From 28de1eebf92af8cf0ef6dddb070793da630fa0db Mon Sep 17 00:00:00 2001 From: Joel Mut Date: Fri, 3 May 2024 15:06:35 -0300 Subject: [PATCH 1/2] Add Recognizers-Text packages to botbuilder-stdlib --- .../botbuilder-repo-utils/src/workspace.ts | 7 +- libraries/botbuilder-stdlib/.gitignore | 1 + libraries/botbuilder-stdlib/package.json | 17 +- .../recognizers-text-choice/README.md | 5 + .../dist/recognizers-text-choice.browser.js | 8772 ++++ .../dist/recognizers-text-choice.es5.js | 8741 ++++ .../dist/recognizers-text-choice.umd.js | 8775 ++++ .../dist/types/choice/chinese/boolean.d.ts | 8 + .../dist/types/choice/choiceRecognizer.d.ts | 11 + .../dist/types/choice/constants.d.ts | 5 + .../dist/types/choice/english/boolean.d.ts | 8 + .../dist/types/choice/extractors.d.ts | 27 + .../dist/types/choice/french/boolean.d.ts | 8 + .../dist/types/choice/german/boolean.d.ts | 8 + .../dist/types/choice/japanese/boolean.d.ts | 8 + .../dist/types/choice/models.d.ts | 13 + .../dist/types/choice/parsers.d.ts | 12 + .../dist/types/choice/portuguese/boolean.d.ts | 8 + .../dist/types/choice/spanish/boolean.d.ts | 8 + .../dist/types/recognizers-text-choice.d.ts | 20 + .../dist/types/resources/chineseChoice.d.ts | 6 + .../dist/types/resources/englishChoice.d.ts | 6 + .../dist/types/resources/frenchChoice.d.ts | 6 + .../dist/types/resources/germanChoice.d.ts | 6 + .../dist/types/resources/japaneseChoice.d.ts | 6 + .../types/resources/portugueseChoice.d.ts | 6 + .../dist/types/resources/spanishChoice.d.ts | 6 + .../recognizers-text-choice/package.json | 31 + ...ext-data-types-timex-expression.browser.js | 1574 + ...rs-text-data-types-timex-expression.es5.js | 1563 + ...rs-text-data-types-timex-expression.umd.js | 1577 + .../package.json | 26 + .../recognizers-text-date-time/README.md | 5 + .../recognizers-text-date-time.browser.js | 35265 ++++++++++++++ .../dist/recognizers-text-date-time.es5.js | 35124 ++++++++++++++ .../dist/recognizers-text-date-time.umd.js | 35268 ++++++++++++++ .../dist/types/dateTime/baseDate.d.ts | 79 + .../dist/types/dateTime/baseDatePeriod.d.ts | 123 + .../dist/types/dateTime/baseDateTime.d.ts | 76 + .../types/dateTime/baseDateTimePeriod.d.ts | 98 + .../dist/types/dateTime/baseDuration.d.ts | 57 + .../dist/types/dateTime/baseHoliday.d.ts | 53 + .../dist/types/dateTime/baseMerged.d.ts | 85 + .../dist/types/dateTime/baseSet.d.ts | 79 + .../dist/types/dateTime/baseTime.d.ts | 46 + .../dist/types/dateTime/baseTimePeriod.d.ts | 62 + .../types/dateTime/chinese/baseDateTime.d.ts | 29 + .../dateTime/chinese/dateConfiguration.d.ts | 26 + .../chinese/datePeriodConfiguration.d.ts | 39 + .../chinese/dateTimeConfiguration.d.ts | 16 + .../chinese/dateTimePeriodConfiguration.d.ts | 34 + .../chinese/durationConfiguration.d.ts | 20 + .../chinese/holidayConfiguration.d.ts | 43 + .../dateTime/chinese/mergedConfiguration.d.ts | 25 + .../dateTime/chinese/setConfiguration.d.ts | 17 + .../dateTime/chinese/timeConfiguration.d.ts | 28 + .../chinese/timePeriodConfiguration.d.ts | 29 + .../dist/types/dateTime/constants.d.ts | 59 + .../types/dateTime/dateTimeRecognizer.d.ts | 15 + .../dateTime/english/baseConfiguration.d.ts | 15 + .../dateTime/english/dateConfiguration.d.ts | 62 + .../english/datePeriodConfiguration.d.ts | 85 + .../english/dateTimeConfiguration.d.ts | 56 + .../english/dateTimePeriodConfiguration.d.ts | 77 + .../english/durationConfiguration.d.ts | 32 + .../english/holidayConfiguration.d.ts | 41 + .../dateTime/english/mergedConfiguration.d.ts | 48 + .../dist/types/dateTime/english/parsers.d.ts | 7 + .../dateTime/english/setConfiguration.d.ts | 59 + .../dateTime/english/timeConfiguration.d.ts | 38 + .../english/timePeriodConfiguration.d.ts | 45 + .../dateTime/french/baseConfiguration.d.ts | 15 + .../dateTime/french/dateConfiguration.d.ts | 60 + .../french/datePeriodConfiguration.d.ts | 92 + .../french/dateTimeConfiguration.d.ts | 61 + .../french/dateTimePeriodConfiguration.d.ts | 88 + .../french/durationConfiguration.d.ts | 32 + .../dateTime/french/holidayConfiguration.d.ts | 44 + .../dateTime/french/mergedConfiguration.d.ts | 48 + .../dateTime/french/setConfiguration.d.ts | 59 + .../dateTime/french/timeConfiguration.d.ts | 34 + .../types/dateTime/french/timeParser.d.ts | 7 + .../french/timePeriodConfiguration.d.ts | 50 + .../dist/types/dateTime/models.d.ts | 16 + .../dist/types/dateTime/parsers.d.ts | 77 + .../dateTime/spanish/baseConfiguration.d.ts | 15 + .../dateTime/spanish/dateConfiguration.d.ts | 62 + .../spanish/datePeriodConfiguration.d.ts | 91 + .../spanish/dateTimeConfiguration.d.ts | 61 + .../spanish/dateTimePeriodConfiguration.d.ts | 84 + .../spanish/dateTimePeriodParser.d.ts | 6 + .../spanish/durationConfiguration.d.ts | 32 + .../spanish/holidayConfiguration.d.ts | 23 + .../dateTime/spanish/mergedConfiguration.d.ts | 48 + .../dateTime/spanish/setConfiguration.d.ts | 59 + .../dateTime/spanish/timeConfiguration.d.ts | 34 + .../spanish/timePeriodConfiguration.d.ts | 50 + .../dist/types/dateTime/utilities.d.ts | 115 + .../types/recognizers-text-date-time.d.ts | 67 + .../dist/types/resources/baseDateTime.d.ts | 14 + .../dist/types/resources/chineseDateTime.d.ts | 162 + .../dist/types/resources/englishDateTime.d.ts | 247 + .../dist/types/resources/frenchDateTime.d.ts | 228 + .../types/resources/portugueseDateTime.d.ts | 209 + .../dist/types/resources/spanishDateTime.d.ts | 208 + .../recognizers-text-date-time/package.json | 31 + .../README.md | 5 + ...cognizers-text-number-with-unit.browser.js | 19049 ++++++++ .../recognizers-text-number-with-unit.es5.js | 18968 ++++++++ .../recognizers-text-number-with-unit.umd.js | 19052 ++++++++ .../types/numberWithUnit/chinese/age.d.ts | 12 + .../types/numberWithUnit/chinese/base.d.ts | 26 + .../numberWithUnit/chinese/currency.d.ts | 12 + .../numberWithUnit/chinese/dimension.d.ts | 12 + .../numberWithUnit/chinese/temperature.d.ts | 12 + .../dist/types/numberWithUnit/constants.d.ts | 15 + .../types/numberWithUnit/english/age.d.ts | 12 + .../types/numberWithUnit/english/base.d.ts | 26 + .../numberWithUnit/english/currency.d.ts | 12 + .../numberWithUnit/english/dimension.d.ts | 12 + .../numberWithUnit/english/temperature.d.ts | 12 + .../dist/types/numberWithUnit/extractors.d.ts | 43 + .../dist/types/numberWithUnit/french/age.d.ts | 12 + .../types/numberWithUnit/french/base.d.ts | 26 + .../types/numberWithUnit/french/currency.d.ts | 12 + .../numberWithUnit/french/dimension.d.ts | 12 + .../numberWithUnit/french/temperature.d.ts | 13 + .../types/numberWithUnit/japanese/age.d.ts | 12 + .../types/numberWithUnit/japanese/base.d.ts | 26 + .../numberWithUnit/japanese/currency.d.ts | 12 + .../dist/types/numberWithUnit/models.d.ts | 26 + .../numberWithUnitRecognizer.d.ts | 17 + .../dist/types/numberWithUnit/parsers.d.ts | 56 + .../types/numberWithUnit/portuguese/age.d.ts | 12 + .../types/numberWithUnit/portuguese/base.d.ts | 26 + .../numberWithUnit/portuguese/currency.d.ts | 12 + .../numberWithUnit/portuguese/dimension.d.ts | 12 + .../portuguese/temperature.d.ts | 12 + .../types/numberWithUnit/spanish/age.d.ts | 12 + .../types/numberWithUnit/spanish/base.d.ts | 26 + .../numberWithUnit/spanish/currency.d.ts | 12 + .../numberWithUnit/spanish/dimension.d.ts | 12 + .../numberWithUnit/spanish/temperature.d.ts | 12 + .../dist/types/numberWithUnit/utilities.d.ts | 4 + .../recognizers-text-number-with-unit.d.ts | 34 + .../dist/types/resources/baseCurrency.d.ts | 4 + .../dist/types/resources/baseNumbers.d.ts | 7 + .../dist/types/resources/baseUnits.d.ts | 7 + .../resources/chineseNumericWithUnit.d.ts | 18 + .../resources/englishNumericWithUnit.d.ts | 23 + .../resources/frenchNumericWithUnit.d.ts | 22 + .../resources/japaneseNumericWithUnit.d.ts | 13 + .../resources/portugueseNumericWithUnit.d.ts | 20 + .../resources/spanishNumericWithUnit.d.ts | 21 + .../package.json | 29 + .../recognizers-text-number/README.md | 5 + .../dist/recognizers-text-number.browser.js | 30858 +++++++++++++ .../dist/recognizers-text-number.es5.js | 30772 +++++++++++++ .../dist/recognizers-text-number.umd.js | 30861 +++++++++++++ .../dist/types/culture.d.ts | 11 + .../types/number/agnosticNumberParser.d.ts | 13 + .../dist/types/number/chinese/extractors.d.ts | 33 + .../number/chinese/parserConfiguration.d.ts | 44 + .../dist/types/number/cjkParsers.d.ts | 42 + .../dist/types/number/constants.d.ts | 10 + .../dist/types/number/english/extractors.d.ts | 31 + .../number/english/parserConfiguration.d.ts | 25 + .../dist/types/number/extractors.d.ts | 31 + .../dist/types/number/french/extractors.d.ts | 30 + .../number/french/parserConfiguration.d.ts | 25 + .../types/number/japanese/extractors.d.ts | 33 + .../number/japanese/parserConfiguration.d.ts | 44 + .../dist/types/number/models.d.ts | 41 + .../dist/types/number/numberRecognizer.d.ts | 16 + .../dist/types/number/parsers.d.ts | 48 + .../types/number/portuguese/extractors.d.ts | 30 + .../portuguese/parserConfiguration.d.ts | 25 + .../dist/types/number/spanish/extractors.d.ts | 30 + .../number/spanish/parserConfiguration.d.ts | 25 + .../dist/types/recognizers-text-number.d.ts | 26 + .../dist/types/resources/baseNumbers.d.ts | 14 + .../dist/types/resources/chineseNumeric.d.ts | 119 + .../dist/types/resources/englishNumeric.d.ts | 106 + .../dist/types/resources/frenchNumeric.d.ts | 110 + .../dist/types/resources/japaneseNumeric.d.ts | 129 + .../types/resources/portugueseNumeric.d.ts | 113 + .../dist/types/resources/spanishNumeric.d.ts | 113 + .../recognizers-text-number/package.json | 29 + .../recognizers-text-sequence/README.md | 5 + .../dist/recognizers-text-sequence.browser.js | 7324 +++ .../dist/recognizers-text-sequence.es5.js | 7269 +++ .../dist/recognizers-text-sequence.umd.js | 7327 +++ .../dist/types/recognizers-text-sequence.d.ts | 14 + .../dist/types/resources/baseEmail.d.ts | 8 + .../dist/types/resources/baseGUID.d.ts | 4 + .../dist/types/resources/baseHashtag.d.ts | 3 + .../dist/types/resources/baseIp.d.ts | 16 + .../dist/types/resources/baseMention.d.ts | 3 + .../types/resources/basePhoneNumbers.d.ts | 19 + .../dist/types/resources/baseURL.d.ts | 11 + .../dist/types/sequence/constants.d.ts | 20 + .../types/sequence/english/extractors.d.ts | 17 + .../dist/types/sequence/english/parsers.d.ts | 38 + .../dist/types/sequence/extractors.d.ts | 37 + .../dist/types/sequence/models.d.ts | 31 + .../dist/types/sequence/parsers.d.ts | 8 + .../types/sequence/sequenceRecognizer.d.ts | 23 + .../recognizers-text-sequence/package.json | 30 + .../recognizers-text-suite/README.md | 221 + .../dist/recognizers-text-suite.browser.js | 38292 +++++++++++++++ .../dist/recognizers-text-suite.es5.js | 38264 +++++++++++++++ .../dist/recognizers-text-suite.umd.js | 38295 ++++++++++++++++ .../dist/types/recognizers-text-suite.d.ts | 5 + .../recognizers-text-suite/package.json | 31 + .../@microsoft/recognizers-text/README.md | 5 + .../recognizers-text/compiled/culture.js | 57 + .../recognizers-text/compiled/extractors.js | 21 + .../recognizers-text/compiled/models.js | 94 + .../recognizers-text/compiled/parsers.js | 18 + .../recognizers-text/compiled/recognizer.js | 27 + .../compiled/recognizers-text.js | 20 + .../recognizers-text/compiled/utilities.js | 1041 + .../dist/recognizers-text.browser.js | 6387 +++ .../dist/recognizers-text.es5.js | 6370 +++ .../dist/recognizers-text.umd.js | 6390 +++ .../recognizers-text/dist/types/culture.d.ts | 22 + .../dist/types/extractors.d.ts | 13 + .../recognizers-text/dist/types/models.d.ts | 33 + .../recognizers-text/dist/types/parsers.d.ts | 9 + .../dist/types/recognizer.d.ts | 12 + .../dist/types/recognizers-text.d.ts | 6 + .../dist/types/utilities.d.ts | 43 + .../@microsoft/recognizers-text/package.json | 28 + libraries/botbuilder-stdlib/vendors/README.md | 3 + 234 files changed, 450775 insertions(+), 4 deletions(-) create mode 100644 libraries/botbuilder-stdlib/vendors/@microsoft/recognizers-text-choice/README.md create mode 100644 libraries/botbuilder-stdlib/vendors/@microsoft/recognizers-text-choice/dist/recognizers-text-choice.browser.js create mode 100644 libraries/botbuilder-stdlib/vendors/@microsoft/recognizers-text-choice/dist/recognizers-text-choice.es5.js create mode 100644 libraries/botbuilder-stdlib/vendors/@microsoft/recognizers-text-choice/dist/recognizers-text-choice.umd.js create mode 100644 libraries/botbuilder-stdlib/vendors/@microsoft/recognizers-text-choice/dist/types/choice/chinese/boolean.d.ts create mode 100644 libraries/botbuilder-stdlib/vendors/@microsoft/recognizers-text-choice/dist/types/choice/choiceRecognizer.d.ts create mode 100644 libraries/botbuilder-stdlib/vendors/@microsoft/recognizers-text-choice/dist/types/choice/constants.d.ts create mode 100644 libraries/botbuilder-stdlib/vendors/@microsoft/recognizers-text-choice/dist/types/choice/english/boolean.d.ts create mode 100644 libraries/botbuilder-stdlib/vendors/@microsoft/recognizers-text-choice/dist/types/choice/extractors.d.ts create mode 100644 libraries/botbuilder-stdlib/vendors/@microsoft/recognizers-text-choice/dist/types/choice/french/boolean.d.ts create mode 100644 libraries/botbuilder-stdlib/vendors/@microsoft/recognizers-text-choice/dist/types/choice/german/boolean.d.ts create mode 100644 libraries/botbuilder-stdlib/vendors/@microsoft/recognizers-text-choice/dist/types/choice/japanese/boolean.d.ts create mode 100644 libraries/botbuilder-stdlib/vendors/@microsoft/recognizers-text-choice/dist/types/choice/models.d.ts create mode 100644 libraries/botbuilder-stdlib/vendors/@microsoft/recognizers-text-choice/dist/types/choice/parsers.d.ts create mode 100644 libraries/botbuilder-stdlib/vendors/@microsoft/recognizers-text-choice/dist/types/choice/portuguese/boolean.d.ts create mode 100644 libraries/botbuilder-stdlib/vendors/@microsoft/recognizers-text-choice/dist/types/choice/spanish/boolean.d.ts create mode 100644 libraries/botbuilder-stdlib/vendors/@microsoft/recognizers-text-choice/dist/types/recognizers-text-choice.d.ts create mode 100644 libraries/botbuilder-stdlib/vendors/@microsoft/recognizers-text-choice/dist/types/resources/chineseChoice.d.ts create mode 100644 libraries/botbuilder-stdlib/vendors/@microsoft/recognizers-text-choice/dist/types/resources/englishChoice.d.ts create mode 100644 libraries/botbuilder-stdlib/vendors/@microsoft/recognizers-text-choice/dist/types/resources/frenchChoice.d.ts create mode 100644 libraries/botbuilder-stdlib/vendors/@microsoft/recognizers-text-choice/dist/types/resources/germanChoice.d.ts create mode 100644 libraries/botbuilder-stdlib/vendors/@microsoft/recognizers-text-choice/dist/types/resources/japaneseChoice.d.ts create mode 100644 libraries/botbuilder-stdlib/vendors/@microsoft/recognizers-text-choice/dist/types/resources/portugueseChoice.d.ts create mode 100644 libraries/botbuilder-stdlib/vendors/@microsoft/recognizers-text-choice/dist/types/resources/spanishChoice.d.ts create mode 100644 libraries/botbuilder-stdlib/vendors/@microsoft/recognizers-text-choice/package.json create mode 100644 libraries/botbuilder-stdlib/vendors/@microsoft/recognizers-text-data-types-timex-expression/dist/recognizers-text-data-types-timex-expression.browser.js create mode 100644 libraries/botbuilder-stdlib/vendors/@microsoft/recognizers-text-data-types-timex-expression/dist/recognizers-text-data-types-timex-expression.es5.js create mode 100644 libraries/botbuilder-stdlib/vendors/@microsoft/recognizers-text-data-types-timex-expression/dist/recognizers-text-data-types-timex-expression.umd.js create mode 100644 libraries/botbuilder-stdlib/vendors/@microsoft/recognizers-text-data-types-timex-expression/package.json create mode 100644 libraries/botbuilder-stdlib/vendors/@microsoft/recognizers-text-date-time/README.md create mode 100644 libraries/botbuilder-stdlib/vendors/@microsoft/recognizers-text-date-time/dist/recognizers-text-date-time.browser.js create mode 100644 libraries/botbuilder-stdlib/vendors/@microsoft/recognizers-text-date-time/dist/recognizers-text-date-time.es5.js create mode 100644 libraries/botbuilder-stdlib/vendors/@microsoft/recognizers-text-date-time/dist/recognizers-text-date-time.umd.js create mode 100644 libraries/botbuilder-stdlib/vendors/@microsoft/recognizers-text-date-time/dist/types/dateTime/baseDate.d.ts create mode 100644 libraries/botbuilder-stdlib/vendors/@microsoft/recognizers-text-date-time/dist/types/dateTime/baseDatePeriod.d.ts create mode 100644 libraries/botbuilder-stdlib/vendors/@microsoft/recognizers-text-date-time/dist/types/dateTime/baseDateTime.d.ts create mode 100644 libraries/botbuilder-stdlib/vendors/@microsoft/recognizers-text-date-time/dist/types/dateTime/baseDateTimePeriod.d.ts create mode 100644 libraries/botbuilder-stdlib/vendors/@microsoft/recognizers-text-date-time/dist/types/dateTime/baseDuration.d.ts create mode 100644 libraries/botbuilder-stdlib/vendors/@microsoft/recognizers-text-date-time/dist/types/dateTime/baseHoliday.d.ts create mode 100644 libraries/botbuilder-stdlib/vendors/@microsoft/recognizers-text-date-time/dist/types/dateTime/baseMerged.d.ts create mode 100644 libraries/botbuilder-stdlib/vendors/@microsoft/recognizers-text-date-time/dist/types/dateTime/baseSet.d.ts create mode 100644 libraries/botbuilder-stdlib/vendors/@microsoft/recognizers-text-date-time/dist/types/dateTime/baseTime.d.ts create mode 100644 libraries/botbuilder-stdlib/vendors/@microsoft/recognizers-text-date-time/dist/types/dateTime/baseTimePeriod.d.ts create mode 100644 libraries/botbuilder-stdlib/vendors/@microsoft/recognizers-text-date-time/dist/types/dateTime/chinese/baseDateTime.d.ts create mode 100644 libraries/botbuilder-stdlib/vendors/@microsoft/recognizers-text-date-time/dist/types/dateTime/chinese/dateConfiguration.d.ts create mode 100644 libraries/botbuilder-stdlib/vendors/@microsoft/recognizers-text-date-time/dist/types/dateTime/chinese/datePeriodConfiguration.d.ts create mode 100644 libraries/botbuilder-stdlib/vendors/@microsoft/recognizers-text-date-time/dist/types/dateTime/chinese/dateTimeConfiguration.d.ts create mode 100644 libraries/botbuilder-stdlib/vendors/@microsoft/recognizers-text-date-time/dist/types/dateTime/chinese/dateTimePeriodConfiguration.d.ts create mode 100644 libraries/botbuilder-stdlib/vendors/@microsoft/recognizers-text-date-time/dist/types/dateTime/chinese/durationConfiguration.d.ts create mode 100644 libraries/botbuilder-stdlib/vendors/@microsoft/recognizers-text-date-time/dist/types/dateTime/chinese/holidayConfiguration.d.ts create mode 100644 libraries/botbuilder-stdlib/vendors/@microsoft/recognizers-text-date-time/dist/types/dateTime/chinese/mergedConfiguration.d.ts create mode 100644 libraries/botbuilder-stdlib/vendors/@microsoft/recognizers-text-date-time/dist/types/dateTime/chinese/setConfiguration.d.ts create mode 100644 libraries/botbuilder-stdlib/vendors/@microsoft/recognizers-text-date-time/dist/types/dateTime/chinese/timeConfiguration.d.ts create mode 100644 libraries/botbuilder-stdlib/vendors/@microsoft/recognizers-text-date-time/dist/types/dateTime/chinese/timePeriodConfiguration.d.ts create mode 100644 libraries/botbuilder-stdlib/vendors/@microsoft/recognizers-text-date-time/dist/types/dateTime/constants.d.ts create mode 100644 libraries/botbuilder-stdlib/vendors/@microsoft/recognizers-text-date-time/dist/types/dateTime/dateTimeRecognizer.d.ts create mode 100644 libraries/botbuilder-stdlib/vendors/@microsoft/recognizers-text-date-time/dist/types/dateTime/english/baseConfiguration.d.ts create mode 100644 libraries/botbuilder-stdlib/vendors/@microsoft/recognizers-text-date-time/dist/types/dateTime/english/dateConfiguration.d.ts create mode 100644 libraries/botbuilder-stdlib/vendors/@microsoft/recognizers-text-date-time/dist/types/dateTime/english/datePeriodConfiguration.d.ts create mode 100644 libraries/botbuilder-stdlib/vendors/@microsoft/recognizers-text-date-time/dist/types/dateTime/english/dateTimeConfiguration.d.ts create mode 100644 libraries/botbuilder-stdlib/vendors/@microsoft/recognizers-text-date-time/dist/types/dateTime/english/dateTimePeriodConfiguration.d.ts create mode 100644 libraries/botbuilder-stdlib/vendors/@microsoft/recognizers-text-date-time/dist/types/dateTime/english/durationConfiguration.d.ts create mode 100644 libraries/botbuilder-stdlib/vendors/@microsoft/recognizers-text-date-time/dist/types/dateTime/english/holidayConfiguration.d.ts create mode 100644 libraries/botbuilder-stdlib/vendors/@microsoft/recognizers-text-date-time/dist/types/dateTime/english/mergedConfiguration.d.ts create mode 100644 libraries/botbuilder-stdlib/vendors/@microsoft/recognizers-text-date-time/dist/types/dateTime/english/parsers.d.ts create mode 100644 libraries/botbuilder-stdlib/vendors/@microsoft/recognizers-text-date-time/dist/types/dateTime/english/setConfiguration.d.ts create mode 100644 libraries/botbuilder-stdlib/vendors/@microsoft/recognizers-text-date-time/dist/types/dateTime/english/timeConfiguration.d.ts create mode 100644 libraries/botbuilder-stdlib/vendors/@microsoft/recognizers-text-date-time/dist/types/dateTime/english/timePeriodConfiguration.d.ts create mode 100644 libraries/botbuilder-stdlib/vendors/@microsoft/recognizers-text-date-time/dist/types/dateTime/french/baseConfiguration.d.ts create mode 100644 libraries/botbuilder-stdlib/vendors/@microsoft/recognizers-text-date-time/dist/types/dateTime/french/dateConfiguration.d.ts create mode 100644 libraries/botbuilder-stdlib/vendors/@microsoft/recognizers-text-date-time/dist/types/dateTime/french/datePeriodConfiguration.d.ts create mode 100644 libraries/botbuilder-stdlib/vendors/@microsoft/recognizers-text-date-time/dist/types/dateTime/french/dateTimeConfiguration.d.ts create mode 100644 libraries/botbuilder-stdlib/vendors/@microsoft/recognizers-text-date-time/dist/types/dateTime/french/dateTimePeriodConfiguration.d.ts create mode 100644 libraries/botbuilder-stdlib/vendors/@microsoft/recognizers-text-date-time/dist/types/dateTime/french/durationConfiguration.d.ts create mode 100644 libraries/botbuilder-stdlib/vendors/@microsoft/recognizers-text-date-time/dist/types/dateTime/french/holidayConfiguration.d.ts create mode 100644 libraries/botbuilder-stdlib/vendors/@microsoft/recognizers-text-date-time/dist/types/dateTime/french/mergedConfiguration.d.ts create mode 100644 libraries/botbuilder-stdlib/vendors/@microsoft/recognizers-text-date-time/dist/types/dateTime/french/setConfiguration.d.ts create mode 100644 libraries/botbuilder-stdlib/vendors/@microsoft/recognizers-text-date-time/dist/types/dateTime/french/timeConfiguration.d.ts create mode 100644 libraries/botbuilder-stdlib/vendors/@microsoft/recognizers-text-date-time/dist/types/dateTime/french/timeParser.d.ts create mode 100644 libraries/botbuilder-stdlib/vendors/@microsoft/recognizers-text-date-time/dist/types/dateTime/french/timePeriodConfiguration.d.ts create mode 100644 libraries/botbuilder-stdlib/vendors/@microsoft/recognizers-text-date-time/dist/types/dateTime/models.d.ts create mode 100644 libraries/botbuilder-stdlib/vendors/@microsoft/recognizers-text-date-time/dist/types/dateTime/parsers.d.ts create mode 100644 libraries/botbuilder-stdlib/vendors/@microsoft/recognizers-text-date-time/dist/types/dateTime/spanish/baseConfiguration.d.ts create mode 100644 libraries/botbuilder-stdlib/vendors/@microsoft/recognizers-text-date-time/dist/types/dateTime/spanish/dateConfiguration.d.ts create mode 100644 libraries/botbuilder-stdlib/vendors/@microsoft/recognizers-text-date-time/dist/types/dateTime/spanish/datePeriodConfiguration.d.ts create mode 100644 libraries/botbuilder-stdlib/vendors/@microsoft/recognizers-text-date-time/dist/types/dateTime/spanish/dateTimeConfiguration.d.ts create mode 100644 libraries/botbuilder-stdlib/vendors/@microsoft/recognizers-text-date-time/dist/types/dateTime/spanish/dateTimePeriodConfiguration.d.ts create mode 100644 libraries/botbuilder-stdlib/vendors/@microsoft/recognizers-text-date-time/dist/types/dateTime/spanish/dateTimePeriodParser.d.ts create mode 100644 libraries/botbuilder-stdlib/vendors/@microsoft/recognizers-text-date-time/dist/types/dateTime/spanish/durationConfiguration.d.ts create mode 100644 libraries/botbuilder-stdlib/vendors/@microsoft/recognizers-text-date-time/dist/types/dateTime/spanish/holidayConfiguration.d.ts create mode 100644 libraries/botbuilder-stdlib/vendors/@microsoft/recognizers-text-date-time/dist/types/dateTime/spanish/mergedConfiguration.d.ts create mode 100644 libraries/botbuilder-stdlib/vendors/@microsoft/recognizers-text-date-time/dist/types/dateTime/spanish/setConfiguration.d.ts create mode 100644 libraries/botbuilder-stdlib/vendors/@microsoft/recognizers-text-date-time/dist/types/dateTime/spanish/timeConfiguration.d.ts create mode 100644 libraries/botbuilder-stdlib/vendors/@microsoft/recognizers-text-date-time/dist/types/dateTime/spanish/timePeriodConfiguration.d.ts create mode 100644 libraries/botbuilder-stdlib/vendors/@microsoft/recognizers-text-date-time/dist/types/dateTime/utilities.d.ts create mode 100644 libraries/botbuilder-stdlib/vendors/@microsoft/recognizers-text-date-time/dist/types/recognizers-text-date-time.d.ts create mode 100644 libraries/botbuilder-stdlib/vendors/@microsoft/recognizers-text-date-time/dist/types/resources/baseDateTime.d.ts create mode 100644 libraries/botbuilder-stdlib/vendors/@microsoft/recognizers-text-date-time/dist/types/resources/chineseDateTime.d.ts create mode 100644 libraries/botbuilder-stdlib/vendors/@microsoft/recognizers-text-date-time/dist/types/resources/englishDateTime.d.ts create mode 100644 libraries/botbuilder-stdlib/vendors/@microsoft/recognizers-text-date-time/dist/types/resources/frenchDateTime.d.ts create mode 100644 libraries/botbuilder-stdlib/vendors/@microsoft/recognizers-text-date-time/dist/types/resources/portugueseDateTime.d.ts create mode 100644 libraries/botbuilder-stdlib/vendors/@microsoft/recognizers-text-date-time/dist/types/resources/spanishDateTime.d.ts create mode 100644 libraries/botbuilder-stdlib/vendors/@microsoft/recognizers-text-date-time/package.json create mode 100644 libraries/botbuilder-stdlib/vendors/@microsoft/recognizers-text-number-with-unit/README.md create mode 100644 libraries/botbuilder-stdlib/vendors/@microsoft/recognizers-text-number-with-unit/dist/recognizers-text-number-with-unit.browser.js create mode 100644 libraries/botbuilder-stdlib/vendors/@microsoft/recognizers-text-number-with-unit/dist/recognizers-text-number-with-unit.es5.js create mode 100644 libraries/botbuilder-stdlib/vendors/@microsoft/recognizers-text-number-with-unit/dist/recognizers-text-number-with-unit.umd.js create mode 100644 libraries/botbuilder-stdlib/vendors/@microsoft/recognizers-text-number-with-unit/dist/types/numberWithUnit/chinese/age.d.ts create mode 100644 libraries/botbuilder-stdlib/vendors/@microsoft/recognizers-text-number-with-unit/dist/types/numberWithUnit/chinese/base.d.ts create mode 100644 libraries/botbuilder-stdlib/vendors/@microsoft/recognizers-text-number-with-unit/dist/types/numberWithUnit/chinese/currency.d.ts create mode 100644 libraries/botbuilder-stdlib/vendors/@microsoft/recognizers-text-number-with-unit/dist/types/numberWithUnit/chinese/dimension.d.ts create mode 100644 libraries/botbuilder-stdlib/vendors/@microsoft/recognizers-text-number-with-unit/dist/types/numberWithUnit/chinese/temperature.d.ts create mode 100644 libraries/botbuilder-stdlib/vendors/@microsoft/recognizers-text-number-with-unit/dist/types/numberWithUnit/constants.d.ts create mode 100644 libraries/botbuilder-stdlib/vendors/@microsoft/recognizers-text-number-with-unit/dist/types/numberWithUnit/english/age.d.ts create mode 100644 libraries/botbuilder-stdlib/vendors/@microsoft/recognizers-text-number-with-unit/dist/types/numberWithUnit/english/base.d.ts create mode 100644 libraries/botbuilder-stdlib/vendors/@microsoft/recognizers-text-number-with-unit/dist/types/numberWithUnit/english/currency.d.ts create mode 100644 libraries/botbuilder-stdlib/vendors/@microsoft/recognizers-text-number-with-unit/dist/types/numberWithUnit/english/dimension.d.ts create mode 100644 libraries/botbuilder-stdlib/vendors/@microsoft/recognizers-text-number-with-unit/dist/types/numberWithUnit/english/temperature.d.ts create mode 100644 libraries/botbuilder-stdlib/vendors/@microsoft/recognizers-text-number-with-unit/dist/types/numberWithUnit/extractors.d.ts create mode 100644 libraries/botbuilder-stdlib/vendors/@microsoft/recognizers-text-number-with-unit/dist/types/numberWithUnit/french/age.d.ts create mode 100644 libraries/botbuilder-stdlib/vendors/@microsoft/recognizers-text-number-with-unit/dist/types/numberWithUnit/french/base.d.ts create mode 100644 libraries/botbuilder-stdlib/vendors/@microsoft/recognizers-text-number-with-unit/dist/types/numberWithUnit/french/currency.d.ts create mode 100644 libraries/botbuilder-stdlib/vendors/@microsoft/recognizers-text-number-with-unit/dist/types/numberWithUnit/french/dimension.d.ts create mode 100644 libraries/botbuilder-stdlib/vendors/@microsoft/recognizers-text-number-with-unit/dist/types/numberWithUnit/french/temperature.d.ts create mode 100644 libraries/botbuilder-stdlib/vendors/@microsoft/recognizers-text-number-with-unit/dist/types/numberWithUnit/japanese/age.d.ts create mode 100644 libraries/botbuilder-stdlib/vendors/@microsoft/recognizers-text-number-with-unit/dist/types/numberWithUnit/japanese/base.d.ts create mode 100644 libraries/botbuilder-stdlib/vendors/@microsoft/recognizers-text-number-with-unit/dist/types/numberWithUnit/japanese/currency.d.ts create mode 100644 libraries/botbuilder-stdlib/vendors/@microsoft/recognizers-text-number-with-unit/dist/types/numberWithUnit/models.d.ts create mode 100644 libraries/botbuilder-stdlib/vendors/@microsoft/recognizers-text-number-with-unit/dist/types/numberWithUnit/numberWithUnitRecognizer.d.ts create mode 100644 libraries/botbuilder-stdlib/vendors/@microsoft/recognizers-text-number-with-unit/dist/types/numberWithUnit/parsers.d.ts create mode 100644 libraries/botbuilder-stdlib/vendors/@microsoft/recognizers-text-number-with-unit/dist/types/numberWithUnit/portuguese/age.d.ts create mode 100644 libraries/botbuilder-stdlib/vendors/@microsoft/recognizers-text-number-with-unit/dist/types/numberWithUnit/portuguese/base.d.ts create mode 100644 libraries/botbuilder-stdlib/vendors/@microsoft/recognizers-text-number-with-unit/dist/types/numberWithUnit/portuguese/currency.d.ts create mode 100644 libraries/botbuilder-stdlib/vendors/@microsoft/recognizers-text-number-with-unit/dist/types/numberWithUnit/portuguese/dimension.d.ts create mode 100644 libraries/botbuilder-stdlib/vendors/@microsoft/recognizers-text-number-with-unit/dist/types/numberWithUnit/portuguese/temperature.d.ts create mode 100644 libraries/botbuilder-stdlib/vendors/@microsoft/recognizers-text-number-with-unit/dist/types/numberWithUnit/spanish/age.d.ts create mode 100644 libraries/botbuilder-stdlib/vendors/@microsoft/recognizers-text-number-with-unit/dist/types/numberWithUnit/spanish/base.d.ts create mode 100644 libraries/botbuilder-stdlib/vendors/@microsoft/recognizers-text-number-with-unit/dist/types/numberWithUnit/spanish/currency.d.ts create mode 100644 libraries/botbuilder-stdlib/vendors/@microsoft/recognizers-text-number-with-unit/dist/types/numberWithUnit/spanish/dimension.d.ts create mode 100644 libraries/botbuilder-stdlib/vendors/@microsoft/recognizers-text-number-with-unit/dist/types/numberWithUnit/spanish/temperature.d.ts create mode 100644 libraries/botbuilder-stdlib/vendors/@microsoft/recognizers-text-number-with-unit/dist/types/numberWithUnit/utilities.d.ts create mode 100644 libraries/botbuilder-stdlib/vendors/@microsoft/recognizers-text-number-with-unit/dist/types/recognizers-text-number-with-unit.d.ts create mode 100644 libraries/botbuilder-stdlib/vendors/@microsoft/recognizers-text-number-with-unit/dist/types/resources/baseCurrency.d.ts create mode 100644 libraries/botbuilder-stdlib/vendors/@microsoft/recognizers-text-number-with-unit/dist/types/resources/baseNumbers.d.ts create mode 100644 libraries/botbuilder-stdlib/vendors/@microsoft/recognizers-text-number-with-unit/dist/types/resources/baseUnits.d.ts create mode 100644 libraries/botbuilder-stdlib/vendors/@microsoft/recognizers-text-number-with-unit/dist/types/resources/chineseNumericWithUnit.d.ts create mode 100644 libraries/botbuilder-stdlib/vendors/@microsoft/recognizers-text-number-with-unit/dist/types/resources/englishNumericWithUnit.d.ts create mode 100644 libraries/botbuilder-stdlib/vendors/@microsoft/recognizers-text-number-with-unit/dist/types/resources/frenchNumericWithUnit.d.ts create mode 100644 libraries/botbuilder-stdlib/vendors/@microsoft/recognizers-text-number-with-unit/dist/types/resources/japaneseNumericWithUnit.d.ts create mode 100644 libraries/botbuilder-stdlib/vendors/@microsoft/recognizers-text-number-with-unit/dist/types/resources/portugueseNumericWithUnit.d.ts create mode 100644 libraries/botbuilder-stdlib/vendors/@microsoft/recognizers-text-number-with-unit/dist/types/resources/spanishNumericWithUnit.d.ts create mode 100644 libraries/botbuilder-stdlib/vendors/@microsoft/recognizers-text-number-with-unit/package.json create mode 100644 libraries/botbuilder-stdlib/vendors/@microsoft/recognizers-text-number/README.md create mode 100644 libraries/botbuilder-stdlib/vendors/@microsoft/recognizers-text-number/dist/recognizers-text-number.browser.js create mode 100644 libraries/botbuilder-stdlib/vendors/@microsoft/recognizers-text-number/dist/recognizers-text-number.es5.js create mode 100644 libraries/botbuilder-stdlib/vendors/@microsoft/recognizers-text-number/dist/recognizers-text-number.umd.js create mode 100644 libraries/botbuilder-stdlib/vendors/@microsoft/recognizers-text-number/dist/types/culture.d.ts create mode 100644 libraries/botbuilder-stdlib/vendors/@microsoft/recognizers-text-number/dist/types/number/agnosticNumberParser.d.ts create mode 100644 libraries/botbuilder-stdlib/vendors/@microsoft/recognizers-text-number/dist/types/number/chinese/extractors.d.ts create mode 100644 libraries/botbuilder-stdlib/vendors/@microsoft/recognizers-text-number/dist/types/number/chinese/parserConfiguration.d.ts create mode 100644 libraries/botbuilder-stdlib/vendors/@microsoft/recognizers-text-number/dist/types/number/cjkParsers.d.ts create mode 100644 libraries/botbuilder-stdlib/vendors/@microsoft/recognizers-text-number/dist/types/number/constants.d.ts create mode 100644 libraries/botbuilder-stdlib/vendors/@microsoft/recognizers-text-number/dist/types/number/english/extractors.d.ts create mode 100644 libraries/botbuilder-stdlib/vendors/@microsoft/recognizers-text-number/dist/types/number/english/parserConfiguration.d.ts create mode 100644 libraries/botbuilder-stdlib/vendors/@microsoft/recognizers-text-number/dist/types/number/extractors.d.ts create mode 100644 libraries/botbuilder-stdlib/vendors/@microsoft/recognizers-text-number/dist/types/number/french/extractors.d.ts create mode 100644 libraries/botbuilder-stdlib/vendors/@microsoft/recognizers-text-number/dist/types/number/french/parserConfiguration.d.ts create mode 100644 libraries/botbuilder-stdlib/vendors/@microsoft/recognizers-text-number/dist/types/number/japanese/extractors.d.ts create mode 100644 libraries/botbuilder-stdlib/vendors/@microsoft/recognizers-text-number/dist/types/number/japanese/parserConfiguration.d.ts create mode 100644 libraries/botbuilder-stdlib/vendors/@microsoft/recognizers-text-number/dist/types/number/models.d.ts create mode 100644 libraries/botbuilder-stdlib/vendors/@microsoft/recognizers-text-number/dist/types/number/numberRecognizer.d.ts create mode 100644 libraries/botbuilder-stdlib/vendors/@microsoft/recognizers-text-number/dist/types/number/parsers.d.ts create mode 100644 libraries/botbuilder-stdlib/vendors/@microsoft/recognizers-text-number/dist/types/number/portuguese/extractors.d.ts create mode 100644 libraries/botbuilder-stdlib/vendors/@microsoft/recognizers-text-number/dist/types/number/portuguese/parserConfiguration.d.ts create mode 100644 libraries/botbuilder-stdlib/vendors/@microsoft/recognizers-text-number/dist/types/number/spanish/extractors.d.ts create mode 100644 libraries/botbuilder-stdlib/vendors/@microsoft/recognizers-text-number/dist/types/number/spanish/parserConfiguration.d.ts create mode 100644 libraries/botbuilder-stdlib/vendors/@microsoft/recognizers-text-number/dist/types/recognizers-text-number.d.ts create mode 100644 libraries/botbuilder-stdlib/vendors/@microsoft/recognizers-text-number/dist/types/resources/baseNumbers.d.ts create mode 100644 libraries/botbuilder-stdlib/vendors/@microsoft/recognizers-text-number/dist/types/resources/chineseNumeric.d.ts create mode 100644 libraries/botbuilder-stdlib/vendors/@microsoft/recognizers-text-number/dist/types/resources/englishNumeric.d.ts create mode 100644 libraries/botbuilder-stdlib/vendors/@microsoft/recognizers-text-number/dist/types/resources/frenchNumeric.d.ts create mode 100644 libraries/botbuilder-stdlib/vendors/@microsoft/recognizers-text-number/dist/types/resources/japaneseNumeric.d.ts create mode 100644 libraries/botbuilder-stdlib/vendors/@microsoft/recognizers-text-number/dist/types/resources/portugueseNumeric.d.ts create mode 100644 libraries/botbuilder-stdlib/vendors/@microsoft/recognizers-text-number/dist/types/resources/spanishNumeric.d.ts create mode 100644 libraries/botbuilder-stdlib/vendors/@microsoft/recognizers-text-number/package.json create mode 100644 libraries/botbuilder-stdlib/vendors/@microsoft/recognizers-text-sequence/README.md create mode 100644 libraries/botbuilder-stdlib/vendors/@microsoft/recognizers-text-sequence/dist/recognizers-text-sequence.browser.js create mode 100644 libraries/botbuilder-stdlib/vendors/@microsoft/recognizers-text-sequence/dist/recognizers-text-sequence.es5.js create mode 100644 libraries/botbuilder-stdlib/vendors/@microsoft/recognizers-text-sequence/dist/recognizers-text-sequence.umd.js create mode 100644 libraries/botbuilder-stdlib/vendors/@microsoft/recognizers-text-sequence/dist/types/recognizers-text-sequence.d.ts create mode 100644 libraries/botbuilder-stdlib/vendors/@microsoft/recognizers-text-sequence/dist/types/resources/baseEmail.d.ts create mode 100644 libraries/botbuilder-stdlib/vendors/@microsoft/recognizers-text-sequence/dist/types/resources/baseGUID.d.ts create mode 100644 libraries/botbuilder-stdlib/vendors/@microsoft/recognizers-text-sequence/dist/types/resources/baseHashtag.d.ts create mode 100644 libraries/botbuilder-stdlib/vendors/@microsoft/recognizers-text-sequence/dist/types/resources/baseIp.d.ts create mode 100644 libraries/botbuilder-stdlib/vendors/@microsoft/recognizers-text-sequence/dist/types/resources/baseMention.d.ts create mode 100644 libraries/botbuilder-stdlib/vendors/@microsoft/recognizers-text-sequence/dist/types/resources/basePhoneNumbers.d.ts create mode 100644 libraries/botbuilder-stdlib/vendors/@microsoft/recognizers-text-sequence/dist/types/resources/baseURL.d.ts create mode 100644 libraries/botbuilder-stdlib/vendors/@microsoft/recognizers-text-sequence/dist/types/sequence/constants.d.ts create mode 100644 libraries/botbuilder-stdlib/vendors/@microsoft/recognizers-text-sequence/dist/types/sequence/english/extractors.d.ts create mode 100644 libraries/botbuilder-stdlib/vendors/@microsoft/recognizers-text-sequence/dist/types/sequence/english/parsers.d.ts create mode 100644 libraries/botbuilder-stdlib/vendors/@microsoft/recognizers-text-sequence/dist/types/sequence/extractors.d.ts create mode 100644 libraries/botbuilder-stdlib/vendors/@microsoft/recognizers-text-sequence/dist/types/sequence/models.d.ts create mode 100644 libraries/botbuilder-stdlib/vendors/@microsoft/recognizers-text-sequence/dist/types/sequence/parsers.d.ts create mode 100644 libraries/botbuilder-stdlib/vendors/@microsoft/recognizers-text-sequence/dist/types/sequence/sequenceRecognizer.d.ts create mode 100644 libraries/botbuilder-stdlib/vendors/@microsoft/recognizers-text-sequence/package.json create mode 100644 libraries/botbuilder-stdlib/vendors/@microsoft/recognizers-text-suite/README.md create mode 100644 libraries/botbuilder-stdlib/vendors/@microsoft/recognizers-text-suite/dist/recognizers-text-suite.browser.js create mode 100644 libraries/botbuilder-stdlib/vendors/@microsoft/recognizers-text-suite/dist/recognizers-text-suite.es5.js create mode 100644 libraries/botbuilder-stdlib/vendors/@microsoft/recognizers-text-suite/dist/recognizers-text-suite.umd.js create mode 100644 libraries/botbuilder-stdlib/vendors/@microsoft/recognizers-text-suite/dist/types/recognizers-text-suite.d.ts create mode 100644 libraries/botbuilder-stdlib/vendors/@microsoft/recognizers-text-suite/package.json create mode 100644 libraries/botbuilder-stdlib/vendors/@microsoft/recognizers-text/README.md create mode 100644 libraries/botbuilder-stdlib/vendors/@microsoft/recognizers-text/compiled/culture.js create mode 100644 libraries/botbuilder-stdlib/vendors/@microsoft/recognizers-text/compiled/extractors.js create mode 100644 libraries/botbuilder-stdlib/vendors/@microsoft/recognizers-text/compiled/models.js create mode 100644 libraries/botbuilder-stdlib/vendors/@microsoft/recognizers-text/compiled/parsers.js create mode 100644 libraries/botbuilder-stdlib/vendors/@microsoft/recognizers-text/compiled/recognizer.js create mode 100644 libraries/botbuilder-stdlib/vendors/@microsoft/recognizers-text/compiled/recognizers-text.js create mode 100644 libraries/botbuilder-stdlib/vendors/@microsoft/recognizers-text/compiled/utilities.js create mode 100644 libraries/botbuilder-stdlib/vendors/@microsoft/recognizers-text/dist/recognizers-text.browser.js create mode 100644 libraries/botbuilder-stdlib/vendors/@microsoft/recognizers-text/dist/recognizers-text.es5.js create mode 100644 libraries/botbuilder-stdlib/vendors/@microsoft/recognizers-text/dist/recognizers-text.umd.js create mode 100644 libraries/botbuilder-stdlib/vendors/@microsoft/recognizers-text/dist/types/culture.d.ts create mode 100644 libraries/botbuilder-stdlib/vendors/@microsoft/recognizers-text/dist/types/extractors.d.ts create mode 100644 libraries/botbuilder-stdlib/vendors/@microsoft/recognizers-text/dist/types/models.d.ts create mode 100644 libraries/botbuilder-stdlib/vendors/@microsoft/recognizers-text/dist/types/parsers.d.ts create mode 100644 libraries/botbuilder-stdlib/vendors/@microsoft/recognizers-text/dist/types/recognizer.d.ts create mode 100644 libraries/botbuilder-stdlib/vendors/@microsoft/recognizers-text/dist/types/recognizers-text.d.ts create mode 100644 libraries/botbuilder-stdlib/vendors/@microsoft/recognizers-text/dist/types/utilities.d.ts create mode 100644 libraries/botbuilder-stdlib/vendors/@microsoft/recognizers-text/package.json create mode 100644 libraries/botbuilder-stdlib/vendors/README.md diff --git a/libraries/botbuilder-repo-utils/src/workspace.ts b/libraries/botbuilder-repo-utils/src/workspace.ts index 0dfa74ccb5..60b8993541 100644 --- a/libraries/botbuilder-repo-utils/src/workspace.ts +++ b/libraries/botbuilder-repo-utils/src/workspace.ts @@ -8,8 +8,6 @@ import path from 'path'; import { Package } from './package'; import { readJsonFile } from './file'; -export const glob = (paths: string[]): Promise => globby(paths); - // Represents a workspace export interface Workspace { absPath: string; @@ -41,7 +39,10 @@ export async function collectWorkspacePackages( filters: Partial = {} ): Promise> { // Note: posix is required, this emits absolute paths that are platform specific - const paths = await glob(workspaces.map((workspace) => path.posix.join(repoRoot, workspace, 'package.json'))); + const paths = await globby( + workspaces.map((workspace) => path.posix.join(repoRoot, workspace, 'package.json')), + { gitignore: true, cwd: process.env['INIT_CWD'] } + ); const maybeWorkspaces = await Promise.all( paths.map( diff --git a/libraries/botbuilder-stdlib/.gitignore b/libraries/botbuilder-stdlib/.gitignore index b9f7068056..6d4eed6669 100644 --- a/libraries/botbuilder-stdlib/.gitignore +++ b/libraries/botbuilder-stdlib/.gitignore @@ -2,3 +2,4 @@ _ts3.4 lib coverage .nyc_output +node_modules diff --git a/libraries/botbuilder-stdlib/package.json b/libraries/botbuilder-stdlib/package.json index c795d79c68..da9014c480 100644 --- a/libraries/botbuilder-stdlib/package.json +++ b/libraries/botbuilder-stdlib/package.json @@ -21,6 +21,20 @@ "postbuild": "downlevel-dts lib _ts3.4/lib", "test": "yarn build && nyc mocha --check-leaks tests" }, + "dependencies": { + "bignumber.js": "^7.2.1", + "grapheme-splitter": "^1.0.2", + "lodash.escaperegexp": "^4.1.2", + "lodash.isequal": "^4.5.0", + "lodash.last": "^3.0.0", + "lodash.max": "^4.0.1", + "lodash.tonumber": "^4.0.3", + "lodash": "^4.17.21" + }, + "devDependencies": { + "chai": "^4.1.2", + "chai-as-promised": "^7.1.1" + }, "main": "lib/index.js", "types": "lib/index.d.ts", "typesVersions": { @@ -33,6 +47,7 @@ "files": [ "_ts3.4", "lib", - "src" + "src", + "vendors" ] } diff --git a/libraries/botbuilder-stdlib/vendors/@microsoft/recognizers-text-choice/README.md b/libraries/botbuilder-stdlib/vendors/@microsoft/recognizers-text-choice/README.md new file mode 100644 index 0000000000..ddf45c6f5c --- /dev/null +++ b/libraries/botbuilder-stdlib/vendors/@microsoft/recognizers-text-choice/README.md @@ -0,0 +1,5 @@ +# Microsoft.Recognizers.Text for JavaScript + +This module (`recognizers-text-choice`) is a sub-module of `recognizers-text-suite`. + +Please check the [main README](https://github.com/Microsoft/Recognizers-Text/tree/master/JavaScript/packages/recognizers-text-suite) for more details. \ No newline at end of file diff --git a/libraries/botbuilder-stdlib/vendors/@microsoft/recognizers-text-choice/dist/recognizers-text-choice.browser.js b/libraries/botbuilder-stdlib/vendors/@microsoft/recognizers-text-choice/dist/recognizers-text-choice.browser.js new file mode 100644 index 0000000000..f7b15d37ba --- /dev/null +++ b/libraries/botbuilder-stdlib/vendors/@microsoft/recognizers-text-choice/dist/recognizers-text-choice.browser.js @@ -0,0 +1,8772 @@ +var microsoftRecognizersTextChoice = (function (exports) { +'use strict'; + +function unwrapExports (x) { + return x && x.__esModule && Object.prototype.hasOwnProperty.call(x, 'default') ? x['default'] : x; +} + +function createCommonjsModule(fn, module) { + return module = { exports: {} }, fn(module, module.exports), module.exports; +} + +var culture = createCommonjsModule(function (module, exports) { +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +class Culture { + constructor(cultureName, cultureCode) { + this.cultureName = cultureName; + this.cultureCode = cultureCode; + } + static getSupportedCultureCodes() { + return Culture.supportedCultures.map(c => c.cultureCode); + } + static mapToNearestLanguage(cultureCode) { + if (cultureCode !== undefined) { + cultureCode = cultureCode.toLowerCase(); + var supportedCultureCodes = Culture.getSupportedCultureCodes(); + if (supportedCultureCodes.indexOf(cultureCode) < 0) { + var culturePrefix = cultureCode.split('-')[0].trim(); + supportedCultureCodes.forEach(function (supportedCultureCode) { + if (supportedCultureCode.startsWith(culturePrefix)) { + cultureCode = supportedCultureCode; + } + }); + } + } + return cultureCode; + } +} +Culture.English = "en-us"; +Culture.Chinese = "zh-cn"; +Culture.Spanish = "es-es"; +Culture.Portuguese = "pt-br"; +Culture.French = "fr-fr"; +Culture.German = "de-de"; +Culture.Japanese = "ja-jp"; +Culture.Dutch = "nl-nl"; +Culture.Italian = "it-it"; +Culture.supportedCultures = [ + new Culture("English", Culture.English), + new Culture("Chinese", Culture.Chinese), + new Culture("Spanish", Culture.Spanish), + new Culture("Portuguese", Culture.Portuguese), + new Culture("French", Culture.French), + new Culture("German", Culture.German), + new Culture("Japanese", Culture.Japanese), + new Culture("Dutch", Culture.Dutch), + new Culture("Italian", Culture.Italian) +]; +exports.Culture = Culture; +class CultureInfo { + static getCultureInfo(cultureCode) { + return new CultureInfo(cultureCode); + } + constructor(cultureName) { + this.code = cultureName; + } +} +exports.CultureInfo = CultureInfo; + +}); + +unwrapExports(culture); + +var xregexp = createCommonjsModule(function (module, exports) { +"use strict"; + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.default = void 0; + +function _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _nonIterableRest(); } + +function _nonIterableRest() { throw new TypeError("Invalid attempt to destructure non-iterable instance"); } + +function _iterableToArrayLimit(arr, i) { var _arr = []; var _n = true; var _d = false; var _e = undefined; try { for (var _i = arr[Symbol.iterator](), _s; !(_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; } + +function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; } + +/*! + * XRegExp 4.2.0 + * + * Steven Levithan (c) 2007-present MIT License + */ + +/** + * XRegExp provides augmented, extensible regular expressions. You get additional regex syntax and + * flags, beyond what browsers support natively. XRegExp is also a regex utility belt with tools to + * make your client-side grepping simpler and more powerful, while freeing you from related + * cross-browser inconsistencies. + */ +// ==--------------------------== +// Private stuff +// ==--------------------------== +// Property name used for extended regex instance data +var REGEX_DATA = 'xregexp'; // Optional features that can be installed and uninstalled + +var features = { + astral: false, + namespacing: false +}; // Native methods to use and restore ('native' is an ES3 reserved keyword) + +var nativ = { + exec: RegExp.prototype.exec, + test: RegExp.prototype.test, + match: String.prototype.match, + replace: String.prototype.replace, + split: String.prototype.split +}; // Storage for fixed/extended native methods + +var fixed = {}; // Storage for regexes cached by `XRegExp.cache` + +var regexCache = {}; // Storage for pattern details cached by the `XRegExp` constructor + +var patternCache = {}; // Storage for regex syntax tokens added internally or by `XRegExp.addToken` + +var tokens = []; // Token scopes + +var defaultScope = 'default'; +var classScope = 'class'; // Regexes that match native regex syntax, including octals + +var nativeTokens = { + // Any native multicharacter token in default scope, or any single character + 'default': /\\(?:0(?:[0-3][0-7]{0,2}|[4-7][0-7]?)?|[1-9]\d*|x[\dA-Fa-f]{2}|u(?:[\dA-Fa-f]{4}|{[\dA-Fa-f]+})|c[A-Za-z]|[\s\S])|\(\?(?:[:=!]|<[=!])|[?*+]\?|{\d+(?:,\d*)?}\??|[\s\S]/, + // Any native multicharacter token in character class scope, or any single character + 'class': /\\(?:[0-3][0-7]{0,2}|[4-7][0-7]?|x[\dA-Fa-f]{2}|u(?:[\dA-Fa-f]{4}|{[\dA-Fa-f]+})|c[A-Za-z]|[\s\S])|[\s\S]/ +}; // Any backreference or dollar-prefixed character in replacement strings + +var replacementToken = /\$(?:{([\w$]+)}|<([\w$]+)>|(\d\d?|[\s\S]))/g; // Check for correct `exec` handling of nonparticipating capturing groups + +var correctExecNpcg = nativ.exec.call(/()??/, '')[1] === undefined; // Check for ES6 `flags` prop support + +var hasFlagsProp = /x/.flags !== undefined; // Shortcut to `Object.prototype.toString` + +var _ref = {}, + toString = _ref.toString; + +function hasNativeFlag(flag) { + // Can't check based on the presence of properties/getters since browsers might support such + // properties even when they don't support the corresponding flag in regex construction (tested + // in Chrome 48, where `'unicode' in /x/` is true but trying to construct a regex with flag `u` + // throws an error) + var isSupported = true; + + try { + // Can't use regex literals for testing even in a `try` because regex literals with + // unsupported flags cause a compilation error in IE + new RegExp('', flag); + } catch (exception) { + isSupported = false; + } + + return isSupported; +} // Check for ES6 `u` flag support + + +var hasNativeU = hasNativeFlag('u'); // Check for ES6 `y` flag support + +var hasNativeY = hasNativeFlag('y'); // Tracker for known flags, including addon flags + +var registeredFlags = { + g: true, + i: true, + m: true, + u: hasNativeU, + y: hasNativeY +}; +/** + * Attaches extended data and `XRegExp.prototype` properties to a regex object. + * + * @private + * @param {RegExp} regex Regex to augment. + * @param {Array} captureNames Array with capture names, or `null`. + * @param {String} xSource XRegExp pattern used to generate `regex`, or `null` if N/A. + * @param {String} xFlags XRegExp flags used to generate `regex`, or `null` if N/A. + * @param {Boolean} [isInternalOnly=false] Whether the regex will be used only for internal + * operations, and never exposed to users. For internal-only regexes, we can improve perf by + * skipping some operations like attaching `XRegExp.prototype` properties. + * @returns {RegExp} Augmented regex. + */ + +function augment(regex, captureNames, xSource, xFlags, isInternalOnly) { + regex[REGEX_DATA] = { + captureNames: captureNames + }; + + if (isInternalOnly) { + return regex; + } // Can't auto-inherit these since the XRegExp constructor returns a nonprimitive value + + + if (regex.__proto__) { + regex.__proto__ = XRegExp.prototype; + } else { + for (var p in XRegExp.prototype) { + // An `XRegExp.prototype.hasOwnProperty(p)` check wouldn't be worth it here, since this + // is performance sensitive, and enumerable `Object.prototype` or `RegExp.prototype` + // extensions exist on `regex.prototype` anyway + regex[p] = XRegExp.prototype[p]; + } + } + + regex[REGEX_DATA].source = xSource; // Emulate the ES6 `flags` prop by ensuring flags are in alphabetical order + + regex[REGEX_DATA].flags = xFlags ? xFlags.split('').sort().join('') : xFlags; + return regex; +} +/** + * Removes any duplicate characters from the provided string. + * + * @private + * @param {String} str String to remove duplicate characters from. + * @returns {String} String with any duplicate characters removed. + */ + + +function clipDuplicates(str) { + return nativ.replace.call(str, /([\s\S])(?=[\s\S]*\1)/g, ''); +} +/** + * Copies a regex object while preserving extended data and augmenting with `XRegExp.prototype` + * properties. The copy has a fresh `lastIndex` property (set to zero). Allows adding and removing + * flags g and y while copying the regex. + * + * @private + * @param {RegExp} regex Regex to copy. + * @param {Object} [options] Options object with optional properties: + * - `addG` {Boolean} Add flag g while copying the regex. + * - `addY` {Boolean} Add flag y while copying the regex. + * - `removeG` {Boolean} Remove flag g while copying the regex. + * - `removeY` {Boolean} Remove flag y while copying the regex. + * - `isInternalOnly` {Boolean} Whether the copied regex will be used only for internal + * operations, and never exposed to users. For internal-only regexes, we can improve perf by + * skipping some operations like attaching `XRegExp.prototype` properties. + * - `source` {String} Overrides `.source`, for special cases. + * @returns {RegExp} Copy of the provided regex, possibly with modified flags. + */ + + +function copyRegex(regex, options) { + if (!XRegExp.isRegExp(regex)) { + throw new TypeError('Type RegExp expected'); + } + + var xData = regex[REGEX_DATA] || {}; + var flags = getNativeFlags(regex); + var flagsToAdd = ''; + var flagsToRemove = ''; + var xregexpSource = null; + var xregexpFlags = null; + options = options || {}; + + if (options.removeG) { + flagsToRemove += 'g'; + } + + if (options.removeY) { + flagsToRemove += 'y'; + } + + if (flagsToRemove) { + flags = nativ.replace.call(flags, new RegExp("[".concat(flagsToRemove, "]+"), 'g'), ''); + } + + if (options.addG) { + flagsToAdd += 'g'; + } + + if (options.addY) { + flagsToAdd += 'y'; + } + + if (flagsToAdd) { + flags = clipDuplicates(flags + flagsToAdd); + } + + if (!options.isInternalOnly) { + if (xData.source !== undefined) { + xregexpSource = xData.source; + } // null or undefined; don't want to add to `flags` if the previous value was null, since + // that indicates we're not tracking original precompilation flags + + + if (xData.flags != null) { + // Flags are only added for non-internal regexes by `XRegExp.globalize`. Flags are never + // removed for non-internal regexes, so don't need to handle it + xregexpFlags = flagsToAdd ? clipDuplicates(xData.flags + flagsToAdd) : xData.flags; + } + } // Augment with `XRegExp.prototype` properties, but use the native `RegExp` constructor to avoid + // searching for special tokens. That would be wrong for regexes constructed by `RegExp`, and + // unnecessary for regexes constructed by `XRegExp` because the regex has already undergone the + // translation to native regex syntax + + + regex = augment(new RegExp(options.source || regex.source, flags), hasNamedCapture(regex) ? xData.captureNames.slice(0) : null, xregexpSource, xregexpFlags, options.isInternalOnly); + return regex; +} +/** + * Converts hexadecimal to decimal. + * + * @private + * @param {String} hex + * @returns {Number} + */ + + +function dec(hex) { + return parseInt(hex, 16); +} +/** + * Returns a pattern that can be used in a native RegExp in place of an ignorable token such as an + * inline comment or whitespace with flag x. This is used directly as a token handler function + * passed to `XRegExp.addToken`. + * + * @private + * @param {String} match Match arg of `XRegExp.addToken` handler + * @param {String} scope Scope arg of `XRegExp.addToken` handler + * @param {String} flags Flags arg of `XRegExp.addToken` handler + * @returns {String} Either '' or '(?:)', depending on which is needed in the context of the match. + */ + + +function getContextualTokenSeparator(match, scope, flags) { + if ( // No need to separate tokens if at the beginning or end of a group + match.input[match.index - 1] === '(' || match.input[match.index + match[0].length] === ')' || // No need to separate tokens if before or after a `|` + match.input[match.index - 1] === '|' || match.input[match.index + match[0].length] === '|' || // No need to separate tokens if at the beginning or end of the pattern + match.index < 1 || match.index + match[0].length >= match.input.length || // No need to separate tokens if at the beginning of a noncapturing group or lookahead. + // The way this is written relies on: + // - The search regex matching only 3-char strings. + // - Although `substr` gives chars from the end of the string if given a negative index, + // the resulting substring will be too short to match. Ex: `'abcd'.substr(-1, 3) === 'd'` + nativ.test.call(/^\(\?[:=!]/, match.input.substr(match.index - 3, 3)) || // Avoid separating tokens when the following token is a quantifier + isQuantifierNext(match.input, match.index + match[0].length, flags)) { + return ''; + } // Keep tokens separated. This avoids e.g. inadvertedly changing `\1 1` or `\1(?#)1` to `\11`. + // This also ensures all tokens remain as discrete atoms, e.g. it avoids converting the syntax + // error `(? :` into `(?:`. + + + return '(?:)'; +} +/** + * Returns native `RegExp` flags used by a regex object. + * + * @private + * @param {RegExp} regex Regex to check. + * @returns {String} Native flags in use. + */ + + +function getNativeFlags(regex) { + return hasFlagsProp ? regex.flags : // Explicitly using `RegExp.prototype.toString` (rather than e.g. `String` or concatenation + // with an empty string) allows this to continue working predictably when + // `XRegExp.proptotype.toString` is overridden + nativ.exec.call(/\/([a-z]*)$/i, RegExp.prototype.toString.call(regex))[1]; +} +/** + * Determines whether a regex has extended instance data used to track capture names. + * + * @private + * @param {RegExp} regex Regex to check. + * @returns {Boolean} Whether the regex uses named capture. + */ + + +function hasNamedCapture(regex) { + return !!(regex[REGEX_DATA] && regex[REGEX_DATA].captureNames); +} +/** + * Converts decimal to hexadecimal. + * + * @private + * @param {Number|String} dec + * @returns {String} + */ + + +function hex(dec) { + return parseInt(dec, 10).toString(16); +} +/** + * Checks whether the next nonignorable token after the specified position is a quantifier. + * + * @private + * @param {String} pattern Pattern to search within. + * @param {Number} pos Index in `pattern` to search at. + * @param {String} flags Flags used by the pattern. + * @returns {Boolean} Whether the next nonignorable token is a quantifier. + */ + + +function isQuantifierNext(pattern, pos, flags) { + return nativ.test.call(flags.indexOf('x') !== -1 ? // Ignore any leading whitespace, line comments, and inline comments + /^(?:\s|#[^#\n]*|\(\?#[^)]*\))*(?:[?*+]|{\d+(?:,\d*)?})/ : // Ignore any leading inline comments + /^(?:\(\?#[^)]*\))*(?:[?*+]|{\d+(?:,\d*)?})/, pattern.slice(pos)); +} +/** + * Determines whether a value is of the specified type, by resolving its internal [[Class]]. + * + * @private + * @param {*} value Object to check. + * @param {String} type Type to check for, in TitleCase. + * @returns {Boolean} Whether the object matches the type. + */ + + +function isType(value, type) { + return toString.call(value) === "[object ".concat(type, "]"); +} +/** + * Adds leading zeros if shorter than four characters. Used for fixed-length hexadecimal values. + * + * @private + * @param {String} str + * @returns {String} + */ + + +function pad4(str) { + while (str.length < 4) { + str = "0".concat(str); + } + + return str; +} +/** + * Checks for flag-related errors, and strips/applies flags in a leading mode modifier. Offloads + * the flag preparation logic from the `XRegExp` constructor. + * + * @private + * @param {String} pattern Regex pattern, possibly with a leading mode modifier. + * @param {String} flags Any combination of flags. + * @returns {Object} Object with properties `pattern` and `flags`. + */ + + +function prepareFlags(pattern, flags) { + // Recent browsers throw on duplicate flags, so copy this behavior for nonnative flags + if (clipDuplicates(flags) !== flags) { + throw new SyntaxError("Invalid duplicate regex flag ".concat(flags)); + } // Strip and apply a leading mode modifier with any combination of flags except g or y + + + pattern = nativ.replace.call(pattern, /^\(\?([\w$]+)\)/, function ($0, $1) { + if (nativ.test.call(/[gy]/, $1)) { + throw new SyntaxError("Cannot use flag g or y in mode modifier ".concat($0)); + } // Allow duplicate flags within the mode modifier + + + flags = clipDuplicates(flags + $1); + return ''; + }); // Throw on unknown native or nonnative flags + + var _iteratorNormalCompletion = true; + var _didIteratorError = false; + var _iteratorError = undefined; + + try { + for (var _iterator = flags[Symbol.iterator](), _step; !(_iteratorNormalCompletion = (_step = _iterator.next()).done); _iteratorNormalCompletion = true) { + var flag = _step.value; + + if (!registeredFlags[flag]) { + throw new SyntaxError("Unknown regex flag ".concat(flag)); + } + } + } catch (err) { + _didIteratorError = true; + _iteratorError = err; + } finally { + try { + if (!_iteratorNormalCompletion && _iterator.return != null) { + _iterator.return(); + } + } finally { + if (_didIteratorError) { + throw _iteratorError; + } + } + } + + return { + pattern: pattern, + flags: flags + }; +} +/** + * Prepares an options object from the given value. + * + * @private + * @param {String|Object} value Value to convert to an options object. + * @returns {Object} Options object. + */ + + +function prepareOptions(value) { + var options = {}; + + if (isType(value, 'String')) { + XRegExp.forEach(value, /[^\s,]+/, function (match) { + options[match] = true; + }); + return options; + } + + return value; +} +/** + * Registers a flag so it doesn't throw an 'unknown flag' error. + * + * @private + * @param {String} flag Single-character flag to register. + */ + + +function registerFlag(flag) { + if (!/^[\w$]$/.test(flag)) { + throw new Error('Flag must be a single character A-Za-z0-9_$'); + } + + registeredFlags[flag] = true; +} +/** + * Runs built-in and custom regex syntax tokens in reverse insertion order at the specified + * position, until a match is found. + * + * @private + * @param {String} pattern Original pattern from which an XRegExp object is being built. + * @param {String} flags Flags being used to construct the regex. + * @param {Number} pos Position to search for tokens within `pattern`. + * @param {Number} scope Regex scope to apply: 'default' or 'class'. + * @param {Object} context Context object to use for token handler functions. + * @returns {Object} Object with properties `matchLength`, `output`, and `reparse`; or `null`. + */ + + +function runTokens(pattern, flags, pos, scope, context) { + var i = tokens.length; + var leadChar = pattern[pos]; + var result = null; + var match; + var t; // Run in reverse insertion order + + while (i--) { + t = tokens[i]; + + if (t.leadChar && t.leadChar !== leadChar || t.scope !== scope && t.scope !== 'all' || t.flag && !(flags.indexOf(t.flag) !== -1)) { + continue; + } + + match = XRegExp.exec(pattern, t.regex, pos, 'sticky'); + + if (match) { + result = { + matchLength: match[0].length, + output: t.handler.call(context, match, scope, flags), + reparse: t.reparse + }; // Finished with token tests + + break; + } + } + + return result; +} +/** + * Enables or disables implicit astral mode opt-in. When enabled, flag A is automatically added to + * all new regexes created by XRegExp. This causes an error to be thrown when creating regexes if + * the Unicode Base addon is not available, since flag A is registered by that addon. + * + * @private + * @param {Boolean} on `true` to enable; `false` to disable. + */ + + +function setAstral(on) { + features.astral = on; +} +/** + * Adds named capture groups to the `groups` property of match arrays. See here for details: + * https://github.com/tc39/proposal-regexp-named-groups + * + * @private + * @param {Boolean} on `true` to enable; `false` to disable. + */ + + +function setNamespacing(on) { + features.namespacing = on; +} +/** + * Returns the object, or throws an error if it is `null` or `undefined`. This is used to follow + * the ES5 abstract operation `ToObject`. + * + * @private + * @param {*} value Object to check and return. + * @returns {*} The provided object. + */ + + +function toObject(value) { + // null or undefined + if (value == null) { + throw new TypeError('Cannot convert null or undefined to object'); + } + + return value; +} // ==--------------------------== +// Constructor +// ==--------------------------== + +/** + * Creates an extended regular expression object for matching text with a pattern. Differs from a + * native regular expression in that additional syntax and flags are supported. The returned object + * is in fact a native `RegExp` and works with all native methods. + * + * @class XRegExp + * @constructor + * @param {String|RegExp} pattern Regex pattern string, or an existing regex object to copy. + * @param {String} [flags] Any combination of flags. + * Native flags: + * - `g` - global + * - `i` - ignore case + * - `m` - multiline anchors + * - `u` - unicode (ES6) + * - `y` - sticky (Firefox 3+, ES6) + * Additional XRegExp flags: + * - `n` - explicit capture + * - `s` - dot matches all (aka singleline) + * - `x` - free-spacing and line comments (aka extended) + * - `A` - astral (requires the Unicode Base addon) + * Flags cannot be provided when constructing one `RegExp` from another. + * @returns {RegExp} Extended regular expression object. + * @example + * + * // With named capture and flag x + * XRegExp(`(? [0-9]{4} ) -? # year + * (? [0-9]{2} ) -? # month + * (? [0-9]{2} ) # day`, 'x'); + * + * // Providing a regex object copies it. Native regexes are recompiled using native (not XRegExp) + * // syntax. Copies maintain extended data, are augmented with `XRegExp.prototype` properties, and + * // have fresh `lastIndex` properties (set to zero). + * XRegExp(/regex/); + */ + + +function XRegExp(pattern, flags) { + if (XRegExp.isRegExp(pattern)) { + if (flags !== undefined) { + throw new TypeError('Cannot supply flags when copying a RegExp'); + } + + return copyRegex(pattern); + } // Copy the argument behavior of `RegExp` + + + pattern = pattern === undefined ? '' : String(pattern); + flags = flags === undefined ? '' : String(flags); + + if (XRegExp.isInstalled('astral') && !(flags.indexOf('A') !== -1)) { + // This causes an error to be thrown if the Unicode Base addon is not available + flags += 'A'; + } + + if (!patternCache[pattern]) { + patternCache[pattern] = {}; + } + + if (!patternCache[pattern][flags]) { + var context = { + hasNamedCapture: false, + captureNames: [] + }; + var scope = defaultScope; + var output = ''; + var pos = 0; + var result; // Check for flag-related errors, and strip/apply flags in a leading mode modifier + + var applied = prepareFlags(pattern, flags); + var appliedPattern = applied.pattern; + var appliedFlags = applied.flags; // Use XRegExp's tokens to translate the pattern to a native regex pattern. + // `appliedPattern.length` may change on each iteration if tokens use `reparse` + + while (pos < appliedPattern.length) { + do { + // Check for custom tokens at the current position + result = runTokens(appliedPattern, appliedFlags, pos, scope, context); // If the matched token used the `reparse` option, splice its output into the + // pattern before running tokens again at the same position + + if (result && result.reparse) { + appliedPattern = appliedPattern.slice(0, pos) + result.output + appliedPattern.slice(pos + result.matchLength); + } + } while (result && result.reparse); + + if (result) { + output += result.output; + pos += result.matchLength || 1; + } else { + // Get the native token at the current position + var _XRegExp$exec = XRegExp.exec(appliedPattern, nativeTokens[scope], pos, 'sticky'), + _XRegExp$exec2 = _slicedToArray(_XRegExp$exec, 1), + token = _XRegExp$exec2[0]; + + output += token; + pos += token.length; + + if (token === '[' && scope === defaultScope) { + scope = classScope; + } else if (token === ']' && scope === classScope) { + scope = defaultScope; + } + } + } + + patternCache[pattern][flags] = { + // Use basic cleanup to collapse repeated empty groups like `(?:)(?:)` to `(?:)`. Empty + // groups are sometimes inserted during regex transpilation in order to keep tokens + // separated. However, more than one empty group in a row is never needed. + pattern: nativ.replace.call(output, /(?:\(\?:\))+/g, '(?:)'), + // Strip all but native flags + flags: nativ.replace.call(appliedFlags, /[^gimuy]+/g, ''), + // `context.captureNames` has an item for each capturing group, even if unnamed + captures: context.hasNamedCapture ? context.captureNames : null + }; + } + + var generated = patternCache[pattern][flags]; + return augment(new RegExp(generated.pattern, generated.flags), generated.captures, pattern, flags); +} // Add `RegExp.prototype` to the prototype chain + + +XRegExp.prototype = /(?:)/; // ==--------------------------== +// Public properties +// ==--------------------------== + +/** + * The XRegExp version number as a string containing three dot-separated parts. For example, + * '2.0.0-beta-3'. + * + * @static + * @memberOf XRegExp + * @type String + */ + +XRegExp.version = '4.2.0'; // ==--------------------------== +// Public methods +// ==--------------------------== +// Intentionally undocumented; used in tests and addons + +XRegExp._clipDuplicates = clipDuplicates; +XRegExp._hasNativeFlag = hasNativeFlag; +XRegExp._dec = dec; +XRegExp._hex = hex; +XRegExp._pad4 = pad4; +/** + * Extends XRegExp syntax and allows custom flags. This is used internally and can be used to + * create XRegExp addons. If more than one token can match the same string, the last added wins. + * + * @memberOf XRegExp + * @param {RegExp} regex Regex object that matches the new token. + * @param {Function} handler Function that returns a new pattern string (using native regex syntax) + * to replace the matched token within all future XRegExp regexes. Has access to persistent + * properties of the regex being built, through `this`. Invoked with three arguments: + * - The match array, with named backreference properties. + * - The regex scope where the match was found: 'default' or 'class'. + * - The flags used by the regex, including any flags in a leading mode modifier. + * The handler function becomes part of the XRegExp construction process, so be careful not to + * construct XRegExps within the function or you will trigger infinite recursion. + * @param {Object} [options] Options object with optional properties: + * - `scope` {String} Scope where the token applies: 'default', 'class', or 'all'. + * - `flag` {String} Single-character flag that triggers the token. This also registers the + * flag, which prevents XRegExp from throwing an 'unknown flag' error when the flag is used. + * - `optionalFlags` {String} Any custom flags checked for within the token `handler` that are + * not required to trigger the token. This registers the flags, to prevent XRegExp from + * throwing an 'unknown flag' error when any of the flags are used. + * - `reparse` {Boolean} Whether the `handler` function's output should not be treated as + * final, and instead be reparseable by other tokens (including the current token). Allows + * token chaining or deferring. + * - `leadChar` {String} Single character that occurs at the beginning of any successful match + * of the token (not always applicable). This doesn't change the behavior of the token unless + * you provide an erroneous value. However, providing it can increase the token's performance + * since the token can be skipped at any positions where this character doesn't appear. + * @example + * + * // Basic usage: Add \a for the ALERT control code + * XRegExp.addToken( + * /\\a/, + * () => '\\x07', + * {scope: 'all'} + * ); + * XRegExp('\\a[\\a-\\n]+').test('\x07\n\x07'); // -> true + * + * // Add the U (ungreedy) flag from PCRE and RE2, which reverses greedy and lazy quantifiers. + * // Since `scope` is not specified, it uses 'default' (i.e., transformations apply outside of + * // character classes only) + * XRegExp.addToken( + * /([?*+]|{\d+(?:,\d*)?})(\??)/, + * (match) => `${match[1]}${match[2] ? '' : '?'}`, + * {flag: 'U'} + * ); + * XRegExp('a+', 'U').exec('aaa')[0]; // -> 'a' + * XRegExp('a+?', 'U').exec('aaa')[0]; // -> 'aaa' + */ + +XRegExp.addToken = function (regex, handler, options) { + options = options || {}; + var _options = options, + optionalFlags = _options.optionalFlags; + + if (options.flag) { + registerFlag(options.flag); + } + + if (optionalFlags) { + optionalFlags = nativ.split.call(optionalFlags, ''); + var _iteratorNormalCompletion2 = true; + var _didIteratorError2 = false; + var _iteratorError2 = undefined; + + try { + for (var _iterator2 = optionalFlags[Symbol.iterator](), _step2; !(_iteratorNormalCompletion2 = (_step2 = _iterator2.next()).done); _iteratorNormalCompletion2 = true) { + var flag = _step2.value; + registerFlag(flag); + } + } catch (err) { + _didIteratorError2 = true; + _iteratorError2 = err; + } finally { + try { + if (!_iteratorNormalCompletion2 && _iterator2.return != null) { + _iterator2.return(); + } + } finally { + if (_didIteratorError2) { + throw _iteratorError2; + } + } + } + } // Add to the private list of syntax tokens + + + tokens.push({ + regex: copyRegex(regex, { + addG: true, + addY: hasNativeY, + isInternalOnly: true + }), + handler: handler, + scope: options.scope || defaultScope, + flag: options.flag, + reparse: options.reparse, + leadChar: options.leadChar + }); // Reset the pattern cache used by the `XRegExp` constructor, since the same pattern and flags + // might now produce different results + + XRegExp.cache.flush('patterns'); +}; +/** + * Caches and returns the result of calling `XRegExp(pattern, flags)`. On any subsequent call with + * the same pattern and flag combination, the cached copy of the regex is returned. + * + * @memberOf XRegExp + * @param {String} pattern Regex pattern string. + * @param {String} [flags] Any combination of XRegExp flags. + * @returns {RegExp} Cached XRegExp object. + * @example + * + * while (match = XRegExp.cache('.', 'gs').exec(str)) { + * // The regex is compiled once only + * } + */ + + +XRegExp.cache = function (pattern, flags) { + if (!regexCache[pattern]) { + regexCache[pattern] = {}; + } + + return regexCache[pattern][flags] || (regexCache[pattern][flags] = XRegExp(pattern, flags)); +}; // Intentionally undocumented; used in tests + + +XRegExp.cache.flush = function (cacheName) { + if (cacheName === 'patterns') { + // Flush the pattern cache used by the `XRegExp` constructor + patternCache = {}; + } else { + // Flush the regex cache populated by `XRegExp.cache` + regexCache = {}; + } +}; +/** + * Escapes any regular expression metacharacters, for use when matching literal strings. The result + * can safely be used at any point within a regex that uses any flags. + * + * @memberOf XRegExp + * @param {String} str String to escape. + * @returns {String} String with regex metacharacters escaped. + * @example + * + * XRegExp.escape('Escaped? <.>'); + * // -> 'Escaped\?\ <\.>' + */ + + +XRegExp.escape = function (str) { + return nativ.replace.call(toObject(str), /[-\[\]{}()*+?.,\\^$|#\s]/g, '\\$&'); +}; +/** + * Executes a regex search in a specified string. Returns a match array or `null`. If the provided + * regex uses named capture, named backreference properties are included on the match array. + * Optional `pos` and `sticky` arguments specify the search start position, and whether the match + * must start at the specified position only. The `lastIndex` property of the provided regex is not + * used, but is updated for compatibility. Also fixes browser bugs compared to the native + * `RegExp.prototype.exec` and can be used reliably cross-browser. + * + * @memberOf XRegExp + * @param {String} str String to search. + * @param {RegExp} regex Regex to search with. + * @param {Number} [pos=0] Zero-based index at which to start the search. + * @param {Boolean|String} [sticky=false] Whether the match must start at the specified position + * only. The string `'sticky'` is accepted as an alternative to `true`. + * @returns {Array} Match array with named backreference properties, or `null`. + * @example + * + * // Basic use, with named backreference + * let match = XRegExp.exec('U+2620', XRegExp('U\\+(?[0-9A-F]{4})')); + * match.hex; // -> '2620' + * + * // With pos and sticky, in a loop + * let pos = 2, result = [], match; + * while (match = XRegExp.exec('<1><2><3><4>5<6>', /<(\d)>/, pos, 'sticky')) { + * result.push(match[1]); + * pos = match.index + match[0].length; + * } + * // result -> ['2', '3', '4'] + */ + + +XRegExp.exec = function (str, regex, pos, sticky) { + var cacheKey = 'g'; + var addY = false; + var fakeY = false; + var match; + addY = hasNativeY && !!(sticky || regex.sticky && sticky !== false); + + if (addY) { + cacheKey += 'y'; + } else if (sticky) { + // Simulate sticky matching by appending an empty capture to the original regex. The + // resulting regex will succeed no matter what at the current index (set with `lastIndex`), + // and will not search the rest of the subject string. We'll know that the original regex + // has failed if that last capture is `''` rather than `undefined` (i.e., if that last + // capture participated in the match). + fakeY = true; + cacheKey += 'FakeY'; + } + + regex[REGEX_DATA] = regex[REGEX_DATA] || {}; // Shares cached copies with `XRegExp.match`/`replace` + + var r2 = regex[REGEX_DATA][cacheKey] || (regex[REGEX_DATA][cacheKey] = copyRegex(regex, { + addG: true, + addY: addY, + source: fakeY ? "".concat(regex.source, "|()") : undefined, + removeY: sticky === false, + isInternalOnly: true + })); + pos = pos || 0; + r2.lastIndex = pos; // Fixed `exec` required for `lastIndex` fix, named backreferences, etc. + + match = fixed.exec.call(r2, str); // Get rid of the capture added by the pseudo-sticky matcher if needed. An empty string means + // the original regexp failed (see above). + + if (fakeY && match && match.pop() === '') { + match = null; + } + + if (regex.global) { + regex.lastIndex = match ? r2.lastIndex : 0; + } + + return match; +}; +/** + * Executes a provided function once per regex match. Searches always start at the beginning of the + * string and continue until the end, regardless of the state of the regex's `global` property and + * initial `lastIndex`. + * + * @memberOf XRegExp + * @param {String} str String to search. + * @param {RegExp} regex Regex to search with. + * @param {Function} callback Function to execute for each match. Invoked with four arguments: + * - The match array, with named backreference properties. + * - The zero-based match index. + * - The string being traversed. + * - The regex object being used to traverse the string. + * @example + * + * // Extracts every other digit from a string + * const evens = []; + * XRegExp.forEach('1a2345', /\d/, (match, i) => { + * if (i % 2) evens.push(+match[0]); + * }); + * // evens -> [2, 4] + */ + + +XRegExp.forEach = function (str, regex, callback) { + var pos = 0; + var i = -1; + var match; + + while (match = XRegExp.exec(str, regex, pos)) { + // Because `regex` is provided to `callback`, the function could use the deprecated/ + // nonstandard `RegExp.prototype.compile` to mutate the regex. However, since `XRegExp.exec` + // doesn't use `lastIndex` to set the search position, this can't lead to an infinite loop, + // at least. Actually, because of the way `XRegExp.exec` caches globalized versions of + // regexes, mutating the regex will not have any effect on the iteration or matched strings, + // which is a nice side effect that brings extra safety. + callback(match, ++i, str, regex); + pos = match.index + (match[0].length || 1); + } +}; +/** + * Copies a regex object and adds flag `g`. The copy maintains extended data, is augmented with + * `XRegExp.prototype` properties, and has a fresh `lastIndex` property (set to zero). Native + * regexes are not recompiled using XRegExp syntax. + * + * @memberOf XRegExp + * @param {RegExp} regex Regex to globalize. + * @returns {RegExp} Copy of the provided regex with flag `g` added. + * @example + * + * const globalCopy = XRegExp.globalize(/regex/); + * globalCopy.global; // -> true + */ + + +XRegExp.globalize = function (regex) { + return copyRegex(regex, { + addG: true + }); +}; +/** + * Installs optional features according to the specified options. Can be undone using + * `XRegExp.uninstall`. + * + * @memberOf XRegExp + * @param {Object|String} options Options object or string. + * @example + * + * // With an options object + * XRegExp.install({ + * // Enables support for astral code points in Unicode addons (implicitly sets flag A) + * astral: true, + * + * // Adds named capture groups to the `groups` property of matches + * namespacing: true + * }); + * + * // With an options string + * XRegExp.install('astral namespacing'); + */ + + +XRegExp.install = function (options) { + options = prepareOptions(options); + + if (!features.astral && options.astral) { + setAstral(true); + } + + if (!features.namespacing && options.namespacing) { + setNamespacing(true); + } +}; +/** + * Checks whether an individual optional feature is installed. + * + * @memberOf XRegExp + * @param {String} feature Name of the feature to check. One of: + * - `astral` + * - `namespacing` + * @returns {Boolean} Whether the feature is installed. + * @example + * + * XRegExp.isInstalled('astral'); + */ + + +XRegExp.isInstalled = function (feature) { + return !!features[feature]; +}; +/** + * Returns `true` if an object is a regex; `false` if it isn't. This works correctly for regexes + * created in another frame, when `instanceof` and `constructor` checks would fail. + * + * @memberOf XRegExp + * @param {*} value Object to check. + * @returns {Boolean} Whether the object is a `RegExp` object. + * @example + * + * XRegExp.isRegExp('string'); // -> false + * XRegExp.isRegExp(/regex/i); // -> true + * XRegExp.isRegExp(RegExp('^', 'm')); // -> true + * XRegExp.isRegExp(XRegExp('(?s).')); // -> true + */ + + +XRegExp.isRegExp = function (value) { + return toString.call(value) === '[object RegExp]'; +}; // isType(value, 'RegExp'); + +/** + * Returns the first matched string, or in global mode, an array containing all matched strings. + * This is essentially a more convenient re-implementation of `String.prototype.match` that gives + * the result types you actually want (string instead of `exec`-style array in match-first mode, + * and an empty array instead of `null` when no matches are found in match-all mode). It also lets + * you override flag g and ignore `lastIndex`, and fixes browser bugs. + * + * @memberOf XRegExp + * @param {String} str String to search. + * @param {RegExp} regex Regex to search with. + * @param {String} [scope='one'] Use 'one' to return the first match as a string. Use 'all' to + * return an array of all matched strings. If not explicitly specified and `regex` uses flag g, + * `scope` is 'all'. + * @returns {String|Array} In match-first mode: First match as a string, or `null`. In match-all + * mode: Array of all matched strings, or an empty array. + * @example + * + * // Match first + * XRegExp.match('abc', /\w/); // -> 'a' + * XRegExp.match('abc', /\w/g, 'one'); // -> 'a' + * XRegExp.match('abc', /x/g, 'one'); // -> null + * + * // Match all + * XRegExp.match('abc', /\w/g); // -> ['a', 'b', 'c'] + * XRegExp.match('abc', /\w/, 'all'); // -> ['a', 'b', 'c'] + * XRegExp.match('abc', /x/, 'all'); // -> [] + */ + + +XRegExp.match = function (str, regex, scope) { + var global = regex.global && scope !== 'one' || scope === 'all'; + var cacheKey = (global ? 'g' : '') + (regex.sticky ? 'y' : '') || 'noGY'; + regex[REGEX_DATA] = regex[REGEX_DATA] || {}; // Shares cached copies with `XRegExp.exec`/`replace` + + var r2 = regex[REGEX_DATA][cacheKey] || (regex[REGEX_DATA][cacheKey] = copyRegex(regex, { + addG: !!global, + removeG: scope === 'one', + isInternalOnly: true + })); + var result = nativ.match.call(toObject(str), r2); + + if (regex.global) { + regex.lastIndex = scope === 'one' && result ? // Can't use `r2.lastIndex` since `r2` is nonglobal in this case + result.index + result[0].length : 0; + } + + return global ? result || [] : result && result[0]; +}; +/** + * Retrieves the matches from searching a string using a chain of regexes that successively search + * within previous matches. The provided `chain` array can contain regexes and or objects with + * `regex` and `backref` properties. When a backreference is specified, the named or numbered + * backreference is passed forward to the next regex or returned. + * + * @memberOf XRegExp + * @param {String} str String to search. + * @param {Array} chain Regexes that each search for matches within preceding results. + * @returns {Array} Matches by the last regex in the chain, or an empty array. + * @example + * + * // Basic usage; matches numbers within tags + * XRegExp.matchChain('1 2 3 4 a 56', [ + * XRegExp('(?is).*?'), + * /\d+/ + * ]); + * // -> ['2', '4', '56'] + * + * // Passing forward and returning specific backreferences + * html = 'XRegExp\ + * Google'; + * XRegExp.matchChain(html, [ + * {regex: //i, backref: 1}, + * {regex: XRegExp('(?i)^https?://(?[^/?#]+)'), backref: 'domain'} + * ]); + * // -> ['xregexp.com', 'www.google.com'] + */ + + +XRegExp.matchChain = function (str, chain) { + return function recurseChain(values, level) { + var item = chain[level].regex ? chain[level] : { + regex: chain[level] + }; + var matches = []; + + function addMatch(match) { + if (item.backref) { + var ERR_UNDEFINED_GROUP = "Backreference to undefined group: ".concat(item.backref); + var isNamedBackref = isNaN(item.backref); + + if (isNamedBackref && XRegExp.isInstalled('namespacing')) { + // `groups` has `null` as prototype, so using `in` instead of `hasOwnProperty` + if (!(item.backref in match.groups)) { + throw new ReferenceError(ERR_UNDEFINED_GROUP); + } + } else if (!match.hasOwnProperty(item.backref)) { + throw new ReferenceError(ERR_UNDEFINED_GROUP); + } + + var backrefValue = isNamedBackref && XRegExp.isInstalled('namespacing') ? match.groups[item.backref] : match[item.backref]; + matches.push(backrefValue || ''); + } else { + matches.push(match[0]); + } + } + + var _iteratorNormalCompletion3 = true; + var _didIteratorError3 = false; + var _iteratorError3 = undefined; + + try { + for (var _iterator3 = values[Symbol.iterator](), _step3; !(_iteratorNormalCompletion3 = (_step3 = _iterator3.next()).done); _iteratorNormalCompletion3 = true) { + var value = _step3.value; + XRegExp.forEach(value, item.regex, addMatch); + } + } catch (err) { + _didIteratorError3 = true; + _iteratorError3 = err; + } finally { + try { + if (!_iteratorNormalCompletion3 && _iterator3.return != null) { + _iterator3.return(); + } + } finally { + if (_didIteratorError3) { + throw _iteratorError3; + } + } + } + + return level === chain.length - 1 || !matches.length ? matches : recurseChain(matches, level + 1); + }([str], 0); +}; +/** + * Returns a new string with one or all matches of a pattern replaced. The pattern can be a string + * or regex, and the replacement can be a string or a function to be called for each match. To + * perform a global search and replace, use the optional `scope` argument or include flag g if using + * a regex. Replacement strings can use `${n}` or `$` for named and numbered backreferences. + * Replacement functions can use named backreferences via `arguments[0].name`. Also fixes browser + * bugs compared to the native `String.prototype.replace` and can be used reliably cross-browser. + * + * @memberOf XRegExp + * @param {String} str String to search. + * @param {RegExp|String} search Search pattern to be replaced. + * @param {String|Function} replacement Replacement string or a function invoked to create it. + * Replacement strings can include special replacement syntax: + * - $$ - Inserts a literal $ character. + * - $&, $0 - Inserts the matched substring. + * - $` - Inserts the string that precedes the matched substring (left context). + * - $' - Inserts the string that follows the matched substring (right context). + * - $n, $nn - Where n/nn are digits referencing an existent capturing group, inserts + * backreference n/nn. + * - ${n}, $ - Where n is a name or any number of digits that reference an existent capturing + * group, inserts backreference n. + * Replacement functions are invoked with three or more arguments: + * - The matched substring (corresponds to $& above). Named backreferences are accessible as + * properties of this first argument. + * - 0..n arguments, one for each backreference (corresponding to $1, $2, etc. above). + * - The zero-based index of the match within the total search string. + * - The total string being searched. + * @param {String} [scope='one'] Use 'one' to replace the first match only, or 'all'. If not + * explicitly specified and using a regex with flag g, `scope` is 'all'. + * @returns {String} New string with one or all matches replaced. + * @example + * + * // Regex search, using named backreferences in replacement string + * const name = XRegExp('(?\\w+) (?\\w+)'); + * XRegExp.replace('John Smith', name, '$, $'); + * // -> 'Smith, John' + * + * // Regex search, using named backreferences in replacement function + * XRegExp.replace('John Smith', name, (match) => `${match.last}, ${match.first}`); + * // -> 'Smith, John' + * + * // String search, with replace-all + * XRegExp.replace('RegExp builds RegExps', 'RegExp', 'XRegExp', 'all'); + * // -> 'XRegExp builds XRegExps' + */ + + +XRegExp.replace = function (str, search, replacement, scope) { + var isRegex = XRegExp.isRegExp(search); + var global = search.global && scope !== 'one' || scope === 'all'; + var cacheKey = (global ? 'g' : '') + (search.sticky ? 'y' : '') || 'noGY'; + var s2 = search; + + if (isRegex) { + search[REGEX_DATA] = search[REGEX_DATA] || {}; // Shares cached copies with `XRegExp.exec`/`match`. Since a copy is used, `search`'s + // `lastIndex` isn't updated *during* replacement iterations + + s2 = search[REGEX_DATA][cacheKey] || (search[REGEX_DATA][cacheKey] = copyRegex(search, { + addG: !!global, + removeG: scope === 'one', + isInternalOnly: true + })); + } else if (global) { + s2 = new RegExp(XRegExp.escape(String(search)), 'g'); + } // Fixed `replace` required for named backreferences, etc. + + + var result = fixed.replace.call(toObject(str), s2, replacement); + + if (isRegex && search.global) { + // Fixes IE, Safari bug (last tested IE 9, Safari 5.1) + search.lastIndex = 0; + } + + return result; +}; +/** + * Performs batch processing of string replacements. Used like `XRegExp.replace`, but accepts an + * array of replacement details. Later replacements operate on the output of earlier replacements. + * Replacement details are accepted as an array with a regex or string to search for, the + * replacement string or function, and an optional scope of 'one' or 'all'. Uses the XRegExp + * replacement text syntax, which supports named backreference properties via `${name}` or + * `$`. + * + * @memberOf XRegExp + * @param {String} str String to search. + * @param {Array} replacements Array of replacement detail arrays. + * @returns {String} New string with all replacements. + * @example + * + * str = XRegExp.replaceEach(str, [ + * [XRegExp('(?a)'), 'z${name}'], + * [/b/gi, 'y'], + * [/c/g, 'x', 'one'], // scope 'one' overrides /g + * [/d/, 'w', 'all'], // scope 'all' overrides lack of /g + * ['e', 'v', 'all'], // scope 'all' allows replace-all for strings + * [/f/g, ($0) => $0.toUpperCase()] + * ]); + */ + + +XRegExp.replaceEach = function (str, replacements) { + var _iteratorNormalCompletion4 = true; + var _didIteratorError4 = false; + var _iteratorError4 = undefined; + + try { + for (var _iterator4 = replacements[Symbol.iterator](), _step4; !(_iteratorNormalCompletion4 = (_step4 = _iterator4.next()).done); _iteratorNormalCompletion4 = true) { + var r = _step4.value; + str = XRegExp.replace(str, r[0], r[1], r[2]); + } + } catch (err) { + _didIteratorError4 = true; + _iteratorError4 = err; + } finally { + try { + if (!_iteratorNormalCompletion4 && _iterator4.return != null) { + _iterator4.return(); + } + } finally { + if (_didIteratorError4) { + throw _iteratorError4; + } + } + } + + return str; +}; +/** + * Splits a string into an array of strings using a regex or string separator. Matches of the + * separator are not included in the result array. However, if `separator` is a regex that contains + * capturing groups, backreferences are spliced into the result each time `separator` is matched. + * Fixes browser bugs compared to the native `String.prototype.split` and can be used reliably + * cross-browser. + * + * @memberOf XRegExp + * @param {String} str String to split. + * @param {RegExp|String} separator Regex or string to use for separating the string. + * @param {Number} [limit] Maximum number of items to include in the result array. + * @returns {Array} Array of substrings. + * @example + * + * // Basic use + * XRegExp.split('a b c', ' '); + * // -> ['a', 'b', 'c'] + * + * // With limit + * XRegExp.split('a b c', ' ', 2); + * // -> ['a', 'b'] + * + * // Backreferences in result array + * XRegExp.split('..word1..', /([a-z]+)(\d+)/i); + * // -> ['..', 'word', '1', '..'] + */ + + +XRegExp.split = function (str, separator, limit) { + return fixed.split.call(toObject(str), separator, limit); +}; +/** + * Executes a regex search in a specified string. Returns `true` or `false`. Optional `pos` and + * `sticky` arguments specify the search start position, and whether the match must start at the + * specified position only. The `lastIndex` property of the provided regex is not used, but is + * updated for compatibility. Also fixes browser bugs compared to the native + * `RegExp.prototype.test` and can be used reliably cross-browser. + * + * @memberOf XRegExp + * @param {String} str String to search. + * @param {RegExp} regex Regex to search with. + * @param {Number} [pos=0] Zero-based index at which to start the search. + * @param {Boolean|String} [sticky=false] Whether the match must start at the specified position + * only. The string `'sticky'` is accepted as an alternative to `true`. + * @returns {Boolean} Whether the regex matched the provided value. + * @example + * + * // Basic use + * XRegExp.test('abc', /c/); // -> true + * + * // With pos and sticky + * XRegExp.test('abc', /c/, 0, 'sticky'); // -> false + * XRegExp.test('abc', /c/, 2, 'sticky'); // -> true + */ +// Do this the easy way :-) + + +XRegExp.test = function (str, regex, pos, sticky) { + return !!XRegExp.exec(str, regex, pos, sticky); +}; +/** + * Uninstalls optional features according to the specified options. All optional features start out + * uninstalled, so this is used to undo the actions of `XRegExp.install`. + * + * @memberOf XRegExp + * @param {Object|String} options Options object or string. + * @example + * + * // With an options object + * XRegExp.uninstall({ + * // Disables support for astral code points in Unicode addons + * astral: true, + * + * // Don't add named capture groups to the `groups` property of matches + * namespacing: true + * }); + * + * // With an options string + * XRegExp.uninstall('astral namespacing'); + */ + + +XRegExp.uninstall = function (options) { + options = prepareOptions(options); + + if (features.astral && options.astral) { + setAstral(false); + } + + if (features.namespacing && options.namespacing) { + setNamespacing(false); + } +}; +/** + * Returns an XRegExp object that is the union of the given patterns. Patterns can be provided as + * regex objects or strings. Metacharacters are escaped in patterns provided as strings. + * Backreferences in provided regex objects are automatically renumbered to work correctly within + * the larger combined pattern. Native flags used by provided regexes are ignored in favor of the + * `flags` argument. + * + * @memberOf XRegExp + * @param {Array} patterns Regexes and strings to combine. + * @param {String} [flags] Any combination of XRegExp flags. + * @param {Object} [options] Options object with optional properties: + * - `conjunction` {String} Type of conjunction to use: 'or' (default) or 'none'. + * @returns {RegExp} Union of the provided regexes and strings. + * @example + * + * XRegExp.union(['a+b*c', /(dogs)\1/, /(cats)\1/], 'i'); + * // -> /a\+b\*c|(dogs)\1|(cats)\2/i + * + * XRegExp.union([/man/, /bear/, /pig/], 'i', {conjunction: 'none'}); + * // -> /manbearpig/i + */ + + +XRegExp.union = function (patterns, flags, options) { + options = options || {}; + var conjunction = options.conjunction || 'or'; + var numCaptures = 0; + var numPriorCaptures; + var captureNames; + + function rewrite(match, paren, backref) { + var name = captureNames[numCaptures - numPriorCaptures]; // Capturing group + + if (paren) { + ++numCaptures; // If the current capture has a name, preserve the name + + if (name) { + return "(?<".concat(name, ">"); + } // Backreference + + } else if (backref) { + // Rewrite the backreference + return "\\".concat(+backref + numPriorCaptures); + } + + return match; + } + + if (!(isType(patterns, 'Array') && patterns.length)) { + throw new TypeError('Must provide a nonempty array of patterns to merge'); + } + + var parts = /(\()(?!\?)|\\([1-9]\d*)|\\[\s\S]|\[(?:[^\\\]]|\\[\s\S])*\]/g; + var output = []; + var _iteratorNormalCompletion5 = true; + var _didIteratorError5 = false; + var _iteratorError5 = undefined; + + try { + for (var _iterator5 = patterns[Symbol.iterator](), _step5; !(_iteratorNormalCompletion5 = (_step5 = _iterator5.next()).done); _iteratorNormalCompletion5 = true) { + var pattern = _step5.value; + + if (XRegExp.isRegExp(pattern)) { + numPriorCaptures = numCaptures; + captureNames = pattern[REGEX_DATA] && pattern[REGEX_DATA].captureNames || []; // Rewrite backreferences. Passing to XRegExp dies on octals and ensures patterns are + // independently valid; helps keep this simple. Named captures are put back + + output.push(nativ.replace.call(XRegExp(pattern.source).source, parts, rewrite)); + } else { + output.push(XRegExp.escape(pattern)); + } + } + } catch (err) { + _didIteratorError5 = true; + _iteratorError5 = err; + } finally { + try { + if (!_iteratorNormalCompletion5 && _iterator5.return != null) { + _iterator5.return(); + } + } finally { + if (_didIteratorError5) { + throw _iteratorError5; + } + } + } + + var separator = conjunction === 'none' ? '' : '|'; + return XRegExp(output.join(separator), flags); +}; // ==--------------------------== +// Fixed/extended native methods +// ==--------------------------== + +/** + * Adds named capture support (with backreferences returned as `result.name`), and fixes browser + * bugs in the native `RegExp.prototype.exec`. Use via `XRegExp.exec`. + * + * @memberOf RegExp + * @param {String} str String to search. + * @returns {Array} Match array with named backreference properties, or `null`. + */ + + +fixed.exec = function (str) { + var origLastIndex = this.lastIndex; + var match = nativ.exec.apply(this, arguments); + + if (match) { + // Fix browsers whose `exec` methods don't return `undefined` for nonparticipating capturing + // groups. This fixes IE 5.5-8, but not IE 9's quirks mode or emulation of older IEs. IE 9 + // in standards mode follows the spec. + if (!correctExecNpcg && match.length > 1 && match.indexOf('') !== -1) { + var r2 = copyRegex(this, { + removeG: true, + isInternalOnly: true + }); // Using `str.slice(match.index)` rather than `match[0]` in case lookahead allowed + // matching due to characters outside the match + + nativ.replace.call(String(str).slice(match.index), r2, function () { + var len = arguments.length; // Skip index 0 and the last 2 + + for (var i = 1; i < len - 2; ++i) { + if ((i < 0 || arguments.length <= i ? undefined : arguments[i]) === undefined) { + match[i] = undefined; + } + } + }); + } // Attach named capture properties + + + var groupsObject = match; + + if (XRegExp.isInstalled('namespacing')) { + // https://tc39.github.io/proposal-regexp-named-groups/#sec-regexpbuiltinexec + match.groups = Object.create(null); + groupsObject = match.groups; + } + + if (this[REGEX_DATA] && this[REGEX_DATA].captureNames) { + // Skip index 0 + for (var i = 1; i < match.length; ++i) { + var name = this[REGEX_DATA].captureNames[i - 1]; + + if (name) { + groupsObject[name] = match[i]; + } + } + } // Fix browsers that increment `lastIndex` after zero-length matches + + + if (this.global && !match[0].length && this.lastIndex > match.index) { + this.lastIndex = match.index; + } + } + + if (!this.global) { + // Fixes IE, Opera bug (last tested IE 9, Opera 11.6) + this.lastIndex = origLastIndex; + } + + return match; +}; +/** + * Fixes browser bugs in the native `RegExp.prototype.test`. + * + * @memberOf RegExp + * @param {String} str String to search. + * @returns {Boolean} Whether the regex matched the provided value. + */ + + +fixed.test = function (str) { + // Do this the easy way :-) + return !!fixed.exec.call(this, str); +}; +/** + * Adds named capture support (with backreferences returned as `result.name`), and fixes browser + * bugs in the native `String.prototype.match`. + * + * @memberOf String + * @param {RegExp|*} regex Regex to search with. If not a regex object, it is passed to `RegExp`. + * @returns {Array} If `regex` uses flag g, an array of match strings or `null`. Without flag g, + * the result of calling `regex.exec(this)`. + */ + + +fixed.match = function (regex) { + if (!XRegExp.isRegExp(regex)) { + // Use the native `RegExp` rather than `XRegExp` + regex = new RegExp(regex); + } else if (regex.global) { + var result = nativ.match.apply(this, arguments); // Fixes IE bug + + regex.lastIndex = 0; + return result; + } + + return fixed.exec.call(regex, toObject(this)); +}; +/** + * Adds support for `${n}` (or `$`) tokens for named and numbered backreferences in replacement + * text, and provides named backreferences to replacement functions as `arguments[0].name`. Also + * fixes browser bugs in replacement text syntax when performing a replacement using a nonregex + * search value, and the value of a replacement regex's `lastIndex` property during replacement + * iterations and upon completion. Note that this doesn't support SpiderMonkey's proprietary third + * (`flags`) argument. Use via `XRegExp.replace`. + * + * @memberOf String + * @param {RegExp|String} search Search pattern to be replaced. + * @param {String|Function} replacement Replacement string or a function invoked to create it. + * @returns {String} New string with one or all matches replaced. + */ + + +fixed.replace = function (search, replacement) { + var isRegex = XRegExp.isRegExp(search); + var origLastIndex; + var captureNames; + var result; + + if (isRegex) { + if (search[REGEX_DATA]) { + captureNames = search[REGEX_DATA].captureNames; + } // Only needed if `search` is nonglobal + + + origLastIndex = search.lastIndex; + } else { + search += ''; // Type-convert + } // Don't use `typeof`; some older browsers return 'function' for regex objects + + + if (isType(replacement, 'Function')) { + // Stringifying `this` fixes a bug in IE < 9 where the last argument in replacement + // functions isn't type-converted to a string + result = nativ.replace.call(String(this), search, function () { + for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) { + args[_key] = arguments[_key]; + } + + if (captureNames) { + var groupsObject; + + if (XRegExp.isInstalled('namespacing')) { + // https://tc39.github.io/proposal-regexp-named-groups/#sec-regexpbuiltinexec + groupsObject = Object.create(null); + args.push(groupsObject); + } else { + // Change the `args[0]` string primitive to a `String` object that can store + // properties. This really does need to use `String` as a constructor + args[0] = new String(args[0]); + groupsObject = args[0]; + } // Store named backreferences + + + for (var i = 0; i < captureNames.length; ++i) { + if (captureNames[i]) { + groupsObject[captureNames[i]] = args[i + 1]; + } + } + } // Update `lastIndex` before calling `replacement`. Fixes IE, Chrome, Firefox, Safari + // bug (last tested IE 9, Chrome 17, Firefox 11, Safari 5.1) + + + if (isRegex && search.global) { + search.lastIndex = args[args.length - 2] + args[0].length; + } // ES6 specs the context for replacement functions as `undefined` + + + return replacement.apply(void 0, args); + }); + } else { + // Ensure that the last value of `args` will be a string when given nonstring `this`, + // while still throwing on null or undefined context + result = nativ.replace.call(this == null ? this : String(this), search, function () { + for (var _len2 = arguments.length, args = new Array(_len2), _key2 = 0; _key2 < _len2; _key2++) { + args[_key2] = arguments[_key2]; + } + + return nativ.replace.call(String(replacement), replacementToken, replacer); + + function replacer($0, bracketed, angled, dollarToken) { + bracketed = bracketed || angled; // Named or numbered backreference with curly or angled braces + + if (bracketed) { + // XRegExp behavior for `${n}` or `$`: + // 1. Backreference to numbered capture, if `n` is an integer. Use `0` for the + // entire match. Any number of leading zeros may be used. + // 2. Backreference to named capture `n`, if it exists and is not an integer + // overridden by numbered capture. In practice, this does not overlap with + // numbered capture since XRegExp does not allow named capture to use a bare + // integer as the name. + // 3. If the name or number does not refer to an existing capturing group, it's + // an error. + var n = +bracketed; // Type-convert; drop leading zeros + + if (n <= args.length - 3) { + return args[n] || ''; + } // Groups with the same name is an error, else would need `lastIndexOf` + + + n = captureNames ? captureNames.indexOf(bracketed) : -1; + + if (n < 0) { + throw new SyntaxError("Backreference to undefined group ".concat($0)); + } + + return args[n + 1] || ''; + } // Else, special variable or numbered backreference without curly braces + + + if (dollarToken === '$') { + // $$ + return '$'; + } + + if (dollarToken === '&' || +dollarToken === 0) { + // $&, $0 (not followed by 1-9), $00 + return args[0]; + } + + if (dollarToken === '`') { + // $` (left context) + return args[args.length - 1].slice(0, args[args.length - 2]); + } + + if (dollarToken === "'") { + // $' (right context) + return args[args.length - 1].slice(args[args.length - 2] + args[0].length); + } // Else, numbered backreference without braces + + + dollarToken = +dollarToken; // Type-convert; drop leading zero + // XRegExp behavior for `$n` and `$nn`: + // - Backrefs end after 1 or 2 digits. Use `${..}` or `$<..>` for more digits. + // - `$1` is an error if no capturing groups. + // - `$10` is an error if less than 10 capturing groups. Use `${1}0` or `$<1>0` + // instead. + // - `$01` is `$1` if at least one capturing group, else it's an error. + // - `$0` (not followed by 1-9) and `$00` are the entire match. + // Native behavior, for comparison: + // - Backrefs end after 1 or 2 digits. Cannot reference capturing group 100+. + // - `$1` is a literal `$1` if no capturing groups. + // - `$10` is `$1` followed by a literal `0` if less than 10 capturing groups. + // - `$01` is `$1` if at least one capturing group, else it's a literal `$01`. + // - `$0` is a literal `$0`. + + if (!isNaN(dollarToken)) { + if (dollarToken > args.length - 3) { + throw new SyntaxError("Backreference to undefined group ".concat($0)); + } + + return args[dollarToken] || ''; + } // `$` followed by an unsupported char is an error, unlike native JS + + + throw new SyntaxError("Invalid token ".concat($0)); + } + }); + } + + if (isRegex) { + if (search.global) { + // Fixes IE, Safari bug (last tested IE 9, Safari 5.1) + search.lastIndex = 0; + } else { + // Fixes IE, Opera bug (last tested IE 9, Opera 11.6) + search.lastIndex = origLastIndex; + } + } + + return result; +}; +/** + * Fixes browser bugs in the native `String.prototype.split`. Use via `XRegExp.split`. + * + * @memberOf String + * @param {RegExp|String} separator Regex or string to use for separating the string. + * @param {Number} [limit] Maximum number of items to include in the result array. + * @returns {Array} Array of substrings. + */ + + +fixed.split = function (separator, limit) { + if (!XRegExp.isRegExp(separator)) { + // Browsers handle nonregex split correctly, so use the faster native method + return nativ.split.apply(this, arguments); + } + + var str = String(this); + var output = []; + var origLastIndex = separator.lastIndex; + var lastLastIndex = 0; + var lastLength; // Values for `limit`, per the spec: + // If undefined: pow(2,32) - 1 + // If 0, Infinity, or NaN: 0 + // If positive number: limit = floor(limit); if (limit >= pow(2,32)) limit -= pow(2,32); + // If negative number: pow(2,32) - floor(abs(limit)) + // If other: Type-convert, then use the above rules + // This line fails in very strange ways for some values of `limit` in Opera 10.5-10.63, unless + // Opera Dragonfly is open (go figure). It works in at least Opera 9.5-10.1 and 11+ + + limit = (limit === undefined ? -1 : limit) >>> 0; + XRegExp.forEach(str, separator, function (match) { + // This condition is not the same as `if (match[0].length)` + if (match.index + match[0].length > lastLastIndex) { + output.push(str.slice(lastLastIndex, match.index)); + + if (match.length > 1 && match.index < str.length) { + Array.prototype.push.apply(output, match.slice(1)); + } + + lastLength = match[0].length; + lastLastIndex = match.index + lastLength; + } + }); + + if (lastLastIndex === str.length) { + if (!nativ.test.call(separator, '') || lastLength) { + output.push(''); + } + } else { + output.push(str.slice(lastLastIndex)); + } + + separator.lastIndex = origLastIndex; + return output.length > limit ? output.slice(0, limit) : output; +}; // ==--------------------------== +// Built-in syntax/flag tokens +// ==--------------------------== + +/* + * Letter escapes that natively match literal characters: `\a`, `\A`, etc. These should be + * SyntaxErrors but are allowed in web reality. XRegExp makes them errors for cross-browser + * consistency and to reserve their syntax, but lets them be superseded by addons. + */ + + +XRegExp.addToken(/\\([ABCE-RTUVXYZaeg-mopqyz]|c(?![A-Za-z])|u(?![\dA-Fa-f]{4}|{[\dA-Fa-f]+})|x(?![\dA-Fa-f]{2}))/, function (match, scope) { + // \B is allowed in default scope only + if (match[1] === 'B' && scope === defaultScope) { + return match[0]; + } + + throw new SyntaxError("Invalid escape ".concat(match[0])); +}, { + scope: 'all', + leadChar: '\\' +}); +/* + * Unicode code point escape with curly braces: `\u{N..}`. `N..` is any one or more digit + * hexadecimal number from 0-10FFFF, and can include leading zeros. Requires the native ES6 `u` flag + * to support code points greater than U+FFFF. Avoids converting code points above U+FFFF to + * surrogate pairs (which could be done without flag `u`), since that could lead to broken behavior + * if you follow a `\u{N..}` token that references a code point above U+FFFF with a quantifier, or + * if you use the same in a character class. + */ + +XRegExp.addToken(/\\u{([\dA-Fa-f]+)}/, function (match, scope, flags) { + var code = dec(match[1]); + + if (code > 0x10FFFF) { + throw new SyntaxError("Invalid Unicode code point ".concat(match[0])); + } + + if (code <= 0xFFFF) { + // Converting to \uNNNN avoids needing to escape the literal character and keep it + // separate from preceding tokens + return "\\u".concat(pad4(hex(code))); + } // If `code` is between 0xFFFF and 0x10FFFF, require and defer to native handling + + + if (hasNativeU && flags.indexOf('u') !== -1) { + return match[0]; + } + + throw new SyntaxError('Cannot use Unicode code point above \\u{FFFF} without flag u'); +}, { + scope: 'all', + leadChar: '\\' +}); +/* + * Empty character class: `[]` or `[^]`. This fixes a critical cross-browser syntax inconsistency. + * Unless this is standardized (per the ES spec), regex syntax can't be accurately parsed because + * character class endings can't be determined. + */ + +XRegExp.addToken(/\[(\^?)\]/, // For cross-browser compatibility with ES3, convert [] to \b\B and [^] to [\s\S]. +// (?!) should work like \b\B, but is unreliable in some versions of Firefox + +/* eslint-disable no-confusing-arrow */ +function (match) { + return match[1] ? '[\\s\\S]' : '\\b\\B'; +}, +/* eslint-enable no-confusing-arrow */ +{ + leadChar: '[' +}); +/* + * Comment pattern: `(?# )`. Inline comments are an alternative to the line comments allowed in + * free-spacing mode (flag x). + */ + +XRegExp.addToken(/\(\?#[^)]*\)/, getContextualTokenSeparator, { + leadChar: '(' +}); +/* + * Whitespace and line comments, in free-spacing mode (aka extended mode, flag x) only. + */ + +XRegExp.addToken(/\s+|#[^\n]*\n?/, getContextualTokenSeparator, { + flag: 'x' +}); +/* + * Dot, in dotall mode (aka singleline mode, flag s) only. + */ + +XRegExp.addToken(/\./, function () { + return '[\\s\\S]'; +}, { + flag: 's', + leadChar: '.' +}); +/* + * Named backreference: `\k`. Backreference names can use the characters A-Z, a-z, 0-9, _, + * and $ only. Also allows numbered backreferences as `\k`. + */ + +XRegExp.addToken(/\\k<([\w$]+)>/, function (match) { + // Groups with the same name is an error, else would need `lastIndexOf` + var index = isNaN(match[1]) ? this.captureNames.indexOf(match[1]) + 1 : +match[1]; + var endIndex = match.index + match[0].length; + + if (!index || index > this.captureNames.length) { + throw new SyntaxError("Backreference to undefined group ".concat(match[0])); + } // Keep backreferences separate from subsequent literal numbers. This avoids e.g. + // inadvertedly changing `(?)\k1` to `()\11`. + + + return "\\".concat(index).concat(endIndex === match.input.length || isNaN(match.input[endIndex]) ? '' : '(?:)'); +}, { + leadChar: '\\' +}); +/* + * Numbered backreference or octal, plus any following digits: `\0`, `\11`, etc. Octals except `\0` + * not followed by 0-9 and backreferences to unopened capture groups throw an error. Other matches + * are returned unaltered. IE < 9 doesn't support backreferences above `\99` in regex syntax. + */ + +XRegExp.addToken(/\\(\d+)/, function (match, scope) { + if (!(scope === defaultScope && /^[1-9]/.test(match[1]) && +match[1] <= this.captureNames.length) && match[1] !== '0') { + throw new SyntaxError("Cannot use octal escape or backreference to undefined group ".concat(match[0])); + } + + return match[0]; +}, { + scope: 'all', + leadChar: '\\' +}); +/* + * Named capturing group; match the opening delimiter only: `(?`. Capture names can use the + * characters A-Z, a-z, 0-9, _, and $ only. Names can't be integers. Supports Python-style + * `(?P` as an alternate syntax to avoid issues in some older versions of Opera which natively + * supported the Python-style syntax. Otherwise, XRegExp might treat numbered backreferences to + * Python-style named capture as octals. + */ + +XRegExp.addToken(/\(\?P?<([\w$]+)>/, function (match) { + // Disallow bare integers as names because named backreferences are added to match arrays + // and therefore numeric properties may lead to incorrect lookups + if (!isNaN(match[1])) { + throw new SyntaxError("Cannot use integer as capture name ".concat(match[0])); + } + + if (!XRegExp.isInstalled('namespacing') && (match[1] === 'length' || match[1] === '__proto__')) { + throw new SyntaxError("Cannot use reserved word as capture name ".concat(match[0])); + } + + if (this.captureNames.indexOf(match[1]) !== -1) { + throw new SyntaxError("Cannot use same name for multiple groups ".concat(match[0])); + } + + this.captureNames.push(match[1]); + this.hasNamedCapture = true; + return '('; +}, { + leadChar: '(' +}); +/* + * Capturing group; match the opening parenthesis only. Required for support of named capturing + * groups. Also adds explicit capture mode (flag n). + */ + +XRegExp.addToken(/\((?!\?)/, function (match, scope, flags) { + if (flags.indexOf('n') !== -1) { + return '(?:'; + } + + this.captureNames.push(null); + return '('; +}, { + optionalFlags: 'n', + leadChar: '(' +}); +var _default = XRegExp; +exports.default = _default; +module.exports = exports["default"]; +}); + +unwrapExports(xregexp); + +var build = createCommonjsModule(function (module, exports) { +"use strict"; + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.default = void 0; + +/*! + * XRegExp.build 4.2.0 + * + * Steven Levithan (c) 2012-present MIT License + */ +var _default = function _default(XRegExp) { + var REGEX_DATA = 'xregexp'; + var subParts = /(\()(?!\?)|\\([1-9]\d*)|\\[\s\S]|\[(?:[^\\\]]|\\[\s\S])*\]/g; + var parts = XRegExp.union([/\({{([\w$]+)}}\)|{{([\w$]+)}}/, subParts], 'g', { + conjunction: 'or' + }); + /** + * Strips a leading `^` and trailing unescaped `$`, if both are present. + * + * @private + * @param {String} pattern Pattern to process. + * @returns {String} Pattern with edge anchors removed. + */ + + function deanchor(pattern) { + // Allow any number of empty noncapturing groups before/after anchors, because regexes + // built/generated by XRegExp sometimes include them + var leadingAnchor = /^(?:\(\?:\))*\^/; + var trailingAnchor = /\$(?:\(\?:\))*$/; + + if (leadingAnchor.test(pattern) && trailingAnchor.test(pattern) && // Ensure that the trailing `$` isn't escaped + trailingAnchor.test(pattern.replace(/\\[\s\S]/g, ''))) { + return pattern.replace(leadingAnchor, '').replace(trailingAnchor, ''); + } + + return pattern; + } + /** + * Converts the provided value to an XRegExp. Native RegExp flags are not preserved. + * + * @private + * @param {String|RegExp} value Value to convert. + * @param {Boolean} [addFlagX] Whether to apply the `x` flag in cases when `value` is not + * already a regex generated by XRegExp + * @returns {RegExp} XRegExp object with XRegExp syntax applied. + */ + + + function asXRegExp(value, addFlagX) { + var flags = addFlagX ? 'x' : ''; + return XRegExp.isRegExp(value) ? value[REGEX_DATA] && value[REGEX_DATA].captureNames ? // Don't recompile, to preserve capture names + value : // Recompile as XRegExp + XRegExp(value.source, flags) : // Compile string as XRegExp + XRegExp(value, flags); + } + + function interpolate(substitution) { + return substitution instanceof RegExp ? substitution : XRegExp.escape(substitution); + } + + function reduceToSubpatternsObject(subpatterns, interpolated, subpatternIndex) { + subpatterns["subpattern".concat(subpatternIndex)] = interpolated; + return subpatterns; + } + + function embedSubpatternAfter(raw, subpatternIndex, rawLiterals) { + var hasSubpattern = subpatternIndex < rawLiterals.length - 1; + return raw + (hasSubpattern ? "{{subpattern".concat(subpatternIndex, "}}") : ''); + } + /** + * Provides tagged template literals that create regexes with XRegExp syntax and flags. The + * provided pattern is handled as a raw string, so backslashes don't need to be escaped. + * + * Interpolation of strings and regexes shares the features of `XRegExp.build`. Interpolated + * patterns are treated as atomic units when quantified, interpolated strings have their special + * characters escaped, a leading `^` and trailing unescaped `$` are stripped from interpolated + * regexes if both are present, and any backreferences within an interpolated regex are + * rewritten to work within the overall pattern. + * + * @memberOf XRegExp + * @param {String} [flags] Any combination of XRegExp flags. + * @returns {Function} Handler for template literals that construct regexes with XRegExp syntax. + * @example + * + * const h12 = /1[0-2]|0?[1-9]/; + * const h24 = /2[0-3]|[01][0-9]/; + * const hours = XRegExp.tag('x')`${h12} : | ${h24}`; + * const minutes = /^[0-5][0-9]$/; + * // Note that explicitly naming the 'minutes' group is required for named backreferences + * const time = XRegExp.tag('x')`^ ${hours} (?${minutes}) $`; + * time.test('10:59'); // -> true + * XRegExp.exec('10:59', time).minutes; // -> '59' + */ + + + XRegExp.tag = function (flags) { + return function (literals) { + for (var _len = arguments.length, substitutions = new Array(_len > 1 ? _len - 1 : 0), _key = 1; _key < _len; _key++) { + substitutions[_key - 1] = arguments[_key]; + } + + var subpatterns = substitutions.map(interpolate).reduce(reduceToSubpatternsObject, {}); + var pattern = literals.raw.map(embedSubpatternAfter).join(''); + return XRegExp.build(pattern, subpatterns, flags); + }; + }; + /** + * Builds regexes using named subpatterns, for readability and pattern reuse. Backreferences in + * the outer pattern and provided subpatterns are automatically renumbered to work correctly. + * Native flags used by provided subpatterns are ignored in favor of the `flags` argument. + * + * @memberOf XRegExp + * @param {String} pattern XRegExp pattern using `{{name}}` for embedded subpatterns. Allows + * `({{name}})` as shorthand for `(?{{name}})`. Patterns cannot be embedded within + * character classes. + * @param {Object} subs Lookup object for named subpatterns. Values can be strings or regexes. A + * leading `^` and trailing unescaped `$` are stripped from subpatterns, if both are present. + * @param {String} [flags] Any combination of XRegExp flags. + * @returns {RegExp} Regex with interpolated subpatterns. + * @example + * + * const time = XRegExp.build('(?x)^ {{hours}} ({{minutes}}) $', { + * hours: XRegExp.build('{{h12}} : | {{h24}}', { + * h12: /1[0-2]|0?[1-9]/, + * h24: /2[0-3]|[01][0-9]/ + * }, 'x'), + * minutes: /^[0-5][0-9]$/ + * }); + * time.test('10:59'); // -> true + * XRegExp.exec('10:59', time).minutes; // -> '59' + */ + + + XRegExp.build = function (pattern, subs, flags) { + flags = flags || ''; // Used with `asXRegExp` calls for `pattern` and subpatterns in `subs`, to work around how + // some browsers convert `RegExp('\n')` to a regex that contains the literal characters `\` + // and `n`. See more details at . + + var addFlagX = flags.indexOf('x') !== -1; + var inlineFlags = /^\(\?([\w$]+)\)/.exec(pattern); // Add flags within a leading mode modifier to the overall pattern's flags + + if (inlineFlags) { + flags = XRegExp._clipDuplicates(flags + inlineFlags[1]); + } + + var data = {}; + + for (var p in subs) { + if (subs.hasOwnProperty(p)) { + // Passing to XRegExp enables extended syntax and ensures independent validity, + // lest an unescaped `(`, `)`, `[`, or trailing `\` breaks the `(?:)` wrapper. For + // subpatterns provided as native regexes, it dies on octals and adds the property + // used to hold extended regex instance data, for simplicity. + var sub = asXRegExp(subs[p], addFlagX); + data[p] = { + // Deanchoring allows embedding independently useful anchored regexes. If you + // really need to keep your anchors, double them (i.e., `^^...$$`). + pattern: deanchor(sub.source), + names: sub[REGEX_DATA].captureNames || [] + }; + } + } // Passing to XRegExp dies on octals and ensures the outer pattern is independently valid; + // helps keep this simple. Named captures will be put back. + + + var patternAsRegex = asXRegExp(pattern, addFlagX); // 'Caps' is short for 'captures' + + var numCaps = 0; + var numPriorCaps; + var numOuterCaps = 0; + var outerCapsMap = [0]; + var outerCapNames = patternAsRegex[REGEX_DATA].captureNames || []; + var output = patternAsRegex.source.replace(parts, function ($0, $1, $2, $3, $4) { + var subName = $1 || $2; + var capName; + var intro; + var localCapIndex; // Named subpattern + + if (subName) { + if (!data.hasOwnProperty(subName)) { + throw new ReferenceError("Undefined property ".concat($0)); + } // Named subpattern was wrapped in a capturing group + + + if ($1) { + capName = outerCapNames[numOuterCaps]; + outerCapsMap[++numOuterCaps] = ++numCaps; // If it's a named group, preserve the name. Otherwise, use the subpattern name + // as the capture name + + intro = "(?<".concat(capName || subName, ">"); + } else { + intro = '(?:'; + } + + numPriorCaps = numCaps; + var rewrittenSubpattern = data[subName].pattern.replace(subParts, function (match, paren, backref) { + // Capturing group + if (paren) { + capName = data[subName].names[numCaps - numPriorCaps]; + ++numCaps; // If the current capture has a name, preserve the name + + if (capName) { + return "(?<".concat(capName, ">"); + } // Backreference + + } else if (backref) { + localCapIndex = +backref - 1; // Rewrite the backreference + + return data[subName].names[localCapIndex] ? // Need to preserve the backreference name in case using flag `n` + "\\k<".concat(data[subName].names[localCapIndex], ">") : "\\".concat(+backref + numPriorCaps); + } + + return match; + }); + return "".concat(intro).concat(rewrittenSubpattern, ")"); + } // Capturing group + + + if ($3) { + capName = outerCapNames[numOuterCaps]; + outerCapsMap[++numOuterCaps] = ++numCaps; // If the current capture has a name, preserve the name + + if (capName) { + return "(?<".concat(capName, ">"); + } // Backreference + + } else if ($4) { + localCapIndex = +$4 - 1; // Rewrite the backreference + + return outerCapNames[localCapIndex] ? // Need to preserve the backreference name in case using flag `n` + "\\k<".concat(outerCapNames[localCapIndex], ">") : "\\".concat(outerCapsMap[+$4]); + } + + return $0; + }); + return XRegExp(output, flags); + }; +}; + +exports.default = _default; +module.exports = exports["default"]; +}); + +unwrapExports(build); + +var matchrecursive = createCommonjsModule(function (module, exports) { +"use strict"; + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.default = void 0; + +/*! + * XRegExp.matchRecursive 4.2.0 + * + * Steven Levithan (c) 2009-present MIT License + */ +var _default = function _default(XRegExp) { + /** + * Returns a match detail object composed of the provided values. + * + * @private + */ + function row(name, value, start, end) { + return { + name: name, + value: value, + start: start, + end: end + }; + } + /** + * Returns an array of match strings between outermost left and right delimiters, or an array of + * objects with detailed match parts and position data. An error is thrown if delimiters are + * unbalanced within the data. + * + * @memberOf XRegExp + * @param {String} str String to search. + * @param {String} left Left delimiter as an XRegExp pattern. + * @param {String} right Right delimiter as an XRegExp pattern. + * @param {String} [flags] Any native or XRegExp flags, used for the left and right delimiters. + * @param {Object} [options] Lets you specify `valueNames` and `escapeChar` options. + * @returns {Array} Array of matches, or an empty array. + * @example + * + * // Basic usage + * let str = '(t((e))s)t()(ing)'; + * XRegExp.matchRecursive(str, '\\(', '\\)', 'g'); + * // -> ['t((e))s', '', 'ing'] + * + * // Extended information mode with valueNames + * str = 'Here is
an
example'; + * XRegExp.matchRecursive(str, '', '', 'gi', { + * valueNames: ['between', 'left', 'match', 'right'] + * }); + * // -> [ + * // {name: 'between', value: 'Here is ', start: 0, end: 8}, + * // {name: 'left', value: '
', start: 8, end: 13}, + * // {name: 'match', value: '
an
', start: 13, end: 27}, + * // {name: 'right', value: '
', start: 27, end: 33}, + * // {name: 'between', value: ' example', start: 33, end: 41} + * // ] + * + * // Omitting unneeded parts with null valueNames, and using escapeChar + * str = '...{1}.\\{{function(x,y){return {y:x}}}'; + * XRegExp.matchRecursive(str, '{', '}', 'g', { + * valueNames: ['literal', null, 'value', null], + * escapeChar: '\\' + * }); + * // -> [ + * // {name: 'literal', value: '...', start: 0, end: 3}, + * // {name: 'value', value: '1', start: 4, end: 5}, + * // {name: 'literal', value: '.\\{', start: 6, end: 9}, + * // {name: 'value', value: 'function(x,y){return {y:x}}', start: 10, end: 37} + * // ] + * + * // Sticky mode via flag y + * str = '<1><<<2>>><3>4<5>'; + * XRegExp.matchRecursive(str, '<', '>', 'gy'); + * // -> ['1', '<<2>>', '3'] + */ + + + XRegExp.matchRecursive = function (str, left, right, flags, options) { + flags = flags || ''; + options = options || {}; + var global = flags.indexOf('g') !== -1; + var sticky = flags.indexOf('y') !== -1; // Flag `y` is controlled internally + + var basicFlags = flags.replace(/y/g, ''); + var _options = options, + escapeChar = _options.escapeChar; + var vN = options.valueNames; + var output = []; + var openTokens = 0; + var delimStart = 0; + var delimEnd = 0; + var lastOuterEnd = 0; + var outerStart; + var innerStart; + var leftMatch; + var rightMatch; + var esc; + left = XRegExp(left, basicFlags); + right = XRegExp(right, basicFlags); + + if (escapeChar) { + if (escapeChar.length > 1) { + throw new Error('Cannot use more than one escape character'); + } + + escapeChar = XRegExp.escape(escapeChar); // Example of concatenated `esc` regex: + // `escapeChar`: '%' + // `left`: '<' + // `right`: '>' + // Regex is: /(?:%[\S\s]|(?:(?!<|>)[^%])+)+/ + + esc = new RegExp("(?:".concat(escapeChar, "[\\S\\s]|(?:(?!").concat( // Using `XRegExp.union` safely rewrites backreferences in `left` and `right`. + // Intentionally not passing `basicFlags` to `XRegExp.union` since any syntax + // transformation resulting from those flags was already applied to `left` and + // `right` when they were passed through the XRegExp constructor above. + XRegExp.union([left, right], '', { + conjunction: 'or' + }).source, ")[^").concat(escapeChar, "])+)+"), // Flags `gy` not needed here + flags.replace(/[^imu]+/g, '')); + } + + while (true) { + // If using an escape character, advance to the delimiter's next starting position, + // skipping any escaped characters in between + if (escapeChar) { + delimEnd += (XRegExp.exec(str, esc, delimEnd, 'sticky') || [''])[0].length; + } + + leftMatch = XRegExp.exec(str, left, delimEnd); + rightMatch = XRegExp.exec(str, right, delimEnd); // Keep the leftmost match only + + if (leftMatch && rightMatch) { + if (leftMatch.index <= rightMatch.index) { + rightMatch = null; + } else { + leftMatch = null; + } + } // Paths (LM: leftMatch, RM: rightMatch, OT: openTokens): + // LM | RM | OT | Result + // 1 | 0 | 1 | loop + // 1 | 0 | 0 | loop + // 0 | 1 | 1 | loop + // 0 | 1 | 0 | throw + // 0 | 0 | 1 | throw + // 0 | 0 | 0 | break + // The paths above don't include the sticky mode special case. The loop ends after the + // first completed match if not `global`. + + + if (leftMatch || rightMatch) { + delimStart = (leftMatch || rightMatch).index; + delimEnd = delimStart + (leftMatch || rightMatch)[0].length; + } else if (!openTokens) { + break; + } + + if (sticky && !openTokens && delimStart > lastOuterEnd) { + break; + } + + if (leftMatch) { + if (!openTokens) { + outerStart = delimStart; + innerStart = delimEnd; + } + + ++openTokens; + } else if (rightMatch && openTokens) { + if (! --openTokens) { + if (vN) { + if (vN[0] && outerStart > lastOuterEnd) { + output.push(row(vN[0], str.slice(lastOuterEnd, outerStart), lastOuterEnd, outerStart)); + } + + if (vN[1]) { + output.push(row(vN[1], str.slice(outerStart, innerStart), outerStart, innerStart)); + } + + if (vN[2]) { + output.push(row(vN[2], str.slice(innerStart, delimStart), innerStart, delimStart)); + } + + if (vN[3]) { + output.push(row(vN[3], str.slice(delimStart, delimEnd), delimStart, delimEnd)); + } + } else { + output.push(str.slice(innerStart, delimStart)); + } + + lastOuterEnd = delimEnd; + + if (!global) { + break; + } + } + } else { + throw new Error('Unbalanced delimiter found in string'); + } // If the delimiter matched an empty string, avoid an infinite loop + + + if (delimStart === delimEnd) { + ++delimEnd; + } + } + + if (global && !sticky && vN && vN[0] && str.length > lastOuterEnd) { + output.push(row(vN[0], str.slice(lastOuterEnd), lastOuterEnd, str.length)); + } + + return output; + }; +}; + +exports.default = _default; +module.exports = exports["default"]; +}); + +unwrapExports(matchrecursive); + +var unicodeBase = createCommonjsModule(function (module, exports) { +"use strict"; + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.default = void 0; + +/*! + * XRegExp Unicode Base 4.2.0 + * + * Steven Levithan (c) 2008-present MIT License + */ +var _default = function _default(XRegExp) { + /** + * Adds base support for Unicode matching: + * - Adds syntax `\p{..}` for matching Unicode tokens. Tokens can be inverted using `\P{..}` or + * `\p{^..}`. Token names ignore case, spaces, hyphens, and underscores. You can omit the + * braces for token names that are a single letter (e.g. `\pL` or `PL`). + * - Adds flag A (astral), which enables 21-bit Unicode support. + * - Adds the `XRegExp.addUnicodeData` method used by other addons to provide character data. + * + * Unicode Base relies on externally provided Unicode character data. Official addons are + * available to provide data for Unicode categories, scripts, blocks, and properties. + * + * @requires XRegExp + */ + // ==--------------------------== + // Private stuff + // ==--------------------------== + // Storage for Unicode data + var unicode = {}; // Reuse utils + + var dec = XRegExp._dec; + var hex = XRegExp._hex; + var pad4 = XRegExp._pad4; // Generates a token lookup name: lowercase, with hyphens, spaces, and underscores removed + + function normalize(name) { + return name.replace(/[- _]+/g, '').toLowerCase(); + } // Gets the decimal code of a literal code unit, \xHH, \uHHHH, or a backslash-escaped literal + + + function charCode(chr) { + var esc = /^\\[xu](.+)/.exec(chr); + return esc ? dec(esc[1]) : chr.charCodeAt(chr[0] === '\\' ? 1 : 0); + } // Inverts a list of ordered BMP characters and ranges + + + function invertBmp(range) { + var output = ''; + var lastEnd = -1; + XRegExp.forEach(range, /(\\x..|\\u....|\\?[\s\S])(?:-(\\x..|\\u....|\\?[\s\S]))?/, function (m) { + var start = charCode(m[1]); + + if (start > lastEnd + 1) { + output += "\\u".concat(pad4(hex(lastEnd + 1))); + + if (start > lastEnd + 2) { + output += "-\\u".concat(pad4(hex(start - 1))); + } + } + + lastEnd = charCode(m[2] || m[1]); + }); + + if (lastEnd < 0xFFFF) { + output += "\\u".concat(pad4(hex(lastEnd + 1))); + + if (lastEnd < 0xFFFE) { + output += '-\\uFFFF'; + } + } + + return output; + } // Generates an inverted BMP range on first use + + + function cacheInvertedBmp(slug) { + var prop = 'b!'; + return unicode[slug][prop] || (unicode[slug][prop] = invertBmp(unicode[slug].bmp)); + } // Combines and optionally negates BMP and astral data + + + function buildAstral(slug, isNegated) { + var item = unicode[slug]; + var combined = ''; + + if (item.bmp && !item.isBmpLast) { + combined = "[".concat(item.bmp, "]").concat(item.astral ? '|' : ''); + } + + if (item.astral) { + combined += item.astral; + } + + if (item.isBmpLast && item.bmp) { + combined += "".concat(item.astral ? '|' : '', "[").concat(item.bmp, "]"); + } // Astral Unicode tokens always match a code point, never a code unit + + + return isNegated ? "(?:(?!".concat(combined, ")(?:[\uD800-\uDBFF][\uDC00-\uDFFF]|[\0-\uFFFF]))") : "(?:".concat(combined, ")"); + } // Builds a complete astral pattern on first use + + + function cacheAstral(slug, isNegated) { + var prop = isNegated ? 'a!' : 'a='; + return unicode[slug][prop] || (unicode[slug][prop] = buildAstral(slug, isNegated)); + } // ==--------------------------== + // Core functionality + // ==--------------------------== + + /* + * Add astral mode (flag A) and Unicode token syntax: `\p{..}`, `\P{..}`, `\p{^..}`, `\pC`. + */ + + + XRegExp.addToken( // Use `*` instead of `+` to avoid capturing `^` as the token name in `\p{^}` + /\\([pP])(?:{(\^?)([^}]*)}|([A-Za-z]))/, function (match, scope, flags) { + var ERR_DOUBLE_NEG = 'Invalid double negation '; + var ERR_UNKNOWN_NAME = 'Unknown Unicode token '; + var ERR_UNKNOWN_REF = 'Unicode token missing data '; + var ERR_ASTRAL_ONLY = 'Astral mode required for Unicode token '; + var ERR_ASTRAL_IN_CLASS = 'Astral mode does not support Unicode tokens within character classes'; // Negated via \P{..} or \p{^..} + + var isNegated = match[1] === 'P' || !!match[2]; // Switch from BMP (0-FFFF) to astral (0-10FFFF) mode via flag A + + var isAstralMode = flags.indexOf('A') !== -1; // Token lookup name. Check `[4]` first to avoid passing `undefined` via `\p{}` + + var slug = normalize(match[4] || match[3]); // Token data object + + var item = unicode[slug]; + + if (match[1] === 'P' && match[2]) { + throw new SyntaxError(ERR_DOUBLE_NEG + match[0]); + } + + if (!unicode.hasOwnProperty(slug)) { + throw new SyntaxError(ERR_UNKNOWN_NAME + match[0]); + } // Switch to the negated form of the referenced Unicode token + + + if (item.inverseOf) { + slug = normalize(item.inverseOf); + + if (!unicode.hasOwnProperty(slug)) { + throw new ReferenceError("".concat(ERR_UNKNOWN_REF + match[0], " -> ").concat(item.inverseOf)); + } + + item = unicode[slug]; + isNegated = !isNegated; + } + + if (!(item.bmp || isAstralMode)) { + throw new SyntaxError(ERR_ASTRAL_ONLY + match[0]); + } + + if (isAstralMode) { + if (scope === 'class') { + throw new SyntaxError(ERR_ASTRAL_IN_CLASS); + } + + return cacheAstral(slug, isNegated); + } + + return scope === 'class' ? isNegated ? cacheInvertedBmp(slug) : item.bmp : "".concat((isNegated ? '[^' : '[') + item.bmp, "]"); + }, { + scope: 'all', + optionalFlags: 'A', + leadChar: '\\' + }); + /** + * Adds to the list of Unicode tokens that XRegExp regexes can match via `\p` or `\P`. + * + * @memberOf XRegExp + * @param {Array} data Objects with named character ranges. Each object may have properties + * `name`, `alias`, `isBmpLast`, `inverseOf`, `bmp`, and `astral`. All but `name` are + * optional, although one of `bmp` or `astral` is required (unless `inverseOf` is set). If + * `astral` is absent, the `bmp` data is used for BMP and astral modes. If `bmp` is absent, + * the name errors in BMP mode but works in astral mode. If both `bmp` and `astral` are + * provided, the `bmp` data only is used in BMP mode, and the combination of `bmp` and + * `astral` data is used in astral mode. `isBmpLast` is needed when a token matches orphan + * high surrogates *and* uses surrogate pairs to match astral code points. The `bmp` and + * `astral` data should be a combination of literal characters and `\xHH` or `\uHHHH` escape + * sequences, with hyphens to create ranges. Any regex metacharacters in the data should be + * escaped, apart from range-creating hyphens. The `astral` data can additionally use + * character classes and alternation, and should use surrogate pairs to represent astral code + * points. `inverseOf` can be used to avoid duplicating character data if a Unicode token is + * defined as the exact inverse of another token. + * @example + * + * // Basic use + * XRegExp.addUnicodeData([{ + * name: 'XDigit', + * alias: 'Hexadecimal', + * bmp: '0-9A-Fa-f' + * }]); + * XRegExp('\\p{XDigit}:\\p{Hexadecimal}+').test('0:3D'); // -> true + */ + + XRegExp.addUnicodeData = function (data) { + var ERR_NO_NAME = 'Unicode token requires name'; + var ERR_NO_DATA = 'Unicode token has no character data '; + var _iteratorNormalCompletion = true; + var _didIteratorError = false; + var _iteratorError = undefined; + + try { + for (var _iterator = data[Symbol.iterator](), _step; !(_iteratorNormalCompletion = (_step = _iterator.next()).done); _iteratorNormalCompletion = true) { + var item = _step.value; + + if (!item.name) { + throw new Error(ERR_NO_NAME); + } + + if (!(item.inverseOf || item.bmp || item.astral)) { + throw new Error(ERR_NO_DATA + item.name); + } + + unicode[normalize(item.name)] = item; + + if (item.alias) { + unicode[normalize(item.alias)] = item; + } + } // Reset the pattern cache used by the `XRegExp` constructor, since the same pattern and + // flags might now produce different results + + } catch (err) { + _didIteratorError = true; + _iteratorError = err; + } finally { + try { + if (!_iteratorNormalCompletion && _iterator.return != null) { + _iterator.return(); + } + } finally { + if (_didIteratorError) { + throw _iteratorError; + } + } + } + + XRegExp.cache.flush('patterns'); + }; + /** + * @ignore + * + * Return a reference to the internal Unicode definition structure for the given Unicode + * Property if the given name is a legal Unicode Property for use in XRegExp `\p` or `\P` regex + * constructs. + * + * @memberOf XRegExp + * @param {String} name Name by which the Unicode Property may be recognized (case-insensitive), + * e.g. `'N'` or `'Number'`. The given name is matched against all registered Unicode + * Properties and Property Aliases. + * @returns {Object} Reference to definition structure when the name matches a Unicode Property. + * + * @note + * For more info on Unicode Properties, see also http://unicode.org/reports/tr18/#Categories. + * + * @note + * This method is *not* part of the officially documented API and may change or be removed in + * the future. It is meant for userland code that wishes to reuse the (large) internal Unicode + * structures set up by XRegExp. + */ + + + XRegExp._getUnicodeProperty = function (name) { + var slug = normalize(name); + return unicode[slug]; + }; +}; + +exports.default = _default; +module.exports = exports["default"]; +}); + +unwrapExports(unicodeBase); + +var blocks = [ + { + 'name': 'InAdlam', + 'astral': '\uD83A[\uDD00-\uDD5F]' + }, + { + 'name': 'InAegean_Numbers', + 'astral': '\uD800[\uDD00-\uDD3F]' + }, + { + 'name': 'InAhom', + 'astral': '\uD805[\uDF00-\uDF3F]' + }, + { + 'name': 'InAlchemical_Symbols', + 'astral': '\uD83D[\uDF00-\uDF7F]' + }, + { + 'name': 'InAlphabetic_Presentation_Forms', + 'bmp': '\uFB00-\uFB4F' + }, + { + 'name': 'InAnatolian_Hieroglyphs', + 'astral': '\uD811[\uDC00-\uDE7F]' + }, + { + 'name': 'InAncient_Greek_Musical_Notation', + 'astral': '\uD834[\uDE00-\uDE4F]' + }, + { + 'name': 'InAncient_Greek_Numbers', + 'astral': '\uD800[\uDD40-\uDD8F]' + }, + { + 'name': 'InAncient_Symbols', + 'astral': '\uD800[\uDD90-\uDDCF]' + }, + { + 'name': 'InArabic', + 'bmp': '\u0600-\u06FF' + }, + { + 'name': 'InArabic_Extended_A', + 'bmp': '\u08A0-\u08FF' + }, + { + 'name': 'InArabic_Mathematical_Alphabetic_Symbols', + 'astral': '\uD83B[\uDE00-\uDEFF]' + }, + { + 'name': 'InArabic_Presentation_Forms_A', + 'bmp': '\uFB50-\uFDFF' + }, + { + 'name': 'InArabic_Presentation_Forms_B', + 'bmp': '\uFE70-\uFEFF' + }, + { + 'name': 'InArabic_Supplement', + 'bmp': '\u0750-\u077F' + }, + { + 'name': 'InArmenian', + 'bmp': '\u0530-\u058F' + }, + { + 'name': 'InArrows', + 'bmp': '\u2190-\u21FF' + }, + { + 'name': 'InAvestan', + 'astral': '\uD802[\uDF00-\uDF3F]' + }, + { + 'name': 'InBalinese', + 'bmp': '\u1B00-\u1B7F' + }, + { + 'name': 'InBamum', + 'bmp': '\uA6A0-\uA6FF' + }, + { + 'name': 'InBamum_Supplement', + 'astral': '\uD81A[\uDC00-\uDE3F]' + }, + { + 'name': 'InBasic_Latin', + 'bmp': '\0-\x7F' + }, + { + 'name': 'InBassa_Vah', + 'astral': '\uD81A[\uDED0-\uDEFF]' + }, + { + 'name': 'InBatak', + 'bmp': '\u1BC0-\u1BFF' + }, + { + 'name': 'InBengali', + 'bmp': '\u0980-\u09FF' + }, + { + 'name': 'InBhaiksuki', + 'astral': '\uD807[\uDC00-\uDC6F]' + }, + { + 'name': 'InBlock_Elements', + 'bmp': '\u2580-\u259F' + }, + { + 'name': 'InBopomofo', + 'bmp': '\u3100-\u312F' + }, + { + 'name': 'InBopomofo_Extended', + 'bmp': '\u31A0-\u31BF' + }, + { + 'name': 'InBox_Drawing', + 'bmp': '\u2500-\u257F' + }, + { + 'name': 'InBrahmi', + 'astral': '\uD804[\uDC00-\uDC7F]' + }, + { + 'name': 'InBraille_Patterns', + 'bmp': '\u2800-\u28FF' + }, + { + 'name': 'InBuginese', + 'bmp': '\u1A00-\u1A1F' + }, + { + 'name': 'InBuhid', + 'bmp': '\u1740-\u175F' + }, + { + 'name': 'InByzantine_Musical_Symbols', + 'astral': '\uD834[\uDC00-\uDCFF]' + }, + { + 'name': 'InCJK_Compatibility', + 'bmp': '\u3300-\u33FF' + }, + { + 'name': 'InCJK_Compatibility_Forms', + 'bmp': '\uFE30-\uFE4F' + }, + { + 'name': 'InCJK_Compatibility_Ideographs', + 'bmp': '\uF900-\uFAFF' + }, + { + 'name': 'InCJK_Compatibility_Ideographs_Supplement', + 'astral': '\uD87E[\uDC00-\uDE1F]' + }, + { + 'name': 'InCJK_Radicals_Supplement', + 'bmp': '\u2E80-\u2EFF' + }, + { + 'name': 'InCJK_Strokes', + 'bmp': '\u31C0-\u31EF' + }, + { + 'name': 'InCJK_Symbols_And_Punctuation', + 'bmp': '\u3000-\u303F' + }, + { + 'name': 'InCJK_Unified_Ideographs', + 'bmp': '\u4E00-\u9FFF' + }, + { + 'name': 'InCJK_Unified_Ideographs_Extension_A', + 'bmp': '\u3400-\u4DBF' + }, + { + 'name': 'InCJK_Unified_Ideographs_Extension_B', + 'astral': '[\uD840-\uD868][\uDC00-\uDFFF]|\uD869[\uDC00-\uDEDF]' + }, + { + 'name': 'InCJK_Unified_Ideographs_Extension_C', + 'astral': '\uD869[\uDF00-\uDFFF]|[\uD86A-\uD86C][\uDC00-\uDFFF]|\uD86D[\uDC00-\uDF3F]' + }, + { + 'name': 'InCJK_Unified_Ideographs_Extension_D', + 'astral': '\uD86D[\uDF40-\uDFFF]|\uD86E[\uDC00-\uDC1F]' + }, + { + 'name': 'InCJK_Unified_Ideographs_Extension_E', + 'astral': '\uD86E[\uDC20-\uDFFF]|[\uD86F-\uD872][\uDC00-\uDFFF]|\uD873[\uDC00-\uDEAF]' + }, + { + 'name': 'InCJK_Unified_Ideographs_Extension_F', + 'astral': '\uD873[\uDEB0-\uDFFF]|[\uD874-\uD879][\uDC00-\uDFFF]|\uD87A[\uDC00-\uDFEF]' + }, + { + 'name': 'InCarian', + 'astral': '\uD800[\uDEA0-\uDEDF]' + }, + { + 'name': 'InCaucasian_Albanian', + 'astral': '\uD801[\uDD30-\uDD6F]' + }, + { + 'name': 'InChakma', + 'astral': '\uD804[\uDD00-\uDD4F]' + }, + { + 'name': 'InCham', + 'bmp': '\uAA00-\uAA5F' + }, + { + 'name': 'InCherokee', + 'bmp': '\u13A0-\u13FF' + }, + { + 'name': 'InCherokee_Supplement', + 'bmp': '\uAB70-\uABBF' + }, + { + 'name': 'InChess_Symbols', + 'astral': '\uD83E[\uDE00-\uDE6F]' + }, + { + 'name': 'InCombining_Diacritical_Marks', + 'bmp': '\u0300-\u036F' + }, + { + 'name': 'InCombining_Diacritical_Marks_Extended', + 'bmp': '\u1AB0-\u1AFF' + }, + { + 'name': 'InCombining_Diacritical_Marks_For_Symbols', + 'bmp': '\u20D0-\u20FF' + }, + { + 'name': 'InCombining_Diacritical_Marks_Supplement', + 'bmp': '\u1DC0-\u1DFF' + }, + { + 'name': 'InCombining_Half_Marks', + 'bmp': '\uFE20-\uFE2F' + }, + { + 'name': 'InCommon_Indic_Number_Forms', + 'bmp': '\uA830-\uA83F' + }, + { + 'name': 'InControl_Pictures', + 'bmp': '\u2400-\u243F' + }, + { + 'name': 'InCoptic', + 'bmp': '\u2C80-\u2CFF' + }, + { + 'name': 'InCoptic_Epact_Numbers', + 'astral': '\uD800[\uDEE0-\uDEFF]' + }, + { + 'name': 'InCounting_Rod_Numerals', + 'astral': '\uD834[\uDF60-\uDF7F]' + }, + { + 'name': 'InCuneiform', + 'astral': '\uD808[\uDC00-\uDFFF]' + }, + { + 'name': 'InCuneiform_Numbers_And_Punctuation', + 'astral': '\uD809[\uDC00-\uDC7F]' + }, + { + 'name': 'InCurrency_Symbols', + 'bmp': '\u20A0-\u20CF' + }, + { + 'name': 'InCypriot_Syllabary', + 'astral': '\uD802[\uDC00-\uDC3F]' + }, + { + 'name': 'InCyrillic', + 'bmp': '\u0400-\u04FF' + }, + { + 'name': 'InCyrillic_Extended_A', + 'bmp': '\u2DE0-\u2DFF' + }, + { + 'name': 'InCyrillic_Extended_B', + 'bmp': '\uA640-\uA69F' + }, + { + 'name': 'InCyrillic_Extended_C', + 'bmp': '\u1C80-\u1C8F' + }, + { + 'name': 'InCyrillic_Supplement', + 'bmp': '\u0500-\u052F' + }, + { + 'name': 'InDeseret', + 'astral': '\uD801[\uDC00-\uDC4F]' + }, + { + 'name': 'InDevanagari', + 'bmp': '\u0900-\u097F' + }, + { + 'name': 'InDevanagari_Extended', + 'bmp': '\uA8E0-\uA8FF' + }, + { + 'name': 'InDingbats', + 'bmp': '\u2700-\u27BF' + }, + { + 'name': 'InDogra', + 'astral': '\uD806[\uDC00-\uDC4F]' + }, + { + 'name': 'InDomino_Tiles', + 'astral': '\uD83C[\uDC30-\uDC9F]' + }, + { + 'name': 'InDuployan', + 'astral': '\uD82F[\uDC00-\uDC9F]' + }, + { + 'name': 'InEarly_Dynastic_Cuneiform', + 'astral': '\uD809[\uDC80-\uDD4F]' + }, + { + 'name': 'InEgyptian_Hieroglyphs', + 'astral': '\uD80C[\uDC00-\uDFFF]|\uD80D[\uDC00-\uDC2F]' + }, + { + 'name': 'InElbasan', + 'astral': '\uD801[\uDD00-\uDD2F]' + }, + { + 'name': 'InEmoticons', + 'astral': '\uD83D[\uDE00-\uDE4F]' + }, + { + 'name': 'InEnclosed_Alphanumeric_Supplement', + 'astral': '\uD83C[\uDD00-\uDDFF]' + }, + { + 'name': 'InEnclosed_Alphanumerics', + 'bmp': '\u2460-\u24FF' + }, + { + 'name': 'InEnclosed_CJK_Letters_And_Months', + 'bmp': '\u3200-\u32FF' + }, + { + 'name': 'InEnclosed_Ideographic_Supplement', + 'astral': '\uD83C[\uDE00-\uDEFF]' + }, + { + 'name': 'InEthiopic', + 'bmp': '\u1200-\u137F' + }, + { + 'name': 'InEthiopic_Extended', + 'bmp': '\u2D80-\u2DDF' + }, + { + 'name': 'InEthiopic_Extended_A', + 'bmp': '\uAB00-\uAB2F' + }, + { + 'name': 'InEthiopic_Supplement', + 'bmp': '\u1380-\u139F' + }, + { + 'name': 'InGeneral_Punctuation', + 'bmp': '\u2000-\u206F' + }, + { + 'name': 'InGeometric_Shapes', + 'bmp': '\u25A0-\u25FF' + }, + { + 'name': 'InGeometric_Shapes_Extended', + 'astral': '\uD83D[\uDF80-\uDFFF]' + }, + { + 'name': 'InGeorgian', + 'bmp': '\u10A0-\u10FF' + }, + { + 'name': 'InGeorgian_Extended', + 'bmp': '\u1C90-\u1CBF' + }, + { + 'name': 'InGeorgian_Supplement', + 'bmp': '\u2D00-\u2D2F' + }, + { + 'name': 'InGlagolitic', + 'bmp': '\u2C00-\u2C5F' + }, + { + 'name': 'InGlagolitic_Supplement', + 'astral': '\uD838[\uDC00-\uDC2F]' + }, + { + 'name': 'InGothic', + 'astral': '\uD800[\uDF30-\uDF4F]' + }, + { + 'name': 'InGrantha', + 'astral': '\uD804[\uDF00-\uDF7F]' + }, + { + 'name': 'InGreek_And_Coptic', + 'bmp': '\u0370-\u03FF' + }, + { + 'name': 'InGreek_Extended', + 'bmp': '\u1F00-\u1FFF' + }, + { + 'name': 'InGujarati', + 'bmp': '\u0A80-\u0AFF' + }, + { + 'name': 'InGunjala_Gondi', + 'astral': '\uD807[\uDD60-\uDDAF]' + }, + { + 'name': 'InGurmukhi', + 'bmp': '\u0A00-\u0A7F' + }, + { + 'name': 'InHalfwidth_And_Fullwidth_Forms', + 'bmp': '\uFF00-\uFFEF' + }, + { + 'name': 'InHangul_Compatibility_Jamo', + 'bmp': '\u3130-\u318F' + }, + { + 'name': 'InHangul_Jamo', + 'bmp': '\u1100-\u11FF' + }, + { + 'name': 'InHangul_Jamo_Extended_A', + 'bmp': '\uA960-\uA97F' + }, + { + 'name': 'InHangul_Jamo_Extended_B', + 'bmp': '\uD7B0-\uD7FF' + }, + { + 'name': 'InHangul_Syllables', + 'bmp': '\uAC00-\uD7AF' + }, + { + 'name': 'InHanifi_Rohingya', + 'astral': '\uD803[\uDD00-\uDD3F]' + }, + { + 'name': 'InHanunoo', + 'bmp': '\u1720-\u173F' + }, + { + 'name': 'InHatran', + 'astral': '\uD802[\uDCE0-\uDCFF]' + }, + { + 'name': 'InHebrew', + 'bmp': '\u0590-\u05FF' + }, + { + 'name': 'InHigh_Private_Use_Surrogates', + 'bmp': '\uDB80-\uDBFF' + }, + { + 'name': 'InHigh_Surrogates', + 'bmp': '\uD800-\uDB7F' + }, + { + 'name': 'InHiragana', + 'bmp': '\u3040-\u309F' + }, + { + 'name': 'InIPA_Extensions', + 'bmp': '\u0250-\u02AF' + }, + { + 'name': 'InIdeographic_Description_Characters', + 'bmp': '\u2FF0-\u2FFF' + }, + { + 'name': 'InIdeographic_Symbols_And_Punctuation', + 'astral': '\uD81B[\uDFE0-\uDFFF]' + }, + { + 'name': 'InImperial_Aramaic', + 'astral': '\uD802[\uDC40-\uDC5F]' + }, + { + 'name': 'InIndic_Siyaq_Numbers', + 'astral': '\uD83B[\uDC70-\uDCBF]' + }, + { + 'name': 'InInscriptional_Pahlavi', + 'astral': '\uD802[\uDF60-\uDF7F]' + }, + { + 'name': 'InInscriptional_Parthian', + 'astral': '\uD802[\uDF40-\uDF5F]' + }, + { + 'name': 'InJavanese', + 'bmp': '\uA980-\uA9DF' + }, + { + 'name': 'InKaithi', + 'astral': '\uD804[\uDC80-\uDCCF]' + }, + { + 'name': 'InKana_Extended_A', + 'astral': '\uD82C[\uDD00-\uDD2F]' + }, + { + 'name': 'InKana_Supplement', + 'astral': '\uD82C[\uDC00-\uDCFF]' + }, + { + 'name': 'InKanbun', + 'bmp': '\u3190-\u319F' + }, + { + 'name': 'InKangxi_Radicals', + 'bmp': '\u2F00-\u2FDF' + }, + { + 'name': 'InKannada', + 'bmp': '\u0C80-\u0CFF' + }, + { + 'name': 'InKatakana', + 'bmp': '\u30A0-\u30FF' + }, + { + 'name': 'InKatakana_Phonetic_Extensions', + 'bmp': '\u31F0-\u31FF' + }, + { + 'name': 'InKayah_Li', + 'bmp': '\uA900-\uA92F' + }, + { + 'name': 'InKharoshthi', + 'astral': '\uD802[\uDE00-\uDE5F]' + }, + { + 'name': 'InKhmer', + 'bmp': '\u1780-\u17FF' + }, + { + 'name': 'InKhmer_Symbols', + 'bmp': '\u19E0-\u19FF' + }, + { + 'name': 'InKhojki', + 'astral': '\uD804[\uDE00-\uDE4F]' + }, + { + 'name': 'InKhudawadi', + 'astral': '\uD804[\uDEB0-\uDEFF]' + }, + { + 'name': 'InLao', + 'bmp': '\u0E80-\u0EFF' + }, + { + 'name': 'InLatin_1_Supplement', + 'bmp': '\x80-\xFF' + }, + { + 'name': 'InLatin_Extended_A', + 'bmp': '\u0100-\u017F' + }, + { + 'name': 'InLatin_Extended_Additional', + 'bmp': '\u1E00-\u1EFF' + }, + { + 'name': 'InLatin_Extended_B', + 'bmp': '\u0180-\u024F' + }, + { + 'name': 'InLatin_Extended_C', + 'bmp': '\u2C60-\u2C7F' + }, + { + 'name': 'InLatin_Extended_D', + 'bmp': '\uA720-\uA7FF' + }, + { + 'name': 'InLatin_Extended_E', + 'bmp': '\uAB30-\uAB6F' + }, + { + 'name': 'InLepcha', + 'bmp': '\u1C00-\u1C4F' + }, + { + 'name': 'InLetterlike_Symbols', + 'bmp': '\u2100-\u214F' + }, + { + 'name': 'InLimbu', + 'bmp': '\u1900-\u194F' + }, + { + 'name': 'InLinear_A', + 'astral': '\uD801[\uDE00-\uDF7F]' + }, + { + 'name': 'InLinear_B_Ideograms', + 'astral': '\uD800[\uDC80-\uDCFF]' + }, + { + 'name': 'InLinear_B_Syllabary', + 'astral': '\uD800[\uDC00-\uDC7F]' + }, + { + 'name': 'InLisu', + 'bmp': '\uA4D0-\uA4FF' + }, + { + 'name': 'InLow_Surrogates', + 'bmp': '\uDC00-\uDFFF' + }, + { + 'name': 'InLycian', + 'astral': '\uD800[\uDE80-\uDE9F]' + }, + { + 'name': 'InLydian', + 'astral': '\uD802[\uDD20-\uDD3F]' + }, + { + 'name': 'InMahajani', + 'astral': '\uD804[\uDD50-\uDD7F]' + }, + { + 'name': 'InMahjong_Tiles', + 'astral': '\uD83C[\uDC00-\uDC2F]' + }, + { + 'name': 'InMakasar', + 'astral': '\uD807[\uDEE0-\uDEFF]' + }, + { + 'name': 'InMalayalam', + 'bmp': '\u0D00-\u0D7F' + }, + { + 'name': 'InMandaic', + 'bmp': '\u0840-\u085F' + }, + { + 'name': 'InManichaean', + 'astral': '\uD802[\uDEC0-\uDEFF]' + }, + { + 'name': 'InMarchen', + 'astral': '\uD807[\uDC70-\uDCBF]' + }, + { + 'name': 'InMasaram_Gondi', + 'astral': '\uD807[\uDD00-\uDD5F]' + }, + { + 'name': 'InMathematical_Alphanumeric_Symbols', + 'astral': '\uD835[\uDC00-\uDFFF]' + }, + { + 'name': 'InMathematical_Operators', + 'bmp': '\u2200-\u22FF' + }, + { + 'name': 'InMayan_Numerals', + 'astral': '\uD834[\uDEE0-\uDEFF]' + }, + { + 'name': 'InMedefaidrin', + 'astral': '\uD81B[\uDE40-\uDE9F]' + }, + { + 'name': 'InMeetei_Mayek', + 'bmp': '\uABC0-\uABFF' + }, + { + 'name': 'InMeetei_Mayek_Extensions', + 'bmp': '\uAAE0-\uAAFF' + }, + { + 'name': 'InMende_Kikakui', + 'astral': '\uD83A[\uDC00-\uDCDF]' + }, + { + 'name': 'InMeroitic_Cursive', + 'astral': '\uD802[\uDDA0-\uDDFF]' + }, + { + 'name': 'InMeroitic_Hieroglyphs', + 'astral': '\uD802[\uDD80-\uDD9F]' + }, + { + 'name': 'InMiao', + 'astral': '\uD81B[\uDF00-\uDF9F]' + }, + { + 'name': 'InMiscellaneous_Mathematical_Symbols_A', + 'bmp': '\u27C0-\u27EF' + }, + { + 'name': 'InMiscellaneous_Mathematical_Symbols_B', + 'bmp': '\u2980-\u29FF' + }, + { + 'name': 'InMiscellaneous_Symbols', + 'bmp': '\u2600-\u26FF' + }, + { + 'name': 'InMiscellaneous_Symbols_And_Arrows', + 'bmp': '\u2B00-\u2BFF' + }, + { + 'name': 'InMiscellaneous_Symbols_And_Pictographs', + 'astral': '\uD83C[\uDF00-\uDFFF]|\uD83D[\uDC00-\uDDFF]' + }, + { + 'name': 'InMiscellaneous_Technical', + 'bmp': '\u2300-\u23FF' + }, + { + 'name': 'InModi', + 'astral': '\uD805[\uDE00-\uDE5F]' + }, + { + 'name': 'InModifier_Tone_Letters', + 'bmp': '\uA700-\uA71F' + }, + { + 'name': 'InMongolian', + 'bmp': '\u1800-\u18AF' + }, + { + 'name': 'InMongolian_Supplement', + 'astral': '\uD805[\uDE60-\uDE7F]' + }, + { + 'name': 'InMro', + 'astral': '\uD81A[\uDE40-\uDE6F]' + }, + { + 'name': 'InMultani', + 'astral': '\uD804[\uDE80-\uDEAF]' + }, + { + 'name': 'InMusical_Symbols', + 'astral': '\uD834[\uDD00-\uDDFF]' + }, + { + 'name': 'InMyanmar', + 'bmp': '\u1000-\u109F' + }, + { + 'name': 'InMyanmar_Extended_A', + 'bmp': '\uAA60-\uAA7F' + }, + { + 'name': 'InMyanmar_Extended_B', + 'bmp': '\uA9E0-\uA9FF' + }, + { + 'name': 'InNKo', + 'bmp': '\u07C0-\u07FF' + }, + { + 'name': 'InNabataean', + 'astral': '\uD802[\uDC80-\uDCAF]' + }, + { + 'name': 'InNew_Tai_Lue', + 'bmp': '\u1980-\u19DF' + }, + { + 'name': 'InNewa', + 'astral': '\uD805[\uDC00-\uDC7F]' + }, + { + 'name': 'InNumber_Forms', + 'bmp': '\u2150-\u218F' + }, + { + 'name': 'InNushu', + 'astral': '\uD82C[\uDD70-\uDEFF]' + }, + { + 'name': 'InOgham', + 'bmp': '\u1680-\u169F' + }, + { + 'name': 'InOl_Chiki', + 'bmp': '\u1C50-\u1C7F' + }, + { + 'name': 'InOld_Hungarian', + 'astral': '\uD803[\uDC80-\uDCFF]' + }, + { + 'name': 'InOld_Italic', + 'astral': '\uD800[\uDF00-\uDF2F]' + }, + { + 'name': 'InOld_North_Arabian', + 'astral': '\uD802[\uDE80-\uDE9F]' + }, + { + 'name': 'InOld_Permic', + 'astral': '\uD800[\uDF50-\uDF7F]' + }, + { + 'name': 'InOld_Persian', + 'astral': '\uD800[\uDFA0-\uDFDF]' + }, + { + 'name': 'InOld_Sogdian', + 'astral': '\uD803[\uDF00-\uDF2F]' + }, + { + 'name': 'InOld_South_Arabian', + 'astral': '\uD802[\uDE60-\uDE7F]' + }, + { + 'name': 'InOld_Turkic', + 'astral': '\uD803[\uDC00-\uDC4F]' + }, + { + 'name': 'InOptical_Character_Recognition', + 'bmp': '\u2440-\u245F' + }, + { + 'name': 'InOriya', + 'bmp': '\u0B00-\u0B7F' + }, + { + 'name': 'InOrnamental_Dingbats', + 'astral': '\uD83D[\uDE50-\uDE7F]' + }, + { + 'name': 'InOsage', + 'astral': '\uD801[\uDCB0-\uDCFF]' + }, + { + 'name': 'InOsmanya', + 'astral': '\uD801[\uDC80-\uDCAF]' + }, + { + 'name': 'InPahawh_Hmong', + 'astral': '\uD81A[\uDF00-\uDF8F]' + }, + { + 'name': 'InPalmyrene', + 'astral': '\uD802[\uDC60-\uDC7F]' + }, + { + 'name': 'InPau_Cin_Hau', + 'astral': '\uD806[\uDEC0-\uDEFF]' + }, + { + 'name': 'InPhags_Pa', + 'bmp': '\uA840-\uA87F' + }, + { + 'name': 'InPhaistos_Disc', + 'astral': '\uD800[\uDDD0-\uDDFF]' + }, + { + 'name': 'InPhoenician', + 'astral': '\uD802[\uDD00-\uDD1F]' + }, + { + 'name': 'InPhonetic_Extensions', + 'bmp': '\u1D00-\u1D7F' + }, + { + 'name': 'InPhonetic_Extensions_Supplement', + 'bmp': '\u1D80-\u1DBF' + }, + { + 'name': 'InPlaying_Cards', + 'astral': '\uD83C[\uDCA0-\uDCFF]' + }, + { + 'name': 'InPrivate_Use_Area', + 'bmp': '\uE000-\uF8FF' + }, + { + 'name': 'InPsalter_Pahlavi', + 'astral': '\uD802[\uDF80-\uDFAF]' + }, + { + 'name': 'InRejang', + 'bmp': '\uA930-\uA95F' + }, + { + 'name': 'InRumi_Numeral_Symbols', + 'astral': '\uD803[\uDE60-\uDE7F]' + }, + { + 'name': 'InRunic', + 'bmp': '\u16A0-\u16FF' + }, + { + 'name': 'InSamaritan', + 'bmp': '\u0800-\u083F' + }, + { + 'name': 'InSaurashtra', + 'bmp': '\uA880-\uA8DF' + }, + { + 'name': 'InSharada', + 'astral': '\uD804[\uDD80-\uDDDF]' + }, + { + 'name': 'InShavian', + 'astral': '\uD801[\uDC50-\uDC7F]' + }, + { + 'name': 'InShorthand_Format_Controls', + 'astral': '\uD82F[\uDCA0-\uDCAF]' + }, + { + 'name': 'InSiddham', + 'astral': '\uD805[\uDD80-\uDDFF]' + }, + { + 'name': 'InSinhala', + 'bmp': '\u0D80-\u0DFF' + }, + { + 'name': 'InSinhala_Archaic_Numbers', + 'astral': '\uD804[\uDDE0-\uDDFF]' + }, + { + 'name': 'InSmall_Form_Variants', + 'bmp': '\uFE50-\uFE6F' + }, + { + 'name': 'InSogdian', + 'astral': '\uD803[\uDF30-\uDF6F]' + }, + { + 'name': 'InSora_Sompeng', + 'astral': '\uD804[\uDCD0-\uDCFF]' + }, + { + 'name': 'InSoyombo', + 'astral': '\uD806[\uDE50-\uDEAF]' + }, + { + 'name': 'InSpacing_Modifier_Letters', + 'bmp': '\u02B0-\u02FF' + }, + { + 'name': 'InSpecials', + 'bmp': '\uFFF0-\uFFFF' + }, + { + 'name': 'InSundanese', + 'bmp': '\u1B80-\u1BBF' + }, + { + 'name': 'InSundanese_Supplement', + 'bmp': '\u1CC0-\u1CCF' + }, + { + 'name': 'InSuperscripts_And_Subscripts', + 'bmp': '\u2070-\u209F' + }, + { + 'name': 'InSupplemental_Arrows_A', + 'bmp': '\u27F0-\u27FF' + }, + { + 'name': 'InSupplemental_Arrows_B', + 'bmp': '\u2900-\u297F' + }, + { + 'name': 'InSupplemental_Arrows_C', + 'astral': '\uD83E[\uDC00-\uDCFF]' + }, + { + 'name': 'InSupplemental_Mathematical_Operators', + 'bmp': '\u2A00-\u2AFF' + }, + { + 'name': 'InSupplemental_Punctuation', + 'bmp': '\u2E00-\u2E7F' + }, + { + 'name': 'InSupplemental_Symbols_And_Pictographs', + 'astral': '\uD83E[\uDD00-\uDDFF]' + }, + { + 'name': 'InSupplementary_Private_Use_Area_A', + 'astral': '[\uDB80-\uDBBF][\uDC00-\uDFFF]' + }, + { + 'name': 'InSupplementary_Private_Use_Area_B', + 'astral': '[\uDBC0-\uDBFF][\uDC00-\uDFFF]' + }, + { + 'name': 'InSutton_SignWriting', + 'astral': '\uD836[\uDC00-\uDEAF]' + }, + { + 'name': 'InSyloti_Nagri', + 'bmp': '\uA800-\uA82F' + }, + { + 'name': 'InSyriac', + 'bmp': '\u0700-\u074F' + }, + { + 'name': 'InSyriac_Supplement', + 'bmp': '\u0860-\u086F' + }, + { + 'name': 'InTagalog', + 'bmp': '\u1700-\u171F' + }, + { + 'name': 'InTagbanwa', + 'bmp': '\u1760-\u177F' + }, + { + 'name': 'InTags', + 'astral': '\uDB40[\uDC00-\uDC7F]' + }, + { + 'name': 'InTai_Le', + 'bmp': '\u1950-\u197F' + }, + { + 'name': 'InTai_Tham', + 'bmp': '\u1A20-\u1AAF' + }, + { + 'name': 'InTai_Viet', + 'bmp': '\uAA80-\uAADF' + }, + { + 'name': 'InTai_Xuan_Jing_Symbols', + 'astral': '\uD834[\uDF00-\uDF5F]' + }, + { + 'name': 'InTakri', + 'astral': '\uD805[\uDE80-\uDECF]' + }, + { + 'name': 'InTamil', + 'bmp': '\u0B80-\u0BFF' + }, + { + 'name': 'InTangut', + 'astral': '[\uD81C-\uD821][\uDC00-\uDFFF]' + }, + { + 'name': 'InTangut_Components', + 'astral': '\uD822[\uDC00-\uDEFF]' + }, + { + 'name': 'InTelugu', + 'bmp': '\u0C00-\u0C7F' + }, + { + 'name': 'InThaana', + 'bmp': '\u0780-\u07BF' + }, + { + 'name': 'InThai', + 'bmp': '\u0E00-\u0E7F' + }, + { + 'name': 'InTibetan', + 'bmp': '\u0F00-\u0FFF' + }, + { + 'name': 'InTifinagh', + 'bmp': '\u2D30-\u2D7F' + }, + { + 'name': 'InTirhuta', + 'astral': '\uD805[\uDC80-\uDCDF]' + }, + { + 'name': 'InTransport_And_Map_Symbols', + 'astral': '\uD83D[\uDE80-\uDEFF]' + }, + { + 'name': 'InUgaritic', + 'astral': '\uD800[\uDF80-\uDF9F]' + }, + { + 'name': 'InUnified_Canadian_Aboriginal_Syllabics', + 'bmp': '\u1400-\u167F' + }, + { + 'name': 'InUnified_Canadian_Aboriginal_Syllabics_Extended', + 'bmp': '\u18B0-\u18FF' + }, + { + 'name': 'InVai', + 'bmp': '\uA500-\uA63F' + }, + { + 'name': 'InVariation_Selectors', + 'bmp': '\uFE00-\uFE0F' + }, + { + 'name': 'InVariation_Selectors_Supplement', + 'astral': '\uDB40[\uDD00-\uDDEF]' + }, + { + 'name': 'InVedic_Extensions', + 'bmp': '\u1CD0-\u1CFF' + }, + { + 'name': 'InVertical_Forms', + 'bmp': '\uFE10-\uFE1F' + }, + { + 'name': 'InWarang_Citi', + 'astral': '\uD806[\uDCA0-\uDCFF]' + }, + { + 'name': 'InYi_Radicals', + 'bmp': '\uA490-\uA4CF' + }, + { + 'name': 'InYi_Syllables', + 'bmp': '\uA000-\uA48F' + }, + { + 'name': 'InYijing_Hexagram_Symbols', + 'bmp': '\u4DC0-\u4DFF' + }, + { + 'name': 'InZanabazar_Square', + 'astral': '\uD806[\uDE00-\uDE4F]' + } +]; + +var unicodeBlocks = createCommonjsModule(function (module, exports) { +"use strict"; + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.default = void 0; + +var _blocks = _interopRequireDefault(blocks); + +function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } + +/*! + * XRegExp Unicode Blocks 4.2.0 + * + * Steven Levithan (c) 2010-present MIT License + * Unicode data by Mathias Bynens + */ +var _default = function _default(XRegExp) { + /** + * Adds support for all Unicode blocks. Block names use the prefix 'In'. E.g., + * `\p{InBasicLatin}`. Token names are case insensitive, and any spaces, hyphens, and + * underscores are ignored. + * + * Uses Unicode 11.0.0. + * + * @requires XRegExp, Unicode Base + */ + if (!XRegExp.addUnicodeData) { + throw new ReferenceError('Unicode Base must be loaded before Unicode Blocks'); + } + + XRegExp.addUnicodeData(_blocks.default); +}; + +exports.default = _default; +module.exports = exports["default"]; +}); + +unwrapExports(unicodeBlocks); + +var categories = [ + { + 'name': 'C', + 'alias': 'Other', + 'isBmpLast': true, + 'bmp': '\0-\x1F\x7F-\x9F\xAD\u0378\u0379\u0380-\u0383\u038B\u038D\u03A2\u0530\u0557\u0558\u058B\u058C\u0590\u05C8-\u05CF\u05EB-\u05EE\u05F5-\u0605\u061C\u061D\u06DD\u070E\u070F\u074B\u074C\u07B2-\u07BF\u07FB\u07FC\u082E\u082F\u083F\u085C\u085D\u085F\u086B-\u089F\u08B5\u08BE-\u08D2\u08E2\u0984\u098D\u098E\u0991\u0992\u09A9\u09B1\u09B3-\u09B5\u09BA\u09BB\u09C5\u09C6\u09C9\u09CA\u09CF-\u09D6\u09D8-\u09DB\u09DE\u09E4\u09E5\u09FF\u0A00\u0A04\u0A0B-\u0A0E\u0A11\u0A12\u0A29\u0A31\u0A34\u0A37\u0A3A\u0A3B\u0A3D\u0A43-\u0A46\u0A49\u0A4A\u0A4E-\u0A50\u0A52-\u0A58\u0A5D\u0A5F-\u0A65\u0A77-\u0A80\u0A84\u0A8E\u0A92\u0AA9\u0AB1\u0AB4\u0ABA\u0ABB\u0AC6\u0ACA\u0ACE\u0ACF\u0AD1-\u0ADF\u0AE4\u0AE5\u0AF2-\u0AF8\u0B00\u0B04\u0B0D\u0B0E\u0B11\u0B12\u0B29\u0B31\u0B34\u0B3A\u0B3B\u0B45\u0B46\u0B49\u0B4A\u0B4E-\u0B55\u0B58-\u0B5B\u0B5E\u0B64\u0B65\u0B78-\u0B81\u0B84\u0B8B-\u0B8D\u0B91\u0B96-\u0B98\u0B9B\u0B9D\u0BA0-\u0BA2\u0BA5-\u0BA7\u0BAB-\u0BAD\u0BBA-\u0BBD\u0BC3-\u0BC5\u0BC9\u0BCE\u0BCF\u0BD1-\u0BD6\u0BD8-\u0BE5\u0BFB-\u0BFF\u0C0D\u0C11\u0C29\u0C3A-\u0C3C\u0C45\u0C49\u0C4E-\u0C54\u0C57\u0C5B-\u0C5F\u0C64\u0C65\u0C70-\u0C77\u0C8D\u0C91\u0CA9\u0CB4\u0CBA\u0CBB\u0CC5\u0CC9\u0CCE-\u0CD4\u0CD7-\u0CDD\u0CDF\u0CE4\u0CE5\u0CF0\u0CF3-\u0CFF\u0D04\u0D0D\u0D11\u0D45\u0D49\u0D50-\u0D53\u0D64\u0D65\u0D80\u0D81\u0D84\u0D97-\u0D99\u0DB2\u0DBC\u0DBE\u0DBF\u0DC7-\u0DC9\u0DCB-\u0DCE\u0DD5\u0DD7\u0DE0-\u0DE5\u0DF0\u0DF1\u0DF5-\u0E00\u0E3B-\u0E3E\u0E5C-\u0E80\u0E83\u0E85\u0E86\u0E89\u0E8B\u0E8C\u0E8E-\u0E93\u0E98\u0EA0\u0EA4\u0EA6\u0EA8\u0EA9\u0EAC\u0EBA\u0EBE\u0EBF\u0EC5\u0EC7\u0ECE\u0ECF\u0EDA\u0EDB\u0EE0-\u0EFF\u0F48\u0F6D-\u0F70\u0F98\u0FBD\u0FCD\u0FDB-\u0FFF\u10C6\u10C8-\u10CC\u10CE\u10CF\u1249\u124E\u124F\u1257\u1259\u125E\u125F\u1289\u128E\u128F\u12B1\u12B6\u12B7\u12BF\u12C1\u12C6\u12C7\u12D7\u1311\u1316\u1317\u135B\u135C\u137D-\u137F\u139A-\u139F\u13F6\u13F7\u13FE\u13FF\u169D-\u169F\u16F9-\u16FF\u170D\u1715-\u171F\u1737-\u173F\u1754-\u175F\u176D\u1771\u1774-\u177F\u17DE\u17DF\u17EA-\u17EF\u17FA-\u17FF\u180E\u180F\u181A-\u181F\u1879-\u187F\u18AB-\u18AF\u18F6-\u18FF\u191F\u192C-\u192F\u193C-\u193F\u1941-\u1943\u196E\u196F\u1975-\u197F\u19AC-\u19AF\u19CA-\u19CF\u19DB-\u19DD\u1A1C\u1A1D\u1A5F\u1A7D\u1A7E\u1A8A-\u1A8F\u1A9A-\u1A9F\u1AAE\u1AAF\u1ABF-\u1AFF\u1B4C-\u1B4F\u1B7D-\u1B7F\u1BF4-\u1BFB\u1C38-\u1C3A\u1C4A-\u1C4C\u1C89-\u1C8F\u1CBB\u1CBC\u1CC8-\u1CCF\u1CFA-\u1CFF\u1DFA\u1F16\u1F17\u1F1E\u1F1F\u1F46\u1F47\u1F4E\u1F4F\u1F58\u1F5A\u1F5C\u1F5E\u1F7E\u1F7F\u1FB5\u1FC5\u1FD4\u1FD5\u1FDC\u1FF0\u1FF1\u1FF5\u1FFF\u200B-\u200F\u202A-\u202E\u2060-\u206F\u2072\u2073\u208F\u209D-\u209F\u20C0-\u20CF\u20F1-\u20FF\u218C-\u218F\u2427-\u243F\u244B-\u245F\u2B74\u2B75\u2B96\u2B97\u2BC9\u2BFF\u2C2F\u2C5F\u2CF4-\u2CF8\u2D26\u2D28-\u2D2C\u2D2E\u2D2F\u2D68-\u2D6E\u2D71-\u2D7E\u2D97-\u2D9F\u2DA7\u2DAF\u2DB7\u2DBF\u2DC7\u2DCF\u2DD7\u2DDF\u2E4F-\u2E7F\u2E9A\u2EF4-\u2EFF\u2FD6-\u2FEF\u2FFC-\u2FFF\u3040\u3097\u3098\u3100-\u3104\u3130\u318F\u31BB-\u31BF\u31E4-\u31EF\u321F\u32FF\u4DB6-\u4DBF\u9FF0-\u9FFF\uA48D-\uA48F\uA4C7-\uA4CF\uA62C-\uA63F\uA6F8-\uA6FF\uA7BA-\uA7F6\uA82C-\uA82F\uA83A-\uA83F\uA878-\uA87F\uA8C6-\uA8CD\uA8DA-\uA8DF\uA954-\uA95E\uA97D-\uA97F\uA9CE\uA9DA-\uA9DD\uA9FF\uAA37-\uAA3F\uAA4E\uAA4F\uAA5A\uAA5B\uAAC3-\uAADA\uAAF7-\uAB00\uAB07\uAB08\uAB0F\uAB10\uAB17-\uAB1F\uAB27\uAB2F\uAB66-\uAB6F\uABEE\uABEF\uABFA-\uABFF\uD7A4-\uD7AF\uD7C7-\uD7CA\uD7FC-\uF8FF\uFA6E\uFA6F\uFADA-\uFAFF\uFB07-\uFB12\uFB18-\uFB1C\uFB37\uFB3D\uFB3F\uFB42\uFB45\uFBC2-\uFBD2\uFD40-\uFD4F\uFD90\uFD91\uFDC8-\uFDEF\uFDFE\uFDFF\uFE1A-\uFE1F\uFE53\uFE67\uFE6C-\uFE6F\uFE75\uFEFD-\uFF00\uFFBF-\uFFC1\uFFC8\uFFC9\uFFD0\uFFD1\uFFD8\uFFD9\uFFDD-\uFFDF\uFFE7\uFFEF-\uFFFB\uFFFE\uFFFF', + 'astral': '\uD800[\uDC0C\uDC27\uDC3B\uDC3E\uDC4E\uDC4F\uDC5E-\uDC7F\uDCFB-\uDCFF\uDD03-\uDD06\uDD34-\uDD36\uDD8F\uDD9C-\uDD9F\uDDA1-\uDDCF\uDDFE-\uDE7F\uDE9D-\uDE9F\uDED1-\uDEDF\uDEFC-\uDEFF\uDF24-\uDF2C\uDF4B-\uDF4F\uDF7B-\uDF7F\uDF9E\uDFC4-\uDFC7\uDFD6-\uDFFF]|\uD801[\uDC9E\uDC9F\uDCAA-\uDCAF\uDCD4-\uDCD7\uDCFC-\uDCFF\uDD28-\uDD2F\uDD64-\uDD6E\uDD70-\uDDFF\uDF37-\uDF3F\uDF56-\uDF5F\uDF68-\uDFFF]|\uD802[\uDC06\uDC07\uDC09\uDC36\uDC39-\uDC3B\uDC3D\uDC3E\uDC56\uDC9F-\uDCA6\uDCB0-\uDCDF\uDCF3\uDCF6-\uDCFA\uDD1C-\uDD1E\uDD3A-\uDD3E\uDD40-\uDD7F\uDDB8-\uDDBB\uDDD0\uDDD1\uDE04\uDE07-\uDE0B\uDE14\uDE18\uDE36\uDE37\uDE3B-\uDE3E\uDE49-\uDE4F\uDE59-\uDE5F\uDEA0-\uDEBF\uDEE7-\uDEEA\uDEF7-\uDEFF\uDF36-\uDF38\uDF56\uDF57\uDF73-\uDF77\uDF92-\uDF98\uDF9D-\uDFA8\uDFB0-\uDFFF]|\uD803[\uDC49-\uDC7F\uDCB3-\uDCBF\uDCF3-\uDCF9\uDD28-\uDD2F\uDD3A-\uDE5F\uDE7F-\uDEFF\uDF28-\uDF2F\uDF5A-\uDFFF]|\uD804[\uDC4E-\uDC51\uDC70-\uDC7E\uDCBD\uDCC2-\uDCCF\uDCE9-\uDCEF\uDCFA-\uDCFF\uDD35\uDD47-\uDD4F\uDD77-\uDD7F\uDDCE\uDDCF\uDDE0\uDDF5-\uDDFF\uDE12\uDE3F-\uDE7F\uDE87\uDE89\uDE8E\uDE9E\uDEAA-\uDEAF\uDEEB-\uDEEF\uDEFA-\uDEFF\uDF04\uDF0D\uDF0E\uDF11\uDF12\uDF29\uDF31\uDF34\uDF3A\uDF45\uDF46\uDF49\uDF4A\uDF4E\uDF4F\uDF51-\uDF56\uDF58-\uDF5C\uDF64\uDF65\uDF6D-\uDF6F\uDF75-\uDFFF]|\uD805[\uDC5A\uDC5C\uDC5F-\uDC7F\uDCC8-\uDCCF\uDCDA-\uDD7F\uDDB6\uDDB7\uDDDE-\uDDFF\uDE45-\uDE4F\uDE5A-\uDE5F\uDE6D-\uDE7F\uDEB8-\uDEBF\uDECA-\uDEFF\uDF1B\uDF1C\uDF2C-\uDF2F\uDF40-\uDFFF]|\uD806[\uDC3C-\uDC9F\uDCF3-\uDCFE\uDD00-\uDDFF\uDE48-\uDE4F\uDE84\uDE85\uDEA3-\uDEBF\uDEF9-\uDFFF]|\uD807[\uDC09\uDC37\uDC46-\uDC4F\uDC6D-\uDC6F\uDC90\uDC91\uDCA8\uDCB7-\uDCFF\uDD07\uDD0A\uDD37-\uDD39\uDD3B\uDD3E\uDD48-\uDD4F\uDD5A-\uDD5F\uDD66\uDD69\uDD8F\uDD92\uDD99-\uDD9F\uDDAA-\uDEDF\uDEF9-\uDFFF]|\uD808[\uDF9A-\uDFFF]|\uD809[\uDC6F\uDC75-\uDC7F\uDD44-\uDFFF]|[\uD80A\uD80B\uD80E-\uD810\uD812-\uD819\uD823-\uD82B\uD82D\uD82E\uD830-\uD833\uD837\uD839\uD83F\uD87B-\uD87D\uD87F-\uDB3F\uDB41-\uDBFF][\uDC00-\uDFFF]|\uD80D[\uDC2F-\uDFFF]|\uD811[\uDE47-\uDFFF]|\uD81A[\uDE39-\uDE3F\uDE5F\uDE6A-\uDE6D\uDE70-\uDECF\uDEEE\uDEEF\uDEF6-\uDEFF\uDF46-\uDF4F\uDF5A\uDF62\uDF78-\uDF7C\uDF90-\uDFFF]|\uD81B[\uDC00-\uDE3F\uDE9B-\uDEFF\uDF45-\uDF4F\uDF7F-\uDF8E\uDFA0-\uDFDF\uDFE2-\uDFFF]|\uD821[\uDFF2-\uDFFF]|\uD822[\uDEF3-\uDFFF]|\uD82C[\uDD1F-\uDD6F\uDEFC-\uDFFF]|\uD82F[\uDC6B-\uDC6F\uDC7D-\uDC7F\uDC89-\uDC8F\uDC9A\uDC9B\uDCA0-\uDFFF]|\uD834[\uDCF6-\uDCFF\uDD27\uDD28\uDD73-\uDD7A\uDDE9-\uDDFF\uDE46-\uDEDF\uDEF4-\uDEFF\uDF57-\uDF5F\uDF79-\uDFFF]|\uD835[\uDC55\uDC9D\uDCA0\uDCA1\uDCA3\uDCA4\uDCA7\uDCA8\uDCAD\uDCBA\uDCBC\uDCC4\uDD06\uDD0B\uDD0C\uDD15\uDD1D\uDD3A\uDD3F\uDD45\uDD47-\uDD49\uDD51\uDEA6\uDEA7\uDFCC\uDFCD]|\uD836[\uDE8C-\uDE9A\uDEA0\uDEB0-\uDFFF]|\uD838[\uDC07\uDC19\uDC1A\uDC22\uDC25\uDC2B-\uDFFF]|\uD83A[\uDCC5\uDCC6\uDCD7-\uDCFF\uDD4B-\uDD4F\uDD5A-\uDD5D\uDD60-\uDFFF]|\uD83B[\uDC00-\uDC70\uDCB5-\uDDFF\uDE04\uDE20\uDE23\uDE25\uDE26\uDE28\uDE33\uDE38\uDE3A\uDE3C-\uDE41\uDE43-\uDE46\uDE48\uDE4A\uDE4C\uDE50\uDE53\uDE55\uDE56\uDE58\uDE5A\uDE5C\uDE5E\uDE60\uDE63\uDE65\uDE66\uDE6B\uDE73\uDE78\uDE7D\uDE7F\uDE8A\uDE9C-\uDEA0\uDEA4\uDEAA\uDEBC-\uDEEF\uDEF2-\uDFFF]|\uD83C[\uDC2C-\uDC2F\uDC94-\uDC9F\uDCAF\uDCB0\uDCC0\uDCD0\uDCF6-\uDCFF\uDD0D-\uDD0F\uDD6C-\uDD6F\uDDAD-\uDDE5\uDE03-\uDE0F\uDE3C-\uDE3F\uDE49-\uDE4F\uDE52-\uDE5F\uDE66-\uDEFF]|\uD83D[\uDED5-\uDEDF\uDEED-\uDEEF\uDEFA-\uDEFF\uDF74-\uDF7F\uDFD9-\uDFFF]|\uD83E[\uDC0C-\uDC0F\uDC48-\uDC4F\uDC5A-\uDC5F\uDC88-\uDC8F\uDCAE-\uDCFF\uDD0C-\uDD0F\uDD3F\uDD71\uDD72\uDD77-\uDD79\uDD7B\uDDA3-\uDDAF\uDDBA-\uDDBF\uDDC3-\uDDCF\uDE00-\uDE5F\uDE6E-\uDFFF]|\uD869[\uDED7-\uDEFF]|\uD86D[\uDF35-\uDF3F]|\uD86E[\uDC1E\uDC1F]|\uD873[\uDEA2-\uDEAF]|\uD87A[\uDFE1-\uDFFF]|\uD87E[\uDE1E-\uDFFF]|\uDB40[\uDC00-\uDCFF\uDDF0-\uDFFF]' + }, + { + 'name': 'Cc', + 'alias': 'Control', + 'bmp': '\0-\x1F\x7F-\x9F' + }, + { + 'name': 'Cf', + 'alias': 'Format', + 'bmp': '\xAD\u0600-\u0605\u061C\u06DD\u070F\u08E2\u180E\u200B-\u200F\u202A-\u202E\u2060-\u2064\u2066-\u206F\uFEFF\uFFF9-\uFFFB', + 'astral': '\uD804[\uDCBD\uDCCD]|\uD82F[\uDCA0-\uDCA3]|\uD834[\uDD73-\uDD7A]|\uDB40[\uDC01\uDC20-\uDC7F]' + }, + { + 'name': 'Cn', + 'alias': 'Unassigned', + 'bmp': '\u0378\u0379\u0380-\u0383\u038B\u038D\u03A2\u0530\u0557\u0558\u058B\u058C\u0590\u05C8-\u05CF\u05EB-\u05EE\u05F5-\u05FF\u061D\u070E\u074B\u074C\u07B2-\u07BF\u07FB\u07FC\u082E\u082F\u083F\u085C\u085D\u085F\u086B-\u089F\u08B5\u08BE-\u08D2\u0984\u098D\u098E\u0991\u0992\u09A9\u09B1\u09B3-\u09B5\u09BA\u09BB\u09C5\u09C6\u09C9\u09CA\u09CF-\u09D6\u09D8-\u09DB\u09DE\u09E4\u09E5\u09FF\u0A00\u0A04\u0A0B-\u0A0E\u0A11\u0A12\u0A29\u0A31\u0A34\u0A37\u0A3A\u0A3B\u0A3D\u0A43-\u0A46\u0A49\u0A4A\u0A4E-\u0A50\u0A52-\u0A58\u0A5D\u0A5F-\u0A65\u0A77-\u0A80\u0A84\u0A8E\u0A92\u0AA9\u0AB1\u0AB4\u0ABA\u0ABB\u0AC6\u0ACA\u0ACE\u0ACF\u0AD1-\u0ADF\u0AE4\u0AE5\u0AF2-\u0AF8\u0B00\u0B04\u0B0D\u0B0E\u0B11\u0B12\u0B29\u0B31\u0B34\u0B3A\u0B3B\u0B45\u0B46\u0B49\u0B4A\u0B4E-\u0B55\u0B58-\u0B5B\u0B5E\u0B64\u0B65\u0B78-\u0B81\u0B84\u0B8B-\u0B8D\u0B91\u0B96-\u0B98\u0B9B\u0B9D\u0BA0-\u0BA2\u0BA5-\u0BA7\u0BAB-\u0BAD\u0BBA-\u0BBD\u0BC3-\u0BC5\u0BC9\u0BCE\u0BCF\u0BD1-\u0BD6\u0BD8-\u0BE5\u0BFB-\u0BFF\u0C0D\u0C11\u0C29\u0C3A-\u0C3C\u0C45\u0C49\u0C4E-\u0C54\u0C57\u0C5B-\u0C5F\u0C64\u0C65\u0C70-\u0C77\u0C8D\u0C91\u0CA9\u0CB4\u0CBA\u0CBB\u0CC5\u0CC9\u0CCE-\u0CD4\u0CD7-\u0CDD\u0CDF\u0CE4\u0CE5\u0CF0\u0CF3-\u0CFF\u0D04\u0D0D\u0D11\u0D45\u0D49\u0D50-\u0D53\u0D64\u0D65\u0D80\u0D81\u0D84\u0D97-\u0D99\u0DB2\u0DBC\u0DBE\u0DBF\u0DC7-\u0DC9\u0DCB-\u0DCE\u0DD5\u0DD7\u0DE0-\u0DE5\u0DF0\u0DF1\u0DF5-\u0E00\u0E3B-\u0E3E\u0E5C-\u0E80\u0E83\u0E85\u0E86\u0E89\u0E8B\u0E8C\u0E8E-\u0E93\u0E98\u0EA0\u0EA4\u0EA6\u0EA8\u0EA9\u0EAC\u0EBA\u0EBE\u0EBF\u0EC5\u0EC7\u0ECE\u0ECF\u0EDA\u0EDB\u0EE0-\u0EFF\u0F48\u0F6D-\u0F70\u0F98\u0FBD\u0FCD\u0FDB-\u0FFF\u10C6\u10C8-\u10CC\u10CE\u10CF\u1249\u124E\u124F\u1257\u1259\u125E\u125F\u1289\u128E\u128F\u12B1\u12B6\u12B7\u12BF\u12C1\u12C6\u12C7\u12D7\u1311\u1316\u1317\u135B\u135C\u137D-\u137F\u139A-\u139F\u13F6\u13F7\u13FE\u13FF\u169D-\u169F\u16F9-\u16FF\u170D\u1715-\u171F\u1737-\u173F\u1754-\u175F\u176D\u1771\u1774-\u177F\u17DE\u17DF\u17EA-\u17EF\u17FA-\u17FF\u180F\u181A-\u181F\u1879-\u187F\u18AB-\u18AF\u18F6-\u18FF\u191F\u192C-\u192F\u193C-\u193F\u1941-\u1943\u196E\u196F\u1975-\u197F\u19AC-\u19AF\u19CA-\u19CF\u19DB-\u19DD\u1A1C\u1A1D\u1A5F\u1A7D\u1A7E\u1A8A-\u1A8F\u1A9A-\u1A9F\u1AAE\u1AAF\u1ABF-\u1AFF\u1B4C-\u1B4F\u1B7D-\u1B7F\u1BF4-\u1BFB\u1C38-\u1C3A\u1C4A-\u1C4C\u1C89-\u1C8F\u1CBB\u1CBC\u1CC8-\u1CCF\u1CFA-\u1CFF\u1DFA\u1F16\u1F17\u1F1E\u1F1F\u1F46\u1F47\u1F4E\u1F4F\u1F58\u1F5A\u1F5C\u1F5E\u1F7E\u1F7F\u1FB5\u1FC5\u1FD4\u1FD5\u1FDC\u1FF0\u1FF1\u1FF5\u1FFF\u2065\u2072\u2073\u208F\u209D-\u209F\u20C0-\u20CF\u20F1-\u20FF\u218C-\u218F\u2427-\u243F\u244B-\u245F\u2B74\u2B75\u2B96\u2B97\u2BC9\u2BFF\u2C2F\u2C5F\u2CF4-\u2CF8\u2D26\u2D28-\u2D2C\u2D2E\u2D2F\u2D68-\u2D6E\u2D71-\u2D7E\u2D97-\u2D9F\u2DA7\u2DAF\u2DB7\u2DBF\u2DC7\u2DCF\u2DD7\u2DDF\u2E4F-\u2E7F\u2E9A\u2EF4-\u2EFF\u2FD6-\u2FEF\u2FFC-\u2FFF\u3040\u3097\u3098\u3100-\u3104\u3130\u318F\u31BB-\u31BF\u31E4-\u31EF\u321F\u32FF\u4DB6-\u4DBF\u9FF0-\u9FFF\uA48D-\uA48F\uA4C7-\uA4CF\uA62C-\uA63F\uA6F8-\uA6FF\uA7BA-\uA7F6\uA82C-\uA82F\uA83A-\uA83F\uA878-\uA87F\uA8C6-\uA8CD\uA8DA-\uA8DF\uA954-\uA95E\uA97D-\uA97F\uA9CE\uA9DA-\uA9DD\uA9FF\uAA37-\uAA3F\uAA4E\uAA4F\uAA5A\uAA5B\uAAC3-\uAADA\uAAF7-\uAB00\uAB07\uAB08\uAB0F\uAB10\uAB17-\uAB1F\uAB27\uAB2F\uAB66-\uAB6F\uABEE\uABEF\uABFA-\uABFF\uD7A4-\uD7AF\uD7C7-\uD7CA\uD7FC-\uD7FF\uFA6E\uFA6F\uFADA-\uFAFF\uFB07-\uFB12\uFB18-\uFB1C\uFB37\uFB3D\uFB3F\uFB42\uFB45\uFBC2-\uFBD2\uFD40-\uFD4F\uFD90\uFD91\uFDC8-\uFDEF\uFDFE\uFDFF\uFE1A-\uFE1F\uFE53\uFE67\uFE6C-\uFE6F\uFE75\uFEFD\uFEFE\uFF00\uFFBF-\uFFC1\uFFC8\uFFC9\uFFD0\uFFD1\uFFD8\uFFD9\uFFDD-\uFFDF\uFFE7\uFFEF-\uFFF8\uFFFE\uFFFF', + 'astral': '\uD800[\uDC0C\uDC27\uDC3B\uDC3E\uDC4E\uDC4F\uDC5E-\uDC7F\uDCFB-\uDCFF\uDD03-\uDD06\uDD34-\uDD36\uDD8F\uDD9C-\uDD9F\uDDA1-\uDDCF\uDDFE-\uDE7F\uDE9D-\uDE9F\uDED1-\uDEDF\uDEFC-\uDEFF\uDF24-\uDF2C\uDF4B-\uDF4F\uDF7B-\uDF7F\uDF9E\uDFC4-\uDFC7\uDFD6-\uDFFF]|\uD801[\uDC9E\uDC9F\uDCAA-\uDCAF\uDCD4-\uDCD7\uDCFC-\uDCFF\uDD28-\uDD2F\uDD64-\uDD6E\uDD70-\uDDFF\uDF37-\uDF3F\uDF56-\uDF5F\uDF68-\uDFFF]|\uD802[\uDC06\uDC07\uDC09\uDC36\uDC39-\uDC3B\uDC3D\uDC3E\uDC56\uDC9F-\uDCA6\uDCB0-\uDCDF\uDCF3\uDCF6-\uDCFA\uDD1C-\uDD1E\uDD3A-\uDD3E\uDD40-\uDD7F\uDDB8-\uDDBB\uDDD0\uDDD1\uDE04\uDE07-\uDE0B\uDE14\uDE18\uDE36\uDE37\uDE3B-\uDE3E\uDE49-\uDE4F\uDE59-\uDE5F\uDEA0-\uDEBF\uDEE7-\uDEEA\uDEF7-\uDEFF\uDF36-\uDF38\uDF56\uDF57\uDF73-\uDF77\uDF92-\uDF98\uDF9D-\uDFA8\uDFB0-\uDFFF]|\uD803[\uDC49-\uDC7F\uDCB3-\uDCBF\uDCF3-\uDCF9\uDD28-\uDD2F\uDD3A-\uDE5F\uDE7F-\uDEFF\uDF28-\uDF2F\uDF5A-\uDFFF]|\uD804[\uDC4E-\uDC51\uDC70-\uDC7E\uDCC2-\uDCCC\uDCCE\uDCCF\uDCE9-\uDCEF\uDCFA-\uDCFF\uDD35\uDD47-\uDD4F\uDD77-\uDD7F\uDDCE\uDDCF\uDDE0\uDDF5-\uDDFF\uDE12\uDE3F-\uDE7F\uDE87\uDE89\uDE8E\uDE9E\uDEAA-\uDEAF\uDEEB-\uDEEF\uDEFA-\uDEFF\uDF04\uDF0D\uDF0E\uDF11\uDF12\uDF29\uDF31\uDF34\uDF3A\uDF45\uDF46\uDF49\uDF4A\uDF4E\uDF4F\uDF51-\uDF56\uDF58-\uDF5C\uDF64\uDF65\uDF6D-\uDF6F\uDF75-\uDFFF]|\uD805[\uDC5A\uDC5C\uDC5F-\uDC7F\uDCC8-\uDCCF\uDCDA-\uDD7F\uDDB6\uDDB7\uDDDE-\uDDFF\uDE45-\uDE4F\uDE5A-\uDE5F\uDE6D-\uDE7F\uDEB8-\uDEBF\uDECA-\uDEFF\uDF1B\uDF1C\uDF2C-\uDF2F\uDF40-\uDFFF]|\uD806[\uDC3C-\uDC9F\uDCF3-\uDCFE\uDD00-\uDDFF\uDE48-\uDE4F\uDE84\uDE85\uDEA3-\uDEBF\uDEF9-\uDFFF]|\uD807[\uDC09\uDC37\uDC46-\uDC4F\uDC6D-\uDC6F\uDC90\uDC91\uDCA8\uDCB7-\uDCFF\uDD07\uDD0A\uDD37-\uDD39\uDD3B\uDD3E\uDD48-\uDD4F\uDD5A-\uDD5F\uDD66\uDD69\uDD8F\uDD92\uDD99-\uDD9F\uDDAA-\uDEDF\uDEF9-\uDFFF]|\uD808[\uDF9A-\uDFFF]|\uD809[\uDC6F\uDC75-\uDC7F\uDD44-\uDFFF]|[\uD80A\uD80B\uD80E-\uD810\uD812-\uD819\uD823-\uD82B\uD82D\uD82E\uD830-\uD833\uD837\uD839\uD83F\uD87B-\uD87D\uD87F-\uDB3F\uDB41-\uDB7F][\uDC00-\uDFFF]|\uD80D[\uDC2F-\uDFFF]|\uD811[\uDE47-\uDFFF]|\uD81A[\uDE39-\uDE3F\uDE5F\uDE6A-\uDE6D\uDE70-\uDECF\uDEEE\uDEEF\uDEF6-\uDEFF\uDF46-\uDF4F\uDF5A\uDF62\uDF78-\uDF7C\uDF90-\uDFFF]|\uD81B[\uDC00-\uDE3F\uDE9B-\uDEFF\uDF45-\uDF4F\uDF7F-\uDF8E\uDFA0-\uDFDF\uDFE2-\uDFFF]|\uD821[\uDFF2-\uDFFF]|\uD822[\uDEF3-\uDFFF]|\uD82C[\uDD1F-\uDD6F\uDEFC-\uDFFF]|\uD82F[\uDC6B-\uDC6F\uDC7D-\uDC7F\uDC89-\uDC8F\uDC9A\uDC9B\uDCA4-\uDFFF]|\uD834[\uDCF6-\uDCFF\uDD27\uDD28\uDDE9-\uDDFF\uDE46-\uDEDF\uDEF4-\uDEFF\uDF57-\uDF5F\uDF79-\uDFFF]|\uD835[\uDC55\uDC9D\uDCA0\uDCA1\uDCA3\uDCA4\uDCA7\uDCA8\uDCAD\uDCBA\uDCBC\uDCC4\uDD06\uDD0B\uDD0C\uDD15\uDD1D\uDD3A\uDD3F\uDD45\uDD47-\uDD49\uDD51\uDEA6\uDEA7\uDFCC\uDFCD]|\uD836[\uDE8C-\uDE9A\uDEA0\uDEB0-\uDFFF]|\uD838[\uDC07\uDC19\uDC1A\uDC22\uDC25\uDC2B-\uDFFF]|\uD83A[\uDCC5\uDCC6\uDCD7-\uDCFF\uDD4B-\uDD4F\uDD5A-\uDD5D\uDD60-\uDFFF]|\uD83B[\uDC00-\uDC70\uDCB5-\uDDFF\uDE04\uDE20\uDE23\uDE25\uDE26\uDE28\uDE33\uDE38\uDE3A\uDE3C-\uDE41\uDE43-\uDE46\uDE48\uDE4A\uDE4C\uDE50\uDE53\uDE55\uDE56\uDE58\uDE5A\uDE5C\uDE5E\uDE60\uDE63\uDE65\uDE66\uDE6B\uDE73\uDE78\uDE7D\uDE7F\uDE8A\uDE9C-\uDEA0\uDEA4\uDEAA\uDEBC-\uDEEF\uDEF2-\uDFFF]|\uD83C[\uDC2C-\uDC2F\uDC94-\uDC9F\uDCAF\uDCB0\uDCC0\uDCD0\uDCF6-\uDCFF\uDD0D-\uDD0F\uDD6C-\uDD6F\uDDAD-\uDDE5\uDE03-\uDE0F\uDE3C-\uDE3F\uDE49-\uDE4F\uDE52-\uDE5F\uDE66-\uDEFF]|\uD83D[\uDED5-\uDEDF\uDEED-\uDEEF\uDEFA-\uDEFF\uDF74-\uDF7F\uDFD9-\uDFFF]|\uD83E[\uDC0C-\uDC0F\uDC48-\uDC4F\uDC5A-\uDC5F\uDC88-\uDC8F\uDCAE-\uDCFF\uDD0C-\uDD0F\uDD3F\uDD71\uDD72\uDD77-\uDD79\uDD7B\uDDA3-\uDDAF\uDDBA-\uDDBF\uDDC3-\uDDCF\uDE00-\uDE5F\uDE6E-\uDFFF]|\uD869[\uDED7-\uDEFF]|\uD86D[\uDF35-\uDF3F]|\uD86E[\uDC1E\uDC1F]|\uD873[\uDEA2-\uDEAF]|\uD87A[\uDFE1-\uDFFF]|\uD87E[\uDE1E-\uDFFF]|\uDB40[\uDC00\uDC02-\uDC1F\uDC80-\uDCFF\uDDF0-\uDFFF]|[\uDBBF\uDBFF][\uDFFE\uDFFF]' + }, + { + 'name': 'Co', + 'alias': 'Private_Use', + 'bmp': '\uE000-\uF8FF', + 'astral': '[\uDB80-\uDBBE\uDBC0-\uDBFE][\uDC00-\uDFFF]|[\uDBBF\uDBFF][\uDC00-\uDFFD]' + }, + { + 'name': 'Cs', + 'alias': 'Surrogate', + 'bmp': '\uD800-\uDFFF' + }, + { + 'name': 'L', + 'alias': 'Letter', + 'bmp': 'A-Za-z\xAA\xB5\xBA\xC0-\xD6\xD8-\xF6\xF8-\u02C1\u02C6-\u02D1\u02E0-\u02E4\u02EC\u02EE\u0370-\u0374\u0376\u0377\u037A-\u037D\u037F\u0386\u0388-\u038A\u038C\u038E-\u03A1\u03A3-\u03F5\u03F7-\u0481\u048A-\u052F\u0531-\u0556\u0559\u0560-\u0588\u05D0-\u05EA\u05EF-\u05F2\u0620-\u064A\u066E\u066F\u0671-\u06D3\u06D5\u06E5\u06E6\u06EE\u06EF\u06FA-\u06FC\u06FF\u0710\u0712-\u072F\u074D-\u07A5\u07B1\u07CA-\u07EA\u07F4\u07F5\u07FA\u0800-\u0815\u081A\u0824\u0828\u0840-\u0858\u0860-\u086A\u08A0-\u08B4\u08B6-\u08BD\u0904-\u0939\u093D\u0950\u0958-\u0961\u0971-\u0980\u0985-\u098C\u098F\u0990\u0993-\u09A8\u09AA-\u09B0\u09B2\u09B6-\u09B9\u09BD\u09CE\u09DC\u09DD\u09DF-\u09E1\u09F0\u09F1\u09FC\u0A05-\u0A0A\u0A0F\u0A10\u0A13-\u0A28\u0A2A-\u0A30\u0A32\u0A33\u0A35\u0A36\u0A38\u0A39\u0A59-\u0A5C\u0A5E\u0A72-\u0A74\u0A85-\u0A8D\u0A8F-\u0A91\u0A93-\u0AA8\u0AAA-\u0AB0\u0AB2\u0AB3\u0AB5-\u0AB9\u0ABD\u0AD0\u0AE0\u0AE1\u0AF9\u0B05-\u0B0C\u0B0F\u0B10\u0B13-\u0B28\u0B2A-\u0B30\u0B32\u0B33\u0B35-\u0B39\u0B3D\u0B5C\u0B5D\u0B5F-\u0B61\u0B71\u0B83\u0B85-\u0B8A\u0B8E-\u0B90\u0B92-\u0B95\u0B99\u0B9A\u0B9C\u0B9E\u0B9F\u0BA3\u0BA4\u0BA8-\u0BAA\u0BAE-\u0BB9\u0BD0\u0C05-\u0C0C\u0C0E-\u0C10\u0C12-\u0C28\u0C2A-\u0C39\u0C3D\u0C58-\u0C5A\u0C60\u0C61\u0C80\u0C85-\u0C8C\u0C8E-\u0C90\u0C92-\u0CA8\u0CAA-\u0CB3\u0CB5-\u0CB9\u0CBD\u0CDE\u0CE0\u0CE1\u0CF1\u0CF2\u0D05-\u0D0C\u0D0E-\u0D10\u0D12-\u0D3A\u0D3D\u0D4E\u0D54-\u0D56\u0D5F-\u0D61\u0D7A-\u0D7F\u0D85-\u0D96\u0D9A-\u0DB1\u0DB3-\u0DBB\u0DBD\u0DC0-\u0DC6\u0E01-\u0E30\u0E32\u0E33\u0E40-\u0E46\u0E81\u0E82\u0E84\u0E87\u0E88\u0E8A\u0E8D\u0E94-\u0E97\u0E99-\u0E9F\u0EA1-\u0EA3\u0EA5\u0EA7\u0EAA\u0EAB\u0EAD-\u0EB0\u0EB2\u0EB3\u0EBD\u0EC0-\u0EC4\u0EC6\u0EDC-\u0EDF\u0F00\u0F40-\u0F47\u0F49-\u0F6C\u0F88-\u0F8C\u1000-\u102A\u103F\u1050-\u1055\u105A-\u105D\u1061\u1065\u1066\u106E-\u1070\u1075-\u1081\u108E\u10A0-\u10C5\u10C7\u10CD\u10D0-\u10FA\u10FC-\u1248\u124A-\u124D\u1250-\u1256\u1258\u125A-\u125D\u1260-\u1288\u128A-\u128D\u1290-\u12B0\u12B2-\u12B5\u12B8-\u12BE\u12C0\u12C2-\u12C5\u12C8-\u12D6\u12D8-\u1310\u1312-\u1315\u1318-\u135A\u1380-\u138F\u13A0-\u13F5\u13F8-\u13FD\u1401-\u166C\u166F-\u167F\u1681-\u169A\u16A0-\u16EA\u16F1-\u16F8\u1700-\u170C\u170E-\u1711\u1720-\u1731\u1740-\u1751\u1760-\u176C\u176E-\u1770\u1780-\u17B3\u17D7\u17DC\u1820-\u1878\u1880-\u1884\u1887-\u18A8\u18AA\u18B0-\u18F5\u1900-\u191E\u1950-\u196D\u1970-\u1974\u1980-\u19AB\u19B0-\u19C9\u1A00-\u1A16\u1A20-\u1A54\u1AA7\u1B05-\u1B33\u1B45-\u1B4B\u1B83-\u1BA0\u1BAE\u1BAF\u1BBA-\u1BE5\u1C00-\u1C23\u1C4D-\u1C4F\u1C5A-\u1C7D\u1C80-\u1C88\u1C90-\u1CBA\u1CBD-\u1CBF\u1CE9-\u1CEC\u1CEE-\u1CF1\u1CF5\u1CF6\u1D00-\u1DBF\u1E00-\u1F15\u1F18-\u1F1D\u1F20-\u1F45\u1F48-\u1F4D\u1F50-\u1F57\u1F59\u1F5B\u1F5D\u1F5F-\u1F7D\u1F80-\u1FB4\u1FB6-\u1FBC\u1FBE\u1FC2-\u1FC4\u1FC6-\u1FCC\u1FD0-\u1FD3\u1FD6-\u1FDB\u1FE0-\u1FEC\u1FF2-\u1FF4\u1FF6-\u1FFC\u2071\u207F\u2090-\u209C\u2102\u2107\u210A-\u2113\u2115\u2119-\u211D\u2124\u2126\u2128\u212A-\u212D\u212F-\u2139\u213C-\u213F\u2145-\u2149\u214E\u2183\u2184\u2C00-\u2C2E\u2C30-\u2C5E\u2C60-\u2CE4\u2CEB-\u2CEE\u2CF2\u2CF3\u2D00-\u2D25\u2D27\u2D2D\u2D30-\u2D67\u2D6F\u2D80-\u2D96\u2DA0-\u2DA6\u2DA8-\u2DAE\u2DB0-\u2DB6\u2DB8-\u2DBE\u2DC0-\u2DC6\u2DC8-\u2DCE\u2DD0-\u2DD6\u2DD8-\u2DDE\u2E2F\u3005\u3006\u3031-\u3035\u303B\u303C\u3041-\u3096\u309D-\u309F\u30A1-\u30FA\u30FC-\u30FF\u3105-\u312F\u3131-\u318E\u31A0-\u31BA\u31F0-\u31FF\u3400-\u4DB5\u4E00-\u9FEF\uA000-\uA48C\uA4D0-\uA4FD\uA500-\uA60C\uA610-\uA61F\uA62A\uA62B\uA640-\uA66E\uA67F-\uA69D\uA6A0-\uA6E5\uA717-\uA71F\uA722-\uA788\uA78B-\uA7B9\uA7F7-\uA801\uA803-\uA805\uA807-\uA80A\uA80C-\uA822\uA840-\uA873\uA882-\uA8B3\uA8F2-\uA8F7\uA8FB\uA8FD\uA8FE\uA90A-\uA925\uA930-\uA946\uA960-\uA97C\uA984-\uA9B2\uA9CF\uA9E0-\uA9E4\uA9E6-\uA9EF\uA9FA-\uA9FE\uAA00-\uAA28\uAA40-\uAA42\uAA44-\uAA4B\uAA60-\uAA76\uAA7A\uAA7E-\uAAAF\uAAB1\uAAB5\uAAB6\uAAB9-\uAABD\uAAC0\uAAC2\uAADB-\uAADD\uAAE0-\uAAEA\uAAF2-\uAAF4\uAB01-\uAB06\uAB09-\uAB0E\uAB11-\uAB16\uAB20-\uAB26\uAB28-\uAB2E\uAB30-\uAB5A\uAB5C-\uAB65\uAB70-\uABE2\uAC00-\uD7A3\uD7B0-\uD7C6\uD7CB-\uD7FB\uF900-\uFA6D\uFA70-\uFAD9\uFB00-\uFB06\uFB13-\uFB17\uFB1D\uFB1F-\uFB28\uFB2A-\uFB36\uFB38-\uFB3C\uFB3E\uFB40\uFB41\uFB43\uFB44\uFB46-\uFBB1\uFBD3-\uFD3D\uFD50-\uFD8F\uFD92-\uFDC7\uFDF0-\uFDFB\uFE70-\uFE74\uFE76-\uFEFC\uFF21-\uFF3A\uFF41-\uFF5A\uFF66-\uFFBE\uFFC2-\uFFC7\uFFCA-\uFFCF\uFFD2-\uFFD7\uFFDA-\uFFDC', + 'astral': '\uD800[\uDC00-\uDC0B\uDC0D-\uDC26\uDC28-\uDC3A\uDC3C\uDC3D\uDC3F-\uDC4D\uDC50-\uDC5D\uDC80-\uDCFA\uDE80-\uDE9C\uDEA0-\uDED0\uDF00-\uDF1F\uDF2D-\uDF40\uDF42-\uDF49\uDF50-\uDF75\uDF80-\uDF9D\uDFA0-\uDFC3\uDFC8-\uDFCF]|\uD801[\uDC00-\uDC9D\uDCB0-\uDCD3\uDCD8-\uDCFB\uDD00-\uDD27\uDD30-\uDD63\uDE00-\uDF36\uDF40-\uDF55\uDF60-\uDF67]|\uD802[\uDC00-\uDC05\uDC08\uDC0A-\uDC35\uDC37\uDC38\uDC3C\uDC3F-\uDC55\uDC60-\uDC76\uDC80-\uDC9E\uDCE0-\uDCF2\uDCF4\uDCF5\uDD00-\uDD15\uDD20-\uDD39\uDD80-\uDDB7\uDDBE\uDDBF\uDE00\uDE10-\uDE13\uDE15-\uDE17\uDE19-\uDE35\uDE60-\uDE7C\uDE80-\uDE9C\uDEC0-\uDEC7\uDEC9-\uDEE4\uDF00-\uDF35\uDF40-\uDF55\uDF60-\uDF72\uDF80-\uDF91]|\uD803[\uDC00-\uDC48\uDC80-\uDCB2\uDCC0-\uDCF2\uDD00-\uDD23\uDF00-\uDF1C\uDF27\uDF30-\uDF45]|\uD804[\uDC03-\uDC37\uDC83-\uDCAF\uDCD0-\uDCE8\uDD03-\uDD26\uDD44\uDD50-\uDD72\uDD76\uDD83-\uDDB2\uDDC1-\uDDC4\uDDDA\uDDDC\uDE00-\uDE11\uDE13-\uDE2B\uDE80-\uDE86\uDE88\uDE8A-\uDE8D\uDE8F-\uDE9D\uDE9F-\uDEA8\uDEB0-\uDEDE\uDF05-\uDF0C\uDF0F\uDF10\uDF13-\uDF28\uDF2A-\uDF30\uDF32\uDF33\uDF35-\uDF39\uDF3D\uDF50\uDF5D-\uDF61]|\uD805[\uDC00-\uDC34\uDC47-\uDC4A\uDC80-\uDCAF\uDCC4\uDCC5\uDCC7\uDD80-\uDDAE\uDDD8-\uDDDB\uDE00-\uDE2F\uDE44\uDE80-\uDEAA\uDF00-\uDF1A]|\uD806[\uDC00-\uDC2B\uDCA0-\uDCDF\uDCFF\uDE00\uDE0B-\uDE32\uDE3A\uDE50\uDE5C-\uDE83\uDE86-\uDE89\uDE9D\uDEC0-\uDEF8]|\uD807[\uDC00-\uDC08\uDC0A-\uDC2E\uDC40\uDC72-\uDC8F\uDD00-\uDD06\uDD08\uDD09\uDD0B-\uDD30\uDD46\uDD60-\uDD65\uDD67\uDD68\uDD6A-\uDD89\uDD98\uDEE0-\uDEF2]|\uD808[\uDC00-\uDF99]|\uD809[\uDC80-\uDD43]|[\uD80C\uD81C-\uD820\uD840-\uD868\uD86A-\uD86C\uD86F-\uD872\uD874-\uD879][\uDC00-\uDFFF]|\uD80D[\uDC00-\uDC2E]|\uD811[\uDC00-\uDE46]|\uD81A[\uDC00-\uDE38\uDE40-\uDE5E\uDED0-\uDEED\uDF00-\uDF2F\uDF40-\uDF43\uDF63-\uDF77\uDF7D-\uDF8F]|\uD81B[\uDE40-\uDE7F\uDF00-\uDF44\uDF50\uDF93-\uDF9F\uDFE0\uDFE1]|\uD821[\uDC00-\uDFF1]|\uD822[\uDC00-\uDEF2]|\uD82C[\uDC00-\uDD1E\uDD70-\uDEFB]|\uD82F[\uDC00-\uDC6A\uDC70-\uDC7C\uDC80-\uDC88\uDC90-\uDC99]|\uD835[\uDC00-\uDC54\uDC56-\uDC9C\uDC9E\uDC9F\uDCA2\uDCA5\uDCA6\uDCA9-\uDCAC\uDCAE-\uDCB9\uDCBB\uDCBD-\uDCC3\uDCC5-\uDD05\uDD07-\uDD0A\uDD0D-\uDD14\uDD16-\uDD1C\uDD1E-\uDD39\uDD3B-\uDD3E\uDD40-\uDD44\uDD46\uDD4A-\uDD50\uDD52-\uDEA5\uDEA8-\uDEC0\uDEC2-\uDEDA\uDEDC-\uDEFA\uDEFC-\uDF14\uDF16-\uDF34\uDF36-\uDF4E\uDF50-\uDF6E\uDF70-\uDF88\uDF8A-\uDFA8\uDFAA-\uDFC2\uDFC4-\uDFCB]|\uD83A[\uDC00-\uDCC4\uDD00-\uDD43]|\uD83B[\uDE00-\uDE03\uDE05-\uDE1F\uDE21\uDE22\uDE24\uDE27\uDE29-\uDE32\uDE34-\uDE37\uDE39\uDE3B\uDE42\uDE47\uDE49\uDE4B\uDE4D-\uDE4F\uDE51\uDE52\uDE54\uDE57\uDE59\uDE5B\uDE5D\uDE5F\uDE61\uDE62\uDE64\uDE67-\uDE6A\uDE6C-\uDE72\uDE74-\uDE77\uDE79-\uDE7C\uDE7E\uDE80-\uDE89\uDE8B-\uDE9B\uDEA1-\uDEA3\uDEA5-\uDEA9\uDEAB-\uDEBB]|\uD869[\uDC00-\uDED6\uDF00-\uDFFF]|\uD86D[\uDC00-\uDF34\uDF40-\uDFFF]|\uD86E[\uDC00-\uDC1D\uDC20-\uDFFF]|\uD873[\uDC00-\uDEA1\uDEB0-\uDFFF]|\uD87A[\uDC00-\uDFE0]|\uD87E[\uDC00-\uDE1D]' + }, + { + 'name': 'LC', + 'alias': 'Cased_Letter', + 'bmp': 'A-Za-z\xB5\xC0-\xD6\xD8-\xF6\xF8-\u01BA\u01BC-\u01BF\u01C4-\u0293\u0295-\u02AF\u0370-\u0373\u0376\u0377\u037B-\u037D\u037F\u0386\u0388-\u038A\u038C\u038E-\u03A1\u03A3-\u03F5\u03F7-\u0481\u048A-\u052F\u0531-\u0556\u0560-\u0588\u10A0-\u10C5\u10C7\u10CD\u10D0-\u10FA\u10FD-\u10FF\u13A0-\u13F5\u13F8-\u13FD\u1C80-\u1C88\u1C90-\u1CBA\u1CBD-\u1CBF\u1D00-\u1D2B\u1D6B-\u1D77\u1D79-\u1D9A\u1E00-\u1F15\u1F18-\u1F1D\u1F20-\u1F45\u1F48-\u1F4D\u1F50-\u1F57\u1F59\u1F5B\u1F5D\u1F5F-\u1F7D\u1F80-\u1FB4\u1FB6-\u1FBC\u1FBE\u1FC2-\u1FC4\u1FC6-\u1FCC\u1FD0-\u1FD3\u1FD6-\u1FDB\u1FE0-\u1FEC\u1FF2-\u1FF4\u1FF6-\u1FFC\u2102\u2107\u210A-\u2113\u2115\u2119-\u211D\u2124\u2126\u2128\u212A-\u212D\u212F-\u2134\u2139\u213C-\u213F\u2145-\u2149\u214E\u2183\u2184\u2C00-\u2C2E\u2C30-\u2C5E\u2C60-\u2C7B\u2C7E-\u2CE4\u2CEB-\u2CEE\u2CF2\u2CF3\u2D00-\u2D25\u2D27\u2D2D\uA640-\uA66D\uA680-\uA69B\uA722-\uA76F\uA771-\uA787\uA78B-\uA78E\uA790-\uA7B9\uA7FA\uAB30-\uAB5A\uAB60-\uAB65\uAB70-\uABBF\uFB00-\uFB06\uFB13-\uFB17\uFF21-\uFF3A\uFF41-\uFF5A', + 'astral': '\uD801[\uDC00-\uDC4F\uDCB0-\uDCD3\uDCD8-\uDCFB]|\uD803[\uDC80-\uDCB2\uDCC0-\uDCF2]|\uD806[\uDCA0-\uDCDF]|\uD81B[\uDE40-\uDE7F]|\uD835[\uDC00-\uDC54\uDC56-\uDC9C\uDC9E\uDC9F\uDCA2\uDCA5\uDCA6\uDCA9-\uDCAC\uDCAE-\uDCB9\uDCBB\uDCBD-\uDCC3\uDCC5-\uDD05\uDD07-\uDD0A\uDD0D-\uDD14\uDD16-\uDD1C\uDD1E-\uDD39\uDD3B-\uDD3E\uDD40-\uDD44\uDD46\uDD4A-\uDD50\uDD52-\uDEA5\uDEA8-\uDEC0\uDEC2-\uDEDA\uDEDC-\uDEFA\uDEFC-\uDF14\uDF16-\uDF34\uDF36-\uDF4E\uDF50-\uDF6E\uDF70-\uDF88\uDF8A-\uDFA8\uDFAA-\uDFC2\uDFC4-\uDFCB]|\uD83A[\uDD00-\uDD43]' + }, + { + 'name': 'Ll', + 'alias': 'Lowercase_Letter', + 'bmp': 'a-z\xB5\xDF-\xF6\xF8-\xFF\u0101\u0103\u0105\u0107\u0109\u010B\u010D\u010F\u0111\u0113\u0115\u0117\u0119\u011B\u011D\u011F\u0121\u0123\u0125\u0127\u0129\u012B\u012D\u012F\u0131\u0133\u0135\u0137\u0138\u013A\u013C\u013E\u0140\u0142\u0144\u0146\u0148\u0149\u014B\u014D\u014F\u0151\u0153\u0155\u0157\u0159\u015B\u015D\u015F\u0161\u0163\u0165\u0167\u0169\u016B\u016D\u016F\u0171\u0173\u0175\u0177\u017A\u017C\u017E-\u0180\u0183\u0185\u0188\u018C\u018D\u0192\u0195\u0199-\u019B\u019E\u01A1\u01A3\u01A5\u01A8\u01AA\u01AB\u01AD\u01B0\u01B4\u01B6\u01B9\u01BA\u01BD-\u01BF\u01C6\u01C9\u01CC\u01CE\u01D0\u01D2\u01D4\u01D6\u01D8\u01DA\u01DC\u01DD\u01DF\u01E1\u01E3\u01E5\u01E7\u01E9\u01EB\u01ED\u01EF\u01F0\u01F3\u01F5\u01F9\u01FB\u01FD\u01FF\u0201\u0203\u0205\u0207\u0209\u020B\u020D\u020F\u0211\u0213\u0215\u0217\u0219\u021B\u021D\u021F\u0221\u0223\u0225\u0227\u0229\u022B\u022D\u022F\u0231\u0233-\u0239\u023C\u023F\u0240\u0242\u0247\u0249\u024B\u024D\u024F-\u0293\u0295-\u02AF\u0371\u0373\u0377\u037B-\u037D\u0390\u03AC-\u03CE\u03D0\u03D1\u03D5-\u03D7\u03D9\u03DB\u03DD\u03DF\u03E1\u03E3\u03E5\u03E7\u03E9\u03EB\u03ED\u03EF-\u03F3\u03F5\u03F8\u03FB\u03FC\u0430-\u045F\u0461\u0463\u0465\u0467\u0469\u046B\u046D\u046F\u0471\u0473\u0475\u0477\u0479\u047B\u047D\u047F\u0481\u048B\u048D\u048F\u0491\u0493\u0495\u0497\u0499\u049B\u049D\u049F\u04A1\u04A3\u04A5\u04A7\u04A9\u04AB\u04AD\u04AF\u04B1\u04B3\u04B5\u04B7\u04B9\u04BB\u04BD\u04BF\u04C2\u04C4\u04C6\u04C8\u04CA\u04CC\u04CE\u04CF\u04D1\u04D3\u04D5\u04D7\u04D9\u04DB\u04DD\u04DF\u04E1\u04E3\u04E5\u04E7\u04E9\u04EB\u04ED\u04EF\u04F1\u04F3\u04F5\u04F7\u04F9\u04FB\u04FD\u04FF\u0501\u0503\u0505\u0507\u0509\u050B\u050D\u050F\u0511\u0513\u0515\u0517\u0519\u051B\u051D\u051F\u0521\u0523\u0525\u0527\u0529\u052B\u052D\u052F\u0560-\u0588\u10D0-\u10FA\u10FD-\u10FF\u13F8-\u13FD\u1C80-\u1C88\u1D00-\u1D2B\u1D6B-\u1D77\u1D79-\u1D9A\u1E01\u1E03\u1E05\u1E07\u1E09\u1E0B\u1E0D\u1E0F\u1E11\u1E13\u1E15\u1E17\u1E19\u1E1B\u1E1D\u1E1F\u1E21\u1E23\u1E25\u1E27\u1E29\u1E2B\u1E2D\u1E2F\u1E31\u1E33\u1E35\u1E37\u1E39\u1E3B\u1E3D\u1E3F\u1E41\u1E43\u1E45\u1E47\u1E49\u1E4B\u1E4D\u1E4F\u1E51\u1E53\u1E55\u1E57\u1E59\u1E5B\u1E5D\u1E5F\u1E61\u1E63\u1E65\u1E67\u1E69\u1E6B\u1E6D\u1E6F\u1E71\u1E73\u1E75\u1E77\u1E79\u1E7B\u1E7D\u1E7F\u1E81\u1E83\u1E85\u1E87\u1E89\u1E8B\u1E8D\u1E8F\u1E91\u1E93\u1E95-\u1E9D\u1E9F\u1EA1\u1EA3\u1EA5\u1EA7\u1EA9\u1EAB\u1EAD\u1EAF\u1EB1\u1EB3\u1EB5\u1EB7\u1EB9\u1EBB\u1EBD\u1EBF\u1EC1\u1EC3\u1EC5\u1EC7\u1EC9\u1ECB\u1ECD\u1ECF\u1ED1\u1ED3\u1ED5\u1ED7\u1ED9\u1EDB\u1EDD\u1EDF\u1EE1\u1EE3\u1EE5\u1EE7\u1EE9\u1EEB\u1EED\u1EEF\u1EF1\u1EF3\u1EF5\u1EF7\u1EF9\u1EFB\u1EFD\u1EFF-\u1F07\u1F10-\u1F15\u1F20-\u1F27\u1F30-\u1F37\u1F40-\u1F45\u1F50-\u1F57\u1F60-\u1F67\u1F70-\u1F7D\u1F80-\u1F87\u1F90-\u1F97\u1FA0-\u1FA7\u1FB0-\u1FB4\u1FB6\u1FB7\u1FBE\u1FC2-\u1FC4\u1FC6\u1FC7\u1FD0-\u1FD3\u1FD6\u1FD7\u1FE0-\u1FE7\u1FF2-\u1FF4\u1FF6\u1FF7\u210A\u210E\u210F\u2113\u212F\u2134\u2139\u213C\u213D\u2146-\u2149\u214E\u2184\u2C30-\u2C5E\u2C61\u2C65\u2C66\u2C68\u2C6A\u2C6C\u2C71\u2C73\u2C74\u2C76-\u2C7B\u2C81\u2C83\u2C85\u2C87\u2C89\u2C8B\u2C8D\u2C8F\u2C91\u2C93\u2C95\u2C97\u2C99\u2C9B\u2C9D\u2C9F\u2CA1\u2CA3\u2CA5\u2CA7\u2CA9\u2CAB\u2CAD\u2CAF\u2CB1\u2CB3\u2CB5\u2CB7\u2CB9\u2CBB\u2CBD\u2CBF\u2CC1\u2CC3\u2CC5\u2CC7\u2CC9\u2CCB\u2CCD\u2CCF\u2CD1\u2CD3\u2CD5\u2CD7\u2CD9\u2CDB\u2CDD\u2CDF\u2CE1\u2CE3\u2CE4\u2CEC\u2CEE\u2CF3\u2D00-\u2D25\u2D27\u2D2D\uA641\uA643\uA645\uA647\uA649\uA64B\uA64D\uA64F\uA651\uA653\uA655\uA657\uA659\uA65B\uA65D\uA65F\uA661\uA663\uA665\uA667\uA669\uA66B\uA66D\uA681\uA683\uA685\uA687\uA689\uA68B\uA68D\uA68F\uA691\uA693\uA695\uA697\uA699\uA69B\uA723\uA725\uA727\uA729\uA72B\uA72D\uA72F-\uA731\uA733\uA735\uA737\uA739\uA73B\uA73D\uA73F\uA741\uA743\uA745\uA747\uA749\uA74B\uA74D\uA74F\uA751\uA753\uA755\uA757\uA759\uA75B\uA75D\uA75F\uA761\uA763\uA765\uA767\uA769\uA76B\uA76D\uA76F\uA771-\uA778\uA77A\uA77C\uA77F\uA781\uA783\uA785\uA787\uA78C\uA78E\uA791\uA793-\uA795\uA797\uA799\uA79B\uA79D\uA79F\uA7A1\uA7A3\uA7A5\uA7A7\uA7A9\uA7AF\uA7B5\uA7B7\uA7B9\uA7FA\uAB30-\uAB5A\uAB60-\uAB65\uAB70-\uABBF\uFB00-\uFB06\uFB13-\uFB17\uFF41-\uFF5A', + 'astral': '\uD801[\uDC28-\uDC4F\uDCD8-\uDCFB]|\uD803[\uDCC0-\uDCF2]|\uD806[\uDCC0-\uDCDF]|\uD81B[\uDE60-\uDE7F]|\uD835[\uDC1A-\uDC33\uDC4E-\uDC54\uDC56-\uDC67\uDC82-\uDC9B\uDCB6-\uDCB9\uDCBB\uDCBD-\uDCC3\uDCC5-\uDCCF\uDCEA-\uDD03\uDD1E-\uDD37\uDD52-\uDD6B\uDD86-\uDD9F\uDDBA-\uDDD3\uDDEE-\uDE07\uDE22-\uDE3B\uDE56-\uDE6F\uDE8A-\uDEA5\uDEC2-\uDEDA\uDEDC-\uDEE1\uDEFC-\uDF14\uDF16-\uDF1B\uDF36-\uDF4E\uDF50-\uDF55\uDF70-\uDF88\uDF8A-\uDF8F\uDFAA-\uDFC2\uDFC4-\uDFC9\uDFCB]|\uD83A[\uDD22-\uDD43]' + }, + { + 'name': 'Lm', + 'alias': 'Modifier_Letter', + 'bmp': '\u02B0-\u02C1\u02C6-\u02D1\u02E0-\u02E4\u02EC\u02EE\u0374\u037A\u0559\u0640\u06E5\u06E6\u07F4\u07F5\u07FA\u081A\u0824\u0828\u0971\u0E46\u0EC6\u10FC\u17D7\u1843\u1AA7\u1C78-\u1C7D\u1D2C-\u1D6A\u1D78\u1D9B-\u1DBF\u2071\u207F\u2090-\u209C\u2C7C\u2C7D\u2D6F\u2E2F\u3005\u3031-\u3035\u303B\u309D\u309E\u30FC-\u30FE\uA015\uA4F8-\uA4FD\uA60C\uA67F\uA69C\uA69D\uA717-\uA71F\uA770\uA788\uA7F8\uA7F9\uA9CF\uA9E6\uAA70\uAADD\uAAF3\uAAF4\uAB5C-\uAB5F\uFF70\uFF9E\uFF9F', + 'astral': '\uD81A[\uDF40-\uDF43]|\uD81B[\uDF93-\uDF9F\uDFE0\uDFE1]' + }, + { + 'name': 'Lo', + 'alias': 'Other_Letter', + 'bmp': '\xAA\xBA\u01BB\u01C0-\u01C3\u0294\u05D0-\u05EA\u05EF-\u05F2\u0620-\u063F\u0641-\u064A\u066E\u066F\u0671-\u06D3\u06D5\u06EE\u06EF\u06FA-\u06FC\u06FF\u0710\u0712-\u072F\u074D-\u07A5\u07B1\u07CA-\u07EA\u0800-\u0815\u0840-\u0858\u0860-\u086A\u08A0-\u08B4\u08B6-\u08BD\u0904-\u0939\u093D\u0950\u0958-\u0961\u0972-\u0980\u0985-\u098C\u098F\u0990\u0993-\u09A8\u09AA-\u09B0\u09B2\u09B6-\u09B9\u09BD\u09CE\u09DC\u09DD\u09DF-\u09E1\u09F0\u09F1\u09FC\u0A05-\u0A0A\u0A0F\u0A10\u0A13-\u0A28\u0A2A-\u0A30\u0A32\u0A33\u0A35\u0A36\u0A38\u0A39\u0A59-\u0A5C\u0A5E\u0A72-\u0A74\u0A85-\u0A8D\u0A8F-\u0A91\u0A93-\u0AA8\u0AAA-\u0AB0\u0AB2\u0AB3\u0AB5-\u0AB9\u0ABD\u0AD0\u0AE0\u0AE1\u0AF9\u0B05-\u0B0C\u0B0F\u0B10\u0B13-\u0B28\u0B2A-\u0B30\u0B32\u0B33\u0B35-\u0B39\u0B3D\u0B5C\u0B5D\u0B5F-\u0B61\u0B71\u0B83\u0B85-\u0B8A\u0B8E-\u0B90\u0B92-\u0B95\u0B99\u0B9A\u0B9C\u0B9E\u0B9F\u0BA3\u0BA4\u0BA8-\u0BAA\u0BAE-\u0BB9\u0BD0\u0C05-\u0C0C\u0C0E-\u0C10\u0C12-\u0C28\u0C2A-\u0C39\u0C3D\u0C58-\u0C5A\u0C60\u0C61\u0C80\u0C85-\u0C8C\u0C8E-\u0C90\u0C92-\u0CA8\u0CAA-\u0CB3\u0CB5-\u0CB9\u0CBD\u0CDE\u0CE0\u0CE1\u0CF1\u0CF2\u0D05-\u0D0C\u0D0E-\u0D10\u0D12-\u0D3A\u0D3D\u0D4E\u0D54-\u0D56\u0D5F-\u0D61\u0D7A-\u0D7F\u0D85-\u0D96\u0D9A-\u0DB1\u0DB3-\u0DBB\u0DBD\u0DC0-\u0DC6\u0E01-\u0E30\u0E32\u0E33\u0E40-\u0E45\u0E81\u0E82\u0E84\u0E87\u0E88\u0E8A\u0E8D\u0E94-\u0E97\u0E99-\u0E9F\u0EA1-\u0EA3\u0EA5\u0EA7\u0EAA\u0EAB\u0EAD-\u0EB0\u0EB2\u0EB3\u0EBD\u0EC0-\u0EC4\u0EDC-\u0EDF\u0F00\u0F40-\u0F47\u0F49-\u0F6C\u0F88-\u0F8C\u1000-\u102A\u103F\u1050-\u1055\u105A-\u105D\u1061\u1065\u1066\u106E-\u1070\u1075-\u1081\u108E\u1100-\u1248\u124A-\u124D\u1250-\u1256\u1258\u125A-\u125D\u1260-\u1288\u128A-\u128D\u1290-\u12B0\u12B2-\u12B5\u12B8-\u12BE\u12C0\u12C2-\u12C5\u12C8-\u12D6\u12D8-\u1310\u1312-\u1315\u1318-\u135A\u1380-\u138F\u1401-\u166C\u166F-\u167F\u1681-\u169A\u16A0-\u16EA\u16F1-\u16F8\u1700-\u170C\u170E-\u1711\u1720-\u1731\u1740-\u1751\u1760-\u176C\u176E-\u1770\u1780-\u17B3\u17DC\u1820-\u1842\u1844-\u1878\u1880-\u1884\u1887-\u18A8\u18AA\u18B0-\u18F5\u1900-\u191E\u1950-\u196D\u1970-\u1974\u1980-\u19AB\u19B0-\u19C9\u1A00-\u1A16\u1A20-\u1A54\u1B05-\u1B33\u1B45-\u1B4B\u1B83-\u1BA0\u1BAE\u1BAF\u1BBA-\u1BE5\u1C00-\u1C23\u1C4D-\u1C4F\u1C5A-\u1C77\u1CE9-\u1CEC\u1CEE-\u1CF1\u1CF5\u1CF6\u2135-\u2138\u2D30-\u2D67\u2D80-\u2D96\u2DA0-\u2DA6\u2DA8-\u2DAE\u2DB0-\u2DB6\u2DB8-\u2DBE\u2DC0-\u2DC6\u2DC8-\u2DCE\u2DD0-\u2DD6\u2DD8-\u2DDE\u3006\u303C\u3041-\u3096\u309F\u30A1-\u30FA\u30FF\u3105-\u312F\u3131-\u318E\u31A0-\u31BA\u31F0-\u31FF\u3400-\u4DB5\u4E00-\u9FEF\uA000-\uA014\uA016-\uA48C\uA4D0-\uA4F7\uA500-\uA60B\uA610-\uA61F\uA62A\uA62B\uA66E\uA6A0-\uA6E5\uA78F\uA7F7\uA7FB-\uA801\uA803-\uA805\uA807-\uA80A\uA80C-\uA822\uA840-\uA873\uA882-\uA8B3\uA8F2-\uA8F7\uA8FB\uA8FD\uA8FE\uA90A-\uA925\uA930-\uA946\uA960-\uA97C\uA984-\uA9B2\uA9E0-\uA9E4\uA9E7-\uA9EF\uA9FA-\uA9FE\uAA00-\uAA28\uAA40-\uAA42\uAA44-\uAA4B\uAA60-\uAA6F\uAA71-\uAA76\uAA7A\uAA7E-\uAAAF\uAAB1\uAAB5\uAAB6\uAAB9-\uAABD\uAAC0\uAAC2\uAADB\uAADC\uAAE0-\uAAEA\uAAF2\uAB01-\uAB06\uAB09-\uAB0E\uAB11-\uAB16\uAB20-\uAB26\uAB28-\uAB2E\uABC0-\uABE2\uAC00-\uD7A3\uD7B0-\uD7C6\uD7CB-\uD7FB\uF900-\uFA6D\uFA70-\uFAD9\uFB1D\uFB1F-\uFB28\uFB2A-\uFB36\uFB38-\uFB3C\uFB3E\uFB40\uFB41\uFB43\uFB44\uFB46-\uFBB1\uFBD3-\uFD3D\uFD50-\uFD8F\uFD92-\uFDC7\uFDF0-\uFDFB\uFE70-\uFE74\uFE76-\uFEFC\uFF66-\uFF6F\uFF71-\uFF9D\uFFA0-\uFFBE\uFFC2-\uFFC7\uFFCA-\uFFCF\uFFD2-\uFFD7\uFFDA-\uFFDC', + 'astral': '\uD800[\uDC00-\uDC0B\uDC0D-\uDC26\uDC28-\uDC3A\uDC3C\uDC3D\uDC3F-\uDC4D\uDC50-\uDC5D\uDC80-\uDCFA\uDE80-\uDE9C\uDEA0-\uDED0\uDF00-\uDF1F\uDF2D-\uDF40\uDF42-\uDF49\uDF50-\uDF75\uDF80-\uDF9D\uDFA0-\uDFC3\uDFC8-\uDFCF]|\uD801[\uDC50-\uDC9D\uDD00-\uDD27\uDD30-\uDD63\uDE00-\uDF36\uDF40-\uDF55\uDF60-\uDF67]|\uD802[\uDC00-\uDC05\uDC08\uDC0A-\uDC35\uDC37\uDC38\uDC3C\uDC3F-\uDC55\uDC60-\uDC76\uDC80-\uDC9E\uDCE0-\uDCF2\uDCF4\uDCF5\uDD00-\uDD15\uDD20-\uDD39\uDD80-\uDDB7\uDDBE\uDDBF\uDE00\uDE10-\uDE13\uDE15-\uDE17\uDE19-\uDE35\uDE60-\uDE7C\uDE80-\uDE9C\uDEC0-\uDEC7\uDEC9-\uDEE4\uDF00-\uDF35\uDF40-\uDF55\uDF60-\uDF72\uDF80-\uDF91]|\uD803[\uDC00-\uDC48\uDD00-\uDD23\uDF00-\uDF1C\uDF27\uDF30-\uDF45]|\uD804[\uDC03-\uDC37\uDC83-\uDCAF\uDCD0-\uDCE8\uDD03-\uDD26\uDD44\uDD50-\uDD72\uDD76\uDD83-\uDDB2\uDDC1-\uDDC4\uDDDA\uDDDC\uDE00-\uDE11\uDE13-\uDE2B\uDE80-\uDE86\uDE88\uDE8A-\uDE8D\uDE8F-\uDE9D\uDE9F-\uDEA8\uDEB0-\uDEDE\uDF05-\uDF0C\uDF0F\uDF10\uDF13-\uDF28\uDF2A-\uDF30\uDF32\uDF33\uDF35-\uDF39\uDF3D\uDF50\uDF5D-\uDF61]|\uD805[\uDC00-\uDC34\uDC47-\uDC4A\uDC80-\uDCAF\uDCC4\uDCC5\uDCC7\uDD80-\uDDAE\uDDD8-\uDDDB\uDE00-\uDE2F\uDE44\uDE80-\uDEAA\uDF00-\uDF1A]|\uD806[\uDC00-\uDC2B\uDCFF\uDE00\uDE0B-\uDE32\uDE3A\uDE50\uDE5C-\uDE83\uDE86-\uDE89\uDE9D\uDEC0-\uDEF8]|\uD807[\uDC00-\uDC08\uDC0A-\uDC2E\uDC40\uDC72-\uDC8F\uDD00-\uDD06\uDD08\uDD09\uDD0B-\uDD30\uDD46\uDD60-\uDD65\uDD67\uDD68\uDD6A-\uDD89\uDD98\uDEE0-\uDEF2]|\uD808[\uDC00-\uDF99]|\uD809[\uDC80-\uDD43]|[\uD80C\uD81C-\uD820\uD840-\uD868\uD86A-\uD86C\uD86F-\uD872\uD874-\uD879][\uDC00-\uDFFF]|\uD80D[\uDC00-\uDC2E]|\uD811[\uDC00-\uDE46]|\uD81A[\uDC00-\uDE38\uDE40-\uDE5E\uDED0-\uDEED\uDF00-\uDF2F\uDF63-\uDF77\uDF7D-\uDF8F]|\uD81B[\uDF00-\uDF44\uDF50]|\uD821[\uDC00-\uDFF1]|\uD822[\uDC00-\uDEF2]|\uD82C[\uDC00-\uDD1E\uDD70-\uDEFB]|\uD82F[\uDC00-\uDC6A\uDC70-\uDC7C\uDC80-\uDC88\uDC90-\uDC99]|\uD83A[\uDC00-\uDCC4]|\uD83B[\uDE00-\uDE03\uDE05-\uDE1F\uDE21\uDE22\uDE24\uDE27\uDE29-\uDE32\uDE34-\uDE37\uDE39\uDE3B\uDE42\uDE47\uDE49\uDE4B\uDE4D-\uDE4F\uDE51\uDE52\uDE54\uDE57\uDE59\uDE5B\uDE5D\uDE5F\uDE61\uDE62\uDE64\uDE67-\uDE6A\uDE6C-\uDE72\uDE74-\uDE77\uDE79-\uDE7C\uDE7E\uDE80-\uDE89\uDE8B-\uDE9B\uDEA1-\uDEA3\uDEA5-\uDEA9\uDEAB-\uDEBB]|\uD869[\uDC00-\uDED6\uDF00-\uDFFF]|\uD86D[\uDC00-\uDF34\uDF40-\uDFFF]|\uD86E[\uDC00-\uDC1D\uDC20-\uDFFF]|\uD873[\uDC00-\uDEA1\uDEB0-\uDFFF]|\uD87A[\uDC00-\uDFE0]|\uD87E[\uDC00-\uDE1D]' + }, + { + 'name': 'Lt', + 'alias': 'Titlecase_Letter', + 'bmp': '\u01C5\u01C8\u01CB\u01F2\u1F88-\u1F8F\u1F98-\u1F9F\u1FA8-\u1FAF\u1FBC\u1FCC\u1FFC' + }, + { + 'name': 'Lu', + 'alias': 'Uppercase_Letter', + 'bmp': 'A-Z\xC0-\xD6\xD8-\xDE\u0100\u0102\u0104\u0106\u0108\u010A\u010C\u010E\u0110\u0112\u0114\u0116\u0118\u011A\u011C\u011E\u0120\u0122\u0124\u0126\u0128\u012A\u012C\u012E\u0130\u0132\u0134\u0136\u0139\u013B\u013D\u013F\u0141\u0143\u0145\u0147\u014A\u014C\u014E\u0150\u0152\u0154\u0156\u0158\u015A\u015C\u015E\u0160\u0162\u0164\u0166\u0168\u016A\u016C\u016E\u0170\u0172\u0174\u0176\u0178\u0179\u017B\u017D\u0181\u0182\u0184\u0186\u0187\u0189-\u018B\u018E-\u0191\u0193\u0194\u0196-\u0198\u019C\u019D\u019F\u01A0\u01A2\u01A4\u01A6\u01A7\u01A9\u01AC\u01AE\u01AF\u01B1-\u01B3\u01B5\u01B7\u01B8\u01BC\u01C4\u01C7\u01CA\u01CD\u01CF\u01D1\u01D3\u01D5\u01D7\u01D9\u01DB\u01DE\u01E0\u01E2\u01E4\u01E6\u01E8\u01EA\u01EC\u01EE\u01F1\u01F4\u01F6-\u01F8\u01FA\u01FC\u01FE\u0200\u0202\u0204\u0206\u0208\u020A\u020C\u020E\u0210\u0212\u0214\u0216\u0218\u021A\u021C\u021E\u0220\u0222\u0224\u0226\u0228\u022A\u022C\u022E\u0230\u0232\u023A\u023B\u023D\u023E\u0241\u0243-\u0246\u0248\u024A\u024C\u024E\u0370\u0372\u0376\u037F\u0386\u0388-\u038A\u038C\u038E\u038F\u0391-\u03A1\u03A3-\u03AB\u03CF\u03D2-\u03D4\u03D8\u03DA\u03DC\u03DE\u03E0\u03E2\u03E4\u03E6\u03E8\u03EA\u03EC\u03EE\u03F4\u03F7\u03F9\u03FA\u03FD-\u042F\u0460\u0462\u0464\u0466\u0468\u046A\u046C\u046E\u0470\u0472\u0474\u0476\u0478\u047A\u047C\u047E\u0480\u048A\u048C\u048E\u0490\u0492\u0494\u0496\u0498\u049A\u049C\u049E\u04A0\u04A2\u04A4\u04A6\u04A8\u04AA\u04AC\u04AE\u04B0\u04B2\u04B4\u04B6\u04B8\u04BA\u04BC\u04BE\u04C0\u04C1\u04C3\u04C5\u04C7\u04C9\u04CB\u04CD\u04D0\u04D2\u04D4\u04D6\u04D8\u04DA\u04DC\u04DE\u04E0\u04E2\u04E4\u04E6\u04E8\u04EA\u04EC\u04EE\u04F0\u04F2\u04F4\u04F6\u04F8\u04FA\u04FC\u04FE\u0500\u0502\u0504\u0506\u0508\u050A\u050C\u050E\u0510\u0512\u0514\u0516\u0518\u051A\u051C\u051E\u0520\u0522\u0524\u0526\u0528\u052A\u052C\u052E\u0531-\u0556\u10A0-\u10C5\u10C7\u10CD\u13A0-\u13F5\u1C90-\u1CBA\u1CBD-\u1CBF\u1E00\u1E02\u1E04\u1E06\u1E08\u1E0A\u1E0C\u1E0E\u1E10\u1E12\u1E14\u1E16\u1E18\u1E1A\u1E1C\u1E1E\u1E20\u1E22\u1E24\u1E26\u1E28\u1E2A\u1E2C\u1E2E\u1E30\u1E32\u1E34\u1E36\u1E38\u1E3A\u1E3C\u1E3E\u1E40\u1E42\u1E44\u1E46\u1E48\u1E4A\u1E4C\u1E4E\u1E50\u1E52\u1E54\u1E56\u1E58\u1E5A\u1E5C\u1E5E\u1E60\u1E62\u1E64\u1E66\u1E68\u1E6A\u1E6C\u1E6E\u1E70\u1E72\u1E74\u1E76\u1E78\u1E7A\u1E7C\u1E7E\u1E80\u1E82\u1E84\u1E86\u1E88\u1E8A\u1E8C\u1E8E\u1E90\u1E92\u1E94\u1E9E\u1EA0\u1EA2\u1EA4\u1EA6\u1EA8\u1EAA\u1EAC\u1EAE\u1EB0\u1EB2\u1EB4\u1EB6\u1EB8\u1EBA\u1EBC\u1EBE\u1EC0\u1EC2\u1EC4\u1EC6\u1EC8\u1ECA\u1ECC\u1ECE\u1ED0\u1ED2\u1ED4\u1ED6\u1ED8\u1EDA\u1EDC\u1EDE\u1EE0\u1EE2\u1EE4\u1EE6\u1EE8\u1EEA\u1EEC\u1EEE\u1EF0\u1EF2\u1EF4\u1EF6\u1EF8\u1EFA\u1EFC\u1EFE\u1F08-\u1F0F\u1F18-\u1F1D\u1F28-\u1F2F\u1F38-\u1F3F\u1F48-\u1F4D\u1F59\u1F5B\u1F5D\u1F5F\u1F68-\u1F6F\u1FB8-\u1FBB\u1FC8-\u1FCB\u1FD8-\u1FDB\u1FE8-\u1FEC\u1FF8-\u1FFB\u2102\u2107\u210B-\u210D\u2110-\u2112\u2115\u2119-\u211D\u2124\u2126\u2128\u212A-\u212D\u2130-\u2133\u213E\u213F\u2145\u2183\u2C00-\u2C2E\u2C60\u2C62-\u2C64\u2C67\u2C69\u2C6B\u2C6D-\u2C70\u2C72\u2C75\u2C7E-\u2C80\u2C82\u2C84\u2C86\u2C88\u2C8A\u2C8C\u2C8E\u2C90\u2C92\u2C94\u2C96\u2C98\u2C9A\u2C9C\u2C9E\u2CA0\u2CA2\u2CA4\u2CA6\u2CA8\u2CAA\u2CAC\u2CAE\u2CB0\u2CB2\u2CB4\u2CB6\u2CB8\u2CBA\u2CBC\u2CBE\u2CC0\u2CC2\u2CC4\u2CC6\u2CC8\u2CCA\u2CCC\u2CCE\u2CD0\u2CD2\u2CD4\u2CD6\u2CD8\u2CDA\u2CDC\u2CDE\u2CE0\u2CE2\u2CEB\u2CED\u2CF2\uA640\uA642\uA644\uA646\uA648\uA64A\uA64C\uA64E\uA650\uA652\uA654\uA656\uA658\uA65A\uA65C\uA65E\uA660\uA662\uA664\uA666\uA668\uA66A\uA66C\uA680\uA682\uA684\uA686\uA688\uA68A\uA68C\uA68E\uA690\uA692\uA694\uA696\uA698\uA69A\uA722\uA724\uA726\uA728\uA72A\uA72C\uA72E\uA732\uA734\uA736\uA738\uA73A\uA73C\uA73E\uA740\uA742\uA744\uA746\uA748\uA74A\uA74C\uA74E\uA750\uA752\uA754\uA756\uA758\uA75A\uA75C\uA75E\uA760\uA762\uA764\uA766\uA768\uA76A\uA76C\uA76E\uA779\uA77B\uA77D\uA77E\uA780\uA782\uA784\uA786\uA78B\uA78D\uA790\uA792\uA796\uA798\uA79A\uA79C\uA79E\uA7A0\uA7A2\uA7A4\uA7A6\uA7A8\uA7AA-\uA7AE\uA7B0-\uA7B4\uA7B6\uA7B8\uFF21-\uFF3A', + 'astral': '\uD801[\uDC00-\uDC27\uDCB0-\uDCD3]|\uD803[\uDC80-\uDCB2]|\uD806[\uDCA0-\uDCBF]|\uD81B[\uDE40-\uDE5F]|\uD835[\uDC00-\uDC19\uDC34-\uDC4D\uDC68-\uDC81\uDC9C\uDC9E\uDC9F\uDCA2\uDCA5\uDCA6\uDCA9-\uDCAC\uDCAE-\uDCB5\uDCD0-\uDCE9\uDD04\uDD05\uDD07-\uDD0A\uDD0D-\uDD14\uDD16-\uDD1C\uDD38\uDD39\uDD3B-\uDD3E\uDD40-\uDD44\uDD46\uDD4A-\uDD50\uDD6C-\uDD85\uDDA0-\uDDB9\uDDD4-\uDDED\uDE08-\uDE21\uDE3C-\uDE55\uDE70-\uDE89\uDEA8-\uDEC0\uDEE2-\uDEFA\uDF1C-\uDF34\uDF56-\uDF6E\uDF90-\uDFA8\uDFCA]|\uD83A[\uDD00-\uDD21]' + }, + { + 'name': 'M', + 'alias': 'Mark', + 'bmp': '\u0300-\u036F\u0483-\u0489\u0591-\u05BD\u05BF\u05C1\u05C2\u05C4\u05C5\u05C7\u0610-\u061A\u064B-\u065F\u0670\u06D6-\u06DC\u06DF-\u06E4\u06E7\u06E8\u06EA-\u06ED\u0711\u0730-\u074A\u07A6-\u07B0\u07EB-\u07F3\u07FD\u0816-\u0819\u081B-\u0823\u0825-\u0827\u0829-\u082D\u0859-\u085B\u08D3-\u08E1\u08E3-\u0903\u093A-\u093C\u093E-\u094F\u0951-\u0957\u0962\u0963\u0981-\u0983\u09BC\u09BE-\u09C4\u09C7\u09C8\u09CB-\u09CD\u09D7\u09E2\u09E3\u09FE\u0A01-\u0A03\u0A3C\u0A3E-\u0A42\u0A47\u0A48\u0A4B-\u0A4D\u0A51\u0A70\u0A71\u0A75\u0A81-\u0A83\u0ABC\u0ABE-\u0AC5\u0AC7-\u0AC9\u0ACB-\u0ACD\u0AE2\u0AE3\u0AFA-\u0AFF\u0B01-\u0B03\u0B3C\u0B3E-\u0B44\u0B47\u0B48\u0B4B-\u0B4D\u0B56\u0B57\u0B62\u0B63\u0B82\u0BBE-\u0BC2\u0BC6-\u0BC8\u0BCA-\u0BCD\u0BD7\u0C00-\u0C04\u0C3E-\u0C44\u0C46-\u0C48\u0C4A-\u0C4D\u0C55\u0C56\u0C62\u0C63\u0C81-\u0C83\u0CBC\u0CBE-\u0CC4\u0CC6-\u0CC8\u0CCA-\u0CCD\u0CD5\u0CD6\u0CE2\u0CE3\u0D00-\u0D03\u0D3B\u0D3C\u0D3E-\u0D44\u0D46-\u0D48\u0D4A-\u0D4D\u0D57\u0D62\u0D63\u0D82\u0D83\u0DCA\u0DCF-\u0DD4\u0DD6\u0DD8-\u0DDF\u0DF2\u0DF3\u0E31\u0E34-\u0E3A\u0E47-\u0E4E\u0EB1\u0EB4-\u0EB9\u0EBB\u0EBC\u0EC8-\u0ECD\u0F18\u0F19\u0F35\u0F37\u0F39\u0F3E\u0F3F\u0F71-\u0F84\u0F86\u0F87\u0F8D-\u0F97\u0F99-\u0FBC\u0FC6\u102B-\u103E\u1056-\u1059\u105E-\u1060\u1062-\u1064\u1067-\u106D\u1071-\u1074\u1082-\u108D\u108F\u109A-\u109D\u135D-\u135F\u1712-\u1714\u1732-\u1734\u1752\u1753\u1772\u1773\u17B4-\u17D3\u17DD\u180B-\u180D\u1885\u1886\u18A9\u1920-\u192B\u1930-\u193B\u1A17-\u1A1B\u1A55-\u1A5E\u1A60-\u1A7C\u1A7F\u1AB0-\u1ABE\u1B00-\u1B04\u1B34-\u1B44\u1B6B-\u1B73\u1B80-\u1B82\u1BA1-\u1BAD\u1BE6-\u1BF3\u1C24-\u1C37\u1CD0-\u1CD2\u1CD4-\u1CE8\u1CED\u1CF2-\u1CF4\u1CF7-\u1CF9\u1DC0-\u1DF9\u1DFB-\u1DFF\u20D0-\u20F0\u2CEF-\u2CF1\u2D7F\u2DE0-\u2DFF\u302A-\u302F\u3099\u309A\uA66F-\uA672\uA674-\uA67D\uA69E\uA69F\uA6F0\uA6F1\uA802\uA806\uA80B\uA823-\uA827\uA880\uA881\uA8B4-\uA8C5\uA8E0-\uA8F1\uA8FF\uA926-\uA92D\uA947-\uA953\uA980-\uA983\uA9B3-\uA9C0\uA9E5\uAA29-\uAA36\uAA43\uAA4C\uAA4D\uAA7B-\uAA7D\uAAB0\uAAB2-\uAAB4\uAAB7\uAAB8\uAABE\uAABF\uAAC1\uAAEB-\uAAEF\uAAF5\uAAF6\uABE3-\uABEA\uABEC\uABED\uFB1E\uFE00-\uFE0F\uFE20-\uFE2F', + 'astral': '\uD800[\uDDFD\uDEE0\uDF76-\uDF7A]|\uD802[\uDE01-\uDE03\uDE05\uDE06\uDE0C-\uDE0F\uDE38-\uDE3A\uDE3F\uDEE5\uDEE6]|\uD803[\uDD24-\uDD27\uDF46-\uDF50]|\uD804[\uDC00-\uDC02\uDC38-\uDC46\uDC7F-\uDC82\uDCB0-\uDCBA\uDD00-\uDD02\uDD27-\uDD34\uDD45\uDD46\uDD73\uDD80-\uDD82\uDDB3-\uDDC0\uDDC9-\uDDCC\uDE2C-\uDE37\uDE3E\uDEDF-\uDEEA\uDF00-\uDF03\uDF3B\uDF3C\uDF3E-\uDF44\uDF47\uDF48\uDF4B-\uDF4D\uDF57\uDF62\uDF63\uDF66-\uDF6C\uDF70-\uDF74]|\uD805[\uDC35-\uDC46\uDC5E\uDCB0-\uDCC3\uDDAF-\uDDB5\uDDB8-\uDDC0\uDDDC\uDDDD\uDE30-\uDE40\uDEAB-\uDEB7\uDF1D-\uDF2B]|\uD806[\uDC2C-\uDC3A\uDE01-\uDE0A\uDE33-\uDE39\uDE3B-\uDE3E\uDE47\uDE51-\uDE5B\uDE8A-\uDE99]|\uD807[\uDC2F-\uDC36\uDC38-\uDC3F\uDC92-\uDCA7\uDCA9-\uDCB6\uDD31-\uDD36\uDD3A\uDD3C\uDD3D\uDD3F-\uDD45\uDD47\uDD8A-\uDD8E\uDD90\uDD91\uDD93-\uDD97\uDEF3-\uDEF6]|\uD81A[\uDEF0-\uDEF4\uDF30-\uDF36]|\uD81B[\uDF51-\uDF7E\uDF8F-\uDF92]|\uD82F[\uDC9D\uDC9E]|\uD834[\uDD65-\uDD69\uDD6D-\uDD72\uDD7B-\uDD82\uDD85-\uDD8B\uDDAA-\uDDAD\uDE42-\uDE44]|\uD836[\uDE00-\uDE36\uDE3B-\uDE6C\uDE75\uDE84\uDE9B-\uDE9F\uDEA1-\uDEAF]|\uD838[\uDC00-\uDC06\uDC08-\uDC18\uDC1B-\uDC21\uDC23\uDC24\uDC26-\uDC2A]|\uD83A[\uDCD0-\uDCD6\uDD44-\uDD4A]|\uDB40[\uDD00-\uDDEF]' + }, + { + 'name': 'Mc', + 'alias': 'Spacing_Mark', + 'bmp': '\u0903\u093B\u093E-\u0940\u0949-\u094C\u094E\u094F\u0982\u0983\u09BE-\u09C0\u09C7\u09C8\u09CB\u09CC\u09D7\u0A03\u0A3E-\u0A40\u0A83\u0ABE-\u0AC0\u0AC9\u0ACB\u0ACC\u0B02\u0B03\u0B3E\u0B40\u0B47\u0B48\u0B4B\u0B4C\u0B57\u0BBE\u0BBF\u0BC1\u0BC2\u0BC6-\u0BC8\u0BCA-\u0BCC\u0BD7\u0C01-\u0C03\u0C41-\u0C44\u0C82\u0C83\u0CBE\u0CC0-\u0CC4\u0CC7\u0CC8\u0CCA\u0CCB\u0CD5\u0CD6\u0D02\u0D03\u0D3E-\u0D40\u0D46-\u0D48\u0D4A-\u0D4C\u0D57\u0D82\u0D83\u0DCF-\u0DD1\u0DD8-\u0DDF\u0DF2\u0DF3\u0F3E\u0F3F\u0F7F\u102B\u102C\u1031\u1038\u103B\u103C\u1056\u1057\u1062-\u1064\u1067-\u106D\u1083\u1084\u1087-\u108C\u108F\u109A-\u109C\u17B6\u17BE-\u17C5\u17C7\u17C8\u1923-\u1926\u1929-\u192B\u1930\u1931\u1933-\u1938\u1A19\u1A1A\u1A55\u1A57\u1A61\u1A63\u1A64\u1A6D-\u1A72\u1B04\u1B35\u1B3B\u1B3D-\u1B41\u1B43\u1B44\u1B82\u1BA1\u1BA6\u1BA7\u1BAA\u1BE7\u1BEA-\u1BEC\u1BEE\u1BF2\u1BF3\u1C24-\u1C2B\u1C34\u1C35\u1CE1\u1CF2\u1CF3\u1CF7\u302E\u302F\uA823\uA824\uA827\uA880\uA881\uA8B4-\uA8C3\uA952\uA953\uA983\uA9B4\uA9B5\uA9BA\uA9BB\uA9BD-\uA9C0\uAA2F\uAA30\uAA33\uAA34\uAA4D\uAA7B\uAA7D\uAAEB\uAAEE\uAAEF\uAAF5\uABE3\uABE4\uABE6\uABE7\uABE9\uABEA\uABEC', + 'astral': '\uD804[\uDC00\uDC02\uDC82\uDCB0-\uDCB2\uDCB7\uDCB8\uDD2C\uDD45\uDD46\uDD82\uDDB3-\uDDB5\uDDBF\uDDC0\uDE2C-\uDE2E\uDE32\uDE33\uDE35\uDEE0-\uDEE2\uDF02\uDF03\uDF3E\uDF3F\uDF41-\uDF44\uDF47\uDF48\uDF4B-\uDF4D\uDF57\uDF62\uDF63]|\uD805[\uDC35-\uDC37\uDC40\uDC41\uDC45\uDCB0-\uDCB2\uDCB9\uDCBB-\uDCBE\uDCC1\uDDAF-\uDDB1\uDDB8-\uDDBB\uDDBE\uDE30-\uDE32\uDE3B\uDE3C\uDE3E\uDEAC\uDEAE\uDEAF\uDEB6\uDF20\uDF21\uDF26]|\uD806[\uDC2C-\uDC2E\uDC38\uDE39\uDE57\uDE58\uDE97]|\uD807[\uDC2F\uDC3E\uDCA9\uDCB1\uDCB4\uDD8A-\uDD8E\uDD93\uDD94\uDD96\uDEF5\uDEF6]|\uD81B[\uDF51-\uDF7E]|\uD834[\uDD65\uDD66\uDD6D-\uDD72]' + }, + { + 'name': 'Me', + 'alias': 'Enclosing_Mark', + 'bmp': '\u0488\u0489\u1ABE\u20DD-\u20E0\u20E2-\u20E4\uA670-\uA672' + }, + { + 'name': 'Mn', + 'alias': 'Nonspacing_Mark', + 'bmp': '\u0300-\u036F\u0483-\u0487\u0591-\u05BD\u05BF\u05C1\u05C2\u05C4\u05C5\u05C7\u0610-\u061A\u064B-\u065F\u0670\u06D6-\u06DC\u06DF-\u06E4\u06E7\u06E8\u06EA-\u06ED\u0711\u0730-\u074A\u07A6-\u07B0\u07EB-\u07F3\u07FD\u0816-\u0819\u081B-\u0823\u0825-\u0827\u0829-\u082D\u0859-\u085B\u08D3-\u08E1\u08E3-\u0902\u093A\u093C\u0941-\u0948\u094D\u0951-\u0957\u0962\u0963\u0981\u09BC\u09C1-\u09C4\u09CD\u09E2\u09E3\u09FE\u0A01\u0A02\u0A3C\u0A41\u0A42\u0A47\u0A48\u0A4B-\u0A4D\u0A51\u0A70\u0A71\u0A75\u0A81\u0A82\u0ABC\u0AC1-\u0AC5\u0AC7\u0AC8\u0ACD\u0AE2\u0AE3\u0AFA-\u0AFF\u0B01\u0B3C\u0B3F\u0B41-\u0B44\u0B4D\u0B56\u0B62\u0B63\u0B82\u0BC0\u0BCD\u0C00\u0C04\u0C3E-\u0C40\u0C46-\u0C48\u0C4A-\u0C4D\u0C55\u0C56\u0C62\u0C63\u0C81\u0CBC\u0CBF\u0CC6\u0CCC\u0CCD\u0CE2\u0CE3\u0D00\u0D01\u0D3B\u0D3C\u0D41-\u0D44\u0D4D\u0D62\u0D63\u0DCA\u0DD2-\u0DD4\u0DD6\u0E31\u0E34-\u0E3A\u0E47-\u0E4E\u0EB1\u0EB4-\u0EB9\u0EBB\u0EBC\u0EC8-\u0ECD\u0F18\u0F19\u0F35\u0F37\u0F39\u0F71-\u0F7E\u0F80-\u0F84\u0F86\u0F87\u0F8D-\u0F97\u0F99-\u0FBC\u0FC6\u102D-\u1030\u1032-\u1037\u1039\u103A\u103D\u103E\u1058\u1059\u105E-\u1060\u1071-\u1074\u1082\u1085\u1086\u108D\u109D\u135D-\u135F\u1712-\u1714\u1732-\u1734\u1752\u1753\u1772\u1773\u17B4\u17B5\u17B7-\u17BD\u17C6\u17C9-\u17D3\u17DD\u180B-\u180D\u1885\u1886\u18A9\u1920-\u1922\u1927\u1928\u1932\u1939-\u193B\u1A17\u1A18\u1A1B\u1A56\u1A58-\u1A5E\u1A60\u1A62\u1A65-\u1A6C\u1A73-\u1A7C\u1A7F\u1AB0-\u1ABD\u1B00-\u1B03\u1B34\u1B36-\u1B3A\u1B3C\u1B42\u1B6B-\u1B73\u1B80\u1B81\u1BA2-\u1BA5\u1BA8\u1BA9\u1BAB-\u1BAD\u1BE6\u1BE8\u1BE9\u1BED\u1BEF-\u1BF1\u1C2C-\u1C33\u1C36\u1C37\u1CD0-\u1CD2\u1CD4-\u1CE0\u1CE2-\u1CE8\u1CED\u1CF4\u1CF8\u1CF9\u1DC0-\u1DF9\u1DFB-\u1DFF\u20D0-\u20DC\u20E1\u20E5-\u20F0\u2CEF-\u2CF1\u2D7F\u2DE0-\u2DFF\u302A-\u302D\u3099\u309A\uA66F\uA674-\uA67D\uA69E\uA69F\uA6F0\uA6F1\uA802\uA806\uA80B\uA825\uA826\uA8C4\uA8C5\uA8E0-\uA8F1\uA8FF\uA926-\uA92D\uA947-\uA951\uA980-\uA982\uA9B3\uA9B6-\uA9B9\uA9BC\uA9E5\uAA29-\uAA2E\uAA31\uAA32\uAA35\uAA36\uAA43\uAA4C\uAA7C\uAAB0\uAAB2-\uAAB4\uAAB7\uAAB8\uAABE\uAABF\uAAC1\uAAEC\uAAED\uAAF6\uABE5\uABE8\uABED\uFB1E\uFE00-\uFE0F\uFE20-\uFE2F', + 'astral': '\uD800[\uDDFD\uDEE0\uDF76-\uDF7A]|\uD802[\uDE01-\uDE03\uDE05\uDE06\uDE0C-\uDE0F\uDE38-\uDE3A\uDE3F\uDEE5\uDEE6]|\uD803[\uDD24-\uDD27\uDF46-\uDF50]|\uD804[\uDC01\uDC38-\uDC46\uDC7F-\uDC81\uDCB3-\uDCB6\uDCB9\uDCBA\uDD00-\uDD02\uDD27-\uDD2B\uDD2D-\uDD34\uDD73\uDD80\uDD81\uDDB6-\uDDBE\uDDC9-\uDDCC\uDE2F-\uDE31\uDE34\uDE36\uDE37\uDE3E\uDEDF\uDEE3-\uDEEA\uDF00\uDF01\uDF3B\uDF3C\uDF40\uDF66-\uDF6C\uDF70-\uDF74]|\uD805[\uDC38-\uDC3F\uDC42-\uDC44\uDC46\uDC5E\uDCB3-\uDCB8\uDCBA\uDCBF\uDCC0\uDCC2\uDCC3\uDDB2-\uDDB5\uDDBC\uDDBD\uDDBF\uDDC0\uDDDC\uDDDD\uDE33-\uDE3A\uDE3D\uDE3F\uDE40\uDEAB\uDEAD\uDEB0-\uDEB5\uDEB7\uDF1D-\uDF1F\uDF22-\uDF25\uDF27-\uDF2B]|\uD806[\uDC2F-\uDC37\uDC39\uDC3A\uDE01-\uDE0A\uDE33-\uDE38\uDE3B-\uDE3E\uDE47\uDE51-\uDE56\uDE59-\uDE5B\uDE8A-\uDE96\uDE98\uDE99]|\uD807[\uDC30-\uDC36\uDC38-\uDC3D\uDC3F\uDC92-\uDCA7\uDCAA-\uDCB0\uDCB2\uDCB3\uDCB5\uDCB6\uDD31-\uDD36\uDD3A\uDD3C\uDD3D\uDD3F-\uDD45\uDD47\uDD90\uDD91\uDD95\uDD97\uDEF3\uDEF4]|\uD81A[\uDEF0-\uDEF4\uDF30-\uDF36]|\uD81B[\uDF8F-\uDF92]|\uD82F[\uDC9D\uDC9E]|\uD834[\uDD67-\uDD69\uDD7B-\uDD82\uDD85-\uDD8B\uDDAA-\uDDAD\uDE42-\uDE44]|\uD836[\uDE00-\uDE36\uDE3B-\uDE6C\uDE75\uDE84\uDE9B-\uDE9F\uDEA1-\uDEAF]|\uD838[\uDC00-\uDC06\uDC08-\uDC18\uDC1B-\uDC21\uDC23\uDC24\uDC26-\uDC2A]|\uD83A[\uDCD0-\uDCD6\uDD44-\uDD4A]|\uDB40[\uDD00-\uDDEF]' + }, + { + 'name': 'N', + 'alias': 'Number', + 'bmp': '0-9\xB2\xB3\xB9\xBC-\xBE\u0660-\u0669\u06F0-\u06F9\u07C0-\u07C9\u0966-\u096F\u09E6-\u09EF\u09F4-\u09F9\u0A66-\u0A6F\u0AE6-\u0AEF\u0B66-\u0B6F\u0B72-\u0B77\u0BE6-\u0BF2\u0C66-\u0C6F\u0C78-\u0C7E\u0CE6-\u0CEF\u0D58-\u0D5E\u0D66-\u0D78\u0DE6-\u0DEF\u0E50-\u0E59\u0ED0-\u0ED9\u0F20-\u0F33\u1040-\u1049\u1090-\u1099\u1369-\u137C\u16EE-\u16F0\u17E0-\u17E9\u17F0-\u17F9\u1810-\u1819\u1946-\u194F\u19D0-\u19DA\u1A80-\u1A89\u1A90-\u1A99\u1B50-\u1B59\u1BB0-\u1BB9\u1C40-\u1C49\u1C50-\u1C59\u2070\u2074-\u2079\u2080-\u2089\u2150-\u2182\u2185-\u2189\u2460-\u249B\u24EA-\u24FF\u2776-\u2793\u2CFD\u3007\u3021-\u3029\u3038-\u303A\u3192-\u3195\u3220-\u3229\u3248-\u324F\u3251-\u325F\u3280-\u3289\u32B1-\u32BF\uA620-\uA629\uA6E6-\uA6EF\uA830-\uA835\uA8D0-\uA8D9\uA900-\uA909\uA9D0-\uA9D9\uA9F0-\uA9F9\uAA50-\uAA59\uABF0-\uABF9\uFF10-\uFF19', + 'astral': '\uD800[\uDD07-\uDD33\uDD40-\uDD78\uDD8A\uDD8B\uDEE1-\uDEFB\uDF20-\uDF23\uDF41\uDF4A\uDFD1-\uDFD5]|\uD801[\uDCA0-\uDCA9]|\uD802[\uDC58-\uDC5F\uDC79-\uDC7F\uDCA7-\uDCAF\uDCFB-\uDCFF\uDD16-\uDD1B\uDDBC\uDDBD\uDDC0-\uDDCF\uDDD2-\uDDFF\uDE40-\uDE48\uDE7D\uDE7E\uDE9D-\uDE9F\uDEEB-\uDEEF\uDF58-\uDF5F\uDF78-\uDF7F\uDFA9-\uDFAF]|\uD803[\uDCFA-\uDCFF\uDD30-\uDD39\uDE60-\uDE7E\uDF1D-\uDF26\uDF51-\uDF54]|\uD804[\uDC52-\uDC6F\uDCF0-\uDCF9\uDD36-\uDD3F\uDDD0-\uDDD9\uDDE1-\uDDF4\uDEF0-\uDEF9]|\uD805[\uDC50-\uDC59\uDCD0-\uDCD9\uDE50-\uDE59\uDEC0-\uDEC9\uDF30-\uDF3B]|\uD806[\uDCE0-\uDCF2]|\uD807[\uDC50-\uDC6C\uDD50-\uDD59\uDDA0-\uDDA9]|\uD809[\uDC00-\uDC6E]|\uD81A[\uDE60-\uDE69\uDF50-\uDF59\uDF5B-\uDF61]|\uD81B[\uDE80-\uDE96]|\uD834[\uDEE0-\uDEF3\uDF60-\uDF78]|\uD835[\uDFCE-\uDFFF]|\uD83A[\uDCC7-\uDCCF\uDD50-\uDD59]|\uD83B[\uDC71-\uDCAB\uDCAD-\uDCAF\uDCB1-\uDCB4]|\uD83C[\uDD00-\uDD0C]' + }, + { + 'name': 'Nd', + 'alias': 'Decimal_Number', + 'bmp': '0-9\u0660-\u0669\u06F0-\u06F9\u07C0-\u07C9\u0966-\u096F\u09E6-\u09EF\u0A66-\u0A6F\u0AE6-\u0AEF\u0B66-\u0B6F\u0BE6-\u0BEF\u0C66-\u0C6F\u0CE6-\u0CEF\u0D66-\u0D6F\u0DE6-\u0DEF\u0E50-\u0E59\u0ED0-\u0ED9\u0F20-\u0F29\u1040-\u1049\u1090-\u1099\u17E0-\u17E9\u1810-\u1819\u1946-\u194F\u19D0-\u19D9\u1A80-\u1A89\u1A90-\u1A99\u1B50-\u1B59\u1BB0-\u1BB9\u1C40-\u1C49\u1C50-\u1C59\uA620-\uA629\uA8D0-\uA8D9\uA900-\uA909\uA9D0-\uA9D9\uA9F0-\uA9F9\uAA50-\uAA59\uABF0-\uABF9\uFF10-\uFF19', + 'astral': '\uD801[\uDCA0-\uDCA9]|\uD803[\uDD30-\uDD39]|\uD804[\uDC66-\uDC6F\uDCF0-\uDCF9\uDD36-\uDD3F\uDDD0-\uDDD9\uDEF0-\uDEF9]|\uD805[\uDC50-\uDC59\uDCD0-\uDCD9\uDE50-\uDE59\uDEC0-\uDEC9\uDF30-\uDF39]|\uD806[\uDCE0-\uDCE9]|\uD807[\uDC50-\uDC59\uDD50-\uDD59\uDDA0-\uDDA9]|\uD81A[\uDE60-\uDE69\uDF50-\uDF59]|\uD835[\uDFCE-\uDFFF]|\uD83A[\uDD50-\uDD59]' + }, + { + 'name': 'Nl', + 'alias': 'Letter_Number', + 'bmp': '\u16EE-\u16F0\u2160-\u2182\u2185-\u2188\u3007\u3021-\u3029\u3038-\u303A\uA6E6-\uA6EF', + 'astral': '\uD800[\uDD40-\uDD74\uDF41\uDF4A\uDFD1-\uDFD5]|\uD809[\uDC00-\uDC6E]' + }, + { + 'name': 'No', + 'alias': 'Other_Number', + 'bmp': '\xB2\xB3\xB9\xBC-\xBE\u09F4-\u09F9\u0B72-\u0B77\u0BF0-\u0BF2\u0C78-\u0C7E\u0D58-\u0D5E\u0D70-\u0D78\u0F2A-\u0F33\u1369-\u137C\u17F0-\u17F9\u19DA\u2070\u2074-\u2079\u2080-\u2089\u2150-\u215F\u2189\u2460-\u249B\u24EA-\u24FF\u2776-\u2793\u2CFD\u3192-\u3195\u3220-\u3229\u3248-\u324F\u3251-\u325F\u3280-\u3289\u32B1-\u32BF\uA830-\uA835', + 'astral': '\uD800[\uDD07-\uDD33\uDD75-\uDD78\uDD8A\uDD8B\uDEE1-\uDEFB\uDF20-\uDF23]|\uD802[\uDC58-\uDC5F\uDC79-\uDC7F\uDCA7-\uDCAF\uDCFB-\uDCFF\uDD16-\uDD1B\uDDBC\uDDBD\uDDC0-\uDDCF\uDDD2-\uDDFF\uDE40-\uDE48\uDE7D\uDE7E\uDE9D-\uDE9F\uDEEB-\uDEEF\uDF58-\uDF5F\uDF78-\uDF7F\uDFA9-\uDFAF]|\uD803[\uDCFA-\uDCFF\uDE60-\uDE7E\uDF1D-\uDF26\uDF51-\uDF54]|\uD804[\uDC52-\uDC65\uDDE1-\uDDF4]|\uD805[\uDF3A\uDF3B]|\uD806[\uDCEA-\uDCF2]|\uD807[\uDC5A-\uDC6C]|\uD81A[\uDF5B-\uDF61]|\uD81B[\uDE80-\uDE96]|\uD834[\uDEE0-\uDEF3\uDF60-\uDF78]|\uD83A[\uDCC7-\uDCCF]|\uD83B[\uDC71-\uDCAB\uDCAD-\uDCAF\uDCB1-\uDCB4]|\uD83C[\uDD00-\uDD0C]' + }, + { + 'name': 'P', + 'alias': 'Punctuation', + 'bmp': '!-#%-\\*,-\\/:;\\?@\\[-\\]_\\{\\}\xA1\xA7\xAB\xB6\xB7\xBB\xBF\u037E\u0387\u055A-\u055F\u0589\u058A\u05BE\u05C0\u05C3\u05C6\u05F3\u05F4\u0609\u060A\u060C\u060D\u061B\u061E\u061F\u066A-\u066D\u06D4\u0700-\u070D\u07F7-\u07F9\u0830-\u083E\u085E\u0964\u0965\u0970\u09FD\u0A76\u0AF0\u0C84\u0DF4\u0E4F\u0E5A\u0E5B\u0F04-\u0F12\u0F14\u0F3A-\u0F3D\u0F85\u0FD0-\u0FD4\u0FD9\u0FDA\u104A-\u104F\u10FB\u1360-\u1368\u1400\u166D\u166E\u169B\u169C\u16EB-\u16ED\u1735\u1736\u17D4-\u17D6\u17D8-\u17DA\u1800-\u180A\u1944\u1945\u1A1E\u1A1F\u1AA0-\u1AA6\u1AA8-\u1AAD\u1B5A-\u1B60\u1BFC-\u1BFF\u1C3B-\u1C3F\u1C7E\u1C7F\u1CC0-\u1CC7\u1CD3\u2010-\u2027\u2030-\u2043\u2045-\u2051\u2053-\u205E\u207D\u207E\u208D\u208E\u2308-\u230B\u2329\u232A\u2768-\u2775\u27C5\u27C6\u27E6-\u27EF\u2983-\u2998\u29D8-\u29DB\u29FC\u29FD\u2CF9-\u2CFC\u2CFE\u2CFF\u2D70\u2E00-\u2E2E\u2E30-\u2E4E\u3001-\u3003\u3008-\u3011\u3014-\u301F\u3030\u303D\u30A0\u30FB\uA4FE\uA4FF\uA60D-\uA60F\uA673\uA67E\uA6F2-\uA6F7\uA874-\uA877\uA8CE\uA8CF\uA8F8-\uA8FA\uA8FC\uA92E\uA92F\uA95F\uA9C1-\uA9CD\uA9DE\uA9DF\uAA5C-\uAA5F\uAADE\uAADF\uAAF0\uAAF1\uABEB\uFD3E\uFD3F\uFE10-\uFE19\uFE30-\uFE52\uFE54-\uFE61\uFE63\uFE68\uFE6A\uFE6B\uFF01-\uFF03\uFF05-\uFF0A\uFF0C-\uFF0F\uFF1A\uFF1B\uFF1F\uFF20\uFF3B-\uFF3D\uFF3F\uFF5B\uFF5D\uFF5F-\uFF65', + 'astral': '\uD800[\uDD00-\uDD02\uDF9F\uDFD0]|\uD801\uDD6F|\uD802[\uDC57\uDD1F\uDD3F\uDE50-\uDE58\uDE7F\uDEF0-\uDEF6\uDF39-\uDF3F\uDF99-\uDF9C]|\uD803[\uDF55-\uDF59]|\uD804[\uDC47-\uDC4D\uDCBB\uDCBC\uDCBE-\uDCC1\uDD40-\uDD43\uDD74\uDD75\uDDC5-\uDDC8\uDDCD\uDDDB\uDDDD-\uDDDF\uDE38-\uDE3D\uDEA9]|\uD805[\uDC4B-\uDC4F\uDC5B\uDC5D\uDCC6\uDDC1-\uDDD7\uDE41-\uDE43\uDE60-\uDE6C\uDF3C-\uDF3E]|\uD806[\uDC3B\uDE3F-\uDE46\uDE9A-\uDE9C\uDE9E-\uDEA2]|\uD807[\uDC41-\uDC45\uDC70\uDC71\uDEF7\uDEF8]|\uD809[\uDC70-\uDC74]|\uD81A[\uDE6E\uDE6F\uDEF5\uDF37-\uDF3B\uDF44]|\uD81B[\uDE97-\uDE9A]|\uD82F\uDC9F|\uD836[\uDE87-\uDE8B]|\uD83A[\uDD5E\uDD5F]' + }, + { + 'name': 'Pc', + 'alias': 'Connector_Punctuation', + 'bmp': '_\u203F\u2040\u2054\uFE33\uFE34\uFE4D-\uFE4F\uFF3F' + }, + { + 'name': 'Pd', + 'alias': 'Dash_Punctuation', + 'bmp': '\\-\u058A\u05BE\u1400\u1806\u2010-\u2015\u2E17\u2E1A\u2E3A\u2E3B\u2E40\u301C\u3030\u30A0\uFE31\uFE32\uFE58\uFE63\uFF0D' + }, + { + 'name': 'Pe', + 'alias': 'Close_Punctuation', + 'bmp': '\\)\\]\\}\u0F3B\u0F3D\u169C\u2046\u207E\u208E\u2309\u230B\u232A\u2769\u276B\u276D\u276F\u2771\u2773\u2775\u27C6\u27E7\u27E9\u27EB\u27ED\u27EF\u2984\u2986\u2988\u298A\u298C\u298E\u2990\u2992\u2994\u2996\u2998\u29D9\u29DB\u29FD\u2E23\u2E25\u2E27\u2E29\u3009\u300B\u300D\u300F\u3011\u3015\u3017\u3019\u301B\u301E\u301F\uFD3E\uFE18\uFE36\uFE38\uFE3A\uFE3C\uFE3E\uFE40\uFE42\uFE44\uFE48\uFE5A\uFE5C\uFE5E\uFF09\uFF3D\uFF5D\uFF60\uFF63' + }, + { + 'name': 'Pf', + 'alias': 'Final_Punctuation', + 'bmp': '\xBB\u2019\u201D\u203A\u2E03\u2E05\u2E0A\u2E0D\u2E1D\u2E21' + }, + { + 'name': 'Pi', + 'alias': 'Initial_Punctuation', + 'bmp': '\xAB\u2018\u201B\u201C\u201F\u2039\u2E02\u2E04\u2E09\u2E0C\u2E1C\u2E20' + }, + { + 'name': 'Po', + 'alias': 'Other_Punctuation', + 'bmp': '!-#%-\'\\*,\\.\\/:;\\?@\\\xA1\xA7\xB6\xB7\xBF\u037E\u0387\u055A-\u055F\u0589\u05C0\u05C3\u05C6\u05F3\u05F4\u0609\u060A\u060C\u060D\u061B\u061E\u061F\u066A-\u066D\u06D4\u0700-\u070D\u07F7-\u07F9\u0830-\u083E\u085E\u0964\u0965\u0970\u09FD\u0A76\u0AF0\u0C84\u0DF4\u0E4F\u0E5A\u0E5B\u0F04-\u0F12\u0F14\u0F85\u0FD0-\u0FD4\u0FD9\u0FDA\u104A-\u104F\u10FB\u1360-\u1368\u166D\u166E\u16EB-\u16ED\u1735\u1736\u17D4-\u17D6\u17D8-\u17DA\u1800-\u1805\u1807-\u180A\u1944\u1945\u1A1E\u1A1F\u1AA0-\u1AA6\u1AA8-\u1AAD\u1B5A-\u1B60\u1BFC-\u1BFF\u1C3B-\u1C3F\u1C7E\u1C7F\u1CC0-\u1CC7\u1CD3\u2016\u2017\u2020-\u2027\u2030-\u2038\u203B-\u203E\u2041-\u2043\u2047-\u2051\u2053\u2055-\u205E\u2CF9-\u2CFC\u2CFE\u2CFF\u2D70\u2E00\u2E01\u2E06-\u2E08\u2E0B\u2E0E-\u2E16\u2E18\u2E19\u2E1B\u2E1E\u2E1F\u2E2A-\u2E2E\u2E30-\u2E39\u2E3C-\u2E3F\u2E41\u2E43-\u2E4E\u3001-\u3003\u303D\u30FB\uA4FE\uA4FF\uA60D-\uA60F\uA673\uA67E\uA6F2-\uA6F7\uA874-\uA877\uA8CE\uA8CF\uA8F8-\uA8FA\uA8FC\uA92E\uA92F\uA95F\uA9C1-\uA9CD\uA9DE\uA9DF\uAA5C-\uAA5F\uAADE\uAADF\uAAF0\uAAF1\uABEB\uFE10-\uFE16\uFE19\uFE30\uFE45\uFE46\uFE49-\uFE4C\uFE50-\uFE52\uFE54-\uFE57\uFE5F-\uFE61\uFE68\uFE6A\uFE6B\uFF01-\uFF03\uFF05-\uFF07\uFF0A\uFF0C\uFF0E\uFF0F\uFF1A\uFF1B\uFF1F\uFF20\uFF3C\uFF61\uFF64\uFF65', + 'astral': '\uD800[\uDD00-\uDD02\uDF9F\uDFD0]|\uD801\uDD6F|\uD802[\uDC57\uDD1F\uDD3F\uDE50-\uDE58\uDE7F\uDEF0-\uDEF6\uDF39-\uDF3F\uDF99-\uDF9C]|\uD803[\uDF55-\uDF59]|\uD804[\uDC47-\uDC4D\uDCBB\uDCBC\uDCBE-\uDCC1\uDD40-\uDD43\uDD74\uDD75\uDDC5-\uDDC8\uDDCD\uDDDB\uDDDD-\uDDDF\uDE38-\uDE3D\uDEA9]|\uD805[\uDC4B-\uDC4F\uDC5B\uDC5D\uDCC6\uDDC1-\uDDD7\uDE41-\uDE43\uDE60-\uDE6C\uDF3C-\uDF3E]|\uD806[\uDC3B\uDE3F-\uDE46\uDE9A-\uDE9C\uDE9E-\uDEA2]|\uD807[\uDC41-\uDC45\uDC70\uDC71\uDEF7\uDEF8]|\uD809[\uDC70-\uDC74]|\uD81A[\uDE6E\uDE6F\uDEF5\uDF37-\uDF3B\uDF44]|\uD81B[\uDE97-\uDE9A]|\uD82F\uDC9F|\uD836[\uDE87-\uDE8B]|\uD83A[\uDD5E\uDD5F]' + }, + { + 'name': 'Ps', + 'alias': 'Open_Punctuation', + 'bmp': '\\(\\[\\{\u0F3A\u0F3C\u169B\u201A\u201E\u2045\u207D\u208D\u2308\u230A\u2329\u2768\u276A\u276C\u276E\u2770\u2772\u2774\u27C5\u27E6\u27E8\u27EA\u27EC\u27EE\u2983\u2985\u2987\u2989\u298B\u298D\u298F\u2991\u2993\u2995\u2997\u29D8\u29DA\u29FC\u2E22\u2E24\u2E26\u2E28\u2E42\u3008\u300A\u300C\u300E\u3010\u3014\u3016\u3018\u301A\u301D\uFD3F\uFE17\uFE35\uFE37\uFE39\uFE3B\uFE3D\uFE3F\uFE41\uFE43\uFE47\uFE59\uFE5B\uFE5D\uFF08\uFF3B\uFF5B\uFF5F\uFF62' + }, + { + 'name': 'S', + 'alias': 'Symbol', + 'bmp': '\\$\\+<->\\^`\\|~\xA2-\xA6\xA8\xA9\xAC\xAE-\xB1\xB4\xB8\xD7\xF7\u02C2-\u02C5\u02D2-\u02DF\u02E5-\u02EB\u02ED\u02EF-\u02FF\u0375\u0384\u0385\u03F6\u0482\u058D-\u058F\u0606-\u0608\u060B\u060E\u060F\u06DE\u06E9\u06FD\u06FE\u07F6\u07FE\u07FF\u09F2\u09F3\u09FA\u09FB\u0AF1\u0B70\u0BF3-\u0BFA\u0C7F\u0D4F\u0D79\u0E3F\u0F01-\u0F03\u0F13\u0F15-\u0F17\u0F1A-\u0F1F\u0F34\u0F36\u0F38\u0FBE-\u0FC5\u0FC7-\u0FCC\u0FCE\u0FCF\u0FD5-\u0FD8\u109E\u109F\u1390-\u1399\u17DB\u1940\u19DE-\u19FF\u1B61-\u1B6A\u1B74-\u1B7C\u1FBD\u1FBF-\u1FC1\u1FCD-\u1FCF\u1FDD-\u1FDF\u1FED-\u1FEF\u1FFD\u1FFE\u2044\u2052\u207A-\u207C\u208A-\u208C\u20A0-\u20BF\u2100\u2101\u2103-\u2106\u2108\u2109\u2114\u2116-\u2118\u211E-\u2123\u2125\u2127\u2129\u212E\u213A\u213B\u2140-\u2144\u214A-\u214D\u214F\u218A\u218B\u2190-\u2307\u230C-\u2328\u232B-\u2426\u2440-\u244A\u249C-\u24E9\u2500-\u2767\u2794-\u27C4\u27C7-\u27E5\u27F0-\u2982\u2999-\u29D7\u29DC-\u29FB\u29FE-\u2B73\u2B76-\u2B95\u2B98-\u2BC8\u2BCA-\u2BFE\u2CE5-\u2CEA\u2E80-\u2E99\u2E9B-\u2EF3\u2F00-\u2FD5\u2FF0-\u2FFB\u3004\u3012\u3013\u3020\u3036\u3037\u303E\u303F\u309B\u309C\u3190\u3191\u3196-\u319F\u31C0-\u31E3\u3200-\u321E\u322A-\u3247\u3250\u3260-\u327F\u328A-\u32B0\u32C0-\u32FE\u3300-\u33FF\u4DC0-\u4DFF\uA490-\uA4C6\uA700-\uA716\uA720\uA721\uA789\uA78A\uA828-\uA82B\uA836-\uA839\uAA77-\uAA79\uAB5B\uFB29\uFBB2-\uFBC1\uFDFC\uFDFD\uFE62\uFE64-\uFE66\uFE69\uFF04\uFF0B\uFF1C-\uFF1E\uFF3E\uFF40\uFF5C\uFF5E\uFFE0-\uFFE6\uFFE8-\uFFEE\uFFFC\uFFFD', + 'astral': '\uD800[\uDD37-\uDD3F\uDD79-\uDD89\uDD8C-\uDD8E\uDD90-\uDD9B\uDDA0\uDDD0-\uDDFC]|\uD802[\uDC77\uDC78\uDEC8]|\uD805\uDF3F|\uD81A[\uDF3C-\uDF3F\uDF45]|\uD82F\uDC9C|\uD834[\uDC00-\uDCF5\uDD00-\uDD26\uDD29-\uDD64\uDD6A-\uDD6C\uDD83\uDD84\uDD8C-\uDDA9\uDDAE-\uDDE8\uDE00-\uDE41\uDE45\uDF00-\uDF56]|\uD835[\uDEC1\uDEDB\uDEFB\uDF15\uDF35\uDF4F\uDF6F\uDF89\uDFA9\uDFC3]|\uD836[\uDC00-\uDDFF\uDE37-\uDE3A\uDE6D-\uDE74\uDE76-\uDE83\uDE85\uDE86]|\uD83B[\uDCAC\uDCB0\uDEF0\uDEF1]|\uD83C[\uDC00-\uDC2B\uDC30-\uDC93\uDCA0-\uDCAE\uDCB1-\uDCBF\uDCC1-\uDCCF\uDCD1-\uDCF5\uDD10-\uDD6B\uDD70-\uDDAC\uDDE6-\uDE02\uDE10-\uDE3B\uDE40-\uDE48\uDE50\uDE51\uDE60-\uDE65\uDF00-\uDFFF]|\uD83D[\uDC00-\uDED4\uDEE0-\uDEEC\uDEF0-\uDEF9\uDF00-\uDF73\uDF80-\uDFD8]|\uD83E[\uDC00-\uDC0B\uDC10-\uDC47\uDC50-\uDC59\uDC60-\uDC87\uDC90-\uDCAD\uDD00-\uDD0B\uDD10-\uDD3E\uDD40-\uDD70\uDD73-\uDD76\uDD7A\uDD7C-\uDDA2\uDDB0-\uDDB9\uDDC0-\uDDC2\uDDD0-\uDDFF\uDE60-\uDE6D]' + }, + { + 'name': 'Sc', + 'alias': 'Currency_Symbol', + 'bmp': '\\$\xA2-\xA5\u058F\u060B\u07FE\u07FF\u09F2\u09F3\u09FB\u0AF1\u0BF9\u0E3F\u17DB\u20A0-\u20BF\uA838\uFDFC\uFE69\uFF04\uFFE0\uFFE1\uFFE5\uFFE6', + 'astral': '\uD83B\uDCB0' + }, + { + 'name': 'Sk', + 'alias': 'Modifier_Symbol', + 'bmp': '\\^`\xA8\xAF\xB4\xB8\u02C2-\u02C5\u02D2-\u02DF\u02E5-\u02EB\u02ED\u02EF-\u02FF\u0375\u0384\u0385\u1FBD\u1FBF-\u1FC1\u1FCD-\u1FCF\u1FDD-\u1FDF\u1FED-\u1FEF\u1FFD\u1FFE\u309B\u309C\uA700-\uA716\uA720\uA721\uA789\uA78A\uAB5B\uFBB2-\uFBC1\uFF3E\uFF40\uFFE3', + 'astral': '\uD83C[\uDFFB-\uDFFF]' + }, + { + 'name': 'Sm', + 'alias': 'Math_Symbol', + 'bmp': '\\+<->\\|~\xAC\xB1\xD7\xF7\u03F6\u0606-\u0608\u2044\u2052\u207A-\u207C\u208A-\u208C\u2118\u2140-\u2144\u214B\u2190-\u2194\u219A\u219B\u21A0\u21A3\u21A6\u21AE\u21CE\u21CF\u21D2\u21D4\u21F4-\u22FF\u2320\u2321\u237C\u239B-\u23B3\u23DC-\u23E1\u25B7\u25C1\u25F8-\u25FF\u266F\u27C0-\u27C4\u27C7-\u27E5\u27F0-\u27FF\u2900-\u2982\u2999-\u29D7\u29DC-\u29FB\u29FE-\u2AFF\u2B30-\u2B44\u2B47-\u2B4C\uFB29\uFE62\uFE64-\uFE66\uFF0B\uFF1C-\uFF1E\uFF5C\uFF5E\uFFE2\uFFE9-\uFFEC', + 'astral': '\uD835[\uDEC1\uDEDB\uDEFB\uDF15\uDF35\uDF4F\uDF6F\uDF89\uDFA9\uDFC3]|\uD83B[\uDEF0\uDEF1]' + }, + { + 'name': 'So', + 'alias': 'Other_Symbol', + 'bmp': '\xA6\xA9\xAE\xB0\u0482\u058D\u058E\u060E\u060F\u06DE\u06E9\u06FD\u06FE\u07F6\u09FA\u0B70\u0BF3-\u0BF8\u0BFA\u0C7F\u0D4F\u0D79\u0F01-\u0F03\u0F13\u0F15-\u0F17\u0F1A-\u0F1F\u0F34\u0F36\u0F38\u0FBE-\u0FC5\u0FC7-\u0FCC\u0FCE\u0FCF\u0FD5-\u0FD8\u109E\u109F\u1390-\u1399\u1940\u19DE-\u19FF\u1B61-\u1B6A\u1B74-\u1B7C\u2100\u2101\u2103-\u2106\u2108\u2109\u2114\u2116\u2117\u211E-\u2123\u2125\u2127\u2129\u212E\u213A\u213B\u214A\u214C\u214D\u214F\u218A\u218B\u2195-\u2199\u219C-\u219F\u21A1\u21A2\u21A4\u21A5\u21A7-\u21AD\u21AF-\u21CD\u21D0\u21D1\u21D3\u21D5-\u21F3\u2300-\u2307\u230C-\u231F\u2322-\u2328\u232B-\u237B\u237D-\u239A\u23B4-\u23DB\u23E2-\u2426\u2440-\u244A\u249C-\u24E9\u2500-\u25B6\u25B8-\u25C0\u25C2-\u25F7\u2600-\u266E\u2670-\u2767\u2794-\u27BF\u2800-\u28FF\u2B00-\u2B2F\u2B45\u2B46\u2B4D-\u2B73\u2B76-\u2B95\u2B98-\u2BC8\u2BCA-\u2BFE\u2CE5-\u2CEA\u2E80-\u2E99\u2E9B-\u2EF3\u2F00-\u2FD5\u2FF0-\u2FFB\u3004\u3012\u3013\u3020\u3036\u3037\u303E\u303F\u3190\u3191\u3196-\u319F\u31C0-\u31E3\u3200-\u321E\u322A-\u3247\u3250\u3260-\u327F\u328A-\u32B0\u32C0-\u32FE\u3300-\u33FF\u4DC0-\u4DFF\uA490-\uA4C6\uA828-\uA82B\uA836\uA837\uA839\uAA77-\uAA79\uFDFD\uFFE4\uFFE8\uFFED\uFFEE\uFFFC\uFFFD', + 'astral': '\uD800[\uDD37-\uDD3F\uDD79-\uDD89\uDD8C-\uDD8E\uDD90-\uDD9B\uDDA0\uDDD0-\uDDFC]|\uD802[\uDC77\uDC78\uDEC8]|\uD805\uDF3F|\uD81A[\uDF3C-\uDF3F\uDF45]|\uD82F\uDC9C|\uD834[\uDC00-\uDCF5\uDD00-\uDD26\uDD29-\uDD64\uDD6A-\uDD6C\uDD83\uDD84\uDD8C-\uDDA9\uDDAE-\uDDE8\uDE00-\uDE41\uDE45\uDF00-\uDF56]|\uD836[\uDC00-\uDDFF\uDE37-\uDE3A\uDE6D-\uDE74\uDE76-\uDE83\uDE85\uDE86]|\uD83B\uDCAC|\uD83C[\uDC00-\uDC2B\uDC30-\uDC93\uDCA0-\uDCAE\uDCB1-\uDCBF\uDCC1-\uDCCF\uDCD1-\uDCF5\uDD10-\uDD6B\uDD70-\uDDAC\uDDE6-\uDE02\uDE10-\uDE3B\uDE40-\uDE48\uDE50\uDE51\uDE60-\uDE65\uDF00-\uDFFA]|\uD83D[\uDC00-\uDED4\uDEE0-\uDEEC\uDEF0-\uDEF9\uDF00-\uDF73\uDF80-\uDFD8]|\uD83E[\uDC00-\uDC0B\uDC10-\uDC47\uDC50-\uDC59\uDC60-\uDC87\uDC90-\uDCAD\uDD00-\uDD0B\uDD10-\uDD3E\uDD40-\uDD70\uDD73-\uDD76\uDD7A\uDD7C-\uDDA2\uDDB0-\uDDB9\uDDC0-\uDDC2\uDDD0-\uDDFF\uDE60-\uDE6D]' + }, + { + 'name': 'Z', + 'alias': 'Separator', + 'bmp': ' \xA0\u1680\u2000-\u200A\u2028\u2029\u202F\u205F\u3000' + }, + { + 'name': 'Zl', + 'alias': 'Line_Separator', + 'bmp': '\u2028' + }, + { + 'name': 'Zp', + 'alias': 'Paragraph_Separator', + 'bmp': '\u2029' + }, + { + 'name': 'Zs', + 'alias': 'Space_Separator', + 'bmp': ' \xA0\u1680\u2000-\u200A\u202F\u205F\u3000' + } +]; + +var unicodeCategories = createCommonjsModule(function (module, exports) { +"use strict"; + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.default = void 0; + +var _categories = _interopRequireDefault(categories); + +function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } + +/*! + * XRegExp Unicode Categories 4.2.0 + * + * Steven Levithan (c) 2010-present MIT License + * Unicode data by Mathias Bynens + */ +var _default = function _default(XRegExp) { + /** + * Adds support for Unicode's general categories. E.g., `\p{Lu}` or `\p{Uppercase Letter}`. See + * category descriptions in UAX #44 . Token + * names are case insensitive, and any spaces, hyphens, and underscores are ignored. + * + * Uses Unicode 11.0.0. + * + * @requires XRegExp, Unicode Base + */ + if (!XRegExp.addUnicodeData) { + throw new ReferenceError('Unicode Base must be loaded before Unicode Categories'); + } + + XRegExp.addUnicodeData(_categories.default); +}; + +exports.default = _default; +module.exports = exports["default"]; +}); + +unwrapExports(unicodeCategories); + +var properties = [ + { + 'name': 'ASCII', + 'bmp': '\0-\x7F' + }, + { + 'name': 'Alphabetic', + 'bmp': 'A-Za-z\xAA\xB5\xBA\xC0-\xD6\xD8-\xF6\xF8-\u02C1\u02C6-\u02D1\u02E0-\u02E4\u02EC\u02EE\u0345\u0370-\u0374\u0376\u0377\u037A-\u037D\u037F\u0386\u0388-\u038A\u038C\u038E-\u03A1\u03A3-\u03F5\u03F7-\u0481\u048A-\u052F\u0531-\u0556\u0559\u0560-\u0588\u05B0-\u05BD\u05BF\u05C1\u05C2\u05C4\u05C5\u05C7\u05D0-\u05EA\u05EF-\u05F2\u0610-\u061A\u0620-\u0657\u0659-\u065F\u066E-\u06D3\u06D5-\u06DC\u06E1-\u06E8\u06ED-\u06EF\u06FA-\u06FC\u06FF\u0710-\u073F\u074D-\u07B1\u07CA-\u07EA\u07F4\u07F5\u07FA\u0800-\u0817\u081A-\u082C\u0840-\u0858\u0860-\u086A\u08A0-\u08B4\u08B6-\u08BD\u08D4-\u08DF\u08E3-\u08E9\u08F0-\u093B\u093D-\u094C\u094E-\u0950\u0955-\u0963\u0971-\u0983\u0985-\u098C\u098F\u0990\u0993-\u09A8\u09AA-\u09B0\u09B2\u09B6-\u09B9\u09BD-\u09C4\u09C7\u09C8\u09CB\u09CC\u09CE\u09D7\u09DC\u09DD\u09DF-\u09E3\u09F0\u09F1\u09FC\u0A01-\u0A03\u0A05-\u0A0A\u0A0F\u0A10\u0A13-\u0A28\u0A2A-\u0A30\u0A32\u0A33\u0A35\u0A36\u0A38\u0A39\u0A3E-\u0A42\u0A47\u0A48\u0A4B\u0A4C\u0A51\u0A59-\u0A5C\u0A5E\u0A70-\u0A75\u0A81-\u0A83\u0A85-\u0A8D\u0A8F-\u0A91\u0A93-\u0AA8\u0AAA-\u0AB0\u0AB2\u0AB3\u0AB5-\u0AB9\u0ABD-\u0AC5\u0AC7-\u0AC9\u0ACB\u0ACC\u0AD0\u0AE0-\u0AE3\u0AF9-\u0AFC\u0B01-\u0B03\u0B05-\u0B0C\u0B0F\u0B10\u0B13-\u0B28\u0B2A-\u0B30\u0B32\u0B33\u0B35-\u0B39\u0B3D-\u0B44\u0B47\u0B48\u0B4B\u0B4C\u0B56\u0B57\u0B5C\u0B5D\u0B5F-\u0B63\u0B71\u0B82\u0B83\u0B85-\u0B8A\u0B8E-\u0B90\u0B92-\u0B95\u0B99\u0B9A\u0B9C\u0B9E\u0B9F\u0BA3\u0BA4\u0BA8-\u0BAA\u0BAE-\u0BB9\u0BBE-\u0BC2\u0BC6-\u0BC8\u0BCA-\u0BCC\u0BD0\u0BD7\u0C00-\u0C03\u0C05-\u0C0C\u0C0E-\u0C10\u0C12-\u0C28\u0C2A-\u0C39\u0C3D-\u0C44\u0C46-\u0C48\u0C4A-\u0C4C\u0C55\u0C56\u0C58-\u0C5A\u0C60-\u0C63\u0C80-\u0C83\u0C85-\u0C8C\u0C8E-\u0C90\u0C92-\u0CA8\u0CAA-\u0CB3\u0CB5-\u0CB9\u0CBD-\u0CC4\u0CC6-\u0CC8\u0CCA-\u0CCC\u0CD5\u0CD6\u0CDE\u0CE0-\u0CE3\u0CF1\u0CF2\u0D00-\u0D03\u0D05-\u0D0C\u0D0E-\u0D10\u0D12-\u0D3A\u0D3D-\u0D44\u0D46-\u0D48\u0D4A-\u0D4C\u0D4E\u0D54-\u0D57\u0D5F-\u0D63\u0D7A-\u0D7F\u0D82\u0D83\u0D85-\u0D96\u0D9A-\u0DB1\u0DB3-\u0DBB\u0DBD\u0DC0-\u0DC6\u0DCF-\u0DD4\u0DD6\u0DD8-\u0DDF\u0DF2\u0DF3\u0E01-\u0E3A\u0E40-\u0E46\u0E4D\u0E81\u0E82\u0E84\u0E87\u0E88\u0E8A\u0E8D\u0E94-\u0E97\u0E99-\u0E9F\u0EA1-\u0EA3\u0EA5\u0EA7\u0EAA\u0EAB\u0EAD-\u0EB9\u0EBB-\u0EBD\u0EC0-\u0EC4\u0EC6\u0ECD\u0EDC-\u0EDF\u0F00\u0F40-\u0F47\u0F49-\u0F6C\u0F71-\u0F81\u0F88-\u0F97\u0F99-\u0FBC\u1000-\u1036\u1038\u103B-\u103F\u1050-\u1062\u1065-\u1068\u106E-\u1086\u108E\u109C\u109D\u10A0-\u10C5\u10C7\u10CD\u10D0-\u10FA\u10FC-\u1248\u124A-\u124D\u1250-\u1256\u1258\u125A-\u125D\u1260-\u1288\u128A-\u128D\u1290-\u12B0\u12B2-\u12B5\u12B8-\u12BE\u12C0\u12C2-\u12C5\u12C8-\u12D6\u12D8-\u1310\u1312-\u1315\u1318-\u135A\u135F\u1380-\u138F\u13A0-\u13F5\u13F8-\u13FD\u1401-\u166C\u166F-\u167F\u1681-\u169A\u16A0-\u16EA\u16EE-\u16F8\u1700-\u170C\u170E-\u1713\u1720-\u1733\u1740-\u1753\u1760-\u176C\u176E-\u1770\u1772\u1773\u1780-\u17B3\u17B6-\u17C8\u17D7\u17DC\u1820-\u1878\u1880-\u18AA\u18B0-\u18F5\u1900-\u191E\u1920-\u192B\u1930-\u1938\u1950-\u196D\u1970-\u1974\u1980-\u19AB\u19B0-\u19C9\u1A00-\u1A1B\u1A20-\u1A5E\u1A61-\u1A74\u1AA7\u1B00-\u1B33\u1B35-\u1B43\u1B45-\u1B4B\u1B80-\u1BA9\u1BAC-\u1BAF\u1BBA-\u1BE5\u1BE7-\u1BF1\u1C00-\u1C35\u1C4D-\u1C4F\u1C5A-\u1C7D\u1C80-\u1C88\u1C90-\u1CBA\u1CBD-\u1CBF\u1CE9-\u1CEC\u1CEE-\u1CF3\u1CF5\u1CF6\u1D00-\u1DBF\u1DE7-\u1DF4\u1E00-\u1F15\u1F18-\u1F1D\u1F20-\u1F45\u1F48-\u1F4D\u1F50-\u1F57\u1F59\u1F5B\u1F5D\u1F5F-\u1F7D\u1F80-\u1FB4\u1FB6-\u1FBC\u1FBE\u1FC2-\u1FC4\u1FC6-\u1FCC\u1FD0-\u1FD3\u1FD6-\u1FDB\u1FE0-\u1FEC\u1FF2-\u1FF4\u1FF6-\u1FFC\u2071\u207F\u2090-\u209C\u2102\u2107\u210A-\u2113\u2115\u2119-\u211D\u2124\u2126\u2128\u212A-\u212D\u212F-\u2139\u213C-\u213F\u2145-\u2149\u214E\u2160-\u2188\u24B6-\u24E9\u2C00-\u2C2E\u2C30-\u2C5E\u2C60-\u2CE4\u2CEB-\u2CEE\u2CF2\u2CF3\u2D00-\u2D25\u2D27\u2D2D\u2D30-\u2D67\u2D6F\u2D80-\u2D96\u2DA0-\u2DA6\u2DA8-\u2DAE\u2DB0-\u2DB6\u2DB8-\u2DBE\u2DC0-\u2DC6\u2DC8-\u2DCE\u2DD0-\u2DD6\u2DD8-\u2DDE\u2DE0-\u2DFF\u2E2F\u3005-\u3007\u3021-\u3029\u3031-\u3035\u3038-\u303C\u3041-\u3096\u309D-\u309F\u30A1-\u30FA\u30FC-\u30FF\u3105-\u312F\u3131-\u318E\u31A0-\u31BA\u31F0-\u31FF\u3400-\u4DB5\u4E00-\u9FEF\uA000-\uA48C\uA4D0-\uA4FD\uA500-\uA60C\uA610-\uA61F\uA62A\uA62B\uA640-\uA66E\uA674-\uA67B\uA67F-\uA6EF\uA717-\uA71F\uA722-\uA788\uA78B-\uA7B9\uA7F7-\uA801\uA803-\uA805\uA807-\uA80A\uA80C-\uA827\uA840-\uA873\uA880-\uA8C3\uA8C5\uA8F2-\uA8F7\uA8FB\uA8FD\uA8FE\uA90A-\uA92A\uA930-\uA952\uA960-\uA97C\uA980-\uA9B2\uA9B4-\uA9BF\uA9CF\uA9E0-\uA9E4\uA9E6-\uA9EF\uA9FA-\uA9FE\uAA00-\uAA36\uAA40-\uAA4D\uAA60-\uAA76\uAA7A\uAA7E-\uAABE\uAAC0\uAAC2\uAADB-\uAADD\uAAE0-\uAAEF\uAAF2-\uAAF5\uAB01-\uAB06\uAB09-\uAB0E\uAB11-\uAB16\uAB20-\uAB26\uAB28-\uAB2E\uAB30-\uAB5A\uAB5C-\uAB65\uAB70-\uABEA\uAC00-\uD7A3\uD7B0-\uD7C6\uD7CB-\uD7FB\uF900-\uFA6D\uFA70-\uFAD9\uFB00-\uFB06\uFB13-\uFB17\uFB1D-\uFB28\uFB2A-\uFB36\uFB38-\uFB3C\uFB3E\uFB40\uFB41\uFB43\uFB44\uFB46-\uFBB1\uFBD3-\uFD3D\uFD50-\uFD8F\uFD92-\uFDC7\uFDF0-\uFDFB\uFE70-\uFE74\uFE76-\uFEFC\uFF21-\uFF3A\uFF41-\uFF5A\uFF66-\uFFBE\uFFC2-\uFFC7\uFFCA-\uFFCF\uFFD2-\uFFD7\uFFDA-\uFFDC', + 'astral': '\uD800[\uDC00-\uDC0B\uDC0D-\uDC26\uDC28-\uDC3A\uDC3C\uDC3D\uDC3F-\uDC4D\uDC50-\uDC5D\uDC80-\uDCFA\uDD40-\uDD74\uDE80-\uDE9C\uDEA0-\uDED0\uDF00-\uDF1F\uDF2D-\uDF4A\uDF50-\uDF7A\uDF80-\uDF9D\uDFA0-\uDFC3\uDFC8-\uDFCF\uDFD1-\uDFD5]|\uD801[\uDC00-\uDC9D\uDCB0-\uDCD3\uDCD8-\uDCFB\uDD00-\uDD27\uDD30-\uDD63\uDE00-\uDF36\uDF40-\uDF55\uDF60-\uDF67]|\uD802[\uDC00-\uDC05\uDC08\uDC0A-\uDC35\uDC37\uDC38\uDC3C\uDC3F-\uDC55\uDC60-\uDC76\uDC80-\uDC9E\uDCE0-\uDCF2\uDCF4\uDCF5\uDD00-\uDD15\uDD20-\uDD39\uDD80-\uDDB7\uDDBE\uDDBF\uDE00-\uDE03\uDE05\uDE06\uDE0C-\uDE13\uDE15-\uDE17\uDE19-\uDE35\uDE60-\uDE7C\uDE80-\uDE9C\uDEC0-\uDEC7\uDEC9-\uDEE4\uDF00-\uDF35\uDF40-\uDF55\uDF60-\uDF72\uDF80-\uDF91]|\uD803[\uDC00-\uDC48\uDC80-\uDCB2\uDCC0-\uDCF2\uDD00-\uDD27\uDF00-\uDF1C\uDF27\uDF30-\uDF45]|\uD804[\uDC00-\uDC45\uDC82-\uDCB8\uDCD0-\uDCE8\uDD00-\uDD32\uDD44-\uDD46\uDD50-\uDD72\uDD76\uDD80-\uDDBF\uDDC1-\uDDC4\uDDDA\uDDDC\uDE00-\uDE11\uDE13-\uDE34\uDE37\uDE3E\uDE80-\uDE86\uDE88\uDE8A-\uDE8D\uDE8F-\uDE9D\uDE9F-\uDEA8\uDEB0-\uDEE8\uDF00-\uDF03\uDF05-\uDF0C\uDF0F\uDF10\uDF13-\uDF28\uDF2A-\uDF30\uDF32\uDF33\uDF35-\uDF39\uDF3D-\uDF44\uDF47\uDF48\uDF4B\uDF4C\uDF50\uDF57\uDF5D-\uDF63]|\uD805[\uDC00-\uDC41\uDC43-\uDC45\uDC47-\uDC4A\uDC80-\uDCC1\uDCC4\uDCC5\uDCC7\uDD80-\uDDB5\uDDB8-\uDDBE\uDDD8-\uDDDD\uDE00-\uDE3E\uDE40\uDE44\uDE80-\uDEB5\uDF00-\uDF1A\uDF1D-\uDF2A]|\uD806[\uDC00-\uDC38\uDCA0-\uDCDF\uDCFF\uDE00-\uDE32\uDE35-\uDE3E\uDE50-\uDE83\uDE86-\uDE97\uDE9D\uDEC0-\uDEF8]|\uD807[\uDC00-\uDC08\uDC0A-\uDC36\uDC38-\uDC3E\uDC40\uDC72-\uDC8F\uDC92-\uDCA7\uDCA9-\uDCB6\uDD00-\uDD06\uDD08\uDD09\uDD0B-\uDD36\uDD3A\uDD3C\uDD3D\uDD3F-\uDD41\uDD43\uDD46\uDD47\uDD60-\uDD65\uDD67\uDD68\uDD6A-\uDD8E\uDD90\uDD91\uDD93-\uDD96\uDD98\uDEE0-\uDEF6]|\uD808[\uDC00-\uDF99]|\uD809[\uDC00-\uDC6E\uDC80-\uDD43]|[\uD80C\uD81C-\uD820\uD840-\uD868\uD86A-\uD86C\uD86F-\uD872\uD874-\uD879][\uDC00-\uDFFF]|\uD80D[\uDC00-\uDC2E]|\uD811[\uDC00-\uDE46]|\uD81A[\uDC00-\uDE38\uDE40-\uDE5E\uDED0-\uDEED\uDF00-\uDF36\uDF40-\uDF43\uDF63-\uDF77\uDF7D-\uDF8F]|\uD81B[\uDE40-\uDE7F\uDF00-\uDF44\uDF50-\uDF7E\uDF93-\uDF9F\uDFE0\uDFE1]|\uD821[\uDC00-\uDFF1]|\uD822[\uDC00-\uDEF2]|\uD82C[\uDC00-\uDD1E\uDD70-\uDEFB]|\uD82F[\uDC00-\uDC6A\uDC70-\uDC7C\uDC80-\uDC88\uDC90-\uDC99\uDC9E]|\uD835[\uDC00-\uDC54\uDC56-\uDC9C\uDC9E\uDC9F\uDCA2\uDCA5\uDCA6\uDCA9-\uDCAC\uDCAE-\uDCB9\uDCBB\uDCBD-\uDCC3\uDCC5-\uDD05\uDD07-\uDD0A\uDD0D-\uDD14\uDD16-\uDD1C\uDD1E-\uDD39\uDD3B-\uDD3E\uDD40-\uDD44\uDD46\uDD4A-\uDD50\uDD52-\uDEA5\uDEA8-\uDEC0\uDEC2-\uDEDA\uDEDC-\uDEFA\uDEFC-\uDF14\uDF16-\uDF34\uDF36-\uDF4E\uDF50-\uDF6E\uDF70-\uDF88\uDF8A-\uDFA8\uDFAA-\uDFC2\uDFC4-\uDFCB]|\uD838[\uDC00-\uDC06\uDC08-\uDC18\uDC1B-\uDC21\uDC23\uDC24\uDC26-\uDC2A]|\uD83A[\uDC00-\uDCC4\uDD00-\uDD43\uDD47]|\uD83B[\uDE00-\uDE03\uDE05-\uDE1F\uDE21\uDE22\uDE24\uDE27\uDE29-\uDE32\uDE34-\uDE37\uDE39\uDE3B\uDE42\uDE47\uDE49\uDE4B\uDE4D-\uDE4F\uDE51\uDE52\uDE54\uDE57\uDE59\uDE5B\uDE5D\uDE5F\uDE61\uDE62\uDE64\uDE67-\uDE6A\uDE6C-\uDE72\uDE74-\uDE77\uDE79-\uDE7C\uDE7E\uDE80-\uDE89\uDE8B-\uDE9B\uDEA1-\uDEA3\uDEA5-\uDEA9\uDEAB-\uDEBB]|\uD83C[\uDD30-\uDD49\uDD50-\uDD69\uDD70-\uDD89]|\uD869[\uDC00-\uDED6\uDF00-\uDFFF]|\uD86D[\uDC00-\uDF34\uDF40-\uDFFF]|\uD86E[\uDC00-\uDC1D\uDC20-\uDFFF]|\uD873[\uDC00-\uDEA1\uDEB0-\uDFFF]|\uD87A[\uDC00-\uDFE0]|\uD87E[\uDC00-\uDE1D]' + }, + { + 'name': 'Any', + 'isBmpLast': true, + 'bmp': '\0-\uFFFF', + 'astral': '[\uD800-\uDBFF][\uDC00-\uDFFF]' + }, + { + 'name': 'Default_Ignorable_Code_Point', + 'bmp': '\xAD\u034F\u061C\u115F\u1160\u17B4\u17B5\u180B-\u180E\u200B-\u200F\u202A-\u202E\u2060-\u206F\u3164\uFE00-\uFE0F\uFEFF\uFFA0\uFFF0-\uFFF8', + 'astral': '\uD82F[\uDCA0-\uDCA3]|\uD834[\uDD73-\uDD7A]|[\uDB40-\uDB43][\uDC00-\uDFFF]' + }, + { + 'name': 'Lowercase', + 'bmp': 'a-z\xAA\xB5\xBA\xDF-\xF6\xF8-\xFF\u0101\u0103\u0105\u0107\u0109\u010B\u010D\u010F\u0111\u0113\u0115\u0117\u0119\u011B\u011D\u011F\u0121\u0123\u0125\u0127\u0129\u012B\u012D\u012F\u0131\u0133\u0135\u0137\u0138\u013A\u013C\u013E\u0140\u0142\u0144\u0146\u0148\u0149\u014B\u014D\u014F\u0151\u0153\u0155\u0157\u0159\u015B\u015D\u015F\u0161\u0163\u0165\u0167\u0169\u016B\u016D\u016F\u0171\u0173\u0175\u0177\u017A\u017C\u017E-\u0180\u0183\u0185\u0188\u018C\u018D\u0192\u0195\u0199-\u019B\u019E\u01A1\u01A3\u01A5\u01A8\u01AA\u01AB\u01AD\u01B0\u01B4\u01B6\u01B9\u01BA\u01BD-\u01BF\u01C6\u01C9\u01CC\u01CE\u01D0\u01D2\u01D4\u01D6\u01D8\u01DA\u01DC\u01DD\u01DF\u01E1\u01E3\u01E5\u01E7\u01E9\u01EB\u01ED\u01EF\u01F0\u01F3\u01F5\u01F9\u01FB\u01FD\u01FF\u0201\u0203\u0205\u0207\u0209\u020B\u020D\u020F\u0211\u0213\u0215\u0217\u0219\u021B\u021D\u021F\u0221\u0223\u0225\u0227\u0229\u022B\u022D\u022F\u0231\u0233-\u0239\u023C\u023F\u0240\u0242\u0247\u0249\u024B\u024D\u024F-\u0293\u0295-\u02B8\u02C0\u02C1\u02E0-\u02E4\u0345\u0371\u0373\u0377\u037A-\u037D\u0390\u03AC-\u03CE\u03D0\u03D1\u03D5-\u03D7\u03D9\u03DB\u03DD\u03DF\u03E1\u03E3\u03E5\u03E7\u03E9\u03EB\u03ED\u03EF-\u03F3\u03F5\u03F8\u03FB\u03FC\u0430-\u045F\u0461\u0463\u0465\u0467\u0469\u046B\u046D\u046F\u0471\u0473\u0475\u0477\u0479\u047B\u047D\u047F\u0481\u048B\u048D\u048F\u0491\u0493\u0495\u0497\u0499\u049B\u049D\u049F\u04A1\u04A3\u04A5\u04A7\u04A9\u04AB\u04AD\u04AF\u04B1\u04B3\u04B5\u04B7\u04B9\u04BB\u04BD\u04BF\u04C2\u04C4\u04C6\u04C8\u04CA\u04CC\u04CE\u04CF\u04D1\u04D3\u04D5\u04D7\u04D9\u04DB\u04DD\u04DF\u04E1\u04E3\u04E5\u04E7\u04E9\u04EB\u04ED\u04EF\u04F1\u04F3\u04F5\u04F7\u04F9\u04FB\u04FD\u04FF\u0501\u0503\u0505\u0507\u0509\u050B\u050D\u050F\u0511\u0513\u0515\u0517\u0519\u051B\u051D\u051F\u0521\u0523\u0525\u0527\u0529\u052B\u052D\u052F\u0560-\u0588\u10D0-\u10FA\u10FD-\u10FF\u13F8-\u13FD\u1C80-\u1C88\u1D00-\u1DBF\u1E01\u1E03\u1E05\u1E07\u1E09\u1E0B\u1E0D\u1E0F\u1E11\u1E13\u1E15\u1E17\u1E19\u1E1B\u1E1D\u1E1F\u1E21\u1E23\u1E25\u1E27\u1E29\u1E2B\u1E2D\u1E2F\u1E31\u1E33\u1E35\u1E37\u1E39\u1E3B\u1E3D\u1E3F\u1E41\u1E43\u1E45\u1E47\u1E49\u1E4B\u1E4D\u1E4F\u1E51\u1E53\u1E55\u1E57\u1E59\u1E5B\u1E5D\u1E5F\u1E61\u1E63\u1E65\u1E67\u1E69\u1E6B\u1E6D\u1E6F\u1E71\u1E73\u1E75\u1E77\u1E79\u1E7B\u1E7D\u1E7F\u1E81\u1E83\u1E85\u1E87\u1E89\u1E8B\u1E8D\u1E8F\u1E91\u1E93\u1E95-\u1E9D\u1E9F\u1EA1\u1EA3\u1EA5\u1EA7\u1EA9\u1EAB\u1EAD\u1EAF\u1EB1\u1EB3\u1EB5\u1EB7\u1EB9\u1EBB\u1EBD\u1EBF\u1EC1\u1EC3\u1EC5\u1EC7\u1EC9\u1ECB\u1ECD\u1ECF\u1ED1\u1ED3\u1ED5\u1ED7\u1ED9\u1EDB\u1EDD\u1EDF\u1EE1\u1EE3\u1EE5\u1EE7\u1EE9\u1EEB\u1EED\u1EEF\u1EF1\u1EF3\u1EF5\u1EF7\u1EF9\u1EFB\u1EFD\u1EFF-\u1F07\u1F10-\u1F15\u1F20-\u1F27\u1F30-\u1F37\u1F40-\u1F45\u1F50-\u1F57\u1F60-\u1F67\u1F70-\u1F7D\u1F80-\u1F87\u1F90-\u1F97\u1FA0-\u1FA7\u1FB0-\u1FB4\u1FB6\u1FB7\u1FBE\u1FC2-\u1FC4\u1FC6\u1FC7\u1FD0-\u1FD3\u1FD6\u1FD7\u1FE0-\u1FE7\u1FF2-\u1FF4\u1FF6\u1FF7\u2071\u207F\u2090-\u209C\u210A\u210E\u210F\u2113\u212F\u2134\u2139\u213C\u213D\u2146-\u2149\u214E\u2170-\u217F\u2184\u24D0-\u24E9\u2C30-\u2C5E\u2C61\u2C65\u2C66\u2C68\u2C6A\u2C6C\u2C71\u2C73\u2C74\u2C76-\u2C7D\u2C81\u2C83\u2C85\u2C87\u2C89\u2C8B\u2C8D\u2C8F\u2C91\u2C93\u2C95\u2C97\u2C99\u2C9B\u2C9D\u2C9F\u2CA1\u2CA3\u2CA5\u2CA7\u2CA9\u2CAB\u2CAD\u2CAF\u2CB1\u2CB3\u2CB5\u2CB7\u2CB9\u2CBB\u2CBD\u2CBF\u2CC1\u2CC3\u2CC5\u2CC7\u2CC9\u2CCB\u2CCD\u2CCF\u2CD1\u2CD3\u2CD5\u2CD7\u2CD9\u2CDB\u2CDD\u2CDF\u2CE1\u2CE3\u2CE4\u2CEC\u2CEE\u2CF3\u2D00-\u2D25\u2D27\u2D2D\uA641\uA643\uA645\uA647\uA649\uA64B\uA64D\uA64F\uA651\uA653\uA655\uA657\uA659\uA65B\uA65D\uA65F\uA661\uA663\uA665\uA667\uA669\uA66B\uA66D\uA681\uA683\uA685\uA687\uA689\uA68B\uA68D\uA68F\uA691\uA693\uA695\uA697\uA699\uA69B-\uA69D\uA723\uA725\uA727\uA729\uA72B\uA72D\uA72F-\uA731\uA733\uA735\uA737\uA739\uA73B\uA73D\uA73F\uA741\uA743\uA745\uA747\uA749\uA74B\uA74D\uA74F\uA751\uA753\uA755\uA757\uA759\uA75B\uA75D\uA75F\uA761\uA763\uA765\uA767\uA769\uA76B\uA76D\uA76F-\uA778\uA77A\uA77C\uA77F\uA781\uA783\uA785\uA787\uA78C\uA78E\uA791\uA793-\uA795\uA797\uA799\uA79B\uA79D\uA79F\uA7A1\uA7A3\uA7A5\uA7A7\uA7A9\uA7AF\uA7B5\uA7B7\uA7B9\uA7F8-\uA7FA\uAB30-\uAB5A\uAB5C-\uAB65\uAB70-\uABBF\uFB00-\uFB06\uFB13-\uFB17\uFF41-\uFF5A', + 'astral': '\uD801[\uDC28-\uDC4F\uDCD8-\uDCFB]|\uD803[\uDCC0-\uDCF2]|\uD806[\uDCC0-\uDCDF]|\uD81B[\uDE60-\uDE7F]|\uD835[\uDC1A-\uDC33\uDC4E-\uDC54\uDC56-\uDC67\uDC82-\uDC9B\uDCB6-\uDCB9\uDCBB\uDCBD-\uDCC3\uDCC5-\uDCCF\uDCEA-\uDD03\uDD1E-\uDD37\uDD52-\uDD6B\uDD86-\uDD9F\uDDBA-\uDDD3\uDDEE-\uDE07\uDE22-\uDE3B\uDE56-\uDE6F\uDE8A-\uDEA5\uDEC2-\uDEDA\uDEDC-\uDEE1\uDEFC-\uDF14\uDF16-\uDF1B\uDF36-\uDF4E\uDF50-\uDF55\uDF70-\uDF88\uDF8A-\uDF8F\uDFAA-\uDFC2\uDFC4-\uDFC9\uDFCB]|\uD83A[\uDD22-\uDD43]' + }, + { + 'name': 'Noncharacter_Code_Point', + 'bmp': '\uFDD0-\uFDEF\uFFFE\uFFFF', + 'astral': '[\uD83F\uD87F\uD8BF\uD8FF\uD93F\uD97F\uD9BF\uD9FF\uDA3F\uDA7F\uDABF\uDAFF\uDB3F\uDB7F\uDBBF\uDBFF][\uDFFE\uDFFF]' + }, + { + 'name': 'Uppercase', + 'bmp': 'A-Z\xC0-\xD6\xD8-\xDE\u0100\u0102\u0104\u0106\u0108\u010A\u010C\u010E\u0110\u0112\u0114\u0116\u0118\u011A\u011C\u011E\u0120\u0122\u0124\u0126\u0128\u012A\u012C\u012E\u0130\u0132\u0134\u0136\u0139\u013B\u013D\u013F\u0141\u0143\u0145\u0147\u014A\u014C\u014E\u0150\u0152\u0154\u0156\u0158\u015A\u015C\u015E\u0160\u0162\u0164\u0166\u0168\u016A\u016C\u016E\u0170\u0172\u0174\u0176\u0178\u0179\u017B\u017D\u0181\u0182\u0184\u0186\u0187\u0189-\u018B\u018E-\u0191\u0193\u0194\u0196-\u0198\u019C\u019D\u019F\u01A0\u01A2\u01A4\u01A6\u01A7\u01A9\u01AC\u01AE\u01AF\u01B1-\u01B3\u01B5\u01B7\u01B8\u01BC\u01C4\u01C7\u01CA\u01CD\u01CF\u01D1\u01D3\u01D5\u01D7\u01D9\u01DB\u01DE\u01E0\u01E2\u01E4\u01E6\u01E8\u01EA\u01EC\u01EE\u01F1\u01F4\u01F6-\u01F8\u01FA\u01FC\u01FE\u0200\u0202\u0204\u0206\u0208\u020A\u020C\u020E\u0210\u0212\u0214\u0216\u0218\u021A\u021C\u021E\u0220\u0222\u0224\u0226\u0228\u022A\u022C\u022E\u0230\u0232\u023A\u023B\u023D\u023E\u0241\u0243-\u0246\u0248\u024A\u024C\u024E\u0370\u0372\u0376\u037F\u0386\u0388-\u038A\u038C\u038E\u038F\u0391-\u03A1\u03A3-\u03AB\u03CF\u03D2-\u03D4\u03D8\u03DA\u03DC\u03DE\u03E0\u03E2\u03E4\u03E6\u03E8\u03EA\u03EC\u03EE\u03F4\u03F7\u03F9\u03FA\u03FD-\u042F\u0460\u0462\u0464\u0466\u0468\u046A\u046C\u046E\u0470\u0472\u0474\u0476\u0478\u047A\u047C\u047E\u0480\u048A\u048C\u048E\u0490\u0492\u0494\u0496\u0498\u049A\u049C\u049E\u04A0\u04A2\u04A4\u04A6\u04A8\u04AA\u04AC\u04AE\u04B0\u04B2\u04B4\u04B6\u04B8\u04BA\u04BC\u04BE\u04C0\u04C1\u04C3\u04C5\u04C7\u04C9\u04CB\u04CD\u04D0\u04D2\u04D4\u04D6\u04D8\u04DA\u04DC\u04DE\u04E0\u04E2\u04E4\u04E6\u04E8\u04EA\u04EC\u04EE\u04F0\u04F2\u04F4\u04F6\u04F8\u04FA\u04FC\u04FE\u0500\u0502\u0504\u0506\u0508\u050A\u050C\u050E\u0510\u0512\u0514\u0516\u0518\u051A\u051C\u051E\u0520\u0522\u0524\u0526\u0528\u052A\u052C\u052E\u0531-\u0556\u10A0-\u10C5\u10C7\u10CD\u13A0-\u13F5\u1C90-\u1CBA\u1CBD-\u1CBF\u1E00\u1E02\u1E04\u1E06\u1E08\u1E0A\u1E0C\u1E0E\u1E10\u1E12\u1E14\u1E16\u1E18\u1E1A\u1E1C\u1E1E\u1E20\u1E22\u1E24\u1E26\u1E28\u1E2A\u1E2C\u1E2E\u1E30\u1E32\u1E34\u1E36\u1E38\u1E3A\u1E3C\u1E3E\u1E40\u1E42\u1E44\u1E46\u1E48\u1E4A\u1E4C\u1E4E\u1E50\u1E52\u1E54\u1E56\u1E58\u1E5A\u1E5C\u1E5E\u1E60\u1E62\u1E64\u1E66\u1E68\u1E6A\u1E6C\u1E6E\u1E70\u1E72\u1E74\u1E76\u1E78\u1E7A\u1E7C\u1E7E\u1E80\u1E82\u1E84\u1E86\u1E88\u1E8A\u1E8C\u1E8E\u1E90\u1E92\u1E94\u1E9E\u1EA0\u1EA2\u1EA4\u1EA6\u1EA8\u1EAA\u1EAC\u1EAE\u1EB0\u1EB2\u1EB4\u1EB6\u1EB8\u1EBA\u1EBC\u1EBE\u1EC0\u1EC2\u1EC4\u1EC6\u1EC8\u1ECA\u1ECC\u1ECE\u1ED0\u1ED2\u1ED4\u1ED6\u1ED8\u1EDA\u1EDC\u1EDE\u1EE0\u1EE2\u1EE4\u1EE6\u1EE8\u1EEA\u1EEC\u1EEE\u1EF0\u1EF2\u1EF4\u1EF6\u1EF8\u1EFA\u1EFC\u1EFE\u1F08-\u1F0F\u1F18-\u1F1D\u1F28-\u1F2F\u1F38-\u1F3F\u1F48-\u1F4D\u1F59\u1F5B\u1F5D\u1F5F\u1F68-\u1F6F\u1FB8-\u1FBB\u1FC8-\u1FCB\u1FD8-\u1FDB\u1FE8-\u1FEC\u1FF8-\u1FFB\u2102\u2107\u210B-\u210D\u2110-\u2112\u2115\u2119-\u211D\u2124\u2126\u2128\u212A-\u212D\u2130-\u2133\u213E\u213F\u2145\u2160-\u216F\u2183\u24B6-\u24CF\u2C00-\u2C2E\u2C60\u2C62-\u2C64\u2C67\u2C69\u2C6B\u2C6D-\u2C70\u2C72\u2C75\u2C7E-\u2C80\u2C82\u2C84\u2C86\u2C88\u2C8A\u2C8C\u2C8E\u2C90\u2C92\u2C94\u2C96\u2C98\u2C9A\u2C9C\u2C9E\u2CA0\u2CA2\u2CA4\u2CA6\u2CA8\u2CAA\u2CAC\u2CAE\u2CB0\u2CB2\u2CB4\u2CB6\u2CB8\u2CBA\u2CBC\u2CBE\u2CC0\u2CC2\u2CC4\u2CC6\u2CC8\u2CCA\u2CCC\u2CCE\u2CD0\u2CD2\u2CD4\u2CD6\u2CD8\u2CDA\u2CDC\u2CDE\u2CE0\u2CE2\u2CEB\u2CED\u2CF2\uA640\uA642\uA644\uA646\uA648\uA64A\uA64C\uA64E\uA650\uA652\uA654\uA656\uA658\uA65A\uA65C\uA65E\uA660\uA662\uA664\uA666\uA668\uA66A\uA66C\uA680\uA682\uA684\uA686\uA688\uA68A\uA68C\uA68E\uA690\uA692\uA694\uA696\uA698\uA69A\uA722\uA724\uA726\uA728\uA72A\uA72C\uA72E\uA732\uA734\uA736\uA738\uA73A\uA73C\uA73E\uA740\uA742\uA744\uA746\uA748\uA74A\uA74C\uA74E\uA750\uA752\uA754\uA756\uA758\uA75A\uA75C\uA75E\uA760\uA762\uA764\uA766\uA768\uA76A\uA76C\uA76E\uA779\uA77B\uA77D\uA77E\uA780\uA782\uA784\uA786\uA78B\uA78D\uA790\uA792\uA796\uA798\uA79A\uA79C\uA79E\uA7A0\uA7A2\uA7A4\uA7A6\uA7A8\uA7AA-\uA7AE\uA7B0-\uA7B4\uA7B6\uA7B8\uFF21-\uFF3A', + 'astral': '\uD801[\uDC00-\uDC27\uDCB0-\uDCD3]|\uD803[\uDC80-\uDCB2]|\uD806[\uDCA0-\uDCBF]|\uD81B[\uDE40-\uDE5F]|\uD835[\uDC00-\uDC19\uDC34-\uDC4D\uDC68-\uDC81\uDC9C\uDC9E\uDC9F\uDCA2\uDCA5\uDCA6\uDCA9-\uDCAC\uDCAE-\uDCB5\uDCD0-\uDCE9\uDD04\uDD05\uDD07-\uDD0A\uDD0D-\uDD14\uDD16-\uDD1C\uDD38\uDD39\uDD3B-\uDD3E\uDD40-\uDD44\uDD46\uDD4A-\uDD50\uDD6C-\uDD85\uDDA0-\uDDB9\uDDD4-\uDDED\uDE08-\uDE21\uDE3C-\uDE55\uDE70-\uDE89\uDEA8-\uDEC0\uDEE2-\uDEFA\uDF1C-\uDF34\uDF56-\uDF6E\uDF90-\uDFA8\uDFCA]|\uD83A[\uDD00-\uDD21]|\uD83C[\uDD30-\uDD49\uDD50-\uDD69\uDD70-\uDD89]' + }, + { + 'name': 'White_Space', + 'bmp': '\t-\r \x85\xA0\u1680\u2000-\u200A\u2028\u2029\u202F\u205F\u3000' + } +]; + +var unicodeProperties = createCommonjsModule(function (module, exports) { +"use strict"; + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.default = void 0; + +var _properties = _interopRequireDefault(properties); + +function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } + +/*! + * XRegExp Unicode Properties 4.2.0 + * + * Steven Levithan (c) 2012-present MIT License + * Unicode data by Mathias Bynens + */ +var _default = function _default(XRegExp) { + /** + * Adds properties to meet the UTS #18 Level 1 RL1.2 requirements for Unicode regex support. See + * . Following are definitions of these properties from + * UAX #44 : + * + * - Alphabetic + * Characters with the Alphabetic property. Generated from: Lowercase + Uppercase + Lt + Lm + + * Lo + Nl + Other_Alphabetic. + * + * - Default_Ignorable_Code_Point + * For programmatic determination of default ignorable code points. New characters that should + * be ignored in rendering (unless explicitly supported) will be assigned in these ranges, + * permitting programs to correctly handle the default rendering of such characters when not + * otherwise supported. + * + * - Lowercase + * Characters with the Lowercase property. Generated from: Ll + Other_Lowercase. + * + * - Noncharacter_Code_Point + * Code points permanently reserved for internal use. + * + * - Uppercase + * Characters with the Uppercase property. Generated from: Lu + Other_Uppercase. + * + * - White_Space + * Spaces, separator characters and other control characters which should be treated by + * programming languages as "white space" for the purpose of parsing elements. + * + * The properties ASCII, Any, and Assigned are also included but are not defined in UAX #44. UTS + * #18 RL1.2 additionally requires support for Unicode scripts and general categories. These are + * included in XRegExp's Unicode Categories and Unicode Scripts addons. + * + * Token names are case insensitive, and any spaces, hyphens, and underscores are ignored. + * + * Uses Unicode 11.0.0. + * + * @requires XRegExp, Unicode Base + */ + if (!XRegExp.addUnicodeData) { + throw new ReferenceError('Unicode Base must be loaded before Unicode Properties'); + } + + var unicodeData = _properties.default; // Add non-generated data + + unicodeData.push({ + name: 'Assigned', + // Since this is defined as the inverse of Unicode category Cn (Unassigned), the Unicode + // Categories addon is required to use this property + inverseOf: 'Cn' + }); + XRegExp.addUnicodeData(unicodeData); +}; + +exports.default = _default; +module.exports = exports["default"]; +}); + +unwrapExports(unicodeProperties); + +var scripts = [ + { + 'name': 'Adlam', + 'astral': '\uD83A[\uDD00-\uDD4A\uDD50-\uDD59\uDD5E\uDD5F]' + }, + { + 'name': 'Ahom', + 'astral': '\uD805[\uDF00-\uDF1A\uDF1D-\uDF2B\uDF30-\uDF3F]' + }, + { + 'name': 'Anatolian_Hieroglyphs', + 'astral': '\uD811[\uDC00-\uDE46]' + }, + { + 'name': 'Arabic', + 'bmp': '\u0600-\u0604\u0606-\u060B\u060D-\u061A\u061C\u061E\u0620-\u063F\u0641-\u064A\u0656-\u066F\u0671-\u06DC\u06DE-\u06FF\u0750-\u077F\u08A0-\u08B4\u08B6-\u08BD\u08D3-\u08E1\u08E3-\u08FF\uFB50-\uFBC1\uFBD3-\uFD3D\uFD50-\uFD8F\uFD92-\uFDC7\uFDF0-\uFDFD\uFE70-\uFE74\uFE76-\uFEFC', + 'astral': '\uD803[\uDE60-\uDE7E]|\uD83B[\uDE00-\uDE03\uDE05-\uDE1F\uDE21\uDE22\uDE24\uDE27\uDE29-\uDE32\uDE34-\uDE37\uDE39\uDE3B\uDE42\uDE47\uDE49\uDE4B\uDE4D-\uDE4F\uDE51\uDE52\uDE54\uDE57\uDE59\uDE5B\uDE5D\uDE5F\uDE61\uDE62\uDE64\uDE67-\uDE6A\uDE6C-\uDE72\uDE74-\uDE77\uDE79-\uDE7C\uDE7E\uDE80-\uDE89\uDE8B-\uDE9B\uDEA1-\uDEA3\uDEA5-\uDEA9\uDEAB-\uDEBB\uDEF0\uDEF1]' + }, + { + 'name': 'Armenian', + 'bmp': '\u0531-\u0556\u0559-\u0588\u058A\u058D-\u058F\uFB13-\uFB17' + }, + { + 'name': 'Avestan', + 'astral': '\uD802[\uDF00-\uDF35\uDF39-\uDF3F]' + }, + { + 'name': 'Balinese', + 'bmp': '\u1B00-\u1B4B\u1B50-\u1B7C' + }, + { + 'name': 'Bamum', + 'bmp': '\uA6A0-\uA6F7', + 'astral': '\uD81A[\uDC00-\uDE38]' + }, + { + 'name': 'Bassa_Vah', + 'astral': '\uD81A[\uDED0-\uDEED\uDEF0-\uDEF5]' + }, + { + 'name': 'Batak', + 'bmp': '\u1BC0-\u1BF3\u1BFC-\u1BFF' + }, + { + 'name': 'Bengali', + 'bmp': '\u0980-\u0983\u0985-\u098C\u098F\u0990\u0993-\u09A8\u09AA-\u09B0\u09B2\u09B6-\u09B9\u09BC-\u09C4\u09C7\u09C8\u09CB-\u09CE\u09D7\u09DC\u09DD\u09DF-\u09E3\u09E6-\u09FE' + }, + { + 'name': 'Bhaiksuki', + 'astral': '\uD807[\uDC00-\uDC08\uDC0A-\uDC36\uDC38-\uDC45\uDC50-\uDC6C]' + }, + { + 'name': 'Bopomofo', + 'bmp': '\u02EA\u02EB\u3105-\u312F\u31A0-\u31BA' + }, + { + 'name': 'Brahmi', + 'astral': '\uD804[\uDC00-\uDC4D\uDC52-\uDC6F\uDC7F]' + }, + { + 'name': 'Braille', + 'bmp': '\u2800-\u28FF' + }, + { + 'name': 'Buginese', + 'bmp': '\u1A00-\u1A1B\u1A1E\u1A1F' + }, + { + 'name': 'Buhid', + 'bmp': '\u1740-\u1753' + }, + { + 'name': 'Canadian_Aboriginal', + 'bmp': '\u1400-\u167F\u18B0-\u18F5' + }, + { + 'name': 'Carian', + 'astral': '\uD800[\uDEA0-\uDED0]' + }, + { + 'name': 'Caucasian_Albanian', + 'astral': '\uD801[\uDD30-\uDD63\uDD6F]' + }, + { + 'name': 'Chakma', + 'astral': '\uD804[\uDD00-\uDD34\uDD36-\uDD46]' + }, + { + 'name': 'Cham', + 'bmp': '\uAA00-\uAA36\uAA40-\uAA4D\uAA50-\uAA59\uAA5C-\uAA5F' + }, + { + 'name': 'Cherokee', + 'bmp': '\u13A0-\u13F5\u13F8-\u13FD\uAB70-\uABBF' + }, + { + 'name': 'Common', + 'bmp': '\0-@\\[-`\\{-\xA9\xAB-\xB9\xBB-\xBF\xD7\xF7\u02B9-\u02DF\u02E5-\u02E9\u02EC-\u02FF\u0374\u037E\u0385\u0387\u0589\u0605\u060C\u061B\u061F\u0640\u06DD\u08E2\u0964\u0965\u0E3F\u0FD5-\u0FD8\u10FB\u16EB-\u16ED\u1735\u1736\u1802\u1803\u1805\u1CD3\u1CE1\u1CE9-\u1CEC\u1CEE-\u1CF3\u1CF5-\u1CF7\u2000-\u200B\u200E-\u2064\u2066-\u2070\u2074-\u207E\u2080-\u208E\u20A0-\u20BF\u2100-\u2125\u2127-\u2129\u212C-\u2131\u2133-\u214D\u214F-\u215F\u2189-\u218B\u2190-\u2426\u2440-\u244A\u2460-\u27FF\u2900-\u2B73\u2B76-\u2B95\u2B98-\u2BC8\u2BCA-\u2BFE\u2E00-\u2E4E\u2FF0-\u2FFB\u3000-\u3004\u3006\u3008-\u3020\u3030-\u3037\u303C-\u303F\u309B\u309C\u30A0\u30FB\u30FC\u3190-\u319F\u31C0-\u31E3\u3220-\u325F\u327F-\u32CF\u3358-\u33FF\u4DC0-\u4DFF\uA700-\uA721\uA788-\uA78A\uA830-\uA839\uA92E\uA9CF\uAB5B\uFD3E\uFD3F\uFE10-\uFE19\uFE30-\uFE52\uFE54-\uFE66\uFE68-\uFE6B\uFEFF\uFF01-\uFF20\uFF3B-\uFF40\uFF5B-\uFF65\uFF70\uFF9E\uFF9F\uFFE0-\uFFE6\uFFE8-\uFFEE\uFFF9-\uFFFD', + 'astral': '\uD800[\uDD00-\uDD02\uDD07-\uDD33\uDD37-\uDD3F\uDD90-\uDD9B\uDDD0-\uDDFC\uDEE1-\uDEFB]|\uD82F[\uDCA0-\uDCA3]|\uD834[\uDC00-\uDCF5\uDD00-\uDD26\uDD29-\uDD66\uDD6A-\uDD7A\uDD83\uDD84\uDD8C-\uDDA9\uDDAE-\uDDE8\uDEE0-\uDEF3\uDF00-\uDF56\uDF60-\uDF78]|\uD835[\uDC00-\uDC54\uDC56-\uDC9C\uDC9E\uDC9F\uDCA2\uDCA5\uDCA6\uDCA9-\uDCAC\uDCAE-\uDCB9\uDCBB\uDCBD-\uDCC3\uDCC5-\uDD05\uDD07-\uDD0A\uDD0D-\uDD14\uDD16-\uDD1C\uDD1E-\uDD39\uDD3B-\uDD3E\uDD40-\uDD44\uDD46\uDD4A-\uDD50\uDD52-\uDEA5\uDEA8-\uDFCB\uDFCE-\uDFFF]|\uD83B[\uDC71-\uDCB4]|\uD83C[\uDC00-\uDC2B\uDC30-\uDC93\uDCA0-\uDCAE\uDCB1-\uDCBF\uDCC1-\uDCCF\uDCD1-\uDCF5\uDD00-\uDD0C\uDD10-\uDD6B\uDD70-\uDDAC\uDDE6-\uDDFF\uDE01\uDE02\uDE10-\uDE3B\uDE40-\uDE48\uDE50\uDE51\uDE60-\uDE65\uDF00-\uDFFF]|\uD83D[\uDC00-\uDED4\uDEE0-\uDEEC\uDEF0-\uDEF9\uDF00-\uDF73\uDF80-\uDFD8]|\uD83E[\uDC00-\uDC0B\uDC10-\uDC47\uDC50-\uDC59\uDC60-\uDC87\uDC90-\uDCAD\uDD00-\uDD0B\uDD10-\uDD3E\uDD40-\uDD70\uDD73-\uDD76\uDD7A\uDD7C-\uDDA2\uDDB0-\uDDB9\uDDC0-\uDDC2\uDDD0-\uDDFF\uDE60-\uDE6D]|\uDB40[\uDC01\uDC20-\uDC7F]' + }, + { + 'name': 'Coptic', + 'bmp': '\u03E2-\u03EF\u2C80-\u2CF3\u2CF9-\u2CFF' + }, + { + 'name': 'Cuneiform', + 'astral': '\uD808[\uDC00-\uDF99]|\uD809[\uDC00-\uDC6E\uDC70-\uDC74\uDC80-\uDD43]' + }, + { + 'name': 'Cypriot', + 'astral': '\uD802[\uDC00-\uDC05\uDC08\uDC0A-\uDC35\uDC37\uDC38\uDC3C\uDC3F]' + }, + { + 'name': 'Cyrillic', + 'bmp': '\u0400-\u0484\u0487-\u052F\u1C80-\u1C88\u1D2B\u1D78\u2DE0-\u2DFF\uA640-\uA69F\uFE2E\uFE2F' + }, + { + 'name': 'Deseret', + 'astral': '\uD801[\uDC00-\uDC4F]' + }, + { + 'name': 'Devanagari', + 'bmp': '\u0900-\u0950\u0953-\u0963\u0966-\u097F\uA8E0-\uA8FF' + }, + { + 'name': 'Dogra', + 'astral': '\uD806[\uDC00-\uDC3B]' + }, + { + 'name': 'Duployan', + 'astral': '\uD82F[\uDC00-\uDC6A\uDC70-\uDC7C\uDC80-\uDC88\uDC90-\uDC99\uDC9C-\uDC9F]' + }, + { + 'name': 'Egyptian_Hieroglyphs', + 'astral': '\uD80C[\uDC00-\uDFFF]|\uD80D[\uDC00-\uDC2E]' + }, + { + 'name': 'Elbasan', + 'astral': '\uD801[\uDD00-\uDD27]' + }, + { + 'name': 'Ethiopic', + 'bmp': '\u1200-\u1248\u124A-\u124D\u1250-\u1256\u1258\u125A-\u125D\u1260-\u1288\u128A-\u128D\u1290-\u12B0\u12B2-\u12B5\u12B8-\u12BE\u12C0\u12C2-\u12C5\u12C8-\u12D6\u12D8-\u1310\u1312-\u1315\u1318-\u135A\u135D-\u137C\u1380-\u1399\u2D80-\u2D96\u2DA0-\u2DA6\u2DA8-\u2DAE\u2DB0-\u2DB6\u2DB8-\u2DBE\u2DC0-\u2DC6\u2DC8-\u2DCE\u2DD0-\u2DD6\u2DD8-\u2DDE\uAB01-\uAB06\uAB09-\uAB0E\uAB11-\uAB16\uAB20-\uAB26\uAB28-\uAB2E' + }, + { + 'name': 'Georgian', + 'bmp': '\u10A0-\u10C5\u10C7\u10CD\u10D0-\u10FA\u10FC-\u10FF\u1C90-\u1CBA\u1CBD-\u1CBF\u2D00-\u2D25\u2D27\u2D2D' + }, + { + 'name': 'Glagolitic', + 'bmp': '\u2C00-\u2C2E\u2C30-\u2C5E', + 'astral': '\uD838[\uDC00-\uDC06\uDC08-\uDC18\uDC1B-\uDC21\uDC23\uDC24\uDC26-\uDC2A]' + }, + { + 'name': 'Gothic', + 'astral': '\uD800[\uDF30-\uDF4A]' + }, + { + 'name': 'Grantha', + 'astral': '\uD804[\uDF00-\uDF03\uDF05-\uDF0C\uDF0F\uDF10\uDF13-\uDF28\uDF2A-\uDF30\uDF32\uDF33\uDF35-\uDF39\uDF3C-\uDF44\uDF47\uDF48\uDF4B-\uDF4D\uDF50\uDF57\uDF5D-\uDF63\uDF66-\uDF6C\uDF70-\uDF74]' + }, + { + 'name': 'Greek', + 'bmp': '\u0370-\u0373\u0375-\u0377\u037A-\u037D\u037F\u0384\u0386\u0388-\u038A\u038C\u038E-\u03A1\u03A3-\u03E1\u03F0-\u03FF\u1D26-\u1D2A\u1D5D-\u1D61\u1D66-\u1D6A\u1DBF\u1F00-\u1F15\u1F18-\u1F1D\u1F20-\u1F45\u1F48-\u1F4D\u1F50-\u1F57\u1F59\u1F5B\u1F5D\u1F5F-\u1F7D\u1F80-\u1FB4\u1FB6-\u1FC4\u1FC6-\u1FD3\u1FD6-\u1FDB\u1FDD-\u1FEF\u1FF2-\u1FF4\u1FF6-\u1FFE\u2126\uAB65', + 'astral': '\uD800[\uDD40-\uDD8E\uDDA0]|\uD834[\uDE00-\uDE45]' + }, + { + 'name': 'Gujarati', + 'bmp': '\u0A81-\u0A83\u0A85-\u0A8D\u0A8F-\u0A91\u0A93-\u0AA8\u0AAA-\u0AB0\u0AB2\u0AB3\u0AB5-\u0AB9\u0ABC-\u0AC5\u0AC7-\u0AC9\u0ACB-\u0ACD\u0AD0\u0AE0-\u0AE3\u0AE6-\u0AF1\u0AF9-\u0AFF' + }, + { + 'name': 'Gunjala_Gondi', + 'astral': '\uD807[\uDD60-\uDD65\uDD67\uDD68\uDD6A-\uDD8E\uDD90\uDD91\uDD93-\uDD98\uDDA0-\uDDA9]' + }, + { + 'name': 'Gurmukhi', + 'bmp': '\u0A01-\u0A03\u0A05-\u0A0A\u0A0F\u0A10\u0A13-\u0A28\u0A2A-\u0A30\u0A32\u0A33\u0A35\u0A36\u0A38\u0A39\u0A3C\u0A3E-\u0A42\u0A47\u0A48\u0A4B-\u0A4D\u0A51\u0A59-\u0A5C\u0A5E\u0A66-\u0A76' + }, + { + 'name': 'Han', + 'bmp': '\u2E80-\u2E99\u2E9B-\u2EF3\u2F00-\u2FD5\u3005\u3007\u3021-\u3029\u3038-\u303B\u3400-\u4DB5\u4E00-\u9FEF\uF900-\uFA6D\uFA70-\uFAD9', + 'astral': '[\uD840-\uD868\uD86A-\uD86C\uD86F-\uD872\uD874-\uD879][\uDC00-\uDFFF]|\uD869[\uDC00-\uDED6\uDF00-\uDFFF]|\uD86D[\uDC00-\uDF34\uDF40-\uDFFF]|\uD86E[\uDC00-\uDC1D\uDC20-\uDFFF]|\uD873[\uDC00-\uDEA1\uDEB0-\uDFFF]|\uD87A[\uDC00-\uDFE0]|\uD87E[\uDC00-\uDE1D]' + }, + { + 'name': 'Hangul', + 'bmp': '\u1100-\u11FF\u302E\u302F\u3131-\u318E\u3200-\u321E\u3260-\u327E\uA960-\uA97C\uAC00-\uD7A3\uD7B0-\uD7C6\uD7CB-\uD7FB\uFFA0-\uFFBE\uFFC2-\uFFC7\uFFCA-\uFFCF\uFFD2-\uFFD7\uFFDA-\uFFDC' + }, + { + 'name': 'Hanifi_Rohingya', + 'astral': '\uD803[\uDD00-\uDD27\uDD30-\uDD39]' + }, + { + 'name': 'Hanunoo', + 'bmp': '\u1720-\u1734' + }, + { + 'name': 'Hatran', + 'astral': '\uD802[\uDCE0-\uDCF2\uDCF4\uDCF5\uDCFB-\uDCFF]' + }, + { + 'name': 'Hebrew', + 'bmp': '\u0591-\u05C7\u05D0-\u05EA\u05EF-\u05F4\uFB1D-\uFB36\uFB38-\uFB3C\uFB3E\uFB40\uFB41\uFB43\uFB44\uFB46-\uFB4F' + }, + { + 'name': 'Hiragana', + 'bmp': '\u3041-\u3096\u309D-\u309F', + 'astral': '\uD82C[\uDC01-\uDD1E]|\uD83C\uDE00' + }, + { + 'name': 'Imperial_Aramaic', + 'astral': '\uD802[\uDC40-\uDC55\uDC57-\uDC5F]' + }, + { + 'name': 'Inherited', + 'bmp': '\u0300-\u036F\u0485\u0486\u064B-\u0655\u0670\u0951\u0952\u1AB0-\u1ABE\u1CD0-\u1CD2\u1CD4-\u1CE0\u1CE2-\u1CE8\u1CED\u1CF4\u1CF8\u1CF9\u1DC0-\u1DF9\u1DFB-\u1DFF\u200C\u200D\u20D0-\u20F0\u302A-\u302D\u3099\u309A\uFE00-\uFE0F\uFE20-\uFE2D', + 'astral': '\uD800[\uDDFD\uDEE0]|\uD804\uDF3B|\uD834[\uDD67-\uDD69\uDD7B-\uDD82\uDD85-\uDD8B\uDDAA-\uDDAD]|\uDB40[\uDD00-\uDDEF]' + }, + { + 'name': 'Inscriptional_Pahlavi', + 'astral': '\uD802[\uDF60-\uDF72\uDF78-\uDF7F]' + }, + { + 'name': 'Inscriptional_Parthian', + 'astral': '\uD802[\uDF40-\uDF55\uDF58-\uDF5F]' + }, + { + 'name': 'Javanese', + 'bmp': '\uA980-\uA9CD\uA9D0-\uA9D9\uA9DE\uA9DF' + }, + { + 'name': 'Kaithi', + 'astral': '\uD804[\uDC80-\uDCC1\uDCCD]' + }, + { + 'name': 'Kannada', + 'bmp': '\u0C80-\u0C8C\u0C8E-\u0C90\u0C92-\u0CA8\u0CAA-\u0CB3\u0CB5-\u0CB9\u0CBC-\u0CC4\u0CC6-\u0CC8\u0CCA-\u0CCD\u0CD5\u0CD6\u0CDE\u0CE0-\u0CE3\u0CE6-\u0CEF\u0CF1\u0CF2' + }, + { + 'name': 'Katakana', + 'bmp': '\u30A1-\u30FA\u30FD-\u30FF\u31F0-\u31FF\u32D0-\u32FE\u3300-\u3357\uFF66-\uFF6F\uFF71-\uFF9D', + 'astral': '\uD82C\uDC00' + }, + { + 'name': 'Kayah_Li', + 'bmp': '\uA900-\uA92D\uA92F' + }, + { + 'name': 'Kharoshthi', + 'astral': '\uD802[\uDE00-\uDE03\uDE05\uDE06\uDE0C-\uDE13\uDE15-\uDE17\uDE19-\uDE35\uDE38-\uDE3A\uDE3F-\uDE48\uDE50-\uDE58]' + }, + { + 'name': 'Khmer', + 'bmp': '\u1780-\u17DD\u17E0-\u17E9\u17F0-\u17F9\u19E0-\u19FF' + }, + { + 'name': 'Khojki', + 'astral': '\uD804[\uDE00-\uDE11\uDE13-\uDE3E]' + }, + { + 'name': 'Khudawadi', + 'astral': '\uD804[\uDEB0-\uDEEA\uDEF0-\uDEF9]' + }, + { + 'name': 'Lao', + 'bmp': '\u0E81\u0E82\u0E84\u0E87\u0E88\u0E8A\u0E8D\u0E94-\u0E97\u0E99-\u0E9F\u0EA1-\u0EA3\u0EA5\u0EA7\u0EAA\u0EAB\u0EAD-\u0EB9\u0EBB-\u0EBD\u0EC0-\u0EC4\u0EC6\u0EC8-\u0ECD\u0ED0-\u0ED9\u0EDC-\u0EDF' + }, + { + 'name': 'Latin', + 'bmp': 'A-Za-z\xAA\xBA\xC0-\xD6\xD8-\xF6\xF8-\u02B8\u02E0-\u02E4\u1D00-\u1D25\u1D2C-\u1D5C\u1D62-\u1D65\u1D6B-\u1D77\u1D79-\u1DBE\u1E00-\u1EFF\u2071\u207F\u2090-\u209C\u212A\u212B\u2132\u214E\u2160-\u2188\u2C60-\u2C7F\uA722-\uA787\uA78B-\uA7B9\uA7F7-\uA7FF\uAB30-\uAB5A\uAB5C-\uAB64\uFB00-\uFB06\uFF21-\uFF3A\uFF41-\uFF5A' + }, + { + 'name': 'Lepcha', + 'bmp': '\u1C00-\u1C37\u1C3B-\u1C49\u1C4D-\u1C4F' + }, + { + 'name': 'Limbu', + 'bmp': '\u1900-\u191E\u1920-\u192B\u1930-\u193B\u1940\u1944-\u194F' + }, + { + 'name': 'Linear_A', + 'astral': '\uD801[\uDE00-\uDF36\uDF40-\uDF55\uDF60-\uDF67]' + }, + { + 'name': 'Linear_B', + 'astral': '\uD800[\uDC00-\uDC0B\uDC0D-\uDC26\uDC28-\uDC3A\uDC3C\uDC3D\uDC3F-\uDC4D\uDC50-\uDC5D\uDC80-\uDCFA]' + }, + { + 'name': 'Lisu', + 'bmp': '\uA4D0-\uA4FF' + }, + { + 'name': 'Lycian', + 'astral': '\uD800[\uDE80-\uDE9C]' + }, + { + 'name': 'Lydian', + 'astral': '\uD802[\uDD20-\uDD39\uDD3F]' + }, + { + 'name': 'Mahajani', + 'astral': '\uD804[\uDD50-\uDD76]' + }, + { + 'name': 'Makasar', + 'astral': '\uD807[\uDEE0-\uDEF8]' + }, + { + 'name': 'Malayalam', + 'bmp': '\u0D00-\u0D03\u0D05-\u0D0C\u0D0E-\u0D10\u0D12-\u0D44\u0D46-\u0D48\u0D4A-\u0D4F\u0D54-\u0D63\u0D66-\u0D7F' + }, + { + 'name': 'Mandaic', + 'bmp': '\u0840-\u085B\u085E' + }, + { + 'name': 'Manichaean', + 'astral': '\uD802[\uDEC0-\uDEE6\uDEEB-\uDEF6]' + }, + { + 'name': 'Marchen', + 'astral': '\uD807[\uDC70-\uDC8F\uDC92-\uDCA7\uDCA9-\uDCB6]' + }, + { + 'name': 'Masaram_Gondi', + 'astral': '\uD807[\uDD00-\uDD06\uDD08\uDD09\uDD0B-\uDD36\uDD3A\uDD3C\uDD3D\uDD3F-\uDD47\uDD50-\uDD59]' + }, + { + 'name': 'Medefaidrin', + 'astral': '\uD81B[\uDE40-\uDE9A]' + }, + { + 'name': 'Meetei_Mayek', + 'bmp': '\uAAE0-\uAAF6\uABC0-\uABED\uABF0-\uABF9' + }, + { + 'name': 'Mende_Kikakui', + 'astral': '\uD83A[\uDC00-\uDCC4\uDCC7-\uDCD6]' + }, + { + 'name': 'Meroitic_Cursive', + 'astral': '\uD802[\uDDA0-\uDDB7\uDDBC-\uDDCF\uDDD2-\uDDFF]' + }, + { + 'name': 'Meroitic_Hieroglyphs', + 'astral': '\uD802[\uDD80-\uDD9F]' + }, + { + 'name': 'Miao', + 'astral': '\uD81B[\uDF00-\uDF44\uDF50-\uDF7E\uDF8F-\uDF9F]' + }, + { + 'name': 'Modi', + 'astral': '\uD805[\uDE00-\uDE44\uDE50-\uDE59]' + }, + { + 'name': 'Mongolian', + 'bmp': '\u1800\u1801\u1804\u1806-\u180E\u1810-\u1819\u1820-\u1878\u1880-\u18AA', + 'astral': '\uD805[\uDE60-\uDE6C]' + }, + { + 'name': 'Mro', + 'astral': '\uD81A[\uDE40-\uDE5E\uDE60-\uDE69\uDE6E\uDE6F]' + }, + { + 'name': 'Multani', + 'astral': '\uD804[\uDE80-\uDE86\uDE88\uDE8A-\uDE8D\uDE8F-\uDE9D\uDE9F-\uDEA9]' + }, + { + 'name': 'Myanmar', + 'bmp': '\u1000-\u109F\uA9E0-\uA9FE\uAA60-\uAA7F' + }, + { + 'name': 'Nabataean', + 'astral': '\uD802[\uDC80-\uDC9E\uDCA7-\uDCAF]' + }, + { + 'name': 'New_Tai_Lue', + 'bmp': '\u1980-\u19AB\u19B0-\u19C9\u19D0-\u19DA\u19DE\u19DF' + }, + { + 'name': 'Newa', + 'astral': '\uD805[\uDC00-\uDC59\uDC5B\uDC5D\uDC5E]' + }, + { + 'name': 'Nko', + 'bmp': '\u07C0-\u07FA\u07FD-\u07FF' + }, + { + 'name': 'Nushu', + 'astral': '\uD81B\uDFE1|\uD82C[\uDD70-\uDEFB]' + }, + { + 'name': 'Ogham', + 'bmp': '\u1680-\u169C' + }, + { + 'name': 'Ol_Chiki', + 'bmp': '\u1C50-\u1C7F' + }, + { + 'name': 'Old_Hungarian', + 'astral': '\uD803[\uDC80-\uDCB2\uDCC0-\uDCF2\uDCFA-\uDCFF]' + }, + { + 'name': 'Old_Italic', + 'astral': '\uD800[\uDF00-\uDF23\uDF2D-\uDF2F]' + }, + { + 'name': 'Old_North_Arabian', + 'astral': '\uD802[\uDE80-\uDE9F]' + }, + { + 'name': 'Old_Permic', + 'astral': '\uD800[\uDF50-\uDF7A]' + }, + { + 'name': 'Old_Persian', + 'astral': '\uD800[\uDFA0-\uDFC3\uDFC8-\uDFD5]' + }, + { + 'name': 'Old_Sogdian', + 'astral': '\uD803[\uDF00-\uDF27]' + }, + { + 'name': 'Old_South_Arabian', + 'astral': '\uD802[\uDE60-\uDE7F]' + }, + { + 'name': 'Old_Turkic', + 'astral': '\uD803[\uDC00-\uDC48]' + }, + { + 'name': 'Oriya', + 'bmp': '\u0B01-\u0B03\u0B05-\u0B0C\u0B0F\u0B10\u0B13-\u0B28\u0B2A-\u0B30\u0B32\u0B33\u0B35-\u0B39\u0B3C-\u0B44\u0B47\u0B48\u0B4B-\u0B4D\u0B56\u0B57\u0B5C\u0B5D\u0B5F-\u0B63\u0B66-\u0B77' + }, + { + 'name': 'Osage', + 'astral': '\uD801[\uDCB0-\uDCD3\uDCD8-\uDCFB]' + }, + { + 'name': 'Osmanya', + 'astral': '\uD801[\uDC80-\uDC9D\uDCA0-\uDCA9]' + }, + { + 'name': 'Pahawh_Hmong', + 'astral': '\uD81A[\uDF00-\uDF45\uDF50-\uDF59\uDF5B-\uDF61\uDF63-\uDF77\uDF7D-\uDF8F]' + }, + { + 'name': 'Palmyrene', + 'astral': '\uD802[\uDC60-\uDC7F]' + }, + { + 'name': 'Pau_Cin_Hau', + 'astral': '\uD806[\uDEC0-\uDEF8]' + }, + { + 'name': 'Phags_Pa', + 'bmp': '\uA840-\uA877' + }, + { + 'name': 'Phoenician', + 'astral': '\uD802[\uDD00-\uDD1B\uDD1F]' + }, + { + 'name': 'Psalter_Pahlavi', + 'astral': '\uD802[\uDF80-\uDF91\uDF99-\uDF9C\uDFA9-\uDFAF]' + }, + { + 'name': 'Rejang', + 'bmp': '\uA930-\uA953\uA95F' + }, + { + 'name': 'Runic', + 'bmp': '\u16A0-\u16EA\u16EE-\u16F8' + }, + { + 'name': 'Samaritan', + 'bmp': '\u0800-\u082D\u0830-\u083E' + }, + { + 'name': 'Saurashtra', + 'bmp': '\uA880-\uA8C5\uA8CE-\uA8D9' + }, + { + 'name': 'Sharada', + 'astral': '\uD804[\uDD80-\uDDCD\uDDD0-\uDDDF]' + }, + { + 'name': 'Shavian', + 'astral': '\uD801[\uDC50-\uDC7F]' + }, + { + 'name': 'Siddham', + 'astral': '\uD805[\uDD80-\uDDB5\uDDB8-\uDDDD]' + }, + { + 'name': 'SignWriting', + 'astral': '\uD836[\uDC00-\uDE8B\uDE9B-\uDE9F\uDEA1-\uDEAF]' + }, + { + 'name': 'Sinhala', + 'bmp': '\u0D82\u0D83\u0D85-\u0D96\u0D9A-\u0DB1\u0DB3-\u0DBB\u0DBD\u0DC0-\u0DC6\u0DCA\u0DCF-\u0DD4\u0DD6\u0DD8-\u0DDF\u0DE6-\u0DEF\u0DF2-\u0DF4', + 'astral': '\uD804[\uDDE1-\uDDF4]' + }, + { + 'name': 'Sogdian', + 'astral': '\uD803[\uDF30-\uDF59]' + }, + { + 'name': 'Sora_Sompeng', + 'astral': '\uD804[\uDCD0-\uDCE8\uDCF0-\uDCF9]' + }, + { + 'name': 'Soyombo', + 'astral': '\uD806[\uDE50-\uDE83\uDE86-\uDEA2]' + }, + { + 'name': 'Sundanese', + 'bmp': '\u1B80-\u1BBF\u1CC0-\u1CC7' + }, + { + 'name': 'Syloti_Nagri', + 'bmp': '\uA800-\uA82B' + }, + { + 'name': 'Syriac', + 'bmp': '\u0700-\u070D\u070F-\u074A\u074D-\u074F\u0860-\u086A' + }, + { + 'name': 'Tagalog', + 'bmp': '\u1700-\u170C\u170E-\u1714' + }, + { + 'name': 'Tagbanwa', + 'bmp': '\u1760-\u176C\u176E-\u1770\u1772\u1773' + }, + { + 'name': 'Tai_Le', + 'bmp': '\u1950-\u196D\u1970-\u1974' + }, + { + 'name': 'Tai_Tham', + 'bmp': '\u1A20-\u1A5E\u1A60-\u1A7C\u1A7F-\u1A89\u1A90-\u1A99\u1AA0-\u1AAD' + }, + { + 'name': 'Tai_Viet', + 'bmp': '\uAA80-\uAAC2\uAADB-\uAADF' + }, + { + 'name': 'Takri', + 'astral': '\uD805[\uDE80-\uDEB7\uDEC0-\uDEC9]' + }, + { + 'name': 'Tamil', + 'bmp': '\u0B82\u0B83\u0B85-\u0B8A\u0B8E-\u0B90\u0B92-\u0B95\u0B99\u0B9A\u0B9C\u0B9E\u0B9F\u0BA3\u0BA4\u0BA8-\u0BAA\u0BAE-\u0BB9\u0BBE-\u0BC2\u0BC6-\u0BC8\u0BCA-\u0BCD\u0BD0\u0BD7\u0BE6-\u0BFA' + }, + { + 'name': 'Tangut', + 'astral': '\uD81B\uDFE0|[\uD81C-\uD820][\uDC00-\uDFFF]|\uD821[\uDC00-\uDFF1]|\uD822[\uDC00-\uDEF2]' + }, + { + 'name': 'Telugu', + 'bmp': '\u0C00-\u0C0C\u0C0E-\u0C10\u0C12-\u0C28\u0C2A-\u0C39\u0C3D-\u0C44\u0C46-\u0C48\u0C4A-\u0C4D\u0C55\u0C56\u0C58-\u0C5A\u0C60-\u0C63\u0C66-\u0C6F\u0C78-\u0C7F' + }, + { + 'name': 'Thaana', + 'bmp': '\u0780-\u07B1' + }, + { + 'name': 'Thai', + 'bmp': '\u0E01-\u0E3A\u0E40-\u0E5B' + }, + { + 'name': 'Tibetan', + 'bmp': '\u0F00-\u0F47\u0F49-\u0F6C\u0F71-\u0F97\u0F99-\u0FBC\u0FBE-\u0FCC\u0FCE-\u0FD4\u0FD9\u0FDA' + }, + { + 'name': 'Tifinagh', + 'bmp': '\u2D30-\u2D67\u2D6F\u2D70\u2D7F' + }, + { + 'name': 'Tirhuta', + 'astral': '\uD805[\uDC80-\uDCC7\uDCD0-\uDCD9]' + }, + { + 'name': 'Ugaritic', + 'astral': '\uD800[\uDF80-\uDF9D\uDF9F]' + }, + { + 'name': 'Vai', + 'bmp': '\uA500-\uA62B' + }, + { + 'name': 'Warang_Citi', + 'astral': '\uD806[\uDCA0-\uDCF2\uDCFF]' + }, + { + 'name': 'Yi', + 'bmp': '\uA000-\uA48C\uA490-\uA4C6' + }, + { + 'name': 'Zanabazar_Square', + 'astral': '\uD806[\uDE00-\uDE47]' + } +]; + +var unicodeScripts = createCommonjsModule(function (module, exports) { +"use strict"; + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.default = void 0; + +var _scripts = _interopRequireDefault(scripts); + +function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } + +/*! + * XRegExp Unicode Scripts 4.2.0 + * + * Steven Levithan (c) 2010-present MIT License + * Unicode data by Mathias Bynens + */ +var _default = function _default(XRegExp) { + /** + * Adds support for all Unicode scripts. E.g., `\p{Latin}`. Token names are case insensitive, + * and any spaces, hyphens, and underscores are ignored. + * + * Uses Unicode 11.0.0. + * + * @requires XRegExp, Unicode Base + */ + if (!XRegExp.addUnicodeData) { + throw new ReferenceError('Unicode Base must be loaded before Unicode Scripts'); + } + + XRegExp.addUnicodeData(_scripts.default); +}; + +exports.default = _default; +module.exports = exports["default"]; +}); + +unwrapExports(unicodeScripts); + +var lib = createCommonjsModule(function (module, exports) { +"use strict"; + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.default = void 0; + +var _xregexp = _interopRequireDefault(xregexp); + +var _build = _interopRequireDefault(build); + +var _matchrecursive = _interopRequireDefault(matchrecursive); + +var _unicodeBase = _interopRequireDefault(unicodeBase); + +var _unicodeBlocks = _interopRequireDefault(unicodeBlocks); + +var _unicodeCategories = _interopRequireDefault(unicodeCategories); + +var _unicodeProperties = _interopRequireDefault(unicodeProperties); + +var _unicodeScripts = _interopRequireDefault(unicodeScripts); + +function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } + +(_build.default)(_xregexp.default); +(_matchrecursive.default)(_xregexp.default); +(_unicodeBase.default)(_xregexp.default); +(_unicodeBlocks.default)(_xregexp.default); +(_unicodeCategories.default)(_xregexp.default); +(_unicodeProperties.default)(_xregexp.default); +(_unicodeScripts.default)(_xregexp.default); +var _default = _xregexp.default; +exports.default = _default; +module.exports = exports["default"]; +}); + +unwrapExports(lib); + +var utilities = createCommonjsModule(function (module, exports) { +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); + +class FormatUtility { + static preProcess(query, toLower = true) { + if (toLower) { + query = query.toLowerCase(); + } + return query + .replace(/0/g, "0") + .replace(/1/g, "1") + .replace(/2/g, "2") + .replace(/3/g, "3") + .replace(/4/g, "4") + .replace(/5/g, "5") + .replace(/6/g, "6") + .replace(/7/g, "7") + .replace(/8/g, "8") + .replace(/9/g, "9") + .replace(/:/g, ":") + .replace(/-/g, "-") + .replace(/,/g, ",") + .replace(///g, "/") + .replace(/G/g, "G") + .replace(/M/g, "M") + .replace(/T/g, "T") + .replace(/K/g, "K") + .replace(/k/g, "k") + .replace(/./g, ".") + .replace(/(/g, "(") + .replace(/)/g, ")"); + } +} +exports.FormatUtility = FormatUtility; +class Match { + constructor(index, length, value, groups) { + this.index = index; + this.length = length; + this.value = value; + this.innerGroups = groups; + } + groups(key) { + return this.innerGroups[key] ? this.innerGroups[key] : { value: '', index: 0, length: 0, captures: [] }; + } +} +exports.Match = Match; +class RegExpUtility { + static getMatches(regex, source) { + if (!regex) + return []; + let rawRegex = regex.xregexp.source; + if (!rawRegex.includes('(?= 0) { + closePos = this.getClosePos(rawRegex, startPos); + let nlbRegex = lib(rawRegex.substring(startPos, closePos + 1), flags); + let nextRegex = RegExpUtility.getNextRegex(rawRegex, startPos); + nlbRegex.nextRegex = nextRegex ? lib(nextRegex, flags) : null; + negativeLookbehindRegexes.push(nlbRegex); + rawRegex = rawRegex.substr(0, startPos) + rawRegex.substr(closePos + 1); + startPos = rawRegex.indexOf('(? { + let clean = true; + negativeLookbehindRegexes.forEach(regex => { + let negativeLookbehindMatches = RegExpUtility.getMatchesSimple(regex, source); + negativeLookbehindMatches.forEach(negativeLookbehindMatch => { + let negativeLookbehindEnd = negativeLookbehindMatch.index + negativeLookbehindMatch.length; + let nextRegex = regex.nextRegex; + if (match.index === negativeLookbehindEnd) { + if (!nextRegex) { + clean = false; + return; + } + else { + let nextMatch = RegExpUtility.getFirstMatchIndex(nextRegex, source.substring(negativeLookbehindMatch.index)); + if (nextMatch.matched && ((nextMatch.index === negativeLookbehindMatch.length) || (source.includes(nextMatch.value + match.value)))) { + clean = false; + return; + } + } + } + if (negativeLookbehindMatch.value.includes(match.value)) { + let preMatches = RegExpUtility.getMatchesSimple(regex, source.substring(0, match.index)); + preMatches.forEach(preMatch => { + if (source.includes(preMatch.value + match.value)) { + clean = false; + return; + } + }); + } + }); + if (!clean) { + return; + } + }); + if (clean) { + realMatches.push(match); + } + }); + return realMatches; + } + static getMatchesSimple(regex, source) { + // Word boundary (\b) in JS is not unicode-aware, so words starting/ending with accentuated characters will not match + // use a normalized string to match, the return matches' values using the original one + // http://blog.stevenlevithan.com/archives/javascript-regex-and-unicode + // https://stackoverflow.com/questions/2881445/utf-8-word-boundary-regex-in-javascript + let normalized = StringUtility.removeDiacriticsFromWordBoundaries(source); + let matches = new Array(); + lib.forEach(normalized, regex, match => { + let positiveLookbehinds = []; + let groups = {}; + let lastGroup = ''; + Object.keys(match).forEach(key => { + if (!key.includes('__')) + return; + if (key.startsWith('plb') && match[key]) { + if (match[0].indexOf(match[key]) !== 0 && !StringUtility.isNullOrEmpty(lastGroup)) { + let index = match.index + match[0].indexOf(match[key]); + let length = match[key].length; + let value = source.substr(index, length); + groups[lastGroup].value = groups[lastGroup].value + value; + } + positiveLookbehinds.push({ key: key, value: match[key] }); + return; + } + if (key.startsWith('nlb')) { + return; + } + let groupKey = key.substr(0, key.lastIndexOf('__')); + lastGroup = groupKey; + if (!groups[groupKey]) + groups[groupKey] = { value: '', index: 0, length: 0, captures: [] }; + if (match[key]) { + let index = match.index + match[0].indexOf(match[key]); + let length = match[key].length; + let value = source.substr(index, length); + groups[groupKey].index = index; + groups[groupKey].length = length; + groups[groupKey].value = value; + groups[groupKey].captures.push(value); + } + }); + let value = match[0]; + let index = match.index; + let length = value.length; + if (positiveLookbehinds && positiveLookbehinds.length > 0 && value.indexOf(positiveLookbehinds[0].value) === 0) { + value = source.substr(index, length).substr(positiveLookbehinds[0].value.length); + index += positiveLookbehinds[0].value.length; + length -= positiveLookbehinds[0].value.length; + } + else { + value = source.substr(index, length); + } + matches.push(new Match(index, length, value, groups)); + }); + return matches; + } + static getSafeRegExp(source, flags) { + let sanitizedSource = this.sanitizeGroups(source); + return lib(sanitizedSource, flags || 'gis'); + } + static getFirstMatchIndex(regex, source) { + let matches = RegExpUtility.getMatches(regex, source); + if (matches.length) { + return { + matched: true, + index: matches[0].index, + value: matches[0].value + }; + } + return { matched: false, index: -1, value: null }; + } + static split(regex, source) { + return lib.split(source, regex); + } + static isMatch(regex, source) { + return !StringUtility.isNullOrEmpty(source) + && this.getMatches(regex, source).length > 0; + } + static sanitizeGroups(source) { + let index = 0; + let result = lib.replace(source, this.matchGroup, (match, name) => match.replace(name, `${name}__${index++}`)); + index = 0; + result = lib.replace(result, this.matchPositiveLookbehind, () => `(?`); + index = 0; + result = lib.replace(result, this.matchNegativeLookbehind, () => `(?`); + return result; + } + static getNextRegex(source, startPos) { + startPos = RegExpUtility.getClosePos(source, startPos) + 1; + let closePos = RegExpUtility.getClosePos(source, startPos); + if (source[startPos] !== '(') { + closePos--; + } + let next = (startPos === closePos) + ? null + : source.substring(startPos, closePos + 1); + return next; + } + static getClosePos(source, startPos) { + let counter = 1; + let closePos = startPos; + while (counter > 0 && closePos < source.length) { + let c = source[++closePos]; + if (c === '(') + counter++; + else if (c === ')') + counter--; + } + return closePos; + } +} +RegExpUtility.matchGroup = lib(String.raw `\?<(?\w+)>`, 'gis'); +RegExpUtility.matchPositiveLookbehind = lib(String.raw `\(\?<=`, 'gis'); +RegExpUtility.matchNegativeLookbehind = lib(String.raw `\(\? { + let length = s.length; + if (length === 0) + return s; + let first = StringUtility.removeDiacritics(s.substring(0, 1)); + if (length === 1) + return first; + let last = length > 1 ? StringUtility.removeDiacritics(s.substring(length - 1)) : ''; + let mid = s.substring(1, length - 1); + // console.log(first + mid + last) + return first + mid + last; + }) + .join(' '); + } + static removeDiacritics(c) { + let clean = StringUtility.diacriticsRemovalMap[c]; + return !clean ? c : clean; + } +} +StringUtility.diacriticsRemovalMap = { + "Ⓐ": "A", + "A": "A", + "À": "A", + "Á": "A", + "Â": "A", + "Ầ": "A", + "Ấ": "A", + "Ẫ": "A", + "Ẩ": "A", + "Ã": "A", + "Ā": "A", + "Ă": "A", + "Ằ": "A", + "Ắ": "A", + "Ẵ": "A", + "Ẳ": "A", + "Ȧ": "A", + "Ǡ": "A", + "Ä": "A", + "Ǟ": "A", + "Ả": "A", + "Å": "A", + "Ǻ": "A", + "Ǎ": "A", + "Ȁ": "A", + "Ȃ": "A", + "Ạ": "A", + "Ậ": "A", + "Ặ": "A", + "Ḁ": "A", + "Ą": "A", + "Ⱥ": "A", + "Ɐ": "A", + "Ⓑ": "B", + "B": "B", + "Ḃ": "B", + "Ḅ": "B", + "Ḇ": "B", + "Ƀ": "B", + "Ƃ": "B", + "Ɓ": "B", + "Ⓒ": "C", + "C": "C", + "Ć": "C", + "Ĉ": "C", + "Ċ": "C", + "Č": "C", + "Ç": "C", + "Ḉ": "C", + "Ƈ": "C", + "Ȼ": "C", + "Ꜿ": "C", + "Ⓓ": "D", + "D": "D", + "Ḋ": "D", + "Ď": "D", + "Ḍ": "D", + "Ḑ": "D", + "Ḓ": "D", + "Ḏ": "D", + "Đ": "D", + "Ƌ": "D", + "Ɗ": "D", + "Ɖ": "D", + "Ꝺ": "D", + "Ⓔ": "E", + "E": "E", + "È": "E", + "É": "E", + "Ê": "E", + "Ề": "E", + "Ế": "E", + "Ễ": "E", + "Ể": "E", + "Ẽ": "E", + "Ē": "E", + "Ḕ": "E", + "Ḗ": "E", + "Ĕ": "E", + "Ė": "E", + "Ë": "E", + "Ẻ": "E", + "Ě": "E", + "Ȅ": "E", + "Ȇ": "E", + "Ẹ": "E", + "Ệ": "E", + "Ȩ": "E", + "Ḝ": "E", + "Ę": "E", + "Ḙ": "E", + "Ḛ": "E", + "Ɛ": "E", + "Ǝ": "E", + "Ⓕ": "F", + "F": "F", + "Ḟ": "F", + "Ƒ": "F", + "Ꝼ": "F", + "Ⓖ": "G", + "G": "G", + "Ǵ": "G", + "Ĝ": "G", + "Ḡ": "G", + "Ğ": "G", + "Ġ": "G", + "Ǧ": "G", + "Ģ": "G", + "Ǥ": "G", + "Ɠ": "G", + "Ꞡ": "G", + "Ᵹ": "G", + "Ꝿ": "G", + "Ⓗ": "H", + "H": "H", + "Ĥ": "H", + "Ḣ": "H", + "Ḧ": "H", + "Ȟ": "H", + "Ḥ": "H", + "Ḩ": "H", + "Ḫ": "H", + "Ħ": "H", + "Ⱨ": "H", + "Ⱶ": "H", + "Ɥ": "H", + "Ⓘ": "I", + "I": "I", + "Ì": "I", + "Í": "I", + "Î": "I", + "Ĩ": "I", + "Ī": "I", + "Ĭ": "I", + "İ": "I", + "Ï": "I", + "Ḯ": "I", + "Ỉ": "I", + "Ǐ": "I", + "Ȉ": "I", + "Ȋ": "I", + "Ị": "I", + "Į": "I", + "Ḭ": "I", + "Ɨ": "I", + "Ⓙ": "J", + "J": "J", + "Ĵ": "J", + "Ɉ": "J", + "Ⓚ": "K", + "K": "K", + "Ḱ": "K", + "Ǩ": "K", + "Ḳ": "K", + "Ķ": "K", + "Ḵ": "K", + "Ƙ": "K", + "Ⱪ": "K", + "Ꝁ": "K", + "Ꝃ": "K", + "Ꝅ": "K", + "Ꞣ": "K", + "Ⓛ": "L", + "L": "L", + "Ŀ": "L", + "Ĺ": "L", + "Ľ": "L", + "Ḷ": "L", + "Ḹ": "L", + "Ļ": "L", + "Ḽ": "L", + "Ḻ": "L", + "Ł": "L", + "Ƚ": "L", + "Ɫ": "L", + "Ⱡ": "L", + "Ꝉ": "L", + "Ꝇ": "L", + "Ꞁ": "L", + "Ⓜ": "M", + "M": "M", + "Ḿ": "M", + "Ṁ": "M", + "Ṃ": "M", + "Ɱ": "M", + "Ɯ": "M", + "Ⓝ": "N", + "N": "N", + "Ǹ": "N", + "Ń": "N", + "Ñ": "N", + "Ṅ": "N", + "Ň": "N", + "Ṇ": "N", + "Ņ": "N", + "Ṋ": "N", + "Ṉ": "N", + "Ƞ": "N", + "Ɲ": "N", + "Ꞑ": "N", + "Ꞥ": "N", + "Ⓞ": "O", + "O": "O", + "Ò": "O", + "Ó": "O", + "Ô": "O", + "Ồ": "O", + "Ố": "O", + "Ỗ": "O", + "Ổ": "O", + "Õ": "O", + "Ṍ": "O", + "Ȭ": "O", + "Ṏ": "O", + "Ō": "O", + "Ṑ": "O", + "Ṓ": "O", + "Ŏ": "O", + "Ȯ": "O", + "Ȱ": "O", + "Ö": "O", + "Ȫ": "O", + "Ỏ": "O", + "Ő": "O", + "Ǒ": "O", + "Ȍ": "O", + "Ȏ": "O", + "Ơ": "O", + "Ờ": "O", + "Ớ": "O", + "Ỡ": "O", + "Ở": "O", + "Ợ": "O", + "Ọ": "O", + "Ộ": "O", + "Ǫ": "O", + "Ǭ": "O", + "Ø": "O", + "Ǿ": "O", + "Ɔ": "O", + "Ɵ": "O", + "Ꝋ": "O", + "Ꝍ": "O", + "Ⓟ": "P", + "P": "P", + "Ṕ": "P", + "Ṗ": "P", + "Ƥ": "P", + "Ᵽ": "P", + "Ꝑ": "P", + "Ꝓ": "P", + "Ꝕ": "P", + "Ⓠ": "Q", + "Q": "Q", + "Ꝗ": "Q", + "Ꝙ": "Q", + "Ɋ": "Q", + "Ⓡ": "R", + "R": "R", + "Ŕ": "R", + "Ṙ": "R", + "Ř": "R", + "Ȑ": "R", + "Ȓ": "R", + "Ṛ": "R", + "Ṝ": "R", + "Ŗ": "R", + "Ṟ": "R", + "Ɍ": "R", + "Ɽ": "R", + "Ꝛ": "R", + "Ꞧ": "R", + "Ꞃ": "R", + "Ⓢ": "S", + "S": "S", + "ẞ": "S", + "Ś": "S", + "Ṥ": "S", + "Ŝ": "S", + "Ṡ": "S", + "Š": "S", + "Ṧ": "S", + "Ṣ": "S", + "Ṩ": "S", + "Ș": "S", + "Ş": "S", + "Ȿ": "S", + "Ꞩ": "S", + "Ꞅ": "S", + "Ⓣ": "T", + "T": "T", + "Ṫ": "T", + "Ť": "T", + "Ṭ": "T", + "Ț": "T", + "Ţ": "T", + "Ṱ": "T", + "Ṯ": "T", + "Ŧ": "T", + "Ƭ": "T", + "Ʈ": "T", + "Ⱦ": "T", + "Ꞇ": "T", + "Ⓤ": "U", + "U": "U", + "Ù": "U", + "Ú": "U", + "Û": "U", + "Ũ": "U", + "Ṹ": "U", + "Ū": "U", + "Ṻ": "U", + "Ŭ": "U", + "Ü": "U", + "Ǜ": "U", + "Ǘ": "U", + "Ǖ": "U", + "Ǚ": "U", + "Ủ": "U", + "Ů": "U", + "Ű": "U", + "Ǔ": "U", + "Ȕ": "U", + "Ȗ": "U", + "Ư": "U", + "Ừ": "U", + "Ứ": "U", + "Ữ": "U", + "Ử": "U", + "Ự": "U", + "Ụ": "U", + "Ṳ": "U", + "Ų": "U", + "Ṷ": "U", + "Ṵ": "U", + "Ʉ": "U", + "Ⓥ": "V", + "V": "V", + "Ṽ": "V", + "Ṿ": "V", + "Ʋ": "V", + "Ꝟ": "V", + "Ʌ": "V", + "Ⓦ": "W", + "W": "W", + "Ẁ": "W", + "Ẃ": "W", + "Ŵ": "W", + "Ẇ": "W", + "Ẅ": "W", + "Ẉ": "W", + "Ⱳ": "W", + "Ⓧ": "X", + "X": "X", + "Ẋ": "X", + "Ẍ": "X", + "Ⓨ": "Y", + "Y": "Y", + "Ỳ": "Y", + "Ý": "Y", + "Ŷ": "Y", + "Ỹ": "Y", + "Ȳ": "Y", + "Ẏ": "Y", + "Ÿ": "Y", + "Ỷ": "Y", + "Ỵ": "Y", + "Ƴ": "Y", + "Ɏ": "Y", + "Ỿ": "Y", + "Ⓩ": "Z", + "Z": "Z", + "Ź": "Z", + "Ẑ": "Z", + "Ż": "Z", + "Ž": "Z", + "Ẓ": "Z", + "Ẕ": "Z", + "Ƶ": "Z", + "Ȥ": "Z", + "Ɀ": "Z", + "Ⱬ": "Z", + "Ꝣ": "Z", + "ⓐ": "a", + "a": "a", + "ẚ": "a", + "à": "a", + "á": "a", + "â": "a", + "ầ": "a", + "ấ": "a", + "ẫ": "a", + "ẩ": "a", + "ã": "a", + "ā": "a", + "ă": "a", + "ằ": "a", + "ắ": "a", + "ẵ": "a", + "ẳ": "a", + "ȧ": "a", + "ǡ": "a", + "ä": "a", + "ǟ": "a", + "ả": "a", + "å": "a", + "ǻ": "a", + "ǎ": "a", + "ȁ": "a", + "ȃ": "a", + "ạ": "a", + "ậ": "a", + "ặ": "a", + "ḁ": "a", + "ą": "a", + "ⱥ": "a", + "ɐ": "a", + "ⓑ": "b", + "b": "b", + "ḃ": "b", + "ḅ": "b", + "ḇ": "b", + "ƀ": "b", + "ƃ": "b", + "ɓ": "b", + "ⓒ": "c", + "c": "c", + "ć": "c", + "ĉ": "c", + "ċ": "c", + "č": "c", + "ç": "c", + "ḉ": "c", + "ƈ": "c", + "ȼ": "c", + "ꜿ": "c", + "ↄ": "c", + "ⓓ": "d", + "d": "d", + "ḋ": "d", + "ď": "d", + "ḍ": "d", + "ḑ": "d", + "ḓ": "d", + "ḏ": "d", + "đ": "d", + "ƌ": "d", + "ɖ": "d", + "ɗ": "d", + "ꝺ": "d", + "ⓔ": "e", + "e": "e", + "è": "e", + "é": "e", + "ê": "e", + "ề": "e", + "ế": "e", + "ễ": "e", + "ể": "e", + "ẽ": "e", + "ē": "e", + "ḕ": "e", + "ḗ": "e", + "ĕ": "e", + "ė": "e", + "ë": "e", + "ẻ": "e", + "ě": "e", + "ȅ": "e", + "ȇ": "e", + "ẹ": "e", + "ệ": "e", + "ȩ": "e", + "ḝ": "e", + "ę": "e", + "ḙ": "e", + "ḛ": "e", + "ɇ": "e", + "ɛ": "e", + "ǝ": "e", + "ⓕ": "f", + "f": "f", + "ḟ": "f", + "ƒ": "f", + "ꝼ": "f", + "ⓖ": "g", + "g": "g", + "ǵ": "g", + "ĝ": "g", + "ḡ": "g", + "ğ": "g", + "ġ": "g", + "ǧ": "g", + "ģ": "g", + "ǥ": "g", + "ɠ": "g", + "ꞡ": "g", + "ᵹ": "g", + "ꝿ": "g", + "ⓗ": "h", + "h": "h", + "ĥ": "h", + "ḣ": "h", + "ḧ": "h", + "ȟ": "h", + "ḥ": "h", + "ḩ": "h", + "ḫ": "h", + "ẖ": "h", + "ħ": "h", + "ⱨ": "h", + "ⱶ": "h", + "ɥ": "h", + "ⓘ": "i", + "i": "i", + "ì": "i", + "í": "i", + "î": "i", + "ĩ": "i", + "ī": "i", + "ĭ": "i", + "ï": "i", + "ḯ": "i", + "ỉ": "i", + "ǐ": "i", + "ȉ": "i", + "ȋ": "i", + "ị": "i", + "į": "i", + "ḭ": "i", + "ɨ": "i", + "ı": "i", + "ⓙ": "j", + "j": "j", + "ĵ": "j", + "ǰ": "j", + "ɉ": "j", + "ⓚ": "k", + "k": "k", + "ḱ": "k", + "ǩ": "k", + "ḳ": "k", + "ķ": "k", + "ḵ": "k", + "ƙ": "k", + "ⱪ": "k", + "ꝁ": "k", + "ꝃ": "k", + "ꝅ": "k", + "ꞣ": "k", + "ⓛ": "l", + "l": "l", + "ŀ": "l", + "ĺ": "l", + "ľ": "l", + "ḷ": "l", + "ḹ": "l", + "ļ": "l", + "ḽ": "l", + "ḻ": "l", + "ſ": "l", + "ł": "l", + "ƚ": "l", + "ɫ": "l", + "ⱡ": "l", + "ꝉ": "l", + "ꞁ": "l", + "ꝇ": "l", + "ⓜ": "m", + "m": "m", + "ḿ": "m", + "ṁ": "m", + "ṃ": "m", + "ɱ": "m", + "ɯ": "m", + "ⓝ": "n", + "n": "n", + "ǹ": "n", + "ń": "n", + "ñ": "n", + "ṅ": "n", + "ň": "n", + "ṇ": "n", + "ņ": "n", + "ṋ": "n", + "ṉ": "n", + "ƞ": "n", + "ɲ": "n", + "ʼn": "n", + "ꞑ": "n", + "ꞥ": "n", + "ⓞ": "o", + "o": "o", + "ò": "o", + "ó": "o", + "ô": "o", + "ồ": "o", + "ố": "o", + "ỗ": "o", + "ổ": "o", + "õ": "o", + "ṍ": "o", + "ȭ": "o", + "ṏ": "o", + "ō": "o", + "ṑ": "o", + "ṓ": "o", + "ŏ": "o", + "ȯ": "o", + "ȱ": "o", + "ö": "o", + "ȫ": "o", + "ỏ": "o", + "ő": "o", + "ǒ": "o", + "ȍ": "o", + "ȏ": "o", + "ơ": "o", + "ờ": "o", + "ớ": "o", + "ỡ": "o", + "ở": "o", + "ợ": "o", + "ọ": "o", + "ộ": "o", + "ǫ": "o", + "ǭ": "o", + "ø": "o", + "ǿ": "o", + "ɔ": "o", + "ꝋ": "o", + "ꝍ": "o", + "ɵ": "o", + "ⓟ": "p", + "p": "p", + "ṕ": "p", + "ṗ": "p", + "ƥ": "p", + "ᵽ": "p", + "ꝑ": "p", + "ꝓ": "p", + "ꝕ": "p", + "ⓠ": "q", + "q": "q", + "ɋ": "q", + "ꝗ": "q", + "ꝙ": "q", + "ⓡ": "r", + "r": "r", + "ŕ": "r", + "ṙ": "r", + "ř": "r", + "ȑ": "r", + "ȓ": "r", + "ṛ": "r", + "ṝ": "r", + "ŗ": "r", + "ṟ": "r", + "ɍ": "r", + "ɽ": "r", + "ꝛ": "r", + "ꞧ": "r", + "ꞃ": "r", + "ⓢ": "s", + "s": "s", + "ß": "s", + "ś": "s", + "ṥ": "s", + "ŝ": "s", + "ṡ": "s", + "š": "s", + "ṧ": "s", + "ṣ": "s", + "ṩ": "s", + "ș": "s", + "ş": "s", + "ȿ": "s", + "ꞩ": "s", + "ꞅ": "s", + "ẛ": "s", + "ⓣ": "t", + "t": "t", + "ṫ": "t", + "ẗ": "t", + "ť": "t", + "ṭ": "t", + "ț": "t", + "ţ": "t", + "ṱ": "t", + "ṯ": "t", + "ŧ": "t", + "ƭ": "t", + "ʈ": "t", + "ⱦ": "t", + "ꞇ": "t", + "ⓤ": "u", + "u": "u", + "ù": "u", + "ú": "u", + "û": "u", + "ũ": "u", + "ṹ": "u", + "ū": "u", + "ṻ": "u", + "ŭ": "u", + "ü": "u", + "ǜ": "u", + "ǘ": "u", + "ǖ": "u", + "ǚ": "u", + "ủ": "u", + "ů": "u", + "ű": "u", + "ǔ": "u", + "ȕ": "u", + "ȗ": "u", + "ư": "u", + "ừ": "u", + "ứ": "u", + "ữ": "u", + "ử": "u", + "ự": "u", + "ụ": "u", + "ṳ": "u", + "ų": "u", + "ṷ": "u", + "ṵ": "u", + "ʉ": "u", + "ⓥ": "v", + "v": "v", + "ṽ": "v", + "ṿ": "v", + "ʋ": "v", + "ꝟ": "v", + "ʌ": "v", + "ⓦ": "w", + "w": "w", + "ẁ": "w", + "ẃ": "w", + "ŵ": "w", + "ẇ": "w", + "ẅ": "w", + "ẘ": "w", + "ẉ": "w", + "ⱳ": "w", + "ⓧ": "x", + "x": "x", + "ẋ": "x", + "ẍ": "x", + "ⓨ": "y", + "y": "y", + "ỳ": "y", + "ý": "y", + "ŷ": "y", + "ỹ": "y", + "ȳ": "y", + "ẏ": "y", + "ÿ": "y", + "ỷ": "y", + "ẙ": "y", + "ỵ": "y", + "ƴ": "y", + "ɏ": "y", + "ỿ": "y", + "ⓩ": "z", + "z": "z", + "ź": "z", + "ẑ": "z", + "ż": "z", + "ž": "z", + "ẓ": "z", + "ẕ": "z", + "ƶ": "z", + "ȥ": "z", + "ɀ": "z", + "ⱬ": "z", + "ꝣ": "z" +}; +exports.StringUtility = StringUtility; + +}); + +unwrapExports(utilities); + +var models = createCommonjsModule(function (module, exports) { +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); + + +class ModelResult { +} +exports.ModelResult = ModelResult; +class ExtendedModelResult extends ModelResult { + constructor(source = null) { + super(); + if (source) { + this.text = source.text; + this.start = source.start; + this.end = source.end; + this.typeName = source.typeName; + this.resolution = source.resolution; + } + } +} +exports.ExtendedModelResult = ExtendedModelResult; +class ModelFactoryKey { + constructor(culture$$1, modelType, options = null) { + this.culture = culture$$1 ? culture$$1.toLowerCase() : null; + this.modelType = modelType; + this.options = options; + } + toString() { + return JSON.stringify(this); + } + static fromString(key) { + return JSON.parse(key); + } +} +class ModelFactory { + constructor() { + this.modelFactories = new Map(); + } + getModel(modelTypeName, culture$$1, fallbackToDefaultCulture, options) { + let result = this.tryGetModel(modelTypeName, culture$$1, options); + if (!result.containsModel && fallbackToDefaultCulture) { + result = this.tryGetModel(modelTypeName, ModelFactory.fallbackCulture, options); + } + if (result.containsModel) { + return result.model; + } + throw new Error(`Could not find Model with the specified configuration: ${culture$$1},${modelTypeName}`); + } + tryGetModel(modelTypeName, culture$$1, options) { + culture$$1 = culture.Culture.mapToNearestLanguage(culture$$1); + let cacheResult = this.getModelFromCache(modelTypeName, culture$$1, options); + if (cacheResult) + return { containsModel: true, model: cacheResult }; + let key = this.generateKey(modelTypeName, culture$$1); + if (this.modelFactories.has(key)) { + let model = this.modelFactories.get(key)(options); + this.registerModelInCache(modelTypeName, culture$$1, options, model); + return { containsModel: true, model: model }; + } + return { containsModel: false }; + } + registerModel(modelTypeName, culture$$1, modelCreator) { + let key = this.generateKey(modelTypeName, culture$$1); + if (this.modelFactories.has(key)) { + throw new Error(`${culture$$1}-${modelTypeName} has already been registered.`); + } + this.modelFactories.set(key, modelCreator); + } + initializeModels(targetCulture, options) { + this.modelFactories.forEach((value, key) => { + let modelFactoryKey = ModelFactoryKey.fromString(key); + if (utilities.StringUtility.isNullOrEmpty(targetCulture) || modelFactoryKey.culture === targetCulture) { + this.tryGetModel(modelFactoryKey.modelType, modelFactoryKey.culture, modelFactoryKey.options); + } + }); + } + generateKey(modelTypeName, culture$$1) { + return new ModelFactoryKey(culture$$1, modelTypeName).toString(); + } + getModelFromCache(modelTypeName, culture$$1, options) { + let key = this.generateCacheKey(modelTypeName, culture$$1, options); + return ModelFactory.cache.get(key); + } + registerModelInCache(modelTypeName, culture$$1, options, model) { + let key = this.generateCacheKey(modelTypeName, culture$$1, options); + ModelFactory.cache.set(key, model); + } + generateCacheKey(modelTypeName, culture$$1, options) { + return new ModelFactoryKey(culture$$1, modelTypeName, options).toString(); + } +} +ModelFactory.fallbackCulture = culture.Culture.English; +ModelFactory.cache = new Map(); +exports.ModelFactory = ModelFactory; + +}); + +unwrapExports(models); + +var recognizer = createCommonjsModule(function (module, exports) { +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); + +class Recognizer { + constructor(targetCulture, options, lazyInitialization) { + this.modelFactory = new models.ModelFactory(); + if (!this.IsValidOptions(options)) + throw new Error(`${options} is not a valid options value.`); + this.TargetCulture = targetCulture; + this.Options = options; + this.InitializeConfiguration(); + if (!lazyInitialization) { + this.initializeModels(targetCulture, options); + } + } + getModel(modelTypeName, culture, fallbackToDefaultCulture) { + return this.modelFactory.getModel(modelTypeName, culture || this.TargetCulture, fallbackToDefaultCulture, this.Options); + } + registerModel(modelTypeName, culture, modelCreator) { + this.modelFactory.registerModel(modelTypeName, culture, modelCreator); + } + initializeModels(targetCulture, options) { + this.modelFactory.initializeModels(targetCulture, options); + } +} +exports.Recognizer = Recognizer; + +}); + +unwrapExports(recognizer); + +var extractors = createCommonjsModule(function (module, exports) { +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +class ExtractResult { + static isOverlap(erA, erB) { + return !(erA.start >= erB.start + erB.length) && !(erB.start >= erA.start + erA.length); + } + static isCover(er1, er2) { + return ((er2.start < er1.start) && ((er2.start + er2.length) >= (er1.start + er1.length))) + || ((er2.start <= er1.start) && ((er2.start + er2.length) > (er1.start + er1.length))); + } + static getFromText(source) { + return { + start: 0, + length: source.length, + text: source, + type: 'custom' + }; + } +} +exports.ExtractResult = ExtractResult; + +}); + +unwrapExports(extractors); + +var parsers = createCommonjsModule(function (module, exports) { +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); + +class ParseResult extends extractors.ExtractResult { + constructor(er) { + super(); + if (er) { + this.length = er.length; + this.start = er.start; + this.data = er.data; + this.text = er.text; + this.type = er.type; + } + this.resolutionStr = ""; + } +} +exports.ParseResult = ParseResult; + +}); + +unwrapExports(parsers); + +var recognizersText = createCommonjsModule(function (module, exports) { +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); + +exports.Culture = culture.Culture; +exports.CultureInfo = culture.CultureInfo; + +exports.ModelResult = models.ModelResult; +exports.ModelFactory = models.ModelFactory; + +exports.Recognizer = recognizer.Recognizer; + +exports.ExtractResult = extractors.ExtractResult; + +exports.ParseResult = parsers.ParseResult; + +exports.FormatUtility = utilities.FormatUtility; +exports.StringUtility = utilities.StringUtility; +exports.Match = utilities.Match; +exports.RegExpUtility = utilities.RegExpUtility; + +}); + +unwrapExports(recognizersText); + +var models$2 = createCommonjsModule(function (module, exports) { +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +class ChoiceModel { + constructor(parser, extractor) { + this.extractor = extractor; + this.parser = parser; + } + parse(source) { + let extractResults = this.extractor.extract(source); + let parseResults = extractResults.map(r => this.parser.parse(r)); + return parseResults + .map(o => o) + .map(o => ({ + start: o.start, + end: o.start + o.length - 1, + resolution: this.getResolution(o), + text: o.text, + typeName: this.modelTypeName + })); + } +} +exports.ChoiceModel = ChoiceModel; +class BooleanModel extends ChoiceModel { + constructor() { + super(...arguments); + this.modelTypeName = 'boolean'; + } + getResolution(sources) { + let results = { + value: sources.value, + score: sources.data.score + }; + if (sources.data.otherMatches) { + results.otherResults = sources.data.otherMatches.map(o => ({ + text: o.text, + value: o.value, + score: o.data.score + })); + } + return results; + } +} +exports.BooleanModel = BooleanModel; + +}); + +unwrapExports(models$2); + +var constants = createCommonjsModule(function (module, exports) { +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +class Constants { +} +Constants.SYS_BOOLEAN = "boolean"; +Constants.SYS_BOOLEAN_TRUE = "boolean-true"; +Constants.SYS_BOOLEAN_FALSE = "boolean-false"; +exports.Constants = Constants; + +}); + +unwrapExports(constants); + +/* +Breaks a Javascript string into individual user-perceived "characters" +called extended grapheme clusters by implementing the Unicode UAX-29 standard, version 10.0.0 + +Usage: +var splitter = new GraphemeSplitter(); +//returns an array of strings, one string for each grapheme cluster +var graphemes = splitter.splitGraphemes(string); + +*/ +function GraphemeSplitter(){ + var CR = 0, + LF = 1, + Control = 2, + Extend = 3, + Regional_Indicator = 4, + SpacingMark = 5, + L = 6, + V = 7, + T = 8, + LV = 9, + LVT = 10, + Other = 11, + Prepend = 12, + E_Base = 13, + E_Modifier = 14, + ZWJ = 15, + Glue_After_Zwj = 16, + E_Base_GAZ = 17; + + // BreakTypes + var NotBreak = 0, + BreakStart = 1, + Break = 2, + BreakLastRegional = 3, + BreakPenultimateRegional = 4; + + function isSurrogate(str, pos) { + return 0xd800 <= str.charCodeAt(pos) && str.charCodeAt(pos) <= 0xdbff && + 0xdc00 <= str.charCodeAt(pos + 1) && str.charCodeAt(pos + 1) <= 0xdfff; + } + + // Private function, gets a Unicode code point from a JavaScript UTF-16 string + // handling surrogate pairs appropriately + function codePointAt(str, idx){ + if(idx === undefined){ + idx = 0; + } + var code = str.charCodeAt(idx); + + // if a high surrogate + if (0xD800 <= code && code <= 0xDBFF && + idx < str.length - 1){ + var hi = code; + var low = str.charCodeAt(idx + 1); + if (0xDC00 <= low && low <= 0xDFFF){ + return ((hi - 0xD800) * 0x400) + (low - 0xDC00) + 0x10000; + } + return hi; + } + + // if a low surrogate + if (0xDC00 <= code && code <= 0xDFFF && + idx >= 1){ + var hi = str.charCodeAt(idx - 1); + var low = code; + if (0xD800 <= hi && hi <= 0xDBFF){ + return ((hi - 0xD800) * 0x400) + (low - 0xDC00) + 0x10000; + } + return low; + } + + //just return the char if an unmatched surrogate half or a + //single-char codepoint + return code; + } + + // Private function, returns whether a break is allowed between the + // two given grapheme breaking classes + function shouldBreak(start, mid, end){ + var all = [start].concat(mid).concat([end]); + var previous = all[all.length - 2]; + var next = end; + + // Lookahead termintor for: + // GB10. (E_Base | EBG) Extend* ? E_Modifier + var eModifierIndex = all.lastIndexOf(E_Modifier); + if(eModifierIndex > 1 && + all.slice(1, eModifierIndex).every(function(c){return c == Extend}) && + [Extend, E_Base, E_Base_GAZ].indexOf(start) == -1){ + return Break + } + + // Lookahead termintor for: + // GB12. ^ (RI RI)* RI ? RI + // GB13. [^RI] (RI RI)* RI ? RI + var rIIndex = all.lastIndexOf(Regional_Indicator); + if(rIIndex > 0 && + all.slice(1, rIIndex).every(function(c){return c == Regional_Indicator}) && + [Prepend, Regional_Indicator].indexOf(previous) == -1) { + if(all.filter(function(c){return c == Regional_Indicator}).length % 2 == 1) { + return BreakLastRegional + } + else { + return BreakPenultimateRegional + } + } + + // GB3. CR X LF + if(previous == CR && next == LF){ + return NotBreak; + } + // GB4. (Control|CR|LF) ÷ + else if(previous == Control || previous == CR || previous == LF){ + if(next == E_Modifier && mid.every(function(c){return c == Extend})){ + return Break + } + else { + return BreakStart + } + } + // GB5. ÷ (Control|CR|LF) + else if(next == Control || next == CR || next == LF){ + return BreakStart; + } + // GB6. L X (L|V|LV|LVT) + else if(previous == L && + (next == L || next == V || next == LV || next == LVT)){ + return NotBreak; + } + // GB7. (LV|V) X (V|T) + else if((previous == LV || previous == V) && + (next == V || next == T)){ + return NotBreak; + } + // GB8. (LVT|T) X (T) + else if((previous == LVT || previous == T) && + next == T){ + return NotBreak; + } + // GB9. X (Extend|ZWJ) + else if (next == Extend || next == ZWJ){ + return NotBreak; + } + // GB9a. X SpacingMark + else if(next == SpacingMark){ + return NotBreak; + } + // GB9b. Prepend X + else if (previous == Prepend){ + return NotBreak; + } + + // GB10. (E_Base | EBG) Extend* ? E_Modifier + var previousNonExtendIndex = all.indexOf(Extend) != -1 ? all.lastIndexOf(Extend) - 1 : all.length - 2; + if([E_Base, E_Base_GAZ].indexOf(all[previousNonExtendIndex]) != -1 && + all.slice(previousNonExtendIndex + 1, -1).every(function(c){return c == Extend}) && + next == E_Modifier){ + return NotBreak; + } + + // GB11. ZWJ ? (Glue_After_Zwj | EBG) + if(previous == ZWJ && [Glue_After_Zwj, E_Base_GAZ].indexOf(next) != -1) { + return NotBreak; + } + + // GB12. ^ (RI RI)* RI ? RI + // GB13. [^RI] (RI RI)* RI ? RI + if(mid.indexOf(Regional_Indicator) != -1) { + return Break; + } + if(previous == Regional_Indicator && next == Regional_Indicator) { + return NotBreak; + } + + // GB999. Any ? Any + return BreakStart; + } + + // Returns the next grapheme break in the string after the given index + this.nextBreak = function(string, index){ + if(index === undefined){ + index = 0; + } + if(index < 0){ + return 0; + } + if(index >= string.length - 1){ + return string.length; + } + var prev = getGraphemeBreakProperty(codePointAt(string, index)); + var mid = []; + for (var i = index + 1; i < string.length; i++) { + // check for already processed low surrogates + if(isSurrogate(string, i - 1)){ + continue; + } + + var next = getGraphemeBreakProperty(codePointAt(string, i)); + if(shouldBreak(prev, mid, next)){ + return i; + } + + mid.push(next); + } + return string.length; + }; + + // Breaks the given string into an array of grapheme cluster strings + this.splitGraphemes = function(str){ + var res = []; + var index = 0; + var brk; + while((brk = this.nextBreak(str, index)) < str.length){ + res.push(str.slice(index, brk)); + index = brk; + } + if(index < str.length){ + res.push(str.slice(index)); + } + return res; + }; + + // Returns the number of grapheme clusters there are in the given string + this.countGraphemes = function(str){ + var count = 0; + var index = 0; + var brk; + while((brk = this.nextBreak(str, index)) < str.length){ + index = brk; + count++; + } + if(index < str.length){ + count++; + } + return count; + }; + + //given a Unicode code point, determines this symbol's grapheme break property + function getGraphemeBreakProperty(code){ + + //grapheme break property for Unicode 10.0.0, + //taken from http://www.unicode.org/Public/10.0.0/ucd/auxiliary/GraphemeBreakProperty.txt + //and adapted to JavaScript rules + + if( + (0x0600 <= code && code <= 0x0605) || // Cf [6] ARABIC NUMBER SIGN..ARABIC NUMBER MARK ABOVE + 0x06DD == code || // Cf ARABIC END OF AYAH + 0x070F == code || // Cf SYRIAC ABBREVIATION MARK + 0x08E2 == code || // Cf ARABIC DISPUTED END OF AYAH + 0x0D4E == code || // Lo MALAYALAM LETTER DOT REPH + 0x110BD == code || // Cf KAITHI NUMBER SIGN + (0x111C2 <= code && code <= 0x111C3) || // Lo [2] SHARADA SIGN JIHVAMULIYA..SHARADA SIGN UPADHMANIYA + 0x11A3A == code || // Lo ZANABAZAR SQUARE CLUSTER-INITIAL LETTER RA + (0x11A86 <= code && code <= 0x11A89) || // Lo [4] SOYOMBO CLUSTER-INITIAL LETTER RA..SOYOMBO CLUSTER-INITIAL LETTER SA + 0x11D46 == code // Lo MASARAM GONDI REPHA + ){ + return Prepend; + } + if( + 0x000D == code // Cc + ){ + return CR; + } + + if( + 0x000A == code // Cc + ){ + return LF; + } + + + if( + (0x0000 <= code && code <= 0x0009) || // Cc [10] .. + (0x000B <= code && code <= 0x000C) || // Cc [2] .. + (0x000E <= code && code <= 0x001F) || // Cc [18] .. + (0x007F <= code && code <= 0x009F) || // Cc [33] .. + 0x00AD == code || // Cf SOFT HYPHEN + 0x061C == code || // Cf ARABIC LETTER MARK + + 0x180E == code || // Cf MONGOLIAN VOWEL SEPARATOR + 0x200B == code || // Cf ZERO WIDTH SPACE + (0x200E <= code && code <= 0x200F) || // Cf [2] LEFT-TO-RIGHT MARK..RIGHT-TO-LEFT MARK + 0x2028 == code || // Zl LINE SEPARATOR + 0x2029 == code || // Zp PARAGRAPH SEPARATOR + (0x202A <= code && code <= 0x202E) || // Cf [5] LEFT-TO-RIGHT EMBEDDING..RIGHT-TO-LEFT OVERRIDE + (0x2060 <= code && code <= 0x2064) || // Cf [5] WORD JOINER..INVISIBLE PLUS + 0x2065 == code || // Cn + (0x2066 <= code && code <= 0x206F) || // Cf [10] LEFT-TO-RIGHT ISOLATE..NOMINAL DIGIT SHAPES + (0xD800 <= code && code <= 0xDFFF) || // Cs [2048] .. + 0xFEFF == code || // Cf ZERO WIDTH NO-BREAK SPACE + (0xFFF0 <= code && code <= 0xFFF8) || // Cn [9] .. + (0xFFF9 <= code && code <= 0xFFFB) || // Cf [3] INTERLINEAR ANNOTATION ANCHOR..INTERLINEAR ANNOTATION TERMINATOR + (0x1BCA0 <= code && code <= 0x1BCA3) || // Cf [4] SHORTHAND FORMAT LETTER OVERLAP..SHORTHAND FORMAT UP STEP + (0x1D173 <= code && code <= 0x1D17A) || // Cf [8] MUSICAL SYMBOL BEGIN BEAM..MUSICAL SYMBOL END PHRASE + 0xE0000 == code || // Cn + 0xE0001 == code || // Cf LANGUAGE TAG + (0xE0002 <= code && code <= 0xE001F) || // Cn [30] .. + (0xE0080 <= code && code <= 0xE00FF) || // Cn [128] .. + (0xE01F0 <= code && code <= 0xE0FFF) // Cn [3600] .. + ){ + return Control; + } + + + if( + (0x0300 <= code && code <= 0x036F) || // Mn [112] COMBINING GRAVE ACCENT..COMBINING LATIN SMALL LETTER X + (0x0483 <= code && code <= 0x0487) || // Mn [5] COMBINING CYRILLIC TITLO..COMBINING CYRILLIC POKRYTIE + (0x0488 <= code && code <= 0x0489) || // Me [2] COMBINING CYRILLIC HUNDRED THOUSANDS SIGN..COMBINING CYRILLIC MILLIONS SIGN + (0x0591 <= code && code <= 0x05BD) || // Mn [45] HEBREW ACCENT ETNAHTA..HEBREW POINT METEG + 0x05BF == code || // Mn HEBREW POINT RAFE + (0x05C1 <= code && code <= 0x05C2) || // Mn [2] HEBREW POINT SHIN DOT..HEBREW POINT SIN DOT + (0x05C4 <= code && code <= 0x05C5) || // Mn [2] HEBREW MARK UPPER DOT..HEBREW MARK LOWER DOT + 0x05C7 == code || // Mn HEBREW POINT QAMATS QATAN + (0x0610 <= code && code <= 0x061A) || // Mn [11] ARABIC SIGN SALLALLAHOU ALAYHE WASSALLAM..ARABIC SMALL KASRA + (0x064B <= code && code <= 0x065F) || // Mn [21] ARABIC FATHATAN..ARABIC WAVY HAMZA BELOW + 0x0670 == code || // Mn ARABIC LETTER SUPERSCRIPT ALEF + (0x06D6 <= code && code <= 0x06DC) || // Mn [7] ARABIC SMALL HIGH LIGATURE SAD WITH LAM WITH ALEF MAKSURA..ARABIC SMALL HIGH SEEN + (0x06DF <= code && code <= 0x06E4) || // Mn [6] ARABIC SMALL HIGH ROUNDED ZERO..ARABIC SMALL HIGH MADDA + (0x06E7 <= code && code <= 0x06E8) || // Mn [2] ARABIC SMALL HIGH YEH..ARABIC SMALL HIGH NOON + (0x06EA <= code && code <= 0x06ED) || // Mn [4] ARABIC EMPTY CENTRE LOW STOP..ARABIC SMALL LOW MEEM + 0x0711 == code || // Mn SYRIAC LETTER SUPERSCRIPT ALAPH + (0x0730 <= code && code <= 0x074A) || // Mn [27] SYRIAC PTHAHA ABOVE..SYRIAC BARREKH + (0x07A6 <= code && code <= 0x07B0) || // Mn [11] THAANA ABAFILI..THAANA SUKUN + (0x07EB <= code && code <= 0x07F3) || // Mn [9] NKO COMBINING SHORT HIGH TONE..NKO COMBINING DOUBLE DOT ABOVE + (0x0816 <= code && code <= 0x0819) || // Mn [4] SAMARITAN MARK IN..SAMARITAN MARK DAGESH + (0x081B <= code && code <= 0x0823) || // Mn [9] SAMARITAN MARK EPENTHETIC YUT..SAMARITAN VOWEL SIGN A + (0x0825 <= code && code <= 0x0827) || // Mn [3] SAMARITAN VOWEL SIGN SHORT A..SAMARITAN VOWEL SIGN U + (0x0829 <= code && code <= 0x082D) || // Mn [5] SAMARITAN VOWEL SIGN LONG I..SAMARITAN MARK NEQUDAA + (0x0859 <= code && code <= 0x085B) || // Mn [3] MANDAIC AFFRICATION MARK..MANDAIC GEMINATION MARK + (0x08D4 <= code && code <= 0x08E1) || // Mn [14] ARABIC SMALL HIGH WORD AR-RUB..ARABIC SMALL HIGH SIGN SAFHA + (0x08E3 <= code && code <= 0x0902) || // Mn [32] ARABIC TURNED DAMMA BELOW..DEVANAGARI SIGN ANUSVARA + 0x093A == code || // Mn DEVANAGARI VOWEL SIGN OE + 0x093C == code || // Mn DEVANAGARI SIGN NUKTA + (0x0941 <= code && code <= 0x0948) || // Mn [8] DEVANAGARI VOWEL SIGN U..DEVANAGARI VOWEL SIGN AI + 0x094D == code || // Mn DEVANAGARI SIGN VIRAMA + (0x0951 <= code && code <= 0x0957) || // Mn [7] DEVANAGARI STRESS SIGN UDATTA..DEVANAGARI VOWEL SIGN UUE + (0x0962 <= code && code <= 0x0963) || // Mn [2] DEVANAGARI VOWEL SIGN VOCALIC L..DEVANAGARI VOWEL SIGN VOCALIC LL + 0x0981 == code || // Mn BENGALI SIGN CANDRABINDU + 0x09BC == code || // Mn BENGALI SIGN NUKTA + 0x09BE == code || // Mc BENGALI VOWEL SIGN AA + (0x09C1 <= code && code <= 0x09C4) || // Mn [4] BENGALI VOWEL SIGN U..BENGALI VOWEL SIGN VOCALIC RR + 0x09CD == code || // Mn BENGALI SIGN VIRAMA + 0x09D7 == code || // Mc BENGALI AU LENGTH MARK + (0x09E2 <= code && code <= 0x09E3) || // Mn [2] BENGALI VOWEL SIGN VOCALIC L..BENGALI VOWEL SIGN VOCALIC LL + (0x0A01 <= code && code <= 0x0A02) || // Mn [2] GURMUKHI SIGN ADAK BINDI..GURMUKHI SIGN BINDI + 0x0A3C == code || // Mn GURMUKHI SIGN NUKTA + (0x0A41 <= code && code <= 0x0A42) || // Mn [2] GURMUKHI VOWEL SIGN U..GURMUKHI VOWEL SIGN UU + (0x0A47 <= code && code <= 0x0A48) || // Mn [2] GURMUKHI VOWEL SIGN EE..GURMUKHI VOWEL SIGN AI + (0x0A4B <= code && code <= 0x0A4D) || // Mn [3] GURMUKHI VOWEL SIGN OO..GURMUKHI SIGN VIRAMA + 0x0A51 == code || // Mn GURMUKHI SIGN UDAAT + (0x0A70 <= code && code <= 0x0A71) || // Mn [2] GURMUKHI TIPPI..GURMUKHI ADDAK + 0x0A75 == code || // Mn GURMUKHI SIGN YAKASH + (0x0A81 <= code && code <= 0x0A82) || // Mn [2] GUJARATI SIGN CANDRABINDU..GUJARATI SIGN ANUSVARA + 0x0ABC == code || // Mn GUJARATI SIGN NUKTA + (0x0AC1 <= code && code <= 0x0AC5) || // Mn [5] GUJARATI VOWEL SIGN U..GUJARATI VOWEL SIGN CANDRA E + (0x0AC7 <= code && code <= 0x0AC8) || // Mn [2] GUJARATI VOWEL SIGN E..GUJARATI VOWEL SIGN AI + 0x0ACD == code || // Mn GUJARATI SIGN VIRAMA + (0x0AE2 <= code && code <= 0x0AE3) || // Mn [2] GUJARATI VOWEL SIGN VOCALIC L..GUJARATI VOWEL SIGN VOCALIC LL + (0x0AFA <= code && code <= 0x0AFF) || // Mn [6] GUJARATI SIGN SUKUN..GUJARATI SIGN TWO-CIRCLE NUKTA ABOVE + 0x0B01 == code || // Mn ORIYA SIGN CANDRABINDU + 0x0B3C == code || // Mn ORIYA SIGN NUKTA + 0x0B3E == code || // Mc ORIYA VOWEL SIGN AA + 0x0B3F == code || // Mn ORIYA VOWEL SIGN I + (0x0B41 <= code && code <= 0x0B44) || // Mn [4] ORIYA VOWEL SIGN U..ORIYA VOWEL SIGN VOCALIC RR + 0x0B4D == code || // Mn ORIYA SIGN VIRAMA + 0x0B56 == code || // Mn ORIYA AI LENGTH MARK + 0x0B57 == code || // Mc ORIYA AU LENGTH MARK + (0x0B62 <= code && code <= 0x0B63) || // Mn [2] ORIYA VOWEL SIGN VOCALIC L..ORIYA VOWEL SIGN VOCALIC LL + 0x0B82 == code || // Mn TAMIL SIGN ANUSVARA + 0x0BBE == code || // Mc TAMIL VOWEL SIGN AA + 0x0BC0 == code || // Mn TAMIL VOWEL SIGN II + 0x0BCD == code || // Mn TAMIL SIGN VIRAMA + 0x0BD7 == code || // Mc TAMIL AU LENGTH MARK + 0x0C00 == code || // Mn TELUGU SIGN COMBINING CANDRABINDU ABOVE + (0x0C3E <= code && code <= 0x0C40) || // Mn [3] TELUGU VOWEL SIGN AA..TELUGU VOWEL SIGN II + (0x0C46 <= code && code <= 0x0C48) || // Mn [3] TELUGU VOWEL SIGN E..TELUGU VOWEL SIGN AI + (0x0C4A <= code && code <= 0x0C4D) || // Mn [4] TELUGU VOWEL SIGN O..TELUGU SIGN VIRAMA + (0x0C55 <= code && code <= 0x0C56) || // Mn [2] TELUGU LENGTH MARK..TELUGU AI LENGTH MARK + (0x0C62 <= code && code <= 0x0C63) || // Mn [2] TELUGU VOWEL SIGN VOCALIC L..TELUGU VOWEL SIGN VOCALIC LL + 0x0C81 == code || // Mn KANNADA SIGN CANDRABINDU + 0x0CBC == code || // Mn KANNADA SIGN NUKTA + 0x0CBF == code || // Mn KANNADA VOWEL SIGN I + 0x0CC2 == code || // Mc KANNADA VOWEL SIGN UU + 0x0CC6 == code || // Mn KANNADA VOWEL SIGN E + (0x0CCC <= code && code <= 0x0CCD) || // Mn [2] KANNADA VOWEL SIGN AU..KANNADA SIGN VIRAMA + (0x0CD5 <= code && code <= 0x0CD6) || // Mc [2] KANNADA LENGTH MARK..KANNADA AI LENGTH MARK + (0x0CE2 <= code && code <= 0x0CE3) || // Mn [2] KANNADA VOWEL SIGN VOCALIC L..KANNADA VOWEL SIGN VOCALIC LL + (0x0D00 <= code && code <= 0x0D01) || // Mn [2] MALAYALAM SIGN COMBINING ANUSVARA ABOVE..MALAYALAM SIGN CANDRABINDU + (0x0D3B <= code && code <= 0x0D3C) || // Mn [2] MALAYALAM SIGN VERTICAL BAR VIRAMA..MALAYALAM SIGN CIRCULAR VIRAMA + 0x0D3E == code || // Mc MALAYALAM VOWEL SIGN AA + (0x0D41 <= code && code <= 0x0D44) || // Mn [4] MALAYALAM VOWEL SIGN U..MALAYALAM VOWEL SIGN VOCALIC RR + 0x0D4D == code || // Mn MALAYALAM SIGN VIRAMA + 0x0D57 == code || // Mc MALAYALAM AU LENGTH MARK + (0x0D62 <= code && code <= 0x0D63) || // Mn [2] MALAYALAM VOWEL SIGN VOCALIC L..MALAYALAM VOWEL SIGN VOCALIC LL + 0x0DCA == code || // Mn SINHALA SIGN AL-LAKUNA + 0x0DCF == code || // Mc SINHALA VOWEL SIGN AELA-PILLA + (0x0DD2 <= code && code <= 0x0DD4) || // Mn [3] SINHALA VOWEL SIGN KETTI IS-PILLA..SINHALA VOWEL SIGN KETTI PAA-PILLA + 0x0DD6 == code || // Mn SINHALA VOWEL SIGN DIGA PAA-PILLA + 0x0DDF == code || // Mc SINHALA VOWEL SIGN GAYANUKITTA + 0x0E31 == code || // Mn THAI CHARACTER MAI HAN-AKAT + (0x0E34 <= code && code <= 0x0E3A) || // Mn [7] THAI CHARACTER SARA I..THAI CHARACTER PHINTHU + (0x0E47 <= code && code <= 0x0E4E) || // Mn [8] THAI CHARACTER MAITAIKHU..THAI CHARACTER YAMAKKAN + 0x0EB1 == code || // Mn LAO VOWEL SIGN MAI KAN + (0x0EB4 <= code && code <= 0x0EB9) || // Mn [6] LAO VOWEL SIGN I..LAO VOWEL SIGN UU + (0x0EBB <= code && code <= 0x0EBC) || // Mn [2] LAO VOWEL SIGN MAI KON..LAO SEMIVOWEL SIGN LO + (0x0EC8 <= code && code <= 0x0ECD) || // Mn [6] LAO TONE MAI EK..LAO NIGGAHITA + (0x0F18 <= code && code <= 0x0F19) || // Mn [2] TIBETAN ASTROLOGICAL SIGN -KHYUD PA..TIBETAN ASTROLOGICAL SIGN SDONG TSHUGS + 0x0F35 == code || // Mn TIBETAN MARK NGAS BZUNG NYI ZLA + 0x0F37 == code || // Mn TIBETAN MARK NGAS BZUNG SGOR RTAGS + 0x0F39 == code || // Mn TIBETAN MARK TSA -PHRU + (0x0F71 <= code && code <= 0x0F7E) || // Mn [14] TIBETAN VOWEL SIGN AA..TIBETAN SIGN RJES SU NGA RO + (0x0F80 <= code && code <= 0x0F84) || // Mn [5] TIBETAN VOWEL SIGN REVERSED I..TIBETAN MARK HALANTA + (0x0F86 <= code && code <= 0x0F87) || // Mn [2] TIBETAN SIGN LCI RTAGS..TIBETAN SIGN YANG RTAGS + (0x0F8D <= code && code <= 0x0F97) || // Mn [11] TIBETAN SUBJOINED SIGN LCE TSA CAN..TIBETAN SUBJOINED LETTER JA + (0x0F99 <= code && code <= 0x0FBC) || // Mn [36] TIBETAN SUBJOINED LETTER NYA..TIBETAN SUBJOINED LETTER FIXED-FORM RA + 0x0FC6 == code || // Mn TIBETAN SYMBOL PADMA GDAN + (0x102D <= code && code <= 0x1030) || // Mn [4] MYANMAR VOWEL SIGN I..MYANMAR VOWEL SIGN UU + (0x1032 <= code && code <= 0x1037) || // Mn [6] MYANMAR VOWEL SIGN AI..MYANMAR SIGN DOT BELOW + (0x1039 <= code && code <= 0x103A) || // Mn [2] MYANMAR SIGN VIRAMA..MYANMAR SIGN ASAT + (0x103D <= code && code <= 0x103E) || // Mn [2] MYANMAR CONSONANT SIGN MEDIAL WA..MYANMAR CONSONANT SIGN MEDIAL HA + (0x1058 <= code && code <= 0x1059) || // Mn [2] MYANMAR VOWEL SIGN VOCALIC L..MYANMAR VOWEL SIGN VOCALIC LL + (0x105E <= code && code <= 0x1060) || // Mn [3] MYANMAR CONSONANT SIGN MON MEDIAL NA..MYANMAR CONSONANT SIGN MON MEDIAL LA + (0x1071 <= code && code <= 0x1074) || // Mn [4] MYANMAR VOWEL SIGN GEBA KAREN I..MYANMAR VOWEL SIGN KAYAH EE + 0x1082 == code || // Mn MYANMAR CONSONANT SIGN SHAN MEDIAL WA + (0x1085 <= code && code <= 0x1086) || // Mn [2] MYANMAR VOWEL SIGN SHAN E ABOVE..MYANMAR VOWEL SIGN SHAN FINAL Y + 0x108D == code || // Mn MYANMAR SIGN SHAN COUNCIL EMPHATIC TONE + 0x109D == code || // Mn MYANMAR VOWEL SIGN AITON AI + (0x135D <= code && code <= 0x135F) || // Mn [3] ETHIOPIC COMBINING GEMINATION AND VOWEL LENGTH MARK..ETHIOPIC COMBINING GEMINATION MARK + (0x1712 <= code && code <= 0x1714) || // Mn [3] TAGALOG VOWEL SIGN I..TAGALOG SIGN VIRAMA + (0x1732 <= code && code <= 0x1734) || // Mn [3] HANUNOO VOWEL SIGN I..HANUNOO SIGN PAMUDPOD + (0x1752 <= code && code <= 0x1753) || // Mn [2] BUHID VOWEL SIGN I..BUHID VOWEL SIGN U + (0x1772 <= code && code <= 0x1773) || // Mn [2] TAGBANWA VOWEL SIGN I..TAGBANWA VOWEL SIGN U + (0x17B4 <= code && code <= 0x17B5) || // Mn [2] KHMER VOWEL INHERENT AQ..KHMER VOWEL INHERENT AA + (0x17B7 <= code && code <= 0x17BD) || // Mn [7] KHMER VOWEL SIGN I..KHMER VOWEL SIGN UA + 0x17C6 == code || // Mn KHMER SIGN NIKAHIT + (0x17C9 <= code && code <= 0x17D3) || // Mn [11] KHMER SIGN MUUSIKATOAN..KHMER SIGN BATHAMASAT + 0x17DD == code || // Mn KHMER SIGN ATTHACAN + (0x180B <= code && code <= 0x180D) || // Mn [3] MONGOLIAN FREE VARIATION SELECTOR ONE..MONGOLIAN FREE VARIATION SELECTOR THREE + (0x1885 <= code && code <= 0x1886) || // Mn [2] MONGOLIAN LETTER ALI GALI BALUDA..MONGOLIAN LETTER ALI GALI THREE BALUDA + 0x18A9 == code || // Mn MONGOLIAN LETTER ALI GALI DAGALGA + (0x1920 <= code && code <= 0x1922) || // Mn [3] LIMBU VOWEL SIGN A..LIMBU VOWEL SIGN U + (0x1927 <= code && code <= 0x1928) || // Mn [2] LIMBU VOWEL SIGN E..LIMBU VOWEL SIGN O + 0x1932 == code || // Mn LIMBU SMALL LETTER ANUSVARA + (0x1939 <= code && code <= 0x193B) || // Mn [3] LIMBU SIGN MUKPHRENG..LIMBU SIGN SA-I + (0x1A17 <= code && code <= 0x1A18) || // Mn [2] BUGINESE VOWEL SIGN I..BUGINESE VOWEL SIGN U + 0x1A1B == code || // Mn BUGINESE VOWEL SIGN AE + 0x1A56 == code || // Mn TAI THAM CONSONANT SIGN MEDIAL LA + (0x1A58 <= code && code <= 0x1A5E) || // Mn [7] TAI THAM SIGN MAI KANG LAI..TAI THAM CONSONANT SIGN SA + 0x1A60 == code || // Mn TAI THAM SIGN SAKOT + 0x1A62 == code || // Mn TAI THAM VOWEL SIGN MAI SAT + (0x1A65 <= code && code <= 0x1A6C) || // Mn [8] TAI THAM VOWEL SIGN I..TAI THAM VOWEL SIGN OA BELOW + (0x1A73 <= code && code <= 0x1A7C) || // Mn [10] TAI THAM VOWEL SIGN OA ABOVE..TAI THAM SIGN KHUEN-LUE KARAN + 0x1A7F == code || // Mn TAI THAM COMBINING CRYPTOGRAMMIC DOT + (0x1AB0 <= code && code <= 0x1ABD) || // Mn [14] COMBINING DOUBLED CIRCUMFLEX ACCENT..COMBINING PARENTHESES BELOW + 0x1ABE == code || // Me COMBINING PARENTHESES OVERLAY + (0x1B00 <= code && code <= 0x1B03) || // Mn [4] BALINESE SIGN ULU RICEM..BALINESE SIGN SURANG + 0x1B34 == code || // Mn BALINESE SIGN REREKAN + (0x1B36 <= code && code <= 0x1B3A) || // Mn [5] BALINESE VOWEL SIGN ULU..BALINESE VOWEL SIGN RA REPA + 0x1B3C == code || // Mn BALINESE VOWEL SIGN LA LENGA + 0x1B42 == code || // Mn BALINESE VOWEL SIGN PEPET + (0x1B6B <= code && code <= 0x1B73) || // Mn [9] BALINESE MUSICAL SYMBOL COMBINING TEGEH..BALINESE MUSICAL SYMBOL COMBINING GONG + (0x1B80 <= code && code <= 0x1B81) || // Mn [2] SUNDANESE SIGN PANYECEK..SUNDANESE SIGN PANGLAYAR + (0x1BA2 <= code && code <= 0x1BA5) || // Mn [4] SUNDANESE CONSONANT SIGN PANYAKRA..SUNDANESE VOWEL SIGN PANYUKU + (0x1BA8 <= code && code <= 0x1BA9) || // Mn [2] SUNDANESE VOWEL SIGN PAMEPET..SUNDANESE VOWEL SIGN PANEULEUNG + (0x1BAB <= code && code <= 0x1BAD) || // Mn [3] SUNDANESE SIGN VIRAMA..SUNDANESE CONSONANT SIGN PASANGAN WA + 0x1BE6 == code || // Mn BATAK SIGN TOMPI + (0x1BE8 <= code && code <= 0x1BE9) || // Mn [2] BATAK VOWEL SIGN PAKPAK E..BATAK VOWEL SIGN EE + 0x1BED == code || // Mn BATAK VOWEL SIGN KARO O + (0x1BEF <= code && code <= 0x1BF1) || // Mn [3] BATAK VOWEL SIGN U FOR SIMALUNGUN SA..BATAK CONSONANT SIGN H + (0x1C2C <= code && code <= 0x1C33) || // Mn [8] LEPCHA VOWEL SIGN E..LEPCHA CONSONANT SIGN T + (0x1C36 <= code && code <= 0x1C37) || // Mn [2] LEPCHA SIGN RAN..LEPCHA SIGN NUKTA + (0x1CD0 <= code && code <= 0x1CD2) || // Mn [3] VEDIC TONE KARSHANA..VEDIC TONE PRENKHA + (0x1CD4 <= code && code <= 0x1CE0) || // Mn [13] VEDIC SIGN YAJURVEDIC MIDLINE SVARITA..VEDIC TONE RIGVEDIC KASHMIRI INDEPENDENT SVARITA + (0x1CE2 <= code && code <= 0x1CE8) || // Mn [7] VEDIC SIGN VISARGA SVARITA..VEDIC SIGN VISARGA ANUDATTA WITH TAIL + 0x1CED == code || // Mn VEDIC SIGN TIRYAK + 0x1CF4 == code || // Mn VEDIC TONE CANDRA ABOVE + (0x1CF8 <= code && code <= 0x1CF9) || // Mn [2] VEDIC TONE RING ABOVE..VEDIC TONE DOUBLE RING ABOVE + (0x1DC0 <= code && code <= 0x1DF9) || // Mn [58] COMBINING DOTTED GRAVE ACCENT..COMBINING WIDE INVERTED BRIDGE BELOW + (0x1DFB <= code && code <= 0x1DFF) || // Mn [5] COMBINING DELETION MARK..COMBINING RIGHT ARROWHEAD AND DOWN ARROWHEAD BELOW + 0x200C == code || // Cf ZERO WIDTH NON-JOINER + (0x20D0 <= code && code <= 0x20DC) || // Mn [13] COMBINING LEFT HARPOON ABOVE..COMBINING FOUR DOTS ABOVE + (0x20DD <= code && code <= 0x20E0) || // Me [4] COMBINING ENCLOSING CIRCLE..COMBINING ENCLOSING CIRCLE BACKSLASH + 0x20E1 == code || // Mn COMBINING LEFT RIGHT ARROW ABOVE + (0x20E2 <= code && code <= 0x20E4) || // Me [3] COMBINING ENCLOSING SCREEN..COMBINING ENCLOSING UPWARD POINTING TRIANGLE + (0x20E5 <= code && code <= 0x20F0) || // Mn [12] COMBINING REVERSE SOLIDUS OVERLAY..COMBINING ASTERISK ABOVE + (0x2CEF <= code && code <= 0x2CF1) || // Mn [3] COPTIC COMBINING NI ABOVE..COPTIC COMBINING SPIRITUS LENIS + 0x2D7F == code || // Mn TIFINAGH CONSONANT JOINER + (0x2DE0 <= code && code <= 0x2DFF) || // Mn [32] COMBINING CYRILLIC LETTER BE..COMBINING CYRILLIC LETTER IOTIFIED BIG YUS + (0x302A <= code && code <= 0x302D) || // Mn [4] IDEOGRAPHIC LEVEL TONE MARK..IDEOGRAPHIC ENTERING TONE MARK + (0x302E <= code && code <= 0x302F) || // Mc [2] HANGUL SINGLE DOT TONE MARK..HANGUL DOUBLE DOT TONE MARK + (0x3099 <= code && code <= 0x309A) || // Mn [2] COMBINING KATAKANA-HIRAGANA VOICED SOUND MARK..COMBINING KATAKANA-HIRAGANA SEMI-VOICED SOUND MARK + 0xA66F == code || // Mn COMBINING CYRILLIC VZMET + (0xA670 <= code && code <= 0xA672) || // Me [3] COMBINING CYRILLIC TEN MILLIONS SIGN..COMBINING CYRILLIC THOUSAND MILLIONS SIGN + (0xA674 <= code && code <= 0xA67D) || // Mn [10] COMBINING CYRILLIC LETTER UKRAINIAN IE..COMBINING CYRILLIC PAYEROK + (0xA69E <= code && code <= 0xA69F) || // Mn [2] COMBINING CYRILLIC LETTER EF..COMBINING CYRILLIC LETTER IOTIFIED E + (0xA6F0 <= code && code <= 0xA6F1) || // Mn [2] BAMUM COMBINING MARK KOQNDON..BAMUM COMBINING MARK TUKWENTIS + 0xA802 == code || // Mn SYLOTI NAGRI SIGN DVISVARA + 0xA806 == code || // Mn SYLOTI NAGRI SIGN HASANTA + 0xA80B == code || // Mn SYLOTI NAGRI SIGN ANUSVARA + (0xA825 <= code && code <= 0xA826) || // Mn [2] SYLOTI NAGRI VOWEL SIGN U..SYLOTI NAGRI VOWEL SIGN E + (0xA8C4 <= code && code <= 0xA8C5) || // Mn [2] SAURASHTRA SIGN VIRAMA..SAURASHTRA SIGN CANDRABINDU + (0xA8E0 <= code && code <= 0xA8F1) || // Mn [18] COMBINING DEVANAGARI DIGIT ZERO..COMBINING DEVANAGARI SIGN AVAGRAHA + (0xA926 <= code && code <= 0xA92D) || // Mn [8] KAYAH LI VOWEL UE..KAYAH LI TONE CALYA PLOPHU + (0xA947 <= code && code <= 0xA951) || // Mn [11] REJANG VOWEL SIGN I..REJANG CONSONANT SIGN R + (0xA980 <= code && code <= 0xA982) || // Mn [3] JAVANESE SIGN PANYANGGA..JAVANESE SIGN LAYAR + 0xA9B3 == code || // Mn JAVANESE SIGN CECAK TELU + (0xA9B6 <= code && code <= 0xA9B9) || // Mn [4] JAVANESE VOWEL SIGN WULU..JAVANESE VOWEL SIGN SUKU MENDUT + 0xA9BC == code || // Mn JAVANESE VOWEL SIGN PEPET + 0xA9E5 == code || // Mn MYANMAR SIGN SHAN SAW + (0xAA29 <= code && code <= 0xAA2E) || // Mn [6] CHAM VOWEL SIGN AA..CHAM VOWEL SIGN OE + (0xAA31 <= code && code <= 0xAA32) || // Mn [2] CHAM VOWEL SIGN AU..CHAM VOWEL SIGN UE + (0xAA35 <= code && code <= 0xAA36) || // Mn [2] CHAM CONSONANT SIGN LA..CHAM CONSONANT SIGN WA + 0xAA43 == code || // Mn CHAM CONSONANT SIGN FINAL NG + 0xAA4C == code || // Mn CHAM CONSONANT SIGN FINAL M + 0xAA7C == code || // Mn MYANMAR SIGN TAI LAING TONE-2 + 0xAAB0 == code || // Mn TAI VIET MAI KANG + (0xAAB2 <= code && code <= 0xAAB4) || // Mn [3] TAI VIET VOWEL I..TAI VIET VOWEL U + (0xAAB7 <= code && code <= 0xAAB8) || // Mn [2] TAI VIET MAI KHIT..TAI VIET VOWEL IA + (0xAABE <= code && code <= 0xAABF) || // Mn [2] TAI VIET VOWEL AM..TAI VIET TONE MAI EK + 0xAAC1 == code || // Mn TAI VIET TONE MAI THO + (0xAAEC <= code && code <= 0xAAED) || // Mn [2] MEETEI MAYEK VOWEL SIGN UU..MEETEI MAYEK VOWEL SIGN AAI + 0xAAF6 == code || // Mn MEETEI MAYEK VIRAMA + 0xABE5 == code || // Mn MEETEI MAYEK VOWEL SIGN ANAP + 0xABE8 == code || // Mn MEETEI MAYEK VOWEL SIGN UNAP + 0xABED == code || // Mn MEETEI MAYEK APUN IYEK + 0xFB1E == code || // Mn HEBREW POINT JUDEO-SPANISH VARIKA + (0xFE00 <= code && code <= 0xFE0F) || // Mn [16] VARIATION SELECTOR-1..VARIATION SELECTOR-16 + (0xFE20 <= code && code <= 0xFE2F) || // Mn [16] COMBINING LIGATURE LEFT HALF..COMBINING CYRILLIC TITLO RIGHT HALF + (0xFF9E <= code && code <= 0xFF9F) || // Lm [2] HALFWIDTH KATAKANA VOICED SOUND MARK..HALFWIDTH KATAKANA SEMI-VOICED SOUND MARK + 0x101FD == code || // Mn PHAISTOS DISC SIGN COMBINING OBLIQUE STROKE + 0x102E0 == code || // Mn COPTIC EPACT THOUSANDS MARK + (0x10376 <= code && code <= 0x1037A) || // Mn [5] COMBINING OLD PERMIC LETTER AN..COMBINING OLD PERMIC LETTER SII + (0x10A01 <= code && code <= 0x10A03) || // Mn [3] KHAROSHTHI VOWEL SIGN I..KHAROSHTHI VOWEL SIGN VOCALIC R + (0x10A05 <= code && code <= 0x10A06) || // Mn [2] KHAROSHTHI VOWEL SIGN E..KHAROSHTHI VOWEL SIGN O + (0x10A0C <= code && code <= 0x10A0F) || // Mn [4] KHAROSHTHI VOWEL LENGTH MARK..KHAROSHTHI SIGN VISARGA + (0x10A38 <= code && code <= 0x10A3A) || // Mn [3] KHAROSHTHI SIGN BAR ABOVE..KHAROSHTHI SIGN DOT BELOW + 0x10A3F == code || // Mn KHAROSHTHI VIRAMA + (0x10AE5 <= code && code <= 0x10AE6) || // Mn [2] MANICHAEAN ABBREVIATION MARK ABOVE..MANICHAEAN ABBREVIATION MARK BELOW + 0x11001 == code || // Mn BRAHMI SIGN ANUSVARA + (0x11038 <= code && code <= 0x11046) || // Mn [15] BRAHMI VOWEL SIGN AA..BRAHMI VIRAMA + (0x1107F <= code && code <= 0x11081) || // Mn [3] BRAHMI NUMBER JOINER..KAITHI SIGN ANUSVARA + (0x110B3 <= code && code <= 0x110B6) || // Mn [4] KAITHI VOWEL SIGN U..KAITHI VOWEL SIGN AI + (0x110B9 <= code && code <= 0x110BA) || // Mn [2] KAITHI SIGN VIRAMA..KAITHI SIGN NUKTA + (0x11100 <= code && code <= 0x11102) || // Mn [3] CHAKMA SIGN CANDRABINDU..CHAKMA SIGN VISARGA + (0x11127 <= code && code <= 0x1112B) || // Mn [5] CHAKMA VOWEL SIGN A..CHAKMA VOWEL SIGN UU + (0x1112D <= code && code <= 0x11134) || // Mn [8] CHAKMA VOWEL SIGN AI..CHAKMA MAAYYAA + 0x11173 == code || // Mn MAHAJANI SIGN NUKTA + (0x11180 <= code && code <= 0x11181) || // Mn [2] SHARADA SIGN CANDRABINDU..SHARADA SIGN ANUSVARA + (0x111B6 <= code && code <= 0x111BE) || // Mn [9] SHARADA VOWEL SIGN U..SHARADA VOWEL SIGN O + (0x111CA <= code && code <= 0x111CC) || // Mn [3] SHARADA SIGN NUKTA..SHARADA EXTRA SHORT VOWEL MARK + (0x1122F <= code && code <= 0x11231) || // Mn [3] KHOJKI VOWEL SIGN U..KHOJKI VOWEL SIGN AI + 0x11234 == code || // Mn KHOJKI SIGN ANUSVARA + (0x11236 <= code && code <= 0x11237) || // Mn [2] KHOJKI SIGN NUKTA..KHOJKI SIGN SHADDA + 0x1123E == code || // Mn KHOJKI SIGN SUKUN + 0x112DF == code || // Mn KHUDAWADI SIGN ANUSVARA + (0x112E3 <= code && code <= 0x112EA) || // Mn [8] KHUDAWADI VOWEL SIGN U..KHUDAWADI SIGN VIRAMA + (0x11300 <= code && code <= 0x11301) || // Mn [2] GRANTHA SIGN COMBINING ANUSVARA ABOVE..GRANTHA SIGN CANDRABINDU + 0x1133C == code || // Mn GRANTHA SIGN NUKTA + 0x1133E == code || // Mc GRANTHA VOWEL SIGN AA + 0x11340 == code || // Mn GRANTHA VOWEL SIGN II + 0x11357 == code || // Mc GRANTHA AU LENGTH MARK + (0x11366 <= code && code <= 0x1136C) || // Mn [7] COMBINING GRANTHA DIGIT ZERO..COMBINING GRANTHA DIGIT SIX + (0x11370 <= code && code <= 0x11374) || // Mn [5] COMBINING GRANTHA LETTER A..COMBINING GRANTHA LETTER PA + (0x11438 <= code && code <= 0x1143F) || // Mn [8] NEWA VOWEL SIGN U..NEWA VOWEL SIGN AI + (0x11442 <= code && code <= 0x11444) || // Mn [3] NEWA SIGN VIRAMA..NEWA SIGN ANUSVARA + 0x11446 == code || // Mn NEWA SIGN NUKTA + 0x114B0 == code || // Mc TIRHUTA VOWEL SIGN AA + (0x114B3 <= code && code <= 0x114B8) || // Mn [6] TIRHUTA VOWEL SIGN U..TIRHUTA VOWEL SIGN VOCALIC LL + 0x114BA == code || // Mn TIRHUTA VOWEL SIGN SHORT E + 0x114BD == code || // Mc TIRHUTA VOWEL SIGN SHORT O + (0x114BF <= code && code <= 0x114C0) || // Mn [2] TIRHUTA SIGN CANDRABINDU..TIRHUTA SIGN ANUSVARA + (0x114C2 <= code && code <= 0x114C3) || // Mn [2] TIRHUTA SIGN VIRAMA..TIRHUTA SIGN NUKTA + 0x115AF == code || // Mc SIDDHAM VOWEL SIGN AA + (0x115B2 <= code && code <= 0x115B5) || // Mn [4] SIDDHAM VOWEL SIGN U..SIDDHAM VOWEL SIGN VOCALIC RR + (0x115BC <= code && code <= 0x115BD) || // Mn [2] SIDDHAM SIGN CANDRABINDU..SIDDHAM SIGN ANUSVARA + (0x115BF <= code && code <= 0x115C0) || // Mn [2] SIDDHAM SIGN VIRAMA..SIDDHAM SIGN NUKTA + (0x115DC <= code && code <= 0x115DD) || // Mn [2] SIDDHAM VOWEL SIGN ALTERNATE U..SIDDHAM VOWEL SIGN ALTERNATE UU + (0x11633 <= code && code <= 0x1163A) || // Mn [8] MODI VOWEL SIGN U..MODI VOWEL SIGN AI + 0x1163D == code || // Mn MODI SIGN ANUSVARA + (0x1163F <= code && code <= 0x11640) || // Mn [2] MODI SIGN VIRAMA..MODI SIGN ARDHACANDRA + 0x116AB == code || // Mn TAKRI SIGN ANUSVARA + 0x116AD == code || // Mn TAKRI VOWEL SIGN AA + (0x116B0 <= code && code <= 0x116B5) || // Mn [6] TAKRI VOWEL SIGN U..TAKRI VOWEL SIGN AU + 0x116B7 == code || // Mn TAKRI SIGN NUKTA + (0x1171D <= code && code <= 0x1171F) || // Mn [3] AHOM CONSONANT SIGN MEDIAL LA..AHOM CONSONANT SIGN MEDIAL LIGATING RA + (0x11722 <= code && code <= 0x11725) || // Mn [4] AHOM VOWEL SIGN I..AHOM VOWEL SIGN UU + (0x11727 <= code && code <= 0x1172B) || // Mn [5] AHOM VOWEL SIGN AW..AHOM SIGN KILLER + (0x11A01 <= code && code <= 0x11A06) || // Mn [6] ZANABAZAR SQUARE VOWEL SIGN I..ZANABAZAR SQUARE VOWEL SIGN O + (0x11A09 <= code && code <= 0x11A0A) || // Mn [2] ZANABAZAR SQUARE VOWEL SIGN REVERSED I..ZANABAZAR SQUARE VOWEL LENGTH MARK + (0x11A33 <= code && code <= 0x11A38) || // Mn [6] ZANABAZAR SQUARE FINAL CONSONANT MARK..ZANABAZAR SQUARE SIGN ANUSVARA + (0x11A3B <= code && code <= 0x11A3E) || // Mn [4] ZANABAZAR SQUARE CLUSTER-FINAL LETTER YA..ZANABAZAR SQUARE CLUSTER-FINAL LETTER VA + 0x11A47 == code || // Mn ZANABAZAR SQUARE SUBJOINER + (0x11A51 <= code && code <= 0x11A56) || // Mn [6] SOYOMBO VOWEL SIGN I..SOYOMBO VOWEL SIGN OE + (0x11A59 <= code && code <= 0x11A5B) || // Mn [3] SOYOMBO VOWEL SIGN VOCALIC R..SOYOMBO VOWEL LENGTH MARK + (0x11A8A <= code && code <= 0x11A96) || // Mn [13] SOYOMBO FINAL CONSONANT SIGN G..SOYOMBO SIGN ANUSVARA + (0x11A98 <= code && code <= 0x11A99) || // Mn [2] SOYOMBO GEMINATION MARK..SOYOMBO SUBJOINER + (0x11C30 <= code && code <= 0x11C36) || // Mn [7] BHAIKSUKI VOWEL SIGN I..BHAIKSUKI VOWEL SIGN VOCALIC L + (0x11C38 <= code && code <= 0x11C3D) || // Mn [6] BHAIKSUKI VOWEL SIGN E..BHAIKSUKI SIGN ANUSVARA + 0x11C3F == code || // Mn BHAIKSUKI SIGN VIRAMA + (0x11C92 <= code && code <= 0x11CA7) || // Mn [22] MARCHEN SUBJOINED LETTER KA..MARCHEN SUBJOINED LETTER ZA + (0x11CAA <= code && code <= 0x11CB0) || // Mn [7] MARCHEN SUBJOINED LETTER RA..MARCHEN VOWEL SIGN AA + (0x11CB2 <= code && code <= 0x11CB3) || // Mn [2] MARCHEN VOWEL SIGN U..MARCHEN VOWEL SIGN E + (0x11CB5 <= code && code <= 0x11CB6) || // Mn [2] MARCHEN SIGN ANUSVARA..MARCHEN SIGN CANDRABINDU + (0x11D31 <= code && code <= 0x11D36) || // Mn [6] MASARAM GONDI VOWEL SIGN AA..MASARAM GONDI VOWEL SIGN VOCALIC R + 0x11D3A == code || // Mn MASARAM GONDI VOWEL SIGN E + (0x11D3C <= code && code <= 0x11D3D) || // Mn [2] MASARAM GONDI VOWEL SIGN AI..MASARAM GONDI VOWEL SIGN O + (0x11D3F <= code && code <= 0x11D45) || // Mn [7] MASARAM GONDI VOWEL SIGN AU..MASARAM GONDI VIRAMA + 0x11D47 == code || // Mn MASARAM GONDI RA-KARA + (0x16AF0 <= code && code <= 0x16AF4) || // Mn [5] BASSA VAH COMBINING HIGH TONE..BASSA VAH COMBINING HIGH-LOW TONE + (0x16B30 <= code && code <= 0x16B36) || // Mn [7] PAHAWH HMONG MARK CIM TUB..PAHAWH HMONG MARK CIM TAUM + (0x16F8F <= code && code <= 0x16F92) || // Mn [4] MIAO TONE RIGHT..MIAO TONE BELOW + (0x1BC9D <= code && code <= 0x1BC9E) || // Mn [2] DUPLOYAN THICK LETTER SELECTOR..DUPLOYAN DOUBLE MARK + 0x1D165 == code || // Mc MUSICAL SYMBOL COMBINING STEM + (0x1D167 <= code && code <= 0x1D169) || // Mn [3] MUSICAL SYMBOL COMBINING TREMOLO-1..MUSICAL SYMBOL COMBINING TREMOLO-3 + (0x1D16E <= code && code <= 0x1D172) || // Mc [5] MUSICAL SYMBOL COMBINING FLAG-1..MUSICAL SYMBOL COMBINING FLAG-5 + (0x1D17B <= code && code <= 0x1D182) || // Mn [8] MUSICAL SYMBOL COMBINING ACCENT..MUSICAL SYMBOL COMBINING LOURE + (0x1D185 <= code && code <= 0x1D18B) || // Mn [7] MUSICAL SYMBOL COMBINING DOIT..MUSICAL SYMBOL COMBINING TRIPLE TONGUE + (0x1D1AA <= code && code <= 0x1D1AD) || // Mn [4] MUSICAL SYMBOL COMBINING DOWN BOW..MUSICAL SYMBOL COMBINING SNAP PIZZICATO + (0x1D242 <= code && code <= 0x1D244) || // Mn [3] COMBINING GREEK MUSICAL TRISEME..COMBINING GREEK MUSICAL PENTASEME + (0x1DA00 <= code && code <= 0x1DA36) || // Mn [55] SIGNWRITING HEAD RIM..SIGNWRITING AIR SUCKING IN + (0x1DA3B <= code && code <= 0x1DA6C) || // Mn [50] SIGNWRITING MOUTH CLOSED NEUTRAL..SIGNWRITING EXCITEMENT + 0x1DA75 == code || // Mn SIGNWRITING UPPER BODY TILTING FROM HIP JOINTS + 0x1DA84 == code || // Mn SIGNWRITING LOCATION HEAD NECK + (0x1DA9B <= code && code <= 0x1DA9F) || // Mn [5] SIGNWRITING FILL MODIFIER-2..SIGNWRITING FILL MODIFIER-6 + (0x1DAA1 <= code && code <= 0x1DAAF) || // Mn [15] SIGNWRITING ROTATION MODIFIER-2..SIGNWRITING ROTATION MODIFIER-16 + (0x1E000 <= code && code <= 0x1E006) || // Mn [7] COMBINING GLAGOLITIC LETTER AZU..COMBINING GLAGOLITIC LETTER ZHIVETE + (0x1E008 <= code && code <= 0x1E018) || // Mn [17] COMBINING GLAGOLITIC LETTER ZEMLJA..COMBINING GLAGOLITIC LETTER HERU + (0x1E01B <= code && code <= 0x1E021) || // Mn [7] COMBINING GLAGOLITIC LETTER SHTA..COMBINING GLAGOLITIC LETTER YATI + (0x1E023 <= code && code <= 0x1E024) || // Mn [2] COMBINING GLAGOLITIC LETTER YU..COMBINING GLAGOLITIC LETTER SMALL YUS + (0x1E026 <= code && code <= 0x1E02A) || // Mn [5] COMBINING GLAGOLITIC LETTER YO..COMBINING GLAGOLITIC LETTER FITA + (0x1E8D0 <= code && code <= 0x1E8D6) || // Mn [7] MENDE KIKAKUI COMBINING NUMBER TEENS..MENDE KIKAKUI COMBINING NUMBER MILLIONS + (0x1E944 <= code && code <= 0x1E94A) || // Mn [7] ADLAM ALIF LENGTHENER..ADLAM NUKTA + (0xE0020 <= code && code <= 0xE007F) || // Cf [96] TAG SPACE..CANCEL TAG + (0xE0100 <= code && code <= 0xE01EF) // Mn [240] VARIATION SELECTOR-17..VARIATION SELECTOR-256 + ){ + return Extend; + } + + + if( + (0x1F1E6 <= code && code <= 0x1F1FF) // So [26] REGIONAL INDICATOR SYMBOL LETTER A..REGIONAL INDICATOR SYMBOL LETTER Z + ){ + return Regional_Indicator; + } + + if( + 0x0903 == code || // Mc DEVANAGARI SIGN VISARGA + 0x093B == code || // Mc DEVANAGARI VOWEL SIGN OOE + (0x093E <= code && code <= 0x0940) || // Mc [3] DEVANAGARI VOWEL SIGN AA..DEVANAGARI VOWEL SIGN II + (0x0949 <= code && code <= 0x094C) || // Mc [4] DEVANAGARI VOWEL SIGN CANDRA O..DEVANAGARI VOWEL SIGN AU + (0x094E <= code && code <= 0x094F) || // Mc [2] DEVANAGARI VOWEL SIGN PRISHTHAMATRA E..DEVANAGARI VOWEL SIGN AW + (0x0982 <= code && code <= 0x0983) || // Mc [2] BENGALI SIGN ANUSVARA..BENGALI SIGN VISARGA + (0x09BF <= code && code <= 0x09C0) || // Mc [2] BENGALI VOWEL SIGN I..BENGALI VOWEL SIGN II + (0x09C7 <= code && code <= 0x09C8) || // Mc [2] BENGALI VOWEL SIGN E..BENGALI VOWEL SIGN AI + (0x09CB <= code && code <= 0x09CC) || // Mc [2] BENGALI VOWEL SIGN O..BENGALI VOWEL SIGN AU + 0x0A03 == code || // Mc GURMUKHI SIGN VISARGA + (0x0A3E <= code && code <= 0x0A40) || // Mc [3] GURMUKHI VOWEL SIGN AA..GURMUKHI VOWEL SIGN II + 0x0A83 == code || // Mc GUJARATI SIGN VISARGA + (0x0ABE <= code && code <= 0x0AC0) || // Mc [3] GUJARATI VOWEL SIGN AA..GUJARATI VOWEL SIGN II + 0x0AC9 == code || // Mc GUJARATI VOWEL SIGN CANDRA O + (0x0ACB <= code && code <= 0x0ACC) || // Mc [2] GUJARATI VOWEL SIGN O..GUJARATI VOWEL SIGN AU + (0x0B02 <= code && code <= 0x0B03) || // Mc [2] ORIYA SIGN ANUSVARA..ORIYA SIGN VISARGA + 0x0B40 == code || // Mc ORIYA VOWEL SIGN II + (0x0B47 <= code && code <= 0x0B48) || // Mc [2] ORIYA VOWEL SIGN E..ORIYA VOWEL SIGN AI + (0x0B4B <= code && code <= 0x0B4C) || // Mc [2] ORIYA VOWEL SIGN O..ORIYA VOWEL SIGN AU + 0x0BBF == code || // Mc TAMIL VOWEL SIGN I + (0x0BC1 <= code && code <= 0x0BC2) || // Mc [2] TAMIL VOWEL SIGN U..TAMIL VOWEL SIGN UU + (0x0BC6 <= code && code <= 0x0BC8) || // Mc [3] TAMIL VOWEL SIGN E..TAMIL VOWEL SIGN AI + (0x0BCA <= code && code <= 0x0BCC) || // Mc [3] TAMIL VOWEL SIGN O..TAMIL VOWEL SIGN AU + (0x0C01 <= code && code <= 0x0C03) || // Mc [3] TELUGU SIGN CANDRABINDU..TELUGU SIGN VISARGA + (0x0C41 <= code && code <= 0x0C44) || // Mc [4] TELUGU VOWEL SIGN U..TELUGU VOWEL SIGN VOCALIC RR + (0x0C82 <= code && code <= 0x0C83) || // Mc [2] KANNADA SIGN ANUSVARA..KANNADA SIGN VISARGA + 0x0CBE == code || // Mc KANNADA VOWEL SIGN AA + (0x0CC0 <= code && code <= 0x0CC1) || // Mc [2] KANNADA VOWEL SIGN II..KANNADA VOWEL SIGN U + (0x0CC3 <= code && code <= 0x0CC4) || // Mc [2] KANNADA VOWEL SIGN VOCALIC R..KANNADA VOWEL SIGN VOCALIC RR + (0x0CC7 <= code && code <= 0x0CC8) || // Mc [2] KANNADA VOWEL SIGN EE..KANNADA VOWEL SIGN AI + (0x0CCA <= code && code <= 0x0CCB) || // Mc [2] KANNADA VOWEL SIGN O..KANNADA VOWEL SIGN OO + (0x0D02 <= code && code <= 0x0D03) || // Mc [2] MALAYALAM SIGN ANUSVARA..MALAYALAM SIGN VISARGA + (0x0D3F <= code && code <= 0x0D40) || // Mc [2] MALAYALAM VOWEL SIGN I..MALAYALAM VOWEL SIGN II + (0x0D46 <= code && code <= 0x0D48) || // Mc [3] MALAYALAM VOWEL SIGN E..MALAYALAM VOWEL SIGN AI + (0x0D4A <= code && code <= 0x0D4C) || // Mc [3] MALAYALAM VOWEL SIGN O..MALAYALAM VOWEL SIGN AU + (0x0D82 <= code && code <= 0x0D83) || // Mc [2] SINHALA SIGN ANUSVARAYA..SINHALA SIGN VISARGAYA + (0x0DD0 <= code && code <= 0x0DD1) || // Mc [2] SINHALA VOWEL SIGN KETTI AEDA-PILLA..SINHALA VOWEL SIGN DIGA AEDA-PILLA + (0x0DD8 <= code && code <= 0x0DDE) || // Mc [7] SINHALA VOWEL SIGN GAETTA-PILLA..SINHALA VOWEL SIGN KOMBUVA HAA GAYANUKITTA + (0x0DF2 <= code && code <= 0x0DF3) || // Mc [2] SINHALA VOWEL SIGN DIGA GAETTA-PILLA..SINHALA VOWEL SIGN DIGA GAYANUKITTA + 0x0E33 == code || // Lo THAI CHARACTER SARA AM + 0x0EB3 == code || // Lo LAO VOWEL SIGN AM + (0x0F3E <= code && code <= 0x0F3F) || // Mc [2] TIBETAN SIGN YAR TSHES..TIBETAN SIGN MAR TSHES + 0x0F7F == code || // Mc TIBETAN SIGN RNAM BCAD + 0x1031 == code || // Mc MYANMAR VOWEL SIGN E + (0x103B <= code && code <= 0x103C) || // Mc [2] MYANMAR CONSONANT SIGN MEDIAL YA..MYANMAR CONSONANT SIGN MEDIAL RA + (0x1056 <= code && code <= 0x1057) || // Mc [2] MYANMAR VOWEL SIGN VOCALIC R..MYANMAR VOWEL SIGN VOCALIC RR + 0x1084 == code || // Mc MYANMAR VOWEL SIGN SHAN E + 0x17B6 == code || // Mc KHMER VOWEL SIGN AA + (0x17BE <= code && code <= 0x17C5) || // Mc [8] KHMER VOWEL SIGN OE..KHMER VOWEL SIGN AU + (0x17C7 <= code && code <= 0x17C8) || // Mc [2] KHMER SIGN REAHMUK..KHMER SIGN YUUKALEAPINTU + (0x1923 <= code && code <= 0x1926) || // Mc [4] LIMBU VOWEL SIGN EE..LIMBU VOWEL SIGN AU + (0x1929 <= code && code <= 0x192B) || // Mc [3] LIMBU SUBJOINED LETTER YA..LIMBU SUBJOINED LETTER WA + (0x1930 <= code && code <= 0x1931) || // Mc [2] LIMBU SMALL LETTER KA..LIMBU SMALL LETTER NGA + (0x1933 <= code && code <= 0x1938) || // Mc [6] LIMBU SMALL LETTER TA..LIMBU SMALL LETTER LA + (0x1A19 <= code && code <= 0x1A1A) || // Mc [2] BUGINESE VOWEL SIGN E..BUGINESE VOWEL SIGN O + 0x1A55 == code || // Mc TAI THAM CONSONANT SIGN MEDIAL RA + 0x1A57 == code || // Mc TAI THAM CONSONANT SIGN LA TANG LAI + (0x1A6D <= code && code <= 0x1A72) || // Mc [6] TAI THAM VOWEL SIGN OY..TAI THAM VOWEL SIGN THAM AI + 0x1B04 == code || // Mc BALINESE SIGN BISAH + 0x1B35 == code || // Mc BALINESE VOWEL SIGN TEDUNG + 0x1B3B == code || // Mc BALINESE VOWEL SIGN RA REPA TEDUNG + (0x1B3D <= code && code <= 0x1B41) || // Mc [5] BALINESE VOWEL SIGN LA LENGA TEDUNG..BALINESE VOWEL SIGN TALING REPA TEDUNG + (0x1B43 <= code && code <= 0x1B44) || // Mc [2] BALINESE VOWEL SIGN PEPET TEDUNG..BALINESE ADEG ADEG + 0x1B82 == code || // Mc SUNDANESE SIGN PANGWISAD + 0x1BA1 == code || // Mc SUNDANESE CONSONANT SIGN PAMINGKAL + (0x1BA6 <= code && code <= 0x1BA7) || // Mc [2] SUNDANESE VOWEL SIGN PANAELAENG..SUNDANESE VOWEL SIGN PANOLONG + 0x1BAA == code || // Mc SUNDANESE SIGN PAMAAEH + 0x1BE7 == code || // Mc BATAK VOWEL SIGN E + (0x1BEA <= code && code <= 0x1BEC) || // Mc [3] BATAK VOWEL SIGN I..BATAK VOWEL SIGN O + 0x1BEE == code || // Mc BATAK VOWEL SIGN U + (0x1BF2 <= code && code <= 0x1BF3) || // Mc [2] BATAK PANGOLAT..BATAK PANONGONAN + (0x1C24 <= code && code <= 0x1C2B) || // Mc [8] LEPCHA SUBJOINED LETTER YA..LEPCHA VOWEL SIGN UU + (0x1C34 <= code && code <= 0x1C35) || // Mc [2] LEPCHA CONSONANT SIGN NYIN-DO..LEPCHA CONSONANT SIGN KANG + 0x1CE1 == code || // Mc VEDIC TONE ATHARVAVEDIC INDEPENDENT SVARITA + (0x1CF2 <= code && code <= 0x1CF3) || // Mc [2] VEDIC SIGN ARDHAVISARGA..VEDIC SIGN ROTATED ARDHAVISARGA + 0x1CF7 == code || // Mc VEDIC SIGN ATIKRAMA + (0xA823 <= code && code <= 0xA824) || // Mc [2] SYLOTI NAGRI VOWEL SIGN A..SYLOTI NAGRI VOWEL SIGN I + 0xA827 == code || // Mc SYLOTI NAGRI VOWEL SIGN OO + (0xA880 <= code && code <= 0xA881) || // Mc [2] SAURASHTRA SIGN ANUSVARA..SAURASHTRA SIGN VISARGA + (0xA8B4 <= code && code <= 0xA8C3) || // Mc [16] SAURASHTRA CONSONANT SIGN HAARU..SAURASHTRA VOWEL SIGN AU + (0xA952 <= code && code <= 0xA953) || // Mc [2] REJANG CONSONANT SIGN H..REJANG VIRAMA + 0xA983 == code || // Mc JAVANESE SIGN WIGNYAN + (0xA9B4 <= code && code <= 0xA9B5) || // Mc [2] JAVANESE VOWEL SIGN TARUNG..JAVANESE VOWEL SIGN TOLONG + (0xA9BA <= code && code <= 0xA9BB) || // Mc [2] JAVANESE VOWEL SIGN TALING..JAVANESE VOWEL SIGN DIRGA MURE + (0xA9BD <= code && code <= 0xA9C0) || // Mc [4] JAVANESE CONSONANT SIGN KERET..JAVANESE PANGKON + (0xAA2F <= code && code <= 0xAA30) || // Mc [2] CHAM VOWEL SIGN O..CHAM VOWEL SIGN AI + (0xAA33 <= code && code <= 0xAA34) || // Mc [2] CHAM CONSONANT SIGN YA..CHAM CONSONANT SIGN RA + 0xAA4D == code || // Mc CHAM CONSONANT SIGN FINAL H + 0xAAEB == code || // Mc MEETEI MAYEK VOWEL SIGN II + (0xAAEE <= code && code <= 0xAAEF) || // Mc [2] MEETEI MAYEK VOWEL SIGN AU..MEETEI MAYEK VOWEL SIGN AAU + 0xAAF5 == code || // Mc MEETEI MAYEK VOWEL SIGN VISARGA + (0xABE3 <= code && code <= 0xABE4) || // Mc [2] MEETEI MAYEK VOWEL SIGN ONAP..MEETEI MAYEK VOWEL SIGN INAP + (0xABE6 <= code && code <= 0xABE7) || // Mc [2] MEETEI MAYEK VOWEL SIGN YENAP..MEETEI MAYEK VOWEL SIGN SOUNAP + (0xABE9 <= code && code <= 0xABEA) || // Mc [2] MEETEI MAYEK VOWEL SIGN CHEINAP..MEETEI MAYEK VOWEL SIGN NUNG + 0xABEC == code || // Mc MEETEI MAYEK LUM IYEK + 0x11000 == code || // Mc BRAHMI SIGN CANDRABINDU + 0x11002 == code || // Mc BRAHMI SIGN VISARGA + 0x11082 == code || // Mc KAITHI SIGN VISARGA + (0x110B0 <= code && code <= 0x110B2) || // Mc [3] KAITHI VOWEL SIGN AA..KAITHI VOWEL SIGN II + (0x110B7 <= code && code <= 0x110B8) || // Mc [2] KAITHI VOWEL SIGN O..KAITHI VOWEL SIGN AU + 0x1112C == code || // Mc CHAKMA VOWEL SIGN E + 0x11182 == code || // Mc SHARADA SIGN VISARGA + (0x111B3 <= code && code <= 0x111B5) || // Mc [3] SHARADA VOWEL SIGN AA..SHARADA VOWEL SIGN II + (0x111BF <= code && code <= 0x111C0) || // Mc [2] SHARADA VOWEL SIGN AU..SHARADA SIGN VIRAMA + (0x1122C <= code && code <= 0x1122E) || // Mc [3] KHOJKI VOWEL SIGN AA..KHOJKI VOWEL SIGN II + (0x11232 <= code && code <= 0x11233) || // Mc [2] KHOJKI VOWEL SIGN O..KHOJKI VOWEL SIGN AU + 0x11235 == code || // Mc KHOJKI SIGN VIRAMA + (0x112E0 <= code && code <= 0x112E2) || // Mc [3] KHUDAWADI VOWEL SIGN AA..KHUDAWADI VOWEL SIGN II + (0x11302 <= code && code <= 0x11303) || // Mc [2] GRANTHA SIGN ANUSVARA..GRANTHA SIGN VISARGA + 0x1133F == code || // Mc GRANTHA VOWEL SIGN I + (0x11341 <= code && code <= 0x11344) || // Mc [4] GRANTHA VOWEL SIGN U..GRANTHA VOWEL SIGN VOCALIC RR + (0x11347 <= code && code <= 0x11348) || // Mc [2] GRANTHA VOWEL SIGN EE..GRANTHA VOWEL SIGN AI + (0x1134B <= code && code <= 0x1134D) || // Mc [3] GRANTHA VOWEL SIGN OO..GRANTHA SIGN VIRAMA + (0x11362 <= code && code <= 0x11363) || // Mc [2] GRANTHA VOWEL SIGN VOCALIC L..GRANTHA VOWEL SIGN VOCALIC LL + (0x11435 <= code && code <= 0x11437) || // Mc [3] NEWA VOWEL SIGN AA..NEWA VOWEL SIGN II + (0x11440 <= code && code <= 0x11441) || // Mc [2] NEWA VOWEL SIGN O..NEWA VOWEL SIGN AU + 0x11445 == code || // Mc NEWA SIGN VISARGA + (0x114B1 <= code && code <= 0x114B2) || // Mc [2] TIRHUTA VOWEL SIGN I..TIRHUTA VOWEL SIGN II + 0x114B9 == code || // Mc TIRHUTA VOWEL SIGN E + (0x114BB <= code && code <= 0x114BC) || // Mc [2] TIRHUTA VOWEL SIGN AI..TIRHUTA VOWEL SIGN O + 0x114BE == code || // Mc TIRHUTA VOWEL SIGN AU + 0x114C1 == code || // Mc TIRHUTA SIGN VISARGA + (0x115B0 <= code && code <= 0x115B1) || // Mc [2] SIDDHAM VOWEL SIGN I..SIDDHAM VOWEL SIGN II + (0x115B8 <= code && code <= 0x115BB) || // Mc [4] SIDDHAM VOWEL SIGN E..SIDDHAM VOWEL SIGN AU + 0x115BE == code || // Mc SIDDHAM SIGN VISARGA + (0x11630 <= code && code <= 0x11632) || // Mc [3] MODI VOWEL SIGN AA..MODI VOWEL SIGN II + (0x1163B <= code && code <= 0x1163C) || // Mc [2] MODI VOWEL SIGN O..MODI VOWEL SIGN AU + 0x1163E == code || // Mc MODI SIGN VISARGA + 0x116AC == code || // Mc TAKRI SIGN VISARGA + (0x116AE <= code && code <= 0x116AF) || // Mc [2] TAKRI VOWEL SIGN I..TAKRI VOWEL SIGN II + 0x116B6 == code || // Mc TAKRI SIGN VIRAMA + (0x11720 <= code && code <= 0x11721) || // Mc [2] AHOM VOWEL SIGN A..AHOM VOWEL SIGN AA + 0x11726 == code || // Mc AHOM VOWEL SIGN E + (0x11A07 <= code && code <= 0x11A08) || // Mc [2] ZANABAZAR SQUARE VOWEL SIGN AI..ZANABAZAR SQUARE VOWEL SIGN AU + 0x11A39 == code || // Mc ZANABAZAR SQUARE SIGN VISARGA + (0x11A57 <= code && code <= 0x11A58) || // Mc [2] SOYOMBO VOWEL SIGN AI..SOYOMBO VOWEL SIGN AU + 0x11A97 == code || // Mc SOYOMBO SIGN VISARGA + 0x11C2F == code || // Mc BHAIKSUKI VOWEL SIGN AA + 0x11C3E == code || // Mc BHAIKSUKI SIGN VISARGA + 0x11CA9 == code || // Mc MARCHEN SUBJOINED LETTER YA + 0x11CB1 == code || // Mc MARCHEN VOWEL SIGN I + 0x11CB4 == code || // Mc MARCHEN VOWEL SIGN O + (0x16F51 <= code && code <= 0x16F7E) || // Mc [46] MIAO SIGN ASPIRATION..MIAO VOWEL SIGN NG + 0x1D166 == code || // Mc MUSICAL SYMBOL COMBINING SPRECHGESANG STEM + 0x1D16D == code // Mc MUSICAL SYMBOL COMBINING AUGMENTATION DOT + ){ + return SpacingMark; + } + + + if( + (0x1100 <= code && code <= 0x115F) || // Lo [96] HANGUL CHOSEONG KIYEOK..HANGUL CHOSEONG FILLER + (0xA960 <= code && code <= 0xA97C) // Lo [29] HANGUL CHOSEONG TIKEUT-MIEUM..HANGUL CHOSEONG SSANGYEORINHIEUH + ){ + return L; + } + + if( + (0x1160 <= code && code <= 0x11A7) || // Lo [72] HANGUL JUNGSEONG FILLER..HANGUL JUNGSEONG O-YAE + (0xD7B0 <= code && code <= 0xD7C6) // Lo [23] HANGUL JUNGSEONG O-YEO..HANGUL JUNGSEONG ARAEA-E + ){ + return V; + } + + + if( + (0x11A8 <= code && code <= 0x11FF) || // Lo [88] HANGUL JONGSEONG KIYEOK..HANGUL JONGSEONG SSANGNIEUN + (0xD7CB <= code && code <= 0xD7FB) // Lo [49] HANGUL JONGSEONG NIEUN-RIEUL..HANGUL JONGSEONG PHIEUPH-THIEUTH + ){ + return T; + } + + if( + 0xAC00 == code || // Lo HANGUL SYLLABLE GA + 0xAC1C == code || // Lo HANGUL SYLLABLE GAE + 0xAC38 == code || // Lo HANGUL SYLLABLE GYA + 0xAC54 == code || // Lo HANGUL SYLLABLE GYAE + 0xAC70 == code || // Lo HANGUL SYLLABLE GEO + 0xAC8C == code || // Lo HANGUL SYLLABLE GE + 0xACA8 == code || // Lo HANGUL SYLLABLE GYEO + 0xACC4 == code || // Lo HANGUL SYLLABLE GYE + 0xACE0 == code || // Lo HANGUL SYLLABLE GO + 0xACFC == code || // Lo HANGUL SYLLABLE GWA + 0xAD18 == code || // Lo HANGUL SYLLABLE GWAE + 0xAD34 == code || // Lo HANGUL SYLLABLE GOE + 0xAD50 == code || // Lo HANGUL SYLLABLE GYO + 0xAD6C == code || // Lo HANGUL SYLLABLE GU + 0xAD88 == code || // Lo HANGUL SYLLABLE GWEO + 0xADA4 == code || // Lo HANGUL SYLLABLE GWE + 0xADC0 == code || // Lo HANGUL SYLLABLE GWI + 0xADDC == code || // Lo HANGUL SYLLABLE GYU + 0xADF8 == code || // Lo HANGUL SYLLABLE GEU + 0xAE14 == code || // Lo HANGUL SYLLABLE GYI + 0xAE30 == code || // Lo HANGUL SYLLABLE GI + 0xAE4C == code || // Lo HANGUL SYLLABLE GGA + 0xAE68 == code || // Lo HANGUL SYLLABLE GGAE + 0xAE84 == code || // Lo HANGUL SYLLABLE GGYA + 0xAEA0 == code || // Lo HANGUL SYLLABLE GGYAE + 0xAEBC == code || // Lo HANGUL SYLLABLE GGEO + 0xAED8 == code || // Lo HANGUL SYLLABLE GGE + 0xAEF4 == code || // Lo HANGUL SYLLABLE GGYEO + 0xAF10 == code || // Lo HANGUL SYLLABLE GGYE + 0xAF2C == code || // Lo HANGUL SYLLABLE GGO + 0xAF48 == code || // Lo HANGUL SYLLABLE GGWA + 0xAF64 == code || // Lo HANGUL SYLLABLE GGWAE + 0xAF80 == code || // Lo HANGUL SYLLABLE GGOE + 0xAF9C == code || // Lo HANGUL SYLLABLE GGYO + 0xAFB8 == code || // Lo HANGUL SYLLABLE GGU + 0xAFD4 == code || // Lo HANGUL SYLLABLE GGWEO + 0xAFF0 == code || // Lo HANGUL SYLLABLE GGWE + 0xB00C == code || // Lo HANGUL SYLLABLE GGWI + 0xB028 == code || // Lo HANGUL SYLLABLE GGYU + 0xB044 == code || // Lo HANGUL SYLLABLE GGEU + 0xB060 == code || // Lo HANGUL SYLLABLE GGYI + 0xB07C == code || // Lo HANGUL SYLLABLE GGI + 0xB098 == code || // Lo HANGUL SYLLABLE NA + 0xB0B4 == code || // Lo HANGUL SYLLABLE NAE + 0xB0D0 == code || // Lo HANGUL SYLLABLE NYA + 0xB0EC == code || // Lo HANGUL SYLLABLE NYAE + 0xB108 == code || // Lo HANGUL SYLLABLE NEO + 0xB124 == code || // Lo HANGUL SYLLABLE NE + 0xB140 == code || // Lo HANGUL SYLLABLE NYEO + 0xB15C == code || // Lo HANGUL SYLLABLE NYE + 0xB178 == code || // Lo HANGUL SYLLABLE NO + 0xB194 == code || // Lo HANGUL SYLLABLE NWA + 0xB1B0 == code || // Lo HANGUL SYLLABLE NWAE + 0xB1CC == code || // Lo HANGUL SYLLABLE NOE + 0xB1E8 == code || // Lo HANGUL SYLLABLE NYO + 0xB204 == code || // Lo HANGUL SYLLABLE NU + 0xB220 == code || // Lo HANGUL SYLLABLE NWEO + 0xB23C == code || // Lo HANGUL SYLLABLE NWE + 0xB258 == code || // Lo HANGUL SYLLABLE NWI + 0xB274 == code || // Lo HANGUL SYLLABLE NYU + 0xB290 == code || // Lo HANGUL SYLLABLE NEU + 0xB2AC == code || // Lo HANGUL SYLLABLE NYI + 0xB2C8 == code || // Lo HANGUL SYLLABLE NI + 0xB2E4 == code || // Lo HANGUL SYLLABLE DA + 0xB300 == code || // Lo HANGUL SYLLABLE DAE + 0xB31C == code || // Lo HANGUL SYLLABLE DYA + 0xB338 == code || // Lo HANGUL SYLLABLE DYAE + 0xB354 == code || // Lo HANGUL SYLLABLE DEO + 0xB370 == code || // Lo HANGUL SYLLABLE DE + 0xB38C == code || // Lo HANGUL SYLLABLE DYEO + 0xB3A8 == code || // Lo HANGUL SYLLABLE DYE + 0xB3C4 == code || // Lo HANGUL SYLLABLE DO + 0xB3E0 == code || // Lo HANGUL SYLLABLE DWA + 0xB3FC == code || // Lo HANGUL SYLLABLE DWAE + 0xB418 == code || // Lo HANGUL SYLLABLE DOE + 0xB434 == code || // Lo HANGUL SYLLABLE DYO + 0xB450 == code || // Lo HANGUL SYLLABLE DU + 0xB46C == code || // Lo HANGUL SYLLABLE DWEO + 0xB488 == code || // Lo HANGUL SYLLABLE DWE + 0xB4A4 == code || // Lo HANGUL SYLLABLE DWI + 0xB4C0 == code || // Lo HANGUL SYLLABLE DYU + 0xB4DC == code || // Lo HANGUL SYLLABLE DEU + 0xB4F8 == code || // Lo HANGUL SYLLABLE DYI + 0xB514 == code || // Lo HANGUL SYLLABLE DI + 0xB530 == code || // Lo HANGUL SYLLABLE DDA + 0xB54C == code || // Lo HANGUL SYLLABLE DDAE + 0xB568 == code || // Lo HANGUL SYLLABLE DDYA + 0xB584 == code || // Lo HANGUL SYLLABLE DDYAE + 0xB5A0 == code || // Lo HANGUL SYLLABLE DDEO + 0xB5BC == code || // Lo HANGUL SYLLABLE DDE + 0xB5D8 == code || // Lo HANGUL SYLLABLE DDYEO + 0xB5F4 == code || // Lo HANGUL SYLLABLE DDYE + 0xB610 == code || // Lo HANGUL SYLLABLE DDO + 0xB62C == code || // Lo HANGUL SYLLABLE DDWA + 0xB648 == code || // Lo HANGUL SYLLABLE DDWAE + 0xB664 == code || // Lo HANGUL SYLLABLE DDOE + 0xB680 == code || // Lo HANGUL SYLLABLE DDYO + 0xB69C == code || // Lo HANGUL SYLLABLE DDU + 0xB6B8 == code || // Lo HANGUL SYLLABLE DDWEO + 0xB6D4 == code || // Lo HANGUL SYLLABLE DDWE + 0xB6F0 == code || // Lo HANGUL SYLLABLE DDWI + 0xB70C == code || // Lo HANGUL SYLLABLE DDYU + 0xB728 == code || // Lo HANGUL SYLLABLE DDEU + 0xB744 == code || // Lo HANGUL SYLLABLE DDYI + 0xB760 == code || // Lo HANGUL SYLLABLE DDI + 0xB77C == code || // Lo HANGUL SYLLABLE RA + 0xB798 == code || // Lo HANGUL SYLLABLE RAE + 0xB7B4 == code || // Lo HANGUL SYLLABLE RYA + 0xB7D0 == code || // Lo HANGUL SYLLABLE RYAE + 0xB7EC == code || // Lo HANGUL SYLLABLE REO + 0xB808 == code || // Lo HANGUL SYLLABLE RE + 0xB824 == code || // Lo HANGUL SYLLABLE RYEO + 0xB840 == code || // Lo HANGUL SYLLABLE RYE + 0xB85C == code || // Lo HANGUL SYLLABLE RO + 0xB878 == code || // Lo HANGUL SYLLABLE RWA + 0xB894 == code || // Lo HANGUL SYLLABLE RWAE + 0xB8B0 == code || // Lo HANGUL SYLLABLE ROE + 0xB8CC == code || // Lo HANGUL SYLLABLE RYO + 0xB8E8 == code || // Lo HANGUL SYLLABLE RU + 0xB904 == code || // Lo HANGUL SYLLABLE RWEO + 0xB920 == code || // Lo HANGUL SYLLABLE RWE + 0xB93C == code || // Lo HANGUL SYLLABLE RWI + 0xB958 == code || // Lo HANGUL SYLLABLE RYU + 0xB974 == code || // Lo HANGUL SYLLABLE REU + 0xB990 == code || // Lo HANGUL SYLLABLE RYI + 0xB9AC == code || // Lo HANGUL SYLLABLE RI + 0xB9C8 == code || // Lo HANGUL SYLLABLE MA + 0xB9E4 == code || // Lo HANGUL SYLLABLE MAE + 0xBA00 == code || // Lo HANGUL SYLLABLE MYA + 0xBA1C == code || // Lo HANGUL SYLLABLE MYAE + 0xBA38 == code || // Lo HANGUL SYLLABLE MEO + 0xBA54 == code || // Lo HANGUL SYLLABLE ME + 0xBA70 == code || // Lo HANGUL SYLLABLE MYEO + 0xBA8C == code || // Lo HANGUL SYLLABLE MYE + 0xBAA8 == code || // Lo HANGUL SYLLABLE MO + 0xBAC4 == code || // Lo HANGUL SYLLABLE MWA + 0xBAE0 == code || // Lo HANGUL SYLLABLE MWAE + 0xBAFC == code || // Lo HANGUL SYLLABLE MOE + 0xBB18 == code || // Lo HANGUL SYLLABLE MYO + 0xBB34 == code || // Lo HANGUL SYLLABLE MU + 0xBB50 == code || // Lo HANGUL SYLLABLE MWEO + 0xBB6C == code || // Lo HANGUL SYLLABLE MWE + 0xBB88 == code || // Lo HANGUL SYLLABLE MWI + 0xBBA4 == code || // Lo HANGUL SYLLABLE MYU + 0xBBC0 == code || // Lo HANGUL SYLLABLE MEU + 0xBBDC == code || // Lo HANGUL SYLLABLE MYI + 0xBBF8 == code || // Lo HANGUL SYLLABLE MI + 0xBC14 == code || // Lo HANGUL SYLLABLE BA + 0xBC30 == code || // Lo HANGUL SYLLABLE BAE + 0xBC4C == code || // Lo HANGUL SYLLABLE BYA + 0xBC68 == code || // Lo HANGUL SYLLABLE BYAE + 0xBC84 == code || // Lo HANGUL SYLLABLE BEO + 0xBCA0 == code || // Lo HANGUL SYLLABLE BE + 0xBCBC == code || // Lo HANGUL SYLLABLE BYEO + 0xBCD8 == code || // Lo HANGUL SYLLABLE BYE + 0xBCF4 == code || // Lo HANGUL SYLLABLE BO + 0xBD10 == code || // Lo HANGUL SYLLABLE BWA + 0xBD2C == code || // Lo HANGUL SYLLABLE BWAE + 0xBD48 == code || // Lo HANGUL SYLLABLE BOE + 0xBD64 == code || // Lo HANGUL SYLLABLE BYO + 0xBD80 == code || // Lo HANGUL SYLLABLE BU + 0xBD9C == code || // Lo HANGUL SYLLABLE BWEO + 0xBDB8 == code || // Lo HANGUL SYLLABLE BWE + 0xBDD4 == code || // Lo HANGUL SYLLABLE BWI + 0xBDF0 == code || // Lo HANGUL SYLLABLE BYU + 0xBE0C == code || // Lo HANGUL SYLLABLE BEU + 0xBE28 == code || // Lo HANGUL SYLLABLE BYI + 0xBE44 == code || // Lo HANGUL SYLLABLE BI + 0xBE60 == code || // Lo HANGUL SYLLABLE BBA + 0xBE7C == code || // Lo HANGUL SYLLABLE BBAE + 0xBE98 == code || // Lo HANGUL SYLLABLE BBYA + 0xBEB4 == code || // Lo HANGUL SYLLABLE BBYAE + 0xBED0 == code || // Lo HANGUL SYLLABLE BBEO + 0xBEEC == code || // Lo HANGUL SYLLABLE BBE + 0xBF08 == code || // Lo HANGUL SYLLABLE BBYEO + 0xBF24 == code || // Lo HANGUL SYLLABLE BBYE + 0xBF40 == code || // Lo HANGUL SYLLABLE BBO + 0xBF5C == code || // Lo HANGUL SYLLABLE BBWA + 0xBF78 == code || // Lo HANGUL SYLLABLE BBWAE + 0xBF94 == code || // Lo HANGUL SYLLABLE BBOE + 0xBFB0 == code || // Lo HANGUL SYLLABLE BBYO + 0xBFCC == code || // Lo HANGUL SYLLABLE BBU + 0xBFE8 == code || // Lo HANGUL SYLLABLE BBWEO + 0xC004 == code || // Lo HANGUL SYLLABLE BBWE + 0xC020 == code || // Lo HANGUL SYLLABLE BBWI + 0xC03C == code || // Lo HANGUL SYLLABLE BBYU + 0xC058 == code || // Lo HANGUL SYLLABLE BBEU + 0xC074 == code || // Lo HANGUL SYLLABLE BBYI + 0xC090 == code || // Lo HANGUL SYLLABLE BBI + 0xC0AC == code || // Lo HANGUL SYLLABLE SA + 0xC0C8 == code || // Lo HANGUL SYLLABLE SAE + 0xC0E4 == code || // Lo HANGUL SYLLABLE SYA + 0xC100 == code || // Lo HANGUL SYLLABLE SYAE + 0xC11C == code || // Lo HANGUL SYLLABLE SEO + 0xC138 == code || // Lo HANGUL SYLLABLE SE + 0xC154 == code || // Lo HANGUL SYLLABLE SYEO + 0xC170 == code || // Lo HANGUL SYLLABLE SYE + 0xC18C == code || // Lo HANGUL SYLLABLE SO + 0xC1A8 == code || // Lo HANGUL SYLLABLE SWA + 0xC1C4 == code || // Lo HANGUL SYLLABLE SWAE + 0xC1E0 == code || // Lo HANGUL SYLLABLE SOE + 0xC1FC == code || // Lo HANGUL SYLLABLE SYO + 0xC218 == code || // Lo HANGUL SYLLABLE SU + 0xC234 == code || // Lo HANGUL SYLLABLE SWEO + 0xC250 == code || // Lo HANGUL SYLLABLE SWE + 0xC26C == code || // Lo HANGUL SYLLABLE SWI + 0xC288 == code || // Lo HANGUL SYLLABLE SYU + 0xC2A4 == code || // Lo HANGUL SYLLABLE SEU + 0xC2C0 == code || // Lo HANGUL SYLLABLE SYI + 0xC2DC == code || // Lo HANGUL SYLLABLE SI + 0xC2F8 == code || // Lo HANGUL SYLLABLE SSA + 0xC314 == code || // Lo HANGUL SYLLABLE SSAE + 0xC330 == code || // Lo HANGUL SYLLABLE SSYA + 0xC34C == code || // Lo HANGUL SYLLABLE SSYAE + 0xC368 == code || // Lo HANGUL SYLLABLE SSEO + 0xC384 == code || // Lo HANGUL SYLLABLE SSE + 0xC3A0 == code || // Lo HANGUL SYLLABLE SSYEO + 0xC3BC == code || // Lo HANGUL SYLLABLE SSYE + 0xC3D8 == code || // Lo HANGUL SYLLABLE SSO + 0xC3F4 == code || // Lo HANGUL SYLLABLE SSWA + 0xC410 == code || // Lo HANGUL SYLLABLE SSWAE + 0xC42C == code || // Lo HANGUL SYLLABLE SSOE + 0xC448 == code || // Lo HANGUL SYLLABLE SSYO + 0xC464 == code || // Lo HANGUL SYLLABLE SSU + 0xC480 == code || // Lo HANGUL SYLLABLE SSWEO + 0xC49C == code || // Lo HANGUL SYLLABLE SSWE + 0xC4B8 == code || // Lo HANGUL SYLLABLE SSWI + 0xC4D4 == code || // Lo HANGUL SYLLABLE SSYU + 0xC4F0 == code || // Lo HANGUL SYLLABLE SSEU + 0xC50C == code || // Lo HANGUL SYLLABLE SSYI + 0xC528 == code || // Lo HANGUL SYLLABLE SSI + 0xC544 == code || // Lo HANGUL SYLLABLE A + 0xC560 == code || // Lo HANGUL SYLLABLE AE + 0xC57C == code || // Lo HANGUL SYLLABLE YA + 0xC598 == code || // Lo HANGUL SYLLABLE YAE + 0xC5B4 == code || // Lo HANGUL SYLLABLE EO + 0xC5D0 == code || // Lo HANGUL SYLLABLE E + 0xC5EC == code || // Lo HANGUL SYLLABLE YEO + 0xC608 == code || // Lo HANGUL SYLLABLE YE + 0xC624 == code || // Lo HANGUL SYLLABLE O + 0xC640 == code || // Lo HANGUL SYLLABLE WA + 0xC65C == code || // Lo HANGUL SYLLABLE WAE + 0xC678 == code || // Lo HANGUL SYLLABLE OE + 0xC694 == code || // Lo HANGUL SYLLABLE YO + 0xC6B0 == code || // Lo HANGUL SYLLABLE U + 0xC6CC == code || // Lo HANGUL SYLLABLE WEO + 0xC6E8 == code || // Lo HANGUL SYLLABLE WE + 0xC704 == code || // Lo HANGUL SYLLABLE WI + 0xC720 == code || // Lo HANGUL SYLLABLE YU + 0xC73C == code || // Lo HANGUL SYLLABLE EU + 0xC758 == code || // Lo HANGUL SYLLABLE YI + 0xC774 == code || // Lo HANGUL SYLLABLE I + 0xC790 == code || // Lo HANGUL SYLLABLE JA + 0xC7AC == code || // Lo HANGUL SYLLABLE JAE + 0xC7C8 == code || // Lo HANGUL SYLLABLE JYA + 0xC7E4 == code || // Lo HANGUL SYLLABLE JYAE + 0xC800 == code || // Lo HANGUL SYLLABLE JEO + 0xC81C == code || // Lo HANGUL SYLLABLE JE + 0xC838 == code || // Lo HANGUL SYLLABLE JYEO + 0xC854 == code || // Lo HANGUL SYLLABLE JYE + 0xC870 == code || // Lo HANGUL SYLLABLE JO + 0xC88C == code || // Lo HANGUL SYLLABLE JWA + 0xC8A8 == code || // Lo HANGUL SYLLABLE JWAE + 0xC8C4 == code || // Lo HANGUL SYLLABLE JOE + 0xC8E0 == code || // Lo HANGUL SYLLABLE JYO + 0xC8FC == code || // Lo HANGUL SYLLABLE JU + 0xC918 == code || // Lo HANGUL SYLLABLE JWEO + 0xC934 == code || // Lo HANGUL SYLLABLE JWE + 0xC950 == code || // Lo HANGUL SYLLABLE JWI + 0xC96C == code || // Lo HANGUL SYLLABLE JYU + 0xC988 == code || // Lo HANGUL SYLLABLE JEU + 0xC9A4 == code || // Lo HANGUL SYLLABLE JYI + 0xC9C0 == code || // Lo HANGUL SYLLABLE JI + 0xC9DC == code || // Lo HANGUL SYLLABLE JJA + 0xC9F8 == code || // Lo HANGUL SYLLABLE JJAE + 0xCA14 == code || // Lo HANGUL SYLLABLE JJYA + 0xCA30 == code || // Lo HANGUL SYLLABLE JJYAE + 0xCA4C == code || // Lo HANGUL SYLLABLE JJEO + 0xCA68 == code || // Lo HANGUL SYLLABLE JJE + 0xCA84 == code || // Lo HANGUL SYLLABLE JJYEO + 0xCAA0 == code || // Lo HANGUL SYLLABLE JJYE + 0xCABC == code || // Lo HANGUL SYLLABLE JJO + 0xCAD8 == code || // Lo HANGUL SYLLABLE JJWA + 0xCAF4 == code || // Lo HANGUL SYLLABLE JJWAE + 0xCB10 == code || // Lo HANGUL SYLLABLE JJOE + 0xCB2C == code || // Lo HANGUL SYLLABLE JJYO + 0xCB48 == code || // Lo HANGUL SYLLABLE JJU + 0xCB64 == code || // Lo HANGUL SYLLABLE JJWEO + 0xCB80 == code || // Lo HANGUL SYLLABLE JJWE + 0xCB9C == code || // Lo HANGUL SYLLABLE JJWI + 0xCBB8 == code || // Lo HANGUL SYLLABLE JJYU + 0xCBD4 == code || // Lo HANGUL SYLLABLE JJEU + 0xCBF0 == code || // Lo HANGUL SYLLABLE JJYI + 0xCC0C == code || // Lo HANGUL SYLLABLE JJI + 0xCC28 == code || // Lo HANGUL SYLLABLE CA + 0xCC44 == code || // Lo HANGUL SYLLABLE CAE + 0xCC60 == code || // Lo HANGUL SYLLABLE CYA + 0xCC7C == code || // Lo HANGUL SYLLABLE CYAE + 0xCC98 == code || // Lo HANGUL SYLLABLE CEO + 0xCCB4 == code || // Lo HANGUL SYLLABLE CE + 0xCCD0 == code || // Lo HANGUL SYLLABLE CYEO + 0xCCEC == code || // Lo HANGUL SYLLABLE CYE + 0xCD08 == code || // Lo HANGUL SYLLABLE CO + 0xCD24 == code || // Lo HANGUL SYLLABLE CWA + 0xCD40 == code || // Lo HANGUL SYLLABLE CWAE + 0xCD5C == code || // Lo HANGUL SYLLABLE COE + 0xCD78 == code || // Lo HANGUL SYLLABLE CYO + 0xCD94 == code || // Lo HANGUL SYLLABLE CU + 0xCDB0 == code || // Lo HANGUL SYLLABLE CWEO + 0xCDCC == code || // Lo HANGUL SYLLABLE CWE + 0xCDE8 == code || // Lo HANGUL SYLLABLE CWI + 0xCE04 == code || // Lo HANGUL SYLLABLE CYU + 0xCE20 == code || // Lo HANGUL SYLLABLE CEU + 0xCE3C == code || // Lo HANGUL SYLLABLE CYI + 0xCE58 == code || // Lo HANGUL SYLLABLE CI + 0xCE74 == code || // Lo HANGUL SYLLABLE KA + 0xCE90 == code || // Lo HANGUL SYLLABLE KAE + 0xCEAC == code || // Lo HANGUL SYLLABLE KYA + 0xCEC8 == code || // Lo HANGUL SYLLABLE KYAE + 0xCEE4 == code || // Lo HANGUL SYLLABLE KEO + 0xCF00 == code || // Lo HANGUL SYLLABLE KE + 0xCF1C == code || // Lo HANGUL SYLLABLE KYEO + 0xCF38 == code || // Lo HANGUL SYLLABLE KYE + 0xCF54 == code || // Lo HANGUL SYLLABLE KO + 0xCF70 == code || // Lo HANGUL SYLLABLE KWA + 0xCF8C == code || // Lo HANGUL SYLLABLE KWAE + 0xCFA8 == code || // Lo HANGUL SYLLABLE KOE + 0xCFC4 == code || // Lo HANGUL SYLLABLE KYO + 0xCFE0 == code || // Lo HANGUL SYLLABLE KU + 0xCFFC == code || // Lo HANGUL SYLLABLE KWEO + 0xD018 == code || // Lo HANGUL SYLLABLE KWE + 0xD034 == code || // Lo HANGUL SYLLABLE KWI + 0xD050 == code || // Lo HANGUL SYLLABLE KYU + 0xD06C == code || // Lo HANGUL SYLLABLE KEU + 0xD088 == code || // Lo HANGUL SYLLABLE KYI + 0xD0A4 == code || // Lo HANGUL SYLLABLE KI + 0xD0C0 == code || // Lo HANGUL SYLLABLE TA + 0xD0DC == code || // Lo HANGUL SYLLABLE TAE + 0xD0F8 == code || // Lo HANGUL SYLLABLE TYA + 0xD114 == code || // Lo HANGUL SYLLABLE TYAE + 0xD130 == code || // Lo HANGUL SYLLABLE TEO + 0xD14C == code || // Lo HANGUL SYLLABLE TE + 0xD168 == code || // Lo HANGUL SYLLABLE TYEO + 0xD184 == code || // Lo HANGUL SYLLABLE TYE + 0xD1A0 == code || // Lo HANGUL SYLLABLE TO + 0xD1BC == code || // Lo HANGUL SYLLABLE TWA + 0xD1D8 == code || // Lo HANGUL SYLLABLE TWAE + 0xD1F4 == code || // Lo HANGUL SYLLABLE TOE + 0xD210 == code || // Lo HANGUL SYLLABLE TYO + 0xD22C == code || // Lo HANGUL SYLLABLE TU + 0xD248 == code || // Lo HANGUL SYLLABLE TWEO + 0xD264 == code || // Lo HANGUL SYLLABLE TWE + 0xD280 == code || // Lo HANGUL SYLLABLE TWI + 0xD29C == code || // Lo HANGUL SYLLABLE TYU + 0xD2B8 == code || // Lo HANGUL SYLLABLE TEU + 0xD2D4 == code || // Lo HANGUL SYLLABLE TYI + 0xD2F0 == code || // Lo HANGUL SYLLABLE TI + 0xD30C == code || // Lo HANGUL SYLLABLE PA + 0xD328 == code || // Lo HANGUL SYLLABLE PAE + 0xD344 == code || // Lo HANGUL SYLLABLE PYA + 0xD360 == code || // Lo HANGUL SYLLABLE PYAE + 0xD37C == code || // Lo HANGUL SYLLABLE PEO + 0xD398 == code || // Lo HANGUL SYLLABLE PE + 0xD3B4 == code || // Lo HANGUL SYLLABLE PYEO + 0xD3D0 == code || // Lo HANGUL SYLLABLE PYE + 0xD3EC == code || // Lo HANGUL SYLLABLE PO + 0xD408 == code || // Lo HANGUL SYLLABLE PWA + 0xD424 == code || // Lo HANGUL SYLLABLE PWAE + 0xD440 == code || // Lo HANGUL SYLLABLE POE + 0xD45C == code || // Lo HANGUL SYLLABLE PYO + 0xD478 == code || // Lo HANGUL SYLLABLE PU + 0xD494 == code || // Lo HANGUL SYLLABLE PWEO + 0xD4B0 == code || // Lo HANGUL SYLLABLE PWE + 0xD4CC == code || // Lo HANGUL SYLLABLE PWI + 0xD4E8 == code || // Lo HANGUL SYLLABLE PYU + 0xD504 == code || // Lo HANGUL SYLLABLE PEU + 0xD520 == code || // Lo HANGUL SYLLABLE PYI + 0xD53C == code || // Lo HANGUL SYLLABLE PI + 0xD558 == code || // Lo HANGUL SYLLABLE HA + 0xD574 == code || // Lo HANGUL SYLLABLE HAE + 0xD590 == code || // Lo HANGUL SYLLABLE HYA + 0xD5AC == code || // Lo HANGUL SYLLABLE HYAE + 0xD5C8 == code || // Lo HANGUL SYLLABLE HEO + 0xD5E4 == code || // Lo HANGUL SYLLABLE HE + 0xD600 == code || // Lo HANGUL SYLLABLE HYEO + 0xD61C == code || // Lo HANGUL SYLLABLE HYE + 0xD638 == code || // Lo HANGUL SYLLABLE HO + 0xD654 == code || // Lo HANGUL SYLLABLE HWA + 0xD670 == code || // Lo HANGUL SYLLABLE HWAE + 0xD68C == code || // Lo HANGUL SYLLABLE HOE + 0xD6A8 == code || // Lo HANGUL SYLLABLE HYO + 0xD6C4 == code || // Lo HANGUL SYLLABLE HU + 0xD6E0 == code || // Lo HANGUL SYLLABLE HWEO + 0xD6FC == code || // Lo HANGUL SYLLABLE HWE + 0xD718 == code || // Lo HANGUL SYLLABLE HWI + 0xD734 == code || // Lo HANGUL SYLLABLE HYU + 0xD750 == code || // Lo HANGUL SYLLABLE HEU + 0xD76C == code || // Lo HANGUL SYLLABLE HYI + 0xD788 == code // Lo HANGUL SYLLABLE HI + ){ + return LV; + } + + if( + (0xAC01 <= code && code <= 0xAC1B) || // Lo [27] HANGUL SYLLABLE GAG..HANGUL SYLLABLE GAH + (0xAC1D <= code && code <= 0xAC37) || // Lo [27] HANGUL SYLLABLE GAEG..HANGUL SYLLABLE GAEH + (0xAC39 <= code && code <= 0xAC53) || // Lo [27] HANGUL SYLLABLE GYAG..HANGUL SYLLABLE GYAH + (0xAC55 <= code && code <= 0xAC6F) || // Lo [27] HANGUL SYLLABLE GYAEG..HANGUL SYLLABLE GYAEH + (0xAC71 <= code && code <= 0xAC8B) || // Lo [27] HANGUL SYLLABLE GEOG..HANGUL SYLLABLE GEOH + (0xAC8D <= code && code <= 0xACA7) || // Lo [27] HANGUL SYLLABLE GEG..HANGUL SYLLABLE GEH + (0xACA9 <= code && code <= 0xACC3) || // Lo [27] HANGUL SYLLABLE GYEOG..HANGUL SYLLABLE GYEOH + (0xACC5 <= code && code <= 0xACDF) || // Lo [27] HANGUL SYLLABLE GYEG..HANGUL SYLLABLE GYEH + (0xACE1 <= code && code <= 0xACFB) || // Lo [27] HANGUL SYLLABLE GOG..HANGUL SYLLABLE GOH + (0xACFD <= code && code <= 0xAD17) || // Lo [27] HANGUL SYLLABLE GWAG..HANGUL SYLLABLE GWAH + (0xAD19 <= code && code <= 0xAD33) || // Lo [27] HANGUL SYLLABLE GWAEG..HANGUL SYLLABLE GWAEH + (0xAD35 <= code && code <= 0xAD4F) || // Lo [27] HANGUL SYLLABLE GOEG..HANGUL SYLLABLE GOEH + (0xAD51 <= code && code <= 0xAD6B) || // Lo [27] HANGUL SYLLABLE GYOG..HANGUL SYLLABLE GYOH + (0xAD6D <= code && code <= 0xAD87) || // Lo [27] HANGUL SYLLABLE GUG..HANGUL SYLLABLE GUH + (0xAD89 <= code && code <= 0xADA3) || // Lo [27] HANGUL SYLLABLE GWEOG..HANGUL SYLLABLE GWEOH + (0xADA5 <= code && code <= 0xADBF) || // Lo [27] HANGUL SYLLABLE GWEG..HANGUL SYLLABLE GWEH + (0xADC1 <= code && code <= 0xADDB) || // Lo [27] HANGUL SYLLABLE GWIG..HANGUL SYLLABLE GWIH + (0xADDD <= code && code <= 0xADF7) || // Lo [27] HANGUL SYLLABLE GYUG..HANGUL SYLLABLE GYUH + (0xADF9 <= code && code <= 0xAE13) || // Lo [27] HANGUL SYLLABLE GEUG..HANGUL SYLLABLE GEUH + (0xAE15 <= code && code <= 0xAE2F) || // Lo [27] HANGUL SYLLABLE GYIG..HANGUL SYLLABLE GYIH + (0xAE31 <= code && code <= 0xAE4B) || // Lo [27] HANGUL SYLLABLE GIG..HANGUL SYLLABLE GIH + (0xAE4D <= code && code <= 0xAE67) || // Lo [27] HANGUL SYLLABLE GGAG..HANGUL SYLLABLE GGAH + (0xAE69 <= code && code <= 0xAE83) || // Lo [27] HANGUL SYLLABLE GGAEG..HANGUL SYLLABLE GGAEH + (0xAE85 <= code && code <= 0xAE9F) || // Lo [27] HANGUL SYLLABLE GGYAG..HANGUL SYLLABLE GGYAH + (0xAEA1 <= code && code <= 0xAEBB) || // Lo [27] HANGUL SYLLABLE GGYAEG..HANGUL SYLLABLE GGYAEH + (0xAEBD <= code && code <= 0xAED7) || // Lo [27] HANGUL SYLLABLE GGEOG..HANGUL SYLLABLE GGEOH + (0xAED9 <= code && code <= 0xAEF3) || // Lo [27] HANGUL SYLLABLE GGEG..HANGUL SYLLABLE GGEH + (0xAEF5 <= code && code <= 0xAF0F) || // Lo [27] HANGUL SYLLABLE GGYEOG..HANGUL SYLLABLE GGYEOH + (0xAF11 <= code && code <= 0xAF2B) || // Lo [27] HANGUL SYLLABLE GGYEG..HANGUL SYLLABLE GGYEH + (0xAF2D <= code && code <= 0xAF47) || // Lo [27] HANGUL SYLLABLE GGOG..HANGUL SYLLABLE GGOH + (0xAF49 <= code && code <= 0xAF63) || // Lo [27] HANGUL SYLLABLE GGWAG..HANGUL SYLLABLE GGWAH + (0xAF65 <= code && code <= 0xAF7F) || // Lo [27] HANGUL SYLLABLE GGWAEG..HANGUL SYLLABLE GGWAEH + (0xAF81 <= code && code <= 0xAF9B) || // Lo [27] HANGUL SYLLABLE GGOEG..HANGUL SYLLABLE GGOEH + (0xAF9D <= code && code <= 0xAFB7) || // Lo [27] HANGUL SYLLABLE GGYOG..HANGUL SYLLABLE GGYOH + (0xAFB9 <= code && code <= 0xAFD3) || // Lo [27] HANGUL SYLLABLE GGUG..HANGUL SYLLABLE GGUH + (0xAFD5 <= code && code <= 0xAFEF) || // Lo [27] HANGUL SYLLABLE GGWEOG..HANGUL SYLLABLE GGWEOH + (0xAFF1 <= code && code <= 0xB00B) || // Lo [27] HANGUL SYLLABLE GGWEG..HANGUL SYLLABLE GGWEH + (0xB00D <= code && code <= 0xB027) || // Lo [27] HANGUL SYLLABLE GGWIG..HANGUL SYLLABLE GGWIH + (0xB029 <= code && code <= 0xB043) || // Lo [27] HANGUL SYLLABLE GGYUG..HANGUL SYLLABLE GGYUH + (0xB045 <= code && code <= 0xB05F) || // Lo [27] HANGUL SYLLABLE GGEUG..HANGUL SYLLABLE GGEUH + (0xB061 <= code && code <= 0xB07B) || // Lo [27] HANGUL SYLLABLE GGYIG..HANGUL SYLLABLE GGYIH + (0xB07D <= code && code <= 0xB097) || // Lo [27] HANGUL SYLLABLE GGIG..HANGUL SYLLABLE GGIH + (0xB099 <= code && code <= 0xB0B3) || // Lo [27] HANGUL SYLLABLE NAG..HANGUL SYLLABLE NAH + (0xB0B5 <= code && code <= 0xB0CF) || // Lo [27] HANGUL SYLLABLE NAEG..HANGUL SYLLABLE NAEH + (0xB0D1 <= code && code <= 0xB0EB) || // Lo [27] HANGUL SYLLABLE NYAG..HANGUL SYLLABLE NYAH + (0xB0ED <= code && code <= 0xB107) || // Lo [27] HANGUL SYLLABLE NYAEG..HANGUL SYLLABLE NYAEH + (0xB109 <= code && code <= 0xB123) || // Lo [27] HANGUL SYLLABLE NEOG..HANGUL SYLLABLE NEOH + (0xB125 <= code && code <= 0xB13F) || // Lo [27] HANGUL SYLLABLE NEG..HANGUL SYLLABLE NEH + (0xB141 <= code && code <= 0xB15B) || // Lo [27] HANGUL SYLLABLE NYEOG..HANGUL SYLLABLE NYEOH + (0xB15D <= code && code <= 0xB177) || // Lo [27] HANGUL SYLLABLE NYEG..HANGUL SYLLABLE NYEH + (0xB179 <= code && code <= 0xB193) || // Lo [27] HANGUL SYLLABLE NOG..HANGUL SYLLABLE NOH + (0xB195 <= code && code <= 0xB1AF) || // Lo [27] HANGUL SYLLABLE NWAG..HANGUL SYLLABLE NWAH + (0xB1B1 <= code && code <= 0xB1CB) || // Lo [27] HANGUL SYLLABLE NWAEG..HANGUL SYLLABLE NWAEH + (0xB1CD <= code && code <= 0xB1E7) || // Lo [27] HANGUL SYLLABLE NOEG..HANGUL SYLLABLE NOEH + (0xB1E9 <= code && code <= 0xB203) || // Lo [27] HANGUL SYLLABLE NYOG..HANGUL SYLLABLE NYOH + (0xB205 <= code && code <= 0xB21F) || // Lo [27] HANGUL SYLLABLE NUG..HANGUL SYLLABLE NUH + (0xB221 <= code && code <= 0xB23B) || // Lo [27] HANGUL SYLLABLE NWEOG..HANGUL SYLLABLE NWEOH + (0xB23D <= code && code <= 0xB257) || // Lo [27] HANGUL SYLLABLE NWEG..HANGUL SYLLABLE NWEH + (0xB259 <= code && code <= 0xB273) || // Lo [27] HANGUL SYLLABLE NWIG..HANGUL SYLLABLE NWIH + (0xB275 <= code && code <= 0xB28F) || // Lo [27] HANGUL SYLLABLE NYUG..HANGUL SYLLABLE NYUH + (0xB291 <= code && code <= 0xB2AB) || // Lo [27] HANGUL SYLLABLE NEUG..HANGUL SYLLABLE NEUH + (0xB2AD <= code && code <= 0xB2C7) || // Lo [27] HANGUL SYLLABLE NYIG..HANGUL SYLLABLE NYIH + (0xB2C9 <= code && code <= 0xB2E3) || // Lo [27] HANGUL SYLLABLE NIG..HANGUL SYLLABLE NIH + (0xB2E5 <= code && code <= 0xB2FF) || // Lo [27] HANGUL SYLLABLE DAG..HANGUL SYLLABLE DAH + (0xB301 <= code && code <= 0xB31B) || // Lo [27] HANGUL SYLLABLE DAEG..HANGUL SYLLABLE DAEH + (0xB31D <= code && code <= 0xB337) || // Lo [27] HANGUL SYLLABLE DYAG..HANGUL SYLLABLE DYAH + (0xB339 <= code && code <= 0xB353) || // Lo [27] HANGUL SYLLABLE DYAEG..HANGUL SYLLABLE DYAEH + (0xB355 <= code && code <= 0xB36F) || // Lo [27] HANGUL SYLLABLE DEOG..HANGUL SYLLABLE DEOH + (0xB371 <= code && code <= 0xB38B) || // Lo [27] HANGUL SYLLABLE DEG..HANGUL SYLLABLE DEH + (0xB38D <= code && code <= 0xB3A7) || // Lo [27] HANGUL SYLLABLE DYEOG..HANGUL SYLLABLE DYEOH + (0xB3A9 <= code && code <= 0xB3C3) || // Lo [27] HANGUL SYLLABLE DYEG..HANGUL SYLLABLE DYEH + (0xB3C5 <= code && code <= 0xB3DF) || // Lo [27] HANGUL SYLLABLE DOG..HANGUL SYLLABLE DOH + (0xB3E1 <= code && code <= 0xB3FB) || // Lo [27] HANGUL SYLLABLE DWAG..HANGUL SYLLABLE DWAH + (0xB3FD <= code && code <= 0xB417) || // Lo [27] HANGUL SYLLABLE DWAEG..HANGUL SYLLABLE DWAEH + (0xB419 <= code && code <= 0xB433) || // Lo [27] HANGUL SYLLABLE DOEG..HANGUL SYLLABLE DOEH + (0xB435 <= code && code <= 0xB44F) || // Lo [27] HANGUL SYLLABLE DYOG..HANGUL SYLLABLE DYOH + (0xB451 <= code && code <= 0xB46B) || // Lo [27] HANGUL SYLLABLE DUG..HANGUL SYLLABLE DUH + (0xB46D <= code && code <= 0xB487) || // Lo [27] HANGUL SYLLABLE DWEOG..HANGUL SYLLABLE DWEOH + (0xB489 <= code && code <= 0xB4A3) || // Lo [27] HANGUL SYLLABLE DWEG..HANGUL SYLLABLE DWEH + (0xB4A5 <= code && code <= 0xB4BF) || // Lo [27] HANGUL SYLLABLE DWIG..HANGUL SYLLABLE DWIH + (0xB4C1 <= code && code <= 0xB4DB) || // Lo [27] HANGUL SYLLABLE DYUG..HANGUL SYLLABLE DYUH + (0xB4DD <= code && code <= 0xB4F7) || // Lo [27] HANGUL SYLLABLE DEUG..HANGUL SYLLABLE DEUH + (0xB4F9 <= code && code <= 0xB513) || // Lo [27] HANGUL SYLLABLE DYIG..HANGUL SYLLABLE DYIH + (0xB515 <= code && code <= 0xB52F) || // Lo [27] HANGUL SYLLABLE DIG..HANGUL SYLLABLE DIH + (0xB531 <= code && code <= 0xB54B) || // Lo [27] HANGUL SYLLABLE DDAG..HANGUL SYLLABLE DDAH + (0xB54D <= code && code <= 0xB567) || // Lo [27] HANGUL SYLLABLE DDAEG..HANGUL SYLLABLE DDAEH + (0xB569 <= code && code <= 0xB583) || // Lo [27] HANGUL SYLLABLE DDYAG..HANGUL SYLLABLE DDYAH + (0xB585 <= code && code <= 0xB59F) || // Lo [27] HANGUL SYLLABLE DDYAEG..HANGUL SYLLABLE DDYAEH + (0xB5A1 <= code && code <= 0xB5BB) || // Lo [27] HANGUL SYLLABLE DDEOG..HANGUL SYLLABLE DDEOH + (0xB5BD <= code && code <= 0xB5D7) || // Lo [27] HANGUL SYLLABLE DDEG..HANGUL SYLLABLE DDEH + (0xB5D9 <= code && code <= 0xB5F3) || // Lo [27] HANGUL SYLLABLE DDYEOG..HANGUL SYLLABLE DDYEOH + (0xB5F5 <= code && code <= 0xB60F) || // Lo [27] HANGUL SYLLABLE DDYEG..HANGUL SYLLABLE DDYEH + (0xB611 <= code && code <= 0xB62B) || // Lo [27] HANGUL SYLLABLE DDOG..HANGUL SYLLABLE DDOH + (0xB62D <= code && code <= 0xB647) || // Lo [27] HANGUL SYLLABLE DDWAG..HANGUL SYLLABLE DDWAH + (0xB649 <= code && code <= 0xB663) || // Lo [27] HANGUL SYLLABLE DDWAEG..HANGUL SYLLABLE DDWAEH + (0xB665 <= code && code <= 0xB67F) || // Lo [27] HANGUL SYLLABLE DDOEG..HANGUL SYLLABLE DDOEH + (0xB681 <= code && code <= 0xB69B) || // Lo [27] HANGUL SYLLABLE DDYOG..HANGUL SYLLABLE DDYOH + (0xB69D <= code && code <= 0xB6B7) || // Lo [27] HANGUL SYLLABLE DDUG..HANGUL SYLLABLE DDUH + (0xB6B9 <= code && code <= 0xB6D3) || // Lo [27] HANGUL SYLLABLE DDWEOG..HANGUL SYLLABLE DDWEOH + (0xB6D5 <= code && code <= 0xB6EF) || // Lo [27] HANGUL SYLLABLE DDWEG..HANGUL SYLLABLE DDWEH + (0xB6F1 <= code && code <= 0xB70B) || // Lo [27] HANGUL SYLLABLE DDWIG..HANGUL SYLLABLE DDWIH + (0xB70D <= code && code <= 0xB727) || // Lo [27] HANGUL SYLLABLE DDYUG..HANGUL SYLLABLE DDYUH + (0xB729 <= code && code <= 0xB743) || // Lo [27] HANGUL SYLLABLE DDEUG..HANGUL SYLLABLE DDEUH + (0xB745 <= code && code <= 0xB75F) || // Lo [27] HANGUL SYLLABLE DDYIG..HANGUL SYLLABLE DDYIH + (0xB761 <= code && code <= 0xB77B) || // Lo [27] HANGUL SYLLABLE DDIG..HANGUL SYLLABLE DDIH + (0xB77D <= code && code <= 0xB797) || // Lo [27] HANGUL SYLLABLE RAG..HANGUL SYLLABLE RAH + (0xB799 <= code && code <= 0xB7B3) || // Lo [27] HANGUL SYLLABLE RAEG..HANGUL SYLLABLE RAEH + (0xB7B5 <= code && code <= 0xB7CF) || // Lo [27] HANGUL SYLLABLE RYAG..HANGUL SYLLABLE RYAH + (0xB7D1 <= code && code <= 0xB7EB) || // Lo [27] HANGUL SYLLABLE RYAEG..HANGUL SYLLABLE RYAEH + (0xB7ED <= code && code <= 0xB807) || // Lo [27] HANGUL SYLLABLE REOG..HANGUL SYLLABLE REOH + (0xB809 <= code && code <= 0xB823) || // Lo [27] HANGUL SYLLABLE REG..HANGUL SYLLABLE REH + (0xB825 <= code && code <= 0xB83F) || // Lo [27] HANGUL SYLLABLE RYEOG..HANGUL SYLLABLE RYEOH + (0xB841 <= code && code <= 0xB85B) || // Lo [27] HANGUL SYLLABLE RYEG..HANGUL SYLLABLE RYEH + (0xB85D <= code && code <= 0xB877) || // Lo [27] HANGUL SYLLABLE ROG..HANGUL SYLLABLE ROH + (0xB879 <= code && code <= 0xB893) || // Lo [27] HANGUL SYLLABLE RWAG..HANGUL SYLLABLE RWAH + (0xB895 <= code && code <= 0xB8AF) || // Lo [27] HANGUL SYLLABLE RWAEG..HANGUL SYLLABLE RWAEH + (0xB8B1 <= code && code <= 0xB8CB) || // Lo [27] HANGUL SYLLABLE ROEG..HANGUL SYLLABLE ROEH + (0xB8CD <= code && code <= 0xB8E7) || // Lo [27] HANGUL SYLLABLE RYOG..HANGUL SYLLABLE RYOH + (0xB8E9 <= code && code <= 0xB903) || // Lo [27] HANGUL SYLLABLE RUG..HANGUL SYLLABLE RUH + (0xB905 <= code && code <= 0xB91F) || // Lo [27] HANGUL SYLLABLE RWEOG..HANGUL SYLLABLE RWEOH + (0xB921 <= code && code <= 0xB93B) || // Lo [27] HANGUL SYLLABLE RWEG..HANGUL SYLLABLE RWEH + (0xB93D <= code && code <= 0xB957) || // Lo [27] HANGUL SYLLABLE RWIG..HANGUL SYLLABLE RWIH + (0xB959 <= code && code <= 0xB973) || // Lo [27] HANGUL SYLLABLE RYUG..HANGUL SYLLABLE RYUH + (0xB975 <= code && code <= 0xB98F) || // Lo [27] HANGUL SYLLABLE REUG..HANGUL SYLLABLE REUH + (0xB991 <= code && code <= 0xB9AB) || // Lo [27] HANGUL SYLLABLE RYIG..HANGUL SYLLABLE RYIH + (0xB9AD <= code && code <= 0xB9C7) || // Lo [27] HANGUL SYLLABLE RIG..HANGUL SYLLABLE RIH + (0xB9C9 <= code && code <= 0xB9E3) || // Lo [27] HANGUL SYLLABLE MAG..HANGUL SYLLABLE MAH + (0xB9E5 <= code && code <= 0xB9FF) || // Lo [27] HANGUL SYLLABLE MAEG..HANGUL SYLLABLE MAEH + (0xBA01 <= code && code <= 0xBA1B) || // Lo [27] HANGUL SYLLABLE MYAG..HANGUL SYLLABLE MYAH + (0xBA1D <= code && code <= 0xBA37) || // Lo [27] HANGUL SYLLABLE MYAEG..HANGUL SYLLABLE MYAEH + (0xBA39 <= code && code <= 0xBA53) || // Lo [27] HANGUL SYLLABLE MEOG..HANGUL SYLLABLE MEOH + (0xBA55 <= code && code <= 0xBA6F) || // Lo [27] HANGUL SYLLABLE MEG..HANGUL SYLLABLE MEH + (0xBA71 <= code && code <= 0xBA8B) || // Lo [27] HANGUL SYLLABLE MYEOG..HANGUL SYLLABLE MYEOH + (0xBA8D <= code && code <= 0xBAA7) || // Lo [27] HANGUL SYLLABLE MYEG..HANGUL SYLLABLE MYEH + (0xBAA9 <= code && code <= 0xBAC3) || // Lo [27] HANGUL SYLLABLE MOG..HANGUL SYLLABLE MOH + (0xBAC5 <= code && code <= 0xBADF) || // Lo [27] HANGUL SYLLABLE MWAG..HANGUL SYLLABLE MWAH + (0xBAE1 <= code && code <= 0xBAFB) || // Lo [27] HANGUL SYLLABLE MWAEG..HANGUL SYLLABLE MWAEH + (0xBAFD <= code && code <= 0xBB17) || // Lo [27] HANGUL SYLLABLE MOEG..HANGUL SYLLABLE MOEH + (0xBB19 <= code && code <= 0xBB33) || // Lo [27] HANGUL SYLLABLE MYOG..HANGUL SYLLABLE MYOH + (0xBB35 <= code && code <= 0xBB4F) || // Lo [27] HANGUL SYLLABLE MUG..HANGUL SYLLABLE MUH + (0xBB51 <= code && code <= 0xBB6B) || // Lo [27] HANGUL SYLLABLE MWEOG..HANGUL SYLLABLE MWEOH + (0xBB6D <= code && code <= 0xBB87) || // Lo [27] HANGUL SYLLABLE MWEG..HANGUL SYLLABLE MWEH + (0xBB89 <= code && code <= 0xBBA3) || // Lo [27] HANGUL SYLLABLE MWIG..HANGUL SYLLABLE MWIH + (0xBBA5 <= code && code <= 0xBBBF) || // Lo [27] HANGUL SYLLABLE MYUG..HANGUL SYLLABLE MYUH + (0xBBC1 <= code && code <= 0xBBDB) || // Lo [27] HANGUL SYLLABLE MEUG..HANGUL SYLLABLE MEUH + (0xBBDD <= code && code <= 0xBBF7) || // Lo [27] HANGUL SYLLABLE MYIG..HANGUL SYLLABLE MYIH + (0xBBF9 <= code && code <= 0xBC13) || // Lo [27] HANGUL SYLLABLE MIG..HANGUL SYLLABLE MIH + (0xBC15 <= code && code <= 0xBC2F) || // Lo [27] HANGUL SYLLABLE BAG..HANGUL SYLLABLE BAH + (0xBC31 <= code && code <= 0xBC4B) || // Lo [27] HANGUL SYLLABLE BAEG..HANGUL SYLLABLE BAEH + (0xBC4D <= code && code <= 0xBC67) || // Lo [27] HANGUL SYLLABLE BYAG..HANGUL SYLLABLE BYAH + (0xBC69 <= code && code <= 0xBC83) || // Lo [27] HANGUL SYLLABLE BYAEG..HANGUL SYLLABLE BYAEH + (0xBC85 <= code && code <= 0xBC9F) || // Lo [27] HANGUL SYLLABLE BEOG..HANGUL SYLLABLE BEOH + (0xBCA1 <= code && code <= 0xBCBB) || // Lo [27] HANGUL SYLLABLE BEG..HANGUL SYLLABLE BEH + (0xBCBD <= code && code <= 0xBCD7) || // Lo [27] HANGUL SYLLABLE BYEOG..HANGUL SYLLABLE BYEOH + (0xBCD9 <= code && code <= 0xBCF3) || // Lo [27] HANGUL SYLLABLE BYEG..HANGUL SYLLABLE BYEH + (0xBCF5 <= code && code <= 0xBD0F) || // Lo [27] HANGUL SYLLABLE BOG..HANGUL SYLLABLE BOH + (0xBD11 <= code && code <= 0xBD2B) || // Lo [27] HANGUL SYLLABLE BWAG..HANGUL SYLLABLE BWAH + (0xBD2D <= code && code <= 0xBD47) || // Lo [27] HANGUL SYLLABLE BWAEG..HANGUL SYLLABLE BWAEH + (0xBD49 <= code && code <= 0xBD63) || // Lo [27] HANGUL SYLLABLE BOEG..HANGUL SYLLABLE BOEH + (0xBD65 <= code && code <= 0xBD7F) || // Lo [27] HANGUL SYLLABLE BYOG..HANGUL SYLLABLE BYOH + (0xBD81 <= code && code <= 0xBD9B) || // Lo [27] HANGUL SYLLABLE BUG..HANGUL SYLLABLE BUH + (0xBD9D <= code && code <= 0xBDB7) || // Lo [27] HANGUL SYLLABLE BWEOG..HANGUL SYLLABLE BWEOH + (0xBDB9 <= code && code <= 0xBDD3) || // Lo [27] HANGUL SYLLABLE BWEG..HANGUL SYLLABLE BWEH + (0xBDD5 <= code && code <= 0xBDEF) || // Lo [27] HANGUL SYLLABLE BWIG..HANGUL SYLLABLE BWIH + (0xBDF1 <= code && code <= 0xBE0B) || // Lo [27] HANGUL SYLLABLE BYUG..HANGUL SYLLABLE BYUH + (0xBE0D <= code && code <= 0xBE27) || // Lo [27] HANGUL SYLLABLE BEUG..HANGUL SYLLABLE BEUH + (0xBE29 <= code && code <= 0xBE43) || // Lo [27] HANGUL SYLLABLE BYIG..HANGUL SYLLABLE BYIH + (0xBE45 <= code && code <= 0xBE5F) || // Lo [27] HANGUL SYLLABLE BIG..HANGUL SYLLABLE BIH + (0xBE61 <= code && code <= 0xBE7B) || // Lo [27] HANGUL SYLLABLE BBAG..HANGUL SYLLABLE BBAH + (0xBE7D <= code && code <= 0xBE97) || // Lo [27] HANGUL SYLLABLE BBAEG..HANGUL SYLLABLE BBAEH + (0xBE99 <= code && code <= 0xBEB3) || // Lo [27] HANGUL SYLLABLE BBYAG..HANGUL SYLLABLE BBYAH + (0xBEB5 <= code && code <= 0xBECF) || // Lo [27] HANGUL SYLLABLE BBYAEG..HANGUL SYLLABLE BBYAEH + (0xBED1 <= code && code <= 0xBEEB) || // Lo [27] HANGUL SYLLABLE BBEOG..HANGUL SYLLABLE BBEOH + (0xBEED <= code && code <= 0xBF07) || // Lo [27] HANGUL SYLLABLE BBEG..HANGUL SYLLABLE BBEH + (0xBF09 <= code && code <= 0xBF23) || // Lo [27] HANGUL SYLLABLE BBYEOG..HANGUL SYLLABLE BBYEOH + (0xBF25 <= code && code <= 0xBF3F) || // Lo [27] HANGUL SYLLABLE BBYEG..HANGUL SYLLABLE BBYEH + (0xBF41 <= code && code <= 0xBF5B) || // Lo [27] HANGUL SYLLABLE BBOG..HANGUL SYLLABLE BBOH + (0xBF5D <= code && code <= 0xBF77) || // Lo [27] HANGUL SYLLABLE BBWAG..HANGUL SYLLABLE BBWAH + (0xBF79 <= code && code <= 0xBF93) || // Lo [27] HANGUL SYLLABLE BBWAEG..HANGUL SYLLABLE BBWAEH + (0xBF95 <= code && code <= 0xBFAF) || // Lo [27] HANGUL SYLLABLE BBOEG..HANGUL SYLLABLE BBOEH + (0xBFB1 <= code && code <= 0xBFCB) || // Lo [27] HANGUL SYLLABLE BBYOG..HANGUL SYLLABLE BBYOH + (0xBFCD <= code && code <= 0xBFE7) || // Lo [27] HANGUL SYLLABLE BBUG..HANGUL SYLLABLE BBUH + (0xBFE9 <= code && code <= 0xC003) || // Lo [27] HANGUL SYLLABLE BBWEOG..HANGUL SYLLABLE BBWEOH + (0xC005 <= code && code <= 0xC01F) || // Lo [27] HANGUL SYLLABLE BBWEG..HANGUL SYLLABLE BBWEH + (0xC021 <= code && code <= 0xC03B) || // Lo [27] HANGUL SYLLABLE BBWIG..HANGUL SYLLABLE BBWIH + (0xC03D <= code && code <= 0xC057) || // Lo [27] HANGUL SYLLABLE BBYUG..HANGUL SYLLABLE BBYUH + (0xC059 <= code && code <= 0xC073) || // Lo [27] HANGUL SYLLABLE BBEUG..HANGUL SYLLABLE BBEUH + (0xC075 <= code && code <= 0xC08F) || // Lo [27] HANGUL SYLLABLE BBYIG..HANGUL SYLLABLE BBYIH + (0xC091 <= code && code <= 0xC0AB) || // Lo [27] HANGUL SYLLABLE BBIG..HANGUL SYLLABLE BBIH + (0xC0AD <= code && code <= 0xC0C7) || // Lo [27] HANGUL SYLLABLE SAG..HANGUL SYLLABLE SAH + (0xC0C9 <= code && code <= 0xC0E3) || // Lo [27] HANGUL SYLLABLE SAEG..HANGUL SYLLABLE SAEH + (0xC0E5 <= code && code <= 0xC0FF) || // Lo [27] HANGUL SYLLABLE SYAG..HANGUL SYLLABLE SYAH + (0xC101 <= code && code <= 0xC11B) || // Lo [27] HANGUL SYLLABLE SYAEG..HANGUL SYLLABLE SYAEH + (0xC11D <= code && code <= 0xC137) || // Lo [27] HANGUL SYLLABLE SEOG..HANGUL SYLLABLE SEOH + (0xC139 <= code && code <= 0xC153) || // Lo [27] HANGUL SYLLABLE SEG..HANGUL SYLLABLE SEH + (0xC155 <= code && code <= 0xC16F) || // Lo [27] HANGUL SYLLABLE SYEOG..HANGUL SYLLABLE SYEOH + (0xC171 <= code && code <= 0xC18B) || // Lo [27] HANGUL SYLLABLE SYEG..HANGUL SYLLABLE SYEH + (0xC18D <= code && code <= 0xC1A7) || // Lo [27] HANGUL SYLLABLE SOG..HANGUL SYLLABLE SOH + (0xC1A9 <= code && code <= 0xC1C3) || // Lo [27] HANGUL SYLLABLE SWAG..HANGUL SYLLABLE SWAH + (0xC1C5 <= code && code <= 0xC1DF) || // Lo [27] HANGUL SYLLABLE SWAEG..HANGUL SYLLABLE SWAEH + (0xC1E1 <= code && code <= 0xC1FB) || // Lo [27] HANGUL SYLLABLE SOEG..HANGUL SYLLABLE SOEH + (0xC1FD <= code && code <= 0xC217) || // Lo [27] HANGUL SYLLABLE SYOG..HANGUL SYLLABLE SYOH + (0xC219 <= code && code <= 0xC233) || // Lo [27] HANGUL SYLLABLE SUG..HANGUL SYLLABLE SUH + (0xC235 <= code && code <= 0xC24F) || // Lo [27] HANGUL SYLLABLE SWEOG..HANGUL SYLLABLE SWEOH + (0xC251 <= code && code <= 0xC26B) || // Lo [27] HANGUL SYLLABLE SWEG..HANGUL SYLLABLE SWEH + (0xC26D <= code && code <= 0xC287) || // Lo [27] HANGUL SYLLABLE SWIG..HANGUL SYLLABLE SWIH + (0xC289 <= code && code <= 0xC2A3) || // Lo [27] HANGUL SYLLABLE SYUG..HANGUL SYLLABLE SYUH + (0xC2A5 <= code && code <= 0xC2BF) || // Lo [27] HANGUL SYLLABLE SEUG..HANGUL SYLLABLE SEUH + (0xC2C1 <= code && code <= 0xC2DB) || // Lo [27] HANGUL SYLLABLE SYIG..HANGUL SYLLABLE SYIH + (0xC2DD <= code && code <= 0xC2F7) || // Lo [27] HANGUL SYLLABLE SIG..HANGUL SYLLABLE SIH + (0xC2F9 <= code && code <= 0xC313) || // Lo [27] HANGUL SYLLABLE SSAG..HANGUL SYLLABLE SSAH + (0xC315 <= code && code <= 0xC32F) || // Lo [27] HANGUL SYLLABLE SSAEG..HANGUL SYLLABLE SSAEH + (0xC331 <= code && code <= 0xC34B) || // Lo [27] HANGUL SYLLABLE SSYAG..HANGUL SYLLABLE SSYAH + (0xC34D <= code && code <= 0xC367) || // Lo [27] HANGUL SYLLABLE SSYAEG..HANGUL SYLLABLE SSYAEH + (0xC369 <= code && code <= 0xC383) || // Lo [27] HANGUL SYLLABLE SSEOG..HANGUL SYLLABLE SSEOH + (0xC385 <= code && code <= 0xC39F) || // Lo [27] HANGUL SYLLABLE SSEG..HANGUL SYLLABLE SSEH + (0xC3A1 <= code && code <= 0xC3BB) || // Lo [27] HANGUL SYLLABLE SSYEOG..HANGUL SYLLABLE SSYEOH + (0xC3BD <= code && code <= 0xC3D7) || // Lo [27] HANGUL SYLLABLE SSYEG..HANGUL SYLLABLE SSYEH + (0xC3D9 <= code && code <= 0xC3F3) || // Lo [27] HANGUL SYLLABLE SSOG..HANGUL SYLLABLE SSOH + (0xC3F5 <= code && code <= 0xC40F) || // Lo [27] HANGUL SYLLABLE SSWAG..HANGUL SYLLABLE SSWAH + (0xC411 <= code && code <= 0xC42B) || // Lo [27] HANGUL SYLLABLE SSWAEG..HANGUL SYLLABLE SSWAEH + (0xC42D <= code && code <= 0xC447) || // Lo [27] HANGUL SYLLABLE SSOEG..HANGUL SYLLABLE SSOEH + (0xC449 <= code && code <= 0xC463) || // Lo [27] HANGUL SYLLABLE SSYOG..HANGUL SYLLABLE SSYOH + (0xC465 <= code && code <= 0xC47F) || // Lo [27] HANGUL SYLLABLE SSUG..HANGUL SYLLABLE SSUH + (0xC481 <= code && code <= 0xC49B) || // Lo [27] HANGUL SYLLABLE SSWEOG..HANGUL SYLLABLE SSWEOH + (0xC49D <= code && code <= 0xC4B7) || // Lo [27] HANGUL SYLLABLE SSWEG..HANGUL SYLLABLE SSWEH + (0xC4B9 <= code && code <= 0xC4D3) || // Lo [27] HANGUL SYLLABLE SSWIG..HANGUL SYLLABLE SSWIH + (0xC4D5 <= code && code <= 0xC4EF) || // Lo [27] HANGUL SYLLABLE SSYUG..HANGUL SYLLABLE SSYUH + (0xC4F1 <= code && code <= 0xC50B) || // Lo [27] HANGUL SYLLABLE SSEUG..HANGUL SYLLABLE SSEUH + (0xC50D <= code && code <= 0xC527) || // Lo [27] HANGUL SYLLABLE SSYIG..HANGUL SYLLABLE SSYIH + (0xC529 <= code && code <= 0xC543) || // Lo [27] HANGUL SYLLABLE SSIG..HANGUL SYLLABLE SSIH + (0xC545 <= code && code <= 0xC55F) || // Lo [27] HANGUL SYLLABLE AG..HANGUL SYLLABLE AH + (0xC561 <= code && code <= 0xC57B) || // Lo [27] HANGUL SYLLABLE AEG..HANGUL SYLLABLE AEH + (0xC57D <= code && code <= 0xC597) || // Lo [27] HANGUL SYLLABLE YAG..HANGUL SYLLABLE YAH + (0xC599 <= code && code <= 0xC5B3) || // Lo [27] HANGUL SYLLABLE YAEG..HANGUL SYLLABLE YAEH + (0xC5B5 <= code && code <= 0xC5CF) || // Lo [27] HANGUL SYLLABLE EOG..HANGUL SYLLABLE EOH + (0xC5D1 <= code && code <= 0xC5EB) || // Lo [27] HANGUL SYLLABLE EG..HANGUL SYLLABLE EH + (0xC5ED <= code && code <= 0xC607) || // Lo [27] HANGUL SYLLABLE YEOG..HANGUL SYLLABLE YEOH + (0xC609 <= code && code <= 0xC623) || // Lo [27] HANGUL SYLLABLE YEG..HANGUL SYLLABLE YEH + (0xC625 <= code && code <= 0xC63F) || // Lo [27] HANGUL SYLLABLE OG..HANGUL SYLLABLE OH + (0xC641 <= code && code <= 0xC65B) || // Lo [27] HANGUL SYLLABLE WAG..HANGUL SYLLABLE WAH + (0xC65D <= code && code <= 0xC677) || // Lo [27] HANGUL SYLLABLE WAEG..HANGUL SYLLABLE WAEH + (0xC679 <= code && code <= 0xC693) || // Lo [27] HANGUL SYLLABLE OEG..HANGUL SYLLABLE OEH + (0xC695 <= code && code <= 0xC6AF) || // Lo [27] HANGUL SYLLABLE YOG..HANGUL SYLLABLE YOH + (0xC6B1 <= code && code <= 0xC6CB) || // Lo [27] HANGUL SYLLABLE UG..HANGUL SYLLABLE UH + (0xC6CD <= code && code <= 0xC6E7) || // Lo [27] HANGUL SYLLABLE WEOG..HANGUL SYLLABLE WEOH + (0xC6E9 <= code && code <= 0xC703) || // Lo [27] HANGUL SYLLABLE WEG..HANGUL SYLLABLE WEH + (0xC705 <= code && code <= 0xC71F) || // Lo [27] HANGUL SYLLABLE WIG..HANGUL SYLLABLE WIH + (0xC721 <= code && code <= 0xC73B) || // Lo [27] HANGUL SYLLABLE YUG..HANGUL SYLLABLE YUH + (0xC73D <= code && code <= 0xC757) || // Lo [27] HANGUL SYLLABLE EUG..HANGUL SYLLABLE EUH + (0xC759 <= code && code <= 0xC773) || // Lo [27] HANGUL SYLLABLE YIG..HANGUL SYLLABLE YIH + (0xC775 <= code && code <= 0xC78F) || // Lo [27] HANGUL SYLLABLE IG..HANGUL SYLLABLE IH + (0xC791 <= code && code <= 0xC7AB) || // Lo [27] HANGUL SYLLABLE JAG..HANGUL SYLLABLE JAH + (0xC7AD <= code && code <= 0xC7C7) || // Lo [27] HANGUL SYLLABLE JAEG..HANGUL SYLLABLE JAEH + (0xC7C9 <= code && code <= 0xC7E3) || // Lo [27] HANGUL SYLLABLE JYAG..HANGUL SYLLABLE JYAH + (0xC7E5 <= code && code <= 0xC7FF) || // Lo [27] HANGUL SYLLABLE JYAEG..HANGUL SYLLABLE JYAEH + (0xC801 <= code && code <= 0xC81B) || // Lo [27] HANGUL SYLLABLE JEOG..HANGUL SYLLABLE JEOH + (0xC81D <= code && code <= 0xC837) || // Lo [27] HANGUL SYLLABLE JEG..HANGUL SYLLABLE JEH + (0xC839 <= code && code <= 0xC853) || // Lo [27] HANGUL SYLLABLE JYEOG..HANGUL SYLLABLE JYEOH + (0xC855 <= code && code <= 0xC86F) || // Lo [27] HANGUL SYLLABLE JYEG..HANGUL SYLLABLE JYEH + (0xC871 <= code && code <= 0xC88B) || // Lo [27] HANGUL SYLLABLE JOG..HANGUL SYLLABLE JOH + (0xC88D <= code && code <= 0xC8A7) || // Lo [27] HANGUL SYLLABLE JWAG..HANGUL SYLLABLE JWAH + (0xC8A9 <= code && code <= 0xC8C3) || // Lo [27] HANGUL SYLLABLE JWAEG..HANGUL SYLLABLE JWAEH + (0xC8C5 <= code && code <= 0xC8DF) || // Lo [27] HANGUL SYLLABLE JOEG..HANGUL SYLLABLE JOEH + (0xC8E1 <= code && code <= 0xC8FB) || // Lo [27] HANGUL SYLLABLE JYOG..HANGUL SYLLABLE JYOH + (0xC8FD <= code && code <= 0xC917) || // Lo [27] HANGUL SYLLABLE JUG..HANGUL SYLLABLE JUH + (0xC919 <= code && code <= 0xC933) || // Lo [27] HANGUL SYLLABLE JWEOG..HANGUL SYLLABLE JWEOH + (0xC935 <= code && code <= 0xC94F) || // Lo [27] HANGUL SYLLABLE JWEG..HANGUL SYLLABLE JWEH + (0xC951 <= code && code <= 0xC96B) || // Lo [27] HANGUL SYLLABLE JWIG..HANGUL SYLLABLE JWIH + (0xC96D <= code && code <= 0xC987) || // Lo [27] HANGUL SYLLABLE JYUG..HANGUL SYLLABLE JYUH + (0xC989 <= code && code <= 0xC9A3) || // Lo [27] HANGUL SYLLABLE JEUG..HANGUL SYLLABLE JEUH + (0xC9A5 <= code && code <= 0xC9BF) || // Lo [27] HANGUL SYLLABLE JYIG..HANGUL SYLLABLE JYIH + (0xC9C1 <= code && code <= 0xC9DB) || // Lo [27] HANGUL SYLLABLE JIG..HANGUL SYLLABLE JIH + (0xC9DD <= code && code <= 0xC9F7) || // Lo [27] HANGUL SYLLABLE JJAG..HANGUL SYLLABLE JJAH + (0xC9F9 <= code && code <= 0xCA13) || // Lo [27] HANGUL SYLLABLE JJAEG..HANGUL SYLLABLE JJAEH + (0xCA15 <= code && code <= 0xCA2F) || // Lo [27] HANGUL SYLLABLE JJYAG..HANGUL SYLLABLE JJYAH + (0xCA31 <= code && code <= 0xCA4B) || // Lo [27] HANGUL SYLLABLE JJYAEG..HANGUL SYLLABLE JJYAEH + (0xCA4D <= code && code <= 0xCA67) || // Lo [27] HANGUL SYLLABLE JJEOG..HANGUL SYLLABLE JJEOH + (0xCA69 <= code && code <= 0xCA83) || // Lo [27] HANGUL SYLLABLE JJEG..HANGUL SYLLABLE JJEH + (0xCA85 <= code && code <= 0xCA9F) || // Lo [27] HANGUL SYLLABLE JJYEOG..HANGUL SYLLABLE JJYEOH + (0xCAA1 <= code && code <= 0xCABB) || // Lo [27] HANGUL SYLLABLE JJYEG..HANGUL SYLLABLE JJYEH + (0xCABD <= code && code <= 0xCAD7) || // Lo [27] HANGUL SYLLABLE JJOG..HANGUL SYLLABLE JJOH + (0xCAD9 <= code && code <= 0xCAF3) || // Lo [27] HANGUL SYLLABLE JJWAG..HANGUL SYLLABLE JJWAH + (0xCAF5 <= code && code <= 0xCB0F) || // Lo [27] HANGUL SYLLABLE JJWAEG..HANGUL SYLLABLE JJWAEH + (0xCB11 <= code && code <= 0xCB2B) || // Lo [27] HANGUL SYLLABLE JJOEG..HANGUL SYLLABLE JJOEH + (0xCB2D <= code && code <= 0xCB47) || // Lo [27] HANGUL SYLLABLE JJYOG..HANGUL SYLLABLE JJYOH + (0xCB49 <= code && code <= 0xCB63) || // Lo [27] HANGUL SYLLABLE JJUG..HANGUL SYLLABLE JJUH + (0xCB65 <= code && code <= 0xCB7F) || // Lo [27] HANGUL SYLLABLE JJWEOG..HANGUL SYLLABLE JJWEOH + (0xCB81 <= code && code <= 0xCB9B) || // Lo [27] HANGUL SYLLABLE JJWEG..HANGUL SYLLABLE JJWEH + (0xCB9D <= code && code <= 0xCBB7) || // Lo [27] HANGUL SYLLABLE JJWIG..HANGUL SYLLABLE JJWIH + (0xCBB9 <= code && code <= 0xCBD3) || // Lo [27] HANGUL SYLLABLE JJYUG..HANGUL SYLLABLE JJYUH + (0xCBD5 <= code && code <= 0xCBEF) || // Lo [27] HANGUL SYLLABLE JJEUG..HANGUL SYLLABLE JJEUH + (0xCBF1 <= code && code <= 0xCC0B) || // Lo [27] HANGUL SYLLABLE JJYIG..HANGUL SYLLABLE JJYIH + (0xCC0D <= code && code <= 0xCC27) || // Lo [27] HANGUL SYLLABLE JJIG..HANGUL SYLLABLE JJIH + (0xCC29 <= code && code <= 0xCC43) || // Lo [27] HANGUL SYLLABLE CAG..HANGUL SYLLABLE CAH + (0xCC45 <= code && code <= 0xCC5F) || // Lo [27] HANGUL SYLLABLE CAEG..HANGUL SYLLABLE CAEH + (0xCC61 <= code && code <= 0xCC7B) || // Lo [27] HANGUL SYLLABLE CYAG..HANGUL SYLLABLE CYAH + (0xCC7D <= code && code <= 0xCC97) || // Lo [27] HANGUL SYLLABLE CYAEG..HANGUL SYLLABLE CYAEH + (0xCC99 <= code && code <= 0xCCB3) || // Lo [27] HANGUL SYLLABLE CEOG..HANGUL SYLLABLE CEOH + (0xCCB5 <= code && code <= 0xCCCF) || // Lo [27] HANGUL SYLLABLE CEG..HANGUL SYLLABLE CEH + (0xCCD1 <= code && code <= 0xCCEB) || // Lo [27] HANGUL SYLLABLE CYEOG..HANGUL SYLLABLE CYEOH + (0xCCED <= code && code <= 0xCD07) || // Lo [27] HANGUL SYLLABLE CYEG..HANGUL SYLLABLE CYEH + (0xCD09 <= code && code <= 0xCD23) || // Lo [27] HANGUL SYLLABLE COG..HANGUL SYLLABLE COH + (0xCD25 <= code && code <= 0xCD3F) || // Lo [27] HANGUL SYLLABLE CWAG..HANGUL SYLLABLE CWAH + (0xCD41 <= code && code <= 0xCD5B) || // Lo [27] HANGUL SYLLABLE CWAEG..HANGUL SYLLABLE CWAEH + (0xCD5D <= code && code <= 0xCD77) || // Lo [27] HANGUL SYLLABLE COEG..HANGUL SYLLABLE COEH + (0xCD79 <= code && code <= 0xCD93) || // Lo [27] HANGUL SYLLABLE CYOG..HANGUL SYLLABLE CYOH + (0xCD95 <= code && code <= 0xCDAF) || // Lo [27] HANGUL SYLLABLE CUG..HANGUL SYLLABLE CUH + (0xCDB1 <= code && code <= 0xCDCB) || // Lo [27] HANGUL SYLLABLE CWEOG..HANGUL SYLLABLE CWEOH + (0xCDCD <= code && code <= 0xCDE7) || // Lo [27] HANGUL SYLLABLE CWEG..HANGUL SYLLABLE CWEH + (0xCDE9 <= code && code <= 0xCE03) || // Lo [27] HANGUL SYLLABLE CWIG..HANGUL SYLLABLE CWIH + (0xCE05 <= code && code <= 0xCE1F) || // Lo [27] HANGUL SYLLABLE CYUG..HANGUL SYLLABLE CYUH + (0xCE21 <= code && code <= 0xCE3B) || // Lo [27] HANGUL SYLLABLE CEUG..HANGUL SYLLABLE CEUH + (0xCE3D <= code && code <= 0xCE57) || // Lo [27] HANGUL SYLLABLE CYIG..HANGUL SYLLABLE CYIH + (0xCE59 <= code && code <= 0xCE73) || // Lo [27] HANGUL SYLLABLE CIG..HANGUL SYLLABLE CIH + (0xCE75 <= code && code <= 0xCE8F) || // Lo [27] HANGUL SYLLABLE KAG..HANGUL SYLLABLE KAH + (0xCE91 <= code && code <= 0xCEAB) || // Lo [27] HANGUL SYLLABLE KAEG..HANGUL SYLLABLE KAEH + (0xCEAD <= code && code <= 0xCEC7) || // Lo [27] HANGUL SYLLABLE KYAG..HANGUL SYLLABLE KYAH + (0xCEC9 <= code && code <= 0xCEE3) || // Lo [27] HANGUL SYLLABLE KYAEG..HANGUL SYLLABLE KYAEH + (0xCEE5 <= code && code <= 0xCEFF) || // Lo [27] HANGUL SYLLABLE KEOG..HANGUL SYLLABLE KEOH + (0xCF01 <= code && code <= 0xCF1B) || // Lo [27] HANGUL SYLLABLE KEG..HANGUL SYLLABLE KEH + (0xCF1D <= code && code <= 0xCF37) || // Lo [27] HANGUL SYLLABLE KYEOG..HANGUL SYLLABLE KYEOH + (0xCF39 <= code && code <= 0xCF53) || // Lo [27] HANGUL SYLLABLE KYEG..HANGUL SYLLABLE KYEH + (0xCF55 <= code && code <= 0xCF6F) || // Lo [27] HANGUL SYLLABLE KOG..HANGUL SYLLABLE KOH + (0xCF71 <= code && code <= 0xCF8B) || // Lo [27] HANGUL SYLLABLE KWAG..HANGUL SYLLABLE KWAH + (0xCF8D <= code && code <= 0xCFA7) || // Lo [27] HANGUL SYLLABLE KWAEG..HANGUL SYLLABLE KWAEH + (0xCFA9 <= code && code <= 0xCFC3) || // Lo [27] HANGUL SYLLABLE KOEG..HANGUL SYLLABLE KOEH + (0xCFC5 <= code && code <= 0xCFDF) || // Lo [27] HANGUL SYLLABLE KYOG..HANGUL SYLLABLE KYOH + (0xCFE1 <= code && code <= 0xCFFB) || // Lo [27] HANGUL SYLLABLE KUG..HANGUL SYLLABLE KUH + (0xCFFD <= code && code <= 0xD017) || // Lo [27] HANGUL SYLLABLE KWEOG..HANGUL SYLLABLE KWEOH + (0xD019 <= code && code <= 0xD033) || // Lo [27] HANGUL SYLLABLE KWEG..HANGUL SYLLABLE KWEH + (0xD035 <= code && code <= 0xD04F) || // Lo [27] HANGUL SYLLABLE KWIG..HANGUL SYLLABLE KWIH + (0xD051 <= code && code <= 0xD06B) || // Lo [27] HANGUL SYLLABLE KYUG..HANGUL SYLLABLE KYUH + (0xD06D <= code && code <= 0xD087) || // Lo [27] HANGUL SYLLABLE KEUG..HANGUL SYLLABLE KEUH + (0xD089 <= code && code <= 0xD0A3) || // Lo [27] HANGUL SYLLABLE KYIG..HANGUL SYLLABLE KYIH + (0xD0A5 <= code && code <= 0xD0BF) || // Lo [27] HANGUL SYLLABLE KIG..HANGUL SYLLABLE KIH + (0xD0C1 <= code && code <= 0xD0DB) || // Lo [27] HANGUL SYLLABLE TAG..HANGUL SYLLABLE TAH + (0xD0DD <= code && code <= 0xD0F7) || // Lo [27] HANGUL SYLLABLE TAEG..HANGUL SYLLABLE TAEH + (0xD0F9 <= code && code <= 0xD113) || // Lo [27] HANGUL SYLLABLE TYAG..HANGUL SYLLABLE TYAH + (0xD115 <= code && code <= 0xD12F) || // Lo [27] HANGUL SYLLABLE TYAEG..HANGUL SYLLABLE TYAEH + (0xD131 <= code && code <= 0xD14B) || // Lo [27] HANGUL SYLLABLE TEOG..HANGUL SYLLABLE TEOH + (0xD14D <= code && code <= 0xD167) || // Lo [27] HANGUL SYLLABLE TEG..HANGUL SYLLABLE TEH + (0xD169 <= code && code <= 0xD183) || // Lo [27] HANGUL SYLLABLE TYEOG..HANGUL SYLLABLE TYEOH + (0xD185 <= code && code <= 0xD19F) || // Lo [27] HANGUL SYLLABLE TYEG..HANGUL SYLLABLE TYEH + (0xD1A1 <= code && code <= 0xD1BB) || // Lo [27] HANGUL SYLLABLE TOG..HANGUL SYLLABLE TOH + (0xD1BD <= code && code <= 0xD1D7) || // Lo [27] HANGUL SYLLABLE TWAG..HANGUL SYLLABLE TWAH + (0xD1D9 <= code && code <= 0xD1F3) || // Lo [27] HANGUL SYLLABLE TWAEG..HANGUL SYLLABLE TWAEH + (0xD1F5 <= code && code <= 0xD20F) || // Lo [27] HANGUL SYLLABLE TOEG..HANGUL SYLLABLE TOEH + (0xD211 <= code && code <= 0xD22B) || // Lo [27] HANGUL SYLLABLE TYOG..HANGUL SYLLABLE TYOH + (0xD22D <= code && code <= 0xD247) || // Lo [27] HANGUL SYLLABLE TUG..HANGUL SYLLABLE TUH + (0xD249 <= code && code <= 0xD263) || // Lo [27] HANGUL SYLLABLE TWEOG..HANGUL SYLLABLE TWEOH + (0xD265 <= code && code <= 0xD27F) || // Lo [27] HANGUL SYLLABLE TWEG..HANGUL SYLLABLE TWEH + (0xD281 <= code && code <= 0xD29B) || // Lo [27] HANGUL SYLLABLE TWIG..HANGUL SYLLABLE TWIH + (0xD29D <= code && code <= 0xD2B7) || // Lo [27] HANGUL SYLLABLE TYUG..HANGUL SYLLABLE TYUH + (0xD2B9 <= code && code <= 0xD2D3) || // Lo [27] HANGUL SYLLABLE TEUG..HANGUL SYLLABLE TEUH + (0xD2D5 <= code && code <= 0xD2EF) || // Lo [27] HANGUL SYLLABLE TYIG..HANGUL SYLLABLE TYIH + (0xD2F1 <= code && code <= 0xD30B) || // Lo [27] HANGUL SYLLABLE TIG..HANGUL SYLLABLE TIH + (0xD30D <= code && code <= 0xD327) || // Lo [27] HANGUL SYLLABLE PAG..HANGUL SYLLABLE PAH + (0xD329 <= code && code <= 0xD343) || // Lo [27] HANGUL SYLLABLE PAEG..HANGUL SYLLABLE PAEH + (0xD345 <= code && code <= 0xD35F) || // Lo [27] HANGUL SYLLABLE PYAG..HANGUL SYLLABLE PYAH + (0xD361 <= code && code <= 0xD37B) || // Lo [27] HANGUL SYLLABLE PYAEG..HANGUL SYLLABLE PYAEH + (0xD37D <= code && code <= 0xD397) || // Lo [27] HANGUL SYLLABLE PEOG..HANGUL SYLLABLE PEOH + (0xD399 <= code && code <= 0xD3B3) || // Lo [27] HANGUL SYLLABLE PEG..HANGUL SYLLABLE PEH + (0xD3B5 <= code && code <= 0xD3CF) || // Lo [27] HANGUL SYLLABLE PYEOG..HANGUL SYLLABLE PYEOH + (0xD3D1 <= code && code <= 0xD3EB) || // Lo [27] HANGUL SYLLABLE PYEG..HANGUL SYLLABLE PYEH + (0xD3ED <= code && code <= 0xD407) || // Lo [27] HANGUL SYLLABLE POG..HANGUL SYLLABLE POH + (0xD409 <= code && code <= 0xD423) || // Lo [27] HANGUL SYLLABLE PWAG..HANGUL SYLLABLE PWAH + (0xD425 <= code && code <= 0xD43F) || // Lo [27] HANGUL SYLLABLE PWAEG..HANGUL SYLLABLE PWAEH + (0xD441 <= code && code <= 0xD45B) || // Lo [27] HANGUL SYLLABLE POEG..HANGUL SYLLABLE POEH + (0xD45D <= code && code <= 0xD477) || // Lo [27] HANGUL SYLLABLE PYOG..HANGUL SYLLABLE PYOH + (0xD479 <= code && code <= 0xD493) || // Lo [27] HANGUL SYLLABLE PUG..HANGUL SYLLABLE PUH + (0xD495 <= code && code <= 0xD4AF) || // Lo [27] HANGUL SYLLABLE PWEOG..HANGUL SYLLABLE PWEOH + (0xD4B1 <= code && code <= 0xD4CB) || // Lo [27] HANGUL SYLLABLE PWEG..HANGUL SYLLABLE PWEH + (0xD4CD <= code && code <= 0xD4E7) || // Lo [27] HANGUL SYLLABLE PWIG..HANGUL SYLLABLE PWIH + (0xD4E9 <= code && code <= 0xD503) || // Lo [27] HANGUL SYLLABLE PYUG..HANGUL SYLLABLE PYUH + (0xD505 <= code && code <= 0xD51F) || // Lo [27] HANGUL SYLLABLE PEUG..HANGUL SYLLABLE PEUH + (0xD521 <= code && code <= 0xD53B) || // Lo [27] HANGUL SYLLABLE PYIG..HANGUL SYLLABLE PYIH + (0xD53D <= code && code <= 0xD557) || // Lo [27] HANGUL SYLLABLE PIG..HANGUL SYLLABLE PIH + (0xD559 <= code && code <= 0xD573) || // Lo [27] HANGUL SYLLABLE HAG..HANGUL SYLLABLE HAH + (0xD575 <= code && code <= 0xD58F) || // Lo [27] HANGUL SYLLABLE HAEG..HANGUL SYLLABLE HAEH + (0xD591 <= code && code <= 0xD5AB) || // Lo [27] HANGUL SYLLABLE HYAG..HANGUL SYLLABLE HYAH + (0xD5AD <= code && code <= 0xD5C7) || // Lo [27] HANGUL SYLLABLE HYAEG..HANGUL SYLLABLE HYAEH + (0xD5C9 <= code && code <= 0xD5E3) || // Lo [27] HANGUL SYLLABLE HEOG..HANGUL SYLLABLE HEOH + (0xD5E5 <= code && code <= 0xD5FF) || // Lo [27] HANGUL SYLLABLE HEG..HANGUL SYLLABLE HEH + (0xD601 <= code && code <= 0xD61B) || // Lo [27] HANGUL SYLLABLE HYEOG..HANGUL SYLLABLE HYEOH + (0xD61D <= code && code <= 0xD637) || // Lo [27] HANGUL SYLLABLE HYEG..HANGUL SYLLABLE HYEH + (0xD639 <= code && code <= 0xD653) || // Lo [27] HANGUL SYLLABLE HOG..HANGUL SYLLABLE HOH + (0xD655 <= code && code <= 0xD66F) || // Lo [27] HANGUL SYLLABLE HWAG..HANGUL SYLLABLE HWAH + (0xD671 <= code && code <= 0xD68B) || // Lo [27] HANGUL SYLLABLE HWAEG..HANGUL SYLLABLE HWAEH + (0xD68D <= code && code <= 0xD6A7) || // Lo [27] HANGUL SYLLABLE HOEG..HANGUL SYLLABLE HOEH + (0xD6A9 <= code && code <= 0xD6C3) || // Lo [27] HANGUL SYLLABLE HYOG..HANGUL SYLLABLE HYOH + (0xD6C5 <= code && code <= 0xD6DF) || // Lo [27] HANGUL SYLLABLE HUG..HANGUL SYLLABLE HUH + (0xD6E1 <= code && code <= 0xD6FB) || // Lo [27] HANGUL SYLLABLE HWEOG..HANGUL SYLLABLE HWEOH + (0xD6FD <= code && code <= 0xD717) || // Lo [27] HANGUL SYLLABLE HWEG..HANGUL SYLLABLE HWEH + (0xD719 <= code && code <= 0xD733) || // Lo [27] HANGUL SYLLABLE HWIG..HANGUL SYLLABLE HWIH + (0xD735 <= code && code <= 0xD74F) || // Lo [27] HANGUL SYLLABLE HYUG..HANGUL SYLLABLE HYUH + (0xD751 <= code && code <= 0xD76B) || // Lo [27] HANGUL SYLLABLE HEUG..HANGUL SYLLABLE HEUH + (0xD76D <= code && code <= 0xD787) || // Lo [27] HANGUL SYLLABLE HYIG..HANGUL SYLLABLE HYIH + (0xD789 <= code && code <= 0xD7A3) // Lo [27] HANGUL SYLLABLE HIG..HANGUL SYLLABLE HIH + ){ + return LVT; + } + + if( + 0x261D == code || // So WHITE UP POINTING INDEX + 0x26F9 == code || // So PERSON WITH BALL + (0x270A <= code && code <= 0x270D) || // So [4] RAISED FIST..WRITING HAND + 0x1F385 == code || // So FATHER CHRISTMAS + (0x1F3C2 <= code && code <= 0x1F3C4) || // So [3] SNOWBOARDER..SURFER + 0x1F3C7 == code || // So HORSE RACING + (0x1F3CA <= code && code <= 0x1F3CC) || // So [3] SWIMMER..GOLFER + (0x1F442 <= code && code <= 0x1F443) || // So [2] EAR..NOSE + (0x1F446 <= code && code <= 0x1F450) || // So [11] WHITE UP POINTING BACKHAND INDEX..OPEN HANDS SIGN + 0x1F46E == code || // So POLICE OFFICER + (0x1F470 <= code && code <= 0x1F478) || // So [9] BRIDE WITH VEIL..PRINCESS + 0x1F47C == code || // So BABY ANGEL + (0x1F481 <= code && code <= 0x1F483) || // So [3] INFORMATION DESK PERSON..DANCER + (0x1F485 <= code && code <= 0x1F487) || // So [3] NAIL POLISH..HAIRCUT + 0x1F4AA == code || // So FLEXED BICEPS + (0x1F574 <= code && code <= 0x1F575) || // So [2] MAN IN BUSINESS SUIT LEVITATING..SLEUTH OR SPY + 0x1F57A == code || // So MAN DANCING + 0x1F590 == code || // So RAISED HAND WITH FINGERS SPLAYED + (0x1F595 <= code && code <= 0x1F596) || // So [2] REVERSED HAND WITH MIDDLE FINGER EXTENDED..RAISED HAND WITH PART BETWEEN MIDDLE AND RING FINGERS + (0x1F645 <= code && code <= 0x1F647) || // So [3] FACE WITH NO GOOD GESTURE..PERSON BOWING DEEPLY + (0x1F64B <= code && code <= 0x1F64F) || // So [5] HAPPY PERSON RAISING ONE HAND..PERSON WITH FOLDED HANDS + 0x1F6A3 == code || // So ROWBOAT + (0x1F6B4 <= code && code <= 0x1F6B6) || // So [3] BICYCLIST..PEDESTRIAN + 0x1F6C0 == code || // So BATH + 0x1F6CC == code || // So SLEEPING ACCOMMODATION + (0x1F918 <= code && code <= 0x1F91C) || // So [5] SIGN OF THE HORNS..RIGHT-FACING FIST + (0x1F91E <= code && code <= 0x1F91F) || // So [2] HAND WITH INDEX AND MIDDLE FINGERS CROSSED..I LOVE YOU HAND SIGN + 0x1F926 == code || // So FACE PALM + (0x1F930 <= code && code <= 0x1F939) || // So [10] PREGNANT WOMAN..JUGGLING + (0x1F93D <= code && code <= 0x1F93E) || // So [2] WATER POLO..HANDBALL + (0x1F9D1 <= code && code <= 0x1F9DD) // So [13] ADULT..ELF + ){ + return E_Base; + } + + if( + (0x1F3FB <= code && code <= 0x1F3FF) // Sk [5] EMOJI MODIFIER FITZPATRICK TYPE-1-2..EMOJI MODIFIER FITZPATRICK TYPE-6 + ){ + return E_Modifier; + } + + if( + 0x200D == code // Cf ZERO WIDTH JOINER + ){ + return ZWJ; + } + + if( + 0x2640 == code || // So FEMALE SIGN + 0x2642 == code || // So MALE SIGN + (0x2695 <= code && code <= 0x2696) || // So [2] STAFF OF AESCULAPIUS..SCALES + 0x2708 == code || // So AIRPLANE + 0x2764 == code || // So HEAVY BLACK HEART + 0x1F308 == code || // So RAINBOW + 0x1F33E == code || // So EAR OF RICE + 0x1F373 == code || // So COOKING + 0x1F393 == code || // So GRADUATION CAP + 0x1F3A4 == code || // So MICROPHONE + 0x1F3A8 == code || // So ARTIST PALETTE + 0x1F3EB == code || // So SCHOOL + 0x1F3ED == code || // So FACTORY + 0x1F48B == code || // So KISS MARK + (0x1F4BB <= code && code <= 0x1F4BC) || // So [2] PERSONAL COMPUTER..BRIEFCASE + 0x1F527 == code || // So WRENCH + 0x1F52C == code || // So MICROSCOPE + 0x1F5E8 == code || // So LEFT SPEECH BUBBLE + 0x1F680 == code || // So ROCKET + 0x1F692 == code // So FIRE ENGINE + ){ + return Glue_After_Zwj; + } + + if( + (0x1F466 <= code && code <= 0x1F469) // So [4] BOY..WOMAN + ){ + return E_Base_GAZ; + } + + + //all unlisted characters have a grapheme break property of "Other" + return Other; + } + return this; +} + +var graphemeSplitter = GraphemeSplitter; + +var extractors$2 = createCommonjsModule(function (module, exports) { +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); + + + +const splitter = new graphemeSplitter(); +class ChoiceExtractor { + constructor(config) { + this.config = config; + } + extract(source) { + let results = new Array(); + let trimmedSource = source.toLowerCase(); + if (recognizersText.StringUtility.isNullOrWhitespace(source)) { + return results; + } + let partialResults = new Array(); + let sourceTokens = this.tokenize(trimmedSource); + this.config.regexesMap.forEach((typeExtracted, regex) => { + recognizersText.RegExpUtility.getMatches(regex, trimmedSource).forEach(match => { + let matchTokens = this.tokenize(match.value); + let topScore = sourceTokens + .map((sToken, index) => this.matchValue(sourceTokens, matchTokens, index)) + .reduce((top, value) => top = Math.max(top, value), 0.0); + if (topScore > 0.0) { + let start = match.index; + let length = match.length; + let text = source.substr(start, length).trim(); + partialResults.push({ + start: start, + length: length, + text: text, + type: typeExtracted, + data: { + source: source, + score: topScore + } + }); + } + }); + }); + if (partialResults.length === 0) { + return results; + } + partialResults = partialResults.sort((a, b) => a.start - b.start); + if (this.config.onlyTopMatch) { + let topResult = partialResults.reduce((top, value) => top = top.data.score < value.data.score ? value : top, partialResults[0]); + topResult.data.otherMatches = partialResults.filter(r => r !== topResult); + results.push(topResult); + } + else { + results = partialResults; + } + return results; + } + matchValue(source, match, startPos) { + let matched = 0; + let totalDeviation = 0; + match.forEach(matchToken => { + let pos = source.indexOf(matchToken, startPos); + if (pos >= 0) { + let distance = matched > 0 ? pos - startPos : 0; + if (distance <= this.config.maxDistance) { + matched++; + totalDeviation += distance; + startPos = pos + 1; + } + } + }); + let score = 0.0; + if (matched > 0 && (matched === match.length || this.config.allowPartialMatch)) { + let completeness = matched / match.length; + let accuracy = completeness * (matched / (matched + totalDeviation)); + let initialScore = accuracy * (matched / source.length); + score = 0.4 + (0.6 * initialScore); + } + return score; + } + tokenize(source) { + let tokens = []; + let chars = splitter.splitGraphemes(source); + let token = ''; + chars.forEach(c => { + let codePoint = c.codePointAt(0) || c.charAt(0); + if (codePoint > 0xFFFF) { + // Character is in a Supplementary Unicode Plane. This is where emoji live so + // we're going to just break each character in this range out as its own token. + tokens.push(c); + if (!recognizersText.StringUtility.isNullOrWhitespace(token)) { + tokens.push(token); + token = ''; + } + } + else if (!(this.config.tokenRegex.test(c) || recognizersText.StringUtility.isWhitespace(c))) { + token = token.concat(c); + } + else if (!recognizersText.StringUtility.isNullOrWhitespace(token)) { + tokens.push(token); + token = ''; + } + }); + if (!recognizersText.StringUtility.isNullOrWhitespace(token)) { + tokens.push(token); + token = ''; + } + return tokens; + } +} +exports.ChoiceExtractor = ChoiceExtractor; +class BooleanExtractor extends ChoiceExtractor { + constructor(config) { + let regexesMap = new Map() + .set(config.regexTrue, constants.Constants.SYS_BOOLEAN_TRUE) + .set(config.regexFalse, constants.Constants.SYS_BOOLEAN_FALSE); + let optionsConfig = { + regexesMap: regexesMap, + tokenRegex: config.tokenRegex, + allowPartialMatch: false, + maxDistance: 2, + onlyTopMatch: config.onlyTopMatch + }; + super(optionsConfig); + this.extractType = constants.Constants.SYS_BOOLEAN; + } +} +BooleanExtractor.booleanTrue = constants.Constants.SYS_BOOLEAN_TRUE; +BooleanExtractor.booleanFalse = constants.Constants.SYS_BOOLEAN_FALSE; +exports.BooleanExtractor = BooleanExtractor; + +}); + +unwrapExports(extractors$2); + +var parsers$2 = createCommonjsModule(function (module, exports) { +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); + + +class ChoiceParser { + constructor(config) { + this.config = config; + } + parse(extResult) { + let result = new recognizersText.ParseResult(extResult); + result.value = this.config.resolutions.get(result.type); + if (result.data.otherMatches) { + result.data.otherMatches = result.data.otherMatches.map(m => { + let r = new recognizersText.ParseResult(m); + r.value = this.config.resolutions.get(r.type); + return r; + }); + } + return result; + } +} +exports.ChoiceParser = ChoiceParser; +class BooleanParser extends ChoiceParser { + constructor() { + let resolutions = new Map([ + [constants.Constants.SYS_BOOLEAN_TRUE, true], + [constants.Constants.SYS_BOOLEAN_FALSE, false] + ]); + let config = { + resolutions: resolutions + }; + super(config); + } +} +exports.BooleanParser = BooleanParser; + +}); + +unwrapExports(parsers$2); + +var englishChoice = createCommonjsModule(function (module, exports) { +"use strict"; +// ------------------------------------------------------------------------------ +// +// This code was generated by a tool. +// Changes to this file may cause incorrect behavior and will be lost if +// the code is regenerated. +// +// ------------------------------------------------------------------------------ +Object.defineProperty(exports, "__esModule", { value: true }); +var EnglishChoice; +(function (EnglishChoice) { + EnglishChoice.LangMarker = 'Eng'; + EnglishChoice.TokenizerRegex = `[^\\w\\d]`; + EnglishChoice.TrueRegex = `\\b(true|yes|yep|y|sure|ok|agree)\\b|(\\uD83D\\uDC4D|\\uD83D\\uDC4C)`; + EnglishChoice.FalseRegex = `\\b(false|nope|nop|no|not\\s+ok|disagree)\\b|(\\uD83D\\uDC4E|\\u270B|\\uD83D\\uDD90)`; +})(EnglishChoice = exports.EnglishChoice || (exports.EnglishChoice = {})); + +}); + +unwrapExports(englishChoice); + +var boolean_1 = createCommonjsModule(function (module, exports) { +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); + + +class EnglishBooleanExtractorConfiguration { + constructor(onlyTopMatch = true) { + this.regexTrue = recognizersText.RegExpUtility.getSafeRegExp(englishChoice.EnglishChoice.TrueRegex); + this.regexFalse = recognizersText.RegExpUtility.getSafeRegExp(englishChoice.EnglishChoice.FalseRegex); + this.tokenRegex = recognizersText.RegExpUtility.getSafeRegExp(englishChoice.EnglishChoice.TokenizerRegex, 'is'); + this.onlyTopMatch = onlyTopMatch; + } +} +exports.EnglishBooleanExtractorConfiguration = EnglishBooleanExtractorConfiguration; + +}); + +unwrapExports(boolean_1); + +var frenchChoice = createCommonjsModule(function (module, exports) { +"use strict"; +// ------------------------------------------------------------------------------ +// +// This code was generated by a tool. +// Changes to this file may cause incorrect behavior and will be lost if +// the code is regenerated. +// +// ------------------------------------------------------------------------------ +Object.defineProperty(exports, "__esModule", { value: true }); +var FrenchChoice; +(function (FrenchChoice) { + FrenchChoice.LangMarker = 'Fr'; + FrenchChoice.TokenizerRegex = `[^\\w\\d\\u00E0-\\u00FC]`; + FrenchChoice.TrueRegex = `\\b(s[uû]r|ouais|oui|yep|y|sure|approuver|accepter|consentir|d'accord|ça march[eé])\\b|(\\uD83D\\uDC4D|\\uD83D\\uDC4C)`; + FrenchChoice.FalseRegex = `\\b(faux|nan|non|pas\\s+d'accord|pas\\s+concorder|n'est\\s+pas\\s+(correct|ok)|pas)\\b|(\\uD83D\\uDC4E|\\u270B|\\uD83D\\uDD90)`; +})(FrenchChoice = exports.FrenchChoice || (exports.FrenchChoice = {})); + +}); + +unwrapExports(frenchChoice); + +var boolean_1$1 = createCommonjsModule(function (module, exports) { +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); + + +class FrenchBooleanExtractorConfiguration { + constructor(onlyTopMatch = true) { + this.regexTrue = recognizersText.RegExpUtility.getSafeRegExp(frenchChoice.FrenchChoice.TrueRegex); + this.regexFalse = recognizersText.RegExpUtility.getSafeRegExp(frenchChoice.FrenchChoice.FalseRegex); + this.tokenRegex = recognizersText.RegExpUtility.getSafeRegExp(frenchChoice.FrenchChoice.TokenizerRegex, 'is'); + this.onlyTopMatch = onlyTopMatch; + } +} +exports.FrenchBooleanExtractorConfiguration = FrenchBooleanExtractorConfiguration; + +}); + +unwrapExports(boolean_1$1); + +var germanChoice = createCommonjsModule(function (module, exports) { +"use strict"; +// ------------------------------------------------------------------------------ +// +// This code was generated by a tool. +// Changes to this file may cause incorrect behavior and will be lost if +// the code is regenerated. +// +// ------------------------------------------------------------------------------ +Object.defineProperty(exports, "__esModule", { value: true }); +var GermanChoice; +(function (GermanChoice) { + GermanChoice.LangMarker = 'Ger'; + GermanChoice.TokenizerRegex = `[^\\w\\d\\u00E0-\\u00FC]`; + GermanChoice.TrueRegex = `\\b(wahr|ja|jep|j|sicher|ok|einverstanden|mit\\s+Sicherheit|sicherlich|jap|mache ich)\\b|(\\uD83D\\uDC4D|\\uD83D\\uDC4C)`; + GermanChoice.FalseRegex = `\\b(falsch|nein|ne|nö|nicht\\s+ok|nicht\\s+einverstanden|n)\\b|(\\uD83D\\uDC4E|\\u270B|\\uD83D\\uDD90)`; +})(GermanChoice = exports.GermanChoice || (exports.GermanChoice = {})); + +}); + +unwrapExports(germanChoice); + +var boolean_1$2 = createCommonjsModule(function (module, exports) { +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); + + +class GermanBooleanExtractorConfiguration { + constructor(onlyTopMatch = true) { + this.regexTrue = recognizersText.RegExpUtility.getSafeRegExp(germanChoice.GermanChoice.TrueRegex); + this.regexFalse = recognizersText.RegExpUtility.getSafeRegExp(germanChoice.GermanChoice.FalseRegex); + this.tokenRegex = recognizersText.RegExpUtility.getSafeRegExp(germanChoice.GermanChoice.TokenizerRegex, 'is'); + this.onlyTopMatch = onlyTopMatch; + } +} +exports.GermanBooleanExtractorConfiguration = GermanBooleanExtractorConfiguration; + +}); + +unwrapExports(boolean_1$2); + +var japaneseChoice = createCommonjsModule(function (module, exports) { +"use strict"; +// ------------------------------------------------------------------------------ +// +// This code was generated by a tool. +// Changes to this file may cause incorrect behavior and will be lost if +// the code is regenerated. +// +// ------------------------------------------------------------------------------ +Object.defineProperty(exports, "__esModule", { value: true }); +var JapaneseChoice; +(function (JapaneseChoice) { + JapaneseChoice.LangMarker = 'Jpn'; + JapaneseChoice.TokenizerRegex = `[^\\w\\d\\u3040-\\u309f\\u30a0-\\u30ff\\uff00-\\uff9f\\u4e00-\\u9faf\\u3400-\\u4dbf]`; + JapaneseChoice.TrueRegex = `(はい(!)*|そうです|よい(です)*)|(\\uD83D\\uDC4D|\\uD83D\\uDC4C)`; + JapaneseChoice.FalseRegex = `(いいえ|ではありません|ではない|じゃない|じゃありません)|(\\uD83D\\uDC4E|\\u270B|\\uD83D\\uDD90)`; +})(JapaneseChoice = exports.JapaneseChoice || (exports.JapaneseChoice = {})); + +}); + +unwrapExports(japaneseChoice); + +var boolean_1$3 = createCommonjsModule(function (module, exports) { +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); + + +class JapaneseBooleanExtractorConfiguration { + constructor(onlyTopMatch = true) { + this.regexTrue = recognizersText.RegExpUtility.getSafeRegExp(japaneseChoice.JapaneseChoice.TrueRegex); + this.regexFalse = recognizersText.RegExpUtility.getSafeRegExp(japaneseChoice.JapaneseChoice.FalseRegex); + this.tokenRegex = recognizersText.RegExpUtility.getSafeRegExp(japaneseChoice.JapaneseChoice.TokenizerRegex, 'is'); + this.onlyTopMatch = onlyTopMatch; + } +} +exports.JapaneseBooleanExtractorConfiguration = JapaneseBooleanExtractorConfiguration; + +}); + +unwrapExports(boolean_1$3); + +var portugueseChoice = createCommonjsModule(function (module, exports) { +"use strict"; +// ------------------------------------------------------------------------------ +// +// This code was generated by a tool. +// Changes to this file may cause incorrect behavior and will be lost if +// the code is regenerated. +// +// ------------------------------------------------------------------------------ +Object.defineProperty(exports, "__esModule", { value: true }); +var PortugueseChoice; +(function (PortugueseChoice) { + PortugueseChoice.LangMarker = 'Por'; + PortugueseChoice.TokenizerRegex = `[^\\w\\d\\u00E0-\\u00FC]`; + PortugueseChoice.TrueRegex = `\\b(verdade|verdadeir[oa]|sim|isso|claro|ok)\\b|(\\uD83D\\uDC4D|\\uD83D\\uDC4C)`; + PortugueseChoice.FalseRegex = `\\b(falso|n[aã]o|incorreto|nada disso)\\b|(\\uD83D\\uDC4E|\\u270B|\\uD83D\\uDD90)`; +})(PortugueseChoice = exports.PortugueseChoice || (exports.PortugueseChoice = {})); + +}); + +unwrapExports(portugueseChoice); + +var boolean_1$4 = createCommonjsModule(function (module, exports) { +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); + + +class PortugueseBooleanExtractorConfiguration { + constructor(onlyTopMatch = true) { + this.regexTrue = recognizersText.RegExpUtility.getSafeRegExp(portugueseChoice.PortugueseChoice.TrueRegex); + this.regexFalse = recognizersText.RegExpUtility.getSafeRegExp(portugueseChoice.PortugueseChoice.FalseRegex); + this.tokenRegex = recognizersText.RegExpUtility.getSafeRegExp(portugueseChoice.PortugueseChoice.TokenizerRegex, 'is'); + this.onlyTopMatch = onlyTopMatch; + } +} +exports.PortugueseBooleanExtractorConfiguration = PortugueseBooleanExtractorConfiguration; + +}); + +unwrapExports(boolean_1$4); + +var spanishChoice = createCommonjsModule(function (module, exports) { +"use strict"; +// ------------------------------------------------------------------------------ +// +// This code was generated by a tool. +// Changes to this file may cause incorrect behavior and will be lost if +// the code is regenerated. +// +// ------------------------------------------------------------------------------ +Object.defineProperty(exports, "__esModule", { value: true }); +var SpanishChoice; +(function (SpanishChoice) { + SpanishChoice.LangMarker = 'Spa'; + SpanishChoice.TokenizerRegex = `[^\\w\\d\\u00E0-\\u00FC]`; + SpanishChoice.TrueRegex = `\\b(verdad|verdadero|sí|sip|s|si|cierto|por supuesto|ok)\\b|(\\uD83D\\uDC4D|\\uD83D\\uDC4C)`; + SpanishChoice.FalseRegex = `\\b(falso|no|nop|n|no)\\b|(\\uD83D\\uDC4E|\\u270B|\\uD83D\\uDD90)`; +})(SpanishChoice = exports.SpanishChoice || (exports.SpanishChoice = {})); + +}); + +unwrapExports(spanishChoice); + +var boolean_1$5 = createCommonjsModule(function (module, exports) { +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); + + +class SpanishBooleanExtractorConfiguration { + constructor(onlyTopMatch = true) { + this.regexTrue = recognizersText.RegExpUtility.getSafeRegExp(spanishChoice.SpanishChoice.TrueRegex); + this.regexFalse = recognizersText.RegExpUtility.getSafeRegExp(spanishChoice.SpanishChoice.FalseRegex); + this.tokenRegex = recognizersText.RegExpUtility.getSafeRegExp(spanishChoice.SpanishChoice.TokenizerRegex, 'is'); + this.onlyTopMatch = onlyTopMatch; + } +} +exports.SpanishBooleanExtractorConfiguration = SpanishBooleanExtractorConfiguration; + +}); + +unwrapExports(boolean_1$5); + +var chineseChoice = createCommonjsModule(function (module, exports) { +"use strict"; +// ------------------------------------------------------------------------------ +// +// This code was generated by a tool. +// Changes to this file may cause incorrect behavior and will be lost if +// the code is regenerated. +// +// ------------------------------------------------------------------------------ +Object.defineProperty(exports, "__esModule", { value: true }); +var ChineseChoice; +(function (ChineseChoice) { + ChineseChoice.LangMarker = 'Chs'; + ChineseChoice.TokenizerRegex = `[^\\u3040-\\u30ff\\u3400-\\u4dbf\\u4e00-\\u9fff\\uf900-\\ufaff\\uff66-\\uff9f]`; + ChineseChoice.TrueRegex = `(好[的啊呀嘞哇]|没问题|可以|中|好|同意|行|是的|是|对)|(\\uD83D\\uDC4D|\\uD83D\\uDC4C)`; + ChineseChoice.FalseRegex = `(不行|不好|拒绝|否定|不中|不可以|不是的|不是|不对|不)|(\\uD83D\\uDC4E|\\u270B|\\uD83D\\uDD90)`; +})(ChineseChoice = exports.ChineseChoice || (exports.ChineseChoice = {})); + +}); + +unwrapExports(chineseChoice); + +var boolean_1$6 = createCommonjsModule(function (module, exports) { +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); + + +class ChineseBooleanExtractorConfiguration { + constructor(onlyTopMatch = true) { + this.regexTrue = recognizersText.RegExpUtility.getSafeRegExp(chineseChoice.ChineseChoice.TrueRegex); + this.regexFalse = recognizersText.RegExpUtility.getSafeRegExp(chineseChoice.ChineseChoice.FalseRegex); + this.tokenRegex = recognizersText.RegExpUtility.getSafeRegExp(chineseChoice.ChineseChoice.TokenizerRegex, 'is'); + this.onlyTopMatch = onlyTopMatch; + } +} +exports.ChineseBooleanExtractorConfiguration = ChineseBooleanExtractorConfiguration; + +}); + +unwrapExports(boolean_1$6); + +var choiceRecognizer = createCommonjsModule(function (module, exports) { +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); + + + + + + + + + + + +var ChoiceOptions; +(function (ChoiceOptions) { + ChoiceOptions[ChoiceOptions["None"] = 0] = "None"; +})(ChoiceOptions = exports.ChoiceOptions || (exports.ChoiceOptions = {})); +function recognizeBoolean(query, culture, options = ChoiceOptions.None, fallbackToDefaultCulture = true) { + let recognizer = new ChoiceRecognizer(culture, options); + let model = recognizer.getBooleanModel(culture, fallbackToDefaultCulture); + return model.parse(query); +} +exports.recognizeBoolean = recognizeBoolean; +class ChoiceRecognizer extends recognizersText.Recognizer { + constructor(culture, options = ChoiceOptions.None, lazyInitialization = false) { + super(culture, options, lazyInitialization); + } + InitializeConfiguration() { + //#region English + this.registerModel("BooleanModel", recognizersText.Culture.English, (options) => new models$2.BooleanModel(new parsers$2.BooleanParser(), new extractors$2.BooleanExtractor(new boolean_1.EnglishBooleanExtractorConfiguration()))); + //#endregion + //#region Japanese + this.registerModel("BooleanModel", recognizersText.Culture.Japanese, (options) => new models$2.BooleanModel(new parsers$2.BooleanParser(), new extractors$2.BooleanExtractor(new boolean_1$3.JapaneseBooleanExtractorConfiguration()))); + //#endregion + //#region Portuguese + this.registerModel("BooleanModel", recognizersText.Culture.Portuguese, (options) => new models$2.BooleanModel(new parsers$2.BooleanParser(), new extractors$2.BooleanExtractor(new boolean_1$4.PortugueseBooleanExtractorConfiguration()))); + //#endregion + //#region Spanish + this.registerModel("BooleanModel", recognizersText.Culture.Spanish, (options) => new models$2.BooleanModel(new parsers$2.BooleanParser(), new extractors$2.BooleanExtractor(new boolean_1$5.SpanishBooleanExtractorConfiguration()))); + //#endregion + //#region Chinese + this.registerModel("BooleanModel", recognizersText.Culture.Chinese, (options) => new models$2.BooleanModel(new parsers$2.BooleanParser(), new extractors$2.BooleanExtractor(new boolean_1$6.ChineseBooleanExtractorConfiguration()))); + //#endregion + //#region French + this.registerModel("BooleanModel", recognizersText.Culture.French, (options) => new models$2.BooleanModel(new parsers$2.BooleanParser(), new extractors$2.BooleanExtractor(new boolean_1$1.FrenchBooleanExtractorConfiguration()))); + //#endregion + //#region German + this.registerModel("BooleanModel", recognizersText.Culture.German, (options) => new models$2.BooleanModel(new parsers$2.BooleanParser(), new extractors$2.BooleanExtractor(new boolean_1$2.GermanBooleanExtractorConfiguration()))); + //#endregion + } + IsValidOptions(options) { + return options >= 0 && options <= ChoiceOptions.None; + } + getBooleanModel(culture = null, fallbackToDefaultCulture = true) { + return this.getModel("BooleanModel", culture, fallbackToDefaultCulture); + } +} +exports.default = ChoiceRecognizer; + +}); + +unwrapExports(choiceRecognizer); + +var recognizersTextChoice = createCommonjsModule(function (module, exports) { +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); + +exports.ChoiceRecognizer = choiceRecognizer.default; +exports.ChoiceOptions = choiceRecognizer.ChoiceOptions; +exports.recognizeBoolean = choiceRecognizer.recognizeBoolean; + +exports.Culture = recognizersText.Culture; + +exports.Constants = constants.Constants; + +exports.ChoiceModel = models$2.ChoiceModel; +exports.BooleanModel = models$2.BooleanModel; + +exports.ChoiceExtractor = extractors$2.ChoiceExtractor; +exports.BooleanExtractor = extractors$2.BooleanExtractor; + +exports.ChoiceParser = parsers$2.ChoiceParser; +exports.BooleanParser = parsers$2.BooleanParser; + +exports.EnglishBooleanExtractorConfiguration = boolean_1.EnglishBooleanExtractorConfiguration; + +exports.FrenchBooleanExtractorConfiguration = boolean_1$1.FrenchBooleanExtractorConfiguration; + +exports.GermanBooleanExtractorConfiguration = boolean_1$2.GermanBooleanExtractorConfiguration; + +exports.PortugueseBooleanExtractorConfiguration = boolean_1$4.PortugueseBooleanExtractorConfiguration; + +exports.JapaneseBooleanExtractorConfiguration = boolean_1$3.JapaneseBooleanExtractorConfiguration; + +exports.SpanishBooleanExtractorConfiguration = boolean_1$5.SpanishBooleanExtractorConfiguration; + +exports.ChineseBooleanExtractorConfiguration = boolean_1$6.ChineseBooleanExtractorConfiguration; + +exports.EnglishChoice = englishChoice.EnglishChoice; + +exports.FrenchChoice = frenchChoice.FrenchChoice; + +exports.GermanChoice = germanChoice.GermanChoice; + +exports.PortugueseChoice = portugueseChoice.PortugueseChoice; + +exports.JapaneseChoice = japaneseChoice.JapaneseChoice; + +exports.SpanishChoice = spanishChoice.SpanishChoice; + +exports.ChineseChoice = chineseChoice.ChineseChoice; + +}); + +var recognizersTextChoice$1 = unwrapExports(recognizersTextChoice); +var recognizersTextChoice_1 = recognizersTextChoice.ChoiceRecognizer; +var recognizersTextChoice_2 = recognizersTextChoice.ChoiceOptions; +var recognizersTextChoice_3 = recognizersTextChoice.recognizeBoolean; +var recognizersTextChoice_4 = recognizersTextChoice.Culture; +var recognizersTextChoice_5 = recognizersTextChoice.Constants; +var recognizersTextChoice_6 = recognizersTextChoice.ChoiceModel; +var recognizersTextChoice_7 = recognizersTextChoice.BooleanModel; +var recognizersTextChoice_8 = recognizersTextChoice.ChoiceExtractor; +var recognizersTextChoice_9 = recognizersTextChoice.BooleanExtractor; +var recognizersTextChoice_10 = recognizersTextChoice.ChoiceParser; +var recognizersTextChoice_11 = recognizersTextChoice.BooleanParser; +var recognizersTextChoice_12 = recognizersTextChoice.EnglishBooleanExtractorConfiguration; +var recognizersTextChoice_13 = recognizersTextChoice.FrenchBooleanExtractorConfiguration; +var recognizersTextChoice_14 = recognizersTextChoice.GermanBooleanExtractorConfiguration; +var recognizersTextChoice_15 = recognizersTextChoice.PortugueseBooleanExtractorConfiguration; +var recognizersTextChoice_16 = recognizersTextChoice.JapaneseBooleanExtractorConfiguration; +var recognizersTextChoice_17 = recognizersTextChoice.SpanishBooleanExtractorConfiguration; +var recognizersTextChoice_18 = recognizersTextChoice.ChineseBooleanExtractorConfiguration; +var recognizersTextChoice_19 = recognizersTextChoice.EnglishChoice; +var recognizersTextChoice_20 = recognizersTextChoice.FrenchChoice; +var recognizersTextChoice_21 = recognizersTextChoice.GermanChoice; +var recognizersTextChoice_22 = recognizersTextChoice.PortugueseChoice; +var recognizersTextChoice_23 = recognizersTextChoice.JapaneseChoice; +var recognizersTextChoice_24 = recognizersTextChoice.SpanishChoice; +var recognizersTextChoice_25 = recognizersTextChoice.ChineseChoice; + +exports['default'] = recognizersTextChoice$1; +exports.ChoiceRecognizer = recognizersTextChoice_1; +exports.ChoiceOptions = recognizersTextChoice_2; +exports.recognizeBoolean = recognizersTextChoice_3; +exports.Culture = recognizersTextChoice_4; +exports.Constants = recognizersTextChoice_5; +exports.ChoiceModel = recognizersTextChoice_6; +exports.BooleanModel = recognizersTextChoice_7; +exports.ChoiceExtractor = recognizersTextChoice_8; +exports.BooleanExtractor = recognizersTextChoice_9; +exports.ChoiceParser = recognizersTextChoice_10; +exports.BooleanParser = recognizersTextChoice_11; +exports.EnglishBooleanExtractorConfiguration = recognizersTextChoice_12; +exports.FrenchBooleanExtractorConfiguration = recognizersTextChoice_13; +exports.GermanBooleanExtractorConfiguration = recognizersTextChoice_14; +exports.PortugueseBooleanExtractorConfiguration = recognizersTextChoice_15; +exports.JapaneseBooleanExtractorConfiguration = recognizersTextChoice_16; +exports.SpanishBooleanExtractorConfiguration = recognizersTextChoice_17; +exports.ChineseBooleanExtractorConfiguration = recognizersTextChoice_18; +exports.EnglishChoice = recognizersTextChoice_19; +exports.FrenchChoice = recognizersTextChoice_20; +exports.GermanChoice = recognizersTextChoice_21; +exports.PortugueseChoice = recognizersTextChoice_22; +exports.JapaneseChoice = recognizersTextChoice_23; +exports.SpanishChoice = recognizersTextChoice_24; +exports.ChineseChoice = recognizersTextChoice_25; + +return exports; + +}({})); +//# sourceMappingURL=recognizers-text-choice.browser.js.map diff --git a/libraries/botbuilder-stdlib/vendors/@microsoft/recognizers-text-choice/dist/recognizers-text-choice.es5.js b/libraries/botbuilder-stdlib/vendors/@microsoft/recognizers-text-choice/dist/recognizers-text-choice.es5.js new file mode 100644 index 0000000000..6011d56ee5 --- /dev/null +++ b/libraries/botbuilder-stdlib/vendors/@microsoft/recognizers-text-choice/dist/recognizers-text-choice.es5.js @@ -0,0 +1,8741 @@ +function unwrapExports (x) { + return x && x.__esModule && Object.prototype.hasOwnProperty.call(x, 'default') ? x['default'] : x; +} + +function createCommonjsModule(fn, module) { + return module = { exports: {} }, fn(module, module.exports), module.exports; +} + +var culture = createCommonjsModule(function (module, exports) { +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +class Culture { + constructor(cultureName, cultureCode) { + this.cultureName = cultureName; + this.cultureCode = cultureCode; + } + static getSupportedCultureCodes() { + return Culture.supportedCultures.map(c => c.cultureCode); + } + static mapToNearestLanguage(cultureCode) { + if (cultureCode !== undefined) { + cultureCode = cultureCode.toLowerCase(); + var supportedCultureCodes = Culture.getSupportedCultureCodes(); + if (supportedCultureCodes.indexOf(cultureCode) < 0) { + var culturePrefix = cultureCode.split('-')[0].trim(); + supportedCultureCodes.forEach(function (supportedCultureCode) { + if (supportedCultureCode.startsWith(culturePrefix)) { + cultureCode = supportedCultureCode; + } + }); + } + } + return cultureCode; + } +} +Culture.English = "en-us"; +Culture.Chinese = "zh-cn"; +Culture.Spanish = "es-es"; +Culture.Portuguese = "pt-br"; +Culture.French = "fr-fr"; +Culture.German = "de-de"; +Culture.Japanese = "ja-jp"; +Culture.Dutch = "nl-nl"; +Culture.Italian = "it-it"; +Culture.supportedCultures = [ + new Culture("English", Culture.English), + new Culture("Chinese", Culture.Chinese), + new Culture("Spanish", Culture.Spanish), + new Culture("Portuguese", Culture.Portuguese), + new Culture("French", Culture.French), + new Culture("German", Culture.German), + new Culture("Japanese", Culture.Japanese), + new Culture("Dutch", Culture.Dutch), + new Culture("Italian", Culture.Italian) +]; +exports.Culture = Culture; +class CultureInfo { + static getCultureInfo(cultureCode) { + return new CultureInfo(cultureCode); + } + constructor(cultureName) { + this.code = cultureName; + } +} +exports.CultureInfo = CultureInfo; + +}); + +unwrapExports(culture); + +var xregexp = createCommonjsModule(function (module, exports) { +"use strict"; + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.default = void 0; + +function _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _nonIterableRest(); } + +function _nonIterableRest() { throw new TypeError("Invalid attempt to destructure non-iterable instance"); } + +function _iterableToArrayLimit(arr, i) { var _arr = []; var _n = true; var _d = false; var _e = undefined; try { for (var _i = arr[Symbol.iterator](), _s; !(_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; } + +function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; } + +/*! + * XRegExp 4.2.0 + * + * Steven Levithan (c) 2007-present MIT License + */ + +/** + * XRegExp provides augmented, extensible regular expressions. You get additional regex syntax and + * flags, beyond what browsers support natively. XRegExp is also a regex utility belt with tools to + * make your client-side grepping simpler and more powerful, while freeing you from related + * cross-browser inconsistencies. + */ +// ==--------------------------== +// Private stuff +// ==--------------------------== +// Property name used for extended regex instance data +var REGEX_DATA = 'xregexp'; // Optional features that can be installed and uninstalled + +var features = { + astral: false, + namespacing: false +}; // Native methods to use and restore ('native' is an ES3 reserved keyword) + +var nativ = { + exec: RegExp.prototype.exec, + test: RegExp.prototype.test, + match: String.prototype.match, + replace: String.prototype.replace, + split: String.prototype.split +}; // Storage for fixed/extended native methods + +var fixed = {}; // Storage for regexes cached by `XRegExp.cache` + +var regexCache = {}; // Storage for pattern details cached by the `XRegExp` constructor + +var patternCache = {}; // Storage for regex syntax tokens added internally or by `XRegExp.addToken` + +var tokens = []; // Token scopes + +var defaultScope = 'default'; +var classScope = 'class'; // Regexes that match native regex syntax, including octals + +var nativeTokens = { + // Any native multicharacter token in default scope, or any single character + 'default': /\\(?:0(?:[0-3][0-7]{0,2}|[4-7][0-7]?)?|[1-9]\d*|x[\dA-Fa-f]{2}|u(?:[\dA-Fa-f]{4}|{[\dA-Fa-f]+})|c[A-Za-z]|[\s\S])|\(\?(?:[:=!]|<[=!])|[?*+]\?|{\d+(?:,\d*)?}\??|[\s\S]/, + // Any native multicharacter token in character class scope, or any single character + 'class': /\\(?:[0-3][0-7]{0,2}|[4-7][0-7]?|x[\dA-Fa-f]{2}|u(?:[\dA-Fa-f]{4}|{[\dA-Fa-f]+})|c[A-Za-z]|[\s\S])|[\s\S]/ +}; // Any backreference or dollar-prefixed character in replacement strings + +var replacementToken = /\$(?:{([\w$]+)}|<([\w$]+)>|(\d\d?|[\s\S]))/g; // Check for correct `exec` handling of nonparticipating capturing groups + +var correctExecNpcg = nativ.exec.call(/()??/, '')[1] === undefined; // Check for ES6 `flags` prop support + +var hasFlagsProp = /x/.flags !== undefined; // Shortcut to `Object.prototype.toString` + +var _ref = {}, + toString = _ref.toString; + +function hasNativeFlag(flag) { + // Can't check based on the presence of properties/getters since browsers might support such + // properties even when they don't support the corresponding flag in regex construction (tested + // in Chrome 48, where `'unicode' in /x/` is true but trying to construct a regex with flag `u` + // throws an error) + var isSupported = true; + + try { + // Can't use regex literals for testing even in a `try` because regex literals with + // unsupported flags cause a compilation error in IE + new RegExp('', flag); + } catch (exception) { + isSupported = false; + } + + return isSupported; +} // Check for ES6 `u` flag support + + +var hasNativeU = hasNativeFlag('u'); // Check for ES6 `y` flag support + +var hasNativeY = hasNativeFlag('y'); // Tracker for known flags, including addon flags + +var registeredFlags = { + g: true, + i: true, + m: true, + u: hasNativeU, + y: hasNativeY +}; +/** + * Attaches extended data and `XRegExp.prototype` properties to a regex object. + * + * @private + * @param {RegExp} regex Regex to augment. + * @param {Array} captureNames Array with capture names, or `null`. + * @param {String} xSource XRegExp pattern used to generate `regex`, or `null` if N/A. + * @param {String} xFlags XRegExp flags used to generate `regex`, or `null` if N/A. + * @param {Boolean} [isInternalOnly=false] Whether the regex will be used only for internal + * operations, and never exposed to users. For internal-only regexes, we can improve perf by + * skipping some operations like attaching `XRegExp.prototype` properties. + * @returns {RegExp} Augmented regex. + */ + +function augment(regex, captureNames, xSource, xFlags, isInternalOnly) { + regex[REGEX_DATA] = { + captureNames: captureNames + }; + + if (isInternalOnly) { + return regex; + } // Can't auto-inherit these since the XRegExp constructor returns a nonprimitive value + + + if (regex.__proto__) { + regex.__proto__ = XRegExp.prototype; + } else { + for (var p in XRegExp.prototype) { + // An `XRegExp.prototype.hasOwnProperty(p)` check wouldn't be worth it here, since this + // is performance sensitive, and enumerable `Object.prototype` or `RegExp.prototype` + // extensions exist on `regex.prototype` anyway + regex[p] = XRegExp.prototype[p]; + } + } + + regex[REGEX_DATA].source = xSource; // Emulate the ES6 `flags` prop by ensuring flags are in alphabetical order + + regex[REGEX_DATA].flags = xFlags ? xFlags.split('').sort().join('') : xFlags; + return regex; +} +/** + * Removes any duplicate characters from the provided string. + * + * @private + * @param {String} str String to remove duplicate characters from. + * @returns {String} String with any duplicate characters removed. + */ + + +function clipDuplicates(str) { + return nativ.replace.call(str, /([\s\S])(?=[\s\S]*\1)/g, ''); +} +/** + * Copies a regex object while preserving extended data and augmenting with `XRegExp.prototype` + * properties. The copy has a fresh `lastIndex` property (set to zero). Allows adding and removing + * flags g and y while copying the regex. + * + * @private + * @param {RegExp} regex Regex to copy. + * @param {Object} [options] Options object with optional properties: + * - `addG` {Boolean} Add flag g while copying the regex. + * - `addY` {Boolean} Add flag y while copying the regex. + * - `removeG` {Boolean} Remove flag g while copying the regex. + * - `removeY` {Boolean} Remove flag y while copying the regex. + * - `isInternalOnly` {Boolean} Whether the copied regex will be used only for internal + * operations, and never exposed to users. For internal-only regexes, we can improve perf by + * skipping some operations like attaching `XRegExp.prototype` properties. + * - `source` {String} Overrides `.source`, for special cases. + * @returns {RegExp} Copy of the provided regex, possibly with modified flags. + */ + + +function copyRegex(regex, options) { + if (!XRegExp.isRegExp(regex)) { + throw new TypeError('Type RegExp expected'); + } + + var xData = regex[REGEX_DATA] || {}; + var flags = getNativeFlags(regex); + var flagsToAdd = ''; + var flagsToRemove = ''; + var xregexpSource = null; + var xregexpFlags = null; + options = options || {}; + + if (options.removeG) { + flagsToRemove += 'g'; + } + + if (options.removeY) { + flagsToRemove += 'y'; + } + + if (flagsToRemove) { + flags = nativ.replace.call(flags, new RegExp("[".concat(flagsToRemove, "]+"), 'g'), ''); + } + + if (options.addG) { + flagsToAdd += 'g'; + } + + if (options.addY) { + flagsToAdd += 'y'; + } + + if (flagsToAdd) { + flags = clipDuplicates(flags + flagsToAdd); + } + + if (!options.isInternalOnly) { + if (xData.source !== undefined) { + xregexpSource = xData.source; + } // null or undefined; don't want to add to `flags` if the previous value was null, since + // that indicates we're not tracking original precompilation flags + + + if (xData.flags != null) { + // Flags are only added for non-internal regexes by `XRegExp.globalize`. Flags are never + // removed for non-internal regexes, so don't need to handle it + xregexpFlags = flagsToAdd ? clipDuplicates(xData.flags + flagsToAdd) : xData.flags; + } + } // Augment with `XRegExp.prototype` properties, but use the native `RegExp` constructor to avoid + // searching for special tokens. That would be wrong for regexes constructed by `RegExp`, and + // unnecessary for regexes constructed by `XRegExp` because the regex has already undergone the + // translation to native regex syntax + + + regex = augment(new RegExp(options.source || regex.source, flags), hasNamedCapture(regex) ? xData.captureNames.slice(0) : null, xregexpSource, xregexpFlags, options.isInternalOnly); + return regex; +} +/** + * Converts hexadecimal to decimal. + * + * @private + * @param {String} hex + * @returns {Number} + */ + + +function dec(hex) { + return parseInt(hex, 16); +} +/** + * Returns a pattern that can be used in a native RegExp in place of an ignorable token such as an + * inline comment or whitespace with flag x. This is used directly as a token handler function + * passed to `XRegExp.addToken`. + * + * @private + * @param {String} match Match arg of `XRegExp.addToken` handler + * @param {String} scope Scope arg of `XRegExp.addToken` handler + * @param {String} flags Flags arg of `XRegExp.addToken` handler + * @returns {String} Either '' or '(?:)', depending on which is needed in the context of the match. + */ + + +function getContextualTokenSeparator(match, scope, flags) { + if ( // No need to separate tokens if at the beginning or end of a group + match.input[match.index - 1] === '(' || match.input[match.index + match[0].length] === ')' || // No need to separate tokens if before or after a `|` + match.input[match.index - 1] === '|' || match.input[match.index + match[0].length] === '|' || // No need to separate tokens if at the beginning or end of the pattern + match.index < 1 || match.index + match[0].length >= match.input.length || // No need to separate tokens if at the beginning of a noncapturing group or lookahead. + // The way this is written relies on: + // - The search regex matching only 3-char strings. + // - Although `substr` gives chars from the end of the string if given a negative index, + // the resulting substring will be too short to match. Ex: `'abcd'.substr(-1, 3) === 'd'` + nativ.test.call(/^\(\?[:=!]/, match.input.substr(match.index - 3, 3)) || // Avoid separating tokens when the following token is a quantifier + isQuantifierNext(match.input, match.index + match[0].length, flags)) { + return ''; + } // Keep tokens separated. This avoids e.g. inadvertedly changing `\1 1` or `\1(?#)1` to `\11`. + // This also ensures all tokens remain as discrete atoms, e.g. it avoids converting the syntax + // error `(? :` into `(?:`. + + + return '(?:)'; +} +/** + * Returns native `RegExp` flags used by a regex object. + * + * @private + * @param {RegExp} regex Regex to check. + * @returns {String} Native flags in use. + */ + + +function getNativeFlags(regex) { + return hasFlagsProp ? regex.flags : // Explicitly using `RegExp.prototype.toString` (rather than e.g. `String` or concatenation + // with an empty string) allows this to continue working predictably when + // `XRegExp.proptotype.toString` is overridden + nativ.exec.call(/\/([a-z]*)$/i, RegExp.prototype.toString.call(regex))[1]; +} +/** + * Determines whether a regex has extended instance data used to track capture names. + * + * @private + * @param {RegExp} regex Regex to check. + * @returns {Boolean} Whether the regex uses named capture. + */ + + +function hasNamedCapture(regex) { + return !!(regex[REGEX_DATA] && regex[REGEX_DATA].captureNames); +} +/** + * Converts decimal to hexadecimal. + * + * @private + * @param {Number|String} dec + * @returns {String} + */ + + +function hex(dec) { + return parseInt(dec, 10).toString(16); +} +/** + * Checks whether the next nonignorable token after the specified position is a quantifier. + * + * @private + * @param {String} pattern Pattern to search within. + * @param {Number} pos Index in `pattern` to search at. + * @param {String} flags Flags used by the pattern. + * @returns {Boolean} Whether the next nonignorable token is a quantifier. + */ + + +function isQuantifierNext(pattern, pos, flags) { + return nativ.test.call(flags.indexOf('x') !== -1 ? // Ignore any leading whitespace, line comments, and inline comments + /^(?:\s|#[^#\n]*|\(\?#[^)]*\))*(?:[?*+]|{\d+(?:,\d*)?})/ : // Ignore any leading inline comments + /^(?:\(\?#[^)]*\))*(?:[?*+]|{\d+(?:,\d*)?})/, pattern.slice(pos)); +} +/** + * Determines whether a value is of the specified type, by resolving its internal [[Class]]. + * + * @private + * @param {*} value Object to check. + * @param {String} type Type to check for, in TitleCase. + * @returns {Boolean} Whether the object matches the type. + */ + + +function isType(value, type) { + return toString.call(value) === "[object ".concat(type, "]"); +} +/** + * Adds leading zeros if shorter than four characters. Used for fixed-length hexadecimal values. + * + * @private + * @param {String} str + * @returns {String} + */ + + +function pad4(str) { + while (str.length < 4) { + str = "0".concat(str); + } + + return str; +} +/** + * Checks for flag-related errors, and strips/applies flags in a leading mode modifier. Offloads + * the flag preparation logic from the `XRegExp` constructor. + * + * @private + * @param {String} pattern Regex pattern, possibly with a leading mode modifier. + * @param {String} flags Any combination of flags. + * @returns {Object} Object with properties `pattern` and `flags`. + */ + + +function prepareFlags(pattern, flags) { + // Recent browsers throw on duplicate flags, so copy this behavior for nonnative flags + if (clipDuplicates(flags) !== flags) { + throw new SyntaxError("Invalid duplicate regex flag ".concat(flags)); + } // Strip and apply a leading mode modifier with any combination of flags except g or y + + + pattern = nativ.replace.call(pattern, /^\(\?([\w$]+)\)/, function ($0, $1) { + if (nativ.test.call(/[gy]/, $1)) { + throw new SyntaxError("Cannot use flag g or y in mode modifier ".concat($0)); + } // Allow duplicate flags within the mode modifier + + + flags = clipDuplicates(flags + $1); + return ''; + }); // Throw on unknown native or nonnative flags + + var _iteratorNormalCompletion = true; + var _didIteratorError = false; + var _iteratorError = undefined; + + try { + for (var _iterator = flags[Symbol.iterator](), _step; !(_iteratorNormalCompletion = (_step = _iterator.next()).done); _iteratorNormalCompletion = true) { + var flag = _step.value; + + if (!registeredFlags[flag]) { + throw new SyntaxError("Unknown regex flag ".concat(flag)); + } + } + } catch (err) { + _didIteratorError = true; + _iteratorError = err; + } finally { + try { + if (!_iteratorNormalCompletion && _iterator.return != null) { + _iterator.return(); + } + } finally { + if (_didIteratorError) { + throw _iteratorError; + } + } + } + + return { + pattern: pattern, + flags: flags + }; +} +/** + * Prepares an options object from the given value. + * + * @private + * @param {String|Object} value Value to convert to an options object. + * @returns {Object} Options object. + */ + + +function prepareOptions(value) { + var options = {}; + + if (isType(value, 'String')) { + XRegExp.forEach(value, /[^\s,]+/, function (match) { + options[match] = true; + }); + return options; + } + + return value; +} +/** + * Registers a flag so it doesn't throw an 'unknown flag' error. + * + * @private + * @param {String} flag Single-character flag to register. + */ + + +function registerFlag(flag) { + if (!/^[\w$]$/.test(flag)) { + throw new Error('Flag must be a single character A-Za-z0-9_$'); + } + + registeredFlags[flag] = true; +} +/** + * Runs built-in and custom regex syntax tokens in reverse insertion order at the specified + * position, until a match is found. + * + * @private + * @param {String} pattern Original pattern from which an XRegExp object is being built. + * @param {String} flags Flags being used to construct the regex. + * @param {Number} pos Position to search for tokens within `pattern`. + * @param {Number} scope Regex scope to apply: 'default' or 'class'. + * @param {Object} context Context object to use for token handler functions. + * @returns {Object} Object with properties `matchLength`, `output`, and `reparse`; or `null`. + */ + + +function runTokens(pattern, flags, pos, scope, context) { + var i = tokens.length; + var leadChar = pattern[pos]; + var result = null; + var match; + var t; // Run in reverse insertion order + + while (i--) { + t = tokens[i]; + + if (t.leadChar && t.leadChar !== leadChar || t.scope !== scope && t.scope !== 'all' || t.flag && !(flags.indexOf(t.flag) !== -1)) { + continue; + } + + match = XRegExp.exec(pattern, t.regex, pos, 'sticky'); + + if (match) { + result = { + matchLength: match[0].length, + output: t.handler.call(context, match, scope, flags), + reparse: t.reparse + }; // Finished with token tests + + break; + } + } + + return result; +} +/** + * Enables or disables implicit astral mode opt-in. When enabled, flag A is automatically added to + * all new regexes created by XRegExp. This causes an error to be thrown when creating regexes if + * the Unicode Base addon is not available, since flag A is registered by that addon. + * + * @private + * @param {Boolean} on `true` to enable; `false` to disable. + */ + + +function setAstral(on) { + features.astral = on; +} +/** + * Adds named capture groups to the `groups` property of match arrays. See here for details: + * https://github.com/tc39/proposal-regexp-named-groups + * + * @private + * @param {Boolean} on `true` to enable; `false` to disable. + */ + + +function setNamespacing(on) { + features.namespacing = on; +} +/** + * Returns the object, or throws an error if it is `null` or `undefined`. This is used to follow + * the ES5 abstract operation `ToObject`. + * + * @private + * @param {*} value Object to check and return. + * @returns {*} The provided object. + */ + + +function toObject(value) { + // null or undefined + if (value == null) { + throw new TypeError('Cannot convert null or undefined to object'); + } + + return value; +} // ==--------------------------== +// Constructor +// ==--------------------------== + +/** + * Creates an extended regular expression object for matching text with a pattern. Differs from a + * native regular expression in that additional syntax and flags are supported. The returned object + * is in fact a native `RegExp` and works with all native methods. + * + * @class XRegExp + * @constructor + * @param {String|RegExp} pattern Regex pattern string, or an existing regex object to copy. + * @param {String} [flags] Any combination of flags. + * Native flags: + * - `g` - global + * - `i` - ignore case + * - `m` - multiline anchors + * - `u` - unicode (ES6) + * - `y` - sticky (Firefox 3+, ES6) + * Additional XRegExp flags: + * - `n` - explicit capture + * - `s` - dot matches all (aka singleline) + * - `x` - free-spacing and line comments (aka extended) + * - `A` - astral (requires the Unicode Base addon) + * Flags cannot be provided when constructing one `RegExp` from another. + * @returns {RegExp} Extended regular expression object. + * @example + * + * // With named capture and flag x + * XRegExp(`(? [0-9]{4} ) -? # year + * (? [0-9]{2} ) -? # month + * (? [0-9]{2} ) # day`, 'x'); + * + * // Providing a regex object copies it. Native regexes are recompiled using native (not XRegExp) + * // syntax. Copies maintain extended data, are augmented with `XRegExp.prototype` properties, and + * // have fresh `lastIndex` properties (set to zero). + * XRegExp(/regex/); + */ + + +function XRegExp(pattern, flags) { + if (XRegExp.isRegExp(pattern)) { + if (flags !== undefined) { + throw new TypeError('Cannot supply flags when copying a RegExp'); + } + + return copyRegex(pattern); + } // Copy the argument behavior of `RegExp` + + + pattern = pattern === undefined ? '' : String(pattern); + flags = flags === undefined ? '' : String(flags); + + if (XRegExp.isInstalled('astral') && !(flags.indexOf('A') !== -1)) { + // This causes an error to be thrown if the Unicode Base addon is not available + flags += 'A'; + } + + if (!patternCache[pattern]) { + patternCache[pattern] = {}; + } + + if (!patternCache[pattern][flags]) { + var context = { + hasNamedCapture: false, + captureNames: [] + }; + var scope = defaultScope; + var output = ''; + var pos = 0; + var result; // Check for flag-related errors, and strip/apply flags in a leading mode modifier + + var applied = prepareFlags(pattern, flags); + var appliedPattern = applied.pattern; + var appliedFlags = applied.flags; // Use XRegExp's tokens to translate the pattern to a native regex pattern. + // `appliedPattern.length` may change on each iteration if tokens use `reparse` + + while (pos < appliedPattern.length) { + do { + // Check for custom tokens at the current position + result = runTokens(appliedPattern, appliedFlags, pos, scope, context); // If the matched token used the `reparse` option, splice its output into the + // pattern before running tokens again at the same position + + if (result && result.reparse) { + appliedPattern = appliedPattern.slice(0, pos) + result.output + appliedPattern.slice(pos + result.matchLength); + } + } while (result && result.reparse); + + if (result) { + output += result.output; + pos += result.matchLength || 1; + } else { + // Get the native token at the current position + var _XRegExp$exec = XRegExp.exec(appliedPattern, nativeTokens[scope], pos, 'sticky'), + _XRegExp$exec2 = _slicedToArray(_XRegExp$exec, 1), + token = _XRegExp$exec2[0]; + + output += token; + pos += token.length; + + if (token === '[' && scope === defaultScope) { + scope = classScope; + } else if (token === ']' && scope === classScope) { + scope = defaultScope; + } + } + } + + patternCache[pattern][flags] = { + // Use basic cleanup to collapse repeated empty groups like `(?:)(?:)` to `(?:)`. Empty + // groups are sometimes inserted during regex transpilation in order to keep tokens + // separated. However, more than one empty group in a row is never needed. + pattern: nativ.replace.call(output, /(?:\(\?:\))+/g, '(?:)'), + // Strip all but native flags + flags: nativ.replace.call(appliedFlags, /[^gimuy]+/g, ''), + // `context.captureNames` has an item for each capturing group, even if unnamed + captures: context.hasNamedCapture ? context.captureNames : null + }; + } + + var generated = patternCache[pattern][flags]; + return augment(new RegExp(generated.pattern, generated.flags), generated.captures, pattern, flags); +} // Add `RegExp.prototype` to the prototype chain + + +XRegExp.prototype = /(?:)/; // ==--------------------------== +// Public properties +// ==--------------------------== + +/** + * The XRegExp version number as a string containing three dot-separated parts. For example, + * '2.0.0-beta-3'. + * + * @static + * @memberOf XRegExp + * @type String + */ + +XRegExp.version = '4.2.0'; // ==--------------------------== +// Public methods +// ==--------------------------== +// Intentionally undocumented; used in tests and addons + +XRegExp._clipDuplicates = clipDuplicates; +XRegExp._hasNativeFlag = hasNativeFlag; +XRegExp._dec = dec; +XRegExp._hex = hex; +XRegExp._pad4 = pad4; +/** + * Extends XRegExp syntax and allows custom flags. This is used internally and can be used to + * create XRegExp addons. If more than one token can match the same string, the last added wins. + * + * @memberOf XRegExp + * @param {RegExp} regex Regex object that matches the new token. + * @param {Function} handler Function that returns a new pattern string (using native regex syntax) + * to replace the matched token within all future XRegExp regexes. Has access to persistent + * properties of the regex being built, through `this`. Invoked with three arguments: + * - The match array, with named backreference properties. + * - The regex scope where the match was found: 'default' or 'class'. + * - The flags used by the regex, including any flags in a leading mode modifier. + * The handler function becomes part of the XRegExp construction process, so be careful not to + * construct XRegExps within the function or you will trigger infinite recursion. + * @param {Object} [options] Options object with optional properties: + * - `scope` {String} Scope where the token applies: 'default', 'class', or 'all'. + * - `flag` {String} Single-character flag that triggers the token. This also registers the + * flag, which prevents XRegExp from throwing an 'unknown flag' error when the flag is used. + * - `optionalFlags` {String} Any custom flags checked for within the token `handler` that are + * not required to trigger the token. This registers the flags, to prevent XRegExp from + * throwing an 'unknown flag' error when any of the flags are used. + * - `reparse` {Boolean} Whether the `handler` function's output should not be treated as + * final, and instead be reparseable by other tokens (including the current token). Allows + * token chaining or deferring. + * - `leadChar` {String} Single character that occurs at the beginning of any successful match + * of the token (not always applicable). This doesn't change the behavior of the token unless + * you provide an erroneous value. However, providing it can increase the token's performance + * since the token can be skipped at any positions where this character doesn't appear. + * @example + * + * // Basic usage: Add \a for the ALERT control code + * XRegExp.addToken( + * /\\a/, + * () => '\\x07', + * {scope: 'all'} + * ); + * XRegExp('\\a[\\a-\\n]+').test('\x07\n\x07'); // -> true + * + * // Add the U (ungreedy) flag from PCRE and RE2, which reverses greedy and lazy quantifiers. + * // Since `scope` is not specified, it uses 'default' (i.e., transformations apply outside of + * // character classes only) + * XRegExp.addToken( + * /([?*+]|{\d+(?:,\d*)?})(\??)/, + * (match) => `${match[1]}${match[2] ? '' : '?'}`, + * {flag: 'U'} + * ); + * XRegExp('a+', 'U').exec('aaa')[0]; // -> 'a' + * XRegExp('a+?', 'U').exec('aaa')[0]; // -> 'aaa' + */ + +XRegExp.addToken = function (regex, handler, options) { + options = options || {}; + var _options = options, + optionalFlags = _options.optionalFlags; + + if (options.flag) { + registerFlag(options.flag); + } + + if (optionalFlags) { + optionalFlags = nativ.split.call(optionalFlags, ''); + var _iteratorNormalCompletion2 = true; + var _didIteratorError2 = false; + var _iteratorError2 = undefined; + + try { + for (var _iterator2 = optionalFlags[Symbol.iterator](), _step2; !(_iteratorNormalCompletion2 = (_step2 = _iterator2.next()).done); _iteratorNormalCompletion2 = true) { + var flag = _step2.value; + registerFlag(flag); + } + } catch (err) { + _didIteratorError2 = true; + _iteratorError2 = err; + } finally { + try { + if (!_iteratorNormalCompletion2 && _iterator2.return != null) { + _iterator2.return(); + } + } finally { + if (_didIteratorError2) { + throw _iteratorError2; + } + } + } + } // Add to the private list of syntax tokens + + + tokens.push({ + regex: copyRegex(regex, { + addG: true, + addY: hasNativeY, + isInternalOnly: true + }), + handler: handler, + scope: options.scope || defaultScope, + flag: options.flag, + reparse: options.reparse, + leadChar: options.leadChar + }); // Reset the pattern cache used by the `XRegExp` constructor, since the same pattern and flags + // might now produce different results + + XRegExp.cache.flush('patterns'); +}; +/** + * Caches and returns the result of calling `XRegExp(pattern, flags)`. On any subsequent call with + * the same pattern and flag combination, the cached copy of the regex is returned. + * + * @memberOf XRegExp + * @param {String} pattern Regex pattern string. + * @param {String} [flags] Any combination of XRegExp flags. + * @returns {RegExp} Cached XRegExp object. + * @example + * + * while (match = XRegExp.cache('.', 'gs').exec(str)) { + * // The regex is compiled once only + * } + */ + + +XRegExp.cache = function (pattern, flags) { + if (!regexCache[pattern]) { + regexCache[pattern] = {}; + } + + return regexCache[pattern][flags] || (regexCache[pattern][flags] = XRegExp(pattern, flags)); +}; // Intentionally undocumented; used in tests + + +XRegExp.cache.flush = function (cacheName) { + if (cacheName === 'patterns') { + // Flush the pattern cache used by the `XRegExp` constructor + patternCache = {}; + } else { + // Flush the regex cache populated by `XRegExp.cache` + regexCache = {}; + } +}; +/** + * Escapes any regular expression metacharacters, for use when matching literal strings. The result + * can safely be used at any point within a regex that uses any flags. + * + * @memberOf XRegExp + * @param {String} str String to escape. + * @returns {String} String with regex metacharacters escaped. + * @example + * + * XRegExp.escape('Escaped? <.>'); + * // -> 'Escaped\?\ <\.>' + */ + + +XRegExp.escape = function (str) { + return nativ.replace.call(toObject(str), /[-\[\]{}()*+?.,\\^$|#\s]/g, '\\$&'); +}; +/** + * Executes a regex search in a specified string. Returns a match array or `null`. If the provided + * regex uses named capture, named backreference properties are included on the match array. + * Optional `pos` and `sticky` arguments specify the search start position, and whether the match + * must start at the specified position only. The `lastIndex` property of the provided regex is not + * used, but is updated for compatibility. Also fixes browser bugs compared to the native + * `RegExp.prototype.exec` and can be used reliably cross-browser. + * + * @memberOf XRegExp + * @param {String} str String to search. + * @param {RegExp} regex Regex to search with. + * @param {Number} [pos=0] Zero-based index at which to start the search. + * @param {Boolean|String} [sticky=false] Whether the match must start at the specified position + * only. The string `'sticky'` is accepted as an alternative to `true`. + * @returns {Array} Match array with named backreference properties, or `null`. + * @example + * + * // Basic use, with named backreference + * let match = XRegExp.exec('U+2620', XRegExp('U\\+(?[0-9A-F]{4})')); + * match.hex; // -> '2620' + * + * // With pos and sticky, in a loop + * let pos = 2, result = [], match; + * while (match = XRegExp.exec('<1><2><3><4>5<6>', /<(\d)>/, pos, 'sticky')) { + * result.push(match[1]); + * pos = match.index + match[0].length; + * } + * // result -> ['2', '3', '4'] + */ + + +XRegExp.exec = function (str, regex, pos, sticky) { + var cacheKey = 'g'; + var addY = false; + var fakeY = false; + var match; + addY = hasNativeY && !!(sticky || regex.sticky && sticky !== false); + + if (addY) { + cacheKey += 'y'; + } else if (sticky) { + // Simulate sticky matching by appending an empty capture to the original regex. The + // resulting regex will succeed no matter what at the current index (set with `lastIndex`), + // and will not search the rest of the subject string. We'll know that the original regex + // has failed if that last capture is `''` rather than `undefined` (i.e., if that last + // capture participated in the match). + fakeY = true; + cacheKey += 'FakeY'; + } + + regex[REGEX_DATA] = regex[REGEX_DATA] || {}; // Shares cached copies with `XRegExp.match`/`replace` + + var r2 = regex[REGEX_DATA][cacheKey] || (regex[REGEX_DATA][cacheKey] = copyRegex(regex, { + addG: true, + addY: addY, + source: fakeY ? "".concat(regex.source, "|()") : undefined, + removeY: sticky === false, + isInternalOnly: true + })); + pos = pos || 0; + r2.lastIndex = pos; // Fixed `exec` required for `lastIndex` fix, named backreferences, etc. + + match = fixed.exec.call(r2, str); // Get rid of the capture added by the pseudo-sticky matcher if needed. An empty string means + // the original regexp failed (see above). + + if (fakeY && match && match.pop() === '') { + match = null; + } + + if (regex.global) { + regex.lastIndex = match ? r2.lastIndex : 0; + } + + return match; +}; +/** + * Executes a provided function once per regex match. Searches always start at the beginning of the + * string and continue until the end, regardless of the state of the regex's `global` property and + * initial `lastIndex`. + * + * @memberOf XRegExp + * @param {String} str String to search. + * @param {RegExp} regex Regex to search with. + * @param {Function} callback Function to execute for each match. Invoked with four arguments: + * - The match array, with named backreference properties. + * - The zero-based match index. + * - The string being traversed. + * - The regex object being used to traverse the string. + * @example + * + * // Extracts every other digit from a string + * const evens = []; + * XRegExp.forEach('1a2345', /\d/, (match, i) => { + * if (i % 2) evens.push(+match[0]); + * }); + * // evens -> [2, 4] + */ + + +XRegExp.forEach = function (str, regex, callback) { + var pos = 0; + var i = -1; + var match; + + while (match = XRegExp.exec(str, regex, pos)) { + // Because `regex` is provided to `callback`, the function could use the deprecated/ + // nonstandard `RegExp.prototype.compile` to mutate the regex. However, since `XRegExp.exec` + // doesn't use `lastIndex` to set the search position, this can't lead to an infinite loop, + // at least. Actually, because of the way `XRegExp.exec` caches globalized versions of + // regexes, mutating the regex will not have any effect on the iteration or matched strings, + // which is a nice side effect that brings extra safety. + callback(match, ++i, str, regex); + pos = match.index + (match[0].length || 1); + } +}; +/** + * Copies a regex object and adds flag `g`. The copy maintains extended data, is augmented with + * `XRegExp.prototype` properties, and has a fresh `lastIndex` property (set to zero). Native + * regexes are not recompiled using XRegExp syntax. + * + * @memberOf XRegExp + * @param {RegExp} regex Regex to globalize. + * @returns {RegExp} Copy of the provided regex with flag `g` added. + * @example + * + * const globalCopy = XRegExp.globalize(/regex/); + * globalCopy.global; // -> true + */ + + +XRegExp.globalize = function (regex) { + return copyRegex(regex, { + addG: true + }); +}; +/** + * Installs optional features according to the specified options. Can be undone using + * `XRegExp.uninstall`. + * + * @memberOf XRegExp + * @param {Object|String} options Options object or string. + * @example + * + * // With an options object + * XRegExp.install({ + * // Enables support for astral code points in Unicode addons (implicitly sets flag A) + * astral: true, + * + * // Adds named capture groups to the `groups` property of matches + * namespacing: true + * }); + * + * // With an options string + * XRegExp.install('astral namespacing'); + */ + + +XRegExp.install = function (options) { + options = prepareOptions(options); + + if (!features.astral && options.astral) { + setAstral(true); + } + + if (!features.namespacing && options.namespacing) { + setNamespacing(true); + } +}; +/** + * Checks whether an individual optional feature is installed. + * + * @memberOf XRegExp + * @param {String} feature Name of the feature to check. One of: + * - `astral` + * - `namespacing` + * @returns {Boolean} Whether the feature is installed. + * @example + * + * XRegExp.isInstalled('astral'); + */ + + +XRegExp.isInstalled = function (feature) { + return !!features[feature]; +}; +/** + * Returns `true` if an object is a regex; `false` if it isn't. This works correctly for regexes + * created in another frame, when `instanceof` and `constructor` checks would fail. + * + * @memberOf XRegExp + * @param {*} value Object to check. + * @returns {Boolean} Whether the object is a `RegExp` object. + * @example + * + * XRegExp.isRegExp('string'); // -> false + * XRegExp.isRegExp(/regex/i); // -> true + * XRegExp.isRegExp(RegExp('^', 'm')); // -> true + * XRegExp.isRegExp(XRegExp('(?s).')); // -> true + */ + + +XRegExp.isRegExp = function (value) { + return toString.call(value) === '[object RegExp]'; +}; // isType(value, 'RegExp'); + +/** + * Returns the first matched string, or in global mode, an array containing all matched strings. + * This is essentially a more convenient re-implementation of `String.prototype.match` that gives + * the result types you actually want (string instead of `exec`-style array in match-first mode, + * and an empty array instead of `null` when no matches are found in match-all mode). It also lets + * you override flag g and ignore `lastIndex`, and fixes browser bugs. + * + * @memberOf XRegExp + * @param {String} str String to search. + * @param {RegExp} regex Regex to search with. + * @param {String} [scope='one'] Use 'one' to return the first match as a string. Use 'all' to + * return an array of all matched strings. If not explicitly specified and `regex` uses flag g, + * `scope` is 'all'. + * @returns {String|Array} In match-first mode: First match as a string, or `null`. In match-all + * mode: Array of all matched strings, or an empty array. + * @example + * + * // Match first + * XRegExp.match('abc', /\w/); // -> 'a' + * XRegExp.match('abc', /\w/g, 'one'); // -> 'a' + * XRegExp.match('abc', /x/g, 'one'); // -> null + * + * // Match all + * XRegExp.match('abc', /\w/g); // -> ['a', 'b', 'c'] + * XRegExp.match('abc', /\w/, 'all'); // -> ['a', 'b', 'c'] + * XRegExp.match('abc', /x/, 'all'); // -> [] + */ + + +XRegExp.match = function (str, regex, scope) { + var global = regex.global && scope !== 'one' || scope === 'all'; + var cacheKey = (global ? 'g' : '') + (regex.sticky ? 'y' : '') || 'noGY'; + regex[REGEX_DATA] = regex[REGEX_DATA] || {}; // Shares cached copies with `XRegExp.exec`/`replace` + + var r2 = regex[REGEX_DATA][cacheKey] || (regex[REGEX_DATA][cacheKey] = copyRegex(regex, { + addG: !!global, + removeG: scope === 'one', + isInternalOnly: true + })); + var result = nativ.match.call(toObject(str), r2); + + if (regex.global) { + regex.lastIndex = scope === 'one' && result ? // Can't use `r2.lastIndex` since `r2` is nonglobal in this case + result.index + result[0].length : 0; + } + + return global ? result || [] : result && result[0]; +}; +/** + * Retrieves the matches from searching a string using a chain of regexes that successively search + * within previous matches. The provided `chain` array can contain regexes and or objects with + * `regex` and `backref` properties. When a backreference is specified, the named or numbered + * backreference is passed forward to the next regex or returned. + * + * @memberOf XRegExp + * @param {String} str String to search. + * @param {Array} chain Regexes that each search for matches within preceding results. + * @returns {Array} Matches by the last regex in the chain, or an empty array. + * @example + * + * // Basic usage; matches numbers within tags + * XRegExp.matchChain('1 2 3 4 a 56', [ + * XRegExp('(?is).*?'), + * /\d+/ + * ]); + * // -> ['2', '4', '56'] + * + * // Passing forward and returning specific backreferences + * html = '
XRegExp\ + * Google'; + * XRegExp.matchChain(html, [ + * {regex: //i, backref: 1}, + * {regex: XRegExp('(?i)^https?://(?[^/?#]+)'), backref: 'domain'} + * ]); + * // -> ['xregexp.com', 'www.google.com'] + */ + + +XRegExp.matchChain = function (str, chain) { + return function recurseChain(values, level) { + var item = chain[level].regex ? chain[level] : { + regex: chain[level] + }; + var matches = []; + + function addMatch(match) { + if (item.backref) { + var ERR_UNDEFINED_GROUP = "Backreference to undefined group: ".concat(item.backref); + var isNamedBackref = isNaN(item.backref); + + if (isNamedBackref && XRegExp.isInstalled('namespacing')) { + // `groups` has `null` as prototype, so using `in` instead of `hasOwnProperty` + if (!(item.backref in match.groups)) { + throw new ReferenceError(ERR_UNDEFINED_GROUP); + } + } else if (!match.hasOwnProperty(item.backref)) { + throw new ReferenceError(ERR_UNDEFINED_GROUP); + } + + var backrefValue = isNamedBackref && XRegExp.isInstalled('namespacing') ? match.groups[item.backref] : match[item.backref]; + matches.push(backrefValue || ''); + } else { + matches.push(match[0]); + } + } + + var _iteratorNormalCompletion3 = true; + var _didIteratorError3 = false; + var _iteratorError3 = undefined; + + try { + for (var _iterator3 = values[Symbol.iterator](), _step3; !(_iteratorNormalCompletion3 = (_step3 = _iterator3.next()).done); _iteratorNormalCompletion3 = true) { + var value = _step3.value; + XRegExp.forEach(value, item.regex, addMatch); + } + } catch (err) { + _didIteratorError3 = true; + _iteratorError3 = err; + } finally { + try { + if (!_iteratorNormalCompletion3 && _iterator3.return != null) { + _iterator3.return(); + } + } finally { + if (_didIteratorError3) { + throw _iteratorError3; + } + } + } + + return level === chain.length - 1 || !matches.length ? matches : recurseChain(matches, level + 1); + }([str], 0); +}; +/** + * Returns a new string with one or all matches of a pattern replaced. The pattern can be a string + * or regex, and the replacement can be a string or a function to be called for each match. To + * perform a global search and replace, use the optional `scope` argument or include flag g if using + * a regex. Replacement strings can use `${n}` or `$` for named and numbered backreferences. + * Replacement functions can use named backreferences via `arguments[0].name`. Also fixes browser + * bugs compared to the native `String.prototype.replace` and can be used reliably cross-browser. + * + * @memberOf XRegExp + * @param {String} str String to search. + * @param {RegExp|String} search Search pattern to be replaced. + * @param {String|Function} replacement Replacement string or a function invoked to create it. + * Replacement strings can include special replacement syntax: + * - $$ - Inserts a literal $ character. + * - $&, $0 - Inserts the matched substring. + * - $` - Inserts the string that precedes the matched substring (left context). + * - $' - Inserts the string that follows the matched substring (right context). + * - $n, $nn - Where n/nn are digits referencing an existent capturing group, inserts + * backreference n/nn. + * - ${n}, $ - Where n is a name or any number of digits that reference an existent capturing + * group, inserts backreference n. + * Replacement functions are invoked with three or more arguments: + * - The matched substring (corresponds to $& above). Named backreferences are accessible as + * properties of this first argument. + * - 0..n arguments, one for each backreference (corresponding to $1, $2, etc. above). + * - The zero-based index of the match within the total search string. + * - The total string being searched. + * @param {String} [scope='one'] Use 'one' to replace the first match only, or 'all'. If not + * explicitly specified and using a regex with flag g, `scope` is 'all'. + * @returns {String} New string with one or all matches replaced. + * @example + * + * // Regex search, using named backreferences in replacement string + * const name = XRegExp('(?\\w+) (?\\w+)'); + * XRegExp.replace('John Smith', name, '$, $'); + * // -> 'Smith, John' + * + * // Regex search, using named backreferences in replacement function + * XRegExp.replace('John Smith', name, (match) => `${match.last}, ${match.first}`); + * // -> 'Smith, John' + * + * // String search, with replace-all + * XRegExp.replace('RegExp builds RegExps', 'RegExp', 'XRegExp', 'all'); + * // -> 'XRegExp builds XRegExps' + */ + + +XRegExp.replace = function (str, search, replacement, scope) { + var isRegex = XRegExp.isRegExp(search); + var global = search.global && scope !== 'one' || scope === 'all'; + var cacheKey = (global ? 'g' : '') + (search.sticky ? 'y' : '') || 'noGY'; + var s2 = search; + + if (isRegex) { + search[REGEX_DATA] = search[REGEX_DATA] || {}; // Shares cached copies with `XRegExp.exec`/`match`. Since a copy is used, `search`'s + // `lastIndex` isn't updated *during* replacement iterations + + s2 = search[REGEX_DATA][cacheKey] || (search[REGEX_DATA][cacheKey] = copyRegex(search, { + addG: !!global, + removeG: scope === 'one', + isInternalOnly: true + })); + } else if (global) { + s2 = new RegExp(XRegExp.escape(String(search)), 'g'); + } // Fixed `replace` required for named backreferences, etc. + + + var result = fixed.replace.call(toObject(str), s2, replacement); + + if (isRegex && search.global) { + // Fixes IE, Safari bug (last tested IE 9, Safari 5.1) + search.lastIndex = 0; + } + + return result; +}; +/** + * Performs batch processing of string replacements. Used like `XRegExp.replace`, but accepts an + * array of replacement details. Later replacements operate on the output of earlier replacements. + * Replacement details are accepted as an array with a regex or string to search for, the + * replacement string or function, and an optional scope of 'one' or 'all'. Uses the XRegExp + * replacement text syntax, which supports named backreference properties via `${name}` or + * `$`. + * + * @memberOf XRegExp + * @param {String} str String to search. + * @param {Array} replacements Array of replacement detail arrays. + * @returns {String} New string with all replacements. + * @example + * + * str = XRegExp.replaceEach(str, [ + * [XRegExp('(?a)'), 'z${name}'], + * [/b/gi, 'y'], + * [/c/g, 'x', 'one'], // scope 'one' overrides /g + * [/d/, 'w', 'all'], // scope 'all' overrides lack of /g + * ['e', 'v', 'all'], // scope 'all' allows replace-all for strings + * [/f/g, ($0) => $0.toUpperCase()] + * ]); + */ + + +XRegExp.replaceEach = function (str, replacements) { + var _iteratorNormalCompletion4 = true; + var _didIteratorError4 = false; + var _iteratorError4 = undefined; + + try { + for (var _iterator4 = replacements[Symbol.iterator](), _step4; !(_iteratorNormalCompletion4 = (_step4 = _iterator4.next()).done); _iteratorNormalCompletion4 = true) { + var r = _step4.value; + str = XRegExp.replace(str, r[0], r[1], r[2]); + } + } catch (err) { + _didIteratorError4 = true; + _iteratorError4 = err; + } finally { + try { + if (!_iteratorNormalCompletion4 && _iterator4.return != null) { + _iterator4.return(); + } + } finally { + if (_didIteratorError4) { + throw _iteratorError4; + } + } + } + + return str; +}; +/** + * Splits a string into an array of strings using a regex or string separator. Matches of the + * separator are not included in the result array. However, if `separator` is a regex that contains + * capturing groups, backreferences are spliced into the result each time `separator` is matched. + * Fixes browser bugs compared to the native `String.prototype.split` and can be used reliably + * cross-browser. + * + * @memberOf XRegExp + * @param {String} str String to split. + * @param {RegExp|String} separator Regex or string to use for separating the string. + * @param {Number} [limit] Maximum number of items to include in the result array. + * @returns {Array} Array of substrings. + * @example + * + * // Basic use + * XRegExp.split('a b c', ' '); + * // -> ['a', 'b', 'c'] + * + * // With limit + * XRegExp.split('a b c', ' ', 2); + * // -> ['a', 'b'] + * + * // Backreferences in result array + * XRegExp.split('..word1..', /([a-z]+)(\d+)/i); + * // -> ['..', 'word', '1', '..'] + */ + + +XRegExp.split = function (str, separator, limit) { + return fixed.split.call(toObject(str), separator, limit); +}; +/** + * Executes a regex search in a specified string. Returns `true` or `false`. Optional `pos` and + * `sticky` arguments specify the search start position, and whether the match must start at the + * specified position only. The `lastIndex` property of the provided regex is not used, but is + * updated for compatibility. Also fixes browser bugs compared to the native + * `RegExp.prototype.test` and can be used reliably cross-browser. + * + * @memberOf XRegExp + * @param {String} str String to search. + * @param {RegExp} regex Regex to search with. + * @param {Number} [pos=0] Zero-based index at which to start the search. + * @param {Boolean|String} [sticky=false] Whether the match must start at the specified position + * only. The string `'sticky'` is accepted as an alternative to `true`. + * @returns {Boolean} Whether the regex matched the provided value. + * @example + * + * // Basic use + * XRegExp.test('abc', /c/); // -> true + * + * // With pos and sticky + * XRegExp.test('abc', /c/, 0, 'sticky'); // -> false + * XRegExp.test('abc', /c/, 2, 'sticky'); // -> true + */ +// Do this the easy way :-) + + +XRegExp.test = function (str, regex, pos, sticky) { + return !!XRegExp.exec(str, regex, pos, sticky); +}; +/** + * Uninstalls optional features according to the specified options. All optional features start out + * uninstalled, so this is used to undo the actions of `XRegExp.install`. + * + * @memberOf XRegExp + * @param {Object|String} options Options object or string. + * @example + * + * // With an options object + * XRegExp.uninstall({ + * // Disables support for astral code points in Unicode addons + * astral: true, + * + * // Don't add named capture groups to the `groups` property of matches + * namespacing: true + * }); + * + * // With an options string + * XRegExp.uninstall('astral namespacing'); + */ + + +XRegExp.uninstall = function (options) { + options = prepareOptions(options); + + if (features.astral && options.astral) { + setAstral(false); + } + + if (features.namespacing && options.namespacing) { + setNamespacing(false); + } +}; +/** + * Returns an XRegExp object that is the union of the given patterns. Patterns can be provided as + * regex objects or strings. Metacharacters are escaped in patterns provided as strings. + * Backreferences in provided regex objects are automatically renumbered to work correctly within + * the larger combined pattern. Native flags used by provided regexes are ignored in favor of the + * `flags` argument. + * + * @memberOf XRegExp + * @param {Array} patterns Regexes and strings to combine. + * @param {String} [flags] Any combination of XRegExp flags. + * @param {Object} [options] Options object with optional properties: + * - `conjunction` {String} Type of conjunction to use: 'or' (default) or 'none'. + * @returns {RegExp} Union of the provided regexes and strings. + * @example + * + * XRegExp.union(['a+b*c', /(dogs)\1/, /(cats)\1/], 'i'); + * // -> /a\+b\*c|(dogs)\1|(cats)\2/i + * + * XRegExp.union([/man/, /bear/, /pig/], 'i', {conjunction: 'none'}); + * // -> /manbearpig/i + */ + + +XRegExp.union = function (patterns, flags, options) { + options = options || {}; + var conjunction = options.conjunction || 'or'; + var numCaptures = 0; + var numPriorCaptures; + var captureNames; + + function rewrite(match, paren, backref) { + var name = captureNames[numCaptures - numPriorCaptures]; // Capturing group + + if (paren) { + ++numCaptures; // If the current capture has a name, preserve the name + + if (name) { + return "(?<".concat(name, ">"); + } // Backreference + + } else if (backref) { + // Rewrite the backreference + return "\\".concat(+backref + numPriorCaptures); + } + + return match; + } + + if (!(isType(patterns, 'Array') && patterns.length)) { + throw new TypeError('Must provide a nonempty array of patterns to merge'); + } + + var parts = /(\()(?!\?)|\\([1-9]\d*)|\\[\s\S]|\[(?:[^\\\]]|\\[\s\S])*\]/g; + var output = []; + var _iteratorNormalCompletion5 = true; + var _didIteratorError5 = false; + var _iteratorError5 = undefined; + + try { + for (var _iterator5 = patterns[Symbol.iterator](), _step5; !(_iteratorNormalCompletion5 = (_step5 = _iterator5.next()).done); _iteratorNormalCompletion5 = true) { + var pattern = _step5.value; + + if (XRegExp.isRegExp(pattern)) { + numPriorCaptures = numCaptures; + captureNames = pattern[REGEX_DATA] && pattern[REGEX_DATA].captureNames || []; // Rewrite backreferences. Passing to XRegExp dies on octals and ensures patterns are + // independently valid; helps keep this simple. Named captures are put back + + output.push(nativ.replace.call(XRegExp(pattern.source).source, parts, rewrite)); + } else { + output.push(XRegExp.escape(pattern)); + } + } + } catch (err) { + _didIteratorError5 = true; + _iteratorError5 = err; + } finally { + try { + if (!_iteratorNormalCompletion5 && _iterator5.return != null) { + _iterator5.return(); + } + } finally { + if (_didIteratorError5) { + throw _iteratorError5; + } + } + } + + var separator = conjunction === 'none' ? '' : '|'; + return XRegExp(output.join(separator), flags); +}; // ==--------------------------== +// Fixed/extended native methods +// ==--------------------------== + +/** + * Adds named capture support (with backreferences returned as `result.name`), and fixes browser + * bugs in the native `RegExp.prototype.exec`. Use via `XRegExp.exec`. + * + * @memberOf RegExp + * @param {String} str String to search. + * @returns {Array} Match array with named backreference properties, or `null`. + */ + + +fixed.exec = function (str) { + var origLastIndex = this.lastIndex; + var match = nativ.exec.apply(this, arguments); + + if (match) { + // Fix browsers whose `exec` methods don't return `undefined` for nonparticipating capturing + // groups. This fixes IE 5.5-8, but not IE 9's quirks mode or emulation of older IEs. IE 9 + // in standards mode follows the spec. + if (!correctExecNpcg && match.length > 1 && match.indexOf('') !== -1) { + var r2 = copyRegex(this, { + removeG: true, + isInternalOnly: true + }); // Using `str.slice(match.index)` rather than `match[0]` in case lookahead allowed + // matching due to characters outside the match + + nativ.replace.call(String(str).slice(match.index), r2, function () { + var len = arguments.length; // Skip index 0 and the last 2 + + for (var i = 1; i < len - 2; ++i) { + if ((i < 0 || arguments.length <= i ? undefined : arguments[i]) === undefined) { + match[i] = undefined; + } + } + }); + } // Attach named capture properties + + + var groupsObject = match; + + if (XRegExp.isInstalled('namespacing')) { + // https://tc39.github.io/proposal-regexp-named-groups/#sec-regexpbuiltinexec + match.groups = Object.create(null); + groupsObject = match.groups; + } + + if (this[REGEX_DATA] && this[REGEX_DATA].captureNames) { + // Skip index 0 + for (var i = 1; i < match.length; ++i) { + var name = this[REGEX_DATA].captureNames[i - 1]; + + if (name) { + groupsObject[name] = match[i]; + } + } + } // Fix browsers that increment `lastIndex` after zero-length matches + + + if (this.global && !match[0].length && this.lastIndex > match.index) { + this.lastIndex = match.index; + } + } + + if (!this.global) { + // Fixes IE, Opera bug (last tested IE 9, Opera 11.6) + this.lastIndex = origLastIndex; + } + + return match; +}; +/** + * Fixes browser bugs in the native `RegExp.prototype.test`. + * + * @memberOf RegExp + * @param {String} str String to search. + * @returns {Boolean} Whether the regex matched the provided value. + */ + + +fixed.test = function (str) { + // Do this the easy way :-) + return !!fixed.exec.call(this, str); +}; +/** + * Adds named capture support (with backreferences returned as `result.name`), and fixes browser + * bugs in the native `String.prototype.match`. + * + * @memberOf String + * @param {RegExp|*} regex Regex to search with. If not a regex object, it is passed to `RegExp`. + * @returns {Array} If `regex` uses flag g, an array of match strings or `null`. Without flag g, + * the result of calling `regex.exec(this)`. + */ + + +fixed.match = function (regex) { + if (!XRegExp.isRegExp(regex)) { + // Use the native `RegExp` rather than `XRegExp` + regex = new RegExp(regex); + } else if (regex.global) { + var result = nativ.match.apply(this, arguments); // Fixes IE bug + + regex.lastIndex = 0; + return result; + } + + return fixed.exec.call(regex, toObject(this)); +}; +/** + * Adds support for `${n}` (or `$`) tokens for named and numbered backreferences in replacement + * text, and provides named backreferences to replacement functions as `arguments[0].name`. Also + * fixes browser bugs in replacement text syntax when performing a replacement using a nonregex + * search value, and the value of a replacement regex's `lastIndex` property during replacement + * iterations and upon completion. Note that this doesn't support SpiderMonkey's proprietary third + * (`flags`) argument. Use via `XRegExp.replace`. + * + * @memberOf String + * @param {RegExp|String} search Search pattern to be replaced. + * @param {String|Function} replacement Replacement string or a function invoked to create it. + * @returns {String} New string with one or all matches replaced. + */ + + +fixed.replace = function (search, replacement) { + var isRegex = XRegExp.isRegExp(search); + var origLastIndex; + var captureNames; + var result; + + if (isRegex) { + if (search[REGEX_DATA]) { + captureNames = search[REGEX_DATA].captureNames; + } // Only needed if `search` is nonglobal + + + origLastIndex = search.lastIndex; + } else { + search += ''; // Type-convert + } // Don't use `typeof`; some older browsers return 'function' for regex objects + + + if (isType(replacement, 'Function')) { + // Stringifying `this` fixes a bug in IE < 9 where the last argument in replacement + // functions isn't type-converted to a string + result = nativ.replace.call(String(this), search, function () { + for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) { + args[_key] = arguments[_key]; + } + + if (captureNames) { + var groupsObject; + + if (XRegExp.isInstalled('namespacing')) { + // https://tc39.github.io/proposal-regexp-named-groups/#sec-regexpbuiltinexec + groupsObject = Object.create(null); + args.push(groupsObject); + } else { + // Change the `args[0]` string primitive to a `String` object that can store + // properties. This really does need to use `String` as a constructor + args[0] = new String(args[0]); + groupsObject = args[0]; + } // Store named backreferences + + + for (var i = 0; i < captureNames.length; ++i) { + if (captureNames[i]) { + groupsObject[captureNames[i]] = args[i + 1]; + } + } + } // Update `lastIndex` before calling `replacement`. Fixes IE, Chrome, Firefox, Safari + // bug (last tested IE 9, Chrome 17, Firefox 11, Safari 5.1) + + + if (isRegex && search.global) { + search.lastIndex = args[args.length - 2] + args[0].length; + } // ES6 specs the context for replacement functions as `undefined` + + + return replacement.apply(void 0, args); + }); + } else { + // Ensure that the last value of `args` will be a string when given nonstring `this`, + // while still throwing on null or undefined context + result = nativ.replace.call(this == null ? this : String(this), search, function () { + for (var _len2 = arguments.length, args = new Array(_len2), _key2 = 0; _key2 < _len2; _key2++) { + args[_key2] = arguments[_key2]; + } + + return nativ.replace.call(String(replacement), replacementToken, replacer); + + function replacer($0, bracketed, angled, dollarToken) { + bracketed = bracketed || angled; // Named or numbered backreference with curly or angled braces + + if (bracketed) { + // XRegExp behavior for `${n}` or `$`: + // 1. Backreference to numbered capture, if `n` is an integer. Use `0` for the + // entire match. Any number of leading zeros may be used. + // 2. Backreference to named capture `n`, if it exists and is not an integer + // overridden by numbered capture. In practice, this does not overlap with + // numbered capture since XRegExp does not allow named capture to use a bare + // integer as the name. + // 3. If the name or number does not refer to an existing capturing group, it's + // an error. + var n = +bracketed; // Type-convert; drop leading zeros + + if (n <= args.length - 3) { + return args[n] || ''; + } // Groups with the same name is an error, else would need `lastIndexOf` + + + n = captureNames ? captureNames.indexOf(bracketed) : -1; + + if (n < 0) { + throw new SyntaxError("Backreference to undefined group ".concat($0)); + } + + return args[n + 1] || ''; + } // Else, special variable or numbered backreference without curly braces + + + if (dollarToken === '$') { + // $$ + return '$'; + } + + if (dollarToken === '&' || +dollarToken === 0) { + // $&, $0 (not followed by 1-9), $00 + return args[0]; + } + + if (dollarToken === '`') { + // $` (left context) + return args[args.length - 1].slice(0, args[args.length - 2]); + } + + if (dollarToken === "'") { + // $' (right context) + return args[args.length - 1].slice(args[args.length - 2] + args[0].length); + } // Else, numbered backreference without braces + + + dollarToken = +dollarToken; // Type-convert; drop leading zero + // XRegExp behavior for `$n` and `$nn`: + // - Backrefs end after 1 or 2 digits. Use `${..}` or `$<..>` for more digits. + // - `$1` is an error if no capturing groups. + // - `$10` is an error if less than 10 capturing groups. Use `${1}0` or `$<1>0` + // instead. + // - `$01` is `$1` if at least one capturing group, else it's an error. + // - `$0` (not followed by 1-9) and `$00` are the entire match. + // Native behavior, for comparison: + // - Backrefs end after 1 or 2 digits. Cannot reference capturing group 100+. + // - `$1` is a literal `$1` if no capturing groups. + // - `$10` is `$1` followed by a literal `0` if less than 10 capturing groups. + // - `$01` is `$1` if at least one capturing group, else it's a literal `$01`. + // - `$0` is a literal `$0`. + + if (!isNaN(dollarToken)) { + if (dollarToken > args.length - 3) { + throw new SyntaxError("Backreference to undefined group ".concat($0)); + } + + return args[dollarToken] || ''; + } // `$` followed by an unsupported char is an error, unlike native JS + + + throw new SyntaxError("Invalid token ".concat($0)); + } + }); + } + + if (isRegex) { + if (search.global) { + // Fixes IE, Safari bug (last tested IE 9, Safari 5.1) + search.lastIndex = 0; + } else { + // Fixes IE, Opera bug (last tested IE 9, Opera 11.6) + search.lastIndex = origLastIndex; + } + } + + return result; +}; +/** + * Fixes browser bugs in the native `String.prototype.split`. Use via `XRegExp.split`. + * + * @memberOf String + * @param {RegExp|String} separator Regex or string to use for separating the string. + * @param {Number} [limit] Maximum number of items to include in the result array. + * @returns {Array} Array of substrings. + */ + + +fixed.split = function (separator, limit) { + if (!XRegExp.isRegExp(separator)) { + // Browsers handle nonregex split correctly, so use the faster native method + return nativ.split.apply(this, arguments); + } + + var str = String(this); + var output = []; + var origLastIndex = separator.lastIndex; + var lastLastIndex = 0; + var lastLength; // Values for `limit`, per the spec: + // If undefined: pow(2,32) - 1 + // If 0, Infinity, or NaN: 0 + // If positive number: limit = floor(limit); if (limit >= pow(2,32)) limit -= pow(2,32); + // If negative number: pow(2,32) - floor(abs(limit)) + // If other: Type-convert, then use the above rules + // This line fails in very strange ways for some values of `limit` in Opera 10.5-10.63, unless + // Opera Dragonfly is open (go figure). It works in at least Opera 9.5-10.1 and 11+ + + limit = (limit === undefined ? -1 : limit) >>> 0; + XRegExp.forEach(str, separator, function (match) { + // This condition is not the same as `if (match[0].length)` + if (match.index + match[0].length > lastLastIndex) { + output.push(str.slice(lastLastIndex, match.index)); + + if (match.length > 1 && match.index < str.length) { + Array.prototype.push.apply(output, match.slice(1)); + } + + lastLength = match[0].length; + lastLastIndex = match.index + lastLength; + } + }); + + if (lastLastIndex === str.length) { + if (!nativ.test.call(separator, '') || lastLength) { + output.push(''); + } + } else { + output.push(str.slice(lastLastIndex)); + } + + separator.lastIndex = origLastIndex; + return output.length > limit ? output.slice(0, limit) : output; +}; // ==--------------------------== +// Built-in syntax/flag tokens +// ==--------------------------== + +/* + * Letter escapes that natively match literal characters: `\a`, `\A`, etc. These should be + * SyntaxErrors but are allowed in web reality. XRegExp makes them errors for cross-browser + * consistency and to reserve their syntax, but lets them be superseded by addons. + */ + + +XRegExp.addToken(/\\([ABCE-RTUVXYZaeg-mopqyz]|c(?![A-Za-z])|u(?![\dA-Fa-f]{4}|{[\dA-Fa-f]+})|x(?![\dA-Fa-f]{2}))/, function (match, scope) { + // \B is allowed in default scope only + if (match[1] === 'B' && scope === defaultScope) { + return match[0]; + } + + throw new SyntaxError("Invalid escape ".concat(match[0])); +}, { + scope: 'all', + leadChar: '\\' +}); +/* + * Unicode code point escape with curly braces: `\u{N..}`. `N..` is any one or more digit + * hexadecimal number from 0-10FFFF, and can include leading zeros. Requires the native ES6 `u` flag + * to support code points greater than U+FFFF. Avoids converting code points above U+FFFF to + * surrogate pairs (which could be done without flag `u`), since that could lead to broken behavior + * if you follow a `\u{N..}` token that references a code point above U+FFFF with a quantifier, or + * if you use the same in a character class. + */ + +XRegExp.addToken(/\\u{([\dA-Fa-f]+)}/, function (match, scope, flags) { + var code = dec(match[1]); + + if (code > 0x10FFFF) { + throw new SyntaxError("Invalid Unicode code point ".concat(match[0])); + } + + if (code <= 0xFFFF) { + // Converting to \uNNNN avoids needing to escape the literal character and keep it + // separate from preceding tokens + return "\\u".concat(pad4(hex(code))); + } // If `code` is between 0xFFFF and 0x10FFFF, require and defer to native handling + + + if (hasNativeU && flags.indexOf('u') !== -1) { + return match[0]; + } + + throw new SyntaxError('Cannot use Unicode code point above \\u{FFFF} without flag u'); +}, { + scope: 'all', + leadChar: '\\' +}); +/* + * Empty character class: `[]` or `[^]`. This fixes a critical cross-browser syntax inconsistency. + * Unless this is standardized (per the ES spec), regex syntax can't be accurately parsed because + * character class endings can't be determined. + */ + +XRegExp.addToken(/\[(\^?)\]/, // For cross-browser compatibility with ES3, convert [] to \b\B and [^] to [\s\S]. +// (?!) should work like \b\B, but is unreliable in some versions of Firefox + +/* eslint-disable no-confusing-arrow */ +function (match) { + return match[1] ? '[\\s\\S]' : '\\b\\B'; +}, +/* eslint-enable no-confusing-arrow */ +{ + leadChar: '[' +}); +/* + * Comment pattern: `(?# )`. Inline comments are an alternative to the line comments allowed in + * free-spacing mode (flag x). + */ + +XRegExp.addToken(/\(\?#[^)]*\)/, getContextualTokenSeparator, { + leadChar: '(' +}); +/* + * Whitespace and line comments, in free-spacing mode (aka extended mode, flag x) only. + */ + +XRegExp.addToken(/\s+|#[^\n]*\n?/, getContextualTokenSeparator, { + flag: 'x' +}); +/* + * Dot, in dotall mode (aka singleline mode, flag s) only. + */ + +XRegExp.addToken(/\./, function () { + return '[\\s\\S]'; +}, { + flag: 's', + leadChar: '.' +}); +/* + * Named backreference: `\k`. Backreference names can use the characters A-Z, a-z, 0-9, _, + * and $ only. Also allows numbered backreferences as `\k`. + */ + +XRegExp.addToken(/\\k<([\w$]+)>/, function (match) { + // Groups with the same name is an error, else would need `lastIndexOf` + var index = isNaN(match[1]) ? this.captureNames.indexOf(match[1]) + 1 : +match[1]; + var endIndex = match.index + match[0].length; + + if (!index || index > this.captureNames.length) { + throw new SyntaxError("Backreference to undefined group ".concat(match[0])); + } // Keep backreferences separate from subsequent literal numbers. This avoids e.g. + // inadvertedly changing `(?)\k1` to `()\11`. + + + return "\\".concat(index).concat(endIndex === match.input.length || isNaN(match.input[endIndex]) ? '' : '(?:)'); +}, { + leadChar: '\\' +}); +/* + * Numbered backreference or octal, plus any following digits: `\0`, `\11`, etc. Octals except `\0` + * not followed by 0-9 and backreferences to unopened capture groups throw an error. Other matches + * are returned unaltered. IE < 9 doesn't support backreferences above `\99` in regex syntax. + */ + +XRegExp.addToken(/\\(\d+)/, function (match, scope) { + if (!(scope === defaultScope && /^[1-9]/.test(match[1]) && +match[1] <= this.captureNames.length) && match[1] !== '0') { + throw new SyntaxError("Cannot use octal escape or backreference to undefined group ".concat(match[0])); + } + + return match[0]; +}, { + scope: 'all', + leadChar: '\\' +}); +/* + * Named capturing group; match the opening delimiter only: `(?`. Capture names can use the + * characters A-Z, a-z, 0-9, _, and $ only. Names can't be integers. Supports Python-style + * `(?P` as an alternate syntax to avoid issues in some older versions of Opera which natively + * supported the Python-style syntax. Otherwise, XRegExp might treat numbered backreferences to + * Python-style named capture as octals. + */ + +XRegExp.addToken(/\(\?P?<([\w$]+)>/, function (match) { + // Disallow bare integers as names because named backreferences are added to match arrays + // and therefore numeric properties may lead to incorrect lookups + if (!isNaN(match[1])) { + throw new SyntaxError("Cannot use integer as capture name ".concat(match[0])); + } + + if (!XRegExp.isInstalled('namespacing') && (match[1] === 'length' || match[1] === '__proto__')) { + throw new SyntaxError("Cannot use reserved word as capture name ".concat(match[0])); + } + + if (this.captureNames.indexOf(match[1]) !== -1) { + throw new SyntaxError("Cannot use same name for multiple groups ".concat(match[0])); + } + + this.captureNames.push(match[1]); + this.hasNamedCapture = true; + return '('; +}, { + leadChar: '(' +}); +/* + * Capturing group; match the opening parenthesis only. Required for support of named capturing + * groups. Also adds explicit capture mode (flag n). + */ + +XRegExp.addToken(/\((?!\?)/, function (match, scope, flags) { + if (flags.indexOf('n') !== -1) { + return '(?:'; + } + + this.captureNames.push(null); + return '('; +}, { + optionalFlags: 'n', + leadChar: '(' +}); +var _default = XRegExp; +exports.default = _default; +module.exports = exports["default"]; +}); + +unwrapExports(xregexp); + +var build = createCommonjsModule(function (module, exports) { +"use strict"; + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.default = void 0; + +/*! + * XRegExp.build 4.2.0 + * + * Steven Levithan (c) 2012-present MIT License + */ +var _default = function _default(XRegExp) { + var REGEX_DATA = 'xregexp'; + var subParts = /(\()(?!\?)|\\([1-9]\d*)|\\[\s\S]|\[(?:[^\\\]]|\\[\s\S])*\]/g; + var parts = XRegExp.union([/\({{([\w$]+)}}\)|{{([\w$]+)}}/, subParts], 'g', { + conjunction: 'or' + }); + /** + * Strips a leading `^` and trailing unescaped `$`, if both are present. + * + * @private + * @param {String} pattern Pattern to process. + * @returns {String} Pattern with edge anchors removed. + */ + + function deanchor(pattern) { + // Allow any number of empty noncapturing groups before/after anchors, because regexes + // built/generated by XRegExp sometimes include them + var leadingAnchor = /^(?:\(\?:\))*\^/; + var trailingAnchor = /\$(?:\(\?:\))*$/; + + if (leadingAnchor.test(pattern) && trailingAnchor.test(pattern) && // Ensure that the trailing `$` isn't escaped + trailingAnchor.test(pattern.replace(/\\[\s\S]/g, ''))) { + return pattern.replace(leadingAnchor, '').replace(trailingAnchor, ''); + } + + return pattern; + } + /** + * Converts the provided value to an XRegExp. Native RegExp flags are not preserved. + * + * @private + * @param {String|RegExp} value Value to convert. + * @param {Boolean} [addFlagX] Whether to apply the `x` flag in cases when `value` is not + * already a regex generated by XRegExp + * @returns {RegExp} XRegExp object with XRegExp syntax applied. + */ + + + function asXRegExp(value, addFlagX) { + var flags = addFlagX ? 'x' : ''; + return XRegExp.isRegExp(value) ? value[REGEX_DATA] && value[REGEX_DATA].captureNames ? // Don't recompile, to preserve capture names + value : // Recompile as XRegExp + XRegExp(value.source, flags) : // Compile string as XRegExp + XRegExp(value, flags); + } + + function interpolate(substitution) { + return substitution instanceof RegExp ? substitution : XRegExp.escape(substitution); + } + + function reduceToSubpatternsObject(subpatterns, interpolated, subpatternIndex) { + subpatterns["subpattern".concat(subpatternIndex)] = interpolated; + return subpatterns; + } + + function embedSubpatternAfter(raw, subpatternIndex, rawLiterals) { + var hasSubpattern = subpatternIndex < rawLiterals.length - 1; + return raw + (hasSubpattern ? "{{subpattern".concat(subpatternIndex, "}}") : ''); + } + /** + * Provides tagged template literals that create regexes with XRegExp syntax and flags. The + * provided pattern is handled as a raw string, so backslashes don't need to be escaped. + * + * Interpolation of strings and regexes shares the features of `XRegExp.build`. Interpolated + * patterns are treated as atomic units when quantified, interpolated strings have their special + * characters escaped, a leading `^` and trailing unescaped `$` are stripped from interpolated + * regexes if both are present, and any backreferences within an interpolated regex are + * rewritten to work within the overall pattern. + * + * @memberOf XRegExp + * @param {String} [flags] Any combination of XRegExp flags. + * @returns {Function} Handler for template literals that construct regexes with XRegExp syntax. + * @example + * + * const h12 = /1[0-2]|0?[1-9]/; + * const h24 = /2[0-3]|[01][0-9]/; + * const hours = XRegExp.tag('x')`${h12} : | ${h24}`; + * const minutes = /^[0-5][0-9]$/; + * // Note that explicitly naming the 'minutes' group is required for named backreferences + * const time = XRegExp.tag('x')`^ ${hours} (?${minutes}) $`; + * time.test('10:59'); // -> true + * XRegExp.exec('10:59', time).minutes; // -> '59' + */ + + + XRegExp.tag = function (flags) { + return function (literals) { + for (var _len = arguments.length, substitutions = new Array(_len > 1 ? _len - 1 : 0), _key = 1; _key < _len; _key++) { + substitutions[_key - 1] = arguments[_key]; + } + + var subpatterns = substitutions.map(interpolate).reduce(reduceToSubpatternsObject, {}); + var pattern = literals.raw.map(embedSubpatternAfter).join(''); + return XRegExp.build(pattern, subpatterns, flags); + }; + }; + /** + * Builds regexes using named subpatterns, for readability and pattern reuse. Backreferences in + * the outer pattern and provided subpatterns are automatically renumbered to work correctly. + * Native flags used by provided subpatterns are ignored in favor of the `flags` argument. + * + * @memberOf XRegExp + * @param {String} pattern XRegExp pattern using `{{name}}` for embedded subpatterns. Allows + * `({{name}})` as shorthand for `(?{{name}})`. Patterns cannot be embedded within + * character classes. + * @param {Object} subs Lookup object for named subpatterns. Values can be strings or regexes. A + * leading `^` and trailing unescaped `$` are stripped from subpatterns, if both are present. + * @param {String} [flags] Any combination of XRegExp flags. + * @returns {RegExp} Regex with interpolated subpatterns. + * @example + * + * const time = XRegExp.build('(?x)^ {{hours}} ({{minutes}}) $', { + * hours: XRegExp.build('{{h12}} : | {{h24}}', { + * h12: /1[0-2]|0?[1-9]/, + * h24: /2[0-3]|[01][0-9]/ + * }, 'x'), + * minutes: /^[0-5][0-9]$/ + * }); + * time.test('10:59'); // -> true + * XRegExp.exec('10:59', time).minutes; // -> '59' + */ + + + XRegExp.build = function (pattern, subs, flags) { + flags = flags || ''; // Used with `asXRegExp` calls for `pattern` and subpatterns in `subs`, to work around how + // some browsers convert `RegExp('\n')` to a regex that contains the literal characters `\` + // and `n`. See more details at . + + var addFlagX = flags.indexOf('x') !== -1; + var inlineFlags = /^\(\?([\w$]+)\)/.exec(pattern); // Add flags within a leading mode modifier to the overall pattern's flags + + if (inlineFlags) { + flags = XRegExp._clipDuplicates(flags + inlineFlags[1]); + } + + var data = {}; + + for (var p in subs) { + if (subs.hasOwnProperty(p)) { + // Passing to XRegExp enables extended syntax and ensures independent validity, + // lest an unescaped `(`, `)`, `[`, or trailing `\` breaks the `(?:)` wrapper. For + // subpatterns provided as native regexes, it dies on octals and adds the property + // used to hold extended regex instance data, for simplicity. + var sub = asXRegExp(subs[p], addFlagX); + data[p] = { + // Deanchoring allows embedding independently useful anchored regexes. If you + // really need to keep your anchors, double them (i.e., `^^...$$`). + pattern: deanchor(sub.source), + names: sub[REGEX_DATA].captureNames || [] + }; + } + } // Passing to XRegExp dies on octals and ensures the outer pattern is independently valid; + // helps keep this simple. Named captures will be put back. + + + var patternAsRegex = asXRegExp(pattern, addFlagX); // 'Caps' is short for 'captures' + + var numCaps = 0; + var numPriorCaps; + var numOuterCaps = 0; + var outerCapsMap = [0]; + var outerCapNames = patternAsRegex[REGEX_DATA].captureNames || []; + var output = patternAsRegex.source.replace(parts, function ($0, $1, $2, $3, $4) { + var subName = $1 || $2; + var capName; + var intro; + var localCapIndex; // Named subpattern + + if (subName) { + if (!data.hasOwnProperty(subName)) { + throw new ReferenceError("Undefined property ".concat($0)); + } // Named subpattern was wrapped in a capturing group + + + if ($1) { + capName = outerCapNames[numOuterCaps]; + outerCapsMap[++numOuterCaps] = ++numCaps; // If it's a named group, preserve the name. Otherwise, use the subpattern name + // as the capture name + + intro = "(?<".concat(capName || subName, ">"); + } else { + intro = '(?:'; + } + + numPriorCaps = numCaps; + var rewrittenSubpattern = data[subName].pattern.replace(subParts, function (match, paren, backref) { + // Capturing group + if (paren) { + capName = data[subName].names[numCaps - numPriorCaps]; + ++numCaps; // If the current capture has a name, preserve the name + + if (capName) { + return "(?<".concat(capName, ">"); + } // Backreference + + } else if (backref) { + localCapIndex = +backref - 1; // Rewrite the backreference + + return data[subName].names[localCapIndex] ? // Need to preserve the backreference name in case using flag `n` + "\\k<".concat(data[subName].names[localCapIndex], ">") : "\\".concat(+backref + numPriorCaps); + } + + return match; + }); + return "".concat(intro).concat(rewrittenSubpattern, ")"); + } // Capturing group + + + if ($3) { + capName = outerCapNames[numOuterCaps]; + outerCapsMap[++numOuterCaps] = ++numCaps; // If the current capture has a name, preserve the name + + if (capName) { + return "(?<".concat(capName, ">"); + } // Backreference + + } else if ($4) { + localCapIndex = +$4 - 1; // Rewrite the backreference + + return outerCapNames[localCapIndex] ? // Need to preserve the backreference name in case using flag `n` + "\\k<".concat(outerCapNames[localCapIndex], ">") : "\\".concat(outerCapsMap[+$4]); + } + + return $0; + }); + return XRegExp(output, flags); + }; +}; + +exports.default = _default; +module.exports = exports["default"]; +}); + +unwrapExports(build); + +var matchrecursive = createCommonjsModule(function (module, exports) { +"use strict"; + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.default = void 0; + +/*! + * XRegExp.matchRecursive 4.2.0 + * + * Steven Levithan (c) 2009-present MIT License + */ +var _default = function _default(XRegExp) { + /** + * Returns a match detail object composed of the provided values. + * + * @private + */ + function row(name, value, start, end) { + return { + name: name, + value: value, + start: start, + end: end + }; + } + /** + * Returns an array of match strings between outermost left and right delimiters, or an array of + * objects with detailed match parts and position data. An error is thrown if delimiters are + * unbalanced within the data. + * + * @memberOf XRegExp + * @param {String} str String to search. + * @param {String} left Left delimiter as an XRegExp pattern. + * @param {String} right Right delimiter as an XRegExp pattern. + * @param {String} [flags] Any native or XRegExp flags, used for the left and right delimiters. + * @param {Object} [options] Lets you specify `valueNames` and `escapeChar` options. + * @returns {Array} Array of matches, or an empty array. + * @example + * + * // Basic usage + * let str = '(t((e))s)t()(ing)'; + * XRegExp.matchRecursive(str, '\\(', '\\)', 'g'); + * // -> ['t((e))s', '', 'ing'] + * + * // Extended information mode with valueNames + * str = 'Here is
an
example'; + * XRegExp.matchRecursive(str, '', '', 'gi', { + * valueNames: ['between', 'left', 'match', 'right'] + * }); + * // -> [ + * // {name: 'between', value: 'Here is ', start: 0, end: 8}, + * // {name: 'left', value: '
', start: 8, end: 13}, + * // {name: 'match', value: '
an
', start: 13, end: 27}, + * // {name: 'right', value: '
', start: 27, end: 33}, + * // {name: 'between', value: ' example', start: 33, end: 41} + * // ] + * + * // Omitting unneeded parts with null valueNames, and using escapeChar + * str = '...{1}.\\{{function(x,y){return {y:x}}}'; + * XRegExp.matchRecursive(str, '{', '}', 'g', { + * valueNames: ['literal', null, 'value', null], + * escapeChar: '\\' + * }); + * // -> [ + * // {name: 'literal', value: '...', start: 0, end: 3}, + * // {name: 'value', value: '1', start: 4, end: 5}, + * // {name: 'literal', value: '.\\{', start: 6, end: 9}, + * // {name: 'value', value: 'function(x,y){return {y:x}}', start: 10, end: 37} + * // ] + * + * // Sticky mode via flag y + * str = '<1><<<2>>><3>4<5>'; + * XRegExp.matchRecursive(str, '<', '>', 'gy'); + * // -> ['1', '<<2>>', '3'] + */ + + + XRegExp.matchRecursive = function (str, left, right, flags, options) { + flags = flags || ''; + options = options || {}; + var global = flags.indexOf('g') !== -1; + var sticky = flags.indexOf('y') !== -1; // Flag `y` is controlled internally + + var basicFlags = flags.replace(/y/g, ''); + var _options = options, + escapeChar = _options.escapeChar; + var vN = options.valueNames; + var output = []; + var openTokens = 0; + var delimStart = 0; + var delimEnd = 0; + var lastOuterEnd = 0; + var outerStart; + var innerStart; + var leftMatch; + var rightMatch; + var esc; + left = XRegExp(left, basicFlags); + right = XRegExp(right, basicFlags); + + if (escapeChar) { + if (escapeChar.length > 1) { + throw new Error('Cannot use more than one escape character'); + } + + escapeChar = XRegExp.escape(escapeChar); // Example of concatenated `esc` regex: + // `escapeChar`: '%' + // `left`: '<' + // `right`: '>' + // Regex is: /(?:%[\S\s]|(?:(?!<|>)[^%])+)+/ + + esc = new RegExp("(?:".concat(escapeChar, "[\\S\\s]|(?:(?!").concat( // Using `XRegExp.union` safely rewrites backreferences in `left` and `right`. + // Intentionally not passing `basicFlags` to `XRegExp.union` since any syntax + // transformation resulting from those flags was already applied to `left` and + // `right` when they were passed through the XRegExp constructor above. + XRegExp.union([left, right], '', { + conjunction: 'or' + }).source, ")[^").concat(escapeChar, "])+)+"), // Flags `gy` not needed here + flags.replace(/[^imu]+/g, '')); + } + + while (true) { + // If using an escape character, advance to the delimiter's next starting position, + // skipping any escaped characters in between + if (escapeChar) { + delimEnd += (XRegExp.exec(str, esc, delimEnd, 'sticky') || [''])[0].length; + } + + leftMatch = XRegExp.exec(str, left, delimEnd); + rightMatch = XRegExp.exec(str, right, delimEnd); // Keep the leftmost match only + + if (leftMatch && rightMatch) { + if (leftMatch.index <= rightMatch.index) { + rightMatch = null; + } else { + leftMatch = null; + } + } // Paths (LM: leftMatch, RM: rightMatch, OT: openTokens): + // LM | RM | OT | Result + // 1 | 0 | 1 | loop + // 1 | 0 | 0 | loop + // 0 | 1 | 1 | loop + // 0 | 1 | 0 | throw + // 0 | 0 | 1 | throw + // 0 | 0 | 0 | break + // The paths above don't include the sticky mode special case. The loop ends after the + // first completed match if not `global`. + + + if (leftMatch || rightMatch) { + delimStart = (leftMatch || rightMatch).index; + delimEnd = delimStart + (leftMatch || rightMatch)[0].length; + } else if (!openTokens) { + break; + } + + if (sticky && !openTokens && delimStart > lastOuterEnd) { + break; + } + + if (leftMatch) { + if (!openTokens) { + outerStart = delimStart; + innerStart = delimEnd; + } + + ++openTokens; + } else if (rightMatch && openTokens) { + if (! --openTokens) { + if (vN) { + if (vN[0] && outerStart > lastOuterEnd) { + output.push(row(vN[0], str.slice(lastOuterEnd, outerStart), lastOuterEnd, outerStart)); + } + + if (vN[1]) { + output.push(row(vN[1], str.slice(outerStart, innerStart), outerStart, innerStart)); + } + + if (vN[2]) { + output.push(row(vN[2], str.slice(innerStart, delimStart), innerStart, delimStart)); + } + + if (vN[3]) { + output.push(row(vN[3], str.slice(delimStart, delimEnd), delimStart, delimEnd)); + } + } else { + output.push(str.slice(innerStart, delimStart)); + } + + lastOuterEnd = delimEnd; + + if (!global) { + break; + } + } + } else { + throw new Error('Unbalanced delimiter found in string'); + } // If the delimiter matched an empty string, avoid an infinite loop + + + if (delimStart === delimEnd) { + ++delimEnd; + } + } + + if (global && !sticky && vN && vN[0] && str.length > lastOuterEnd) { + output.push(row(vN[0], str.slice(lastOuterEnd), lastOuterEnd, str.length)); + } + + return output; + }; +}; + +exports.default = _default; +module.exports = exports["default"]; +}); + +unwrapExports(matchrecursive); + +var unicodeBase = createCommonjsModule(function (module, exports) { +"use strict"; + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.default = void 0; + +/*! + * XRegExp Unicode Base 4.2.0 + * + * Steven Levithan (c) 2008-present MIT License + */ +var _default = function _default(XRegExp) { + /** + * Adds base support for Unicode matching: + * - Adds syntax `\p{..}` for matching Unicode tokens. Tokens can be inverted using `\P{..}` or + * `\p{^..}`. Token names ignore case, spaces, hyphens, and underscores. You can omit the + * braces for token names that are a single letter (e.g. `\pL` or `PL`). + * - Adds flag A (astral), which enables 21-bit Unicode support. + * - Adds the `XRegExp.addUnicodeData` method used by other addons to provide character data. + * + * Unicode Base relies on externally provided Unicode character data. Official addons are + * available to provide data for Unicode categories, scripts, blocks, and properties. + * + * @requires XRegExp + */ + // ==--------------------------== + // Private stuff + // ==--------------------------== + // Storage for Unicode data + var unicode = {}; // Reuse utils + + var dec = XRegExp._dec; + var hex = XRegExp._hex; + var pad4 = XRegExp._pad4; // Generates a token lookup name: lowercase, with hyphens, spaces, and underscores removed + + function normalize(name) { + return name.replace(/[- _]+/g, '').toLowerCase(); + } // Gets the decimal code of a literal code unit, \xHH, \uHHHH, or a backslash-escaped literal + + + function charCode(chr) { + var esc = /^\\[xu](.+)/.exec(chr); + return esc ? dec(esc[1]) : chr.charCodeAt(chr[0] === '\\' ? 1 : 0); + } // Inverts a list of ordered BMP characters and ranges + + + function invertBmp(range) { + var output = ''; + var lastEnd = -1; + XRegExp.forEach(range, /(\\x..|\\u....|\\?[\s\S])(?:-(\\x..|\\u....|\\?[\s\S]))?/, function (m) { + var start = charCode(m[1]); + + if (start > lastEnd + 1) { + output += "\\u".concat(pad4(hex(lastEnd + 1))); + + if (start > lastEnd + 2) { + output += "-\\u".concat(pad4(hex(start - 1))); + } + } + + lastEnd = charCode(m[2] || m[1]); + }); + + if (lastEnd < 0xFFFF) { + output += "\\u".concat(pad4(hex(lastEnd + 1))); + + if (lastEnd < 0xFFFE) { + output += '-\\uFFFF'; + } + } + + return output; + } // Generates an inverted BMP range on first use + + + function cacheInvertedBmp(slug) { + var prop = 'b!'; + return unicode[slug][prop] || (unicode[slug][prop] = invertBmp(unicode[slug].bmp)); + } // Combines and optionally negates BMP and astral data + + + function buildAstral(slug, isNegated) { + var item = unicode[slug]; + var combined = ''; + + if (item.bmp && !item.isBmpLast) { + combined = "[".concat(item.bmp, "]").concat(item.astral ? '|' : ''); + } + + if (item.astral) { + combined += item.astral; + } + + if (item.isBmpLast && item.bmp) { + combined += "".concat(item.astral ? '|' : '', "[").concat(item.bmp, "]"); + } // Astral Unicode tokens always match a code point, never a code unit + + + return isNegated ? "(?:(?!".concat(combined, ")(?:[\uD800-\uDBFF][\uDC00-\uDFFF]|[\0-\uFFFF]))") : "(?:".concat(combined, ")"); + } // Builds a complete astral pattern on first use + + + function cacheAstral(slug, isNegated) { + var prop = isNegated ? 'a!' : 'a='; + return unicode[slug][prop] || (unicode[slug][prop] = buildAstral(slug, isNegated)); + } // ==--------------------------== + // Core functionality + // ==--------------------------== + + /* + * Add astral mode (flag A) and Unicode token syntax: `\p{..}`, `\P{..}`, `\p{^..}`, `\pC`. + */ + + + XRegExp.addToken( // Use `*` instead of `+` to avoid capturing `^` as the token name in `\p{^}` + /\\([pP])(?:{(\^?)([^}]*)}|([A-Za-z]))/, function (match, scope, flags) { + var ERR_DOUBLE_NEG = 'Invalid double negation '; + var ERR_UNKNOWN_NAME = 'Unknown Unicode token '; + var ERR_UNKNOWN_REF = 'Unicode token missing data '; + var ERR_ASTRAL_ONLY = 'Astral mode required for Unicode token '; + var ERR_ASTRAL_IN_CLASS = 'Astral mode does not support Unicode tokens within character classes'; // Negated via \P{..} or \p{^..} + + var isNegated = match[1] === 'P' || !!match[2]; // Switch from BMP (0-FFFF) to astral (0-10FFFF) mode via flag A + + var isAstralMode = flags.indexOf('A') !== -1; // Token lookup name. Check `[4]` first to avoid passing `undefined` via `\p{}` + + var slug = normalize(match[4] || match[3]); // Token data object + + var item = unicode[slug]; + + if (match[1] === 'P' && match[2]) { + throw new SyntaxError(ERR_DOUBLE_NEG + match[0]); + } + + if (!unicode.hasOwnProperty(slug)) { + throw new SyntaxError(ERR_UNKNOWN_NAME + match[0]); + } // Switch to the negated form of the referenced Unicode token + + + if (item.inverseOf) { + slug = normalize(item.inverseOf); + + if (!unicode.hasOwnProperty(slug)) { + throw new ReferenceError("".concat(ERR_UNKNOWN_REF + match[0], " -> ").concat(item.inverseOf)); + } + + item = unicode[slug]; + isNegated = !isNegated; + } + + if (!(item.bmp || isAstralMode)) { + throw new SyntaxError(ERR_ASTRAL_ONLY + match[0]); + } + + if (isAstralMode) { + if (scope === 'class') { + throw new SyntaxError(ERR_ASTRAL_IN_CLASS); + } + + return cacheAstral(slug, isNegated); + } + + return scope === 'class' ? isNegated ? cacheInvertedBmp(slug) : item.bmp : "".concat((isNegated ? '[^' : '[') + item.bmp, "]"); + }, { + scope: 'all', + optionalFlags: 'A', + leadChar: '\\' + }); + /** + * Adds to the list of Unicode tokens that XRegExp regexes can match via `\p` or `\P`. + * + * @memberOf XRegExp + * @param {Array} data Objects with named character ranges. Each object may have properties + * `name`, `alias`, `isBmpLast`, `inverseOf`, `bmp`, and `astral`. All but `name` are + * optional, although one of `bmp` or `astral` is required (unless `inverseOf` is set). If + * `astral` is absent, the `bmp` data is used for BMP and astral modes. If `bmp` is absent, + * the name errors in BMP mode but works in astral mode. If both `bmp` and `astral` are + * provided, the `bmp` data only is used in BMP mode, and the combination of `bmp` and + * `astral` data is used in astral mode. `isBmpLast` is needed when a token matches orphan + * high surrogates *and* uses surrogate pairs to match astral code points. The `bmp` and + * `astral` data should be a combination of literal characters and `\xHH` or `\uHHHH` escape + * sequences, with hyphens to create ranges. Any regex metacharacters in the data should be + * escaped, apart from range-creating hyphens. The `astral` data can additionally use + * character classes and alternation, and should use surrogate pairs to represent astral code + * points. `inverseOf` can be used to avoid duplicating character data if a Unicode token is + * defined as the exact inverse of another token. + * @example + * + * // Basic use + * XRegExp.addUnicodeData([{ + * name: 'XDigit', + * alias: 'Hexadecimal', + * bmp: '0-9A-Fa-f' + * }]); + * XRegExp('\\p{XDigit}:\\p{Hexadecimal}+').test('0:3D'); // -> true + */ + + XRegExp.addUnicodeData = function (data) { + var ERR_NO_NAME = 'Unicode token requires name'; + var ERR_NO_DATA = 'Unicode token has no character data '; + var _iteratorNormalCompletion = true; + var _didIteratorError = false; + var _iteratorError = undefined; + + try { + for (var _iterator = data[Symbol.iterator](), _step; !(_iteratorNormalCompletion = (_step = _iterator.next()).done); _iteratorNormalCompletion = true) { + var item = _step.value; + + if (!item.name) { + throw new Error(ERR_NO_NAME); + } + + if (!(item.inverseOf || item.bmp || item.astral)) { + throw new Error(ERR_NO_DATA + item.name); + } + + unicode[normalize(item.name)] = item; + + if (item.alias) { + unicode[normalize(item.alias)] = item; + } + } // Reset the pattern cache used by the `XRegExp` constructor, since the same pattern and + // flags might now produce different results + + } catch (err) { + _didIteratorError = true; + _iteratorError = err; + } finally { + try { + if (!_iteratorNormalCompletion && _iterator.return != null) { + _iterator.return(); + } + } finally { + if (_didIteratorError) { + throw _iteratorError; + } + } + } + + XRegExp.cache.flush('patterns'); + }; + /** + * @ignore + * + * Return a reference to the internal Unicode definition structure for the given Unicode + * Property if the given name is a legal Unicode Property for use in XRegExp `\p` or `\P` regex + * constructs. + * + * @memberOf XRegExp + * @param {String} name Name by which the Unicode Property may be recognized (case-insensitive), + * e.g. `'N'` or `'Number'`. The given name is matched against all registered Unicode + * Properties and Property Aliases. + * @returns {Object} Reference to definition structure when the name matches a Unicode Property. + * + * @note + * For more info on Unicode Properties, see also http://unicode.org/reports/tr18/#Categories. + * + * @note + * This method is *not* part of the officially documented API and may change or be removed in + * the future. It is meant for userland code that wishes to reuse the (large) internal Unicode + * structures set up by XRegExp. + */ + + + XRegExp._getUnicodeProperty = function (name) { + var slug = normalize(name); + return unicode[slug]; + }; +}; + +exports.default = _default; +module.exports = exports["default"]; +}); + +unwrapExports(unicodeBase); + +var blocks = [ + { + 'name': 'InAdlam', + 'astral': '\uD83A[\uDD00-\uDD5F]' + }, + { + 'name': 'InAegean_Numbers', + 'astral': '\uD800[\uDD00-\uDD3F]' + }, + { + 'name': 'InAhom', + 'astral': '\uD805[\uDF00-\uDF3F]' + }, + { + 'name': 'InAlchemical_Symbols', + 'astral': '\uD83D[\uDF00-\uDF7F]' + }, + { + 'name': 'InAlphabetic_Presentation_Forms', + 'bmp': '\uFB00-\uFB4F' + }, + { + 'name': 'InAnatolian_Hieroglyphs', + 'astral': '\uD811[\uDC00-\uDE7F]' + }, + { + 'name': 'InAncient_Greek_Musical_Notation', + 'astral': '\uD834[\uDE00-\uDE4F]' + }, + { + 'name': 'InAncient_Greek_Numbers', + 'astral': '\uD800[\uDD40-\uDD8F]' + }, + { + 'name': 'InAncient_Symbols', + 'astral': '\uD800[\uDD90-\uDDCF]' + }, + { + 'name': 'InArabic', + 'bmp': '\u0600-\u06FF' + }, + { + 'name': 'InArabic_Extended_A', + 'bmp': '\u08A0-\u08FF' + }, + { + 'name': 'InArabic_Mathematical_Alphabetic_Symbols', + 'astral': '\uD83B[\uDE00-\uDEFF]' + }, + { + 'name': 'InArabic_Presentation_Forms_A', + 'bmp': '\uFB50-\uFDFF' + }, + { + 'name': 'InArabic_Presentation_Forms_B', + 'bmp': '\uFE70-\uFEFF' + }, + { + 'name': 'InArabic_Supplement', + 'bmp': '\u0750-\u077F' + }, + { + 'name': 'InArmenian', + 'bmp': '\u0530-\u058F' + }, + { + 'name': 'InArrows', + 'bmp': '\u2190-\u21FF' + }, + { + 'name': 'InAvestan', + 'astral': '\uD802[\uDF00-\uDF3F]' + }, + { + 'name': 'InBalinese', + 'bmp': '\u1B00-\u1B7F' + }, + { + 'name': 'InBamum', + 'bmp': '\uA6A0-\uA6FF' + }, + { + 'name': 'InBamum_Supplement', + 'astral': '\uD81A[\uDC00-\uDE3F]' + }, + { + 'name': 'InBasic_Latin', + 'bmp': '\0-\x7F' + }, + { + 'name': 'InBassa_Vah', + 'astral': '\uD81A[\uDED0-\uDEFF]' + }, + { + 'name': 'InBatak', + 'bmp': '\u1BC0-\u1BFF' + }, + { + 'name': 'InBengali', + 'bmp': '\u0980-\u09FF' + }, + { + 'name': 'InBhaiksuki', + 'astral': '\uD807[\uDC00-\uDC6F]' + }, + { + 'name': 'InBlock_Elements', + 'bmp': '\u2580-\u259F' + }, + { + 'name': 'InBopomofo', + 'bmp': '\u3100-\u312F' + }, + { + 'name': 'InBopomofo_Extended', + 'bmp': '\u31A0-\u31BF' + }, + { + 'name': 'InBox_Drawing', + 'bmp': '\u2500-\u257F' + }, + { + 'name': 'InBrahmi', + 'astral': '\uD804[\uDC00-\uDC7F]' + }, + { + 'name': 'InBraille_Patterns', + 'bmp': '\u2800-\u28FF' + }, + { + 'name': 'InBuginese', + 'bmp': '\u1A00-\u1A1F' + }, + { + 'name': 'InBuhid', + 'bmp': '\u1740-\u175F' + }, + { + 'name': 'InByzantine_Musical_Symbols', + 'astral': '\uD834[\uDC00-\uDCFF]' + }, + { + 'name': 'InCJK_Compatibility', + 'bmp': '\u3300-\u33FF' + }, + { + 'name': 'InCJK_Compatibility_Forms', + 'bmp': '\uFE30-\uFE4F' + }, + { + 'name': 'InCJK_Compatibility_Ideographs', + 'bmp': '\uF900-\uFAFF' + }, + { + 'name': 'InCJK_Compatibility_Ideographs_Supplement', + 'astral': '\uD87E[\uDC00-\uDE1F]' + }, + { + 'name': 'InCJK_Radicals_Supplement', + 'bmp': '\u2E80-\u2EFF' + }, + { + 'name': 'InCJK_Strokes', + 'bmp': '\u31C0-\u31EF' + }, + { + 'name': 'InCJK_Symbols_And_Punctuation', + 'bmp': '\u3000-\u303F' + }, + { + 'name': 'InCJK_Unified_Ideographs', + 'bmp': '\u4E00-\u9FFF' + }, + { + 'name': 'InCJK_Unified_Ideographs_Extension_A', + 'bmp': '\u3400-\u4DBF' + }, + { + 'name': 'InCJK_Unified_Ideographs_Extension_B', + 'astral': '[\uD840-\uD868][\uDC00-\uDFFF]|\uD869[\uDC00-\uDEDF]' + }, + { + 'name': 'InCJK_Unified_Ideographs_Extension_C', + 'astral': '\uD869[\uDF00-\uDFFF]|[\uD86A-\uD86C][\uDC00-\uDFFF]|\uD86D[\uDC00-\uDF3F]' + }, + { + 'name': 'InCJK_Unified_Ideographs_Extension_D', + 'astral': '\uD86D[\uDF40-\uDFFF]|\uD86E[\uDC00-\uDC1F]' + }, + { + 'name': 'InCJK_Unified_Ideographs_Extension_E', + 'astral': '\uD86E[\uDC20-\uDFFF]|[\uD86F-\uD872][\uDC00-\uDFFF]|\uD873[\uDC00-\uDEAF]' + }, + { + 'name': 'InCJK_Unified_Ideographs_Extension_F', + 'astral': '\uD873[\uDEB0-\uDFFF]|[\uD874-\uD879][\uDC00-\uDFFF]|\uD87A[\uDC00-\uDFEF]' + }, + { + 'name': 'InCarian', + 'astral': '\uD800[\uDEA0-\uDEDF]' + }, + { + 'name': 'InCaucasian_Albanian', + 'astral': '\uD801[\uDD30-\uDD6F]' + }, + { + 'name': 'InChakma', + 'astral': '\uD804[\uDD00-\uDD4F]' + }, + { + 'name': 'InCham', + 'bmp': '\uAA00-\uAA5F' + }, + { + 'name': 'InCherokee', + 'bmp': '\u13A0-\u13FF' + }, + { + 'name': 'InCherokee_Supplement', + 'bmp': '\uAB70-\uABBF' + }, + { + 'name': 'InChess_Symbols', + 'astral': '\uD83E[\uDE00-\uDE6F]' + }, + { + 'name': 'InCombining_Diacritical_Marks', + 'bmp': '\u0300-\u036F' + }, + { + 'name': 'InCombining_Diacritical_Marks_Extended', + 'bmp': '\u1AB0-\u1AFF' + }, + { + 'name': 'InCombining_Diacritical_Marks_For_Symbols', + 'bmp': '\u20D0-\u20FF' + }, + { + 'name': 'InCombining_Diacritical_Marks_Supplement', + 'bmp': '\u1DC0-\u1DFF' + }, + { + 'name': 'InCombining_Half_Marks', + 'bmp': '\uFE20-\uFE2F' + }, + { + 'name': 'InCommon_Indic_Number_Forms', + 'bmp': '\uA830-\uA83F' + }, + { + 'name': 'InControl_Pictures', + 'bmp': '\u2400-\u243F' + }, + { + 'name': 'InCoptic', + 'bmp': '\u2C80-\u2CFF' + }, + { + 'name': 'InCoptic_Epact_Numbers', + 'astral': '\uD800[\uDEE0-\uDEFF]' + }, + { + 'name': 'InCounting_Rod_Numerals', + 'astral': '\uD834[\uDF60-\uDF7F]' + }, + { + 'name': 'InCuneiform', + 'astral': '\uD808[\uDC00-\uDFFF]' + }, + { + 'name': 'InCuneiform_Numbers_And_Punctuation', + 'astral': '\uD809[\uDC00-\uDC7F]' + }, + { + 'name': 'InCurrency_Symbols', + 'bmp': '\u20A0-\u20CF' + }, + { + 'name': 'InCypriot_Syllabary', + 'astral': '\uD802[\uDC00-\uDC3F]' + }, + { + 'name': 'InCyrillic', + 'bmp': '\u0400-\u04FF' + }, + { + 'name': 'InCyrillic_Extended_A', + 'bmp': '\u2DE0-\u2DFF' + }, + { + 'name': 'InCyrillic_Extended_B', + 'bmp': '\uA640-\uA69F' + }, + { + 'name': 'InCyrillic_Extended_C', + 'bmp': '\u1C80-\u1C8F' + }, + { + 'name': 'InCyrillic_Supplement', + 'bmp': '\u0500-\u052F' + }, + { + 'name': 'InDeseret', + 'astral': '\uD801[\uDC00-\uDC4F]' + }, + { + 'name': 'InDevanagari', + 'bmp': '\u0900-\u097F' + }, + { + 'name': 'InDevanagari_Extended', + 'bmp': '\uA8E0-\uA8FF' + }, + { + 'name': 'InDingbats', + 'bmp': '\u2700-\u27BF' + }, + { + 'name': 'InDogra', + 'astral': '\uD806[\uDC00-\uDC4F]' + }, + { + 'name': 'InDomino_Tiles', + 'astral': '\uD83C[\uDC30-\uDC9F]' + }, + { + 'name': 'InDuployan', + 'astral': '\uD82F[\uDC00-\uDC9F]' + }, + { + 'name': 'InEarly_Dynastic_Cuneiform', + 'astral': '\uD809[\uDC80-\uDD4F]' + }, + { + 'name': 'InEgyptian_Hieroglyphs', + 'astral': '\uD80C[\uDC00-\uDFFF]|\uD80D[\uDC00-\uDC2F]' + }, + { + 'name': 'InElbasan', + 'astral': '\uD801[\uDD00-\uDD2F]' + }, + { + 'name': 'InEmoticons', + 'astral': '\uD83D[\uDE00-\uDE4F]' + }, + { + 'name': 'InEnclosed_Alphanumeric_Supplement', + 'astral': '\uD83C[\uDD00-\uDDFF]' + }, + { + 'name': 'InEnclosed_Alphanumerics', + 'bmp': '\u2460-\u24FF' + }, + { + 'name': 'InEnclosed_CJK_Letters_And_Months', + 'bmp': '\u3200-\u32FF' + }, + { + 'name': 'InEnclosed_Ideographic_Supplement', + 'astral': '\uD83C[\uDE00-\uDEFF]' + }, + { + 'name': 'InEthiopic', + 'bmp': '\u1200-\u137F' + }, + { + 'name': 'InEthiopic_Extended', + 'bmp': '\u2D80-\u2DDF' + }, + { + 'name': 'InEthiopic_Extended_A', + 'bmp': '\uAB00-\uAB2F' + }, + { + 'name': 'InEthiopic_Supplement', + 'bmp': '\u1380-\u139F' + }, + { + 'name': 'InGeneral_Punctuation', + 'bmp': '\u2000-\u206F' + }, + { + 'name': 'InGeometric_Shapes', + 'bmp': '\u25A0-\u25FF' + }, + { + 'name': 'InGeometric_Shapes_Extended', + 'astral': '\uD83D[\uDF80-\uDFFF]' + }, + { + 'name': 'InGeorgian', + 'bmp': '\u10A0-\u10FF' + }, + { + 'name': 'InGeorgian_Extended', + 'bmp': '\u1C90-\u1CBF' + }, + { + 'name': 'InGeorgian_Supplement', + 'bmp': '\u2D00-\u2D2F' + }, + { + 'name': 'InGlagolitic', + 'bmp': '\u2C00-\u2C5F' + }, + { + 'name': 'InGlagolitic_Supplement', + 'astral': '\uD838[\uDC00-\uDC2F]' + }, + { + 'name': 'InGothic', + 'astral': '\uD800[\uDF30-\uDF4F]' + }, + { + 'name': 'InGrantha', + 'astral': '\uD804[\uDF00-\uDF7F]' + }, + { + 'name': 'InGreek_And_Coptic', + 'bmp': '\u0370-\u03FF' + }, + { + 'name': 'InGreek_Extended', + 'bmp': '\u1F00-\u1FFF' + }, + { + 'name': 'InGujarati', + 'bmp': '\u0A80-\u0AFF' + }, + { + 'name': 'InGunjala_Gondi', + 'astral': '\uD807[\uDD60-\uDDAF]' + }, + { + 'name': 'InGurmukhi', + 'bmp': '\u0A00-\u0A7F' + }, + { + 'name': 'InHalfwidth_And_Fullwidth_Forms', + 'bmp': '\uFF00-\uFFEF' + }, + { + 'name': 'InHangul_Compatibility_Jamo', + 'bmp': '\u3130-\u318F' + }, + { + 'name': 'InHangul_Jamo', + 'bmp': '\u1100-\u11FF' + }, + { + 'name': 'InHangul_Jamo_Extended_A', + 'bmp': '\uA960-\uA97F' + }, + { + 'name': 'InHangul_Jamo_Extended_B', + 'bmp': '\uD7B0-\uD7FF' + }, + { + 'name': 'InHangul_Syllables', + 'bmp': '\uAC00-\uD7AF' + }, + { + 'name': 'InHanifi_Rohingya', + 'astral': '\uD803[\uDD00-\uDD3F]' + }, + { + 'name': 'InHanunoo', + 'bmp': '\u1720-\u173F' + }, + { + 'name': 'InHatran', + 'astral': '\uD802[\uDCE0-\uDCFF]' + }, + { + 'name': 'InHebrew', + 'bmp': '\u0590-\u05FF' + }, + { + 'name': 'InHigh_Private_Use_Surrogates', + 'bmp': '\uDB80-\uDBFF' + }, + { + 'name': 'InHigh_Surrogates', + 'bmp': '\uD800-\uDB7F' + }, + { + 'name': 'InHiragana', + 'bmp': '\u3040-\u309F' + }, + { + 'name': 'InIPA_Extensions', + 'bmp': '\u0250-\u02AF' + }, + { + 'name': 'InIdeographic_Description_Characters', + 'bmp': '\u2FF0-\u2FFF' + }, + { + 'name': 'InIdeographic_Symbols_And_Punctuation', + 'astral': '\uD81B[\uDFE0-\uDFFF]' + }, + { + 'name': 'InImperial_Aramaic', + 'astral': '\uD802[\uDC40-\uDC5F]' + }, + { + 'name': 'InIndic_Siyaq_Numbers', + 'astral': '\uD83B[\uDC70-\uDCBF]' + }, + { + 'name': 'InInscriptional_Pahlavi', + 'astral': '\uD802[\uDF60-\uDF7F]' + }, + { + 'name': 'InInscriptional_Parthian', + 'astral': '\uD802[\uDF40-\uDF5F]' + }, + { + 'name': 'InJavanese', + 'bmp': '\uA980-\uA9DF' + }, + { + 'name': 'InKaithi', + 'astral': '\uD804[\uDC80-\uDCCF]' + }, + { + 'name': 'InKana_Extended_A', + 'astral': '\uD82C[\uDD00-\uDD2F]' + }, + { + 'name': 'InKana_Supplement', + 'astral': '\uD82C[\uDC00-\uDCFF]' + }, + { + 'name': 'InKanbun', + 'bmp': '\u3190-\u319F' + }, + { + 'name': 'InKangxi_Radicals', + 'bmp': '\u2F00-\u2FDF' + }, + { + 'name': 'InKannada', + 'bmp': '\u0C80-\u0CFF' + }, + { + 'name': 'InKatakana', + 'bmp': '\u30A0-\u30FF' + }, + { + 'name': 'InKatakana_Phonetic_Extensions', + 'bmp': '\u31F0-\u31FF' + }, + { + 'name': 'InKayah_Li', + 'bmp': '\uA900-\uA92F' + }, + { + 'name': 'InKharoshthi', + 'astral': '\uD802[\uDE00-\uDE5F]' + }, + { + 'name': 'InKhmer', + 'bmp': '\u1780-\u17FF' + }, + { + 'name': 'InKhmer_Symbols', + 'bmp': '\u19E0-\u19FF' + }, + { + 'name': 'InKhojki', + 'astral': '\uD804[\uDE00-\uDE4F]' + }, + { + 'name': 'InKhudawadi', + 'astral': '\uD804[\uDEB0-\uDEFF]' + }, + { + 'name': 'InLao', + 'bmp': '\u0E80-\u0EFF' + }, + { + 'name': 'InLatin_1_Supplement', + 'bmp': '\x80-\xFF' + }, + { + 'name': 'InLatin_Extended_A', + 'bmp': '\u0100-\u017F' + }, + { + 'name': 'InLatin_Extended_Additional', + 'bmp': '\u1E00-\u1EFF' + }, + { + 'name': 'InLatin_Extended_B', + 'bmp': '\u0180-\u024F' + }, + { + 'name': 'InLatin_Extended_C', + 'bmp': '\u2C60-\u2C7F' + }, + { + 'name': 'InLatin_Extended_D', + 'bmp': '\uA720-\uA7FF' + }, + { + 'name': 'InLatin_Extended_E', + 'bmp': '\uAB30-\uAB6F' + }, + { + 'name': 'InLepcha', + 'bmp': '\u1C00-\u1C4F' + }, + { + 'name': 'InLetterlike_Symbols', + 'bmp': '\u2100-\u214F' + }, + { + 'name': 'InLimbu', + 'bmp': '\u1900-\u194F' + }, + { + 'name': 'InLinear_A', + 'astral': '\uD801[\uDE00-\uDF7F]' + }, + { + 'name': 'InLinear_B_Ideograms', + 'astral': '\uD800[\uDC80-\uDCFF]' + }, + { + 'name': 'InLinear_B_Syllabary', + 'astral': '\uD800[\uDC00-\uDC7F]' + }, + { + 'name': 'InLisu', + 'bmp': '\uA4D0-\uA4FF' + }, + { + 'name': 'InLow_Surrogates', + 'bmp': '\uDC00-\uDFFF' + }, + { + 'name': 'InLycian', + 'astral': '\uD800[\uDE80-\uDE9F]' + }, + { + 'name': 'InLydian', + 'astral': '\uD802[\uDD20-\uDD3F]' + }, + { + 'name': 'InMahajani', + 'astral': '\uD804[\uDD50-\uDD7F]' + }, + { + 'name': 'InMahjong_Tiles', + 'astral': '\uD83C[\uDC00-\uDC2F]' + }, + { + 'name': 'InMakasar', + 'astral': '\uD807[\uDEE0-\uDEFF]' + }, + { + 'name': 'InMalayalam', + 'bmp': '\u0D00-\u0D7F' + }, + { + 'name': 'InMandaic', + 'bmp': '\u0840-\u085F' + }, + { + 'name': 'InManichaean', + 'astral': '\uD802[\uDEC0-\uDEFF]' + }, + { + 'name': 'InMarchen', + 'astral': '\uD807[\uDC70-\uDCBF]' + }, + { + 'name': 'InMasaram_Gondi', + 'astral': '\uD807[\uDD00-\uDD5F]' + }, + { + 'name': 'InMathematical_Alphanumeric_Symbols', + 'astral': '\uD835[\uDC00-\uDFFF]' + }, + { + 'name': 'InMathematical_Operators', + 'bmp': '\u2200-\u22FF' + }, + { + 'name': 'InMayan_Numerals', + 'astral': '\uD834[\uDEE0-\uDEFF]' + }, + { + 'name': 'InMedefaidrin', + 'astral': '\uD81B[\uDE40-\uDE9F]' + }, + { + 'name': 'InMeetei_Mayek', + 'bmp': '\uABC0-\uABFF' + }, + { + 'name': 'InMeetei_Mayek_Extensions', + 'bmp': '\uAAE0-\uAAFF' + }, + { + 'name': 'InMende_Kikakui', + 'astral': '\uD83A[\uDC00-\uDCDF]' + }, + { + 'name': 'InMeroitic_Cursive', + 'astral': '\uD802[\uDDA0-\uDDFF]' + }, + { + 'name': 'InMeroitic_Hieroglyphs', + 'astral': '\uD802[\uDD80-\uDD9F]' + }, + { + 'name': 'InMiao', + 'astral': '\uD81B[\uDF00-\uDF9F]' + }, + { + 'name': 'InMiscellaneous_Mathematical_Symbols_A', + 'bmp': '\u27C0-\u27EF' + }, + { + 'name': 'InMiscellaneous_Mathematical_Symbols_B', + 'bmp': '\u2980-\u29FF' + }, + { + 'name': 'InMiscellaneous_Symbols', + 'bmp': '\u2600-\u26FF' + }, + { + 'name': 'InMiscellaneous_Symbols_And_Arrows', + 'bmp': '\u2B00-\u2BFF' + }, + { + 'name': 'InMiscellaneous_Symbols_And_Pictographs', + 'astral': '\uD83C[\uDF00-\uDFFF]|\uD83D[\uDC00-\uDDFF]' + }, + { + 'name': 'InMiscellaneous_Technical', + 'bmp': '\u2300-\u23FF' + }, + { + 'name': 'InModi', + 'astral': '\uD805[\uDE00-\uDE5F]' + }, + { + 'name': 'InModifier_Tone_Letters', + 'bmp': '\uA700-\uA71F' + }, + { + 'name': 'InMongolian', + 'bmp': '\u1800-\u18AF' + }, + { + 'name': 'InMongolian_Supplement', + 'astral': '\uD805[\uDE60-\uDE7F]' + }, + { + 'name': 'InMro', + 'astral': '\uD81A[\uDE40-\uDE6F]' + }, + { + 'name': 'InMultani', + 'astral': '\uD804[\uDE80-\uDEAF]' + }, + { + 'name': 'InMusical_Symbols', + 'astral': '\uD834[\uDD00-\uDDFF]' + }, + { + 'name': 'InMyanmar', + 'bmp': '\u1000-\u109F' + }, + { + 'name': 'InMyanmar_Extended_A', + 'bmp': '\uAA60-\uAA7F' + }, + { + 'name': 'InMyanmar_Extended_B', + 'bmp': '\uA9E0-\uA9FF' + }, + { + 'name': 'InNKo', + 'bmp': '\u07C0-\u07FF' + }, + { + 'name': 'InNabataean', + 'astral': '\uD802[\uDC80-\uDCAF]' + }, + { + 'name': 'InNew_Tai_Lue', + 'bmp': '\u1980-\u19DF' + }, + { + 'name': 'InNewa', + 'astral': '\uD805[\uDC00-\uDC7F]' + }, + { + 'name': 'InNumber_Forms', + 'bmp': '\u2150-\u218F' + }, + { + 'name': 'InNushu', + 'astral': '\uD82C[\uDD70-\uDEFF]' + }, + { + 'name': 'InOgham', + 'bmp': '\u1680-\u169F' + }, + { + 'name': 'InOl_Chiki', + 'bmp': '\u1C50-\u1C7F' + }, + { + 'name': 'InOld_Hungarian', + 'astral': '\uD803[\uDC80-\uDCFF]' + }, + { + 'name': 'InOld_Italic', + 'astral': '\uD800[\uDF00-\uDF2F]' + }, + { + 'name': 'InOld_North_Arabian', + 'astral': '\uD802[\uDE80-\uDE9F]' + }, + { + 'name': 'InOld_Permic', + 'astral': '\uD800[\uDF50-\uDF7F]' + }, + { + 'name': 'InOld_Persian', + 'astral': '\uD800[\uDFA0-\uDFDF]' + }, + { + 'name': 'InOld_Sogdian', + 'astral': '\uD803[\uDF00-\uDF2F]' + }, + { + 'name': 'InOld_South_Arabian', + 'astral': '\uD802[\uDE60-\uDE7F]' + }, + { + 'name': 'InOld_Turkic', + 'astral': '\uD803[\uDC00-\uDC4F]' + }, + { + 'name': 'InOptical_Character_Recognition', + 'bmp': '\u2440-\u245F' + }, + { + 'name': 'InOriya', + 'bmp': '\u0B00-\u0B7F' + }, + { + 'name': 'InOrnamental_Dingbats', + 'astral': '\uD83D[\uDE50-\uDE7F]' + }, + { + 'name': 'InOsage', + 'astral': '\uD801[\uDCB0-\uDCFF]' + }, + { + 'name': 'InOsmanya', + 'astral': '\uD801[\uDC80-\uDCAF]' + }, + { + 'name': 'InPahawh_Hmong', + 'astral': '\uD81A[\uDF00-\uDF8F]' + }, + { + 'name': 'InPalmyrene', + 'astral': '\uD802[\uDC60-\uDC7F]' + }, + { + 'name': 'InPau_Cin_Hau', + 'astral': '\uD806[\uDEC0-\uDEFF]' + }, + { + 'name': 'InPhags_Pa', + 'bmp': '\uA840-\uA87F' + }, + { + 'name': 'InPhaistos_Disc', + 'astral': '\uD800[\uDDD0-\uDDFF]' + }, + { + 'name': 'InPhoenician', + 'astral': '\uD802[\uDD00-\uDD1F]' + }, + { + 'name': 'InPhonetic_Extensions', + 'bmp': '\u1D00-\u1D7F' + }, + { + 'name': 'InPhonetic_Extensions_Supplement', + 'bmp': '\u1D80-\u1DBF' + }, + { + 'name': 'InPlaying_Cards', + 'astral': '\uD83C[\uDCA0-\uDCFF]' + }, + { + 'name': 'InPrivate_Use_Area', + 'bmp': '\uE000-\uF8FF' + }, + { + 'name': 'InPsalter_Pahlavi', + 'astral': '\uD802[\uDF80-\uDFAF]' + }, + { + 'name': 'InRejang', + 'bmp': '\uA930-\uA95F' + }, + { + 'name': 'InRumi_Numeral_Symbols', + 'astral': '\uD803[\uDE60-\uDE7F]' + }, + { + 'name': 'InRunic', + 'bmp': '\u16A0-\u16FF' + }, + { + 'name': 'InSamaritan', + 'bmp': '\u0800-\u083F' + }, + { + 'name': 'InSaurashtra', + 'bmp': '\uA880-\uA8DF' + }, + { + 'name': 'InSharada', + 'astral': '\uD804[\uDD80-\uDDDF]' + }, + { + 'name': 'InShavian', + 'astral': '\uD801[\uDC50-\uDC7F]' + }, + { + 'name': 'InShorthand_Format_Controls', + 'astral': '\uD82F[\uDCA0-\uDCAF]' + }, + { + 'name': 'InSiddham', + 'astral': '\uD805[\uDD80-\uDDFF]' + }, + { + 'name': 'InSinhala', + 'bmp': '\u0D80-\u0DFF' + }, + { + 'name': 'InSinhala_Archaic_Numbers', + 'astral': '\uD804[\uDDE0-\uDDFF]' + }, + { + 'name': 'InSmall_Form_Variants', + 'bmp': '\uFE50-\uFE6F' + }, + { + 'name': 'InSogdian', + 'astral': '\uD803[\uDF30-\uDF6F]' + }, + { + 'name': 'InSora_Sompeng', + 'astral': '\uD804[\uDCD0-\uDCFF]' + }, + { + 'name': 'InSoyombo', + 'astral': '\uD806[\uDE50-\uDEAF]' + }, + { + 'name': 'InSpacing_Modifier_Letters', + 'bmp': '\u02B0-\u02FF' + }, + { + 'name': 'InSpecials', + 'bmp': '\uFFF0-\uFFFF' + }, + { + 'name': 'InSundanese', + 'bmp': '\u1B80-\u1BBF' + }, + { + 'name': 'InSundanese_Supplement', + 'bmp': '\u1CC0-\u1CCF' + }, + { + 'name': 'InSuperscripts_And_Subscripts', + 'bmp': '\u2070-\u209F' + }, + { + 'name': 'InSupplemental_Arrows_A', + 'bmp': '\u27F0-\u27FF' + }, + { + 'name': 'InSupplemental_Arrows_B', + 'bmp': '\u2900-\u297F' + }, + { + 'name': 'InSupplemental_Arrows_C', + 'astral': '\uD83E[\uDC00-\uDCFF]' + }, + { + 'name': 'InSupplemental_Mathematical_Operators', + 'bmp': '\u2A00-\u2AFF' + }, + { + 'name': 'InSupplemental_Punctuation', + 'bmp': '\u2E00-\u2E7F' + }, + { + 'name': 'InSupplemental_Symbols_And_Pictographs', + 'astral': '\uD83E[\uDD00-\uDDFF]' + }, + { + 'name': 'InSupplementary_Private_Use_Area_A', + 'astral': '[\uDB80-\uDBBF][\uDC00-\uDFFF]' + }, + { + 'name': 'InSupplementary_Private_Use_Area_B', + 'astral': '[\uDBC0-\uDBFF][\uDC00-\uDFFF]' + }, + { + 'name': 'InSutton_SignWriting', + 'astral': '\uD836[\uDC00-\uDEAF]' + }, + { + 'name': 'InSyloti_Nagri', + 'bmp': '\uA800-\uA82F' + }, + { + 'name': 'InSyriac', + 'bmp': '\u0700-\u074F' + }, + { + 'name': 'InSyriac_Supplement', + 'bmp': '\u0860-\u086F' + }, + { + 'name': 'InTagalog', + 'bmp': '\u1700-\u171F' + }, + { + 'name': 'InTagbanwa', + 'bmp': '\u1760-\u177F' + }, + { + 'name': 'InTags', + 'astral': '\uDB40[\uDC00-\uDC7F]' + }, + { + 'name': 'InTai_Le', + 'bmp': '\u1950-\u197F' + }, + { + 'name': 'InTai_Tham', + 'bmp': '\u1A20-\u1AAF' + }, + { + 'name': 'InTai_Viet', + 'bmp': '\uAA80-\uAADF' + }, + { + 'name': 'InTai_Xuan_Jing_Symbols', + 'astral': '\uD834[\uDF00-\uDF5F]' + }, + { + 'name': 'InTakri', + 'astral': '\uD805[\uDE80-\uDECF]' + }, + { + 'name': 'InTamil', + 'bmp': '\u0B80-\u0BFF' + }, + { + 'name': 'InTangut', + 'astral': '[\uD81C-\uD821][\uDC00-\uDFFF]' + }, + { + 'name': 'InTangut_Components', + 'astral': '\uD822[\uDC00-\uDEFF]' + }, + { + 'name': 'InTelugu', + 'bmp': '\u0C00-\u0C7F' + }, + { + 'name': 'InThaana', + 'bmp': '\u0780-\u07BF' + }, + { + 'name': 'InThai', + 'bmp': '\u0E00-\u0E7F' + }, + { + 'name': 'InTibetan', + 'bmp': '\u0F00-\u0FFF' + }, + { + 'name': 'InTifinagh', + 'bmp': '\u2D30-\u2D7F' + }, + { + 'name': 'InTirhuta', + 'astral': '\uD805[\uDC80-\uDCDF]' + }, + { + 'name': 'InTransport_And_Map_Symbols', + 'astral': '\uD83D[\uDE80-\uDEFF]' + }, + { + 'name': 'InUgaritic', + 'astral': '\uD800[\uDF80-\uDF9F]' + }, + { + 'name': 'InUnified_Canadian_Aboriginal_Syllabics', + 'bmp': '\u1400-\u167F' + }, + { + 'name': 'InUnified_Canadian_Aboriginal_Syllabics_Extended', + 'bmp': '\u18B0-\u18FF' + }, + { + 'name': 'InVai', + 'bmp': '\uA500-\uA63F' + }, + { + 'name': 'InVariation_Selectors', + 'bmp': '\uFE00-\uFE0F' + }, + { + 'name': 'InVariation_Selectors_Supplement', + 'astral': '\uDB40[\uDD00-\uDDEF]' + }, + { + 'name': 'InVedic_Extensions', + 'bmp': '\u1CD0-\u1CFF' + }, + { + 'name': 'InVertical_Forms', + 'bmp': '\uFE10-\uFE1F' + }, + { + 'name': 'InWarang_Citi', + 'astral': '\uD806[\uDCA0-\uDCFF]' + }, + { + 'name': 'InYi_Radicals', + 'bmp': '\uA490-\uA4CF' + }, + { + 'name': 'InYi_Syllables', + 'bmp': '\uA000-\uA48F' + }, + { + 'name': 'InYijing_Hexagram_Symbols', + 'bmp': '\u4DC0-\u4DFF' + }, + { + 'name': 'InZanabazar_Square', + 'astral': '\uD806[\uDE00-\uDE4F]' + } +]; + +var unicodeBlocks = createCommonjsModule(function (module, exports) { +"use strict"; + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.default = void 0; + +var _blocks = _interopRequireDefault(blocks); + +function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } + +/*! + * XRegExp Unicode Blocks 4.2.0 + * + * Steven Levithan (c) 2010-present MIT License + * Unicode data by Mathias Bynens + */ +var _default = function _default(XRegExp) { + /** + * Adds support for all Unicode blocks. Block names use the prefix 'In'. E.g., + * `\p{InBasicLatin}`. Token names are case insensitive, and any spaces, hyphens, and + * underscores are ignored. + * + * Uses Unicode 11.0.0. + * + * @requires XRegExp, Unicode Base + */ + if (!XRegExp.addUnicodeData) { + throw new ReferenceError('Unicode Base must be loaded before Unicode Blocks'); + } + + XRegExp.addUnicodeData(_blocks.default); +}; + +exports.default = _default; +module.exports = exports["default"]; +}); + +unwrapExports(unicodeBlocks); + +var categories = [ + { + 'name': 'C', + 'alias': 'Other', + 'isBmpLast': true, + 'bmp': '\0-\x1F\x7F-\x9F\xAD\u0378\u0379\u0380-\u0383\u038B\u038D\u03A2\u0530\u0557\u0558\u058B\u058C\u0590\u05C8-\u05CF\u05EB-\u05EE\u05F5-\u0605\u061C\u061D\u06DD\u070E\u070F\u074B\u074C\u07B2-\u07BF\u07FB\u07FC\u082E\u082F\u083F\u085C\u085D\u085F\u086B-\u089F\u08B5\u08BE-\u08D2\u08E2\u0984\u098D\u098E\u0991\u0992\u09A9\u09B1\u09B3-\u09B5\u09BA\u09BB\u09C5\u09C6\u09C9\u09CA\u09CF-\u09D6\u09D8-\u09DB\u09DE\u09E4\u09E5\u09FF\u0A00\u0A04\u0A0B-\u0A0E\u0A11\u0A12\u0A29\u0A31\u0A34\u0A37\u0A3A\u0A3B\u0A3D\u0A43-\u0A46\u0A49\u0A4A\u0A4E-\u0A50\u0A52-\u0A58\u0A5D\u0A5F-\u0A65\u0A77-\u0A80\u0A84\u0A8E\u0A92\u0AA9\u0AB1\u0AB4\u0ABA\u0ABB\u0AC6\u0ACA\u0ACE\u0ACF\u0AD1-\u0ADF\u0AE4\u0AE5\u0AF2-\u0AF8\u0B00\u0B04\u0B0D\u0B0E\u0B11\u0B12\u0B29\u0B31\u0B34\u0B3A\u0B3B\u0B45\u0B46\u0B49\u0B4A\u0B4E-\u0B55\u0B58-\u0B5B\u0B5E\u0B64\u0B65\u0B78-\u0B81\u0B84\u0B8B-\u0B8D\u0B91\u0B96-\u0B98\u0B9B\u0B9D\u0BA0-\u0BA2\u0BA5-\u0BA7\u0BAB-\u0BAD\u0BBA-\u0BBD\u0BC3-\u0BC5\u0BC9\u0BCE\u0BCF\u0BD1-\u0BD6\u0BD8-\u0BE5\u0BFB-\u0BFF\u0C0D\u0C11\u0C29\u0C3A-\u0C3C\u0C45\u0C49\u0C4E-\u0C54\u0C57\u0C5B-\u0C5F\u0C64\u0C65\u0C70-\u0C77\u0C8D\u0C91\u0CA9\u0CB4\u0CBA\u0CBB\u0CC5\u0CC9\u0CCE-\u0CD4\u0CD7-\u0CDD\u0CDF\u0CE4\u0CE5\u0CF0\u0CF3-\u0CFF\u0D04\u0D0D\u0D11\u0D45\u0D49\u0D50-\u0D53\u0D64\u0D65\u0D80\u0D81\u0D84\u0D97-\u0D99\u0DB2\u0DBC\u0DBE\u0DBF\u0DC7-\u0DC9\u0DCB-\u0DCE\u0DD5\u0DD7\u0DE0-\u0DE5\u0DF0\u0DF1\u0DF5-\u0E00\u0E3B-\u0E3E\u0E5C-\u0E80\u0E83\u0E85\u0E86\u0E89\u0E8B\u0E8C\u0E8E-\u0E93\u0E98\u0EA0\u0EA4\u0EA6\u0EA8\u0EA9\u0EAC\u0EBA\u0EBE\u0EBF\u0EC5\u0EC7\u0ECE\u0ECF\u0EDA\u0EDB\u0EE0-\u0EFF\u0F48\u0F6D-\u0F70\u0F98\u0FBD\u0FCD\u0FDB-\u0FFF\u10C6\u10C8-\u10CC\u10CE\u10CF\u1249\u124E\u124F\u1257\u1259\u125E\u125F\u1289\u128E\u128F\u12B1\u12B6\u12B7\u12BF\u12C1\u12C6\u12C7\u12D7\u1311\u1316\u1317\u135B\u135C\u137D-\u137F\u139A-\u139F\u13F6\u13F7\u13FE\u13FF\u169D-\u169F\u16F9-\u16FF\u170D\u1715-\u171F\u1737-\u173F\u1754-\u175F\u176D\u1771\u1774-\u177F\u17DE\u17DF\u17EA-\u17EF\u17FA-\u17FF\u180E\u180F\u181A-\u181F\u1879-\u187F\u18AB-\u18AF\u18F6-\u18FF\u191F\u192C-\u192F\u193C-\u193F\u1941-\u1943\u196E\u196F\u1975-\u197F\u19AC-\u19AF\u19CA-\u19CF\u19DB-\u19DD\u1A1C\u1A1D\u1A5F\u1A7D\u1A7E\u1A8A-\u1A8F\u1A9A-\u1A9F\u1AAE\u1AAF\u1ABF-\u1AFF\u1B4C-\u1B4F\u1B7D-\u1B7F\u1BF4-\u1BFB\u1C38-\u1C3A\u1C4A-\u1C4C\u1C89-\u1C8F\u1CBB\u1CBC\u1CC8-\u1CCF\u1CFA-\u1CFF\u1DFA\u1F16\u1F17\u1F1E\u1F1F\u1F46\u1F47\u1F4E\u1F4F\u1F58\u1F5A\u1F5C\u1F5E\u1F7E\u1F7F\u1FB5\u1FC5\u1FD4\u1FD5\u1FDC\u1FF0\u1FF1\u1FF5\u1FFF\u200B-\u200F\u202A-\u202E\u2060-\u206F\u2072\u2073\u208F\u209D-\u209F\u20C0-\u20CF\u20F1-\u20FF\u218C-\u218F\u2427-\u243F\u244B-\u245F\u2B74\u2B75\u2B96\u2B97\u2BC9\u2BFF\u2C2F\u2C5F\u2CF4-\u2CF8\u2D26\u2D28-\u2D2C\u2D2E\u2D2F\u2D68-\u2D6E\u2D71-\u2D7E\u2D97-\u2D9F\u2DA7\u2DAF\u2DB7\u2DBF\u2DC7\u2DCF\u2DD7\u2DDF\u2E4F-\u2E7F\u2E9A\u2EF4-\u2EFF\u2FD6-\u2FEF\u2FFC-\u2FFF\u3040\u3097\u3098\u3100-\u3104\u3130\u318F\u31BB-\u31BF\u31E4-\u31EF\u321F\u32FF\u4DB6-\u4DBF\u9FF0-\u9FFF\uA48D-\uA48F\uA4C7-\uA4CF\uA62C-\uA63F\uA6F8-\uA6FF\uA7BA-\uA7F6\uA82C-\uA82F\uA83A-\uA83F\uA878-\uA87F\uA8C6-\uA8CD\uA8DA-\uA8DF\uA954-\uA95E\uA97D-\uA97F\uA9CE\uA9DA-\uA9DD\uA9FF\uAA37-\uAA3F\uAA4E\uAA4F\uAA5A\uAA5B\uAAC3-\uAADA\uAAF7-\uAB00\uAB07\uAB08\uAB0F\uAB10\uAB17-\uAB1F\uAB27\uAB2F\uAB66-\uAB6F\uABEE\uABEF\uABFA-\uABFF\uD7A4-\uD7AF\uD7C7-\uD7CA\uD7FC-\uF8FF\uFA6E\uFA6F\uFADA-\uFAFF\uFB07-\uFB12\uFB18-\uFB1C\uFB37\uFB3D\uFB3F\uFB42\uFB45\uFBC2-\uFBD2\uFD40-\uFD4F\uFD90\uFD91\uFDC8-\uFDEF\uFDFE\uFDFF\uFE1A-\uFE1F\uFE53\uFE67\uFE6C-\uFE6F\uFE75\uFEFD-\uFF00\uFFBF-\uFFC1\uFFC8\uFFC9\uFFD0\uFFD1\uFFD8\uFFD9\uFFDD-\uFFDF\uFFE7\uFFEF-\uFFFB\uFFFE\uFFFF', + 'astral': '\uD800[\uDC0C\uDC27\uDC3B\uDC3E\uDC4E\uDC4F\uDC5E-\uDC7F\uDCFB-\uDCFF\uDD03-\uDD06\uDD34-\uDD36\uDD8F\uDD9C-\uDD9F\uDDA1-\uDDCF\uDDFE-\uDE7F\uDE9D-\uDE9F\uDED1-\uDEDF\uDEFC-\uDEFF\uDF24-\uDF2C\uDF4B-\uDF4F\uDF7B-\uDF7F\uDF9E\uDFC4-\uDFC7\uDFD6-\uDFFF]|\uD801[\uDC9E\uDC9F\uDCAA-\uDCAF\uDCD4-\uDCD7\uDCFC-\uDCFF\uDD28-\uDD2F\uDD64-\uDD6E\uDD70-\uDDFF\uDF37-\uDF3F\uDF56-\uDF5F\uDF68-\uDFFF]|\uD802[\uDC06\uDC07\uDC09\uDC36\uDC39-\uDC3B\uDC3D\uDC3E\uDC56\uDC9F-\uDCA6\uDCB0-\uDCDF\uDCF3\uDCF6-\uDCFA\uDD1C-\uDD1E\uDD3A-\uDD3E\uDD40-\uDD7F\uDDB8-\uDDBB\uDDD0\uDDD1\uDE04\uDE07-\uDE0B\uDE14\uDE18\uDE36\uDE37\uDE3B-\uDE3E\uDE49-\uDE4F\uDE59-\uDE5F\uDEA0-\uDEBF\uDEE7-\uDEEA\uDEF7-\uDEFF\uDF36-\uDF38\uDF56\uDF57\uDF73-\uDF77\uDF92-\uDF98\uDF9D-\uDFA8\uDFB0-\uDFFF]|\uD803[\uDC49-\uDC7F\uDCB3-\uDCBF\uDCF3-\uDCF9\uDD28-\uDD2F\uDD3A-\uDE5F\uDE7F-\uDEFF\uDF28-\uDF2F\uDF5A-\uDFFF]|\uD804[\uDC4E-\uDC51\uDC70-\uDC7E\uDCBD\uDCC2-\uDCCF\uDCE9-\uDCEF\uDCFA-\uDCFF\uDD35\uDD47-\uDD4F\uDD77-\uDD7F\uDDCE\uDDCF\uDDE0\uDDF5-\uDDFF\uDE12\uDE3F-\uDE7F\uDE87\uDE89\uDE8E\uDE9E\uDEAA-\uDEAF\uDEEB-\uDEEF\uDEFA-\uDEFF\uDF04\uDF0D\uDF0E\uDF11\uDF12\uDF29\uDF31\uDF34\uDF3A\uDF45\uDF46\uDF49\uDF4A\uDF4E\uDF4F\uDF51-\uDF56\uDF58-\uDF5C\uDF64\uDF65\uDF6D-\uDF6F\uDF75-\uDFFF]|\uD805[\uDC5A\uDC5C\uDC5F-\uDC7F\uDCC8-\uDCCF\uDCDA-\uDD7F\uDDB6\uDDB7\uDDDE-\uDDFF\uDE45-\uDE4F\uDE5A-\uDE5F\uDE6D-\uDE7F\uDEB8-\uDEBF\uDECA-\uDEFF\uDF1B\uDF1C\uDF2C-\uDF2F\uDF40-\uDFFF]|\uD806[\uDC3C-\uDC9F\uDCF3-\uDCFE\uDD00-\uDDFF\uDE48-\uDE4F\uDE84\uDE85\uDEA3-\uDEBF\uDEF9-\uDFFF]|\uD807[\uDC09\uDC37\uDC46-\uDC4F\uDC6D-\uDC6F\uDC90\uDC91\uDCA8\uDCB7-\uDCFF\uDD07\uDD0A\uDD37-\uDD39\uDD3B\uDD3E\uDD48-\uDD4F\uDD5A-\uDD5F\uDD66\uDD69\uDD8F\uDD92\uDD99-\uDD9F\uDDAA-\uDEDF\uDEF9-\uDFFF]|\uD808[\uDF9A-\uDFFF]|\uD809[\uDC6F\uDC75-\uDC7F\uDD44-\uDFFF]|[\uD80A\uD80B\uD80E-\uD810\uD812-\uD819\uD823-\uD82B\uD82D\uD82E\uD830-\uD833\uD837\uD839\uD83F\uD87B-\uD87D\uD87F-\uDB3F\uDB41-\uDBFF][\uDC00-\uDFFF]|\uD80D[\uDC2F-\uDFFF]|\uD811[\uDE47-\uDFFF]|\uD81A[\uDE39-\uDE3F\uDE5F\uDE6A-\uDE6D\uDE70-\uDECF\uDEEE\uDEEF\uDEF6-\uDEFF\uDF46-\uDF4F\uDF5A\uDF62\uDF78-\uDF7C\uDF90-\uDFFF]|\uD81B[\uDC00-\uDE3F\uDE9B-\uDEFF\uDF45-\uDF4F\uDF7F-\uDF8E\uDFA0-\uDFDF\uDFE2-\uDFFF]|\uD821[\uDFF2-\uDFFF]|\uD822[\uDEF3-\uDFFF]|\uD82C[\uDD1F-\uDD6F\uDEFC-\uDFFF]|\uD82F[\uDC6B-\uDC6F\uDC7D-\uDC7F\uDC89-\uDC8F\uDC9A\uDC9B\uDCA0-\uDFFF]|\uD834[\uDCF6-\uDCFF\uDD27\uDD28\uDD73-\uDD7A\uDDE9-\uDDFF\uDE46-\uDEDF\uDEF4-\uDEFF\uDF57-\uDF5F\uDF79-\uDFFF]|\uD835[\uDC55\uDC9D\uDCA0\uDCA1\uDCA3\uDCA4\uDCA7\uDCA8\uDCAD\uDCBA\uDCBC\uDCC4\uDD06\uDD0B\uDD0C\uDD15\uDD1D\uDD3A\uDD3F\uDD45\uDD47-\uDD49\uDD51\uDEA6\uDEA7\uDFCC\uDFCD]|\uD836[\uDE8C-\uDE9A\uDEA0\uDEB0-\uDFFF]|\uD838[\uDC07\uDC19\uDC1A\uDC22\uDC25\uDC2B-\uDFFF]|\uD83A[\uDCC5\uDCC6\uDCD7-\uDCFF\uDD4B-\uDD4F\uDD5A-\uDD5D\uDD60-\uDFFF]|\uD83B[\uDC00-\uDC70\uDCB5-\uDDFF\uDE04\uDE20\uDE23\uDE25\uDE26\uDE28\uDE33\uDE38\uDE3A\uDE3C-\uDE41\uDE43-\uDE46\uDE48\uDE4A\uDE4C\uDE50\uDE53\uDE55\uDE56\uDE58\uDE5A\uDE5C\uDE5E\uDE60\uDE63\uDE65\uDE66\uDE6B\uDE73\uDE78\uDE7D\uDE7F\uDE8A\uDE9C-\uDEA0\uDEA4\uDEAA\uDEBC-\uDEEF\uDEF2-\uDFFF]|\uD83C[\uDC2C-\uDC2F\uDC94-\uDC9F\uDCAF\uDCB0\uDCC0\uDCD0\uDCF6-\uDCFF\uDD0D-\uDD0F\uDD6C-\uDD6F\uDDAD-\uDDE5\uDE03-\uDE0F\uDE3C-\uDE3F\uDE49-\uDE4F\uDE52-\uDE5F\uDE66-\uDEFF]|\uD83D[\uDED5-\uDEDF\uDEED-\uDEEF\uDEFA-\uDEFF\uDF74-\uDF7F\uDFD9-\uDFFF]|\uD83E[\uDC0C-\uDC0F\uDC48-\uDC4F\uDC5A-\uDC5F\uDC88-\uDC8F\uDCAE-\uDCFF\uDD0C-\uDD0F\uDD3F\uDD71\uDD72\uDD77-\uDD79\uDD7B\uDDA3-\uDDAF\uDDBA-\uDDBF\uDDC3-\uDDCF\uDE00-\uDE5F\uDE6E-\uDFFF]|\uD869[\uDED7-\uDEFF]|\uD86D[\uDF35-\uDF3F]|\uD86E[\uDC1E\uDC1F]|\uD873[\uDEA2-\uDEAF]|\uD87A[\uDFE1-\uDFFF]|\uD87E[\uDE1E-\uDFFF]|\uDB40[\uDC00-\uDCFF\uDDF0-\uDFFF]' + }, + { + 'name': 'Cc', + 'alias': 'Control', + 'bmp': '\0-\x1F\x7F-\x9F' + }, + { + 'name': 'Cf', + 'alias': 'Format', + 'bmp': '\xAD\u0600-\u0605\u061C\u06DD\u070F\u08E2\u180E\u200B-\u200F\u202A-\u202E\u2060-\u2064\u2066-\u206F\uFEFF\uFFF9-\uFFFB', + 'astral': '\uD804[\uDCBD\uDCCD]|\uD82F[\uDCA0-\uDCA3]|\uD834[\uDD73-\uDD7A]|\uDB40[\uDC01\uDC20-\uDC7F]' + }, + { + 'name': 'Cn', + 'alias': 'Unassigned', + 'bmp': '\u0378\u0379\u0380-\u0383\u038B\u038D\u03A2\u0530\u0557\u0558\u058B\u058C\u0590\u05C8-\u05CF\u05EB-\u05EE\u05F5-\u05FF\u061D\u070E\u074B\u074C\u07B2-\u07BF\u07FB\u07FC\u082E\u082F\u083F\u085C\u085D\u085F\u086B-\u089F\u08B5\u08BE-\u08D2\u0984\u098D\u098E\u0991\u0992\u09A9\u09B1\u09B3-\u09B5\u09BA\u09BB\u09C5\u09C6\u09C9\u09CA\u09CF-\u09D6\u09D8-\u09DB\u09DE\u09E4\u09E5\u09FF\u0A00\u0A04\u0A0B-\u0A0E\u0A11\u0A12\u0A29\u0A31\u0A34\u0A37\u0A3A\u0A3B\u0A3D\u0A43-\u0A46\u0A49\u0A4A\u0A4E-\u0A50\u0A52-\u0A58\u0A5D\u0A5F-\u0A65\u0A77-\u0A80\u0A84\u0A8E\u0A92\u0AA9\u0AB1\u0AB4\u0ABA\u0ABB\u0AC6\u0ACA\u0ACE\u0ACF\u0AD1-\u0ADF\u0AE4\u0AE5\u0AF2-\u0AF8\u0B00\u0B04\u0B0D\u0B0E\u0B11\u0B12\u0B29\u0B31\u0B34\u0B3A\u0B3B\u0B45\u0B46\u0B49\u0B4A\u0B4E-\u0B55\u0B58-\u0B5B\u0B5E\u0B64\u0B65\u0B78-\u0B81\u0B84\u0B8B-\u0B8D\u0B91\u0B96-\u0B98\u0B9B\u0B9D\u0BA0-\u0BA2\u0BA5-\u0BA7\u0BAB-\u0BAD\u0BBA-\u0BBD\u0BC3-\u0BC5\u0BC9\u0BCE\u0BCF\u0BD1-\u0BD6\u0BD8-\u0BE5\u0BFB-\u0BFF\u0C0D\u0C11\u0C29\u0C3A-\u0C3C\u0C45\u0C49\u0C4E-\u0C54\u0C57\u0C5B-\u0C5F\u0C64\u0C65\u0C70-\u0C77\u0C8D\u0C91\u0CA9\u0CB4\u0CBA\u0CBB\u0CC5\u0CC9\u0CCE-\u0CD4\u0CD7-\u0CDD\u0CDF\u0CE4\u0CE5\u0CF0\u0CF3-\u0CFF\u0D04\u0D0D\u0D11\u0D45\u0D49\u0D50-\u0D53\u0D64\u0D65\u0D80\u0D81\u0D84\u0D97-\u0D99\u0DB2\u0DBC\u0DBE\u0DBF\u0DC7-\u0DC9\u0DCB-\u0DCE\u0DD5\u0DD7\u0DE0-\u0DE5\u0DF0\u0DF1\u0DF5-\u0E00\u0E3B-\u0E3E\u0E5C-\u0E80\u0E83\u0E85\u0E86\u0E89\u0E8B\u0E8C\u0E8E-\u0E93\u0E98\u0EA0\u0EA4\u0EA6\u0EA8\u0EA9\u0EAC\u0EBA\u0EBE\u0EBF\u0EC5\u0EC7\u0ECE\u0ECF\u0EDA\u0EDB\u0EE0-\u0EFF\u0F48\u0F6D-\u0F70\u0F98\u0FBD\u0FCD\u0FDB-\u0FFF\u10C6\u10C8-\u10CC\u10CE\u10CF\u1249\u124E\u124F\u1257\u1259\u125E\u125F\u1289\u128E\u128F\u12B1\u12B6\u12B7\u12BF\u12C1\u12C6\u12C7\u12D7\u1311\u1316\u1317\u135B\u135C\u137D-\u137F\u139A-\u139F\u13F6\u13F7\u13FE\u13FF\u169D-\u169F\u16F9-\u16FF\u170D\u1715-\u171F\u1737-\u173F\u1754-\u175F\u176D\u1771\u1774-\u177F\u17DE\u17DF\u17EA-\u17EF\u17FA-\u17FF\u180F\u181A-\u181F\u1879-\u187F\u18AB-\u18AF\u18F6-\u18FF\u191F\u192C-\u192F\u193C-\u193F\u1941-\u1943\u196E\u196F\u1975-\u197F\u19AC-\u19AF\u19CA-\u19CF\u19DB-\u19DD\u1A1C\u1A1D\u1A5F\u1A7D\u1A7E\u1A8A-\u1A8F\u1A9A-\u1A9F\u1AAE\u1AAF\u1ABF-\u1AFF\u1B4C-\u1B4F\u1B7D-\u1B7F\u1BF4-\u1BFB\u1C38-\u1C3A\u1C4A-\u1C4C\u1C89-\u1C8F\u1CBB\u1CBC\u1CC8-\u1CCF\u1CFA-\u1CFF\u1DFA\u1F16\u1F17\u1F1E\u1F1F\u1F46\u1F47\u1F4E\u1F4F\u1F58\u1F5A\u1F5C\u1F5E\u1F7E\u1F7F\u1FB5\u1FC5\u1FD4\u1FD5\u1FDC\u1FF0\u1FF1\u1FF5\u1FFF\u2065\u2072\u2073\u208F\u209D-\u209F\u20C0-\u20CF\u20F1-\u20FF\u218C-\u218F\u2427-\u243F\u244B-\u245F\u2B74\u2B75\u2B96\u2B97\u2BC9\u2BFF\u2C2F\u2C5F\u2CF4-\u2CF8\u2D26\u2D28-\u2D2C\u2D2E\u2D2F\u2D68-\u2D6E\u2D71-\u2D7E\u2D97-\u2D9F\u2DA7\u2DAF\u2DB7\u2DBF\u2DC7\u2DCF\u2DD7\u2DDF\u2E4F-\u2E7F\u2E9A\u2EF4-\u2EFF\u2FD6-\u2FEF\u2FFC-\u2FFF\u3040\u3097\u3098\u3100-\u3104\u3130\u318F\u31BB-\u31BF\u31E4-\u31EF\u321F\u32FF\u4DB6-\u4DBF\u9FF0-\u9FFF\uA48D-\uA48F\uA4C7-\uA4CF\uA62C-\uA63F\uA6F8-\uA6FF\uA7BA-\uA7F6\uA82C-\uA82F\uA83A-\uA83F\uA878-\uA87F\uA8C6-\uA8CD\uA8DA-\uA8DF\uA954-\uA95E\uA97D-\uA97F\uA9CE\uA9DA-\uA9DD\uA9FF\uAA37-\uAA3F\uAA4E\uAA4F\uAA5A\uAA5B\uAAC3-\uAADA\uAAF7-\uAB00\uAB07\uAB08\uAB0F\uAB10\uAB17-\uAB1F\uAB27\uAB2F\uAB66-\uAB6F\uABEE\uABEF\uABFA-\uABFF\uD7A4-\uD7AF\uD7C7-\uD7CA\uD7FC-\uD7FF\uFA6E\uFA6F\uFADA-\uFAFF\uFB07-\uFB12\uFB18-\uFB1C\uFB37\uFB3D\uFB3F\uFB42\uFB45\uFBC2-\uFBD2\uFD40-\uFD4F\uFD90\uFD91\uFDC8-\uFDEF\uFDFE\uFDFF\uFE1A-\uFE1F\uFE53\uFE67\uFE6C-\uFE6F\uFE75\uFEFD\uFEFE\uFF00\uFFBF-\uFFC1\uFFC8\uFFC9\uFFD0\uFFD1\uFFD8\uFFD9\uFFDD-\uFFDF\uFFE7\uFFEF-\uFFF8\uFFFE\uFFFF', + 'astral': '\uD800[\uDC0C\uDC27\uDC3B\uDC3E\uDC4E\uDC4F\uDC5E-\uDC7F\uDCFB-\uDCFF\uDD03-\uDD06\uDD34-\uDD36\uDD8F\uDD9C-\uDD9F\uDDA1-\uDDCF\uDDFE-\uDE7F\uDE9D-\uDE9F\uDED1-\uDEDF\uDEFC-\uDEFF\uDF24-\uDF2C\uDF4B-\uDF4F\uDF7B-\uDF7F\uDF9E\uDFC4-\uDFC7\uDFD6-\uDFFF]|\uD801[\uDC9E\uDC9F\uDCAA-\uDCAF\uDCD4-\uDCD7\uDCFC-\uDCFF\uDD28-\uDD2F\uDD64-\uDD6E\uDD70-\uDDFF\uDF37-\uDF3F\uDF56-\uDF5F\uDF68-\uDFFF]|\uD802[\uDC06\uDC07\uDC09\uDC36\uDC39-\uDC3B\uDC3D\uDC3E\uDC56\uDC9F-\uDCA6\uDCB0-\uDCDF\uDCF3\uDCF6-\uDCFA\uDD1C-\uDD1E\uDD3A-\uDD3E\uDD40-\uDD7F\uDDB8-\uDDBB\uDDD0\uDDD1\uDE04\uDE07-\uDE0B\uDE14\uDE18\uDE36\uDE37\uDE3B-\uDE3E\uDE49-\uDE4F\uDE59-\uDE5F\uDEA0-\uDEBF\uDEE7-\uDEEA\uDEF7-\uDEFF\uDF36-\uDF38\uDF56\uDF57\uDF73-\uDF77\uDF92-\uDF98\uDF9D-\uDFA8\uDFB0-\uDFFF]|\uD803[\uDC49-\uDC7F\uDCB3-\uDCBF\uDCF3-\uDCF9\uDD28-\uDD2F\uDD3A-\uDE5F\uDE7F-\uDEFF\uDF28-\uDF2F\uDF5A-\uDFFF]|\uD804[\uDC4E-\uDC51\uDC70-\uDC7E\uDCC2-\uDCCC\uDCCE\uDCCF\uDCE9-\uDCEF\uDCFA-\uDCFF\uDD35\uDD47-\uDD4F\uDD77-\uDD7F\uDDCE\uDDCF\uDDE0\uDDF5-\uDDFF\uDE12\uDE3F-\uDE7F\uDE87\uDE89\uDE8E\uDE9E\uDEAA-\uDEAF\uDEEB-\uDEEF\uDEFA-\uDEFF\uDF04\uDF0D\uDF0E\uDF11\uDF12\uDF29\uDF31\uDF34\uDF3A\uDF45\uDF46\uDF49\uDF4A\uDF4E\uDF4F\uDF51-\uDF56\uDF58-\uDF5C\uDF64\uDF65\uDF6D-\uDF6F\uDF75-\uDFFF]|\uD805[\uDC5A\uDC5C\uDC5F-\uDC7F\uDCC8-\uDCCF\uDCDA-\uDD7F\uDDB6\uDDB7\uDDDE-\uDDFF\uDE45-\uDE4F\uDE5A-\uDE5F\uDE6D-\uDE7F\uDEB8-\uDEBF\uDECA-\uDEFF\uDF1B\uDF1C\uDF2C-\uDF2F\uDF40-\uDFFF]|\uD806[\uDC3C-\uDC9F\uDCF3-\uDCFE\uDD00-\uDDFF\uDE48-\uDE4F\uDE84\uDE85\uDEA3-\uDEBF\uDEF9-\uDFFF]|\uD807[\uDC09\uDC37\uDC46-\uDC4F\uDC6D-\uDC6F\uDC90\uDC91\uDCA8\uDCB7-\uDCFF\uDD07\uDD0A\uDD37-\uDD39\uDD3B\uDD3E\uDD48-\uDD4F\uDD5A-\uDD5F\uDD66\uDD69\uDD8F\uDD92\uDD99-\uDD9F\uDDAA-\uDEDF\uDEF9-\uDFFF]|\uD808[\uDF9A-\uDFFF]|\uD809[\uDC6F\uDC75-\uDC7F\uDD44-\uDFFF]|[\uD80A\uD80B\uD80E-\uD810\uD812-\uD819\uD823-\uD82B\uD82D\uD82E\uD830-\uD833\uD837\uD839\uD83F\uD87B-\uD87D\uD87F-\uDB3F\uDB41-\uDB7F][\uDC00-\uDFFF]|\uD80D[\uDC2F-\uDFFF]|\uD811[\uDE47-\uDFFF]|\uD81A[\uDE39-\uDE3F\uDE5F\uDE6A-\uDE6D\uDE70-\uDECF\uDEEE\uDEEF\uDEF6-\uDEFF\uDF46-\uDF4F\uDF5A\uDF62\uDF78-\uDF7C\uDF90-\uDFFF]|\uD81B[\uDC00-\uDE3F\uDE9B-\uDEFF\uDF45-\uDF4F\uDF7F-\uDF8E\uDFA0-\uDFDF\uDFE2-\uDFFF]|\uD821[\uDFF2-\uDFFF]|\uD822[\uDEF3-\uDFFF]|\uD82C[\uDD1F-\uDD6F\uDEFC-\uDFFF]|\uD82F[\uDC6B-\uDC6F\uDC7D-\uDC7F\uDC89-\uDC8F\uDC9A\uDC9B\uDCA4-\uDFFF]|\uD834[\uDCF6-\uDCFF\uDD27\uDD28\uDDE9-\uDDFF\uDE46-\uDEDF\uDEF4-\uDEFF\uDF57-\uDF5F\uDF79-\uDFFF]|\uD835[\uDC55\uDC9D\uDCA0\uDCA1\uDCA3\uDCA4\uDCA7\uDCA8\uDCAD\uDCBA\uDCBC\uDCC4\uDD06\uDD0B\uDD0C\uDD15\uDD1D\uDD3A\uDD3F\uDD45\uDD47-\uDD49\uDD51\uDEA6\uDEA7\uDFCC\uDFCD]|\uD836[\uDE8C-\uDE9A\uDEA0\uDEB0-\uDFFF]|\uD838[\uDC07\uDC19\uDC1A\uDC22\uDC25\uDC2B-\uDFFF]|\uD83A[\uDCC5\uDCC6\uDCD7-\uDCFF\uDD4B-\uDD4F\uDD5A-\uDD5D\uDD60-\uDFFF]|\uD83B[\uDC00-\uDC70\uDCB5-\uDDFF\uDE04\uDE20\uDE23\uDE25\uDE26\uDE28\uDE33\uDE38\uDE3A\uDE3C-\uDE41\uDE43-\uDE46\uDE48\uDE4A\uDE4C\uDE50\uDE53\uDE55\uDE56\uDE58\uDE5A\uDE5C\uDE5E\uDE60\uDE63\uDE65\uDE66\uDE6B\uDE73\uDE78\uDE7D\uDE7F\uDE8A\uDE9C-\uDEA0\uDEA4\uDEAA\uDEBC-\uDEEF\uDEF2-\uDFFF]|\uD83C[\uDC2C-\uDC2F\uDC94-\uDC9F\uDCAF\uDCB0\uDCC0\uDCD0\uDCF6-\uDCFF\uDD0D-\uDD0F\uDD6C-\uDD6F\uDDAD-\uDDE5\uDE03-\uDE0F\uDE3C-\uDE3F\uDE49-\uDE4F\uDE52-\uDE5F\uDE66-\uDEFF]|\uD83D[\uDED5-\uDEDF\uDEED-\uDEEF\uDEFA-\uDEFF\uDF74-\uDF7F\uDFD9-\uDFFF]|\uD83E[\uDC0C-\uDC0F\uDC48-\uDC4F\uDC5A-\uDC5F\uDC88-\uDC8F\uDCAE-\uDCFF\uDD0C-\uDD0F\uDD3F\uDD71\uDD72\uDD77-\uDD79\uDD7B\uDDA3-\uDDAF\uDDBA-\uDDBF\uDDC3-\uDDCF\uDE00-\uDE5F\uDE6E-\uDFFF]|\uD869[\uDED7-\uDEFF]|\uD86D[\uDF35-\uDF3F]|\uD86E[\uDC1E\uDC1F]|\uD873[\uDEA2-\uDEAF]|\uD87A[\uDFE1-\uDFFF]|\uD87E[\uDE1E-\uDFFF]|\uDB40[\uDC00\uDC02-\uDC1F\uDC80-\uDCFF\uDDF0-\uDFFF]|[\uDBBF\uDBFF][\uDFFE\uDFFF]' + }, + { + 'name': 'Co', + 'alias': 'Private_Use', + 'bmp': '\uE000-\uF8FF', + 'astral': '[\uDB80-\uDBBE\uDBC0-\uDBFE][\uDC00-\uDFFF]|[\uDBBF\uDBFF][\uDC00-\uDFFD]' + }, + { + 'name': 'Cs', + 'alias': 'Surrogate', + 'bmp': '\uD800-\uDFFF' + }, + { + 'name': 'L', + 'alias': 'Letter', + 'bmp': 'A-Za-z\xAA\xB5\xBA\xC0-\xD6\xD8-\xF6\xF8-\u02C1\u02C6-\u02D1\u02E0-\u02E4\u02EC\u02EE\u0370-\u0374\u0376\u0377\u037A-\u037D\u037F\u0386\u0388-\u038A\u038C\u038E-\u03A1\u03A3-\u03F5\u03F7-\u0481\u048A-\u052F\u0531-\u0556\u0559\u0560-\u0588\u05D0-\u05EA\u05EF-\u05F2\u0620-\u064A\u066E\u066F\u0671-\u06D3\u06D5\u06E5\u06E6\u06EE\u06EF\u06FA-\u06FC\u06FF\u0710\u0712-\u072F\u074D-\u07A5\u07B1\u07CA-\u07EA\u07F4\u07F5\u07FA\u0800-\u0815\u081A\u0824\u0828\u0840-\u0858\u0860-\u086A\u08A0-\u08B4\u08B6-\u08BD\u0904-\u0939\u093D\u0950\u0958-\u0961\u0971-\u0980\u0985-\u098C\u098F\u0990\u0993-\u09A8\u09AA-\u09B0\u09B2\u09B6-\u09B9\u09BD\u09CE\u09DC\u09DD\u09DF-\u09E1\u09F0\u09F1\u09FC\u0A05-\u0A0A\u0A0F\u0A10\u0A13-\u0A28\u0A2A-\u0A30\u0A32\u0A33\u0A35\u0A36\u0A38\u0A39\u0A59-\u0A5C\u0A5E\u0A72-\u0A74\u0A85-\u0A8D\u0A8F-\u0A91\u0A93-\u0AA8\u0AAA-\u0AB0\u0AB2\u0AB3\u0AB5-\u0AB9\u0ABD\u0AD0\u0AE0\u0AE1\u0AF9\u0B05-\u0B0C\u0B0F\u0B10\u0B13-\u0B28\u0B2A-\u0B30\u0B32\u0B33\u0B35-\u0B39\u0B3D\u0B5C\u0B5D\u0B5F-\u0B61\u0B71\u0B83\u0B85-\u0B8A\u0B8E-\u0B90\u0B92-\u0B95\u0B99\u0B9A\u0B9C\u0B9E\u0B9F\u0BA3\u0BA4\u0BA8-\u0BAA\u0BAE-\u0BB9\u0BD0\u0C05-\u0C0C\u0C0E-\u0C10\u0C12-\u0C28\u0C2A-\u0C39\u0C3D\u0C58-\u0C5A\u0C60\u0C61\u0C80\u0C85-\u0C8C\u0C8E-\u0C90\u0C92-\u0CA8\u0CAA-\u0CB3\u0CB5-\u0CB9\u0CBD\u0CDE\u0CE0\u0CE1\u0CF1\u0CF2\u0D05-\u0D0C\u0D0E-\u0D10\u0D12-\u0D3A\u0D3D\u0D4E\u0D54-\u0D56\u0D5F-\u0D61\u0D7A-\u0D7F\u0D85-\u0D96\u0D9A-\u0DB1\u0DB3-\u0DBB\u0DBD\u0DC0-\u0DC6\u0E01-\u0E30\u0E32\u0E33\u0E40-\u0E46\u0E81\u0E82\u0E84\u0E87\u0E88\u0E8A\u0E8D\u0E94-\u0E97\u0E99-\u0E9F\u0EA1-\u0EA3\u0EA5\u0EA7\u0EAA\u0EAB\u0EAD-\u0EB0\u0EB2\u0EB3\u0EBD\u0EC0-\u0EC4\u0EC6\u0EDC-\u0EDF\u0F00\u0F40-\u0F47\u0F49-\u0F6C\u0F88-\u0F8C\u1000-\u102A\u103F\u1050-\u1055\u105A-\u105D\u1061\u1065\u1066\u106E-\u1070\u1075-\u1081\u108E\u10A0-\u10C5\u10C7\u10CD\u10D0-\u10FA\u10FC-\u1248\u124A-\u124D\u1250-\u1256\u1258\u125A-\u125D\u1260-\u1288\u128A-\u128D\u1290-\u12B0\u12B2-\u12B5\u12B8-\u12BE\u12C0\u12C2-\u12C5\u12C8-\u12D6\u12D8-\u1310\u1312-\u1315\u1318-\u135A\u1380-\u138F\u13A0-\u13F5\u13F8-\u13FD\u1401-\u166C\u166F-\u167F\u1681-\u169A\u16A0-\u16EA\u16F1-\u16F8\u1700-\u170C\u170E-\u1711\u1720-\u1731\u1740-\u1751\u1760-\u176C\u176E-\u1770\u1780-\u17B3\u17D7\u17DC\u1820-\u1878\u1880-\u1884\u1887-\u18A8\u18AA\u18B0-\u18F5\u1900-\u191E\u1950-\u196D\u1970-\u1974\u1980-\u19AB\u19B0-\u19C9\u1A00-\u1A16\u1A20-\u1A54\u1AA7\u1B05-\u1B33\u1B45-\u1B4B\u1B83-\u1BA0\u1BAE\u1BAF\u1BBA-\u1BE5\u1C00-\u1C23\u1C4D-\u1C4F\u1C5A-\u1C7D\u1C80-\u1C88\u1C90-\u1CBA\u1CBD-\u1CBF\u1CE9-\u1CEC\u1CEE-\u1CF1\u1CF5\u1CF6\u1D00-\u1DBF\u1E00-\u1F15\u1F18-\u1F1D\u1F20-\u1F45\u1F48-\u1F4D\u1F50-\u1F57\u1F59\u1F5B\u1F5D\u1F5F-\u1F7D\u1F80-\u1FB4\u1FB6-\u1FBC\u1FBE\u1FC2-\u1FC4\u1FC6-\u1FCC\u1FD0-\u1FD3\u1FD6-\u1FDB\u1FE0-\u1FEC\u1FF2-\u1FF4\u1FF6-\u1FFC\u2071\u207F\u2090-\u209C\u2102\u2107\u210A-\u2113\u2115\u2119-\u211D\u2124\u2126\u2128\u212A-\u212D\u212F-\u2139\u213C-\u213F\u2145-\u2149\u214E\u2183\u2184\u2C00-\u2C2E\u2C30-\u2C5E\u2C60-\u2CE4\u2CEB-\u2CEE\u2CF2\u2CF3\u2D00-\u2D25\u2D27\u2D2D\u2D30-\u2D67\u2D6F\u2D80-\u2D96\u2DA0-\u2DA6\u2DA8-\u2DAE\u2DB0-\u2DB6\u2DB8-\u2DBE\u2DC0-\u2DC6\u2DC8-\u2DCE\u2DD0-\u2DD6\u2DD8-\u2DDE\u2E2F\u3005\u3006\u3031-\u3035\u303B\u303C\u3041-\u3096\u309D-\u309F\u30A1-\u30FA\u30FC-\u30FF\u3105-\u312F\u3131-\u318E\u31A0-\u31BA\u31F0-\u31FF\u3400-\u4DB5\u4E00-\u9FEF\uA000-\uA48C\uA4D0-\uA4FD\uA500-\uA60C\uA610-\uA61F\uA62A\uA62B\uA640-\uA66E\uA67F-\uA69D\uA6A0-\uA6E5\uA717-\uA71F\uA722-\uA788\uA78B-\uA7B9\uA7F7-\uA801\uA803-\uA805\uA807-\uA80A\uA80C-\uA822\uA840-\uA873\uA882-\uA8B3\uA8F2-\uA8F7\uA8FB\uA8FD\uA8FE\uA90A-\uA925\uA930-\uA946\uA960-\uA97C\uA984-\uA9B2\uA9CF\uA9E0-\uA9E4\uA9E6-\uA9EF\uA9FA-\uA9FE\uAA00-\uAA28\uAA40-\uAA42\uAA44-\uAA4B\uAA60-\uAA76\uAA7A\uAA7E-\uAAAF\uAAB1\uAAB5\uAAB6\uAAB9-\uAABD\uAAC0\uAAC2\uAADB-\uAADD\uAAE0-\uAAEA\uAAF2-\uAAF4\uAB01-\uAB06\uAB09-\uAB0E\uAB11-\uAB16\uAB20-\uAB26\uAB28-\uAB2E\uAB30-\uAB5A\uAB5C-\uAB65\uAB70-\uABE2\uAC00-\uD7A3\uD7B0-\uD7C6\uD7CB-\uD7FB\uF900-\uFA6D\uFA70-\uFAD9\uFB00-\uFB06\uFB13-\uFB17\uFB1D\uFB1F-\uFB28\uFB2A-\uFB36\uFB38-\uFB3C\uFB3E\uFB40\uFB41\uFB43\uFB44\uFB46-\uFBB1\uFBD3-\uFD3D\uFD50-\uFD8F\uFD92-\uFDC7\uFDF0-\uFDFB\uFE70-\uFE74\uFE76-\uFEFC\uFF21-\uFF3A\uFF41-\uFF5A\uFF66-\uFFBE\uFFC2-\uFFC7\uFFCA-\uFFCF\uFFD2-\uFFD7\uFFDA-\uFFDC', + 'astral': '\uD800[\uDC00-\uDC0B\uDC0D-\uDC26\uDC28-\uDC3A\uDC3C\uDC3D\uDC3F-\uDC4D\uDC50-\uDC5D\uDC80-\uDCFA\uDE80-\uDE9C\uDEA0-\uDED0\uDF00-\uDF1F\uDF2D-\uDF40\uDF42-\uDF49\uDF50-\uDF75\uDF80-\uDF9D\uDFA0-\uDFC3\uDFC8-\uDFCF]|\uD801[\uDC00-\uDC9D\uDCB0-\uDCD3\uDCD8-\uDCFB\uDD00-\uDD27\uDD30-\uDD63\uDE00-\uDF36\uDF40-\uDF55\uDF60-\uDF67]|\uD802[\uDC00-\uDC05\uDC08\uDC0A-\uDC35\uDC37\uDC38\uDC3C\uDC3F-\uDC55\uDC60-\uDC76\uDC80-\uDC9E\uDCE0-\uDCF2\uDCF4\uDCF5\uDD00-\uDD15\uDD20-\uDD39\uDD80-\uDDB7\uDDBE\uDDBF\uDE00\uDE10-\uDE13\uDE15-\uDE17\uDE19-\uDE35\uDE60-\uDE7C\uDE80-\uDE9C\uDEC0-\uDEC7\uDEC9-\uDEE4\uDF00-\uDF35\uDF40-\uDF55\uDF60-\uDF72\uDF80-\uDF91]|\uD803[\uDC00-\uDC48\uDC80-\uDCB2\uDCC0-\uDCF2\uDD00-\uDD23\uDF00-\uDF1C\uDF27\uDF30-\uDF45]|\uD804[\uDC03-\uDC37\uDC83-\uDCAF\uDCD0-\uDCE8\uDD03-\uDD26\uDD44\uDD50-\uDD72\uDD76\uDD83-\uDDB2\uDDC1-\uDDC4\uDDDA\uDDDC\uDE00-\uDE11\uDE13-\uDE2B\uDE80-\uDE86\uDE88\uDE8A-\uDE8D\uDE8F-\uDE9D\uDE9F-\uDEA8\uDEB0-\uDEDE\uDF05-\uDF0C\uDF0F\uDF10\uDF13-\uDF28\uDF2A-\uDF30\uDF32\uDF33\uDF35-\uDF39\uDF3D\uDF50\uDF5D-\uDF61]|\uD805[\uDC00-\uDC34\uDC47-\uDC4A\uDC80-\uDCAF\uDCC4\uDCC5\uDCC7\uDD80-\uDDAE\uDDD8-\uDDDB\uDE00-\uDE2F\uDE44\uDE80-\uDEAA\uDF00-\uDF1A]|\uD806[\uDC00-\uDC2B\uDCA0-\uDCDF\uDCFF\uDE00\uDE0B-\uDE32\uDE3A\uDE50\uDE5C-\uDE83\uDE86-\uDE89\uDE9D\uDEC0-\uDEF8]|\uD807[\uDC00-\uDC08\uDC0A-\uDC2E\uDC40\uDC72-\uDC8F\uDD00-\uDD06\uDD08\uDD09\uDD0B-\uDD30\uDD46\uDD60-\uDD65\uDD67\uDD68\uDD6A-\uDD89\uDD98\uDEE0-\uDEF2]|\uD808[\uDC00-\uDF99]|\uD809[\uDC80-\uDD43]|[\uD80C\uD81C-\uD820\uD840-\uD868\uD86A-\uD86C\uD86F-\uD872\uD874-\uD879][\uDC00-\uDFFF]|\uD80D[\uDC00-\uDC2E]|\uD811[\uDC00-\uDE46]|\uD81A[\uDC00-\uDE38\uDE40-\uDE5E\uDED0-\uDEED\uDF00-\uDF2F\uDF40-\uDF43\uDF63-\uDF77\uDF7D-\uDF8F]|\uD81B[\uDE40-\uDE7F\uDF00-\uDF44\uDF50\uDF93-\uDF9F\uDFE0\uDFE1]|\uD821[\uDC00-\uDFF1]|\uD822[\uDC00-\uDEF2]|\uD82C[\uDC00-\uDD1E\uDD70-\uDEFB]|\uD82F[\uDC00-\uDC6A\uDC70-\uDC7C\uDC80-\uDC88\uDC90-\uDC99]|\uD835[\uDC00-\uDC54\uDC56-\uDC9C\uDC9E\uDC9F\uDCA2\uDCA5\uDCA6\uDCA9-\uDCAC\uDCAE-\uDCB9\uDCBB\uDCBD-\uDCC3\uDCC5-\uDD05\uDD07-\uDD0A\uDD0D-\uDD14\uDD16-\uDD1C\uDD1E-\uDD39\uDD3B-\uDD3E\uDD40-\uDD44\uDD46\uDD4A-\uDD50\uDD52-\uDEA5\uDEA8-\uDEC0\uDEC2-\uDEDA\uDEDC-\uDEFA\uDEFC-\uDF14\uDF16-\uDF34\uDF36-\uDF4E\uDF50-\uDF6E\uDF70-\uDF88\uDF8A-\uDFA8\uDFAA-\uDFC2\uDFC4-\uDFCB]|\uD83A[\uDC00-\uDCC4\uDD00-\uDD43]|\uD83B[\uDE00-\uDE03\uDE05-\uDE1F\uDE21\uDE22\uDE24\uDE27\uDE29-\uDE32\uDE34-\uDE37\uDE39\uDE3B\uDE42\uDE47\uDE49\uDE4B\uDE4D-\uDE4F\uDE51\uDE52\uDE54\uDE57\uDE59\uDE5B\uDE5D\uDE5F\uDE61\uDE62\uDE64\uDE67-\uDE6A\uDE6C-\uDE72\uDE74-\uDE77\uDE79-\uDE7C\uDE7E\uDE80-\uDE89\uDE8B-\uDE9B\uDEA1-\uDEA3\uDEA5-\uDEA9\uDEAB-\uDEBB]|\uD869[\uDC00-\uDED6\uDF00-\uDFFF]|\uD86D[\uDC00-\uDF34\uDF40-\uDFFF]|\uD86E[\uDC00-\uDC1D\uDC20-\uDFFF]|\uD873[\uDC00-\uDEA1\uDEB0-\uDFFF]|\uD87A[\uDC00-\uDFE0]|\uD87E[\uDC00-\uDE1D]' + }, + { + 'name': 'LC', + 'alias': 'Cased_Letter', + 'bmp': 'A-Za-z\xB5\xC0-\xD6\xD8-\xF6\xF8-\u01BA\u01BC-\u01BF\u01C4-\u0293\u0295-\u02AF\u0370-\u0373\u0376\u0377\u037B-\u037D\u037F\u0386\u0388-\u038A\u038C\u038E-\u03A1\u03A3-\u03F5\u03F7-\u0481\u048A-\u052F\u0531-\u0556\u0560-\u0588\u10A0-\u10C5\u10C7\u10CD\u10D0-\u10FA\u10FD-\u10FF\u13A0-\u13F5\u13F8-\u13FD\u1C80-\u1C88\u1C90-\u1CBA\u1CBD-\u1CBF\u1D00-\u1D2B\u1D6B-\u1D77\u1D79-\u1D9A\u1E00-\u1F15\u1F18-\u1F1D\u1F20-\u1F45\u1F48-\u1F4D\u1F50-\u1F57\u1F59\u1F5B\u1F5D\u1F5F-\u1F7D\u1F80-\u1FB4\u1FB6-\u1FBC\u1FBE\u1FC2-\u1FC4\u1FC6-\u1FCC\u1FD0-\u1FD3\u1FD6-\u1FDB\u1FE0-\u1FEC\u1FF2-\u1FF4\u1FF6-\u1FFC\u2102\u2107\u210A-\u2113\u2115\u2119-\u211D\u2124\u2126\u2128\u212A-\u212D\u212F-\u2134\u2139\u213C-\u213F\u2145-\u2149\u214E\u2183\u2184\u2C00-\u2C2E\u2C30-\u2C5E\u2C60-\u2C7B\u2C7E-\u2CE4\u2CEB-\u2CEE\u2CF2\u2CF3\u2D00-\u2D25\u2D27\u2D2D\uA640-\uA66D\uA680-\uA69B\uA722-\uA76F\uA771-\uA787\uA78B-\uA78E\uA790-\uA7B9\uA7FA\uAB30-\uAB5A\uAB60-\uAB65\uAB70-\uABBF\uFB00-\uFB06\uFB13-\uFB17\uFF21-\uFF3A\uFF41-\uFF5A', + 'astral': '\uD801[\uDC00-\uDC4F\uDCB0-\uDCD3\uDCD8-\uDCFB]|\uD803[\uDC80-\uDCB2\uDCC0-\uDCF2]|\uD806[\uDCA0-\uDCDF]|\uD81B[\uDE40-\uDE7F]|\uD835[\uDC00-\uDC54\uDC56-\uDC9C\uDC9E\uDC9F\uDCA2\uDCA5\uDCA6\uDCA9-\uDCAC\uDCAE-\uDCB9\uDCBB\uDCBD-\uDCC3\uDCC5-\uDD05\uDD07-\uDD0A\uDD0D-\uDD14\uDD16-\uDD1C\uDD1E-\uDD39\uDD3B-\uDD3E\uDD40-\uDD44\uDD46\uDD4A-\uDD50\uDD52-\uDEA5\uDEA8-\uDEC0\uDEC2-\uDEDA\uDEDC-\uDEFA\uDEFC-\uDF14\uDF16-\uDF34\uDF36-\uDF4E\uDF50-\uDF6E\uDF70-\uDF88\uDF8A-\uDFA8\uDFAA-\uDFC2\uDFC4-\uDFCB]|\uD83A[\uDD00-\uDD43]' + }, + { + 'name': 'Ll', + 'alias': 'Lowercase_Letter', + 'bmp': 'a-z\xB5\xDF-\xF6\xF8-\xFF\u0101\u0103\u0105\u0107\u0109\u010B\u010D\u010F\u0111\u0113\u0115\u0117\u0119\u011B\u011D\u011F\u0121\u0123\u0125\u0127\u0129\u012B\u012D\u012F\u0131\u0133\u0135\u0137\u0138\u013A\u013C\u013E\u0140\u0142\u0144\u0146\u0148\u0149\u014B\u014D\u014F\u0151\u0153\u0155\u0157\u0159\u015B\u015D\u015F\u0161\u0163\u0165\u0167\u0169\u016B\u016D\u016F\u0171\u0173\u0175\u0177\u017A\u017C\u017E-\u0180\u0183\u0185\u0188\u018C\u018D\u0192\u0195\u0199-\u019B\u019E\u01A1\u01A3\u01A5\u01A8\u01AA\u01AB\u01AD\u01B0\u01B4\u01B6\u01B9\u01BA\u01BD-\u01BF\u01C6\u01C9\u01CC\u01CE\u01D0\u01D2\u01D4\u01D6\u01D8\u01DA\u01DC\u01DD\u01DF\u01E1\u01E3\u01E5\u01E7\u01E9\u01EB\u01ED\u01EF\u01F0\u01F3\u01F5\u01F9\u01FB\u01FD\u01FF\u0201\u0203\u0205\u0207\u0209\u020B\u020D\u020F\u0211\u0213\u0215\u0217\u0219\u021B\u021D\u021F\u0221\u0223\u0225\u0227\u0229\u022B\u022D\u022F\u0231\u0233-\u0239\u023C\u023F\u0240\u0242\u0247\u0249\u024B\u024D\u024F-\u0293\u0295-\u02AF\u0371\u0373\u0377\u037B-\u037D\u0390\u03AC-\u03CE\u03D0\u03D1\u03D5-\u03D7\u03D9\u03DB\u03DD\u03DF\u03E1\u03E3\u03E5\u03E7\u03E9\u03EB\u03ED\u03EF-\u03F3\u03F5\u03F8\u03FB\u03FC\u0430-\u045F\u0461\u0463\u0465\u0467\u0469\u046B\u046D\u046F\u0471\u0473\u0475\u0477\u0479\u047B\u047D\u047F\u0481\u048B\u048D\u048F\u0491\u0493\u0495\u0497\u0499\u049B\u049D\u049F\u04A1\u04A3\u04A5\u04A7\u04A9\u04AB\u04AD\u04AF\u04B1\u04B3\u04B5\u04B7\u04B9\u04BB\u04BD\u04BF\u04C2\u04C4\u04C6\u04C8\u04CA\u04CC\u04CE\u04CF\u04D1\u04D3\u04D5\u04D7\u04D9\u04DB\u04DD\u04DF\u04E1\u04E3\u04E5\u04E7\u04E9\u04EB\u04ED\u04EF\u04F1\u04F3\u04F5\u04F7\u04F9\u04FB\u04FD\u04FF\u0501\u0503\u0505\u0507\u0509\u050B\u050D\u050F\u0511\u0513\u0515\u0517\u0519\u051B\u051D\u051F\u0521\u0523\u0525\u0527\u0529\u052B\u052D\u052F\u0560-\u0588\u10D0-\u10FA\u10FD-\u10FF\u13F8-\u13FD\u1C80-\u1C88\u1D00-\u1D2B\u1D6B-\u1D77\u1D79-\u1D9A\u1E01\u1E03\u1E05\u1E07\u1E09\u1E0B\u1E0D\u1E0F\u1E11\u1E13\u1E15\u1E17\u1E19\u1E1B\u1E1D\u1E1F\u1E21\u1E23\u1E25\u1E27\u1E29\u1E2B\u1E2D\u1E2F\u1E31\u1E33\u1E35\u1E37\u1E39\u1E3B\u1E3D\u1E3F\u1E41\u1E43\u1E45\u1E47\u1E49\u1E4B\u1E4D\u1E4F\u1E51\u1E53\u1E55\u1E57\u1E59\u1E5B\u1E5D\u1E5F\u1E61\u1E63\u1E65\u1E67\u1E69\u1E6B\u1E6D\u1E6F\u1E71\u1E73\u1E75\u1E77\u1E79\u1E7B\u1E7D\u1E7F\u1E81\u1E83\u1E85\u1E87\u1E89\u1E8B\u1E8D\u1E8F\u1E91\u1E93\u1E95-\u1E9D\u1E9F\u1EA1\u1EA3\u1EA5\u1EA7\u1EA9\u1EAB\u1EAD\u1EAF\u1EB1\u1EB3\u1EB5\u1EB7\u1EB9\u1EBB\u1EBD\u1EBF\u1EC1\u1EC3\u1EC5\u1EC7\u1EC9\u1ECB\u1ECD\u1ECF\u1ED1\u1ED3\u1ED5\u1ED7\u1ED9\u1EDB\u1EDD\u1EDF\u1EE1\u1EE3\u1EE5\u1EE7\u1EE9\u1EEB\u1EED\u1EEF\u1EF1\u1EF3\u1EF5\u1EF7\u1EF9\u1EFB\u1EFD\u1EFF-\u1F07\u1F10-\u1F15\u1F20-\u1F27\u1F30-\u1F37\u1F40-\u1F45\u1F50-\u1F57\u1F60-\u1F67\u1F70-\u1F7D\u1F80-\u1F87\u1F90-\u1F97\u1FA0-\u1FA7\u1FB0-\u1FB4\u1FB6\u1FB7\u1FBE\u1FC2-\u1FC4\u1FC6\u1FC7\u1FD0-\u1FD3\u1FD6\u1FD7\u1FE0-\u1FE7\u1FF2-\u1FF4\u1FF6\u1FF7\u210A\u210E\u210F\u2113\u212F\u2134\u2139\u213C\u213D\u2146-\u2149\u214E\u2184\u2C30-\u2C5E\u2C61\u2C65\u2C66\u2C68\u2C6A\u2C6C\u2C71\u2C73\u2C74\u2C76-\u2C7B\u2C81\u2C83\u2C85\u2C87\u2C89\u2C8B\u2C8D\u2C8F\u2C91\u2C93\u2C95\u2C97\u2C99\u2C9B\u2C9D\u2C9F\u2CA1\u2CA3\u2CA5\u2CA7\u2CA9\u2CAB\u2CAD\u2CAF\u2CB1\u2CB3\u2CB5\u2CB7\u2CB9\u2CBB\u2CBD\u2CBF\u2CC1\u2CC3\u2CC5\u2CC7\u2CC9\u2CCB\u2CCD\u2CCF\u2CD1\u2CD3\u2CD5\u2CD7\u2CD9\u2CDB\u2CDD\u2CDF\u2CE1\u2CE3\u2CE4\u2CEC\u2CEE\u2CF3\u2D00-\u2D25\u2D27\u2D2D\uA641\uA643\uA645\uA647\uA649\uA64B\uA64D\uA64F\uA651\uA653\uA655\uA657\uA659\uA65B\uA65D\uA65F\uA661\uA663\uA665\uA667\uA669\uA66B\uA66D\uA681\uA683\uA685\uA687\uA689\uA68B\uA68D\uA68F\uA691\uA693\uA695\uA697\uA699\uA69B\uA723\uA725\uA727\uA729\uA72B\uA72D\uA72F-\uA731\uA733\uA735\uA737\uA739\uA73B\uA73D\uA73F\uA741\uA743\uA745\uA747\uA749\uA74B\uA74D\uA74F\uA751\uA753\uA755\uA757\uA759\uA75B\uA75D\uA75F\uA761\uA763\uA765\uA767\uA769\uA76B\uA76D\uA76F\uA771-\uA778\uA77A\uA77C\uA77F\uA781\uA783\uA785\uA787\uA78C\uA78E\uA791\uA793-\uA795\uA797\uA799\uA79B\uA79D\uA79F\uA7A1\uA7A3\uA7A5\uA7A7\uA7A9\uA7AF\uA7B5\uA7B7\uA7B9\uA7FA\uAB30-\uAB5A\uAB60-\uAB65\uAB70-\uABBF\uFB00-\uFB06\uFB13-\uFB17\uFF41-\uFF5A', + 'astral': '\uD801[\uDC28-\uDC4F\uDCD8-\uDCFB]|\uD803[\uDCC0-\uDCF2]|\uD806[\uDCC0-\uDCDF]|\uD81B[\uDE60-\uDE7F]|\uD835[\uDC1A-\uDC33\uDC4E-\uDC54\uDC56-\uDC67\uDC82-\uDC9B\uDCB6-\uDCB9\uDCBB\uDCBD-\uDCC3\uDCC5-\uDCCF\uDCEA-\uDD03\uDD1E-\uDD37\uDD52-\uDD6B\uDD86-\uDD9F\uDDBA-\uDDD3\uDDEE-\uDE07\uDE22-\uDE3B\uDE56-\uDE6F\uDE8A-\uDEA5\uDEC2-\uDEDA\uDEDC-\uDEE1\uDEFC-\uDF14\uDF16-\uDF1B\uDF36-\uDF4E\uDF50-\uDF55\uDF70-\uDF88\uDF8A-\uDF8F\uDFAA-\uDFC2\uDFC4-\uDFC9\uDFCB]|\uD83A[\uDD22-\uDD43]' + }, + { + 'name': 'Lm', + 'alias': 'Modifier_Letter', + 'bmp': '\u02B0-\u02C1\u02C6-\u02D1\u02E0-\u02E4\u02EC\u02EE\u0374\u037A\u0559\u0640\u06E5\u06E6\u07F4\u07F5\u07FA\u081A\u0824\u0828\u0971\u0E46\u0EC6\u10FC\u17D7\u1843\u1AA7\u1C78-\u1C7D\u1D2C-\u1D6A\u1D78\u1D9B-\u1DBF\u2071\u207F\u2090-\u209C\u2C7C\u2C7D\u2D6F\u2E2F\u3005\u3031-\u3035\u303B\u309D\u309E\u30FC-\u30FE\uA015\uA4F8-\uA4FD\uA60C\uA67F\uA69C\uA69D\uA717-\uA71F\uA770\uA788\uA7F8\uA7F9\uA9CF\uA9E6\uAA70\uAADD\uAAF3\uAAF4\uAB5C-\uAB5F\uFF70\uFF9E\uFF9F', + 'astral': '\uD81A[\uDF40-\uDF43]|\uD81B[\uDF93-\uDF9F\uDFE0\uDFE1]' + }, + { + 'name': 'Lo', + 'alias': 'Other_Letter', + 'bmp': '\xAA\xBA\u01BB\u01C0-\u01C3\u0294\u05D0-\u05EA\u05EF-\u05F2\u0620-\u063F\u0641-\u064A\u066E\u066F\u0671-\u06D3\u06D5\u06EE\u06EF\u06FA-\u06FC\u06FF\u0710\u0712-\u072F\u074D-\u07A5\u07B1\u07CA-\u07EA\u0800-\u0815\u0840-\u0858\u0860-\u086A\u08A0-\u08B4\u08B6-\u08BD\u0904-\u0939\u093D\u0950\u0958-\u0961\u0972-\u0980\u0985-\u098C\u098F\u0990\u0993-\u09A8\u09AA-\u09B0\u09B2\u09B6-\u09B9\u09BD\u09CE\u09DC\u09DD\u09DF-\u09E1\u09F0\u09F1\u09FC\u0A05-\u0A0A\u0A0F\u0A10\u0A13-\u0A28\u0A2A-\u0A30\u0A32\u0A33\u0A35\u0A36\u0A38\u0A39\u0A59-\u0A5C\u0A5E\u0A72-\u0A74\u0A85-\u0A8D\u0A8F-\u0A91\u0A93-\u0AA8\u0AAA-\u0AB0\u0AB2\u0AB3\u0AB5-\u0AB9\u0ABD\u0AD0\u0AE0\u0AE1\u0AF9\u0B05-\u0B0C\u0B0F\u0B10\u0B13-\u0B28\u0B2A-\u0B30\u0B32\u0B33\u0B35-\u0B39\u0B3D\u0B5C\u0B5D\u0B5F-\u0B61\u0B71\u0B83\u0B85-\u0B8A\u0B8E-\u0B90\u0B92-\u0B95\u0B99\u0B9A\u0B9C\u0B9E\u0B9F\u0BA3\u0BA4\u0BA8-\u0BAA\u0BAE-\u0BB9\u0BD0\u0C05-\u0C0C\u0C0E-\u0C10\u0C12-\u0C28\u0C2A-\u0C39\u0C3D\u0C58-\u0C5A\u0C60\u0C61\u0C80\u0C85-\u0C8C\u0C8E-\u0C90\u0C92-\u0CA8\u0CAA-\u0CB3\u0CB5-\u0CB9\u0CBD\u0CDE\u0CE0\u0CE1\u0CF1\u0CF2\u0D05-\u0D0C\u0D0E-\u0D10\u0D12-\u0D3A\u0D3D\u0D4E\u0D54-\u0D56\u0D5F-\u0D61\u0D7A-\u0D7F\u0D85-\u0D96\u0D9A-\u0DB1\u0DB3-\u0DBB\u0DBD\u0DC0-\u0DC6\u0E01-\u0E30\u0E32\u0E33\u0E40-\u0E45\u0E81\u0E82\u0E84\u0E87\u0E88\u0E8A\u0E8D\u0E94-\u0E97\u0E99-\u0E9F\u0EA1-\u0EA3\u0EA5\u0EA7\u0EAA\u0EAB\u0EAD-\u0EB0\u0EB2\u0EB3\u0EBD\u0EC0-\u0EC4\u0EDC-\u0EDF\u0F00\u0F40-\u0F47\u0F49-\u0F6C\u0F88-\u0F8C\u1000-\u102A\u103F\u1050-\u1055\u105A-\u105D\u1061\u1065\u1066\u106E-\u1070\u1075-\u1081\u108E\u1100-\u1248\u124A-\u124D\u1250-\u1256\u1258\u125A-\u125D\u1260-\u1288\u128A-\u128D\u1290-\u12B0\u12B2-\u12B5\u12B8-\u12BE\u12C0\u12C2-\u12C5\u12C8-\u12D6\u12D8-\u1310\u1312-\u1315\u1318-\u135A\u1380-\u138F\u1401-\u166C\u166F-\u167F\u1681-\u169A\u16A0-\u16EA\u16F1-\u16F8\u1700-\u170C\u170E-\u1711\u1720-\u1731\u1740-\u1751\u1760-\u176C\u176E-\u1770\u1780-\u17B3\u17DC\u1820-\u1842\u1844-\u1878\u1880-\u1884\u1887-\u18A8\u18AA\u18B0-\u18F5\u1900-\u191E\u1950-\u196D\u1970-\u1974\u1980-\u19AB\u19B0-\u19C9\u1A00-\u1A16\u1A20-\u1A54\u1B05-\u1B33\u1B45-\u1B4B\u1B83-\u1BA0\u1BAE\u1BAF\u1BBA-\u1BE5\u1C00-\u1C23\u1C4D-\u1C4F\u1C5A-\u1C77\u1CE9-\u1CEC\u1CEE-\u1CF1\u1CF5\u1CF6\u2135-\u2138\u2D30-\u2D67\u2D80-\u2D96\u2DA0-\u2DA6\u2DA8-\u2DAE\u2DB0-\u2DB6\u2DB8-\u2DBE\u2DC0-\u2DC6\u2DC8-\u2DCE\u2DD0-\u2DD6\u2DD8-\u2DDE\u3006\u303C\u3041-\u3096\u309F\u30A1-\u30FA\u30FF\u3105-\u312F\u3131-\u318E\u31A0-\u31BA\u31F0-\u31FF\u3400-\u4DB5\u4E00-\u9FEF\uA000-\uA014\uA016-\uA48C\uA4D0-\uA4F7\uA500-\uA60B\uA610-\uA61F\uA62A\uA62B\uA66E\uA6A0-\uA6E5\uA78F\uA7F7\uA7FB-\uA801\uA803-\uA805\uA807-\uA80A\uA80C-\uA822\uA840-\uA873\uA882-\uA8B3\uA8F2-\uA8F7\uA8FB\uA8FD\uA8FE\uA90A-\uA925\uA930-\uA946\uA960-\uA97C\uA984-\uA9B2\uA9E0-\uA9E4\uA9E7-\uA9EF\uA9FA-\uA9FE\uAA00-\uAA28\uAA40-\uAA42\uAA44-\uAA4B\uAA60-\uAA6F\uAA71-\uAA76\uAA7A\uAA7E-\uAAAF\uAAB1\uAAB5\uAAB6\uAAB9-\uAABD\uAAC0\uAAC2\uAADB\uAADC\uAAE0-\uAAEA\uAAF2\uAB01-\uAB06\uAB09-\uAB0E\uAB11-\uAB16\uAB20-\uAB26\uAB28-\uAB2E\uABC0-\uABE2\uAC00-\uD7A3\uD7B0-\uD7C6\uD7CB-\uD7FB\uF900-\uFA6D\uFA70-\uFAD9\uFB1D\uFB1F-\uFB28\uFB2A-\uFB36\uFB38-\uFB3C\uFB3E\uFB40\uFB41\uFB43\uFB44\uFB46-\uFBB1\uFBD3-\uFD3D\uFD50-\uFD8F\uFD92-\uFDC7\uFDF0-\uFDFB\uFE70-\uFE74\uFE76-\uFEFC\uFF66-\uFF6F\uFF71-\uFF9D\uFFA0-\uFFBE\uFFC2-\uFFC7\uFFCA-\uFFCF\uFFD2-\uFFD7\uFFDA-\uFFDC', + 'astral': '\uD800[\uDC00-\uDC0B\uDC0D-\uDC26\uDC28-\uDC3A\uDC3C\uDC3D\uDC3F-\uDC4D\uDC50-\uDC5D\uDC80-\uDCFA\uDE80-\uDE9C\uDEA0-\uDED0\uDF00-\uDF1F\uDF2D-\uDF40\uDF42-\uDF49\uDF50-\uDF75\uDF80-\uDF9D\uDFA0-\uDFC3\uDFC8-\uDFCF]|\uD801[\uDC50-\uDC9D\uDD00-\uDD27\uDD30-\uDD63\uDE00-\uDF36\uDF40-\uDF55\uDF60-\uDF67]|\uD802[\uDC00-\uDC05\uDC08\uDC0A-\uDC35\uDC37\uDC38\uDC3C\uDC3F-\uDC55\uDC60-\uDC76\uDC80-\uDC9E\uDCE0-\uDCF2\uDCF4\uDCF5\uDD00-\uDD15\uDD20-\uDD39\uDD80-\uDDB7\uDDBE\uDDBF\uDE00\uDE10-\uDE13\uDE15-\uDE17\uDE19-\uDE35\uDE60-\uDE7C\uDE80-\uDE9C\uDEC0-\uDEC7\uDEC9-\uDEE4\uDF00-\uDF35\uDF40-\uDF55\uDF60-\uDF72\uDF80-\uDF91]|\uD803[\uDC00-\uDC48\uDD00-\uDD23\uDF00-\uDF1C\uDF27\uDF30-\uDF45]|\uD804[\uDC03-\uDC37\uDC83-\uDCAF\uDCD0-\uDCE8\uDD03-\uDD26\uDD44\uDD50-\uDD72\uDD76\uDD83-\uDDB2\uDDC1-\uDDC4\uDDDA\uDDDC\uDE00-\uDE11\uDE13-\uDE2B\uDE80-\uDE86\uDE88\uDE8A-\uDE8D\uDE8F-\uDE9D\uDE9F-\uDEA8\uDEB0-\uDEDE\uDF05-\uDF0C\uDF0F\uDF10\uDF13-\uDF28\uDF2A-\uDF30\uDF32\uDF33\uDF35-\uDF39\uDF3D\uDF50\uDF5D-\uDF61]|\uD805[\uDC00-\uDC34\uDC47-\uDC4A\uDC80-\uDCAF\uDCC4\uDCC5\uDCC7\uDD80-\uDDAE\uDDD8-\uDDDB\uDE00-\uDE2F\uDE44\uDE80-\uDEAA\uDF00-\uDF1A]|\uD806[\uDC00-\uDC2B\uDCFF\uDE00\uDE0B-\uDE32\uDE3A\uDE50\uDE5C-\uDE83\uDE86-\uDE89\uDE9D\uDEC0-\uDEF8]|\uD807[\uDC00-\uDC08\uDC0A-\uDC2E\uDC40\uDC72-\uDC8F\uDD00-\uDD06\uDD08\uDD09\uDD0B-\uDD30\uDD46\uDD60-\uDD65\uDD67\uDD68\uDD6A-\uDD89\uDD98\uDEE0-\uDEF2]|\uD808[\uDC00-\uDF99]|\uD809[\uDC80-\uDD43]|[\uD80C\uD81C-\uD820\uD840-\uD868\uD86A-\uD86C\uD86F-\uD872\uD874-\uD879][\uDC00-\uDFFF]|\uD80D[\uDC00-\uDC2E]|\uD811[\uDC00-\uDE46]|\uD81A[\uDC00-\uDE38\uDE40-\uDE5E\uDED0-\uDEED\uDF00-\uDF2F\uDF63-\uDF77\uDF7D-\uDF8F]|\uD81B[\uDF00-\uDF44\uDF50]|\uD821[\uDC00-\uDFF1]|\uD822[\uDC00-\uDEF2]|\uD82C[\uDC00-\uDD1E\uDD70-\uDEFB]|\uD82F[\uDC00-\uDC6A\uDC70-\uDC7C\uDC80-\uDC88\uDC90-\uDC99]|\uD83A[\uDC00-\uDCC4]|\uD83B[\uDE00-\uDE03\uDE05-\uDE1F\uDE21\uDE22\uDE24\uDE27\uDE29-\uDE32\uDE34-\uDE37\uDE39\uDE3B\uDE42\uDE47\uDE49\uDE4B\uDE4D-\uDE4F\uDE51\uDE52\uDE54\uDE57\uDE59\uDE5B\uDE5D\uDE5F\uDE61\uDE62\uDE64\uDE67-\uDE6A\uDE6C-\uDE72\uDE74-\uDE77\uDE79-\uDE7C\uDE7E\uDE80-\uDE89\uDE8B-\uDE9B\uDEA1-\uDEA3\uDEA5-\uDEA9\uDEAB-\uDEBB]|\uD869[\uDC00-\uDED6\uDF00-\uDFFF]|\uD86D[\uDC00-\uDF34\uDF40-\uDFFF]|\uD86E[\uDC00-\uDC1D\uDC20-\uDFFF]|\uD873[\uDC00-\uDEA1\uDEB0-\uDFFF]|\uD87A[\uDC00-\uDFE0]|\uD87E[\uDC00-\uDE1D]' + }, + { + 'name': 'Lt', + 'alias': 'Titlecase_Letter', + 'bmp': '\u01C5\u01C8\u01CB\u01F2\u1F88-\u1F8F\u1F98-\u1F9F\u1FA8-\u1FAF\u1FBC\u1FCC\u1FFC' + }, + { + 'name': 'Lu', + 'alias': 'Uppercase_Letter', + 'bmp': 'A-Z\xC0-\xD6\xD8-\xDE\u0100\u0102\u0104\u0106\u0108\u010A\u010C\u010E\u0110\u0112\u0114\u0116\u0118\u011A\u011C\u011E\u0120\u0122\u0124\u0126\u0128\u012A\u012C\u012E\u0130\u0132\u0134\u0136\u0139\u013B\u013D\u013F\u0141\u0143\u0145\u0147\u014A\u014C\u014E\u0150\u0152\u0154\u0156\u0158\u015A\u015C\u015E\u0160\u0162\u0164\u0166\u0168\u016A\u016C\u016E\u0170\u0172\u0174\u0176\u0178\u0179\u017B\u017D\u0181\u0182\u0184\u0186\u0187\u0189-\u018B\u018E-\u0191\u0193\u0194\u0196-\u0198\u019C\u019D\u019F\u01A0\u01A2\u01A4\u01A6\u01A7\u01A9\u01AC\u01AE\u01AF\u01B1-\u01B3\u01B5\u01B7\u01B8\u01BC\u01C4\u01C7\u01CA\u01CD\u01CF\u01D1\u01D3\u01D5\u01D7\u01D9\u01DB\u01DE\u01E0\u01E2\u01E4\u01E6\u01E8\u01EA\u01EC\u01EE\u01F1\u01F4\u01F6-\u01F8\u01FA\u01FC\u01FE\u0200\u0202\u0204\u0206\u0208\u020A\u020C\u020E\u0210\u0212\u0214\u0216\u0218\u021A\u021C\u021E\u0220\u0222\u0224\u0226\u0228\u022A\u022C\u022E\u0230\u0232\u023A\u023B\u023D\u023E\u0241\u0243-\u0246\u0248\u024A\u024C\u024E\u0370\u0372\u0376\u037F\u0386\u0388-\u038A\u038C\u038E\u038F\u0391-\u03A1\u03A3-\u03AB\u03CF\u03D2-\u03D4\u03D8\u03DA\u03DC\u03DE\u03E0\u03E2\u03E4\u03E6\u03E8\u03EA\u03EC\u03EE\u03F4\u03F7\u03F9\u03FA\u03FD-\u042F\u0460\u0462\u0464\u0466\u0468\u046A\u046C\u046E\u0470\u0472\u0474\u0476\u0478\u047A\u047C\u047E\u0480\u048A\u048C\u048E\u0490\u0492\u0494\u0496\u0498\u049A\u049C\u049E\u04A0\u04A2\u04A4\u04A6\u04A8\u04AA\u04AC\u04AE\u04B0\u04B2\u04B4\u04B6\u04B8\u04BA\u04BC\u04BE\u04C0\u04C1\u04C3\u04C5\u04C7\u04C9\u04CB\u04CD\u04D0\u04D2\u04D4\u04D6\u04D8\u04DA\u04DC\u04DE\u04E0\u04E2\u04E4\u04E6\u04E8\u04EA\u04EC\u04EE\u04F0\u04F2\u04F4\u04F6\u04F8\u04FA\u04FC\u04FE\u0500\u0502\u0504\u0506\u0508\u050A\u050C\u050E\u0510\u0512\u0514\u0516\u0518\u051A\u051C\u051E\u0520\u0522\u0524\u0526\u0528\u052A\u052C\u052E\u0531-\u0556\u10A0-\u10C5\u10C7\u10CD\u13A0-\u13F5\u1C90-\u1CBA\u1CBD-\u1CBF\u1E00\u1E02\u1E04\u1E06\u1E08\u1E0A\u1E0C\u1E0E\u1E10\u1E12\u1E14\u1E16\u1E18\u1E1A\u1E1C\u1E1E\u1E20\u1E22\u1E24\u1E26\u1E28\u1E2A\u1E2C\u1E2E\u1E30\u1E32\u1E34\u1E36\u1E38\u1E3A\u1E3C\u1E3E\u1E40\u1E42\u1E44\u1E46\u1E48\u1E4A\u1E4C\u1E4E\u1E50\u1E52\u1E54\u1E56\u1E58\u1E5A\u1E5C\u1E5E\u1E60\u1E62\u1E64\u1E66\u1E68\u1E6A\u1E6C\u1E6E\u1E70\u1E72\u1E74\u1E76\u1E78\u1E7A\u1E7C\u1E7E\u1E80\u1E82\u1E84\u1E86\u1E88\u1E8A\u1E8C\u1E8E\u1E90\u1E92\u1E94\u1E9E\u1EA0\u1EA2\u1EA4\u1EA6\u1EA8\u1EAA\u1EAC\u1EAE\u1EB0\u1EB2\u1EB4\u1EB6\u1EB8\u1EBA\u1EBC\u1EBE\u1EC0\u1EC2\u1EC4\u1EC6\u1EC8\u1ECA\u1ECC\u1ECE\u1ED0\u1ED2\u1ED4\u1ED6\u1ED8\u1EDA\u1EDC\u1EDE\u1EE0\u1EE2\u1EE4\u1EE6\u1EE8\u1EEA\u1EEC\u1EEE\u1EF0\u1EF2\u1EF4\u1EF6\u1EF8\u1EFA\u1EFC\u1EFE\u1F08-\u1F0F\u1F18-\u1F1D\u1F28-\u1F2F\u1F38-\u1F3F\u1F48-\u1F4D\u1F59\u1F5B\u1F5D\u1F5F\u1F68-\u1F6F\u1FB8-\u1FBB\u1FC8-\u1FCB\u1FD8-\u1FDB\u1FE8-\u1FEC\u1FF8-\u1FFB\u2102\u2107\u210B-\u210D\u2110-\u2112\u2115\u2119-\u211D\u2124\u2126\u2128\u212A-\u212D\u2130-\u2133\u213E\u213F\u2145\u2183\u2C00-\u2C2E\u2C60\u2C62-\u2C64\u2C67\u2C69\u2C6B\u2C6D-\u2C70\u2C72\u2C75\u2C7E-\u2C80\u2C82\u2C84\u2C86\u2C88\u2C8A\u2C8C\u2C8E\u2C90\u2C92\u2C94\u2C96\u2C98\u2C9A\u2C9C\u2C9E\u2CA0\u2CA2\u2CA4\u2CA6\u2CA8\u2CAA\u2CAC\u2CAE\u2CB0\u2CB2\u2CB4\u2CB6\u2CB8\u2CBA\u2CBC\u2CBE\u2CC0\u2CC2\u2CC4\u2CC6\u2CC8\u2CCA\u2CCC\u2CCE\u2CD0\u2CD2\u2CD4\u2CD6\u2CD8\u2CDA\u2CDC\u2CDE\u2CE0\u2CE2\u2CEB\u2CED\u2CF2\uA640\uA642\uA644\uA646\uA648\uA64A\uA64C\uA64E\uA650\uA652\uA654\uA656\uA658\uA65A\uA65C\uA65E\uA660\uA662\uA664\uA666\uA668\uA66A\uA66C\uA680\uA682\uA684\uA686\uA688\uA68A\uA68C\uA68E\uA690\uA692\uA694\uA696\uA698\uA69A\uA722\uA724\uA726\uA728\uA72A\uA72C\uA72E\uA732\uA734\uA736\uA738\uA73A\uA73C\uA73E\uA740\uA742\uA744\uA746\uA748\uA74A\uA74C\uA74E\uA750\uA752\uA754\uA756\uA758\uA75A\uA75C\uA75E\uA760\uA762\uA764\uA766\uA768\uA76A\uA76C\uA76E\uA779\uA77B\uA77D\uA77E\uA780\uA782\uA784\uA786\uA78B\uA78D\uA790\uA792\uA796\uA798\uA79A\uA79C\uA79E\uA7A0\uA7A2\uA7A4\uA7A6\uA7A8\uA7AA-\uA7AE\uA7B0-\uA7B4\uA7B6\uA7B8\uFF21-\uFF3A', + 'astral': '\uD801[\uDC00-\uDC27\uDCB0-\uDCD3]|\uD803[\uDC80-\uDCB2]|\uD806[\uDCA0-\uDCBF]|\uD81B[\uDE40-\uDE5F]|\uD835[\uDC00-\uDC19\uDC34-\uDC4D\uDC68-\uDC81\uDC9C\uDC9E\uDC9F\uDCA2\uDCA5\uDCA6\uDCA9-\uDCAC\uDCAE-\uDCB5\uDCD0-\uDCE9\uDD04\uDD05\uDD07-\uDD0A\uDD0D-\uDD14\uDD16-\uDD1C\uDD38\uDD39\uDD3B-\uDD3E\uDD40-\uDD44\uDD46\uDD4A-\uDD50\uDD6C-\uDD85\uDDA0-\uDDB9\uDDD4-\uDDED\uDE08-\uDE21\uDE3C-\uDE55\uDE70-\uDE89\uDEA8-\uDEC0\uDEE2-\uDEFA\uDF1C-\uDF34\uDF56-\uDF6E\uDF90-\uDFA8\uDFCA]|\uD83A[\uDD00-\uDD21]' + }, + { + 'name': 'M', + 'alias': 'Mark', + 'bmp': '\u0300-\u036F\u0483-\u0489\u0591-\u05BD\u05BF\u05C1\u05C2\u05C4\u05C5\u05C7\u0610-\u061A\u064B-\u065F\u0670\u06D6-\u06DC\u06DF-\u06E4\u06E7\u06E8\u06EA-\u06ED\u0711\u0730-\u074A\u07A6-\u07B0\u07EB-\u07F3\u07FD\u0816-\u0819\u081B-\u0823\u0825-\u0827\u0829-\u082D\u0859-\u085B\u08D3-\u08E1\u08E3-\u0903\u093A-\u093C\u093E-\u094F\u0951-\u0957\u0962\u0963\u0981-\u0983\u09BC\u09BE-\u09C4\u09C7\u09C8\u09CB-\u09CD\u09D7\u09E2\u09E3\u09FE\u0A01-\u0A03\u0A3C\u0A3E-\u0A42\u0A47\u0A48\u0A4B-\u0A4D\u0A51\u0A70\u0A71\u0A75\u0A81-\u0A83\u0ABC\u0ABE-\u0AC5\u0AC7-\u0AC9\u0ACB-\u0ACD\u0AE2\u0AE3\u0AFA-\u0AFF\u0B01-\u0B03\u0B3C\u0B3E-\u0B44\u0B47\u0B48\u0B4B-\u0B4D\u0B56\u0B57\u0B62\u0B63\u0B82\u0BBE-\u0BC2\u0BC6-\u0BC8\u0BCA-\u0BCD\u0BD7\u0C00-\u0C04\u0C3E-\u0C44\u0C46-\u0C48\u0C4A-\u0C4D\u0C55\u0C56\u0C62\u0C63\u0C81-\u0C83\u0CBC\u0CBE-\u0CC4\u0CC6-\u0CC8\u0CCA-\u0CCD\u0CD5\u0CD6\u0CE2\u0CE3\u0D00-\u0D03\u0D3B\u0D3C\u0D3E-\u0D44\u0D46-\u0D48\u0D4A-\u0D4D\u0D57\u0D62\u0D63\u0D82\u0D83\u0DCA\u0DCF-\u0DD4\u0DD6\u0DD8-\u0DDF\u0DF2\u0DF3\u0E31\u0E34-\u0E3A\u0E47-\u0E4E\u0EB1\u0EB4-\u0EB9\u0EBB\u0EBC\u0EC8-\u0ECD\u0F18\u0F19\u0F35\u0F37\u0F39\u0F3E\u0F3F\u0F71-\u0F84\u0F86\u0F87\u0F8D-\u0F97\u0F99-\u0FBC\u0FC6\u102B-\u103E\u1056-\u1059\u105E-\u1060\u1062-\u1064\u1067-\u106D\u1071-\u1074\u1082-\u108D\u108F\u109A-\u109D\u135D-\u135F\u1712-\u1714\u1732-\u1734\u1752\u1753\u1772\u1773\u17B4-\u17D3\u17DD\u180B-\u180D\u1885\u1886\u18A9\u1920-\u192B\u1930-\u193B\u1A17-\u1A1B\u1A55-\u1A5E\u1A60-\u1A7C\u1A7F\u1AB0-\u1ABE\u1B00-\u1B04\u1B34-\u1B44\u1B6B-\u1B73\u1B80-\u1B82\u1BA1-\u1BAD\u1BE6-\u1BF3\u1C24-\u1C37\u1CD0-\u1CD2\u1CD4-\u1CE8\u1CED\u1CF2-\u1CF4\u1CF7-\u1CF9\u1DC0-\u1DF9\u1DFB-\u1DFF\u20D0-\u20F0\u2CEF-\u2CF1\u2D7F\u2DE0-\u2DFF\u302A-\u302F\u3099\u309A\uA66F-\uA672\uA674-\uA67D\uA69E\uA69F\uA6F0\uA6F1\uA802\uA806\uA80B\uA823-\uA827\uA880\uA881\uA8B4-\uA8C5\uA8E0-\uA8F1\uA8FF\uA926-\uA92D\uA947-\uA953\uA980-\uA983\uA9B3-\uA9C0\uA9E5\uAA29-\uAA36\uAA43\uAA4C\uAA4D\uAA7B-\uAA7D\uAAB0\uAAB2-\uAAB4\uAAB7\uAAB8\uAABE\uAABF\uAAC1\uAAEB-\uAAEF\uAAF5\uAAF6\uABE3-\uABEA\uABEC\uABED\uFB1E\uFE00-\uFE0F\uFE20-\uFE2F', + 'astral': '\uD800[\uDDFD\uDEE0\uDF76-\uDF7A]|\uD802[\uDE01-\uDE03\uDE05\uDE06\uDE0C-\uDE0F\uDE38-\uDE3A\uDE3F\uDEE5\uDEE6]|\uD803[\uDD24-\uDD27\uDF46-\uDF50]|\uD804[\uDC00-\uDC02\uDC38-\uDC46\uDC7F-\uDC82\uDCB0-\uDCBA\uDD00-\uDD02\uDD27-\uDD34\uDD45\uDD46\uDD73\uDD80-\uDD82\uDDB3-\uDDC0\uDDC9-\uDDCC\uDE2C-\uDE37\uDE3E\uDEDF-\uDEEA\uDF00-\uDF03\uDF3B\uDF3C\uDF3E-\uDF44\uDF47\uDF48\uDF4B-\uDF4D\uDF57\uDF62\uDF63\uDF66-\uDF6C\uDF70-\uDF74]|\uD805[\uDC35-\uDC46\uDC5E\uDCB0-\uDCC3\uDDAF-\uDDB5\uDDB8-\uDDC0\uDDDC\uDDDD\uDE30-\uDE40\uDEAB-\uDEB7\uDF1D-\uDF2B]|\uD806[\uDC2C-\uDC3A\uDE01-\uDE0A\uDE33-\uDE39\uDE3B-\uDE3E\uDE47\uDE51-\uDE5B\uDE8A-\uDE99]|\uD807[\uDC2F-\uDC36\uDC38-\uDC3F\uDC92-\uDCA7\uDCA9-\uDCB6\uDD31-\uDD36\uDD3A\uDD3C\uDD3D\uDD3F-\uDD45\uDD47\uDD8A-\uDD8E\uDD90\uDD91\uDD93-\uDD97\uDEF3-\uDEF6]|\uD81A[\uDEF0-\uDEF4\uDF30-\uDF36]|\uD81B[\uDF51-\uDF7E\uDF8F-\uDF92]|\uD82F[\uDC9D\uDC9E]|\uD834[\uDD65-\uDD69\uDD6D-\uDD72\uDD7B-\uDD82\uDD85-\uDD8B\uDDAA-\uDDAD\uDE42-\uDE44]|\uD836[\uDE00-\uDE36\uDE3B-\uDE6C\uDE75\uDE84\uDE9B-\uDE9F\uDEA1-\uDEAF]|\uD838[\uDC00-\uDC06\uDC08-\uDC18\uDC1B-\uDC21\uDC23\uDC24\uDC26-\uDC2A]|\uD83A[\uDCD0-\uDCD6\uDD44-\uDD4A]|\uDB40[\uDD00-\uDDEF]' + }, + { + 'name': 'Mc', + 'alias': 'Spacing_Mark', + 'bmp': '\u0903\u093B\u093E-\u0940\u0949-\u094C\u094E\u094F\u0982\u0983\u09BE-\u09C0\u09C7\u09C8\u09CB\u09CC\u09D7\u0A03\u0A3E-\u0A40\u0A83\u0ABE-\u0AC0\u0AC9\u0ACB\u0ACC\u0B02\u0B03\u0B3E\u0B40\u0B47\u0B48\u0B4B\u0B4C\u0B57\u0BBE\u0BBF\u0BC1\u0BC2\u0BC6-\u0BC8\u0BCA-\u0BCC\u0BD7\u0C01-\u0C03\u0C41-\u0C44\u0C82\u0C83\u0CBE\u0CC0-\u0CC4\u0CC7\u0CC8\u0CCA\u0CCB\u0CD5\u0CD6\u0D02\u0D03\u0D3E-\u0D40\u0D46-\u0D48\u0D4A-\u0D4C\u0D57\u0D82\u0D83\u0DCF-\u0DD1\u0DD8-\u0DDF\u0DF2\u0DF3\u0F3E\u0F3F\u0F7F\u102B\u102C\u1031\u1038\u103B\u103C\u1056\u1057\u1062-\u1064\u1067-\u106D\u1083\u1084\u1087-\u108C\u108F\u109A-\u109C\u17B6\u17BE-\u17C5\u17C7\u17C8\u1923-\u1926\u1929-\u192B\u1930\u1931\u1933-\u1938\u1A19\u1A1A\u1A55\u1A57\u1A61\u1A63\u1A64\u1A6D-\u1A72\u1B04\u1B35\u1B3B\u1B3D-\u1B41\u1B43\u1B44\u1B82\u1BA1\u1BA6\u1BA7\u1BAA\u1BE7\u1BEA-\u1BEC\u1BEE\u1BF2\u1BF3\u1C24-\u1C2B\u1C34\u1C35\u1CE1\u1CF2\u1CF3\u1CF7\u302E\u302F\uA823\uA824\uA827\uA880\uA881\uA8B4-\uA8C3\uA952\uA953\uA983\uA9B4\uA9B5\uA9BA\uA9BB\uA9BD-\uA9C0\uAA2F\uAA30\uAA33\uAA34\uAA4D\uAA7B\uAA7D\uAAEB\uAAEE\uAAEF\uAAF5\uABE3\uABE4\uABE6\uABE7\uABE9\uABEA\uABEC', + 'astral': '\uD804[\uDC00\uDC02\uDC82\uDCB0-\uDCB2\uDCB7\uDCB8\uDD2C\uDD45\uDD46\uDD82\uDDB3-\uDDB5\uDDBF\uDDC0\uDE2C-\uDE2E\uDE32\uDE33\uDE35\uDEE0-\uDEE2\uDF02\uDF03\uDF3E\uDF3F\uDF41-\uDF44\uDF47\uDF48\uDF4B-\uDF4D\uDF57\uDF62\uDF63]|\uD805[\uDC35-\uDC37\uDC40\uDC41\uDC45\uDCB0-\uDCB2\uDCB9\uDCBB-\uDCBE\uDCC1\uDDAF-\uDDB1\uDDB8-\uDDBB\uDDBE\uDE30-\uDE32\uDE3B\uDE3C\uDE3E\uDEAC\uDEAE\uDEAF\uDEB6\uDF20\uDF21\uDF26]|\uD806[\uDC2C-\uDC2E\uDC38\uDE39\uDE57\uDE58\uDE97]|\uD807[\uDC2F\uDC3E\uDCA9\uDCB1\uDCB4\uDD8A-\uDD8E\uDD93\uDD94\uDD96\uDEF5\uDEF6]|\uD81B[\uDF51-\uDF7E]|\uD834[\uDD65\uDD66\uDD6D-\uDD72]' + }, + { + 'name': 'Me', + 'alias': 'Enclosing_Mark', + 'bmp': '\u0488\u0489\u1ABE\u20DD-\u20E0\u20E2-\u20E4\uA670-\uA672' + }, + { + 'name': 'Mn', + 'alias': 'Nonspacing_Mark', + 'bmp': '\u0300-\u036F\u0483-\u0487\u0591-\u05BD\u05BF\u05C1\u05C2\u05C4\u05C5\u05C7\u0610-\u061A\u064B-\u065F\u0670\u06D6-\u06DC\u06DF-\u06E4\u06E7\u06E8\u06EA-\u06ED\u0711\u0730-\u074A\u07A6-\u07B0\u07EB-\u07F3\u07FD\u0816-\u0819\u081B-\u0823\u0825-\u0827\u0829-\u082D\u0859-\u085B\u08D3-\u08E1\u08E3-\u0902\u093A\u093C\u0941-\u0948\u094D\u0951-\u0957\u0962\u0963\u0981\u09BC\u09C1-\u09C4\u09CD\u09E2\u09E3\u09FE\u0A01\u0A02\u0A3C\u0A41\u0A42\u0A47\u0A48\u0A4B-\u0A4D\u0A51\u0A70\u0A71\u0A75\u0A81\u0A82\u0ABC\u0AC1-\u0AC5\u0AC7\u0AC8\u0ACD\u0AE2\u0AE3\u0AFA-\u0AFF\u0B01\u0B3C\u0B3F\u0B41-\u0B44\u0B4D\u0B56\u0B62\u0B63\u0B82\u0BC0\u0BCD\u0C00\u0C04\u0C3E-\u0C40\u0C46-\u0C48\u0C4A-\u0C4D\u0C55\u0C56\u0C62\u0C63\u0C81\u0CBC\u0CBF\u0CC6\u0CCC\u0CCD\u0CE2\u0CE3\u0D00\u0D01\u0D3B\u0D3C\u0D41-\u0D44\u0D4D\u0D62\u0D63\u0DCA\u0DD2-\u0DD4\u0DD6\u0E31\u0E34-\u0E3A\u0E47-\u0E4E\u0EB1\u0EB4-\u0EB9\u0EBB\u0EBC\u0EC8-\u0ECD\u0F18\u0F19\u0F35\u0F37\u0F39\u0F71-\u0F7E\u0F80-\u0F84\u0F86\u0F87\u0F8D-\u0F97\u0F99-\u0FBC\u0FC6\u102D-\u1030\u1032-\u1037\u1039\u103A\u103D\u103E\u1058\u1059\u105E-\u1060\u1071-\u1074\u1082\u1085\u1086\u108D\u109D\u135D-\u135F\u1712-\u1714\u1732-\u1734\u1752\u1753\u1772\u1773\u17B4\u17B5\u17B7-\u17BD\u17C6\u17C9-\u17D3\u17DD\u180B-\u180D\u1885\u1886\u18A9\u1920-\u1922\u1927\u1928\u1932\u1939-\u193B\u1A17\u1A18\u1A1B\u1A56\u1A58-\u1A5E\u1A60\u1A62\u1A65-\u1A6C\u1A73-\u1A7C\u1A7F\u1AB0-\u1ABD\u1B00-\u1B03\u1B34\u1B36-\u1B3A\u1B3C\u1B42\u1B6B-\u1B73\u1B80\u1B81\u1BA2-\u1BA5\u1BA8\u1BA9\u1BAB-\u1BAD\u1BE6\u1BE8\u1BE9\u1BED\u1BEF-\u1BF1\u1C2C-\u1C33\u1C36\u1C37\u1CD0-\u1CD2\u1CD4-\u1CE0\u1CE2-\u1CE8\u1CED\u1CF4\u1CF8\u1CF9\u1DC0-\u1DF9\u1DFB-\u1DFF\u20D0-\u20DC\u20E1\u20E5-\u20F0\u2CEF-\u2CF1\u2D7F\u2DE0-\u2DFF\u302A-\u302D\u3099\u309A\uA66F\uA674-\uA67D\uA69E\uA69F\uA6F0\uA6F1\uA802\uA806\uA80B\uA825\uA826\uA8C4\uA8C5\uA8E0-\uA8F1\uA8FF\uA926-\uA92D\uA947-\uA951\uA980-\uA982\uA9B3\uA9B6-\uA9B9\uA9BC\uA9E5\uAA29-\uAA2E\uAA31\uAA32\uAA35\uAA36\uAA43\uAA4C\uAA7C\uAAB0\uAAB2-\uAAB4\uAAB7\uAAB8\uAABE\uAABF\uAAC1\uAAEC\uAAED\uAAF6\uABE5\uABE8\uABED\uFB1E\uFE00-\uFE0F\uFE20-\uFE2F', + 'astral': '\uD800[\uDDFD\uDEE0\uDF76-\uDF7A]|\uD802[\uDE01-\uDE03\uDE05\uDE06\uDE0C-\uDE0F\uDE38-\uDE3A\uDE3F\uDEE5\uDEE6]|\uD803[\uDD24-\uDD27\uDF46-\uDF50]|\uD804[\uDC01\uDC38-\uDC46\uDC7F-\uDC81\uDCB3-\uDCB6\uDCB9\uDCBA\uDD00-\uDD02\uDD27-\uDD2B\uDD2D-\uDD34\uDD73\uDD80\uDD81\uDDB6-\uDDBE\uDDC9-\uDDCC\uDE2F-\uDE31\uDE34\uDE36\uDE37\uDE3E\uDEDF\uDEE3-\uDEEA\uDF00\uDF01\uDF3B\uDF3C\uDF40\uDF66-\uDF6C\uDF70-\uDF74]|\uD805[\uDC38-\uDC3F\uDC42-\uDC44\uDC46\uDC5E\uDCB3-\uDCB8\uDCBA\uDCBF\uDCC0\uDCC2\uDCC3\uDDB2-\uDDB5\uDDBC\uDDBD\uDDBF\uDDC0\uDDDC\uDDDD\uDE33-\uDE3A\uDE3D\uDE3F\uDE40\uDEAB\uDEAD\uDEB0-\uDEB5\uDEB7\uDF1D-\uDF1F\uDF22-\uDF25\uDF27-\uDF2B]|\uD806[\uDC2F-\uDC37\uDC39\uDC3A\uDE01-\uDE0A\uDE33-\uDE38\uDE3B-\uDE3E\uDE47\uDE51-\uDE56\uDE59-\uDE5B\uDE8A-\uDE96\uDE98\uDE99]|\uD807[\uDC30-\uDC36\uDC38-\uDC3D\uDC3F\uDC92-\uDCA7\uDCAA-\uDCB0\uDCB2\uDCB3\uDCB5\uDCB6\uDD31-\uDD36\uDD3A\uDD3C\uDD3D\uDD3F-\uDD45\uDD47\uDD90\uDD91\uDD95\uDD97\uDEF3\uDEF4]|\uD81A[\uDEF0-\uDEF4\uDF30-\uDF36]|\uD81B[\uDF8F-\uDF92]|\uD82F[\uDC9D\uDC9E]|\uD834[\uDD67-\uDD69\uDD7B-\uDD82\uDD85-\uDD8B\uDDAA-\uDDAD\uDE42-\uDE44]|\uD836[\uDE00-\uDE36\uDE3B-\uDE6C\uDE75\uDE84\uDE9B-\uDE9F\uDEA1-\uDEAF]|\uD838[\uDC00-\uDC06\uDC08-\uDC18\uDC1B-\uDC21\uDC23\uDC24\uDC26-\uDC2A]|\uD83A[\uDCD0-\uDCD6\uDD44-\uDD4A]|\uDB40[\uDD00-\uDDEF]' + }, + { + 'name': 'N', + 'alias': 'Number', + 'bmp': '0-9\xB2\xB3\xB9\xBC-\xBE\u0660-\u0669\u06F0-\u06F9\u07C0-\u07C9\u0966-\u096F\u09E6-\u09EF\u09F4-\u09F9\u0A66-\u0A6F\u0AE6-\u0AEF\u0B66-\u0B6F\u0B72-\u0B77\u0BE6-\u0BF2\u0C66-\u0C6F\u0C78-\u0C7E\u0CE6-\u0CEF\u0D58-\u0D5E\u0D66-\u0D78\u0DE6-\u0DEF\u0E50-\u0E59\u0ED0-\u0ED9\u0F20-\u0F33\u1040-\u1049\u1090-\u1099\u1369-\u137C\u16EE-\u16F0\u17E0-\u17E9\u17F0-\u17F9\u1810-\u1819\u1946-\u194F\u19D0-\u19DA\u1A80-\u1A89\u1A90-\u1A99\u1B50-\u1B59\u1BB0-\u1BB9\u1C40-\u1C49\u1C50-\u1C59\u2070\u2074-\u2079\u2080-\u2089\u2150-\u2182\u2185-\u2189\u2460-\u249B\u24EA-\u24FF\u2776-\u2793\u2CFD\u3007\u3021-\u3029\u3038-\u303A\u3192-\u3195\u3220-\u3229\u3248-\u324F\u3251-\u325F\u3280-\u3289\u32B1-\u32BF\uA620-\uA629\uA6E6-\uA6EF\uA830-\uA835\uA8D0-\uA8D9\uA900-\uA909\uA9D0-\uA9D9\uA9F0-\uA9F9\uAA50-\uAA59\uABF0-\uABF9\uFF10-\uFF19', + 'astral': '\uD800[\uDD07-\uDD33\uDD40-\uDD78\uDD8A\uDD8B\uDEE1-\uDEFB\uDF20-\uDF23\uDF41\uDF4A\uDFD1-\uDFD5]|\uD801[\uDCA0-\uDCA9]|\uD802[\uDC58-\uDC5F\uDC79-\uDC7F\uDCA7-\uDCAF\uDCFB-\uDCFF\uDD16-\uDD1B\uDDBC\uDDBD\uDDC0-\uDDCF\uDDD2-\uDDFF\uDE40-\uDE48\uDE7D\uDE7E\uDE9D-\uDE9F\uDEEB-\uDEEF\uDF58-\uDF5F\uDF78-\uDF7F\uDFA9-\uDFAF]|\uD803[\uDCFA-\uDCFF\uDD30-\uDD39\uDE60-\uDE7E\uDF1D-\uDF26\uDF51-\uDF54]|\uD804[\uDC52-\uDC6F\uDCF0-\uDCF9\uDD36-\uDD3F\uDDD0-\uDDD9\uDDE1-\uDDF4\uDEF0-\uDEF9]|\uD805[\uDC50-\uDC59\uDCD0-\uDCD9\uDE50-\uDE59\uDEC0-\uDEC9\uDF30-\uDF3B]|\uD806[\uDCE0-\uDCF2]|\uD807[\uDC50-\uDC6C\uDD50-\uDD59\uDDA0-\uDDA9]|\uD809[\uDC00-\uDC6E]|\uD81A[\uDE60-\uDE69\uDF50-\uDF59\uDF5B-\uDF61]|\uD81B[\uDE80-\uDE96]|\uD834[\uDEE0-\uDEF3\uDF60-\uDF78]|\uD835[\uDFCE-\uDFFF]|\uD83A[\uDCC7-\uDCCF\uDD50-\uDD59]|\uD83B[\uDC71-\uDCAB\uDCAD-\uDCAF\uDCB1-\uDCB4]|\uD83C[\uDD00-\uDD0C]' + }, + { + 'name': 'Nd', + 'alias': 'Decimal_Number', + 'bmp': '0-9\u0660-\u0669\u06F0-\u06F9\u07C0-\u07C9\u0966-\u096F\u09E6-\u09EF\u0A66-\u0A6F\u0AE6-\u0AEF\u0B66-\u0B6F\u0BE6-\u0BEF\u0C66-\u0C6F\u0CE6-\u0CEF\u0D66-\u0D6F\u0DE6-\u0DEF\u0E50-\u0E59\u0ED0-\u0ED9\u0F20-\u0F29\u1040-\u1049\u1090-\u1099\u17E0-\u17E9\u1810-\u1819\u1946-\u194F\u19D0-\u19D9\u1A80-\u1A89\u1A90-\u1A99\u1B50-\u1B59\u1BB0-\u1BB9\u1C40-\u1C49\u1C50-\u1C59\uA620-\uA629\uA8D0-\uA8D9\uA900-\uA909\uA9D0-\uA9D9\uA9F0-\uA9F9\uAA50-\uAA59\uABF0-\uABF9\uFF10-\uFF19', + 'astral': '\uD801[\uDCA0-\uDCA9]|\uD803[\uDD30-\uDD39]|\uD804[\uDC66-\uDC6F\uDCF0-\uDCF9\uDD36-\uDD3F\uDDD0-\uDDD9\uDEF0-\uDEF9]|\uD805[\uDC50-\uDC59\uDCD0-\uDCD9\uDE50-\uDE59\uDEC0-\uDEC9\uDF30-\uDF39]|\uD806[\uDCE0-\uDCE9]|\uD807[\uDC50-\uDC59\uDD50-\uDD59\uDDA0-\uDDA9]|\uD81A[\uDE60-\uDE69\uDF50-\uDF59]|\uD835[\uDFCE-\uDFFF]|\uD83A[\uDD50-\uDD59]' + }, + { + 'name': 'Nl', + 'alias': 'Letter_Number', + 'bmp': '\u16EE-\u16F0\u2160-\u2182\u2185-\u2188\u3007\u3021-\u3029\u3038-\u303A\uA6E6-\uA6EF', + 'astral': '\uD800[\uDD40-\uDD74\uDF41\uDF4A\uDFD1-\uDFD5]|\uD809[\uDC00-\uDC6E]' + }, + { + 'name': 'No', + 'alias': 'Other_Number', + 'bmp': '\xB2\xB3\xB9\xBC-\xBE\u09F4-\u09F9\u0B72-\u0B77\u0BF0-\u0BF2\u0C78-\u0C7E\u0D58-\u0D5E\u0D70-\u0D78\u0F2A-\u0F33\u1369-\u137C\u17F0-\u17F9\u19DA\u2070\u2074-\u2079\u2080-\u2089\u2150-\u215F\u2189\u2460-\u249B\u24EA-\u24FF\u2776-\u2793\u2CFD\u3192-\u3195\u3220-\u3229\u3248-\u324F\u3251-\u325F\u3280-\u3289\u32B1-\u32BF\uA830-\uA835', + 'astral': '\uD800[\uDD07-\uDD33\uDD75-\uDD78\uDD8A\uDD8B\uDEE1-\uDEFB\uDF20-\uDF23]|\uD802[\uDC58-\uDC5F\uDC79-\uDC7F\uDCA7-\uDCAF\uDCFB-\uDCFF\uDD16-\uDD1B\uDDBC\uDDBD\uDDC0-\uDDCF\uDDD2-\uDDFF\uDE40-\uDE48\uDE7D\uDE7E\uDE9D-\uDE9F\uDEEB-\uDEEF\uDF58-\uDF5F\uDF78-\uDF7F\uDFA9-\uDFAF]|\uD803[\uDCFA-\uDCFF\uDE60-\uDE7E\uDF1D-\uDF26\uDF51-\uDF54]|\uD804[\uDC52-\uDC65\uDDE1-\uDDF4]|\uD805[\uDF3A\uDF3B]|\uD806[\uDCEA-\uDCF2]|\uD807[\uDC5A-\uDC6C]|\uD81A[\uDF5B-\uDF61]|\uD81B[\uDE80-\uDE96]|\uD834[\uDEE0-\uDEF3\uDF60-\uDF78]|\uD83A[\uDCC7-\uDCCF]|\uD83B[\uDC71-\uDCAB\uDCAD-\uDCAF\uDCB1-\uDCB4]|\uD83C[\uDD00-\uDD0C]' + }, + { + 'name': 'P', + 'alias': 'Punctuation', + 'bmp': '!-#%-\\*,-\\/:;\\?@\\[-\\]_\\{\\}\xA1\xA7\xAB\xB6\xB7\xBB\xBF\u037E\u0387\u055A-\u055F\u0589\u058A\u05BE\u05C0\u05C3\u05C6\u05F3\u05F4\u0609\u060A\u060C\u060D\u061B\u061E\u061F\u066A-\u066D\u06D4\u0700-\u070D\u07F7-\u07F9\u0830-\u083E\u085E\u0964\u0965\u0970\u09FD\u0A76\u0AF0\u0C84\u0DF4\u0E4F\u0E5A\u0E5B\u0F04-\u0F12\u0F14\u0F3A-\u0F3D\u0F85\u0FD0-\u0FD4\u0FD9\u0FDA\u104A-\u104F\u10FB\u1360-\u1368\u1400\u166D\u166E\u169B\u169C\u16EB-\u16ED\u1735\u1736\u17D4-\u17D6\u17D8-\u17DA\u1800-\u180A\u1944\u1945\u1A1E\u1A1F\u1AA0-\u1AA6\u1AA8-\u1AAD\u1B5A-\u1B60\u1BFC-\u1BFF\u1C3B-\u1C3F\u1C7E\u1C7F\u1CC0-\u1CC7\u1CD3\u2010-\u2027\u2030-\u2043\u2045-\u2051\u2053-\u205E\u207D\u207E\u208D\u208E\u2308-\u230B\u2329\u232A\u2768-\u2775\u27C5\u27C6\u27E6-\u27EF\u2983-\u2998\u29D8-\u29DB\u29FC\u29FD\u2CF9-\u2CFC\u2CFE\u2CFF\u2D70\u2E00-\u2E2E\u2E30-\u2E4E\u3001-\u3003\u3008-\u3011\u3014-\u301F\u3030\u303D\u30A0\u30FB\uA4FE\uA4FF\uA60D-\uA60F\uA673\uA67E\uA6F2-\uA6F7\uA874-\uA877\uA8CE\uA8CF\uA8F8-\uA8FA\uA8FC\uA92E\uA92F\uA95F\uA9C1-\uA9CD\uA9DE\uA9DF\uAA5C-\uAA5F\uAADE\uAADF\uAAF0\uAAF1\uABEB\uFD3E\uFD3F\uFE10-\uFE19\uFE30-\uFE52\uFE54-\uFE61\uFE63\uFE68\uFE6A\uFE6B\uFF01-\uFF03\uFF05-\uFF0A\uFF0C-\uFF0F\uFF1A\uFF1B\uFF1F\uFF20\uFF3B-\uFF3D\uFF3F\uFF5B\uFF5D\uFF5F-\uFF65', + 'astral': '\uD800[\uDD00-\uDD02\uDF9F\uDFD0]|\uD801\uDD6F|\uD802[\uDC57\uDD1F\uDD3F\uDE50-\uDE58\uDE7F\uDEF0-\uDEF6\uDF39-\uDF3F\uDF99-\uDF9C]|\uD803[\uDF55-\uDF59]|\uD804[\uDC47-\uDC4D\uDCBB\uDCBC\uDCBE-\uDCC1\uDD40-\uDD43\uDD74\uDD75\uDDC5-\uDDC8\uDDCD\uDDDB\uDDDD-\uDDDF\uDE38-\uDE3D\uDEA9]|\uD805[\uDC4B-\uDC4F\uDC5B\uDC5D\uDCC6\uDDC1-\uDDD7\uDE41-\uDE43\uDE60-\uDE6C\uDF3C-\uDF3E]|\uD806[\uDC3B\uDE3F-\uDE46\uDE9A-\uDE9C\uDE9E-\uDEA2]|\uD807[\uDC41-\uDC45\uDC70\uDC71\uDEF7\uDEF8]|\uD809[\uDC70-\uDC74]|\uD81A[\uDE6E\uDE6F\uDEF5\uDF37-\uDF3B\uDF44]|\uD81B[\uDE97-\uDE9A]|\uD82F\uDC9F|\uD836[\uDE87-\uDE8B]|\uD83A[\uDD5E\uDD5F]' + }, + { + 'name': 'Pc', + 'alias': 'Connector_Punctuation', + 'bmp': '_\u203F\u2040\u2054\uFE33\uFE34\uFE4D-\uFE4F\uFF3F' + }, + { + 'name': 'Pd', + 'alias': 'Dash_Punctuation', + 'bmp': '\\-\u058A\u05BE\u1400\u1806\u2010-\u2015\u2E17\u2E1A\u2E3A\u2E3B\u2E40\u301C\u3030\u30A0\uFE31\uFE32\uFE58\uFE63\uFF0D' + }, + { + 'name': 'Pe', + 'alias': 'Close_Punctuation', + 'bmp': '\\)\\]\\}\u0F3B\u0F3D\u169C\u2046\u207E\u208E\u2309\u230B\u232A\u2769\u276B\u276D\u276F\u2771\u2773\u2775\u27C6\u27E7\u27E9\u27EB\u27ED\u27EF\u2984\u2986\u2988\u298A\u298C\u298E\u2990\u2992\u2994\u2996\u2998\u29D9\u29DB\u29FD\u2E23\u2E25\u2E27\u2E29\u3009\u300B\u300D\u300F\u3011\u3015\u3017\u3019\u301B\u301E\u301F\uFD3E\uFE18\uFE36\uFE38\uFE3A\uFE3C\uFE3E\uFE40\uFE42\uFE44\uFE48\uFE5A\uFE5C\uFE5E\uFF09\uFF3D\uFF5D\uFF60\uFF63' + }, + { + 'name': 'Pf', + 'alias': 'Final_Punctuation', + 'bmp': '\xBB\u2019\u201D\u203A\u2E03\u2E05\u2E0A\u2E0D\u2E1D\u2E21' + }, + { + 'name': 'Pi', + 'alias': 'Initial_Punctuation', + 'bmp': '\xAB\u2018\u201B\u201C\u201F\u2039\u2E02\u2E04\u2E09\u2E0C\u2E1C\u2E20' + }, + { + 'name': 'Po', + 'alias': 'Other_Punctuation', + 'bmp': '!-#%-\'\\*,\\.\\/:;\\?@\\\xA1\xA7\xB6\xB7\xBF\u037E\u0387\u055A-\u055F\u0589\u05C0\u05C3\u05C6\u05F3\u05F4\u0609\u060A\u060C\u060D\u061B\u061E\u061F\u066A-\u066D\u06D4\u0700-\u070D\u07F7-\u07F9\u0830-\u083E\u085E\u0964\u0965\u0970\u09FD\u0A76\u0AF0\u0C84\u0DF4\u0E4F\u0E5A\u0E5B\u0F04-\u0F12\u0F14\u0F85\u0FD0-\u0FD4\u0FD9\u0FDA\u104A-\u104F\u10FB\u1360-\u1368\u166D\u166E\u16EB-\u16ED\u1735\u1736\u17D4-\u17D6\u17D8-\u17DA\u1800-\u1805\u1807-\u180A\u1944\u1945\u1A1E\u1A1F\u1AA0-\u1AA6\u1AA8-\u1AAD\u1B5A-\u1B60\u1BFC-\u1BFF\u1C3B-\u1C3F\u1C7E\u1C7F\u1CC0-\u1CC7\u1CD3\u2016\u2017\u2020-\u2027\u2030-\u2038\u203B-\u203E\u2041-\u2043\u2047-\u2051\u2053\u2055-\u205E\u2CF9-\u2CFC\u2CFE\u2CFF\u2D70\u2E00\u2E01\u2E06-\u2E08\u2E0B\u2E0E-\u2E16\u2E18\u2E19\u2E1B\u2E1E\u2E1F\u2E2A-\u2E2E\u2E30-\u2E39\u2E3C-\u2E3F\u2E41\u2E43-\u2E4E\u3001-\u3003\u303D\u30FB\uA4FE\uA4FF\uA60D-\uA60F\uA673\uA67E\uA6F2-\uA6F7\uA874-\uA877\uA8CE\uA8CF\uA8F8-\uA8FA\uA8FC\uA92E\uA92F\uA95F\uA9C1-\uA9CD\uA9DE\uA9DF\uAA5C-\uAA5F\uAADE\uAADF\uAAF0\uAAF1\uABEB\uFE10-\uFE16\uFE19\uFE30\uFE45\uFE46\uFE49-\uFE4C\uFE50-\uFE52\uFE54-\uFE57\uFE5F-\uFE61\uFE68\uFE6A\uFE6B\uFF01-\uFF03\uFF05-\uFF07\uFF0A\uFF0C\uFF0E\uFF0F\uFF1A\uFF1B\uFF1F\uFF20\uFF3C\uFF61\uFF64\uFF65', + 'astral': '\uD800[\uDD00-\uDD02\uDF9F\uDFD0]|\uD801\uDD6F|\uD802[\uDC57\uDD1F\uDD3F\uDE50-\uDE58\uDE7F\uDEF0-\uDEF6\uDF39-\uDF3F\uDF99-\uDF9C]|\uD803[\uDF55-\uDF59]|\uD804[\uDC47-\uDC4D\uDCBB\uDCBC\uDCBE-\uDCC1\uDD40-\uDD43\uDD74\uDD75\uDDC5-\uDDC8\uDDCD\uDDDB\uDDDD-\uDDDF\uDE38-\uDE3D\uDEA9]|\uD805[\uDC4B-\uDC4F\uDC5B\uDC5D\uDCC6\uDDC1-\uDDD7\uDE41-\uDE43\uDE60-\uDE6C\uDF3C-\uDF3E]|\uD806[\uDC3B\uDE3F-\uDE46\uDE9A-\uDE9C\uDE9E-\uDEA2]|\uD807[\uDC41-\uDC45\uDC70\uDC71\uDEF7\uDEF8]|\uD809[\uDC70-\uDC74]|\uD81A[\uDE6E\uDE6F\uDEF5\uDF37-\uDF3B\uDF44]|\uD81B[\uDE97-\uDE9A]|\uD82F\uDC9F|\uD836[\uDE87-\uDE8B]|\uD83A[\uDD5E\uDD5F]' + }, + { + 'name': 'Ps', + 'alias': 'Open_Punctuation', + 'bmp': '\\(\\[\\{\u0F3A\u0F3C\u169B\u201A\u201E\u2045\u207D\u208D\u2308\u230A\u2329\u2768\u276A\u276C\u276E\u2770\u2772\u2774\u27C5\u27E6\u27E8\u27EA\u27EC\u27EE\u2983\u2985\u2987\u2989\u298B\u298D\u298F\u2991\u2993\u2995\u2997\u29D8\u29DA\u29FC\u2E22\u2E24\u2E26\u2E28\u2E42\u3008\u300A\u300C\u300E\u3010\u3014\u3016\u3018\u301A\u301D\uFD3F\uFE17\uFE35\uFE37\uFE39\uFE3B\uFE3D\uFE3F\uFE41\uFE43\uFE47\uFE59\uFE5B\uFE5D\uFF08\uFF3B\uFF5B\uFF5F\uFF62' + }, + { + 'name': 'S', + 'alias': 'Symbol', + 'bmp': '\\$\\+<->\\^`\\|~\xA2-\xA6\xA8\xA9\xAC\xAE-\xB1\xB4\xB8\xD7\xF7\u02C2-\u02C5\u02D2-\u02DF\u02E5-\u02EB\u02ED\u02EF-\u02FF\u0375\u0384\u0385\u03F6\u0482\u058D-\u058F\u0606-\u0608\u060B\u060E\u060F\u06DE\u06E9\u06FD\u06FE\u07F6\u07FE\u07FF\u09F2\u09F3\u09FA\u09FB\u0AF1\u0B70\u0BF3-\u0BFA\u0C7F\u0D4F\u0D79\u0E3F\u0F01-\u0F03\u0F13\u0F15-\u0F17\u0F1A-\u0F1F\u0F34\u0F36\u0F38\u0FBE-\u0FC5\u0FC7-\u0FCC\u0FCE\u0FCF\u0FD5-\u0FD8\u109E\u109F\u1390-\u1399\u17DB\u1940\u19DE-\u19FF\u1B61-\u1B6A\u1B74-\u1B7C\u1FBD\u1FBF-\u1FC1\u1FCD-\u1FCF\u1FDD-\u1FDF\u1FED-\u1FEF\u1FFD\u1FFE\u2044\u2052\u207A-\u207C\u208A-\u208C\u20A0-\u20BF\u2100\u2101\u2103-\u2106\u2108\u2109\u2114\u2116-\u2118\u211E-\u2123\u2125\u2127\u2129\u212E\u213A\u213B\u2140-\u2144\u214A-\u214D\u214F\u218A\u218B\u2190-\u2307\u230C-\u2328\u232B-\u2426\u2440-\u244A\u249C-\u24E9\u2500-\u2767\u2794-\u27C4\u27C7-\u27E5\u27F0-\u2982\u2999-\u29D7\u29DC-\u29FB\u29FE-\u2B73\u2B76-\u2B95\u2B98-\u2BC8\u2BCA-\u2BFE\u2CE5-\u2CEA\u2E80-\u2E99\u2E9B-\u2EF3\u2F00-\u2FD5\u2FF0-\u2FFB\u3004\u3012\u3013\u3020\u3036\u3037\u303E\u303F\u309B\u309C\u3190\u3191\u3196-\u319F\u31C0-\u31E3\u3200-\u321E\u322A-\u3247\u3250\u3260-\u327F\u328A-\u32B0\u32C0-\u32FE\u3300-\u33FF\u4DC0-\u4DFF\uA490-\uA4C6\uA700-\uA716\uA720\uA721\uA789\uA78A\uA828-\uA82B\uA836-\uA839\uAA77-\uAA79\uAB5B\uFB29\uFBB2-\uFBC1\uFDFC\uFDFD\uFE62\uFE64-\uFE66\uFE69\uFF04\uFF0B\uFF1C-\uFF1E\uFF3E\uFF40\uFF5C\uFF5E\uFFE0-\uFFE6\uFFE8-\uFFEE\uFFFC\uFFFD', + 'astral': '\uD800[\uDD37-\uDD3F\uDD79-\uDD89\uDD8C-\uDD8E\uDD90-\uDD9B\uDDA0\uDDD0-\uDDFC]|\uD802[\uDC77\uDC78\uDEC8]|\uD805\uDF3F|\uD81A[\uDF3C-\uDF3F\uDF45]|\uD82F\uDC9C|\uD834[\uDC00-\uDCF5\uDD00-\uDD26\uDD29-\uDD64\uDD6A-\uDD6C\uDD83\uDD84\uDD8C-\uDDA9\uDDAE-\uDDE8\uDE00-\uDE41\uDE45\uDF00-\uDF56]|\uD835[\uDEC1\uDEDB\uDEFB\uDF15\uDF35\uDF4F\uDF6F\uDF89\uDFA9\uDFC3]|\uD836[\uDC00-\uDDFF\uDE37-\uDE3A\uDE6D-\uDE74\uDE76-\uDE83\uDE85\uDE86]|\uD83B[\uDCAC\uDCB0\uDEF0\uDEF1]|\uD83C[\uDC00-\uDC2B\uDC30-\uDC93\uDCA0-\uDCAE\uDCB1-\uDCBF\uDCC1-\uDCCF\uDCD1-\uDCF5\uDD10-\uDD6B\uDD70-\uDDAC\uDDE6-\uDE02\uDE10-\uDE3B\uDE40-\uDE48\uDE50\uDE51\uDE60-\uDE65\uDF00-\uDFFF]|\uD83D[\uDC00-\uDED4\uDEE0-\uDEEC\uDEF0-\uDEF9\uDF00-\uDF73\uDF80-\uDFD8]|\uD83E[\uDC00-\uDC0B\uDC10-\uDC47\uDC50-\uDC59\uDC60-\uDC87\uDC90-\uDCAD\uDD00-\uDD0B\uDD10-\uDD3E\uDD40-\uDD70\uDD73-\uDD76\uDD7A\uDD7C-\uDDA2\uDDB0-\uDDB9\uDDC0-\uDDC2\uDDD0-\uDDFF\uDE60-\uDE6D]' + }, + { + 'name': 'Sc', + 'alias': 'Currency_Symbol', + 'bmp': '\\$\xA2-\xA5\u058F\u060B\u07FE\u07FF\u09F2\u09F3\u09FB\u0AF1\u0BF9\u0E3F\u17DB\u20A0-\u20BF\uA838\uFDFC\uFE69\uFF04\uFFE0\uFFE1\uFFE5\uFFE6', + 'astral': '\uD83B\uDCB0' + }, + { + 'name': 'Sk', + 'alias': 'Modifier_Symbol', + 'bmp': '\\^`\xA8\xAF\xB4\xB8\u02C2-\u02C5\u02D2-\u02DF\u02E5-\u02EB\u02ED\u02EF-\u02FF\u0375\u0384\u0385\u1FBD\u1FBF-\u1FC1\u1FCD-\u1FCF\u1FDD-\u1FDF\u1FED-\u1FEF\u1FFD\u1FFE\u309B\u309C\uA700-\uA716\uA720\uA721\uA789\uA78A\uAB5B\uFBB2-\uFBC1\uFF3E\uFF40\uFFE3', + 'astral': '\uD83C[\uDFFB-\uDFFF]' + }, + { + 'name': 'Sm', + 'alias': 'Math_Symbol', + 'bmp': '\\+<->\\|~\xAC\xB1\xD7\xF7\u03F6\u0606-\u0608\u2044\u2052\u207A-\u207C\u208A-\u208C\u2118\u2140-\u2144\u214B\u2190-\u2194\u219A\u219B\u21A0\u21A3\u21A6\u21AE\u21CE\u21CF\u21D2\u21D4\u21F4-\u22FF\u2320\u2321\u237C\u239B-\u23B3\u23DC-\u23E1\u25B7\u25C1\u25F8-\u25FF\u266F\u27C0-\u27C4\u27C7-\u27E5\u27F0-\u27FF\u2900-\u2982\u2999-\u29D7\u29DC-\u29FB\u29FE-\u2AFF\u2B30-\u2B44\u2B47-\u2B4C\uFB29\uFE62\uFE64-\uFE66\uFF0B\uFF1C-\uFF1E\uFF5C\uFF5E\uFFE2\uFFE9-\uFFEC', + 'astral': '\uD835[\uDEC1\uDEDB\uDEFB\uDF15\uDF35\uDF4F\uDF6F\uDF89\uDFA9\uDFC3]|\uD83B[\uDEF0\uDEF1]' + }, + { + 'name': 'So', + 'alias': 'Other_Symbol', + 'bmp': '\xA6\xA9\xAE\xB0\u0482\u058D\u058E\u060E\u060F\u06DE\u06E9\u06FD\u06FE\u07F6\u09FA\u0B70\u0BF3-\u0BF8\u0BFA\u0C7F\u0D4F\u0D79\u0F01-\u0F03\u0F13\u0F15-\u0F17\u0F1A-\u0F1F\u0F34\u0F36\u0F38\u0FBE-\u0FC5\u0FC7-\u0FCC\u0FCE\u0FCF\u0FD5-\u0FD8\u109E\u109F\u1390-\u1399\u1940\u19DE-\u19FF\u1B61-\u1B6A\u1B74-\u1B7C\u2100\u2101\u2103-\u2106\u2108\u2109\u2114\u2116\u2117\u211E-\u2123\u2125\u2127\u2129\u212E\u213A\u213B\u214A\u214C\u214D\u214F\u218A\u218B\u2195-\u2199\u219C-\u219F\u21A1\u21A2\u21A4\u21A5\u21A7-\u21AD\u21AF-\u21CD\u21D0\u21D1\u21D3\u21D5-\u21F3\u2300-\u2307\u230C-\u231F\u2322-\u2328\u232B-\u237B\u237D-\u239A\u23B4-\u23DB\u23E2-\u2426\u2440-\u244A\u249C-\u24E9\u2500-\u25B6\u25B8-\u25C0\u25C2-\u25F7\u2600-\u266E\u2670-\u2767\u2794-\u27BF\u2800-\u28FF\u2B00-\u2B2F\u2B45\u2B46\u2B4D-\u2B73\u2B76-\u2B95\u2B98-\u2BC8\u2BCA-\u2BFE\u2CE5-\u2CEA\u2E80-\u2E99\u2E9B-\u2EF3\u2F00-\u2FD5\u2FF0-\u2FFB\u3004\u3012\u3013\u3020\u3036\u3037\u303E\u303F\u3190\u3191\u3196-\u319F\u31C0-\u31E3\u3200-\u321E\u322A-\u3247\u3250\u3260-\u327F\u328A-\u32B0\u32C0-\u32FE\u3300-\u33FF\u4DC0-\u4DFF\uA490-\uA4C6\uA828-\uA82B\uA836\uA837\uA839\uAA77-\uAA79\uFDFD\uFFE4\uFFE8\uFFED\uFFEE\uFFFC\uFFFD', + 'astral': '\uD800[\uDD37-\uDD3F\uDD79-\uDD89\uDD8C-\uDD8E\uDD90-\uDD9B\uDDA0\uDDD0-\uDDFC]|\uD802[\uDC77\uDC78\uDEC8]|\uD805\uDF3F|\uD81A[\uDF3C-\uDF3F\uDF45]|\uD82F\uDC9C|\uD834[\uDC00-\uDCF5\uDD00-\uDD26\uDD29-\uDD64\uDD6A-\uDD6C\uDD83\uDD84\uDD8C-\uDDA9\uDDAE-\uDDE8\uDE00-\uDE41\uDE45\uDF00-\uDF56]|\uD836[\uDC00-\uDDFF\uDE37-\uDE3A\uDE6D-\uDE74\uDE76-\uDE83\uDE85\uDE86]|\uD83B\uDCAC|\uD83C[\uDC00-\uDC2B\uDC30-\uDC93\uDCA0-\uDCAE\uDCB1-\uDCBF\uDCC1-\uDCCF\uDCD1-\uDCF5\uDD10-\uDD6B\uDD70-\uDDAC\uDDE6-\uDE02\uDE10-\uDE3B\uDE40-\uDE48\uDE50\uDE51\uDE60-\uDE65\uDF00-\uDFFA]|\uD83D[\uDC00-\uDED4\uDEE0-\uDEEC\uDEF0-\uDEF9\uDF00-\uDF73\uDF80-\uDFD8]|\uD83E[\uDC00-\uDC0B\uDC10-\uDC47\uDC50-\uDC59\uDC60-\uDC87\uDC90-\uDCAD\uDD00-\uDD0B\uDD10-\uDD3E\uDD40-\uDD70\uDD73-\uDD76\uDD7A\uDD7C-\uDDA2\uDDB0-\uDDB9\uDDC0-\uDDC2\uDDD0-\uDDFF\uDE60-\uDE6D]' + }, + { + 'name': 'Z', + 'alias': 'Separator', + 'bmp': ' \xA0\u1680\u2000-\u200A\u2028\u2029\u202F\u205F\u3000' + }, + { + 'name': 'Zl', + 'alias': 'Line_Separator', + 'bmp': '\u2028' + }, + { + 'name': 'Zp', + 'alias': 'Paragraph_Separator', + 'bmp': '\u2029' + }, + { + 'name': 'Zs', + 'alias': 'Space_Separator', + 'bmp': ' \xA0\u1680\u2000-\u200A\u202F\u205F\u3000' + } +]; + +var unicodeCategories = createCommonjsModule(function (module, exports) { +"use strict"; + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.default = void 0; + +var _categories = _interopRequireDefault(categories); + +function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } + +/*! + * XRegExp Unicode Categories 4.2.0 + * + * Steven Levithan (c) 2010-present MIT License + * Unicode data by Mathias Bynens + */ +var _default = function _default(XRegExp) { + /** + * Adds support for Unicode's general categories. E.g., `\p{Lu}` or `\p{Uppercase Letter}`. See + * category descriptions in UAX #44 . Token + * names are case insensitive, and any spaces, hyphens, and underscores are ignored. + * + * Uses Unicode 11.0.0. + * + * @requires XRegExp, Unicode Base + */ + if (!XRegExp.addUnicodeData) { + throw new ReferenceError('Unicode Base must be loaded before Unicode Categories'); + } + + XRegExp.addUnicodeData(_categories.default); +}; + +exports.default = _default; +module.exports = exports["default"]; +}); + +unwrapExports(unicodeCategories); + +var properties = [ + { + 'name': 'ASCII', + 'bmp': '\0-\x7F' + }, + { + 'name': 'Alphabetic', + 'bmp': 'A-Za-z\xAA\xB5\xBA\xC0-\xD6\xD8-\xF6\xF8-\u02C1\u02C6-\u02D1\u02E0-\u02E4\u02EC\u02EE\u0345\u0370-\u0374\u0376\u0377\u037A-\u037D\u037F\u0386\u0388-\u038A\u038C\u038E-\u03A1\u03A3-\u03F5\u03F7-\u0481\u048A-\u052F\u0531-\u0556\u0559\u0560-\u0588\u05B0-\u05BD\u05BF\u05C1\u05C2\u05C4\u05C5\u05C7\u05D0-\u05EA\u05EF-\u05F2\u0610-\u061A\u0620-\u0657\u0659-\u065F\u066E-\u06D3\u06D5-\u06DC\u06E1-\u06E8\u06ED-\u06EF\u06FA-\u06FC\u06FF\u0710-\u073F\u074D-\u07B1\u07CA-\u07EA\u07F4\u07F5\u07FA\u0800-\u0817\u081A-\u082C\u0840-\u0858\u0860-\u086A\u08A0-\u08B4\u08B6-\u08BD\u08D4-\u08DF\u08E3-\u08E9\u08F0-\u093B\u093D-\u094C\u094E-\u0950\u0955-\u0963\u0971-\u0983\u0985-\u098C\u098F\u0990\u0993-\u09A8\u09AA-\u09B0\u09B2\u09B6-\u09B9\u09BD-\u09C4\u09C7\u09C8\u09CB\u09CC\u09CE\u09D7\u09DC\u09DD\u09DF-\u09E3\u09F0\u09F1\u09FC\u0A01-\u0A03\u0A05-\u0A0A\u0A0F\u0A10\u0A13-\u0A28\u0A2A-\u0A30\u0A32\u0A33\u0A35\u0A36\u0A38\u0A39\u0A3E-\u0A42\u0A47\u0A48\u0A4B\u0A4C\u0A51\u0A59-\u0A5C\u0A5E\u0A70-\u0A75\u0A81-\u0A83\u0A85-\u0A8D\u0A8F-\u0A91\u0A93-\u0AA8\u0AAA-\u0AB0\u0AB2\u0AB3\u0AB5-\u0AB9\u0ABD-\u0AC5\u0AC7-\u0AC9\u0ACB\u0ACC\u0AD0\u0AE0-\u0AE3\u0AF9-\u0AFC\u0B01-\u0B03\u0B05-\u0B0C\u0B0F\u0B10\u0B13-\u0B28\u0B2A-\u0B30\u0B32\u0B33\u0B35-\u0B39\u0B3D-\u0B44\u0B47\u0B48\u0B4B\u0B4C\u0B56\u0B57\u0B5C\u0B5D\u0B5F-\u0B63\u0B71\u0B82\u0B83\u0B85-\u0B8A\u0B8E-\u0B90\u0B92-\u0B95\u0B99\u0B9A\u0B9C\u0B9E\u0B9F\u0BA3\u0BA4\u0BA8-\u0BAA\u0BAE-\u0BB9\u0BBE-\u0BC2\u0BC6-\u0BC8\u0BCA-\u0BCC\u0BD0\u0BD7\u0C00-\u0C03\u0C05-\u0C0C\u0C0E-\u0C10\u0C12-\u0C28\u0C2A-\u0C39\u0C3D-\u0C44\u0C46-\u0C48\u0C4A-\u0C4C\u0C55\u0C56\u0C58-\u0C5A\u0C60-\u0C63\u0C80-\u0C83\u0C85-\u0C8C\u0C8E-\u0C90\u0C92-\u0CA8\u0CAA-\u0CB3\u0CB5-\u0CB9\u0CBD-\u0CC4\u0CC6-\u0CC8\u0CCA-\u0CCC\u0CD5\u0CD6\u0CDE\u0CE0-\u0CE3\u0CF1\u0CF2\u0D00-\u0D03\u0D05-\u0D0C\u0D0E-\u0D10\u0D12-\u0D3A\u0D3D-\u0D44\u0D46-\u0D48\u0D4A-\u0D4C\u0D4E\u0D54-\u0D57\u0D5F-\u0D63\u0D7A-\u0D7F\u0D82\u0D83\u0D85-\u0D96\u0D9A-\u0DB1\u0DB3-\u0DBB\u0DBD\u0DC0-\u0DC6\u0DCF-\u0DD4\u0DD6\u0DD8-\u0DDF\u0DF2\u0DF3\u0E01-\u0E3A\u0E40-\u0E46\u0E4D\u0E81\u0E82\u0E84\u0E87\u0E88\u0E8A\u0E8D\u0E94-\u0E97\u0E99-\u0E9F\u0EA1-\u0EA3\u0EA5\u0EA7\u0EAA\u0EAB\u0EAD-\u0EB9\u0EBB-\u0EBD\u0EC0-\u0EC4\u0EC6\u0ECD\u0EDC-\u0EDF\u0F00\u0F40-\u0F47\u0F49-\u0F6C\u0F71-\u0F81\u0F88-\u0F97\u0F99-\u0FBC\u1000-\u1036\u1038\u103B-\u103F\u1050-\u1062\u1065-\u1068\u106E-\u1086\u108E\u109C\u109D\u10A0-\u10C5\u10C7\u10CD\u10D0-\u10FA\u10FC-\u1248\u124A-\u124D\u1250-\u1256\u1258\u125A-\u125D\u1260-\u1288\u128A-\u128D\u1290-\u12B0\u12B2-\u12B5\u12B8-\u12BE\u12C0\u12C2-\u12C5\u12C8-\u12D6\u12D8-\u1310\u1312-\u1315\u1318-\u135A\u135F\u1380-\u138F\u13A0-\u13F5\u13F8-\u13FD\u1401-\u166C\u166F-\u167F\u1681-\u169A\u16A0-\u16EA\u16EE-\u16F8\u1700-\u170C\u170E-\u1713\u1720-\u1733\u1740-\u1753\u1760-\u176C\u176E-\u1770\u1772\u1773\u1780-\u17B3\u17B6-\u17C8\u17D7\u17DC\u1820-\u1878\u1880-\u18AA\u18B0-\u18F5\u1900-\u191E\u1920-\u192B\u1930-\u1938\u1950-\u196D\u1970-\u1974\u1980-\u19AB\u19B0-\u19C9\u1A00-\u1A1B\u1A20-\u1A5E\u1A61-\u1A74\u1AA7\u1B00-\u1B33\u1B35-\u1B43\u1B45-\u1B4B\u1B80-\u1BA9\u1BAC-\u1BAF\u1BBA-\u1BE5\u1BE7-\u1BF1\u1C00-\u1C35\u1C4D-\u1C4F\u1C5A-\u1C7D\u1C80-\u1C88\u1C90-\u1CBA\u1CBD-\u1CBF\u1CE9-\u1CEC\u1CEE-\u1CF3\u1CF5\u1CF6\u1D00-\u1DBF\u1DE7-\u1DF4\u1E00-\u1F15\u1F18-\u1F1D\u1F20-\u1F45\u1F48-\u1F4D\u1F50-\u1F57\u1F59\u1F5B\u1F5D\u1F5F-\u1F7D\u1F80-\u1FB4\u1FB6-\u1FBC\u1FBE\u1FC2-\u1FC4\u1FC6-\u1FCC\u1FD0-\u1FD3\u1FD6-\u1FDB\u1FE0-\u1FEC\u1FF2-\u1FF4\u1FF6-\u1FFC\u2071\u207F\u2090-\u209C\u2102\u2107\u210A-\u2113\u2115\u2119-\u211D\u2124\u2126\u2128\u212A-\u212D\u212F-\u2139\u213C-\u213F\u2145-\u2149\u214E\u2160-\u2188\u24B6-\u24E9\u2C00-\u2C2E\u2C30-\u2C5E\u2C60-\u2CE4\u2CEB-\u2CEE\u2CF2\u2CF3\u2D00-\u2D25\u2D27\u2D2D\u2D30-\u2D67\u2D6F\u2D80-\u2D96\u2DA0-\u2DA6\u2DA8-\u2DAE\u2DB0-\u2DB6\u2DB8-\u2DBE\u2DC0-\u2DC6\u2DC8-\u2DCE\u2DD0-\u2DD6\u2DD8-\u2DDE\u2DE0-\u2DFF\u2E2F\u3005-\u3007\u3021-\u3029\u3031-\u3035\u3038-\u303C\u3041-\u3096\u309D-\u309F\u30A1-\u30FA\u30FC-\u30FF\u3105-\u312F\u3131-\u318E\u31A0-\u31BA\u31F0-\u31FF\u3400-\u4DB5\u4E00-\u9FEF\uA000-\uA48C\uA4D0-\uA4FD\uA500-\uA60C\uA610-\uA61F\uA62A\uA62B\uA640-\uA66E\uA674-\uA67B\uA67F-\uA6EF\uA717-\uA71F\uA722-\uA788\uA78B-\uA7B9\uA7F7-\uA801\uA803-\uA805\uA807-\uA80A\uA80C-\uA827\uA840-\uA873\uA880-\uA8C3\uA8C5\uA8F2-\uA8F7\uA8FB\uA8FD\uA8FE\uA90A-\uA92A\uA930-\uA952\uA960-\uA97C\uA980-\uA9B2\uA9B4-\uA9BF\uA9CF\uA9E0-\uA9E4\uA9E6-\uA9EF\uA9FA-\uA9FE\uAA00-\uAA36\uAA40-\uAA4D\uAA60-\uAA76\uAA7A\uAA7E-\uAABE\uAAC0\uAAC2\uAADB-\uAADD\uAAE0-\uAAEF\uAAF2-\uAAF5\uAB01-\uAB06\uAB09-\uAB0E\uAB11-\uAB16\uAB20-\uAB26\uAB28-\uAB2E\uAB30-\uAB5A\uAB5C-\uAB65\uAB70-\uABEA\uAC00-\uD7A3\uD7B0-\uD7C6\uD7CB-\uD7FB\uF900-\uFA6D\uFA70-\uFAD9\uFB00-\uFB06\uFB13-\uFB17\uFB1D-\uFB28\uFB2A-\uFB36\uFB38-\uFB3C\uFB3E\uFB40\uFB41\uFB43\uFB44\uFB46-\uFBB1\uFBD3-\uFD3D\uFD50-\uFD8F\uFD92-\uFDC7\uFDF0-\uFDFB\uFE70-\uFE74\uFE76-\uFEFC\uFF21-\uFF3A\uFF41-\uFF5A\uFF66-\uFFBE\uFFC2-\uFFC7\uFFCA-\uFFCF\uFFD2-\uFFD7\uFFDA-\uFFDC', + 'astral': '\uD800[\uDC00-\uDC0B\uDC0D-\uDC26\uDC28-\uDC3A\uDC3C\uDC3D\uDC3F-\uDC4D\uDC50-\uDC5D\uDC80-\uDCFA\uDD40-\uDD74\uDE80-\uDE9C\uDEA0-\uDED0\uDF00-\uDF1F\uDF2D-\uDF4A\uDF50-\uDF7A\uDF80-\uDF9D\uDFA0-\uDFC3\uDFC8-\uDFCF\uDFD1-\uDFD5]|\uD801[\uDC00-\uDC9D\uDCB0-\uDCD3\uDCD8-\uDCFB\uDD00-\uDD27\uDD30-\uDD63\uDE00-\uDF36\uDF40-\uDF55\uDF60-\uDF67]|\uD802[\uDC00-\uDC05\uDC08\uDC0A-\uDC35\uDC37\uDC38\uDC3C\uDC3F-\uDC55\uDC60-\uDC76\uDC80-\uDC9E\uDCE0-\uDCF2\uDCF4\uDCF5\uDD00-\uDD15\uDD20-\uDD39\uDD80-\uDDB7\uDDBE\uDDBF\uDE00-\uDE03\uDE05\uDE06\uDE0C-\uDE13\uDE15-\uDE17\uDE19-\uDE35\uDE60-\uDE7C\uDE80-\uDE9C\uDEC0-\uDEC7\uDEC9-\uDEE4\uDF00-\uDF35\uDF40-\uDF55\uDF60-\uDF72\uDF80-\uDF91]|\uD803[\uDC00-\uDC48\uDC80-\uDCB2\uDCC0-\uDCF2\uDD00-\uDD27\uDF00-\uDF1C\uDF27\uDF30-\uDF45]|\uD804[\uDC00-\uDC45\uDC82-\uDCB8\uDCD0-\uDCE8\uDD00-\uDD32\uDD44-\uDD46\uDD50-\uDD72\uDD76\uDD80-\uDDBF\uDDC1-\uDDC4\uDDDA\uDDDC\uDE00-\uDE11\uDE13-\uDE34\uDE37\uDE3E\uDE80-\uDE86\uDE88\uDE8A-\uDE8D\uDE8F-\uDE9D\uDE9F-\uDEA8\uDEB0-\uDEE8\uDF00-\uDF03\uDF05-\uDF0C\uDF0F\uDF10\uDF13-\uDF28\uDF2A-\uDF30\uDF32\uDF33\uDF35-\uDF39\uDF3D-\uDF44\uDF47\uDF48\uDF4B\uDF4C\uDF50\uDF57\uDF5D-\uDF63]|\uD805[\uDC00-\uDC41\uDC43-\uDC45\uDC47-\uDC4A\uDC80-\uDCC1\uDCC4\uDCC5\uDCC7\uDD80-\uDDB5\uDDB8-\uDDBE\uDDD8-\uDDDD\uDE00-\uDE3E\uDE40\uDE44\uDE80-\uDEB5\uDF00-\uDF1A\uDF1D-\uDF2A]|\uD806[\uDC00-\uDC38\uDCA0-\uDCDF\uDCFF\uDE00-\uDE32\uDE35-\uDE3E\uDE50-\uDE83\uDE86-\uDE97\uDE9D\uDEC0-\uDEF8]|\uD807[\uDC00-\uDC08\uDC0A-\uDC36\uDC38-\uDC3E\uDC40\uDC72-\uDC8F\uDC92-\uDCA7\uDCA9-\uDCB6\uDD00-\uDD06\uDD08\uDD09\uDD0B-\uDD36\uDD3A\uDD3C\uDD3D\uDD3F-\uDD41\uDD43\uDD46\uDD47\uDD60-\uDD65\uDD67\uDD68\uDD6A-\uDD8E\uDD90\uDD91\uDD93-\uDD96\uDD98\uDEE0-\uDEF6]|\uD808[\uDC00-\uDF99]|\uD809[\uDC00-\uDC6E\uDC80-\uDD43]|[\uD80C\uD81C-\uD820\uD840-\uD868\uD86A-\uD86C\uD86F-\uD872\uD874-\uD879][\uDC00-\uDFFF]|\uD80D[\uDC00-\uDC2E]|\uD811[\uDC00-\uDE46]|\uD81A[\uDC00-\uDE38\uDE40-\uDE5E\uDED0-\uDEED\uDF00-\uDF36\uDF40-\uDF43\uDF63-\uDF77\uDF7D-\uDF8F]|\uD81B[\uDE40-\uDE7F\uDF00-\uDF44\uDF50-\uDF7E\uDF93-\uDF9F\uDFE0\uDFE1]|\uD821[\uDC00-\uDFF1]|\uD822[\uDC00-\uDEF2]|\uD82C[\uDC00-\uDD1E\uDD70-\uDEFB]|\uD82F[\uDC00-\uDC6A\uDC70-\uDC7C\uDC80-\uDC88\uDC90-\uDC99\uDC9E]|\uD835[\uDC00-\uDC54\uDC56-\uDC9C\uDC9E\uDC9F\uDCA2\uDCA5\uDCA6\uDCA9-\uDCAC\uDCAE-\uDCB9\uDCBB\uDCBD-\uDCC3\uDCC5-\uDD05\uDD07-\uDD0A\uDD0D-\uDD14\uDD16-\uDD1C\uDD1E-\uDD39\uDD3B-\uDD3E\uDD40-\uDD44\uDD46\uDD4A-\uDD50\uDD52-\uDEA5\uDEA8-\uDEC0\uDEC2-\uDEDA\uDEDC-\uDEFA\uDEFC-\uDF14\uDF16-\uDF34\uDF36-\uDF4E\uDF50-\uDF6E\uDF70-\uDF88\uDF8A-\uDFA8\uDFAA-\uDFC2\uDFC4-\uDFCB]|\uD838[\uDC00-\uDC06\uDC08-\uDC18\uDC1B-\uDC21\uDC23\uDC24\uDC26-\uDC2A]|\uD83A[\uDC00-\uDCC4\uDD00-\uDD43\uDD47]|\uD83B[\uDE00-\uDE03\uDE05-\uDE1F\uDE21\uDE22\uDE24\uDE27\uDE29-\uDE32\uDE34-\uDE37\uDE39\uDE3B\uDE42\uDE47\uDE49\uDE4B\uDE4D-\uDE4F\uDE51\uDE52\uDE54\uDE57\uDE59\uDE5B\uDE5D\uDE5F\uDE61\uDE62\uDE64\uDE67-\uDE6A\uDE6C-\uDE72\uDE74-\uDE77\uDE79-\uDE7C\uDE7E\uDE80-\uDE89\uDE8B-\uDE9B\uDEA1-\uDEA3\uDEA5-\uDEA9\uDEAB-\uDEBB]|\uD83C[\uDD30-\uDD49\uDD50-\uDD69\uDD70-\uDD89]|\uD869[\uDC00-\uDED6\uDF00-\uDFFF]|\uD86D[\uDC00-\uDF34\uDF40-\uDFFF]|\uD86E[\uDC00-\uDC1D\uDC20-\uDFFF]|\uD873[\uDC00-\uDEA1\uDEB0-\uDFFF]|\uD87A[\uDC00-\uDFE0]|\uD87E[\uDC00-\uDE1D]' + }, + { + 'name': 'Any', + 'isBmpLast': true, + 'bmp': '\0-\uFFFF', + 'astral': '[\uD800-\uDBFF][\uDC00-\uDFFF]' + }, + { + 'name': 'Default_Ignorable_Code_Point', + 'bmp': '\xAD\u034F\u061C\u115F\u1160\u17B4\u17B5\u180B-\u180E\u200B-\u200F\u202A-\u202E\u2060-\u206F\u3164\uFE00-\uFE0F\uFEFF\uFFA0\uFFF0-\uFFF8', + 'astral': '\uD82F[\uDCA0-\uDCA3]|\uD834[\uDD73-\uDD7A]|[\uDB40-\uDB43][\uDC00-\uDFFF]' + }, + { + 'name': 'Lowercase', + 'bmp': 'a-z\xAA\xB5\xBA\xDF-\xF6\xF8-\xFF\u0101\u0103\u0105\u0107\u0109\u010B\u010D\u010F\u0111\u0113\u0115\u0117\u0119\u011B\u011D\u011F\u0121\u0123\u0125\u0127\u0129\u012B\u012D\u012F\u0131\u0133\u0135\u0137\u0138\u013A\u013C\u013E\u0140\u0142\u0144\u0146\u0148\u0149\u014B\u014D\u014F\u0151\u0153\u0155\u0157\u0159\u015B\u015D\u015F\u0161\u0163\u0165\u0167\u0169\u016B\u016D\u016F\u0171\u0173\u0175\u0177\u017A\u017C\u017E-\u0180\u0183\u0185\u0188\u018C\u018D\u0192\u0195\u0199-\u019B\u019E\u01A1\u01A3\u01A5\u01A8\u01AA\u01AB\u01AD\u01B0\u01B4\u01B6\u01B9\u01BA\u01BD-\u01BF\u01C6\u01C9\u01CC\u01CE\u01D0\u01D2\u01D4\u01D6\u01D8\u01DA\u01DC\u01DD\u01DF\u01E1\u01E3\u01E5\u01E7\u01E9\u01EB\u01ED\u01EF\u01F0\u01F3\u01F5\u01F9\u01FB\u01FD\u01FF\u0201\u0203\u0205\u0207\u0209\u020B\u020D\u020F\u0211\u0213\u0215\u0217\u0219\u021B\u021D\u021F\u0221\u0223\u0225\u0227\u0229\u022B\u022D\u022F\u0231\u0233-\u0239\u023C\u023F\u0240\u0242\u0247\u0249\u024B\u024D\u024F-\u0293\u0295-\u02B8\u02C0\u02C1\u02E0-\u02E4\u0345\u0371\u0373\u0377\u037A-\u037D\u0390\u03AC-\u03CE\u03D0\u03D1\u03D5-\u03D7\u03D9\u03DB\u03DD\u03DF\u03E1\u03E3\u03E5\u03E7\u03E9\u03EB\u03ED\u03EF-\u03F3\u03F5\u03F8\u03FB\u03FC\u0430-\u045F\u0461\u0463\u0465\u0467\u0469\u046B\u046D\u046F\u0471\u0473\u0475\u0477\u0479\u047B\u047D\u047F\u0481\u048B\u048D\u048F\u0491\u0493\u0495\u0497\u0499\u049B\u049D\u049F\u04A1\u04A3\u04A5\u04A7\u04A9\u04AB\u04AD\u04AF\u04B1\u04B3\u04B5\u04B7\u04B9\u04BB\u04BD\u04BF\u04C2\u04C4\u04C6\u04C8\u04CA\u04CC\u04CE\u04CF\u04D1\u04D3\u04D5\u04D7\u04D9\u04DB\u04DD\u04DF\u04E1\u04E3\u04E5\u04E7\u04E9\u04EB\u04ED\u04EF\u04F1\u04F3\u04F5\u04F7\u04F9\u04FB\u04FD\u04FF\u0501\u0503\u0505\u0507\u0509\u050B\u050D\u050F\u0511\u0513\u0515\u0517\u0519\u051B\u051D\u051F\u0521\u0523\u0525\u0527\u0529\u052B\u052D\u052F\u0560-\u0588\u10D0-\u10FA\u10FD-\u10FF\u13F8-\u13FD\u1C80-\u1C88\u1D00-\u1DBF\u1E01\u1E03\u1E05\u1E07\u1E09\u1E0B\u1E0D\u1E0F\u1E11\u1E13\u1E15\u1E17\u1E19\u1E1B\u1E1D\u1E1F\u1E21\u1E23\u1E25\u1E27\u1E29\u1E2B\u1E2D\u1E2F\u1E31\u1E33\u1E35\u1E37\u1E39\u1E3B\u1E3D\u1E3F\u1E41\u1E43\u1E45\u1E47\u1E49\u1E4B\u1E4D\u1E4F\u1E51\u1E53\u1E55\u1E57\u1E59\u1E5B\u1E5D\u1E5F\u1E61\u1E63\u1E65\u1E67\u1E69\u1E6B\u1E6D\u1E6F\u1E71\u1E73\u1E75\u1E77\u1E79\u1E7B\u1E7D\u1E7F\u1E81\u1E83\u1E85\u1E87\u1E89\u1E8B\u1E8D\u1E8F\u1E91\u1E93\u1E95-\u1E9D\u1E9F\u1EA1\u1EA3\u1EA5\u1EA7\u1EA9\u1EAB\u1EAD\u1EAF\u1EB1\u1EB3\u1EB5\u1EB7\u1EB9\u1EBB\u1EBD\u1EBF\u1EC1\u1EC3\u1EC5\u1EC7\u1EC9\u1ECB\u1ECD\u1ECF\u1ED1\u1ED3\u1ED5\u1ED7\u1ED9\u1EDB\u1EDD\u1EDF\u1EE1\u1EE3\u1EE5\u1EE7\u1EE9\u1EEB\u1EED\u1EEF\u1EF1\u1EF3\u1EF5\u1EF7\u1EF9\u1EFB\u1EFD\u1EFF-\u1F07\u1F10-\u1F15\u1F20-\u1F27\u1F30-\u1F37\u1F40-\u1F45\u1F50-\u1F57\u1F60-\u1F67\u1F70-\u1F7D\u1F80-\u1F87\u1F90-\u1F97\u1FA0-\u1FA7\u1FB0-\u1FB4\u1FB6\u1FB7\u1FBE\u1FC2-\u1FC4\u1FC6\u1FC7\u1FD0-\u1FD3\u1FD6\u1FD7\u1FE0-\u1FE7\u1FF2-\u1FF4\u1FF6\u1FF7\u2071\u207F\u2090-\u209C\u210A\u210E\u210F\u2113\u212F\u2134\u2139\u213C\u213D\u2146-\u2149\u214E\u2170-\u217F\u2184\u24D0-\u24E9\u2C30-\u2C5E\u2C61\u2C65\u2C66\u2C68\u2C6A\u2C6C\u2C71\u2C73\u2C74\u2C76-\u2C7D\u2C81\u2C83\u2C85\u2C87\u2C89\u2C8B\u2C8D\u2C8F\u2C91\u2C93\u2C95\u2C97\u2C99\u2C9B\u2C9D\u2C9F\u2CA1\u2CA3\u2CA5\u2CA7\u2CA9\u2CAB\u2CAD\u2CAF\u2CB1\u2CB3\u2CB5\u2CB7\u2CB9\u2CBB\u2CBD\u2CBF\u2CC1\u2CC3\u2CC5\u2CC7\u2CC9\u2CCB\u2CCD\u2CCF\u2CD1\u2CD3\u2CD5\u2CD7\u2CD9\u2CDB\u2CDD\u2CDF\u2CE1\u2CE3\u2CE4\u2CEC\u2CEE\u2CF3\u2D00-\u2D25\u2D27\u2D2D\uA641\uA643\uA645\uA647\uA649\uA64B\uA64D\uA64F\uA651\uA653\uA655\uA657\uA659\uA65B\uA65D\uA65F\uA661\uA663\uA665\uA667\uA669\uA66B\uA66D\uA681\uA683\uA685\uA687\uA689\uA68B\uA68D\uA68F\uA691\uA693\uA695\uA697\uA699\uA69B-\uA69D\uA723\uA725\uA727\uA729\uA72B\uA72D\uA72F-\uA731\uA733\uA735\uA737\uA739\uA73B\uA73D\uA73F\uA741\uA743\uA745\uA747\uA749\uA74B\uA74D\uA74F\uA751\uA753\uA755\uA757\uA759\uA75B\uA75D\uA75F\uA761\uA763\uA765\uA767\uA769\uA76B\uA76D\uA76F-\uA778\uA77A\uA77C\uA77F\uA781\uA783\uA785\uA787\uA78C\uA78E\uA791\uA793-\uA795\uA797\uA799\uA79B\uA79D\uA79F\uA7A1\uA7A3\uA7A5\uA7A7\uA7A9\uA7AF\uA7B5\uA7B7\uA7B9\uA7F8-\uA7FA\uAB30-\uAB5A\uAB5C-\uAB65\uAB70-\uABBF\uFB00-\uFB06\uFB13-\uFB17\uFF41-\uFF5A', + 'astral': '\uD801[\uDC28-\uDC4F\uDCD8-\uDCFB]|\uD803[\uDCC0-\uDCF2]|\uD806[\uDCC0-\uDCDF]|\uD81B[\uDE60-\uDE7F]|\uD835[\uDC1A-\uDC33\uDC4E-\uDC54\uDC56-\uDC67\uDC82-\uDC9B\uDCB6-\uDCB9\uDCBB\uDCBD-\uDCC3\uDCC5-\uDCCF\uDCEA-\uDD03\uDD1E-\uDD37\uDD52-\uDD6B\uDD86-\uDD9F\uDDBA-\uDDD3\uDDEE-\uDE07\uDE22-\uDE3B\uDE56-\uDE6F\uDE8A-\uDEA5\uDEC2-\uDEDA\uDEDC-\uDEE1\uDEFC-\uDF14\uDF16-\uDF1B\uDF36-\uDF4E\uDF50-\uDF55\uDF70-\uDF88\uDF8A-\uDF8F\uDFAA-\uDFC2\uDFC4-\uDFC9\uDFCB]|\uD83A[\uDD22-\uDD43]' + }, + { + 'name': 'Noncharacter_Code_Point', + 'bmp': '\uFDD0-\uFDEF\uFFFE\uFFFF', + 'astral': '[\uD83F\uD87F\uD8BF\uD8FF\uD93F\uD97F\uD9BF\uD9FF\uDA3F\uDA7F\uDABF\uDAFF\uDB3F\uDB7F\uDBBF\uDBFF][\uDFFE\uDFFF]' + }, + { + 'name': 'Uppercase', + 'bmp': 'A-Z\xC0-\xD6\xD8-\xDE\u0100\u0102\u0104\u0106\u0108\u010A\u010C\u010E\u0110\u0112\u0114\u0116\u0118\u011A\u011C\u011E\u0120\u0122\u0124\u0126\u0128\u012A\u012C\u012E\u0130\u0132\u0134\u0136\u0139\u013B\u013D\u013F\u0141\u0143\u0145\u0147\u014A\u014C\u014E\u0150\u0152\u0154\u0156\u0158\u015A\u015C\u015E\u0160\u0162\u0164\u0166\u0168\u016A\u016C\u016E\u0170\u0172\u0174\u0176\u0178\u0179\u017B\u017D\u0181\u0182\u0184\u0186\u0187\u0189-\u018B\u018E-\u0191\u0193\u0194\u0196-\u0198\u019C\u019D\u019F\u01A0\u01A2\u01A4\u01A6\u01A7\u01A9\u01AC\u01AE\u01AF\u01B1-\u01B3\u01B5\u01B7\u01B8\u01BC\u01C4\u01C7\u01CA\u01CD\u01CF\u01D1\u01D3\u01D5\u01D7\u01D9\u01DB\u01DE\u01E0\u01E2\u01E4\u01E6\u01E8\u01EA\u01EC\u01EE\u01F1\u01F4\u01F6-\u01F8\u01FA\u01FC\u01FE\u0200\u0202\u0204\u0206\u0208\u020A\u020C\u020E\u0210\u0212\u0214\u0216\u0218\u021A\u021C\u021E\u0220\u0222\u0224\u0226\u0228\u022A\u022C\u022E\u0230\u0232\u023A\u023B\u023D\u023E\u0241\u0243-\u0246\u0248\u024A\u024C\u024E\u0370\u0372\u0376\u037F\u0386\u0388-\u038A\u038C\u038E\u038F\u0391-\u03A1\u03A3-\u03AB\u03CF\u03D2-\u03D4\u03D8\u03DA\u03DC\u03DE\u03E0\u03E2\u03E4\u03E6\u03E8\u03EA\u03EC\u03EE\u03F4\u03F7\u03F9\u03FA\u03FD-\u042F\u0460\u0462\u0464\u0466\u0468\u046A\u046C\u046E\u0470\u0472\u0474\u0476\u0478\u047A\u047C\u047E\u0480\u048A\u048C\u048E\u0490\u0492\u0494\u0496\u0498\u049A\u049C\u049E\u04A0\u04A2\u04A4\u04A6\u04A8\u04AA\u04AC\u04AE\u04B0\u04B2\u04B4\u04B6\u04B8\u04BA\u04BC\u04BE\u04C0\u04C1\u04C3\u04C5\u04C7\u04C9\u04CB\u04CD\u04D0\u04D2\u04D4\u04D6\u04D8\u04DA\u04DC\u04DE\u04E0\u04E2\u04E4\u04E6\u04E8\u04EA\u04EC\u04EE\u04F0\u04F2\u04F4\u04F6\u04F8\u04FA\u04FC\u04FE\u0500\u0502\u0504\u0506\u0508\u050A\u050C\u050E\u0510\u0512\u0514\u0516\u0518\u051A\u051C\u051E\u0520\u0522\u0524\u0526\u0528\u052A\u052C\u052E\u0531-\u0556\u10A0-\u10C5\u10C7\u10CD\u13A0-\u13F5\u1C90-\u1CBA\u1CBD-\u1CBF\u1E00\u1E02\u1E04\u1E06\u1E08\u1E0A\u1E0C\u1E0E\u1E10\u1E12\u1E14\u1E16\u1E18\u1E1A\u1E1C\u1E1E\u1E20\u1E22\u1E24\u1E26\u1E28\u1E2A\u1E2C\u1E2E\u1E30\u1E32\u1E34\u1E36\u1E38\u1E3A\u1E3C\u1E3E\u1E40\u1E42\u1E44\u1E46\u1E48\u1E4A\u1E4C\u1E4E\u1E50\u1E52\u1E54\u1E56\u1E58\u1E5A\u1E5C\u1E5E\u1E60\u1E62\u1E64\u1E66\u1E68\u1E6A\u1E6C\u1E6E\u1E70\u1E72\u1E74\u1E76\u1E78\u1E7A\u1E7C\u1E7E\u1E80\u1E82\u1E84\u1E86\u1E88\u1E8A\u1E8C\u1E8E\u1E90\u1E92\u1E94\u1E9E\u1EA0\u1EA2\u1EA4\u1EA6\u1EA8\u1EAA\u1EAC\u1EAE\u1EB0\u1EB2\u1EB4\u1EB6\u1EB8\u1EBA\u1EBC\u1EBE\u1EC0\u1EC2\u1EC4\u1EC6\u1EC8\u1ECA\u1ECC\u1ECE\u1ED0\u1ED2\u1ED4\u1ED6\u1ED8\u1EDA\u1EDC\u1EDE\u1EE0\u1EE2\u1EE4\u1EE6\u1EE8\u1EEA\u1EEC\u1EEE\u1EF0\u1EF2\u1EF4\u1EF6\u1EF8\u1EFA\u1EFC\u1EFE\u1F08-\u1F0F\u1F18-\u1F1D\u1F28-\u1F2F\u1F38-\u1F3F\u1F48-\u1F4D\u1F59\u1F5B\u1F5D\u1F5F\u1F68-\u1F6F\u1FB8-\u1FBB\u1FC8-\u1FCB\u1FD8-\u1FDB\u1FE8-\u1FEC\u1FF8-\u1FFB\u2102\u2107\u210B-\u210D\u2110-\u2112\u2115\u2119-\u211D\u2124\u2126\u2128\u212A-\u212D\u2130-\u2133\u213E\u213F\u2145\u2160-\u216F\u2183\u24B6-\u24CF\u2C00-\u2C2E\u2C60\u2C62-\u2C64\u2C67\u2C69\u2C6B\u2C6D-\u2C70\u2C72\u2C75\u2C7E-\u2C80\u2C82\u2C84\u2C86\u2C88\u2C8A\u2C8C\u2C8E\u2C90\u2C92\u2C94\u2C96\u2C98\u2C9A\u2C9C\u2C9E\u2CA0\u2CA2\u2CA4\u2CA6\u2CA8\u2CAA\u2CAC\u2CAE\u2CB0\u2CB2\u2CB4\u2CB6\u2CB8\u2CBA\u2CBC\u2CBE\u2CC0\u2CC2\u2CC4\u2CC6\u2CC8\u2CCA\u2CCC\u2CCE\u2CD0\u2CD2\u2CD4\u2CD6\u2CD8\u2CDA\u2CDC\u2CDE\u2CE0\u2CE2\u2CEB\u2CED\u2CF2\uA640\uA642\uA644\uA646\uA648\uA64A\uA64C\uA64E\uA650\uA652\uA654\uA656\uA658\uA65A\uA65C\uA65E\uA660\uA662\uA664\uA666\uA668\uA66A\uA66C\uA680\uA682\uA684\uA686\uA688\uA68A\uA68C\uA68E\uA690\uA692\uA694\uA696\uA698\uA69A\uA722\uA724\uA726\uA728\uA72A\uA72C\uA72E\uA732\uA734\uA736\uA738\uA73A\uA73C\uA73E\uA740\uA742\uA744\uA746\uA748\uA74A\uA74C\uA74E\uA750\uA752\uA754\uA756\uA758\uA75A\uA75C\uA75E\uA760\uA762\uA764\uA766\uA768\uA76A\uA76C\uA76E\uA779\uA77B\uA77D\uA77E\uA780\uA782\uA784\uA786\uA78B\uA78D\uA790\uA792\uA796\uA798\uA79A\uA79C\uA79E\uA7A0\uA7A2\uA7A4\uA7A6\uA7A8\uA7AA-\uA7AE\uA7B0-\uA7B4\uA7B6\uA7B8\uFF21-\uFF3A', + 'astral': '\uD801[\uDC00-\uDC27\uDCB0-\uDCD3]|\uD803[\uDC80-\uDCB2]|\uD806[\uDCA0-\uDCBF]|\uD81B[\uDE40-\uDE5F]|\uD835[\uDC00-\uDC19\uDC34-\uDC4D\uDC68-\uDC81\uDC9C\uDC9E\uDC9F\uDCA2\uDCA5\uDCA6\uDCA9-\uDCAC\uDCAE-\uDCB5\uDCD0-\uDCE9\uDD04\uDD05\uDD07-\uDD0A\uDD0D-\uDD14\uDD16-\uDD1C\uDD38\uDD39\uDD3B-\uDD3E\uDD40-\uDD44\uDD46\uDD4A-\uDD50\uDD6C-\uDD85\uDDA0-\uDDB9\uDDD4-\uDDED\uDE08-\uDE21\uDE3C-\uDE55\uDE70-\uDE89\uDEA8-\uDEC0\uDEE2-\uDEFA\uDF1C-\uDF34\uDF56-\uDF6E\uDF90-\uDFA8\uDFCA]|\uD83A[\uDD00-\uDD21]|\uD83C[\uDD30-\uDD49\uDD50-\uDD69\uDD70-\uDD89]' + }, + { + 'name': 'White_Space', + 'bmp': '\t-\r \x85\xA0\u1680\u2000-\u200A\u2028\u2029\u202F\u205F\u3000' + } +]; + +var unicodeProperties = createCommonjsModule(function (module, exports) { +"use strict"; + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.default = void 0; + +var _properties = _interopRequireDefault(properties); + +function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } + +/*! + * XRegExp Unicode Properties 4.2.0 + * + * Steven Levithan (c) 2012-present MIT License + * Unicode data by Mathias Bynens + */ +var _default = function _default(XRegExp) { + /** + * Adds properties to meet the UTS #18 Level 1 RL1.2 requirements for Unicode regex support. See + * . Following are definitions of these properties from + * UAX #44 : + * + * - Alphabetic + * Characters with the Alphabetic property. Generated from: Lowercase + Uppercase + Lt + Lm + + * Lo + Nl + Other_Alphabetic. + * + * - Default_Ignorable_Code_Point + * For programmatic determination of default ignorable code points. New characters that should + * be ignored in rendering (unless explicitly supported) will be assigned in these ranges, + * permitting programs to correctly handle the default rendering of such characters when not + * otherwise supported. + * + * - Lowercase + * Characters with the Lowercase property. Generated from: Ll + Other_Lowercase. + * + * - Noncharacter_Code_Point + * Code points permanently reserved for internal use. + * + * - Uppercase + * Characters with the Uppercase property. Generated from: Lu + Other_Uppercase. + * + * - White_Space + * Spaces, separator characters and other control characters which should be treated by + * programming languages as "white space" for the purpose of parsing elements. + * + * The properties ASCII, Any, and Assigned are also included but are not defined in UAX #44. UTS + * #18 RL1.2 additionally requires support for Unicode scripts and general categories. These are + * included in XRegExp's Unicode Categories and Unicode Scripts addons. + * + * Token names are case insensitive, and any spaces, hyphens, and underscores are ignored. + * + * Uses Unicode 11.0.0. + * + * @requires XRegExp, Unicode Base + */ + if (!XRegExp.addUnicodeData) { + throw new ReferenceError('Unicode Base must be loaded before Unicode Properties'); + } + + var unicodeData = _properties.default; // Add non-generated data + + unicodeData.push({ + name: 'Assigned', + // Since this is defined as the inverse of Unicode category Cn (Unassigned), the Unicode + // Categories addon is required to use this property + inverseOf: 'Cn' + }); + XRegExp.addUnicodeData(unicodeData); +}; + +exports.default = _default; +module.exports = exports["default"]; +}); + +unwrapExports(unicodeProperties); + +var scripts = [ + { + 'name': 'Adlam', + 'astral': '\uD83A[\uDD00-\uDD4A\uDD50-\uDD59\uDD5E\uDD5F]' + }, + { + 'name': 'Ahom', + 'astral': '\uD805[\uDF00-\uDF1A\uDF1D-\uDF2B\uDF30-\uDF3F]' + }, + { + 'name': 'Anatolian_Hieroglyphs', + 'astral': '\uD811[\uDC00-\uDE46]' + }, + { + 'name': 'Arabic', + 'bmp': '\u0600-\u0604\u0606-\u060B\u060D-\u061A\u061C\u061E\u0620-\u063F\u0641-\u064A\u0656-\u066F\u0671-\u06DC\u06DE-\u06FF\u0750-\u077F\u08A0-\u08B4\u08B6-\u08BD\u08D3-\u08E1\u08E3-\u08FF\uFB50-\uFBC1\uFBD3-\uFD3D\uFD50-\uFD8F\uFD92-\uFDC7\uFDF0-\uFDFD\uFE70-\uFE74\uFE76-\uFEFC', + 'astral': '\uD803[\uDE60-\uDE7E]|\uD83B[\uDE00-\uDE03\uDE05-\uDE1F\uDE21\uDE22\uDE24\uDE27\uDE29-\uDE32\uDE34-\uDE37\uDE39\uDE3B\uDE42\uDE47\uDE49\uDE4B\uDE4D-\uDE4F\uDE51\uDE52\uDE54\uDE57\uDE59\uDE5B\uDE5D\uDE5F\uDE61\uDE62\uDE64\uDE67-\uDE6A\uDE6C-\uDE72\uDE74-\uDE77\uDE79-\uDE7C\uDE7E\uDE80-\uDE89\uDE8B-\uDE9B\uDEA1-\uDEA3\uDEA5-\uDEA9\uDEAB-\uDEBB\uDEF0\uDEF1]' + }, + { + 'name': 'Armenian', + 'bmp': '\u0531-\u0556\u0559-\u0588\u058A\u058D-\u058F\uFB13-\uFB17' + }, + { + 'name': 'Avestan', + 'astral': '\uD802[\uDF00-\uDF35\uDF39-\uDF3F]' + }, + { + 'name': 'Balinese', + 'bmp': '\u1B00-\u1B4B\u1B50-\u1B7C' + }, + { + 'name': 'Bamum', + 'bmp': '\uA6A0-\uA6F7', + 'astral': '\uD81A[\uDC00-\uDE38]' + }, + { + 'name': 'Bassa_Vah', + 'astral': '\uD81A[\uDED0-\uDEED\uDEF0-\uDEF5]' + }, + { + 'name': 'Batak', + 'bmp': '\u1BC0-\u1BF3\u1BFC-\u1BFF' + }, + { + 'name': 'Bengali', + 'bmp': '\u0980-\u0983\u0985-\u098C\u098F\u0990\u0993-\u09A8\u09AA-\u09B0\u09B2\u09B6-\u09B9\u09BC-\u09C4\u09C7\u09C8\u09CB-\u09CE\u09D7\u09DC\u09DD\u09DF-\u09E3\u09E6-\u09FE' + }, + { + 'name': 'Bhaiksuki', + 'astral': '\uD807[\uDC00-\uDC08\uDC0A-\uDC36\uDC38-\uDC45\uDC50-\uDC6C]' + }, + { + 'name': 'Bopomofo', + 'bmp': '\u02EA\u02EB\u3105-\u312F\u31A0-\u31BA' + }, + { + 'name': 'Brahmi', + 'astral': '\uD804[\uDC00-\uDC4D\uDC52-\uDC6F\uDC7F]' + }, + { + 'name': 'Braille', + 'bmp': '\u2800-\u28FF' + }, + { + 'name': 'Buginese', + 'bmp': '\u1A00-\u1A1B\u1A1E\u1A1F' + }, + { + 'name': 'Buhid', + 'bmp': '\u1740-\u1753' + }, + { + 'name': 'Canadian_Aboriginal', + 'bmp': '\u1400-\u167F\u18B0-\u18F5' + }, + { + 'name': 'Carian', + 'astral': '\uD800[\uDEA0-\uDED0]' + }, + { + 'name': 'Caucasian_Albanian', + 'astral': '\uD801[\uDD30-\uDD63\uDD6F]' + }, + { + 'name': 'Chakma', + 'astral': '\uD804[\uDD00-\uDD34\uDD36-\uDD46]' + }, + { + 'name': 'Cham', + 'bmp': '\uAA00-\uAA36\uAA40-\uAA4D\uAA50-\uAA59\uAA5C-\uAA5F' + }, + { + 'name': 'Cherokee', + 'bmp': '\u13A0-\u13F5\u13F8-\u13FD\uAB70-\uABBF' + }, + { + 'name': 'Common', + 'bmp': '\0-@\\[-`\\{-\xA9\xAB-\xB9\xBB-\xBF\xD7\xF7\u02B9-\u02DF\u02E5-\u02E9\u02EC-\u02FF\u0374\u037E\u0385\u0387\u0589\u0605\u060C\u061B\u061F\u0640\u06DD\u08E2\u0964\u0965\u0E3F\u0FD5-\u0FD8\u10FB\u16EB-\u16ED\u1735\u1736\u1802\u1803\u1805\u1CD3\u1CE1\u1CE9-\u1CEC\u1CEE-\u1CF3\u1CF5-\u1CF7\u2000-\u200B\u200E-\u2064\u2066-\u2070\u2074-\u207E\u2080-\u208E\u20A0-\u20BF\u2100-\u2125\u2127-\u2129\u212C-\u2131\u2133-\u214D\u214F-\u215F\u2189-\u218B\u2190-\u2426\u2440-\u244A\u2460-\u27FF\u2900-\u2B73\u2B76-\u2B95\u2B98-\u2BC8\u2BCA-\u2BFE\u2E00-\u2E4E\u2FF0-\u2FFB\u3000-\u3004\u3006\u3008-\u3020\u3030-\u3037\u303C-\u303F\u309B\u309C\u30A0\u30FB\u30FC\u3190-\u319F\u31C0-\u31E3\u3220-\u325F\u327F-\u32CF\u3358-\u33FF\u4DC0-\u4DFF\uA700-\uA721\uA788-\uA78A\uA830-\uA839\uA92E\uA9CF\uAB5B\uFD3E\uFD3F\uFE10-\uFE19\uFE30-\uFE52\uFE54-\uFE66\uFE68-\uFE6B\uFEFF\uFF01-\uFF20\uFF3B-\uFF40\uFF5B-\uFF65\uFF70\uFF9E\uFF9F\uFFE0-\uFFE6\uFFE8-\uFFEE\uFFF9-\uFFFD', + 'astral': '\uD800[\uDD00-\uDD02\uDD07-\uDD33\uDD37-\uDD3F\uDD90-\uDD9B\uDDD0-\uDDFC\uDEE1-\uDEFB]|\uD82F[\uDCA0-\uDCA3]|\uD834[\uDC00-\uDCF5\uDD00-\uDD26\uDD29-\uDD66\uDD6A-\uDD7A\uDD83\uDD84\uDD8C-\uDDA9\uDDAE-\uDDE8\uDEE0-\uDEF3\uDF00-\uDF56\uDF60-\uDF78]|\uD835[\uDC00-\uDC54\uDC56-\uDC9C\uDC9E\uDC9F\uDCA2\uDCA5\uDCA6\uDCA9-\uDCAC\uDCAE-\uDCB9\uDCBB\uDCBD-\uDCC3\uDCC5-\uDD05\uDD07-\uDD0A\uDD0D-\uDD14\uDD16-\uDD1C\uDD1E-\uDD39\uDD3B-\uDD3E\uDD40-\uDD44\uDD46\uDD4A-\uDD50\uDD52-\uDEA5\uDEA8-\uDFCB\uDFCE-\uDFFF]|\uD83B[\uDC71-\uDCB4]|\uD83C[\uDC00-\uDC2B\uDC30-\uDC93\uDCA0-\uDCAE\uDCB1-\uDCBF\uDCC1-\uDCCF\uDCD1-\uDCF5\uDD00-\uDD0C\uDD10-\uDD6B\uDD70-\uDDAC\uDDE6-\uDDFF\uDE01\uDE02\uDE10-\uDE3B\uDE40-\uDE48\uDE50\uDE51\uDE60-\uDE65\uDF00-\uDFFF]|\uD83D[\uDC00-\uDED4\uDEE0-\uDEEC\uDEF0-\uDEF9\uDF00-\uDF73\uDF80-\uDFD8]|\uD83E[\uDC00-\uDC0B\uDC10-\uDC47\uDC50-\uDC59\uDC60-\uDC87\uDC90-\uDCAD\uDD00-\uDD0B\uDD10-\uDD3E\uDD40-\uDD70\uDD73-\uDD76\uDD7A\uDD7C-\uDDA2\uDDB0-\uDDB9\uDDC0-\uDDC2\uDDD0-\uDDFF\uDE60-\uDE6D]|\uDB40[\uDC01\uDC20-\uDC7F]' + }, + { + 'name': 'Coptic', + 'bmp': '\u03E2-\u03EF\u2C80-\u2CF3\u2CF9-\u2CFF' + }, + { + 'name': 'Cuneiform', + 'astral': '\uD808[\uDC00-\uDF99]|\uD809[\uDC00-\uDC6E\uDC70-\uDC74\uDC80-\uDD43]' + }, + { + 'name': 'Cypriot', + 'astral': '\uD802[\uDC00-\uDC05\uDC08\uDC0A-\uDC35\uDC37\uDC38\uDC3C\uDC3F]' + }, + { + 'name': 'Cyrillic', + 'bmp': '\u0400-\u0484\u0487-\u052F\u1C80-\u1C88\u1D2B\u1D78\u2DE0-\u2DFF\uA640-\uA69F\uFE2E\uFE2F' + }, + { + 'name': 'Deseret', + 'astral': '\uD801[\uDC00-\uDC4F]' + }, + { + 'name': 'Devanagari', + 'bmp': '\u0900-\u0950\u0953-\u0963\u0966-\u097F\uA8E0-\uA8FF' + }, + { + 'name': 'Dogra', + 'astral': '\uD806[\uDC00-\uDC3B]' + }, + { + 'name': 'Duployan', + 'astral': '\uD82F[\uDC00-\uDC6A\uDC70-\uDC7C\uDC80-\uDC88\uDC90-\uDC99\uDC9C-\uDC9F]' + }, + { + 'name': 'Egyptian_Hieroglyphs', + 'astral': '\uD80C[\uDC00-\uDFFF]|\uD80D[\uDC00-\uDC2E]' + }, + { + 'name': 'Elbasan', + 'astral': '\uD801[\uDD00-\uDD27]' + }, + { + 'name': 'Ethiopic', + 'bmp': '\u1200-\u1248\u124A-\u124D\u1250-\u1256\u1258\u125A-\u125D\u1260-\u1288\u128A-\u128D\u1290-\u12B0\u12B2-\u12B5\u12B8-\u12BE\u12C0\u12C2-\u12C5\u12C8-\u12D6\u12D8-\u1310\u1312-\u1315\u1318-\u135A\u135D-\u137C\u1380-\u1399\u2D80-\u2D96\u2DA0-\u2DA6\u2DA8-\u2DAE\u2DB0-\u2DB6\u2DB8-\u2DBE\u2DC0-\u2DC6\u2DC8-\u2DCE\u2DD0-\u2DD6\u2DD8-\u2DDE\uAB01-\uAB06\uAB09-\uAB0E\uAB11-\uAB16\uAB20-\uAB26\uAB28-\uAB2E' + }, + { + 'name': 'Georgian', + 'bmp': '\u10A0-\u10C5\u10C7\u10CD\u10D0-\u10FA\u10FC-\u10FF\u1C90-\u1CBA\u1CBD-\u1CBF\u2D00-\u2D25\u2D27\u2D2D' + }, + { + 'name': 'Glagolitic', + 'bmp': '\u2C00-\u2C2E\u2C30-\u2C5E', + 'astral': '\uD838[\uDC00-\uDC06\uDC08-\uDC18\uDC1B-\uDC21\uDC23\uDC24\uDC26-\uDC2A]' + }, + { + 'name': 'Gothic', + 'astral': '\uD800[\uDF30-\uDF4A]' + }, + { + 'name': 'Grantha', + 'astral': '\uD804[\uDF00-\uDF03\uDF05-\uDF0C\uDF0F\uDF10\uDF13-\uDF28\uDF2A-\uDF30\uDF32\uDF33\uDF35-\uDF39\uDF3C-\uDF44\uDF47\uDF48\uDF4B-\uDF4D\uDF50\uDF57\uDF5D-\uDF63\uDF66-\uDF6C\uDF70-\uDF74]' + }, + { + 'name': 'Greek', + 'bmp': '\u0370-\u0373\u0375-\u0377\u037A-\u037D\u037F\u0384\u0386\u0388-\u038A\u038C\u038E-\u03A1\u03A3-\u03E1\u03F0-\u03FF\u1D26-\u1D2A\u1D5D-\u1D61\u1D66-\u1D6A\u1DBF\u1F00-\u1F15\u1F18-\u1F1D\u1F20-\u1F45\u1F48-\u1F4D\u1F50-\u1F57\u1F59\u1F5B\u1F5D\u1F5F-\u1F7D\u1F80-\u1FB4\u1FB6-\u1FC4\u1FC6-\u1FD3\u1FD6-\u1FDB\u1FDD-\u1FEF\u1FF2-\u1FF4\u1FF6-\u1FFE\u2126\uAB65', + 'astral': '\uD800[\uDD40-\uDD8E\uDDA0]|\uD834[\uDE00-\uDE45]' + }, + { + 'name': 'Gujarati', + 'bmp': '\u0A81-\u0A83\u0A85-\u0A8D\u0A8F-\u0A91\u0A93-\u0AA8\u0AAA-\u0AB0\u0AB2\u0AB3\u0AB5-\u0AB9\u0ABC-\u0AC5\u0AC7-\u0AC9\u0ACB-\u0ACD\u0AD0\u0AE0-\u0AE3\u0AE6-\u0AF1\u0AF9-\u0AFF' + }, + { + 'name': 'Gunjala_Gondi', + 'astral': '\uD807[\uDD60-\uDD65\uDD67\uDD68\uDD6A-\uDD8E\uDD90\uDD91\uDD93-\uDD98\uDDA0-\uDDA9]' + }, + { + 'name': 'Gurmukhi', + 'bmp': '\u0A01-\u0A03\u0A05-\u0A0A\u0A0F\u0A10\u0A13-\u0A28\u0A2A-\u0A30\u0A32\u0A33\u0A35\u0A36\u0A38\u0A39\u0A3C\u0A3E-\u0A42\u0A47\u0A48\u0A4B-\u0A4D\u0A51\u0A59-\u0A5C\u0A5E\u0A66-\u0A76' + }, + { + 'name': 'Han', + 'bmp': '\u2E80-\u2E99\u2E9B-\u2EF3\u2F00-\u2FD5\u3005\u3007\u3021-\u3029\u3038-\u303B\u3400-\u4DB5\u4E00-\u9FEF\uF900-\uFA6D\uFA70-\uFAD9', + 'astral': '[\uD840-\uD868\uD86A-\uD86C\uD86F-\uD872\uD874-\uD879][\uDC00-\uDFFF]|\uD869[\uDC00-\uDED6\uDF00-\uDFFF]|\uD86D[\uDC00-\uDF34\uDF40-\uDFFF]|\uD86E[\uDC00-\uDC1D\uDC20-\uDFFF]|\uD873[\uDC00-\uDEA1\uDEB0-\uDFFF]|\uD87A[\uDC00-\uDFE0]|\uD87E[\uDC00-\uDE1D]' + }, + { + 'name': 'Hangul', + 'bmp': '\u1100-\u11FF\u302E\u302F\u3131-\u318E\u3200-\u321E\u3260-\u327E\uA960-\uA97C\uAC00-\uD7A3\uD7B0-\uD7C6\uD7CB-\uD7FB\uFFA0-\uFFBE\uFFC2-\uFFC7\uFFCA-\uFFCF\uFFD2-\uFFD7\uFFDA-\uFFDC' + }, + { + 'name': 'Hanifi_Rohingya', + 'astral': '\uD803[\uDD00-\uDD27\uDD30-\uDD39]' + }, + { + 'name': 'Hanunoo', + 'bmp': '\u1720-\u1734' + }, + { + 'name': 'Hatran', + 'astral': '\uD802[\uDCE0-\uDCF2\uDCF4\uDCF5\uDCFB-\uDCFF]' + }, + { + 'name': 'Hebrew', + 'bmp': '\u0591-\u05C7\u05D0-\u05EA\u05EF-\u05F4\uFB1D-\uFB36\uFB38-\uFB3C\uFB3E\uFB40\uFB41\uFB43\uFB44\uFB46-\uFB4F' + }, + { + 'name': 'Hiragana', + 'bmp': '\u3041-\u3096\u309D-\u309F', + 'astral': '\uD82C[\uDC01-\uDD1E]|\uD83C\uDE00' + }, + { + 'name': 'Imperial_Aramaic', + 'astral': '\uD802[\uDC40-\uDC55\uDC57-\uDC5F]' + }, + { + 'name': 'Inherited', + 'bmp': '\u0300-\u036F\u0485\u0486\u064B-\u0655\u0670\u0951\u0952\u1AB0-\u1ABE\u1CD0-\u1CD2\u1CD4-\u1CE0\u1CE2-\u1CE8\u1CED\u1CF4\u1CF8\u1CF9\u1DC0-\u1DF9\u1DFB-\u1DFF\u200C\u200D\u20D0-\u20F0\u302A-\u302D\u3099\u309A\uFE00-\uFE0F\uFE20-\uFE2D', + 'astral': '\uD800[\uDDFD\uDEE0]|\uD804\uDF3B|\uD834[\uDD67-\uDD69\uDD7B-\uDD82\uDD85-\uDD8B\uDDAA-\uDDAD]|\uDB40[\uDD00-\uDDEF]' + }, + { + 'name': 'Inscriptional_Pahlavi', + 'astral': '\uD802[\uDF60-\uDF72\uDF78-\uDF7F]' + }, + { + 'name': 'Inscriptional_Parthian', + 'astral': '\uD802[\uDF40-\uDF55\uDF58-\uDF5F]' + }, + { + 'name': 'Javanese', + 'bmp': '\uA980-\uA9CD\uA9D0-\uA9D9\uA9DE\uA9DF' + }, + { + 'name': 'Kaithi', + 'astral': '\uD804[\uDC80-\uDCC1\uDCCD]' + }, + { + 'name': 'Kannada', + 'bmp': '\u0C80-\u0C8C\u0C8E-\u0C90\u0C92-\u0CA8\u0CAA-\u0CB3\u0CB5-\u0CB9\u0CBC-\u0CC4\u0CC6-\u0CC8\u0CCA-\u0CCD\u0CD5\u0CD6\u0CDE\u0CE0-\u0CE3\u0CE6-\u0CEF\u0CF1\u0CF2' + }, + { + 'name': 'Katakana', + 'bmp': '\u30A1-\u30FA\u30FD-\u30FF\u31F0-\u31FF\u32D0-\u32FE\u3300-\u3357\uFF66-\uFF6F\uFF71-\uFF9D', + 'astral': '\uD82C\uDC00' + }, + { + 'name': 'Kayah_Li', + 'bmp': '\uA900-\uA92D\uA92F' + }, + { + 'name': 'Kharoshthi', + 'astral': '\uD802[\uDE00-\uDE03\uDE05\uDE06\uDE0C-\uDE13\uDE15-\uDE17\uDE19-\uDE35\uDE38-\uDE3A\uDE3F-\uDE48\uDE50-\uDE58]' + }, + { + 'name': 'Khmer', + 'bmp': '\u1780-\u17DD\u17E0-\u17E9\u17F0-\u17F9\u19E0-\u19FF' + }, + { + 'name': 'Khojki', + 'astral': '\uD804[\uDE00-\uDE11\uDE13-\uDE3E]' + }, + { + 'name': 'Khudawadi', + 'astral': '\uD804[\uDEB0-\uDEEA\uDEF0-\uDEF9]' + }, + { + 'name': 'Lao', + 'bmp': '\u0E81\u0E82\u0E84\u0E87\u0E88\u0E8A\u0E8D\u0E94-\u0E97\u0E99-\u0E9F\u0EA1-\u0EA3\u0EA5\u0EA7\u0EAA\u0EAB\u0EAD-\u0EB9\u0EBB-\u0EBD\u0EC0-\u0EC4\u0EC6\u0EC8-\u0ECD\u0ED0-\u0ED9\u0EDC-\u0EDF' + }, + { + 'name': 'Latin', + 'bmp': 'A-Za-z\xAA\xBA\xC0-\xD6\xD8-\xF6\xF8-\u02B8\u02E0-\u02E4\u1D00-\u1D25\u1D2C-\u1D5C\u1D62-\u1D65\u1D6B-\u1D77\u1D79-\u1DBE\u1E00-\u1EFF\u2071\u207F\u2090-\u209C\u212A\u212B\u2132\u214E\u2160-\u2188\u2C60-\u2C7F\uA722-\uA787\uA78B-\uA7B9\uA7F7-\uA7FF\uAB30-\uAB5A\uAB5C-\uAB64\uFB00-\uFB06\uFF21-\uFF3A\uFF41-\uFF5A' + }, + { + 'name': 'Lepcha', + 'bmp': '\u1C00-\u1C37\u1C3B-\u1C49\u1C4D-\u1C4F' + }, + { + 'name': 'Limbu', + 'bmp': '\u1900-\u191E\u1920-\u192B\u1930-\u193B\u1940\u1944-\u194F' + }, + { + 'name': 'Linear_A', + 'astral': '\uD801[\uDE00-\uDF36\uDF40-\uDF55\uDF60-\uDF67]' + }, + { + 'name': 'Linear_B', + 'astral': '\uD800[\uDC00-\uDC0B\uDC0D-\uDC26\uDC28-\uDC3A\uDC3C\uDC3D\uDC3F-\uDC4D\uDC50-\uDC5D\uDC80-\uDCFA]' + }, + { + 'name': 'Lisu', + 'bmp': '\uA4D0-\uA4FF' + }, + { + 'name': 'Lycian', + 'astral': '\uD800[\uDE80-\uDE9C]' + }, + { + 'name': 'Lydian', + 'astral': '\uD802[\uDD20-\uDD39\uDD3F]' + }, + { + 'name': 'Mahajani', + 'astral': '\uD804[\uDD50-\uDD76]' + }, + { + 'name': 'Makasar', + 'astral': '\uD807[\uDEE0-\uDEF8]' + }, + { + 'name': 'Malayalam', + 'bmp': '\u0D00-\u0D03\u0D05-\u0D0C\u0D0E-\u0D10\u0D12-\u0D44\u0D46-\u0D48\u0D4A-\u0D4F\u0D54-\u0D63\u0D66-\u0D7F' + }, + { + 'name': 'Mandaic', + 'bmp': '\u0840-\u085B\u085E' + }, + { + 'name': 'Manichaean', + 'astral': '\uD802[\uDEC0-\uDEE6\uDEEB-\uDEF6]' + }, + { + 'name': 'Marchen', + 'astral': '\uD807[\uDC70-\uDC8F\uDC92-\uDCA7\uDCA9-\uDCB6]' + }, + { + 'name': 'Masaram_Gondi', + 'astral': '\uD807[\uDD00-\uDD06\uDD08\uDD09\uDD0B-\uDD36\uDD3A\uDD3C\uDD3D\uDD3F-\uDD47\uDD50-\uDD59]' + }, + { + 'name': 'Medefaidrin', + 'astral': '\uD81B[\uDE40-\uDE9A]' + }, + { + 'name': 'Meetei_Mayek', + 'bmp': '\uAAE0-\uAAF6\uABC0-\uABED\uABF0-\uABF9' + }, + { + 'name': 'Mende_Kikakui', + 'astral': '\uD83A[\uDC00-\uDCC4\uDCC7-\uDCD6]' + }, + { + 'name': 'Meroitic_Cursive', + 'astral': '\uD802[\uDDA0-\uDDB7\uDDBC-\uDDCF\uDDD2-\uDDFF]' + }, + { + 'name': 'Meroitic_Hieroglyphs', + 'astral': '\uD802[\uDD80-\uDD9F]' + }, + { + 'name': 'Miao', + 'astral': '\uD81B[\uDF00-\uDF44\uDF50-\uDF7E\uDF8F-\uDF9F]' + }, + { + 'name': 'Modi', + 'astral': '\uD805[\uDE00-\uDE44\uDE50-\uDE59]' + }, + { + 'name': 'Mongolian', + 'bmp': '\u1800\u1801\u1804\u1806-\u180E\u1810-\u1819\u1820-\u1878\u1880-\u18AA', + 'astral': '\uD805[\uDE60-\uDE6C]' + }, + { + 'name': 'Mro', + 'astral': '\uD81A[\uDE40-\uDE5E\uDE60-\uDE69\uDE6E\uDE6F]' + }, + { + 'name': 'Multani', + 'astral': '\uD804[\uDE80-\uDE86\uDE88\uDE8A-\uDE8D\uDE8F-\uDE9D\uDE9F-\uDEA9]' + }, + { + 'name': 'Myanmar', + 'bmp': '\u1000-\u109F\uA9E0-\uA9FE\uAA60-\uAA7F' + }, + { + 'name': 'Nabataean', + 'astral': '\uD802[\uDC80-\uDC9E\uDCA7-\uDCAF]' + }, + { + 'name': 'New_Tai_Lue', + 'bmp': '\u1980-\u19AB\u19B0-\u19C9\u19D0-\u19DA\u19DE\u19DF' + }, + { + 'name': 'Newa', + 'astral': '\uD805[\uDC00-\uDC59\uDC5B\uDC5D\uDC5E]' + }, + { + 'name': 'Nko', + 'bmp': '\u07C0-\u07FA\u07FD-\u07FF' + }, + { + 'name': 'Nushu', + 'astral': '\uD81B\uDFE1|\uD82C[\uDD70-\uDEFB]' + }, + { + 'name': 'Ogham', + 'bmp': '\u1680-\u169C' + }, + { + 'name': 'Ol_Chiki', + 'bmp': '\u1C50-\u1C7F' + }, + { + 'name': 'Old_Hungarian', + 'astral': '\uD803[\uDC80-\uDCB2\uDCC0-\uDCF2\uDCFA-\uDCFF]' + }, + { + 'name': 'Old_Italic', + 'astral': '\uD800[\uDF00-\uDF23\uDF2D-\uDF2F]' + }, + { + 'name': 'Old_North_Arabian', + 'astral': '\uD802[\uDE80-\uDE9F]' + }, + { + 'name': 'Old_Permic', + 'astral': '\uD800[\uDF50-\uDF7A]' + }, + { + 'name': 'Old_Persian', + 'astral': '\uD800[\uDFA0-\uDFC3\uDFC8-\uDFD5]' + }, + { + 'name': 'Old_Sogdian', + 'astral': '\uD803[\uDF00-\uDF27]' + }, + { + 'name': 'Old_South_Arabian', + 'astral': '\uD802[\uDE60-\uDE7F]' + }, + { + 'name': 'Old_Turkic', + 'astral': '\uD803[\uDC00-\uDC48]' + }, + { + 'name': 'Oriya', + 'bmp': '\u0B01-\u0B03\u0B05-\u0B0C\u0B0F\u0B10\u0B13-\u0B28\u0B2A-\u0B30\u0B32\u0B33\u0B35-\u0B39\u0B3C-\u0B44\u0B47\u0B48\u0B4B-\u0B4D\u0B56\u0B57\u0B5C\u0B5D\u0B5F-\u0B63\u0B66-\u0B77' + }, + { + 'name': 'Osage', + 'astral': '\uD801[\uDCB0-\uDCD3\uDCD8-\uDCFB]' + }, + { + 'name': 'Osmanya', + 'astral': '\uD801[\uDC80-\uDC9D\uDCA0-\uDCA9]' + }, + { + 'name': 'Pahawh_Hmong', + 'astral': '\uD81A[\uDF00-\uDF45\uDF50-\uDF59\uDF5B-\uDF61\uDF63-\uDF77\uDF7D-\uDF8F]' + }, + { + 'name': 'Palmyrene', + 'astral': '\uD802[\uDC60-\uDC7F]' + }, + { + 'name': 'Pau_Cin_Hau', + 'astral': '\uD806[\uDEC0-\uDEF8]' + }, + { + 'name': 'Phags_Pa', + 'bmp': '\uA840-\uA877' + }, + { + 'name': 'Phoenician', + 'astral': '\uD802[\uDD00-\uDD1B\uDD1F]' + }, + { + 'name': 'Psalter_Pahlavi', + 'astral': '\uD802[\uDF80-\uDF91\uDF99-\uDF9C\uDFA9-\uDFAF]' + }, + { + 'name': 'Rejang', + 'bmp': '\uA930-\uA953\uA95F' + }, + { + 'name': 'Runic', + 'bmp': '\u16A0-\u16EA\u16EE-\u16F8' + }, + { + 'name': 'Samaritan', + 'bmp': '\u0800-\u082D\u0830-\u083E' + }, + { + 'name': 'Saurashtra', + 'bmp': '\uA880-\uA8C5\uA8CE-\uA8D9' + }, + { + 'name': 'Sharada', + 'astral': '\uD804[\uDD80-\uDDCD\uDDD0-\uDDDF]' + }, + { + 'name': 'Shavian', + 'astral': '\uD801[\uDC50-\uDC7F]' + }, + { + 'name': 'Siddham', + 'astral': '\uD805[\uDD80-\uDDB5\uDDB8-\uDDDD]' + }, + { + 'name': 'SignWriting', + 'astral': '\uD836[\uDC00-\uDE8B\uDE9B-\uDE9F\uDEA1-\uDEAF]' + }, + { + 'name': 'Sinhala', + 'bmp': '\u0D82\u0D83\u0D85-\u0D96\u0D9A-\u0DB1\u0DB3-\u0DBB\u0DBD\u0DC0-\u0DC6\u0DCA\u0DCF-\u0DD4\u0DD6\u0DD8-\u0DDF\u0DE6-\u0DEF\u0DF2-\u0DF4', + 'astral': '\uD804[\uDDE1-\uDDF4]' + }, + { + 'name': 'Sogdian', + 'astral': '\uD803[\uDF30-\uDF59]' + }, + { + 'name': 'Sora_Sompeng', + 'astral': '\uD804[\uDCD0-\uDCE8\uDCF0-\uDCF9]' + }, + { + 'name': 'Soyombo', + 'astral': '\uD806[\uDE50-\uDE83\uDE86-\uDEA2]' + }, + { + 'name': 'Sundanese', + 'bmp': '\u1B80-\u1BBF\u1CC0-\u1CC7' + }, + { + 'name': 'Syloti_Nagri', + 'bmp': '\uA800-\uA82B' + }, + { + 'name': 'Syriac', + 'bmp': '\u0700-\u070D\u070F-\u074A\u074D-\u074F\u0860-\u086A' + }, + { + 'name': 'Tagalog', + 'bmp': '\u1700-\u170C\u170E-\u1714' + }, + { + 'name': 'Tagbanwa', + 'bmp': '\u1760-\u176C\u176E-\u1770\u1772\u1773' + }, + { + 'name': 'Tai_Le', + 'bmp': '\u1950-\u196D\u1970-\u1974' + }, + { + 'name': 'Tai_Tham', + 'bmp': '\u1A20-\u1A5E\u1A60-\u1A7C\u1A7F-\u1A89\u1A90-\u1A99\u1AA0-\u1AAD' + }, + { + 'name': 'Tai_Viet', + 'bmp': '\uAA80-\uAAC2\uAADB-\uAADF' + }, + { + 'name': 'Takri', + 'astral': '\uD805[\uDE80-\uDEB7\uDEC0-\uDEC9]' + }, + { + 'name': 'Tamil', + 'bmp': '\u0B82\u0B83\u0B85-\u0B8A\u0B8E-\u0B90\u0B92-\u0B95\u0B99\u0B9A\u0B9C\u0B9E\u0B9F\u0BA3\u0BA4\u0BA8-\u0BAA\u0BAE-\u0BB9\u0BBE-\u0BC2\u0BC6-\u0BC8\u0BCA-\u0BCD\u0BD0\u0BD7\u0BE6-\u0BFA' + }, + { + 'name': 'Tangut', + 'astral': '\uD81B\uDFE0|[\uD81C-\uD820][\uDC00-\uDFFF]|\uD821[\uDC00-\uDFF1]|\uD822[\uDC00-\uDEF2]' + }, + { + 'name': 'Telugu', + 'bmp': '\u0C00-\u0C0C\u0C0E-\u0C10\u0C12-\u0C28\u0C2A-\u0C39\u0C3D-\u0C44\u0C46-\u0C48\u0C4A-\u0C4D\u0C55\u0C56\u0C58-\u0C5A\u0C60-\u0C63\u0C66-\u0C6F\u0C78-\u0C7F' + }, + { + 'name': 'Thaana', + 'bmp': '\u0780-\u07B1' + }, + { + 'name': 'Thai', + 'bmp': '\u0E01-\u0E3A\u0E40-\u0E5B' + }, + { + 'name': 'Tibetan', + 'bmp': '\u0F00-\u0F47\u0F49-\u0F6C\u0F71-\u0F97\u0F99-\u0FBC\u0FBE-\u0FCC\u0FCE-\u0FD4\u0FD9\u0FDA' + }, + { + 'name': 'Tifinagh', + 'bmp': '\u2D30-\u2D67\u2D6F\u2D70\u2D7F' + }, + { + 'name': 'Tirhuta', + 'astral': '\uD805[\uDC80-\uDCC7\uDCD0-\uDCD9]' + }, + { + 'name': 'Ugaritic', + 'astral': '\uD800[\uDF80-\uDF9D\uDF9F]' + }, + { + 'name': 'Vai', + 'bmp': '\uA500-\uA62B' + }, + { + 'name': 'Warang_Citi', + 'astral': '\uD806[\uDCA0-\uDCF2\uDCFF]' + }, + { + 'name': 'Yi', + 'bmp': '\uA000-\uA48C\uA490-\uA4C6' + }, + { + 'name': 'Zanabazar_Square', + 'astral': '\uD806[\uDE00-\uDE47]' + } +]; + +var unicodeScripts = createCommonjsModule(function (module, exports) { +"use strict"; + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.default = void 0; + +var _scripts = _interopRequireDefault(scripts); + +function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } + +/*! + * XRegExp Unicode Scripts 4.2.0 + * + * Steven Levithan (c) 2010-present MIT License + * Unicode data by Mathias Bynens + */ +var _default = function _default(XRegExp) { + /** + * Adds support for all Unicode scripts. E.g., `\p{Latin}`. Token names are case insensitive, + * and any spaces, hyphens, and underscores are ignored. + * + * Uses Unicode 11.0.0. + * + * @requires XRegExp, Unicode Base + */ + if (!XRegExp.addUnicodeData) { + throw new ReferenceError('Unicode Base must be loaded before Unicode Scripts'); + } + + XRegExp.addUnicodeData(_scripts.default); +}; + +exports.default = _default; +module.exports = exports["default"]; +}); + +unwrapExports(unicodeScripts); + +var lib = createCommonjsModule(function (module, exports) { +"use strict"; + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.default = void 0; + +var _xregexp = _interopRequireDefault(xregexp); + +var _build = _interopRequireDefault(build); + +var _matchrecursive = _interopRequireDefault(matchrecursive); + +var _unicodeBase = _interopRequireDefault(unicodeBase); + +var _unicodeBlocks = _interopRequireDefault(unicodeBlocks); + +var _unicodeCategories = _interopRequireDefault(unicodeCategories); + +var _unicodeProperties = _interopRequireDefault(unicodeProperties); + +var _unicodeScripts = _interopRequireDefault(unicodeScripts); + +function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } + +(_build.default)(_xregexp.default); +(_matchrecursive.default)(_xregexp.default); +(_unicodeBase.default)(_xregexp.default); +(_unicodeBlocks.default)(_xregexp.default); +(_unicodeCategories.default)(_xregexp.default); +(_unicodeProperties.default)(_xregexp.default); +(_unicodeScripts.default)(_xregexp.default); +var _default = _xregexp.default; +exports.default = _default; +module.exports = exports["default"]; +}); + +unwrapExports(lib); + +var utilities = createCommonjsModule(function (module, exports) { +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); + +class FormatUtility { + static preProcess(query, toLower = true) { + if (toLower) { + query = query.toLowerCase(); + } + return query + .replace(/0/g, "0") + .replace(/1/g, "1") + .replace(/2/g, "2") + .replace(/3/g, "3") + .replace(/4/g, "4") + .replace(/5/g, "5") + .replace(/6/g, "6") + .replace(/7/g, "7") + .replace(/8/g, "8") + .replace(/9/g, "9") + .replace(/:/g, ":") + .replace(/-/g, "-") + .replace(/,/g, ",") + .replace(///g, "/") + .replace(/G/g, "G") + .replace(/M/g, "M") + .replace(/T/g, "T") + .replace(/K/g, "K") + .replace(/k/g, "k") + .replace(/./g, ".") + .replace(/(/g, "(") + .replace(/)/g, ")"); + } +} +exports.FormatUtility = FormatUtility; +class Match { + constructor(index, length, value, groups) { + this.index = index; + this.length = length; + this.value = value; + this.innerGroups = groups; + } + groups(key) { + return this.innerGroups[key] ? this.innerGroups[key] : { value: '', index: 0, length: 0, captures: [] }; + } +} +exports.Match = Match; +class RegExpUtility { + static getMatches(regex, source) { + if (!regex) + return []; + let rawRegex = regex.xregexp.source; + if (!rawRegex.includes('(?= 0) { + closePos = this.getClosePos(rawRegex, startPos); + let nlbRegex = lib(rawRegex.substring(startPos, closePos + 1), flags); + let nextRegex = RegExpUtility.getNextRegex(rawRegex, startPos); + nlbRegex.nextRegex = nextRegex ? lib(nextRegex, flags) : null; + negativeLookbehindRegexes.push(nlbRegex); + rawRegex = rawRegex.substr(0, startPos) + rawRegex.substr(closePos + 1); + startPos = rawRegex.indexOf('(? { + let clean = true; + negativeLookbehindRegexes.forEach(regex => { + let negativeLookbehindMatches = RegExpUtility.getMatchesSimple(regex, source); + negativeLookbehindMatches.forEach(negativeLookbehindMatch => { + let negativeLookbehindEnd = negativeLookbehindMatch.index + negativeLookbehindMatch.length; + let nextRegex = regex.nextRegex; + if (match.index === negativeLookbehindEnd) { + if (!nextRegex) { + clean = false; + return; + } + else { + let nextMatch = RegExpUtility.getFirstMatchIndex(nextRegex, source.substring(negativeLookbehindMatch.index)); + if (nextMatch.matched && ((nextMatch.index === negativeLookbehindMatch.length) || (source.includes(nextMatch.value + match.value)))) { + clean = false; + return; + } + } + } + if (negativeLookbehindMatch.value.includes(match.value)) { + let preMatches = RegExpUtility.getMatchesSimple(regex, source.substring(0, match.index)); + preMatches.forEach(preMatch => { + if (source.includes(preMatch.value + match.value)) { + clean = false; + return; + } + }); + } + }); + if (!clean) { + return; + } + }); + if (clean) { + realMatches.push(match); + } + }); + return realMatches; + } + static getMatchesSimple(regex, source) { + // Word boundary (\b) in JS is not unicode-aware, so words starting/ending with accentuated characters will not match + // use a normalized string to match, the return matches' values using the original one + // http://blog.stevenlevithan.com/archives/javascript-regex-and-unicode + // https://stackoverflow.com/questions/2881445/utf-8-word-boundary-regex-in-javascript + let normalized = StringUtility.removeDiacriticsFromWordBoundaries(source); + let matches = new Array(); + lib.forEach(normalized, regex, match => { + let positiveLookbehinds = []; + let groups = {}; + let lastGroup = ''; + Object.keys(match).forEach(key => { + if (!key.includes('__')) + return; + if (key.startsWith('plb') && match[key]) { + if (match[0].indexOf(match[key]) !== 0 && !StringUtility.isNullOrEmpty(lastGroup)) { + let index = match.index + match[0].indexOf(match[key]); + let length = match[key].length; + let value = source.substr(index, length); + groups[lastGroup].value = groups[lastGroup].value + value; + } + positiveLookbehinds.push({ key: key, value: match[key] }); + return; + } + if (key.startsWith('nlb')) { + return; + } + let groupKey = key.substr(0, key.lastIndexOf('__')); + lastGroup = groupKey; + if (!groups[groupKey]) + groups[groupKey] = { value: '', index: 0, length: 0, captures: [] }; + if (match[key]) { + let index = match.index + match[0].indexOf(match[key]); + let length = match[key].length; + let value = source.substr(index, length); + groups[groupKey].index = index; + groups[groupKey].length = length; + groups[groupKey].value = value; + groups[groupKey].captures.push(value); + } + }); + let value = match[0]; + let index = match.index; + let length = value.length; + if (positiveLookbehinds && positiveLookbehinds.length > 0 && value.indexOf(positiveLookbehinds[0].value) === 0) { + value = source.substr(index, length).substr(positiveLookbehinds[0].value.length); + index += positiveLookbehinds[0].value.length; + length -= positiveLookbehinds[0].value.length; + } + else { + value = source.substr(index, length); + } + matches.push(new Match(index, length, value, groups)); + }); + return matches; + } + static getSafeRegExp(source, flags) { + let sanitizedSource = this.sanitizeGroups(source); + return lib(sanitizedSource, flags || 'gis'); + } + static getFirstMatchIndex(regex, source) { + let matches = RegExpUtility.getMatches(regex, source); + if (matches.length) { + return { + matched: true, + index: matches[0].index, + value: matches[0].value + }; + } + return { matched: false, index: -1, value: null }; + } + static split(regex, source) { + return lib.split(source, regex); + } + static isMatch(regex, source) { + return !StringUtility.isNullOrEmpty(source) + && this.getMatches(regex, source).length > 0; + } + static sanitizeGroups(source) { + let index = 0; + let result = lib.replace(source, this.matchGroup, (match, name) => match.replace(name, `${name}__${index++}`)); + index = 0; + result = lib.replace(result, this.matchPositiveLookbehind, () => `(?`); + index = 0; + result = lib.replace(result, this.matchNegativeLookbehind, () => `(?`); + return result; + } + static getNextRegex(source, startPos) { + startPos = RegExpUtility.getClosePos(source, startPos) + 1; + let closePos = RegExpUtility.getClosePos(source, startPos); + if (source[startPos] !== '(') { + closePos--; + } + let next = (startPos === closePos) + ? null + : source.substring(startPos, closePos + 1); + return next; + } + static getClosePos(source, startPos) { + let counter = 1; + let closePos = startPos; + while (counter > 0 && closePos < source.length) { + let c = source[++closePos]; + if (c === '(') + counter++; + else if (c === ')') + counter--; + } + return closePos; + } +} +RegExpUtility.matchGroup = lib(String.raw `\?<(?\w+)>`, 'gis'); +RegExpUtility.matchPositiveLookbehind = lib(String.raw `\(\?<=`, 'gis'); +RegExpUtility.matchNegativeLookbehind = lib(String.raw `\(\? { + let length = s.length; + if (length === 0) + return s; + let first = StringUtility.removeDiacritics(s.substring(0, 1)); + if (length === 1) + return first; + let last = length > 1 ? StringUtility.removeDiacritics(s.substring(length - 1)) : ''; + let mid = s.substring(1, length - 1); + // console.log(first + mid + last) + return first + mid + last; + }) + .join(' '); + } + static removeDiacritics(c) { + let clean = StringUtility.diacriticsRemovalMap[c]; + return !clean ? c : clean; + } +} +StringUtility.diacriticsRemovalMap = { + "Ⓐ": "A", + "A": "A", + "À": "A", + "Á": "A", + "Â": "A", + "Ầ": "A", + "Ấ": "A", + "Ẫ": "A", + "Ẩ": "A", + "Ã": "A", + "Ā": "A", + "Ă": "A", + "Ằ": "A", + "Ắ": "A", + "Ẵ": "A", + "Ẳ": "A", + "Ȧ": "A", + "Ǡ": "A", + "Ä": "A", + "Ǟ": "A", + "Ả": "A", + "Å": "A", + "Ǻ": "A", + "Ǎ": "A", + "Ȁ": "A", + "Ȃ": "A", + "Ạ": "A", + "Ậ": "A", + "Ặ": "A", + "Ḁ": "A", + "Ą": "A", + "Ⱥ": "A", + "Ɐ": "A", + "Ⓑ": "B", + "B": "B", + "Ḃ": "B", + "Ḅ": "B", + "Ḇ": "B", + "Ƀ": "B", + "Ƃ": "B", + "Ɓ": "B", + "Ⓒ": "C", + "C": "C", + "Ć": "C", + "Ĉ": "C", + "Ċ": "C", + "Č": "C", + "Ç": "C", + "Ḉ": "C", + "Ƈ": "C", + "Ȼ": "C", + "Ꜿ": "C", + "Ⓓ": "D", + "D": "D", + "Ḋ": "D", + "Ď": "D", + "Ḍ": "D", + "Ḑ": "D", + "Ḓ": "D", + "Ḏ": "D", + "Đ": "D", + "Ƌ": "D", + "Ɗ": "D", + "Ɖ": "D", + "Ꝺ": "D", + "Ⓔ": "E", + "E": "E", + "È": "E", + "É": "E", + "Ê": "E", + "Ề": "E", + "Ế": "E", + "Ễ": "E", + "Ể": "E", + "Ẽ": "E", + "Ē": "E", + "Ḕ": "E", + "Ḗ": "E", + "Ĕ": "E", + "Ė": "E", + "Ë": "E", + "Ẻ": "E", + "Ě": "E", + "Ȅ": "E", + "Ȇ": "E", + "Ẹ": "E", + "Ệ": "E", + "Ȩ": "E", + "Ḝ": "E", + "Ę": "E", + "Ḙ": "E", + "Ḛ": "E", + "Ɛ": "E", + "Ǝ": "E", + "Ⓕ": "F", + "F": "F", + "Ḟ": "F", + "Ƒ": "F", + "Ꝼ": "F", + "Ⓖ": "G", + "G": "G", + "Ǵ": "G", + "Ĝ": "G", + "Ḡ": "G", + "Ğ": "G", + "Ġ": "G", + "Ǧ": "G", + "Ģ": "G", + "Ǥ": "G", + "Ɠ": "G", + "Ꞡ": "G", + "Ᵹ": "G", + "Ꝿ": "G", + "Ⓗ": "H", + "H": "H", + "Ĥ": "H", + "Ḣ": "H", + "Ḧ": "H", + "Ȟ": "H", + "Ḥ": "H", + "Ḩ": "H", + "Ḫ": "H", + "Ħ": "H", + "Ⱨ": "H", + "Ⱶ": "H", + "Ɥ": "H", + "Ⓘ": "I", + "I": "I", + "Ì": "I", + "Í": "I", + "Î": "I", + "Ĩ": "I", + "Ī": "I", + "Ĭ": "I", + "İ": "I", + "Ï": "I", + "Ḯ": "I", + "Ỉ": "I", + "Ǐ": "I", + "Ȉ": "I", + "Ȋ": "I", + "Ị": "I", + "Į": "I", + "Ḭ": "I", + "Ɨ": "I", + "Ⓙ": "J", + "J": "J", + "Ĵ": "J", + "Ɉ": "J", + "Ⓚ": "K", + "K": "K", + "Ḱ": "K", + "Ǩ": "K", + "Ḳ": "K", + "Ķ": "K", + "Ḵ": "K", + "Ƙ": "K", + "Ⱪ": "K", + "Ꝁ": "K", + "Ꝃ": "K", + "Ꝅ": "K", + "Ꞣ": "K", + "Ⓛ": "L", + "L": "L", + "Ŀ": "L", + "Ĺ": "L", + "Ľ": "L", + "Ḷ": "L", + "Ḹ": "L", + "Ļ": "L", + "Ḽ": "L", + "Ḻ": "L", + "Ł": "L", + "Ƚ": "L", + "Ɫ": "L", + "Ⱡ": "L", + "Ꝉ": "L", + "Ꝇ": "L", + "Ꞁ": "L", + "Ⓜ": "M", + "M": "M", + "Ḿ": "M", + "Ṁ": "M", + "Ṃ": "M", + "Ɱ": "M", + "Ɯ": "M", + "Ⓝ": "N", + "N": "N", + "Ǹ": "N", + "Ń": "N", + "Ñ": "N", + "Ṅ": "N", + "Ň": "N", + "Ṇ": "N", + "Ņ": "N", + "Ṋ": "N", + "Ṉ": "N", + "Ƞ": "N", + "Ɲ": "N", + "Ꞑ": "N", + "Ꞥ": "N", + "Ⓞ": "O", + "O": "O", + "Ò": "O", + "Ó": "O", + "Ô": "O", + "Ồ": "O", + "Ố": "O", + "Ỗ": "O", + "Ổ": "O", + "Õ": "O", + "Ṍ": "O", + "Ȭ": "O", + "Ṏ": "O", + "Ō": "O", + "Ṑ": "O", + "Ṓ": "O", + "Ŏ": "O", + "Ȯ": "O", + "Ȱ": "O", + "Ö": "O", + "Ȫ": "O", + "Ỏ": "O", + "Ő": "O", + "Ǒ": "O", + "Ȍ": "O", + "Ȏ": "O", + "Ơ": "O", + "Ờ": "O", + "Ớ": "O", + "Ỡ": "O", + "Ở": "O", + "Ợ": "O", + "Ọ": "O", + "Ộ": "O", + "Ǫ": "O", + "Ǭ": "O", + "Ø": "O", + "Ǿ": "O", + "Ɔ": "O", + "Ɵ": "O", + "Ꝋ": "O", + "Ꝍ": "O", + "Ⓟ": "P", + "P": "P", + "Ṕ": "P", + "Ṗ": "P", + "Ƥ": "P", + "Ᵽ": "P", + "Ꝑ": "P", + "Ꝓ": "P", + "Ꝕ": "P", + "Ⓠ": "Q", + "Q": "Q", + "Ꝗ": "Q", + "Ꝙ": "Q", + "Ɋ": "Q", + "Ⓡ": "R", + "R": "R", + "Ŕ": "R", + "Ṙ": "R", + "Ř": "R", + "Ȑ": "R", + "Ȓ": "R", + "Ṛ": "R", + "Ṝ": "R", + "Ŗ": "R", + "Ṟ": "R", + "Ɍ": "R", + "Ɽ": "R", + "Ꝛ": "R", + "Ꞧ": "R", + "Ꞃ": "R", + "Ⓢ": "S", + "S": "S", + "ẞ": "S", + "Ś": "S", + "Ṥ": "S", + "Ŝ": "S", + "Ṡ": "S", + "Š": "S", + "Ṧ": "S", + "Ṣ": "S", + "Ṩ": "S", + "Ș": "S", + "Ş": "S", + "Ȿ": "S", + "Ꞩ": "S", + "Ꞅ": "S", + "Ⓣ": "T", + "T": "T", + "Ṫ": "T", + "Ť": "T", + "Ṭ": "T", + "Ț": "T", + "Ţ": "T", + "Ṱ": "T", + "Ṯ": "T", + "Ŧ": "T", + "Ƭ": "T", + "Ʈ": "T", + "Ⱦ": "T", + "Ꞇ": "T", + "Ⓤ": "U", + "U": "U", + "Ù": "U", + "Ú": "U", + "Û": "U", + "Ũ": "U", + "Ṹ": "U", + "Ū": "U", + "Ṻ": "U", + "Ŭ": "U", + "Ü": "U", + "Ǜ": "U", + "Ǘ": "U", + "Ǖ": "U", + "Ǚ": "U", + "Ủ": "U", + "Ů": "U", + "Ű": "U", + "Ǔ": "U", + "Ȕ": "U", + "Ȗ": "U", + "Ư": "U", + "Ừ": "U", + "Ứ": "U", + "Ữ": "U", + "Ử": "U", + "Ự": "U", + "Ụ": "U", + "Ṳ": "U", + "Ų": "U", + "Ṷ": "U", + "Ṵ": "U", + "Ʉ": "U", + "Ⓥ": "V", + "V": "V", + "Ṽ": "V", + "Ṿ": "V", + "Ʋ": "V", + "Ꝟ": "V", + "Ʌ": "V", + "Ⓦ": "W", + "W": "W", + "Ẁ": "W", + "Ẃ": "W", + "Ŵ": "W", + "Ẇ": "W", + "Ẅ": "W", + "Ẉ": "W", + "Ⱳ": "W", + "Ⓧ": "X", + "X": "X", + "Ẋ": "X", + "Ẍ": "X", + "Ⓨ": "Y", + "Y": "Y", + "Ỳ": "Y", + "Ý": "Y", + "Ŷ": "Y", + "Ỹ": "Y", + "Ȳ": "Y", + "Ẏ": "Y", + "Ÿ": "Y", + "Ỷ": "Y", + "Ỵ": "Y", + "Ƴ": "Y", + "Ɏ": "Y", + "Ỿ": "Y", + "Ⓩ": "Z", + "Z": "Z", + "Ź": "Z", + "Ẑ": "Z", + "Ż": "Z", + "Ž": "Z", + "Ẓ": "Z", + "Ẕ": "Z", + "Ƶ": "Z", + "Ȥ": "Z", + "Ɀ": "Z", + "Ⱬ": "Z", + "Ꝣ": "Z", + "ⓐ": "a", + "a": "a", + "ẚ": "a", + "à": "a", + "á": "a", + "â": "a", + "ầ": "a", + "ấ": "a", + "ẫ": "a", + "ẩ": "a", + "ã": "a", + "ā": "a", + "ă": "a", + "ằ": "a", + "ắ": "a", + "ẵ": "a", + "ẳ": "a", + "ȧ": "a", + "ǡ": "a", + "ä": "a", + "ǟ": "a", + "ả": "a", + "å": "a", + "ǻ": "a", + "ǎ": "a", + "ȁ": "a", + "ȃ": "a", + "ạ": "a", + "ậ": "a", + "ặ": "a", + "ḁ": "a", + "ą": "a", + "ⱥ": "a", + "ɐ": "a", + "ⓑ": "b", + "b": "b", + "ḃ": "b", + "ḅ": "b", + "ḇ": "b", + "ƀ": "b", + "ƃ": "b", + "ɓ": "b", + "ⓒ": "c", + "c": "c", + "ć": "c", + "ĉ": "c", + "ċ": "c", + "č": "c", + "ç": "c", + "ḉ": "c", + "ƈ": "c", + "ȼ": "c", + "ꜿ": "c", + "ↄ": "c", + "ⓓ": "d", + "d": "d", + "ḋ": "d", + "ď": "d", + "ḍ": "d", + "ḑ": "d", + "ḓ": "d", + "ḏ": "d", + "đ": "d", + "ƌ": "d", + "ɖ": "d", + "ɗ": "d", + "ꝺ": "d", + "ⓔ": "e", + "e": "e", + "è": "e", + "é": "e", + "ê": "e", + "ề": "e", + "ế": "e", + "ễ": "e", + "ể": "e", + "ẽ": "e", + "ē": "e", + "ḕ": "e", + "ḗ": "e", + "ĕ": "e", + "ė": "e", + "ë": "e", + "ẻ": "e", + "ě": "e", + "ȅ": "e", + "ȇ": "e", + "ẹ": "e", + "ệ": "e", + "ȩ": "e", + "ḝ": "e", + "ę": "e", + "ḙ": "e", + "ḛ": "e", + "ɇ": "e", + "ɛ": "e", + "ǝ": "e", + "ⓕ": "f", + "f": "f", + "ḟ": "f", + "ƒ": "f", + "ꝼ": "f", + "ⓖ": "g", + "g": "g", + "ǵ": "g", + "ĝ": "g", + "ḡ": "g", + "ğ": "g", + "ġ": "g", + "ǧ": "g", + "ģ": "g", + "ǥ": "g", + "ɠ": "g", + "ꞡ": "g", + "ᵹ": "g", + "ꝿ": "g", + "ⓗ": "h", + "h": "h", + "ĥ": "h", + "ḣ": "h", + "ḧ": "h", + "ȟ": "h", + "ḥ": "h", + "ḩ": "h", + "ḫ": "h", + "ẖ": "h", + "ħ": "h", + "ⱨ": "h", + "ⱶ": "h", + "ɥ": "h", + "ⓘ": "i", + "i": "i", + "ì": "i", + "í": "i", + "î": "i", + "ĩ": "i", + "ī": "i", + "ĭ": "i", + "ï": "i", + "ḯ": "i", + "ỉ": "i", + "ǐ": "i", + "ȉ": "i", + "ȋ": "i", + "ị": "i", + "į": "i", + "ḭ": "i", + "ɨ": "i", + "ı": "i", + "ⓙ": "j", + "j": "j", + "ĵ": "j", + "ǰ": "j", + "ɉ": "j", + "ⓚ": "k", + "k": "k", + "ḱ": "k", + "ǩ": "k", + "ḳ": "k", + "ķ": "k", + "ḵ": "k", + "ƙ": "k", + "ⱪ": "k", + "ꝁ": "k", + "ꝃ": "k", + "ꝅ": "k", + "ꞣ": "k", + "ⓛ": "l", + "l": "l", + "ŀ": "l", + "ĺ": "l", + "ľ": "l", + "ḷ": "l", + "ḹ": "l", + "ļ": "l", + "ḽ": "l", + "ḻ": "l", + "ſ": "l", + "ł": "l", + "ƚ": "l", + "ɫ": "l", + "ⱡ": "l", + "ꝉ": "l", + "ꞁ": "l", + "ꝇ": "l", + "ⓜ": "m", + "m": "m", + "ḿ": "m", + "ṁ": "m", + "ṃ": "m", + "ɱ": "m", + "ɯ": "m", + "ⓝ": "n", + "n": "n", + "ǹ": "n", + "ń": "n", + "ñ": "n", + "ṅ": "n", + "ň": "n", + "ṇ": "n", + "ņ": "n", + "ṋ": "n", + "ṉ": "n", + "ƞ": "n", + "ɲ": "n", + "ʼn": "n", + "ꞑ": "n", + "ꞥ": "n", + "ⓞ": "o", + "o": "o", + "ò": "o", + "ó": "o", + "ô": "o", + "ồ": "o", + "ố": "o", + "ỗ": "o", + "ổ": "o", + "õ": "o", + "ṍ": "o", + "ȭ": "o", + "ṏ": "o", + "ō": "o", + "ṑ": "o", + "ṓ": "o", + "ŏ": "o", + "ȯ": "o", + "ȱ": "o", + "ö": "o", + "ȫ": "o", + "ỏ": "o", + "ő": "o", + "ǒ": "o", + "ȍ": "o", + "ȏ": "o", + "ơ": "o", + "ờ": "o", + "ớ": "o", + "ỡ": "o", + "ở": "o", + "ợ": "o", + "ọ": "o", + "ộ": "o", + "ǫ": "o", + "ǭ": "o", + "ø": "o", + "ǿ": "o", + "ɔ": "o", + "ꝋ": "o", + "ꝍ": "o", + "ɵ": "o", + "ⓟ": "p", + "p": "p", + "ṕ": "p", + "ṗ": "p", + "ƥ": "p", + "ᵽ": "p", + "ꝑ": "p", + "ꝓ": "p", + "ꝕ": "p", + "ⓠ": "q", + "q": "q", + "ɋ": "q", + "ꝗ": "q", + "ꝙ": "q", + "ⓡ": "r", + "r": "r", + "ŕ": "r", + "ṙ": "r", + "ř": "r", + "ȑ": "r", + "ȓ": "r", + "ṛ": "r", + "ṝ": "r", + "ŗ": "r", + "ṟ": "r", + "ɍ": "r", + "ɽ": "r", + "ꝛ": "r", + "ꞧ": "r", + "ꞃ": "r", + "ⓢ": "s", + "s": "s", + "ß": "s", + "ś": "s", + "ṥ": "s", + "ŝ": "s", + "ṡ": "s", + "š": "s", + "ṧ": "s", + "ṣ": "s", + "ṩ": "s", + "ș": "s", + "ş": "s", + "ȿ": "s", + "ꞩ": "s", + "ꞅ": "s", + "ẛ": "s", + "ⓣ": "t", + "t": "t", + "ṫ": "t", + "ẗ": "t", + "ť": "t", + "ṭ": "t", + "ț": "t", + "ţ": "t", + "ṱ": "t", + "ṯ": "t", + "ŧ": "t", + "ƭ": "t", + "ʈ": "t", + "ⱦ": "t", + "ꞇ": "t", + "ⓤ": "u", + "u": "u", + "ù": "u", + "ú": "u", + "û": "u", + "ũ": "u", + "ṹ": "u", + "ū": "u", + "ṻ": "u", + "ŭ": "u", + "ü": "u", + "ǜ": "u", + "ǘ": "u", + "ǖ": "u", + "ǚ": "u", + "ủ": "u", + "ů": "u", + "ű": "u", + "ǔ": "u", + "ȕ": "u", + "ȗ": "u", + "ư": "u", + "ừ": "u", + "ứ": "u", + "ữ": "u", + "ử": "u", + "ự": "u", + "ụ": "u", + "ṳ": "u", + "ų": "u", + "ṷ": "u", + "ṵ": "u", + "ʉ": "u", + "ⓥ": "v", + "v": "v", + "ṽ": "v", + "ṿ": "v", + "ʋ": "v", + "ꝟ": "v", + "ʌ": "v", + "ⓦ": "w", + "w": "w", + "ẁ": "w", + "ẃ": "w", + "ŵ": "w", + "ẇ": "w", + "ẅ": "w", + "ẘ": "w", + "ẉ": "w", + "ⱳ": "w", + "ⓧ": "x", + "x": "x", + "ẋ": "x", + "ẍ": "x", + "ⓨ": "y", + "y": "y", + "ỳ": "y", + "ý": "y", + "ŷ": "y", + "ỹ": "y", + "ȳ": "y", + "ẏ": "y", + "ÿ": "y", + "ỷ": "y", + "ẙ": "y", + "ỵ": "y", + "ƴ": "y", + "ɏ": "y", + "ỿ": "y", + "ⓩ": "z", + "z": "z", + "ź": "z", + "ẑ": "z", + "ż": "z", + "ž": "z", + "ẓ": "z", + "ẕ": "z", + "ƶ": "z", + "ȥ": "z", + "ɀ": "z", + "ⱬ": "z", + "ꝣ": "z" +}; +exports.StringUtility = StringUtility; + +}); + +unwrapExports(utilities); + +var models = createCommonjsModule(function (module, exports) { +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); + + +class ModelResult { +} +exports.ModelResult = ModelResult; +class ExtendedModelResult extends ModelResult { + constructor(source = null) { + super(); + if (source) { + this.text = source.text; + this.start = source.start; + this.end = source.end; + this.typeName = source.typeName; + this.resolution = source.resolution; + } + } +} +exports.ExtendedModelResult = ExtendedModelResult; +class ModelFactoryKey { + constructor(culture$$1, modelType, options = null) { + this.culture = culture$$1 ? culture$$1.toLowerCase() : null; + this.modelType = modelType; + this.options = options; + } + toString() { + return JSON.stringify(this); + } + static fromString(key) { + return JSON.parse(key); + } +} +class ModelFactory { + constructor() { + this.modelFactories = new Map(); + } + getModel(modelTypeName, culture$$1, fallbackToDefaultCulture, options) { + let result = this.tryGetModel(modelTypeName, culture$$1, options); + if (!result.containsModel && fallbackToDefaultCulture) { + result = this.tryGetModel(modelTypeName, ModelFactory.fallbackCulture, options); + } + if (result.containsModel) { + return result.model; + } + throw new Error(`Could not find Model with the specified configuration: ${culture$$1},${modelTypeName}`); + } + tryGetModel(modelTypeName, culture$$1, options) { + culture$$1 = culture.Culture.mapToNearestLanguage(culture$$1); + let cacheResult = this.getModelFromCache(modelTypeName, culture$$1, options); + if (cacheResult) + return { containsModel: true, model: cacheResult }; + let key = this.generateKey(modelTypeName, culture$$1); + if (this.modelFactories.has(key)) { + let model = this.modelFactories.get(key)(options); + this.registerModelInCache(modelTypeName, culture$$1, options, model); + return { containsModel: true, model: model }; + } + return { containsModel: false }; + } + registerModel(modelTypeName, culture$$1, modelCreator) { + let key = this.generateKey(modelTypeName, culture$$1); + if (this.modelFactories.has(key)) { + throw new Error(`${culture$$1}-${modelTypeName} has already been registered.`); + } + this.modelFactories.set(key, modelCreator); + } + initializeModels(targetCulture, options) { + this.modelFactories.forEach((value, key) => { + let modelFactoryKey = ModelFactoryKey.fromString(key); + if (utilities.StringUtility.isNullOrEmpty(targetCulture) || modelFactoryKey.culture === targetCulture) { + this.tryGetModel(modelFactoryKey.modelType, modelFactoryKey.culture, modelFactoryKey.options); + } + }); + } + generateKey(modelTypeName, culture$$1) { + return new ModelFactoryKey(culture$$1, modelTypeName).toString(); + } + getModelFromCache(modelTypeName, culture$$1, options) { + let key = this.generateCacheKey(modelTypeName, culture$$1, options); + return ModelFactory.cache.get(key); + } + registerModelInCache(modelTypeName, culture$$1, options, model) { + let key = this.generateCacheKey(modelTypeName, culture$$1, options); + ModelFactory.cache.set(key, model); + } + generateCacheKey(modelTypeName, culture$$1, options) { + return new ModelFactoryKey(culture$$1, modelTypeName, options).toString(); + } +} +ModelFactory.fallbackCulture = culture.Culture.English; +ModelFactory.cache = new Map(); +exports.ModelFactory = ModelFactory; + +}); + +unwrapExports(models); + +var recognizer = createCommonjsModule(function (module, exports) { +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); + +class Recognizer { + constructor(targetCulture, options, lazyInitialization) { + this.modelFactory = new models.ModelFactory(); + if (!this.IsValidOptions(options)) + throw new Error(`${options} is not a valid options value.`); + this.TargetCulture = targetCulture; + this.Options = options; + this.InitializeConfiguration(); + if (!lazyInitialization) { + this.initializeModels(targetCulture, options); + } + } + getModel(modelTypeName, culture, fallbackToDefaultCulture) { + return this.modelFactory.getModel(modelTypeName, culture || this.TargetCulture, fallbackToDefaultCulture, this.Options); + } + registerModel(modelTypeName, culture, modelCreator) { + this.modelFactory.registerModel(modelTypeName, culture, modelCreator); + } + initializeModels(targetCulture, options) { + this.modelFactory.initializeModels(targetCulture, options); + } +} +exports.Recognizer = Recognizer; + +}); + +unwrapExports(recognizer); + +var extractors = createCommonjsModule(function (module, exports) { +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +class ExtractResult { + static isOverlap(erA, erB) { + return !(erA.start >= erB.start + erB.length) && !(erB.start >= erA.start + erA.length); + } + static isCover(er1, er2) { + return ((er2.start < er1.start) && ((er2.start + er2.length) >= (er1.start + er1.length))) + || ((er2.start <= er1.start) && ((er2.start + er2.length) > (er1.start + er1.length))); + } + static getFromText(source) { + return { + start: 0, + length: source.length, + text: source, + type: 'custom' + }; + } +} +exports.ExtractResult = ExtractResult; + +}); + +unwrapExports(extractors); + +var parsers = createCommonjsModule(function (module, exports) { +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); + +class ParseResult extends extractors.ExtractResult { + constructor(er) { + super(); + if (er) { + this.length = er.length; + this.start = er.start; + this.data = er.data; + this.text = er.text; + this.type = er.type; + } + this.resolutionStr = ""; + } +} +exports.ParseResult = ParseResult; + +}); + +unwrapExports(parsers); + +var recognizersText = createCommonjsModule(function (module, exports) { +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); + +exports.Culture = culture.Culture; +exports.CultureInfo = culture.CultureInfo; + +exports.ModelResult = models.ModelResult; +exports.ModelFactory = models.ModelFactory; + +exports.Recognizer = recognizer.Recognizer; + +exports.ExtractResult = extractors.ExtractResult; + +exports.ParseResult = parsers.ParseResult; + +exports.FormatUtility = utilities.FormatUtility; +exports.StringUtility = utilities.StringUtility; +exports.Match = utilities.Match; +exports.RegExpUtility = utilities.RegExpUtility; + +}); + +unwrapExports(recognizersText); + +var models$2 = createCommonjsModule(function (module, exports) { +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +class ChoiceModel { + constructor(parser, extractor) { + this.extractor = extractor; + this.parser = parser; + } + parse(source) { + let extractResults = this.extractor.extract(source); + let parseResults = extractResults.map(r => this.parser.parse(r)); + return parseResults + .map(o => o) + .map(o => ({ + start: o.start, + end: o.start + o.length - 1, + resolution: this.getResolution(o), + text: o.text, + typeName: this.modelTypeName + })); + } +} +exports.ChoiceModel = ChoiceModel; +class BooleanModel extends ChoiceModel { + constructor() { + super(...arguments); + this.modelTypeName = 'boolean'; + } + getResolution(sources) { + let results = { + value: sources.value, + score: sources.data.score + }; + if (sources.data.otherMatches) { + results.otherResults = sources.data.otherMatches.map(o => ({ + text: o.text, + value: o.value, + score: o.data.score + })); + } + return results; + } +} +exports.BooleanModel = BooleanModel; + +}); + +unwrapExports(models$2); + +var constants = createCommonjsModule(function (module, exports) { +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +class Constants { +} +Constants.SYS_BOOLEAN = "boolean"; +Constants.SYS_BOOLEAN_TRUE = "boolean-true"; +Constants.SYS_BOOLEAN_FALSE = "boolean-false"; +exports.Constants = Constants; + +}); + +unwrapExports(constants); + +/* +Breaks a Javascript string into individual user-perceived "characters" +called extended grapheme clusters by implementing the Unicode UAX-29 standard, version 10.0.0 + +Usage: +var splitter = new GraphemeSplitter(); +//returns an array of strings, one string for each grapheme cluster +var graphemes = splitter.splitGraphemes(string); + +*/ +function GraphemeSplitter(){ + var CR = 0, + LF = 1, + Control = 2, + Extend = 3, + Regional_Indicator = 4, + SpacingMark = 5, + L = 6, + V = 7, + T = 8, + LV = 9, + LVT = 10, + Other = 11, + Prepend = 12, + E_Base = 13, + E_Modifier = 14, + ZWJ = 15, + Glue_After_Zwj = 16, + E_Base_GAZ = 17; + + // BreakTypes + var NotBreak = 0, + BreakStart = 1, + Break = 2, + BreakLastRegional = 3, + BreakPenultimateRegional = 4; + + function isSurrogate(str, pos) { + return 0xd800 <= str.charCodeAt(pos) && str.charCodeAt(pos) <= 0xdbff && + 0xdc00 <= str.charCodeAt(pos + 1) && str.charCodeAt(pos + 1) <= 0xdfff; + } + + // Private function, gets a Unicode code point from a JavaScript UTF-16 string + // handling surrogate pairs appropriately + function codePointAt(str, idx){ + if(idx === undefined){ + idx = 0; + } + var code = str.charCodeAt(idx); + + // if a high surrogate + if (0xD800 <= code && code <= 0xDBFF && + idx < str.length - 1){ + var hi = code; + var low = str.charCodeAt(idx + 1); + if (0xDC00 <= low && low <= 0xDFFF){ + return ((hi - 0xD800) * 0x400) + (low - 0xDC00) + 0x10000; + } + return hi; + } + + // if a low surrogate + if (0xDC00 <= code && code <= 0xDFFF && + idx >= 1){ + var hi = str.charCodeAt(idx - 1); + var low = code; + if (0xD800 <= hi && hi <= 0xDBFF){ + return ((hi - 0xD800) * 0x400) + (low - 0xDC00) + 0x10000; + } + return low; + } + + //just return the char if an unmatched surrogate half or a + //single-char codepoint + return code; + } + + // Private function, returns whether a break is allowed between the + // two given grapheme breaking classes + function shouldBreak(start, mid, end){ + var all = [start].concat(mid).concat([end]); + var previous = all[all.length - 2]; + var next = end; + + // Lookahead termintor for: + // GB10. (E_Base | EBG) Extend* ? E_Modifier + var eModifierIndex = all.lastIndexOf(E_Modifier); + if(eModifierIndex > 1 && + all.slice(1, eModifierIndex).every(function(c){return c == Extend}) && + [Extend, E_Base, E_Base_GAZ].indexOf(start) == -1){ + return Break + } + + // Lookahead termintor for: + // GB12. ^ (RI RI)* RI ? RI + // GB13. [^RI] (RI RI)* RI ? RI + var rIIndex = all.lastIndexOf(Regional_Indicator); + if(rIIndex > 0 && + all.slice(1, rIIndex).every(function(c){return c == Regional_Indicator}) && + [Prepend, Regional_Indicator].indexOf(previous) == -1) { + if(all.filter(function(c){return c == Regional_Indicator}).length % 2 == 1) { + return BreakLastRegional + } + else { + return BreakPenultimateRegional + } + } + + // GB3. CR X LF + if(previous == CR && next == LF){ + return NotBreak; + } + // GB4. (Control|CR|LF) ÷ + else if(previous == Control || previous == CR || previous == LF){ + if(next == E_Modifier && mid.every(function(c){return c == Extend})){ + return Break + } + else { + return BreakStart + } + } + // GB5. ÷ (Control|CR|LF) + else if(next == Control || next == CR || next == LF){ + return BreakStart; + } + // GB6. L X (L|V|LV|LVT) + else if(previous == L && + (next == L || next == V || next == LV || next == LVT)){ + return NotBreak; + } + // GB7. (LV|V) X (V|T) + else if((previous == LV || previous == V) && + (next == V || next == T)){ + return NotBreak; + } + // GB8. (LVT|T) X (T) + else if((previous == LVT || previous == T) && + next == T){ + return NotBreak; + } + // GB9. X (Extend|ZWJ) + else if (next == Extend || next == ZWJ){ + return NotBreak; + } + // GB9a. X SpacingMark + else if(next == SpacingMark){ + return NotBreak; + } + // GB9b. Prepend X + else if (previous == Prepend){ + return NotBreak; + } + + // GB10. (E_Base | EBG) Extend* ? E_Modifier + var previousNonExtendIndex = all.indexOf(Extend) != -1 ? all.lastIndexOf(Extend) - 1 : all.length - 2; + if([E_Base, E_Base_GAZ].indexOf(all[previousNonExtendIndex]) != -1 && + all.slice(previousNonExtendIndex + 1, -1).every(function(c){return c == Extend}) && + next == E_Modifier){ + return NotBreak; + } + + // GB11. ZWJ ? (Glue_After_Zwj | EBG) + if(previous == ZWJ && [Glue_After_Zwj, E_Base_GAZ].indexOf(next) != -1) { + return NotBreak; + } + + // GB12. ^ (RI RI)* RI ? RI + // GB13. [^RI] (RI RI)* RI ? RI + if(mid.indexOf(Regional_Indicator) != -1) { + return Break; + } + if(previous == Regional_Indicator && next == Regional_Indicator) { + return NotBreak; + } + + // GB999. Any ? Any + return BreakStart; + } + + // Returns the next grapheme break in the string after the given index + this.nextBreak = function(string, index){ + if(index === undefined){ + index = 0; + } + if(index < 0){ + return 0; + } + if(index >= string.length - 1){ + return string.length; + } + var prev = getGraphemeBreakProperty(codePointAt(string, index)); + var mid = []; + for (var i = index + 1; i < string.length; i++) { + // check for already processed low surrogates + if(isSurrogate(string, i - 1)){ + continue; + } + + var next = getGraphemeBreakProperty(codePointAt(string, i)); + if(shouldBreak(prev, mid, next)){ + return i; + } + + mid.push(next); + } + return string.length; + }; + + // Breaks the given string into an array of grapheme cluster strings + this.splitGraphemes = function(str){ + var res = []; + var index = 0; + var brk; + while((brk = this.nextBreak(str, index)) < str.length){ + res.push(str.slice(index, brk)); + index = brk; + } + if(index < str.length){ + res.push(str.slice(index)); + } + return res; + }; + + // Returns the number of grapheme clusters there are in the given string + this.countGraphemes = function(str){ + var count = 0; + var index = 0; + var brk; + while((brk = this.nextBreak(str, index)) < str.length){ + index = brk; + count++; + } + if(index < str.length){ + count++; + } + return count; + }; + + //given a Unicode code point, determines this symbol's grapheme break property + function getGraphemeBreakProperty(code){ + + //grapheme break property for Unicode 10.0.0, + //taken from http://www.unicode.org/Public/10.0.0/ucd/auxiliary/GraphemeBreakProperty.txt + //and adapted to JavaScript rules + + if( + (0x0600 <= code && code <= 0x0605) || // Cf [6] ARABIC NUMBER SIGN..ARABIC NUMBER MARK ABOVE + 0x06DD == code || // Cf ARABIC END OF AYAH + 0x070F == code || // Cf SYRIAC ABBREVIATION MARK + 0x08E2 == code || // Cf ARABIC DISPUTED END OF AYAH + 0x0D4E == code || // Lo MALAYALAM LETTER DOT REPH + 0x110BD == code || // Cf KAITHI NUMBER SIGN + (0x111C2 <= code && code <= 0x111C3) || // Lo [2] SHARADA SIGN JIHVAMULIYA..SHARADA SIGN UPADHMANIYA + 0x11A3A == code || // Lo ZANABAZAR SQUARE CLUSTER-INITIAL LETTER RA + (0x11A86 <= code && code <= 0x11A89) || // Lo [4] SOYOMBO CLUSTER-INITIAL LETTER RA..SOYOMBO CLUSTER-INITIAL LETTER SA + 0x11D46 == code // Lo MASARAM GONDI REPHA + ){ + return Prepend; + } + if( + 0x000D == code // Cc + ){ + return CR; + } + + if( + 0x000A == code // Cc + ){ + return LF; + } + + + if( + (0x0000 <= code && code <= 0x0009) || // Cc [10] .. + (0x000B <= code && code <= 0x000C) || // Cc [2] .. + (0x000E <= code && code <= 0x001F) || // Cc [18] .. + (0x007F <= code && code <= 0x009F) || // Cc [33] .. + 0x00AD == code || // Cf SOFT HYPHEN + 0x061C == code || // Cf ARABIC LETTER MARK + + 0x180E == code || // Cf MONGOLIAN VOWEL SEPARATOR + 0x200B == code || // Cf ZERO WIDTH SPACE + (0x200E <= code && code <= 0x200F) || // Cf [2] LEFT-TO-RIGHT MARK..RIGHT-TO-LEFT MARK + 0x2028 == code || // Zl LINE SEPARATOR + 0x2029 == code || // Zp PARAGRAPH SEPARATOR + (0x202A <= code && code <= 0x202E) || // Cf [5] LEFT-TO-RIGHT EMBEDDING..RIGHT-TO-LEFT OVERRIDE + (0x2060 <= code && code <= 0x2064) || // Cf [5] WORD JOINER..INVISIBLE PLUS + 0x2065 == code || // Cn + (0x2066 <= code && code <= 0x206F) || // Cf [10] LEFT-TO-RIGHT ISOLATE..NOMINAL DIGIT SHAPES + (0xD800 <= code && code <= 0xDFFF) || // Cs [2048] .. + 0xFEFF == code || // Cf ZERO WIDTH NO-BREAK SPACE + (0xFFF0 <= code && code <= 0xFFF8) || // Cn [9] .. + (0xFFF9 <= code && code <= 0xFFFB) || // Cf [3] INTERLINEAR ANNOTATION ANCHOR..INTERLINEAR ANNOTATION TERMINATOR + (0x1BCA0 <= code && code <= 0x1BCA3) || // Cf [4] SHORTHAND FORMAT LETTER OVERLAP..SHORTHAND FORMAT UP STEP + (0x1D173 <= code && code <= 0x1D17A) || // Cf [8] MUSICAL SYMBOL BEGIN BEAM..MUSICAL SYMBOL END PHRASE + 0xE0000 == code || // Cn + 0xE0001 == code || // Cf LANGUAGE TAG + (0xE0002 <= code && code <= 0xE001F) || // Cn [30] .. + (0xE0080 <= code && code <= 0xE00FF) || // Cn [128] .. + (0xE01F0 <= code && code <= 0xE0FFF) // Cn [3600] .. + ){ + return Control; + } + + + if( + (0x0300 <= code && code <= 0x036F) || // Mn [112] COMBINING GRAVE ACCENT..COMBINING LATIN SMALL LETTER X + (0x0483 <= code && code <= 0x0487) || // Mn [5] COMBINING CYRILLIC TITLO..COMBINING CYRILLIC POKRYTIE + (0x0488 <= code && code <= 0x0489) || // Me [2] COMBINING CYRILLIC HUNDRED THOUSANDS SIGN..COMBINING CYRILLIC MILLIONS SIGN + (0x0591 <= code && code <= 0x05BD) || // Mn [45] HEBREW ACCENT ETNAHTA..HEBREW POINT METEG + 0x05BF == code || // Mn HEBREW POINT RAFE + (0x05C1 <= code && code <= 0x05C2) || // Mn [2] HEBREW POINT SHIN DOT..HEBREW POINT SIN DOT + (0x05C4 <= code && code <= 0x05C5) || // Mn [2] HEBREW MARK UPPER DOT..HEBREW MARK LOWER DOT + 0x05C7 == code || // Mn HEBREW POINT QAMATS QATAN + (0x0610 <= code && code <= 0x061A) || // Mn [11] ARABIC SIGN SALLALLAHOU ALAYHE WASSALLAM..ARABIC SMALL KASRA + (0x064B <= code && code <= 0x065F) || // Mn [21] ARABIC FATHATAN..ARABIC WAVY HAMZA BELOW + 0x0670 == code || // Mn ARABIC LETTER SUPERSCRIPT ALEF + (0x06D6 <= code && code <= 0x06DC) || // Mn [7] ARABIC SMALL HIGH LIGATURE SAD WITH LAM WITH ALEF MAKSURA..ARABIC SMALL HIGH SEEN + (0x06DF <= code && code <= 0x06E4) || // Mn [6] ARABIC SMALL HIGH ROUNDED ZERO..ARABIC SMALL HIGH MADDA + (0x06E7 <= code && code <= 0x06E8) || // Mn [2] ARABIC SMALL HIGH YEH..ARABIC SMALL HIGH NOON + (0x06EA <= code && code <= 0x06ED) || // Mn [4] ARABIC EMPTY CENTRE LOW STOP..ARABIC SMALL LOW MEEM + 0x0711 == code || // Mn SYRIAC LETTER SUPERSCRIPT ALAPH + (0x0730 <= code && code <= 0x074A) || // Mn [27] SYRIAC PTHAHA ABOVE..SYRIAC BARREKH + (0x07A6 <= code && code <= 0x07B0) || // Mn [11] THAANA ABAFILI..THAANA SUKUN + (0x07EB <= code && code <= 0x07F3) || // Mn [9] NKO COMBINING SHORT HIGH TONE..NKO COMBINING DOUBLE DOT ABOVE + (0x0816 <= code && code <= 0x0819) || // Mn [4] SAMARITAN MARK IN..SAMARITAN MARK DAGESH + (0x081B <= code && code <= 0x0823) || // Mn [9] SAMARITAN MARK EPENTHETIC YUT..SAMARITAN VOWEL SIGN A + (0x0825 <= code && code <= 0x0827) || // Mn [3] SAMARITAN VOWEL SIGN SHORT A..SAMARITAN VOWEL SIGN U + (0x0829 <= code && code <= 0x082D) || // Mn [5] SAMARITAN VOWEL SIGN LONG I..SAMARITAN MARK NEQUDAA + (0x0859 <= code && code <= 0x085B) || // Mn [3] MANDAIC AFFRICATION MARK..MANDAIC GEMINATION MARK + (0x08D4 <= code && code <= 0x08E1) || // Mn [14] ARABIC SMALL HIGH WORD AR-RUB..ARABIC SMALL HIGH SIGN SAFHA + (0x08E3 <= code && code <= 0x0902) || // Mn [32] ARABIC TURNED DAMMA BELOW..DEVANAGARI SIGN ANUSVARA + 0x093A == code || // Mn DEVANAGARI VOWEL SIGN OE + 0x093C == code || // Mn DEVANAGARI SIGN NUKTA + (0x0941 <= code && code <= 0x0948) || // Mn [8] DEVANAGARI VOWEL SIGN U..DEVANAGARI VOWEL SIGN AI + 0x094D == code || // Mn DEVANAGARI SIGN VIRAMA + (0x0951 <= code && code <= 0x0957) || // Mn [7] DEVANAGARI STRESS SIGN UDATTA..DEVANAGARI VOWEL SIGN UUE + (0x0962 <= code && code <= 0x0963) || // Mn [2] DEVANAGARI VOWEL SIGN VOCALIC L..DEVANAGARI VOWEL SIGN VOCALIC LL + 0x0981 == code || // Mn BENGALI SIGN CANDRABINDU + 0x09BC == code || // Mn BENGALI SIGN NUKTA + 0x09BE == code || // Mc BENGALI VOWEL SIGN AA + (0x09C1 <= code && code <= 0x09C4) || // Mn [4] BENGALI VOWEL SIGN U..BENGALI VOWEL SIGN VOCALIC RR + 0x09CD == code || // Mn BENGALI SIGN VIRAMA + 0x09D7 == code || // Mc BENGALI AU LENGTH MARK + (0x09E2 <= code && code <= 0x09E3) || // Mn [2] BENGALI VOWEL SIGN VOCALIC L..BENGALI VOWEL SIGN VOCALIC LL + (0x0A01 <= code && code <= 0x0A02) || // Mn [2] GURMUKHI SIGN ADAK BINDI..GURMUKHI SIGN BINDI + 0x0A3C == code || // Mn GURMUKHI SIGN NUKTA + (0x0A41 <= code && code <= 0x0A42) || // Mn [2] GURMUKHI VOWEL SIGN U..GURMUKHI VOWEL SIGN UU + (0x0A47 <= code && code <= 0x0A48) || // Mn [2] GURMUKHI VOWEL SIGN EE..GURMUKHI VOWEL SIGN AI + (0x0A4B <= code && code <= 0x0A4D) || // Mn [3] GURMUKHI VOWEL SIGN OO..GURMUKHI SIGN VIRAMA + 0x0A51 == code || // Mn GURMUKHI SIGN UDAAT + (0x0A70 <= code && code <= 0x0A71) || // Mn [2] GURMUKHI TIPPI..GURMUKHI ADDAK + 0x0A75 == code || // Mn GURMUKHI SIGN YAKASH + (0x0A81 <= code && code <= 0x0A82) || // Mn [2] GUJARATI SIGN CANDRABINDU..GUJARATI SIGN ANUSVARA + 0x0ABC == code || // Mn GUJARATI SIGN NUKTA + (0x0AC1 <= code && code <= 0x0AC5) || // Mn [5] GUJARATI VOWEL SIGN U..GUJARATI VOWEL SIGN CANDRA E + (0x0AC7 <= code && code <= 0x0AC8) || // Mn [2] GUJARATI VOWEL SIGN E..GUJARATI VOWEL SIGN AI + 0x0ACD == code || // Mn GUJARATI SIGN VIRAMA + (0x0AE2 <= code && code <= 0x0AE3) || // Mn [2] GUJARATI VOWEL SIGN VOCALIC L..GUJARATI VOWEL SIGN VOCALIC LL + (0x0AFA <= code && code <= 0x0AFF) || // Mn [6] GUJARATI SIGN SUKUN..GUJARATI SIGN TWO-CIRCLE NUKTA ABOVE + 0x0B01 == code || // Mn ORIYA SIGN CANDRABINDU + 0x0B3C == code || // Mn ORIYA SIGN NUKTA + 0x0B3E == code || // Mc ORIYA VOWEL SIGN AA + 0x0B3F == code || // Mn ORIYA VOWEL SIGN I + (0x0B41 <= code && code <= 0x0B44) || // Mn [4] ORIYA VOWEL SIGN U..ORIYA VOWEL SIGN VOCALIC RR + 0x0B4D == code || // Mn ORIYA SIGN VIRAMA + 0x0B56 == code || // Mn ORIYA AI LENGTH MARK + 0x0B57 == code || // Mc ORIYA AU LENGTH MARK + (0x0B62 <= code && code <= 0x0B63) || // Mn [2] ORIYA VOWEL SIGN VOCALIC L..ORIYA VOWEL SIGN VOCALIC LL + 0x0B82 == code || // Mn TAMIL SIGN ANUSVARA + 0x0BBE == code || // Mc TAMIL VOWEL SIGN AA + 0x0BC0 == code || // Mn TAMIL VOWEL SIGN II + 0x0BCD == code || // Mn TAMIL SIGN VIRAMA + 0x0BD7 == code || // Mc TAMIL AU LENGTH MARK + 0x0C00 == code || // Mn TELUGU SIGN COMBINING CANDRABINDU ABOVE + (0x0C3E <= code && code <= 0x0C40) || // Mn [3] TELUGU VOWEL SIGN AA..TELUGU VOWEL SIGN II + (0x0C46 <= code && code <= 0x0C48) || // Mn [3] TELUGU VOWEL SIGN E..TELUGU VOWEL SIGN AI + (0x0C4A <= code && code <= 0x0C4D) || // Mn [4] TELUGU VOWEL SIGN O..TELUGU SIGN VIRAMA + (0x0C55 <= code && code <= 0x0C56) || // Mn [2] TELUGU LENGTH MARK..TELUGU AI LENGTH MARK + (0x0C62 <= code && code <= 0x0C63) || // Mn [2] TELUGU VOWEL SIGN VOCALIC L..TELUGU VOWEL SIGN VOCALIC LL + 0x0C81 == code || // Mn KANNADA SIGN CANDRABINDU + 0x0CBC == code || // Mn KANNADA SIGN NUKTA + 0x0CBF == code || // Mn KANNADA VOWEL SIGN I + 0x0CC2 == code || // Mc KANNADA VOWEL SIGN UU + 0x0CC6 == code || // Mn KANNADA VOWEL SIGN E + (0x0CCC <= code && code <= 0x0CCD) || // Mn [2] KANNADA VOWEL SIGN AU..KANNADA SIGN VIRAMA + (0x0CD5 <= code && code <= 0x0CD6) || // Mc [2] KANNADA LENGTH MARK..KANNADA AI LENGTH MARK + (0x0CE2 <= code && code <= 0x0CE3) || // Mn [2] KANNADA VOWEL SIGN VOCALIC L..KANNADA VOWEL SIGN VOCALIC LL + (0x0D00 <= code && code <= 0x0D01) || // Mn [2] MALAYALAM SIGN COMBINING ANUSVARA ABOVE..MALAYALAM SIGN CANDRABINDU + (0x0D3B <= code && code <= 0x0D3C) || // Mn [2] MALAYALAM SIGN VERTICAL BAR VIRAMA..MALAYALAM SIGN CIRCULAR VIRAMA + 0x0D3E == code || // Mc MALAYALAM VOWEL SIGN AA + (0x0D41 <= code && code <= 0x0D44) || // Mn [4] MALAYALAM VOWEL SIGN U..MALAYALAM VOWEL SIGN VOCALIC RR + 0x0D4D == code || // Mn MALAYALAM SIGN VIRAMA + 0x0D57 == code || // Mc MALAYALAM AU LENGTH MARK + (0x0D62 <= code && code <= 0x0D63) || // Mn [2] MALAYALAM VOWEL SIGN VOCALIC L..MALAYALAM VOWEL SIGN VOCALIC LL + 0x0DCA == code || // Mn SINHALA SIGN AL-LAKUNA + 0x0DCF == code || // Mc SINHALA VOWEL SIGN AELA-PILLA + (0x0DD2 <= code && code <= 0x0DD4) || // Mn [3] SINHALA VOWEL SIGN KETTI IS-PILLA..SINHALA VOWEL SIGN KETTI PAA-PILLA + 0x0DD6 == code || // Mn SINHALA VOWEL SIGN DIGA PAA-PILLA + 0x0DDF == code || // Mc SINHALA VOWEL SIGN GAYANUKITTA + 0x0E31 == code || // Mn THAI CHARACTER MAI HAN-AKAT + (0x0E34 <= code && code <= 0x0E3A) || // Mn [7] THAI CHARACTER SARA I..THAI CHARACTER PHINTHU + (0x0E47 <= code && code <= 0x0E4E) || // Mn [8] THAI CHARACTER MAITAIKHU..THAI CHARACTER YAMAKKAN + 0x0EB1 == code || // Mn LAO VOWEL SIGN MAI KAN + (0x0EB4 <= code && code <= 0x0EB9) || // Mn [6] LAO VOWEL SIGN I..LAO VOWEL SIGN UU + (0x0EBB <= code && code <= 0x0EBC) || // Mn [2] LAO VOWEL SIGN MAI KON..LAO SEMIVOWEL SIGN LO + (0x0EC8 <= code && code <= 0x0ECD) || // Mn [6] LAO TONE MAI EK..LAO NIGGAHITA + (0x0F18 <= code && code <= 0x0F19) || // Mn [2] TIBETAN ASTROLOGICAL SIGN -KHYUD PA..TIBETAN ASTROLOGICAL SIGN SDONG TSHUGS + 0x0F35 == code || // Mn TIBETAN MARK NGAS BZUNG NYI ZLA + 0x0F37 == code || // Mn TIBETAN MARK NGAS BZUNG SGOR RTAGS + 0x0F39 == code || // Mn TIBETAN MARK TSA -PHRU + (0x0F71 <= code && code <= 0x0F7E) || // Mn [14] TIBETAN VOWEL SIGN AA..TIBETAN SIGN RJES SU NGA RO + (0x0F80 <= code && code <= 0x0F84) || // Mn [5] TIBETAN VOWEL SIGN REVERSED I..TIBETAN MARK HALANTA + (0x0F86 <= code && code <= 0x0F87) || // Mn [2] TIBETAN SIGN LCI RTAGS..TIBETAN SIGN YANG RTAGS + (0x0F8D <= code && code <= 0x0F97) || // Mn [11] TIBETAN SUBJOINED SIGN LCE TSA CAN..TIBETAN SUBJOINED LETTER JA + (0x0F99 <= code && code <= 0x0FBC) || // Mn [36] TIBETAN SUBJOINED LETTER NYA..TIBETAN SUBJOINED LETTER FIXED-FORM RA + 0x0FC6 == code || // Mn TIBETAN SYMBOL PADMA GDAN + (0x102D <= code && code <= 0x1030) || // Mn [4] MYANMAR VOWEL SIGN I..MYANMAR VOWEL SIGN UU + (0x1032 <= code && code <= 0x1037) || // Mn [6] MYANMAR VOWEL SIGN AI..MYANMAR SIGN DOT BELOW + (0x1039 <= code && code <= 0x103A) || // Mn [2] MYANMAR SIGN VIRAMA..MYANMAR SIGN ASAT + (0x103D <= code && code <= 0x103E) || // Mn [2] MYANMAR CONSONANT SIGN MEDIAL WA..MYANMAR CONSONANT SIGN MEDIAL HA + (0x1058 <= code && code <= 0x1059) || // Mn [2] MYANMAR VOWEL SIGN VOCALIC L..MYANMAR VOWEL SIGN VOCALIC LL + (0x105E <= code && code <= 0x1060) || // Mn [3] MYANMAR CONSONANT SIGN MON MEDIAL NA..MYANMAR CONSONANT SIGN MON MEDIAL LA + (0x1071 <= code && code <= 0x1074) || // Mn [4] MYANMAR VOWEL SIGN GEBA KAREN I..MYANMAR VOWEL SIGN KAYAH EE + 0x1082 == code || // Mn MYANMAR CONSONANT SIGN SHAN MEDIAL WA + (0x1085 <= code && code <= 0x1086) || // Mn [2] MYANMAR VOWEL SIGN SHAN E ABOVE..MYANMAR VOWEL SIGN SHAN FINAL Y + 0x108D == code || // Mn MYANMAR SIGN SHAN COUNCIL EMPHATIC TONE + 0x109D == code || // Mn MYANMAR VOWEL SIGN AITON AI + (0x135D <= code && code <= 0x135F) || // Mn [3] ETHIOPIC COMBINING GEMINATION AND VOWEL LENGTH MARK..ETHIOPIC COMBINING GEMINATION MARK + (0x1712 <= code && code <= 0x1714) || // Mn [3] TAGALOG VOWEL SIGN I..TAGALOG SIGN VIRAMA + (0x1732 <= code && code <= 0x1734) || // Mn [3] HANUNOO VOWEL SIGN I..HANUNOO SIGN PAMUDPOD + (0x1752 <= code && code <= 0x1753) || // Mn [2] BUHID VOWEL SIGN I..BUHID VOWEL SIGN U + (0x1772 <= code && code <= 0x1773) || // Mn [2] TAGBANWA VOWEL SIGN I..TAGBANWA VOWEL SIGN U + (0x17B4 <= code && code <= 0x17B5) || // Mn [2] KHMER VOWEL INHERENT AQ..KHMER VOWEL INHERENT AA + (0x17B7 <= code && code <= 0x17BD) || // Mn [7] KHMER VOWEL SIGN I..KHMER VOWEL SIGN UA + 0x17C6 == code || // Mn KHMER SIGN NIKAHIT + (0x17C9 <= code && code <= 0x17D3) || // Mn [11] KHMER SIGN MUUSIKATOAN..KHMER SIGN BATHAMASAT + 0x17DD == code || // Mn KHMER SIGN ATTHACAN + (0x180B <= code && code <= 0x180D) || // Mn [3] MONGOLIAN FREE VARIATION SELECTOR ONE..MONGOLIAN FREE VARIATION SELECTOR THREE + (0x1885 <= code && code <= 0x1886) || // Mn [2] MONGOLIAN LETTER ALI GALI BALUDA..MONGOLIAN LETTER ALI GALI THREE BALUDA + 0x18A9 == code || // Mn MONGOLIAN LETTER ALI GALI DAGALGA + (0x1920 <= code && code <= 0x1922) || // Mn [3] LIMBU VOWEL SIGN A..LIMBU VOWEL SIGN U + (0x1927 <= code && code <= 0x1928) || // Mn [2] LIMBU VOWEL SIGN E..LIMBU VOWEL SIGN O + 0x1932 == code || // Mn LIMBU SMALL LETTER ANUSVARA + (0x1939 <= code && code <= 0x193B) || // Mn [3] LIMBU SIGN MUKPHRENG..LIMBU SIGN SA-I + (0x1A17 <= code && code <= 0x1A18) || // Mn [2] BUGINESE VOWEL SIGN I..BUGINESE VOWEL SIGN U + 0x1A1B == code || // Mn BUGINESE VOWEL SIGN AE + 0x1A56 == code || // Mn TAI THAM CONSONANT SIGN MEDIAL LA + (0x1A58 <= code && code <= 0x1A5E) || // Mn [7] TAI THAM SIGN MAI KANG LAI..TAI THAM CONSONANT SIGN SA + 0x1A60 == code || // Mn TAI THAM SIGN SAKOT + 0x1A62 == code || // Mn TAI THAM VOWEL SIGN MAI SAT + (0x1A65 <= code && code <= 0x1A6C) || // Mn [8] TAI THAM VOWEL SIGN I..TAI THAM VOWEL SIGN OA BELOW + (0x1A73 <= code && code <= 0x1A7C) || // Mn [10] TAI THAM VOWEL SIGN OA ABOVE..TAI THAM SIGN KHUEN-LUE KARAN + 0x1A7F == code || // Mn TAI THAM COMBINING CRYPTOGRAMMIC DOT + (0x1AB0 <= code && code <= 0x1ABD) || // Mn [14] COMBINING DOUBLED CIRCUMFLEX ACCENT..COMBINING PARENTHESES BELOW + 0x1ABE == code || // Me COMBINING PARENTHESES OVERLAY + (0x1B00 <= code && code <= 0x1B03) || // Mn [4] BALINESE SIGN ULU RICEM..BALINESE SIGN SURANG + 0x1B34 == code || // Mn BALINESE SIGN REREKAN + (0x1B36 <= code && code <= 0x1B3A) || // Mn [5] BALINESE VOWEL SIGN ULU..BALINESE VOWEL SIGN RA REPA + 0x1B3C == code || // Mn BALINESE VOWEL SIGN LA LENGA + 0x1B42 == code || // Mn BALINESE VOWEL SIGN PEPET + (0x1B6B <= code && code <= 0x1B73) || // Mn [9] BALINESE MUSICAL SYMBOL COMBINING TEGEH..BALINESE MUSICAL SYMBOL COMBINING GONG + (0x1B80 <= code && code <= 0x1B81) || // Mn [2] SUNDANESE SIGN PANYECEK..SUNDANESE SIGN PANGLAYAR + (0x1BA2 <= code && code <= 0x1BA5) || // Mn [4] SUNDANESE CONSONANT SIGN PANYAKRA..SUNDANESE VOWEL SIGN PANYUKU + (0x1BA8 <= code && code <= 0x1BA9) || // Mn [2] SUNDANESE VOWEL SIGN PAMEPET..SUNDANESE VOWEL SIGN PANEULEUNG + (0x1BAB <= code && code <= 0x1BAD) || // Mn [3] SUNDANESE SIGN VIRAMA..SUNDANESE CONSONANT SIGN PASANGAN WA + 0x1BE6 == code || // Mn BATAK SIGN TOMPI + (0x1BE8 <= code && code <= 0x1BE9) || // Mn [2] BATAK VOWEL SIGN PAKPAK E..BATAK VOWEL SIGN EE + 0x1BED == code || // Mn BATAK VOWEL SIGN KARO O + (0x1BEF <= code && code <= 0x1BF1) || // Mn [3] BATAK VOWEL SIGN U FOR SIMALUNGUN SA..BATAK CONSONANT SIGN H + (0x1C2C <= code && code <= 0x1C33) || // Mn [8] LEPCHA VOWEL SIGN E..LEPCHA CONSONANT SIGN T + (0x1C36 <= code && code <= 0x1C37) || // Mn [2] LEPCHA SIGN RAN..LEPCHA SIGN NUKTA + (0x1CD0 <= code && code <= 0x1CD2) || // Mn [3] VEDIC TONE KARSHANA..VEDIC TONE PRENKHA + (0x1CD4 <= code && code <= 0x1CE0) || // Mn [13] VEDIC SIGN YAJURVEDIC MIDLINE SVARITA..VEDIC TONE RIGVEDIC KASHMIRI INDEPENDENT SVARITA + (0x1CE2 <= code && code <= 0x1CE8) || // Mn [7] VEDIC SIGN VISARGA SVARITA..VEDIC SIGN VISARGA ANUDATTA WITH TAIL + 0x1CED == code || // Mn VEDIC SIGN TIRYAK + 0x1CF4 == code || // Mn VEDIC TONE CANDRA ABOVE + (0x1CF8 <= code && code <= 0x1CF9) || // Mn [2] VEDIC TONE RING ABOVE..VEDIC TONE DOUBLE RING ABOVE + (0x1DC0 <= code && code <= 0x1DF9) || // Mn [58] COMBINING DOTTED GRAVE ACCENT..COMBINING WIDE INVERTED BRIDGE BELOW + (0x1DFB <= code && code <= 0x1DFF) || // Mn [5] COMBINING DELETION MARK..COMBINING RIGHT ARROWHEAD AND DOWN ARROWHEAD BELOW + 0x200C == code || // Cf ZERO WIDTH NON-JOINER + (0x20D0 <= code && code <= 0x20DC) || // Mn [13] COMBINING LEFT HARPOON ABOVE..COMBINING FOUR DOTS ABOVE + (0x20DD <= code && code <= 0x20E0) || // Me [4] COMBINING ENCLOSING CIRCLE..COMBINING ENCLOSING CIRCLE BACKSLASH + 0x20E1 == code || // Mn COMBINING LEFT RIGHT ARROW ABOVE + (0x20E2 <= code && code <= 0x20E4) || // Me [3] COMBINING ENCLOSING SCREEN..COMBINING ENCLOSING UPWARD POINTING TRIANGLE + (0x20E5 <= code && code <= 0x20F0) || // Mn [12] COMBINING REVERSE SOLIDUS OVERLAY..COMBINING ASTERISK ABOVE + (0x2CEF <= code && code <= 0x2CF1) || // Mn [3] COPTIC COMBINING NI ABOVE..COPTIC COMBINING SPIRITUS LENIS + 0x2D7F == code || // Mn TIFINAGH CONSONANT JOINER + (0x2DE0 <= code && code <= 0x2DFF) || // Mn [32] COMBINING CYRILLIC LETTER BE..COMBINING CYRILLIC LETTER IOTIFIED BIG YUS + (0x302A <= code && code <= 0x302D) || // Mn [4] IDEOGRAPHIC LEVEL TONE MARK..IDEOGRAPHIC ENTERING TONE MARK + (0x302E <= code && code <= 0x302F) || // Mc [2] HANGUL SINGLE DOT TONE MARK..HANGUL DOUBLE DOT TONE MARK + (0x3099 <= code && code <= 0x309A) || // Mn [2] COMBINING KATAKANA-HIRAGANA VOICED SOUND MARK..COMBINING KATAKANA-HIRAGANA SEMI-VOICED SOUND MARK + 0xA66F == code || // Mn COMBINING CYRILLIC VZMET + (0xA670 <= code && code <= 0xA672) || // Me [3] COMBINING CYRILLIC TEN MILLIONS SIGN..COMBINING CYRILLIC THOUSAND MILLIONS SIGN + (0xA674 <= code && code <= 0xA67D) || // Mn [10] COMBINING CYRILLIC LETTER UKRAINIAN IE..COMBINING CYRILLIC PAYEROK + (0xA69E <= code && code <= 0xA69F) || // Mn [2] COMBINING CYRILLIC LETTER EF..COMBINING CYRILLIC LETTER IOTIFIED E + (0xA6F0 <= code && code <= 0xA6F1) || // Mn [2] BAMUM COMBINING MARK KOQNDON..BAMUM COMBINING MARK TUKWENTIS + 0xA802 == code || // Mn SYLOTI NAGRI SIGN DVISVARA + 0xA806 == code || // Mn SYLOTI NAGRI SIGN HASANTA + 0xA80B == code || // Mn SYLOTI NAGRI SIGN ANUSVARA + (0xA825 <= code && code <= 0xA826) || // Mn [2] SYLOTI NAGRI VOWEL SIGN U..SYLOTI NAGRI VOWEL SIGN E + (0xA8C4 <= code && code <= 0xA8C5) || // Mn [2] SAURASHTRA SIGN VIRAMA..SAURASHTRA SIGN CANDRABINDU + (0xA8E0 <= code && code <= 0xA8F1) || // Mn [18] COMBINING DEVANAGARI DIGIT ZERO..COMBINING DEVANAGARI SIGN AVAGRAHA + (0xA926 <= code && code <= 0xA92D) || // Mn [8] KAYAH LI VOWEL UE..KAYAH LI TONE CALYA PLOPHU + (0xA947 <= code && code <= 0xA951) || // Mn [11] REJANG VOWEL SIGN I..REJANG CONSONANT SIGN R + (0xA980 <= code && code <= 0xA982) || // Mn [3] JAVANESE SIGN PANYANGGA..JAVANESE SIGN LAYAR + 0xA9B3 == code || // Mn JAVANESE SIGN CECAK TELU + (0xA9B6 <= code && code <= 0xA9B9) || // Mn [4] JAVANESE VOWEL SIGN WULU..JAVANESE VOWEL SIGN SUKU MENDUT + 0xA9BC == code || // Mn JAVANESE VOWEL SIGN PEPET + 0xA9E5 == code || // Mn MYANMAR SIGN SHAN SAW + (0xAA29 <= code && code <= 0xAA2E) || // Mn [6] CHAM VOWEL SIGN AA..CHAM VOWEL SIGN OE + (0xAA31 <= code && code <= 0xAA32) || // Mn [2] CHAM VOWEL SIGN AU..CHAM VOWEL SIGN UE + (0xAA35 <= code && code <= 0xAA36) || // Mn [2] CHAM CONSONANT SIGN LA..CHAM CONSONANT SIGN WA + 0xAA43 == code || // Mn CHAM CONSONANT SIGN FINAL NG + 0xAA4C == code || // Mn CHAM CONSONANT SIGN FINAL M + 0xAA7C == code || // Mn MYANMAR SIGN TAI LAING TONE-2 + 0xAAB0 == code || // Mn TAI VIET MAI KANG + (0xAAB2 <= code && code <= 0xAAB4) || // Mn [3] TAI VIET VOWEL I..TAI VIET VOWEL U + (0xAAB7 <= code && code <= 0xAAB8) || // Mn [2] TAI VIET MAI KHIT..TAI VIET VOWEL IA + (0xAABE <= code && code <= 0xAABF) || // Mn [2] TAI VIET VOWEL AM..TAI VIET TONE MAI EK + 0xAAC1 == code || // Mn TAI VIET TONE MAI THO + (0xAAEC <= code && code <= 0xAAED) || // Mn [2] MEETEI MAYEK VOWEL SIGN UU..MEETEI MAYEK VOWEL SIGN AAI + 0xAAF6 == code || // Mn MEETEI MAYEK VIRAMA + 0xABE5 == code || // Mn MEETEI MAYEK VOWEL SIGN ANAP + 0xABE8 == code || // Mn MEETEI MAYEK VOWEL SIGN UNAP + 0xABED == code || // Mn MEETEI MAYEK APUN IYEK + 0xFB1E == code || // Mn HEBREW POINT JUDEO-SPANISH VARIKA + (0xFE00 <= code && code <= 0xFE0F) || // Mn [16] VARIATION SELECTOR-1..VARIATION SELECTOR-16 + (0xFE20 <= code && code <= 0xFE2F) || // Mn [16] COMBINING LIGATURE LEFT HALF..COMBINING CYRILLIC TITLO RIGHT HALF + (0xFF9E <= code && code <= 0xFF9F) || // Lm [2] HALFWIDTH KATAKANA VOICED SOUND MARK..HALFWIDTH KATAKANA SEMI-VOICED SOUND MARK + 0x101FD == code || // Mn PHAISTOS DISC SIGN COMBINING OBLIQUE STROKE + 0x102E0 == code || // Mn COPTIC EPACT THOUSANDS MARK + (0x10376 <= code && code <= 0x1037A) || // Mn [5] COMBINING OLD PERMIC LETTER AN..COMBINING OLD PERMIC LETTER SII + (0x10A01 <= code && code <= 0x10A03) || // Mn [3] KHAROSHTHI VOWEL SIGN I..KHAROSHTHI VOWEL SIGN VOCALIC R + (0x10A05 <= code && code <= 0x10A06) || // Mn [2] KHAROSHTHI VOWEL SIGN E..KHAROSHTHI VOWEL SIGN O + (0x10A0C <= code && code <= 0x10A0F) || // Mn [4] KHAROSHTHI VOWEL LENGTH MARK..KHAROSHTHI SIGN VISARGA + (0x10A38 <= code && code <= 0x10A3A) || // Mn [3] KHAROSHTHI SIGN BAR ABOVE..KHAROSHTHI SIGN DOT BELOW + 0x10A3F == code || // Mn KHAROSHTHI VIRAMA + (0x10AE5 <= code && code <= 0x10AE6) || // Mn [2] MANICHAEAN ABBREVIATION MARK ABOVE..MANICHAEAN ABBREVIATION MARK BELOW + 0x11001 == code || // Mn BRAHMI SIGN ANUSVARA + (0x11038 <= code && code <= 0x11046) || // Mn [15] BRAHMI VOWEL SIGN AA..BRAHMI VIRAMA + (0x1107F <= code && code <= 0x11081) || // Mn [3] BRAHMI NUMBER JOINER..KAITHI SIGN ANUSVARA + (0x110B3 <= code && code <= 0x110B6) || // Mn [4] KAITHI VOWEL SIGN U..KAITHI VOWEL SIGN AI + (0x110B9 <= code && code <= 0x110BA) || // Mn [2] KAITHI SIGN VIRAMA..KAITHI SIGN NUKTA + (0x11100 <= code && code <= 0x11102) || // Mn [3] CHAKMA SIGN CANDRABINDU..CHAKMA SIGN VISARGA + (0x11127 <= code && code <= 0x1112B) || // Mn [5] CHAKMA VOWEL SIGN A..CHAKMA VOWEL SIGN UU + (0x1112D <= code && code <= 0x11134) || // Mn [8] CHAKMA VOWEL SIGN AI..CHAKMA MAAYYAA + 0x11173 == code || // Mn MAHAJANI SIGN NUKTA + (0x11180 <= code && code <= 0x11181) || // Mn [2] SHARADA SIGN CANDRABINDU..SHARADA SIGN ANUSVARA + (0x111B6 <= code && code <= 0x111BE) || // Mn [9] SHARADA VOWEL SIGN U..SHARADA VOWEL SIGN O + (0x111CA <= code && code <= 0x111CC) || // Mn [3] SHARADA SIGN NUKTA..SHARADA EXTRA SHORT VOWEL MARK + (0x1122F <= code && code <= 0x11231) || // Mn [3] KHOJKI VOWEL SIGN U..KHOJKI VOWEL SIGN AI + 0x11234 == code || // Mn KHOJKI SIGN ANUSVARA + (0x11236 <= code && code <= 0x11237) || // Mn [2] KHOJKI SIGN NUKTA..KHOJKI SIGN SHADDA + 0x1123E == code || // Mn KHOJKI SIGN SUKUN + 0x112DF == code || // Mn KHUDAWADI SIGN ANUSVARA + (0x112E3 <= code && code <= 0x112EA) || // Mn [8] KHUDAWADI VOWEL SIGN U..KHUDAWADI SIGN VIRAMA + (0x11300 <= code && code <= 0x11301) || // Mn [2] GRANTHA SIGN COMBINING ANUSVARA ABOVE..GRANTHA SIGN CANDRABINDU + 0x1133C == code || // Mn GRANTHA SIGN NUKTA + 0x1133E == code || // Mc GRANTHA VOWEL SIGN AA + 0x11340 == code || // Mn GRANTHA VOWEL SIGN II + 0x11357 == code || // Mc GRANTHA AU LENGTH MARK + (0x11366 <= code && code <= 0x1136C) || // Mn [7] COMBINING GRANTHA DIGIT ZERO..COMBINING GRANTHA DIGIT SIX + (0x11370 <= code && code <= 0x11374) || // Mn [5] COMBINING GRANTHA LETTER A..COMBINING GRANTHA LETTER PA + (0x11438 <= code && code <= 0x1143F) || // Mn [8] NEWA VOWEL SIGN U..NEWA VOWEL SIGN AI + (0x11442 <= code && code <= 0x11444) || // Mn [3] NEWA SIGN VIRAMA..NEWA SIGN ANUSVARA + 0x11446 == code || // Mn NEWA SIGN NUKTA + 0x114B0 == code || // Mc TIRHUTA VOWEL SIGN AA + (0x114B3 <= code && code <= 0x114B8) || // Mn [6] TIRHUTA VOWEL SIGN U..TIRHUTA VOWEL SIGN VOCALIC LL + 0x114BA == code || // Mn TIRHUTA VOWEL SIGN SHORT E + 0x114BD == code || // Mc TIRHUTA VOWEL SIGN SHORT O + (0x114BF <= code && code <= 0x114C0) || // Mn [2] TIRHUTA SIGN CANDRABINDU..TIRHUTA SIGN ANUSVARA + (0x114C2 <= code && code <= 0x114C3) || // Mn [2] TIRHUTA SIGN VIRAMA..TIRHUTA SIGN NUKTA + 0x115AF == code || // Mc SIDDHAM VOWEL SIGN AA + (0x115B2 <= code && code <= 0x115B5) || // Mn [4] SIDDHAM VOWEL SIGN U..SIDDHAM VOWEL SIGN VOCALIC RR + (0x115BC <= code && code <= 0x115BD) || // Mn [2] SIDDHAM SIGN CANDRABINDU..SIDDHAM SIGN ANUSVARA + (0x115BF <= code && code <= 0x115C0) || // Mn [2] SIDDHAM SIGN VIRAMA..SIDDHAM SIGN NUKTA + (0x115DC <= code && code <= 0x115DD) || // Mn [2] SIDDHAM VOWEL SIGN ALTERNATE U..SIDDHAM VOWEL SIGN ALTERNATE UU + (0x11633 <= code && code <= 0x1163A) || // Mn [8] MODI VOWEL SIGN U..MODI VOWEL SIGN AI + 0x1163D == code || // Mn MODI SIGN ANUSVARA + (0x1163F <= code && code <= 0x11640) || // Mn [2] MODI SIGN VIRAMA..MODI SIGN ARDHACANDRA + 0x116AB == code || // Mn TAKRI SIGN ANUSVARA + 0x116AD == code || // Mn TAKRI VOWEL SIGN AA + (0x116B0 <= code && code <= 0x116B5) || // Mn [6] TAKRI VOWEL SIGN U..TAKRI VOWEL SIGN AU + 0x116B7 == code || // Mn TAKRI SIGN NUKTA + (0x1171D <= code && code <= 0x1171F) || // Mn [3] AHOM CONSONANT SIGN MEDIAL LA..AHOM CONSONANT SIGN MEDIAL LIGATING RA + (0x11722 <= code && code <= 0x11725) || // Mn [4] AHOM VOWEL SIGN I..AHOM VOWEL SIGN UU + (0x11727 <= code && code <= 0x1172B) || // Mn [5] AHOM VOWEL SIGN AW..AHOM SIGN KILLER + (0x11A01 <= code && code <= 0x11A06) || // Mn [6] ZANABAZAR SQUARE VOWEL SIGN I..ZANABAZAR SQUARE VOWEL SIGN O + (0x11A09 <= code && code <= 0x11A0A) || // Mn [2] ZANABAZAR SQUARE VOWEL SIGN REVERSED I..ZANABAZAR SQUARE VOWEL LENGTH MARK + (0x11A33 <= code && code <= 0x11A38) || // Mn [6] ZANABAZAR SQUARE FINAL CONSONANT MARK..ZANABAZAR SQUARE SIGN ANUSVARA + (0x11A3B <= code && code <= 0x11A3E) || // Mn [4] ZANABAZAR SQUARE CLUSTER-FINAL LETTER YA..ZANABAZAR SQUARE CLUSTER-FINAL LETTER VA + 0x11A47 == code || // Mn ZANABAZAR SQUARE SUBJOINER + (0x11A51 <= code && code <= 0x11A56) || // Mn [6] SOYOMBO VOWEL SIGN I..SOYOMBO VOWEL SIGN OE + (0x11A59 <= code && code <= 0x11A5B) || // Mn [3] SOYOMBO VOWEL SIGN VOCALIC R..SOYOMBO VOWEL LENGTH MARK + (0x11A8A <= code && code <= 0x11A96) || // Mn [13] SOYOMBO FINAL CONSONANT SIGN G..SOYOMBO SIGN ANUSVARA + (0x11A98 <= code && code <= 0x11A99) || // Mn [2] SOYOMBO GEMINATION MARK..SOYOMBO SUBJOINER + (0x11C30 <= code && code <= 0x11C36) || // Mn [7] BHAIKSUKI VOWEL SIGN I..BHAIKSUKI VOWEL SIGN VOCALIC L + (0x11C38 <= code && code <= 0x11C3D) || // Mn [6] BHAIKSUKI VOWEL SIGN E..BHAIKSUKI SIGN ANUSVARA + 0x11C3F == code || // Mn BHAIKSUKI SIGN VIRAMA + (0x11C92 <= code && code <= 0x11CA7) || // Mn [22] MARCHEN SUBJOINED LETTER KA..MARCHEN SUBJOINED LETTER ZA + (0x11CAA <= code && code <= 0x11CB0) || // Mn [7] MARCHEN SUBJOINED LETTER RA..MARCHEN VOWEL SIGN AA + (0x11CB2 <= code && code <= 0x11CB3) || // Mn [2] MARCHEN VOWEL SIGN U..MARCHEN VOWEL SIGN E + (0x11CB5 <= code && code <= 0x11CB6) || // Mn [2] MARCHEN SIGN ANUSVARA..MARCHEN SIGN CANDRABINDU + (0x11D31 <= code && code <= 0x11D36) || // Mn [6] MASARAM GONDI VOWEL SIGN AA..MASARAM GONDI VOWEL SIGN VOCALIC R + 0x11D3A == code || // Mn MASARAM GONDI VOWEL SIGN E + (0x11D3C <= code && code <= 0x11D3D) || // Mn [2] MASARAM GONDI VOWEL SIGN AI..MASARAM GONDI VOWEL SIGN O + (0x11D3F <= code && code <= 0x11D45) || // Mn [7] MASARAM GONDI VOWEL SIGN AU..MASARAM GONDI VIRAMA + 0x11D47 == code || // Mn MASARAM GONDI RA-KARA + (0x16AF0 <= code && code <= 0x16AF4) || // Mn [5] BASSA VAH COMBINING HIGH TONE..BASSA VAH COMBINING HIGH-LOW TONE + (0x16B30 <= code && code <= 0x16B36) || // Mn [7] PAHAWH HMONG MARK CIM TUB..PAHAWH HMONG MARK CIM TAUM + (0x16F8F <= code && code <= 0x16F92) || // Mn [4] MIAO TONE RIGHT..MIAO TONE BELOW + (0x1BC9D <= code && code <= 0x1BC9E) || // Mn [2] DUPLOYAN THICK LETTER SELECTOR..DUPLOYAN DOUBLE MARK + 0x1D165 == code || // Mc MUSICAL SYMBOL COMBINING STEM + (0x1D167 <= code && code <= 0x1D169) || // Mn [3] MUSICAL SYMBOL COMBINING TREMOLO-1..MUSICAL SYMBOL COMBINING TREMOLO-3 + (0x1D16E <= code && code <= 0x1D172) || // Mc [5] MUSICAL SYMBOL COMBINING FLAG-1..MUSICAL SYMBOL COMBINING FLAG-5 + (0x1D17B <= code && code <= 0x1D182) || // Mn [8] MUSICAL SYMBOL COMBINING ACCENT..MUSICAL SYMBOL COMBINING LOURE + (0x1D185 <= code && code <= 0x1D18B) || // Mn [7] MUSICAL SYMBOL COMBINING DOIT..MUSICAL SYMBOL COMBINING TRIPLE TONGUE + (0x1D1AA <= code && code <= 0x1D1AD) || // Mn [4] MUSICAL SYMBOL COMBINING DOWN BOW..MUSICAL SYMBOL COMBINING SNAP PIZZICATO + (0x1D242 <= code && code <= 0x1D244) || // Mn [3] COMBINING GREEK MUSICAL TRISEME..COMBINING GREEK MUSICAL PENTASEME + (0x1DA00 <= code && code <= 0x1DA36) || // Mn [55] SIGNWRITING HEAD RIM..SIGNWRITING AIR SUCKING IN + (0x1DA3B <= code && code <= 0x1DA6C) || // Mn [50] SIGNWRITING MOUTH CLOSED NEUTRAL..SIGNWRITING EXCITEMENT + 0x1DA75 == code || // Mn SIGNWRITING UPPER BODY TILTING FROM HIP JOINTS + 0x1DA84 == code || // Mn SIGNWRITING LOCATION HEAD NECK + (0x1DA9B <= code && code <= 0x1DA9F) || // Mn [5] SIGNWRITING FILL MODIFIER-2..SIGNWRITING FILL MODIFIER-6 + (0x1DAA1 <= code && code <= 0x1DAAF) || // Mn [15] SIGNWRITING ROTATION MODIFIER-2..SIGNWRITING ROTATION MODIFIER-16 + (0x1E000 <= code && code <= 0x1E006) || // Mn [7] COMBINING GLAGOLITIC LETTER AZU..COMBINING GLAGOLITIC LETTER ZHIVETE + (0x1E008 <= code && code <= 0x1E018) || // Mn [17] COMBINING GLAGOLITIC LETTER ZEMLJA..COMBINING GLAGOLITIC LETTER HERU + (0x1E01B <= code && code <= 0x1E021) || // Mn [7] COMBINING GLAGOLITIC LETTER SHTA..COMBINING GLAGOLITIC LETTER YATI + (0x1E023 <= code && code <= 0x1E024) || // Mn [2] COMBINING GLAGOLITIC LETTER YU..COMBINING GLAGOLITIC LETTER SMALL YUS + (0x1E026 <= code && code <= 0x1E02A) || // Mn [5] COMBINING GLAGOLITIC LETTER YO..COMBINING GLAGOLITIC LETTER FITA + (0x1E8D0 <= code && code <= 0x1E8D6) || // Mn [7] MENDE KIKAKUI COMBINING NUMBER TEENS..MENDE KIKAKUI COMBINING NUMBER MILLIONS + (0x1E944 <= code && code <= 0x1E94A) || // Mn [7] ADLAM ALIF LENGTHENER..ADLAM NUKTA + (0xE0020 <= code && code <= 0xE007F) || // Cf [96] TAG SPACE..CANCEL TAG + (0xE0100 <= code && code <= 0xE01EF) // Mn [240] VARIATION SELECTOR-17..VARIATION SELECTOR-256 + ){ + return Extend; + } + + + if( + (0x1F1E6 <= code && code <= 0x1F1FF) // So [26] REGIONAL INDICATOR SYMBOL LETTER A..REGIONAL INDICATOR SYMBOL LETTER Z + ){ + return Regional_Indicator; + } + + if( + 0x0903 == code || // Mc DEVANAGARI SIGN VISARGA + 0x093B == code || // Mc DEVANAGARI VOWEL SIGN OOE + (0x093E <= code && code <= 0x0940) || // Mc [3] DEVANAGARI VOWEL SIGN AA..DEVANAGARI VOWEL SIGN II + (0x0949 <= code && code <= 0x094C) || // Mc [4] DEVANAGARI VOWEL SIGN CANDRA O..DEVANAGARI VOWEL SIGN AU + (0x094E <= code && code <= 0x094F) || // Mc [2] DEVANAGARI VOWEL SIGN PRISHTHAMATRA E..DEVANAGARI VOWEL SIGN AW + (0x0982 <= code && code <= 0x0983) || // Mc [2] BENGALI SIGN ANUSVARA..BENGALI SIGN VISARGA + (0x09BF <= code && code <= 0x09C0) || // Mc [2] BENGALI VOWEL SIGN I..BENGALI VOWEL SIGN II + (0x09C7 <= code && code <= 0x09C8) || // Mc [2] BENGALI VOWEL SIGN E..BENGALI VOWEL SIGN AI + (0x09CB <= code && code <= 0x09CC) || // Mc [2] BENGALI VOWEL SIGN O..BENGALI VOWEL SIGN AU + 0x0A03 == code || // Mc GURMUKHI SIGN VISARGA + (0x0A3E <= code && code <= 0x0A40) || // Mc [3] GURMUKHI VOWEL SIGN AA..GURMUKHI VOWEL SIGN II + 0x0A83 == code || // Mc GUJARATI SIGN VISARGA + (0x0ABE <= code && code <= 0x0AC0) || // Mc [3] GUJARATI VOWEL SIGN AA..GUJARATI VOWEL SIGN II + 0x0AC9 == code || // Mc GUJARATI VOWEL SIGN CANDRA O + (0x0ACB <= code && code <= 0x0ACC) || // Mc [2] GUJARATI VOWEL SIGN O..GUJARATI VOWEL SIGN AU + (0x0B02 <= code && code <= 0x0B03) || // Mc [2] ORIYA SIGN ANUSVARA..ORIYA SIGN VISARGA + 0x0B40 == code || // Mc ORIYA VOWEL SIGN II + (0x0B47 <= code && code <= 0x0B48) || // Mc [2] ORIYA VOWEL SIGN E..ORIYA VOWEL SIGN AI + (0x0B4B <= code && code <= 0x0B4C) || // Mc [2] ORIYA VOWEL SIGN O..ORIYA VOWEL SIGN AU + 0x0BBF == code || // Mc TAMIL VOWEL SIGN I + (0x0BC1 <= code && code <= 0x0BC2) || // Mc [2] TAMIL VOWEL SIGN U..TAMIL VOWEL SIGN UU + (0x0BC6 <= code && code <= 0x0BC8) || // Mc [3] TAMIL VOWEL SIGN E..TAMIL VOWEL SIGN AI + (0x0BCA <= code && code <= 0x0BCC) || // Mc [3] TAMIL VOWEL SIGN O..TAMIL VOWEL SIGN AU + (0x0C01 <= code && code <= 0x0C03) || // Mc [3] TELUGU SIGN CANDRABINDU..TELUGU SIGN VISARGA + (0x0C41 <= code && code <= 0x0C44) || // Mc [4] TELUGU VOWEL SIGN U..TELUGU VOWEL SIGN VOCALIC RR + (0x0C82 <= code && code <= 0x0C83) || // Mc [2] KANNADA SIGN ANUSVARA..KANNADA SIGN VISARGA + 0x0CBE == code || // Mc KANNADA VOWEL SIGN AA + (0x0CC0 <= code && code <= 0x0CC1) || // Mc [2] KANNADA VOWEL SIGN II..KANNADA VOWEL SIGN U + (0x0CC3 <= code && code <= 0x0CC4) || // Mc [2] KANNADA VOWEL SIGN VOCALIC R..KANNADA VOWEL SIGN VOCALIC RR + (0x0CC7 <= code && code <= 0x0CC8) || // Mc [2] KANNADA VOWEL SIGN EE..KANNADA VOWEL SIGN AI + (0x0CCA <= code && code <= 0x0CCB) || // Mc [2] KANNADA VOWEL SIGN O..KANNADA VOWEL SIGN OO + (0x0D02 <= code && code <= 0x0D03) || // Mc [2] MALAYALAM SIGN ANUSVARA..MALAYALAM SIGN VISARGA + (0x0D3F <= code && code <= 0x0D40) || // Mc [2] MALAYALAM VOWEL SIGN I..MALAYALAM VOWEL SIGN II + (0x0D46 <= code && code <= 0x0D48) || // Mc [3] MALAYALAM VOWEL SIGN E..MALAYALAM VOWEL SIGN AI + (0x0D4A <= code && code <= 0x0D4C) || // Mc [3] MALAYALAM VOWEL SIGN O..MALAYALAM VOWEL SIGN AU + (0x0D82 <= code && code <= 0x0D83) || // Mc [2] SINHALA SIGN ANUSVARAYA..SINHALA SIGN VISARGAYA + (0x0DD0 <= code && code <= 0x0DD1) || // Mc [2] SINHALA VOWEL SIGN KETTI AEDA-PILLA..SINHALA VOWEL SIGN DIGA AEDA-PILLA + (0x0DD8 <= code && code <= 0x0DDE) || // Mc [7] SINHALA VOWEL SIGN GAETTA-PILLA..SINHALA VOWEL SIGN KOMBUVA HAA GAYANUKITTA + (0x0DF2 <= code && code <= 0x0DF3) || // Mc [2] SINHALA VOWEL SIGN DIGA GAETTA-PILLA..SINHALA VOWEL SIGN DIGA GAYANUKITTA + 0x0E33 == code || // Lo THAI CHARACTER SARA AM + 0x0EB3 == code || // Lo LAO VOWEL SIGN AM + (0x0F3E <= code && code <= 0x0F3F) || // Mc [2] TIBETAN SIGN YAR TSHES..TIBETAN SIGN MAR TSHES + 0x0F7F == code || // Mc TIBETAN SIGN RNAM BCAD + 0x1031 == code || // Mc MYANMAR VOWEL SIGN E + (0x103B <= code && code <= 0x103C) || // Mc [2] MYANMAR CONSONANT SIGN MEDIAL YA..MYANMAR CONSONANT SIGN MEDIAL RA + (0x1056 <= code && code <= 0x1057) || // Mc [2] MYANMAR VOWEL SIGN VOCALIC R..MYANMAR VOWEL SIGN VOCALIC RR + 0x1084 == code || // Mc MYANMAR VOWEL SIGN SHAN E + 0x17B6 == code || // Mc KHMER VOWEL SIGN AA + (0x17BE <= code && code <= 0x17C5) || // Mc [8] KHMER VOWEL SIGN OE..KHMER VOWEL SIGN AU + (0x17C7 <= code && code <= 0x17C8) || // Mc [2] KHMER SIGN REAHMUK..KHMER SIGN YUUKALEAPINTU + (0x1923 <= code && code <= 0x1926) || // Mc [4] LIMBU VOWEL SIGN EE..LIMBU VOWEL SIGN AU + (0x1929 <= code && code <= 0x192B) || // Mc [3] LIMBU SUBJOINED LETTER YA..LIMBU SUBJOINED LETTER WA + (0x1930 <= code && code <= 0x1931) || // Mc [2] LIMBU SMALL LETTER KA..LIMBU SMALL LETTER NGA + (0x1933 <= code && code <= 0x1938) || // Mc [6] LIMBU SMALL LETTER TA..LIMBU SMALL LETTER LA + (0x1A19 <= code && code <= 0x1A1A) || // Mc [2] BUGINESE VOWEL SIGN E..BUGINESE VOWEL SIGN O + 0x1A55 == code || // Mc TAI THAM CONSONANT SIGN MEDIAL RA + 0x1A57 == code || // Mc TAI THAM CONSONANT SIGN LA TANG LAI + (0x1A6D <= code && code <= 0x1A72) || // Mc [6] TAI THAM VOWEL SIGN OY..TAI THAM VOWEL SIGN THAM AI + 0x1B04 == code || // Mc BALINESE SIGN BISAH + 0x1B35 == code || // Mc BALINESE VOWEL SIGN TEDUNG + 0x1B3B == code || // Mc BALINESE VOWEL SIGN RA REPA TEDUNG + (0x1B3D <= code && code <= 0x1B41) || // Mc [5] BALINESE VOWEL SIGN LA LENGA TEDUNG..BALINESE VOWEL SIGN TALING REPA TEDUNG + (0x1B43 <= code && code <= 0x1B44) || // Mc [2] BALINESE VOWEL SIGN PEPET TEDUNG..BALINESE ADEG ADEG + 0x1B82 == code || // Mc SUNDANESE SIGN PANGWISAD + 0x1BA1 == code || // Mc SUNDANESE CONSONANT SIGN PAMINGKAL + (0x1BA6 <= code && code <= 0x1BA7) || // Mc [2] SUNDANESE VOWEL SIGN PANAELAENG..SUNDANESE VOWEL SIGN PANOLONG + 0x1BAA == code || // Mc SUNDANESE SIGN PAMAAEH + 0x1BE7 == code || // Mc BATAK VOWEL SIGN E + (0x1BEA <= code && code <= 0x1BEC) || // Mc [3] BATAK VOWEL SIGN I..BATAK VOWEL SIGN O + 0x1BEE == code || // Mc BATAK VOWEL SIGN U + (0x1BF2 <= code && code <= 0x1BF3) || // Mc [2] BATAK PANGOLAT..BATAK PANONGONAN + (0x1C24 <= code && code <= 0x1C2B) || // Mc [8] LEPCHA SUBJOINED LETTER YA..LEPCHA VOWEL SIGN UU + (0x1C34 <= code && code <= 0x1C35) || // Mc [2] LEPCHA CONSONANT SIGN NYIN-DO..LEPCHA CONSONANT SIGN KANG + 0x1CE1 == code || // Mc VEDIC TONE ATHARVAVEDIC INDEPENDENT SVARITA + (0x1CF2 <= code && code <= 0x1CF3) || // Mc [2] VEDIC SIGN ARDHAVISARGA..VEDIC SIGN ROTATED ARDHAVISARGA + 0x1CF7 == code || // Mc VEDIC SIGN ATIKRAMA + (0xA823 <= code && code <= 0xA824) || // Mc [2] SYLOTI NAGRI VOWEL SIGN A..SYLOTI NAGRI VOWEL SIGN I + 0xA827 == code || // Mc SYLOTI NAGRI VOWEL SIGN OO + (0xA880 <= code && code <= 0xA881) || // Mc [2] SAURASHTRA SIGN ANUSVARA..SAURASHTRA SIGN VISARGA + (0xA8B4 <= code && code <= 0xA8C3) || // Mc [16] SAURASHTRA CONSONANT SIGN HAARU..SAURASHTRA VOWEL SIGN AU + (0xA952 <= code && code <= 0xA953) || // Mc [2] REJANG CONSONANT SIGN H..REJANG VIRAMA + 0xA983 == code || // Mc JAVANESE SIGN WIGNYAN + (0xA9B4 <= code && code <= 0xA9B5) || // Mc [2] JAVANESE VOWEL SIGN TARUNG..JAVANESE VOWEL SIGN TOLONG + (0xA9BA <= code && code <= 0xA9BB) || // Mc [2] JAVANESE VOWEL SIGN TALING..JAVANESE VOWEL SIGN DIRGA MURE + (0xA9BD <= code && code <= 0xA9C0) || // Mc [4] JAVANESE CONSONANT SIGN KERET..JAVANESE PANGKON + (0xAA2F <= code && code <= 0xAA30) || // Mc [2] CHAM VOWEL SIGN O..CHAM VOWEL SIGN AI + (0xAA33 <= code && code <= 0xAA34) || // Mc [2] CHAM CONSONANT SIGN YA..CHAM CONSONANT SIGN RA + 0xAA4D == code || // Mc CHAM CONSONANT SIGN FINAL H + 0xAAEB == code || // Mc MEETEI MAYEK VOWEL SIGN II + (0xAAEE <= code && code <= 0xAAEF) || // Mc [2] MEETEI MAYEK VOWEL SIGN AU..MEETEI MAYEK VOWEL SIGN AAU + 0xAAF5 == code || // Mc MEETEI MAYEK VOWEL SIGN VISARGA + (0xABE3 <= code && code <= 0xABE4) || // Mc [2] MEETEI MAYEK VOWEL SIGN ONAP..MEETEI MAYEK VOWEL SIGN INAP + (0xABE6 <= code && code <= 0xABE7) || // Mc [2] MEETEI MAYEK VOWEL SIGN YENAP..MEETEI MAYEK VOWEL SIGN SOUNAP + (0xABE9 <= code && code <= 0xABEA) || // Mc [2] MEETEI MAYEK VOWEL SIGN CHEINAP..MEETEI MAYEK VOWEL SIGN NUNG + 0xABEC == code || // Mc MEETEI MAYEK LUM IYEK + 0x11000 == code || // Mc BRAHMI SIGN CANDRABINDU + 0x11002 == code || // Mc BRAHMI SIGN VISARGA + 0x11082 == code || // Mc KAITHI SIGN VISARGA + (0x110B0 <= code && code <= 0x110B2) || // Mc [3] KAITHI VOWEL SIGN AA..KAITHI VOWEL SIGN II + (0x110B7 <= code && code <= 0x110B8) || // Mc [2] KAITHI VOWEL SIGN O..KAITHI VOWEL SIGN AU + 0x1112C == code || // Mc CHAKMA VOWEL SIGN E + 0x11182 == code || // Mc SHARADA SIGN VISARGA + (0x111B3 <= code && code <= 0x111B5) || // Mc [3] SHARADA VOWEL SIGN AA..SHARADA VOWEL SIGN II + (0x111BF <= code && code <= 0x111C0) || // Mc [2] SHARADA VOWEL SIGN AU..SHARADA SIGN VIRAMA + (0x1122C <= code && code <= 0x1122E) || // Mc [3] KHOJKI VOWEL SIGN AA..KHOJKI VOWEL SIGN II + (0x11232 <= code && code <= 0x11233) || // Mc [2] KHOJKI VOWEL SIGN O..KHOJKI VOWEL SIGN AU + 0x11235 == code || // Mc KHOJKI SIGN VIRAMA + (0x112E0 <= code && code <= 0x112E2) || // Mc [3] KHUDAWADI VOWEL SIGN AA..KHUDAWADI VOWEL SIGN II + (0x11302 <= code && code <= 0x11303) || // Mc [2] GRANTHA SIGN ANUSVARA..GRANTHA SIGN VISARGA + 0x1133F == code || // Mc GRANTHA VOWEL SIGN I + (0x11341 <= code && code <= 0x11344) || // Mc [4] GRANTHA VOWEL SIGN U..GRANTHA VOWEL SIGN VOCALIC RR + (0x11347 <= code && code <= 0x11348) || // Mc [2] GRANTHA VOWEL SIGN EE..GRANTHA VOWEL SIGN AI + (0x1134B <= code && code <= 0x1134D) || // Mc [3] GRANTHA VOWEL SIGN OO..GRANTHA SIGN VIRAMA + (0x11362 <= code && code <= 0x11363) || // Mc [2] GRANTHA VOWEL SIGN VOCALIC L..GRANTHA VOWEL SIGN VOCALIC LL + (0x11435 <= code && code <= 0x11437) || // Mc [3] NEWA VOWEL SIGN AA..NEWA VOWEL SIGN II + (0x11440 <= code && code <= 0x11441) || // Mc [2] NEWA VOWEL SIGN O..NEWA VOWEL SIGN AU + 0x11445 == code || // Mc NEWA SIGN VISARGA + (0x114B1 <= code && code <= 0x114B2) || // Mc [2] TIRHUTA VOWEL SIGN I..TIRHUTA VOWEL SIGN II + 0x114B9 == code || // Mc TIRHUTA VOWEL SIGN E + (0x114BB <= code && code <= 0x114BC) || // Mc [2] TIRHUTA VOWEL SIGN AI..TIRHUTA VOWEL SIGN O + 0x114BE == code || // Mc TIRHUTA VOWEL SIGN AU + 0x114C1 == code || // Mc TIRHUTA SIGN VISARGA + (0x115B0 <= code && code <= 0x115B1) || // Mc [2] SIDDHAM VOWEL SIGN I..SIDDHAM VOWEL SIGN II + (0x115B8 <= code && code <= 0x115BB) || // Mc [4] SIDDHAM VOWEL SIGN E..SIDDHAM VOWEL SIGN AU + 0x115BE == code || // Mc SIDDHAM SIGN VISARGA + (0x11630 <= code && code <= 0x11632) || // Mc [3] MODI VOWEL SIGN AA..MODI VOWEL SIGN II + (0x1163B <= code && code <= 0x1163C) || // Mc [2] MODI VOWEL SIGN O..MODI VOWEL SIGN AU + 0x1163E == code || // Mc MODI SIGN VISARGA + 0x116AC == code || // Mc TAKRI SIGN VISARGA + (0x116AE <= code && code <= 0x116AF) || // Mc [2] TAKRI VOWEL SIGN I..TAKRI VOWEL SIGN II + 0x116B6 == code || // Mc TAKRI SIGN VIRAMA + (0x11720 <= code && code <= 0x11721) || // Mc [2] AHOM VOWEL SIGN A..AHOM VOWEL SIGN AA + 0x11726 == code || // Mc AHOM VOWEL SIGN E + (0x11A07 <= code && code <= 0x11A08) || // Mc [2] ZANABAZAR SQUARE VOWEL SIGN AI..ZANABAZAR SQUARE VOWEL SIGN AU + 0x11A39 == code || // Mc ZANABAZAR SQUARE SIGN VISARGA + (0x11A57 <= code && code <= 0x11A58) || // Mc [2] SOYOMBO VOWEL SIGN AI..SOYOMBO VOWEL SIGN AU + 0x11A97 == code || // Mc SOYOMBO SIGN VISARGA + 0x11C2F == code || // Mc BHAIKSUKI VOWEL SIGN AA + 0x11C3E == code || // Mc BHAIKSUKI SIGN VISARGA + 0x11CA9 == code || // Mc MARCHEN SUBJOINED LETTER YA + 0x11CB1 == code || // Mc MARCHEN VOWEL SIGN I + 0x11CB4 == code || // Mc MARCHEN VOWEL SIGN O + (0x16F51 <= code && code <= 0x16F7E) || // Mc [46] MIAO SIGN ASPIRATION..MIAO VOWEL SIGN NG + 0x1D166 == code || // Mc MUSICAL SYMBOL COMBINING SPRECHGESANG STEM + 0x1D16D == code // Mc MUSICAL SYMBOL COMBINING AUGMENTATION DOT + ){ + return SpacingMark; + } + + + if( + (0x1100 <= code && code <= 0x115F) || // Lo [96] HANGUL CHOSEONG KIYEOK..HANGUL CHOSEONG FILLER + (0xA960 <= code && code <= 0xA97C) // Lo [29] HANGUL CHOSEONG TIKEUT-MIEUM..HANGUL CHOSEONG SSANGYEORINHIEUH + ){ + return L; + } + + if( + (0x1160 <= code && code <= 0x11A7) || // Lo [72] HANGUL JUNGSEONG FILLER..HANGUL JUNGSEONG O-YAE + (0xD7B0 <= code && code <= 0xD7C6) // Lo [23] HANGUL JUNGSEONG O-YEO..HANGUL JUNGSEONG ARAEA-E + ){ + return V; + } + + + if( + (0x11A8 <= code && code <= 0x11FF) || // Lo [88] HANGUL JONGSEONG KIYEOK..HANGUL JONGSEONG SSANGNIEUN + (0xD7CB <= code && code <= 0xD7FB) // Lo [49] HANGUL JONGSEONG NIEUN-RIEUL..HANGUL JONGSEONG PHIEUPH-THIEUTH + ){ + return T; + } + + if( + 0xAC00 == code || // Lo HANGUL SYLLABLE GA + 0xAC1C == code || // Lo HANGUL SYLLABLE GAE + 0xAC38 == code || // Lo HANGUL SYLLABLE GYA + 0xAC54 == code || // Lo HANGUL SYLLABLE GYAE + 0xAC70 == code || // Lo HANGUL SYLLABLE GEO + 0xAC8C == code || // Lo HANGUL SYLLABLE GE + 0xACA8 == code || // Lo HANGUL SYLLABLE GYEO + 0xACC4 == code || // Lo HANGUL SYLLABLE GYE + 0xACE0 == code || // Lo HANGUL SYLLABLE GO + 0xACFC == code || // Lo HANGUL SYLLABLE GWA + 0xAD18 == code || // Lo HANGUL SYLLABLE GWAE + 0xAD34 == code || // Lo HANGUL SYLLABLE GOE + 0xAD50 == code || // Lo HANGUL SYLLABLE GYO + 0xAD6C == code || // Lo HANGUL SYLLABLE GU + 0xAD88 == code || // Lo HANGUL SYLLABLE GWEO + 0xADA4 == code || // Lo HANGUL SYLLABLE GWE + 0xADC0 == code || // Lo HANGUL SYLLABLE GWI + 0xADDC == code || // Lo HANGUL SYLLABLE GYU + 0xADF8 == code || // Lo HANGUL SYLLABLE GEU + 0xAE14 == code || // Lo HANGUL SYLLABLE GYI + 0xAE30 == code || // Lo HANGUL SYLLABLE GI + 0xAE4C == code || // Lo HANGUL SYLLABLE GGA + 0xAE68 == code || // Lo HANGUL SYLLABLE GGAE + 0xAE84 == code || // Lo HANGUL SYLLABLE GGYA + 0xAEA0 == code || // Lo HANGUL SYLLABLE GGYAE + 0xAEBC == code || // Lo HANGUL SYLLABLE GGEO + 0xAED8 == code || // Lo HANGUL SYLLABLE GGE + 0xAEF4 == code || // Lo HANGUL SYLLABLE GGYEO + 0xAF10 == code || // Lo HANGUL SYLLABLE GGYE + 0xAF2C == code || // Lo HANGUL SYLLABLE GGO + 0xAF48 == code || // Lo HANGUL SYLLABLE GGWA + 0xAF64 == code || // Lo HANGUL SYLLABLE GGWAE + 0xAF80 == code || // Lo HANGUL SYLLABLE GGOE + 0xAF9C == code || // Lo HANGUL SYLLABLE GGYO + 0xAFB8 == code || // Lo HANGUL SYLLABLE GGU + 0xAFD4 == code || // Lo HANGUL SYLLABLE GGWEO + 0xAFF0 == code || // Lo HANGUL SYLLABLE GGWE + 0xB00C == code || // Lo HANGUL SYLLABLE GGWI + 0xB028 == code || // Lo HANGUL SYLLABLE GGYU + 0xB044 == code || // Lo HANGUL SYLLABLE GGEU + 0xB060 == code || // Lo HANGUL SYLLABLE GGYI + 0xB07C == code || // Lo HANGUL SYLLABLE GGI + 0xB098 == code || // Lo HANGUL SYLLABLE NA + 0xB0B4 == code || // Lo HANGUL SYLLABLE NAE + 0xB0D0 == code || // Lo HANGUL SYLLABLE NYA + 0xB0EC == code || // Lo HANGUL SYLLABLE NYAE + 0xB108 == code || // Lo HANGUL SYLLABLE NEO + 0xB124 == code || // Lo HANGUL SYLLABLE NE + 0xB140 == code || // Lo HANGUL SYLLABLE NYEO + 0xB15C == code || // Lo HANGUL SYLLABLE NYE + 0xB178 == code || // Lo HANGUL SYLLABLE NO + 0xB194 == code || // Lo HANGUL SYLLABLE NWA + 0xB1B0 == code || // Lo HANGUL SYLLABLE NWAE + 0xB1CC == code || // Lo HANGUL SYLLABLE NOE + 0xB1E8 == code || // Lo HANGUL SYLLABLE NYO + 0xB204 == code || // Lo HANGUL SYLLABLE NU + 0xB220 == code || // Lo HANGUL SYLLABLE NWEO + 0xB23C == code || // Lo HANGUL SYLLABLE NWE + 0xB258 == code || // Lo HANGUL SYLLABLE NWI + 0xB274 == code || // Lo HANGUL SYLLABLE NYU + 0xB290 == code || // Lo HANGUL SYLLABLE NEU + 0xB2AC == code || // Lo HANGUL SYLLABLE NYI + 0xB2C8 == code || // Lo HANGUL SYLLABLE NI + 0xB2E4 == code || // Lo HANGUL SYLLABLE DA + 0xB300 == code || // Lo HANGUL SYLLABLE DAE + 0xB31C == code || // Lo HANGUL SYLLABLE DYA + 0xB338 == code || // Lo HANGUL SYLLABLE DYAE + 0xB354 == code || // Lo HANGUL SYLLABLE DEO + 0xB370 == code || // Lo HANGUL SYLLABLE DE + 0xB38C == code || // Lo HANGUL SYLLABLE DYEO + 0xB3A8 == code || // Lo HANGUL SYLLABLE DYE + 0xB3C4 == code || // Lo HANGUL SYLLABLE DO + 0xB3E0 == code || // Lo HANGUL SYLLABLE DWA + 0xB3FC == code || // Lo HANGUL SYLLABLE DWAE + 0xB418 == code || // Lo HANGUL SYLLABLE DOE + 0xB434 == code || // Lo HANGUL SYLLABLE DYO + 0xB450 == code || // Lo HANGUL SYLLABLE DU + 0xB46C == code || // Lo HANGUL SYLLABLE DWEO + 0xB488 == code || // Lo HANGUL SYLLABLE DWE + 0xB4A4 == code || // Lo HANGUL SYLLABLE DWI + 0xB4C0 == code || // Lo HANGUL SYLLABLE DYU + 0xB4DC == code || // Lo HANGUL SYLLABLE DEU + 0xB4F8 == code || // Lo HANGUL SYLLABLE DYI + 0xB514 == code || // Lo HANGUL SYLLABLE DI + 0xB530 == code || // Lo HANGUL SYLLABLE DDA + 0xB54C == code || // Lo HANGUL SYLLABLE DDAE + 0xB568 == code || // Lo HANGUL SYLLABLE DDYA + 0xB584 == code || // Lo HANGUL SYLLABLE DDYAE + 0xB5A0 == code || // Lo HANGUL SYLLABLE DDEO + 0xB5BC == code || // Lo HANGUL SYLLABLE DDE + 0xB5D8 == code || // Lo HANGUL SYLLABLE DDYEO + 0xB5F4 == code || // Lo HANGUL SYLLABLE DDYE + 0xB610 == code || // Lo HANGUL SYLLABLE DDO + 0xB62C == code || // Lo HANGUL SYLLABLE DDWA + 0xB648 == code || // Lo HANGUL SYLLABLE DDWAE + 0xB664 == code || // Lo HANGUL SYLLABLE DDOE + 0xB680 == code || // Lo HANGUL SYLLABLE DDYO + 0xB69C == code || // Lo HANGUL SYLLABLE DDU + 0xB6B8 == code || // Lo HANGUL SYLLABLE DDWEO + 0xB6D4 == code || // Lo HANGUL SYLLABLE DDWE + 0xB6F0 == code || // Lo HANGUL SYLLABLE DDWI + 0xB70C == code || // Lo HANGUL SYLLABLE DDYU + 0xB728 == code || // Lo HANGUL SYLLABLE DDEU + 0xB744 == code || // Lo HANGUL SYLLABLE DDYI + 0xB760 == code || // Lo HANGUL SYLLABLE DDI + 0xB77C == code || // Lo HANGUL SYLLABLE RA + 0xB798 == code || // Lo HANGUL SYLLABLE RAE + 0xB7B4 == code || // Lo HANGUL SYLLABLE RYA + 0xB7D0 == code || // Lo HANGUL SYLLABLE RYAE + 0xB7EC == code || // Lo HANGUL SYLLABLE REO + 0xB808 == code || // Lo HANGUL SYLLABLE RE + 0xB824 == code || // Lo HANGUL SYLLABLE RYEO + 0xB840 == code || // Lo HANGUL SYLLABLE RYE + 0xB85C == code || // Lo HANGUL SYLLABLE RO + 0xB878 == code || // Lo HANGUL SYLLABLE RWA + 0xB894 == code || // Lo HANGUL SYLLABLE RWAE + 0xB8B0 == code || // Lo HANGUL SYLLABLE ROE + 0xB8CC == code || // Lo HANGUL SYLLABLE RYO + 0xB8E8 == code || // Lo HANGUL SYLLABLE RU + 0xB904 == code || // Lo HANGUL SYLLABLE RWEO + 0xB920 == code || // Lo HANGUL SYLLABLE RWE + 0xB93C == code || // Lo HANGUL SYLLABLE RWI + 0xB958 == code || // Lo HANGUL SYLLABLE RYU + 0xB974 == code || // Lo HANGUL SYLLABLE REU + 0xB990 == code || // Lo HANGUL SYLLABLE RYI + 0xB9AC == code || // Lo HANGUL SYLLABLE RI + 0xB9C8 == code || // Lo HANGUL SYLLABLE MA + 0xB9E4 == code || // Lo HANGUL SYLLABLE MAE + 0xBA00 == code || // Lo HANGUL SYLLABLE MYA + 0xBA1C == code || // Lo HANGUL SYLLABLE MYAE + 0xBA38 == code || // Lo HANGUL SYLLABLE MEO + 0xBA54 == code || // Lo HANGUL SYLLABLE ME + 0xBA70 == code || // Lo HANGUL SYLLABLE MYEO + 0xBA8C == code || // Lo HANGUL SYLLABLE MYE + 0xBAA8 == code || // Lo HANGUL SYLLABLE MO + 0xBAC4 == code || // Lo HANGUL SYLLABLE MWA + 0xBAE0 == code || // Lo HANGUL SYLLABLE MWAE + 0xBAFC == code || // Lo HANGUL SYLLABLE MOE + 0xBB18 == code || // Lo HANGUL SYLLABLE MYO + 0xBB34 == code || // Lo HANGUL SYLLABLE MU + 0xBB50 == code || // Lo HANGUL SYLLABLE MWEO + 0xBB6C == code || // Lo HANGUL SYLLABLE MWE + 0xBB88 == code || // Lo HANGUL SYLLABLE MWI + 0xBBA4 == code || // Lo HANGUL SYLLABLE MYU + 0xBBC0 == code || // Lo HANGUL SYLLABLE MEU + 0xBBDC == code || // Lo HANGUL SYLLABLE MYI + 0xBBF8 == code || // Lo HANGUL SYLLABLE MI + 0xBC14 == code || // Lo HANGUL SYLLABLE BA + 0xBC30 == code || // Lo HANGUL SYLLABLE BAE + 0xBC4C == code || // Lo HANGUL SYLLABLE BYA + 0xBC68 == code || // Lo HANGUL SYLLABLE BYAE + 0xBC84 == code || // Lo HANGUL SYLLABLE BEO + 0xBCA0 == code || // Lo HANGUL SYLLABLE BE + 0xBCBC == code || // Lo HANGUL SYLLABLE BYEO + 0xBCD8 == code || // Lo HANGUL SYLLABLE BYE + 0xBCF4 == code || // Lo HANGUL SYLLABLE BO + 0xBD10 == code || // Lo HANGUL SYLLABLE BWA + 0xBD2C == code || // Lo HANGUL SYLLABLE BWAE + 0xBD48 == code || // Lo HANGUL SYLLABLE BOE + 0xBD64 == code || // Lo HANGUL SYLLABLE BYO + 0xBD80 == code || // Lo HANGUL SYLLABLE BU + 0xBD9C == code || // Lo HANGUL SYLLABLE BWEO + 0xBDB8 == code || // Lo HANGUL SYLLABLE BWE + 0xBDD4 == code || // Lo HANGUL SYLLABLE BWI + 0xBDF0 == code || // Lo HANGUL SYLLABLE BYU + 0xBE0C == code || // Lo HANGUL SYLLABLE BEU + 0xBE28 == code || // Lo HANGUL SYLLABLE BYI + 0xBE44 == code || // Lo HANGUL SYLLABLE BI + 0xBE60 == code || // Lo HANGUL SYLLABLE BBA + 0xBE7C == code || // Lo HANGUL SYLLABLE BBAE + 0xBE98 == code || // Lo HANGUL SYLLABLE BBYA + 0xBEB4 == code || // Lo HANGUL SYLLABLE BBYAE + 0xBED0 == code || // Lo HANGUL SYLLABLE BBEO + 0xBEEC == code || // Lo HANGUL SYLLABLE BBE + 0xBF08 == code || // Lo HANGUL SYLLABLE BBYEO + 0xBF24 == code || // Lo HANGUL SYLLABLE BBYE + 0xBF40 == code || // Lo HANGUL SYLLABLE BBO + 0xBF5C == code || // Lo HANGUL SYLLABLE BBWA + 0xBF78 == code || // Lo HANGUL SYLLABLE BBWAE + 0xBF94 == code || // Lo HANGUL SYLLABLE BBOE + 0xBFB0 == code || // Lo HANGUL SYLLABLE BBYO + 0xBFCC == code || // Lo HANGUL SYLLABLE BBU + 0xBFE8 == code || // Lo HANGUL SYLLABLE BBWEO + 0xC004 == code || // Lo HANGUL SYLLABLE BBWE + 0xC020 == code || // Lo HANGUL SYLLABLE BBWI + 0xC03C == code || // Lo HANGUL SYLLABLE BBYU + 0xC058 == code || // Lo HANGUL SYLLABLE BBEU + 0xC074 == code || // Lo HANGUL SYLLABLE BBYI + 0xC090 == code || // Lo HANGUL SYLLABLE BBI + 0xC0AC == code || // Lo HANGUL SYLLABLE SA + 0xC0C8 == code || // Lo HANGUL SYLLABLE SAE + 0xC0E4 == code || // Lo HANGUL SYLLABLE SYA + 0xC100 == code || // Lo HANGUL SYLLABLE SYAE + 0xC11C == code || // Lo HANGUL SYLLABLE SEO + 0xC138 == code || // Lo HANGUL SYLLABLE SE + 0xC154 == code || // Lo HANGUL SYLLABLE SYEO + 0xC170 == code || // Lo HANGUL SYLLABLE SYE + 0xC18C == code || // Lo HANGUL SYLLABLE SO + 0xC1A8 == code || // Lo HANGUL SYLLABLE SWA + 0xC1C4 == code || // Lo HANGUL SYLLABLE SWAE + 0xC1E0 == code || // Lo HANGUL SYLLABLE SOE + 0xC1FC == code || // Lo HANGUL SYLLABLE SYO + 0xC218 == code || // Lo HANGUL SYLLABLE SU + 0xC234 == code || // Lo HANGUL SYLLABLE SWEO + 0xC250 == code || // Lo HANGUL SYLLABLE SWE + 0xC26C == code || // Lo HANGUL SYLLABLE SWI + 0xC288 == code || // Lo HANGUL SYLLABLE SYU + 0xC2A4 == code || // Lo HANGUL SYLLABLE SEU + 0xC2C0 == code || // Lo HANGUL SYLLABLE SYI + 0xC2DC == code || // Lo HANGUL SYLLABLE SI + 0xC2F8 == code || // Lo HANGUL SYLLABLE SSA + 0xC314 == code || // Lo HANGUL SYLLABLE SSAE + 0xC330 == code || // Lo HANGUL SYLLABLE SSYA + 0xC34C == code || // Lo HANGUL SYLLABLE SSYAE + 0xC368 == code || // Lo HANGUL SYLLABLE SSEO + 0xC384 == code || // Lo HANGUL SYLLABLE SSE + 0xC3A0 == code || // Lo HANGUL SYLLABLE SSYEO + 0xC3BC == code || // Lo HANGUL SYLLABLE SSYE + 0xC3D8 == code || // Lo HANGUL SYLLABLE SSO + 0xC3F4 == code || // Lo HANGUL SYLLABLE SSWA + 0xC410 == code || // Lo HANGUL SYLLABLE SSWAE + 0xC42C == code || // Lo HANGUL SYLLABLE SSOE + 0xC448 == code || // Lo HANGUL SYLLABLE SSYO + 0xC464 == code || // Lo HANGUL SYLLABLE SSU + 0xC480 == code || // Lo HANGUL SYLLABLE SSWEO + 0xC49C == code || // Lo HANGUL SYLLABLE SSWE + 0xC4B8 == code || // Lo HANGUL SYLLABLE SSWI + 0xC4D4 == code || // Lo HANGUL SYLLABLE SSYU + 0xC4F0 == code || // Lo HANGUL SYLLABLE SSEU + 0xC50C == code || // Lo HANGUL SYLLABLE SSYI + 0xC528 == code || // Lo HANGUL SYLLABLE SSI + 0xC544 == code || // Lo HANGUL SYLLABLE A + 0xC560 == code || // Lo HANGUL SYLLABLE AE + 0xC57C == code || // Lo HANGUL SYLLABLE YA + 0xC598 == code || // Lo HANGUL SYLLABLE YAE + 0xC5B4 == code || // Lo HANGUL SYLLABLE EO + 0xC5D0 == code || // Lo HANGUL SYLLABLE E + 0xC5EC == code || // Lo HANGUL SYLLABLE YEO + 0xC608 == code || // Lo HANGUL SYLLABLE YE + 0xC624 == code || // Lo HANGUL SYLLABLE O + 0xC640 == code || // Lo HANGUL SYLLABLE WA + 0xC65C == code || // Lo HANGUL SYLLABLE WAE + 0xC678 == code || // Lo HANGUL SYLLABLE OE + 0xC694 == code || // Lo HANGUL SYLLABLE YO + 0xC6B0 == code || // Lo HANGUL SYLLABLE U + 0xC6CC == code || // Lo HANGUL SYLLABLE WEO + 0xC6E8 == code || // Lo HANGUL SYLLABLE WE + 0xC704 == code || // Lo HANGUL SYLLABLE WI + 0xC720 == code || // Lo HANGUL SYLLABLE YU + 0xC73C == code || // Lo HANGUL SYLLABLE EU + 0xC758 == code || // Lo HANGUL SYLLABLE YI + 0xC774 == code || // Lo HANGUL SYLLABLE I + 0xC790 == code || // Lo HANGUL SYLLABLE JA + 0xC7AC == code || // Lo HANGUL SYLLABLE JAE + 0xC7C8 == code || // Lo HANGUL SYLLABLE JYA + 0xC7E4 == code || // Lo HANGUL SYLLABLE JYAE + 0xC800 == code || // Lo HANGUL SYLLABLE JEO + 0xC81C == code || // Lo HANGUL SYLLABLE JE + 0xC838 == code || // Lo HANGUL SYLLABLE JYEO + 0xC854 == code || // Lo HANGUL SYLLABLE JYE + 0xC870 == code || // Lo HANGUL SYLLABLE JO + 0xC88C == code || // Lo HANGUL SYLLABLE JWA + 0xC8A8 == code || // Lo HANGUL SYLLABLE JWAE + 0xC8C4 == code || // Lo HANGUL SYLLABLE JOE + 0xC8E0 == code || // Lo HANGUL SYLLABLE JYO + 0xC8FC == code || // Lo HANGUL SYLLABLE JU + 0xC918 == code || // Lo HANGUL SYLLABLE JWEO + 0xC934 == code || // Lo HANGUL SYLLABLE JWE + 0xC950 == code || // Lo HANGUL SYLLABLE JWI + 0xC96C == code || // Lo HANGUL SYLLABLE JYU + 0xC988 == code || // Lo HANGUL SYLLABLE JEU + 0xC9A4 == code || // Lo HANGUL SYLLABLE JYI + 0xC9C0 == code || // Lo HANGUL SYLLABLE JI + 0xC9DC == code || // Lo HANGUL SYLLABLE JJA + 0xC9F8 == code || // Lo HANGUL SYLLABLE JJAE + 0xCA14 == code || // Lo HANGUL SYLLABLE JJYA + 0xCA30 == code || // Lo HANGUL SYLLABLE JJYAE + 0xCA4C == code || // Lo HANGUL SYLLABLE JJEO + 0xCA68 == code || // Lo HANGUL SYLLABLE JJE + 0xCA84 == code || // Lo HANGUL SYLLABLE JJYEO + 0xCAA0 == code || // Lo HANGUL SYLLABLE JJYE + 0xCABC == code || // Lo HANGUL SYLLABLE JJO + 0xCAD8 == code || // Lo HANGUL SYLLABLE JJWA + 0xCAF4 == code || // Lo HANGUL SYLLABLE JJWAE + 0xCB10 == code || // Lo HANGUL SYLLABLE JJOE + 0xCB2C == code || // Lo HANGUL SYLLABLE JJYO + 0xCB48 == code || // Lo HANGUL SYLLABLE JJU + 0xCB64 == code || // Lo HANGUL SYLLABLE JJWEO + 0xCB80 == code || // Lo HANGUL SYLLABLE JJWE + 0xCB9C == code || // Lo HANGUL SYLLABLE JJWI + 0xCBB8 == code || // Lo HANGUL SYLLABLE JJYU + 0xCBD4 == code || // Lo HANGUL SYLLABLE JJEU + 0xCBF0 == code || // Lo HANGUL SYLLABLE JJYI + 0xCC0C == code || // Lo HANGUL SYLLABLE JJI + 0xCC28 == code || // Lo HANGUL SYLLABLE CA + 0xCC44 == code || // Lo HANGUL SYLLABLE CAE + 0xCC60 == code || // Lo HANGUL SYLLABLE CYA + 0xCC7C == code || // Lo HANGUL SYLLABLE CYAE + 0xCC98 == code || // Lo HANGUL SYLLABLE CEO + 0xCCB4 == code || // Lo HANGUL SYLLABLE CE + 0xCCD0 == code || // Lo HANGUL SYLLABLE CYEO + 0xCCEC == code || // Lo HANGUL SYLLABLE CYE + 0xCD08 == code || // Lo HANGUL SYLLABLE CO + 0xCD24 == code || // Lo HANGUL SYLLABLE CWA + 0xCD40 == code || // Lo HANGUL SYLLABLE CWAE + 0xCD5C == code || // Lo HANGUL SYLLABLE COE + 0xCD78 == code || // Lo HANGUL SYLLABLE CYO + 0xCD94 == code || // Lo HANGUL SYLLABLE CU + 0xCDB0 == code || // Lo HANGUL SYLLABLE CWEO + 0xCDCC == code || // Lo HANGUL SYLLABLE CWE + 0xCDE8 == code || // Lo HANGUL SYLLABLE CWI + 0xCE04 == code || // Lo HANGUL SYLLABLE CYU + 0xCE20 == code || // Lo HANGUL SYLLABLE CEU + 0xCE3C == code || // Lo HANGUL SYLLABLE CYI + 0xCE58 == code || // Lo HANGUL SYLLABLE CI + 0xCE74 == code || // Lo HANGUL SYLLABLE KA + 0xCE90 == code || // Lo HANGUL SYLLABLE KAE + 0xCEAC == code || // Lo HANGUL SYLLABLE KYA + 0xCEC8 == code || // Lo HANGUL SYLLABLE KYAE + 0xCEE4 == code || // Lo HANGUL SYLLABLE KEO + 0xCF00 == code || // Lo HANGUL SYLLABLE KE + 0xCF1C == code || // Lo HANGUL SYLLABLE KYEO + 0xCF38 == code || // Lo HANGUL SYLLABLE KYE + 0xCF54 == code || // Lo HANGUL SYLLABLE KO + 0xCF70 == code || // Lo HANGUL SYLLABLE KWA + 0xCF8C == code || // Lo HANGUL SYLLABLE KWAE + 0xCFA8 == code || // Lo HANGUL SYLLABLE KOE + 0xCFC4 == code || // Lo HANGUL SYLLABLE KYO + 0xCFE0 == code || // Lo HANGUL SYLLABLE KU + 0xCFFC == code || // Lo HANGUL SYLLABLE KWEO + 0xD018 == code || // Lo HANGUL SYLLABLE KWE + 0xD034 == code || // Lo HANGUL SYLLABLE KWI + 0xD050 == code || // Lo HANGUL SYLLABLE KYU + 0xD06C == code || // Lo HANGUL SYLLABLE KEU + 0xD088 == code || // Lo HANGUL SYLLABLE KYI + 0xD0A4 == code || // Lo HANGUL SYLLABLE KI + 0xD0C0 == code || // Lo HANGUL SYLLABLE TA + 0xD0DC == code || // Lo HANGUL SYLLABLE TAE + 0xD0F8 == code || // Lo HANGUL SYLLABLE TYA + 0xD114 == code || // Lo HANGUL SYLLABLE TYAE + 0xD130 == code || // Lo HANGUL SYLLABLE TEO + 0xD14C == code || // Lo HANGUL SYLLABLE TE + 0xD168 == code || // Lo HANGUL SYLLABLE TYEO + 0xD184 == code || // Lo HANGUL SYLLABLE TYE + 0xD1A0 == code || // Lo HANGUL SYLLABLE TO + 0xD1BC == code || // Lo HANGUL SYLLABLE TWA + 0xD1D8 == code || // Lo HANGUL SYLLABLE TWAE + 0xD1F4 == code || // Lo HANGUL SYLLABLE TOE + 0xD210 == code || // Lo HANGUL SYLLABLE TYO + 0xD22C == code || // Lo HANGUL SYLLABLE TU + 0xD248 == code || // Lo HANGUL SYLLABLE TWEO + 0xD264 == code || // Lo HANGUL SYLLABLE TWE + 0xD280 == code || // Lo HANGUL SYLLABLE TWI + 0xD29C == code || // Lo HANGUL SYLLABLE TYU + 0xD2B8 == code || // Lo HANGUL SYLLABLE TEU + 0xD2D4 == code || // Lo HANGUL SYLLABLE TYI + 0xD2F0 == code || // Lo HANGUL SYLLABLE TI + 0xD30C == code || // Lo HANGUL SYLLABLE PA + 0xD328 == code || // Lo HANGUL SYLLABLE PAE + 0xD344 == code || // Lo HANGUL SYLLABLE PYA + 0xD360 == code || // Lo HANGUL SYLLABLE PYAE + 0xD37C == code || // Lo HANGUL SYLLABLE PEO + 0xD398 == code || // Lo HANGUL SYLLABLE PE + 0xD3B4 == code || // Lo HANGUL SYLLABLE PYEO + 0xD3D0 == code || // Lo HANGUL SYLLABLE PYE + 0xD3EC == code || // Lo HANGUL SYLLABLE PO + 0xD408 == code || // Lo HANGUL SYLLABLE PWA + 0xD424 == code || // Lo HANGUL SYLLABLE PWAE + 0xD440 == code || // Lo HANGUL SYLLABLE POE + 0xD45C == code || // Lo HANGUL SYLLABLE PYO + 0xD478 == code || // Lo HANGUL SYLLABLE PU + 0xD494 == code || // Lo HANGUL SYLLABLE PWEO + 0xD4B0 == code || // Lo HANGUL SYLLABLE PWE + 0xD4CC == code || // Lo HANGUL SYLLABLE PWI + 0xD4E8 == code || // Lo HANGUL SYLLABLE PYU + 0xD504 == code || // Lo HANGUL SYLLABLE PEU + 0xD520 == code || // Lo HANGUL SYLLABLE PYI + 0xD53C == code || // Lo HANGUL SYLLABLE PI + 0xD558 == code || // Lo HANGUL SYLLABLE HA + 0xD574 == code || // Lo HANGUL SYLLABLE HAE + 0xD590 == code || // Lo HANGUL SYLLABLE HYA + 0xD5AC == code || // Lo HANGUL SYLLABLE HYAE + 0xD5C8 == code || // Lo HANGUL SYLLABLE HEO + 0xD5E4 == code || // Lo HANGUL SYLLABLE HE + 0xD600 == code || // Lo HANGUL SYLLABLE HYEO + 0xD61C == code || // Lo HANGUL SYLLABLE HYE + 0xD638 == code || // Lo HANGUL SYLLABLE HO + 0xD654 == code || // Lo HANGUL SYLLABLE HWA + 0xD670 == code || // Lo HANGUL SYLLABLE HWAE + 0xD68C == code || // Lo HANGUL SYLLABLE HOE + 0xD6A8 == code || // Lo HANGUL SYLLABLE HYO + 0xD6C4 == code || // Lo HANGUL SYLLABLE HU + 0xD6E0 == code || // Lo HANGUL SYLLABLE HWEO + 0xD6FC == code || // Lo HANGUL SYLLABLE HWE + 0xD718 == code || // Lo HANGUL SYLLABLE HWI + 0xD734 == code || // Lo HANGUL SYLLABLE HYU + 0xD750 == code || // Lo HANGUL SYLLABLE HEU + 0xD76C == code || // Lo HANGUL SYLLABLE HYI + 0xD788 == code // Lo HANGUL SYLLABLE HI + ){ + return LV; + } + + if( + (0xAC01 <= code && code <= 0xAC1B) || // Lo [27] HANGUL SYLLABLE GAG..HANGUL SYLLABLE GAH + (0xAC1D <= code && code <= 0xAC37) || // Lo [27] HANGUL SYLLABLE GAEG..HANGUL SYLLABLE GAEH + (0xAC39 <= code && code <= 0xAC53) || // Lo [27] HANGUL SYLLABLE GYAG..HANGUL SYLLABLE GYAH + (0xAC55 <= code && code <= 0xAC6F) || // Lo [27] HANGUL SYLLABLE GYAEG..HANGUL SYLLABLE GYAEH + (0xAC71 <= code && code <= 0xAC8B) || // Lo [27] HANGUL SYLLABLE GEOG..HANGUL SYLLABLE GEOH + (0xAC8D <= code && code <= 0xACA7) || // Lo [27] HANGUL SYLLABLE GEG..HANGUL SYLLABLE GEH + (0xACA9 <= code && code <= 0xACC3) || // Lo [27] HANGUL SYLLABLE GYEOG..HANGUL SYLLABLE GYEOH + (0xACC5 <= code && code <= 0xACDF) || // Lo [27] HANGUL SYLLABLE GYEG..HANGUL SYLLABLE GYEH + (0xACE1 <= code && code <= 0xACFB) || // Lo [27] HANGUL SYLLABLE GOG..HANGUL SYLLABLE GOH + (0xACFD <= code && code <= 0xAD17) || // Lo [27] HANGUL SYLLABLE GWAG..HANGUL SYLLABLE GWAH + (0xAD19 <= code && code <= 0xAD33) || // Lo [27] HANGUL SYLLABLE GWAEG..HANGUL SYLLABLE GWAEH + (0xAD35 <= code && code <= 0xAD4F) || // Lo [27] HANGUL SYLLABLE GOEG..HANGUL SYLLABLE GOEH + (0xAD51 <= code && code <= 0xAD6B) || // Lo [27] HANGUL SYLLABLE GYOG..HANGUL SYLLABLE GYOH + (0xAD6D <= code && code <= 0xAD87) || // Lo [27] HANGUL SYLLABLE GUG..HANGUL SYLLABLE GUH + (0xAD89 <= code && code <= 0xADA3) || // Lo [27] HANGUL SYLLABLE GWEOG..HANGUL SYLLABLE GWEOH + (0xADA5 <= code && code <= 0xADBF) || // Lo [27] HANGUL SYLLABLE GWEG..HANGUL SYLLABLE GWEH + (0xADC1 <= code && code <= 0xADDB) || // Lo [27] HANGUL SYLLABLE GWIG..HANGUL SYLLABLE GWIH + (0xADDD <= code && code <= 0xADF7) || // Lo [27] HANGUL SYLLABLE GYUG..HANGUL SYLLABLE GYUH + (0xADF9 <= code && code <= 0xAE13) || // Lo [27] HANGUL SYLLABLE GEUG..HANGUL SYLLABLE GEUH + (0xAE15 <= code && code <= 0xAE2F) || // Lo [27] HANGUL SYLLABLE GYIG..HANGUL SYLLABLE GYIH + (0xAE31 <= code && code <= 0xAE4B) || // Lo [27] HANGUL SYLLABLE GIG..HANGUL SYLLABLE GIH + (0xAE4D <= code && code <= 0xAE67) || // Lo [27] HANGUL SYLLABLE GGAG..HANGUL SYLLABLE GGAH + (0xAE69 <= code && code <= 0xAE83) || // Lo [27] HANGUL SYLLABLE GGAEG..HANGUL SYLLABLE GGAEH + (0xAE85 <= code && code <= 0xAE9F) || // Lo [27] HANGUL SYLLABLE GGYAG..HANGUL SYLLABLE GGYAH + (0xAEA1 <= code && code <= 0xAEBB) || // Lo [27] HANGUL SYLLABLE GGYAEG..HANGUL SYLLABLE GGYAEH + (0xAEBD <= code && code <= 0xAED7) || // Lo [27] HANGUL SYLLABLE GGEOG..HANGUL SYLLABLE GGEOH + (0xAED9 <= code && code <= 0xAEF3) || // Lo [27] HANGUL SYLLABLE GGEG..HANGUL SYLLABLE GGEH + (0xAEF5 <= code && code <= 0xAF0F) || // Lo [27] HANGUL SYLLABLE GGYEOG..HANGUL SYLLABLE GGYEOH + (0xAF11 <= code && code <= 0xAF2B) || // Lo [27] HANGUL SYLLABLE GGYEG..HANGUL SYLLABLE GGYEH + (0xAF2D <= code && code <= 0xAF47) || // Lo [27] HANGUL SYLLABLE GGOG..HANGUL SYLLABLE GGOH + (0xAF49 <= code && code <= 0xAF63) || // Lo [27] HANGUL SYLLABLE GGWAG..HANGUL SYLLABLE GGWAH + (0xAF65 <= code && code <= 0xAF7F) || // Lo [27] HANGUL SYLLABLE GGWAEG..HANGUL SYLLABLE GGWAEH + (0xAF81 <= code && code <= 0xAF9B) || // Lo [27] HANGUL SYLLABLE GGOEG..HANGUL SYLLABLE GGOEH + (0xAF9D <= code && code <= 0xAFB7) || // Lo [27] HANGUL SYLLABLE GGYOG..HANGUL SYLLABLE GGYOH + (0xAFB9 <= code && code <= 0xAFD3) || // Lo [27] HANGUL SYLLABLE GGUG..HANGUL SYLLABLE GGUH + (0xAFD5 <= code && code <= 0xAFEF) || // Lo [27] HANGUL SYLLABLE GGWEOG..HANGUL SYLLABLE GGWEOH + (0xAFF1 <= code && code <= 0xB00B) || // Lo [27] HANGUL SYLLABLE GGWEG..HANGUL SYLLABLE GGWEH + (0xB00D <= code && code <= 0xB027) || // Lo [27] HANGUL SYLLABLE GGWIG..HANGUL SYLLABLE GGWIH + (0xB029 <= code && code <= 0xB043) || // Lo [27] HANGUL SYLLABLE GGYUG..HANGUL SYLLABLE GGYUH + (0xB045 <= code && code <= 0xB05F) || // Lo [27] HANGUL SYLLABLE GGEUG..HANGUL SYLLABLE GGEUH + (0xB061 <= code && code <= 0xB07B) || // Lo [27] HANGUL SYLLABLE GGYIG..HANGUL SYLLABLE GGYIH + (0xB07D <= code && code <= 0xB097) || // Lo [27] HANGUL SYLLABLE GGIG..HANGUL SYLLABLE GGIH + (0xB099 <= code && code <= 0xB0B3) || // Lo [27] HANGUL SYLLABLE NAG..HANGUL SYLLABLE NAH + (0xB0B5 <= code && code <= 0xB0CF) || // Lo [27] HANGUL SYLLABLE NAEG..HANGUL SYLLABLE NAEH + (0xB0D1 <= code && code <= 0xB0EB) || // Lo [27] HANGUL SYLLABLE NYAG..HANGUL SYLLABLE NYAH + (0xB0ED <= code && code <= 0xB107) || // Lo [27] HANGUL SYLLABLE NYAEG..HANGUL SYLLABLE NYAEH + (0xB109 <= code && code <= 0xB123) || // Lo [27] HANGUL SYLLABLE NEOG..HANGUL SYLLABLE NEOH + (0xB125 <= code && code <= 0xB13F) || // Lo [27] HANGUL SYLLABLE NEG..HANGUL SYLLABLE NEH + (0xB141 <= code && code <= 0xB15B) || // Lo [27] HANGUL SYLLABLE NYEOG..HANGUL SYLLABLE NYEOH + (0xB15D <= code && code <= 0xB177) || // Lo [27] HANGUL SYLLABLE NYEG..HANGUL SYLLABLE NYEH + (0xB179 <= code && code <= 0xB193) || // Lo [27] HANGUL SYLLABLE NOG..HANGUL SYLLABLE NOH + (0xB195 <= code && code <= 0xB1AF) || // Lo [27] HANGUL SYLLABLE NWAG..HANGUL SYLLABLE NWAH + (0xB1B1 <= code && code <= 0xB1CB) || // Lo [27] HANGUL SYLLABLE NWAEG..HANGUL SYLLABLE NWAEH + (0xB1CD <= code && code <= 0xB1E7) || // Lo [27] HANGUL SYLLABLE NOEG..HANGUL SYLLABLE NOEH + (0xB1E9 <= code && code <= 0xB203) || // Lo [27] HANGUL SYLLABLE NYOG..HANGUL SYLLABLE NYOH + (0xB205 <= code && code <= 0xB21F) || // Lo [27] HANGUL SYLLABLE NUG..HANGUL SYLLABLE NUH + (0xB221 <= code && code <= 0xB23B) || // Lo [27] HANGUL SYLLABLE NWEOG..HANGUL SYLLABLE NWEOH + (0xB23D <= code && code <= 0xB257) || // Lo [27] HANGUL SYLLABLE NWEG..HANGUL SYLLABLE NWEH + (0xB259 <= code && code <= 0xB273) || // Lo [27] HANGUL SYLLABLE NWIG..HANGUL SYLLABLE NWIH + (0xB275 <= code && code <= 0xB28F) || // Lo [27] HANGUL SYLLABLE NYUG..HANGUL SYLLABLE NYUH + (0xB291 <= code && code <= 0xB2AB) || // Lo [27] HANGUL SYLLABLE NEUG..HANGUL SYLLABLE NEUH + (0xB2AD <= code && code <= 0xB2C7) || // Lo [27] HANGUL SYLLABLE NYIG..HANGUL SYLLABLE NYIH + (0xB2C9 <= code && code <= 0xB2E3) || // Lo [27] HANGUL SYLLABLE NIG..HANGUL SYLLABLE NIH + (0xB2E5 <= code && code <= 0xB2FF) || // Lo [27] HANGUL SYLLABLE DAG..HANGUL SYLLABLE DAH + (0xB301 <= code && code <= 0xB31B) || // Lo [27] HANGUL SYLLABLE DAEG..HANGUL SYLLABLE DAEH + (0xB31D <= code && code <= 0xB337) || // Lo [27] HANGUL SYLLABLE DYAG..HANGUL SYLLABLE DYAH + (0xB339 <= code && code <= 0xB353) || // Lo [27] HANGUL SYLLABLE DYAEG..HANGUL SYLLABLE DYAEH + (0xB355 <= code && code <= 0xB36F) || // Lo [27] HANGUL SYLLABLE DEOG..HANGUL SYLLABLE DEOH + (0xB371 <= code && code <= 0xB38B) || // Lo [27] HANGUL SYLLABLE DEG..HANGUL SYLLABLE DEH + (0xB38D <= code && code <= 0xB3A7) || // Lo [27] HANGUL SYLLABLE DYEOG..HANGUL SYLLABLE DYEOH + (0xB3A9 <= code && code <= 0xB3C3) || // Lo [27] HANGUL SYLLABLE DYEG..HANGUL SYLLABLE DYEH + (0xB3C5 <= code && code <= 0xB3DF) || // Lo [27] HANGUL SYLLABLE DOG..HANGUL SYLLABLE DOH + (0xB3E1 <= code && code <= 0xB3FB) || // Lo [27] HANGUL SYLLABLE DWAG..HANGUL SYLLABLE DWAH + (0xB3FD <= code && code <= 0xB417) || // Lo [27] HANGUL SYLLABLE DWAEG..HANGUL SYLLABLE DWAEH + (0xB419 <= code && code <= 0xB433) || // Lo [27] HANGUL SYLLABLE DOEG..HANGUL SYLLABLE DOEH + (0xB435 <= code && code <= 0xB44F) || // Lo [27] HANGUL SYLLABLE DYOG..HANGUL SYLLABLE DYOH + (0xB451 <= code && code <= 0xB46B) || // Lo [27] HANGUL SYLLABLE DUG..HANGUL SYLLABLE DUH + (0xB46D <= code && code <= 0xB487) || // Lo [27] HANGUL SYLLABLE DWEOG..HANGUL SYLLABLE DWEOH + (0xB489 <= code && code <= 0xB4A3) || // Lo [27] HANGUL SYLLABLE DWEG..HANGUL SYLLABLE DWEH + (0xB4A5 <= code && code <= 0xB4BF) || // Lo [27] HANGUL SYLLABLE DWIG..HANGUL SYLLABLE DWIH + (0xB4C1 <= code && code <= 0xB4DB) || // Lo [27] HANGUL SYLLABLE DYUG..HANGUL SYLLABLE DYUH + (0xB4DD <= code && code <= 0xB4F7) || // Lo [27] HANGUL SYLLABLE DEUG..HANGUL SYLLABLE DEUH + (0xB4F9 <= code && code <= 0xB513) || // Lo [27] HANGUL SYLLABLE DYIG..HANGUL SYLLABLE DYIH + (0xB515 <= code && code <= 0xB52F) || // Lo [27] HANGUL SYLLABLE DIG..HANGUL SYLLABLE DIH + (0xB531 <= code && code <= 0xB54B) || // Lo [27] HANGUL SYLLABLE DDAG..HANGUL SYLLABLE DDAH + (0xB54D <= code && code <= 0xB567) || // Lo [27] HANGUL SYLLABLE DDAEG..HANGUL SYLLABLE DDAEH + (0xB569 <= code && code <= 0xB583) || // Lo [27] HANGUL SYLLABLE DDYAG..HANGUL SYLLABLE DDYAH + (0xB585 <= code && code <= 0xB59F) || // Lo [27] HANGUL SYLLABLE DDYAEG..HANGUL SYLLABLE DDYAEH + (0xB5A1 <= code && code <= 0xB5BB) || // Lo [27] HANGUL SYLLABLE DDEOG..HANGUL SYLLABLE DDEOH + (0xB5BD <= code && code <= 0xB5D7) || // Lo [27] HANGUL SYLLABLE DDEG..HANGUL SYLLABLE DDEH + (0xB5D9 <= code && code <= 0xB5F3) || // Lo [27] HANGUL SYLLABLE DDYEOG..HANGUL SYLLABLE DDYEOH + (0xB5F5 <= code && code <= 0xB60F) || // Lo [27] HANGUL SYLLABLE DDYEG..HANGUL SYLLABLE DDYEH + (0xB611 <= code && code <= 0xB62B) || // Lo [27] HANGUL SYLLABLE DDOG..HANGUL SYLLABLE DDOH + (0xB62D <= code && code <= 0xB647) || // Lo [27] HANGUL SYLLABLE DDWAG..HANGUL SYLLABLE DDWAH + (0xB649 <= code && code <= 0xB663) || // Lo [27] HANGUL SYLLABLE DDWAEG..HANGUL SYLLABLE DDWAEH + (0xB665 <= code && code <= 0xB67F) || // Lo [27] HANGUL SYLLABLE DDOEG..HANGUL SYLLABLE DDOEH + (0xB681 <= code && code <= 0xB69B) || // Lo [27] HANGUL SYLLABLE DDYOG..HANGUL SYLLABLE DDYOH + (0xB69D <= code && code <= 0xB6B7) || // Lo [27] HANGUL SYLLABLE DDUG..HANGUL SYLLABLE DDUH + (0xB6B9 <= code && code <= 0xB6D3) || // Lo [27] HANGUL SYLLABLE DDWEOG..HANGUL SYLLABLE DDWEOH + (0xB6D5 <= code && code <= 0xB6EF) || // Lo [27] HANGUL SYLLABLE DDWEG..HANGUL SYLLABLE DDWEH + (0xB6F1 <= code && code <= 0xB70B) || // Lo [27] HANGUL SYLLABLE DDWIG..HANGUL SYLLABLE DDWIH + (0xB70D <= code && code <= 0xB727) || // Lo [27] HANGUL SYLLABLE DDYUG..HANGUL SYLLABLE DDYUH + (0xB729 <= code && code <= 0xB743) || // Lo [27] HANGUL SYLLABLE DDEUG..HANGUL SYLLABLE DDEUH + (0xB745 <= code && code <= 0xB75F) || // Lo [27] HANGUL SYLLABLE DDYIG..HANGUL SYLLABLE DDYIH + (0xB761 <= code && code <= 0xB77B) || // Lo [27] HANGUL SYLLABLE DDIG..HANGUL SYLLABLE DDIH + (0xB77D <= code && code <= 0xB797) || // Lo [27] HANGUL SYLLABLE RAG..HANGUL SYLLABLE RAH + (0xB799 <= code && code <= 0xB7B3) || // Lo [27] HANGUL SYLLABLE RAEG..HANGUL SYLLABLE RAEH + (0xB7B5 <= code && code <= 0xB7CF) || // Lo [27] HANGUL SYLLABLE RYAG..HANGUL SYLLABLE RYAH + (0xB7D1 <= code && code <= 0xB7EB) || // Lo [27] HANGUL SYLLABLE RYAEG..HANGUL SYLLABLE RYAEH + (0xB7ED <= code && code <= 0xB807) || // Lo [27] HANGUL SYLLABLE REOG..HANGUL SYLLABLE REOH + (0xB809 <= code && code <= 0xB823) || // Lo [27] HANGUL SYLLABLE REG..HANGUL SYLLABLE REH + (0xB825 <= code && code <= 0xB83F) || // Lo [27] HANGUL SYLLABLE RYEOG..HANGUL SYLLABLE RYEOH + (0xB841 <= code && code <= 0xB85B) || // Lo [27] HANGUL SYLLABLE RYEG..HANGUL SYLLABLE RYEH + (0xB85D <= code && code <= 0xB877) || // Lo [27] HANGUL SYLLABLE ROG..HANGUL SYLLABLE ROH + (0xB879 <= code && code <= 0xB893) || // Lo [27] HANGUL SYLLABLE RWAG..HANGUL SYLLABLE RWAH + (0xB895 <= code && code <= 0xB8AF) || // Lo [27] HANGUL SYLLABLE RWAEG..HANGUL SYLLABLE RWAEH + (0xB8B1 <= code && code <= 0xB8CB) || // Lo [27] HANGUL SYLLABLE ROEG..HANGUL SYLLABLE ROEH + (0xB8CD <= code && code <= 0xB8E7) || // Lo [27] HANGUL SYLLABLE RYOG..HANGUL SYLLABLE RYOH + (0xB8E9 <= code && code <= 0xB903) || // Lo [27] HANGUL SYLLABLE RUG..HANGUL SYLLABLE RUH + (0xB905 <= code && code <= 0xB91F) || // Lo [27] HANGUL SYLLABLE RWEOG..HANGUL SYLLABLE RWEOH + (0xB921 <= code && code <= 0xB93B) || // Lo [27] HANGUL SYLLABLE RWEG..HANGUL SYLLABLE RWEH + (0xB93D <= code && code <= 0xB957) || // Lo [27] HANGUL SYLLABLE RWIG..HANGUL SYLLABLE RWIH + (0xB959 <= code && code <= 0xB973) || // Lo [27] HANGUL SYLLABLE RYUG..HANGUL SYLLABLE RYUH + (0xB975 <= code && code <= 0xB98F) || // Lo [27] HANGUL SYLLABLE REUG..HANGUL SYLLABLE REUH + (0xB991 <= code && code <= 0xB9AB) || // Lo [27] HANGUL SYLLABLE RYIG..HANGUL SYLLABLE RYIH + (0xB9AD <= code && code <= 0xB9C7) || // Lo [27] HANGUL SYLLABLE RIG..HANGUL SYLLABLE RIH + (0xB9C9 <= code && code <= 0xB9E3) || // Lo [27] HANGUL SYLLABLE MAG..HANGUL SYLLABLE MAH + (0xB9E5 <= code && code <= 0xB9FF) || // Lo [27] HANGUL SYLLABLE MAEG..HANGUL SYLLABLE MAEH + (0xBA01 <= code && code <= 0xBA1B) || // Lo [27] HANGUL SYLLABLE MYAG..HANGUL SYLLABLE MYAH + (0xBA1D <= code && code <= 0xBA37) || // Lo [27] HANGUL SYLLABLE MYAEG..HANGUL SYLLABLE MYAEH + (0xBA39 <= code && code <= 0xBA53) || // Lo [27] HANGUL SYLLABLE MEOG..HANGUL SYLLABLE MEOH + (0xBA55 <= code && code <= 0xBA6F) || // Lo [27] HANGUL SYLLABLE MEG..HANGUL SYLLABLE MEH + (0xBA71 <= code && code <= 0xBA8B) || // Lo [27] HANGUL SYLLABLE MYEOG..HANGUL SYLLABLE MYEOH + (0xBA8D <= code && code <= 0xBAA7) || // Lo [27] HANGUL SYLLABLE MYEG..HANGUL SYLLABLE MYEH + (0xBAA9 <= code && code <= 0xBAC3) || // Lo [27] HANGUL SYLLABLE MOG..HANGUL SYLLABLE MOH + (0xBAC5 <= code && code <= 0xBADF) || // Lo [27] HANGUL SYLLABLE MWAG..HANGUL SYLLABLE MWAH + (0xBAE1 <= code && code <= 0xBAFB) || // Lo [27] HANGUL SYLLABLE MWAEG..HANGUL SYLLABLE MWAEH + (0xBAFD <= code && code <= 0xBB17) || // Lo [27] HANGUL SYLLABLE MOEG..HANGUL SYLLABLE MOEH + (0xBB19 <= code && code <= 0xBB33) || // Lo [27] HANGUL SYLLABLE MYOG..HANGUL SYLLABLE MYOH + (0xBB35 <= code && code <= 0xBB4F) || // Lo [27] HANGUL SYLLABLE MUG..HANGUL SYLLABLE MUH + (0xBB51 <= code && code <= 0xBB6B) || // Lo [27] HANGUL SYLLABLE MWEOG..HANGUL SYLLABLE MWEOH + (0xBB6D <= code && code <= 0xBB87) || // Lo [27] HANGUL SYLLABLE MWEG..HANGUL SYLLABLE MWEH + (0xBB89 <= code && code <= 0xBBA3) || // Lo [27] HANGUL SYLLABLE MWIG..HANGUL SYLLABLE MWIH + (0xBBA5 <= code && code <= 0xBBBF) || // Lo [27] HANGUL SYLLABLE MYUG..HANGUL SYLLABLE MYUH + (0xBBC1 <= code && code <= 0xBBDB) || // Lo [27] HANGUL SYLLABLE MEUG..HANGUL SYLLABLE MEUH + (0xBBDD <= code && code <= 0xBBF7) || // Lo [27] HANGUL SYLLABLE MYIG..HANGUL SYLLABLE MYIH + (0xBBF9 <= code && code <= 0xBC13) || // Lo [27] HANGUL SYLLABLE MIG..HANGUL SYLLABLE MIH + (0xBC15 <= code && code <= 0xBC2F) || // Lo [27] HANGUL SYLLABLE BAG..HANGUL SYLLABLE BAH + (0xBC31 <= code && code <= 0xBC4B) || // Lo [27] HANGUL SYLLABLE BAEG..HANGUL SYLLABLE BAEH + (0xBC4D <= code && code <= 0xBC67) || // Lo [27] HANGUL SYLLABLE BYAG..HANGUL SYLLABLE BYAH + (0xBC69 <= code && code <= 0xBC83) || // Lo [27] HANGUL SYLLABLE BYAEG..HANGUL SYLLABLE BYAEH + (0xBC85 <= code && code <= 0xBC9F) || // Lo [27] HANGUL SYLLABLE BEOG..HANGUL SYLLABLE BEOH + (0xBCA1 <= code && code <= 0xBCBB) || // Lo [27] HANGUL SYLLABLE BEG..HANGUL SYLLABLE BEH + (0xBCBD <= code && code <= 0xBCD7) || // Lo [27] HANGUL SYLLABLE BYEOG..HANGUL SYLLABLE BYEOH + (0xBCD9 <= code && code <= 0xBCF3) || // Lo [27] HANGUL SYLLABLE BYEG..HANGUL SYLLABLE BYEH + (0xBCF5 <= code && code <= 0xBD0F) || // Lo [27] HANGUL SYLLABLE BOG..HANGUL SYLLABLE BOH + (0xBD11 <= code && code <= 0xBD2B) || // Lo [27] HANGUL SYLLABLE BWAG..HANGUL SYLLABLE BWAH + (0xBD2D <= code && code <= 0xBD47) || // Lo [27] HANGUL SYLLABLE BWAEG..HANGUL SYLLABLE BWAEH + (0xBD49 <= code && code <= 0xBD63) || // Lo [27] HANGUL SYLLABLE BOEG..HANGUL SYLLABLE BOEH + (0xBD65 <= code && code <= 0xBD7F) || // Lo [27] HANGUL SYLLABLE BYOG..HANGUL SYLLABLE BYOH + (0xBD81 <= code && code <= 0xBD9B) || // Lo [27] HANGUL SYLLABLE BUG..HANGUL SYLLABLE BUH + (0xBD9D <= code && code <= 0xBDB7) || // Lo [27] HANGUL SYLLABLE BWEOG..HANGUL SYLLABLE BWEOH + (0xBDB9 <= code && code <= 0xBDD3) || // Lo [27] HANGUL SYLLABLE BWEG..HANGUL SYLLABLE BWEH + (0xBDD5 <= code && code <= 0xBDEF) || // Lo [27] HANGUL SYLLABLE BWIG..HANGUL SYLLABLE BWIH + (0xBDF1 <= code && code <= 0xBE0B) || // Lo [27] HANGUL SYLLABLE BYUG..HANGUL SYLLABLE BYUH + (0xBE0D <= code && code <= 0xBE27) || // Lo [27] HANGUL SYLLABLE BEUG..HANGUL SYLLABLE BEUH + (0xBE29 <= code && code <= 0xBE43) || // Lo [27] HANGUL SYLLABLE BYIG..HANGUL SYLLABLE BYIH + (0xBE45 <= code && code <= 0xBE5F) || // Lo [27] HANGUL SYLLABLE BIG..HANGUL SYLLABLE BIH + (0xBE61 <= code && code <= 0xBE7B) || // Lo [27] HANGUL SYLLABLE BBAG..HANGUL SYLLABLE BBAH + (0xBE7D <= code && code <= 0xBE97) || // Lo [27] HANGUL SYLLABLE BBAEG..HANGUL SYLLABLE BBAEH + (0xBE99 <= code && code <= 0xBEB3) || // Lo [27] HANGUL SYLLABLE BBYAG..HANGUL SYLLABLE BBYAH + (0xBEB5 <= code && code <= 0xBECF) || // Lo [27] HANGUL SYLLABLE BBYAEG..HANGUL SYLLABLE BBYAEH + (0xBED1 <= code && code <= 0xBEEB) || // Lo [27] HANGUL SYLLABLE BBEOG..HANGUL SYLLABLE BBEOH + (0xBEED <= code && code <= 0xBF07) || // Lo [27] HANGUL SYLLABLE BBEG..HANGUL SYLLABLE BBEH + (0xBF09 <= code && code <= 0xBF23) || // Lo [27] HANGUL SYLLABLE BBYEOG..HANGUL SYLLABLE BBYEOH + (0xBF25 <= code && code <= 0xBF3F) || // Lo [27] HANGUL SYLLABLE BBYEG..HANGUL SYLLABLE BBYEH + (0xBF41 <= code && code <= 0xBF5B) || // Lo [27] HANGUL SYLLABLE BBOG..HANGUL SYLLABLE BBOH + (0xBF5D <= code && code <= 0xBF77) || // Lo [27] HANGUL SYLLABLE BBWAG..HANGUL SYLLABLE BBWAH + (0xBF79 <= code && code <= 0xBF93) || // Lo [27] HANGUL SYLLABLE BBWAEG..HANGUL SYLLABLE BBWAEH + (0xBF95 <= code && code <= 0xBFAF) || // Lo [27] HANGUL SYLLABLE BBOEG..HANGUL SYLLABLE BBOEH + (0xBFB1 <= code && code <= 0xBFCB) || // Lo [27] HANGUL SYLLABLE BBYOG..HANGUL SYLLABLE BBYOH + (0xBFCD <= code && code <= 0xBFE7) || // Lo [27] HANGUL SYLLABLE BBUG..HANGUL SYLLABLE BBUH + (0xBFE9 <= code && code <= 0xC003) || // Lo [27] HANGUL SYLLABLE BBWEOG..HANGUL SYLLABLE BBWEOH + (0xC005 <= code && code <= 0xC01F) || // Lo [27] HANGUL SYLLABLE BBWEG..HANGUL SYLLABLE BBWEH + (0xC021 <= code && code <= 0xC03B) || // Lo [27] HANGUL SYLLABLE BBWIG..HANGUL SYLLABLE BBWIH + (0xC03D <= code && code <= 0xC057) || // Lo [27] HANGUL SYLLABLE BBYUG..HANGUL SYLLABLE BBYUH + (0xC059 <= code && code <= 0xC073) || // Lo [27] HANGUL SYLLABLE BBEUG..HANGUL SYLLABLE BBEUH + (0xC075 <= code && code <= 0xC08F) || // Lo [27] HANGUL SYLLABLE BBYIG..HANGUL SYLLABLE BBYIH + (0xC091 <= code && code <= 0xC0AB) || // Lo [27] HANGUL SYLLABLE BBIG..HANGUL SYLLABLE BBIH + (0xC0AD <= code && code <= 0xC0C7) || // Lo [27] HANGUL SYLLABLE SAG..HANGUL SYLLABLE SAH + (0xC0C9 <= code && code <= 0xC0E3) || // Lo [27] HANGUL SYLLABLE SAEG..HANGUL SYLLABLE SAEH + (0xC0E5 <= code && code <= 0xC0FF) || // Lo [27] HANGUL SYLLABLE SYAG..HANGUL SYLLABLE SYAH + (0xC101 <= code && code <= 0xC11B) || // Lo [27] HANGUL SYLLABLE SYAEG..HANGUL SYLLABLE SYAEH + (0xC11D <= code && code <= 0xC137) || // Lo [27] HANGUL SYLLABLE SEOG..HANGUL SYLLABLE SEOH + (0xC139 <= code && code <= 0xC153) || // Lo [27] HANGUL SYLLABLE SEG..HANGUL SYLLABLE SEH + (0xC155 <= code && code <= 0xC16F) || // Lo [27] HANGUL SYLLABLE SYEOG..HANGUL SYLLABLE SYEOH + (0xC171 <= code && code <= 0xC18B) || // Lo [27] HANGUL SYLLABLE SYEG..HANGUL SYLLABLE SYEH + (0xC18D <= code && code <= 0xC1A7) || // Lo [27] HANGUL SYLLABLE SOG..HANGUL SYLLABLE SOH + (0xC1A9 <= code && code <= 0xC1C3) || // Lo [27] HANGUL SYLLABLE SWAG..HANGUL SYLLABLE SWAH + (0xC1C5 <= code && code <= 0xC1DF) || // Lo [27] HANGUL SYLLABLE SWAEG..HANGUL SYLLABLE SWAEH + (0xC1E1 <= code && code <= 0xC1FB) || // Lo [27] HANGUL SYLLABLE SOEG..HANGUL SYLLABLE SOEH + (0xC1FD <= code && code <= 0xC217) || // Lo [27] HANGUL SYLLABLE SYOG..HANGUL SYLLABLE SYOH + (0xC219 <= code && code <= 0xC233) || // Lo [27] HANGUL SYLLABLE SUG..HANGUL SYLLABLE SUH + (0xC235 <= code && code <= 0xC24F) || // Lo [27] HANGUL SYLLABLE SWEOG..HANGUL SYLLABLE SWEOH + (0xC251 <= code && code <= 0xC26B) || // Lo [27] HANGUL SYLLABLE SWEG..HANGUL SYLLABLE SWEH + (0xC26D <= code && code <= 0xC287) || // Lo [27] HANGUL SYLLABLE SWIG..HANGUL SYLLABLE SWIH + (0xC289 <= code && code <= 0xC2A3) || // Lo [27] HANGUL SYLLABLE SYUG..HANGUL SYLLABLE SYUH + (0xC2A5 <= code && code <= 0xC2BF) || // Lo [27] HANGUL SYLLABLE SEUG..HANGUL SYLLABLE SEUH + (0xC2C1 <= code && code <= 0xC2DB) || // Lo [27] HANGUL SYLLABLE SYIG..HANGUL SYLLABLE SYIH + (0xC2DD <= code && code <= 0xC2F7) || // Lo [27] HANGUL SYLLABLE SIG..HANGUL SYLLABLE SIH + (0xC2F9 <= code && code <= 0xC313) || // Lo [27] HANGUL SYLLABLE SSAG..HANGUL SYLLABLE SSAH + (0xC315 <= code && code <= 0xC32F) || // Lo [27] HANGUL SYLLABLE SSAEG..HANGUL SYLLABLE SSAEH + (0xC331 <= code && code <= 0xC34B) || // Lo [27] HANGUL SYLLABLE SSYAG..HANGUL SYLLABLE SSYAH + (0xC34D <= code && code <= 0xC367) || // Lo [27] HANGUL SYLLABLE SSYAEG..HANGUL SYLLABLE SSYAEH + (0xC369 <= code && code <= 0xC383) || // Lo [27] HANGUL SYLLABLE SSEOG..HANGUL SYLLABLE SSEOH + (0xC385 <= code && code <= 0xC39F) || // Lo [27] HANGUL SYLLABLE SSEG..HANGUL SYLLABLE SSEH + (0xC3A1 <= code && code <= 0xC3BB) || // Lo [27] HANGUL SYLLABLE SSYEOG..HANGUL SYLLABLE SSYEOH + (0xC3BD <= code && code <= 0xC3D7) || // Lo [27] HANGUL SYLLABLE SSYEG..HANGUL SYLLABLE SSYEH + (0xC3D9 <= code && code <= 0xC3F3) || // Lo [27] HANGUL SYLLABLE SSOG..HANGUL SYLLABLE SSOH + (0xC3F5 <= code && code <= 0xC40F) || // Lo [27] HANGUL SYLLABLE SSWAG..HANGUL SYLLABLE SSWAH + (0xC411 <= code && code <= 0xC42B) || // Lo [27] HANGUL SYLLABLE SSWAEG..HANGUL SYLLABLE SSWAEH + (0xC42D <= code && code <= 0xC447) || // Lo [27] HANGUL SYLLABLE SSOEG..HANGUL SYLLABLE SSOEH + (0xC449 <= code && code <= 0xC463) || // Lo [27] HANGUL SYLLABLE SSYOG..HANGUL SYLLABLE SSYOH + (0xC465 <= code && code <= 0xC47F) || // Lo [27] HANGUL SYLLABLE SSUG..HANGUL SYLLABLE SSUH + (0xC481 <= code && code <= 0xC49B) || // Lo [27] HANGUL SYLLABLE SSWEOG..HANGUL SYLLABLE SSWEOH + (0xC49D <= code && code <= 0xC4B7) || // Lo [27] HANGUL SYLLABLE SSWEG..HANGUL SYLLABLE SSWEH + (0xC4B9 <= code && code <= 0xC4D3) || // Lo [27] HANGUL SYLLABLE SSWIG..HANGUL SYLLABLE SSWIH + (0xC4D5 <= code && code <= 0xC4EF) || // Lo [27] HANGUL SYLLABLE SSYUG..HANGUL SYLLABLE SSYUH + (0xC4F1 <= code && code <= 0xC50B) || // Lo [27] HANGUL SYLLABLE SSEUG..HANGUL SYLLABLE SSEUH + (0xC50D <= code && code <= 0xC527) || // Lo [27] HANGUL SYLLABLE SSYIG..HANGUL SYLLABLE SSYIH + (0xC529 <= code && code <= 0xC543) || // Lo [27] HANGUL SYLLABLE SSIG..HANGUL SYLLABLE SSIH + (0xC545 <= code && code <= 0xC55F) || // Lo [27] HANGUL SYLLABLE AG..HANGUL SYLLABLE AH + (0xC561 <= code && code <= 0xC57B) || // Lo [27] HANGUL SYLLABLE AEG..HANGUL SYLLABLE AEH + (0xC57D <= code && code <= 0xC597) || // Lo [27] HANGUL SYLLABLE YAG..HANGUL SYLLABLE YAH + (0xC599 <= code && code <= 0xC5B3) || // Lo [27] HANGUL SYLLABLE YAEG..HANGUL SYLLABLE YAEH + (0xC5B5 <= code && code <= 0xC5CF) || // Lo [27] HANGUL SYLLABLE EOG..HANGUL SYLLABLE EOH + (0xC5D1 <= code && code <= 0xC5EB) || // Lo [27] HANGUL SYLLABLE EG..HANGUL SYLLABLE EH + (0xC5ED <= code && code <= 0xC607) || // Lo [27] HANGUL SYLLABLE YEOG..HANGUL SYLLABLE YEOH + (0xC609 <= code && code <= 0xC623) || // Lo [27] HANGUL SYLLABLE YEG..HANGUL SYLLABLE YEH + (0xC625 <= code && code <= 0xC63F) || // Lo [27] HANGUL SYLLABLE OG..HANGUL SYLLABLE OH + (0xC641 <= code && code <= 0xC65B) || // Lo [27] HANGUL SYLLABLE WAG..HANGUL SYLLABLE WAH + (0xC65D <= code && code <= 0xC677) || // Lo [27] HANGUL SYLLABLE WAEG..HANGUL SYLLABLE WAEH + (0xC679 <= code && code <= 0xC693) || // Lo [27] HANGUL SYLLABLE OEG..HANGUL SYLLABLE OEH + (0xC695 <= code && code <= 0xC6AF) || // Lo [27] HANGUL SYLLABLE YOG..HANGUL SYLLABLE YOH + (0xC6B1 <= code && code <= 0xC6CB) || // Lo [27] HANGUL SYLLABLE UG..HANGUL SYLLABLE UH + (0xC6CD <= code && code <= 0xC6E7) || // Lo [27] HANGUL SYLLABLE WEOG..HANGUL SYLLABLE WEOH + (0xC6E9 <= code && code <= 0xC703) || // Lo [27] HANGUL SYLLABLE WEG..HANGUL SYLLABLE WEH + (0xC705 <= code && code <= 0xC71F) || // Lo [27] HANGUL SYLLABLE WIG..HANGUL SYLLABLE WIH + (0xC721 <= code && code <= 0xC73B) || // Lo [27] HANGUL SYLLABLE YUG..HANGUL SYLLABLE YUH + (0xC73D <= code && code <= 0xC757) || // Lo [27] HANGUL SYLLABLE EUG..HANGUL SYLLABLE EUH + (0xC759 <= code && code <= 0xC773) || // Lo [27] HANGUL SYLLABLE YIG..HANGUL SYLLABLE YIH + (0xC775 <= code && code <= 0xC78F) || // Lo [27] HANGUL SYLLABLE IG..HANGUL SYLLABLE IH + (0xC791 <= code && code <= 0xC7AB) || // Lo [27] HANGUL SYLLABLE JAG..HANGUL SYLLABLE JAH + (0xC7AD <= code && code <= 0xC7C7) || // Lo [27] HANGUL SYLLABLE JAEG..HANGUL SYLLABLE JAEH + (0xC7C9 <= code && code <= 0xC7E3) || // Lo [27] HANGUL SYLLABLE JYAG..HANGUL SYLLABLE JYAH + (0xC7E5 <= code && code <= 0xC7FF) || // Lo [27] HANGUL SYLLABLE JYAEG..HANGUL SYLLABLE JYAEH + (0xC801 <= code && code <= 0xC81B) || // Lo [27] HANGUL SYLLABLE JEOG..HANGUL SYLLABLE JEOH + (0xC81D <= code && code <= 0xC837) || // Lo [27] HANGUL SYLLABLE JEG..HANGUL SYLLABLE JEH + (0xC839 <= code && code <= 0xC853) || // Lo [27] HANGUL SYLLABLE JYEOG..HANGUL SYLLABLE JYEOH + (0xC855 <= code && code <= 0xC86F) || // Lo [27] HANGUL SYLLABLE JYEG..HANGUL SYLLABLE JYEH + (0xC871 <= code && code <= 0xC88B) || // Lo [27] HANGUL SYLLABLE JOG..HANGUL SYLLABLE JOH + (0xC88D <= code && code <= 0xC8A7) || // Lo [27] HANGUL SYLLABLE JWAG..HANGUL SYLLABLE JWAH + (0xC8A9 <= code && code <= 0xC8C3) || // Lo [27] HANGUL SYLLABLE JWAEG..HANGUL SYLLABLE JWAEH + (0xC8C5 <= code && code <= 0xC8DF) || // Lo [27] HANGUL SYLLABLE JOEG..HANGUL SYLLABLE JOEH + (0xC8E1 <= code && code <= 0xC8FB) || // Lo [27] HANGUL SYLLABLE JYOG..HANGUL SYLLABLE JYOH + (0xC8FD <= code && code <= 0xC917) || // Lo [27] HANGUL SYLLABLE JUG..HANGUL SYLLABLE JUH + (0xC919 <= code && code <= 0xC933) || // Lo [27] HANGUL SYLLABLE JWEOG..HANGUL SYLLABLE JWEOH + (0xC935 <= code && code <= 0xC94F) || // Lo [27] HANGUL SYLLABLE JWEG..HANGUL SYLLABLE JWEH + (0xC951 <= code && code <= 0xC96B) || // Lo [27] HANGUL SYLLABLE JWIG..HANGUL SYLLABLE JWIH + (0xC96D <= code && code <= 0xC987) || // Lo [27] HANGUL SYLLABLE JYUG..HANGUL SYLLABLE JYUH + (0xC989 <= code && code <= 0xC9A3) || // Lo [27] HANGUL SYLLABLE JEUG..HANGUL SYLLABLE JEUH + (0xC9A5 <= code && code <= 0xC9BF) || // Lo [27] HANGUL SYLLABLE JYIG..HANGUL SYLLABLE JYIH + (0xC9C1 <= code && code <= 0xC9DB) || // Lo [27] HANGUL SYLLABLE JIG..HANGUL SYLLABLE JIH + (0xC9DD <= code && code <= 0xC9F7) || // Lo [27] HANGUL SYLLABLE JJAG..HANGUL SYLLABLE JJAH + (0xC9F9 <= code && code <= 0xCA13) || // Lo [27] HANGUL SYLLABLE JJAEG..HANGUL SYLLABLE JJAEH + (0xCA15 <= code && code <= 0xCA2F) || // Lo [27] HANGUL SYLLABLE JJYAG..HANGUL SYLLABLE JJYAH + (0xCA31 <= code && code <= 0xCA4B) || // Lo [27] HANGUL SYLLABLE JJYAEG..HANGUL SYLLABLE JJYAEH + (0xCA4D <= code && code <= 0xCA67) || // Lo [27] HANGUL SYLLABLE JJEOG..HANGUL SYLLABLE JJEOH + (0xCA69 <= code && code <= 0xCA83) || // Lo [27] HANGUL SYLLABLE JJEG..HANGUL SYLLABLE JJEH + (0xCA85 <= code && code <= 0xCA9F) || // Lo [27] HANGUL SYLLABLE JJYEOG..HANGUL SYLLABLE JJYEOH + (0xCAA1 <= code && code <= 0xCABB) || // Lo [27] HANGUL SYLLABLE JJYEG..HANGUL SYLLABLE JJYEH + (0xCABD <= code && code <= 0xCAD7) || // Lo [27] HANGUL SYLLABLE JJOG..HANGUL SYLLABLE JJOH + (0xCAD9 <= code && code <= 0xCAF3) || // Lo [27] HANGUL SYLLABLE JJWAG..HANGUL SYLLABLE JJWAH + (0xCAF5 <= code && code <= 0xCB0F) || // Lo [27] HANGUL SYLLABLE JJWAEG..HANGUL SYLLABLE JJWAEH + (0xCB11 <= code && code <= 0xCB2B) || // Lo [27] HANGUL SYLLABLE JJOEG..HANGUL SYLLABLE JJOEH + (0xCB2D <= code && code <= 0xCB47) || // Lo [27] HANGUL SYLLABLE JJYOG..HANGUL SYLLABLE JJYOH + (0xCB49 <= code && code <= 0xCB63) || // Lo [27] HANGUL SYLLABLE JJUG..HANGUL SYLLABLE JJUH + (0xCB65 <= code && code <= 0xCB7F) || // Lo [27] HANGUL SYLLABLE JJWEOG..HANGUL SYLLABLE JJWEOH + (0xCB81 <= code && code <= 0xCB9B) || // Lo [27] HANGUL SYLLABLE JJWEG..HANGUL SYLLABLE JJWEH + (0xCB9D <= code && code <= 0xCBB7) || // Lo [27] HANGUL SYLLABLE JJWIG..HANGUL SYLLABLE JJWIH + (0xCBB9 <= code && code <= 0xCBD3) || // Lo [27] HANGUL SYLLABLE JJYUG..HANGUL SYLLABLE JJYUH + (0xCBD5 <= code && code <= 0xCBEF) || // Lo [27] HANGUL SYLLABLE JJEUG..HANGUL SYLLABLE JJEUH + (0xCBF1 <= code && code <= 0xCC0B) || // Lo [27] HANGUL SYLLABLE JJYIG..HANGUL SYLLABLE JJYIH + (0xCC0D <= code && code <= 0xCC27) || // Lo [27] HANGUL SYLLABLE JJIG..HANGUL SYLLABLE JJIH + (0xCC29 <= code && code <= 0xCC43) || // Lo [27] HANGUL SYLLABLE CAG..HANGUL SYLLABLE CAH + (0xCC45 <= code && code <= 0xCC5F) || // Lo [27] HANGUL SYLLABLE CAEG..HANGUL SYLLABLE CAEH + (0xCC61 <= code && code <= 0xCC7B) || // Lo [27] HANGUL SYLLABLE CYAG..HANGUL SYLLABLE CYAH + (0xCC7D <= code && code <= 0xCC97) || // Lo [27] HANGUL SYLLABLE CYAEG..HANGUL SYLLABLE CYAEH + (0xCC99 <= code && code <= 0xCCB3) || // Lo [27] HANGUL SYLLABLE CEOG..HANGUL SYLLABLE CEOH + (0xCCB5 <= code && code <= 0xCCCF) || // Lo [27] HANGUL SYLLABLE CEG..HANGUL SYLLABLE CEH + (0xCCD1 <= code && code <= 0xCCEB) || // Lo [27] HANGUL SYLLABLE CYEOG..HANGUL SYLLABLE CYEOH + (0xCCED <= code && code <= 0xCD07) || // Lo [27] HANGUL SYLLABLE CYEG..HANGUL SYLLABLE CYEH + (0xCD09 <= code && code <= 0xCD23) || // Lo [27] HANGUL SYLLABLE COG..HANGUL SYLLABLE COH + (0xCD25 <= code && code <= 0xCD3F) || // Lo [27] HANGUL SYLLABLE CWAG..HANGUL SYLLABLE CWAH + (0xCD41 <= code && code <= 0xCD5B) || // Lo [27] HANGUL SYLLABLE CWAEG..HANGUL SYLLABLE CWAEH + (0xCD5D <= code && code <= 0xCD77) || // Lo [27] HANGUL SYLLABLE COEG..HANGUL SYLLABLE COEH + (0xCD79 <= code && code <= 0xCD93) || // Lo [27] HANGUL SYLLABLE CYOG..HANGUL SYLLABLE CYOH + (0xCD95 <= code && code <= 0xCDAF) || // Lo [27] HANGUL SYLLABLE CUG..HANGUL SYLLABLE CUH + (0xCDB1 <= code && code <= 0xCDCB) || // Lo [27] HANGUL SYLLABLE CWEOG..HANGUL SYLLABLE CWEOH + (0xCDCD <= code && code <= 0xCDE7) || // Lo [27] HANGUL SYLLABLE CWEG..HANGUL SYLLABLE CWEH + (0xCDE9 <= code && code <= 0xCE03) || // Lo [27] HANGUL SYLLABLE CWIG..HANGUL SYLLABLE CWIH + (0xCE05 <= code && code <= 0xCE1F) || // Lo [27] HANGUL SYLLABLE CYUG..HANGUL SYLLABLE CYUH + (0xCE21 <= code && code <= 0xCE3B) || // Lo [27] HANGUL SYLLABLE CEUG..HANGUL SYLLABLE CEUH + (0xCE3D <= code && code <= 0xCE57) || // Lo [27] HANGUL SYLLABLE CYIG..HANGUL SYLLABLE CYIH + (0xCE59 <= code && code <= 0xCE73) || // Lo [27] HANGUL SYLLABLE CIG..HANGUL SYLLABLE CIH + (0xCE75 <= code && code <= 0xCE8F) || // Lo [27] HANGUL SYLLABLE KAG..HANGUL SYLLABLE KAH + (0xCE91 <= code && code <= 0xCEAB) || // Lo [27] HANGUL SYLLABLE KAEG..HANGUL SYLLABLE KAEH + (0xCEAD <= code && code <= 0xCEC7) || // Lo [27] HANGUL SYLLABLE KYAG..HANGUL SYLLABLE KYAH + (0xCEC9 <= code && code <= 0xCEE3) || // Lo [27] HANGUL SYLLABLE KYAEG..HANGUL SYLLABLE KYAEH + (0xCEE5 <= code && code <= 0xCEFF) || // Lo [27] HANGUL SYLLABLE KEOG..HANGUL SYLLABLE KEOH + (0xCF01 <= code && code <= 0xCF1B) || // Lo [27] HANGUL SYLLABLE KEG..HANGUL SYLLABLE KEH + (0xCF1D <= code && code <= 0xCF37) || // Lo [27] HANGUL SYLLABLE KYEOG..HANGUL SYLLABLE KYEOH + (0xCF39 <= code && code <= 0xCF53) || // Lo [27] HANGUL SYLLABLE KYEG..HANGUL SYLLABLE KYEH + (0xCF55 <= code && code <= 0xCF6F) || // Lo [27] HANGUL SYLLABLE KOG..HANGUL SYLLABLE KOH + (0xCF71 <= code && code <= 0xCF8B) || // Lo [27] HANGUL SYLLABLE KWAG..HANGUL SYLLABLE KWAH + (0xCF8D <= code && code <= 0xCFA7) || // Lo [27] HANGUL SYLLABLE KWAEG..HANGUL SYLLABLE KWAEH + (0xCFA9 <= code && code <= 0xCFC3) || // Lo [27] HANGUL SYLLABLE KOEG..HANGUL SYLLABLE KOEH + (0xCFC5 <= code && code <= 0xCFDF) || // Lo [27] HANGUL SYLLABLE KYOG..HANGUL SYLLABLE KYOH + (0xCFE1 <= code && code <= 0xCFFB) || // Lo [27] HANGUL SYLLABLE KUG..HANGUL SYLLABLE KUH + (0xCFFD <= code && code <= 0xD017) || // Lo [27] HANGUL SYLLABLE KWEOG..HANGUL SYLLABLE KWEOH + (0xD019 <= code && code <= 0xD033) || // Lo [27] HANGUL SYLLABLE KWEG..HANGUL SYLLABLE KWEH + (0xD035 <= code && code <= 0xD04F) || // Lo [27] HANGUL SYLLABLE KWIG..HANGUL SYLLABLE KWIH + (0xD051 <= code && code <= 0xD06B) || // Lo [27] HANGUL SYLLABLE KYUG..HANGUL SYLLABLE KYUH + (0xD06D <= code && code <= 0xD087) || // Lo [27] HANGUL SYLLABLE KEUG..HANGUL SYLLABLE KEUH + (0xD089 <= code && code <= 0xD0A3) || // Lo [27] HANGUL SYLLABLE KYIG..HANGUL SYLLABLE KYIH + (0xD0A5 <= code && code <= 0xD0BF) || // Lo [27] HANGUL SYLLABLE KIG..HANGUL SYLLABLE KIH + (0xD0C1 <= code && code <= 0xD0DB) || // Lo [27] HANGUL SYLLABLE TAG..HANGUL SYLLABLE TAH + (0xD0DD <= code && code <= 0xD0F7) || // Lo [27] HANGUL SYLLABLE TAEG..HANGUL SYLLABLE TAEH + (0xD0F9 <= code && code <= 0xD113) || // Lo [27] HANGUL SYLLABLE TYAG..HANGUL SYLLABLE TYAH + (0xD115 <= code && code <= 0xD12F) || // Lo [27] HANGUL SYLLABLE TYAEG..HANGUL SYLLABLE TYAEH + (0xD131 <= code && code <= 0xD14B) || // Lo [27] HANGUL SYLLABLE TEOG..HANGUL SYLLABLE TEOH + (0xD14D <= code && code <= 0xD167) || // Lo [27] HANGUL SYLLABLE TEG..HANGUL SYLLABLE TEH + (0xD169 <= code && code <= 0xD183) || // Lo [27] HANGUL SYLLABLE TYEOG..HANGUL SYLLABLE TYEOH + (0xD185 <= code && code <= 0xD19F) || // Lo [27] HANGUL SYLLABLE TYEG..HANGUL SYLLABLE TYEH + (0xD1A1 <= code && code <= 0xD1BB) || // Lo [27] HANGUL SYLLABLE TOG..HANGUL SYLLABLE TOH + (0xD1BD <= code && code <= 0xD1D7) || // Lo [27] HANGUL SYLLABLE TWAG..HANGUL SYLLABLE TWAH + (0xD1D9 <= code && code <= 0xD1F3) || // Lo [27] HANGUL SYLLABLE TWAEG..HANGUL SYLLABLE TWAEH + (0xD1F5 <= code && code <= 0xD20F) || // Lo [27] HANGUL SYLLABLE TOEG..HANGUL SYLLABLE TOEH + (0xD211 <= code && code <= 0xD22B) || // Lo [27] HANGUL SYLLABLE TYOG..HANGUL SYLLABLE TYOH + (0xD22D <= code && code <= 0xD247) || // Lo [27] HANGUL SYLLABLE TUG..HANGUL SYLLABLE TUH + (0xD249 <= code && code <= 0xD263) || // Lo [27] HANGUL SYLLABLE TWEOG..HANGUL SYLLABLE TWEOH + (0xD265 <= code && code <= 0xD27F) || // Lo [27] HANGUL SYLLABLE TWEG..HANGUL SYLLABLE TWEH + (0xD281 <= code && code <= 0xD29B) || // Lo [27] HANGUL SYLLABLE TWIG..HANGUL SYLLABLE TWIH + (0xD29D <= code && code <= 0xD2B7) || // Lo [27] HANGUL SYLLABLE TYUG..HANGUL SYLLABLE TYUH + (0xD2B9 <= code && code <= 0xD2D3) || // Lo [27] HANGUL SYLLABLE TEUG..HANGUL SYLLABLE TEUH + (0xD2D5 <= code && code <= 0xD2EF) || // Lo [27] HANGUL SYLLABLE TYIG..HANGUL SYLLABLE TYIH + (0xD2F1 <= code && code <= 0xD30B) || // Lo [27] HANGUL SYLLABLE TIG..HANGUL SYLLABLE TIH + (0xD30D <= code && code <= 0xD327) || // Lo [27] HANGUL SYLLABLE PAG..HANGUL SYLLABLE PAH + (0xD329 <= code && code <= 0xD343) || // Lo [27] HANGUL SYLLABLE PAEG..HANGUL SYLLABLE PAEH + (0xD345 <= code && code <= 0xD35F) || // Lo [27] HANGUL SYLLABLE PYAG..HANGUL SYLLABLE PYAH + (0xD361 <= code && code <= 0xD37B) || // Lo [27] HANGUL SYLLABLE PYAEG..HANGUL SYLLABLE PYAEH + (0xD37D <= code && code <= 0xD397) || // Lo [27] HANGUL SYLLABLE PEOG..HANGUL SYLLABLE PEOH + (0xD399 <= code && code <= 0xD3B3) || // Lo [27] HANGUL SYLLABLE PEG..HANGUL SYLLABLE PEH + (0xD3B5 <= code && code <= 0xD3CF) || // Lo [27] HANGUL SYLLABLE PYEOG..HANGUL SYLLABLE PYEOH + (0xD3D1 <= code && code <= 0xD3EB) || // Lo [27] HANGUL SYLLABLE PYEG..HANGUL SYLLABLE PYEH + (0xD3ED <= code && code <= 0xD407) || // Lo [27] HANGUL SYLLABLE POG..HANGUL SYLLABLE POH + (0xD409 <= code && code <= 0xD423) || // Lo [27] HANGUL SYLLABLE PWAG..HANGUL SYLLABLE PWAH + (0xD425 <= code && code <= 0xD43F) || // Lo [27] HANGUL SYLLABLE PWAEG..HANGUL SYLLABLE PWAEH + (0xD441 <= code && code <= 0xD45B) || // Lo [27] HANGUL SYLLABLE POEG..HANGUL SYLLABLE POEH + (0xD45D <= code && code <= 0xD477) || // Lo [27] HANGUL SYLLABLE PYOG..HANGUL SYLLABLE PYOH + (0xD479 <= code && code <= 0xD493) || // Lo [27] HANGUL SYLLABLE PUG..HANGUL SYLLABLE PUH + (0xD495 <= code && code <= 0xD4AF) || // Lo [27] HANGUL SYLLABLE PWEOG..HANGUL SYLLABLE PWEOH + (0xD4B1 <= code && code <= 0xD4CB) || // Lo [27] HANGUL SYLLABLE PWEG..HANGUL SYLLABLE PWEH + (0xD4CD <= code && code <= 0xD4E7) || // Lo [27] HANGUL SYLLABLE PWIG..HANGUL SYLLABLE PWIH + (0xD4E9 <= code && code <= 0xD503) || // Lo [27] HANGUL SYLLABLE PYUG..HANGUL SYLLABLE PYUH + (0xD505 <= code && code <= 0xD51F) || // Lo [27] HANGUL SYLLABLE PEUG..HANGUL SYLLABLE PEUH + (0xD521 <= code && code <= 0xD53B) || // Lo [27] HANGUL SYLLABLE PYIG..HANGUL SYLLABLE PYIH + (0xD53D <= code && code <= 0xD557) || // Lo [27] HANGUL SYLLABLE PIG..HANGUL SYLLABLE PIH + (0xD559 <= code && code <= 0xD573) || // Lo [27] HANGUL SYLLABLE HAG..HANGUL SYLLABLE HAH + (0xD575 <= code && code <= 0xD58F) || // Lo [27] HANGUL SYLLABLE HAEG..HANGUL SYLLABLE HAEH + (0xD591 <= code && code <= 0xD5AB) || // Lo [27] HANGUL SYLLABLE HYAG..HANGUL SYLLABLE HYAH + (0xD5AD <= code && code <= 0xD5C7) || // Lo [27] HANGUL SYLLABLE HYAEG..HANGUL SYLLABLE HYAEH + (0xD5C9 <= code && code <= 0xD5E3) || // Lo [27] HANGUL SYLLABLE HEOG..HANGUL SYLLABLE HEOH + (0xD5E5 <= code && code <= 0xD5FF) || // Lo [27] HANGUL SYLLABLE HEG..HANGUL SYLLABLE HEH + (0xD601 <= code && code <= 0xD61B) || // Lo [27] HANGUL SYLLABLE HYEOG..HANGUL SYLLABLE HYEOH + (0xD61D <= code && code <= 0xD637) || // Lo [27] HANGUL SYLLABLE HYEG..HANGUL SYLLABLE HYEH + (0xD639 <= code && code <= 0xD653) || // Lo [27] HANGUL SYLLABLE HOG..HANGUL SYLLABLE HOH + (0xD655 <= code && code <= 0xD66F) || // Lo [27] HANGUL SYLLABLE HWAG..HANGUL SYLLABLE HWAH + (0xD671 <= code && code <= 0xD68B) || // Lo [27] HANGUL SYLLABLE HWAEG..HANGUL SYLLABLE HWAEH + (0xD68D <= code && code <= 0xD6A7) || // Lo [27] HANGUL SYLLABLE HOEG..HANGUL SYLLABLE HOEH + (0xD6A9 <= code && code <= 0xD6C3) || // Lo [27] HANGUL SYLLABLE HYOG..HANGUL SYLLABLE HYOH + (0xD6C5 <= code && code <= 0xD6DF) || // Lo [27] HANGUL SYLLABLE HUG..HANGUL SYLLABLE HUH + (0xD6E1 <= code && code <= 0xD6FB) || // Lo [27] HANGUL SYLLABLE HWEOG..HANGUL SYLLABLE HWEOH + (0xD6FD <= code && code <= 0xD717) || // Lo [27] HANGUL SYLLABLE HWEG..HANGUL SYLLABLE HWEH + (0xD719 <= code && code <= 0xD733) || // Lo [27] HANGUL SYLLABLE HWIG..HANGUL SYLLABLE HWIH + (0xD735 <= code && code <= 0xD74F) || // Lo [27] HANGUL SYLLABLE HYUG..HANGUL SYLLABLE HYUH + (0xD751 <= code && code <= 0xD76B) || // Lo [27] HANGUL SYLLABLE HEUG..HANGUL SYLLABLE HEUH + (0xD76D <= code && code <= 0xD787) || // Lo [27] HANGUL SYLLABLE HYIG..HANGUL SYLLABLE HYIH + (0xD789 <= code && code <= 0xD7A3) // Lo [27] HANGUL SYLLABLE HIG..HANGUL SYLLABLE HIH + ){ + return LVT; + } + + if( + 0x261D == code || // So WHITE UP POINTING INDEX + 0x26F9 == code || // So PERSON WITH BALL + (0x270A <= code && code <= 0x270D) || // So [4] RAISED FIST..WRITING HAND + 0x1F385 == code || // So FATHER CHRISTMAS + (0x1F3C2 <= code && code <= 0x1F3C4) || // So [3] SNOWBOARDER..SURFER + 0x1F3C7 == code || // So HORSE RACING + (0x1F3CA <= code && code <= 0x1F3CC) || // So [3] SWIMMER..GOLFER + (0x1F442 <= code && code <= 0x1F443) || // So [2] EAR..NOSE + (0x1F446 <= code && code <= 0x1F450) || // So [11] WHITE UP POINTING BACKHAND INDEX..OPEN HANDS SIGN + 0x1F46E == code || // So POLICE OFFICER + (0x1F470 <= code && code <= 0x1F478) || // So [9] BRIDE WITH VEIL..PRINCESS + 0x1F47C == code || // So BABY ANGEL + (0x1F481 <= code && code <= 0x1F483) || // So [3] INFORMATION DESK PERSON..DANCER + (0x1F485 <= code && code <= 0x1F487) || // So [3] NAIL POLISH..HAIRCUT + 0x1F4AA == code || // So FLEXED BICEPS + (0x1F574 <= code && code <= 0x1F575) || // So [2] MAN IN BUSINESS SUIT LEVITATING..SLEUTH OR SPY + 0x1F57A == code || // So MAN DANCING + 0x1F590 == code || // So RAISED HAND WITH FINGERS SPLAYED + (0x1F595 <= code && code <= 0x1F596) || // So [2] REVERSED HAND WITH MIDDLE FINGER EXTENDED..RAISED HAND WITH PART BETWEEN MIDDLE AND RING FINGERS + (0x1F645 <= code && code <= 0x1F647) || // So [3] FACE WITH NO GOOD GESTURE..PERSON BOWING DEEPLY + (0x1F64B <= code && code <= 0x1F64F) || // So [5] HAPPY PERSON RAISING ONE HAND..PERSON WITH FOLDED HANDS + 0x1F6A3 == code || // So ROWBOAT + (0x1F6B4 <= code && code <= 0x1F6B6) || // So [3] BICYCLIST..PEDESTRIAN + 0x1F6C0 == code || // So BATH + 0x1F6CC == code || // So SLEEPING ACCOMMODATION + (0x1F918 <= code && code <= 0x1F91C) || // So [5] SIGN OF THE HORNS..RIGHT-FACING FIST + (0x1F91E <= code && code <= 0x1F91F) || // So [2] HAND WITH INDEX AND MIDDLE FINGERS CROSSED..I LOVE YOU HAND SIGN + 0x1F926 == code || // So FACE PALM + (0x1F930 <= code && code <= 0x1F939) || // So [10] PREGNANT WOMAN..JUGGLING + (0x1F93D <= code && code <= 0x1F93E) || // So [2] WATER POLO..HANDBALL + (0x1F9D1 <= code && code <= 0x1F9DD) // So [13] ADULT..ELF + ){ + return E_Base; + } + + if( + (0x1F3FB <= code && code <= 0x1F3FF) // Sk [5] EMOJI MODIFIER FITZPATRICK TYPE-1-2..EMOJI MODIFIER FITZPATRICK TYPE-6 + ){ + return E_Modifier; + } + + if( + 0x200D == code // Cf ZERO WIDTH JOINER + ){ + return ZWJ; + } + + if( + 0x2640 == code || // So FEMALE SIGN + 0x2642 == code || // So MALE SIGN + (0x2695 <= code && code <= 0x2696) || // So [2] STAFF OF AESCULAPIUS..SCALES + 0x2708 == code || // So AIRPLANE + 0x2764 == code || // So HEAVY BLACK HEART + 0x1F308 == code || // So RAINBOW + 0x1F33E == code || // So EAR OF RICE + 0x1F373 == code || // So COOKING + 0x1F393 == code || // So GRADUATION CAP + 0x1F3A4 == code || // So MICROPHONE + 0x1F3A8 == code || // So ARTIST PALETTE + 0x1F3EB == code || // So SCHOOL + 0x1F3ED == code || // So FACTORY + 0x1F48B == code || // So KISS MARK + (0x1F4BB <= code && code <= 0x1F4BC) || // So [2] PERSONAL COMPUTER..BRIEFCASE + 0x1F527 == code || // So WRENCH + 0x1F52C == code || // So MICROSCOPE + 0x1F5E8 == code || // So LEFT SPEECH BUBBLE + 0x1F680 == code || // So ROCKET + 0x1F692 == code // So FIRE ENGINE + ){ + return Glue_After_Zwj; + } + + if( + (0x1F466 <= code && code <= 0x1F469) // So [4] BOY..WOMAN + ){ + return E_Base_GAZ; + } + + + //all unlisted characters have a grapheme break property of "Other" + return Other; + } + return this; +} + +var graphemeSplitter = GraphemeSplitter; + +var extractors$2 = createCommonjsModule(function (module, exports) { +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); + + + +const splitter = new graphemeSplitter(); +class ChoiceExtractor { + constructor(config) { + this.config = config; + } + extract(source) { + let results = new Array(); + let trimmedSource = source.toLowerCase(); + if (recognizersText.StringUtility.isNullOrWhitespace(source)) { + return results; + } + let partialResults = new Array(); + let sourceTokens = this.tokenize(trimmedSource); + this.config.regexesMap.forEach((typeExtracted, regex) => { + recognizersText.RegExpUtility.getMatches(regex, trimmedSource).forEach(match => { + let matchTokens = this.tokenize(match.value); + let topScore = sourceTokens + .map((sToken, index) => this.matchValue(sourceTokens, matchTokens, index)) + .reduce((top, value) => top = Math.max(top, value), 0.0); + if (topScore > 0.0) { + let start = match.index; + let length = match.length; + let text = source.substr(start, length).trim(); + partialResults.push({ + start: start, + length: length, + text: text, + type: typeExtracted, + data: { + source: source, + score: topScore + } + }); + } + }); + }); + if (partialResults.length === 0) { + return results; + } + partialResults = partialResults.sort((a, b) => a.start - b.start); + if (this.config.onlyTopMatch) { + let topResult = partialResults.reduce((top, value) => top = top.data.score < value.data.score ? value : top, partialResults[0]); + topResult.data.otherMatches = partialResults.filter(r => r !== topResult); + results.push(topResult); + } + else { + results = partialResults; + } + return results; + } + matchValue(source, match, startPos) { + let matched = 0; + let totalDeviation = 0; + match.forEach(matchToken => { + let pos = source.indexOf(matchToken, startPos); + if (pos >= 0) { + let distance = matched > 0 ? pos - startPos : 0; + if (distance <= this.config.maxDistance) { + matched++; + totalDeviation += distance; + startPos = pos + 1; + } + } + }); + let score = 0.0; + if (matched > 0 && (matched === match.length || this.config.allowPartialMatch)) { + let completeness = matched / match.length; + let accuracy = completeness * (matched / (matched + totalDeviation)); + let initialScore = accuracy * (matched / source.length); + score = 0.4 + (0.6 * initialScore); + } + return score; + } + tokenize(source) { + let tokens = []; + let chars = splitter.splitGraphemes(source); + let token = ''; + chars.forEach(c => { + let codePoint = c.codePointAt(0) || c.charAt(0); + if (codePoint > 0xFFFF) { + // Character is in a Supplementary Unicode Plane. This is where emoji live so + // we're going to just break each character in this range out as its own token. + tokens.push(c); + if (!recognizersText.StringUtility.isNullOrWhitespace(token)) { + tokens.push(token); + token = ''; + } + } + else if (!(this.config.tokenRegex.test(c) || recognizersText.StringUtility.isWhitespace(c))) { + token = token.concat(c); + } + else if (!recognizersText.StringUtility.isNullOrWhitespace(token)) { + tokens.push(token); + token = ''; + } + }); + if (!recognizersText.StringUtility.isNullOrWhitespace(token)) { + tokens.push(token); + token = ''; + } + return tokens; + } +} +exports.ChoiceExtractor = ChoiceExtractor; +class BooleanExtractor extends ChoiceExtractor { + constructor(config) { + let regexesMap = new Map() + .set(config.regexTrue, constants.Constants.SYS_BOOLEAN_TRUE) + .set(config.regexFalse, constants.Constants.SYS_BOOLEAN_FALSE); + let optionsConfig = { + regexesMap: regexesMap, + tokenRegex: config.tokenRegex, + allowPartialMatch: false, + maxDistance: 2, + onlyTopMatch: config.onlyTopMatch + }; + super(optionsConfig); + this.extractType = constants.Constants.SYS_BOOLEAN; + } +} +BooleanExtractor.booleanTrue = constants.Constants.SYS_BOOLEAN_TRUE; +BooleanExtractor.booleanFalse = constants.Constants.SYS_BOOLEAN_FALSE; +exports.BooleanExtractor = BooleanExtractor; + +}); + +unwrapExports(extractors$2); + +var parsers$2 = createCommonjsModule(function (module, exports) { +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); + + +class ChoiceParser { + constructor(config) { + this.config = config; + } + parse(extResult) { + let result = new recognizersText.ParseResult(extResult); + result.value = this.config.resolutions.get(result.type); + if (result.data.otherMatches) { + result.data.otherMatches = result.data.otherMatches.map(m => { + let r = new recognizersText.ParseResult(m); + r.value = this.config.resolutions.get(r.type); + return r; + }); + } + return result; + } +} +exports.ChoiceParser = ChoiceParser; +class BooleanParser extends ChoiceParser { + constructor() { + let resolutions = new Map([ + [constants.Constants.SYS_BOOLEAN_TRUE, true], + [constants.Constants.SYS_BOOLEAN_FALSE, false] + ]); + let config = { + resolutions: resolutions + }; + super(config); + } +} +exports.BooleanParser = BooleanParser; + +}); + +unwrapExports(parsers$2); + +var englishChoice = createCommonjsModule(function (module, exports) { +"use strict"; +// ------------------------------------------------------------------------------ +// +// This code was generated by a tool. +// Changes to this file may cause incorrect behavior and will be lost if +// the code is regenerated. +// +// ------------------------------------------------------------------------------ +Object.defineProperty(exports, "__esModule", { value: true }); +var EnglishChoice; +(function (EnglishChoice) { + EnglishChoice.LangMarker = 'Eng'; + EnglishChoice.TokenizerRegex = `[^\\w\\d]`; + EnglishChoice.TrueRegex = `\\b(true|yes|yep|y|sure|ok|agree)\\b|(\\uD83D\\uDC4D|\\uD83D\\uDC4C)`; + EnglishChoice.FalseRegex = `\\b(false|nope|nop|no|not\\s+ok|disagree)\\b|(\\uD83D\\uDC4E|\\u270B|\\uD83D\\uDD90)`; +})(EnglishChoice = exports.EnglishChoice || (exports.EnglishChoice = {})); + +}); + +unwrapExports(englishChoice); + +var boolean_1 = createCommonjsModule(function (module, exports) { +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); + + +class EnglishBooleanExtractorConfiguration { + constructor(onlyTopMatch = true) { + this.regexTrue = recognizersText.RegExpUtility.getSafeRegExp(englishChoice.EnglishChoice.TrueRegex); + this.regexFalse = recognizersText.RegExpUtility.getSafeRegExp(englishChoice.EnglishChoice.FalseRegex); + this.tokenRegex = recognizersText.RegExpUtility.getSafeRegExp(englishChoice.EnglishChoice.TokenizerRegex, 'is'); + this.onlyTopMatch = onlyTopMatch; + } +} +exports.EnglishBooleanExtractorConfiguration = EnglishBooleanExtractorConfiguration; + +}); + +unwrapExports(boolean_1); + +var frenchChoice = createCommonjsModule(function (module, exports) { +"use strict"; +// ------------------------------------------------------------------------------ +// +// This code was generated by a tool. +// Changes to this file may cause incorrect behavior and will be lost if +// the code is regenerated. +// +// ------------------------------------------------------------------------------ +Object.defineProperty(exports, "__esModule", { value: true }); +var FrenchChoice; +(function (FrenchChoice) { + FrenchChoice.LangMarker = 'Fr'; + FrenchChoice.TokenizerRegex = `[^\\w\\d\\u00E0-\\u00FC]`; + FrenchChoice.TrueRegex = `\\b(s[uû]r|ouais|oui|yep|y|sure|approuver|accepter|consentir|d'accord|ça march[eé])\\b|(\\uD83D\\uDC4D|\\uD83D\\uDC4C)`; + FrenchChoice.FalseRegex = `\\b(faux|nan|non|pas\\s+d'accord|pas\\s+concorder|n'est\\s+pas\\s+(correct|ok)|pas)\\b|(\\uD83D\\uDC4E|\\u270B|\\uD83D\\uDD90)`; +})(FrenchChoice = exports.FrenchChoice || (exports.FrenchChoice = {})); + +}); + +unwrapExports(frenchChoice); + +var boolean_1$1 = createCommonjsModule(function (module, exports) { +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); + + +class FrenchBooleanExtractorConfiguration { + constructor(onlyTopMatch = true) { + this.regexTrue = recognizersText.RegExpUtility.getSafeRegExp(frenchChoice.FrenchChoice.TrueRegex); + this.regexFalse = recognizersText.RegExpUtility.getSafeRegExp(frenchChoice.FrenchChoice.FalseRegex); + this.tokenRegex = recognizersText.RegExpUtility.getSafeRegExp(frenchChoice.FrenchChoice.TokenizerRegex, 'is'); + this.onlyTopMatch = onlyTopMatch; + } +} +exports.FrenchBooleanExtractorConfiguration = FrenchBooleanExtractorConfiguration; + +}); + +unwrapExports(boolean_1$1); + +var germanChoice = createCommonjsModule(function (module, exports) { +"use strict"; +// ------------------------------------------------------------------------------ +// +// This code was generated by a tool. +// Changes to this file may cause incorrect behavior and will be lost if +// the code is regenerated. +// +// ------------------------------------------------------------------------------ +Object.defineProperty(exports, "__esModule", { value: true }); +var GermanChoice; +(function (GermanChoice) { + GermanChoice.LangMarker = 'Ger'; + GermanChoice.TokenizerRegex = `[^\\w\\d\\u00E0-\\u00FC]`; + GermanChoice.TrueRegex = `\\b(wahr|ja|jep|j|sicher|ok|einverstanden|mit\\s+Sicherheit|sicherlich|jap|mache ich)\\b|(\\uD83D\\uDC4D|\\uD83D\\uDC4C)`; + GermanChoice.FalseRegex = `\\b(falsch|nein|ne|nö|nicht\\s+ok|nicht\\s+einverstanden|n)\\b|(\\uD83D\\uDC4E|\\u270B|\\uD83D\\uDD90)`; +})(GermanChoice = exports.GermanChoice || (exports.GermanChoice = {})); + +}); + +unwrapExports(germanChoice); + +var boolean_1$2 = createCommonjsModule(function (module, exports) { +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); + + +class GermanBooleanExtractorConfiguration { + constructor(onlyTopMatch = true) { + this.regexTrue = recognizersText.RegExpUtility.getSafeRegExp(germanChoice.GermanChoice.TrueRegex); + this.regexFalse = recognizersText.RegExpUtility.getSafeRegExp(germanChoice.GermanChoice.FalseRegex); + this.tokenRegex = recognizersText.RegExpUtility.getSafeRegExp(germanChoice.GermanChoice.TokenizerRegex, 'is'); + this.onlyTopMatch = onlyTopMatch; + } +} +exports.GermanBooleanExtractorConfiguration = GermanBooleanExtractorConfiguration; + +}); + +unwrapExports(boolean_1$2); + +var japaneseChoice = createCommonjsModule(function (module, exports) { +"use strict"; +// ------------------------------------------------------------------------------ +// +// This code was generated by a tool. +// Changes to this file may cause incorrect behavior and will be lost if +// the code is regenerated. +// +// ------------------------------------------------------------------------------ +Object.defineProperty(exports, "__esModule", { value: true }); +var JapaneseChoice; +(function (JapaneseChoice) { + JapaneseChoice.LangMarker = 'Jpn'; + JapaneseChoice.TokenizerRegex = `[^\\w\\d\\u3040-\\u309f\\u30a0-\\u30ff\\uff00-\\uff9f\\u4e00-\\u9faf\\u3400-\\u4dbf]`; + JapaneseChoice.TrueRegex = `(はい(!)*|そうです|よい(です)*)|(\\uD83D\\uDC4D|\\uD83D\\uDC4C)`; + JapaneseChoice.FalseRegex = `(いいえ|ではありません|ではない|じゃない|じゃありません)|(\\uD83D\\uDC4E|\\u270B|\\uD83D\\uDD90)`; +})(JapaneseChoice = exports.JapaneseChoice || (exports.JapaneseChoice = {})); + +}); + +unwrapExports(japaneseChoice); + +var boolean_1$3 = createCommonjsModule(function (module, exports) { +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); + + +class JapaneseBooleanExtractorConfiguration { + constructor(onlyTopMatch = true) { + this.regexTrue = recognizersText.RegExpUtility.getSafeRegExp(japaneseChoice.JapaneseChoice.TrueRegex); + this.regexFalse = recognizersText.RegExpUtility.getSafeRegExp(japaneseChoice.JapaneseChoice.FalseRegex); + this.tokenRegex = recognizersText.RegExpUtility.getSafeRegExp(japaneseChoice.JapaneseChoice.TokenizerRegex, 'is'); + this.onlyTopMatch = onlyTopMatch; + } +} +exports.JapaneseBooleanExtractorConfiguration = JapaneseBooleanExtractorConfiguration; + +}); + +unwrapExports(boolean_1$3); + +var portugueseChoice = createCommonjsModule(function (module, exports) { +"use strict"; +// ------------------------------------------------------------------------------ +// +// This code was generated by a tool. +// Changes to this file may cause incorrect behavior and will be lost if +// the code is regenerated. +// +// ------------------------------------------------------------------------------ +Object.defineProperty(exports, "__esModule", { value: true }); +var PortugueseChoice; +(function (PortugueseChoice) { + PortugueseChoice.LangMarker = 'Por'; + PortugueseChoice.TokenizerRegex = `[^\\w\\d\\u00E0-\\u00FC]`; + PortugueseChoice.TrueRegex = `\\b(verdade|verdadeir[oa]|sim|isso|claro|ok)\\b|(\\uD83D\\uDC4D|\\uD83D\\uDC4C)`; + PortugueseChoice.FalseRegex = `\\b(falso|n[aã]o|incorreto|nada disso)\\b|(\\uD83D\\uDC4E|\\u270B|\\uD83D\\uDD90)`; +})(PortugueseChoice = exports.PortugueseChoice || (exports.PortugueseChoice = {})); + +}); + +unwrapExports(portugueseChoice); + +var boolean_1$4 = createCommonjsModule(function (module, exports) { +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); + + +class PortugueseBooleanExtractorConfiguration { + constructor(onlyTopMatch = true) { + this.regexTrue = recognizersText.RegExpUtility.getSafeRegExp(portugueseChoice.PortugueseChoice.TrueRegex); + this.regexFalse = recognizersText.RegExpUtility.getSafeRegExp(portugueseChoice.PortugueseChoice.FalseRegex); + this.tokenRegex = recognizersText.RegExpUtility.getSafeRegExp(portugueseChoice.PortugueseChoice.TokenizerRegex, 'is'); + this.onlyTopMatch = onlyTopMatch; + } +} +exports.PortugueseBooleanExtractorConfiguration = PortugueseBooleanExtractorConfiguration; + +}); + +unwrapExports(boolean_1$4); + +var spanishChoice = createCommonjsModule(function (module, exports) { +"use strict"; +// ------------------------------------------------------------------------------ +// +// This code was generated by a tool. +// Changes to this file may cause incorrect behavior and will be lost if +// the code is regenerated. +// +// ------------------------------------------------------------------------------ +Object.defineProperty(exports, "__esModule", { value: true }); +var SpanishChoice; +(function (SpanishChoice) { + SpanishChoice.LangMarker = 'Spa'; + SpanishChoice.TokenizerRegex = `[^\\w\\d\\u00E0-\\u00FC]`; + SpanishChoice.TrueRegex = `\\b(verdad|verdadero|sí|sip|s|si|cierto|por supuesto|ok)\\b|(\\uD83D\\uDC4D|\\uD83D\\uDC4C)`; + SpanishChoice.FalseRegex = `\\b(falso|no|nop|n|no)\\b|(\\uD83D\\uDC4E|\\u270B|\\uD83D\\uDD90)`; +})(SpanishChoice = exports.SpanishChoice || (exports.SpanishChoice = {})); + +}); + +unwrapExports(spanishChoice); + +var boolean_1$5 = createCommonjsModule(function (module, exports) { +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); + + +class SpanishBooleanExtractorConfiguration { + constructor(onlyTopMatch = true) { + this.regexTrue = recognizersText.RegExpUtility.getSafeRegExp(spanishChoice.SpanishChoice.TrueRegex); + this.regexFalse = recognizersText.RegExpUtility.getSafeRegExp(spanishChoice.SpanishChoice.FalseRegex); + this.tokenRegex = recognizersText.RegExpUtility.getSafeRegExp(spanishChoice.SpanishChoice.TokenizerRegex, 'is'); + this.onlyTopMatch = onlyTopMatch; + } +} +exports.SpanishBooleanExtractorConfiguration = SpanishBooleanExtractorConfiguration; + +}); + +unwrapExports(boolean_1$5); + +var chineseChoice = createCommonjsModule(function (module, exports) { +"use strict"; +// ------------------------------------------------------------------------------ +// +// This code was generated by a tool. +// Changes to this file may cause incorrect behavior and will be lost if +// the code is regenerated. +// +// ------------------------------------------------------------------------------ +Object.defineProperty(exports, "__esModule", { value: true }); +var ChineseChoice; +(function (ChineseChoice) { + ChineseChoice.LangMarker = 'Chs'; + ChineseChoice.TokenizerRegex = `[^\\u3040-\\u30ff\\u3400-\\u4dbf\\u4e00-\\u9fff\\uf900-\\ufaff\\uff66-\\uff9f]`; + ChineseChoice.TrueRegex = `(好[的啊呀嘞哇]|没问题|可以|中|好|同意|行|是的|是|对)|(\\uD83D\\uDC4D|\\uD83D\\uDC4C)`; + ChineseChoice.FalseRegex = `(不行|不好|拒绝|否定|不中|不可以|不是的|不是|不对|不)|(\\uD83D\\uDC4E|\\u270B|\\uD83D\\uDD90)`; +})(ChineseChoice = exports.ChineseChoice || (exports.ChineseChoice = {})); + +}); + +unwrapExports(chineseChoice); + +var boolean_1$6 = createCommonjsModule(function (module, exports) { +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); + + +class ChineseBooleanExtractorConfiguration { + constructor(onlyTopMatch = true) { + this.regexTrue = recognizersText.RegExpUtility.getSafeRegExp(chineseChoice.ChineseChoice.TrueRegex); + this.regexFalse = recognizersText.RegExpUtility.getSafeRegExp(chineseChoice.ChineseChoice.FalseRegex); + this.tokenRegex = recognizersText.RegExpUtility.getSafeRegExp(chineseChoice.ChineseChoice.TokenizerRegex, 'is'); + this.onlyTopMatch = onlyTopMatch; + } +} +exports.ChineseBooleanExtractorConfiguration = ChineseBooleanExtractorConfiguration; + +}); + +unwrapExports(boolean_1$6); + +var choiceRecognizer = createCommonjsModule(function (module, exports) { +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); + + + + + + + + + + + +var ChoiceOptions; +(function (ChoiceOptions) { + ChoiceOptions[ChoiceOptions["None"] = 0] = "None"; +})(ChoiceOptions = exports.ChoiceOptions || (exports.ChoiceOptions = {})); +function recognizeBoolean(query, culture, options = ChoiceOptions.None, fallbackToDefaultCulture = true) { + let recognizer = new ChoiceRecognizer(culture, options); + let model = recognizer.getBooleanModel(culture, fallbackToDefaultCulture); + return model.parse(query); +} +exports.recognizeBoolean = recognizeBoolean; +class ChoiceRecognizer extends recognizersText.Recognizer { + constructor(culture, options = ChoiceOptions.None, lazyInitialization = false) { + super(culture, options, lazyInitialization); + } + InitializeConfiguration() { + //#region English + this.registerModel("BooleanModel", recognizersText.Culture.English, (options) => new models$2.BooleanModel(new parsers$2.BooleanParser(), new extractors$2.BooleanExtractor(new boolean_1.EnglishBooleanExtractorConfiguration()))); + //#endregion + //#region Japanese + this.registerModel("BooleanModel", recognizersText.Culture.Japanese, (options) => new models$2.BooleanModel(new parsers$2.BooleanParser(), new extractors$2.BooleanExtractor(new boolean_1$3.JapaneseBooleanExtractorConfiguration()))); + //#endregion + //#region Portuguese + this.registerModel("BooleanModel", recognizersText.Culture.Portuguese, (options) => new models$2.BooleanModel(new parsers$2.BooleanParser(), new extractors$2.BooleanExtractor(new boolean_1$4.PortugueseBooleanExtractorConfiguration()))); + //#endregion + //#region Spanish + this.registerModel("BooleanModel", recognizersText.Culture.Spanish, (options) => new models$2.BooleanModel(new parsers$2.BooleanParser(), new extractors$2.BooleanExtractor(new boolean_1$5.SpanishBooleanExtractorConfiguration()))); + //#endregion + //#region Chinese + this.registerModel("BooleanModel", recognizersText.Culture.Chinese, (options) => new models$2.BooleanModel(new parsers$2.BooleanParser(), new extractors$2.BooleanExtractor(new boolean_1$6.ChineseBooleanExtractorConfiguration()))); + //#endregion + //#region French + this.registerModel("BooleanModel", recognizersText.Culture.French, (options) => new models$2.BooleanModel(new parsers$2.BooleanParser(), new extractors$2.BooleanExtractor(new boolean_1$1.FrenchBooleanExtractorConfiguration()))); + //#endregion + //#region German + this.registerModel("BooleanModel", recognizersText.Culture.German, (options) => new models$2.BooleanModel(new parsers$2.BooleanParser(), new extractors$2.BooleanExtractor(new boolean_1$2.GermanBooleanExtractorConfiguration()))); + //#endregion + } + IsValidOptions(options) { + return options >= 0 && options <= ChoiceOptions.None; + } + getBooleanModel(culture = null, fallbackToDefaultCulture = true) { + return this.getModel("BooleanModel", culture, fallbackToDefaultCulture); + } +} +exports.default = ChoiceRecognizer; + +}); + +unwrapExports(choiceRecognizer); + +var recognizersTextChoice = createCommonjsModule(function (module, exports) { +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); + +exports.ChoiceRecognizer = choiceRecognizer.default; +exports.ChoiceOptions = choiceRecognizer.ChoiceOptions; +exports.recognizeBoolean = choiceRecognizer.recognizeBoolean; + +exports.Culture = recognizersText.Culture; + +exports.Constants = constants.Constants; + +exports.ChoiceModel = models$2.ChoiceModel; +exports.BooleanModel = models$2.BooleanModel; + +exports.ChoiceExtractor = extractors$2.ChoiceExtractor; +exports.BooleanExtractor = extractors$2.BooleanExtractor; + +exports.ChoiceParser = parsers$2.ChoiceParser; +exports.BooleanParser = parsers$2.BooleanParser; + +exports.EnglishBooleanExtractorConfiguration = boolean_1.EnglishBooleanExtractorConfiguration; + +exports.FrenchBooleanExtractorConfiguration = boolean_1$1.FrenchBooleanExtractorConfiguration; + +exports.GermanBooleanExtractorConfiguration = boolean_1$2.GermanBooleanExtractorConfiguration; + +exports.PortugueseBooleanExtractorConfiguration = boolean_1$4.PortugueseBooleanExtractorConfiguration; + +exports.JapaneseBooleanExtractorConfiguration = boolean_1$3.JapaneseBooleanExtractorConfiguration; + +exports.SpanishBooleanExtractorConfiguration = boolean_1$5.SpanishBooleanExtractorConfiguration; + +exports.ChineseBooleanExtractorConfiguration = boolean_1$6.ChineseBooleanExtractorConfiguration; + +exports.EnglishChoice = englishChoice.EnglishChoice; + +exports.FrenchChoice = frenchChoice.FrenchChoice; + +exports.GermanChoice = germanChoice.GermanChoice; + +exports.PortugueseChoice = portugueseChoice.PortugueseChoice; + +exports.JapaneseChoice = japaneseChoice.JapaneseChoice; + +exports.SpanishChoice = spanishChoice.SpanishChoice; + +exports.ChineseChoice = chineseChoice.ChineseChoice; + +}); + +var recognizersTextChoice$1 = unwrapExports(recognizersTextChoice); +var recognizersTextChoice_1 = recognizersTextChoice.ChoiceRecognizer; +var recognizersTextChoice_2 = recognizersTextChoice.ChoiceOptions; +var recognizersTextChoice_3 = recognizersTextChoice.recognizeBoolean; +var recognizersTextChoice_4 = recognizersTextChoice.Culture; +var recognizersTextChoice_5 = recognizersTextChoice.Constants; +var recognizersTextChoice_6 = recognizersTextChoice.ChoiceModel; +var recognizersTextChoice_7 = recognizersTextChoice.BooleanModel; +var recognizersTextChoice_8 = recognizersTextChoice.ChoiceExtractor; +var recognizersTextChoice_9 = recognizersTextChoice.BooleanExtractor; +var recognizersTextChoice_10 = recognizersTextChoice.ChoiceParser; +var recognizersTextChoice_11 = recognizersTextChoice.BooleanParser; +var recognizersTextChoice_12 = recognizersTextChoice.EnglishBooleanExtractorConfiguration; +var recognizersTextChoice_13 = recognizersTextChoice.FrenchBooleanExtractorConfiguration; +var recognizersTextChoice_14 = recognizersTextChoice.GermanBooleanExtractorConfiguration; +var recognizersTextChoice_15 = recognizersTextChoice.PortugueseBooleanExtractorConfiguration; +var recognizersTextChoice_16 = recognizersTextChoice.JapaneseBooleanExtractorConfiguration; +var recognizersTextChoice_17 = recognizersTextChoice.SpanishBooleanExtractorConfiguration; +var recognizersTextChoice_18 = recognizersTextChoice.ChineseBooleanExtractorConfiguration; +var recognizersTextChoice_19 = recognizersTextChoice.EnglishChoice; +var recognizersTextChoice_20 = recognizersTextChoice.FrenchChoice; +var recognizersTextChoice_21 = recognizersTextChoice.GermanChoice; +var recognizersTextChoice_22 = recognizersTextChoice.PortugueseChoice; +var recognizersTextChoice_23 = recognizersTextChoice.JapaneseChoice; +var recognizersTextChoice_24 = recognizersTextChoice.SpanishChoice; +var recognizersTextChoice_25 = recognizersTextChoice.ChineseChoice; + +export { recognizersTextChoice_1 as ChoiceRecognizer, recognizersTextChoice_2 as ChoiceOptions, recognizersTextChoice_3 as recognizeBoolean, recognizersTextChoice_4 as Culture, recognizersTextChoice_5 as Constants, recognizersTextChoice_6 as ChoiceModel, recognizersTextChoice_7 as BooleanModel, recognizersTextChoice_8 as ChoiceExtractor, recognizersTextChoice_9 as BooleanExtractor, recognizersTextChoice_10 as ChoiceParser, recognizersTextChoice_11 as BooleanParser, recognizersTextChoice_12 as EnglishBooleanExtractorConfiguration, recognizersTextChoice_13 as FrenchBooleanExtractorConfiguration, recognizersTextChoice_14 as GermanBooleanExtractorConfiguration, recognizersTextChoice_15 as PortugueseBooleanExtractorConfiguration, recognizersTextChoice_16 as JapaneseBooleanExtractorConfiguration, recognizersTextChoice_17 as SpanishBooleanExtractorConfiguration, recognizersTextChoice_18 as ChineseBooleanExtractorConfiguration, recognizersTextChoice_19 as EnglishChoice, recognizersTextChoice_20 as FrenchChoice, recognizersTextChoice_21 as GermanChoice, recognizersTextChoice_22 as PortugueseChoice, recognizersTextChoice_23 as JapaneseChoice, recognizersTextChoice_24 as SpanishChoice, recognizersTextChoice_25 as ChineseChoice }; +export default recognizersTextChoice$1; +//# sourceMappingURL=recognizers-text-choice.es5.js.map diff --git a/libraries/botbuilder-stdlib/vendors/@microsoft/recognizers-text-choice/dist/recognizers-text-choice.umd.js b/libraries/botbuilder-stdlib/vendors/@microsoft/recognizers-text-choice/dist/recognizers-text-choice.umd.js new file mode 100644 index 0000000000..24db399f5f --- /dev/null +++ b/libraries/botbuilder-stdlib/vendors/@microsoft/recognizers-text-choice/dist/recognizers-text-choice.umd.js @@ -0,0 +1,8775 @@ +(function (global, factory) { + typeof exports === 'object' && typeof module !== 'undefined' ? factory(exports) : + typeof define === 'function' && define.amd ? define(['exports'], factory) : + (factory((global.microsoftRecognizersTextChoice = {}))); +}(this, (function (exports) { 'use strict'; + +function unwrapExports (x) { + return x && x.__esModule && Object.prototype.hasOwnProperty.call(x, 'default') ? x['default'] : x; +} + +function createCommonjsModule(fn, module) { + return module = { exports: {} }, fn(module, module.exports), module.exports; +} + +var culture = createCommonjsModule(function (module, exports) { +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +class Culture { + constructor(cultureName, cultureCode) { + this.cultureName = cultureName; + this.cultureCode = cultureCode; + } + static getSupportedCultureCodes() { + return Culture.supportedCultures.map(c => c.cultureCode); + } + static mapToNearestLanguage(cultureCode) { + if (cultureCode !== undefined) { + cultureCode = cultureCode.toLowerCase(); + var supportedCultureCodes = Culture.getSupportedCultureCodes(); + if (supportedCultureCodes.indexOf(cultureCode) < 0) { + var culturePrefix = cultureCode.split('-')[0].trim(); + supportedCultureCodes.forEach(function (supportedCultureCode) { + if (supportedCultureCode.startsWith(culturePrefix)) { + cultureCode = supportedCultureCode; + } + }); + } + } + return cultureCode; + } +} +Culture.English = "en-us"; +Culture.Chinese = "zh-cn"; +Culture.Spanish = "es-es"; +Culture.Portuguese = "pt-br"; +Culture.French = "fr-fr"; +Culture.German = "de-de"; +Culture.Japanese = "ja-jp"; +Culture.Dutch = "nl-nl"; +Culture.Italian = "it-it"; +Culture.supportedCultures = [ + new Culture("English", Culture.English), + new Culture("Chinese", Culture.Chinese), + new Culture("Spanish", Culture.Spanish), + new Culture("Portuguese", Culture.Portuguese), + new Culture("French", Culture.French), + new Culture("German", Culture.German), + new Culture("Japanese", Culture.Japanese), + new Culture("Dutch", Culture.Dutch), + new Culture("Italian", Culture.Italian) +]; +exports.Culture = Culture; +class CultureInfo { + static getCultureInfo(cultureCode) { + return new CultureInfo(cultureCode); + } + constructor(cultureName) { + this.code = cultureName; + } +} +exports.CultureInfo = CultureInfo; + +}); + +unwrapExports(culture); + +var xregexp = createCommonjsModule(function (module, exports) { +"use strict"; + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.default = void 0; + +function _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _nonIterableRest(); } + +function _nonIterableRest() { throw new TypeError("Invalid attempt to destructure non-iterable instance"); } + +function _iterableToArrayLimit(arr, i) { var _arr = []; var _n = true; var _d = false; var _e = undefined; try { for (var _i = arr[Symbol.iterator](), _s; !(_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; } + +function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; } + +/*! + * XRegExp 4.2.0 + * + * Steven Levithan (c) 2007-present MIT License + */ + +/** + * XRegExp provides augmented, extensible regular expressions. You get additional regex syntax and + * flags, beyond what browsers support natively. XRegExp is also a regex utility belt with tools to + * make your client-side grepping simpler and more powerful, while freeing you from related + * cross-browser inconsistencies. + */ +// ==--------------------------== +// Private stuff +// ==--------------------------== +// Property name used for extended regex instance data +var REGEX_DATA = 'xregexp'; // Optional features that can be installed and uninstalled + +var features = { + astral: false, + namespacing: false +}; // Native methods to use and restore ('native' is an ES3 reserved keyword) + +var nativ = { + exec: RegExp.prototype.exec, + test: RegExp.prototype.test, + match: String.prototype.match, + replace: String.prototype.replace, + split: String.prototype.split +}; // Storage for fixed/extended native methods + +var fixed = {}; // Storage for regexes cached by `XRegExp.cache` + +var regexCache = {}; // Storage for pattern details cached by the `XRegExp` constructor + +var patternCache = {}; // Storage for regex syntax tokens added internally or by `XRegExp.addToken` + +var tokens = []; // Token scopes + +var defaultScope = 'default'; +var classScope = 'class'; // Regexes that match native regex syntax, including octals + +var nativeTokens = { + // Any native multicharacter token in default scope, or any single character + 'default': /\\(?:0(?:[0-3][0-7]{0,2}|[4-7][0-7]?)?|[1-9]\d*|x[\dA-Fa-f]{2}|u(?:[\dA-Fa-f]{4}|{[\dA-Fa-f]+})|c[A-Za-z]|[\s\S])|\(\?(?:[:=!]|<[=!])|[?*+]\?|{\d+(?:,\d*)?}\??|[\s\S]/, + // Any native multicharacter token in character class scope, or any single character + 'class': /\\(?:[0-3][0-7]{0,2}|[4-7][0-7]?|x[\dA-Fa-f]{2}|u(?:[\dA-Fa-f]{4}|{[\dA-Fa-f]+})|c[A-Za-z]|[\s\S])|[\s\S]/ +}; // Any backreference or dollar-prefixed character in replacement strings + +var replacementToken = /\$(?:{([\w$]+)}|<([\w$]+)>|(\d\d?|[\s\S]))/g; // Check for correct `exec` handling of nonparticipating capturing groups + +var correctExecNpcg = nativ.exec.call(/()??/, '')[1] === undefined; // Check for ES6 `flags` prop support + +var hasFlagsProp = /x/.flags !== undefined; // Shortcut to `Object.prototype.toString` + +var _ref = {}, + toString = _ref.toString; + +function hasNativeFlag(flag) { + // Can't check based on the presence of properties/getters since browsers might support such + // properties even when they don't support the corresponding flag in regex construction (tested + // in Chrome 48, where `'unicode' in /x/` is true but trying to construct a regex with flag `u` + // throws an error) + var isSupported = true; + + try { + // Can't use regex literals for testing even in a `try` because regex literals with + // unsupported flags cause a compilation error in IE + new RegExp('', flag); + } catch (exception) { + isSupported = false; + } + + return isSupported; +} // Check for ES6 `u` flag support + + +var hasNativeU = hasNativeFlag('u'); // Check for ES6 `y` flag support + +var hasNativeY = hasNativeFlag('y'); // Tracker for known flags, including addon flags + +var registeredFlags = { + g: true, + i: true, + m: true, + u: hasNativeU, + y: hasNativeY +}; +/** + * Attaches extended data and `XRegExp.prototype` properties to a regex object. + * + * @private + * @param {RegExp} regex Regex to augment. + * @param {Array} captureNames Array with capture names, or `null`. + * @param {String} xSource XRegExp pattern used to generate `regex`, or `null` if N/A. + * @param {String} xFlags XRegExp flags used to generate `regex`, or `null` if N/A. + * @param {Boolean} [isInternalOnly=false] Whether the regex will be used only for internal + * operations, and never exposed to users. For internal-only regexes, we can improve perf by + * skipping some operations like attaching `XRegExp.prototype` properties. + * @returns {RegExp} Augmented regex. + */ + +function augment(regex, captureNames, xSource, xFlags, isInternalOnly) { + regex[REGEX_DATA] = { + captureNames: captureNames + }; + + if (isInternalOnly) { + return regex; + } // Can't auto-inherit these since the XRegExp constructor returns a nonprimitive value + + + if (regex.__proto__) { + regex.__proto__ = XRegExp.prototype; + } else { + for (var p in XRegExp.prototype) { + // An `XRegExp.prototype.hasOwnProperty(p)` check wouldn't be worth it here, since this + // is performance sensitive, and enumerable `Object.prototype` or `RegExp.prototype` + // extensions exist on `regex.prototype` anyway + regex[p] = XRegExp.prototype[p]; + } + } + + regex[REGEX_DATA].source = xSource; // Emulate the ES6 `flags` prop by ensuring flags are in alphabetical order + + regex[REGEX_DATA].flags = xFlags ? xFlags.split('').sort().join('') : xFlags; + return regex; +} +/** + * Removes any duplicate characters from the provided string. + * + * @private + * @param {String} str String to remove duplicate characters from. + * @returns {String} String with any duplicate characters removed. + */ + + +function clipDuplicates(str) { + return nativ.replace.call(str, /([\s\S])(?=[\s\S]*\1)/g, ''); +} +/** + * Copies a regex object while preserving extended data and augmenting with `XRegExp.prototype` + * properties. The copy has a fresh `lastIndex` property (set to zero). Allows adding and removing + * flags g and y while copying the regex. + * + * @private + * @param {RegExp} regex Regex to copy. + * @param {Object} [options] Options object with optional properties: + * - `addG` {Boolean} Add flag g while copying the regex. + * - `addY` {Boolean} Add flag y while copying the regex. + * - `removeG` {Boolean} Remove flag g while copying the regex. + * - `removeY` {Boolean} Remove flag y while copying the regex. + * - `isInternalOnly` {Boolean} Whether the copied regex will be used only for internal + * operations, and never exposed to users. For internal-only regexes, we can improve perf by + * skipping some operations like attaching `XRegExp.prototype` properties. + * - `source` {String} Overrides `.source`, for special cases. + * @returns {RegExp} Copy of the provided regex, possibly with modified flags. + */ + + +function copyRegex(regex, options) { + if (!XRegExp.isRegExp(regex)) { + throw new TypeError('Type RegExp expected'); + } + + var xData = regex[REGEX_DATA] || {}; + var flags = getNativeFlags(regex); + var flagsToAdd = ''; + var flagsToRemove = ''; + var xregexpSource = null; + var xregexpFlags = null; + options = options || {}; + + if (options.removeG) { + flagsToRemove += 'g'; + } + + if (options.removeY) { + flagsToRemove += 'y'; + } + + if (flagsToRemove) { + flags = nativ.replace.call(flags, new RegExp("[".concat(flagsToRemove, "]+"), 'g'), ''); + } + + if (options.addG) { + flagsToAdd += 'g'; + } + + if (options.addY) { + flagsToAdd += 'y'; + } + + if (flagsToAdd) { + flags = clipDuplicates(flags + flagsToAdd); + } + + if (!options.isInternalOnly) { + if (xData.source !== undefined) { + xregexpSource = xData.source; + } // null or undefined; don't want to add to `flags` if the previous value was null, since + // that indicates we're not tracking original precompilation flags + + + if (xData.flags != null) { + // Flags are only added for non-internal regexes by `XRegExp.globalize`. Flags are never + // removed for non-internal regexes, so don't need to handle it + xregexpFlags = flagsToAdd ? clipDuplicates(xData.flags + flagsToAdd) : xData.flags; + } + } // Augment with `XRegExp.prototype` properties, but use the native `RegExp` constructor to avoid + // searching for special tokens. That would be wrong for regexes constructed by `RegExp`, and + // unnecessary for regexes constructed by `XRegExp` because the regex has already undergone the + // translation to native regex syntax + + + regex = augment(new RegExp(options.source || regex.source, flags), hasNamedCapture(regex) ? xData.captureNames.slice(0) : null, xregexpSource, xregexpFlags, options.isInternalOnly); + return regex; +} +/** + * Converts hexadecimal to decimal. + * + * @private + * @param {String} hex + * @returns {Number} + */ + + +function dec(hex) { + return parseInt(hex, 16); +} +/** + * Returns a pattern that can be used in a native RegExp in place of an ignorable token such as an + * inline comment or whitespace with flag x. This is used directly as a token handler function + * passed to `XRegExp.addToken`. + * + * @private + * @param {String} match Match arg of `XRegExp.addToken` handler + * @param {String} scope Scope arg of `XRegExp.addToken` handler + * @param {String} flags Flags arg of `XRegExp.addToken` handler + * @returns {String} Either '' or '(?:)', depending on which is needed in the context of the match. + */ + + +function getContextualTokenSeparator(match, scope, flags) { + if ( // No need to separate tokens if at the beginning or end of a group + match.input[match.index - 1] === '(' || match.input[match.index + match[0].length] === ')' || // No need to separate tokens if before or after a `|` + match.input[match.index - 1] === '|' || match.input[match.index + match[0].length] === '|' || // No need to separate tokens if at the beginning or end of the pattern + match.index < 1 || match.index + match[0].length >= match.input.length || // No need to separate tokens if at the beginning of a noncapturing group or lookahead. + // The way this is written relies on: + // - The search regex matching only 3-char strings. + // - Although `substr` gives chars from the end of the string if given a negative index, + // the resulting substring will be too short to match. Ex: `'abcd'.substr(-1, 3) === 'd'` + nativ.test.call(/^\(\?[:=!]/, match.input.substr(match.index - 3, 3)) || // Avoid separating tokens when the following token is a quantifier + isQuantifierNext(match.input, match.index + match[0].length, flags)) { + return ''; + } // Keep tokens separated. This avoids e.g. inadvertedly changing `\1 1` or `\1(?#)1` to `\11`. + // This also ensures all tokens remain as discrete atoms, e.g. it avoids converting the syntax + // error `(? :` into `(?:`. + + + return '(?:)'; +} +/** + * Returns native `RegExp` flags used by a regex object. + * + * @private + * @param {RegExp} regex Regex to check. + * @returns {String} Native flags in use. + */ + + +function getNativeFlags(regex) { + return hasFlagsProp ? regex.flags : // Explicitly using `RegExp.prototype.toString` (rather than e.g. `String` or concatenation + // with an empty string) allows this to continue working predictably when + // `XRegExp.proptotype.toString` is overridden + nativ.exec.call(/\/([a-z]*)$/i, RegExp.prototype.toString.call(regex))[1]; +} +/** + * Determines whether a regex has extended instance data used to track capture names. + * + * @private + * @param {RegExp} regex Regex to check. + * @returns {Boolean} Whether the regex uses named capture. + */ + + +function hasNamedCapture(regex) { + return !!(regex[REGEX_DATA] && regex[REGEX_DATA].captureNames); +} +/** + * Converts decimal to hexadecimal. + * + * @private + * @param {Number|String} dec + * @returns {String} + */ + + +function hex(dec) { + return parseInt(dec, 10).toString(16); +} +/** + * Checks whether the next nonignorable token after the specified position is a quantifier. + * + * @private + * @param {String} pattern Pattern to search within. + * @param {Number} pos Index in `pattern` to search at. + * @param {String} flags Flags used by the pattern. + * @returns {Boolean} Whether the next nonignorable token is a quantifier. + */ + + +function isQuantifierNext(pattern, pos, flags) { + return nativ.test.call(flags.indexOf('x') !== -1 ? // Ignore any leading whitespace, line comments, and inline comments + /^(?:\s|#[^#\n]*|\(\?#[^)]*\))*(?:[?*+]|{\d+(?:,\d*)?})/ : // Ignore any leading inline comments + /^(?:\(\?#[^)]*\))*(?:[?*+]|{\d+(?:,\d*)?})/, pattern.slice(pos)); +} +/** + * Determines whether a value is of the specified type, by resolving its internal [[Class]]. + * + * @private + * @param {*} value Object to check. + * @param {String} type Type to check for, in TitleCase. + * @returns {Boolean} Whether the object matches the type. + */ + + +function isType(value, type) { + return toString.call(value) === "[object ".concat(type, "]"); +} +/** + * Adds leading zeros if shorter than four characters. Used for fixed-length hexadecimal values. + * + * @private + * @param {String} str + * @returns {String} + */ + + +function pad4(str) { + while (str.length < 4) { + str = "0".concat(str); + } + + return str; +} +/** + * Checks for flag-related errors, and strips/applies flags in a leading mode modifier. Offloads + * the flag preparation logic from the `XRegExp` constructor. + * + * @private + * @param {String} pattern Regex pattern, possibly with a leading mode modifier. + * @param {String} flags Any combination of flags. + * @returns {Object} Object with properties `pattern` and `flags`. + */ + + +function prepareFlags(pattern, flags) { + // Recent browsers throw on duplicate flags, so copy this behavior for nonnative flags + if (clipDuplicates(flags) !== flags) { + throw new SyntaxError("Invalid duplicate regex flag ".concat(flags)); + } // Strip and apply a leading mode modifier with any combination of flags except g or y + + + pattern = nativ.replace.call(pattern, /^\(\?([\w$]+)\)/, function ($0, $1) { + if (nativ.test.call(/[gy]/, $1)) { + throw new SyntaxError("Cannot use flag g or y in mode modifier ".concat($0)); + } // Allow duplicate flags within the mode modifier + + + flags = clipDuplicates(flags + $1); + return ''; + }); // Throw on unknown native or nonnative flags + + var _iteratorNormalCompletion = true; + var _didIteratorError = false; + var _iteratorError = undefined; + + try { + for (var _iterator = flags[Symbol.iterator](), _step; !(_iteratorNormalCompletion = (_step = _iterator.next()).done); _iteratorNormalCompletion = true) { + var flag = _step.value; + + if (!registeredFlags[flag]) { + throw new SyntaxError("Unknown regex flag ".concat(flag)); + } + } + } catch (err) { + _didIteratorError = true; + _iteratorError = err; + } finally { + try { + if (!_iteratorNormalCompletion && _iterator.return != null) { + _iterator.return(); + } + } finally { + if (_didIteratorError) { + throw _iteratorError; + } + } + } + + return { + pattern: pattern, + flags: flags + }; +} +/** + * Prepares an options object from the given value. + * + * @private + * @param {String|Object} value Value to convert to an options object. + * @returns {Object} Options object. + */ + + +function prepareOptions(value) { + var options = {}; + + if (isType(value, 'String')) { + XRegExp.forEach(value, /[^\s,]+/, function (match) { + options[match] = true; + }); + return options; + } + + return value; +} +/** + * Registers a flag so it doesn't throw an 'unknown flag' error. + * + * @private + * @param {String} flag Single-character flag to register. + */ + + +function registerFlag(flag) { + if (!/^[\w$]$/.test(flag)) { + throw new Error('Flag must be a single character A-Za-z0-9_$'); + } + + registeredFlags[flag] = true; +} +/** + * Runs built-in and custom regex syntax tokens in reverse insertion order at the specified + * position, until a match is found. + * + * @private + * @param {String} pattern Original pattern from which an XRegExp object is being built. + * @param {String} flags Flags being used to construct the regex. + * @param {Number} pos Position to search for tokens within `pattern`. + * @param {Number} scope Regex scope to apply: 'default' or 'class'. + * @param {Object} context Context object to use for token handler functions. + * @returns {Object} Object with properties `matchLength`, `output`, and `reparse`; or `null`. + */ + + +function runTokens(pattern, flags, pos, scope, context) { + var i = tokens.length; + var leadChar = pattern[pos]; + var result = null; + var match; + var t; // Run in reverse insertion order + + while (i--) { + t = tokens[i]; + + if (t.leadChar && t.leadChar !== leadChar || t.scope !== scope && t.scope !== 'all' || t.flag && !(flags.indexOf(t.flag) !== -1)) { + continue; + } + + match = XRegExp.exec(pattern, t.regex, pos, 'sticky'); + + if (match) { + result = { + matchLength: match[0].length, + output: t.handler.call(context, match, scope, flags), + reparse: t.reparse + }; // Finished with token tests + + break; + } + } + + return result; +} +/** + * Enables or disables implicit astral mode opt-in. When enabled, flag A is automatically added to + * all new regexes created by XRegExp. This causes an error to be thrown when creating regexes if + * the Unicode Base addon is not available, since flag A is registered by that addon. + * + * @private + * @param {Boolean} on `true` to enable; `false` to disable. + */ + + +function setAstral(on) { + features.astral = on; +} +/** + * Adds named capture groups to the `groups` property of match arrays. See here for details: + * https://github.com/tc39/proposal-regexp-named-groups + * + * @private + * @param {Boolean} on `true` to enable; `false` to disable. + */ + + +function setNamespacing(on) { + features.namespacing = on; +} +/** + * Returns the object, or throws an error if it is `null` or `undefined`. This is used to follow + * the ES5 abstract operation `ToObject`. + * + * @private + * @param {*} value Object to check and return. + * @returns {*} The provided object. + */ + + +function toObject(value) { + // null or undefined + if (value == null) { + throw new TypeError('Cannot convert null or undefined to object'); + } + + return value; +} // ==--------------------------== +// Constructor +// ==--------------------------== + +/** + * Creates an extended regular expression object for matching text with a pattern. Differs from a + * native regular expression in that additional syntax and flags are supported. The returned object + * is in fact a native `RegExp` and works with all native methods. + * + * @class XRegExp + * @constructor + * @param {String|RegExp} pattern Regex pattern string, or an existing regex object to copy. + * @param {String} [flags] Any combination of flags. + * Native flags: + * - `g` - global + * - `i` - ignore case + * - `m` - multiline anchors + * - `u` - unicode (ES6) + * - `y` - sticky (Firefox 3+, ES6) + * Additional XRegExp flags: + * - `n` - explicit capture + * - `s` - dot matches all (aka singleline) + * - `x` - free-spacing and line comments (aka extended) + * - `A` - astral (requires the Unicode Base addon) + * Flags cannot be provided when constructing one `RegExp` from another. + * @returns {RegExp} Extended regular expression object. + * @example + * + * // With named capture and flag x + * XRegExp(`(? [0-9]{4} ) -? # year + * (? [0-9]{2} ) -? # month + * (? [0-9]{2} ) # day`, 'x'); + * + * // Providing a regex object copies it. Native regexes are recompiled using native (not XRegExp) + * // syntax. Copies maintain extended data, are augmented with `XRegExp.prototype` properties, and + * // have fresh `lastIndex` properties (set to zero). + * XRegExp(/regex/); + */ + + +function XRegExp(pattern, flags) { + if (XRegExp.isRegExp(pattern)) { + if (flags !== undefined) { + throw new TypeError('Cannot supply flags when copying a RegExp'); + } + + return copyRegex(pattern); + } // Copy the argument behavior of `RegExp` + + + pattern = pattern === undefined ? '' : String(pattern); + flags = flags === undefined ? '' : String(flags); + + if (XRegExp.isInstalled('astral') && !(flags.indexOf('A') !== -1)) { + // This causes an error to be thrown if the Unicode Base addon is not available + flags += 'A'; + } + + if (!patternCache[pattern]) { + patternCache[pattern] = {}; + } + + if (!patternCache[pattern][flags]) { + var context = { + hasNamedCapture: false, + captureNames: [] + }; + var scope = defaultScope; + var output = ''; + var pos = 0; + var result; // Check for flag-related errors, and strip/apply flags in a leading mode modifier + + var applied = prepareFlags(pattern, flags); + var appliedPattern = applied.pattern; + var appliedFlags = applied.flags; // Use XRegExp's tokens to translate the pattern to a native regex pattern. + // `appliedPattern.length` may change on each iteration if tokens use `reparse` + + while (pos < appliedPattern.length) { + do { + // Check for custom tokens at the current position + result = runTokens(appliedPattern, appliedFlags, pos, scope, context); // If the matched token used the `reparse` option, splice its output into the + // pattern before running tokens again at the same position + + if (result && result.reparse) { + appliedPattern = appliedPattern.slice(0, pos) + result.output + appliedPattern.slice(pos + result.matchLength); + } + } while (result && result.reparse); + + if (result) { + output += result.output; + pos += result.matchLength || 1; + } else { + // Get the native token at the current position + var _XRegExp$exec = XRegExp.exec(appliedPattern, nativeTokens[scope], pos, 'sticky'), + _XRegExp$exec2 = _slicedToArray(_XRegExp$exec, 1), + token = _XRegExp$exec2[0]; + + output += token; + pos += token.length; + + if (token === '[' && scope === defaultScope) { + scope = classScope; + } else if (token === ']' && scope === classScope) { + scope = defaultScope; + } + } + } + + patternCache[pattern][flags] = { + // Use basic cleanup to collapse repeated empty groups like `(?:)(?:)` to `(?:)`. Empty + // groups are sometimes inserted during regex transpilation in order to keep tokens + // separated. However, more than one empty group in a row is never needed. + pattern: nativ.replace.call(output, /(?:\(\?:\))+/g, '(?:)'), + // Strip all but native flags + flags: nativ.replace.call(appliedFlags, /[^gimuy]+/g, ''), + // `context.captureNames` has an item for each capturing group, even if unnamed + captures: context.hasNamedCapture ? context.captureNames : null + }; + } + + var generated = patternCache[pattern][flags]; + return augment(new RegExp(generated.pattern, generated.flags), generated.captures, pattern, flags); +} // Add `RegExp.prototype` to the prototype chain + + +XRegExp.prototype = /(?:)/; // ==--------------------------== +// Public properties +// ==--------------------------== + +/** + * The XRegExp version number as a string containing three dot-separated parts. For example, + * '2.0.0-beta-3'. + * + * @static + * @memberOf XRegExp + * @type String + */ + +XRegExp.version = '4.2.0'; // ==--------------------------== +// Public methods +// ==--------------------------== +// Intentionally undocumented; used in tests and addons + +XRegExp._clipDuplicates = clipDuplicates; +XRegExp._hasNativeFlag = hasNativeFlag; +XRegExp._dec = dec; +XRegExp._hex = hex; +XRegExp._pad4 = pad4; +/** + * Extends XRegExp syntax and allows custom flags. This is used internally and can be used to + * create XRegExp addons. If more than one token can match the same string, the last added wins. + * + * @memberOf XRegExp + * @param {RegExp} regex Regex object that matches the new token. + * @param {Function} handler Function that returns a new pattern string (using native regex syntax) + * to replace the matched token within all future XRegExp regexes. Has access to persistent + * properties of the regex being built, through `this`. Invoked with three arguments: + * - The match array, with named backreference properties. + * - The regex scope where the match was found: 'default' or 'class'. + * - The flags used by the regex, including any flags in a leading mode modifier. + * The handler function becomes part of the XRegExp construction process, so be careful not to + * construct XRegExps within the function or you will trigger infinite recursion. + * @param {Object} [options] Options object with optional properties: + * - `scope` {String} Scope where the token applies: 'default', 'class', or 'all'. + * - `flag` {String} Single-character flag that triggers the token. This also registers the + * flag, which prevents XRegExp from throwing an 'unknown flag' error when the flag is used. + * - `optionalFlags` {String} Any custom flags checked for within the token `handler` that are + * not required to trigger the token. This registers the flags, to prevent XRegExp from + * throwing an 'unknown flag' error when any of the flags are used. + * - `reparse` {Boolean} Whether the `handler` function's output should not be treated as + * final, and instead be reparseable by other tokens (including the current token). Allows + * token chaining or deferring. + * - `leadChar` {String} Single character that occurs at the beginning of any successful match + * of the token (not always applicable). This doesn't change the behavior of the token unless + * you provide an erroneous value. However, providing it can increase the token's performance + * since the token can be skipped at any positions where this character doesn't appear. + * @example + * + * // Basic usage: Add \a for the ALERT control code + * XRegExp.addToken( + * /\\a/, + * () => '\\x07', + * {scope: 'all'} + * ); + * XRegExp('\\a[\\a-\\n]+').test('\x07\n\x07'); // -> true + * + * // Add the U (ungreedy) flag from PCRE and RE2, which reverses greedy and lazy quantifiers. + * // Since `scope` is not specified, it uses 'default' (i.e., transformations apply outside of + * // character classes only) + * XRegExp.addToken( + * /([?*+]|{\d+(?:,\d*)?})(\??)/, + * (match) => `${match[1]}${match[2] ? '' : '?'}`, + * {flag: 'U'} + * ); + * XRegExp('a+', 'U').exec('aaa')[0]; // -> 'a' + * XRegExp('a+?', 'U').exec('aaa')[0]; // -> 'aaa' + */ + +XRegExp.addToken = function (regex, handler, options) { + options = options || {}; + var _options = options, + optionalFlags = _options.optionalFlags; + + if (options.flag) { + registerFlag(options.flag); + } + + if (optionalFlags) { + optionalFlags = nativ.split.call(optionalFlags, ''); + var _iteratorNormalCompletion2 = true; + var _didIteratorError2 = false; + var _iteratorError2 = undefined; + + try { + for (var _iterator2 = optionalFlags[Symbol.iterator](), _step2; !(_iteratorNormalCompletion2 = (_step2 = _iterator2.next()).done); _iteratorNormalCompletion2 = true) { + var flag = _step2.value; + registerFlag(flag); + } + } catch (err) { + _didIteratorError2 = true; + _iteratorError2 = err; + } finally { + try { + if (!_iteratorNormalCompletion2 && _iterator2.return != null) { + _iterator2.return(); + } + } finally { + if (_didIteratorError2) { + throw _iteratorError2; + } + } + } + } // Add to the private list of syntax tokens + + + tokens.push({ + regex: copyRegex(regex, { + addG: true, + addY: hasNativeY, + isInternalOnly: true + }), + handler: handler, + scope: options.scope || defaultScope, + flag: options.flag, + reparse: options.reparse, + leadChar: options.leadChar + }); // Reset the pattern cache used by the `XRegExp` constructor, since the same pattern and flags + // might now produce different results + + XRegExp.cache.flush('patterns'); +}; +/** + * Caches and returns the result of calling `XRegExp(pattern, flags)`. On any subsequent call with + * the same pattern and flag combination, the cached copy of the regex is returned. + * + * @memberOf XRegExp + * @param {String} pattern Regex pattern string. + * @param {String} [flags] Any combination of XRegExp flags. + * @returns {RegExp} Cached XRegExp object. + * @example + * + * while (match = XRegExp.cache('.', 'gs').exec(str)) { + * // The regex is compiled once only + * } + */ + + +XRegExp.cache = function (pattern, flags) { + if (!regexCache[pattern]) { + regexCache[pattern] = {}; + } + + return regexCache[pattern][flags] || (regexCache[pattern][flags] = XRegExp(pattern, flags)); +}; // Intentionally undocumented; used in tests + + +XRegExp.cache.flush = function (cacheName) { + if (cacheName === 'patterns') { + // Flush the pattern cache used by the `XRegExp` constructor + patternCache = {}; + } else { + // Flush the regex cache populated by `XRegExp.cache` + regexCache = {}; + } +}; +/** + * Escapes any regular expression metacharacters, for use when matching literal strings. The result + * can safely be used at any point within a regex that uses any flags. + * + * @memberOf XRegExp + * @param {String} str String to escape. + * @returns {String} String with regex metacharacters escaped. + * @example + * + * XRegExp.escape('Escaped? <.>'); + * // -> 'Escaped\?\ <\.>' + */ + + +XRegExp.escape = function (str) { + return nativ.replace.call(toObject(str), /[-\[\]{}()*+?.,\\^$|#\s]/g, '\\$&'); +}; +/** + * Executes a regex search in a specified string. Returns a match array or `null`. If the provided + * regex uses named capture, named backreference properties are included on the match array. + * Optional `pos` and `sticky` arguments specify the search start position, and whether the match + * must start at the specified position only. The `lastIndex` property of the provided regex is not + * used, but is updated for compatibility. Also fixes browser bugs compared to the native + * `RegExp.prototype.exec` and can be used reliably cross-browser. + * + * @memberOf XRegExp + * @param {String} str String to search. + * @param {RegExp} regex Regex to search with. + * @param {Number} [pos=0] Zero-based index at which to start the search. + * @param {Boolean|String} [sticky=false] Whether the match must start at the specified position + * only. The string `'sticky'` is accepted as an alternative to `true`. + * @returns {Array} Match array with named backreference properties, or `null`. + * @example + * + * // Basic use, with named backreference + * let match = XRegExp.exec('U+2620', XRegExp('U\\+(?[0-9A-F]{4})')); + * match.hex; // -> '2620' + * + * // With pos and sticky, in a loop + * let pos = 2, result = [], match; + * while (match = XRegExp.exec('<1><2><3><4>5<6>', /<(\d)>/, pos, 'sticky')) { + * result.push(match[1]); + * pos = match.index + match[0].length; + * } + * // result -> ['2', '3', '4'] + */ + + +XRegExp.exec = function (str, regex, pos, sticky) { + var cacheKey = 'g'; + var addY = false; + var fakeY = false; + var match; + addY = hasNativeY && !!(sticky || regex.sticky && sticky !== false); + + if (addY) { + cacheKey += 'y'; + } else if (sticky) { + // Simulate sticky matching by appending an empty capture to the original regex. The + // resulting regex will succeed no matter what at the current index (set with `lastIndex`), + // and will not search the rest of the subject string. We'll know that the original regex + // has failed if that last capture is `''` rather than `undefined` (i.e., if that last + // capture participated in the match). + fakeY = true; + cacheKey += 'FakeY'; + } + + regex[REGEX_DATA] = regex[REGEX_DATA] || {}; // Shares cached copies with `XRegExp.match`/`replace` + + var r2 = regex[REGEX_DATA][cacheKey] || (regex[REGEX_DATA][cacheKey] = copyRegex(regex, { + addG: true, + addY: addY, + source: fakeY ? "".concat(regex.source, "|()") : undefined, + removeY: sticky === false, + isInternalOnly: true + })); + pos = pos || 0; + r2.lastIndex = pos; // Fixed `exec` required for `lastIndex` fix, named backreferences, etc. + + match = fixed.exec.call(r2, str); // Get rid of the capture added by the pseudo-sticky matcher if needed. An empty string means + // the original regexp failed (see above). + + if (fakeY && match && match.pop() === '') { + match = null; + } + + if (regex.global) { + regex.lastIndex = match ? r2.lastIndex : 0; + } + + return match; +}; +/** + * Executes a provided function once per regex match. Searches always start at the beginning of the + * string and continue until the end, regardless of the state of the regex's `global` property and + * initial `lastIndex`. + * + * @memberOf XRegExp + * @param {String} str String to search. + * @param {RegExp} regex Regex to search with. + * @param {Function} callback Function to execute for each match. Invoked with four arguments: + * - The match array, with named backreference properties. + * - The zero-based match index. + * - The string being traversed. + * - The regex object being used to traverse the string. + * @example + * + * // Extracts every other digit from a string + * const evens = []; + * XRegExp.forEach('1a2345', /\d/, (match, i) => { + * if (i % 2) evens.push(+match[0]); + * }); + * // evens -> [2, 4] + */ + + +XRegExp.forEach = function (str, regex, callback) { + var pos = 0; + var i = -1; + var match; + + while (match = XRegExp.exec(str, regex, pos)) { + // Because `regex` is provided to `callback`, the function could use the deprecated/ + // nonstandard `RegExp.prototype.compile` to mutate the regex. However, since `XRegExp.exec` + // doesn't use `lastIndex` to set the search position, this can't lead to an infinite loop, + // at least. Actually, because of the way `XRegExp.exec` caches globalized versions of + // regexes, mutating the regex will not have any effect on the iteration or matched strings, + // which is a nice side effect that brings extra safety. + callback(match, ++i, str, regex); + pos = match.index + (match[0].length || 1); + } +}; +/** + * Copies a regex object and adds flag `g`. The copy maintains extended data, is augmented with + * `XRegExp.prototype` properties, and has a fresh `lastIndex` property (set to zero). Native + * regexes are not recompiled using XRegExp syntax. + * + * @memberOf XRegExp + * @param {RegExp} regex Regex to globalize. + * @returns {RegExp} Copy of the provided regex with flag `g` added. + * @example + * + * const globalCopy = XRegExp.globalize(/regex/); + * globalCopy.global; // -> true + */ + + +XRegExp.globalize = function (regex) { + return copyRegex(regex, { + addG: true + }); +}; +/** + * Installs optional features according to the specified options. Can be undone using + * `XRegExp.uninstall`. + * + * @memberOf XRegExp + * @param {Object|String} options Options object or string. + * @example + * + * // With an options object + * XRegExp.install({ + * // Enables support for astral code points in Unicode addons (implicitly sets flag A) + * astral: true, + * + * // Adds named capture groups to the `groups` property of matches + * namespacing: true + * }); + * + * // With an options string + * XRegExp.install('astral namespacing'); + */ + + +XRegExp.install = function (options) { + options = prepareOptions(options); + + if (!features.astral && options.astral) { + setAstral(true); + } + + if (!features.namespacing && options.namespacing) { + setNamespacing(true); + } +}; +/** + * Checks whether an individual optional feature is installed. + * + * @memberOf XRegExp + * @param {String} feature Name of the feature to check. One of: + * - `astral` + * - `namespacing` + * @returns {Boolean} Whether the feature is installed. + * @example + * + * XRegExp.isInstalled('astral'); + */ + + +XRegExp.isInstalled = function (feature) { + return !!features[feature]; +}; +/** + * Returns `true` if an object is a regex; `false` if it isn't. This works correctly for regexes + * created in another frame, when `instanceof` and `constructor` checks would fail. + * + * @memberOf XRegExp + * @param {*} value Object to check. + * @returns {Boolean} Whether the object is a `RegExp` object. + * @example + * + * XRegExp.isRegExp('string'); // -> false + * XRegExp.isRegExp(/regex/i); // -> true + * XRegExp.isRegExp(RegExp('^', 'm')); // -> true + * XRegExp.isRegExp(XRegExp('(?s).')); // -> true + */ + + +XRegExp.isRegExp = function (value) { + return toString.call(value) === '[object RegExp]'; +}; // isType(value, 'RegExp'); + +/** + * Returns the first matched string, or in global mode, an array containing all matched strings. + * This is essentially a more convenient re-implementation of `String.prototype.match` that gives + * the result types you actually want (string instead of `exec`-style array in match-first mode, + * and an empty array instead of `null` when no matches are found in match-all mode). It also lets + * you override flag g and ignore `lastIndex`, and fixes browser bugs. + * + * @memberOf XRegExp + * @param {String} str String to search. + * @param {RegExp} regex Regex to search with. + * @param {String} [scope='one'] Use 'one' to return the first match as a string. Use 'all' to + * return an array of all matched strings. If not explicitly specified and `regex` uses flag g, + * `scope` is 'all'. + * @returns {String|Array} In match-first mode: First match as a string, or `null`. In match-all + * mode: Array of all matched strings, or an empty array. + * @example + * + * // Match first + * XRegExp.match('abc', /\w/); // -> 'a' + * XRegExp.match('abc', /\w/g, 'one'); // -> 'a' + * XRegExp.match('abc', /x/g, 'one'); // -> null + * + * // Match all + * XRegExp.match('abc', /\w/g); // -> ['a', 'b', 'c'] + * XRegExp.match('abc', /\w/, 'all'); // -> ['a', 'b', 'c'] + * XRegExp.match('abc', /x/, 'all'); // -> [] + */ + + +XRegExp.match = function (str, regex, scope) { + var global = regex.global && scope !== 'one' || scope === 'all'; + var cacheKey = (global ? 'g' : '') + (regex.sticky ? 'y' : '') || 'noGY'; + regex[REGEX_DATA] = regex[REGEX_DATA] || {}; // Shares cached copies with `XRegExp.exec`/`replace` + + var r2 = regex[REGEX_DATA][cacheKey] || (regex[REGEX_DATA][cacheKey] = copyRegex(regex, { + addG: !!global, + removeG: scope === 'one', + isInternalOnly: true + })); + var result = nativ.match.call(toObject(str), r2); + + if (regex.global) { + regex.lastIndex = scope === 'one' && result ? // Can't use `r2.lastIndex` since `r2` is nonglobal in this case + result.index + result[0].length : 0; + } + + return global ? result || [] : result && result[0]; +}; +/** + * Retrieves the matches from searching a string using a chain of regexes that successively search + * within previous matches. The provided `chain` array can contain regexes and or objects with + * `regex` and `backref` properties. When a backreference is specified, the named or numbered + * backreference is passed forward to the next regex or returned. + * + * @memberOf XRegExp + * @param {String} str String to search. + * @param {Array} chain Regexes that each search for matches within preceding results. + * @returns {Array} Matches by the last regex in the chain, or an empty array. + * @example + * + * // Basic usage; matches numbers within tags + * XRegExp.matchChain('1 2 3 4 a 56', [ + * XRegExp('(?is).*?'), + * /\d+/ + * ]); + * // -> ['2', '4', '56'] + * + * // Passing forward and returning specific backreferences + * html = '
XRegExp\ + * Google'; + * XRegExp.matchChain(html, [ + * {regex: //i, backref: 1}, + * {regex: XRegExp('(?i)^https?://(?[^/?#]+)'), backref: 'domain'} + * ]); + * // -> ['xregexp.com', 'www.google.com'] + */ + + +XRegExp.matchChain = function (str, chain) { + return function recurseChain(values, level) { + var item = chain[level].regex ? chain[level] : { + regex: chain[level] + }; + var matches = []; + + function addMatch(match) { + if (item.backref) { + var ERR_UNDEFINED_GROUP = "Backreference to undefined group: ".concat(item.backref); + var isNamedBackref = isNaN(item.backref); + + if (isNamedBackref && XRegExp.isInstalled('namespacing')) { + // `groups` has `null` as prototype, so using `in` instead of `hasOwnProperty` + if (!(item.backref in match.groups)) { + throw new ReferenceError(ERR_UNDEFINED_GROUP); + } + } else if (!match.hasOwnProperty(item.backref)) { + throw new ReferenceError(ERR_UNDEFINED_GROUP); + } + + var backrefValue = isNamedBackref && XRegExp.isInstalled('namespacing') ? match.groups[item.backref] : match[item.backref]; + matches.push(backrefValue || ''); + } else { + matches.push(match[0]); + } + } + + var _iteratorNormalCompletion3 = true; + var _didIteratorError3 = false; + var _iteratorError3 = undefined; + + try { + for (var _iterator3 = values[Symbol.iterator](), _step3; !(_iteratorNormalCompletion3 = (_step3 = _iterator3.next()).done); _iteratorNormalCompletion3 = true) { + var value = _step3.value; + XRegExp.forEach(value, item.regex, addMatch); + } + } catch (err) { + _didIteratorError3 = true; + _iteratorError3 = err; + } finally { + try { + if (!_iteratorNormalCompletion3 && _iterator3.return != null) { + _iterator3.return(); + } + } finally { + if (_didIteratorError3) { + throw _iteratorError3; + } + } + } + + return level === chain.length - 1 || !matches.length ? matches : recurseChain(matches, level + 1); + }([str], 0); +}; +/** + * Returns a new string with one or all matches of a pattern replaced. The pattern can be a string + * or regex, and the replacement can be a string or a function to be called for each match. To + * perform a global search and replace, use the optional `scope` argument or include flag g if using + * a regex. Replacement strings can use `${n}` or `$` for named and numbered backreferences. + * Replacement functions can use named backreferences via `arguments[0].name`. Also fixes browser + * bugs compared to the native `String.prototype.replace` and can be used reliably cross-browser. + * + * @memberOf XRegExp + * @param {String} str String to search. + * @param {RegExp|String} search Search pattern to be replaced. + * @param {String|Function} replacement Replacement string or a function invoked to create it. + * Replacement strings can include special replacement syntax: + * - $$ - Inserts a literal $ character. + * - $&, $0 - Inserts the matched substring. + * - $` - Inserts the string that precedes the matched substring (left context). + * - $' - Inserts the string that follows the matched substring (right context). + * - $n, $nn - Where n/nn are digits referencing an existent capturing group, inserts + * backreference n/nn. + * - ${n}, $ - Where n is a name or any number of digits that reference an existent capturing + * group, inserts backreference n. + * Replacement functions are invoked with three or more arguments: + * - The matched substring (corresponds to $& above). Named backreferences are accessible as + * properties of this first argument. + * - 0..n arguments, one for each backreference (corresponding to $1, $2, etc. above). + * - The zero-based index of the match within the total search string. + * - The total string being searched. + * @param {String} [scope='one'] Use 'one' to replace the first match only, or 'all'. If not + * explicitly specified and using a regex with flag g, `scope` is 'all'. + * @returns {String} New string with one or all matches replaced. + * @example + * + * // Regex search, using named backreferences in replacement string + * const name = XRegExp('(?\\w+) (?\\w+)'); + * XRegExp.replace('John Smith', name, '$, $'); + * // -> 'Smith, John' + * + * // Regex search, using named backreferences in replacement function + * XRegExp.replace('John Smith', name, (match) => `${match.last}, ${match.first}`); + * // -> 'Smith, John' + * + * // String search, with replace-all + * XRegExp.replace('RegExp builds RegExps', 'RegExp', 'XRegExp', 'all'); + * // -> 'XRegExp builds XRegExps' + */ + + +XRegExp.replace = function (str, search, replacement, scope) { + var isRegex = XRegExp.isRegExp(search); + var global = search.global && scope !== 'one' || scope === 'all'; + var cacheKey = (global ? 'g' : '') + (search.sticky ? 'y' : '') || 'noGY'; + var s2 = search; + + if (isRegex) { + search[REGEX_DATA] = search[REGEX_DATA] || {}; // Shares cached copies with `XRegExp.exec`/`match`. Since a copy is used, `search`'s + // `lastIndex` isn't updated *during* replacement iterations + + s2 = search[REGEX_DATA][cacheKey] || (search[REGEX_DATA][cacheKey] = copyRegex(search, { + addG: !!global, + removeG: scope === 'one', + isInternalOnly: true + })); + } else if (global) { + s2 = new RegExp(XRegExp.escape(String(search)), 'g'); + } // Fixed `replace` required for named backreferences, etc. + + + var result = fixed.replace.call(toObject(str), s2, replacement); + + if (isRegex && search.global) { + // Fixes IE, Safari bug (last tested IE 9, Safari 5.1) + search.lastIndex = 0; + } + + return result; +}; +/** + * Performs batch processing of string replacements. Used like `XRegExp.replace`, but accepts an + * array of replacement details. Later replacements operate on the output of earlier replacements. + * Replacement details are accepted as an array with a regex or string to search for, the + * replacement string or function, and an optional scope of 'one' or 'all'. Uses the XRegExp + * replacement text syntax, which supports named backreference properties via `${name}` or + * `$`. + * + * @memberOf XRegExp + * @param {String} str String to search. + * @param {Array} replacements Array of replacement detail arrays. + * @returns {String} New string with all replacements. + * @example + * + * str = XRegExp.replaceEach(str, [ + * [XRegExp('(?a)'), 'z${name}'], + * [/b/gi, 'y'], + * [/c/g, 'x', 'one'], // scope 'one' overrides /g + * [/d/, 'w', 'all'], // scope 'all' overrides lack of /g + * ['e', 'v', 'all'], // scope 'all' allows replace-all for strings + * [/f/g, ($0) => $0.toUpperCase()] + * ]); + */ + + +XRegExp.replaceEach = function (str, replacements) { + var _iteratorNormalCompletion4 = true; + var _didIteratorError4 = false; + var _iteratorError4 = undefined; + + try { + for (var _iterator4 = replacements[Symbol.iterator](), _step4; !(_iteratorNormalCompletion4 = (_step4 = _iterator4.next()).done); _iteratorNormalCompletion4 = true) { + var r = _step4.value; + str = XRegExp.replace(str, r[0], r[1], r[2]); + } + } catch (err) { + _didIteratorError4 = true; + _iteratorError4 = err; + } finally { + try { + if (!_iteratorNormalCompletion4 && _iterator4.return != null) { + _iterator4.return(); + } + } finally { + if (_didIteratorError4) { + throw _iteratorError4; + } + } + } + + return str; +}; +/** + * Splits a string into an array of strings using a regex or string separator. Matches of the + * separator are not included in the result array. However, if `separator` is a regex that contains + * capturing groups, backreferences are spliced into the result each time `separator` is matched. + * Fixes browser bugs compared to the native `String.prototype.split` and can be used reliably + * cross-browser. + * + * @memberOf XRegExp + * @param {String} str String to split. + * @param {RegExp|String} separator Regex or string to use for separating the string. + * @param {Number} [limit] Maximum number of items to include in the result array. + * @returns {Array} Array of substrings. + * @example + * + * // Basic use + * XRegExp.split('a b c', ' '); + * // -> ['a', 'b', 'c'] + * + * // With limit + * XRegExp.split('a b c', ' ', 2); + * // -> ['a', 'b'] + * + * // Backreferences in result array + * XRegExp.split('..word1..', /([a-z]+)(\d+)/i); + * // -> ['..', 'word', '1', '..'] + */ + + +XRegExp.split = function (str, separator, limit) { + return fixed.split.call(toObject(str), separator, limit); +}; +/** + * Executes a regex search in a specified string. Returns `true` or `false`. Optional `pos` and + * `sticky` arguments specify the search start position, and whether the match must start at the + * specified position only. The `lastIndex` property of the provided regex is not used, but is + * updated for compatibility. Also fixes browser bugs compared to the native + * `RegExp.prototype.test` and can be used reliably cross-browser. + * + * @memberOf XRegExp + * @param {String} str String to search. + * @param {RegExp} regex Regex to search with. + * @param {Number} [pos=0] Zero-based index at which to start the search. + * @param {Boolean|String} [sticky=false] Whether the match must start at the specified position + * only. The string `'sticky'` is accepted as an alternative to `true`. + * @returns {Boolean} Whether the regex matched the provided value. + * @example + * + * // Basic use + * XRegExp.test('abc', /c/); // -> true + * + * // With pos and sticky + * XRegExp.test('abc', /c/, 0, 'sticky'); // -> false + * XRegExp.test('abc', /c/, 2, 'sticky'); // -> true + */ +// Do this the easy way :-) + + +XRegExp.test = function (str, regex, pos, sticky) { + return !!XRegExp.exec(str, regex, pos, sticky); +}; +/** + * Uninstalls optional features according to the specified options. All optional features start out + * uninstalled, so this is used to undo the actions of `XRegExp.install`. + * + * @memberOf XRegExp + * @param {Object|String} options Options object or string. + * @example + * + * // With an options object + * XRegExp.uninstall({ + * // Disables support for astral code points in Unicode addons + * astral: true, + * + * // Don't add named capture groups to the `groups` property of matches + * namespacing: true + * }); + * + * // With an options string + * XRegExp.uninstall('astral namespacing'); + */ + + +XRegExp.uninstall = function (options) { + options = prepareOptions(options); + + if (features.astral && options.astral) { + setAstral(false); + } + + if (features.namespacing && options.namespacing) { + setNamespacing(false); + } +}; +/** + * Returns an XRegExp object that is the union of the given patterns. Patterns can be provided as + * regex objects or strings. Metacharacters are escaped in patterns provided as strings. + * Backreferences in provided regex objects are automatically renumbered to work correctly within + * the larger combined pattern. Native flags used by provided regexes are ignored in favor of the + * `flags` argument. + * + * @memberOf XRegExp + * @param {Array} patterns Regexes and strings to combine. + * @param {String} [flags] Any combination of XRegExp flags. + * @param {Object} [options] Options object with optional properties: + * - `conjunction` {String} Type of conjunction to use: 'or' (default) or 'none'. + * @returns {RegExp} Union of the provided regexes and strings. + * @example + * + * XRegExp.union(['a+b*c', /(dogs)\1/, /(cats)\1/], 'i'); + * // -> /a\+b\*c|(dogs)\1|(cats)\2/i + * + * XRegExp.union([/man/, /bear/, /pig/], 'i', {conjunction: 'none'}); + * // -> /manbearpig/i + */ + + +XRegExp.union = function (patterns, flags, options) { + options = options || {}; + var conjunction = options.conjunction || 'or'; + var numCaptures = 0; + var numPriorCaptures; + var captureNames; + + function rewrite(match, paren, backref) { + var name = captureNames[numCaptures - numPriorCaptures]; // Capturing group + + if (paren) { + ++numCaptures; // If the current capture has a name, preserve the name + + if (name) { + return "(?<".concat(name, ">"); + } // Backreference + + } else if (backref) { + // Rewrite the backreference + return "\\".concat(+backref + numPriorCaptures); + } + + return match; + } + + if (!(isType(patterns, 'Array') && patterns.length)) { + throw new TypeError('Must provide a nonempty array of patterns to merge'); + } + + var parts = /(\()(?!\?)|\\([1-9]\d*)|\\[\s\S]|\[(?:[^\\\]]|\\[\s\S])*\]/g; + var output = []; + var _iteratorNormalCompletion5 = true; + var _didIteratorError5 = false; + var _iteratorError5 = undefined; + + try { + for (var _iterator5 = patterns[Symbol.iterator](), _step5; !(_iteratorNormalCompletion5 = (_step5 = _iterator5.next()).done); _iteratorNormalCompletion5 = true) { + var pattern = _step5.value; + + if (XRegExp.isRegExp(pattern)) { + numPriorCaptures = numCaptures; + captureNames = pattern[REGEX_DATA] && pattern[REGEX_DATA].captureNames || []; // Rewrite backreferences. Passing to XRegExp dies on octals and ensures patterns are + // independently valid; helps keep this simple. Named captures are put back + + output.push(nativ.replace.call(XRegExp(pattern.source).source, parts, rewrite)); + } else { + output.push(XRegExp.escape(pattern)); + } + } + } catch (err) { + _didIteratorError5 = true; + _iteratorError5 = err; + } finally { + try { + if (!_iteratorNormalCompletion5 && _iterator5.return != null) { + _iterator5.return(); + } + } finally { + if (_didIteratorError5) { + throw _iteratorError5; + } + } + } + + var separator = conjunction === 'none' ? '' : '|'; + return XRegExp(output.join(separator), flags); +}; // ==--------------------------== +// Fixed/extended native methods +// ==--------------------------== + +/** + * Adds named capture support (with backreferences returned as `result.name`), and fixes browser + * bugs in the native `RegExp.prototype.exec`. Use via `XRegExp.exec`. + * + * @memberOf RegExp + * @param {String} str String to search. + * @returns {Array} Match array with named backreference properties, or `null`. + */ + + +fixed.exec = function (str) { + var origLastIndex = this.lastIndex; + var match = nativ.exec.apply(this, arguments); + + if (match) { + // Fix browsers whose `exec` methods don't return `undefined` for nonparticipating capturing + // groups. This fixes IE 5.5-8, but not IE 9's quirks mode or emulation of older IEs. IE 9 + // in standards mode follows the spec. + if (!correctExecNpcg && match.length > 1 && match.indexOf('') !== -1) { + var r2 = copyRegex(this, { + removeG: true, + isInternalOnly: true + }); // Using `str.slice(match.index)` rather than `match[0]` in case lookahead allowed + // matching due to characters outside the match + + nativ.replace.call(String(str).slice(match.index), r2, function () { + var len = arguments.length; // Skip index 0 and the last 2 + + for (var i = 1; i < len - 2; ++i) { + if ((i < 0 || arguments.length <= i ? undefined : arguments[i]) === undefined) { + match[i] = undefined; + } + } + }); + } // Attach named capture properties + + + var groupsObject = match; + + if (XRegExp.isInstalled('namespacing')) { + // https://tc39.github.io/proposal-regexp-named-groups/#sec-regexpbuiltinexec + match.groups = Object.create(null); + groupsObject = match.groups; + } + + if (this[REGEX_DATA] && this[REGEX_DATA].captureNames) { + // Skip index 0 + for (var i = 1; i < match.length; ++i) { + var name = this[REGEX_DATA].captureNames[i - 1]; + + if (name) { + groupsObject[name] = match[i]; + } + } + } // Fix browsers that increment `lastIndex` after zero-length matches + + + if (this.global && !match[0].length && this.lastIndex > match.index) { + this.lastIndex = match.index; + } + } + + if (!this.global) { + // Fixes IE, Opera bug (last tested IE 9, Opera 11.6) + this.lastIndex = origLastIndex; + } + + return match; +}; +/** + * Fixes browser bugs in the native `RegExp.prototype.test`. + * + * @memberOf RegExp + * @param {String} str String to search. + * @returns {Boolean} Whether the regex matched the provided value. + */ + + +fixed.test = function (str) { + // Do this the easy way :-) + return !!fixed.exec.call(this, str); +}; +/** + * Adds named capture support (with backreferences returned as `result.name`), and fixes browser + * bugs in the native `String.prototype.match`. + * + * @memberOf String + * @param {RegExp|*} regex Regex to search with. If not a regex object, it is passed to `RegExp`. + * @returns {Array} If `regex` uses flag g, an array of match strings or `null`. Without flag g, + * the result of calling `regex.exec(this)`. + */ + + +fixed.match = function (regex) { + if (!XRegExp.isRegExp(regex)) { + // Use the native `RegExp` rather than `XRegExp` + regex = new RegExp(regex); + } else if (regex.global) { + var result = nativ.match.apply(this, arguments); // Fixes IE bug + + regex.lastIndex = 0; + return result; + } + + return fixed.exec.call(regex, toObject(this)); +}; +/** + * Adds support for `${n}` (or `$`) tokens for named and numbered backreferences in replacement + * text, and provides named backreferences to replacement functions as `arguments[0].name`. Also + * fixes browser bugs in replacement text syntax when performing a replacement using a nonregex + * search value, and the value of a replacement regex's `lastIndex` property during replacement + * iterations and upon completion. Note that this doesn't support SpiderMonkey's proprietary third + * (`flags`) argument. Use via `XRegExp.replace`. + * + * @memberOf String + * @param {RegExp|String} search Search pattern to be replaced. + * @param {String|Function} replacement Replacement string or a function invoked to create it. + * @returns {String} New string with one or all matches replaced. + */ + + +fixed.replace = function (search, replacement) { + var isRegex = XRegExp.isRegExp(search); + var origLastIndex; + var captureNames; + var result; + + if (isRegex) { + if (search[REGEX_DATA]) { + captureNames = search[REGEX_DATA].captureNames; + } // Only needed if `search` is nonglobal + + + origLastIndex = search.lastIndex; + } else { + search += ''; // Type-convert + } // Don't use `typeof`; some older browsers return 'function' for regex objects + + + if (isType(replacement, 'Function')) { + // Stringifying `this` fixes a bug in IE < 9 where the last argument in replacement + // functions isn't type-converted to a string + result = nativ.replace.call(String(this), search, function () { + for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) { + args[_key] = arguments[_key]; + } + + if (captureNames) { + var groupsObject; + + if (XRegExp.isInstalled('namespacing')) { + // https://tc39.github.io/proposal-regexp-named-groups/#sec-regexpbuiltinexec + groupsObject = Object.create(null); + args.push(groupsObject); + } else { + // Change the `args[0]` string primitive to a `String` object that can store + // properties. This really does need to use `String` as a constructor + args[0] = new String(args[0]); + groupsObject = args[0]; + } // Store named backreferences + + + for (var i = 0; i < captureNames.length; ++i) { + if (captureNames[i]) { + groupsObject[captureNames[i]] = args[i + 1]; + } + } + } // Update `lastIndex` before calling `replacement`. Fixes IE, Chrome, Firefox, Safari + // bug (last tested IE 9, Chrome 17, Firefox 11, Safari 5.1) + + + if (isRegex && search.global) { + search.lastIndex = args[args.length - 2] + args[0].length; + } // ES6 specs the context for replacement functions as `undefined` + + + return replacement.apply(void 0, args); + }); + } else { + // Ensure that the last value of `args` will be a string when given nonstring `this`, + // while still throwing on null or undefined context + result = nativ.replace.call(this == null ? this : String(this), search, function () { + for (var _len2 = arguments.length, args = new Array(_len2), _key2 = 0; _key2 < _len2; _key2++) { + args[_key2] = arguments[_key2]; + } + + return nativ.replace.call(String(replacement), replacementToken, replacer); + + function replacer($0, bracketed, angled, dollarToken) { + bracketed = bracketed || angled; // Named or numbered backreference with curly or angled braces + + if (bracketed) { + // XRegExp behavior for `${n}` or `$`: + // 1. Backreference to numbered capture, if `n` is an integer. Use `0` for the + // entire match. Any number of leading zeros may be used. + // 2. Backreference to named capture `n`, if it exists and is not an integer + // overridden by numbered capture. In practice, this does not overlap with + // numbered capture since XRegExp does not allow named capture to use a bare + // integer as the name. + // 3. If the name or number does not refer to an existing capturing group, it's + // an error. + var n = +bracketed; // Type-convert; drop leading zeros + + if (n <= args.length - 3) { + return args[n] || ''; + } // Groups with the same name is an error, else would need `lastIndexOf` + + + n = captureNames ? captureNames.indexOf(bracketed) : -1; + + if (n < 0) { + throw new SyntaxError("Backreference to undefined group ".concat($0)); + } + + return args[n + 1] || ''; + } // Else, special variable or numbered backreference without curly braces + + + if (dollarToken === '$') { + // $$ + return '$'; + } + + if (dollarToken === '&' || +dollarToken === 0) { + // $&, $0 (not followed by 1-9), $00 + return args[0]; + } + + if (dollarToken === '`') { + // $` (left context) + return args[args.length - 1].slice(0, args[args.length - 2]); + } + + if (dollarToken === "'") { + // $' (right context) + return args[args.length - 1].slice(args[args.length - 2] + args[0].length); + } // Else, numbered backreference without braces + + + dollarToken = +dollarToken; // Type-convert; drop leading zero + // XRegExp behavior for `$n` and `$nn`: + // - Backrefs end after 1 or 2 digits. Use `${..}` or `$<..>` for more digits. + // - `$1` is an error if no capturing groups. + // - `$10` is an error if less than 10 capturing groups. Use `${1}0` or `$<1>0` + // instead. + // - `$01` is `$1` if at least one capturing group, else it's an error. + // - `$0` (not followed by 1-9) and `$00` are the entire match. + // Native behavior, for comparison: + // - Backrefs end after 1 or 2 digits. Cannot reference capturing group 100+. + // - `$1` is a literal `$1` if no capturing groups. + // - `$10` is `$1` followed by a literal `0` if less than 10 capturing groups. + // - `$01` is `$1` if at least one capturing group, else it's a literal `$01`. + // - `$0` is a literal `$0`. + + if (!isNaN(dollarToken)) { + if (dollarToken > args.length - 3) { + throw new SyntaxError("Backreference to undefined group ".concat($0)); + } + + return args[dollarToken] || ''; + } // `$` followed by an unsupported char is an error, unlike native JS + + + throw new SyntaxError("Invalid token ".concat($0)); + } + }); + } + + if (isRegex) { + if (search.global) { + // Fixes IE, Safari bug (last tested IE 9, Safari 5.1) + search.lastIndex = 0; + } else { + // Fixes IE, Opera bug (last tested IE 9, Opera 11.6) + search.lastIndex = origLastIndex; + } + } + + return result; +}; +/** + * Fixes browser bugs in the native `String.prototype.split`. Use via `XRegExp.split`. + * + * @memberOf String + * @param {RegExp|String} separator Regex or string to use for separating the string. + * @param {Number} [limit] Maximum number of items to include in the result array. + * @returns {Array} Array of substrings. + */ + + +fixed.split = function (separator, limit) { + if (!XRegExp.isRegExp(separator)) { + // Browsers handle nonregex split correctly, so use the faster native method + return nativ.split.apply(this, arguments); + } + + var str = String(this); + var output = []; + var origLastIndex = separator.lastIndex; + var lastLastIndex = 0; + var lastLength; // Values for `limit`, per the spec: + // If undefined: pow(2,32) - 1 + // If 0, Infinity, or NaN: 0 + // If positive number: limit = floor(limit); if (limit >= pow(2,32)) limit -= pow(2,32); + // If negative number: pow(2,32) - floor(abs(limit)) + // If other: Type-convert, then use the above rules + // This line fails in very strange ways for some values of `limit` in Opera 10.5-10.63, unless + // Opera Dragonfly is open (go figure). It works in at least Opera 9.5-10.1 and 11+ + + limit = (limit === undefined ? -1 : limit) >>> 0; + XRegExp.forEach(str, separator, function (match) { + // This condition is not the same as `if (match[0].length)` + if (match.index + match[0].length > lastLastIndex) { + output.push(str.slice(lastLastIndex, match.index)); + + if (match.length > 1 && match.index < str.length) { + Array.prototype.push.apply(output, match.slice(1)); + } + + lastLength = match[0].length; + lastLastIndex = match.index + lastLength; + } + }); + + if (lastLastIndex === str.length) { + if (!nativ.test.call(separator, '') || lastLength) { + output.push(''); + } + } else { + output.push(str.slice(lastLastIndex)); + } + + separator.lastIndex = origLastIndex; + return output.length > limit ? output.slice(0, limit) : output; +}; // ==--------------------------== +// Built-in syntax/flag tokens +// ==--------------------------== + +/* + * Letter escapes that natively match literal characters: `\a`, `\A`, etc. These should be + * SyntaxErrors but are allowed in web reality. XRegExp makes them errors for cross-browser + * consistency and to reserve their syntax, but lets them be superseded by addons. + */ + + +XRegExp.addToken(/\\([ABCE-RTUVXYZaeg-mopqyz]|c(?![A-Za-z])|u(?![\dA-Fa-f]{4}|{[\dA-Fa-f]+})|x(?![\dA-Fa-f]{2}))/, function (match, scope) { + // \B is allowed in default scope only + if (match[1] === 'B' && scope === defaultScope) { + return match[0]; + } + + throw new SyntaxError("Invalid escape ".concat(match[0])); +}, { + scope: 'all', + leadChar: '\\' +}); +/* + * Unicode code point escape with curly braces: `\u{N..}`. `N..` is any one or more digit + * hexadecimal number from 0-10FFFF, and can include leading zeros. Requires the native ES6 `u` flag + * to support code points greater than U+FFFF. Avoids converting code points above U+FFFF to + * surrogate pairs (which could be done without flag `u`), since that could lead to broken behavior + * if you follow a `\u{N..}` token that references a code point above U+FFFF with a quantifier, or + * if you use the same in a character class. + */ + +XRegExp.addToken(/\\u{([\dA-Fa-f]+)}/, function (match, scope, flags) { + var code = dec(match[1]); + + if (code > 0x10FFFF) { + throw new SyntaxError("Invalid Unicode code point ".concat(match[0])); + } + + if (code <= 0xFFFF) { + // Converting to \uNNNN avoids needing to escape the literal character and keep it + // separate from preceding tokens + return "\\u".concat(pad4(hex(code))); + } // If `code` is between 0xFFFF and 0x10FFFF, require and defer to native handling + + + if (hasNativeU && flags.indexOf('u') !== -1) { + return match[0]; + } + + throw new SyntaxError('Cannot use Unicode code point above \\u{FFFF} without flag u'); +}, { + scope: 'all', + leadChar: '\\' +}); +/* + * Empty character class: `[]` or `[^]`. This fixes a critical cross-browser syntax inconsistency. + * Unless this is standardized (per the ES spec), regex syntax can't be accurately parsed because + * character class endings can't be determined. + */ + +XRegExp.addToken(/\[(\^?)\]/, // For cross-browser compatibility with ES3, convert [] to \b\B and [^] to [\s\S]. +// (?!) should work like \b\B, but is unreliable in some versions of Firefox + +/* eslint-disable no-confusing-arrow */ +function (match) { + return match[1] ? '[\\s\\S]' : '\\b\\B'; +}, +/* eslint-enable no-confusing-arrow */ +{ + leadChar: '[' +}); +/* + * Comment pattern: `(?# )`. Inline comments are an alternative to the line comments allowed in + * free-spacing mode (flag x). + */ + +XRegExp.addToken(/\(\?#[^)]*\)/, getContextualTokenSeparator, { + leadChar: '(' +}); +/* + * Whitespace and line comments, in free-spacing mode (aka extended mode, flag x) only. + */ + +XRegExp.addToken(/\s+|#[^\n]*\n?/, getContextualTokenSeparator, { + flag: 'x' +}); +/* + * Dot, in dotall mode (aka singleline mode, flag s) only. + */ + +XRegExp.addToken(/\./, function () { + return '[\\s\\S]'; +}, { + flag: 's', + leadChar: '.' +}); +/* + * Named backreference: `\k`. Backreference names can use the characters A-Z, a-z, 0-9, _, + * and $ only. Also allows numbered backreferences as `\k`. + */ + +XRegExp.addToken(/\\k<([\w$]+)>/, function (match) { + // Groups with the same name is an error, else would need `lastIndexOf` + var index = isNaN(match[1]) ? this.captureNames.indexOf(match[1]) + 1 : +match[1]; + var endIndex = match.index + match[0].length; + + if (!index || index > this.captureNames.length) { + throw new SyntaxError("Backreference to undefined group ".concat(match[0])); + } // Keep backreferences separate from subsequent literal numbers. This avoids e.g. + // inadvertedly changing `(?)\k1` to `()\11`. + + + return "\\".concat(index).concat(endIndex === match.input.length || isNaN(match.input[endIndex]) ? '' : '(?:)'); +}, { + leadChar: '\\' +}); +/* + * Numbered backreference or octal, plus any following digits: `\0`, `\11`, etc. Octals except `\0` + * not followed by 0-9 and backreferences to unopened capture groups throw an error. Other matches + * are returned unaltered. IE < 9 doesn't support backreferences above `\99` in regex syntax. + */ + +XRegExp.addToken(/\\(\d+)/, function (match, scope) { + if (!(scope === defaultScope && /^[1-9]/.test(match[1]) && +match[1] <= this.captureNames.length) && match[1] !== '0') { + throw new SyntaxError("Cannot use octal escape or backreference to undefined group ".concat(match[0])); + } + + return match[0]; +}, { + scope: 'all', + leadChar: '\\' +}); +/* + * Named capturing group; match the opening delimiter only: `(?`. Capture names can use the + * characters A-Z, a-z, 0-9, _, and $ only. Names can't be integers. Supports Python-style + * `(?P` as an alternate syntax to avoid issues in some older versions of Opera which natively + * supported the Python-style syntax. Otherwise, XRegExp might treat numbered backreferences to + * Python-style named capture as octals. + */ + +XRegExp.addToken(/\(\?P?<([\w$]+)>/, function (match) { + // Disallow bare integers as names because named backreferences are added to match arrays + // and therefore numeric properties may lead to incorrect lookups + if (!isNaN(match[1])) { + throw new SyntaxError("Cannot use integer as capture name ".concat(match[0])); + } + + if (!XRegExp.isInstalled('namespacing') && (match[1] === 'length' || match[1] === '__proto__')) { + throw new SyntaxError("Cannot use reserved word as capture name ".concat(match[0])); + } + + if (this.captureNames.indexOf(match[1]) !== -1) { + throw new SyntaxError("Cannot use same name for multiple groups ".concat(match[0])); + } + + this.captureNames.push(match[1]); + this.hasNamedCapture = true; + return '('; +}, { + leadChar: '(' +}); +/* + * Capturing group; match the opening parenthesis only. Required for support of named capturing + * groups. Also adds explicit capture mode (flag n). + */ + +XRegExp.addToken(/\((?!\?)/, function (match, scope, flags) { + if (flags.indexOf('n') !== -1) { + return '(?:'; + } + + this.captureNames.push(null); + return '('; +}, { + optionalFlags: 'n', + leadChar: '(' +}); +var _default = XRegExp; +exports.default = _default; +module.exports = exports["default"]; +}); + +unwrapExports(xregexp); + +var build = createCommonjsModule(function (module, exports) { +"use strict"; + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.default = void 0; + +/*! + * XRegExp.build 4.2.0 + * + * Steven Levithan (c) 2012-present MIT License + */ +var _default = function _default(XRegExp) { + var REGEX_DATA = 'xregexp'; + var subParts = /(\()(?!\?)|\\([1-9]\d*)|\\[\s\S]|\[(?:[^\\\]]|\\[\s\S])*\]/g; + var parts = XRegExp.union([/\({{([\w$]+)}}\)|{{([\w$]+)}}/, subParts], 'g', { + conjunction: 'or' + }); + /** + * Strips a leading `^` and trailing unescaped `$`, if both are present. + * + * @private + * @param {String} pattern Pattern to process. + * @returns {String} Pattern with edge anchors removed. + */ + + function deanchor(pattern) { + // Allow any number of empty noncapturing groups before/after anchors, because regexes + // built/generated by XRegExp sometimes include them + var leadingAnchor = /^(?:\(\?:\))*\^/; + var trailingAnchor = /\$(?:\(\?:\))*$/; + + if (leadingAnchor.test(pattern) && trailingAnchor.test(pattern) && // Ensure that the trailing `$` isn't escaped + trailingAnchor.test(pattern.replace(/\\[\s\S]/g, ''))) { + return pattern.replace(leadingAnchor, '').replace(trailingAnchor, ''); + } + + return pattern; + } + /** + * Converts the provided value to an XRegExp. Native RegExp flags are not preserved. + * + * @private + * @param {String|RegExp} value Value to convert. + * @param {Boolean} [addFlagX] Whether to apply the `x` flag in cases when `value` is not + * already a regex generated by XRegExp + * @returns {RegExp} XRegExp object with XRegExp syntax applied. + */ + + + function asXRegExp(value, addFlagX) { + var flags = addFlagX ? 'x' : ''; + return XRegExp.isRegExp(value) ? value[REGEX_DATA] && value[REGEX_DATA].captureNames ? // Don't recompile, to preserve capture names + value : // Recompile as XRegExp + XRegExp(value.source, flags) : // Compile string as XRegExp + XRegExp(value, flags); + } + + function interpolate(substitution) { + return substitution instanceof RegExp ? substitution : XRegExp.escape(substitution); + } + + function reduceToSubpatternsObject(subpatterns, interpolated, subpatternIndex) { + subpatterns["subpattern".concat(subpatternIndex)] = interpolated; + return subpatterns; + } + + function embedSubpatternAfter(raw, subpatternIndex, rawLiterals) { + var hasSubpattern = subpatternIndex < rawLiterals.length - 1; + return raw + (hasSubpattern ? "{{subpattern".concat(subpatternIndex, "}}") : ''); + } + /** + * Provides tagged template literals that create regexes with XRegExp syntax and flags. The + * provided pattern is handled as a raw string, so backslashes don't need to be escaped. + * + * Interpolation of strings and regexes shares the features of `XRegExp.build`. Interpolated + * patterns are treated as atomic units when quantified, interpolated strings have their special + * characters escaped, a leading `^` and trailing unescaped `$` are stripped from interpolated + * regexes if both are present, and any backreferences within an interpolated regex are + * rewritten to work within the overall pattern. + * + * @memberOf XRegExp + * @param {String} [flags] Any combination of XRegExp flags. + * @returns {Function} Handler for template literals that construct regexes with XRegExp syntax. + * @example + * + * const h12 = /1[0-2]|0?[1-9]/; + * const h24 = /2[0-3]|[01][0-9]/; + * const hours = XRegExp.tag('x')`${h12} : | ${h24}`; + * const minutes = /^[0-5][0-9]$/; + * // Note that explicitly naming the 'minutes' group is required for named backreferences + * const time = XRegExp.tag('x')`^ ${hours} (?${minutes}) $`; + * time.test('10:59'); // -> true + * XRegExp.exec('10:59', time).minutes; // -> '59' + */ + + + XRegExp.tag = function (flags) { + return function (literals) { + for (var _len = arguments.length, substitutions = new Array(_len > 1 ? _len - 1 : 0), _key = 1; _key < _len; _key++) { + substitutions[_key - 1] = arguments[_key]; + } + + var subpatterns = substitutions.map(interpolate).reduce(reduceToSubpatternsObject, {}); + var pattern = literals.raw.map(embedSubpatternAfter).join(''); + return XRegExp.build(pattern, subpatterns, flags); + }; + }; + /** + * Builds regexes using named subpatterns, for readability and pattern reuse. Backreferences in + * the outer pattern and provided subpatterns are automatically renumbered to work correctly. + * Native flags used by provided subpatterns are ignored in favor of the `flags` argument. + * + * @memberOf XRegExp + * @param {String} pattern XRegExp pattern using `{{name}}` for embedded subpatterns. Allows + * `({{name}})` as shorthand for `(?{{name}})`. Patterns cannot be embedded within + * character classes. + * @param {Object} subs Lookup object for named subpatterns. Values can be strings or regexes. A + * leading `^` and trailing unescaped `$` are stripped from subpatterns, if both are present. + * @param {String} [flags] Any combination of XRegExp flags. + * @returns {RegExp} Regex with interpolated subpatterns. + * @example + * + * const time = XRegExp.build('(?x)^ {{hours}} ({{minutes}}) $', { + * hours: XRegExp.build('{{h12}} : | {{h24}}', { + * h12: /1[0-2]|0?[1-9]/, + * h24: /2[0-3]|[01][0-9]/ + * }, 'x'), + * minutes: /^[0-5][0-9]$/ + * }); + * time.test('10:59'); // -> true + * XRegExp.exec('10:59', time).minutes; // -> '59' + */ + + + XRegExp.build = function (pattern, subs, flags) { + flags = flags || ''; // Used with `asXRegExp` calls for `pattern` and subpatterns in `subs`, to work around how + // some browsers convert `RegExp('\n')` to a regex that contains the literal characters `\` + // and `n`. See more details at . + + var addFlagX = flags.indexOf('x') !== -1; + var inlineFlags = /^\(\?([\w$]+)\)/.exec(pattern); // Add flags within a leading mode modifier to the overall pattern's flags + + if (inlineFlags) { + flags = XRegExp._clipDuplicates(flags + inlineFlags[1]); + } + + var data = {}; + + for (var p in subs) { + if (subs.hasOwnProperty(p)) { + // Passing to XRegExp enables extended syntax and ensures independent validity, + // lest an unescaped `(`, `)`, `[`, or trailing `\` breaks the `(?:)` wrapper. For + // subpatterns provided as native regexes, it dies on octals and adds the property + // used to hold extended regex instance data, for simplicity. + var sub = asXRegExp(subs[p], addFlagX); + data[p] = { + // Deanchoring allows embedding independently useful anchored regexes. If you + // really need to keep your anchors, double them (i.e., `^^...$$`). + pattern: deanchor(sub.source), + names: sub[REGEX_DATA].captureNames || [] + }; + } + } // Passing to XRegExp dies on octals and ensures the outer pattern is independently valid; + // helps keep this simple. Named captures will be put back. + + + var patternAsRegex = asXRegExp(pattern, addFlagX); // 'Caps' is short for 'captures' + + var numCaps = 0; + var numPriorCaps; + var numOuterCaps = 0; + var outerCapsMap = [0]; + var outerCapNames = patternAsRegex[REGEX_DATA].captureNames || []; + var output = patternAsRegex.source.replace(parts, function ($0, $1, $2, $3, $4) { + var subName = $1 || $2; + var capName; + var intro; + var localCapIndex; // Named subpattern + + if (subName) { + if (!data.hasOwnProperty(subName)) { + throw new ReferenceError("Undefined property ".concat($0)); + } // Named subpattern was wrapped in a capturing group + + + if ($1) { + capName = outerCapNames[numOuterCaps]; + outerCapsMap[++numOuterCaps] = ++numCaps; // If it's a named group, preserve the name. Otherwise, use the subpattern name + // as the capture name + + intro = "(?<".concat(capName || subName, ">"); + } else { + intro = '(?:'; + } + + numPriorCaps = numCaps; + var rewrittenSubpattern = data[subName].pattern.replace(subParts, function (match, paren, backref) { + // Capturing group + if (paren) { + capName = data[subName].names[numCaps - numPriorCaps]; + ++numCaps; // If the current capture has a name, preserve the name + + if (capName) { + return "(?<".concat(capName, ">"); + } // Backreference + + } else if (backref) { + localCapIndex = +backref - 1; // Rewrite the backreference + + return data[subName].names[localCapIndex] ? // Need to preserve the backreference name in case using flag `n` + "\\k<".concat(data[subName].names[localCapIndex], ">") : "\\".concat(+backref + numPriorCaps); + } + + return match; + }); + return "".concat(intro).concat(rewrittenSubpattern, ")"); + } // Capturing group + + + if ($3) { + capName = outerCapNames[numOuterCaps]; + outerCapsMap[++numOuterCaps] = ++numCaps; // If the current capture has a name, preserve the name + + if (capName) { + return "(?<".concat(capName, ">"); + } // Backreference + + } else if ($4) { + localCapIndex = +$4 - 1; // Rewrite the backreference + + return outerCapNames[localCapIndex] ? // Need to preserve the backreference name in case using flag `n` + "\\k<".concat(outerCapNames[localCapIndex], ">") : "\\".concat(outerCapsMap[+$4]); + } + + return $0; + }); + return XRegExp(output, flags); + }; +}; + +exports.default = _default; +module.exports = exports["default"]; +}); + +unwrapExports(build); + +var matchrecursive = createCommonjsModule(function (module, exports) { +"use strict"; + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.default = void 0; + +/*! + * XRegExp.matchRecursive 4.2.0 + * + * Steven Levithan (c) 2009-present MIT License + */ +var _default = function _default(XRegExp) { + /** + * Returns a match detail object composed of the provided values. + * + * @private + */ + function row(name, value, start, end) { + return { + name: name, + value: value, + start: start, + end: end + }; + } + /** + * Returns an array of match strings between outermost left and right delimiters, or an array of + * objects with detailed match parts and position data. An error is thrown if delimiters are + * unbalanced within the data. + * + * @memberOf XRegExp + * @param {String} str String to search. + * @param {String} left Left delimiter as an XRegExp pattern. + * @param {String} right Right delimiter as an XRegExp pattern. + * @param {String} [flags] Any native or XRegExp flags, used for the left and right delimiters. + * @param {Object} [options] Lets you specify `valueNames` and `escapeChar` options. + * @returns {Array} Array of matches, or an empty array. + * @example + * + * // Basic usage + * let str = '(t((e))s)t()(ing)'; + * XRegExp.matchRecursive(str, '\\(', '\\)', 'g'); + * // -> ['t((e))s', '', 'ing'] + * + * // Extended information mode with valueNames + * str = 'Here is
an
example'; + * XRegExp.matchRecursive(str, '', '', 'gi', { + * valueNames: ['between', 'left', 'match', 'right'] + * }); + * // -> [ + * // {name: 'between', value: 'Here is ', start: 0, end: 8}, + * // {name: 'left', value: '
', start: 8, end: 13}, + * // {name: 'match', value: '
an
', start: 13, end: 27}, + * // {name: 'right', value: '
', start: 27, end: 33}, + * // {name: 'between', value: ' example', start: 33, end: 41} + * // ] + * + * // Omitting unneeded parts with null valueNames, and using escapeChar + * str = '...{1}.\\{{function(x,y){return {y:x}}}'; + * XRegExp.matchRecursive(str, '{', '}', 'g', { + * valueNames: ['literal', null, 'value', null], + * escapeChar: '\\' + * }); + * // -> [ + * // {name: 'literal', value: '...', start: 0, end: 3}, + * // {name: 'value', value: '1', start: 4, end: 5}, + * // {name: 'literal', value: '.\\{', start: 6, end: 9}, + * // {name: 'value', value: 'function(x,y){return {y:x}}', start: 10, end: 37} + * // ] + * + * // Sticky mode via flag y + * str = '<1><<<2>>><3>4<5>'; + * XRegExp.matchRecursive(str, '<', '>', 'gy'); + * // -> ['1', '<<2>>', '3'] + */ + + + XRegExp.matchRecursive = function (str, left, right, flags, options) { + flags = flags || ''; + options = options || {}; + var global = flags.indexOf('g') !== -1; + var sticky = flags.indexOf('y') !== -1; // Flag `y` is controlled internally + + var basicFlags = flags.replace(/y/g, ''); + var _options = options, + escapeChar = _options.escapeChar; + var vN = options.valueNames; + var output = []; + var openTokens = 0; + var delimStart = 0; + var delimEnd = 0; + var lastOuterEnd = 0; + var outerStart; + var innerStart; + var leftMatch; + var rightMatch; + var esc; + left = XRegExp(left, basicFlags); + right = XRegExp(right, basicFlags); + + if (escapeChar) { + if (escapeChar.length > 1) { + throw new Error('Cannot use more than one escape character'); + } + + escapeChar = XRegExp.escape(escapeChar); // Example of concatenated `esc` regex: + // `escapeChar`: '%' + // `left`: '<' + // `right`: '>' + // Regex is: /(?:%[\S\s]|(?:(?!<|>)[^%])+)+/ + + esc = new RegExp("(?:".concat(escapeChar, "[\\S\\s]|(?:(?!").concat( // Using `XRegExp.union` safely rewrites backreferences in `left` and `right`. + // Intentionally not passing `basicFlags` to `XRegExp.union` since any syntax + // transformation resulting from those flags was already applied to `left` and + // `right` when they were passed through the XRegExp constructor above. + XRegExp.union([left, right], '', { + conjunction: 'or' + }).source, ")[^").concat(escapeChar, "])+)+"), // Flags `gy` not needed here + flags.replace(/[^imu]+/g, '')); + } + + while (true) { + // If using an escape character, advance to the delimiter's next starting position, + // skipping any escaped characters in between + if (escapeChar) { + delimEnd += (XRegExp.exec(str, esc, delimEnd, 'sticky') || [''])[0].length; + } + + leftMatch = XRegExp.exec(str, left, delimEnd); + rightMatch = XRegExp.exec(str, right, delimEnd); // Keep the leftmost match only + + if (leftMatch && rightMatch) { + if (leftMatch.index <= rightMatch.index) { + rightMatch = null; + } else { + leftMatch = null; + } + } // Paths (LM: leftMatch, RM: rightMatch, OT: openTokens): + // LM | RM | OT | Result + // 1 | 0 | 1 | loop + // 1 | 0 | 0 | loop + // 0 | 1 | 1 | loop + // 0 | 1 | 0 | throw + // 0 | 0 | 1 | throw + // 0 | 0 | 0 | break + // The paths above don't include the sticky mode special case. The loop ends after the + // first completed match if not `global`. + + + if (leftMatch || rightMatch) { + delimStart = (leftMatch || rightMatch).index; + delimEnd = delimStart + (leftMatch || rightMatch)[0].length; + } else if (!openTokens) { + break; + } + + if (sticky && !openTokens && delimStart > lastOuterEnd) { + break; + } + + if (leftMatch) { + if (!openTokens) { + outerStart = delimStart; + innerStart = delimEnd; + } + + ++openTokens; + } else if (rightMatch && openTokens) { + if (! --openTokens) { + if (vN) { + if (vN[0] && outerStart > lastOuterEnd) { + output.push(row(vN[0], str.slice(lastOuterEnd, outerStart), lastOuterEnd, outerStart)); + } + + if (vN[1]) { + output.push(row(vN[1], str.slice(outerStart, innerStart), outerStart, innerStart)); + } + + if (vN[2]) { + output.push(row(vN[2], str.slice(innerStart, delimStart), innerStart, delimStart)); + } + + if (vN[3]) { + output.push(row(vN[3], str.slice(delimStart, delimEnd), delimStart, delimEnd)); + } + } else { + output.push(str.slice(innerStart, delimStart)); + } + + lastOuterEnd = delimEnd; + + if (!global) { + break; + } + } + } else { + throw new Error('Unbalanced delimiter found in string'); + } // If the delimiter matched an empty string, avoid an infinite loop + + + if (delimStart === delimEnd) { + ++delimEnd; + } + } + + if (global && !sticky && vN && vN[0] && str.length > lastOuterEnd) { + output.push(row(vN[0], str.slice(lastOuterEnd), lastOuterEnd, str.length)); + } + + return output; + }; +}; + +exports.default = _default; +module.exports = exports["default"]; +}); + +unwrapExports(matchrecursive); + +var unicodeBase = createCommonjsModule(function (module, exports) { +"use strict"; + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.default = void 0; + +/*! + * XRegExp Unicode Base 4.2.0 + * + * Steven Levithan (c) 2008-present MIT License + */ +var _default = function _default(XRegExp) { + /** + * Adds base support for Unicode matching: + * - Adds syntax `\p{..}` for matching Unicode tokens. Tokens can be inverted using `\P{..}` or + * `\p{^..}`. Token names ignore case, spaces, hyphens, and underscores. You can omit the + * braces for token names that are a single letter (e.g. `\pL` or `PL`). + * - Adds flag A (astral), which enables 21-bit Unicode support. + * - Adds the `XRegExp.addUnicodeData` method used by other addons to provide character data. + * + * Unicode Base relies on externally provided Unicode character data. Official addons are + * available to provide data for Unicode categories, scripts, blocks, and properties. + * + * @requires XRegExp + */ + // ==--------------------------== + // Private stuff + // ==--------------------------== + // Storage for Unicode data + var unicode = {}; // Reuse utils + + var dec = XRegExp._dec; + var hex = XRegExp._hex; + var pad4 = XRegExp._pad4; // Generates a token lookup name: lowercase, with hyphens, spaces, and underscores removed + + function normalize(name) { + return name.replace(/[- _]+/g, '').toLowerCase(); + } // Gets the decimal code of a literal code unit, \xHH, \uHHHH, or a backslash-escaped literal + + + function charCode(chr) { + var esc = /^\\[xu](.+)/.exec(chr); + return esc ? dec(esc[1]) : chr.charCodeAt(chr[0] === '\\' ? 1 : 0); + } // Inverts a list of ordered BMP characters and ranges + + + function invertBmp(range) { + var output = ''; + var lastEnd = -1; + XRegExp.forEach(range, /(\\x..|\\u....|\\?[\s\S])(?:-(\\x..|\\u....|\\?[\s\S]))?/, function (m) { + var start = charCode(m[1]); + + if (start > lastEnd + 1) { + output += "\\u".concat(pad4(hex(lastEnd + 1))); + + if (start > lastEnd + 2) { + output += "-\\u".concat(pad4(hex(start - 1))); + } + } + + lastEnd = charCode(m[2] || m[1]); + }); + + if (lastEnd < 0xFFFF) { + output += "\\u".concat(pad4(hex(lastEnd + 1))); + + if (lastEnd < 0xFFFE) { + output += '-\\uFFFF'; + } + } + + return output; + } // Generates an inverted BMP range on first use + + + function cacheInvertedBmp(slug) { + var prop = 'b!'; + return unicode[slug][prop] || (unicode[slug][prop] = invertBmp(unicode[slug].bmp)); + } // Combines and optionally negates BMP and astral data + + + function buildAstral(slug, isNegated) { + var item = unicode[slug]; + var combined = ''; + + if (item.bmp && !item.isBmpLast) { + combined = "[".concat(item.bmp, "]").concat(item.astral ? '|' : ''); + } + + if (item.astral) { + combined += item.astral; + } + + if (item.isBmpLast && item.bmp) { + combined += "".concat(item.astral ? '|' : '', "[").concat(item.bmp, "]"); + } // Astral Unicode tokens always match a code point, never a code unit + + + return isNegated ? "(?:(?!".concat(combined, ")(?:[\uD800-\uDBFF][\uDC00-\uDFFF]|[\0-\uFFFF]))") : "(?:".concat(combined, ")"); + } // Builds a complete astral pattern on first use + + + function cacheAstral(slug, isNegated) { + var prop = isNegated ? 'a!' : 'a='; + return unicode[slug][prop] || (unicode[slug][prop] = buildAstral(slug, isNegated)); + } // ==--------------------------== + // Core functionality + // ==--------------------------== + + /* + * Add astral mode (flag A) and Unicode token syntax: `\p{..}`, `\P{..}`, `\p{^..}`, `\pC`. + */ + + + XRegExp.addToken( // Use `*` instead of `+` to avoid capturing `^` as the token name in `\p{^}` + /\\([pP])(?:{(\^?)([^}]*)}|([A-Za-z]))/, function (match, scope, flags) { + var ERR_DOUBLE_NEG = 'Invalid double negation '; + var ERR_UNKNOWN_NAME = 'Unknown Unicode token '; + var ERR_UNKNOWN_REF = 'Unicode token missing data '; + var ERR_ASTRAL_ONLY = 'Astral mode required for Unicode token '; + var ERR_ASTRAL_IN_CLASS = 'Astral mode does not support Unicode tokens within character classes'; // Negated via \P{..} or \p{^..} + + var isNegated = match[1] === 'P' || !!match[2]; // Switch from BMP (0-FFFF) to astral (0-10FFFF) mode via flag A + + var isAstralMode = flags.indexOf('A') !== -1; // Token lookup name. Check `[4]` first to avoid passing `undefined` via `\p{}` + + var slug = normalize(match[4] || match[3]); // Token data object + + var item = unicode[slug]; + + if (match[1] === 'P' && match[2]) { + throw new SyntaxError(ERR_DOUBLE_NEG + match[0]); + } + + if (!unicode.hasOwnProperty(slug)) { + throw new SyntaxError(ERR_UNKNOWN_NAME + match[0]); + } // Switch to the negated form of the referenced Unicode token + + + if (item.inverseOf) { + slug = normalize(item.inverseOf); + + if (!unicode.hasOwnProperty(slug)) { + throw new ReferenceError("".concat(ERR_UNKNOWN_REF + match[0], " -> ").concat(item.inverseOf)); + } + + item = unicode[slug]; + isNegated = !isNegated; + } + + if (!(item.bmp || isAstralMode)) { + throw new SyntaxError(ERR_ASTRAL_ONLY + match[0]); + } + + if (isAstralMode) { + if (scope === 'class') { + throw new SyntaxError(ERR_ASTRAL_IN_CLASS); + } + + return cacheAstral(slug, isNegated); + } + + return scope === 'class' ? isNegated ? cacheInvertedBmp(slug) : item.bmp : "".concat((isNegated ? '[^' : '[') + item.bmp, "]"); + }, { + scope: 'all', + optionalFlags: 'A', + leadChar: '\\' + }); + /** + * Adds to the list of Unicode tokens that XRegExp regexes can match via `\p` or `\P`. + * + * @memberOf XRegExp + * @param {Array} data Objects with named character ranges. Each object may have properties + * `name`, `alias`, `isBmpLast`, `inverseOf`, `bmp`, and `astral`. All but `name` are + * optional, although one of `bmp` or `astral` is required (unless `inverseOf` is set). If + * `astral` is absent, the `bmp` data is used for BMP and astral modes. If `bmp` is absent, + * the name errors in BMP mode but works in astral mode. If both `bmp` and `astral` are + * provided, the `bmp` data only is used in BMP mode, and the combination of `bmp` and + * `astral` data is used in astral mode. `isBmpLast` is needed when a token matches orphan + * high surrogates *and* uses surrogate pairs to match astral code points. The `bmp` and + * `astral` data should be a combination of literal characters and `\xHH` or `\uHHHH` escape + * sequences, with hyphens to create ranges. Any regex metacharacters in the data should be + * escaped, apart from range-creating hyphens. The `astral` data can additionally use + * character classes and alternation, and should use surrogate pairs to represent astral code + * points. `inverseOf` can be used to avoid duplicating character data if a Unicode token is + * defined as the exact inverse of another token. + * @example + * + * // Basic use + * XRegExp.addUnicodeData([{ + * name: 'XDigit', + * alias: 'Hexadecimal', + * bmp: '0-9A-Fa-f' + * }]); + * XRegExp('\\p{XDigit}:\\p{Hexadecimal}+').test('0:3D'); // -> true + */ + + XRegExp.addUnicodeData = function (data) { + var ERR_NO_NAME = 'Unicode token requires name'; + var ERR_NO_DATA = 'Unicode token has no character data '; + var _iteratorNormalCompletion = true; + var _didIteratorError = false; + var _iteratorError = undefined; + + try { + for (var _iterator = data[Symbol.iterator](), _step; !(_iteratorNormalCompletion = (_step = _iterator.next()).done); _iteratorNormalCompletion = true) { + var item = _step.value; + + if (!item.name) { + throw new Error(ERR_NO_NAME); + } + + if (!(item.inverseOf || item.bmp || item.astral)) { + throw new Error(ERR_NO_DATA + item.name); + } + + unicode[normalize(item.name)] = item; + + if (item.alias) { + unicode[normalize(item.alias)] = item; + } + } // Reset the pattern cache used by the `XRegExp` constructor, since the same pattern and + // flags might now produce different results + + } catch (err) { + _didIteratorError = true; + _iteratorError = err; + } finally { + try { + if (!_iteratorNormalCompletion && _iterator.return != null) { + _iterator.return(); + } + } finally { + if (_didIteratorError) { + throw _iteratorError; + } + } + } + + XRegExp.cache.flush('patterns'); + }; + /** + * @ignore + * + * Return a reference to the internal Unicode definition structure for the given Unicode + * Property if the given name is a legal Unicode Property for use in XRegExp `\p` or `\P` regex + * constructs. + * + * @memberOf XRegExp + * @param {String} name Name by which the Unicode Property may be recognized (case-insensitive), + * e.g. `'N'` or `'Number'`. The given name is matched against all registered Unicode + * Properties and Property Aliases. + * @returns {Object} Reference to definition structure when the name matches a Unicode Property. + * + * @note + * For more info on Unicode Properties, see also http://unicode.org/reports/tr18/#Categories. + * + * @note + * This method is *not* part of the officially documented API and may change or be removed in + * the future. It is meant for userland code that wishes to reuse the (large) internal Unicode + * structures set up by XRegExp. + */ + + + XRegExp._getUnicodeProperty = function (name) { + var slug = normalize(name); + return unicode[slug]; + }; +}; + +exports.default = _default; +module.exports = exports["default"]; +}); + +unwrapExports(unicodeBase); + +var blocks = [ + { + 'name': 'InAdlam', + 'astral': '\uD83A[\uDD00-\uDD5F]' + }, + { + 'name': 'InAegean_Numbers', + 'astral': '\uD800[\uDD00-\uDD3F]' + }, + { + 'name': 'InAhom', + 'astral': '\uD805[\uDF00-\uDF3F]' + }, + { + 'name': 'InAlchemical_Symbols', + 'astral': '\uD83D[\uDF00-\uDF7F]' + }, + { + 'name': 'InAlphabetic_Presentation_Forms', + 'bmp': '\uFB00-\uFB4F' + }, + { + 'name': 'InAnatolian_Hieroglyphs', + 'astral': '\uD811[\uDC00-\uDE7F]' + }, + { + 'name': 'InAncient_Greek_Musical_Notation', + 'astral': '\uD834[\uDE00-\uDE4F]' + }, + { + 'name': 'InAncient_Greek_Numbers', + 'astral': '\uD800[\uDD40-\uDD8F]' + }, + { + 'name': 'InAncient_Symbols', + 'astral': '\uD800[\uDD90-\uDDCF]' + }, + { + 'name': 'InArabic', + 'bmp': '\u0600-\u06FF' + }, + { + 'name': 'InArabic_Extended_A', + 'bmp': '\u08A0-\u08FF' + }, + { + 'name': 'InArabic_Mathematical_Alphabetic_Symbols', + 'astral': '\uD83B[\uDE00-\uDEFF]' + }, + { + 'name': 'InArabic_Presentation_Forms_A', + 'bmp': '\uFB50-\uFDFF' + }, + { + 'name': 'InArabic_Presentation_Forms_B', + 'bmp': '\uFE70-\uFEFF' + }, + { + 'name': 'InArabic_Supplement', + 'bmp': '\u0750-\u077F' + }, + { + 'name': 'InArmenian', + 'bmp': '\u0530-\u058F' + }, + { + 'name': 'InArrows', + 'bmp': '\u2190-\u21FF' + }, + { + 'name': 'InAvestan', + 'astral': '\uD802[\uDF00-\uDF3F]' + }, + { + 'name': 'InBalinese', + 'bmp': '\u1B00-\u1B7F' + }, + { + 'name': 'InBamum', + 'bmp': '\uA6A0-\uA6FF' + }, + { + 'name': 'InBamum_Supplement', + 'astral': '\uD81A[\uDC00-\uDE3F]' + }, + { + 'name': 'InBasic_Latin', + 'bmp': '\0-\x7F' + }, + { + 'name': 'InBassa_Vah', + 'astral': '\uD81A[\uDED0-\uDEFF]' + }, + { + 'name': 'InBatak', + 'bmp': '\u1BC0-\u1BFF' + }, + { + 'name': 'InBengali', + 'bmp': '\u0980-\u09FF' + }, + { + 'name': 'InBhaiksuki', + 'astral': '\uD807[\uDC00-\uDC6F]' + }, + { + 'name': 'InBlock_Elements', + 'bmp': '\u2580-\u259F' + }, + { + 'name': 'InBopomofo', + 'bmp': '\u3100-\u312F' + }, + { + 'name': 'InBopomofo_Extended', + 'bmp': '\u31A0-\u31BF' + }, + { + 'name': 'InBox_Drawing', + 'bmp': '\u2500-\u257F' + }, + { + 'name': 'InBrahmi', + 'astral': '\uD804[\uDC00-\uDC7F]' + }, + { + 'name': 'InBraille_Patterns', + 'bmp': '\u2800-\u28FF' + }, + { + 'name': 'InBuginese', + 'bmp': '\u1A00-\u1A1F' + }, + { + 'name': 'InBuhid', + 'bmp': '\u1740-\u175F' + }, + { + 'name': 'InByzantine_Musical_Symbols', + 'astral': '\uD834[\uDC00-\uDCFF]' + }, + { + 'name': 'InCJK_Compatibility', + 'bmp': '\u3300-\u33FF' + }, + { + 'name': 'InCJK_Compatibility_Forms', + 'bmp': '\uFE30-\uFE4F' + }, + { + 'name': 'InCJK_Compatibility_Ideographs', + 'bmp': '\uF900-\uFAFF' + }, + { + 'name': 'InCJK_Compatibility_Ideographs_Supplement', + 'astral': '\uD87E[\uDC00-\uDE1F]' + }, + { + 'name': 'InCJK_Radicals_Supplement', + 'bmp': '\u2E80-\u2EFF' + }, + { + 'name': 'InCJK_Strokes', + 'bmp': '\u31C0-\u31EF' + }, + { + 'name': 'InCJK_Symbols_And_Punctuation', + 'bmp': '\u3000-\u303F' + }, + { + 'name': 'InCJK_Unified_Ideographs', + 'bmp': '\u4E00-\u9FFF' + }, + { + 'name': 'InCJK_Unified_Ideographs_Extension_A', + 'bmp': '\u3400-\u4DBF' + }, + { + 'name': 'InCJK_Unified_Ideographs_Extension_B', + 'astral': '[\uD840-\uD868][\uDC00-\uDFFF]|\uD869[\uDC00-\uDEDF]' + }, + { + 'name': 'InCJK_Unified_Ideographs_Extension_C', + 'astral': '\uD869[\uDF00-\uDFFF]|[\uD86A-\uD86C][\uDC00-\uDFFF]|\uD86D[\uDC00-\uDF3F]' + }, + { + 'name': 'InCJK_Unified_Ideographs_Extension_D', + 'astral': '\uD86D[\uDF40-\uDFFF]|\uD86E[\uDC00-\uDC1F]' + }, + { + 'name': 'InCJK_Unified_Ideographs_Extension_E', + 'astral': '\uD86E[\uDC20-\uDFFF]|[\uD86F-\uD872][\uDC00-\uDFFF]|\uD873[\uDC00-\uDEAF]' + }, + { + 'name': 'InCJK_Unified_Ideographs_Extension_F', + 'astral': '\uD873[\uDEB0-\uDFFF]|[\uD874-\uD879][\uDC00-\uDFFF]|\uD87A[\uDC00-\uDFEF]' + }, + { + 'name': 'InCarian', + 'astral': '\uD800[\uDEA0-\uDEDF]' + }, + { + 'name': 'InCaucasian_Albanian', + 'astral': '\uD801[\uDD30-\uDD6F]' + }, + { + 'name': 'InChakma', + 'astral': '\uD804[\uDD00-\uDD4F]' + }, + { + 'name': 'InCham', + 'bmp': '\uAA00-\uAA5F' + }, + { + 'name': 'InCherokee', + 'bmp': '\u13A0-\u13FF' + }, + { + 'name': 'InCherokee_Supplement', + 'bmp': '\uAB70-\uABBF' + }, + { + 'name': 'InChess_Symbols', + 'astral': '\uD83E[\uDE00-\uDE6F]' + }, + { + 'name': 'InCombining_Diacritical_Marks', + 'bmp': '\u0300-\u036F' + }, + { + 'name': 'InCombining_Diacritical_Marks_Extended', + 'bmp': '\u1AB0-\u1AFF' + }, + { + 'name': 'InCombining_Diacritical_Marks_For_Symbols', + 'bmp': '\u20D0-\u20FF' + }, + { + 'name': 'InCombining_Diacritical_Marks_Supplement', + 'bmp': '\u1DC0-\u1DFF' + }, + { + 'name': 'InCombining_Half_Marks', + 'bmp': '\uFE20-\uFE2F' + }, + { + 'name': 'InCommon_Indic_Number_Forms', + 'bmp': '\uA830-\uA83F' + }, + { + 'name': 'InControl_Pictures', + 'bmp': '\u2400-\u243F' + }, + { + 'name': 'InCoptic', + 'bmp': '\u2C80-\u2CFF' + }, + { + 'name': 'InCoptic_Epact_Numbers', + 'astral': '\uD800[\uDEE0-\uDEFF]' + }, + { + 'name': 'InCounting_Rod_Numerals', + 'astral': '\uD834[\uDF60-\uDF7F]' + }, + { + 'name': 'InCuneiform', + 'astral': '\uD808[\uDC00-\uDFFF]' + }, + { + 'name': 'InCuneiform_Numbers_And_Punctuation', + 'astral': '\uD809[\uDC00-\uDC7F]' + }, + { + 'name': 'InCurrency_Symbols', + 'bmp': '\u20A0-\u20CF' + }, + { + 'name': 'InCypriot_Syllabary', + 'astral': '\uD802[\uDC00-\uDC3F]' + }, + { + 'name': 'InCyrillic', + 'bmp': '\u0400-\u04FF' + }, + { + 'name': 'InCyrillic_Extended_A', + 'bmp': '\u2DE0-\u2DFF' + }, + { + 'name': 'InCyrillic_Extended_B', + 'bmp': '\uA640-\uA69F' + }, + { + 'name': 'InCyrillic_Extended_C', + 'bmp': '\u1C80-\u1C8F' + }, + { + 'name': 'InCyrillic_Supplement', + 'bmp': '\u0500-\u052F' + }, + { + 'name': 'InDeseret', + 'astral': '\uD801[\uDC00-\uDC4F]' + }, + { + 'name': 'InDevanagari', + 'bmp': '\u0900-\u097F' + }, + { + 'name': 'InDevanagari_Extended', + 'bmp': '\uA8E0-\uA8FF' + }, + { + 'name': 'InDingbats', + 'bmp': '\u2700-\u27BF' + }, + { + 'name': 'InDogra', + 'astral': '\uD806[\uDC00-\uDC4F]' + }, + { + 'name': 'InDomino_Tiles', + 'astral': '\uD83C[\uDC30-\uDC9F]' + }, + { + 'name': 'InDuployan', + 'astral': '\uD82F[\uDC00-\uDC9F]' + }, + { + 'name': 'InEarly_Dynastic_Cuneiform', + 'astral': '\uD809[\uDC80-\uDD4F]' + }, + { + 'name': 'InEgyptian_Hieroglyphs', + 'astral': '\uD80C[\uDC00-\uDFFF]|\uD80D[\uDC00-\uDC2F]' + }, + { + 'name': 'InElbasan', + 'astral': '\uD801[\uDD00-\uDD2F]' + }, + { + 'name': 'InEmoticons', + 'astral': '\uD83D[\uDE00-\uDE4F]' + }, + { + 'name': 'InEnclosed_Alphanumeric_Supplement', + 'astral': '\uD83C[\uDD00-\uDDFF]' + }, + { + 'name': 'InEnclosed_Alphanumerics', + 'bmp': '\u2460-\u24FF' + }, + { + 'name': 'InEnclosed_CJK_Letters_And_Months', + 'bmp': '\u3200-\u32FF' + }, + { + 'name': 'InEnclosed_Ideographic_Supplement', + 'astral': '\uD83C[\uDE00-\uDEFF]' + }, + { + 'name': 'InEthiopic', + 'bmp': '\u1200-\u137F' + }, + { + 'name': 'InEthiopic_Extended', + 'bmp': '\u2D80-\u2DDF' + }, + { + 'name': 'InEthiopic_Extended_A', + 'bmp': '\uAB00-\uAB2F' + }, + { + 'name': 'InEthiopic_Supplement', + 'bmp': '\u1380-\u139F' + }, + { + 'name': 'InGeneral_Punctuation', + 'bmp': '\u2000-\u206F' + }, + { + 'name': 'InGeometric_Shapes', + 'bmp': '\u25A0-\u25FF' + }, + { + 'name': 'InGeometric_Shapes_Extended', + 'astral': '\uD83D[\uDF80-\uDFFF]' + }, + { + 'name': 'InGeorgian', + 'bmp': '\u10A0-\u10FF' + }, + { + 'name': 'InGeorgian_Extended', + 'bmp': '\u1C90-\u1CBF' + }, + { + 'name': 'InGeorgian_Supplement', + 'bmp': '\u2D00-\u2D2F' + }, + { + 'name': 'InGlagolitic', + 'bmp': '\u2C00-\u2C5F' + }, + { + 'name': 'InGlagolitic_Supplement', + 'astral': '\uD838[\uDC00-\uDC2F]' + }, + { + 'name': 'InGothic', + 'astral': '\uD800[\uDF30-\uDF4F]' + }, + { + 'name': 'InGrantha', + 'astral': '\uD804[\uDF00-\uDF7F]' + }, + { + 'name': 'InGreek_And_Coptic', + 'bmp': '\u0370-\u03FF' + }, + { + 'name': 'InGreek_Extended', + 'bmp': '\u1F00-\u1FFF' + }, + { + 'name': 'InGujarati', + 'bmp': '\u0A80-\u0AFF' + }, + { + 'name': 'InGunjala_Gondi', + 'astral': '\uD807[\uDD60-\uDDAF]' + }, + { + 'name': 'InGurmukhi', + 'bmp': '\u0A00-\u0A7F' + }, + { + 'name': 'InHalfwidth_And_Fullwidth_Forms', + 'bmp': '\uFF00-\uFFEF' + }, + { + 'name': 'InHangul_Compatibility_Jamo', + 'bmp': '\u3130-\u318F' + }, + { + 'name': 'InHangul_Jamo', + 'bmp': '\u1100-\u11FF' + }, + { + 'name': 'InHangul_Jamo_Extended_A', + 'bmp': '\uA960-\uA97F' + }, + { + 'name': 'InHangul_Jamo_Extended_B', + 'bmp': '\uD7B0-\uD7FF' + }, + { + 'name': 'InHangul_Syllables', + 'bmp': '\uAC00-\uD7AF' + }, + { + 'name': 'InHanifi_Rohingya', + 'astral': '\uD803[\uDD00-\uDD3F]' + }, + { + 'name': 'InHanunoo', + 'bmp': '\u1720-\u173F' + }, + { + 'name': 'InHatran', + 'astral': '\uD802[\uDCE0-\uDCFF]' + }, + { + 'name': 'InHebrew', + 'bmp': '\u0590-\u05FF' + }, + { + 'name': 'InHigh_Private_Use_Surrogates', + 'bmp': '\uDB80-\uDBFF' + }, + { + 'name': 'InHigh_Surrogates', + 'bmp': '\uD800-\uDB7F' + }, + { + 'name': 'InHiragana', + 'bmp': '\u3040-\u309F' + }, + { + 'name': 'InIPA_Extensions', + 'bmp': '\u0250-\u02AF' + }, + { + 'name': 'InIdeographic_Description_Characters', + 'bmp': '\u2FF0-\u2FFF' + }, + { + 'name': 'InIdeographic_Symbols_And_Punctuation', + 'astral': '\uD81B[\uDFE0-\uDFFF]' + }, + { + 'name': 'InImperial_Aramaic', + 'astral': '\uD802[\uDC40-\uDC5F]' + }, + { + 'name': 'InIndic_Siyaq_Numbers', + 'astral': '\uD83B[\uDC70-\uDCBF]' + }, + { + 'name': 'InInscriptional_Pahlavi', + 'astral': '\uD802[\uDF60-\uDF7F]' + }, + { + 'name': 'InInscriptional_Parthian', + 'astral': '\uD802[\uDF40-\uDF5F]' + }, + { + 'name': 'InJavanese', + 'bmp': '\uA980-\uA9DF' + }, + { + 'name': 'InKaithi', + 'astral': '\uD804[\uDC80-\uDCCF]' + }, + { + 'name': 'InKana_Extended_A', + 'astral': '\uD82C[\uDD00-\uDD2F]' + }, + { + 'name': 'InKana_Supplement', + 'astral': '\uD82C[\uDC00-\uDCFF]' + }, + { + 'name': 'InKanbun', + 'bmp': '\u3190-\u319F' + }, + { + 'name': 'InKangxi_Radicals', + 'bmp': '\u2F00-\u2FDF' + }, + { + 'name': 'InKannada', + 'bmp': '\u0C80-\u0CFF' + }, + { + 'name': 'InKatakana', + 'bmp': '\u30A0-\u30FF' + }, + { + 'name': 'InKatakana_Phonetic_Extensions', + 'bmp': '\u31F0-\u31FF' + }, + { + 'name': 'InKayah_Li', + 'bmp': '\uA900-\uA92F' + }, + { + 'name': 'InKharoshthi', + 'astral': '\uD802[\uDE00-\uDE5F]' + }, + { + 'name': 'InKhmer', + 'bmp': '\u1780-\u17FF' + }, + { + 'name': 'InKhmer_Symbols', + 'bmp': '\u19E0-\u19FF' + }, + { + 'name': 'InKhojki', + 'astral': '\uD804[\uDE00-\uDE4F]' + }, + { + 'name': 'InKhudawadi', + 'astral': '\uD804[\uDEB0-\uDEFF]' + }, + { + 'name': 'InLao', + 'bmp': '\u0E80-\u0EFF' + }, + { + 'name': 'InLatin_1_Supplement', + 'bmp': '\x80-\xFF' + }, + { + 'name': 'InLatin_Extended_A', + 'bmp': '\u0100-\u017F' + }, + { + 'name': 'InLatin_Extended_Additional', + 'bmp': '\u1E00-\u1EFF' + }, + { + 'name': 'InLatin_Extended_B', + 'bmp': '\u0180-\u024F' + }, + { + 'name': 'InLatin_Extended_C', + 'bmp': '\u2C60-\u2C7F' + }, + { + 'name': 'InLatin_Extended_D', + 'bmp': '\uA720-\uA7FF' + }, + { + 'name': 'InLatin_Extended_E', + 'bmp': '\uAB30-\uAB6F' + }, + { + 'name': 'InLepcha', + 'bmp': '\u1C00-\u1C4F' + }, + { + 'name': 'InLetterlike_Symbols', + 'bmp': '\u2100-\u214F' + }, + { + 'name': 'InLimbu', + 'bmp': '\u1900-\u194F' + }, + { + 'name': 'InLinear_A', + 'astral': '\uD801[\uDE00-\uDF7F]' + }, + { + 'name': 'InLinear_B_Ideograms', + 'astral': '\uD800[\uDC80-\uDCFF]' + }, + { + 'name': 'InLinear_B_Syllabary', + 'astral': '\uD800[\uDC00-\uDC7F]' + }, + { + 'name': 'InLisu', + 'bmp': '\uA4D0-\uA4FF' + }, + { + 'name': 'InLow_Surrogates', + 'bmp': '\uDC00-\uDFFF' + }, + { + 'name': 'InLycian', + 'astral': '\uD800[\uDE80-\uDE9F]' + }, + { + 'name': 'InLydian', + 'astral': '\uD802[\uDD20-\uDD3F]' + }, + { + 'name': 'InMahajani', + 'astral': '\uD804[\uDD50-\uDD7F]' + }, + { + 'name': 'InMahjong_Tiles', + 'astral': '\uD83C[\uDC00-\uDC2F]' + }, + { + 'name': 'InMakasar', + 'astral': '\uD807[\uDEE0-\uDEFF]' + }, + { + 'name': 'InMalayalam', + 'bmp': '\u0D00-\u0D7F' + }, + { + 'name': 'InMandaic', + 'bmp': '\u0840-\u085F' + }, + { + 'name': 'InManichaean', + 'astral': '\uD802[\uDEC0-\uDEFF]' + }, + { + 'name': 'InMarchen', + 'astral': '\uD807[\uDC70-\uDCBF]' + }, + { + 'name': 'InMasaram_Gondi', + 'astral': '\uD807[\uDD00-\uDD5F]' + }, + { + 'name': 'InMathematical_Alphanumeric_Symbols', + 'astral': '\uD835[\uDC00-\uDFFF]' + }, + { + 'name': 'InMathematical_Operators', + 'bmp': '\u2200-\u22FF' + }, + { + 'name': 'InMayan_Numerals', + 'astral': '\uD834[\uDEE0-\uDEFF]' + }, + { + 'name': 'InMedefaidrin', + 'astral': '\uD81B[\uDE40-\uDE9F]' + }, + { + 'name': 'InMeetei_Mayek', + 'bmp': '\uABC0-\uABFF' + }, + { + 'name': 'InMeetei_Mayek_Extensions', + 'bmp': '\uAAE0-\uAAFF' + }, + { + 'name': 'InMende_Kikakui', + 'astral': '\uD83A[\uDC00-\uDCDF]' + }, + { + 'name': 'InMeroitic_Cursive', + 'astral': '\uD802[\uDDA0-\uDDFF]' + }, + { + 'name': 'InMeroitic_Hieroglyphs', + 'astral': '\uD802[\uDD80-\uDD9F]' + }, + { + 'name': 'InMiao', + 'astral': '\uD81B[\uDF00-\uDF9F]' + }, + { + 'name': 'InMiscellaneous_Mathematical_Symbols_A', + 'bmp': '\u27C0-\u27EF' + }, + { + 'name': 'InMiscellaneous_Mathematical_Symbols_B', + 'bmp': '\u2980-\u29FF' + }, + { + 'name': 'InMiscellaneous_Symbols', + 'bmp': '\u2600-\u26FF' + }, + { + 'name': 'InMiscellaneous_Symbols_And_Arrows', + 'bmp': '\u2B00-\u2BFF' + }, + { + 'name': 'InMiscellaneous_Symbols_And_Pictographs', + 'astral': '\uD83C[\uDF00-\uDFFF]|\uD83D[\uDC00-\uDDFF]' + }, + { + 'name': 'InMiscellaneous_Technical', + 'bmp': '\u2300-\u23FF' + }, + { + 'name': 'InModi', + 'astral': '\uD805[\uDE00-\uDE5F]' + }, + { + 'name': 'InModifier_Tone_Letters', + 'bmp': '\uA700-\uA71F' + }, + { + 'name': 'InMongolian', + 'bmp': '\u1800-\u18AF' + }, + { + 'name': 'InMongolian_Supplement', + 'astral': '\uD805[\uDE60-\uDE7F]' + }, + { + 'name': 'InMro', + 'astral': '\uD81A[\uDE40-\uDE6F]' + }, + { + 'name': 'InMultani', + 'astral': '\uD804[\uDE80-\uDEAF]' + }, + { + 'name': 'InMusical_Symbols', + 'astral': '\uD834[\uDD00-\uDDFF]' + }, + { + 'name': 'InMyanmar', + 'bmp': '\u1000-\u109F' + }, + { + 'name': 'InMyanmar_Extended_A', + 'bmp': '\uAA60-\uAA7F' + }, + { + 'name': 'InMyanmar_Extended_B', + 'bmp': '\uA9E0-\uA9FF' + }, + { + 'name': 'InNKo', + 'bmp': '\u07C0-\u07FF' + }, + { + 'name': 'InNabataean', + 'astral': '\uD802[\uDC80-\uDCAF]' + }, + { + 'name': 'InNew_Tai_Lue', + 'bmp': '\u1980-\u19DF' + }, + { + 'name': 'InNewa', + 'astral': '\uD805[\uDC00-\uDC7F]' + }, + { + 'name': 'InNumber_Forms', + 'bmp': '\u2150-\u218F' + }, + { + 'name': 'InNushu', + 'astral': '\uD82C[\uDD70-\uDEFF]' + }, + { + 'name': 'InOgham', + 'bmp': '\u1680-\u169F' + }, + { + 'name': 'InOl_Chiki', + 'bmp': '\u1C50-\u1C7F' + }, + { + 'name': 'InOld_Hungarian', + 'astral': '\uD803[\uDC80-\uDCFF]' + }, + { + 'name': 'InOld_Italic', + 'astral': '\uD800[\uDF00-\uDF2F]' + }, + { + 'name': 'InOld_North_Arabian', + 'astral': '\uD802[\uDE80-\uDE9F]' + }, + { + 'name': 'InOld_Permic', + 'astral': '\uD800[\uDF50-\uDF7F]' + }, + { + 'name': 'InOld_Persian', + 'astral': '\uD800[\uDFA0-\uDFDF]' + }, + { + 'name': 'InOld_Sogdian', + 'astral': '\uD803[\uDF00-\uDF2F]' + }, + { + 'name': 'InOld_South_Arabian', + 'astral': '\uD802[\uDE60-\uDE7F]' + }, + { + 'name': 'InOld_Turkic', + 'astral': '\uD803[\uDC00-\uDC4F]' + }, + { + 'name': 'InOptical_Character_Recognition', + 'bmp': '\u2440-\u245F' + }, + { + 'name': 'InOriya', + 'bmp': '\u0B00-\u0B7F' + }, + { + 'name': 'InOrnamental_Dingbats', + 'astral': '\uD83D[\uDE50-\uDE7F]' + }, + { + 'name': 'InOsage', + 'astral': '\uD801[\uDCB0-\uDCFF]' + }, + { + 'name': 'InOsmanya', + 'astral': '\uD801[\uDC80-\uDCAF]' + }, + { + 'name': 'InPahawh_Hmong', + 'astral': '\uD81A[\uDF00-\uDF8F]' + }, + { + 'name': 'InPalmyrene', + 'astral': '\uD802[\uDC60-\uDC7F]' + }, + { + 'name': 'InPau_Cin_Hau', + 'astral': '\uD806[\uDEC0-\uDEFF]' + }, + { + 'name': 'InPhags_Pa', + 'bmp': '\uA840-\uA87F' + }, + { + 'name': 'InPhaistos_Disc', + 'astral': '\uD800[\uDDD0-\uDDFF]' + }, + { + 'name': 'InPhoenician', + 'astral': '\uD802[\uDD00-\uDD1F]' + }, + { + 'name': 'InPhonetic_Extensions', + 'bmp': '\u1D00-\u1D7F' + }, + { + 'name': 'InPhonetic_Extensions_Supplement', + 'bmp': '\u1D80-\u1DBF' + }, + { + 'name': 'InPlaying_Cards', + 'astral': '\uD83C[\uDCA0-\uDCFF]' + }, + { + 'name': 'InPrivate_Use_Area', + 'bmp': '\uE000-\uF8FF' + }, + { + 'name': 'InPsalter_Pahlavi', + 'astral': '\uD802[\uDF80-\uDFAF]' + }, + { + 'name': 'InRejang', + 'bmp': '\uA930-\uA95F' + }, + { + 'name': 'InRumi_Numeral_Symbols', + 'astral': '\uD803[\uDE60-\uDE7F]' + }, + { + 'name': 'InRunic', + 'bmp': '\u16A0-\u16FF' + }, + { + 'name': 'InSamaritan', + 'bmp': '\u0800-\u083F' + }, + { + 'name': 'InSaurashtra', + 'bmp': '\uA880-\uA8DF' + }, + { + 'name': 'InSharada', + 'astral': '\uD804[\uDD80-\uDDDF]' + }, + { + 'name': 'InShavian', + 'astral': '\uD801[\uDC50-\uDC7F]' + }, + { + 'name': 'InShorthand_Format_Controls', + 'astral': '\uD82F[\uDCA0-\uDCAF]' + }, + { + 'name': 'InSiddham', + 'astral': '\uD805[\uDD80-\uDDFF]' + }, + { + 'name': 'InSinhala', + 'bmp': '\u0D80-\u0DFF' + }, + { + 'name': 'InSinhala_Archaic_Numbers', + 'astral': '\uD804[\uDDE0-\uDDFF]' + }, + { + 'name': 'InSmall_Form_Variants', + 'bmp': '\uFE50-\uFE6F' + }, + { + 'name': 'InSogdian', + 'astral': '\uD803[\uDF30-\uDF6F]' + }, + { + 'name': 'InSora_Sompeng', + 'astral': '\uD804[\uDCD0-\uDCFF]' + }, + { + 'name': 'InSoyombo', + 'astral': '\uD806[\uDE50-\uDEAF]' + }, + { + 'name': 'InSpacing_Modifier_Letters', + 'bmp': '\u02B0-\u02FF' + }, + { + 'name': 'InSpecials', + 'bmp': '\uFFF0-\uFFFF' + }, + { + 'name': 'InSundanese', + 'bmp': '\u1B80-\u1BBF' + }, + { + 'name': 'InSundanese_Supplement', + 'bmp': '\u1CC0-\u1CCF' + }, + { + 'name': 'InSuperscripts_And_Subscripts', + 'bmp': '\u2070-\u209F' + }, + { + 'name': 'InSupplemental_Arrows_A', + 'bmp': '\u27F0-\u27FF' + }, + { + 'name': 'InSupplemental_Arrows_B', + 'bmp': '\u2900-\u297F' + }, + { + 'name': 'InSupplemental_Arrows_C', + 'astral': '\uD83E[\uDC00-\uDCFF]' + }, + { + 'name': 'InSupplemental_Mathematical_Operators', + 'bmp': '\u2A00-\u2AFF' + }, + { + 'name': 'InSupplemental_Punctuation', + 'bmp': '\u2E00-\u2E7F' + }, + { + 'name': 'InSupplemental_Symbols_And_Pictographs', + 'astral': '\uD83E[\uDD00-\uDDFF]' + }, + { + 'name': 'InSupplementary_Private_Use_Area_A', + 'astral': '[\uDB80-\uDBBF][\uDC00-\uDFFF]' + }, + { + 'name': 'InSupplementary_Private_Use_Area_B', + 'astral': '[\uDBC0-\uDBFF][\uDC00-\uDFFF]' + }, + { + 'name': 'InSutton_SignWriting', + 'astral': '\uD836[\uDC00-\uDEAF]' + }, + { + 'name': 'InSyloti_Nagri', + 'bmp': '\uA800-\uA82F' + }, + { + 'name': 'InSyriac', + 'bmp': '\u0700-\u074F' + }, + { + 'name': 'InSyriac_Supplement', + 'bmp': '\u0860-\u086F' + }, + { + 'name': 'InTagalog', + 'bmp': '\u1700-\u171F' + }, + { + 'name': 'InTagbanwa', + 'bmp': '\u1760-\u177F' + }, + { + 'name': 'InTags', + 'astral': '\uDB40[\uDC00-\uDC7F]' + }, + { + 'name': 'InTai_Le', + 'bmp': '\u1950-\u197F' + }, + { + 'name': 'InTai_Tham', + 'bmp': '\u1A20-\u1AAF' + }, + { + 'name': 'InTai_Viet', + 'bmp': '\uAA80-\uAADF' + }, + { + 'name': 'InTai_Xuan_Jing_Symbols', + 'astral': '\uD834[\uDF00-\uDF5F]' + }, + { + 'name': 'InTakri', + 'astral': '\uD805[\uDE80-\uDECF]' + }, + { + 'name': 'InTamil', + 'bmp': '\u0B80-\u0BFF' + }, + { + 'name': 'InTangut', + 'astral': '[\uD81C-\uD821][\uDC00-\uDFFF]' + }, + { + 'name': 'InTangut_Components', + 'astral': '\uD822[\uDC00-\uDEFF]' + }, + { + 'name': 'InTelugu', + 'bmp': '\u0C00-\u0C7F' + }, + { + 'name': 'InThaana', + 'bmp': '\u0780-\u07BF' + }, + { + 'name': 'InThai', + 'bmp': '\u0E00-\u0E7F' + }, + { + 'name': 'InTibetan', + 'bmp': '\u0F00-\u0FFF' + }, + { + 'name': 'InTifinagh', + 'bmp': '\u2D30-\u2D7F' + }, + { + 'name': 'InTirhuta', + 'astral': '\uD805[\uDC80-\uDCDF]' + }, + { + 'name': 'InTransport_And_Map_Symbols', + 'astral': '\uD83D[\uDE80-\uDEFF]' + }, + { + 'name': 'InUgaritic', + 'astral': '\uD800[\uDF80-\uDF9F]' + }, + { + 'name': 'InUnified_Canadian_Aboriginal_Syllabics', + 'bmp': '\u1400-\u167F' + }, + { + 'name': 'InUnified_Canadian_Aboriginal_Syllabics_Extended', + 'bmp': '\u18B0-\u18FF' + }, + { + 'name': 'InVai', + 'bmp': '\uA500-\uA63F' + }, + { + 'name': 'InVariation_Selectors', + 'bmp': '\uFE00-\uFE0F' + }, + { + 'name': 'InVariation_Selectors_Supplement', + 'astral': '\uDB40[\uDD00-\uDDEF]' + }, + { + 'name': 'InVedic_Extensions', + 'bmp': '\u1CD0-\u1CFF' + }, + { + 'name': 'InVertical_Forms', + 'bmp': '\uFE10-\uFE1F' + }, + { + 'name': 'InWarang_Citi', + 'astral': '\uD806[\uDCA0-\uDCFF]' + }, + { + 'name': 'InYi_Radicals', + 'bmp': '\uA490-\uA4CF' + }, + { + 'name': 'InYi_Syllables', + 'bmp': '\uA000-\uA48F' + }, + { + 'name': 'InYijing_Hexagram_Symbols', + 'bmp': '\u4DC0-\u4DFF' + }, + { + 'name': 'InZanabazar_Square', + 'astral': '\uD806[\uDE00-\uDE4F]' + } +]; + +var unicodeBlocks = createCommonjsModule(function (module, exports) { +"use strict"; + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.default = void 0; + +var _blocks = _interopRequireDefault(blocks); + +function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } + +/*! + * XRegExp Unicode Blocks 4.2.0 + * + * Steven Levithan (c) 2010-present MIT License + * Unicode data by Mathias Bynens + */ +var _default = function _default(XRegExp) { + /** + * Adds support for all Unicode blocks. Block names use the prefix 'In'. E.g., + * `\p{InBasicLatin}`. Token names are case insensitive, and any spaces, hyphens, and + * underscores are ignored. + * + * Uses Unicode 11.0.0. + * + * @requires XRegExp, Unicode Base + */ + if (!XRegExp.addUnicodeData) { + throw new ReferenceError('Unicode Base must be loaded before Unicode Blocks'); + } + + XRegExp.addUnicodeData(_blocks.default); +}; + +exports.default = _default; +module.exports = exports["default"]; +}); + +unwrapExports(unicodeBlocks); + +var categories = [ + { + 'name': 'C', + 'alias': 'Other', + 'isBmpLast': true, + 'bmp': '\0-\x1F\x7F-\x9F\xAD\u0378\u0379\u0380-\u0383\u038B\u038D\u03A2\u0530\u0557\u0558\u058B\u058C\u0590\u05C8-\u05CF\u05EB-\u05EE\u05F5-\u0605\u061C\u061D\u06DD\u070E\u070F\u074B\u074C\u07B2-\u07BF\u07FB\u07FC\u082E\u082F\u083F\u085C\u085D\u085F\u086B-\u089F\u08B5\u08BE-\u08D2\u08E2\u0984\u098D\u098E\u0991\u0992\u09A9\u09B1\u09B3-\u09B5\u09BA\u09BB\u09C5\u09C6\u09C9\u09CA\u09CF-\u09D6\u09D8-\u09DB\u09DE\u09E4\u09E5\u09FF\u0A00\u0A04\u0A0B-\u0A0E\u0A11\u0A12\u0A29\u0A31\u0A34\u0A37\u0A3A\u0A3B\u0A3D\u0A43-\u0A46\u0A49\u0A4A\u0A4E-\u0A50\u0A52-\u0A58\u0A5D\u0A5F-\u0A65\u0A77-\u0A80\u0A84\u0A8E\u0A92\u0AA9\u0AB1\u0AB4\u0ABA\u0ABB\u0AC6\u0ACA\u0ACE\u0ACF\u0AD1-\u0ADF\u0AE4\u0AE5\u0AF2-\u0AF8\u0B00\u0B04\u0B0D\u0B0E\u0B11\u0B12\u0B29\u0B31\u0B34\u0B3A\u0B3B\u0B45\u0B46\u0B49\u0B4A\u0B4E-\u0B55\u0B58-\u0B5B\u0B5E\u0B64\u0B65\u0B78-\u0B81\u0B84\u0B8B-\u0B8D\u0B91\u0B96-\u0B98\u0B9B\u0B9D\u0BA0-\u0BA2\u0BA5-\u0BA7\u0BAB-\u0BAD\u0BBA-\u0BBD\u0BC3-\u0BC5\u0BC9\u0BCE\u0BCF\u0BD1-\u0BD6\u0BD8-\u0BE5\u0BFB-\u0BFF\u0C0D\u0C11\u0C29\u0C3A-\u0C3C\u0C45\u0C49\u0C4E-\u0C54\u0C57\u0C5B-\u0C5F\u0C64\u0C65\u0C70-\u0C77\u0C8D\u0C91\u0CA9\u0CB4\u0CBA\u0CBB\u0CC5\u0CC9\u0CCE-\u0CD4\u0CD7-\u0CDD\u0CDF\u0CE4\u0CE5\u0CF0\u0CF3-\u0CFF\u0D04\u0D0D\u0D11\u0D45\u0D49\u0D50-\u0D53\u0D64\u0D65\u0D80\u0D81\u0D84\u0D97-\u0D99\u0DB2\u0DBC\u0DBE\u0DBF\u0DC7-\u0DC9\u0DCB-\u0DCE\u0DD5\u0DD7\u0DE0-\u0DE5\u0DF0\u0DF1\u0DF5-\u0E00\u0E3B-\u0E3E\u0E5C-\u0E80\u0E83\u0E85\u0E86\u0E89\u0E8B\u0E8C\u0E8E-\u0E93\u0E98\u0EA0\u0EA4\u0EA6\u0EA8\u0EA9\u0EAC\u0EBA\u0EBE\u0EBF\u0EC5\u0EC7\u0ECE\u0ECF\u0EDA\u0EDB\u0EE0-\u0EFF\u0F48\u0F6D-\u0F70\u0F98\u0FBD\u0FCD\u0FDB-\u0FFF\u10C6\u10C8-\u10CC\u10CE\u10CF\u1249\u124E\u124F\u1257\u1259\u125E\u125F\u1289\u128E\u128F\u12B1\u12B6\u12B7\u12BF\u12C1\u12C6\u12C7\u12D7\u1311\u1316\u1317\u135B\u135C\u137D-\u137F\u139A-\u139F\u13F6\u13F7\u13FE\u13FF\u169D-\u169F\u16F9-\u16FF\u170D\u1715-\u171F\u1737-\u173F\u1754-\u175F\u176D\u1771\u1774-\u177F\u17DE\u17DF\u17EA-\u17EF\u17FA-\u17FF\u180E\u180F\u181A-\u181F\u1879-\u187F\u18AB-\u18AF\u18F6-\u18FF\u191F\u192C-\u192F\u193C-\u193F\u1941-\u1943\u196E\u196F\u1975-\u197F\u19AC-\u19AF\u19CA-\u19CF\u19DB-\u19DD\u1A1C\u1A1D\u1A5F\u1A7D\u1A7E\u1A8A-\u1A8F\u1A9A-\u1A9F\u1AAE\u1AAF\u1ABF-\u1AFF\u1B4C-\u1B4F\u1B7D-\u1B7F\u1BF4-\u1BFB\u1C38-\u1C3A\u1C4A-\u1C4C\u1C89-\u1C8F\u1CBB\u1CBC\u1CC8-\u1CCF\u1CFA-\u1CFF\u1DFA\u1F16\u1F17\u1F1E\u1F1F\u1F46\u1F47\u1F4E\u1F4F\u1F58\u1F5A\u1F5C\u1F5E\u1F7E\u1F7F\u1FB5\u1FC5\u1FD4\u1FD5\u1FDC\u1FF0\u1FF1\u1FF5\u1FFF\u200B-\u200F\u202A-\u202E\u2060-\u206F\u2072\u2073\u208F\u209D-\u209F\u20C0-\u20CF\u20F1-\u20FF\u218C-\u218F\u2427-\u243F\u244B-\u245F\u2B74\u2B75\u2B96\u2B97\u2BC9\u2BFF\u2C2F\u2C5F\u2CF4-\u2CF8\u2D26\u2D28-\u2D2C\u2D2E\u2D2F\u2D68-\u2D6E\u2D71-\u2D7E\u2D97-\u2D9F\u2DA7\u2DAF\u2DB7\u2DBF\u2DC7\u2DCF\u2DD7\u2DDF\u2E4F-\u2E7F\u2E9A\u2EF4-\u2EFF\u2FD6-\u2FEF\u2FFC-\u2FFF\u3040\u3097\u3098\u3100-\u3104\u3130\u318F\u31BB-\u31BF\u31E4-\u31EF\u321F\u32FF\u4DB6-\u4DBF\u9FF0-\u9FFF\uA48D-\uA48F\uA4C7-\uA4CF\uA62C-\uA63F\uA6F8-\uA6FF\uA7BA-\uA7F6\uA82C-\uA82F\uA83A-\uA83F\uA878-\uA87F\uA8C6-\uA8CD\uA8DA-\uA8DF\uA954-\uA95E\uA97D-\uA97F\uA9CE\uA9DA-\uA9DD\uA9FF\uAA37-\uAA3F\uAA4E\uAA4F\uAA5A\uAA5B\uAAC3-\uAADA\uAAF7-\uAB00\uAB07\uAB08\uAB0F\uAB10\uAB17-\uAB1F\uAB27\uAB2F\uAB66-\uAB6F\uABEE\uABEF\uABFA-\uABFF\uD7A4-\uD7AF\uD7C7-\uD7CA\uD7FC-\uF8FF\uFA6E\uFA6F\uFADA-\uFAFF\uFB07-\uFB12\uFB18-\uFB1C\uFB37\uFB3D\uFB3F\uFB42\uFB45\uFBC2-\uFBD2\uFD40-\uFD4F\uFD90\uFD91\uFDC8-\uFDEF\uFDFE\uFDFF\uFE1A-\uFE1F\uFE53\uFE67\uFE6C-\uFE6F\uFE75\uFEFD-\uFF00\uFFBF-\uFFC1\uFFC8\uFFC9\uFFD0\uFFD1\uFFD8\uFFD9\uFFDD-\uFFDF\uFFE7\uFFEF-\uFFFB\uFFFE\uFFFF', + 'astral': '\uD800[\uDC0C\uDC27\uDC3B\uDC3E\uDC4E\uDC4F\uDC5E-\uDC7F\uDCFB-\uDCFF\uDD03-\uDD06\uDD34-\uDD36\uDD8F\uDD9C-\uDD9F\uDDA1-\uDDCF\uDDFE-\uDE7F\uDE9D-\uDE9F\uDED1-\uDEDF\uDEFC-\uDEFF\uDF24-\uDF2C\uDF4B-\uDF4F\uDF7B-\uDF7F\uDF9E\uDFC4-\uDFC7\uDFD6-\uDFFF]|\uD801[\uDC9E\uDC9F\uDCAA-\uDCAF\uDCD4-\uDCD7\uDCFC-\uDCFF\uDD28-\uDD2F\uDD64-\uDD6E\uDD70-\uDDFF\uDF37-\uDF3F\uDF56-\uDF5F\uDF68-\uDFFF]|\uD802[\uDC06\uDC07\uDC09\uDC36\uDC39-\uDC3B\uDC3D\uDC3E\uDC56\uDC9F-\uDCA6\uDCB0-\uDCDF\uDCF3\uDCF6-\uDCFA\uDD1C-\uDD1E\uDD3A-\uDD3E\uDD40-\uDD7F\uDDB8-\uDDBB\uDDD0\uDDD1\uDE04\uDE07-\uDE0B\uDE14\uDE18\uDE36\uDE37\uDE3B-\uDE3E\uDE49-\uDE4F\uDE59-\uDE5F\uDEA0-\uDEBF\uDEE7-\uDEEA\uDEF7-\uDEFF\uDF36-\uDF38\uDF56\uDF57\uDF73-\uDF77\uDF92-\uDF98\uDF9D-\uDFA8\uDFB0-\uDFFF]|\uD803[\uDC49-\uDC7F\uDCB3-\uDCBF\uDCF3-\uDCF9\uDD28-\uDD2F\uDD3A-\uDE5F\uDE7F-\uDEFF\uDF28-\uDF2F\uDF5A-\uDFFF]|\uD804[\uDC4E-\uDC51\uDC70-\uDC7E\uDCBD\uDCC2-\uDCCF\uDCE9-\uDCEF\uDCFA-\uDCFF\uDD35\uDD47-\uDD4F\uDD77-\uDD7F\uDDCE\uDDCF\uDDE0\uDDF5-\uDDFF\uDE12\uDE3F-\uDE7F\uDE87\uDE89\uDE8E\uDE9E\uDEAA-\uDEAF\uDEEB-\uDEEF\uDEFA-\uDEFF\uDF04\uDF0D\uDF0E\uDF11\uDF12\uDF29\uDF31\uDF34\uDF3A\uDF45\uDF46\uDF49\uDF4A\uDF4E\uDF4F\uDF51-\uDF56\uDF58-\uDF5C\uDF64\uDF65\uDF6D-\uDF6F\uDF75-\uDFFF]|\uD805[\uDC5A\uDC5C\uDC5F-\uDC7F\uDCC8-\uDCCF\uDCDA-\uDD7F\uDDB6\uDDB7\uDDDE-\uDDFF\uDE45-\uDE4F\uDE5A-\uDE5F\uDE6D-\uDE7F\uDEB8-\uDEBF\uDECA-\uDEFF\uDF1B\uDF1C\uDF2C-\uDF2F\uDF40-\uDFFF]|\uD806[\uDC3C-\uDC9F\uDCF3-\uDCFE\uDD00-\uDDFF\uDE48-\uDE4F\uDE84\uDE85\uDEA3-\uDEBF\uDEF9-\uDFFF]|\uD807[\uDC09\uDC37\uDC46-\uDC4F\uDC6D-\uDC6F\uDC90\uDC91\uDCA8\uDCB7-\uDCFF\uDD07\uDD0A\uDD37-\uDD39\uDD3B\uDD3E\uDD48-\uDD4F\uDD5A-\uDD5F\uDD66\uDD69\uDD8F\uDD92\uDD99-\uDD9F\uDDAA-\uDEDF\uDEF9-\uDFFF]|\uD808[\uDF9A-\uDFFF]|\uD809[\uDC6F\uDC75-\uDC7F\uDD44-\uDFFF]|[\uD80A\uD80B\uD80E-\uD810\uD812-\uD819\uD823-\uD82B\uD82D\uD82E\uD830-\uD833\uD837\uD839\uD83F\uD87B-\uD87D\uD87F-\uDB3F\uDB41-\uDBFF][\uDC00-\uDFFF]|\uD80D[\uDC2F-\uDFFF]|\uD811[\uDE47-\uDFFF]|\uD81A[\uDE39-\uDE3F\uDE5F\uDE6A-\uDE6D\uDE70-\uDECF\uDEEE\uDEEF\uDEF6-\uDEFF\uDF46-\uDF4F\uDF5A\uDF62\uDF78-\uDF7C\uDF90-\uDFFF]|\uD81B[\uDC00-\uDE3F\uDE9B-\uDEFF\uDF45-\uDF4F\uDF7F-\uDF8E\uDFA0-\uDFDF\uDFE2-\uDFFF]|\uD821[\uDFF2-\uDFFF]|\uD822[\uDEF3-\uDFFF]|\uD82C[\uDD1F-\uDD6F\uDEFC-\uDFFF]|\uD82F[\uDC6B-\uDC6F\uDC7D-\uDC7F\uDC89-\uDC8F\uDC9A\uDC9B\uDCA0-\uDFFF]|\uD834[\uDCF6-\uDCFF\uDD27\uDD28\uDD73-\uDD7A\uDDE9-\uDDFF\uDE46-\uDEDF\uDEF4-\uDEFF\uDF57-\uDF5F\uDF79-\uDFFF]|\uD835[\uDC55\uDC9D\uDCA0\uDCA1\uDCA3\uDCA4\uDCA7\uDCA8\uDCAD\uDCBA\uDCBC\uDCC4\uDD06\uDD0B\uDD0C\uDD15\uDD1D\uDD3A\uDD3F\uDD45\uDD47-\uDD49\uDD51\uDEA6\uDEA7\uDFCC\uDFCD]|\uD836[\uDE8C-\uDE9A\uDEA0\uDEB0-\uDFFF]|\uD838[\uDC07\uDC19\uDC1A\uDC22\uDC25\uDC2B-\uDFFF]|\uD83A[\uDCC5\uDCC6\uDCD7-\uDCFF\uDD4B-\uDD4F\uDD5A-\uDD5D\uDD60-\uDFFF]|\uD83B[\uDC00-\uDC70\uDCB5-\uDDFF\uDE04\uDE20\uDE23\uDE25\uDE26\uDE28\uDE33\uDE38\uDE3A\uDE3C-\uDE41\uDE43-\uDE46\uDE48\uDE4A\uDE4C\uDE50\uDE53\uDE55\uDE56\uDE58\uDE5A\uDE5C\uDE5E\uDE60\uDE63\uDE65\uDE66\uDE6B\uDE73\uDE78\uDE7D\uDE7F\uDE8A\uDE9C-\uDEA0\uDEA4\uDEAA\uDEBC-\uDEEF\uDEF2-\uDFFF]|\uD83C[\uDC2C-\uDC2F\uDC94-\uDC9F\uDCAF\uDCB0\uDCC0\uDCD0\uDCF6-\uDCFF\uDD0D-\uDD0F\uDD6C-\uDD6F\uDDAD-\uDDE5\uDE03-\uDE0F\uDE3C-\uDE3F\uDE49-\uDE4F\uDE52-\uDE5F\uDE66-\uDEFF]|\uD83D[\uDED5-\uDEDF\uDEED-\uDEEF\uDEFA-\uDEFF\uDF74-\uDF7F\uDFD9-\uDFFF]|\uD83E[\uDC0C-\uDC0F\uDC48-\uDC4F\uDC5A-\uDC5F\uDC88-\uDC8F\uDCAE-\uDCFF\uDD0C-\uDD0F\uDD3F\uDD71\uDD72\uDD77-\uDD79\uDD7B\uDDA3-\uDDAF\uDDBA-\uDDBF\uDDC3-\uDDCF\uDE00-\uDE5F\uDE6E-\uDFFF]|\uD869[\uDED7-\uDEFF]|\uD86D[\uDF35-\uDF3F]|\uD86E[\uDC1E\uDC1F]|\uD873[\uDEA2-\uDEAF]|\uD87A[\uDFE1-\uDFFF]|\uD87E[\uDE1E-\uDFFF]|\uDB40[\uDC00-\uDCFF\uDDF0-\uDFFF]' + }, + { + 'name': 'Cc', + 'alias': 'Control', + 'bmp': '\0-\x1F\x7F-\x9F' + }, + { + 'name': 'Cf', + 'alias': 'Format', + 'bmp': '\xAD\u0600-\u0605\u061C\u06DD\u070F\u08E2\u180E\u200B-\u200F\u202A-\u202E\u2060-\u2064\u2066-\u206F\uFEFF\uFFF9-\uFFFB', + 'astral': '\uD804[\uDCBD\uDCCD]|\uD82F[\uDCA0-\uDCA3]|\uD834[\uDD73-\uDD7A]|\uDB40[\uDC01\uDC20-\uDC7F]' + }, + { + 'name': 'Cn', + 'alias': 'Unassigned', + 'bmp': '\u0378\u0379\u0380-\u0383\u038B\u038D\u03A2\u0530\u0557\u0558\u058B\u058C\u0590\u05C8-\u05CF\u05EB-\u05EE\u05F5-\u05FF\u061D\u070E\u074B\u074C\u07B2-\u07BF\u07FB\u07FC\u082E\u082F\u083F\u085C\u085D\u085F\u086B-\u089F\u08B5\u08BE-\u08D2\u0984\u098D\u098E\u0991\u0992\u09A9\u09B1\u09B3-\u09B5\u09BA\u09BB\u09C5\u09C6\u09C9\u09CA\u09CF-\u09D6\u09D8-\u09DB\u09DE\u09E4\u09E5\u09FF\u0A00\u0A04\u0A0B-\u0A0E\u0A11\u0A12\u0A29\u0A31\u0A34\u0A37\u0A3A\u0A3B\u0A3D\u0A43-\u0A46\u0A49\u0A4A\u0A4E-\u0A50\u0A52-\u0A58\u0A5D\u0A5F-\u0A65\u0A77-\u0A80\u0A84\u0A8E\u0A92\u0AA9\u0AB1\u0AB4\u0ABA\u0ABB\u0AC6\u0ACA\u0ACE\u0ACF\u0AD1-\u0ADF\u0AE4\u0AE5\u0AF2-\u0AF8\u0B00\u0B04\u0B0D\u0B0E\u0B11\u0B12\u0B29\u0B31\u0B34\u0B3A\u0B3B\u0B45\u0B46\u0B49\u0B4A\u0B4E-\u0B55\u0B58-\u0B5B\u0B5E\u0B64\u0B65\u0B78-\u0B81\u0B84\u0B8B-\u0B8D\u0B91\u0B96-\u0B98\u0B9B\u0B9D\u0BA0-\u0BA2\u0BA5-\u0BA7\u0BAB-\u0BAD\u0BBA-\u0BBD\u0BC3-\u0BC5\u0BC9\u0BCE\u0BCF\u0BD1-\u0BD6\u0BD8-\u0BE5\u0BFB-\u0BFF\u0C0D\u0C11\u0C29\u0C3A-\u0C3C\u0C45\u0C49\u0C4E-\u0C54\u0C57\u0C5B-\u0C5F\u0C64\u0C65\u0C70-\u0C77\u0C8D\u0C91\u0CA9\u0CB4\u0CBA\u0CBB\u0CC5\u0CC9\u0CCE-\u0CD4\u0CD7-\u0CDD\u0CDF\u0CE4\u0CE5\u0CF0\u0CF3-\u0CFF\u0D04\u0D0D\u0D11\u0D45\u0D49\u0D50-\u0D53\u0D64\u0D65\u0D80\u0D81\u0D84\u0D97-\u0D99\u0DB2\u0DBC\u0DBE\u0DBF\u0DC7-\u0DC9\u0DCB-\u0DCE\u0DD5\u0DD7\u0DE0-\u0DE5\u0DF0\u0DF1\u0DF5-\u0E00\u0E3B-\u0E3E\u0E5C-\u0E80\u0E83\u0E85\u0E86\u0E89\u0E8B\u0E8C\u0E8E-\u0E93\u0E98\u0EA0\u0EA4\u0EA6\u0EA8\u0EA9\u0EAC\u0EBA\u0EBE\u0EBF\u0EC5\u0EC7\u0ECE\u0ECF\u0EDA\u0EDB\u0EE0-\u0EFF\u0F48\u0F6D-\u0F70\u0F98\u0FBD\u0FCD\u0FDB-\u0FFF\u10C6\u10C8-\u10CC\u10CE\u10CF\u1249\u124E\u124F\u1257\u1259\u125E\u125F\u1289\u128E\u128F\u12B1\u12B6\u12B7\u12BF\u12C1\u12C6\u12C7\u12D7\u1311\u1316\u1317\u135B\u135C\u137D-\u137F\u139A-\u139F\u13F6\u13F7\u13FE\u13FF\u169D-\u169F\u16F9-\u16FF\u170D\u1715-\u171F\u1737-\u173F\u1754-\u175F\u176D\u1771\u1774-\u177F\u17DE\u17DF\u17EA-\u17EF\u17FA-\u17FF\u180F\u181A-\u181F\u1879-\u187F\u18AB-\u18AF\u18F6-\u18FF\u191F\u192C-\u192F\u193C-\u193F\u1941-\u1943\u196E\u196F\u1975-\u197F\u19AC-\u19AF\u19CA-\u19CF\u19DB-\u19DD\u1A1C\u1A1D\u1A5F\u1A7D\u1A7E\u1A8A-\u1A8F\u1A9A-\u1A9F\u1AAE\u1AAF\u1ABF-\u1AFF\u1B4C-\u1B4F\u1B7D-\u1B7F\u1BF4-\u1BFB\u1C38-\u1C3A\u1C4A-\u1C4C\u1C89-\u1C8F\u1CBB\u1CBC\u1CC8-\u1CCF\u1CFA-\u1CFF\u1DFA\u1F16\u1F17\u1F1E\u1F1F\u1F46\u1F47\u1F4E\u1F4F\u1F58\u1F5A\u1F5C\u1F5E\u1F7E\u1F7F\u1FB5\u1FC5\u1FD4\u1FD5\u1FDC\u1FF0\u1FF1\u1FF5\u1FFF\u2065\u2072\u2073\u208F\u209D-\u209F\u20C0-\u20CF\u20F1-\u20FF\u218C-\u218F\u2427-\u243F\u244B-\u245F\u2B74\u2B75\u2B96\u2B97\u2BC9\u2BFF\u2C2F\u2C5F\u2CF4-\u2CF8\u2D26\u2D28-\u2D2C\u2D2E\u2D2F\u2D68-\u2D6E\u2D71-\u2D7E\u2D97-\u2D9F\u2DA7\u2DAF\u2DB7\u2DBF\u2DC7\u2DCF\u2DD7\u2DDF\u2E4F-\u2E7F\u2E9A\u2EF4-\u2EFF\u2FD6-\u2FEF\u2FFC-\u2FFF\u3040\u3097\u3098\u3100-\u3104\u3130\u318F\u31BB-\u31BF\u31E4-\u31EF\u321F\u32FF\u4DB6-\u4DBF\u9FF0-\u9FFF\uA48D-\uA48F\uA4C7-\uA4CF\uA62C-\uA63F\uA6F8-\uA6FF\uA7BA-\uA7F6\uA82C-\uA82F\uA83A-\uA83F\uA878-\uA87F\uA8C6-\uA8CD\uA8DA-\uA8DF\uA954-\uA95E\uA97D-\uA97F\uA9CE\uA9DA-\uA9DD\uA9FF\uAA37-\uAA3F\uAA4E\uAA4F\uAA5A\uAA5B\uAAC3-\uAADA\uAAF7-\uAB00\uAB07\uAB08\uAB0F\uAB10\uAB17-\uAB1F\uAB27\uAB2F\uAB66-\uAB6F\uABEE\uABEF\uABFA-\uABFF\uD7A4-\uD7AF\uD7C7-\uD7CA\uD7FC-\uD7FF\uFA6E\uFA6F\uFADA-\uFAFF\uFB07-\uFB12\uFB18-\uFB1C\uFB37\uFB3D\uFB3F\uFB42\uFB45\uFBC2-\uFBD2\uFD40-\uFD4F\uFD90\uFD91\uFDC8-\uFDEF\uFDFE\uFDFF\uFE1A-\uFE1F\uFE53\uFE67\uFE6C-\uFE6F\uFE75\uFEFD\uFEFE\uFF00\uFFBF-\uFFC1\uFFC8\uFFC9\uFFD0\uFFD1\uFFD8\uFFD9\uFFDD-\uFFDF\uFFE7\uFFEF-\uFFF8\uFFFE\uFFFF', + 'astral': '\uD800[\uDC0C\uDC27\uDC3B\uDC3E\uDC4E\uDC4F\uDC5E-\uDC7F\uDCFB-\uDCFF\uDD03-\uDD06\uDD34-\uDD36\uDD8F\uDD9C-\uDD9F\uDDA1-\uDDCF\uDDFE-\uDE7F\uDE9D-\uDE9F\uDED1-\uDEDF\uDEFC-\uDEFF\uDF24-\uDF2C\uDF4B-\uDF4F\uDF7B-\uDF7F\uDF9E\uDFC4-\uDFC7\uDFD6-\uDFFF]|\uD801[\uDC9E\uDC9F\uDCAA-\uDCAF\uDCD4-\uDCD7\uDCFC-\uDCFF\uDD28-\uDD2F\uDD64-\uDD6E\uDD70-\uDDFF\uDF37-\uDF3F\uDF56-\uDF5F\uDF68-\uDFFF]|\uD802[\uDC06\uDC07\uDC09\uDC36\uDC39-\uDC3B\uDC3D\uDC3E\uDC56\uDC9F-\uDCA6\uDCB0-\uDCDF\uDCF3\uDCF6-\uDCFA\uDD1C-\uDD1E\uDD3A-\uDD3E\uDD40-\uDD7F\uDDB8-\uDDBB\uDDD0\uDDD1\uDE04\uDE07-\uDE0B\uDE14\uDE18\uDE36\uDE37\uDE3B-\uDE3E\uDE49-\uDE4F\uDE59-\uDE5F\uDEA0-\uDEBF\uDEE7-\uDEEA\uDEF7-\uDEFF\uDF36-\uDF38\uDF56\uDF57\uDF73-\uDF77\uDF92-\uDF98\uDF9D-\uDFA8\uDFB0-\uDFFF]|\uD803[\uDC49-\uDC7F\uDCB3-\uDCBF\uDCF3-\uDCF9\uDD28-\uDD2F\uDD3A-\uDE5F\uDE7F-\uDEFF\uDF28-\uDF2F\uDF5A-\uDFFF]|\uD804[\uDC4E-\uDC51\uDC70-\uDC7E\uDCC2-\uDCCC\uDCCE\uDCCF\uDCE9-\uDCEF\uDCFA-\uDCFF\uDD35\uDD47-\uDD4F\uDD77-\uDD7F\uDDCE\uDDCF\uDDE0\uDDF5-\uDDFF\uDE12\uDE3F-\uDE7F\uDE87\uDE89\uDE8E\uDE9E\uDEAA-\uDEAF\uDEEB-\uDEEF\uDEFA-\uDEFF\uDF04\uDF0D\uDF0E\uDF11\uDF12\uDF29\uDF31\uDF34\uDF3A\uDF45\uDF46\uDF49\uDF4A\uDF4E\uDF4F\uDF51-\uDF56\uDF58-\uDF5C\uDF64\uDF65\uDF6D-\uDF6F\uDF75-\uDFFF]|\uD805[\uDC5A\uDC5C\uDC5F-\uDC7F\uDCC8-\uDCCF\uDCDA-\uDD7F\uDDB6\uDDB7\uDDDE-\uDDFF\uDE45-\uDE4F\uDE5A-\uDE5F\uDE6D-\uDE7F\uDEB8-\uDEBF\uDECA-\uDEFF\uDF1B\uDF1C\uDF2C-\uDF2F\uDF40-\uDFFF]|\uD806[\uDC3C-\uDC9F\uDCF3-\uDCFE\uDD00-\uDDFF\uDE48-\uDE4F\uDE84\uDE85\uDEA3-\uDEBF\uDEF9-\uDFFF]|\uD807[\uDC09\uDC37\uDC46-\uDC4F\uDC6D-\uDC6F\uDC90\uDC91\uDCA8\uDCB7-\uDCFF\uDD07\uDD0A\uDD37-\uDD39\uDD3B\uDD3E\uDD48-\uDD4F\uDD5A-\uDD5F\uDD66\uDD69\uDD8F\uDD92\uDD99-\uDD9F\uDDAA-\uDEDF\uDEF9-\uDFFF]|\uD808[\uDF9A-\uDFFF]|\uD809[\uDC6F\uDC75-\uDC7F\uDD44-\uDFFF]|[\uD80A\uD80B\uD80E-\uD810\uD812-\uD819\uD823-\uD82B\uD82D\uD82E\uD830-\uD833\uD837\uD839\uD83F\uD87B-\uD87D\uD87F-\uDB3F\uDB41-\uDB7F][\uDC00-\uDFFF]|\uD80D[\uDC2F-\uDFFF]|\uD811[\uDE47-\uDFFF]|\uD81A[\uDE39-\uDE3F\uDE5F\uDE6A-\uDE6D\uDE70-\uDECF\uDEEE\uDEEF\uDEF6-\uDEFF\uDF46-\uDF4F\uDF5A\uDF62\uDF78-\uDF7C\uDF90-\uDFFF]|\uD81B[\uDC00-\uDE3F\uDE9B-\uDEFF\uDF45-\uDF4F\uDF7F-\uDF8E\uDFA0-\uDFDF\uDFE2-\uDFFF]|\uD821[\uDFF2-\uDFFF]|\uD822[\uDEF3-\uDFFF]|\uD82C[\uDD1F-\uDD6F\uDEFC-\uDFFF]|\uD82F[\uDC6B-\uDC6F\uDC7D-\uDC7F\uDC89-\uDC8F\uDC9A\uDC9B\uDCA4-\uDFFF]|\uD834[\uDCF6-\uDCFF\uDD27\uDD28\uDDE9-\uDDFF\uDE46-\uDEDF\uDEF4-\uDEFF\uDF57-\uDF5F\uDF79-\uDFFF]|\uD835[\uDC55\uDC9D\uDCA0\uDCA1\uDCA3\uDCA4\uDCA7\uDCA8\uDCAD\uDCBA\uDCBC\uDCC4\uDD06\uDD0B\uDD0C\uDD15\uDD1D\uDD3A\uDD3F\uDD45\uDD47-\uDD49\uDD51\uDEA6\uDEA7\uDFCC\uDFCD]|\uD836[\uDE8C-\uDE9A\uDEA0\uDEB0-\uDFFF]|\uD838[\uDC07\uDC19\uDC1A\uDC22\uDC25\uDC2B-\uDFFF]|\uD83A[\uDCC5\uDCC6\uDCD7-\uDCFF\uDD4B-\uDD4F\uDD5A-\uDD5D\uDD60-\uDFFF]|\uD83B[\uDC00-\uDC70\uDCB5-\uDDFF\uDE04\uDE20\uDE23\uDE25\uDE26\uDE28\uDE33\uDE38\uDE3A\uDE3C-\uDE41\uDE43-\uDE46\uDE48\uDE4A\uDE4C\uDE50\uDE53\uDE55\uDE56\uDE58\uDE5A\uDE5C\uDE5E\uDE60\uDE63\uDE65\uDE66\uDE6B\uDE73\uDE78\uDE7D\uDE7F\uDE8A\uDE9C-\uDEA0\uDEA4\uDEAA\uDEBC-\uDEEF\uDEF2-\uDFFF]|\uD83C[\uDC2C-\uDC2F\uDC94-\uDC9F\uDCAF\uDCB0\uDCC0\uDCD0\uDCF6-\uDCFF\uDD0D-\uDD0F\uDD6C-\uDD6F\uDDAD-\uDDE5\uDE03-\uDE0F\uDE3C-\uDE3F\uDE49-\uDE4F\uDE52-\uDE5F\uDE66-\uDEFF]|\uD83D[\uDED5-\uDEDF\uDEED-\uDEEF\uDEFA-\uDEFF\uDF74-\uDF7F\uDFD9-\uDFFF]|\uD83E[\uDC0C-\uDC0F\uDC48-\uDC4F\uDC5A-\uDC5F\uDC88-\uDC8F\uDCAE-\uDCFF\uDD0C-\uDD0F\uDD3F\uDD71\uDD72\uDD77-\uDD79\uDD7B\uDDA3-\uDDAF\uDDBA-\uDDBF\uDDC3-\uDDCF\uDE00-\uDE5F\uDE6E-\uDFFF]|\uD869[\uDED7-\uDEFF]|\uD86D[\uDF35-\uDF3F]|\uD86E[\uDC1E\uDC1F]|\uD873[\uDEA2-\uDEAF]|\uD87A[\uDFE1-\uDFFF]|\uD87E[\uDE1E-\uDFFF]|\uDB40[\uDC00\uDC02-\uDC1F\uDC80-\uDCFF\uDDF0-\uDFFF]|[\uDBBF\uDBFF][\uDFFE\uDFFF]' + }, + { + 'name': 'Co', + 'alias': 'Private_Use', + 'bmp': '\uE000-\uF8FF', + 'astral': '[\uDB80-\uDBBE\uDBC0-\uDBFE][\uDC00-\uDFFF]|[\uDBBF\uDBFF][\uDC00-\uDFFD]' + }, + { + 'name': 'Cs', + 'alias': 'Surrogate', + 'bmp': '\uD800-\uDFFF' + }, + { + 'name': 'L', + 'alias': 'Letter', + 'bmp': 'A-Za-z\xAA\xB5\xBA\xC0-\xD6\xD8-\xF6\xF8-\u02C1\u02C6-\u02D1\u02E0-\u02E4\u02EC\u02EE\u0370-\u0374\u0376\u0377\u037A-\u037D\u037F\u0386\u0388-\u038A\u038C\u038E-\u03A1\u03A3-\u03F5\u03F7-\u0481\u048A-\u052F\u0531-\u0556\u0559\u0560-\u0588\u05D0-\u05EA\u05EF-\u05F2\u0620-\u064A\u066E\u066F\u0671-\u06D3\u06D5\u06E5\u06E6\u06EE\u06EF\u06FA-\u06FC\u06FF\u0710\u0712-\u072F\u074D-\u07A5\u07B1\u07CA-\u07EA\u07F4\u07F5\u07FA\u0800-\u0815\u081A\u0824\u0828\u0840-\u0858\u0860-\u086A\u08A0-\u08B4\u08B6-\u08BD\u0904-\u0939\u093D\u0950\u0958-\u0961\u0971-\u0980\u0985-\u098C\u098F\u0990\u0993-\u09A8\u09AA-\u09B0\u09B2\u09B6-\u09B9\u09BD\u09CE\u09DC\u09DD\u09DF-\u09E1\u09F0\u09F1\u09FC\u0A05-\u0A0A\u0A0F\u0A10\u0A13-\u0A28\u0A2A-\u0A30\u0A32\u0A33\u0A35\u0A36\u0A38\u0A39\u0A59-\u0A5C\u0A5E\u0A72-\u0A74\u0A85-\u0A8D\u0A8F-\u0A91\u0A93-\u0AA8\u0AAA-\u0AB0\u0AB2\u0AB3\u0AB5-\u0AB9\u0ABD\u0AD0\u0AE0\u0AE1\u0AF9\u0B05-\u0B0C\u0B0F\u0B10\u0B13-\u0B28\u0B2A-\u0B30\u0B32\u0B33\u0B35-\u0B39\u0B3D\u0B5C\u0B5D\u0B5F-\u0B61\u0B71\u0B83\u0B85-\u0B8A\u0B8E-\u0B90\u0B92-\u0B95\u0B99\u0B9A\u0B9C\u0B9E\u0B9F\u0BA3\u0BA4\u0BA8-\u0BAA\u0BAE-\u0BB9\u0BD0\u0C05-\u0C0C\u0C0E-\u0C10\u0C12-\u0C28\u0C2A-\u0C39\u0C3D\u0C58-\u0C5A\u0C60\u0C61\u0C80\u0C85-\u0C8C\u0C8E-\u0C90\u0C92-\u0CA8\u0CAA-\u0CB3\u0CB5-\u0CB9\u0CBD\u0CDE\u0CE0\u0CE1\u0CF1\u0CF2\u0D05-\u0D0C\u0D0E-\u0D10\u0D12-\u0D3A\u0D3D\u0D4E\u0D54-\u0D56\u0D5F-\u0D61\u0D7A-\u0D7F\u0D85-\u0D96\u0D9A-\u0DB1\u0DB3-\u0DBB\u0DBD\u0DC0-\u0DC6\u0E01-\u0E30\u0E32\u0E33\u0E40-\u0E46\u0E81\u0E82\u0E84\u0E87\u0E88\u0E8A\u0E8D\u0E94-\u0E97\u0E99-\u0E9F\u0EA1-\u0EA3\u0EA5\u0EA7\u0EAA\u0EAB\u0EAD-\u0EB0\u0EB2\u0EB3\u0EBD\u0EC0-\u0EC4\u0EC6\u0EDC-\u0EDF\u0F00\u0F40-\u0F47\u0F49-\u0F6C\u0F88-\u0F8C\u1000-\u102A\u103F\u1050-\u1055\u105A-\u105D\u1061\u1065\u1066\u106E-\u1070\u1075-\u1081\u108E\u10A0-\u10C5\u10C7\u10CD\u10D0-\u10FA\u10FC-\u1248\u124A-\u124D\u1250-\u1256\u1258\u125A-\u125D\u1260-\u1288\u128A-\u128D\u1290-\u12B0\u12B2-\u12B5\u12B8-\u12BE\u12C0\u12C2-\u12C5\u12C8-\u12D6\u12D8-\u1310\u1312-\u1315\u1318-\u135A\u1380-\u138F\u13A0-\u13F5\u13F8-\u13FD\u1401-\u166C\u166F-\u167F\u1681-\u169A\u16A0-\u16EA\u16F1-\u16F8\u1700-\u170C\u170E-\u1711\u1720-\u1731\u1740-\u1751\u1760-\u176C\u176E-\u1770\u1780-\u17B3\u17D7\u17DC\u1820-\u1878\u1880-\u1884\u1887-\u18A8\u18AA\u18B0-\u18F5\u1900-\u191E\u1950-\u196D\u1970-\u1974\u1980-\u19AB\u19B0-\u19C9\u1A00-\u1A16\u1A20-\u1A54\u1AA7\u1B05-\u1B33\u1B45-\u1B4B\u1B83-\u1BA0\u1BAE\u1BAF\u1BBA-\u1BE5\u1C00-\u1C23\u1C4D-\u1C4F\u1C5A-\u1C7D\u1C80-\u1C88\u1C90-\u1CBA\u1CBD-\u1CBF\u1CE9-\u1CEC\u1CEE-\u1CF1\u1CF5\u1CF6\u1D00-\u1DBF\u1E00-\u1F15\u1F18-\u1F1D\u1F20-\u1F45\u1F48-\u1F4D\u1F50-\u1F57\u1F59\u1F5B\u1F5D\u1F5F-\u1F7D\u1F80-\u1FB4\u1FB6-\u1FBC\u1FBE\u1FC2-\u1FC4\u1FC6-\u1FCC\u1FD0-\u1FD3\u1FD6-\u1FDB\u1FE0-\u1FEC\u1FF2-\u1FF4\u1FF6-\u1FFC\u2071\u207F\u2090-\u209C\u2102\u2107\u210A-\u2113\u2115\u2119-\u211D\u2124\u2126\u2128\u212A-\u212D\u212F-\u2139\u213C-\u213F\u2145-\u2149\u214E\u2183\u2184\u2C00-\u2C2E\u2C30-\u2C5E\u2C60-\u2CE4\u2CEB-\u2CEE\u2CF2\u2CF3\u2D00-\u2D25\u2D27\u2D2D\u2D30-\u2D67\u2D6F\u2D80-\u2D96\u2DA0-\u2DA6\u2DA8-\u2DAE\u2DB0-\u2DB6\u2DB8-\u2DBE\u2DC0-\u2DC6\u2DC8-\u2DCE\u2DD0-\u2DD6\u2DD8-\u2DDE\u2E2F\u3005\u3006\u3031-\u3035\u303B\u303C\u3041-\u3096\u309D-\u309F\u30A1-\u30FA\u30FC-\u30FF\u3105-\u312F\u3131-\u318E\u31A0-\u31BA\u31F0-\u31FF\u3400-\u4DB5\u4E00-\u9FEF\uA000-\uA48C\uA4D0-\uA4FD\uA500-\uA60C\uA610-\uA61F\uA62A\uA62B\uA640-\uA66E\uA67F-\uA69D\uA6A0-\uA6E5\uA717-\uA71F\uA722-\uA788\uA78B-\uA7B9\uA7F7-\uA801\uA803-\uA805\uA807-\uA80A\uA80C-\uA822\uA840-\uA873\uA882-\uA8B3\uA8F2-\uA8F7\uA8FB\uA8FD\uA8FE\uA90A-\uA925\uA930-\uA946\uA960-\uA97C\uA984-\uA9B2\uA9CF\uA9E0-\uA9E4\uA9E6-\uA9EF\uA9FA-\uA9FE\uAA00-\uAA28\uAA40-\uAA42\uAA44-\uAA4B\uAA60-\uAA76\uAA7A\uAA7E-\uAAAF\uAAB1\uAAB5\uAAB6\uAAB9-\uAABD\uAAC0\uAAC2\uAADB-\uAADD\uAAE0-\uAAEA\uAAF2-\uAAF4\uAB01-\uAB06\uAB09-\uAB0E\uAB11-\uAB16\uAB20-\uAB26\uAB28-\uAB2E\uAB30-\uAB5A\uAB5C-\uAB65\uAB70-\uABE2\uAC00-\uD7A3\uD7B0-\uD7C6\uD7CB-\uD7FB\uF900-\uFA6D\uFA70-\uFAD9\uFB00-\uFB06\uFB13-\uFB17\uFB1D\uFB1F-\uFB28\uFB2A-\uFB36\uFB38-\uFB3C\uFB3E\uFB40\uFB41\uFB43\uFB44\uFB46-\uFBB1\uFBD3-\uFD3D\uFD50-\uFD8F\uFD92-\uFDC7\uFDF0-\uFDFB\uFE70-\uFE74\uFE76-\uFEFC\uFF21-\uFF3A\uFF41-\uFF5A\uFF66-\uFFBE\uFFC2-\uFFC7\uFFCA-\uFFCF\uFFD2-\uFFD7\uFFDA-\uFFDC', + 'astral': '\uD800[\uDC00-\uDC0B\uDC0D-\uDC26\uDC28-\uDC3A\uDC3C\uDC3D\uDC3F-\uDC4D\uDC50-\uDC5D\uDC80-\uDCFA\uDE80-\uDE9C\uDEA0-\uDED0\uDF00-\uDF1F\uDF2D-\uDF40\uDF42-\uDF49\uDF50-\uDF75\uDF80-\uDF9D\uDFA0-\uDFC3\uDFC8-\uDFCF]|\uD801[\uDC00-\uDC9D\uDCB0-\uDCD3\uDCD8-\uDCFB\uDD00-\uDD27\uDD30-\uDD63\uDE00-\uDF36\uDF40-\uDF55\uDF60-\uDF67]|\uD802[\uDC00-\uDC05\uDC08\uDC0A-\uDC35\uDC37\uDC38\uDC3C\uDC3F-\uDC55\uDC60-\uDC76\uDC80-\uDC9E\uDCE0-\uDCF2\uDCF4\uDCF5\uDD00-\uDD15\uDD20-\uDD39\uDD80-\uDDB7\uDDBE\uDDBF\uDE00\uDE10-\uDE13\uDE15-\uDE17\uDE19-\uDE35\uDE60-\uDE7C\uDE80-\uDE9C\uDEC0-\uDEC7\uDEC9-\uDEE4\uDF00-\uDF35\uDF40-\uDF55\uDF60-\uDF72\uDF80-\uDF91]|\uD803[\uDC00-\uDC48\uDC80-\uDCB2\uDCC0-\uDCF2\uDD00-\uDD23\uDF00-\uDF1C\uDF27\uDF30-\uDF45]|\uD804[\uDC03-\uDC37\uDC83-\uDCAF\uDCD0-\uDCE8\uDD03-\uDD26\uDD44\uDD50-\uDD72\uDD76\uDD83-\uDDB2\uDDC1-\uDDC4\uDDDA\uDDDC\uDE00-\uDE11\uDE13-\uDE2B\uDE80-\uDE86\uDE88\uDE8A-\uDE8D\uDE8F-\uDE9D\uDE9F-\uDEA8\uDEB0-\uDEDE\uDF05-\uDF0C\uDF0F\uDF10\uDF13-\uDF28\uDF2A-\uDF30\uDF32\uDF33\uDF35-\uDF39\uDF3D\uDF50\uDF5D-\uDF61]|\uD805[\uDC00-\uDC34\uDC47-\uDC4A\uDC80-\uDCAF\uDCC4\uDCC5\uDCC7\uDD80-\uDDAE\uDDD8-\uDDDB\uDE00-\uDE2F\uDE44\uDE80-\uDEAA\uDF00-\uDF1A]|\uD806[\uDC00-\uDC2B\uDCA0-\uDCDF\uDCFF\uDE00\uDE0B-\uDE32\uDE3A\uDE50\uDE5C-\uDE83\uDE86-\uDE89\uDE9D\uDEC0-\uDEF8]|\uD807[\uDC00-\uDC08\uDC0A-\uDC2E\uDC40\uDC72-\uDC8F\uDD00-\uDD06\uDD08\uDD09\uDD0B-\uDD30\uDD46\uDD60-\uDD65\uDD67\uDD68\uDD6A-\uDD89\uDD98\uDEE0-\uDEF2]|\uD808[\uDC00-\uDF99]|\uD809[\uDC80-\uDD43]|[\uD80C\uD81C-\uD820\uD840-\uD868\uD86A-\uD86C\uD86F-\uD872\uD874-\uD879][\uDC00-\uDFFF]|\uD80D[\uDC00-\uDC2E]|\uD811[\uDC00-\uDE46]|\uD81A[\uDC00-\uDE38\uDE40-\uDE5E\uDED0-\uDEED\uDF00-\uDF2F\uDF40-\uDF43\uDF63-\uDF77\uDF7D-\uDF8F]|\uD81B[\uDE40-\uDE7F\uDF00-\uDF44\uDF50\uDF93-\uDF9F\uDFE0\uDFE1]|\uD821[\uDC00-\uDFF1]|\uD822[\uDC00-\uDEF2]|\uD82C[\uDC00-\uDD1E\uDD70-\uDEFB]|\uD82F[\uDC00-\uDC6A\uDC70-\uDC7C\uDC80-\uDC88\uDC90-\uDC99]|\uD835[\uDC00-\uDC54\uDC56-\uDC9C\uDC9E\uDC9F\uDCA2\uDCA5\uDCA6\uDCA9-\uDCAC\uDCAE-\uDCB9\uDCBB\uDCBD-\uDCC3\uDCC5-\uDD05\uDD07-\uDD0A\uDD0D-\uDD14\uDD16-\uDD1C\uDD1E-\uDD39\uDD3B-\uDD3E\uDD40-\uDD44\uDD46\uDD4A-\uDD50\uDD52-\uDEA5\uDEA8-\uDEC0\uDEC2-\uDEDA\uDEDC-\uDEFA\uDEFC-\uDF14\uDF16-\uDF34\uDF36-\uDF4E\uDF50-\uDF6E\uDF70-\uDF88\uDF8A-\uDFA8\uDFAA-\uDFC2\uDFC4-\uDFCB]|\uD83A[\uDC00-\uDCC4\uDD00-\uDD43]|\uD83B[\uDE00-\uDE03\uDE05-\uDE1F\uDE21\uDE22\uDE24\uDE27\uDE29-\uDE32\uDE34-\uDE37\uDE39\uDE3B\uDE42\uDE47\uDE49\uDE4B\uDE4D-\uDE4F\uDE51\uDE52\uDE54\uDE57\uDE59\uDE5B\uDE5D\uDE5F\uDE61\uDE62\uDE64\uDE67-\uDE6A\uDE6C-\uDE72\uDE74-\uDE77\uDE79-\uDE7C\uDE7E\uDE80-\uDE89\uDE8B-\uDE9B\uDEA1-\uDEA3\uDEA5-\uDEA9\uDEAB-\uDEBB]|\uD869[\uDC00-\uDED6\uDF00-\uDFFF]|\uD86D[\uDC00-\uDF34\uDF40-\uDFFF]|\uD86E[\uDC00-\uDC1D\uDC20-\uDFFF]|\uD873[\uDC00-\uDEA1\uDEB0-\uDFFF]|\uD87A[\uDC00-\uDFE0]|\uD87E[\uDC00-\uDE1D]' + }, + { + 'name': 'LC', + 'alias': 'Cased_Letter', + 'bmp': 'A-Za-z\xB5\xC0-\xD6\xD8-\xF6\xF8-\u01BA\u01BC-\u01BF\u01C4-\u0293\u0295-\u02AF\u0370-\u0373\u0376\u0377\u037B-\u037D\u037F\u0386\u0388-\u038A\u038C\u038E-\u03A1\u03A3-\u03F5\u03F7-\u0481\u048A-\u052F\u0531-\u0556\u0560-\u0588\u10A0-\u10C5\u10C7\u10CD\u10D0-\u10FA\u10FD-\u10FF\u13A0-\u13F5\u13F8-\u13FD\u1C80-\u1C88\u1C90-\u1CBA\u1CBD-\u1CBF\u1D00-\u1D2B\u1D6B-\u1D77\u1D79-\u1D9A\u1E00-\u1F15\u1F18-\u1F1D\u1F20-\u1F45\u1F48-\u1F4D\u1F50-\u1F57\u1F59\u1F5B\u1F5D\u1F5F-\u1F7D\u1F80-\u1FB4\u1FB6-\u1FBC\u1FBE\u1FC2-\u1FC4\u1FC6-\u1FCC\u1FD0-\u1FD3\u1FD6-\u1FDB\u1FE0-\u1FEC\u1FF2-\u1FF4\u1FF6-\u1FFC\u2102\u2107\u210A-\u2113\u2115\u2119-\u211D\u2124\u2126\u2128\u212A-\u212D\u212F-\u2134\u2139\u213C-\u213F\u2145-\u2149\u214E\u2183\u2184\u2C00-\u2C2E\u2C30-\u2C5E\u2C60-\u2C7B\u2C7E-\u2CE4\u2CEB-\u2CEE\u2CF2\u2CF3\u2D00-\u2D25\u2D27\u2D2D\uA640-\uA66D\uA680-\uA69B\uA722-\uA76F\uA771-\uA787\uA78B-\uA78E\uA790-\uA7B9\uA7FA\uAB30-\uAB5A\uAB60-\uAB65\uAB70-\uABBF\uFB00-\uFB06\uFB13-\uFB17\uFF21-\uFF3A\uFF41-\uFF5A', + 'astral': '\uD801[\uDC00-\uDC4F\uDCB0-\uDCD3\uDCD8-\uDCFB]|\uD803[\uDC80-\uDCB2\uDCC0-\uDCF2]|\uD806[\uDCA0-\uDCDF]|\uD81B[\uDE40-\uDE7F]|\uD835[\uDC00-\uDC54\uDC56-\uDC9C\uDC9E\uDC9F\uDCA2\uDCA5\uDCA6\uDCA9-\uDCAC\uDCAE-\uDCB9\uDCBB\uDCBD-\uDCC3\uDCC5-\uDD05\uDD07-\uDD0A\uDD0D-\uDD14\uDD16-\uDD1C\uDD1E-\uDD39\uDD3B-\uDD3E\uDD40-\uDD44\uDD46\uDD4A-\uDD50\uDD52-\uDEA5\uDEA8-\uDEC0\uDEC2-\uDEDA\uDEDC-\uDEFA\uDEFC-\uDF14\uDF16-\uDF34\uDF36-\uDF4E\uDF50-\uDF6E\uDF70-\uDF88\uDF8A-\uDFA8\uDFAA-\uDFC2\uDFC4-\uDFCB]|\uD83A[\uDD00-\uDD43]' + }, + { + 'name': 'Ll', + 'alias': 'Lowercase_Letter', + 'bmp': 'a-z\xB5\xDF-\xF6\xF8-\xFF\u0101\u0103\u0105\u0107\u0109\u010B\u010D\u010F\u0111\u0113\u0115\u0117\u0119\u011B\u011D\u011F\u0121\u0123\u0125\u0127\u0129\u012B\u012D\u012F\u0131\u0133\u0135\u0137\u0138\u013A\u013C\u013E\u0140\u0142\u0144\u0146\u0148\u0149\u014B\u014D\u014F\u0151\u0153\u0155\u0157\u0159\u015B\u015D\u015F\u0161\u0163\u0165\u0167\u0169\u016B\u016D\u016F\u0171\u0173\u0175\u0177\u017A\u017C\u017E-\u0180\u0183\u0185\u0188\u018C\u018D\u0192\u0195\u0199-\u019B\u019E\u01A1\u01A3\u01A5\u01A8\u01AA\u01AB\u01AD\u01B0\u01B4\u01B6\u01B9\u01BA\u01BD-\u01BF\u01C6\u01C9\u01CC\u01CE\u01D0\u01D2\u01D4\u01D6\u01D8\u01DA\u01DC\u01DD\u01DF\u01E1\u01E3\u01E5\u01E7\u01E9\u01EB\u01ED\u01EF\u01F0\u01F3\u01F5\u01F9\u01FB\u01FD\u01FF\u0201\u0203\u0205\u0207\u0209\u020B\u020D\u020F\u0211\u0213\u0215\u0217\u0219\u021B\u021D\u021F\u0221\u0223\u0225\u0227\u0229\u022B\u022D\u022F\u0231\u0233-\u0239\u023C\u023F\u0240\u0242\u0247\u0249\u024B\u024D\u024F-\u0293\u0295-\u02AF\u0371\u0373\u0377\u037B-\u037D\u0390\u03AC-\u03CE\u03D0\u03D1\u03D5-\u03D7\u03D9\u03DB\u03DD\u03DF\u03E1\u03E3\u03E5\u03E7\u03E9\u03EB\u03ED\u03EF-\u03F3\u03F5\u03F8\u03FB\u03FC\u0430-\u045F\u0461\u0463\u0465\u0467\u0469\u046B\u046D\u046F\u0471\u0473\u0475\u0477\u0479\u047B\u047D\u047F\u0481\u048B\u048D\u048F\u0491\u0493\u0495\u0497\u0499\u049B\u049D\u049F\u04A1\u04A3\u04A5\u04A7\u04A9\u04AB\u04AD\u04AF\u04B1\u04B3\u04B5\u04B7\u04B9\u04BB\u04BD\u04BF\u04C2\u04C4\u04C6\u04C8\u04CA\u04CC\u04CE\u04CF\u04D1\u04D3\u04D5\u04D7\u04D9\u04DB\u04DD\u04DF\u04E1\u04E3\u04E5\u04E7\u04E9\u04EB\u04ED\u04EF\u04F1\u04F3\u04F5\u04F7\u04F9\u04FB\u04FD\u04FF\u0501\u0503\u0505\u0507\u0509\u050B\u050D\u050F\u0511\u0513\u0515\u0517\u0519\u051B\u051D\u051F\u0521\u0523\u0525\u0527\u0529\u052B\u052D\u052F\u0560-\u0588\u10D0-\u10FA\u10FD-\u10FF\u13F8-\u13FD\u1C80-\u1C88\u1D00-\u1D2B\u1D6B-\u1D77\u1D79-\u1D9A\u1E01\u1E03\u1E05\u1E07\u1E09\u1E0B\u1E0D\u1E0F\u1E11\u1E13\u1E15\u1E17\u1E19\u1E1B\u1E1D\u1E1F\u1E21\u1E23\u1E25\u1E27\u1E29\u1E2B\u1E2D\u1E2F\u1E31\u1E33\u1E35\u1E37\u1E39\u1E3B\u1E3D\u1E3F\u1E41\u1E43\u1E45\u1E47\u1E49\u1E4B\u1E4D\u1E4F\u1E51\u1E53\u1E55\u1E57\u1E59\u1E5B\u1E5D\u1E5F\u1E61\u1E63\u1E65\u1E67\u1E69\u1E6B\u1E6D\u1E6F\u1E71\u1E73\u1E75\u1E77\u1E79\u1E7B\u1E7D\u1E7F\u1E81\u1E83\u1E85\u1E87\u1E89\u1E8B\u1E8D\u1E8F\u1E91\u1E93\u1E95-\u1E9D\u1E9F\u1EA1\u1EA3\u1EA5\u1EA7\u1EA9\u1EAB\u1EAD\u1EAF\u1EB1\u1EB3\u1EB5\u1EB7\u1EB9\u1EBB\u1EBD\u1EBF\u1EC1\u1EC3\u1EC5\u1EC7\u1EC9\u1ECB\u1ECD\u1ECF\u1ED1\u1ED3\u1ED5\u1ED7\u1ED9\u1EDB\u1EDD\u1EDF\u1EE1\u1EE3\u1EE5\u1EE7\u1EE9\u1EEB\u1EED\u1EEF\u1EF1\u1EF3\u1EF5\u1EF7\u1EF9\u1EFB\u1EFD\u1EFF-\u1F07\u1F10-\u1F15\u1F20-\u1F27\u1F30-\u1F37\u1F40-\u1F45\u1F50-\u1F57\u1F60-\u1F67\u1F70-\u1F7D\u1F80-\u1F87\u1F90-\u1F97\u1FA0-\u1FA7\u1FB0-\u1FB4\u1FB6\u1FB7\u1FBE\u1FC2-\u1FC4\u1FC6\u1FC7\u1FD0-\u1FD3\u1FD6\u1FD7\u1FE0-\u1FE7\u1FF2-\u1FF4\u1FF6\u1FF7\u210A\u210E\u210F\u2113\u212F\u2134\u2139\u213C\u213D\u2146-\u2149\u214E\u2184\u2C30-\u2C5E\u2C61\u2C65\u2C66\u2C68\u2C6A\u2C6C\u2C71\u2C73\u2C74\u2C76-\u2C7B\u2C81\u2C83\u2C85\u2C87\u2C89\u2C8B\u2C8D\u2C8F\u2C91\u2C93\u2C95\u2C97\u2C99\u2C9B\u2C9D\u2C9F\u2CA1\u2CA3\u2CA5\u2CA7\u2CA9\u2CAB\u2CAD\u2CAF\u2CB1\u2CB3\u2CB5\u2CB7\u2CB9\u2CBB\u2CBD\u2CBF\u2CC1\u2CC3\u2CC5\u2CC7\u2CC9\u2CCB\u2CCD\u2CCF\u2CD1\u2CD3\u2CD5\u2CD7\u2CD9\u2CDB\u2CDD\u2CDF\u2CE1\u2CE3\u2CE4\u2CEC\u2CEE\u2CF3\u2D00-\u2D25\u2D27\u2D2D\uA641\uA643\uA645\uA647\uA649\uA64B\uA64D\uA64F\uA651\uA653\uA655\uA657\uA659\uA65B\uA65D\uA65F\uA661\uA663\uA665\uA667\uA669\uA66B\uA66D\uA681\uA683\uA685\uA687\uA689\uA68B\uA68D\uA68F\uA691\uA693\uA695\uA697\uA699\uA69B\uA723\uA725\uA727\uA729\uA72B\uA72D\uA72F-\uA731\uA733\uA735\uA737\uA739\uA73B\uA73D\uA73F\uA741\uA743\uA745\uA747\uA749\uA74B\uA74D\uA74F\uA751\uA753\uA755\uA757\uA759\uA75B\uA75D\uA75F\uA761\uA763\uA765\uA767\uA769\uA76B\uA76D\uA76F\uA771-\uA778\uA77A\uA77C\uA77F\uA781\uA783\uA785\uA787\uA78C\uA78E\uA791\uA793-\uA795\uA797\uA799\uA79B\uA79D\uA79F\uA7A1\uA7A3\uA7A5\uA7A7\uA7A9\uA7AF\uA7B5\uA7B7\uA7B9\uA7FA\uAB30-\uAB5A\uAB60-\uAB65\uAB70-\uABBF\uFB00-\uFB06\uFB13-\uFB17\uFF41-\uFF5A', + 'astral': '\uD801[\uDC28-\uDC4F\uDCD8-\uDCFB]|\uD803[\uDCC0-\uDCF2]|\uD806[\uDCC0-\uDCDF]|\uD81B[\uDE60-\uDE7F]|\uD835[\uDC1A-\uDC33\uDC4E-\uDC54\uDC56-\uDC67\uDC82-\uDC9B\uDCB6-\uDCB9\uDCBB\uDCBD-\uDCC3\uDCC5-\uDCCF\uDCEA-\uDD03\uDD1E-\uDD37\uDD52-\uDD6B\uDD86-\uDD9F\uDDBA-\uDDD3\uDDEE-\uDE07\uDE22-\uDE3B\uDE56-\uDE6F\uDE8A-\uDEA5\uDEC2-\uDEDA\uDEDC-\uDEE1\uDEFC-\uDF14\uDF16-\uDF1B\uDF36-\uDF4E\uDF50-\uDF55\uDF70-\uDF88\uDF8A-\uDF8F\uDFAA-\uDFC2\uDFC4-\uDFC9\uDFCB]|\uD83A[\uDD22-\uDD43]' + }, + { + 'name': 'Lm', + 'alias': 'Modifier_Letter', + 'bmp': '\u02B0-\u02C1\u02C6-\u02D1\u02E0-\u02E4\u02EC\u02EE\u0374\u037A\u0559\u0640\u06E5\u06E6\u07F4\u07F5\u07FA\u081A\u0824\u0828\u0971\u0E46\u0EC6\u10FC\u17D7\u1843\u1AA7\u1C78-\u1C7D\u1D2C-\u1D6A\u1D78\u1D9B-\u1DBF\u2071\u207F\u2090-\u209C\u2C7C\u2C7D\u2D6F\u2E2F\u3005\u3031-\u3035\u303B\u309D\u309E\u30FC-\u30FE\uA015\uA4F8-\uA4FD\uA60C\uA67F\uA69C\uA69D\uA717-\uA71F\uA770\uA788\uA7F8\uA7F9\uA9CF\uA9E6\uAA70\uAADD\uAAF3\uAAF4\uAB5C-\uAB5F\uFF70\uFF9E\uFF9F', + 'astral': '\uD81A[\uDF40-\uDF43]|\uD81B[\uDF93-\uDF9F\uDFE0\uDFE1]' + }, + { + 'name': 'Lo', + 'alias': 'Other_Letter', + 'bmp': '\xAA\xBA\u01BB\u01C0-\u01C3\u0294\u05D0-\u05EA\u05EF-\u05F2\u0620-\u063F\u0641-\u064A\u066E\u066F\u0671-\u06D3\u06D5\u06EE\u06EF\u06FA-\u06FC\u06FF\u0710\u0712-\u072F\u074D-\u07A5\u07B1\u07CA-\u07EA\u0800-\u0815\u0840-\u0858\u0860-\u086A\u08A0-\u08B4\u08B6-\u08BD\u0904-\u0939\u093D\u0950\u0958-\u0961\u0972-\u0980\u0985-\u098C\u098F\u0990\u0993-\u09A8\u09AA-\u09B0\u09B2\u09B6-\u09B9\u09BD\u09CE\u09DC\u09DD\u09DF-\u09E1\u09F0\u09F1\u09FC\u0A05-\u0A0A\u0A0F\u0A10\u0A13-\u0A28\u0A2A-\u0A30\u0A32\u0A33\u0A35\u0A36\u0A38\u0A39\u0A59-\u0A5C\u0A5E\u0A72-\u0A74\u0A85-\u0A8D\u0A8F-\u0A91\u0A93-\u0AA8\u0AAA-\u0AB0\u0AB2\u0AB3\u0AB5-\u0AB9\u0ABD\u0AD0\u0AE0\u0AE1\u0AF9\u0B05-\u0B0C\u0B0F\u0B10\u0B13-\u0B28\u0B2A-\u0B30\u0B32\u0B33\u0B35-\u0B39\u0B3D\u0B5C\u0B5D\u0B5F-\u0B61\u0B71\u0B83\u0B85-\u0B8A\u0B8E-\u0B90\u0B92-\u0B95\u0B99\u0B9A\u0B9C\u0B9E\u0B9F\u0BA3\u0BA4\u0BA8-\u0BAA\u0BAE-\u0BB9\u0BD0\u0C05-\u0C0C\u0C0E-\u0C10\u0C12-\u0C28\u0C2A-\u0C39\u0C3D\u0C58-\u0C5A\u0C60\u0C61\u0C80\u0C85-\u0C8C\u0C8E-\u0C90\u0C92-\u0CA8\u0CAA-\u0CB3\u0CB5-\u0CB9\u0CBD\u0CDE\u0CE0\u0CE1\u0CF1\u0CF2\u0D05-\u0D0C\u0D0E-\u0D10\u0D12-\u0D3A\u0D3D\u0D4E\u0D54-\u0D56\u0D5F-\u0D61\u0D7A-\u0D7F\u0D85-\u0D96\u0D9A-\u0DB1\u0DB3-\u0DBB\u0DBD\u0DC0-\u0DC6\u0E01-\u0E30\u0E32\u0E33\u0E40-\u0E45\u0E81\u0E82\u0E84\u0E87\u0E88\u0E8A\u0E8D\u0E94-\u0E97\u0E99-\u0E9F\u0EA1-\u0EA3\u0EA5\u0EA7\u0EAA\u0EAB\u0EAD-\u0EB0\u0EB2\u0EB3\u0EBD\u0EC0-\u0EC4\u0EDC-\u0EDF\u0F00\u0F40-\u0F47\u0F49-\u0F6C\u0F88-\u0F8C\u1000-\u102A\u103F\u1050-\u1055\u105A-\u105D\u1061\u1065\u1066\u106E-\u1070\u1075-\u1081\u108E\u1100-\u1248\u124A-\u124D\u1250-\u1256\u1258\u125A-\u125D\u1260-\u1288\u128A-\u128D\u1290-\u12B0\u12B2-\u12B5\u12B8-\u12BE\u12C0\u12C2-\u12C5\u12C8-\u12D6\u12D8-\u1310\u1312-\u1315\u1318-\u135A\u1380-\u138F\u1401-\u166C\u166F-\u167F\u1681-\u169A\u16A0-\u16EA\u16F1-\u16F8\u1700-\u170C\u170E-\u1711\u1720-\u1731\u1740-\u1751\u1760-\u176C\u176E-\u1770\u1780-\u17B3\u17DC\u1820-\u1842\u1844-\u1878\u1880-\u1884\u1887-\u18A8\u18AA\u18B0-\u18F5\u1900-\u191E\u1950-\u196D\u1970-\u1974\u1980-\u19AB\u19B0-\u19C9\u1A00-\u1A16\u1A20-\u1A54\u1B05-\u1B33\u1B45-\u1B4B\u1B83-\u1BA0\u1BAE\u1BAF\u1BBA-\u1BE5\u1C00-\u1C23\u1C4D-\u1C4F\u1C5A-\u1C77\u1CE9-\u1CEC\u1CEE-\u1CF1\u1CF5\u1CF6\u2135-\u2138\u2D30-\u2D67\u2D80-\u2D96\u2DA0-\u2DA6\u2DA8-\u2DAE\u2DB0-\u2DB6\u2DB8-\u2DBE\u2DC0-\u2DC6\u2DC8-\u2DCE\u2DD0-\u2DD6\u2DD8-\u2DDE\u3006\u303C\u3041-\u3096\u309F\u30A1-\u30FA\u30FF\u3105-\u312F\u3131-\u318E\u31A0-\u31BA\u31F0-\u31FF\u3400-\u4DB5\u4E00-\u9FEF\uA000-\uA014\uA016-\uA48C\uA4D0-\uA4F7\uA500-\uA60B\uA610-\uA61F\uA62A\uA62B\uA66E\uA6A0-\uA6E5\uA78F\uA7F7\uA7FB-\uA801\uA803-\uA805\uA807-\uA80A\uA80C-\uA822\uA840-\uA873\uA882-\uA8B3\uA8F2-\uA8F7\uA8FB\uA8FD\uA8FE\uA90A-\uA925\uA930-\uA946\uA960-\uA97C\uA984-\uA9B2\uA9E0-\uA9E4\uA9E7-\uA9EF\uA9FA-\uA9FE\uAA00-\uAA28\uAA40-\uAA42\uAA44-\uAA4B\uAA60-\uAA6F\uAA71-\uAA76\uAA7A\uAA7E-\uAAAF\uAAB1\uAAB5\uAAB6\uAAB9-\uAABD\uAAC0\uAAC2\uAADB\uAADC\uAAE0-\uAAEA\uAAF2\uAB01-\uAB06\uAB09-\uAB0E\uAB11-\uAB16\uAB20-\uAB26\uAB28-\uAB2E\uABC0-\uABE2\uAC00-\uD7A3\uD7B0-\uD7C6\uD7CB-\uD7FB\uF900-\uFA6D\uFA70-\uFAD9\uFB1D\uFB1F-\uFB28\uFB2A-\uFB36\uFB38-\uFB3C\uFB3E\uFB40\uFB41\uFB43\uFB44\uFB46-\uFBB1\uFBD3-\uFD3D\uFD50-\uFD8F\uFD92-\uFDC7\uFDF0-\uFDFB\uFE70-\uFE74\uFE76-\uFEFC\uFF66-\uFF6F\uFF71-\uFF9D\uFFA0-\uFFBE\uFFC2-\uFFC7\uFFCA-\uFFCF\uFFD2-\uFFD7\uFFDA-\uFFDC', + 'astral': '\uD800[\uDC00-\uDC0B\uDC0D-\uDC26\uDC28-\uDC3A\uDC3C\uDC3D\uDC3F-\uDC4D\uDC50-\uDC5D\uDC80-\uDCFA\uDE80-\uDE9C\uDEA0-\uDED0\uDF00-\uDF1F\uDF2D-\uDF40\uDF42-\uDF49\uDF50-\uDF75\uDF80-\uDF9D\uDFA0-\uDFC3\uDFC8-\uDFCF]|\uD801[\uDC50-\uDC9D\uDD00-\uDD27\uDD30-\uDD63\uDE00-\uDF36\uDF40-\uDF55\uDF60-\uDF67]|\uD802[\uDC00-\uDC05\uDC08\uDC0A-\uDC35\uDC37\uDC38\uDC3C\uDC3F-\uDC55\uDC60-\uDC76\uDC80-\uDC9E\uDCE0-\uDCF2\uDCF4\uDCF5\uDD00-\uDD15\uDD20-\uDD39\uDD80-\uDDB7\uDDBE\uDDBF\uDE00\uDE10-\uDE13\uDE15-\uDE17\uDE19-\uDE35\uDE60-\uDE7C\uDE80-\uDE9C\uDEC0-\uDEC7\uDEC9-\uDEE4\uDF00-\uDF35\uDF40-\uDF55\uDF60-\uDF72\uDF80-\uDF91]|\uD803[\uDC00-\uDC48\uDD00-\uDD23\uDF00-\uDF1C\uDF27\uDF30-\uDF45]|\uD804[\uDC03-\uDC37\uDC83-\uDCAF\uDCD0-\uDCE8\uDD03-\uDD26\uDD44\uDD50-\uDD72\uDD76\uDD83-\uDDB2\uDDC1-\uDDC4\uDDDA\uDDDC\uDE00-\uDE11\uDE13-\uDE2B\uDE80-\uDE86\uDE88\uDE8A-\uDE8D\uDE8F-\uDE9D\uDE9F-\uDEA8\uDEB0-\uDEDE\uDF05-\uDF0C\uDF0F\uDF10\uDF13-\uDF28\uDF2A-\uDF30\uDF32\uDF33\uDF35-\uDF39\uDF3D\uDF50\uDF5D-\uDF61]|\uD805[\uDC00-\uDC34\uDC47-\uDC4A\uDC80-\uDCAF\uDCC4\uDCC5\uDCC7\uDD80-\uDDAE\uDDD8-\uDDDB\uDE00-\uDE2F\uDE44\uDE80-\uDEAA\uDF00-\uDF1A]|\uD806[\uDC00-\uDC2B\uDCFF\uDE00\uDE0B-\uDE32\uDE3A\uDE50\uDE5C-\uDE83\uDE86-\uDE89\uDE9D\uDEC0-\uDEF8]|\uD807[\uDC00-\uDC08\uDC0A-\uDC2E\uDC40\uDC72-\uDC8F\uDD00-\uDD06\uDD08\uDD09\uDD0B-\uDD30\uDD46\uDD60-\uDD65\uDD67\uDD68\uDD6A-\uDD89\uDD98\uDEE0-\uDEF2]|\uD808[\uDC00-\uDF99]|\uD809[\uDC80-\uDD43]|[\uD80C\uD81C-\uD820\uD840-\uD868\uD86A-\uD86C\uD86F-\uD872\uD874-\uD879][\uDC00-\uDFFF]|\uD80D[\uDC00-\uDC2E]|\uD811[\uDC00-\uDE46]|\uD81A[\uDC00-\uDE38\uDE40-\uDE5E\uDED0-\uDEED\uDF00-\uDF2F\uDF63-\uDF77\uDF7D-\uDF8F]|\uD81B[\uDF00-\uDF44\uDF50]|\uD821[\uDC00-\uDFF1]|\uD822[\uDC00-\uDEF2]|\uD82C[\uDC00-\uDD1E\uDD70-\uDEFB]|\uD82F[\uDC00-\uDC6A\uDC70-\uDC7C\uDC80-\uDC88\uDC90-\uDC99]|\uD83A[\uDC00-\uDCC4]|\uD83B[\uDE00-\uDE03\uDE05-\uDE1F\uDE21\uDE22\uDE24\uDE27\uDE29-\uDE32\uDE34-\uDE37\uDE39\uDE3B\uDE42\uDE47\uDE49\uDE4B\uDE4D-\uDE4F\uDE51\uDE52\uDE54\uDE57\uDE59\uDE5B\uDE5D\uDE5F\uDE61\uDE62\uDE64\uDE67-\uDE6A\uDE6C-\uDE72\uDE74-\uDE77\uDE79-\uDE7C\uDE7E\uDE80-\uDE89\uDE8B-\uDE9B\uDEA1-\uDEA3\uDEA5-\uDEA9\uDEAB-\uDEBB]|\uD869[\uDC00-\uDED6\uDF00-\uDFFF]|\uD86D[\uDC00-\uDF34\uDF40-\uDFFF]|\uD86E[\uDC00-\uDC1D\uDC20-\uDFFF]|\uD873[\uDC00-\uDEA1\uDEB0-\uDFFF]|\uD87A[\uDC00-\uDFE0]|\uD87E[\uDC00-\uDE1D]' + }, + { + 'name': 'Lt', + 'alias': 'Titlecase_Letter', + 'bmp': '\u01C5\u01C8\u01CB\u01F2\u1F88-\u1F8F\u1F98-\u1F9F\u1FA8-\u1FAF\u1FBC\u1FCC\u1FFC' + }, + { + 'name': 'Lu', + 'alias': 'Uppercase_Letter', + 'bmp': 'A-Z\xC0-\xD6\xD8-\xDE\u0100\u0102\u0104\u0106\u0108\u010A\u010C\u010E\u0110\u0112\u0114\u0116\u0118\u011A\u011C\u011E\u0120\u0122\u0124\u0126\u0128\u012A\u012C\u012E\u0130\u0132\u0134\u0136\u0139\u013B\u013D\u013F\u0141\u0143\u0145\u0147\u014A\u014C\u014E\u0150\u0152\u0154\u0156\u0158\u015A\u015C\u015E\u0160\u0162\u0164\u0166\u0168\u016A\u016C\u016E\u0170\u0172\u0174\u0176\u0178\u0179\u017B\u017D\u0181\u0182\u0184\u0186\u0187\u0189-\u018B\u018E-\u0191\u0193\u0194\u0196-\u0198\u019C\u019D\u019F\u01A0\u01A2\u01A4\u01A6\u01A7\u01A9\u01AC\u01AE\u01AF\u01B1-\u01B3\u01B5\u01B7\u01B8\u01BC\u01C4\u01C7\u01CA\u01CD\u01CF\u01D1\u01D3\u01D5\u01D7\u01D9\u01DB\u01DE\u01E0\u01E2\u01E4\u01E6\u01E8\u01EA\u01EC\u01EE\u01F1\u01F4\u01F6-\u01F8\u01FA\u01FC\u01FE\u0200\u0202\u0204\u0206\u0208\u020A\u020C\u020E\u0210\u0212\u0214\u0216\u0218\u021A\u021C\u021E\u0220\u0222\u0224\u0226\u0228\u022A\u022C\u022E\u0230\u0232\u023A\u023B\u023D\u023E\u0241\u0243-\u0246\u0248\u024A\u024C\u024E\u0370\u0372\u0376\u037F\u0386\u0388-\u038A\u038C\u038E\u038F\u0391-\u03A1\u03A3-\u03AB\u03CF\u03D2-\u03D4\u03D8\u03DA\u03DC\u03DE\u03E0\u03E2\u03E4\u03E6\u03E8\u03EA\u03EC\u03EE\u03F4\u03F7\u03F9\u03FA\u03FD-\u042F\u0460\u0462\u0464\u0466\u0468\u046A\u046C\u046E\u0470\u0472\u0474\u0476\u0478\u047A\u047C\u047E\u0480\u048A\u048C\u048E\u0490\u0492\u0494\u0496\u0498\u049A\u049C\u049E\u04A0\u04A2\u04A4\u04A6\u04A8\u04AA\u04AC\u04AE\u04B0\u04B2\u04B4\u04B6\u04B8\u04BA\u04BC\u04BE\u04C0\u04C1\u04C3\u04C5\u04C7\u04C9\u04CB\u04CD\u04D0\u04D2\u04D4\u04D6\u04D8\u04DA\u04DC\u04DE\u04E0\u04E2\u04E4\u04E6\u04E8\u04EA\u04EC\u04EE\u04F0\u04F2\u04F4\u04F6\u04F8\u04FA\u04FC\u04FE\u0500\u0502\u0504\u0506\u0508\u050A\u050C\u050E\u0510\u0512\u0514\u0516\u0518\u051A\u051C\u051E\u0520\u0522\u0524\u0526\u0528\u052A\u052C\u052E\u0531-\u0556\u10A0-\u10C5\u10C7\u10CD\u13A0-\u13F5\u1C90-\u1CBA\u1CBD-\u1CBF\u1E00\u1E02\u1E04\u1E06\u1E08\u1E0A\u1E0C\u1E0E\u1E10\u1E12\u1E14\u1E16\u1E18\u1E1A\u1E1C\u1E1E\u1E20\u1E22\u1E24\u1E26\u1E28\u1E2A\u1E2C\u1E2E\u1E30\u1E32\u1E34\u1E36\u1E38\u1E3A\u1E3C\u1E3E\u1E40\u1E42\u1E44\u1E46\u1E48\u1E4A\u1E4C\u1E4E\u1E50\u1E52\u1E54\u1E56\u1E58\u1E5A\u1E5C\u1E5E\u1E60\u1E62\u1E64\u1E66\u1E68\u1E6A\u1E6C\u1E6E\u1E70\u1E72\u1E74\u1E76\u1E78\u1E7A\u1E7C\u1E7E\u1E80\u1E82\u1E84\u1E86\u1E88\u1E8A\u1E8C\u1E8E\u1E90\u1E92\u1E94\u1E9E\u1EA0\u1EA2\u1EA4\u1EA6\u1EA8\u1EAA\u1EAC\u1EAE\u1EB0\u1EB2\u1EB4\u1EB6\u1EB8\u1EBA\u1EBC\u1EBE\u1EC0\u1EC2\u1EC4\u1EC6\u1EC8\u1ECA\u1ECC\u1ECE\u1ED0\u1ED2\u1ED4\u1ED6\u1ED8\u1EDA\u1EDC\u1EDE\u1EE0\u1EE2\u1EE4\u1EE6\u1EE8\u1EEA\u1EEC\u1EEE\u1EF0\u1EF2\u1EF4\u1EF6\u1EF8\u1EFA\u1EFC\u1EFE\u1F08-\u1F0F\u1F18-\u1F1D\u1F28-\u1F2F\u1F38-\u1F3F\u1F48-\u1F4D\u1F59\u1F5B\u1F5D\u1F5F\u1F68-\u1F6F\u1FB8-\u1FBB\u1FC8-\u1FCB\u1FD8-\u1FDB\u1FE8-\u1FEC\u1FF8-\u1FFB\u2102\u2107\u210B-\u210D\u2110-\u2112\u2115\u2119-\u211D\u2124\u2126\u2128\u212A-\u212D\u2130-\u2133\u213E\u213F\u2145\u2183\u2C00-\u2C2E\u2C60\u2C62-\u2C64\u2C67\u2C69\u2C6B\u2C6D-\u2C70\u2C72\u2C75\u2C7E-\u2C80\u2C82\u2C84\u2C86\u2C88\u2C8A\u2C8C\u2C8E\u2C90\u2C92\u2C94\u2C96\u2C98\u2C9A\u2C9C\u2C9E\u2CA0\u2CA2\u2CA4\u2CA6\u2CA8\u2CAA\u2CAC\u2CAE\u2CB0\u2CB2\u2CB4\u2CB6\u2CB8\u2CBA\u2CBC\u2CBE\u2CC0\u2CC2\u2CC4\u2CC6\u2CC8\u2CCA\u2CCC\u2CCE\u2CD0\u2CD2\u2CD4\u2CD6\u2CD8\u2CDA\u2CDC\u2CDE\u2CE0\u2CE2\u2CEB\u2CED\u2CF2\uA640\uA642\uA644\uA646\uA648\uA64A\uA64C\uA64E\uA650\uA652\uA654\uA656\uA658\uA65A\uA65C\uA65E\uA660\uA662\uA664\uA666\uA668\uA66A\uA66C\uA680\uA682\uA684\uA686\uA688\uA68A\uA68C\uA68E\uA690\uA692\uA694\uA696\uA698\uA69A\uA722\uA724\uA726\uA728\uA72A\uA72C\uA72E\uA732\uA734\uA736\uA738\uA73A\uA73C\uA73E\uA740\uA742\uA744\uA746\uA748\uA74A\uA74C\uA74E\uA750\uA752\uA754\uA756\uA758\uA75A\uA75C\uA75E\uA760\uA762\uA764\uA766\uA768\uA76A\uA76C\uA76E\uA779\uA77B\uA77D\uA77E\uA780\uA782\uA784\uA786\uA78B\uA78D\uA790\uA792\uA796\uA798\uA79A\uA79C\uA79E\uA7A0\uA7A2\uA7A4\uA7A6\uA7A8\uA7AA-\uA7AE\uA7B0-\uA7B4\uA7B6\uA7B8\uFF21-\uFF3A', + 'astral': '\uD801[\uDC00-\uDC27\uDCB0-\uDCD3]|\uD803[\uDC80-\uDCB2]|\uD806[\uDCA0-\uDCBF]|\uD81B[\uDE40-\uDE5F]|\uD835[\uDC00-\uDC19\uDC34-\uDC4D\uDC68-\uDC81\uDC9C\uDC9E\uDC9F\uDCA2\uDCA5\uDCA6\uDCA9-\uDCAC\uDCAE-\uDCB5\uDCD0-\uDCE9\uDD04\uDD05\uDD07-\uDD0A\uDD0D-\uDD14\uDD16-\uDD1C\uDD38\uDD39\uDD3B-\uDD3E\uDD40-\uDD44\uDD46\uDD4A-\uDD50\uDD6C-\uDD85\uDDA0-\uDDB9\uDDD4-\uDDED\uDE08-\uDE21\uDE3C-\uDE55\uDE70-\uDE89\uDEA8-\uDEC0\uDEE2-\uDEFA\uDF1C-\uDF34\uDF56-\uDF6E\uDF90-\uDFA8\uDFCA]|\uD83A[\uDD00-\uDD21]' + }, + { + 'name': 'M', + 'alias': 'Mark', + 'bmp': '\u0300-\u036F\u0483-\u0489\u0591-\u05BD\u05BF\u05C1\u05C2\u05C4\u05C5\u05C7\u0610-\u061A\u064B-\u065F\u0670\u06D6-\u06DC\u06DF-\u06E4\u06E7\u06E8\u06EA-\u06ED\u0711\u0730-\u074A\u07A6-\u07B0\u07EB-\u07F3\u07FD\u0816-\u0819\u081B-\u0823\u0825-\u0827\u0829-\u082D\u0859-\u085B\u08D3-\u08E1\u08E3-\u0903\u093A-\u093C\u093E-\u094F\u0951-\u0957\u0962\u0963\u0981-\u0983\u09BC\u09BE-\u09C4\u09C7\u09C8\u09CB-\u09CD\u09D7\u09E2\u09E3\u09FE\u0A01-\u0A03\u0A3C\u0A3E-\u0A42\u0A47\u0A48\u0A4B-\u0A4D\u0A51\u0A70\u0A71\u0A75\u0A81-\u0A83\u0ABC\u0ABE-\u0AC5\u0AC7-\u0AC9\u0ACB-\u0ACD\u0AE2\u0AE3\u0AFA-\u0AFF\u0B01-\u0B03\u0B3C\u0B3E-\u0B44\u0B47\u0B48\u0B4B-\u0B4D\u0B56\u0B57\u0B62\u0B63\u0B82\u0BBE-\u0BC2\u0BC6-\u0BC8\u0BCA-\u0BCD\u0BD7\u0C00-\u0C04\u0C3E-\u0C44\u0C46-\u0C48\u0C4A-\u0C4D\u0C55\u0C56\u0C62\u0C63\u0C81-\u0C83\u0CBC\u0CBE-\u0CC4\u0CC6-\u0CC8\u0CCA-\u0CCD\u0CD5\u0CD6\u0CE2\u0CE3\u0D00-\u0D03\u0D3B\u0D3C\u0D3E-\u0D44\u0D46-\u0D48\u0D4A-\u0D4D\u0D57\u0D62\u0D63\u0D82\u0D83\u0DCA\u0DCF-\u0DD4\u0DD6\u0DD8-\u0DDF\u0DF2\u0DF3\u0E31\u0E34-\u0E3A\u0E47-\u0E4E\u0EB1\u0EB4-\u0EB9\u0EBB\u0EBC\u0EC8-\u0ECD\u0F18\u0F19\u0F35\u0F37\u0F39\u0F3E\u0F3F\u0F71-\u0F84\u0F86\u0F87\u0F8D-\u0F97\u0F99-\u0FBC\u0FC6\u102B-\u103E\u1056-\u1059\u105E-\u1060\u1062-\u1064\u1067-\u106D\u1071-\u1074\u1082-\u108D\u108F\u109A-\u109D\u135D-\u135F\u1712-\u1714\u1732-\u1734\u1752\u1753\u1772\u1773\u17B4-\u17D3\u17DD\u180B-\u180D\u1885\u1886\u18A9\u1920-\u192B\u1930-\u193B\u1A17-\u1A1B\u1A55-\u1A5E\u1A60-\u1A7C\u1A7F\u1AB0-\u1ABE\u1B00-\u1B04\u1B34-\u1B44\u1B6B-\u1B73\u1B80-\u1B82\u1BA1-\u1BAD\u1BE6-\u1BF3\u1C24-\u1C37\u1CD0-\u1CD2\u1CD4-\u1CE8\u1CED\u1CF2-\u1CF4\u1CF7-\u1CF9\u1DC0-\u1DF9\u1DFB-\u1DFF\u20D0-\u20F0\u2CEF-\u2CF1\u2D7F\u2DE0-\u2DFF\u302A-\u302F\u3099\u309A\uA66F-\uA672\uA674-\uA67D\uA69E\uA69F\uA6F0\uA6F1\uA802\uA806\uA80B\uA823-\uA827\uA880\uA881\uA8B4-\uA8C5\uA8E0-\uA8F1\uA8FF\uA926-\uA92D\uA947-\uA953\uA980-\uA983\uA9B3-\uA9C0\uA9E5\uAA29-\uAA36\uAA43\uAA4C\uAA4D\uAA7B-\uAA7D\uAAB0\uAAB2-\uAAB4\uAAB7\uAAB8\uAABE\uAABF\uAAC1\uAAEB-\uAAEF\uAAF5\uAAF6\uABE3-\uABEA\uABEC\uABED\uFB1E\uFE00-\uFE0F\uFE20-\uFE2F', + 'astral': '\uD800[\uDDFD\uDEE0\uDF76-\uDF7A]|\uD802[\uDE01-\uDE03\uDE05\uDE06\uDE0C-\uDE0F\uDE38-\uDE3A\uDE3F\uDEE5\uDEE6]|\uD803[\uDD24-\uDD27\uDF46-\uDF50]|\uD804[\uDC00-\uDC02\uDC38-\uDC46\uDC7F-\uDC82\uDCB0-\uDCBA\uDD00-\uDD02\uDD27-\uDD34\uDD45\uDD46\uDD73\uDD80-\uDD82\uDDB3-\uDDC0\uDDC9-\uDDCC\uDE2C-\uDE37\uDE3E\uDEDF-\uDEEA\uDF00-\uDF03\uDF3B\uDF3C\uDF3E-\uDF44\uDF47\uDF48\uDF4B-\uDF4D\uDF57\uDF62\uDF63\uDF66-\uDF6C\uDF70-\uDF74]|\uD805[\uDC35-\uDC46\uDC5E\uDCB0-\uDCC3\uDDAF-\uDDB5\uDDB8-\uDDC0\uDDDC\uDDDD\uDE30-\uDE40\uDEAB-\uDEB7\uDF1D-\uDF2B]|\uD806[\uDC2C-\uDC3A\uDE01-\uDE0A\uDE33-\uDE39\uDE3B-\uDE3E\uDE47\uDE51-\uDE5B\uDE8A-\uDE99]|\uD807[\uDC2F-\uDC36\uDC38-\uDC3F\uDC92-\uDCA7\uDCA9-\uDCB6\uDD31-\uDD36\uDD3A\uDD3C\uDD3D\uDD3F-\uDD45\uDD47\uDD8A-\uDD8E\uDD90\uDD91\uDD93-\uDD97\uDEF3-\uDEF6]|\uD81A[\uDEF0-\uDEF4\uDF30-\uDF36]|\uD81B[\uDF51-\uDF7E\uDF8F-\uDF92]|\uD82F[\uDC9D\uDC9E]|\uD834[\uDD65-\uDD69\uDD6D-\uDD72\uDD7B-\uDD82\uDD85-\uDD8B\uDDAA-\uDDAD\uDE42-\uDE44]|\uD836[\uDE00-\uDE36\uDE3B-\uDE6C\uDE75\uDE84\uDE9B-\uDE9F\uDEA1-\uDEAF]|\uD838[\uDC00-\uDC06\uDC08-\uDC18\uDC1B-\uDC21\uDC23\uDC24\uDC26-\uDC2A]|\uD83A[\uDCD0-\uDCD6\uDD44-\uDD4A]|\uDB40[\uDD00-\uDDEF]' + }, + { + 'name': 'Mc', + 'alias': 'Spacing_Mark', + 'bmp': '\u0903\u093B\u093E-\u0940\u0949-\u094C\u094E\u094F\u0982\u0983\u09BE-\u09C0\u09C7\u09C8\u09CB\u09CC\u09D7\u0A03\u0A3E-\u0A40\u0A83\u0ABE-\u0AC0\u0AC9\u0ACB\u0ACC\u0B02\u0B03\u0B3E\u0B40\u0B47\u0B48\u0B4B\u0B4C\u0B57\u0BBE\u0BBF\u0BC1\u0BC2\u0BC6-\u0BC8\u0BCA-\u0BCC\u0BD7\u0C01-\u0C03\u0C41-\u0C44\u0C82\u0C83\u0CBE\u0CC0-\u0CC4\u0CC7\u0CC8\u0CCA\u0CCB\u0CD5\u0CD6\u0D02\u0D03\u0D3E-\u0D40\u0D46-\u0D48\u0D4A-\u0D4C\u0D57\u0D82\u0D83\u0DCF-\u0DD1\u0DD8-\u0DDF\u0DF2\u0DF3\u0F3E\u0F3F\u0F7F\u102B\u102C\u1031\u1038\u103B\u103C\u1056\u1057\u1062-\u1064\u1067-\u106D\u1083\u1084\u1087-\u108C\u108F\u109A-\u109C\u17B6\u17BE-\u17C5\u17C7\u17C8\u1923-\u1926\u1929-\u192B\u1930\u1931\u1933-\u1938\u1A19\u1A1A\u1A55\u1A57\u1A61\u1A63\u1A64\u1A6D-\u1A72\u1B04\u1B35\u1B3B\u1B3D-\u1B41\u1B43\u1B44\u1B82\u1BA1\u1BA6\u1BA7\u1BAA\u1BE7\u1BEA-\u1BEC\u1BEE\u1BF2\u1BF3\u1C24-\u1C2B\u1C34\u1C35\u1CE1\u1CF2\u1CF3\u1CF7\u302E\u302F\uA823\uA824\uA827\uA880\uA881\uA8B4-\uA8C3\uA952\uA953\uA983\uA9B4\uA9B5\uA9BA\uA9BB\uA9BD-\uA9C0\uAA2F\uAA30\uAA33\uAA34\uAA4D\uAA7B\uAA7D\uAAEB\uAAEE\uAAEF\uAAF5\uABE3\uABE4\uABE6\uABE7\uABE9\uABEA\uABEC', + 'astral': '\uD804[\uDC00\uDC02\uDC82\uDCB0-\uDCB2\uDCB7\uDCB8\uDD2C\uDD45\uDD46\uDD82\uDDB3-\uDDB5\uDDBF\uDDC0\uDE2C-\uDE2E\uDE32\uDE33\uDE35\uDEE0-\uDEE2\uDF02\uDF03\uDF3E\uDF3F\uDF41-\uDF44\uDF47\uDF48\uDF4B-\uDF4D\uDF57\uDF62\uDF63]|\uD805[\uDC35-\uDC37\uDC40\uDC41\uDC45\uDCB0-\uDCB2\uDCB9\uDCBB-\uDCBE\uDCC1\uDDAF-\uDDB1\uDDB8-\uDDBB\uDDBE\uDE30-\uDE32\uDE3B\uDE3C\uDE3E\uDEAC\uDEAE\uDEAF\uDEB6\uDF20\uDF21\uDF26]|\uD806[\uDC2C-\uDC2E\uDC38\uDE39\uDE57\uDE58\uDE97]|\uD807[\uDC2F\uDC3E\uDCA9\uDCB1\uDCB4\uDD8A-\uDD8E\uDD93\uDD94\uDD96\uDEF5\uDEF6]|\uD81B[\uDF51-\uDF7E]|\uD834[\uDD65\uDD66\uDD6D-\uDD72]' + }, + { + 'name': 'Me', + 'alias': 'Enclosing_Mark', + 'bmp': '\u0488\u0489\u1ABE\u20DD-\u20E0\u20E2-\u20E4\uA670-\uA672' + }, + { + 'name': 'Mn', + 'alias': 'Nonspacing_Mark', + 'bmp': '\u0300-\u036F\u0483-\u0487\u0591-\u05BD\u05BF\u05C1\u05C2\u05C4\u05C5\u05C7\u0610-\u061A\u064B-\u065F\u0670\u06D6-\u06DC\u06DF-\u06E4\u06E7\u06E8\u06EA-\u06ED\u0711\u0730-\u074A\u07A6-\u07B0\u07EB-\u07F3\u07FD\u0816-\u0819\u081B-\u0823\u0825-\u0827\u0829-\u082D\u0859-\u085B\u08D3-\u08E1\u08E3-\u0902\u093A\u093C\u0941-\u0948\u094D\u0951-\u0957\u0962\u0963\u0981\u09BC\u09C1-\u09C4\u09CD\u09E2\u09E3\u09FE\u0A01\u0A02\u0A3C\u0A41\u0A42\u0A47\u0A48\u0A4B-\u0A4D\u0A51\u0A70\u0A71\u0A75\u0A81\u0A82\u0ABC\u0AC1-\u0AC5\u0AC7\u0AC8\u0ACD\u0AE2\u0AE3\u0AFA-\u0AFF\u0B01\u0B3C\u0B3F\u0B41-\u0B44\u0B4D\u0B56\u0B62\u0B63\u0B82\u0BC0\u0BCD\u0C00\u0C04\u0C3E-\u0C40\u0C46-\u0C48\u0C4A-\u0C4D\u0C55\u0C56\u0C62\u0C63\u0C81\u0CBC\u0CBF\u0CC6\u0CCC\u0CCD\u0CE2\u0CE3\u0D00\u0D01\u0D3B\u0D3C\u0D41-\u0D44\u0D4D\u0D62\u0D63\u0DCA\u0DD2-\u0DD4\u0DD6\u0E31\u0E34-\u0E3A\u0E47-\u0E4E\u0EB1\u0EB4-\u0EB9\u0EBB\u0EBC\u0EC8-\u0ECD\u0F18\u0F19\u0F35\u0F37\u0F39\u0F71-\u0F7E\u0F80-\u0F84\u0F86\u0F87\u0F8D-\u0F97\u0F99-\u0FBC\u0FC6\u102D-\u1030\u1032-\u1037\u1039\u103A\u103D\u103E\u1058\u1059\u105E-\u1060\u1071-\u1074\u1082\u1085\u1086\u108D\u109D\u135D-\u135F\u1712-\u1714\u1732-\u1734\u1752\u1753\u1772\u1773\u17B4\u17B5\u17B7-\u17BD\u17C6\u17C9-\u17D3\u17DD\u180B-\u180D\u1885\u1886\u18A9\u1920-\u1922\u1927\u1928\u1932\u1939-\u193B\u1A17\u1A18\u1A1B\u1A56\u1A58-\u1A5E\u1A60\u1A62\u1A65-\u1A6C\u1A73-\u1A7C\u1A7F\u1AB0-\u1ABD\u1B00-\u1B03\u1B34\u1B36-\u1B3A\u1B3C\u1B42\u1B6B-\u1B73\u1B80\u1B81\u1BA2-\u1BA5\u1BA8\u1BA9\u1BAB-\u1BAD\u1BE6\u1BE8\u1BE9\u1BED\u1BEF-\u1BF1\u1C2C-\u1C33\u1C36\u1C37\u1CD0-\u1CD2\u1CD4-\u1CE0\u1CE2-\u1CE8\u1CED\u1CF4\u1CF8\u1CF9\u1DC0-\u1DF9\u1DFB-\u1DFF\u20D0-\u20DC\u20E1\u20E5-\u20F0\u2CEF-\u2CF1\u2D7F\u2DE0-\u2DFF\u302A-\u302D\u3099\u309A\uA66F\uA674-\uA67D\uA69E\uA69F\uA6F0\uA6F1\uA802\uA806\uA80B\uA825\uA826\uA8C4\uA8C5\uA8E0-\uA8F1\uA8FF\uA926-\uA92D\uA947-\uA951\uA980-\uA982\uA9B3\uA9B6-\uA9B9\uA9BC\uA9E5\uAA29-\uAA2E\uAA31\uAA32\uAA35\uAA36\uAA43\uAA4C\uAA7C\uAAB0\uAAB2-\uAAB4\uAAB7\uAAB8\uAABE\uAABF\uAAC1\uAAEC\uAAED\uAAF6\uABE5\uABE8\uABED\uFB1E\uFE00-\uFE0F\uFE20-\uFE2F', + 'astral': '\uD800[\uDDFD\uDEE0\uDF76-\uDF7A]|\uD802[\uDE01-\uDE03\uDE05\uDE06\uDE0C-\uDE0F\uDE38-\uDE3A\uDE3F\uDEE5\uDEE6]|\uD803[\uDD24-\uDD27\uDF46-\uDF50]|\uD804[\uDC01\uDC38-\uDC46\uDC7F-\uDC81\uDCB3-\uDCB6\uDCB9\uDCBA\uDD00-\uDD02\uDD27-\uDD2B\uDD2D-\uDD34\uDD73\uDD80\uDD81\uDDB6-\uDDBE\uDDC9-\uDDCC\uDE2F-\uDE31\uDE34\uDE36\uDE37\uDE3E\uDEDF\uDEE3-\uDEEA\uDF00\uDF01\uDF3B\uDF3C\uDF40\uDF66-\uDF6C\uDF70-\uDF74]|\uD805[\uDC38-\uDC3F\uDC42-\uDC44\uDC46\uDC5E\uDCB3-\uDCB8\uDCBA\uDCBF\uDCC0\uDCC2\uDCC3\uDDB2-\uDDB5\uDDBC\uDDBD\uDDBF\uDDC0\uDDDC\uDDDD\uDE33-\uDE3A\uDE3D\uDE3F\uDE40\uDEAB\uDEAD\uDEB0-\uDEB5\uDEB7\uDF1D-\uDF1F\uDF22-\uDF25\uDF27-\uDF2B]|\uD806[\uDC2F-\uDC37\uDC39\uDC3A\uDE01-\uDE0A\uDE33-\uDE38\uDE3B-\uDE3E\uDE47\uDE51-\uDE56\uDE59-\uDE5B\uDE8A-\uDE96\uDE98\uDE99]|\uD807[\uDC30-\uDC36\uDC38-\uDC3D\uDC3F\uDC92-\uDCA7\uDCAA-\uDCB0\uDCB2\uDCB3\uDCB5\uDCB6\uDD31-\uDD36\uDD3A\uDD3C\uDD3D\uDD3F-\uDD45\uDD47\uDD90\uDD91\uDD95\uDD97\uDEF3\uDEF4]|\uD81A[\uDEF0-\uDEF4\uDF30-\uDF36]|\uD81B[\uDF8F-\uDF92]|\uD82F[\uDC9D\uDC9E]|\uD834[\uDD67-\uDD69\uDD7B-\uDD82\uDD85-\uDD8B\uDDAA-\uDDAD\uDE42-\uDE44]|\uD836[\uDE00-\uDE36\uDE3B-\uDE6C\uDE75\uDE84\uDE9B-\uDE9F\uDEA1-\uDEAF]|\uD838[\uDC00-\uDC06\uDC08-\uDC18\uDC1B-\uDC21\uDC23\uDC24\uDC26-\uDC2A]|\uD83A[\uDCD0-\uDCD6\uDD44-\uDD4A]|\uDB40[\uDD00-\uDDEF]' + }, + { + 'name': 'N', + 'alias': 'Number', + 'bmp': '0-9\xB2\xB3\xB9\xBC-\xBE\u0660-\u0669\u06F0-\u06F9\u07C0-\u07C9\u0966-\u096F\u09E6-\u09EF\u09F4-\u09F9\u0A66-\u0A6F\u0AE6-\u0AEF\u0B66-\u0B6F\u0B72-\u0B77\u0BE6-\u0BF2\u0C66-\u0C6F\u0C78-\u0C7E\u0CE6-\u0CEF\u0D58-\u0D5E\u0D66-\u0D78\u0DE6-\u0DEF\u0E50-\u0E59\u0ED0-\u0ED9\u0F20-\u0F33\u1040-\u1049\u1090-\u1099\u1369-\u137C\u16EE-\u16F0\u17E0-\u17E9\u17F0-\u17F9\u1810-\u1819\u1946-\u194F\u19D0-\u19DA\u1A80-\u1A89\u1A90-\u1A99\u1B50-\u1B59\u1BB0-\u1BB9\u1C40-\u1C49\u1C50-\u1C59\u2070\u2074-\u2079\u2080-\u2089\u2150-\u2182\u2185-\u2189\u2460-\u249B\u24EA-\u24FF\u2776-\u2793\u2CFD\u3007\u3021-\u3029\u3038-\u303A\u3192-\u3195\u3220-\u3229\u3248-\u324F\u3251-\u325F\u3280-\u3289\u32B1-\u32BF\uA620-\uA629\uA6E6-\uA6EF\uA830-\uA835\uA8D0-\uA8D9\uA900-\uA909\uA9D0-\uA9D9\uA9F0-\uA9F9\uAA50-\uAA59\uABF0-\uABF9\uFF10-\uFF19', + 'astral': '\uD800[\uDD07-\uDD33\uDD40-\uDD78\uDD8A\uDD8B\uDEE1-\uDEFB\uDF20-\uDF23\uDF41\uDF4A\uDFD1-\uDFD5]|\uD801[\uDCA0-\uDCA9]|\uD802[\uDC58-\uDC5F\uDC79-\uDC7F\uDCA7-\uDCAF\uDCFB-\uDCFF\uDD16-\uDD1B\uDDBC\uDDBD\uDDC0-\uDDCF\uDDD2-\uDDFF\uDE40-\uDE48\uDE7D\uDE7E\uDE9D-\uDE9F\uDEEB-\uDEEF\uDF58-\uDF5F\uDF78-\uDF7F\uDFA9-\uDFAF]|\uD803[\uDCFA-\uDCFF\uDD30-\uDD39\uDE60-\uDE7E\uDF1D-\uDF26\uDF51-\uDF54]|\uD804[\uDC52-\uDC6F\uDCF0-\uDCF9\uDD36-\uDD3F\uDDD0-\uDDD9\uDDE1-\uDDF4\uDEF0-\uDEF9]|\uD805[\uDC50-\uDC59\uDCD0-\uDCD9\uDE50-\uDE59\uDEC0-\uDEC9\uDF30-\uDF3B]|\uD806[\uDCE0-\uDCF2]|\uD807[\uDC50-\uDC6C\uDD50-\uDD59\uDDA0-\uDDA9]|\uD809[\uDC00-\uDC6E]|\uD81A[\uDE60-\uDE69\uDF50-\uDF59\uDF5B-\uDF61]|\uD81B[\uDE80-\uDE96]|\uD834[\uDEE0-\uDEF3\uDF60-\uDF78]|\uD835[\uDFCE-\uDFFF]|\uD83A[\uDCC7-\uDCCF\uDD50-\uDD59]|\uD83B[\uDC71-\uDCAB\uDCAD-\uDCAF\uDCB1-\uDCB4]|\uD83C[\uDD00-\uDD0C]' + }, + { + 'name': 'Nd', + 'alias': 'Decimal_Number', + 'bmp': '0-9\u0660-\u0669\u06F0-\u06F9\u07C0-\u07C9\u0966-\u096F\u09E6-\u09EF\u0A66-\u0A6F\u0AE6-\u0AEF\u0B66-\u0B6F\u0BE6-\u0BEF\u0C66-\u0C6F\u0CE6-\u0CEF\u0D66-\u0D6F\u0DE6-\u0DEF\u0E50-\u0E59\u0ED0-\u0ED9\u0F20-\u0F29\u1040-\u1049\u1090-\u1099\u17E0-\u17E9\u1810-\u1819\u1946-\u194F\u19D0-\u19D9\u1A80-\u1A89\u1A90-\u1A99\u1B50-\u1B59\u1BB0-\u1BB9\u1C40-\u1C49\u1C50-\u1C59\uA620-\uA629\uA8D0-\uA8D9\uA900-\uA909\uA9D0-\uA9D9\uA9F0-\uA9F9\uAA50-\uAA59\uABF0-\uABF9\uFF10-\uFF19', + 'astral': '\uD801[\uDCA0-\uDCA9]|\uD803[\uDD30-\uDD39]|\uD804[\uDC66-\uDC6F\uDCF0-\uDCF9\uDD36-\uDD3F\uDDD0-\uDDD9\uDEF0-\uDEF9]|\uD805[\uDC50-\uDC59\uDCD0-\uDCD9\uDE50-\uDE59\uDEC0-\uDEC9\uDF30-\uDF39]|\uD806[\uDCE0-\uDCE9]|\uD807[\uDC50-\uDC59\uDD50-\uDD59\uDDA0-\uDDA9]|\uD81A[\uDE60-\uDE69\uDF50-\uDF59]|\uD835[\uDFCE-\uDFFF]|\uD83A[\uDD50-\uDD59]' + }, + { + 'name': 'Nl', + 'alias': 'Letter_Number', + 'bmp': '\u16EE-\u16F0\u2160-\u2182\u2185-\u2188\u3007\u3021-\u3029\u3038-\u303A\uA6E6-\uA6EF', + 'astral': '\uD800[\uDD40-\uDD74\uDF41\uDF4A\uDFD1-\uDFD5]|\uD809[\uDC00-\uDC6E]' + }, + { + 'name': 'No', + 'alias': 'Other_Number', + 'bmp': '\xB2\xB3\xB9\xBC-\xBE\u09F4-\u09F9\u0B72-\u0B77\u0BF0-\u0BF2\u0C78-\u0C7E\u0D58-\u0D5E\u0D70-\u0D78\u0F2A-\u0F33\u1369-\u137C\u17F0-\u17F9\u19DA\u2070\u2074-\u2079\u2080-\u2089\u2150-\u215F\u2189\u2460-\u249B\u24EA-\u24FF\u2776-\u2793\u2CFD\u3192-\u3195\u3220-\u3229\u3248-\u324F\u3251-\u325F\u3280-\u3289\u32B1-\u32BF\uA830-\uA835', + 'astral': '\uD800[\uDD07-\uDD33\uDD75-\uDD78\uDD8A\uDD8B\uDEE1-\uDEFB\uDF20-\uDF23]|\uD802[\uDC58-\uDC5F\uDC79-\uDC7F\uDCA7-\uDCAF\uDCFB-\uDCFF\uDD16-\uDD1B\uDDBC\uDDBD\uDDC0-\uDDCF\uDDD2-\uDDFF\uDE40-\uDE48\uDE7D\uDE7E\uDE9D-\uDE9F\uDEEB-\uDEEF\uDF58-\uDF5F\uDF78-\uDF7F\uDFA9-\uDFAF]|\uD803[\uDCFA-\uDCFF\uDE60-\uDE7E\uDF1D-\uDF26\uDF51-\uDF54]|\uD804[\uDC52-\uDC65\uDDE1-\uDDF4]|\uD805[\uDF3A\uDF3B]|\uD806[\uDCEA-\uDCF2]|\uD807[\uDC5A-\uDC6C]|\uD81A[\uDF5B-\uDF61]|\uD81B[\uDE80-\uDE96]|\uD834[\uDEE0-\uDEF3\uDF60-\uDF78]|\uD83A[\uDCC7-\uDCCF]|\uD83B[\uDC71-\uDCAB\uDCAD-\uDCAF\uDCB1-\uDCB4]|\uD83C[\uDD00-\uDD0C]' + }, + { + 'name': 'P', + 'alias': 'Punctuation', + 'bmp': '!-#%-\\*,-\\/:;\\?@\\[-\\]_\\{\\}\xA1\xA7\xAB\xB6\xB7\xBB\xBF\u037E\u0387\u055A-\u055F\u0589\u058A\u05BE\u05C0\u05C3\u05C6\u05F3\u05F4\u0609\u060A\u060C\u060D\u061B\u061E\u061F\u066A-\u066D\u06D4\u0700-\u070D\u07F7-\u07F9\u0830-\u083E\u085E\u0964\u0965\u0970\u09FD\u0A76\u0AF0\u0C84\u0DF4\u0E4F\u0E5A\u0E5B\u0F04-\u0F12\u0F14\u0F3A-\u0F3D\u0F85\u0FD0-\u0FD4\u0FD9\u0FDA\u104A-\u104F\u10FB\u1360-\u1368\u1400\u166D\u166E\u169B\u169C\u16EB-\u16ED\u1735\u1736\u17D4-\u17D6\u17D8-\u17DA\u1800-\u180A\u1944\u1945\u1A1E\u1A1F\u1AA0-\u1AA6\u1AA8-\u1AAD\u1B5A-\u1B60\u1BFC-\u1BFF\u1C3B-\u1C3F\u1C7E\u1C7F\u1CC0-\u1CC7\u1CD3\u2010-\u2027\u2030-\u2043\u2045-\u2051\u2053-\u205E\u207D\u207E\u208D\u208E\u2308-\u230B\u2329\u232A\u2768-\u2775\u27C5\u27C6\u27E6-\u27EF\u2983-\u2998\u29D8-\u29DB\u29FC\u29FD\u2CF9-\u2CFC\u2CFE\u2CFF\u2D70\u2E00-\u2E2E\u2E30-\u2E4E\u3001-\u3003\u3008-\u3011\u3014-\u301F\u3030\u303D\u30A0\u30FB\uA4FE\uA4FF\uA60D-\uA60F\uA673\uA67E\uA6F2-\uA6F7\uA874-\uA877\uA8CE\uA8CF\uA8F8-\uA8FA\uA8FC\uA92E\uA92F\uA95F\uA9C1-\uA9CD\uA9DE\uA9DF\uAA5C-\uAA5F\uAADE\uAADF\uAAF0\uAAF1\uABEB\uFD3E\uFD3F\uFE10-\uFE19\uFE30-\uFE52\uFE54-\uFE61\uFE63\uFE68\uFE6A\uFE6B\uFF01-\uFF03\uFF05-\uFF0A\uFF0C-\uFF0F\uFF1A\uFF1B\uFF1F\uFF20\uFF3B-\uFF3D\uFF3F\uFF5B\uFF5D\uFF5F-\uFF65', + 'astral': '\uD800[\uDD00-\uDD02\uDF9F\uDFD0]|\uD801\uDD6F|\uD802[\uDC57\uDD1F\uDD3F\uDE50-\uDE58\uDE7F\uDEF0-\uDEF6\uDF39-\uDF3F\uDF99-\uDF9C]|\uD803[\uDF55-\uDF59]|\uD804[\uDC47-\uDC4D\uDCBB\uDCBC\uDCBE-\uDCC1\uDD40-\uDD43\uDD74\uDD75\uDDC5-\uDDC8\uDDCD\uDDDB\uDDDD-\uDDDF\uDE38-\uDE3D\uDEA9]|\uD805[\uDC4B-\uDC4F\uDC5B\uDC5D\uDCC6\uDDC1-\uDDD7\uDE41-\uDE43\uDE60-\uDE6C\uDF3C-\uDF3E]|\uD806[\uDC3B\uDE3F-\uDE46\uDE9A-\uDE9C\uDE9E-\uDEA2]|\uD807[\uDC41-\uDC45\uDC70\uDC71\uDEF7\uDEF8]|\uD809[\uDC70-\uDC74]|\uD81A[\uDE6E\uDE6F\uDEF5\uDF37-\uDF3B\uDF44]|\uD81B[\uDE97-\uDE9A]|\uD82F\uDC9F|\uD836[\uDE87-\uDE8B]|\uD83A[\uDD5E\uDD5F]' + }, + { + 'name': 'Pc', + 'alias': 'Connector_Punctuation', + 'bmp': '_\u203F\u2040\u2054\uFE33\uFE34\uFE4D-\uFE4F\uFF3F' + }, + { + 'name': 'Pd', + 'alias': 'Dash_Punctuation', + 'bmp': '\\-\u058A\u05BE\u1400\u1806\u2010-\u2015\u2E17\u2E1A\u2E3A\u2E3B\u2E40\u301C\u3030\u30A0\uFE31\uFE32\uFE58\uFE63\uFF0D' + }, + { + 'name': 'Pe', + 'alias': 'Close_Punctuation', + 'bmp': '\\)\\]\\}\u0F3B\u0F3D\u169C\u2046\u207E\u208E\u2309\u230B\u232A\u2769\u276B\u276D\u276F\u2771\u2773\u2775\u27C6\u27E7\u27E9\u27EB\u27ED\u27EF\u2984\u2986\u2988\u298A\u298C\u298E\u2990\u2992\u2994\u2996\u2998\u29D9\u29DB\u29FD\u2E23\u2E25\u2E27\u2E29\u3009\u300B\u300D\u300F\u3011\u3015\u3017\u3019\u301B\u301E\u301F\uFD3E\uFE18\uFE36\uFE38\uFE3A\uFE3C\uFE3E\uFE40\uFE42\uFE44\uFE48\uFE5A\uFE5C\uFE5E\uFF09\uFF3D\uFF5D\uFF60\uFF63' + }, + { + 'name': 'Pf', + 'alias': 'Final_Punctuation', + 'bmp': '\xBB\u2019\u201D\u203A\u2E03\u2E05\u2E0A\u2E0D\u2E1D\u2E21' + }, + { + 'name': 'Pi', + 'alias': 'Initial_Punctuation', + 'bmp': '\xAB\u2018\u201B\u201C\u201F\u2039\u2E02\u2E04\u2E09\u2E0C\u2E1C\u2E20' + }, + { + 'name': 'Po', + 'alias': 'Other_Punctuation', + 'bmp': '!-#%-\'\\*,\\.\\/:;\\?@\\\xA1\xA7\xB6\xB7\xBF\u037E\u0387\u055A-\u055F\u0589\u05C0\u05C3\u05C6\u05F3\u05F4\u0609\u060A\u060C\u060D\u061B\u061E\u061F\u066A-\u066D\u06D4\u0700-\u070D\u07F7-\u07F9\u0830-\u083E\u085E\u0964\u0965\u0970\u09FD\u0A76\u0AF0\u0C84\u0DF4\u0E4F\u0E5A\u0E5B\u0F04-\u0F12\u0F14\u0F85\u0FD0-\u0FD4\u0FD9\u0FDA\u104A-\u104F\u10FB\u1360-\u1368\u166D\u166E\u16EB-\u16ED\u1735\u1736\u17D4-\u17D6\u17D8-\u17DA\u1800-\u1805\u1807-\u180A\u1944\u1945\u1A1E\u1A1F\u1AA0-\u1AA6\u1AA8-\u1AAD\u1B5A-\u1B60\u1BFC-\u1BFF\u1C3B-\u1C3F\u1C7E\u1C7F\u1CC0-\u1CC7\u1CD3\u2016\u2017\u2020-\u2027\u2030-\u2038\u203B-\u203E\u2041-\u2043\u2047-\u2051\u2053\u2055-\u205E\u2CF9-\u2CFC\u2CFE\u2CFF\u2D70\u2E00\u2E01\u2E06-\u2E08\u2E0B\u2E0E-\u2E16\u2E18\u2E19\u2E1B\u2E1E\u2E1F\u2E2A-\u2E2E\u2E30-\u2E39\u2E3C-\u2E3F\u2E41\u2E43-\u2E4E\u3001-\u3003\u303D\u30FB\uA4FE\uA4FF\uA60D-\uA60F\uA673\uA67E\uA6F2-\uA6F7\uA874-\uA877\uA8CE\uA8CF\uA8F8-\uA8FA\uA8FC\uA92E\uA92F\uA95F\uA9C1-\uA9CD\uA9DE\uA9DF\uAA5C-\uAA5F\uAADE\uAADF\uAAF0\uAAF1\uABEB\uFE10-\uFE16\uFE19\uFE30\uFE45\uFE46\uFE49-\uFE4C\uFE50-\uFE52\uFE54-\uFE57\uFE5F-\uFE61\uFE68\uFE6A\uFE6B\uFF01-\uFF03\uFF05-\uFF07\uFF0A\uFF0C\uFF0E\uFF0F\uFF1A\uFF1B\uFF1F\uFF20\uFF3C\uFF61\uFF64\uFF65', + 'astral': '\uD800[\uDD00-\uDD02\uDF9F\uDFD0]|\uD801\uDD6F|\uD802[\uDC57\uDD1F\uDD3F\uDE50-\uDE58\uDE7F\uDEF0-\uDEF6\uDF39-\uDF3F\uDF99-\uDF9C]|\uD803[\uDF55-\uDF59]|\uD804[\uDC47-\uDC4D\uDCBB\uDCBC\uDCBE-\uDCC1\uDD40-\uDD43\uDD74\uDD75\uDDC5-\uDDC8\uDDCD\uDDDB\uDDDD-\uDDDF\uDE38-\uDE3D\uDEA9]|\uD805[\uDC4B-\uDC4F\uDC5B\uDC5D\uDCC6\uDDC1-\uDDD7\uDE41-\uDE43\uDE60-\uDE6C\uDF3C-\uDF3E]|\uD806[\uDC3B\uDE3F-\uDE46\uDE9A-\uDE9C\uDE9E-\uDEA2]|\uD807[\uDC41-\uDC45\uDC70\uDC71\uDEF7\uDEF8]|\uD809[\uDC70-\uDC74]|\uD81A[\uDE6E\uDE6F\uDEF5\uDF37-\uDF3B\uDF44]|\uD81B[\uDE97-\uDE9A]|\uD82F\uDC9F|\uD836[\uDE87-\uDE8B]|\uD83A[\uDD5E\uDD5F]' + }, + { + 'name': 'Ps', + 'alias': 'Open_Punctuation', + 'bmp': '\\(\\[\\{\u0F3A\u0F3C\u169B\u201A\u201E\u2045\u207D\u208D\u2308\u230A\u2329\u2768\u276A\u276C\u276E\u2770\u2772\u2774\u27C5\u27E6\u27E8\u27EA\u27EC\u27EE\u2983\u2985\u2987\u2989\u298B\u298D\u298F\u2991\u2993\u2995\u2997\u29D8\u29DA\u29FC\u2E22\u2E24\u2E26\u2E28\u2E42\u3008\u300A\u300C\u300E\u3010\u3014\u3016\u3018\u301A\u301D\uFD3F\uFE17\uFE35\uFE37\uFE39\uFE3B\uFE3D\uFE3F\uFE41\uFE43\uFE47\uFE59\uFE5B\uFE5D\uFF08\uFF3B\uFF5B\uFF5F\uFF62' + }, + { + 'name': 'S', + 'alias': 'Symbol', + 'bmp': '\\$\\+<->\\^`\\|~\xA2-\xA6\xA8\xA9\xAC\xAE-\xB1\xB4\xB8\xD7\xF7\u02C2-\u02C5\u02D2-\u02DF\u02E5-\u02EB\u02ED\u02EF-\u02FF\u0375\u0384\u0385\u03F6\u0482\u058D-\u058F\u0606-\u0608\u060B\u060E\u060F\u06DE\u06E9\u06FD\u06FE\u07F6\u07FE\u07FF\u09F2\u09F3\u09FA\u09FB\u0AF1\u0B70\u0BF3-\u0BFA\u0C7F\u0D4F\u0D79\u0E3F\u0F01-\u0F03\u0F13\u0F15-\u0F17\u0F1A-\u0F1F\u0F34\u0F36\u0F38\u0FBE-\u0FC5\u0FC7-\u0FCC\u0FCE\u0FCF\u0FD5-\u0FD8\u109E\u109F\u1390-\u1399\u17DB\u1940\u19DE-\u19FF\u1B61-\u1B6A\u1B74-\u1B7C\u1FBD\u1FBF-\u1FC1\u1FCD-\u1FCF\u1FDD-\u1FDF\u1FED-\u1FEF\u1FFD\u1FFE\u2044\u2052\u207A-\u207C\u208A-\u208C\u20A0-\u20BF\u2100\u2101\u2103-\u2106\u2108\u2109\u2114\u2116-\u2118\u211E-\u2123\u2125\u2127\u2129\u212E\u213A\u213B\u2140-\u2144\u214A-\u214D\u214F\u218A\u218B\u2190-\u2307\u230C-\u2328\u232B-\u2426\u2440-\u244A\u249C-\u24E9\u2500-\u2767\u2794-\u27C4\u27C7-\u27E5\u27F0-\u2982\u2999-\u29D7\u29DC-\u29FB\u29FE-\u2B73\u2B76-\u2B95\u2B98-\u2BC8\u2BCA-\u2BFE\u2CE5-\u2CEA\u2E80-\u2E99\u2E9B-\u2EF3\u2F00-\u2FD5\u2FF0-\u2FFB\u3004\u3012\u3013\u3020\u3036\u3037\u303E\u303F\u309B\u309C\u3190\u3191\u3196-\u319F\u31C0-\u31E3\u3200-\u321E\u322A-\u3247\u3250\u3260-\u327F\u328A-\u32B0\u32C0-\u32FE\u3300-\u33FF\u4DC0-\u4DFF\uA490-\uA4C6\uA700-\uA716\uA720\uA721\uA789\uA78A\uA828-\uA82B\uA836-\uA839\uAA77-\uAA79\uAB5B\uFB29\uFBB2-\uFBC1\uFDFC\uFDFD\uFE62\uFE64-\uFE66\uFE69\uFF04\uFF0B\uFF1C-\uFF1E\uFF3E\uFF40\uFF5C\uFF5E\uFFE0-\uFFE6\uFFE8-\uFFEE\uFFFC\uFFFD', + 'astral': '\uD800[\uDD37-\uDD3F\uDD79-\uDD89\uDD8C-\uDD8E\uDD90-\uDD9B\uDDA0\uDDD0-\uDDFC]|\uD802[\uDC77\uDC78\uDEC8]|\uD805\uDF3F|\uD81A[\uDF3C-\uDF3F\uDF45]|\uD82F\uDC9C|\uD834[\uDC00-\uDCF5\uDD00-\uDD26\uDD29-\uDD64\uDD6A-\uDD6C\uDD83\uDD84\uDD8C-\uDDA9\uDDAE-\uDDE8\uDE00-\uDE41\uDE45\uDF00-\uDF56]|\uD835[\uDEC1\uDEDB\uDEFB\uDF15\uDF35\uDF4F\uDF6F\uDF89\uDFA9\uDFC3]|\uD836[\uDC00-\uDDFF\uDE37-\uDE3A\uDE6D-\uDE74\uDE76-\uDE83\uDE85\uDE86]|\uD83B[\uDCAC\uDCB0\uDEF0\uDEF1]|\uD83C[\uDC00-\uDC2B\uDC30-\uDC93\uDCA0-\uDCAE\uDCB1-\uDCBF\uDCC1-\uDCCF\uDCD1-\uDCF5\uDD10-\uDD6B\uDD70-\uDDAC\uDDE6-\uDE02\uDE10-\uDE3B\uDE40-\uDE48\uDE50\uDE51\uDE60-\uDE65\uDF00-\uDFFF]|\uD83D[\uDC00-\uDED4\uDEE0-\uDEEC\uDEF0-\uDEF9\uDF00-\uDF73\uDF80-\uDFD8]|\uD83E[\uDC00-\uDC0B\uDC10-\uDC47\uDC50-\uDC59\uDC60-\uDC87\uDC90-\uDCAD\uDD00-\uDD0B\uDD10-\uDD3E\uDD40-\uDD70\uDD73-\uDD76\uDD7A\uDD7C-\uDDA2\uDDB0-\uDDB9\uDDC0-\uDDC2\uDDD0-\uDDFF\uDE60-\uDE6D]' + }, + { + 'name': 'Sc', + 'alias': 'Currency_Symbol', + 'bmp': '\\$\xA2-\xA5\u058F\u060B\u07FE\u07FF\u09F2\u09F3\u09FB\u0AF1\u0BF9\u0E3F\u17DB\u20A0-\u20BF\uA838\uFDFC\uFE69\uFF04\uFFE0\uFFE1\uFFE5\uFFE6', + 'astral': '\uD83B\uDCB0' + }, + { + 'name': 'Sk', + 'alias': 'Modifier_Symbol', + 'bmp': '\\^`\xA8\xAF\xB4\xB8\u02C2-\u02C5\u02D2-\u02DF\u02E5-\u02EB\u02ED\u02EF-\u02FF\u0375\u0384\u0385\u1FBD\u1FBF-\u1FC1\u1FCD-\u1FCF\u1FDD-\u1FDF\u1FED-\u1FEF\u1FFD\u1FFE\u309B\u309C\uA700-\uA716\uA720\uA721\uA789\uA78A\uAB5B\uFBB2-\uFBC1\uFF3E\uFF40\uFFE3', + 'astral': '\uD83C[\uDFFB-\uDFFF]' + }, + { + 'name': 'Sm', + 'alias': 'Math_Symbol', + 'bmp': '\\+<->\\|~\xAC\xB1\xD7\xF7\u03F6\u0606-\u0608\u2044\u2052\u207A-\u207C\u208A-\u208C\u2118\u2140-\u2144\u214B\u2190-\u2194\u219A\u219B\u21A0\u21A3\u21A6\u21AE\u21CE\u21CF\u21D2\u21D4\u21F4-\u22FF\u2320\u2321\u237C\u239B-\u23B3\u23DC-\u23E1\u25B7\u25C1\u25F8-\u25FF\u266F\u27C0-\u27C4\u27C7-\u27E5\u27F0-\u27FF\u2900-\u2982\u2999-\u29D7\u29DC-\u29FB\u29FE-\u2AFF\u2B30-\u2B44\u2B47-\u2B4C\uFB29\uFE62\uFE64-\uFE66\uFF0B\uFF1C-\uFF1E\uFF5C\uFF5E\uFFE2\uFFE9-\uFFEC', + 'astral': '\uD835[\uDEC1\uDEDB\uDEFB\uDF15\uDF35\uDF4F\uDF6F\uDF89\uDFA9\uDFC3]|\uD83B[\uDEF0\uDEF1]' + }, + { + 'name': 'So', + 'alias': 'Other_Symbol', + 'bmp': '\xA6\xA9\xAE\xB0\u0482\u058D\u058E\u060E\u060F\u06DE\u06E9\u06FD\u06FE\u07F6\u09FA\u0B70\u0BF3-\u0BF8\u0BFA\u0C7F\u0D4F\u0D79\u0F01-\u0F03\u0F13\u0F15-\u0F17\u0F1A-\u0F1F\u0F34\u0F36\u0F38\u0FBE-\u0FC5\u0FC7-\u0FCC\u0FCE\u0FCF\u0FD5-\u0FD8\u109E\u109F\u1390-\u1399\u1940\u19DE-\u19FF\u1B61-\u1B6A\u1B74-\u1B7C\u2100\u2101\u2103-\u2106\u2108\u2109\u2114\u2116\u2117\u211E-\u2123\u2125\u2127\u2129\u212E\u213A\u213B\u214A\u214C\u214D\u214F\u218A\u218B\u2195-\u2199\u219C-\u219F\u21A1\u21A2\u21A4\u21A5\u21A7-\u21AD\u21AF-\u21CD\u21D0\u21D1\u21D3\u21D5-\u21F3\u2300-\u2307\u230C-\u231F\u2322-\u2328\u232B-\u237B\u237D-\u239A\u23B4-\u23DB\u23E2-\u2426\u2440-\u244A\u249C-\u24E9\u2500-\u25B6\u25B8-\u25C0\u25C2-\u25F7\u2600-\u266E\u2670-\u2767\u2794-\u27BF\u2800-\u28FF\u2B00-\u2B2F\u2B45\u2B46\u2B4D-\u2B73\u2B76-\u2B95\u2B98-\u2BC8\u2BCA-\u2BFE\u2CE5-\u2CEA\u2E80-\u2E99\u2E9B-\u2EF3\u2F00-\u2FD5\u2FF0-\u2FFB\u3004\u3012\u3013\u3020\u3036\u3037\u303E\u303F\u3190\u3191\u3196-\u319F\u31C0-\u31E3\u3200-\u321E\u322A-\u3247\u3250\u3260-\u327F\u328A-\u32B0\u32C0-\u32FE\u3300-\u33FF\u4DC0-\u4DFF\uA490-\uA4C6\uA828-\uA82B\uA836\uA837\uA839\uAA77-\uAA79\uFDFD\uFFE4\uFFE8\uFFED\uFFEE\uFFFC\uFFFD', + 'astral': '\uD800[\uDD37-\uDD3F\uDD79-\uDD89\uDD8C-\uDD8E\uDD90-\uDD9B\uDDA0\uDDD0-\uDDFC]|\uD802[\uDC77\uDC78\uDEC8]|\uD805\uDF3F|\uD81A[\uDF3C-\uDF3F\uDF45]|\uD82F\uDC9C|\uD834[\uDC00-\uDCF5\uDD00-\uDD26\uDD29-\uDD64\uDD6A-\uDD6C\uDD83\uDD84\uDD8C-\uDDA9\uDDAE-\uDDE8\uDE00-\uDE41\uDE45\uDF00-\uDF56]|\uD836[\uDC00-\uDDFF\uDE37-\uDE3A\uDE6D-\uDE74\uDE76-\uDE83\uDE85\uDE86]|\uD83B\uDCAC|\uD83C[\uDC00-\uDC2B\uDC30-\uDC93\uDCA0-\uDCAE\uDCB1-\uDCBF\uDCC1-\uDCCF\uDCD1-\uDCF5\uDD10-\uDD6B\uDD70-\uDDAC\uDDE6-\uDE02\uDE10-\uDE3B\uDE40-\uDE48\uDE50\uDE51\uDE60-\uDE65\uDF00-\uDFFA]|\uD83D[\uDC00-\uDED4\uDEE0-\uDEEC\uDEF0-\uDEF9\uDF00-\uDF73\uDF80-\uDFD8]|\uD83E[\uDC00-\uDC0B\uDC10-\uDC47\uDC50-\uDC59\uDC60-\uDC87\uDC90-\uDCAD\uDD00-\uDD0B\uDD10-\uDD3E\uDD40-\uDD70\uDD73-\uDD76\uDD7A\uDD7C-\uDDA2\uDDB0-\uDDB9\uDDC0-\uDDC2\uDDD0-\uDDFF\uDE60-\uDE6D]' + }, + { + 'name': 'Z', + 'alias': 'Separator', + 'bmp': ' \xA0\u1680\u2000-\u200A\u2028\u2029\u202F\u205F\u3000' + }, + { + 'name': 'Zl', + 'alias': 'Line_Separator', + 'bmp': '\u2028' + }, + { + 'name': 'Zp', + 'alias': 'Paragraph_Separator', + 'bmp': '\u2029' + }, + { + 'name': 'Zs', + 'alias': 'Space_Separator', + 'bmp': ' \xA0\u1680\u2000-\u200A\u202F\u205F\u3000' + } +]; + +var unicodeCategories = createCommonjsModule(function (module, exports) { +"use strict"; + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.default = void 0; + +var _categories = _interopRequireDefault(categories); + +function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } + +/*! + * XRegExp Unicode Categories 4.2.0 + * + * Steven Levithan (c) 2010-present MIT License + * Unicode data by Mathias Bynens + */ +var _default = function _default(XRegExp) { + /** + * Adds support for Unicode's general categories. E.g., `\p{Lu}` or `\p{Uppercase Letter}`. See + * category descriptions in UAX #44 . Token + * names are case insensitive, and any spaces, hyphens, and underscores are ignored. + * + * Uses Unicode 11.0.0. + * + * @requires XRegExp, Unicode Base + */ + if (!XRegExp.addUnicodeData) { + throw new ReferenceError('Unicode Base must be loaded before Unicode Categories'); + } + + XRegExp.addUnicodeData(_categories.default); +}; + +exports.default = _default; +module.exports = exports["default"]; +}); + +unwrapExports(unicodeCategories); + +var properties = [ + { + 'name': 'ASCII', + 'bmp': '\0-\x7F' + }, + { + 'name': 'Alphabetic', + 'bmp': 'A-Za-z\xAA\xB5\xBA\xC0-\xD6\xD8-\xF6\xF8-\u02C1\u02C6-\u02D1\u02E0-\u02E4\u02EC\u02EE\u0345\u0370-\u0374\u0376\u0377\u037A-\u037D\u037F\u0386\u0388-\u038A\u038C\u038E-\u03A1\u03A3-\u03F5\u03F7-\u0481\u048A-\u052F\u0531-\u0556\u0559\u0560-\u0588\u05B0-\u05BD\u05BF\u05C1\u05C2\u05C4\u05C5\u05C7\u05D0-\u05EA\u05EF-\u05F2\u0610-\u061A\u0620-\u0657\u0659-\u065F\u066E-\u06D3\u06D5-\u06DC\u06E1-\u06E8\u06ED-\u06EF\u06FA-\u06FC\u06FF\u0710-\u073F\u074D-\u07B1\u07CA-\u07EA\u07F4\u07F5\u07FA\u0800-\u0817\u081A-\u082C\u0840-\u0858\u0860-\u086A\u08A0-\u08B4\u08B6-\u08BD\u08D4-\u08DF\u08E3-\u08E9\u08F0-\u093B\u093D-\u094C\u094E-\u0950\u0955-\u0963\u0971-\u0983\u0985-\u098C\u098F\u0990\u0993-\u09A8\u09AA-\u09B0\u09B2\u09B6-\u09B9\u09BD-\u09C4\u09C7\u09C8\u09CB\u09CC\u09CE\u09D7\u09DC\u09DD\u09DF-\u09E3\u09F0\u09F1\u09FC\u0A01-\u0A03\u0A05-\u0A0A\u0A0F\u0A10\u0A13-\u0A28\u0A2A-\u0A30\u0A32\u0A33\u0A35\u0A36\u0A38\u0A39\u0A3E-\u0A42\u0A47\u0A48\u0A4B\u0A4C\u0A51\u0A59-\u0A5C\u0A5E\u0A70-\u0A75\u0A81-\u0A83\u0A85-\u0A8D\u0A8F-\u0A91\u0A93-\u0AA8\u0AAA-\u0AB0\u0AB2\u0AB3\u0AB5-\u0AB9\u0ABD-\u0AC5\u0AC7-\u0AC9\u0ACB\u0ACC\u0AD0\u0AE0-\u0AE3\u0AF9-\u0AFC\u0B01-\u0B03\u0B05-\u0B0C\u0B0F\u0B10\u0B13-\u0B28\u0B2A-\u0B30\u0B32\u0B33\u0B35-\u0B39\u0B3D-\u0B44\u0B47\u0B48\u0B4B\u0B4C\u0B56\u0B57\u0B5C\u0B5D\u0B5F-\u0B63\u0B71\u0B82\u0B83\u0B85-\u0B8A\u0B8E-\u0B90\u0B92-\u0B95\u0B99\u0B9A\u0B9C\u0B9E\u0B9F\u0BA3\u0BA4\u0BA8-\u0BAA\u0BAE-\u0BB9\u0BBE-\u0BC2\u0BC6-\u0BC8\u0BCA-\u0BCC\u0BD0\u0BD7\u0C00-\u0C03\u0C05-\u0C0C\u0C0E-\u0C10\u0C12-\u0C28\u0C2A-\u0C39\u0C3D-\u0C44\u0C46-\u0C48\u0C4A-\u0C4C\u0C55\u0C56\u0C58-\u0C5A\u0C60-\u0C63\u0C80-\u0C83\u0C85-\u0C8C\u0C8E-\u0C90\u0C92-\u0CA8\u0CAA-\u0CB3\u0CB5-\u0CB9\u0CBD-\u0CC4\u0CC6-\u0CC8\u0CCA-\u0CCC\u0CD5\u0CD6\u0CDE\u0CE0-\u0CE3\u0CF1\u0CF2\u0D00-\u0D03\u0D05-\u0D0C\u0D0E-\u0D10\u0D12-\u0D3A\u0D3D-\u0D44\u0D46-\u0D48\u0D4A-\u0D4C\u0D4E\u0D54-\u0D57\u0D5F-\u0D63\u0D7A-\u0D7F\u0D82\u0D83\u0D85-\u0D96\u0D9A-\u0DB1\u0DB3-\u0DBB\u0DBD\u0DC0-\u0DC6\u0DCF-\u0DD4\u0DD6\u0DD8-\u0DDF\u0DF2\u0DF3\u0E01-\u0E3A\u0E40-\u0E46\u0E4D\u0E81\u0E82\u0E84\u0E87\u0E88\u0E8A\u0E8D\u0E94-\u0E97\u0E99-\u0E9F\u0EA1-\u0EA3\u0EA5\u0EA7\u0EAA\u0EAB\u0EAD-\u0EB9\u0EBB-\u0EBD\u0EC0-\u0EC4\u0EC6\u0ECD\u0EDC-\u0EDF\u0F00\u0F40-\u0F47\u0F49-\u0F6C\u0F71-\u0F81\u0F88-\u0F97\u0F99-\u0FBC\u1000-\u1036\u1038\u103B-\u103F\u1050-\u1062\u1065-\u1068\u106E-\u1086\u108E\u109C\u109D\u10A0-\u10C5\u10C7\u10CD\u10D0-\u10FA\u10FC-\u1248\u124A-\u124D\u1250-\u1256\u1258\u125A-\u125D\u1260-\u1288\u128A-\u128D\u1290-\u12B0\u12B2-\u12B5\u12B8-\u12BE\u12C0\u12C2-\u12C5\u12C8-\u12D6\u12D8-\u1310\u1312-\u1315\u1318-\u135A\u135F\u1380-\u138F\u13A0-\u13F5\u13F8-\u13FD\u1401-\u166C\u166F-\u167F\u1681-\u169A\u16A0-\u16EA\u16EE-\u16F8\u1700-\u170C\u170E-\u1713\u1720-\u1733\u1740-\u1753\u1760-\u176C\u176E-\u1770\u1772\u1773\u1780-\u17B3\u17B6-\u17C8\u17D7\u17DC\u1820-\u1878\u1880-\u18AA\u18B0-\u18F5\u1900-\u191E\u1920-\u192B\u1930-\u1938\u1950-\u196D\u1970-\u1974\u1980-\u19AB\u19B0-\u19C9\u1A00-\u1A1B\u1A20-\u1A5E\u1A61-\u1A74\u1AA7\u1B00-\u1B33\u1B35-\u1B43\u1B45-\u1B4B\u1B80-\u1BA9\u1BAC-\u1BAF\u1BBA-\u1BE5\u1BE7-\u1BF1\u1C00-\u1C35\u1C4D-\u1C4F\u1C5A-\u1C7D\u1C80-\u1C88\u1C90-\u1CBA\u1CBD-\u1CBF\u1CE9-\u1CEC\u1CEE-\u1CF3\u1CF5\u1CF6\u1D00-\u1DBF\u1DE7-\u1DF4\u1E00-\u1F15\u1F18-\u1F1D\u1F20-\u1F45\u1F48-\u1F4D\u1F50-\u1F57\u1F59\u1F5B\u1F5D\u1F5F-\u1F7D\u1F80-\u1FB4\u1FB6-\u1FBC\u1FBE\u1FC2-\u1FC4\u1FC6-\u1FCC\u1FD0-\u1FD3\u1FD6-\u1FDB\u1FE0-\u1FEC\u1FF2-\u1FF4\u1FF6-\u1FFC\u2071\u207F\u2090-\u209C\u2102\u2107\u210A-\u2113\u2115\u2119-\u211D\u2124\u2126\u2128\u212A-\u212D\u212F-\u2139\u213C-\u213F\u2145-\u2149\u214E\u2160-\u2188\u24B6-\u24E9\u2C00-\u2C2E\u2C30-\u2C5E\u2C60-\u2CE4\u2CEB-\u2CEE\u2CF2\u2CF3\u2D00-\u2D25\u2D27\u2D2D\u2D30-\u2D67\u2D6F\u2D80-\u2D96\u2DA0-\u2DA6\u2DA8-\u2DAE\u2DB0-\u2DB6\u2DB8-\u2DBE\u2DC0-\u2DC6\u2DC8-\u2DCE\u2DD0-\u2DD6\u2DD8-\u2DDE\u2DE0-\u2DFF\u2E2F\u3005-\u3007\u3021-\u3029\u3031-\u3035\u3038-\u303C\u3041-\u3096\u309D-\u309F\u30A1-\u30FA\u30FC-\u30FF\u3105-\u312F\u3131-\u318E\u31A0-\u31BA\u31F0-\u31FF\u3400-\u4DB5\u4E00-\u9FEF\uA000-\uA48C\uA4D0-\uA4FD\uA500-\uA60C\uA610-\uA61F\uA62A\uA62B\uA640-\uA66E\uA674-\uA67B\uA67F-\uA6EF\uA717-\uA71F\uA722-\uA788\uA78B-\uA7B9\uA7F7-\uA801\uA803-\uA805\uA807-\uA80A\uA80C-\uA827\uA840-\uA873\uA880-\uA8C3\uA8C5\uA8F2-\uA8F7\uA8FB\uA8FD\uA8FE\uA90A-\uA92A\uA930-\uA952\uA960-\uA97C\uA980-\uA9B2\uA9B4-\uA9BF\uA9CF\uA9E0-\uA9E4\uA9E6-\uA9EF\uA9FA-\uA9FE\uAA00-\uAA36\uAA40-\uAA4D\uAA60-\uAA76\uAA7A\uAA7E-\uAABE\uAAC0\uAAC2\uAADB-\uAADD\uAAE0-\uAAEF\uAAF2-\uAAF5\uAB01-\uAB06\uAB09-\uAB0E\uAB11-\uAB16\uAB20-\uAB26\uAB28-\uAB2E\uAB30-\uAB5A\uAB5C-\uAB65\uAB70-\uABEA\uAC00-\uD7A3\uD7B0-\uD7C6\uD7CB-\uD7FB\uF900-\uFA6D\uFA70-\uFAD9\uFB00-\uFB06\uFB13-\uFB17\uFB1D-\uFB28\uFB2A-\uFB36\uFB38-\uFB3C\uFB3E\uFB40\uFB41\uFB43\uFB44\uFB46-\uFBB1\uFBD3-\uFD3D\uFD50-\uFD8F\uFD92-\uFDC7\uFDF0-\uFDFB\uFE70-\uFE74\uFE76-\uFEFC\uFF21-\uFF3A\uFF41-\uFF5A\uFF66-\uFFBE\uFFC2-\uFFC7\uFFCA-\uFFCF\uFFD2-\uFFD7\uFFDA-\uFFDC', + 'astral': '\uD800[\uDC00-\uDC0B\uDC0D-\uDC26\uDC28-\uDC3A\uDC3C\uDC3D\uDC3F-\uDC4D\uDC50-\uDC5D\uDC80-\uDCFA\uDD40-\uDD74\uDE80-\uDE9C\uDEA0-\uDED0\uDF00-\uDF1F\uDF2D-\uDF4A\uDF50-\uDF7A\uDF80-\uDF9D\uDFA0-\uDFC3\uDFC8-\uDFCF\uDFD1-\uDFD5]|\uD801[\uDC00-\uDC9D\uDCB0-\uDCD3\uDCD8-\uDCFB\uDD00-\uDD27\uDD30-\uDD63\uDE00-\uDF36\uDF40-\uDF55\uDF60-\uDF67]|\uD802[\uDC00-\uDC05\uDC08\uDC0A-\uDC35\uDC37\uDC38\uDC3C\uDC3F-\uDC55\uDC60-\uDC76\uDC80-\uDC9E\uDCE0-\uDCF2\uDCF4\uDCF5\uDD00-\uDD15\uDD20-\uDD39\uDD80-\uDDB7\uDDBE\uDDBF\uDE00-\uDE03\uDE05\uDE06\uDE0C-\uDE13\uDE15-\uDE17\uDE19-\uDE35\uDE60-\uDE7C\uDE80-\uDE9C\uDEC0-\uDEC7\uDEC9-\uDEE4\uDF00-\uDF35\uDF40-\uDF55\uDF60-\uDF72\uDF80-\uDF91]|\uD803[\uDC00-\uDC48\uDC80-\uDCB2\uDCC0-\uDCF2\uDD00-\uDD27\uDF00-\uDF1C\uDF27\uDF30-\uDF45]|\uD804[\uDC00-\uDC45\uDC82-\uDCB8\uDCD0-\uDCE8\uDD00-\uDD32\uDD44-\uDD46\uDD50-\uDD72\uDD76\uDD80-\uDDBF\uDDC1-\uDDC4\uDDDA\uDDDC\uDE00-\uDE11\uDE13-\uDE34\uDE37\uDE3E\uDE80-\uDE86\uDE88\uDE8A-\uDE8D\uDE8F-\uDE9D\uDE9F-\uDEA8\uDEB0-\uDEE8\uDF00-\uDF03\uDF05-\uDF0C\uDF0F\uDF10\uDF13-\uDF28\uDF2A-\uDF30\uDF32\uDF33\uDF35-\uDF39\uDF3D-\uDF44\uDF47\uDF48\uDF4B\uDF4C\uDF50\uDF57\uDF5D-\uDF63]|\uD805[\uDC00-\uDC41\uDC43-\uDC45\uDC47-\uDC4A\uDC80-\uDCC1\uDCC4\uDCC5\uDCC7\uDD80-\uDDB5\uDDB8-\uDDBE\uDDD8-\uDDDD\uDE00-\uDE3E\uDE40\uDE44\uDE80-\uDEB5\uDF00-\uDF1A\uDF1D-\uDF2A]|\uD806[\uDC00-\uDC38\uDCA0-\uDCDF\uDCFF\uDE00-\uDE32\uDE35-\uDE3E\uDE50-\uDE83\uDE86-\uDE97\uDE9D\uDEC0-\uDEF8]|\uD807[\uDC00-\uDC08\uDC0A-\uDC36\uDC38-\uDC3E\uDC40\uDC72-\uDC8F\uDC92-\uDCA7\uDCA9-\uDCB6\uDD00-\uDD06\uDD08\uDD09\uDD0B-\uDD36\uDD3A\uDD3C\uDD3D\uDD3F-\uDD41\uDD43\uDD46\uDD47\uDD60-\uDD65\uDD67\uDD68\uDD6A-\uDD8E\uDD90\uDD91\uDD93-\uDD96\uDD98\uDEE0-\uDEF6]|\uD808[\uDC00-\uDF99]|\uD809[\uDC00-\uDC6E\uDC80-\uDD43]|[\uD80C\uD81C-\uD820\uD840-\uD868\uD86A-\uD86C\uD86F-\uD872\uD874-\uD879][\uDC00-\uDFFF]|\uD80D[\uDC00-\uDC2E]|\uD811[\uDC00-\uDE46]|\uD81A[\uDC00-\uDE38\uDE40-\uDE5E\uDED0-\uDEED\uDF00-\uDF36\uDF40-\uDF43\uDF63-\uDF77\uDF7D-\uDF8F]|\uD81B[\uDE40-\uDE7F\uDF00-\uDF44\uDF50-\uDF7E\uDF93-\uDF9F\uDFE0\uDFE1]|\uD821[\uDC00-\uDFF1]|\uD822[\uDC00-\uDEF2]|\uD82C[\uDC00-\uDD1E\uDD70-\uDEFB]|\uD82F[\uDC00-\uDC6A\uDC70-\uDC7C\uDC80-\uDC88\uDC90-\uDC99\uDC9E]|\uD835[\uDC00-\uDC54\uDC56-\uDC9C\uDC9E\uDC9F\uDCA2\uDCA5\uDCA6\uDCA9-\uDCAC\uDCAE-\uDCB9\uDCBB\uDCBD-\uDCC3\uDCC5-\uDD05\uDD07-\uDD0A\uDD0D-\uDD14\uDD16-\uDD1C\uDD1E-\uDD39\uDD3B-\uDD3E\uDD40-\uDD44\uDD46\uDD4A-\uDD50\uDD52-\uDEA5\uDEA8-\uDEC0\uDEC2-\uDEDA\uDEDC-\uDEFA\uDEFC-\uDF14\uDF16-\uDF34\uDF36-\uDF4E\uDF50-\uDF6E\uDF70-\uDF88\uDF8A-\uDFA8\uDFAA-\uDFC2\uDFC4-\uDFCB]|\uD838[\uDC00-\uDC06\uDC08-\uDC18\uDC1B-\uDC21\uDC23\uDC24\uDC26-\uDC2A]|\uD83A[\uDC00-\uDCC4\uDD00-\uDD43\uDD47]|\uD83B[\uDE00-\uDE03\uDE05-\uDE1F\uDE21\uDE22\uDE24\uDE27\uDE29-\uDE32\uDE34-\uDE37\uDE39\uDE3B\uDE42\uDE47\uDE49\uDE4B\uDE4D-\uDE4F\uDE51\uDE52\uDE54\uDE57\uDE59\uDE5B\uDE5D\uDE5F\uDE61\uDE62\uDE64\uDE67-\uDE6A\uDE6C-\uDE72\uDE74-\uDE77\uDE79-\uDE7C\uDE7E\uDE80-\uDE89\uDE8B-\uDE9B\uDEA1-\uDEA3\uDEA5-\uDEA9\uDEAB-\uDEBB]|\uD83C[\uDD30-\uDD49\uDD50-\uDD69\uDD70-\uDD89]|\uD869[\uDC00-\uDED6\uDF00-\uDFFF]|\uD86D[\uDC00-\uDF34\uDF40-\uDFFF]|\uD86E[\uDC00-\uDC1D\uDC20-\uDFFF]|\uD873[\uDC00-\uDEA1\uDEB0-\uDFFF]|\uD87A[\uDC00-\uDFE0]|\uD87E[\uDC00-\uDE1D]' + }, + { + 'name': 'Any', + 'isBmpLast': true, + 'bmp': '\0-\uFFFF', + 'astral': '[\uD800-\uDBFF][\uDC00-\uDFFF]' + }, + { + 'name': 'Default_Ignorable_Code_Point', + 'bmp': '\xAD\u034F\u061C\u115F\u1160\u17B4\u17B5\u180B-\u180E\u200B-\u200F\u202A-\u202E\u2060-\u206F\u3164\uFE00-\uFE0F\uFEFF\uFFA0\uFFF0-\uFFF8', + 'astral': '\uD82F[\uDCA0-\uDCA3]|\uD834[\uDD73-\uDD7A]|[\uDB40-\uDB43][\uDC00-\uDFFF]' + }, + { + 'name': 'Lowercase', + 'bmp': 'a-z\xAA\xB5\xBA\xDF-\xF6\xF8-\xFF\u0101\u0103\u0105\u0107\u0109\u010B\u010D\u010F\u0111\u0113\u0115\u0117\u0119\u011B\u011D\u011F\u0121\u0123\u0125\u0127\u0129\u012B\u012D\u012F\u0131\u0133\u0135\u0137\u0138\u013A\u013C\u013E\u0140\u0142\u0144\u0146\u0148\u0149\u014B\u014D\u014F\u0151\u0153\u0155\u0157\u0159\u015B\u015D\u015F\u0161\u0163\u0165\u0167\u0169\u016B\u016D\u016F\u0171\u0173\u0175\u0177\u017A\u017C\u017E-\u0180\u0183\u0185\u0188\u018C\u018D\u0192\u0195\u0199-\u019B\u019E\u01A1\u01A3\u01A5\u01A8\u01AA\u01AB\u01AD\u01B0\u01B4\u01B6\u01B9\u01BA\u01BD-\u01BF\u01C6\u01C9\u01CC\u01CE\u01D0\u01D2\u01D4\u01D6\u01D8\u01DA\u01DC\u01DD\u01DF\u01E1\u01E3\u01E5\u01E7\u01E9\u01EB\u01ED\u01EF\u01F0\u01F3\u01F5\u01F9\u01FB\u01FD\u01FF\u0201\u0203\u0205\u0207\u0209\u020B\u020D\u020F\u0211\u0213\u0215\u0217\u0219\u021B\u021D\u021F\u0221\u0223\u0225\u0227\u0229\u022B\u022D\u022F\u0231\u0233-\u0239\u023C\u023F\u0240\u0242\u0247\u0249\u024B\u024D\u024F-\u0293\u0295-\u02B8\u02C0\u02C1\u02E0-\u02E4\u0345\u0371\u0373\u0377\u037A-\u037D\u0390\u03AC-\u03CE\u03D0\u03D1\u03D5-\u03D7\u03D9\u03DB\u03DD\u03DF\u03E1\u03E3\u03E5\u03E7\u03E9\u03EB\u03ED\u03EF-\u03F3\u03F5\u03F8\u03FB\u03FC\u0430-\u045F\u0461\u0463\u0465\u0467\u0469\u046B\u046D\u046F\u0471\u0473\u0475\u0477\u0479\u047B\u047D\u047F\u0481\u048B\u048D\u048F\u0491\u0493\u0495\u0497\u0499\u049B\u049D\u049F\u04A1\u04A3\u04A5\u04A7\u04A9\u04AB\u04AD\u04AF\u04B1\u04B3\u04B5\u04B7\u04B9\u04BB\u04BD\u04BF\u04C2\u04C4\u04C6\u04C8\u04CA\u04CC\u04CE\u04CF\u04D1\u04D3\u04D5\u04D7\u04D9\u04DB\u04DD\u04DF\u04E1\u04E3\u04E5\u04E7\u04E9\u04EB\u04ED\u04EF\u04F1\u04F3\u04F5\u04F7\u04F9\u04FB\u04FD\u04FF\u0501\u0503\u0505\u0507\u0509\u050B\u050D\u050F\u0511\u0513\u0515\u0517\u0519\u051B\u051D\u051F\u0521\u0523\u0525\u0527\u0529\u052B\u052D\u052F\u0560-\u0588\u10D0-\u10FA\u10FD-\u10FF\u13F8-\u13FD\u1C80-\u1C88\u1D00-\u1DBF\u1E01\u1E03\u1E05\u1E07\u1E09\u1E0B\u1E0D\u1E0F\u1E11\u1E13\u1E15\u1E17\u1E19\u1E1B\u1E1D\u1E1F\u1E21\u1E23\u1E25\u1E27\u1E29\u1E2B\u1E2D\u1E2F\u1E31\u1E33\u1E35\u1E37\u1E39\u1E3B\u1E3D\u1E3F\u1E41\u1E43\u1E45\u1E47\u1E49\u1E4B\u1E4D\u1E4F\u1E51\u1E53\u1E55\u1E57\u1E59\u1E5B\u1E5D\u1E5F\u1E61\u1E63\u1E65\u1E67\u1E69\u1E6B\u1E6D\u1E6F\u1E71\u1E73\u1E75\u1E77\u1E79\u1E7B\u1E7D\u1E7F\u1E81\u1E83\u1E85\u1E87\u1E89\u1E8B\u1E8D\u1E8F\u1E91\u1E93\u1E95-\u1E9D\u1E9F\u1EA1\u1EA3\u1EA5\u1EA7\u1EA9\u1EAB\u1EAD\u1EAF\u1EB1\u1EB3\u1EB5\u1EB7\u1EB9\u1EBB\u1EBD\u1EBF\u1EC1\u1EC3\u1EC5\u1EC7\u1EC9\u1ECB\u1ECD\u1ECF\u1ED1\u1ED3\u1ED5\u1ED7\u1ED9\u1EDB\u1EDD\u1EDF\u1EE1\u1EE3\u1EE5\u1EE7\u1EE9\u1EEB\u1EED\u1EEF\u1EF1\u1EF3\u1EF5\u1EF7\u1EF9\u1EFB\u1EFD\u1EFF-\u1F07\u1F10-\u1F15\u1F20-\u1F27\u1F30-\u1F37\u1F40-\u1F45\u1F50-\u1F57\u1F60-\u1F67\u1F70-\u1F7D\u1F80-\u1F87\u1F90-\u1F97\u1FA0-\u1FA7\u1FB0-\u1FB4\u1FB6\u1FB7\u1FBE\u1FC2-\u1FC4\u1FC6\u1FC7\u1FD0-\u1FD3\u1FD6\u1FD7\u1FE0-\u1FE7\u1FF2-\u1FF4\u1FF6\u1FF7\u2071\u207F\u2090-\u209C\u210A\u210E\u210F\u2113\u212F\u2134\u2139\u213C\u213D\u2146-\u2149\u214E\u2170-\u217F\u2184\u24D0-\u24E9\u2C30-\u2C5E\u2C61\u2C65\u2C66\u2C68\u2C6A\u2C6C\u2C71\u2C73\u2C74\u2C76-\u2C7D\u2C81\u2C83\u2C85\u2C87\u2C89\u2C8B\u2C8D\u2C8F\u2C91\u2C93\u2C95\u2C97\u2C99\u2C9B\u2C9D\u2C9F\u2CA1\u2CA3\u2CA5\u2CA7\u2CA9\u2CAB\u2CAD\u2CAF\u2CB1\u2CB3\u2CB5\u2CB7\u2CB9\u2CBB\u2CBD\u2CBF\u2CC1\u2CC3\u2CC5\u2CC7\u2CC9\u2CCB\u2CCD\u2CCF\u2CD1\u2CD3\u2CD5\u2CD7\u2CD9\u2CDB\u2CDD\u2CDF\u2CE1\u2CE3\u2CE4\u2CEC\u2CEE\u2CF3\u2D00-\u2D25\u2D27\u2D2D\uA641\uA643\uA645\uA647\uA649\uA64B\uA64D\uA64F\uA651\uA653\uA655\uA657\uA659\uA65B\uA65D\uA65F\uA661\uA663\uA665\uA667\uA669\uA66B\uA66D\uA681\uA683\uA685\uA687\uA689\uA68B\uA68D\uA68F\uA691\uA693\uA695\uA697\uA699\uA69B-\uA69D\uA723\uA725\uA727\uA729\uA72B\uA72D\uA72F-\uA731\uA733\uA735\uA737\uA739\uA73B\uA73D\uA73F\uA741\uA743\uA745\uA747\uA749\uA74B\uA74D\uA74F\uA751\uA753\uA755\uA757\uA759\uA75B\uA75D\uA75F\uA761\uA763\uA765\uA767\uA769\uA76B\uA76D\uA76F-\uA778\uA77A\uA77C\uA77F\uA781\uA783\uA785\uA787\uA78C\uA78E\uA791\uA793-\uA795\uA797\uA799\uA79B\uA79D\uA79F\uA7A1\uA7A3\uA7A5\uA7A7\uA7A9\uA7AF\uA7B5\uA7B7\uA7B9\uA7F8-\uA7FA\uAB30-\uAB5A\uAB5C-\uAB65\uAB70-\uABBF\uFB00-\uFB06\uFB13-\uFB17\uFF41-\uFF5A', + 'astral': '\uD801[\uDC28-\uDC4F\uDCD8-\uDCFB]|\uD803[\uDCC0-\uDCF2]|\uD806[\uDCC0-\uDCDF]|\uD81B[\uDE60-\uDE7F]|\uD835[\uDC1A-\uDC33\uDC4E-\uDC54\uDC56-\uDC67\uDC82-\uDC9B\uDCB6-\uDCB9\uDCBB\uDCBD-\uDCC3\uDCC5-\uDCCF\uDCEA-\uDD03\uDD1E-\uDD37\uDD52-\uDD6B\uDD86-\uDD9F\uDDBA-\uDDD3\uDDEE-\uDE07\uDE22-\uDE3B\uDE56-\uDE6F\uDE8A-\uDEA5\uDEC2-\uDEDA\uDEDC-\uDEE1\uDEFC-\uDF14\uDF16-\uDF1B\uDF36-\uDF4E\uDF50-\uDF55\uDF70-\uDF88\uDF8A-\uDF8F\uDFAA-\uDFC2\uDFC4-\uDFC9\uDFCB]|\uD83A[\uDD22-\uDD43]' + }, + { + 'name': 'Noncharacter_Code_Point', + 'bmp': '\uFDD0-\uFDEF\uFFFE\uFFFF', + 'astral': '[\uD83F\uD87F\uD8BF\uD8FF\uD93F\uD97F\uD9BF\uD9FF\uDA3F\uDA7F\uDABF\uDAFF\uDB3F\uDB7F\uDBBF\uDBFF][\uDFFE\uDFFF]' + }, + { + 'name': 'Uppercase', + 'bmp': 'A-Z\xC0-\xD6\xD8-\xDE\u0100\u0102\u0104\u0106\u0108\u010A\u010C\u010E\u0110\u0112\u0114\u0116\u0118\u011A\u011C\u011E\u0120\u0122\u0124\u0126\u0128\u012A\u012C\u012E\u0130\u0132\u0134\u0136\u0139\u013B\u013D\u013F\u0141\u0143\u0145\u0147\u014A\u014C\u014E\u0150\u0152\u0154\u0156\u0158\u015A\u015C\u015E\u0160\u0162\u0164\u0166\u0168\u016A\u016C\u016E\u0170\u0172\u0174\u0176\u0178\u0179\u017B\u017D\u0181\u0182\u0184\u0186\u0187\u0189-\u018B\u018E-\u0191\u0193\u0194\u0196-\u0198\u019C\u019D\u019F\u01A0\u01A2\u01A4\u01A6\u01A7\u01A9\u01AC\u01AE\u01AF\u01B1-\u01B3\u01B5\u01B7\u01B8\u01BC\u01C4\u01C7\u01CA\u01CD\u01CF\u01D1\u01D3\u01D5\u01D7\u01D9\u01DB\u01DE\u01E0\u01E2\u01E4\u01E6\u01E8\u01EA\u01EC\u01EE\u01F1\u01F4\u01F6-\u01F8\u01FA\u01FC\u01FE\u0200\u0202\u0204\u0206\u0208\u020A\u020C\u020E\u0210\u0212\u0214\u0216\u0218\u021A\u021C\u021E\u0220\u0222\u0224\u0226\u0228\u022A\u022C\u022E\u0230\u0232\u023A\u023B\u023D\u023E\u0241\u0243-\u0246\u0248\u024A\u024C\u024E\u0370\u0372\u0376\u037F\u0386\u0388-\u038A\u038C\u038E\u038F\u0391-\u03A1\u03A3-\u03AB\u03CF\u03D2-\u03D4\u03D8\u03DA\u03DC\u03DE\u03E0\u03E2\u03E4\u03E6\u03E8\u03EA\u03EC\u03EE\u03F4\u03F7\u03F9\u03FA\u03FD-\u042F\u0460\u0462\u0464\u0466\u0468\u046A\u046C\u046E\u0470\u0472\u0474\u0476\u0478\u047A\u047C\u047E\u0480\u048A\u048C\u048E\u0490\u0492\u0494\u0496\u0498\u049A\u049C\u049E\u04A0\u04A2\u04A4\u04A6\u04A8\u04AA\u04AC\u04AE\u04B0\u04B2\u04B4\u04B6\u04B8\u04BA\u04BC\u04BE\u04C0\u04C1\u04C3\u04C5\u04C7\u04C9\u04CB\u04CD\u04D0\u04D2\u04D4\u04D6\u04D8\u04DA\u04DC\u04DE\u04E0\u04E2\u04E4\u04E6\u04E8\u04EA\u04EC\u04EE\u04F0\u04F2\u04F4\u04F6\u04F8\u04FA\u04FC\u04FE\u0500\u0502\u0504\u0506\u0508\u050A\u050C\u050E\u0510\u0512\u0514\u0516\u0518\u051A\u051C\u051E\u0520\u0522\u0524\u0526\u0528\u052A\u052C\u052E\u0531-\u0556\u10A0-\u10C5\u10C7\u10CD\u13A0-\u13F5\u1C90-\u1CBA\u1CBD-\u1CBF\u1E00\u1E02\u1E04\u1E06\u1E08\u1E0A\u1E0C\u1E0E\u1E10\u1E12\u1E14\u1E16\u1E18\u1E1A\u1E1C\u1E1E\u1E20\u1E22\u1E24\u1E26\u1E28\u1E2A\u1E2C\u1E2E\u1E30\u1E32\u1E34\u1E36\u1E38\u1E3A\u1E3C\u1E3E\u1E40\u1E42\u1E44\u1E46\u1E48\u1E4A\u1E4C\u1E4E\u1E50\u1E52\u1E54\u1E56\u1E58\u1E5A\u1E5C\u1E5E\u1E60\u1E62\u1E64\u1E66\u1E68\u1E6A\u1E6C\u1E6E\u1E70\u1E72\u1E74\u1E76\u1E78\u1E7A\u1E7C\u1E7E\u1E80\u1E82\u1E84\u1E86\u1E88\u1E8A\u1E8C\u1E8E\u1E90\u1E92\u1E94\u1E9E\u1EA0\u1EA2\u1EA4\u1EA6\u1EA8\u1EAA\u1EAC\u1EAE\u1EB0\u1EB2\u1EB4\u1EB6\u1EB8\u1EBA\u1EBC\u1EBE\u1EC0\u1EC2\u1EC4\u1EC6\u1EC8\u1ECA\u1ECC\u1ECE\u1ED0\u1ED2\u1ED4\u1ED6\u1ED8\u1EDA\u1EDC\u1EDE\u1EE0\u1EE2\u1EE4\u1EE6\u1EE8\u1EEA\u1EEC\u1EEE\u1EF0\u1EF2\u1EF4\u1EF6\u1EF8\u1EFA\u1EFC\u1EFE\u1F08-\u1F0F\u1F18-\u1F1D\u1F28-\u1F2F\u1F38-\u1F3F\u1F48-\u1F4D\u1F59\u1F5B\u1F5D\u1F5F\u1F68-\u1F6F\u1FB8-\u1FBB\u1FC8-\u1FCB\u1FD8-\u1FDB\u1FE8-\u1FEC\u1FF8-\u1FFB\u2102\u2107\u210B-\u210D\u2110-\u2112\u2115\u2119-\u211D\u2124\u2126\u2128\u212A-\u212D\u2130-\u2133\u213E\u213F\u2145\u2160-\u216F\u2183\u24B6-\u24CF\u2C00-\u2C2E\u2C60\u2C62-\u2C64\u2C67\u2C69\u2C6B\u2C6D-\u2C70\u2C72\u2C75\u2C7E-\u2C80\u2C82\u2C84\u2C86\u2C88\u2C8A\u2C8C\u2C8E\u2C90\u2C92\u2C94\u2C96\u2C98\u2C9A\u2C9C\u2C9E\u2CA0\u2CA2\u2CA4\u2CA6\u2CA8\u2CAA\u2CAC\u2CAE\u2CB0\u2CB2\u2CB4\u2CB6\u2CB8\u2CBA\u2CBC\u2CBE\u2CC0\u2CC2\u2CC4\u2CC6\u2CC8\u2CCA\u2CCC\u2CCE\u2CD0\u2CD2\u2CD4\u2CD6\u2CD8\u2CDA\u2CDC\u2CDE\u2CE0\u2CE2\u2CEB\u2CED\u2CF2\uA640\uA642\uA644\uA646\uA648\uA64A\uA64C\uA64E\uA650\uA652\uA654\uA656\uA658\uA65A\uA65C\uA65E\uA660\uA662\uA664\uA666\uA668\uA66A\uA66C\uA680\uA682\uA684\uA686\uA688\uA68A\uA68C\uA68E\uA690\uA692\uA694\uA696\uA698\uA69A\uA722\uA724\uA726\uA728\uA72A\uA72C\uA72E\uA732\uA734\uA736\uA738\uA73A\uA73C\uA73E\uA740\uA742\uA744\uA746\uA748\uA74A\uA74C\uA74E\uA750\uA752\uA754\uA756\uA758\uA75A\uA75C\uA75E\uA760\uA762\uA764\uA766\uA768\uA76A\uA76C\uA76E\uA779\uA77B\uA77D\uA77E\uA780\uA782\uA784\uA786\uA78B\uA78D\uA790\uA792\uA796\uA798\uA79A\uA79C\uA79E\uA7A0\uA7A2\uA7A4\uA7A6\uA7A8\uA7AA-\uA7AE\uA7B0-\uA7B4\uA7B6\uA7B8\uFF21-\uFF3A', + 'astral': '\uD801[\uDC00-\uDC27\uDCB0-\uDCD3]|\uD803[\uDC80-\uDCB2]|\uD806[\uDCA0-\uDCBF]|\uD81B[\uDE40-\uDE5F]|\uD835[\uDC00-\uDC19\uDC34-\uDC4D\uDC68-\uDC81\uDC9C\uDC9E\uDC9F\uDCA2\uDCA5\uDCA6\uDCA9-\uDCAC\uDCAE-\uDCB5\uDCD0-\uDCE9\uDD04\uDD05\uDD07-\uDD0A\uDD0D-\uDD14\uDD16-\uDD1C\uDD38\uDD39\uDD3B-\uDD3E\uDD40-\uDD44\uDD46\uDD4A-\uDD50\uDD6C-\uDD85\uDDA0-\uDDB9\uDDD4-\uDDED\uDE08-\uDE21\uDE3C-\uDE55\uDE70-\uDE89\uDEA8-\uDEC0\uDEE2-\uDEFA\uDF1C-\uDF34\uDF56-\uDF6E\uDF90-\uDFA8\uDFCA]|\uD83A[\uDD00-\uDD21]|\uD83C[\uDD30-\uDD49\uDD50-\uDD69\uDD70-\uDD89]' + }, + { + 'name': 'White_Space', + 'bmp': '\t-\r \x85\xA0\u1680\u2000-\u200A\u2028\u2029\u202F\u205F\u3000' + } +]; + +var unicodeProperties = createCommonjsModule(function (module, exports) { +"use strict"; + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.default = void 0; + +var _properties = _interopRequireDefault(properties); + +function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } + +/*! + * XRegExp Unicode Properties 4.2.0 + * + * Steven Levithan (c) 2012-present MIT License + * Unicode data by Mathias Bynens + */ +var _default = function _default(XRegExp) { + /** + * Adds properties to meet the UTS #18 Level 1 RL1.2 requirements for Unicode regex support. See + * . Following are definitions of these properties from + * UAX #44 : + * + * - Alphabetic + * Characters with the Alphabetic property. Generated from: Lowercase + Uppercase + Lt + Lm + + * Lo + Nl + Other_Alphabetic. + * + * - Default_Ignorable_Code_Point + * For programmatic determination of default ignorable code points. New characters that should + * be ignored in rendering (unless explicitly supported) will be assigned in these ranges, + * permitting programs to correctly handle the default rendering of such characters when not + * otherwise supported. + * + * - Lowercase + * Characters with the Lowercase property. Generated from: Ll + Other_Lowercase. + * + * - Noncharacter_Code_Point + * Code points permanently reserved for internal use. + * + * - Uppercase + * Characters with the Uppercase property. Generated from: Lu + Other_Uppercase. + * + * - White_Space + * Spaces, separator characters and other control characters which should be treated by + * programming languages as "white space" for the purpose of parsing elements. + * + * The properties ASCII, Any, and Assigned are also included but are not defined in UAX #44. UTS + * #18 RL1.2 additionally requires support for Unicode scripts and general categories. These are + * included in XRegExp's Unicode Categories and Unicode Scripts addons. + * + * Token names are case insensitive, and any spaces, hyphens, and underscores are ignored. + * + * Uses Unicode 11.0.0. + * + * @requires XRegExp, Unicode Base + */ + if (!XRegExp.addUnicodeData) { + throw new ReferenceError('Unicode Base must be loaded before Unicode Properties'); + } + + var unicodeData = _properties.default; // Add non-generated data + + unicodeData.push({ + name: 'Assigned', + // Since this is defined as the inverse of Unicode category Cn (Unassigned), the Unicode + // Categories addon is required to use this property + inverseOf: 'Cn' + }); + XRegExp.addUnicodeData(unicodeData); +}; + +exports.default = _default; +module.exports = exports["default"]; +}); + +unwrapExports(unicodeProperties); + +var scripts = [ + { + 'name': 'Adlam', + 'astral': '\uD83A[\uDD00-\uDD4A\uDD50-\uDD59\uDD5E\uDD5F]' + }, + { + 'name': 'Ahom', + 'astral': '\uD805[\uDF00-\uDF1A\uDF1D-\uDF2B\uDF30-\uDF3F]' + }, + { + 'name': 'Anatolian_Hieroglyphs', + 'astral': '\uD811[\uDC00-\uDE46]' + }, + { + 'name': 'Arabic', + 'bmp': '\u0600-\u0604\u0606-\u060B\u060D-\u061A\u061C\u061E\u0620-\u063F\u0641-\u064A\u0656-\u066F\u0671-\u06DC\u06DE-\u06FF\u0750-\u077F\u08A0-\u08B4\u08B6-\u08BD\u08D3-\u08E1\u08E3-\u08FF\uFB50-\uFBC1\uFBD3-\uFD3D\uFD50-\uFD8F\uFD92-\uFDC7\uFDF0-\uFDFD\uFE70-\uFE74\uFE76-\uFEFC', + 'astral': '\uD803[\uDE60-\uDE7E]|\uD83B[\uDE00-\uDE03\uDE05-\uDE1F\uDE21\uDE22\uDE24\uDE27\uDE29-\uDE32\uDE34-\uDE37\uDE39\uDE3B\uDE42\uDE47\uDE49\uDE4B\uDE4D-\uDE4F\uDE51\uDE52\uDE54\uDE57\uDE59\uDE5B\uDE5D\uDE5F\uDE61\uDE62\uDE64\uDE67-\uDE6A\uDE6C-\uDE72\uDE74-\uDE77\uDE79-\uDE7C\uDE7E\uDE80-\uDE89\uDE8B-\uDE9B\uDEA1-\uDEA3\uDEA5-\uDEA9\uDEAB-\uDEBB\uDEF0\uDEF1]' + }, + { + 'name': 'Armenian', + 'bmp': '\u0531-\u0556\u0559-\u0588\u058A\u058D-\u058F\uFB13-\uFB17' + }, + { + 'name': 'Avestan', + 'astral': '\uD802[\uDF00-\uDF35\uDF39-\uDF3F]' + }, + { + 'name': 'Balinese', + 'bmp': '\u1B00-\u1B4B\u1B50-\u1B7C' + }, + { + 'name': 'Bamum', + 'bmp': '\uA6A0-\uA6F7', + 'astral': '\uD81A[\uDC00-\uDE38]' + }, + { + 'name': 'Bassa_Vah', + 'astral': '\uD81A[\uDED0-\uDEED\uDEF0-\uDEF5]' + }, + { + 'name': 'Batak', + 'bmp': '\u1BC0-\u1BF3\u1BFC-\u1BFF' + }, + { + 'name': 'Bengali', + 'bmp': '\u0980-\u0983\u0985-\u098C\u098F\u0990\u0993-\u09A8\u09AA-\u09B0\u09B2\u09B6-\u09B9\u09BC-\u09C4\u09C7\u09C8\u09CB-\u09CE\u09D7\u09DC\u09DD\u09DF-\u09E3\u09E6-\u09FE' + }, + { + 'name': 'Bhaiksuki', + 'astral': '\uD807[\uDC00-\uDC08\uDC0A-\uDC36\uDC38-\uDC45\uDC50-\uDC6C]' + }, + { + 'name': 'Bopomofo', + 'bmp': '\u02EA\u02EB\u3105-\u312F\u31A0-\u31BA' + }, + { + 'name': 'Brahmi', + 'astral': '\uD804[\uDC00-\uDC4D\uDC52-\uDC6F\uDC7F]' + }, + { + 'name': 'Braille', + 'bmp': '\u2800-\u28FF' + }, + { + 'name': 'Buginese', + 'bmp': '\u1A00-\u1A1B\u1A1E\u1A1F' + }, + { + 'name': 'Buhid', + 'bmp': '\u1740-\u1753' + }, + { + 'name': 'Canadian_Aboriginal', + 'bmp': '\u1400-\u167F\u18B0-\u18F5' + }, + { + 'name': 'Carian', + 'astral': '\uD800[\uDEA0-\uDED0]' + }, + { + 'name': 'Caucasian_Albanian', + 'astral': '\uD801[\uDD30-\uDD63\uDD6F]' + }, + { + 'name': 'Chakma', + 'astral': '\uD804[\uDD00-\uDD34\uDD36-\uDD46]' + }, + { + 'name': 'Cham', + 'bmp': '\uAA00-\uAA36\uAA40-\uAA4D\uAA50-\uAA59\uAA5C-\uAA5F' + }, + { + 'name': 'Cherokee', + 'bmp': '\u13A0-\u13F5\u13F8-\u13FD\uAB70-\uABBF' + }, + { + 'name': 'Common', + 'bmp': '\0-@\\[-`\\{-\xA9\xAB-\xB9\xBB-\xBF\xD7\xF7\u02B9-\u02DF\u02E5-\u02E9\u02EC-\u02FF\u0374\u037E\u0385\u0387\u0589\u0605\u060C\u061B\u061F\u0640\u06DD\u08E2\u0964\u0965\u0E3F\u0FD5-\u0FD8\u10FB\u16EB-\u16ED\u1735\u1736\u1802\u1803\u1805\u1CD3\u1CE1\u1CE9-\u1CEC\u1CEE-\u1CF3\u1CF5-\u1CF7\u2000-\u200B\u200E-\u2064\u2066-\u2070\u2074-\u207E\u2080-\u208E\u20A0-\u20BF\u2100-\u2125\u2127-\u2129\u212C-\u2131\u2133-\u214D\u214F-\u215F\u2189-\u218B\u2190-\u2426\u2440-\u244A\u2460-\u27FF\u2900-\u2B73\u2B76-\u2B95\u2B98-\u2BC8\u2BCA-\u2BFE\u2E00-\u2E4E\u2FF0-\u2FFB\u3000-\u3004\u3006\u3008-\u3020\u3030-\u3037\u303C-\u303F\u309B\u309C\u30A0\u30FB\u30FC\u3190-\u319F\u31C0-\u31E3\u3220-\u325F\u327F-\u32CF\u3358-\u33FF\u4DC0-\u4DFF\uA700-\uA721\uA788-\uA78A\uA830-\uA839\uA92E\uA9CF\uAB5B\uFD3E\uFD3F\uFE10-\uFE19\uFE30-\uFE52\uFE54-\uFE66\uFE68-\uFE6B\uFEFF\uFF01-\uFF20\uFF3B-\uFF40\uFF5B-\uFF65\uFF70\uFF9E\uFF9F\uFFE0-\uFFE6\uFFE8-\uFFEE\uFFF9-\uFFFD', + 'astral': '\uD800[\uDD00-\uDD02\uDD07-\uDD33\uDD37-\uDD3F\uDD90-\uDD9B\uDDD0-\uDDFC\uDEE1-\uDEFB]|\uD82F[\uDCA0-\uDCA3]|\uD834[\uDC00-\uDCF5\uDD00-\uDD26\uDD29-\uDD66\uDD6A-\uDD7A\uDD83\uDD84\uDD8C-\uDDA9\uDDAE-\uDDE8\uDEE0-\uDEF3\uDF00-\uDF56\uDF60-\uDF78]|\uD835[\uDC00-\uDC54\uDC56-\uDC9C\uDC9E\uDC9F\uDCA2\uDCA5\uDCA6\uDCA9-\uDCAC\uDCAE-\uDCB9\uDCBB\uDCBD-\uDCC3\uDCC5-\uDD05\uDD07-\uDD0A\uDD0D-\uDD14\uDD16-\uDD1C\uDD1E-\uDD39\uDD3B-\uDD3E\uDD40-\uDD44\uDD46\uDD4A-\uDD50\uDD52-\uDEA5\uDEA8-\uDFCB\uDFCE-\uDFFF]|\uD83B[\uDC71-\uDCB4]|\uD83C[\uDC00-\uDC2B\uDC30-\uDC93\uDCA0-\uDCAE\uDCB1-\uDCBF\uDCC1-\uDCCF\uDCD1-\uDCF5\uDD00-\uDD0C\uDD10-\uDD6B\uDD70-\uDDAC\uDDE6-\uDDFF\uDE01\uDE02\uDE10-\uDE3B\uDE40-\uDE48\uDE50\uDE51\uDE60-\uDE65\uDF00-\uDFFF]|\uD83D[\uDC00-\uDED4\uDEE0-\uDEEC\uDEF0-\uDEF9\uDF00-\uDF73\uDF80-\uDFD8]|\uD83E[\uDC00-\uDC0B\uDC10-\uDC47\uDC50-\uDC59\uDC60-\uDC87\uDC90-\uDCAD\uDD00-\uDD0B\uDD10-\uDD3E\uDD40-\uDD70\uDD73-\uDD76\uDD7A\uDD7C-\uDDA2\uDDB0-\uDDB9\uDDC0-\uDDC2\uDDD0-\uDDFF\uDE60-\uDE6D]|\uDB40[\uDC01\uDC20-\uDC7F]' + }, + { + 'name': 'Coptic', + 'bmp': '\u03E2-\u03EF\u2C80-\u2CF3\u2CF9-\u2CFF' + }, + { + 'name': 'Cuneiform', + 'astral': '\uD808[\uDC00-\uDF99]|\uD809[\uDC00-\uDC6E\uDC70-\uDC74\uDC80-\uDD43]' + }, + { + 'name': 'Cypriot', + 'astral': '\uD802[\uDC00-\uDC05\uDC08\uDC0A-\uDC35\uDC37\uDC38\uDC3C\uDC3F]' + }, + { + 'name': 'Cyrillic', + 'bmp': '\u0400-\u0484\u0487-\u052F\u1C80-\u1C88\u1D2B\u1D78\u2DE0-\u2DFF\uA640-\uA69F\uFE2E\uFE2F' + }, + { + 'name': 'Deseret', + 'astral': '\uD801[\uDC00-\uDC4F]' + }, + { + 'name': 'Devanagari', + 'bmp': '\u0900-\u0950\u0953-\u0963\u0966-\u097F\uA8E0-\uA8FF' + }, + { + 'name': 'Dogra', + 'astral': '\uD806[\uDC00-\uDC3B]' + }, + { + 'name': 'Duployan', + 'astral': '\uD82F[\uDC00-\uDC6A\uDC70-\uDC7C\uDC80-\uDC88\uDC90-\uDC99\uDC9C-\uDC9F]' + }, + { + 'name': 'Egyptian_Hieroglyphs', + 'astral': '\uD80C[\uDC00-\uDFFF]|\uD80D[\uDC00-\uDC2E]' + }, + { + 'name': 'Elbasan', + 'astral': '\uD801[\uDD00-\uDD27]' + }, + { + 'name': 'Ethiopic', + 'bmp': '\u1200-\u1248\u124A-\u124D\u1250-\u1256\u1258\u125A-\u125D\u1260-\u1288\u128A-\u128D\u1290-\u12B0\u12B2-\u12B5\u12B8-\u12BE\u12C0\u12C2-\u12C5\u12C8-\u12D6\u12D8-\u1310\u1312-\u1315\u1318-\u135A\u135D-\u137C\u1380-\u1399\u2D80-\u2D96\u2DA0-\u2DA6\u2DA8-\u2DAE\u2DB0-\u2DB6\u2DB8-\u2DBE\u2DC0-\u2DC6\u2DC8-\u2DCE\u2DD0-\u2DD6\u2DD8-\u2DDE\uAB01-\uAB06\uAB09-\uAB0E\uAB11-\uAB16\uAB20-\uAB26\uAB28-\uAB2E' + }, + { + 'name': 'Georgian', + 'bmp': '\u10A0-\u10C5\u10C7\u10CD\u10D0-\u10FA\u10FC-\u10FF\u1C90-\u1CBA\u1CBD-\u1CBF\u2D00-\u2D25\u2D27\u2D2D' + }, + { + 'name': 'Glagolitic', + 'bmp': '\u2C00-\u2C2E\u2C30-\u2C5E', + 'astral': '\uD838[\uDC00-\uDC06\uDC08-\uDC18\uDC1B-\uDC21\uDC23\uDC24\uDC26-\uDC2A]' + }, + { + 'name': 'Gothic', + 'astral': '\uD800[\uDF30-\uDF4A]' + }, + { + 'name': 'Grantha', + 'astral': '\uD804[\uDF00-\uDF03\uDF05-\uDF0C\uDF0F\uDF10\uDF13-\uDF28\uDF2A-\uDF30\uDF32\uDF33\uDF35-\uDF39\uDF3C-\uDF44\uDF47\uDF48\uDF4B-\uDF4D\uDF50\uDF57\uDF5D-\uDF63\uDF66-\uDF6C\uDF70-\uDF74]' + }, + { + 'name': 'Greek', + 'bmp': '\u0370-\u0373\u0375-\u0377\u037A-\u037D\u037F\u0384\u0386\u0388-\u038A\u038C\u038E-\u03A1\u03A3-\u03E1\u03F0-\u03FF\u1D26-\u1D2A\u1D5D-\u1D61\u1D66-\u1D6A\u1DBF\u1F00-\u1F15\u1F18-\u1F1D\u1F20-\u1F45\u1F48-\u1F4D\u1F50-\u1F57\u1F59\u1F5B\u1F5D\u1F5F-\u1F7D\u1F80-\u1FB4\u1FB6-\u1FC4\u1FC6-\u1FD3\u1FD6-\u1FDB\u1FDD-\u1FEF\u1FF2-\u1FF4\u1FF6-\u1FFE\u2126\uAB65', + 'astral': '\uD800[\uDD40-\uDD8E\uDDA0]|\uD834[\uDE00-\uDE45]' + }, + { + 'name': 'Gujarati', + 'bmp': '\u0A81-\u0A83\u0A85-\u0A8D\u0A8F-\u0A91\u0A93-\u0AA8\u0AAA-\u0AB0\u0AB2\u0AB3\u0AB5-\u0AB9\u0ABC-\u0AC5\u0AC7-\u0AC9\u0ACB-\u0ACD\u0AD0\u0AE0-\u0AE3\u0AE6-\u0AF1\u0AF9-\u0AFF' + }, + { + 'name': 'Gunjala_Gondi', + 'astral': '\uD807[\uDD60-\uDD65\uDD67\uDD68\uDD6A-\uDD8E\uDD90\uDD91\uDD93-\uDD98\uDDA0-\uDDA9]' + }, + { + 'name': 'Gurmukhi', + 'bmp': '\u0A01-\u0A03\u0A05-\u0A0A\u0A0F\u0A10\u0A13-\u0A28\u0A2A-\u0A30\u0A32\u0A33\u0A35\u0A36\u0A38\u0A39\u0A3C\u0A3E-\u0A42\u0A47\u0A48\u0A4B-\u0A4D\u0A51\u0A59-\u0A5C\u0A5E\u0A66-\u0A76' + }, + { + 'name': 'Han', + 'bmp': '\u2E80-\u2E99\u2E9B-\u2EF3\u2F00-\u2FD5\u3005\u3007\u3021-\u3029\u3038-\u303B\u3400-\u4DB5\u4E00-\u9FEF\uF900-\uFA6D\uFA70-\uFAD9', + 'astral': '[\uD840-\uD868\uD86A-\uD86C\uD86F-\uD872\uD874-\uD879][\uDC00-\uDFFF]|\uD869[\uDC00-\uDED6\uDF00-\uDFFF]|\uD86D[\uDC00-\uDF34\uDF40-\uDFFF]|\uD86E[\uDC00-\uDC1D\uDC20-\uDFFF]|\uD873[\uDC00-\uDEA1\uDEB0-\uDFFF]|\uD87A[\uDC00-\uDFE0]|\uD87E[\uDC00-\uDE1D]' + }, + { + 'name': 'Hangul', + 'bmp': '\u1100-\u11FF\u302E\u302F\u3131-\u318E\u3200-\u321E\u3260-\u327E\uA960-\uA97C\uAC00-\uD7A3\uD7B0-\uD7C6\uD7CB-\uD7FB\uFFA0-\uFFBE\uFFC2-\uFFC7\uFFCA-\uFFCF\uFFD2-\uFFD7\uFFDA-\uFFDC' + }, + { + 'name': 'Hanifi_Rohingya', + 'astral': '\uD803[\uDD00-\uDD27\uDD30-\uDD39]' + }, + { + 'name': 'Hanunoo', + 'bmp': '\u1720-\u1734' + }, + { + 'name': 'Hatran', + 'astral': '\uD802[\uDCE0-\uDCF2\uDCF4\uDCF5\uDCFB-\uDCFF]' + }, + { + 'name': 'Hebrew', + 'bmp': '\u0591-\u05C7\u05D0-\u05EA\u05EF-\u05F4\uFB1D-\uFB36\uFB38-\uFB3C\uFB3E\uFB40\uFB41\uFB43\uFB44\uFB46-\uFB4F' + }, + { + 'name': 'Hiragana', + 'bmp': '\u3041-\u3096\u309D-\u309F', + 'astral': '\uD82C[\uDC01-\uDD1E]|\uD83C\uDE00' + }, + { + 'name': 'Imperial_Aramaic', + 'astral': '\uD802[\uDC40-\uDC55\uDC57-\uDC5F]' + }, + { + 'name': 'Inherited', + 'bmp': '\u0300-\u036F\u0485\u0486\u064B-\u0655\u0670\u0951\u0952\u1AB0-\u1ABE\u1CD0-\u1CD2\u1CD4-\u1CE0\u1CE2-\u1CE8\u1CED\u1CF4\u1CF8\u1CF9\u1DC0-\u1DF9\u1DFB-\u1DFF\u200C\u200D\u20D0-\u20F0\u302A-\u302D\u3099\u309A\uFE00-\uFE0F\uFE20-\uFE2D', + 'astral': '\uD800[\uDDFD\uDEE0]|\uD804\uDF3B|\uD834[\uDD67-\uDD69\uDD7B-\uDD82\uDD85-\uDD8B\uDDAA-\uDDAD]|\uDB40[\uDD00-\uDDEF]' + }, + { + 'name': 'Inscriptional_Pahlavi', + 'astral': '\uD802[\uDF60-\uDF72\uDF78-\uDF7F]' + }, + { + 'name': 'Inscriptional_Parthian', + 'astral': '\uD802[\uDF40-\uDF55\uDF58-\uDF5F]' + }, + { + 'name': 'Javanese', + 'bmp': '\uA980-\uA9CD\uA9D0-\uA9D9\uA9DE\uA9DF' + }, + { + 'name': 'Kaithi', + 'astral': '\uD804[\uDC80-\uDCC1\uDCCD]' + }, + { + 'name': 'Kannada', + 'bmp': '\u0C80-\u0C8C\u0C8E-\u0C90\u0C92-\u0CA8\u0CAA-\u0CB3\u0CB5-\u0CB9\u0CBC-\u0CC4\u0CC6-\u0CC8\u0CCA-\u0CCD\u0CD5\u0CD6\u0CDE\u0CE0-\u0CE3\u0CE6-\u0CEF\u0CF1\u0CF2' + }, + { + 'name': 'Katakana', + 'bmp': '\u30A1-\u30FA\u30FD-\u30FF\u31F0-\u31FF\u32D0-\u32FE\u3300-\u3357\uFF66-\uFF6F\uFF71-\uFF9D', + 'astral': '\uD82C\uDC00' + }, + { + 'name': 'Kayah_Li', + 'bmp': '\uA900-\uA92D\uA92F' + }, + { + 'name': 'Kharoshthi', + 'astral': '\uD802[\uDE00-\uDE03\uDE05\uDE06\uDE0C-\uDE13\uDE15-\uDE17\uDE19-\uDE35\uDE38-\uDE3A\uDE3F-\uDE48\uDE50-\uDE58]' + }, + { + 'name': 'Khmer', + 'bmp': '\u1780-\u17DD\u17E0-\u17E9\u17F0-\u17F9\u19E0-\u19FF' + }, + { + 'name': 'Khojki', + 'astral': '\uD804[\uDE00-\uDE11\uDE13-\uDE3E]' + }, + { + 'name': 'Khudawadi', + 'astral': '\uD804[\uDEB0-\uDEEA\uDEF0-\uDEF9]' + }, + { + 'name': 'Lao', + 'bmp': '\u0E81\u0E82\u0E84\u0E87\u0E88\u0E8A\u0E8D\u0E94-\u0E97\u0E99-\u0E9F\u0EA1-\u0EA3\u0EA5\u0EA7\u0EAA\u0EAB\u0EAD-\u0EB9\u0EBB-\u0EBD\u0EC0-\u0EC4\u0EC6\u0EC8-\u0ECD\u0ED0-\u0ED9\u0EDC-\u0EDF' + }, + { + 'name': 'Latin', + 'bmp': 'A-Za-z\xAA\xBA\xC0-\xD6\xD8-\xF6\xF8-\u02B8\u02E0-\u02E4\u1D00-\u1D25\u1D2C-\u1D5C\u1D62-\u1D65\u1D6B-\u1D77\u1D79-\u1DBE\u1E00-\u1EFF\u2071\u207F\u2090-\u209C\u212A\u212B\u2132\u214E\u2160-\u2188\u2C60-\u2C7F\uA722-\uA787\uA78B-\uA7B9\uA7F7-\uA7FF\uAB30-\uAB5A\uAB5C-\uAB64\uFB00-\uFB06\uFF21-\uFF3A\uFF41-\uFF5A' + }, + { + 'name': 'Lepcha', + 'bmp': '\u1C00-\u1C37\u1C3B-\u1C49\u1C4D-\u1C4F' + }, + { + 'name': 'Limbu', + 'bmp': '\u1900-\u191E\u1920-\u192B\u1930-\u193B\u1940\u1944-\u194F' + }, + { + 'name': 'Linear_A', + 'astral': '\uD801[\uDE00-\uDF36\uDF40-\uDF55\uDF60-\uDF67]' + }, + { + 'name': 'Linear_B', + 'astral': '\uD800[\uDC00-\uDC0B\uDC0D-\uDC26\uDC28-\uDC3A\uDC3C\uDC3D\uDC3F-\uDC4D\uDC50-\uDC5D\uDC80-\uDCFA]' + }, + { + 'name': 'Lisu', + 'bmp': '\uA4D0-\uA4FF' + }, + { + 'name': 'Lycian', + 'astral': '\uD800[\uDE80-\uDE9C]' + }, + { + 'name': 'Lydian', + 'astral': '\uD802[\uDD20-\uDD39\uDD3F]' + }, + { + 'name': 'Mahajani', + 'astral': '\uD804[\uDD50-\uDD76]' + }, + { + 'name': 'Makasar', + 'astral': '\uD807[\uDEE0-\uDEF8]' + }, + { + 'name': 'Malayalam', + 'bmp': '\u0D00-\u0D03\u0D05-\u0D0C\u0D0E-\u0D10\u0D12-\u0D44\u0D46-\u0D48\u0D4A-\u0D4F\u0D54-\u0D63\u0D66-\u0D7F' + }, + { + 'name': 'Mandaic', + 'bmp': '\u0840-\u085B\u085E' + }, + { + 'name': 'Manichaean', + 'astral': '\uD802[\uDEC0-\uDEE6\uDEEB-\uDEF6]' + }, + { + 'name': 'Marchen', + 'astral': '\uD807[\uDC70-\uDC8F\uDC92-\uDCA7\uDCA9-\uDCB6]' + }, + { + 'name': 'Masaram_Gondi', + 'astral': '\uD807[\uDD00-\uDD06\uDD08\uDD09\uDD0B-\uDD36\uDD3A\uDD3C\uDD3D\uDD3F-\uDD47\uDD50-\uDD59]' + }, + { + 'name': 'Medefaidrin', + 'astral': '\uD81B[\uDE40-\uDE9A]' + }, + { + 'name': 'Meetei_Mayek', + 'bmp': '\uAAE0-\uAAF6\uABC0-\uABED\uABF0-\uABF9' + }, + { + 'name': 'Mende_Kikakui', + 'astral': '\uD83A[\uDC00-\uDCC4\uDCC7-\uDCD6]' + }, + { + 'name': 'Meroitic_Cursive', + 'astral': '\uD802[\uDDA0-\uDDB7\uDDBC-\uDDCF\uDDD2-\uDDFF]' + }, + { + 'name': 'Meroitic_Hieroglyphs', + 'astral': '\uD802[\uDD80-\uDD9F]' + }, + { + 'name': 'Miao', + 'astral': '\uD81B[\uDF00-\uDF44\uDF50-\uDF7E\uDF8F-\uDF9F]' + }, + { + 'name': 'Modi', + 'astral': '\uD805[\uDE00-\uDE44\uDE50-\uDE59]' + }, + { + 'name': 'Mongolian', + 'bmp': '\u1800\u1801\u1804\u1806-\u180E\u1810-\u1819\u1820-\u1878\u1880-\u18AA', + 'astral': '\uD805[\uDE60-\uDE6C]' + }, + { + 'name': 'Mro', + 'astral': '\uD81A[\uDE40-\uDE5E\uDE60-\uDE69\uDE6E\uDE6F]' + }, + { + 'name': 'Multani', + 'astral': '\uD804[\uDE80-\uDE86\uDE88\uDE8A-\uDE8D\uDE8F-\uDE9D\uDE9F-\uDEA9]' + }, + { + 'name': 'Myanmar', + 'bmp': '\u1000-\u109F\uA9E0-\uA9FE\uAA60-\uAA7F' + }, + { + 'name': 'Nabataean', + 'astral': '\uD802[\uDC80-\uDC9E\uDCA7-\uDCAF]' + }, + { + 'name': 'New_Tai_Lue', + 'bmp': '\u1980-\u19AB\u19B0-\u19C9\u19D0-\u19DA\u19DE\u19DF' + }, + { + 'name': 'Newa', + 'astral': '\uD805[\uDC00-\uDC59\uDC5B\uDC5D\uDC5E]' + }, + { + 'name': 'Nko', + 'bmp': '\u07C0-\u07FA\u07FD-\u07FF' + }, + { + 'name': 'Nushu', + 'astral': '\uD81B\uDFE1|\uD82C[\uDD70-\uDEFB]' + }, + { + 'name': 'Ogham', + 'bmp': '\u1680-\u169C' + }, + { + 'name': 'Ol_Chiki', + 'bmp': '\u1C50-\u1C7F' + }, + { + 'name': 'Old_Hungarian', + 'astral': '\uD803[\uDC80-\uDCB2\uDCC0-\uDCF2\uDCFA-\uDCFF]' + }, + { + 'name': 'Old_Italic', + 'astral': '\uD800[\uDF00-\uDF23\uDF2D-\uDF2F]' + }, + { + 'name': 'Old_North_Arabian', + 'astral': '\uD802[\uDE80-\uDE9F]' + }, + { + 'name': 'Old_Permic', + 'astral': '\uD800[\uDF50-\uDF7A]' + }, + { + 'name': 'Old_Persian', + 'astral': '\uD800[\uDFA0-\uDFC3\uDFC8-\uDFD5]' + }, + { + 'name': 'Old_Sogdian', + 'astral': '\uD803[\uDF00-\uDF27]' + }, + { + 'name': 'Old_South_Arabian', + 'astral': '\uD802[\uDE60-\uDE7F]' + }, + { + 'name': 'Old_Turkic', + 'astral': '\uD803[\uDC00-\uDC48]' + }, + { + 'name': 'Oriya', + 'bmp': '\u0B01-\u0B03\u0B05-\u0B0C\u0B0F\u0B10\u0B13-\u0B28\u0B2A-\u0B30\u0B32\u0B33\u0B35-\u0B39\u0B3C-\u0B44\u0B47\u0B48\u0B4B-\u0B4D\u0B56\u0B57\u0B5C\u0B5D\u0B5F-\u0B63\u0B66-\u0B77' + }, + { + 'name': 'Osage', + 'astral': '\uD801[\uDCB0-\uDCD3\uDCD8-\uDCFB]' + }, + { + 'name': 'Osmanya', + 'astral': '\uD801[\uDC80-\uDC9D\uDCA0-\uDCA9]' + }, + { + 'name': 'Pahawh_Hmong', + 'astral': '\uD81A[\uDF00-\uDF45\uDF50-\uDF59\uDF5B-\uDF61\uDF63-\uDF77\uDF7D-\uDF8F]' + }, + { + 'name': 'Palmyrene', + 'astral': '\uD802[\uDC60-\uDC7F]' + }, + { + 'name': 'Pau_Cin_Hau', + 'astral': '\uD806[\uDEC0-\uDEF8]' + }, + { + 'name': 'Phags_Pa', + 'bmp': '\uA840-\uA877' + }, + { + 'name': 'Phoenician', + 'astral': '\uD802[\uDD00-\uDD1B\uDD1F]' + }, + { + 'name': 'Psalter_Pahlavi', + 'astral': '\uD802[\uDF80-\uDF91\uDF99-\uDF9C\uDFA9-\uDFAF]' + }, + { + 'name': 'Rejang', + 'bmp': '\uA930-\uA953\uA95F' + }, + { + 'name': 'Runic', + 'bmp': '\u16A0-\u16EA\u16EE-\u16F8' + }, + { + 'name': 'Samaritan', + 'bmp': '\u0800-\u082D\u0830-\u083E' + }, + { + 'name': 'Saurashtra', + 'bmp': '\uA880-\uA8C5\uA8CE-\uA8D9' + }, + { + 'name': 'Sharada', + 'astral': '\uD804[\uDD80-\uDDCD\uDDD0-\uDDDF]' + }, + { + 'name': 'Shavian', + 'astral': '\uD801[\uDC50-\uDC7F]' + }, + { + 'name': 'Siddham', + 'astral': '\uD805[\uDD80-\uDDB5\uDDB8-\uDDDD]' + }, + { + 'name': 'SignWriting', + 'astral': '\uD836[\uDC00-\uDE8B\uDE9B-\uDE9F\uDEA1-\uDEAF]' + }, + { + 'name': 'Sinhala', + 'bmp': '\u0D82\u0D83\u0D85-\u0D96\u0D9A-\u0DB1\u0DB3-\u0DBB\u0DBD\u0DC0-\u0DC6\u0DCA\u0DCF-\u0DD4\u0DD6\u0DD8-\u0DDF\u0DE6-\u0DEF\u0DF2-\u0DF4', + 'astral': '\uD804[\uDDE1-\uDDF4]' + }, + { + 'name': 'Sogdian', + 'astral': '\uD803[\uDF30-\uDF59]' + }, + { + 'name': 'Sora_Sompeng', + 'astral': '\uD804[\uDCD0-\uDCE8\uDCF0-\uDCF9]' + }, + { + 'name': 'Soyombo', + 'astral': '\uD806[\uDE50-\uDE83\uDE86-\uDEA2]' + }, + { + 'name': 'Sundanese', + 'bmp': '\u1B80-\u1BBF\u1CC0-\u1CC7' + }, + { + 'name': 'Syloti_Nagri', + 'bmp': '\uA800-\uA82B' + }, + { + 'name': 'Syriac', + 'bmp': '\u0700-\u070D\u070F-\u074A\u074D-\u074F\u0860-\u086A' + }, + { + 'name': 'Tagalog', + 'bmp': '\u1700-\u170C\u170E-\u1714' + }, + { + 'name': 'Tagbanwa', + 'bmp': '\u1760-\u176C\u176E-\u1770\u1772\u1773' + }, + { + 'name': 'Tai_Le', + 'bmp': '\u1950-\u196D\u1970-\u1974' + }, + { + 'name': 'Tai_Tham', + 'bmp': '\u1A20-\u1A5E\u1A60-\u1A7C\u1A7F-\u1A89\u1A90-\u1A99\u1AA0-\u1AAD' + }, + { + 'name': 'Tai_Viet', + 'bmp': '\uAA80-\uAAC2\uAADB-\uAADF' + }, + { + 'name': 'Takri', + 'astral': '\uD805[\uDE80-\uDEB7\uDEC0-\uDEC9]' + }, + { + 'name': 'Tamil', + 'bmp': '\u0B82\u0B83\u0B85-\u0B8A\u0B8E-\u0B90\u0B92-\u0B95\u0B99\u0B9A\u0B9C\u0B9E\u0B9F\u0BA3\u0BA4\u0BA8-\u0BAA\u0BAE-\u0BB9\u0BBE-\u0BC2\u0BC6-\u0BC8\u0BCA-\u0BCD\u0BD0\u0BD7\u0BE6-\u0BFA' + }, + { + 'name': 'Tangut', + 'astral': '\uD81B\uDFE0|[\uD81C-\uD820][\uDC00-\uDFFF]|\uD821[\uDC00-\uDFF1]|\uD822[\uDC00-\uDEF2]' + }, + { + 'name': 'Telugu', + 'bmp': '\u0C00-\u0C0C\u0C0E-\u0C10\u0C12-\u0C28\u0C2A-\u0C39\u0C3D-\u0C44\u0C46-\u0C48\u0C4A-\u0C4D\u0C55\u0C56\u0C58-\u0C5A\u0C60-\u0C63\u0C66-\u0C6F\u0C78-\u0C7F' + }, + { + 'name': 'Thaana', + 'bmp': '\u0780-\u07B1' + }, + { + 'name': 'Thai', + 'bmp': '\u0E01-\u0E3A\u0E40-\u0E5B' + }, + { + 'name': 'Tibetan', + 'bmp': '\u0F00-\u0F47\u0F49-\u0F6C\u0F71-\u0F97\u0F99-\u0FBC\u0FBE-\u0FCC\u0FCE-\u0FD4\u0FD9\u0FDA' + }, + { + 'name': 'Tifinagh', + 'bmp': '\u2D30-\u2D67\u2D6F\u2D70\u2D7F' + }, + { + 'name': 'Tirhuta', + 'astral': '\uD805[\uDC80-\uDCC7\uDCD0-\uDCD9]' + }, + { + 'name': 'Ugaritic', + 'astral': '\uD800[\uDF80-\uDF9D\uDF9F]' + }, + { + 'name': 'Vai', + 'bmp': '\uA500-\uA62B' + }, + { + 'name': 'Warang_Citi', + 'astral': '\uD806[\uDCA0-\uDCF2\uDCFF]' + }, + { + 'name': 'Yi', + 'bmp': '\uA000-\uA48C\uA490-\uA4C6' + }, + { + 'name': 'Zanabazar_Square', + 'astral': '\uD806[\uDE00-\uDE47]' + } +]; + +var unicodeScripts = createCommonjsModule(function (module, exports) { +"use strict"; + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.default = void 0; + +var _scripts = _interopRequireDefault(scripts); + +function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } + +/*! + * XRegExp Unicode Scripts 4.2.0 + * + * Steven Levithan (c) 2010-present MIT License + * Unicode data by Mathias Bynens + */ +var _default = function _default(XRegExp) { + /** + * Adds support for all Unicode scripts. E.g., `\p{Latin}`. Token names are case insensitive, + * and any spaces, hyphens, and underscores are ignored. + * + * Uses Unicode 11.0.0. + * + * @requires XRegExp, Unicode Base + */ + if (!XRegExp.addUnicodeData) { + throw new ReferenceError('Unicode Base must be loaded before Unicode Scripts'); + } + + XRegExp.addUnicodeData(_scripts.default); +}; + +exports.default = _default; +module.exports = exports["default"]; +}); + +unwrapExports(unicodeScripts); + +var lib = createCommonjsModule(function (module, exports) { +"use strict"; + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.default = void 0; + +var _xregexp = _interopRequireDefault(xregexp); + +var _build = _interopRequireDefault(build); + +var _matchrecursive = _interopRequireDefault(matchrecursive); + +var _unicodeBase = _interopRequireDefault(unicodeBase); + +var _unicodeBlocks = _interopRequireDefault(unicodeBlocks); + +var _unicodeCategories = _interopRequireDefault(unicodeCategories); + +var _unicodeProperties = _interopRequireDefault(unicodeProperties); + +var _unicodeScripts = _interopRequireDefault(unicodeScripts); + +function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } + +(_build.default)(_xregexp.default); +(_matchrecursive.default)(_xregexp.default); +(_unicodeBase.default)(_xregexp.default); +(_unicodeBlocks.default)(_xregexp.default); +(_unicodeCategories.default)(_xregexp.default); +(_unicodeProperties.default)(_xregexp.default); +(_unicodeScripts.default)(_xregexp.default); +var _default = _xregexp.default; +exports.default = _default; +module.exports = exports["default"]; +}); + +unwrapExports(lib); + +var utilities = createCommonjsModule(function (module, exports) { +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); + +class FormatUtility { + static preProcess(query, toLower = true) { + if (toLower) { + query = query.toLowerCase(); + } + return query + .replace(/0/g, "0") + .replace(/1/g, "1") + .replace(/2/g, "2") + .replace(/3/g, "3") + .replace(/4/g, "4") + .replace(/5/g, "5") + .replace(/6/g, "6") + .replace(/7/g, "7") + .replace(/8/g, "8") + .replace(/9/g, "9") + .replace(/:/g, ":") + .replace(/-/g, "-") + .replace(/,/g, ",") + .replace(///g, "/") + .replace(/G/g, "G") + .replace(/M/g, "M") + .replace(/T/g, "T") + .replace(/K/g, "K") + .replace(/k/g, "k") + .replace(/./g, ".") + .replace(/(/g, "(") + .replace(/)/g, ")"); + } +} +exports.FormatUtility = FormatUtility; +class Match { + constructor(index, length, value, groups) { + this.index = index; + this.length = length; + this.value = value; + this.innerGroups = groups; + } + groups(key) { + return this.innerGroups[key] ? this.innerGroups[key] : { value: '', index: 0, length: 0, captures: [] }; + } +} +exports.Match = Match; +class RegExpUtility { + static getMatches(regex, source) { + if (!regex) + return []; + let rawRegex = regex.xregexp.source; + if (!rawRegex.includes('(?= 0) { + closePos = this.getClosePos(rawRegex, startPos); + let nlbRegex = lib(rawRegex.substring(startPos, closePos + 1), flags); + let nextRegex = RegExpUtility.getNextRegex(rawRegex, startPos); + nlbRegex.nextRegex = nextRegex ? lib(nextRegex, flags) : null; + negativeLookbehindRegexes.push(nlbRegex); + rawRegex = rawRegex.substr(0, startPos) + rawRegex.substr(closePos + 1); + startPos = rawRegex.indexOf('(? { + let clean = true; + negativeLookbehindRegexes.forEach(regex => { + let negativeLookbehindMatches = RegExpUtility.getMatchesSimple(regex, source); + negativeLookbehindMatches.forEach(negativeLookbehindMatch => { + let negativeLookbehindEnd = negativeLookbehindMatch.index + negativeLookbehindMatch.length; + let nextRegex = regex.nextRegex; + if (match.index === negativeLookbehindEnd) { + if (!nextRegex) { + clean = false; + return; + } + else { + let nextMatch = RegExpUtility.getFirstMatchIndex(nextRegex, source.substring(negativeLookbehindMatch.index)); + if (nextMatch.matched && ((nextMatch.index === negativeLookbehindMatch.length) || (source.includes(nextMatch.value + match.value)))) { + clean = false; + return; + } + } + } + if (negativeLookbehindMatch.value.includes(match.value)) { + let preMatches = RegExpUtility.getMatchesSimple(regex, source.substring(0, match.index)); + preMatches.forEach(preMatch => { + if (source.includes(preMatch.value + match.value)) { + clean = false; + return; + } + }); + } + }); + if (!clean) { + return; + } + }); + if (clean) { + realMatches.push(match); + } + }); + return realMatches; + } + static getMatchesSimple(regex, source) { + // Word boundary (\b) in JS is not unicode-aware, so words starting/ending with accentuated characters will not match + // use a normalized string to match, the return matches' values using the original one + // http://blog.stevenlevithan.com/archives/javascript-regex-and-unicode + // https://stackoverflow.com/questions/2881445/utf-8-word-boundary-regex-in-javascript + let normalized = StringUtility.removeDiacriticsFromWordBoundaries(source); + let matches = new Array(); + lib.forEach(normalized, regex, match => { + let positiveLookbehinds = []; + let groups = {}; + let lastGroup = ''; + Object.keys(match).forEach(key => { + if (!key.includes('__')) + return; + if (key.startsWith('plb') && match[key]) { + if (match[0].indexOf(match[key]) !== 0 && !StringUtility.isNullOrEmpty(lastGroup)) { + let index = match.index + match[0].indexOf(match[key]); + let length = match[key].length; + let value = source.substr(index, length); + groups[lastGroup].value = groups[lastGroup].value + value; + } + positiveLookbehinds.push({ key: key, value: match[key] }); + return; + } + if (key.startsWith('nlb')) { + return; + } + let groupKey = key.substr(0, key.lastIndexOf('__')); + lastGroup = groupKey; + if (!groups[groupKey]) + groups[groupKey] = { value: '', index: 0, length: 0, captures: [] }; + if (match[key]) { + let index = match.index + match[0].indexOf(match[key]); + let length = match[key].length; + let value = source.substr(index, length); + groups[groupKey].index = index; + groups[groupKey].length = length; + groups[groupKey].value = value; + groups[groupKey].captures.push(value); + } + }); + let value = match[0]; + let index = match.index; + let length = value.length; + if (positiveLookbehinds && positiveLookbehinds.length > 0 && value.indexOf(positiveLookbehinds[0].value) === 0) { + value = source.substr(index, length).substr(positiveLookbehinds[0].value.length); + index += positiveLookbehinds[0].value.length; + length -= positiveLookbehinds[0].value.length; + } + else { + value = source.substr(index, length); + } + matches.push(new Match(index, length, value, groups)); + }); + return matches; + } + static getSafeRegExp(source, flags) { + let sanitizedSource = this.sanitizeGroups(source); + return lib(sanitizedSource, flags || 'gis'); + } + static getFirstMatchIndex(regex, source) { + let matches = RegExpUtility.getMatches(regex, source); + if (matches.length) { + return { + matched: true, + index: matches[0].index, + value: matches[0].value + }; + } + return { matched: false, index: -1, value: null }; + } + static split(regex, source) { + return lib.split(source, regex); + } + static isMatch(regex, source) { + return !StringUtility.isNullOrEmpty(source) + && this.getMatches(regex, source).length > 0; + } + static sanitizeGroups(source) { + let index = 0; + let result = lib.replace(source, this.matchGroup, (match, name) => match.replace(name, `${name}__${index++}`)); + index = 0; + result = lib.replace(result, this.matchPositiveLookbehind, () => `(?`); + index = 0; + result = lib.replace(result, this.matchNegativeLookbehind, () => `(?`); + return result; + } + static getNextRegex(source, startPos) { + startPos = RegExpUtility.getClosePos(source, startPos) + 1; + let closePos = RegExpUtility.getClosePos(source, startPos); + if (source[startPos] !== '(') { + closePos--; + } + let next = (startPos === closePos) + ? null + : source.substring(startPos, closePos + 1); + return next; + } + static getClosePos(source, startPos) { + let counter = 1; + let closePos = startPos; + while (counter > 0 && closePos < source.length) { + let c = source[++closePos]; + if (c === '(') + counter++; + else if (c === ')') + counter--; + } + return closePos; + } +} +RegExpUtility.matchGroup = lib(String.raw `\?<(?\w+)>`, 'gis'); +RegExpUtility.matchPositiveLookbehind = lib(String.raw `\(\?<=`, 'gis'); +RegExpUtility.matchNegativeLookbehind = lib(String.raw `\(\? { + let length = s.length; + if (length === 0) + return s; + let first = StringUtility.removeDiacritics(s.substring(0, 1)); + if (length === 1) + return first; + let last = length > 1 ? StringUtility.removeDiacritics(s.substring(length - 1)) : ''; + let mid = s.substring(1, length - 1); + // console.log(first + mid + last) + return first + mid + last; + }) + .join(' '); + } + static removeDiacritics(c) { + let clean = StringUtility.diacriticsRemovalMap[c]; + return !clean ? c : clean; + } +} +StringUtility.diacriticsRemovalMap = { + "Ⓐ": "A", + "A": "A", + "À": "A", + "Á": "A", + "Â": "A", + "Ầ": "A", + "Ấ": "A", + "Ẫ": "A", + "Ẩ": "A", + "Ã": "A", + "Ā": "A", + "Ă": "A", + "Ằ": "A", + "Ắ": "A", + "Ẵ": "A", + "Ẳ": "A", + "Ȧ": "A", + "Ǡ": "A", + "Ä": "A", + "Ǟ": "A", + "Ả": "A", + "Å": "A", + "Ǻ": "A", + "Ǎ": "A", + "Ȁ": "A", + "Ȃ": "A", + "Ạ": "A", + "Ậ": "A", + "Ặ": "A", + "Ḁ": "A", + "Ą": "A", + "Ⱥ": "A", + "Ɐ": "A", + "Ⓑ": "B", + "B": "B", + "Ḃ": "B", + "Ḅ": "B", + "Ḇ": "B", + "Ƀ": "B", + "Ƃ": "B", + "Ɓ": "B", + "Ⓒ": "C", + "C": "C", + "Ć": "C", + "Ĉ": "C", + "Ċ": "C", + "Č": "C", + "Ç": "C", + "Ḉ": "C", + "Ƈ": "C", + "Ȼ": "C", + "Ꜿ": "C", + "Ⓓ": "D", + "D": "D", + "Ḋ": "D", + "Ď": "D", + "Ḍ": "D", + "Ḑ": "D", + "Ḓ": "D", + "Ḏ": "D", + "Đ": "D", + "Ƌ": "D", + "Ɗ": "D", + "Ɖ": "D", + "Ꝺ": "D", + "Ⓔ": "E", + "E": "E", + "È": "E", + "É": "E", + "Ê": "E", + "Ề": "E", + "Ế": "E", + "Ễ": "E", + "Ể": "E", + "Ẽ": "E", + "Ē": "E", + "Ḕ": "E", + "Ḗ": "E", + "Ĕ": "E", + "Ė": "E", + "Ë": "E", + "Ẻ": "E", + "Ě": "E", + "Ȅ": "E", + "Ȇ": "E", + "Ẹ": "E", + "Ệ": "E", + "Ȩ": "E", + "Ḝ": "E", + "Ę": "E", + "Ḙ": "E", + "Ḛ": "E", + "Ɛ": "E", + "Ǝ": "E", + "Ⓕ": "F", + "F": "F", + "Ḟ": "F", + "Ƒ": "F", + "Ꝼ": "F", + "Ⓖ": "G", + "G": "G", + "Ǵ": "G", + "Ĝ": "G", + "Ḡ": "G", + "Ğ": "G", + "Ġ": "G", + "Ǧ": "G", + "Ģ": "G", + "Ǥ": "G", + "Ɠ": "G", + "Ꞡ": "G", + "Ᵹ": "G", + "Ꝿ": "G", + "Ⓗ": "H", + "H": "H", + "Ĥ": "H", + "Ḣ": "H", + "Ḧ": "H", + "Ȟ": "H", + "Ḥ": "H", + "Ḩ": "H", + "Ḫ": "H", + "Ħ": "H", + "Ⱨ": "H", + "Ⱶ": "H", + "Ɥ": "H", + "Ⓘ": "I", + "I": "I", + "Ì": "I", + "Í": "I", + "Î": "I", + "Ĩ": "I", + "Ī": "I", + "Ĭ": "I", + "İ": "I", + "Ï": "I", + "Ḯ": "I", + "Ỉ": "I", + "Ǐ": "I", + "Ȉ": "I", + "Ȋ": "I", + "Ị": "I", + "Į": "I", + "Ḭ": "I", + "Ɨ": "I", + "Ⓙ": "J", + "J": "J", + "Ĵ": "J", + "Ɉ": "J", + "Ⓚ": "K", + "K": "K", + "Ḱ": "K", + "Ǩ": "K", + "Ḳ": "K", + "Ķ": "K", + "Ḵ": "K", + "Ƙ": "K", + "Ⱪ": "K", + "Ꝁ": "K", + "Ꝃ": "K", + "Ꝅ": "K", + "Ꞣ": "K", + "Ⓛ": "L", + "L": "L", + "Ŀ": "L", + "Ĺ": "L", + "Ľ": "L", + "Ḷ": "L", + "Ḹ": "L", + "Ļ": "L", + "Ḽ": "L", + "Ḻ": "L", + "Ł": "L", + "Ƚ": "L", + "Ɫ": "L", + "Ⱡ": "L", + "Ꝉ": "L", + "Ꝇ": "L", + "Ꞁ": "L", + "Ⓜ": "M", + "M": "M", + "Ḿ": "M", + "Ṁ": "M", + "Ṃ": "M", + "Ɱ": "M", + "Ɯ": "M", + "Ⓝ": "N", + "N": "N", + "Ǹ": "N", + "Ń": "N", + "Ñ": "N", + "Ṅ": "N", + "Ň": "N", + "Ṇ": "N", + "Ņ": "N", + "Ṋ": "N", + "Ṉ": "N", + "Ƞ": "N", + "Ɲ": "N", + "Ꞑ": "N", + "Ꞥ": "N", + "Ⓞ": "O", + "O": "O", + "Ò": "O", + "Ó": "O", + "Ô": "O", + "Ồ": "O", + "Ố": "O", + "Ỗ": "O", + "Ổ": "O", + "Õ": "O", + "Ṍ": "O", + "Ȭ": "O", + "Ṏ": "O", + "Ō": "O", + "Ṑ": "O", + "Ṓ": "O", + "Ŏ": "O", + "Ȯ": "O", + "Ȱ": "O", + "Ö": "O", + "Ȫ": "O", + "Ỏ": "O", + "Ő": "O", + "Ǒ": "O", + "Ȍ": "O", + "Ȏ": "O", + "Ơ": "O", + "Ờ": "O", + "Ớ": "O", + "Ỡ": "O", + "Ở": "O", + "Ợ": "O", + "Ọ": "O", + "Ộ": "O", + "Ǫ": "O", + "Ǭ": "O", + "Ø": "O", + "Ǿ": "O", + "Ɔ": "O", + "Ɵ": "O", + "Ꝋ": "O", + "Ꝍ": "O", + "Ⓟ": "P", + "P": "P", + "Ṕ": "P", + "Ṗ": "P", + "Ƥ": "P", + "Ᵽ": "P", + "Ꝑ": "P", + "Ꝓ": "P", + "Ꝕ": "P", + "Ⓠ": "Q", + "Q": "Q", + "Ꝗ": "Q", + "Ꝙ": "Q", + "Ɋ": "Q", + "Ⓡ": "R", + "R": "R", + "Ŕ": "R", + "Ṙ": "R", + "Ř": "R", + "Ȑ": "R", + "Ȓ": "R", + "Ṛ": "R", + "Ṝ": "R", + "Ŗ": "R", + "Ṟ": "R", + "Ɍ": "R", + "Ɽ": "R", + "Ꝛ": "R", + "Ꞧ": "R", + "Ꞃ": "R", + "Ⓢ": "S", + "S": "S", + "ẞ": "S", + "Ś": "S", + "Ṥ": "S", + "Ŝ": "S", + "Ṡ": "S", + "Š": "S", + "Ṧ": "S", + "Ṣ": "S", + "Ṩ": "S", + "Ș": "S", + "Ş": "S", + "Ȿ": "S", + "Ꞩ": "S", + "Ꞅ": "S", + "Ⓣ": "T", + "T": "T", + "Ṫ": "T", + "Ť": "T", + "Ṭ": "T", + "Ț": "T", + "Ţ": "T", + "Ṱ": "T", + "Ṯ": "T", + "Ŧ": "T", + "Ƭ": "T", + "Ʈ": "T", + "Ⱦ": "T", + "Ꞇ": "T", + "Ⓤ": "U", + "U": "U", + "Ù": "U", + "Ú": "U", + "Û": "U", + "Ũ": "U", + "Ṹ": "U", + "Ū": "U", + "Ṻ": "U", + "Ŭ": "U", + "Ü": "U", + "Ǜ": "U", + "Ǘ": "U", + "Ǖ": "U", + "Ǚ": "U", + "Ủ": "U", + "Ů": "U", + "Ű": "U", + "Ǔ": "U", + "Ȕ": "U", + "Ȗ": "U", + "Ư": "U", + "Ừ": "U", + "Ứ": "U", + "Ữ": "U", + "Ử": "U", + "Ự": "U", + "Ụ": "U", + "Ṳ": "U", + "Ų": "U", + "Ṷ": "U", + "Ṵ": "U", + "Ʉ": "U", + "Ⓥ": "V", + "V": "V", + "Ṽ": "V", + "Ṿ": "V", + "Ʋ": "V", + "Ꝟ": "V", + "Ʌ": "V", + "Ⓦ": "W", + "W": "W", + "Ẁ": "W", + "Ẃ": "W", + "Ŵ": "W", + "Ẇ": "W", + "Ẅ": "W", + "Ẉ": "W", + "Ⱳ": "W", + "Ⓧ": "X", + "X": "X", + "Ẋ": "X", + "Ẍ": "X", + "Ⓨ": "Y", + "Y": "Y", + "Ỳ": "Y", + "Ý": "Y", + "Ŷ": "Y", + "Ỹ": "Y", + "Ȳ": "Y", + "Ẏ": "Y", + "Ÿ": "Y", + "Ỷ": "Y", + "Ỵ": "Y", + "Ƴ": "Y", + "Ɏ": "Y", + "Ỿ": "Y", + "Ⓩ": "Z", + "Z": "Z", + "Ź": "Z", + "Ẑ": "Z", + "Ż": "Z", + "Ž": "Z", + "Ẓ": "Z", + "Ẕ": "Z", + "Ƶ": "Z", + "Ȥ": "Z", + "Ɀ": "Z", + "Ⱬ": "Z", + "Ꝣ": "Z", + "ⓐ": "a", + "a": "a", + "ẚ": "a", + "à": "a", + "á": "a", + "â": "a", + "ầ": "a", + "ấ": "a", + "ẫ": "a", + "ẩ": "a", + "ã": "a", + "ā": "a", + "ă": "a", + "ằ": "a", + "ắ": "a", + "ẵ": "a", + "ẳ": "a", + "ȧ": "a", + "ǡ": "a", + "ä": "a", + "ǟ": "a", + "ả": "a", + "å": "a", + "ǻ": "a", + "ǎ": "a", + "ȁ": "a", + "ȃ": "a", + "ạ": "a", + "ậ": "a", + "ặ": "a", + "ḁ": "a", + "ą": "a", + "ⱥ": "a", + "ɐ": "a", + "ⓑ": "b", + "b": "b", + "ḃ": "b", + "ḅ": "b", + "ḇ": "b", + "ƀ": "b", + "ƃ": "b", + "ɓ": "b", + "ⓒ": "c", + "c": "c", + "ć": "c", + "ĉ": "c", + "ċ": "c", + "č": "c", + "ç": "c", + "ḉ": "c", + "ƈ": "c", + "ȼ": "c", + "ꜿ": "c", + "ↄ": "c", + "ⓓ": "d", + "d": "d", + "ḋ": "d", + "ď": "d", + "ḍ": "d", + "ḑ": "d", + "ḓ": "d", + "ḏ": "d", + "đ": "d", + "ƌ": "d", + "ɖ": "d", + "ɗ": "d", + "ꝺ": "d", + "ⓔ": "e", + "e": "e", + "è": "e", + "é": "e", + "ê": "e", + "ề": "e", + "ế": "e", + "ễ": "e", + "ể": "e", + "ẽ": "e", + "ē": "e", + "ḕ": "e", + "ḗ": "e", + "ĕ": "e", + "ė": "e", + "ë": "e", + "ẻ": "e", + "ě": "e", + "ȅ": "e", + "ȇ": "e", + "ẹ": "e", + "ệ": "e", + "ȩ": "e", + "ḝ": "e", + "ę": "e", + "ḙ": "e", + "ḛ": "e", + "ɇ": "e", + "ɛ": "e", + "ǝ": "e", + "ⓕ": "f", + "f": "f", + "ḟ": "f", + "ƒ": "f", + "ꝼ": "f", + "ⓖ": "g", + "g": "g", + "ǵ": "g", + "ĝ": "g", + "ḡ": "g", + "ğ": "g", + "ġ": "g", + "ǧ": "g", + "ģ": "g", + "ǥ": "g", + "ɠ": "g", + "ꞡ": "g", + "ᵹ": "g", + "ꝿ": "g", + "ⓗ": "h", + "h": "h", + "ĥ": "h", + "ḣ": "h", + "ḧ": "h", + "ȟ": "h", + "ḥ": "h", + "ḩ": "h", + "ḫ": "h", + "ẖ": "h", + "ħ": "h", + "ⱨ": "h", + "ⱶ": "h", + "ɥ": "h", + "ⓘ": "i", + "i": "i", + "ì": "i", + "í": "i", + "î": "i", + "ĩ": "i", + "ī": "i", + "ĭ": "i", + "ï": "i", + "ḯ": "i", + "ỉ": "i", + "ǐ": "i", + "ȉ": "i", + "ȋ": "i", + "ị": "i", + "į": "i", + "ḭ": "i", + "ɨ": "i", + "ı": "i", + "ⓙ": "j", + "j": "j", + "ĵ": "j", + "ǰ": "j", + "ɉ": "j", + "ⓚ": "k", + "k": "k", + "ḱ": "k", + "ǩ": "k", + "ḳ": "k", + "ķ": "k", + "ḵ": "k", + "ƙ": "k", + "ⱪ": "k", + "ꝁ": "k", + "ꝃ": "k", + "ꝅ": "k", + "ꞣ": "k", + "ⓛ": "l", + "l": "l", + "ŀ": "l", + "ĺ": "l", + "ľ": "l", + "ḷ": "l", + "ḹ": "l", + "ļ": "l", + "ḽ": "l", + "ḻ": "l", + "ſ": "l", + "ł": "l", + "ƚ": "l", + "ɫ": "l", + "ⱡ": "l", + "ꝉ": "l", + "ꞁ": "l", + "ꝇ": "l", + "ⓜ": "m", + "m": "m", + "ḿ": "m", + "ṁ": "m", + "ṃ": "m", + "ɱ": "m", + "ɯ": "m", + "ⓝ": "n", + "n": "n", + "ǹ": "n", + "ń": "n", + "ñ": "n", + "ṅ": "n", + "ň": "n", + "ṇ": "n", + "ņ": "n", + "ṋ": "n", + "ṉ": "n", + "ƞ": "n", + "ɲ": "n", + "ʼn": "n", + "ꞑ": "n", + "ꞥ": "n", + "ⓞ": "o", + "o": "o", + "ò": "o", + "ó": "o", + "ô": "o", + "ồ": "o", + "ố": "o", + "ỗ": "o", + "ổ": "o", + "õ": "o", + "ṍ": "o", + "ȭ": "o", + "ṏ": "o", + "ō": "o", + "ṑ": "o", + "ṓ": "o", + "ŏ": "o", + "ȯ": "o", + "ȱ": "o", + "ö": "o", + "ȫ": "o", + "ỏ": "o", + "ő": "o", + "ǒ": "o", + "ȍ": "o", + "ȏ": "o", + "ơ": "o", + "ờ": "o", + "ớ": "o", + "ỡ": "o", + "ở": "o", + "ợ": "o", + "ọ": "o", + "ộ": "o", + "ǫ": "o", + "ǭ": "o", + "ø": "o", + "ǿ": "o", + "ɔ": "o", + "ꝋ": "o", + "ꝍ": "o", + "ɵ": "o", + "ⓟ": "p", + "p": "p", + "ṕ": "p", + "ṗ": "p", + "ƥ": "p", + "ᵽ": "p", + "ꝑ": "p", + "ꝓ": "p", + "ꝕ": "p", + "ⓠ": "q", + "q": "q", + "ɋ": "q", + "ꝗ": "q", + "ꝙ": "q", + "ⓡ": "r", + "r": "r", + "ŕ": "r", + "ṙ": "r", + "ř": "r", + "ȑ": "r", + "ȓ": "r", + "ṛ": "r", + "ṝ": "r", + "ŗ": "r", + "ṟ": "r", + "ɍ": "r", + "ɽ": "r", + "ꝛ": "r", + "ꞧ": "r", + "ꞃ": "r", + "ⓢ": "s", + "s": "s", + "ß": "s", + "ś": "s", + "ṥ": "s", + "ŝ": "s", + "ṡ": "s", + "š": "s", + "ṧ": "s", + "ṣ": "s", + "ṩ": "s", + "ș": "s", + "ş": "s", + "ȿ": "s", + "ꞩ": "s", + "ꞅ": "s", + "ẛ": "s", + "ⓣ": "t", + "t": "t", + "ṫ": "t", + "ẗ": "t", + "ť": "t", + "ṭ": "t", + "ț": "t", + "ţ": "t", + "ṱ": "t", + "ṯ": "t", + "ŧ": "t", + "ƭ": "t", + "ʈ": "t", + "ⱦ": "t", + "ꞇ": "t", + "ⓤ": "u", + "u": "u", + "ù": "u", + "ú": "u", + "û": "u", + "ũ": "u", + "ṹ": "u", + "ū": "u", + "ṻ": "u", + "ŭ": "u", + "ü": "u", + "ǜ": "u", + "ǘ": "u", + "ǖ": "u", + "ǚ": "u", + "ủ": "u", + "ů": "u", + "ű": "u", + "ǔ": "u", + "ȕ": "u", + "ȗ": "u", + "ư": "u", + "ừ": "u", + "ứ": "u", + "ữ": "u", + "ử": "u", + "ự": "u", + "ụ": "u", + "ṳ": "u", + "ų": "u", + "ṷ": "u", + "ṵ": "u", + "ʉ": "u", + "ⓥ": "v", + "v": "v", + "ṽ": "v", + "ṿ": "v", + "ʋ": "v", + "ꝟ": "v", + "ʌ": "v", + "ⓦ": "w", + "w": "w", + "ẁ": "w", + "ẃ": "w", + "ŵ": "w", + "ẇ": "w", + "ẅ": "w", + "ẘ": "w", + "ẉ": "w", + "ⱳ": "w", + "ⓧ": "x", + "x": "x", + "ẋ": "x", + "ẍ": "x", + "ⓨ": "y", + "y": "y", + "ỳ": "y", + "ý": "y", + "ŷ": "y", + "ỹ": "y", + "ȳ": "y", + "ẏ": "y", + "ÿ": "y", + "ỷ": "y", + "ẙ": "y", + "ỵ": "y", + "ƴ": "y", + "ɏ": "y", + "ỿ": "y", + "ⓩ": "z", + "z": "z", + "ź": "z", + "ẑ": "z", + "ż": "z", + "ž": "z", + "ẓ": "z", + "ẕ": "z", + "ƶ": "z", + "ȥ": "z", + "ɀ": "z", + "ⱬ": "z", + "ꝣ": "z" +}; +exports.StringUtility = StringUtility; + +}); + +unwrapExports(utilities); + +var models = createCommonjsModule(function (module, exports) { +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); + + +class ModelResult { +} +exports.ModelResult = ModelResult; +class ExtendedModelResult extends ModelResult { + constructor(source = null) { + super(); + if (source) { + this.text = source.text; + this.start = source.start; + this.end = source.end; + this.typeName = source.typeName; + this.resolution = source.resolution; + } + } +} +exports.ExtendedModelResult = ExtendedModelResult; +class ModelFactoryKey { + constructor(culture$$1, modelType, options = null) { + this.culture = culture$$1 ? culture$$1.toLowerCase() : null; + this.modelType = modelType; + this.options = options; + } + toString() { + return JSON.stringify(this); + } + static fromString(key) { + return JSON.parse(key); + } +} +class ModelFactory { + constructor() { + this.modelFactories = new Map(); + } + getModel(modelTypeName, culture$$1, fallbackToDefaultCulture, options) { + let result = this.tryGetModel(modelTypeName, culture$$1, options); + if (!result.containsModel && fallbackToDefaultCulture) { + result = this.tryGetModel(modelTypeName, ModelFactory.fallbackCulture, options); + } + if (result.containsModel) { + return result.model; + } + throw new Error(`Could not find Model with the specified configuration: ${culture$$1},${modelTypeName}`); + } + tryGetModel(modelTypeName, culture$$1, options) { + culture$$1 = culture.Culture.mapToNearestLanguage(culture$$1); + let cacheResult = this.getModelFromCache(modelTypeName, culture$$1, options); + if (cacheResult) + return { containsModel: true, model: cacheResult }; + let key = this.generateKey(modelTypeName, culture$$1); + if (this.modelFactories.has(key)) { + let model = this.modelFactories.get(key)(options); + this.registerModelInCache(modelTypeName, culture$$1, options, model); + return { containsModel: true, model: model }; + } + return { containsModel: false }; + } + registerModel(modelTypeName, culture$$1, modelCreator) { + let key = this.generateKey(modelTypeName, culture$$1); + if (this.modelFactories.has(key)) { + throw new Error(`${culture$$1}-${modelTypeName} has already been registered.`); + } + this.modelFactories.set(key, modelCreator); + } + initializeModels(targetCulture, options) { + this.modelFactories.forEach((value, key) => { + let modelFactoryKey = ModelFactoryKey.fromString(key); + if (utilities.StringUtility.isNullOrEmpty(targetCulture) || modelFactoryKey.culture === targetCulture) { + this.tryGetModel(modelFactoryKey.modelType, modelFactoryKey.culture, modelFactoryKey.options); + } + }); + } + generateKey(modelTypeName, culture$$1) { + return new ModelFactoryKey(culture$$1, modelTypeName).toString(); + } + getModelFromCache(modelTypeName, culture$$1, options) { + let key = this.generateCacheKey(modelTypeName, culture$$1, options); + return ModelFactory.cache.get(key); + } + registerModelInCache(modelTypeName, culture$$1, options, model) { + let key = this.generateCacheKey(modelTypeName, culture$$1, options); + ModelFactory.cache.set(key, model); + } + generateCacheKey(modelTypeName, culture$$1, options) { + return new ModelFactoryKey(culture$$1, modelTypeName, options).toString(); + } +} +ModelFactory.fallbackCulture = culture.Culture.English; +ModelFactory.cache = new Map(); +exports.ModelFactory = ModelFactory; + +}); + +unwrapExports(models); + +var recognizer = createCommonjsModule(function (module, exports) { +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); + +class Recognizer { + constructor(targetCulture, options, lazyInitialization) { + this.modelFactory = new models.ModelFactory(); + if (!this.IsValidOptions(options)) + throw new Error(`${options} is not a valid options value.`); + this.TargetCulture = targetCulture; + this.Options = options; + this.InitializeConfiguration(); + if (!lazyInitialization) { + this.initializeModels(targetCulture, options); + } + } + getModel(modelTypeName, culture, fallbackToDefaultCulture) { + return this.modelFactory.getModel(modelTypeName, culture || this.TargetCulture, fallbackToDefaultCulture, this.Options); + } + registerModel(modelTypeName, culture, modelCreator) { + this.modelFactory.registerModel(modelTypeName, culture, modelCreator); + } + initializeModels(targetCulture, options) { + this.modelFactory.initializeModels(targetCulture, options); + } +} +exports.Recognizer = Recognizer; + +}); + +unwrapExports(recognizer); + +var extractors = createCommonjsModule(function (module, exports) { +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +class ExtractResult { + static isOverlap(erA, erB) { + return !(erA.start >= erB.start + erB.length) && !(erB.start >= erA.start + erA.length); + } + static isCover(er1, er2) { + return ((er2.start < er1.start) && ((er2.start + er2.length) >= (er1.start + er1.length))) + || ((er2.start <= er1.start) && ((er2.start + er2.length) > (er1.start + er1.length))); + } + static getFromText(source) { + return { + start: 0, + length: source.length, + text: source, + type: 'custom' + }; + } +} +exports.ExtractResult = ExtractResult; + +}); + +unwrapExports(extractors); + +var parsers = createCommonjsModule(function (module, exports) { +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); + +class ParseResult extends extractors.ExtractResult { + constructor(er) { + super(); + if (er) { + this.length = er.length; + this.start = er.start; + this.data = er.data; + this.text = er.text; + this.type = er.type; + } + this.resolutionStr = ""; + } +} +exports.ParseResult = ParseResult; + +}); + +unwrapExports(parsers); + +var recognizersText = createCommonjsModule(function (module, exports) { +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); + +exports.Culture = culture.Culture; +exports.CultureInfo = culture.CultureInfo; + +exports.ModelResult = models.ModelResult; +exports.ModelFactory = models.ModelFactory; + +exports.Recognizer = recognizer.Recognizer; + +exports.ExtractResult = extractors.ExtractResult; + +exports.ParseResult = parsers.ParseResult; + +exports.FormatUtility = utilities.FormatUtility; +exports.StringUtility = utilities.StringUtility; +exports.Match = utilities.Match; +exports.RegExpUtility = utilities.RegExpUtility; + +}); + +unwrapExports(recognizersText); + +var models$2 = createCommonjsModule(function (module, exports) { +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +class ChoiceModel { + constructor(parser, extractor) { + this.extractor = extractor; + this.parser = parser; + } + parse(source) { + let extractResults = this.extractor.extract(source); + let parseResults = extractResults.map(r => this.parser.parse(r)); + return parseResults + .map(o => o) + .map(o => ({ + start: o.start, + end: o.start + o.length - 1, + resolution: this.getResolution(o), + text: o.text, + typeName: this.modelTypeName + })); + } +} +exports.ChoiceModel = ChoiceModel; +class BooleanModel extends ChoiceModel { + constructor() { + super(...arguments); + this.modelTypeName = 'boolean'; + } + getResolution(sources) { + let results = { + value: sources.value, + score: sources.data.score + }; + if (sources.data.otherMatches) { + results.otherResults = sources.data.otherMatches.map(o => ({ + text: o.text, + value: o.value, + score: o.data.score + })); + } + return results; + } +} +exports.BooleanModel = BooleanModel; + +}); + +unwrapExports(models$2); + +var constants = createCommonjsModule(function (module, exports) { +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +class Constants { +} +Constants.SYS_BOOLEAN = "boolean"; +Constants.SYS_BOOLEAN_TRUE = "boolean-true"; +Constants.SYS_BOOLEAN_FALSE = "boolean-false"; +exports.Constants = Constants; + +}); + +unwrapExports(constants); + +/* +Breaks a Javascript string into individual user-perceived "characters" +called extended grapheme clusters by implementing the Unicode UAX-29 standard, version 10.0.0 + +Usage: +var splitter = new GraphemeSplitter(); +//returns an array of strings, one string for each grapheme cluster +var graphemes = splitter.splitGraphemes(string); + +*/ +function GraphemeSplitter(){ + var CR = 0, + LF = 1, + Control = 2, + Extend = 3, + Regional_Indicator = 4, + SpacingMark = 5, + L = 6, + V = 7, + T = 8, + LV = 9, + LVT = 10, + Other = 11, + Prepend = 12, + E_Base = 13, + E_Modifier = 14, + ZWJ = 15, + Glue_After_Zwj = 16, + E_Base_GAZ = 17; + + // BreakTypes + var NotBreak = 0, + BreakStart = 1, + Break = 2, + BreakLastRegional = 3, + BreakPenultimateRegional = 4; + + function isSurrogate(str, pos) { + return 0xd800 <= str.charCodeAt(pos) && str.charCodeAt(pos) <= 0xdbff && + 0xdc00 <= str.charCodeAt(pos + 1) && str.charCodeAt(pos + 1) <= 0xdfff; + } + + // Private function, gets a Unicode code point from a JavaScript UTF-16 string + // handling surrogate pairs appropriately + function codePointAt(str, idx){ + if(idx === undefined){ + idx = 0; + } + var code = str.charCodeAt(idx); + + // if a high surrogate + if (0xD800 <= code && code <= 0xDBFF && + idx < str.length - 1){ + var hi = code; + var low = str.charCodeAt(idx + 1); + if (0xDC00 <= low && low <= 0xDFFF){ + return ((hi - 0xD800) * 0x400) + (low - 0xDC00) + 0x10000; + } + return hi; + } + + // if a low surrogate + if (0xDC00 <= code && code <= 0xDFFF && + idx >= 1){ + var hi = str.charCodeAt(idx - 1); + var low = code; + if (0xD800 <= hi && hi <= 0xDBFF){ + return ((hi - 0xD800) * 0x400) + (low - 0xDC00) + 0x10000; + } + return low; + } + + //just return the char if an unmatched surrogate half or a + //single-char codepoint + return code; + } + + // Private function, returns whether a break is allowed between the + // two given grapheme breaking classes + function shouldBreak(start, mid, end){ + var all = [start].concat(mid).concat([end]); + var previous = all[all.length - 2]; + var next = end; + + // Lookahead termintor for: + // GB10. (E_Base | EBG) Extend* ? E_Modifier + var eModifierIndex = all.lastIndexOf(E_Modifier); + if(eModifierIndex > 1 && + all.slice(1, eModifierIndex).every(function(c){return c == Extend}) && + [Extend, E_Base, E_Base_GAZ].indexOf(start) == -1){ + return Break + } + + // Lookahead termintor for: + // GB12. ^ (RI RI)* RI ? RI + // GB13. [^RI] (RI RI)* RI ? RI + var rIIndex = all.lastIndexOf(Regional_Indicator); + if(rIIndex > 0 && + all.slice(1, rIIndex).every(function(c){return c == Regional_Indicator}) && + [Prepend, Regional_Indicator].indexOf(previous) == -1) { + if(all.filter(function(c){return c == Regional_Indicator}).length % 2 == 1) { + return BreakLastRegional + } + else { + return BreakPenultimateRegional + } + } + + // GB3. CR X LF + if(previous == CR && next == LF){ + return NotBreak; + } + // GB4. (Control|CR|LF) ÷ + else if(previous == Control || previous == CR || previous == LF){ + if(next == E_Modifier && mid.every(function(c){return c == Extend})){ + return Break + } + else { + return BreakStart + } + } + // GB5. ÷ (Control|CR|LF) + else if(next == Control || next == CR || next == LF){ + return BreakStart; + } + // GB6. L X (L|V|LV|LVT) + else if(previous == L && + (next == L || next == V || next == LV || next == LVT)){ + return NotBreak; + } + // GB7. (LV|V) X (V|T) + else if((previous == LV || previous == V) && + (next == V || next == T)){ + return NotBreak; + } + // GB8. (LVT|T) X (T) + else if((previous == LVT || previous == T) && + next == T){ + return NotBreak; + } + // GB9. X (Extend|ZWJ) + else if (next == Extend || next == ZWJ){ + return NotBreak; + } + // GB9a. X SpacingMark + else if(next == SpacingMark){ + return NotBreak; + } + // GB9b. Prepend X + else if (previous == Prepend){ + return NotBreak; + } + + // GB10. (E_Base | EBG) Extend* ? E_Modifier + var previousNonExtendIndex = all.indexOf(Extend) != -1 ? all.lastIndexOf(Extend) - 1 : all.length - 2; + if([E_Base, E_Base_GAZ].indexOf(all[previousNonExtendIndex]) != -1 && + all.slice(previousNonExtendIndex + 1, -1).every(function(c){return c == Extend}) && + next == E_Modifier){ + return NotBreak; + } + + // GB11. ZWJ ? (Glue_After_Zwj | EBG) + if(previous == ZWJ && [Glue_After_Zwj, E_Base_GAZ].indexOf(next) != -1) { + return NotBreak; + } + + // GB12. ^ (RI RI)* RI ? RI + // GB13. [^RI] (RI RI)* RI ? RI + if(mid.indexOf(Regional_Indicator) != -1) { + return Break; + } + if(previous == Regional_Indicator && next == Regional_Indicator) { + return NotBreak; + } + + // GB999. Any ? Any + return BreakStart; + } + + // Returns the next grapheme break in the string after the given index + this.nextBreak = function(string, index){ + if(index === undefined){ + index = 0; + } + if(index < 0){ + return 0; + } + if(index >= string.length - 1){ + return string.length; + } + var prev = getGraphemeBreakProperty(codePointAt(string, index)); + var mid = []; + for (var i = index + 1; i < string.length; i++) { + // check for already processed low surrogates + if(isSurrogate(string, i - 1)){ + continue; + } + + var next = getGraphemeBreakProperty(codePointAt(string, i)); + if(shouldBreak(prev, mid, next)){ + return i; + } + + mid.push(next); + } + return string.length; + }; + + // Breaks the given string into an array of grapheme cluster strings + this.splitGraphemes = function(str){ + var res = []; + var index = 0; + var brk; + while((brk = this.nextBreak(str, index)) < str.length){ + res.push(str.slice(index, brk)); + index = brk; + } + if(index < str.length){ + res.push(str.slice(index)); + } + return res; + }; + + // Returns the number of grapheme clusters there are in the given string + this.countGraphemes = function(str){ + var count = 0; + var index = 0; + var brk; + while((brk = this.nextBreak(str, index)) < str.length){ + index = brk; + count++; + } + if(index < str.length){ + count++; + } + return count; + }; + + //given a Unicode code point, determines this symbol's grapheme break property + function getGraphemeBreakProperty(code){ + + //grapheme break property for Unicode 10.0.0, + //taken from http://www.unicode.org/Public/10.0.0/ucd/auxiliary/GraphemeBreakProperty.txt + //and adapted to JavaScript rules + + if( + (0x0600 <= code && code <= 0x0605) || // Cf [6] ARABIC NUMBER SIGN..ARABIC NUMBER MARK ABOVE + 0x06DD == code || // Cf ARABIC END OF AYAH + 0x070F == code || // Cf SYRIAC ABBREVIATION MARK + 0x08E2 == code || // Cf ARABIC DISPUTED END OF AYAH + 0x0D4E == code || // Lo MALAYALAM LETTER DOT REPH + 0x110BD == code || // Cf KAITHI NUMBER SIGN + (0x111C2 <= code && code <= 0x111C3) || // Lo [2] SHARADA SIGN JIHVAMULIYA..SHARADA SIGN UPADHMANIYA + 0x11A3A == code || // Lo ZANABAZAR SQUARE CLUSTER-INITIAL LETTER RA + (0x11A86 <= code && code <= 0x11A89) || // Lo [4] SOYOMBO CLUSTER-INITIAL LETTER RA..SOYOMBO CLUSTER-INITIAL LETTER SA + 0x11D46 == code // Lo MASARAM GONDI REPHA + ){ + return Prepend; + } + if( + 0x000D == code // Cc + ){ + return CR; + } + + if( + 0x000A == code // Cc + ){ + return LF; + } + + + if( + (0x0000 <= code && code <= 0x0009) || // Cc [10] .. + (0x000B <= code && code <= 0x000C) || // Cc [2] .. + (0x000E <= code && code <= 0x001F) || // Cc [18] .. + (0x007F <= code && code <= 0x009F) || // Cc [33] .. + 0x00AD == code || // Cf SOFT HYPHEN + 0x061C == code || // Cf ARABIC LETTER MARK + + 0x180E == code || // Cf MONGOLIAN VOWEL SEPARATOR + 0x200B == code || // Cf ZERO WIDTH SPACE + (0x200E <= code && code <= 0x200F) || // Cf [2] LEFT-TO-RIGHT MARK..RIGHT-TO-LEFT MARK + 0x2028 == code || // Zl LINE SEPARATOR + 0x2029 == code || // Zp PARAGRAPH SEPARATOR + (0x202A <= code && code <= 0x202E) || // Cf [5] LEFT-TO-RIGHT EMBEDDING..RIGHT-TO-LEFT OVERRIDE + (0x2060 <= code && code <= 0x2064) || // Cf [5] WORD JOINER..INVISIBLE PLUS + 0x2065 == code || // Cn + (0x2066 <= code && code <= 0x206F) || // Cf [10] LEFT-TO-RIGHT ISOLATE..NOMINAL DIGIT SHAPES + (0xD800 <= code && code <= 0xDFFF) || // Cs [2048] .. + 0xFEFF == code || // Cf ZERO WIDTH NO-BREAK SPACE + (0xFFF0 <= code && code <= 0xFFF8) || // Cn [9] .. + (0xFFF9 <= code && code <= 0xFFFB) || // Cf [3] INTERLINEAR ANNOTATION ANCHOR..INTERLINEAR ANNOTATION TERMINATOR + (0x1BCA0 <= code && code <= 0x1BCA3) || // Cf [4] SHORTHAND FORMAT LETTER OVERLAP..SHORTHAND FORMAT UP STEP + (0x1D173 <= code && code <= 0x1D17A) || // Cf [8] MUSICAL SYMBOL BEGIN BEAM..MUSICAL SYMBOL END PHRASE + 0xE0000 == code || // Cn + 0xE0001 == code || // Cf LANGUAGE TAG + (0xE0002 <= code && code <= 0xE001F) || // Cn [30] .. + (0xE0080 <= code && code <= 0xE00FF) || // Cn [128] .. + (0xE01F0 <= code && code <= 0xE0FFF) // Cn [3600] .. + ){ + return Control; + } + + + if( + (0x0300 <= code && code <= 0x036F) || // Mn [112] COMBINING GRAVE ACCENT..COMBINING LATIN SMALL LETTER X + (0x0483 <= code && code <= 0x0487) || // Mn [5] COMBINING CYRILLIC TITLO..COMBINING CYRILLIC POKRYTIE + (0x0488 <= code && code <= 0x0489) || // Me [2] COMBINING CYRILLIC HUNDRED THOUSANDS SIGN..COMBINING CYRILLIC MILLIONS SIGN + (0x0591 <= code && code <= 0x05BD) || // Mn [45] HEBREW ACCENT ETNAHTA..HEBREW POINT METEG + 0x05BF == code || // Mn HEBREW POINT RAFE + (0x05C1 <= code && code <= 0x05C2) || // Mn [2] HEBREW POINT SHIN DOT..HEBREW POINT SIN DOT + (0x05C4 <= code && code <= 0x05C5) || // Mn [2] HEBREW MARK UPPER DOT..HEBREW MARK LOWER DOT + 0x05C7 == code || // Mn HEBREW POINT QAMATS QATAN + (0x0610 <= code && code <= 0x061A) || // Mn [11] ARABIC SIGN SALLALLAHOU ALAYHE WASSALLAM..ARABIC SMALL KASRA + (0x064B <= code && code <= 0x065F) || // Mn [21] ARABIC FATHATAN..ARABIC WAVY HAMZA BELOW + 0x0670 == code || // Mn ARABIC LETTER SUPERSCRIPT ALEF + (0x06D6 <= code && code <= 0x06DC) || // Mn [7] ARABIC SMALL HIGH LIGATURE SAD WITH LAM WITH ALEF MAKSURA..ARABIC SMALL HIGH SEEN + (0x06DF <= code && code <= 0x06E4) || // Mn [6] ARABIC SMALL HIGH ROUNDED ZERO..ARABIC SMALL HIGH MADDA + (0x06E7 <= code && code <= 0x06E8) || // Mn [2] ARABIC SMALL HIGH YEH..ARABIC SMALL HIGH NOON + (0x06EA <= code && code <= 0x06ED) || // Mn [4] ARABIC EMPTY CENTRE LOW STOP..ARABIC SMALL LOW MEEM + 0x0711 == code || // Mn SYRIAC LETTER SUPERSCRIPT ALAPH + (0x0730 <= code && code <= 0x074A) || // Mn [27] SYRIAC PTHAHA ABOVE..SYRIAC BARREKH + (0x07A6 <= code && code <= 0x07B0) || // Mn [11] THAANA ABAFILI..THAANA SUKUN + (0x07EB <= code && code <= 0x07F3) || // Mn [9] NKO COMBINING SHORT HIGH TONE..NKO COMBINING DOUBLE DOT ABOVE + (0x0816 <= code && code <= 0x0819) || // Mn [4] SAMARITAN MARK IN..SAMARITAN MARK DAGESH + (0x081B <= code && code <= 0x0823) || // Mn [9] SAMARITAN MARK EPENTHETIC YUT..SAMARITAN VOWEL SIGN A + (0x0825 <= code && code <= 0x0827) || // Mn [3] SAMARITAN VOWEL SIGN SHORT A..SAMARITAN VOWEL SIGN U + (0x0829 <= code && code <= 0x082D) || // Mn [5] SAMARITAN VOWEL SIGN LONG I..SAMARITAN MARK NEQUDAA + (0x0859 <= code && code <= 0x085B) || // Mn [3] MANDAIC AFFRICATION MARK..MANDAIC GEMINATION MARK + (0x08D4 <= code && code <= 0x08E1) || // Mn [14] ARABIC SMALL HIGH WORD AR-RUB..ARABIC SMALL HIGH SIGN SAFHA + (0x08E3 <= code && code <= 0x0902) || // Mn [32] ARABIC TURNED DAMMA BELOW..DEVANAGARI SIGN ANUSVARA + 0x093A == code || // Mn DEVANAGARI VOWEL SIGN OE + 0x093C == code || // Mn DEVANAGARI SIGN NUKTA + (0x0941 <= code && code <= 0x0948) || // Mn [8] DEVANAGARI VOWEL SIGN U..DEVANAGARI VOWEL SIGN AI + 0x094D == code || // Mn DEVANAGARI SIGN VIRAMA + (0x0951 <= code && code <= 0x0957) || // Mn [7] DEVANAGARI STRESS SIGN UDATTA..DEVANAGARI VOWEL SIGN UUE + (0x0962 <= code && code <= 0x0963) || // Mn [2] DEVANAGARI VOWEL SIGN VOCALIC L..DEVANAGARI VOWEL SIGN VOCALIC LL + 0x0981 == code || // Mn BENGALI SIGN CANDRABINDU + 0x09BC == code || // Mn BENGALI SIGN NUKTA + 0x09BE == code || // Mc BENGALI VOWEL SIGN AA + (0x09C1 <= code && code <= 0x09C4) || // Mn [4] BENGALI VOWEL SIGN U..BENGALI VOWEL SIGN VOCALIC RR + 0x09CD == code || // Mn BENGALI SIGN VIRAMA + 0x09D7 == code || // Mc BENGALI AU LENGTH MARK + (0x09E2 <= code && code <= 0x09E3) || // Mn [2] BENGALI VOWEL SIGN VOCALIC L..BENGALI VOWEL SIGN VOCALIC LL + (0x0A01 <= code && code <= 0x0A02) || // Mn [2] GURMUKHI SIGN ADAK BINDI..GURMUKHI SIGN BINDI + 0x0A3C == code || // Mn GURMUKHI SIGN NUKTA + (0x0A41 <= code && code <= 0x0A42) || // Mn [2] GURMUKHI VOWEL SIGN U..GURMUKHI VOWEL SIGN UU + (0x0A47 <= code && code <= 0x0A48) || // Mn [2] GURMUKHI VOWEL SIGN EE..GURMUKHI VOWEL SIGN AI + (0x0A4B <= code && code <= 0x0A4D) || // Mn [3] GURMUKHI VOWEL SIGN OO..GURMUKHI SIGN VIRAMA + 0x0A51 == code || // Mn GURMUKHI SIGN UDAAT + (0x0A70 <= code && code <= 0x0A71) || // Mn [2] GURMUKHI TIPPI..GURMUKHI ADDAK + 0x0A75 == code || // Mn GURMUKHI SIGN YAKASH + (0x0A81 <= code && code <= 0x0A82) || // Mn [2] GUJARATI SIGN CANDRABINDU..GUJARATI SIGN ANUSVARA + 0x0ABC == code || // Mn GUJARATI SIGN NUKTA + (0x0AC1 <= code && code <= 0x0AC5) || // Mn [5] GUJARATI VOWEL SIGN U..GUJARATI VOWEL SIGN CANDRA E + (0x0AC7 <= code && code <= 0x0AC8) || // Mn [2] GUJARATI VOWEL SIGN E..GUJARATI VOWEL SIGN AI + 0x0ACD == code || // Mn GUJARATI SIGN VIRAMA + (0x0AE2 <= code && code <= 0x0AE3) || // Mn [2] GUJARATI VOWEL SIGN VOCALIC L..GUJARATI VOWEL SIGN VOCALIC LL + (0x0AFA <= code && code <= 0x0AFF) || // Mn [6] GUJARATI SIGN SUKUN..GUJARATI SIGN TWO-CIRCLE NUKTA ABOVE + 0x0B01 == code || // Mn ORIYA SIGN CANDRABINDU + 0x0B3C == code || // Mn ORIYA SIGN NUKTA + 0x0B3E == code || // Mc ORIYA VOWEL SIGN AA + 0x0B3F == code || // Mn ORIYA VOWEL SIGN I + (0x0B41 <= code && code <= 0x0B44) || // Mn [4] ORIYA VOWEL SIGN U..ORIYA VOWEL SIGN VOCALIC RR + 0x0B4D == code || // Mn ORIYA SIGN VIRAMA + 0x0B56 == code || // Mn ORIYA AI LENGTH MARK + 0x0B57 == code || // Mc ORIYA AU LENGTH MARK + (0x0B62 <= code && code <= 0x0B63) || // Mn [2] ORIYA VOWEL SIGN VOCALIC L..ORIYA VOWEL SIGN VOCALIC LL + 0x0B82 == code || // Mn TAMIL SIGN ANUSVARA + 0x0BBE == code || // Mc TAMIL VOWEL SIGN AA + 0x0BC0 == code || // Mn TAMIL VOWEL SIGN II + 0x0BCD == code || // Mn TAMIL SIGN VIRAMA + 0x0BD7 == code || // Mc TAMIL AU LENGTH MARK + 0x0C00 == code || // Mn TELUGU SIGN COMBINING CANDRABINDU ABOVE + (0x0C3E <= code && code <= 0x0C40) || // Mn [3] TELUGU VOWEL SIGN AA..TELUGU VOWEL SIGN II + (0x0C46 <= code && code <= 0x0C48) || // Mn [3] TELUGU VOWEL SIGN E..TELUGU VOWEL SIGN AI + (0x0C4A <= code && code <= 0x0C4D) || // Mn [4] TELUGU VOWEL SIGN O..TELUGU SIGN VIRAMA + (0x0C55 <= code && code <= 0x0C56) || // Mn [2] TELUGU LENGTH MARK..TELUGU AI LENGTH MARK + (0x0C62 <= code && code <= 0x0C63) || // Mn [2] TELUGU VOWEL SIGN VOCALIC L..TELUGU VOWEL SIGN VOCALIC LL + 0x0C81 == code || // Mn KANNADA SIGN CANDRABINDU + 0x0CBC == code || // Mn KANNADA SIGN NUKTA + 0x0CBF == code || // Mn KANNADA VOWEL SIGN I + 0x0CC2 == code || // Mc KANNADA VOWEL SIGN UU + 0x0CC6 == code || // Mn KANNADA VOWEL SIGN E + (0x0CCC <= code && code <= 0x0CCD) || // Mn [2] KANNADA VOWEL SIGN AU..KANNADA SIGN VIRAMA + (0x0CD5 <= code && code <= 0x0CD6) || // Mc [2] KANNADA LENGTH MARK..KANNADA AI LENGTH MARK + (0x0CE2 <= code && code <= 0x0CE3) || // Mn [2] KANNADA VOWEL SIGN VOCALIC L..KANNADA VOWEL SIGN VOCALIC LL + (0x0D00 <= code && code <= 0x0D01) || // Mn [2] MALAYALAM SIGN COMBINING ANUSVARA ABOVE..MALAYALAM SIGN CANDRABINDU + (0x0D3B <= code && code <= 0x0D3C) || // Mn [2] MALAYALAM SIGN VERTICAL BAR VIRAMA..MALAYALAM SIGN CIRCULAR VIRAMA + 0x0D3E == code || // Mc MALAYALAM VOWEL SIGN AA + (0x0D41 <= code && code <= 0x0D44) || // Mn [4] MALAYALAM VOWEL SIGN U..MALAYALAM VOWEL SIGN VOCALIC RR + 0x0D4D == code || // Mn MALAYALAM SIGN VIRAMA + 0x0D57 == code || // Mc MALAYALAM AU LENGTH MARK + (0x0D62 <= code && code <= 0x0D63) || // Mn [2] MALAYALAM VOWEL SIGN VOCALIC L..MALAYALAM VOWEL SIGN VOCALIC LL + 0x0DCA == code || // Mn SINHALA SIGN AL-LAKUNA + 0x0DCF == code || // Mc SINHALA VOWEL SIGN AELA-PILLA + (0x0DD2 <= code && code <= 0x0DD4) || // Mn [3] SINHALA VOWEL SIGN KETTI IS-PILLA..SINHALA VOWEL SIGN KETTI PAA-PILLA + 0x0DD6 == code || // Mn SINHALA VOWEL SIGN DIGA PAA-PILLA + 0x0DDF == code || // Mc SINHALA VOWEL SIGN GAYANUKITTA + 0x0E31 == code || // Mn THAI CHARACTER MAI HAN-AKAT + (0x0E34 <= code && code <= 0x0E3A) || // Mn [7] THAI CHARACTER SARA I..THAI CHARACTER PHINTHU + (0x0E47 <= code && code <= 0x0E4E) || // Mn [8] THAI CHARACTER MAITAIKHU..THAI CHARACTER YAMAKKAN + 0x0EB1 == code || // Mn LAO VOWEL SIGN MAI KAN + (0x0EB4 <= code && code <= 0x0EB9) || // Mn [6] LAO VOWEL SIGN I..LAO VOWEL SIGN UU + (0x0EBB <= code && code <= 0x0EBC) || // Mn [2] LAO VOWEL SIGN MAI KON..LAO SEMIVOWEL SIGN LO + (0x0EC8 <= code && code <= 0x0ECD) || // Mn [6] LAO TONE MAI EK..LAO NIGGAHITA + (0x0F18 <= code && code <= 0x0F19) || // Mn [2] TIBETAN ASTROLOGICAL SIGN -KHYUD PA..TIBETAN ASTROLOGICAL SIGN SDONG TSHUGS + 0x0F35 == code || // Mn TIBETAN MARK NGAS BZUNG NYI ZLA + 0x0F37 == code || // Mn TIBETAN MARK NGAS BZUNG SGOR RTAGS + 0x0F39 == code || // Mn TIBETAN MARK TSA -PHRU + (0x0F71 <= code && code <= 0x0F7E) || // Mn [14] TIBETAN VOWEL SIGN AA..TIBETAN SIGN RJES SU NGA RO + (0x0F80 <= code && code <= 0x0F84) || // Mn [5] TIBETAN VOWEL SIGN REVERSED I..TIBETAN MARK HALANTA + (0x0F86 <= code && code <= 0x0F87) || // Mn [2] TIBETAN SIGN LCI RTAGS..TIBETAN SIGN YANG RTAGS + (0x0F8D <= code && code <= 0x0F97) || // Mn [11] TIBETAN SUBJOINED SIGN LCE TSA CAN..TIBETAN SUBJOINED LETTER JA + (0x0F99 <= code && code <= 0x0FBC) || // Mn [36] TIBETAN SUBJOINED LETTER NYA..TIBETAN SUBJOINED LETTER FIXED-FORM RA + 0x0FC6 == code || // Mn TIBETAN SYMBOL PADMA GDAN + (0x102D <= code && code <= 0x1030) || // Mn [4] MYANMAR VOWEL SIGN I..MYANMAR VOWEL SIGN UU + (0x1032 <= code && code <= 0x1037) || // Mn [6] MYANMAR VOWEL SIGN AI..MYANMAR SIGN DOT BELOW + (0x1039 <= code && code <= 0x103A) || // Mn [2] MYANMAR SIGN VIRAMA..MYANMAR SIGN ASAT + (0x103D <= code && code <= 0x103E) || // Mn [2] MYANMAR CONSONANT SIGN MEDIAL WA..MYANMAR CONSONANT SIGN MEDIAL HA + (0x1058 <= code && code <= 0x1059) || // Mn [2] MYANMAR VOWEL SIGN VOCALIC L..MYANMAR VOWEL SIGN VOCALIC LL + (0x105E <= code && code <= 0x1060) || // Mn [3] MYANMAR CONSONANT SIGN MON MEDIAL NA..MYANMAR CONSONANT SIGN MON MEDIAL LA + (0x1071 <= code && code <= 0x1074) || // Mn [4] MYANMAR VOWEL SIGN GEBA KAREN I..MYANMAR VOWEL SIGN KAYAH EE + 0x1082 == code || // Mn MYANMAR CONSONANT SIGN SHAN MEDIAL WA + (0x1085 <= code && code <= 0x1086) || // Mn [2] MYANMAR VOWEL SIGN SHAN E ABOVE..MYANMAR VOWEL SIGN SHAN FINAL Y + 0x108D == code || // Mn MYANMAR SIGN SHAN COUNCIL EMPHATIC TONE + 0x109D == code || // Mn MYANMAR VOWEL SIGN AITON AI + (0x135D <= code && code <= 0x135F) || // Mn [3] ETHIOPIC COMBINING GEMINATION AND VOWEL LENGTH MARK..ETHIOPIC COMBINING GEMINATION MARK + (0x1712 <= code && code <= 0x1714) || // Mn [3] TAGALOG VOWEL SIGN I..TAGALOG SIGN VIRAMA + (0x1732 <= code && code <= 0x1734) || // Mn [3] HANUNOO VOWEL SIGN I..HANUNOO SIGN PAMUDPOD + (0x1752 <= code && code <= 0x1753) || // Mn [2] BUHID VOWEL SIGN I..BUHID VOWEL SIGN U + (0x1772 <= code && code <= 0x1773) || // Mn [2] TAGBANWA VOWEL SIGN I..TAGBANWA VOWEL SIGN U + (0x17B4 <= code && code <= 0x17B5) || // Mn [2] KHMER VOWEL INHERENT AQ..KHMER VOWEL INHERENT AA + (0x17B7 <= code && code <= 0x17BD) || // Mn [7] KHMER VOWEL SIGN I..KHMER VOWEL SIGN UA + 0x17C6 == code || // Mn KHMER SIGN NIKAHIT + (0x17C9 <= code && code <= 0x17D3) || // Mn [11] KHMER SIGN MUUSIKATOAN..KHMER SIGN BATHAMASAT + 0x17DD == code || // Mn KHMER SIGN ATTHACAN + (0x180B <= code && code <= 0x180D) || // Mn [3] MONGOLIAN FREE VARIATION SELECTOR ONE..MONGOLIAN FREE VARIATION SELECTOR THREE + (0x1885 <= code && code <= 0x1886) || // Mn [2] MONGOLIAN LETTER ALI GALI BALUDA..MONGOLIAN LETTER ALI GALI THREE BALUDA + 0x18A9 == code || // Mn MONGOLIAN LETTER ALI GALI DAGALGA + (0x1920 <= code && code <= 0x1922) || // Mn [3] LIMBU VOWEL SIGN A..LIMBU VOWEL SIGN U + (0x1927 <= code && code <= 0x1928) || // Mn [2] LIMBU VOWEL SIGN E..LIMBU VOWEL SIGN O + 0x1932 == code || // Mn LIMBU SMALL LETTER ANUSVARA + (0x1939 <= code && code <= 0x193B) || // Mn [3] LIMBU SIGN MUKPHRENG..LIMBU SIGN SA-I + (0x1A17 <= code && code <= 0x1A18) || // Mn [2] BUGINESE VOWEL SIGN I..BUGINESE VOWEL SIGN U + 0x1A1B == code || // Mn BUGINESE VOWEL SIGN AE + 0x1A56 == code || // Mn TAI THAM CONSONANT SIGN MEDIAL LA + (0x1A58 <= code && code <= 0x1A5E) || // Mn [7] TAI THAM SIGN MAI KANG LAI..TAI THAM CONSONANT SIGN SA + 0x1A60 == code || // Mn TAI THAM SIGN SAKOT + 0x1A62 == code || // Mn TAI THAM VOWEL SIGN MAI SAT + (0x1A65 <= code && code <= 0x1A6C) || // Mn [8] TAI THAM VOWEL SIGN I..TAI THAM VOWEL SIGN OA BELOW + (0x1A73 <= code && code <= 0x1A7C) || // Mn [10] TAI THAM VOWEL SIGN OA ABOVE..TAI THAM SIGN KHUEN-LUE KARAN + 0x1A7F == code || // Mn TAI THAM COMBINING CRYPTOGRAMMIC DOT + (0x1AB0 <= code && code <= 0x1ABD) || // Mn [14] COMBINING DOUBLED CIRCUMFLEX ACCENT..COMBINING PARENTHESES BELOW + 0x1ABE == code || // Me COMBINING PARENTHESES OVERLAY + (0x1B00 <= code && code <= 0x1B03) || // Mn [4] BALINESE SIGN ULU RICEM..BALINESE SIGN SURANG + 0x1B34 == code || // Mn BALINESE SIGN REREKAN + (0x1B36 <= code && code <= 0x1B3A) || // Mn [5] BALINESE VOWEL SIGN ULU..BALINESE VOWEL SIGN RA REPA + 0x1B3C == code || // Mn BALINESE VOWEL SIGN LA LENGA + 0x1B42 == code || // Mn BALINESE VOWEL SIGN PEPET + (0x1B6B <= code && code <= 0x1B73) || // Mn [9] BALINESE MUSICAL SYMBOL COMBINING TEGEH..BALINESE MUSICAL SYMBOL COMBINING GONG + (0x1B80 <= code && code <= 0x1B81) || // Mn [2] SUNDANESE SIGN PANYECEK..SUNDANESE SIGN PANGLAYAR + (0x1BA2 <= code && code <= 0x1BA5) || // Mn [4] SUNDANESE CONSONANT SIGN PANYAKRA..SUNDANESE VOWEL SIGN PANYUKU + (0x1BA8 <= code && code <= 0x1BA9) || // Mn [2] SUNDANESE VOWEL SIGN PAMEPET..SUNDANESE VOWEL SIGN PANEULEUNG + (0x1BAB <= code && code <= 0x1BAD) || // Mn [3] SUNDANESE SIGN VIRAMA..SUNDANESE CONSONANT SIGN PASANGAN WA + 0x1BE6 == code || // Mn BATAK SIGN TOMPI + (0x1BE8 <= code && code <= 0x1BE9) || // Mn [2] BATAK VOWEL SIGN PAKPAK E..BATAK VOWEL SIGN EE + 0x1BED == code || // Mn BATAK VOWEL SIGN KARO O + (0x1BEF <= code && code <= 0x1BF1) || // Mn [3] BATAK VOWEL SIGN U FOR SIMALUNGUN SA..BATAK CONSONANT SIGN H + (0x1C2C <= code && code <= 0x1C33) || // Mn [8] LEPCHA VOWEL SIGN E..LEPCHA CONSONANT SIGN T + (0x1C36 <= code && code <= 0x1C37) || // Mn [2] LEPCHA SIGN RAN..LEPCHA SIGN NUKTA + (0x1CD0 <= code && code <= 0x1CD2) || // Mn [3] VEDIC TONE KARSHANA..VEDIC TONE PRENKHA + (0x1CD4 <= code && code <= 0x1CE0) || // Mn [13] VEDIC SIGN YAJURVEDIC MIDLINE SVARITA..VEDIC TONE RIGVEDIC KASHMIRI INDEPENDENT SVARITA + (0x1CE2 <= code && code <= 0x1CE8) || // Mn [7] VEDIC SIGN VISARGA SVARITA..VEDIC SIGN VISARGA ANUDATTA WITH TAIL + 0x1CED == code || // Mn VEDIC SIGN TIRYAK + 0x1CF4 == code || // Mn VEDIC TONE CANDRA ABOVE + (0x1CF8 <= code && code <= 0x1CF9) || // Mn [2] VEDIC TONE RING ABOVE..VEDIC TONE DOUBLE RING ABOVE + (0x1DC0 <= code && code <= 0x1DF9) || // Mn [58] COMBINING DOTTED GRAVE ACCENT..COMBINING WIDE INVERTED BRIDGE BELOW + (0x1DFB <= code && code <= 0x1DFF) || // Mn [5] COMBINING DELETION MARK..COMBINING RIGHT ARROWHEAD AND DOWN ARROWHEAD BELOW + 0x200C == code || // Cf ZERO WIDTH NON-JOINER + (0x20D0 <= code && code <= 0x20DC) || // Mn [13] COMBINING LEFT HARPOON ABOVE..COMBINING FOUR DOTS ABOVE + (0x20DD <= code && code <= 0x20E0) || // Me [4] COMBINING ENCLOSING CIRCLE..COMBINING ENCLOSING CIRCLE BACKSLASH + 0x20E1 == code || // Mn COMBINING LEFT RIGHT ARROW ABOVE + (0x20E2 <= code && code <= 0x20E4) || // Me [3] COMBINING ENCLOSING SCREEN..COMBINING ENCLOSING UPWARD POINTING TRIANGLE + (0x20E5 <= code && code <= 0x20F0) || // Mn [12] COMBINING REVERSE SOLIDUS OVERLAY..COMBINING ASTERISK ABOVE + (0x2CEF <= code && code <= 0x2CF1) || // Mn [3] COPTIC COMBINING NI ABOVE..COPTIC COMBINING SPIRITUS LENIS + 0x2D7F == code || // Mn TIFINAGH CONSONANT JOINER + (0x2DE0 <= code && code <= 0x2DFF) || // Mn [32] COMBINING CYRILLIC LETTER BE..COMBINING CYRILLIC LETTER IOTIFIED BIG YUS + (0x302A <= code && code <= 0x302D) || // Mn [4] IDEOGRAPHIC LEVEL TONE MARK..IDEOGRAPHIC ENTERING TONE MARK + (0x302E <= code && code <= 0x302F) || // Mc [2] HANGUL SINGLE DOT TONE MARK..HANGUL DOUBLE DOT TONE MARK + (0x3099 <= code && code <= 0x309A) || // Mn [2] COMBINING KATAKANA-HIRAGANA VOICED SOUND MARK..COMBINING KATAKANA-HIRAGANA SEMI-VOICED SOUND MARK + 0xA66F == code || // Mn COMBINING CYRILLIC VZMET + (0xA670 <= code && code <= 0xA672) || // Me [3] COMBINING CYRILLIC TEN MILLIONS SIGN..COMBINING CYRILLIC THOUSAND MILLIONS SIGN + (0xA674 <= code && code <= 0xA67D) || // Mn [10] COMBINING CYRILLIC LETTER UKRAINIAN IE..COMBINING CYRILLIC PAYEROK + (0xA69E <= code && code <= 0xA69F) || // Mn [2] COMBINING CYRILLIC LETTER EF..COMBINING CYRILLIC LETTER IOTIFIED E + (0xA6F0 <= code && code <= 0xA6F1) || // Mn [2] BAMUM COMBINING MARK KOQNDON..BAMUM COMBINING MARK TUKWENTIS + 0xA802 == code || // Mn SYLOTI NAGRI SIGN DVISVARA + 0xA806 == code || // Mn SYLOTI NAGRI SIGN HASANTA + 0xA80B == code || // Mn SYLOTI NAGRI SIGN ANUSVARA + (0xA825 <= code && code <= 0xA826) || // Mn [2] SYLOTI NAGRI VOWEL SIGN U..SYLOTI NAGRI VOWEL SIGN E + (0xA8C4 <= code && code <= 0xA8C5) || // Mn [2] SAURASHTRA SIGN VIRAMA..SAURASHTRA SIGN CANDRABINDU + (0xA8E0 <= code && code <= 0xA8F1) || // Mn [18] COMBINING DEVANAGARI DIGIT ZERO..COMBINING DEVANAGARI SIGN AVAGRAHA + (0xA926 <= code && code <= 0xA92D) || // Mn [8] KAYAH LI VOWEL UE..KAYAH LI TONE CALYA PLOPHU + (0xA947 <= code && code <= 0xA951) || // Mn [11] REJANG VOWEL SIGN I..REJANG CONSONANT SIGN R + (0xA980 <= code && code <= 0xA982) || // Mn [3] JAVANESE SIGN PANYANGGA..JAVANESE SIGN LAYAR + 0xA9B3 == code || // Mn JAVANESE SIGN CECAK TELU + (0xA9B6 <= code && code <= 0xA9B9) || // Mn [4] JAVANESE VOWEL SIGN WULU..JAVANESE VOWEL SIGN SUKU MENDUT + 0xA9BC == code || // Mn JAVANESE VOWEL SIGN PEPET + 0xA9E5 == code || // Mn MYANMAR SIGN SHAN SAW + (0xAA29 <= code && code <= 0xAA2E) || // Mn [6] CHAM VOWEL SIGN AA..CHAM VOWEL SIGN OE + (0xAA31 <= code && code <= 0xAA32) || // Mn [2] CHAM VOWEL SIGN AU..CHAM VOWEL SIGN UE + (0xAA35 <= code && code <= 0xAA36) || // Mn [2] CHAM CONSONANT SIGN LA..CHAM CONSONANT SIGN WA + 0xAA43 == code || // Mn CHAM CONSONANT SIGN FINAL NG + 0xAA4C == code || // Mn CHAM CONSONANT SIGN FINAL M + 0xAA7C == code || // Mn MYANMAR SIGN TAI LAING TONE-2 + 0xAAB0 == code || // Mn TAI VIET MAI KANG + (0xAAB2 <= code && code <= 0xAAB4) || // Mn [3] TAI VIET VOWEL I..TAI VIET VOWEL U + (0xAAB7 <= code && code <= 0xAAB8) || // Mn [2] TAI VIET MAI KHIT..TAI VIET VOWEL IA + (0xAABE <= code && code <= 0xAABF) || // Mn [2] TAI VIET VOWEL AM..TAI VIET TONE MAI EK + 0xAAC1 == code || // Mn TAI VIET TONE MAI THO + (0xAAEC <= code && code <= 0xAAED) || // Mn [2] MEETEI MAYEK VOWEL SIGN UU..MEETEI MAYEK VOWEL SIGN AAI + 0xAAF6 == code || // Mn MEETEI MAYEK VIRAMA + 0xABE5 == code || // Mn MEETEI MAYEK VOWEL SIGN ANAP + 0xABE8 == code || // Mn MEETEI MAYEK VOWEL SIGN UNAP + 0xABED == code || // Mn MEETEI MAYEK APUN IYEK + 0xFB1E == code || // Mn HEBREW POINT JUDEO-SPANISH VARIKA + (0xFE00 <= code && code <= 0xFE0F) || // Mn [16] VARIATION SELECTOR-1..VARIATION SELECTOR-16 + (0xFE20 <= code && code <= 0xFE2F) || // Mn [16] COMBINING LIGATURE LEFT HALF..COMBINING CYRILLIC TITLO RIGHT HALF + (0xFF9E <= code && code <= 0xFF9F) || // Lm [2] HALFWIDTH KATAKANA VOICED SOUND MARK..HALFWIDTH KATAKANA SEMI-VOICED SOUND MARK + 0x101FD == code || // Mn PHAISTOS DISC SIGN COMBINING OBLIQUE STROKE + 0x102E0 == code || // Mn COPTIC EPACT THOUSANDS MARK + (0x10376 <= code && code <= 0x1037A) || // Mn [5] COMBINING OLD PERMIC LETTER AN..COMBINING OLD PERMIC LETTER SII + (0x10A01 <= code && code <= 0x10A03) || // Mn [3] KHAROSHTHI VOWEL SIGN I..KHAROSHTHI VOWEL SIGN VOCALIC R + (0x10A05 <= code && code <= 0x10A06) || // Mn [2] KHAROSHTHI VOWEL SIGN E..KHAROSHTHI VOWEL SIGN O + (0x10A0C <= code && code <= 0x10A0F) || // Mn [4] KHAROSHTHI VOWEL LENGTH MARK..KHAROSHTHI SIGN VISARGA + (0x10A38 <= code && code <= 0x10A3A) || // Mn [3] KHAROSHTHI SIGN BAR ABOVE..KHAROSHTHI SIGN DOT BELOW + 0x10A3F == code || // Mn KHAROSHTHI VIRAMA + (0x10AE5 <= code && code <= 0x10AE6) || // Mn [2] MANICHAEAN ABBREVIATION MARK ABOVE..MANICHAEAN ABBREVIATION MARK BELOW + 0x11001 == code || // Mn BRAHMI SIGN ANUSVARA + (0x11038 <= code && code <= 0x11046) || // Mn [15] BRAHMI VOWEL SIGN AA..BRAHMI VIRAMA + (0x1107F <= code && code <= 0x11081) || // Mn [3] BRAHMI NUMBER JOINER..KAITHI SIGN ANUSVARA + (0x110B3 <= code && code <= 0x110B6) || // Mn [4] KAITHI VOWEL SIGN U..KAITHI VOWEL SIGN AI + (0x110B9 <= code && code <= 0x110BA) || // Mn [2] KAITHI SIGN VIRAMA..KAITHI SIGN NUKTA + (0x11100 <= code && code <= 0x11102) || // Mn [3] CHAKMA SIGN CANDRABINDU..CHAKMA SIGN VISARGA + (0x11127 <= code && code <= 0x1112B) || // Mn [5] CHAKMA VOWEL SIGN A..CHAKMA VOWEL SIGN UU + (0x1112D <= code && code <= 0x11134) || // Mn [8] CHAKMA VOWEL SIGN AI..CHAKMA MAAYYAA + 0x11173 == code || // Mn MAHAJANI SIGN NUKTA + (0x11180 <= code && code <= 0x11181) || // Mn [2] SHARADA SIGN CANDRABINDU..SHARADA SIGN ANUSVARA + (0x111B6 <= code && code <= 0x111BE) || // Mn [9] SHARADA VOWEL SIGN U..SHARADA VOWEL SIGN O + (0x111CA <= code && code <= 0x111CC) || // Mn [3] SHARADA SIGN NUKTA..SHARADA EXTRA SHORT VOWEL MARK + (0x1122F <= code && code <= 0x11231) || // Mn [3] KHOJKI VOWEL SIGN U..KHOJKI VOWEL SIGN AI + 0x11234 == code || // Mn KHOJKI SIGN ANUSVARA + (0x11236 <= code && code <= 0x11237) || // Mn [2] KHOJKI SIGN NUKTA..KHOJKI SIGN SHADDA + 0x1123E == code || // Mn KHOJKI SIGN SUKUN + 0x112DF == code || // Mn KHUDAWADI SIGN ANUSVARA + (0x112E3 <= code && code <= 0x112EA) || // Mn [8] KHUDAWADI VOWEL SIGN U..KHUDAWADI SIGN VIRAMA + (0x11300 <= code && code <= 0x11301) || // Mn [2] GRANTHA SIGN COMBINING ANUSVARA ABOVE..GRANTHA SIGN CANDRABINDU + 0x1133C == code || // Mn GRANTHA SIGN NUKTA + 0x1133E == code || // Mc GRANTHA VOWEL SIGN AA + 0x11340 == code || // Mn GRANTHA VOWEL SIGN II + 0x11357 == code || // Mc GRANTHA AU LENGTH MARK + (0x11366 <= code && code <= 0x1136C) || // Mn [7] COMBINING GRANTHA DIGIT ZERO..COMBINING GRANTHA DIGIT SIX + (0x11370 <= code && code <= 0x11374) || // Mn [5] COMBINING GRANTHA LETTER A..COMBINING GRANTHA LETTER PA + (0x11438 <= code && code <= 0x1143F) || // Mn [8] NEWA VOWEL SIGN U..NEWA VOWEL SIGN AI + (0x11442 <= code && code <= 0x11444) || // Mn [3] NEWA SIGN VIRAMA..NEWA SIGN ANUSVARA + 0x11446 == code || // Mn NEWA SIGN NUKTA + 0x114B0 == code || // Mc TIRHUTA VOWEL SIGN AA + (0x114B3 <= code && code <= 0x114B8) || // Mn [6] TIRHUTA VOWEL SIGN U..TIRHUTA VOWEL SIGN VOCALIC LL + 0x114BA == code || // Mn TIRHUTA VOWEL SIGN SHORT E + 0x114BD == code || // Mc TIRHUTA VOWEL SIGN SHORT O + (0x114BF <= code && code <= 0x114C0) || // Mn [2] TIRHUTA SIGN CANDRABINDU..TIRHUTA SIGN ANUSVARA + (0x114C2 <= code && code <= 0x114C3) || // Mn [2] TIRHUTA SIGN VIRAMA..TIRHUTA SIGN NUKTA + 0x115AF == code || // Mc SIDDHAM VOWEL SIGN AA + (0x115B2 <= code && code <= 0x115B5) || // Mn [4] SIDDHAM VOWEL SIGN U..SIDDHAM VOWEL SIGN VOCALIC RR + (0x115BC <= code && code <= 0x115BD) || // Mn [2] SIDDHAM SIGN CANDRABINDU..SIDDHAM SIGN ANUSVARA + (0x115BF <= code && code <= 0x115C0) || // Mn [2] SIDDHAM SIGN VIRAMA..SIDDHAM SIGN NUKTA + (0x115DC <= code && code <= 0x115DD) || // Mn [2] SIDDHAM VOWEL SIGN ALTERNATE U..SIDDHAM VOWEL SIGN ALTERNATE UU + (0x11633 <= code && code <= 0x1163A) || // Mn [8] MODI VOWEL SIGN U..MODI VOWEL SIGN AI + 0x1163D == code || // Mn MODI SIGN ANUSVARA + (0x1163F <= code && code <= 0x11640) || // Mn [2] MODI SIGN VIRAMA..MODI SIGN ARDHACANDRA + 0x116AB == code || // Mn TAKRI SIGN ANUSVARA + 0x116AD == code || // Mn TAKRI VOWEL SIGN AA + (0x116B0 <= code && code <= 0x116B5) || // Mn [6] TAKRI VOWEL SIGN U..TAKRI VOWEL SIGN AU + 0x116B7 == code || // Mn TAKRI SIGN NUKTA + (0x1171D <= code && code <= 0x1171F) || // Mn [3] AHOM CONSONANT SIGN MEDIAL LA..AHOM CONSONANT SIGN MEDIAL LIGATING RA + (0x11722 <= code && code <= 0x11725) || // Mn [4] AHOM VOWEL SIGN I..AHOM VOWEL SIGN UU + (0x11727 <= code && code <= 0x1172B) || // Mn [5] AHOM VOWEL SIGN AW..AHOM SIGN KILLER + (0x11A01 <= code && code <= 0x11A06) || // Mn [6] ZANABAZAR SQUARE VOWEL SIGN I..ZANABAZAR SQUARE VOWEL SIGN O + (0x11A09 <= code && code <= 0x11A0A) || // Mn [2] ZANABAZAR SQUARE VOWEL SIGN REVERSED I..ZANABAZAR SQUARE VOWEL LENGTH MARK + (0x11A33 <= code && code <= 0x11A38) || // Mn [6] ZANABAZAR SQUARE FINAL CONSONANT MARK..ZANABAZAR SQUARE SIGN ANUSVARA + (0x11A3B <= code && code <= 0x11A3E) || // Mn [4] ZANABAZAR SQUARE CLUSTER-FINAL LETTER YA..ZANABAZAR SQUARE CLUSTER-FINAL LETTER VA + 0x11A47 == code || // Mn ZANABAZAR SQUARE SUBJOINER + (0x11A51 <= code && code <= 0x11A56) || // Mn [6] SOYOMBO VOWEL SIGN I..SOYOMBO VOWEL SIGN OE + (0x11A59 <= code && code <= 0x11A5B) || // Mn [3] SOYOMBO VOWEL SIGN VOCALIC R..SOYOMBO VOWEL LENGTH MARK + (0x11A8A <= code && code <= 0x11A96) || // Mn [13] SOYOMBO FINAL CONSONANT SIGN G..SOYOMBO SIGN ANUSVARA + (0x11A98 <= code && code <= 0x11A99) || // Mn [2] SOYOMBO GEMINATION MARK..SOYOMBO SUBJOINER + (0x11C30 <= code && code <= 0x11C36) || // Mn [7] BHAIKSUKI VOWEL SIGN I..BHAIKSUKI VOWEL SIGN VOCALIC L + (0x11C38 <= code && code <= 0x11C3D) || // Mn [6] BHAIKSUKI VOWEL SIGN E..BHAIKSUKI SIGN ANUSVARA + 0x11C3F == code || // Mn BHAIKSUKI SIGN VIRAMA + (0x11C92 <= code && code <= 0x11CA7) || // Mn [22] MARCHEN SUBJOINED LETTER KA..MARCHEN SUBJOINED LETTER ZA + (0x11CAA <= code && code <= 0x11CB0) || // Mn [7] MARCHEN SUBJOINED LETTER RA..MARCHEN VOWEL SIGN AA + (0x11CB2 <= code && code <= 0x11CB3) || // Mn [2] MARCHEN VOWEL SIGN U..MARCHEN VOWEL SIGN E + (0x11CB5 <= code && code <= 0x11CB6) || // Mn [2] MARCHEN SIGN ANUSVARA..MARCHEN SIGN CANDRABINDU + (0x11D31 <= code && code <= 0x11D36) || // Mn [6] MASARAM GONDI VOWEL SIGN AA..MASARAM GONDI VOWEL SIGN VOCALIC R + 0x11D3A == code || // Mn MASARAM GONDI VOWEL SIGN E + (0x11D3C <= code && code <= 0x11D3D) || // Mn [2] MASARAM GONDI VOWEL SIGN AI..MASARAM GONDI VOWEL SIGN O + (0x11D3F <= code && code <= 0x11D45) || // Mn [7] MASARAM GONDI VOWEL SIGN AU..MASARAM GONDI VIRAMA + 0x11D47 == code || // Mn MASARAM GONDI RA-KARA + (0x16AF0 <= code && code <= 0x16AF4) || // Mn [5] BASSA VAH COMBINING HIGH TONE..BASSA VAH COMBINING HIGH-LOW TONE + (0x16B30 <= code && code <= 0x16B36) || // Mn [7] PAHAWH HMONG MARK CIM TUB..PAHAWH HMONG MARK CIM TAUM + (0x16F8F <= code && code <= 0x16F92) || // Mn [4] MIAO TONE RIGHT..MIAO TONE BELOW + (0x1BC9D <= code && code <= 0x1BC9E) || // Mn [2] DUPLOYAN THICK LETTER SELECTOR..DUPLOYAN DOUBLE MARK + 0x1D165 == code || // Mc MUSICAL SYMBOL COMBINING STEM + (0x1D167 <= code && code <= 0x1D169) || // Mn [3] MUSICAL SYMBOL COMBINING TREMOLO-1..MUSICAL SYMBOL COMBINING TREMOLO-3 + (0x1D16E <= code && code <= 0x1D172) || // Mc [5] MUSICAL SYMBOL COMBINING FLAG-1..MUSICAL SYMBOL COMBINING FLAG-5 + (0x1D17B <= code && code <= 0x1D182) || // Mn [8] MUSICAL SYMBOL COMBINING ACCENT..MUSICAL SYMBOL COMBINING LOURE + (0x1D185 <= code && code <= 0x1D18B) || // Mn [7] MUSICAL SYMBOL COMBINING DOIT..MUSICAL SYMBOL COMBINING TRIPLE TONGUE + (0x1D1AA <= code && code <= 0x1D1AD) || // Mn [4] MUSICAL SYMBOL COMBINING DOWN BOW..MUSICAL SYMBOL COMBINING SNAP PIZZICATO + (0x1D242 <= code && code <= 0x1D244) || // Mn [3] COMBINING GREEK MUSICAL TRISEME..COMBINING GREEK MUSICAL PENTASEME + (0x1DA00 <= code && code <= 0x1DA36) || // Mn [55] SIGNWRITING HEAD RIM..SIGNWRITING AIR SUCKING IN + (0x1DA3B <= code && code <= 0x1DA6C) || // Mn [50] SIGNWRITING MOUTH CLOSED NEUTRAL..SIGNWRITING EXCITEMENT + 0x1DA75 == code || // Mn SIGNWRITING UPPER BODY TILTING FROM HIP JOINTS + 0x1DA84 == code || // Mn SIGNWRITING LOCATION HEAD NECK + (0x1DA9B <= code && code <= 0x1DA9F) || // Mn [5] SIGNWRITING FILL MODIFIER-2..SIGNWRITING FILL MODIFIER-6 + (0x1DAA1 <= code && code <= 0x1DAAF) || // Mn [15] SIGNWRITING ROTATION MODIFIER-2..SIGNWRITING ROTATION MODIFIER-16 + (0x1E000 <= code && code <= 0x1E006) || // Mn [7] COMBINING GLAGOLITIC LETTER AZU..COMBINING GLAGOLITIC LETTER ZHIVETE + (0x1E008 <= code && code <= 0x1E018) || // Mn [17] COMBINING GLAGOLITIC LETTER ZEMLJA..COMBINING GLAGOLITIC LETTER HERU + (0x1E01B <= code && code <= 0x1E021) || // Mn [7] COMBINING GLAGOLITIC LETTER SHTA..COMBINING GLAGOLITIC LETTER YATI + (0x1E023 <= code && code <= 0x1E024) || // Mn [2] COMBINING GLAGOLITIC LETTER YU..COMBINING GLAGOLITIC LETTER SMALL YUS + (0x1E026 <= code && code <= 0x1E02A) || // Mn [5] COMBINING GLAGOLITIC LETTER YO..COMBINING GLAGOLITIC LETTER FITA + (0x1E8D0 <= code && code <= 0x1E8D6) || // Mn [7] MENDE KIKAKUI COMBINING NUMBER TEENS..MENDE KIKAKUI COMBINING NUMBER MILLIONS + (0x1E944 <= code && code <= 0x1E94A) || // Mn [7] ADLAM ALIF LENGTHENER..ADLAM NUKTA + (0xE0020 <= code && code <= 0xE007F) || // Cf [96] TAG SPACE..CANCEL TAG + (0xE0100 <= code && code <= 0xE01EF) // Mn [240] VARIATION SELECTOR-17..VARIATION SELECTOR-256 + ){ + return Extend; + } + + + if( + (0x1F1E6 <= code && code <= 0x1F1FF) // So [26] REGIONAL INDICATOR SYMBOL LETTER A..REGIONAL INDICATOR SYMBOL LETTER Z + ){ + return Regional_Indicator; + } + + if( + 0x0903 == code || // Mc DEVANAGARI SIGN VISARGA + 0x093B == code || // Mc DEVANAGARI VOWEL SIGN OOE + (0x093E <= code && code <= 0x0940) || // Mc [3] DEVANAGARI VOWEL SIGN AA..DEVANAGARI VOWEL SIGN II + (0x0949 <= code && code <= 0x094C) || // Mc [4] DEVANAGARI VOWEL SIGN CANDRA O..DEVANAGARI VOWEL SIGN AU + (0x094E <= code && code <= 0x094F) || // Mc [2] DEVANAGARI VOWEL SIGN PRISHTHAMATRA E..DEVANAGARI VOWEL SIGN AW + (0x0982 <= code && code <= 0x0983) || // Mc [2] BENGALI SIGN ANUSVARA..BENGALI SIGN VISARGA + (0x09BF <= code && code <= 0x09C0) || // Mc [2] BENGALI VOWEL SIGN I..BENGALI VOWEL SIGN II + (0x09C7 <= code && code <= 0x09C8) || // Mc [2] BENGALI VOWEL SIGN E..BENGALI VOWEL SIGN AI + (0x09CB <= code && code <= 0x09CC) || // Mc [2] BENGALI VOWEL SIGN O..BENGALI VOWEL SIGN AU + 0x0A03 == code || // Mc GURMUKHI SIGN VISARGA + (0x0A3E <= code && code <= 0x0A40) || // Mc [3] GURMUKHI VOWEL SIGN AA..GURMUKHI VOWEL SIGN II + 0x0A83 == code || // Mc GUJARATI SIGN VISARGA + (0x0ABE <= code && code <= 0x0AC0) || // Mc [3] GUJARATI VOWEL SIGN AA..GUJARATI VOWEL SIGN II + 0x0AC9 == code || // Mc GUJARATI VOWEL SIGN CANDRA O + (0x0ACB <= code && code <= 0x0ACC) || // Mc [2] GUJARATI VOWEL SIGN O..GUJARATI VOWEL SIGN AU + (0x0B02 <= code && code <= 0x0B03) || // Mc [2] ORIYA SIGN ANUSVARA..ORIYA SIGN VISARGA + 0x0B40 == code || // Mc ORIYA VOWEL SIGN II + (0x0B47 <= code && code <= 0x0B48) || // Mc [2] ORIYA VOWEL SIGN E..ORIYA VOWEL SIGN AI + (0x0B4B <= code && code <= 0x0B4C) || // Mc [2] ORIYA VOWEL SIGN O..ORIYA VOWEL SIGN AU + 0x0BBF == code || // Mc TAMIL VOWEL SIGN I + (0x0BC1 <= code && code <= 0x0BC2) || // Mc [2] TAMIL VOWEL SIGN U..TAMIL VOWEL SIGN UU + (0x0BC6 <= code && code <= 0x0BC8) || // Mc [3] TAMIL VOWEL SIGN E..TAMIL VOWEL SIGN AI + (0x0BCA <= code && code <= 0x0BCC) || // Mc [3] TAMIL VOWEL SIGN O..TAMIL VOWEL SIGN AU + (0x0C01 <= code && code <= 0x0C03) || // Mc [3] TELUGU SIGN CANDRABINDU..TELUGU SIGN VISARGA + (0x0C41 <= code && code <= 0x0C44) || // Mc [4] TELUGU VOWEL SIGN U..TELUGU VOWEL SIGN VOCALIC RR + (0x0C82 <= code && code <= 0x0C83) || // Mc [2] KANNADA SIGN ANUSVARA..KANNADA SIGN VISARGA + 0x0CBE == code || // Mc KANNADA VOWEL SIGN AA + (0x0CC0 <= code && code <= 0x0CC1) || // Mc [2] KANNADA VOWEL SIGN II..KANNADA VOWEL SIGN U + (0x0CC3 <= code && code <= 0x0CC4) || // Mc [2] KANNADA VOWEL SIGN VOCALIC R..KANNADA VOWEL SIGN VOCALIC RR + (0x0CC7 <= code && code <= 0x0CC8) || // Mc [2] KANNADA VOWEL SIGN EE..KANNADA VOWEL SIGN AI + (0x0CCA <= code && code <= 0x0CCB) || // Mc [2] KANNADA VOWEL SIGN O..KANNADA VOWEL SIGN OO + (0x0D02 <= code && code <= 0x0D03) || // Mc [2] MALAYALAM SIGN ANUSVARA..MALAYALAM SIGN VISARGA + (0x0D3F <= code && code <= 0x0D40) || // Mc [2] MALAYALAM VOWEL SIGN I..MALAYALAM VOWEL SIGN II + (0x0D46 <= code && code <= 0x0D48) || // Mc [3] MALAYALAM VOWEL SIGN E..MALAYALAM VOWEL SIGN AI + (0x0D4A <= code && code <= 0x0D4C) || // Mc [3] MALAYALAM VOWEL SIGN O..MALAYALAM VOWEL SIGN AU + (0x0D82 <= code && code <= 0x0D83) || // Mc [2] SINHALA SIGN ANUSVARAYA..SINHALA SIGN VISARGAYA + (0x0DD0 <= code && code <= 0x0DD1) || // Mc [2] SINHALA VOWEL SIGN KETTI AEDA-PILLA..SINHALA VOWEL SIGN DIGA AEDA-PILLA + (0x0DD8 <= code && code <= 0x0DDE) || // Mc [7] SINHALA VOWEL SIGN GAETTA-PILLA..SINHALA VOWEL SIGN KOMBUVA HAA GAYANUKITTA + (0x0DF2 <= code && code <= 0x0DF3) || // Mc [2] SINHALA VOWEL SIGN DIGA GAETTA-PILLA..SINHALA VOWEL SIGN DIGA GAYANUKITTA + 0x0E33 == code || // Lo THAI CHARACTER SARA AM + 0x0EB3 == code || // Lo LAO VOWEL SIGN AM + (0x0F3E <= code && code <= 0x0F3F) || // Mc [2] TIBETAN SIGN YAR TSHES..TIBETAN SIGN MAR TSHES + 0x0F7F == code || // Mc TIBETAN SIGN RNAM BCAD + 0x1031 == code || // Mc MYANMAR VOWEL SIGN E + (0x103B <= code && code <= 0x103C) || // Mc [2] MYANMAR CONSONANT SIGN MEDIAL YA..MYANMAR CONSONANT SIGN MEDIAL RA + (0x1056 <= code && code <= 0x1057) || // Mc [2] MYANMAR VOWEL SIGN VOCALIC R..MYANMAR VOWEL SIGN VOCALIC RR + 0x1084 == code || // Mc MYANMAR VOWEL SIGN SHAN E + 0x17B6 == code || // Mc KHMER VOWEL SIGN AA + (0x17BE <= code && code <= 0x17C5) || // Mc [8] KHMER VOWEL SIGN OE..KHMER VOWEL SIGN AU + (0x17C7 <= code && code <= 0x17C8) || // Mc [2] KHMER SIGN REAHMUK..KHMER SIGN YUUKALEAPINTU + (0x1923 <= code && code <= 0x1926) || // Mc [4] LIMBU VOWEL SIGN EE..LIMBU VOWEL SIGN AU + (0x1929 <= code && code <= 0x192B) || // Mc [3] LIMBU SUBJOINED LETTER YA..LIMBU SUBJOINED LETTER WA + (0x1930 <= code && code <= 0x1931) || // Mc [2] LIMBU SMALL LETTER KA..LIMBU SMALL LETTER NGA + (0x1933 <= code && code <= 0x1938) || // Mc [6] LIMBU SMALL LETTER TA..LIMBU SMALL LETTER LA + (0x1A19 <= code && code <= 0x1A1A) || // Mc [2] BUGINESE VOWEL SIGN E..BUGINESE VOWEL SIGN O + 0x1A55 == code || // Mc TAI THAM CONSONANT SIGN MEDIAL RA + 0x1A57 == code || // Mc TAI THAM CONSONANT SIGN LA TANG LAI + (0x1A6D <= code && code <= 0x1A72) || // Mc [6] TAI THAM VOWEL SIGN OY..TAI THAM VOWEL SIGN THAM AI + 0x1B04 == code || // Mc BALINESE SIGN BISAH + 0x1B35 == code || // Mc BALINESE VOWEL SIGN TEDUNG + 0x1B3B == code || // Mc BALINESE VOWEL SIGN RA REPA TEDUNG + (0x1B3D <= code && code <= 0x1B41) || // Mc [5] BALINESE VOWEL SIGN LA LENGA TEDUNG..BALINESE VOWEL SIGN TALING REPA TEDUNG + (0x1B43 <= code && code <= 0x1B44) || // Mc [2] BALINESE VOWEL SIGN PEPET TEDUNG..BALINESE ADEG ADEG + 0x1B82 == code || // Mc SUNDANESE SIGN PANGWISAD + 0x1BA1 == code || // Mc SUNDANESE CONSONANT SIGN PAMINGKAL + (0x1BA6 <= code && code <= 0x1BA7) || // Mc [2] SUNDANESE VOWEL SIGN PANAELAENG..SUNDANESE VOWEL SIGN PANOLONG + 0x1BAA == code || // Mc SUNDANESE SIGN PAMAAEH + 0x1BE7 == code || // Mc BATAK VOWEL SIGN E + (0x1BEA <= code && code <= 0x1BEC) || // Mc [3] BATAK VOWEL SIGN I..BATAK VOWEL SIGN O + 0x1BEE == code || // Mc BATAK VOWEL SIGN U + (0x1BF2 <= code && code <= 0x1BF3) || // Mc [2] BATAK PANGOLAT..BATAK PANONGONAN + (0x1C24 <= code && code <= 0x1C2B) || // Mc [8] LEPCHA SUBJOINED LETTER YA..LEPCHA VOWEL SIGN UU + (0x1C34 <= code && code <= 0x1C35) || // Mc [2] LEPCHA CONSONANT SIGN NYIN-DO..LEPCHA CONSONANT SIGN KANG + 0x1CE1 == code || // Mc VEDIC TONE ATHARVAVEDIC INDEPENDENT SVARITA + (0x1CF2 <= code && code <= 0x1CF3) || // Mc [2] VEDIC SIGN ARDHAVISARGA..VEDIC SIGN ROTATED ARDHAVISARGA + 0x1CF7 == code || // Mc VEDIC SIGN ATIKRAMA + (0xA823 <= code && code <= 0xA824) || // Mc [2] SYLOTI NAGRI VOWEL SIGN A..SYLOTI NAGRI VOWEL SIGN I + 0xA827 == code || // Mc SYLOTI NAGRI VOWEL SIGN OO + (0xA880 <= code && code <= 0xA881) || // Mc [2] SAURASHTRA SIGN ANUSVARA..SAURASHTRA SIGN VISARGA + (0xA8B4 <= code && code <= 0xA8C3) || // Mc [16] SAURASHTRA CONSONANT SIGN HAARU..SAURASHTRA VOWEL SIGN AU + (0xA952 <= code && code <= 0xA953) || // Mc [2] REJANG CONSONANT SIGN H..REJANG VIRAMA + 0xA983 == code || // Mc JAVANESE SIGN WIGNYAN + (0xA9B4 <= code && code <= 0xA9B5) || // Mc [2] JAVANESE VOWEL SIGN TARUNG..JAVANESE VOWEL SIGN TOLONG + (0xA9BA <= code && code <= 0xA9BB) || // Mc [2] JAVANESE VOWEL SIGN TALING..JAVANESE VOWEL SIGN DIRGA MURE + (0xA9BD <= code && code <= 0xA9C0) || // Mc [4] JAVANESE CONSONANT SIGN KERET..JAVANESE PANGKON + (0xAA2F <= code && code <= 0xAA30) || // Mc [2] CHAM VOWEL SIGN O..CHAM VOWEL SIGN AI + (0xAA33 <= code && code <= 0xAA34) || // Mc [2] CHAM CONSONANT SIGN YA..CHAM CONSONANT SIGN RA + 0xAA4D == code || // Mc CHAM CONSONANT SIGN FINAL H + 0xAAEB == code || // Mc MEETEI MAYEK VOWEL SIGN II + (0xAAEE <= code && code <= 0xAAEF) || // Mc [2] MEETEI MAYEK VOWEL SIGN AU..MEETEI MAYEK VOWEL SIGN AAU + 0xAAF5 == code || // Mc MEETEI MAYEK VOWEL SIGN VISARGA + (0xABE3 <= code && code <= 0xABE4) || // Mc [2] MEETEI MAYEK VOWEL SIGN ONAP..MEETEI MAYEK VOWEL SIGN INAP + (0xABE6 <= code && code <= 0xABE7) || // Mc [2] MEETEI MAYEK VOWEL SIGN YENAP..MEETEI MAYEK VOWEL SIGN SOUNAP + (0xABE9 <= code && code <= 0xABEA) || // Mc [2] MEETEI MAYEK VOWEL SIGN CHEINAP..MEETEI MAYEK VOWEL SIGN NUNG + 0xABEC == code || // Mc MEETEI MAYEK LUM IYEK + 0x11000 == code || // Mc BRAHMI SIGN CANDRABINDU + 0x11002 == code || // Mc BRAHMI SIGN VISARGA + 0x11082 == code || // Mc KAITHI SIGN VISARGA + (0x110B0 <= code && code <= 0x110B2) || // Mc [3] KAITHI VOWEL SIGN AA..KAITHI VOWEL SIGN II + (0x110B7 <= code && code <= 0x110B8) || // Mc [2] KAITHI VOWEL SIGN O..KAITHI VOWEL SIGN AU + 0x1112C == code || // Mc CHAKMA VOWEL SIGN E + 0x11182 == code || // Mc SHARADA SIGN VISARGA + (0x111B3 <= code && code <= 0x111B5) || // Mc [3] SHARADA VOWEL SIGN AA..SHARADA VOWEL SIGN II + (0x111BF <= code && code <= 0x111C0) || // Mc [2] SHARADA VOWEL SIGN AU..SHARADA SIGN VIRAMA + (0x1122C <= code && code <= 0x1122E) || // Mc [3] KHOJKI VOWEL SIGN AA..KHOJKI VOWEL SIGN II + (0x11232 <= code && code <= 0x11233) || // Mc [2] KHOJKI VOWEL SIGN O..KHOJKI VOWEL SIGN AU + 0x11235 == code || // Mc KHOJKI SIGN VIRAMA + (0x112E0 <= code && code <= 0x112E2) || // Mc [3] KHUDAWADI VOWEL SIGN AA..KHUDAWADI VOWEL SIGN II + (0x11302 <= code && code <= 0x11303) || // Mc [2] GRANTHA SIGN ANUSVARA..GRANTHA SIGN VISARGA + 0x1133F == code || // Mc GRANTHA VOWEL SIGN I + (0x11341 <= code && code <= 0x11344) || // Mc [4] GRANTHA VOWEL SIGN U..GRANTHA VOWEL SIGN VOCALIC RR + (0x11347 <= code && code <= 0x11348) || // Mc [2] GRANTHA VOWEL SIGN EE..GRANTHA VOWEL SIGN AI + (0x1134B <= code && code <= 0x1134D) || // Mc [3] GRANTHA VOWEL SIGN OO..GRANTHA SIGN VIRAMA + (0x11362 <= code && code <= 0x11363) || // Mc [2] GRANTHA VOWEL SIGN VOCALIC L..GRANTHA VOWEL SIGN VOCALIC LL + (0x11435 <= code && code <= 0x11437) || // Mc [3] NEWA VOWEL SIGN AA..NEWA VOWEL SIGN II + (0x11440 <= code && code <= 0x11441) || // Mc [2] NEWA VOWEL SIGN O..NEWA VOWEL SIGN AU + 0x11445 == code || // Mc NEWA SIGN VISARGA + (0x114B1 <= code && code <= 0x114B2) || // Mc [2] TIRHUTA VOWEL SIGN I..TIRHUTA VOWEL SIGN II + 0x114B9 == code || // Mc TIRHUTA VOWEL SIGN E + (0x114BB <= code && code <= 0x114BC) || // Mc [2] TIRHUTA VOWEL SIGN AI..TIRHUTA VOWEL SIGN O + 0x114BE == code || // Mc TIRHUTA VOWEL SIGN AU + 0x114C1 == code || // Mc TIRHUTA SIGN VISARGA + (0x115B0 <= code && code <= 0x115B1) || // Mc [2] SIDDHAM VOWEL SIGN I..SIDDHAM VOWEL SIGN II + (0x115B8 <= code && code <= 0x115BB) || // Mc [4] SIDDHAM VOWEL SIGN E..SIDDHAM VOWEL SIGN AU + 0x115BE == code || // Mc SIDDHAM SIGN VISARGA + (0x11630 <= code && code <= 0x11632) || // Mc [3] MODI VOWEL SIGN AA..MODI VOWEL SIGN II + (0x1163B <= code && code <= 0x1163C) || // Mc [2] MODI VOWEL SIGN O..MODI VOWEL SIGN AU + 0x1163E == code || // Mc MODI SIGN VISARGA + 0x116AC == code || // Mc TAKRI SIGN VISARGA + (0x116AE <= code && code <= 0x116AF) || // Mc [2] TAKRI VOWEL SIGN I..TAKRI VOWEL SIGN II + 0x116B6 == code || // Mc TAKRI SIGN VIRAMA + (0x11720 <= code && code <= 0x11721) || // Mc [2] AHOM VOWEL SIGN A..AHOM VOWEL SIGN AA + 0x11726 == code || // Mc AHOM VOWEL SIGN E + (0x11A07 <= code && code <= 0x11A08) || // Mc [2] ZANABAZAR SQUARE VOWEL SIGN AI..ZANABAZAR SQUARE VOWEL SIGN AU + 0x11A39 == code || // Mc ZANABAZAR SQUARE SIGN VISARGA + (0x11A57 <= code && code <= 0x11A58) || // Mc [2] SOYOMBO VOWEL SIGN AI..SOYOMBO VOWEL SIGN AU + 0x11A97 == code || // Mc SOYOMBO SIGN VISARGA + 0x11C2F == code || // Mc BHAIKSUKI VOWEL SIGN AA + 0x11C3E == code || // Mc BHAIKSUKI SIGN VISARGA + 0x11CA9 == code || // Mc MARCHEN SUBJOINED LETTER YA + 0x11CB1 == code || // Mc MARCHEN VOWEL SIGN I + 0x11CB4 == code || // Mc MARCHEN VOWEL SIGN O + (0x16F51 <= code && code <= 0x16F7E) || // Mc [46] MIAO SIGN ASPIRATION..MIAO VOWEL SIGN NG + 0x1D166 == code || // Mc MUSICAL SYMBOL COMBINING SPRECHGESANG STEM + 0x1D16D == code // Mc MUSICAL SYMBOL COMBINING AUGMENTATION DOT + ){ + return SpacingMark; + } + + + if( + (0x1100 <= code && code <= 0x115F) || // Lo [96] HANGUL CHOSEONG KIYEOK..HANGUL CHOSEONG FILLER + (0xA960 <= code && code <= 0xA97C) // Lo [29] HANGUL CHOSEONG TIKEUT-MIEUM..HANGUL CHOSEONG SSANGYEORINHIEUH + ){ + return L; + } + + if( + (0x1160 <= code && code <= 0x11A7) || // Lo [72] HANGUL JUNGSEONG FILLER..HANGUL JUNGSEONG O-YAE + (0xD7B0 <= code && code <= 0xD7C6) // Lo [23] HANGUL JUNGSEONG O-YEO..HANGUL JUNGSEONG ARAEA-E + ){ + return V; + } + + + if( + (0x11A8 <= code && code <= 0x11FF) || // Lo [88] HANGUL JONGSEONG KIYEOK..HANGUL JONGSEONG SSANGNIEUN + (0xD7CB <= code && code <= 0xD7FB) // Lo [49] HANGUL JONGSEONG NIEUN-RIEUL..HANGUL JONGSEONG PHIEUPH-THIEUTH + ){ + return T; + } + + if( + 0xAC00 == code || // Lo HANGUL SYLLABLE GA + 0xAC1C == code || // Lo HANGUL SYLLABLE GAE + 0xAC38 == code || // Lo HANGUL SYLLABLE GYA + 0xAC54 == code || // Lo HANGUL SYLLABLE GYAE + 0xAC70 == code || // Lo HANGUL SYLLABLE GEO + 0xAC8C == code || // Lo HANGUL SYLLABLE GE + 0xACA8 == code || // Lo HANGUL SYLLABLE GYEO + 0xACC4 == code || // Lo HANGUL SYLLABLE GYE + 0xACE0 == code || // Lo HANGUL SYLLABLE GO + 0xACFC == code || // Lo HANGUL SYLLABLE GWA + 0xAD18 == code || // Lo HANGUL SYLLABLE GWAE + 0xAD34 == code || // Lo HANGUL SYLLABLE GOE + 0xAD50 == code || // Lo HANGUL SYLLABLE GYO + 0xAD6C == code || // Lo HANGUL SYLLABLE GU + 0xAD88 == code || // Lo HANGUL SYLLABLE GWEO + 0xADA4 == code || // Lo HANGUL SYLLABLE GWE + 0xADC0 == code || // Lo HANGUL SYLLABLE GWI + 0xADDC == code || // Lo HANGUL SYLLABLE GYU + 0xADF8 == code || // Lo HANGUL SYLLABLE GEU + 0xAE14 == code || // Lo HANGUL SYLLABLE GYI + 0xAE30 == code || // Lo HANGUL SYLLABLE GI + 0xAE4C == code || // Lo HANGUL SYLLABLE GGA + 0xAE68 == code || // Lo HANGUL SYLLABLE GGAE + 0xAE84 == code || // Lo HANGUL SYLLABLE GGYA + 0xAEA0 == code || // Lo HANGUL SYLLABLE GGYAE + 0xAEBC == code || // Lo HANGUL SYLLABLE GGEO + 0xAED8 == code || // Lo HANGUL SYLLABLE GGE + 0xAEF4 == code || // Lo HANGUL SYLLABLE GGYEO + 0xAF10 == code || // Lo HANGUL SYLLABLE GGYE + 0xAF2C == code || // Lo HANGUL SYLLABLE GGO + 0xAF48 == code || // Lo HANGUL SYLLABLE GGWA + 0xAF64 == code || // Lo HANGUL SYLLABLE GGWAE + 0xAF80 == code || // Lo HANGUL SYLLABLE GGOE + 0xAF9C == code || // Lo HANGUL SYLLABLE GGYO + 0xAFB8 == code || // Lo HANGUL SYLLABLE GGU + 0xAFD4 == code || // Lo HANGUL SYLLABLE GGWEO + 0xAFF0 == code || // Lo HANGUL SYLLABLE GGWE + 0xB00C == code || // Lo HANGUL SYLLABLE GGWI + 0xB028 == code || // Lo HANGUL SYLLABLE GGYU + 0xB044 == code || // Lo HANGUL SYLLABLE GGEU + 0xB060 == code || // Lo HANGUL SYLLABLE GGYI + 0xB07C == code || // Lo HANGUL SYLLABLE GGI + 0xB098 == code || // Lo HANGUL SYLLABLE NA + 0xB0B4 == code || // Lo HANGUL SYLLABLE NAE + 0xB0D0 == code || // Lo HANGUL SYLLABLE NYA + 0xB0EC == code || // Lo HANGUL SYLLABLE NYAE + 0xB108 == code || // Lo HANGUL SYLLABLE NEO + 0xB124 == code || // Lo HANGUL SYLLABLE NE + 0xB140 == code || // Lo HANGUL SYLLABLE NYEO + 0xB15C == code || // Lo HANGUL SYLLABLE NYE + 0xB178 == code || // Lo HANGUL SYLLABLE NO + 0xB194 == code || // Lo HANGUL SYLLABLE NWA + 0xB1B0 == code || // Lo HANGUL SYLLABLE NWAE + 0xB1CC == code || // Lo HANGUL SYLLABLE NOE + 0xB1E8 == code || // Lo HANGUL SYLLABLE NYO + 0xB204 == code || // Lo HANGUL SYLLABLE NU + 0xB220 == code || // Lo HANGUL SYLLABLE NWEO + 0xB23C == code || // Lo HANGUL SYLLABLE NWE + 0xB258 == code || // Lo HANGUL SYLLABLE NWI + 0xB274 == code || // Lo HANGUL SYLLABLE NYU + 0xB290 == code || // Lo HANGUL SYLLABLE NEU + 0xB2AC == code || // Lo HANGUL SYLLABLE NYI + 0xB2C8 == code || // Lo HANGUL SYLLABLE NI + 0xB2E4 == code || // Lo HANGUL SYLLABLE DA + 0xB300 == code || // Lo HANGUL SYLLABLE DAE + 0xB31C == code || // Lo HANGUL SYLLABLE DYA + 0xB338 == code || // Lo HANGUL SYLLABLE DYAE + 0xB354 == code || // Lo HANGUL SYLLABLE DEO + 0xB370 == code || // Lo HANGUL SYLLABLE DE + 0xB38C == code || // Lo HANGUL SYLLABLE DYEO + 0xB3A8 == code || // Lo HANGUL SYLLABLE DYE + 0xB3C4 == code || // Lo HANGUL SYLLABLE DO + 0xB3E0 == code || // Lo HANGUL SYLLABLE DWA + 0xB3FC == code || // Lo HANGUL SYLLABLE DWAE + 0xB418 == code || // Lo HANGUL SYLLABLE DOE + 0xB434 == code || // Lo HANGUL SYLLABLE DYO + 0xB450 == code || // Lo HANGUL SYLLABLE DU + 0xB46C == code || // Lo HANGUL SYLLABLE DWEO + 0xB488 == code || // Lo HANGUL SYLLABLE DWE + 0xB4A4 == code || // Lo HANGUL SYLLABLE DWI + 0xB4C0 == code || // Lo HANGUL SYLLABLE DYU + 0xB4DC == code || // Lo HANGUL SYLLABLE DEU + 0xB4F8 == code || // Lo HANGUL SYLLABLE DYI + 0xB514 == code || // Lo HANGUL SYLLABLE DI + 0xB530 == code || // Lo HANGUL SYLLABLE DDA + 0xB54C == code || // Lo HANGUL SYLLABLE DDAE + 0xB568 == code || // Lo HANGUL SYLLABLE DDYA + 0xB584 == code || // Lo HANGUL SYLLABLE DDYAE + 0xB5A0 == code || // Lo HANGUL SYLLABLE DDEO + 0xB5BC == code || // Lo HANGUL SYLLABLE DDE + 0xB5D8 == code || // Lo HANGUL SYLLABLE DDYEO + 0xB5F4 == code || // Lo HANGUL SYLLABLE DDYE + 0xB610 == code || // Lo HANGUL SYLLABLE DDO + 0xB62C == code || // Lo HANGUL SYLLABLE DDWA + 0xB648 == code || // Lo HANGUL SYLLABLE DDWAE + 0xB664 == code || // Lo HANGUL SYLLABLE DDOE + 0xB680 == code || // Lo HANGUL SYLLABLE DDYO + 0xB69C == code || // Lo HANGUL SYLLABLE DDU + 0xB6B8 == code || // Lo HANGUL SYLLABLE DDWEO + 0xB6D4 == code || // Lo HANGUL SYLLABLE DDWE + 0xB6F0 == code || // Lo HANGUL SYLLABLE DDWI + 0xB70C == code || // Lo HANGUL SYLLABLE DDYU + 0xB728 == code || // Lo HANGUL SYLLABLE DDEU + 0xB744 == code || // Lo HANGUL SYLLABLE DDYI + 0xB760 == code || // Lo HANGUL SYLLABLE DDI + 0xB77C == code || // Lo HANGUL SYLLABLE RA + 0xB798 == code || // Lo HANGUL SYLLABLE RAE + 0xB7B4 == code || // Lo HANGUL SYLLABLE RYA + 0xB7D0 == code || // Lo HANGUL SYLLABLE RYAE + 0xB7EC == code || // Lo HANGUL SYLLABLE REO + 0xB808 == code || // Lo HANGUL SYLLABLE RE + 0xB824 == code || // Lo HANGUL SYLLABLE RYEO + 0xB840 == code || // Lo HANGUL SYLLABLE RYE + 0xB85C == code || // Lo HANGUL SYLLABLE RO + 0xB878 == code || // Lo HANGUL SYLLABLE RWA + 0xB894 == code || // Lo HANGUL SYLLABLE RWAE + 0xB8B0 == code || // Lo HANGUL SYLLABLE ROE + 0xB8CC == code || // Lo HANGUL SYLLABLE RYO + 0xB8E8 == code || // Lo HANGUL SYLLABLE RU + 0xB904 == code || // Lo HANGUL SYLLABLE RWEO + 0xB920 == code || // Lo HANGUL SYLLABLE RWE + 0xB93C == code || // Lo HANGUL SYLLABLE RWI + 0xB958 == code || // Lo HANGUL SYLLABLE RYU + 0xB974 == code || // Lo HANGUL SYLLABLE REU + 0xB990 == code || // Lo HANGUL SYLLABLE RYI + 0xB9AC == code || // Lo HANGUL SYLLABLE RI + 0xB9C8 == code || // Lo HANGUL SYLLABLE MA + 0xB9E4 == code || // Lo HANGUL SYLLABLE MAE + 0xBA00 == code || // Lo HANGUL SYLLABLE MYA + 0xBA1C == code || // Lo HANGUL SYLLABLE MYAE + 0xBA38 == code || // Lo HANGUL SYLLABLE MEO + 0xBA54 == code || // Lo HANGUL SYLLABLE ME + 0xBA70 == code || // Lo HANGUL SYLLABLE MYEO + 0xBA8C == code || // Lo HANGUL SYLLABLE MYE + 0xBAA8 == code || // Lo HANGUL SYLLABLE MO + 0xBAC4 == code || // Lo HANGUL SYLLABLE MWA + 0xBAE0 == code || // Lo HANGUL SYLLABLE MWAE + 0xBAFC == code || // Lo HANGUL SYLLABLE MOE + 0xBB18 == code || // Lo HANGUL SYLLABLE MYO + 0xBB34 == code || // Lo HANGUL SYLLABLE MU + 0xBB50 == code || // Lo HANGUL SYLLABLE MWEO + 0xBB6C == code || // Lo HANGUL SYLLABLE MWE + 0xBB88 == code || // Lo HANGUL SYLLABLE MWI + 0xBBA4 == code || // Lo HANGUL SYLLABLE MYU + 0xBBC0 == code || // Lo HANGUL SYLLABLE MEU + 0xBBDC == code || // Lo HANGUL SYLLABLE MYI + 0xBBF8 == code || // Lo HANGUL SYLLABLE MI + 0xBC14 == code || // Lo HANGUL SYLLABLE BA + 0xBC30 == code || // Lo HANGUL SYLLABLE BAE + 0xBC4C == code || // Lo HANGUL SYLLABLE BYA + 0xBC68 == code || // Lo HANGUL SYLLABLE BYAE + 0xBC84 == code || // Lo HANGUL SYLLABLE BEO + 0xBCA0 == code || // Lo HANGUL SYLLABLE BE + 0xBCBC == code || // Lo HANGUL SYLLABLE BYEO + 0xBCD8 == code || // Lo HANGUL SYLLABLE BYE + 0xBCF4 == code || // Lo HANGUL SYLLABLE BO + 0xBD10 == code || // Lo HANGUL SYLLABLE BWA + 0xBD2C == code || // Lo HANGUL SYLLABLE BWAE + 0xBD48 == code || // Lo HANGUL SYLLABLE BOE + 0xBD64 == code || // Lo HANGUL SYLLABLE BYO + 0xBD80 == code || // Lo HANGUL SYLLABLE BU + 0xBD9C == code || // Lo HANGUL SYLLABLE BWEO + 0xBDB8 == code || // Lo HANGUL SYLLABLE BWE + 0xBDD4 == code || // Lo HANGUL SYLLABLE BWI + 0xBDF0 == code || // Lo HANGUL SYLLABLE BYU + 0xBE0C == code || // Lo HANGUL SYLLABLE BEU + 0xBE28 == code || // Lo HANGUL SYLLABLE BYI + 0xBE44 == code || // Lo HANGUL SYLLABLE BI + 0xBE60 == code || // Lo HANGUL SYLLABLE BBA + 0xBE7C == code || // Lo HANGUL SYLLABLE BBAE + 0xBE98 == code || // Lo HANGUL SYLLABLE BBYA + 0xBEB4 == code || // Lo HANGUL SYLLABLE BBYAE + 0xBED0 == code || // Lo HANGUL SYLLABLE BBEO + 0xBEEC == code || // Lo HANGUL SYLLABLE BBE + 0xBF08 == code || // Lo HANGUL SYLLABLE BBYEO + 0xBF24 == code || // Lo HANGUL SYLLABLE BBYE + 0xBF40 == code || // Lo HANGUL SYLLABLE BBO + 0xBF5C == code || // Lo HANGUL SYLLABLE BBWA + 0xBF78 == code || // Lo HANGUL SYLLABLE BBWAE + 0xBF94 == code || // Lo HANGUL SYLLABLE BBOE + 0xBFB0 == code || // Lo HANGUL SYLLABLE BBYO + 0xBFCC == code || // Lo HANGUL SYLLABLE BBU + 0xBFE8 == code || // Lo HANGUL SYLLABLE BBWEO + 0xC004 == code || // Lo HANGUL SYLLABLE BBWE + 0xC020 == code || // Lo HANGUL SYLLABLE BBWI + 0xC03C == code || // Lo HANGUL SYLLABLE BBYU + 0xC058 == code || // Lo HANGUL SYLLABLE BBEU + 0xC074 == code || // Lo HANGUL SYLLABLE BBYI + 0xC090 == code || // Lo HANGUL SYLLABLE BBI + 0xC0AC == code || // Lo HANGUL SYLLABLE SA + 0xC0C8 == code || // Lo HANGUL SYLLABLE SAE + 0xC0E4 == code || // Lo HANGUL SYLLABLE SYA + 0xC100 == code || // Lo HANGUL SYLLABLE SYAE + 0xC11C == code || // Lo HANGUL SYLLABLE SEO + 0xC138 == code || // Lo HANGUL SYLLABLE SE + 0xC154 == code || // Lo HANGUL SYLLABLE SYEO + 0xC170 == code || // Lo HANGUL SYLLABLE SYE + 0xC18C == code || // Lo HANGUL SYLLABLE SO + 0xC1A8 == code || // Lo HANGUL SYLLABLE SWA + 0xC1C4 == code || // Lo HANGUL SYLLABLE SWAE + 0xC1E0 == code || // Lo HANGUL SYLLABLE SOE + 0xC1FC == code || // Lo HANGUL SYLLABLE SYO + 0xC218 == code || // Lo HANGUL SYLLABLE SU + 0xC234 == code || // Lo HANGUL SYLLABLE SWEO + 0xC250 == code || // Lo HANGUL SYLLABLE SWE + 0xC26C == code || // Lo HANGUL SYLLABLE SWI + 0xC288 == code || // Lo HANGUL SYLLABLE SYU + 0xC2A4 == code || // Lo HANGUL SYLLABLE SEU + 0xC2C0 == code || // Lo HANGUL SYLLABLE SYI + 0xC2DC == code || // Lo HANGUL SYLLABLE SI + 0xC2F8 == code || // Lo HANGUL SYLLABLE SSA + 0xC314 == code || // Lo HANGUL SYLLABLE SSAE + 0xC330 == code || // Lo HANGUL SYLLABLE SSYA + 0xC34C == code || // Lo HANGUL SYLLABLE SSYAE + 0xC368 == code || // Lo HANGUL SYLLABLE SSEO + 0xC384 == code || // Lo HANGUL SYLLABLE SSE + 0xC3A0 == code || // Lo HANGUL SYLLABLE SSYEO + 0xC3BC == code || // Lo HANGUL SYLLABLE SSYE + 0xC3D8 == code || // Lo HANGUL SYLLABLE SSO + 0xC3F4 == code || // Lo HANGUL SYLLABLE SSWA + 0xC410 == code || // Lo HANGUL SYLLABLE SSWAE + 0xC42C == code || // Lo HANGUL SYLLABLE SSOE + 0xC448 == code || // Lo HANGUL SYLLABLE SSYO + 0xC464 == code || // Lo HANGUL SYLLABLE SSU + 0xC480 == code || // Lo HANGUL SYLLABLE SSWEO + 0xC49C == code || // Lo HANGUL SYLLABLE SSWE + 0xC4B8 == code || // Lo HANGUL SYLLABLE SSWI + 0xC4D4 == code || // Lo HANGUL SYLLABLE SSYU + 0xC4F0 == code || // Lo HANGUL SYLLABLE SSEU + 0xC50C == code || // Lo HANGUL SYLLABLE SSYI + 0xC528 == code || // Lo HANGUL SYLLABLE SSI + 0xC544 == code || // Lo HANGUL SYLLABLE A + 0xC560 == code || // Lo HANGUL SYLLABLE AE + 0xC57C == code || // Lo HANGUL SYLLABLE YA + 0xC598 == code || // Lo HANGUL SYLLABLE YAE + 0xC5B4 == code || // Lo HANGUL SYLLABLE EO + 0xC5D0 == code || // Lo HANGUL SYLLABLE E + 0xC5EC == code || // Lo HANGUL SYLLABLE YEO + 0xC608 == code || // Lo HANGUL SYLLABLE YE + 0xC624 == code || // Lo HANGUL SYLLABLE O + 0xC640 == code || // Lo HANGUL SYLLABLE WA + 0xC65C == code || // Lo HANGUL SYLLABLE WAE + 0xC678 == code || // Lo HANGUL SYLLABLE OE + 0xC694 == code || // Lo HANGUL SYLLABLE YO + 0xC6B0 == code || // Lo HANGUL SYLLABLE U + 0xC6CC == code || // Lo HANGUL SYLLABLE WEO + 0xC6E8 == code || // Lo HANGUL SYLLABLE WE + 0xC704 == code || // Lo HANGUL SYLLABLE WI + 0xC720 == code || // Lo HANGUL SYLLABLE YU + 0xC73C == code || // Lo HANGUL SYLLABLE EU + 0xC758 == code || // Lo HANGUL SYLLABLE YI + 0xC774 == code || // Lo HANGUL SYLLABLE I + 0xC790 == code || // Lo HANGUL SYLLABLE JA + 0xC7AC == code || // Lo HANGUL SYLLABLE JAE + 0xC7C8 == code || // Lo HANGUL SYLLABLE JYA + 0xC7E4 == code || // Lo HANGUL SYLLABLE JYAE + 0xC800 == code || // Lo HANGUL SYLLABLE JEO + 0xC81C == code || // Lo HANGUL SYLLABLE JE + 0xC838 == code || // Lo HANGUL SYLLABLE JYEO + 0xC854 == code || // Lo HANGUL SYLLABLE JYE + 0xC870 == code || // Lo HANGUL SYLLABLE JO + 0xC88C == code || // Lo HANGUL SYLLABLE JWA + 0xC8A8 == code || // Lo HANGUL SYLLABLE JWAE + 0xC8C4 == code || // Lo HANGUL SYLLABLE JOE + 0xC8E0 == code || // Lo HANGUL SYLLABLE JYO + 0xC8FC == code || // Lo HANGUL SYLLABLE JU + 0xC918 == code || // Lo HANGUL SYLLABLE JWEO + 0xC934 == code || // Lo HANGUL SYLLABLE JWE + 0xC950 == code || // Lo HANGUL SYLLABLE JWI + 0xC96C == code || // Lo HANGUL SYLLABLE JYU + 0xC988 == code || // Lo HANGUL SYLLABLE JEU + 0xC9A4 == code || // Lo HANGUL SYLLABLE JYI + 0xC9C0 == code || // Lo HANGUL SYLLABLE JI + 0xC9DC == code || // Lo HANGUL SYLLABLE JJA + 0xC9F8 == code || // Lo HANGUL SYLLABLE JJAE + 0xCA14 == code || // Lo HANGUL SYLLABLE JJYA + 0xCA30 == code || // Lo HANGUL SYLLABLE JJYAE + 0xCA4C == code || // Lo HANGUL SYLLABLE JJEO + 0xCA68 == code || // Lo HANGUL SYLLABLE JJE + 0xCA84 == code || // Lo HANGUL SYLLABLE JJYEO + 0xCAA0 == code || // Lo HANGUL SYLLABLE JJYE + 0xCABC == code || // Lo HANGUL SYLLABLE JJO + 0xCAD8 == code || // Lo HANGUL SYLLABLE JJWA + 0xCAF4 == code || // Lo HANGUL SYLLABLE JJWAE + 0xCB10 == code || // Lo HANGUL SYLLABLE JJOE + 0xCB2C == code || // Lo HANGUL SYLLABLE JJYO + 0xCB48 == code || // Lo HANGUL SYLLABLE JJU + 0xCB64 == code || // Lo HANGUL SYLLABLE JJWEO + 0xCB80 == code || // Lo HANGUL SYLLABLE JJWE + 0xCB9C == code || // Lo HANGUL SYLLABLE JJWI + 0xCBB8 == code || // Lo HANGUL SYLLABLE JJYU + 0xCBD4 == code || // Lo HANGUL SYLLABLE JJEU + 0xCBF0 == code || // Lo HANGUL SYLLABLE JJYI + 0xCC0C == code || // Lo HANGUL SYLLABLE JJI + 0xCC28 == code || // Lo HANGUL SYLLABLE CA + 0xCC44 == code || // Lo HANGUL SYLLABLE CAE + 0xCC60 == code || // Lo HANGUL SYLLABLE CYA + 0xCC7C == code || // Lo HANGUL SYLLABLE CYAE + 0xCC98 == code || // Lo HANGUL SYLLABLE CEO + 0xCCB4 == code || // Lo HANGUL SYLLABLE CE + 0xCCD0 == code || // Lo HANGUL SYLLABLE CYEO + 0xCCEC == code || // Lo HANGUL SYLLABLE CYE + 0xCD08 == code || // Lo HANGUL SYLLABLE CO + 0xCD24 == code || // Lo HANGUL SYLLABLE CWA + 0xCD40 == code || // Lo HANGUL SYLLABLE CWAE + 0xCD5C == code || // Lo HANGUL SYLLABLE COE + 0xCD78 == code || // Lo HANGUL SYLLABLE CYO + 0xCD94 == code || // Lo HANGUL SYLLABLE CU + 0xCDB0 == code || // Lo HANGUL SYLLABLE CWEO + 0xCDCC == code || // Lo HANGUL SYLLABLE CWE + 0xCDE8 == code || // Lo HANGUL SYLLABLE CWI + 0xCE04 == code || // Lo HANGUL SYLLABLE CYU + 0xCE20 == code || // Lo HANGUL SYLLABLE CEU + 0xCE3C == code || // Lo HANGUL SYLLABLE CYI + 0xCE58 == code || // Lo HANGUL SYLLABLE CI + 0xCE74 == code || // Lo HANGUL SYLLABLE KA + 0xCE90 == code || // Lo HANGUL SYLLABLE KAE + 0xCEAC == code || // Lo HANGUL SYLLABLE KYA + 0xCEC8 == code || // Lo HANGUL SYLLABLE KYAE + 0xCEE4 == code || // Lo HANGUL SYLLABLE KEO + 0xCF00 == code || // Lo HANGUL SYLLABLE KE + 0xCF1C == code || // Lo HANGUL SYLLABLE KYEO + 0xCF38 == code || // Lo HANGUL SYLLABLE KYE + 0xCF54 == code || // Lo HANGUL SYLLABLE KO + 0xCF70 == code || // Lo HANGUL SYLLABLE KWA + 0xCF8C == code || // Lo HANGUL SYLLABLE KWAE + 0xCFA8 == code || // Lo HANGUL SYLLABLE KOE + 0xCFC4 == code || // Lo HANGUL SYLLABLE KYO + 0xCFE0 == code || // Lo HANGUL SYLLABLE KU + 0xCFFC == code || // Lo HANGUL SYLLABLE KWEO + 0xD018 == code || // Lo HANGUL SYLLABLE KWE + 0xD034 == code || // Lo HANGUL SYLLABLE KWI + 0xD050 == code || // Lo HANGUL SYLLABLE KYU + 0xD06C == code || // Lo HANGUL SYLLABLE KEU + 0xD088 == code || // Lo HANGUL SYLLABLE KYI + 0xD0A4 == code || // Lo HANGUL SYLLABLE KI + 0xD0C0 == code || // Lo HANGUL SYLLABLE TA + 0xD0DC == code || // Lo HANGUL SYLLABLE TAE + 0xD0F8 == code || // Lo HANGUL SYLLABLE TYA + 0xD114 == code || // Lo HANGUL SYLLABLE TYAE + 0xD130 == code || // Lo HANGUL SYLLABLE TEO + 0xD14C == code || // Lo HANGUL SYLLABLE TE + 0xD168 == code || // Lo HANGUL SYLLABLE TYEO + 0xD184 == code || // Lo HANGUL SYLLABLE TYE + 0xD1A0 == code || // Lo HANGUL SYLLABLE TO + 0xD1BC == code || // Lo HANGUL SYLLABLE TWA + 0xD1D8 == code || // Lo HANGUL SYLLABLE TWAE + 0xD1F4 == code || // Lo HANGUL SYLLABLE TOE + 0xD210 == code || // Lo HANGUL SYLLABLE TYO + 0xD22C == code || // Lo HANGUL SYLLABLE TU + 0xD248 == code || // Lo HANGUL SYLLABLE TWEO + 0xD264 == code || // Lo HANGUL SYLLABLE TWE + 0xD280 == code || // Lo HANGUL SYLLABLE TWI + 0xD29C == code || // Lo HANGUL SYLLABLE TYU + 0xD2B8 == code || // Lo HANGUL SYLLABLE TEU + 0xD2D4 == code || // Lo HANGUL SYLLABLE TYI + 0xD2F0 == code || // Lo HANGUL SYLLABLE TI + 0xD30C == code || // Lo HANGUL SYLLABLE PA + 0xD328 == code || // Lo HANGUL SYLLABLE PAE + 0xD344 == code || // Lo HANGUL SYLLABLE PYA + 0xD360 == code || // Lo HANGUL SYLLABLE PYAE + 0xD37C == code || // Lo HANGUL SYLLABLE PEO + 0xD398 == code || // Lo HANGUL SYLLABLE PE + 0xD3B4 == code || // Lo HANGUL SYLLABLE PYEO + 0xD3D0 == code || // Lo HANGUL SYLLABLE PYE + 0xD3EC == code || // Lo HANGUL SYLLABLE PO + 0xD408 == code || // Lo HANGUL SYLLABLE PWA + 0xD424 == code || // Lo HANGUL SYLLABLE PWAE + 0xD440 == code || // Lo HANGUL SYLLABLE POE + 0xD45C == code || // Lo HANGUL SYLLABLE PYO + 0xD478 == code || // Lo HANGUL SYLLABLE PU + 0xD494 == code || // Lo HANGUL SYLLABLE PWEO + 0xD4B0 == code || // Lo HANGUL SYLLABLE PWE + 0xD4CC == code || // Lo HANGUL SYLLABLE PWI + 0xD4E8 == code || // Lo HANGUL SYLLABLE PYU + 0xD504 == code || // Lo HANGUL SYLLABLE PEU + 0xD520 == code || // Lo HANGUL SYLLABLE PYI + 0xD53C == code || // Lo HANGUL SYLLABLE PI + 0xD558 == code || // Lo HANGUL SYLLABLE HA + 0xD574 == code || // Lo HANGUL SYLLABLE HAE + 0xD590 == code || // Lo HANGUL SYLLABLE HYA + 0xD5AC == code || // Lo HANGUL SYLLABLE HYAE + 0xD5C8 == code || // Lo HANGUL SYLLABLE HEO + 0xD5E4 == code || // Lo HANGUL SYLLABLE HE + 0xD600 == code || // Lo HANGUL SYLLABLE HYEO + 0xD61C == code || // Lo HANGUL SYLLABLE HYE + 0xD638 == code || // Lo HANGUL SYLLABLE HO + 0xD654 == code || // Lo HANGUL SYLLABLE HWA + 0xD670 == code || // Lo HANGUL SYLLABLE HWAE + 0xD68C == code || // Lo HANGUL SYLLABLE HOE + 0xD6A8 == code || // Lo HANGUL SYLLABLE HYO + 0xD6C4 == code || // Lo HANGUL SYLLABLE HU + 0xD6E0 == code || // Lo HANGUL SYLLABLE HWEO + 0xD6FC == code || // Lo HANGUL SYLLABLE HWE + 0xD718 == code || // Lo HANGUL SYLLABLE HWI + 0xD734 == code || // Lo HANGUL SYLLABLE HYU + 0xD750 == code || // Lo HANGUL SYLLABLE HEU + 0xD76C == code || // Lo HANGUL SYLLABLE HYI + 0xD788 == code // Lo HANGUL SYLLABLE HI + ){ + return LV; + } + + if( + (0xAC01 <= code && code <= 0xAC1B) || // Lo [27] HANGUL SYLLABLE GAG..HANGUL SYLLABLE GAH + (0xAC1D <= code && code <= 0xAC37) || // Lo [27] HANGUL SYLLABLE GAEG..HANGUL SYLLABLE GAEH + (0xAC39 <= code && code <= 0xAC53) || // Lo [27] HANGUL SYLLABLE GYAG..HANGUL SYLLABLE GYAH + (0xAC55 <= code && code <= 0xAC6F) || // Lo [27] HANGUL SYLLABLE GYAEG..HANGUL SYLLABLE GYAEH + (0xAC71 <= code && code <= 0xAC8B) || // Lo [27] HANGUL SYLLABLE GEOG..HANGUL SYLLABLE GEOH + (0xAC8D <= code && code <= 0xACA7) || // Lo [27] HANGUL SYLLABLE GEG..HANGUL SYLLABLE GEH + (0xACA9 <= code && code <= 0xACC3) || // Lo [27] HANGUL SYLLABLE GYEOG..HANGUL SYLLABLE GYEOH + (0xACC5 <= code && code <= 0xACDF) || // Lo [27] HANGUL SYLLABLE GYEG..HANGUL SYLLABLE GYEH + (0xACE1 <= code && code <= 0xACFB) || // Lo [27] HANGUL SYLLABLE GOG..HANGUL SYLLABLE GOH + (0xACFD <= code && code <= 0xAD17) || // Lo [27] HANGUL SYLLABLE GWAG..HANGUL SYLLABLE GWAH + (0xAD19 <= code && code <= 0xAD33) || // Lo [27] HANGUL SYLLABLE GWAEG..HANGUL SYLLABLE GWAEH + (0xAD35 <= code && code <= 0xAD4F) || // Lo [27] HANGUL SYLLABLE GOEG..HANGUL SYLLABLE GOEH + (0xAD51 <= code && code <= 0xAD6B) || // Lo [27] HANGUL SYLLABLE GYOG..HANGUL SYLLABLE GYOH + (0xAD6D <= code && code <= 0xAD87) || // Lo [27] HANGUL SYLLABLE GUG..HANGUL SYLLABLE GUH + (0xAD89 <= code && code <= 0xADA3) || // Lo [27] HANGUL SYLLABLE GWEOG..HANGUL SYLLABLE GWEOH + (0xADA5 <= code && code <= 0xADBF) || // Lo [27] HANGUL SYLLABLE GWEG..HANGUL SYLLABLE GWEH + (0xADC1 <= code && code <= 0xADDB) || // Lo [27] HANGUL SYLLABLE GWIG..HANGUL SYLLABLE GWIH + (0xADDD <= code && code <= 0xADF7) || // Lo [27] HANGUL SYLLABLE GYUG..HANGUL SYLLABLE GYUH + (0xADF9 <= code && code <= 0xAE13) || // Lo [27] HANGUL SYLLABLE GEUG..HANGUL SYLLABLE GEUH + (0xAE15 <= code && code <= 0xAE2F) || // Lo [27] HANGUL SYLLABLE GYIG..HANGUL SYLLABLE GYIH + (0xAE31 <= code && code <= 0xAE4B) || // Lo [27] HANGUL SYLLABLE GIG..HANGUL SYLLABLE GIH + (0xAE4D <= code && code <= 0xAE67) || // Lo [27] HANGUL SYLLABLE GGAG..HANGUL SYLLABLE GGAH + (0xAE69 <= code && code <= 0xAE83) || // Lo [27] HANGUL SYLLABLE GGAEG..HANGUL SYLLABLE GGAEH + (0xAE85 <= code && code <= 0xAE9F) || // Lo [27] HANGUL SYLLABLE GGYAG..HANGUL SYLLABLE GGYAH + (0xAEA1 <= code && code <= 0xAEBB) || // Lo [27] HANGUL SYLLABLE GGYAEG..HANGUL SYLLABLE GGYAEH + (0xAEBD <= code && code <= 0xAED7) || // Lo [27] HANGUL SYLLABLE GGEOG..HANGUL SYLLABLE GGEOH + (0xAED9 <= code && code <= 0xAEF3) || // Lo [27] HANGUL SYLLABLE GGEG..HANGUL SYLLABLE GGEH + (0xAEF5 <= code && code <= 0xAF0F) || // Lo [27] HANGUL SYLLABLE GGYEOG..HANGUL SYLLABLE GGYEOH + (0xAF11 <= code && code <= 0xAF2B) || // Lo [27] HANGUL SYLLABLE GGYEG..HANGUL SYLLABLE GGYEH + (0xAF2D <= code && code <= 0xAF47) || // Lo [27] HANGUL SYLLABLE GGOG..HANGUL SYLLABLE GGOH + (0xAF49 <= code && code <= 0xAF63) || // Lo [27] HANGUL SYLLABLE GGWAG..HANGUL SYLLABLE GGWAH + (0xAF65 <= code && code <= 0xAF7F) || // Lo [27] HANGUL SYLLABLE GGWAEG..HANGUL SYLLABLE GGWAEH + (0xAF81 <= code && code <= 0xAF9B) || // Lo [27] HANGUL SYLLABLE GGOEG..HANGUL SYLLABLE GGOEH + (0xAF9D <= code && code <= 0xAFB7) || // Lo [27] HANGUL SYLLABLE GGYOG..HANGUL SYLLABLE GGYOH + (0xAFB9 <= code && code <= 0xAFD3) || // Lo [27] HANGUL SYLLABLE GGUG..HANGUL SYLLABLE GGUH + (0xAFD5 <= code && code <= 0xAFEF) || // Lo [27] HANGUL SYLLABLE GGWEOG..HANGUL SYLLABLE GGWEOH + (0xAFF1 <= code && code <= 0xB00B) || // Lo [27] HANGUL SYLLABLE GGWEG..HANGUL SYLLABLE GGWEH + (0xB00D <= code && code <= 0xB027) || // Lo [27] HANGUL SYLLABLE GGWIG..HANGUL SYLLABLE GGWIH + (0xB029 <= code && code <= 0xB043) || // Lo [27] HANGUL SYLLABLE GGYUG..HANGUL SYLLABLE GGYUH + (0xB045 <= code && code <= 0xB05F) || // Lo [27] HANGUL SYLLABLE GGEUG..HANGUL SYLLABLE GGEUH + (0xB061 <= code && code <= 0xB07B) || // Lo [27] HANGUL SYLLABLE GGYIG..HANGUL SYLLABLE GGYIH + (0xB07D <= code && code <= 0xB097) || // Lo [27] HANGUL SYLLABLE GGIG..HANGUL SYLLABLE GGIH + (0xB099 <= code && code <= 0xB0B3) || // Lo [27] HANGUL SYLLABLE NAG..HANGUL SYLLABLE NAH + (0xB0B5 <= code && code <= 0xB0CF) || // Lo [27] HANGUL SYLLABLE NAEG..HANGUL SYLLABLE NAEH + (0xB0D1 <= code && code <= 0xB0EB) || // Lo [27] HANGUL SYLLABLE NYAG..HANGUL SYLLABLE NYAH + (0xB0ED <= code && code <= 0xB107) || // Lo [27] HANGUL SYLLABLE NYAEG..HANGUL SYLLABLE NYAEH + (0xB109 <= code && code <= 0xB123) || // Lo [27] HANGUL SYLLABLE NEOG..HANGUL SYLLABLE NEOH + (0xB125 <= code && code <= 0xB13F) || // Lo [27] HANGUL SYLLABLE NEG..HANGUL SYLLABLE NEH + (0xB141 <= code && code <= 0xB15B) || // Lo [27] HANGUL SYLLABLE NYEOG..HANGUL SYLLABLE NYEOH + (0xB15D <= code && code <= 0xB177) || // Lo [27] HANGUL SYLLABLE NYEG..HANGUL SYLLABLE NYEH + (0xB179 <= code && code <= 0xB193) || // Lo [27] HANGUL SYLLABLE NOG..HANGUL SYLLABLE NOH + (0xB195 <= code && code <= 0xB1AF) || // Lo [27] HANGUL SYLLABLE NWAG..HANGUL SYLLABLE NWAH + (0xB1B1 <= code && code <= 0xB1CB) || // Lo [27] HANGUL SYLLABLE NWAEG..HANGUL SYLLABLE NWAEH + (0xB1CD <= code && code <= 0xB1E7) || // Lo [27] HANGUL SYLLABLE NOEG..HANGUL SYLLABLE NOEH + (0xB1E9 <= code && code <= 0xB203) || // Lo [27] HANGUL SYLLABLE NYOG..HANGUL SYLLABLE NYOH + (0xB205 <= code && code <= 0xB21F) || // Lo [27] HANGUL SYLLABLE NUG..HANGUL SYLLABLE NUH + (0xB221 <= code && code <= 0xB23B) || // Lo [27] HANGUL SYLLABLE NWEOG..HANGUL SYLLABLE NWEOH + (0xB23D <= code && code <= 0xB257) || // Lo [27] HANGUL SYLLABLE NWEG..HANGUL SYLLABLE NWEH + (0xB259 <= code && code <= 0xB273) || // Lo [27] HANGUL SYLLABLE NWIG..HANGUL SYLLABLE NWIH + (0xB275 <= code && code <= 0xB28F) || // Lo [27] HANGUL SYLLABLE NYUG..HANGUL SYLLABLE NYUH + (0xB291 <= code && code <= 0xB2AB) || // Lo [27] HANGUL SYLLABLE NEUG..HANGUL SYLLABLE NEUH + (0xB2AD <= code && code <= 0xB2C7) || // Lo [27] HANGUL SYLLABLE NYIG..HANGUL SYLLABLE NYIH + (0xB2C9 <= code && code <= 0xB2E3) || // Lo [27] HANGUL SYLLABLE NIG..HANGUL SYLLABLE NIH + (0xB2E5 <= code && code <= 0xB2FF) || // Lo [27] HANGUL SYLLABLE DAG..HANGUL SYLLABLE DAH + (0xB301 <= code && code <= 0xB31B) || // Lo [27] HANGUL SYLLABLE DAEG..HANGUL SYLLABLE DAEH + (0xB31D <= code && code <= 0xB337) || // Lo [27] HANGUL SYLLABLE DYAG..HANGUL SYLLABLE DYAH + (0xB339 <= code && code <= 0xB353) || // Lo [27] HANGUL SYLLABLE DYAEG..HANGUL SYLLABLE DYAEH + (0xB355 <= code && code <= 0xB36F) || // Lo [27] HANGUL SYLLABLE DEOG..HANGUL SYLLABLE DEOH + (0xB371 <= code && code <= 0xB38B) || // Lo [27] HANGUL SYLLABLE DEG..HANGUL SYLLABLE DEH + (0xB38D <= code && code <= 0xB3A7) || // Lo [27] HANGUL SYLLABLE DYEOG..HANGUL SYLLABLE DYEOH + (0xB3A9 <= code && code <= 0xB3C3) || // Lo [27] HANGUL SYLLABLE DYEG..HANGUL SYLLABLE DYEH + (0xB3C5 <= code && code <= 0xB3DF) || // Lo [27] HANGUL SYLLABLE DOG..HANGUL SYLLABLE DOH + (0xB3E1 <= code && code <= 0xB3FB) || // Lo [27] HANGUL SYLLABLE DWAG..HANGUL SYLLABLE DWAH + (0xB3FD <= code && code <= 0xB417) || // Lo [27] HANGUL SYLLABLE DWAEG..HANGUL SYLLABLE DWAEH + (0xB419 <= code && code <= 0xB433) || // Lo [27] HANGUL SYLLABLE DOEG..HANGUL SYLLABLE DOEH + (0xB435 <= code && code <= 0xB44F) || // Lo [27] HANGUL SYLLABLE DYOG..HANGUL SYLLABLE DYOH + (0xB451 <= code && code <= 0xB46B) || // Lo [27] HANGUL SYLLABLE DUG..HANGUL SYLLABLE DUH + (0xB46D <= code && code <= 0xB487) || // Lo [27] HANGUL SYLLABLE DWEOG..HANGUL SYLLABLE DWEOH + (0xB489 <= code && code <= 0xB4A3) || // Lo [27] HANGUL SYLLABLE DWEG..HANGUL SYLLABLE DWEH + (0xB4A5 <= code && code <= 0xB4BF) || // Lo [27] HANGUL SYLLABLE DWIG..HANGUL SYLLABLE DWIH + (0xB4C1 <= code && code <= 0xB4DB) || // Lo [27] HANGUL SYLLABLE DYUG..HANGUL SYLLABLE DYUH + (0xB4DD <= code && code <= 0xB4F7) || // Lo [27] HANGUL SYLLABLE DEUG..HANGUL SYLLABLE DEUH + (0xB4F9 <= code && code <= 0xB513) || // Lo [27] HANGUL SYLLABLE DYIG..HANGUL SYLLABLE DYIH + (0xB515 <= code && code <= 0xB52F) || // Lo [27] HANGUL SYLLABLE DIG..HANGUL SYLLABLE DIH + (0xB531 <= code && code <= 0xB54B) || // Lo [27] HANGUL SYLLABLE DDAG..HANGUL SYLLABLE DDAH + (0xB54D <= code && code <= 0xB567) || // Lo [27] HANGUL SYLLABLE DDAEG..HANGUL SYLLABLE DDAEH + (0xB569 <= code && code <= 0xB583) || // Lo [27] HANGUL SYLLABLE DDYAG..HANGUL SYLLABLE DDYAH + (0xB585 <= code && code <= 0xB59F) || // Lo [27] HANGUL SYLLABLE DDYAEG..HANGUL SYLLABLE DDYAEH + (0xB5A1 <= code && code <= 0xB5BB) || // Lo [27] HANGUL SYLLABLE DDEOG..HANGUL SYLLABLE DDEOH + (0xB5BD <= code && code <= 0xB5D7) || // Lo [27] HANGUL SYLLABLE DDEG..HANGUL SYLLABLE DDEH + (0xB5D9 <= code && code <= 0xB5F3) || // Lo [27] HANGUL SYLLABLE DDYEOG..HANGUL SYLLABLE DDYEOH + (0xB5F5 <= code && code <= 0xB60F) || // Lo [27] HANGUL SYLLABLE DDYEG..HANGUL SYLLABLE DDYEH + (0xB611 <= code && code <= 0xB62B) || // Lo [27] HANGUL SYLLABLE DDOG..HANGUL SYLLABLE DDOH + (0xB62D <= code && code <= 0xB647) || // Lo [27] HANGUL SYLLABLE DDWAG..HANGUL SYLLABLE DDWAH + (0xB649 <= code && code <= 0xB663) || // Lo [27] HANGUL SYLLABLE DDWAEG..HANGUL SYLLABLE DDWAEH + (0xB665 <= code && code <= 0xB67F) || // Lo [27] HANGUL SYLLABLE DDOEG..HANGUL SYLLABLE DDOEH + (0xB681 <= code && code <= 0xB69B) || // Lo [27] HANGUL SYLLABLE DDYOG..HANGUL SYLLABLE DDYOH + (0xB69D <= code && code <= 0xB6B7) || // Lo [27] HANGUL SYLLABLE DDUG..HANGUL SYLLABLE DDUH + (0xB6B9 <= code && code <= 0xB6D3) || // Lo [27] HANGUL SYLLABLE DDWEOG..HANGUL SYLLABLE DDWEOH + (0xB6D5 <= code && code <= 0xB6EF) || // Lo [27] HANGUL SYLLABLE DDWEG..HANGUL SYLLABLE DDWEH + (0xB6F1 <= code && code <= 0xB70B) || // Lo [27] HANGUL SYLLABLE DDWIG..HANGUL SYLLABLE DDWIH + (0xB70D <= code && code <= 0xB727) || // Lo [27] HANGUL SYLLABLE DDYUG..HANGUL SYLLABLE DDYUH + (0xB729 <= code && code <= 0xB743) || // Lo [27] HANGUL SYLLABLE DDEUG..HANGUL SYLLABLE DDEUH + (0xB745 <= code && code <= 0xB75F) || // Lo [27] HANGUL SYLLABLE DDYIG..HANGUL SYLLABLE DDYIH + (0xB761 <= code && code <= 0xB77B) || // Lo [27] HANGUL SYLLABLE DDIG..HANGUL SYLLABLE DDIH + (0xB77D <= code && code <= 0xB797) || // Lo [27] HANGUL SYLLABLE RAG..HANGUL SYLLABLE RAH + (0xB799 <= code && code <= 0xB7B3) || // Lo [27] HANGUL SYLLABLE RAEG..HANGUL SYLLABLE RAEH + (0xB7B5 <= code && code <= 0xB7CF) || // Lo [27] HANGUL SYLLABLE RYAG..HANGUL SYLLABLE RYAH + (0xB7D1 <= code && code <= 0xB7EB) || // Lo [27] HANGUL SYLLABLE RYAEG..HANGUL SYLLABLE RYAEH + (0xB7ED <= code && code <= 0xB807) || // Lo [27] HANGUL SYLLABLE REOG..HANGUL SYLLABLE REOH + (0xB809 <= code && code <= 0xB823) || // Lo [27] HANGUL SYLLABLE REG..HANGUL SYLLABLE REH + (0xB825 <= code && code <= 0xB83F) || // Lo [27] HANGUL SYLLABLE RYEOG..HANGUL SYLLABLE RYEOH + (0xB841 <= code && code <= 0xB85B) || // Lo [27] HANGUL SYLLABLE RYEG..HANGUL SYLLABLE RYEH + (0xB85D <= code && code <= 0xB877) || // Lo [27] HANGUL SYLLABLE ROG..HANGUL SYLLABLE ROH + (0xB879 <= code && code <= 0xB893) || // Lo [27] HANGUL SYLLABLE RWAG..HANGUL SYLLABLE RWAH + (0xB895 <= code && code <= 0xB8AF) || // Lo [27] HANGUL SYLLABLE RWAEG..HANGUL SYLLABLE RWAEH + (0xB8B1 <= code && code <= 0xB8CB) || // Lo [27] HANGUL SYLLABLE ROEG..HANGUL SYLLABLE ROEH + (0xB8CD <= code && code <= 0xB8E7) || // Lo [27] HANGUL SYLLABLE RYOG..HANGUL SYLLABLE RYOH + (0xB8E9 <= code && code <= 0xB903) || // Lo [27] HANGUL SYLLABLE RUG..HANGUL SYLLABLE RUH + (0xB905 <= code && code <= 0xB91F) || // Lo [27] HANGUL SYLLABLE RWEOG..HANGUL SYLLABLE RWEOH + (0xB921 <= code && code <= 0xB93B) || // Lo [27] HANGUL SYLLABLE RWEG..HANGUL SYLLABLE RWEH + (0xB93D <= code && code <= 0xB957) || // Lo [27] HANGUL SYLLABLE RWIG..HANGUL SYLLABLE RWIH + (0xB959 <= code && code <= 0xB973) || // Lo [27] HANGUL SYLLABLE RYUG..HANGUL SYLLABLE RYUH + (0xB975 <= code && code <= 0xB98F) || // Lo [27] HANGUL SYLLABLE REUG..HANGUL SYLLABLE REUH + (0xB991 <= code && code <= 0xB9AB) || // Lo [27] HANGUL SYLLABLE RYIG..HANGUL SYLLABLE RYIH + (0xB9AD <= code && code <= 0xB9C7) || // Lo [27] HANGUL SYLLABLE RIG..HANGUL SYLLABLE RIH + (0xB9C9 <= code && code <= 0xB9E3) || // Lo [27] HANGUL SYLLABLE MAG..HANGUL SYLLABLE MAH + (0xB9E5 <= code && code <= 0xB9FF) || // Lo [27] HANGUL SYLLABLE MAEG..HANGUL SYLLABLE MAEH + (0xBA01 <= code && code <= 0xBA1B) || // Lo [27] HANGUL SYLLABLE MYAG..HANGUL SYLLABLE MYAH + (0xBA1D <= code && code <= 0xBA37) || // Lo [27] HANGUL SYLLABLE MYAEG..HANGUL SYLLABLE MYAEH + (0xBA39 <= code && code <= 0xBA53) || // Lo [27] HANGUL SYLLABLE MEOG..HANGUL SYLLABLE MEOH + (0xBA55 <= code && code <= 0xBA6F) || // Lo [27] HANGUL SYLLABLE MEG..HANGUL SYLLABLE MEH + (0xBA71 <= code && code <= 0xBA8B) || // Lo [27] HANGUL SYLLABLE MYEOG..HANGUL SYLLABLE MYEOH + (0xBA8D <= code && code <= 0xBAA7) || // Lo [27] HANGUL SYLLABLE MYEG..HANGUL SYLLABLE MYEH + (0xBAA9 <= code && code <= 0xBAC3) || // Lo [27] HANGUL SYLLABLE MOG..HANGUL SYLLABLE MOH + (0xBAC5 <= code && code <= 0xBADF) || // Lo [27] HANGUL SYLLABLE MWAG..HANGUL SYLLABLE MWAH + (0xBAE1 <= code && code <= 0xBAFB) || // Lo [27] HANGUL SYLLABLE MWAEG..HANGUL SYLLABLE MWAEH + (0xBAFD <= code && code <= 0xBB17) || // Lo [27] HANGUL SYLLABLE MOEG..HANGUL SYLLABLE MOEH + (0xBB19 <= code && code <= 0xBB33) || // Lo [27] HANGUL SYLLABLE MYOG..HANGUL SYLLABLE MYOH + (0xBB35 <= code && code <= 0xBB4F) || // Lo [27] HANGUL SYLLABLE MUG..HANGUL SYLLABLE MUH + (0xBB51 <= code && code <= 0xBB6B) || // Lo [27] HANGUL SYLLABLE MWEOG..HANGUL SYLLABLE MWEOH + (0xBB6D <= code && code <= 0xBB87) || // Lo [27] HANGUL SYLLABLE MWEG..HANGUL SYLLABLE MWEH + (0xBB89 <= code && code <= 0xBBA3) || // Lo [27] HANGUL SYLLABLE MWIG..HANGUL SYLLABLE MWIH + (0xBBA5 <= code && code <= 0xBBBF) || // Lo [27] HANGUL SYLLABLE MYUG..HANGUL SYLLABLE MYUH + (0xBBC1 <= code && code <= 0xBBDB) || // Lo [27] HANGUL SYLLABLE MEUG..HANGUL SYLLABLE MEUH + (0xBBDD <= code && code <= 0xBBF7) || // Lo [27] HANGUL SYLLABLE MYIG..HANGUL SYLLABLE MYIH + (0xBBF9 <= code && code <= 0xBC13) || // Lo [27] HANGUL SYLLABLE MIG..HANGUL SYLLABLE MIH + (0xBC15 <= code && code <= 0xBC2F) || // Lo [27] HANGUL SYLLABLE BAG..HANGUL SYLLABLE BAH + (0xBC31 <= code && code <= 0xBC4B) || // Lo [27] HANGUL SYLLABLE BAEG..HANGUL SYLLABLE BAEH + (0xBC4D <= code && code <= 0xBC67) || // Lo [27] HANGUL SYLLABLE BYAG..HANGUL SYLLABLE BYAH + (0xBC69 <= code && code <= 0xBC83) || // Lo [27] HANGUL SYLLABLE BYAEG..HANGUL SYLLABLE BYAEH + (0xBC85 <= code && code <= 0xBC9F) || // Lo [27] HANGUL SYLLABLE BEOG..HANGUL SYLLABLE BEOH + (0xBCA1 <= code && code <= 0xBCBB) || // Lo [27] HANGUL SYLLABLE BEG..HANGUL SYLLABLE BEH + (0xBCBD <= code && code <= 0xBCD7) || // Lo [27] HANGUL SYLLABLE BYEOG..HANGUL SYLLABLE BYEOH + (0xBCD9 <= code && code <= 0xBCF3) || // Lo [27] HANGUL SYLLABLE BYEG..HANGUL SYLLABLE BYEH + (0xBCF5 <= code && code <= 0xBD0F) || // Lo [27] HANGUL SYLLABLE BOG..HANGUL SYLLABLE BOH + (0xBD11 <= code && code <= 0xBD2B) || // Lo [27] HANGUL SYLLABLE BWAG..HANGUL SYLLABLE BWAH + (0xBD2D <= code && code <= 0xBD47) || // Lo [27] HANGUL SYLLABLE BWAEG..HANGUL SYLLABLE BWAEH + (0xBD49 <= code && code <= 0xBD63) || // Lo [27] HANGUL SYLLABLE BOEG..HANGUL SYLLABLE BOEH + (0xBD65 <= code && code <= 0xBD7F) || // Lo [27] HANGUL SYLLABLE BYOG..HANGUL SYLLABLE BYOH + (0xBD81 <= code && code <= 0xBD9B) || // Lo [27] HANGUL SYLLABLE BUG..HANGUL SYLLABLE BUH + (0xBD9D <= code && code <= 0xBDB7) || // Lo [27] HANGUL SYLLABLE BWEOG..HANGUL SYLLABLE BWEOH + (0xBDB9 <= code && code <= 0xBDD3) || // Lo [27] HANGUL SYLLABLE BWEG..HANGUL SYLLABLE BWEH + (0xBDD5 <= code && code <= 0xBDEF) || // Lo [27] HANGUL SYLLABLE BWIG..HANGUL SYLLABLE BWIH + (0xBDF1 <= code && code <= 0xBE0B) || // Lo [27] HANGUL SYLLABLE BYUG..HANGUL SYLLABLE BYUH + (0xBE0D <= code && code <= 0xBE27) || // Lo [27] HANGUL SYLLABLE BEUG..HANGUL SYLLABLE BEUH + (0xBE29 <= code && code <= 0xBE43) || // Lo [27] HANGUL SYLLABLE BYIG..HANGUL SYLLABLE BYIH + (0xBE45 <= code && code <= 0xBE5F) || // Lo [27] HANGUL SYLLABLE BIG..HANGUL SYLLABLE BIH + (0xBE61 <= code && code <= 0xBE7B) || // Lo [27] HANGUL SYLLABLE BBAG..HANGUL SYLLABLE BBAH + (0xBE7D <= code && code <= 0xBE97) || // Lo [27] HANGUL SYLLABLE BBAEG..HANGUL SYLLABLE BBAEH + (0xBE99 <= code && code <= 0xBEB3) || // Lo [27] HANGUL SYLLABLE BBYAG..HANGUL SYLLABLE BBYAH + (0xBEB5 <= code && code <= 0xBECF) || // Lo [27] HANGUL SYLLABLE BBYAEG..HANGUL SYLLABLE BBYAEH + (0xBED1 <= code && code <= 0xBEEB) || // Lo [27] HANGUL SYLLABLE BBEOG..HANGUL SYLLABLE BBEOH + (0xBEED <= code && code <= 0xBF07) || // Lo [27] HANGUL SYLLABLE BBEG..HANGUL SYLLABLE BBEH + (0xBF09 <= code && code <= 0xBF23) || // Lo [27] HANGUL SYLLABLE BBYEOG..HANGUL SYLLABLE BBYEOH + (0xBF25 <= code && code <= 0xBF3F) || // Lo [27] HANGUL SYLLABLE BBYEG..HANGUL SYLLABLE BBYEH + (0xBF41 <= code && code <= 0xBF5B) || // Lo [27] HANGUL SYLLABLE BBOG..HANGUL SYLLABLE BBOH + (0xBF5D <= code && code <= 0xBF77) || // Lo [27] HANGUL SYLLABLE BBWAG..HANGUL SYLLABLE BBWAH + (0xBF79 <= code && code <= 0xBF93) || // Lo [27] HANGUL SYLLABLE BBWAEG..HANGUL SYLLABLE BBWAEH + (0xBF95 <= code && code <= 0xBFAF) || // Lo [27] HANGUL SYLLABLE BBOEG..HANGUL SYLLABLE BBOEH + (0xBFB1 <= code && code <= 0xBFCB) || // Lo [27] HANGUL SYLLABLE BBYOG..HANGUL SYLLABLE BBYOH + (0xBFCD <= code && code <= 0xBFE7) || // Lo [27] HANGUL SYLLABLE BBUG..HANGUL SYLLABLE BBUH + (0xBFE9 <= code && code <= 0xC003) || // Lo [27] HANGUL SYLLABLE BBWEOG..HANGUL SYLLABLE BBWEOH + (0xC005 <= code && code <= 0xC01F) || // Lo [27] HANGUL SYLLABLE BBWEG..HANGUL SYLLABLE BBWEH + (0xC021 <= code && code <= 0xC03B) || // Lo [27] HANGUL SYLLABLE BBWIG..HANGUL SYLLABLE BBWIH + (0xC03D <= code && code <= 0xC057) || // Lo [27] HANGUL SYLLABLE BBYUG..HANGUL SYLLABLE BBYUH + (0xC059 <= code && code <= 0xC073) || // Lo [27] HANGUL SYLLABLE BBEUG..HANGUL SYLLABLE BBEUH + (0xC075 <= code && code <= 0xC08F) || // Lo [27] HANGUL SYLLABLE BBYIG..HANGUL SYLLABLE BBYIH + (0xC091 <= code && code <= 0xC0AB) || // Lo [27] HANGUL SYLLABLE BBIG..HANGUL SYLLABLE BBIH + (0xC0AD <= code && code <= 0xC0C7) || // Lo [27] HANGUL SYLLABLE SAG..HANGUL SYLLABLE SAH + (0xC0C9 <= code && code <= 0xC0E3) || // Lo [27] HANGUL SYLLABLE SAEG..HANGUL SYLLABLE SAEH + (0xC0E5 <= code && code <= 0xC0FF) || // Lo [27] HANGUL SYLLABLE SYAG..HANGUL SYLLABLE SYAH + (0xC101 <= code && code <= 0xC11B) || // Lo [27] HANGUL SYLLABLE SYAEG..HANGUL SYLLABLE SYAEH + (0xC11D <= code && code <= 0xC137) || // Lo [27] HANGUL SYLLABLE SEOG..HANGUL SYLLABLE SEOH + (0xC139 <= code && code <= 0xC153) || // Lo [27] HANGUL SYLLABLE SEG..HANGUL SYLLABLE SEH + (0xC155 <= code && code <= 0xC16F) || // Lo [27] HANGUL SYLLABLE SYEOG..HANGUL SYLLABLE SYEOH + (0xC171 <= code && code <= 0xC18B) || // Lo [27] HANGUL SYLLABLE SYEG..HANGUL SYLLABLE SYEH + (0xC18D <= code && code <= 0xC1A7) || // Lo [27] HANGUL SYLLABLE SOG..HANGUL SYLLABLE SOH + (0xC1A9 <= code && code <= 0xC1C3) || // Lo [27] HANGUL SYLLABLE SWAG..HANGUL SYLLABLE SWAH + (0xC1C5 <= code && code <= 0xC1DF) || // Lo [27] HANGUL SYLLABLE SWAEG..HANGUL SYLLABLE SWAEH + (0xC1E1 <= code && code <= 0xC1FB) || // Lo [27] HANGUL SYLLABLE SOEG..HANGUL SYLLABLE SOEH + (0xC1FD <= code && code <= 0xC217) || // Lo [27] HANGUL SYLLABLE SYOG..HANGUL SYLLABLE SYOH + (0xC219 <= code && code <= 0xC233) || // Lo [27] HANGUL SYLLABLE SUG..HANGUL SYLLABLE SUH + (0xC235 <= code && code <= 0xC24F) || // Lo [27] HANGUL SYLLABLE SWEOG..HANGUL SYLLABLE SWEOH + (0xC251 <= code && code <= 0xC26B) || // Lo [27] HANGUL SYLLABLE SWEG..HANGUL SYLLABLE SWEH + (0xC26D <= code && code <= 0xC287) || // Lo [27] HANGUL SYLLABLE SWIG..HANGUL SYLLABLE SWIH + (0xC289 <= code && code <= 0xC2A3) || // Lo [27] HANGUL SYLLABLE SYUG..HANGUL SYLLABLE SYUH + (0xC2A5 <= code && code <= 0xC2BF) || // Lo [27] HANGUL SYLLABLE SEUG..HANGUL SYLLABLE SEUH + (0xC2C1 <= code && code <= 0xC2DB) || // Lo [27] HANGUL SYLLABLE SYIG..HANGUL SYLLABLE SYIH + (0xC2DD <= code && code <= 0xC2F7) || // Lo [27] HANGUL SYLLABLE SIG..HANGUL SYLLABLE SIH + (0xC2F9 <= code && code <= 0xC313) || // Lo [27] HANGUL SYLLABLE SSAG..HANGUL SYLLABLE SSAH + (0xC315 <= code && code <= 0xC32F) || // Lo [27] HANGUL SYLLABLE SSAEG..HANGUL SYLLABLE SSAEH + (0xC331 <= code && code <= 0xC34B) || // Lo [27] HANGUL SYLLABLE SSYAG..HANGUL SYLLABLE SSYAH + (0xC34D <= code && code <= 0xC367) || // Lo [27] HANGUL SYLLABLE SSYAEG..HANGUL SYLLABLE SSYAEH + (0xC369 <= code && code <= 0xC383) || // Lo [27] HANGUL SYLLABLE SSEOG..HANGUL SYLLABLE SSEOH + (0xC385 <= code && code <= 0xC39F) || // Lo [27] HANGUL SYLLABLE SSEG..HANGUL SYLLABLE SSEH + (0xC3A1 <= code && code <= 0xC3BB) || // Lo [27] HANGUL SYLLABLE SSYEOG..HANGUL SYLLABLE SSYEOH + (0xC3BD <= code && code <= 0xC3D7) || // Lo [27] HANGUL SYLLABLE SSYEG..HANGUL SYLLABLE SSYEH + (0xC3D9 <= code && code <= 0xC3F3) || // Lo [27] HANGUL SYLLABLE SSOG..HANGUL SYLLABLE SSOH + (0xC3F5 <= code && code <= 0xC40F) || // Lo [27] HANGUL SYLLABLE SSWAG..HANGUL SYLLABLE SSWAH + (0xC411 <= code && code <= 0xC42B) || // Lo [27] HANGUL SYLLABLE SSWAEG..HANGUL SYLLABLE SSWAEH + (0xC42D <= code && code <= 0xC447) || // Lo [27] HANGUL SYLLABLE SSOEG..HANGUL SYLLABLE SSOEH + (0xC449 <= code && code <= 0xC463) || // Lo [27] HANGUL SYLLABLE SSYOG..HANGUL SYLLABLE SSYOH + (0xC465 <= code && code <= 0xC47F) || // Lo [27] HANGUL SYLLABLE SSUG..HANGUL SYLLABLE SSUH + (0xC481 <= code && code <= 0xC49B) || // Lo [27] HANGUL SYLLABLE SSWEOG..HANGUL SYLLABLE SSWEOH + (0xC49D <= code && code <= 0xC4B7) || // Lo [27] HANGUL SYLLABLE SSWEG..HANGUL SYLLABLE SSWEH + (0xC4B9 <= code && code <= 0xC4D3) || // Lo [27] HANGUL SYLLABLE SSWIG..HANGUL SYLLABLE SSWIH + (0xC4D5 <= code && code <= 0xC4EF) || // Lo [27] HANGUL SYLLABLE SSYUG..HANGUL SYLLABLE SSYUH + (0xC4F1 <= code && code <= 0xC50B) || // Lo [27] HANGUL SYLLABLE SSEUG..HANGUL SYLLABLE SSEUH + (0xC50D <= code && code <= 0xC527) || // Lo [27] HANGUL SYLLABLE SSYIG..HANGUL SYLLABLE SSYIH + (0xC529 <= code && code <= 0xC543) || // Lo [27] HANGUL SYLLABLE SSIG..HANGUL SYLLABLE SSIH + (0xC545 <= code && code <= 0xC55F) || // Lo [27] HANGUL SYLLABLE AG..HANGUL SYLLABLE AH + (0xC561 <= code && code <= 0xC57B) || // Lo [27] HANGUL SYLLABLE AEG..HANGUL SYLLABLE AEH + (0xC57D <= code && code <= 0xC597) || // Lo [27] HANGUL SYLLABLE YAG..HANGUL SYLLABLE YAH + (0xC599 <= code && code <= 0xC5B3) || // Lo [27] HANGUL SYLLABLE YAEG..HANGUL SYLLABLE YAEH + (0xC5B5 <= code && code <= 0xC5CF) || // Lo [27] HANGUL SYLLABLE EOG..HANGUL SYLLABLE EOH + (0xC5D1 <= code && code <= 0xC5EB) || // Lo [27] HANGUL SYLLABLE EG..HANGUL SYLLABLE EH + (0xC5ED <= code && code <= 0xC607) || // Lo [27] HANGUL SYLLABLE YEOG..HANGUL SYLLABLE YEOH + (0xC609 <= code && code <= 0xC623) || // Lo [27] HANGUL SYLLABLE YEG..HANGUL SYLLABLE YEH + (0xC625 <= code && code <= 0xC63F) || // Lo [27] HANGUL SYLLABLE OG..HANGUL SYLLABLE OH + (0xC641 <= code && code <= 0xC65B) || // Lo [27] HANGUL SYLLABLE WAG..HANGUL SYLLABLE WAH + (0xC65D <= code && code <= 0xC677) || // Lo [27] HANGUL SYLLABLE WAEG..HANGUL SYLLABLE WAEH + (0xC679 <= code && code <= 0xC693) || // Lo [27] HANGUL SYLLABLE OEG..HANGUL SYLLABLE OEH + (0xC695 <= code && code <= 0xC6AF) || // Lo [27] HANGUL SYLLABLE YOG..HANGUL SYLLABLE YOH + (0xC6B1 <= code && code <= 0xC6CB) || // Lo [27] HANGUL SYLLABLE UG..HANGUL SYLLABLE UH + (0xC6CD <= code && code <= 0xC6E7) || // Lo [27] HANGUL SYLLABLE WEOG..HANGUL SYLLABLE WEOH + (0xC6E9 <= code && code <= 0xC703) || // Lo [27] HANGUL SYLLABLE WEG..HANGUL SYLLABLE WEH + (0xC705 <= code && code <= 0xC71F) || // Lo [27] HANGUL SYLLABLE WIG..HANGUL SYLLABLE WIH + (0xC721 <= code && code <= 0xC73B) || // Lo [27] HANGUL SYLLABLE YUG..HANGUL SYLLABLE YUH + (0xC73D <= code && code <= 0xC757) || // Lo [27] HANGUL SYLLABLE EUG..HANGUL SYLLABLE EUH + (0xC759 <= code && code <= 0xC773) || // Lo [27] HANGUL SYLLABLE YIG..HANGUL SYLLABLE YIH + (0xC775 <= code && code <= 0xC78F) || // Lo [27] HANGUL SYLLABLE IG..HANGUL SYLLABLE IH + (0xC791 <= code && code <= 0xC7AB) || // Lo [27] HANGUL SYLLABLE JAG..HANGUL SYLLABLE JAH + (0xC7AD <= code && code <= 0xC7C7) || // Lo [27] HANGUL SYLLABLE JAEG..HANGUL SYLLABLE JAEH + (0xC7C9 <= code && code <= 0xC7E3) || // Lo [27] HANGUL SYLLABLE JYAG..HANGUL SYLLABLE JYAH + (0xC7E5 <= code && code <= 0xC7FF) || // Lo [27] HANGUL SYLLABLE JYAEG..HANGUL SYLLABLE JYAEH + (0xC801 <= code && code <= 0xC81B) || // Lo [27] HANGUL SYLLABLE JEOG..HANGUL SYLLABLE JEOH + (0xC81D <= code && code <= 0xC837) || // Lo [27] HANGUL SYLLABLE JEG..HANGUL SYLLABLE JEH + (0xC839 <= code && code <= 0xC853) || // Lo [27] HANGUL SYLLABLE JYEOG..HANGUL SYLLABLE JYEOH + (0xC855 <= code && code <= 0xC86F) || // Lo [27] HANGUL SYLLABLE JYEG..HANGUL SYLLABLE JYEH + (0xC871 <= code && code <= 0xC88B) || // Lo [27] HANGUL SYLLABLE JOG..HANGUL SYLLABLE JOH + (0xC88D <= code && code <= 0xC8A7) || // Lo [27] HANGUL SYLLABLE JWAG..HANGUL SYLLABLE JWAH + (0xC8A9 <= code && code <= 0xC8C3) || // Lo [27] HANGUL SYLLABLE JWAEG..HANGUL SYLLABLE JWAEH + (0xC8C5 <= code && code <= 0xC8DF) || // Lo [27] HANGUL SYLLABLE JOEG..HANGUL SYLLABLE JOEH + (0xC8E1 <= code && code <= 0xC8FB) || // Lo [27] HANGUL SYLLABLE JYOG..HANGUL SYLLABLE JYOH + (0xC8FD <= code && code <= 0xC917) || // Lo [27] HANGUL SYLLABLE JUG..HANGUL SYLLABLE JUH + (0xC919 <= code && code <= 0xC933) || // Lo [27] HANGUL SYLLABLE JWEOG..HANGUL SYLLABLE JWEOH + (0xC935 <= code && code <= 0xC94F) || // Lo [27] HANGUL SYLLABLE JWEG..HANGUL SYLLABLE JWEH + (0xC951 <= code && code <= 0xC96B) || // Lo [27] HANGUL SYLLABLE JWIG..HANGUL SYLLABLE JWIH + (0xC96D <= code && code <= 0xC987) || // Lo [27] HANGUL SYLLABLE JYUG..HANGUL SYLLABLE JYUH + (0xC989 <= code && code <= 0xC9A3) || // Lo [27] HANGUL SYLLABLE JEUG..HANGUL SYLLABLE JEUH + (0xC9A5 <= code && code <= 0xC9BF) || // Lo [27] HANGUL SYLLABLE JYIG..HANGUL SYLLABLE JYIH + (0xC9C1 <= code && code <= 0xC9DB) || // Lo [27] HANGUL SYLLABLE JIG..HANGUL SYLLABLE JIH + (0xC9DD <= code && code <= 0xC9F7) || // Lo [27] HANGUL SYLLABLE JJAG..HANGUL SYLLABLE JJAH + (0xC9F9 <= code && code <= 0xCA13) || // Lo [27] HANGUL SYLLABLE JJAEG..HANGUL SYLLABLE JJAEH + (0xCA15 <= code && code <= 0xCA2F) || // Lo [27] HANGUL SYLLABLE JJYAG..HANGUL SYLLABLE JJYAH + (0xCA31 <= code && code <= 0xCA4B) || // Lo [27] HANGUL SYLLABLE JJYAEG..HANGUL SYLLABLE JJYAEH + (0xCA4D <= code && code <= 0xCA67) || // Lo [27] HANGUL SYLLABLE JJEOG..HANGUL SYLLABLE JJEOH + (0xCA69 <= code && code <= 0xCA83) || // Lo [27] HANGUL SYLLABLE JJEG..HANGUL SYLLABLE JJEH + (0xCA85 <= code && code <= 0xCA9F) || // Lo [27] HANGUL SYLLABLE JJYEOG..HANGUL SYLLABLE JJYEOH + (0xCAA1 <= code && code <= 0xCABB) || // Lo [27] HANGUL SYLLABLE JJYEG..HANGUL SYLLABLE JJYEH + (0xCABD <= code && code <= 0xCAD7) || // Lo [27] HANGUL SYLLABLE JJOG..HANGUL SYLLABLE JJOH + (0xCAD9 <= code && code <= 0xCAF3) || // Lo [27] HANGUL SYLLABLE JJWAG..HANGUL SYLLABLE JJWAH + (0xCAF5 <= code && code <= 0xCB0F) || // Lo [27] HANGUL SYLLABLE JJWAEG..HANGUL SYLLABLE JJWAEH + (0xCB11 <= code && code <= 0xCB2B) || // Lo [27] HANGUL SYLLABLE JJOEG..HANGUL SYLLABLE JJOEH + (0xCB2D <= code && code <= 0xCB47) || // Lo [27] HANGUL SYLLABLE JJYOG..HANGUL SYLLABLE JJYOH + (0xCB49 <= code && code <= 0xCB63) || // Lo [27] HANGUL SYLLABLE JJUG..HANGUL SYLLABLE JJUH + (0xCB65 <= code && code <= 0xCB7F) || // Lo [27] HANGUL SYLLABLE JJWEOG..HANGUL SYLLABLE JJWEOH + (0xCB81 <= code && code <= 0xCB9B) || // Lo [27] HANGUL SYLLABLE JJWEG..HANGUL SYLLABLE JJWEH + (0xCB9D <= code && code <= 0xCBB7) || // Lo [27] HANGUL SYLLABLE JJWIG..HANGUL SYLLABLE JJWIH + (0xCBB9 <= code && code <= 0xCBD3) || // Lo [27] HANGUL SYLLABLE JJYUG..HANGUL SYLLABLE JJYUH + (0xCBD5 <= code && code <= 0xCBEF) || // Lo [27] HANGUL SYLLABLE JJEUG..HANGUL SYLLABLE JJEUH + (0xCBF1 <= code && code <= 0xCC0B) || // Lo [27] HANGUL SYLLABLE JJYIG..HANGUL SYLLABLE JJYIH + (0xCC0D <= code && code <= 0xCC27) || // Lo [27] HANGUL SYLLABLE JJIG..HANGUL SYLLABLE JJIH + (0xCC29 <= code && code <= 0xCC43) || // Lo [27] HANGUL SYLLABLE CAG..HANGUL SYLLABLE CAH + (0xCC45 <= code && code <= 0xCC5F) || // Lo [27] HANGUL SYLLABLE CAEG..HANGUL SYLLABLE CAEH + (0xCC61 <= code && code <= 0xCC7B) || // Lo [27] HANGUL SYLLABLE CYAG..HANGUL SYLLABLE CYAH + (0xCC7D <= code && code <= 0xCC97) || // Lo [27] HANGUL SYLLABLE CYAEG..HANGUL SYLLABLE CYAEH + (0xCC99 <= code && code <= 0xCCB3) || // Lo [27] HANGUL SYLLABLE CEOG..HANGUL SYLLABLE CEOH + (0xCCB5 <= code && code <= 0xCCCF) || // Lo [27] HANGUL SYLLABLE CEG..HANGUL SYLLABLE CEH + (0xCCD1 <= code && code <= 0xCCEB) || // Lo [27] HANGUL SYLLABLE CYEOG..HANGUL SYLLABLE CYEOH + (0xCCED <= code && code <= 0xCD07) || // Lo [27] HANGUL SYLLABLE CYEG..HANGUL SYLLABLE CYEH + (0xCD09 <= code && code <= 0xCD23) || // Lo [27] HANGUL SYLLABLE COG..HANGUL SYLLABLE COH + (0xCD25 <= code && code <= 0xCD3F) || // Lo [27] HANGUL SYLLABLE CWAG..HANGUL SYLLABLE CWAH + (0xCD41 <= code && code <= 0xCD5B) || // Lo [27] HANGUL SYLLABLE CWAEG..HANGUL SYLLABLE CWAEH + (0xCD5D <= code && code <= 0xCD77) || // Lo [27] HANGUL SYLLABLE COEG..HANGUL SYLLABLE COEH + (0xCD79 <= code && code <= 0xCD93) || // Lo [27] HANGUL SYLLABLE CYOG..HANGUL SYLLABLE CYOH + (0xCD95 <= code && code <= 0xCDAF) || // Lo [27] HANGUL SYLLABLE CUG..HANGUL SYLLABLE CUH + (0xCDB1 <= code && code <= 0xCDCB) || // Lo [27] HANGUL SYLLABLE CWEOG..HANGUL SYLLABLE CWEOH + (0xCDCD <= code && code <= 0xCDE7) || // Lo [27] HANGUL SYLLABLE CWEG..HANGUL SYLLABLE CWEH + (0xCDE9 <= code && code <= 0xCE03) || // Lo [27] HANGUL SYLLABLE CWIG..HANGUL SYLLABLE CWIH + (0xCE05 <= code && code <= 0xCE1F) || // Lo [27] HANGUL SYLLABLE CYUG..HANGUL SYLLABLE CYUH + (0xCE21 <= code && code <= 0xCE3B) || // Lo [27] HANGUL SYLLABLE CEUG..HANGUL SYLLABLE CEUH + (0xCE3D <= code && code <= 0xCE57) || // Lo [27] HANGUL SYLLABLE CYIG..HANGUL SYLLABLE CYIH + (0xCE59 <= code && code <= 0xCE73) || // Lo [27] HANGUL SYLLABLE CIG..HANGUL SYLLABLE CIH + (0xCE75 <= code && code <= 0xCE8F) || // Lo [27] HANGUL SYLLABLE KAG..HANGUL SYLLABLE KAH + (0xCE91 <= code && code <= 0xCEAB) || // Lo [27] HANGUL SYLLABLE KAEG..HANGUL SYLLABLE KAEH + (0xCEAD <= code && code <= 0xCEC7) || // Lo [27] HANGUL SYLLABLE KYAG..HANGUL SYLLABLE KYAH + (0xCEC9 <= code && code <= 0xCEE3) || // Lo [27] HANGUL SYLLABLE KYAEG..HANGUL SYLLABLE KYAEH + (0xCEE5 <= code && code <= 0xCEFF) || // Lo [27] HANGUL SYLLABLE KEOG..HANGUL SYLLABLE KEOH + (0xCF01 <= code && code <= 0xCF1B) || // Lo [27] HANGUL SYLLABLE KEG..HANGUL SYLLABLE KEH + (0xCF1D <= code && code <= 0xCF37) || // Lo [27] HANGUL SYLLABLE KYEOG..HANGUL SYLLABLE KYEOH + (0xCF39 <= code && code <= 0xCF53) || // Lo [27] HANGUL SYLLABLE KYEG..HANGUL SYLLABLE KYEH + (0xCF55 <= code && code <= 0xCF6F) || // Lo [27] HANGUL SYLLABLE KOG..HANGUL SYLLABLE KOH + (0xCF71 <= code && code <= 0xCF8B) || // Lo [27] HANGUL SYLLABLE KWAG..HANGUL SYLLABLE KWAH + (0xCF8D <= code && code <= 0xCFA7) || // Lo [27] HANGUL SYLLABLE KWAEG..HANGUL SYLLABLE KWAEH + (0xCFA9 <= code && code <= 0xCFC3) || // Lo [27] HANGUL SYLLABLE KOEG..HANGUL SYLLABLE KOEH + (0xCFC5 <= code && code <= 0xCFDF) || // Lo [27] HANGUL SYLLABLE KYOG..HANGUL SYLLABLE KYOH + (0xCFE1 <= code && code <= 0xCFFB) || // Lo [27] HANGUL SYLLABLE KUG..HANGUL SYLLABLE KUH + (0xCFFD <= code && code <= 0xD017) || // Lo [27] HANGUL SYLLABLE KWEOG..HANGUL SYLLABLE KWEOH + (0xD019 <= code && code <= 0xD033) || // Lo [27] HANGUL SYLLABLE KWEG..HANGUL SYLLABLE KWEH + (0xD035 <= code && code <= 0xD04F) || // Lo [27] HANGUL SYLLABLE KWIG..HANGUL SYLLABLE KWIH + (0xD051 <= code && code <= 0xD06B) || // Lo [27] HANGUL SYLLABLE KYUG..HANGUL SYLLABLE KYUH + (0xD06D <= code && code <= 0xD087) || // Lo [27] HANGUL SYLLABLE KEUG..HANGUL SYLLABLE KEUH + (0xD089 <= code && code <= 0xD0A3) || // Lo [27] HANGUL SYLLABLE KYIG..HANGUL SYLLABLE KYIH + (0xD0A5 <= code && code <= 0xD0BF) || // Lo [27] HANGUL SYLLABLE KIG..HANGUL SYLLABLE KIH + (0xD0C1 <= code && code <= 0xD0DB) || // Lo [27] HANGUL SYLLABLE TAG..HANGUL SYLLABLE TAH + (0xD0DD <= code && code <= 0xD0F7) || // Lo [27] HANGUL SYLLABLE TAEG..HANGUL SYLLABLE TAEH + (0xD0F9 <= code && code <= 0xD113) || // Lo [27] HANGUL SYLLABLE TYAG..HANGUL SYLLABLE TYAH + (0xD115 <= code && code <= 0xD12F) || // Lo [27] HANGUL SYLLABLE TYAEG..HANGUL SYLLABLE TYAEH + (0xD131 <= code && code <= 0xD14B) || // Lo [27] HANGUL SYLLABLE TEOG..HANGUL SYLLABLE TEOH + (0xD14D <= code && code <= 0xD167) || // Lo [27] HANGUL SYLLABLE TEG..HANGUL SYLLABLE TEH + (0xD169 <= code && code <= 0xD183) || // Lo [27] HANGUL SYLLABLE TYEOG..HANGUL SYLLABLE TYEOH + (0xD185 <= code && code <= 0xD19F) || // Lo [27] HANGUL SYLLABLE TYEG..HANGUL SYLLABLE TYEH + (0xD1A1 <= code && code <= 0xD1BB) || // Lo [27] HANGUL SYLLABLE TOG..HANGUL SYLLABLE TOH + (0xD1BD <= code && code <= 0xD1D7) || // Lo [27] HANGUL SYLLABLE TWAG..HANGUL SYLLABLE TWAH + (0xD1D9 <= code && code <= 0xD1F3) || // Lo [27] HANGUL SYLLABLE TWAEG..HANGUL SYLLABLE TWAEH + (0xD1F5 <= code && code <= 0xD20F) || // Lo [27] HANGUL SYLLABLE TOEG..HANGUL SYLLABLE TOEH + (0xD211 <= code && code <= 0xD22B) || // Lo [27] HANGUL SYLLABLE TYOG..HANGUL SYLLABLE TYOH + (0xD22D <= code && code <= 0xD247) || // Lo [27] HANGUL SYLLABLE TUG..HANGUL SYLLABLE TUH + (0xD249 <= code && code <= 0xD263) || // Lo [27] HANGUL SYLLABLE TWEOG..HANGUL SYLLABLE TWEOH + (0xD265 <= code && code <= 0xD27F) || // Lo [27] HANGUL SYLLABLE TWEG..HANGUL SYLLABLE TWEH + (0xD281 <= code && code <= 0xD29B) || // Lo [27] HANGUL SYLLABLE TWIG..HANGUL SYLLABLE TWIH + (0xD29D <= code && code <= 0xD2B7) || // Lo [27] HANGUL SYLLABLE TYUG..HANGUL SYLLABLE TYUH + (0xD2B9 <= code && code <= 0xD2D3) || // Lo [27] HANGUL SYLLABLE TEUG..HANGUL SYLLABLE TEUH + (0xD2D5 <= code && code <= 0xD2EF) || // Lo [27] HANGUL SYLLABLE TYIG..HANGUL SYLLABLE TYIH + (0xD2F1 <= code && code <= 0xD30B) || // Lo [27] HANGUL SYLLABLE TIG..HANGUL SYLLABLE TIH + (0xD30D <= code && code <= 0xD327) || // Lo [27] HANGUL SYLLABLE PAG..HANGUL SYLLABLE PAH + (0xD329 <= code && code <= 0xD343) || // Lo [27] HANGUL SYLLABLE PAEG..HANGUL SYLLABLE PAEH + (0xD345 <= code && code <= 0xD35F) || // Lo [27] HANGUL SYLLABLE PYAG..HANGUL SYLLABLE PYAH + (0xD361 <= code && code <= 0xD37B) || // Lo [27] HANGUL SYLLABLE PYAEG..HANGUL SYLLABLE PYAEH + (0xD37D <= code && code <= 0xD397) || // Lo [27] HANGUL SYLLABLE PEOG..HANGUL SYLLABLE PEOH + (0xD399 <= code && code <= 0xD3B3) || // Lo [27] HANGUL SYLLABLE PEG..HANGUL SYLLABLE PEH + (0xD3B5 <= code && code <= 0xD3CF) || // Lo [27] HANGUL SYLLABLE PYEOG..HANGUL SYLLABLE PYEOH + (0xD3D1 <= code && code <= 0xD3EB) || // Lo [27] HANGUL SYLLABLE PYEG..HANGUL SYLLABLE PYEH + (0xD3ED <= code && code <= 0xD407) || // Lo [27] HANGUL SYLLABLE POG..HANGUL SYLLABLE POH + (0xD409 <= code && code <= 0xD423) || // Lo [27] HANGUL SYLLABLE PWAG..HANGUL SYLLABLE PWAH + (0xD425 <= code && code <= 0xD43F) || // Lo [27] HANGUL SYLLABLE PWAEG..HANGUL SYLLABLE PWAEH + (0xD441 <= code && code <= 0xD45B) || // Lo [27] HANGUL SYLLABLE POEG..HANGUL SYLLABLE POEH + (0xD45D <= code && code <= 0xD477) || // Lo [27] HANGUL SYLLABLE PYOG..HANGUL SYLLABLE PYOH + (0xD479 <= code && code <= 0xD493) || // Lo [27] HANGUL SYLLABLE PUG..HANGUL SYLLABLE PUH + (0xD495 <= code && code <= 0xD4AF) || // Lo [27] HANGUL SYLLABLE PWEOG..HANGUL SYLLABLE PWEOH + (0xD4B1 <= code && code <= 0xD4CB) || // Lo [27] HANGUL SYLLABLE PWEG..HANGUL SYLLABLE PWEH + (0xD4CD <= code && code <= 0xD4E7) || // Lo [27] HANGUL SYLLABLE PWIG..HANGUL SYLLABLE PWIH + (0xD4E9 <= code && code <= 0xD503) || // Lo [27] HANGUL SYLLABLE PYUG..HANGUL SYLLABLE PYUH + (0xD505 <= code && code <= 0xD51F) || // Lo [27] HANGUL SYLLABLE PEUG..HANGUL SYLLABLE PEUH + (0xD521 <= code && code <= 0xD53B) || // Lo [27] HANGUL SYLLABLE PYIG..HANGUL SYLLABLE PYIH + (0xD53D <= code && code <= 0xD557) || // Lo [27] HANGUL SYLLABLE PIG..HANGUL SYLLABLE PIH + (0xD559 <= code && code <= 0xD573) || // Lo [27] HANGUL SYLLABLE HAG..HANGUL SYLLABLE HAH + (0xD575 <= code && code <= 0xD58F) || // Lo [27] HANGUL SYLLABLE HAEG..HANGUL SYLLABLE HAEH + (0xD591 <= code && code <= 0xD5AB) || // Lo [27] HANGUL SYLLABLE HYAG..HANGUL SYLLABLE HYAH + (0xD5AD <= code && code <= 0xD5C7) || // Lo [27] HANGUL SYLLABLE HYAEG..HANGUL SYLLABLE HYAEH + (0xD5C9 <= code && code <= 0xD5E3) || // Lo [27] HANGUL SYLLABLE HEOG..HANGUL SYLLABLE HEOH + (0xD5E5 <= code && code <= 0xD5FF) || // Lo [27] HANGUL SYLLABLE HEG..HANGUL SYLLABLE HEH + (0xD601 <= code && code <= 0xD61B) || // Lo [27] HANGUL SYLLABLE HYEOG..HANGUL SYLLABLE HYEOH + (0xD61D <= code && code <= 0xD637) || // Lo [27] HANGUL SYLLABLE HYEG..HANGUL SYLLABLE HYEH + (0xD639 <= code && code <= 0xD653) || // Lo [27] HANGUL SYLLABLE HOG..HANGUL SYLLABLE HOH + (0xD655 <= code && code <= 0xD66F) || // Lo [27] HANGUL SYLLABLE HWAG..HANGUL SYLLABLE HWAH + (0xD671 <= code && code <= 0xD68B) || // Lo [27] HANGUL SYLLABLE HWAEG..HANGUL SYLLABLE HWAEH + (0xD68D <= code && code <= 0xD6A7) || // Lo [27] HANGUL SYLLABLE HOEG..HANGUL SYLLABLE HOEH + (0xD6A9 <= code && code <= 0xD6C3) || // Lo [27] HANGUL SYLLABLE HYOG..HANGUL SYLLABLE HYOH + (0xD6C5 <= code && code <= 0xD6DF) || // Lo [27] HANGUL SYLLABLE HUG..HANGUL SYLLABLE HUH + (0xD6E1 <= code && code <= 0xD6FB) || // Lo [27] HANGUL SYLLABLE HWEOG..HANGUL SYLLABLE HWEOH + (0xD6FD <= code && code <= 0xD717) || // Lo [27] HANGUL SYLLABLE HWEG..HANGUL SYLLABLE HWEH + (0xD719 <= code && code <= 0xD733) || // Lo [27] HANGUL SYLLABLE HWIG..HANGUL SYLLABLE HWIH + (0xD735 <= code && code <= 0xD74F) || // Lo [27] HANGUL SYLLABLE HYUG..HANGUL SYLLABLE HYUH + (0xD751 <= code && code <= 0xD76B) || // Lo [27] HANGUL SYLLABLE HEUG..HANGUL SYLLABLE HEUH + (0xD76D <= code && code <= 0xD787) || // Lo [27] HANGUL SYLLABLE HYIG..HANGUL SYLLABLE HYIH + (0xD789 <= code && code <= 0xD7A3) // Lo [27] HANGUL SYLLABLE HIG..HANGUL SYLLABLE HIH + ){ + return LVT; + } + + if( + 0x261D == code || // So WHITE UP POINTING INDEX + 0x26F9 == code || // So PERSON WITH BALL + (0x270A <= code && code <= 0x270D) || // So [4] RAISED FIST..WRITING HAND + 0x1F385 == code || // So FATHER CHRISTMAS + (0x1F3C2 <= code && code <= 0x1F3C4) || // So [3] SNOWBOARDER..SURFER + 0x1F3C7 == code || // So HORSE RACING + (0x1F3CA <= code && code <= 0x1F3CC) || // So [3] SWIMMER..GOLFER + (0x1F442 <= code && code <= 0x1F443) || // So [2] EAR..NOSE + (0x1F446 <= code && code <= 0x1F450) || // So [11] WHITE UP POINTING BACKHAND INDEX..OPEN HANDS SIGN + 0x1F46E == code || // So POLICE OFFICER + (0x1F470 <= code && code <= 0x1F478) || // So [9] BRIDE WITH VEIL..PRINCESS + 0x1F47C == code || // So BABY ANGEL + (0x1F481 <= code && code <= 0x1F483) || // So [3] INFORMATION DESK PERSON..DANCER + (0x1F485 <= code && code <= 0x1F487) || // So [3] NAIL POLISH..HAIRCUT + 0x1F4AA == code || // So FLEXED BICEPS + (0x1F574 <= code && code <= 0x1F575) || // So [2] MAN IN BUSINESS SUIT LEVITATING..SLEUTH OR SPY + 0x1F57A == code || // So MAN DANCING + 0x1F590 == code || // So RAISED HAND WITH FINGERS SPLAYED + (0x1F595 <= code && code <= 0x1F596) || // So [2] REVERSED HAND WITH MIDDLE FINGER EXTENDED..RAISED HAND WITH PART BETWEEN MIDDLE AND RING FINGERS + (0x1F645 <= code && code <= 0x1F647) || // So [3] FACE WITH NO GOOD GESTURE..PERSON BOWING DEEPLY + (0x1F64B <= code && code <= 0x1F64F) || // So [5] HAPPY PERSON RAISING ONE HAND..PERSON WITH FOLDED HANDS + 0x1F6A3 == code || // So ROWBOAT + (0x1F6B4 <= code && code <= 0x1F6B6) || // So [3] BICYCLIST..PEDESTRIAN + 0x1F6C0 == code || // So BATH + 0x1F6CC == code || // So SLEEPING ACCOMMODATION + (0x1F918 <= code && code <= 0x1F91C) || // So [5] SIGN OF THE HORNS..RIGHT-FACING FIST + (0x1F91E <= code && code <= 0x1F91F) || // So [2] HAND WITH INDEX AND MIDDLE FINGERS CROSSED..I LOVE YOU HAND SIGN + 0x1F926 == code || // So FACE PALM + (0x1F930 <= code && code <= 0x1F939) || // So [10] PREGNANT WOMAN..JUGGLING + (0x1F93D <= code && code <= 0x1F93E) || // So [2] WATER POLO..HANDBALL + (0x1F9D1 <= code && code <= 0x1F9DD) // So [13] ADULT..ELF + ){ + return E_Base; + } + + if( + (0x1F3FB <= code && code <= 0x1F3FF) // Sk [5] EMOJI MODIFIER FITZPATRICK TYPE-1-2..EMOJI MODIFIER FITZPATRICK TYPE-6 + ){ + return E_Modifier; + } + + if( + 0x200D == code // Cf ZERO WIDTH JOINER + ){ + return ZWJ; + } + + if( + 0x2640 == code || // So FEMALE SIGN + 0x2642 == code || // So MALE SIGN + (0x2695 <= code && code <= 0x2696) || // So [2] STAFF OF AESCULAPIUS..SCALES + 0x2708 == code || // So AIRPLANE + 0x2764 == code || // So HEAVY BLACK HEART + 0x1F308 == code || // So RAINBOW + 0x1F33E == code || // So EAR OF RICE + 0x1F373 == code || // So COOKING + 0x1F393 == code || // So GRADUATION CAP + 0x1F3A4 == code || // So MICROPHONE + 0x1F3A8 == code || // So ARTIST PALETTE + 0x1F3EB == code || // So SCHOOL + 0x1F3ED == code || // So FACTORY + 0x1F48B == code || // So KISS MARK + (0x1F4BB <= code && code <= 0x1F4BC) || // So [2] PERSONAL COMPUTER..BRIEFCASE + 0x1F527 == code || // So WRENCH + 0x1F52C == code || // So MICROSCOPE + 0x1F5E8 == code || // So LEFT SPEECH BUBBLE + 0x1F680 == code || // So ROCKET + 0x1F692 == code // So FIRE ENGINE + ){ + return Glue_After_Zwj; + } + + if( + (0x1F466 <= code && code <= 0x1F469) // So [4] BOY..WOMAN + ){ + return E_Base_GAZ; + } + + + //all unlisted characters have a grapheme break property of "Other" + return Other; + } + return this; +} + +var graphemeSplitter = GraphemeSplitter; + +var extractors$2 = createCommonjsModule(function (module, exports) { +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); + + + +const splitter = new graphemeSplitter(); +class ChoiceExtractor { + constructor(config) { + this.config = config; + } + extract(source) { + let results = new Array(); + let trimmedSource = source.toLowerCase(); + if (recognizersText.StringUtility.isNullOrWhitespace(source)) { + return results; + } + let partialResults = new Array(); + let sourceTokens = this.tokenize(trimmedSource); + this.config.regexesMap.forEach((typeExtracted, regex) => { + recognizersText.RegExpUtility.getMatches(regex, trimmedSource).forEach(match => { + let matchTokens = this.tokenize(match.value); + let topScore = sourceTokens + .map((sToken, index) => this.matchValue(sourceTokens, matchTokens, index)) + .reduce((top, value) => top = Math.max(top, value), 0.0); + if (topScore > 0.0) { + let start = match.index; + let length = match.length; + let text = source.substr(start, length).trim(); + partialResults.push({ + start: start, + length: length, + text: text, + type: typeExtracted, + data: { + source: source, + score: topScore + } + }); + } + }); + }); + if (partialResults.length === 0) { + return results; + } + partialResults = partialResults.sort((a, b) => a.start - b.start); + if (this.config.onlyTopMatch) { + let topResult = partialResults.reduce((top, value) => top = top.data.score < value.data.score ? value : top, partialResults[0]); + topResult.data.otherMatches = partialResults.filter(r => r !== topResult); + results.push(topResult); + } + else { + results = partialResults; + } + return results; + } + matchValue(source, match, startPos) { + let matched = 0; + let totalDeviation = 0; + match.forEach(matchToken => { + let pos = source.indexOf(matchToken, startPos); + if (pos >= 0) { + let distance = matched > 0 ? pos - startPos : 0; + if (distance <= this.config.maxDistance) { + matched++; + totalDeviation += distance; + startPos = pos + 1; + } + } + }); + let score = 0.0; + if (matched > 0 && (matched === match.length || this.config.allowPartialMatch)) { + let completeness = matched / match.length; + let accuracy = completeness * (matched / (matched + totalDeviation)); + let initialScore = accuracy * (matched / source.length); + score = 0.4 + (0.6 * initialScore); + } + return score; + } + tokenize(source) { + let tokens = []; + let chars = splitter.splitGraphemes(source); + let token = ''; + chars.forEach(c => { + let codePoint = c.codePointAt(0) || c.charAt(0); + if (codePoint > 0xFFFF) { + // Character is in a Supplementary Unicode Plane. This is where emoji live so + // we're going to just break each character in this range out as its own token. + tokens.push(c); + if (!recognizersText.StringUtility.isNullOrWhitespace(token)) { + tokens.push(token); + token = ''; + } + } + else if (!(this.config.tokenRegex.test(c) || recognizersText.StringUtility.isWhitespace(c))) { + token = token.concat(c); + } + else if (!recognizersText.StringUtility.isNullOrWhitespace(token)) { + tokens.push(token); + token = ''; + } + }); + if (!recognizersText.StringUtility.isNullOrWhitespace(token)) { + tokens.push(token); + token = ''; + } + return tokens; + } +} +exports.ChoiceExtractor = ChoiceExtractor; +class BooleanExtractor extends ChoiceExtractor { + constructor(config) { + let regexesMap = new Map() + .set(config.regexTrue, constants.Constants.SYS_BOOLEAN_TRUE) + .set(config.regexFalse, constants.Constants.SYS_BOOLEAN_FALSE); + let optionsConfig = { + regexesMap: regexesMap, + tokenRegex: config.tokenRegex, + allowPartialMatch: false, + maxDistance: 2, + onlyTopMatch: config.onlyTopMatch + }; + super(optionsConfig); + this.extractType = constants.Constants.SYS_BOOLEAN; + } +} +BooleanExtractor.booleanTrue = constants.Constants.SYS_BOOLEAN_TRUE; +BooleanExtractor.booleanFalse = constants.Constants.SYS_BOOLEAN_FALSE; +exports.BooleanExtractor = BooleanExtractor; + +}); + +unwrapExports(extractors$2); + +var parsers$2 = createCommonjsModule(function (module, exports) { +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); + + +class ChoiceParser { + constructor(config) { + this.config = config; + } + parse(extResult) { + let result = new recognizersText.ParseResult(extResult); + result.value = this.config.resolutions.get(result.type); + if (result.data.otherMatches) { + result.data.otherMatches = result.data.otherMatches.map(m => { + let r = new recognizersText.ParseResult(m); + r.value = this.config.resolutions.get(r.type); + return r; + }); + } + return result; + } +} +exports.ChoiceParser = ChoiceParser; +class BooleanParser extends ChoiceParser { + constructor() { + let resolutions = new Map([ + [constants.Constants.SYS_BOOLEAN_TRUE, true], + [constants.Constants.SYS_BOOLEAN_FALSE, false] + ]); + let config = { + resolutions: resolutions + }; + super(config); + } +} +exports.BooleanParser = BooleanParser; + +}); + +unwrapExports(parsers$2); + +var englishChoice = createCommonjsModule(function (module, exports) { +"use strict"; +// ------------------------------------------------------------------------------ +// +// This code was generated by a tool. +// Changes to this file may cause incorrect behavior and will be lost if +// the code is regenerated. +// +// ------------------------------------------------------------------------------ +Object.defineProperty(exports, "__esModule", { value: true }); +var EnglishChoice; +(function (EnglishChoice) { + EnglishChoice.LangMarker = 'Eng'; + EnglishChoice.TokenizerRegex = `[^\\w\\d]`; + EnglishChoice.TrueRegex = `\\b(true|yes|yep|y|sure|ok|agree)\\b|(\\uD83D\\uDC4D|\\uD83D\\uDC4C)`; + EnglishChoice.FalseRegex = `\\b(false|nope|nop|no|not\\s+ok|disagree)\\b|(\\uD83D\\uDC4E|\\u270B|\\uD83D\\uDD90)`; +})(EnglishChoice = exports.EnglishChoice || (exports.EnglishChoice = {})); + +}); + +unwrapExports(englishChoice); + +var boolean_1 = createCommonjsModule(function (module, exports) { +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); + + +class EnglishBooleanExtractorConfiguration { + constructor(onlyTopMatch = true) { + this.regexTrue = recognizersText.RegExpUtility.getSafeRegExp(englishChoice.EnglishChoice.TrueRegex); + this.regexFalse = recognizersText.RegExpUtility.getSafeRegExp(englishChoice.EnglishChoice.FalseRegex); + this.tokenRegex = recognizersText.RegExpUtility.getSafeRegExp(englishChoice.EnglishChoice.TokenizerRegex, 'is'); + this.onlyTopMatch = onlyTopMatch; + } +} +exports.EnglishBooleanExtractorConfiguration = EnglishBooleanExtractorConfiguration; + +}); + +unwrapExports(boolean_1); + +var frenchChoice = createCommonjsModule(function (module, exports) { +"use strict"; +// ------------------------------------------------------------------------------ +// +// This code was generated by a tool. +// Changes to this file may cause incorrect behavior and will be lost if +// the code is regenerated. +// +// ------------------------------------------------------------------------------ +Object.defineProperty(exports, "__esModule", { value: true }); +var FrenchChoice; +(function (FrenchChoice) { + FrenchChoice.LangMarker = 'Fr'; + FrenchChoice.TokenizerRegex = `[^\\w\\d\\u00E0-\\u00FC]`; + FrenchChoice.TrueRegex = `\\b(s[uû]r|ouais|oui|yep|y|sure|approuver|accepter|consentir|d'accord|ça march[eé])\\b|(\\uD83D\\uDC4D|\\uD83D\\uDC4C)`; + FrenchChoice.FalseRegex = `\\b(faux|nan|non|pas\\s+d'accord|pas\\s+concorder|n'est\\s+pas\\s+(correct|ok)|pas)\\b|(\\uD83D\\uDC4E|\\u270B|\\uD83D\\uDD90)`; +})(FrenchChoice = exports.FrenchChoice || (exports.FrenchChoice = {})); + +}); + +unwrapExports(frenchChoice); + +var boolean_1$1 = createCommonjsModule(function (module, exports) { +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); + + +class FrenchBooleanExtractorConfiguration { + constructor(onlyTopMatch = true) { + this.regexTrue = recognizersText.RegExpUtility.getSafeRegExp(frenchChoice.FrenchChoice.TrueRegex); + this.regexFalse = recognizersText.RegExpUtility.getSafeRegExp(frenchChoice.FrenchChoice.FalseRegex); + this.tokenRegex = recognizersText.RegExpUtility.getSafeRegExp(frenchChoice.FrenchChoice.TokenizerRegex, 'is'); + this.onlyTopMatch = onlyTopMatch; + } +} +exports.FrenchBooleanExtractorConfiguration = FrenchBooleanExtractorConfiguration; + +}); + +unwrapExports(boolean_1$1); + +var germanChoice = createCommonjsModule(function (module, exports) { +"use strict"; +// ------------------------------------------------------------------------------ +// +// This code was generated by a tool. +// Changes to this file may cause incorrect behavior and will be lost if +// the code is regenerated. +// +// ------------------------------------------------------------------------------ +Object.defineProperty(exports, "__esModule", { value: true }); +var GermanChoice; +(function (GermanChoice) { + GermanChoice.LangMarker = 'Ger'; + GermanChoice.TokenizerRegex = `[^\\w\\d\\u00E0-\\u00FC]`; + GermanChoice.TrueRegex = `\\b(wahr|ja|jep|j|sicher|ok|einverstanden|mit\\s+Sicherheit|sicherlich|jap|mache ich)\\b|(\\uD83D\\uDC4D|\\uD83D\\uDC4C)`; + GermanChoice.FalseRegex = `\\b(falsch|nein|ne|nö|nicht\\s+ok|nicht\\s+einverstanden|n)\\b|(\\uD83D\\uDC4E|\\u270B|\\uD83D\\uDD90)`; +})(GermanChoice = exports.GermanChoice || (exports.GermanChoice = {})); + +}); + +unwrapExports(germanChoice); + +var boolean_1$2 = createCommonjsModule(function (module, exports) { +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); + + +class GermanBooleanExtractorConfiguration { + constructor(onlyTopMatch = true) { + this.regexTrue = recognizersText.RegExpUtility.getSafeRegExp(germanChoice.GermanChoice.TrueRegex); + this.regexFalse = recognizersText.RegExpUtility.getSafeRegExp(germanChoice.GermanChoice.FalseRegex); + this.tokenRegex = recognizersText.RegExpUtility.getSafeRegExp(germanChoice.GermanChoice.TokenizerRegex, 'is'); + this.onlyTopMatch = onlyTopMatch; + } +} +exports.GermanBooleanExtractorConfiguration = GermanBooleanExtractorConfiguration; + +}); + +unwrapExports(boolean_1$2); + +var japaneseChoice = createCommonjsModule(function (module, exports) { +"use strict"; +// ------------------------------------------------------------------------------ +// +// This code was generated by a tool. +// Changes to this file may cause incorrect behavior and will be lost if +// the code is regenerated. +// +// ------------------------------------------------------------------------------ +Object.defineProperty(exports, "__esModule", { value: true }); +var JapaneseChoice; +(function (JapaneseChoice) { + JapaneseChoice.LangMarker = 'Jpn'; + JapaneseChoice.TokenizerRegex = `[^\\w\\d\\u3040-\\u309f\\u30a0-\\u30ff\\uff00-\\uff9f\\u4e00-\\u9faf\\u3400-\\u4dbf]`; + JapaneseChoice.TrueRegex = `(はい(!)*|そうです|よい(です)*)|(\\uD83D\\uDC4D|\\uD83D\\uDC4C)`; + JapaneseChoice.FalseRegex = `(いいえ|ではありません|ではない|じゃない|じゃありません)|(\\uD83D\\uDC4E|\\u270B|\\uD83D\\uDD90)`; +})(JapaneseChoice = exports.JapaneseChoice || (exports.JapaneseChoice = {})); + +}); + +unwrapExports(japaneseChoice); + +var boolean_1$3 = createCommonjsModule(function (module, exports) { +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); + + +class JapaneseBooleanExtractorConfiguration { + constructor(onlyTopMatch = true) { + this.regexTrue = recognizersText.RegExpUtility.getSafeRegExp(japaneseChoice.JapaneseChoice.TrueRegex); + this.regexFalse = recognizersText.RegExpUtility.getSafeRegExp(japaneseChoice.JapaneseChoice.FalseRegex); + this.tokenRegex = recognizersText.RegExpUtility.getSafeRegExp(japaneseChoice.JapaneseChoice.TokenizerRegex, 'is'); + this.onlyTopMatch = onlyTopMatch; + } +} +exports.JapaneseBooleanExtractorConfiguration = JapaneseBooleanExtractorConfiguration; + +}); + +unwrapExports(boolean_1$3); + +var portugueseChoice = createCommonjsModule(function (module, exports) { +"use strict"; +// ------------------------------------------------------------------------------ +// +// This code was generated by a tool. +// Changes to this file may cause incorrect behavior and will be lost if +// the code is regenerated. +// +// ------------------------------------------------------------------------------ +Object.defineProperty(exports, "__esModule", { value: true }); +var PortugueseChoice; +(function (PortugueseChoice) { + PortugueseChoice.LangMarker = 'Por'; + PortugueseChoice.TokenizerRegex = `[^\\w\\d\\u00E0-\\u00FC]`; + PortugueseChoice.TrueRegex = `\\b(verdade|verdadeir[oa]|sim|isso|claro|ok)\\b|(\\uD83D\\uDC4D|\\uD83D\\uDC4C)`; + PortugueseChoice.FalseRegex = `\\b(falso|n[aã]o|incorreto|nada disso)\\b|(\\uD83D\\uDC4E|\\u270B|\\uD83D\\uDD90)`; +})(PortugueseChoice = exports.PortugueseChoice || (exports.PortugueseChoice = {})); + +}); + +unwrapExports(portugueseChoice); + +var boolean_1$4 = createCommonjsModule(function (module, exports) { +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); + + +class PortugueseBooleanExtractorConfiguration { + constructor(onlyTopMatch = true) { + this.regexTrue = recognizersText.RegExpUtility.getSafeRegExp(portugueseChoice.PortugueseChoice.TrueRegex); + this.regexFalse = recognizersText.RegExpUtility.getSafeRegExp(portugueseChoice.PortugueseChoice.FalseRegex); + this.tokenRegex = recognizersText.RegExpUtility.getSafeRegExp(portugueseChoice.PortugueseChoice.TokenizerRegex, 'is'); + this.onlyTopMatch = onlyTopMatch; + } +} +exports.PortugueseBooleanExtractorConfiguration = PortugueseBooleanExtractorConfiguration; + +}); + +unwrapExports(boolean_1$4); + +var spanishChoice = createCommonjsModule(function (module, exports) { +"use strict"; +// ------------------------------------------------------------------------------ +// +// This code was generated by a tool. +// Changes to this file may cause incorrect behavior and will be lost if +// the code is regenerated. +// +// ------------------------------------------------------------------------------ +Object.defineProperty(exports, "__esModule", { value: true }); +var SpanishChoice; +(function (SpanishChoice) { + SpanishChoice.LangMarker = 'Spa'; + SpanishChoice.TokenizerRegex = `[^\\w\\d\\u00E0-\\u00FC]`; + SpanishChoice.TrueRegex = `\\b(verdad|verdadero|sí|sip|s|si|cierto|por supuesto|ok)\\b|(\\uD83D\\uDC4D|\\uD83D\\uDC4C)`; + SpanishChoice.FalseRegex = `\\b(falso|no|nop|n|no)\\b|(\\uD83D\\uDC4E|\\u270B|\\uD83D\\uDD90)`; +})(SpanishChoice = exports.SpanishChoice || (exports.SpanishChoice = {})); + +}); + +unwrapExports(spanishChoice); + +var boolean_1$5 = createCommonjsModule(function (module, exports) { +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); + + +class SpanishBooleanExtractorConfiguration { + constructor(onlyTopMatch = true) { + this.regexTrue = recognizersText.RegExpUtility.getSafeRegExp(spanishChoice.SpanishChoice.TrueRegex); + this.regexFalse = recognizersText.RegExpUtility.getSafeRegExp(spanishChoice.SpanishChoice.FalseRegex); + this.tokenRegex = recognizersText.RegExpUtility.getSafeRegExp(spanishChoice.SpanishChoice.TokenizerRegex, 'is'); + this.onlyTopMatch = onlyTopMatch; + } +} +exports.SpanishBooleanExtractorConfiguration = SpanishBooleanExtractorConfiguration; + +}); + +unwrapExports(boolean_1$5); + +var chineseChoice = createCommonjsModule(function (module, exports) { +"use strict"; +// ------------------------------------------------------------------------------ +// +// This code was generated by a tool. +// Changes to this file may cause incorrect behavior and will be lost if +// the code is regenerated. +// +// ------------------------------------------------------------------------------ +Object.defineProperty(exports, "__esModule", { value: true }); +var ChineseChoice; +(function (ChineseChoice) { + ChineseChoice.LangMarker = 'Chs'; + ChineseChoice.TokenizerRegex = `[^\\u3040-\\u30ff\\u3400-\\u4dbf\\u4e00-\\u9fff\\uf900-\\ufaff\\uff66-\\uff9f]`; + ChineseChoice.TrueRegex = `(好[的啊呀嘞哇]|没问题|可以|中|好|同意|行|是的|是|对)|(\\uD83D\\uDC4D|\\uD83D\\uDC4C)`; + ChineseChoice.FalseRegex = `(不行|不好|拒绝|否定|不中|不可以|不是的|不是|不对|不)|(\\uD83D\\uDC4E|\\u270B|\\uD83D\\uDD90)`; +})(ChineseChoice = exports.ChineseChoice || (exports.ChineseChoice = {})); + +}); + +unwrapExports(chineseChoice); + +var boolean_1$6 = createCommonjsModule(function (module, exports) { +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); + + +class ChineseBooleanExtractorConfiguration { + constructor(onlyTopMatch = true) { + this.regexTrue = recognizersText.RegExpUtility.getSafeRegExp(chineseChoice.ChineseChoice.TrueRegex); + this.regexFalse = recognizersText.RegExpUtility.getSafeRegExp(chineseChoice.ChineseChoice.FalseRegex); + this.tokenRegex = recognizersText.RegExpUtility.getSafeRegExp(chineseChoice.ChineseChoice.TokenizerRegex, 'is'); + this.onlyTopMatch = onlyTopMatch; + } +} +exports.ChineseBooleanExtractorConfiguration = ChineseBooleanExtractorConfiguration; + +}); + +unwrapExports(boolean_1$6); + +var choiceRecognizer = createCommonjsModule(function (module, exports) { +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); + + + + + + + + + + + +var ChoiceOptions; +(function (ChoiceOptions) { + ChoiceOptions[ChoiceOptions["None"] = 0] = "None"; +})(ChoiceOptions = exports.ChoiceOptions || (exports.ChoiceOptions = {})); +function recognizeBoolean(query, culture, options = ChoiceOptions.None, fallbackToDefaultCulture = true) { + let recognizer = new ChoiceRecognizer(culture, options); + let model = recognizer.getBooleanModel(culture, fallbackToDefaultCulture); + return model.parse(query); +} +exports.recognizeBoolean = recognizeBoolean; +class ChoiceRecognizer extends recognizersText.Recognizer { + constructor(culture, options = ChoiceOptions.None, lazyInitialization = false) { + super(culture, options, lazyInitialization); + } + InitializeConfiguration() { + //#region English + this.registerModel("BooleanModel", recognizersText.Culture.English, (options) => new models$2.BooleanModel(new parsers$2.BooleanParser(), new extractors$2.BooleanExtractor(new boolean_1.EnglishBooleanExtractorConfiguration()))); + //#endregion + //#region Japanese + this.registerModel("BooleanModel", recognizersText.Culture.Japanese, (options) => new models$2.BooleanModel(new parsers$2.BooleanParser(), new extractors$2.BooleanExtractor(new boolean_1$3.JapaneseBooleanExtractorConfiguration()))); + //#endregion + //#region Portuguese + this.registerModel("BooleanModel", recognizersText.Culture.Portuguese, (options) => new models$2.BooleanModel(new parsers$2.BooleanParser(), new extractors$2.BooleanExtractor(new boolean_1$4.PortugueseBooleanExtractorConfiguration()))); + //#endregion + //#region Spanish + this.registerModel("BooleanModel", recognizersText.Culture.Spanish, (options) => new models$2.BooleanModel(new parsers$2.BooleanParser(), new extractors$2.BooleanExtractor(new boolean_1$5.SpanishBooleanExtractorConfiguration()))); + //#endregion + //#region Chinese + this.registerModel("BooleanModel", recognizersText.Culture.Chinese, (options) => new models$2.BooleanModel(new parsers$2.BooleanParser(), new extractors$2.BooleanExtractor(new boolean_1$6.ChineseBooleanExtractorConfiguration()))); + //#endregion + //#region French + this.registerModel("BooleanModel", recognizersText.Culture.French, (options) => new models$2.BooleanModel(new parsers$2.BooleanParser(), new extractors$2.BooleanExtractor(new boolean_1$1.FrenchBooleanExtractorConfiguration()))); + //#endregion + //#region German + this.registerModel("BooleanModel", recognizersText.Culture.German, (options) => new models$2.BooleanModel(new parsers$2.BooleanParser(), new extractors$2.BooleanExtractor(new boolean_1$2.GermanBooleanExtractorConfiguration()))); + //#endregion + } + IsValidOptions(options) { + return options >= 0 && options <= ChoiceOptions.None; + } + getBooleanModel(culture = null, fallbackToDefaultCulture = true) { + return this.getModel("BooleanModel", culture, fallbackToDefaultCulture); + } +} +exports.default = ChoiceRecognizer; + +}); + +unwrapExports(choiceRecognizer); + +var recognizersTextChoice = createCommonjsModule(function (module, exports) { +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); + +exports.ChoiceRecognizer = choiceRecognizer.default; +exports.ChoiceOptions = choiceRecognizer.ChoiceOptions; +exports.recognizeBoolean = choiceRecognizer.recognizeBoolean; + +exports.Culture = recognizersText.Culture; + +exports.Constants = constants.Constants; + +exports.ChoiceModel = models$2.ChoiceModel; +exports.BooleanModel = models$2.BooleanModel; + +exports.ChoiceExtractor = extractors$2.ChoiceExtractor; +exports.BooleanExtractor = extractors$2.BooleanExtractor; + +exports.ChoiceParser = parsers$2.ChoiceParser; +exports.BooleanParser = parsers$2.BooleanParser; + +exports.EnglishBooleanExtractorConfiguration = boolean_1.EnglishBooleanExtractorConfiguration; + +exports.FrenchBooleanExtractorConfiguration = boolean_1$1.FrenchBooleanExtractorConfiguration; + +exports.GermanBooleanExtractorConfiguration = boolean_1$2.GermanBooleanExtractorConfiguration; + +exports.PortugueseBooleanExtractorConfiguration = boolean_1$4.PortugueseBooleanExtractorConfiguration; + +exports.JapaneseBooleanExtractorConfiguration = boolean_1$3.JapaneseBooleanExtractorConfiguration; + +exports.SpanishBooleanExtractorConfiguration = boolean_1$5.SpanishBooleanExtractorConfiguration; + +exports.ChineseBooleanExtractorConfiguration = boolean_1$6.ChineseBooleanExtractorConfiguration; + +exports.EnglishChoice = englishChoice.EnglishChoice; + +exports.FrenchChoice = frenchChoice.FrenchChoice; + +exports.GermanChoice = germanChoice.GermanChoice; + +exports.PortugueseChoice = portugueseChoice.PortugueseChoice; + +exports.JapaneseChoice = japaneseChoice.JapaneseChoice; + +exports.SpanishChoice = spanishChoice.SpanishChoice; + +exports.ChineseChoice = chineseChoice.ChineseChoice; + +}); + +var recognizersTextChoice$1 = unwrapExports(recognizersTextChoice); +var recognizersTextChoice_1 = recognizersTextChoice.ChoiceRecognizer; +var recognizersTextChoice_2 = recognizersTextChoice.ChoiceOptions; +var recognizersTextChoice_3 = recognizersTextChoice.recognizeBoolean; +var recognizersTextChoice_4 = recognizersTextChoice.Culture; +var recognizersTextChoice_5 = recognizersTextChoice.Constants; +var recognizersTextChoice_6 = recognizersTextChoice.ChoiceModel; +var recognizersTextChoice_7 = recognizersTextChoice.BooleanModel; +var recognizersTextChoice_8 = recognizersTextChoice.ChoiceExtractor; +var recognizersTextChoice_9 = recognizersTextChoice.BooleanExtractor; +var recognizersTextChoice_10 = recognizersTextChoice.ChoiceParser; +var recognizersTextChoice_11 = recognizersTextChoice.BooleanParser; +var recognizersTextChoice_12 = recognizersTextChoice.EnglishBooleanExtractorConfiguration; +var recognizersTextChoice_13 = recognizersTextChoice.FrenchBooleanExtractorConfiguration; +var recognizersTextChoice_14 = recognizersTextChoice.GermanBooleanExtractorConfiguration; +var recognizersTextChoice_15 = recognizersTextChoice.PortugueseBooleanExtractorConfiguration; +var recognizersTextChoice_16 = recognizersTextChoice.JapaneseBooleanExtractorConfiguration; +var recognizersTextChoice_17 = recognizersTextChoice.SpanishBooleanExtractorConfiguration; +var recognizersTextChoice_18 = recognizersTextChoice.ChineseBooleanExtractorConfiguration; +var recognizersTextChoice_19 = recognizersTextChoice.EnglishChoice; +var recognizersTextChoice_20 = recognizersTextChoice.FrenchChoice; +var recognizersTextChoice_21 = recognizersTextChoice.GermanChoice; +var recognizersTextChoice_22 = recognizersTextChoice.PortugueseChoice; +var recognizersTextChoice_23 = recognizersTextChoice.JapaneseChoice; +var recognizersTextChoice_24 = recognizersTextChoice.SpanishChoice; +var recognizersTextChoice_25 = recognizersTextChoice.ChineseChoice; + +exports['default'] = recognizersTextChoice$1; +exports.ChoiceRecognizer = recognizersTextChoice_1; +exports.ChoiceOptions = recognizersTextChoice_2; +exports.recognizeBoolean = recognizersTextChoice_3; +exports.Culture = recognizersTextChoice_4; +exports.Constants = recognizersTextChoice_5; +exports.ChoiceModel = recognizersTextChoice_6; +exports.BooleanModel = recognizersTextChoice_7; +exports.ChoiceExtractor = recognizersTextChoice_8; +exports.BooleanExtractor = recognizersTextChoice_9; +exports.ChoiceParser = recognizersTextChoice_10; +exports.BooleanParser = recognizersTextChoice_11; +exports.EnglishBooleanExtractorConfiguration = recognizersTextChoice_12; +exports.FrenchBooleanExtractorConfiguration = recognizersTextChoice_13; +exports.GermanBooleanExtractorConfiguration = recognizersTextChoice_14; +exports.PortugueseBooleanExtractorConfiguration = recognizersTextChoice_15; +exports.JapaneseBooleanExtractorConfiguration = recognizersTextChoice_16; +exports.SpanishBooleanExtractorConfiguration = recognizersTextChoice_17; +exports.ChineseBooleanExtractorConfiguration = recognizersTextChoice_18; +exports.EnglishChoice = recognizersTextChoice_19; +exports.FrenchChoice = recognizersTextChoice_20; +exports.GermanChoice = recognizersTextChoice_21; +exports.PortugueseChoice = recognizersTextChoice_22; +exports.JapaneseChoice = recognizersTextChoice_23; +exports.SpanishChoice = recognizersTextChoice_24; +exports.ChineseChoice = recognizersTextChoice_25; + +Object.defineProperty(exports, '__esModule', { value: true }); + +}))); +//# sourceMappingURL=recognizers-text-choice.umd.js.map diff --git a/libraries/botbuilder-stdlib/vendors/@microsoft/recognizers-text-choice/dist/types/choice/chinese/boolean.d.ts b/libraries/botbuilder-stdlib/vendors/@microsoft/recognizers-text-choice/dist/types/choice/chinese/boolean.d.ts new file mode 100644 index 0000000000..7a211cebc7 --- /dev/null +++ b/libraries/botbuilder-stdlib/vendors/@microsoft/recognizers-text-choice/dist/types/choice/chinese/boolean.d.ts @@ -0,0 +1,8 @@ +import { IBooleanExtractorConfiguration } from "../extractors"; +export declare class ChineseBooleanExtractorConfiguration implements IBooleanExtractorConfiguration { + readonly regexTrue: RegExp; + readonly regexFalse: RegExp; + readonly tokenRegex: RegExp; + readonly onlyTopMatch: boolean; + constructor(onlyTopMatch?: boolean); +} diff --git a/libraries/botbuilder-stdlib/vendors/@microsoft/recognizers-text-choice/dist/types/choice/choiceRecognizer.d.ts b/libraries/botbuilder-stdlib/vendors/@microsoft/recognizers-text-choice/dist/types/choice/choiceRecognizer.d.ts new file mode 100644 index 0000000000..eb00ea62f0 --- /dev/null +++ b/libraries/botbuilder-stdlib/vendors/@microsoft/recognizers-text-choice/dist/types/choice/choiceRecognizer.d.ts @@ -0,0 +1,11 @@ +import { Recognizer, IModel, ModelResult } from "botbuilder-stdlib/vendors/@microsoft/recognizers-text"; +export declare enum ChoiceOptions { + None = 0, +} +export declare function recognizeBoolean(query: string, culture: string, options?: ChoiceOptions, fallbackToDefaultCulture?: boolean): Array; +export default class ChoiceRecognizer extends Recognizer { + constructor(culture: string, options?: ChoiceOptions, lazyInitialization?: boolean); + protected InitializeConfiguration(): void; + protected IsValidOptions(options: number): boolean; + getBooleanModel(culture?: string, fallbackToDefaultCulture?: boolean): IModel; +} diff --git a/libraries/botbuilder-stdlib/vendors/@microsoft/recognizers-text-choice/dist/types/choice/constants.d.ts b/libraries/botbuilder-stdlib/vendors/@microsoft/recognizers-text-choice/dist/types/choice/constants.d.ts new file mode 100644 index 0000000000..f2d3c452ab --- /dev/null +++ b/libraries/botbuilder-stdlib/vendors/@microsoft/recognizers-text-choice/dist/types/choice/constants.d.ts @@ -0,0 +1,5 @@ +export declare class Constants { + static readonly SYS_BOOLEAN: string; + static readonly SYS_BOOLEAN_TRUE: string; + static readonly SYS_BOOLEAN_FALSE: string; +} diff --git a/libraries/botbuilder-stdlib/vendors/@microsoft/recognizers-text-choice/dist/types/choice/english/boolean.d.ts b/libraries/botbuilder-stdlib/vendors/@microsoft/recognizers-text-choice/dist/types/choice/english/boolean.d.ts new file mode 100644 index 0000000000..a7905bcb73 --- /dev/null +++ b/libraries/botbuilder-stdlib/vendors/@microsoft/recognizers-text-choice/dist/types/choice/english/boolean.d.ts @@ -0,0 +1,8 @@ +import { IBooleanExtractorConfiguration } from "../extractors"; +export declare class EnglishBooleanExtractorConfiguration implements IBooleanExtractorConfiguration { + readonly regexTrue: RegExp; + readonly regexFalse: RegExp; + readonly tokenRegex: RegExp; + readonly onlyTopMatch: boolean; + constructor(onlyTopMatch?: boolean); +} diff --git a/libraries/botbuilder-stdlib/vendors/@microsoft/recognizers-text-choice/dist/types/choice/extractors.d.ts b/libraries/botbuilder-stdlib/vendors/@microsoft/recognizers-text-choice/dist/types/choice/extractors.d.ts new file mode 100644 index 0000000000..463a4ac8ce --- /dev/null +++ b/libraries/botbuilder-stdlib/vendors/@microsoft/recognizers-text-choice/dist/types/choice/extractors.d.ts @@ -0,0 +1,27 @@ +import { IExtractor, ExtractResult } from "botbuilder-stdlib/vendors/@microsoft/recognizers-text"; +export interface IChoiceExtractorConfiguration { + regexesMap: Map; + tokenRegex: RegExp; + allowPartialMatch: boolean; + maxDistance: number; + onlyTopMatch: boolean; +} +export declare class ChoiceExtractor implements IExtractor { + private readonly config; + protected extractType: string; + constructor(config: IChoiceExtractorConfiguration); + extract(source: string): Array; + matchValue(source: string[], match: string[], startPos: number): number; + private tokenize(source); +} +export interface IBooleanExtractorConfiguration { + regexTrue: RegExp; + regexFalse: RegExp; + tokenRegex: RegExp; + onlyTopMatch: boolean; +} +export declare class BooleanExtractor extends ChoiceExtractor { + private static readonly booleanTrue; + private static readonly booleanFalse; + constructor(config: IBooleanExtractorConfiguration); +} diff --git a/libraries/botbuilder-stdlib/vendors/@microsoft/recognizers-text-choice/dist/types/choice/french/boolean.d.ts b/libraries/botbuilder-stdlib/vendors/@microsoft/recognizers-text-choice/dist/types/choice/french/boolean.d.ts new file mode 100644 index 0000000000..3b58a2e663 --- /dev/null +++ b/libraries/botbuilder-stdlib/vendors/@microsoft/recognizers-text-choice/dist/types/choice/french/boolean.d.ts @@ -0,0 +1,8 @@ +import { IBooleanExtractorConfiguration } from "../extractors"; +export declare class FrenchBooleanExtractorConfiguration implements IBooleanExtractorConfiguration { + readonly regexTrue: RegExp; + readonly regexFalse: RegExp; + readonly tokenRegex: RegExp; + readonly onlyTopMatch: boolean; + constructor(onlyTopMatch?: boolean); +} diff --git a/libraries/botbuilder-stdlib/vendors/@microsoft/recognizers-text-choice/dist/types/choice/german/boolean.d.ts b/libraries/botbuilder-stdlib/vendors/@microsoft/recognizers-text-choice/dist/types/choice/german/boolean.d.ts new file mode 100644 index 0000000000..514cfcd868 --- /dev/null +++ b/libraries/botbuilder-stdlib/vendors/@microsoft/recognizers-text-choice/dist/types/choice/german/boolean.d.ts @@ -0,0 +1,8 @@ +import { IBooleanExtractorConfiguration } from "../extractors"; +export declare class GermanBooleanExtractorConfiguration implements IBooleanExtractorConfiguration { + readonly regexTrue: RegExp; + readonly regexFalse: RegExp; + readonly tokenRegex: RegExp; + readonly onlyTopMatch: boolean; + constructor(onlyTopMatch?: boolean); +} diff --git a/libraries/botbuilder-stdlib/vendors/@microsoft/recognizers-text-choice/dist/types/choice/japanese/boolean.d.ts b/libraries/botbuilder-stdlib/vendors/@microsoft/recognizers-text-choice/dist/types/choice/japanese/boolean.d.ts new file mode 100644 index 0000000000..34b5692bb9 --- /dev/null +++ b/libraries/botbuilder-stdlib/vendors/@microsoft/recognizers-text-choice/dist/types/choice/japanese/boolean.d.ts @@ -0,0 +1,8 @@ +import { IBooleanExtractorConfiguration } from "../extractors"; +export declare class JapaneseBooleanExtractorConfiguration implements IBooleanExtractorConfiguration { + readonly regexTrue: RegExp; + readonly regexFalse: RegExp; + readonly tokenRegex: RegExp; + readonly onlyTopMatch: boolean; + constructor(onlyTopMatch?: boolean); +} diff --git a/libraries/botbuilder-stdlib/vendors/@microsoft/recognizers-text-choice/dist/types/choice/models.d.ts b/libraries/botbuilder-stdlib/vendors/@microsoft/recognizers-text-choice/dist/types/choice/models.d.ts new file mode 100644 index 0000000000..5e39a735a3 --- /dev/null +++ b/libraries/botbuilder-stdlib/vendors/@microsoft/recognizers-text-choice/dist/types/choice/models.d.ts @@ -0,0 +1,13 @@ +import { IModel, ModelResult, IExtractor, IParser } from "botbuilder-stdlib/vendors/@microsoft/recognizers-text"; +export declare abstract class ChoiceModel implements IModel { + readonly abstract modelTypeName: string; + protected readonly extractor: IExtractor; + protected readonly parser: IParser; + constructor(parser: IParser, extractor: IExtractor); + parse(source: string): ModelResult[]; + protected abstract getResolution(data: any): any; +} +export declare class BooleanModel extends ChoiceModel { + readonly modelTypeName: string; + protected getResolution(sources: any): any; +} diff --git a/libraries/botbuilder-stdlib/vendors/@microsoft/recognizers-text-choice/dist/types/choice/parsers.d.ts b/libraries/botbuilder-stdlib/vendors/@microsoft/recognizers-text-choice/dist/types/choice/parsers.d.ts new file mode 100644 index 0000000000..538be897e8 --- /dev/null +++ b/libraries/botbuilder-stdlib/vendors/@microsoft/recognizers-text-choice/dist/types/choice/parsers.d.ts @@ -0,0 +1,12 @@ +import { IParser, ExtractResult, ParseResult } from "botbuilder-stdlib/vendors/@microsoft/recognizers-text"; +export interface IChoiceParserConfiguration { + resolutions: Map; +} +export declare class ChoiceParser implements IParser { + private readonly config; + constructor(config: IChoiceParserConfiguration); + parse(extResult: ExtractResult): ParseResult; +} +export declare class BooleanParser extends ChoiceParser { + constructor(); +} diff --git a/libraries/botbuilder-stdlib/vendors/@microsoft/recognizers-text-choice/dist/types/choice/portuguese/boolean.d.ts b/libraries/botbuilder-stdlib/vendors/@microsoft/recognizers-text-choice/dist/types/choice/portuguese/boolean.d.ts new file mode 100644 index 0000000000..1cd66e146a --- /dev/null +++ b/libraries/botbuilder-stdlib/vendors/@microsoft/recognizers-text-choice/dist/types/choice/portuguese/boolean.d.ts @@ -0,0 +1,8 @@ +import { IBooleanExtractorConfiguration } from "../extractors"; +export declare class PortugueseBooleanExtractorConfiguration implements IBooleanExtractorConfiguration { + readonly regexTrue: RegExp; + readonly regexFalse: RegExp; + readonly tokenRegex: RegExp; + readonly onlyTopMatch: boolean; + constructor(onlyTopMatch?: boolean); +} diff --git a/libraries/botbuilder-stdlib/vendors/@microsoft/recognizers-text-choice/dist/types/choice/spanish/boolean.d.ts b/libraries/botbuilder-stdlib/vendors/@microsoft/recognizers-text-choice/dist/types/choice/spanish/boolean.d.ts new file mode 100644 index 0000000000..f140ea7dcf --- /dev/null +++ b/libraries/botbuilder-stdlib/vendors/@microsoft/recognizers-text-choice/dist/types/choice/spanish/boolean.d.ts @@ -0,0 +1,8 @@ +import { IBooleanExtractorConfiguration } from "../extractors"; +export declare class SpanishBooleanExtractorConfiguration implements IBooleanExtractorConfiguration { + readonly regexTrue: RegExp; + readonly regexFalse: RegExp; + readonly tokenRegex: RegExp; + readonly onlyTopMatch: boolean; + constructor(onlyTopMatch?: boolean); +} diff --git a/libraries/botbuilder-stdlib/vendors/@microsoft/recognizers-text-choice/dist/types/recognizers-text-choice.d.ts b/libraries/botbuilder-stdlib/vendors/@microsoft/recognizers-text-choice/dist/types/recognizers-text-choice.d.ts new file mode 100644 index 0000000000..05292836be --- /dev/null +++ b/libraries/botbuilder-stdlib/vendors/@microsoft/recognizers-text-choice/dist/types/recognizers-text-choice.d.ts @@ -0,0 +1,20 @@ +export { default as ChoiceRecognizer, ChoiceOptions, recognizeBoolean } from "./choice/choiceRecognizer"; +export { Culture } from "botbuilder-stdlib/vendors/@microsoft/recognizers-text"; +export { Constants } from "./choice/constants"; +export { ChoiceModel, BooleanModel } from "./choice/models"; +export { IChoiceExtractorConfiguration, ChoiceExtractor, IBooleanExtractorConfiguration, BooleanExtractor } from "./choice/extractors"; +export { IChoiceParserConfiguration, ChoiceParser, BooleanParser } from "./choice/parsers"; +export { EnglishBooleanExtractorConfiguration } from "./choice/english/boolean"; +export { FrenchBooleanExtractorConfiguration } from "./choice/french/boolean"; +export { GermanBooleanExtractorConfiguration } from "./choice/german/boolean"; +export { PortugueseBooleanExtractorConfiguration } from "./choice/portuguese/boolean"; +export { JapaneseBooleanExtractorConfiguration } from "./choice/japanese/boolean"; +export { SpanishBooleanExtractorConfiguration } from "./choice/spanish/boolean"; +export { ChineseBooleanExtractorConfiguration } from "./choice/chinese/boolean"; +export { EnglishChoice } from "./resources/englishChoice"; +export { FrenchChoice } from "./resources/frenchChoice"; +export { GermanChoice } from "./resources/germanChoice"; +export { PortugueseChoice } from "./resources/portugueseChoice"; +export { JapaneseChoice } from "./resources/japaneseChoice"; +export { SpanishChoice } from "./resources/spanishChoice"; +export { ChineseChoice } from "./resources/chineseChoice"; diff --git a/libraries/botbuilder-stdlib/vendors/@microsoft/recognizers-text-choice/dist/types/resources/chineseChoice.d.ts b/libraries/botbuilder-stdlib/vendors/@microsoft/recognizers-text-choice/dist/types/resources/chineseChoice.d.ts new file mode 100644 index 0000000000..f3eeebb43d --- /dev/null +++ b/libraries/botbuilder-stdlib/vendors/@microsoft/recognizers-text-choice/dist/types/resources/chineseChoice.d.ts @@ -0,0 +1,6 @@ +export declare namespace ChineseChoice { + const LangMarker = "Chs"; + const TokenizerRegex = "[^\\u3040-\\u30ff\\u3400-\\u4dbf\\u4e00-\\u9fff\\uf900-\\ufaff\\uff66-\\uff9f]"; + const TrueRegex = "(好[的啊呀嘞哇]|没问题|可以|中|好|同意|行|是的|是|对)|(\\uD83D\\uDC4D|\\uD83D\\uDC4C)"; + const FalseRegex = "(不行|不好|拒绝|否定|不中|不可以|不是的|不是|不对|不)|(\\uD83D\\uDC4E|\\u270B|\\uD83D\\uDD90)"; +} diff --git a/libraries/botbuilder-stdlib/vendors/@microsoft/recognizers-text-choice/dist/types/resources/englishChoice.d.ts b/libraries/botbuilder-stdlib/vendors/@microsoft/recognizers-text-choice/dist/types/resources/englishChoice.d.ts new file mode 100644 index 0000000000..d45e7e32b4 --- /dev/null +++ b/libraries/botbuilder-stdlib/vendors/@microsoft/recognizers-text-choice/dist/types/resources/englishChoice.d.ts @@ -0,0 +1,6 @@ +export declare namespace EnglishChoice { + const LangMarker = "Eng"; + const TokenizerRegex = "[^\\w\\d]"; + const TrueRegex = "\\b(true|yes|yep|y|sure|ok|agree)\\b|(\\uD83D\\uDC4D|\\uD83D\\uDC4C)"; + const FalseRegex = "\\b(false|nope|nop|no|not\\s+ok|disagree)\\b|(\\uD83D\\uDC4E|\\u270B|\\uD83D\\uDD90)"; +} diff --git a/libraries/botbuilder-stdlib/vendors/@microsoft/recognizers-text-choice/dist/types/resources/frenchChoice.d.ts b/libraries/botbuilder-stdlib/vendors/@microsoft/recognizers-text-choice/dist/types/resources/frenchChoice.d.ts new file mode 100644 index 0000000000..8484c76f45 --- /dev/null +++ b/libraries/botbuilder-stdlib/vendors/@microsoft/recognizers-text-choice/dist/types/resources/frenchChoice.d.ts @@ -0,0 +1,6 @@ +export declare namespace FrenchChoice { + const LangMarker = "Fr"; + const TokenizerRegex = "[^\\w\\d\\u00E0-\\u00FC]"; + const TrueRegex = "\\b(s[uû]r|ouais|oui|yep|y|sure|approuver|accepter|consentir|d'accord|ça march[eé])\\b|(\\uD83D\\uDC4D|\\uD83D\\uDC4C)"; + const FalseRegex = "\\b(faux|nan|non|pas\\s+d'accord|pas\\s+concorder|n'est\\s+pas\\s+(correct|ok)|pas)\\b|(\\uD83D\\uDC4E|\\u270B|\\uD83D\\uDD90)"; +} diff --git a/libraries/botbuilder-stdlib/vendors/@microsoft/recognizers-text-choice/dist/types/resources/germanChoice.d.ts b/libraries/botbuilder-stdlib/vendors/@microsoft/recognizers-text-choice/dist/types/resources/germanChoice.d.ts new file mode 100644 index 0000000000..6eb5f7321c --- /dev/null +++ b/libraries/botbuilder-stdlib/vendors/@microsoft/recognizers-text-choice/dist/types/resources/germanChoice.d.ts @@ -0,0 +1,6 @@ +export declare namespace GermanChoice { + const LangMarker = "Ger"; + const TokenizerRegex = "[^\\w\\d\\u00E0-\\u00FC]"; + const TrueRegex = "\\b(wahr|ja|jep|j|sicher|ok|einverstanden|mit\\s+Sicherheit|sicherlich|jap|mache ich)\\b|(\\uD83D\\uDC4D|\\uD83D\\uDC4C)"; + const FalseRegex = "\\b(falsch|nein|ne|nö|nicht\\s+ok|nicht\\s+einverstanden|n)\\b|(\\uD83D\\uDC4E|\\u270B|\\uD83D\\uDD90)"; +} diff --git a/libraries/botbuilder-stdlib/vendors/@microsoft/recognizers-text-choice/dist/types/resources/japaneseChoice.d.ts b/libraries/botbuilder-stdlib/vendors/@microsoft/recognizers-text-choice/dist/types/resources/japaneseChoice.d.ts new file mode 100644 index 0000000000..819fad353f --- /dev/null +++ b/libraries/botbuilder-stdlib/vendors/@microsoft/recognizers-text-choice/dist/types/resources/japaneseChoice.d.ts @@ -0,0 +1,6 @@ +export declare namespace JapaneseChoice { + const LangMarker = "Jpn"; + const TokenizerRegex = "[^\\w\\d\\u3040-\\u309f\\u30a0-\\u30ff\\uff00-\\uff9f\\u4e00-\\u9faf\\u3400-\\u4dbf]"; + const TrueRegex = "(はい(!)*|そうです|よい(です)*)|(\\uD83D\\uDC4D|\\uD83D\\uDC4C)"; + const FalseRegex = "(いいえ|ではありません|ではない|じゃない|じゃありません)|(\\uD83D\\uDC4E|\\u270B|\\uD83D\\uDD90)"; +} diff --git a/libraries/botbuilder-stdlib/vendors/@microsoft/recognizers-text-choice/dist/types/resources/portugueseChoice.d.ts b/libraries/botbuilder-stdlib/vendors/@microsoft/recognizers-text-choice/dist/types/resources/portugueseChoice.d.ts new file mode 100644 index 0000000000..cbf0b4a837 --- /dev/null +++ b/libraries/botbuilder-stdlib/vendors/@microsoft/recognizers-text-choice/dist/types/resources/portugueseChoice.d.ts @@ -0,0 +1,6 @@ +export declare namespace PortugueseChoice { + const LangMarker = "Por"; + const TokenizerRegex = "[^\\w\\d\\u00E0-\\u00FC]"; + const TrueRegex = "\\b(verdade|verdadeir[oa]|sim|isso|claro|ok)\\b|(\\uD83D\\uDC4D|\\uD83D\\uDC4C)"; + const FalseRegex = "\\b(falso|n[aã]o|incorreto|nada disso)\\b|(\\uD83D\\uDC4E|\\u270B|\\uD83D\\uDD90)"; +} diff --git a/libraries/botbuilder-stdlib/vendors/@microsoft/recognizers-text-choice/dist/types/resources/spanishChoice.d.ts b/libraries/botbuilder-stdlib/vendors/@microsoft/recognizers-text-choice/dist/types/resources/spanishChoice.d.ts new file mode 100644 index 0000000000..29f79a0b4b --- /dev/null +++ b/libraries/botbuilder-stdlib/vendors/@microsoft/recognizers-text-choice/dist/types/resources/spanishChoice.d.ts @@ -0,0 +1,6 @@ +export declare namespace SpanishChoice { + const LangMarker = "Spa"; + const TokenizerRegex = "[^\\w\\d\\u00E0-\\u00FC]"; + const TrueRegex = "\\b(verdad|verdadero|sí|sip|s|si|cierto|por supuesto|ok)\\b|(\\uD83D\\uDC4D|\\uD83D\\uDC4C)"; + const FalseRegex = "\\b(falso|no|nop|n|no)\\b|(\\uD83D\\uDC4E|\\u270B|\\uD83D\\uDD90)"; +} diff --git a/libraries/botbuilder-stdlib/vendors/@microsoft/recognizers-text-choice/package.json b/libraries/botbuilder-stdlib/vendors/@microsoft/recognizers-text-choice/package.json new file mode 100644 index 0000000000..7b3490333c --- /dev/null +++ b/libraries/botbuilder-stdlib/vendors/@microsoft/recognizers-text-choice/package.json @@ -0,0 +1,31 @@ +{ + "internal": true, + "name": "@microsoft/recognizers-text-choice", + "version": "1.1.4", + "description": "recognizers-text-choice provides recognition of Boolean (yes/no) answers expressed in multiple languages, as well as base classes to support lists of alternative choices.", + "author": "Microsoft Corp.", + "license": "MIT", + "keywords": [ + "nlp", + "nlp-entity-extraction", + "entity-extraction", + "boolean", + "alternatives", + "choices", + "parser-library" + ], + "main": "dist/recognizers-text-choice.umd.js", + "module": "dist/recognizers-text-choice.es5.js", + "typings": "dist/types/recognizers-text-choice.d.ts", + "browser": "dist/recognizers-text-choice.browser.js", + "bugs": { + "url": "https://github.com/Microsoft/botbuilder-js/issues" + }, + "repository": { + "type": "git", + "url": "https://github.com/Microsoft/botbuilder-js.git" + }, + "engines": { + "node": ">=6.0.0" + } +} \ No newline at end of file diff --git a/libraries/botbuilder-stdlib/vendors/@microsoft/recognizers-text-data-types-timex-expression/dist/recognizers-text-data-types-timex-expression.browser.js b/libraries/botbuilder-stdlib/vendors/@microsoft/recognizers-text-data-types-timex-expression/dist/recognizers-text-data-types-timex-expression.browser.js new file mode 100644 index 0000000000..54cc6c91cf --- /dev/null +++ b/libraries/botbuilder-stdlib/vendors/@microsoft/recognizers-text-data-types-timex-expression/dist/recognizers-text-data-types-timex-expression.browser.js @@ -0,0 +1,1574 @@ +var microsoftRecognizersTextDataTypesTimexExpression = (function (exports) { +'use strict'; + +// Copyright (c) Microsoft Corporation. All rights reserved. + +class Time { + constructor(hour, minute, second) { + if (arguments.length === 1) { + this.hour = Math.floor(hour / 3600000); + this.minute = Math.floor((hour - (this.hour * 3600000)) / 60000); + this.second = (hour - (this.hour * 3600000) - (this.minute * 60000)) / 1000; + } + else { + this.hour = hour; + this.minute = minute; + this.second = second; + } + } + + getTime () { + return (this.second * 1000) + (this.minute * 60000) + (this.hour * 3600000); + } +} + +var Time_1 = Time; + +var time = { + Time: Time_1 +}; + +// Copyright (c) Microsoft Corporation. All rights reserved. + +const value = function (s) { return s; }; +const isTrue = function () { return true; }; +const zero = function () { return 0; }; + +const timexRegex = { + + date: [ + // date + { regex: /^(\d\d\d\d)-(\d\d)-(\d\d)$/, props: { year: Number, month: Number, dayOfMonth: Number } }, + { regex: /^XXXX-WXX-(\d)$/, props: { dayOfWeek: Number } }, + { regex: /^XXXX-(\d\d)-(\d\d)$/, props: { month: Number, dayOfMonth: Number } }, + // daterange + { regex: /^(\d\d\d\d)$/, props: { year: Number } }, + { regex: /^(\d\d\d\d)-(\d\d)$/, props: { year: Number, month: Number } }, + { regex: /^(SP|SU|FA|WI)$/, props: { season: value } }, + { regex: /^(\d\d\d\d)-(SP|SU|FA|WI)$/, props: { year: Number, season: value } }, + { regex: /^(\d\d\d\d)-W(\d\d)$/, props: { year: Number, weekOfYear: Number } }, + { regex: /^(\d\d\d\d)-W(\d\d)-WE$/, props: { year: Number, weekOfYear: Number, weekend: isTrue } }, + { regex: /^XXXX-(\d\d)$/, props: { month: Number } }, + { regex: /^XXXX-(\d\d)-W(\d\d)$/, props: { month: Number, weekOfMonth: Number } }, + { regex: /^XXXX-(\d\d)-WXX-(\d)-(\d)$/, props: { month: Number, weekOfMonth: Number, dayOfWeek: Number } } + ], + + time: [ + // time + { regex: /^T(\d\d)$/, props: { hour: Number, minute: zero, second: zero } }, + { regex: /^T(\d\d):(\d\d)$/, props: { hour: Number, minute: Number, second: zero } }, + { regex: /^T(\d\d):(\d\d):(\d\d)$/, props: { hour: Number, minute: Number, second: Number } }, + // timerange + { regex: /^T(DT|NI|MO|AF|EV)$/, props: { partOfDay: value } } + ], + + period: [ + { regex: /^P(\d*\.?\d+)(Y|M|W|D)$/, props: { amount: Number, dateUnit: value } }, + { regex: /^PT(\d*\.?\d+)(H|M|S)$/, props: { amount: Number, timeUnit: value } } + ] +}; + +const tryExtract = function (entry, timex, result) { + const regexResult = timex.match(entry.regex); + if (!regexResult) { + return false; + } + let index = 1; + for (const name in entry.props) { + const val = regexResult[index++]; + result[name] = entry.props[name](val); + } + return true; +}; + +const extract = function (name, timex, result) { + for (const entry of timexRegex[name]) { + if (tryExtract(entry, timex, result)) { + return true; + } + } + return false; +}; + +var extract_1 = extract; + +var timexregex = { + extract: extract_1 +}; + +// Copyright (c) Microsoft Corporation. All rights reserved. + + + +const parseString = function (timex, obj) { + // a reference to the present + if (timex === 'PRESENT_REF') { + obj.now = true; + } + // duration + else if (timex.startsWith('P')) { + extractDuration(timex, obj); + } + // range indicated with start and end dates and a duration + else if (timex.startsWith('(') && timex.endsWith(')')) { + extractStartEndRange(timex, obj); + } + // date and time and their respective ranges + else { + extractDateTime(timex, obj); + } +}; + +const extractDuration = function (s, obj) { + const extracted = {}; + timexregex.extract('period', s, extracted); + if (extracted.dateUnit) { + obj[{ Y: 'years', M: 'months', W: 'weeks', D: 'days' }[extracted.dateUnit]] = extracted.amount; + } + else if (extracted.timeUnit) { + obj[{ H: 'hours', M: 'minutes', S: 'seconds' }[extracted.timeUnit]] = extracted.amount; + } +}; + +const extractStartEndRange = function (s, obj) { + const parts = s.substring(1, s.length - 1).split(','); + if (parts.length === 3) { + extractDateTime(parts[0], obj); + extractDuration(parts[2], obj); + } +}; + +const extractDateTime = function (s, obj) { + const indexOfT = s.indexOf('T'); + if (indexOfT === -1) { + timexregex.extract('date', s, obj); + } + else { + timexregex.extract('date', s.substr(0, indexOfT), obj); + timexregex.extract('time', s.substr(indexOfT), obj); + } +}; + +const fromObject = function (source, obj) { + Object.assign(obj, source); + if ('hour' in obj) { + if (!('minute' in obj)) { + obj.minute = 0; + } + if (!('second' in obj)) { + obj.second = 0; + } + } +}; + +var timexParsing = { + parseString: parseString, + fromObject: fromObject +}; + +// Copyright (c) Microsoft Corporation. All rights reserved. + +const isPresent = function (obj) { + return obj.now === true; +}; + +const isDuration = function (obj) { + return 'years' in obj || 'months' in obj || 'weeks' in obj || 'days' in obj + || 'hours' in obj || 'minutes' in obj || 'seconds' in obj; +}; + +const isTime = function (obj) { + return 'hour' in obj && 'minute' in obj && 'second' in obj; +}; + +const isDate = function (obj) { + return ('month' in obj && 'dayOfMonth' in obj) || 'dayOfWeek' in obj; +}; + +const isTimeRange = function (obj) { + return 'partOfDay' in obj; +}; + +const isDateRange = function (obj) { + return ('year' in obj && !('dayOfMonth' in obj)) + || ('year' in obj && 'month' in obj && !('dayOfMonth' in obj)) + || ('month' in obj && !('dayOfMonth' in obj)) + || 'season' in obj + || 'weekOfYear' in obj + || 'weekOfMonth' in obj; +}; + +const isDefinite = function (obj) { + return 'year' in obj && 'month' in obj && 'dayOfMonth' in obj; +}; + +const infer = function (obj) { + const types = new Set(); + if (isPresent(obj)) { + types.add('present'); + } + if (isDefinite(obj)) { + types.add('definite'); + } + if (isDate(obj)) { + types.add('date'); + } + if (isDateRange(obj)) { + types.add('daterange'); + } + if (isDuration(obj)) { + types.add('duration'); + } + if (isTime(obj)) { + types.add('time'); + } + if (isTimeRange(obj)) { + types.add('timerange'); + } + if (types.has('present')) { + types.add('date'); + types.add('time'); + } + if (types.has('time') && types.has('duration')) { + types.add('timerange'); + } + if (types.has('date') && types.has('time')) { + types.add('datetime'); + } + if (types.has('date') && types.has('duration')) { + types.add('daterange'); + } + if (types.has('datetime') && types.has('duration')) { + types.add('datetimerange'); + } + if (types.has('date') && types.has('timerange')) { + types.add('datetimerange'); + } + return types; +}; + +var infer_1 = infer; + +var timexInference = { + infer: infer_1 +}; + +// Copyright (c) Microsoft Corporation. All rights reserved. + +const cloneDate = function (date) { + const result = new Date(); + result.setTime(date.getTime()); + return result; +}; + +const tomorrow = function (date) { + const result = cloneDate(date); + result.setDate(result.getDate() + 1); + return result; +}; + +const yesterday = function (date) { + const result = cloneDate(date); + result.setDate(result.getDate() - 1); + return result; +}; + +const datePartEquals = function (dateX, dateY) { + return (dateX.getFullYear() === dateY.getFullYear()) + && (dateX.getMonth() === dateY.getMonth()) + && (dateX.getDate() === dateY.getDate()); +}; + +const isDateInWeek = function (date, startOfWeek) { + let d = cloneDate(startOfWeek); + for (let i=0; i<7; i++) { + if (datePartEquals(date, d)) { + return true; + } + d = tomorrow(d); + } + return false; +}; + +const isThisWeek = function (date, referenceDate) { + const startOfThisWeek = cloneDate(referenceDate); + startOfThisWeek.setDate(startOfThisWeek.getDate() - startOfThisWeek.getDay()); + return isDateInWeek(date, startOfThisWeek); +}; + +const isNextWeek = function (date, referenceDate) { + const startOfNextWeek = cloneDate(referenceDate); + startOfNextWeek.setDate(startOfNextWeek.getDate() + (7 - startOfNextWeek.getDay())); + return isDateInWeek(date, startOfNextWeek); +}; + +const isLastWeek = function (date, referenceDate) { + const startOfLastWeek = cloneDate(referenceDate); + startOfLastWeek.setDate(startOfLastWeek.getDate() - (7 + startOfLastWeek.getDay())); + return isDateInWeek(date, startOfLastWeek); +}; + +const weekOfYear = function (date) { + const ds = new Date(date.getFullYear(), 0); + const de = new Date(date.getFullYear(), date.getMonth(), date.getDate()); + let weeks = 1; + while (ds.getTime() < de.getTime()) { + const jsDayOfWeek = ds.getDay(); + const isoDayOfWeek = jsDayOfWeek == 0 ? 7 : jsDayOfWeek; + if (isoDayOfWeek === 7) { + weeks++; + } + ds.setDate(ds.getDate() + 1); + } + return weeks; +}; + +const fixedFormatNumber$1 = function (n, size) { + const s = n.toString(); + let zeros = ''; + const np = size - s.length; + for (let i=0; i 23) { + const days = Math.floor(result.hour / 24); + const hour = result.hour % 24; + result.hour = hour; + if ('year' in result && 'month' in result && 'dayOfMonth' in result) { + const d = new Date(result.year, result.month - 1, result.dayOfMonth, 0, 0, 0); + for (let i=0; i 59) { + result.hour++; + result.minute = 0; + } + return result; + } + return start; +}; + +const timexDateTimeAdd$1 = function (start, duration) { + return timexTimeAdd$1(timexDateAdd$1(start, duration), duration); +}; + +const expandDateTimeRange = function (timex) { + const types = ('types' in timex) ? timex.types : timexInference.infer(timex); + if (types.has('duration')) { + const start = cloneDateTime(timex); + const duration = cloneDuration(timex); + return { start: start, end: timexDateTimeAdd$1(start, duration), duration: duration }; + } + else { + if ('year' in timex) { + const range = { start: { year: timex.year }, end: {} }; + if ('month' in timex) { + range.start.month = timex.month; + range.start.dayOfMonth = 1; + range.end.year = timex.year; + range.end.month = timex.month + 1; + range.end.dayOfMonth = 1; + } + else { + range.start.month = 1; + range.start.dayOfMonth = 1; + range.end.year = timex.year + 1; + range.end.month = 1; + range.end.dayOfMonth = 1; + } + return range; + } + } + return { start: {}, end: {} }; +}; + +const timeAdd = function (start, duration) { + const hours = duration.hours || 0; + const minutes = duration.minutes || 0; + const seconds = duration.seconds || 0; + return { hour: start.hour + hours, minute: start.minute + minutes, second: start.second + seconds }; +}; + +const expandTimeRange = function (timex) { + + if (!timex.types.has('timerange')) + { + throw new exception('argument must be a timerange'); + } + + if (timex.partOfDay !== undefined) { + switch (timex.partOfDay) { + case 'DT': + timex = { hour: 8, minute: 0, second: 0, hours: 10, minutes: 0, seconds: 0 }; + break; + case 'MO': + timex = { hour: 8, minute: 0, second: 0, hours: 4, minutes: 0, seconds: 0 }; + break; + case 'AF': + timex = { hour: 12, minute: 0, second: 0, hours: 4, minutes: 0, seconds: 0 }; + break; + case 'EV': + timex = { hour: 16, minute: 0, second: 0, hours: 4, minutes: 0, seconds: 0 }; + break; + case 'NI': + timex = { hour: 20, minute: 0, second: 0, hours: 4, minutes: 0, seconds: 0 }; + break; + default: + throw new exception('unrecognized part of day timerange'); + } + } + + const start = { hour: timex.hour, minute: timex.minute, second: timex.second }; + const duration = cloneDuration(timex); + return { start: start, end: timeAdd(start, duration), duration: duration }; +}; + +const dateFromTimex = function (timex) { + const year = 'year' in timex ? timex.year : 2001; + const month = 'month' in timex ? timex.month - 1 : 0; + const date = 'dayOfMonth' in timex ? timex.dayOfMonth : 1; + const hour = 'hour' in timex ? timex.hour : 0; + const minute = 'minute' in timex ? timex.minute : 0; + const second = 'second' in timex ? timex.second : 0; + return new Date(year, month, date, hour, minute, second); +}; + +const timeFromTimex = function (timex) { + const hour = timex.hour || 0; + const minute = timex.minute || 0; + const second = timex.second || 0; + return new Time$1(hour, minute, second); +}; + +const dateRangeFromTimex = function (timex) { + const expanded = expandDateTimeRange(timex); + return { start: dateFromTimex(expanded.start), end: dateFromTimex(expanded.end) }; +}; + +const timeRangeFromTimex = function (timex) { + const expanded = expandTimeRange(timex); + return { start: timeFromTimex(expanded.start), end: timeFromTimex(expanded.end) }; +}; + +var timexHelpers = { + expandDateTimeRange: expandDateTimeRange, + expandTimeRange: expandTimeRange, + dateFromTimex: dateFromTimex, + timeFromTimex: timeFromTimex, + dateRangeFromTimex: dateRangeFromTimex, + timeRangeFromTimex: timeRangeFromTimex, + timexTimeAdd: timexTimeAdd$1, + timexDateTimeAdd: timexDateTimeAdd$1 +}; + +// Copyright (c) Microsoft Corporation. All rights reserved. + + +const fixedFormatNumber = timexDateHelpers.fixedFormatNumber; + + +const formatDuration = function (timex) { + if ('years' in timex) { + return `P${timex.years}Y`; + } + if ('months' in timex) { + return `P${timex.months}M`; + } + if ('weeks' in timex) { + return `P${timex.weeks}W`; + } + if ('days' in timex) { + return `P${timex.days}D`; + } + if ('hours' in timex) { + return `PT${timex.hours}H`; + } + if ('minutes' in timex) { + return `PT${timex.minutes}M`; + } + if ('seconds' in timex) { + return `PT${timex.seconds}S`; + } + return ''; +}; + +const formatTime = function (timex) { + if (timex.minute === 0 && timex.second === 0) { + return `T${fixedFormatNumber(timex.hour, 2)}`; + } + if (timex.second === 0) { + return `T${fixedFormatNumber(timex.hour, 2)}:${fixedFormatNumber(timex.minute, 2)}`; + } + return `T${fixedFormatNumber(timex.hour, 2)}:${fixedFormatNumber(timex.minute, 2)}:${fixedFormatNumber(timex.second, 2)}`; +}; + +const formatDate = function (timex) { + if ('year' in timex && 'month' in timex && 'dayOfMonth' in timex) { + return `${fixedFormatNumber(timex.year, 4)}-${fixedFormatNumber(timex.month, 2)}-${fixedFormatNumber(timex.dayOfMonth, 2)}`; + } + if ('month' in timex && 'dayOfMonth' in timex) { + return `XXXX-${fixedFormatNumber(timex.month, 2)}-${fixedFormatNumber(timex.dayOfMonth, 2)}`; + } + if ('dayOfWeek' in timex) { + return `XXXX-WXX-${timex.dayOfWeek}`; + } + return ''; +}; + +const formatDateRange = function (timex) { + if ('year' in timex && 'weekOfYear' in timex && 'weekend' in timex) { + return `${fixedFormatNumber(timex.year, 4)}-W${fixedFormatNumber(timex.weekOfYear, 2)}-WE`; + } + if ('year' in timex && 'weekOfYear' in timex) { + return `${fixedFormatNumber(timex.year, 4)}-W${fixedFormatNumber(timex.weekOfYear, 2)}`; + } + if ('year' in timex && 'season' in timex) { + return `${fixedFormatNumber(timex.year, 4)}-${timex.season}`; + } + if ('season' in timex) { + return `${timex.season}`; + } + if ('year' in timex && 'month' in timex) { + return `${fixedFormatNumber(timex.year, 4)}-${fixedFormatNumber(timex.month, 2)}`; + } + if ('year' in timex) { + return `${fixedFormatNumber(timex.year, 4)}`; + } + if ('month' in timex && 'weekOfMonth' in timex && 'dayOfWeek' in timex) { + return `XXXX-${fixedFormatNumber(timex.month, 2)}-WXX-${timex.weekOfMonth}-${timex.dayOfWeek}`; + } + if ('month' in timex && 'weekOfMonth' in timex) { + return `XXXX-${fixedFormatNumber(timex.month, 2)}-WXX-${timex.weekOfMonth}`; + } + if ('month' in timex) { + return `XXXX-${fixedFormatNumber(timex.month, 2)}`; + } + return ''; +}; + +const formatTimeRange = function (timex) { + if ('partOfDay' in timex) { + return `T${timex.partOfDay}`; + } + return ''; +}; + +const format = function(timex) { + + const types = ('types' in timex) ? timex.types : timexInference.infer(timex); + + if (types.has('present')) { + return 'PRESENT_REF'; + } + if ((types.has('datetimerange') || types.has('daterange') || types.has('timerange')) && types.has('duration')) { + const range = timexHelpers.expandDateTimeRange(timex); + return `(${format(range.start)},${format(range.end)},${format(range.duration)})`; + } + if (types.has('datetimerange')) { + return `${formatDate(timex)}${formatTimeRange(timex)}`; + } + if (types.has('daterange')) { + return `${formatDateRange(timex)}`; + } + if (types.has('timerange')) { + return `${formatTimeRange(timex)}`; + } + if (types.has('datetime')) { + return `${formatDate(timex)}${formatTime(timex)}`; + } + if (types.has('duration')) { + return `${formatDuration(timex)}`; + } + if (types.has('date')) { + return `${formatDate(timex)}`; + } + if (types.has('time')) { + return `${formatTime(timex)}`; + } + return ''; +}; + +var format_1 = format; + +var timexFormat = { + format: format_1 +}; + +// Copyright (c) Microsoft Corporation. All rights reserved. + +var days = [ + 'Monday', + 'Tuesday', + 'Wednesday', + 'Thursday', + 'Friday', + 'Saturday', + 'Sunday' +]; + +var months = [ + 'January', + 'Februrary', + 'March', + 'April', + 'May', + 'June', + 'July', + 'August', + 'September', + 'October', + 'November', + 'December' +]; + +var dateAbbreviation = { 0: 'th', 1: 'st', 2: 'nd', 3: 'rd', 4: 'th', 5: 'th', 6: 'th', 7: 'th', 8: 'th', 9: 'th' }; + +var hours = [ + 'midnight', '1AM', '2AM', '3AM', '4AM', '5AM', '6AM', '7AM', '8AM', '9AM', '10AM', '11AM', + 'midday', '1PM', '2PM', '3PM', '4PM', '5PM', '6PM', '7PM', '8PM', '9PM', '10PM', '11PM' +]; + +var seasons = { SP: 'spring', SU: 'summer', FA: 'fall', WI: 'winter' }; + +var weeks = [ 'first', 'second', 'third', 'forth' ]; + +var dayParts = { DT: 'daytime', NI: 'night', MO: 'morning', AF: 'afternoon', EV: 'evening' }; + +var timexConstants = { + days: days, + months: months, + dateAbbreviation: dateAbbreviation, + hours: hours, + seasons: seasons, + weeks: weeks, + dayParts: dayParts +}; + +// Copyright (c) Microsoft Corporation. All rights reserved. + + + + +const convertDate = function(timex) { + if ('dayOfWeek' in timex) { + return timexConstants.days[timex.dayOfWeek - 1]; + } + const month = timexConstants.months[timex.month - 1]; + const date = timex.dayOfMonth.toString(); + const abbreviation = timexConstants.dateAbbreviation[date.slice(-1)]; + if ('year' in timex) { + return `${date}${abbreviation} ${month} ${timex.year}`.trim(); + } + return `${date}${abbreviation} ${month}`; +}; + +const convertTime = function(timex) { + if (timex.hour === 0 && timex.minute === 0 && timex.second === 0) { + return 'midnight'; + } + if (timex.hour === 12 && timex.minute === 0 && timex.second === 0) { + return 'midday'; + } + const pad = function (s) { return (s.length === 1) ? '0' + s : s; }; + const hour = (timex.hour === 0) ? '12' : (timex.hour > 12) ? (timex.hour - 12).toString() : timex.hour.toString(); + const minute = (timex.minute === 0 && timex.second === 0) ? '' : ':' + pad(timex.minute.toString()); + const second = (timex.second === 0) ? '' : ':' + pad(timex.second.toString()); + const period = timex.hour < 12 ? 'AM' : 'PM'; + return `${hour}${minute}${second}${period}`; +}; + +const convertDurationPropertyToString = function (timex, property, includeSingleCount) { + const propertyName = property + 's'; + const value = timex[propertyName]; + if (value !== undefined) { + if (value === 1) { + return includeSingleCount ? '1 ' + property : property; + } + else { + return `${value} ${property}s`; + } + } + return false; +}; + +const convertTimexDurationToString = function (timex, includeSingleCount) { + return convertDurationPropertyToString(timex, 'year', includeSingleCount) + || convertDurationPropertyToString(timex, 'month', includeSingleCount) + || convertDurationPropertyToString(timex, 'week', includeSingleCount) + || convertDurationPropertyToString(timex, 'day', includeSingleCount) + || convertDurationPropertyToString(timex, 'hour', includeSingleCount) + || convertDurationPropertyToString(timex, 'minute', includeSingleCount) + || convertDurationPropertyToString(timex, 'second', includeSingleCount); +}; + +const convertDuration = function(timex) { + return convertTimexDurationToString(timex, true); +}; + +const convertDateRange = function(timex) { + const season = ('season' in timex) ? timexConstants.seasons[timex.season] : ''; + const year = ('year' in timex) ? timex.year.toString() : ''; + if ('weekOfYear' in timex) { + if (timex.weekend) { + return ''; + } + else { + return ''; + } + } + if ('month' in timex) { + const month = `${timexConstants.months[timex.month - 1]}`; + if ('weekOfMonth' in timex) { + return `${timexConstants.weeks[timex.weekOfMonth - 1]} week of ${month}`; + } + else { + return `${month} ${year}`.trim(); + } + } + return `${season} ${year}`.trim(); +}; + +const convertTimeRange = function(timex) { + return timexConstants.dayParts[timex.partOfDay]; +}; + +const convertDateTime = function(timex) { + return `${convertTime(timex)} ${convertDate(timex)}`; +}; + +const convertDateTimeRange = function(timex) { + if (timex.types.has('timerange')) { + return `${convertDate(timex)} ${convertTimeRange(timex)}`; + } + // date + time + duration + // - OR - + // date + duration + return ''; +}; + +const convertTimexToString = function (timex) { + + const types = ('types' in timex) ? timex.types : timexInference.infer(timex); + + if (types.has('present')) { + return 'now'; + } + if (types.has('datetimerange')) { + return convertDateTimeRange(timex); + } + if (types.has('daterange')) { + return convertDateRange(timex); + } + if (types.has('duration')) { + return convertDuration(timex); + } + if (types.has('timerange')) { + return convertTimeRange(timex); + } + + // TODO: where appropriate delegate most the formatting delegate to Date.toLocaleString(options) + if (types.has('datetime')) { + return convertDateTime(timex); + } + if (types.has('date')) { + return convertDate(timex); + } + if (types.has('time')) { + return convertTime(timex); + } + return ''; +}; + +const convertTimexSetToString = function(timexSet) { + + const timex = timexSet.timex; + if (timex.types.has('duration')) { + return `every ${convertTimexDurationToString(timex, false)}`; + } + else { + return `every ${convertTimexToString(timex)}`; + } +}; + +var timexConvert$2 = { + convertDate: convertDate, + convertTime: convertTime, + convertTimexToString: convertTimexToString, + convertTimexSetToString: convertTimexSetToString +}; + +// Copyright (c) Microsoft Corporation. All rights reserved. + + + +var timexConvert = { + convertTimexToString: timexConvert$2.convertTimexToString, + convertTimexSetToString: timexConvert$2.convertTimexSetToString +}; + +// Copyright (c) Microsoft Corporation. All rights reserved. + + + + + + +const getDateDay = function (day) { + const index = (day === 0) ? 6 : day - 1; + return timexConstants.days[index]; +}; + +const convertDate$1 = function(timex, date) { + if ('year' in timex && 'month' in timex && 'dayOfMonth' in timex) { + const timexDate = new Date(timex.year, timex.month - 1, timex.dayOfMonth); + + if (timexDateHelpers.datePartEquals(timexDate, date)) { + return 'today'; + } + const tomorrow = timexDateHelpers.tomorrow(date); + if (timexDateHelpers.datePartEquals(timexDate, tomorrow)) { + return 'tomorrow'; + } + const yesterday = timexDateHelpers.yesterday(date); + if (timexDateHelpers.datePartEquals(timexDate, yesterday)) { + return 'yesterday'; + } + if (timexDateHelpers.isThisWeek(timexDate, date)) { + return `this ${getDateDay(timexDate.getDay())}`; + } + if (timexDateHelpers.isNextWeek(timexDate, date)) { + return `next ${getDateDay(timexDate.getDay())}`; + } + if (timexDateHelpers.isLastWeek(timexDate, date)) { + return `last ${getDateDay(timexDate.getDay())}`; + } + } + return timexConvert$2.convertDate(timex); +}; + +const convertDateTime$1 = function (timex, date) { + return `${convertDate$1(timex, date)} ${timexConvert$2.convertTime(timex)}`; +}; + +const convertDateRange$1 = function(timex, date) { + if ('year' in timex) { + const year = date.getFullYear(); + if (timex.year === year) { + if ('weekOfYear' in timex) { + const thisWeek = timexDateHelpers.weekOfYear(date); + if (thisWeek === timex.weekOfYear) { + return timex.weekend ? 'this weekend' : 'this week'; + } + if (thisWeek === timex.weekOfYear + 1) { + return timex.weekend ? 'last weekend' : 'last week'; + } + if (thisWeek === timex.weekOfYear - 1) { + return timex.weekend ? 'next weekend' : 'next week'; + } + } + if ('month' in timex) { + const isoMonth = date.getMonth() + 1; + if (timex.month === isoMonth) { + return 'this month'; + } + if (timex.month === isoMonth + 1) { + return 'next month'; + } + if (timex.month === isoMonth - 1) { + return 'last month'; + } + } + return ('season' in timex) ? `this ${timexConstants.seasons[timex.season]}` : 'this year'; + } + if (timex.year === year + 1) { + return ('season' in timex) ? `next ${timexConstants.seasons[timex.season]}` : 'next year'; + } + if (timex.year === year - 1) { + return ('season' in timex) ? `last ${timexConstants.seasons[timex.season]}` : 'last year'; + } + } + return ''; +}; + +const convertDateTimeRange$1 = function(timex, date) { + if ('year' in timex && 'month' in timex && 'dayOfMonth' in timex) { + const timexDate = new Date(timex.year, timex.month - 1, timex.dayOfMonth); + + if ('partOfDay' in timex) { + if (timexDateHelpers.datePartEquals(timexDate, date)) { + if (timex.partOfDay === 'NI') { + return 'tonight'; + } + else { + return `this ${timexConstants.dayParts[timex.partOfDay]}`; + } + } + const tomorrow = timexDateHelpers.tomorrow(date); + if (timexDateHelpers.datePartEquals(timexDate, tomorrow)) { + return `tomorrow ${timexConstants.dayParts[timex.partOfDay]}`; + } + const yesterday = timexDateHelpers.yesterday(date); + if (timexDateHelpers.datePartEquals(timexDate, yesterday)) { + return `yesterday ${timexConstants.dayParts[timex.partOfDay]}`; + } + + if (timexDateHelpers.isNextWeek(timexDate, date)) { + return `next ${getDateDay(timexDate.getDay())} ${timexConstants.dayParts[timex.partOfDay]}`; + } + + if (timexDateHelpers.isLastWeek(timexDate, date)) { + return `last ${getDateDay(timexDate.getDay())} ${timexConstants.dayParts[timex.partOfDay]}`; + } + } + } + return ''; +}; + +const convertTimexToStringRelative$1 = function (timex, date) { + + const types = ('types' in timex) ? timex.types : timexInference.infer(timex); + + if (types.has('datetimerange')) { + return convertDateTimeRange$1(timex, date); + } + if (types.has('daterange')) { + return convertDateRange$1(timex, date); + } + if (types.has('datetime')) { + return convertDateTime$1(timex, date); + } + if (types.has('date')) { + return convertDate$1(timex, date); + } + + return timexConvert$2.convertTimexToString(timex); +}; + +var convertTimexToStringRelative_1 = convertTimexToStringRelative$1; + +var timexRelativeConvert$2 = { + convertTimexToStringRelative: convertTimexToStringRelative_1 +}; + +// Copyright (c) Microsoft Corporation. All rights reserved. + +var convertTimexToStringRelative = timexRelativeConvert$2.convertTimexToStringRelative; + +var timexRelativeConvert = { + convertTimexToStringRelative: convertTimexToStringRelative +}; + +// Copyright (c) Microsoft Corporation. All rights reserved. + + + + + + + +class TimexProperty { + constructor (timex) { + if (typeof timex === 'string') { + timexParsing.parseString(timex, this); + } + else { + timexParsing.fromObject(timex, this); + } + // TODO: constructing a Timex from a Timex should be very cheap + } + + get timex() { + return timexFormat.format(this); + } + + get types () { + return timexInference.infer(this); + } + + toString () { + return timexConvert.convertTimexToString(this); + } + + // TODO: consider [locales[, options]] similar to Date.toLocaleString([locales[, options]]) + toNaturalLanguage (referenceDate) { + return timexRelativeConvert.convertTimexToStringRelative(this, referenceDate); + } + + static fromDate (date) { + return new TimexProperty({ + year: date.getFullYear(), + month: date.getMonth() + 1, + dayOfMonth: date.getDate() + }); + } + + static fromDateTime (date) { + return new TimexProperty({ + year: date.getFullYear(), + month: date.getMonth() + 1, + dayOfMonth: date.getDate(), + hour: date.getHours(), + minute: date.getMinutes(), + second: date.getSeconds() + }); + } + + static fromTime (time) { + return new TimexProperty(time); + } +} + +var TimexProperty_1 = TimexProperty; + +var timexProperty = { + TimexProperty: TimexProperty_1 +}; + +// Copyright (c) Microsoft Corporation. All rights reserved. + +const TimexProperty$1 = timexProperty.TimexProperty; + +class TimexSet { + constructor (timex) { + this.timex = new TimexProperty$1(timex); + } +} + +var TimexSet_1 = TimexSet; + +var timexSet = { + TimexSet: TimexSet_1 +}; + +// Copyright (c) Microsoft Corporation. All rights reserved. + + + +const TimexProperty$2 = timexProperty.TimexProperty; + +const today = function (date) { + return TimexProperty$2.fromDate(date || new Date()).timex; +}; + +const tomorrow$1 = function (date) { + const d = (date === undefined) ? new Date() : new Date(date.getTime()); + d.setDate(d.getDate() + 1); + return TimexProperty$2.fromDate(d).timex; +}; + +const yesterday$1 = function (date) { + const d = (date === undefined) ? new Date() : new Date(date.getTime()); + d.setDate(d.getDate() - 1); + return TimexProperty$2.fromDate(d).timex; +}; + +const weekFromToday = function (date) { + const d = (date === undefined) ? new Date() : new Date(date.getTime()); + return (new TimexProperty$2(Object.assign(TimexProperty$2.fromDate(d), { days: 7 }))).timex; +}; + +const weekBackFromToday = function (date) { + const d = (date === undefined) ? new Date() : new Date(date.getTime()); + d.setDate(d.getDate() - 7); + return (new TimexProperty$2(Object.assign(TimexProperty$2.fromDate(d), { days: 7 }))).timex; +}; + +const thisWeek = function (date) { + const d = (date === undefined) ? new Date() : new Date(date.getTime()); + d.setDate(d.getDate() - 7); + const start = timexDateHelpers.dateOfNextDay(1, d); + return (new TimexProperty$2(Object.assign(TimexProperty$2.fromDate(start), { days: 7 }))).timex; +}; + +const nextWeek = function (date) { + const d = (date === undefined) ? new Date() : new Date(date.getTime()); + const start = timexDateHelpers.dateOfNextDay(1, d); + return (new TimexProperty$2(Object.assign(TimexProperty$2.fromDate(start), { days: 7 }))).timex; +}; + +const lastWeek = function (date) { + const d = (date === undefined) ? new Date() : new Date(date.getTime()); + const start = timexDateHelpers.dateOfLastDay(1, d); + start.setDate(start.getDate() - 7); + return (new TimexProperty$2(Object.assign(TimexProperty$2.fromDate(start), { days: 7 }))).timex; +}; + +const nextWeeksFromToday = function (n, date) { + const d = (date === undefined) ? new Date() : new Date(date.getTime()); + return (new TimexProperty$2(Object.assign(TimexProperty$2.fromDate(d), { days: 7 * n }))).timex; +}; + +// The following constants are consistent with the Recognizer results +const monday = 'XXXX-WXX-1'; +const tuesday = 'XXXX-WXX-2'; +const wednesday = 'XXXX-WXX-3'; +const thursday = 'XXXX-WXX-4'; +const friday = 'XXXX-WXX-5'; +const saturday = 'XXXX-WXX-6'; +const sunday = 'XXXX-WXX-7'; +const morning = '(T08,T12,PT4H)'; +const afternoon = '(T12,T16,PT4H)'; +const evening = '(T16,T20,PT4H)'; +const daytime = '(T08,T18,PT10H)'; + +var timexCreator = { + today: today, + tomorrow: tomorrow$1, + yesterday: yesterday$1, + weekFromToday: weekFromToday, + weekBackFromToday: weekBackFromToday, + thisWeek: thisWeek, + nextWeek: nextWeek, + lastWeek: lastWeek, + nextWeeksFromToday: nextWeeksFromToday, + monday: monday, + tuesday: tuesday, + wednesday: wednesday, + thursday: thursday, + friday: friday, + saturday: saturday, + sunday: sunday, + morning: morning, + afternoon: afternoon, + evening: evening, + daytime: daytime +}; + +// Copyright (c) Microsoft Corporation. All rights reserved. + +const isOverlapping = function (r1, r2) { + return r1.end.getTime() > r2.start.getTime() && r1.start.getTime() <= r2.start.getTime() + || r1.start.getTime() < r2.end.getTime() && r1.start.getTime() >= r2.start.getTime(); +}; + +const collapseOverlapping = function (r1, r2, T) { + return { + start: new T(Math.max(r1.start.getTime(), r2.start.getTime())), + end: new T(Math.min(r1.end.getTime(), r2.end.getTime())) + }; +}; + +const innerCollapse = function (ranges, T) { + if (ranges.length === 1) { + return false; + } + for (let i=0; i a.start.getTime() - b.start.getTime()); + return r; +}; + +var timexConstraintsHelper = { + collapse: collapse, + isOverlapping: isOverlapping +}; + +// Copyright (c) Microsoft Corporation. All rights reserved. + + + + +const Time$2 = time.Time; +const TimexProperty$3 = timexProperty.TimexProperty; + +const resolveDefiniteAgainstConstraint = function (timex, constraint) { + const timexDate = timexHelpers.dateFromTimex(timex); + if (timexDate.getTime() >= constraint.start.getTime() && timexDate.getTime() < constraint.end.getTime()) { + return [ timex.timex ]; + } + return []; +}; + +const resolveDateAgainstConstraint = function (timex, constraint) { + if ('month' in timex && 'dayOfMonth' in timex) { + const result = []; + for (let year = constraint.start.getFullYear(); year <= constraint.end.getFullYear(); year++) { + const r = resolveDefiniteAgainstConstraint(new TimexProperty$3(Object.assign({}, timex, { year: year })), constraint); + if (r.length > 0) { + result.push(r[0]); + } + } + return result; + } + if ('dayOfWeek' in timex) { + const day = timex.dayOfWeek === 7 ? 0 : timex.dayOfWeek; + const dates = timexDateHelpers.datesMatchingDay(day, constraint.start, constraint.end); + const result = []; + for (const d of dates) { + const t = Object.assign({}, timex); + delete t.dayOfWeek; + const r = new TimexProperty$3(Object.assign({}, t, { year: d.getFullYear(), month: d.getMonth() + 1, dayOfMonth: d.getDate() })); + result.push(r.timex); + } + return result; + } + return []; +}; + +const resolveDate = function (timex, constraints) { + const result = []; + for (const constraint of constraints) { + Array.prototype.push.apply(result, resolveDateAgainstConstraint(timex, constraint)); + } + return result; +}; + +const resolveTimeAgainstConstraint = function (timex, constraint) { + const t = new Time$2(timex.hour, timex.minute, timex.second); + if (t.getTime() >= constraint.start.getTime() && t.getTime() < constraint.end.getTime()) { + return [ timex.timex ]; + } + return []; +}; + +const resolveTime = function (timex, constraints) { + const result = []; + for (const constraint of constraints) { + Array.prototype.push.apply(result, resolveTimeAgainstConstraint(timex, constraint)); + } + return result; +}; + +const removeDuplicates = function (array) { + var seen = new Set(); + return array.filter(item => { return seen.has(item) ? false : seen.add(item); }); +}; + +const resolveByDateRangeConstraints = function (candidates, timexConstraints) { + + const dateRangeConstraints = timexConstraints + .filter((timex) => { + return timex.types.has('daterange'); }) + .map((timex) => { + return timexHelpers.dateRangeFromTimex(timex); + }); + const collapsedDateRanges = timexConstraintsHelper.collapse(dateRangeConstraints, Date); + + if (collapsedDateRanges.length === 0) { + return candidates; + } + + const resolution = []; + for (const timex of candidates) { + const r = resolveDate(new TimexProperty$3(timex), collapsedDateRanges); + Array.prototype.push.apply(resolution, r); + } + + return removeDuplicates(resolution); +}; + +const resolveByTimeConstraints = function (candidates, timexConstraints) { + + const times = timexConstraints + .filter((timex) => { + return timex.types.has('time'); }) + .map((timex) => { + return timexHelpers.timeFromTimex(timex); + }); + + if (times.length === 0) { + return candidates; + } + + const resolution = []; + for (const timex of candidates.map(t => new TimexProperty$3(t))) { + if (timex.types.has('date') && !timex.types.has('time')) { + for (const time$$2 of times) { + timex.hour = time$$2.hour; + timex.minute = time$$2.minute; + timex.second = time$$2.second; + resolution.push(timex.timex); + } + } + else { + resolution.push(timex.timex); + } + } + return removeDuplicates(resolution); +}; + +const resolveByTimeRangeConstraints = function (candidates, timexConstraints) { + + const timeRangeConstraints = timexConstraints + .filter((timex) => { + return timex.types.has('timerange'); }) + .map((timex) => { + return timexHelpers.timeRangeFromTimex(timex); + }); + const collapsedTimeRanges = timexConstraintsHelper.collapse(timeRangeConstraints, Time$2); + + if (collapsedTimeRanges.length === 0) { + return candidates; + } + + const resolution = []; + for (const timex of candidates) { + const t = new TimexProperty$3(timex); + if (t.types.has('timerange')) { + const r = resolveTimeRange(t, collapsedTimeRanges); + Array.prototype.push.apply(resolution, r); + } + else if (t.types.has('time')) { + const r = resolveTime(t, collapsedTimeRanges); + Array.prototype.push.apply(resolution, r); + } + } + + return removeDuplicates(resolution); +}; + +const resolveTimeRange = function (timex, constraints) { + + const candidate = timexHelpers.timeRangeFromTimex(timex); + + const result = []; + for (const constraint of constraints) { + + if (timexConstraintsHelper.isOverlapping(candidate, constraint)) { + + const start = Math.max(candidate.start.getTime(), constraint.start.getTime()); + const time$$2 = new Time$2(start); + + // TODO: refer to comments in C# - consider first classing this clone/overwrite behavior + const resolved = new TimexProperty$3(timex.timex); + delete resolved.partOfDay; + delete resolved.seconds; + delete resolved.minutes; + delete resolved.hours; + resolved.second = time$$2.second; + resolved.minute = time$$2.minute; + resolved.hour = time$$2.hour; + + result.push(resolved.timex); + } + } + return result; +}; + +const resolveDuration = function (candidate, constraints) { + const results = []; + for (const constraint of constraints) { + if (constraint.types.has('datetime')) { + results.push(new TimexProperty$3(timexHelpers.timexDateTimeAdd(constraint, candidate))); + } + else if (constraint.types.has('time')) { + results.push(new TimexProperty$3(timexHelpers.timexTimeAdd(constraint, candidate))); + } + } + return results; +}; + +const resolveDurations = function (candidates, constraints) { + const results = []; + for (const candidate of candidates) { + const timex = new TimexProperty$3(candidate); + if (timex.types.has('duration')) { + const r = resolveDuration(timex, constraints); + for (const resolved of r) { + results.push(resolved.timex); + } + } + else { + results.push(candidate); + } + } + return results; +}; + +const evaluate = function (candidates, constraints) { + const timexConstraints = constraints.map((x) => { return new TimexProperty$3(x); }); + const candidatesWithDurationsResolved = resolveDurations(candidates, timexConstraints); + const candidatesAccordingToDate = resolveByDateRangeConstraints(candidatesWithDurationsResolved, timexConstraints); + const candidatesWithAddedTime = resolveByTimeConstraints(candidatesAccordingToDate, timexConstraints); + const candidatesFilteredByTime = resolveByTimeRangeConstraints(candidatesWithAddedTime, timexConstraints); + const timexResults = candidatesFilteredByTime.map((x) => { return new TimexProperty$3(x); }); + return timexResults; +}; + +var timexRangeResolver = { + evaluate: evaluate +}; + +// Copyright (c) Microsoft Corporation. All rights reserved. + +var datatypesDateTime = { + Time: time.Time, + TimexProperty: timexProperty.TimexProperty, + TimexSet: timexSet.TimexSet, + creator: timexCreator, + resolver: timexRangeResolver +}; + +var datatypesDateTime_1 = datatypesDateTime.Time; +var datatypesDateTime_2 = datatypesDateTime.TimexProperty; +var datatypesDateTime_3 = datatypesDateTime.TimexSet; +var datatypesDateTime_4 = datatypesDateTime.creator; +var datatypesDateTime_5 = datatypesDateTime.resolver; + +exports['default'] = datatypesDateTime; +exports.Time = datatypesDateTime_1; +exports.TimexProperty = datatypesDateTime_2; +exports.TimexSet = datatypesDateTime_3; +exports.creator = datatypesDateTime_4; +exports.resolver = datatypesDateTime_5; + +return exports; + +}({})); +//# sourceMappingURL=recognizers-text-data-types-timex-expression.browser.js.map diff --git a/libraries/botbuilder-stdlib/vendors/@microsoft/recognizers-text-data-types-timex-expression/dist/recognizers-text-data-types-timex-expression.es5.js b/libraries/botbuilder-stdlib/vendors/@microsoft/recognizers-text-data-types-timex-expression/dist/recognizers-text-data-types-timex-expression.es5.js new file mode 100644 index 0000000000..10983daab8 --- /dev/null +++ b/libraries/botbuilder-stdlib/vendors/@microsoft/recognizers-text-data-types-timex-expression/dist/recognizers-text-data-types-timex-expression.es5.js @@ -0,0 +1,1563 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. + +class Time { + constructor(hour, minute, second) { + if (arguments.length === 1) { + this.hour = Math.floor(hour / 3600000); + this.minute = Math.floor((hour - (this.hour * 3600000)) / 60000); + this.second = (hour - (this.hour * 3600000) - (this.minute * 60000)) / 1000; + } + else { + this.hour = hour; + this.minute = minute; + this.second = second; + } + } + + getTime () { + return (this.second * 1000) + (this.minute * 60000) + (this.hour * 3600000); + } +} + +var Time_1 = Time; + +var time = { + Time: Time_1 +}; + +// Copyright (c) Microsoft Corporation. All rights reserved. + +const value = function (s) { return s; }; +const isTrue = function () { return true; }; +const zero = function () { return 0; }; + +const timexRegex = { + + date: [ + // date + { regex: /^(\d\d\d\d)-(\d\d)-(\d\d)$/, props: { year: Number, month: Number, dayOfMonth: Number } }, + { regex: /^XXXX-WXX-(\d)$/, props: { dayOfWeek: Number } }, + { regex: /^XXXX-(\d\d)-(\d\d)$/, props: { month: Number, dayOfMonth: Number } }, + // daterange + { regex: /^(\d\d\d\d)$/, props: { year: Number } }, + { regex: /^(\d\d\d\d)-(\d\d)$/, props: { year: Number, month: Number } }, + { regex: /^(SP|SU|FA|WI)$/, props: { season: value } }, + { regex: /^(\d\d\d\d)-(SP|SU|FA|WI)$/, props: { year: Number, season: value } }, + { regex: /^(\d\d\d\d)-W(\d\d)$/, props: { year: Number, weekOfYear: Number } }, + { regex: /^(\d\d\d\d)-W(\d\d)-WE$/, props: { year: Number, weekOfYear: Number, weekend: isTrue } }, + { regex: /^XXXX-(\d\d)$/, props: { month: Number } }, + { regex: /^XXXX-(\d\d)-W(\d\d)$/, props: { month: Number, weekOfMonth: Number } }, + { regex: /^XXXX-(\d\d)-WXX-(\d)-(\d)$/, props: { month: Number, weekOfMonth: Number, dayOfWeek: Number } } + ], + + time: [ + // time + { regex: /^T(\d\d)$/, props: { hour: Number, minute: zero, second: zero } }, + { regex: /^T(\d\d):(\d\d)$/, props: { hour: Number, minute: Number, second: zero } }, + { regex: /^T(\d\d):(\d\d):(\d\d)$/, props: { hour: Number, minute: Number, second: Number } }, + // timerange + { regex: /^T(DT|NI|MO|AF|EV)$/, props: { partOfDay: value } } + ], + + period: [ + { regex: /^P(\d*\.?\d+)(Y|M|W|D)$/, props: { amount: Number, dateUnit: value } }, + { regex: /^PT(\d*\.?\d+)(H|M|S)$/, props: { amount: Number, timeUnit: value } } + ] +}; + +const tryExtract = function (entry, timex, result) { + const regexResult = timex.match(entry.regex); + if (!regexResult) { + return false; + } + let index = 1; + for (const name in entry.props) { + const val = regexResult[index++]; + result[name] = entry.props[name](val); + } + return true; +}; + +const extract = function (name, timex, result) { + for (const entry of timexRegex[name]) { + if (tryExtract(entry, timex, result)) { + return true; + } + } + return false; +}; + +var extract_1 = extract; + +var timexregex = { + extract: extract_1 +}; + +// Copyright (c) Microsoft Corporation. All rights reserved. + + + +const parseString = function (timex, obj) { + // a reference to the present + if (timex === 'PRESENT_REF') { + obj.now = true; + } + // duration + else if (timex.startsWith('P')) { + extractDuration(timex, obj); + } + // range indicated with start and end dates and a duration + else if (timex.startsWith('(') && timex.endsWith(')')) { + extractStartEndRange(timex, obj); + } + // date and time and their respective ranges + else { + extractDateTime(timex, obj); + } +}; + +const extractDuration = function (s, obj) { + const extracted = {}; + timexregex.extract('period', s, extracted); + if (extracted.dateUnit) { + obj[{ Y: 'years', M: 'months', W: 'weeks', D: 'days' }[extracted.dateUnit]] = extracted.amount; + } + else if (extracted.timeUnit) { + obj[{ H: 'hours', M: 'minutes', S: 'seconds' }[extracted.timeUnit]] = extracted.amount; + } +}; + +const extractStartEndRange = function (s, obj) { + const parts = s.substring(1, s.length - 1).split(','); + if (parts.length === 3) { + extractDateTime(parts[0], obj); + extractDuration(parts[2], obj); + } +}; + +const extractDateTime = function (s, obj) { + const indexOfT = s.indexOf('T'); + if (indexOfT === -1) { + timexregex.extract('date', s, obj); + } + else { + timexregex.extract('date', s.substr(0, indexOfT), obj); + timexregex.extract('time', s.substr(indexOfT), obj); + } +}; + +const fromObject = function (source, obj) { + Object.assign(obj, source); + if ('hour' in obj) { + if (!('minute' in obj)) { + obj.minute = 0; + } + if (!('second' in obj)) { + obj.second = 0; + } + } +}; + +var timexParsing = { + parseString: parseString, + fromObject: fromObject +}; + +// Copyright (c) Microsoft Corporation. All rights reserved. + +const isPresent = function (obj) { + return obj.now === true; +}; + +const isDuration = function (obj) { + return 'years' in obj || 'months' in obj || 'weeks' in obj || 'days' in obj + || 'hours' in obj || 'minutes' in obj || 'seconds' in obj; +}; + +const isTime = function (obj) { + return 'hour' in obj && 'minute' in obj && 'second' in obj; +}; + +const isDate = function (obj) { + return ('month' in obj && 'dayOfMonth' in obj) || 'dayOfWeek' in obj; +}; + +const isTimeRange = function (obj) { + return 'partOfDay' in obj; +}; + +const isDateRange = function (obj) { + return ('year' in obj && !('dayOfMonth' in obj)) + || ('year' in obj && 'month' in obj && !('dayOfMonth' in obj)) + || ('month' in obj && !('dayOfMonth' in obj)) + || 'season' in obj + || 'weekOfYear' in obj + || 'weekOfMonth' in obj; +}; + +const isDefinite = function (obj) { + return 'year' in obj && 'month' in obj && 'dayOfMonth' in obj; +}; + +const infer = function (obj) { + const types = new Set(); + if (isPresent(obj)) { + types.add('present'); + } + if (isDefinite(obj)) { + types.add('definite'); + } + if (isDate(obj)) { + types.add('date'); + } + if (isDateRange(obj)) { + types.add('daterange'); + } + if (isDuration(obj)) { + types.add('duration'); + } + if (isTime(obj)) { + types.add('time'); + } + if (isTimeRange(obj)) { + types.add('timerange'); + } + if (types.has('present')) { + types.add('date'); + types.add('time'); + } + if (types.has('time') && types.has('duration')) { + types.add('timerange'); + } + if (types.has('date') && types.has('time')) { + types.add('datetime'); + } + if (types.has('date') && types.has('duration')) { + types.add('daterange'); + } + if (types.has('datetime') && types.has('duration')) { + types.add('datetimerange'); + } + if (types.has('date') && types.has('timerange')) { + types.add('datetimerange'); + } + return types; +}; + +var infer_1 = infer; + +var timexInference = { + infer: infer_1 +}; + +// Copyright (c) Microsoft Corporation. All rights reserved. + +const cloneDate = function (date) { + const result = new Date(); + result.setTime(date.getTime()); + return result; +}; + +const tomorrow = function (date) { + const result = cloneDate(date); + result.setDate(result.getDate() + 1); + return result; +}; + +const yesterday = function (date) { + const result = cloneDate(date); + result.setDate(result.getDate() - 1); + return result; +}; + +const datePartEquals = function (dateX, dateY) { + return (dateX.getFullYear() === dateY.getFullYear()) + && (dateX.getMonth() === dateY.getMonth()) + && (dateX.getDate() === dateY.getDate()); +}; + +const isDateInWeek = function (date, startOfWeek) { + let d = cloneDate(startOfWeek); + for (let i=0; i<7; i++) { + if (datePartEquals(date, d)) { + return true; + } + d = tomorrow(d); + } + return false; +}; + +const isThisWeek = function (date, referenceDate) { + const startOfThisWeek = cloneDate(referenceDate); + startOfThisWeek.setDate(startOfThisWeek.getDate() - startOfThisWeek.getDay()); + return isDateInWeek(date, startOfThisWeek); +}; + +const isNextWeek = function (date, referenceDate) { + const startOfNextWeek = cloneDate(referenceDate); + startOfNextWeek.setDate(startOfNextWeek.getDate() + (7 - startOfNextWeek.getDay())); + return isDateInWeek(date, startOfNextWeek); +}; + +const isLastWeek = function (date, referenceDate) { + const startOfLastWeek = cloneDate(referenceDate); + startOfLastWeek.setDate(startOfLastWeek.getDate() - (7 + startOfLastWeek.getDay())); + return isDateInWeek(date, startOfLastWeek); +}; + +const weekOfYear = function (date) { + const ds = new Date(date.getFullYear(), 0); + const de = new Date(date.getFullYear(), date.getMonth(), date.getDate()); + let weeks = 1; + while (ds.getTime() < de.getTime()) { + const jsDayOfWeek = ds.getDay(); + const isoDayOfWeek = jsDayOfWeek == 0 ? 7 : jsDayOfWeek; + if (isoDayOfWeek === 7) { + weeks++; + } + ds.setDate(ds.getDate() + 1); + } + return weeks; +}; + +const fixedFormatNumber$1 = function (n, size) { + const s = n.toString(); + let zeros = ''; + const np = size - s.length; + for (let i=0; i 23) { + const days = Math.floor(result.hour / 24); + const hour = result.hour % 24; + result.hour = hour; + if ('year' in result && 'month' in result && 'dayOfMonth' in result) { + const d = new Date(result.year, result.month - 1, result.dayOfMonth, 0, 0, 0); + for (let i=0; i 59) { + result.hour++; + result.minute = 0; + } + return result; + } + return start; +}; + +const timexDateTimeAdd$1 = function (start, duration) { + return timexTimeAdd$1(timexDateAdd$1(start, duration), duration); +}; + +const expandDateTimeRange = function (timex) { + const types = ('types' in timex) ? timex.types : timexInference.infer(timex); + if (types.has('duration')) { + const start = cloneDateTime(timex); + const duration = cloneDuration(timex); + return { start: start, end: timexDateTimeAdd$1(start, duration), duration: duration }; + } + else { + if ('year' in timex) { + const range = { start: { year: timex.year }, end: {} }; + if ('month' in timex) { + range.start.month = timex.month; + range.start.dayOfMonth = 1; + range.end.year = timex.year; + range.end.month = timex.month + 1; + range.end.dayOfMonth = 1; + } + else { + range.start.month = 1; + range.start.dayOfMonth = 1; + range.end.year = timex.year + 1; + range.end.month = 1; + range.end.dayOfMonth = 1; + } + return range; + } + } + return { start: {}, end: {} }; +}; + +const timeAdd = function (start, duration) { + const hours = duration.hours || 0; + const minutes = duration.minutes || 0; + const seconds = duration.seconds || 0; + return { hour: start.hour + hours, minute: start.minute + minutes, second: start.second + seconds }; +}; + +const expandTimeRange = function (timex) { + + if (!timex.types.has('timerange')) + { + throw new exception('argument must be a timerange'); + } + + if (timex.partOfDay !== undefined) { + switch (timex.partOfDay) { + case 'DT': + timex = { hour: 8, minute: 0, second: 0, hours: 10, minutes: 0, seconds: 0 }; + break; + case 'MO': + timex = { hour: 8, minute: 0, second: 0, hours: 4, minutes: 0, seconds: 0 }; + break; + case 'AF': + timex = { hour: 12, minute: 0, second: 0, hours: 4, minutes: 0, seconds: 0 }; + break; + case 'EV': + timex = { hour: 16, minute: 0, second: 0, hours: 4, minutes: 0, seconds: 0 }; + break; + case 'NI': + timex = { hour: 20, minute: 0, second: 0, hours: 4, minutes: 0, seconds: 0 }; + break; + default: + throw new exception('unrecognized part of day timerange'); + } + } + + const start = { hour: timex.hour, minute: timex.minute, second: timex.second }; + const duration = cloneDuration(timex); + return { start: start, end: timeAdd(start, duration), duration: duration }; +}; + +const dateFromTimex = function (timex) { + const year = 'year' in timex ? timex.year : 2001; + const month = 'month' in timex ? timex.month - 1 : 0; + const date = 'dayOfMonth' in timex ? timex.dayOfMonth : 1; + const hour = 'hour' in timex ? timex.hour : 0; + const minute = 'minute' in timex ? timex.minute : 0; + const second = 'second' in timex ? timex.second : 0; + return new Date(year, month, date, hour, minute, second); +}; + +const timeFromTimex = function (timex) { + const hour = timex.hour || 0; + const minute = timex.minute || 0; + const second = timex.second || 0; + return new Time$1(hour, minute, second); +}; + +const dateRangeFromTimex = function (timex) { + const expanded = expandDateTimeRange(timex); + return { start: dateFromTimex(expanded.start), end: dateFromTimex(expanded.end) }; +}; + +const timeRangeFromTimex = function (timex) { + const expanded = expandTimeRange(timex); + return { start: timeFromTimex(expanded.start), end: timeFromTimex(expanded.end) }; +}; + +var timexHelpers = { + expandDateTimeRange: expandDateTimeRange, + expandTimeRange: expandTimeRange, + dateFromTimex: dateFromTimex, + timeFromTimex: timeFromTimex, + dateRangeFromTimex: dateRangeFromTimex, + timeRangeFromTimex: timeRangeFromTimex, + timexTimeAdd: timexTimeAdd$1, + timexDateTimeAdd: timexDateTimeAdd$1 +}; + +// Copyright (c) Microsoft Corporation. All rights reserved. + + +const fixedFormatNumber = timexDateHelpers.fixedFormatNumber; + + +const formatDuration = function (timex) { + if ('years' in timex) { + return `P${timex.years}Y`; + } + if ('months' in timex) { + return `P${timex.months}M`; + } + if ('weeks' in timex) { + return `P${timex.weeks}W`; + } + if ('days' in timex) { + return `P${timex.days}D`; + } + if ('hours' in timex) { + return `PT${timex.hours}H`; + } + if ('minutes' in timex) { + return `PT${timex.minutes}M`; + } + if ('seconds' in timex) { + return `PT${timex.seconds}S`; + } + return ''; +}; + +const formatTime = function (timex) { + if (timex.minute === 0 && timex.second === 0) { + return `T${fixedFormatNumber(timex.hour, 2)}`; + } + if (timex.second === 0) { + return `T${fixedFormatNumber(timex.hour, 2)}:${fixedFormatNumber(timex.minute, 2)}`; + } + return `T${fixedFormatNumber(timex.hour, 2)}:${fixedFormatNumber(timex.minute, 2)}:${fixedFormatNumber(timex.second, 2)}`; +}; + +const formatDate = function (timex) { + if ('year' in timex && 'month' in timex && 'dayOfMonth' in timex) { + return `${fixedFormatNumber(timex.year, 4)}-${fixedFormatNumber(timex.month, 2)}-${fixedFormatNumber(timex.dayOfMonth, 2)}`; + } + if ('month' in timex && 'dayOfMonth' in timex) { + return `XXXX-${fixedFormatNumber(timex.month, 2)}-${fixedFormatNumber(timex.dayOfMonth, 2)}`; + } + if ('dayOfWeek' in timex) { + return `XXXX-WXX-${timex.dayOfWeek}`; + } + return ''; +}; + +const formatDateRange = function (timex) { + if ('year' in timex && 'weekOfYear' in timex && 'weekend' in timex) { + return `${fixedFormatNumber(timex.year, 4)}-W${fixedFormatNumber(timex.weekOfYear, 2)}-WE`; + } + if ('year' in timex && 'weekOfYear' in timex) { + return `${fixedFormatNumber(timex.year, 4)}-W${fixedFormatNumber(timex.weekOfYear, 2)}`; + } + if ('year' in timex && 'season' in timex) { + return `${fixedFormatNumber(timex.year, 4)}-${timex.season}`; + } + if ('season' in timex) { + return `${timex.season}`; + } + if ('year' in timex && 'month' in timex) { + return `${fixedFormatNumber(timex.year, 4)}-${fixedFormatNumber(timex.month, 2)}`; + } + if ('year' in timex) { + return `${fixedFormatNumber(timex.year, 4)}`; + } + if ('month' in timex && 'weekOfMonth' in timex && 'dayOfWeek' in timex) { + return `XXXX-${fixedFormatNumber(timex.month, 2)}-WXX-${timex.weekOfMonth}-${timex.dayOfWeek}`; + } + if ('month' in timex && 'weekOfMonth' in timex) { + return `XXXX-${fixedFormatNumber(timex.month, 2)}-WXX-${timex.weekOfMonth}`; + } + if ('month' in timex) { + return `XXXX-${fixedFormatNumber(timex.month, 2)}`; + } + return ''; +}; + +const formatTimeRange = function (timex) { + if ('partOfDay' in timex) { + return `T${timex.partOfDay}`; + } + return ''; +}; + +const format = function(timex) { + + const types = ('types' in timex) ? timex.types : timexInference.infer(timex); + + if (types.has('present')) { + return 'PRESENT_REF'; + } + if ((types.has('datetimerange') || types.has('daterange') || types.has('timerange')) && types.has('duration')) { + const range = timexHelpers.expandDateTimeRange(timex); + return `(${format(range.start)},${format(range.end)},${format(range.duration)})`; + } + if (types.has('datetimerange')) { + return `${formatDate(timex)}${formatTimeRange(timex)}`; + } + if (types.has('daterange')) { + return `${formatDateRange(timex)}`; + } + if (types.has('timerange')) { + return `${formatTimeRange(timex)}`; + } + if (types.has('datetime')) { + return `${formatDate(timex)}${formatTime(timex)}`; + } + if (types.has('duration')) { + return `${formatDuration(timex)}`; + } + if (types.has('date')) { + return `${formatDate(timex)}`; + } + if (types.has('time')) { + return `${formatTime(timex)}`; + } + return ''; +}; + +var format_1 = format; + +var timexFormat = { + format: format_1 +}; + +// Copyright (c) Microsoft Corporation. All rights reserved. + +var days = [ + 'Monday', + 'Tuesday', + 'Wednesday', + 'Thursday', + 'Friday', + 'Saturday', + 'Sunday' +]; + +var months = [ + 'January', + 'Februrary', + 'March', + 'April', + 'May', + 'June', + 'July', + 'August', + 'September', + 'October', + 'November', + 'December' +]; + +var dateAbbreviation = { 0: 'th', 1: 'st', 2: 'nd', 3: 'rd', 4: 'th', 5: 'th', 6: 'th', 7: 'th', 8: 'th', 9: 'th' }; + +var hours = [ + 'midnight', '1AM', '2AM', '3AM', '4AM', '5AM', '6AM', '7AM', '8AM', '9AM', '10AM', '11AM', + 'midday', '1PM', '2PM', '3PM', '4PM', '5PM', '6PM', '7PM', '8PM', '9PM', '10PM', '11PM' +]; + +var seasons = { SP: 'spring', SU: 'summer', FA: 'fall', WI: 'winter' }; + +var weeks = [ 'first', 'second', 'third', 'forth' ]; + +var dayParts = { DT: 'daytime', NI: 'night', MO: 'morning', AF: 'afternoon', EV: 'evening' }; + +var timexConstants = { + days: days, + months: months, + dateAbbreviation: dateAbbreviation, + hours: hours, + seasons: seasons, + weeks: weeks, + dayParts: dayParts +}; + +// Copyright (c) Microsoft Corporation. All rights reserved. + + + + +const convertDate = function(timex) { + if ('dayOfWeek' in timex) { + return timexConstants.days[timex.dayOfWeek - 1]; + } + const month = timexConstants.months[timex.month - 1]; + const date = timex.dayOfMonth.toString(); + const abbreviation = timexConstants.dateAbbreviation[date.slice(-1)]; + if ('year' in timex) { + return `${date}${abbreviation} ${month} ${timex.year}`.trim(); + } + return `${date}${abbreviation} ${month}`; +}; + +const convertTime = function(timex) { + if (timex.hour === 0 && timex.minute === 0 && timex.second === 0) { + return 'midnight'; + } + if (timex.hour === 12 && timex.minute === 0 && timex.second === 0) { + return 'midday'; + } + const pad = function (s) { return (s.length === 1) ? '0' + s : s; }; + const hour = (timex.hour === 0) ? '12' : (timex.hour > 12) ? (timex.hour - 12).toString() : timex.hour.toString(); + const minute = (timex.minute === 0 && timex.second === 0) ? '' : ':' + pad(timex.minute.toString()); + const second = (timex.second === 0) ? '' : ':' + pad(timex.second.toString()); + const period = timex.hour < 12 ? 'AM' : 'PM'; + return `${hour}${minute}${second}${period}`; +}; + +const convertDurationPropertyToString = function (timex, property, includeSingleCount) { + const propertyName = property + 's'; + const value = timex[propertyName]; + if (value !== undefined) { + if (value === 1) { + return includeSingleCount ? '1 ' + property : property; + } + else { + return `${value} ${property}s`; + } + } + return false; +}; + +const convertTimexDurationToString = function (timex, includeSingleCount) { + return convertDurationPropertyToString(timex, 'year', includeSingleCount) + || convertDurationPropertyToString(timex, 'month', includeSingleCount) + || convertDurationPropertyToString(timex, 'week', includeSingleCount) + || convertDurationPropertyToString(timex, 'day', includeSingleCount) + || convertDurationPropertyToString(timex, 'hour', includeSingleCount) + || convertDurationPropertyToString(timex, 'minute', includeSingleCount) + || convertDurationPropertyToString(timex, 'second', includeSingleCount); +}; + +const convertDuration = function(timex) { + return convertTimexDurationToString(timex, true); +}; + +const convertDateRange = function(timex) { + const season = ('season' in timex) ? timexConstants.seasons[timex.season] : ''; + const year = ('year' in timex) ? timex.year.toString() : ''; + if ('weekOfYear' in timex) { + if (timex.weekend) { + return ''; + } + else { + return ''; + } + } + if ('month' in timex) { + const month = `${timexConstants.months[timex.month - 1]}`; + if ('weekOfMonth' in timex) { + return `${timexConstants.weeks[timex.weekOfMonth - 1]} week of ${month}`; + } + else { + return `${month} ${year}`.trim(); + } + } + return `${season} ${year}`.trim(); +}; + +const convertTimeRange = function(timex) { + return timexConstants.dayParts[timex.partOfDay]; +}; + +const convertDateTime = function(timex) { + return `${convertTime(timex)} ${convertDate(timex)}`; +}; + +const convertDateTimeRange = function(timex) { + if (timex.types.has('timerange')) { + return `${convertDate(timex)} ${convertTimeRange(timex)}`; + } + // date + time + duration + // - OR - + // date + duration + return ''; +}; + +const convertTimexToString = function (timex) { + + const types = ('types' in timex) ? timex.types : timexInference.infer(timex); + + if (types.has('present')) { + return 'now'; + } + if (types.has('datetimerange')) { + return convertDateTimeRange(timex); + } + if (types.has('daterange')) { + return convertDateRange(timex); + } + if (types.has('duration')) { + return convertDuration(timex); + } + if (types.has('timerange')) { + return convertTimeRange(timex); + } + + // TODO: where appropriate delegate most the formatting delegate to Date.toLocaleString(options) + if (types.has('datetime')) { + return convertDateTime(timex); + } + if (types.has('date')) { + return convertDate(timex); + } + if (types.has('time')) { + return convertTime(timex); + } + return ''; +}; + +const convertTimexSetToString = function(timexSet) { + + const timex = timexSet.timex; + if (timex.types.has('duration')) { + return `every ${convertTimexDurationToString(timex, false)}`; + } + else { + return `every ${convertTimexToString(timex)}`; + } +}; + +var timexConvert$2 = { + convertDate: convertDate, + convertTime: convertTime, + convertTimexToString: convertTimexToString, + convertTimexSetToString: convertTimexSetToString +}; + +// Copyright (c) Microsoft Corporation. All rights reserved. + + + +var timexConvert = { + convertTimexToString: timexConvert$2.convertTimexToString, + convertTimexSetToString: timexConvert$2.convertTimexSetToString +}; + +// Copyright (c) Microsoft Corporation. All rights reserved. + + + + + + +const getDateDay = function (day) { + const index = (day === 0) ? 6 : day - 1; + return timexConstants.days[index]; +}; + +const convertDate$1 = function(timex, date) { + if ('year' in timex && 'month' in timex && 'dayOfMonth' in timex) { + const timexDate = new Date(timex.year, timex.month - 1, timex.dayOfMonth); + + if (timexDateHelpers.datePartEquals(timexDate, date)) { + return 'today'; + } + const tomorrow = timexDateHelpers.tomorrow(date); + if (timexDateHelpers.datePartEquals(timexDate, tomorrow)) { + return 'tomorrow'; + } + const yesterday = timexDateHelpers.yesterday(date); + if (timexDateHelpers.datePartEquals(timexDate, yesterday)) { + return 'yesterday'; + } + if (timexDateHelpers.isThisWeek(timexDate, date)) { + return `this ${getDateDay(timexDate.getDay())}`; + } + if (timexDateHelpers.isNextWeek(timexDate, date)) { + return `next ${getDateDay(timexDate.getDay())}`; + } + if (timexDateHelpers.isLastWeek(timexDate, date)) { + return `last ${getDateDay(timexDate.getDay())}`; + } + } + return timexConvert$2.convertDate(timex); +}; + +const convertDateTime$1 = function (timex, date) { + return `${convertDate$1(timex, date)} ${timexConvert$2.convertTime(timex)}`; +}; + +const convertDateRange$1 = function(timex, date) { + if ('year' in timex) { + const year = date.getFullYear(); + if (timex.year === year) { + if ('weekOfYear' in timex) { + const thisWeek = timexDateHelpers.weekOfYear(date); + if (thisWeek === timex.weekOfYear) { + return timex.weekend ? 'this weekend' : 'this week'; + } + if (thisWeek === timex.weekOfYear + 1) { + return timex.weekend ? 'last weekend' : 'last week'; + } + if (thisWeek === timex.weekOfYear - 1) { + return timex.weekend ? 'next weekend' : 'next week'; + } + } + if ('month' in timex) { + const isoMonth = date.getMonth() + 1; + if (timex.month === isoMonth) { + return 'this month'; + } + if (timex.month === isoMonth + 1) { + return 'next month'; + } + if (timex.month === isoMonth - 1) { + return 'last month'; + } + } + return ('season' in timex) ? `this ${timexConstants.seasons[timex.season]}` : 'this year'; + } + if (timex.year === year + 1) { + return ('season' in timex) ? `next ${timexConstants.seasons[timex.season]}` : 'next year'; + } + if (timex.year === year - 1) { + return ('season' in timex) ? `last ${timexConstants.seasons[timex.season]}` : 'last year'; + } + } + return ''; +}; + +const convertDateTimeRange$1 = function(timex, date) { + if ('year' in timex && 'month' in timex && 'dayOfMonth' in timex) { + const timexDate = new Date(timex.year, timex.month - 1, timex.dayOfMonth); + + if ('partOfDay' in timex) { + if (timexDateHelpers.datePartEquals(timexDate, date)) { + if (timex.partOfDay === 'NI') { + return 'tonight'; + } + else { + return `this ${timexConstants.dayParts[timex.partOfDay]}`; + } + } + const tomorrow = timexDateHelpers.tomorrow(date); + if (timexDateHelpers.datePartEquals(timexDate, tomorrow)) { + return `tomorrow ${timexConstants.dayParts[timex.partOfDay]}`; + } + const yesterday = timexDateHelpers.yesterday(date); + if (timexDateHelpers.datePartEquals(timexDate, yesterday)) { + return `yesterday ${timexConstants.dayParts[timex.partOfDay]}`; + } + + if (timexDateHelpers.isNextWeek(timexDate, date)) { + return `next ${getDateDay(timexDate.getDay())} ${timexConstants.dayParts[timex.partOfDay]}`; + } + + if (timexDateHelpers.isLastWeek(timexDate, date)) { + return `last ${getDateDay(timexDate.getDay())} ${timexConstants.dayParts[timex.partOfDay]}`; + } + } + } + return ''; +}; + +const convertTimexToStringRelative$1 = function (timex, date) { + + const types = ('types' in timex) ? timex.types : timexInference.infer(timex); + + if (types.has('datetimerange')) { + return convertDateTimeRange$1(timex, date); + } + if (types.has('daterange')) { + return convertDateRange$1(timex, date); + } + if (types.has('datetime')) { + return convertDateTime$1(timex, date); + } + if (types.has('date')) { + return convertDate$1(timex, date); + } + + return timexConvert$2.convertTimexToString(timex); +}; + +var convertTimexToStringRelative_1 = convertTimexToStringRelative$1; + +var timexRelativeConvert$2 = { + convertTimexToStringRelative: convertTimexToStringRelative_1 +}; + +// Copyright (c) Microsoft Corporation. All rights reserved. + +var convertTimexToStringRelative = timexRelativeConvert$2.convertTimexToStringRelative; + +var timexRelativeConvert = { + convertTimexToStringRelative: convertTimexToStringRelative +}; + +// Copyright (c) Microsoft Corporation. All rights reserved. + + + + + + + +class TimexProperty { + constructor (timex) { + if (typeof timex === 'string') { + timexParsing.parseString(timex, this); + } + else { + timexParsing.fromObject(timex, this); + } + // TODO: constructing a Timex from a Timex should be very cheap + } + + get timex() { + return timexFormat.format(this); + } + + get types () { + return timexInference.infer(this); + } + + toString () { + return timexConvert.convertTimexToString(this); + } + + // TODO: consider [locales[, options]] similar to Date.toLocaleString([locales[, options]]) + toNaturalLanguage (referenceDate) { + return timexRelativeConvert.convertTimexToStringRelative(this, referenceDate); + } + + static fromDate (date) { + return new TimexProperty({ + year: date.getFullYear(), + month: date.getMonth() + 1, + dayOfMonth: date.getDate() + }); + } + + static fromDateTime (date) { + return new TimexProperty({ + year: date.getFullYear(), + month: date.getMonth() + 1, + dayOfMonth: date.getDate(), + hour: date.getHours(), + minute: date.getMinutes(), + second: date.getSeconds() + }); + } + + static fromTime (time) { + return new TimexProperty(time); + } +} + +var TimexProperty_1 = TimexProperty; + +var timexProperty = { + TimexProperty: TimexProperty_1 +}; + +// Copyright (c) Microsoft Corporation. All rights reserved. + +const TimexProperty$1 = timexProperty.TimexProperty; + +class TimexSet { + constructor (timex) { + this.timex = new TimexProperty$1(timex); + } +} + +var TimexSet_1 = TimexSet; + +var timexSet = { + TimexSet: TimexSet_1 +}; + +// Copyright (c) Microsoft Corporation. All rights reserved. + + + +const TimexProperty$2 = timexProperty.TimexProperty; + +const today = function (date) { + return TimexProperty$2.fromDate(date || new Date()).timex; +}; + +const tomorrow$1 = function (date) { + const d = (date === undefined) ? new Date() : new Date(date.getTime()); + d.setDate(d.getDate() + 1); + return TimexProperty$2.fromDate(d).timex; +}; + +const yesterday$1 = function (date) { + const d = (date === undefined) ? new Date() : new Date(date.getTime()); + d.setDate(d.getDate() - 1); + return TimexProperty$2.fromDate(d).timex; +}; + +const weekFromToday = function (date) { + const d = (date === undefined) ? new Date() : new Date(date.getTime()); + return (new TimexProperty$2(Object.assign(TimexProperty$2.fromDate(d), { days: 7 }))).timex; +}; + +const weekBackFromToday = function (date) { + const d = (date === undefined) ? new Date() : new Date(date.getTime()); + d.setDate(d.getDate() - 7); + return (new TimexProperty$2(Object.assign(TimexProperty$2.fromDate(d), { days: 7 }))).timex; +}; + +const thisWeek = function (date) { + const d = (date === undefined) ? new Date() : new Date(date.getTime()); + d.setDate(d.getDate() - 7); + const start = timexDateHelpers.dateOfNextDay(1, d); + return (new TimexProperty$2(Object.assign(TimexProperty$2.fromDate(start), { days: 7 }))).timex; +}; + +const nextWeek = function (date) { + const d = (date === undefined) ? new Date() : new Date(date.getTime()); + const start = timexDateHelpers.dateOfNextDay(1, d); + return (new TimexProperty$2(Object.assign(TimexProperty$2.fromDate(start), { days: 7 }))).timex; +}; + +const lastWeek = function (date) { + const d = (date === undefined) ? new Date() : new Date(date.getTime()); + const start = timexDateHelpers.dateOfLastDay(1, d); + start.setDate(start.getDate() - 7); + return (new TimexProperty$2(Object.assign(TimexProperty$2.fromDate(start), { days: 7 }))).timex; +}; + +const nextWeeksFromToday = function (n, date) { + const d = (date === undefined) ? new Date() : new Date(date.getTime()); + return (new TimexProperty$2(Object.assign(TimexProperty$2.fromDate(d), { days: 7 * n }))).timex; +}; + +// The following constants are consistent with the Recognizer results +const monday = 'XXXX-WXX-1'; +const tuesday = 'XXXX-WXX-2'; +const wednesday = 'XXXX-WXX-3'; +const thursday = 'XXXX-WXX-4'; +const friday = 'XXXX-WXX-5'; +const saturday = 'XXXX-WXX-6'; +const sunday = 'XXXX-WXX-7'; +const morning = '(T08,T12,PT4H)'; +const afternoon = '(T12,T16,PT4H)'; +const evening = '(T16,T20,PT4H)'; +const daytime = '(T08,T18,PT10H)'; + +var timexCreator = { + today: today, + tomorrow: tomorrow$1, + yesterday: yesterday$1, + weekFromToday: weekFromToday, + weekBackFromToday: weekBackFromToday, + thisWeek: thisWeek, + nextWeek: nextWeek, + lastWeek: lastWeek, + nextWeeksFromToday: nextWeeksFromToday, + monday: monday, + tuesday: tuesday, + wednesday: wednesday, + thursday: thursday, + friday: friday, + saturday: saturday, + sunday: sunday, + morning: morning, + afternoon: afternoon, + evening: evening, + daytime: daytime +}; + +// Copyright (c) Microsoft Corporation. All rights reserved. + +const isOverlapping = function (r1, r2) { + return r1.end.getTime() > r2.start.getTime() && r1.start.getTime() <= r2.start.getTime() + || r1.start.getTime() < r2.end.getTime() && r1.start.getTime() >= r2.start.getTime(); +}; + +const collapseOverlapping = function (r1, r2, T) { + return { + start: new T(Math.max(r1.start.getTime(), r2.start.getTime())), + end: new T(Math.min(r1.end.getTime(), r2.end.getTime())) + }; +}; + +const innerCollapse = function (ranges, T) { + if (ranges.length === 1) { + return false; + } + for (let i=0; i a.start.getTime() - b.start.getTime()); + return r; +}; + +var timexConstraintsHelper = { + collapse: collapse, + isOverlapping: isOverlapping +}; + +// Copyright (c) Microsoft Corporation. All rights reserved. + + + + +const Time$2 = time.Time; +const TimexProperty$3 = timexProperty.TimexProperty; + +const resolveDefiniteAgainstConstraint = function (timex, constraint) { + const timexDate = timexHelpers.dateFromTimex(timex); + if (timexDate.getTime() >= constraint.start.getTime() && timexDate.getTime() < constraint.end.getTime()) { + return [ timex.timex ]; + } + return []; +}; + +const resolveDateAgainstConstraint = function (timex, constraint) { + if ('month' in timex && 'dayOfMonth' in timex) { + const result = []; + for (let year = constraint.start.getFullYear(); year <= constraint.end.getFullYear(); year++) { + const r = resolveDefiniteAgainstConstraint(new TimexProperty$3(Object.assign({}, timex, { year: year })), constraint); + if (r.length > 0) { + result.push(r[0]); + } + } + return result; + } + if ('dayOfWeek' in timex) { + const day = timex.dayOfWeek === 7 ? 0 : timex.dayOfWeek; + const dates = timexDateHelpers.datesMatchingDay(day, constraint.start, constraint.end); + const result = []; + for (const d of dates) { + const t = Object.assign({}, timex); + delete t.dayOfWeek; + const r = new TimexProperty$3(Object.assign({}, t, { year: d.getFullYear(), month: d.getMonth() + 1, dayOfMonth: d.getDate() })); + result.push(r.timex); + } + return result; + } + return []; +}; + +const resolveDate = function (timex, constraints) { + const result = []; + for (const constraint of constraints) { + Array.prototype.push.apply(result, resolveDateAgainstConstraint(timex, constraint)); + } + return result; +}; + +const resolveTimeAgainstConstraint = function (timex, constraint) { + const t = new Time$2(timex.hour, timex.minute, timex.second); + if (t.getTime() >= constraint.start.getTime() && t.getTime() < constraint.end.getTime()) { + return [ timex.timex ]; + } + return []; +}; + +const resolveTime = function (timex, constraints) { + const result = []; + for (const constraint of constraints) { + Array.prototype.push.apply(result, resolveTimeAgainstConstraint(timex, constraint)); + } + return result; +}; + +const removeDuplicates = function (array) { + var seen = new Set(); + return array.filter(item => { return seen.has(item) ? false : seen.add(item); }); +}; + +const resolveByDateRangeConstraints = function (candidates, timexConstraints) { + + const dateRangeConstraints = timexConstraints + .filter((timex) => { + return timex.types.has('daterange'); }) + .map((timex) => { + return timexHelpers.dateRangeFromTimex(timex); + }); + const collapsedDateRanges = timexConstraintsHelper.collapse(dateRangeConstraints, Date); + + if (collapsedDateRanges.length === 0) { + return candidates; + } + + const resolution = []; + for (const timex of candidates) { + const r = resolveDate(new TimexProperty$3(timex), collapsedDateRanges); + Array.prototype.push.apply(resolution, r); + } + + return removeDuplicates(resolution); +}; + +const resolveByTimeConstraints = function (candidates, timexConstraints) { + + const times = timexConstraints + .filter((timex) => { + return timex.types.has('time'); }) + .map((timex) => { + return timexHelpers.timeFromTimex(timex); + }); + + if (times.length === 0) { + return candidates; + } + + const resolution = []; + for (const timex of candidates.map(t => new TimexProperty$3(t))) { + if (timex.types.has('date') && !timex.types.has('time')) { + for (const time$$2 of times) { + timex.hour = time$$2.hour; + timex.minute = time$$2.minute; + timex.second = time$$2.second; + resolution.push(timex.timex); + } + } + else { + resolution.push(timex.timex); + } + } + return removeDuplicates(resolution); +}; + +const resolveByTimeRangeConstraints = function (candidates, timexConstraints) { + + const timeRangeConstraints = timexConstraints + .filter((timex) => { + return timex.types.has('timerange'); }) + .map((timex) => { + return timexHelpers.timeRangeFromTimex(timex); + }); + const collapsedTimeRanges = timexConstraintsHelper.collapse(timeRangeConstraints, Time$2); + + if (collapsedTimeRanges.length === 0) { + return candidates; + } + + const resolution = []; + for (const timex of candidates) { + const t = new TimexProperty$3(timex); + if (t.types.has('timerange')) { + const r = resolveTimeRange(t, collapsedTimeRanges); + Array.prototype.push.apply(resolution, r); + } + else if (t.types.has('time')) { + const r = resolveTime(t, collapsedTimeRanges); + Array.prototype.push.apply(resolution, r); + } + } + + return removeDuplicates(resolution); +}; + +const resolveTimeRange = function (timex, constraints) { + + const candidate = timexHelpers.timeRangeFromTimex(timex); + + const result = []; + for (const constraint of constraints) { + + if (timexConstraintsHelper.isOverlapping(candidate, constraint)) { + + const start = Math.max(candidate.start.getTime(), constraint.start.getTime()); + const time$$2 = new Time$2(start); + + // TODO: refer to comments in C# - consider first classing this clone/overwrite behavior + const resolved = new TimexProperty$3(timex.timex); + delete resolved.partOfDay; + delete resolved.seconds; + delete resolved.minutes; + delete resolved.hours; + resolved.second = time$$2.second; + resolved.minute = time$$2.minute; + resolved.hour = time$$2.hour; + + result.push(resolved.timex); + } + } + return result; +}; + +const resolveDuration = function (candidate, constraints) { + const results = []; + for (const constraint of constraints) { + if (constraint.types.has('datetime')) { + results.push(new TimexProperty$3(timexHelpers.timexDateTimeAdd(constraint, candidate))); + } + else if (constraint.types.has('time')) { + results.push(new TimexProperty$3(timexHelpers.timexTimeAdd(constraint, candidate))); + } + } + return results; +}; + +const resolveDurations = function (candidates, constraints) { + const results = []; + for (const candidate of candidates) { + const timex = new TimexProperty$3(candidate); + if (timex.types.has('duration')) { + const r = resolveDuration(timex, constraints); + for (const resolved of r) { + results.push(resolved.timex); + } + } + else { + results.push(candidate); + } + } + return results; +}; + +const evaluate = function (candidates, constraints) { + const timexConstraints = constraints.map((x) => { return new TimexProperty$3(x); }); + const candidatesWithDurationsResolved = resolveDurations(candidates, timexConstraints); + const candidatesAccordingToDate = resolveByDateRangeConstraints(candidatesWithDurationsResolved, timexConstraints); + const candidatesWithAddedTime = resolveByTimeConstraints(candidatesAccordingToDate, timexConstraints); + const candidatesFilteredByTime = resolveByTimeRangeConstraints(candidatesWithAddedTime, timexConstraints); + const timexResults = candidatesFilteredByTime.map((x) => { return new TimexProperty$3(x); }); + return timexResults; +}; + +var timexRangeResolver = { + evaluate: evaluate +}; + +// Copyright (c) Microsoft Corporation. All rights reserved. + +var datatypesDateTime = { + Time: time.Time, + TimexProperty: timexProperty.TimexProperty, + TimexSet: timexSet.TimexSet, + creator: timexCreator, + resolver: timexRangeResolver +}; + +var datatypesDateTime_1 = datatypesDateTime.Time; +var datatypesDateTime_2 = datatypesDateTime.TimexProperty; +var datatypesDateTime_3 = datatypesDateTime.TimexSet; +var datatypesDateTime_4 = datatypesDateTime.creator; +var datatypesDateTime_5 = datatypesDateTime.resolver; + +export { datatypesDateTime_1 as Time, datatypesDateTime_2 as TimexProperty, datatypesDateTime_3 as TimexSet, datatypesDateTime_4 as creator, datatypesDateTime_5 as resolver }; +export default datatypesDateTime; +//# sourceMappingURL=recognizers-text-data-types-timex-expression.es5.js.map diff --git a/libraries/botbuilder-stdlib/vendors/@microsoft/recognizers-text-data-types-timex-expression/dist/recognizers-text-data-types-timex-expression.umd.js b/libraries/botbuilder-stdlib/vendors/@microsoft/recognizers-text-data-types-timex-expression/dist/recognizers-text-data-types-timex-expression.umd.js new file mode 100644 index 0000000000..5b45210280 --- /dev/null +++ b/libraries/botbuilder-stdlib/vendors/@microsoft/recognizers-text-data-types-timex-expression/dist/recognizers-text-data-types-timex-expression.umd.js @@ -0,0 +1,1577 @@ +(function (global, factory) { + typeof exports === 'object' && typeof module !== 'undefined' ? factory(exports) : + typeof define === 'function' && define.amd ? define(['exports'], factory) : + (factory((global.microsoftRecognizersTextDataTypesTimexExpression = {}))); +}(this, (function (exports) { 'use strict'; + +// Copyright (c) Microsoft Corporation. All rights reserved. + +class Time { + constructor(hour, minute, second) { + if (arguments.length === 1) { + this.hour = Math.floor(hour / 3600000); + this.minute = Math.floor((hour - (this.hour * 3600000)) / 60000); + this.second = (hour - (this.hour * 3600000) - (this.minute * 60000)) / 1000; + } + else { + this.hour = hour; + this.minute = minute; + this.second = second; + } + } + + getTime () { + return (this.second * 1000) + (this.minute * 60000) + (this.hour * 3600000); + } +} + +var Time_1 = Time; + +var time = { + Time: Time_1 +}; + +// Copyright (c) Microsoft Corporation. All rights reserved. + +const value = function (s) { return s; }; +const isTrue = function () { return true; }; +const zero = function () { return 0; }; + +const timexRegex = { + + date: [ + // date + { regex: /^(\d\d\d\d)-(\d\d)-(\d\d)$/, props: { year: Number, month: Number, dayOfMonth: Number } }, + { regex: /^XXXX-WXX-(\d)$/, props: { dayOfWeek: Number } }, + { regex: /^XXXX-(\d\d)-(\d\d)$/, props: { month: Number, dayOfMonth: Number } }, + // daterange + { regex: /^(\d\d\d\d)$/, props: { year: Number } }, + { regex: /^(\d\d\d\d)-(\d\d)$/, props: { year: Number, month: Number } }, + { regex: /^(SP|SU|FA|WI)$/, props: { season: value } }, + { regex: /^(\d\d\d\d)-(SP|SU|FA|WI)$/, props: { year: Number, season: value } }, + { regex: /^(\d\d\d\d)-W(\d\d)$/, props: { year: Number, weekOfYear: Number } }, + { regex: /^(\d\d\d\d)-W(\d\d)-WE$/, props: { year: Number, weekOfYear: Number, weekend: isTrue } }, + { regex: /^XXXX-(\d\d)$/, props: { month: Number } }, + { regex: /^XXXX-(\d\d)-W(\d\d)$/, props: { month: Number, weekOfMonth: Number } }, + { regex: /^XXXX-(\d\d)-WXX-(\d)-(\d)$/, props: { month: Number, weekOfMonth: Number, dayOfWeek: Number } } + ], + + time: [ + // time + { regex: /^T(\d\d)$/, props: { hour: Number, minute: zero, second: zero } }, + { regex: /^T(\d\d):(\d\d)$/, props: { hour: Number, minute: Number, second: zero } }, + { regex: /^T(\d\d):(\d\d):(\d\d)$/, props: { hour: Number, minute: Number, second: Number } }, + // timerange + { regex: /^T(DT|NI|MO|AF|EV)$/, props: { partOfDay: value } } + ], + + period: [ + { regex: /^P(\d*\.?\d+)(Y|M|W|D)$/, props: { amount: Number, dateUnit: value } }, + { regex: /^PT(\d*\.?\d+)(H|M|S)$/, props: { amount: Number, timeUnit: value } } + ] +}; + +const tryExtract = function (entry, timex, result) { + const regexResult = timex.match(entry.regex); + if (!regexResult) { + return false; + } + let index = 1; + for (const name in entry.props) { + const val = regexResult[index++]; + result[name] = entry.props[name](val); + } + return true; +}; + +const extract = function (name, timex, result) { + for (const entry of timexRegex[name]) { + if (tryExtract(entry, timex, result)) { + return true; + } + } + return false; +}; + +var extract_1 = extract; + +var timexregex = { + extract: extract_1 +}; + +// Copyright (c) Microsoft Corporation. All rights reserved. + + + +const parseString = function (timex, obj) { + // a reference to the present + if (timex === 'PRESENT_REF') { + obj.now = true; + } + // duration + else if (timex.startsWith('P')) { + extractDuration(timex, obj); + } + // range indicated with start and end dates and a duration + else if (timex.startsWith('(') && timex.endsWith(')')) { + extractStartEndRange(timex, obj); + } + // date and time and their respective ranges + else { + extractDateTime(timex, obj); + } +}; + +const extractDuration = function (s, obj) { + const extracted = {}; + timexregex.extract('period', s, extracted); + if (extracted.dateUnit) { + obj[{ Y: 'years', M: 'months', W: 'weeks', D: 'days' }[extracted.dateUnit]] = extracted.amount; + } + else if (extracted.timeUnit) { + obj[{ H: 'hours', M: 'minutes', S: 'seconds' }[extracted.timeUnit]] = extracted.amount; + } +}; + +const extractStartEndRange = function (s, obj) { + const parts = s.substring(1, s.length - 1).split(','); + if (parts.length === 3) { + extractDateTime(parts[0], obj); + extractDuration(parts[2], obj); + } +}; + +const extractDateTime = function (s, obj) { + const indexOfT = s.indexOf('T'); + if (indexOfT === -1) { + timexregex.extract('date', s, obj); + } + else { + timexregex.extract('date', s.substr(0, indexOfT), obj); + timexregex.extract('time', s.substr(indexOfT), obj); + } +}; + +const fromObject = function (source, obj) { + Object.assign(obj, source); + if ('hour' in obj) { + if (!('minute' in obj)) { + obj.minute = 0; + } + if (!('second' in obj)) { + obj.second = 0; + } + } +}; + +var timexParsing = { + parseString: parseString, + fromObject: fromObject +}; + +// Copyright (c) Microsoft Corporation. All rights reserved. + +const isPresent = function (obj) { + return obj.now === true; +}; + +const isDuration = function (obj) { + return 'years' in obj || 'months' in obj || 'weeks' in obj || 'days' in obj + || 'hours' in obj || 'minutes' in obj || 'seconds' in obj; +}; + +const isTime = function (obj) { + return 'hour' in obj && 'minute' in obj && 'second' in obj; +}; + +const isDate = function (obj) { + return ('month' in obj && 'dayOfMonth' in obj) || 'dayOfWeek' in obj; +}; + +const isTimeRange = function (obj) { + return 'partOfDay' in obj; +}; + +const isDateRange = function (obj) { + return ('year' in obj && !('dayOfMonth' in obj)) + || ('year' in obj && 'month' in obj && !('dayOfMonth' in obj)) + || ('month' in obj && !('dayOfMonth' in obj)) + || 'season' in obj + || 'weekOfYear' in obj + || 'weekOfMonth' in obj; +}; + +const isDefinite = function (obj) { + return 'year' in obj && 'month' in obj && 'dayOfMonth' in obj; +}; + +const infer = function (obj) { + const types = new Set(); + if (isPresent(obj)) { + types.add('present'); + } + if (isDefinite(obj)) { + types.add('definite'); + } + if (isDate(obj)) { + types.add('date'); + } + if (isDateRange(obj)) { + types.add('daterange'); + } + if (isDuration(obj)) { + types.add('duration'); + } + if (isTime(obj)) { + types.add('time'); + } + if (isTimeRange(obj)) { + types.add('timerange'); + } + if (types.has('present')) { + types.add('date'); + types.add('time'); + } + if (types.has('time') && types.has('duration')) { + types.add('timerange'); + } + if (types.has('date') && types.has('time')) { + types.add('datetime'); + } + if (types.has('date') && types.has('duration')) { + types.add('daterange'); + } + if (types.has('datetime') && types.has('duration')) { + types.add('datetimerange'); + } + if (types.has('date') && types.has('timerange')) { + types.add('datetimerange'); + } + return types; +}; + +var infer_1 = infer; + +var timexInference = { + infer: infer_1 +}; + +// Copyright (c) Microsoft Corporation. All rights reserved. + +const cloneDate = function (date) { + const result = new Date(); + result.setTime(date.getTime()); + return result; +}; + +const tomorrow = function (date) { + const result = cloneDate(date); + result.setDate(result.getDate() + 1); + return result; +}; + +const yesterday = function (date) { + const result = cloneDate(date); + result.setDate(result.getDate() - 1); + return result; +}; + +const datePartEquals = function (dateX, dateY) { + return (dateX.getFullYear() === dateY.getFullYear()) + && (dateX.getMonth() === dateY.getMonth()) + && (dateX.getDate() === dateY.getDate()); +}; + +const isDateInWeek = function (date, startOfWeek) { + let d = cloneDate(startOfWeek); + for (let i=0; i<7; i++) { + if (datePartEquals(date, d)) { + return true; + } + d = tomorrow(d); + } + return false; +}; + +const isThisWeek = function (date, referenceDate) { + const startOfThisWeek = cloneDate(referenceDate); + startOfThisWeek.setDate(startOfThisWeek.getDate() - startOfThisWeek.getDay()); + return isDateInWeek(date, startOfThisWeek); +}; + +const isNextWeek = function (date, referenceDate) { + const startOfNextWeek = cloneDate(referenceDate); + startOfNextWeek.setDate(startOfNextWeek.getDate() + (7 - startOfNextWeek.getDay())); + return isDateInWeek(date, startOfNextWeek); +}; + +const isLastWeek = function (date, referenceDate) { + const startOfLastWeek = cloneDate(referenceDate); + startOfLastWeek.setDate(startOfLastWeek.getDate() - (7 + startOfLastWeek.getDay())); + return isDateInWeek(date, startOfLastWeek); +}; + +const weekOfYear = function (date) { + const ds = new Date(date.getFullYear(), 0); + const de = new Date(date.getFullYear(), date.getMonth(), date.getDate()); + let weeks = 1; + while (ds.getTime() < de.getTime()) { + const jsDayOfWeek = ds.getDay(); + const isoDayOfWeek = jsDayOfWeek == 0 ? 7 : jsDayOfWeek; + if (isoDayOfWeek === 7) { + weeks++; + } + ds.setDate(ds.getDate() + 1); + } + return weeks; +}; + +const fixedFormatNumber$1 = function (n, size) { + const s = n.toString(); + let zeros = ''; + const np = size - s.length; + for (let i=0; i 23) { + const days = Math.floor(result.hour / 24); + const hour = result.hour % 24; + result.hour = hour; + if ('year' in result && 'month' in result && 'dayOfMonth' in result) { + const d = new Date(result.year, result.month - 1, result.dayOfMonth, 0, 0, 0); + for (let i=0; i 59) { + result.hour++; + result.minute = 0; + } + return result; + } + return start; +}; + +const timexDateTimeAdd$1 = function (start, duration) { + return timexTimeAdd$1(timexDateAdd$1(start, duration), duration); +}; + +const expandDateTimeRange = function (timex) { + const types = ('types' in timex) ? timex.types : timexInference.infer(timex); + if (types.has('duration')) { + const start = cloneDateTime(timex); + const duration = cloneDuration(timex); + return { start: start, end: timexDateTimeAdd$1(start, duration), duration: duration }; + } + else { + if ('year' in timex) { + const range = { start: { year: timex.year }, end: {} }; + if ('month' in timex) { + range.start.month = timex.month; + range.start.dayOfMonth = 1; + range.end.year = timex.year; + range.end.month = timex.month + 1; + range.end.dayOfMonth = 1; + } + else { + range.start.month = 1; + range.start.dayOfMonth = 1; + range.end.year = timex.year + 1; + range.end.month = 1; + range.end.dayOfMonth = 1; + } + return range; + } + } + return { start: {}, end: {} }; +}; + +const timeAdd = function (start, duration) { + const hours = duration.hours || 0; + const minutes = duration.minutes || 0; + const seconds = duration.seconds || 0; + return { hour: start.hour + hours, minute: start.minute + minutes, second: start.second + seconds }; +}; + +const expandTimeRange = function (timex) { + + if (!timex.types.has('timerange')) + { + throw new exception('argument must be a timerange'); + } + + if (timex.partOfDay !== undefined) { + switch (timex.partOfDay) { + case 'DT': + timex = { hour: 8, minute: 0, second: 0, hours: 10, minutes: 0, seconds: 0 }; + break; + case 'MO': + timex = { hour: 8, minute: 0, second: 0, hours: 4, minutes: 0, seconds: 0 }; + break; + case 'AF': + timex = { hour: 12, minute: 0, second: 0, hours: 4, minutes: 0, seconds: 0 }; + break; + case 'EV': + timex = { hour: 16, minute: 0, second: 0, hours: 4, minutes: 0, seconds: 0 }; + break; + case 'NI': + timex = { hour: 20, minute: 0, second: 0, hours: 4, minutes: 0, seconds: 0 }; + break; + default: + throw new exception('unrecognized part of day timerange'); + } + } + + const start = { hour: timex.hour, minute: timex.minute, second: timex.second }; + const duration = cloneDuration(timex); + return { start: start, end: timeAdd(start, duration), duration: duration }; +}; + +const dateFromTimex = function (timex) { + const year = 'year' in timex ? timex.year : 2001; + const month = 'month' in timex ? timex.month - 1 : 0; + const date = 'dayOfMonth' in timex ? timex.dayOfMonth : 1; + const hour = 'hour' in timex ? timex.hour : 0; + const minute = 'minute' in timex ? timex.minute : 0; + const second = 'second' in timex ? timex.second : 0; + return new Date(year, month, date, hour, minute, second); +}; + +const timeFromTimex = function (timex) { + const hour = timex.hour || 0; + const minute = timex.minute || 0; + const second = timex.second || 0; + return new Time$1(hour, minute, second); +}; + +const dateRangeFromTimex = function (timex) { + const expanded = expandDateTimeRange(timex); + return { start: dateFromTimex(expanded.start), end: dateFromTimex(expanded.end) }; +}; + +const timeRangeFromTimex = function (timex) { + const expanded = expandTimeRange(timex); + return { start: timeFromTimex(expanded.start), end: timeFromTimex(expanded.end) }; +}; + +var timexHelpers = { + expandDateTimeRange: expandDateTimeRange, + expandTimeRange: expandTimeRange, + dateFromTimex: dateFromTimex, + timeFromTimex: timeFromTimex, + dateRangeFromTimex: dateRangeFromTimex, + timeRangeFromTimex: timeRangeFromTimex, + timexTimeAdd: timexTimeAdd$1, + timexDateTimeAdd: timexDateTimeAdd$1 +}; + +// Copyright (c) Microsoft Corporation. All rights reserved. + + +const fixedFormatNumber = timexDateHelpers.fixedFormatNumber; + + +const formatDuration = function (timex) { + if ('years' in timex) { + return `P${timex.years}Y`; + } + if ('months' in timex) { + return `P${timex.months}M`; + } + if ('weeks' in timex) { + return `P${timex.weeks}W`; + } + if ('days' in timex) { + return `P${timex.days}D`; + } + if ('hours' in timex) { + return `PT${timex.hours}H`; + } + if ('minutes' in timex) { + return `PT${timex.minutes}M`; + } + if ('seconds' in timex) { + return `PT${timex.seconds}S`; + } + return ''; +}; + +const formatTime = function (timex) { + if (timex.minute === 0 && timex.second === 0) { + return `T${fixedFormatNumber(timex.hour, 2)}`; + } + if (timex.second === 0) { + return `T${fixedFormatNumber(timex.hour, 2)}:${fixedFormatNumber(timex.minute, 2)}`; + } + return `T${fixedFormatNumber(timex.hour, 2)}:${fixedFormatNumber(timex.minute, 2)}:${fixedFormatNumber(timex.second, 2)}`; +}; + +const formatDate = function (timex) { + if ('year' in timex && 'month' in timex && 'dayOfMonth' in timex) { + return `${fixedFormatNumber(timex.year, 4)}-${fixedFormatNumber(timex.month, 2)}-${fixedFormatNumber(timex.dayOfMonth, 2)}`; + } + if ('month' in timex && 'dayOfMonth' in timex) { + return `XXXX-${fixedFormatNumber(timex.month, 2)}-${fixedFormatNumber(timex.dayOfMonth, 2)}`; + } + if ('dayOfWeek' in timex) { + return `XXXX-WXX-${timex.dayOfWeek}`; + } + return ''; +}; + +const formatDateRange = function (timex) { + if ('year' in timex && 'weekOfYear' in timex && 'weekend' in timex) { + return `${fixedFormatNumber(timex.year, 4)}-W${fixedFormatNumber(timex.weekOfYear, 2)}-WE`; + } + if ('year' in timex && 'weekOfYear' in timex) { + return `${fixedFormatNumber(timex.year, 4)}-W${fixedFormatNumber(timex.weekOfYear, 2)}`; + } + if ('year' in timex && 'season' in timex) { + return `${fixedFormatNumber(timex.year, 4)}-${timex.season}`; + } + if ('season' in timex) { + return `${timex.season}`; + } + if ('year' in timex && 'month' in timex) { + return `${fixedFormatNumber(timex.year, 4)}-${fixedFormatNumber(timex.month, 2)}`; + } + if ('year' in timex) { + return `${fixedFormatNumber(timex.year, 4)}`; + } + if ('month' in timex && 'weekOfMonth' in timex && 'dayOfWeek' in timex) { + return `XXXX-${fixedFormatNumber(timex.month, 2)}-WXX-${timex.weekOfMonth}-${timex.dayOfWeek}`; + } + if ('month' in timex && 'weekOfMonth' in timex) { + return `XXXX-${fixedFormatNumber(timex.month, 2)}-WXX-${timex.weekOfMonth}`; + } + if ('month' in timex) { + return `XXXX-${fixedFormatNumber(timex.month, 2)}`; + } + return ''; +}; + +const formatTimeRange = function (timex) { + if ('partOfDay' in timex) { + return `T${timex.partOfDay}`; + } + return ''; +}; + +const format = function(timex) { + + const types = ('types' in timex) ? timex.types : timexInference.infer(timex); + + if (types.has('present')) { + return 'PRESENT_REF'; + } + if ((types.has('datetimerange') || types.has('daterange') || types.has('timerange')) && types.has('duration')) { + const range = timexHelpers.expandDateTimeRange(timex); + return `(${format(range.start)},${format(range.end)},${format(range.duration)})`; + } + if (types.has('datetimerange')) { + return `${formatDate(timex)}${formatTimeRange(timex)}`; + } + if (types.has('daterange')) { + return `${formatDateRange(timex)}`; + } + if (types.has('timerange')) { + return `${formatTimeRange(timex)}`; + } + if (types.has('datetime')) { + return `${formatDate(timex)}${formatTime(timex)}`; + } + if (types.has('duration')) { + return `${formatDuration(timex)}`; + } + if (types.has('date')) { + return `${formatDate(timex)}`; + } + if (types.has('time')) { + return `${formatTime(timex)}`; + } + return ''; +}; + +var format_1 = format; + +var timexFormat = { + format: format_1 +}; + +// Copyright (c) Microsoft Corporation. All rights reserved. + +var days = [ + 'Monday', + 'Tuesday', + 'Wednesday', + 'Thursday', + 'Friday', + 'Saturday', + 'Sunday' +]; + +var months = [ + 'January', + 'Februrary', + 'March', + 'April', + 'May', + 'June', + 'July', + 'August', + 'September', + 'October', + 'November', + 'December' +]; + +var dateAbbreviation = { 0: 'th', 1: 'st', 2: 'nd', 3: 'rd', 4: 'th', 5: 'th', 6: 'th', 7: 'th', 8: 'th', 9: 'th' }; + +var hours = [ + 'midnight', '1AM', '2AM', '3AM', '4AM', '5AM', '6AM', '7AM', '8AM', '9AM', '10AM', '11AM', + 'midday', '1PM', '2PM', '3PM', '4PM', '5PM', '6PM', '7PM', '8PM', '9PM', '10PM', '11PM' +]; + +var seasons = { SP: 'spring', SU: 'summer', FA: 'fall', WI: 'winter' }; + +var weeks = [ 'first', 'second', 'third', 'forth' ]; + +var dayParts = { DT: 'daytime', NI: 'night', MO: 'morning', AF: 'afternoon', EV: 'evening' }; + +var timexConstants = { + days: days, + months: months, + dateAbbreviation: dateAbbreviation, + hours: hours, + seasons: seasons, + weeks: weeks, + dayParts: dayParts +}; + +// Copyright (c) Microsoft Corporation. All rights reserved. + + + + +const convertDate = function(timex) { + if ('dayOfWeek' in timex) { + return timexConstants.days[timex.dayOfWeek - 1]; + } + const month = timexConstants.months[timex.month - 1]; + const date = timex.dayOfMonth.toString(); + const abbreviation = timexConstants.dateAbbreviation[date.slice(-1)]; + if ('year' in timex) { + return `${date}${abbreviation} ${month} ${timex.year}`.trim(); + } + return `${date}${abbreviation} ${month}`; +}; + +const convertTime = function(timex) { + if (timex.hour === 0 && timex.minute === 0 && timex.second === 0) { + return 'midnight'; + } + if (timex.hour === 12 && timex.minute === 0 && timex.second === 0) { + return 'midday'; + } + const pad = function (s) { return (s.length === 1) ? '0' + s : s; }; + const hour = (timex.hour === 0) ? '12' : (timex.hour > 12) ? (timex.hour - 12).toString() : timex.hour.toString(); + const minute = (timex.minute === 0 && timex.second === 0) ? '' : ':' + pad(timex.minute.toString()); + const second = (timex.second === 0) ? '' : ':' + pad(timex.second.toString()); + const period = timex.hour < 12 ? 'AM' : 'PM'; + return `${hour}${minute}${second}${period}`; +}; + +const convertDurationPropertyToString = function (timex, property, includeSingleCount) { + const propertyName = property + 's'; + const value = timex[propertyName]; + if (value !== undefined) { + if (value === 1) { + return includeSingleCount ? '1 ' + property : property; + } + else { + return `${value} ${property}s`; + } + } + return false; +}; + +const convertTimexDurationToString = function (timex, includeSingleCount) { + return convertDurationPropertyToString(timex, 'year', includeSingleCount) + || convertDurationPropertyToString(timex, 'month', includeSingleCount) + || convertDurationPropertyToString(timex, 'week', includeSingleCount) + || convertDurationPropertyToString(timex, 'day', includeSingleCount) + || convertDurationPropertyToString(timex, 'hour', includeSingleCount) + || convertDurationPropertyToString(timex, 'minute', includeSingleCount) + || convertDurationPropertyToString(timex, 'second', includeSingleCount); +}; + +const convertDuration = function(timex) { + return convertTimexDurationToString(timex, true); +}; + +const convertDateRange = function(timex) { + const season = ('season' in timex) ? timexConstants.seasons[timex.season] : ''; + const year = ('year' in timex) ? timex.year.toString() : ''; + if ('weekOfYear' in timex) { + if (timex.weekend) { + return ''; + } + else { + return ''; + } + } + if ('month' in timex) { + const month = `${timexConstants.months[timex.month - 1]}`; + if ('weekOfMonth' in timex) { + return `${timexConstants.weeks[timex.weekOfMonth - 1]} week of ${month}`; + } + else { + return `${month} ${year}`.trim(); + } + } + return `${season} ${year}`.trim(); +}; + +const convertTimeRange = function(timex) { + return timexConstants.dayParts[timex.partOfDay]; +}; + +const convertDateTime = function(timex) { + return `${convertTime(timex)} ${convertDate(timex)}`; +}; + +const convertDateTimeRange = function(timex) { + if (timex.types.has('timerange')) { + return `${convertDate(timex)} ${convertTimeRange(timex)}`; + } + // date + time + duration + // - OR - + // date + duration + return ''; +}; + +const convertTimexToString = function (timex) { + + const types = ('types' in timex) ? timex.types : timexInference.infer(timex); + + if (types.has('present')) { + return 'now'; + } + if (types.has('datetimerange')) { + return convertDateTimeRange(timex); + } + if (types.has('daterange')) { + return convertDateRange(timex); + } + if (types.has('duration')) { + return convertDuration(timex); + } + if (types.has('timerange')) { + return convertTimeRange(timex); + } + + // TODO: where appropriate delegate most the formatting delegate to Date.toLocaleString(options) + if (types.has('datetime')) { + return convertDateTime(timex); + } + if (types.has('date')) { + return convertDate(timex); + } + if (types.has('time')) { + return convertTime(timex); + } + return ''; +}; + +const convertTimexSetToString = function(timexSet) { + + const timex = timexSet.timex; + if (timex.types.has('duration')) { + return `every ${convertTimexDurationToString(timex, false)}`; + } + else { + return `every ${convertTimexToString(timex)}`; + } +}; + +var timexConvert$2 = { + convertDate: convertDate, + convertTime: convertTime, + convertTimexToString: convertTimexToString, + convertTimexSetToString: convertTimexSetToString +}; + +// Copyright (c) Microsoft Corporation. All rights reserved. + + + +var timexConvert = { + convertTimexToString: timexConvert$2.convertTimexToString, + convertTimexSetToString: timexConvert$2.convertTimexSetToString +}; + +// Copyright (c) Microsoft Corporation. All rights reserved. + + + + + + +const getDateDay = function (day) { + const index = (day === 0) ? 6 : day - 1; + return timexConstants.days[index]; +}; + +const convertDate$1 = function(timex, date) { + if ('year' in timex && 'month' in timex && 'dayOfMonth' in timex) { + const timexDate = new Date(timex.year, timex.month - 1, timex.dayOfMonth); + + if (timexDateHelpers.datePartEquals(timexDate, date)) { + return 'today'; + } + const tomorrow = timexDateHelpers.tomorrow(date); + if (timexDateHelpers.datePartEquals(timexDate, tomorrow)) { + return 'tomorrow'; + } + const yesterday = timexDateHelpers.yesterday(date); + if (timexDateHelpers.datePartEquals(timexDate, yesterday)) { + return 'yesterday'; + } + if (timexDateHelpers.isThisWeek(timexDate, date)) { + return `this ${getDateDay(timexDate.getDay())}`; + } + if (timexDateHelpers.isNextWeek(timexDate, date)) { + return `next ${getDateDay(timexDate.getDay())}`; + } + if (timexDateHelpers.isLastWeek(timexDate, date)) { + return `last ${getDateDay(timexDate.getDay())}`; + } + } + return timexConvert$2.convertDate(timex); +}; + +const convertDateTime$1 = function (timex, date) { + return `${convertDate$1(timex, date)} ${timexConvert$2.convertTime(timex)}`; +}; + +const convertDateRange$1 = function(timex, date) { + if ('year' in timex) { + const year = date.getFullYear(); + if (timex.year === year) { + if ('weekOfYear' in timex) { + const thisWeek = timexDateHelpers.weekOfYear(date); + if (thisWeek === timex.weekOfYear) { + return timex.weekend ? 'this weekend' : 'this week'; + } + if (thisWeek === timex.weekOfYear + 1) { + return timex.weekend ? 'last weekend' : 'last week'; + } + if (thisWeek === timex.weekOfYear - 1) { + return timex.weekend ? 'next weekend' : 'next week'; + } + } + if ('month' in timex) { + const isoMonth = date.getMonth() + 1; + if (timex.month === isoMonth) { + return 'this month'; + } + if (timex.month === isoMonth + 1) { + return 'next month'; + } + if (timex.month === isoMonth - 1) { + return 'last month'; + } + } + return ('season' in timex) ? `this ${timexConstants.seasons[timex.season]}` : 'this year'; + } + if (timex.year === year + 1) { + return ('season' in timex) ? `next ${timexConstants.seasons[timex.season]}` : 'next year'; + } + if (timex.year === year - 1) { + return ('season' in timex) ? `last ${timexConstants.seasons[timex.season]}` : 'last year'; + } + } + return ''; +}; + +const convertDateTimeRange$1 = function(timex, date) { + if ('year' in timex && 'month' in timex && 'dayOfMonth' in timex) { + const timexDate = new Date(timex.year, timex.month - 1, timex.dayOfMonth); + + if ('partOfDay' in timex) { + if (timexDateHelpers.datePartEquals(timexDate, date)) { + if (timex.partOfDay === 'NI') { + return 'tonight'; + } + else { + return `this ${timexConstants.dayParts[timex.partOfDay]}`; + } + } + const tomorrow = timexDateHelpers.tomorrow(date); + if (timexDateHelpers.datePartEquals(timexDate, tomorrow)) { + return `tomorrow ${timexConstants.dayParts[timex.partOfDay]}`; + } + const yesterday = timexDateHelpers.yesterday(date); + if (timexDateHelpers.datePartEquals(timexDate, yesterday)) { + return `yesterday ${timexConstants.dayParts[timex.partOfDay]}`; + } + + if (timexDateHelpers.isNextWeek(timexDate, date)) { + return `next ${getDateDay(timexDate.getDay())} ${timexConstants.dayParts[timex.partOfDay]}`; + } + + if (timexDateHelpers.isLastWeek(timexDate, date)) { + return `last ${getDateDay(timexDate.getDay())} ${timexConstants.dayParts[timex.partOfDay]}`; + } + } + } + return ''; +}; + +const convertTimexToStringRelative$1 = function (timex, date) { + + const types = ('types' in timex) ? timex.types : timexInference.infer(timex); + + if (types.has('datetimerange')) { + return convertDateTimeRange$1(timex, date); + } + if (types.has('daterange')) { + return convertDateRange$1(timex, date); + } + if (types.has('datetime')) { + return convertDateTime$1(timex, date); + } + if (types.has('date')) { + return convertDate$1(timex, date); + } + + return timexConvert$2.convertTimexToString(timex); +}; + +var convertTimexToStringRelative_1 = convertTimexToStringRelative$1; + +var timexRelativeConvert$2 = { + convertTimexToStringRelative: convertTimexToStringRelative_1 +}; + +// Copyright (c) Microsoft Corporation. All rights reserved. + +var convertTimexToStringRelative = timexRelativeConvert$2.convertTimexToStringRelative; + +var timexRelativeConvert = { + convertTimexToStringRelative: convertTimexToStringRelative +}; + +// Copyright (c) Microsoft Corporation. All rights reserved. + + + + + + + +class TimexProperty { + constructor (timex) { + if (typeof timex === 'string') { + timexParsing.parseString(timex, this); + } + else { + timexParsing.fromObject(timex, this); + } + // TODO: constructing a Timex from a Timex should be very cheap + } + + get timex() { + return timexFormat.format(this); + } + + get types () { + return timexInference.infer(this); + } + + toString () { + return timexConvert.convertTimexToString(this); + } + + // TODO: consider [locales[, options]] similar to Date.toLocaleString([locales[, options]]) + toNaturalLanguage (referenceDate) { + return timexRelativeConvert.convertTimexToStringRelative(this, referenceDate); + } + + static fromDate (date) { + return new TimexProperty({ + year: date.getFullYear(), + month: date.getMonth() + 1, + dayOfMonth: date.getDate() + }); + } + + static fromDateTime (date) { + return new TimexProperty({ + year: date.getFullYear(), + month: date.getMonth() + 1, + dayOfMonth: date.getDate(), + hour: date.getHours(), + minute: date.getMinutes(), + second: date.getSeconds() + }); + } + + static fromTime (time) { + return new TimexProperty(time); + } +} + +var TimexProperty_1 = TimexProperty; + +var timexProperty = { + TimexProperty: TimexProperty_1 +}; + +// Copyright (c) Microsoft Corporation. All rights reserved. + +const TimexProperty$1 = timexProperty.TimexProperty; + +class TimexSet { + constructor (timex) { + this.timex = new TimexProperty$1(timex); + } +} + +var TimexSet_1 = TimexSet; + +var timexSet = { + TimexSet: TimexSet_1 +}; + +// Copyright (c) Microsoft Corporation. All rights reserved. + + + +const TimexProperty$2 = timexProperty.TimexProperty; + +const today = function (date) { + return TimexProperty$2.fromDate(date || new Date()).timex; +}; + +const tomorrow$1 = function (date) { + const d = (date === undefined) ? new Date() : new Date(date.getTime()); + d.setDate(d.getDate() + 1); + return TimexProperty$2.fromDate(d).timex; +}; + +const yesterday$1 = function (date) { + const d = (date === undefined) ? new Date() : new Date(date.getTime()); + d.setDate(d.getDate() - 1); + return TimexProperty$2.fromDate(d).timex; +}; + +const weekFromToday = function (date) { + const d = (date === undefined) ? new Date() : new Date(date.getTime()); + return (new TimexProperty$2(Object.assign(TimexProperty$2.fromDate(d), { days: 7 }))).timex; +}; + +const weekBackFromToday = function (date) { + const d = (date === undefined) ? new Date() : new Date(date.getTime()); + d.setDate(d.getDate() - 7); + return (new TimexProperty$2(Object.assign(TimexProperty$2.fromDate(d), { days: 7 }))).timex; +}; + +const thisWeek = function (date) { + const d = (date === undefined) ? new Date() : new Date(date.getTime()); + d.setDate(d.getDate() - 7); + const start = timexDateHelpers.dateOfNextDay(1, d); + return (new TimexProperty$2(Object.assign(TimexProperty$2.fromDate(start), { days: 7 }))).timex; +}; + +const nextWeek = function (date) { + const d = (date === undefined) ? new Date() : new Date(date.getTime()); + const start = timexDateHelpers.dateOfNextDay(1, d); + return (new TimexProperty$2(Object.assign(TimexProperty$2.fromDate(start), { days: 7 }))).timex; +}; + +const lastWeek = function (date) { + const d = (date === undefined) ? new Date() : new Date(date.getTime()); + const start = timexDateHelpers.dateOfLastDay(1, d); + start.setDate(start.getDate() - 7); + return (new TimexProperty$2(Object.assign(TimexProperty$2.fromDate(start), { days: 7 }))).timex; +}; + +const nextWeeksFromToday = function (n, date) { + const d = (date === undefined) ? new Date() : new Date(date.getTime()); + return (new TimexProperty$2(Object.assign(TimexProperty$2.fromDate(d), { days: 7 * n }))).timex; +}; + +// The following constants are consistent with the Recognizer results +const monday = 'XXXX-WXX-1'; +const tuesday = 'XXXX-WXX-2'; +const wednesday = 'XXXX-WXX-3'; +const thursday = 'XXXX-WXX-4'; +const friday = 'XXXX-WXX-5'; +const saturday = 'XXXX-WXX-6'; +const sunday = 'XXXX-WXX-7'; +const morning = '(T08,T12,PT4H)'; +const afternoon = '(T12,T16,PT4H)'; +const evening = '(T16,T20,PT4H)'; +const daytime = '(T08,T18,PT10H)'; + +var timexCreator = { + today: today, + tomorrow: tomorrow$1, + yesterday: yesterday$1, + weekFromToday: weekFromToday, + weekBackFromToday: weekBackFromToday, + thisWeek: thisWeek, + nextWeek: nextWeek, + lastWeek: lastWeek, + nextWeeksFromToday: nextWeeksFromToday, + monday: monday, + tuesday: tuesday, + wednesday: wednesday, + thursday: thursday, + friday: friday, + saturday: saturday, + sunday: sunday, + morning: morning, + afternoon: afternoon, + evening: evening, + daytime: daytime +}; + +// Copyright (c) Microsoft Corporation. All rights reserved. + +const isOverlapping = function (r1, r2) { + return r1.end.getTime() > r2.start.getTime() && r1.start.getTime() <= r2.start.getTime() + || r1.start.getTime() < r2.end.getTime() && r1.start.getTime() >= r2.start.getTime(); +}; + +const collapseOverlapping = function (r1, r2, T) { + return { + start: new T(Math.max(r1.start.getTime(), r2.start.getTime())), + end: new T(Math.min(r1.end.getTime(), r2.end.getTime())) + }; +}; + +const innerCollapse = function (ranges, T) { + if (ranges.length === 1) { + return false; + } + for (let i=0; i a.start.getTime() - b.start.getTime()); + return r; +}; + +var timexConstraintsHelper = { + collapse: collapse, + isOverlapping: isOverlapping +}; + +// Copyright (c) Microsoft Corporation. All rights reserved. + + + + +const Time$2 = time.Time; +const TimexProperty$3 = timexProperty.TimexProperty; + +const resolveDefiniteAgainstConstraint = function (timex, constraint) { + const timexDate = timexHelpers.dateFromTimex(timex); + if (timexDate.getTime() >= constraint.start.getTime() && timexDate.getTime() < constraint.end.getTime()) { + return [ timex.timex ]; + } + return []; +}; + +const resolveDateAgainstConstraint = function (timex, constraint) { + if ('month' in timex && 'dayOfMonth' in timex) { + const result = []; + for (let year = constraint.start.getFullYear(); year <= constraint.end.getFullYear(); year++) { + const r = resolveDefiniteAgainstConstraint(new TimexProperty$3(Object.assign({}, timex, { year: year })), constraint); + if (r.length > 0) { + result.push(r[0]); + } + } + return result; + } + if ('dayOfWeek' in timex) { + const day = timex.dayOfWeek === 7 ? 0 : timex.dayOfWeek; + const dates = timexDateHelpers.datesMatchingDay(day, constraint.start, constraint.end); + const result = []; + for (const d of dates) { + const t = Object.assign({}, timex); + delete t.dayOfWeek; + const r = new TimexProperty$3(Object.assign({}, t, { year: d.getFullYear(), month: d.getMonth() + 1, dayOfMonth: d.getDate() })); + result.push(r.timex); + } + return result; + } + return []; +}; + +const resolveDate = function (timex, constraints) { + const result = []; + for (const constraint of constraints) { + Array.prototype.push.apply(result, resolveDateAgainstConstraint(timex, constraint)); + } + return result; +}; + +const resolveTimeAgainstConstraint = function (timex, constraint) { + const t = new Time$2(timex.hour, timex.minute, timex.second); + if (t.getTime() >= constraint.start.getTime() && t.getTime() < constraint.end.getTime()) { + return [ timex.timex ]; + } + return []; +}; + +const resolveTime = function (timex, constraints) { + const result = []; + for (const constraint of constraints) { + Array.prototype.push.apply(result, resolveTimeAgainstConstraint(timex, constraint)); + } + return result; +}; + +const removeDuplicates = function (array) { + var seen = new Set(); + return array.filter(item => { return seen.has(item) ? false : seen.add(item); }); +}; + +const resolveByDateRangeConstraints = function (candidates, timexConstraints) { + + const dateRangeConstraints = timexConstraints + .filter((timex) => { + return timex.types.has('daterange'); }) + .map((timex) => { + return timexHelpers.dateRangeFromTimex(timex); + }); + const collapsedDateRanges = timexConstraintsHelper.collapse(dateRangeConstraints, Date); + + if (collapsedDateRanges.length === 0) { + return candidates; + } + + const resolution = []; + for (const timex of candidates) { + const r = resolveDate(new TimexProperty$3(timex), collapsedDateRanges); + Array.prototype.push.apply(resolution, r); + } + + return removeDuplicates(resolution); +}; + +const resolveByTimeConstraints = function (candidates, timexConstraints) { + + const times = timexConstraints + .filter((timex) => { + return timex.types.has('time'); }) + .map((timex) => { + return timexHelpers.timeFromTimex(timex); + }); + + if (times.length === 0) { + return candidates; + } + + const resolution = []; + for (const timex of candidates.map(t => new TimexProperty$3(t))) { + if (timex.types.has('date') && !timex.types.has('time')) { + for (const time$$2 of times) { + timex.hour = time$$2.hour; + timex.minute = time$$2.minute; + timex.second = time$$2.second; + resolution.push(timex.timex); + } + } + else { + resolution.push(timex.timex); + } + } + return removeDuplicates(resolution); +}; + +const resolveByTimeRangeConstraints = function (candidates, timexConstraints) { + + const timeRangeConstraints = timexConstraints + .filter((timex) => { + return timex.types.has('timerange'); }) + .map((timex) => { + return timexHelpers.timeRangeFromTimex(timex); + }); + const collapsedTimeRanges = timexConstraintsHelper.collapse(timeRangeConstraints, Time$2); + + if (collapsedTimeRanges.length === 0) { + return candidates; + } + + const resolution = []; + for (const timex of candidates) { + const t = new TimexProperty$3(timex); + if (t.types.has('timerange')) { + const r = resolveTimeRange(t, collapsedTimeRanges); + Array.prototype.push.apply(resolution, r); + } + else if (t.types.has('time')) { + const r = resolveTime(t, collapsedTimeRanges); + Array.prototype.push.apply(resolution, r); + } + } + + return removeDuplicates(resolution); +}; + +const resolveTimeRange = function (timex, constraints) { + + const candidate = timexHelpers.timeRangeFromTimex(timex); + + const result = []; + for (const constraint of constraints) { + + if (timexConstraintsHelper.isOverlapping(candidate, constraint)) { + + const start = Math.max(candidate.start.getTime(), constraint.start.getTime()); + const time$$2 = new Time$2(start); + + // TODO: refer to comments in C# - consider first classing this clone/overwrite behavior + const resolved = new TimexProperty$3(timex.timex); + delete resolved.partOfDay; + delete resolved.seconds; + delete resolved.minutes; + delete resolved.hours; + resolved.second = time$$2.second; + resolved.minute = time$$2.minute; + resolved.hour = time$$2.hour; + + result.push(resolved.timex); + } + } + return result; +}; + +const resolveDuration = function (candidate, constraints) { + const results = []; + for (const constraint of constraints) { + if (constraint.types.has('datetime')) { + results.push(new TimexProperty$3(timexHelpers.timexDateTimeAdd(constraint, candidate))); + } + else if (constraint.types.has('time')) { + results.push(new TimexProperty$3(timexHelpers.timexTimeAdd(constraint, candidate))); + } + } + return results; +}; + +const resolveDurations = function (candidates, constraints) { + const results = []; + for (const candidate of candidates) { + const timex = new TimexProperty$3(candidate); + if (timex.types.has('duration')) { + const r = resolveDuration(timex, constraints); + for (const resolved of r) { + results.push(resolved.timex); + } + } + else { + results.push(candidate); + } + } + return results; +}; + +const evaluate = function (candidates, constraints) { + const timexConstraints = constraints.map((x) => { return new TimexProperty$3(x); }); + const candidatesWithDurationsResolved = resolveDurations(candidates, timexConstraints); + const candidatesAccordingToDate = resolveByDateRangeConstraints(candidatesWithDurationsResolved, timexConstraints); + const candidatesWithAddedTime = resolveByTimeConstraints(candidatesAccordingToDate, timexConstraints); + const candidatesFilteredByTime = resolveByTimeRangeConstraints(candidatesWithAddedTime, timexConstraints); + const timexResults = candidatesFilteredByTime.map((x) => { return new TimexProperty$3(x); }); + return timexResults; +}; + +var timexRangeResolver = { + evaluate: evaluate +}; + +// Copyright (c) Microsoft Corporation. All rights reserved. + +var datatypesDateTime = { + Time: time.Time, + TimexProperty: timexProperty.TimexProperty, + TimexSet: timexSet.TimexSet, + creator: timexCreator, + resolver: timexRangeResolver +}; + +var datatypesDateTime_1 = datatypesDateTime.Time; +var datatypesDateTime_2 = datatypesDateTime.TimexProperty; +var datatypesDateTime_3 = datatypesDateTime.TimexSet; +var datatypesDateTime_4 = datatypesDateTime.creator; +var datatypesDateTime_5 = datatypesDateTime.resolver; + +exports['default'] = datatypesDateTime; +exports.Time = datatypesDateTime_1; +exports.TimexProperty = datatypesDateTime_2; +exports.TimexSet = datatypesDateTime_3; +exports.creator = datatypesDateTime_4; +exports.resolver = datatypesDateTime_5; + +Object.defineProperty(exports, '__esModule', { value: true }); + +}))); +//# sourceMappingURL=recognizers-text-data-types-timex-expression.umd.js.map diff --git a/libraries/botbuilder-stdlib/vendors/@microsoft/recognizers-text-data-types-timex-expression/package.json b/libraries/botbuilder-stdlib/vendors/@microsoft/recognizers-text-data-types-timex-expression/package.json new file mode 100644 index 0000000000..60b26c4718 --- /dev/null +++ b/libraries/botbuilder-stdlib/vendors/@microsoft/recognizers-text-data-types-timex-expression/package.json @@ -0,0 +1,26 @@ +{ + "internal": true, + "name": "@microsoft/recognizers-text-data-types-timex-expression", + "version": "1.3.1", + "description": "Support for TIMEX representation of data time", + "author": "Microsoft", + "license": "MIT", + "keywords": [ + "bot", + "timex", + "luis" + ], + "main": "dist/recognizers-text-data-types-timex-expression.umd.js", + "module": "dist/recognizers-text-data-types-timex-expression.es5.js", + "browser": "dist/recognizers-text-data-types-timex-expression.browser.js", + "bugs": { + "url": "https://github.com/Microsoft/botbuilder-js/issues" + }, + "repository": { + "type": "git", + "url": "https://github.com/Microsoft/botbuilder-js.git" + }, + "engines": { + "node": ">=6.0.0" + } +} \ No newline at end of file diff --git a/libraries/botbuilder-stdlib/vendors/@microsoft/recognizers-text-date-time/README.md b/libraries/botbuilder-stdlib/vendors/@microsoft/recognizers-text-date-time/README.md new file mode 100644 index 0000000000..05e1121106 --- /dev/null +++ b/libraries/botbuilder-stdlib/vendors/@microsoft/recognizers-text-date-time/README.md @@ -0,0 +1,5 @@ +# Microsoft.Recognizers.Text for JavaScript + +This module (`recognizers-text-date-time`) is a sub-module of `recognizers-text-suite`. + +Please check the [main README](https://github.com/Microsoft/Recognizers-Text/tree/master/JavaScript/packages/recognizers-text-suite) for more details. \ No newline at end of file diff --git a/libraries/botbuilder-stdlib/vendors/@microsoft/recognizers-text-date-time/dist/recognizers-text-date-time.browser.js b/libraries/botbuilder-stdlib/vendors/@microsoft/recognizers-text-date-time/dist/recognizers-text-date-time.browser.js new file mode 100644 index 0000000000..dd1ec59bf5 --- /dev/null +++ b/libraries/botbuilder-stdlib/vendors/@microsoft/recognizers-text-date-time/dist/recognizers-text-date-time.browser.js @@ -0,0 +1,35265 @@ +var microsoftRecognizersTextDateTime = (function (exports) { +'use strict'; + +var commonjsGlobal = typeof window !== 'undefined' ? window : typeof global !== 'undefined' ? global : typeof self !== 'undefined' ? self : {}; + + + +function unwrapExports (x) { + return x && x.__esModule && Object.prototype.hasOwnProperty.call(x, 'default') ? x['default'] : x; +} + +function createCommonjsModule(fn, module) { + return module = { exports: {} }, fn(module, module.exports), module.exports; +} + +var culture = createCommonjsModule(function (module, exports) { +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +class Culture { + constructor(cultureName, cultureCode) { + this.cultureName = cultureName; + this.cultureCode = cultureCode; + } + static getSupportedCultureCodes() { + return Culture.supportedCultures.map(c => c.cultureCode); + } + static mapToNearestLanguage(cultureCode) { + if (cultureCode !== undefined) { + cultureCode = cultureCode.toLowerCase(); + var supportedCultureCodes = Culture.getSupportedCultureCodes(); + if (supportedCultureCodes.indexOf(cultureCode) < 0) { + var culturePrefix = cultureCode.split('-')[0].trim(); + supportedCultureCodes.forEach(function (supportedCultureCode) { + if (supportedCultureCode.startsWith(culturePrefix)) { + cultureCode = supportedCultureCode; + } + }); + } + } + return cultureCode; + } +} +Culture.English = "en-us"; +Culture.Chinese = "zh-cn"; +Culture.Spanish = "es-es"; +Culture.Portuguese = "pt-br"; +Culture.French = "fr-fr"; +Culture.German = "de-de"; +Culture.Japanese = "ja-jp"; +Culture.Dutch = "nl-nl"; +Culture.Italian = "it-it"; +Culture.supportedCultures = [ + new Culture("English", Culture.English), + new Culture("Chinese", Culture.Chinese), + new Culture("Spanish", Culture.Spanish), + new Culture("Portuguese", Culture.Portuguese), + new Culture("French", Culture.French), + new Culture("German", Culture.German), + new Culture("Japanese", Culture.Japanese), + new Culture("Dutch", Culture.Dutch), + new Culture("Italian", Culture.Italian) +]; +exports.Culture = Culture; +class CultureInfo { + static getCultureInfo(cultureCode) { + return new CultureInfo(cultureCode); + } + constructor(cultureName) { + this.code = cultureName; + } +} +exports.CultureInfo = CultureInfo; + +}); + +unwrapExports(culture); + +var xregexp = createCommonjsModule(function (module, exports) { +"use strict"; + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.default = void 0; + +function _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _nonIterableRest(); } + +function _nonIterableRest() { throw new TypeError("Invalid attempt to destructure non-iterable instance"); } + +function _iterableToArrayLimit(arr, i) { var _arr = []; var _n = true; var _d = false; var _e = undefined; try { for (var _i = arr[Symbol.iterator](), _s; !(_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; } + +function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; } + +/*! + * XRegExp 4.2.0 + * + * Steven Levithan (c) 2007-present MIT License + */ + +/** + * XRegExp provides augmented, extensible regular expressions. You get additional regex syntax and + * flags, beyond what browsers support natively. XRegExp is also a regex utility belt with tools to + * make your client-side grepping simpler and more powerful, while freeing you from related + * cross-browser inconsistencies. + */ +// ==--------------------------== +// Private stuff +// ==--------------------------== +// Property name used for extended regex instance data +var REGEX_DATA = 'xregexp'; // Optional features that can be installed and uninstalled + +var features = { + astral: false, + namespacing: false +}; // Native methods to use and restore ('native' is an ES3 reserved keyword) + +var nativ = { + exec: RegExp.prototype.exec, + test: RegExp.prototype.test, + match: String.prototype.match, + replace: String.prototype.replace, + split: String.prototype.split +}; // Storage for fixed/extended native methods + +var fixed = {}; // Storage for regexes cached by `XRegExp.cache` + +var regexCache = {}; // Storage for pattern details cached by the `XRegExp` constructor + +var patternCache = {}; // Storage for regex syntax tokens added internally or by `XRegExp.addToken` + +var tokens = []; // Token scopes + +var defaultScope = 'default'; +var classScope = 'class'; // Regexes that match native regex syntax, including octals + +var nativeTokens = { + // Any native multicharacter token in default scope, or any single character + 'default': /\\(?:0(?:[0-3][0-7]{0,2}|[4-7][0-7]?)?|[1-9]\d*|x[\dA-Fa-f]{2}|u(?:[\dA-Fa-f]{4}|{[\dA-Fa-f]+})|c[A-Za-z]|[\s\S])|\(\?(?:[:=!]|<[=!])|[?*+]\?|{\d+(?:,\d*)?}\??|[\s\S]/, + // Any native multicharacter token in character class scope, or any single character + 'class': /\\(?:[0-3][0-7]{0,2}|[4-7][0-7]?|x[\dA-Fa-f]{2}|u(?:[\dA-Fa-f]{4}|{[\dA-Fa-f]+})|c[A-Za-z]|[\s\S])|[\s\S]/ +}; // Any backreference or dollar-prefixed character in replacement strings + +var replacementToken = /\$(?:{([\w$]+)}|<([\w$]+)>|(\d\d?|[\s\S]))/g; // Check for correct `exec` handling of nonparticipating capturing groups + +var correctExecNpcg = nativ.exec.call(/()??/, '')[1] === undefined; // Check for ES6 `flags` prop support + +var hasFlagsProp = /x/.flags !== undefined; // Shortcut to `Object.prototype.toString` + +var _ref = {}, + toString = _ref.toString; + +function hasNativeFlag(flag) { + // Can't check based on the presence of properties/getters since browsers might support such + // properties even when they don't support the corresponding flag in regex construction (tested + // in Chrome 48, where `'unicode' in /x/` is true but trying to construct a regex with flag `u` + // throws an error) + var isSupported = true; + + try { + // Can't use regex literals for testing even in a `try` because regex literals with + // unsupported flags cause a compilation error in IE + new RegExp('', flag); + } catch (exception) { + isSupported = false; + } + + return isSupported; +} // Check for ES6 `u` flag support + + +var hasNativeU = hasNativeFlag('u'); // Check for ES6 `y` flag support + +var hasNativeY = hasNativeFlag('y'); // Tracker for known flags, including addon flags + +var registeredFlags = { + g: true, + i: true, + m: true, + u: hasNativeU, + y: hasNativeY +}; +/** + * Attaches extended data and `XRegExp.prototype` properties to a regex object. + * + * @private + * @param {RegExp} regex Regex to augment. + * @param {Array} captureNames Array with capture names, or `null`. + * @param {String} xSource XRegExp pattern used to generate `regex`, or `null` if N/A. + * @param {String} xFlags XRegExp flags used to generate `regex`, or `null` if N/A. + * @param {Boolean} [isInternalOnly=false] Whether the regex will be used only for internal + * operations, and never exposed to users. For internal-only regexes, we can improve perf by + * skipping some operations like attaching `XRegExp.prototype` properties. + * @returns {RegExp} Augmented regex. + */ + +function augment(regex, captureNames, xSource, xFlags, isInternalOnly) { + regex[REGEX_DATA] = { + captureNames: captureNames + }; + + if (isInternalOnly) { + return regex; + } // Can't auto-inherit these since the XRegExp constructor returns a nonprimitive value + + + if (regex.__proto__) { + regex.__proto__ = XRegExp.prototype; + } else { + for (var p in XRegExp.prototype) { + // An `XRegExp.prototype.hasOwnProperty(p)` check wouldn't be worth it here, since this + // is performance sensitive, and enumerable `Object.prototype` or `RegExp.prototype` + // extensions exist on `regex.prototype` anyway + regex[p] = XRegExp.prototype[p]; + } + } + + regex[REGEX_DATA].source = xSource; // Emulate the ES6 `flags` prop by ensuring flags are in alphabetical order + + regex[REGEX_DATA].flags = xFlags ? xFlags.split('').sort().join('') : xFlags; + return regex; +} +/** + * Removes any duplicate characters from the provided string. + * + * @private + * @param {String} str String to remove duplicate characters from. + * @returns {String} String with any duplicate characters removed. + */ + + +function clipDuplicates(str) { + return nativ.replace.call(str, /([\s\S])(?=[\s\S]*\1)/g, ''); +} +/** + * Copies a regex object while preserving extended data and augmenting with `XRegExp.prototype` + * properties. The copy has a fresh `lastIndex` property (set to zero). Allows adding and removing + * flags g and y while copying the regex. + * + * @private + * @param {RegExp} regex Regex to copy. + * @param {Object} [options] Options object with optional properties: + * - `addG` {Boolean} Add flag g while copying the regex. + * - `addY` {Boolean} Add flag y while copying the regex. + * - `removeG` {Boolean} Remove flag g while copying the regex. + * - `removeY` {Boolean} Remove flag y while copying the regex. + * - `isInternalOnly` {Boolean} Whether the copied regex will be used only for internal + * operations, and never exposed to users. For internal-only regexes, we can improve perf by + * skipping some operations like attaching `XRegExp.prototype` properties. + * - `source` {String} Overrides `.source`, for special cases. + * @returns {RegExp} Copy of the provided regex, possibly with modified flags. + */ + + +function copyRegex(regex, options) { + if (!XRegExp.isRegExp(regex)) { + throw new TypeError('Type RegExp expected'); + } + + var xData = regex[REGEX_DATA] || {}; + var flags = getNativeFlags(regex); + var flagsToAdd = ''; + var flagsToRemove = ''; + var xregexpSource = null; + var xregexpFlags = null; + options = options || {}; + + if (options.removeG) { + flagsToRemove += 'g'; + } + + if (options.removeY) { + flagsToRemove += 'y'; + } + + if (flagsToRemove) { + flags = nativ.replace.call(flags, new RegExp("[".concat(flagsToRemove, "]+"), 'g'), ''); + } + + if (options.addG) { + flagsToAdd += 'g'; + } + + if (options.addY) { + flagsToAdd += 'y'; + } + + if (flagsToAdd) { + flags = clipDuplicates(flags + flagsToAdd); + } + + if (!options.isInternalOnly) { + if (xData.source !== undefined) { + xregexpSource = xData.source; + } // null or undefined; don't want to add to `flags` if the previous value was null, since + // that indicates we're not tracking original precompilation flags + + + if (xData.flags != null) { + // Flags are only added for non-internal regexes by `XRegExp.globalize`. Flags are never + // removed for non-internal regexes, so don't need to handle it + xregexpFlags = flagsToAdd ? clipDuplicates(xData.flags + flagsToAdd) : xData.flags; + } + } // Augment with `XRegExp.prototype` properties, but use the native `RegExp` constructor to avoid + // searching for special tokens. That would be wrong for regexes constructed by `RegExp`, and + // unnecessary for regexes constructed by `XRegExp` because the regex has already undergone the + // translation to native regex syntax + + + regex = augment(new RegExp(options.source || regex.source, flags), hasNamedCapture(regex) ? xData.captureNames.slice(0) : null, xregexpSource, xregexpFlags, options.isInternalOnly); + return regex; +} +/** + * Converts hexadecimal to decimal. + * + * @private + * @param {String} hex + * @returns {Number} + */ + + +function dec(hex) { + return parseInt(hex, 16); +} +/** + * Returns a pattern that can be used in a native RegExp in place of an ignorable token such as an + * inline comment or whitespace with flag x. This is used directly as a token handler function + * passed to `XRegExp.addToken`. + * + * @private + * @param {String} match Match arg of `XRegExp.addToken` handler + * @param {String} scope Scope arg of `XRegExp.addToken` handler + * @param {String} flags Flags arg of `XRegExp.addToken` handler + * @returns {String} Either '' or '(?:)', depending on which is needed in the context of the match. + */ + + +function getContextualTokenSeparator(match, scope, flags) { + if ( // No need to separate tokens if at the beginning or end of a group + match.input[match.index - 1] === '(' || match.input[match.index + match[0].length] === ')' || // No need to separate tokens if before or after a `|` + match.input[match.index - 1] === '|' || match.input[match.index + match[0].length] === '|' || // No need to separate tokens if at the beginning or end of the pattern + match.index < 1 || match.index + match[0].length >= match.input.length || // No need to separate tokens if at the beginning of a noncapturing group or lookahead. + // The way this is written relies on: + // - The search regex matching only 3-char strings. + // - Although `substr` gives chars from the end of the string if given a negative index, + // the resulting substring will be too short to match. Ex: `'abcd'.substr(-1, 3) === 'd'` + nativ.test.call(/^\(\?[:=!]/, match.input.substr(match.index - 3, 3)) || // Avoid separating tokens when the following token is a quantifier + isQuantifierNext(match.input, match.index + match[0].length, flags)) { + return ''; + } // Keep tokens separated. This avoids e.g. inadvertedly changing `\1 1` or `\1(?#)1` to `\11`. + // This also ensures all tokens remain as discrete atoms, e.g. it avoids converting the syntax + // error `(? :` into `(?:`. + + + return '(?:)'; +} +/** + * Returns native `RegExp` flags used by a regex object. + * + * @private + * @param {RegExp} regex Regex to check. + * @returns {String} Native flags in use. + */ + + +function getNativeFlags(regex) { + return hasFlagsProp ? regex.flags : // Explicitly using `RegExp.prototype.toString` (rather than e.g. `String` or concatenation + // with an empty string) allows this to continue working predictably when + // `XRegExp.proptotype.toString` is overridden + nativ.exec.call(/\/([a-z]*)$/i, RegExp.prototype.toString.call(regex))[1]; +} +/** + * Determines whether a regex has extended instance data used to track capture names. + * + * @private + * @param {RegExp} regex Regex to check. + * @returns {Boolean} Whether the regex uses named capture. + */ + + +function hasNamedCapture(regex) { + return !!(regex[REGEX_DATA] && regex[REGEX_DATA].captureNames); +} +/** + * Converts decimal to hexadecimal. + * + * @private + * @param {Number|String} dec + * @returns {String} + */ + + +function hex(dec) { + return parseInt(dec, 10).toString(16); +} +/** + * Checks whether the next nonignorable token after the specified position is a quantifier. + * + * @private + * @param {String} pattern Pattern to search within. + * @param {Number} pos Index in `pattern` to search at. + * @param {String} flags Flags used by the pattern. + * @returns {Boolean} Whether the next nonignorable token is a quantifier. + */ + + +function isQuantifierNext(pattern, pos, flags) { + return nativ.test.call(flags.indexOf('x') !== -1 ? // Ignore any leading whitespace, line comments, and inline comments + /^(?:\s|#[^#\n]*|\(\?#[^)]*\))*(?:[?*+]|{\d+(?:,\d*)?})/ : // Ignore any leading inline comments + /^(?:\(\?#[^)]*\))*(?:[?*+]|{\d+(?:,\d*)?})/, pattern.slice(pos)); +} +/** + * Determines whether a value is of the specified type, by resolving its internal [[Class]]. + * + * @private + * @param {*} value Object to check. + * @param {String} type Type to check for, in TitleCase. + * @returns {Boolean} Whether the object matches the type. + */ + + +function isType(value, type) { + return toString.call(value) === "[object ".concat(type, "]"); +} +/** + * Adds leading zeros if shorter than four characters. Used for fixed-length hexadecimal values. + * + * @private + * @param {String} str + * @returns {String} + */ + + +function pad4(str) { + while (str.length < 4) { + str = "0".concat(str); + } + + return str; +} +/** + * Checks for flag-related errors, and strips/applies flags in a leading mode modifier. Offloads + * the flag preparation logic from the `XRegExp` constructor. + * + * @private + * @param {String} pattern Regex pattern, possibly with a leading mode modifier. + * @param {String} flags Any combination of flags. + * @returns {Object} Object with properties `pattern` and `flags`. + */ + + +function prepareFlags(pattern, flags) { + // Recent browsers throw on duplicate flags, so copy this behavior for nonnative flags + if (clipDuplicates(flags) !== flags) { + throw new SyntaxError("Invalid duplicate regex flag ".concat(flags)); + } // Strip and apply a leading mode modifier with any combination of flags except g or y + + + pattern = nativ.replace.call(pattern, /^\(\?([\w$]+)\)/, function ($0, $1) { + if (nativ.test.call(/[gy]/, $1)) { + throw new SyntaxError("Cannot use flag g or y in mode modifier ".concat($0)); + } // Allow duplicate flags within the mode modifier + + + flags = clipDuplicates(flags + $1); + return ''; + }); // Throw on unknown native or nonnative flags + + var _iteratorNormalCompletion = true; + var _didIteratorError = false; + var _iteratorError = undefined; + + try { + for (var _iterator = flags[Symbol.iterator](), _step; !(_iteratorNormalCompletion = (_step = _iterator.next()).done); _iteratorNormalCompletion = true) { + var flag = _step.value; + + if (!registeredFlags[flag]) { + throw new SyntaxError("Unknown regex flag ".concat(flag)); + } + } + } catch (err) { + _didIteratorError = true; + _iteratorError = err; + } finally { + try { + if (!_iteratorNormalCompletion && _iterator.return != null) { + _iterator.return(); + } + } finally { + if (_didIteratorError) { + throw _iteratorError; + } + } + } + + return { + pattern: pattern, + flags: flags + }; +} +/** + * Prepares an options object from the given value. + * + * @private + * @param {String|Object} value Value to convert to an options object. + * @returns {Object} Options object. + */ + + +function prepareOptions(value) { + var options = {}; + + if (isType(value, 'String')) { + XRegExp.forEach(value, /[^\s,]+/, function (match) { + options[match] = true; + }); + return options; + } + + return value; +} +/** + * Registers a flag so it doesn't throw an 'unknown flag' error. + * + * @private + * @param {String} flag Single-character flag to register. + */ + + +function registerFlag(flag) { + if (!/^[\w$]$/.test(flag)) { + throw new Error('Flag must be a single character A-Za-z0-9_$'); + } + + registeredFlags[flag] = true; +} +/** + * Runs built-in and custom regex syntax tokens in reverse insertion order at the specified + * position, until a match is found. + * + * @private + * @param {String} pattern Original pattern from which an XRegExp object is being built. + * @param {String} flags Flags being used to construct the regex. + * @param {Number} pos Position to search for tokens within `pattern`. + * @param {Number} scope Regex scope to apply: 'default' or 'class'. + * @param {Object} context Context object to use for token handler functions. + * @returns {Object} Object with properties `matchLength`, `output`, and `reparse`; or `null`. + */ + + +function runTokens(pattern, flags, pos, scope, context) { + var i = tokens.length; + var leadChar = pattern[pos]; + var result = null; + var match; + var t; // Run in reverse insertion order + + while (i--) { + t = tokens[i]; + + if (t.leadChar && t.leadChar !== leadChar || t.scope !== scope && t.scope !== 'all' || t.flag && !(flags.indexOf(t.flag) !== -1)) { + continue; + } + + match = XRegExp.exec(pattern, t.regex, pos, 'sticky'); + + if (match) { + result = { + matchLength: match[0].length, + output: t.handler.call(context, match, scope, flags), + reparse: t.reparse + }; // Finished with token tests + + break; + } + } + + return result; +} +/** + * Enables or disables implicit astral mode opt-in. When enabled, flag A is automatically added to + * all new regexes created by XRegExp. This causes an error to be thrown when creating regexes if + * the Unicode Base addon is not available, since flag A is registered by that addon. + * + * @private + * @param {Boolean} on `true` to enable; `false` to disable. + */ + + +function setAstral(on) { + features.astral = on; +} +/** + * Adds named capture groups to the `groups` property of match arrays. See here for details: + * https://github.com/tc39/proposal-regexp-named-groups + * + * @private + * @param {Boolean} on `true` to enable; `false` to disable. + */ + + +function setNamespacing(on) { + features.namespacing = on; +} +/** + * Returns the object, or throws an error if it is `null` or `undefined`. This is used to follow + * the ES5 abstract operation `ToObject`. + * + * @private + * @param {*} value Object to check and return. + * @returns {*} The provided object. + */ + + +function toObject(value) { + // null or undefined + if (value == null) { + throw new TypeError('Cannot convert null or undefined to object'); + } + + return value; +} // ==--------------------------== +// Constructor +// ==--------------------------== + +/** + * Creates an extended regular expression object for matching text with a pattern. Differs from a + * native regular expression in that additional syntax and flags are supported. The returned object + * is in fact a native `RegExp` and works with all native methods. + * + * @class XRegExp + * @constructor + * @param {String|RegExp} pattern Regex pattern string, or an existing regex object to copy. + * @param {String} [flags] Any combination of flags. + * Native flags: + * - `g` - global + * - `i` - ignore case + * - `m` - multiline anchors + * - `u` - unicode (ES6) + * - `y` - sticky (Firefox 3+, ES6) + * Additional XRegExp flags: + * - `n` - explicit capture + * - `s` - dot matches all (aka singleline) + * - `x` - free-spacing and line comments (aka extended) + * - `A` - astral (requires the Unicode Base addon) + * Flags cannot be provided when constructing one `RegExp` from another. + * @returns {RegExp} Extended regular expression object. + * @example + * + * // With named capture and flag x + * XRegExp(`(? [0-9]{4} ) -? # year + * (? [0-9]{2} ) -? # month + * (? [0-9]{2} ) # day`, 'x'); + * + * // Providing a regex object copies it. Native regexes are recompiled using native (not XRegExp) + * // syntax. Copies maintain extended data, are augmented with `XRegExp.prototype` properties, and + * // have fresh `lastIndex` properties (set to zero). + * XRegExp(/regex/); + */ + + +function XRegExp(pattern, flags) { + if (XRegExp.isRegExp(pattern)) { + if (flags !== undefined) { + throw new TypeError('Cannot supply flags when copying a RegExp'); + } + + return copyRegex(pattern); + } // Copy the argument behavior of `RegExp` + + + pattern = pattern === undefined ? '' : String(pattern); + flags = flags === undefined ? '' : String(flags); + + if (XRegExp.isInstalled('astral') && !(flags.indexOf('A') !== -1)) { + // This causes an error to be thrown if the Unicode Base addon is not available + flags += 'A'; + } + + if (!patternCache[pattern]) { + patternCache[pattern] = {}; + } + + if (!patternCache[pattern][flags]) { + var context = { + hasNamedCapture: false, + captureNames: [] + }; + var scope = defaultScope; + var output = ''; + var pos = 0; + var result; // Check for flag-related errors, and strip/apply flags in a leading mode modifier + + var applied = prepareFlags(pattern, flags); + var appliedPattern = applied.pattern; + var appliedFlags = applied.flags; // Use XRegExp's tokens to translate the pattern to a native regex pattern. + // `appliedPattern.length` may change on each iteration if tokens use `reparse` + + while (pos < appliedPattern.length) { + do { + // Check for custom tokens at the current position + result = runTokens(appliedPattern, appliedFlags, pos, scope, context); // If the matched token used the `reparse` option, splice its output into the + // pattern before running tokens again at the same position + + if (result && result.reparse) { + appliedPattern = appliedPattern.slice(0, pos) + result.output + appliedPattern.slice(pos + result.matchLength); + } + } while (result && result.reparse); + + if (result) { + output += result.output; + pos += result.matchLength || 1; + } else { + // Get the native token at the current position + var _XRegExp$exec = XRegExp.exec(appliedPattern, nativeTokens[scope], pos, 'sticky'), + _XRegExp$exec2 = _slicedToArray(_XRegExp$exec, 1), + token = _XRegExp$exec2[0]; + + output += token; + pos += token.length; + + if (token === '[' && scope === defaultScope) { + scope = classScope; + } else if (token === ']' && scope === classScope) { + scope = defaultScope; + } + } + } + + patternCache[pattern][flags] = { + // Use basic cleanup to collapse repeated empty groups like `(?:)(?:)` to `(?:)`. Empty + // groups are sometimes inserted during regex transpilation in order to keep tokens + // separated. However, more than one empty group in a row is never needed. + pattern: nativ.replace.call(output, /(?:\(\?:\))+/g, '(?:)'), + // Strip all but native flags + flags: nativ.replace.call(appliedFlags, /[^gimuy]+/g, ''), + // `context.captureNames` has an item for each capturing group, even if unnamed + captures: context.hasNamedCapture ? context.captureNames : null + }; + } + + var generated = patternCache[pattern][flags]; + return augment(new RegExp(generated.pattern, generated.flags), generated.captures, pattern, flags); +} // Add `RegExp.prototype` to the prototype chain + + +XRegExp.prototype = /(?:)/; // ==--------------------------== +// Public properties +// ==--------------------------== + +/** + * The XRegExp version number as a string containing three dot-separated parts. For example, + * '2.0.0-beta-3'. + * + * @static + * @memberOf XRegExp + * @type String + */ + +XRegExp.version = '4.2.0'; // ==--------------------------== +// Public methods +// ==--------------------------== +// Intentionally undocumented; used in tests and addons + +XRegExp._clipDuplicates = clipDuplicates; +XRegExp._hasNativeFlag = hasNativeFlag; +XRegExp._dec = dec; +XRegExp._hex = hex; +XRegExp._pad4 = pad4; +/** + * Extends XRegExp syntax and allows custom flags. This is used internally and can be used to + * create XRegExp addons. If more than one token can match the same string, the last added wins. + * + * @memberOf XRegExp + * @param {RegExp} regex Regex object that matches the new token. + * @param {Function} handler Function that returns a new pattern string (using native regex syntax) + * to replace the matched token within all future XRegExp regexes. Has access to persistent + * properties of the regex being built, through `this`. Invoked with three arguments: + * - The match array, with named backreference properties. + * - The regex scope where the match was found: 'default' or 'class'. + * - The flags used by the regex, including any flags in a leading mode modifier. + * The handler function becomes part of the XRegExp construction process, so be careful not to + * construct XRegExps within the function or you will trigger infinite recursion. + * @param {Object} [options] Options object with optional properties: + * - `scope` {String} Scope where the token applies: 'default', 'class', or 'all'. + * - `flag` {String} Single-character flag that triggers the token. This also registers the + * flag, which prevents XRegExp from throwing an 'unknown flag' error when the flag is used. + * - `optionalFlags` {String} Any custom flags checked for within the token `handler` that are + * not required to trigger the token. This registers the flags, to prevent XRegExp from + * throwing an 'unknown flag' error when any of the flags are used. + * - `reparse` {Boolean} Whether the `handler` function's output should not be treated as + * final, and instead be reparseable by other tokens (including the current token). Allows + * token chaining or deferring. + * - `leadChar` {String} Single character that occurs at the beginning of any successful match + * of the token (not always applicable). This doesn't change the behavior of the token unless + * you provide an erroneous value. However, providing it can increase the token's performance + * since the token can be skipped at any positions where this character doesn't appear. + * @example + * + * // Basic usage: Add \a for the ALERT control code + * XRegExp.addToken( + * /\\a/, + * () => '\\x07', + * {scope: 'all'} + * ); + * XRegExp('\\a[\\a-\\n]+').test('\x07\n\x07'); // -> true + * + * // Add the U (ungreedy) flag from PCRE and RE2, which reverses greedy and lazy quantifiers. + * // Since `scope` is not specified, it uses 'default' (i.e., transformations apply outside of + * // character classes only) + * XRegExp.addToken( + * /([?*+]|{\d+(?:,\d*)?})(\??)/, + * (match) => `${match[1]}${match[2] ? '' : '?'}`, + * {flag: 'U'} + * ); + * XRegExp('a+', 'U').exec('aaa')[0]; // -> 'a' + * XRegExp('a+?', 'U').exec('aaa')[0]; // -> 'aaa' + */ + +XRegExp.addToken = function (regex, handler, options) { + options = options || {}; + var _options = options, + optionalFlags = _options.optionalFlags; + + if (options.flag) { + registerFlag(options.flag); + } + + if (optionalFlags) { + optionalFlags = nativ.split.call(optionalFlags, ''); + var _iteratorNormalCompletion2 = true; + var _didIteratorError2 = false; + var _iteratorError2 = undefined; + + try { + for (var _iterator2 = optionalFlags[Symbol.iterator](), _step2; !(_iteratorNormalCompletion2 = (_step2 = _iterator2.next()).done); _iteratorNormalCompletion2 = true) { + var flag = _step2.value; + registerFlag(flag); + } + } catch (err) { + _didIteratorError2 = true; + _iteratorError2 = err; + } finally { + try { + if (!_iteratorNormalCompletion2 && _iterator2.return != null) { + _iterator2.return(); + } + } finally { + if (_didIteratorError2) { + throw _iteratorError2; + } + } + } + } // Add to the private list of syntax tokens + + + tokens.push({ + regex: copyRegex(regex, { + addG: true, + addY: hasNativeY, + isInternalOnly: true + }), + handler: handler, + scope: options.scope || defaultScope, + flag: options.flag, + reparse: options.reparse, + leadChar: options.leadChar + }); // Reset the pattern cache used by the `XRegExp` constructor, since the same pattern and flags + // might now produce different results + + XRegExp.cache.flush('patterns'); +}; +/** + * Caches and returns the result of calling `XRegExp(pattern, flags)`. On any subsequent call with + * the same pattern and flag combination, the cached copy of the regex is returned. + * + * @memberOf XRegExp + * @param {String} pattern Regex pattern string. + * @param {String} [flags] Any combination of XRegExp flags. + * @returns {RegExp} Cached XRegExp object. + * @example + * + * while (match = XRegExp.cache('.', 'gs').exec(str)) { + * // The regex is compiled once only + * } + */ + + +XRegExp.cache = function (pattern, flags) { + if (!regexCache[pattern]) { + regexCache[pattern] = {}; + } + + return regexCache[pattern][flags] || (regexCache[pattern][flags] = XRegExp(pattern, flags)); +}; // Intentionally undocumented; used in tests + + +XRegExp.cache.flush = function (cacheName) { + if (cacheName === 'patterns') { + // Flush the pattern cache used by the `XRegExp` constructor + patternCache = {}; + } else { + // Flush the regex cache populated by `XRegExp.cache` + regexCache = {}; + } +}; +/** + * Escapes any regular expression metacharacters, for use when matching literal strings. The result + * can safely be used at any point within a regex that uses any flags. + * + * @memberOf XRegExp + * @param {String} str String to escape. + * @returns {String} String with regex metacharacters escaped. + * @example + * + * XRegExp.escape('Escaped? <.>'); + * // -> 'Escaped\?\ <\.>' + */ + + +XRegExp.escape = function (str) { + return nativ.replace.call(toObject(str), /[-\[\]{}()*+?.,\\^$|#\s]/g, '\\$&'); +}; +/** + * Executes a regex search in a specified string. Returns a match array or `null`. If the provided + * regex uses named capture, named backreference properties are included on the match array. + * Optional `pos` and `sticky` arguments specify the search start position, and whether the match + * must start at the specified position only. The `lastIndex` property of the provided regex is not + * used, but is updated for compatibility. Also fixes browser bugs compared to the native + * `RegExp.prototype.exec` and can be used reliably cross-browser. + * + * @memberOf XRegExp + * @param {String} str String to search. + * @param {RegExp} regex Regex to search with. + * @param {Number} [pos=0] Zero-based index at which to start the search. + * @param {Boolean|String} [sticky=false] Whether the match must start at the specified position + * only. The string `'sticky'` is accepted as an alternative to `true`. + * @returns {Array} Match array with named backreference properties, or `null`. + * @example + * + * // Basic use, with named backreference + * let match = XRegExp.exec('U+2620', XRegExp('U\\+(?[0-9A-F]{4})')); + * match.hex; // -> '2620' + * + * // With pos and sticky, in a loop + * let pos = 2, result = [], match; + * while (match = XRegExp.exec('<1><2><3><4>5<6>', /<(\d)>/, pos, 'sticky')) { + * result.push(match[1]); + * pos = match.index + match[0].length; + * } + * // result -> ['2', '3', '4'] + */ + + +XRegExp.exec = function (str, regex, pos, sticky) { + var cacheKey = 'g'; + var addY = false; + var fakeY = false; + var match; + addY = hasNativeY && !!(sticky || regex.sticky && sticky !== false); + + if (addY) { + cacheKey += 'y'; + } else if (sticky) { + // Simulate sticky matching by appending an empty capture to the original regex. The + // resulting regex will succeed no matter what at the current index (set with `lastIndex`), + // and will not search the rest of the subject string. We'll know that the original regex + // has failed if that last capture is `''` rather than `undefined` (i.e., if that last + // capture participated in the match). + fakeY = true; + cacheKey += 'FakeY'; + } + + regex[REGEX_DATA] = regex[REGEX_DATA] || {}; // Shares cached copies with `XRegExp.match`/`replace` + + var r2 = regex[REGEX_DATA][cacheKey] || (regex[REGEX_DATA][cacheKey] = copyRegex(regex, { + addG: true, + addY: addY, + source: fakeY ? "".concat(regex.source, "|()") : undefined, + removeY: sticky === false, + isInternalOnly: true + })); + pos = pos || 0; + r2.lastIndex = pos; // Fixed `exec` required for `lastIndex` fix, named backreferences, etc. + + match = fixed.exec.call(r2, str); // Get rid of the capture added by the pseudo-sticky matcher if needed. An empty string means + // the original regexp failed (see above). + + if (fakeY && match && match.pop() === '') { + match = null; + } + + if (regex.global) { + regex.lastIndex = match ? r2.lastIndex : 0; + } + + return match; +}; +/** + * Executes a provided function once per regex match. Searches always start at the beginning of the + * string and continue until the end, regardless of the state of the regex's `global` property and + * initial `lastIndex`. + * + * @memberOf XRegExp + * @param {String} str String to search. + * @param {RegExp} regex Regex to search with. + * @param {Function} callback Function to execute for each match. Invoked with four arguments: + * - The match array, with named backreference properties. + * - The zero-based match index. + * - The string being traversed. + * - The regex object being used to traverse the string. + * @example + * + * // Extracts every other digit from a string + * const evens = []; + * XRegExp.forEach('1a2345', /\d/, (match, i) => { + * if (i % 2) evens.push(+match[0]); + * }); + * // evens -> [2, 4] + */ + + +XRegExp.forEach = function (str, regex, callback) { + var pos = 0; + var i = -1; + var match; + + while (match = XRegExp.exec(str, regex, pos)) { + // Because `regex` is provided to `callback`, the function could use the deprecated/ + // nonstandard `RegExp.prototype.compile` to mutate the regex. However, since `XRegExp.exec` + // doesn't use `lastIndex` to set the search position, this can't lead to an infinite loop, + // at least. Actually, because of the way `XRegExp.exec` caches globalized versions of + // regexes, mutating the regex will not have any effect on the iteration or matched strings, + // which is a nice side effect that brings extra safety. + callback(match, ++i, str, regex); + pos = match.index + (match[0].length || 1); + } +}; +/** + * Copies a regex object and adds flag `g`. The copy maintains extended data, is augmented with + * `XRegExp.prototype` properties, and has a fresh `lastIndex` property (set to zero). Native + * regexes are not recompiled using XRegExp syntax. + * + * @memberOf XRegExp + * @param {RegExp} regex Regex to globalize. + * @returns {RegExp} Copy of the provided regex with flag `g` added. + * @example + * + * const globalCopy = XRegExp.globalize(/regex/); + * globalCopy.global; // -> true + */ + + +XRegExp.globalize = function (regex) { + return copyRegex(regex, { + addG: true + }); +}; +/** + * Installs optional features according to the specified options. Can be undone using + * `XRegExp.uninstall`. + * + * @memberOf XRegExp + * @param {Object|String} options Options object or string. + * @example + * + * // With an options object + * XRegExp.install({ + * // Enables support for astral code points in Unicode addons (implicitly sets flag A) + * astral: true, + * + * // Adds named capture groups to the `groups` property of matches + * namespacing: true + * }); + * + * // With an options string + * XRegExp.install('astral namespacing'); + */ + + +XRegExp.install = function (options) { + options = prepareOptions(options); + + if (!features.astral && options.astral) { + setAstral(true); + } + + if (!features.namespacing && options.namespacing) { + setNamespacing(true); + } +}; +/** + * Checks whether an individual optional feature is installed. + * + * @memberOf XRegExp + * @param {String} feature Name of the feature to check. One of: + * - `astral` + * - `namespacing` + * @returns {Boolean} Whether the feature is installed. + * @example + * + * XRegExp.isInstalled('astral'); + */ + + +XRegExp.isInstalled = function (feature) { + return !!features[feature]; +}; +/** + * Returns `true` if an object is a regex; `false` if it isn't. This works correctly for regexes + * created in another frame, when `instanceof` and `constructor` checks would fail. + * + * @memberOf XRegExp + * @param {*} value Object to check. + * @returns {Boolean} Whether the object is a `RegExp` object. + * @example + * + * XRegExp.isRegExp('string'); // -> false + * XRegExp.isRegExp(/regex/i); // -> true + * XRegExp.isRegExp(RegExp('^', 'm')); // -> true + * XRegExp.isRegExp(XRegExp('(?s).')); // -> true + */ + + +XRegExp.isRegExp = function (value) { + return toString.call(value) === '[object RegExp]'; +}; // isType(value, 'RegExp'); + +/** + * Returns the first matched string, or in global mode, an array containing all matched strings. + * This is essentially a more convenient re-implementation of `String.prototype.match` that gives + * the result types you actually want (string instead of `exec`-style array in match-first mode, + * and an empty array instead of `null` when no matches are found in match-all mode). It also lets + * you override flag g and ignore `lastIndex`, and fixes browser bugs. + * + * @memberOf XRegExp + * @param {String} str String to search. + * @param {RegExp} regex Regex to search with. + * @param {String} [scope='one'] Use 'one' to return the first match as a string. Use 'all' to + * return an array of all matched strings. If not explicitly specified and `regex` uses flag g, + * `scope` is 'all'. + * @returns {String|Array} In match-first mode: First match as a string, or `null`. In match-all + * mode: Array of all matched strings, or an empty array. + * @example + * + * // Match first + * XRegExp.match('abc', /\w/); // -> 'a' + * XRegExp.match('abc', /\w/g, 'one'); // -> 'a' + * XRegExp.match('abc', /x/g, 'one'); // -> null + * + * // Match all + * XRegExp.match('abc', /\w/g); // -> ['a', 'b', 'c'] + * XRegExp.match('abc', /\w/, 'all'); // -> ['a', 'b', 'c'] + * XRegExp.match('abc', /x/, 'all'); // -> [] + */ + + +XRegExp.match = function (str, regex, scope) { + var global = regex.global && scope !== 'one' || scope === 'all'; + var cacheKey = (global ? 'g' : '') + (regex.sticky ? 'y' : '') || 'noGY'; + regex[REGEX_DATA] = regex[REGEX_DATA] || {}; // Shares cached copies with `XRegExp.exec`/`replace` + + var r2 = regex[REGEX_DATA][cacheKey] || (regex[REGEX_DATA][cacheKey] = copyRegex(regex, { + addG: !!global, + removeG: scope === 'one', + isInternalOnly: true + })); + var result = nativ.match.call(toObject(str), r2); + + if (regex.global) { + regex.lastIndex = scope === 'one' && result ? // Can't use `r2.lastIndex` since `r2` is nonglobal in this case + result.index + result[0].length : 0; + } + + return global ? result || [] : result && result[0]; +}; +/** + * Retrieves the matches from searching a string using a chain of regexes that successively search + * within previous matches. The provided `chain` array can contain regexes and or objects with + * `regex` and `backref` properties. When a backreference is specified, the named or numbered + * backreference is passed forward to the next regex or returned. + * + * @memberOf XRegExp + * @param {String} str String to search. + * @param {Array} chain Regexes that each search for matches within preceding results. + * @returns {Array} Matches by the last regex in the chain, or an empty array. + * @example + * + * // Basic usage; matches numbers within tags + * XRegExp.matchChain('1 2 3 4 a 56', [ + * XRegExp('(?is).*?'), + * /\d+/ + * ]); + * // -> ['2', '4', '56'] + * + * // Passing forward and returning specific backreferences + * html = '
XRegExp\ + * Google'; + * XRegExp.matchChain(html, [ + * {regex: //i, backref: 1}, + * {regex: XRegExp('(?i)^https?://(?[^/?#]+)'), backref: 'domain'} + * ]); + * // -> ['xregexp.com', 'www.google.com'] + */ + + +XRegExp.matchChain = function (str, chain) { + return function recurseChain(values, level) { + var item = chain[level].regex ? chain[level] : { + regex: chain[level] + }; + var matches = []; + + function addMatch(match) { + if (item.backref) { + var ERR_UNDEFINED_GROUP = "Backreference to undefined group: ".concat(item.backref); + var isNamedBackref = isNaN(item.backref); + + if (isNamedBackref && XRegExp.isInstalled('namespacing')) { + // `groups` has `null` as prototype, so using `in` instead of `hasOwnProperty` + if (!(item.backref in match.groups)) { + throw new ReferenceError(ERR_UNDEFINED_GROUP); + } + } else if (!match.hasOwnProperty(item.backref)) { + throw new ReferenceError(ERR_UNDEFINED_GROUP); + } + + var backrefValue = isNamedBackref && XRegExp.isInstalled('namespacing') ? match.groups[item.backref] : match[item.backref]; + matches.push(backrefValue || ''); + } else { + matches.push(match[0]); + } + } + + var _iteratorNormalCompletion3 = true; + var _didIteratorError3 = false; + var _iteratorError3 = undefined; + + try { + for (var _iterator3 = values[Symbol.iterator](), _step3; !(_iteratorNormalCompletion3 = (_step3 = _iterator3.next()).done); _iteratorNormalCompletion3 = true) { + var value = _step3.value; + XRegExp.forEach(value, item.regex, addMatch); + } + } catch (err) { + _didIteratorError3 = true; + _iteratorError3 = err; + } finally { + try { + if (!_iteratorNormalCompletion3 && _iterator3.return != null) { + _iterator3.return(); + } + } finally { + if (_didIteratorError3) { + throw _iteratorError3; + } + } + } + + return level === chain.length - 1 || !matches.length ? matches : recurseChain(matches, level + 1); + }([str], 0); +}; +/** + * Returns a new string with one or all matches of a pattern replaced. The pattern can be a string + * or regex, and the replacement can be a string or a function to be called for each match. To + * perform a global search and replace, use the optional `scope` argument or include flag g if using + * a regex. Replacement strings can use `${n}` or `$` for named and numbered backreferences. + * Replacement functions can use named backreferences via `arguments[0].name`. Also fixes browser + * bugs compared to the native `String.prototype.replace` and can be used reliably cross-browser. + * + * @memberOf XRegExp + * @param {String} str String to search. + * @param {RegExp|String} search Search pattern to be replaced. + * @param {String|Function} replacement Replacement string or a function invoked to create it. + * Replacement strings can include special replacement syntax: + * - $$ - Inserts a literal $ character. + * - $&, $0 - Inserts the matched substring. + * - $` - Inserts the string that precedes the matched substring (left context). + * - $' - Inserts the string that follows the matched substring (right context). + * - $n, $nn - Where n/nn are digits referencing an existent capturing group, inserts + * backreference n/nn. + * - ${n}, $ - Where n is a name or any number of digits that reference an existent capturing + * group, inserts backreference n. + * Replacement functions are invoked with three or more arguments: + * - The matched substring (corresponds to $& above). Named backreferences are accessible as + * properties of this first argument. + * - 0..n arguments, one for each backreference (corresponding to $1, $2, etc. above). + * - The zero-based index of the match within the total search string. + * - The total string being searched. + * @param {String} [scope='one'] Use 'one' to replace the first match only, or 'all'. If not + * explicitly specified and using a regex with flag g, `scope` is 'all'. + * @returns {String} New string with one or all matches replaced. + * @example + * + * // Regex search, using named backreferences in replacement string + * const name = XRegExp('(?\\w+) (?\\w+)'); + * XRegExp.replace('John Smith', name, '$, $'); + * // -> 'Smith, John' + * + * // Regex search, using named backreferences in replacement function + * XRegExp.replace('John Smith', name, (match) => `${match.last}, ${match.first}`); + * // -> 'Smith, John' + * + * // String search, with replace-all + * XRegExp.replace('RegExp builds RegExps', 'RegExp', 'XRegExp', 'all'); + * // -> 'XRegExp builds XRegExps' + */ + + +XRegExp.replace = function (str, search, replacement, scope) { + var isRegex = XRegExp.isRegExp(search); + var global = search.global && scope !== 'one' || scope === 'all'; + var cacheKey = (global ? 'g' : '') + (search.sticky ? 'y' : '') || 'noGY'; + var s2 = search; + + if (isRegex) { + search[REGEX_DATA] = search[REGEX_DATA] || {}; // Shares cached copies with `XRegExp.exec`/`match`. Since a copy is used, `search`'s + // `lastIndex` isn't updated *during* replacement iterations + + s2 = search[REGEX_DATA][cacheKey] || (search[REGEX_DATA][cacheKey] = copyRegex(search, { + addG: !!global, + removeG: scope === 'one', + isInternalOnly: true + })); + } else if (global) { + s2 = new RegExp(XRegExp.escape(String(search)), 'g'); + } // Fixed `replace` required for named backreferences, etc. + + + var result = fixed.replace.call(toObject(str), s2, replacement); + + if (isRegex && search.global) { + // Fixes IE, Safari bug (last tested IE 9, Safari 5.1) + search.lastIndex = 0; + } + + return result; +}; +/** + * Performs batch processing of string replacements. Used like `XRegExp.replace`, but accepts an + * array of replacement details. Later replacements operate on the output of earlier replacements. + * Replacement details are accepted as an array with a regex or string to search for, the + * replacement string or function, and an optional scope of 'one' or 'all'. Uses the XRegExp + * replacement text syntax, which supports named backreference properties via `${name}` or + * `$`. + * + * @memberOf XRegExp + * @param {String} str String to search. + * @param {Array} replacements Array of replacement detail arrays. + * @returns {String} New string with all replacements. + * @example + * + * str = XRegExp.replaceEach(str, [ + * [XRegExp('(?a)'), 'z${name}'], + * [/b/gi, 'y'], + * [/c/g, 'x', 'one'], // scope 'one' overrides /g + * [/d/, 'w', 'all'], // scope 'all' overrides lack of /g + * ['e', 'v', 'all'], // scope 'all' allows replace-all for strings + * [/f/g, ($0) => $0.toUpperCase()] + * ]); + */ + + +XRegExp.replaceEach = function (str, replacements) { + var _iteratorNormalCompletion4 = true; + var _didIteratorError4 = false; + var _iteratorError4 = undefined; + + try { + for (var _iterator4 = replacements[Symbol.iterator](), _step4; !(_iteratorNormalCompletion4 = (_step4 = _iterator4.next()).done); _iteratorNormalCompletion4 = true) { + var r = _step4.value; + str = XRegExp.replace(str, r[0], r[1], r[2]); + } + } catch (err) { + _didIteratorError4 = true; + _iteratorError4 = err; + } finally { + try { + if (!_iteratorNormalCompletion4 && _iterator4.return != null) { + _iterator4.return(); + } + } finally { + if (_didIteratorError4) { + throw _iteratorError4; + } + } + } + + return str; +}; +/** + * Splits a string into an array of strings using a regex or string separator. Matches of the + * separator are not included in the result array. However, if `separator` is a regex that contains + * capturing groups, backreferences are spliced into the result each time `separator` is matched. + * Fixes browser bugs compared to the native `String.prototype.split` and can be used reliably + * cross-browser. + * + * @memberOf XRegExp + * @param {String} str String to split. + * @param {RegExp|String} separator Regex or string to use for separating the string. + * @param {Number} [limit] Maximum number of items to include in the result array. + * @returns {Array} Array of substrings. + * @example + * + * // Basic use + * XRegExp.split('a b c', ' '); + * // -> ['a', 'b', 'c'] + * + * // With limit + * XRegExp.split('a b c', ' ', 2); + * // -> ['a', 'b'] + * + * // Backreferences in result array + * XRegExp.split('..word1..', /([a-z]+)(\d+)/i); + * // -> ['..', 'word', '1', '..'] + */ + + +XRegExp.split = function (str, separator, limit) { + return fixed.split.call(toObject(str), separator, limit); +}; +/** + * Executes a regex search in a specified string. Returns `true` or `false`. Optional `pos` and + * `sticky` arguments specify the search start position, and whether the match must start at the + * specified position only. The `lastIndex` property of the provided regex is not used, but is + * updated for compatibility. Also fixes browser bugs compared to the native + * `RegExp.prototype.test` and can be used reliably cross-browser. + * + * @memberOf XRegExp + * @param {String} str String to search. + * @param {RegExp} regex Regex to search with. + * @param {Number} [pos=0] Zero-based index at which to start the search. + * @param {Boolean|String} [sticky=false] Whether the match must start at the specified position + * only. The string `'sticky'` is accepted as an alternative to `true`. + * @returns {Boolean} Whether the regex matched the provided value. + * @example + * + * // Basic use + * XRegExp.test('abc', /c/); // -> true + * + * // With pos and sticky + * XRegExp.test('abc', /c/, 0, 'sticky'); // -> false + * XRegExp.test('abc', /c/, 2, 'sticky'); // -> true + */ +// Do this the easy way :-) + + +XRegExp.test = function (str, regex, pos, sticky) { + return !!XRegExp.exec(str, regex, pos, sticky); +}; +/** + * Uninstalls optional features according to the specified options. All optional features start out + * uninstalled, so this is used to undo the actions of `XRegExp.install`. + * + * @memberOf XRegExp + * @param {Object|String} options Options object or string. + * @example + * + * // With an options object + * XRegExp.uninstall({ + * // Disables support for astral code points in Unicode addons + * astral: true, + * + * // Don't add named capture groups to the `groups` property of matches + * namespacing: true + * }); + * + * // With an options string + * XRegExp.uninstall('astral namespacing'); + */ + + +XRegExp.uninstall = function (options) { + options = prepareOptions(options); + + if (features.astral && options.astral) { + setAstral(false); + } + + if (features.namespacing && options.namespacing) { + setNamespacing(false); + } +}; +/** + * Returns an XRegExp object that is the union of the given patterns. Patterns can be provided as + * regex objects or strings. Metacharacters are escaped in patterns provided as strings. + * Backreferences in provided regex objects are automatically renumbered to work correctly within + * the larger combined pattern. Native flags used by provided regexes are ignored in favor of the + * `flags` argument. + * + * @memberOf XRegExp + * @param {Array} patterns Regexes and strings to combine. + * @param {String} [flags] Any combination of XRegExp flags. + * @param {Object} [options] Options object with optional properties: + * - `conjunction` {String} Type of conjunction to use: 'or' (default) or 'none'. + * @returns {RegExp} Union of the provided regexes and strings. + * @example + * + * XRegExp.union(['a+b*c', /(dogs)\1/, /(cats)\1/], 'i'); + * // -> /a\+b\*c|(dogs)\1|(cats)\2/i + * + * XRegExp.union([/man/, /bear/, /pig/], 'i', {conjunction: 'none'}); + * // -> /manbearpig/i + */ + + +XRegExp.union = function (patterns, flags, options) { + options = options || {}; + var conjunction = options.conjunction || 'or'; + var numCaptures = 0; + var numPriorCaptures; + var captureNames; + + function rewrite(match, paren, backref) { + var name = captureNames[numCaptures - numPriorCaptures]; // Capturing group + + if (paren) { + ++numCaptures; // If the current capture has a name, preserve the name + + if (name) { + return "(?<".concat(name, ">"); + } // Backreference + + } else if (backref) { + // Rewrite the backreference + return "\\".concat(+backref + numPriorCaptures); + } + + return match; + } + + if (!(isType(patterns, 'Array') && patterns.length)) { + throw new TypeError('Must provide a nonempty array of patterns to merge'); + } + + var parts = /(\()(?!\?)|\\([1-9]\d*)|\\[\s\S]|\[(?:[^\\\]]|\\[\s\S])*\]/g; + var output = []; + var _iteratorNormalCompletion5 = true; + var _didIteratorError5 = false; + var _iteratorError5 = undefined; + + try { + for (var _iterator5 = patterns[Symbol.iterator](), _step5; !(_iteratorNormalCompletion5 = (_step5 = _iterator5.next()).done); _iteratorNormalCompletion5 = true) { + var pattern = _step5.value; + + if (XRegExp.isRegExp(pattern)) { + numPriorCaptures = numCaptures; + captureNames = pattern[REGEX_DATA] && pattern[REGEX_DATA].captureNames || []; // Rewrite backreferences. Passing to XRegExp dies on octals and ensures patterns are + // independently valid; helps keep this simple. Named captures are put back + + output.push(nativ.replace.call(XRegExp(pattern.source).source, parts, rewrite)); + } else { + output.push(XRegExp.escape(pattern)); + } + } + } catch (err) { + _didIteratorError5 = true; + _iteratorError5 = err; + } finally { + try { + if (!_iteratorNormalCompletion5 && _iterator5.return != null) { + _iterator5.return(); + } + } finally { + if (_didIteratorError5) { + throw _iteratorError5; + } + } + } + + var separator = conjunction === 'none' ? '' : '|'; + return XRegExp(output.join(separator), flags); +}; // ==--------------------------== +// Fixed/extended native methods +// ==--------------------------== + +/** + * Adds named capture support (with backreferences returned as `result.name`), and fixes browser + * bugs in the native `RegExp.prototype.exec`. Use via `XRegExp.exec`. + * + * @memberOf RegExp + * @param {String} str String to search. + * @returns {Array} Match array with named backreference properties, or `null`. + */ + + +fixed.exec = function (str) { + var origLastIndex = this.lastIndex; + var match = nativ.exec.apply(this, arguments); + + if (match) { + // Fix browsers whose `exec` methods don't return `undefined` for nonparticipating capturing + // groups. This fixes IE 5.5-8, but not IE 9's quirks mode or emulation of older IEs. IE 9 + // in standards mode follows the spec. + if (!correctExecNpcg && match.length > 1 && match.indexOf('') !== -1) { + var r2 = copyRegex(this, { + removeG: true, + isInternalOnly: true + }); // Using `str.slice(match.index)` rather than `match[0]` in case lookahead allowed + // matching due to characters outside the match + + nativ.replace.call(String(str).slice(match.index), r2, function () { + var len = arguments.length; // Skip index 0 and the last 2 + + for (var i = 1; i < len - 2; ++i) { + if ((i < 0 || arguments.length <= i ? undefined : arguments[i]) === undefined) { + match[i] = undefined; + } + } + }); + } // Attach named capture properties + + + var groupsObject = match; + + if (XRegExp.isInstalled('namespacing')) { + // https://tc39.github.io/proposal-regexp-named-groups/#sec-regexpbuiltinexec + match.groups = Object.create(null); + groupsObject = match.groups; + } + + if (this[REGEX_DATA] && this[REGEX_DATA].captureNames) { + // Skip index 0 + for (var i = 1; i < match.length; ++i) { + var name = this[REGEX_DATA].captureNames[i - 1]; + + if (name) { + groupsObject[name] = match[i]; + } + } + } // Fix browsers that increment `lastIndex` after zero-length matches + + + if (this.global && !match[0].length && this.lastIndex > match.index) { + this.lastIndex = match.index; + } + } + + if (!this.global) { + // Fixes IE, Opera bug (last tested IE 9, Opera 11.6) + this.lastIndex = origLastIndex; + } + + return match; +}; +/** + * Fixes browser bugs in the native `RegExp.prototype.test`. + * + * @memberOf RegExp + * @param {String} str String to search. + * @returns {Boolean} Whether the regex matched the provided value. + */ + + +fixed.test = function (str) { + // Do this the easy way :-) + return !!fixed.exec.call(this, str); +}; +/** + * Adds named capture support (with backreferences returned as `result.name`), and fixes browser + * bugs in the native `String.prototype.match`. + * + * @memberOf String + * @param {RegExp|*} regex Regex to search with. If not a regex object, it is passed to `RegExp`. + * @returns {Array} If `regex` uses flag g, an array of match strings or `null`. Without flag g, + * the result of calling `regex.exec(this)`. + */ + + +fixed.match = function (regex) { + if (!XRegExp.isRegExp(regex)) { + // Use the native `RegExp` rather than `XRegExp` + regex = new RegExp(regex); + } else if (regex.global) { + var result = nativ.match.apply(this, arguments); // Fixes IE bug + + regex.lastIndex = 0; + return result; + } + + return fixed.exec.call(regex, toObject(this)); +}; +/** + * Adds support for `${n}` (or `$`) tokens for named and numbered backreferences in replacement + * text, and provides named backreferences to replacement functions as `arguments[0].name`. Also + * fixes browser bugs in replacement text syntax when performing a replacement using a nonregex + * search value, and the value of a replacement regex's `lastIndex` property during replacement + * iterations and upon completion. Note that this doesn't support SpiderMonkey's proprietary third + * (`flags`) argument. Use via `XRegExp.replace`. + * + * @memberOf String + * @param {RegExp|String} search Search pattern to be replaced. + * @param {String|Function} replacement Replacement string or a function invoked to create it. + * @returns {String} New string with one or all matches replaced. + */ + + +fixed.replace = function (search, replacement) { + var isRegex = XRegExp.isRegExp(search); + var origLastIndex; + var captureNames; + var result; + + if (isRegex) { + if (search[REGEX_DATA]) { + captureNames = search[REGEX_DATA].captureNames; + } // Only needed if `search` is nonglobal + + + origLastIndex = search.lastIndex; + } else { + search += ''; // Type-convert + } // Don't use `typeof`; some older browsers return 'function' for regex objects + + + if (isType(replacement, 'Function')) { + // Stringifying `this` fixes a bug in IE < 9 where the last argument in replacement + // functions isn't type-converted to a string + result = nativ.replace.call(String(this), search, function () { + for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) { + args[_key] = arguments[_key]; + } + + if (captureNames) { + var groupsObject; + + if (XRegExp.isInstalled('namespacing')) { + // https://tc39.github.io/proposal-regexp-named-groups/#sec-regexpbuiltinexec + groupsObject = Object.create(null); + args.push(groupsObject); + } else { + // Change the `args[0]` string primitive to a `String` object that can store + // properties. This really does need to use `String` as a constructor + args[0] = new String(args[0]); + groupsObject = args[0]; + } // Store named backreferences + + + for (var i = 0; i < captureNames.length; ++i) { + if (captureNames[i]) { + groupsObject[captureNames[i]] = args[i + 1]; + } + } + } // Update `lastIndex` before calling `replacement`. Fixes IE, Chrome, Firefox, Safari + // bug (last tested IE 9, Chrome 17, Firefox 11, Safari 5.1) + + + if (isRegex && search.global) { + search.lastIndex = args[args.length - 2] + args[0].length; + } // ES6 specs the context for replacement functions as `undefined` + + + return replacement.apply(void 0, args); + }); + } else { + // Ensure that the last value of `args` will be a string when given nonstring `this`, + // while still throwing on null or undefined context + result = nativ.replace.call(this == null ? this : String(this), search, function () { + for (var _len2 = arguments.length, args = new Array(_len2), _key2 = 0; _key2 < _len2; _key2++) { + args[_key2] = arguments[_key2]; + } + + return nativ.replace.call(String(replacement), replacementToken, replacer); + + function replacer($0, bracketed, angled, dollarToken) { + bracketed = bracketed || angled; // Named or numbered backreference with curly or angled braces + + if (bracketed) { + // XRegExp behavior for `${n}` or `$`: + // 1. Backreference to numbered capture, if `n` is an integer. Use `0` for the + // entire match. Any number of leading zeros may be used. + // 2. Backreference to named capture `n`, if it exists and is not an integer + // overridden by numbered capture. In practice, this does not overlap with + // numbered capture since XRegExp does not allow named capture to use a bare + // integer as the name. + // 3. If the name or number does not refer to an existing capturing group, it's + // an error. + var n = +bracketed; // Type-convert; drop leading zeros + + if (n <= args.length - 3) { + return args[n] || ''; + } // Groups with the same name is an error, else would need `lastIndexOf` + + + n = captureNames ? captureNames.indexOf(bracketed) : -1; + + if (n < 0) { + throw new SyntaxError("Backreference to undefined group ".concat($0)); + } + + return args[n + 1] || ''; + } // Else, special variable or numbered backreference without curly braces + + + if (dollarToken === '$') { + // $$ + return '$'; + } + + if (dollarToken === '&' || +dollarToken === 0) { + // $&, $0 (not followed by 1-9), $00 + return args[0]; + } + + if (dollarToken === '`') { + // $` (left context) + return args[args.length - 1].slice(0, args[args.length - 2]); + } + + if (dollarToken === "'") { + // $' (right context) + return args[args.length - 1].slice(args[args.length - 2] + args[0].length); + } // Else, numbered backreference without braces + + + dollarToken = +dollarToken; // Type-convert; drop leading zero + // XRegExp behavior for `$n` and `$nn`: + // - Backrefs end after 1 or 2 digits. Use `${..}` or `$<..>` for more digits. + // - `$1` is an error if no capturing groups. + // - `$10` is an error if less than 10 capturing groups. Use `${1}0` or `$<1>0` + // instead. + // - `$01` is `$1` if at least one capturing group, else it's an error. + // - `$0` (not followed by 1-9) and `$00` are the entire match. + // Native behavior, for comparison: + // - Backrefs end after 1 or 2 digits. Cannot reference capturing group 100+. + // - `$1` is a literal `$1` if no capturing groups. + // - `$10` is `$1` followed by a literal `0` if less than 10 capturing groups. + // - `$01` is `$1` if at least one capturing group, else it's a literal `$01`. + // - `$0` is a literal `$0`. + + if (!isNaN(dollarToken)) { + if (dollarToken > args.length - 3) { + throw new SyntaxError("Backreference to undefined group ".concat($0)); + } + + return args[dollarToken] || ''; + } // `$` followed by an unsupported char is an error, unlike native JS + + + throw new SyntaxError("Invalid token ".concat($0)); + } + }); + } + + if (isRegex) { + if (search.global) { + // Fixes IE, Safari bug (last tested IE 9, Safari 5.1) + search.lastIndex = 0; + } else { + // Fixes IE, Opera bug (last tested IE 9, Opera 11.6) + search.lastIndex = origLastIndex; + } + } + + return result; +}; +/** + * Fixes browser bugs in the native `String.prototype.split`. Use via `XRegExp.split`. + * + * @memberOf String + * @param {RegExp|String} separator Regex or string to use for separating the string. + * @param {Number} [limit] Maximum number of items to include in the result array. + * @returns {Array} Array of substrings. + */ + + +fixed.split = function (separator, limit) { + if (!XRegExp.isRegExp(separator)) { + // Browsers handle nonregex split correctly, so use the faster native method + return nativ.split.apply(this, arguments); + } + + var str = String(this); + var output = []; + var origLastIndex = separator.lastIndex; + var lastLastIndex = 0; + var lastLength; // Values for `limit`, per the spec: + // If undefined: pow(2,32) - 1 + // If 0, Infinity, or NaN: 0 + // If positive number: limit = floor(limit); if (limit >= pow(2,32)) limit -= pow(2,32); + // If negative number: pow(2,32) - floor(abs(limit)) + // If other: Type-convert, then use the above rules + // This line fails in very strange ways for some values of `limit` in Opera 10.5-10.63, unless + // Opera Dragonfly is open (go figure). It works in at least Opera 9.5-10.1 and 11+ + + limit = (limit === undefined ? -1 : limit) >>> 0; + XRegExp.forEach(str, separator, function (match) { + // This condition is not the same as `if (match[0].length)` + if (match.index + match[0].length > lastLastIndex) { + output.push(str.slice(lastLastIndex, match.index)); + + if (match.length > 1 && match.index < str.length) { + Array.prototype.push.apply(output, match.slice(1)); + } + + lastLength = match[0].length; + lastLastIndex = match.index + lastLength; + } + }); + + if (lastLastIndex === str.length) { + if (!nativ.test.call(separator, '') || lastLength) { + output.push(''); + } + } else { + output.push(str.slice(lastLastIndex)); + } + + separator.lastIndex = origLastIndex; + return output.length > limit ? output.slice(0, limit) : output; +}; // ==--------------------------== +// Built-in syntax/flag tokens +// ==--------------------------== + +/* + * Letter escapes that natively match literal characters: `\a`, `\A`, etc. These should be + * SyntaxErrors but are allowed in web reality. XRegExp makes them errors for cross-browser + * consistency and to reserve their syntax, but lets them be superseded by addons. + */ + + +XRegExp.addToken(/\\([ABCE-RTUVXYZaeg-mopqyz]|c(?![A-Za-z])|u(?![\dA-Fa-f]{4}|{[\dA-Fa-f]+})|x(?![\dA-Fa-f]{2}))/, function (match, scope) { + // \B is allowed in default scope only + if (match[1] === 'B' && scope === defaultScope) { + return match[0]; + } + + throw new SyntaxError("Invalid escape ".concat(match[0])); +}, { + scope: 'all', + leadChar: '\\' +}); +/* + * Unicode code point escape with curly braces: `\u{N..}`. `N..` is any one or more digit + * hexadecimal number from 0-10FFFF, and can include leading zeros. Requires the native ES6 `u` flag + * to support code points greater than U+FFFF. Avoids converting code points above U+FFFF to + * surrogate pairs (which could be done without flag `u`), since that could lead to broken behavior + * if you follow a `\u{N..}` token that references a code point above U+FFFF with a quantifier, or + * if you use the same in a character class. + */ + +XRegExp.addToken(/\\u{([\dA-Fa-f]+)}/, function (match, scope, flags) { + var code = dec(match[1]); + + if (code > 0x10FFFF) { + throw new SyntaxError("Invalid Unicode code point ".concat(match[0])); + } + + if (code <= 0xFFFF) { + // Converting to \uNNNN avoids needing to escape the literal character and keep it + // separate from preceding tokens + return "\\u".concat(pad4(hex(code))); + } // If `code` is between 0xFFFF and 0x10FFFF, require and defer to native handling + + + if (hasNativeU && flags.indexOf('u') !== -1) { + return match[0]; + } + + throw new SyntaxError('Cannot use Unicode code point above \\u{FFFF} without flag u'); +}, { + scope: 'all', + leadChar: '\\' +}); +/* + * Empty character class: `[]` or `[^]`. This fixes a critical cross-browser syntax inconsistency. + * Unless this is standardized (per the ES spec), regex syntax can't be accurately parsed because + * character class endings can't be determined. + */ + +XRegExp.addToken(/\[(\^?)\]/, // For cross-browser compatibility with ES3, convert [] to \b\B and [^] to [\s\S]. +// (?!) should work like \b\B, but is unreliable in some versions of Firefox + +/* eslint-disable no-confusing-arrow */ +function (match) { + return match[1] ? '[\\s\\S]' : '\\b\\B'; +}, +/* eslint-enable no-confusing-arrow */ +{ + leadChar: '[' +}); +/* + * Comment pattern: `(?# )`. Inline comments are an alternative to the line comments allowed in + * free-spacing mode (flag x). + */ + +XRegExp.addToken(/\(\?#[^)]*\)/, getContextualTokenSeparator, { + leadChar: '(' +}); +/* + * Whitespace and line comments, in free-spacing mode (aka extended mode, flag x) only. + */ + +XRegExp.addToken(/\s+|#[^\n]*\n?/, getContextualTokenSeparator, { + flag: 'x' +}); +/* + * Dot, in dotall mode (aka singleline mode, flag s) only. + */ + +XRegExp.addToken(/\./, function () { + return '[\\s\\S]'; +}, { + flag: 's', + leadChar: '.' +}); +/* + * Named backreference: `\k`. Backreference names can use the characters A-Z, a-z, 0-9, _, + * and $ only. Also allows numbered backreferences as `\k`. + */ + +XRegExp.addToken(/\\k<([\w$]+)>/, function (match) { + // Groups with the same name is an error, else would need `lastIndexOf` + var index = isNaN(match[1]) ? this.captureNames.indexOf(match[1]) + 1 : +match[1]; + var endIndex = match.index + match[0].length; + + if (!index || index > this.captureNames.length) { + throw new SyntaxError("Backreference to undefined group ".concat(match[0])); + } // Keep backreferences separate from subsequent literal numbers. This avoids e.g. + // inadvertedly changing `(?)\k1` to `()\11`. + + + return "\\".concat(index).concat(endIndex === match.input.length || isNaN(match.input[endIndex]) ? '' : '(?:)'); +}, { + leadChar: '\\' +}); +/* + * Numbered backreference or octal, plus any following digits: `\0`, `\11`, etc. Octals except `\0` + * not followed by 0-9 and backreferences to unopened capture groups throw an error. Other matches + * are returned unaltered. IE < 9 doesn't support backreferences above `\99` in regex syntax. + */ + +XRegExp.addToken(/\\(\d+)/, function (match, scope) { + if (!(scope === defaultScope && /^[1-9]/.test(match[1]) && +match[1] <= this.captureNames.length) && match[1] !== '0') { + throw new SyntaxError("Cannot use octal escape or backreference to undefined group ".concat(match[0])); + } + + return match[0]; +}, { + scope: 'all', + leadChar: '\\' +}); +/* + * Named capturing group; match the opening delimiter only: `(?`. Capture names can use the + * characters A-Z, a-z, 0-9, _, and $ only. Names can't be integers. Supports Python-style + * `(?P` as an alternate syntax to avoid issues in some older versions of Opera which natively + * supported the Python-style syntax. Otherwise, XRegExp might treat numbered backreferences to + * Python-style named capture as octals. + */ + +XRegExp.addToken(/\(\?P?<([\w$]+)>/, function (match) { + // Disallow bare integers as names because named backreferences are added to match arrays + // and therefore numeric properties may lead to incorrect lookups + if (!isNaN(match[1])) { + throw new SyntaxError("Cannot use integer as capture name ".concat(match[0])); + } + + if (!XRegExp.isInstalled('namespacing') && (match[1] === 'length' || match[1] === '__proto__')) { + throw new SyntaxError("Cannot use reserved word as capture name ".concat(match[0])); + } + + if (this.captureNames.indexOf(match[1]) !== -1) { + throw new SyntaxError("Cannot use same name for multiple groups ".concat(match[0])); + } + + this.captureNames.push(match[1]); + this.hasNamedCapture = true; + return '('; +}, { + leadChar: '(' +}); +/* + * Capturing group; match the opening parenthesis only. Required for support of named capturing + * groups. Also adds explicit capture mode (flag n). + */ + +XRegExp.addToken(/\((?!\?)/, function (match, scope, flags) { + if (flags.indexOf('n') !== -1) { + return '(?:'; + } + + this.captureNames.push(null); + return '('; +}, { + optionalFlags: 'n', + leadChar: '(' +}); +var _default = XRegExp; +exports.default = _default; +module.exports = exports["default"]; +}); + +unwrapExports(xregexp); + +var build = createCommonjsModule(function (module, exports) { +"use strict"; + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.default = void 0; + +/*! + * XRegExp.build 4.2.0 + * + * Steven Levithan (c) 2012-present MIT License + */ +var _default = function _default(XRegExp) { + var REGEX_DATA = 'xregexp'; + var subParts = /(\()(?!\?)|\\([1-9]\d*)|\\[\s\S]|\[(?:[^\\\]]|\\[\s\S])*\]/g; + var parts = XRegExp.union([/\({{([\w$]+)}}\)|{{([\w$]+)}}/, subParts], 'g', { + conjunction: 'or' + }); + /** + * Strips a leading `^` and trailing unescaped `$`, if both are present. + * + * @private + * @param {String} pattern Pattern to process. + * @returns {String} Pattern with edge anchors removed. + */ + + function deanchor(pattern) { + // Allow any number of empty noncapturing groups before/after anchors, because regexes + // built/generated by XRegExp sometimes include them + var leadingAnchor = /^(?:\(\?:\))*\^/; + var trailingAnchor = /\$(?:\(\?:\))*$/; + + if (leadingAnchor.test(pattern) && trailingAnchor.test(pattern) && // Ensure that the trailing `$` isn't escaped + trailingAnchor.test(pattern.replace(/\\[\s\S]/g, ''))) { + return pattern.replace(leadingAnchor, '').replace(trailingAnchor, ''); + } + + return pattern; + } + /** + * Converts the provided value to an XRegExp. Native RegExp flags are not preserved. + * + * @private + * @param {String|RegExp} value Value to convert. + * @param {Boolean} [addFlagX] Whether to apply the `x` flag in cases when `value` is not + * already a regex generated by XRegExp + * @returns {RegExp} XRegExp object with XRegExp syntax applied. + */ + + + function asXRegExp(value, addFlagX) { + var flags = addFlagX ? 'x' : ''; + return XRegExp.isRegExp(value) ? value[REGEX_DATA] && value[REGEX_DATA].captureNames ? // Don't recompile, to preserve capture names + value : // Recompile as XRegExp + XRegExp(value.source, flags) : // Compile string as XRegExp + XRegExp(value, flags); + } + + function interpolate(substitution) { + return substitution instanceof RegExp ? substitution : XRegExp.escape(substitution); + } + + function reduceToSubpatternsObject(subpatterns, interpolated, subpatternIndex) { + subpatterns["subpattern".concat(subpatternIndex)] = interpolated; + return subpatterns; + } + + function embedSubpatternAfter(raw, subpatternIndex, rawLiterals) { + var hasSubpattern = subpatternIndex < rawLiterals.length - 1; + return raw + (hasSubpattern ? "{{subpattern".concat(subpatternIndex, "}}") : ''); + } + /** + * Provides tagged template literals that create regexes with XRegExp syntax and flags. The + * provided pattern is handled as a raw string, so backslashes don't need to be escaped. + * + * Interpolation of strings and regexes shares the features of `XRegExp.build`. Interpolated + * patterns are treated as atomic units when quantified, interpolated strings have their special + * characters escaped, a leading `^` and trailing unescaped `$` are stripped from interpolated + * regexes if both are present, and any backreferences within an interpolated regex are + * rewritten to work within the overall pattern. + * + * @memberOf XRegExp + * @param {String} [flags] Any combination of XRegExp flags. + * @returns {Function} Handler for template literals that construct regexes with XRegExp syntax. + * @example + * + * const h12 = /1[0-2]|0?[1-9]/; + * const h24 = /2[0-3]|[01][0-9]/; + * const hours = XRegExp.tag('x')`${h12} : | ${h24}`; + * const minutes = /^[0-5][0-9]$/; + * // Note that explicitly naming the 'minutes' group is required for named backreferences + * const time = XRegExp.tag('x')`^ ${hours} (?${minutes}) $`; + * time.test('10:59'); // -> true + * XRegExp.exec('10:59', time).minutes; // -> '59' + */ + + + XRegExp.tag = function (flags) { + return function (literals) { + for (var _len = arguments.length, substitutions = new Array(_len > 1 ? _len - 1 : 0), _key = 1; _key < _len; _key++) { + substitutions[_key - 1] = arguments[_key]; + } + + var subpatterns = substitutions.map(interpolate).reduce(reduceToSubpatternsObject, {}); + var pattern = literals.raw.map(embedSubpatternAfter).join(''); + return XRegExp.build(pattern, subpatterns, flags); + }; + }; + /** + * Builds regexes using named subpatterns, for readability and pattern reuse. Backreferences in + * the outer pattern and provided subpatterns are automatically renumbered to work correctly. + * Native flags used by provided subpatterns are ignored in favor of the `flags` argument. + * + * @memberOf XRegExp + * @param {String} pattern XRegExp pattern using `{{name}}` for embedded subpatterns. Allows + * `({{name}})` as shorthand for `(?{{name}})`. Patterns cannot be embedded within + * character classes. + * @param {Object} subs Lookup object for named subpatterns. Values can be strings or regexes. A + * leading `^` and trailing unescaped `$` are stripped from subpatterns, if both are present. + * @param {String} [flags] Any combination of XRegExp flags. + * @returns {RegExp} Regex with interpolated subpatterns. + * @example + * + * const time = XRegExp.build('(?x)^ {{hours}} ({{minutes}}) $', { + * hours: XRegExp.build('{{h12}} : | {{h24}}', { + * h12: /1[0-2]|0?[1-9]/, + * h24: /2[0-3]|[01][0-9]/ + * }, 'x'), + * minutes: /^[0-5][0-9]$/ + * }); + * time.test('10:59'); // -> true + * XRegExp.exec('10:59', time).minutes; // -> '59' + */ + + + XRegExp.build = function (pattern, subs, flags) { + flags = flags || ''; // Used with `asXRegExp` calls for `pattern` and subpatterns in `subs`, to work around how + // some browsers convert `RegExp('\n')` to a regex that contains the literal characters `\` + // and `n`. See more details at . + + var addFlagX = flags.indexOf('x') !== -1; + var inlineFlags = /^\(\?([\w$]+)\)/.exec(pattern); // Add flags within a leading mode modifier to the overall pattern's flags + + if (inlineFlags) { + flags = XRegExp._clipDuplicates(flags + inlineFlags[1]); + } + + var data = {}; + + for (var p in subs) { + if (subs.hasOwnProperty(p)) { + // Passing to XRegExp enables extended syntax and ensures independent validity, + // lest an unescaped `(`, `)`, `[`, or trailing `\` breaks the `(?:)` wrapper. For + // subpatterns provided as native regexes, it dies on octals and adds the property + // used to hold extended regex instance data, for simplicity. + var sub = asXRegExp(subs[p], addFlagX); + data[p] = { + // Deanchoring allows embedding independently useful anchored regexes. If you + // really need to keep your anchors, double them (i.e., `^^...$$`). + pattern: deanchor(sub.source), + names: sub[REGEX_DATA].captureNames || [] + }; + } + } // Passing to XRegExp dies on octals and ensures the outer pattern is independently valid; + // helps keep this simple. Named captures will be put back. + + + var patternAsRegex = asXRegExp(pattern, addFlagX); // 'Caps' is short for 'captures' + + var numCaps = 0; + var numPriorCaps; + var numOuterCaps = 0; + var outerCapsMap = [0]; + var outerCapNames = patternAsRegex[REGEX_DATA].captureNames || []; + var output = patternAsRegex.source.replace(parts, function ($0, $1, $2, $3, $4) { + var subName = $1 || $2; + var capName; + var intro; + var localCapIndex; // Named subpattern + + if (subName) { + if (!data.hasOwnProperty(subName)) { + throw new ReferenceError("Undefined property ".concat($0)); + } // Named subpattern was wrapped in a capturing group + + + if ($1) { + capName = outerCapNames[numOuterCaps]; + outerCapsMap[++numOuterCaps] = ++numCaps; // If it's a named group, preserve the name. Otherwise, use the subpattern name + // as the capture name + + intro = "(?<".concat(capName || subName, ">"); + } else { + intro = '(?:'; + } + + numPriorCaps = numCaps; + var rewrittenSubpattern = data[subName].pattern.replace(subParts, function (match, paren, backref) { + // Capturing group + if (paren) { + capName = data[subName].names[numCaps - numPriorCaps]; + ++numCaps; // If the current capture has a name, preserve the name + + if (capName) { + return "(?<".concat(capName, ">"); + } // Backreference + + } else if (backref) { + localCapIndex = +backref - 1; // Rewrite the backreference + + return data[subName].names[localCapIndex] ? // Need to preserve the backreference name in case using flag `n` + "\\k<".concat(data[subName].names[localCapIndex], ">") : "\\".concat(+backref + numPriorCaps); + } + + return match; + }); + return "".concat(intro).concat(rewrittenSubpattern, ")"); + } // Capturing group + + + if ($3) { + capName = outerCapNames[numOuterCaps]; + outerCapsMap[++numOuterCaps] = ++numCaps; // If the current capture has a name, preserve the name + + if (capName) { + return "(?<".concat(capName, ">"); + } // Backreference + + } else if ($4) { + localCapIndex = +$4 - 1; // Rewrite the backreference + + return outerCapNames[localCapIndex] ? // Need to preserve the backreference name in case using flag `n` + "\\k<".concat(outerCapNames[localCapIndex], ">") : "\\".concat(outerCapsMap[+$4]); + } + + return $0; + }); + return XRegExp(output, flags); + }; +}; + +exports.default = _default; +module.exports = exports["default"]; +}); + +unwrapExports(build); + +var matchrecursive = createCommonjsModule(function (module, exports) { +"use strict"; + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.default = void 0; + +/*! + * XRegExp.matchRecursive 4.2.0 + * + * Steven Levithan (c) 2009-present MIT License + */ +var _default = function _default(XRegExp) { + /** + * Returns a match detail object composed of the provided values. + * + * @private + */ + function row(name, value, start, end) { + return { + name: name, + value: value, + start: start, + end: end + }; + } + /** + * Returns an array of match strings between outermost left and right delimiters, or an array of + * objects with detailed match parts and position data. An error is thrown if delimiters are + * unbalanced within the data. + * + * @memberOf XRegExp + * @param {String} str String to search. + * @param {String} left Left delimiter as an XRegExp pattern. + * @param {String} right Right delimiter as an XRegExp pattern. + * @param {String} [flags] Any native or XRegExp flags, used for the left and right delimiters. + * @param {Object} [options] Lets you specify `valueNames` and `escapeChar` options. + * @returns {Array} Array of matches, or an empty array. + * @example + * + * // Basic usage + * let str = '(t((e))s)t()(ing)'; + * XRegExp.matchRecursive(str, '\\(', '\\)', 'g'); + * // -> ['t((e))s', '', 'ing'] + * + * // Extended information mode with valueNames + * str = 'Here is
an
example'; + * XRegExp.matchRecursive(str, '', '', 'gi', { + * valueNames: ['between', 'left', 'match', 'right'] + * }); + * // -> [ + * // {name: 'between', value: 'Here is ', start: 0, end: 8}, + * // {name: 'left', value: '
', start: 8, end: 13}, + * // {name: 'match', value: '
an
', start: 13, end: 27}, + * // {name: 'right', value: '
', start: 27, end: 33}, + * // {name: 'between', value: ' example', start: 33, end: 41} + * // ] + * + * // Omitting unneeded parts with null valueNames, and using escapeChar + * str = '...{1}.\\{{function(x,y){return {y:x}}}'; + * XRegExp.matchRecursive(str, '{', '}', 'g', { + * valueNames: ['literal', null, 'value', null], + * escapeChar: '\\' + * }); + * // -> [ + * // {name: 'literal', value: '...', start: 0, end: 3}, + * // {name: 'value', value: '1', start: 4, end: 5}, + * // {name: 'literal', value: '.\\{', start: 6, end: 9}, + * // {name: 'value', value: 'function(x,y){return {y:x}}', start: 10, end: 37} + * // ] + * + * // Sticky mode via flag y + * str = '<1><<<2>>><3>4<5>'; + * XRegExp.matchRecursive(str, '<', '>', 'gy'); + * // -> ['1', '<<2>>', '3'] + */ + + + XRegExp.matchRecursive = function (str, left, right, flags, options) { + flags = flags || ''; + options = options || {}; + var global = flags.indexOf('g') !== -1; + var sticky = flags.indexOf('y') !== -1; // Flag `y` is controlled internally + + var basicFlags = flags.replace(/y/g, ''); + var _options = options, + escapeChar = _options.escapeChar; + var vN = options.valueNames; + var output = []; + var openTokens = 0; + var delimStart = 0; + var delimEnd = 0; + var lastOuterEnd = 0; + var outerStart; + var innerStart; + var leftMatch; + var rightMatch; + var esc; + left = XRegExp(left, basicFlags); + right = XRegExp(right, basicFlags); + + if (escapeChar) { + if (escapeChar.length > 1) { + throw new Error('Cannot use more than one escape character'); + } + + escapeChar = XRegExp.escape(escapeChar); // Example of concatenated `esc` regex: + // `escapeChar`: '%' + // `left`: '<' + // `right`: '>' + // Regex is: /(?:%[\S\s]|(?:(?!<|>)[^%])+)+/ + + esc = new RegExp("(?:".concat(escapeChar, "[\\S\\s]|(?:(?!").concat( // Using `XRegExp.union` safely rewrites backreferences in `left` and `right`. + // Intentionally not passing `basicFlags` to `XRegExp.union` since any syntax + // transformation resulting from those flags was already applied to `left` and + // `right` when they were passed through the XRegExp constructor above. + XRegExp.union([left, right], '', { + conjunction: 'or' + }).source, ")[^").concat(escapeChar, "])+)+"), // Flags `gy` not needed here + flags.replace(/[^imu]+/g, '')); + } + + while (true) { + // If using an escape character, advance to the delimiter's next starting position, + // skipping any escaped characters in between + if (escapeChar) { + delimEnd += (XRegExp.exec(str, esc, delimEnd, 'sticky') || [''])[0].length; + } + + leftMatch = XRegExp.exec(str, left, delimEnd); + rightMatch = XRegExp.exec(str, right, delimEnd); // Keep the leftmost match only + + if (leftMatch && rightMatch) { + if (leftMatch.index <= rightMatch.index) { + rightMatch = null; + } else { + leftMatch = null; + } + } // Paths (LM: leftMatch, RM: rightMatch, OT: openTokens): + // LM | RM | OT | Result + // 1 | 0 | 1 | loop + // 1 | 0 | 0 | loop + // 0 | 1 | 1 | loop + // 0 | 1 | 0 | throw + // 0 | 0 | 1 | throw + // 0 | 0 | 0 | break + // The paths above don't include the sticky mode special case. The loop ends after the + // first completed match if not `global`. + + + if (leftMatch || rightMatch) { + delimStart = (leftMatch || rightMatch).index; + delimEnd = delimStart + (leftMatch || rightMatch)[0].length; + } else if (!openTokens) { + break; + } + + if (sticky && !openTokens && delimStart > lastOuterEnd) { + break; + } + + if (leftMatch) { + if (!openTokens) { + outerStart = delimStart; + innerStart = delimEnd; + } + + ++openTokens; + } else if (rightMatch && openTokens) { + if (! --openTokens) { + if (vN) { + if (vN[0] && outerStart > lastOuterEnd) { + output.push(row(vN[0], str.slice(lastOuterEnd, outerStart), lastOuterEnd, outerStart)); + } + + if (vN[1]) { + output.push(row(vN[1], str.slice(outerStart, innerStart), outerStart, innerStart)); + } + + if (vN[2]) { + output.push(row(vN[2], str.slice(innerStart, delimStart), innerStart, delimStart)); + } + + if (vN[3]) { + output.push(row(vN[3], str.slice(delimStart, delimEnd), delimStart, delimEnd)); + } + } else { + output.push(str.slice(innerStart, delimStart)); + } + + lastOuterEnd = delimEnd; + + if (!global) { + break; + } + } + } else { + throw new Error('Unbalanced delimiter found in string'); + } // If the delimiter matched an empty string, avoid an infinite loop + + + if (delimStart === delimEnd) { + ++delimEnd; + } + } + + if (global && !sticky && vN && vN[0] && str.length > lastOuterEnd) { + output.push(row(vN[0], str.slice(lastOuterEnd), lastOuterEnd, str.length)); + } + + return output; + }; +}; + +exports.default = _default; +module.exports = exports["default"]; +}); + +unwrapExports(matchrecursive); + +var unicodeBase = createCommonjsModule(function (module, exports) { +"use strict"; + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.default = void 0; + +/*! + * XRegExp Unicode Base 4.2.0 + * + * Steven Levithan (c) 2008-present MIT License + */ +var _default = function _default(XRegExp) { + /** + * Adds base support for Unicode matching: + * - Adds syntax `\p{..}` for matching Unicode tokens. Tokens can be inverted using `\P{..}` or + * `\p{^..}`. Token names ignore case, spaces, hyphens, and underscores. You can omit the + * braces for token names that are a single letter (e.g. `\pL` or `PL`). + * - Adds flag A (astral), which enables 21-bit Unicode support. + * - Adds the `XRegExp.addUnicodeData` method used by other addons to provide character data. + * + * Unicode Base relies on externally provided Unicode character data. Official addons are + * available to provide data for Unicode categories, scripts, blocks, and properties. + * + * @requires XRegExp + */ + // ==--------------------------== + // Private stuff + // ==--------------------------== + // Storage for Unicode data + var unicode = {}; // Reuse utils + + var dec = XRegExp._dec; + var hex = XRegExp._hex; + var pad4 = XRegExp._pad4; // Generates a token lookup name: lowercase, with hyphens, spaces, and underscores removed + + function normalize(name) { + return name.replace(/[- _]+/g, '').toLowerCase(); + } // Gets the decimal code of a literal code unit, \xHH, \uHHHH, or a backslash-escaped literal + + + function charCode(chr) { + var esc = /^\\[xu](.+)/.exec(chr); + return esc ? dec(esc[1]) : chr.charCodeAt(chr[0] === '\\' ? 1 : 0); + } // Inverts a list of ordered BMP characters and ranges + + + function invertBmp(range) { + var output = ''; + var lastEnd = -1; + XRegExp.forEach(range, /(\\x..|\\u....|\\?[\s\S])(?:-(\\x..|\\u....|\\?[\s\S]))?/, function (m) { + var start = charCode(m[1]); + + if (start > lastEnd + 1) { + output += "\\u".concat(pad4(hex(lastEnd + 1))); + + if (start > lastEnd + 2) { + output += "-\\u".concat(pad4(hex(start - 1))); + } + } + + lastEnd = charCode(m[2] || m[1]); + }); + + if (lastEnd < 0xFFFF) { + output += "\\u".concat(pad4(hex(lastEnd + 1))); + + if (lastEnd < 0xFFFE) { + output += '-\\uFFFF'; + } + } + + return output; + } // Generates an inverted BMP range on first use + + + function cacheInvertedBmp(slug) { + var prop = 'b!'; + return unicode[slug][prop] || (unicode[slug][prop] = invertBmp(unicode[slug].bmp)); + } // Combines and optionally negates BMP and astral data + + + function buildAstral(slug, isNegated) { + var item = unicode[slug]; + var combined = ''; + + if (item.bmp && !item.isBmpLast) { + combined = "[".concat(item.bmp, "]").concat(item.astral ? '|' : ''); + } + + if (item.astral) { + combined += item.astral; + } + + if (item.isBmpLast && item.bmp) { + combined += "".concat(item.astral ? '|' : '', "[").concat(item.bmp, "]"); + } // Astral Unicode tokens always match a code point, never a code unit + + + return isNegated ? "(?:(?!".concat(combined, ")(?:[\uD800-\uDBFF][\uDC00-\uDFFF]|[\0-\uFFFF]))") : "(?:".concat(combined, ")"); + } // Builds a complete astral pattern on first use + + + function cacheAstral(slug, isNegated) { + var prop = isNegated ? 'a!' : 'a='; + return unicode[slug][prop] || (unicode[slug][prop] = buildAstral(slug, isNegated)); + } // ==--------------------------== + // Core functionality + // ==--------------------------== + + /* + * Add astral mode (flag A) and Unicode token syntax: `\p{..}`, `\P{..}`, `\p{^..}`, `\pC`. + */ + + + XRegExp.addToken( // Use `*` instead of `+` to avoid capturing `^` as the token name in `\p{^}` + /\\([pP])(?:{(\^?)([^}]*)}|([A-Za-z]))/, function (match, scope, flags) { + var ERR_DOUBLE_NEG = 'Invalid double negation '; + var ERR_UNKNOWN_NAME = 'Unknown Unicode token '; + var ERR_UNKNOWN_REF = 'Unicode token missing data '; + var ERR_ASTRAL_ONLY = 'Astral mode required for Unicode token '; + var ERR_ASTRAL_IN_CLASS = 'Astral mode does not support Unicode tokens within character classes'; // Negated via \P{..} or \p{^..} + + var isNegated = match[1] === 'P' || !!match[2]; // Switch from BMP (0-FFFF) to astral (0-10FFFF) mode via flag A + + var isAstralMode = flags.indexOf('A') !== -1; // Token lookup name. Check `[4]` first to avoid passing `undefined` via `\p{}` + + var slug = normalize(match[4] || match[3]); // Token data object + + var item = unicode[slug]; + + if (match[1] === 'P' && match[2]) { + throw new SyntaxError(ERR_DOUBLE_NEG + match[0]); + } + + if (!unicode.hasOwnProperty(slug)) { + throw new SyntaxError(ERR_UNKNOWN_NAME + match[0]); + } // Switch to the negated form of the referenced Unicode token + + + if (item.inverseOf) { + slug = normalize(item.inverseOf); + + if (!unicode.hasOwnProperty(slug)) { + throw new ReferenceError("".concat(ERR_UNKNOWN_REF + match[0], " -> ").concat(item.inverseOf)); + } + + item = unicode[slug]; + isNegated = !isNegated; + } + + if (!(item.bmp || isAstralMode)) { + throw new SyntaxError(ERR_ASTRAL_ONLY + match[0]); + } + + if (isAstralMode) { + if (scope === 'class') { + throw new SyntaxError(ERR_ASTRAL_IN_CLASS); + } + + return cacheAstral(slug, isNegated); + } + + return scope === 'class' ? isNegated ? cacheInvertedBmp(slug) : item.bmp : "".concat((isNegated ? '[^' : '[') + item.bmp, "]"); + }, { + scope: 'all', + optionalFlags: 'A', + leadChar: '\\' + }); + /** + * Adds to the list of Unicode tokens that XRegExp regexes can match via `\p` or `\P`. + * + * @memberOf XRegExp + * @param {Array} data Objects with named character ranges. Each object may have properties + * `name`, `alias`, `isBmpLast`, `inverseOf`, `bmp`, and `astral`. All but `name` are + * optional, although one of `bmp` or `astral` is required (unless `inverseOf` is set). If + * `astral` is absent, the `bmp` data is used for BMP and astral modes. If `bmp` is absent, + * the name errors in BMP mode but works in astral mode. If both `bmp` and `astral` are + * provided, the `bmp` data only is used in BMP mode, and the combination of `bmp` and + * `astral` data is used in astral mode. `isBmpLast` is needed when a token matches orphan + * high surrogates *and* uses surrogate pairs to match astral code points. The `bmp` and + * `astral` data should be a combination of literal characters and `\xHH` or `\uHHHH` escape + * sequences, with hyphens to create ranges. Any regex metacharacters in the data should be + * escaped, apart from range-creating hyphens. The `astral` data can additionally use + * character classes and alternation, and should use surrogate pairs to represent astral code + * points. `inverseOf` can be used to avoid duplicating character data if a Unicode token is + * defined as the exact inverse of another token. + * @example + * + * // Basic use + * XRegExp.addUnicodeData([{ + * name: 'XDigit', + * alias: 'Hexadecimal', + * bmp: '0-9A-Fa-f' + * }]); + * XRegExp('\\p{XDigit}:\\p{Hexadecimal}+').test('0:3D'); // -> true + */ + + XRegExp.addUnicodeData = function (data) { + var ERR_NO_NAME = 'Unicode token requires name'; + var ERR_NO_DATA = 'Unicode token has no character data '; + var _iteratorNormalCompletion = true; + var _didIteratorError = false; + var _iteratorError = undefined; + + try { + for (var _iterator = data[Symbol.iterator](), _step; !(_iteratorNormalCompletion = (_step = _iterator.next()).done); _iteratorNormalCompletion = true) { + var item = _step.value; + + if (!item.name) { + throw new Error(ERR_NO_NAME); + } + + if (!(item.inverseOf || item.bmp || item.astral)) { + throw new Error(ERR_NO_DATA + item.name); + } + + unicode[normalize(item.name)] = item; + + if (item.alias) { + unicode[normalize(item.alias)] = item; + } + } // Reset the pattern cache used by the `XRegExp` constructor, since the same pattern and + // flags might now produce different results + + } catch (err) { + _didIteratorError = true; + _iteratorError = err; + } finally { + try { + if (!_iteratorNormalCompletion && _iterator.return != null) { + _iterator.return(); + } + } finally { + if (_didIteratorError) { + throw _iteratorError; + } + } + } + + XRegExp.cache.flush('patterns'); + }; + /** + * @ignore + * + * Return a reference to the internal Unicode definition structure for the given Unicode + * Property if the given name is a legal Unicode Property for use in XRegExp `\p` or `\P` regex + * constructs. + * + * @memberOf XRegExp + * @param {String} name Name by which the Unicode Property may be recognized (case-insensitive), + * e.g. `'N'` or `'Number'`. The given name is matched against all registered Unicode + * Properties and Property Aliases. + * @returns {Object} Reference to definition structure when the name matches a Unicode Property. + * + * @note + * For more info on Unicode Properties, see also http://unicode.org/reports/tr18/#Categories. + * + * @note + * This method is *not* part of the officially documented API and may change or be removed in + * the future. It is meant for userland code that wishes to reuse the (large) internal Unicode + * structures set up by XRegExp. + */ + + + XRegExp._getUnicodeProperty = function (name) { + var slug = normalize(name); + return unicode[slug]; + }; +}; + +exports.default = _default; +module.exports = exports["default"]; +}); + +unwrapExports(unicodeBase); + +var blocks = [ + { + 'name': 'InAdlam', + 'astral': '\uD83A[\uDD00-\uDD5F]' + }, + { + 'name': 'InAegean_Numbers', + 'astral': '\uD800[\uDD00-\uDD3F]' + }, + { + 'name': 'InAhom', + 'astral': '\uD805[\uDF00-\uDF3F]' + }, + { + 'name': 'InAlchemical_Symbols', + 'astral': '\uD83D[\uDF00-\uDF7F]' + }, + { + 'name': 'InAlphabetic_Presentation_Forms', + 'bmp': '\uFB00-\uFB4F' + }, + { + 'name': 'InAnatolian_Hieroglyphs', + 'astral': '\uD811[\uDC00-\uDE7F]' + }, + { + 'name': 'InAncient_Greek_Musical_Notation', + 'astral': '\uD834[\uDE00-\uDE4F]' + }, + { + 'name': 'InAncient_Greek_Numbers', + 'astral': '\uD800[\uDD40-\uDD8F]' + }, + { + 'name': 'InAncient_Symbols', + 'astral': '\uD800[\uDD90-\uDDCF]' + }, + { + 'name': 'InArabic', + 'bmp': '\u0600-\u06FF' + }, + { + 'name': 'InArabic_Extended_A', + 'bmp': '\u08A0-\u08FF' + }, + { + 'name': 'InArabic_Mathematical_Alphabetic_Symbols', + 'astral': '\uD83B[\uDE00-\uDEFF]' + }, + { + 'name': 'InArabic_Presentation_Forms_A', + 'bmp': '\uFB50-\uFDFF' + }, + { + 'name': 'InArabic_Presentation_Forms_B', + 'bmp': '\uFE70-\uFEFF' + }, + { + 'name': 'InArabic_Supplement', + 'bmp': '\u0750-\u077F' + }, + { + 'name': 'InArmenian', + 'bmp': '\u0530-\u058F' + }, + { + 'name': 'InArrows', + 'bmp': '\u2190-\u21FF' + }, + { + 'name': 'InAvestan', + 'astral': '\uD802[\uDF00-\uDF3F]' + }, + { + 'name': 'InBalinese', + 'bmp': '\u1B00-\u1B7F' + }, + { + 'name': 'InBamum', + 'bmp': '\uA6A0-\uA6FF' + }, + { + 'name': 'InBamum_Supplement', + 'astral': '\uD81A[\uDC00-\uDE3F]' + }, + { + 'name': 'InBasic_Latin', + 'bmp': '\0-\x7F' + }, + { + 'name': 'InBassa_Vah', + 'astral': '\uD81A[\uDED0-\uDEFF]' + }, + { + 'name': 'InBatak', + 'bmp': '\u1BC0-\u1BFF' + }, + { + 'name': 'InBengali', + 'bmp': '\u0980-\u09FF' + }, + { + 'name': 'InBhaiksuki', + 'astral': '\uD807[\uDC00-\uDC6F]' + }, + { + 'name': 'InBlock_Elements', + 'bmp': '\u2580-\u259F' + }, + { + 'name': 'InBopomofo', + 'bmp': '\u3100-\u312F' + }, + { + 'name': 'InBopomofo_Extended', + 'bmp': '\u31A0-\u31BF' + }, + { + 'name': 'InBox_Drawing', + 'bmp': '\u2500-\u257F' + }, + { + 'name': 'InBrahmi', + 'astral': '\uD804[\uDC00-\uDC7F]' + }, + { + 'name': 'InBraille_Patterns', + 'bmp': '\u2800-\u28FF' + }, + { + 'name': 'InBuginese', + 'bmp': '\u1A00-\u1A1F' + }, + { + 'name': 'InBuhid', + 'bmp': '\u1740-\u175F' + }, + { + 'name': 'InByzantine_Musical_Symbols', + 'astral': '\uD834[\uDC00-\uDCFF]' + }, + { + 'name': 'InCJK_Compatibility', + 'bmp': '\u3300-\u33FF' + }, + { + 'name': 'InCJK_Compatibility_Forms', + 'bmp': '\uFE30-\uFE4F' + }, + { + 'name': 'InCJK_Compatibility_Ideographs', + 'bmp': '\uF900-\uFAFF' + }, + { + 'name': 'InCJK_Compatibility_Ideographs_Supplement', + 'astral': '\uD87E[\uDC00-\uDE1F]' + }, + { + 'name': 'InCJK_Radicals_Supplement', + 'bmp': '\u2E80-\u2EFF' + }, + { + 'name': 'InCJK_Strokes', + 'bmp': '\u31C0-\u31EF' + }, + { + 'name': 'InCJK_Symbols_And_Punctuation', + 'bmp': '\u3000-\u303F' + }, + { + 'name': 'InCJK_Unified_Ideographs', + 'bmp': '\u4E00-\u9FFF' + }, + { + 'name': 'InCJK_Unified_Ideographs_Extension_A', + 'bmp': '\u3400-\u4DBF' + }, + { + 'name': 'InCJK_Unified_Ideographs_Extension_B', + 'astral': '[\uD840-\uD868][\uDC00-\uDFFF]|\uD869[\uDC00-\uDEDF]' + }, + { + 'name': 'InCJK_Unified_Ideographs_Extension_C', + 'astral': '\uD869[\uDF00-\uDFFF]|[\uD86A-\uD86C][\uDC00-\uDFFF]|\uD86D[\uDC00-\uDF3F]' + }, + { + 'name': 'InCJK_Unified_Ideographs_Extension_D', + 'astral': '\uD86D[\uDF40-\uDFFF]|\uD86E[\uDC00-\uDC1F]' + }, + { + 'name': 'InCJK_Unified_Ideographs_Extension_E', + 'astral': '\uD86E[\uDC20-\uDFFF]|[\uD86F-\uD872][\uDC00-\uDFFF]|\uD873[\uDC00-\uDEAF]' + }, + { + 'name': 'InCJK_Unified_Ideographs_Extension_F', + 'astral': '\uD873[\uDEB0-\uDFFF]|[\uD874-\uD879][\uDC00-\uDFFF]|\uD87A[\uDC00-\uDFEF]' + }, + { + 'name': 'InCarian', + 'astral': '\uD800[\uDEA0-\uDEDF]' + }, + { + 'name': 'InCaucasian_Albanian', + 'astral': '\uD801[\uDD30-\uDD6F]' + }, + { + 'name': 'InChakma', + 'astral': '\uD804[\uDD00-\uDD4F]' + }, + { + 'name': 'InCham', + 'bmp': '\uAA00-\uAA5F' + }, + { + 'name': 'InCherokee', + 'bmp': '\u13A0-\u13FF' + }, + { + 'name': 'InCherokee_Supplement', + 'bmp': '\uAB70-\uABBF' + }, + { + 'name': 'InChess_Symbols', + 'astral': '\uD83E[\uDE00-\uDE6F]' + }, + { + 'name': 'InCombining_Diacritical_Marks', + 'bmp': '\u0300-\u036F' + }, + { + 'name': 'InCombining_Diacritical_Marks_Extended', + 'bmp': '\u1AB0-\u1AFF' + }, + { + 'name': 'InCombining_Diacritical_Marks_For_Symbols', + 'bmp': '\u20D0-\u20FF' + }, + { + 'name': 'InCombining_Diacritical_Marks_Supplement', + 'bmp': '\u1DC0-\u1DFF' + }, + { + 'name': 'InCombining_Half_Marks', + 'bmp': '\uFE20-\uFE2F' + }, + { + 'name': 'InCommon_Indic_Number_Forms', + 'bmp': '\uA830-\uA83F' + }, + { + 'name': 'InControl_Pictures', + 'bmp': '\u2400-\u243F' + }, + { + 'name': 'InCoptic', + 'bmp': '\u2C80-\u2CFF' + }, + { + 'name': 'InCoptic_Epact_Numbers', + 'astral': '\uD800[\uDEE0-\uDEFF]' + }, + { + 'name': 'InCounting_Rod_Numerals', + 'astral': '\uD834[\uDF60-\uDF7F]' + }, + { + 'name': 'InCuneiform', + 'astral': '\uD808[\uDC00-\uDFFF]' + }, + { + 'name': 'InCuneiform_Numbers_And_Punctuation', + 'astral': '\uD809[\uDC00-\uDC7F]' + }, + { + 'name': 'InCurrency_Symbols', + 'bmp': '\u20A0-\u20CF' + }, + { + 'name': 'InCypriot_Syllabary', + 'astral': '\uD802[\uDC00-\uDC3F]' + }, + { + 'name': 'InCyrillic', + 'bmp': '\u0400-\u04FF' + }, + { + 'name': 'InCyrillic_Extended_A', + 'bmp': '\u2DE0-\u2DFF' + }, + { + 'name': 'InCyrillic_Extended_B', + 'bmp': '\uA640-\uA69F' + }, + { + 'name': 'InCyrillic_Extended_C', + 'bmp': '\u1C80-\u1C8F' + }, + { + 'name': 'InCyrillic_Supplement', + 'bmp': '\u0500-\u052F' + }, + { + 'name': 'InDeseret', + 'astral': '\uD801[\uDC00-\uDC4F]' + }, + { + 'name': 'InDevanagari', + 'bmp': '\u0900-\u097F' + }, + { + 'name': 'InDevanagari_Extended', + 'bmp': '\uA8E0-\uA8FF' + }, + { + 'name': 'InDingbats', + 'bmp': '\u2700-\u27BF' + }, + { + 'name': 'InDogra', + 'astral': '\uD806[\uDC00-\uDC4F]' + }, + { + 'name': 'InDomino_Tiles', + 'astral': '\uD83C[\uDC30-\uDC9F]' + }, + { + 'name': 'InDuployan', + 'astral': '\uD82F[\uDC00-\uDC9F]' + }, + { + 'name': 'InEarly_Dynastic_Cuneiform', + 'astral': '\uD809[\uDC80-\uDD4F]' + }, + { + 'name': 'InEgyptian_Hieroglyphs', + 'astral': '\uD80C[\uDC00-\uDFFF]|\uD80D[\uDC00-\uDC2F]' + }, + { + 'name': 'InElbasan', + 'astral': '\uD801[\uDD00-\uDD2F]' + }, + { + 'name': 'InEmoticons', + 'astral': '\uD83D[\uDE00-\uDE4F]' + }, + { + 'name': 'InEnclosed_Alphanumeric_Supplement', + 'astral': '\uD83C[\uDD00-\uDDFF]' + }, + { + 'name': 'InEnclosed_Alphanumerics', + 'bmp': '\u2460-\u24FF' + }, + { + 'name': 'InEnclosed_CJK_Letters_And_Months', + 'bmp': '\u3200-\u32FF' + }, + { + 'name': 'InEnclosed_Ideographic_Supplement', + 'astral': '\uD83C[\uDE00-\uDEFF]' + }, + { + 'name': 'InEthiopic', + 'bmp': '\u1200-\u137F' + }, + { + 'name': 'InEthiopic_Extended', + 'bmp': '\u2D80-\u2DDF' + }, + { + 'name': 'InEthiopic_Extended_A', + 'bmp': '\uAB00-\uAB2F' + }, + { + 'name': 'InEthiopic_Supplement', + 'bmp': '\u1380-\u139F' + }, + { + 'name': 'InGeneral_Punctuation', + 'bmp': '\u2000-\u206F' + }, + { + 'name': 'InGeometric_Shapes', + 'bmp': '\u25A0-\u25FF' + }, + { + 'name': 'InGeometric_Shapes_Extended', + 'astral': '\uD83D[\uDF80-\uDFFF]' + }, + { + 'name': 'InGeorgian', + 'bmp': '\u10A0-\u10FF' + }, + { + 'name': 'InGeorgian_Extended', + 'bmp': '\u1C90-\u1CBF' + }, + { + 'name': 'InGeorgian_Supplement', + 'bmp': '\u2D00-\u2D2F' + }, + { + 'name': 'InGlagolitic', + 'bmp': '\u2C00-\u2C5F' + }, + { + 'name': 'InGlagolitic_Supplement', + 'astral': '\uD838[\uDC00-\uDC2F]' + }, + { + 'name': 'InGothic', + 'astral': '\uD800[\uDF30-\uDF4F]' + }, + { + 'name': 'InGrantha', + 'astral': '\uD804[\uDF00-\uDF7F]' + }, + { + 'name': 'InGreek_And_Coptic', + 'bmp': '\u0370-\u03FF' + }, + { + 'name': 'InGreek_Extended', + 'bmp': '\u1F00-\u1FFF' + }, + { + 'name': 'InGujarati', + 'bmp': '\u0A80-\u0AFF' + }, + { + 'name': 'InGunjala_Gondi', + 'astral': '\uD807[\uDD60-\uDDAF]' + }, + { + 'name': 'InGurmukhi', + 'bmp': '\u0A00-\u0A7F' + }, + { + 'name': 'InHalfwidth_And_Fullwidth_Forms', + 'bmp': '\uFF00-\uFFEF' + }, + { + 'name': 'InHangul_Compatibility_Jamo', + 'bmp': '\u3130-\u318F' + }, + { + 'name': 'InHangul_Jamo', + 'bmp': '\u1100-\u11FF' + }, + { + 'name': 'InHangul_Jamo_Extended_A', + 'bmp': '\uA960-\uA97F' + }, + { + 'name': 'InHangul_Jamo_Extended_B', + 'bmp': '\uD7B0-\uD7FF' + }, + { + 'name': 'InHangul_Syllables', + 'bmp': '\uAC00-\uD7AF' + }, + { + 'name': 'InHanifi_Rohingya', + 'astral': '\uD803[\uDD00-\uDD3F]' + }, + { + 'name': 'InHanunoo', + 'bmp': '\u1720-\u173F' + }, + { + 'name': 'InHatran', + 'astral': '\uD802[\uDCE0-\uDCFF]' + }, + { + 'name': 'InHebrew', + 'bmp': '\u0590-\u05FF' + }, + { + 'name': 'InHigh_Private_Use_Surrogates', + 'bmp': '\uDB80-\uDBFF' + }, + { + 'name': 'InHigh_Surrogates', + 'bmp': '\uD800-\uDB7F' + }, + { + 'name': 'InHiragana', + 'bmp': '\u3040-\u309F' + }, + { + 'name': 'InIPA_Extensions', + 'bmp': '\u0250-\u02AF' + }, + { + 'name': 'InIdeographic_Description_Characters', + 'bmp': '\u2FF0-\u2FFF' + }, + { + 'name': 'InIdeographic_Symbols_And_Punctuation', + 'astral': '\uD81B[\uDFE0-\uDFFF]' + }, + { + 'name': 'InImperial_Aramaic', + 'astral': '\uD802[\uDC40-\uDC5F]' + }, + { + 'name': 'InIndic_Siyaq_Numbers', + 'astral': '\uD83B[\uDC70-\uDCBF]' + }, + { + 'name': 'InInscriptional_Pahlavi', + 'astral': '\uD802[\uDF60-\uDF7F]' + }, + { + 'name': 'InInscriptional_Parthian', + 'astral': '\uD802[\uDF40-\uDF5F]' + }, + { + 'name': 'InJavanese', + 'bmp': '\uA980-\uA9DF' + }, + { + 'name': 'InKaithi', + 'astral': '\uD804[\uDC80-\uDCCF]' + }, + { + 'name': 'InKana_Extended_A', + 'astral': '\uD82C[\uDD00-\uDD2F]' + }, + { + 'name': 'InKana_Supplement', + 'astral': '\uD82C[\uDC00-\uDCFF]' + }, + { + 'name': 'InKanbun', + 'bmp': '\u3190-\u319F' + }, + { + 'name': 'InKangxi_Radicals', + 'bmp': '\u2F00-\u2FDF' + }, + { + 'name': 'InKannada', + 'bmp': '\u0C80-\u0CFF' + }, + { + 'name': 'InKatakana', + 'bmp': '\u30A0-\u30FF' + }, + { + 'name': 'InKatakana_Phonetic_Extensions', + 'bmp': '\u31F0-\u31FF' + }, + { + 'name': 'InKayah_Li', + 'bmp': '\uA900-\uA92F' + }, + { + 'name': 'InKharoshthi', + 'astral': '\uD802[\uDE00-\uDE5F]' + }, + { + 'name': 'InKhmer', + 'bmp': '\u1780-\u17FF' + }, + { + 'name': 'InKhmer_Symbols', + 'bmp': '\u19E0-\u19FF' + }, + { + 'name': 'InKhojki', + 'astral': '\uD804[\uDE00-\uDE4F]' + }, + { + 'name': 'InKhudawadi', + 'astral': '\uD804[\uDEB0-\uDEFF]' + }, + { + 'name': 'InLao', + 'bmp': '\u0E80-\u0EFF' + }, + { + 'name': 'InLatin_1_Supplement', + 'bmp': '\x80-\xFF' + }, + { + 'name': 'InLatin_Extended_A', + 'bmp': '\u0100-\u017F' + }, + { + 'name': 'InLatin_Extended_Additional', + 'bmp': '\u1E00-\u1EFF' + }, + { + 'name': 'InLatin_Extended_B', + 'bmp': '\u0180-\u024F' + }, + { + 'name': 'InLatin_Extended_C', + 'bmp': '\u2C60-\u2C7F' + }, + { + 'name': 'InLatin_Extended_D', + 'bmp': '\uA720-\uA7FF' + }, + { + 'name': 'InLatin_Extended_E', + 'bmp': '\uAB30-\uAB6F' + }, + { + 'name': 'InLepcha', + 'bmp': '\u1C00-\u1C4F' + }, + { + 'name': 'InLetterlike_Symbols', + 'bmp': '\u2100-\u214F' + }, + { + 'name': 'InLimbu', + 'bmp': '\u1900-\u194F' + }, + { + 'name': 'InLinear_A', + 'astral': '\uD801[\uDE00-\uDF7F]' + }, + { + 'name': 'InLinear_B_Ideograms', + 'astral': '\uD800[\uDC80-\uDCFF]' + }, + { + 'name': 'InLinear_B_Syllabary', + 'astral': '\uD800[\uDC00-\uDC7F]' + }, + { + 'name': 'InLisu', + 'bmp': '\uA4D0-\uA4FF' + }, + { + 'name': 'InLow_Surrogates', + 'bmp': '\uDC00-\uDFFF' + }, + { + 'name': 'InLycian', + 'astral': '\uD800[\uDE80-\uDE9F]' + }, + { + 'name': 'InLydian', + 'astral': '\uD802[\uDD20-\uDD3F]' + }, + { + 'name': 'InMahajani', + 'astral': '\uD804[\uDD50-\uDD7F]' + }, + { + 'name': 'InMahjong_Tiles', + 'astral': '\uD83C[\uDC00-\uDC2F]' + }, + { + 'name': 'InMakasar', + 'astral': '\uD807[\uDEE0-\uDEFF]' + }, + { + 'name': 'InMalayalam', + 'bmp': '\u0D00-\u0D7F' + }, + { + 'name': 'InMandaic', + 'bmp': '\u0840-\u085F' + }, + { + 'name': 'InManichaean', + 'astral': '\uD802[\uDEC0-\uDEFF]' + }, + { + 'name': 'InMarchen', + 'astral': '\uD807[\uDC70-\uDCBF]' + }, + { + 'name': 'InMasaram_Gondi', + 'astral': '\uD807[\uDD00-\uDD5F]' + }, + { + 'name': 'InMathematical_Alphanumeric_Symbols', + 'astral': '\uD835[\uDC00-\uDFFF]' + }, + { + 'name': 'InMathematical_Operators', + 'bmp': '\u2200-\u22FF' + }, + { + 'name': 'InMayan_Numerals', + 'astral': '\uD834[\uDEE0-\uDEFF]' + }, + { + 'name': 'InMedefaidrin', + 'astral': '\uD81B[\uDE40-\uDE9F]' + }, + { + 'name': 'InMeetei_Mayek', + 'bmp': '\uABC0-\uABFF' + }, + { + 'name': 'InMeetei_Mayek_Extensions', + 'bmp': '\uAAE0-\uAAFF' + }, + { + 'name': 'InMende_Kikakui', + 'astral': '\uD83A[\uDC00-\uDCDF]' + }, + { + 'name': 'InMeroitic_Cursive', + 'astral': '\uD802[\uDDA0-\uDDFF]' + }, + { + 'name': 'InMeroitic_Hieroglyphs', + 'astral': '\uD802[\uDD80-\uDD9F]' + }, + { + 'name': 'InMiao', + 'astral': '\uD81B[\uDF00-\uDF9F]' + }, + { + 'name': 'InMiscellaneous_Mathematical_Symbols_A', + 'bmp': '\u27C0-\u27EF' + }, + { + 'name': 'InMiscellaneous_Mathematical_Symbols_B', + 'bmp': '\u2980-\u29FF' + }, + { + 'name': 'InMiscellaneous_Symbols', + 'bmp': '\u2600-\u26FF' + }, + { + 'name': 'InMiscellaneous_Symbols_And_Arrows', + 'bmp': '\u2B00-\u2BFF' + }, + { + 'name': 'InMiscellaneous_Symbols_And_Pictographs', + 'astral': '\uD83C[\uDF00-\uDFFF]|\uD83D[\uDC00-\uDDFF]' + }, + { + 'name': 'InMiscellaneous_Technical', + 'bmp': '\u2300-\u23FF' + }, + { + 'name': 'InModi', + 'astral': '\uD805[\uDE00-\uDE5F]' + }, + { + 'name': 'InModifier_Tone_Letters', + 'bmp': '\uA700-\uA71F' + }, + { + 'name': 'InMongolian', + 'bmp': '\u1800-\u18AF' + }, + { + 'name': 'InMongolian_Supplement', + 'astral': '\uD805[\uDE60-\uDE7F]' + }, + { + 'name': 'InMro', + 'astral': '\uD81A[\uDE40-\uDE6F]' + }, + { + 'name': 'InMultani', + 'astral': '\uD804[\uDE80-\uDEAF]' + }, + { + 'name': 'InMusical_Symbols', + 'astral': '\uD834[\uDD00-\uDDFF]' + }, + { + 'name': 'InMyanmar', + 'bmp': '\u1000-\u109F' + }, + { + 'name': 'InMyanmar_Extended_A', + 'bmp': '\uAA60-\uAA7F' + }, + { + 'name': 'InMyanmar_Extended_B', + 'bmp': '\uA9E0-\uA9FF' + }, + { + 'name': 'InNKo', + 'bmp': '\u07C0-\u07FF' + }, + { + 'name': 'InNabataean', + 'astral': '\uD802[\uDC80-\uDCAF]' + }, + { + 'name': 'InNew_Tai_Lue', + 'bmp': '\u1980-\u19DF' + }, + { + 'name': 'InNewa', + 'astral': '\uD805[\uDC00-\uDC7F]' + }, + { + 'name': 'InNumber_Forms', + 'bmp': '\u2150-\u218F' + }, + { + 'name': 'InNushu', + 'astral': '\uD82C[\uDD70-\uDEFF]' + }, + { + 'name': 'InOgham', + 'bmp': '\u1680-\u169F' + }, + { + 'name': 'InOl_Chiki', + 'bmp': '\u1C50-\u1C7F' + }, + { + 'name': 'InOld_Hungarian', + 'astral': '\uD803[\uDC80-\uDCFF]' + }, + { + 'name': 'InOld_Italic', + 'astral': '\uD800[\uDF00-\uDF2F]' + }, + { + 'name': 'InOld_North_Arabian', + 'astral': '\uD802[\uDE80-\uDE9F]' + }, + { + 'name': 'InOld_Permic', + 'astral': '\uD800[\uDF50-\uDF7F]' + }, + { + 'name': 'InOld_Persian', + 'astral': '\uD800[\uDFA0-\uDFDF]' + }, + { + 'name': 'InOld_Sogdian', + 'astral': '\uD803[\uDF00-\uDF2F]' + }, + { + 'name': 'InOld_South_Arabian', + 'astral': '\uD802[\uDE60-\uDE7F]' + }, + { + 'name': 'InOld_Turkic', + 'astral': '\uD803[\uDC00-\uDC4F]' + }, + { + 'name': 'InOptical_Character_Recognition', + 'bmp': '\u2440-\u245F' + }, + { + 'name': 'InOriya', + 'bmp': '\u0B00-\u0B7F' + }, + { + 'name': 'InOrnamental_Dingbats', + 'astral': '\uD83D[\uDE50-\uDE7F]' + }, + { + 'name': 'InOsage', + 'astral': '\uD801[\uDCB0-\uDCFF]' + }, + { + 'name': 'InOsmanya', + 'astral': '\uD801[\uDC80-\uDCAF]' + }, + { + 'name': 'InPahawh_Hmong', + 'astral': '\uD81A[\uDF00-\uDF8F]' + }, + { + 'name': 'InPalmyrene', + 'astral': '\uD802[\uDC60-\uDC7F]' + }, + { + 'name': 'InPau_Cin_Hau', + 'astral': '\uD806[\uDEC0-\uDEFF]' + }, + { + 'name': 'InPhags_Pa', + 'bmp': '\uA840-\uA87F' + }, + { + 'name': 'InPhaistos_Disc', + 'astral': '\uD800[\uDDD0-\uDDFF]' + }, + { + 'name': 'InPhoenician', + 'astral': '\uD802[\uDD00-\uDD1F]' + }, + { + 'name': 'InPhonetic_Extensions', + 'bmp': '\u1D00-\u1D7F' + }, + { + 'name': 'InPhonetic_Extensions_Supplement', + 'bmp': '\u1D80-\u1DBF' + }, + { + 'name': 'InPlaying_Cards', + 'astral': '\uD83C[\uDCA0-\uDCFF]' + }, + { + 'name': 'InPrivate_Use_Area', + 'bmp': '\uE000-\uF8FF' + }, + { + 'name': 'InPsalter_Pahlavi', + 'astral': '\uD802[\uDF80-\uDFAF]' + }, + { + 'name': 'InRejang', + 'bmp': '\uA930-\uA95F' + }, + { + 'name': 'InRumi_Numeral_Symbols', + 'astral': '\uD803[\uDE60-\uDE7F]' + }, + { + 'name': 'InRunic', + 'bmp': '\u16A0-\u16FF' + }, + { + 'name': 'InSamaritan', + 'bmp': '\u0800-\u083F' + }, + { + 'name': 'InSaurashtra', + 'bmp': '\uA880-\uA8DF' + }, + { + 'name': 'InSharada', + 'astral': '\uD804[\uDD80-\uDDDF]' + }, + { + 'name': 'InShavian', + 'astral': '\uD801[\uDC50-\uDC7F]' + }, + { + 'name': 'InShorthand_Format_Controls', + 'astral': '\uD82F[\uDCA0-\uDCAF]' + }, + { + 'name': 'InSiddham', + 'astral': '\uD805[\uDD80-\uDDFF]' + }, + { + 'name': 'InSinhala', + 'bmp': '\u0D80-\u0DFF' + }, + { + 'name': 'InSinhala_Archaic_Numbers', + 'astral': '\uD804[\uDDE0-\uDDFF]' + }, + { + 'name': 'InSmall_Form_Variants', + 'bmp': '\uFE50-\uFE6F' + }, + { + 'name': 'InSogdian', + 'astral': '\uD803[\uDF30-\uDF6F]' + }, + { + 'name': 'InSora_Sompeng', + 'astral': '\uD804[\uDCD0-\uDCFF]' + }, + { + 'name': 'InSoyombo', + 'astral': '\uD806[\uDE50-\uDEAF]' + }, + { + 'name': 'InSpacing_Modifier_Letters', + 'bmp': '\u02B0-\u02FF' + }, + { + 'name': 'InSpecials', + 'bmp': '\uFFF0-\uFFFF' + }, + { + 'name': 'InSundanese', + 'bmp': '\u1B80-\u1BBF' + }, + { + 'name': 'InSundanese_Supplement', + 'bmp': '\u1CC0-\u1CCF' + }, + { + 'name': 'InSuperscripts_And_Subscripts', + 'bmp': '\u2070-\u209F' + }, + { + 'name': 'InSupplemental_Arrows_A', + 'bmp': '\u27F0-\u27FF' + }, + { + 'name': 'InSupplemental_Arrows_B', + 'bmp': '\u2900-\u297F' + }, + { + 'name': 'InSupplemental_Arrows_C', + 'astral': '\uD83E[\uDC00-\uDCFF]' + }, + { + 'name': 'InSupplemental_Mathematical_Operators', + 'bmp': '\u2A00-\u2AFF' + }, + { + 'name': 'InSupplemental_Punctuation', + 'bmp': '\u2E00-\u2E7F' + }, + { + 'name': 'InSupplemental_Symbols_And_Pictographs', + 'astral': '\uD83E[\uDD00-\uDDFF]' + }, + { + 'name': 'InSupplementary_Private_Use_Area_A', + 'astral': '[\uDB80-\uDBBF][\uDC00-\uDFFF]' + }, + { + 'name': 'InSupplementary_Private_Use_Area_B', + 'astral': '[\uDBC0-\uDBFF][\uDC00-\uDFFF]' + }, + { + 'name': 'InSutton_SignWriting', + 'astral': '\uD836[\uDC00-\uDEAF]' + }, + { + 'name': 'InSyloti_Nagri', + 'bmp': '\uA800-\uA82F' + }, + { + 'name': 'InSyriac', + 'bmp': '\u0700-\u074F' + }, + { + 'name': 'InSyriac_Supplement', + 'bmp': '\u0860-\u086F' + }, + { + 'name': 'InTagalog', + 'bmp': '\u1700-\u171F' + }, + { + 'name': 'InTagbanwa', + 'bmp': '\u1760-\u177F' + }, + { + 'name': 'InTags', + 'astral': '\uDB40[\uDC00-\uDC7F]' + }, + { + 'name': 'InTai_Le', + 'bmp': '\u1950-\u197F' + }, + { + 'name': 'InTai_Tham', + 'bmp': '\u1A20-\u1AAF' + }, + { + 'name': 'InTai_Viet', + 'bmp': '\uAA80-\uAADF' + }, + { + 'name': 'InTai_Xuan_Jing_Symbols', + 'astral': '\uD834[\uDF00-\uDF5F]' + }, + { + 'name': 'InTakri', + 'astral': '\uD805[\uDE80-\uDECF]' + }, + { + 'name': 'InTamil', + 'bmp': '\u0B80-\u0BFF' + }, + { + 'name': 'InTangut', + 'astral': '[\uD81C-\uD821][\uDC00-\uDFFF]' + }, + { + 'name': 'InTangut_Components', + 'astral': '\uD822[\uDC00-\uDEFF]' + }, + { + 'name': 'InTelugu', + 'bmp': '\u0C00-\u0C7F' + }, + { + 'name': 'InThaana', + 'bmp': '\u0780-\u07BF' + }, + { + 'name': 'InThai', + 'bmp': '\u0E00-\u0E7F' + }, + { + 'name': 'InTibetan', + 'bmp': '\u0F00-\u0FFF' + }, + { + 'name': 'InTifinagh', + 'bmp': '\u2D30-\u2D7F' + }, + { + 'name': 'InTirhuta', + 'astral': '\uD805[\uDC80-\uDCDF]' + }, + { + 'name': 'InTransport_And_Map_Symbols', + 'astral': '\uD83D[\uDE80-\uDEFF]' + }, + { + 'name': 'InUgaritic', + 'astral': '\uD800[\uDF80-\uDF9F]' + }, + { + 'name': 'InUnified_Canadian_Aboriginal_Syllabics', + 'bmp': '\u1400-\u167F' + }, + { + 'name': 'InUnified_Canadian_Aboriginal_Syllabics_Extended', + 'bmp': '\u18B0-\u18FF' + }, + { + 'name': 'InVai', + 'bmp': '\uA500-\uA63F' + }, + { + 'name': 'InVariation_Selectors', + 'bmp': '\uFE00-\uFE0F' + }, + { + 'name': 'InVariation_Selectors_Supplement', + 'astral': '\uDB40[\uDD00-\uDDEF]' + }, + { + 'name': 'InVedic_Extensions', + 'bmp': '\u1CD0-\u1CFF' + }, + { + 'name': 'InVertical_Forms', + 'bmp': '\uFE10-\uFE1F' + }, + { + 'name': 'InWarang_Citi', + 'astral': '\uD806[\uDCA0-\uDCFF]' + }, + { + 'name': 'InYi_Radicals', + 'bmp': '\uA490-\uA4CF' + }, + { + 'name': 'InYi_Syllables', + 'bmp': '\uA000-\uA48F' + }, + { + 'name': 'InYijing_Hexagram_Symbols', + 'bmp': '\u4DC0-\u4DFF' + }, + { + 'name': 'InZanabazar_Square', + 'astral': '\uD806[\uDE00-\uDE4F]' + } +]; + +var unicodeBlocks = createCommonjsModule(function (module, exports) { +"use strict"; + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.default = void 0; + +var _blocks = _interopRequireDefault(blocks); + +function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } + +/*! + * XRegExp Unicode Blocks 4.2.0 + * + * Steven Levithan (c) 2010-present MIT License + * Unicode data by Mathias Bynens + */ +var _default = function _default(XRegExp) { + /** + * Adds support for all Unicode blocks. Block names use the prefix 'In'. E.g., + * `\p{InBasicLatin}`. Token names are case insensitive, and any spaces, hyphens, and + * underscores are ignored. + * + * Uses Unicode 11.0.0. + * + * @requires XRegExp, Unicode Base + */ + if (!XRegExp.addUnicodeData) { + throw new ReferenceError('Unicode Base must be loaded before Unicode Blocks'); + } + + XRegExp.addUnicodeData(_blocks.default); +}; + +exports.default = _default; +module.exports = exports["default"]; +}); + +unwrapExports(unicodeBlocks); + +var categories = [ + { + 'name': 'C', + 'alias': 'Other', + 'isBmpLast': true, + 'bmp': '\0-\x1F\x7F-\x9F\xAD\u0378\u0379\u0380-\u0383\u038B\u038D\u03A2\u0530\u0557\u0558\u058B\u058C\u0590\u05C8-\u05CF\u05EB-\u05EE\u05F5-\u0605\u061C\u061D\u06DD\u070E\u070F\u074B\u074C\u07B2-\u07BF\u07FB\u07FC\u082E\u082F\u083F\u085C\u085D\u085F\u086B-\u089F\u08B5\u08BE-\u08D2\u08E2\u0984\u098D\u098E\u0991\u0992\u09A9\u09B1\u09B3-\u09B5\u09BA\u09BB\u09C5\u09C6\u09C9\u09CA\u09CF-\u09D6\u09D8-\u09DB\u09DE\u09E4\u09E5\u09FF\u0A00\u0A04\u0A0B-\u0A0E\u0A11\u0A12\u0A29\u0A31\u0A34\u0A37\u0A3A\u0A3B\u0A3D\u0A43-\u0A46\u0A49\u0A4A\u0A4E-\u0A50\u0A52-\u0A58\u0A5D\u0A5F-\u0A65\u0A77-\u0A80\u0A84\u0A8E\u0A92\u0AA9\u0AB1\u0AB4\u0ABA\u0ABB\u0AC6\u0ACA\u0ACE\u0ACF\u0AD1-\u0ADF\u0AE4\u0AE5\u0AF2-\u0AF8\u0B00\u0B04\u0B0D\u0B0E\u0B11\u0B12\u0B29\u0B31\u0B34\u0B3A\u0B3B\u0B45\u0B46\u0B49\u0B4A\u0B4E-\u0B55\u0B58-\u0B5B\u0B5E\u0B64\u0B65\u0B78-\u0B81\u0B84\u0B8B-\u0B8D\u0B91\u0B96-\u0B98\u0B9B\u0B9D\u0BA0-\u0BA2\u0BA5-\u0BA7\u0BAB-\u0BAD\u0BBA-\u0BBD\u0BC3-\u0BC5\u0BC9\u0BCE\u0BCF\u0BD1-\u0BD6\u0BD8-\u0BE5\u0BFB-\u0BFF\u0C0D\u0C11\u0C29\u0C3A-\u0C3C\u0C45\u0C49\u0C4E-\u0C54\u0C57\u0C5B-\u0C5F\u0C64\u0C65\u0C70-\u0C77\u0C8D\u0C91\u0CA9\u0CB4\u0CBA\u0CBB\u0CC5\u0CC9\u0CCE-\u0CD4\u0CD7-\u0CDD\u0CDF\u0CE4\u0CE5\u0CF0\u0CF3-\u0CFF\u0D04\u0D0D\u0D11\u0D45\u0D49\u0D50-\u0D53\u0D64\u0D65\u0D80\u0D81\u0D84\u0D97-\u0D99\u0DB2\u0DBC\u0DBE\u0DBF\u0DC7-\u0DC9\u0DCB-\u0DCE\u0DD5\u0DD7\u0DE0-\u0DE5\u0DF0\u0DF1\u0DF5-\u0E00\u0E3B-\u0E3E\u0E5C-\u0E80\u0E83\u0E85\u0E86\u0E89\u0E8B\u0E8C\u0E8E-\u0E93\u0E98\u0EA0\u0EA4\u0EA6\u0EA8\u0EA9\u0EAC\u0EBA\u0EBE\u0EBF\u0EC5\u0EC7\u0ECE\u0ECF\u0EDA\u0EDB\u0EE0-\u0EFF\u0F48\u0F6D-\u0F70\u0F98\u0FBD\u0FCD\u0FDB-\u0FFF\u10C6\u10C8-\u10CC\u10CE\u10CF\u1249\u124E\u124F\u1257\u1259\u125E\u125F\u1289\u128E\u128F\u12B1\u12B6\u12B7\u12BF\u12C1\u12C6\u12C7\u12D7\u1311\u1316\u1317\u135B\u135C\u137D-\u137F\u139A-\u139F\u13F6\u13F7\u13FE\u13FF\u169D-\u169F\u16F9-\u16FF\u170D\u1715-\u171F\u1737-\u173F\u1754-\u175F\u176D\u1771\u1774-\u177F\u17DE\u17DF\u17EA-\u17EF\u17FA-\u17FF\u180E\u180F\u181A-\u181F\u1879-\u187F\u18AB-\u18AF\u18F6-\u18FF\u191F\u192C-\u192F\u193C-\u193F\u1941-\u1943\u196E\u196F\u1975-\u197F\u19AC-\u19AF\u19CA-\u19CF\u19DB-\u19DD\u1A1C\u1A1D\u1A5F\u1A7D\u1A7E\u1A8A-\u1A8F\u1A9A-\u1A9F\u1AAE\u1AAF\u1ABF-\u1AFF\u1B4C-\u1B4F\u1B7D-\u1B7F\u1BF4-\u1BFB\u1C38-\u1C3A\u1C4A-\u1C4C\u1C89-\u1C8F\u1CBB\u1CBC\u1CC8-\u1CCF\u1CFA-\u1CFF\u1DFA\u1F16\u1F17\u1F1E\u1F1F\u1F46\u1F47\u1F4E\u1F4F\u1F58\u1F5A\u1F5C\u1F5E\u1F7E\u1F7F\u1FB5\u1FC5\u1FD4\u1FD5\u1FDC\u1FF0\u1FF1\u1FF5\u1FFF\u200B-\u200F\u202A-\u202E\u2060-\u206F\u2072\u2073\u208F\u209D-\u209F\u20C0-\u20CF\u20F1-\u20FF\u218C-\u218F\u2427-\u243F\u244B-\u245F\u2B74\u2B75\u2B96\u2B97\u2BC9\u2BFF\u2C2F\u2C5F\u2CF4-\u2CF8\u2D26\u2D28-\u2D2C\u2D2E\u2D2F\u2D68-\u2D6E\u2D71-\u2D7E\u2D97-\u2D9F\u2DA7\u2DAF\u2DB7\u2DBF\u2DC7\u2DCF\u2DD7\u2DDF\u2E4F-\u2E7F\u2E9A\u2EF4-\u2EFF\u2FD6-\u2FEF\u2FFC-\u2FFF\u3040\u3097\u3098\u3100-\u3104\u3130\u318F\u31BB-\u31BF\u31E4-\u31EF\u321F\u32FF\u4DB6-\u4DBF\u9FF0-\u9FFF\uA48D-\uA48F\uA4C7-\uA4CF\uA62C-\uA63F\uA6F8-\uA6FF\uA7BA-\uA7F6\uA82C-\uA82F\uA83A-\uA83F\uA878-\uA87F\uA8C6-\uA8CD\uA8DA-\uA8DF\uA954-\uA95E\uA97D-\uA97F\uA9CE\uA9DA-\uA9DD\uA9FF\uAA37-\uAA3F\uAA4E\uAA4F\uAA5A\uAA5B\uAAC3-\uAADA\uAAF7-\uAB00\uAB07\uAB08\uAB0F\uAB10\uAB17-\uAB1F\uAB27\uAB2F\uAB66-\uAB6F\uABEE\uABEF\uABFA-\uABFF\uD7A4-\uD7AF\uD7C7-\uD7CA\uD7FC-\uF8FF\uFA6E\uFA6F\uFADA-\uFAFF\uFB07-\uFB12\uFB18-\uFB1C\uFB37\uFB3D\uFB3F\uFB42\uFB45\uFBC2-\uFBD2\uFD40-\uFD4F\uFD90\uFD91\uFDC8-\uFDEF\uFDFE\uFDFF\uFE1A-\uFE1F\uFE53\uFE67\uFE6C-\uFE6F\uFE75\uFEFD-\uFF00\uFFBF-\uFFC1\uFFC8\uFFC9\uFFD0\uFFD1\uFFD8\uFFD9\uFFDD-\uFFDF\uFFE7\uFFEF-\uFFFB\uFFFE\uFFFF', + 'astral': '\uD800[\uDC0C\uDC27\uDC3B\uDC3E\uDC4E\uDC4F\uDC5E-\uDC7F\uDCFB-\uDCFF\uDD03-\uDD06\uDD34-\uDD36\uDD8F\uDD9C-\uDD9F\uDDA1-\uDDCF\uDDFE-\uDE7F\uDE9D-\uDE9F\uDED1-\uDEDF\uDEFC-\uDEFF\uDF24-\uDF2C\uDF4B-\uDF4F\uDF7B-\uDF7F\uDF9E\uDFC4-\uDFC7\uDFD6-\uDFFF]|\uD801[\uDC9E\uDC9F\uDCAA-\uDCAF\uDCD4-\uDCD7\uDCFC-\uDCFF\uDD28-\uDD2F\uDD64-\uDD6E\uDD70-\uDDFF\uDF37-\uDF3F\uDF56-\uDF5F\uDF68-\uDFFF]|\uD802[\uDC06\uDC07\uDC09\uDC36\uDC39-\uDC3B\uDC3D\uDC3E\uDC56\uDC9F-\uDCA6\uDCB0-\uDCDF\uDCF3\uDCF6-\uDCFA\uDD1C-\uDD1E\uDD3A-\uDD3E\uDD40-\uDD7F\uDDB8-\uDDBB\uDDD0\uDDD1\uDE04\uDE07-\uDE0B\uDE14\uDE18\uDE36\uDE37\uDE3B-\uDE3E\uDE49-\uDE4F\uDE59-\uDE5F\uDEA0-\uDEBF\uDEE7-\uDEEA\uDEF7-\uDEFF\uDF36-\uDF38\uDF56\uDF57\uDF73-\uDF77\uDF92-\uDF98\uDF9D-\uDFA8\uDFB0-\uDFFF]|\uD803[\uDC49-\uDC7F\uDCB3-\uDCBF\uDCF3-\uDCF9\uDD28-\uDD2F\uDD3A-\uDE5F\uDE7F-\uDEFF\uDF28-\uDF2F\uDF5A-\uDFFF]|\uD804[\uDC4E-\uDC51\uDC70-\uDC7E\uDCBD\uDCC2-\uDCCF\uDCE9-\uDCEF\uDCFA-\uDCFF\uDD35\uDD47-\uDD4F\uDD77-\uDD7F\uDDCE\uDDCF\uDDE0\uDDF5-\uDDFF\uDE12\uDE3F-\uDE7F\uDE87\uDE89\uDE8E\uDE9E\uDEAA-\uDEAF\uDEEB-\uDEEF\uDEFA-\uDEFF\uDF04\uDF0D\uDF0E\uDF11\uDF12\uDF29\uDF31\uDF34\uDF3A\uDF45\uDF46\uDF49\uDF4A\uDF4E\uDF4F\uDF51-\uDF56\uDF58-\uDF5C\uDF64\uDF65\uDF6D-\uDF6F\uDF75-\uDFFF]|\uD805[\uDC5A\uDC5C\uDC5F-\uDC7F\uDCC8-\uDCCF\uDCDA-\uDD7F\uDDB6\uDDB7\uDDDE-\uDDFF\uDE45-\uDE4F\uDE5A-\uDE5F\uDE6D-\uDE7F\uDEB8-\uDEBF\uDECA-\uDEFF\uDF1B\uDF1C\uDF2C-\uDF2F\uDF40-\uDFFF]|\uD806[\uDC3C-\uDC9F\uDCF3-\uDCFE\uDD00-\uDDFF\uDE48-\uDE4F\uDE84\uDE85\uDEA3-\uDEBF\uDEF9-\uDFFF]|\uD807[\uDC09\uDC37\uDC46-\uDC4F\uDC6D-\uDC6F\uDC90\uDC91\uDCA8\uDCB7-\uDCFF\uDD07\uDD0A\uDD37-\uDD39\uDD3B\uDD3E\uDD48-\uDD4F\uDD5A-\uDD5F\uDD66\uDD69\uDD8F\uDD92\uDD99-\uDD9F\uDDAA-\uDEDF\uDEF9-\uDFFF]|\uD808[\uDF9A-\uDFFF]|\uD809[\uDC6F\uDC75-\uDC7F\uDD44-\uDFFF]|[\uD80A\uD80B\uD80E-\uD810\uD812-\uD819\uD823-\uD82B\uD82D\uD82E\uD830-\uD833\uD837\uD839\uD83F\uD87B-\uD87D\uD87F-\uDB3F\uDB41-\uDBFF][\uDC00-\uDFFF]|\uD80D[\uDC2F-\uDFFF]|\uD811[\uDE47-\uDFFF]|\uD81A[\uDE39-\uDE3F\uDE5F\uDE6A-\uDE6D\uDE70-\uDECF\uDEEE\uDEEF\uDEF6-\uDEFF\uDF46-\uDF4F\uDF5A\uDF62\uDF78-\uDF7C\uDF90-\uDFFF]|\uD81B[\uDC00-\uDE3F\uDE9B-\uDEFF\uDF45-\uDF4F\uDF7F-\uDF8E\uDFA0-\uDFDF\uDFE2-\uDFFF]|\uD821[\uDFF2-\uDFFF]|\uD822[\uDEF3-\uDFFF]|\uD82C[\uDD1F-\uDD6F\uDEFC-\uDFFF]|\uD82F[\uDC6B-\uDC6F\uDC7D-\uDC7F\uDC89-\uDC8F\uDC9A\uDC9B\uDCA0-\uDFFF]|\uD834[\uDCF6-\uDCFF\uDD27\uDD28\uDD73-\uDD7A\uDDE9-\uDDFF\uDE46-\uDEDF\uDEF4-\uDEFF\uDF57-\uDF5F\uDF79-\uDFFF]|\uD835[\uDC55\uDC9D\uDCA0\uDCA1\uDCA3\uDCA4\uDCA7\uDCA8\uDCAD\uDCBA\uDCBC\uDCC4\uDD06\uDD0B\uDD0C\uDD15\uDD1D\uDD3A\uDD3F\uDD45\uDD47-\uDD49\uDD51\uDEA6\uDEA7\uDFCC\uDFCD]|\uD836[\uDE8C-\uDE9A\uDEA0\uDEB0-\uDFFF]|\uD838[\uDC07\uDC19\uDC1A\uDC22\uDC25\uDC2B-\uDFFF]|\uD83A[\uDCC5\uDCC6\uDCD7-\uDCFF\uDD4B-\uDD4F\uDD5A-\uDD5D\uDD60-\uDFFF]|\uD83B[\uDC00-\uDC70\uDCB5-\uDDFF\uDE04\uDE20\uDE23\uDE25\uDE26\uDE28\uDE33\uDE38\uDE3A\uDE3C-\uDE41\uDE43-\uDE46\uDE48\uDE4A\uDE4C\uDE50\uDE53\uDE55\uDE56\uDE58\uDE5A\uDE5C\uDE5E\uDE60\uDE63\uDE65\uDE66\uDE6B\uDE73\uDE78\uDE7D\uDE7F\uDE8A\uDE9C-\uDEA0\uDEA4\uDEAA\uDEBC-\uDEEF\uDEF2-\uDFFF]|\uD83C[\uDC2C-\uDC2F\uDC94-\uDC9F\uDCAF\uDCB0\uDCC0\uDCD0\uDCF6-\uDCFF\uDD0D-\uDD0F\uDD6C-\uDD6F\uDDAD-\uDDE5\uDE03-\uDE0F\uDE3C-\uDE3F\uDE49-\uDE4F\uDE52-\uDE5F\uDE66-\uDEFF]|\uD83D[\uDED5-\uDEDF\uDEED-\uDEEF\uDEFA-\uDEFF\uDF74-\uDF7F\uDFD9-\uDFFF]|\uD83E[\uDC0C-\uDC0F\uDC48-\uDC4F\uDC5A-\uDC5F\uDC88-\uDC8F\uDCAE-\uDCFF\uDD0C-\uDD0F\uDD3F\uDD71\uDD72\uDD77-\uDD79\uDD7B\uDDA3-\uDDAF\uDDBA-\uDDBF\uDDC3-\uDDCF\uDE00-\uDE5F\uDE6E-\uDFFF]|\uD869[\uDED7-\uDEFF]|\uD86D[\uDF35-\uDF3F]|\uD86E[\uDC1E\uDC1F]|\uD873[\uDEA2-\uDEAF]|\uD87A[\uDFE1-\uDFFF]|\uD87E[\uDE1E-\uDFFF]|\uDB40[\uDC00-\uDCFF\uDDF0-\uDFFF]' + }, + { + 'name': 'Cc', + 'alias': 'Control', + 'bmp': '\0-\x1F\x7F-\x9F' + }, + { + 'name': 'Cf', + 'alias': 'Format', + 'bmp': '\xAD\u0600-\u0605\u061C\u06DD\u070F\u08E2\u180E\u200B-\u200F\u202A-\u202E\u2060-\u2064\u2066-\u206F\uFEFF\uFFF9-\uFFFB', + 'astral': '\uD804[\uDCBD\uDCCD]|\uD82F[\uDCA0-\uDCA3]|\uD834[\uDD73-\uDD7A]|\uDB40[\uDC01\uDC20-\uDC7F]' + }, + { + 'name': 'Cn', + 'alias': 'Unassigned', + 'bmp': '\u0378\u0379\u0380-\u0383\u038B\u038D\u03A2\u0530\u0557\u0558\u058B\u058C\u0590\u05C8-\u05CF\u05EB-\u05EE\u05F5-\u05FF\u061D\u070E\u074B\u074C\u07B2-\u07BF\u07FB\u07FC\u082E\u082F\u083F\u085C\u085D\u085F\u086B-\u089F\u08B5\u08BE-\u08D2\u0984\u098D\u098E\u0991\u0992\u09A9\u09B1\u09B3-\u09B5\u09BA\u09BB\u09C5\u09C6\u09C9\u09CA\u09CF-\u09D6\u09D8-\u09DB\u09DE\u09E4\u09E5\u09FF\u0A00\u0A04\u0A0B-\u0A0E\u0A11\u0A12\u0A29\u0A31\u0A34\u0A37\u0A3A\u0A3B\u0A3D\u0A43-\u0A46\u0A49\u0A4A\u0A4E-\u0A50\u0A52-\u0A58\u0A5D\u0A5F-\u0A65\u0A77-\u0A80\u0A84\u0A8E\u0A92\u0AA9\u0AB1\u0AB4\u0ABA\u0ABB\u0AC6\u0ACA\u0ACE\u0ACF\u0AD1-\u0ADF\u0AE4\u0AE5\u0AF2-\u0AF8\u0B00\u0B04\u0B0D\u0B0E\u0B11\u0B12\u0B29\u0B31\u0B34\u0B3A\u0B3B\u0B45\u0B46\u0B49\u0B4A\u0B4E-\u0B55\u0B58-\u0B5B\u0B5E\u0B64\u0B65\u0B78-\u0B81\u0B84\u0B8B-\u0B8D\u0B91\u0B96-\u0B98\u0B9B\u0B9D\u0BA0-\u0BA2\u0BA5-\u0BA7\u0BAB-\u0BAD\u0BBA-\u0BBD\u0BC3-\u0BC5\u0BC9\u0BCE\u0BCF\u0BD1-\u0BD6\u0BD8-\u0BE5\u0BFB-\u0BFF\u0C0D\u0C11\u0C29\u0C3A-\u0C3C\u0C45\u0C49\u0C4E-\u0C54\u0C57\u0C5B-\u0C5F\u0C64\u0C65\u0C70-\u0C77\u0C8D\u0C91\u0CA9\u0CB4\u0CBA\u0CBB\u0CC5\u0CC9\u0CCE-\u0CD4\u0CD7-\u0CDD\u0CDF\u0CE4\u0CE5\u0CF0\u0CF3-\u0CFF\u0D04\u0D0D\u0D11\u0D45\u0D49\u0D50-\u0D53\u0D64\u0D65\u0D80\u0D81\u0D84\u0D97-\u0D99\u0DB2\u0DBC\u0DBE\u0DBF\u0DC7-\u0DC9\u0DCB-\u0DCE\u0DD5\u0DD7\u0DE0-\u0DE5\u0DF0\u0DF1\u0DF5-\u0E00\u0E3B-\u0E3E\u0E5C-\u0E80\u0E83\u0E85\u0E86\u0E89\u0E8B\u0E8C\u0E8E-\u0E93\u0E98\u0EA0\u0EA4\u0EA6\u0EA8\u0EA9\u0EAC\u0EBA\u0EBE\u0EBF\u0EC5\u0EC7\u0ECE\u0ECF\u0EDA\u0EDB\u0EE0-\u0EFF\u0F48\u0F6D-\u0F70\u0F98\u0FBD\u0FCD\u0FDB-\u0FFF\u10C6\u10C8-\u10CC\u10CE\u10CF\u1249\u124E\u124F\u1257\u1259\u125E\u125F\u1289\u128E\u128F\u12B1\u12B6\u12B7\u12BF\u12C1\u12C6\u12C7\u12D7\u1311\u1316\u1317\u135B\u135C\u137D-\u137F\u139A-\u139F\u13F6\u13F7\u13FE\u13FF\u169D-\u169F\u16F9-\u16FF\u170D\u1715-\u171F\u1737-\u173F\u1754-\u175F\u176D\u1771\u1774-\u177F\u17DE\u17DF\u17EA-\u17EF\u17FA-\u17FF\u180F\u181A-\u181F\u1879-\u187F\u18AB-\u18AF\u18F6-\u18FF\u191F\u192C-\u192F\u193C-\u193F\u1941-\u1943\u196E\u196F\u1975-\u197F\u19AC-\u19AF\u19CA-\u19CF\u19DB-\u19DD\u1A1C\u1A1D\u1A5F\u1A7D\u1A7E\u1A8A-\u1A8F\u1A9A-\u1A9F\u1AAE\u1AAF\u1ABF-\u1AFF\u1B4C-\u1B4F\u1B7D-\u1B7F\u1BF4-\u1BFB\u1C38-\u1C3A\u1C4A-\u1C4C\u1C89-\u1C8F\u1CBB\u1CBC\u1CC8-\u1CCF\u1CFA-\u1CFF\u1DFA\u1F16\u1F17\u1F1E\u1F1F\u1F46\u1F47\u1F4E\u1F4F\u1F58\u1F5A\u1F5C\u1F5E\u1F7E\u1F7F\u1FB5\u1FC5\u1FD4\u1FD5\u1FDC\u1FF0\u1FF1\u1FF5\u1FFF\u2065\u2072\u2073\u208F\u209D-\u209F\u20C0-\u20CF\u20F1-\u20FF\u218C-\u218F\u2427-\u243F\u244B-\u245F\u2B74\u2B75\u2B96\u2B97\u2BC9\u2BFF\u2C2F\u2C5F\u2CF4-\u2CF8\u2D26\u2D28-\u2D2C\u2D2E\u2D2F\u2D68-\u2D6E\u2D71-\u2D7E\u2D97-\u2D9F\u2DA7\u2DAF\u2DB7\u2DBF\u2DC7\u2DCF\u2DD7\u2DDF\u2E4F-\u2E7F\u2E9A\u2EF4-\u2EFF\u2FD6-\u2FEF\u2FFC-\u2FFF\u3040\u3097\u3098\u3100-\u3104\u3130\u318F\u31BB-\u31BF\u31E4-\u31EF\u321F\u32FF\u4DB6-\u4DBF\u9FF0-\u9FFF\uA48D-\uA48F\uA4C7-\uA4CF\uA62C-\uA63F\uA6F8-\uA6FF\uA7BA-\uA7F6\uA82C-\uA82F\uA83A-\uA83F\uA878-\uA87F\uA8C6-\uA8CD\uA8DA-\uA8DF\uA954-\uA95E\uA97D-\uA97F\uA9CE\uA9DA-\uA9DD\uA9FF\uAA37-\uAA3F\uAA4E\uAA4F\uAA5A\uAA5B\uAAC3-\uAADA\uAAF7-\uAB00\uAB07\uAB08\uAB0F\uAB10\uAB17-\uAB1F\uAB27\uAB2F\uAB66-\uAB6F\uABEE\uABEF\uABFA-\uABFF\uD7A4-\uD7AF\uD7C7-\uD7CA\uD7FC-\uD7FF\uFA6E\uFA6F\uFADA-\uFAFF\uFB07-\uFB12\uFB18-\uFB1C\uFB37\uFB3D\uFB3F\uFB42\uFB45\uFBC2-\uFBD2\uFD40-\uFD4F\uFD90\uFD91\uFDC8-\uFDEF\uFDFE\uFDFF\uFE1A-\uFE1F\uFE53\uFE67\uFE6C-\uFE6F\uFE75\uFEFD\uFEFE\uFF00\uFFBF-\uFFC1\uFFC8\uFFC9\uFFD0\uFFD1\uFFD8\uFFD9\uFFDD-\uFFDF\uFFE7\uFFEF-\uFFF8\uFFFE\uFFFF', + 'astral': '\uD800[\uDC0C\uDC27\uDC3B\uDC3E\uDC4E\uDC4F\uDC5E-\uDC7F\uDCFB-\uDCFF\uDD03-\uDD06\uDD34-\uDD36\uDD8F\uDD9C-\uDD9F\uDDA1-\uDDCF\uDDFE-\uDE7F\uDE9D-\uDE9F\uDED1-\uDEDF\uDEFC-\uDEFF\uDF24-\uDF2C\uDF4B-\uDF4F\uDF7B-\uDF7F\uDF9E\uDFC4-\uDFC7\uDFD6-\uDFFF]|\uD801[\uDC9E\uDC9F\uDCAA-\uDCAF\uDCD4-\uDCD7\uDCFC-\uDCFF\uDD28-\uDD2F\uDD64-\uDD6E\uDD70-\uDDFF\uDF37-\uDF3F\uDF56-\uDF5F\uDF68-\uDFFF]|\uD802[\uDC06\uDC07\uDC09\uDC36\uDC39-\uDC3B\uDC3D\uDC3E\uDC56\uDC9F-\uDCA6\uDCB0-\uDCDF\uDCF3\uDCF6-\uDCFA\uDD1C-\uDD1E\uDD3A-\uDD3E\uDD40-\uDD7F\uDDB8-\uDDBB\uDDD0\uDDD1\uDE04\uDE07-\uDE0B\uDE14\uDE18\uDE36\uDE37\uDE3B-\uDE3E\uDE49-\uDE4F\uDE59-\uDE5F\uDEA0-\uDEBF\uDEE7-\uDEEA\uDEF7-\uDEFF\uDF36-\uDF38\uDF56\uDF57\uDF73-\uDF77\uDF92-\uDF98\uDF9D-\uDFA8\uDFB0-\uDFFF]|\uD803[\uDC49-\uDC7F\uDCB3-\uDCBF\uDCF3-\uDCF9\uDD28-\uDD2F\uDD3A-\uDE5F\uDE7F-\uDEFF\uDF28-\uDF2F\uDF5A-\uDFFF]|\uD804[\uDC4E-\uDC51\uDC70-\uDC7E\uDCC2-\uDCCC\uDCCE\uDCCF\uDCE9-\uDCEF\uDCFA-\uDCFF\uDD35\uDD47-\uDD4F\uDD77-\uDD7F\uDDCE\uDDCF\uDDE0\uDDF5-\uDDFF\uDE12\uDE3F-\uDE7F\uDE87\uDE89\uDE8E\uDE9E\uDEAA-\uDEAF\uDEEB-\uDEEF\uDEFA-\uDEFF\uDF04\uDF0D\uDF0E\uDF11\uDF12\uDF29\uDF31\uDF34\uDF3A\uDF45\uDF46\uDF49\uDF4A\uDF4E\uDF4F\uDF51-\uDF56\uDF58-\uDF5C\uDF64\uDF65\uDF6D-\uDF6F\uDF75-\uDFFF]|\uD805[\uDC5A\uDC5C\uDC5F-\uDC7F\uDCC8-\uDCCF\uDCDA-\uDD7F\uDDB6\uDDB7\uDDDE-\uDDFF\uDE45-\uDE4F\uDE5A-\uDE5F\uDE6D-\uDE7F\uDEB8-\uDEBF\uDECA-\uDEFF\uDF1B\uDF1C\uDF2C-\uDF2F\uDF40-\uDFFF]|\uD806[\uDC3C-\uDC9F\uDCF3-\uDCFE\uDD00-\uDDFF\uDE48-\uDE4F\uDE84\uDE85\uDEA3-\uDEBF\uDEF9-\uDFFF]|\uD807[\uDC09\uDC37\uDC46-\uDC4F\uDC6D-\uDC6F\uDC90\uDC91\uDCA8\uDCB7-\uDCFF\uDD07\uDD0A\uDD37-\uDD39\uDD3B\uDD3E\uDD48-\uDD4F\uDD5A-\uDD5F\uDD66\uDD69\uDD8F\uDD92\uDD99-\uDD9F\uDDAA-\uDEDF\uDEF9-\uDFFF]|\uD808[\uDF9A-\uDFFF]|\uD809[\uDC6F\uDC75-\uDC7F\uDD44-\uDFFF]|[\uD80A\uD80B\uD80E-\uD810\uD812-\uD819\uD823-\uD82B\uD82D\uD82E\uD830-\uD833\uD837\uD839\uD83F\uD87B-\uD87D\uD87F-\uDB3F\uDB41-\uDB7F][\uDC00-\uDFFF]|\uD80D[\uDC2F-\uDFFF]|\uD811[\uDE47-\uDFFF]|\uD81A[\uDE39-\uDE3F\uDE5F\uDE6A-\uDE6D\uDE70-\uDECF\uDEEE\uDEEF\uDEF6-\uDEFF\uDF46-\uDF4F\uDF5A\uDF62\uDF78-\uDF7C\uDF90-\uDFFF]|\uD81B[\uDC00-\uDE3F\uDE9B-\uDEFF\uDF45-\uDF4F\uDF7F-\uDF8E\uDFA0-\uDFDF\uDFE2-\uDFFF]|\uD821[\uDFF2-\uDFFF]|\uD822[\uDEF3-\uDFFF]|\uD82C[\uDD1F-\uDD6F\uDEFC-\uDFFF]|\uD82F[\uDC6B-\uDC6F\uDC7D-\uDC7F\uDC89-\uDC8F\uDC9A\uDC9B\uDCA4-\uDFFF]|\uD834[\uDCF6-\uDCFF\uDD27\uDD28\uDDE9-\uDDFF\uDE46-\uDEDF\uDEF4-\uDEFF\uDF57-\uDF5F\uDF79-\uDFFF]|\uD835[\uDC55\uDC9D\uDCA0\uDCA1\uDCA3\uDCA4\uDCA7\uDCA8\uDCAD\uDCBA\uDCBC\uDCC4\uDD06\uDD0B\uDD0C\uDD15\uDD1D\uDD3A\uDD3F\uDD45\uDD47-\uDD49\uDD51\uDEA6\uDEA7\uDFCC\uDFCD]|\uD836[\uDE8C-\uDE9A\uDEA0\uDEB0-\uDFFF]|\uD838[\uDC07\uDC19\uDC1A\uDC22\uDC25\uDC2B-\uDFFF]|\uD83A[\uDCC5\uDCC6\uDCD7-\uDCFF\uDD4B-\uDD4F\uDD5A-\uDD5D\uDD60-\uDFFF]|\uD83B[\uDC00-\uDC70\uDCB5-\uDDFF\uDE04\uDE20\uDE23\uDE25\uDE26\uDE28\uDE33\uDE38\uDE3A\uDE3C-\uDE41\uDE43-\uDE46\uDE48\uDE4A\uDE4C\uDE50\uDE53\uDE55\uDE56\uDE58\uDE5A\uDE5C\uDE5E\uDE60\uDE63\uDE65\uDE66\uDE6B\uDE73\uDE78\uDE7D\uDE7F\uDE8A\uDE9C-\uDEA0\uDEA4\uDEAA\uDEBC-\uDEEF\uDEF2-\uDFFF]|\uD83C[\uDC2C-\uDC2F\uDC94-\uDC9F\uDCAF\uDCB0\uDCC0\uDCD0\uDCF6-\uDCFF\uDD0D-\uDD0F\uDD6C-\uDD6F\uDDAD-\uDDE5\uDE03-\uDE0F\uDE3C-\uDE3F\uDE49-\uDE4F\uDE52-\uDE5F\uDE66-\uDEFF]|\uD83D[\uDED5-\uDEDF\uDEED-\uDEEF\uDEFA-\uDEFF\uDF74-\uDF7F\uDFD9-\uDFFF]|\uD83E[\uDC0C-\uDC0F\uDC48-\uDC4F\uDC5A-\uDC5F\uDC88-\uDC8F\uDCAE-\uDCFF\uDD0C-\uDD0F\uDD3F\uDD71\uDD72\uDD77-\uDD79\uDD7B\uDDA3-\uDDAF\uDDBA-\uDDBF\uDDC3-\uDDCF\uDE00-\uDE5F\uDE6E-\uDFFF]|\uD869[\uDED7-\uDEFF]|\uD86D[\uDF35-\uDF3F]|\uD86E[\uDC1E\uDC1F]|\uD873[\uDEA2-\uDEAF]|\uD87A[\uDFE1-\uDFFF]|\uD87E[\uDE1E-\uDFFF]|\uDB40[\uDC00\uDC02-\uDC1F\uDC80-\uDCFF\uDDF0-\uDFFF]|[\uDBBF\uDBFF][\uDFFE\uDFFF]' + }, + { + 'name': 'Co', + 'alias': 'Private_Use', + 'bmp': '\uE000-\uF8FF', + 'astral': '[\uDB80-\uDBBE\uDBC0-\uDBFE][\uDC00-\uDFFF]|[\uDBBF\uDBFF][\uDC00-\uDFFD]' + }, + { + 'name': 'Cs', + 'alias': 'Surrogate', + 'bmp': '\uD800-\uDFFF' + }, + { + 'name': 'L', + 'alias': 'Letter', + 'bmp': 'A-Za-z\xAA\xB5\xBA\xC0-\xD6\xD8-\xF6\xF8-\u02C1\u02C6-\u02D1\u02E0-\u02E4\u02EC\u02EE\u0370-\u0374\u0376\u0377\u037A-\u037D\u037F\u0386\u0388-\u038A\u038C\u038E-\u03A1\u03A3-\u03F5\u03F7-\u0481\u048A-\u052F\u0531-\u0556\u0559\u0560-\u0588\u05D0-\u05EA\u05EF-\u05F2\u0620-\u064A\u066E\u066F\u0671-\u06D3\u06D5\u06E5\u06E6\u06EE\u06EF\u06FA-\u06FC\u06FF\u0710\u0712-\u072F\u074D-\u07A5\u07B1\u07CA-\u07EA\u07F4\u07F5\u07FA\u0800-\u0815\u081A\u0824\u0828\u0840-\u0858\u0860-\u086A\u08A0-\u08B4\u08B6-\u08BD\u0904-\u0939\u093D\u0950\u0958-\u0961\u0971-\u0980\u0985-\u098C\u098F\u0990\u0993-\u09A8\u09AA-\u09B0\u09B2\u09B6-\u09B9\u09BD\u09CE\u09DC\u09DD\u09DF-\u09E1\u09F0\u09F1\u09FC\u0A05-\u0A0A\u0A0F\u0A10\u0A13-\u0A28\u0A2A-\u0A30\u0A32\u0A33\u0A35\u0A36\u0A38\u0A39\u0A59-\u0A5C\u0A5E\u0A72-\u0A74\u0A85-\u0A8D\u0A8F-\u0A91\u0A93-\u0AA8\u0AAA-\u0AB0\u0AB2\u0AB3\u0AB5-\u0AB9\u0ABD\u0AD0\u0AE0\u0AE1\u0AF9\u0B05-\u0B0C\u0B0F\u0B10\u0B13-\u0B28\u0B2A-\u0B30\u0B32\u0B33\u0B35-\u0B39\u0B3D\u0B5C\u0B5D\u0B5F-\u0B61\u0B71\u0B83\u0B85-\u0B8A\u0B8E-\u0B90\u0B92-\u0B95\u0B99\u0B9A\u0B9C\u0B9E\u0B9F\u0BA3\u0BA4\u0BA8-\u0BAA\u0BAE-\u0BB9\u0BD0\u0C05-\u0C0C\u0C0E-\u0C10\u0C12-\u0C28\u0C2A-\u0C39\u0C3D\u0C58-\u0C5A\u0C60\u0C61\u0C80\u0C85-\u0C8C\u0C8E-\u0C90\u0C92-\u0CA8\u0CAA-\u0CB3\u0CB5-\u0CB9\u0CBD\u0CDE\u0CE0\u0CE1\u0CF1\u0CF2\u0D05-\u0D0C\u0D0E-\u0D10\u0D12-\u0D3A\u0D3D\u0D4E\u0D54-\u0D56\u0D5F-\u0D61\u0D7A-\u0D7F\u0D85-\u0D96\u0D9A-\u0DB1\u0DB3-\u0DBB\u0DBD\u0DC0-\u0DC6\u0E01-\u0E30\u0E32\u0E33\u0E40-\u0E46\u0E81\u0E82\u0E84\u0E87\u0E88\u0E8A\u0E8D\u0E94-\u0E97\u0E99-\u0E9F\u0EA1-\u0EA3\u0EA5\u0EA7\u0EAA\u0EAB\u0EAD-\u0EB0\u0EB2\u0EB3\u0EBD\u0EC0-\u0EC4\u0EC6\u0EDC-\u0EDF\u0F00\u0F40-\u0F47\u0F49-\u0F6C\u0F88-\u0F8C\u1000-\u102A\u103F\u1050-\u1055\u105A-\u105D\u1061\u1065\u1066\u106E-\u1070\u1075-\u1081\u108E\u10A0-\u10C5\u10C7\u10CD\u10D0-\u10FA\u10FC-\u1248\u124A-\u124D\u1250-\u1256\u1258\u125A-\u125D\u1260-\u1288\u128A-\u128D\u1290-\u12B0\u12B2-\u12B5\u12B8-\u12BE\u12C0\u12C2-\u12C5\u12C8-\u12D6\u12D8-\u1310\u1312-\u1315\u1318-\u135A\u1380-\u138F\u13A0-\u13F5\u13F8-\u13FD\u1401-\u166C\u166F-\u167F\u1681-\u169A\u16A0-\u16EA\u16F1-\u16F8\u1700-\u170C\u170E-\u1711\u1720-\u1731\u1740-\u1751\u1760-\u176C\u176E-\u1770\u1780-\u17B3\u17D7\u17DC\u1820-\u1878\u1880-\u1884\u1887-\u18A8\u18AA\u18B0-\u18F5\u1900-\u191E\u1950-\u196D\u1970-\u1974\u1980-\u19AB\u19B0-\u19C9\u1A00-\u1A16\u1A20-\u1A54\u1AA7\u1B05-\u1B33\u1B45-\u1B4B\u1B83-\u1BA0\u1BAE\u1BAF\u1BBA-\u1BE5\u1C00-\u1C23\u1C4D-\u1C4F\u1C5A-\u1C7D\u1C80-\u1C88\u1C90-\u1CBA\u1CBD-\u1CBF\u1CE9-\u1CEC\u1CEE-\u1CF1\u1CF5\u1CF6\u1D00-\u1DBF\u1E00-\u1F15\u1F18-\u1F1D\u1F20-\u1F45\u1F48-\u1F4D\u1F50-\u1F57\u1F59\u1F5B\u1F5D\u1F5F-\u1F7D\u1F80-\u1FB4\u1FB6-\u1FBC\u1FBE\u1FC2-\u1FC4\u1FC6-\u1FCC\u1FD0-\u1FD3\u1FD6-\u1FDB\u1FE0-\u1FEC\u1FF2-\u1FF4\u1FF6-\u1FFC\u2071\u207F\u2090-\u209C\u2102\u2107\u210A-\u2113\u2115\u2119-\u211D\u2124\u2126\u2128\u212A-\u212D\u212F-\u2139\u213C-\u213F\u2145-\u2149\u214E\u2183\u2184\u2C00-\u2C2E\u2C30-\u2C5E\u2C60-\u2CE4\u2CEB-\u2CEE\u2CF2\u2CF3\u2D00-\u2D25\u2D27\u2D2D\u2D30-\u2D67\u2D6F\u2D80-\u2D96\u2DA0-\u2DA6\u2DA8-\u2DAE\u2DB0-\u2DB6\u2DB8-\u2DBE\u2DC0-\u2DC6\u2DC8-\u2DCE\u2DD0-\u2DD6\u2DD8-\u2DDE\u2E2F\u3005\u3006\u3031-\u3035\u303B\u303C\u3041-\u3096\u309D-\u309F\u30A1-\u30FA\u30FC-\u30FF\u3105-\u312F\u3131-\u318E\u31A0-\u31BA\u31F0-\u31FF\u3400-\u4DB5\u4E00-\u9FEF\uA000-\uA48C\uA4D0-\uA4FD\uA500-\uA60C\uA610-\uA61F\uA62A\uA62B\uA640-\uA66E\uA67F-\uA69D\uA6A0-\uA6E5\uA717-\uA71F\uA722-\uA788\uA78B-\uA7B9\uA7F7-\uA801\uA803-\uA805\uA807-\uA80A\uA80C-\uA822\uA840-\uA873\uA882-\uA8B3\uA8F2-\uA8F7\uA8FB\uA8FD\uA8FE\uA90A-\uA925\uA930-\uA946\uA960-\uA97C\uA984-\uA9B2\uA9CF\uA9E0-\uA9E4\uA9E6-\uA9EF\uA9FA-\uA9FE\uAA00-\uAA28\uAA40-\uAA42\uAA44-\uAA4B\uAA60-\uAA76\uAA7A\uAA7E-\uAAAF\uAAB1\uAAB5\uAAB6\uAAB9-\uAABD\uAAC0\uAAC2\uAADB-\uAADD\uAAE0-\uAAEA\uAAF2-\uAAF4\uAB01-\uAB06\uAB09-\uAB0E\uAB11-\uAB16\uAB20-\uAB26\uAB28-\uAB2E\uAB30-\uAB5A\uAB5C-\uAB65\uAB70-\uABE2\uAC00-\uD7A3\uD7B0-\uD7C6\uD7CB-\uD7FB\uF900-\uFA6D\uFA70-\uFAD9\uFB00-\uFB06\uFB13-\uFB17\uFB1D\uFB1F-\uFB28\uFB2A-\uFB36\uFB38-\uFB3C\uFB3E\uFB40\uFB41\uFB43\uFB44\uFB46-\uFBB1\uFBD3-\uFD3D\uFD50-\uFD8F\uFD92-\uFDC7\uFDF0-\uFDFB\uFE70-\uFE74\uFE76-\uFEFC\uFF21-\uFF3A\uFF41-\uFF5A\uFF66-\uFFBE\uFFC2-\uFFC7\uFFCA-\uFFCF\uFFD2-\uFFD7\uFFDA-\uFFDC', + 'astral': '\uD800[\uDC00-\uDC0B\uDC0D-\uDC26\uDC28-\uDC3A\uDC3C\uDC3D\uDC3F-\uDC4D\uDC50-\uDC5D\uDC80-\uDCFA\uDE80-\uDE9C\uDEA0-\uDED0\uDF00-\uDF1F\uDF2D-\uDF40\uDF42-\uDF49\uDF50-\uDF75\uDF80-\uDF9D\uDFA0-\uDFC3\uDFC8-\uDFCF]|\uD801[\uDC00-\uDC9D\uDCB0-\uDCD3\uDCD8-\uDCFB\uDD00-\uDD27\uDD30-\uDD63\uDE00-\uDF36\uDF40-\uDF55\uDF60-\uDF67]|\uD802[\uDC00-\uDC05\uDC08\uDC0A-\uDC35\uDC37\uDC38\uDC3C\uDC3F-\uDC55\uDC60-\uDC76\uDC80-\uDC9E\uDCE0-\uDCF2\uDCF4\uDCF5\uDD00-\uDD15\uDD20-\uDD39\uDD80-\uDDB7\uDDBE\uDDBF\uDE00\uDE10-\uDE13\uDE15-\uDE17\uDE19-\uDE35\uDE60-\uDE7C\uDE80-\uDE9C\uDEC0-\uDEC7\uDEC9-\uDEE4\uDF00-\uDF35\uDF40-\uDF55\uDF60-\uDF72\uDF80-\uDF91]|\uD803[\uDC00-\uDC48\uDC80-\uDCB2\uDCC0-\uDCF2\uDD00-\uDD23\uDF00-\uDF1C\uDF27\uDF30-\uDF45]|\uD804[\uDC03-\uDC37\uDC83-\uDCAF\uDCD0-\uDCE8\uDD03-\uDD26\uDD44\uDD50-\uDD72\uDD76\uDD83-\uDDB2\uDDC1-\uDDC4\uDDDA\uDDDC\uDE00-\uDE11\uDE13-\uDE2B\uDE80-\uDE86\uDE88\uDE8A-\uDE8D\uDE8F-\uDE9D\uDE9F-\uDEA8\uDEB0-\uDEDE\uDF05-\uDF0C\uDF0F\uDF10\uDF13-\uDF28\uDF2A-\uDF30\uDF32\uDF33\uDF35-\uDF39\uDF3D\uDF50\uDF5D-\uDF61]|\uD805[\uDC00-\uDC34\uDC47-\uDC4A\uDC80-\uDCAF\uDCC4\uDCC5\uDCC7\uDD80-\uDDAE\uDDD8-\uDDDB\uDE00-\uDE2F\uDE44\uDE80-\uDEAA\uDF00-\uDF1A]|\uD806[\uDC00-\uDC2B\uDCA0-\uDCDF\uDCFF\uDE00\uDE0B-\uDE32\uDE3A\uDE50\uDE5C-\uDE83\uDE86-\uDE89\uDE9D\uDEC0-\uDEF8]|\uD807[\uDC00-\uDC08\uDC0A-\uDC2E\uDC40\uDC72-\uDC8F\uDD00-\uDD06\uDD08\uDD09\uDD0B-\uDD30\uDD46\uDD60-\uDD65\uDD67\uDD68\uDD6A-\uDD89\uDD98\uDEE0-\uDEF2]|\uD808[\uDC00-\uDF99]|\uD809[\uDC80-\uDD43]|[\uD80C\uD81C-\uD820\uD840-\uD868\uD86A-\uD86C\uD86F-\uD872\uD874-\uD879][\uDC00-\uDFFF]|\uD80D[\uDC00-\uDC2E]|\uD811[\uDC00-\uDE46]|\uD81A[\uDC00-\uDE38\uDE40-\uDE5E\uDED0-\uDEED\uDF00-\uDF2F\uDF40-\uDF43\uDF63-\uDF77\uDF7D-\uDF8F]|\uD81B[\uDE40-\uDE7F\uDF00-\uDF44\uDF50\uDF93-\uDF9F\uDFE0\uDFE1]|\uD821[\uDC00-\uDFF1]|\uD822[\uDC00-\uDEF2]|\uD82C[\uDC00-\uDD1E\uDD70-\uDEFB]|\uD82F[\uDC00-\uDC6A\uDC70-\uDC7C\uDC80-\uDC88\uDC90-\uDC99]|\uD835[\uDC00-\uDC54\uDC56-\uDC9C\uDC9E\uDC9F\uDCA2\uDCA5\uDCA6\uDCA9-\uDCAC\uDCAE-\uDCB9\uDCBB\uDCBD-\uDCC3\uDCC5-\uDD05\uDD07-\uDD0A\uDD0D-\uDD14\uDD16-\uDD1C\uDD1E-\uDD39\uDD3B-\uDD3E\uDD40-\uDD44\uDD46\uDD4A-\uDD50\uDD52-\uDEA5\uDEA8-\uDEC0\uDEC2-\uDEDA\uDEDC-\uDEFA\uDEFC-\uDF14\uDF16-\uDF34\uDF36-\uDF4E\uDF50-\uDF6E\uDF70-\uDF88\uDF8A-\uDFA8\uDFAA-\uDFC2\uDFC4-\uDFCB]|\uD83A[\uDC00-\uDCC4\uDD00-\uDD43]|\uD83B[\uDE00-\uDE03\uDE05-\uDE1F\uDE21\uDE22\uDE24\uDE27\uDE29-\uDE32\uDE34-\uDE37\uDE39\uDE3B\uDE42\uDE47\uDE49\uDE4B\uDE4D-\uDE4F\uDE51\uDE52\uDE54\uDE57\uDE59\uDE5B\uDE5D\uDE5F\uDE61\uDE62\uDE64\uDE67-\uDE6A\uDE6C-\uDE72\uDE74-\uDE77\uDE79-\uDE7C\uDE7E\uDE80-\uDE89\uDE8B-\uDE9B\uDEA1-\uDEA3\uDEA5-\uDEA9\uDEAB-\uDEBB]|\uD869[\uDC00-\uDED6\uDF00-\uDFFF]|\uD86D[\uDC00-\uDF34\uDF40-\uDFFF]|\uD86E[\uDC00-\uDC1D\uDC20-\uDFFF]|\uD873[\uDC00-\uDEA1\uDEB0-\uDFFF]|\uD87A[\uDC00-\uDFE0]|\uD87E[\uDC00-\uDE1D]' + }, + { + 'name': 'LC', + 'alias': 'Cased_Letter', + 'bmp': 'A-Za-z\xB5\xC0-\xD6\xD8-\xF6\xF8-\u01BA\u01BC-\u01BF\u01C4-\u0293\u0295-\u02AF\u0370-\u0373\u0376\u0377\u037B-\u037D\u037F\u0386\u0388-\u038A\u038C\u038E-\u03A1\u03A3-\u03F5\u03F7-\u0481\u048A-\u052F\u0531-\u0556\u0560-\u0588\u10A0-\u10C5\u10C7\u10CD\u10D0-\u10FA\u10FD-\u10FF\u13A0-\u13F5\u13F8-\u13FD\u1C80-\u1C88\u1C90-\u1CBA\u1CBD-\u1CBF\u1D00-\u1D2B\u1D6B-\u1D77\u1D79-\u1D9A\u1E00-\u1F15\u1F18-\u1F1D\u1F20-\u1F45\u1F48-\u1F4D\u1F50-\u1F57\u1F59\u1F5B\u1F5D\u1F5F-\u1F7D\u1F80-\u1FB4\u1FB6-\u1FBC\u1FBE\u1FC2-\u1FC4\u1FC6-\u1FCC\u1FD0-\u1FD3\u1FD6-\u1FDB\u1FE0-\u1FEC\u1FF2-\u1FF4\u1FF6-\u1FFC\u2102\u2107\u210A-\u2113\u2115\u2119-\u211D\u2124\u2126\u2128\u212A-\u212D\u212F-\u2134\u2139\u213C-\u213F\u2145-\u2149\u214E\u2183\u2184\u2C00-\u2C2E\u2C30-\u2C5E\u2C60-\u2C7B\u2C7E-\u2CE4\u2CEB-\u2CEE\u2CF2\u2CF3\u2D00-\u2D25\u2D27\u2D2D\uA640-\uA66D\uA680-\uA69B\uA722-\uA76F\uA771-\uA787\uA78B-\uA78E\uA790-\uA7B9\uA7FA\uAB30-\uAB5A\uAB60-\uAB65\uAB70-\uABBF\uFB00-\uFB06\uFB13-\uFB17\uFF21-\uFF3A\uFF41-\uFF5A', + 'astral': '\uD801[\uDC00-\uDC4F\uDCB0-\uDCD3\uDCD8-\uDCFB]|\uD803[\uDC80-\uDCB2\uDCC0-\uDCF2]|\uD806[\uDCA0-\uDCDF]|\uD81B[\uDE40-\uDE7F]|\uD835[\uDC00-\uDC54\uDC56-\uDC9C\uDC9E\uDC9F\uDCA2\uDCA5\uDCA6\uDCA9-\uDCAC\uDCAE-\uDCB9\uDCBB\uDCBD-\uDCC3\uDCC5-\uDD05\uDD07-\uDD0A\uDD0D-\uDD14\uDD16-\uDD1C\uDD1E-\uDD39\uDD3B-\uDD3E\uDD40-\uDD44\uDD46\uDD4A-\uDD50\uDD52-\uDEA5\uDEA8-\uDEC0\uDEC2-\uDEDA\uDEDC-\uDEFA\uDEFC-\uDF14\uDF16-\uDF34\uDF36-\uDF4E\uDF50-\uDF6E\uDF70-\uDF88\uDF8A-\uDFA8\uDFAA-\uDFC2\uDFC4-\uDFCB]|\uD83A[\uDD00-\uDD43]' + }, + { + 'name': 'Ll', + 'alias': 'Lowercase_Letter', + 'bmp': 'a-z\xB5\xDF-\xF6\xF8-\xFF\u0101\u0103\u0105\u0107\u0109\u010B\u010D\u010F\u0111\u0113\u0115\u0117\u0119\u011B\u011D\u011F\u0121\u0123\u0125\u0127\u0129\u012B\u012D\u012F\u0131\u0133\u0135\u0137\u0138\u013A\u013C\u013E\u0140\u0142\u0144\u0146\u0148\u0149\u014B\u014D\u014F\u0151\u0153\u0155\u0157\u0159\u015B\u015D\u015F\u0161\u0163\u0165\u0167\u0169\u016B\u016D\u016F\u0171\u0173\u0175\u0177\u017A\u017C\u017E-\u0180\u0183\u0185\u0188\u018C\u018D\u0192\u0195\u0199-\u019B\u019E\u01A1\u01A3\u01A5\u01A8\u01AA\u01AB\u01AD\u01B0\u01B4\u01B6\u01B9\u01BA\u01BD-\u01BF\u01C6\u01C9\u01CC\u01CE\u01D0\u01D2\u01D4\u01D6\u01D8\u01DA\u01DC\u01DD\u01DF\u01E1\u01E3\u01E5\u01E7\u01E9\u01EB\u01ED\u01EF\u01F0\u01F3\u01F5\u01F9\u01FB\u01FD\u01FF\u0201\u0203\u0205\u0207\u0209\u020B\u020D\u020F\u0211\u0213\u0215\u0217\u0219\u021B\u021D\u021F\u0221\u0223\u0225\u0227\u0229\u022B\u022D\u022F\u0231\u0233-\u0239\u023C\u023F\u0240\u0242\u0247\u0249\u024B\u024D\u024F-\u0293\u0295-\u02AF\u0371\u0373\u0377\u037B-\u037D\u0390\u03AC-\u03CE\u03D0\u03D1\u03D5-\u03D7\u03D9\u03DB\u03DD\u03DF\u03E1\u03E3\u03E5\u03E7\u03E9\u03EB\u03ED\u03EF-\u03F3\u03F5\u03F8\u03FB\u03FC\u0430-\u045F\u0461\u0463\u0465\u0467\u0469\u046B\u046D\u046F\u0471\u0473\u0475\u0477\u0479\u047B\u047D\u047F\u0481\u048B\u048D\u048F\u0491\u0493\u0495\u0497\u0499\u049B\u049D\u049F\u04A1\u04A3\u04A5\u04A7\u04A9\u04AB\u04AD\u04AF\u04B1\u04B3\u04B5\u04B7\u04B9\u04BB\u04BD\u04BF\u04C2\u04C4\u04C6\u04C8\u04CA\u04CC\u04CE\u04CF\u04D1\u04D3\u04D5\u04D7\u04D9\u04DB\u04DD\u04DF\u04E1\u04E3\u04E5\u04E7\u04E9\u04EB\u04ED\u04EF\u04F1\u04F3\u04F5\u04F7\u04F9\u04FB\u04FD\u04FF\u0501\u0503\u0505\u0507\u0509\u050B\u050D\u050F\u0511\u0513\u0515\u0517\u0519\u051B\u051D\u051F\u0521\u0523\u0525\u0527\u0529\u052B\u052D\u052F\u0560-\u0588\u10D0-\u10FA\u10FD-\u10FF\u13F8-\u13FD\u1C80-\u1C88\u1D00-\u1D2B\u1D6B-\u1D77\u1D79-\u1D9A\u1E01\u1E03\u1E05\u1E07\u1E09\u1E0B\u1E0D\u1E0F\u1E11\u1E13\u1E15\u1E17\u1E19\u1E1B\u1E1D\u1E1F\u1E21\u1E23\u1E25\u1E27\u1E29\u1E2B\u1E2D\u1E2F\u1E31\u1E33\u1E35\u1E37\u1E39\u1E3B\u1E3D\u1E3F\u1E41\u1E43\u1E45\u1E47\u1E49\u1E4B\u1E4D\u1E4F\u1E51\u1E53\u1E55\u1E57\u1E59\u1E5B\u1E5D\u1E5F\u1E61\u1E63\u1E65\u1E67\u1E69\u1E6B\u1E6D\u1E6F\u1E71\u1E73\u1E75\u1E77\u1E79\u1E7B\u1E7D\u1E7F\u1E81\u1E83\u1E85\u1E87\u1E89\u1E8B\u1E8D\u1E8F\u1E91\u1E93\u1E95-\u1E9D\u1E9F\u1EA1\u1EA3\u1EA5\u1EA7\u1EA9\u1EAB\u1EAD\u1EAF\u1EB1\u1EB3\u1EB5\u1EB7\u1EB9\u1EBB\u1EBD\u1EBF\u1EC1\u1EC3\u1EC5\u1EC7\u1EC9\u1ECB\u1ECD\u1ECF\u1ED1\u1ED3\u1ED5\u1ED7\u1ED9\u1EDB\u1EDD\u1EDF\u1EE1\u1EE3\u1EE5\u1EE7\u1EE9\u1EEB\u1EED\u1EEF\u1EF1\u1EF3\u1EF5\u1EF7\u1EF9\u1EFB\u1EFD\u1EFF-\u1F07\u1F10-\u1F15\u1F20-\u1F27\u1F30-\u1F37\u1F40-\u1F45\u1F50-\u1F57\u1F60-\u1F67\u1F70-\u1F7D\u1F80-\u1F87\u1F90-\u1F97\u1FA0-\u1FA7\u1FB0-\u1FB4\u1FB6\u1FB7\u1FBE\u1FC2-\u1FC4\u1FC6\u1FC7\u1FD0-\u1FD3\u1FD6\u1FD7\u1FE0-\u1FE7\u1FF2-\u1FF4\u1FF6\u1FF7\u210A\u210E\u210F\u2113\u212F\u2134\u2139\u213C\u213D\u2146-\u2149\u214E\u2184\u2C30-\u2C5E\u2C61\u2C65\u2C66\u2C68\u2C6A\u2C6C\u2C71\u2C73\u2C74\u2C76-\u2C7B\u2C81\u2C83\u2C85\u2C87\u2C89\u2C8B\u2C8D\u2C8F\u2C91\u2C93\u2C95\u2C97\u2C99\u2C9B\u2C9D\u2C9F\u2CA1\u2CA3\u2CA5\u2CA7\u2CA9\u2CAB\u2CAD\u2CAF\u2CB1\u2CB3\u2CB5\u2CB7\u2CB9\u2CBB\u2CBD\u2CBF\u2CC1\u2CC3\u2CC5\u2CC7\u2CC9\u2CCB\u2CCD\u2CCF\u2CD1\u2CD3\u2CD5\u2CD7\u2CD9\u2CDB\u2CDD\u2CDF\u2CE1\u2CE3\u2CE4\u2CEC\u2CEE\u2CF3\u2D00-\u2D25\u2D27\u2D2D\uA641\uA643\uA645\uA647\uA649\uA64B\uA64D\uA64F\uA651\uA653\uA655\uA657\uA659\uA65B\uA65D\uA65F\uA661\uA663\uA665\uA667\uA669\uA66B\uA66D\uA681\uA683\uA685\uA687\uA689\uA68B\uA68D\uA68F\uA691\uA693\uA695\uA697\uA699\uA69B\uA723\uA725\uA727\uA729\uA72B\uA72D\uA72F-\uA731\uA733\uA735\uA737\uA739\uA73B\uA73D\uA73F\uA741\uA743\uA745\uA747\uA749\uA74B\uA74D\uA74F\uA751\uA753\uA755\uA757\uA759\uA75B\uA75D\uA75F\uA761\uA763\uA765\uA767\uA769\uA76B\uA76D\uA76F\uA771-\uA778\uA77A\uA77C\uA77F\uA781\uA783\uA785\uA787\uA78C\uA78E\uA791\uA793-\uA795\uA797\uA799\uA79B\uA79D\uA79F\uA7A1\uA7A3\uA7A5\uA7A7\uA7A9\uA7AF\uA7B5\uA7B7\uA7B9\uA7FA\uAB30-\uAB5A\uAB60-\uAB65\uAB70-\uABBF\uFB00-\uFB06\uFB13-\uFB17\uFF41-\uFF5A', + 'astral': '\uD801[\uDC28-\uDC4F\uDCD8-\uDCFB]|\uD803[\uDCC0-\uDCF2]|\uD806[\uDCC0-\uDCDF]|\uD81B[\uDE60-\uDE7F]|\uD835[\uDC1A-\uDC33\uDC4E-\uDC54\uDC56-\uDC67\uDC82-\uDC9B\uDCB6-\uDCB9\uDCBB\uDCBD-\uDCC3\uDCC5-\uDCCF\uDCEA-\uDD03\uDD1E-\uDD37\uDD52-\uDD6B\uDD86-\uDD9F\uDDBA-\uDDD3\uDDEE-\uDE07\uDE22-\uDE3B\uDE56-\uDE6F\uDE8A-\uDEA5\uDEC2-\uDEDA\uDEDC-\uDEE1\uDEFC-\uDF14\uDF16-\uDF1B\uDF36-\uDF4E\uDF50-\uDF55\uDF70-\uDF88\uDF8A-\uDF8F\uDFAA-\uDFC2\uDFC4-\uDFC9\uDFCB]|\uD83A[\uDD22-\uDD43]' + }, + { + 'name': 'Lm', + 'alias': 'Modifier_Letter', + 'bmp': '\u02B0-\u02C1\u02C6-\u02D1\u02E0-\u02E4\u02EC\u02EE\u0374\u037A\u0559\u0640\u06E5\u06E6\u07F4\u07F5\u07FA\u081A\u0824\u0828\u0971\u0E46\u0EC6\u10FC\u17D7\u1843\u1AA7\u1C78-\u1C7D\u1D2C-\u1D6A\u1D78\u1D9B-\u1DBF\u2071\u207F\u2090-\u209C\u2C7C\u2C7D\u2D6F\u2E2F\u3005\u3031-\u3035\u303B\u309D\u309E\u30FC-\u30FE\uA015\uA4F8-\uA4FD\uA60C\uA67F\uA69C\uA69D\uA717-\uA71F\uA770\uA788\uA7F8\uA7F9\uA9CF\uA9E6\uAA70\uAADD\uAAF3\uAAF4\uAB5C-\uAB5F\uFF70\uFF9E\uFF9F', + 'astral': '\uD81A[\uDF40-\uDF43]|\uD81B[\uDF93-\uDF9F\uDFE0\uDFE1]' + }, + { + 'name': 'Lo', + 'alias': 'Other_Letter', + 'bmp': '\xAA\xBA\u01BB\u01C0-\u01C3\u0294\u05D0-\u05EA\u05EF-\u05F2\u0620-\u063F\u0641-\u064A\u066E\u066F\u0671-\u06D3\u06D5\u06EE\u06EF\u06FA-\u06FC\u06FF\u0710\u0712-\u072F\u074D-\u07A5\u07B1\u07CA-\u07EA\u0800-\u0815\u0840-\u0858\u0860-\u086A\u08A0-\u08B4\u08B6-\u08BD\u0904-\u0939\u093D\u0950\u0958-\u0961\u0972-\u0980\u0985-\u098C\u098F\u0990\u0993-\u09A8\u09AA-\u09B0\u09B2\u09B6-\u09B9\u09BD\u09CE\u09DC\u09DD\u09DF-\u09E1\u09F0\u09F1\u09FC\u0A05-\u0A0A\u0A0F\u0A10\u0A13-\u0A28\u0A2A-\u0A30\u0A32\u0A33\u0A35\u0A36\u0A38\u0A39\u0A59-\u0A5C\u0A5E\u0A72-\u0A74\u0A85-\u0A8D\u0A8F-\u0A91\u0A93-\u0AA8\u0AAA-\u0AB0\u0AB2\u0AB3\u0AB5-\u0AB9\u0ABD\u0AD0\u0AE0\u0AE1\u0AF9\u0B05-\u0B0C\u0B0F\u0B10\u0B13-\u0B28\u0B2A-\u0B30\u0B32\u0B33\u0B35-\u0B39\u0B3D\u0B5C\u0B5D\u0B5F-\u0B61\u0B71\u0B83\u0B85-\u0B8A\u0B8E-\u0B90\u0B92-\u0B95\u0B99\u0B9A\u0B9C\u0B9E\u0B9F\u0BA3\u0BA4\u0BA8-\u0BAA\u0BAE-\u0BB9\u0BD0\u0C05-\u0C0C\u0C0E-\u0C10\u0C12-\u0C28\u0C2A-\u0C39\u0C3D\u0C58-\u0C5A\u0C60\u0C61\u0C80\u0C85-\u0C8C\u0C8E-\u0C90\u0C92-\u0CA8\u0CAA-\u0CB3\u0CB5-\u0CB9\u0CBD\u0CDE\u0CE0\u0CE1\u0CF1\u0CF2\u0D05-\u0D0C\u0D0E-\u0D10\u0D12-\u0D3A\u0D3D\u0D4E\u0D54-\u0D56\u0D5F-\u0D61\u0D7A-\u0D7F\u0D85-\u0D96\u0D9A-\u0DB1\u0DB3-\u0DBB\u0DBD\u0DC0-\u0DC6\u0E01-\u0E30\u0E32\u0E33\u0E40-\u0E45\u0E81\u0E82\u0E84\u0E87\u0E88\u0E8A\u0E8D\u0E94-\u0E97\u0E99-\u0E9F\u0EA1-\u0EA3\u0EA5\u0EA7\u0EAA\u0EAB\u0EAD-\u0EB0\u0EB2\u0EB3\u0EBD\u0EC0-\u0EC4\u0EDC-\u0EDF\u0F00\u0F40-\u0F47\u0F49-\u0F6C\u0F88-\u0F8C\u1000-\u102A\u103F\u1050-\u1055\u105A-\u105D\u1061\u1065\u1066\u106E-\u1070\u1075-\u1081\u108E\u1100-\u1248\u124A-\u124D\u1250-\u1256\u1258\u125A-\u125D\u1260-\u1288\u128A-\u128D\u1290-\u12B0\u12B2-\u12B5\u12B8-\u12BE\u12C0\u12C2-\u12C5\u12C8-\u12D6\u12D8-\u1310\u1312-\u1315\u1318-\u135A\u1380-\u138F\u1401-\u166C\u166F-\u167F\u1681-\u169A\u16A0-\u16EA\u16F1-\u16F8\u1700-\u170C\u170E-\u1711\u1720-\u1731\u1740-\u1751\u1760-\u176C\u176E-\u1770\u1780-\u17B3\u17DC\u1820-\u1842\u1844-\u1878\u1880-\u1884\u1887-\u18A8\u18AA\u18B0-\u18F5\u1900-\u191E\u1950-\u196D\u1970-\u1974\u1980-\u19AB\u19B0-\u19C9\u1A00-\u1A16\u1A20-\u1A54\u1B05-\u1B33\u1B45-\u1B4B\u1B83-\u1BA0\u1BAE\u1BAF\u1BBA-\u1BE5\u1C00-\u1C23\u1C4D-\u1C4F\u1C5A-\u1C77\u1CE9-\u1CEC\u1CEE-\u1CF1\u1CF5\u1CF6\u2135-\u2138\u2D30-\u2D67\u2D80-\u2D96\u2DA0-\u2DA6\u2DA8-\u2DAE\u2DB0-\u2DB6\u2DB8-\u2DBE\u2DC0-\u2DC6\u2DC8-\u2DCE\u2DD0-\u2DD6\u2DD8-\u2DDE\u3006\u303C\u3041-\u3096\u309F\u30A1-\u30FA\u30FF\u3105-\u312F\u3131-\u318E\u31A0-\u31BA\u31F0-\u31FF\u3400-\u4DB5\u4E00-\u9FEF\uA000-\uA014\uA016-\uA48C\uA4D0-\uA4F7\uA500-\uA60B\uA610-\uA61F\uA62A\uA62B\uA66E\uA6A0-\uA6E5\uA78F\uA7F7\uA7FB-\uA801\uA803-\uA805\uA807-\uA80A\uA80C-\uA822\uA840-\uA873\uA882-\uA8B3\uA8F2-\uA8F7\uA8FB\uA8FD\uA8FE\uA90A-\uA925\uA930-\uA946\uA960-\uA97C\uA984-\uA9B2\uA9E0-\uA9E4\uA9E7-\uA9EF\uA9FA-\uA9FE\uAA00-\uAA28\uAA40-\uAA42\uAA44-\uAA4B\uAA60-\uAA6F\uAA71-\uAA76\uAA7A\uAA7E-\uAAAF\uAAB1\uAAB5\uAAB6\uAAB9-\uAABD\uAAC0\uAAC2\uAADB\uAADC\uAAE0-\uAAEA\uAAF2\uAB01-\uAB06\uAB09-\uAB0E\uAB11-\uAB16\uAB20-\uAB26\uAB28-\uAB2E\uABC0-\uABE2\uAC00-\uD7A3\uD7B0-\uD7C6\uD7CB-\uD7FB\uF900-\uFA6D\uFA70-\uFAD9\uFB1D\uFB1F-\uFB28\uFB2A-\uFB36\uFB38-\uFB3C\uFB3E\uFB40\uFB41\uFB43\uFB44\uFB46-\uFBB1\uFBD3-\uFD3D\uFD50-\uFD8F\uFD92-\uFDC7\uFDF0-\uFDFB\uFE70-\uFE74\uFE76-\uFEFC\uFF66-\uFF6F\uFF71-\uFF9D\uFFA0-\uFFBE\uFFC2-\uFFC7\uFFCA-\uFFCF\uFFD2-\uFFD7\uFFDA-\uFFDC', + 'astral': '\uD800[\uDC00-\uDC0B\uDC0D-\uDC26\uDC28-\uDC3A\uDC3C\uDC3D\uDC3F-\uDC4D\uDC50-\uDC5D\uDC80-\uDCFA\uDE80-\uDE9C\uDEA0-\uDED0\uDF00-\uDF1F\uDF2D-\uDF40\uDF42-\uDF49\uDF50-\uDF75\uDF80-\uDF9D\uDFA0-\uDFC3\uDFC8-\uDFCF]|\uD801[\uDC50-\uDC9D\uDD00-\uDD27\uDD30-\uDD63\uDE00-\uDF36\uDF40-\uDF55\uDF60-\uDF67]|\uD802[\uDC00-\uDC05\uDC08\uDC0A-\uDC35\uDC37\uDC38\uDC3C\uDC3F-\uDC55\uDC60-\uDC76\uDC80-\uDC9E\uDCE0-\uDCF2\uDCF4\uDCF5\uDD00-\uDD15\uDD20-\uDD39\uDD80-\uDDB7\uDDBE\uDDBF\uDE00\uDE10-\uDE13\uDE15-\uDE17\uDE19-\uDE35\uDE60-\uDE7C\uDE80-\uDE9C\uDEC0-\uDEC7\uDEC9-\uDEE4\uDF00-\uDF35\uDF40-\uDF55\uDF60-\uDF72\uDF80-\uDF91]|\uD803[\uDC00-\uDC48\uDD00-\uDD23\uDF00-\uDF1C\uDF27\uDF30-\uDF45]|\uD804[\uDC03-\uDC37\uDC83-\uDCAF\uDCD0-\uDCE8\uDD03-\uDD26\uDD44\uDD50-\uDD72\uDD76\uDD83-\uDDB2\uDDC1-\uDDC4\uDDDA\uDDDC\uDE00-\uDE11\uDE13-\uDE2B\uDE80-\uDE86\uDE88\uDE8A-\uDE8D\uDE8F-\uDE9D\uDE9F-\uDEA8\uDEB0-\uDEDE\uDF05-\uDF0C\uDF0F\uDF10\uDF13-\uDF28\uDF2A-\uDF30\uDF32\uDF33\uDF35-\uDF39\uDF3D\uDF50\uDF5D-\uDF61]|\uD805[\uDC00-\uDC34\uDC47-\uDC4A\uDC80-\uDCAF\uDCC4\uDCC5\uDCC7\uDD80-\uDDAE\uDDD8-\uDDDB\uDE00-\uDE2F\uDE44\uDE80-\uDEAA\uDF00-\uDF1A]|\uD806[\uDC00-\uDC2B\uDCFF\uDE00\uDE0B-\uDE32\uDE3A\uDE50\uDE5C-\uDE83\uDE86-\uDE89\uDE9D\uDEC0-\uDEF8]|\uD807[\uDC00-\uDC08\uDC0A-\uDC2E\uDC40\uDC72-\uDC8F\uDD00-\uDD06\uDD08\uDD09\uDD0B-\uDD30\uDD46\uDD60-\uDD65\uDD67\uDD68\uDD6A-\uDD89\uDD98\uDEE0-\uDEF2]|\uD808[\uDC00-\uDF99]|\uD809[\uDC80-\uDD43]|[\uD80C\uD81C-\uD820\uD840-\uD868\uD86A-\uD86C\uD86F-\uD872\uD874-\uD879][\uDC00-\uDFFF]|\uD80D[\uDC00-\uDC2E]|\uD811[\uDC00-\uDE46]|\uD81A[\uDC00-\uDE38\uDE40-\uDE5E\uDED0-\uDEED\uDF00-\uDF2F\uDF63-\uDF77\uDF7D-\uDF8F]|\uD81B[\uDF00-\uDF44\uDF50]|\uD821[\uDC00-\uDFF1]|\uD822[\uDC00-\uDEF2]|\uD82C[\uDC00-\uDD1E\uDD70-\uDEFB]|\uD82F[\uDC00-\uDC6A\uDC70-\uDC7C\uDC80-\uDC88\uDC90-\uDC99]|\uD83A[\uDC00-\uDCC4]|\uD83B[\uDE00-\uDE03\uDE05-\uDE1F\uDE21\uDE22\uDE24\uDE27\uDE29-\uDE32\uDE34-\uDE37\uDE39\uDE3B\uDE42\uDE47\uDE49\uDE4B\uDE4D-\uDE4F\uDE51\uDE52\uDE54\uDE57\uDE59\uDE5B\uDE5D\uDE5F\uDE61\uDE62\uDE64\uDE67-\uDE6A\uDE6C-\uDE72\uDE74-\uDE77\uDE79-\uDE7C\uDE7E\uDE80-\uDE89\uDE8B-\uDE9B\uDEA1-\uDEA3\uDEA5-\uDEA9\uDEAB-\uDEBB]|\uD869[\uDC00-\uDED6\uDF00-\uDFFF]|\uD86D[\uDC00-\uDF34\uDF40-\uDFFF]|\uD86E[\uDC00-\uDC1D\uDC20-\uDFFF]|\uD873[\uDC00-\uDEA1\uDEB0-\uDFFF]|\uD87A[\uDC00-\uDFE0]|\uD87E[\uDC00-\uDE1D]' + }, + { + 'name': 'Lt', + 'alias': 'Titlecase_Letter', + 'bmp': '\u01C5\u01C8\u01CB\u01F2\u1F88-\u1F8F\u1F98-\u1F9F\u1FA8-\u1FAF\u1FBC\u1FCC\u1FFC' + }, + { + 'name': 'Lu', + 'alias': 'Uppercase_Letter', + 'bmp': 'A-Z\xC0-\xD6\xD8-\xDE\u0100\u0102\u0104\u0106\u0108\u010A\u010C\u010E\u0110\u0112\u0114\u0116\u0118\u011A\u011C\u011E\u0120\u0122\u0124\u0126\u0128\u012A\u012C\u012E\u0130\u0132\u0134\u0136\u0139\u013B\u013D\u013F\u0141\u0143\u0145\u0147\u014A\u014C\u014E\u0150\u0152\u0154\u0156\u0158\u015A\u015C\u015E\u0160\u0162\u0164\u0166\u0168\u016A\u016C\u016E\u0170\u0172\u0174\u0176\u0178\u0179\u017B\u017D\u0181\u0182\u0184\u0186\u0187\u0189-\u018B\u018E-\u0191\u0193\u0194\u0196-\u0198\u019C\u019D\u019F\u01A0\u01A2\u01A4\u01A6\u01A7\u01A9\u01AC\u01AE\u01AF\u01B1-\u01B3\u01B5\u01B7\u01B8\u01BC\u01C4\u01C7\u01CA\u01CD\u01CF\u01D1\u01D3\u01D5\u01D7\u01D9\u01DB\u01DE\u01E0\u01E2\u01E4\u01E6\u01E8\u01EA\u01EC\u01EE\u01F1\u01F4\u01F6-\u01F8\u01FA\u01FC\u01FE\u0200\u0202\u0204\u0206\u0208\u020A\u020C\u020E\u0210\u0212\u0214\u0216\u0218\u021A\u021C\u021E\u0220\u0222\u0224\u0226\u0228\u022A\u022C\u022E\u0230\u0232\u023A\u023B\u023D\u023E\u0241\u0243-\u0246\u0248\u024A\u024C\u024E\u0370\u0372\u0376\u037F\u0386\u0388-\u038A\u038C\u038E\u038F\u0391-\u03A1\u03A3-\u03AB\u03CF\u03D2-\u03D4\u03D8\u03DA\u03DC\u03DE\u03E0\u03E2\u03E4\u03E6\u03E8\u03EA\u03EC\u03EE\u03F4\u03F7\u03F9\u03FA\u03FD-\u042F\u0460\u0462\u0464\u0466\u0468\u046A\u046C\u046E\u0470\u0472\u0474\u0476\u0478\u047A\u047C\u047E\u0480\u048A\u048C\u048E\u0490\u0492\u0494\u0496\u0498\u049A\u049C\u049E\u04A0\u04A2\u04A4\u04A6\u04A8\u04AA\u04AC\u04AE\u04B0\u04B2\u04B4\u04B6\u04B8\u04BA\u04BC\u04BE\u04C0\u04C1\u04C3\u04C5\u04C7\u04C9\u04CB\u04CD\u04D0\u04D2\u04D4\u04D6\u04D8\u04DA\u04DC\u04DE\u04E0\u04E2\u04E4\u04E6\u04E8\u04EA\u04EC\u04EE\u04F0\u04F2\u04F4\u04F6\u04F8\u04FA\u04FC\u04FE\u0500\u0502\u0504\u0506\u0508\u050A\u050C\u050E\u0510\u0512\u0514\u0516\u0518\u051A\u051C\u051E\u0520\u0522\u0524\u0526\u0528\u052A\u052C\u052E\u0531-\u0556\u10A0-\u10C5\u10C7\u10CD\u13A0-\u13F5\u1C90-\u1CBA\u1CBD-\u1CBF\u1E00\u1E02\u1E04\u1E06\u1E08\u1E0A\u1E0C\u1E0E\u1E10\u1E12\u1E14\u1E16\u1E18\u1E1A\u1E1C\u1E1E\u1E20\u1E22\u1E24\u1E26\u1E28\u1E2A\u1E2C\u1E2E\u1E30\u1E32\u1E34\u1E36\u1E38\u1E3A\u1E3C\u1E3E\u1E40\u1E42\u1E44\u1E46\u1E48\u1E4A\u1E4C\u1E4E\u1E50\u1E52\u1E54\u1E56\u1E58\u1E5A\u1E5C\u1E5E\u1E60\u1E62\u1E64\u1E66\u1E68\u1E6A\u1E6C\u1E6E\u1E70\u1E72\u1E74\u1E76\u1E78\u1E7A\u1E7C\u1E7E\u1E80\u1E82\u1E84\u1E86\u1E88\u1E8A\u1E8C\u1E8E\u1E90\u1E92\u1E94\u1E9E\u1EA0\u1EA2\u1EA4\u1EA6\u1EA8\u1EAA\u1EAC\u1EAE\u1EB0\u1EB2\u1EB4\u1EB6\u1EB8\u1EBA\u1EBC\u1EBE\u1EC0\u1EC2\u1EC4\u1EC6\u1EC8\u1ECA\u1ECC\u1ECE\u1ED0\u1ED2\u1ED4\u1ED6\u1ED8\u1EDA\u1EDC\u1EDE\u1EE0\u1EE2\u1EE4\u1EE6\u1EE8\u1EEA\u1EEC\u1EEE\u1EF0\u1EF2\u1EF4\u1EF6\u1EF8\u1EFA\u1EFC\u1EFE\u1F08-\u1F0F\u1F18-\u1F1D\u1F28-\u1F2F\u1F38-\u1F3F\u1F48-\u1F4D\u1F59\u1F5B\u1F5D\u1F5F\u1F68-\u1F6F\u1FB8-\u1FBB\u1FC8-\u1FCB\u1FD8-\u1FDB\u1FE8-\u1FEC\u1FF8-\u1FFB\u2102\u2107\u210B-\u210D\u2110-\u2112\u2115\u2119-\u211D\u2124\u2126\u2128\u212A-\u212D\u2130-\u2133\u213E\u213F\u2145\u2183\u2C00-\u2C2E\u2C60\u2C62-\u2C64\u2C67\u2C69\u2C6B\u2C6D-\u2C70\u2C72\u2C75\u2C7E-\u2C80\u2C82\u2C84\u2C86\u2C88\u2C8A\u2C8C\u2C8E\u2C90\u2C92\u2C94\u2C96\u2C98\u2C9A\u2C9C\u2C9E\u2CA0\u2CA2\u2CA4\u2CA6\u2CA8\u2CAA\u2CAC\u2CAE\u2CB0\u2CB2\u2CB4\u2CB6\u2CB8\u2CBA\u2CBC\u2CBE\u2CC0\u2CC2\u2CC4\u2CC6\u2CC8\u2CCA\u2CCC\u2CCE\u2CD0\u2CD2\u2CD4\u2CD6\u2CD8\u2CDA\u2CDC\u2CDE\u2CE0\u2CE2\u2CEB\u2CED\u2CF2\uA640\uA642\uA644\uA646\uA648\uA64A\uA64C\uA64E\uA650\uA652\uA654\uA656\uA658\uA65A\uA65C\uA65E\uA660\uA662\uA664\uA666\uA668\uA66A\uA66C\uA680\uA682\uA684\uA686\uA688\uA68A\uA68C\uA68E\uA690\uA692\uA694\uA696\uA698\uA69A\uA722\uA724\uA726\uA728\uA72A\uA72C\uA72E\uA732\uA734\uA736\uA738\uA73A\uA73C\uA73E\uA740\uA742\uA744\uA746\uA748\uA74A\uA74C\uA74E\uA750\uA752\uA754\uA756\uA758\uA75A\uA75C\uA75E\uA760\uA762\uA764\uA766\uA768\uA76A\uA76C\uA76E\uA779\uA77B\uA77D\uA77E\uA780\uA782\uA784\uA786\uA78B\uA78D\uA790\uA792\uA796\uA798\uA79A\uA79C\uA79E\uA7A0\uA7A2\uA7A4\uA7A6\uA7A8\uA7AA-\uA7AE\uA7B0-\uA7B4\uA7B6\uA7B8\uFF21-\uFF3A', + 'astral': '\uD801[\uDC00-\uDC27\uDCB0-\uDCD3]|\uD803[\uDC80-\uDCB2]|\uD806[\uDCA0-\uDCBF]|\uD81B[\uDE40-\uDE5F]|\uD835[\uDC00-\uDC19\uDC34-\uDC4D\uDC68-\uDC81\uDC9C\uDC9E\uDC9F\uDCA2\uDCA5\uDCA6\uDCA9-\uDCAC\uDCAE-\uDCB5\uDCD0-\uDCE9\uDD04\uDD05\uDD07-\uDD0A\uDD0D-\uDD14\uDD16-\uDD1C\uDD38\uDD39\uDD3B-\uDD3E\uDD40-\uDD44\uDD46\uDD4A-\uDD50\uDD6C-\uDD85\uDDA0-\uDDB9\uDDD4-\uDDED\uDE08-\uDE21\uDE3C-\uDE55\uDE70-\uDE89\uDEA8-\uDEC0\uDEE2-\uDEFA\uDF1C-\uDF34\uDF56-\uDF6E\uDF90-\uDFA8\uDFCA]|\uD83A[\uDD00-\uDD21]' + }, + { + 'name': 'M', + 'alias': 'Mark', + 'bmp': '\u0300-\u036F\u0483-\u0489\u0591-\u05BD\u05BF\u05C1\u05C2\u05C4\u05C5\u05C7\u0610-\u061A\u064B-\u065F\u0670\u06D6-\u06DC\u06DF-\u06E4\u06E7\u06E8\u06EA-\u06ED\u0711\u0730-\u074A\u07A6-\u07B0\u07EB-\u07F3\u07FD\u0816-\u0819\u081B-\u0823\u0825-\u0827\u0829-\u082D\u0859-\u085B\u08D3-\u08E1\u08E3-\u0903\u093A-\u093C\u093E-\u094F\u0951-\u0957\u0962\u0963\u0981-\u0983\u09BC\u09BE-\u09C4\u09C7\u09C8\u09CB-\u09CD\u09D7\u09E2\u09E3\u09FE\u0A01-\u0A03\u0A3C\u0A3E-\u0A42\u0A47\u0A48\u0A4B-\u0A4D\u0A51\u0A70\u0A71\u0A75\u0A81-\u0A83\u0ABC\u0ABE-\u0AC5\u0AC7-\u0AC9\u0ACB-\u0ACD\u0AE2\u0AE3\u0AFA-\u0AFF\u0B01-\u0B03\u0B3C\u0B3E-\u0B44\u0B47\u0B48\u0B4B-\u0B4D\u0B56\u0B57\u0B62\u0B63\u0B82\u0BBE-\u0BC2\u0BC6-\u0BC8\u0BCA-\u0BCD\u0BD7\u0C00-\u0C04\u0C3E-\u0C44\u0C46-\u0C48\u0C4A-\u0C4D\u0C55\u0C56\u0C62\u0C63\u0C81-\u0C83\u0CBC\u0CBE-\u0CC4\u0CC6-\u0CC8\u0CCA-\u0CCD\u0CD5\u0CD6\u0CE2\u0CE3\u0D00-\u0D03\u0D3B\u0D3C\u0D3E-\u0D44\u0D46-\u0D48\u0D4A-\u0D4D\u0D57\u0D62\u0D63\u0D82\u0D83\u0DCA\u0DCF-\u0DD4\u0DD6\u0DD8-\u0DDF\u0DF2\u0DF3\u0E31\u0E34-\u0E3A\u0E47-\u0E4E\u0EB1\u0EB4-\u0EB9\u0EBB\u0EBC\u0EC8-\u0ECD\u0F18\u0F19\u0F35\u0F37\u0F39\u0F3E\u0F3F\u0F71-\u0F84\u0F86\u0F87\u0F8D-\u0F97\u0F99-\u0FBC\u0FC6\u102B-\u103E\u1056-\u1059\u105E-\u1060\u1062-\u1064\u1067-\u106D\u1071-\u1074\u1082-\u108D\u108F\u109A-\u109D\u135D-\u135F\u1712-\u1714\u1732-\u1734\u1752\u1753\u1772\u1773\u17B4-\u17D3\u17DD\u180B-\u180D\u1885\u1886\u18A9\u1920-\u192B\u1930-\u193B\u1A17-\u1A1B\u1A55-\u1A5E\u1A60-\u1A7C\u1A7F\u1AB0-\u1ABE\u1B00-\u1B04\u1B34-\u1B44\u1B6B-\u1B73\u1B80-\u1B82\u1BA1-\u1BAD\u1BE6-\u1BF3\u1C24-\u1C37\u1CD0-\u1CD2\u1CD4-\u1CE8\u1CED\u1CF2-\u1CF4\u1CF7-\u1CF9\u1DC0-\u1DF9\u1DFB-\u1DFF\u20D0-\u20F0\u2CEF-\u2CF1\u2D7F\u2DE0-\u2DFF\u302A-\u302F\u3099\u309A\uA66F-\uA672\uA674-\uA67D\uA69E\uA69F\uA6F0\uA6F1\uA802\uA806\uA80B\uA823-\uA827\uA880\uA881\uA8B4-\uA8C5\uA8E0-\uA8F1\uA8FF\uA926-\uA92D\uA947-\uA953\uA980-\uA983\uA9B3-\uA9C0\uA9E5\uAA29-\uAA36\uAA43\uAA4C\uAA4D\uAA7B-\uAA7D\uAAB0\uAAB2-\uAAB4\uAAB7\uAAB8\uAABE\uAABF\uAAC1\uAAEB-\uAAEF\uAAF5\uAAF6\uABE3-\uABEA\uABEC\uABED\uFB1E\uFE00-\uFE0F\uFE20-\uFE2F', + 'astral': '\uD800[\uDDFD\uDEE0\uDF76-\uDF7A]|\uD802[\uDE01-\uDE03\uDE05\uDE06\uDE0C-\uDE0F\uDE38-\uDE3A\uDE3F\uDEE5\uDEE6]|\uD803[\uDD24-\uDD27\uDF46-\uDF50]|\uD804[\uDC00-\uDC02\uDC38-\uDC46\uDC7F-\uDC82\uDCB0-\uDCBA\uDD00-\uDD02\uDD27-\uDD34\uDD45\uDD46\uDD73\uDD80-\uDD82\uDDB3-\uDDC0\uDDC9-\uDDCC\uDE2C-\uDE37\uDE3E\uDEDF-\uDEEA\uDF00-\uDF03\uDF3B\uDF3C\uDF3E-\uDF44\uDF47\uDF48\uDF4B-\uDF4D\uDF57\uDF62\uDF63\uDF66-\uDF6C\uDF70-\uDF74]|\uD805[\uDC35-\uDC46\uDC5E\uDCB0-\uDCC3\uDDAF-\uDDB5\uDDB8-\uDDC0\uDDDC\uDDDD\uDE30-\uDE40\uDEAB-\uDEB7\uDF1D-\uDF2B]|\uD806[\uDC2C-\uDC3A\uDE01-\uDE0A\uDE33-\uDE39\uDE3B-\uDE3E\uDE47\uDE51-\uDE5B\uDE8A-\uDE99]|\uD807[\uDC2F-\uDC36\uDC38-\uDC3F\uDC92-\uDCA7\uDCA9-\uDCB6\uDD31-\uDD36\uDD3A\uDD3C\uDD3D\uDD3F-\uDD45\uDD47\uDD8A-\uDD8E\uDD90\uDD91\uDD93-\uDD97\uDEF3-\uDEF6]|\uD81A[\uDEF0-\uDEF4\uDF30-\uDF36]|\uD81B[\uDF51-\uDF7E\uDF8F-\uDF92]|\uD82F[\uDC9D\uDC9E]|\uD834[\uDD65-\uDD69\uDD6D-\uDD72\uDD7B-\uDD82\uDD85-\uDD8B\uDDAA-\uDDAD\uDE42-\uDE44]|\uD836[\uDE00-\uDE36\uDE3B-\uDE6C\uDE75\uDE84\uDE9B-\uDE9F\uDEA1-\uDEAF]|\uD838[\uDC00-\uDC06\uDC08-\uDC18\uDC1B-\uDC21\uDC23\uDC24\uDC26-\uDC2A]|\uD83A[\uDCD0-\uDCD6\uDD44-\uDD4A]|\uDB40[\uDD00-\uDDEF]' + }, + { + 'name': 'Mc', + 'alias': 'Spacing_Mark', + 'bmp': '\u0903\u093B\u093E-\u0940\u0949-\u094C\u094E\u094F\u0982\u0983\u09BE-\u09C0\u09C7\u09C8\u09CB\u09CC\u09D7\u0A03\u0A3E-\u0A40\u0A83\u0ABE-\u0AC0\u0AC9\u0ACB\u0ACC\u0B02\u0B03\u0B3E\u0B40\u0B47\u0B48\u0B4B\u0B4C\u0B57\u0BBE\u0BBF\u0BC1\u0BC2\u0BC6-\u0BC8\u0BCA-\u0BCC\u0BD7\u0C01-\u0C03\u0C41-\u0C44\u0C82\u0C83\u0CBE\u0CC0-\u0CC4\u0CC7\u0CC8\u0CCA\u0CCB\u0CD5\u0CD6\u0D02\u0D03\u0D3E-\u0D40\u0D46-\u0D48\u0D4A-\u0D4C\u0D57\u0D82\u0D83\u0DCF-\u0DD1\u0DD8-\u0DDF\u0DF2\u0DF3\u0F3E\u0F3F\u0F7F\u102B\u102C\u1031\u1038\u103B\u103C\u1056\u1057\u1062-\u1064\u1067-\u106D\u1083\u1084\u1087-\u108C\u108F\u109A-\u109C\u17B6\u17BE-\u17C5\u17C7\u17C8\u1923-\u1926\u1929-\u192B\u1930\u1931\u1933-\u1938\u1A19\u1A1A\u1A55\u1A57\u1A61\u1A63\u1A64\u1A6D-\u1A72\u1B04\u1B35\u1B3B\u1B3D-\u1B41\u1B43\u1B44\u1B82\u1BA1\u1BA6\u1BA7\u1BAA\u1BE7\u1BEA-\u1BEC\u1BEE\u1BF2\u1BF3\u1C24-\u1C2B\u1C34\u1C35\u1CE1\u1CF2\u1CF3\u1CF7\u302E\u302F\uA823\uA824\uA827\uA880\uA881\uA8B4-\uA8C3\uA952\uA953\uA983\uA9B4\uA9B5\uA9BA\uA9BB\uA9BD-\uA9C0\uAA2F\uAA30\uAA33\uAA34\uAA4D\uAA7B\uAA7D\uAAEB\uAAEE\uAAEF\uAAF5\uABE3\uABE4\uABE6\uABE7\uABE9\uABEA\uABEC', + 'astral': '\uD804[\uDC00\uDC02\uDC82\uDCB0-\uDCB2\uDCB7\uDCB8\uDD2C\uDD45\uDD46\uDD82\uDDB3-\uDDB5\uDDBF\uDDC0\uDE2C-\uDE2E\uDE32\uDE33\uDE35\uDEE0-\uDEE2\uDF02\uDF03\uDF3E\uDF3F\uDF41-\uDF44\uDF47\uDF48\uDF4B-\uDF4D\uDF57\uDF62\uDF63]|\uD805[\uDC35-\uDC37\uDC40\uDC41\uDC45\uDCB0-\uDCB2\uDCB9\uDCBB-\uDCBE\uDCC1\uDDAF-\uDDB1\uDDB8-\uDDBB\uDDBE\uDE30-\uDE32\uDE3B\uDE3C\uDE3E\uDEAC\uDEAE\uDEAF\uDEB6\uDF20\uDF21\uDF26]|\uD806[\uDC2C-\uDC2E\uDC38\uDE39\uDE57\uDE58\uDE97]|\uD807[\uDC2F\uDC3E\uDCA9\uDCB1\uDCB4\uDD8A-\uDD8E\uDD93\uDD94\uDD96\uDEF5\uDEF6]|\uD81B[\uDF51-\uDF7E]|\uD834[\uDD65\uDD66\uDD6D-\uDD72]' + }, + { + 'name': 'Me', + 'alias': 'Enclosing_Mark', + 'bmp': '\u0488\u0489\u1ABE\u20DD-\u20E0\u20E2-\u20E4\uA670-\uA672' + }, + { + 'name': 'Mn', + 'alias': 'Nonspacing_Mark', + 'bmp': '\u0300-\u036F\u0483-\u0487\u0591-\u05BD\u05BF\u05C1\u05C2\u05C4\u05C5\u05C7\u0610-\u061A\u064B-\u065F\u0670\u06D6-\u06DC\u06DF-\u06E4\u06E7\u06E8\u06EA-\u06ED\u0711\u0730-\u074A\u07A6-\u07B0\u07EB-\u07F3\u07FD\u0816-\u0819\u081B-\u0823\u0825-\u0827\u0829-\u082D\u0859-\u085B\u08D3-\u08E1\u08E3-\u0902\u093A\u093C\u0941-\u0948\u094D\u0951-\u0957\u0962\u0963\u0981\u09BC\u09C1-\u09C4\u09CD\u09E2\u09E3\u09FE\u0A01\u0A02\u0A3C\u0A41\u0A42\u0A47\u0A48\u0A4B-\u0A4D\u0A51\u0A70\u0A71\u0A75\u0A81\u0A82\u0ABC\u0AC1-\u0AC5\u0AC7\u0AC8\u0ACD\u0AE2\u0AE3\u0AFA-\u0AFF\u0B01\u0B3C\u0B3F\u0B41-\u0B44\u0B4D\u0B56\u0B62\u0B63\u0B82\u0BC0\u0BCD\u0C00\u0C04\u0C3E-\u0C40\u0C46-\u0C48\u0C4A-\u0C4D\u0C55\u0C56\u0C62\u0C63\u0C81\u0CBC\u0CBF\u0CC6\u0CCC\u0CCD\u0CE2\u0CE3\u0D00\u0D01\u0D3B\u0D3C\u0D41-\u0D44\u0D4D\u0D62\u0D63\u0DCA\u0DD2-\u0DD4\u0DD6\u0E31\u0E34-\u0E3A\u0E47-\u0E4E\u0EB1\u0EB4-\u0EB9\u0EBB\u0EBC\u0EC8-\u0ECD\u0F18\u0F19\u0F35\u0F37\u0F39\u0F71-\u0F7E\u0F80-\u0F84\u0F86\u0F87\u0F8D-\u0F97\u0F99-\u0FBC\u0FC6\u102D-\u1030\u1032-\u1037\u1039\u103A\u103D\u103E\u1058\u1059\u105E-\u1060\u1071-\u1074\u1082\u1085\u1086\u108D\u109D\u135D-\u135F\u1712-\u1714\u1732-\u1734\u1752\u1753\u1772\u1773\u17B4\u17B5\u17B7-\u17BD\u17C6\u17C9-\u17D3\u17DD\u180B-\u180D\u1885\u1886\u18A9\u1920-\u1922\u1927\u1928\u1932\u1939-\u193B\u1A17\u1A18\u1A1B\u1A56\u1A58-\u1A5E\u1A60\u1A62\u1A65-\u1A6C\u1A73-\u1A7C\u1A7F\u1AB0-\u1ABD\u1B00-\u1B03\u1B34\u1B36-\u1B3A\u1B3C\u1B42\u1B6B-\u1B73\u1B80\u1B81\u1BA2-\u1BA5\u1BA8\u1BA9\u1BAB-\u1BAD\u1BE6\u1BE8\u1BE9\u1BED\u1BEF-\u1BF1\u1C2C-\u1C33\u1C36\u1C37\u1CD0-\u1CD2\u1CD4-\u1CE0\u1CE2-\u1CE8\u1CED\u1CF4\u1CF8\u1CF9\u1DC0-\u1DF9\u1DFB-\u1DFF\u20D0-\u20DC\u20E1\u20E5-\u20F0\u2CEF-\u2CF1\u2D7F\u2DE0-\u2DFF\u302A-\u302D\u3099\u309A\uA66F\uA674-\uA67D\uA69E\uA69F\uA6F0\uA6F1\uA802\uA806\uA80B\uA825\uA826\uA8C4\uA8C5\uA8E0-\uA8F1\uA8FF\uA926-\uA92D\uA947-\uA951\uA980-\uA982\uA9B3\uA9B6-\uA9B9\uA9BC\uA9E5\uAA29-\uAA2E\uAA31\uAA32\uAA35\uAA36\uAA43\uAA4C\uAA7C\uAAB0\uAAB2-\uAAB4\uAAB7\uAAB8\uAABE\uAABF\uAAC1\uAAEC\uAAED\uAAF6\uABE5\uABE8\uABED\uFB1E\uFE00-\uFE0F\uFE20-\uFE2F', + 'astral': '\uD800[\uDDFD\uDEE0\uDF76-\uDF7A]|\uD802[\uDE01-\uDE03\uDE05\uDE06\uDE0C-\uDE0F\uDE38-\uDE3A\uDE3F\uDEE5\uDEE6]|\uD803[\uDD24-\uDD27\uDF46-\uDF50]|\uD804[\uDC01\uDC38-\uDC46\uDC7F-\uDC81\uDCB3-\uDCB6\uDCB9\uDCBA\uDD00-\uDD02\uDD27-\uDD2B\uDD2D-\uDD34\uDD73\uDD80\uDD81\uDDB6-\uDDBE\uDDC9-\uDDCC\uDE2F-\uDE31\uDE34\uDE36\uDE37\uDE3E\uDEDF\uDEE3-\uDEEA\uDF00\uDF01\uDF3B\uDF3C\uDF40\uDF66-\uDF6C\uDF70-\uDF74]|\uD805[\uDC38-\uDC3F\uDC42-\uDC44\uDC46\uDC5E\uDCB3-\uDCB8\uDCBA\uDCBF\uDCC0\uDCC2\uDCC3\uDDB2-\uDDB5\uDDBC\uDDBD\uDDBF\uDDC0\uDDDC\uDDDD\uDE33-\uDE3A\uDE3D\uDE3F\uDE40\uDEAB\uDEAD\uDEB0-\uDEB5\uDEB7\uDF1D-\uDF1F\uDF22-\uDF25\uDF27-\uDF2B]|\uD806[\uDC2F-\uDC37\uDC39\uDC3A\uDE01-\uDE0A\uDE33-\uDE38\uDE3B-\uDE3E\uDE47\uDE51-\uDE56\uDE59-\uDE5B\uDE8A-\uDE96\uDE98\uDE99]|\uD807[\uDC30-\uDC36\uDC38-\uDC3D\uDC3F\uDC92-\uDCA7\uDCAA-\uDCB0\uDCB2\uDCB3\uDCB5\uDCB6\uDD31-\uDD36\uDD3A\uDD3C\uDD3D\uDD3F-\uDD45\uDD47\uDD90\uDD91\uDD95\uDD97\uDEF3\uDEF4]|\uD81A[\uDEF0-\uDEF4\uDF30-\uDF36]|\uD81B[\uDF8F-\uDF92]|\uD82F[\uDC9D\uDC9E]|\uD834[\uDD67-\uDD69\uDD7B-\uDD82\uDD85-\uDD8B\uDDAA-\uDDAD\uDE42-\uDE44]|\uD836[\uDE00-\uDE36\uDE3B-\uDE6C\uDE75\uDE84\uDE9B-\uDE9F\uDEA1-\uDEAF]|\uD838[\uDC00-\uDC06\uDC08-\uDC18\uDC1B-\uDC21\uDC23\uDC24\uDC26-\uDC2A]|\uD83A[\uDCD0-\uDCD6\uDD44-\uDD4A]|\uDB40[\uDD00-\uDDEF]' + }, + { + 'name': 'N', + 'alias': 'Number', + 'bmp': '0-9\xB2\xB3\xB9\xBC-\xBE\u0660-\u0669\u06F0-\u06F9\u07C0-\u07C9\u0966-\u096F\u09E6-\u09EF\u09F4-\u09F9\u0A66-\u0A6F\u0AE6-\u0AEF\u0B66-\u0B6F\u0B72-\u0B77\u0BE6-\u0BF2\u0C66-\u0C6F\u0C78-\u0C7E\u0CE6-\u0CEF\u0D58-\u0D5E\u0D66-\u0D78\u0DE6-\u0DEF\u0E50-\u0E59\u0ED0-\u0ED9\u0F20-\u0F33\u1040-\u1049\u1090-\u1099\u1369-\u137C\u16EE-\u16F0\u17E0-\u17E9\u17F0-\u17F9\u1810-\u1819\u1946-\u194F\u19D0-\u19DA\u1A80-\u1A89\u1A90-\u1A99\u1B50-\u1B59\u1BB0-\u1BB9\u1C40-\u1C49\u1C50-\u1C59\u2070\u2074-\u2079\u2080-\u2089\u2150-\u2182\u2185-\u2189\u2460-\u249B\u24EA-\u24FF\u2776-\u2793\u2CFD\u3007\u3021-\u3029\u3038-\u303A\u3192-\u3195\u3220-\u3229\u3248-\u324F\u3251-\u325F\u3280-\u3289\u32B1-\u32BF\uA620-\uA629\uA6E6-\uA6EF\uA830-\uA835\uA8D0-\uA8D9\uA900-\uA909\uA9D0-\uA9D9\uA9F0-\uA9F9\uAA50-\uAA59\uABF0-\uABF9\uFF10-\uFF19', + 'astral': '\uD800[\uDD07-\uDD33\uDD40-\uDD78\uDD8A\uDD8B\uDEE1-\uDEFB\uDF20-\uDF23\uDF41\uDF4A\uDFD1-\uDFD5]|\uD801[\uDCA0-\uDCA9]|\uD802[\uDC58-\uDC5F\uDC79-\uDC7F\uDCA7-\uDCAF\uDCFB-\uDCFF\uDD16-\uDD1B\uDDBC\uDDBD\uDDC0-\uDDCF\uDDD2-\uDDFF\uDE40-\uDE48\uDE7D\uDE7E\uDE9D-\uDE9F\uDEEB-\uDEEF\uDF58-\uDF5F\uDF78-\uDF7F\uDFA9-\uDFAF]|\uD803[\uDCFA-\uDCFF\uDD30-\uDD39\uDE60-\uDE7E\uDF1D-\uDF26\uDF51-\uDF54]|\uD804[\uDC52-\uDC6F\uDCF0-\uDCF9\uDD36-\uDD3F\uDDD0-\uDDD9\uDDE1-\uDDF4\uDEF0-\uDEF9]|\uD805[\uDC50-\uDC59\uDCD0-\uDCD9\uDE50-\uDE59\uDEC0-\uDEC9\uDF30-\uDF3B]|\uD806[\uDCE0-\uDCF2]|\uD807[\uDC50-\uDC6C\uDD50-\uDD59\uDDA0-\uDDA9]|\uD809[\uDC00-\uDC6E]|\uD81A[\uDE60-\uDE69\uDF50-\uDF59\uDF5B-\uDF61]|\uD81B[\uDE80-\uDE96]|\uD834[\uDEE0-\uDEF3\uDF60-\uDF78]|\uD835[\uDFCE-\uDFFF]|\uD83A[\uDCC7-\uDCCF\uDD50-\uDD59]|\uD83B[\uDC71-\uDCAB\uDCAD-\uDCAF\uDCB1-\uDCB4]|\uD83C[\uDD00-\uDD0C]' + }, + { + 'name': 'Nd', + 'alias': 'Decimal_Number', + 'bmp': '0-9\u0660-\u0669\u06F0-\u06F9\u07C0-\u07C9\u0966-\u096F\u09E6-\u09EF\u0A66-\u0A6F\u0AE6-\u0AEF\u0B66-\u0B6F\u0BE6-\u0BEF\u0C66-\u0C6F\u0CE6-\u0CEF\u0D66-\u0D6F\u0DE6-\u0DEF\u0E50-\u0E59\u0ED0-\u0ED9\u0F20-\u0F29\u1040-\u1049\u1090-\u1099\u17E0-\u17E9\u1810-\u1819\u1946-\u194F\u19D0-\u19D9\u1A80-\u1A89\u1A90-\u1A99\u1B50-\u1B59\u1BB0-\u1BB9\u1C40-\u1C49\u1C50-\u1C59\uA620-\uA629\uA8D0-\uA8D9\uA900-\uA909\uA9D0-\uA9D9\uA9F0-\uA9F9\uAA50-\uAA59\uABF0-\uABF9\uFF10-\uFF19', + 'astral': '\uD801[\uDCA0-\uDCA9]|\uD803[\uDD30-\uDD39]|\uD804[\uDC66-\uDC6F\uDCF0-\uDCF9\uDD36-\uDD3F\uDDD0-\uDDD9\uDEF0-\uDEF9]|\uD805[\uDC50-\uDC59\uDCD0-\uDCD9\uDE50-\uDE59\uDEC0-\uDEC9\uDF30-\uDF39]|\uD806[\uDCE0-\uDCE9]|\uD807[\uDC50-\uDC59\uDD50-\uDD59\uDDA0-\uDDA9]|\uD81A[\uDE60-\uDE69\uDF50-\uDF59]|\uD835[\uDFCE-\uDFFF]|\uD83A[\uDD50-\uDD59]' + }, + { + 'name': 'Nl', + 'alias': 'Letter_Number', + 'bmp': '\u16EE-\u16F0\u2160-\u2182\u2185-\u2188\u3007\u3021-\u3029\u3038-\u303A\uA6E6-\uA6EF', + 'astral': '\uD800[\uDD40-\uDD74\uDF41\uDF4A\uDFD1-\uDFD5]|\uD809[\uDC00-\uDC6E]' + }, + { + 'name': 'No', + 'alias': 'Other_Number', + 'bmp': '\xB2\xB3\xB9\xBC-\xBE\u09F4-\u09F9\u0B72-\u0B77\u0BF0-\u0BF2\u0C78-\u0C7E\u0D58-\u0D5E\u0D70-\u0D78\u0F2A-\u0F33\u1369-\u137C\u17F0-\u17F9\u19DA\u2070\u2074-\u2079\u2080-\u2089\u2150-\u215F\u2189\u2460-\u249B\u24EA-\u24FF\u2776-\u2793\u2CFD\u3192-\u3195\u3220-\u3229\u3248-\u324F\u3251-\u325F\u3280-\u3289\u32B1-\u32BF\uA830-\uA835', + 'astral': '\uD800[\uDD07-\uDD33\uDD75-\uDD78\uDD8A\uDD8B\uDEE1-\uDEFB\uDF20-\uDF23]|\uD802[\uDC58-\uDC5F\uDC79-\uDC7F\uDCA7-\uDCAF\uDCFB-\uDCFF\uDD16-\uDD1B\uDDBC\uDDBD\uDDC0-\uDDCF\uDDD2-\uDDFF\uDE40-\uDE48\uDE7D\uDE7E\uDE9D-\uDE9F\uDEEB-\uDEEF\uDF58-\uDF5F\uDF78-\uDF7F\uDFA9-\uDFAF]|\uD803[\uDCFA-\uDCFF\uDE60-\uDE7E\uDF1D-\uDF26\uDF51-\uDF54]|\uD804[\uDC52-\uDC65\uDDE1-\uDDF4]|\uD805[\uDF3A\uDF3B]|\uD806[\uDCEA-\uDCF2]|\uD807[\uDC5A-\uDC6C]|\uD81A[\uDF5B-\uDF61]|\uD81B[\uDE80-\uDE96]|\uD834[\uDEE0-\uDEF3\uDF60-\uDF78]|\uD83A[\uDCC7-\uDCCF]|\uD83B[\uDC71-\uDCAB\uDCAD-\uDCAF\uDCB1-\uDCB4]|\uD83C[\uDD00-\uDD0C]' + }, + { + 'name': 'P', + 'alias': 'Punctuation', + 'bmp': '!-#%-\\*,-\\/:;\\?@\\[-\\]_\\{\\}\xA1\xA7\xAB\xB6\xB7\xBB\xBF\u037E\u0387\u055A-\u055F\u0589\u058A\u05BE\u05C0\u05C3\u05C6\u05F3\u05F4\u0609\u060A\u060C\u060D\u061B\u061E\u061F\u066A-\u066D\u06D4\u0700-\u070D\u07F7-\u07F9\u0830-\u083E\u085E\u0964\u0965\u0970\u09FD\u0A76\u0AF0\u0C84\u0DF4\u0E4F\u0E5A\u0E5B\u0F04-\u0F12\u0F14\u0F3A-\u0F3D\u0F85\u0FD0-\u0FD4\u0FD9\u0FDA\u104A-\u104F\u10FB\u1360-\u1368\u1400\u166D\u166E\u169B\u169C\u16EB-\u16ED\u1735\u1736\u17D4-\u17D6\u17D8-\u17DA\u1800-\u180A\u1944\u1945\u1A1E\u1A1F\u1AA0-\u1AA6\u1AA8-\u1AAD\u1B5A-\u1B60\u1BFC-\u1BFF\u1C3B-\u1C3F\u1C7E\u1C7F\u1CC0-\u1CC7\u1CD3\u2010-\u2027\u2030-\u2043\u2045-\u2051\u2053-\u205E\u207D\u207E\u208D\u208E\u2308-\u230B\u2329\u232A\u2768-\u2775\u27C5\u27C6\u27E6-\u27EF\u2983-\u2998\u29D8-\u29DB\u29FC\u29FD\u2CF9-\u2CFC\u2CFE\u2CFF\u2D70\u2E00-\u2E2E\u2E30-\u2E4E\u3001-\u3003\u3008-\u3011\u3014-\u301F\u3030\u303D\u30A0\u30FB\uA4FE\uA4FF\uA60D-\uA60F\uA673\uA67E\uA6F2-\uA6F7\uA874-\uA877\uA8CE\uA8CF\uA8F8-\uA8FA\uA8FC\uA92E\uA92F\uA95F\uA9C1-\uA9CD\uA9DE\uA9DF\uAA5C-\uAA5F\uAADE\uAADF\uAAF0\uAAF1\uABEB\uFD3E\uFD3F\uFE10-\uFE19\uFE30-\uFE52\uFE54-\uFE61\uFE63\uFE68\uFE6A\uFE6B\uFF01-\uFF03\uFF05-\uFF0A\uFF0C-\uFF0F\uFF1A\uFF1B\uFF1F\uFF20\uFF3B-\uFF3D\uFF3F\uFF5B\uFF5D\uFF5F-\uFF65', + 'astral': '\uD800[\uDD00-\uDD02\uDF9F\uDFD0]|\uD801\uDD6F|\uD802[\uDC57\uDD1F\uDD3F\uDE50-\uDE58\uDE7F\uDEF0-\uDEF6\uDF39-\uDF3F\uDF99-\uDF9C]|\uD803[\uDF55-\uDF59]|\uD804[\uDC47-\uDC4D\uDCBB\uDCBC\uDCBE-\uDCC1\uDD40-\uDD43\uDD74\uDD75\uDDC5-\uDDC8\uDDCD\uDDDB\uDDDD-\uDDDF\uDE38-\uDE3D\uDEA9]|\uD805[\uDC4B-\uDC4F\uDC5B\uDC5D\uDCC6\uDDC1-\uDDD7\uDE41-\uDE43\uDE60-\uDE6C\uDF3C-\uDF3E]|\uD806[\uDC3B\uDE3F-\uDE46\uDE9A-\uDE9C\uDE9E-\uDEA2]|\uD807[\uDC41-\uDC45\uDC70\uDC71\uDEF7\uDEF8]|\uD809[\uDC70-\uDC74]|\uD81A[\uDE6E\uDE6F\uDEF5\uDF37-\uDF3B\uDF44]|\uD81B[\uDE97-\uDE9A]|\uD82F\uDC9F|\uD836[\uDE87-\uDE8B]|\uD83A[\uDD5E\uDD5F]' + }, + { + 'name': 'Pc', + 'alias': 'Connector_Punctuation', + 'bmp': '_\u203F\u2040\u2054\uFE33\uFE34\uFE4D-\uFE4F\uFF3F' + }, + { + 'name': 'Pd', + 'alias': 'Dash_Punctuation', + 'bmp': '\\-\u058A\u05BE\u1400\u1806\u2010-\u2015\u2E17\u2E1A\u2E3A\u2E3B\u2E40\u301C\u3030\u30A0\uFE31\uFE32\uFE58\uFE63\uFF0D' + }, + { + 'name': 'Pe', + 'alias': 'Close_Punctuation', + 'bmp': '\\)\\]\\}\u0F3B\u0F3D\u169C\u2046\u207E\u208E\u2309\u230B\u232A\u2769\u276B\u276D\u276F\u2771\u2773\u2775\u27C6\u27E7\u27E9\u27EB\u27ED\u27EF\u2984\u2986\u2988\u298A\u298C\u298E\u2990\u2992\u2994\u2996\u2998\u29D9\u29DB\u29FD\u2E23\u2E25\u2E27\u2E29\u3009\u300B\u300D\u300F\u3011\u3015\u3017\u3019\u301B\u301E\u301F\uFD3E\uFE18\uFE36\uFE38\uFE3A\uFE3C\uFE3E\uFE40\uFE42\uFE44\uFE48\uFE5A\uFE5C\uFE5E\uFF09\uFF3D\uFF5D\uFF60\uFF63' + }, + { + 'name': 'Pf', + 'alias': 'Final_Punctuation', + 'bmp': '\xBB\u2019\u201D\u203A\u2E03\u2E05\u2E0A\u2E0D\u2E1D\u2E21' + }, + { + 'name': 'Pi', + 'alias': 'Initial_Punctuation', + 'bmp': '\xAB\u2018\u201B\u201C\u201F\u2039\u2E02\u2E04\u2E09\u2E0C\u2E1C\u2E20' + }, + { + 'name': 'Po', + 'alias': 'Other_Punctuation', + 'bmp': '!-#%-\'\\*,\\.\\/:;\\?@\\\xA1\xA7\xB6\xB7\xBF\u037E\u0387\u055A-\u055F\u0589\u05C0\u05C3\u05C6\u05F3\u05F4\u0609\u060A\u060C\u060D\u061B\u061E\u061F\u066A-\u066D\u06D4\u0700-\u070D\u07F7-\u07F9\u0830-\u083E\u085E\u0964\u0965\u0970\u09FD\u0A76\u0AF0\u0C84\u0DF4\u0E4F\u0E5A\u0E5B\u0F04-\u0F12\u0F14\u0F85\u0FD0-\u0FD4\u0FD9\u0FDA\u104A-\u104F\u10FB\u1360-\u1368\u166D\u166E\u16EB-\u16ED\u1735\u1736\u17D4-\u17D6\u17D8-\u17DA\u1800-\u1805\u1807-\u180A\u1944\u1945\u1A1E\u1A1F\u1AA0-\u1AA6\u1AA8-\u1AAD\u1B5A-\u1B60\u1BFC-\u1BFF\u1C3B-\u1C3F\u1C7E\u1C7F\u1CC0-\u1CC7\u1CD3\u2016\u2017\u2020-\u2027\u2030-\u2038\u203B-\u203E\u2041-\u2043\u2047-\u2051\u2053\u2055-\u205E\u2CF9-\u2CFC\u2CFE\u2CFF\u2D70\u2E00\u2E01\u2E06-\u2E08\u2E0B\u2E0E-\u2E16\u2E18\u2E19\u2E1B\u2E1E\u2E1F\u2E2A-\u2E2E\u2E30-\u2E39\u2E3C-\u2E3F\u2E41\u2E43-\u2E4E\u3001-\u3003\u303D\u30FB\uA4FE\uA4FF\uA60D-\uA60F\uA673\uA67E\uA6F2-\uA6F7\uA874-\uA877\uA8CE\uA8CF\uA8F8-\uA8FA\uA8FC\uA92E\uA92F\uA95F\uA9C1-\uA9CD\uA9DE\uA9DF\uAA5C-\uAA5F\uAADE\uAADF\uAAF0\uAAF1\uABEB\uFE10-\uFE16\uFE19\uFE30\uFE45\uFE46\uFE49-\uFE4C\uFE50-\uFE52\uFE54-\uFE57\uFE5F-\uFE61\uFE68\uFE6A\uFE6B\uFF01-\uFF03\uFF05-\uFF07\uFF0A\uFF0C\uFF0E\uFF0F\uFF1A\uFF1B\uFF1F\uFF20\uFF3C\uFF61\uFF64\uFF65', + 'astral': '\uD800[\uDD00-\uDD02\uDF9F\uDFD0]|\uD801\uDD6F|\uD802[\uDC57\uDD1F\uDD3F\uDE50-\uDE58\uDE7F\uDEF0-\uDEF6\uDF39-\uDF3F\uDF99-\uDF9C]|\uD803[\uDF55-\uDF59]|\uD804[\uDC47-\uDC4D\uDCBB\uDCBC\uDCBE-\uDCC1\uDD40-\uDD43\uDD74\uDD75\uDDC5-\uDDC8\uDDCD\uDDDB\uDDDD-\uDDDF\uDE38-\uDE3D\uDEA9]|\uD805[\uDC4B-\uDC4F\uDC5B\uDC5D\uDCC6\uDDC1-\uDDD7\uDE41-\uDE43\uDE60-\uDE6C\uDF3C-\uDF3E]|\uD806[\uDC3B\uDE3F-\uDE46\uDE9A-\uDE9C\uDE9E-\uDEA2]|\uD807[\uDC41-\uDC45\uDC70\uDC71\uDEF7\uDEF8]|\uD809[\uDC70-\uDC74]|\uD81A[\uDE6E\uDE6F\uDEF5\uDF37-\uDF3B\uDF44]|\uD81B[\uDE97-\uDE9A]|\uD82F\uDC9F|\uD836[\uDE87-\uDE8B]|\uD83A[\uDD5E\uDD5F]' + }, + { + 'name': 'Ps', + 'alias': 'Open_Punctuation', + 'bmp': '\\(\\[\\{\u0F3A\u0F3C\u169B\u201A\u201E\u2045\u207D\u208D\u2308\u230A\u2329\u2768\u276A\u276C\u276E\u2770\u2772\u2774\u27C5\u27E6\u27E8\u27EA\u27EC\u27EE\u2983\u2985\u2987\u2989\u298B\u298D\u298F\u2991\u2993\u2995\u2997\u29D8\u29DA\u29FC\u2E22\u2E24\u2E26\u2E28\u2E42\u3008\u300A\u300C\u300E\u3010\u3014\u3016\u3018\u301A\u301D\uFD3F\uFE17\uFE35\uFE37\uFE39\uFE3B\uFE3D\uFE3F\uFE41\uFE43\uFE47\uFE59\uFE5B\uFE5D\uFF08\uFF3B\uFF5B\uFF5F\uFF62' + }, + { + 'name': 'S', + 'alias': 'Symbol', + 'bmp': '\\$\\+<->\\^`\\|~\xA2-\xA6\xA8\xA9\xAC\xAE-\xB1\xB4\xB8\xD7\xF7\u02C2-\u02C5\u02D2-\u02DF\u02E5-\u02EB\u02ED\u02EF-\u02FF\u0375\u0384\u0385\u03F6\u0482\u058D-\u058F\u0606-\u0608\u060B\u060E\u060F\u06DE\u06E9\u06FD\u06FE\u07F6\u07FE\u07FF\u09F2\u09F3\u09FA\u09FB\u0AF1\u0B70\u0BF3-\u0BFA\u0C7F\u0D4F\u0D79\u0E3F\u0F01-\u0F03\u0F13\u0F15-\u0F17\u0F1A-\u0F1F\u0F34\u0F36\u0F38\u0FBE-\u0FC5\u0FC7-\u0FCC\u0FCE\u0FCF\u0FD5-\u0FD8\u109E\u109F\u1390-\u1399\u17DB\u1940\u19DE-\u19FF\u1B61-\u1B6A\u1B74-\u1B7C\u1FBD\u1FBF-\u1FC1\u1FCD-\u1FCF\u1FDD-\u1FDF\u1FED-\u1FEF\u1FFD\u1FFE\u2044\u2052\u207A-\u207C\u208A-\u208C\u20A0-\u20BF\u2100\u2101\u2103-\u2106\u2108\u2109\u2114\u2116-\u2118\u211E-\u2123\u2125\u2127\u2129\u212E\u213A\u213B\u2140-\u2144\u214A-\u214D\u214F\u218A\u218B\u2190-\u2307\u230C-\u2328\u232B-\u2426\u2440-\u244A\u249C-\u24E9\u2500-\u2767\u2794-\u27C4\u27C7-\u27E5\u27F0-\u2982\u2999-\u29D7\u29DC-\u29FB\u29FE-\u2B73\u2B76-\u2B95\u2B98-\u2BC8\u2BCA-\u2BFE\u2CE5-\u2CEA\u2E80-\u2E99\u2E9B-\u2EF3\u2F00-\u2FD5\u2FF0-\u2FFB\u3004\u3012\u3013\u3020\u3036\u3037\u303E\u303F\u309B\u309C\u3190\u3191\u3196-\u319F\u31C0-\u31E3\u3200-\u321E\u322A-\u3247\u3250\u3260-\u327F\u328A-\u32B0\u32C0-\u32FE\u3300-\u33FF\u4DC0-\u4DFF\uA490-\uA4C6\uA700-\uA716\uA720\uA721\uA789\uA78A\uA828-\uA82B\uA836-\uA839\uAA77-\uAA79\uAB5B\uFB29\uFBB2-\uFBC1\uFDFC\uFDFD\uFE62\uFE64-\uFE66\uFE69\uFF04\uFF0B\uFF1C-\uFF1E\uFF3E\uFF40\uFF5C\uFF5E\uFFE0-\uFFE6\uFFE8-\uFFEE\uFFFC\uFFFD', + 'astral': '\uD800[\uDD37-\uDD3F\uDD79-\uDD89\uDD8C-\uDD8E\uDD90-\uDD9B\uDDA0\uDDD0-\uDDFC]|\uD802[\uDC77\uDC78\uDEC8]|\uD805\uDF3F|\uD81A[\uDF3C-\uDF3F\uDF45]|\uD82F\uDC9C|\uD834[\uDC00-\uDCF5\uDD00-\uDD26\uDD29-\uDD64\uDD6A-\uDD6C\uDD83\uDD84\uDD8C-\uDDA9\uDDAE-\uDDE8\uDE00-\uDE41\uDE45\uDF00-\uDF56]|\uD835[\uDEC1\uDEDB\uDEFB\uDF15\uDF35\uDF4F\uDF6F\uDF89\uDFA9\uDFC3]|\uD836[\uDC00-\uDDFF\uDE37-\uDE3A\uDE6D-\uDE74\uDE76-\uDE83\uDE85\uDE86]|\uD83B[\uDCAC\uDCB0\uDEF0\uDEF1]|\uD83C[\uDC00-\uDC2B\uDC30-\uDC93\uDCA0-\uDCAE\uDCB1-\uDCBF\uDCC1-\uDCCF\uDCD1-\uDCF5\uDD10-\uDD6B\uDD70-\uDDAC\uDDE6-\uDE02\uDE10-\uDE3B\uDE40-\uDE48\uDE50\uDE51\uDE60-\uDE65\uDF00-\uDFFF]|\uD83D[\uDC00-\uDED4\uDEE0-\uDEEC\uDEF0-\uDEF9\uDF00-\uDF73\uDF80-\uDFD8]|\uD83E[\uDC00-\uDC0B\uDC10-\uDC47\uDC50-\uDC59\uDC60-\uDC87\uDC90-\uDCAD\uDD00-\uDD0B\uDD10-\uDD3E\uDD40-\uDD70\uDD73-\uDD76\uDD7A\uDD7C-\uDDA2\uDDB0-\uDDB9\uDDC0-\uDDC2\uDDD0-\uDDFF\uDE60-\uDE6D]' + }, + { + 'name': 'Sc', + 'alias': 'Currency_Symbol', + 'bmp': '\\$\xA2-\xA5\u058F\u060B\u07FE\u07FF\u09F2\u09F3\u09FB\u0AF1\u0BF9\u0E3F\u17DB\u20A0-\u20BF\uA838\uFDFC\uFE69\uFF04\uFFE0\uFFE1\uFFE5\uFFE6', + 'astral': '\uD83B\uDCB0' + }, + { + 'name': 'Sk', + 'alias': 'Modifier_Symbol', + 'bmp': '\\^`\xA8\xAF\xB4\xB8\u02C2-\u02C5\u02D2-\u02DF\u02E5-\u02EB\u02ED\u02EF-\u02FF\u0375\u0384\u0385\u1FBD\u1FBF-\u1FC1\u1FCD-\u1FCF\u1FDD-\u1FDF\u1FED-\u1FEF\u1FFD\u1FFE\u309B\u309C\uA700-\uA716\uA720\uA721\uA789\uA78A\uAB5B\uFBB2-\uFBC1\uFF3E\uFF40\uFFE3', + 'astral': '\uD83C[\uDFFB-\uDFFF]' + }, + { + 'name': 'Sm', + 'alias': 'Math_Symbol', + 'bmp': '\\+<->\\|~\xAC\xB1\xD7\xF7\u03F6\u0606-\u0608\u2044\u2052\u207A-\u207C\u208A-\u208C\u2118\u2140-\u2144\u214B\u2190-\u2194\u219A\u219B\u21A0\u21A3\u21A6\u21AE\u21CE\u21CF\u21D2\u21D4\u21F4-\u22FF\u2320\u2321\u237C\u239B-\u23B3\u23DC-\u23E1\u25B7\u25C1\u25F8-\u25FF\u266F\u27C0-\u27C4\u27C7-\u27E5\u27F0-\u27FF\u2900-\u2982\u2999-\u29D7\u29DC-\u29FB\u29FE-\u2AFF\u2B30-\u2B44\u2B47-\u2B4C\uFB29\uFE62\uFE64-\uFE66\uFF0B\uFF1C-\uFF1E\uFF5C\uFF5E\uFFE2\uFFE9-\uFFEC', + 'astral': '\uD835[\uDEC1\uDEDB\uDEFB\uDF15\uDF35\uDF4F\uDF6F\uDF89\uDFA9\uDFC3]|\uD83B[\uDEF0\uDEF1]' + }, + { + 'name': 'So', + 'alias': 'Other_Symbol', + 'bmp': '\xA6\xA9\xAE\xB0\u0482\u058D\u058E\u060E\u060F\u06DE\u06E9\u06FD\u06FE\u07F6\u09FA\u0B70\u0BF3-\u0BF8\u0BFA\u0C7F\u0D4F\u0D79\u0F01-\u0F03\u0F13\u0F15-\u0F17\u0F1A-\u0F1F\u0F34\u0F36\u0F38\u0FBE-\u0FC5\u0FC7-\u0FCC\u0FCE\u0FCF\u0FD5-\u0FD8\u109E\u109F\u1390-\u1399\u1940\u19DE-\u19FF\u1B61-\u1B6A\u1B74-\u1B7C\u2100\u2101\u2103-\u2106\u2108\u2109\u2114\u2116\u2117\u211E-\u2123\u2125\u2127\u2129\u212E\u213A\u213B\u214A\u214C\u214D\u214F\u218A\u218B\u2195-\u2199\u219C-\u219F\u21A1\u21A2\u21A4\u21A5\u21A7-\u21AD\u21AF-\u21CD\u21D0\u21D1\u21D3\u21D5-\u21F3\u2300-\u2307\u230C-\u231F\u2322-\u2328\u232B-\u237B\u237D-\u239A\u23B4-\u23DB\u23E2-\u2426\u2440-\u244A\u249C-\u24E9\u2500-\u25B6\u25B8-\u25C0\u25C2-\u25F7\u2600-\u266E\u2670-\u2767\u2794-\u27BF\u2800-\u28FF\u2B00-\u2B2F\u2B45\u2B46\u2B4D-\u2B73\u2B76-\u2B95\u2B98-\u2BC8\u2BCA-\u2BFE\u2CE5-\u2CEA\u2E80-\u2E99\u2E9B-\u2EF3\u2F00-\u2FD5\u2FF0-\u2FFB\u3004\u3012\u3013\u3020\u3036\u3037\u303E\u303F\u3190\u3191\u3196-\u319F\u31C0-\u31E3\u3200-\u321E\u322A-\u3247\u3250\u3260-\u327F\u328A-\u32B0\u32C0-\u32FE\u3300-\u33FF\u4DC0-\u4DFF\uA490-\uA4C6\uA828-\uA82B\uA836\uA837\uA839\uAA77-\uAA79\uFDFD\uFFE4\uFFE8\uFFED\uFFEE\uFFFC\uFFFD', + 'astral': '\uD800[\uDD37-\uDD3F\uDD79-\uDD89\uDD8C-\uDD8E\uDD90-\uDD9B\uDDA0\uDDD0-\uDDFC]|\uD802[\uDC77\uDC78\uDEC8]|\uD805\uDF3F|\uD81A[\uDF3C-\uDF3F\uDF45]|\uD82F\uDC9C|\uD834[\uDC00-\uDCF5\uDD00-\uDD26\uDD29-\uDD64\uDD6A-\uDD6C\uDD83\uDD84\uDD8C-\uDDA9\uDDAE-\uDDE8\uDE00-\uDE41\uDE45\uDF00-\uDF56]|\uD836[\uDC00-\uDDFF\uDE37-\uDE3A\uDE6D-\uDE74\uDE76-\uDE83\uDE85\uDE86]|\uD83B\uDCAC|\uD83C[\uDC00-\uDC2B\uDC30-\uDC93\uDCA0-\uDCAE\uDCB1-\uDCBF\uDCC1-\uDCCF\uDCD1-\uDCF5\uDD10-\uDD6B\uDD70-\uDDAC\uDDE6-\uDE02\uDE10-\uDE3B\uDE40-\uDE48\uDE50\uDE51\uDE60-\uDE65\uDF00-\uDFFA]|\uD83D[\uDC00-\uDED4\uDEE0-\uDEEC\uDEF0-\uDEF9\uDF00-\uDF73\uDF80-\uDFD8]|\uD83E[\uDC00-\uDC0B\uDC10-\uDC47\uDC50-\uDC59\uDC60-\uDC87\uDC90-\uDCAD\uDD00-\uDD0B\uDD10-\uDD3E\uDD40-\uDD70\uDD73-\uDD76\uDD7A\uDD7C-\uDDA2\uDDB0-\uDDB9\uDDC0-\uDDC2\uDDD0-\uDDFF\uDE60-\uDE6D]' + }, + { + 'name': 'Z', + 'alias': 'Separator', + 'bmp': ' \xA0\u1680\u2000-\u200A\u2028\u2029\u202F\u205F\u3000' + }, + { + 'name': 'Zl', + 'alias': 'Line_Separator', + 'bmp': '\u2028' + }, + { + 'name': 'Zp', + 'alias': 'Paragraph_Separator', + 'bmp': '\u2029' + }, + { + 'name': 'Zs', + 'alias': 'Space_Separator', + 'bmp': ' \xA0\u1680\u2000-\u200A\u202F\u205F\u3000' + } +]; + +var unicodeCategories = createCommonjsModule(function (module, exports) { +"use strict"; + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.default = void 0; + +var _categories = _interopRequireDefault(categories); + +function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } + +/*! + * XRegExp Unicode Categories 4.2.0 + * + * Steven Levithan (c) 2010-present MIT License + * Unicode data by Mathias Bynens + */ +var _default = function _default(XRegExp) { + /** + * Adds support for Unicode's general categories. E.g., `\p{Lu}` or `\p{Uppercase Letter}`. See + * category descriptions in UAX #44 . Token + * names are case insensitive, and any spaces, hyphens, and underscores are ignored. + * + * Uses Unicode 11.0.0. + * + * @requires XRegExp, Unicode Base + */ + if (!XRegExp.addUnicodeData) { + throw new ReferenceError('Unicode Base must be loaded before Unicode Categories'); + } + + XRegExp.addUnicodeData(_categories.default); +}; + +exports.default = _default; +module.exports = exports["default"]; +}); + +unwrapExports(unicodeCategories); + +var properties = [ + { + 'name': 'ASCII', + 'bmp': '\0-\x7F' + }, + { + 'name': 'Alphabetic', + 'bmp': 'A-Za-z\xAA\xB5\xBA\xC0-\xD6\xD8-\xF6\xF8-\u02C1\u02C6-\u02D1\u02E0-\u02E4\u02EC\u02EE\u0345\u0370-\u0374\u0376\u0377\u037A-\u037D\u037F\u0386\u0388-\u038A\u038C\u038E-\u03A1\u03A3-\u03F5\u03F7-\u0481\u048A-\u052F\u0531-\u0556\u0559\u0560-\u0588\u05B0-\u05BD\u05BF\u05C1\u05C2\u05C4\u05C5\u05C7\u05D0-\u05EA\u05EF-\u05F2\u0610-\u061A\u0620-\u0657\u0659-\u065F\u066E-\u06D3\u06D5-\u06DC\u06E1-\u06E8\u06ED-\u06EF\u06FA-\u06FC\u06FF\u0710-\u073F\u074D-\u07B1\u07CA-\u07EA\u07F4\u07F5\u07FA\u0800-\u0817\u081A-\u082C\u0840-\u0858\u0860-\u086A\u08A0-\u08B4\u08B6-\u08BD\u08D4-\u08DF\u08E3-\u08E9\u08F0-\u093B\u093D-\u094C\u094E-\u0950\u0955-\u0963\u0971-\u0983\u0985-\u098C\u098F\u0990\u0993-\u09A8\u09AA-\u09B0\u09B2\u09B6-\u09B9\u09BD-\u09C4\u09C7\u09C8\u09CB\u09CC\u09CE\u09D7\u09DC\u09DD\u09DF-\u09E3\u09F0\u09F1\u09FC\u0A01-\u0A03\u0A05-\u0A0A\u0A0F\u0A10\u0A13-\u0A28\u0A2A-\u0A30\u0A32\u0A33\u0A35\u0A36\u0A38\u0A39\u0A3E-\u0A42\u0A47\u0A48\u0A4B\u0A4C\u0A51\u0A59-\u0A5C\u0A5E\u0A70-\u0A75\u0A81-\u0A83\u0A85-\u0A8D\u0A8F-\u0A91\u0A93-\u0AA8\u0AAA-\u0AB0\u0AB2\u0AB3\u0AB5-\u0AB9\u0ABD-\u0AC5\u0AC7-\u0AC9\u0ACB\u0ACC\u0AD0\u0AE0-\u0AE3\u0AF9-\u0AFC\u0B01-\u0B03\u0B05-\u0B0C\u0B0F\u0B10\u0B13-\u0B28\u0B2A-\u0B30\u0B32\u0B33\u0B35-\u0B39\u0B3D-\u0B44\u0B47\u0B48\u0B4B\u0B4C\u0B56\u0B57\u0B5C\u0B5D\u0B5F-\u0B63\u0B71\u0B82\u0B83\u0B85-\u0B8A\u0B8E-\u0B90\u0B92-\u0B95\u0B99\u0B9A\u0B9C\u0B9E\u0B9F\u0BA3\u0BA4\u0BA8-\u0BAA\u0BAE-\u0BB9\u0BBE-\u0BC2\u0BC6-\u0BC8\u0BCA-\u0BCC\u0BD0\u0BD7\u0C00-\u0C03\u0C05-\u0C0C\u0C0E-\u0C10\u0C12-\u0C28\u0C2A-\u0C39\u0C3D-\u0C44\u0C46-\u0C48\u0C4A-\u0C4C\u0C55\u0C56\u0C58-\u0C5A\u0C60-\u0C63\u0C80-\u0C83\u0C85-\u0C8C\u0C8E-\u0C90\u0C92-\u0CA8\u0CAA-\u0CB3\u0CB5-\u0CB9\u0CBD-\u0CC4\u0CC6-\u0CC8\u0CCA-\u0CCC\u0CD5\u0CD6\u0CDE\u0CE0-\u0CE3\u0CF1\u0CF2\u0D00-\u0D03\u0D05-\u0D0C\u0D0E-\u0D10\u0D12-\u0D3A\u0D3D-\u0D44\u0D46-\u0D48\u0D4A-\u0D4C\u0D4E\u0D54-\u0D57\u0D5F-\u0D63\u0D7A-\u0D7F\u0D82\u0D83\u0D85-\u0D96\u0D9A-\u0DB1\u0DB3-\u0DBB\u0DBD\u0DC0-\u0DC6\u0DCF-\u0DD4\u0DD6\u0DD8-\u0DDF\u0DF2\u0DF3\u0E01-\u0E3A\u0E40-\u0E46\u0E4D\u0E81\u0E82\u0E84\u0E87\u0E88\u0E8A\u0E8D\u0E94-\u0E97\u0E99-\u0E9F\u0EA1-\u0EA3\u0EA5\u0EA7\u0EAA\u0EAB\u0EAD-\u0EB9\u0EBB-\u0EBD\u0EC0-\u0EC4\u0EC6\u0ECD\u0EDC-\u0EDF\u0F00\u0F40-\u0F47\u0F49-\u0F6C\u0F71-\u0F81\u0F88-\u0F97\u0F99-\u0FBC\u1000-\u1036\u1038\u103B-\u103F\u1050-\u1062\u1065-\u1068\u106E-\u1086\u108E\u109C\u109D\u10A0-\u10C5\u10C7\u10CD\u10D0-\u10FA\u10FC-\u1248\u124A-\u124D\u1250-\u1256\u1258\u125A-\u125D\u1260-\u1288\u128A-\u128D\u1290-\u12B0\u12B2-\u12B5\u12B8-\u12BE\u12C0\u12C2-\u12C5\u12C8-\u12D6\u12D8-\u1310\u1312-\u1315\u1318-\u135A\u135F\u1380-\u138F\u13A0-\u13F5\u13F8-\u13FD\u1401-\u166C\u166F-\u167F\u1681-\u169A\u16A0-\u16EA\u16EE-\u16F8\u1700-\u170C\u170E-\u1713\u1720-\u1733\u1740-\u1753\u1760-\u176C\u176E-\u1770\u1772\u1773\u1780-\u17B3\u17B6-\u17C8\u17D7\u17DC\u1820-\u1878\u1880-\u18AA\u18B0-\u18F5\u1900-\u191E\u1920-\u192B\u1930-\u1938\u1950-\u196D\u1970-\u1974\u1980-\u19AB\u19B0-\u19C9\u1A00-\u1A1B\u1A20-\u1A5E\u1A61-\u1A74\u1AA7\u1B00-\u1B33\u1B35-\u1B43\u1B45-\u1B4B\u1B80-\u1BA9\u1BAC-\u1BAF\u1BBA-\u1BE5\u1BE7-\u1BF1\u1C00-\u1C35\u1C4D-\u1C4F\u1C5A-\u1C7D\u1C80-\u1C88\u1C90-\u1CBA\u1CBD-\u1CBF\u1CE9-\u1CEC\u1CEE-\u1CF3\u1CF5\u1CF6\u1D00-\u1DBF\u1DE7-\u1DF4\u1E00-\u1F15\u1F18-\u1F1D\u1F20-\u1F45\u1F48-\u1F4D\u1F50-\u1F57\u1F59\u1F5B\u1F5D\u1F5F-\u1F7D\u1F80-\u1FB4\u1FB6-\u1FBC\u1FBE\u1FC2-\u1FC4\u1FC6-\u1FCC\u1FD0-\u1FD3\u1FD6-\u1FDB\u1FE0-\u1FEC\u1FF2-\u1FF4\u1FF6-\u1FFC\u2071\u207F\u2090-\u209C\u2102\u2107\u210A-\u2113\u2115\u2119-\u211D\u2124\u2126\u2128\u212A-\u212D\u212F-\u2139\u213C-\u213F\u2145-\u2149\u214E\u2160-\u2188\u24B6-\u24E9\u2C00-\u2C2E\u2C30-\u2C5E\u2C60-\u2CE4\u2CEB-\u2CEE\u2CF2\u2CF3\u2D00-\u2D25\u2D27\u2D2D\u2D30-\u2D67\u2D6F\u2D80-\u2D96\u2DA0-\u2DA6\u2DA8-\u2DAE\u2DB0-\u2DB6\u2DB8-\u2DBE\u2DC0-\u2DC6\u2DC8-\u2DCE\u2DD0-\u2DD6\u2DD8-\u2DDE\u2DE0-\u2DFF\u2E2F\u3005-\u3007\u3021-\u3029\u3031-\u3035\u3038-\u303C\u3041-\u3096\u309D-\u309F\u30A1-\u30FA\u30FC-\u30FF\u3105-\u312F\u3131-\u318E\u31A0-\u31BA\u31F0-\u31FF\u3400-\u4DB5\u4E00-\u9FEF\uA000-\uA48C\uA4D0-\uA4FD\uA500-\uA60C\uA610-\uA61F\uA62A\uA62B\uA640-\uA66E\uA674-\uA67B\uA67F-\uA6EF\uA717-\uA71F\uA722-\uA788\uA78B-\uA7B9\uA7F7-\uA801\uA803-\uA805\uA807-\uA80A\uA80C-\uA827\uA840-\uA873\uA880-\uA8C3\uA8C5\uA8F2-\uA8F7\uA8FB\uA8FD\uA8FE\uA90A-\uA92A\uA930-\uA952\uA960-\uA97C\uA980-\uA9B2\uA9B4-\uA9BF\uA9CF\uA9E0-\uA9E4\uA9E6-\uA9EF\uA9FA-\uA9FE\uAA00-\uAA36\uAA40-\uAA4D\uAA60-\uAA76\uAA7A\uAA7E-\uAABE\uAAC0\uAAC2\uAADB-\uAADD\uAAE0-\uAAEF\uAAF2-\uAAF5\uAB01-\uAB06\uAB09-\uAB0E\uAB11-\uAB16\uAB20-\uAB26\uAB28-\uAB2E\uAB30-\uAB5A\uAB5C-\uAB65\uAB70-\uABEA\uAC00-\uD7A3\uD7B0-\uD7C6\uD7CB-\uD7FB\uF900-\uFA6D\uFA70-\uFAD9\uFB00-\uFB06\uFB13-\uFB17\uFB1D-\uFB28\uFB2A-\uFB36\uFB38-\uFB3C\uFB3E\uFB40\uFB41\uFB43\uFB44\uFB46-\uFBB1\uFBD3-\uFD3D\uFD50-\uFD8F\uFD92-\uFDC7\uFDF0-\uFDFB\uFE70-\uFE74\uFE76-\uFEFC\uFF21-\uFF3A\uFF41-\uFF5A\uFF66-\uFFBE\uFFC2-\uFFC7\uFFCA-\uFFCF\uFFD2-\uFFD7\uFFDA-\uFFDC', + 'astral': '\uD800[\uDC00-\uDC0B\uDC0D-\uDC26\uDC28-\uDC3A\uDC3C\uDC3D\uDC3F-\uDC4D\uDC50-\uDC5D\uDC80-\uDCFA\uDD40-\uDD74\uDE80-\uDE9C\uDEA0-\uDED0\uDF00-\uDF1F\uDF2D-\uDF4A\uDF50-\uDF7A\uDF80-\uDF9D\uDFA0-\uDFC3\uDFC8-\uDFCF\uDFD1-\uDFD5]|\uD801[\uDC00-\uDC9D\uDCB0-\uDCD3\uDCD8-\uDCFB\uDD00-\uDD27\uDD30-\uDD63\uDE00-\uDF36\uDF40-\uDF55\uDF60-\uDF67]|\uD802[\uDC00-\uDC05\uDC08\uDC0A-\uDC35\uDC37\uDC38\uDC3C\uDC3F-\uDC55\uDC60-\uDC76\uDC80-\uDC9E\uDCE0-\uDCF2\uDCF4\uDCF5\uDD00-\uDD15\uDD20-\uDD39\uDD80-\uDDB7\uDDBE\uDDBF\uDE00-\uDE03\uDE05\uDE06\uDE0C-\uDE13\uDE15-\uDE17\uDE19-\uDE35\uDE60-\uDE7C\uDE80-\uDE9C\uDEC0-\uDEC7\uDEC9-\uDEE4\uDF00-\uDF35\uDF40-\uDF55\uDF60-\uDF72\uDF80-\uDF91]|\uD803[\uDC00-\uDC48\uDC80-\uDCB2\uDCC0-\uDCF2\uDD00-\uDD27\uDF00-\uDF1C\uDF27\uDF30-\uDF45]|\uD804[\uDC00-\uDC45\uDC82-\uDCB8\uDCD0-\uDCE8\uDD00-\uDD32\uDD44-\uDD46\uDD50-\uDD72\uDD76\uDD80-\uDDBF\uDDC1-\uDDC4\uDDDA\uDDDC\uDE00-\uDE11\uDE13-\uDE34\uDE37\uDE3E\uDE80-\uDE86\uDE88\uDE8A-\uDE8D\uDE8F-\uDE9D\uDE9F-\uDEA8\uDEB0-\uDEE8\uDF00-\uDF03\uDF05-\uDF0C\uDF0F\uDF10\uDF13-\uDF28\uDF2A-\uDF30\uDF32\uDF33\uDF35-\uDF39\uDF3D-\uDF44\uDF47\uDF48\uDF4B\uDF4C\uDF50\uDF57\uDF5D-\uDF63]|\uD805[\uDC00-\uDC41\uDC43-\uDC45\uDC47-\uDC4A\uDC80-\uDCC1\uDCC4\uDCC5\uDCC7\uDD80-\uDDB5\uDDB8-\uDDBE\uDDD8-\uDDDD\uDE00-\uDE3E\uDE40\uDE44\uDE80-\uDEB5\uDF00-\uDF1A\uDF1D-\uDF2A]|\uD806[\uDC00-\uDC38\uDCA0-\uDCDF\uDCFF\uDE00-\uDE32\uDE35-\uDE3E\uDE50-\uDE83\uDE86-\uDE97\uDE9D\uDEC0-\uDEF8]|\uD807[\uDC00-\uDC08\uDC0A-\uDC36\uDC38-\uDC3E\uDC40\uDC72-\uDC8F\uDC92-\uDCA7\uDCA9-\uDCB6\uDD00-\uDD06\uDD08\uDD09\uDD0B-\uDD36\uDD3A\uDD3C\uDD3D\uDD3F-\uDD41\uDD43\uDD46\uDD47\uDD60-\uDD65\uDD67\uDD68\uDD6A-\uDD8E\uDD90\uDD91\uDD93-\uDD96\uDD98\uDEE0-\uDEF6]|\uD808[\uDC00-\uDF99]|\uD809[\uDC00-\uDC6E\uDC80-\uDD43]|[\uD80C\uD81C-\uD820\uD840-\uD868\uD86A-\uD86C\uD86F-\uD872\uD874-\uD879][\uDC00-\uDFFF]|\uD80D[\uDC00-\uDC2E]|\uD811[\uDC00-\uDE46]|\uD81A[\uDC00-\uDE38\uDE40-\uDE5E\uDED0-\uDEED\uDF00-\uDF36\uDF40-\uDF43\uDF63-\uDF77\uDF7D-\uDF8F]|\uD81B[\uDE40-\uDE7F\uDF00-\uDF44\uDF50-\uDF7E\uDF93-\uDF9F\uDFE0\uDFE1]|\uD821[\uDC00-\uDFF1]|\uD822[\uDC00-\uDEF2]|\uD82C[\uDC00-\uDD1E\uDD70-\uDEFB]|\uD82F[\uDC00-\uDC6A\uDC70-\uDC7C\uDC80-\uDC88\uDC90-\uDC99\uDC9E]|\uD835[\uDC00-\uDC54\uDC56-\uDC9C\uDC9E\uDC9F\uDCA2\uDCA5\uDCA6\uDCA9-\uDCAC\uDCAE-\uDCB9\uDCBB\uDCBD-\uDCC3\uDCC5-\uDD05\uDD07-\uDD0A\uDD0D-\uDD14\uDD16-\uDD1C\uDD1E-\uDD39\uDD3B-\uDD3E\uDD40-\uDD44\uDD46\uDD4A-\uDD50\uDD52-\uDEA5\uDEA8-\uDEC0\uDEC2-\uDEDA\uDEDC-\uDEFA\uDEFC-\uDF14\uDF16-\uDF34\uDF36-\uDF4E\uDF50-\uDF6E\uDF70-\uDF88\uDF8A-\uDFA8\uDFAA-\uDFC2\uDFC4-\uDFCB]|\uD838[\uDC00-\uDC06\uDC08-\uDC18\uDC1B-\uDC21\uDC23\uDC24\uDC26-\uDC2A]|\uD83A[\uDC00-\uDCC4\uDD00-\uDD43\uDD47]|\uD83B[\uDE00-\uDE03\uDE05-\uDE1F\uDE21\uDE22\uDE24\uDE27\uDE29-\uDE32\uDE34-\uDE37\uDE39\uDE3B\uDE42\uDE47\uDE49\uDE4B\uDE4D-\uDE4F\uDE51\uDE52\uDE54\uDE57\uDE59\uDE5B\uDE5D\uDE5F\uDE61\uDE62\uDE64\uDE67-\uDE6A\uDE6C-\uDE72\uDE74-\uDE77\uDE79-\uDE7C\uDE7E\uDE80-\uDE89\uDE8B-\uDE9B\uDEA1-\uDEA3\uDEA5-\uDEA9\uDEAB-\uDEBB]|\uD83C[\uDD30-\uDD49\uDD50-\uDD69\uDD70-\uDD89]|\uD869[\uDC00-\uDED6\uDF00-\uDFFF]|\uD86D[\uDC00-\uDF34\uDF40-\uDFFF]|\uD86E[\uDC00-\uDC1D\uDC20-\uDFFF]|\uD873[\uDC00-\uDEA1\uDEB0-\uDFFF]|\uD87A[\uDC00-\uDFE0]|\uD87E[\uDC00-\uDE1D]' + }, + { + 'name': 'Any', + 'isBmpLast': true, + 'bmp': '\0-\uFFFF', + 'astral': '[\uD800-\uDBFF][\uDC00-\uDFFF]' + }, + { + 'name': 'Default_Ignorable_Code_Point', + 'bmp': '\xAD\u034F\u061C\u115F\u1160\u17B4\u17B5\u180B-\u180E\u200B-\u200F\u202A-\u202E\u2060-\u206F\u3164\uFE00-\uFE0F\uFEFF\uFFA0\uFFF0-\uFFF8', + 'astral': '\uD82F[\uDCA0-\uDCA3]|\uD834[\uDD73-\uDD7A]|[\uDB40-\uDB43][\uDC00-\uDFFF]' + }, + { + 'name': 'Lowercase', + 'bmp': 'a-z\xAA\xB5\xBA\xDF-\xF6\xF8-\xFF\u0101\u0103\u0105\u0107\u0109\u010B\u010D\u010F\u0111\u0113\u0115\u0117\u0119\u011B\u011D\u011F\u0121\u0123\u0125\u0127\u0129\u012B\u012D\u012F\u0131\u0133\u0135\u0137\u0138\u013A\u013C\u013E\u0140\u0142\u0144\u0146\u0148\u0149\u014B\u014D\u014F\u0151\u0153\u0155\u0157\u0159\u015B\u015D\u015F\u0161\u0163\u0165\u0167\u0169\u016B\u016D\u016F\u0171\u0173\u0175\u0177\u017A\u017C\u017E-\u0180\u0183\u0185\u0188\u018C\u018D\u0192\u0195\u0199-\u019B\u019E\u01A1\u01A3\u01A5\u01A8\u01AA\u01AB\u01AD\u01B0\u01B4\u01B6\u01B9\u01BA\u01BD-\u01BF\u01C6\u01C9\u01CC\u01CE\u01D0\u01D2\u01D4\u01D6\u01D8\u01DA\u01DC\u01DD\u01DF\u01E1\u01E3\u01E5\u01E7\u01E9\u01EB\u01ED\u01EF\u01F0\u01F3\u01F5\u01F9\u01FB\u01FD\u01FF\u0201\u0203\u0205\u0207\u0209\u020B\u020D\u020F\u0211\u0213\u0215\u0217\u0219\u021B\u021D\u021F\u0221\u0223\u0225\u0227\u0229\u022B\u022D\u022F\u0231\u0233-\u0239\u023C\u023F\u0240\u0242\u0247\u0249\u024B\u024D\u024F-\u0293\u0295-\u02B8\u02C0\u02C1\u02E0-\u02E4\u0345\u0371\u0373\u0377\u037A-\u037D\u0390\u03AC-\u03CE\u03D0\u03D1\u03D5-\u03D7\u03D9\u03DB\u03DD\u03DF\u03E1\u03E3\u03E5\u03E7\u03E9\u03EB\u03ED\u03EF-\u03F3\u03F5\u03F8\u03FB\u03FC\u0430-\u045F\u0461\u0463\u0465\u0467\u0469\u046B\u046D\u046F\u0471\u0473\u0475\u0477\u0479\u047B\u047D\u047F\u0481\u048B\u048D\u048F\u0491\u0493\u0495\u0497\u0499\u049B\u049D\u049F\u04A1\u04A3\u04A5\u04A7\u04A9\u04AB\u04AD\u04AF\u04B1\u04B3\u04B5\u04B7\u04B9\u04BB\u04BD\u04BF\u04C2\u04C4\u04C6\u04C8\u04CA\u04CC\u04CE\u04CF\u04D1\u04D3\u04D5\u04D7\u04D9\u04DB\u04DD\u04DF\u04E1\u04E3\u04E5\u04E7\u04E9\u04EB\u04ED\u04EF\u04F1\u04F3\u04F5\u04F7\u04F9\u04FB\u04FD\u04FF\u0501\u0503\u0505\u0507\u0509\u050B\u050D\u050F\u0511\u0513\u0515\u0517\u0519\u051B\u051D\u051F\u0521\u0523\u0525\u0527\u0529\u052B\u052D\u052F\u0560-\u0588\u10D0-\u10FA\u10FD-\u10FF\u13F8-\u13FD\u1C80-\u1C88\u1D00-\u1DBF\u1E01\u1E03\u1E05\u1E07\u1E09\u1E0B\u1E0D\u1E0F\u1E11\u1E13\u1E15\u1E17\u1E19\u1E1B\u1E1D\u1E1F\u1E21\u1E23\u1E25\u1E27\u1E29\u1E2B\u1E2D\u1E2F\u1E31\u1E33\u1E35\u1E37\u1E39\u1E3B\u1E3D\u1E3F\u1E41\u1E43\u1E45\u1E47\u1E49\u1E4B\u1E4D\u1E4F\u1E51\u1E53\u1E55\u1E57\u1E59\u1E5B\u1E5D\u1E5F\u1E61\u1E63\u1E65\u1E67\u1E69\u1E6B\u1E6D\u1E6F\u1E71\u1E73\u1E75\u1E77\u1E79\u1E7B\u1E7D\u1E7F\u1E81\u1E83\u1E85\u1E87\u1E89\u1E8B\u1E8D\u1E8F\u1E91\u1E93\u1E95-\u1E9D\u1E9F\u1EA1\u1EA3\u1EA5\u1EA7\u1EA9\u1EAB\u1EAD\u1EAF\u1EB1\u1EB3\u1EB5\u1EB7\u1EB9\u1EBB\u1EBD\u1EBF\u1EC1\u1EC3\u1EC5\u1EC7\u1EC9\u1ECB\u1ECD\u1ECF\u1ED1\u1ED3\u1ED5\u1ED7\u1ED9\u1EDB\u1EDD\u1EDF\u1EE1\u1EE3\u1EE5\u1EE7\u1EE9\u1EEB\u1EED\u1EEF\u1EF1\u1EF3\u1EF5\u1EF7\u1EF9\u1EFB\u1EFD\u1EFF-\u1F07\u1F10-\u1F15\u1F20-\u1F27\u1F30-\u1F37\u1F40-\u1F45\u1F50-\u1F57\u1F60-\u1F67\u1F70-\u1F7D\u1F80-\u1F87\u1F90-\u1F97\u1FA0-\u1FA7\u1FB0-\u1FB4\u1FB6\u1FB7\u1FBE\u1FC2-\u1FC4\u1FC6\u1FC7\u1FD0-\u1FD3\u1FD6\u1FD7\u1FE0-\u1FE7\u1FF2-\u1FF4\u1FF6\u1FF7\u2071\u207F\u2090-\u209C\u210A\u210E\u210F\u2113\u212F\u2134\u2139\u213C\u213D\u2146-\u2149\u214E\u2170-\u217F\u2184\u24D0-\u24E9\u2C30-\u2C5E\u2C61\u2C65\u2C66\u2C68\u2C6A\u2C6C\u2C71\u2C73\u2C74\u2C76-\u2C7D\u2C81\u2C83\u2C85\u2C87\u2C89\u2C8B\u2C8D\u2C8F\u2C91\u2C93\u2C95\u2C97\u2C99\u2C9B\u2C9D\u2C9F\u2CA1\u2CA3\u2CA5\u2CA7\u2CA9\u2CAB\u2CAD\u2CAF\u2CB1\u2CB3\u2CB5\u2CB7\u2CB9\u2CBB\u2CBD\u2CBF\u2CC1\u2CC3\u2CC5\u2CC7\u2CC9\u2CCB\u2CCD\u2CCF\u2CD1\u2CD3\u2CD5\u2CD7\u2CD9\u2CDB\u2CDD\u2CDF\u2CE1\u2CE3\u2CE4\u2CEC\u2CEE\u2CF3\u2D00-\u2D25\u2D27\u2D2D\uA641\uA643\uA645\uA647\uA649\uA64B\uA64D\uA64F\uA651\uA653\uA655\uA657\uA659\uA65B\uA65D\uA65F\uA661\uA663\uA665\uA667\uA669\uA66B\uA66D\uA681\uA683\uA685\uA687\uA689\uA68B\uA68D\uA68F\uA691\uA693\uA695\uA697\uA699\uA69B-\uA69D\uA723\uA725\uA727\uA729\uA72B\uA72D\uA72F-\uA731\uA733\uA735\uA737\uA739\uA73B\uA73D\uA73F\uA741\uA743\uA745\uA747\uA749\uA74B\uA74D\uA74F\uA751\uA753\uA755\uA757\uA759\uA75B\uA75D\uA75F\uA761\uA763\uA765\uA767\uA769\uA76B\uA76D\uA76F-\uA778\uA77A\uA77C\uA77F\uA781\uA783\uA785\uA787\uA78C\uA78E\uA791\uA793-\uA795\uA797\uA799\uA79B\uA79D\uA79F\uA7A1\uA7A3\uA7A5\uA7A7\uA7A9\uA7AF\uA7B5\uA7B7\uA7B9\uA7F8-\uA7FA\uAB30-\uAB5A\uAB5C-\uAB65\uAB70-\uABBF\uFB00-\uFB06\uFB13-\uFB17\uFF41-\uFF5A', + 'astral': '\uD801[\uDC28-\uDC4F\uDCD8-\uDCFB]|\uD803[\uDCC0-\uDCF2]|\uD806[\uDCC0-\uDCDF]|\uD81B[\uDE60-\uDE7F]|\uD835[\uDC1A-\uDC33\uDC4E-\uDC54\uDC56-\uDC67\uDC82-\uDC9B\uDCB6-\uDCB9\uDCBB\uDCBD-\uDCC3\uDCC5-\uDCCF\uDCEA-\uDD03\uDD1E-\uDD37\uDD52-\uDD6B\uDD86-\uDD9F\uDDBA-\uDDD3\uDDEE-\uDE07\uDE22-\uDE3B\uDE56-\uDE6F\uDE8A-\uDEA5\uDEC2-\uDEDA\uDEDC-\uDEE1\uDEFC-\uDF14\uDF16-\uDF1B\uDF36-\uDF4E\uDF50-\uDF55\uDF70-\uDF88\uDF8A-\uDF8F\uDFAA-\uDFC2\uDFC4-\uDFC9\uDFCB]|\uD83A[\uDD22-\uDD43]' + }, + { + 'name': 'Noncharacter_Code_Point', + 'bmp': '\uFDD0-\uFDEF\uFFFE\uFFFF', + 'astral': '[\uD83F\uD87F\uD8BF\uD8FF\uD93F\uD97F\uD9BF\uD9FF\uDA3F\uDA7F\uDABF\uDAFF\uDB3F\uDB7F\uDBBF\uDBFF][\uDFFE\uDFFF]' + }, + { + 'name': 'Uppercase', + 'bmp': 'A-Z\xC0-\xD6\xD8-\xDE\u0100\u0102\u0104\u0106\u0108\u010A\u010C\u010E\u0110\u0112\u0114\u0116\u0118\u011A\u011C\u011E\u0120\u0122\u0124\u0126\u0128\u012A\u012C\u012E\u0130\u0132\u0134\u0136\u0139\u013B\u013D\u013F\u0141\u0143\u0145\u0147\u014A\u014C\u014E\u0150\u0152\u0154\u0156\u0158\u015A\u015C\u015E\u0160\u0162\u0164\u0166\u0168\u016A\u016C\u016E\u0170\u0172\u0174\u0176\u0178\u0179\u017B\u017D\u0181\u0182\u0184\u0186\u0187\u0189-\u018B\u018E-\u0191\u0193\u0194\u0196-\u0198\u019C\u019D\u019F\u01A0\u01A2\u01A4\u01A6\u01A7\u01A9\u01AC\u01AE\u01AF\u01B1-\u01B3\u01B5\u01B7\u01B8\u01BC\u01C4\u01C7\u01CA\u01CD\u01CF\u01D1\u01D3\u01D5\u01D7\u01D9\u01DB\u01DE\u01E0\u01E2\u01E4\u01E6\u01E8\u01EA\u01EC\u01EE\u01F1\u01F4\u01F6-\u01F8\u01FA\u01FC\u01FE\u0200\u0202\u0204\u0206\u0208\u020A\u020C\u020E\u0210\u0212\u0214\u0216\u0218\u021A\u021C\u021E\u0220\u0222\u0224\u0226\u0228\u022A\u022C\u022E\u0230\u0232\u023A\u023B\u023D\u023E\u0241\u0243-\u0246\u0248\u024A\u024C\u024E\u0370\u0372\u0376\u037F\u0386\u0388-\u038A\u038C\u038E\u038F\u0391-\u03A1\u03A3-\u03AB\u03CF\u03D2-\u03D4\u03D8\u03DA\u03DC\u03DE\u03E0\u03E2\u03E4\u03E6\u03E8\u03EA\u03EC\u03EE\u03F4\u03F7\u03F9\u03FA\u03FD-\u042F\u0460\u0462\u0464\u0466\u0468\u046A\u046C\u046E\u0470\u0472\u0474\u0476\u0478\u047A\u047C\u047E\u0480\u048A\u048C\u048E\u0490\u0492\u0494\u0496\u0498\u049A\u049C\u049E\u04A0\u04A2\u04A4\u04A6\u04A8\u04AA\u04AC\u04AE\u04B0\u04B2\u04B4\u04B6\u04B8\u04BA\u04BC\u04BE\u04C0\u04C1\u04C3\u04C5\u04C7\u04C9\u04CB\u04CD\u04D0\u04D2\u04D4\u04D6\u04D8\u04DA\u04DC\u04DE\u04E0\u04E2\u04E4\u04E6\u04E8\u04EA\u04EC\u04EE\u04F0\u04F2\u04F4\u04F6\u04F8\u04FA\u04FC\u04FE\u0500\u0502\u0504\u0506\u0508\u050A\u050C\u050E\u0510\u0512\u0514\u0516\u0518\u051A\u051C\u051E\u0520\u0522\u0524\u0526\u0528\u052A\u052C\u052E\u0531-\u0556\u10A0-\u10C5\u10C7\u10CD\u13A0-\u13F5\u1C90-\u1CBA\u1CBD-\u1CBF\u1E00\u1E02\u1E04\u1E06\u1E08\u1E0A\u1E0C\u1E0E\u1E10\u1E12\u1E14\u1E16\u1E18\u1E1A\u1E1C\u1E1E\u1E20\u1E22\u1E24\u1E26\u1E28\u1E2A\u1E2C\u1E2E\u1E30\u1E32\u1E34\u1E36\u1E38\u1E3A\u1E3C\u1E3E\u1E40\u1E42\u1E44\u1E46\u1E48\u1E4A\u1E4C\u1E4E\u1E50\u1E52\u1E54\u1E56\u1E58\u1E5A\u1E5C\u1E5E\u1E60\u1E62\u1E64\u1E66\u1E68\u1E6A\u1E6C\u1E6E\u1E70\u1E72\u1E74\u1E76\u1E78\u1E7A\u1E7C\u1E7E\u1E80\u1E82\u1E84\u1E86\u1E88\u1E8A\u1E8C\u1E8E\u1E90\u1E92\u1E94\u1E9E\u1EA0\u1EA2\u1EA4\u1EA6\u1EA8\u1EAA\u1EAC\u1EAE\u1EB0\u1EB2\u1EB4\u1EB6\u1EB8\u1EBA\u1EBC\u1EBE\u1EC0\u1EC2\u1EC4\u1EC6\u1EC8\u1ECA\u1ECC\u1ECE\u1ED0\u1ED2\u1ED4\u1ED6\u1ED8\u1EDA\u1EDC\u1EDE\u1EE0\u1EE2\u1EE4\u1EE6\u1EE8\u1EEA\u1EEC\u1EEE\u1EF0\u1EF2\u1EF4\u1EF6\u1EF8\u1EFA\u1EFC\u1EFE\u1F08-\u1F0F\u1F18-\u1F1D\u1F28-\u1F2F\u1F38-\u1F3F\u1F48-\u1F4D\u1F59\u1F5B\u1F5D\u1F5F\u1F68-\u1F6F\u1FB8-\u1FBB\u1FC8-\u1FCB\u1FD8-\u1FDB\u1FE8-\u1FEC\u1FF8-\u1FFB\u2102\u2107\u210B-\u210D\u2110-\u2112\u2115\u2119-\u211D\u2124\u2126\u2128\u212A-\u212D\u2130-\u2133\u213E\u213F\u2145\u2160-\u216F\u2183\u24B6-\u24CF\u2C00-\u2C2E\u2C60\u2C62-\u2C64\u2C67\u2C69\u2C6B\u2C6D-\u2C70\u2C72\u2C75\u2C7E-\u2C80\u2C82\u2C84\u2C86\u2C88\u2C8A\u2C8C\u2C8E\u2C90\u2C92\u2C94\u2C96\u2C98\u2C9A\u2C9C\u2C9E\u2CA0\u2CA2\u2CA4\u2CA6\u2CA8\u2CAA\u2CAC\u2CAE\u2CB0\u2CB2\u2CB4\u2CB6\u2CB8\u2CBA\u2CBC\u2CBE\u2CC0\u2CC2\u2CC4\u2CC6\u2CC8\u2CCA\u2CCC\u2CCE\u2CD0\u2CD2\u2CD4\u2CD6\u2CD8\u2CDA\u2CDC\u2CDE\u2CE0\u2CE2\u2CEB\u2CED\u2CF2\uA640\uA642\uA644\uA646\uA648\uA64A\uA64C\uA64E\uA650\uA652\uA654\uA656\uA658\uA65A\uA65C\uA65E\uA660\uA662\uA664\uA666\uA668\uA66A\uA66C\uA680\uA682\uA684\uA686\uA688\uA68A\uA68C\uA68E\uA690\uA692\uA694\uA696\uA698\uA69A\uA722\uA724\uA726\uA728\uA72A\uA72C\uA72E\uA732\uA734\uA736\uA738\uA73A\uA73C\uA73E\uA740\uA742\uA744\uA746\uA748\uA74A\uA74C\uA74E\uA750\uA752\uA754\uA756\uA758\uA75A\uA75C\uA75E\uA760\uA762\uA764\uA766\uA768\uA76A\uA76C\uA76E\uA779\uA77B\uA77D\uA77E\uA780\uA782\uA784\uA786\uA78B\uA78D\uA790\uA792\uA796\uA798\uA79A\uA79C\uA79E\uA7A0\uA7A2\uA7A4\uA7A6\uA7A8\uA7AA-\uA7AE\uA7B0-\uA7B4\uA7B6\uA7B8\uFF21-\uFF3A', + 'astral': '\uD801[\uDC00-\uDC27\uDCB0-\uDCD3]|\uD803[\uDC80-\uDCB2]|\uD806[\uDCA0-\uDCBF]|\uD81B[\uDE40-\uDE5F]|\uD835[\uDC00-\uDC19\uDC34-\uDC4D\uDC68-\uDC81\uDC9C\uDC9E\uDC9F\uDCA2\uDCA5\uDCA6\uDCA9-\uDCAC\uDCAE-\uDCB5\uDCD0-\uDCE9\uDD04\uDD05\uDD07-\uDD0A\uDD0D-\uDD14\uDD16-\uDD1C\uDD38\uDD39\uDD3B-\uDD3E\uDD40-\uDD44\uDD46\uDD4A-\uDD50\uDD6C-\uDD85\uDDA0-\uDDB9\uDDD4-\uDDED\uDE08-\uDE21\uDE3C-\uDE55\uDE70-\uDE89\uDEA8-\uDEC0\uDEE2-\uDEFA\uDF1C-\uDF34\uDF56-\uDF6E\uDF90-\uDFA8\uDFCA]|\uD83A[\uDD00-\uDD21]|\uD83C[\uDD30-\uDD49\uDD50-\uDD69\uDD70-\uDD89]' + }, + { + 'name': 'White_Space', + 'bmp': '\t-\r \x85\xA0\u1680\u2000-\u200A\u2028\u2029\u202F\u205F\u3000' + } +]; + +var unicodeProperties = createCommonjsModule(function (module, exports) { +"use strict"; + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.default = void 0; + +var _properties = _interopRequireDefault(properties); + +function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } + +/*! + * XRegExp Unicode Properties 4.2.0 + * + * Steven Levithan (c) 2012-present MIT License + * Unicode data by Mathias Bynens + */ +var _default = function _default(XRegExp) { + /** + * Adds properties to meet the UTS #18 Level 1 RL1.2 requirements for Unicode regex support. See + * . Following are definitions of these properties from + * UAX #44 : + * + * - Alphabetic + * Characters with the Alphabetic property. Generated from: Lowercase + Uppercase + Lt + Lm + + * Lo + Nl + Other_Alphabetic. + * + * - Default_Ignorable_Code_Point + * For programmatic determination of default ignorable code points. New characters that should + * be ignored in rendering (unless explicitly supported) will be assigned in these ranges, + * permitting programs to correctly handle the default rendering of such characters when not + * otherwise supported. + * + * - Lowercase + * Characters with the Lowercase property. Generated from: Ll + Other_Lowercase. + * + * - Noncharacter_Code_Point + * Code points permanently reserved for internal use. + * + * - Uppercase + * Characters with the Uppercase property. Generated from: Lu + Other_Uppercase. + * + * - White_Space + * Spaces, separator characters and other control characters which should be treated by + * programming languages as "white space" for the purpose of parsing elements. + * + * The properties ASCII, Any, and Assigned are also included but are not defined in UAX #44. UTS + * #18 RL1.2 additionally requires support for Unicode scripts and general categories. These are + * included in XRegExp's Unicode Categories and Unicode Scripts addons. + * + * Token names are case insensitive, and any spaces, hyphens, and underscores are ignored. + * + * Uses Unicode 11.0.0. + * + * @requires XRegExp, Unicode Base + */ + if (!XRegExp.addUnicodeData) { + throw new ReferenceError('Unicode Base must be loaded before Unicode Properties'); + } + + var unicodeData = _properties.default; // Add non-generated data + + unicodeData.push({ + name: 'Assigned', + // Since this is defined as the inverse of Unicode category Cn (Unassigned), the Unicode + // Categories addon is required to use this property + inverseOf: 'Cn' + }); + XRegExp.addUnicodeData(unicodeData); +}; + +exports.default = _default; +module.exports = exports["default"]; +}); + +unwrapExports(unicodeProperties); + +var scripts = [ + { + 'name': 'Adlam', + 'astral': '\uD83A[\uDD00-\uDD4A\uDD50-\uDD59\uDD5E\uDD5F]' + }, + { + 'name': 'Ahom', + 'astral': '\uD805[\uDF00-\uDF1A\uDF1D-\uDF2B\uDF30-\uDF3F]' + }, + { + 'name': 'Anatolian_Hieroglyphs', + 'astral': '\uD811[\uDC00-\uDE46]' + }, + { + 'name': 'Arabic', + 'bmp': '\u0600-\u0604\u0606-\u060B\u060D-\u061A\u061C\u061E\u0620-\u063F\u0641-\u064A\u0656-\u066F\u0671-\u06DC\u06DE-\u06FF\u0750-\u077F\u08A0-\u08B4\u08B6-\u08BD\u08D3-\u08E1\u08E3-\u08FF\uFB50-\uFBC1\uFBD3-\uFD3D\uFD50-\uFD8F\uFD92-\uFDC7\uFDF0-\uFDFD\uFE70-\uFE74\uFE76-\uFEFC', + 'astral': '\uD803[\uDE60-\uDE7E]|\uD83B[\uDE00-\uDE03\uDE05-\uDE1F\uDE21\uDE22\uDE24\uDE27\uDE29-\uDE32\uDE34-\uDE37\uDE39\uDE3B\uDE42\uDE47\uDE49\uDE4B\uDE4D-\uDE4F\uDE51\uDE52\uDE54\uDE57\uDE59\uDE5B\uDE5D\uDE5F\uDE61\uDE62\uDE64\uDE67-\uDE6A\uDE6C-\uDE72\uDE74-\uDE77\uDE79-\uDE7C\uDE7E\uDE80-\uDE89\uDE8B-\uDE9B\uDEA1-\uDEA3\uDEA5-\uDEA9\uDEAB-\uDEBB\uDEF0\uDEF1]' + }, + { + 'name': 'Armenian', + 'bmp': '\u0531-\u0556\u0559-\u0588\u058A\u058D-\u058F\uFB13-\uFB17' + }, + { + 'name': 'Avestan', + 'astral': '\uD802[\uDF00-\uDF35\uDF39-\uDF3F]' + }, + { + 'name': 'Balinese', + 'bmp': '\u1B00-\u1B4B\u1B50-\u1B7C' + }, + { + 'name': 'Bamum', + 'bmp': '\uA6A0-\uA6F7', + 'astral': '\uD81A[\uDC00-\uDE38]' + }, + { + 'name': 'Bassa_Vah', + 'astral': '\uD81A[\uDED0-\uDEED\uDEF0-\uDEF5]' + }, + { + 'name': 'Batak', + 'bmp': '\u1BC0-\u1BF3\u1BFC-\u1BFF' + }, + { + 'name': 'Bengali', + 'bmp': '\u0980-\u0983\u0985-\u098C\u098F\u0990\u0993-\u09A8\u09AA-\u09B0\u09B2\u09B6-\u09B9\u09BC-\u09C4\u09C7\u09C8\u09CB-\u09CE\u09D7\u09DC\u09DD\u09DF-\u09E3\u09E6-\u09FE' + }, + { + 'name': 'Bhaiksuki', + 'astral': '\uD807[\uDC00-\uDC08\uDC0A-\uDC36\uDC38-\uDC45\uDC50-\uDC6C]' + }, + { + 'name': 'Bopomofo', + 'bmp': '\u02EA\u02EB\u3105-\u312F\u31A0-\u31BA' + }, + { + 'name': 'Brahmi', + 'astral': '\uD804[\uDC00-\uDC4D\uDC52-\uDC6F\uDC7F]' + }, + { + 'name': 'Braille', + 'bmp': '\u2800-\u28FF' + }, + { + 'name': 'Buginese', + 'bmp': '\u1A00-\u1A1B\u1A1E\u1A1F' + }, + { + 'name': 'Buhid', + 'bmp': '\u1740-\u1753' + }, + { + 'name': 'Canadian_Aboriginal', + 'bmp': '\u1400-\u167F\u18B0-\u18F5' + }, + { + 'name': 'Carian', + 'astral': '\uD800[\uDEA0-\uDED0]' + }, + { + 'name': 'Caucasian_Albanian', + 'astral': '\uD801[\uDD30-\uDD63\uDD6F]' + }, + { + 'name': 'Chakma', + 'astral': '\uD804[\uDD00-\uDD34\uDD36-\uDD46]' + }, + { + 'name': 'Cham', + 'bmp': '\uAA00-\uAA36\uAA40-\uAA4D\uAA50-\uAA59\uAA5C-\uAA5F' + }, + { + 'name': 'Cherokee', + 'bmp': '\u13A0-\u13F5\u13F8-\u13FD\uAB70-\uABBF' + }, + { + 'name': 'Common', + 'bmp': '\0-@\\[-`\\{-\xA9\xAB-\xB9\xBB-\xBF\xD7\xF7\u02B9-\u02DF\u02E5-\u02E9\u02EC-\u02FF\u0374\u037E\u0385\u0387\u0589\u0605\u060C\u061B\u061F\u0640\u06DD\u08E2\u0964\u0965\u0E3F\u0FD5-\u0FD8\u10FB\u16EB-\u16ED\u1735\u1736\u1802\u1803\u1805\u1CD3\u1CE1\u1CE9-\u1CEC\u1CEE-\u1CF3\u1CF5-\u1CF7\u2000-\u200B\u200E-\u2064\u2066-\u2070\u2074-\u207E\u2080-\u208E\u20A0-\u20BF\u2100-\u2125\u2127-\u2129\u212C-\u2131\u2133-\u214D\u214F-\u215F\u2189-\u218B\u2190-\u2426\u2440-\u244A\u2460-\u27FF\u2900-\u2B73\u2B76-\u2B95\u2B98-\u2BC8\u2BCA-\u2BFE\u2E00-\u2E4E\u2FF0-\u2FFB\u3000-\u3004\u3006\u3008-\u3020\u3030-\u3037\u303C-\u303F\u309B\u309C\u30A0\u30FB\u30FC\u3190-\u319F\u31C0-\u31E3\u3220-\u325F\u327F-\u32CF\u3358-\u33FF\u4DC0-\u4DFF\uA700-\uA721\uA788-\uA78A\uA830-\uA839\uA92E\uA9CF\uAB5B\uFD3E\uFD3F\uFE10-\uFE19\uFE30-\uFE52\uFE54-\uFE66\uFE68-\uFE6B\uFEFF\uFF01-\uFF20\uFF3B-\uFF40\uFF5B-\uFF65\uFF70\uFF9E\uFF9F\uFFE0-\uFFE6\uFFE8-\uFFEE\uFFF9-\uFFFD', + 'astral': '\uD800[\uDD00-\uDD02\uDD07-\uDD33\uDD37-\uDD3F\uDD90-\uDD9B\uDDD0-\uDDFC\uDEE1-\uDEFB]|\uD82F[\uDCA0-\uDCA3]|\uD834[\uDC00-\uDCF5\uDD00-\uDD26\uDD29-\uDD66\uDD6A-\uDD7A\uDD83\uDD84\uDD8C-\uDDA9\uDDAE-\uDDE8\uDEE0-\uDEF3\uDF00-\uDF56\uDF60-\uDF78]|\uD835[\uDC00-\uDC54\uDC56-\uDC9C\uDC9E\uDC9F\uDCA2\uDCA5\uDCA6\uDCA9-\uDCAC\uDCAE-\uDCB9\uDCBB\uDCBD-\uDCC3\uDCC5-\uDD05\uDD07-\uDD0A\uDD0D-\uDD14\uDD16-\uDD1C\uDD1E-\uDD39\uDD3B-\uDD3E\uDD40-\uDD44\uDD46\uDD4A-\uDD50\uDD52-\uDEA5\uDEA8-\uDFCB\uDFCE-\uDFFF]|\uD83B[\uDC71-\uDCB4]|\uD83C[\uDC00-\uDC2B\uDC30-\uDC93\uDCA0-\uDCAE\uDCB1-\uDCBF\uDCC1-\uDCCF\uDCD1-\uDCF5\uDD00-\uDD0C\uDD10-\uDD6B\uDD70-\uDDAC\uDDE6-\uDDFF\uDE01\uDE02\uDE10-\uDE3B\uDE40-\uDE48\uDE50\uDE51\uDE60-\uDE65\uDF00-\uDFFF]|\uD83D[\uDC00-\uDED4\uDEE0-\uDEEC\uDEF0-\uDEF9\uDF00-\uDF73\uDF80-\uDFD8]|\uD83E[\uDC00-\uDC0B\uDC10-\uDC47\uDC50-\uDC59\uDC60-\uDC87\uDC90-\uDCAD\uDD00-\uDD0B\uDD10-\uDD3E\uDD40-\uDD70\uDD73-\uDD76\uDD7A\uDD7C-\uDDA2\uDDB0-\uDDB9\uDDC0-\uDDC2\uDDD0-\uDDFF\uDE60-\uDE6D]|\uDB40[\uDC01\uDC20-\uDC7F]' + }, + { + 'name': 'Coptic', + 'bmp': '\u03E2-\u03EF\u2C80-\u2CF3\u2CF9-\u2CFF' + }, + { + 'name': 'Cuneiform', + 'astral': '\uD808[\uDC00-\uDF99]|\uD809[\uDC00-\uDC6E\uDC70-\uDC74\uDC80-\uDD43]' + }, + { + 'name': 'Cypriot', + 'astral': '\uD802[\uDC00-\uDC05\uDC08\uDC0A-\uDC35\uDC37\uDC38\uDC3C\uDC3F]' + }, + { + 'name': 'Cyrillic', + 'bmp': '\u0400-\u0484\u0487-\u052F\u1C80-\u1C88\u1D2B\u1D78\u2DE0-\u2DFF\uA640-\uA69F\uFE2E\uFE2F' + }, + { + 'name': 'Deseret', + 'astral': '\uD801[\uDC00-\uDC4F]' + }, + { + 'name': 'Devanagari', + 'bmp': '\u0900-\u0950\u0953-\u0963\u0966-\u097F\uA8E0-\uA8FF' + }, + { + 'name': 'Dogra', + 'astral': '\uD806[\uDC00-\uDC3B]' + }, + { + 'name': 'Duployan', + 'astral': '\uD82F[\uDC00-\uDC6A\uDC70-\uDC7C\uDC80-\uDC88\uDC90-\uDC99\uDC9C-\uDC9F]' + }, + { + 'name': 'Egyptian_Hieroglyphs', + 'astral': '\uD80C[\uDC00-\uDFFF]|\uD80D[\uDC00-\uDC2E]' + }, + { + 'name': 'Elbasan', + 'astral': '\uD801[\uDD00-\uDD27]' + }, + { + 'name': 'Ethiopic', + 'bmp': '\u1200-\u1248\u124A-\u124D\u1250-\u1256\u1258\u125A-\u125D\u1260-\u1288\u128A-\u128D\u1290-\u12B0\u12B2-\u12B5\u12B8-\u12BE\u12C0\u12C2-\u12C5\u12C8-\u12D6\u12D8-\u1310\u1312-\u1315\u1318-\u135A\u135D-\u137C\u1380-\u1399\u2D80-\u2D96\u2DA0-\u2DA6\u2DA8-\u2DAE\u2DB0-\u2DB6\u2DB8-\u2DBE\u2DC0-\u2DC6\u2DC8-\u2DCE\u2DD0-\u2DD6\u2DD8-\u2DDE\uAB01-\uAB06\uAB09-\uAB0E\uAB11-\uAB16\uAB20-\uAB26\uAB28-\uAB2E' + }, + { + 'name': 'Georgian', + 'bmp': '\u10A0-\u10C5\u10C7\u10CD\u10D0-\u10FA\u10FC-\u10FF\u1C90-\u1CBA\u1CBD-\u1CBF\u2D00-\u2D25\u2D27\u2D2D' + }, + { + 'name': 'Glagolitic', + 'bmp': '\u2C00-\u2C2E\u2C30-\u2C5E', + 'astral': '\uD838[\uDC00-\uDC06\uDC08-\uDC18\uDC1B-\uDC21\uDC23\uDC24\uDC26-\uDC2A]' + }, + { + 'name': 'Gothic', + 'astral': '\uD800[\uDF30-\uDF4A]' + }, + { + 'name': 'Grantha', + 'astral': '\uD804[\uDF00-\uDF03\uDF05-\uDF0C\uDF0F\uDF10\uDF13-\uDF28\uDF2A-\uDF30\uDF32\uDF33\uDF35-\uDF39\uDF3C-\uDF44\uDF47\uDF48\uDF4B-\uDF4D\uDF50\uDF57\uDF5D-\uDF63\uDF66-\uDF6C\uDF70-\uDF74]' + }, + { + 'name': 'Greek', + 'bmp': '\u0370-\u0373\u0375-\u0377\u037A-\u037D\u037F\u0384\u0386\u0388-\u038A\u038C\u038E-\u03A1\u03A3-\u03E1\u03F0-\u03FF\u1D26-\u1D2A\u1D5D-\u1D61\u1D66-\u1D6A\u1DBF\u1F00-\u1F15\u1F18-\u1F1D\u1F20-\u1F45\u1F48-\u1F4D\u1F50-\u1F57\u1F59\u1F5B\u1F5D\u1F5F-\u1F7D\u1F80-\u1FB4\u1FB6-\u1FC4\u1FC6-\u1FD3\u1FD6-\u1FDB\u1FDD-\u1FEF\u1FF2-\u1FF4\u1FF6-\u1FFE\u2126\uAB65', + 'astral': '\uD800[\uDD40-\uDD8E\uDDA0]|\uD834[\uDE00-\uDE45]' + }, + { + 'name': 'Gujarati', + 'bmp': '\u0A81-\u0A83\u0A85-\u0A8D\u0A8F-\u0A91\u0A93-\u0AA8\u0AAA-\u0AB0\u0AB2\u0AB3\u0AB5-\u0AB9\u0ABC-\u0AC5\u0AC7-\u0AC9\u0ACB-\u0ACD\u0AD0\u0AE0-\u0AE3\u0AE6-\u0AF1\u0AF9-\u0AFF' + }, + { + 'name': 'Gunjala_Gondi', + 'astral': '\uD807[\uDD60-\uDD65\uDD67\uDD68\uDD6A-\uDD8E\uDD90\uDD91\uDD93-\uDD98\uDDA0-\uDDA9]' + }, + { + 'name': 'Gurmukhi', + 'bmp': '\u0A01-\u0A03\u0A05-\u0A0A\u0A0F\u0A10\u0A13-\u0A28\u0A2A-\u0A30\u0A32\u0A33\u0A35\u0A36\u0A38\u0A39\u0A3C\u0A3E-\u0A42\u0A47\u0A48\u0A4B-\u0A4D\u0A51\u0A59-\u0A5C\u0A5E\u0A66-\u0A76' + }, + { + 'name': 'Han', + 'bmp': '\u2E80-\u2E99\u2E9B-\u2EF3\u2F00-\u2FD5\u3005\u3007\u3021-\u3029\u3038-\u303B\u3400-\u4DB5\u4E00-\u9FEF\uF900-\uFA6D\uFA70-\uFAD9', + 'astral': '[\uD840-\uD868\uD86A-\uD86C\uD86F-\uD872\uD874-\uD879][\uDC00-\uDFFF]|\uD869[\uDC00-\uDED6\uDF00-\uDFFF]|\uD86D[\uDC00-\uDF34\uDF40-\uDFFF]|\uD86E[\uDC00-\uDC1D\uDC20-\uDFFF]|\uD873[\uDC00-\uDEA1\uDEB0-\uDFFF]|\uD87A[\uDC00-\uDFE0]|\uD87E[\uDC00-\uDE1D]' + }, + { + 'name': 'Hangul', + 'bmp': '\u1100-\u11FF\u302E\u302F\u3131-\u318E\u3200-\u321E\u3260-\u327E\uA960-\uA97C\uAC00-\uD7A3\uD7B0-\uD7C6\uD7CB-\uD7FB\uFFA0-\uFFBE\uFFC2-\uFFC7\uFFCA-\uFFCF\uFFD2-\uFFD7\uFFDA-\uFFDC' + }, + { + 'name': 'Hanifi_Rohingya', + 'astral': '\uD803[\uDD00-\uDD27\uDD30-\uDD39]' + }, + { + 'name': 'Hanunoo', + 'bmp': '\u1720-\u1734' + }, + { + 'name': 'Hatran', + 'astral': '\uD802[\uDCE0-\uDCF2\uDCF4\uDCF5\uDCFB-\uDCFF]' + }, + { + 'name': 'Hebrew', + 'bmp': '\u0591-\u05C7\u05D0-\u05EA\u05EF-\u05F4\uFB1D-\uFB36\uFB38-\uFB3C\uFB3E\uFB40\uFB41\uFB43\uFB44\uFB46-\uFB4F' + }, + { + 'name': 'Hiragana', + 'bmp': '\u3041-\u3096\u309D-\u309F', + 'astral': '\uD82C[\uDC01-\uDD1E]|\uD83C\uDE00' + }, + { + 'name': 'Imperial_Aramaic', + 'astral': '\uD802[\uDC40-\uDC55\uDC57-\uDC5F]' + }, + { + 'name': 'Inherited', + 'bmp': '\u0300-\u036F\u0485\u0486\u064B-\u0655\u0670\u0951\u0952\u1AB0-\u1ABE\u1CD0-\u1CD2\u1CD4-\u1CE0\u1CE2-\u1CE8\u1CED\u1CF4\u1CF8\u1CF9\u1DC0-\u1DF9\u1DFB-\u1DFF\u200C\u200D\u20D0-\u20F0\u302A-\u302D\u3099\u309A\uFE00-\uFE0F\uFE20-\uFE2D', + 'astral': '\uD800[\uDDFD\uDEE0]|\uD804\uDF3B|\uD834[\uDD67-\uDD69\uDD7B-\uDD82\uDD85-\uDD8B\uDDAA-\uDDAD]|\uDB40[\uDD00-\uDDEF]' + }, + { + 'name': 'Inscriptional_Pahlavi', + 'astral': '\uD802[\uDF60-\uDF72\uDF78-\uDF7F]' + }, + { + 'name': 'Inscriptional_Parthian', + 'astral': '\uD802[\uDF40-\uDF55\uDF58-\uDF5F]' + }, + { + 'name': 'Javanese', + 'bmp': '\uA980-\uA9CD\uA9D0-\uA9D9\uA9DE\uA9DF' + }, + { + 'name': 'Kaithi', + 'astral': '\uD804[\uDC80-\uDCC1\uDCCD]' + }, + { + 'name': 'Kannada', + 'bmp': '\u0C80-\u0C8C\u0C8E-\u0C90\u0C92-\u0CA8\u0CAA-\u0CB3\u0CB5-\u0CB9\u0CBC-\u0CC4\u0CC6-\u0CC8\u0CCA-\u0CCD\u0CD5\u0CD6\u0CDE\u0CE0-\u0CE3\u0CE6-\u0CEF\u0CF1\u0CF2' + }, + { + 'name': 'Katakana', + 'bmp': '\u30A1-\u30FA\u30FD-\u30FF\u31F0-\u31FF\u32D0-\u32FE\u3300-\u3357\uFF66-\uFF6F\uFF71-\uFF9D', + 'astral': '\uD82C\uDC00' + }, + { + 'name': 'Kayah_Li', + 'bmp': '\uA900-\uA92D\uA92F' + }, + { + 'name': 'Kharoshthi', + 'astral': '\uD802[\uDE00-\uDE03\uDE05\uDE06\uDE0C-\uDE13\uDE15-\uDE17\uDE19-\uDE35\uDE38-\uDE3A\uDE3F-\uDE48\uDE50-\uDE58]' + }, + { + 'name': 'Khmer', + 'bmp': '\u1780-\u17DD\u17E0-\u17E9\u17F0-\u17F9\u19E0-\u19FF' + }, + { + 'name': 'Khojki', + 'astral': '\uD804[\uDE00-\uDE11\uDE13-\uDE3E]' + }, + { + 'name': 'Khudawadi', + 'astral': '\uD804[\uDEB0-\uDEEA\uDEF0-\uDEF9]' + }, + { + 'name': 'Lao', + 'bmp': '\u0E81\u0E82\u0E84\u0E87\u0E88\u0E8A\u0E8D\u0E94-\u0E97\u0E99-\u0E9F\u0EA1-\u0EA3\u0EA5\u0EA7\u0EAA\u0EAB\u0EAD-\u0EB9\u0EBB-\u0EBD\u0EC0-\u0EC4\u0EC6\u0EC8-\u0ECD\u0ED0-\u0ED9\u0EDC-\u0EDF' + }, + { + 'name': 'Latin', + 'bmp': 'A-Za-z\xAA\xBA\xC0-\xD6\xD8-\xF6\xF8-\u02B8\u02E0-\u02E4\u1D00-\u1D25\u1D2C-\u1D5C\u1D62-\u1D65\u1D6B-\u1D77\u1D79-\u1DBE\u1E00-\u1EFF\u2071\u207F\u2090-\u209C\u212A\u212B\u2132\u214E\u2160-\u2188\u2C60-\u2C7F\uA722-\uA787\uA78B-\uA7B9\uA7F7-\uA7FF\uAB30-\uAB5A\uAB5C-\uAB64\uFB00-\uFB06\uFF21-\uFF3A\uFF41-\uFF5A' + }, + { + 'name': 'Lepcha', + 'bmp': '\u1C00-\u1C37\u1C3B-\u1C49\u1C4D-\u1C4F' + }, + { + 'name': 'Limbu', + 'bmp': '\u1900-\u191E\u1920-\u192B\u1930-\u193B\u1940\u1944-\u194F' + }, + { + 'name': 'Linear_A', + 'astral': '\uD801[\uDE00-\uDF36\uDF40-\uDF55\uDF60-\uDF67]' + }, + { + 'name': 'Linear_B', + 'astral': '\uD800[\uDC00-\uDC0B\uDC0D-\uDC26\uDC28-\uDC3A\uDC3C\uDC3D\uDC3F-\uDC4D\uDC50-\uDC5D\uDC80-\uDCFA]' + }, + { + 'name': 'Lisu', + 'bmp': '\uA4D0-\uA4FF' + }, + { + 'name': 'Lycian', + 'astral': '\uD800[\uDE80-\uDE9C]' + }, + { + 'name': 'Lydian', + 'astral': '\uD802[\uDD20-\uDD39\uDD3F]' + }, + { + 'name': 'Mahajani', + 'astral': '\uD804[\uDD50-\uDD76]' + }, + { + 'name': 'Makasar', + 'astral': '\uD807[\uDEE0-\uDEF8]' + }, + { + 'name': 'Malayalam', + 'bmp': '\u0D00-\u0D03\u0D05-\u0D0C\u0D0E-\u0D10\u0D12-\u0D44\u0D46-\u0D48\u0D4A-\u0D4F\u0D54-\u0D63\u0D66-\u0D7F' + }, + { + 'name': 'Mandaic', + 'bmp': '\u0840-\u085B\u085E' + }, + { + 'name': 'Manichaean', + 'astral': '\uD802[\uDEC0-\uDEE6\uDEEB-\uDEF6]' + }, + { + 'name': 'Marchen', + 'astral': '\uD807[\uDC70-\uDC8F\uDC92-\uDCA7\uDCA9-\uDCB6]' + }, + { + 'name': 'Masaram_Gondi', + 'astral': '\uD807[\uDD00-\uDD06\uDD08\uDD09\uDD0B-\uDD36\uDD3A\uDD3C\uDD3D\uDD3F-\uDD47\uDD50-\uDD59]' + }, + { + 'name': 'Medefaidrin', + 'astral': '\uD81B[\uDE40-\uDE9A]' + }, + { + 'name': 'Meetei_Mayek', + 'bmp': '\uAAE0-\uAAF6\uABC0-\uABED\uABF0-\uABF9' + }, + { + 'name': 'Mende_Kikakui', + 'astral': '\uD83A[\uDC00-\uDCC4\uDCC7-\uDCD6]' + }, + { + 'name': 'Meroitic_Cursive', + 'astral': '\uD802[\uDDA0-\uDDB7\uDDBC-\uDDCF\uDDD2-\uDDFF]' + }, + { + 'name': 'Meroitic_Hieroglyphs', + 'astral': '\uD802[\uDD80-\uDD9F]' + }, + { + 'name': 'Miao', + 'astral': '\uD81B[\uDF00-\uDF44\uDF50-\uDF7E\uDF8F-\uDF9F]' + }, + { + 'name': 'Modi', + 'astral': '\uD805[\uDE00-\uDE44\uDE50-\uDE59]' + }, + { + 'name': 'Mongolian', + 'bmp': '\u1800\u1801\u1804\u1806-\u180E\u1810-\u1819\u1820-\u1878\u1880-\u18AA', + 'astral': '\uD805[\uDE60-\uDE6C]' + }, + { + 'name': 'Mro', + 'astral': '\uD81A[\uDE40-\uDE5E\uDE60-\uDE69\uDE6E\uDE6F]' + }, + { + 'name': 'Multani', + 'astral': '\uD804[\uDE80-\uDE86\uDE88\uDE8A-\uDE8D\uDE8F-\uDE9D\uDE9F-\uDEA9]' + }, + { + 'name': 'Myanmar', + 'bmp': '\u1000-\u109F\uA9E0-\uA9FE\uAA60-\uAA7F' + }, + { + 'name': 'Nabataean', + 'astral': '\uD802[\uDC80-\uDC9E\uDCA7-\uDCAF]' + }, + { + 'name': 'New_Tai_Lue', + 'bmp': '\u1980-\u19AB\u19B0-\u19C9\u19D0-\u19DA\u19DE\u19DF' + }, + { + 'name': 'Newa', + 'astral': '\uD805[\uDC00-\uDC59\uDC5B\uDC5D\uDC5E]' + }, + { + 'name': 'Nko', + 'bmp': '\u07C0-\u07FA\u07FD-\u07FF' + }, + { + 'name': 'Nushu', + 'astral': '\uD81B\uDFE1|\uD82C[\uDD70-\uDEFB]' + }, + { + 'name': 'Ogham', + 'bmp': '\u1680-\u169C' + }, + { + 'name': 'Ol_Chiki', + 'bmp': '\u1C50-\u1C7F' + }, + { + 'name': 'Old_Hungarian', + 'astral': '\uD803[\uDC80-\uDCB2\uDCC0-\uDCF2\uDCFA-\uDCFF]' + }, + { + 'name': 'Old_Italic', + 'astral': '\uD800[\uDF00-\uDF23\uDF2D-\uDF2F]' + }, + { + 'name': 'Old_North_Arabian', + 'astral': '\uD802[\uDE80-\uDE9F]' + }, + { + 'name': 'Old_Permic', + 'astral': '\uD800[\uDF50-\uDF7A]' + }, + { + 'name': 'Old_Persian', + 'astral': '\uD800[\uDFA0-\uDFC3\uDFC8-\uDFD5]' + }, + { + 'name': 'Old_Sogdian', + 'astral': '\uD803[\uDF00-\uDF27]' + }, + { + 'name': 'Old_South_Arabian', + 'astral': '\uD802[\uDE60-\uDE7F]' + }, + { + 'name': 'Old_Turkic', + 'astral': '\uD803[\uDC00-\uDC48]' + }, + { + 'name': 'Oriya', + 'bmp': '\u0B01-\u0B03\u0B05-\u0B0C\u0B0F\u0B10\u0B13-\u0B28\u0B2A-\u0B30\u0B32\u0B33\u0B35-\u0B39\u0B3C-\u0B44\u0B47\u0B48\u0B4B-\u0B4D\u0B56\u0B57\u0B5C\u0B5D\u0B5F-\u0B63\u0B66-\u0B77' + }, + { + 'name': 'Osage', + 'astral': '\uD801[\uDCB0-\uDCD3\uDCD8-\uDCFB]' + }, + { + 'name': 'Osmanya', + 'astral': '\uD801[\uDC80-\uDC9D\uDCA0-\uDCA9]' + }, + { + 'name': 'Pahawh_Hmong', + 'astral': '\uD81A[\uDF00-\uDF45\uDF50-\uDF59\uDF5B-\uDF61\uDF63-\uDF77\uDF7D-\uDF8F]' + }, + { + 'name': 'Palmyrene', + 'astral': '\uD802[\uDC60-\uDC7F]' + }, + { + 'name': 'Pau_Cin_Hau', + 'astral': '\uD806[\uDEC0-\uDEF8]' + }, + { + 'name': 'Phags_Pa', + 'bmp': '\uA840-\uA877' + }, + { + 'name': 'Phoenician', + 'astral': '\uD802[\uDD00-\uDD1B\uDD1F]' + }, + { + 'name': 'Psalter_Pahlavi', + 'astral': '\uD802[\uDF80-\uDF91\uDF99-\uDF9C\uDFA9-\uDFAF]' + }, + { + 'name': 'Rejang', + 'bmp': '\uA930-\uA953\uA95F' + }, + { + 'name': 'Runic', + 'bmp': '\u16A0-\u16EA\u16EE-\u16F8' + }, + { + 'name': 'Samaritan', + 'bmp': '\u0800-\u082D\u0830-\u083E' + }, + { + 'name': 'Saurashtra', + 'bmp': '\uA880-\uA8C5\uA8CE-\uA8D9' + }, + { + 'name': 'Sharada', + 'astral': '\uD804[\uDD80-\uDDCD\uDDD0-\uDDDF]' + }, + { + 'name': 'Shavian', + 'astral': '\uD801[\uDC50-\uDC7F]' + }, + { + 'name': 'Siddham', + 'astral': '\uD805[\uDD80-\uDDB5\uDDB8-\uDDDD]' + }, + { + 'name': 'SignWriting', + 'astral': '\uD836[\uDC00-\uDE8B\uDE9B-\uDE9F\uDEA1-\uDEAF]' + }, + { + 'name': 'Sinhala', + 'bmp': '\u0D82\u0D83\u0D85-\u0D96\u0D9A-\u0DB1\u0DB3-\u0DBB\u0DBD\u0DC0-\u0DC6\u0DCA\u0DCF-\u0DD4\u0DD6\u0DD8-\u0DDF\u0DE6-\u0DEF\u0DF2-\u0DF4', + 'astral': '\uD804[\uDDE1-\uDDF4]' + }, + { + 'name': 'Sogdian', + 'astral': '\uD803[\uDF30-\uDF59]' + }, + { + 'name': 'Sora_Sompeng', + 'astral': '\uD804[\uDCD0-\uDCE8\uDCF0-\uDCF9]' + }, + { + 'name': 'Soyombo', + 'astral': '\uD806[\uDE50-\uDE83\uDE86-\uDEA2]' + }, + { + 'name': 'Sundanese', + 'bmp': '\u1B80-\u1BBF\u1CC0-\u1CC7' + }, + { + 'name': 'Syloti_Nagri', + 'bmp': '\uA800-\uA82B' + }, + { + 'name': 'Syriac', + 'bmp': '\u0700-\u070D\u070F-\u074A\u074D-\u074F\u0860-\u086A' + }, + { + 'name': 'Tagalog', + 'bmp': '\u1700-\u170C\u170E-\u1714' + }, + { + 'name': 'Tagbanwa', + 'bmp': '\u1760-\u176C\u176E-\u1770\u1772\u1773' + }, + { + 'name': 'Tai_Le', + 'bmp': '\u1950-\u196D\u1970-\u1974' + }, + { + 'name': 'Tai_Tham', + 'bmp': '\u1A20-\u1A5E\u1A60-\u1A7C\u1A7F-\u1A89\u1A90-\u1A99\u1AA0-\u1AAD' + }, + { + 'name': 'Tai_Viet', + 'bmp': '\uAA80-\uAAC2\uAADB-\uAADF' + }, + { + 'name': 'Takri', + 'astral': '\uD805[\uDE80-\uDEB7\uDEC0-\uDEC9]' + }, + { + 'name': 'Tamil', + 'bmp': '\u0B82\u0B83\u0B85-\u0B8A\u0B8E-\u0B90\u0B92-\u0B95\u0B99\u0B9A\u0B9C\u0B9E\u0B9F\u0BA3\u0BA4\u0BA8-\u0BAA\u0BAE-\u0BB9\u0BBE-\u0BC2\u0BC6-\u0BC8\u0BCA-\u0BCD\u0BD0\u0BD7\u0BE6-\u0BFA' + }, + { + 'name': 'Tangut', + 'astral': '\uD81B\uDFE0|[\uD81C-\uD820][\uDC00-\uDFFF]|\uD821[\uDC00-\uDFF1]|\uD822[\uDC00-\uDEF2]' + }, + { + 'name': 'Telugu', + 'bmp': '\u0C00-\u0C0C\u0C0E-\u0C10\u0C12-\u0C28\u0C2A-\u0C39\u0C3D-\u0C44\u0C46-\u0C48\u0C4A-\u0C4D\u0C55\u0C56\u0C58-\u0C5A\u0C60-\u0C63\u0C66-\u0C6F\u0C78-\u0C7F' + }, + { + 'name': 'Thaana', + 'bmp': '\u0780-\u07B1' + }, + { + 'name': 'Thai', + 'bmp': '\u0E01-\u0E3A\u0E40-\u0E5B' + }, + { + 'name': 'Tibetan', + 'bmp': '\u0F00-\u0F47\u0F49-\u0F6C\u0F71-\u0F97\u0F99-\u0FBC\u0FBE-\u0FCC\u0FCE-\u0FD4\u0FD9\u0FDA' + }, + { + 'name': 'Tifinagh', + 'bmp': '\u2D30-\u2D67\u2D6F\u2D70\u2D7F' + }, + { + 'name': 'Tirhuta', + 'astral': '\uD805[\uDC80-\uDCC7\uDCD0-\uDCD9]' + }, + { + 'name': 'Ugaritic', + 'astral': '\uD800[\uDF80-\uDF9D\uDF9F]' + }, + { + 'name': 'Vai', + 'bmp': '\uA500-\uA62B' + }, + { + 'name': 'Warang_Citi', + 'astral': '\uD806[\uDCA0-\uDCF2\uDCFF]' + }, + { + 'name': 'Yi', + 'bmp': '\uA000-\uA48C\uA490-\uA4C6' + }, + { + 'name': 'Zanabazar_Square', + 'astral': '\uD806[\uDE00-\uDE47]' + } +]; + +var unicodeScripts = createCommonjsModule(function (module, exports) { +"use strict"; + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.default = void 0; + +var _scripts = _interopRequireDefault(scripts); + +function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } + +/*! + * XRegExp Unicode Scripts 4.2.0 + * + * Steven Levithan (c) 2010-present MIT License + * Unicode data by Mathias Bynens + */ +var _default = function _default(XRegExp) { + /** + * Adds support for all Unicode scripts. E.g., `\p{Latin}`. Token names are case insensitive, + * and any spaces, hyphens, and underscores are ignored. + * + * Uses Unicode 11.0.0. + * + * @requires XRegExp, Unicode Base + */ + if (!XRegExp.addUnicodeData) { + throw new ReferenceError('Unicode Base must be loaded before Unicode Scripts'); + } + + XRegExp.addUnicodeData(_scripts.default); +}; + +exports.default = _default; +module.exports = exports["default"]; +}); + +unwrapExports(unicodeScripts); + +var lib = createCommonjsModule(function (module, exports) { +"use strict"; + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.default = void 0; + +var _xregexp = _interopRequireDefault(xregexp); + +var _build = _interopRequireDefault(build); + +var _matchrecursive = _interopRequireDefault(matchrecursive); + +var _unicodeBase = _interopRequireDefault(unicodeBase); + +var _unicodeBlocks = _interopRequireDefault(unicodeBlocks); + +var _unicodeCategories = _interopRequireDefault(unicodeCategories); + +var _unicodeProperties = _interopRequireDefault(unicodeProperties); + +var _unicodeScripts = _interopRequireDefault(unicodeScripts); + +function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } + +(_build.default)(_xregexp.default); +(_matchrecursive.default)(_xregexp.default); +(_unicodeBase.default)(_xregexp.default); +(_unicodeBlocks.default)(_xregexp.default); +(_unicodeCategories.default)(_xregexp.default); +(_unicodeProperties.default)(_xregexp.default); +(_unicodeScripts.default)(_xregexp.default); +var _default = _xregexp.default; +exports.default = _default; +module.exports = exports["default"]; +}); + +unwrapExports(lib); + +var utilities = createCommonjsModule(function (module, exports) { +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); + +class FormatUtility { + static preProcess(query, toLower = true) { + if (toLower) { + query = query.toLowerCase(); + } + return query + .replace(/0/g, "0") + .replace(/1/g, "1") + .replace(/2/g, "2") + .replace(/3/g, "3") + .replace(/4/g, "4") + .replace(/5/g, "5") + .replace(/6/g, "6") + .replace(/7/g, "7") + .replace(/8/g, "8") + .replace(/9/g, "9") + .replace(/:/g, ":") + .replace(/-/g, "-") + .replace(/,/g, ",") + .replace(///g, "/") + .replace(/G/g, "G") + .replace(/M/g, "M") + .replace(/T/g, "T") + .replace(/K/g, "K") + .replace(/k/g, "k") + .replace(/./g, ".") + .replace(/(/g, "(") + .replace(/)/g, ")"); + } +} +exports.FormatUtility = FormatUtility; +class Match { + constructor(index, length, value, groups) { + this.index = index; + this.length = length; + this.value = value; + this.innerGroups = groups; + } + groups(key) { + return this.innerGroups[key] ? this.innerGroups[key] : { value: '', index: 0, length: 0, captures: [] }; + } +} +exports.Match = Match; +class RegExpUtility { + static getMatches(regex, source) { + if (!regex) + return []; + let rawRegex = regex.xregexp.source; + if (!rawRegex.includes('(?= 0) { + closePos = this.getClosePos(rawRegex, startPos); + let nlbRegex = lib(rawRegex.substring(startPos, closePos + 1), flags); + let nextRegex = RegExpUtility.getNextRegex(rawRegex, startPos); + nlbRegex.nextRegex = nextRegex ? lib(nextRegex, flags) : null; + negativeLookbehindRegexes.push(nlbRegex); + rawRegex = rawRegex.substr(0, startPos) + rawRegex.substr(closePos + 1); + startPos = rawRegex.indexOf('(? { + let clean = true; + negativeLookbehindRegexes.forEach(regex => { + let negativeLookbehindMatches = RegExpUtility.getMatchesSimple(regex, source); + negativeLookbehindMatches.forEach(negativeLookbehindMatch => { + let negativeLookbehindEnd = negativeLookbehindMatch.index + negativeLookbehindMatch.length; + let nextRegex = regex.nextRegex; + if (match.index === negativeLookbehindEnd) { + if (!nextRegex) { + clean = false; + return; + } + else { + let nextMatch = RegExpUtility.getFirstMatchIndex(nextRegex, source.substring(negativeLookbehindMatch.index)); + if (nextMatch.matched && ((nextMatch.index === negativeLookbehindMatch.length) || (source.includes(nextMatch.value + match.value)))) { + clean = false; + return; + } + } + } + if (negativeLookbehindMatch.value.includes(match.value)) { + let preMatches = RegExpUtility.getMatchesSimple(regex, source.substring(0, match.index)); + preMatches.forEach(preMatch => { + if (source.includes(preMatch.value + match.value)) { + clean = false; + return; + } + }); + } + }); + if (!clean) { + return; + } + }); + if (clean) { + realMatches.push(match); + } + }); + return realMatches; + } + static getMatchesSimple(regex, source) { + // Word boundary (\b) in JS is not unicode-aware, so words starting/ending with accentuated characters will not match + // use a normalized string to match, the return matches' values using the original one + // http://blog.stevenlevithan.com/archives/javascript-regex-and-unicode + // https://stackoverflow.com/questions/2881445/utf-8-word-boundary-regex-in-javascript + let normalized = StringUtility.removeDiacriticsFromWordBoundaries(source); + let matches = new Array(); + lib.forEach(normalized, regex, match => { + let positiveLookbehinds = []; + let groups = {}; + let lastGroup = ''; + Object.keys(match).forEach(key => { + if (!key.includes('__')) + return; + if (key.startsWith('plb') && match[key]) { + if (match[0].indexOf(match[key]) !== 0 && !StringUtility.isNullOrEmpty(lastGroup)) { + let index = match.index + match[0].indexOf(match[key]); + let length = match[key].length; + let value = source.substr(index, length); + groups[lastGroup].value = groups[lastGroup].value + value; + } + positiveLookbehinds.push({ key: key, value: match[key] }); + return; + } + if (key.startsWith('nlb')) { + return; + } + let groupKey = key.substr(0, key.lastIndexOf('__')); + lastGroup = groupKey; + if (!groups[groupKey]) + groups[groupKey] = { value: '', index: 0, length: 0, captures: [] }; + if (match[key]) { + let index = match.index + match[0].indexOf(match[key]); + let length = match[key].length; + let value = source.substr(index, length); + groups[groupKey].index = index; + groups[groupKey].length = length; + groups[groupKey].value = value; + groups[groupKey].captures.push(value); + } + }); + let value = match[0]; + let index = match.index; + let length = value.length; + if (positiveLookbehinds && positiveLookbehinds.length > 0 && value.indexOf(positiveLookbehinds[0].value) === 0) { + value = source.substr(index, length).substr(positiveLookbehinds[0].value.length); + index += positiveLookbehinds[0].value.length; + length -= positiveLookbehinds[0].value.length; + } + else { + value = source.substr(index, length); + } + matches.push(new Match(index, length, value, groups)); + }); + return matches; + } + static getSafeRegExp(source, flags) { + let sanitizedSource = this.sanitizeGroups(source); + return lib(sanitizedSource, flags || 'gis'); + } + static getFirstMatchIndex(regex, source) { + let matches = RegExpUtility.getMatches(regex, source); + if (matches.length) { + return { + matched: true, + index: matches[0].index, + value: matches[0].value + }; + } + return { matched: false, index: -1, value: null }; + } + static split(regex, source) { + return lib.split(source, regex); + } + static isMatch(regex, source) { + return !StringUtility.isNullOrEmpty(source) + && this.getMatches(regex, source).length > 0; + } + static sanitizeGroups(source) { + let index = 0; + let result = lib.replace(source, this.matchGroup, (match, name) => match.replace(name, `${name}__${index++}`)); + index = 0; + result = lib.replace(result, this.matchPositiveLookbehind, () => `(?`); + index = 0; + result = lib.replace(result, this.matchNegativeLookbehind, () => `(?`); + return result; + } + static getNextRegex(source, startPos) { + startPos = RegExpUtility.getClosePos(source, startPos) + 1; + let closePos = RegExpUtility.getClosePos(source, startPos); + if (source[startPos] !== '(') { + closePos--; + } + let next = (startPos === closePos) + ? null + : source.substring(startPos, closePos + 1); + return next; + } + static getClosePos(source, startPos) { + let counter = 1; + let closePos = startPos; + while (counter > 0 && closePos < source.length) { + let c = source[++closePos]; + if (c === '(') + counter++; + else if (c === ')') + counter--; + } + return closePos; + } +} +RegExpUtility.matchGroup = lib(String.raw `\?<(?\w+)>`, 'gis'); +RegExpUtility.matchPositiveLookbehind = lib(String.raw `\(\?<=`, 'gis'); +RegExpUtility.matchNegativeLookbehind = lib(String.raw `\(\? { + let length = s.length; + if (length === 0) + return s; + let first = StringUtility.removeDiacritics(s.substring(0, 1)); + if (length === 1) + return first; + let last = length > 1 ? StringUtility.removeDiacritics(s.substring(length - 1)) : ''; + let mid = s.substring(1, length - 1); + // console.log(first + mid + last) + return first + mid + last; + }) + .join(' '); + } + static removeDiacritics(c) { + let clean = StringUtility.diacriticsRemovalMap[c]; + return !clean ? c : clean; + } +} +StringUtility.diacriticsRemovalMap = { + "Ⓐ": "A", + "A": "A", + "À": "A", + "Á": "A", + "Â": "A", + "Ầ": "A", + "Ấ": "A", + "Ẫ": "A", + "Ẩ": "A", + "Ã": "A", + "Ā": "A", + "Ă": "A", + "Ằ": "A", + "Ắ": "A", + "Ẵ": "A", + "Ẳ": "A", + "Ȧ": "A", + "Ǡ": "A", + "Ä": "A", + "Ǟ": "A", + "Ả": "A", + "Å": "A", + "Ǻ": "A", + "Ǎ": "A", + "Ȁ": "A", + "Ȃ": "A", + "Ạ": "A", + "Ậ": "A", + "Ặ": "A", + "Ḁ": "A", + "Ą": "A", + "Ⱥ": "A", + "Ɐ": "A", + "Ⓑ": "B", + "B": "B", + "Ḃ": "B", + "Ḅ": "B", + "Ḇ": "B", + "Ƀ": "B", + "Ƃ": "B", + "Ɓ": "B", + "Ⓒ": "C", + "C": "C", + "Ć": "C", + "Ĉ": "C", + "Ċ": "C", + "Č": "C", + "Ç": "C", + "Ḉ": "C", + "Ƈ": "C", + "Ȼ": "C", + "Ꜿ": "C", + "Ⓓ": "D", + "D": "D", + "Ḋ": "D", + "Ď": "D", + "Ḍ": "D", + "Ḑ": "D", + "Ḓ": "D", + "Ḏ": "D", + "Đ": "D", + "Ƌ": "D", + "Ɗ": "D", + "Ɖ": "D", + "Ꝺ": "D", + "Ⓔ": "E", + "E": "E", + "È": "E", + "É": "E", + "Ê": "E", + "Ề": "E", + "Ế": "E", + "Ễ": "E", + "Ể": "E", + "Ẽ": "E", + "Ē": "E", + "Ḕ": "E", + "Ḗ": "E", + "Ĕ": "E", + "Ė": "E", + "Ë": "E", + "Ẻ": "E", + "Ě": "E", + "Ȅ": "E", + "Ȇ": "E", + "Ẹ": "E", + "Ệ": "E", + "Ȩ": "E", + "Ḝ": "E", + "Ę": "E", + "Ḙ": "E", + "Ḛ": "E", + "Ɛ": "E", + "Ǝ": "E", + "Ⓕ": "F", + "F": "F", + "Ḟ": "F", + "Ƒ": "F", + "Ꝼ": "F", + "Ⓖ": "G", + "G": "G", + "Ǵ": "G", + "Ĝ": "G", + "Ḡ": "G", + "Ğ": "G", + "Ġ": "G", + "Ǧ": "G", + "Ģ": "G", + "Ǥ": "G", + "Ɠ": "G", + "Ꞡ": "G", + "Ᵹ": "G", + "Ꝿ": "G", + "Ⓗ": "H", + "H": "H", + "Ĥ": "H", + "Ḣ": "H", + "Ḧ": "H", + "Ȟ": "H", + "Ḥ": "H", + "Ḩ": "H", + "Ḫ": "H", + "Ħ": "H", + "Ⱨ": "H", + "Ⱶ": "H", + "Ɥ": "H", + "Ⓘ": "I", + "I": "I", + "Ì": "I", + "Í": "I", + "Î": "I", + "Ĩ": "I", + "Ī": "I", + "Ĭ": "I", + "İ": "I", + "Ï": "I", + "Ḯ": "I", + "Ỉ": "I", + "Ǐ": "I", + "Ȉ": "I", + "Ȋ": "I", + "Ị": "I", + "Į": "I", + "Ḭ": "I", + "Ɨ": "I", + "Ⓙ": "J", + "J": "J", + "Ĵ": "J", + "Ɉ": "J", + "Ⓚ": "K", + "K": "K", + "Ḱ": "K", + "Ǩ": "K", + "Ḳ": "K", + "Ķ": "K", + "Ḵ": "K", + "Ƙ": "K", + "Ⱪ": "K", + "Ꝁ": "K", + "Ꝃ": "K", + "Ꝅ": "K", + "Ꞣ": "K", + "Ⓛ": "L", + "L": "L", + "Ŀ": "L", + "Ĺ": "L", + "Ľ": "L", + "Ḷ": "L", + "Ḹ": "L", + "Ļ": "L", + "Ḽ": "L", + "Ḻ": "L", + "Ł": "L", + "Ƚ": "L", + "Ɫ": "L", + "Ⱡ": "L", + "Ꝉ": "L", + "Ꝇ": "L", + "Ꞁ": "L", + "Ⓜ": "M", + "M": "M", + "Ḿ": "M", + "Ṁ": "M", + "Ṃ": "M", + "Ɱ": "M", + "Ɯ": "M", + "Ⓝ": "N", + "N": "N", + "Ǹ": "N", + "Ń": "N", + "Ñ": "N", + "Ṅ": "N", + "Ň": "N", + "Ṇ": "N", + "Ņ": "N", + "Ṋ": "N", + "Ṉ": "N", + "Ƞ": "N", + "Ɲ": "N", + "Ꞑ": "N", + "Ꞥ": "N", + "Ⓞ": "O", + "O": "O", + "Ò": "O", + "Ó": "O", + "Ô": "O", + "Ồ": "O", + "Ố": "O", + "Ỗ": "O", + "Ổ": "O", + "Õ": "O", + "Ṍ": "O", + "Ȭ": "O", + "Ṏ": "O", + "Ō": "O", + "Ṑ": "O", + "Ṓ": "O", + "Ŏ": "O", + "Ȯ": "O", + "Ȱ": "O", + "Ö": "O", + "Ȫ": "O", + "Ỏ": "O", + "Ő": "O", + "Ǒ": "O", + "Ȍ": "O", + "Ȏ": "O", + "Ơ": "O", + "Ờ": "O", + "Ớ": "O", + "Ỡ": "O", + "Ở": "O", + "Ợ": "O", + "Ọ": "O", + "Ộ": "O", + "Ǫ": "O", + "Ǭ": "O", + "Ø": "O", + "Ǿ": "O", + "Ɔ": "O", + "Ɵ": "O", + "Ꝋ": "O", + "Ꝍ": "O", + "Ⓟ": "P", + "P": "P", + "Ṕ": "P", + "Ṗ": "P", + "Ƥ": "P", + "Ᵽ": "P", + "Ꝑ": "P", + "Ꝓ": "P", + "Ꝕ": "P", + "Ⓠ": "Q", + "Q": "Q", + "Ꝗ": "Q", + "Ꝙ": "Q", + "Ɋ": "Q", + "Ⓡ": "R", + "R": "R", + "Ŕ": "R", + "Ṙ": "R", + "Ř": "R", + "Ȑ": "R", + "Ȓ": "R", + "Ṛ": "R", + "Ṝ": "R", + "Ŗ": "R", + "Ṟ": "R", + "Ɍ": "R", + "Ɽ": "R", + "Ꝛ": "R", + "Ꞧ": "R", + "Ꞃ": "R", + "Ⓢ": "S", + "S": "S", + "ẞ": "S", + "Ś": "S", + "Ṥ": "S", + "Ŝ": "S", + "Ṡ": "S", + "Š": "S", + "Ṧ": "S", + "Ṣ": "S", + "Ṩ": "S", + "Ș": "S", + "Ş": "S", + "Ȿ": "S", + "Ꞩ": "S", + "Ꞅ": "S", + "Ⓣ": "T", + "T": "T", + "Ṫ": "T", + "Ť": "T", + "Ṭ": "T", + "Ț": "T", + "Ţ": "T", + "Ṱ": "T", + "Ṯ": "T", + "Ŧ": "T", + "Ƭ": "T", + "Ʈ": "T", + "Ⱦ": "T", + "Ꞇ": "T", + "Ⓤ": "U", + "U": "U", + "Ù": "U", + "Ú": "U", + "Û": "U", + "Ũ": "U", + "Ṹ": "U", + "Ū": "U", + "Ṻ": "U", + "Ŭ": "U", + "Ü": "U", + "Ǜ": "U", + "Ǘ": "U", + "Ǖ": "U", + "Ǚ": "U", + "Ủ": "U", + "Ů": "U", + "Ű": "U", + "Ǔ": "U", + "Ȕ": "U", + "Ȗ": "U", + "Ư": "U", + "Ừ": "U", + "Ứ": "U", + "Ữ": "U", + "Ử": "U", + "Ự": "U", + "Ụ": "U", + "Ṳ": "U", + "Ų": "U", + "Ṷ": "U", + "Ṵ": "U", + "Ʉ": "U", + "Ⓥ": "V", + "V": "V", + "Ṽ": "V", + "Ṿ": "V", + "Ʋ": "V", + "Ꝟ": "V", + "Ʌ": "V", + "Ⓦ": "W", + "W": "W", + "Ẁ": "W", + "Ẃ": "W", + "Ŵ": "W", + "Ẇ": "W", + "Ẅ": "W", + "Ẉ": "W", + "Ⱳ": "W", + "Ⓧ": "X", + "X": "X", + "Ẋ": "X", + "Ẍ": "X", + "Ⓨ": "Y", + "Y": "Y", + "Ỳ": "Y", + "Ý": "Y", + "Ŷ": "Y", + "Ỹ": "Y", + "Ȳ": "Y", + "Ẏ": "Y", + "Ÿ": "Y", + "Ỷ": "Y", + "Ỵ": "Y", + "Ƴ": "Y", + "Ɏ": "Y", + "Ỿ": "Y", + "Ⓩ": "Z", + "Z": "Z", + "Ź": "Z", + "Ẑ": "Z", + "Ż": "Z", + "Ž": "Z", + "Ẓ": "Z", + "Ẕ": "Z", + "Ƶ": "Z", + "Ȥ": "Z", + "Ɀ": "Z", + "Ⱬ": "Z", + "Ꝣ": "Z", + "ⓐ": "a", + "a": "a", + "ẚ": "a", + "à": "a", + "á": "a", + "â": "a", + "ầ": "a", + "ấ": "a", + "ẫ": "a", + "ẩ": "a", + "ã": "a", + "ā": "a", + "ă": "a", + "ằ": "a", + "ắ": "a", + "ẵ": "a", + "ẳ": "a", + "ȧ": "a", + "ǡ": "a", + "ä": "a", + "ǟ": "a", + "ả": "a", + "å": "a", + "ǻ": "a", + "ǎ": "a", + "ȁ": "a", + "ȃ": "a", + "ạ": "a", + "ậ": "a", + "ặ": "a", + "ḁ": "a", + "ą": "a", + "ⱥ": "a", + "ɐ": "a", + "ⓑ": "b", + "b": "b", + "ḃ": "b", + "ḅ": "b", + "ḇ": "b", + "ƀ": "b", + "ƃ": "b", + "ɓ": "b", + "ⓒ": "c", + "c": "c", + "ć": "c", + "ĉ": "c", + "ċ": "c", + "č": "c", + "ç": "c", + "ḉ": "c", + "ƈ": "c", + "ȼ": "c", + "ꜿ": "c", + "ↄ": "c", + "ⓓ": "d", + "d": "d", + "ḋ": "d", + "ď": "d", + "ḍ": "d", + "ḑ": "d", + "ḓ": "d", + "ḏ": "d", + "đ": "d", + "ƌ": "d", + "ɖ": "d", + "ɗ": "d", + "ꝺ": "d", + "ⓔ": "e", + "e": "e", + "è": "e", + "é": "e", + "ê": "e", + "ề": "e", + "ế": "e", + "ễ": "e", + "ể": "e", + "ẽ": "e", + "ē": "e", + "ḕ": "e", + "ḗ": "e", + "ĕ": "e", + "ė": "e", + "ë": "e", + "ẻ": "e", + "ě": "e", + "ȅ": "e", + "ȇ": "e", + "ẹ": "e", + "ệ": "e", + "ȩ": "e", + "ḝ": "e", + "ę": "e", + "ḙ": "e", + "ḛ": "e", + "ɇ": "e", + "ɛ": "e", + "ǝ": "e", + "ⓕ": "f", + "f": "f", + "ḟ": "f", + "ƒ": "f", + "ꝼ": "f", + "ⓖ": "g", + "g": "g", + "ǵ": "g", + "ĝ": "g", + "ḡ": "g", + "ğ": "g", + "ġ": "g", + "ǧ": "g", + "ģ": "g", + "ǥ": "g", + "ɠ": "g", + "ꞡ": "g", + "ᵹ": "g", + "ꝿ": "g", + "ⓗ": "h", + "h": "h", + "ĥ": "h", + "ḣ": "h", + "ḧ": "h", + "ȟ": "h", + "ḥ": "h", + "ḩ": "h", + "ḫ": "h", + "ẖ": "h", + "ħ": "h", + "ⱨ": "h", + "ⱶ": "h", + "ɥ": "h", + "ⓘ": "i", + "i": "i", + "ì": "i", + "í": "i", + "î": "i", + "ĩ": "i", + "ī": "i", + "ĭ": "i", + "ï": "i", + "ḯ": "i", + "ỉ": "i", + "ǐ": "i", + "ȉ": "i", + "ȋ": "i", + "ị": "i", + "į": "i", + "ḭ": "i", + "ɨ": "i", + "ı": "i", + "ⓙ": "j", + "j": "j", + "ĵ": "j", + "ǰ": "j", + "ɉ": "j", + "ⓚ": "k", + "k": "k", + "ḱ": "k", + "ǩ": "k", + "ḳ": "k", + "ķ": "k", + "ḵ": "k", + "ƙ": "k", + "ⱪ": "k", + "ꝁ": "k", + "ꝃ": "k", + "ꝅ": "k", + "ꞣ": "k", + "ⓛ": "l", + "l": "l", + "ŀ": "l", + "ĺ": "l", + "ľ": "l", + "ḷ": "l", + "ḹ": "l", + "ļ": "l", + "ḽ": "l", + "ḻ": "l", + "ſ": "l", + "ł": "l", + "ƚ": "l", + "ɫ": "l", + "ⱡ": "l", + "ꝉ": "l", + "ꞁ": "l", + "ꝇ": "l", + "ⓜ": "m", + "m": "m", + "ḿ": "m", + "ṁ": "m", + "ṃ": "m", + "ɱ": "m", + "ɯ": "m", + "ⓝ": "n", + "n": "n", + "ǹ": "n", + "ń": "n", + "ñ": "n", + "ṅ": "n", + "ň": "n", + "ṇ": "n", + "ņ": "n", + "ṋ": "n", + "ṉ": "n", + "ƞ": "n", + "ɲ": "n", + "ʼn": "n", + "ꞑ": "n", + "ꞥ": "n", + "ⓞ": "o", + "o": "o", + "ò": "o", + "ó": "o", + "ô": "o", + "ồ": "o", + "ố": "o", + "ỗ": "o", + "ổ": "o", + "õ": "o", + "ṍ": "o", + "ȭ": "o", + "ṏ": "o", + "ō": "o", + "ṑ": "o", + "ṓ": "o", + "ŏ": "o", + "ȯ": "o", + "ȱ": "o", + "ö": "o", + "ȫ": "o", + "ỏ": "o", + "ő": "o", + "ǒ": "o", + "ȍ": "o", + "ȏ": "o", + "ơ": "o", + "ờ": "o", + "ớ": "o", + "ỡ": "o", + "ở": "o", + "ợ": "o", + "ọ": "o", + "ộ": "o", + "ǫ": "o", + "ǭ": "o", + "ø": "o", + "ǿ": "o", + "ɔ": "o", + "ꝋ": "o", + "ꝍ": "o", + "ɵ": "o", + "ⓟ": "p", + "p": "p", + "ṕ": "p", + "ṗ": "p", + "ƥ": "p", + "ᵽ": "p", + "ꝑ": "p", + "ꝓ": "p", + "ꝕ": "p", + "ⓠ": "q", + "q": "q", + "ɋ": "q", + "ꝗ": "q", + "ꝙ": "q", + "ⓡ": "r", + "r": "r", + "ŕ": "r", + "ṙ": "r", + "ř": "r", + "ȑ": "r", + "ȓ": "r", + "ṛ": "r", + "ṝ": "r", + "ŗ": "r", + "ṟ": "r", + "ɍ": "r", + "ɽ": "r", + "ꝛ": "r", + "ꞧ": "r", + "ꞃ": "r", + "ⓢ": "s", + "s": "s", + "ß": "s", + "ś": "s", + "ṥ": "s", + "ŝ": "s", + "ṡ": "s", + "š": "s", + "ṧ": "s", + "ṣ": "s", + "ṩ": "s", + "ș": "s", + "ş": "s", + "ȿ": "s", + "ꞩ": "s", + "ꞅ": "s", + "ẛ": "s", + "ⓣ": "t", + "t": "t", + "ṫ": "t", + "ẗ": "t", + "ť": "t", + "ṭ": "t", + "ț": "t", + "ţ": "t", + "ṱ": "t", + "ṯ": "t", + "ŧ": "t", + "ƭ": "t", + "ʈ": "t", + "ⱦ": "t", + "ꞇ": "t", + "ⓤ": "u", + "u": "u", + "ù": "u", + "ú": "u", + "û": "u", + "ũ": "u", + "ṹ": "u", + "ū": "u", + "ṻ": "u", + "ŭ": "u", + "ü": "u", + "ǜ": "u", + "ǘ": "u", + "ǖ": "u", + "ǚ": "u", + "ủ": "u", + "ů": "u", + "ű": "u", + "ǔ": "u", + "ȕ": "u", + "ȗ": "u", + "ư": "u", + "ừ": "u", + "ứ": "u", + "ữ": "u", + "ử": "u", + "ự": "u", + "ụ": "u", + "ṳ": "u", + "ų": "u", + "ṷ": "u", + "ṵ": "u", + "ʉ": "u", + "ⓥ": "v", + "v": "v", + "ṽ": "v", + "ṿ": "v", + "ʋ": "v", + "ꝟ": "v", + "ʌ": "v", + "ⓦ": "w", + "w": "w", + "ẁ": "w", + "ẃ": "w", + "ŵ": "w", + "ẇ": "w", + "ẅ": "w", + "ẘ": "w", + "ẉ": "w", + "ⱳ": "w", + "ⓧ": "x", + "x": "x", + "ẋ": "x", + "ẍ": "x", + "ⓨ": "y", + "y": "y", + "ỳ": "y", + "ý": "y", + "ŷ": "y", + "ỹ": "y", + "ȳ": "y", + "ẏ": "y", + "ÿ": "y", + "ỷ": "y", + "ẙ": "y", + "ỵ": "y", + "ƴ": "y", + "ɏ": "y", + "ỿ": "y", + "ⓩ": "z", + "z": "z", + "ź": "z", + "ẑ": "z", + "ż": "z", + "ž": "z", + "ẓ": "z", + "ẕ": "z", + "ƶ": "z", + "ȥ": "z", + "ɀ": "z", + "ⱬ": "z", + "ꝣ": "z" +}; +exports.StringUtility = StringUtility; + +}); + +unwrapExports(utilities); + +var models = createCommonjsModule(function (module, exports) { +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); + + +class ModelResult { +} +exports.ModelResult = ModelResult; +class ExtendedModelResult extends ModelResult { + constructor(source = null) { + super(); + if (source) { + this.text = source.text; + this.start = source.start; + this.end = source.end; + this.typeName = source.typeName; + this.resolution = source.resolution; + } + } +} +exports.ExtendedModelResult = ExtendedModelResult; +class ModelFactoryKey { + constructor(culture$$1, modelType, options = null) { + this.culture = culture$$1 ? culture$$1.toLowerCase() : null; + this.modelType = modelType; + this.options = options; + } + toString() { + return JSON.stringify(this); + } + static fromString(key) { + return JSON.parse(key); + } +} +class ModelFactory { + constructor() { + this.modelFactories = new Map(); + } + getModel(modelTypeName, culture$$1, fallbackToDefaultCulture, options) { + let result = this.tryGetModel(modelTypeName, culture$$1, options); + if (!result.containsModel && fallbackToDefaultCulture) { + result = this.tryGetModel(modelTypeName, ModelFactory.fallbackCulture, options); + } + if (result.containsModel) { + return result.model; + } + throw new Error(`Could not find Model with the specified configuration: ${culture$$1},${modelTypeName}`); + } + tryGetModel(modelTypeName, culture$$1, options) { + culture$$1 = culture.Culture.mapToNearestLanguage(culture$$1); + let cacheResult = this.getModelFromCache(modelTypeName, culture$$1, options); + if (cacheResult) + return { containsModel: true, model: cacheResult }; + let key = this.generateKey(modelTypeName, culture$$1); + if (this.modelFactories.has(key)) { + let model = this.modelFactories.get(key)(options); + this.registerModelInCache(modelTypeName, culture$$1, options, model); + return { containsModel: true, model: model }; + } + return { containsModel: false }; + } + registerModel(modelTypeName, culture$$1, modelCreator) { + let key = this.generateKey(modelTypeName, culture$$1); + if (this.modelFactories.has(key)) { + throw new Error(`${culture$$1}-${modelTypeName} has already been registered.`); + } + this.modelFactories.set(key, modelCreator); + } + initializeModels(targetCulture, options) { + this.modelFactories.forEach((value, key) => { + let modelFactoryKey = ModelFactoryKey.fromString(key); + if (utilities.StringUtility.isNullOrEmpty(targetCulture) || modelFactoryKey.culture === targetCulture) { + this.tryGetModel(modelFactoryKey.modelType, modelFactoryKey.culture, modelFactoryKey.options); + } + }); + } + generateKey(modelTypeName, culture$$1) { + return new ModelFactoryKey(culture$$1, modelTypeName).toString(); + } + getModelFromCache(modelTypeName, culture$$1, options) { + let key = this.generateCacheKey(modelTypeName, culture$$1, options); + return ModelFactory.cache.get(key); + } + registerModelInCache(modelTypeName, culture$$1, options, model) { + let key = this.generateCacheKey(modelTypeName, culture$$1, options); + ModelFactory.cache.set(key, model); + } + generateCacheKey(modelTypeName, culture$$1, options) { + return new ModelFactoryKey(culture$$1, modelTypeName, options).toString(); + } +} +ModelFactory.fallbackCulture = culture.Culture.English; +ModelFactory.cache = new Map(); +exports.ModelFactory = ModelFactory; + +}); + +unwrapExports(models); + +var recognizer = createCommonjsModule(function (module, exports) { +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); + +class Recognizer { + constructor(targetCulture, options, lazyInitialization) { + this.modelFactory = new models.ModelFactory(); + if (!this.IsValidOptions(options)) + throw new Error(`${options} is not a valid options value.`); + this.TargetCulture = targetCulture; + this.Options = options; + this.InitializeConfiguration(); + if (!lazyInitialization) { + this.initializeModels(targetCulture, options); + } + } + getModel(modelTypeName, culture, fallbackToDefaultCulture) { + return this.modelFactory.getModel(modelTypeName, culture || this.TargetCulture, fallbackToDefaultCulture, this.Options); + } + registerModel(modelTypeName, culture, modelCreator) { + this.modelFactory.registerModel(modelTypeName, culture, modelCreator); + } + initializeModels(targetCulture, options) { + this.modelFactory.initializeModels(targetCulture, options); + } +} +exports.Recognizer = Recognizer; + +}); + +unwrapExports(recognizer); + +var extractors = createCommonjsModule(function (module, exports) { +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +class ExtractResult { + static isOverlap(erA, erB) { + return !(erA.start >= erB.start + erB.length) && !(erB.start >= erA.start + erA.length); + } + static isCover(er1, er2) { + return ((er2.start < er1.start) && ((er2.start + er2.length) >= (er1.start + er1.length))) + || ((er2.start <= er1.start) && ((er2.start + er2.length) > (er1.start + er1.length))); + } + static getFromText(source) { + return { + start: 0, + length: source.length, + text: source, + type: 'custom' + }; + } +} +exports.ExtractResult = ExtractResult; + +}); + +unwrapExports(extractors); + +var parsers = createCommonjsModule(function (module, exports) { +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); + +class ParseResult extends extractors.ExtractResult { + constructor(er) { + super(); + if (er) { + this.length = er.length; + this.start = er.start; + this.data = er.data; + this.text = er.text; + this.type = er.type; + } + this.resolutionStr = ""; + } +} +exports.ParseResult = ParseResult; + +}); + +unwrapExports(parsers); + +var recognizersText = createCommonjsModule(function (module, exports) { +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); + +exports.Culture = culture.Culture; +exports.CultureInfo = culture.CultureInfo; + +exports.ModelResult = models.ModelResult; +exports.ModelFactory = models.ModelFactory; + +exports.Recognizer = recognizer.Recognizer; + +exports.ExtractResult = extractors.ExtractResult; + +exports.ParseResult = parsers.ParseResult; + +exports.FormatUtility = utilities.FormatUtility; +exports.StringUtility = utilities.StringUtility; +exports.Match = utilities.Match; +exports.RegExpUtility = utilities.RegExpUtility; + +}); + +unwrapExports(recognizersText); + +/** + * lodash (Custom Build) + * Build: `lodash modularize exports="npm" -o ./` + * Copyright jQuery Foundation and other contributors + * Released under MIT license + * Based on Underscore.js 1.8.3 + * Copyright Jeremy Ashkenas, DocumentCloud and Investigative Reporters & Editors + */ + +/** Used as references for various `Number` constants. */ +var INFINITY = 1 / 0; + +/** `Object#toString` result references. */ +var symbolTag = '[object Symbol]'; + +/** Used to match leading and trailing whitespace. */ +var reTrimEnd = /\s+$/; + +/** Used to compose unicode character classes. */ +var rsAstralRange = '\\ud800-\\udfff'; +var rsComboMarksRange = '\\u0300-\\u036f\\ufe20-\\ufe23'; +var rsComboSymbolsRange = '\\u20d0-\\u20f0'; +var rsVarRange = '\\ufe0e\\ufe0f'; + +/** Used to compose unicode capture groups. */ +var rsAstral = '[' + rsAstralRange + ']'; +var rsCombo = '[' + rsComboMarksRange + rsComboSymbolsRange + ']'; +var rsFitz = '\\ud83c[\\udffb-\\udfff]'; +var rsModifier = '(?:' + rsCombo + '|' + rsFitz + ')'; +var rsNonAstral = '[^' + rsAstralRange + ']'; +var rsRegional = '(?:\\ud83c[\\udde6-\\uddff]){2}'; +var rsSurrPair = '[\\ud800-\\udbff][\\udc00-\\udfff]'; +var rsZWJ = '\\u200d'; + +/** Used to compose unicode regexes. */ +var reOptMod = rsModifier + '?'; +var rsOptVar = '[' + rsVarRange + ']?'; +var rsOptJoin = '(?:' + rsZWJ + '(?:' + [rsNonAstral, rsRegional, rsSurrPair].join('|') + ')' + rsOptVar + reOptMod + ')*'; +var rsSeq = rsOptVar + reOptMod + rsOptJoin; +var rsSymbol = '(?:' + [rsNonAstral + rsCombo + '?', rsCombo, rsRegional, rsSurrPair, rsAstral].join('|') + ')'; + +/** Used to match [string symbols](https://mathiasbynens.be/notes/javascript-unicode). */ +var reUnicode = RegExp(rsFitz + '(?=' + rsFitz + ')|' + rsSymbol + rsSeq, 'g'); + +/** Used to detect strings with [zero-width joiners or code points from the astral planes](http://eev.ee/blog/2015/09/12/dark-corners-of-unicode/). */ +var reHasUnicode = RegExp('[' + rsZWJ + rsAstralRange + rsComboMarksRange + rsComboSymbolsRange + rsVarRange + ']'); + +/** Detect free variable `global` from Node.js. */ +var freeGlobal = typeof commonjsGlobal == 'object' && commonjsGlobal && commonjsGlobal.Object === Object && commonjsGlobal; + +/** Detect free variable `self`. */ +var freeSelf = typeof self == 'object' && self && self.Object === Object && self; + +/** Used as a reference to the global object. */ +var root = freeGlobal || freeSelf || Function('return this')(); + +/** + * Converts an ASCII `string` to an array. + * + * @private + * @param {string} string The string to convert. + * @returns {Array} Returns the converted array. + */ +function asciiToArray(string) { + return string.split(''); +} + +/** + * The base implementation of `_.findIndex` and `_.findLastIndex` without + * support for iteratee shorthands. + * + * @private + * @param {Array} array The array to inspect. + * @param {Function} predicate The function invoked per iteration. + * @param {number} fromIndex The index to search from. + * @param {boolean} [fromRight] Specify iterating from right to left. + * @returns {number} Returns the index of the matched value, else `-1`. + */ +function baseFindIndex(array, predicate, fromIndex, fromRight) { + var length = array.length, + index = fromIndex + (fromRight ? 1 : -1); + + while ((fromRight ? index-- : ++index < length)) { + if (predicate(array[index], index, array)) { + return index; + } + } + return -1; +} + +/** + * The base implementation of `_.indexOf` without `fromIndex` bounds checks. + * + * @private + * @param {Array} array The array to inspect. + * @param {*} value The value to search for. + * @param {number} fromIndex The index to search from. + * @returns {number} Returns the index of the matched value, else `-1`. + */ +function baseIndexOf(array, value, fromIndex) { + if (value !== value) { + return baseFindIndex(array, baseIsNaN, fromIndex); + } + var index = fromIndex - 1, + length = array.length; + + while (++index < length) { + if (array[index] === value) { + return index; + } + } + return -1; +} + +/** + * The base implementation of `_.isNaN` without support for number objects. + * + * @private + * @param {*} value The value to check. + * @returns {boolean} Returns `true` if `value` is `NaN`, else `false`. + */ +function baseIsNaN(value) { + return value !== value; +} + +/** + * Used by `_.trim` and `_.trimEnd` to get the index of the last string symbol + * that is not found in the character symbols. + * + * @private + * @param {Array} strSymbols The string symbols to inspect. + * @param {Array} chrSymbols The character symbols to find. + * @returns {number} Returns the index of the last unmatched string symbol. + */ +function charsEndIndex(strSymbols, chrSymbols) { + var index = strSymbols.length; + + while (index-- && baseIndexOf(chrSymbols, strSymbols[index], 0) > -1) {} + return index; +} + +/** + * Checks if `string` contains Unicode symbols. + * + * @private + * @param {string} string The string to inspect. + * @returns {boolean} Returns `true` if a symbol is found, else `false`. + */ +function hasUnicode(string) { + return reHasUnicode.test(string); +} + +/** + * Converts `string` to an array. + * + * @private + * @param {string} string The string to convert. + * @returns {Array} Returns the converted array. + */ +function stringToArray(string) { + return hasUnicode(string) + ? unicodeToArray(string) + : asciiToArray(string); +} + +/** + * Converts a Unicode `string` to an array. + * + * @private + * @param {string} string The string to convert. + * @returns {Array} Returns the converted array. + */ +function unicodeToArray(string) { + return string.match(reUnicode) || []; +} + +/** Used for built-in method references. */ +var objectProto = Object.prototype; + +/** + * Used to resolve the + * [`toStringTag`](http://ecma-international.org/ecma-262/7.0/#sec-object.prototype.tostring) + * of values. + */ +var objectToString = objectProto.toString; + +/** Built-in value references. */ +var Symbol$1 = root.Symbol; + +/** Used to convert symbols to primitives and strings. */ +var symbolProto = Symbol$1 ? Symbol$1.prototype : undefined; +var symbolToString = symbolProto ? symbolProto.toString : undefined; + +/** + * The base implementation of `_.slice` without an iteratee call guard. + * + * @private + * @param {Array} array The array to slice. + * @param {number} [start=0] The start position. + * @param {number} [end=array.length] The end position. + * @returns {Array} Returns the slice of `array`. + */ +function baseSlice(array, start, end) { + var index = -1, + length = array.length; + + if (start < 0) { + start = -start > length ? 0 : (length + start); + } + end = end > length ? length : end; + if (end < 0) { + end += length; + } + length = start > end ? 0 : ((end - start) >>> 0); + start >>>= 0; + + var result = Array(length); + while (++index < length) { + result[index] = array[index + start]; + } + return result; +} + +/** + * The base implementation of `_.toString` which doesn't convert nullish + * values to empty strings. + * + * @private + * @param {*} value The value to process. + * @returns {string} Returns the string. + */ +function baseToString(value) { + // Exit early for strings to avoid a performance hit in some environments. + if (typeof value == 'string') { + return value; + } + if (isSymbol(value)) { + return symbolToString ? symbolToString.call(value) : ''; + } + var result = (value + ''); + return (result == '0' && (1 / value) == -INFINITY) ? '-0' : result; +} + +/** + * Casts `array` to a slice if it's needed. + * + * @private + * @param {Array} array The array to inspect. + * @param {number} start The start position. + * @param {number} [end=array.length] The end position. + * @returns {Array} Returns the cast slice. + */ +function castSlice(array, start, end) { + var length = array.length; + end = end === undefined ? length : end; + return (!start && end >= length) ? array : baseSlice(array, start, end); +} + +/** + * Checks if `value` is object-like. A value is object-like if it's not `null` + * and has a `typeof` result of "object". + * + * @static + * @memberOf _ + * @since 4.0.0 + * @category Lang + * @param {*} value The value to check. + * @returns {boolean} Returns `true` if `value` is object-like, else `false`. + * @example + * + * _.isObjectLike({}); + * // => true + * + * _.isObjectLike([1, 2, 3]); + * // => true + * + * _.isObjectLike(_.noop); + * // => false + * + * _.isObjectLike(null); + * // => false + */ +function isObjectLike(value) { + return !!value && typeof value == 'object'; +} + +/** + * Checks if `value` is classified as a `Symbol` primitive or object. + * + * @static + * @memberOf _ + * @since 4.0.0 + * @category Lang + * @param {*} value The value to check. + * @returns {boolean} Returns `true` if `value` is a symbol, else `false`. + * @example + * + * _.isSymbol(Symbol.iterator); + * // => true + * + * _.isSymbol('abc'); + * // => false + */ +function isSymbol(value) { + return typeof value == 'symbol' || + (isObjectLike(value) && objectToString.call(value) == symbolTag); +} + +/** + * Converts `value` to a string. An empty string is returned for `null` + * and `undefined` values. The sign of `-0` is preserved. + * + * @static + * @memberOf _ + * @since 4.0.0 + * @category Lang + * @param {*} value The value to process. + * @returns {string} Returns the string. + * @example + * + * _.toString(null); + * // => '' + * + * _.toString(-0); + * // => '-0' + * + * _.toString([1, 2, 3]); + * // => '1,2,3' + */ +function toString(value) { + return value == null ? '' : baseToString(value); +} + +/** + * Removes trailing whitespace or specified characters from `string`. + * + * @static + * @memberOf _ + * @since 4.0.0 + * @category String + * @param {string} [string=''] The string to trim. + * @param {string} [chars=whitespace] The characters to trim. + * @param- {Object} [guard] Enables use as an iteratee for methods like `_.map`. + * @returns {string} Returns the trimmed string. + * @example + * + * _.trimEnd(' abc '); + * // => ' abc' + * + * _.trimEnd('-_-abc-_-', '_-'); + * // => '-_-abc' + */ +function trimEnd(string, chars, guard) { + string = toString(string); + if (string && (guard || chars === undefined)) { + return string.replace(reTrimEnd, ''); + } + if (!string || !(chars = baseToString(chars))) { + return string; + } + var strSymbols = stringToArray(string), + end = charsEndIndex(strSymbols, stringToArray(chars)) + 1; + + return castSlice(strSymbols, 0, end).join(''); +} + +var lodash_trimend = trimEnd; + +var bignumber = createCommonjsModule(function (module) { +(function (globalObject) { + 'use strict'; + +/* + * bignumber.js v7.2.1 + * A JavaScript library for arbitrary-precision arithmetic. + * https://github.com/MikeMcl/bignumber.js + * Copyright (c) 2018 Michael Mclaughlin + * MIT Licensed. + * + * BigNumber.prototype methods | BigNumber methods + * | + * absoluteValue abs | clone + * comparedTo | config set + * decimalPlaces dp | DECIMAL_PLACES + * dividedBy div | ROUNDING_MODE + * dividedToIntegerBy idiv | EXPONENTIAL_AT + * exponentiatedBy pow | RANGE + * integerValue | CRYPTO + * isEqualTo eq | MODULO_MODE + * isFinite | POW_PRECISION + * isGreaterThan gt | FORMAT + * isGreaterThanOrEqualTo gte | ALPHABET + * isInteger | isBigNumber + * isLessThan lt | maximum max + * isLessThanOrEqualTo lte | minimum min + * isNaN | random + * isNegative | + * isPositive | + * isZero | + * minus | + * modulo mod | + * multipliedBy times | + * negated | + * plus | + * precision sd | + * shiftedBy | + * squareRoot sqrt | + * toExponential | + * toFixed | + * toFormat | + * toFraction | + * toJSON | + * toNumber | + * toPrecision | + * toString | + * valueOf | + * + */ + + + var BigNumber, + isNumeric = /^-?(?:\d+(?:\.\d*)?|\.\d+)(?:e[+-]?\d+)?$/i, + + mathceil = Math.ceil, + mathfloor = Math.floor, + + bignumberError = '[BigNumber Error] ', + tooManyDigits = bignumberError + 'Number primitive has more than 15 significant digits: ', + + BASE = 1e14, + LOG_BASE = 14, + MAX_SAFE_INTEGER = 0x1fffffffffffff, // 2^53 - 1 + // MAX_INT32 = 0x7fffffff, // 2^31 - 1 + POWS_TEN = [1, 10, 100, 1e3, 1e4, 1e5, 1e6, 1e7, 1e8, 1e9, 1e10, 1e11, 1e12, 1e13], + SQRT_BASE = 1e7, + + // EDITABLE + // The limit on the value of DECIMAL_PLACES, TO_EXP_NEG, TO_EXP_POS, MIN_EXP, MAX_EXP, and + // the arguments to toExponential, toFixed, toFormat, and toPrecision. + MAX = 1E9; // 0 to MAX_INT32 + + + /* + * Create and return a BigNumber constructor. + */ + function clone(configObject) { + var div, convertBase, parseNumeric, + P = BigNumber.prototype = { constructor: BigNumber, toString: null, valueOf: null }, + ONE = new BigNumber(1), + + + //----------------------------- EDITABLE CONFIG DEFAULTS ------------------------------- + + + // The default values below must be integers within the inclusive ranges stated. + // The values can also be changed at run-time using BigNumber.set. + + // The maximum number of decimal places for operations involving division. + DECIMAL_PLACES = 20, // 0 to MAX + + // The rounding mode used when rounding to the above decimal places, and when using + // toExponential, toFixed, toFormat and toPrecision, and round (default value). + // UP 0 Away from zero. + // DOWN 1 Towards zero. + // CEIL 2 Towards +Infinity. + // FLOOR 3 Towards -Infinity. + // HALF_UP 4 Towards nearest neighbour. If equidistant, up. + // HALF_DOWN 5 Towards nearest neighbour. If equidistant, down. + // HALF_EVEN 6 Towards nearest neighbour. If equidistant, towards even neighbour. + // HALF_CEIL 7 Towards nearest neighbour. If equidistant, towards +Infinity. + // HALF_FLOOR 8 Towards nearest neighbour. If equidistant, towards -Infinity. + ROUNDING_MODE = 4, // 0 to 8 + + // EXPONENTIAL_AT : [TO_EXP_NEG , TO_EXP_POS] + + // The exponent value at and beneath which toString returns exponential notation. + // Number type: -7 + TO_EXP_NEG = -7, // 0 to -MAX + + // The exponent value at and above which toString returns exponential notation. + // Number type: 21 + TO_EXP_POS = 21, // 0 to MAX + + // RANGE : [MIN_EXP, MAX_EXP] + + // The minimum exponent value, beneath which underflow to zero occurs. + // Number type: -324 (5e-324) + MIN_EXP = -1e7, // -1 to -MAX + + // The maximum exponent value, above which overflow to Infinity occurs. + // Number type: 308 (1.7976931348623157e+308) + // For MAX_EXP > 1e7, e.g. new BigNumber('1e100000000').plus(1) may be slow. + MAX_EXP = 1e7, // 1 to MAX + + // Whether to use cryptographically-secure random number generation, if available. + CRYPTO = false, // true or false + + // The modulo mode used when calculating the modulus: a mod n. + // The quotient (q = a / n) is calculated according to the corresponding rounding mode. + // The remainder (r) is calculated as: r = a - n * q. + // + // UP 0 The remainder is positive if the dividend is negative, else is negative. + // DOWN 1 The remainder has the same sign as the dividend. + // This modulo mode is commonly known as 'truncated division' and is + // equivalent to (a % n) in JavaScript. + // FLOOR 3 The remainder has the same sign as the divisor (Python %). + // HALF_EVEN 6 This modulo mode implements the IEEE 754 remainder function. + // EUCLID 9 Euclidian division. q = sign(n) * floor(a / abs(n)). + // The remainder is always positive. + // + // The truncated division, floored division, Euclidian division and IEEE 754 remainder + // modes are commonly used for the modulus operation. + // Although the other rounding modes can also be used, they may not give useful results. + MODULO_MODE = 1, // 0 to 9 + + // The maximum number of significant digits of the result of the exponentiatedBy operation. + // If POW_PRECISION is 0, there will be unlimited significant digits. + POW_PRECISION = 0, // 0 to MAX + + // The format specification used by the BigNumber.prototype.toFormat method. + FORMAT = { + decimalSeparator: '.', + groupSeparator: ',', + groupSize: 3, + secondaryGroupSize: 0, + fractionGroupSeparator: '\xA0', // non-breaking space + fractionGroupSize: 0 + }, + + // The alphabet used for base conversion. + // It must be at least 2 characters long, with no '.' or repeated character. + // '0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ$_' + ALPHABET = '0123456789abcdefghijklmnopqrstuvwxyz'; + + + //------------------------------------------------------------------------------------------ + + + // CONSTRUCTOR + + + /* + * The BigNumber constructor and exported function. + * Create and return a new instance of a BigNumber object. + * + * n {number|string|BigNumber} A numeric value. + * [b] {number} The base of n. Integer, 2 to ALPHABET.length inclusive. + */ + function BigNumber(n, b) { + var alphabet, c, caseChanged, e, i, isNum, len, str, + x = this; + + // Enable constructor usage without new. + if (!(x instanceof BigNumber)) { + + // Don't throw on constructor call without new (#81). + // '[BigNumber Error] Constructor call without new: {n}' + //throw Error(bignumberError + ' Constructor call without new: ' + n); + return new BigNumber(n, b); + } + + if (b == null) { + + // Duplicate. + if (n instanceof BigNumber) { + x.s = n.s; + x.e = n.e; + x.c = (n = n.c) ? n.slice() : n; + return; + } + + isNum = typeof n == 'number'; + + if (isNum && n * 0 == 0) { + + // Use `1 / n` to handle minus zero also. + x.s = 1 / n < 0 ? (n = -n, -1) : 1; + + // Faster path for integers. + if (n === ~~n) { + for (e = 0, i = n; i >= 10; i /= 10, e++); + x.e = e; + x.c = [n]; + return; + } + + str = n + ''; + } else { + if (!isNumeric.test(str = n + '')) return parseNumeric(x, str, isNum); + x.s = str.charCodeAt(0) == 45 ? (str = str.slice(1), -1) : 1; + } + + // Decimal point? + if ((e = str.indexOf('.')) > -1) str = str.replace('.', ''); + + // Exponential form? + if ((i = str.search(/e/i)) > 0) { + + // Determine exponent. + if (e < 0) e = i; + e += +str.slice(i + 1); + str = str.substring(0, i); + } else if (e < 0) { + + // Integer. + e = str.length; + } + + } else { + + // '[BigNumber Error] Base {not a primitive number|not an integer|out of range}: {b}' + intCheck(b, 2, ALPHABET.length, 'Base'); + str = n + ''; + + // Allow exponential notation to be used with base 10 argument, while + // also rounding to DECIMAL_PLACES as with other bases. + if (b == 10) { + x = new BigNumber(n instanceof BigNumber ? n : str); + return round(x, DECIMAL_PLACES + x.e + 1, ROUNDING_MODE); + } + + isNum = typeof n == 'number'; + + if (isNum) { + + // Avoid potential interpretation of Infinity and NaN as base 44+ values. + if (n * 0 != 0) return parseNumeric(x, str, isNum, b); + + x.s = 1 / n < 0 ? (str = str.slice(1), -1) : 1; + + // '[BigNumber Error] Number primitive has more than 15 significant digits: {n}' + if (BigNumber.DEBUG && str.replace(/^0\.0*|\./, '').length > 15) { + throw Error + (tooManyDigits + n); + } + + // Prevent later check for length on converted number. + isNum = false; + } else { + x.s = str.charCodeAt(0) === 45 ? (str = str.slice(1), -1) : 1; + } + + alphabet = ALPHABET.slice(0, b); + e = i = 0; + + // Check that str is a valid base b number. + // Don't use RegExp so alphabet can contain special characters. + for (len = str.length; i < len; i++) { + if (alphabet.indexOf(c = str.charAt(i)) < 0) { + if (c == '.') { + + // If '.' is not the first character and it has not be found before. + if (i > e) { + e = len; + continue; + } + } else if (!caseChanged) { + + // Allow e.g. hexadecimal 'FF' as well as 'ff'. + if (str == str.toUpperCase() && (str = str.toLowerCase()) || + str == str.toLowerCase() && (str = str.toUpperCase())) { + caseChanged = true; + i = -1; + e = 0; + continue; + } + } + + return parseNumeric(x, n + '', isNum, b); + } + } + + str = convertBase(str, b, 10, x.s); + + // Decimal point? + if ((e = str.indexOf('.')) > -1) str = str.replace('.', ''); + else e = str.length; + } + + // Determine leading zeros. + for (i = 0; str.charCodeAt(i) === 48; i++); + + // Determine trailing zeros. + for (len = str.length; str.charCodeAt(--len) === 48;); + + str = str.slice(i, ++len); + + if (str) { + len -= i; + + // '[BigNumber Error] Number primitive has more than 15 significant digits: {n}' + if (isNum && BigNumber.DEBUG && + len > 15 && (n > MAX_SAFE_INTEGER || n !== mathfloor(n))) { + throw Error + (tooManyDigits + (x.s * n)); + } + + e = e - i - 1; + + // Overflow? + if (e > MAX_EXP) { + + // Infinity. + x.c = x.e = null; + + // Underflow? + } else if (e < MIN_EXP) { + + // Zero. + x.c = [x.e = 0]; + } else { + x.e = e; + x.c = []; + + // Transform base + + // e is the base 10 exponent. + // i is where to slice str to get the first element of the coefficient array. + i = (e + 1) % LOG_BASE; + if (e < 0) i += LOG_BASE; + + if (i < len) { + if (i) x.c.push(+str.slice(0, i)); + + for (len -= LOG_BASE; i < len;) { + x.c.push(+str.slice(i, i += LOG_BASE)); + } + + str = str.slice(i); + i = LOG_BASE - str.length; + } else { + i -= len; + } + + for (; i--; str += '0'); + x.c.push(+str); + } + } else { + + // Zero. + x.c = [x.e = 0]; + } + } + + + // CONSTRUCTOR PROPERTIES + + + BigNumber.clone = clone; + + BigNumber.ROUND_UP = 0; + BigNumber.ROUND_DOWN = 1; + BigNumber.ROUND_CEIL = 2; + BigNumber.ROUND_FLOOR = 3; + BigNumber.ROUND_HALF_UP = 4; + BigNumber.ROUND_HALF_DOWN = 5; + BigNumber.ROUND_HALF_EVEN = 6; + BigNumber.ROUND_HALF_CEIL = 7; + BigNumber.ROUND_HALF_FLOOR = 8; + BigNumber.EUCLID = 9; + + + /* + * Configure infrequently-changing library-wide settings. + * + * Accept an object with the following optional properties (if the value of a property is + * a number, it must be an integer within the inclusive range stated): + * + * DECIMAL_PLACES {number} 0 to MAX + * ROUNDING_MODE {number} 0 to 8 + * EXPONENTIAL_AT {number|number[]} -MAX to MAX or [-MAX to 0, 0 to MAX] + * RANGE {number|number[]} -MAX to MAX (not zero) or [-MAX to -1, 1 to MAX] + * CRYPTO {boolean} true or false + * MODULO_MODE {number} 0 to 9 + * POW_PRECISION {number} 0 to MAX + * ALPHABET {string} A string of two or more unique characters which does + * not contain '.'. + * FORMAT {object} An object with some of the following properties: + * decimalSeparator {string} + * groupSeparator {string} + * groupSize {number} + * secondaryGroupSize {number} + * fractionGroupSeparator {string} + * fractionGroupSize {number} + * + * (The values assigned to the above FORMAT object properties are not checked for validity.) + * + * E.g. + * BigNumber.config({ DECIMAL_PLACES : 20, ROUNDING_MODE : 4 }) + * + * Ignore properties/parameters set to null or undefined, except for ALPHABET. + * + * Return an object with the properties current values. + */ + BigNumber.config = BigNumber.set = function (obj) { + var p, v; + + if (obj != null) { + + if (typeof obj == 'object') { + + // DECIMAL_PLACES {number} Integer, 0 to MAX inclusive. + // '[BigNumber Error] DECIMAL_PLACES {not a primitive number|not an integer|out of range}: {v}' + if (obj.hasOwnProperty(p = 'DECIMAL_PLACES')) { + v = obj[p]; + intCheck(v, 0, MAX, p); + DECIMAL_PLACES = v; + } + + // ROUNDING_MODE {number} Integer, 0 to 8 inclusive. + // '[BigNumber Error] ROUNDING_MODE {not a primitive number|not an integer|out of range}: {v}' + if (obj.hasOwnProperty(p = 'ROUNDING_MODE')) { + v = obj[p]; + intCheck(v, 0, 8, p); + ROUNDING_MODE = v; + } + + // EXPONENTIAL_AT {number|number[]} + // Integer, -MAX to MAX inclusive or + // [integer -MAX to 0 inclusive, 0 to MAX inclusive]. + // '[BigNumber Error] EXPONENTIAL_AT {not a primitive number|not an integer|out of range}: {v}' + if (obj.hasOwnProperty(p = 'EXPONENTIAL_AT')) { + v = obj[p]; + if (isArray(v)) { + intCheck(v[0], -MAX, 0, p); + intCheck(v[1], 0, MAX, p); + TO_EXP_NEG = v[0]; + TO_EXP_POS = v[1]; + } else { + intCheck(v, -MAX, MAX, p); + TO_EXP_NEG = -(TO_EXP_POS = v < 0 ? -v : v); + } + } + + // RANGE {number|number[]} Non-zero integer, -MAX to MAX inclusive or + // [integer -MAX to -1 inclusive, integer 1 to MAX inclusive]. + // '[BigNumber Error] RANGE {not a primitive number|not an integer|out of range|cannot be zero}: {v}' + if (obj.hasOwnProperty(p = 'RANGE')) { + v = obj[p]; + if (isArray(v)) { + intCheck(v[0], -MAX, -1, p); + intCheck(v[1], 1, MAX, p); + MIN_EXP = v[0]; + MAX_EXP = v[1]; + } else { + intCheck(v, -MAX, MAX, p); + if (v) { + MIN_EXP = -(MAX_EXP = v < 0 ? -v : v); + } else { + throw Error + (bignumberError + p + ' cannot be zero: ' + v); + } + } + } + + // CRYPTO {boolean} true or false. + // '[BigNumber Error] CRYPTO not true or false: {v}' + // '[BigNumber Error] crypto unavailable' + if (obj.hasOwnProperty(p = 'CRYPTO')) { + v = obj[p]; + if (v === !!v) { + if (v) { + if (typeof crypto != 'undefined' && crypto && + (crypto.getRandomValues || crypto.randomBytes)) { + CRYPTO = v; + } else { + CRYPTO = !v; + throw Error + (bignumberError + 'crypto unavailable'); + } + } else { + CRYPTO = v; + } + } else { + throw Error + (bignumberError + p + ' not true or false: ' + v); + } + } + + // MODULO_MODE {number} Integer, 0 to 9 inclusive. + // '[BigNumber Error] MODULO_MODE {not a primitive number|not an integer|out of range}: {v}' + if (obj.hasOwnProperty(p = 'MODULO_MODE')) { + v = obj[p]; + intCheck(v, 0, 9, p); + MODULO_MODE = v; + } + + // POW_PRECISION {number} Integer, 0 to MAX inclusive. + // '[BigNumber Error] POW_PRECISION {not a primitive number|not an integer|out of range}: {v}' + if (obj.hasOwnProperty(p = 'POW_PRECISION')) { + v = obj[p]; + intCheck(v, 0, MAX, p); + POW_PRECISION = v; + } + + // FORMAT {object} + // '[BigNumber Error] FORMAT not an object: {v}' + if (obj.hasOwnProperty(p = 'FORMAT')) { + v = obj[p]; + if (typeof v == 'object') FORMAT = v; + else throw Error + (bignumberError + p + ' not an object: ' + v); + } + + // ALPHABET {string} + // '[BigNumber Error] ALPHABET invalid: {v}' + if (obj.hasOwnProperty(p = 'ALPHABET')) { + v = obj[p]; + + // Disallow if only one character, or contains '.' or a repeated character. + if (typeof v == 'string' && !/^.$|\.|(.).*\1/.test(v)) { + ALPHABET = v; + } else { + throw Error + (bignumberError + p + ' invalid: ' + v); + } + } + + } else { + + // '[BigNumber Error] Object expected: {v}' + throw Error + (bignumberError + 'Object expected: ' + obj); + } + } + + return { + DECIMAL_PLACES: DECIMAL_PLACES, + ROUNDING_MODE: ROUNDING_MODE, + EXPONENTIAL_AT: [TO_EXP_NEG, TO_EXP_POS], + RANGE: [MIN_EXP, MAX_EXP], + CRYPTO: CRYPTO, + MODULO_MODE: MODULO_MODE, + POW_PRECISION: POW_PRECISION, + FORMAT: FORMAT, + ALPHABET: ALPHABET + }; + }; + + + /* + * Return true if v is a BigNumber instance, otherwise return false. + * + * v {any} + */ + BigNumber.isBigNumber = function (v) { + return v instanceof BigNumber || v && v._isBigNumber === true || false; + }; + + + /* + * Return a new BigNumber whose value is the maximum of the arguments. + * + * arguments {number|string|BigNumber} + */ + BigNumber.maximum = BigNumber.max = function () { + return maxOrMin(arguments, P.lt); + }; + + + /* + * Return a new BigNumber whose value is the minimum of the arguments. + * + * arguments {number|string|BigNumber} + */ + BigNumber.minimum = BigNumber.min = function () { + return maxOrMin(arguments, P.gt); + }; + + + /* + * Return a new BigNumber with a random value equal to or greater than 0 and less than 1, + * and with dp, or DECIMAL_PLACES if dp is omitted, decimal places (or less if trailing + * zeros are produced). + * + * [dp] {number} Decimal places. Integer, 0 to MAX inclusive. + * + * '[BigNumber Error] Argument {not a primitive number|not an integer|out of range}: {dp}' + * '[BigNumber Error] crypto unavailable' + */ + BigNumber.random = (function () { + var pow2_53 = 0x20000000000000; + + // Return a 53 bit integer n, where 0 <= n < 9007199254740992. + // Check if Math.random() produces more than 32 bits of randomness. + // If it does, assume at least 53 bits are produced, otherwise assume at least 30 bits. + // 0x40000000 is 2^30, 0x800000 is 2^23, 0x1fffff is 2^21 - 1. + var random53bitInt = (Math.random() * pow2_53) & 0x1fffff + ? function () { return mathfloor(Math.random() * pow2_53); } + : function () { return ((Math.random() * 0x40000000 | 0) * 0x800000) + + (Math.random() * 0x800000 | 0); }; + + return function (dp) { + var a, b, e, k, v, + i = 0, + c = [], + rand = new BigNumber(ONE); + + if (dp == null) dp = DECIMAL_PLACES; + else intCheck(dp, 0, MAX); + + k = mathceil(dp / LOG_BASE); + + if (CRYPTO) { + + // Browsers supporting crypto.getRandomValues. + if (crypto.getRandomValues) { + + a = crypto.getRandomValues(new Uint32Array(k *= 2)); + + for (; i < k;) { + + // 53 bits: + // ((Math.pow(2, 32) - 1) * Math.pow(2, 21)).toString(2) + // 11111 11111111 11111111 11111111 11100000 00000000 00000000 + // ((Math.pow(2, 32) - 1) >>> 11).toString(2) + // 11111 11111111 11111111 + // 0x20000 is 2^21. + v = a[i] * 0x20000 + (a[i + 1] >>> 11); + + // Rejection sampling: + // 0 <= v < 9007199254740992 + // Probability that v >= 9e15, is + // 7199254740992 / 9007199254740992 ~= 0.0008, i.e. 1 in 1251 + if (v >= 9e15) { + b = crypto.getRandomValues(new Uint32Array(2)); + a[i] = b[0]; + a[i + 1] = b[1]; + } else { + + // 0 <= v <= 8999999999999999 + // 0 <= (v % 1e14) <= 99999999999999 + c.push(v % 1e14); + i += 2; + } + } + i = k / 2; + + // Node.js supporting crypto.randomBytes. + } else if (crypto.randomBytes) { + + // buffer + a = crypto.randomBytes(k *= 7); + + for (; i < k;) { + + // 0x1000000000000 is 2^48, 0x10000000000 is 2^40 + // 0x100000000 is 2^32, 0x1000000 is 2^24 + // 11111 11111111 11111111 11111111 11111111 11111111 11111111 + // 0 <= v < 9007199254740992 + v = ((a[i] & 31) * 0x1000000000000) + (a[i + 1] * 0x10000000000) + + (a[i + 2] * 0x100000000) + (a[i + 3] * 0x1000000) + + (a[i + 4] << 16) + (a[i + 5] << 8) + a[i + 6]; + + if (v >= 9e15) { + crypto.randomBytes(7).copy(a, i); + } else { + + // 0 <= (v % 1e14) <= 99999999999999 + c.push(v % 1e14); + i += 7; + } + } + i = k / 7; + } else { + CRYPTO = false; + throw Error + (bignumberError + 'crypto unavailable'); + } + } + + // Use Math.random. + if (!CRYPTO) { + + for (; i < k;) { + v = random53bitInt(); + if (v < 9e15) c[i++] = v % 1e14; + } + } + + k = c[--i]; + dp %= LOG_BASE; + + // Convert trailing digits to zeros according to dp. + if (k && dp) { + v = POWS_TEN[LOG_BASE - dp]; + c[i] = mathfloor(k / v) * v; + } + + // Remove trailing elements which are zero. + for (; c[i] === 0; c.pop(), i--); + + // Zero? + if (i < 0) { + c = [e = 0]; + } else { + + // Remove leading elements which are zero and adjust exponent accordingly. + for (e = -1 ; c[0] === 0; c.splice(0, 1), e -= LOG_BASE); + + // Count the digits of the first element of c to determine leading zeros, and... + for (i = 1, v = c[0]; v >= 10; v /= 10, i++); + + // adjust the exponent accordingly. + if (i < LOG_BASE) e -= LOG_BASE - i; + } + + rand.e = e; + rand.c = c; + return rand; + }; + })(); + + + // PRIVATE FUNCTIONS + + + // Called by BigNumber and BigNumber.prototype.toString. + convertBase = (function () { + var decimal = '0123456789'; + + /* + * Convert string of baseIn to an array of numbers of baseOut. + * Eg. toBaseOut('255', 10, 16) returns [15, 15]. + * Eg. toBaseOut('ff', 16, 10) returns [2, 5, 5]. + */ + function toBaseOut(str, baseIn, baseOut, alphabet) { + var j, + arr = [0], + arrL, + i = 0, + len = str.length; + + for (; i < len;) { + for (arrL = arr.length; arrL--; arr[arrL] *= baseIn); + + arr[0] += alphabet.indexOf(str.charAt(i++)); + + for (j = 0; j < arr.length; j++) { + + if (arr[j] > baseOut - 1) { + if (arr[j + 1] == null) arr[j + 1] = 0; + arr[j + 1] += arr[j] / baseOut | 0; + arr[j] %= baseOut; + } + } + } + + return arr.reverse(); + } + + // Convert a numeric string of baseIn to a numeric string of baseOut. + // If the caller is toString, we are converting from base 10 to baseOut. + // If the caller is BigNumber, we are converting from baseIn to base 10. + return function (str, baseIn, baseOut, sign, callerIsToString) { + var alphabet, d, e, k, r, x, xc, y, + i = str.indexOf('.'), + dp = DECIMAL_PLACES, + rm = ROUNDING_MODE; + + // Non-integer. + if (i >= 0) { + k = POW_PRECISION; + + // Unlimited precision. + POW_PRECISION = 0; + str = str.replace('.', ''); + y = new BigNumber(baseIn); + x = y.pow(str.length - i); + POW_PRECISION = k; + + // Convert str as if an integer, then restore the fraction part by dividing the + // result by its base raised to a power. + + y.c = toBaseOut(toFixedPoint(coeffToString(x.c), x.e, '0'), + 10, baseOut, decimal); + y.e = y.c.length; + } + + // Convert the number as integer. + + xc = toBaseOut(str, baseIn, baseOut, callerIsToString + ? (alphabet = ALPHABET, decimal) + : (alphabet = decimal, ALPHABET)); + + // xc now represents str as an integer and converted to baseOut. e is the exponent. + e = k = xc.length; + + // Remove trailing zeros. + for (; xc[--k] == 0; xc.pop()); + + // Zero? + if (!xc[0]) return alphabet.charAt(0); + + // Does str represent an integer? If so, no need for the division. + if (i < 0) { + --e; + } else { + x.c = xc; + x.e = e; + + // The sign is needed for correct rounding. + x.s = sign; + x = div(x, y, dp, rm, baseOut); + xc = x.c; + r = x.r; + e = x.e; + } + + // xc now represents str converted to baseOut. + + // THe index of the rounding digit. + d = e + dp + 1; + + // The rounding digit: the digit to the right of the digit that may be rounded up. + i = xc[d]; + + // Look at the rounding digits and mode to determine whether to round up. + + k = baseOut / 2; + r = r || d < 0 || xc[d + 1] != null; + + r = rm < 4 ? (i != null || r) && (rm == 0 || rm == (x.s < 0 ? 3 : 2)) + : i > k || i == k &&(rm == 4 || r || rm == 6 && xc[d - 1] & 1 || + rm == (x.s < 0 ? 8 : 7)); + + // If the index of the rounding digit is not greater than zero, or xc represents + // zero, then the result of the base conversion is zero or, if rounding up, a value + // such as 0.00001. + if (d < 1 || !xc[0]) { + + // 1^-dp or 0 + str = r ? toFixedPoint(alphabet.charAt(1), -dp, alphabet.charAt(0)) + : alphabet.charAt(0); + } else { + + // Truncate xc to the required number of decimal places. + xc.length = d; + + // Round up? + if (r) { + + // Rounding up may mean the previous digit has to be rounded up and so on. + for (--baseOut; ++xc[--d] > baseOut;) { + xc[d] = 0; + + if (!d) { + ++e; + xc = [1].concat(xc); + } + } + } + + // Determine trailing zeros. + for (k = xc.length; !xc[--k];); + + // E.g. [4, 11, 15] becomes 4bf. + for (i = 0, str = ''; i <= k; str += alphabet.charAt(xc[i++])); + + // Add leading zeros, decimal point and trailing zeros as required. + str = toFixedPoint(str, e, alphabet.charAt(0)); + } + + // The caller will add the sign. + return str; + }; + })(); + + + // Perform division in the specified base. Called by div and convertBase. + div = (function () { + + // Assume non-zero x and k. + function multiply(x, k, base) { + var m, temp, xlo, xhi, + carry = 0, + i = x.length, + klo = k % SQRT_BASE, + khi = k / SQRT_BASE | 0; + + for (x = x.slice(); i--;) { + xlo = x[i] % SQRT_BASE; + xhi = x[i] / SQRT_BASE | 0; + m = khi * xlo + xhi * klo; + temp = klo * xlo + ((m % SQRT_BASE) * SQRT_BASE) + carry; + carry = (temp / base | 0) + (m / SQRT_BASE | 0) + khi * xhi; + x[i] = temp % base; + } + + if (carry) x = [carry].concat(x); + + return x; + } + + function compare(a, b, aL, bL) { + var i, cmp; + + if (aL != bL) { + cmp = aL > bL ? 1 : -1; + } else { + + for (i = cmp = 0; i < aL; i++) { + + if (a[i] != b[i]) { + cmp = a[i] > b[i] ? 1 : -1; + break; + } + } + } + + return cmp; + } + + function subtract(a, b, aL, base) { + var i = 0; + + // Subtract b from a. + for (; aL--;) { + a[aL] -= i; + i = a[aL] < b[aL] ? 1 : 0; + a[aL] = i * base + a[aL] - b[aL]; + } + + // Remove leading zeros. + for (; !a[0] && a.length > 1; a.splice(0, 1)); + } + + // x: dividend, y: divisor. + return function (x, y, dp, rm, base) { + var cmp, e, i, more, n, prod, prodL, q, qc, rem, remL, rem0, xi, xL, yc0, + yL, yz, + s = x.s == y.s ? 1 : -1, + xc = x.c, + yc = y.c; + + // Either NaN, Infinity or 0? + if (!xc || !xc[0] || !yc || !yc[0]) { + + return new BigNumber( + + // Return NaN if either NaN, or both Infinity or 0. + !x.s || !y.s || (xc ? yc && xc[0] == yc[0] : !yc) ? NaN : + + // Return ±0 if x is ±0 or y is ±Infinity, or return ±Infinity as y is ±0. + xc && xc[0] == 0 || !yc ? s * 0 : s / 0 + ); + } + + q = new BigNumber(s); + qc = q.c = []; + e = x.e - y.e; + s = dp + e + 1; + + if (!base) { + base = BASE; + e = bitFloor(x.e / LOG_BASE) - bitFloor(y.e / LOG_BASE); + s = s / LOG_BASE | 0; + } + + // Result exponent may be one less then the current value of e. + // The coefficients of the BigNumbers from convertBase may have trailing zeros. + for (i = 0; yc[i] == (xc[i] || 0); i++); + + if (yc[i] > (xc[i] || 0)) e--; + + if (s < 0) { + qc.push(1); + more = true; + } else { + xL = xc.length; + yL = yc.length; + i = 0; + s += 2; + + // Normalise xc and yc so highest order digit of yc is >= base / 2. + + n = mathfloor(base / (yc[0] + 1)); + + // Not necessary, but to handle odd bases where yc[0] == (base / 2) - 1. + // if (n > 1 || n++ == 1 && yc[0] < base / 2) { + if (n > 1) { + yc = multiply(yc, n, base); + xc = multiply(xc, n, base); + yL = yc.length; + xL = xc.length; + } + + xi = yL; + rem = xc.slice(0, yL); + remL = rem.length; + + // Add zeros to make remainder as long as divisor. + for (; remL < yL; rem[remL++] = 0); + yz = yc.slice(); + yz = [0].concat(yz); + yc0 = yc[0]; + if (yc[1] >= base / 2) yc0++; + // Not necessary, but to prevent trial digit n > base, when using base 3. + // else if (base == 3 && yc0 == 1) yc0 = 1 + 1e-15; + + do { + n = 0; + + // Compare divisor and remainder. + cmp = compare(yc, rem, yL, remL); + + // If divisor < remainder. + if (cmp < 0) { + + // Calculate trial digit, n. + + rem0 = rem[0]; + if (yL != remL) rem0 = rem0 * base + (rem[1] || 0); + + // n is how many times the divisor goes into the current remainder. + n = mathfloor(rem0 / yc0); + + // Algorithm: + // product = divisor multiplied by trial digit (n). + // Compare product and remainder. + // If product is greater than remainder: + // Subtract divisor from product, decrement trial digit. + // Subtract product from remainder. + // If product was less than remainder at the last compare: + // Compare new remainder and divisor. + // If remainder is greater than divisor: + // Subtract divisor from remainder, increment trial digit. + + if (n > 1) { + + // n may be > base only when base is 3. + if (n >= base) n = base - 1; + + // product = divisor * trial digit. + prod = multiply(yc, n, base); + prodL = prod.length; + remL = rem.length; + + // Compare product and remainder. + // If product > remainder then trial digit n too high. + // n is 1 too high about 5% of the time, and is not known to have + // ever been more than 1 too high. + while (compare(prod, rem, prodL, remL) == 1) { + n--; + + // Subtract divisor from product. + subtract(prod, yL < prodL ? yz : yc, prodL, base); + prodL = prod.length; + cmp = 1; + } + } else { + + // n is 0 or 1, cmp is -1. + // If n is 0, there is no need to compare yc and rem again below, + // so change cmp to 1 to avoid it. + // If n is 1, leave cmp as -1, so yc and rem are compared again. + if (n == 0) { + + // divisor < remainder, so n must be at least 1. + cmp = n = 1; + } + + // product = divisor + prod = yc.slice(); + prodL = prod.length; + } + + if (prodL < remL) prod = [0].concat(prod); + + // Subtract product from remainder. + subtract(rem, prod, remL, base); + remL = rem.length; + + // If product was < remainder. + if (cmp == -1) { + + // Compare divisor and new remainder. + // If divisor < new remainder, subtract divisor from remainder. + // Trial digit n too low. + // n is 1 too low about 5% of the time, and very rarely 2 too low. + while (compare(yc, rem, yL, remL) < 1) { + n++; + + // Subtract divisor from remainder. + subtract(rem, yL < remL ? yz : yc, remL, base); + remL = rem.length; + } + } + } else if (cmp === 0) { + n++; + rem = [0]; + } // else cmp === 1 and n will be 0 + + // Add the next digit, n, to the result array. + qc[i++] = n; + + // Update the remainder. + if (rem[0]) { + rem[remL++] = xc[xi] || 0; + } else { + rem = [xc[xi]]; + remL = 1; + } + } while ((xi++ < xL || rem[0] != null) && s--); + + more = rem[0] != null; + + // Leading zero? + if (!qc[0]) qc.splice(0, 1); + } + + if (base == BASE) { + + // To calculate q.e, first get the number of digits of qc[0]. + for (i = 1, s = qc[0]; s >= 10; s /= 10, i++); + + round(q, dp + (q.e = i + e * LOG_BASE - 1) + 1, rm, more); + + // Caller is convertBase. + } else { + q.e = e; + q.r = +more; + } + + return q; + }; + })(); + + + /* + * Return a string representing the value of BigNumber n in fixed-point or exponential + * notation rounded to the specified decimal places or significant digits. + * + * n: a BigNumber. + * i: the index of the last digit required (i.e. the digit that may be rounded up). + * rm: the rounding mode. + * id: 1 (toExponential) or 2 (toPrecision). + */ + function format(n, i, rm, id) { + var c0, e, ne, len, str; + + if (rm == null) rm = ROUNDING_MODE; + else intCheck(rm, 0, 8); + + if (!n.c) return n.toString(); + + c0 = n.c[0]; + ne = n.e; + + if (i == null) { + str = coeffToString(n.c); + str = id == 1 || id == 2 && ne <= TO_EXP_NEG + ? toExponential(str, ne) + : toFixedPoint(str, ne, '0'); + } else { + n = round(new BigNumber(n), i, rm); + + // n.e may have changed if the value was rounded up. + e = n.e; + + str = coeffToString(n.c); + len = str.length; + + // toPrecision returns exponential notation if the number of significant digits + // specified is less than the number of digits necessary to represent the integer + // part of the value in fixed-point notation. + + // Exponential notation. + if (id == 1 || id == 2 && (i <= e || e <= TO_EXP_NEG)) { + + // Append zeros? + for (; len < i; str += '0', len++); + str = toExponential(str, e); + + // Fixed-point notation. + } else { + i -= ne; + str = toFixedPoint(str, e, '0'); + + // Append zeros? + if (e + 1 > len) { + if (--i > 0) for (str += '.'; i--; str += '0'); + } else { + i += e - len; + if (i > 0) { + if (e + 1 == len) str += '.'; + for (; i--; str += '0'); + } + } + } + } + + return n.s < 0 && c0 ? '-' + str : str; + } + + + // Handle BigNumber.max and BigNumber.min. + function maxOrMin(args, method) { + var m, n, + i = 0; + + if (isArray(args[0])) args = args[0]; + m = new BigNumber(args[0]); + + for (; ++i < args.length;) { + n = new BigNumber(args[i]); + + // If any number is NaN, return NaN. + if (!n.s) { + m = n; + break; + } else if (method.call(m, n)) { + m = n; + } + } + + return m; + } + + + /* + * Strip trailing zeros, calculate base 10 exponent and check against MIN_EXP and MAX_EXP. + * Called by minus, plus and times. + */ + function normalise(n, c, e) { + var i = 1, + j = c.length; + + // Remove trailing zeros. + for (; !c[--j]; c.pop()); + + // Calculate the base 10 exponent. First get the number of digits of c[0]. + for (j = c[0]; j >= 10; j /= 10, i++); + + // Overflow? + if ((e = i + e * LOG_BASE - 1) > MAX_EXP) { + + // Infinity. + n.c = n.e = null; + + // Underflow? + } else if (e < MIN_EXP) { + + // Zero. + n.c = [n.e = 0]; + } else { + n.e = e; + n.c = c; + } + + return n; + } + + + // Handle values that fail the validity test in BigNumber. + parseNumeric = (function () { + var basePrefix = /^(-?)0([xbo])(?=\w[\w.]*$)/i, + dotAfter = /^([^.]+)\.$/, + dotBefore = /^\.([^.]+)$/, + isInfinityOrNaN = /^-?(Infinity|NaN)$/, + whitespaceOrPlus = /^\s*\+(?=[\w.])|^\s+|\s+$/g; + + return function (x, str, isNum, b) { + var base, + s = isNum ? str : str.replace(whitespaceOrPlus, ''); + + // No exception on ±Infinity or NaN. + if (isInfinityOrNaN.test(s)) { + x.s = isNaN(s) ? null : s < 0 ? -1 : 1; + x.c = x.e = null; + } else { + if (!isNum) { + + // basePrefix = /^(-?)0([xbo])(?=\w[\w.]*$)/i + s = s.replace(basePrefix, function (m, p1, p2) { + base = (p2 = p2.toLowerCase()) == 'x' ? 16 : p2 == 'b' ? 2 : 8; + return !b || b == base ? p1 : m; + }); + + if (b) { + base = b; + + // E.g. '1.' to '1', '.1' to '0.1' + s = s.replace(dotAfter, '$1').replace(dotBefore, '0.$1'); + } + + if (str != s) return new BigNumber(s, base); + } + + // '[BigNumber Error] Not a number: {n}' + // '[BigNumber Error] Not a base {b} number: {n}' + if (BigNumber.DEBUG) { + throw Error + (bignumberError + 'Not a' + (b ? ' base ' + b : '') + ' number: ' + str); + } + + // NaN + x.c = x.e = x.s = null; + } + } + })(); + + + /* + * Round x to sd significant digits using rounding mode rm. Check for over/under-flow. + * If r is truthy, it is known that there are more digits after the rounding digit. + */ + function round(x, sd, rm, r) { + var d, i, j, k, n, ni, rd, + xc = x.c, + pows10 = POWS_TEN; + + // if x is not Infinity or NaN... + if (xc) { + + // rd is the rounding digit, i.e. the digit after the digit that may be rounded up. + // n is a base 1e14 number, the value of the element of array x.c containing rd. + // ni is the index of n within x.c. + // d is the number of digits of n. + // i is the index of rd within n including leading zeros. + // j is the actual index of rd within n (if < 0, rd is a leading zero). + out: { + + // Get the number of digits of the first element of xc. + for (d = 1, k = xc[0]; k >= 10; k /= 10, d++); + i = sd - d; + + // If the rounding digit is in the first element of xc... + if (i < 0) { + i += LOG_BASE; + j = sd; + n = xc[ni = 0]; + + // Get the rounding digit at index j of n. + rd = n / pows10[d - j - 1] % 10 | 0; + } else { + ni = mathceil((i + 1) / LOG_BASE); + + if (ni >= xc.length) { + + if (r) { + + // Needed by sqrt. + for (; xc.length <= ni; xc.push(0)); + n = rd = 0; + d = 1; + i %= LOG_BASE; + j = i - LOG_BASE + 1; + } else { + break out; + } + } else { + n = k = xc[ni]; + + // Get the number of digits of n. + for (d = 1; k >= 10; k /= 10, d++); + + // Get the index of rd within n. + i %= LOG_BASE; + + // Get the index of rd within n, adjusted for leading zeros. + // The number of leading zeros of n is given by LOG_BASE - d. + j = i - LOG_BASE + d; + + // Get the rounding digit at index j of n. + rd = j < 0 ? 0 : n / pows10[d - j - 1] % 10 | 0; + } + } + + r = r || sd < 0 || + + // Are there any non-zero digits after the rounding digit? + // The expression n % pows10[d - j - 1] returns all digits of n to the right + // of the digit at j, e.g. if n is 908714 and j is 2, the expression gives 714. + xc[ni + 1] != null || (j < 0 ? n : n % pows10[d - j - 1]); + + r = rm < 4 + ? (rd || r) && (rm == 0 || rm == (x.s < 0 ? 3 : 2)) + : rd > 5 || rd == 5 && (rm == 4 || r || rm == 6 && + + // Check whether the digit to the left of the rounding digit is odd. + ((i > 0 ? j > 0 ? n / pows10[d - j] : 0 : xc[ni - 1]) % 10) & 1 || + rm == (x.s < 0 ? 8 : 7)); + + if (sd < 1 || !xc[0]) { + xc.length = 0; + + if (r) { + + // Convert sd to decimal places. + sd -= x.e + 1; + + // 1, 0.1, 0.01, 0.001, 0.0001 etc. + xc[0] = pows10[(LOG_BASE - sd % LOG_BASE) % LOG_BASE]; + x.e = -sd || 0; + } else { + + // Zero. + xc[0] = x.e = 0; + } + + return x; + } + + // Remove excess digits. + if (i == 0) { + xc.length = ni; + k = 1; + ni--; + } else { + xc.length = ni + 1; + k = pows10[LOG_BASE - i]; + + // E.g. 56700 becomes 56000 if 7 is the rounding digit. + // j > 0 means i > number of leading zeros of n. + xc[ni] = j > 0 ? mathfloor(n / pows10[d - j] % pows10[j]) * k : 0; + } + + // Round up? + if (r) { + + for (; ;) { + + // If the digit to be rounded up is in the first element of xc... + if (ni == 0) { + + // i will be the length of xc[0] before k is added. + for (i = 1, j = xc[0]; j >= 10; j /= 10, i++); + j = xc[0] += k; + for (k = 1; j >= 10; j /= 10, k++); + + // if i != k the length has increased. + if (i != k) { + x.e++; + if (xc[0] == BASE) xc[0] = 1; + } + + break; + } else { + xc[ni] += k; + if (xc[ni] != BASE) break; + xc[ni--] = 0; + k = 1; + } + } + } + + // Remove trailing zeros. + for (i = xc.length; xc[--i] === 0; xc.pop()); + } + + // Overflow? Infinity. + if (x.e > MAX_EXP) { + x.c = x.e = null; + + // Underflow? Zero. + } else if (x.e < MIN_EXP) { + x.c = [x.e = 0]; + } + } + + return x; + } + + + // PROTOTYPE/INSTANCE METHODS + + + /* + * Return a new BigNumber whose value is the absolute value of this BigNumber. + */ + P.absoluteValue = P.abs = function () { + var x = new BigNumber(this); + if (x.s < 0) x.s = 1; + return x; + }; + + + /* + * Return + * 1 if the value of this BigNumber is greater than the value of BigNumber(y, b), + * -1 if the value of this BigNumber is less than the value of BigNumber(y, b), + * 0 if they have the same value, + * or null if the value of either is NaN. + */ + P.comparedTo = function (y, b) { + return compare(this, new BigNumber(y, b)); + }; + + + /* + * If dp is undefined or null or true or false, return the number of decimal places of the + * value of this BigNumber, or null if the value of this BigNumber is ±Infinity or NaN. + * + * Otherwise, if dp is a number, return a new BigNumber whose value is the value of this + * BigNumber rounded to a maximum of dp decimal places using rounding mode rm, or + * ROUNDING_MODE if rm is omitted. + * + * [dp] {number} Decimal places: integer, 0 to MAX inclusive. + * [rm] {number} Rounding mode. Integer, 0 to 8 inclusive. + * + * '[BigNumber Error] Argument {not a primitive number|not an integer|out of range}: {dp|rm}' + */ + P.decimalPlaces = P.dp = function (dp, rm) { + var c, n, v, + x = this; + + if (dp != null) { + intCheck(dp, 0, MAX); + if (rm == null) rm = ROUNDING_MODE; + else intCheck(rm, 0, 8); + + return round(new BigNumber(x), dp + x.e + 1, rm); + } + + if (!(c = x.c)) return null; + n = ((v = c.length - 1) - bitFloor(this.e / LOG_BASE)) * LOG_BASE; + + // Subtract the number of trailing zeros of the last number. + if (v = c[v]) for (; v % 10 == 0; v /= 10, n--); + if (n < 0) n = 0; + + return n; + }; + + + /* + * n / 0 = I + * n / N = N + * n / I = 0 + * 0 / n = 0 + * 0 / 0 = N + * 0 / N = N + * 0 / I = 0 + * N / n = N + * N / 0 = N + * N / N = N + * N / I = N + * I / n = I + * I / 0 = I + * I / N = N + * I / I = N + * + * Return a new BigNumber whose value is the value of this BigNumber divided by the value of + * BigNumber(y, b), rounded according to DECIMAL_PLACES and ROUNDING_MODE. + */ + P.dividedBy = P.div = function (y, b) { + return div(this, new BigNumber(y, b), DECIMAL_PLACES, ROUNDING_MODE); + }; + + + /* + * Return a new BigNumber whose value is the integer part of dividing the value of this + * BigNumber by the value of BigNumber(y, b). + */ + P.dividedToIntegerBy = P.idiv = function (y, b) { + return div(this, new BigNumber(y, b), 0, 1); + }; + + + /* + * Return a BigNumber whose value is the value of this BigNumber exponentiated by n. + * + * If m is present, return the result modulo m. + * If n is negative round according to DECIMAL_PLACES and ROUNDING_MODE. + * If POW_PRECISION is non-zero and m is not present, round to POW_PRECISION using ROUNDING_MODE. + * + * The modular power operation works efficiently when x, n, and m are integers, otherwise it + * is equivalent to calculating x.exponentiatedBy(n).modulo(m) with a POW_PRECISION of 0. + * + * n {number|string|BigNumber} The exponent. An integer. + * [m] {number|string|BigNumber} The modulus. + * + * '[BigNumber Error] Exponent not an integer: {n}' + */ + P.exponentiatedBy = P.pow = function (n, m) { + var half, isModExp, k, more, nIsBig, nIsNeg, nIsOdd, y, + x = this; + + n = new BigNumber(n); + + // Allow NaN and ±Infinity, but not other non-integers. + if (n.c && !n.isInteger()) { + throw Error + (bignumberError + 'Exponent not an integer: ' + n); + } + + if (m != null) m = new BigNumber(m); + + // Exponent of MAX_SAFE_INTEGER is 15. + nIsBig = n.e > 14; + + // If x is NaN, ±Infinity, ±0 or ±1, or n is ±Infinity, NaN or ±0. + if (!x.c || !x.c[0] || x.c[0] == 1 && !x.e && x.c.length == 1 || !n.c || !n.c[0]) { + + // The sign of the result of pow when x is negative depends on the evenness of n. + // If +n overflows to ±Infinity, the evenness of n would be not be known. + y = new BigNumber(Math.pow(+x.valueOf(), nIsBig ? 2 - isOdd(n) : +n)); + return m ? y.mod(m) : y; + } + + nIsNeg = n.s < 0; + + if (m) { + + // x % m returns NaN if abs(m) is zero, or m is NaN. + if (m.c ? !m.c[0] : !m.s) return new BigNumber(NaN); + + isModExp = !nIsNeg && x.isInteger() && m.isInteger(); + + if (isModExp) x = x.mod(m); + + // Overflow to ±Infinity: >=2**1e10 or >=1.0000024**1e15. + // Underflow to ±0: <=0.79**1e10 or <=0.9999975**1e15. + } else if (n.e > 9 && (x.e > 0 || x.e < -1 || (x.e == 0 + // [1, 240000000] + ? x.c[0] > 1 || nIsBig && x.c[1] >= 24e7 + // [80000000000000] [99999750000000] + : x.c[0] < 8e13 || nIsBig && x.c[0] <= 9999975e7))) { + + // If x is negative and n is odd, k = -0, else k = 0. + k = x.s < 0 && isOdd(n) ? -0 : 0; + + // If x >= 1, k = ±Infinity. + if (x.e > -1) k = 1 / k; + + // If n is negative return ±0, else return ±Infinity. + return new BigNumber(nIsNeg ? 1 / k : k); + + } else if (POW_PRECISION) { + + // Truncating each coefficient array to a length of k after each multiplication + // equates to truncating significant digits to POW_PRECISION + [28, 41], + // i.e. there will be a minimum of 28 guard digits retained. + k = mathceil(POW_PRECISION / LOG_BASE + 2); + } + + if (nIsBig) { + half = new BigNumber(0.5); + nIsOdd = isOdd(n); + } else { + nIsOdd = n % 2; + } + + if (nIsNeg) n.s = 1; + + y = new BigNumber(ONE); + + // Performs 54 loop iterations for n of 9007199254740991. + for (; ;) { + + if (nIsOdd) { + y = y.times(x); + if (!y.c) break; + + if (k) { + if (y.c.length > k) y.c.length = k; + } else if (isModExp) { + y = y.mod(m); //y = y.minus(div(y, m, 0, MODULO_MODE).times(m)); + } + } + + if (nIsBig) { + n = n.times(half); + round(n, n.e + 1, 1); + if (!n.c[0]) break; + nIsBig = n.e > 14; + nIsOdd = isOdd(n); + } else { + n = mathfloor(n / 2); + if (!n) break; + nIsOdd = n % 2; + } + + x = x.times(x); + + if (k) { + if (x.c && x.c.length > k) x.c.length = k; + } else if (isModExp) { + x = x.mod(m); //x = x.minus(div(x, m, 0, MODULO_MODE).times(m)); + } + } + + if (isModExp) return y; + if (nIsNeg) y = ONE.div(y); + + return m ? y.mod(m) : k ? round(y, POW_PRECISION, ROUNDING_MODE, more) : y; + }; + + + /* + * Return a new BigNumber whose value is the value of this BigNumber rounded to an integer + * using rounding mode rm, or ROUNDING_MODE if rm is omitted. + * + * [rm] {number} Rounding mode. Integer, 0 to 8 inclusive. + * + * '[BigNumber Error] Argument {not a primitive number|not an integer|out of range}: {rm}' + */ + P.integerValue = function (rm) { + var n = new BigNumber(this); + if (rm == null) rm = ROUNDING_MODE; + else intCheck(rm, 0, 8); + return round(n, n.e + 1, rm); + }; + + + /* + * Return true if the value of this BigNumber is equal to the value of BigNumber(y, b), + * otherwise return false. + */ + P.isEqualTo = P.eq = function (y, b) { + return compare(this, new BigNumber(y, b)) === 0; + }; + + + /* + * Return true if the value of this BigNumber is a finite number, otherwise return false. + */ + P.isFinite = function () { + return !!this.c; + }; + + + /* + * Return true if the value of this BigNumber is greater than the value of BigNumber(y, b), + * otherwise return false. + */ + P.isGreaterThan = P.gt = function (y, b) { + return compare(this, new BigNumber(y, b)) > 0; + }; + + + /* + * Return true if the value of this BigNumber is greater than or equal to the value of + * BigNumber(y, b), otherwise return false. + */ + P.isGreaterThanOrEqualTo = P.gte = function (y, b) { + return (b = compare(this, new BigNumber(y, b))) === 1 || b === 0; + + }; + + + /* + * Return true if the value of this BigNumber is an integer, otherwise return false. + */ + P.isInteger = function () { + return !!this.c && bitFloor(this.e / LOG_BASE) > this.c.length - 2; + }; + + + /* + * Return true if the value of this BigNumber is less than the value of BigNumber(y, b), + * otherwise return false. + */ + P.isLessThan = P.lt = function (y, b) { + return compare(this, new BigNumber(y, b)) < 0; + }; + + + /* + * Return true if the value of this BigNumber is less than or equal to the value of + * BigNumber(y, b), otherwise return false. + */ + P.isLessThanOrEqualTo = P.lte = function (y, b) { + return (b = compare(this, new BigNumber(y, b))) === -1 || b === 0; + }; + + + /* + * Return true if the value of this BigNumber is NaN, otherwise return false. + */ + P.isNaN = function () { + return !this.s; + }; + + + /* + * Return true if the value of this BigNumber is negative, otherwise return false. + */ + P.isNegative = function () { + return this.s < 0; + }; + + + /* + * Return true if the value of this BigNumber is positive, otherwise return false. + */ + P.isPositive = function () { + return this.s > 0; + }; + + + /* + * Return true if the value of this BigNumber is 0 or -0, otherwise return false. + */ + P.isZero = function () { + return !!this.c && this.c[0] == 0; + }; + + + /* + * n - 0 = n + * n - N = N + * n - I = -I + * 0 - n = -n + * 0 - 0 = 0 + * 0 - N = N + * 0 - I = -I + * N - n = N + * N - 0 = N + * N - N = N + * N - I = N + * I - n = I + * I - 0 = I + * I - N = N + * I - I = N + * + * Return a new BigNumber whose value is the value of this BigNumber minus the value of + * BigNumber(y, b). + */ + P.minus = function (y, b) { + var i, j, t, xLTy, + x = this, + a = x.s; + + y = new BigNumber(y, b); + b = y.s; + + // Either NaN? + if (!a || !b) return new BigNumber(NaN); + + // Signs differ? + if (a != b) { + y.s = -b; + return x.plus(y); + } + + var xe = x.e / LOG_BASE, + ye = y.e / LOG_BASE, + xc = x.c, + yc = y.c; + + if (!xe || !ye) { + + // Either Infinity? + if (!xc || !yc) return xc ? (y.s = -b, y) : new BigNumber(yc ? x : NaN); + + // Either zero? + if (!xc[0] || !yc[0]) { + + // Return y if y is non-zero, x if x is non-zero, or zero if both are zero. + return yc[0] ? (y.s = -b, y) : new BigNumber(xc[0] ? x : + + // IEEE 754 (2008) 6.3: n - n = -0 when rounding to -Infinity + ROUNDING_MODE == 3 ? -0 : 0); + } + } + + xe = bitFloor(xe); + ye = bitFloor(ye); + xc = xc.slice(); + + // Determine which is the bigger number. + if (a = xe - ye) { + + if (xLTy = a < 0) { + a = -a; + t = xc; + } else { + ye = xe; + t = yc; + } + + t.reverse(); + + // Prepend zeros to equalise exponents. + for (b = a; b--; t.push(0)); + t.reverse(); + } else { + + // Exponents equal. Check digit by digit. + j = (xLTy = (a = xc.length) < (b = yc.length)) ? a : b; + + for (a = b = 0; b < j; b++) { + + if (xc[b] != yc[b]) { + xLTy = xc[b] < yc[b]; + break; + } + } + } + + // x < y? Point xc to the array of the bigger number. + if (xLTy) t = xc, xc = yc, yc = t, y.s = -y.s; + + b = (j = yc.length) - (i = xc.length); + + // Append zeros to xc if shorter. + // No need to add zeros to yc if shorter as subtract only needs to start at yc.length. + if (b > 0) for (; b--; xc[i++] = 0); + b = BASE - 1; + + // Subtract yc from xc. + for (; j > a;) { + + if (xc[--j] < yc[j]) { + for (i = j; i && !xc[--i]; xc[i] = b); + --xc[i]; + xc[j] += BASE; + } + + xc[j] -= yc[j]; + } + + // Remove leading zeros and adjust exponent accordingly. + for (; xc[0] == 0; xc.splice(0, 1), --ye); + + // Zero? + if (!xc[0]) { + + // Following IEEE 754 (2008) 6.3, + // n - n = +0 but n - n = -0 when rounding towards -Infinity. + y.s = ROUNDING_MODE == 3 ? -1 : 1; + y.c = [y.e = 0]; + return y; + } + + // No need to check for Infinity as +x - +y != Infinity && -x - -y != Infinity + // for finite x and y. + return normalise(y, xc, ye); + }; + + + /* + * n % 0 = N + * n % N = N + * n % I = n + * 0 % n = 0 + * -0 % n = -0 + * 0 % 0 = N + * 0 % N = N + * 0 % I = 0 + * N % n = N + * N % 0 = N + * N % N = N + * N % I = N + * I % n = N + * I % 0 = N + * I % N = N + * I % I = N + * + * Return a new BigNumber whose value is the value of this BigNumber modulo the value of + * BigNumber(y, b). The result depends on the value of MODULO_MODE. + */ + P.modulo = P.mod = function (y, b) { + var q, s, + x = this; + + y = new BigNumber(y, b); + + // Return NaN if x is Infinity or NaN, or y is NaN or zero. + if (!x.c || !y.s || y.c && !y.c[0]) { + return new BigNumber(NaN); + + // Return x if y is Infinity or x is zero. + } else if (!y.c || x.c && !x.c[0]) { + return new BigNumber(x); + } + + if (MODULO_MODE == 9) { + + // Euclidian division: q = sign(y) * floor(x / abs(y)) + // r = x - qy where 0 <= r < abs(y) + s = y.s; + y.s = 1; + q = div(x, y, 0, 3); + y.s = s; + q.s *= s; + } else { + q = div(x, y, 0, MODULO_MODE); + } + + y = x.minus(q.times(y)); + + // To match JavaScript %, ensure sign of zero is sign of dividend. + if (!y.c[0] && MODULO_MODE == 1) y.s = x.s; + + return y; + }; + + + /* + * n * 0 = 0 + * n * N = N + * n * I = I + * 0 * n = 0 + * 0 * 0 = 0 + * 0 * N = N + * 0 * I = N + * N * n = N + * N * 0 = N + * N * N = N + * N * I = N + * I * n = I + * I * 0 = N + * I * N = N + * I * I = I + * + * Return a new BigNumber whose value is the value of this BigNumber multiplied by the value + * of BigNumber(y, b). + */ + P.multipliedBy = P.times = function (y, b) { + var c, e, i, j, k, m, xcL, xlo, xhi, ycL, ylo, yhi, zc, + base, sqrtBase, + x = this, + xc = x.c, + yc = (y = new BigNumber(y, b)).c; + + // Either NaN, ±Infinity or ±0? + if (!xc || !yc || !xc[0] || !yc[0]) { + + // Return NaN if either is NaN, or one is 0 and the other is Infinity. + if (!x.s || !y.s || xc && !xc[0] && !yc || yc && !yc[0] && !xc) { + y.c = y.e = y.s = null; + } else { + y.s *= x.s; + + // Return ±Infinity if either is ±Infinity. + if (!xc || !yc) { + y.c = y.e = null; + + // Return ±0 if either is ±0. + } else { + y.c = [0]; + y.e = 0; + } + } + + return y; + } + + e = bitFloor(x.e / LOG_BASE) + bitFloor(y.e / LOG_BASE); + y.s *= x.s; + xcL = xc.length; + ycL = yc.length; + + // Ensure xc points to longer array and xcL to its length. + if (xcL < ycL) zc = xc, xc = yc, yc = zc, i = xcL, xcL = ycL, ycL = i; + + // Initialise the result array with zeros. + for (i = xcL + ycL, zc = []; i--; zc.push(0)); + + base = BASE; + sqrtBase = SQRT_BASE; + + for (i = ycL; --i >= 0;) { + c = 0; + ylo = yc[i] % sqrtBase; + yhi = yc[i] / sqrtBase | 0; + + for (k = xcL, j = i + k; j > i;) { + xlo = xc[--k] % sqrtBase; + xhi = xc[k] / sqrtBase | 0; + m = yhi * xlo + xhi * ylo; + xlo = ylo * xlo + ((m % sqrtBase) * sqrtBase) + zc[j] + c; + c = (xlo / base | 0) + (m / sqrtBase | 0) + yhi * xhi; + zc[j--] = xlo % base; + } + + zc[j] = c; + } + + if (c) { + ++e; + } else { + zc.splice(0, 1); + } + + return normalise(y, zc, e); + }; + + + /* + * Return a new BigNumber whose value is the value of this BigNumber negated, + * i.e. multiplied by -1. + */ + P.negated = function () { + var x = new BigNumber(this); + x.s = -x.s || null; + return x; + }; + + + /* + * n + 0 = n + * n + N = N + * n + I = I + * 0 + n = n + * 0 + 0 = 0 + * 0 + N = N + * 0 + I = I + * N + n = N + * N + 0 = N + * N + N = N + * N + I = N + * I + n = I + * I + 0 = I + * I + N = N + * I + I = I + * + * Return a new BigNumber whose value is the value of this BigNumber plus the value of + * BigNumber(y, b). + */ + P.plus = function (y, b) { + var t, + x = this, + a = x.s; + + y = new BigNumber(y, b); + b = y.s; + + // Either NaN? + if (!a || !b) return new BigNumber(NaN); + + // Signs differ? + if (a != b) { + y.s = -b; + return x.minus(y); + } + + var xe = x.e / LOG_BASE, + ye = y.e / LOG_BASE, + xc = x.c, + yc = y.c; + + if (!xe || !ye) { + + // Return ±Infinity if either ±Infinity. + if (!xc || !yc) return new BigNumber(a / 0); + + // Either zero? + // Return y if y is non-zero, x if x is non-zero, or zero if both are zero. + if (!xc[0] || !yc[0]) return yc[0] ? y : new BigNumber(xc[0] ? x : a * 0); + } + + xe = bitFloor(xe); + ye = bitFloor(ye); + xc = xc.slice(); + + // Prepend zeros to equalise exponents. Faster to use reverse then do unshifts. + if (a = xe - ye) { + if (a > 0) { + ye = xe; + t = yc; + } else { + a = -a; + t = xc; + } + + t.reverse(); + for (; a--; t.push(0)); + t.reverse(); + } + + a = xc.length; + b = yc.length; + + // Point xc to the longer array, and b to the shorter length. + if (a - b < 0) t = yc, yc = xc, xc = t, b = a; + + // Only start adding at yc.length - 1 as the further digits of xc can be ignored. + for (a = 0; b;) { + a = (xc[--b] = xc[b] + yc[b] + a) / BASE | 0; + xc[b] = BASE === xc[b] ? 0 : xc[b] % BASE; + } + + if (a) { + xc = [a].concat(xc); + ++ye; + } + + // No need to check for zero, as +x + +y != 0 && -x + -y != 0 + // ye = MAX_EXP + 1 possible + return normalise(y, xc, ye); + }; + + + /* + * If sd is undefined or null or true or false, return the number of significant digits of + * the value of this BigNumber, or null if the value of this BigNumber is ±Infinity or NaN. + * If sd is true include integer-part trailing zeros in the count. + * + * Otherwise, if sd is a number, return a new BigNumber whose value is the value of this + * BigNumber rounded to a maximum of sd significant digits using rounding mode rm, or + * ROUNDING_MODE if rm is omitted. + * + * sd {number|boolean} number: significant digits: integer, 1 to MAX inclusive. + * boolean: whether to count integer-part trailing zeros: true or false. + * [rm] {number} Rounding mode. Integer, 0 to 8 inclusive. + * + * '[BigNumber Error] Argument {not a primitive number|not an integer|out of range}: {sd|rm}' + */ + P.precision = P.sd = function (sd, rm) { + var c, n, v, + x = this; + + if (sd != null && sd !== !!sd) { + intCheck(sd, 1, MAX); + if (rm == null) rm = ROUNDING_MODE; + else intCheck(rm, 0, 8); + + return round(new BigNumber(x), sd, rm); + } + + if (!(c = x.c)) return null; + v = c.length - 1; + n = v * LOG_BASE + 1; + + if (v = c[v]) { + + // Subtract the number of trailing zeros of the last element. + for (; v % 10 == 0; v /= 10, n--); + + // Add the number of digits of the first element. + for (v = c[0]; v >= 10; v /= 10, n++); + } + + if (sd && x.e + 1 > n) n = x.e + 1; + + return n; + }; + + + /* + * Return a new BigNumber whose value is the value of this BigNumber shifted by k places + * (powers of 10). Shift to the right if n > 0, and to the left if n < 0. + * + * k {number} Integer, -MAX_SAFE_INTEGER to MAX_SAFE_INTEGER inclusive. + * + * '[BigNumber Error] Argument {not a primitive number|not an integer|out of range}: {k}' + */ + P.shiftedBy = function (k) { + intCheck(k, -MAX_SAFE_INTEGER, MAX_SAFE_INTEGER); + return this.times('1e' + k); + }; + + + /* + * sqrt(-n) = N + * sqrt(N) = N + * sqrt(-I) = N + * sqrt(I) = I + * sqrt(0) = 0 + * sqrt(-0) = -0 + * + * Return a new BigNumber whose value is the square root of the value of this BigNumber, + * rounded according to DECIMAL_PLACES and ROUNDING_MODE. + */ + P.squareRoot = P.sqrt = function () { + var m, n, r, rep, t, + x = this, + c = x.c, + s = x.s, + e = x.e, + dp = DECIMAL_PLACES + 4, + half = new BigNumber('0.5'); + + // Negative/NaN/Infinity/zero? + if (s !== 1 || !c || !c[0]) { + return new BigNumber(!s || s < 0 && (!c || c[0]) ? NaN : c ? x : 1 / 0); + } + + // Initial estimate. + s = Math.sqrt(+x); + + // Math.sqrt underflow/overflow? + // Pass x to Math.sqrt as integer, then adjust the exponent of the result. + if (s == 0 || s == 1 / 0) { + n = coeffToString(c); + if ((n.length + e) % 2 == 0) n += '0'; + s = Math.sqrt(n); + e = bitFloor((e + 1) / 2) - (e < 0 || e % 2); + + if (s == 1 / 0) { + n = '1e' + e; + } else { + n = s.toExponential(); + n = n.slice(0, n.indexOf('e') + 1) + e; + } + + r = new BigNumber(n); + } else { + r = new BigNumber(s + ''); + } + + // Check for zero. + // r could be zero if MIN_EXP is changed after the this value was created. + // This would cause a division by zero (x/t) and hence Infinity below, which would cause + // coeffToString to throw. + if (r.c[0]) { + e = r.e; + s = e + dp; + if (s < 3) s = 0; + + // Newton-Raphson iteration. + for (; ;) { + t = r; + r = half.times(t.plus(div(x, t, dp, 1))); + + if (coeffToString(t.c ).slice(0, s) === (n = + coeffToString(r.c)).slice(0, s)) { + + // The exponent of r may here be one less than the final result exponent, + // e.g 0.0009999 (e-4) --> 0.001 (e-3), so adjust s so the rounding digits + // are indexed correctly. + if (r.e < e) --s; + n = n.slice(s - 3, s + 1); + + // The 4th rounding digit may be in error by -1 so if the 4 rounding digits + // are 9999 or 4999 (i.e. approaching a rounding boundary) continue the + // iteration. + if (n == '9999' || !rep && n == '4999') { + + // On the first iteration only, check to see if rounding up gives the + // exact result as the nines may infinitely repeat. + if (!rep) { + round(t, t.e + DECIMAL_PLACES + 2, 0); + + if (t.times(t).eq(x)) { + r = t; + break; + } + } + + dp += 4; + s += 4; + rep = 1; + } else { + + // If rounding digits are null, 0{0,4} or 50{0,3}, check for exact + // result. If not, then there are further digits and m will be truthy. + if (!+n || !+n.slice(1) && n.charAt(0) == '5') { + + // Truncate to the first rounding digit. + round(r, r.e + DECIMAL_PLACES + 2, 1); + m = !r.times(r).eq(x); + } + + break; + } + } + } + } + + return round(r, r.e + DECIMAL_PLACES + 1, ROUNDING_MODE, m); + }; + + + /* + * Return a string representing the value of this BigNumber in exponential notation and + * rounded using ROUNDING_MODE to dp fixed decimal places. + * + * [dp] {number} Decimal places. Integer, 0 to MAX inclusive. + * [rm] {number} Rounding mode. Integer, 0 to 8 inclusive. + * + * '[BigNumber Error] Argument {not a primitive number|not an integer|out of range}: {dp|rm}' + */ + P.toExponential = function (dp, rm) { + if (dp != null) { + intCheck(dp, 0, MAX); + dp++; + } + return format(this, dp, rm, 1); + }; + + + /* + * Return a string representing the value of this BigNumber in fixed-point notation rounding + * to dp fixed decimal places using rounding mode rm, or ROUNDING_MODE if rm is omitted. + * + * Note: as with JavaScript's number type, (-0).toFixed(0) is '0', + * but e.g. (-0.00001).toFixed(0) is '-0'. + * + * [dp] {number} Decimal places. Integer, 0 to MAX inclusive. + * [rm] {number} Rounding mode. Integer, 0 to 8 inclusive. + * + * '[BigNumber Error] Argument {not a primitive number|not an integer|out of range}: {dp|rm}' + */ + P.toFixed = function (dp, rm) { + if (dp != null) { + intCheck(dp, 0, MAX); + dp = dp + this.e + 1; + } + return format(this, dp, rm); + }; + + + /* + * Return a string representing the value of this BigNumber in fixed-point notation rounded + * using rm or ROUNDING_MODE to dp decimal places, and formatted according to the properties + * of the FORMAT object (see BigNumber.set). + * + * FORMAT = { + * decimalSeparator : '.', + * groupSeparator : ',', + * groupSize : 3, + * secondaryGroupSize : 0, + * fractionGroupSeparator : '\xA0', // non-breaking space + * fractionGroupSize : 0 + * }; + * + * [dp] {number} Decimal places. Integer, 0 to MAX inclusive. + * [rm] {number} Rounding mode. Integer, 0 to 8 inclusive. + * + * '[BigNumber Error] Argument {not a primitive number|not an integer|out of range}: {dp|rm}' + */ + P.toFormat = function (dp, rm) { + var str = this.toFixed(dp, rm); + + if (this.c) { + var i, + arr = str.split('.'), + g1 = +FORMAT.groupSize, + g2 = +FORMAT.secondaryGroupSize, + groupSeparator = FORMAT.groupSeparator, + intPart = arr[0], + fractionPart = arr[1], + isNeg = this.s < 0, + intDigits = isNeg ? intPart.slice(1) : intPart, + len = intDigits.length; + + if (g2) i = g1, g1 = g2, g2 = i, len -= i; + + if (g1 > 0 && len > 0) { + i = len % g1 || g1; + intPart = intDigits.substr(0, i); + + for (; i < len; i += g1) { + intPart += groupSeparator + intDigits.substr(i, g1); + } + + if (g2 > 0) intPart += groupSeparator + intDigits.slice(i); + if (isNeg) intPart = '-' + intPart; + } + + str = fractionPart + ? intPart + FORMAT.decimalSeparator + ((g2 = +FORMAT.fractionGroupSize) + ? fractionPart.replace(new RegExp('\\d{' + g2 + '}\\B', 'g'), + '$&' + FORMAT.fractionGroupSeparator) + : fractionPart) + : intPart; + } + + return str; + }; + + + /* + * Return a string array representing the value of this BigNumber as a simple fraction with + * an integer numerator and an integer denominator. The denominator will be a positive + * non-zero value less than or equal to the specified maximum denominator. If a maximum + * denominator is not specified, the denominator will be the lowest value necessary to + * represent the number exactly. + * + * [md] {number|string|BigNumber} Integer >= 1, or Infinity. The maximum denominator. + * + * '[BigNumber Error] Argument {not an integer|out of range} : {md}' + */ + P.toFraction = function (md) { + var arr, d, d0, d1, d2, e, exp, n, n0, n1, q, s, + x = this, + xc = x.c; + + if (md != null) { + n = new BigNumber(md); + + // Throw if md is less than one or is not an integer, unless it is Infinity. + if (!n.isInteger() && (n.c || n.s !== 1) || n.lt(ONE)) { + throw Error + (bignumberError + 'Argument ' + + (n.isInteger() ? 'out of range: ' : 'not an integer: ') + md); + } + } + + if (!xc) return x.toString(); + + d = new BigNumber(ONE); + n1 = d0 = new BigNumber(ONE); + d1 = n0 = new BigNumber(ONE); + s = coeffToString(xc); + + // Determine initial denominator. + // d is a power of 10 and the minimum max denominator that specifies the value exactly. + e = d.e = s.length - x.e - 1; + d.c[0] = POWS_TEN[(exp = e % LOG_BASE) < 0 ? LOG_BASE + exp : exp]; + md = !md || n.comparedTo(d) > 0 ? (e > 0 ? d : n1) : n; + + exp = MAX_EXP; + MAX_EXP = 1 / 0; + n = new BigNumber(s); + + // n0 = d1 = 0 + n0.c[0] = 0; + + for (; ;) { + q = div(n, d, 0, 1); + d2 = d0.plus(q.times(d1)); + if (d2.comparedTo(md) == 1) break; + d0 = d1; + d1 = d2; + n1 = n0.plus(q.times(d2 = n1)); + n0 = d2; + d = n.minus(q.times(d2 = d)); + n = d2; + } + + d2 = div(md.minus(d0), d1, 0, 1); + n0 = n0.plus(d2.times(n1)); + d0 = d0.plus(d2.times(d1)); + n0.s = n1.s = x.s; + e *= 2; + + // Determine which fraction is closer to x, n0/d0 or n1/d1 + arr = div(n1, d1, e, ROUNDING_MODE).minus(x).abs().comparedTo( + div(n0, d0, e, ROUNDING_MODE).minus(x).abs()) < 1 + ? [n1.toString(), d1.toString()] + : [n0.toString(), d0.toString()]; + + MAX_EXP = exp; + return arr; + }; + + + /* + * Return the value of this BigNumber converted to a number primitive. + */ + P.toNumber = function () { + return +this; + }; + + + /* + * Return a string representing the value of this BigNumber rounded to sd significant digits + * using rounding mode rm or ROUNDING_MODE. If sd is less than the number of digits + * necessary to represent the integer part of the value in fixed-point notation, then use + * exponential notation. + * + * [sd] {number} Significant digits. Integer, 1 to MAX inclusive. + * [rm] {number} Rounding mode. Integer, 0 to 8 inclusive. + * + * '[BigNumber Error] Argument {not a primitive number|not an integer|out of range}: {sd|rm}' + */ + P.toPrecision = function (sd, rm) { + if (sd != null) intCheck(sd, 1, MAX); + return format(this, sd, rm, 2); + }; + + + /* + * Return a string representing the value of this BigNumber in base b, or base 10 if b is + * omitted. If a base is specified, including base 10, round according to DECIMAL_PLACES and + * ROUNDING_MODE. If a base is not specified, and this BigNumber has a positive exponent + * that is equal to or greater than TO_EXP_POS, or a negative exponent equal to or less than + * TO_EXP_NEG, return exponential notation. + * + * [b] {number} Integer, 2 to ALPHABET.length inclusive. + * + * '[BigNumber Error] Base {not a primitive number|not an integer|out of range}: {b}' + */ + P.toString = function (b) { + var str, + n = this, + s = n.s, + e = n.e; + + // Infinity or NaN? + if (e === null) { + + if (s) { + str = 'Infinity'; + if (s < 0) str = '-' + str; + } else { + str = 'NaN'; + } + } else { + str = coeffToString(n.c); + + if (b == null) { + str = e <= TO_EXP_NEG || e >= TO_EXP_POS + ? toExponential(str, e) + : toFixedPoint(str, e, '0'); + } else { + intCheck(b, 2, ALPHABET.length, 'Base'); + str = convertBase(toFixedPoint(str, e, '0'), 10, b, s, true); + } + + if (s < 0 && n.c[0]) str = '-' + str; + } + + return str; + }; + + + /* + * Return as toString, but do not accept a base argument, and include the minus sign for + * negative zero. + */ + P.valueOf = P.toJSON = function () { + var str, + n = this, + e = n.e; + + if (e === null) return n.toString(); + + str = coeffToString(n.c); + + str = e <= TO_EXP_NEG || e >= TO_EXP_POS + ? toExponential(str, e) + : toFixedPoint(str, e, '0'); + + return n.s < 0 ? '-' + str : str; + }; + + + P._isBigNumber = true; + + if (configObject != null) BigNumber.set(configObject); + + return BigNumber; + } + + + // PRIVATE HELPER FUNCTIONS + + + function bitFloor(n) { + var i = n | 0; + return n > 0 || n === i ? i : i - 1; + } + + + // Return a coefficient array as a string of base 10 digits. + function coeffToString(a) { + var s, z, + i = 1, + j = a.length, + r = a[0] + ''; + + for (; i < j;) { + s = a[i++] + ''; + z = LOG_BASE - s.length; + for (; z--; s = '0' + s); + r += s; + } + + // Determine trailing zeros. + for (j = r.length; r.charCodeAt(--j) === 48;); + return r.slice(0, j + 1 || 1); + } + + + // Compare the value of BigNumbers x and y. + function compare(x, y) { + var a, b, + xc = x.c, + yc = y.c, + i = x.s, + j = y.s, + k = x.e, + l = y.e; + + // Either NaN? + if (!i || !j) return null; + + a = xc && !xc[0]; + b = yc && !yc[0]; + + // Either zero? + if (a || b) return a ? b ? 0 : -j : i; + + // Signs differ? + if (i != j) return i; + + a = i < 0; + b = k == l; + + // Either Infinity? + if (!xc || !yc) return b ? 0 : !xc ^ a ? 1 : -1; + + // Compare exponents. + if (!b) return k > l ^ a ? 1 : -1; + + j = (k = xc.length) < (l = yc.length) ? k : l; + + // Compare digit by digit. + for (i = 0; i < j; i++) if (xc[i] != yc[i]) return xc[i] > yc[i] ^ a ? 1 : -1; + + // Compare lengths. + return k == l ? 0 : k > l ^ a ? 1 : -1; + } + + + /* + * Check that n is a primitive number, an integer, and in range, otherwise throw. + */ + function intCheck(n, min, max, name) { + if (n < min || n > max || n !== (n < 0 ? mathceil(n) : mathfloor(n))) { + throw Error + (bignumberError + (name || 'Argument') + (typeof n == 'number' + ? n < min || n > max ? ' out of range: ' : ' not an integer: ' + : ' not a primitive number: ') + n); + } + } + + + function isArray(obj) { + return Object.prototype.toString.call(obj) == '[object Array]'; + } + + + // Assumes finite n. + function isOdd(n) { + var k = n.c.length - 1; + return bitFloor(n.e / LOG_BASE) == k && n.c[k] % 2 != 0; + } + + + function toExponential(str, e) { + return (str.length > 1 ? str.charAt(0) + '.' + str.slice(1) : str) + + (e < 0 ? 'e' : 'e+') + e; + } + + + function toFixedPoint(str, e, z) { + var len, zs; + + // Negative exponent? + if (e < 0) { + + // Prepend zeros. + for (zs = z + '.'; ++e; zs += z); + str = zs + str; + + // Positive exponent + } else { + len = str.length; + + // Append zeros. + if (++e > len) { + for (zs = z, e -= len; --e; zs += z); + str += zs; + } else if (e < len) { + str = str.slice(0, e) + '.' + str.slice(e); + } + } + + return str; + } + + + // EXPORT + + + BigNumber = clone(); + BigNumber['default'] = BigNumber.BigNumber = BigNumber; + + // AMD. + if (typeof undefined == 'function' && undefined.amd) { + undefined(function () { return BigNumber; }); + + // Node.js and other environments that support module.exports. + } else if ('object' != 'undefined' && module.exports) { + module.exports = BigNumber; + + // Browser. + } else { + if (!globalObject) { + globalObject = typeof self != 'undefined' && self ? self : window; + } + + globalObject.BigNumber = BigNumber; + } +})(commonjsGlobal); +}); + +var constants = createCommonjsModule(function (module, exports) { +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +class Constants { +} +Constants.SYS_NUM_CARDINAL = "builtin.num.cardinal"; +Constants.SYS_NUM_DOUBLE = "builtin.num.double"; +Constants.SYS_NUM_FRACTION = "builtin.num.fraction"; +Constants.SYS_NUM_INTEGER = "builtin.num.integer"; +Constants.SYS_NUM = "builtin.num"; +Constants.SYS_NUM_ORDINAL = "builtin.num.ordinal"; +Constants.SYS_NUM_PERCENTAGE = "builtin.num.percentage"; +// NARROW NO-BREAK SPACE +Constants.NO_BREAK_SPACE = '\u202f'; +exports.Constants = Constants; + +}); + +unwrapExports(constants); + +var models$2 = createCommonjsModule(function (module, exports) { +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); + +var NumberMode; +(function (NumberMode) { + // Default is for unit and datetime + NumberMode[NumberMode["Default"] = 0] = "Default"; + // Add 67.5 billion & million support. + NumberMode[NumberMode["Currency"] = 1] = "Currency"; + // Don't extract number from cases like 16ml + NumberMode[NumberMode["PureNumber"] = 2] = "PureNumber"; +})(NumberMode = exports.NumberMode || (exports.NumberMode = {})); +class LongFormatType { + constructor(thousandsMark, decimalsMark) { + this.thousandsMark = thousandsMark; + this.decimalsMark = decimalsMark; + } +} +// Reference : https://www.wikiwand.com/en/Decimal_mark +// Value : 1234567.89 +// 1,234,567 +LongFormatType.integerNumComma = new LongFormatType(',', '\0'); +// 1.234.567 +LongFormatType.integerNumDot = new LongFormatType('.', '\0'); +// 1 234 567 +LongFormatType.integerNumBlank = new LongFormatType(' ', '\0'); +// 1 234 567 +LongFormatType.integerNumNoBreakSpace = new LongFormatType(constants.Constants.NO_BREAK_SPACE, '\0'); +// 1'234'567 +LongFormatType.integerNumQuote = new LongFormatType('\'', '\0'); +// 1,234,567.89 +LongFormatType.doubleNumCommaDot = new LongFormatType(',', '.'); +// 1,234,567·89 +LongFormatType.doubleNumCommaCdot = new LongFormatType(',', '·'); +// 1 234 567,89 +LongFormatType.doubleNumBlankComma = new LongFormatType(' ', ','); +// 1 234 567,89 +LongFormatType.doubleNumNoBreakSpaceComma = new LongFormatType(constants.Constants.NO_BREAK_SPACE, ','); +// 1 234 567.89 +LongFormatType.doubleNumBlankDot = new LongFormatType(' ', '.'); +// 1 234 567.89 +LongFormatType.doubleNumNoBreakSpaceDot = new LongFormatType(constants.Constants.NO_BREAK_SPACE, '.'); +// 1.234.567,89 +LongFormatType.doubleNumDotComma = new LongFormatType('.', ','); +// 1'234'567,89 +LongFormatType.doubleNumQuoteComma = new LongFormatType('\'', ','); +exports.LongFormatType = LongFormatType; +class AbstractNumberModel { + constructor(parser, extractor) { + this.extractor = extractor; + this.parser = parser; + } + parse(query) { + let extractResults = this.extractor.extract(query); + let parseNums = extractResults.map(r => this.parser.parse(r)); + return parseNums + .map(o => o) + .map(o => ({ + start: o.start, + end: o.start + o.length - 1, + resolution: { value: o.resolutionStr }, + text: o.text, + typeName: this.modelTypeName + })); + } +} +exports.AbstractNumberModel = AbstractNumberModel; +class NumberModel extends AbstractNumberModel { + constructor() { + super(...arguments); + this.modelTypeName = "number"; + } +} +exports.NumberModel = NumberModel; +class OrdinalModel extends AbstractNumberModel { + constructor() { + super(...arguments); + this.modelTypeName = "ordinal"; + } +} +exports.OrdinalModel = OrdinalModel; +class PercentModel extends AbstractNumberModel { + constructor() { + super(...arguments); + this.modelTypeName = "percentage"; + } +} +exports.PercentModel = PercentModel; + +}); + +unwrapExports(models$2); + +var culture$2 = createCommonjsModule(function (module, exports) { +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); + + + + +class Culture extends recognizersText.Culture { + constructor(cultureName, cultureCode, longFormat) { + super(cultureName, cultureCode); + this.longFormat = longFormat; + } +} +Culture.supportedCultures = [ + new Culture("English", Culture.English, new models$2.LongFormatType(',', '.')), + new Culture("Chinese", Culture.Chinese, null), + new Culture("Spanish", Culture.Spanish, new models$2.LongFormatType('.', ',')), + new Culture("Portuguese", Culture.Portuguese, new models$2.LongFormatType('.', ',')), + new Culture("French", Culture.French, new models$2.LongFormatType('.', ',')), + new Culture("Japanese", Culture.Japanese, new models$2.LongFormatType(',', '.')) +]; +exports.Culture = Culture; +class CultureInfo extends recognizersText.CultureInfo { + format(value) { + let bigNumber = new bignumber.BigNumber(value); + let s; + if (bigNumber.decimalPlaces()) { + s = bigNumber.precision(15, bignumber.BigNumber.ROUND_HALF_UP).toString(); + } + else { + s = bigNumber.toString().toUpperCase(); + } + if (s.indexOf('.') > -1) { + // trim leading 0 from decimal places + s = lodash_trimend(s, '0'); + } + if (s.indexOf('e-') > -1) { + // mimic .NET behavior by adding leading 0 to exponential. E.g.: 1E-07 + let p = s.split('e-'); + p[1] = p[1].length === 1 ? ('0' + p[1]) : p[1]; + s = p.join('E-'); + } + // TODO: Use BigNumber.toFormat instead + let culture = Culture.supportedCultures.find(c => c.cultureCode === this.code); + if (culture && culture.longFormat) { + return s + .split(',') + .map(t => t.split('.').join(culture.longFormat.decimalsMark)) + .join(culture.longFormat.thousandsMark); + } + return s; + } +} +exports.CultureInfo = CultureInfo; + +}); + +unwrapExports(culture$2); + +var lodash_sortby = createCommonjsModule(function (module, exports) { +/** + * lodash (Custom Build) + * Build: `lodash modularize exports="npm" -o ./` + * Copyright jQuery Foundation and other contributors + * Released under MIT license + * Based on Underscore.js 1.8.3 + * Copyright Jeremy Ashkenas, DocumentCloud and Investigative Reporters & Editors + */ + +/** Used as the size to enable large array optimizations. */ +var LARGE_ARRAY_SIZE = 200; + +/** Used as the `TypeError` message for "Functions" methods. */ +var FUNC_ERROR_TEXT = 'Expected a function'; + +/** Used to stand-in for `undefined` hash values. */ +var HASH_UNDEFINED = '__lodash_hash_undefined__'; + +/** Used to compose bitmasks for comparison styles. */ +var UNORDERED_COMPARE_FLAG = 1, + PARTIAL_COMPARE_FLAG = 2; + +/** Used as references for various `Number` constants. */ +var INFINITY = 1 / 0, + MAX_SAFE_INTEGER = 9007199254740991; + +/** `Object#toString` result references. */ +var argsTag = '[object Arguments]', + arrayTag = '[object Array]', + boolTag = '[object Boolean]', + dateTag = '[object Date]', + errorTag = '[object Error]', + funcTag = '[object Function]', + genTag = '[object GeneratorFunction]', + mapTag = '[object Map]', + numberTag = '[object Number]', + objectTag = '[object Object]', + promiseTag = '[object Promise]', + regexpTag = '[object RegExp]', + setTag = '[object Set]', + stringTag = '[object String]', + symbolTag = '[object Symbol]', + weakMapTag = '[object WeakMap]'; + +var arrayBufferTag = '[object ArrayBuffer]', + dataViewTag = '[object DataView]', + float32Tag = '[object Float32Array]', + float64Tag = '[object Float64Array]', + int8Tag = '[object Int8Array]', + int16Tag = '[object Int16Array]', + int32Tag = '[object Int32Array]', + uint8Tag = '[object Uint8Array]', + uint8ClampedTag = '[object Uint8ClampedArray]', + uint16Tag = '[object Uint16Array]', + uint32Tag = '[object Uint32Array]'; + +/** Used to match property names within property paths. */ +var reIsDeepProp = /\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/, + reIsPlainProp = /^\w*$/, + reLeadingDot = /^\./, + rePropName = /[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g; + +/** + * Used to match `RegExp` + * [syntax characters](http://ecma-international.org/ecma-262/7.0/#sec-patterns). + */ +var reRegExpChar = /[\\^$.*+?()[\]{}|]/g; + +/** Used to match backslashes in property paths. */ +var reEscapeChar = /\\(\\)?/g; + +/** Used to detect host constructors (Safari). */ +var reIsHostCtor = /^\[object .+?Constructor\]$/; + +/** Used to detect unsigned integer values. */ +var reIsUint = /^(?:0|[1-9]\d*)$/; + +/** Used to identify `toStringTag` values of typed arrays. */ +var typedArrayTags = {}; +typedArrayTags[float32Tag] = typedArrayTags[float64Tag] = +typedArrayTags[int8Tag] = typedArrayTags[int16Tag] = +typedArrayTags[int32Tag] = typedArrayTags[uint8Tag] = +typedArrayTags[uint8ClampedTag] = typedArrayTags[uint16Tag] = +typedArrayTags[uint32Tag] = true; +typedArrayTags[argsTag] = typedArrayTags[arrayTag] = +typedArrayTags[arrayBufferTag] = typedArrayTags[boolTag] = +typedArrayTags[dataViewTag] = typedArrayTags[dateTag] = +typedArrayTags[errorTag] = typedArrayTags[funcTag] = +typedArrayTags[mapTag] = typedArrayTags[numberTag] = +typedArrayTags[objectTag] = typedArrayTags[regexpTag] = +typedArrayTags[setTag] = typedArrayTags[stringTag] = +typedArrayTags[weakMapTag] = false; + +/** Detect free variable `global` from Node.js. */ +var freeGlobal = typeof commonjsGlobal == 'object' && commonjsGlobal && commonjsGlobal.Object === Object && commonjsGlobal; + +/** Detect free variable `self`. */ +var freeSelf = typeof self == 'object' && self && self.Object === Object && self; + +/** Used as a reference to the global object. */ +var root = freeGlobal || freeSelf || Function('return this')(); + +/** Detect free variable `exports`. */ +var freeExports = 'object' == 'object' && exports && !exports.nodeType && exports; + +/** Detect free variable `module`. */ +var freeModule = freeExports && 'object' == 'object' && module && !module.nodeType && module; + +/** Detect the popular CommonJS extension `module.exports`. */ +var moduleExports = freeModule && freeModule.exports === freeExports; + +/** Detect free variable `process` from Node.js. */ +var freeProcess = moduleExports && freeGlobal.process; + +/** Used to access faster Node.js helpers. */ +var nodeUtil = (function() { + try { + return freeProcess && freeProcess.binding('util'); + } catch (e) {} +}()); + +/* Node.js helper references. */ +var nodeIsTypedArray = nodeUtil && nodeUtil.isTypedArray; + +/** + * A faster alternative to `Function#apply`, this function invokes `func` + * with the `this` binding of `thisArg` and the arguments of `args`. + * + * @private + * @param {Function} func The function to invoke. + * @param {*} thisArg The `this` binding of `func`. + * @param {Array} args The arguments to invoke `func` with. + * @returns {*} Returns the result of `func`. + */ +function apply(func, thisArg, args) { + switch (args.length) { + case 0: return func.call(thisArg); + case 1: return func.call(thisArg, args[0]); + case 2: return func.call(thisArg, args[0], args[1]); + case 3: return func.call(thisArg, args[0], args[1], args[2]); + } + return func.apply(thisArg, args); +} + +/** + * A specialized version of `_.map` for arrays without support for iteratee + * shorthands. + * + * @private + * @param {Array} [array] The array to iterate over. + * @param {Function} iteratee The function invoked per iteration. + * @returns {Array} Returns the new mapped array. + */ +function arrayMap(array, iteratee) { + var index = -1, + length = array ? array.length : 0, + result = Array(length); + + while (++index < length) { + result[index] = iteratee(array[index], index, array); + } + return result; +} + +/** + * Appends the elements of `values` to `array`. + * + * @private + * @param {Array} array The array to modify. + * @param {Array} values The values to append. + * @returns {Array} Returns `array`. + */ +function arrayPush(array, values) { + var index = -1, + length = values.length, + offset = array.length; + + while (++index < length) { + array[offset + index] = values[index]; + } + return array; +} + +/** + * A specialized version of `_.some` for arrays without support for iteratee + * shorthands. + * + * @private + * @param {Array} [array] The array to iterate over. + * @param {Function} predicate The function invoked per iteration. + * @returns {boolean} Returns `true` if any element passes the predicate check, + * else `false`. + */ +function arraySome(array, predicate) { + var index = -1, + length = array ? array.length : 0; + + while (++index < length) { + if (predicate(array[index], index, array)) { + return true; + } + } + return false; +} + +/** + * The base implementation of `_.property` without support for deep paths. + * + * @private + * @param {string} key The key of the property to get. + * @returns {Function} Returns the new accessor function. + */ +function baseProperty(key) { + return function(object) { + return object == null ? undefined : object[key]; + }; +} + +/** + * The base implementation of `_.sortBy` which uses `comparer` to define the + * sort order of `array` and replaces criteria objects with their corresponding + * values. + * + * @private + * @param {Array} array The array to sort. + * @param {Function} comparer The function to define sort order. + * @returns {Array} Returns `array`. + */ +function baseSortBy(array, comparer) { + var length = array.length; + + array.sort(comparer); + while (length--) { + array[length] = array[length].value; + } + return array; +} + +/** + * The base implementation of `_.times` without support for iteratee shorthands + * or max array length checks. + * + * @private + * @param {number} n The number of times to invoke `iteratee`. + * @param {Function} iteratee The function invoked per iteration. + * @returns {Array} Returns the array of results. + */ +function baseTimes(n, iteratee) { + var index = -1, + result = Array(n); + + while (++index < n) { + result[index] = iteratee(index); + } + return result; +} + +/** + * The base implementation of `_.unary` without support for storing metadata. + * + * @private + * @param {Function} func The function to cap arguments for. + * @returns {Function} Returns the new capped function. + */ +function baseUnary(func) { + return function(value) { + return func(value); + }; +} + +/** + * Gets the value at `key` of `object`. + * + * @private + * @param {Object} [object] The object to query. + * @param {string} key The key of the property to get. + * @returns {*} Returns the property value. + */ +function getValue(object, key) { + return object == null ? undefined : object[key]; +} + +/** + * Checks if `value` is a host object in IE < 9. + * + * @private + * @param {*} value The value to check. + * @returns {boolean} Returns `true` if `value` is a host object, else `false`. + */ +function isHostObject(value) { + // Many host objects are `Object` objects that can coerce to strings + // despite having improperly defined `toString` methods. + var result = false; + if (value != null && typeof value.toString != 'function') { + try { + result = !!(value + ''); + } catch (e) {} + } + return result; +} + +/** + * Converts `map` to its key-value pairs. + * + * @private + * @param {Object} map The map to convert. + * @returns {Array} Returns the key-value pairs. + */ +function mapToArray(map) { + var index = -1, + result = Array(map.size); + + map.forEach(function(value, key) { + result[++index] = [key, value]; + }); + return result; +} + +/** + * Creates a unary function that invokes `func` with its argument transformed. + * + * @private + * @param {Function} func The function to wrap. + * @param {Function} transform The argument transform. + * @returns {Function} Returns the new function. + */ +function overArg(func, transform) { + return function(arg) { + return func(transform(arg)); + }; +} + +/** + * Converts `set` to an array of its values. + * + * @private + * @param {Object} set The set to convert. + * @returns {Array} Returns the values. + */ +function setToArray(set) { + var index = -1, + result = Array(set.size); + + set.forEach(function(value) { + result[++index] = value; + }); + return result; +} + +/** Used for built-in method references. */ +var arrayProto = Array.prototype, + funcProto = Function.prototype, + objectProto = Object.prototype; + +/** Used to detect overreaching core-js shims. */ +var coreJsData = root['__core-js_shared__']; + +/** Used to detect methods masquerading as native. */ +var maskSrcKey = (function() { + var uid = /[^.]+$/.exec(coreJsData && coreJsData.keys && coreJsData.keys.IE_PROTO || ''); + return uid ? ('Symbol(src)_1.' + uid) : ''; +}()); + +/** Used to resolve the decompiled source of functions. */ +var funcToString = funcProto.toString; + +/** Used to check objects for own properties. */ +var hasOwnProperty = objectProto.hasOwnProperty; + +/** + * Used to resolve the + * [`toStringTag`](http://ecma-international.org/ecma-262/7.0/#sec-object.prototype.tostring) + * of values. + */ +var objectToString = objectProto.toString; + +/** Used to detect if a method is native. */ +var reIsNative = RegExp('^' + + funcToString.call(hasOwnProperty).replace(reRegExpChar, '\\$&') + .replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g, '$1.*?') + '$' +); + +/** Built-in value references. */ +var Symbol = root.Symbol, + Uint8Array = root.Uint8Array, + propertyIsEnumerable = objectProto.propertyIsEnumerable, + splice = arrayProto.splice, + spreadableSymbol = Symbol ? Symbol.isConcatSpreadable : undefined; + +/* Built-in method references for those with the same name as other `lodash` methods. */ +var nativeKeys = overArg(Object.keys, Object), + nativeMax = Math.max; + +/* Built-in method references that are verified to be native. */ +var DataView = getNative(root, 'DataView'), + Map = getNative(root, 'Map'), + Promise = getNative(root, 'Promise'), + Set = getNative(root, 'Set'), + WeakMap = getNative(root, 'WeakMap'), + nativeCreate = getNative(Object, 'create'); + +/** Used to detect maps, sets, and weakmaps. */ +var dataViewCtorString = toSource(DataView), + mapCtorString = toSource(Map), + promiseCtorString = toSource(Promise), + setCtorString = toSource(Set), + weakMapCtorString = toSource(WeakMap); + +/** Used to convert symbols to primitives and strings. */ +var symbolProto = Symbol ? Symbol.prototype : undefined, + symbolValueOf = symbolProto ? symbolProto.valueOf : undefined, + symbolToString = symbolProto ? symbolProto.toString : undefined; + +/** + * Creates a hash object. + * + * @private + * @constructor + * @param {Array} [entries] The key-value pairs to cache. + */ +function Hash(entries) { + var index = -1, + length = entries ? entries.length : 0; + + this.clear(); + while (++index < length) { + var entry = entries[index]; + this.set(entry[0], entry[1]); + } +} + +/** + * Removes all key-value entries from the hash. + * + * @private + * @name clear + * @memberOf Hash + */ +function hashClear() { + this.__data__ = nativeCreate ? nativeCreate(null) : {}; +} + +/** + * Removes `key` and its value from the hash. + * + * @private + * @name delete + * @memberOf Hash + * @param {Object} hash The hash to modify. + * @param {string} key The key of the value to remove. + * @returns {boolean} Returns `true` if the entry was removed, else `false`. + */ +function hashDelete(key) { + return this.has(key) && delete this.__data__[key]; +} + +/** + * Gets the hash value for `key`. + * + * @private + * @name get + * @memberOf Hash + * @param {string} key The key of the value to get. + * @returns {*} Returns the entry value. + */ +function hashGet(key) { + var data = this.__data__; + if (nativeCreate) { + var result = data[key]; + return result === HASH_UNDEFINED ? undefined : result; + } + return hasOwnProperty.call(data, key) ? data[key] : undefined; +} + +/** + * Checks if a hash value for `key` exists. + * + * @private + * @name has + * @memberOf Hash + * @param {string} key The key of the entry to check. + * @returns {boolean} Returns `true` if an entry for `key` exists, else `false`. + */ +function hashHas(key) { + var data = this.__data__; + return nativeCreate ? data[key] !== undefined : hasOwnProperty.call(data, key); +} + +/** + * Sets the hash `key` to `value`. + * + * @private + * @name set + * @memberOf Hash + * @param {string} key The key of the value to set. + * @param {*} value The value to set. + * @returns {Object} Returns the hash instance. + */ +function hashSet(key, value) { + var data = this.__data__; + data[key] = (nativeCreate && value === undefined) ? HASH_UNDEFINED : value; + return this; +} + +// Add methods to `Hash`. +Hash.prototype.clear = hashClear; +Hash.prototype['delete'] = hashDelete; +Hash.prototype.get = hashGet; +Hash.prototype.has = hashHas; +Hash.prototype.set = hashSet; + +/** + * Creates an list cache object. + * + * @private + * @constructor + * @param {Array} [entries] The key-value pairs to cache. + */ +function ListCache(entries) { + var index = -1, + length = entries ? entries.length : 0; + + this.clear(); + while (++index < length) { + var entry = entries[index]; + this.set(entry[0], entry[1]); + } +} + +/** + * Removes all key-value entries from the list cache. + * + * @private + * @name clear + * @memberOf ListCache + */ +function listCacheClear() { + this.__data__ = []; +} + +/** + * Removes `key` and its value from the list cache. + * + * @private + * @name delete + * @memberOf ListCache + * @param {string} key The key of the value to remove. + * @returns {boolean} Returns `true` if the entry was removed, else `false`. + */ +function listCacheDelete(key) { + var data = this.__data__, + index = assocIndexOf(data, key); + + if (index < 0) { + return false; + } + var lastIndex = data.length - 1; + if (index == lastIndex) { + data.pop(); + } else { + splice.call(data, index, 1); + } + return true; +} + +/** + * Gets the list cache value for `key`. + * + * @private + * @name get + * @memberOf ListCache + * @param {string} key The key of the value to get. + * @returns {*} Returns the entry value. + */ +function listCacheGet(key) { + var data = this.__data__, + index = assocIndexOf(data, key); + + return index < 0 ? undefined : data[index][1]; +} + +/** + * Checks if a list cache value for `key` exists. + * + * @private + * @name has + * @memberOf ListCache + * @param {string} key The key of the entry to check. + * @returns {boolean} Returns `true` if an entry for `key` exists, else `false`. + */ +function listCacheHas(key) { + return assocIndexOf(this.__data__, key) > -1; +} + +/** + * Sets the list cache `key` to `value`. + * + * @private + * @name set + * @memberOf ListCache + * @param {string} key The key of the value to set. + * @param {*} value The value to set. + * @returns {Object} Returns the list cache instance. + */ +function listCacheSet(key, value) { + var data = this.__data__, + index = assocIndexOf(data, key); + + if (index < 0) { + data.push([key, value]); + } else { + data[index][1] = value; + } + return this; +} + +// Add methods to `ListCache`. +ListCache.prototype.clear = listCacheClear; +ListCache.prototype['delete'] = listCacheDelete; +ListCache.prototype.get = listCacheGet; +ListCache.prototype.has = listCacheHas; +ListCache.prototype.set = listCacheSet; + +/** + * Creates a map cache object to store key-value pairs. + * + * @private + * @constructor + * @param {Array} [entries] The key-value pairs to cache. + */ +function MapCache(entries) { + var index = -1, + length = entries ? entries.length : 0; + + this.clear(); + while (++index < length) { + var entry = entries[index]; + this.set(entry[0], entry[1]); + } +} + +/** + * Removes all key-value entries from the map. + * + * @private + * @name clear + * @memberOf MapCache + */ +function mapCacheClear() { + this.__data__ = { + 'hash': new Hash, + 'map': new (Map || ListCache), + 'string': new Hash + }; +} + +/** + * Removes `key` and its value from the map. + * + * @private + * @name delete + * @memberOf MapCache + * @param {string} key The key of the value to remove. + * @returns {boolean} Returns `true` if the entry was removed, else `false`. + */ +function mapCacheDelete(key) { + return getMapData(this, key)['delete'](key); +} + +/** + * Gets the map value for `key`. + * + * @private + * @name get + * @memberOf MapCache + * @param {string} key The key of the value to get. + * @returns {*} Returns the entry value. + */ +function mapCacheGet(key) { + return getMapData(this, key).get(key); +} + +/** + * Checks if a map value for `key` exists. + * + * @private + * @name has + * @memberOf MapCache + * @param {string} key The key of the entry to check. + * @returns {boolean} Returns `true` if an entry for `key` exists, else `false`. + */ +function mapCacheHas(key) { + return getMapData(this, key).has(key); +} + +/** + * Sets the map `key` to `value`. + * + * @private + * @name set + * @memberOf MapCache + * @param {string} key The key of the value to set. + * @param {*} value The value to set. + * @returns {Object} Returns the map cache instance. + */ +function mapCacheSet(key, value) { + getMapData(this, key).set(key, value); + return this; +} + +// Add methods to `MapCache`. +MapCache.prototype.clear = mapCacheClear; +MapCache.prototype['delete'] = mapCacheDelete; +MapCache.prototype.get = mapCacheGet; +MapCache.prototype.has = mapCacheHas; +MapCache.prototype.set = mapCacheSet; + +/** + * + * Creates an array cache object to store unique values. + * + * @private + * @constructor + * @param {Array} [values] The values to cache. + */ +function SetCache(values) { + var index = -1, + length = values ? values.length : 0; + + this.__data__ = new MapCache; + while (++index < length) { + this.add(values[index]); + } +} + +/** + * Adds `value` to the array cache. + * + * @private + * @name add + * @memberOf SetCache + * @alias push + * @param {*} value The value to cache. + * @returns {Object} Returns the cache instance. + */ +function setCacheAdd(value) { + this.__data__.set(value, HASH_UNDEFINED); + return this; +} + +/** + * Checks if `value` is in the array cache. + * + * @private + * @name has + * @memberOf SetCache + * @param {*} value The value to search for. + * @returns {number} Returns `true` if `value` is found, else `false`. + */ +function setCacheHas(value) { + return this.__data__.has(value); +} + +// Add methods to `SetCache`. +SetCache.prototype.add = SetCache.prototype.push = setCacheAdd; +SetCache.prototype.has = setCacheHas; + +/** + * Creates a stack cache object to store key-value pairs. + * + * @private + * @constructor + * @param {Array} [entries] The key-value pairs to cache. + */ +function Stack(entries) { + this.__data__ = new ListCache(entries); +} + +/** + * Removes all key-value entries from the stack. + * + * @private + * @name clear + * @memberOf Stack + */ +function stackClear() { + this.__data__ = new ListCache; +} + +/** + * Removes `key` and its value from the stack. + * + * @private + * @name delete + * @memberOf Stack + * @param {string} key The key of the value to remove. + * @returns {boolean} Returns `true` if the entry was removed, else `false`. + */ +function stackDelete(key) { + return this.__data__['delete'](key); +} + +/** + * Gets the stack value for `key`. + * + * @private + * @name get + * @memberOf Stack + * @param {string} key The key of the value to get. + * @returns {*} Returns the entry value. + */ +function stackGet(key) { + return this.__data__.get(key); +} + +/** + * Checks if a stack value for `key` exists. + * + * @private + * @name has + * @memberOf Stack + * @param {string} key The key of the entry to check. + * @returns {boolean} Returns `true` if an entry for `key` exists, else `false`. + */ +function stackHas(key) { + return this.__data__.has(key); +} + +/** + * Sets the stack `key` to `value`. + * + * @private + * @name set + * @memberOf Stack + * @param {string} key The key of the value to set. + * @param {*} value The value to set. + * @returns {Object} Returns the stack cache instance. + */ +function stackSet(key, value) { + var cache = this.__data__; + if (cache instanceof ListCache) { + var pairs = cache.__data__; + if (!Map || (pairs.length < LARGE_ARRAY_SIZE - 1)) { + pairs.push([key, value]); + return this; + } + cache = this.__data__ = new MapCache(pairs); + } + cache.set(key, value); + return this; +} + +// Add methods to `Stack`. +Stack.prototype.clear = stackClear; +Stack.prototype['delete'] = stackDelete; +Stack.prototype.get = stackGet; +Stack.prototype.has = stackHas; +Stack.prototype.set = stackSet; + +/** + * Creates an array of the enumerable property names of the array-like `value`. + * + * @private + * @param {*} value The value to query. + * @param {boolean} inherited Specify returning inherited property names. + * @returns {Array} Returns the array of property names. + */ +function arrayLikeKeys(value, inherited) { + // Safari 8.1 makes `arguments.callee` enumerable in strict mode. + // Safari 9 makes `arguments.length` enumerable in strict mode. + var result = (isArray(value) || isArguments(value)) + ? baseTimes(value.length, String) + : []; + + var length = result.length, + skipIndexes = !!length; + + for (var key in value) { + if ((inherited || hasOwnProperty.call(value, key)) && + !(skipIndexes && (key == 'length' || isIndex(key, length)))) { + result.push(key); + } + } + return result; +} + +/** + * Gets the index at which the `key` is found in `array` of key-value pairs. + * + * @private + * @param {Array} array The array to inspect. + * @param {*} key The key to search for. + * @returns {number} Returns the index of the matched value, else `-1`. + */ +function assocIndexOf(array, key) { + var length = array.length; + while (length--) { + if (eq(array[length][0], key)) { + return length; + } + } + return -1; +} + +/** + * The base implementation of `_.forEach` without support for iteratee shorthands. + * + * @private + * @param {Array|Object} collection The collection to iterate over. + * @param {Function} iteratee The function invoked per iteration. + * @returns {Array|Object} Returns `collection`. + */ +var baseEach = createBaseEach(baseForOwn); + +/** + * The base implementation of `_.flatten` with support for restricting flattening. + * + * @private + * @param {Array} array The array to flatten. + * @param {number} depth The maximum recursion depth. + * @param {boolean} [predicate=isFlattenable] The function invoked per iteration. + * @param {boolean} [isStrict] Restrict to values that pass `predicate` checks. + * @param {Array} [result=[]] The initial result value. + * @returns {Array} Returns the new flattened array. + */ +function baseFlatten(array, depth, predicate, isStrict, result) { + var index = -1, + length = array.length; + + predicate || (predicate = isFlattenable); + result || (result = []); + + while (++index < length) { + var value = array[index]; + if (depth > 0 && predicate(value)) { + if (depth > 1) { + // Recursively flatten arrays (susceptible to call stack limits). + baseFlatten(value, depth - 1, predicate, isStrict, result); + } else { + arrayPush(result, value); + } + } else if (!isStrict) { + result[result.length] = value; + } + } + return result; +} + +/** + * The base implementation of `baseForOwn` which iterates over `object` + * properties returned by `keysFunc` and invokes `iteratee` for each property. + * Iteratee functions may exit iteration early by explicitly returning `false`. + * + * @private + * @param {Object} object The object to iterate over. + * @param {Function} iteratee The function invoked per iteration. + * @param {Function} keysFunc The function to get the keys of `object`. + * @returns {Object} Returns `object`. + */ +var baseFor = createBaseFor(); + +/** + * The base implementation of `_.forOwn` without support for iteratee shorthands. + * + * @private + * @param {Object} object The object to iterate over. + * @param {Function} iteratee The function invoked per iteration. + * @returns {Object} Returns `object`. + */ +function baseForOwn(object, iteratee) { + return object && baseFor(object, iteratee, keys); +} + +/** + * The base implementation of `_.get` without support for default values. + * + * @private + * @param {Object} object The object to query. + * @param {Array|string} path The path of the property to get. + * @returns {*} Returns the resolved value. + */ +function baseGet(object, path) { + path = isKey(path, object) ? [path] : castPath(path); + + var index = 0, + length = path.length; + + while (object != null && index < length) { + object = object[toKey(path[index++])]; + } + return (index && index == length) ? object : undefined; +} + +/** + * The base implementation of `getTag`. + * + * @private + * @param {*} value The value to query. + * @returns {string} Returns the `toStringTag`. + */ +function baseGetTag(value) { + return objectToString.call(value); +} + +/** + * The base implementation of `_.hasIn` without support for deep paths. + * + * @private + * @param {Object} [object] The object to query. + * @param {Array|string} key The key to check. + * @returns {boolean} Returns `true` if `key` exists, else `false`. + */ +function baseHasIn(object, key) { + return object != null && key in Object(object); +} + +/** + * The base implementation of `_.isEqual` which supports partial comparisons + * and tracks traversed objects. + * + * @private + * @param {*} value The value to compare. + * @param {*} other The other value to compare. + * @param {Function} [customizer] The function to customize comparisons. + * @param {boolean} [bitmask] The bitmask of comparison flags. + * The bitmask may be composed of the following flags: + * 1 - Unordered comparison + * 2 - Partial comparison + * @param {Object} [stack] Tracks traversed `value` and `other` objects. + * @returns {boolean} Returns `true` if the values are equivalent, else `false`. + */ +function baseIsEqual(value, other, customizer, bitmask, stack) { + if (value === other) { + return true; + } + if (value == null || other == null || (!isObject(value) && !isObjectLike(other))) { + return value !== value && other !== other; + } + return baseIsEqualDeep(value, other, baseIsEqual, customizer, bitmask, stack); +} + +/** + * A specialized version of `baseIsEqual` for arrays and objects which performs + * deep comparisons and tracks traversed objects enabling objects with circular + * references to be compared. + * + * @private + * @param {Object} object The object to compare. + * @param {Object} other The other object to compare. + * @param {Function} equalFunc The function to determine equivalents of values. + * @param {Function} [customizer] The function to customize comparisons. + * @param {number} [bitmask] The bitmask of comparison flags. See `baseIsEqual` + * for more details. + * @param {Object} [stack] Tracks traversed `object` and `other` objects. + * @returns {boolean} Returns `true` if the objects are equivalent, else `false`. + */ +function baseIsEqualDeep(object, other, equalFunc, customizer, bitmask, stack) { + var objIsArr = isArray(object), + othIsArr = isArray(other), + objTag = arrayTag, + othTag = arrayTag; + + if (!objIsArr) { + objTag = getTag(object); + objTag = objTag == argsTag ? objectTag : objTag; + } + if (!othIsArr) { + othTag = getTag(other); + othTag = othTag == argsTag ? objectTag : othTag; + } + var objIsObj = objTag == objectTag && !isHostObject(object), + othIsObj = othTag == objectTag && !isHostObject(other), + isSameTag = objTag == othTag; + + if (isSameTag && !objIsObj) { + stack || (stack = new Stack); + return (objIsArr || isTypedArray(object)) + ? equalArrays(object, other, equalFunc, customizer, bitmask, stack) + : equalByTag(object, other, objTag, equalFunc, customizer, bitmask, stack); + } + if (!(bitmask & PARTIAL_COMPARE_FLAG)) { + var objIsWrapped = objIsObj && hasOwnProperty.call(object, '__wrapped__'), + othIsWrapped = othIsObj && hasOwnProperty.call(other, '__wrapped__'); + + if (objIsWrapped || othIsWrapped) { + var objUnwrapped = objIsWrapped ? object.value() : object, + othUnwrapped = othIsWrapped ? other.value() : other; + + stack || (stack = new Stack); + return equalFunc(objUnwrapped, othUnwrapped, customizer, bitmask, stack); + } + } + if (!isSameTag) { + return false; + } + stack || (stack = new Stack); + return equalObjects(object, other, equalFunc, customizer, bitmask, stack); +} + +/** + * The base implementation of `_.isMatch` without support for iteratee shorthands. + * + * @private + * @param {Object} object The object to inspect. + * @param {Object} source The object of property values to match. + * @param {Array} matchData The property names, values, and compare flags to match. + * @param {Function} [customizer] The function to customize comparisons. + * @returns {boolean} Returns `true` if `object` is a match, else `false`. + */ +function baseIsMatch(object, source, matchData, customizer) { + var index = matchData.length, + length = index, + noCustomizer = !customizer; + + if (object == null) { + return !length; + } + object = Object(object); + while (index--) { + var data = matchData[index]; + if ((noCustomizer && data[2]) + ? data[1] !== object[data[0]] + : !(data[0] in object) + ) { + return false; + } + } + while (++index < length) { + data = matchData[index]; + var key = data[0], + objValue = object[key], + srcValue = data[1]; + + if (noCustomizer && data[2]) { + if (objValue === undefined && !(key in object)) { + return false; + } + } else { + var stack = new Stack; + if (customizer) { + var result = customizer(objValue, srcValue, key, object, source, stack); + } + if (!(result === undefined + ? baseIsEqual(srcValue, objValue, customizer, UNORDERED_COMPARE_FLAG | PARTIAL_COMPARE_FLAG, stack) + : result + )) { + return false; + } + } + } + return true; +} + +/** + * The base implementation of `_.isNative` without bad shim checks. + * + * @private + * @param {*} value The value to check. + * @returns {boolean} Returns `true` if `value` is a native function, + * else `false`. + */ +function baseIsNative(value) { + if (!isObject(value) || isMasked(value)) { + return false; + } + var pattern = (isFunction(value) || isHostObject(value)) ? reIsNative : reIsHostCtor; + return pattern.test(toSource(value)); +} + +/** + * The base implementation of `_.isTypedArray` without Node.js optimizations. + * + * @private + * @param {*} value The value to check. + * @returns {boolean} Returns `true` if `value` is a typed array, else `false`. + */ +function baseIsTypedArray(value) { + return isObjectLike(value) && + isLength(value.length) && !!typedArrayTags[objectToString.call(value)]; +} + +/** + * The base implementation of `_.iteratee`. + * + * @private + * @param {*} [value=_.identity] The value to convert to an iteratee. + * @returns {Function} Returns the iteratee. + */ +function baseIteratee(value) { + // Don't store the `typeof` result in a variable to avoid a JIT bug in Safari 9. + // See https://bugs.webkit.org/show_bug.cgi?id=156034 for more details. + if (typeof value == 'function') { + return value; + } + if (value == null) { + return identity; + } + if (typeof value == 'object') { + return isArray(value) + ? baseMatchesProperty(value[0], value[1]) + : baseMatches(value); + } + return property(value); +} + +/** + * The base implementation of `_.keys` which doesn't treat sparse arrays as dense. + * + * @private + * @param {Object} object The object to query. + * @returns {Array} Returns the array of property names. + */ +function baseKeys(object) { + if (!isPrototype(object)) { + return nativeKeys(object); + } + var result = []; + for (var key in Object(object)) { + if (hasOwnProperty.call(object, key) && key != 'constructor') { + result.push(key); + } + } + return result; +} + +/** + * The base implementation of `_.map` without support for iteratee shorthands. + * + * @private + * @param {Array|Object} collection The collection to iterate over. + * @param {Function} iteratee The function invoked per iteration. + * @returns {Array} Returns the new mapped array. + */ +function baseMap(collection, iteratee) { + var index = -1, + result = isArrayLike(collection) ? Array(collection.length) : []; + + baseEach(collection, function(value, key, collection) { + result[++index] = iteratee(value, key, collection); + }); + return result; +} + +/** + * The base implementation of `_.matches` which doesn't clone `source`. + * + * @private + * @param {Object} source The object of property values to match. + * @returns {Function} Returns the new spec function. + */ +function baseMatches(source) { + var matchData = getMatchData(source); + if (matchData.length == 1 && matchData[0][2]) { + return matchesStrictComparable(matchData[0][0], matchData[0][1]); + } + return function(object) { + return object === source || baseIsMatch(object, source, matchData); + }; +} + +/** + * The base implementation of `_.matchesProperty` which doesn't clone `srcValue`. + * + * @private + * @param {string} path The path of the property to get. + * @param {*} srcValue The value to match. + * @returns {Function} Returns the new spec function. + */ +function baseMatchesProperty(path, srcValue) { + if (isKey(path) && isStrictComparable(srcValue)) { + return matchesStrictComparable(toKey(path), srcValue); + } + return function(object) { + var objValue = get(object, path); + return (objValue === undefined && objValue === srcValue) + ? hasIn(object, path) + : baseIsEqual(srcValue, objValue, undefined, UNORDERED_COMPARE_FLAG | PARTIAL_COMPARE_FLAG); + }; +} + +/** + * The base implementation of `_.orderBy` without param guards. + * + * @private + * @param {Array|Object} collection The collection to iterate over. + * @param {Function[]|Object[]|string[]} iteratees The iteratees to sort by. + * @param {string[]} orders The sort orders of `iteratees`. + * @returns {Array} Returns the new sorted array. + */ +function baseOrderBy(collection, iteratees, orders) { + var index = -1; + iteratees = arrayMap(iteratees.length ? iteratees : [identity], baseUnary(baseIteratee)); + + var result = baseMap(collection, function(value, key, collection) { + var criteria = arrayMap(iteratees, function(iteratee) { + return iteratee(value); + }); + return { 'criteria': criteria, 'index': ++index, 'value': value }; + }); + + return baseSortBy(result, function(object, other) { + return compareMultiple(object, other, orders); + }); +} + +/** + * A specialized version of `baseProperty` which supports deep paths. + * + * @private + * @param {Array|string} path The path of the property to get. + * @returns {Function} Returns the new accessor function. + */ +function basePropertyDeep(path) { + return function(object) { + return baseGet(object, path); + }; +} + +/** + * The base implementation of `_.rest` which doesn't validate or coerce arguments. + * + * @private + * @param {Function} func The function to apply a rest parameter to. + * @param {number} [start=func.length-1] The start position of the rest parameter. + * @returns {Function} Returns the new function. + */ +function baseRest(func, start) { + start = nativeMax(start === undefined ? (func.length - 1) : start, 0); + return function() { + var args = arguments, + index = -1, + length = nativeMax(args.length - start, 0), + array = Array(length); + + while (++index < length) { + array[index] = args[start + index]; + } + index = -1; + var otherArgs = Array(start + 1); + while (++index < start) { + otherArgs[index] = args[index]; + } + otherArgs[start] = array; + return apply(func, this, otherArgs); + }; +} + +/** + * The base implementation of `_.toString` which doesn't convert nullish + * values to empty strings. + * + * @private + * @param {*} value The value to process. + * @returns {string} Returns the string. + */ +function baseToString(value) { + // Exit early for strings to avoid a performance hit in some environments. + if (typeof value == 'string') { + return value; + } + if (isSymbol(value)) { + return symbolToString ? symbolToString.call(value) : ''; + } + var result = (value + ''); + return (result == '0' && (1 / value) == -INFINITY) ? '-0' : result; +} + +/** + * Casts `value` to a path array if it's not one. + * + * @private + * @param {*} value The value to inspect. + * @returns {Array} Returns the cast property path array. + */ +function castPath(value) { + return isArray(value) ? value : stringToPath(value); +} + +/** + * Compares values to sort them in ascending order. + * + * @private + * @param {*} value The value to compare. + * @param {*} other The other value to compare. + * @returns {number} Returns the sort order indicator for `value`. + */ +function compareAscending(value, other) { + if (value !== other) { + var valIsDefined = value !== undefined, + valIsNull = value === null, + valIsReflexive = value === value, + valIsSymbol = isSymbol(value); + + var othIsDefined = other !== undefined, + othIsNull = other === null, + othIsReflexive = other === other, + othIsSymbol = isSymbol(other); + + if ((!othIsNull && !othIsSymbol && !valIsSymbol && value > other) || + (valIsSymbol && othIsDefined && othIsReflexive && !othIsNull && !othIsSymbol) || + (valIsNull && othIsDefined && othIsReflexive) || + (!valIsDefined && othIsReflexive) || + !valIsReflexive) { + return 1; + } + if ((!valIsNull && !valIsSymbol && !othIsSymbol && value < other) || + (othIsSymbol && valIsDefined && valIsReflexive && !valIsNull && !valIsSymbol) || + (othIsNull && valIsDefined && valIsReflexive) || + (!othIsDefined && valIsReflexive) || + !othIsReflexive) { + return -1; + } + } + return 0; +} + +/** + * Used by `_.orderBy` to compare multiple properties of a value to another + * and stable sort them. + * + * If `orders` is unspecified, all values are sorted in ascending order. Otherwise, + * specify an order of "desc" for descending or "asc" for ascending sort order + * of corresponding values. + * + * @private + * @param {Object} object The object to compare. + * @param {Object} other The other object to compare. + * @param {boolean[]|string[]} orders The order to sort by for each property. + * @returns {number} Returns the sort order indicator for `object`. + */ +function compareMultiple(object, other, orders) { + var index = -1, + objCriteria = object.criteria, + othCriteria = other.criteria, + length = objCriteria.length, + ordersLength = orders.length; + + while (++index < length) { + var result = compareAscending(objCriteria[index], othCriteria[index]); + if (result) { + if (index >= ordersLength) { + return result; + } + var order = orders[index]; + return result * (order == 'desc' ? -1 : 1); + } + } + // Fixes an `Array#sort` bug in the JS engine embedded in Adobe applications + // that causes it, under certain circumstances, to provide the same value for + // `object` and `other`. See https://github.com/jashkenas/underscore/pull/1247 + // for more details. + // + // This also ensures a stable sort in V8 and other engines. + // See https://bugs.chromium.org/p/v8/issues/detail?id=90 for more details. + return object.index - other.index; +} + +/** + * Creates a `baseEach` or `baseEachRight` function. + * + * @private + * @param {Function} eachFunc The function to iterate over a collection. + * @param {boolean} [fromRight] Specify iterating from right to left. + * @returns {Function} Returns the new base function. + */ +function createBaseEach(eachFunc, fromRight) { + return function(collection, iteratee) { + if (collection == null) { + return collection; + } + if (!isArrayLike(collection)) { + return eachFunc(collection, iteratee); + } + var length = collection.length, + index = fromRight ? length : -1, + iterable = Object(collection); + + while ((fromRight ? index-- : ++index < length)) { + if (iteratee(iterable[index], index, iterable) === false) { + break; + } + } + return collection; + }; +} + +/** + * Creates a base function for methods like `_.forIn` and `_.forOwn`. + * + * @private + * @param {boolean} [fromRight] Specify iterating from right to left. + * @returns {Function} Returns the new base function. + */ +function createBaseFor(fromRight) { + return function(object, iteratee, keysFunc) { + var index = -1, + iterable = Object(object), + props = keysFunc(object), + length = props.length; + + while (length--) { + var key = props[fromRight ? length : ++index]; + if (iteratee(iterable[key], key, iterable) === false) { + break; + } + } + return object; + }; +} + +/** + * A specialized version of `baseIsEqualDeep` for arrays with support for + * partial deep comparisons. + * + * @private + * @param {Array} array The array to compare. + * @param {Array} other The other array to compare. + * @param {Function} equalFunc The function to determine equivalents of values. + * @param {Function} customizer The function to customize comparisons. + * @param {number} bitmask The bitmask of comparison flags. See `baseIsEqual` + * for more details. + * @param {Object} stack Tracks traversed `array` and `other` objects. + * @returns {boolean} Returns `true` if the arrays are equivalent, else `false`. + */ +function equalArrays(array, other, equalFunc, customizer, bitmask, stack) { + var isPartial = bitmask & PARTIAL_COMPARE_FLAG, + arrLength = array.length, + othLength = other.length; + + if (arrLength != othLength && !(isPartial && othLength > arrLength)) { + return false; + } + // Assume cyclic values are equal. + var stacked = stack.get(array); + if (stacked && stack.get(other)) { + return stacked == other; + } + var index = -1, + result = true, + seen = (bitmask & UNORDERED_COMPARE_FLAG) ? new SetCache : undefined; + + stack.set(array, other); + stack.set(other, array); + + // Ignore non-index properties. + while (++index < arrLength) { + var arrValue = array[index], + othValue = other[index]; + + if (customizer) { + var compared = isPartial + ? customizer(othValue, arrValue, index, other, array, stack) + : customizer(arrValue, othValue, index, array, other, stack); + } + if (compared !== undefined) { + if (compared) { + continue; + } + result = false; + break; + } + // Recursively compare arrays (susceptible to call stack limits). + if (seen) { + if (!arraySome(other, function(othValue, othIndex) { + if (!seen.has(othIndex) && + (arrValue === othValue || equalFunc(arrValue, othValue, customizer, bitmask, stack))) { + return seen.add(othIndex); + } + })) { + result = false; + break; + } + } else if (!( + arrValue === othValue || + equalFunc(arrValue, othValue, customizer, bitmask, stack) + )) { + result = false; + break; + } + } + stack['delete'](array); + stack['delete'](other); + return result; +} + +/** + * A specialized version of `baseIsEqualDeep` for comparing objects of + * the same `toStringTag`. + * + * **Note:** This function only supports comparing values with tags of + * `Boolean`, `Date`, `Error`, `Number`, `RegExp`, or `String`. + * + * @private + * @param {Object} object The object to compare. + * @param {Object} other The other object to compare. + * @param {string} tag The `toStringTag` of the objects to compare. + * @param {Function} equalFunc The function to determine equivalents of values. + * @param {Function} customizer The function to customize comparisons. + * @param {number} bitmask The bitmask of comparison flags. See `baseIsEqual` + * for more details. + * @param {Object} stack Tracks traversed `object` and `other` objects. + * @returns {boolean} Returns `true` if the objects are equivalent, else `false`. + */ +function equalByTag(object, other, tag, equalFunc, customizer, bitmask, stack) { + switch (tag) { + case dataViewTag: + if ((object.byteLength != other.byteLength) || + (object.byteOffset != other.byteOffset)) { + return false; + } + object = object.buffer; + other = other.buffer; + + case arrayBufferTag: + if ((object.byteLength != other.byteLength) || + !equalFunc(new Uint8Array(object), new Uint8Array(other))) { + return false; + } + return true; + + case boolTag: + case dateTag: + case numberTag: + // Coerce booleans to `1` or `0` and dates to milliseconds. + // Invalid dates are coerced to `NaN`. + return eq(+object, +other); + + case errorTag: + return object.name == other.name && object.message == other.message; + + case regexpTag: + case stringTag: + // Coerce regexes to strings and treat strings, primitives and objects, + // as equal. See http://www.ecma-international.org/ecma-262/7.0/#sec-regexp.prototype.tostring + // for more details. + return object == (other + ''); + + case mapTag: + var convert = mapToArray; + + case setTag: + var isPartial = bitmask & PARTIAL_COMPARE_FLAG; + convert || (convert = setToArray); + + if (object.size != other.size && !isPartial) { + return false; + } + // Assume cyclic values are equal. + var stacked = stack.get(object); + if (stacked) { + return stacked == other; + } + bitmask |= UNORDERED_COMPARE_FLAG; + + // Recursively compare objects (susceptible to call stack limits). + stack.set(object, other); + var result = equalArrays(convert(object), convert(other), equalFunc, customizer, bitmask, stack); + stack['delete'](object); + return result; + + case symbolTag: + if (symbolValueOf) { + return symbolValueOf.call(object) == symbolValueOf.call(other); + } + } + return false; +} + +/** + * A specialized version of `baseIsEqualDeep` for objects with support for + * partial deep comparisons. + * + * @private + * @param {Object} object The object to compare. + * @param {Object} other The other object to compare. + * @param {Function} equalFunc The function to determine equivalents of values. + * @param {Function} customizer The function to customize comparisons. + * @param {number} bitmask The bitmask of comparison flags. See `baseIsEqual` + * for more details. + * @param {Object} stack Tracks traversed `object` and `other` objects. + * @returns {boolean} Returns `true` if the objects are equivalent, else `false`. + */ +function equalObjects(object, other, equalFunc, customizer, bitmask, stack) { + var isPartial = bitmask & PARTIAL_COMPARE_FLAG, + objProps = keys(object), + objLength = objProps.length, + othProps = keys(other), + othLength = othProps.length; + + if (objLength != othLength && !isPartial) { + return false; + } + var index = objLength; + while (index--) { + var key = objProps[index]; + if (!(isPartial ? key in other : hasOwnProperty.call(other, key))) { + return false; + } + } + // Assume cyclic values are equal. + var stacked = stack.get(object); + if (stacked && stack.get(other)) { + return stacked == other; + } + var result = true; + stack.set(object, other); + stack.set(other, object); + + var skipCtor = isPartial; + while (++index < objLength) { + key = objProps[index]; + var objValue = object[key], + othValue = other[key]; + + if (customizer) { + var compared = isPartial + ? customizer(othValue, objValue, key, other, object, stack) + : customizer(objValue, othValue, key, object, other, stack); + } + // Recursively compare objects (susceptible to call stack limits). + if (!(compared === undefined + ? (objValue === othValue || equalFunc(objValue, othValue, customizer, bitmask, stack)) + : compared + )) { + result = false; + break; + } + skipCtor || (skipCtor = key == 'constructor'); + } + if (result && !skipCtor) { + var objCtor = object.constructor, + othCtor = other.constructor; + + // Non `Object` object instances with different constructors are not equal. + if (objCtor != othCtor && + ('constructor' in object && 'constructor' in other) && + !(typeof objCtor == 'function' && objCtor instanceof objCtor && + typeof othCtor == 'function' && othCtor instanceof othCtor)) { + result = false; + } + } + stack['delete'](object); + stack['delete'](other); + return result; +} + +/** + * Gets the data for `map`. + * + * @private + * @param {Object} map The map to query. + * @param {string} key The reference key. + * @returns {*} Returns the map data. + */ +function getMapData(map, key) { + var data = map.__data__; + return isKeyable(key) + ? data[typeof key == 'string' ? 'string' : 'hash'] + : data.map; +} + +/** + * Gets the property names, values, and compare flags of `object`. + * + * @private + * @param {Object} object The object to query. + * @returns {Array} Returns the match data of `object`. + */ +function getMatchData(object) { + var result = keys(object), + length = result.length; + + while (length--) { + var key = result[length], + value = object[key]; + + result[length] = [key, value, isStrictComparable(value)]; + } + return result; +} + +/** + * Gets the native function at `key` of `object`. + * + * @private + * @param {Object} object The object to query. + * @param {string} key The key of the method to get. + * @returns {*} Returns the function if it's native, else `undefined`. + */ +function getNative(object, key) { + var value = getValue(object, key); + return baseIsNative(value) ? value : undefined; +} + +/** + * Gets the `toStringTag` of `value`. + * + * @private + * @param {*} value The value to query. + * @returns {string} Returns the `toStringTag`. + */ +var getTag = baseGetTag; + +// Fallback for data views, maps, sets, and weak maps in IE 11, +// for data views in Edge < 14, and promises in Node.js. +if ((DataView && getTag(new DataView(new ArrayBuffer(1))) != dataViewTag) || + (Map && getTag(new Map) != mapTag) || + (Promise && getTag(Promise.resolve()) != promiseTag) || + (Set && getTag(new Set) != setTag) || + (WeakMap && getTag(new WeakMap) != weakMapTag)) { + getTag = function(value) { + var result = objectToString.call(value), + Ctor = result == objectTag ? value.constructor : undefined, + ctorString = Ctor ? toSource(Ctor) : undefined; + + if (ctorString) { + switch (ctorString) { + case dataViewCtorString: return dataViewTag; + case mapCtorString: return mapTag; + case promiseCtorString: return promiseTag; + case setCtorString: return setTag; + case weakMapCtorString: return weakMapTag; + } + } + return result; + }; +} + +/** + * Checks if `path` exists on `object`. + * + * @private + * @param {Object} object The object to query. + * @param {Array|string} path The path to check. + * @param {Function} hasFunc The function to check properties. + * @returns {boolean} Returns `true` if `path` exists, else `false`. + */ +function hasPath(object, path, hasFunc) { + path = isKey(path, object) ? [path] : castPath(path); + + var result, + index = -1, + length = path.length; + + while (++index < length) { + var key = toKey(path[index]); + if (!(result = object != null && hasFunc(object, key))) { + break; + } + object = object[key]; + } + if (result) { + return result; + } + var length = object ? object.length : 0; + return !!length && isLength(length) && isIndex(key, length) && + (isArray(object) || isArguments(object)); +} + +/** + * Checks if `value` is a flattenable `arguments` object or array. + * + * @private + * @param {*} value The value to check. + * @returns {boolean} Returns `true` if `value` is flattenable, else `false`. + */ +function isFlattenable(value) { + return isArray(value) || isArguments(value) || + !!(spreadableSymbol && value && value[spreadableSymbol]); +} + +/** + * Checks if `value` is a valid array-like index. + * + * @private + * @param {*} value The value to check. + * @param {number} [length=MAX_SAFE_INTEGER] The upper bounds of a valid index. + * @returns {boolean} Returns `true` if `value` is a valid index, else `false`. + */ +function isIndex(value, length) { + length = length == null ? MAX_SAFE_INTEGER : length; + return !!length && + (typeof value == 'number' || reIsUint.test(value)) && + (value > -1 && value % 1 == 0 && value < length); +} + +/** + * Checks if the given arguments are from an iteratee call. + * + * @private + * @param {*} value The potential iteratee value argument. + * @param {*} index The potential iteratee index or key argument. + * @param {*} object The potential iteratee object argument. + * @returns {boolean} Returns `true` if the arguments are from an iteratee call, + * else `false`. + */ +function isIterateeCall(value, index, object) { + if (!isObject(object)) { + return false; + } + var type = typeof index; + if (type == 'number' + ? (isArrayLike(object) && isIndex(index, object.length)) + : (type == 'string' && index in object) + ) { + return eq(object[index], value); + } + return false; +} + +/** + * Checks if `value` is a property name and not a property path. + * + * @private + * @param {*} value The value to check. + * @param {Object} [object] The object to query keys on. + * @returns {boolean} Returns `true` if `value` is a property name, else `false`. + */ +function isKey(value, object) { + if (isArray(value)) { + return false; + } + var type = typeof value; + if (type == 'number' || type == 'symbol' || type == 'boolean' || + value == null || isSymbol(value)) { + return true; + } + return reIsPlainProp.test(value) || !reIsDeepProp.test(value) || + (object != null && value in Object(object)); +} + +/** + * Checks if `value` is suitable for use as unique object key. + * + * @private + * @param {*} value The value to check. + * @returns {boolean} Returns `true` if `value` is suitable, else `false`. + */ +function isKeyable(value) { + var type = typeof value; + return (type == 'string' || type == 'number' || type == 'symbol' || type == 'boolean') + ? (value !== '__proto__') + : (value === null); +} + +/** + * Checks if `func` has its source masked. + * + * @private + * @param {Function} func The function to check. + * @returns {boolean} Returns `true` if `func` is masked, else `false`. + */ +function isMasked(func) { + return !!maskSrcKey && (maskSrcKey in func); +} + +/** + * Checks if `value` is likely a prototype object. + * + * @private + * @param {*} value The value to check. + * @returns {boolean} Returns `true` if `value` is a prototype, else `false`. + */ +function isPrototype(value) { + var Ctor = value && value.constructor, + proto = (typeof Ctor == 'function' && Ctor.prototype) || objectProto; + + return value === proto; +} + +/** + * Checks if `value` is suitable for strict equality comparisons, i.e. `===`. + * + * @private + * @param {*} value The value to check. + * @returns {boolean} Returns `true` if `value` if suitable for strict + * equality comparisons, else `false`. + */ +function isStrictComparable(value) { + return value === value && !isObject(value); +} + +/** + * A specialized version of `matchesProperty` for source values suitable + * for strict equality comparisons, i.e. `===`. + * + * @private + * @param {string} key The key of the property to get. + * @param {*} srcValue The value to match. + * @returns {Function} Returns the new spec function. + */ +function matchesStrictComparable(key, srcValue) { + return function(object) { + if (object == null) { + return false; + } + return object[key] === srcValue && + (srcValue !== undefined || (key in Object(object))); + }; +} + +/** + * Converts `string` to a property path array. + * + * @private + * @param {string} string The string to convert. + * @returns {Array} Returns the property path array. + */ +var stringToPath = memoize(function(string) { + string = toString(string); + + var result = []; + if (reLeadingDot.test(string)) { + result.push(''); + } + string.replace(rePropName, function(match, number, quote, string) { + result.push(quote ? string.replace(reEscapeChar, '$1') : (number || match)); + }); + return result; +}); + +/** + * Converts `value` to a string key if it's not a string or symbol. + * + * @private + * @param {*} value The value to inspect. + * @returns {string|symbol} Returns the key. + */ +function toKey(value) { + if (typeof value == 'string' || isSymbol(value)) { + return value; + } + var result = (value + ''); + return (result == '0' && (1 / value) == -INFINITY) ? '-0' : result; +} + +/** + * Converts `func` to its source code. + * + * @private + * @param {Function} func The function to process. + * @returns {string} Returns the source code. + */ +function toSource(func) { + if (func != null) { + try { + return funcToString.call(func); + } catch (e) {} + try { + return (func + ''); + } catch (e) {} + } + return ''; +} + +/** + * Creates an array of elements, sorted in ascending order by the results of + * running each element in a collection thru each iteratee. This method + * performs a stable sort, that is, it preserves the original sort order of + * equal elements. The iteratees are invoked with one argument: (value). + * + * @static + * @memberOf _ + * @since 0.1.0 + * @category Collection + * @param {Array|Object} collection The collection to iterate over. + * @param {...(Function|Function[])} [iteratees=[_.identity]] + * The iteratees to sort by. + * @returns {Array} Returns the new sorted array. + * @example + * + * var users = [ + * { 'user': 'fred', 'age': 48 }, + * { 'user': 'barney', 'age': 36 }, + * { 'user': 'fred', 'age': 40 }, + * { 'user': 'barney', 'age': 34 } + * ]; + * + * _.sortBy(users, function(o) { return o.user; }); + * // => objects for [['barney', 36], ['barney', 34], ['fred', 48], ['fred', 40]] + * + * _.sortBy(users, ['user', 'age']); + * // => objects for [['barney', 34], ['barney', 36], ['fred', 40], ['fred', 48]] + * + * _.sortBy(users, 'user', function(o) { + * return Math.floor(o.age / 10); + * }); + * // => objects for [['barney', 36], ['barney', 34], ['fred', 48], ['fred', 40]] + */ +var sortBy = baseRest(function(collection, iteratees) { + if (collection == null) { + return []; + } + var length = iteratees.length; + if (length > 1 && isIterateeCall(collection, iteratees[0], iteratees[1])) { + iteratees = []; + } else if (length > 2 && isIterateeCall(iteratees[0], iteratees[1], iteratees[2])) { + iteratees = [iteratees[0]]; + } + return baseOrderBy(collection, baseFlatten(iteratees, 1), []); +}); + +/** + * Creates a function that memoizes the result of `func`. If `resolver` is + * provided, it determines the cache key for storing the result based on the + * arguments provided to the memoized function. By default, the first argument + * provided to the memoized function is used as the map cache key. The `func` + * is invoked with the `this` binding of the memoized function. + * + * **Note:** The cache is exposed as the `cache` property on the memoized + * function. Its creation may be customized by replacing the `_.memoize.Cache` + * constructor with one whose instances implement the + * [`Map`](http://ecma-international.org/ecma-262/7.0/#sec-properties-of-the-map-prototype-object) + * method interface of `delete`, `get`, `has`, and `set`. + * + * @static + * @memberOf _ + * @since 0.1.0 + * @category Function + * @param {Function} func The function to have its output memoized. + * @param {Function} [resolver] The function to resolve the cache key. + * @returns {Function} Returns the new memoized function. + * @example + * + * var object = { 'a': 1, 'b': 2 }; + * var other = { 'c': 3, 'd': 4 }; + * + * var values = _.memoize(_.values); + * values(object); + * // => [1, 2] + * + * values(other); + * // => [3, 4] + * + * object.a = 2; + * values(object); + * // => [1, 2] + * + * // Modify the result cache. + * values.cache.set(object, ['a', 'b']); + * values(object); + * // => ['a', 'b'] + * + * // Replace `_.memoize.Cache`. + * _.memoize.Cache = WeakMap; + */ +function memoize(func, resolver) { + if (typeof func != 'function' || (resolver && typeof resolver != 'function')) { + throw new TypeError(FUNC_ERROR_TEXT); + } + var memoized = function() { + var args = arguments, + key = resolver ? resolver.apply(this, args) : args[0], + cache = memoized.cache; + + if (cache.has(key)) { + return cache.get(key); + } + var result = func.apply(this, args); + memoized.cache = cache.set(key, result); + return result; + }; + memoized.cache = new (memoize.Cache || MapCache); + return memoized; +} + +// Assign cache to `_.memoize`. +memoize.Cache = MapCache; + +/** + * Performs a + * [`SameValueZero`](http://ecma-international.org/ecma-262/7.0/#sec-samevaluezero) + * comparison between two values to determine if they are equivalent. + * + * @static + * @memberOf _ + * @since 4.0.0 + * @category Lang + * @param {*} value The value to compare. + * @param {*} other The other value to compare. + * @returns {boolean} Returns `true` if the values are equivalent, else `false`. + * @example + * + * var object = { 'a': 1 }; + * var other = { 'a': 1 }; + * + * _.eq(object, object); + * // => true + * + * _.eq(object, other); + * // => false + * + * _.eq('a', 'a'); + * // => true + * + * _.eq('a', Object('a')); + * // => false + * + * _.eq(NaN, NaN); + * // => true + */ +function eq(value, other) { + return value === other || (value !== value && other !== other); +} + +/** + * Checks if `value` is likely an `arguments` object. + * + * @static + * @memberOf _ + * @since 0.1.0 + * @category Lang + * @param {*} value The value to check. + * @returns {boolean} Returns `true` if `value` is an `arguments` object, + * else `false`. + * @example + * + * _.isArguments(function() { return arguments; }()); + * // => true + * + * _.isArguments([1, 2, 3]); + * // => false + */ +function isArguments(value) { + // Safari 8.1 makes `arguments.callee` enumerable in strict mode. + return isArrayLikeObject(value) && hasOwnProperty.call(value, 'callee') && + (!propertyIsEnumerable.call(value, 'callee') || objectToString.call(value) == argsTag); +} + +/** + * Checks if `value` is classified as an `Array` object. + * + * @static + * @memberOf _ + * @since 0.1.0 + * @category Lang + * @param {*} value The value to check. + * @returns {boolean} Returns `true` if `value` is an array, else `false`. + * @example + * + * _.isArray([1, 2, 3]); + * // => true + * + * _.isArray(document.body.children); + * // => false + * + * _.isArray('abc'); + * // => false + * + * _.isArray(_.noop); + * // => false + */ +var isArray = Array.isArray; + +/** + * Checks if `value` is array-like. A value is considered array-like if it's + * not a function and has a `value.length` that's an integer greater than or + * equal to `0` and less than or equal to `Number.MAX_SAFE_INTEGER`. + * + * @static + * @memberOf _ + * @since 4.0.0 + * @category Lang + * @param {*} value The value to check. + * @returns {boolean} Returns `true` if `value` is array-like, else `false`. + * @example + * + * _.isArrayLike([1, 2, 3]); + * // => true + * + * _.isArrayLike(document.body.children); + * // => true + * + * _.isArrayLike('abc'); + * // => true + * + * _.isArrayLike(_.noop); + * // => false + */ +function isArrayLike(value) { + return value != null && isLength(value.length) && !isFunction(value); +} + +/** + * This method is like `_.isArrayLike` except that it also checks if `value` + * is an object. + * + * @static + * @memberOf _ + * @since 4.0.0 + * @category Lang + * @param {*} value The value to check. + * @returns {boolean} Returns `true` if `value` is an array-like object, + * else `false`. + * @example + * + * _.isArrayLikeObject([1, 2, 3]); + * // => true + * + * _.isArrayLikeObject(document.body.children); + * // => true + * + * _.isArrayLikeObject('abc'); + * // => false + * + * _.isArrayLikeObject(_.noop); + * // => false + */ +function isArrayLikeObject(value) { + return isObjectLike(value) && isArrayLike(value); +} + +/** + * Checks if `value` is classified as a `Function` object. + * + * @static + * @memberOf _ + * @since 0.1.0 + * @category Lang + * @param {*} value The value to check. + * @returns {boolean} Returns `true` if `value` is a function, else `false`. + * @example + * + * _.isFunction(_); + * // => true + * + * _.isFunction(/abc/); + * // => false + */ +function isFunction(value) { + // The use of `Object#toString` avoids issues with the `typeof` operator + // in Safari 8-9 which returns 'object' for typed array and other constructors. + var tag = isObject(value) ? objectToString.call(value) : ''; + return tag == funcTag || tag == genTag; +} + +/** + * Checks if `value` is a valid array-like length. + * + * **Note:** This method is loosely based on + * [`ToLength`](http://ecma-international.org/ecma-262/7.0/#sec-tolength). + * + * @static + * @memberOf _ + * @since 4.0.0 + * @category Lang + * @param {*} value The value to check. + * @returns {boolean} Returns `true` if `value` is a valid length, else `false`. + * @example + * + * _.isLength(3); + * // => true + * + * _.isLength(Number.MIN_VALUE); + * // => false + * + * _.isLength(Infinity); + * // => false + * + * _.isLength('3'); + * // => false + */ +function isLength(value) { + return typeof value == 'number' && + value > -1 && value % 1 == 0 && value <= MAX_SAFE_INTEGER; +} + +/** + * Checks if `value` is the + * [language type](http://www.ecma-international.org/ecma-262/7.0/#sec-ecmascript-language-types) + * of `Object`. (e.g. arrays, functions, objects, regexes, `new Number(0)`, and `new String('')`) + * + * @static + * @memberOf _ + * @since 0.1.0 + * @category Lang + * @param {*} value The value to check. + * @returns {boolean} Returns `true` if `value` is an object, else `false`. + * @example + * + * _.isObject({}); + * // => true + * + * _.isObject([1, 2, 3]); + * // => true + * + * _.isObject(_.noop); + * // => true + * + * _.isObject(null); + * // => false + */ +function isObject(value) { + var type = typeof value; + return !!value && (type == 'object' || type == 'function'); +} + +/** + * Checks if `value` is object-like. A value is object-like if it's not `null` + * and has a `typeof` result of "object". + * + * @static + * @memberOf _ + * @since 4.0.0 + * @category Lang + * @param {*} value The value to check. + * @returns {boolean} Returns `true` if `value` is object-like, else `false`. + * @example + * + * _.isObjectLike({}); + * // => true + * + * _.isObjectLike([1, 2, 3]); + * // => true + * + * _.isObjectLike(_.noop); + * // => false + * + * _.isObjectLike(null); + * // => false + */ +function isObjectLike(value) { + return !!value && typeof value == 'object'; +} + +/** + * Checks if `value` is classified as a `Symbol` primitive or object. + * + * @static + * @memberOf _ + * @since 4.0.0 + * @category Lang + * @param {*} value The value to check. + * @returns {boolean} Returns `true` if `value` is a symbol, else `false`. + * @example + * + * _.isSymbol(Symbol.iterator); + * // => true + * + * _.isSymbol('abc'); + * // => false + */ +function isSymbol(value) { + return typeof value == 'symbol' || + (isObjectLike(value) && objectToString.call(value) == symbolTag); +} + +/** + * Checks if `value` is classified as a typed array. + * + * @static + * @memberOf _ + * @since 3.0.0 + * @category Lang + * @param {*} value The value to check. + * @returns {boolean} Returns `true` if `value` is a typed array, else `false`. + * @example + * + * _.isTypedArray(new Uint8Array); + * // => true + * + * _.isTypedArray([]); + * // => false + */ +var isTypedArray = nodeIsTypedArray ? baseUnary(nodeIsTypedArray) : baseIsTypedArray; + +/** + * Converts `value` to a string. An empty string is returned for `null` + * and `undefined` values. The sign of `-0` is preserved. + * + * @static + * @memberOf _ + * @since 4.0.0 + * @category Lang + * @param {*} value The value to process. + * @returns {string} Returns the string. + * @example + * + * _.toString(null); + * // => '' + * + * _.toString(-0); + * // => '-0' + * + * _.toString([1, 2, 3]); + * // => '1,2,3' + */ +function toString(value) { + return value == null ? '' : baseToString(value); +} + +/** + * Gets the value at `path` of `object`. If the resolved value is + * `undefined`, the `defaultValue` is returned in its place. + * + * @static + * @memberOf _ + * @since 3.7.0 + * @category Object + * @param {Object} object The object to query. + * @param {Array|string} path The path of the property to get. + * @param {*} [defaultValue] The value returned for `undefined` resolved values. + * @returns {*} Returns the resolved value. + * @example + * + * var object = { 'a': [{ 'b': { 'c': 3 } }] }; + * + * _.get(object, 'a[0].b.c'); + * // => 3 + * + * _.get(object, ['a', '0', 'b', 'c']); + * // => 3 + * + * _.get(object, 'a.b.c', 'default'); + * // => 'default' + */ +function get(object, path, defaultValue) { + var result = object == null ? undefined : baseGet(object, path); + return result === undefined ? defaultValue : result; +} + +/** + * Checks if `path` is a direct or inherited property of `object`. + * + * @static + * @memberOf _ + * @since 4.0.0 + * @category Object + * @param {Object} object The object to query. + * @param {Array|string} path The path to check. + * @returns {boolean} Returns `true` if `path` exists, else `false`. + * @example + * + * var object = _.create({ 'a': _.create({ 'b': 2 }) }); + * + * _.hasIn(object, 'a'); + * // => true + * + * _.hasIn(object, 'a.b'); + * // => true + * + * _.hasIn(object, ['a', 'b']); + * // => true + * + * _.hasIn(object, 'b'); + * // => false + */ +function hasIn(object, path) { + return object != null && hasPath(object, path, baseHasIn); +} + +/** + * Creates an array of the own enumerable property names of `object`. + * + * **Note:** Non-object values are coerced to objects. See the + * [ES spec](http://ecma-international.org/ecma-262/7.0/#sec-object.keys) + * for more details. + * + * @static + * @since 0.1.0 + * @memberOf _ + * @category Object + * @param {Object} object The object to query. + * @returns {Array} Returns the array of property names. + * @example + * + * function Foo() { + * this.a = 1; + * this.b = 2; + * } + * + * Foo.prototype.c = 3; + * + * _.keys(new Foo); + * // => ['a', 'b'] (iteration order is not guaranteed) + * + * _.keys('hi'); + * // => ['0', '1'] + */ +function keys(object) { + return isArrayLike(object) ? arrayLikeKeys(object) : baseKeys(object); +} + +/** + * This method returns the first argument it receives. + * + * @static + * @since 0.1.0 + * @memberOf _ + * @category Util + * @param {*} value Any value. + * @returns {*} Returns `value`. + * @example + * + * var object = { 'a': 1 }; + * + * console.log(_.identity(object) === object); + * // => true + */ +function identity(value) { + return value; +} + +/** + * Creates a function that returns the value at `path` of a given object. + * + * @static + * @memberOf _ + * @since 2.4.0 + * @category Util + * @param {Array|string} path The path of the property to get. + * @returns {Function} Returns the new accessor function. + * @example + * + * var objects = [ + * { 'a': { 'b': 2 } }, + * { 'a': { 'b': 1 } } + * ]; + * + * _.map(objects, _.property('a.b')); + * // => [2, 1] + * + * _.map(_.sortBy(objects, _.property(['a', 'b'])), 'a.b'); + * // => [1, 2] + */ +function property(path) { + return isKey(path) ? baseProperty(toKey(path)) : basePropertyDeep(path); +} + +module.exports = sortBy; +}); + +var parsers$2 = createCommonjsModule(function (module, exports) { +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); + + + + +// The exponent value(s) at which toString returns exponential notation. +bignumber.BigNumber.config({ EXPONENTIAL_AT: [-5, 15] }); +class BaseNumberParser { + constructor(config) { + this.config = config; + let singleIntFrac = `${this.config.wordSeparatorToken}| -|${this.getKeyRegex(this.config.cardinalNumberMap)}|${this.getKeyRegex(this.config.ordinalNumberMap)}`; + this.textNumberRegex = recognizersText.RegExpUtility.getSafeRegExp(String.raw `(?=\b)(${singleIntFrac})(?=\b)`, "gis"); + this.arabicNumberRegex = recognizersText.RegExpUtility.getSafeRegExp(String.raw `\d+`, "is"); + this.roundNumberSet = new Set(); + this.config.roundNumberMap.forEach((value, key) => this.roundNumberSet.add(key)); + } + parse(extResult) { + // check if the parser is configured to support specific types + if (this.supportedTypes && !this.supportedTypes.find(t => t === extResult.type)) { + return null; + } + let ret = null; + let extra = extResult.data; + if (!extra) { + if (this.arabicNumberRegex.test(extResult.text)) { + extra = "Num"; + } + else { + extra = this.config.langMarker; + } + } + // Resolve symbol prefix + let isNegative = false; + let matchNegative = extResult.text.match(this.config.negativeNumberSignRegex); + if (matchNegative) { + isNegative = true; + extResult.text = extResult.text.substr(matchNegative[1].length); + } + if (extra.includes("Num")) { + ret = this.digitNumberParse(extResult); + } + else if (extra.includes(`Frac${this.config.langMarker}`)) // Frac is a special number, parse via another method + { + ret = this.fracLikeNumberParse(extResult); + } + else if (extra.includes(this.config.langMarker)) { + ret = this.textNumberParse(extResult); + } + else if (extra.includes("Pow")) { + ret = this.powerNumberParse(extResult); + } + if (ret && ret.value !== null) { + if (isNegative) { + // Recover to the original extracted Text + ret.text = matchNegative[1] + extResult.text; + // Check if ret.value is a BigNumber + if (typeof ret.value === "number") { + ret.value = -ret.value; + } + else { + ret.value.s = -1; + } + } + ret.resolutionStr = this.config.cultureInfo + ? this.config.cultureInfo.format(ret.value) + : ret.value.toString(); + } + return ret; + } + getKeyRegex(regexMap) { + let keys = new Array(); + regexMap.forEach((value, key) => keys.push(key)); + let sortKeys = lodash_sortby(keys, key => key.length).reverse(); + return sortKeys.join('|'); + } + digitNumberParse(extResult) { + let result = { + start: extResult.start, + length: extResult.length, + text: extResult.text, + type: extResult.type + }; + // [1] 24 + // [2] 12 32/33 + // [3] 1,000,000 + // [4] 234.567 + // [5] 44/55 + // [6] 2 hundred + // dot occured. + let power = 1; + let tmpIndex = -1; + let startIndex = 0; + let handle = extResult.text.toLowerCase(); + let matches = recognizersText.RegExpUtility.getMatches(this.config.digitalNumberRegex, handle); + if (matches) { + matches.forEach(match => { + // HACK: Matching regex may be buggy, may include a digit before the unit + match.value = match.value.replace(/\d/g, ''); + match.length = match.value.length; + let rep = this.config.roundNumberMap.get(match.value); + // \\s+ for filter the spaces. + power *= rep; + // tslint:disable-next-line:no-conditional-assignment + while ((tmpIndex = handle.indexOf(match.value, startIndex)) >= 0) { + let front = lodash_trimend(handle.substring(0, tmpIndex)); + startIndex = front.length; + handle = front + handle.substring(tmpIndex + match.length); + } + }); + } + // scale used in the calculate of double + result.value = this.getDigitalValue(handle, power); + return result; + } + isDigit(c) { + return c >= '0' && c <= '9'; + } + fracLikeNumberParse(extResult) { + let result = { + start: extResult.start, + length: extResult.length, + text: extResult.text, + type: extResult.type + }; + let resultText = extResult.text.toLowerCase(); + if (resultText.includes(this.config.fractionMarkerToken)) { + let overIndex = resultText.indexOf(this.config.fractionMarkerToken); + let smallPart = resultText.substring(0, overIndex).trim(); + let bigPart = resultText.substring(overIndex + this.config.fractionMarkerToken.length, resultText.length).trim(); + let smallValue = this.isDigit(smallPart[0]) + ? this.getDigitalValue(smallPart, 1) + : this.getIntValue(this.getMatches(smallPart)); + let bigValue = this.isDigit(bigPart[0]) + ? this.getDigitalValue(bigPart, 1) + : this.getIntValue(this.getMatches(bigPart)); + result.value = smallValue / bigValue; + } + else { + let words = resultText.split(" ").filter(s => s && s.length); + let fracWords = Array.from(this.config.normalizeTokenSet(words, result)); + // Split fraction with integer + let splitIndex = fracWords.length - 1; + let currentValue = this.config.resolveCompositeNumber(fracWords[splitIndex]); + let roundValue = 1; + for (splitIndex = fracWords.length - 2; splitIndex >= 0; splitIndex--) { + if (this.config.writtenFractionSeparatorTexts.indexOf(fracWords[splitIndex]) > -1 || + this.config.writtenIntegerSeparatorTexts.indexOf(fracWords[splitIndex]) > -1) { + continue; + } + let previousValue = currentValue; + currentValue = this.config.resolveCompositeNumber(fracWords[splitIndex]); + let smHundreds = 100; + // previous : hundred + // current : one + if ((previousValue >= smHundreds && previousValue > currentValue) + || (previousValue < smHundreds && this.isComposable(currentValue, previousValue))) { + if (previousValue < smHundreds && currentValue >= roundValue) { + roundValue = currentValue; + } + else if (previousValue < smHundreds && currentValue < roundValue) { + splitIndex++; + break; + } + // current is the first word + if (splitIndex === 0) { + // scan, skip the first word + splitIndex = 1; + while (splitIndex <= fracWords.length - 2) { + // e.g. one hundred thousand + // frac[i+1] % 100 && frac[i] % 100 = 0 + if (this.config.resolveCompositeNumber(fracWords[splitIndex]) >= smHundreds + && !(this.config.writtenFractionSeparatorTexts.indexOf(fracWords[splitIndex + 1]) > -1) + && this.config.resolveCompositeNumber(fracWords[splitIndex + 1]) < smHundreds) { + splitIndex++; + break; + } + splitIndex++; + } + break; + } + continue; + } + splitIndex++; + break; + } + let fracPart = new Array(); + for (let i = splitIndex; i < fracWords.length; i++) { + if (fracWords[i].indexOf("-") > -1) { + let split = fracWords[i].split('-'); + fracPart.push(split[0]); + fracPart.push("-"); + fracPart.push(split[1]); + } + else { + fracPart.push(fracWords[i]); + } + } + fracWords.splice(splitIndex, fracWords.length - splitIndex); + // denomi = denominator + let denomiValue = this.getIntValue(fracPart); + // Split mixed number with fraction + let numerValue = 0; + let intValue = 0; + let mixedIndex = fracWords.length; + for (let i = fracWords.length - 1; i >= 0; i--) { + if (i < fracWords.length - 1 && this.config.writtenFractionSeparatorTexts.indexOf(fracWords[i]) > -1) { + let numerStr = fracWords.slice(i + 1, fracWords.length).join(" "); + numerValue = this.getIntValue(this.getMatches(numerStr)); + mixedIndex = i + 1; + break; + } + } + let intStr = fracWords.slice(0, mixedIndex).join(" "); + intValue = this.getIntValue(this.getMatches(intStr)); + // Find mixed number + if (mixedIndex !== fracWords.length && numerValue < denomiValue) { + // intValue + numerValue / denomiValue + result.value = new bignumber.BigNumber(intValue).plus(new bignumber.BigNumber(numerValue).dividedBy(denomiValue)); + } + else { + // (intValue + numerValue) / denomiValue + result.value = new bignumber.BigNumber(intValue + numerValue).dividedBy(denomiValue); + } + } + return result; + } + textNumberParse(extResult) { + let result = { + start: extResult.start, + length: extResult.length, + text: extResult.text, + type: extResult.type + }; + let handle = extResult.text.toLowerCase(); + handle = handle.replace(this.config.halfADozenRegex, this.config.halfADozenText); + let numGroup = this.splitMulti(handle, Array.from(this.config.writtenDecimalSeparatorTexts)).filter(s => s && s.length > 0); + let intPart = numGroup[0]; + let matchStrs = intPart + ? intPart.match(this.textNumberRegex).map(s => s.toLowerCase()) + : new Array(); + // Get the value recursively + let intPartRet = this.getIntValue(matchStrs); + let pointPartRet = 0; + if (numGroup.length === 2) { + let pointPart = numGroup[1]; + let matchStrs = pointPart.match(this.textNumberRegex).map(s => s.toLowerCase()); + pointPartRet += this.getPointValue(matchStrs); + } + result.value = intPartRet + pointPartRet; + return result; + } + powerNumberParse(extResult) { + let result = { + start: extResult.start, + length: extResult.length, + text: extResult.text, + type: extResult.type + }; + let handle = extResult.text.toUpperCase(); + let isE = !extResult.text.includes("^"); + // [1] 1e10 + // [2] 1.1^-23 + let calStack = new Array(); + let scale = new bignumber.BigNumber(10); + let dot = false; + let isNegative = false; + let tmp = new bignumber.BigNumber(0); + for (let i = 0; i < handle.length; i++) { + let ch = handle[i]; + if (ch === '^' || ch === 'E') { + if (isNegative) { + calStack.push(tmp.negated()); + } + else { + calStack.push(tmp); + } + tmp = new bignumber.BigNumber(0); + scale = new bignumber.BigNumber(10); + dot = false; + isNegative = false; + } + else if (ch.charCodeAt(0) - 48 >= 0 && ch.charCodeAt(0) - 48 <= 9) { + if (dot) { + // tmp = tmp + scale * (ch.charCodeAt(0) - 48); + // scale *= 0.1; + tmp = tmp.plus(scale.times(ch.charCodeAt(0) - 48)); + scale = scale.times(0.1); + } + else { + // tmp = tmp * scale + (ch.charCodeAt(0) - 48); + tmp = tmp.times(scale).plus(ch.charCodeAt(0) - 48); + } + } + else if (ch === this.config.decimalSeparatorChar) { + dot = true; + scale = new bignumber.BigNumber(0.1); + } + else if (ch === '-') { + isNegative = !isNegative; + } + else if (ch === '+') { + continue; + } + if (i === handle.length - 1) { + if (isNegative) { + calStack.push(tmp.negated()); + } + else { + calStack.push(tmp); + } + } + } + let ret = 0; + if (isE) { + // ret = calStack.shift() * Math.pow(10, calStack.shift()); + ret = calStack.shift().times(Math.pow(10, calStack.shift().toNumber())).toNumber(); + } + else { + ret = Math.pow(calStack.shift().toNumber(), calStack.shift().toNumber()); + } + result.value = ret; + result.resolutionStr = ret.toString(); // @TODO Possible Culture bug. + return result; + } + splitMulti(str, tokens) { + let tempChar = tokens[0]; // We can use the first token as a temporary join character + for (let i = 0; i < tokens.length; i++) { + str = str.split(tokens[i]).join(tempChar); + } + return str.split(tempChar); + } + getMatches(input) { + let matches = input.match(this.textNumberRegex); + return (matches || []).map(match => { + return match.toLowerCase(); + }); + } + // Test if big and combine with small. + // e.g. "hundred" can combine with "thirty" but "twenty" can't combine with "thirty". + isComposable(big, small) { + let baseNumber = small > 10 ? 100 : 10; + if (big % baseNumber === 0 && big / baseNumber >= 1) { + return true; + } + return false; + } + getIntValue(matchStrs) { + let isEnd = new Array(matchStrs.length); + for (let i = 0; i < isEnd.length; i++) { + isEnd[i] = false; + } + let tempValue = 0; + let endFlag = 1; + // Scan from end to start, find the end word + for (let i = matchStrs.length - 1; i >= 0; i--) { + if (this.roundNumberSet.has(matchStrs[i])) { + // if false,then continue + // You will meet hundred first, then thousand. + if (endFlag > this.config.roundNumberMap.get(matchStrs[i])) { + continue; + } + isEnd[i] = true; + endFlag = this.config.roundNumberMap.get(matchStrs[i]); + } + } + if (endFlag === 1) { + let tempStack = new Array(); + let oldSym = ""; + matchStrs.forEach(matchStr => { + let isCardinal = this.config.cardinalNumberMap.has(matchStr); + let isOrdinal = this.config.ordinalNumberMap.has(matchStr); + if (isCardinal || isOrdinal) { + let matchValue = isCardinal + ? this.config.cardinalNumberMap.get(matchStr) + : this.config.ordinalNumberMap.get(matchStr); + // This is just for ordinal now. Not for fraction ever. + if (isOrdinal) { + let fracPart = this.config.ordinalNumberMap.get(matchStr); + if (tempStack.length > 0) { + let intPart = tempStack.pop(); + // if intPart >= fracPart, it means it is an ordinal number + // it begins with an integer, ends with an ordinal + // e.g. ninety-ninth + if (intPart >= fracPart) { + tempStack.push(intPart + fracPart); + } + // another case of the type is ordinal + // e.g. three hundredth + else { + while (tempStack.length > 0) { + intPart = intPart + tempStack.pop(); + } + tempStack.push(intPart * fracPart); + } + } + else { + tempStack.push(fracPart); + } + } + else if (this.config.cardinalNumberMap.has(matchStr)) { + if (oldSym === "-") { + let sum = tempStack.pop() + matchValue; + tempStack.push(sum); + } + else if (oldSym === this.config.writtenIntegerSeparatorTexts[0] || tempStack.length < 2) { + tempStack.push(matchValue); + } + else if (tempStack.length >= 2) { + let sum = tempStack.pop() + matchValue; + sum = tempStack.pop() + sum; + tempStack.push(sum); + } + } + } + else { + let complexValue = this.config.resolveCompositeNumber(matchStr); + if (complexValue !== 0) { + tempStack.push(complexValue); + } + } + oldSym = matchStr; + }); + tempStack.forEach(stackValue => { + tempValue += stackValue; + }); + } + else { + let lastIndex = 0; + let mulValue = 1; + let partValue = 1; + for (let i = 0; i < isEnd.length; i++) { + if (isEnd[i]) { + mulValue = this.config.roundNumberMap.get(matchStrs[i]); + partValue = 1; + if (i !== 0) { + partValue = this.getIntValue(matchStrs.slice(lastIndex, i)); + } + tempValue += mulValue * partValue; + lastIndex = i + 1; + } + } + // Calculate the part like "thirty-one" + mulValue = 1; + if (lastIndex !== isEnd.length) { + partValue = this.getIntValue(matchStrs.slice(lastIndex, isEnd.length)); + tempValue += mulValue * partValue; + } + } + return tempValue; + } + getPointValue(matchStrs) { + let ret = 0; + let firstMatch = matchStrs[0]; + if (this.config.cardinalNumberMap.has(firstMatch) && this.config.cardinalNumberMap.get(firstMatch) >= 10) { + let prefix = "0."; + let tempInt = this.getIntValue(matchStrs); + let all = prefix + tempInt; + ret = parseFloat(all); + } + else { + let scale = new bignumber.BigNumber(0.1); + for (let i = 0; i < matchStrs.length; i++) { + ret += scale.times(this.config.cardinalNumberMap.get(matchStrs[i])).toNumber(); + // scale *= 0.1; + scale = scale.times(0.1); + } + } + return ret; + } + skipNonDecimalSeparator(ch, distance, culture) { + var decimalLength = 3; + // Special cases for multi-language countries where decimal separators can be used interchangeably. Mostly informally. + // Ex: South Africa, Namibia; Puerto Rico in ES; or in Canada for EN and FR. + // "me pidio $5.00 prestados" and "me pidio $5,00 prestados" -> currency $5 + var cultureRegex = recognizersText.RegExpUtility.getSafeRegExp(String.raw `^(en|es|fr)(-)?\b`, "is"); + return (ch == this.config.nonDecimalSeparatorChar && !(distance <= decimalLength && (cultureRegex.exec(culture.code) !== null))); + } + getDigitalValue(digitsStr, power) { + let tmp = new bignumber.BigNumber(0); + let scale = new bignumber.BigNumber(10); + let decimalSeparator = false; + var strLength = digitsStr.length; + let isNegative = false; + let isFrac = digitsStr.includes('/'); + let calStack = new Array(); + for (let i = 0; i < digitsStr.length; i++) { + let ch = digitsStr[i]; + var skippableNonDecimal = this.skipNonDecimalSeparator(ch, strLength - i, this.config.cultureInfo); + if (!isFrac && (ch === ' ' || skippableNonDecimal)) { + continue; + } + if (ch === ' ' || ch === '/') { + calStack.push(tmp); + tmp = new bignumber.BigNumber(0); + } + else if (ch >= '0' && ch <= '9') { + if (decimalSeparator) { + // tmp = tmp + scale * (ch.charCodeAt(0) - 48); + // scale *= 0.1; + tmp = tmp.plus(scale.times(ch.charCodeAt(0) - 48)); + scale = scale.times(0.1); + } + else { + // tmp = tmp * scale + (ch.charCodeAt(0) - 48); + tmp = tmp.times(scale).plus(ch.charCodeAt(0) - 48); + } + } + else if (ch === this.config.decimalSeparatorChar || (!skippableNonDecimal && ch == this.config.nonDecimalSeparatorChar)) { + decimalSeparator = true; + scale = new bignumber.BigNumber(0.1); + } + else if (ch === '-') { + isNegative = true; + } + } + calStack.push(tmp); + // if the number is a fraction. + let calResult = new bignumber.BigNumber(0); + if (isFrac) { + let deno = calStack.pop(); + let mole = calStack.pop(); + // calResult += mole / deno; + calResult = calResult.plus(mole.dividedBy(deno)); + } + while (calStack.length > 0) { + calResult = calResult.plus(calStack.pop()); + } + // calResult *= power; + calResult = calResult.times(power); + if (isNegative) { + return calResult.negated().toNumber(); + } + return calResult.toNumber(); + } +} +exports.BaseNumberParser = BaseNumberParser; +class BasePercentageParser extends BaseNumberParser { + parse(extResult) { + let originText = extResult.text; + // do replace text & data from extended info + if (extResult.data && extResult.data instanceof Array) { + extResult.text = extResult.data[0]; + extResult.data = extResult.data[1].data; + } + let ret = super.parse(extResult); + if (ret.resolutionStr && ret.resolutionStr.length > 0) { + if (!ret.resolutionStr.trim().endsWith("%")) { + ret.resolutionStr = ret.resolutionStr.trim() + "%"; + } + } + ret.data = extResult.text; + ret.text = originText; + return ret; + } +} +exports.BasePercentageParser = BasePercentageParser; + +}); + +unwrapExports(parsers$2); + +var cjkParsers = createCommonjsModule(function (module, exports) { +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); + + + +const recognizers_text_2 = recognizersText; +class BaseCJKNumberParser extends parsers$2.BaseNumberParser { + constructor(config) { + super(config); + this.config = config; + } + toString(value) { + return this.config.cultureInfo + ? this.config.cultureInfo.format(value) + : value.toString(); + } + parse(extResult) { + let extra = ''; + let result; + extra = extResult.data; + let getExtResult = { + start: extResult.start, + length: extResult.length, + data: extResult.data, + text: this.replaceTraditionalWithSimplified(extResult.text), + type: extResult.type + }; + if (!extra) { + return result; + } + if (extra.includes("Per")) { + result = this.perParseCJK(getExtResult); + } + else if (extra.includes("Num")) { + getExtResult.text = this.replaceFullWithHalf(getExtResult.text); + result = this.digitNumberParse(getExtResult); + if (this.config.negativeNumberSignRegex.test(getExtResult.text) && result.value > 0) { + result.value = -result.value; + } + result.resolutionStr = this.toString(result.value); + } + else if (extra.includes("Pow")) { + getExtResult.text = this.replaceFullWithHalf(getExtResult.text); + result = this.powerNumberParse(getExtResult); + result.resolutionStr = this.toString(result.value); + } + else if (extra.includes("Frac")) { + result = this.fracParseCJK(getExtResult); + } + else if (extra.includes("Dou")) { + result = this.douParseCJK(getExtResult); + } + else if (extra.includes("Integer")) { + result = this.intParseCJK(getExtResult); + } + else if (extra.includes("Ordinal")) { + result = this.ordParseCJK(getExtResult); + } + if (result) { + result.text = extResult.text; + } + return result; + } + replaceTraditionalWithSimplified(value) { + if (recognizers_text_2.StringUtility.isNullOrWhitespace(value)) { + return value; + } + if (this.config.tratoSimMap == null) { + return value; + } + let result = ''; + for (let index = 0; index < value.length; index++) { + result = result.concat(this.config.tratoSimMap.get(value.charAt(index)) || value.charAt(index)); + } + return result; + } + replaceFullWithHalf(value) { + if (recognizers_text_2.StringUtility.isNullOrWhitespace(value)) { + return value; + } + let result = ''; + for (let index = 0; index < value.length; index++) { + result = result.concat(this.config.fullToHalfMap.get(value.charAt(index)) || value.charAt(index)); + } + return result; + } + replaceUnit(value) { + if (recognizers_text_2.StringUtility.isNullOrEmpty(value)) + return value; + let result = value; + this.config.unitMap.forEach((value, key) => { + result = result.replace(new RegExp(key, 'g'), value); + }); + return result; + } + perParseCJK(extResult) { + let result = new recognizersText.ParseResult(extResult); + let resultText = extResult.text; + let power = 1; + if (extResult.data.includes("Spe")) { + resultText = this.replaceFullWithHalf(resultText); + resultText = this.replaceUnit(resultText); + if (resultText === "半額" || resultText === "半折" || resultText === "半折") { + result.value = 50; + } + else if (resultText === "10成" || resultText === "10割" || resultText === "十割") { + result.value = 100; + } + else { + let matches = recognizers_text_2.RegExpUtility.getMatches(this.config.speGetNumberRegex, resultText); + let intNumber; + if (matches.length === 2) { + let intNumberChar = matches[0].value.charAt(0); + if (intNumberChar === '対' || intNumberChar === "对") { + intNumber = 5; + } + else if (intNumberChar === "十" || intNumberChar === "拾") { + intNumber = 10; + } + else { + intNumber = this.config.zeroToNineMap.get(intNumberChar); + } + let pointNumberChar = matches[1].value.charAt(0); + let pointNumber; + if (pointNumberChar === "半") { + pointNumber = 0.5; + } + else { + pointNumber = this.config.zeroToNineMap.get(pointNumberChar) * 0.1; + } + result.value = (intNumber + pointNumber) * 10; + } + else if (matches.length === 5) { + // Deal the Japanese percentage case like "xxx割xxx分xxx厘", get the integer value and convert into result. + let intNumberChar = matches[0].value.charAt(0); + let pointNumberChar = matches[1].value.charAt(0); + let dotNumberChar = matches[3].value.charAt(0); + let pointNumber = this.config.zeroToNineMap.get(pointNumberChar) * 0.1; + let dotNumber = this.config.zeroToNineMap.get(dotNumberChar) * 0.01; + intNumber = this.config.zeroToNineMap.get(intNumberChar); + result.value = (intNumber + pointNumber + dotNumber) * 10; + } + else { + let intNumberChar = matches[0].value.charAt(0); + if (intNumberChar === '対' || intNumberChar === "对") { + intNumber = 5; + } + else if (intNumberChar === "十" || intNumberChar === "拾") { + intNumber = 10; + } + else { + intNumber = this.config.zeroToNineMap.get(intNumberChar); + } + result.value = intNumber * 10; + } + } + } + else if (extResult.data.includes("Num")) { + let doubleMatch = recognizers_text_2.RegExpUtility.getMatches(this.config.percentageRegex, resultText).pop(); + let doubleText = doubleMatch.value; + if (doubleText.includes("k") || doubleText.includes("K") || doubleText.includes("k") || doubleText.includes("K")) { + power = 1000; + } + if (doubleText.includes("M") || doubleText.includes("M")) { + power = 1000000; + } + if (doubleText.includes("G") || doubleText.includes("G")) { + power = 1000000000; + } + if (doubleText.includes("T") || doubleText.includes("T")) { + power = 1000000000000; + } + result.value = this.getDigitValueCJK(resultText, power); + } + else { + let doubleMatch = recognizers_text_2.RegExpUtility.getMatches(this.config.percentageRegex, resultText).pop(); + let doubleText = this.replaceUnit(doubleMatch.value); + let splitResult = recognizers_text_2.RegExpUtility.split(this.config.pointRegex, doubleText); + if (splitResult[0] === "") { + splitResult[0] = "零"; + } + let doubleValue = this.getIntValueCJK(splitResult[0]); + if (splitResult.length === 2) { + if (recognizers_text_2.RegExpUtility.isMatch(this.config.negativeNumberSignRegex, splitResult[0])) { + doubleValue -= this.getPointValueCJK(splitResult[1]); + } + else { + doubleValue += this.getPointValueCJK(splitResult[1]); + } + } + result.value = doubleValue; + } + result.resolutionStr = this.toString(result.value) + "%"; + return result; + } + fracParseCJK(extResult) { + let result = new recognizersText.ParseResult(extResult); + let resultText = extResult.text; + let splitResult = recognizers_text_2.RegExpUtility.split(this.config.fracSplitRegex, resultText); + let intPart = ""; + let demoPart = ""; + let numPart = ""; + if (splitResult.length === 3) { + intPart = splitResult[0] || ""; + demoPart = splitResult[1] || ""; + numPart = splitResult[2] || ""; + } + else { + intPart = "零"; + demoPart = splitResult[0] || ""; + numPart = splitResult[1] || ""; + } + let intValue = this.isDigitCJK(intPart) + ? this.getDigitValueCJK(intPart, 1.0) + : this.getIntValueCJK(intPart); + let numValue = this.isDigitCJK(numPart) + ? this.getDigitValueCJK(numPart, 1.0) + : this.getIntValueCJK(numPart); + let demoValue = this.isDigitCJK(demoPart) + ? this.getDigitValueCJK(demoPart, 1.0) + : this.getIntValueCJK(demoPart); + if (recognizers_text_2.RegExpUtility.isMatch(this.config.negativeNumberSignRegex, intPart)) { + result.value = intValue - numValue / demoValue; + } + else { + result.value = intValue + numValue / demoValue; + } + result.resolutionStr = this.toString(result.value); + return result; + } + douParseCJK(extResult) { + let result = new recognizersText.ParseResult(extResult); + let resultText = extResult.text; + if (recognizers_text_2.RegExpUtility.isMatch(this.config.doubleAndRoundRegex, resultText)) { + resultText = this.replaceUnit(resultText); + let power = this.config.roundNumberMapChar.get(resultText.charAt(resultText.length - 1)); + result.value = this.getDigitValueCJK(resultText.substr(0, resultText.length - 1), power); + } + else { + resultText = this.replaceUnit(resultText); + let splitResult = recognizers_text_2.RegExpUtility.split(this.config.pointRegex, resultText); + if (splitResult[0] === "") { + splitResult[0] = "零"; + } + if (recognizers_text_2.RegExpUtility.isMatch(this.config.negativeNumberSignRegex, splitResult[0])) { + result.value = this.getIntValueCJK(splitResult[0]) - this.getPointValueCJK(splitResult[1]); + } + else { + result.value = this.getIntValueCJK(splitResult[0]) + this.getPointValueCJK(splitResult[1]); + } + } + result.resolutionStr = this.toString(result.value); + return result; + } + intParseCJK(extResult) { + let result = new recognizersText.ParseResult(extResult); + result.value = this.getIntValueCJK(extResult.text); + result.resolutionStr = this.toString(result.value); + return result; + } + ordParseCJK(extResult) { + let result = new recognizersText.ParseResult(extResult); + let resultText = extResult.text.substr(1); + if (recognizers_text_2.RegExpUtility.isMatch(this.config.digitNumRegex, resultText) && !recognizers_text_2.RegExpUtility.isMatch(this.config.roundNumberIntegerRegex, resultText)) { + result.value = this.getDigitValueCJK(resultText, 1); + } + else { + result.value = this.getIntValueCJK(resultText); + } + result.resolutionStr = this.toString(result.value); + return result; + } + getDigitValueCJK(value, power) { + let isNegative = false; + let resultStr = value; + if (recognizers_text_2.RegExpUtility.isMatch(this.config.negativeNumberSignRegex, resultStr)) { + isNegative = true; + resultStr = resultStr.substr(1); + } + resultStr = this.replaceFullWithHalf(resultStr); + let result = this.getDigitalValue(resultStr, power); + if (isNegative) { + result = -result; + } + return result; + } + getIntValueCJK(value) { + let resultStr = value; + let isDozen = false; + let isPair = false; + if (recognizers_text_2.RegExpUtility.isMatch(this.config.dozenRegex, resultStr)) { + isDozen = true; + if (this.config.cultureInfo.code.toLowerCase() === culture$2.Culture.Chinese) { + resultStr = resultStr.substr(0, resultStr.length - 1); + } + else if (this.config.cultureInfo.code.toLowerCase() === culture$2.Culture.Japanese) { + resultStr = resultStr.substr(0, resultStr.length - 3); + } + } + else if (recognizers_text_2.RegExpUtility.isMatch(this.config.pairRegex, resultStr)) { + isPair = true; + resultStr = resultStr.substr(0, resultStr.length - 1); + } + resultStr = this.replaceUnit(resultStr); + let intValue = 0; + let partValue = 0; + let beforeValue = 0; + let isRoundBefore = false; + let roundBefore = -1; + let roundDefault = 1; + let isNegative = false; + let hasNumber = false; + if (recognizers_text_2.RegExpUtility.isMatch(this.config.negativeNumberSignRegex, resultStr)) { + isNegative = true; + resultStr = resultStr.substr(1); + } + for (let index = 0; index < resultStr.length; index++) { + let currentChar = resultStr.charAt(index); + if (this.config.roundNumberMapChar.has(currentChar)) { + let roundRecent = this.config.roundNumberMapChar.get(currentChar); + if (!hasNumber) { + beforeValue = 1; + } + if (roundBefore !== -1 && roundRecent > roundBefore) { + if (isRoundBefore) { + intValue += partValue * roundRecent; + isRoundBefore = false; + } + else { + partValue += beforeValue * roundDefault; + intValue += partValue * roundRecent; + } + roundBefore = -1; + partValue = 0; + } + else { + isRoundBefore = true; + partValue += beforeValue * roundRecent; + roundBefore = roundRecent; + if ((index === resultStr.length - 1) || this.config.roundDirectList.some(o => o === currentChar)) { + intValue += partValue; + partValue = 0; + } + } + hasNumber = false; + beforeValue = 0; + roundDefault = roundRecent / 10; + } + else if (this.config.zeroToNineMap.has(currentChar)) { + hasNumber = true; + if (index !== resultStr.length - 1) { + if ((currentChar === "零") && !this.config.roundNumberMapChar.has(resultStr.charAt(index + 1))) { + roundDefault = 1; + } + else { + beforeValue = beforeValue * 10 + this.config.zeroToNineMap.get(currentChar); + isRoundBefore = false; + } + } + else { + if (index === resultStr.length - 1 && this.config.cultureInfo.code.toLowerCase() === culture$2.Culture.Japanese) { + roundDefault = 1; + } + partValue += beforeValue * 10; + partValue += this.config.zeroToNineMap.get(currentChar) * roundDefault; + intValue += partValue; + partValue = 0; + } + } + } + if (isNegative) { + intValue = -intValue; + } + if (isDozen) { + intValue = intValue * 12; + } + if (isPair) { + intValue = intValue * 2; + } + return intValue; + } + getPointValueCJK(value) { + let result = 0; + let scale = 0.1; + for (let index = 0; index < value.length; index++) { + result += scale * this.config.zeroToNineMap.get(value.charAt(index)); + scale *= 0.1; + } + return result; + } + isDigitCJK(value) { + return !recognizers_text_2.StringUtility.isNullOrEmpty(value) + && recognizers_text_2.RegExpUtility.isMatch(this.config.digitNumRegex, value); + } +} +exports.BaseCJKNumberParser = BaseCJKNumberParser; + +}); + +unwrapExports(cjkParsers); + +var agnosticNumberParser = createCommonjsModule(function (module, exports) { +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); + + + + +var AgnosticNumberParserType; +(function (AgnosticNumberParserType) { + AgnosticNumberParserType[AgnosticNumberParserType["Cardinal"] = 0] = "Cardinal"; + AgnosticNumberParserType[AgnosticNumberParserType["Double"] = 1] = "Double"; + AgnosticNumberParserType[AgnosticNumberParserType["Fraction"] = 2] = "Fraction"; + AgnosticNumberParserType[AgnosticNumberParserType["Integer"] = 3] = "Integer"; + AgnosticNumberParserType[AgnosticNumberParserType["Number"] = 4] = "Number"; + AgnosticNumberParserType[AgnosticNumberParserType["Ordinal"] = 5] = "Ordinal"; + AgnosticNumberParserType[AgnosticNumberParserType["Percentage"] = 6] = "Percentage"; +})(AgnosticNumberParserType = exports.AgnosticNumberParserType || (exports.AgnosticNumberParserType = {})); +class AgnosticNumberParserFactory { + static getParser(type, languageConfiguration) { + let isChinese = languageConfiguration.cultureInfo.code.toLowerCase() === culture$2.Culture.Chinese; + let isJapanese = languageConfiguration.cultureInfo.code.toLowerCase() === culture$2.Culture.Japanese; + let parser; + if (isChinese) { + parser = new cjkParsers.BaseCJKNumberParser(languageConfiguration); + } + else if (isJapanese) { + parser = new cjkParsers.BaseCJKNumberParser(languageConfiguration); + } + else { + parser = new parsers$2.BaseNumberParser(languageConfiguration); + } + switch (type) { + case AgnosticNumberParserType.Cardinal: + parser.supportedTypes = [constants.Constants.SYS_NUM_CARDINAL, constants.Constants.SYS_NUM_INTEGER, constants.Constants.SYS_NUM_DOUBLE]; + break; + case AgnosticNumberParserType.Double: + parser.supportedTypes = [constants.Constants.SYS_NUM_DOUBLE]; + break; + case AgnosticNumberParserType.Fraction: + parser.supportedTypes = [constants.Constants.SYS_NUM_FRACTION]; + break; + case AgnosticNumberParserType.Integer: + parser.supportedTypes = [constants.Constants.SYS_NUM_INTEGER]; + break; + case AgnosticNumberParserType.Ordinal: + parser.supportedTypes = [constants.Constants.SYS_NUM_ORDINAL]; + break; + case AgnosticNumberParserType.Percentage: + if (!isChinese && !isJapanese) { + parser = new parsers$2.BasePercentageParser(languageConfiguration); + } + break; + } + return parser; + } +} +exports.AgnosticNumberParserFactory = AgnosticNumberParserFactory; + +}); + +unwrapExports(agnosticNumberParser); + +var baseNumbers = createCommonjsModule(function (module, exports) { +"use strict"; +// ------------------------------------------------------------------------------ +// +// This code was generated by a tool. +// Changes to this file may cause incorrect behavior and will be lost if +// the code is regenerated. +// +// ------------------------------------------------------------------------------ +Object.defineProperty(exports, "__esModule", { value: true }); +var BaseNumbers; +(function (BaseNumbers) { + BaseNumbers.NumberReplaceToken = '@builtin.num'; + BaseNumbers.FractionNumberReplaceToken = '@builtin.num.fraction'; + BaseNumbers.IntegerRegexDefinition = (placeholder, thousandsmark) => { return `(((? { return `(((? +// This code was generated by a tool. +// Changes to this file may cause incorrect behavior and will be lost if +// the code is regenerated. +// +// ------------------------------------------------------------------------------ +Object.defineProperty(exports, "__esModule", { value: true }); + +var EnglishNumeric; +(function (EnglishNumeric) { + EnglishNumeric.LangMarker = 'Eng'; + EnglishNumeric.RoundNumberIntegerRegex = `(hundred|thousand|million|billion|trillion)`; + EnglishNumeric.ZeroToNineIntegerRegex = `(three|seven|eight|four|five|zero|nine|one|two|six)`; + EnglishNumeric.NegativeNumberTermsRegex = `((minus|negative)\\s+)`; + EnglishNumeric.NegativeNumberSignRegex = `^${EnglishNumeric.NegativeNumberTermsRegex}.*`; + EnglishNumeric.AnIntRegex = `(an|a)(?=\\s)`; + EnglishNumeric.TenToNineteenIntegerRegex = `(seventeen|thirteen|fourteen|eighteen|nineteen|fifteen|sixteen|eleven|twelve|ten)`; + EnglishNumeric.TensNumberIntegerRegex = `(seventy|twenty|thirty|eighty|ninety|forty|fifty|sixty)`; + EnglishNumeric.SeparaIntRegex = `(((${EnglishNumeric.TenToNineteenIntegerRegex}|(${EnglishNumeric.TensNumberIntegerRegex}(\\s+(and\\s+)?|\\s*-\\s*)${EnglishNumeric.ZeroToNineIntegerRegex})|${EnglishNumeric.TensNumberIntegerRegex}|${EnglishNumeric.ZeroToNineIntegerRegex})(\\s+${EnglishNumeric.RoundNumberIntegerRegex})*))|((${EnglishNumeric.AnIntRegex}(\\s+${EnglishNumeric.RoundNumberIntegerRegex})+))`; + EnglishNumeric.AllIntRegex = `((((${EnglishNumeric.TenToNineteenIntegerRegex}|(${EnglishNumeric.TensNumberIntegerRegex}(\\s+(and\\s+)?|\\s*-\\s*)${EnglishNumeric.ZeroToNineIntegerRegex})|${EnglishNumeric.TensNumberIntegerRegex}|${EnglishNumeric.ZeroToNineIntegerRegex}|${EnglishNumeric.AnIntRegex})(\\s+${EnglishNumeric.RoundNumberIntegerRegex})+)\\s+(and\\s+)?)*${EnglishNumeric.SeparaIntRegex})`; + EnglishNumeric.PlaceHolderPureNumber = `\\b`; + EnglishNumeric.PlaceHolderDefault = `\\D|\\b`; + EnglishNumeric.NumbersWithPlaceHolder = (placeholder) => { return `(((?(${EnglishNumeric.AllIntRegex})|((?(${EnglishNumeric.AllIntRegex})|(\\d+)(?![\\.,]))(?=\\b)`; + EnglishNumeric.FractionPrepositionWithinPercentModeRegex = `(?<=\\b)(?(${EnglishNumeric.AllIntRegex})|((?(${EnglishNumeric.AllIntRegex})|(\\d+)(?![\\.,]))(?=\\b)`; + EnglishNumeric.AllPointRegex = `((\\s+${EnglishNumeric.ZeroToNineIntegerRegex})+|(\\s+${EnglishNumeric.SeparaIntRegex}))`; + EnglishNumeric.AllFloatRegex = `${EnglishNumeric.AllIntRegex}(\\s+point)${EnglishNumeric.AllPointRegex}`; + EnglishNumeric.DoubleWithMultiplierRegex = `(((? { return `(((? { return `(?<=\\s|^)(?and)`; + EnglishNumeric.NumberWithSuffixPercentage = `(?)`; + EnglishNumeric.LessRegex = `((less|lower|smaller|fewer)(\\s+than)?|below|under|(?|=)<)`; + EnglishNumeric.EqualRegex = `(equal(s|ing)?(\\s+(to|than))?|(?)=)`; + EnglishNumeric.MoreOrEqualPrefix = `((no\\s+${EnglishNumeric.LessRegex})|(at\\s+least))`; + EnglishNumeric.MoreOrEqual = `((${EnglishNumeric.MoreRegex}\\s+(or)?\\s+${EnglishNumeric.EqualRegex})|(${EnglishNumeric.EqualRegex}\\s+(or)?\\s+${EnglishNumeric.MoreRegex})|${EnglishNumeric.MoreOrEqualPrefix}(\\s+(or)?\\s+${EnglishNumeric.EqualRegex})?|(${EnglishNumeric.EqualRegex}\\s+(or)?\\s+)?${EnglishNumeric.MoreOrEqualPrefix}|>\\s*=)`; + EnglishNumeric.MoreOrEqualSuffix = `((and|or)\\s+(more|greater|higher|larger|bigger)((?!\\s+than)|(\\s+than(?!(\\s*\\d+)))))`; + EnglishNumeric.LessOrEqualPrefix = `((no\\s+${EnglishNumeric.MoreRegex})|(at\\s+most))`; + EnglishNumeric.LessOrEqual = `((${EnglishNumeric.LessRegex}\\s+(or)?\\s+${EnglishNumeric.EqualRegex})|(${EnglishNumeric.EqualRegex}\\s+(or)?\\s+${EnglishNumeric.LessRegex})|${EnglishNumeric.LessOrEqualPrefix}(\\s+(or)?\\s+${EnglishNumeric.EqualRegex})?|(${EnglishNumeric.EqualRegex}\\s+(or)?\\s+)?${EnglishNumeric.LessOrEqualPrefix}|<\\s*=)`; + EnglishNumeric.LessOrEqualSuffix = `((and|or)\\s+(less|lower|smaller|fewer)((?!\\s+than)|(\\s+than(?!(\\s*\\d+)))))`; + EnglishNumeric.NumberSplitMark = `(?![,.](?!\\d+))`; + EnglishNumeric.MoreRegexNoNumberSucceed = `((bigger|greater|more|higher|larger)((?!\\s+than)|\\s+(than(?!(\\s*\\d+))))|(above|over)(?!(\\s*\\d+)))`; + EnglishNumeric.LessRegexNoNumberSucceed = `((less|lower|smaller|fewer)((?!\\s+than)|\\s+(than(?!(\\s*\\d+))))|(below|under)(?!(\\s*\\d+)))`; + EnglishNumeric.EqualRegexNoNumberSucceed = `(equal(s|ing)?((?!\\s+(to|than))|(\\s+(to|than)(?!(\\s*\\d+)))))`; + EnglishNumeric.OneNumberRangeMoreRegex1 = `(${EnglishNumeric.MoreOrEqual}|${EnglishNumeric.MoreRegex})\\s*(the\\s+)?(?(${EnglishNumeric.NumberSplitMark}.)+)`; + EnglishNumeric.OneNumberRangeMoreRegex2 = `(?(${EnglishNumeric.NumberSplitMark}.)+)\\s*${EnglishNumeric.MoreOrEqualSuffix}`; + EnglishNumeric.OneNumberRangeMoreSeparateRegex = `(${EnglishNumeric.EqualRegex}\\s+(?(${EnglishNumeric.NumberSplitMark}.)+)(\\s+or\\s+)${EnglishNumeric.MoreRegexNoNumberSucceed})|(${EnglishNumeric.MoreRegex}\\s+(?(${EnglishNumeric.NumberSplitMark}.)+)(\\s+or\\s+)${EnglishNumeric.EqualRegexNoNumberSucceed})`; + EnglishNumeric.OneNumberRangeLessRegex1 = `(${EnglishNumeric.LessOrEqual}|${EnglishNumeric.LessRegex})\\s*(the\\s+)?(?(${EnglishNumeric.NumberSplitMark}.)+)`; + EnglishNumeric.OneNumberRangeLessRegex2 = `(?(${EnglishNumeric.NumberSplitMark}.)+)\\s*${EnglishNumeric.LessOrEqualSuffix}`; + EnglishNumeric.OneNumberRangeLessSeparateRegex = `(${EnglishNumeric.EqualRegex}\\s+(?(${EnglishNumeric.NumberSplitMark}.)+)(\\s+or\\s+)${EnglishNumeric.LessRegexNoNumberSucceed})|(${EnglishNumeric.LessRegex}\\s+(?(${EnglishNumeric.NumberSplitMark}.)+)(\\s+or\\s+)${EnglishNumeric.EqualRegexNoNumberSucceed})`; + EnglishNumeric.OneNumberRangeEqualRegex = `${EnglishNumeric.EqualRegex}\\s*(the\\s+)?(?(${EnglishNumeric.NumberSplitMark}.)+)`; + EnglishNumeric.TwoNumberRangeRegex1 = `between\\s*(the\\s+)?(?(${EnglishNumeric.NumberSplitMark}.)+)\\s*and\\s*(the\\s+)?(?(${EnglishNumeric.NumberSplitMark}.)+)`; + EnglishNumeric.TwoNumberRangeRegex2 = `(${EnglishNumeric.OneNumberRangeMoreRegex1}|${EnglishNumeric.OneNumberRangeMoreRegex2})\\s*(and|but|,)\\s*(${EnglishNumeric.OneNumberRangeLessRegex1}|${EnglishNumeric.OneNumberRangeLessRegex2})`; + EnglishNumeric.TwoNumberRangeRegex3 = `(${EnglishNumeric.OneNumberRangeLessRegex1}|${EnglishNumeric.OneNumberRangeLessRegex2})\\s*(and|but|,)\\s*(${EnglishNumeric.OneNumberRangeMoreRegex1}|${EnglishNumeric.OneNumberRangeMoreRegex2})`; + EnglishNumeric.TwoNumberRangeRegex4 = `(from\\s+)?(?(${EnglishNumeric.NumberSplitMark}(?!\\bfrom\\b).)+)\\s*${EnglishNumeric.TillRegex}\\s*(the\\s+)?(?(${EnglishNumeric.NumberSplitMark}.)+)`; + EnglishNumeric.AmbiguousFractionConnectorsRegex = `(\\bin\\b)`; + EnglishNumeric.DecimalSeparatorChar = '.'; + EnglishNumeric.FractionMarkerToken = 'over'; + EnglishNumeric.NonDecimalSeparatorChar = ','; + EnglishNumeric.HalfADozenText = 'six'; + EnglishNumeric.WordSeparatorToken = 'and'; + EnglishNumeric.WrittenDecimalSeparatorTexts = ['point']; + EnglishNumeric.WrittenGroupSeparatorTexts = ['punto']; + EnglishNumeric.WrittenIntegerSeparatorTexts = ['and']; + EnglishNumeric.WrittenFractionSeparatorTexts = ['and']; + EnglishNumeric.HalfADozenRegex = `half\\s+a\\s+dozen`; + EnglishNumeric.DigitalNumberRegex = `((?<=\\b)(hundred|thousand|million|billion|trillion|dozen(s)?)(?=\\b))|((?<=(\\d|\\b))(k|t|m|g|b)(?=\\b))`; + EnglishNumeric.CardinalNumberMap = new Map([["a", 1], ["zero", 0], ["an", 1], ["one", 1], ["two", 2], ["three", 3], ["four", 4], ["five", 5], ["six", 6], ["seven", 7], ["eight", 8], ["nine", 9], ["ten", 10], ["eleven", 11], ["twelve", 12], ["dozen", 12], ["dozens", 12], ["thirteen", 13], ["fourteen", 14], ["fifteen", 15], ["sixteen", 16], ["seventeen", 17], ["eighteen", 18], ["nineteen", 19], ["twenty", 20], ["thirty", 30], ["forty", 40], ["fifty", 50], ["sixty", 60], ["seventy", 70], ["eighty", 80], ["ninety", 90], ["hundred", 100], ["thousand", 1000], ["million", 1000000], ["billion", 1000000000], ["trillion", 1000000000000]]); + EnglishNumeric.OrdinalNumberMap = new Map([["first", 1], ["second", 2], ["secondary", 2], ["half", 2], ["third", 3], ["fourth", 4], ["quarter", 4], ["fifth", 5], ["sixth", 6], ["seventh", 7], ["eighth", 8], ["ninth", 9], ["tenth", 10], ["eleventh", 11], ["twelfth", 12], ["thirteenth", 13], ["fourteenth", 14], ["fifteenth", 15], ["sixteenth", 16], ["seventeenth", 17], ["eighteenth", 18], ["nineteenth", 19], ["twentieth", 20], ["thirtieth", 30], ["fortieth", 40], ["fiftieth", 50], ["sixtieth", 60], ["seventieth", 70], ["eightieth", 80], ["ninetieth", 90], ["hundredth", 100], ["thousandth", 1000], ["millionth", 1000000], ["billionth", 1000000000], ["trillionth", 1000000000000], ["firsts", 1], ["halves", 2], ["thirds", 3], ["fourths", 4], ["quarters", 4], ["fifths", 5], ["sixths", 6], ["sevenths", 7], ["eighths", 8], ["ninths", 9], ["tenths", 10], ["elevenths", 11], ["twelfths", 12], ["thirteenths", 13], ["fourteenths", 14], ["fifteenths", 15], ["sixteenths", 16], ["seventeenths", 17], ["eighteenths", 18], ["nineteenths", 19], ["twentieths", 20], ["thirtieths", 30], ["fortieths", 40], ["fiftieths", 50], ["sixtieths", 60], ["seventieths", 70], ["eightieths", 80], ["ninetieths", 90], ["hundredths", 100], ["thousandths", 1000], ["millionths", 1000000], ["billionths", 1000000000], ["trillionths", 1000000000000]]); + EnglishNumeric.RoundNumberMap = new Map([["hundred", 100], ["thousand", 1000], ["million", 1000000], ["billion", 1000000000], ["trillion", 1000000000000], ["hundredth", 100], ["thousandth", 1000], ["millionth", 1000000], ["billionth", 1000000000], ["trillionth", 1000000000000], ["hundredths", 100], ["thousandths", 1000], ["millionths", 1000000], ["billionths", 1000000000], ["trillionths", 1000000000000], ["dozen", 12], ["dozens", 12], ["k", 1000], ["m", 1000000], ["g", 1000000000], ["b", 1000000000], ["t", 1000000000000]]); + EnglishNumeric.AmbiguityFiltersDict = new Map([["\\bone\\b", "\\b(the|this|that|which)\\s+(one)\\b"]]); +})(EnglishNumeric = exports.EnglishNumeric || (exports.EnglishNumeric = {})); + +}); + +unwrapExports(englishNumeric); + +var parserConfiguration = createCommonjsModule(function (module, exports) { +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); + + + +class EnglishNumberParserConfiguration { + constructor(ci) { + if (!ci) { + ci = new culture$2.CultureInfo(culture$2.Culture.English); + } + this.cultureInfo = ci; + this.langMarker = englishNumeric.EnglishNumeric.LangMarker; + this.decimalSeparatorChar = englishNumeric.EnglishNumeric.DecimalSeparatorChar; + this.fractionMarkerToken = englishNumeric.EnglishNumeric.FractionMarkerToken; + this.nonDecimalSeparatorChar = englishNumeric.EnglishNumeric.NonDecimalSeparatorChar; + this.halfADozenText = englishNumeric.EnglishNumeric.HalfADozenText; + this.wordSeparatorToken = englishNumeric.EnglishNumeric.WordSeparatorToken; + this.writtenDecimalSeparatorTexts = englishNumeric.EnglishNumeric.WrittenDecimalSeparatorTexts; + this.writtenGroupSeparatorTexts = englishNumeric.EnglishNumeric.WrittenGroupSeparatorTexts; + this.writtenIntegerSeparatorTexts = englishNumeric.EnglishNumeric.WrittenIntegerSeparatorTexts; + this.writtenFractionSeparatorTexts = englishNumeric.EnglishNumeric.WrittenFractionSeparatorTexts; + this.cardinalNumberMap = englishNumeric.EnglishNumeric.CardinalNumberMap; + this.ordinalNumberMap = englishNumeric.EnglishNumeric.OrdinalNumberMap; + this.roundNumberMap = englishNumeric.EnglishNumeric.RoundNumberMap; + this.negativeNumberSignRegex = recognizersText.RegExpUtility.getSafeRegExp(englishNumeric.EnglishNumeric.NegativeNumberSignRegex, "is"); + this.halfADozenRegex = recognizersText.RegExpUtility.getSafeRegExp(englishNumeric.EnglishNumeric.HalfADozenRegex, "gis"); + this.digitalNumberRegex = recognizersText.RegExpUtility.getSafeRegExp(englishNumeric.EnglishNumeric.DigitalNumberRegex, "gis"); + } + normalizeTokenSet(tokens, context) { + let fracWords = new Array(); + let tokenList = Array.from(tokens); + let tokenLen = tokenList.length; + for (let i = 0; i < tokenLen; i++) { + if (tokenList[i].includes("-")) { + let spiltedTokens = tokenList[i].split("-"); + if (spiltedTokens.length === 2 && this.ordinalNumberMap.has(spiltedTokens[1])) { + fracWords.push(spiltedTokens[0]); + fracWords.push(spiltedTokens[1]); + } + else { + fracWords.push(tokenList[i]); + } + } + else if ((i < tokenLen - 2) && tokenList[i + 1] === "-") { + if (this.ordinalNumberMap.has(tokenList[i + 2])) { + fracWords.push(tokenList[i]); + fracWords.push(tokenList[i + 2]); + } + else { + fracWords.push(tokenList[i] + tokenList[i + 1] + tokenList[i + 2]); + } + i += 2; + } + else { + fracWords.push(tokenList[i]); + } + } + return fracWords; + } + resolveCompositeNumber(numberStr) { + if (numberStr.includes("-")) { + let numbers = numberStr.split('-'); + let ret = 0; + numbers.forEach(num => { + if (this.ordinalNumberMap.has(num)) { + ret += this.ordinalNumberMap.get(num); + } + else if (this.cardinalNumberMap.has(num)) { + ret += this.cardinalNumberMap.get(num); + } + }); + return ret; + } + if (this.ordinalNumberMap.has(numberStr)) { + return this.ordinalNumberMap.get(numberStr); + } + if (this.cardinalNumberMap.has(numberStr)) { + return this.cardinalNumberMap.get(numberStr); + } + return 0; + } +} +exports.EnglishNumberParserConfiguration = EnglishNumberParserConfiguration; + +}); + +unwrapExports(parserConfiguration); + +var spanishNumeric = createCommonjsModule(function (module, exports) { +"use strict"; +// ------------------------------------------------------------------------------ +// +// This code was generated by a tool. +// Changes to this file may cause incorrect behavior and will be lost if +// the code is regenerated. +// +// ------------------------------------------------------------------------------ +Object.defineProperty(exports, "__esModule", { value: true }); + +var SpanishNumeric; +(function (SpanishNumeric) { + SpanishNumeric.LangMarker = 'Spa'; + SpanishNumeric.HundredsNumberIntegerRegex = `(cuatrocient[ao]s|trescient[ao]s|seiscient[ao]s|setecient[ao]s|ochocient[ao]s|novecient[ao]s|doscient[ao]s|quinient[ao]s|(? { return `(((?(${SpanishNumeric.AllIntRegex})|((?(${SpanishNumeric.AllIntRegex})|((\\d+)(?!\\.)))(?=\\b)`; + SpanishNumeric.AllPointRegex = `((\\s+${SpanishNumeric.ZeroToNineIntegerRegex})+|(\\s+${SpanishNumeric.AllIntRegex}))`; + SpanishNumeric.AllFloatRegex = `${SpanishNumeric.AllIntRegex}(\\s+(coma|con))${SpanishNumeric.AllPointRegex}`; + SpanishNumeric.DoubleDecimalPointRegex = (placeholder) => { return `(((? { return `(?<=\\s|^)(? { + spanishNumeric.SpanishNumeric.SuffixOrdinalMap.forEach((suffixValue, suffixKey) => { + if (!ordinalNumberMap.has(prefixKey + suffixKey)) { + ordinalNumberMap.set(prefixKey + suffixKey, prefixValue * suffixValue); + } + }); + }); + this.cardinalNumberMap = spanishNumeric.SpanishNumeric.CardinalNumberMap; + this.ordinalNumberMap = ordinalNumberMap; + this.roundNumberMap = spanishNumeric.SpanishNumeric.RoundNumberMap; + this.negativeNumberSignRegex = recognizersText.RegExpUtility.getSafeRegExp(spanishNumeric.SpanishNumeric.NegativeNumberSignRegex, "is"); + this.halfADozenRegex = recognizersText.RegExpUtility.getSafeRegExp(spanishNumeric.SpanishNumeric.HalfADozenRegex); + this.digitalNumberRegex = recognizersText.RegExpUtility.getSafeRegExp(spanishNumeric.SpanishNumeric.DigitalNumberRegex); + } + normalizeTokenSet(tokens, context) { + let result = new Array(); + tokens.forEach((token) => { + let tempWord = token.replace(/^s+/, '').replace(/s+$/, ''); + if (this.ordinalNumberMap.has(tempWord)) { + result.push(tempWord); + return; + } + if (tempWord.endsWith("avo") || tempWord.endsWith("ava")) { + let origTempWord = tempWord; + let newLength = origTempWord.length; + tempWord = origTempWord.substring(0, newLength - 3); + if (this.cardinalNumberMap.has(tempWord)) { + result.push(tempWord); + return; + } + else { + tempWord = origTempWord.substring(0, newLength - 2); + if (this.cardinalNumberMap.has(tempWord)) { + result.push(tempWord); + return; + } + } + } + result.push(token); + }); + return result; + } + resolveCompositeNumber(numberStr) { + if (this.ordinalNumberMap.has(numberStr)) { + return this.ordinalNumberMap.get(numberStr); + } + if (this.cardinalNumberMap.has(numberStr)) { + return this.cardinalNumberMap.get(numberStr); + } + let value = 0; + let finalValue = 0; + let strBuilder = ""; + let lastGoodChar = 0; + for (let i = 0; i < numberStr.length; i++) { + strBuilder = strBuilder.concat(numberStr[i]); + if (this.cardinalNumberMap.has(strBuilder) && this.cardinalNumberMap.get(strBuilder) > value) { + lastGoodChar = i; + value = this.cardinalNumberMap.get(strBuilder); + } + if ((i + 1) === numberStr.length) { + finalValue += value; + strBuilder = ""; + i = lastGoodChar++; + value = 0; + } + } + return finalValue; + } +} +exports.SpanishNumberParserConfiguration = SpanishNumberParserConfiguration; + +}); + +unwrapExports(parserConfiguration$2); + +var portugueseNumeric = createCommonjsModule(function (module, exports) { +"use strict"; +// ------------------------------------------------------------------------------ +// +// This code was generated by a tool. +// Changes to this file may cause incorrect behavior and will be lost if +// the code is regenerated. +// +// ------------------------------------------------------------------------------ +Object.defineProperty(exports, "__esModule", { value: true }); + +var PortugueseNumeric; +(function (PortugueseNumeric) { + PortugueseNumeric.LangMarker = 'Por'; + PortugueseNumeric.HundredsNumberIntegerRegex = `(quatrocent[ao]s|trezent[ao]s|seiscent[ao]s|setecent[ao]s|oitocent[ao]s|novecent[ao]s|duzent[ao]s|quinhent[ao]s|cem|(? { return `(((?(${PortugueseNumeric.AllIntRegex})|((?(${PortugueseNumeric.AllIntRegex})|((\\d+)(?!\\.)))(?=\\b)`; + PortugueseNumeric.AllFloatRegex = `${PortugueseNumeric.AllIntRegex}(\\s+(vírgula|virgula|e|ponto))${PortugueseNumeric.AllPointRegex}`; + PortugueseNumeric.DoubleWithMultiplierRegex = `(((? { return `(((? { return `(?<=\\s|^)(? { + portugueseNumeric.PortugueseNumeric.SuffixOrdinalMap.forEach((suffixValue, suffixKey) => { + if (!ordinalNumberMap.has(prefixKey + suffixKey)) { + ordinalNumberMap.set(prefixKey + suffixKey, prefixValue * suffixValue); + } + }); + }); + this.cardinalNumberMap = portugueseNumeric.PortugueseNumeric.CardinalNumberMap; + this.ordinalNumberMap = ordinalNumberMap; + this.roundNumberMap = portugueseNumeric.PortugueseNumeric.RoundNumberMap; + this.negativeNumberSignRegex = recognizersText.RegExpUtility.getSafeRegExp(portugueseNumeric.PortugueseNumeric.NegativeNumberSignRegex, "is"); + this.halfADozenRegex = recognizersText.RegExpUtility.getSafeRegExp(portugueseNumeric.PortugueseNumeric.HalfADozenRegex); + this.digitalNumberRegex = recognizersText.RegExpUtility.getSafeRegExp(portugueseNumeric.PortugueseNumeric.DigitalNumberRegex); + } + normalizeTokenSet(tokens, context) { + let result = new Array(); + tokens.forEach((token) => { + let tempWord = token.replace(/^s+/, '').replace(/s+$/, ''); + if (this.ordinalNumberMap.has(tempWord)) { + result.push(tempWord); + return; + } + // ends with 'avo' or 'ava' + if (portugueseNumeric.PortugueseNumeric.WrittenFractionSuffix.some(suffix => tempWord.endsWith(suffix))) { + let origTempWord = tempWord; + let newLength = origTempWord.length; + tempWord = origTempWord.substring(0, newLength - 3); + if (!tempWord) { + return; + } + else if (this.cardinalNumberMap.has(tempWord)) { + result.push(tempWord); + return; + } + else { + tempWord = origTempWord.substring(0, newLength - 2); + if (this.cardinalNumberMap.has(tempWord)) { + result.push(tempWord); + return; + } + } + } + result.push(token); + }); + return result; + } + resolveCompositeNumber(numberStr) { + if (this.ordinalNumberMap.has(numberStr)) { + return this.ordinalNumberMap.get(numberStr); + } + if (this.cardinalNumberMap.has(numberStr)) { + return this.cardinalNumberMap.get(numberStr); + } + let value = 0; + let finalValue = 0; + let strBuilder = ""; + let lastGoodChar = 0; + for (let i = 0; i < numberStr.length; i++) { + strBuilder = strBuilder.concat(numberStr[i]); + if (this.cardinalNumberMap.has(strBuilder) && this.cardinalNumberMap.get(strBuilder) > value) { + lastGoodChar = i; + value = this.cardinalNumberMap.get(strBuilder); + } + if ((i + 1) === numberStr.length) { + finalValue += value; + strBuilder = ""; + i = lastGoodChar++; + value = 0; + } + } + return finalValue; + } +} +exports.PortugueseNumberParserConfiguration = PortugueseNumberParserConfiguration; + +}); + +unwrapExports(parserConfiguration$4); + +var frenchNumeric = createCommonjsModule(function (module, exports) { +"use strict"; +// ------------------------------------------------------------------------------ +// +// This code was generated by a tool. +// Changes to this file may cause incorrect behavior and will be lost if +// the code is regenerated. +// +// ------------------------------------------------------------------------------ +Object.defineProperty(exports, "__esModule", { value: true }); + +var FrenchNumeric; +(function (FrenchNumeric) { + FrenchNumeric.LangMarker = 'Fr'; + FrenchNumeric.RoundNumberIntegerRegex = `(cent|mille|millions|million|milliard|milliards|billion|billions)`; + FrenchNumeric.ZeroToNineIntegerRegex = `(et un|un|une|deux|trois|quatre|cinq|six|sept|huit|neuf)`; + FrenchNumeric.TenToNineteenIntegerRegex = `((seize|quinze|quatorze|treize|douze|onze)|dix(\\Wneuf|\\Whuit|\\Wsept)?)`; + FrenchNumeric.TensNumberIntegerRegex = `(quatre\\Wvingt(s|\\Wdix)?|soixante\\Wdix|vingt|trente|quarante|cinquante|soixante|septante|octante|huitante|nonante)`; + FrenchNumeric.DigitsNumberRegex = `\\d|\\d{1,3}(\\.\\d{3})`; + FrenchNumeric.NegativeNumberTermsRegex = `^[.]`; + FrenchNumeric.NegativeNumberSignRegex = `^(${FrenchNumeric.NegativeNumberTermsRegex}\\s+).*`; + FrenchNumeric.HundredsNumberIntegerRegex = `((${FrenchNumeric.ZeroToNineIntegerRegex}(\\s+cent))|cent|((\\s+cent\\s)+${FrenchNumeric.TensNumberIntegerRegex}))`; + FrenchNumeric.BelowHundredsRegex = `((${FrenchNumeric.TenToNineteenIntegerRegex}|(${FrenchNumeric.TensNumberIntegerRegex}([-\\s]+(${FrenchNumeric.TenToNineteenIntegerRegex}|${FrenchNumeric.ZeroToNineIntegerRegex}))?))|${FrenchNumeric.ZeroToNineIntegerRegex})`; + FrenchNumeric.BelowThousandsRegex = `((${FrenchNumeric.HundredsNumberIntegerRegex}(\\s+${FrenchNumeric.BelowHundredsRegex})?|${FrenchNumeric.BelowHundredsRegex}|${FrenchNumeric.TenToNineteenIntegerRegex})|cent\\s+${FrenchNumeric.TenToNineteenIntegerRegex})`; + FrenchNumeric.SupportThousandsRegex = `((${FrenchNumeric.BelowThousandsRegex}|${FrenchNumeric.BelowHundredsRegex})\\s+${FrenchNumeric.RoundNumberIntegerRegex}(\\s+${FrenchNumeric.RoundNumberIntegerRegex})?)`; + FrenchNumeric.SeparaIntRegex = `(${FrenchNumeric.SupportThousandsRegex}(\\s+${FrenchNumeric.SupportThousandsRegex})*(\\s+${FrenchNumeric.BelowThousandsRegex})?|${FrenchNumeric.BelowThousandsRegex})`; + FrenchNumeric.AllIntRegex = `(${FrenchNumeric.SeparaIntRegex}|mille(\\s+${FrenchNumeric.BelowThousandsRegex})?)`; + FrenchNumeric.NumbersWithPlaceHolder = (placeholder) => { return `(((?(${FrenchNumeric.AllIntRegex})|((?(${FrenchNumeric.AllIntRegex})|((\\d+)(?!\\.)))(?=\\b)`; + FrenchNumeric.AllPointRegex = `((\\s+${FrenchNumeric.ZeroToNineIntegerRegex})+|(\\s+${FrenchNumeric.SeparaIntRegex}))`; + FrenchNumeric.AllFloatRegex = `(${FrenchNumeric.AllIntRegex}(\\s+(virgule|point))${FrenchNumeric.AllPointRegex})`; + FrenchNumeric.DoubleDecimalPointRegex = (placeholder) => { return `(((? { return `(?<=\\s|^)(? value) { + lastGoodChar = i; + value = this.cardinalNumberMap.get(strBuilder); + } + if ((i + 1) === numberStr.length) { + finalValue += value; + strBuilder = ""; + i = lastGoodChar++; + value = 0; + } + } + return finalValue; + } +} +exports.FrenchNumberParserConfiguration = FrenchNumberParserConfiguration; + +}); + +unwrapExports(parserConfiguration$6); + +var chineseNumeric = createCommonjsModule(function (module, exports) { +"use strict"; +// ------------------------------------------------------------------------------ +// +// This code was generated by a tool. +// Changes to this file may cause incorrect behavior and will be lost if +// the code is regenerated. +// +// ------------------------------------------------------------------------------ +Object.defineProperty(exports, "__esModule", { value: true }); +var ChineseNumeric; +(function (ChineseNumeric) { + ChineseNumeric.LangMarker = ''; + ChineseNumeric.DecimalSeparatorChar = '.'; + ChineseNumeric.FractionMarkerToken = ''; + ChineseNumeric.NonDecimalSeparatorChar = ' '; + ChineseNumeric.HalfADozenText = ''; + ChineseNumeric.WordSeparatorToken = ''; + ChineseNumeric.RoundNumberMap = new Map([["k", 1000], ["m", 1000000], ["g", 1000000000], ["t", 1000000000000]]); + ChineseNumeric.RoundNumberMapChar = new Map([["十", 10], ["百", 100], ["千", 1000], ["万", 10000], ["亿", 100000000], ["兆", 1000000000000], ["拾", 10], ["佰", 100], ["仟", 1000], ["萬", 10000], ["億", 100000000]]); + ChineseNumeric.ZeroToNineMap = new Map([["0", 0], ["1", 1], ["2", 2], ["3", 3], ["4", 4], ["5", 5], ["6", 6], ["7", 7], ["8", 8], ["9", 9], ["零", 0], ["一", 1], ["二", 2], ["三", 3], ["四", 4], ["五", 5], ["六", 6], ["七", 7], ["八", 8], ["九", 9], ["〇", 0], ["壹", 1], ["贰", 2], ["貳", 2], ["叁", 3], ["肆", 4], ["伍", 5], ["陆", 6], ["陸", 6], ["柒", 7], ["捌", 8], ["玖", 9], ["0", 0], ["1", 1], ["2", 2], ["3", 3], ["4", 4], ["5", 5], ["6", 6], ["7", 7], ["8", 8], ["9", 9], ["半", 0.5], ["两", 2], ["兩", 2], ["俩", 2], ["倆", 2], ["仨", 3]]); + ChineseNumeric.FullToHalfMap = new Map([["0", "0"], ["1", "1"], ["2", "2"], ["3", "3"], ["4", "4"], ["5", "5"], ["6", "6"], ["7", "7"], ["8", "8"], ["9", "9"], ["/", "/"], ["-", "-"], [",", "\'"], ["G", "G"], ["M", "M"], ["T", "T"], ["K", "K"], ["k", "k"], [".", "."]]); + ChineseNumeric.TratoSimMap = new Map([["佰", "百"], ["點", "点"], ["個", "个"], ["幾", "几"], ["對", "对"], ["雙", "双"]]); + ChineseNumeric.UnitMap = new Map([["萬萬", "億"], ["億萬", "兆"], ["萬億", "兆"], ["万万", "亿"], ["万亿", "兆"], ["亿万", "兆"], [" ", ""], ["多", ""], ["余", ""], ["几", ""]]); + ChineseNumeric.RoundDirectList = ['万', '萬', '亿', '兆', '億']; + ChineseNumeric.DigitalNumberRegex = `((?<=(\\d|\\b))(k|t|m|g)(?=\\b))`; + ChineseNumeric.ZeroToNineFullHalfRegex = `[\\d1234567890]`; + ChineseNumeric.DigitNumRegex = `${ChineseNumeric.ZeroToNineFullHalfRegex}+`; + ChineseNumeric.DozenRegex = `.*打$`; + ChineseNumeric.PercentageRegex = `(?<=百\\s*分\\s*之).+|.+(?=个\\s*百\\s*分\\s*点)|.*(?=[%%])`; + ChineseNumeric.DoubleAndRoundRegex = `${ChineseNumeric.ZeroToNineFullHalfRegex}+(\\.${ChineseNumeric.ZeroToNineFullHalfRegex}+)?\\s*[多几余]?[万亿萬億]{1,2}`; + ChineseNumeric.FracSplitRegex = `又|分\\s*之`; + ChineseNumeric.ZeroToNineIntegerRegex = `[一二三四五六七八九零壹贰貳叁肆伍陆陸柒捌玖〇两兩俩倆仨]`; + ChineseNumeric.NegativeNumberTermsRegex = `[负負]`; + ChineseNumeric.NegativeNumberTermsRegexNum = `((?)`; + ChineseNumeric.LessRegex = `(小于|少于|低于|小於|少於|低於|不到|不足|<)`; + ChineseNumeric.EqualRegex = `(等于|等於|=)`; + ChineseNumeric.MoreOrEqual = `((${ChineseNumeric.MoreRegex}\\s*(或|或者)?\\s*${ChineseNumeric.EqualRegex})|至少|最少|不${ChineseNumeric.LessRegex})`; + ChineseNumeric.MoreOrEqualSuffix = `(或|或者)\\s*(以上|之上|更[大多高])`; + ChineseNumeric.LessOrEqual = `((${ChineseNumeric.LessRegex}\\s*(或|或者)?\\s*${ChineseNumeric.EqualRegex})|至多|最多|不${ChineseNumeric.MoreRegex})`; + ChineseNumeric.LessOrEqualSuffix = `(或|或者)\\s*(以下|之下|更[小少低])`; + ChineseNumeric.OneNumberRangeMoreRegex1 = `(${ChineseNumeric.MoreOrEqual}|${ChineseNumeric.MoreRegex})\\s*(?((?!([并且而並的同時时]|(,(?!\\d+))|(,(?!\\d+))|。)).)+)`; + ChineseNumeric.OneNumberRangeMoreRegex2 = `比\\s*(?((?!((,(?!\\d+))|(,(?!\\d+))|。)).)+)\\s*更?[大多高]`; + ChineseNumeric.OneNumberRangeMoreRegex3 = `(?((?!((,(?!\\d+))|(,(?!\\d+))|。|[或者])).)+)\\s*(或|或者)?\\s*([多几余幾餘]|以上|之上|更[大多高])(?![万亿萬億]{1,2})`; + ChineseNumeric.OneNumberRangeLessRegex1 = `(${ChineseNumeric.LessOrEqual}|${ChineseNumeric.LessRegex})\\s*(?((?!([并且而並的同時时]|(,(?!\\d+))|(,(?!\\d+))|。)).)+)`; + ChineseNumeric.OneNumberRangeLessRegex2 = `比\\s*(?((?!((,(?!\\d+))|(,(?!\\d+))|。)).)+)\\s*更?[小少低]`; + ChineseNumeric.OneNumberRangeLessRegex3 = `(?((?!((,(?!\\d+))|(,(?!\\d+))|。|[或者])).)+)\\s*(或|或者)?\\s*(以下|之下|更[小少低])`; + ChineseNumeric.OneNumberRangeMoreSeparateRegex = `^[.]`; + ChineseNumeric.OneNumberRangeLessSeparateRegex = `^[.]`; + ChineseNumeric.OneNumberRangeEqualRegex = `${ChineseNumeric.EqualRegex}\\s*(?((?!((,(?!\\d+))|(,(?!\\d+))|。)).)+)`; + ChineseNumeric.TwoNumberRangeRegex1 = `((位于|在|位於)|(?=(\\d|\\+|\\-)))\\s*(?((?!((,(?!\\d+))|(,(?!\\d+))|。)).)+)\\s*(和|与|與|${ChineseNumeric.TillRegex})\\s*(?((?!((,(?!\\d+))|(,(?!\\d+))|。))[^之])+)\\s*(之)?(间|間)`; + ChineseNumeric.TwoNumberRangeRegex2 = `(${ChineseNumeric.OneNumberRangeMoreRegex1}|${ChineseNumeric.OneNumberRangeMoreRegex2}|${ChineseNumeric.OneNumberRangeMoreRegex3})\\s*(且|并且|而且|並且|((的)?同時)|((的)?同时)|,)?\\s*(${ChineseNumeric.OneNumberRangeLessRegex1}|${ChineseNumeric.OneNumberRangeLessRegex2}|${ChineseNumeric.OneNumberRangeLessRegex3})`; + ChineseNumeric.TwoNumberRangeRegex3 = `(${ChineseNumeric.OneNumberRangeLessRegex1}|${ChineseNumeric.OneNumberRangeLessRegex2}|${ChineseNumeric.OneNumberRangeLessRegex3})\\s*(且|并且|而且|並且|((的)?同時)|((的)?同时)|,)?\\s*(${ChineseNumeric.OneNumberRangeMoreRegex1}|${ChineseNumeric.OneNumberRangeMoreRegex2}|${ChineseNumeric.OneNumberRangeMoreRegex3})`; + ChineseNumeric.TwoNumberRangeRegex4 = `(?((?!((,(?!\\d+))|(,(?!\\d+))|。)).)+)\\s*${ChineseNumeric.TillRegex}\\s*(?((?!((,(?!\\d+))|(,(?!\\d+))|。)).)+)`; + ChineseNumeric.AmbiguousFractionConnectorsRegex = `^[.]`; +})(ChineseNumeric = exports.ChineseNumeric || (exports.ChineseNumeric = {})); + +}); + +unwrapExports(chineseNumeric); + +var parserConfiguration$8 = createCommonjsModule(function (module, exports) { +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); + + + +class ChineseNumberParserConfiguration { + constructor(ci) { + if (!ci) { + ci = new culture$2.CultureInfo(culture$2.Culture.Chinese); + } + this.cultureInfo = ci; + this.langMarker = chineseNumeric.ChineseNumeric.LangMarker; + this.decimalSeparatorChar = chineseNumeric.ChineseNumeric.DecimalSeparatorChar; + this.fractionMarkerToken = chineseNumeric.ChineseNumeric.FractionMarkerToken; + this.nonDecimalSeparatorChar = chineseNumeric.ChineseNumeric.NonDecimalSeparatorChar; + this.halfADozenText = chineseNumeric.ChineseNumeric.HalfADozenText; + this.wordSeparatorToken = chineseNumeric.ChineseNumeric.WordSeparatorToken; + this.writtenDecimalSeparatorTexts = []; + this.writtenGroupSeparatorTexts = []; + this.writtenIntegerSeparatorTexts = []; + this.writtenFractionSeparatorTexts = []; + this.cardinalNumberMap = new Map(); + this.ordinalNumberMap = new Map(); + this.roundNumberMap = chineseNumeric.ChineseNumeric.RoundNumberMap; + this.halfADozenRegex = null; + this.digitalNumberRegex = recognizersText.RegExpUtility.getSafeRegExp(chineseNumeric.ChineseNumeric.DigitalNumberRegex, "gis"); + this.zeroToNineMap = chineseNumeric.ChineseNumeric.ZeroToNineMap; + this.roundNumberMapChar = chineseNumeric.ChineseNumeric.RoundNumberMapChar; + this.fullToHalfMap = chineseNumeric.ChineseNumeric.FullToHalfMap; + this.tratoSimMap = chineseNumeric.ChineseNumeric.TratoSimMap; + this.unitMap = chineseNumeric.ChineseNumeric.UnitMap; + this.roundDirectList = chineseNumeric.ChineseNumeric.RoundDirectList; + this.digitNumRegex = recognizersText.RegExpUtility.getSafeRegExp(chineseNumeric.ChineseNumeric.DigitNumRegex, "gis"); + this.dozenRegex = recognizersText.RegExpUtility.getSafeRegExp(chineseNumeric.ChineseNumeric.DozenRegex, "gis"); + this.percentageRegex = recognizersText.RegExpUtility.getSafeRegExp(chineseNumeric.ChineseNumeric.PercentageRegex, "gis"); + this.doubleAndRoundRegex = recognizersText.RegExpUtility.getSafeRegExp(chineseNumeric.ChineseNumeric.DoubleAndRoundRegex, "gis"); + this.fracSplitRegex = recognizersText.RegExpUtility.getSafeRegExp(chineseNumeric.ChineseNumeric.FracSplitRegex, "gis"); + this.negativeNumberSignRegex = recognizersText.RegExpUtility.getSafeRegExp(chineseNumeric.ChineseNumeric.NegativeNumberSignRegex, "gis"); + this.pointRegex = recognizersText.RegExpUtility.getSafeRegExp(chineseNumeric.ChineseNumeric.PointRegex, "gis"); + this.speGetNumberRegex = recognizersText.RegExpUtility.getSafeRegExp(chineseNumeric.ChineseNumeric.SpeGetNumberRegex, "gis"); + this.pairRegex = recognizersText.RegExpUtility.getSafeRegExp(chineseNumeric.ChineseNumeric.PairRegex, "gis"); + this.roundNumberIntegerRegex = recognizersText.RegExpUtility.getSafeRegExp(chineseNumeric.ChineseNumeric.RoundNumberIntegerRegex, "gis"); + } + normalizeTokenSet(tokens, context) { + return tokens; + } + resolveCompositeNumber(numberStr) { + return 0; + } +} +exports.ChineseNumberParserConfiguration = ChineseNumberParserConfiguration; + +}); + +unwrapExports(parserConfiguration$8); + +var japaneseNumeric = createCommonjsModule(function (module, exports) { +"use strict"; +// ------------------------------------------------------------------------------ +// +// This code was generated by a tool. +// Changes to this file may cause incorrect behavior and will be lost if +// the code is regenerated. +// +// ------------------------------------------------------------------------------ +Object.defineProperty(exports, "__esModule", { value: true }); +var JapaneseNumeric; +(function (JapaneseNumeric) { + JapaneseNumeric.LangMarker = ''; + JapaneseNumeric.DecimalSeparatorChar = '.'; + JapaneseNumeric.FractionMarkerToken = ''; + JapaneseNumeric.NonDecimalSeparatorChar = ' '; + JapaneseNumeric.HalfADozenText = ''; + JapaneseNumeric.WordSeparatorToken = ''; + JapaneseNumeric.RoundNumberMap = new Map([["k", 1000], ["m", 1000000], ["g", 1000000000], ["t", 1000000000000]]); + JapaneseNumeric.RoundNumberMapChar = new Map([["十", 10], ["百", 100], ["千", 1000], ["万", 10000], ["億", 100000000], ["兆", 1000000000000]]); + JapaneseNumeric.ZeroToNineMap = new Map([["0", 0], ["1", 1], ["2", 2], ["3", 3], ["4", 4], ["5", 5], ["6", 6], ["7", 7], ["8", 8], ["9", 9], ["零", 0], ["一", 1], ["二", 2], ["三", 3], ["四", 4], ["五", 5], ["六", 6], ["七", 7], ["八", 8], ["九", 9], ["半", 0.5]]); + JapaneseNumeric.FullToHalfMap = new Map([["0", "0"], ["1", "1"], ["2", "2"], ["3", "3"], ["4", "4"], ["5", "5"], ["6", "6"], ["7", "7"], ["8", "8"], ["9", "9"], ["/", "/"], ["-", "-"], [",", "\'"], ["、", "\'"], ["G", "G"], ["M", "M"], ["T", "T"], ["K", "K"], ["k", "k"], [".", "."]]); + JapaneseNumeric.UnitMap = new Map([["万万", "億"], ["億万", "兆"], ["万億", "兆"], [" ", ""]]); + JapaneseNumeric.RoundDirectList = ['万', '億', '兆']; + JapaneseNumeric.DigitalNumberRegex = `((?<=(\\d|\\b))(k|t|m|g)(?=\\b))`; + JapaneseNumeric.ZeroToNineFullHalfRegex = `[\\d1234567890]`; + JapaneseNumeric.DigitNumRegex = `${JapaneseNumeric.ZeroToNineFullHalfRegex}+`; + JapaneseNumeric.DozenRegex = `.*ダース$`; + JapaneseNumeric.PercentageRegex = `.+(?=パ\\s*ー\\s*セ\\s*ン\\s*ト)|.*(?=[%%])`; + JapaneseNumeric.DoubleAndRoundRegex = `${JapaneseNumeric.ZeroToNineFullHalfRegex}+(\\.${JapaneseNumeric.ZeroToNineFullHalfRegex}+)?\\s*[万億]{1,2}(\\s*(以上))?`; + JapaneseNumeric.FracSplitRegex = `[はと]|分\\s*の`; + JapaneseNumeric.ZeroToNineIntegerRegex = `[一二三四五六七八九]`; + JapaneseNumeric.NegativeNumberTermsRegex = `(マ\\s*イ\\s*ナ\\s*ス)`; + JapaneseNumeric.NegativeNumberTermsRegexNum = `(?)`; + JapaneseNumeric.LessRegex = `(小なり|小さい|低い|<)`; + JapaneseNumeric.EqualRegex = `(等しい|イコール|=)`; + JapaneseNumeric.MoreOrEqual = `((大なりかイコール)|(大きいかイコール)|(大なりか等しい)|(大きいか等しい)|小さくない|以上|最低)`; + JapaneseNumeric.MoreOrEqualSuffix = `(より(大なりイコール|小さくない))`; + JapaneseNumeric.LessOrEqual = `((${JapaneseNumeric.LessRegex}\\s*(或|或者)?\\s*${JapaneseNumeric.EqualRegex})|(小なりかイコール)|(小なりか等しい)|(小さいかイコール)|(小さいか等しい)|(小さいか等しい)|大さくない|以下|最大)`; + JapaneseNumeric.LessOrEqualSuffix = `(小なりイコール|大さくない)`; + JapaneseNumeric.OneNumberRangeMoreRegex1 = `(?((?!(((,|、)(?!\\d+))|((,|、)(?!\\d+))|。)).)+)\\s*((より)\\s*((${JapaneseNumeric.MoreOrEqual}|${JapaneseNumeric.MoreRegex}))|超える|を超える)`; + JapaneseNumeric.OneNumberRangeMoreRegex2 = `(?((?!((,|、(?!\\d+))|(,|、(?!\\d+))|。)).)+)\\s*(より)?(大なり)`; + JapaneseNumeric.OneNumberRangeMoreRegex3 = `(?((?!((,(?!\\d+))|(,(?!\\d+))|。)).)+)\\s*(以上|最低)(?![万億]{1,2})`; + JapaneseNumeric.OneNumberRangeMoreRegex4 = `(${JapaneseNumeric.MoreOrEqual}|${JapaneseNumeric.MoreRegex})\\s*(?((?!(と|は|((と)?同時に)|((と)?そして)|が|,|、|,|(,(?!\\d+))|(,(?!\\d+))|。)).)+)`; + JapaneseNumeric.OneNumberRangeMoreSeparateRegex = `^[.]`; + JapaneseNumeric.OneNumberRangeLessSeparateRegex = `^[.]`; + JapaneseNumeric.OneNumberRangeLessRegex1 = `(?((?!(((,|、)(?!\\d+))|((,|、)(?!\\d+))|。)).)+)\\s*(より)\\s*(${JapaneseNumeric.LessOrEqual}|${JapaneseNumeric.LessRegex})`; + JapaneseNumeric.OneNumberRangeLessRegex2 = `(?((?!((,(?!\\d+))|(,(?!\\d+))|。)).)+)\\s*(より)?(小な)`; + JapaneseNumeric.OneNumberRangeLessRegex3 = `(?((?!((,(?!\\d+))|(,(?!\\d+))|。)).)+)\\s*(以下|未満)(?![万億]{1,2})`; + JapaneseNumeric.OneNumberRangeLessRegex4 = `(${JapaneseNumeric.LessOrEqual}|${JapaneseNumeric.LessRegex})\\s*(?((?!(と|は|((と)?同時に)|((と)?そして)|が|,|、|,|(,(?!\\d+))|(,(?!\\d+))|。)).)+)`; + JapaneseNumeric.OneNumberRangeEqualRegex = `(((?((?!((,(?!\\d+))|(,(?!\\d+))|。)).)+)\\s*(に)\\s*${JapaneseNumeric.EqualRegex})|(${JapaneseNumeric.EqualRegex}\\s*(?((?!((,(?!\\d+))|(,(?!\\d+))|。)).)+)))`; + JapaneseNumeric.TwoNumberRangeRegex1 = `(?((?!((,(?!\\d+))|(,(?!\\d+))|。)).)+)\\s*(と|${JapaneseNumeric.TillRegex})\\s*(?((?!((,(?!\\d+))|(,(?!\\d+))|。)).)+)\\s*(の間)`; + JapaneseNumeric.TwoNumberRangeRegex2 = `(${JapaneseNumeric.OneNumberRangeMoreRegex1}|${JapaneseNumeric.OneNumberRangeMoreRegex2}|${JapaneseNumeric.OneNumberRangeMoreRegex3}|${JapaneseNumeric.OneNumberRangeMoreRegex4})\\s*(と|は|((と)?同時に)|((と)?そして)|が|,|、|,)?\\s*(${JapaneseNumeric.OneNumberRangeLessRegex1}|${JapaneseNumeric.OneNumberRangeLessRegex2}|${JapaneseNumeric.OneNumberRangeLessRegex3}|${JapaneseNumeric.OneNumberRangeLessRegex4})`; + JapaneseNumeric.TwoNumberRangeRegex3 = `(${JapaneseNumeric.OneNumberRangeLessRegex1}|${JapaneseNumeric.OneNumberRangeLessRegex2}|${JapaneseNumeric.OneNumberRangeLessRegex3}|${JapaneseNumeric.OneNumberRangeLessRegex4})\\s*(と|は|((と)?同時に)|((と)?そして)|が|,|、|,)?\\s*(${JapaneseNumeric.OneNumberRangeMoreRegex1}|${JapaneseNumeric.OneNumberRangeMoreRegex2}|${JapaneseNumeric.OneNumberRangeMoreRegex3}|${JapaneseNumeric.OneNumberRangeMoreRegex4})`; + JapaneseNumeric.TwoNumberRangeRegex4 = `(?((?!((,(?!\\d+))|(,(?!\\d+))|。)).)+)\\s*${JapaneseNumeric.TillRegex}\\s*(?((?!((,(?!\\d+))|(,(?!\\d+))|。)).)+)`; + JapaneseNumeric.AmbiguousFractionConnectorsRegex = `^[.]`; +})(JapaneseNumeric = exports.JapaneseNumeric || (exports.JapaneseNumeric = {})); + +}); + +unwrapExports(japaneseNumeric); + +var parserConfiguration$10 = createCommonjsModule(function (module, exports) { +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); + + + +class JapaneseNumberParserConfiguration { + // readonly NumberOptions Options { get; } + // readonly Regex FractionPrepositionRegex { get; } + // readonly string NonDecimalSeparatorText + constructor(ci) { + if (!ci) { + ci = new culture$2.CultureInfo(culture$2.Culture.Japanese); + } + this.cultureInfo = ci; + this.langMarker = japaneseNumeric.JapaneseNumeric.LangMarker; + this.decimalSeparatorChar = japaneseNumeric.JapaneseNumeric.DecimalSeparatorChar; + this.fractionMarkerToken = japaneseNumeric.JapaneseNumeric.FractionMarkerToken; + this.nonDecimalSeparatorChar = japaneseNumeric.JapaneseNumeric.NonDecimalSeparatorChar; + this.halfADozenText = japaneseNumeric.JapaneseNumeric.HalfADozenText; + this.wordSeparatorToken = japaneseNumeric.JapaneseNumeric.WordSeparatorToken; + this.writtenDecimalSeparatorTexts = []; + this.writtenGroupSeparatorTexts = []; + this.writtenIntegerSeparatorTexts = []; + this.writtenFractionSeparatorTexts = []; + this.cardinalNumberMap = new Map(); + this.ordinalNumberMap = new Map(); + this.roundNumberMap = japaneseNumeric.JapaneseNumeric.RoundNumberMap; + this.halfADozenRegex = null; + this.digitalNumberRegex = recognizersText.RegExpUtility.getSafeRegExp(japaneseNumeric.JapaneseNumeric.DigitalNumberRegex, "gis"); + this.zeroToNineMap = japaneseNumeric.JapaneseNumeric.ZeroToNineMap; + this.roundNumberMapChar = japaneseNumeric.JapaneseNumeric.RoundNumberMapChar; + this.fullToHalfMap = japaneseNumeric.JapaneseNumeric.FullToHalfMap; + this.tratoSimMap = null; + this.unitMap = japaneseNumeric.JapaneseNumeric.UnitMap; + this.roundDirectList = japaneseNumeric.JapaneseNumeric.RoundDirectList; + this.digitNumRegex = recognizersText.RegExpUtility.getSafeRegExp(japaneseNumeric.JapaneseNumeric.DigitNumRegex, "gis"); + this.dozenRegex = recognizersText.RegExpUtility.getSafeRegExp(japaneseNumeric.JapaneseNumeric.DozenRegex, "gis"); + this.percentageRegex = recognizersText.RegExpUtility.getSafeRegExp(japaneseNumeric.JapaneseNumeric.PercentageRegex, "gis"); + this.doubleAndRoundRegex = recognizersText.RegExpUtility.getSafeRegExp(japaneseNumeric.JapaneseNumeric.DoubleAndRoundRegex, "gis"); + this.fracSplitRegex = recognizersText.RegExpUtility.getSafeRegExp(japaneseNumeric.JapaneseNumeric.FracSplitRegex, "gis"); + this.negativeNumberSignRegex = recognizersText.RegExpUtility.getSafeRegExp(japaneseNumeric.JapaneseNumeric.NegativeNumberSignRegex, "is"); + this.pointRegex = recognizersText.RegExpUtility.getSafeRegExp(japaneseNumeric.JapaneseNumeric.PointRegex, "gis"); + this.speGetNumberRegex = recognizersText.RegExpUtility.getSafeRegExp(japaneseNumeric.JapaneseNumeric.SpeGetNumberRegex, "gis"); + this.pairRegex = recognizersText.RegExpUtility.getSafeRegExp(japaneseNumeric.JapaneseNumeric.PairRegex, "gis"); + this.roundNumberIntegerRegex = recognizersText.RegExpUtility.getSafeRegExp(japaneseNumeric.JapaneseNumeric.RoundNumberIntegerRegex, "gis"); + } + normalizeTokenSet(tokens, context) { + return tokens; + } + resolveCompositeNumber(numberStr) { + return 0; + } +} +exports.JapaneseNumberParserConfiguration = JapaneseNumberParserConfiguration; + +}); + +unwrapExports(parserConfiguration$10); + +/** + * lodash (Custom Build) + * Build: `lodash modularize exports="npm" -o ./` + * Copyright jQuery Foundation and other contributors + * Released under MIT license + * Based on Underscore.js 1.8.3 + * Copyright Jeremy Ashkenas, DocumentCloud and Investigative Reporters & Editors + */ + +/** Used as references for various `Number` constants. */ +var INFINITY$1 = 1 / 0; + +/** `Object#toString` result references. */ +var symbolTag$1 = '[object Symbol]'; + +/** + * Used to match `RegExp` + * [syntax characters](http://ecma-international.org/ecma-262/6.0/#sec-patterns). + */ +var reRegExpChar = /[\\^$.*+?()[\]{}|]/g; +var reHasRegExpChar = RegExp(reRegExpChar.source); + +/** Detect free variable `global` from Node.js. */ +var freeGlobal$1 = typeof commonjsGlobal == 'object' && commonjsGlobal && commonjsGlobal.Object === Object && commonjsGlobal; + +/** Detect free variable `self`. */ +var freeSelf$1 = typeof self == 'object' && self && self.Object === Object && self; + +/** Used as a reference to the global object. */ +var root$1 = freeGlobal$1 || freeSelf$1 || Function('return this')(); + +/** Used for built-in method references. */ +var objectProto$1 = Object.prototype; + +/** + * Used to resolve the + * [`toStringTag`](http://ecma-international.org/ecma-262/6.0/#sec-object.prototype.tostring) + * of values. + */ +var objectToString$1 = objectProto$1.toString; + +/** Built-in value references. */ +var Symbol$2 = root$1.Symbol; + +/** Used to convert symbols to primitives and strings. */ +var symbolProto$1 = Symbol$2 ? Symbol$2.prototype : undefined; +var symbolToString$1 = symbolProto$1 ? symbolProto$1.toString : undefined; + +/** + * The base implementation of `_.toString` which doesn't convert nullish + * values to empty strings. + * + * @private + * @param {*} value The value to process. + * @returns {string} Returns the string. + */ +function baseToString$1(value) { + // Exit early for strings to avoid a performance hit in some environments. + if (typeof value == 'string') { + return value; + } + if (isSymbol$1(value)) { + return symbolToString$1 ? symbolToString$1.call(value) : ''; + } + var result = (value + ''); + return (result == '0' && (1 / value) == -INFINITY$1) ? '-0' : result; +} + +/** + * Checks if `value` is object-like. A value is object-like if it's not `null` + * and has a `typeof` result of "object". + * + * @static + * @memberOf _ + * @since 4.0.0 + * @category Lang + * @param {*} value The value to check. + * @returns {boolean} Returns `true` if `value` is object-like, else `false`. + * @example + * + * _.isObjectLike({}); + * // => true + * + * _.isObjectLike([1, 2, 3]); + * // => true + * + * _.isObjectLike(_.noop); + * // => false + * + * _.isObjectLike(null); + * // => false + */ +function isObjectLike$1(value) { + return !!value && typeof value == 'object'; +} + +/** + * Checks if `value` is classified as a `Symbol` primitive or object. + * + * @static + * @memberOf _ + * @since 4.0.0 + * @category Lang + * @param {*} value The value to check. + * @returns {boolean} Returns `true` if `value` is a symbol, else `false`. + * @example + * + * _.isSymbol(Symbol.iterator); + * // => true + * + * _.isSymbol('abc'); + * // => false + */ +function isSymbol$1(value) { + return typeof value == 'symbol' || + (isObjectLike$1(value) && objectToString$1.call(value) == symbolTag$1); +} + +/** + * Converts `value` to a string. An empty string is returned for `null` + * and `undefined` values. The sign of `-0` is preserved. + * + * @static + * @memberOf _ + * @since 4.0.0 + * @category Lang + * @param {*} value The value to process. + * @returns {string} Returns the string. + * @example + * + * _.toString(null); + * // => '' + * + * _.toString(-0); + * // => '-0' + * + * _.toString([1, 2, 3]); + * // => '1,2,3' + */ +function toString$1(value) { + return value == null ? '' : baseToString$1(value); +} + +/** + * Escapes the `RegExp` special characters "^", "$", "\", ".", "*", "+", + * "?", "(", ")", "[", "]", "{", "}", and "|" in `string`. + * + * @static + * @memberOf _ + * @since 3.0.0 + * @category String + * @param {string} [string=''] The string to escape. + * @returns {string} Returns the escaped string. + * @example + * + * _.escapeRegExp('[lodash](https://lodash.com/)'); + * // => '\[lodash\]\(https://lodash\.com/\)' + */ +function escapeRegExp(string) { + string = toString$1(string); + return (string && reHasRegExpChar.test(string)) + ? string.replace(reRegExpChar, '\\$&') + : string; +} + +var lodash_escaperegexp = escapeRegExp; + +var extractors$4 = createCommonjsModule(function (module, exports) { +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); + + + + +class BaseNumberExtractor { + constructor() { + this.extractType = ""; + this.negativeNumberTermsRegex = null; + } + extract(source) { + if (!source || source.trim().length === 0) { + return []; + } + let result = new Array(); + let matchSource = new Map(); + let matched = new Array(source.length); + for (let i = 0; i < source.length; i++) { + matched[i] = false; + } + let collections = this.regexes + .map(o => ({ matches: recognizersText.RegExpUtility.getMatches(o.regExp, source), value: o.value })) + .filter(o => o.matches && o.matches.length); + collections.forEach(collection => { + collection.matches.forEach(m => { + for (let j = 0; j < m.length; j++) { + matched[m.index + j] = true; + } + // Keep Source Data for extra information + matchSource.set(m, collection.value); + }); + }); + let last = -1; + for (let i = 0; i < source.length; i++) { + if (matched[i]) { + if (i + 1 === source.length || !matched[i + 1]) { + let start = last + 1; + let length = i - last; + let substr = source.substring(start, start + length); + let srcMatch = Array.from(matchSource.keys()).find(m => m.index === start && m.length === length); + // Extract negative numbers + if (this.negativeNumberTermsRegex !== null) { + let match = source.substr(0, start).match(this.negativeNumberTermsRegex); + if (match) { + start = match.index; + length = length + match[0].length; + substr = match[0] + substr; + } + } + if (srcMatch) { + result.push({ + start: start, + length: length, + text: substr, + type: this.extractType, + data: matchSource.has(srcMatch) ? matchSource.get(srcMatch) : null + }); + } + } + } + else { + last = i; + } + } + return result; + } + generateLongFormatNumberRegexes(type, placeholder = baseNumbers.BaseNumbers.PlaceHolderDefault) { + let thousandsMark = lodash_escaperegexp(type.thousandsMark); + let decimalsMark = lodash_escaperegexp(type.decimalsMark); + let regexDefinition = type.decimalsMark === '\0' + ? baseNumbers.BaseNumbers.IntegerRegexDefinition(placeholder, thousandsMark) + : baseNumbers.BaseNumbers.DoubleRegexDefinition(placeholder, thousandsMark, decimalsMark); + return recognizersText.RegExpUtility.getSafeRegExp(regexDefinition, "gis"); + } +} +exports.BaseNumberExtractor = BaseNumberExtractor; +class BasePercentageExtractor { + constructor(numberExtractor) { + this.extractType = constants.Constants.SYS_NUM_PERCENTAGE; + this.numberExtractor = numberExtractor; + this.regexes = this.initRegexes(); + } + extract(source) { + let originSource = source; + let positionMap; + let numExtResults; + // preprocess the source sentence via extracting and replacing the numbers in it + let preprocess = this.preprocessStrWithNumberExtracted(originSource); + source = preprocess.source; + positionMap = preprocess.positionMap; + numExtResults = preprocess.numExtResults; + let allMatches = this.regexes.map(rx => recognizersText.RegExpUtility.getMatches(rx, source)); + let matched = new Array(source.length); + for (let i = 0; i < source.length; i++) { + matched[i] = false; + } + for (let i = 0; i < allMatches.length; i++) { + allMatches[i].forEach(match => { + for (let j = 0; j < match.length; j++) { + matched[j + match.index] = true; + } + }); + } + let result = new Array(); + let last = -1; + // get index of each matched results + for (let i = 0; i < source.length; i++) { + if (matched[i]) { + if (i + 1 === source.length || matched[i + 1] === false) { + let start = last + 1; + let length = i - last; + let substr = source.substring(start, start + length); + let er = { + start: start, + length: length, + text: substr, + type: this.extractType + }; + result.push(er); + } + } + else { + last = i; + } + } + // post-processing, restoring the extracted numbers + this.postProcessing(result, originSource, positionMap, numExtResults); + return result; + } + // get the number extractor results and convert the extracted numbers to @sys.num, so that the regexes can work + preprocessStrWithNumberExtracted(str) { + let positionMap = new Map(); + let numExtResults = this.numberExtractor.extract(str); + let replaceText = baseNumbers.BaseNumbers.NumberReplaceToken; + let match = new Array(str.length); + let strParts = new Array(); + let start; + let end; + for (let i = 0; i < str.length; i++) { + match[i] = -1; + } + for (let i = 0; i < numExtResults.length; i++) { + let extraction = numExtResults[i]; + start = extraction.start; + end = extraction.length + start; + for (let j = start; j < end; j++) { + if (match[j] === -1) { + match[j] = i; + } + } + } + start = 0; + for (let i = 1; i < str.length; i++) { + if (match[i] !== match[i - 1]) { + strParts.push([start, i - 1]); + start = i; + } + } + strParts.push([start, str.length - 1]); + let ret = ""; + let index = 0; + strParts.forEach(strPart => { + start = strPart[0]; + end = strPart[1]; + let type = match[start]; + if (type === -1) { + ret += str.substring(start, end + 1); + for (let i = start; i <= end; i++) { + positionMap.set(index++, i); + } + } + else { + let originalText = str.substring(start, end + 1); + ret += replaceText; + for (let i = 0; i < replaceText.length; i++) { + positionMap.set(index++, start); + } + } + }); + positionMap.set(index++, str.length); + return { + numExtResults: numExtResults, + source: ret, + positionMap: positionMap + }; + } + // replace the @sys.num to the real patterns, directly modifies the ExtractResult + postProcessing(results, originSource, positionMap, numExtResults) { + let replaceText = baseNumbers.BaseNumbers.NumberReplaceToken; + for (let i = 0; i < results.length; i++) { + let start = results[i].start; + let end = start + results[i].length; + let str = results[i].text; + if (positionMap.has(start) && positionMap.has(end)) { + let originStart = positionMap.get(start); + let originLenth = positionMap.get(end) - originStart; + results[i].start = originStart; + results[i].length = originLenth; + results[i].text = originSource.substring(originStart, originStart + originLenth).trim(); + let numStart = str.indexOf(replaceText); + if (numStart !== -1) { + let numOriginStart = start + numStart; + if (positionMap.has(numStart)) { + let dataKey = originSource.substring(positionMap.get(numOriginStart), positionMap.get(numOriginStart + replaceText.length)); + for (let j = i; j < numExtResults.length; j++) { + if (results[i].start === numExtResults[j].start && results[i].text.includes(numExtResults[j].text)) { + results[i].data = [dataKey, numExtResults[j]]; + break; + } + } + } + } + } + } + } + // read the rules + buildRegexes(regexStrs, ignoreCase = true) { + return regexStrs.map(regexStr => { + let options = "gs"; + if (ignoreCase) { + options += "i"; + } + return recognizersText.RegExpUtility.getSafeRegExp(regexStr, options); + }); + } +} +BasePercentageExtractor.numExtType = constants.Constants.SYS_NUM; +exports.BasePercentageExtractor = BasePercentageExtractor; + +}); + +unwrapExports(extractors$4); + +var extractors$2 = createCommonjsModule(function (module, exports) { +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); + + + + + +class EnglishNumberExtractor extends extractors$4.BaseNumberExtractor { + constructor(mode = models$2.NumberMode.Default) { + super(); + this.extractType = constants.Constants.SYS_NUM; + this.negativeNumberTermsRegex = recognizersText.RegExpUtility.getSafeRegExp(englishNumeric.EnglishNumeric.NegativeNumberTermsRegex + "$", "is"); + let regexes = new Array(); + // Add Cardinal + let cardExtract = null; + switch (mode) { + case models$2.NumberMode.PureNumber: + cardExtract = new EnglishCardinalExtractor(englishNumeric.EnglishNumeric.PlaceHolderPureNumber); + break; + case models$2.NumberMode.Currency: + regexes.push({ regExp: recognizersText.RegExpUtility.getSafeRegExp(englishNumeric.EnglishNumeric.CurrencyRegex, "gs"), value: "IntegerNum" }); + break; + case models$2.NumberMode.Default: + break; + } + if (cardExtract === null) { + cardExtract = new EnglishCardinalExtractor(); + } + cardExtract.regexes.forEach(r => regexes.push(r)); + // Add Fraction + let fracExtract = new EnglishFractionExtractor(); + fracExtract.regexes.forEach(r => regexes.push(r)); + this.regexes = regexes; + } +} +exports.EnglishNumberExtractor = EnglishNumberExtractor; +class EnglishCardinalExtractor extends extractors$4.BaseNumberExtractor { + constructor(placeholder = englishNumeric.EnglishNumeric.PlaceHolderDefault) { + super(); + this.extractType = constants.Constants.SYS_NUM_CARDINAL; + let regexes = new Array(); + // Add Integer Regexes + let intExtract = new EnglishIntegerExtractor(placeholder); + intExtract.regexes.forEach(r => regexes.push(r)); + // Add Double Regexes + let doubleExtract = new EnglishDoubleExtractor(placeholder); + doubleExtract.regexes.forEach(r => regexes.push(r)); + this.regexes = regexes; + } +} +exports.EnglishCardinalExtractor = EnglishCardinalExtractor; +class EnglishIntegerExtractor extends extractors$4.BaseNumberExtractor { + constructor(placeholder = englishNumeric.EnglishNumeric.PlaceHolderDefault) { + super(); + this.extractType = constants.Constants.SYS_NUM_INTEGER; + let regexes = new Array({ + regExp: recognizersText.RegExpUtility.getSafeRegExp(englishNumeric.EnglishNumeric.NumbersWithPlaceHolder(placeholder), "gi"), + value: "IntegerNum" + }, { + regExp: recognizersText.RegExpUtility.getSafeRegExp(englishNumeric.EnglishNumeric.NumbersWithSuffix, "gs"), + value: "IntegerNum" + }, { + regExp: this.generateLongFormatNumberRegexes(models$2.LongFormatType.integerNumComma, placeholder), + value: "IntegerNum" + }, { + regExp: this.generateLongFormatNumberRegexes(models$2.LongFormatType.integerNumBlank, placeholder), + value: "IntegerNum" + }, { + regExp: this.generateLongFormatNumberRegexes(models$2.LongFormatType.integerNumNoBreakSpace, placeholder), + value: "IntegerNum" + }, { + regExp: recognizersText.RegExpUtility.getSafeRegExp(englishNumeric.EnglishNumeric.RoundNumberIntegerRegexWithLocks, "gis"), + value: "IntegerNum" + }, { + regExp: recognizersText.RegExpUtility.getSafeRegExp(englishNumeric.EnglishNumeric.NumbersWithDozenSuffix, "gis"), + value: "IntegerNum" + }, { + regExp: recognizersText.RegExpUtility.getSafeRegExp(englishNumeric.EnglishNumeric.AllIntRegexWithLocks, "gis"), + value: "IntegerEng" + }, { + regExp: recognizersText.RegExpUtility.getSafeRegExp(englishNumeric.EnglishNumeric.AllIntRegexWithDozenSuffixLocks, "gis"), + value: "IntegerEng" + }); + this.regexes = regexes; + } +} +exports.EnglishIntegerExtractor = EnglishIntegerExtractor; +class EnglishDoubleExtractor extends extractors$4.BaseNumberExtractor { + constructor(placeholder = englishNumeric.EnglishNumeric.PlaceHolderDefault) { + super(); + this.extractType = constants.Constants.SYS_NUM_DOUBLE; + let regexes = new Array({ + regExp: recognizersText.RegExpUtility.getSafeRegExp(englishNumeric.EnglishNumeric.DoubleDecimalPointRegex(placeholder), "gis"), + value: "DoubleNum" + }, { + regExp: recognizersText.RegExpUtility.getSafeRegExp(englishNumeric.EnglishNumeric.DoubleWithoutIntegralRegex(placeholder), "gis"), + value: "DoubleNum" + }, { + regExp: this.generateLongFormatNumberRegexes(models$2.LongFormatType.doubleNumCommaDot, placeholder), + value: "DoubleNum" + }, { + regExp: this.generateLongFormatNumberRegexes(models$2.LongFormatType.doubleNumNoBreakSpaceDot, placeholder), + value: "DoubleNum" + }, { + regExp: recognizersText.RegExpUtility.getSafeRegExp(englishNumeric.EnglishNumeric.DoubleWithMultiplierRegex, "gs"), + value: "DoubleNum" + }, { + regExp: recognizersText.RegExpUtility.getSafeRegExp(englishNumeric.EnglishNumeric.DoubleWithRoundNumber, "gis"), + value: "DoubleNum" + }, { + regExp: recognizersText.RegExpUtility.getSafeRegExp(englishNumeric.EnglishNumeric.DoubleAllFloatRegex, "gis"), + value: "DoubleEng" + }, { + regExp: recognizersText.RegExpUtility.getSafeRegExp(englishNumeric.EnglishNumeric.DoubleExponentialNotationRegex, "gis"), + value: "DoublePow" + }, { + regExp: recognizersText.RegExpUtility.getSafeRegExp(englishNumeric.EnglishNumeric.DoubleCaretExponentialNotationRegex, "gis"), + value: "DoublePow" + }); + this.regexes = regexes; + } +} +exports.EnglishDoubleExtractor = EnglishDoubleExtractor; +class EnglishFractionExtractor extends extractors$4.BaseNumberExtractor { + constructor() { + super(); + this.extractType = constants.Constants.SYS_NUM_FRACTION; + let regexes = new Array({ + regExp: recognizersText.RegExpUtility.getSafeRegExp(englishNumeric.EnglishNumeric.FractionNotationWithSpacesRegex, "gis"), + value: "FracNum" + }, { + regExp: recognizersText.RegExpUtility.getSafeRegExp(englishNumeric.EnglishNumeric.FractionNotationRegex, "gis"), + value: "FracNum" + }, { + regExp: recognizersText.RegExpUtility.getSafeRegExp(englishNumeric.EnglishNumeric.FractionNounRegex, "gis"), + value: "FracEng" + }, { + regExp: recognizersText.RegExpUtility.getSafeRegExp(englishNumeric.EnglishNumeric.FractionNounWithArticleRegex, "gis"), + value: "FracEng" + }, { + regExp: recognizersText.RegExpUtility.getSafeRegExp(englishNumeric.EnglishNumeric.FractionPrepositionRegex, "gis"), + value: "FracEng" + }); + this.regexes = regexes; + } +} +exports.EnglishFractionExtractor = EnglishFractionExtractor; +class EnglishOrdinalExtractor extends extractors$4.BaseNumberExtractor { + constructor() { + super(); + this.extractType = constants.Constants.SYS_NUM_ORDINAL; + let regexes = new Array({ + regExp: recognizersText.RegExpUtility.getSafeRegExp(englishNumeric.EnglishNumeric.OrdinalSuffixRegex, "gis"), + value: "OrdinalNum" + }, { + regExp: recognizersText.RegExpUtility.getSafeRegExp(englishNumeric.EnglishNumeric.OrdinalNumericRegex, "gis"), + value: "OrdinalNum" + }, { + regExp: recognizersText.RegExpUtility.getSafeRegExp(englishNumeric.EnglishNumeric.OrdinalEnglishRegex, "gis"), + value: "OrdEng" + }, { + regExp: recognizersText.RegExpUtility.getSafeRegExp(englishNumeric.EnglishNumeric.OrdinalRoundNumberRegex, "gis"), + value: "OrdEng" + }); + this.regexes = regexes; + } +} +exports.EnglishOrdinalExtractor = EnglishOrdinalExtractor; +class EnglishPercentageExtractor extends extractors$4.BasePercentageExtractor { + constructor() { + super(new EnglishNumberExtractor()); + } + initRegexes() { + let regexStrs = [ + englishNumeric.EnglishNumeric.NumberWithSuffixPercentage, + englishNumeric.EnglishNumeric.NumberWithPrefixPercentage + ]; + return this.buildRegexes(regexStrs); + } +} +exports.EnglishPercentageExtractor = EnglishPercentageExtractor; + +}); + +unwrapExports(extractors$2); + +var extractors$6 = createCommonjsModule(function (module, exports) { +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); + + + + + +class SpanishNumberExtractor extends extractors$4.BaseNumberExtractor { + constructor(mode = models$2.NumberMode.Default) { + super(); + this.extractType = constants.Constants.SYS_NUM; + let regexes = new Array(); + // Add Cardinal + let cardExtract = null; + switch (mode) { + case models$2.NumberMode.PureNumber: + cardExtract = new SpanishCardinalExtractor(spanishNumeric.SpanishNumeric.PlaceHolderPureNumber); + break; + case models$2.NumberMode.Currency: + regexes.push({ regExp: recognizersText.RegExpUtility.getSafeRegExp(spanishNumeric.SpanishNumeric.CurrencyRegex, "gs"), value: "IntegerNum" }); + break; + case models$2.NumberMode.Default: + break; + } + if (cardExtract === null) { + cardExtract = new SpanishCardinalExtractor(); + } + cardExtract.regexes.forEach(r => regexes.push(r)); + // Add Fraction + let fracExtract = new SpanishFractionExtractor(); + fracExtract.regexes.forEach(r => regexes.push(r)); + this.regexes = regexes; + } +} +exports.SpanishNumberExtractor = SpanishNumberExtractor; +class SpanishCardinalExtractor extends extractors$4.BaseNumberExtractor { + constructor(placeholder = spanishNumeric.SpanishNumeric.PlaceHolderDefault) { + super(); + this.extractType = constants.Constants.SYS_NUM_CARDINAL; + let regexes = new Array(); + // Add Integer Regexes + let intExtract = new SpanishIntegerExtractor(placeholder); + intExtract.regexes.forEach(r => regexes.push(r)); + // Add Double Regexes + let doubleExtract = new SpanishDoubleExtractor(placeholder); + doubleExtract.regexes.forEach(r => regexes.push(r)); + this.regexes = regexes; + } +} +exports.SpanishCardinalExtractor = SpanishCardinalExtractor; +class SpanishIntegerExtractor extends extractors$4.BaseNumberExtractor { + constructor(placeholder = spanishNumeric.SpanishNumeric.PlaceHolderDefault) { + super(); + this.extractType = constants.Constants.SYS_NUM_INTEGER; + let regexes = new Array({ + regExp: recognizersText.RegExpUtility.getSafeRegExp(spanishNumeric.SpanishNumeric.NumbersWithPlaceHolder(placeholder), "gi"), + value: "IntegerNum" + }, { + regExp: recognizersText.RegExpUtility.getSafeRegExp(spanishNumeric.SpanishNumeric.NumbersWithSuffix, "gs"), + value: "IntegerNum" + }, { + regExp: this.generateLongFormatNumberRegexes(models$2.LongFormatType.integerNumDot, placeholder), + value: "IntegerNum" + }, { + regExp: this.generateLongFormatNumberRegexes(models$2.LongFormatType.integerNumBlank, placeholder), + value: "IntegerNum" + }, { + regExp: this.generateLongFormatNumberRegexes(models$2.LongFormatType.integerNumNoBreakSpace, placeholder), + value: "IntegerNum" + }, { + regExp: recognizersText.RegExpUtility.getSafeRegExp(spanishNumeric.SpanishNumeric.RoundNumberIntegerRegexWithLocks), + value: "IntegerNum" + }, { + regExp: recognizersText.RegExpUtility.getSafeRegExp(spanishNumeric.SpanishNumeric.NumbersWithDozenSuffix), + value: "IntegerNum" + }, { + regExp: recognizersText.RegExpUtility.getSafeRegExp(spanishNumeric.SpanishNumeric.AllIntRegexWithLocks), + value: "IntegerSpa" + }, { + regExp: recognizersText.RegExpUtility.getSafeRegExp(spanishNumeric.SpanishNumeric.AllIntRegexWithDozenSuffixLocks), + value: "IntegerSpa" + }); + this.regexes = regexes; + } +} +exports.SpanishIntegerExtractor = SpanishIntegerExtractor; +class SpanishDoubleExtractor extends extractors$4.BaseNumberExtractor { + constructor(placeholder = spanishNumeric.SpanishNumeric.PlaceHolderDefault) { + super(); + this.extractType = constants.Constants.SYS_NUM_DOUBLE; + let regexes = new Array({ + regExp: recognizersText.RegExpUtility.getSafeRegExp(spanishNumeric.SpanishNumeric.DoubleDecimalPointRegex(placeholder)), + value: "DoubleNum" + }, { + regExp: recognizersText.RegExpUtility.getSafeRegExp(spanishNumeric.SpanishNumeric.DoubleWithoutIntegralRegex(placeholder)), + value: "DoubleNum" + }, { + regExp: recognizersText.RegExpUtility.getSafeRegExp(spanishNumeric.SpanishNumeric.DoubleWithMultiplierRegex, "gs"), + value: "DoubleNum" + }, { + regExp: recognizersText.RegExpUtility.getSafeRegExp(spanishNumeric.SpanishNumeric.DoubleWithRoundNumber), + value: "DoubleNum" + }, { + regExp: recognizersText.RegExpUtility.getSafeRegExp(spanishNumeric.SpanishNumeric.DoubleAllFloatRegex), + value: "DoubleSpa" + }, { + regExp: recognizersText.RegExpUtility.getSafeRegExp(spanishNumeric.SpanishNumeric.DoubleExponentialNotationRegex), + value: "DoublePow" + }, { + regExp: recognizersText.RegExpUtility.getSafeRegExp(spanishNumeric.SpanishNumeric.DoubleCaretExponentialNotationRegex), + value: "DoublePow" + }, { + regExp: this.generateLongFormatNumberRegexes(models$2.LongFormatType.doubleNumDotComma, placeholder), + value: "DoubleNum" + }, { + regExp: this.generateLongFormatNumberRegexes(models$2.LongFormatType.doubleNumNoBreakSpaceComma, placeholder), + value: "DoubleNum" + }); + this.regexes = regexes; + } +} +exports.SpanishDoubleExtractor = SpanishDoubleExtractor; +class SpanishFractionExtractor extends extractors$4.BaseNumberExtractor { + constructor() { + super(); + this.extractType = constants.Constants.SYS_NUM_FRACTION; + let regexes = new Array({ + regExp: recognizersText.RegExpUtility.getSafeRegExp(spanishNumeric.SpanishNumeric.FractionNotationRegex), + value: "FracNum" + }, { + regExp: recognizersText.RegExpUtility.getSafeRegExp(spanishNumeric.SpanishNumeric.FractionNotationWithSpacesRegex), + value: "FracNum" + }, { + regExp: recognizersText.RegExpUtility.getSafeRegExp(spanishNumeric.SpanishNumeric.FractionNounRegex), + value: "FracSpa" + }, { + regExp: recognizersText.RegExpUtility.getSafeRegExp(spanishNumeric.SpanishNumeric.FractionNounWithArticleRegex), + value: "FracSpa" + }, { + regExp: recognizersText.RegExpUtility.getSafeRegExp(spanishNumeric.SpanishNumeric.FractionPrepositionRegex), + value: "FracSpa" + }); + this.regexes = regexes; + } +} +exports.SpanishFractionExtractor = SpanishFractionExtractor; +class SpanishOrdinalExtractor extends extractors$4.BaseNumberExtractor { + constructor() { + super(); + this.extractType = constants.Constants.SYS_NUM_ORDINAL; + let regexes = new Array({ + regExp: recognizersText.RegExpUtility.getSafeRegExp(spanishNumeric.SpanishNumeric.OrdinalSuffixRegex), + value: "OrdinalNum" + }, { + regExp: recognizersText.RegExpUtility.getSafeRegExp(spanishNumeric.SpanishNumeric.OrdinalNounRegex), + value: "OrdSpa" + }); + this.regexes = regexes; + } +} +exports.SpanishOrdinalExtractor = SpanishOrdinalExtractor; +class SpanishPercentageExtractor extends extractors$4.BasePercentageExtractor { + constructor() { + super(new SpanishNumberExtractor()); + } + initRegexes() { + let regexStrs = [ + spanishNumeric.SpanishNumeric.NumberWithPrefixPercentage + ]; + return this.buildRegexes(regexStrs); + } +} +exports.SpanishPercentageExtractor = SpanishPercentageExtractor; + +}); + +unwrapExports(extractors$6); + +var extractors$8 = createCommonjsModule(function (module, exports) { +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); + + + + + +class PortugueseNumberExtractor extends extractors$4.BaseNumberExtractor { + constructor(mode = models$2.NumberMode.Default) { + super(); + this.extractType = constants.Constants.SYS_NUM; + let regexes = new Array(); + // Add Cardinal + let cardExtract = null; + switch (mode) { + case models$2.NumberMode.PureNumber: + cardExtract = new PortugueseCardinalExtractor(portugueseNumeric.PortugueseNumeric.PlaceHolderPureNumber); + break; + case models$2.NumberMode.Currency: + regexes.push({ regExp: recognizersText.RegExpUtility.getSafeRegExp(portugueseNumeric.PortugueseNumeric.CurrencyRegex, "gs"), value: "IntegerNum" }); + break; + case models$2.NumberMode.Default: + break; + } + if (cardExtract === null) { + cardExtract = new PortugueseCardinalExtractor(); + } + cardExtract.regexes.forEach(r => regexes.push(r)); + // Add Fraction + let fracExtract = new PortugueseFractionExtractor(); + fracExtract.regexes.forEach(r => regexes.push(r)); + this.regexes = regexes; + } +} +exports.PortugueseNumberExtractor = PortugueseNumberExtractor; +class PortugueseCardinalExtractor extends extractors$4.BaseNumberExtractor { + constructor(placeholder = portugueseNumeric.PortugueseNumeric.PlaceHolderDefault) { + super(); + this.extractType = constants.Constants.SYS_NUM_CARDINAL; + let regexes = new Array(); + // Add Integer Regexes + let intExtract = new PortugueseIntegerExtractor(placeholder); + intExtract.regexes.forEach(r => regexes.push(r)); + // Add Double Regexes + let doubleExtract = new PortugueseDoubleExtractor(placeholder); + doubleExtract.regexes.forEach(r => regexes.push(r)); + this.regexes = regexes; + } +} +exports.PortugueseCardinalExtractor = PortugueseCardinalExtractor; +class PortugueseIntegerExtractor extends extractors$4.BaseNumberExtractor { + constructor(placeholder = portugueseNumeric.PortugueseNumeric.PlaceHolderDefault) { + super(); + this.extractType = constants.Constants.SYS_NUM_INTEGER; + let regexes = new Array({ + regExp: recognizersText.RegExpUtility.getSafeRegExp(portugueseNumeric.PortugueseNumeric.NumbersWithPlaceHolder(placeholder), "gi"), + value: "IntegerNum" + }, { + regExp: recognizersText.RegExpUtility.getSafeRegExp(portugueseNumeric.PortugueseNumeric.NumbersWithSuffix, "gs"), + value: "IntegerNum" + }, { + regExp: this.generateLongFormatNumberRegexes(models$2.LongFormatType.integerNumDot, placeholder), + value: "IntegerNum" + }, { + regExp: this.generateLongFormatNumberRegexes(models$2.LongFormatType.integerNumBlank, placeholder), + value: "IntegerNum" + }, { + regExp: this.generateLongFormatNumberRegexes(models$2.LongFormatType.integerNumNoBreakSpace, placeholder), + value: "IntegerNum" + }, { + regExp: recognizersText.RegExpUtility.getSafeRegExp(portugueseNumeric.PortugueseNumeric.RoundNumberIntegerRegexWithLocks), + value: "IntegerNum" + }, { + regExp: recognizersText.RegExpUtility.getSafeRegExp(portugueseNumeric.PortugueseNumeric.NumbersWithDozen2Suffix), + value: "IntegerNum" + }, { + regExp: recognizersText.RegExpUtility.getSafeRegExp(portugueseNumeric.PortugueseNumeric.NumbersWithDozenSuffix), + value: "IntegerNum" + }, { + regExp: recognizersText.RegExpUtility.getSafeRegExp(portugueseNumeric.PortugueseNumeric.AllIntRegexWithLocks), + value: "IntegerPor" + }, { + regExp: recognizersText.RegExpUtility.getSafeRegExp(portugueseNumeric.PortugueseNumeric.AllIntRegexWithDozenSuffixLocks), + value: "IntegerPor" + }); + this.regexes = regexes; + } +} +exports.PortugueseIntegerExtractor = PortugueseIntegerExtractor; +class PortugueseDoubleExtractor extends extractors$4.BaseNumberExtractor { + constructor(placeholder = portugueseNumeric.PortugueseNumeric.PlaceHolderDefault) { + super(); + this.extractType = constants.Constants.SYS_NUM_DOUBLE; + let regexes = new Array({ + regExp: recognizersText.RegExpUtility.getSafeRegExp(portugueseNumeric.PortugueseNumeric.DoubleDecimalPointRegex(placeholder)), + value: "DoubleNum" + }, { + regExp: recognizersText.RegExpUtility.getSafeRegExp(portugueseNumeric.PortugueseNumeric.DoubleWithoutIntegralRegex(placeholder)), + value: "DoubleNum" + }, { + regExp: recognizersText.RegExpUtility.getSafeRegExp(portugueseNumeric.PortugueseNumeric.DoubleWithMultiplierRegex, "gs"), + value: "DoubleNum" + }, { + regExp: recognizersText.RegExpUtility.getSafeRegExp(portugueseNumeric.PortugueseNumeric.DoubleWithRoundNumber), + value: "DoubleNum" + }, { + regExp: recognizersText.RegExpUtility.getSafeRegExp(portugueseNumeric.PortugueseNumeric.DoubleAllFloatRegex), + value: "DoublePor" + }, { + regExp: recognizersText.RegExpUtility.getSafeRegExp(portugueseNumeric.PortugueseNumeric.DoubleExponentialNotationRegex), + value: "DoublePow" + }, { + regExp: recognizersText.RegExpUtility.getSafeRegExp(portugueseNumeric.PortugueseNumeric.DoubleCaretExponentialNotationRegex), + value: "DoublePow" + }, { + regExp: this.generateLongFormatNumberRegexes(models$2.LongFormatType.doubleNumDotComma, placeholder), + value: "DoubleNum" + }, { + regExp: this.generateLongFormatNumberRegexes(models$2.LongFormatType.doubleNumNoBreakSpaceComma, placeholder), + value: "DoubleNum" + }); + this.regexes = regexes; + } +} +exports.PortugueseDoubleExtractor = PortugueseDoubleExtractor; +class PortugueseFractionExtractor extends extractors$4.BaseNumberExtractor { + constructor() { + super(); + this.extractType = constants.Constants.SYS_NUM_FRACTION; + let regexes = new Array({ + regExp: recognizersText.RegExpUtility.getSafeRegExp(portugueseNumeric.PortugueseNumeric.FractionNotationRegex), + value: "FracNum" + }, { + regExp: recognizersText.RegExpUtility.getSafeRegExp(portugueseNumeric.PortugueseNumeric.FractionNotationWithSpacesRegex), + value: "FracNum" + }, { + regExp: recognizersText.RegExpUtility.getSafeRegExp(portugueseNumeric.PortugueseNumeric.FractionNounRegex), + value: "FracPor" + }, { + regExp: recognizersText.RegExpUtility.getSafeRegExp(portugueseNumeric.PortugueseNumeric.FractionNounWithArticleRegex), + value: "FracPor" + }, { + regExp: recognizersText.RegExpUtility.getSafeRegExp(portugueseNumeric.PortugueseNumeric.FractionPrepositionRegex), + value: "FracPor" + }); + this.regexes = regexes; + } +} +exports.PortugueseFractionExtractor = PortugueseFractionExtractor; +class PortugueseOrdinalExtractor extends extractors$4.BaseNumberExtractor { + constructor() { + super(); + this.extractType = constants.Constants.SYS_NUM_ORDINAL; + let regexes = new Array({ + regExp: recognizersText.RegExpUtility.getSafeRegExp(portugueseNumeric.PortugueseNumeric.OrdinalSuffixRegex), + value: "OrdinalNum" + }, { + regExp: recognizersText.RegExpUtility.getSafeRegExp(portugueseNumeric.PortugueseNumeric.OrdinalEnglishRegex), + value: "OrdinalPor" + }); + this.regexes = regexes; + } +} +exports.PortugueseOrdinalExtractor = PortugueseOrdinalExtractor; +class PortuguesePercentageExtractor extends extractors$4.BasePercentageExtractor { + constructor() { + super(new PortugueseNumberExtractor()); + } + initRegexes() { + let regexStrs = [ + portugueseNumeric.PortugueseNumeric.NumberWithSuffixPercentage + ]; + return this.buildRegexes(regexStrs); + } +} +exports.PortuguesePercentageExtractor = PortuguesePercentageExtractor; + +}); + +unwrapExports(extractors$8); + +var extractors$10 = createCommonjsModule(function (module, exports) { +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); + + + + + +class FrenchNumberExtractor extends extractors$4.BaseNumberExtractor { + constructor(mode = models$2.NumberMode.Default) { + super(); + this.extractType = constants.Constants.SYS_NUM; + let regexes = new Array(); + // Add Cardinal + let cardExtract = null; + switch (mode) { + case models$2.NumberMode.PureNumber: + cardExtract = new FrenchCardinalExtractor(frenchNumeric.FrenchNumeric.PlaceHolderPureNumber); + break; + case models$2.NumberMode.Currency: + regexes.push({ regExp: recognizersText.RegExpUtility.getSafeRegExp(frenchNumeric.FrenchNumeric.CurrencyRegex, "gs"), value: "IntegerNum" }); + break; + case models$2.NumberMode.Default: + break; + } + if (cardExtract === null) { + cardExtract = new FrenchCardinalExtractor(); + } + cardExtract.regexes.forEach(r => regexes.push(r)); + // Add Fraction + let fracExtract = new FrenchFractionExtractor(); + fracExtract.regexes.forEach(r => regexes.push(r)); + this.regexes = regexes; + } +} +exports.FrenchNumberExtractor = FrenchNumberExtractor; +class FrenchCardinalExtractor extends extractors$4.BaseNumberExtractor { + constructor(placeholder = frenchNumeric.FrenchNumeric.PlaceHolderDefault) { + super(); + this.extractType = constants.Constants.SYS_NUM_CARDINAL; + let regexes = new Array(); + // Add Integer Regexes + let intExtract = new FrenchIntegerExtractor(placeholder); + intExtract.regexes.forEach(r => regexes.push(r)); + // Add Double Regexes + let doubleExtract = new FrenchDoubleExtractor(placeholder); + doubleExtract.regexes.forEach(r => regexes.push(r)); + this.regexes = regexes; + } +} +exports.FrenchCardinalExtractor = FrenchCardinalExtractor; +class FrenchIntegerExtractor extends extractors$4.BaseNumberExtractor { + constructor(placeholder = frenchNumeric.FrenchNumeric.PlaceHolderDefault) { + super(); + this.extractType = constants.Constants.SYS_NUM_INTEGER; + let regexes = new Array({ + regExp: recognizersText.RegExpUtility.getSafeRegExp(frenchNumeric.FrenchNumeric.NumbersWithPlaceHolder(placeholder), "gi"), + value: "IntegerNum" + }, { + regExp: recognizersText.RegExpUtility.getSafeRegExp(frenchNumeric.FrenchNumeric.NumbersWithSuffix, "gs"), + value: "IntegerNum" + }, { + regExp: this.generateLongFormatNumberRegexes(models$2.LongFormatType.integerNumDot, placeholder), + value: "IntegerNum" + }, { + regExp: this.generateLongFormatNumberRegexes(models$2.LongFormatType.integerNumBlank, placeholder), + value: "IntegerNum" + }, { + regExp: this.generateLongFormatNumberRegexes(models$2.LongFormatType.integerNumNoBreakSpace, placeholder), + value: "IntegerNum" + }, { + regExp: recognizersText.RegExpUtility.getSafeRegExp(frenchNumeric.FrenchNumeric.RoundNumberIntegerRegexWithLocks), + value: "IntegerNum" + }, { + regExp: recognizersText.RegExpUtility.getSafeRegExp(frenchNumeric.FrenchNumeric.NumbersWithDozenSuffix), + value: "IntegerNum" + }, { + regExp: recognizersText.RegExpUtility.getSafeRegExp(frenchNumeric.FrenchNumeric.AllIntRegexWithLocks), + value: "IntegerFr" + }, { + regExp: recognizersText.RegExpUtility.getSafeRegExp(frenchNumeric.FrenchNumeric.AllIntRegexWithDozenSuffixLocks), + value: "IntegerFr" + }); + this.regexes = regexes; + } +} +exports.FrenchIntegerExtractor = FrenchIntegerExtractor; +class FrenchDoubleExtractor extends extractors$4.BaseNumberExtractor { + constructor(placeholder = frenchNumeric.FrenchNumeric.PlaceHolderDefault) { + super(); + this.extractType = constants.Constants.SYS_NUM_DOUBLE; + let regexes = new Array({ + regExp: recognizersText.RegExpUtility.getSafeRegExp(frenchNumeric.FrenchNumeric.DoubleDecimalPointRegex(placeholder)), + value: "DoubleNum" + }, { + regExp: recognizersText.RegExpUtility.getSafeRegExp(frenchNumeric.FrenchNumeric.DoubleWithoutIntegralRegex(placeholder)), + value: "DoubleNum" + }, { + regExp: recognizersText.RegExpUtility.getSafeRegExp(frenchNumeric.FrenchNumeric.DoubleWithMultiplierRegex, "gs"), + value: "DoubleNum" + }, { + regExp: recognizersText.RegExpUtility.getSafeRegExp(frenchNumeric.FrenchNumeric.DoubleWithRoundNumber), + value: "DoubleNum" + }, { + regExp: recognizersText.RegExpUtility.getSafeRegExp(frenchNumeric.FrenchNumeric.DoubleAllFloatRegex), + value: "DoubleFr" + }, { + regExp: recognizersText.RegExpUtility.getSafeRegExp(frenchNumeric.FrenchNumeric.DoubleExponentialNotationRegex), + value: "DoublePow" + }, { + regExp: recognizersText.RegExpUtility.getSafeRegExp(frenchNumeric.FrenchNumeric.DoubleCaretExponentialNotationRegex), + value: "DoublePow" + }, { + regExp: this.generateLongFormatNumberRegexes(models$2.LongFormatType.doubleNumDotComma, placeholder), + value: "DoubleNum" + }, { + regExp: this.generateLongFormatNumberRegexes(models$2.LongFormatType.doubleNumNoBreakSpaceComma, placeholder), + value: "DoubleNum" + }); + this.regexes = regexes; + } +} +exports.FrenchDoubleExtractor = FrenchDoubleExtractor; +class FrenchFractionExtractor extends extractors$4.BaseNumberExtractor { + constructor() { + super(); + this.extractType = constants.Constants.SYS_NUM_FRACTION; + let regexes = new Array({ + regExp: recognizersText.RegExpUtility.getSafeRegExp(frenchNumeric.FrenchNumeric.FractionNotationRegex), + value: "FracNum" + }, { + regExp: recognizersText.RegExpUtility.getSafeRegExp(frenchNumeric.FrenchNumeric.FractionNotationWithSpacesRegex), + value: "FracNum" + }, { + regExp: recognizersText.RegExpUtility.getSafeRegExp(frenchNumeric.FrenchNumeric.FractionNounRegex), + value: "FracFr" + }, { + regExp: recognizersText.RegExpUtility.getSafeRegExp(frenchNumeric.FrenchNumeric.FractionNounWithArticleRegex), + value: "FracFr" + }, { + regExp: recognizersText.RegExpUtility.getSafeRegExp(frenchNumeric.FrenchNumeric.FractionPrepositionRegex), + value: "FracFr" + }); + this.regexes = regexes; + } +} +exports.FrenchFractionExtractor = FrenchFractionExtractor; +class FrenchOrdinalExtractor extends extractors$4.BaseNumberExtractor { + constructor() { + super(); + this.extractType = constants.Constants.SYS_NUM_ORDINAL; + let regexes = new Array({ + regExp: recognizersText.RegExpUtility.getSafeRegExp(frenchNumeric.FrenchNumeric.OrdinalSuffixRegex), + value: "OrdinalNum" + }, { + regExp: recognizersText.RegExpUtility.getSafeRegExp(frenchNumeric.FrenchNumeric.OrdinalFrenchRegex), + value: "OrdFr" + }); + this.regexes = regexes; + } +} +exports.FrenchOrdinalExtractor = FrenchOrdinalExtractor; +class FrenchPercentageExtractor extends extractors$4.BasePercentageExtractor { + constructor() { + super(new FrenchNumberExtractor()); + } + initRegexes() { + let regexStrs = [ + frenchNumeric.FrenchNumeric.NumberWithSuffixPercentage, + frenchNumeric.FrenchNumeric.NumberWithPrefixPercentage + ]; + return this.buildRegexes(regexStrs); + } +} +exports.FrenchPercentageExtractor = FrenchPercentageExtractor; + +}); + +unwrapExports(extractors$10); + +var extractors$12 = createCommonjsModule(function (module, exports) { +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); + + + + +var ChineseNumberExtractorMode; +(function (ChineseNumberExtractorMode) { + // Number extraction with an allow list that filters what numbers to extract. + ChineseNumberExtractorMode[ChineseNumberExtractorMode["Default"] = 0] = "Default"; + // Extract all number-related terms aggressively. + ChineseNumberExtractorMode[ChineseNumberExtractorMode["ExtractAll"] = 1] = "ExtractAll"; +})(ChineseNumberExtractorMode = exports.ChineseNumberExtractorMode || (exports.ChineseNumberExtractorMode = {})); +class ChineseNumberExtractor extends extractors$4.BaseNumberExtractor { + constructor(mode = ChineseNumberExtractorMode.Default) { + super(); + this.extractType = constants.Constants.SYS_NUM; + let regexes = new Array(); + // Add Cardinal + let cardExtract = new ChineseCardinalExtractor(mode); + cardExtract.regexes.forEach(r => regexes.push(r)); + // Add Fraction + let fracExtract = new ChineseFractionExtractor(); + fracExtract.regexes.forEach(r => regexes.push(r)); + this.regexes = regexes; + } +} +exports.ChineseNumberExtractor = ChineseNumberExtractor; +class ChineseCardinalExtractor extends extractors$4.BaseNumberExtractor { + constructor(mode = ChineseNumberExtractorMode.Default) { + super(); + this.extractType = constants.Constants.SYS_NUM_CARDINAL; + let regexes = new Array(); + // Add Integer Regexes + let intExtract = new ChineseIntegerExtractor(mode); + intExtract.regexes.forEach(r => regexes.push(r)); + // Add Double Regexes + let doubleExtract = new ChineseDoubleExtractor(); + doubleExtract.regexes.forEach(r => regexes.push(r)); + this.regexes = regexes; + } +} +exports.ChineseCardinalExtractor = ChineseCardinalExtractor; +class ChineseIntegerExtractor extends extractors$4.BaseNumberExtractor { + constructor(mode = ChineseNumberExtractorMode.Default) { + super(); + this.extractType = constants.Constants.SYS_NUM_INTEGER; + let regexes = new Array({ + regExp: recognizersText.RegExpUtility.getSafeRegExp(chineseNumeric.ChineseNumeric.NumbersSpecialsChars, "gi"), + value: "IntegerNum" + }, { + regExp: recognizersText.RegExpUtility.getSafeRegExp(chineseNumeric.ChineseNumeric.NumbersSpecialsCharsWithSuffix, "gs"), + value: "IntegerNum" + }, { + regExp: recognizersText.RegExpUtility.getSafeRegExp(chineseNumeric.ChineseNumeric.DottedNumbersSpecialsChar, "gis"), + value: "IntegerNum" + }, { + regExp: recognizersText.RegExpUtility.getSafeRegExp(chineseNumeric.ChineseNumeric.NumbersWithHalfDozen, "gis"), + value: "IntegerChs" + }, { + regExp: recognizersText.RegExpUtility.getSafeRegExp(chineseNumeric.ChineseNumeric.NumbersWithDozen, "gis"), + value: "IntegerChs" + }); + switch (mode) { + case ChineseNumberExtractorMode.Default: + regexes.push({ + regExp: recognizersText.RegExpUtility.getSafeRegExp(chineseNumeric.ChineseNumeric.NumbersWithAllowListRegex, "gi"), + value: "IntegerChs" + }); + break; + case ChineseNumberExtractorMode.ExtractAll: + regexes.push({ + regExp: recognizersText.RegExpUtility.getSafeRegExp(chineseNumeric.ChineseNumeric.NumbersAggressiveRegex, "gi"), + value: "IntegerChs" + }); + break; + } + this.regexes = regexes; + } +} +exports.ChineseIntegerExtractor = ChineseIntegerExtractor; +class ChineseDoubleExtractor extends extractors$4.BaseNumberExtractor { + constructor() { + super(); + this.extractType = constants.Constants.SYS_NUM_DOUBLE; + let regexes = new Array({ + regExp: recognizersText.RegExpUtility.getSafeRegExp(chineseNumeric.ChineseNumeric.DoubleSpecialsChars, "gis"), + value: "DoubleNum" + }, { + regExp: recognizersText.RegExpUtility.getSafeRegExp(chineseNumeric.ChineseNumeric.DoubleSpecialsCharsWithNegatives, "gis"), + value: "DoubleNum" + }, { + regExp: recognizersText.RegExpUtility.getSafeRegExp(chineseNumeric.ChineseNumeric.SimpleDoubleSpecialsChars, "gis"), + value: "DoubleNum" + }, { + regExp: recognizersText.RegExpUtility.getSafeRegExp(chineseNumeric.ChineseNumeric.DoubleWithMultiplierRegex, "gi"), + value: "DoubleNum" + }, { + regExp: recognizersText.RegExpUtility.getSafeRegExp(chineseNumeric.ChineseNumeric.DoubleWithThousandsRegex, "gi"), + value: "DoubleChs" + }, { + regExp: recognizersText.RegExpUtility.getSafeRegExp(chineseNumeric.ChineseNumeric.DoubleAllFloatRegex, "gi"), + value: "DoubleChs" + }, { + regExp: recognizersText.RegExpUtility.getSafeRegExp(chineseNumeric.ChineseNumeric.DoubleExponentialNotationRegex, "gis"), + value: "DoublePow" + }, { + regExp: recognizersText.RegExpUtility.getSafeRegExp(chineseNumeric.ChineseNumeric.DoubleScientificNotationRegex, "gis"), + value: "DoublePow" + }); + this.regexes = regexes; + } +} +exports.ChineseDoubleExtractor = ChineseDoubleExtractor; +class ChineseFractionExtractor extends extractors$4.BaseNumberExtractor { + constructor() { + super(); + this.extractType = constants.Constants.SYS_NUM_FRACTION; + let regexes = new Array({ + regExp: recognizersText.RegExpUtility.getSafeRegExp(chineseNumeric.ChineseNumeric.FractionNotationSpecialsCharsRegex, "gis"), + value: "FracNum" + }, { + regExp: recognizersText.RegExpUtility.getSafeRegExp(chineseNumeric.ChineseNumeric.FractionNotationRegex, "gis"), + value: "FracNum" + }, { + regExp: recognizersText.RegExpUtility.getSafeRegExp(chineseNumeric.ChineseNumeric.AllFractionNumber, "gi"), + value: "FracChs" + }); + this.regexes = regexes; + } +} +exports.ChineseFractionExtractor = ChineseFractionExtractor; +class ChineseOrdinalExtractor extends extractors$4.BaseNumberExtractor { + constructor() { + super(); + this.extractType = constants.Constants.SYS_NUM_ORDINAL; + let regexes = new Array({ + regExp: recognizersText.RegExpUtility.getSafeRegExp(chineseNumeric.ChineseNumeric.OrdinalRegex, "gi"), + value: "OrdinalChs" + }, { + regExp: recognizersText.RegExpUtility.getSafeRegExp(chineseNumeric.ChineseNumeric.OrdinalNumbersRegex, "gi"), + value: "OrdinalChs" + }); + this.regexes = regexes; + } +} +exports.ChineseOrdinalExtractor = ChineseOrdinalExtractor; +class ChinesePercentageExtractor extends extractors$4.BaseNumberExtractor { + constructor() { + super(); + this.extractType = constants.Constants.SYS_NUM_PERCENTAGE; + let regexes = new Array({ + regExp: recognizersText.RegExpUtility.getSafeRegExp(chineseNumeric.ChineseNumeric.PercentagePointRegex, "gi"), + value: "PerChs" + }, { + regExp: recognizersText.RegExpUtility.getSafeRegExp(chineseNumeric.ChineseNumeric.SimplePercentageRegex, "gi"), + value: "PerChs" + }, { + regExp: recognizersText.RegExpUtility.getSafeRegExp(chineseNumeric.ChineseNumeric.NumbersPercentagePointRegex, "gis"), + value: "PerNum" + }, { + regExp: recognizersText.RegExpUtility.getSafeRegExp(chineseNumeric.ChineseNumeric.NumbersPercentageWithSeparatorRegex, "gis"), + value: "PerNum" + }, { + regExp: recognizersText.RegExpUtility.getSafeRegExp(chineseNumeric.ChineseNumeric.NumbersPercentageWithMultiplierRegex, "gi"), + value: "PerNum" + }, { + regExp: recognizersText.RegExpUtility.getSafeRegExp(chineseNumeric.ChineseNumeric.FractionPercentagePointRegex, "gis"), + value: "PerNum" + }, { + regExp: recognizersText.RegExpUtility.getSafeRegExp(chineseNumeric.ChineseNumeric.FractionPercentageWithSeparatorRegex, "gis"), + value: "PerNum" + }, { + regExp: recognizersText.RegExpUtility.getSafeRegExp(chineseNumeric.ChineseNumeric.FractionPercentageWithMultiplierRegex, "gi"), + value: "PerNum" + }, { + regExp: recognizersText.RegExpUtility.getSafeRegExp(chineseNumeric.ChineseNumeric.SimpleNumbersPercentageRegex, "gis"), + value: "PerNum" + }, { + regExp: recognizersText.RegExpUtility.getSafeRegExp(chineseNumeric.ChineseNumeric.SimpleNumbersPercentageWithMultiplierRegex, "gi"), + value: "PerNum" + }, { + regExp: recognizersText.RegExpUtility.getSafeRegExp(chineseNumeric.ChineseNumeric.SimpleNumbersPercentagePointRegex, "gis"), + value: "PerNum" + }, { + regExp: recognizersText.RegExpUtility.getSafeRegExp(chineseNumeric.ChineseNumeric.IntegerPercentageRegex, "gis"), + value: "PerNum" + }, { + regExp: recognizersText.RegExpUtility.getSafeRegExp(chineseNumeric.ChineseNumeric.IntegerPercentageWithMultiplierRegex, "gi"), + value: "PerNum" + }, { + regExp: recognizersText.RegExpUtility.getSafeRegExp(chineseNumeric.ChineseNumeric.NumbersFractionPercentageRegex, "gis"), + value: "PerNum" + }, { + regExp: recognizersText.RegExpUtility.getSafeRegExp(chineseNumeric.ChineseNumeric.SimpleIntegerPercentageRegex, "gis"), + value: "PerNum" + }, { + regExp: recognizersText.RegExpUtility.getSafeRegExp(chineseNumeric.ChineseNumeric.NumbersFoldsPercentageRegex, "gis"), + value: "PerSpe" + }, { + regExp: recognizersText.RegExpUtility.getSafeRegExp(chineseNumeric.ChineseNumeric.FoldsPercentageRegex, "gis"), + value: "PerSpe" + }, { + regExp: recognizersText.RegExpUtility.getSafeRegExp(chineseNumeric.ChineseNumeric.SimpleFoldsPercentageRegex, "gis"), + value: "PerSpe" + }, { + regExp: recognizersText.RegExpUtility.getSafeRegExp(chineseNumeric.ChineseNumeric.SpecialsPercentageRegex, "gis"), + value: "PerSpe" + }, { + regExp: recognizersText.RegExpUtility.getSafeRegExp(chineseNumeric.ChineseNumeric.NumbersSpecialsPercentageRegex, "gis"), + value: "PerSpe" + }, { + regExp: recognizersText.RegExpUtility.getSafeRegExp(chineseNumeric.ChineseNumeric.SimpleSpecialsPercentageRegex, "gis"), + value: "PerSpe" + }, { + regExp: recognizersText.RegExpUtility.getSafeRegExp(chineseNumeric.ChineseNumeric.SpecialsFoldsPercentageRegex, "gis"), + value: "PerSpe" + }); + this.regexes = regexes; + } +} +exports.ChinesePercentageExtractor = ChinesePercentageExtractor; + +}); + +unwrapExports(extractors$12); + +var extractors$14 = createCommonjsModule(function (module, exports) { +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); + + + + +var JapaneseNumberExtractorMode; +(function (JapaneseNumberExtractorMode) { + // Number extraction with an allow list that filters what numbers to extract. + JapaneseNumberExtractorMode[JapaneseNumberExtractorMode["Default"] = 0] = "Default"; + // Extract all number-related terms aggressively. + JapaneseNumberExtractorMode[JapaneseNumberExtractorMode["ExtractAll"] = 1] = "ExtractAll"; +})(JapaneseNumberExtractorMode = exports.JapaneseNumberExtractorMode || (exports.JapaneseNumberExtractorMode = {})); +class JapaneseNumberExtractor extends extractors$4.BaseNumberExtractor { + constructor(mode = JapaneseNumberExtractorMode.Default) { + super(); + this.extractType = constants.Constants.SYS_NUM; + let regexes = new Array(); + // Add Cardinal + let cardExtract = new JapaneseCardinalExtractor(mode); + cardExtract.regexes.forEach(r => regexes.push(r)); + // Add Fraction + let fracExtract = new JapaneseFractionExtractor(); + fracExtract.regexes.forEach(r => regexes.push(r)); + this.regexes = regexes; + } +} +exports.JapaneseNumberExtractor = JapaneseNumberExtractor; +class JapaneseCardinalExtractor extends extractors$4.BaseNumberExtractor { + constructor(mode = JapaneseNumberExtractorMode.Default) { + super(); + this.extractType = constants.Constants.SYS_NUM_CARDINAL; + let regexes = new Array(); + // Add Integer Regexes + let intExtract = new JapaneseIntegerExtractor(mode); + intExtract.regexes.forEach(r => regexes.push(r)); + // Add Double Regexes + let doubleExtract = new JapaneseDoubleExtractor(); + doubleExtract.regexes.forEach(r => regexes.push(r)); + this.regexes = regexes; + } +} +exports.JapaneseCardinalExtractor = JapaneseCardinalExtractor; +class JapaneseIntegerExtractor extends extractors$4.BaseNumberExtractor { + constructor(mode = JapaneseNumberExtractorMode.Default) { + super(); + this.extractType = constants.Constants.SYS_NUM_INTEGER; + let regexes = new Array({ + regExp: recognizersText.RegExpUtility.getSafeRegExp(japaneseNumeric.JapaneseNumeric.NumbersSpecialsChars, "gi"), + value: "IntegerNum" + }, { + regExp: recognizersText.RegExpUtility.getSafeRegExp(japaneseNumeric.JapaneseNumeric.NumbersSpecialsCharsWithSuffix, "gi"), + value: "IntegerNum" + }, { + regExp: recognizersText.RegExpUtility.getSafeRegExp(japaneseNumeric.JapaneseNumeric.DottedNumbersSpecialsChar, "gi"), + value: "IntegerNum" + }, { + regExp: recognizersText.RegExpUtility.getSafeRegExp(japaneseNumeric.JapaneseNumeric.NumbersWithHalfDozen, "gi"), + value: "IntegerJpn" + }, { + regExp: recognizersText.RegExpUtility.getSafeRegExp(japaneseNumeric.JapaneseNumeric.NumbersWithDozen, "gi"), + value: "IntegerJpn" + }); + switch (mode) { + case JapaneseNumberExtractorMode.Default: + regexes.push({ + regExp: recognizersText.RegExpUtility.getSafeRegExp(japaneseNumeric.JapaneseNumeric.NumbersWithAllowListRegex, "gi"), + value: "IntegerJpn" + }); + break; + case JapaneseNumberExtractorMode.ExtractAll: + regexes.push({ + regExp: recognizersText.RegExpUtility.getSafeRegExp(japaneseNumeric.JapaneseNumeric.NumbersAggressiveRegex, "gi"), + value: "IntegerJpn" + }); + break; + } + this.regexes = regexes; + } +} +exports.JapaneseIntegerExtractor = JapaneseIntegerExtractor; +class JapaneseDoubleExtractor extends extractors$4.BaseNumberExtractor { + constructor() { + super(); + this.extractType = constants.Constants.SYS_NUM_DOUBLE; + let regexes = new Array({ + regExp: recognizersText.RegExpUtility.getSafeRegExp(japaneseNumeric.JapaneseNumeric.DoubleSpecialsChars, "gis"), + value: "DoubleNum" + }, { + regExp: recognizersText.RegExpUtility.getSafeRegExp(japaneseNumeric.JapaneseNumeric.DoubleSpecialsCharsWithNegatives, "gis"), + value: "DoubleNum" + }, { + regExp: recognizersText.RegExpUtility.getSafeRegExp(japaneseNumeric.JapaneseNumeric.SimpleDoubleSpecialsChars, "gis"), + value: "DoubleNum" + }, { + regExp: recognizersText.RegExpUtility.getSafeRegExp(japaneseNumeric.JapaneseNumeric.DoubleWithMultiplierRegex, "gis"), + value: "DoubleNum" + }, { + regExp: recognizersText.RegExpUtility.getSafeRegExp(japaneseNumeric.JapaneseNumeric.DoubleWithThousandsRegex, "gis"), + value: "DoubleJpn" + }, { + regExp: recognizersText.RegExpUtility.getSafeRegExp(japaneseNumeric.JapaneseNumeric.DoubleExponentialNotationRegex, "gis"), + value: "DoublePow" + }, { + regExp: recognizersText.RegExpUtility.getSafeRegExp(japaneseNumeric.JapaneseNumeric.DoubleScientificNotationRegex, "gis"), + value: "DoublePow" + }); + this.regexes = regexes; + } +} +exports.JapaneseDoubleExtractor = JapaneseDoubleExtractor; +class JapaneseFractionExtractor extends extractors$4.BaseNumberExtractor { + constructor() { + super(); + this.extractType = constants.Constants.SYS_NUM_FRACTION; + let regexes = new Array({ + regExp: recognizersText.RegExpUtility.getSafeRegExp(japaneseNumeric.JapaneseNumeric.FractionNotationSpecialsCharsRegex, "gis"), + value: "FracNum" + }, { + regExp: recognizersText.RegExpUtility.getSafeRegExp(japaneseNumeric.JapaneseNumeric.FractionNotationRegex, "gis"), + value: "FracNum" + }, { + regExp: recognizersText.RegExpUtility.getSafeRegExp(japaneseNumeric.JapaneseNumeric.AllFractionNumber, "gis"), + value: "FracJpn" + }); + this.regexes = regexes; + } +} +exports.JapaneseFractionExtractor = JapaneseFractionExtractor; +class JapaneseOrdinalExtractor extends extractors$4.BaseNumberExtractor { + constructor() { + super(); + this.extractType = constants.Constants.SYS_NUM_ORDINAL; + let regexes = new Array({ + regExp: recognizersText.RegExpUtility.getSafeRegExp(japaneseNumeric.JapaneseNumeric.OrdinalRegex, "gi"), + value: "OrdinalJpn" + }, { + regExp: recognizersText.RegExpUtility.getSafeRegExp(japaneseNumeric.JapaneseNumeric.OrdinalNumbersRegex, "gi"), + value: "OrdinalJpn" + }, { + regExp: recognizersText.RegExpUtility.getSafeRegExp(japaneseNumeric.JapaneseNumeric.NumbersFoldsPercentageRegex, "gi"), + value: "OrdinalJpn" + }); + this.regexes = regexes; + } +} +exports.JapaneseOrdinalExtractor = JapaneseOrdinalExtractor; +class JapanesePercentageExtractor extends extractors$4.BaseNumberExtractor { + constructor() { + super(); + this.extractType = constants.Constants.SYS_NUM_PERCENTAGE; + let regexes = new Array({ + regExp: recognizersText.RegExpUtility.getSafeRegExp(japaneseNumeric.JapaneseNumeric.SimplePercentageRegex, "gi"), + value: "PerJpn" + }, { + regExp: recognizersText.RegExpUtility.getSafeRegExp(japaneseNumeric.JapaneseNumeric.NumbersPercentagePointRegex, "gis"), + value: "PerNum" + }, { + regExp: recognizersText.RegExpUtility.getSafeRegExp(japaneseNumeric.JapaneseNumeric.NumbersPercentageWithSeparatorRegex, "gis"), + value: "PerNum" + }, { + regExp: recognizersText.RegExpUtility.getSafeRegExp(japaneseNumeric.JapaneseNumeric.NumbersPercentageWithMultiplierRegex, "gi"), + value: "PerNum" + }, { + regExp: recognizersText.RegExpUtility.getSafeRegExp(japaneseNumeric.JapaneseNumeric.SimpleNumbersPercentageWithMultiplierRegex, "gi"), + value: "PerNum" + }, { + regExp: recognizersText.RegExpUtility.getSafeRegExp(japaneseNumeric.JapaneseNumeric.SimpleIntegerPercentageRegex, "gis"), + value: "PerNum" + }, { + regExp: recognizersText.RegExpUtility.getSafeRegExp(japaneseNumeric.JapaneseNumeric.NumbersFoldsPercentageRegex, "gis"), + value: "PerSpe" + }, { + regExp: recognizersText.RegExpUtility.getSafeRegExp(japaneseNumeric.JapaneseNumeric.FoldsPercentageRegex, "gis"), + value: "PerSpe" + }, { + regExp: recognizersText.RegExpUtility.getSafeRegExp(japaneseNumeric.JapaneseNumeric.SimpleFoldsPercentageRegex, "gis"), + value: "PerSpe" + }, { + regExp: recognizersText.RegExpUtility.getSafeRegExp(japaneseNumeric.JapaneseNumeric.SpecialsPercentageRegex, "gis"), + value: "PerSpe" + }, { + regExp: recognizersText.RegExpUtility.getSafeRegExp(japaneseNumeric.JapaneseNumeric.NumbersSpecialsPercentageRegex, "gis"), + value: "PerSpe" + }, { + regExp: recognizersText.RegExpUtility.getSafeRegExp(japaneseNumeric.JapaneseNumeric.SimpleSpecialsPercentageRegex, "gis"), + value: "PerSpe" + }, { + regExp: recognizersText.RegExpUtility.getSafeRegExp(japaneseNumeric.JapaneseNumeric.SpecialsFoldsPercentageRegex, "gis"), + value: "PerSpe" + }); + this.regexes = regexes; + } +} +exports.JapanesePercentageExtractor = JapanesePercentageExtractor; + +}); + +unwrapExports(extractors$14); + +var numberRecognizer = createCommonjsModule(function (module, exports) { +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); + + + + + + + + + + + + + + + + +var NumberOptions; +(function (NumberOptions) { + NumberOptions[NumberOptions["None"] = 0] = "None"; +})(NumberOptions = exports.NumberOptions || (exports.NumberOptions = {})); +function recognizeNumber(query, culture, options = NumberOptions.None, fallbackToDefaultCulture = true) { + return recognizeByModel(recognizer => recognizer.getNumberModel(culture, fallbackToDefaultCulture), query, culture, options); +} +exports.recognizeNumber = recognizeNumber; +function recognizeOrdinal(query, culture, options = NumberOptions.None, fallbackToDefaultCulture = true) { + return recognizeByModel(recognizer => recognizer.getOrdinalModel(culture, fallbackToDefaultCulture), query, culture, options); +} +exports.recognizeOrdinal = recognizeOrdinal; +function recognizePercentage(query, culture, options = NumberOptions.None, fallbackToDefaultCulture = true) { + return recognizeByModel(recognizer => recognizer.getPercentageModel(culture, fallbackToDefaultCulture), query, culture, options); +} +exports.recognizePercentage = recognizePercentage; +function recognizeByModel(getModelFunc, query, culture, options) { + let recognizer = new NumberRecognizer(culture, options); + let model = getModelFunc(recognizer); + return model.parse(query); +} +class NumberRecognizer extends recognizersText.Recognizer { + constructor(culture, options = NumberOptions.None, lazyInitialization = false) { + super(culture, options, lazyInitialization); + } + InitializeConfiguration() { + //#region English + this.registerModel("NumberModel", culture$2.Culture.English, (options) => new models$2.NumberModel(agnosticNumberParser.AgnosticNumberParserFactory.getParser(agnosticNumberParser.AgnosticNumberParserType.Number, new parserConfiguration.EnglishNumberParserConfiguration()), new extractors$2.EnglishNumberExtractor(models$2.NumberMode.PureNumber))); + this.registerModel("OrdinalModel", culture$2.Culture.English, (options) => new models$2.OrdinalModel(agnosticNumberParser.AgnosticNumberParserFactory.getParser(agnosticNumberParser.AgnosticNumberParserType.Ordinal, new parserConfiguration.EnglishNumberParserConfiguration()), new extractors$2.EnglishOrdinalExtractor())); + this.registerModel("PercentModel", culture$2.Culture.English, (options) => new models$2.PercentModel(agnosticNumberParser.AgnosticNumberParserFactory.getParser(agnosticNumberParser.AgnosticNumberParserType.Percentage, new parserConfiguration.EnglishNumberParserConfiguration()), new extractors$2.EnglishPercentageExtractor())); + //#endregion + //#region Spanish + this.registerModel("NumberModel", culture$2.Culture.Spanish, (options) => new models$2.NumberModel(agnosticNumberParser.AgnosticNumberParserFactory.getParser(agnosticNumberParser.AgnosticNumberParserType.Number, new parserConfiguration$2.SpanishNumberParserConfiguration()), new extractors$6.SpanishNumberExtractor(models$2.NumberMode.PureNumber))); + this.registerModel("OrdinalModel", culture$2.Culture.Spanish, (options) => new models$2.OrdinalModel(agnosticNumberParser.AgnosticNumberParserFactory.getParser(agnosticNumberParser.AgnosticNumberParserType.Ordinal, new parserConfiguration$2.SpanishNumberParserConfiguration()), new extractors$6.SpanishOrdinalExtractor())); + this.registerModel("PercentModel", culture$2.Culture.Spanish, (options) => new models$2.PercentModel(agnosticNumberParser.AgnosticNumberParserFactory.getParser(agnosticNumberParser.AgnosticNumberParserType.Percentage, new parserConfiguration$2.SpanishNumberParserConfiguration()), new extractors$6.SpanishPercentageExtractor())); + //#endregion + //#region Portuguese + this.registerModel("NumberModel", culture$2.Culture.Portuguese, (options) => new models$2.NumberModel(agnosticNumberParser.AgnosticNumberParserFactory.getParser(agnosticNumberParser.AgnosticNumberParserType.Number, new parserConfiguration$4.PortugueseNumberParserConfiguration()), new extractors$8.PortugueseNumberExtractor(models$2.NumberMode.PureNumber))); + this.registerModel("OrdinalModel", culture$2.Culture.Portuguese, (options) => new models$2.OrdinalModel(agnosticNumberParser.AgnosticNumberParserFactory.getParser(agnosticNumberParser.AgnosticNumberParserType.Ordinal, new parserConfiguration$4.PortugueseNumberParserConfiguration()), new extractors$8.PortugueseOrdinalExtractor())); + this.registerModel("PercentModel", culture$2.Culture.Portuguese, (options) => new models$2.PercentModel(agnosticNumberParser.AgnosticNumberParserFactory.getParser(agnosticNumberParser.AgnosticNumberParserType.Percentage, new parserConfiguration$4.PortugueseNumberParserConfiguration()), new extractors$8.PortuguesePercentageExtractor())); + //#endregion + //#region Chinese + this.registerModel("NumberModel", culture$2.Culture.Chinese, (options) => new models$2.NumberModel(agnosticNumberParser.AgnosticNumberParserFactory.getParser(agnosticNumberParser.AgnosticNumberParserType.Number, new parserConfiguration$8.ChineseNumberParserConfiguration()), new extractors$12.ChineseNumberExtractor())); + this.registerModel("OrdinalModel", culture$2.Culture.Chinese, (options) => new models$2.OrdinalModel(agnosticNumberParser.AgnosticNumberParserFactory.getParser(agnosticNumberParser.AgnosticNumberParserType.Ordinal, new parserConfiguration$8.ChineseNumberParserConfiguration()), new extractors$12.ChineseOrdinalExtractor())); + this.registerModel("PercentModel", culture$2.Culture.Chinese, (options) => new models$2.PercentModel(agnosticNumberParser.AgnosticNumberParserFactory.getParser(agnosticNumberParser.AgnosticNumberParserType.Percentage, new parserConfiguration$8.ChineseNumberParserConfiguration()), new extractors$12.ChinesePercentageExtractor())); + //#endregion + //#region Japanese + this.registerModel("NumberModel", culture$2.Culture.Japanese, (options) => new models$2.NumberModel(agnosticNumberParser.AgnosticNumberParserFactory.getParser(agnosticNumberParser.AgnosticNumberParserType.Number, new parserConfiguration$10.JapaneseNumberParserConfiguration()), new extractors$14.JapaneseNumberExtractor())); + this.registerModel("OrdinalModel", culture$2.Culture.Japanese, (options) => new models$2.OrdinalModel(agnosticNumberParser.AgnosticNumberParserFactory.getParser(agnosticNumberParser.AgnosticNumberParserType.Ordinal, new parserConfiguration$10.JapaneseNumberParserConfiguration()), new extractors$14.JapaneseOrdinalExtractor())); + this.registerModel("PercentModel", culture$2.Culture.Japanese, (options) => new models$2.PercentModel(agnosticNumberParser.AgnosticNumberParserFactory.getParser(agnosticNumberParser.AgnosticNumberParserType.Percentage, new parserConfiguration$10.JapaneseNumberParserConfiguration()), new extractors$14.JapanesePercentageExtractor())); + //#endregion + //#region French + this.registerModel("NumberModel", culture$2.Culture.French, (options) => new models$2.NumberModel(agnosticNumberParser.AgnosticNumberParserFactory.getParser(agnosticNumberParser.AgnosticNumberParserType.Number, new parserConfiguration$6.FrenchNumberParserConfiguration()), new extractors$10.FrenchNumberExtractor(models$2.NumberMode.PureNumber))); + this.registerModel("OrdinalModel", culture$2.Culture.French, (options) => new models$2.OrdinalModel(agnosticNumberParser.AgnosticNumberParserFactory.getParser(agnosticNumberParser.AgnosticNumberParserType.Ordinal, new parserConfiguration$6.FrenchNumberParserConfiguration()), new extractors$10.FrenchOrdinalExtractor())); + this.registerModel("PercentModel", culture$2.Culture.French, (options) => new models$2.PercentModel(agnosticNumberParser.AgnosticNumberParserFactory.getParser(agnosticNumberParser.AgnosticNumberParserType.Percentage, new parserConfiguration$6.FrenchNumberParserConfiguration()), new extractors$10.FrenchPercentageExtractor())); + //#endregion + } + IsValidOptions(options) { + return options >= 0 && options <= NumberOptions.None; + } + getNumberModel(culture = null, fallbackToDefaultCulture = true) { + return this.getModel("NumberModel", culture, fallbackToDefaultCulture); + } + getOrdinalModel(culture = null, fallbackToDefaultCulture = true) { + return this.getModel("OrdinalModel", culture, fallbackToDefaultCulture); + } + getPercentageModel(culture = null, fallbackToDefaultCulture = true) { + return this.getModel("PercentModel", culture, fallbackToDefaultCulture); + } +} +exports.default = NumberRecognizer; + +}); + +unwrapExports(numberRecognizer); + +var recognizersTextNumber = createCommonjsModule(function (module, exports) { +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); + +exports.NumberRecognizer = numberRecognizer.default; +exports.NumberOptions = numberRecognizer.NumberOptions; +exports.recognizeNumber = numberRecognizer.recognizeNumber; +exports.recognizeOrdinal = numberRecognizer.recognizeOrdinal; +exports.recognizePercentage = numberRecognizer.recognizePercentage; + +exports.Culture = culture$2.Culture; +exports.CultureInfo = culture$2.CultureInfo; + +exports.FormatUtility = recognizersText.FormatUtility; +exports.StringUtility = recognizersText.StringUtility; +exports.Match = recognizersText.Match; +exports.RegExpUtility = recognizersText.RegExpUtility; + +exports.BaseNumbers = baseNumbers.BaseNumbers; + +exports.EnglishNumeric = englishNumeric.EnglishNumeric; + +exports.SpanishNumeric = spanishNumeric.SpanishNumeric; + +exports.FrenchNumeric = frenchNumeric.FrenchNumeric; + +exports.ChineseNumeric = chineseNumeric.ChineseNumeric; + +exports.JapaneseNumeric = japaneseNumeric.JapaneseNumeric; + +exports.Constants = constants.Constants; + +exports.BaseNumberExtractor = extractors$4.BaseNumberExtractor; +exports.BasePercentageExtractor = extractors$4.BasePercentageExtractor; + +exports.NumberMode = models$2.NumberMode; +exports.LongFormatType = models$2.LongFormatType; +exports.AbstractNumberModel = models$2.AbstractNumberModel; +exports.NumberModel = models$2.NumberModel; +exports.OrdinalModel = models$2.OrdinalModel; +exports.PercentModel = models$2.PercentModel; + +exports.AgnosticNumberParserType = agnosticNumberParser.AgnosticNumberParserType; +exports.AgnosticNumberParserFactory = agnosticNumberParser.AgnosticNumberParserFactory; + +exports.BaseNumberParser = parsers$2.BaseNumberParser; +exports.BasePercentageParser = parsers$2.BasePercentageParser; + +exports.EnglishCardinalExtractor = extractors$2.EnglishCardinalExtractor; +exports.EnglishDoubleExtractor = extractors$2.EnglishDoubleExtractor; +exports.EnglishFractionExtractor = extractors$2.EnglishFractionExtractor; +exports.EnglishIntegerExtractor = extractors$2.EnglishIntegerExtractor; +exports.EnglishNumberExtractor = extractors$2.EnglishNumberExtractor; +exports.EnglishOrdinalExtractor = extractors$2.EnglishOrdinalExtractor; +exports.EnglishPercentageExtractor = extractors$2.EnglishPercentageExtractor; + +exports.EnglishNumberParserConfiguration = parserConfiguration.EnglishNumberParserConfiguration; + +exports.SpanishCardinalExtractor = extractors$6.SpanishCardinalExtractor; +exports.SpanishDoubleExtractor = extractors$6.SpanishDoubleExtractor; +exports.SpanishFractionExtractor = extractors$6.SpanishFractionExtractor; +exports.SpanishIntegerExtractor = extractors$6.SpanishIntegerExtractor; +exports.SpanishNumberExtractor = extractors$6.SpanishNumberExtractor; +exports.SpanishOrdinalExtractor = extractors$6.SpanishOrdinalExtractor; +exports.SpanishPercentageExtractor = extractors$6.SpanishPercentageExtractor; + +exports.SpanishNumberParserConfiguration = parserConfiguration$2.SpanishNumberParserConfiguration; + +exports.PortugueseCardinalExtractor = extractors$8.PortugueseCardinalExtractor; +exports.PortugueseDoubleExtractor = extractors$8.PortugueseDoubleExtractor; +exports.PortugueseFractionExtractor = extractors$8.PortugueseFractionExtractor; +exports.PortugueseIntegerExtractor = extractors$8.PortugueseIntegerExtractor; +exports.PortugueseNumberExtractor = extractors$8.PortugueseNumberExtractor; +exports.PortugueseOrdinalExtractor = extractors$8.PortugueseOrdinalExtractor; +exports.PortuguesePercentageExtractor = extractors$8.PortuguesePercentageExtractor; + +exports.PortugueseNumberParserConfiguration = parserConfiguration$4.PortugueseNumberParserConfiguration; + +exports.FrenchCardinalExtractor = extractors$10.FrenchCardinalExtractor; +exports.FrenchDoubleExtractor = extractors$10.FrenchDoubleExtractor; +exports.FrenchFractionExtractor = extractors$10.FrenchFractionExtractor; +exports.FrenchIntegerExtractor = extractors$10.FrenchIntegerExtractor; +exports.FrenchNumberExtractor = extractors$10.FrenchNumberExtractor; +exports.FrenchOrdinalExtractor = extractors$10.FrenchOrdinalExtractor; +exports.FrenchPercentageExtractor = extractors$10.FrenchPercentageExtractor; + +exports.FrenchNumberParserConfiguration = parserConfiguration$6.FrenchNumberParserConfiguration; + +exports.ChineseCardinalExtractor = extractors$12.ChineseCardinalExtractor; +exports.ChineseDoubleExtractor = extractors$12.ChineseDoubleExtractor; +exports.ChineseFractionExtractor = extractors$12.ChineseFractionExtractor; +exports.ChineseIntegerExtractor = extractors$12.ChineseIntegerExtractor; +exports.ChineseNumberExtractor = extractors$12.ChineseNumberExtractor; +exports.ChineseOrdinalExtractor = extractors$12.ChineseOrdinalExtractor; +exports.ChinesePercentageExtractor = extractors$12.ChinesePercentageExtractor; +exports.ChineseNumberExtractorMode = extractors$12.ChineseNumberExtractorMode; + +exports.ChineseNumberParserConfiguration = parserConfiguration$8.ChineseNumberParserConfiguration; + +exports.JapaneseCardinalExtractor = extractors$14.JapaneseCardinalExtractor; +exports.JapaneseDoubleExtractor = extractors$14.JapaneseDoubleExtractor; +exports.JapaneseFractionExtractor = extractors$14.JapaneseFractionExtractor; +exports.JapaneseIntegerExtractor = extractors$14.JapaneseIntegerExtractor; +exports.JapaneseNumberExtractor = extractors$14.JapaneseNumberExtractor; +exports.JapaneseOrdinalExtractor = extractors$14.JapaneseOrdinalExtractor; +exports.JapanesePercentageExtractor = extractors$14.JapanesePercentageExtractor; +exports.JapaneseNumberExtractorMode = extractors$14.JapaneseNumberExtractorMode; + +exports.JapaneseNumberParserConfiguration = parserConfiguration$10.JapaneseNumberParserConfiguration; + +}); + +unwrapExports(recognizersTextNumber); + +var models$4 = createCommonjsModule(function (module, exports) { +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); + +class DateTimeModelResult extends recognizersText.ModelResult { +} +exports.DateTimeModelResult = DateTimeModelResult; +class DateTimeModel { + constructor(parser, extractor) { + this.modelTypeName = "datetime"; + this.extractor = extractor; + this.parser = parser; + } + parse(query, referenceDate = new Date()) { + query = recognizersText.FormatUtility.preProcess(query); + let extractResults = this.extractor.extract(query, referenceDate); + let parseDates = new Array(); + for (let result of extractResults) { + let parseResult = this.parser.parse(result, referenceDate); + if (Array.isArray(parseResult.value)) { + parseDates.push(...parseResult.value); + } + else { + parseDates.push(parseResult); + } + } + return parseDates + .map(o => ({ + start: o.start, + end: o.start + o.length - 1, + resolution: o.value, + text: o.text, + typeName: o.type + })); + } +} +exports.DateTimeModel = DateTimeModel; + +}); + +unwrapExports(models$4); + +var baseDateTime = createCommonjsModule(function (module, exports) { +"use strict"; +// ------------------------------------------------------------------------------ +// +// This code was generated by a tool. +// Changes to this file may cause incorrect behavior and will be lost if +// the code is regenerated. +// +// ------------------------------------------------------------------------------ +Object.defineProperty(exports, "__esModule", { value: true }); +var BaseDateTime; +(function (BaseDateTime) { + BaseDateTime.HourRegex = `(?00|01|02|03|04|05|06|07|08|09|0|10|11|12|13|14|15|16|17|18|19|20|21|22|23|24|1|2|3|4|5|6|7|8|9)(h)?`; + BaseDateTime.MinuteRegex = `(?00|01|02|03|04|05|06|07|08|09|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|0|1|2|3|4|5|6|7|8|9)(?!\\d)`; + BaseDateTime.DeltaMinuteRegex = `(?00|01|02|03|04|05|06|07|08|09|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|0|1|2|3|4|5|6|7|8|9)`; + BaseDateTime.SecondRegex = `(?00|01|02|03|04|05|06|07|08|09|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|0|1|2|3|4|5|6|7|8|9)`; + BaseDateTime.FourDigitYearRegex = `\\b(?((1\\d|20)\\d{2})|2100)(?!\\.0\\b)\\b`; + BaseDateTime.IllegalYearRegex = `([-])(${BaseDateTime.FourDigitYearRegex})([-])`; + BaseDateTime.MinYearNum = '1500'; + BaseDateTime.MaxYearNum = '2100'; + BaseDateTime.MaxTwoDigitYearFutureNum = '30'; + BaseDateTime.MinTwoDigitYearPastNum = '70'; + BaseDateTime.DayOfMonthDictionary = new Map([["1", 1], ["2", 2], ["3", 3], ["4", 4], ["5", 5], ["6", 6], ["7", 7], ["8", 8], ["9", 9], ["10", 10], ["11", 11], ["12", 12], ["13", 13], ["14", 14], ["15", 15], ["16", 16], ["17", 17], ["18", 18], ["19", 19], ["20", 20], ["21", 21], ["22", 22], ["23", 23], ["24", 24], ["25", 25], ["26", 26], ["27", 27], ["28", 28], ["29", 29], ["30", 30], ["31", 31], ["01", 1], ["02", 2], ["03", 3], ["04", 4], ["05", 5], ["06", 6], ["07", 7], ["08", 8], ["09", 9]]); + BaseDateTime.VariableHolidaysTimexDictionary = new Map([["fathers", "-06-WXX-7-3"], ["mothers", "-05-WXX-7-2"], ["thanksgiving", "-11-WXX-4-4"], ["martinlutherking", "-01-WXX-1-3"], ["washingtonsbirthday", "-02-WXX-1-3"], ["canberra", "-03-WXX-1-1"], ["labour", "-09-WXX-1-1"], ["columbus", "-10-WXX-1-2"], ["memorial", "-05-WXX-1-4"]]); +})(BaseDateTime = exports.BaseDateTime || (exports.BaseDateTime = {})); + +}); + +unwrapExports(baseDateTime); + +var constants$2 = createCommonjsModule(function (module, exports) { +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); + +class Constants { +} +Constants.SYS_DATETIME_DATE = "date"; +Constants.SYS_DATETIME_TIME = "time"; +Constants.SYS_DATETIME_DATEPERIOD = "daterange"; +Constants.SYS_DATETIME_DATETIME = "datetime"; +Constants.SYS_DATETIME_TIMEPERIOD = "timerange"; +Constants.SYS_DATETIME_DATETIMEPERIOD = "datetimerange"; +Constants.SYS_DATETIME_DURATION = "duration"; +Constants.SYS_DATETIME_SET = "set"; +// key +Constants.TimexKey = "timex"; +Constants.ModKey = "Mod"; +Constants.TypeKey = "type"; +Constants.IsLunarKey = "isLunar"; +Constants.ResolveKey = "resolve"; +Constants.ResolveToPastKey = "resolveToPast"; +Constants.ResolveToFutureKey = "resolveToFuture"; +Constants.CommentKey = "Comment"; +Constants.CommentAmPm = "ampm"; +Constants.SemesterMonthCount = 6; +Constants.TrimesterMonthCount = 3; +Constants.FourDigitsYearLength = 4; +Constants.DefaultLanguageFallback_MDY = 'MDY'; +Constants.DefaultLanguageFallback_DMY = 'DMY'; +Constants.MinYearNum = parseInt(baseDateTime.BaseDateTime.MinYearNum); +Constants.MaxYearNum = parseInt(baseDateTime.BaseDateTime.MaxYearNum); +Constants.MaxTwoDigitYearFutureNum = parseInt(baseDateTime.BaseDateTime.MaxTwoDigitYearFutureNum); +Constants.MinTwoDigitYearPastNum = parseInt(baseDateTime.BaseDateTime.MinTwoDigitYearPastNum); +// Mod Value +// "before" -> To mean "preceding in time". I.e. Does not include the extracted datetime entity in the resolution's ending point. Equivalent to "<" +Constants.BEFORE_MOD = 'before'; +// "after" -> To mean "following in time". I.e. Does not include the extracted datetime entity in the resolution's starting point. Equivalent to ">" +Constants.AFTER_MOD = 'after'; +// "since" -> Same as "after", but including the extracted datetime entity. Equivalent to ">=" +Constants.SINCE_MOD = 'since'; +// "until" -> Same as "before", but including the extracted datetime entity. Equivalent to "<=" +Constants.UNTIL_MOD = 'until'; +Constants.EARLY_MOD = 'start'; +Constants.MID_MOD = 'mid'; +Constants.LATE_MOD = 'end'; +Constants.MORE_THAN_MOD = 'more'; +Constants.LESS_THAN_MOD = 'less'; +Constants.REF_UNDEF_MOD = 'ref_undef'; +exports.Constants = Constants; +class TimeTypeConstants { +} +TimeTypeConstants.DATE = "date"; +TimeTypeConstants.START_DATE = "startDate"; +TimeTypeConstants.END_DATE = "endDate"; +TimeTypeConstants.DATETIME = "dateTime"; +TimeTypeConstants.START_DATETIME = "startDateTime"; +TimeTypeConstants.END_DATETIME = "endDateTime"; +TimeTypeConstants.DURATION = "duration"; +TimeTypeConstants.SET = "set"; +TimeTypeConstants.TIME = "time"; +TimeTypeConstants.VALUE = "value"; +TimeTypeConstants.START_TIME = "startTime"; +TimeTypeConstants.END_TIME = "endTime"; +TimeTypeConstants.START = "start"; +TimeTypeConstants.END = "end"; +TimeTypeConstants.beforeMod = "before"; +TimeTypeConstants.afterMod = "after"; +TimeTypeConstants.sinceMod = "since"; +TimeTypeConstants.moreThanMod = "more"; +TimeTypeConstants.lessThanMod = "less"; +exports.TimeTypeConstants = TimeTypeConstants; + +}); + +unwrapExports(constants$2); + +var utilities$2 = createCommonjsModule(function (module, exports) { +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); + + +class Token { + constructor(start, end) { + this.start = start; + this.end = end; + } + get length() { + return this.end - this.start; + } + static mergeAllTokens(tokens, source, extractorName) { + let ret = []; + let mergedTokens = []; + tokens = tokens.sort((a, b) => { return a.start < b.start ? -1 : 1; }); + tokens.forEach(token => { + if (token) { + let bAdd = true; + for (let index = 0; index < mergedTokens.length && bAdd; index++) { + let mergedToken = mergedTokens[index]; + if (token.start >= mergedToken.start && token.end <= mergedToken.end) { + bAdd = false; + } + if (token.start > mergedToken.start && token.start < mergedToken.end) { + bAdd = false; + } + if (token.start <= mergedToken.start && token.end >= mergedToken.end) { + bAdd = false; + mergedTokens[index] = token; + } + } + if (bAdd) { + mergedTokens.push(token); + } + } + }); + mergedTokens.forEach(token => { + ret.push({ + start: token.start, + length: token.length, + text: source.substr(token.start, token.length), + type: extractorName + }); + }); + return ret; + } +} +exports.Token = Token; +var AgoLaterMode; +(function (AgoLaterMode) { + AgoLaterMode[AgoLaterMode["Date"] = 0] = "Date"; + AgoLaterMode[AgoLaterMode["DateTime"] = 1] = "DateTime"; +})(AgoLaterMode = exports.AgoLaterMode || (exports.AgoLaterMode = {})); +class AgoLaterUtil { + static extractorDurationWithBeforeAndAfter(source, er, ret, config) { + let pos = er.start + er.length; + if (pos <= source.length) { + let afterString = source.substring(pos); + let beforeString = source.substring(0, er.start); + let value = MatchingUtil.getAgoLaterIndex(afterString, config.agoRegex); + if (value.matched) { + ret.push(new Token(er.start, er.start + er.length + value.index)); + } + else { + value = MatchingUtil.getAgoLaterIndex(afterString, config.laterRegex); + if (value.matched) { + ret.push(new Token(er.start, er.start + er.length + value.index)); + } + else { + value = MatchingUtil.getInIndex(beforeString, config.inConnectorRegex); + // for range unit like "week, month, year", it should output dateRange or datetimeRange + if (recognizersText.RegExpUtility.getMatches(config.rangeUnitRegex, er.text).length > 0) + return ret; + if (value.matched && er.start && er.length && er.start >= value.index) { + ret.push(new Token(er.start - value.index, er.start + er.length)); + } + } + } + } + return ret; + } + static parseDurationWithAgoAndLater(source, referenceDate, durationExtractor, durationParser, unitMap, unitRegex, utilityConfiguration, mode) { + let result = new DateTimeResolutionResult(); + let duration = durationExtractor.extract(source, referenceDate).pop(); + if (!duration) + return result; + let pr = durationParser.parse(duration, referenceDate); + if (!pr) + return result; + let match = recognizersText.RegExpUtility.getMatches(unitRegex, source).pop(); + if (!match) + return result; + let afterStr = source.substr(duration.start + duration.length); + let beforeStr = source.substr(0, duration.start); + let srcUnit = match.groups('unit').value; + let durationResult = pr.value; + let numStr = durationResult.timex.substr(0, durationResult.timex.length - 1) + .replace('P', '') + .replace('T', ''); + let num = Number.parseInt(numStr, 10); + if (!num) + return result; + return AgoLaterUtil.getAgoLaterResult(pr, num, unitMap, srcUnit, afterStr, beforeStr, referenceDate, utilityConfiguration, mode); + } + static getAgoLaterResult(durationParseResult, num, unitMap, srcUnit, afterStr, beforeStr, referenceDate, utilityConfiguration, mode) { + let result = new DateTimeResolutionResult(); + let unitStr = unitMap.get(srcUnit); + if (!unitStr) + return result; + let numStr = num.toString(); + let containsAgo = MatchingUtil.containsAgoLaterIndex(afterStr, utilityConfiguration.agoRegex); + let containsLaterOrIn = MatchingUtil.containsAgoLaterIndex(afterStr, utilityConfiguration.laterRegex) || MatchingUtil.containsInIndex(beforeStr, utilityConfiguration.inConnectorRegex); + if (containsAgo) { + result = AgoLaterUtil.getDateResult(unitStr, num, referenceDate, false, mode); + durationParseResult.value.mod = constants$2.TimeTypeConstants.beforeMod; + result.subDateTimeEntities = [durationParseResult]; + return result; + } + if (containsLaterOrIn) { + result = AgoLaterUtil.getDateResult(unitStr, num, referenceDate, true, mode); + durationParseResult.value.mod = constants$2.TimeTypeConstants.afterMod; + result.subDateTimeEntities = [durationParseResult]; + return result; + } + return result; + } + static getDateResult(unitStr, num, referenceDate, isFuture, mode) { + let value = new Date(referenceDate); + let result = new DateTimeResolutionResult(); + let swift = isFuture ? 1 : -1; + switch (unitStr) { + case 'D': + value.setDate(referenceDate.getDate() + (num * swift)); + break; + case 'W': + value.setDate(referenceDate.getDate() + (num * swift * 7)); + break; + case 'MON': + value.setMonth(referenceDate.getMonth() + (num * swift)); + break; + case 'Y': + value.setFullYear(referenceDate.getFullYear() + (num * swift)); + break; + case 'H': + value.setHours(referenceDate.getHours() + (num * swift)); + break; + case 'M': + value.setMinutes(referenceDate.getMinutes() + (num * swift)); + break; + case 'S': + value.setSeconds(referenceDate.getSeconds() + (num * swift)); + break; + default: return result; + } + result.timex = mode === AgoLaterMode.Date ? FormatUtil.luisDateFromDate(value) : FormatUtil.luisDateTime(value); + result.futureValue = value; + result.pastValue = value; + result.success = true; + return result; + } +} +exports.AgoLaterUtil = AgoLaterUtil; +class MatchingUtil { + static getAgoLaterIndex(source, regex) { + let result = { matched: false, index: -1 }; + let referencedMatches = recognizersText.RegExpUtility.getMatches(regex, source.trim().toLowerCase()); + if (referencedMatches && referencedMatches.length > 0 && referencedMatches[0].index === 0) { + result.index = source.toLowerCase().indexOf(referencedMatches[0].value) + referencedMatches[0].length; + result.matched = true; + } + return result; + } + static getInIndex(source, regex) { + let result = { matched: false, index: -1 }; + let referencedMatch = recognizersText.RegExpUtility.getMatches(regex, source.trim().toLowerCase().split(' ').pop()); + if (referencedMatch && referencedMatch.length > 0) { + result.index = source.length - source.toLowerCase().lastIndexOf(referencedMatch[0].value); + result.matched = true; + } + return result; + } + static containsAgoLaterIndex(source, regex) { + return this.getAgoLaterIndex(source, regex).matched; + } + static containsInIndex(source, regex) { + return this.getInIndex(source, regex).matched; + } +} +exports.MatchingUtil = MatchingUtil; +class FormatUtil { + // Emulates .NET ToString("D{size}") + static toString(num, size) { + let s = "000000" + (num || ""); + return s.substr(s.length - size); + } + static luisDate(year, month, day) { + if (year === -1) { + if (month === -1) { + return new Array("XXXX", "XX", FormatUtil.toString(day, 2)).join("-"); + } + return new Array("XXXX", FormatUtil.toString(month + 1, 2), FormatUtil.toString(day, 2)).join("-"); + } + return new Array(FormatUtil.toString(year, 4), FormatUtil.toString(month + 1, 2), FormatUtil.toString(day, 2)).join("-"); + } + static luisDateFromDate(date) { + return FormatUtil.luisDate(date.getFullYear(), date.getMonth(), date.getDate()); + } + static luisTime(hour, min, second) { + return new Array(FormatUtil.toString(hour, 2), FormatUtil.toString(min, 2), FormatUtil.toString(second, 2)).join(":"); + } + static luisTimeFromDate(time) { + return FormatUtil.luisTime(time.getHours(), time.getMinutes(), time.getSeconds()); + } + static luisDateTime(time) { + return `${FormatUtil.luisDateFromDate(time)}T${FormatUtil.luisTimeFromDate(time)}`; + } + static formatDate(date) { + return new Array(FormatUtil.toString(date.getFullYear(), 4), FormatUtil.toString(date.getMonth() + 1, 2), FormatUtil.toString(date.getDate(), 2)).join("-"); + } + static formatTime(time) { + return new Array(FormatUtil.toString(time.getHours(), 2), FormatUtil.toString(time.getMinutes(), 2), FormatUtil.toString(time.getSeconds(), 2)).join(":"); + } + static formatDateTime(datetime) { + return `${FormatUtil.formatDate(datetime)} ${FormatUtil.formatTime(datetime)}`; + } + static shortTime(hour, minute, second) { + if (minute < 0 && second < 0) { + return `T${FormatUtil.toString(hour, 2)}`; + } + else if (second < 0) { + return `T${FormatUtil.toString(hour, 2)}:${FormatUtil.toString(minute, 2)}`; + } + return `T${FormatUtil.toString(hour, 2)}:${FormatUtil.toString(minute, 2)}:${FormatUtil.toString(second, 2)}`; + } + static luisTimeSpan(from, to) { + let result = 'PT'; + let span = DateUtils.totalHoursFloor(from, to); + if (span > 0) { + result = `${result}${span}H`; + } + span = DateUtils.totalMinutesFloor(from, to) - (span * 60); + if (span > 0 && span < 60) { + result = `${result}${span}M`; + } + span = DateUtils.totalSeconds(from, to) - (span * 60); + if (span > 0 && span < 60) { + result = `${result}${span}S`; + } + return result; + } + static allStringToPm(timeStr) { + let matches = recognizersText.RegExpUtility.getMatches(FormatUtil.HourTimexRegex, timeStr); + let split = Array(); + let lastPos = 0; + matches.forEach(match => { + if (lastPos !== match.index) + split.push(timeStr.substring(lastPos, match.index)); + split.push(timeStr.substring(match.index, match.index + match.length)); + lastPos = match.index + match.length; + }); + if (timeStr.substring(lastPos)) { + split.push(timeStr.substring(lastPos)); + } + for (let i = 0; i < split.length; i += 1) { + if (recognizersText.RegExpUtility.getMatches(FormatUtil.HourTimexRegex, split[i]).length > 0) { + split[i] = FormatUtil.toPm(split[i]); + } + } + return split.join(''); + } + static toPm(timeStr) { + let hasT = false; + if (timeStr.startsWith("T")) { + hasT = true; + timeStr = timeStr.substring(1); + } + let split = timeStr.split(':'); + let hour = parseInt(split[0], 10); + hour = (hour === 12) ? 0 : hour + 12; + split[0] = FormatUtil.toString(hour, 2); + return (hasT ? "T" : "") + split.join(":"); + } +} +FormatUtil.HourTimexRegex = recognizersText.RegExpUtility.getSafeRegExp(String.raw `(?= 12) { + year += (month + 1) / 12; + month %= 12; + } + return this.safeCreateFromMinValue(year, month, day); + } + static safeCreateFromMinValueWithDateAndTime(date, time) { + return this.safeCreateFromMinValue(date.getFullYear(), date.getMonth(), date.getDate(), time ? time.getHours() : 0, time ? time.getMinutes() : 0, time ? time.getSeconds() : 0); + } + static isLeapYear(year) { + return ((year % 4 === 0) && (year % 100 !== 0)) || (year % 400 === 0); + } + static dayOfYear(date) { + let start = new Date(date.getFullYear(), 0, 1); + let diffDays = date.valueOf() - start.valueOf(); + return Math.floor(diffDays / DateUtils.oneDay); + } + static validDays(year) { return [31, this.isLeapYear(year) ? 29 : 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31]; } + static isValidDate(year, month, day) { + return year > 0 && year <= 9999 + && month >= 0 && month < 12 + && day > 0 && day <= this.validDays(year)[month]; + } + static isValidTime(hour, minute, second) { + return hour >= 0 && hour < 24 + && minute >= 0 && minute < 60 + && second >= 0 && minute < 60; + } +} +DateUtils.oneDay = 24 * 60 * 60 * 1000; +DateUtils.oneHour = 60 * 60 * 1000; +DateUtils.oneMinute = 60 * 1000; +DateUtils.oneSecond = 1000; +exports.DateUtils = DateUtils; + +}); + +unwrapExports(utilities$2); + +var lodash_isequal = createCommonjsModule(function (module, exports) { +/** + * Lodash (Custom Build) + * Build: `lodash modularize exports="npm" -o ./` + * Copyright JS Foundation and other contributors + * Released under MIT license + * Based on Underscore.js 1.8.3 + * Copyright Jeremy Ashkenas, DocumentCloud and Investigative Reporters & Editors + */ + +/** Used as the size to enable large array optimizations. */ +var LARGE_ARRAY_SIZE = 200; + +/** Used to stand-in for `undefined` hash values. */ +var HASH_UNDEFINED = '__lodash_hash_undefined__'; + +/** Used to compose bitmasks for value comparisons. */ +var COMPARE_PARTIAL_FLAG = 1, + COMPARE_UNORDERED_FLAG = 2; + +/** Used as references for various `Number` constants. */ +var MAX_SAFE_INTEGER = 9007199254740991; + +/** `Object#toString` result references. */ +var argsTag = '[object Arguments]', + arrayTag = '[object Array]', + asyncTag = '[object AsyncFunction]', + boolTag = '[object Boolean]', + dateTag = '[object Date]', + errorTag = '[object Error]', + funcTag = '[object Function]', + genTag = '[object GeneratorFunction]', + mapTag = '[object Map]', + numberTag = '[object Number]', + nullTag = '[object Null]', + objectTag = '[object Object]', + promiseTag = '[object Promise]', + proxyTag = '[object Proxy]', + regexpTag = '[object RegExp]', + setTag = '[object Set]', + stringTag = '[object String]', + symbolTag = '[object Symbol]', + undefinedTag = '[object Undefined]', + weakMapTag = '[object WeakMap]'; + +var arrayBufferTag = '[object ArrayBuffer]', + dataViewTag = '[object DataView]', + float32Tag = '[object Float32Array]', + float64Tag = '[object Float64Array]', + int8Tag = '[object Int8Array]', + int16Tag = '[object Int16Array]', + int32Tag = '[object Int32Array]', + uint8Tag = '[object Uint8Array]', + uint8ClampedTag = '[object Uint8ClampedArray]', + uint16Tag = '[object Uint16Array]', + uint32Tag = '[object Uint32Array]'; + +/** + * Used to match `RegExp` + * [syntax characters](http://ecma-international.org/ecma-262/7.0/#sec-patterns). + */ +var reRegExpChar = /[\\^$.*+?()[\]{}|]/g; + +/** Used to detect host constructors (Safari). */ +var reIsHostCtor = /^\[object .+?Constructor\]$/; + +/** Used to detect unsigned integer values. */ +var reIsUint = /^(?:0|[1-9]\d*)$/; + +/** Used to identify `toStringTag` values of typed arrays. */ +var typedArrayTags = {}; +typedArrayTags[float32Tag] = typedArrayTags[float64Tag] = +typedArrayTags[int8Tag] = typedArrayTags[int16Tag] = +typedArrayTags[int32Tag] = typedArrayTags[uint8Tag] = +typedArrayTags[uint8ClampedTag] = typedArrayTags[uint16Tag] = +typedArrayTags[uint32Tag] = true; +typedArrayTags[argsTag] = typedArrayTags[arrayTag] = +typedArrayTags[arrayBufferTag] = typedArrayTags[boolTag] = +typedArrayTags[dataViewTag] = typedArrayTags[dateTag] = +typedArrayTags[errorTag] = typedArrayTags[funcTag] = +typedArrayTags[mapTag] = typedArrayTags[numberTag] = +typedArrayTags[objectTag] = typedArrayTags[regexpTag] = +typedArrayTags[setTag] = typedArrayTags[stringTag] = +typedArrayTags[weakMapTag] = false; + +/** Detect free variable `global` from Node.js. */ +var freeGlobal = typeof commonjsGlobal == 'object' && commonjsGlobal && commonjsGlobal.Object === Object && commonjsGlobal; + +/** Detect free variable `self`. */ +var freeSelf = typeof self == 'object' && self && self.Object === Object && self; + +/** Used as a reference to the global object. */ +var root = freeGlobal || freeSelf || Function('return this')(); + +/** Detect free variable `exports`. */ +var freeExports = 'object' == 'object' && exports && !exports.nodeType && exports; + +/** Detect free variable `module`. */ +var freeModule = freeExports && 'object' == 'object' && module && !module.nodeType && module; + +/** Detect the popular CommonJS extension `module.exports`. */ +var moduleExports = freeModule && freeModule.exports === freeExports; + +/** Detect free variable `process` from Node.js. */ +var freeProcess = moduleExports && freeGlobal.process; + +/** Used to access faster Node.js helpers. */ +var nodeUtil = (function() { + try { + return freeProcess && freeProcess.binding && freeProcess.binding('util'); + } catch (e) {} +}()); + +/* Node.js helper references. */ +var nodeIsTypedArray = nodeUtil && nodeUtil.isTypedArray; + +/** + * A specialized version of `_.filter` for arrays without support for + * iteratee shorthands. + * + * @private + * @param {Array} [array] The array to iterate over. + * @param {Function} predicate The function invoked per iteration. + * @returns {Array} Returns the new filtered array. + */ +function arrayFilter(array, predicate) { + var index = -1, + length = array == null ? 0 : array.length, + resIndex = 0, + result = []; + + while (++index < length) { + var value = array[index]; + if (predicate(value, index, array)) { + result[resIndex++] = value; + } + } + return result; +} + +/** + * Appends the elements of `values` to `array`. + * + * @private + * @param {Array} array The array to modify. + * @param {Array} values The values to append. + * @returns {Array} Returns `array`. + */ +function arrayPush(array, values) { + var index = -1, + length = values.length, + offset = array.length; + + while (++index < length) { + array[offset + index] = values[index]; + } + return array; +} + +/** + * A specialized version of `_.some` for arrays without support for iteratee + * shorthands. + * + * @private + * @param {Array} [array] The array to iterate over. + * @param {Function} predicate The function invoked per iteration. + * @returns {boolean} Returns `true` if any element passes the predicate check, + * else `false`. + */ +function arraySome(array, predicate) { + var index = -1, + length = array == null ? 0 : array.length; + + while (++index < length) { + if (predicate(array[index], index, array)) { + return true; + } + } + return false; +} + +/** + * The base implementation of `_.times` without support for iteratee shorthands + * or max array length checks. + * + * @private + * @param {number} n The number of times to invoke `iteratee`. + * @param {Function} iteratee The function invoked per iteration. + * @returns {Array} Returns the array of results. + */ +function baseTimes(n, iteratee) { + var index = -1, + result = Array(n); + + while (++index < n) { + result[index] = iteratee(index); + } + return result; +} + +/** + * The base implementation of `_.unary` without support for storing metadata. + * + * @private + * @param {Function} func The function to cap arguments for. + * @returns {Function} Returns the new capped function. + */ +function baseUnary(func) { + return function(value) { + return func(value); + }; +} + +/** + * Checks if a `cache` value for `key` exists. + * + * @private + * @param {Object} cache The cache to query. + * @param {string} key The key of the entry to check. + * @returns {boolean} Returns `true` if an entry for `key` exists, else `false`. + */ +function cacheHas(cache, key) { + return cache.has(key); +} + +/** + * Gets the value at `key` of `object`. + * + * @private + * @param {Object} [object] The object to query. + * @param {string} key The key of the property to get. + * @returns {*} Returns the property value. + */ +function getValue(object, key) { + return object == null ? undefined : object[key]; +} + +/** + * Converts `map` to its key-value pairs. + * + * @private + * @param {Object} map The map to convert. + * @returns {Array} Returns the key-value pairs. + */ +function mapToArray(map) { + var index = -1, + result = Array(map.size); + + map.forEach(function(value, key) { + result[++index] = [key, value]; + }); + return result; +} + +/** + * Creates a unary function that invokes `func` with its argument transformed. + * + * @private + * @param {Function} func The function to wrap. + * @param {Function} transform The argument transform. + * @returns {Function} Returns the new function. + */ +function overArg(func, transform) { + return function(arg) { + return func(transform(arg)); + }; +} + +/** + * Converts `set` to an array of its values. + * + * @private + * @param {Object} set The set to convert. + * @returns {Array} Returns the values. + */ +function setToArray(set) { + var index = -1, + result = Array(set.size); + + set.forEach(function(value) { + result[++index] = value; + }); + return result; +} + +/** Used for built-in method references. */ +var arrayProto = Array.prototype, + funcProto = Function.prototype, + objectProto = Object.prototype; + +/** Used to detect overreaching core-js shims. */ +var coreJsData = root['__core-js_shared__']; + +/** Used to resolve the decompiled source of functions. */ +var funcToString = funcProto.toString; + +/** Used to check objects for own properties. */ +var hasOwnProperty = objectProto.hasOwnProperty; + +/** Used to detect methods masquerading as native. */ +var maskSrcKey = (function() { + var uid = /[^.]+$/.exec(coreJsData && coreJsData.keys && coreJsData.keys.IE_PROTO || ''); + return uid ? ('Symbol(src)_1.' + uid) : ''; +}()); + +/** + * Used to resolve the + * [`toStringTag`](http://ecma-international.org/ecma-262/7.0/#sec-object.prototype.tostring) + * of values. + */ +var nativeObjectToString = objectProto.toString; + +/** Used to detect if a method is native. */ +var reIsNative = RegExp('^' + + funcToString.call(hasOwnProperty).replace(reRegExpChar, '\\$&') + .replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g, '$1.*?') + '$' +); + +/** Built-in value references. */ +var Buffer = moduleExports ? root.Buffer : undefined, + Symbol = root.Symbol, + Uint8Array = root.Uint8Array, + propertyIsEnumerable = objectProto.propertyIsEnumerable, + splice = arrayProto.splice, + symToStringTag = Symbol ? Symbol.toStringTag : undefined; + +/* Built-in method references for those with the same name as other `lodash` methods. */ +var nativeGetSymbols = Object.getOwnPropertySymbols, + nativeIsBuffer = Buffer ? Buffer.isBuffer : undefined, + nativeKeys = overArg(Object.keys, Object); + +/* Built-in method references that are verified to be native. */ +var DataView = getNative(root, 'DataView'), + Map = getNative(root, 'Map'), + Promise = getNative(root, 'Promise'), + Set = getNative(root, 'Set'), + WeakMap = getNative(root, 'WeakMap'), + nativeCreate = getNative(Object, 'create'); + +/** Used to detect maps, sets, and weakmaps. */ +var dataViewCtorString = toSource(DataView), + mapCtorString = toSource(Map), + promiseCtorString = toSource(Promise), + setCtorString = toSource(Set), + weakMapCtorString = toSource(WeakMap); + +/** Used to convert symbols to primitives and strings. */ +var symbolProto = Symbol ? Symbol.prototype : undefined, + symbolValueOf = symbolProto ? symbolProto.valueOf : undefined; + +/** + * Creates a hash object. + * + * @private + * @constructor + * @param {Array} [entries] The key-value pairs to cache. + */ +function Hash(entries) { + var index = -1, + length = entries == null ? 0 : entries.length; + + this.clear(); + while (++index < length) { + var entry = entries[index]; + this.set(entry[0], entry[1]); + } +} + +/** + * Removes all key-value entries from the hash. + * + * @private + * @name clear + * @memberOf Hash + */ +function hashClear() { + this.__data__ = nativeCreate ? nativeCreate(null) : {}; + this.size = 0; +} + +/** + * Removes `key` and its value from the hash. + * + * @private + * @name delete + * @memberOf Hash + * @param {Object} hash The hash to modify. + * @param {string} key The key of the value to remove. + * @returns {boolean} Returns `true` if the entry was removed, else `false`. + */ +function hashDelete(key) { + var result = this.has(key) && delete this.__data__[key]; + this.size -= result ? 1 : 0; + return result; +} + +/** + * Gets the hash value for `key`. + * + * @private + * @name get + * @memberOf Hash + * @param {string} key The key of the value to get. + * @returns {*} Returns the entry value. + */ +function hashGet(key) { + var data = this.__data__; + if (nativeCreate) { + var result = data[key]; + return result === HASH_UNDEFINED ? undefined : result; + } + return hasOwnProperty.call(data, key) ? data[key] : undefined; +} + +/** + * Checks if a hash value for `key` exists. + * + * @private + * @name has + * @memberOf Hash + * @param {string} key The key of the entry to check. + * @returns {boolean} Returns `true` if an entry for `key` exists, else `false`. + */ +function hashHas(key) { + var data = this.__data__; + return nativeCreate ? (data[key] !== undefined) : hasOwnProperty.call(data, key); +} + +/** + * Sets the hash `key` to `value`. + * + * @private + * @name set + * @memberOf Hash + * @param {string} key The key of the value to set. + * @param {*} value The value to set. + * @returns {Object} Returns the hash instance. + */ +function hashSet(key, value) { + var data = this.__data__; + this.size += this.has(key) ? 0 : 1; + data[key] = (nativeCreate && value === undefined) ? HASH_UNDEFINED : value; + return this; +} + +// Add methods to `Hash`. +Hash.prototype.clear = hashClear; +Hash.prototype['delete'] = hashDelete; +Hash.prototype.get = hashGet; +Hash.prototype.has = hashHas; +Hash.prototype.set = hashSet; + +/** + * Creates an list cache object. + * + * @private + * @constructor + * @param {Array} [entries] The key-value pairs to cache. + */ +function ListCache(entries) { + var index = -1, + length = entries == null ? 0 : entries.length; + + this.clear(); + while (++index < length) { + var entry = entries[index]; + this.set(entry[0], entry[1]); + } +} + +/** + * Removes all key-value entries from the list cache. + * + * @private + * @name clear + * @memberOf ListCache + */ +function listCacheClear() { + this.__data__ = []; + this.size = 0; +} + +/** + * Removes `key` and its value from the list cache. + * + * @private + * @name delete + * @memberOf ListCache + * @param {string} key The key of the value to remove. + * @returns {boolean} Returns `true` if the entry was removed, else `false`. + */ +function listCacheDelete(key) { + var data = this.__data__, + index = assocIndexOf(data, key); + + if (index < 0) { + return false; + } + var lastIndex = data.length - 1; + if (index == lastIndex) { + data.pop(); + } else { + splice.call(data, index, 1); + } + --this.size; + return true; +} + +/** + * Gets the list cache value for `key`. + * + * @private + * @name get + * @memberOf ListCache + * @param {string} key The key of the value to get. + * @returns {*} Returns the entry value. + */ +function listCacheGet(key) { + var data = this.__data__, + index = assocIndexOf(data, key); + + return index < 0 ? undefined : data[index][1]; +} + +/** + * Checks if a list cache value for `key` exists. + * + * @private + * @name has + * @memberOf ListCache + * @param {string} key The key of the entry to check. + * @returns {boolean} Returns `true` if an entry for `key` exists, else `false`. + */ +function listCacheHas(key) { + return assocIndexOf(this.__data__, key) > -1; +} + +/** + * Sets the list cache `key` to `value`. + * + * @private + * @name set + * @memberOf ListCache + * @param {string} key The key of the value to set. + * @param {*} value The value to set. + * @returns {Object} Returns the list cache instance. + */ +function listCacheSet(key, value) { + var data = this.__data__, + index = assocIndexOf(data, key); + + if (index < 0) { + ++this.size; + data.push([key, value]); + } else { + data[index][1] = value; + } + return this; +} + +// Add methods to `ListCache`. +ListCache.prototype.clear = listCacheClear; +ListCache.prototype['delete'] = listCacheDelete; +ListCache.prototype.get = listCacheGet; +ListCache.prototype.has = listCacheHas; +ListCache.prototype.set = listCacheSet; + +/** + * Creates a map cache object to store key-value pairs. + * + * @private + * @constructor + * @param {Array} [entries] The key-value pairs to cache. + */ +function MapCache(entries) { + var index = -1, + length = entries == null ? 0 : entries.length; + + this.clear(); + while (++index < length) { + var entry = entries[index]; + this.set(entry[0], entry[1]); + } +} + +/** + * Removes all key-value entries from the map. + * + * @private + * @name clear + * @memberOf MapCache + */ +function mapCacheClear() { + this.size = 0; + this.__data__ = { + 'hash': new Hash, + 'map': new (Map || ListCache), + 'string': new Hash + }; +} + +/** + * Removes `key` and its value from the map. + * + * @private + * @name delete + * @memberOf MapCache + * @param {string} key The key of the value to remove. + * @returns {boolean} Returns `true` if the entry was removed, else `false`. + */ +function mapCacheDelete(key) { + var result = getMapData(this, key)['delete'](key); + this.size -= result ? 1 : 0; + return result; +} + +/** + * Gets the map value for `key`. + * + * @private + * @name get + * @memberOf MapCache + * @param {string} key The key of the value to get. + * @returns {*} Returns the entry value. + */ +function mapCacheGet(key) { + return getMapData(this, key).get(key); +} + +/** + * Checks if a map value for `key` exists. + * + * @private + * @name has + * @memberOf MapCache + * @param {string} key The key of the entry to check. + * @returns {boolean} Returns `true` if an entry for `key` exists, else `false`. + */ +function mapCacheHas(key) { + return getMapData(this, key).has(key); +} + +/** + * Sets the map `key` to `value`. + * + * @private + * @name set + * @memberOf MapCache + * @param {string} key The key of the value to set. + * @param {*} value The value to set. + * @returns {Object} Returns the map cache instance. + */ +function mapCacheSet(key, value) { + var data = getMapData(this, key), + size = data.size; + + data.set(key, value); + this.size += data.size == size ? 0 : 1; + return this; +} + +// Add methods to `MapCache`. +MapCache.prototype.clear = mapCacheClear; +MapCache.prototype['delete'] = mapCacheDelete; +MapCache.prototype.get = mapCacheGet; +MapCache.prototype.has = mapCacheHas; +MapCache.prototype.set = mapCacheSet; + +/** + * + * Creates an array cache object to store unique values. + * + * @private + * @constructor + * @param {Array} [values] The values to cache. + */ +function SetCache(values) { + var index = -1, + length = values == null ? 0 : values.length; + + this.__data__ = new MapCache; + while (++index < length) { + this.add(values[index]); + } +} + +/** + * Adds `value` to the array cache. + * + * @private + * @name add + * @memberOf SetCache + * @alias push + * @param {*} value The value to cache. + * @returns {Object} Returns the cache instance. + */ +function setCacheAdd(value) { + this.__data__.set(value, HASH_UNDEFINED); + return this; +} + +/** + * Checks if `value` is in the array cache. + * + * @private + * @name has + * @memberOf SetCache + * @param {*} value The value to search for. + * @returns {number} Returns `true` if `value` is found, else `false`. + */ +function setCacheHas(value) { + return this.__data__.has(value); +} + +// Add methods to `SetCache`. +SetCache.prototype.add = SetCache.prototype.push = setCacheAdd; +SetCache.prototype.has = setCacheHas; + +/** + * Creates a stack cache object to store key-value pairs. + * + * @private + * @constructor + * @param {Array} [entries] The key-value pairs to cache. + */ +function Stack(entries) { + var data = this.__data__ = new ListCache(entries); + this.size = data.size; +} + +/** + * Removes all key-value entries from the stack. + * + * @private + * @name clear + * @memberOf Stack + */ +function stackClear() { + this.__data__ = new ListCache; + this.size = 0; +} + +/** + * Removes `key` and its value from the stack. + * + * @private + * @name delete + * @memberOf Stack + * @param {string} key The key of the value to remove. + * @returns {boolean} Returns `true` if the entry was removed, else `false`. + */ +function stackDelete(key) { + var data = this.__data__, + result = data['delete'](key); + + this.size = data.size; + return result; +} + +/** + * Gets the stack value for `key`. + * + * @private + * @name get + * @memberOf Stack + * @param {string} key The key of the value to get. + * @returns {*} Returns the entry value. + */ +function stackGet(key) { + return this.__data__.get(key); +} + +/** + * Checks if a stack value for `key` exists. + * + * @private + * @name has + * @memberOf Stack + * @param {string} key The key of the entry to check. + * @returns {boolean} Returns `true` if an entry for `key` exists, else `false`. + */ +function stackHas(key) { + return this.__data__.has(key); +} + +/** + * Sets the stack `key` to `value`. + * + * @private + * @name set + * @memberOf Stack + * @param {string} key The key of the value to set. + * @param {*} value The value to set. + * @returns {Object} Returns the stack cache instance. + */ +function stackSet(key, value) { + var data = this.__data__; + if (data instanceof ListCache) { + var pairs = data.__data__; + if (!Map || (pairs.length < LARGE_ARRAY_SIZE - 1)) { + pairs.push([key, value]); + this.size = ++data.size; + return this; + } + data = this.__data__ = new MapCache(pairs); + } + data.set(key, value); + this.size = data.size; + return this; +} + +// Add methods to `Stack`. +Stack.prototype.clear = stackClear; +Stack.prototype['delete'] = stackDelete; +Stack.prototype.get = stackGet; +Stack.prototype.has = stackHas; +Stack.prototype.set = stackSet; + +/** + * Creates an array of the enumerable property names of the array-like `value`. + * + * @private + * @param {*} value The value to query. + * @param {boolean} inherited Specify returning inherited property names. + * @returns {Array} Returns the array of property names. + */ +function arrayLikeKeys(value, inherited) { + var isArr = isArray(value), + isArg = !isArr && isArguments(value), + isBuff = !isArr && !isArg && isBuffer(value), + isType = !isArr && !isArg && !isBuff && isTypedArray(value), + skipIndexes = isArr || isArg || isBuff || isType, + result = skipIndexes ? baseTimes(value.length, String) : [], + length = result.length; + + for (var key in value) { + if ((inherited || hasOwnProperty.call(value, key)) && + !(skipIndexes && ( + // Safari 9 has enumerable `arguments.length` in strict mode. + key == 'length' || + // Node.js 0.10 has enumerable non-index properties on buffers. + (isBuff && (key == 'offset' || key == 'parent')) || + // PhantomJS 2 has enumerable non-index properties on typed arrays. + (isType && (key == 'buffer' || key == 'byteLength' || key == 'byteOffset')) || + // Skip index properties. + isIndex(key, length) + ))) { + result.push(key); + } + } + return result; +} + +/** + * Gets the index at which the `key` is found in `array` of key-value pairs. + * + * @private + * @param {Array} array The array to inspect. + * @param {*} key The key to search for. + * @returns {number} Returns the index of the matched value, else `-1`. + */ +function assocIndexOf(array, key) { + var length = array.length; + while (length--) { + if (eq(array[length][0], key)) { + return length; + } + } + return -1; +} + +/** + * The base implementation of `getAllKeys` and `getAllKeysIn` which uses + * `keysFunc` and `symbolsFunc` to get the enumerable property names and + * symbols of `object`. + * + * @private + * @param {Object} object The object to query. + * @param {Function} keysFunc The function to get the keys of `object`. + * @param {Function} symbolsFunc The function to get the symbols of `object`. + * @returns {Array} Returns the array of property names and symbols. + */ +function baseGetAllKeys(object, keysFunc, symbolsFunc) { + var result = keysFunc(object); + return isArray(object) ? result : arrayPush(result, symbolsFunc(object)); +} + +/** + * The base implementation of `getTag` without fallbacks for buggy environments. + * + * @private + * @param {*} value The value to query. + * @returns {string} Returns the `toStringTag`. + */ +function baseGetTag(value) { + if (value == null) { + return value === undefined ? undefinedTag : nullTag; + } + return (symToStringTag && symToStringTag in Object(value)) + ? getRawTag(value) + : objectToString(value); +} + +/** + * The base implementation of `_.isArguments`. + * + * @private + * @param {*} value The value to check. + * @returns {boolean} Returns `true` if `value` is an `arguments` object, + */ +function baseIsArguments(value) { + return isObjectLike(value) && baseGetTag(value) == argsTag; +} + +/** + * The base implementation of `_.isEqual` which supports partial comparisons + * and tracks traversed objects. + * + * @private + * @param {*} value The value to compare. + * @param {*} other The other value to compare. + * @param {boolean} bitmask The bitmask flags. + * 1 - Unordered comparison + * 2 - Partial comparison + * @param {Function} [customizer] The function to customize comparisons. + * @param {Object} [stack] Tracks traversed `value` and `other` objects. + * @returns {boolean} Returns `true` if the values are equivalent, else `false`. + */ +function baseIsEqual(value, other, bitmask, customizer, stack) { + if (value === other) { + return true; + } + if (value == null || other == null || (!isObjectLike(value) && !isObjectLike(other))) { + return value !== value && other !== other; + } + return baseIsEqualDeep(value, other, bitmask, customizer, baseIsEqual, stack); +} + +/** + * A specialized version of `baseIsEqual` for arrays and objects which performs + * deep comparisons and tracks traversed objects enabling objects with circular + * references to be compared. + * + * @private + * @param {Object} object The object to compare. + * @param {Object} other The other object to compare. + * @param {number} bitmask The bitmask flags. See `baseIsEqual` for more details. + * @param {Function} customizer The function to customize comparisons. + * @param {Function} equalFunc The function to determine equivalents of values. + * @param {Object} [stack] Tracks traversed `object` and `other` objects. + * @returns {boolean} Returns `true` if the objects are equivalent, else `false`. + */ +function baseIsEqualDeep(object, other, bitmask, customizer, equalFunc, stack) { + var objIsArr = isArray(object), + othIsArr = isArray(other), + objTag = objIsArr ? arrayTag : getTag(object), + othTag = othIsArr ? arrayTag : getTag(other); + + objTag = objTag == argsTag ? objectTag : objTag; + othTag = othTag == argsTag ? objectTag : othTag; + + var objIsObj = objTag == objectTag, + othIsObj = othTag == objectTag, + isSameTag = objTag == othTag; + + if (isSameTag && isBuffer(object)) { + if (!isBuffer(other)) { + return false; + } + objIsArr = true; + objIsObj = false; + } + if (isSameTag && !objIsObj) { + stack || (stack = new Stack); + return (objIsArr || isTypedArray(object)) + ? equalArrays(object, other, bitmask, customizer, equalFunc, stack) + : equalByTag(object, other, objTag, bitmask, customizer, equalFunc, stack); + } + if (!(bitmask & COMPARE_PARTIAL_FLAG)) { + var objIsWrapped = objIsObj && hasOwnProperty.call(object, '__wrapped__'), + othIsWrapped = othIsObj && hasOwnProperty.call(other, '__wrapped__'); + + if (objIsWrapped || othIsWrapped) { + var objUnwrapped = objIsWrapped ? object.value() : object, + othUnwrapped = othIsWrapped ? other.value() : other; + + stack || (stack = new Stack); + return equalFunc(objUnwrapped, othUnwrapped, bitmask, customizer, stack); + } + } + if (!isSameTag) { + return false; + } + stack || (stack = new Stack); + return equalObjects(object, other, bitmask, customizer, equalFunc, stack); +} + +/** + * The base implementation of `_.isNative` without bad shim checks. + * + * @private + * @param {*} value The value to check. + * @returns {boolean} Returns `true` if `value` is a native function, + * else `false`. + */ +function baseIsNative(value) { + if (!isObject(value) || isMasked(value)) { + return false; + } + var pattern = isFunction(value) ? reIsNative : reIsHostCtor; + return pattern.test(toSource(value)); +} + +/** + * The base implementation of `_.isTypedArray` without Node.js optimizations. + * + * @private + * @param {*} value The value to check. + * @returns {boolean} Returns `true` if `value` is a typed array, else `false`. + */ +function baseIsTypedArray(value) { + return isObjectLike(value) && + isLength(value.length) && !!typedArrayTags[baseGetTag(value)]; +} + +/** + * The base implementation of `_.keys` which doesn't treat sparse arrays as dense. + * + * @private + * @param {Object} object The object to query. + * @returns {Array} Returns the array of property names. + */ +function baseKeys(object) { + if (!isPrototype(object)) { + return nativeKeys(object); + } + var result = []; + for (var key in Object(object)) { + if (hasOwnProperty.call(object, key) && key != 'constructor') { + result.push(key); + } + } + return result; +} + +/** + * A specialized version of `baseIsEqualDeep` for arrays with support for + * partial deep comparisons. + * + * @private + * @param {Array} array The array to compare. + * @param {Array} other The other array to compare. + * @param {number} bitmask The bitmask flags. See `baseIsEqual` for more details. + * @param {Function} customizer The function to customize comparisons. + * @param {Function} equalFunc The function to determine equivalents of values. + * @param {Object} stack Tracks traversed `array` and `other` objects. + * @returns {boolean} Returns `true` if the arrays are equivalent, else `false`. + */ +function equalArrays(array, other, bitmask, customizer, equalFunc, stack) { + var isPartial = bitmask & COMPARE_PARTIAL_FLAG, + arrLength = array.length, + othLength = other.length; + + if (arrLength != othLength && !(isPartial && othLength > arrLength)) { + return false; + } + // Assume cyclic values are equal. + var stacked = stack.get(array); + if (stacked && stack.get(other)) { + return stacked == other; + } + var index = -1, + result = true, + seen = (bitmask & COMPARE_UNORDERED_FLAG) ? new SetCache : undefined; + + stack.set(array, other); + stack.set(other, array); + + // Ignore non-index properties. + while (++index < arrLength) { + var arrValue = array[index], + othValue = other[index]; + + if (customizer) { + var compared = isPartial + ? customizer(othValue, arrValue, index, other, array, stack) + : customizer(arrValue, othValue, index, array, other, stack); + } + if (compared !== undefined) { + if (compared) { + continue; + } + result = false; + break; + } + // Recursively compare arrays (susceptible to call stack limits). + if (seen) { + if (!arraySome(other, function(othValue, othIndex) { + if (!cacheHas(seen, othIndex) && + (arrValue === othValue || equalFunc(arrValue, othValue, bitmask, customizer, stack))) { + return seen.push(othIndex); + } + })) { + result = false; + break; + } + } else if (!( + arrValue === othValue || + equalFunc(arrValue, othValue, bitmask, customizer, stack) + )) { + result = false; + break; + } + } + stack['delete'](array); + stack['delete'](other); + return result; +} + +/** + * A specialized version of `baseIsEqualDeep` for comparing objects of + * the same `toStringTag`. + * + * **Note:** This function only supports comparing values with tags of + * `Boolean`, `Date`, `Error`, `Number`, `RegExp`, or `String`. + * + * @private + * @param {Object} object The object to compare. + * @param {Object} other The other object to compare. + * @param {string} tag The `toStringTag` of the objects to compare. + * @param {number} bitmask The bitmask flags. See `baseIsEqual` for more details. + * @param {Function} customizer The function to customize comparisons. + * @param {Function} equalFunc The function to determine equivalents of values. + * @param {Object} stack Tracks traversed `object` and `other` objects. + * @returns {boolean} Returns `true` if the objects are equivalent, else `false`. + */ +function equalByTag(object, other, tag, bitmask, customizer, equalFunc, stack) { + switch (tag) { + case dataViewTag: + if ((object.byteLength != other.byteLength) || + (object.byteOffset != other.byteOffset)) { + return false; + } + object = object.buffer; + other = other.buffer; + + case arrayBufferTag: + if ((object.byteLength != other.byteLength) || + !equalFunc(new Uint8Array(object), new Uint8Array(other))) { + return false; + } + return true; + + case boolTag: + case dateTag: + case numberTag: + // Coerce booleans to `1` or `0` and dates to milliseconds. + // Invalid dates are coerced to `NaN`. + return eq(+object, +other); + + case errorTag: + return object.name == other.name && object.message == other.message; + + case regexpTag: + case stringTag: + // Coerce regexes to strings and treat strings, primitives and objects, + // as equal. See http://www.ecma-international.org/ecma-262/7.0/#sec-regexp.prototype.tostring + // for more details. + return object == (other + ''); + + case mapTag: + var convert = mapToArray; + + case setTag: + var isPartial = bitmask & COMPARE_PARTIAL_FLAG; + convert || (convert = setToArray); + + if (object.size != other.size && !isPartial) { + return false; + } + // Assume cyclic values are equal. + var stacked = stack.get(object); + if (stacked) { + return stacked == other; + } + bitmask |= COMPARE_UNORDERED_FLAG; + + // Recursively compare objects (susceptible to call stack limits). + stack.set(object, other); + var result = equalArrays(convert(object), convert(other), bitmask, customizer, equalFunc, stack); + stack['delete'](object); + return result; + + case symbolTag: + if (symbolValueOf) { + return symbolValueOf.call(object) == symbolValueOf.call(other); + } + } + return false; +} + +/** + * A specialized version of `baseIsEqualDeep` for objects with support for + * partial deep comparisons. + * + * @private + * @param {Object} object The object to compare. + * @param {Object} other The other object to compare. + * @param {number} bitmask The bitmask flags. See `baseIsEqual` for more details. + * @param {Function} customizer The function to customize comparisons. + * @param {Function} equalFunc The function to determine equivalents of values. + * @param {Object} stack Tracks traversed `object` and `other` objects. + * @returns {boolean} Returns `true` if the objects are equivalent, else `false`. + */ +function equalObjects(object, other, bitmask, customizer, equalFunc, stack) { + var isPartial = bitmask & COMPARE_PARTIAL_FLAG, + objProps = getAllKeys(object), + objLength = objProps.length, + othProps = getAllKeys(other), + othLength = othProps.length; + + if (objLength != othLength && !isPartial) { + return false; + } + var index = objLength; + while (index--) { + var key = objProps[index]; + if (!(isPartial ? key in other : hasOwnProperty.call(other, key))) { + return false; + } + } + // Assume cyclic values are equal. + var stacked = stack.get(object); + if (stacked && stack.get(other)) { + return stacked == other; + } + var result = true; + stack.set(object, other); + stack.set(other, object); + + var skipCtor = isPartial; + while (++index < objLength) { + key = objProps[index]; + var objValue = object[key], + othValue = other[key]; + + if (customizer) { + var compared = isPartial + ? customizer(othValue, objValue, key, other, object, stack) + : customizer(objValue, othValue, key, object, other, stack); + } + // Recursively compare objects (susceptible to call stack limits). + if (!(compared === undefined + ? (objValue === othValue || equalFunc(objValue, othValue, bitmask, customizer, stack)) + : compared + )) { + result = false; + break; + } + skipCtor || (skipCtor = key == 'constructor'); + } + if (result && !skipCtor) { + var objCtor = object.constructor, + othCtor = other.constructor; + + // Non `Object` object instances with different constructors are not equal. + if (objCtor != othCtor && + ('constructor' in object && 'constructor' in other) && + !(typeof objCtor == 'function' && objCtor instanceof objCtor && + typeof othCtor == 'function' && othCtor instanceof othCtor)) { + result = false; + } + } + stack['delete'](object); + stack['delete'](other); + return result; +} + +/** + * Creates an array of own enumerable property names and symbols of `object`. + * + * @private + * @param {Object} object The object to query. + * @returns {Array} Returns the array of property names and symbols. + */ +function getAllKeys(object) { + return baseGetAllKeys(object, keys, getSymbols); +} + +/** + * Gets the data for `map`. + * + * @private + * @param {Object} map The map to query. + * @param {string} key The reference key. + * @returns {*} Returns the map data. + */ +function getMapData(map, key) { + var data = map.__data__; + return isKeyable(key) + ? data[typeof key == 'string' ? 'string' : 'hash'] + : data.map; +} + +/** + * Gets the native function at `key` of `object`. + * + * @private + * @param {Object} object The object to query. + * @param {string} key The key of the method to get. + * @returns {*} Returns the function if it's native, else `undefined`. + */ +function getNative(object, key) { + var value = getValue(object, key); + return baseIsNative(value) ? value : undefined; +} + +/** + * A specialized version of `baseGetTag` which ignores `Symbol.toStringTag` values. + * + * @private + * @param {*} value The value to query. + * @returns {string} Returns the raw `toStringTag`. + */ +function getRawTag(value) { + var isOwn = hasOwnProperty.call(value, symToStringTag), + tag = value[symToStringTag]; + + try { + value[symToStringTag] = undefined; + var unmasked = true; + } catch (e) {} + + var result = nativeObjectToString.call(value); + if (unmasked) { + if (isOwn) { + value[symToStringTag] = tag; + } else { + delete value[symToStringTag]; + } + } + return result; +} + +/** + * Creates an array of the own enumerable symbols of `object`. + * + * @private + * @param {Object} object The object to query. + * @returns {Array} Returns the array of symbols. + */ +var getSymbols = !nativeGetSymbols ? stubArray : function(object) { + if (object == null) { + return []; + } + object = Object(object); + return arrayFilter(nativeGetSymbols(object), function(symbol) { + return propertyIsEnumerable.call(object, symbol); + }); +}; + +/** + * Gets the `toStringTag` of `value`. + * + * @private + * @param {*} value The value to query. + * @returns {string} Returns the `toStringTag`. + */ +var getTag = baseGetTag; + +// Fallback for data views, maps, sets, and weak maps in IE 11 and promises in Node.js < 6. +if ((DataView && getTag(new DataView(new ArrayBuffer(1))) != dataViewTag) || + (Map && getTag(new Map) != mapTag) || + (Promise && getTag(Promise.resolve()) != promiseTag) || + (Set && getTag(new Set) != setTag) || + (WeakMap && getTag(new WeakMap) != weakMapTag)) { + getTag = function(value) { + var result = baseGetTag(value), + Ctor = result == objectTag ? value.constructor : undefined, + ctorString = Ctor ? toSource(Ctor) : ''; + + if (ctorString) { + switch (ctorString) { + case dataViewCtorString: return dataViewTag; + case mapCtorString: return mapTag; + case promiseCtorString: return promiseTag; + case setCtorString: return setTag; + case weakMapCtorString: return weakMapTag; + } + } + return result; + }; +} + +/** + * Checks if `value` is a valid array-like index. + * + * @private + * @param {*} value The value to check. + * @param {number} [length=MAX_SAFE_INTEGER] The upper bounds of a valid index. + * @returns {boolean} Returns `true` if `value` is a valid index, else `false`. + */ +function isIndex(value, length) { + length = length == null ? MAX_SAFE_INTEGER : length; + return !!length && + (typeof value == 'number' || reIsUint.test(value)) && + (value > -1 && value % 1 == 0 && value < length); +} + +/** + * Checks if `value` is suitable for use as unique object key. + * + * @private + * @param {*} value The value to check. + * @returns {boolean} Returns `true` if `value` is suitable, else `false`. + */ +function isKeyable(value) { + var type = typeof value; + return (type == 'string' || type == 'number' || type == 'symbol' || type == 'boolean') + ? (value !== '__proto__') + : (value === null); +} + +/** + * Checks if `func` has its source masked. + * + * @private + * @param {Function} func The function to check. + * @returns {boolean} Returns `true` if `func` is masked, else `false`. + */ +function isMasked(func) { + return !!maskSrcKey && (maskSrcKey in func); +} + +/** + * Checks if `value` is likely a prototype object. + * + * @private + * @param {*} value The value to check. + * @returns {boolean} Returns `true` if `value` is a prototype, else `false`. + */ +function isPrototype(value) { + var Ctor = value && value.constructor, + proto = (typeof Ctor == 'function' && Ctor.prototype) || objectProto; + + return value === proto; +} + +/** + * Converts `value` to a string using `Object.prototype.toString`. + * + * @private + * @param {*} value The value to convert. + * @returns {string} Returns the converted string. + */ +function objectToString(value) { + return nativeObjectToString.call(value); +} + +/** + * Converts `func` to its source code. + * + * @private + * @param {Function} func The function to convert. + * @returns {string} Returns the source code. + */ +function toSource(func) { + if (func != null) { + try { + return funcToString.call(func); + } catch (e) {} + try { + return (func + ''); + } catch (e) {} + } + return ''; +} + +/** + * Performs a + * [`SameValueZero`](http://ecma-international.org/ecma-262/7.0/#sec-samevaluezero) + * comparison between two values to determine if they are equivalent. + * + * @static + * @memberOf _ + * @since 4.0.0 + * @category Lang + * @param {*} value The value to compare. + * @param {*} other The other value to compare. + * @returns {boolean} Returns `true` if the values are equivalent, else `false`. + * @example + * + * var object = { 'a': 1 }; + * var other = { 'a': 1 }; + * + * _.eq(object, object); + * // => true + * + * _.eq(object, other); + * // => false + * + * _.eq('a', 'a'); + * // => true + * + * _.eq('a', Object('a')); + * // => false + * + * _.eq(NaN, NaN); + * // => true + */ +function eq(value, other) { + return value === other || (value !== value && other !== other); +} + +/** + * Checks if `value` is likely an `arguments` object. + * + * @static + * @memberOf _ + * @since 0.1.0 + * @category Lang + * @param {*} value The value to check. + * @returns {boolean} Returns `true` if `value` is an `arguments` object, + * else `false`. + * @example + * + * _.isArguments(function() { return arguments; }()); + * // => true + * + * _.isArguments([1, 2, 3]); + * // => false + */ +var isArguments = baseIsArguments(function() { return arguments; }()) ? baseIsArguments : function(value) { + return isObjectLike(value) && hasOwnProperty.call(value, 'callee') && + !propertyIsEnumerable.call(value, 'callee'); +}; + +/** + * Checks if `value` is classified as an `Array` object. + * + * @static + * @memberOf _ + * @since 0.1.0 + * @category Lang + * @param {*} value The value to check. + * @returns {boolean} Returns `true` if `value` is an array, else `false`. + * @example + * + * _.isArray([1, 2, 3]); + * // => true + * + * _.isArray(document.body.children); + * // => false + * + * _.isArray('abc'); + * // => false + * + * _.isArray(_.noop); + * // => false + */ +var isArray = Array.isArray; + +/** + * Checks if `value` is array-like. A value is considered array-like if it's + * not a function and has a `value.length` that's an integer greater than or + * equal to `0` and less than or equal to `Number.MAX_SAFE_INTEGER`. + * + * @static + * @memberOf _ + * @since 4.0.0 + * @category Lang + * @param {*} value The value to check. + * @returns {boolean} Returns `true` if `value` is array-like, else `false`. + * @example + * + * _.isArrayLike([1, 2, 3]); + * // => true + * + * _.isArrayLike(document.body.children); + * // => true + * + * _.isArrayLike('abc'); + * // => true + * + * _.isArrayLike(_.noop); + * // => false + */ +function isArrayLike(value) { + return value != null && isLength(value.length) && !isFunction(value); +} + +/** + * Checks if `value` is a buffer. + * + * @static + * @memberOf _ + * @since 4.3.0 + * @category Lang + * @param {*} value The value to check. + * @returns {boolean} Returns `true` if `value` is a buffer, else `false`. + * @example + * + * _.isBuffer(new Buffer(2)); + * // => true + * + * _.isBuffer(new Uint8Array(2)); + * // => false + */ +var isBuffer = nativeIsBuffer || stubFalse; + +/** + * Performs a deep comparison between two values to determine if they are + * equivalent. + * + * **Note:** This method supports comparing arrays, array buffers, booleans, + * date objects, error objects, maps, numbers, `Object` objects, regexes, + * sets, strings, symbols, and typed arrays. `Object` objects are compared + * by their own, not inherited, enumerable properties. Functions and DOM + * nodes are compared by strict equality, i.e. `===`. + * + * @static + * @memberOf _ + * @since 0.1.0 + * @category Lang + * @param {*} value The value to compare. + * @param {*} other The other value to compare. + * @returns {boolean} Returns `true` if the values are equivalent, else `false`. + * @example + * + * var object = { 'a': 1 }; + * var other = { 'a': 1 }; + * + * _.isEqual(object, other); + * // => true + * + * object === other; + * // => false + */ +function isEqual(value, other) { + return baseIsEqual(value, other); +} + +/** + * Checks if `value` is classified as a `Function` object. + * + * @static + * @memberOf _ + * @since 0.1.0 + * @category Lang + * @param {*} value The value to check. + * @returns {boolean} Returns `true` if `value` is a function, else `false`. + * @example + * + * _.isFunction(_); + * // => true + * + * _.isFunction(/abc/); + * // => false + */ +function isFunction(value) { + if (!isObject(value)) { + return false; + } + // The use of `Object#toString` avoids issues with the `typeof` operator + // in Safari 9 which returns 'object' for typed arrays and other constructors. + var tag = baseGetTag(value); + return tag == funcTag || tag == genTag || tag == asyncTag || tag == proxyTag; +} + +/** + * Checks if `value` is a valid array-like length. + * + * **Note:** This method is loosely based on + * [`ToLength`](http://ecma-international.org/ecma-262/7.0/#sec-tolength). + * + * @static + * @memberOf _ + * @since 4.0.0 + * @category Lang + * @param {*} value The value to check. + * @returns {boolean} Returns `true` if `value` is a valid length, else `false`. + * @example + * + * _.isLength(3); + * // => true + * + * _.isLength(Number.MIN_VALUE); + * // => false + * + * _.isLength(Infinity); + * // => false + * + * _.isLength('3'); + * // => false + */ +function isLength(value) { + return typeof value == 'number' && + value > -1 && value % 1 == 0 && value <= MAX_SAFE_INTEGER; +} + +/** + * Checks if `value` is the + * [language type](http://www.ecma-international.org/ecma-262/7.0/#sec-ecmascript-language-types) + * of `Object`. (e.g. arrays, functions, objects, regexes, `new Number(0)`, and `new String('')`) + * + * @static + * @memberOf _ + * @since 0.1.0 + * @category Lang + * @param {*} value The value to check. + * @returns {boolean} Returns `true` if `value` is an object, else `false`. + * @example + * + * _.isObject({}); + * // => true + * + * _.isObject([1, 2, 3]); + * // => true + * + * _.isObject(_.noop); + * // => true + * + * _.isObject(null); + * // => false + */ +function isObject(value) { + var type = typeof value; + return value != null && (type == 'object' || type == 'function'); +} + +/** + * Checks if `value` is object-like. A value is object-like if it's not `null` + * and has a `typeof` result of "object". + * + * @static + * @memberOf _ + * @since 4.0.0 + * @category Lang + * @param {*} value The value to check. + * @returns {boolean} Returns `true` if `value` is object-like, else `false`. + * @example + * + * _.isObjectLike({}); + * // => true + * + * _.isObjectLike([1, 2, 3]); + * // => true + * + * _.isObjectLike(_.noop); + * // => false + * + * _.isObjectLike(null); + * // => false + */ +function isObjectLike(value) { + return value != null && typeof value == 'object'; +} + +/** + * Checks if `value` is classified as a typed array. + * + * @static + * @memberOf _ + * @since 3.0.0 + * @category Lang + * @param {*} value The value to check. + * @returns {boolean} Returns `true` if `value` is a typed array, else `false`. + * @example + * + * _.isTypedArray(new Uint8Array); + * // => true + * + * _.isTypedArray([]); + * // => false + */ +var isTypedArray = nodeIsTypedArray ? baseUnary(nodeIsTypedArray) : baseIsTypedArray; + +/** + * Creates an array of the own enumerable property names of `object`. + * + * **Note:** Non-object values are coerced to objects. See the + * [ES spec](http://ecma-international.org/ecma-262/7.0/#sec-object.keys) + * for more details. + * + * @static + * @since 0.1.0 + * @memberOf _ + * @category Object + * @param {Object} object The object to query. + * @returns {Array} Returns the array of property names. + * @example + * + * function Foo() { + * this.a = 1; + * this.b = 2; + * } + * + * Foo.prototype.c = 3; + * + * _.keys(new Foo); + * // => ['a', 'b'] (iteration order is not guaranteed) + * + * _.keys('hi'); + * // => ['0', '1'] + */ +function keys(object) { + return isArrayLike(object) ? arrayLikeKeys(object) : baseKeys(object); +} + +/** + * This method returns a new empty array. + * + * @static + * @memberOf _ + * @since 4.13.0 + * @category Util + * @returns {Array} Returns the new empty array. + * @example + * + * var arrays = _.times(2, _.stubArray); + * + * console.log(arrays); + * // => [[], []] + * + * console.log(arrays[0] === arrays[1]); + * // => false + */ +function stubArray() { + return []; +} + +/** + * This method returns `false`. + * + * @static + * @memberOf _ + * @since 4.13.0 + * @category Util + * @returns {boolean} Returns `false`. + * @example + * + * _.times(2, _.stubFalse); + * // => [false, false] + */ +function stubFalse() { + return false; +} + +module.exports = isEqual; +}); + +var baseMerged = createCommonjsModule(function (module, exports) { +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); + + + + + + +class BaseMergedExtractor { + constructor(config, options) { + this.config = config; + this.options = options; + } + extract(source, refDate) { + if (!refDate) + refDate = new Date(); + let referenceDate = refDate; + let result = new Array(); + this.addTo(result, this.config.dateExtractor.extract(source, referenceDate), source); + this.addTo(result, this.config.timeExtractor.extract(source, referenceDate), source); + this.addTo(result, this.config.durationExtractor.extract(source, referenceDate), source); + this.addTo(result, this.config.datePeriodExtractor.extract(source, referenceDate), source); + this.addTo(result, this.config.dateTimeExtractor.extract(source, referenceDate), source); + this.addTo(result, this.config.timePeriodExtractor.extract(source, referenceDate), source); + this.addTo(result, this.config.dateTimePeriodExtractor.extract(source, referenceDate), source); + this.addTo(result, this.config.setExtractor.extract(source, referenceDate), source); + this.addTo(result, this.config.holidayExtractor.extract(source, referenceDate), source); + // this should be at the end since if need the extractor to determine the previous text contains time or not + this.addTo(result, this.numberEndingRegexMatch(source, result), source); + this.addMod(result, source); + // filtering + if ((this.options & dateTimeRecognizer.DateTimeOptions.Calendar) !== 0) { + this.checkCalendarFilterList(result, source); + } + result = result.sort((a, b) => a.start - b.start); + return result; + } + checkCalendarFilterList(ers, text) { + for (let er of ers.reverse()) { + for (let negRegex of this.config.filterWordRegexList) { + let match = recognizersTextNumber.RegExpUtility.getMatches(negRegex, er.text).pop(); + if (match) { + ers.splice(ers.indexOf(er)); + } + } + } + } + // handle cases like "move 3pm appointment to 4" + numberEndingRegexMatch(text, extractResults) { + let tokens = new Array(); + extractResults.forEach(extractResult => { + if (extractResult.type === constants$2.Constants.SYS_DATETIME_TIME + || extractResult.type === constants$2.Constants.SYS_DATETIME_DATETIME) { + let stringAfter = text.substring(extractResult.start + extractResult.length); + let match = recognizersTextNumber.RegExpUtility.getMatches(this.config.numberEndingPattern, stringAfter); + if (match != null && match.length) { + let newTime = match[0].groups("newTime"); + let numRes = this.config.integerExtractor.extract(newTime.value); + if (numRes.length === 0) { + return; + } + let startPosition = extractResult.start + extractResult.length + newTime.index; + tokens.push(new utilities$2.Token(startPosition, startPosition + newTime.length)); + } + } + }); + return utilities$2.Token.mergeAllTokens(tokens, text, constants$2.Constants.SYS_DATETIME_TIME); + } + addTo(destination, source, text) { + source.forEach(value => { + if (this.options === dateTimeRecognizer.DateTimeOptions.SkipFromToMerge && this.shouldSkipFromMerge(value)) + return; + let isFound = false; + let overlapIndexes = new Array(); + let firstIndex = -1; + destination.forEach((dest, index) => { + if (recognizersText.ExtractResult.isOverlap(dest, value)) { + isFound = true; + if (recognizersText.ExtractResult.isCover(dest, value)) { + if (firstIndex === -1) { + firstIndex = index; + } + overlapIndexes.push(index); + } + else { + return; + } + } + }); + if (!isFound) { + destination.push(value); + } + else if (overlapIndexes.length) { + let tempDst = new Array(); + for (let i = 0; i < destination.length; i++) { + if (overlapIndexes.indexOf(i) === -1) { + tempDst.push(destination[i]); + } + } + // insert at the first overlap occurrence to keep the order + tempDst.splice(firstIndex, 0, value); + destination.length = 0; + destination.push.apply(destination, tempDst); + } + }); + } + shouldSkipFromMerge(er) { + return recognizersTextNumber.RegExpUtility.getMatches(this.config.fromToRegex, er.text).length > 0; + } + filterAmbiguousSingleWord(er, text) { + let matches = recognizersTextNumber.RegExpUtility.getMatches(this.config.singleAmbiguousMonthRegex, er.text.toLowerCase()); + if (matches.length) { + let stringBefore = text.substring(0, er.start).replace(/\s+$/, ''); + matches = recognizersTextNumber.RegExpUtility.getMatches(this.config.prepositionSuffixRegex, stringBefore); + if (!matches.length) { + return true; + } + } + return false; + } + addMod(ers, source) { + let lastEnd = 0; + ers.forEach(er => { + let beforeStr = source.substr(lastEnd, er.start).toLowerCase(); + let before = this.hasTokenIndex(beforeStr.trim(), this.config.beforeRegex); + if (before.matched) { + let modLength = beforeStr.length - before.index; + er.length += modLength; + er.start -= modLength; + er.text = source.substr(er.start, er.length); + } + let after = this.hasTokenIndex(beforeStr.trim(), this.config.afterRegex); + if (after.matched) { + let modLength = beforeStr.length - after.index; + er.length += modLength; + er.start -= modLength; + er.text = source.substr(er.start, er.length); + } + let since = this.hasTokenIndex(beforeStr.trim(), this.config.sinceRegex); + if (since.matched) { + let modLength = beforeStr.length - since.index; + er.length += modLength; + er.start -= modLength; + er.text = source.substr(er.start, er.length); + } + }); + } + hasTokenIndex(source, regex) { + let result = { matched: false, index: -1 }; + let match = recognizersTextNumber.RegExpUtility.getMatches(regex, source).pop(); + if (match) { + result.matched = true; + result.index = match.index; + } + return result; + } +} +exports.BaseMergedExtractor = BaseMergedExtractor; +class BaseMergedParser { + constructor(config, options) { + this.parserTypeName = 'datetimeV2'; + this.dateMinValue = utilities$2.FormatUtil.formatDate(utilities$2.DateUtils.minValue()); + this.dateTimeMinValue = utilities$2.FormatUtil.formatDateTime(utilities$2.DateUtils.minValue()); + this.config = config; + this.options = options; + } + parse(er, refTime) { + let referenceTime = refTime || new Date(); + let pr = null; + // push, save teh MOD string + let hasBefore = false; + let hasAfter = false; + let hasSince = false; + let modStr = ""; + let beforeMatch = recognizersTextNumber.RegExpUtility.getMatches(this.config.beforeRegex, er.text).shift(); + let afterMatch = recognizersTextNumber.RegExpUtility.getMatches(this.config.afterRegex, er.text).shift(); + let sinceMatch = recognizersTextNumber.RegExpUtility.getMatches(this.config.sinceRegex, er.text).shift(); + if (beforeMatch && beforeMatch.index === 0) { + hasBefore = true; + er.start += beforeMatch.length; + er.length -= beforeMatch.length; + er.text = er.text.substring(beforeMatch.length); + modStr = beforeMatch.value; + } + else if (afterMatch && afterMatch.index === 0) { + hasAfter = true; + er.start += afterMatch.length; + er.length -= afterMatch.length; + er.text = er.text.substring(afterMatch.length); + modStr = afterMatch.value; + } + else if (sinceMatch && sinceMatch.index === 0) { + hasSince = true; + er.start += sinceMatch.length; + er.length -= sinceMatch.length; + er.text = er.text.substring(sinceMatch.length); + modStr = sinceMatch.value; + } + if (er.type === constants$2.Constants.SYS_DATETIME_DATE) { + pr = this.config.dateParser.parse(er, referenceTime); + if (pr.value === null || pr.value === undefined) { + pr = this.config.holidayParser.parse(er, referenceTime); + } + } + else if (er.type === constants$2.Constants.SYS_DATETIME_TIME) { + pr = this.config.timeParser.parse(er, referenceTime); + } + else if (er.type === constants$2.Constants.SYS_DATETIME_DATETIME) { + pr = this.config.dateTimeParser.parse(er, referenceTime); + } + else if (er.type === constants$2.Constants.SYS_DATETIME_DATEPERIOD) { + pr = this.config.datePeriodParser.parse(er, referenceTime); + } + else if (er.type === constants$2.Constants.SYS_DATETIME_TIMEPERIOD) { + pr = this.config.timePeriodParser.parse(er, referenceTime); + } + else if (er.type === constants$2.Constants.SYS_DATETIME_DATETIMEPERIOD) { + pr = this.config.dateTimePeriodParser.parse(er, referenceTime); + } + else if (er.type === constants$2.Constants.SYS_DATETIME_DURATION) { + pr = this.config.durationParser.parse(er, referenceTime); + } + else if (er.type === constants$2.Constants.SYS_DATETIME_SET) { + pr = this.config.setParser.parse(er, referenceTime); + } + else { + return null; + } + // pop, restore the MOD string + if (hasBefore && pr.value !== null) { + pr.length += modStr.length; + pr.start -= modStr.length; + pr.text = modStr + pr.text; + let val = pr.value; + val.mod = constants$2.TimeTypeConstants.beforeMod; + pr.value = val; + } + if (hasAfter && pr.value !== null) { + pr.length += modStr.length; + pr.start -= modStr.length; + pr.text = modStr + pr.text; + let val = pr.value; + val.mod = constants$2.TimeTypeConstants.afterMod; + pr.value = val; + } + if (hasSince && pr.value !== null) { + pr.length += modStr.length; + pr.start -= modStr.length; + pr.text = modStr + pr.text; + let val = pr.value; + val.mod = constants$2.TimeTypeConstants.sinceMod; + pr.value = val; + } + if ((this.options & dateTimeRecognizer.DateTimeOptions.SplitDateAndTime) === dateTimeRecognizer.DateTimeOptions.SplitDateAndTime + && pr.value && pr.value.subDateTimeEntities != null) { + pr.value = this.dateTimeResolutionForSplit(pr); + } + else { + pr = this.setParseResult(pr, hasBefore, hasAfter, hasSince); + } + return pr; + } + setParseResult(slot, hasBefore, hasAfter, hasSince) { + slot.value = this.dateTimeResolution(slot, hasBefore, hasAfter, hasSince); + // change the type at last for the after or before mode + slot.type = `${this.parserTypeName}.${this.determineDateTimeType(slot.type, hasBefore, hasAfter, hasSince)}`; + return slot; + } + getParseResult(extractorResult, referenceDate) { + let extractorType = extractorResult.type; + if (extractorType === constants$2.Constants.SYS_DATETIME_DATE) { + let pr = this.config.dateParser.parse(extractorResult, referenceDate); + if (!pr || !pr.value) + return this.config.holidayParser.parse(extractorResult, referenceDate); + return pr; + } + if (extractorType === constants$2.Constants.SYS_DATETIME_TIME) { + return this.config.timeParser.parse(extractorResult, referenceDate); + } + if (extractorType === constants$2.Constants.SYS_DATETIME_DATETIME) { + return this.config.dateTimeParser.parse(extractorResult, referenceDate); + } + if (extractorType === constants$2.Constants.SYS_DATETIME_DATEPERIOD) { + return this.config.datePeriodParser.parse(extractorResult, referenceDate); + } + if (extractorType === constants$2.Constants.SYS_DATETIME_TIMEPERIOD) { + return this.config.timePeriodParser.parse(extractorResult, referenceDate); + } + if (extractorType === constants$2.Constants.SYS_DATETIME_DATETIMEPERIOD) { + return this.config.dateTimePeriodParser.parse(extractorResult, referenceDate); + } + if (extractorType === constants$2.Constants.SYS_DATETIME_DURATION) { + return this.config.durationParser.parse(extractorResult, referenceDate); + } + if (extractorType === constants$2.Constants.SYS_DATETIME_SET) { + return this.config.setParser.parse(extractorResult, referenceDate); + } + return null; + } + determineDateTimeType(type, hasBefore, hasAfter, hasSince) { + if ((this.options & dateTimeRecognizer.DateTimeOptions.SplitDateAndTime) === dateTimeRecognizer.DateTimeOptions.SplitDateAndTime) { + if (type === constants$2.Constants.SYS_DATETIME_DATETIME) { + return constants$2.Constants.SYS_DATETIME_TIME; + } + } + else { + if (hasBefore || hasAfter || hasSince) { + if (type === constants$2.Constants.SYS_DATETIME_DATE) + return constants$2.Constants.SYS_DATETIME_DATEPERIOD; + if (type === constants$2.Constants.SYS_DATETIME_TIME) + return constants$2.Constants.SYS_DATETIME_TIMEPERIOD; + if (type === constants$2.Constants.SYS_DATETIME_DATETIME) + return constants$2.Constants.SYS_DATETIME_DATETIMEPERIOD; + } + } + return type; + } + dateTimeResolutionForSplit(slot) { + let results = new Array(); + if (slot.value.subDateTimeEntities != null) { + let subEntities = slot.value.subDateTimeEntities; + for (let subEntity of subEntities) { + let result = subEntity; + results.push(...this.dateTimeResolutionForSplit(result)); + } + } + else { + slot.value = this.dateTimeResolution(slot, false, false, false); + slot.type = `${this.parserTypeName}.${this.determineDateTimeType(slot.type, false, false, false)}`; + results.push(slot); + } + return results; + } + dateTimeResolution(slot, hasBefore, hasAfter, hasSince) { + if (!slot) + return null; + let result = new Map(); + let resolutions = new Array(); + let type = slot.type; + let outputType = this.determineDateTimeType(type, hasBefore, hasAfter, hasSince); + let timex = slot.timexStr; + let value = slot.value; + if (!value) + return null; + let isLunar = value.isLunar; + let mod = value.mod; + let comment = value.comment; + // the following should added to res first since the ResolveAmPm is using these fields + this.addResolutionFieldsAny(result, constants$2.Constants.TimexKey, timex); + this.addResolutionFieldsAny(result, constants$2.Constants.CommentKey, comment); + this.addResolutionFieldsAny(result, constants$2.Constants.ModKey, mod); + this.addResolutionFieldsAny(result, constants$2.Constants.TypeKey, outputType); + this.addResolutionFieldsAny(result, constants$2.Constants.IsLunarKey, isLunar ? String(isLunar) : ""); + let futureResolution = value.futureResolution; + let pastResolution = value.pastResolution; + let future = this.generateFromResolution(type, futureResolution, mod); + let past = this.generateFromResolution(type, pastResolution, mod); + let futureValues = Array.from(this.getValues(future)).sort(); + let pastValues = Array.from(this.getValues(past)).sort(); + if (lodash_isequal(futureValues, pastValues)) { + if (pastValues.length > 0) + this.addResolutionFieldsAny(result, constants$2.Constants.ResolveKey, past); + } + else { + if (pastValues.length > 0) + this.addResolutionFieldsAny(result, constants$2.Constants.ResolveToPastKey, past); + if (futureValues.length > 0) + this.addResolutionFieldsAny(result, constants$2.Constants.ResolveToFutureKey, future); + } + if (comment && comment === 'ampm') { + if (result.has('resolve')) { + this.resolveAMPM(result, 'resolve'); + } + else { + this.resolveAMPM(result, 'resolveToPast'); + this.resolveAMPM(result, 'resolveToFuture'); + } + } + result.forEach((value, key) => { + if (this.isObject(value)) { + // is "StringMap" + let newValues = {}; + this.addResolutionFields(newValues, constants$2.Constants.TimexKey, timex); + this.addResolutionFields(newValues, constants$2.Constants.ModKey, mod); + this.addResolutionFields(newValues, constants$2.Constants.TypeKey, outputType); + this.addResolutionFields(newValues, constants$2.Constants.IsLunarKey, isLunar ? String(isLunar) : ""); + Object.keys(value).forEach((innerKey) => { + newValues[innerKey] = value[innerKey]; + }); + resolutions.push(newValues); + } + }); + if (Object.keys(past).length === 0 && Object.keys(future).length === 0) { + let o = {}; + o['timex'] = timex; + o['type'] = outputType; + o['value'] = 'not resolved'; + resolutions.push(o); + } + return { + values: resolutions + }; + } + isObject(o) { + return (!!o) && (o.constructor === Object); + } + addResolutionFieldsAny(dic, key, value) { + if (value instanceof String) { + if (!recognizersTextNumber.StringUtility.isNullOrEmpty(value)) { + dic.set(key, value); + } + } + else { + dic.set(key, value); + } + } + addResolutionFields(dic, key, value) { + if (!recognizersTextNumber.StringUtility.isNullOrEmpty(value)) { + dic[key] = value; + } + } + generateFromResolution(type, resolutions, mod) { + let result = {}; + switch (type) { + case constants$2.Constants.SYS_DATETIME_DATETIME: + this.addSingleDateTimeToResolution(resolutions, constants$2.TimeTypeConstants.DATETIME, mod, result); + break; + case constants$2.Constants.SYS_DATETIME_TIME: + this.addSingleDateTimeToResolution(resolutions, constants$2.TimeTypeConstants.TIME, mod, result); + break; + case constants$2.Constants.SYS_DATETIME_DATE: + this.addSingleDateTimeToResolution(resolutions, constants$2.TimeTypeConstants.DATE, mod, result); + break; + case constants$2.Constants.SYS_DATETIME_DURATION: + if (resolutions.hasOwnProperty(constants$2.TimeTypeConstants.DURATION)) { + result[constants$2.TimeTypeConstants.VALUE] = resolutions[constants$2.TimeTypeConstants.DURATION]; + } + break; + case constants$2.Constants.SYS_DATETIME_TIMEPERIOD: + this.addPeriodToResolution(resolutions, constants$2.TimeTypeConstants.START_TIME, constants$2.TimeTypeConstants.END_TIME, mod, result); + break; + case constants$2.Constants.SYS_DATETIME_DATEPERIOD: + this.addPeriodToResolution(resolutions, constants$2.TimeTypeConstants.START_DATE, constants$2.TimeTypeConstants.END_DATE, mod, result); + break; + case constants$2.Constants.SYS_DATETIME_DATETIMEPERIOD: + this.addPeriodToResolution(resolutions, constants$2.TimeTypeConstants.START_DATETIME, constants$2.TimeTypeConstants.END_DATETIME, mod, result); + break; + } + return result; + } + addSingleDateTimeToResolution(resolutions, type, mod, result) { + let key = constants$2.TimeTypeConstants.VALUE; + let value = resolutions[type]; + if (!value || this.dateMinValue === value || this.dateTimeMinValue === value) + return; + if (!recognizersTextNumber.StringUtility.isNullOrEmpty(mod)) { + if (mod === constants$2.TimeTypeConstants.beforeMod) { + key = constants$2.TimeTypeConstants.END; + } + else if (mod === constants$2.TimeTypeConstants.afterMod) { + key = constants$2.TimeTypeConstants.START; + } + else if (mod === constants$2.TimeTypeConstants.sinceMod) { + key = constants$2.TimeTypeConstants.START; + } + } + result[key] = value; + } + addPeriodToResolution(resolutions, startType, endType, mod, result) { + let start = resolutions[startType]; + let end = resolutions[endType]; + if (!recognizersTextNumber.StringUtility.isNullOrEmpty(mod)) { + // For the 'before' mod + // 1. Cases like "Before December", the start of the period should be the end of the new period, not the start + // 2. Cases like "More than 3 days before today", the date point should be the end of the new period + if (mod === constants$2.TimeTypeConstants.beforeMod) { + if (!recognizersTextNumber.StringUtility.isNullOrEmpty(start) && !recognizersTextNumber.StringUtility.isNullOrEmpty(end)) { + result[constants$2.TimeTypeConstants.END] = start; + } + else { + result[constants$2.TimeTypeConstants.END] = end; + } + return; + } + // For the 'after' mod + // 1. Cases like "After January". the end of the period should be the start of the new period, not the end + // 2. Cases like "More than 3 days after today", the date point should be the start of the new period + if (mod === constants$2.TimeTypeConstants.afterMod) { + // For cases like "After January" or "After 2018" + // The "end" of the period is not inclusive by default ("January", the end should be "XXXX-02-01" / "2018", the end should be "2019-01-01") + // Mod "after" is also not inclusive the "start" ("After January", the start should be "XXXX-01-31" / "After 2018", the start should be "2017-12-31") + // So here the START day should be the inclusive end of the period, which is one day previous to the default end (exclusive end) + if (!recognizersTextNumber.StringUtility.isNullOrEmpty(start) && !recognizersTextNumber.StringUtility.isNullOrEmpty(end)) { + var dateObj = new Date(end); + dateObj.setDate(dateObj.getDate() - 1); + result[constants$2.TimeTypeConstants.START] = utilities$2.FormatUtil.formatDate(dateObj); + } + else { + result[constants$2.TimeTypeConstants.START] = start; + } + return; + } + if (mod === constants$2.TimeTypeConstants.sinceMod) { + result[constants$2.TimeTypeConstants.START] = start; + return; + } + } + if (recognizersTextNumber.StringUtility.isNullOrEmpty(start) || recognizersTextNumber.StringUtility.isNullOrEmpty(end)) + return; + result[constants$2.TimeTypeConstants.START] = start; + result[constants$2.TimeTypeConstants.END] = end; + } + getValues(obj) { + return Object.keys(obj).map(key => obj[key]); + } + resolveAMPM(valuesMap, keyName) { + if (!valuesMap.has(keyName)) + return; + let resolution = valuesMap.get(keyName); + if (!valuesMap.has('timex')) + return; + let timex = valuesMap.get('timex'); + valuesMap.delete(keyName); + valuesMap.set(keyName + 'Am', resolution); + let resolutionPm = {}; + switch (valuesMap.get('type')) { + case constants$2.Constants.SYS_DATETIME_TIME: + resolutionPm[constants$2.TimeTypeConstants.VALUE] = utilities$2.FormatUtil.toPm(resolution[constants$2.TimeTypeConstants.VALUE]); + resolutionPm['timex'] = utilities$2.FormatUtil.toPm(timex); + break; + case constants$2.Constants.SYS_DATETIME_DATETIME: + let splitValue = resolution[constants$2.TimeTypeConstants.VALUE].split(' '); + resolutionPm[constants$2.TimeTypeConstants.VALUE] = `${splitValue[0]} ${utilities$2.FormatUtil.toPm(splitValue[1])}`; + resolutionPm['timex'] = utilities$2.FormatUtil.allStringToPm(timex); + break; + case constants$2.Constants.SYS_DATETIME_TIMEPERIOD: + if (resolution.hasOwnProperty(constants$2.TimeTypeConstants.START)) + resolutionPm[constants$2.TimeTypeConstants.START] = utilities$2.FormatUtil.toPm(resolution[constants$2.TimeTypeConstants.START]); + if (resolution.hasOwnProperty(constants$2.TimeTypeConstants.END)) + resolutionPm[constants$2.TimeTypeConstants.END] = utilities$2.FormatUtil.toPm(resolution[constants$2.TimeTypeConstants.END]); + resolutionPm['timex'] = utilities$2.FormatUtil.allStringToPm(timex); + break; + case constants$2.Constants.SYS_DATETIME_DATETIMEPERIOD: + if (resolution.hasOwnProperty(constants$2.TimeTypeConstants.START)) { + let splitValue = resolution[constants$2.TimeTypeConstants.START].split(' '); + resolutionPm[constants$2.TimeTypeConstants.START] = `${splitValue[0]} ${utilities$2.FormatUtil.toPm(splitValue[1])}`; + } + if (resolution.hasOwnProperty(constants$2.TimeTypeConstants.END)) { + let splitValue = resolution[constants$2.TimeTypeConstants.END].split(' '); + resolutionPm[constants$2.TimeTypeConstants.END] = `${splitValue[0]} ${utilities$2.FormatUtil.toPm(splitValue[1])}`; + } + resolutionPm['timex'] = utilities$2.FormatUtil.allStringToPm(timex); + break; + } + valuesMap.set(keyName + 'Pm', resolutionPm); + } +} +exports.BaseMergedParser = BaseMergedParser; + +}); + +unwrapExports(baseMerged); + +var englishDateTime = createCommonjsModule(function (module, exports) { +"use strict"; +// ------------------------------------------------------------------------------ +// +// This code was generated by a tool. +// Changes to this file may cause incorrect behavior and will be lost if +// the code is regenerated. +// +// ------------------------------------------------------------------------------ +Object.defineProperty(exports, "__esModule", { value: true }); + +var EnglishDateTime; +(function (EnglishDateTime) { + EnglishDateTime.TillRegex = `(?\\b(to|till|til|until|thru|through)\\b|(--|-|—|——|~|–))`; + EnglishDateTime.RangeConnectorRegex = `(?\\b(and|through|to)\\b|(--|-|—|——|~|–))`; + EnglishDateTime.RelativeRegex = `\\b(?following|next|coming|upcoming|this|last|past|previous|current|the)\\b`; + EnglishDateTime.StrictRelativeRegex = `\\b(?following|next|coming|upcoming|this|last|past|previous|current)\\b`; + EnglishDateTime.NextPrefixRegex = `\\b(following|next|upcoming|coming)\\b`; + EnglishDateTime.AfterNextSuffixRegex = `\\b(after\\s+(the\\s+)?next)\\b`; + EnglishDateTime.PastPrefixRegex = `(last|past|previous)\\b`; + EnglishDateTime.ThisPrefixRegex = `(this|current)\\b`; + EnglishDateTime.CenturySuffixRegex = `(^century)\\b`; + EnglishDateTime.ReferencePrefixRegex = `(that|same)\\b`; + EnglishDateTime.FutureSuffixRegex = `\\b(in\\s+the\\s+)?(future|hence)\\b`; + EnglishDateTime.DayRegex = `(the\\s*)?(?01|02|03|04|05|06|07|08|09|10th|10|11th|11st|11|12nd|12th|12|13rd|13th|13|14th|14|15th|15|16th|16|17th|17|18th|18|19th|19|1st|1|20th|20|21st|21th|21|22nd|22th|22|23rd|23th|23|24th|24|25th|25|26th|26|27th|27|28th|28|29th|29|2nd|2|30th|30|31st|31|3rd|3|4th|4|5th|5|6th|6|7th|7|8th|8|9th|9)(?=\\b|t)`; + EnglishDateTime.ImplicitDayRegex = `(the\\s*)?(?10th|11th|11st|12nd|12th|13rd|13th|14th|15th|16th|17th|18th|19th|1st|20th|21st|21th|22nd|22th|23rd|23th|24th|25th|26th|27th|28th|29th|2nd|30th|31st|3rd|4th|5th|6th|7th|8th|9th)\\b`; + EnglishDateTime.MonthNumRegex = `(?01|02|03|04|05|06|07|08|09|10|11|12|1|2|3|4|5|6|7|8|9)\\b`; + EnglishDateTime.CenturyRegex = `\\b(?((one|two)\\s+thousand(\\s+and)?(\\s+(one|two|three|four|five|six|seven|eight|nine)\\s+hundred(\\s+and)?)?)|((twenty one|twenty two|one|two|three|four|five|six|seven|eight|nine|ten|eleven|twelve|thirteen|fourteen|fifteen|sixteen|seventeen|eighteen|nineteen|twenty)(\\s+hundred)?(\\s+and)?))\\b`; + EnglishDateTime.WrittenNumRegex = `(one|two|three|four|five|six|seven|eight|nine|ten|eleven|twelve|thirteen|fourteen|fifteen|sixteen|seventeen|eighteen|nineteen|twenty|thirty|forty|fourty|fifty|sixty|seventy|eighty|ninety)`; + EnglishDateTime.FullTextYearRegex = `\\b((?${EnglishDateTime.CenturyRegex})\\s+(?((zero|twenty|thirty|forty|fourty|fifty|sixty|seventy|eighty|ninety)\\s+${EnglishDateTime.WrittenNumRegex})|${EnglishDateTime.WrittenNumRegex}))\\b|\\b(?${EnglishDateTime.CenturyRegex})\\b`; + EnglishDateTime.AmDescRegex = `(am\\b|a\\.m\\.|a m\\b|a\\. m\\.|a\\.m\\b|a\\. m\\b|a m\\b)`; + EnglishDateTime.PmDescRegex = `(pm\\b|p\\.m\\.|p\\b|p m\\b|p\\. m\\.|p\\.m\\b|p\\. m\\b|p m\\b)`; + EnglishDateTime.TwoDigitYearRegex = `\\b(?([0-27-9]\\d))(?!(\\s*((\\:)|${EnglishDateTime.AmDescRegex}|${EnglishDateTime.PmDescRegex}|\\.\\d)))\\b`; + EnglishDateTime.YearRegex = `(${baseDateTime.BaseDateTime.FourDigitYearRegex}|${EnglishDateTime.FullTextYearRegex})`; + EnglishDateTime.WeekDayRegex = `\\b(?Sunday|Monday|Tuesday|Wednesday|Thursday|Friday|Saturday|Mon|Tues|Tue|Wedn|Weds|Wed|Thurs|Thur|Thu|Fri|Sat|Sun)s?\\b`; + EnglishDateTime.SingleWeekDayRegex = `\\b(?Sunday|Monday|Tuesday|Wednesday|Thursday|Friday|Saturday|Mon|Tue|Tues|Wedn|Weds|Wed|Thurs|Thur|Thu|Fri|((?<=on\\s+)(Sat|Sun)))\\b`; + EnglishDateTime.RelativeMonthRegex = `(?(of\\s+)?${EnglishDateTime.RelativeRegex}\\s+month)\\b`; + EnglishDateTime.WrittenMonthRegex = `(((the\\s+)?month of\\s+)?(?April|Apr|August|Aug|December|Dec|February|Feb|January|Jan|July|Jul|June|Jun|March|Mar|May|November|Nov|October|Oct|September|Sept|Sep))`; + EnglishDateTime.MonthSuffixRegex = `(?(in\\s+|of\\s+|on\\s+)?(${EnglishDateTime.RelativeMonthRegex}|${EnglishDateTime.WrittenMonthRegex}))`; + EnglishDateTime.DateUnitRegex = `(?decades?|years?|months?|weeks?|(?business\\s+)?days?)\\b`; + EnglishDateTime.DateTokenPrefix = 'on '; + EnglishDateTime.TimeTokenPrefix = 'at '; + EnglishDateTime.TokenBeforeDate = 'on '; + EnglishDateTime.TokenBeforeTime = 'at '; + EnglishDateTime.SimpleCasesRegex = `\\b((from|between)\\s+)?(${EnglishDateTime.DayRegex})\\s*${EnglishDateTime.TillRegex}\\s*(${EnglishDateTime.DayRegex}\\s+${EnglishDateTime.MonthSuffixRegex}|${EnglishDateTime.MonthSuffixRegex}\\s+${EnglishDateTime.DayRegex})((\\s+|\\s*,\\s*)${EnglishDateTime.YearRegex})?\\b`; + EnglishDateTime.MonthFrontSimpleCasesRegex = `\\b((from|between)\\s+)?${EnglishDateTime.MonthSuffixRegex}\\s+((from)\\s+)?(${EnglishDateTime.DayRegex})\\s*${EnglishDateTime.TillRegex}\\s*(${EnglishDateTime.DayRegex})((\\s+|\\s*,\\s*)${EnglishDateTime.YearRegex})?\\b`; + EnglishDateTime.MonthFrontBetweenRegex = `\\b${EnglishDateTime.MonthSuffixRegex}\\s+(between\\s+)(${EnglishDateTime.DayRegex})\\s*${EnglishDateTime.RangeConnectorRegex}\\s*(${EnglishDateTime.DayRegex})((\\s+|\\s*,\\s*)${EnglishDateTime.YearRegex})?\\b`; + EnglishDateTime.BetweenRegex = `\\b(between\\s+)(${EnglishDateTime.DayRegex})\\s*${EnglishDateTime.RangeConnectorRegex}\\s*(${EnglishDateTime.DayRegex})\\s+${EnglishDateTime.MonthSuffixRegex}((\\s+|\\s*,\\s*)${EnglishDateTime.YearRegex})?\\b`; + EnglishDateTime.MonthWithYear = `\\b((${EnglishDateTime.WrittenMonthRegex}(\\.)?(\\s*),?(\\s+of)?(\\s*)(${EnglishDateTime.YearRegex}|(?following|next|last|this)\\s+year))|((${EnglishDateTime.YearRegex}|(?following|next|last|this)\\s+year)(\\s*),?(\\s*)${EnglishDateTime.WrittenMonthRegex}))\\b`; + EnglishDateTime.OneWordPeriodRegex = `\\b((((the\\s+)?month of\\s+)?(${EnglishDateTime.StrictRelativeRegex}\\s+)?(?April|Apr|August|Aug|December|Dec|February|Feb|January|Jan|July|Jul|June|Jun|March|Mar|May|November|Nov|October|Oct|September|Sep|Sept))|(month|year) to date|(${EnglishDateTime.RelativeRegex}\\s+)?(my\\s+)?(weekend|week|month|year)(?!((\\s+of)?\\s+\\d+|\\s+to\\s+date))(\\s+${EnglishDateTime.AfterNextSuffixRegex})?)\\b`; + EnglishDateTime.MonthNumWithYear = `\\b((${baseDateTime.BaseDateTime.FourDigitYearRegex}(\\s*)[/\\-\\.](\\s*)${EnglishDateTime.MonthNumRegex})|(${EnglishDateTime.MonthNumRegex}(\\s*)[/\\-](\\s*)${baseDateTime.BaseDateTime.FourDigitYearRegex}))\\b`; + EnglishDateTime.WeekOfMonthRegex = `\\b(?(the\\s+)?(?first|1st|second|2nd|third|3rd|fourth|4th|fifth|5th|last)\\s+week\\s+${EnglishDateTime.MonthSuffixRegex})\\b`; + EnglishDateTime.WeekOfYearRegex = `\\b(?(the\\s+)?(?first|1st|second|2nd|third|3rd|fourth|4th|fifth|5th|last)\\s+week(\\s+of)?\\s+(${EnglishDateTime.YearRegex}|${EnglishDateTime.RelativeRegex}\\s+year))\\b`; + EnglishDateTime.FollowedDateUnit = `^\\s*${EnglishDateTime.DateUnitRegex}`; + EnglishDateTime.NumberCombinedWithDateUnit = `\\b(?\\d+(\\.\\d*)?)${EnglishDateTime.DateUnitRegex}`; + EnglishDateTime.QuarterTermRegex = `\\b(((?first|1st|second|2nd|third|3rd|fourth|4th)[ -]+quarter)|(Q(?[1-4])))\\b`; + EnglishDateTime.QuarterRegex = `(the\\s+)?${EnglishDateTime.QuarterTermRegex}((\\s+of|\\s*,\\s*)?\\s+(${EnglishDateTime.YearRegex}|${EnglishDateTime.RelativeRegex}\\s+year))?`; + EnglishDateTime.QuarterRegexYearFront = `(${EnglishDateTime.YearRegex}|${EnglishDateTime.RelativeRegex}\\s+year)('s)?\\s+(the\\s+)?${EnglishDateTime.QuarterTermRegex}`; + EnglishDateTime.HalfYearTermRegex = `(?first|1st|second|2nd)\\s+half`; + EnglishDateTime.HalfYearFrontRegex = `(?((1[5-9]|20)\\d{2})|2100)\\s*(the\\s+)?H(?[1-2])`; + EnglishDateTime.HalfYearBackRegex = `(the\\s+)?(H(?[1-2])|(${EnglishDateTime.HalfYearTermRegex}))(\\s+of|\\s*,\\s*)?\\s+(${EnglishDateTime.YearRegex})`; + EnglishDateTime.HalfYearRelativeRegex = `(the\\s+)?${EnglishDateTime.HalfYearTermRegex}(\\s+of|\\s*,\\s*)?\\s+(${EnglishDateTime.RelativeRegex}\\s+year)`; + EnglishDateTime.AllHalfYearRegex = `(${EnglishDateTime.HalfYearFrontRegex})|(${EnglishDateTime.HalfYearBackRegex})|(${EnglishDateTime.HalfYearRelativeRegex})`; + EnglishDateTime.EarlyPrefixRegex = `\\b(?early|beginning of|start of|(?earlier(\\s+in)?))\\b`; + EnglishDateTime.MidPrefixRegex = `\\b(?mid-?|middle of)\\b`; + EnglishDateTime.LaterPrefixRegex = `\\b(?late|end of|(?later(\\s+in)?))\\b`; + EnglishDateTime.PrefixPeriodRegex = `(${EnglishDateTime.EarlyPrefixRegex}|${EnglishDateTime.MidPrefixRegex}|${EnglishDateTime.LaterPrefixRegex})`; + EnglishDateTime.PrefixDayRegex = `\\b((?early)|(?mid|middle)|(?late|later))(\\s+in)?(\\s+the\\s+day)?$`; + EnglishDateTime.SeasonDescRegex = `(?spring|summer|fall|autumn|winter)`; + EnglishDateTime.SeasonRegex = `\\b(?(${EnglishDateTime.PrefixPeriodRegex}\\s+)?(${EnglishDateTime.RelativeRegex}\\s+)?${EnglishDateTime.SeasonDescRegex}((\\s+of|\\s*,\\s*)?\\s+(${EnglishDateTime.YearRegex}|${EnglishDateTime.RelativeRegex}\\s+year))?)\\b`; + EnglishDateTime.WhichWeekRegex = `(week)(\\s*)(?\\d\\d|\\d|0\\d)`; + EnglishDateTime.WeekOfRegex = `(the\\s+)?(week)(\\s+of)(\\s+the)?`; + EnglishDateTime.MonthOfRegex = `(month)(\\s*)(of)`; + EnglishDateTime.MonthRegex = `(?April|Apr|August|Aug|December|Dec|February|Feb|January|Jan|July|Jul|June|Jun|March|Mar|May|November|Nov|October|Oct|September|Sept|Sep)`; + EnglishDateTime.AmbiguousMonthP0Regex = `\\b((^may i)|(i|you|he|she|we|they)\\s+may|(may\\s+((((also|not|(also not)|well)\\s+)?(be|contain|constitute|email|e-mail|take|have|result|involve|get|work|reply))|(or may not))))\\b`; + EnglishDateTime.DateYearRegex = `(?${baseDateTime.BaseDateTime.FourDigitYearRegex}|${EnglishDateTime.TwoDigitYearRegex})`; + EnglishDateTime.YearSuffix = `(,?\\s*(${EnglishDateTime.DateYearRegex}|${EnglishDateTime.FullTextYearRegex}))`; + EnglishDateTime.OnRegex = `(?<=\\bon\\s+)(${EnglishDateTime.DayRegex}s?)\\b`; + EnglishDateTime.RelaxedOnRegex = `(?<=\\b(on|at|in)\\s+)((?10th|11th|11st|12nd|12th|13rd|13th|14th|15th|16th|17th|18th|19th|1st|20th|21st|21th|22nd|22th|23rd|23th|24th|25th|26th|27th|28th|29th|2nd|30th|31st|3rd|4th|5th|6th|7th|8th|9th)s?)\\b`; + EnglishDateTime.ThisRegex = `\\b((this(\\s*week)?(\\s*on)?\\s+)${EnglishDateTime.WeekDayRegex})|(${EnglishDateTime.WeekDayRegex}((\\s+of)?\\s+this\\s*week))\\b`; + EnglishDateTime.LastDateRegex = `\\b(${EnglishDateTime.PastPrefixRegex}(\\s*week)?\\s+${EnglishDateTime.WeekDayRegex})|(${EnglishDateTime.WeekDayRegex}(\\s+last\\s*week))\\b`; + EnglishDateTime.NextDateRegex = `\\b(${EnglishDateTime.NextPrefixRegex}(\\s*week(\\s*,?\\s*on)?)?\\s+${EnglishDateTime.WeekDayRegex})|((on\\s+)?${EnglishDateTime.WeekDayRegex}((\\s+of)?\\s+(the\\s+following|(the\\s+)?next)\\s*week))\\b`; + EnglishDateTime.SpecialDayRegex = `\\b((the\\s+)?day before yesterday|(the\\s+)?day after (tomorrow|tmr)|((the\\s+)?(${EnglishDateTime.RelativeRegex}|my)\\s+day)|yesterday|tomorrow|tmr|today)\\b`; + EnglishDateTime.SpecialDayWithNumRegex = `\\b((?${EnglishDateTime.WrittenNumRegex})\\s+days?\\s+from\\s+(?yesterday|tomorrow|tmr|today))\\b`; + EnglishDateTime.RelativeDayRegex = `\\b(((the\\s+)?${EnglishDateTime.RelativeRegex}\\s+day))\\b`; + EnglishDateTime.SetWeekDayRegex = `\\b(?on\\s+)?(?morning|afternoon|evening|night|Sunday|Monday|Tuesday|Wednesday|Thursday|Friday|Saturday)s\\b`; + EnglishDateTime.WeekDayOfMonthRegex = `(?(the\\s+)?(?first|1st|second|2nd|third|3rd|fourth|4th|fifth|5th|last)\\s+${EnglishDateTime.WeekDayRegex}\\s+${EnglishDateTime.MonthSuffixRegex})`; + EnglishDateTime.RelativeWeekDayRegex = `\\b(${EnglishDateTime.WrittenNumRegex}\\s+${EnglishDateTime.WeekDayRegex}\\s+(from\\s+now|later))\\b`; + EnglishDateTime.SpecialDate = `(?=\\b(on|at)\\s+the\\s+)${EnglishDateTime.DayRegex}\\b`; + EnglishDateTime.DatePreposition = `\\b(on|in)`; + EnglishDateTime.DateExtractor1 = `\\b((this\\s+)?${EnglishDateTime.WeekDayRegex}\\s*[,-]?\\s*)?((${EnglishDateTime.MonthRegex}(\\.)?\\s*[/\\\\.,-]?\\s*${EnglishDateTime.DayRegex})|(\\(${EnglishDateTime.MonthRegex}\\s*[-.]\\s*${EnglishDateTime.DayRegex}\\)))(\\s*\\(\\s*${EnglishDateTime.WeekDayRegex}\\s*\\))?`; + EnglishDateTime.DateExtractor2 = `\\b${EnglishDateTime.DateExtractor1}(\\s+|\\s*,\\s*|\\s+of\\s+)${EnglishDateTime.DateYearRegex}\\b`; + EnglishDateTime.DateExtractor3 = `\\b(${EnglishDateTime.WeekDayRegex}(\\s+|\\s*,\\s*))?${EnglishDateTime.DayRegex}(\\.)?(\\s+|\\s*,\\s*|\\s+of\\s+|\\s*-\\s*)${EnglishDateTime.MonthRegex}(\\.)?((\\s+|\\s*,\\s*)${EnglishDateTime.DateYearRegex})?\\b`; + EnglishDateTime.DateExtractor4 = `\\b${EnglishDateTime.MonthNumRegex}\\s*[/\\\\\\-]\\s*${EnglishDateTime.DayRegex}(\\.)?\\s*[/\\\\\\-]\\s*${EnglishDateTime.DateYearRegex}`; + EnglishDateTime.DateExtractor5 = `\\b${EnglishDateTime.DayRegex}\\s*[/\\\\\\-\\.]\\s*${EnglishDateTime.MonthNumRegex}\\s*[/\\\\\\-\\.]\\s*${EnglishDateTime.DateYearRegex}`; + EnglishDateTime.DateExtractor6 = `(?<=${EnglishDateTime.DatePreposition}\\s+)(${EnglishDateTime.WeekDayRegex}\\s+)?${EnglishDateTime.MonthNumRegex}[\\-\\.]${EnglishDateTime.DayRegex}(?![%])\\b`; + EnglishDateTime.DateExtractor7 = `\\b(${EnglishDateTime.WeekDayRegex}\\s+)?${EnglishDateTime.MonthNumRegex}\\s*/\\s*${EnglishDateTime.DayRegex}((\\s+|\\s*,\\s*|\\s+of\\s+)${EnglishDateTime.DateYearRegex})?(?![%])\\b`; + EnglishDateTime.DateExtractor8 = `(?<=${EnglishDateTime.DatePreposition}\\s+)(${EnglishDateTime.WeekDayRegex}\\s+)?${EnglishDateTime.DayRegex}[\\\\\\-]${EnglishDateTime.MonthNumRegex}(?![%])\\b`; + EnglishDateTime.DateExtractor9 = `\\b(${EnglishDateTime.WeekDayRegex}\\s+)?${EnglishDateTime.DayRegex}\\s*/\\s*${EnglishDateTime.MonthNumRegex}((\\s+|\\s*,\\s*|\\s+of\\s+)${EnglishDateTime.DateYearRegex})?(?![%])\\b`; + EnglishDateTime.DateExtractorA = `\\b(${EnglishDateTime.WeekDayRegex}\\s+)?${EnglishDateTime.DateYearRegex}\\s*[/\\\\\\-\\.]\\s*${EnglishDateTime.MonthNumRegex}\\s*[/\\\\\\-\\.]\\s*${EnglishDateTime.DayRegex}`; + EnglishDateTime.OfMonth = `^\\s*of\\s*${EnglishDateTime.MonthRegex}`; + EnglishDateTime.MonthEnd = `${EnglishDateTime.MonthRegex}\\s*(the)?\\s*$`; + EnglishDateTime.WeekDayEnd = `(this\\s+)?${EnglishDateTime.WeekDayRegex}\\s*,?\\s*$`; + EnglishDateTime.RangeUnitRegex = `\\b(?years|year|months|month|weeks|week)\\b`; + EnglishDateTime.OclockRegex = `(?o\\s*’\\s*clock|o\\s*‘\\s*clock|o\\s*'\\s*clock|o\\s*clock)`; + EnglishDateTime.DescRegex = `(((${EnglishDateTime.OclockRegex}\\s+)?(?ampm|am\\b|a\\.m\\.|a m\\b|a\\. m\\.|a\\.m\\b|a\\. m\\b|a m\\b|pm\\b|p\\.m\\.|p m\\b|p\\. m\\.|p\\.m\\b|p\\. m\\b|p\\b|p m\\b))|${EnglishDateTime.OclockRegex})`; + EnglishDateTime.HourNumRegex = `\\b(?zero|one|two|three|four|five|six|seven|eight|nine|ten|eleven|twelve)\\b`; + EnglishDateTime.MinuteNumRegex = `(?one|two|three|four|five|six|seven|eight|nine|ten|eleven|twelve|thirteen|fourteen|fifteen|sixteen|seventeen|eighteen|nineteen|twenty|thirty|forty|fifty)`; + EnglishDateTime.DeltaMinuteNumRegex = `(?one|two|three|four|five|six|seven|eight|nine|ten|eleven|twelve|thirteen|fourteen|fifteen|sixteen|seventeen|eighteen|nineteen|twenty|thirty|forty|fifty)`; + EnglishDateTime.PmRegex = `(?(((at|in|around|on|for)\\s+(the\\s+)?)?(afternoon|evening|midnight|lunchtime))|((at|in|around|on|for)\\s+(the\\s+)?night))`; + EnglishDateTime.PmRegexFull = `(?((at|in|around|on|for)\\s+(the\\s+)?)?(afternoon|evening|midnight|night|lunchtime))`; + EnglishDateTime.AmRegex = `(?((at|in|around|on|for)\\s+(the\\s+)?)?(morning))`; + EnglishDateTime.LunchRegex = `\\b(lunchtime)\\b`; + EnglishDateTime.NightRegex = `\\b(midnight|night)\\b`; + EnglishDateTime.CommonDatePrefixRegex = `^[\\.]`; + EnglishDateTime.LessThanOneHour = `(?(a\\s+)?quarter|three quarter(s)?|half( an hour)?|${baseDateTime.BaseDateTime.DeltaMinuteRegex}(\\s+(minute|minutes|min|mins))|${EnglishDateTime.DeltaMinuteNumRegex}(\\s+(minute|minutes|min|mins)))`; + EnglishDateTime.WrittenTimeRegex = `(?${EnglishDateTime.HourNumRegex}\\s+(${EnglishDateTime.MinuteNumRegex}|(?twenty|thirty|forty|fourty|fifty)\\s+${EnglishDateTime.MinuteNumRegex}))`; + EnglishDateTime.TimePrefix = `(?(${EnglishDateTime.LessThanOneHour} past|${EnglishDateTime.LessThanOneHour} to))`; + EnglishDateTime.TimeSuffix = `(?${EnglishDateTime.AmRegex}|${EnglishDateTime.PmRegex}|${EnglishDateTime.OclockRegex})`; + EnglishDateTime.TimeSuffixFull = `(?${EnglishDateTime.AmRegex}|${EnglishDateTime.PmRegexFull}|${EnglishDateTime.OclockRegex})`; + EnglishDateTime.BasicTime = `\\b(?${EnglishDateTime.WrittenTimeRegex}|${EnglishDateTime.HourNumRegex}|${baseDateTime.BaseDateTime.HourRegex}:${baseDateTime.BaseDateTime.MinuteRegex}(:${baseDateTime.BaseDateTime.SecondRegex})?|${baseDateTime.BaseDateTime.HourRegex})`; + EnglishDateTime.MidnightRegex = `(?midnight|mid-night|mid night)`; + EnglishDateTime.MidmorningRegex = `(?midmorning|mid-morning|mid morning)`; + EnglishDateTime.MidafternoonRegex = `(?midafternoon|mid-afternoon|mid afternoon)`; + EnglishDateTime.MiddayRegex = `(?midday|mid-day|mid day|((12\\s)?noon))`; + EnglishDateTime.MidTimeRegex = `(?(${EnglishDateTime.MidnightRegex}|${EnglishDateTime.MidmorningRegex}|${EnglishDateTime.MidafternoonRegex}|${EnglishDateTime.MiddayRegex}))`; + EnglishDateTime.AtRegex = `\\b(((?<=\\bat\\s+)(${EnglishDateTime.WrittenTimeRegex}|${EnglishDateTime.HourNumRegex}|${baseDateTime.BaseDateTime.HourRegex}(?!\\.\\d)(\\s*((?a)|(?p)))?|${EnglishDateTime.MidTimeRegex}))|${EnglishDateTime.MidTimeRegex})\\b`; + EnglishDateTime.IshRegex = `\\b(${baseDateTime.BaseDateTime.HourRegex}(-|——)?ish|noonish|noon)\\b`; + EnglishDateTime.TimeUnitRegex = `([^A-Za-z]{1,}|\\b)(?hours|hour|hrs|hr|h|minutes|minute|mins|min|seconds|second|secs|sec)\\b`; + EnglishDateTime.RestrictedTimeUnitRegex = `(?hour|minute)\\b`; + EnglishDateTime.FivesRegex = `(?(fifteen|twenty(\\s*five)?|thirty(\\s*five)?|forty(\\s*five)?|fourty(\\s*five)?|fifty(\\s*five)?|ten|five))\\b`; + EnglishDateTime.HourRegex = `\\b${baseDateTime.BaseDateTime.HourRegex}`; + EnglishDateTime.PeriodHourNumRegex = `\\b(?twenty one|twenty two|twenty three|twenty four|zero|one|two|three|four|five|six|seven|eight|nine|ten|eleven|twelve|thirteen|fourteen|fifteen|sixteen|seventeen|eighteen|nineteen|twenty)\\b`; + EnglishDateTime.ConnectNumRegex = `\\b${baseDateTime.BaseDateTime.HourRegex}(?00|01|02|03|04|05|06|07|08|09|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)\\s*${EnglishDateTime.DescRegex}`; + EnglishDateTime.TimeRegexWithDotConnector = `(${baseDateTime.BaseDateTime.HourRegex}(\\s*\\.\\s*)${baseDateTime.BaseDateTime.MinuteRegex})`; + EnglishDateTime.TimeRegex1 = `\\b(${EnglishDateTime.TimePrefix}\\s+)?(${EnglishDateTime.WrittenTimeRegex}|${EnglishDateTime.HourNumRegex}|${baseDateTime.BaseDateTime.HourRegex})\\s*${EnglishDateTime.DescRegex}`; + EnglishDateTime.TimeRegex2 = `(\\b${EnglishDateTime.TimePrefix}\\s+)?(T)?${baseDateTime.BaseDateTime.HourRegex}(\\s*)?:(\\s*)?${baseDateTime.BaseDateTime.MinuteRegex}((\\s*)?:(\\s*)?${baseDateTime.BaseDateTime.SecondRegex})?((\\s*${EnglishDateTime.DescRegex})|\\b)`; + EnglishDateTime.TimeRegex3 = `(\\b${EnglishDateTime.TimePrefix}\\s+)?${baseDateTime.BaseDateTime.HourRegex}\\.${baseDateTime.BaseDateTime.MinuteRegex}(\\s*${EnglishDateTime.DescRegex})`; + EnglishDateTime.TimeRegex4 = `\\b${EnglishDateTime.TimePrefix}\\s+${EnglishDateTime.BasicTime}(\\s*${EnglishDateTime.DescRegex})?\\s+${EnglishDateTime.TimeSuffix}\\b`; + EnglishDateTime.TimeRegex5 = `\\b${EnglishDateTime.TimePrefix}\\s+${EnglishDateTime.BasicTime}((\\s*${EnglishDateTime.DescRegex})|\\b)`; + EnglishDateTime.TimeRegex6 = `${EnglishDateTime.BasicTime}(\\s*${EnglishDateTime.DescRegex})?\\s+${EnglishDateTime.TimeSuffix}\\b`; + EnglishDateTime.TimeRegex7 = `\\b${EnglishDateTime.TimeSuffixFull}\\s+at\\s+${EnglishDateTime.BasicTime}((\\s*${EnglishDateTime.DescRegex})|\\b)`; + EnglishDateTime.TimeRegex8 = `\\b${EnglishDateTime.TimeSuffixFull}\\s+${EnglishDateTime.BasicTime}((\\s*${EnglishDateTime.DescRegex})|\\b)`; + EnglishDateTime.TimeRegex9 = `\\b${EnglishDateTime.PeriodHourNumRegex}\\s+${EnglishDateTime.FivesRegex}((\\s*${EnglishDateTime.DescRegex})|\\b)`; + EnglishDateTime.TimeRegex10 = `\\b(${EnglishDateTime.TimePrefix}\\s+)?${baseDateTime.BaseDateTime.HourRegex}(\\s*h\\s*)${baseDateTime.BaseDateTime.MinuteRegex}(\\s*${EnglishDateTime.DescRegex})?`; + EnglishDateTime.TimeRegex11 = `\\b((${EnglishDateTime.TimeTokenPrefix}${EnglishDateTime.TimeRegexWithDotConnector})(?!\\s*per\\s*cent|%)|(${EnglishDateTime.TimeRegexWithDotConnector}(\\s*${EnglishDateTime.DescRegex})))`; + EnglishDateTime.FirstTimeRegexInTimeRange = `\\b${EnglishDateTime.TimeRegexWithDotConnector}(\\s*${EnglishDateTime.DescRegex})?`; + EnglishDateTime.PureNumFromTo = `((from|between)\\s+)?(${EnglishDateTime.HourRegex}|${EnglishDateTime.PeriodHourNumRegex})(\\s*(?${EnglishDateTime.DescRegex}))?\\s*${EnglishDateTime.TillRegex}\\s*(${EnglishDateTime.HourRegex}|${EnglishDateTime.PeriodHourNumRegex})(?\\s*(${EnglishDateTime.PmRegex}|${EnglishDateTime.AmRegex}|${EnglishDateTime.DescRegex}))?`; + EnglishDateTime.PureNumBetweenAnd = `(between\\s+)(${EnglishDateTime.HourRegex}|${EnglishDateTime.PeriodHourNumRegex})(\\s*(?${EnglishDateTime.DescRegex}))?\\s*${EnglishDateTime.RangeConnectorRegex}\\s*(${EnglishDateTime.HourRegex}|${EnglishDateTime.PeriodHourNumRegex})(?\\s*(${EnglishDateTime.PmRegex}|${EnglishDateTime.AmRegex}|${EnglishDateTime.DescRegex}))?`; + EnglishDateTime.SpecificTimeFromTo = `((from|between)\\s+)?(?((${EnglishDateTime.TimeRegex2}|${EnglishDateTime.FirstTimeRegexInTimeRange})|(${EnglishDateTime.HourRegex}|${EnglishDateTime.PeriodHourNumRegex})(\\s*(?${EnglishDateTime.DescRegex}))?))\\s*${EnglishDateTime.TillRegex}\\s*(?((${EnglishDateTime.TimeRegex2}|${EnglishDateTime.TimeRegexWithDotConnector}(?\\s*${EnglishDateTime.DescRegex}))|(${EnglishDateTime.HourRegex}|${EnglishDateTime.PeriodHourNumRegex})(\\s*(?${EnglishDateTime.DescRegex}))?))`; + EnglishDateTime.SpecificTimeBetweenAnd = `(between\\s+)(?((${EnglishDateTime.TimeRegex2}|${EnglishDateTime.FirstTimeRegexInTimeRange})|(${EnglishDateTime.HourRegex}|${EnglishDateTime.PeriodHourNumRegex})(\\s*(?${EnglishDateTime.DescRegex}))?))\\s*${EnglishDateTime.RangeConnectorRegex}\\s*(?((${EnglishDateTime.TimeRegex2}|${EnglishDateTime.TimeRegexWithDotConnector}(?\\s*${EnglishDateTime.DescRegex}))|(${EnglishDateTime.HourRegex}|${EnglishDateTime.PeriodHourNumRegex})(\\s*(?${EnglishDateTime.DescRegex}))?))`; + EnglishDateTime.PrepositionRegex = `(?^(at|on|of)(\\s+the)?$)`; + EnglishDateTime.TimeOfDayRegex = `\\b(?((((in\\s+(the)?\\s+)?((?early(\\s+|-))|(?late(\\s+|-)))?(morning|afternoon|night|evening)))|(((in\\s+(the)?\\s+)?)(daytime|business\\s+hour)))s?)\\b`; + EnglishDateTime.SpecificTimeOfDayRegex = `\\b((${EnglishDateTime.StrictRelativeRegex}\\s+${EnglishDateTime.TimeOfDayRegex})\\b|\\btonight)s?\\b`; + EnglishDateTime.TimeFollowedUnit = `^\\s*${EnglishDateTime.TimeUnitRegex}`; + EnglishDateTime.TimeNumberCombinedWithUnit = `\\b(?\\d+(\\.\\d*)?)${EnglishDateTime.TimeUnitRegex}`; + EnglishDateTime.BusinessHourSplitStrings = ['business', 'hour']; + EnglishDateTime.NowRegex = `\\b(?(right\\s+)?now|as soon as possible|asap|recently|previously)\\b`; + EnglishDateTime.SuffixRegex = `^\\s*(in the\\s+)?(morning|afternoon|evening|night)\\b`; + EnglishDateTime.DateTimeTimeOfDayRegex = `\\b(?morning|afternoon|night|evening)\\b`; + EnglishDateTime.DateTimeSpecificTimeOfDayRegex = `\\b((${EnglishDateTime.RelativeRegex}\\s+${EnglishDateTime.DateTimeTimeOfDayRegex})\\b|\\btonight)\\b`; + EnglishDateTime.TimeOfTodayAfterRegex = `^\\s*(,\\s*)?(in\\s+)?${EnglishDateTime.DateTimeSpecificTimeOfDayRegex}`; + EnglishDateTime.TimeOfTodayBeforeRegex = `${EnglishDateTime.DateTimeSpecificTimeOfDayRegex}(\\s*,)?(\\s+(at|around|in|on))?\\s*$`; + EnglishDateTime.SimpleTimeOfTodayAfterRegex = `(${EnglishDateTime.HourNumRegex}|${baseDateTime.BaseDateTime.HourRegex})\\s*(,\\s*)?(in\\s+)?${EnglishDateTime.DateTimeSpecificTimeOfDayRegex}`; + EnglishDateTime.SimpleTimeOfTodayBeforeRegex = `\\b${EnglishDateTime.DateTimeSpecificTimeOfDayRegex}(\\s*,)?(\\s+(at|around))?\\s*(${EnglishDateTime.HourNumRegex}|${baseDateTime.BaseDateTime.HourRegex})\\b`; + EnglishDateTime.TheEndOfRegex = `(the\\s+)?end of(\\s+the)?\\s*$`; + EnglishDateTime.PeriodTimeOfDayRegex = `\\b((in\\s+(the)?\\s+)?((?early(\\s+|-))|(?late(\\s+|-)))?(?morning|afternoon|night|evening))\\b`; + EnglishDateTime.PeriodSpecificTimeOfDayRegex = `\\b((${EnglishDateTime.StrictRelativeRegex}\\s+${EnglishDateTime.PeriodTimeOfDayRegex})\\b|\\btonight)\\b`; + EnglishDateTime.PeriodTimeOfDayWithDateRegex = `\\b((${EnglishDateTime.TimeOfDayRegex}(\\s+(on|of))?))\\b`; + EnglishDateTime.LessThanRegex = `\\b(less\\s+than)\\b`; + EnglishDateTime.MoreThanRegex = `\\b(more\\s+than)\\b`; + EnglishDateTime.DurationUnitRegex = `(?${EnglishDateTime.DateUnitRegex}|hours?|hrs?|h|minutes?|mins?|seconds?|secs?)\\b`; + EnglishDateTime.SuffixAndRegex = `(?\\s*(and)\\s+((an|a)\\s+)?(?half|quarter))`; + EnglishDateTime.PeriodicRegex = `\\b(?daily|monthly|weekly|biweekly|yearly|annually|annual)\\b`; + EnglishDateTime.EachUnitRegex = `(?(each|every)(?\\s+other)?\\s*${EnglishDateTime.DurationUnitRegex})`; + EnglishDateTime.EachPrefixRegex = `\\b(?(each|(every))\\s*$)`; + EnglishDateTime.SetEachRegex = `\\b(?(each|(every))\\s*)`; + EnglishDateTime.SetLastRegex = `(?following|next|upcoming|this|last|past|previous|current)`; + EnglishDateTime.EachDayRegex = `^\\s*(each|every)\\s*day\\b`; + EnglishDateTime.DurationFollowedUnit = `^\\s*${EnglishDateTime.SuffixAndRegex}?(\\s+|-)?${EnglishDateTime.DurationUnitRegex}`; + EnglishDateTime.NumberCombinedWithDurationUnit = `\\b(?\\d+(\\.\\d*)?)(-)?${EnglishDateTime.DurationUnitRegex}`; + EnglishDateTime.AnUnitRegex = `\\b((?half\\s+)?(an|a)|another)\\s+${EnglishDateTime.DurationUnitRegex}`; + EnglishDateTime.DuringRegex = `\\b(for|during)\\s+the\\s+(?year|month|week|day)\\b`; + EnglishDateTime.AllRegex = `\\b(?(all|full|whole)(\\s+|-)(?year|month|week|day))\\b`; + EnglishDateTime.HalfRegex = `(((a|an)\\s*)|\\b)(?half\\s+(?year|month|week|day|hour))\\b`; + EnglishDateTime.ConjunctionRegex = `\\b((and(\\s+for)?)|with)\\b`; + EnglishDateTime.HolidayRegex1 = `\\b(?clean monday|good friday|ash wednesday|mardi gras|washington's birthday|mao's birthday|chinese new Year|new years' eve|new year's eve|new year 's eve|new years eve|new year eve|new years'|new year's|new year 's|new years|new year|may\\s*day|yuan dan|april fools|christmas eve|christmas|xmas|thanksgiving|halloween|yuandan|easter)(\\s+(of\\s+)?(${EnglishDateTime.YearRegex}|${EnglishDateTime.RelativeRegex}\\s+year))?\\b`; + EnglishDateTime.HolidayRegex2 = `\\b(?all saint's|tree planting day|white lover|st patrick|st george|cinco de mayo|us independence|all hallow|all souls|guy fawkes)(\\s+(of\\s+)?(${EnglishDateTime.YearRegex}|${EnglishDateTime.RelativeRegex}\\s+year))?\\b`; + EnglishDateTime.HolidayRegex3 = `(?(independence|mlk|martin luther king|martin luther king jr|canberra|easter|columbus|thanks\\s*giving|christmas|xmas|labour|(international|int'l)\\s+workers'?|mother's|mother|mothers|father's|father|fathers|female|single|teacher's|youth|children|arbor|girls|chsmilbuild|lover|labor|inauguration|groundhog|valentine's|baptiste|bastille|halloween|veterans|memorial|mid(-| )autumn|moon|spring|lantern|qingming|dragon boat|new years'|new year's|new year 's|new years|new year)\\s+(day))(\\s+(of\\s+)?(${EnglishDateTime.YearRegex}|${EnglishDateTime.RelativeRegex}\\s+year))?`; + EnglishDateTime.AMTimeRegex = `(?morning)`; + EnglishDateTime.PMTimeRegex = `\\b(?afternoon|evening|night)\\b`; + EnglishDateTime.InclusiveModPrepositions = `(?((on|in|at)\\s+or\\s+)|(\\s+or\\s+(on|in|at)))`; + EnglishDateTime.BeforeRegex = `(\\b${EnglishDateTime.InclusiveModPrepositions}?(before|in\\s+advance\\s+of|prior\\s+to|(no\\s+later|earlier|sooner)\\s+than|ending\\s+(with|on)|by|till|til|until|(?as\\s+late\\s+as))${EnglishDateTime.InclusiveModPrepositions}?\\b\\s*)|(?)((?<=)|<)`; + EnglishDateTime.AfterRegex = `(\\b${EnglishDateTime.InclusiveModPrepositions}?((after|(?>=)|>)`; + EnglishDateTime.SinceRegex = `(\\b(since|after\\s+or\\s+equal\\s+to|starting\\s+(from|on|with)|as\\s+early\\s+as|any\\s+time\\s+from)\\b\\s*)|(?=)`; + EnglishDateTime.AroundRegex = `(\\b(around|circa)\\s*\\b)`; + EnglishDateTime.AgoRegex = `\\b(ago|before\\s+(?yesterday|today))\\b`; + EnglishDateTime.LaterRegex = `\\b(later|from now|(from|after) (?tomorrow|tmr|today))\\b`; + EnglishDateTime.InConnectorRegex = `\\b(in)\\b`; + EnglishDateTime.WithinNextPrefixRegex = `\\b(within(\\s+the)?(\\s+(?${EnglishDateTime.NextPrefixRegex}))?)\\b`; + EnglishDateTime.AmPmDescRegex = `(ampm)`; + EnglishDateTime.MorningStartEndRegex = `(^(morning|${EnglishDateTime.AmDescRegex}))|((morning|${EnglishDateTime.AmDescRegex})$)`; + EnglishDateTime.AfternoonStartEndRegex = `(^(afternoon|${EnglishDateTime.PmDescRegex}))|((afternoon|${EnglishDateTime.PmDescRegex})$)`; + EnglishDateTime.EveningStartEndRegex = `(^(evening))|((evening)$)`; + EnglishDateTime.NightStartEndRegex = `(^(overnight|tonight|night))|((overnight|tonight|night)$)`; + EnglishDateTime.InexactNumberRegex = `\\b(a few|few|some|several|(?(a\\s+)?couple(\\s+of)?))\\b`; + EnglishDateTime.InexactNumberUnitRegex = `(${EnglishDateTime.InexactNumberRegex})\\s+(${EnglishDateTime.DurationUnitRegex})`; + EnglishDateTime.RelativeTimeUnitRegex = `(((${EnglishDateTime.NextPrefixRegex}|${EnglishDateTime.PastPrefixRegex}|${EnglishDateTime.ThisPrefixRegex})\\s+(${EnglishDateTime.TimeUnitRegex}))|((the|my))\\s+(${EnglishDateTime.RestrictedTimeUnitRegex}))`; + EnglishDateTime.RelativeDurationUnitRegex = `(((?<=(${EnglishDateTime.NextPrefixRegex}|${EnglishDateTime.PastPrefixRegex}|${EnglishDateTime.ThisPrefixRegex})\\s+)(${EnglishDateTime.DurationUnitRegex}))|((the|my))\\s+(${EnglishDateTime.RestrictedTimeUnitRegex}))`; + EnglishDateTime.ReferenceDatePeriodRegex = `\\b${EnglishDateTime.ReferencePrefixRegex}\\s+(?week|month|year|decade|weekend)\\b`; + EnglishDateTime.ConnectorRegex = `^(-|,|for|t|around|@)$`; + EnglishDateTime.FromToRegex = `\\b(from).+(to)\\b.+`; + EnglishDateTime.SingleAmbiguousMonthRegex = `^(the\\s+)?(may|march)$`; + EnglishDateTime.SingleAmbiguousTermsRegex = `^(the\\s+)?(day|week|month|year)$`; + EnglishDateTime.UnspecificDatePeriodRegex = `^(week|weekend|month|year)$`; + EnglishDateTime.PrepositionSuffixRegex = `\\b(on|in|at|around|from|to)$`; + EnglishDateTime.FlexibleDayRegex = `(?([A-Za-z]+\\s)?[A-Za-z\\d]+)`; + EnglishDateTime.ForTheRegex = `\\b((((?<=for\\s+)the\\s+${EnglishDateTime.FlexibleDayRegex})|((?<=on\\s+)(the\\s+)?${EnglishDateTime.FlexibleDayRegex}(?<=(st|nd|rd|th))))(?\\s*(,|\\.|!|\\?|$)))`; + EnglishDateTime.WeekDayAndDayOfMonthRegex = `\\b${EnglishDateTime.WeekDayRegex}\\s+(the\\s+${EnglishDateTime.FlexibleDayRegex})\\b`; + EnglishDateTime.RestOfDateRegex = `\\bRest\\s+(of\\s+)?((the|my|this|current)\\s+)?(?week|month|year|decade)\\b`; + EnglishDateTime.RestOfDateTimeRegex = `\\bRest\\s+(of\\s+)?((the|my|this|current)\\s+)?(?day)\\b`; + EnglishDateTime.MealTimeRegex = `\\b(at\\s+)?(?lunchtime)\\b`; + EnglishDateTime.NumberEndingPattern = `^(\\s+(?meeting|appointment|conference|call|skype call)\\s+to\\s+(?${EnglishDateTime.PeriodHourNumRegex}|${EnglishDateTime.HourRegex})((\\.)?$|(\\.,|,|!|\\?)))`; + EnglishDateTime.OneOnOneRegex = `\\b(1\\s*:\\s*1)|(one (on )?one|one\\s*-\\s*one|one\\s*:\\s*one)\\b`; + EnglishDateTime.LaterEarlyPeriodRegex = `\\b(${EnglishDateTime.PrefixPeriodRegex})\\s*\\b\\s*(?${EnglishDateTime.OneWordPeriodRegex})\\b`; + EnglishDateTime.WeekWithWeekDayRangeRegex = `\\b((?(${EnglishDateTime.NextPrefixRegex}|${EnglishDateTime.PastPrefixRegex}|this)\\s+week)((\\s+between\\s+${EnglishDateTime.WeekDayRegex}\\s+and\\s+${EnglishDateTime.WeekDayRegex})|(\\s+from\\s+${EnglishDateTime.WeekDayRegex}\\s+to\\s+${EnglishDateTime.WeekDayRegex})))\\b`; + EnglishDateTime.GeneralEndingRegex = `^\\s*((\\.,)|\\.|,|!|\\?)?\\s*$`; + EnglishDateTime.MiddlePauseRegex = `\\s*(,)\\s*`; + EnglishDateTime.DurationConnectorRegex = `^\\s*(?\\s+|and|,)\\s*$`; + EnglishDateTime.PrefixArticleRegex = `\\bthe\\s+`; + EnglishDateTime.OrRegex = `\\s*((\\b|,\\s*)(or|and)\\b|,)\\s*`; + EnglishDateTime.YearPlusNumberRegex = `\\b(Year\\s+((?(\\d{3,4}))|${EnglishDateTime.FullTextYearRegex}))\\b`; + EnglishDateTime.NumberAsTimeRegex = `\\b(${EnglishDateTime.WrittenTimeRegex}|${EnglishDateTime.PeriodHourNumRegex}|${baseDateTime.BaseDateTime.HourRegex})\\b`; + EnglishDateTime.TimeBeforeAfterRegex = `\\b(((?<=\\b(before|no later than|by|after)\\s+)(${EnglishDateTime.WrittenTimeRegex}|${EnglishDateTime.HourNumRegex}|${baseDateTime.BaseDateTime.HourRegex}|${EnglishDateTime.MidTimeRegex}))|${EnglishDateTime.MidTimeRegex})\\b`; + EnglishDateTime.DateNumberConnectorRegex = `^\\s*(?\\s+at)\\s*$`; + EnglishDateTime.DecadeRegex = `(?noughties|twenties|thirties|forties|fifties|sixties|seventies|eighties|nineties|two thousands)`; + EnglishDateTime.DecadeWithCenturyRegex = `(the\\s+)?(((?\\d|1\\d|2\\d)?(')?(?\\d0)(')?s)|((${EnglishDateTime.CenturyRegex}(\\s+|-)(and\\s+)?)?${EnglishDateTime.DecadeRegex})|(${EnglishDateTime.CenturyRegex}(\\s+|-)(and\\s+)?(?tens|hundreds)))`; + EnglishDateTime.RelativeDecadeRegex = `\\b((the\\s+)?${EnglishDateTime.RelativeRegex}\\s+((?[\\w,]+)\\s+)?decades?)\\b`; + EnglishDateTime.DateAfterRegex = `\\b((or|and)\\s+(above|after|later|greater)(?!\\s+than))\\b`; + EnglishDateTime.YearPeriodRegex = `((((from|during|in)\\s+)?${EnglishDateTime.YearRegex}\\s*(${EnglishDateTime.TillRegex})\\s*${EnglishDateTime.YearRegex})|(((between)\\s+)${EnglishDateTime.YearRegex}\\s*(${EnglishDateTime.RangeConnectorRegex})\\s*${EnglishDateTime.YearRegex}))`; + EnglishDateTime.ComplexDatePeriodRegex = `(((from|during|in)\\s+)?(?.+)\\s*(${EnglishDateTime.TillRegex})\\s*(?.+)|((between)\\s+)(?.+)\\s*(${EnglishDateTime.RangeConnectorRegex})\\s*(?.+))`; + EnglishDateTime.UnitMap = new Map([["decades", "10Y"], ["decade", "10Y"], ["years", "Y"], ["year", "Y"], ["months", "MON"], ["month", "MON"], ["weeks", "W"], ["week", "W"], ["days", "D"], ["day", "D"], ["hours", "H"], ["hour", "H"], ["hrs", "H"], ["hr", "H"], ["h", "H"], ["minutes", "M"], ["minute", "M"], ["mins", "M"], ["min", "M"], ["seconds", "S"], ["second", "S"], ["secs", "S"], ["sec", "S"]]); + EnglishDateTime.UnitValueMap = new Map([["decades", 315360000], ["decade", 315360000], ["years", 31536000], ["year", 31536000], ["months", 2592000], ["month", 2592000], ["weeks", 604800], ["week", 604800], ["days", 86400], ["day", 86400], ["hours", 3600], ["hour", 3600], ["hrs", 3600], ["hr", 3600], ["h", 3600], ["minutes", 60], ["minute", 60], ["mins", 60], ["min", 60], ["seconds", 1], ["second", 1], ["secs", 1], ["sec", 1]]); + EnglishDateTime.SeasonMap = new Map([["spring", "SP"], ["summer", "SU"], ["fall", "FA"], ["autumn", "FA"], ["winter", "WI"]]); + EnglishDateTime.SeasonValueMap = new Map([["SP", 3], ["SU", 6], ["FA", 9], ["WI", 12]]); + EnglishDateTime.CardinalMap = new Map([["first", 1], ["1st", 1], ["second", 2], ["2nd", 2], ["third", 3], ["3rd", 3], ["fourth", 4], ["4th", 4], ["fifth", 5], ["5th", 5]]); + EnglishDateTime.DayOfWeek = new Map([["monday", 1], ["tuesday", 2], ["wednesday", 3], ["thursday", 4], ["friday", 5], ["saturday", 6], ["sunday", 0], ["mon", 1], ["tue", 2], ["tues", 2], ["wed", 3], ["wedn", 3], ["weds", 3], ["thu", 4], ["thur", 4], ["thurs", 4], ["fri", 5], ["sat", 6], ["sun", 0]]); + EnglishDateTime.MonthOfYear = new Map([["1", 1], ["2", 2], ["3", 3], ["4", 4], ["5", 5], ["6", 6], ["7", 7], ["8", 8], ["9", 9], ["10", 10], ["11", 11], ["12", 12], ["january", 1], ["february", 2], ["march", 3], ["april", 4], ["may", 5], ["june", 6], ["july", 7], ["august", 8], ["september", 9], ["october", 10], ["november", 11], ["december", 12], ["jan", 1], ["feb", 2], ["mar", 3], ["apr", 4], ["jun", 6], ["jul", 7], ["aug", 8], ["sep", 9], ["sept", 9], ["oct", 10], ["nov", 11], ["dec", 12], ["01", 1], ["02", 2], ["03", 3], ["04", 4], ["05", 5], ["06", 6], ["07", 7], ["08", 8], ["09", 9]]); + EnglishDateTime.Numbers = new Map([["zero", 0], ["one", 1], ["a", 1], ["an", 1], ["two", 2], ["three", 3], ["four", 4], ["five", 5], ["six", 6], ["seven", 7], ["eight", 8], ["nine", 9], ["ten", 10], ["eleven", 11], ["twelve", 12], ["thirteen", 13], ["fourteen", 14], ["fifteen", 15], ["sixteen", 16], ["seventeen", 17], ["eighteen", 18], ["nineteen", 19], ["twenty", 20], ["twenty one", 21], ["twenty two", 22], ["twenty three", 23], ["twenty four", 24], ["twenty five", 25], ["twenty six", 26], ["twenty seven", 27], ["twenty eight", 28], ["twenty nine", 29], ["thirty", 30], ["thirty one", 31], ["thirty two", 32], ["thirty three", 33], ["thirty four", 34], ["thirty five", 35], ["thirty six", 36], ["thirty seven", 37], ["thirty eight", 38], ["thirty nine", 39], ["forty", 40], ["forty one", 41], ["forty two", 42], ["forty three", 43], ["forty four", 44], ["forty five", 45], ["forty six", 46], ["forty seven", 47], ["forty eight", 48], ["forty nine", 49], ["fifty", 50], ["fifty one", 51], ["fifty two", 52], ["fifty three", 53], ["fifty four", 54], ["fifty five", 55], ["fifty six", 56], ["fifty seven", 57], ["fifty eight", 58], ["fifty nine", 59], ["sixty", 60], ["sixty one", 61], ["sixty two", 62], ["sixty three", 63], ["sixty four", 64], ["sixty five", 65], ["sixty six", 66], ["sixty seven", 67], ["sixty eight", 68], ["sixty nine", 69], ["seventy", 70], ["seventy one", 71], ["seventy two", 72], ["seventy three", 73], ["seventy four", 74], ["seventy five", 75], ["seventy six", 76], ["seventy seven", 77], ["seventy eight", 78], ["seventy nine", 79], ["eighty", 80], ["eighty one", 81], ["eighty two", 82], ["eighty three", 83], ["eighty four", 84], ["eighty five", 85], ["eighty six", 86], ["eighty seven", 87], ["eighty eight", 88], ["eighty nine", 89], ["ninety", 90], ["ninety one", 91], ["ninety two", 92], ["ninety three", 93], ["ninety four", 94], ["ninety five", 95], ["ninety six", 96], ["ninety seven", 97], ["ninety eight", 98], ["ninety nine", 99], ["one hundred", 100]]); + EnglishDateTime.DayOfMonth = new Map([["1st", 1], ["2nd", 2], ["3rd", 3], ["4th", 4], ["5th", 5], ["6th", 6], ["7th", 7], ["8th", 8], ["9th", 9], ["10th", 10], ["11th", 11], ["11st", 11], ["12th", 12], ["12nd", 12], ["13th", 13], ["13rd", 13], ["14th", 14], ["15th", 15], ["16th", 16], ["17th", 17], ["18th", 18], ["19th", 19], ["20th", 20], ["21st", 21], ["21th", 21], ["22nd", 22], ["22th", 22], ["23rd", 23], ["23th", 23], ["24th", 24], ["25th", 25], ["26th", 26], ["27th", 27], ["28th", 28], ["29th", 29], ["30th", 30], ["31st", 31]]); + EnglishDateTime.DoubleNumbers = new Map([["half", 0.5], ["quarter", 0.25]]); + EnglishDateTime.HolidayNames = new Map([["easterday", ["easterday", "easter"]], ["fathers", ["fatherday", "fathersday"]], ["mothers", ["motherday", "mothersday"]], ["thanksgiving", ["thanksgivingday", "thanksgiving"]], ["martinlutherking", ["mlkday", "martinlutherkingday", "martinlutherkingjrday"]], ["washingtonsbirthday", ["washingtonsbirthday", "washingtonbirthday"]], ["canberra", ["canberraday"]], ["labour", ["labourday", "laborday"]], ["columbus", ["columbusday"]], ["memorial", ["memorialday"]], ["yuandan", ["yuandan"]], ["maosbirthday", ["maosbirthday"]], ["teachersday", ["teachersday", "teacherday"]], ["singleday", ["singleday"]], ["allsaintsday", ["allsaintsday"]], ["youthday", ["youthday"]], ["childrenday", ["childrenday", "childday"]], ["femaleday", ["femaleday"]], ["treeplantingday", ["treeplantingday"]], ["arborday", ["arborday"]], ["girlsday", ["girlsday"]], ["whiteloverday", ["whiteloverday"]], ["loverday", ["loverday"]], ["christmas", ["christmasday", "christmas"]], ["xmas", ["xmasday", "xmas"]], ["newyear", ["newyear"]], ["newyearday", ["newyearday"]], ["newyearsday", ["newyearsday"]], ["inaugurationday", ["inaugurationday"]], ["groundhougday", ["groundhougday"]], ["valentinesday", ["valentinesday"]], ["stpatrickday", ["stpatrickday"]], ["aprilfools", ["aprilfools"]], ["stgeorgeday", ["stgeorgeday"]], ["mayday", ["mayday", "intlworkersday", "internationalworkersday"]], ["cincodemayoday", ["cincodemayoday"]], ["baptisteday", ["baptisteday"]], ["usindependenceday", ["usindependenceday"]], ["independenceday", ["independenceday"]], ["bastilleday", ["bastilleday"]], ["halloweenday", ["halloweenday"]], ["allhallowday", ["allhallowday"]], ["allsoulsday", ["allsoulsday"]], ["guyfawkesday", ["guyfawkesday"]], ["veteransday", ["veteransday"]], ["christmaseve", ["christmaseve"]], ["newyeareve", ["newyearseve", "newyeareve"]]]); + EnglishDateTime.WrittenDecades = new Map([["hundreds", 0], ["tens", 10], ["twenties", 20], ["thirties", 30], ["forties", 40], ["fifties", 50], ["sixties", 60], ["seventies", 70], ["eighties", 80], ["nineties", 90]]); + EnglishDateTime.SpecialDecadeCases = new Map([["noughties", 2000], ["two thousands", 2000]]); + EnglishDateTime.DefaultLanguageFallback = 'MDY'; + EnglishDateTime.SuperfluousWordList = ['preferably', 'how about', 'maybe', 'say', 'like']; + EnglishDateTime.DurationDateRestrictions = ['today', 'now']; + EnglishDateTime.AmbiguityFiltersDict = new Map([["\\bmorning|afternoon|evening|night|day\\b", "\\bgood\\s+(morning|afternoon|evening|night|day)\\b"], ["\\bmay\\b", "\\b((^may i)|(i|you|he|she|we|they)\\s+may|(may\\s+((((also|not|(also not)|well)\\s+)?(be|contain|constitute|email|e-mail|take|have|result|involve|get|work|reply))|(or may not))))\\b"]]); +})(EnglishDateTime = exports.EnglishDateTime || (exports.EnglishDateTime = {})); + +}); + +unwrapExports(englishDateTime); + +var parsers$4 = createCommonjsModule(function (module, exports) { +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); + + +class DateTimeParseResult extends recognizersText.ParseResult { +} +exports.DateTimeParseResult = DateTimeParseResult; +class BaseDateParserConfiguration { + constructor() { + this.dayOfMonth = baseDateTime.BaseDateTime.DayOfMonthDictionary; + } +} +exports.BaseDateParserConfiguration = BaseDateParserConfiguration; + +}); + +unwrapExports(parsers$4); + +/** + * lodash (Custom Build) + * Build: `lodash modularize exports="npm" -o ./` + * Copyright jQuery Foundation and other contributors + * Released under MIT license + * Based on Underscore.js 1.8.3 + * Copyright Jeremy Ashkenas, DocumentCloud and Investigative Reporters & Editors + */ + +/** Used as references for various `Number` constants. */ +var NAN = 0 / 0; + +/** `Object#toString` result references. */ +var symbolTag$2 = '[object Symbol]'; + +/** Used to match leading and trailing whitespace. */ +var reTrim = /^\s+|\s+$/g; + +/** Used to detect bad signed hexadecimal string values. */ +var reIsBadHex = /^[-+]0x[0-9a-f]+$/i; + +/** Used to detect binary string values. */ +var reIsBinary = /^0b[01]+$/i; + +/** Used to detect octal string values. */ +var reIsOctal = /^0o[0-7]+$/i; + +/** Built-in method references without a dependency on `root`. */ +var freeParseInt = parseInt; + +/** Used for built-in method references. */ +var objectProto$2 = Object.prototype; + +/** + * Used to resolve the + * [`toStringTag`](http://ecma-international.org/ecma-262/7.0/#sec-object.prototype.tostring) + * of values. + */ +var objectToString$2 = objectProto$2.toString; + +/** + * Checks if `value` is the + * [language type](http://www.ecma-international.org/ecma-262/7.0/#sec-ecmascript-language-types) + * of `Object`. (e.g. arrays, functions, objects, regexes, `new Number(0)`, and `new String('')`) + * + * @static + * @memberOf _ + * @since 0.1.0 + * @category Lang + * @param {*} value The value to check. + * @returns {boolean} Returns `true` if `value` is an object, else `false`. + * @example + * + * _.isObject({}); + * // => true + * + * _.isObject([1, 2, 3]); + * // => true + * + * _.isObject(_.noop); + * // => true + * + * _.isObject(null); + * // => false + */ +function isObject(value) { + var type = typeof value; + return !!value && (type == 'object' || type == 'function'); +} + +/** + * Checks if `value` is object-like. A value is object-like if it's not `null` + * and has a `typeof` result of "object". + * + * @static + * @memberOf _ + * @since 4.0.0 + * @category Lang + * @param {*} value The value to check. + * @returns {boolean} Returns `true` if `value` is object-like, else `false`. + * @example + * + * _.isObjectLike({}); + * // => true + * + * _.isObjectLike([1, 2, 3]); + * // => true + * + * _.isObjectLike(_.noop); + * // => false + * + * _.isObjectLike(null); + * // => false + */ +function isObjectLike$2(value) { + return !!value && typeof value == 'object'; +} + +/** + * Checks if `value` is classified as a `Symbol` primitive or object. + * + * @static + * @memberOf _ + * @since 4.0.0 + * @category Lang + * @param {*} value The value to check. + * @returns {boolean} Returns `true` if `value` is a symbol, else `false`. + * @example + * + * _.isSymbol(Symbol.iterator); + * // => true + * + * _.isSymbol('abc'); + * // => false + */ +function isSymbol$2(value) { + return typeof value == 'symbol' || + (isObjectLike$2(value) && objectToString$2.call(value) == symbolTag$2); +} + +/** + * Converts `value` to a number. + * + * @static + * @memberOf _ + * @since 4.0.0 + * @category Lang + * @param {*} value The value to process. + * @returns {number} Returns the number. + * @example + * + * _.toNumber(3.2); + * // => 3.2 + * + * _.toNumber(Number.MIN_VALUE); + * // => 5e-324 + * + * _.toNumber(Infinity); + * // => Infinity + * + * _.toNumber('3.2'); + * // => 3.2 + */ +function toNumber(value) { + if (typeof value == 'number') { + return value; + } + if (isSymbol$2(value)) { + return NAN; + } + if (isObject(value)) { + var other = typeof value.valueOf == 'function' ? value.valueOf() : value; + value = isObject(other) ? (other + '') : other; + } + if (typeof value != 'string') { + return value === 0 ? value : +value; + } + value = value.replace(reTrim, ''); + var isBinary = reIsBinary.test(value); + return (isBinary || reIsOctal.test(value)) + ? freeParseInt(value.slice(2), isBinary ? 2 : 8) + : (reIsBadHex.test(value) ? NAN : +value); +} + +var lodash_tonumber = toNumber; + +var baseDate = createCommonjsModule(function (module, exports) { +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); + + + + + + +class BaseDateExtractor { + constructor(config) { + this.extractorName = constants$2.Constants.SYS_DATETIME_DATE; + this.config = config; + } + extract(source, refDate) { + if (!refDate) + refDate = new Date(); + let referenceDate = refDate; + let tokens = new Array(); + tokens = tokens.concat(this.basicRegexMatch(source)); + tokens = tokens.concat(this.implicitDate(source)); + tokens = tokens.concat(this.numberWithMonth(source, referenceDate)); + tokens = tokens.concat(this.durationWithBeforeAndAfter(source, referenceDate)); + let result = utilities$2.Token.mergeAllTokens(tokens, source, this.extractorName); + return result; + } + basicRegexMatch(source) { + let ret = []; + this.config.dateRegexList.forEach(regexp => { + let matches = recognizersText.RegExpUtility.getMatches(regexp, source); + matches.forEach(match => { + ret.push(new utilities$2.Token(match.index, match.index + match.length)); + }); + }); + return ret; + } + implicitDate(source) { + let ret = []; + this.config.implicitDateList.forEach(regexp => { + let matches = recognizersText.RegExpUtility.getMatches(regexp, source); + matches.forEach(match => { + ret.push(new utilities$2.Token(match.index, match.index + match.length)); + }); + }); + return ret; + } + numberWithMonth(source, refDate) { + let ret = []; + let er = this.config.ordinalExtractor.extract(source).concat(this.config.integerExtractor.extract(source)); + er.forEach(result => { + let num = lodash_tonumber(this.config.numberParser.parse(result).value); + if (num < 1 || num > 31) { + return; + } + if (result.start >= 0) { + let frontString = source.substring(0, result.start | 0); + let match = recognizersText.RegExpUtility.getMatches(this.config.monthEnd, frontString)[0]; + if (match && match.length) { + ret.push(new utilities$2.Token(match.index, match.index + match.length + result.length)); + return; + } + // handling cases like 'for the 25th' + let matches = recognizersText.RegExpUtility.getMatches(this.config.forTheRegex, source); + let isFound = false; + matches.forEach(matchCase => { + if (matchCase) { + let ordinalNum = matchCase.groups('DayOfMonth').value; + if (ordinalNum === result.text) { + let length = matchCase.groups('end').value.length; + ret.push(new utilities$2.Token(matchCase.index, matchCase.index + matchCase.length - length)); + isFound = true; + } + } + }); + if (isFound) { + return; + } + // handling cases like 'Thursday the 21st', which both 'Thursday' and '21st' refer to a same date + matches = recognizersText.RegExpUtility.getMatches(this.config.weekDayAndDayOfMonthRegex, source); + matches.forEach(matchCase => { + if (matchCase) { + let ordinalNum = matchCase.groups('DayOfMonth').value; + if (ordinalNum === result.text) { + let month = refDate.getMonth(); + let year = refDate.getFullYear(); + // get week of day for the ordinal number which is regarded as a date of reference month + let date = utilities$2.DateUtils.safeCreateFromMinValue(year, month, num); + let numWeekDayStr = utilities$2.DayOfWeek[date.getDay()].toString().toLowerCase(); + // get week day from text directly, compare it with the weekday generated above + // to see whether they refer to a same week day + let extractedWeekDayStr = matchCase.groups("weekday").value.toString().toLowerCase(); + if (date !== utilities$2.DateUtils.minValue() && + this.config.dayOfWeek.get(numWeekDayStr) === this.config.dayOfWeek.get(extractedWeekDayStr)) { + ret.push(new utilities$2.Token(matchCase.index, result.start + result.length)); + isFound = true; + } + } + } + }); + if (isFound) { + return; + } + // handling cases like '20th of next month' + let suffixStr = source.substr(result.start + result.length).toLowerCase(); + match = recognizersText.RegExpUtility.getMatches(this.config.relativeMonthRegex, suffixStr.trim()).pop(); + if (match && match.index === 0) { + let spaceLen = suffixStr.length - suffixStr.trim().length; + ret.push(new utilities$2.Token(result.start, result.start + result.length + spaceLen + match.length)); + } + // handling cases like 'second Sunday' + match = recognizersText.RegExpUtility.getMatches(this.config.weekDayRegex, suffixStr.trim()).pop(); + if (match && match.index === 0 && num >= 1 && num <= 5 + && result.type === recognizersTextNumber.Constants.SYS_NUM_ORDINAL) { + let weekDayStr = match.groups('weekday').value; + if (this.config.dayOfWeek.has(weekDayStr)) { + let spaceLen = suffixStr.length - suffixStr.trim().length; + ret.push(new utilities$2.Token(result.start, result.start + result.length + spaceLen + match.length)); + } + } + } + if (result.start + result.length < source.length) { + let afterString = source.substring(result.start + result.length); + let match = recognizersText.RegExpUtility.getMatches(this.config.ofMonth, afterString)[0]; + if (match && match.length) { + ret.push(new utilities$2.Token(result.start, result.start + result.length + match.length)); + return; + } + } + }); + return ret; + } + durationWithBeforeAndAfter(source, refDate) { + let ret = []; + let durEx = this.config.durationExtractor.extract(source, refDate); + durEx.forEach(er => { + let match = recognizersText.RegExpUtility.getMatches(this.config.dateUnitRegex, er.text).pop(); + if (!match) + return; + ret = utilities$2.AgoLaterUtil.extractorDurationWithBeforeAndAfter(source, er, ret, this.config.utilityConfiguration); + }); + return ret; + } +} +exports.BaseDateExtractor = BaseDateExtractor; +class BaseDateParser { + constructor(config) { + this.parserName = constants$2.Constants.SYS_DATETIME_DATE; + this.config = config; + } + parse(extractorResult, referenceDate) { + if (!referenceDate) + referenceDate = new Date(); + let resultValue; + if (extractorResult.type === this.parserName) { + let source = extractorResult.text.toLowerCase(); + let innerResult = this.parseBasicRegexMatch(source, referenceDate); + if (!innerResult.success) { + innerResult = this.parseImplicitDate(source, referenceDate); + } + if (!innerResult.success) { + innerResult = this.parseWeekdayOfMonth(source, referenceDate); + } + if (!innerResult.success) { + innerResult = this.parserDurationWithAgoAndLater(source, referenceDate); + } + if (!innerResult.success) { + innerResult = this.parseNumberWithMonth(source, referenceDate); + } + if (!innerResult.success) { + innerResult = this.parseSingleNumber(source, referenceDate); + } + if (innerResult.success) { + innerResult.futureResolution = {}; + innerResult.futureResolution[constants$2.TimeTypeConstants.DATE] = utilities$2.FormatUtil.formatDate(innerResult.futureValue); + innerResult.pastResolution = {}; + innerResult.pastResolution[constants$2.TimeTypeConstants.DATE] = utilities$2.FormatUtil.formatDate(innerResult.pastValue); + resultValue = innerResult; + } + } + let result = new parsers$4.DateTimeParseResult(extractorResult); + result.value = resultValue; + result.timexStr = resultValue ? resultValue.timex : ''; + result.resolutionStr = ''; + return result; + } + parseBasicRegexMatch(source, referenceDate) { + let trimmedSource = source.trim(); + let result = new utilities$2.DateTimeResolutionResult(); + this.config.dateRegex.some(regex => { + let offset = 0; + let match = recognizersText.RegExpUtility.getMatches(regex, trimmedSource).pop(); + if (!match) { + match = recognizersText.RegExpUtility.getMatches(regex, this.config.dateTokenPrefix + trimmedSource).pop(); + offset = this.config.dateTokenPrefix.length; + } + if (match && match.index === offset && match.length === trimmedSource.length) { + result = this.matchToDate(match, referenceDate); + return true; + } + }); + return result; + } + parseImplicitDate(source, referenceDate) { + let trimmedSource = source.trim(); + let result = new utilities$2.DateTimeResolutionResult(); + // handle "on 12" + let match = recognizersText.RegExpUtility.getMatches(this.config.onRegex, this.config.dateTokenPrefix + trimmedSource).pop(); + if (match && match.index === this.config.dateTokenPrefix.length && match.length === trimmedSource.length) { + let day = 0; + let month = referenceDate.getMonth(); + let year = referenceDate.getFullYear(); + let dayStr = match.groups('day').value; + day = this.config.dayOfMonth.get(dayStr); + result.timex = utilities$2.FormatUtil.luisDate(-1, -1, day); + let tryStr = utilities$2.FormatUtil.luisDate(year, month, day); + let tryDate = Date.parse(tryStr); + let futureDate; + let pastDate; + if (tryDate && !isNaN(tryDate)) { + futureDate = utilities$2.DateUtils.safeCreateFromMinValue(year, month, day); + pastDate = utilities$2.DateUtils.safeCreateFromMinValue(year, month, day); + if (futureDate < referenceDate) { + futureDate.setMonth(futureDate.getMonth() + 1); + } + if (pastDate >= referenceDate) { + pastDate.setMonth(pastDate.getMonth() - 1); + } + } + else { + futureDate = utilities$2.DateUtils.safeCreateFromMinValue(year, month + 1, day); + pastDate = utilities$2.DateUtils.safeCreateFromMinValue(year, month - 1, day); + } + result.futureValue = futureDate; + result.pastValue = pastDate; + result.success = true; + return result; + } + // handle "today", "the day before yesterday" + match = recognizersText.RegExpUtility.getMatches(this.config.specialDayRegex, trimmedSource).pop(); + if (match && match.index === 0 && match.length === trimmedSource.length) { + let swift = this.config.getSwiftDay(match.value); + let value = utilities$2.DateUtils.addDays(referenceDate, swift); + result.timex = utilities$2.FormatUtil.luisDateFromDate(value); + result.futureValue = value; + result.pastValue = value; + result.success = true; + return result; + } + // handle "two days from tomorrow" + match = recognizersText.RegExpUtility.getMatches(this.config.specialDayWithNumRegex, trimmedSource).pop(); + if (match && match.index === 0 && match.length === trimmedSource.length) { + let swift = this.config.getSwiftDay(match.groups('day').value); + let numErs = this.config.integerExtractor.extract(trimmedSource); + let numOfDays = Number.parseInt(this.config.numberParser.parse(numErs[0]).value); + let value = utilities$2.DateUtils.addDays(referenceDate, swift + numOfDays); + result.timex = utilities$2.FormatUtil.luisDateFromDate(value); + result.futureValue = value; + result.pastValue = value; + result.success = true; + return result; + } + // handle "two sundays from now" + match = recognizersText.RegExpUtility.getMatches(this.config.relativeWeekDayRegex, trimmedSource).pop(); + if (match && match.index === 0 && match.length === trimmedSource.length) { + let numErs = this.config.integerExtractor.extract(trimmedSource); + let num = Number.parseInt(this.config.numberParser.parse(numErs[0]).value); + let weekdayStr = match.groups('weekday').value.toLowerCase(); + let value = referenceDate; + // Check whether the determined day of this week has passed. + if (value.getDay() > this.config.dayOfWeek.get(weekdayStr)) { + num--; + } + while (num-- > 0) { + value = utilities$2.DateUtils.next(value, this.config.dayOfWeek.get(weekdayStr)); + } + result.timex = utilities$2.FormatUtil.luisDateFromDate(value); + result.futureValue = value; + result.pastValue = value; + result.success = true; + return result; + } + // handle "next Sunday" + match = recognizersText.RegExpUtility.getMatches(this.config.nextRegex, trimmedSource).pop(); + if (match && match.index === 0 && match.length === trimmedSource.length) { + let weekdayStr = match.groups('weekday').value; + let value = utilities$2.DateUtils.next(referenceDate, this.config.dayOfWeek.get(weekdayStr)); + result.timex = utilities$2.FormatUtil.luisDateFromDate(value); + result.futureValue = value; + result.pastValue = value; + result.success = true; + return result; + } + // handle "this Friday" + match = recognizersText.RegExpUtility.getMatches(this.config.thisRegex, trimmedSource).pop(); + if (match && match.index === 0 && match.length === trimmedSource.length) { + let weekdayStr = match.groups('weekday').value; + let value = utilities$2.DateUtils.this(referenceDate, this.config.dayOfWeek.get(weekdayStr)); + result.timex = utilities$2.FormatUtil.luisDateFromDate(value); + result.futureValue = value; + result.pastValue = value; + result.success = true; + return result; + } + // handle "last Friday", "last mon" + match = recognizersText.RegExpUtility.getMatches(this.config.lastRegex, trimmedSource).pop(); + if (match && match.index === 0 && match.length === trimmedSource.length) { + let weekdayStr = match.groups('weekday').value; + let value = utilities$2.DateUtils.last(referenceDate, this.config.dayOfWeek.get(weekdayStr)); + result.timex = utilities$2.FormatUtil.luisDateFromDate(value); + result.futureValue = value; + result.pastValue = value; + result.success = true; + return result; + } + // handle "Friday" + match = recognizersText.RegExpUtility.getMatches(this.config.weekDayRegex, trimmedSource).pop(); + if (match && match.index === 0 && match.length === trimmedSource.length) { + let weekdayStr = match.groups('weekday').value; + let weekday = this.config.dayOfWeek.get(weekdayStr); + let value = utilities$2.DateUtils.this(referenceDate, this.config.dayOfWeek.get(weekdayStr)); + if (weekday === 0) + weekday = 7; + if (weekday < referenceDate.getDay()) + value = utilities$2.DateUtils.next(referenceDate, weekday); + result.timex = 'XXXX-WXX-' + weekday; + let futureDate = new Date(value); + let pastDate = new Date(value); + if (futureDate < referenceDate) + futureDate.setDate(value.getDate() + 7); + if (pastDate >= referenceDate) + pastDate.setDate(value.getDate() - 7); + result.futureValue = futureDate; + result.pastValue = pastDate; + result.success = true; + return result; + } + // handle "for the 27th." + match = recognizersText.RegExpUtility.getMatches(this.config.forTheRegex, trimmedSource).pop(); + if (match) { + let dayStr = match.groups('DayOfMonth').value; + let er = recognizersText.ExtractResult.getFromText(dayStr); + let day = Number.parseInt(this.config.numberParser.parse(er).value); + let month = referenceDate.getMonth(); + let year = referenceDate.getFullYear(); + result.timex = utilities$2.FormatUtil.luisDate(-1, -1, day); + let date = new Date(year, month, day); + result.futureValue = date; + result.pastValue = date; + result.success = true; + return result; + } + // handling cases like 'Thursday the 21st', which both 'Thursday' and '21st' refer to a same date + match = recognizersText.RegExpUtility.getMatches(this.config.weekDayAndDayOfMonthRegex, trimmedSource).pop(); + if (match) { + let dayStr = match.groups('DayOfMonth').value; + let er = recognizersText.ExtractResult.getFromText(dayStr); + let day = Number.parseInt(this.config.numberParser.parse(er).value); + let month = referenceDate.getMonth(); + let year = referenceDate.getFullYear(); + // the validity of the phrase is guaranteed in the Date Extractor + result.timex = utilities$2.FormatUtil.luisDate(year, month, day); + result.futureValue = new Date(year, month, day); + result.pastValue = new Date(year, month, day); + result.success = true; + return result; + } + return result; + } + parseNumberWithMonth(source, referenceDate) { + let trimmedSource = source.trim(); + let ambiguous = true; + let result = new utilities$2.DateTimeResolutionResult(); + let ers = this.config.ordinalExtractor.extract(trimmedSource); + if (!ers || ers.length === 0) { + ers = this.config.integerExtractor.extract(trimmedSource); + } + if (!ers || ers.length === 0) + return result; + let num = Number.parseInt(this.config.numberParser.parse(ers[0]).value); + let day = 1; + let month = 0; + let match = recognizersText.RegExpUtility.getMatches(this.config.monthRegex, trimmedSource).pop(); + if (match) { + month = this.config.monthOfYear.get(match.value) - 1; + day = num; + } + else { + // handling relative month + match = recognizersText.RegExpUtility.getMatches(this.config.relativeMonthRegex, trimmedSource).pop(); + if (match) { + let monthStr = match.groups('order').value; + let swift = this.config.getSwiftMonth(monthStr); + let date = new Date(referenceDate); + date.setMonth(referenceDate.getMonth() + swift); + month = date.getMonth(); + day = num; + ambiguous = false; + } + } + // handling casesd like 'second Sunday' + if (!match) { + match = recognizersText.RegExpUtility.getMatches(this.config.weekDayRegex, trimmedSource).pop(); + if (match) { + month = referenceDate.getMonth(); + // resolve the date of wanted week day + let wantedWeekDay = this.config.dayOfWeek.get(match.groups('weekday').value); + let firstDate = utilities$2.DateUtils.safeCreateFromMinValue(referenceDate.getFullYear(), referenceDate.getMonth(), 1); + let firstWeekday = firstDate.getDay(); + let firstWantedWeekDay = new Date(firstDate); + firstWantedWeekDay.setDate(firstDate.getDate() + ((wantedWeekDay > firstWeekday) ? wantedWeekDay - firstWeekday : wantedWeekDay - firstWeekday + 7)); + day = firstWantedWeekDay.getDate() + ((num - 1) * 7); + ambiguous = false; + } + } + if (!match) + return result; + let year = referenceDate.getFullYear(); + // for LUIS format value string + let futureDate = utilities$2.DateUtils.safeCreateFromMinValue(year, month, day); + let pastDate = utilities$2.DateUtils.safeCreateFromMinValue(year, month, day); + if (ambiguous) { + result.timex = utilities$2.FormatUtil.luisDate(-1, month, day); + if (futureDate < referenceDate) + futureDate.setFullYear(year + 1); + if (pastDate >= referenceDate) + pastDate.setFullYear(year - 1); + } + else { + result.timex = utilities$2.FormatUtil.luisDate(year, month, day); + } + result.futureValue = futureDate; + result.pastValue = pastDate; + result.success = true; + return result; + } + // handle cases like "the 27th". In the extractor, only the unmatched weekday and date will output this date. + parseSingleNumber(source, referenceDate) { + let trimmedSource = source.trim(); + let result = new utilities$2.DateTimeResolutionResult(); + let er = this.config.ordinalExtractor.extract(trimmedSource).pop(); + if (!er || recognizersText.StringUtility.isNullOrEmpty(er.text)) { + er = this.config.integerExtractor.extract(trimmedSource).pop(); + } + if (!er || recognizersText.StringUtility.isNullOrEmpty(er.text)) + return result; + let day = Number.parseInt(this.config.numberParser.parse(er).value); + let month = referenceDate.getMonth(); + let year = referenceDate.getFullYear(); + result.timex = utilities$2.FormatUtil.luisDate(-1, -1, day); + let pastDate = utilities$2.DateUtils.safeCreateFromMinValue(year, month, day); + let futureDate = utilities$2.DateUtils.safeCreateFromMinValue(year, month, day); + if (futureDate !== utilities$2.DateUtils.minValue() && futureDate < referenceDate) + futureDate.setMonth(month + 1); + if (pastDate !== utilities$2.DateUtils.minValue() && pastDate >= referenceDate) + pastDate.setMonth(month - 1); + result.futureValue = futureDate; + result.pastValue = pastDate; + result.success = true; + return result; + } + parserDurationWithAgoAndLater(source, referenceDate) { + return utilities$2.AgoLaterUtil.parseDurationWithAgoAndLater(source, referenceDate, this.config.durationExtractor, this.config.durationParser, this.config.unitMap, this.config.unitRegex, this.config.utilityConfiguration, utilities$2.AgoLaterMode.Date); + } + parseWeekdayOfMonth(source, referenceDate) { + let trimmedSource = source.trim(); + let result = new utilities$2.DateTimeResolutionResult(); + let match = recognizersText.RegExpUtility.getMatches(this.config.weekDayOfMonthRegex, trimmedSource).pop(); + if (!match) + return result; + let cardinalStr = match.groups('cardinal').value; + let weekdayStr = match.groups('weekday').value; + let monthStr = match.groups('month').value; + let noYear = false; + let cardinal = this.config.isCardinalLast(cardinalStr) ? 5 : this.config.cardinalMap.get(cardinalStr); + let weekday = this.config.dayOfWeek.get(weekdayStr); + let month = referenceDate.getMonth(); + let year = referenceDate.getFullYear(); + if (recognizersText.StringUtility.isNullOrEmpty(monthStr)) { + let swift = this.config.getSwiftMonth(trimmedSource); + let temp = new Date(referenceDate); + temp.setMonth(referenceDate.getMonth() + swift); + month = temp.getMonth(); + year = temp.getFullYear(); + } + else { + month = this.config.monthOfYear.get(monthStr) - 1; + noYear = true; + } + let value = this.computeDate(cardinal, weekday, month, year); + if (value.getMonth() !== month) { + cardinal -= 1; + value.setDate(value.getDate() - 7); + } + let futureDate = value; + let pastDate = value; + if (noYear && futureDate < referenceDate) { + futureDate = this.computeDate(cardinal, weekday, month, year + 1); + if (futureDate.getMonth() !== month) + futureDate.setDate(futureDate.getDate() - 7); + } + if (noYear && pastDate >= referenceDate) { + pastDate = this.computeDate(cardinal, weekday, month, year - 1); + if (pastDate.getMonth() !== month) + pastDate.setDate(pastDate.getDate() - 7); + } + result.timex = ['XXXX', utilities$2.FormatUtil.toString(month + 1, 2), 'WXX', weekday, '#' + cardinal].join('-'); + result.futureValue = futureDate; + result.pastValue = pastDate; + result.success = true; + return result; + } + matchToDate(match, referenceDate) { + let result = new utilities$2.DateTimeResolutionResult(); + let yearStr = match.groups('year').value; + let monthStr = match.groups('month').value; + let dayStr = match.groups('day').value; + let month = 0; + let day = 0; + let year = 0; + if (this.config.monthOfYear.has(monthStr) && this.config.dayOfMonth.has(dayStr)) { + month = this.config.monthOfYear.get(monthStr) - 1; + day = this.config.dayOfMonth.get(dayStr); + if (!recognizersText.StringUtility.isNullOrEmpty(yearStr)) { + year = Number.parseInt(yearStr, 10); + if (year < 100 && year >= constants$2.Constants.MinTwoDigitYearPastNum) + year += 1900; + else if (year >= 0 && year < constants$2.Constants.MaxTwoDigitYearFutureNum) + year += 2000; + } + } + let noYear = false; + if (year === 0) { + year = referenceDate.getFullYear(); + result.timex = utilities$2.FormatUtil.luisDate(-1, month, day); + noYear = true; + } + else { + result.timex = utilities$2.FormatUtil.luisDate(year, month, day); + } + let futureDate = utilities$2.DateUtils.safeCreateFromMinValue(year, month, day); + let pastDate = utilities$2.DateUtils.safeCreateFromMinValue(year, month, day); + if (noYear && futureDate < referenceDate) { + futureDate = utilities$2.DateUtils.safeCreateFromMinValue(year + 1, month, day); + } + if (noYear && pastDate >= referenceDate) { + pastDate = utilities$2.DateUtils.safeCreateFromMinValue(year - 1, month, day); + } + result.futureValue = futureDate; + result.pastValue = pastDate; + result.success = true; + return result; + } + computeDate(cardinal, weekday, month, year) { + let firstDay = new Date(year, month, 1); + let firstWeekday = utilities$2.DateUtils.this(firstDay, weekday); + let dayOfWeekOfFirstDay = firstDay.getDay(); + if (weekday === 0) + weekday = 7; + if (dayOfWeekOfFirstDay === 0) + dayOfWeekOfFirstDay = 7; + if (weekday < dayOfWeekOfFirstDay) + firstWeekday = utilities$2.DateUtils.next(firstDay, weekday); + firstWeekday.setDate(firstWeekday.getDate() + (7 * (cardinal - 1))); + return firstWeekday; + } +} +exports.BaseDateParser = BaseDateParser; + +}); + +unwrapExports(baseDate); + +var baseTime = createCommonjsModule(function (module, exports) { +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); + + + + +class BaseTimeExtractor { + constructor(config) { + this.extractorName = constants$2.Constants.SYS_DATETIME_TIME; // "Time"; + this.config = config; + } + extract(text, refDate) { + if (!refDate) + refDate = new Date(); + let referenceDate = refDate; + let tokens = new Array() + .concat(this.basicRegexMatch(text)) + .concat(this.atRegexMatch(text)) + .concat(this.specialsRegexMatch(text, referenceDate)); + let result = utilities$2.Token.mergeAllTokens(tokens, text, this.extractorName); + return result; + } + basicRegexMatch(text) { + let ret = []; + this.config.timeRegexList.forEach(regexp => { + let matches = recognizersTextNumber.RegExpUtility.getMatches(regexp, text); + matches.forEach(match => { + ret.push(new utilities$2.Token(match.index, match.index + match.length)); + }); + }); + return ret; + } + atRegexMatch(text) { + let ret = []; + // handle "at 5", "at seven" + let matches = recognizersTextNumber.RegExpUtility.getMatches(this.config.atRegex, text); + matches.forEach(match => { + if (match.index + match.length < text.length && + text.charAt(match.index + match.length) === '%') { + return; + } + ret.push(new utilities$2.Token(match.index, match.index + match.length)); + }); + return ret; + } + specialsRegexMatch(text, refDate) { + let ret = []; + // handle "ish" + if (this.config.ishRegex !== null) { + let matches = recognizersTextNumber.RegExpUtility.getMatches(this.config.ishRegex, text); + matches.forEach(match => { + ret.push(new utilities$2.Token(match.index, match.index + match.length)); + }); + } + return ret; + } +} +exports.BaseTimeExtractor = BaseTimeExtractor; +class BaseTimeParser { + constructor(configuration) { + this.ParserName = constants$2.Constants.SYS_DATETIME_TIME; // "Time"; + this.config = configuration; + } + parse(er, referenceTime) { + if (!referenceTime) + referenceTime = new Date(); + let value = null; + if (er.type === this.ParserName) { + let innerResult = this.internalParse(er.text, referenceTime); + if (innerResult.success) { + innerResult.futureResolution = {}; + innerResult.futureResolution[constants$2.TimeTypeConstants.TIME] = utilities$2.FormatUtil.formatTime(innerResult.futureValue); + innerResult.pastResolution = {}; + innerResult.pastResolution[constants$2.TimeTypeConstants.TIME] = utilities$2.FormatUtil.formatTime(innerResult.pastValue); + value = innerResult; + } + } + let ret = new parsers$4.DateTimeParseResult(er); + ret.value = value, ret.timexStr = value === null ? "" : value.timex, ret.resolutionStr = ""; + return ret; + } + internalParse(text, referenceTime) { + let innerResult = this.parseBasicRegexMatch(text, referenceTime); + return innerResult; + } + // parse basic patterns in TimeRegexList + parseBasicRegexMatch(text, referenceTime) { + let trimmedText = text.trim().toLowerCase(); + let offset = 0; + let matches = recognizersTextNumber.RegExpUtility.getMatches(this.config.atRegex, trimmedText); + if (matches.length === 0) { + matches = recognizersTextNumber.RegExpUtility.getMatches(this.config.atRegex, this.config.timeTokenPrefix + trimmedText); + offset = this.config.timeTokenPrefix.length; + } + if (matches.length > 0 && matches[0].index === offset && matches[0].length === trimmedText.length) { + return this.match2Time(matches[0], referenceTime); + } + // parse hour pattern, like "twenty one", "16" + // create a extract result which content the pass-in text + let hour = this.config.numbers.get(text) || Number(text); + if (hour) { + if (hour >= 0 && hour <= 24) { + let ret = new utilities$2.DateTimeResolutionResult(); + if (hour === 24) { + hour = 0; + } + if (hour <= 12 && hour !== 0) { + ret.comment = "ampm"; + } + ret.timex = "T" + utilities$2.FormatUtil.toString(hour, 2); + ret.futureValue = ret.pastValue = + utilities$2.DateUtils.safeCreateFromMinValue(referenceTime.getFullYear(), referenceTime.getMonth(), referenceTime.getDate(), hour, 0, 0); + ret.success = true; + return ret; + } + } + for (let regex of this.config.timeRegexes) { + offset = 0; + matches = recognizersTextNumber.RegExpUtility.getMatches(regex, trimmedText); + if (matches.length && matches[0].index === offset && matches[0].length === trimmedText.length) { + return this.match2Time(matches[0], referenceTime); + } + } + return new utilities$2.DateTimeResolutionResult(); + } + match2Time(match, referenceTime) { + let ret = new utilities$2.DateTimeResolutionResult(); + let hour = 0; + let min = 0; + let second = 0; + let day = referenceTime.getDate(); + let month = referenceTime.getMonth(); + let year = referenceTime.getFullYear(); + let hasMin = false; + let hasSec = false; + let hasAm = false; + let hasPm = false; + let hasMid = false; + let engTimeStr = match.groups('engtime').value; + if (!recognizersTextNumber.StringUtility.isNullOrWhitespace(engTimeStr)) { + // get hour + let hourStr = match.groups('hournum').value.toLowerCase(); + hour = this.config.numbers.get(hourStr); + // get minute + let minStr = match.groups('minnum').value; + let tensStr = match.groups('tens').value; + if (!recognizersTextNumber.StringUtility.isNullOrWhitespace(minStr)) { + min = this.config.numbers.get(minStr); + if (tensStr) { + min += this.config.numbers.get(tensStr); + } + hasMin = true; + } + } + else if (!recognizersTextNumber.StringUtility.isNullOrWhitespace(match.groups('mid').value)) { + hasMid = true; + if (!recognizersTextNumber.StringUtility.isNullOrWhitespace(match.groups('midnight').value)) { + hour = 0; + min = 0; + second = 0; + } + else if (!recognizersTextNumber.StringUtility.isNullOrWhitespace(match.groups('midmorning').value)) { + hour = 10; + min = 0; + second = 0; + } + else if (!recognizersTextNumber.StringUtility.isNullOrWhitespace(match.groups('midafternoon').value)) { + hour = 14; + min = 0; + second = 0; + } + else if (!recognizersTextNumber.StringUtility.isNullOrWhitespace(match.groups('midday').value)) { + hour = 12; + min = 0; + second = 0; + } + } + else { + // get hour + let hourStr = match.groups('hour').value; + if (recognizersTextNumber.StringUtility.isNullOrWhitespace(hourStr)) { + hourStr = match.groups('hournum').value.toLowerCase(); + hour = this.config.numbers.get(hourStr); + if (!hour) { + return ret; + } + } + else { + hour = Number.parseInt(hourStr, 10); + if (!hour) { + hour = this.config.numbers.get(hourStr); + if (!hour) { + return ret; + } + } + } + // get minute + let minStr = match.groups('min').value.toLowerCase(); + if (recognizersTextNumber.StringUtility.isNullOrWhitespace(minStr)) { + minStr = match.groups('minnum').value; + if (!recognizersTextNumber.StringUtility.isNullOrWhitespace(minStr)) { + min = this.config.numbers.get(minStr); + hasMin = true; + } + let tensStr = match.groups('tens').value; + if (!recognizersTextNumber.StringUtility.isNullOrWhitespace(tensStr)) { + min += this.config.numbers.get(tensStr); + hasMin = true; + } + } + else { + min = Number.parseInt(minStr, 10); + hasMin = true; + } + // get second + let secStr = match.groups('sec').value.toLowerCase(); + if (!recognizersTextNumber.StringUtility.isNullOrWhitespace(secStr)) { + second = Number.parseInt(secStr, 10); + hasSec = true; + } + } + // adjust by desc string + let descStr = match.groups('desc').value.toLowerCase(); + if (recognizersTextNumber.RegExpUtility.getMatches(this.config.utilityConfiguration.amDescRegex, descStr).length > 0 + || recognizersTextNumber.RegExpUtility.getMatches(this.config.utilityConfiguration.amPmDescRegex, descStr).length > 0 + || !recognizersTextNumber.StringUtility.isNullOrEmpty(match.groups('iam').value)) { + if (hour >= 12) { + hour -= 12; + } + if (recognizersTextNumber.RegExpUtility.getMatches(this.config.utilityConfiguration.amPmDescRegex, descStr).length === 0) { + hasAm = true; + } + } + else if (recognizersTextNumber.RegExpUtility.getMatches(this.config.utilityConfiguration.pmDescRegex, descStr).length > 0 + || !recognizersTextNumber.StringUtility.isNullOrEmpty(match.groups('ipm').value)) { + if (hour < 12) { + hour += 12; + } + hasPm = true; + } + // adjust min by prefix + let timePrefix = match.groups('prefix').value.toLowerCase(); + if (!recognizersTextNumber.StringUtility.isNullOrWhitespace(timePrefix)) { + let adjust = { hour: hour, min: min, hasMin: hasMin }; + this.config.adjustByPrefix(timePrefix, adjust); + hour = adjust.hour; + min = adjust.min; + hasMin = adjust.hasMin; + } + // adjust hour by suffix + let timeSuffix = match.groups('suffix').value.toLowerCase(); + if (!recognizersTextNumber.StringUtility.isNullOrWhitespace(timeSuffix)) { + let adjust = { hour: hour, min: min, hasMin: hasMin, hasAm: hasAm, hasPm: hasPm }; + this.config.adjustBySuffix(timeSuffix, adjust); + hour = adjust.hour; + min = adjust.min; + hasMin = adjust.hasMin; + hasAm = adjust.hasAm; + hasPm = adjust.hasPm; + } + if (hour === 24) { + hour = 0; + } + ret.timex = "T" + utilities$2.FormatUtil.toString(hour, 2); + if (hasMin) { + ret.timex += ":" + utilities$2.FormatUtil.toString(min, 2); + } + if (hasSec) { + ret.timex += ":" + utilities$2.FormatUtil.toString(second, 2); + } + if (hour <= 12 && !hasPm && !hasAm && !hasMid) { + ret.comment = "ampm"; + } + ret.futureValue = ret.pastValue = new Date(year, month, day, hour, min, second); + ret.success = true; + return ret; + } +} +exports.BaseTimeParser = BaseTimeParser; + +}); + +unwrapExports(baseTime); + +var baseDatePeriod = createCommonjsModule(function (module, exports) { +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); + + + + +class BaseDatePeriodExtractor { + constructor(config) { + this.extractorName = constants$2.Constants.SYS_DATETIME_DATEPERIOD; + this.config = config; + } + extract(source, refDate) { + if (!refDate) + refDate = new Date(); + let referenceDate = refDate; + let tokens = new Array(); + tokens = tokens.concat(this.matchSimpleCases(source)); + tokens = tokens.concat(this.mergeTwoTimePoints(source, referenceDate)); + tokens = tokens.concat(this.matchDuration(source, referenceDate)); + tokens = tokens.concat(this.singleTimePointWithPatterns(source, referenceDate)); + let result = utilities$2.Token.mergeAllTokens(tokens, source, this.extractorName); + return result; + } + matchSimpleCases(source) { + let tokens = new Array(); + this.config.simpleCasesRegexes.forEach(regexp => { + recognizersText.RegExpUtility.getMatches(regexp, source).forEach(match => { + let addToken = true; + let matchYear = recognizersText.RegExpUtility.getMatches(this.config.YearRegex, match.value).pop(); + if (matchYear && matchYear.length === match.value.length) { + let yearStr = matchYear.groups('year').value; + if (recognizersText.StringUtility.isNullOrEmpty(yearStr)) { + let year = this.getYearFromText(matchYear); + if (!(year >= constants$2.Constants.MinYearNum && year <= constants$2.Constants.MaxYearNum)) { + addToken = false; + } + } + } + if (match.length === constants$2.Constants.FourDigitsYearLength && recognizersText.RegExpUtility.isMatch(this.config.YearRegex, match.value) && this.infixBoundaryCheck(match, source)) { + let substr = source.substr(match.index - 1, 6); + if (recognizersText.RegExpUtility.isMatch(this.config.illegalYearRegex, substr)) { + addToken = false; + } + } + if (addToken) { + tokens.push(new utilities$2.Token(match.index, match.index + match.length)); + } + }); + }); + return tokens; + } + getYearFromText(match) { + let firstTwoYearNumStr = match.groups('firsttwoyearnum').value; + if (!recognizersText.StringUtility.isNullOrEmpty(firstTwoYearNumStr)) { + let er = new recognizersText.ExtractResult(); + er.text = firstTwoYearNumStr; + er.start = match.groups('firsttwoyearnum').index; + er.length = match.groups('firsttwoyearnum').length; + let firstTwoYearNum = Number.parseInt(this.config.numberParser.parse(er).value); + let lastTwoYearNum = 0; + let lastTwoYearNumStr = match.groups('lasttwoyearnum').value; + if (!recognizersText.StringUtility.isNullOrEmpty(lastTwoYearNumStr)) { + er.text = lastTwoYearNumStr; + er.start = match.groups('lasttwoyearnum').index; + er.length = match.groups('lasttwoyearnum').length; + lastTwoYearNum = Number.parseInt(this.config.numberParser.parse(er).value); + } + if (firstTwoYearNum < 100 && lastTwoYearNum === 0 || firstTwoYearNum < 100 && firstTwoYearNum % 10 === 0 && lastTwoYearNumStr.trim().split(' ').length === 1) { + return -1; + } + if (firstTwoYearNum >= 100) { + return (firstTwoYearNum + lastTwoYearNum); + } + else { + return (firstTwoYearNum * 100 + lastTwoYearNum); + } + } + else { + return -1; + } + } + mergeTwoTimePoints(source, refDate) { + let tokens = new Array(); + let er = this.config.datePointExtractor.extract(source, refDate); + if (er.length <= 1) { + return tokens; + } + let idx = 0; + while (idx < er.length - 1) { + let middleBegin = er[idx].start + (er[idx].length || 0); + let middleEnd = er[idx + 1].start || 0; + if (middleBegin >= middleEnd) { + idx++; + continue; + } + let middleStr = source.substr(middleBegin, middleEnd - middleBegin).trim().toLowerCase(); + let match = recognizersText.RegExpUtility.getMatches(this.config.tillRegex, middleStr); + if (match && match.length > 0 && match[0].index === 0 && match[0].length === middleStr.length) { + let periodBegin = er[idx].start || 0; + let periodEnd = (er[idx + 1].start || 0) + (er[idx + 1].length || 0); + let beforeStr = source.substring(0, periodBegin).trim().toLowerCase(); + let fromTokenIndex = this.config.getFromTokenIndex(beforeStr); + let betweenTokenIndex = this.config.getBetweenTokenIndex(beforeStr); + if (fromTokenIndex.matched || betweenTokenIndex.matched) { + periodBegin = fromTokenIndex.matched ? fromTokenIndex.index : betweenTokenIndex.index; + } + tokens.push(new utilities$2.Token(periodBegin, periodEnd)); + idx += 2; + continue; + } + if (this.config.hasConnectorToken(middleStr)) { + let periodBegin = er[idx].start || 0; + let periodEnd = (er[idx + 1].start || 0) + (er[idx + 1].length || 0); + let beforeStr = source.substring(0, periodBegin).trim().toLowerCase(); + let betweenTokenIndex = this.config.getBetweenTokenIndex(beforeStr); + if (betweenTokenIndex.matched) { + periodBegin = betweenTokenIndex.index; + tokens.push(new utilities$2.Token(periodBegin, periodEnd)); + idx += 2; + continue; + } + } + idx++; + } + return tokens; + } + matchDuration(source, refDate) { + let tokens = new Array(); + let durations = new Array(); + this.config.durationExtractor.extract(source, refDate).forEach(durationEx => { + let match = recognizersText.RegExpUtility.getMatches(this.config.dateUnitRegex, durationEx.text).pop(); + if (match) { + durations.push(new utilities$2.Token(durationEx.start, durationEx.start + durationEx.length)); + } + }); + durations.forEach(duration => { + let beforeStr = source.substring(0, duration.start).toLowerCase(); + if (recognizersText.StringUtility.isNullOrWhitespace(beforeStr)) + return; + let match = recognizersText.RegExpUtility.getMatches(this.config.pastRegex, beforeStr).pop(); + if (this.matchRegexInPrefix(beforeStr, match)) { + tokens.push(new utilities$2.Token(match.index, duration.end)); + return; + } + match = recognizersText.RegExpUtility.getMatches(this.config.futureRegex, beforeStr).pop(); + if (this.matchRegexInPrefix(beforeStr, match)) { + tokens.push(new utilities$2.Token(match.index, duration.end)); + return; + } + match = recognizersText.RegExpUtility.getMatches(this.config.inConnectorRegex, beforeStr).pop(); + if (this.matchRegexInPrefix(beforeStr, match)) { + let rangeStr = source.substr(duration.start, duration.length); + let rangeMatch = recognizersText.RegExpUtility.getMatches(this.config.rangeUnitRegex, rangeStr).pop(); + if (rangeMatch) { + tokens.push(new utilities$2.Token(match.index, duration.end)); + } + return; + } + }); + return tokens; + } + singleTimePointWithPatterns(source, refDate) { + let tokens = new Array(); + let ers = this.config.datePointExtractor.extract(source, refDate); + if (ers.length < 1) + return tokens; + ers.forEach(er => { + if (er.start && er.length) { + let beforeStr = source.substring(0, er.start); + tokens = tokens + .concat(this.getTokenForRegexMatching(beforeStr, this.config.weekOfRegex, er)) + .concat(this.getTokenForRegexMatching(beforeStr, this.config.monthOfRegex, er)); + } + }); + return tokens; + } + getTokenForRegexMatching(source, regexp, er) { + let tokens = new Array(); + let match = recognizersText.RegExpUtility.getMatches(regexp, source).shift(); + if (match && source.trim().endsWith(match.value.trim())) { + let startIndex = source.lastIndexOf(match.value); + tokens.push(new utilities$2.Token(startIndex, er.start + er.length)); + } + return tokens; + } + matchRegexInPrefix(source, match) { + return (match && recognizersText.StringUtility.isNullOrWhitespace(source.substring(match.index + match.length))); + } + infixBoundaryCheck(match, source) { + let isMatchInfixOfSource = false; + if (match.index > 0 && match.index + match.length < source.length) { + if (source.substr(match.index, match.length) === match.value) { + isMatchInfixOfSource = true; + } + } + return isMatchInfixOfSource; + } +} +exports.BaseDatePeriodExtractor = BaseDatePeriodExtractor; +class BaseDatePeriodParser { + constructor(config, inclusiveEndPeriod = false) { + this.parserName = constants$2.Constants.SYS_DATETIME_DATEPERIOD; + this.weekOfComment = 'WeekOf'; + this.monthOfComment = 'MonthOf'; + this.config = config; + this.inclusiveEndPeriod = inclusiveEndPeriod; + } + parse(extractorResult, referenceDate) { + if (!referenceDate) + referenceDate = new Date(); + let resultValue; + if (extractorResult.type === this.parserName) { + let source = extractorResult.text.trim().toLowerCase(); + let innerResult = this.parseMonthWithYear(source, referenceDate); + if (!innerResult.success) { + innerResult = this.parseSimpleCases(source, referenceDate); + } + if (!innerResult.success) { + innerResult = this.parseOneWordPeriod(source, referenceDate); + } + if (!innerResult.success) { + innerResult = this.mergeTwoTimePoints(source, referenceDate); + } + if (!innerResult.success) { + innerResult = this.parseYear(source, referenceDate); + } + if (!innerResult.success) { + innerResult = this.parseWeekOfMonth(source, referenceDate); + } + if (!innerResult.success) { + innerResult = this.parseWeekOfYear(source, referenceDate); + } + if (!innerResult.success) { + innerResult = this.parseHalfYear(source, referenceDate); + } + if (!innerResult.success) { + innerResult = this.parseQuarter(source, referenceDate); + } + if (!innerResult.success) { + innerResult = this.parseSeason(source, referenceDate); + } + if (!innerResult.success) { + innerResult = this.parseWhichWeek(source, referenceDate); + } + if (!innerResult.success) { + innerResult = this.parseWeekOfDate(source, referenceDate); + } + if (!innerResult.success) { + innerResult = this.parseMonthOfDate(source, referenceDate); + } + // parse duration should be at the end since it will extract "the last week" from "the last week of July" + if (!innerResult.success) { + innerResult = this.parseDuration(source, referenceDate); + } + if (innerResult.success) { + if (innerResult.futureValue && innerResult.pastValue) { + innerResult.futureResolution = {}; + innerResult.futureResolution[constants$2.TimeTypeConstants.START_DATE] = utilities$2.FormatUtil.formatDate(innerResult.futureValue[0]); + innerResult.futureResolution[constants$2.TimeTypeConstants.END_DATE] = utilities$2.FormatUtil.formatDate(innerResult.futureValue[1]); + innerResult.pastResolution = {}; + innerResult.pastResolution[constants$2.TimeTypeConstants.START_DATE] = utilities$2.FormatUtil.formatDate(innerResult.pastValue[0]); + innerResult.pastResolution[constants$2.TimeTypeConstants.END_DATE] = utilities$2.FormatUtil.formatDate(innerResult.pastValue[1]); + } + else { + innerResult.futureResolution = {}; + innerResult.pastResolution = {}; + } + resultValue = innerResult; + } + } + let result = new parsers$4.DateTimeParseResult(extractorResult); + result.value = resultValue; + result.timexStr = resultValue ? resultValue.timex : ''; + result.resolutionStr = ''; + return result; + } + parseMonthWithYear(source, referenceDate) { + let trimmedSource = source.trim().toLowerCase(); + let result = new utilities$2.DateTimeResolutionResult(); + let match = recognizersText.RegExpUtility.getMatches(this.config.monthWithYear, trimmedSource).pop(); + if (!match) { + match = recognizersText.RegExpUtility.getMatches(this.config.monthNumWithYear, trimmedSource).pop(); + } + if (!match || match.length !== trimmedSource.length) + return result; + let monthStr = match.groups('month').value; + let yearStr = match.groups('year').value; + let orderStr = match.groups('order').value; + let month = this.config.monthOfYear.get(monthStr) - 1; + let year = Number.parseInt(yearStr, 10); + if (!year || isNaN(year)) { + let swift = this.config.getSwiftYear(orderStr); + if (swift < -1) + return result; + year = referenceDate.getFullYear() + swift; + } + let beginDate = utilities$2.DateUtils.safeCreateFromValue(utilities$2.DateUtils.minValue(), year, month, 1); + let endDate = utilities$2.DateUtils.addDays(utilities$2.DateUtils.addMonths(beginDate, 1), this.inclusiveEndPeriod ? -1 : 0); + result.futureValue = [beginDate, endDate]; + result.pastValue = [beginDate, endDate]; + result.timex = `${utilities$2.FormatUtil.toString(year, 4)}-${utilities$2.FormatUtil.toString(month + 1, 2)}`; + result.success = true; + return result; + } + getMatchSimpleCase(source) { + let match = recognizersText.RegExpUtility.getMatches(this.config.monthFrontBetweenRegex, source).pop(); + if (!match) { + match = recognizersText.RegExpUtility.getMatches(this.config.betweenRegex, source).pop(); + } + if (!match) { + match = recognizersText.RegExpUtility.getMatches(this.config.monthFrontSimpleCasesRegex, source).pop(); + } + if (!match) { + match = recognizersText.RegExpUtility.getMatches(this.config.simpleCasesRegex, source).pop(); + } + return match; + } + parseSimpleCases(source, referenceDate) { + let result = new utilities$2.DateTimeResolutionResult(); + let year = referenceDate.getFullYear(); + let month = referenceDate.getMonth(); + let noYear = true; + let match = this.getMatchSimpleCase(source); + if (!match || match.index !== 0 || match.length !== source.length) + return result; + let days = match.groups('day'); + let beginDay = this.config.dayOfMonth.get(days.captures[0]); + let endDay = this.config.dayOfMonth.get(days.captures[1]); + let yearStr = match.groups('year').value; + if (!recognizersText.StringUtility.isNullOrEmpty(yearStr)) { + year = Number.parseInt(yearStr, 10); + noYear = false; + } + let monthStr = match.groups('month').value; + if (!recognizersText.StringUtility.isNullOrEmpty(monthStr)) { + month = this.config.monthOfYear.get(monthStr) - 1; + } + else { + monthStr = match.groups('relmonth').value; + month += this.config.getSwiftDayOrMonth(monthStr); + if (month < 0) { + month = 0; + year--; + } + else if (month > 11) { + month = 11; + year++; + } + if (this.config.isFuture(monthStr)) { + noYear = false; + } + } + let beginDateLuis = utilities$2.FormatUtil.luisDate(noYear ? -1 : year, month, beginDay); + let endDateLuis = utilities$2.FormatUtil.luisDate(noYear ? -1 : year, month, endDay); + let futureYear = year; + let pastYear = year; + let startDate = utilities$2.DateUtils.safeCreateFromValue(utilities$2.DateUtils.minValue(), year, month, beginDay); + if (noYear && startDate < referenceDate) + futureYear++; + if (noYear && startDate >= referenceDate) + pastYear--; + result.timex = `(${beginDateLuis},${endDateLuis},P${endDay - beginDay}D)`; + result.futureValue = [ + utilities$2.DateUtils.safeCreateFromValue(utilities$2.DateUtils.minValue(), futureYear, month, beginDay), + utilities$2.DateUtils.safeCreateFromValue(utilities$2.DateUtils.minValue(), futureYear, month, endDay), + ]; + result.pastValue = [ + utilities$2.DateUtils.safeCreateFromValue(utilities$2.DateUtils.minValue(), pastYear, month, beginDay), + utilities$2.DateUtils.safeCreateFromValue(utilities$2.DateUtils.minValue(), pastYear, month, endDay), + ]; + result.success = true; + return result; + } + parseOneWordPeriod(source, referenceDate) { + let result = new utilities$2.DateTimeResolutionResult(); + let year = referenceDate.getFullYear(); + let month = referenceDate.getMonth(); + let earlyPrefix = false; + let latePrefix = false; + let earlierPrefix = false; + let laterPrefix = false; + if (this.config.isYearToDate(source)) { + result.timex = utilities$2.FormatUtil.toString(year, 4); + result.futureValue = [utilities$2.DateUtils.safeCreateFromValue(utilities$2.DateUtils.minValue(), year, 0, 1), referenceDate]; + result.pastValue = [utilities$2.DateUtils.safeCreateFromValue(utilities$2.DateUtils.minValue(), year, 0, 1), referenceDate]; + result.success = true; + return result; + } + if (this.config.isMonthToDate(source)) { + result.timex = `${utilities$2.FormatUtil.toString(year, 4)}-${utilities$2.FormatUtil.toString(month + 1, 2)}`; + result.futureValue = [utilities$2.DateUtils.safeCreateFromValue(utilities$2.DateUtils.minValue(), year, month, 1), referenceDate]; + result.pastValue = [utilities$2.DateUtils.safeCreateFromValue(utilities$2.DateUtils.minValue(), year, month, 1), referenceDate]; + result.success = true; + return result; + } + let futureYear = year; + let pastYear = year; + let trimedText = source.trim().toLowerCase(); + let match = recognizersText.RegExpUtility.getMatches(this.config.oneWordPeriodRegex, trimedText).pop(); + if (!(match && match.index === 0 && match.length === trimedText.length)) { + match = recognizersText.RegExpUtility.getMatches(this.config.laterEarlyPeriodRegex, trimedText).pop(); + } + if (!match || match.index !== 0 || match.length !== trimedText.length) + return result; + if (match.groups("EarlyPrefix").value) { + earlyPrefix = true; + trimedText = match.groups("suffix").value; + result.mod = constants$2.Constants.EARLY_MOD; + } + if (match.groups("LatePrefix").value) { + latePrefix = true; + trimedText = match.groups("suffix").value; + result.mod = constants$2.Constants.LATE_MOD; + } + if (match.groups("MidPrefix").value) { + latePrefix = true; + trimedText = match.groups("suffix").value; + result.mod = constants$2.Constants.MID_MOD; + } + if (match.groups("RelEarly").value) { + earlierPrefix = true; + result.mod = null; + } + if (match.groups("RelLate").value) { + laterPrefix = true; + result.mod = null; + } + let monthStr = match.groups('month').value; + if (!recognizersText.StringUtility.isNullOrEmpty(monthStr)) { + let swift = this.config.getSwiftYear(trimedText); + month = this.config.monthOfYear.get(monthStr) - 1; + if (swift >= -1) { + result.timex = `${utilities$2.FormatUtil.toString(year + swift, 4)}-${utilities$2.FormatUtil.toString(month + 1, 2)}`; + year += swift; + futureYear = year; + pastYear = year; + } + else { + result.timex = `XXXX-${utilities$2.FormatUtil.toString(month + 1, 2)}`; + if (month < referenceDate.getMonth()) + futureYear++; + if (month >= referenceDate.getMonth()) + pastYear--; + } + } + else { + let swift = this.config.getSwiftDayOrMonth(trimedText); + if (this.config.isWeekOnly(trimedText)) { + let monday = utilities$2.DateUtils.addDays(utilities$2.DateUtils.this(referenceDate, utilities$2.DayOfWeek.Monday), 7 * swift); + result.timex = `${utilities$2.FormatUtil.toString(monday.getFullYear(), 4)}-W${utilities$2.FormatUtil.toString(utilities$2.DateUtils.getWeekNumber(monday).weekNo, 2)}`; + let beginDate = utilities$2.DateUtils.addDays(utilities$2.DateUtils.this(referenceDate, utilities$2.DayOfWeek.Monday), 7 * swift); + let endDate = this.inclusiveEndPeriod + ? utilities$2.DateUtils.addDays(utilities$2.DateUtils.this(referenceDate, utilities$2.DayOfWeek.Sunday), 7 * swift) + : utilities$2.DateUtils.addDays(utilities$2.DateUtils.addDays(utilities$2.DateUtils.this(referenceDate, utilities$2.DayOfWeek.Sunday), 7 * swift), 1); + if (earlyPrefix) { + endDate = this.inclusiveEndPeriod + ? utilities$2.DateUtils.addDays(utilities$2.DateUtils.this(referenceDate, utilities$2.DayOfWeek.Wednesday), 7 * swift) + : utilities$2.DateUtils.addDays(utilities$2.DateUtils.addDays(utilities$2.DateUtils.this(referenceDate, utilities$2.DayOfWeek.Wednesday), 7 * swift), 1); + } + if (latePrefix) { + beginDate = utilities$2.DateUtils.addDays(utilities$2.DateUtils.this(referenceDate, utilities$2.DayOfWeek.Thursday), 7 * swift); + } + if (earlierPrefix && swift === 0) { + if (endDate > referenceDate) { + endDate = referenceDate; + } + } + else if (laterPrefix && swift === 0) { + if (beginDate < referenceDate) { + beginDate = referenceDate; + } + } + result.futureValue = [beginDate, endDate]; + result.pastValue = [beginDate, endDate]; + result.success = true; + return result; + } + if (this.config.isWeekend(trimedText)) { + let beginDate = utilities$2.DateUtils.addDays(utilities$2.DateUtils.this(referenceDate, utilities$2.DayOfWeek.Saturday), 7 * swift); + let endDate = utilities$2.DateUtils.addDays(utilities$2.DateUtils.this(referenceDate, utilities$2.DayOfWeek.Sunday), (7 * swift) + (this.inclusiveEndPeriod ? 0 : 1)); + result.timex = `${utilities$2.FormatUtil.toString(beginDate.getFullYear(), 4)}-W${utilities$2.FormatUtil.toString(utilities$2.DateUtils.getWeekNumber(beginDate).weekNo, 2)}-WE`; + result.futureValue = [beginDate, endDate]; + result.pastValue = [beginDate, endDate]; + result.success = true; + return result; + } + if (this.config.isMonthOnly(trimedText)) { + let tempDate = new Date(referenceDate); + tempDate.setMonth(referenceDate.getMonth() + swift); + month = tempDate.getMonth(); + year = tempDate.getFullYear(); + result.timex = `${utilities$2.FormatUtil.toString(year, 4)}-${utilities$2.FormatUtil.toString(month + 1, 2)}`; + futureYear = year; + pastYear = year; + } + else if (this.config.isYearOnly(trimedText)) { + let tempDate = new Date(referenceDate); + tempDate.setFullYear(referenceDate.getFullYear() + swift); + year = tempDate.getFullYear(); + let beginDate = utilities$2.DateUtils.safeCreateFromMinValue(year, 0, 1); + let endDate = this.inclusiveEndPeriod + ? utilities$2.DateUtils.safeCreateFromMinValue(year, 11, 31) + : utilities$2.DateUtils.addDays(utilities$2.DateUtils.safeCreateFromMinValue(year, 11, 31), 1); + if (earlyPrefix) { + endDate = this.inclusiveEndPeriod + ? utilities$2.DateUtils.safeCreateFromMinValue(year, 5, 30) + : utilities$2.DateUtils.addDays(utilities$2.DateUtils.safeCreateFromMinValue(year, 5, 30), 1); + } + if (latePrefix) { + beginDate = utilities$2.DateUtils.safeCreateFromMinValue(year, 6, 1); + } + if (earlierPrefix && swift === 0) { + if (endDate > referenceDate) { + endDate = referenceDate; + } + } + else if (laterPrefix && swift === 0) { + if (beginDate < referenceDate) { + beginDate = referenceDate; + } + } + result.timex = utilities$2.FormatUtil.toString(year, 4); + result.futureValue = [beginDate, endDate]; + result.pastValue = [beginDate, endDate]; + result.success = true; + return result; + } + } + // only "month" will come to here + let futureStart = utilities$2.DateUtils.safeCreateFromMinValue(futureYear, month, 1); + let futureEnd = this.inclusiveEndPeriod + ? utilities$2.DateUtils.addDays(utilities$2.DateUtils.addMonths(utilities$2.DateUtils.safeCreateFromMinValue(futureYear, month, 1), 1), -1) + : utilities$2.DateUtils.addMonths(utilities$2.DateUtils.safeCreateFromMinValue(futureYear, month, 1), 1); + let pastStart = utilities$2.DateUtils.safeCreateFromMinValue(pastYear, month, 1); + let pastEnd = this.inclusiveEndPeriod + ? utilities$2.DateUtils.addDays(utilities$2.DateUtils.addMonths(utilities$2.DateUtils.safeCreateFromMinValue(pastYear, month, 1), 1), -1) + : utilities$2.DateUtils.addMonths(utilities$2.DateUtils.safeCreateFromMinValue(pastYear, month, 1), 1); + if (earlyPrefix) { + futureEnd = this.inclusiveEndPeriod + ? utilities$2.DateUtils.safeCreateFromMinValue(futureYear, month, 15) + : utilities$2.DateUtils.addDays(utilities$2.DateUtils.safeCreateFromMinValue(futureYear, month, 15), 1); + pastEnd = this.inclusiveEndPeriod + ? utilities$2.DateUtils.safeCreateFromMinValue(pastYear, month, 15) + : utilities$2.DateUtils.addDays(utilities$2.DateUtils.safeCreateFromMinValue(pastYear, month, 15), 1); + } + else if (latePrefix) { + futureStart = utilities$2.DateUtils.safeCreateFromMinValue(futureYear, month, 16); + pastStart = utilities$2.DateUtils.safeCreateFromMinValue(pastYear, month, 16); + } + if (earlierPrefix && futureYear === pastYear) { + if (futureEnd > referenceDate) { + futureEnd = pastEnd = referenceDate; + } + } + else if (laterPrefix && futureYear === pastYear) { + if (futureStart < referenceDate) { + futureStart = pastStart = referenceDate; + } + } + result.futureValue = [futureStart, futureEnd]; + result.pastValue = [pastStart, pastEnd]; + result.success = true; + return result; + } + mergeTwoTimePoints(source, referenceDate) { + let trimmedSource = source.trim(); + let result = new utilities$2.DateTimeResolutionResult(); + let ers = this.config.dateExtractor.extract(trimmedSource, referenceDate); + if (!ers || ers.length < 2) { + ers = this.config.dateExtractor.extract(this.config.tokenBeforeDate + trimmedSource, referenceDate) + .map(er => { + er.start -= this.config.tokenBeforeDate.length; + return er; + }); + if (!ers || ers.length < 2) + return result; + } + let match = recognizersText.RegExpUtility.getMatches(this.config.weekWithWeekDayRangeRegex, source).pop(); + let weekPrefix = null; + if (match) { + weekPrefix = match.groups("week").value; + } + if (!recognizersText.StringUtility.isNullOrWhitespace(weekPrefix)) { + ers[0].text = weekPrefix + " " + ers[0].text; + ers[1].text = weekPrefix + " " + ers[1].text; + } + let prs = ers.map(er => this.config.dateParser.parse(er, referenceDate)).filter(pr => pr); + if (prs.length < 2) + return result; + let prBegin = prs[0]; + let prEnd = prs[1]; + let futureBegin = prBegin.value.futureValue; + let futureEnd = prEnd.value.futureValue; + let pastBegin = prBegin.value.pastValue; + let pastEnd = prEnd.value.pastValue; + result.subDateTimeEntities = prs; + result.timex = `(${prBegin.timexStr},${prEnd.timexStr},P${utilities$2.DateUtils.diffDays(futureEnd, futureBegin)}D)`; + result.futureValue = [futureBegin, futureEnd]; + result.pastValue = [pastBegin, pastEnd]; + result.success = true; + return result; + } + parseYear(source, referenceDate) { + let trimmedSource = source.trim(); + let result = new utilities$2.DateTimeResolutionResult(); + let match = recognizersText.RegExpUtility.getMatches(this.config.yearRegex, trimmedSource).pop(); + if (!match || match.length !== trimmedSource.length) + return result; + let year = Number.parseInt(match.value, 10); + let beginDate = utilities$2.DateUtils.safeCreateFromValue(utilities$2.DateUtils.minValue(), year, 0, 1); + let endDate = utilities$2.DateUtils.addDays(utilities$2.DateUtils.safeCreateFromValue(utilities$2.DateUtils.minValue(), year + 1, 0, 1), this.inclusiveEndPeriod ? -1 : 0); + result.timex = utilities$2.FormatUtil.toString(year, 4); + result.futureValue = [beginDate, endDate]; + result.pastValue = [beginDate, endDate]; + result.success = true; + return result; + } + parseDuration(source, referenceDate) { + let result = new utilities$2.DateTimeResolutionResult(); + let ers = this.config.durationExtractor.extract(source, referenceDate); + let beginDate = new Date(referenceDate); + let endDate = new Date(referenceDate); + let restNowSunday = false; + let durationTimex = ''; + if (ers.length === 1) { + let pr = this.config.durationParser.parse(ers[0]); + if (pr === null) + return result; + let beforeStr = source.substr(0, pr.start).trim(); + let mod; + let durationResult = pr.value; + if (recognizersText.StringUtility.isNullOrEmpty(durationResult.timex)) + return result; + let prefixMatch = recognizersText.RegExpUtility.getMatches(this.config.pastRegex, beforeStr).pop(); + if (prefixMatch) { + mod = constants$2.TimeTypeConstants.beforeMod; + beginDate = this.getSwiftDate(endDate, durationResult.timex, false); + } + prefixMatch = recognizersText.RegExpUtility.getMatches(this.config.futureRegex, beforeStr).pop(); + if (prefixMatch && prefixMatch.length === beforeStr.length) { + mod = constants$2.TimeTypeConstants.afterMod; + // for future the beginDate should add 1 first + beginDate = new Date(referenceDate.getFullYear(), referenceDate.getMonth(), referenceDate.getDate() + 1); + endDate = this.getSwiftDate(beginDate, durationResult.timex, true); + } + prefixMatch = recognizersText.RegExpUtility.getMatches(this.config.inConnectorRegex, beforeStr).pop(); + if (prefixMatch && prefixMatch.length === beforeStr.length) { + mod = constants$2.TimeTypeConstants.afterMod; + beginDate = new Date(referenceDate.getFullYear(), referenceDate.getMonth(), referenceDate.getDate() + 1); + endDate = this.getSwiftDate(beginDate, durationResult.timex, true); + let unit = durationResult.timex.substr(durationResult.timex.length - 1); + durationResult.timex = `P1${unit}`; + beginDate = this.getSwiftDate(endDate, durationResult.timex, false); + } + if (mod) { + pr.value.mod = mod; + } + durationTimex = durationResult.timex; + result.subDateTimeEntities = [pr]; + } + // parse rest of + let match = recognizersText.RegExpUtility.getMatches(this.config.restOfDateRegex, source).pop(); + if (match) { + let diffDays = 0; + let durationStr = match.groups('duration').value; + let durationUnit = this.config.unitMap.get(durationStr); + switch (durationUnit) { + case 'W': + diffDays = 7 - ((beginDate.getDay() === 0) ? 7 : beginDate.getDay()); + endDate = utilities$2.DateUtils.addDays(referenceDate, diffDays); + restNowSunday = (diffDays === 0); + break; + case 'MON': + endDate = utilities$2.DateUtils.safeCreateFromMinValue(beginDate.getFullYear(), beginDate.getMonth(), 1); + endDate.setMonth(beginDate.getMonth() + 1); + endDate.setDate(endDate.getDate() - 1); + diffDays = endDate.getDate() - beginDate.getDate() + 1; + break; + case 'Y': + endDate = utilities$2.DateUtils.safeCreateFromMinValue(beginDate.getFullYear(), 11, 1); + endDate.setMonth(endDate.getMonth() + 1); + endDate.setDate(endDate.getDate() - 1); + diffDays = utilities$2.DateUtils.dayOfYear(endDate) - utilities$2.DateUtils.dayOfYear(beginDate) + 1; + break; + } + durationTimex = `P${diffDays}D`; + } + if (beginDate.getTime() !== endDate.getTime() || restNowSunday) { + endDate = utilities$2.DateUtils.addDays(endDate, this.inclusiveEndPeriod ? -1 : 0); + result.timex = `(${utilities$2.FormatUtil.luisDateFromDate(beginDate)},${utilities$2.FormatUtil.luisDateFromDate(endDate)},${durationTimex})`; + result.futureValue = [beginDate, endDate]; + result.pastValue = [beginDate, endDate]; + result.success = true; + } + return result; + } + getSwiftDate(date, timex, isPositiveSwift) { + let result = new Date(date); + let numStr = timex.replace('P', '').substr(0, timex.length - 2); + let unitStr = timex.substr(timex.length - 1); + let swift = Number.parseInt(numStr, 10) || 0; + if (swift === 0) + return result; + if (!isPositiveSwift) + swift *= -1; + switch (unitStr) { + case 'D': + result.setDate(date.getDate() + swift); + break; + case 'W': + result.setDate(date.getDate() + (7 * swift)); + break; + case 'M': + result.setMonth(date.getMonth() + swift); + break; + case 'Y': + result.setFullYear(date.getFullYear() + swift); + break; + } + return result; + } + parseWeekOfMonth(source, referenceDate) { + let result = new utilities$2.DateTimeResolutionResult(); + let match = recognizersText.RegExpUtility.getMatches(this.config.weekOfMonthRegex, source).pop(); + if (!match || match.length !== source.length) + return result; + let cardinalStr = match.groups('cardinal').value; + let monthStr = match.groups('month').value; + let month = referenceDate.getMonth(); + let year = referenceDate.getFullYear(); + let noYear = false; + let cardinal = this.config.isLastCardinal(cardinalStr) ? 5 + : this.config.cardinalMap.get(cardinalStr); + if (recognizersText.StringUtility.isNullOrEmpty(monthStr)) { + let swift = this.config.getSwiftDayOrMonth(source); + let tempDate = new Date(referenceDate); + tempDate.setMonth(referenceDate.getMonth() + swift); + month = tempDate.getMonth(); + year = tempDate.getFullYear(); + } + else { + month = this.config.monthOfYear.get(monthStr) - 1; + noYear = true; + } + return this.getWeekOfMonth(cardinal, month, year, referenceDate, noYear); + } + getWeekOfMonth(cardinal, month, year, referenceDate, noYear) { + let result = new utilities$2.DateTimeResolutionResult(); + let seedDate = this.computeDate(cardinal, 1, month, year); + if (seedDate.getMonth() !== month) { + cardinal--; + seedDate.setDate(seedDate.getDate() - 7); + } + let futureDate = new Date(seedDate); + let pastDate = new Date(seedDate); + if (noYear && futureDate < referenceDate) { + futureDate = this.computeDate(cardinal, 1, month, year + 1); + if (futureDate.getMonth() !== month) { + futureDate.setDate(futureDate.getDate() - 7); + } + } + if (noYear && pastDate >= referenceDate) { + pastDate = this.computeDate(cardinal, 1, month, year - 1); + if (pastDate.getMonth() !== month) { + pastDate.setDate(pastDate.getDate() - 7); + } + } + result.timex = noYear ? + `XXXX-${utilities$2.FormatUtil.toString(month + 1, 2)}-W${utilities$2.FormatUtil.toString(cardinal, 2)}` : + `${utilities$2.FormatUtil.toString(year, 4)}-${utilities$2.FormatUtil.toString(month + 1, 2)}-W${utilities$2.FormatUtil.toString(cardinal, 2)}`; + result.futureValue = [futureDate, utilities$2.DateUtils.addDays(futureDate, this.inclusiveEndPeriod ? 6 : 7)]; + result.pastValue = [pastDate, utilities$2.DateUtils.addDays(pastDate, this.inclusiveEndPeriod ? 6 : 7)]; + result.success = true; + return result; + } + parseWeekOfYear(source, referenceDate) { + let result = new utilities$2.DateTimeResolutionResult(); + let match = recognizersText.RegExpUtility.getMatches(this.config.weekOfYearRegex, source).pop(); + if (!match || match.length !== source.length) + return result; + let cardinalStr = match.groups('cardinal').value; + let yearStr = match.groups('year').value; + let orderStr = match.groups('order').value; + let year = Number.parseInt(yearStr, 10); + if (isNaN(year)) { + let swift = this.config.getSwiftYear(orderStr); + if (swift < -1) + return result; + year = referenceDate.getFullYear() + swift; + } + let targetWeekMonday; + if (this.config.isLastCardinal(cardinalStr)) { + let lastDay = utilities$2.DateUtils.safeCreateFromMinValue(year, 11, 31); + let lastDayWeekMonday = utilities$2.DateUtils.this(lastDay, utilities$2.DayOfWeek.Monday); + let weekNum = utilities$2.DateUtils.getWeekNumber(lastDay).weekNo; + if (weekNum === 1) { + lastDayWeekMonday = utilities$2.DateUtils.this(utilities$2.DateUtils.addDays(lastDay, -7), utilities$2.DayOfWeek.Monday); + } + targetWeekMonday = lastDayWeekMonday; + weekNum = utilities$2.DateUtils.getWeekNumber(targetWeekMonday).weekNo; + result.timex = `${utilities$2.FormatUtil.toString(year, 4)}-${utilities$2.FormatUtil.toString(targetWeekMonday.getMonth() + 1, 2)}-W${utilities$2.FormatUtil.toString(weekNum, 2)}`; + } + else { + let cardinal = this.config.cardinalMap.get(cardinalStr); + let firstDay = utilities$2.DateUtils.safeCreateFromMinValue(year, 0, 1); + let firstDayWeekMonday = utilities$2.DateUtils.this(firstDay, utilities$2.DayOfWeek.Monday); + let weekNum = utilities$2.DateUtils.getWeekNumber(firstDay).weekNo; + if (weekNum !== 1) { + firstDayWeekMonday = utilities$2.DateUtils.this(utilities$2.DateUtils.addDays(firstDay, 7), utilities$2.DayOfWeek.Monday); + } + targetWeekMonday = utilities$2.DateUtils.addDays(firstDayWeekMonday, 7 * (cardinal - 1)); + let targetWeekSunday = utilities$2.DateUtils.this(targetWeekMonday, utilities$2.DayOfWeek.Sunday); + result.timex = `${utilities$2.FormatUtil.toString(year, 4)}-${utilities$2.FormatUtil.toString(targetWeekSunday.getMonth() + 1, 2)}-W${utilities$2.FormatUtil.toString(cardinal, 2)}`; + } + result.futureValue = [targetWeekMonday, utilities$2.DateUtils.addDays(targetWeekMonday, this.inclusiveEndPeriod ? 6 : 7)]; + result.pastValue = [targetWeekMonday, utilities$2.DateUtils.addDays(targetWeekMonday, this.inclusiveEndPeriod ? 6 : 7)]; + result.success = true; + return result; + } + parseHalfYear(source, referenceDate) { + let result = new utilities$2.DateTimeResolutionResult(); + let match = recognizersText.RegExpUtility.getMatches(this.config.allHalfYearRegex, source).pop(); + if (!match || match.length !== source.length) + return result; + let cardinalStr = match.groups('cardinal').value; + let yearStr = match.groups('year').value; + let orderStr = match.groups('order').value; + let numberStr = match.groups('number').value; + let year = Number.parseInt(yearStr, 10); + if (isNaN(year)) { + let swift = this.config.getSwiftYear(orderStr); + if (swift < -1) { + return result; + } + year = referenceDate.getFullYear() + swift; + } + let quarterNum; + if (!numberStr) { + quarterNum = this.config.cardinalMap.get(cardinalStr); + } + else { + quarterNum = parseInt(numberStr); + } + let beginDate = utilities$2.DateUtils.safeCreateDateResolveOverflow(year, (quarterNum - 1) * constants$2.Constants.SemesterMonthCount, 1); + let endDate = utilities$2.DateUtils.safeCreateDateResolveOverflow(year, quarterNum * constants$2.Constants.SemesterMonthCount, 1); + result.futureValue = [beginDate, endDate]; + result.pastValue = [beginDate, endDate]; + result.timex = `(${utilities$2.FormatUtil.luisDateFromDate(beginDate)},${utilities$2.FormatUtil.luisDateFromDate(endDate)},P6M)`; + result.success = true; + return result; + } + parseQuarter(source, referenceDate) { + let result = new utilities$2.DateTimeResolutionResult(); + let match = recognizersText.RegExpUtility.getMatches(this.config.quarterRegex, source).pop(); + if (!match || match.length !== source.length) { + match = recognizersText.RegExpUtility.getMatches(this.config.quarterRegexYearFront, source).pop(); + } + if (!match || match.length !== source.length) + return result; + let cardinalStr = match.groups('cardinal').value; + let yearStr = match.groups('year').value; + let orderStr = match.groups('order').value; + let numberStr = match.groups('number').value; + let noSpecificYear = false; + let year = Number.parseInt(yearStr, 10); + if (isNaN(year)) { + let swift = this.config.getSwiftYear(orderStr); + if (swift < -1) { + swift = 0; + noSpecificYear = true; + } + year = referenceDate.getFullYear() + swift; + } + let quarterNum; + if (!numberStr) { + quarterNum = this.config.cardinalMap.get(cardinalStr); + } + else { + quarterNum = parseInt(numberStr); + } + let beginDate = utilities$2.DateUtils.safeCreateDateResolveOverflow(year, (quarterNum - 1) * constants$2.Constants.TrimesterMonthCount, 1); + let endDate = utilities$2.DateUtils.safeCreateDateResolveOverflow(year, quarterNum * constants$2.Constants.TrimesterMonthCount, 1); + if (noSpecificYear) { + if (endDate < referenceDate) { + result.pastValue = [beginDate, endDate]; + let futureBeginDate = utilities$2.DateUtils.safeCreateDateResolveOverflow(year + 1, (quarterNum - 1) * constants$2.Constants.TrimesterMonthCount, 1); + let futureEndDate = utilities$2.DateUtils.safeCreateDateResolveOverflow(year + 1, quarterNum * constants$2.Constants.TrimesterMonthCount, 1); + result.futureValue = [futureBeginDate, futureEndDate]; + } + else if (endDate > referenceDate) { + result.futureValue = [beginDate, endDate]; + let pastBeginDate = utilities$2.DateUtils.safeCreateDateResolveOverflow(year - 1, (quarterNum - 1) * constants$2.Constants.TrimesterMonthCount, 1); + let pastEndDate = utilities$2.DateUtils.safeCreateDateResolveOverflow(year - 1, quarterNum * constants$2.Constants.TrimesterMonthCount, 1); + result.pastValue = [pastBeginDate, pastEndDate]; + } + else { + result.futureValue = [beginDate, endDate]; + result.pastValue = [beginDate, endDate]; + } + } + else { + result.futureValue = [beginDate, endDate]; + result.pastValue = [beginDate, endDate]; + } + result.timex = `(${utilities$2.FormatUtil.luisDateFromDate(beginDate)},${utilities$2.FormatUtil.luisDateFromDate(endDate)},P3M)`; + result.success = true; + return result; + } + parseSeason(source, referenceDate) { + let result = new utilities$2.DateTimeResolutionResult(); + let match = recognizersText.RegExpUtility.getMatches(this.config.seasonRegex, source).pop(); + if (!match || match.length !== source.length) + return result; + let swift = this.config.getSwiftYear(source); + let yearStr = match.groups('year').value; + let year = referenceDate.getFullYear(); + let seasonStr = match.groups('seas').value; + let season = this.config.seasonMap.get(seasonStr); + if (swift >= -1 || !recognizersText.StringUtility.isNullOrEmpty(yearStr)) { + if (recognizersText.StringUtility.isNullOrEmpty(yearStr)) + yearStr = utilities$2.FormatUtil.toString(year + swift, 4); + result.timex = `${yearStr}-${season}`; + } + else { + result.timex = season; + } + result.success = true; + return result; + } + parseWhichWeek(source, referenceDate) { + let result = new utilities$2.DateTimeResolutionResult(); + let match = recognizersText.RegExpUtility.getMatches(this.config.whichWeekRegex, source).pop(); + if (!match) + return result; + let num = Number.parseInt(match.groups('number').value, 10); + let year = referenceDate.getFullYear(); + let firstDay = utilities$2.DateUtils.safeCreateFromValue(utilities$2.DateUtils.minValue(), year, 0, 1); + let firstWeekday = utilities$2.DateUtils.this(firstDay, utilities$2.DayOfWeek.Monday); + let resultDate = utilities$2.DateUtils.addDays(firstWeekday, 7 * num); + result.timex = `${utilities$2.FormatUtil.toString(year, 4)}-W${utilities$2.FormatUtil.toString(num, 2)}`; + result.futureValue = [resultDate, utilities$2.DateUtils.addDays(resultDate, 7)]; + result.pastValue = [resultDate, utilities$2.DateUtils.addDays(resultDate, 7)]; + result.success = true; + return result; + } + parseWeekOfDate(source, referenceDate) { + let result = new utilities$2.DateTimeResolutionResult(); + let match = recognizersText.RegExpUtility.getMatches(this.config.weekOfRegex, source).pop(); + let ers = this.config.dateExtractor.extract(source, referenceDate); + if (!match || ers.length !== 1) + return result; + let dateResolution = this.config.dateParser.parse(ers[0], referenceDate).value; + result.timex = dateResolution.timex; + result.comment = this.weekOfComment; + result.futureValue = this.getWeekRangeFromDate(dateResolution.futureValue); + result.pastValue = this.getWeekRangeFromDate(dateResolution.pastValue); + result.success = true; + return result; + } + parseMonthOfDate(source, referenceDate) { + let result = new utilities$2.DateTimeResolutionResult(); + let match = recognizersText.RegExpUtility.getMatches(this.config.monthOfRegex, source).pop(); + let ers = this.config.dateExtractor.extract(source, referenceDate); + if (!match || ers.length !== 1) + return result; + let dateResolution = this.config.dateParser.parse(ers[0], referenceDate).value; + result.timex = dateResolution.timex; + result.comment = this.monthOfComment; + result.futureValue = this.getMonthRangeFromDate(dateResolution.futureValue); + result.pastValue = this.getMonthRangeFromDate(dateResolution.pastValue); + result.success = true; + return result; + } + computeDate(cardinal, weekday, month, year) { + let firstDay = new Date(year, month, 1); + let firstWeekday = utilities$2.DateUtils.this(firstDay, weekday); + if (weekday === 0) + weekday = 7; + let firstDayOfWeek = firstDay.getDay() !== 0 ? firstDay.getDay() : 7; + if (weekday < firstDayOfWeek) + firstWeekday = utilities$2.DateUtils.next(firstDay, weekday); + firstWeekday.setDate(firstWeekday.getDate() + (7 * (cardinal - 1))); + return firstWeekday; + } + getWeekRangeFromDate(seedDate) { + let beginDate = utilities$2.DateUtils.this(seedDate, utilities$2.DayOfWeek.Monday); + let endDate = utilities$2.DateUtils.addDays(beginDate, this.inclusiveEndPeriod ? 6 : 7); + return [beginDate, endDate]; + } + getMonthRangeFromDate(seedDate) { + let beginDate = utilities$2.DateUtils.safeCreateFromValue(utilities$2.DateUtils.minValue(), seedDate.getFullYear(), seedDate.getMonth(), 1); + let endDate = utilities$2.DateUtils.safeCreateFromValue(utilities$2.DateUtils.minValue(), seedDate.getFullYear(), seedDate.getMonth() + 1, 1); + endDate.setDate(endDate.getDate() + (this.inclusiveEndPeriod ? -1 : 0)); + return [beginDate, endDate]; + } +} +exports.BaseDatePeriodParser = BaseDatePeriodParser; + +}); + +unwrapExports(baseDatePeriod); + +var baseTimePeriod = createCommonjsModule(function (module, exports) { +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); + + + + +class BaseTimePeriodExtractor { + constructor(config) { + this.extractorName = constants$2.Constants.SYS_DATETIME_TIMEPERIOD; // "TimePeriod"; + this.config = config; + } + extract(source, refDate) { + if (!refDate) + refDate = new Date(); + let referenceDate = refDate; + let tokens = new Array() + .concat(this.matchSimpleCases(source)) + .concat(this.mergeTwoTimePoints(source, referenceDate)) + .concat(this.matchNight(source)); + let result = utilities$2.Token.mergeAllTokens(tokens, source, this.extractorName); + return result; + } + matchSimpleCases(text) { + let ret = []; + this.config.simpleCasesRegex.forEach(regex => { + let matches = recognizersText.RegExpUtility.getMatches(regex, text); + matches.forEach(match => { + // is there "pm" or "am" ? + let pmStr = match.groups("pm").value; + let amStr = match.groups("am").value; + let descStr = match.groups("desc").value; + // check "pm", "am" + if (pmStr || amStr || descStr) { + ret.push(new utilities$2.Token(match.index, match.index + match.length)); + } + }); + }); + return ret; + } + mergeTwoTimePoints(text, refDate) { + let ret = []; + let ers = this.config.singleTimeExtractor.extract(text, refDate); + let numErs = this.config.integerExtractor.extract(text); + // Check if it is an ending number + if (numErs.length > 0) { + let timeNumbers = []; + // check if it is a ending number + let endingNumber = false; + let num = numErs[numErs.length - 1]; + if (num.start + num.length === text.length) { + endingNumber = true; + } + else { + let afterStr = text.substr(num.start + num.length); + let endingMatch = afterStr.match(this.config.generalEndingRegex); + if (endingMatch) { + endingNumber = true; + } + } + if (endingNumber) { + timeNumbers.push(num); + } + let i = 0; + let j = 0; + while (i < numErs.length) { + // find subsequent time point + let numEndPoint = numErs[i].start + numErs[i].length; + while (j < ers.length && ers[j].start <= numEndPoint) { + j++; + } + if (j >= ers.length) { + break; + } + // check connector string + let midStr = text.substr(numEndPoint, ers[j].start - numEndPoint); + let match = midStr.match(this.config.tillRegex); + if (match && match[0].length === midStr.trim().length) { + timeNumbers.push(numErs[i]); + } + i++; + } + // check overlap + for (let timeNum of timeNumbers) { + let overlap = false; + for (let er of ers) { + if (er.start <= timeNum.start && er.start + er.length >= timeNum.start) { + overlap = true; + } + } + if (!overlap) { + ers.push(timeNum); + } + } + ers = ers.sort((x, y) => (x.start - y.start)); + } + // merge "{TimePoint} to {TimePoint}", "between {TimePoint} and {TimePoint}" + let idx = 0; + while (idx < ers.length - 1) { + let middleBegin = ers[idx].start + ers[idx].length || 0; + let middleEnd = ers[idx + 1].start || 0; + let middleStr = text.substring(middleBegin, middleEnd).trim().toLowerCase(); + let matches = recognizersText.RegExpUtility.getMatches(this.config.tillRegex, middleStr); + // handle "{TimePoint} to {TimePoint}" + if (matches.length > 0 && matches[0].index === 0 && matches[0].length === middleStr.length) { + let periodBegin = ers[idx].start || 0; + let periodEnd = (ers[idx + 1].start || 0) + (ers[idx + 1].length || 0); + // handle "from" + let beforeStr = text.substring(0, periodBegin).trim().toLowerCase(); + let fromIndex = this.config.getFromTokenIndex(beforeStr); + if (fromIndex.matched) { + periodBegin = fromIndex.index; + } + // handle "between" + let betweenIndex = this.config.getBetweenTokenIndex(beforeStr); + if (betweenIndex.matched) { + periodBegin = betweenIndex.index; + } + ret.push(new utilities$2.Token(periodBegin, periodEnd)); + idx += 2; + continue; + } + // handle "between {TimePoint} and {TimePoint}" + if (this.config.hasConnectorToken(middleStr)) { + let periodBegin = ers[idx].start || 0; + let periodEnd = (ers[idx + 1].start || 0) + (ers[idx + 1].length || 0); + // handle "between" + let beforeStr = text.substring(0, periodBegin).trim().toLowerCase(); + let betweenIndex = this.config.getBetweenTokenIndex(beforeStr); + if (betweenIndex.matched) { + periodBegin = betweenIndex.index; + ret.push(new utilities$2.Token(periodBegin, periodEnd)); + idx += 2; + continue; + } + } + idx++; + } + return ret; + } + matchNight(source) { + let ret = []; + let matches = recognizersText.RegExpUtility.getMatches(this.config.timeOfDayRegex, source); + matches.forEach(match => { + ret.push(new utilities$2.Token(match.index, match.index + match.length)); + }); + return ret; + } +} +exports.BaseTimePeriodExtractor = BaseTimePeriodExtractor; +class BaseTimePeriodParser { + constructor(configuration) { + this.config = configuration; + } + parse(er, refTime) { + let referenceTime = refTime || new Date(); + let value = null; + if (er.type === BaseTimePeriodParser.ParserName) { + let innerResult = this.parseSimpleCases(er.text, referenceTime); + if (!innerResult.success) { + innerResult = this.mergeTwoTimePoints(er.text, referenceTime); + } + if (!innerResult.success) { + innerResult = this.parseTimeOfDay(er.text, referenceTime); + } + if (innerResult.success) { + innerResult.futureResolution = {}; + innerResult.futureResolution[constants$2.TimeTypeConstants.START_TIME] = utilities$2.FormatUtil.formatTime(innerResult.futureValue.item1); + innerResult.futureResolution[constants$2.TimeTypeConstants.END_TIME] = utilities$2.FormatUtil.formatTime(innerResult.futureValue.item2); + innerResult.pastResolution = {}; + innerResult.pastResolution[constants$2.TimeTypeConstants.START_TIME] = utilities$2.FormatUtil.formatTime(innerResult.pastValue.item1); + innerResult.pastResolution[constants$2.TimeTypeConstants.END_TIME] = utilities$2.FormatUtil.formatTime(innerResult.pastValue.item2); + value = innerResult; + } + } + let ret = new parsers$4.DateTimeParseResult(er); + ret.value = value; + ret.timexStr = value === null ? "" : value.timex; + ret.resolutionStr = ""; + return ret; + } + parseSimpleCases(source, reference) { + // Cases like "from 3 to 5pm" or "between 4 and 6am", time point is pure number without colon + let result = this.parsePureNumCases(source, reference); + if (!result.success) { + // Cases like "from 3:30 to 5" or "between 3:30am to 6pm", at least one of the time point contains colon + result = this.parseSpecificTimeCases(source, reference); + } + return result; + } + parsePureNumCases(text, referenceTime) { + let ret = new utilities$2.DateTimeResolutionResult(); + let year = referenceTime.getFullYear(); + let month = referenceTime.getMonth(); + let day = referenceTime.getDate(); + let trimmedText = text.trim().toLowerCase(); + let matches = recognizersText.RegExpUtility.getMatches(this.config.pureNumberFromToRegex, trimmedText); + if (!matches.length) { + matches = recognizersText.RegExpUtility.getMatches(this.config.pureNumberBetweenAndRegex, trimmedText); + } + if (matches.length && matches[0].index === 0) { + // this "from .. to .." pattern is valid if followed by a Date OR "pm" + let isValid = false; + // get hours + let hourGroup = matches[0].groups('hour'); + let hourStr = hourGroup.captures[0]; + let afterHourIndex = hourGroup.index + hourGroup.length; + // hard to integrate this part into the regex + if (afterHourIndex === trimmedText.length || !trimmedText.substr(afterHourIndex).trim().startsWith(':')) { + let beginHour = this.config.numbers.get(hourStr); + if (!beginHour) { + beginHour = Number.parseInt(hourStr, 10); + } + hourStr = hourGroup.captures[1]; + afterHourIndex = trimmedText.indexOf(hourStr, hourGroup.index + 1) + hourStr.length; + if (afterHourIndex === trimmedText.length || !trimmedText.substr(afterHourIndex).trim().startsWith(':')) { + let endHour = this.config.numbers.get(hourStr); + if (!endHour) { + endHour = Number.parseInt(hourStr, 10); + } + // parse "pm" + let leftDesc = matches[0].groups("leftDesc").value; + let rightDesc = matches[0].groups("rightDesc").value; + let pmStr = matches[0].groups("pm").value; + let amStr = matches[0].groups("am").value; + // The "ampm" only occurs in time, don't have to consider it here + if (recognizersText.StringUtility.isNullOrWhitespace(leftDesc)) { + let rightAmValid = !recognizersText.StringUtility.isNullOrEmpty(rightDesc) && + recognizersText.RegExpUtility.getMatches(this.config.utilityConfiguration.amDescRegex, rightDesc.toLowerCase()).length; + let rightPmValid = !recognizersText.StringUtility.isNullOrEmpty(rightDesc) && + recognizersText.RegExpUtility.getMatches(this.config.utilityConfiguration.pmDescRegex, rightDesc.toLowerCase()).length; + if (!recognizersText.StringUtility.isNullOrEmpty(amStr) || rightAmValid) { + if (endHour >= 12) { + endHour -= 12; + } + if (beginHour >= 12 && beginHour - 12 < endHour) { + beginHour -= 12; + } + // Resolve case like "11 to 3am" + if (beginHour < 12 && beginHour > endHour) { + beginHour += 12; + } + isValid = true; + } + else if (!recognizersText.StringUtility.isNullOrEmpty(pmStr) || rightPmValid) { + if (endHour < 12) { + endHour += 12; + } + // Resolve case like "11 to 3pm" + if (beginHour + 12 < endHour) { + beginHour += 12; + } + isValid = true; + } + } + if (isValid) { + let beginStr = "T" + utilities$2.FormatUtil.toString(beginHour, 2); + let endStr = "T" + utilities$2.FormatUtil.toString(endHour, 2); + if (beginHour >= endHour) { + endHour += 24; + } + ret.timex = `(${beginStr},${endStr},PT${endHour - beginHour}H)`; + ret.futureValue = ret.pastValue = { + item1: new Date(year, month, day, beginHour, 0, 0), + item2: new Date(year, month, day, endHour, 0, 0) + }; + ret.success = true; + return ret; + } + } + } + } + return ret; + } + parseSpecificTimeCases(source, reference) { + let result = new utilities$2.DateTimeResolutionResult(); + let year = reference.getFullYear(); + let month = reference.getMonth(); + let day = reference.getDate(); + let trimmedText = source.trim().toLowerCase(); + // Handle cases like "from 4:30 to 5" + let match = recognizersText.RegExpUtility.getMatches(this.config.specificTimeFromToRegex, source).pop(); + if (!match) { + // Handle cases like "between 5:10 and 7" + match = recognizersText.RegExpUtility.getMatches(this.config.specificTimeBetweenAndRegex, source).pop(); + } + if (match && match.index === 0 && match.index + match.length === trimmedText.length) { + // Cases like "half past seven" are not handled here + if (match.groups('prefix').value !== '') { + return result; + } + // Cases like "4" is different with "4:00" as the Timex is different "T04H" vs "T04H00M" + // Uses this invalidFlag to differentiate + let beginHour; + let invalidFlag = -1; + let beginMinute = invalidFlag; + let beginSecond = invalidFlag; + let endHour; + let endMinute = invalidFlag; + let endSecond = invalidFlag; + // Get time1 and time2 + let hourGroup = match.groups('hour'); + let hourStr = hourGroup.captures[0]; + if (this.config.numbers.has(hourStr)) { + beginHour = this.config.numbers[hourStr]; + } + else { + beginHour = parseInt(hourStr, 10); + } + hourStr = hourGroup.captures[1]; + if (this.config.numbers.has(hourStr)) { + endHour = this.config.numbers[hourStr]; + } + else { + endHour = parseInt(hourStr, 10); + } + let time1StartIndex = match.groups('time1').index; + let time1EndIndex = time1StartIndex + match.groups('time1').length; + let time2StartIndex = match.groups('time2').index; + let time2EndIndex = time2StartIndex + match.groups('time2').length; + // Get beginMinute (if exists) and endMinute (if exists) + let lastGroupIndex = 0; + for (let i = 0; i < match.groups('min').captures.length; i++) { + let minuteCapture = match.groups('min').captures[i]; + let minuteCaptureIndex = source.indexOf(minuteCapture, lastGroupIndex); + if (minuteCaptureIndex >= time1StartIndex && minuteCaptureIndex + minuteCapture.length <= time1EndIndex) { + beginMinute = parseInt(minuteCapture, 10); + } + else if (minuteCaptureIndex >= time2StartIndex && minuteCaptureIndex + minuteCapture.length <= time2EndIndex) { + endMinute = parseInt(minuteCapture, 10); + } + lastGroupIndex = minuteCaptureIndex + 1; + } + lastGroupIndex = 0; + // Get beginSecond (if exists) and endSecond (if exists) + for (let i = 0; i < match.groups('sec').captures.length; i++) { + let secondCapture = match.groups('sec').captures[i]; + let secondCaptureIndex = source.indexOf(secondCapture, lastGroupIndex); + if (secondCaptureIndex >= time1StartIndex && secondCaptureIndex + secondCapture.length <= time1EndIndex) { + beginSecond = parseInt(secondCapture, 10); + } + else if (secondCaptureIndex >= time2StartIndex && secondCaptureIndex + secondCapture.length <= time2EndIndex) { + endSecond = parseInt(secondCapture, 10); + } + lastGroupIndex = secondCaptureIndex + 1; + } + lastGroupIndex = 0; + // Desc here means descriptions like "am / pm / o'clock" + // Get leftDesc (if exists) and rightDesc (if exists) + let leftDesc = match.groups('leftDesc').value; + let rightDesc = match.groups('rightDesc').value; + for (let i = 0; i < match.groups('desc').captures.length; i++) { + let descCapture = match.groups('desc').captures[i]; + let descCaptureIndex = source.indexOf(descCapture, lastGroupIndex); + if (descCaptureIndex >= time1StartIndex && descCaptureIndex + descCapture.length <= time1EndIndex && recognizersText.StringUtility.isNullOrEmpty(leftDesc)) { + leftDesc = descCapture; + } + else if (descCaptureIndex >= time2StartIndex && descCaptureIndex + descCapture.length <= time2EndIndex && recognizersText.StringUtility.isNullOrEmpty(rightDesc)) { + rightDesc = descCapture; + } + lastGroupIndex = descCaptureIndex + 1; + } + let beginDateTime = utilities$2.DateUtils.safeCreateFromMinValue(year, month, day, beginHour, beginMinute >= 0 ? beginMinute : 0, beginSecond >= 0 ? beginSecond : 0); + let endDateTime = utilities$2.DateUtils.safeCreateFromMinValue(year, month, day, endHour, endMinute >= 0 ? endMinute : 0, endSecond >= 0 ? endSecond : 0); + let hasLeftAm = !recognizersText.StringUtility.isNullOrEmpty(leftDesc) && leftDesc.toLowerCase().startsWith('a'); + let hasLeftPm = !recognizersText.StringUtility.isNullOrEmpty(leftDesc) && leftDesc.toLowerCase().startsWith('p'); + let hasRightAm = !recognizersText.StringUtility.isNullOrEmpty(rightDesc) && rightDesc.toLowerCase().startsWith('a'); + let hasRightPm = !recognizersText.StringUtility.isNullOrEmpty(rightDesc) && rightDesc.toLowerCase().startsWith('p'); + let hasLeft = hasLeftAm || hasLeftPm; + let hasRight = hasRightAm || hasRightPm; + // Both timepoint has description like 'am' or 'pm' + if (hasLeft && hasRight) { + if (hasLeftAm) { + if (beginHour >= 12) { + beginDateTime = utilities$2.DateUtils.addHours(beginDateTime, -12); + } + } + else if (hasLeftPm) { + if (beginHour < 12) { + beginDateTime = utilities$2.DateUtils.addHours(beginDateTime, 12); + } + } + if (hasRightAm) { + if (endHour >= 12) { + endDateTime = utilities$2.DateUtils.addHours(endDateTime, -12); + } + } + else if (hasRightPm) { + if (endHour < 12) { + endDateTime = utilities$2.DateUtils.addHours(endDateTime, 12); + } + } + } + else if (hasLeft || hasRight) { + if (hasLeftAm) { + if (beginHour >= 12) { + beginDateTime = utilities$2.DateUtils.addHours(beginDateTime, -12); + } + if (endHour < 12) { + if (endDateTime < beginDateTime) { + endDateTime = utilities$2.DateUtils.addHours(endDateTime, 12); + } + } + } + else if (hasLeftPm) { + if (beginHour < 12) { + beginDateTime = utilities$2.DateUtils.addHours(beginDateTime, 12); + } + if (endHour < 12) { + if (endDateTime.getTime() < beginDateTime.getTime()) { + let span = utilities$2.DateUtils.totalHoursFloor(beginDateTime, endDateTime); + if (span >= 12) { + endDateTime = utilities$2.DateUtils.addHours(endDateTime, 24); + } + else { + endDateTime = utilities$2.DateUtils.addHours(endDateTime, 12); + } + } + } + } + if (hasRightAm) { + if (endHour >= 12) { + endDateTime = utilities$2.DateUtils.addHours(endDateTime, -12); + } + if (beginHour < 12) { + if (endDateTime.getTime() < beginDateTime.getTime()) { + beginDateTime = utilities$2.DateUtils.addHours(beginDateTime, -12); + } + } + } + else if (hasRightPm) { + if (endHour < 12) { + endDateTime = utilities$2.DateUtils.addHours(endDateTime, 12); + } + if (beginHour < 12) { + if (endDateTime.getTime() < beginDateTime.getTime()) { + beginDateTime = utilities$2.DateUtils.addHours(beginDateTime, -12); + } + else { + let span = utilities$2.DateUtils.totalHoursFloor(endDateTime, beginDateTime); + if (span > 12) { + beginDateTime = utilities$2.DateUtils.addHours(beginDateTime, 12); + } + } + } + } + } + else if (!hasLeft && !hasRight && beginHour <= 12 && endHour <= 12) { + if (beginHour > endHour) { + if (beginHour === 12) { + beginDateTime = utilities$2.DateUtils.addHours(beginDateTime, -12); + } + else { + endDateTime = utilities$2.DateUtils.addHours(endDateTime, 12); + } + } + result.comment = constants$2.Constants.CommentAmPm; + } + if (endDateTime.getTime() < beginDateTime.getTime()) { + endDateTime = utilities$2.DateUtils.addHours(endDateTime, 24); + } + let beginStr = utilities$2.FormatUtil.shortTime(beginDateTime.getHours(), beginMinute, beginSecond); + let endStr = utilities$2.FormatUtil.shortTime(endDateTime.getHours(), endMinute, endSecond); + result.success = true; + result.timex = `(${beginStr},${endStr},${utilities$2.FormatUtil.luisTimeSpan(endDateTime, beginDateTime)})`; + result.futureValue = result.pastValue = { item1: beginDateTime, item2: endDateTime }; + result.subDateTimeEntities = []; + // In SplitDateAndTime mode, time points will be get from these SubDateTimeEntities + // Cases like "from 4 to 5pm", "4" should not be treated as SubDateTimeEntity + if (hasLeft || beginMinute !== invalidFlag || beginSecond !== invalidFlag) { + let er = { + start: time1StartIndex, + length: time1EndIndex - time1StartIndex, + text: source.substring(time1StartIndex, time1EndIndex), + type: constants$2.Constants.SYS_DATETIME_TIME + }; + let pr = this.config.timeParser.parse(er, reference); + result.subDateTimeEntities.push(pr); + } + // Cases like "from 4am to 5", "5" should not be treated as SubDateTimeEntity + if (hasRight || endMinute !== invalidFlag || endSecond !== invalidFlag) { + let er = { + start: time2StartIndex, + length: time2EndIndex - time2StartIndex, + text: source.substring(time2StartIndex, time2EndIndex), + type: constants$2.Constants.SYS_DATETIME_TIME + }; + let pr = this.config.timeParser.parse(er, reference); + result.subDateTimeEntities.push(pr); + } + } + return result; + } + mergeTwoTimePoints(text, referenceTime) { + let ret = new utilities$2.DateTimeResolutionResult(); + let ers = this.config.timeExtractor.extract(text, referenceTime); + let pr1 = null; + let pr2 = null; + let validTimeNumber = false; + if (ers.length !== 2) { + if (ers.length === 1) { + let numErs = this.config.integerExtractor.extract(text); + for (let num of numErs) { + let midStrBegin = 0; + let midStrEnd = 0; + // ending number + if (num.start > ers[0].start + ers[0].length) { + midStrBegin = ers[0].start + ers[0].length; + midStrEnd = num.start - midStrBegin; + } + else if (num.start + num.length < ers[0].start) { + midStrBegin = num.start + num.length; + midStrEnd = ers[0].start - midStrBegin; + } + // check if the middle string between the time point and the valid number is a connect string. + let middleStr = text.substr(midStrBegin, midStrEnd); + let tillMatch = middleStr.match(this.config.tillRegex); + if (tillMatch) { + num.type = constants$2.Constants.SYS_DATETIME_TIME; + ers.push(num); + validTimeNumber = true; + break; + } + } + ers = ers.sort((x, y) => (x.start - y.start)); + } + if (!validTimeNumber) { + return ret; + } + } + if (ers.length !== 2) { + return ret; + } + pr1 = this.config.timeParser.parse(ers[0], referenceTime); + pr2 = this.config.timeParser.parse(ers[1], referenceTime); + if (pr1.value === null || pr2.value === null) { + return ret; + } + let ampmStr1 = pr1.value.comment; + let ampmStr2 = pr2.value.comment; + let beginTime = pr1.value.futureValue; + let endTime = pr2.value.futureValue; + if (!recognizersText.StringUtility.isNullOrEmpty(ampmStr2) && ampmStr2.endsWith("ampm") + && endTime <= beginTime && utilities$2.DateUtils.addHours(endTime, 12) > beginTime) { + endTime = utilities$2.DateUtils.addHours(endTime, 12); + pr2.value.futureValue = endTime; + pr2.timexStr = `T${endTime.getHours()}`; + if (endTime.getMinutes() > 0) { + pr2.timexStr = `${pr2.timexStr}:${endTime.getMinutes()}`; + } + } + if (!recognizersText.StringUtility.isNullOrEmpty(ampmStr1) && ampmStr1.endsWith("ampm") + && endTime > utilities$2.DateUtils.addHours(beginTime, 12)) { + beginTime = utilities$2.DateUtils.addHours(beginTime, 12); + pr1.value.futureValue = beginTime; + pr1.timexStr = `T${beginTime.getHours()}`; + if (beginTime.getMinutes() > 0) { + pr1.timexStr = `${pr1.timexStr}:${beginTime.getMinutes()}`; + } + } + if (endTime < beginTime) { + endTime = utilities$2.DateUtils.addDays(endTime, 1); + } + let hours = utilities$2.DateUtils.totalHoursFloor(endTime, beginTime); + let minutes = utilities$2.DateUtils.totalMinutesFloor(endTime, beginTime) % 60; + ret.timex = `(${pr1.timexStr},${pr2.timexStr},PT` + + (hours > 0 ? `${hours}H` : '') + + (minutes > 0 ? `${minutes}M` : '') + + ')'; + ret.futureValue = ret.pastValue = { item1: beginTime, item2: endTime }; + ret.success = true; + if (ampmStr1 && ampmStr1.endsWith("ampm") && ampmStr2 && ampmStr2.endsWith("ampm")) { + ret.comment = "ampm"; + } + ret.subDateTimeEntities = [pr1, pr2]; + return ret; + } + // parse "morning", "afternoon", "night" + parseTimeOfDay(text, referenceTime) { + let day = referenceTime.getDate(); + let month = referenceTime.getMonth(); + let year = referenceTime.getFullYear(); + let ret = new utilities$2.DateTimeResolutionResult(); + // extract early/late prefix from text + let matches = recognizersText.RegExpUtility.getMatches(this.config.timeOfDayRegex, text); + let hasEarly = false; + let hasLate = false; + if (matches.length) { + if (!recognizersText.StringUtility.isNullOrEmpty(matches[0].groups("early").value)) { + let early = matches[0].groups("early").value; + text = text.replace(early, ""); + hasEarly = true; + ret.comment = "early"; + } + if (!hasEarly && !recognizersText.StringUtility.isNullOrEmpty(matches[0].groups("late").value)) { + let late = matches[0].groups("late").value; + text = text.replace(late, ""); + hasLate = true; + ret.comment = "late"; + } + } + let timexRange = this.config.getMatchedTimexRange(text); + if (!timexRange.matched) { + return new utilities$2.DateTimeResolutionResult(); + } + // modify time period if "early" or "late" is existed + if (hasEarly) { + timexRange.endHour = timexRange.beginHour + 2; + // handling case: night end with 23:59 + if (timexRange.endMin === 59) { + timexRange.endMin = 0; + } + } + else if (hasLate) { + timexRange.beginHour = timexRange.beginHour + 2; + } + ret.timex = timexRange.timex; + ret.futureValue = ret.pastValue = { + item1: new Date(year, month, day, timexRange.beginHour, 0, 0), + item2: new Date(year, month, day, timexRange.endHour, timexRange.endMin, timexRange.endMin) + }; + ret.success = true; + return ret; + } +} +BaseTimePeriodParser.ParserName = constants$2.Constants.SYS_DATETIME_TIMEPERIOD; // "TimePeriod"; +exports.BaseTimePeriodParser = BaseTimePeriodParser; + +}); + +unwrapExports(baseTimePeriod); + +var baseDateTime$2 = createCommonjsModule(function (module, exports) { +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); + + + + +class BaseDateTimeExtractor { + constructor(config) { + this.extractorName = constants$2.Constants.SYS_DATETIME_DATETIME; + this.config = config; + } + extract(source, refDate) { + if (!refDate) + refDate = new Date(); + let referenceDate = refDate; + let tokens = new Array(); + tokens = tokens.concat(this.mergeDateAndTime(source, referenceDate)); + tokens = tokens.concat(this.basicRegexMatch(source)); + tokens = tokens.concat(this.timeOfTodayBefore(source, referenceDate)); + tokens = tokens.concat(this.timeOfTodayAfter(source, referenceDate)); + tokens = tokens.concat(this.specialTimeOfDate(source, referenceDate)); + tokens = tokens.concat(this.durationWithBeforeAndAfter(source, referenceDate)); + let result = utilities$2.Token.mergeAllTokens(tokens, source, this.extractorName); + return result; + } + mergeDateAndTime(source, refDate) { + let tokens = new Array(); + let ers = this.config.datePointExtractor.extract(source, refDate); + if (ers.length < 1) + return tokens; + ers = ers.concat(this.config.timePointExtractor.extract(source, refDate)); + if (ers.length < 2) + return tokens; + ers = ers.sort((erA, erB) => erA.start < erB.start ? -1 : erA.start === erB.start ? 0 : 1); + let i = 0; + while (i < ers.length - 1) { + let j = i + 1; + while (j < ers.length && recognizersText.ExtractResult.isOverlap(ers[i], ers[j])) { + j++; + } + if (j >= ers.length) + break; + if ((ers[i].type === constants$2.Constants.SYS_DATETIME_DATE && ers[j].type === constants$2.Constants.SYS_DATETIME_TIME) || + (ers[i].type === constants$2.Constants.SYS_DATETIME_TIME && ers[j].type === constants$2.Constants.SYS_DATETIME_DATE)) { + let middleBegin = ers[i].start + ers[i].length; + let middleEnd = ers[j].start; + if (middleBegin > middleEnd) { + i = j + 1; + continue; + } + let middleStr = source.substr(middleBegin, middleEnd - middleBegin).trim().toLowerCase(); + if (this.config.isConnectorToken(middleStr)) { + let begin = ers[i].start; + let end = ers[j].start + ers[j].length; + tokens.push(new utilities$2.Token(begin, end)); + } + i = j + 1; + continue; + } + i = j; + } + tokens.forEach((token, index) => { + let afterStr = source.substr(token.end); + let match = recognizersText.RegExpUtility.getMatches(this.config.suffixRegex, afterStr); + if (match && match.length > 0) { + // TODO: verify element + token.end += match[0].length; + } + }); + return tokens; + } + basicRegexMatch(source) { + let tokens = new Array(); + recognizersText.RegExpUtility.getMatches(this.config.nowRegex, source) + .forEach(match => { + tokens.push(new utilities$2.Token(match.index, match.index + match.length)); + }); + return tokens; + } + timeOfTodayBefore(source, refDate) { + let tokens = new Array(); + let ers = this.config.timePointExtractor.extract(source, refDate); + ers.forEach(er => { + let beforeStr = source.substr(0, er.start); + let innerMatches = recognizersText.RegExpUtility.getMatches(this.config.nightRegex, er.text); + if (innerMatches && innerMatches.length > 0 && innerMatches[0].index === 0) { + beforeStr = source.substr(0, er.start + innerMatches[0].length); + } + if (recognizersText.StringUtility.isNullOrWhitespace(beforeStr)) + return; + let matches = recognizersText.RegExpUtility.getMatches(this.config.timeOfTodayBeforeRegex, beforeStr); + if (matches && matches.length > 0) { + let begin = matches[0].index; + let end = er.start + er.length; + tokens.push(new utilities$2.Token(begin, end)); + } + }); + recognizersText.RegExpUtility.getMatches(this.config.simpleTimeOfTodayBeforeRegex, source) + .forEach(match => { + tokens.push(new utilities$2.Token(match.index, match.index + match.length)); + }); + return tokens; + } + timeOfTodayAfter(source, refDate) { + let tokens = new Array(); + let ers = this.config.timePointExtractor.extract(source, refDate); + ers.forEach(er => { + let afterStr = source.substr(er.start + er.length); + if (recognizersText.StringUtility.isNullOrWhitespace(afterStr)) + return; + let matches = recognizersText.RegExpUtility.getMatches(this.config.timeOfTodayAfterRegex, afterStr); + if (matches && matches.length > 0) { + let begin = er.start; + let end = er.start + er.length + matches[0].length; + tokens.push(new utilities$2.Token(begin, end)); + } + }); + recognizersText.RegExpUtility.getMatches(this.config.simpleTimeOfTodayAfterRegex, source) + .forEach(match => { + tokens.push(new utilities$2.Token(match.index, match.index + match.length)); + }); + return tokens; + } + specialTimeOfDate(source, refDate) { + let tokens = new Array(); + let ers = this.config.datePointExtractor.extract(source, refDate); + ers.forEach(er => { + let beforeStr = source.substr(0, er.start); + let beforeMatches = recognizersText.RegExpUtility.getMatches(this.config.theEndOfRegex, beforeStr); + if (beforeMatches && beforeMatches.length > 0) { + tokens.push(new utilities$2.Token(beforeMatches[0].index, er.start + er.length)); + } + else { + let afterStr = source.substr(er.start + er.length); + let afterMatches = recognizersText.RegExpUtility.getMatches(this.config.theEndOfRegex, afterStr); + if (afterMatches && afterMatches.length > 0) { + tokens.push(new utilities$2.Token(er.start, er.start + er.length + afterMatches[0].index + afterMatches[0].length)); + } + } + }); + return tokens; + } + durationWithBeforeAndAfter(source, refDate) { + let tokens = new Array(); + this.config.durationExtractor.extract(source, refDate).forEach(er => { + let matches = recognizersText.RegExpUtility.getMatches(this.config.unitRegex, er.text); + if (matches && matches.length > 0) { + tokens = utilities$2.AgoLaterUtil.extractorDurationWithBeforeAndAfter(source, er, tokens, this.config.utilityConfiguration); + } + }); + return tokens; + } +} +exports.BaseDateTimeExtractor = BaseDateTimeExtractor; +class BaseDateTimeParser { + constructor(configuration) { + this.config = configuration; + } + parse(er, refTime) { + if (!refTime) + refTime = new Date(); + let referenceTime = refTime; + let value = null; + if (er.type === BaseDateTimeParser.ParserName) { + let innerResult = this.mergeDateAndTime(er.text, referenceTime); + if (!innerResult.success) { + innerResult = this.parseBasicRegex(er.text, referenceTime); + } + if (!innerResult.success) { + innerResult = this.parseTimeOfToday(er.text, referenceTime); + } + if (!innerResult.success) { + innerResult = this.parseSpecialTimeOfDate(er.text, referenceTime); + } + if (!innerResult.success) { + innerResult = this.parserDurationWithAgoAndLater(er.text, referenceTime); + } + if (innerResult.success) { + innerResult.futureResolution = {}; + innerResult.futureResolution[constants$2.TimeTypeConstants.DATETIME] = utilities$2.FormatUtil.formatDateTime(innerResult.futureValue); + innerResult.pastResolution = {}; + innerResult.pastResolution[constants$2.TimeTypeConstants.DATETIME] = utilities$2.FormatUtil.formatDateTime(innerResult.pastValue); + value = innerResult; + } + } + let ret = new parsers$4.DateTimeParseResult(er); + { + ret.value = value, ret.timexStr = value === null ? "" : value.timex, ret.resolutionStr = ""; + } + + return ret; + } + parseBasicRegex(text, referenceTime) { + let ret = new utilities$2.DateTimeResolutionResult(); + let trimmedText = text.trim().toLowerCase(); + // handle "now" + let matches = recognizersText.RegExpUtility.getMatches(this.config.nowRegex, trimmedText); + if (matches.length && matches[0].index === 0 && matches[0].length === trimmedText.length) { + let getMatchedNowTimex = this.config.getMatchedNowTimex(trimmedText); + ret.timex = getMatchedNowTimex.timex; + ret.futureValue = ret.pastValue = referenceTime; + ret.success = true; + return ret; + } + return ret; + } + // merge a Date entity and a Time entity + mergeDateAndTime(text, referenceTime) { + let ret = new utilities$2.DateTimeResolutionResult(); + let er1 = this.config.dateExtractor.extract(text, referenceTime); + if (er1.length === 0) { + er1 = this.config.dateExtractor.extract(this.config.tokenBeforeDate + text, referenceTime); + if (er1.length === 1) { + er1[0].start -= this.config.tokenBeforeDate.length; + } + else { + return ret; + } + } + else { + // this is to understand if there is an ambiguous token in the text. For some languages (e.g. spanish) + // the same word could mean different things (e.g a time in the day or an specific day). + if (this.config.haveAmbiguousToken(text, er1[0].text)) { + return ret; + } + } + let er2 = this.config.timeExtractor.extract(text, referenceTime); + if (er2.length === 0) { + // here we filter out "morning, afternoon, night..." time entities + er2 = this.config.timeExtractor.extract(this.config.tokenBeforeTime + text, referenceTime); + if (er2.length === 1) { + er2[0].start -= this.config.tokenBeforeTime.length; + } + else { + return ret; + } + } + // handle case "Oct. 5 in the afternoon at 7:00" + // in this case "5 in the afternoon" will be extract as a Time entity + let correctTimeIdx = 0; + while (correctTimeIdx < er2.length && recognizersText.ExtractResult.isOverlap(er2[correctTimeIdx], er1[0])) { + correctTimeIdx++; + } + if (correctTimeIdx >= er2.length) { + return ret; + } + let pr1 = this.config.dateParser.parse(er1[0], new Date(referenceTime.toDateString())); + let pr2 = this.config.timeParser.parse(er2[correctTimeIdx], referenceTime); + if (pr1.value === null || pr2.value === null) { + return ret; + } + let futureDate = pr1.value.futureValue; + let pastDate = pr1.value.pastValue; + let time = pr2.value.futureValue; + let hour = time.getHours(); + let min = time.getMinutes(); + let sec = time.getSeconds(); + // handle morning, afternoon + if (recognizersText.RegExpUtility.getMatches(this.config.pmTimeRegex, text).length && hour < 12) { + hour += 12; + } + else if (recognizersText.RegExpUtility.getMatches(this.config.amTimeRegex, text).length && hour >= 12) { + hour -= 12; + } + let timeStr = pr2.timexStr; + if (timeStr.endsWith("ampm")) { + timeStr = timeStr.substring(0, timeStr.length - 4); + } + timeStr = "T" + utilities$2.FormatUtil.toString(hour, 2) + timeStr.substring(3); + ret.timex = pr1.timexStr + timeStr; + let val = pr2.value; + if (hour <= 12 && !recognizersText.RegExpUtility.getMatches(this.config.pmTimeRegex, text).length + && !recognizersText.RegExpUtility.getMatches(this.config.amTimeRegex, text).length && val.comment) { + ret.comment = "ampm"; + } + ret.futureValue = new Date(futureDate.getFullYear(), futureDate.getMonth(), futureDate.getDate(), hour, min, sec); + ret.pastValue = new Date(pastDate.getFullYear(), pastDate.getMonth(), pastDate.getDate(), hour, min, sec); + ret.success = true; + // change the value of time object + pr2.timexStr = timeStr; + if (!recognizersText.StringUtility.isNullOrEmpty(ret.comment)) { + pr2.value.comment = ret.comment === "ampm" ? "ampm" : ""; + } + // add the date and time object in case we want to split them + ret.subDateTimeEntities = [pr1, pr2]; + return ret; + } + parseTimeOfToday(text, referenceTime) { + let ret = new utilities$2.DateTimeResolutionResult(); + let trimmedText = text.toLowerCase().trim(); + let hour = 0; + let min = 0; + let sec = 0; + let timeStr; + let wholeMatches = recognizersText.RegExpUtility.getMatches(this.config.simpleTimeOfTodayAfterRegex, trimmedText); + if (!(wholeMatches.length && wholeMatches[0].length === trimmedText.length)) { + wholeMatches = recognizersText.RegExpUtility.getMatches(this.config.simpleTimeOfTodayBeforeRegex, trimmedText); + } + if (wholeMatches.length && wholeMatches[0].length === trimmedText.length) { + let hourStr = wholeMatches[0].groups("hour").value; + if (!hourStr) { + hourStr = wholeMatches[0].groups("hournum").value.toLowerCase(); + hour = this.config.numbers.get(hourStr); + } + else { + hour = parseInt(hourStr, 10); + } + timeStr = "T" + utilities$2.FormatUtil.toString(hour, 2); + } + else { + let ers = this.config.timeExtractor.extract(trimmedText, referenceTime); + if (ers.length !== 1) { + ers = this.config.timeExtractor.extract(this.config.tokenBeforeTime + trimmedText, referenceTime); + if (ers.length === 1) { + ers[0].start -= this.config.tokenBeforeTime.length; + } + else { + return ret; + } + } + let pr = this.config.timeParser.parse(ers[0], referenceTime); + if (pr.value === null) { + return ret; + } + let time = pr.value.futureValue; + hour = time.getHours(); + min = time.getMinutes(); + sec = time.getSeconds(); + timeStr = pr.timexStr; + } + let matches = recognizersText.RegExpUtility.getMatches(this.config.specificTimeOfDayRegex, trimmedText); + if (matches.length) { + let matchStr = matches[0].value.toLowerCase(); + // handle "last", "next" + let swift = this.config.getSwiftDay(matchStr); + let date = new Date(referenceTime); + date.setDate(date.getDate() + swift); + // handle "morning", "afternoon" + hour = this.config.getHour(matchStr, hour); + // in this situation, luisStr cannot end up with "ampm", because we always have a "morning" or "night" + if (timeStr.endsWith("ampm")) { + timeStr = timeStr.substring(0, timeStr.length - 4); + } + timeStr = "T" + utilities$2.FormatUtil.toString(hour, 2) + timeStr.substring(3); + ret.timex = utilities$2.FormatUtil.formatDate(date) + timeStr; + ret.futureValue = ret.pastValue = new Date(date.getFullYear(), date.getMonth(), date.getDate(), hour, min, sec); + ret.success = true; + return ret; + } + return ret; + } + parseSpecialTimeOfDate(text, refDateTime) { + let ret = new utilities$2.DateTimeResolutionResult(); + let ers = this.config.dateExtractor.extract(text, refDateTime); + if (ers.length !== 1) { + return ret; + } + let beforeStr = text.substring(0, ers[0].start || 0); + if (recognizersText.RegExpUtility.getMatches(this.config.theEndOfRegex, beforeStr).length) { + let pr = this.config.dateParser.parse(ers[0], refDateTime); + let futureDate = new Date(pr.value.futureValue); + let pastDate = new Date(pr.value.pastValue); + ret.timex = pr.timexStr + "T23:59"; + futureDate.setDate(futureDate.getDate() + 1); + futureDate.setMinutes(futureDate.getMinutes() - 1); + ret.futureValue = futureDate; + pastDate.setDate(pastDate.getDate() + 1); + pastDate.setMinutes(pastDate.getMinutes() - 1); + ret.pastValue = pastDate; + ret.success = true; + return ret; + } + return ret; + } + // handle like "two hours ago" + parserDurationWithAgoAndLater(text, referenceTime) { + return utilities$2.AgoLaterUtil.parseDurationWithAgoAndLater(text, referenceTime, this.config.durationExtractor, this.config.durationParser, this.config.unitMap, this.config.unitRegex, this.config.utilityConfiguration, utilities$2.AgoLaterMode.DateTime); + } +} +BaseDateTimeParser.ParserName = constants$2.Constants.SYS_DATETIME_DATETIME; // "DateTime"; +exports.BaseDateTimeParser = BaseDateTimeParser; + +}); + +unwrapExports(baseDateTime$2); + +var baseDateTimePeriod = createCommonjsModule(function (module, exports) { +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); + + + + +class BaseDateTimePeriodExtractor { + constructor(config) { + this.extractorName = constants$2.Constants.SYS_DATETIME_DATETIMEPERIOD; + this.config = config; + } + extract(source, refDate) { + if (!refDate) + refDate = new Date(); + let referenceDate = refDate; + let tokens = new Array() + .concat(this.matchSimpleCases(source, referenceDate)) + .concat(this.mergeTwoTimePoints(source, referenceDate)) + .concat(this.matchDuration(source, referenceDate)) + .concat(this.matchNight(source, referenceDate)) + .concat(this.matchRelativeUnit(source)); + let result = utilities$2.Token.mergeAllTokens(tokens, source, this.extractorName); + return result; + } + matchSimpleCases(source, refDate) { + let tokens = new Array(); + this.config.simpleCasesRegexes.forEach(regexp => { + recognizersText.RegExpUtility.getMatches(regexp, source).forEach(match => { + // has a date before? + let hasBeforeDate = false; + let beforeStr = source.substr(0, match.index); + if (!recognizersText.StringUtility.isNullOrWhitespace(beforeStr)) { + let ers = this.config.singleDateExtractor.extract(beforeStr, refDate); + if (ers && ers.length > 0) { + let er = ers[ers.length - 1]; + let begin = er.start; + let middleStr = beforeStr.substr(begin + er.length).trim().toLowerCase(); + if (recognizersText.StringUtility.isNullOrWhitespace(middleStr) || recognizersText.RegExpUtility.getMatches(this.config.prepositionRegex, middleStr).length > 0) { + tokens.push(new utilities$2.Token(begin, match.index + match.length)); + hasBeforeDate = true; + } + } + } + let followedStr = source.substr(match.index + match.length); + if (!recognizersText.StringUtility.isNullOrWhitespace(followedStr) && !hasBeforeDate) { + let ers = this.config.singleDateExtractor.extract(followedStr, refDate); + if (ers && ers.length > 0) { + let er = ers[0]; + let begin = er.start; + let end = er.start + er.length; + let middleStr = followedStr.substr(0, begin).trim().toLowerCase(); + if (recognizersText.StringUtility.isNullOrWhitespace(middleStr) || recognizersText.RegExpUtility.getMatches(this.config.prepositionRegex, middleStr).length > 0) { + tokens.push(new utilities$2.Token(match.index, match.index + match.length + end)); + } + } + } + }); + }); + return tokens; + } + mergeTwoTimePoints(source, refDate) { + let tokens = new Array(); + let ersDateTime = this.config.singleDateTimeExtractor.extract(source, refDate); + let ersTime = this.config.singleTimeExtractor.extract(source, refDate); + let innerMarks = []; + let j = 0; + ersDateTime.forEach((erDateTime, index) => { + innerMarks.push(erDateTime); + while (j < ersTime.length && ersTime[j].start + ersTime[j].length < erDateTime.start) { + innerMarks.push(ersTime[j++]); + } + while (j < ersTime.length && recognizersText.ExtractResult.isOverlap(ersTime[j], erDateTime)) { + j++; + } + }); + while (j < ersTime.length) { + innerMarks.push(ersTime[j++]); + } + innerMarks = innerMarks.sort((erA, erB) => erA.start < erB.start ? -1 : erA.start === erB.start ? 0 : 1); + let idx = 0; + while (idx < innerMarks.length - 1) { + let currentMark = innerMarks[idx]; + let nextMark = innerMarks[idx + 1]; + if (currentMark.type === constants$2.Constants.SYS_DATETIME_TIME && nextMark.type === constants$2.Constants.SYS_DATETIME_TIME) { + idx++; + continue; + } + let middleBegin = currentMark.start + currentMark.length; + let middleEnd = nextMark.start; + let middleStr = source.substr(middleBegin, middleEnd - middleBegin).trim().toLowerCase(); + let matches = recognizersText.RegExpUtility.getMatches(this.config.tillRegex, middleStr); + if (matches && matches.length > 0 && matches[0].index === 0 && matches[0].length === middleStr.length) { + let periodBegin = currentMark.start; + let periodEnd = nextMark.start + nextMark.length; + let beforeStr = source.substr(0, periodBegin).trim().toLowerCase(); + let matchFrom = this.config.getFromTokenIndex(beforeStr); + let fromTokenIndex = matchFrom.matched ? matchFrom : this.config.getBetweenTokenIndex(beforeStr); + if (fromTokenIndex.matched) { + periodBegin = fromTokenIndex.index; + } + tokens.push(new utilities$2.Token(periodBegin, periodEnd)); + idx += 2; + continue; + } + if (this.config.hasConnectorToken(middleStr)) { + let periodBegin = currentMark.start; + let periodEnd = nextMark.start + nextMark.length; + let beforeStr = source.substr(0, periodBegin).trim().toLowerCase(); + let betweenTokenIndex = this.config.getBetweenTokenIndex(beforeStr); + if (betweenTokenIndex.matched) { + periodBegin = betweenTokenIndex.index; + tokens.push(new utilities$2.Token(periodBegin, periodEnd)); + idx += 2; + continue; + } + } + idx++; + } + + return tokens; + } + matchDuration(source, refDate) { + let tokens = new Array(); + let durations = new Array(); + this.config.durationExtractor.extract(source, refDate).forEach(duration => { + let match = recognizersText.RegExpUtility.getMatches(this.config.timeUnitRegex, duration.text).pop(); + if (match) { + durations.push(new utilities$2.Token(duration.start, duration.start + duration.length)); + } + }); + durations.forEach(duration => { + let beforeStr = source.substr(0, duration.start).toLowerCase(); + if (recognizersText.StringUtility.isNullOrWhitespace(beforeStr)) + return; + let match = recognizersText.RegExpUtility.getMatches(this.config.pastPrefixRegex, beforeStr).pop(); + if (match && recognizersText.StringUtility.isNullOrWhitespace(beforeStr.substr(match.index + match.length))) { + tokens.push(new utilities$2.Token(match.index, duration.end)); + return; + } + match = recognizersText.RegExpUtility.getMatches(this.config.nextPrefixRegex, beforeStr).pop(); + if (match && recognizersText.StringUtility.isNullOrWhitespace(beforeStr.substr(match.index + match.length))) { + tokens.push(new utilities$2.Token(match.index, duration.end)); + } + }); + return tokens; + } + matchNight(source, refDate) { + let tokens = new Array(); + recognizersText.RegExpUtility.getMatches(this.config.specificTimeOfDayRegex, source).forEach(match => { + tokens.push(new utilities$2.Token(match.index, match.index + match.length)); + }); + this.config.singleDateExtractor.extract(source, refDate).forEach(er => { + let afterStr = source.substr(er.start + er.length); + let match = recognizersText.RegExpUtility.getMatches(this.config.periodTimeOfDayWithDateRegex, afterStr).pop(); + if (match) { + if (recognizersText.StringUtility.isNullOrWhitespace(afterStr.substr(0, match.index))) { + tokens.push(new utilities$2.Token(er.start, er.start + er.length + match.index + match.length)); + } + else { + let pauseMatch = recognizersText.RegExpUtility.getMatches(this.config.middlePauseRegex, afterStr.substr(0, match.index)).pop(); + if (pauseMatch) { + // TODO: should use trimStart() instead? + let suffix = afterStr.substr(match.index + match.length).trim(); + let endingMatch = recognizersText.RegExpUtility.getMatches(this.config.generalEndingRegex, suffix).pop(); + if (endingMatch) { + tokens.push(new utilities$2.Token(er.start || 0, er.start + er.length + match.index + match.length || 0)); + } + } + } + } + let beforeStr = source.substr(0, er.start); + match = recognizersText.RegExpUtility.getMatches(this.config.periodTimeOfDayWithDateRegex, beforeStr).pop(); + if (match) { + if (recognizersText.StringUtility.isNullOrWhitespace(beforeStr.substr(match.index + match.length))) { + let middleStr = source.substr(match.index + match.length, er.start - match.index - match.length); + if (recognizersText.StringUtility.isWhitespace(middleStr)) { + tokens.push(new utilities$2.Token(match.index, er.start + er.length)); + } + } + else { + let pauseMatch = recognizersText.RegExpUtility.getMatches(this.config.middlePauseRegex, beforeStr.substr(match.index + match.length)).pop(); + if (pauseMatch) { + // TODO: should use trimStart() instead? + let suffix = source.substr(er.start + er.length || 0).trim(); + let endingMatch = recognizersText.RegExpUtility.getMatches(this.config.generalEndingRegex, suffix).pop(); + if (endingMatch) { + tokens.push(new utilities$2.Token(match.index, er.start + er.length || 0)); + } + } + } + } + // check whether there are adjacent time period strings, before or after + for (let e of tokens) { + // try to extract a time period in before-string + if (e.start > 0) { + let beforeStr = source.substr(0, e.start); + if (!recognizersText.StringUtility.isNullOrWhitespace(beforeStr)) { + let timeErs = this.config.timePeriodExtractor.extract(beforeStr); + if (timeErs.length > 0) { + for (let tp of timeErs) { + let midStr = beforeStr.substr(tp.start + tp.length || 0); + if (recognizersText.StringUtility.isNullOrWhitespace(midStr)) { + tokens.push(new utilities$2.Token(tp.start || 0, tp.start + tp.length + midStr.length + e.length || 0)); + } + } + } + } + } + // try to extract a time period in after-string + if (e.start + e.length <= source.length) { + let afterStr = source.substr(e.start + e.length); + if (!recognizersText.StringUtility.isNullOrWhitespace(afterStr)) { + let timeErs = this.config.timePeriodExtractor.extract(afterStr); + if (timeErs.length > 0) { + for (let tp of timeErs) { + let midStr = afterStr.substr(0, tp.start || 0); + if (recognizersText.StringUtility.isNullOrWhitespace(midStr)) { + tokens.push(new utilities$2.Token(e.start, e.start + e.length + midStr.length + tp.length || 0)); + } + } + } + } + } + } + }); + return tokens; + } + matchRelativeUnit(source) { + let tokens = new Array(); + let matches = recognizersText.RegExpUtility.getMatches(this.config.relativeTimeUnitRegex, source); + if (matches.length === 0) { + matches = recognizersText.RegExpUtility.getMatches(this.config.restOfDateTimeRegex, source); + } + matches.forEach(match => { + tokens.push(new utilities$2.Token(match.index, match.index + match.length)); + }); + return tokens; + } +} +exports.BaseDateTimePeriodExtractor = BaseDateTimePeriodExtractor; +class BaseDateTimePeriodParser { + constructor(config) { + this.parserName = constants$2.Constants.SYS_DATETIME_DATETIMEPERIOD; + this.config = config; + } + parse(extractorResult, referenceDate) { + if (!referenceDate) + referenceDate = new Date(); + let resultValue; + if (extractorResult.type === this.parserName) { + let source = extractorResult.text.trim().toLowerCase(); + let innerResult = this.mergeDateAndTimePeriods(source, referenceDate); + if (!innerResult.success) { + innerResult = this.mergeTwoTimePoints(source, referenceDate); + } + if (!innerResult.success) { + innerResult = this.parseSpecificTimeOfDay(source, referenceDate); + } + if (!innerResult.success) { + innerResult = this.parseDuration(source, referenceDate); + } + if (!innerResult.success) { + innerResult = this.parseRelativeUnit(source, referenceDate); + } + if (innerResult.success) { + innerResult.futureResolution = {}; + innerResult.futureResolution[constants$2.TimeTypeConstants.START_DATETIME] = utilities$2.FormatUtil.formatDateTime(innerResult.futureValue[0]); + innerResult.futureResolution[constants$2.TimeTypeConstants.END_DATETIME] = utilities$2.FormatUtil.formatDateTime(innerResult.futureValue[1]); + innerResult.pastResolution = {}; + innerResult.pastResolution[constants$2.TimeTypeConstants.START_DATETIME] = utilities$2.FormatUtil.formatDateTime(innerResult.pastValue[0]); + innerResult.pastResolution[constants$2.TimeTypeConstants.END_DATETIME] = utilities$2.FormatUtil.formatDateTime(innerResult.pastValue[1]); + resultValue = innerResult; + } + } + let result = new parsers$4.DateTimeParseResult(extractorResult); + result.value = resultValue; + result.timexStr = resultValue ? resultValue.timex : ''; + result.resolutionStr = ''; + return result; + } + mergeDateAndTimePeriods(text, referenceTime) { + let ret = new utilities$2.DateTimeResolutionResult(); + let trimedText = text.trim().toLowerCase(); + let er = this.config.timePeriodExtractor.extract(trimedText, referenceTime); + if (er.length !== 1) { + return this.parseSimpleCases(text, referenceTime); + } + let timePeriodParseResult = this.config.timePeriodParser.parse(er[0]); + let timePeriodResolutionResult = timePeriodParseResult.value; + if (!timePeriodResolutionResult) { + return this.parseSimpleCases(text, referenceTime); + } + let timePeriodTimex = timePeriodResolutionResult.timex; + // if it is a range type timex + if (!recognizersText.StringUtility.isNullOrEmpty(timePeriodTimex) + && timePeriodTimex.startsWith("(")) { + let dateResult = this.config.dateExtractor.extract(trimedText.replace(er[0].text, ""), referenceTime); + let dateStr = ""; + let futureTime; + let pastTime; + if (dateResult.length === 1 && trimedText.replace(er[0].text, "").trim() === dateResult[0].text) { + let pr = this.config.dateParser.parse(dateResult[0], referenceTime); + if (pr.value) { + futureTime = pr.value.futureValue; + pastTime = pr.value.pastValue; + dateStr = pr.timexStr; + } + else { + return this.parseSimpleCases(text, referenceTime); + } + timePeriodTimex = timePeriodTimex.replace("(", "").replace(")", ""); + let timePeriodTimexArray = timePeriodTimex.split(','); + let timePeriodFutureValue = timePeriodResolutionResult.futureValue; + let beginTime = timePeriodFutureValue.item1; + let endTime = timePeriodFutureValue.item2; + if (timePeriodTimexArray.length === 3) { + let beginStr = dateStr + timePeriodTimexArray[0]; + let endStr = dateStr + timePeriodTimexArray[1]; + ret.timex = `(${beginStr},${endStr},${timePeriodTimexArray[2]})`; + ret.futureValue = [ + utilities$2.DateUtils.safeCreateFromMinValue(futureTime.getFullYear(), futureTime.getMonth(), futureTime.getDate(), beginTime.getHours(), beginTime.getMinutes(), beginTime.getSeconds()), + utilities$2.DateUtils.safeCreateFromMinValue(futureTime.getFullYear(), futureTime.getMonth(), futureTime.getDate(), endTime.getHours(), endTime.getMinutes(), endTime.getSeconds()) + ]; + ret.pastValue = [ + utilities$2.DateUtils.safeCreateFromMinValue(pastTime.getFullYear(), pastTime.getMonth(), pastTime.getDate(), beginTime.getHours(), beginTime.getMinutes(), beginTime.getSeconds()), + utilities$2.DateUtils.safeCreateFromMinValue(pastTime.getFullYear(), pastTime.getMonth(), pastTime.getDate(), endTime.getHours(), endTime.getMinutes(), endTime.getSeconds()) + ]; + if (!recognizersText.StringUtility.isNullOrEmpty(timePeriodResolutionResult.comment) + && timePeriodResolutionResult.comment === "ampm") { + ret.comment = "ampm"; + } + ret.success = true; + ret.subDateTimeEntities = [pr, timePeriodParseResult]; + return ret; + } + } + else { + return this.parseSimpleCases(text, referenceTime); + } + } + return this.parseSimpleCases(text, referenceTime); + } + parseSimpleCases(source, referenceDate) { + let result = new utilities$2.DateTimeResolutionResult(); + let match = recognizersText.RegExpUtility.getMatches(this.config.pureNumberFromToRegex, source).pop(); + if (!match) { + match = recognizersText.RegExpUtility.getMatches(this.config.pureNumberBetweenAndRegex, source).pop(); + } + if (!match || (match.index !== 0 && match.index + match.length !== source.length)) + return result; + let hourGroup = match.groups('hour'); + let beginHour = this.config.numbers.get(hourGroup.captures[0]) || Number.parseInt(hourGroup.captures[0], 10) || 0; + let endHour = this.config.numbers.get(hourGroup.captures[1]) || Number.parseInt(hourGroup.captures[1], 10) || 0; + let er = this.config.dateExtractor.extract(source.replace(match.value, ""), referenceDate).pop(); + if (!er) + return result; + let pr = this.config.dateParser.parse(er, referenceDate); + if (!pr) + return result; + let dateResult = pr.value; + let futureDate = dateResult.futureValue; + let pastDate = dateResult.pastValue; + let dateStr = pr.timexStr; + let hasAm = false; + let hasPm = false; + let pmStr = match.groups('pm').value; + let amStr = match.groups('am').value; + let descStr = match.groups('desc').value; + if (!recognizersText.StringUtility.isNullOrEmpty(amStr) || descStr.startsWith('a')) { + if (beginHour >= 12) + beginHour -= 12; + if (endHour >= 12) + endHour -= 12; + hasAm = true; + } + if (!recognizersText.StringUtility.isNullOrEmpty(pmStr) || descStr.startsWith('p')) { + if (beginHour < 12) + beginHour += 12; + if (endHour < 12) + endHour += 12; + hasPm = true; + } + if (!hasAm && !hasPm && beginHour <= 12 && endHour <= 12) { + result.comment = "ampm"; + } + let beginStr = `${dateStr}T${utilities$2.FormatUtil.toString(beginHour, 2)}`; + let endStr = `${dateStr}T${utilities$2.FormatUtil.toString(endHour, 2)}`; + result.timex = `(${beginStr},${endStr},PT${endHour - beginHour}H)`; + result.futureValue = [ + utilities$2.DateUtils.safeCreateFromMinValue(futureDate.getFullYear(), futureDate.getMonth(), futureDate.getDate(), beginHour, 0, 0), + utilities$2.DateUtils.safeCreateFromMinValue(futureDate.getFullYear(), futureDate.getMonth(), futureDate.getDate(), endHour, 0, 0) + ]; + result.pastValue = [ + utilities$2.DateUtils.safeCreateFromMinValue(pastDate.getFullYear(), pastDate.getMonth(), pastDate.getDate(), beginHour, 0, 0), + utilities$2.DateUtils.safeCreateFromMinValue(pastDate.getFullYear(), pastDate.getMonth(), pastDate.getDate(), endHour, 0, 0) + ]; + result.success = true; + return result; + } + mergeTwoTimePoints(source, referenceDate) { + let result = new utilities$2.DateTimeResolutionResult(); + let prs; + let timeErs = this.config.timeExtractor.extract(source, referenceDate); + let datetimeErs = this.config.dateTimeExtractor.extract(source, referenceDate); + let bothHasDate = false; + let beginHasDate = false; + let endHasDate = false; + if (datetimeErs.length === 2) { + prs = this.getTwoPoints(datetimeErs[0], datetimeErs[1], this.config.dateTimeParser, this.config.dateTimeParser, referenceDate); + bothHasDate = true; + } + else if (datetimeErs.length === 1 && timeErs.length === 2) { + if (recognizersText.ExtractResult.isOverlap(datetimeErs[0], timeErs[0])) { + prs = this.getTwoPoints(datetimeErs[0], timeErs[1], this.config.dateTimeParser, this.config.timeParser, referenceDate); + beginHasDate = true; + } + else { + prs = this.getTwoPoints(timeErs[0], datetimeErs[0], this.config.timeParser, this.config.dateTimeParser, referenceDate); + endHasDate = true; + } + } + else if (datetimeErs.length === 1 && timeErs.length === 1) { + if (timeErs[0].start < datetimeErs[0].start) { + prs = this.getTwoPoints(timeErs[0], datetimeErs[0], this.config.timeParser, this.config.dateTimeParser, referenceDate); + endHasDate = true; + } + else { + prs = this.getTwoPoints(datetimeErs[0], timeErs[0], this.config.dateTimeParser, this.config.timeParser, referenceDate); + beginHasDate = true; + } + } + if (!prs || !prs.begin.value || !prs.end.value) + return result; + let begin = prs.begin.value; + let end = prs.end.value; + let futureBegin = begin.futureValue; + let futureEnd = end.futureValue; + let pastBegin = begin.pastValue; + let pastEnd = end.pastValue; + if (bothHasDate) { + if (futureBegin > futureEnd) + futureBegin = pastBegin; + if (pastEnd < pastBegin) + pastEnd = futureEnd; + result.timex = `(${prs.begin.timexStr},${prs.end.timexStr},PT${utilities$2.DateUtils.totalHours(futureEnd, futureBegin)}H)`; + } + else if (beginHasDate) { + futureEnd = utilities$2.DateUtils.safeCreateFromMinValue(futureBegin.getFullYear(), futureBegin.getMonth(), futureBegin.getDate(), futureEnd.getHours(), futureEnd.getMinutes(), futureEnd.getSeconds()); + pastEnd = utilities$2.DateUtils.safeCreateFromMinValue(pastBegin.getFullYear(), pastBegin.getMonth(), pastBegin.getDate(), pastEnd.getHours(), pastEnd.getMinutes(), pastEnd.getSeconds()); + let dateStr = prs.begin.timexStr.split('T').pop(); + result.timex = `(${prs.begin.timexStr},${dateStr}${prs.end.timexStr},PT${utilities$2.DateUtils.totalHours(futureEnd, futureBegin)}H)`; + } + else if (endHasDate) { + futureBegin = utilities$2.DateUtils.safeCreateFromMinValue(futureEnd.getFullYear(), futureEnd.getMonth(), futureEnd.getDate(), futureBegin.getHours(), futureBegin.getMinutes(), futureBegin.getSeconds()); + pastBegin = utilities$2.DateUtils.safeCreateFromMinValue(pastEnd.getFullYear(), pastEnd.getMonth(), pastEnd.getDate(), pastBegin.getHours(), pastBegin.getMinutes(), pastBegin.getSeconds()); + let dateStr = prs.end.timexStr.split('T')[0]; + result.timex = `(${dateStr}${prs.begin.timexStr},${prs.end.timexStr},PT${utilities$2.DateUtils.totalHours(futureEnd, futureBegin)}H)`; + } + if (!recognizersText.StringUtility.isNullOrEmpty(begin.comment) && begin.comment.endsWith('ampm') && !recognizersText.StringUtility.isNullOrEmpty(end.comment) && end.comment.endsWith('ampm')) { + result.comment = 'ampm'; + } + result.futureValue = [futureBegin, futureEnd]; + result.pastValue = [pastBegin, pastEnd]; + result.success = true; + result.subDateTimeEntities = [prs.begin, prs.end]; + return result; + } + getTwoPoints(beginEr, endEr, beginParser, endParser, referenceDate) { + let beginPr = beginParser.parse(beginEr, referenceDate); + let endPr = endParser.parse(endEr, referenceDate); + return { begin: beginPr, end: endPr }; + } + parseSpecificTimeOfDay(source, referenceDate) { + let result = new utilities$2.DateTimeResolutionResult(); + let timeText = source; + let hasEarly = false; + let hasLate = false; + let match = recognizersText.RegExpUtility.getMatches(this.config.periodTimeOfDayWithDateRegex, source).pop(); + if (match) { + timeText = match.groups('timeOfDay').value; + if (!recognizersText.StringUtility.isNullOrEmpty(match.groups('early').value)) { + hasEarly = true; + result.comment = 'early'; + } + else if (!recognizersText.StringUtility.isNullOrEmpty(match.groups('late').value)) { + hasLate = true; + result.comment = 'late'; + } + } + let matched = this.config.getMatchedTimeRange(timeText); + if (!matched || !matched.success) + return result; + if (hasEarly) { + matched.endHour = matched.beginHour + 2; + if (matched.endMin === 59) + matched.endMin = 0; + } + else if (hasLate) { + matched.beginHour += 2; + } + match = recognizersText.RegExpUtility.getMatches(this.config.specificTimeOfDayRegex, source).pop(); + if (match && match.index === 0 && match.length === source.length) { + let swift = this.config.getSwiftPrefix(source); + let date = utilities$2.DateUtils.addDays(referenceDate, swift); + result.timex = utilities$2.FormatUtil.formatDate(date) + matched.timeStr; + result.futureValue = [ + utilities$2.DateUtils.safeCreateFromMinValue(date.getFullYear(), date.getMonth(), date.getDate(), matched.beginHour, 0, 0), + utilities$2.DateUtils.safeCreateFromMinValue(date.getFullYear(), date.getMonth(), date.getDate(), matched.endHour, matched.endMin, matched.endMin), + ]; + result.pastValue = [ + utilities$2.DateUtils.safeCreateFromMinValue(date.getFullYear(), date.getMonth(), date.getDate(), matched.beginHour, 0, 0), + utilities$2.DateUtils.safeCreateFromMinValue(date.getFullYear(), date.getMonth(), date.getDate(), matched.endHour, matched.endMin, matched.endMin), + ]; + result.success = true; + return result; + } + match = recognizersText.RegExpUtility.getMatches(this.config.periodTimeOfDayWithDateRegex, source).pop(); + if (!match) + return result; + let beforeStr = source.substr(0, match.index).trim(); + let afterStr = source.substr(match.index + match.length).trim(); + let ers = this.config.dateExtractor.extract(beforeStr, referenceDate); + // eliminate time period, if any + let timePeriodErs = this.config.timePeriodExtractor.extract(beforeStr); + if (timePeriodErs.length > 0) { + beforeStr = beforeStr.slice(timePeriodErs[0].start || 0, timePeriodErs[0].start + timePeriodErs[0].length || 0).trim(); + } + else { + timePeriodErs = this.config.timePeriodExtractor.extract(afterStr); + if (timePeriodErs.length > 0) { + afterStr = afterStr.slice(timePeriodErs[0].start || 0, timePeriodErs[0].start + timePeriodErs[0].length || 0).trim(); + } + } + if (ers.length === 0 || ers[0].length !== beforeStr.length) { + let valid = false; + if (ers.length > 0 && ers[0].start === 0) { + let midStr = beforeStr.substr(ers[0].start + ers[0].length || 0); + if (recognizersText.StringUtility.isNullOrWhitespace(midStr.replace(',', ' '))) { + valid = true; + } + } + if (!valid) { + ers = this.config.dateExtractor.extract(afterStr); + if (ers.length === 0 || ers[0].length !== afterStr.length) { + if (ers.length > 0 && ers[0].start + ers[0].length === afterStr.length) { + let midStr = afterStr.substr(0, ers[0].start || 0); + if (recognizersText.StringUtility.isNullOrWhitespace(midStr.replace(',', ' '))) { + valid = true; + } + } + } + else { + valid = true; + } + if (!valid) { + return result; + } + } + } + let hasSpecificTimePeriod = false; + if (timePeriodErs.length > 0) { + let TimePr = this.config.timePeriodParser.parse(timePeriodErs[0], referenceDate); + if (TimePr != null) { + let periodFuture = TimePr.value.futureValue; + let periodPast = TimePr.value.pastValue; + if (periodFuture === periodPast) { + matched.beginHour = periodFuture.item1.getHours(); + matched.endHour = periodFuture.item2.getHours(); + } + else { + if (periodFuture.item1.Hour >= matched.beginHour || periodFuture.item2.Hour <= matched.endHour) { + matched.beginHour = periodFuture.item1.getHours(); + matched.endHour = periodFuture.item2.getHours(); + } + else { + matched.beginHour = periodPast.item1.getHours(); + matched.endHour = periodPast.item2.getHours(); + } + } + hasSpecificTimePeriod = true; + } + } + let pr = this.config.dateParser.parse(ers[0], referenceDate); + if (!pr) + return result; + let futureDate = pr.value.futureValue; + let pastDate = pr.value.pastValue; + if (!hasSpecificTimePeriod) { + result.timex = pr.timexStr + matched.timeStr; + } + else { + result.timex = `(${pr.timexStr}T${matched.beginHour},${pr.timexStr}T${matched.endHour},PT${matched.endHour - matched.beginHour}H)`; + } + result.futureValue = [ + utilities$2.DateUtils.safeCreateFromMinValue(futureDate.getFullYear(), futureDate.getMonth(), futureDate.getDate(), matched.beginHour, 0, 0), + utilities$2.DateUtils.safeCreateFromMinValue(futureDate.getFullYear(), futureDate.getMonth(), futureDate.getDate(), matched.endHour, matched.endMin, matched.endMin), + ]; + result.pastValue = [ + utilities$2.DateUtils.safeCreateFromMinValue(pastDate.getFullYear(), pastDate.getMonth(), pastDate.getDate(), matched.beginHour, 0, 0), + utilities$2.DateUtils.safeCreateFromMinValue(pastDate.getFullYear(), pastDate.getMonth(), pastDate.getDate(), matched.endHour, matched.endMin, matched.endMin), + ]; + result.success = true; + return result; + } + parseDuration(source, referenceDate) { + let result = new utilities$2.DateTimeResolutionResult(); + // for rest of datetime, it will be handled in next function + let restOfDateTimeMatch = recognizersText.RegExpUtility.getMatches(this.config.restOfDateTimeRegex, source); + if (restOfDateTimeMatch.length) { + return result; + } + let ers = this.config.durationExtractor.extract(source, referenceDate); + if (!ers || ers.length !== 1) + return result; + let pr = this.config.durationParser.parse(ers[0], referenceDate); + if (!pr) + return result; + let beforeStr = source.substr(0, pr.start).trim(); + let durationResult = pr.value; + let swiftSecond = 0; + let mod; + if (Number.isFinite(durationResult.pastValue) && Number.isFinite(durationResult.futureValue)) { + swiftSecond = Math.round(durationResult.futureValue); + } + let beginTime = new Date(referenceDate); + let endTime = new Date(referenceDate); + let prefixMatch = recognizersText.RegExpUtility.getMatches(this.config.pastRegex, beforeStr).pop(); + if (prefixMatch && prefixMatch.length === beforeStr.length) { + mod = constants$2.TimeTypeConstants.beforeMod; + beginTime.setSeconds(referenceDate.getSeconds() - swiftSecond); + } + prefixMatch = recognizersText.RegExpUtility.getMatches(this.config.futureRegex, beforeStr).pop(); + if (prefixMatch && prefixMatch.length === beforeStr.length) { + mod = constants$2.TimeTypeConstants.afterMod; + endTime = new Date(beginTime); + endTime.setSeconds(beginTime.getSeconds() + swiftSecond); + } + let luisDateBegin = utilities$2.FormatUtil.luisDateFromDate(beginTime); + let luisTimeBegin = utilities$2.FormatUtil.luisTimeFromDate(beginTime); + let luisDateEnd = utilities$2.FormatUtil.luisDateFromDate(endTime); + let luisTimeEnd = utilities$2.FormatUtil.luisTimeFromDate(endTime); + result.timex = `(${luisDateBegin}T${luisTimeBegin},${luisDateEnd}T${luisTimeEnd},${durationResult.timex})`; + result.futureValue = [beginTime, endTime]; + result.pastValue = [beginTime, endTime]; + result.success = true; + if (mod) { + pr.value.mod = mod; + } + result.subDateTimeEntities = [pr]; + return result; + } + isFloat(value) { + return Number.isFinite(value) && !Number.isInteger(value); + } + parseRelativeUnit(source, referenceDate) { + let result = new utilities$2.DateTimeResolutionResult(); + let match = recognizersText.RegExpUtility.getMatches(this.config.relativeTimeUnitRegex, source).pop(); + if (!match) { + match = recognizersText.RegExpUtility.getMatches(this.config.restOfDateTimeRegex, source).pop(); + } + if (!match) + return result; + let srcUnit = match.groups('unit').value; + let unitStr = this.config.unitMap.get(srcUnit); + if (!unitStr) + return result; + let swift = 1; + let prefixMatch = recognizersText.RegExpUtility.getMatches(this.config.pastRegex, source).pop(); + if (prefixMatch) + swift = -1; + let beginTime = new Date(referenceDate); + let endTime = new Date(referenceDate); + let ptTimex = ''; + switch (unitStr) { + case 'D': + endTime = utilities$2.DateUtils.safeCreateFromMinValue(beginTime.getFullYear(), beginTime.getMonth(), beginTime.getDate()); + endTime.setDate(endTime.getDate() + 1); + endTime.setSeconds(endTime.getSeconds() - 1); + ptTimex = `PT${utilities$2.DateUtils.totalSeconds(endTime, beginTime)}S`; + break; + case 'H': + beginTime.setHours(beginTime.getHours() + (swift > 0 ? 0 : swift)); + endTime.setHours(endTime.getHours() + (swift > 0 ? swift : 0)); + ptTimex = `PT1H`; + break; + case 'M': + beginTime.setMinutes(beginTime.getMinutes() + (swift > 0 ? 0 : swift)); + endTime.setMinutes(endTime.getMinutes() + (swift > 0 ? swift : 0)); + ptTimex = `PT1M`; + break; + case 'S': + beginTime.setSeconds(beginTime.getSeconds() + (swift > 0 ? 0 : swift)); + endTime.setSeconds(endTime.getSeconds() + (swift > 0 ? swift : 0)); + ptTimex = `PT1S`; + break; + default: return result; + } + let luisDateBegin = utilities$2.FormatUtil.luisDateFromDate(beginTime); + let luisTimeBegin = utilities$2.FormatUtil.luisTimeFromDate(beginTime); + let luisDateEnd = utilities$2.FormatUtil.luisDateFromDate(endTime); + let luisTimeEnd = utilities$2.FormatUtil.luisTimeFromDate(endTime); + result.timex = `(${luisDateBegin}T${luisTimeBegin},${luisDateEnd}T${luisTimeEnd},${ptTimex})`; + result.futureValue = [beginTime, endTime]; + result.pastValue = [beginTime, endTime]; + result.success = true; + return result; + } +} +exports.BaseDateTimePeriodParser = BaseDateTimePeriodParser; + +}); + +unwrapExports(baseDateTimePeriod); + +var baseDuration = createCommonjsModule(function (module, exports) { +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); + + + + +class BaseDurationExtractor { + constructor(config) { + this.extractorName = constants$2.Constants.SYS_DATETIME_DURATION; + this.config = config; + } + extract(source, refDate) { + if (!refDate) + refDate = new Date(); + let baseTokens = this.numberWithUnit(source); + let tokens = new Array() + .concat(baseTokens) + .concat(this.numberWithUnitAndSuffix(source, baseTokens)) + .concat(this.implicitDuration(source)); + let result = utilities$2.Token.mergeAllTokens(tokens, source, this.extractorName); + this.resolveMoreThanOrLessThanPrefix(source, result); + return result; + } + // handle cases look like: {more than | less than} {duration}? + resolveMoreThanOrLessThanPrefix(text, ers) { + for (let er of ers) { + var beforeString = text.substr(0, er.start); + let match = recognizersText.RegExpUtility.getMatches(this.config.moreThanRegex, beforeString); + if (match && match.length) { + er.data = constants$2.TimeTypeConstants.moreThanMod; + } + if (!match || match.length === 0) { + match = recognizersText.RegExpUtility.getMatches(this.config.lessThanRegex, beforeString); + if (match && match.length) { + er.data = constants$2.TimeTypeConstants.lessThanMod; + } + } + if (match && match.length) { + er.length += er.start - match[0].index; + er.start = match[0].index; + er.text = text.substr(er.start, er.length); + } + } + } + numberWithUnit(source) { + return this.config.cardinalExtractor.extract(source) + .map(o => { + let afterString = source.substring(o.start + o.length); + let match = recognizersText.RegExpUtility.getMatches(this.config.followedUnit, afterString)[0]; + if (match && match.index === 0) { + return new utilities$2.Token(o.start | 0, o.start + o.length + match.length); + } + }).filter(o => o !== undefined) + .concat(this.getTokensFromRegex(this.config.numberCombinedWithUnit, source)) + .concat(this.getTokensFromRegex(this.config.anUnitRegex, source)) + .concat(this.getTokensFromRegex(this.config.inexactNumberUnitRegex, source)); + } + numberWithUnitAndSuffix(source, ers) { + return ers.map(o => { + let afterString = source.substring(o.start + o.length); + let match = recognizersText.RegExpUtility.getMatches(this.config.suffixAndRegex, afterString)[0]; + if (match && match.index === 0) { + return new utilities$2.Token(o.start | 0, o.start + o.length + match.length); + } + }); + } + implicitDuration(source) { + // handle "all day", "all year" + return this.getTokensFromRegex(this.config.allRegex, source) + // handle "half day", "half year" + .concat(this.getTokensFromRegex(this.config.halfRegex, source)) + // handle "next day", "last year" + .concat(this.getTokensFromRegex(this.config.relativeDurationUnitRegex, source)); + } + getTokensFromRegex(regexp, source) { + return recognizersText.RegExpUtility.getMatches(regexp, source) + .map(o => new utilities$2.Token(o.index, o.index + o.length)); + } +} +exports.BaseDurationExtractor = BaseDurationExtractor; +class BaseDurationParser { + constructor(config) { + this.parserName = constants$2.Constants.SYS_DATETIME_DURATION; + this.config = config; + } + parse(extractorResult, referenceDate) { + if (!referenceDate) + referenceDate = new Date(); + let resultValue; + if (extractorResult.type === this.parserName) { + let source = extractorResult.text.toLowerCase(); + let innerResult = this.parseNumberWithUnit(source, referenceDate); + if (!innerResult.success) { + innerResult = this.parseImplicitDuration(source, referenceDate); + } + if (innerResult.success) { + innerResult.futureResolution = {}; + innerResult.futureResolution[constants$2.TimeTypeConstants.DURATION] = innerResult.futureValue.toString(); + innerResult.pastResolution = {}; + innerResult.pastResolution[constants$2.TimeTypeConstants.DURATION] = innerResult.pastValue.toString(); + resultValue = innerResult; + } + } + var value = resultValue; + if (value && extractorResult.data) { + if (extractorResult.data === constants$2.TimeTypeConstants.moreThanMod || + extractorResult.data === constants$2.TimeTypeConstants.lessThanMod) { + value.mod = extractorResult.data; + } + } + let result = new parsers$4.DateTimeParseResult(extractorResult); + result.value = resultValue; + result.timexStr = resultValue ? resultValue.timex : ''; + result.resolutionStr = ''; + return result; + } + parseNumberWithUnit(source, referenceDate) { + let trimmedSource = source.trim(); + let result = this.parseNumberSpaceUnit(trimmedSource); + if (!result.success) { + result = this.parseNumberCombinedUnit(trimmedSource); + } + if (!result.success) { + result = this.parseAnUnit(trimmedSource); + } + if (!result.success) { + result = this.parseInexactNumberUnit(trimmedSource); + } + return result; + } + parseImplicitDuration(source, referenceDate) { + let trimmedSource = source.trim(); + // handle "all day" "all year" + let result = this.getResultFromRegex(this.config.allDateUnitRegex, trimmedSource, 1); + // handle "half day", "half year" + if (!result.success) { + result = this.getResultFromRegex(this.config.halfDateUnitRegex, trimmedSource, 0.5); + } + // handle single duration unit, it is filtered in the extraction that there is a relative word in advance + if (!result.success) { + result = this.getResultFromRegex(this.config.followedUnit, trimmedSource, 1); + } + return result; + } + getResultFromRegex(regex, source, num) { + let result = new utilities$2.DateTimeResolutionResult(); + let match = recognizersText.RegExpUtility.getMatches(regex, source).pop(); + if (!match) + return result; + let sourceUnit = match.groups('unit').value; + if (!this.config.unitMap.has(sourceUnit)) + return result; + let unitStr = this.config.unitMap.get(sourceUnit); + result.timex = `P${this.isLessThanDay(unitStr) ? 'T' : ''}${num}${unitStr[0]}`; + result.futureValue = num * this.config.unitValueMap.get(sourceUnit); + result.pastValue = result.futureValue; + result.success = true; + return result; + } + parseNumberSpaceUnit(source) { + let result = new utilities$2.DateTimeResolutionResult(); + let suffixStr = source; + let ers = this.config.cardinalExtractor.extract(source); + if (ers && ers.length === 1) { + let er = ers[0]; + let sourceUnit = ''; + let pr = this.config.numberParser.parse(er); + let noNumStr = source.substr(er.start + er.length).trim().toLowerCase(); + let match = recognizersText.RegExpUtility.getMatches(this.config.followedUnit, noNumStr).pop(); + if (match) { + sourceUnit = match.groups('unit').value; + suffixStr = match.groups('suffix').value; + } + if (this.config.unitMap.has(sourceUnit)) { + let num = Number.parseFloat(pr.value) + this.parseNumberWithUnitAndSuffix(suffixStr); + let unitStr = this.config.unitMap.get(sourceUnit); + result.timex = `P${this.isLessThanDay(unitStr) ? 'T' : ''}${num}${unitStr[0]}`; + result.futureValue = num * this.config.unitValueMap.get(sourceUnit); + result.pastValue = result.futureValue; + result.success = true; + return result; + } + } + return result; + } + parseNumberWithUnitAndSuffix(source) { + let match = recognizersText.RegExpUtility.getMatches(this.config.suffixAndRegex, source).pop(); + if (match) { + let numStr = match.groups('suffix_num').value; + if (this.config.doubleNumbers.has(numStr)) { + return this.config.doubleNumbers.get(numStr); + } + } + return 0; + } + parseNumberCombinedUnit(source) { + let result = new utilities$2.DateTimeResolutionResult(); + let match = recognizersText.RegExpUtility.getMatches(this.config.numberCombinedWithUnit, source).pop(); + if (!match) + return result; + let num = Number.parseFloat(match.groups('num').value) + this.parseNumberWithUnitAndSuffix(source); + let sourceUnit = match.groups('unit').value; + if (this.config.unitMap.has(sourceUnit)) { + let unitStr = this.config.unitMap.get(sourceUnit); + if (num > 1000 && (unitStr === 'Y' || unitStr === 'MON' || unitStr === 'W')) { + return result; + } + result.timex = `P${this.isLessThanDay(unitStr) ? 'T' : ''}${num}${unitStr[0]}`; + result.futureValue = num * this.config.unitValueMap.get(sourceUnit); + result.pastValue = result.futureValue; + result.success = true; + return result; + } + return result; + } + parseAnUnit(source) { + let result = new utilities$2.DateTimeResolutionResult(); + let match = recognizersText.RegExpUtility.getMatches(this.config.anUnitRegex, source).pop(); + if (!match) { + match = recognizersText.RegExpUtility.getMatches(this.config.halfDateUnitRegex, source).pop(); + } + if (!match) + return result; + let num = recognizersText.StringUtility.isNullOrEmpty(match.groups('half').value) ? 1 : 0.5; + num += this.parseNumberWithUnitAndSuffix(source); + let sourceUnit = match.groups('unit').value; + if (this.config.unitMap.has(sourceUnit)) { + let unitStr = this.config.unitMap.get(sourceUnit); + result.timex = `P${this.isLessThanDay(unitStr) ? 'T' : ''}${num}${unitStr[0]}`; + result.futureValue = num * this.config.unitValueMap.get(sourceUnit); + result.pastValue = result.futureValue; + result.success = true; + return result; + } + return result; + } + parseInexactNumberUnit(source) { + let result = new utilities$2.DateTimeResolutionResult(); + let match = recognizersText.RegExpUtility.getMatches(this.config.inexactNumberUnitRegex, source).pop(); + if (!match) + return result; + let num; + if (match.groups('NumTwoTerm').value) { + num = 2; + } + else { + // set the inexact number "few", "some" to 3 for now + num = 3; + } + let sourceUnit = match.groups('unit').value; + if (this.config.unitMap.has(sourceUnit)) { + let unitStr = this.config.unitMap.get(sourceUnit); + if (num > 1000 && (unitStr === 'Y' || unitStr === 'MON' || unitStr === 'W')) { + return result; + } + result.timex = `P${this.isLessThanDay(unitStr) ? 'T' : ''}${num}${unitStr[0]}`; + result.futureValue = num * this.config.unitValueMap.get(sourceUnit); + result.pastValue = result.futureValue; + result.success = true; + return result; + } + return result; + } + isLessThanDay(source) { + return (source === 'S') || (source === 'M') || (source === 'H'); + } +} +exports.BaseDurationParser = BaseDurationParser; + +}); + +unwrapExports(baseDuration); + +var durationConfiguration = createCommonjsModule(function (module, exports) { +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); + + + +class EnglishDurationExtractorConfiguration { + constructor() { + this.allRegex = recognizersText.RegExpUtility.getSafeRegExp(englishDateTime.EnglishDateTime.AllRegex); + this.halfRegex = recognizersText.RegExpUtility.getSafeRegExp(englishDateTime.EnglishDateTime.HalfRegex); + this.followedUnit = recognizersText.RegExpUtility.getSafeRegExp(englishDateTime.EnglishDateTime.DurationFollowedUnit); + this.numberCombinedWithUnit = recognizersText.RegExpUtility.getSafeRegExp(englishDateTime.EnglishDateTime.NumberCombinedWithDurationUnit); + this.anUnitRegex = recognizersText.RegExpUtility.getSafeRegExp(englishDateTime.EnglishDateTime.AnUnitRegex); + this.inexactNumberUnitRegex = recognizersText.RegExpUtility.getSafeRegExp(englishDateTime.EnglishDateTime.InexactNumberUnitRegex); + this.suffixAndRegex = recognizersText.RegExpUtility.getSafeRegExp(englishDateTime.EnglishDateTime.SuffixAndRegex); + this.relativeDurationUnitRegex = recognizersText.RegExpUtility.getSafeRegExp(englishDateTime.EnglishDateTime.RelativeDurationUnitRegex); + this.moreThanRegex = recognizersText.RegExpUtility.getSafeRegExp(englishDateTime.EnglishDateTime.MoreThanRegex); + this.lessThanRegex = recognizersText.RegExpUtility.getSafeRegExp(englishDateTime.EnglishDateTime.LessThanRegex); + this.cardinalExtractor = new recognizersTextNumber.EnglishCardinalExtractor(); + } +} +exports.EnglishDurationExtractorConfiguration = EnglishDurationExtractorConfiguration; +class EnglishDurationParserConfiguration { + constructor(config) { + this.cardinalExtractor = config.cardinalExtractor; + this.numberParser = config.numberParser; + this.followedUnit = recognizersText.RegExpUtility.getSafeRegExp(englishDateTime.EnglishDateTime.DurationFollowedUnit); + this.suffixAndRegex = recognizersText.RegExpUtility.getSafeRegExp(englishDateTime.EnglishDateTime.SuffixAndRegex); + this.numberCombinedWithUnit = recognizersText.RegExpUtility.getSafeRegExp(englishDateTime.EnglishDateTime.NumberCombinedWithDurationUnit); + this.anUnitRegex = recognizersText.RegExpUtility.getSafeRegExp(englishDateTime.EnglishDateTime.AnUnitRegex); + this.allDateUnitRegex = recognizersText.RegExpUtility.getSafeRegExp(englishDateTime.EnglishDateTime.AllRegex); + this.halfDateUnitRegex = recognizersText.RegExpUtility.getSafeRegExp(englishDateTime.EnglishDateTime.HalfRegex); + this.inexactNumberUnitRegex = recognizersText.RegExpUtility.getSafeRegExp(englishDateTime.EnglishDateTime.InexactNumberUnitRegex); + this.unitMap = config.unitMap; + this.unitValueMap = config.unitValueMap; + this.doubleNumbers = config.doubleNumbers; + } +} +exports.EnglishDurationParserConfiguration = EnglishDurationParserConfiguration; + +}); + +unwrapExports(durationConfiguration); + +var timeConfiguration = createCommonjsModule(function (module, exports) { +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); + + +class EnglishTimeExtractorConfiguration { + constructor() { + this.timeRegexList = EnglishTimeExtractorConfiguration.timeRegexList; + this.atRegex = EnglishTimeExtractorConfiguration.atRegex; + this.ishRegex = EnglishTimeExtractorConfiguration.ishRegex; + } +} +EnglishTimeExtractorConfiguration.timeRegexList = [ + // (three min past)? seven|7|(seven thirty) pm + recognizersText.RegExpUtility.getSafeRegExp(englishDateTime.EnglishDateTime.TimeRegex1, "gis"), + // (three min past)? 3:00(:00)? (pm)? + recognizersText.RegExpUtility.getSafeRegExp(englishDateTime.EnglishDateTime.TimeRegex2, "gis"), + // (three min past)? 3.00 (pm) + recognizersText.RegExpUtility.getSafeRegExp(englishDateTime.EnglishDateTime.TimeRegex3, "gis"), + // (three min past) (five thirty|seven|7|7:00(:00)?) (pm)? (in the night) + recognizersText.RegExpUtility.getSafeRegExp(englishDateTime.EnglishDateTime.TimeRegex4, "gis"), + // (three min past) (five thirty|seven|7|7:00(:00)?) (pm)? + recognizersText.RegExpUtility.getSafeRegExp(englishDateTime.EnglishDateTime.TimeRegex5, "gis"), + // (five thirty|seven|7|7:00(:00)?) (pm)? (in the night) + recognizersText.RegExpUtility.getSafeRegExp(englishDateTime.EnglishDateTime.TimeRegex6, "gis"), + // (in the night) at (five thirty|seven|7|7:00(:00)?) (pm)? + recognizersText.RegExpUtility.getSafeRegExp(englishDateTime.EnglishDateTime.TimeRegex7, "gis"), + // (in the night) (five thirty|seven|7|7:00(:00)?) (pm)? + recognizersText.RegExpUtility.getSafeRegExp(englishDateTime.EnglishDateTime.TimeRegex8, "gis"), + recognizersText.RegExpUtility.getSafeRegExp(englishDateTime.EnglishDateTime.TimeRegex9, "gis"), + // (three min past)? 3h00 (pm)? + recognizersText.RegExpUtility.getSafeRegExp(englishDateTime.EnglishDateTime.TimeRegex10, "gis"), + // at 2.30, before 6.30pm. 'at' prefix or 'am/pm' suffix is required here + recognizersText.RegExpUtility.getSafeRegExp(englishDateTime.EnglishDateTime.TimeRegex11, "gis"), + // 340pm + recognizersText.RegExpUtility.getSafeRegExp(englishDateTime.EnglishDateTime.ConnectNumRegex, "gis") +]; +EnglishTimeExtractorConfiguration.atRegex = recognizersText.RegExpUtility.getSafeRegExp(englishDateTime.EnglishDateTime.AtRegex, "gis"); +EnglishTimeExtractorConfiguration.lessThanOneHour = recognizersText.RegExpUtility.getSafeRegExp(englishDateTime.EnglishDateTime.LessThanOneHour, "gis"); +EnglishTimeExtractorConfiguration.timeSuffix = recognizersText.RegExpUtility.getSafeRegExp(englishDateTime.EnglishDateTime.TimeSuffix, "gis"); +EnglishTimeExtractorConfiguration.timeSuffixFull = recognizersText.RegExpUtility.getSafeRegExp(englishDateTime.EnglishDateTime.TimeSuffixFull, "gis"); +EnglishTimeExtractorConfiguration.ishRegex = recognizersText.RegExpUtility.getSafeRegExp(englishDateTime.EnglishDateTime.IshRegex, "gis"); +exports.EnglishTimeExtractorConfiguration = EnglishTimeExtractorConfiguration; +class EnglishTimeParserConfiguration { + constructor(config) { + this.timeTokenPrefix = englishDateTime.EnglishDateTime.TimeTokenPrefix; + this.atRegex = EnglishTimeExtractorConfiguration.atRegex; + this.timeRegexes = EnglishTimeExtractorConfiguration.timeRegexList; + this.numbers = config.numbers; + this.lunchRegex = recognizersText.RegExpUtility.getSafeRegExp(englishDateTime.EnglishDateTime.LunchRegex); + this.timeSuffixFull = recognizersText.RegExpUtility.getSafeRegExp(englishDateTime.EnglishDateTime.TimeSuffixFull); + this.nightRegex = recognizersText.RegExpUtility.getSafeRegExp(englishDateTime.EnglishDateTime.NightRegex); + this.utilityConfiguration = config.utilityConfiguration; + } + adjustByPrefix(prefix, adjust) { + let deltaMin = 0; + let trimmedPrefix = prefix.trim().toLowerCase(); + if (trimmedPrefix.startsWith("half")) { + deltaMin = 30; + } + else if (trimmedPrefix.startsWith("a quarter") || trimmedPrefix.startsWith("quarter")) { + deltaMin = 15; + } + else if (trimmedPrefix.startsWith("three quarter")) { + deltaMin = 45; + } + else { + let match = recognizersText.RegExpUtility.getMatches(EnglishTimeExtractorConfiguration.lessThanOneHour, trimmedPrefix); + let minStr = match[0].groups("deltamin").value; + if (minStr) { + deltaMin = Number.parseInt(minStr, 10); + } + else { + minStr = match[0].groups("deltaminnum").value.toLowerCase(); + deltaMin = this.numbers.get(minStr); + } + } + if (trimmedPrefix.endsWith("to")) { + deltaMin = -deltaMin; + } + adjust.min += deltaMin; + if (adjust.min < 0) { + adjust.min += 60; + adjust.hour -= 1; + } + adjust.hasMin = true; + } + adjustBySuffix(suffix, adjust) { + let trimmedSuffix = suffix.trim().toLowerCase(); + let deltaHour = 0; + let matches = recognizersText.RegExpUtility.getMatches(EnglishTimeExtractorConfiguration.timeSuffixFull, trimmedSuffix); + if (matches.length > 0 && matches[0].index === 0 && matches[0].length === trimmedSuffix.length) { + let oclockStr = matches[0].groups("oclock").value; + if (!oclockStr) { + let amStr = matches[0].groups("am").value; + if (amStr) { + if (adjust.hour >= 12) { + deltaHour = -12; + } + else { + adjust.hasAm = true; + } + } + let pmStr = matches[0].groups("pm").value; + if (pmStr) { + if (adjust.hour < 12) { + deltaHour = 12; + } + if (recognizersText.RegExpUtility.getMatches(this.lunchRegex, pmStr).length > 0) { + // for hour>=10, <12 + if (adjust.hour >= 10 && adjust.hour <= 12) { + deltaHour = 0; + if (adjust.hour === 12) { + adjust.hasPm = true; + } + else { + adjust.hasAm = true; + } + } + else { + adjust.hasPm = true; + } + } + else if (recognizersText.RegExpUtility.getMatches(this.nightRegex, pmStr).length > 0) { + // for hour <=3 or === 12, we treat it as am, for example 1 in the night (midnight) === 1am + if (adjust.hour <= 3 || adjust.hour === 12) { + if (adjust.hour === 12) { + adjust.hour = 0; + } + deltaHour = 0; + adjust.hasAm = true; + } + else { + adjust.hasPm = true; + } + } + else { + adjust.hasPm = true; + } + } + } + } + adjust.hour = (adjust.hour + deltaHour) % 24; + } +} +exports.EnglishTimeParserConfiguration = EnglishTimeParserConfiguration; + +}); + +unwrapExports(timeConfiguration); + +var dateConfiguration = createCommonjsModule(function (module, exports) { +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); + + + + + + + +class EnglishDateExtractorConfiguration { + constructor() { + this.dateRegexList = [ + recognizersText.RegExpUtility.getSafeRegExp(englishDateTime.EnglishDateTime.DateExtractor1), + recognizersText.RegExpUtility.getSafeRegExp(englishDateTime.EnglishDateTime.DateExtractor2), + recognizersText.RegExpUtility.getSafeRegExp(englishDateTime.EnglishDateTime.DateExtractor3), + englishDateTime.EnglishDateTime.DefaultLanguageFallback === constants$2.Constants.DefaultLanguageFallback_MDY ? + recognizersText.RegExpUtility.getSafeRegExp(englishDateTime.EnglishDateTime.DateExtractor4) : + recognizersText.RegExpUtility.getSafeRegExp(englishDateTime.EnglishDateTime.DateExtractor5), + englishDateTime.EnglishDateTime.DefaultLanguageFallback === constants$2.Constants.DefaultLanguageFallback_MDY ? + recognizersText.RegExpUtility.getSafeRegExp(englishDateTime.EnglishDateTime.DateExtractor5) : + recognizersText.RegExpUtility.getSafeRegExp(englishDateTime.EnglishDateTime.DateExtractor4), + recognizersText.RegExpUtility.getSafeRegExp(englishDateTime.EnglishDateTime.DateExtractor6), + recognizersText.RegExpUtility.getSafeRegExp(englishDateTime.EnglishDateTime.DateExtractor7), + recognizersText.RegExpUtility.getSafeRegExp(englishDateTime.EnglishDateTime.DateExtractor8), + recognizersText.RegExpUtility.getSafeRegExp(englishDateTime.EnglishDateTime.DateExtractor9), + recognizersText.RegExpUtility.getSafeRegExp(englishDateTime.EnglishDateTime.DateExtractorA), + ]; + this.implicitDateList = [ + recognizersText.RegExpUtility.getSafeRegExp(englishDateTime.EnglishDateTime.OnRegex), + recognizersText.RegExpUtility.getSafeRegExp(englishDateTime.EnglishDateTime.RelaxedOnRegex), + recognizersText.RegExpUtility.getSafeRegExp(englishDateTime.EnglishDateTime.SpecialDayRegex), + recognizersText.RegExpUtility.getSafeRegExp(englishDateTime.EnglishDateTime.SpecialDayWithNumRegex), + recognizersText.RegExpUtility.getSafeRegExp(englishDateTime.EnglishDateTime.ThisRegex), + recognizersText.RegExpUtility.getSafeRegExp(englishDateTime.EnglishDateTime.LastDateRegex), + recognizersText.RegExpUtility.getSafeRegExp(englishDateTime.EnglishDateTime.NextDateRegex), + recognizersText.RegExpUtility.getSafeRegExp(englishDateTime.EnglishDateTime.SingleWeekDayRegex), + recognizersText.RegExpUtility.getSafeRegExp(englishDateTime.EnglishDateTime.WeekDayOfMonthRegex), + recognizersText.RegExpUtility.getSafeRegExp(englishDateTime.EnglishDateTime.SpecialDate), + recognizersText.RegExpUtility.getSafeRegExp(englishDateTime.EnglishDateTime.RelativeWeekDayRegex), + ]; + this.monthEnd = recognizersText.RegExpUtility.getSafeRegExp(englishDateTime.EnglishDateTime.MonthEnd); + this.ofMonth = recognizersText.RegExpUtility.getSafeRegExp(englishDateTime.EnglishDateTime.OfMonth); + this.dateUnitRegex = recognizersText.RegExpUtility.getSafeRegExp(englishDateTime.EnglishDateTime.DateUnitRegex); + this.forTheRegex = recognizersText.RegExpUtility.getSafeRegExp(englishDateTime.EnglishDateTime.ForTheRegex); + this.weekDayAndDayOfMonthRegex = recognizersText.RegExpUtility.getSafeRegExp(englishDateTime.EnglishDateTime.WeekDayAndDayOfMonthRegex); + this.relativeMonthRegex = recognizersText.RegExpUtility.getSafeRegExp(englishDateTime.EnglishDateTime.RelativeMonthRegex); + this.weekDayRegex = recognizersText.RegExpUtility.getSafeRegExp(englishDateTime.EnglishDateTime.WeekDayRegex); + this.dayOfWeek = englishDateTime.EnglishDateTime.DayOfWeek; + this.ordinalExtractor = new recognizersTextNumber.EnglishOrdinalExtractor(); + this.integerExtractor = new recognizersTextNumber.EnglishIntegerExtractor(); + this.numberParser = new recognizersTextNumber.BaseNumberParser(new recognizersTextNumber.EnglishNumberParserConfiguration()); + this.durationExtractor = new baseDuration.BaseDurationExtractor(new durationConfiguration.EnglishDurationExtractorConfiguration()); + this.utilityConfiguration = new baseConfiguration.EnglishDateTimeUtilityConfiguration(); + } +} +exports.EnglishDateExtractorConfiguration = EnglishDateExtractorConfiguration; +class EnglishDateParserConfiguration { + constructor(config) { + this.ordinalExtractor = config.ordinalExtractor; + this.integerExtractor = config.integerExtractor; + this.cardinalExtractor = config.cardinalExtractor; + this.durationExtractor = config.durationExtractor; + this.numberParser = config.numberParser; + this.durationParser = config.durationParser; + this.monthOfYear = config.monthOfYear; + this.dayOfMonth = config.dayOfMonth; + this.dayOfWeek = config.dayOfWeek; + this.unitMap = config.unitMap; + this.cardinalMap = config.cardinalMap; + this.dateRegex = new EnglishDateExtractorConfiguration().dateRegexList; + this.onRegex = recognizersText.RegExpUtility.getSafeRegExp(englishDateTime.EnglishDateTime.OnRegex); + this.specialDayRegex = recognizersText.RegExpUtility.getSafeRegExp(englishDateTime.EnglishDateTime.SpecialDayRegex); + this.specialDayWithNumRegex = recognizersText.RegExpUtility.getSafeRegExp(englishDateTime.EnglishDateTime.SpecialDayWithNumRegex); + this.nextRegex = recognizersText.RegExpUtility.getSafeRegExp(englishDateTime.EnglishDateTime.NextDateRegex); + this.unitRegex = recognizersText.RegExpUtility.getSafeRegExp(englishDateTime.EnglishDateTime.DateUnitRegex); + this.monthRegex = recognizersText.RegExpUtility.getSafeRegExp(englishDateTime.EnglishDateTime.MonthRegex); + this.weekDayRegex = recognizersText.RegExpUtility.getSafeRegExp(englishDateTime.EnglishDateTime.WeekDayRegex); + this.lastRegex = recognizersText.RegExpUtility.getSafeRegExp(englishDateTime.EnglishDateTime.LastDateRegex); + this.thisRegex = recognizersText.RegExpUtility.getSafeRegExp(englishDateTime.EnglishDateTime.ThisRegex); + this.weekDayOfMonthRegex = recognizersText.RegExpUtility.getSafeRegExp(englishDateTime.EnglishDateTime.WeekDayOfMonthRegex); + this.forTheRegex = recognizersText.RegExpUtility.getSafeRegExp(englishDateTime.EnglishDateTime.ForTheRegex); + this.weekDayAndDayOfMonthRegex = recognizersText.RegExpUtility.getSafeRegExp(englishDateTime.EnglishDateTime.WeekDayAndDayOfMonthRegex); + this.relativeMonthRegex = recognizersText.RegExpUtility.getSafeRegExp(englishDateTime.EnglishDateTime.RelativeMonthRegex); + this.relativeWeekDayRegex = recognizersText.RegExpUtility.getSafeRegExp(englishDateTime.EnglishDateTime.RelativeWeekDayRegex); + this.utilityConfiguration = config.utilityConfiguration; + this.dateTokenPrefix = englishDateTime.EnglishDateTime.DateTokenPrefix; + } + getSwiftDay(source) { + let trimmedText = source.trim().toLowerCase(); + let swift = 0; + let matches = recognizersText.RegExpUtility.getMatches(EnglishDateParserConfiguration.relativeDayRegex, source); + if (trimmedText === "today") { + swift = 0; + } + else if (trimmedText === "tomorrow" || trimmedText === "tmr") { + swift = 1; + } + else if (trimmedText === "yesterday") { + swift = -1; + } + else if (trimmedText.endsWith("day after tomorrow") || + trimmedText.endsWith("day after tmr")) { + swift = 2; + } + else if (trimmedText.endsWith("day before yesterday")) { + swift = -2; + } + else if (matches.length) { + swift = this.getSwift(source); + } + return swift; + } + getSwiftMonth(source) { + return this.getSwift(source); + } + getSwift(source) { + let trimmedText = source.trim().toLowerCase(); + let swift = 0; + let nextPrefixMatches = recognizersText.RegExpUtility.getMatches(EnglishDateParserConfiguration.nextPrefixRegex, trimmedText); + let pastPrefixMatches = recognizersText.RegExpUtility.getMatches(EnglishDateParserConfiguration.pastPrefixRegex, trimmedText); + if (nextPrefixMatches.length) { + swift = 1; + } + else if (pastPrefixMatches.length) { + swift = -1; + } + return swift; + } + isCardinalLast(source) { + let trimmedText = source.trim().toLowerCase(); + return trimmedText === "last"; + } +} +// The following three regexes only used in this configuration +// They are not used in the base parser, therefore they are not extracted +// If the spanish date parser need the same regexes, they should be extracted +EnglishDateParserConfiguration.relativeDayRegex = recognizersText.RegExpUtility.getSafeRegExp(englishDateTime.EnglishDateTime.RelativeDayRegex); +EnglishDateParserConfiguration.nextPrefixRegex = recognizersText.RegExpUtility.getSafeRegExp(englishDateTime.EnglishDateTime.NextPrefixRegex); +EnglishDateParserConfiguration.pastPrefixRegex = recognizersText.RegExpUtility.getSafeRegExp(englishDateTime.EnglishDateTime.PastPrefixRegex); +exports.EnglishDateParserConfiguration = EnglishDateParserConfiguration; + +}); + +unwrapExports(dateConfiguration); + +var dateTimeConfiguration = createCommonjsModule(function (module, exports) { +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); + + + + + + + + + +class EnglishDateTimeExtractorConfiguration { + constructor() { + this.datePointExtractor = new baseDate.BaseDateExtractor(new dateConfiguration.EnglishDateExtractorConfiguration()); + this.timePointExtractor = new baseTime.BaseTimeExtractor(new timeConfiguration.EnglishTimeExtractorConfiguration()); + this.durationExtractor = new baseDuration.BaseDurationExtractor(new durationConfiguration.EnglishDurationExtractorConfiguration()); + this.suffixRegex = recognizersText.RegExpUtility.getSafeRegExp(englishDateTime.EnglishDateTime.SuffixRegex); + this.nowRegex = recognizersText.RegExpUtility.getSafeRegExp(englishDateTime.EnglishDateTime.NowRegex); + this.timeOfTodayAfterRegex = recognizersText.RegExpUtility.getSafeRegExp(englishDateTime.EnglishDateTime.TimeOfTodayAfterRegex); + this.simpleTimeOfTodayAfterRegex = recognizersText.RegExpUtility.getSafeRegExp(englishDateTime.EnglishDateTime.SimpleTimeOfTodayAfterRegex); + this.nightRegex = recognizersText.RegExpUtility.getSafeRegExp(englishDateTime.EnglishDateTime.TimeOfDayRegex); + this.timeOfTodayBeforeRegex = recognizersText.RegExpUtility.getSafeRegExp(englishDateTime.EnglishDateTime.TimeOfTodayBeforeRegex); + this.simpleTimeOfTodayBeforeRegex = recognizersText.RegExpUtility.getSafeRegExp(englishDateTime.EnglishDateTime.SimpleTimeOfTodayBeforeRegex); + this.theEndOfRegex = recognizersText.RegExpUtility.getSafeRegExp(englishDateTime.EnglishDateTime.TheEndOfRegex); + this.unitRegex = recognizersText.RegExpUtility.getSafeRegExp(englishDateTime.EnglishDateTime.TimeUnitRegex); + this.prepositionRegex = recognizersText.RegExpUtility.getSafeRegExp(englishDateTime.EnglishDateTime.PrepositionRegex); + this.connectorRegex = recognizersText.RegExpUtility.getSafeRegExp(englishDateTime.EnglishDateTime.ConnectorRegex); + this.utilityConfiguration = new baseConfiguration.EnglishDateTimeUtilityConfiguration(); + } + isConnectorToken(source) { + return (recognizersText.StringUtility.isNullOrWhitespace(source) + || recognizersText.RegExpUtility.getMatches(this.connectorRegex, source).length > 0 + || recognizersText.RegExpUtility.getMatches(this.prepositionRegex, source).length > 0); + } +} +exports.EnglishDateTimeExtractorConfiguration = EnglishDateTimeExtractorConfiguration; +class EnglishDateTimeParserConfiguration { + constructor(config) { + this.tokenBeforeDate = englishDateTime.EnglishDateTime.TokenBeforeDate; + this.tokenBeforeTime = englishDateTime.EnglishDateTime.TokenBeforeTime; + this.dateExtractor = config.dateExtractor; + this.timeExtractor = config.timeExtractor; + this.dateParser = config.dateParser; + this.timeParser = config.timeParser; + this.nowRegex = recognizersText.RegExpUtility.getSafeRegExp(englishDateTime.EnglishDateTime.NowRegex); + this.amTimeRegex = recognizersText.RegExpUtility.getSafeRegExp(englishDateTime.EnglishDateTime.AMTimeRegex); + this.pmTimeRegex = recognizersText.RegExpUtility.getSafeRegExp(englishDateTime.EnglishDateTime.PMTimeRegex); + this.simpleTimeOfTodayAfterRegex = recognizersText.RegExpUtility.getSafeRegExp(englishDateTime.EnglishDateTime.SimpleTimeOfTodayAfterRegex); + this.simpleTimeOfTodayBeforeRegex = recognizersText.RegExpUtility.getSafeRegExp(englishDateTime.EnglishDateTime.SimpleTimeOfTodayBeforeRegex); + this.specificTimeOfDayRegex = recognizersText.RegExpUtility.getSafeRegExp(englishDateTime.EnglishDateTime.SpecificTimeOfDayRegex); + this.theEndOfRegex = recognizersText.RegExpUtility.getSafeRegExp(englishDateTime.EnglishDateTime.TheEndOfRegex); + this.unitRegex = recognizersText.RegExpUtility.getSafeRegExp(englishDateTime.EnglishDateTime.TimeUnitRegex); + this.numbers = config.numbers; + this.cardinalExtractor = config.cardinalExtractor; + this.numberParser = config.numberParser; + this.durationExtractor = config.durationExtractor; + this.durationParser = config.durationParser; + this.unitMap = config.unitMap; + this.utilityConfiguration = config.utilityConfiguration; + } + getHour(text, hour) { + let trimmedText = text.trim().toLowerCase(); + let result = hour; + if (trimmedText.endsWith("morning") && hour >= 12) { + result -= 12; + } + else if (!trimmedText.endsWith("morning") && hour < 12) { + result += 12; + } + return result; + } + getMatchedNowTimex(text) { + let trimmedText = text.trim().toLowerCase(); + let timex; + if (trimmedText.endsWith("now")) { + timex = "PRESENT_REF"; + } + else if (trimmedText === "recently" || trimmedText === "previously") { + timex = "PAST_REF"; + } + else if (trimmedText === "as soon as possible" || trimmedText === "asap") { + timex = "FUTURE_REF"; + } + else { + timex = null; + return { matched: false, timex: timex }; + } + return { matched: true, timex: timex }; + } + getSwiftDay(text) { + let trimmedText = text.trim().toLowerCase(); + let swift = 0; + if (trimmedText.startsWith("next")) { + swift = 1; + } + else if (trimmedText.startsWith("last")) { + swift = -1; + } + return swift; + } + haveAmbiguousToken(text, matchedText) { return false; } +} +exports.EnglishDateTimeParserConfiguration = EnglishDateTimeParserConfiguration; + +}); + +unwrapExports(dateTimeConfiguration); + +var timePeriodConfiguration = createCommonjsModule(function (module, exports) { +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); + + + + + +class EnglishTimePeriodExtractorConfiguration { + constructor() { + this.simpleCasesRegex = [ + recognizersText.RegExpUtility.getSafeRegExp(englishDateTime.EnglishDateTime.PureNumFromTo, "gis"), + recognizersText.RegExpUtility.getSafeRegExp(englishDateTime.EnglishDateTime.PureNumBetweenAnd, "gis") + ]; + this.tillRegex = recognizersText.RegExpUtility.getSafeRegExp(englishDateTime.EnglishDateTime.TillRegex, "gis"); + this.timeOfDayRegex = recognizersText.RegExpUtility.getSafeRegExp(englishDateTime.EnglishDateTime.TimeOfDayRegex, "gis"); + this.generalEndingRegex = recognizersText.RegExpUtility.getSafeRegExp(englishDateTime.EnglishDateTime.GeneralEndingRegex, "gis"); + this.singleTimeExtractor = new baseTime.BaseTimeExtractor(new timeConfiguration.EnglishTimeExtractorConfiguration()); + this.integerExtractor = new recognizersTextNumber.EnglishIntegerExtractor(); + } + getFromTokenIndex(source) { + let index = -1; + if (source.endsWith("from")) { + index = source.lastIndexOf("from"); + return { matched: true, index: index }; + } + return { matched: false, index: index }; + } + getBetweenTokenIndex(source) { + let index = -1; + if (source.endsWith("between")) { + index = source.lastIndexOf("between"); + return { matched: true, index: index }; + } + return { matched: false, index: index }; + } + hasConnectorToken(source) { + return source === "and"; + } +} +exports.EnglishTimePeriodExtractorConfiguration = EnglishTimePeriodExtractorConfiguration; +class EnglishTimePeriodParserConfiguration { + constructor(config) { + this.timeExtractor = config.timeExtractor; + this.timeParser = config.timeParser; + this.integerExtractor = config.integerExtractor; + this.pureNumberFromToRegex = recognizersText.RegExpUtility.getSafeRegExp(englishDateTime.EnglishDateTime.PureNumFromTo); + this.pureNumberBetweenAndRegex = recognizersText.RegExpUtility.getSafeRegExp(englishDateTime.EnglishDateTime.PureNumBetweenAnd); + this.timeOfDayRegex = recognizersText.RegExpUtility.getSafeRegExp(englishDateTime.EnglishDateTime.TimeOfDayRegex); + this.tillRegex = recognizersText.RegExpUtility.getSafeRegExp(englishDateTime.EnglishDateTime.TillRegex, "gis"); + this.numbers = config.numbers; + this.utilityConfiguration = config.utilityConfiguration; + this.specificTimeFromToRegex = recognizersText.RegExpUtility.getSafeRegExp(englishDateTime.EnglishDateTime.SpecificTimeFromTo); + this.specificTimeBetweenAndRegex = recognizersText.RegExpUtility.getSafeRegExp(englishDateTime.EnglishDateTime.SpecificTimeBetweenAnd); + } + getMatchedTimexRange(text) { + let trimmedText = text.trim().toLowerCase(); + if (trimmedText.endsWith("s")) { + trimmedText = trimmedText.substring(0, trimmedText.length - 1); + } + let result = { + matched: false, + timex: '', + beginHour: 0, + endHour: 0, + endMin: 0 + }; + if (trimmedText.endsWith("morning")) { + result.timex = "TMO"; + result.beginHour = 8; + result.endHour = 12; + } + else if (trimmedText.endsWith("afternoon")) { + result.timex = "TAF"; + result.beginHour = 12; + result.endHour = 16; + } + else if (trimmedText.endsWith("evening")) { + result.timex = "TEV"; + result.beginHour = 16; + result.endHour = 20; + } + else if (trimmedText === "daytime") { + result.timex = "TDT"; + result.beginHour = 8; + result.endHour = 18; + } + else if (trimmedText.endsWith("night")) { + result.timex = "TNI"; + result.beginHour = 20; + result.endHour = 23; + result.endMin = 59; + } + else { + result.timex = null; + result.matched = false; + return result; + } + result.matched = true; + return result; + } +} +exports.EnglishTimePeriodParserConfiguration = EnglishTimePeriodParserConfiguration; + +}); + +unwrapExports(timePeriodConfiguration); + +var datePeriodConfiguration = createCommonjsModule(function (module, exports) { +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); + + + + + + + + +class EnglishDatePeriodExtractorConfiguration { + constructor() { + this.simpleCasesRegexes = [ + recognizersText.RegExpUtility.getSafeRegExp(englishDateTime.EnglishDateTime.SimpleCasesRegex), + recognizersText.RegExpUtility.getSafeRegExp(englishDateTime.EnglishDateTime.BetweenRegex), + recognizersText.RegExpUtility.getSafeRegExp(englishDateTime.EnglishDateTime.OneWordPeriodRegex), + recognizersText.RegExpUtility.getSafeRegExp(englishDateTime.EnglishDateTime.MonthWithYear), + recognizersText.RegExpUtility.getSafeRegExp(englishDateTime.EnglishDateTime.MonthNumWithYear), + recognizersText.RegExpUtility.getSafeRegExp(englishDateTime.EnglishDateTime.YearRegex), + recognizersText.RegExpUtility.getSafeRegExp(englishDateTime.EnglishDateTime.WeekOfMonthRegex), + recognizersText.RegExpUtility.getSafeRegExp(englishDateTime.EnglishDateTime.WeekOfYearRegex), + recognizersText.RegExpUtility.getSafeRegExp(englishDateTime.EnglishDateTime.MonthFrontBetweenRegex), + recognizersText.RegExpUtility.getSafeRegExp(englishDateTime.EnglishDateTime.MonthFrontSimpleCasesRegex), + recognizersText.RegExpUtility.getSafeRegExp(englishDateTime.EnglishDateTime.QuarterRegex), + recognizersText.RegExpUtility.getSafeRegExp(englishDateTime.EnglishDateTime.QuarterRegexYearFront), + recognizersText.RegExpUtility.getSafeRegExp(englishDateTime.EnglishDateTime.AllHalfYearRegex), + recognizersText.RegExpUtility.getSafeRegExp(englishDateTime.EnglishDateTime.SeasonRegex), + recognizersText.RegExpUtility.getSafeRegExp(englishDateTime.EnglishDateTime.WhichWeekRegex), + recognizersText.RegExpUtility.getSafeRegExp(englishDateTime.EnglishDateTime.RestOfDateRegex), + recognizersText.RegExpUtility.getSafeRegExp(englishDateTime.EnglishDateTime.LaterEarlyPeriodRegex), + recognizersText.RegExpUtility.getSafeRegExp(englishDateTime.EnglishDateTime.WeekWithWeekDayRangeRegex) + ]; + this.illegalYearRegex = recognizersText.RegExpUtility.getSafeRegExp(baseDateTime.BaseDateTime.IllegalYearRegex); + this.YearRegex = recognizersText.RegExpUtility.getSafeRegExp(englishDateTime.EnglishDateTime.YearRegex); + this.tillRegex = recognizersText.RegExpUtility.getSafeRegExp(englishDateTime.EnglishDateTime.TillRegex); + this.followedUnit = recognizersText.RegExpUtility.getSafeRegExp(englishDateTime.EnglishDateTime.FollowedDateUnit); + this.numberCombinedWithUnit = recognizersText.RegExpUtility.getSafeRegExp(englishDateTime.EnglishDateTime.NumberCombinedWithDateUnit); + this.pastRegex = recognizersText.RegExpUtility.getSafeRegExp(englishDateTime.EnglishDateTime.PastPrefixRegex); + this.futureRegex = recognizersText.RegExpUtility.getSafeRegExp(englishDateTime.EnglishDateTime.NextPrefixRegex); + this.weekOfRegex = recognizersText.RegExpUtility.getSafeRegExp(englishDateTime.EnglishDateTime.WeekOfRegex); + this.monthOfRegex = recognizersText.RegExpUtility.getSafeRegExp(englishDateTime.EnglishDateTime.MonthOfRegex); + this.dateUnitRegex = recognizersText.RegExpUtility.getSafeRegExp(englishDateTime.EnglishDateTime.DateUnitRegex); + this.inConnectorRegex = recognizersText.RegExpUtility.getSafeRegExp(englishDateTime.EnglishDateTime.InConnectorRegex); + this.rangeUnitRegex = recognizersText.RegExpUtility.getSafeRegExp(englishDateTime.EnglishDateTime.RangeUnitRegex); + this.datePointExtractor = new baseDate.BaseDateExtractor(new dateConfiguration.EnglishDateExtractorConfiguration()); + this.integerExtractor = new recognizersTextNumber.EnglishIntegerExtractor(); + this.numberParser = new recognizersTextNumber.BaseNumberParser(new recognizersTextNumber.EnglishNumberParserConfiguration()); + this.durationExtractor = new baseDuration.BaseDurationExtractor(new durationConfiguration.EnglishDurationExtractorConfiguration()); + this.rangeConnectorRegex = recognizersText.RegExpUtility.getSafeRegExp(englishDateTime.EnglishDateTime.RangeConnectorRegex); + } + getFromTokenIndex(source) { + let result = { matched: false, index: -1 }; + if (source.endsWith("from")) { + result.index = source.lastIndexOf("from"); + result.matched = true; + } + return result; + } + ; + getBetweenTokenIndex(source) { + let result = { matched: false, index: -1 }; + if (source.endsWith("between")) { + result.index = source.lastIndexOf("between"); + result.matched = true; + } + return result; + } + ; + hasConnectorToken(source) { + let match = recognizersText.RegExpUtility.getMatches(this.rangeConnectorRegex, source).pop(); + return match && match.length === source.length; + } + ; +} +exports.EnglishDatePeriodExtractorConfiguration = EnglishDatePeriodExtractorConfiguration; +class EnglishDatePeriodParserConfiguration { + constructor(config) { + this.dateExtractor = config.dateExtractor; + this.dateParser = config.dateParser; + this.durationExtractor = config.durationExtractor; + this.durationParser = config.durationParser; + this.monthFrontBetweenRegex = recognizersText.RegExpUtility.getSafeRegExp(englishDateTime.EnglishDateTime.MonthFrontBetweenRegex); + this.betweenRegex = recognizersText.RegExpUtility.getSafeRegExp(englishDateTime.EnglishDateTime.BetweenRegex); + this.monthFrontSimpleCasesRegex = recognizersText.RegExpUtility.getSafeRegExp(englishDateTime.EnglishDateTime.MonthFrontSimpleCasesRegex); + this.simpleCasesRegex = recognizersText.RegExpUtility.getSafeRegExp(englishDateTime.EnglishDateTime.SimpleCasesRegex); + this.oneWordPeriodRegex = recognizersText.RegExpUtility.getSafeRegExp(englishDateTime.EnglishDateTime.OneWordPeriodRegex); + this.monthWithYear = recognizersText.RegExpUtility.getSafeRegExp(englishDateTime.EnglishDateTime.MonthWithYear); + this.monthNumWithYear = recognizersText.RegExpUtility.getSafeRegExp(englishDateTime.EnglishDateTime.MonthNumWithYear); + this.yearRegex = recognizersText.RegExpUtility.getSafeRegExp(englishDateTime.EnglishDateTime.YearRegex); + this.pastRegex = recognizersText.RegExpUtility.getSafeRegExp(englishDateTime.EnglishDateTime.PastPrefixRegex); + this.futureRegex = recognizersText.RegExpUtility.getSafeRegExp(englishDateTime.EnglishDateTime.NextPrefixRegex); + this.inConnectorRegex = config.utilityConfiguration.inConnectorRegex; + this.weekOfMonthRegex = recognizersText.RegExpUtility.getSafeRegExp(englishDateTime.EnglishDateTime.WeekOfMonthRegex); + this.weekOfYearRegex = recognizersText.RegExpUtility.getSafeRegExp(englishDateTime.EnglishDateTime.WeekOfYearRegex); + this.quarterRegex = recognizersText.RegExpUtility.getSafeRegExp(englishDateTime.EnglishDateTime.QuarterRegex); + this.quarterRegexYearFront = recognizersText.RegExpUtility.getSafeRegExp(englishDateTime.EnglishDateTime.QuarterRegexYearFront); + this.allHalfYearRegex = recognizersText.RegExpUtility.getSafeRegExp(englishDateTime.EnglishDateTime.AllHalfYearRegex); + this.seasonRegex = recognizersText.RegExpUtility.getSafeRegExp(englishDateTime.EnglishDateTime.SeasonRegex); + this.weekOfRegex = recognizersText.RegExpUtility.getSafeRegExp(englishDateTime.EnglishDateTime.WeekOfRegex); + this.monthOfRegex = recognizersText.RegExpUtility.getSafeRegExp(englishDateTime.EnglishDateTime.MonthOfRegex); + this.whichWeekRegex = recognizersText.RegExpUtility.getSafeRegExp(englishDateTime.EnglishDateTime.WhichWeekRegex); + this.nextPrefixRegex = recognizersText.RegExpUtility.getSafeRegExp(englishDateTime.EnglishDateTime.NextPrefixRegex); + this.pastPrefixRegex = recognizersText.RegExpUtility.getSafeRegExp(englishDateTime.EnglishDateTime.PastPrefixRegex); + this.thisPrefixRegex = recognizersText.RegExpUtility.getSafeRegExp(englishDateTime.EnglishDateTime.ThisPrefixRegex); + this.restOfDateRegex = recognizersText.RegExpUtility.getSafeRegExp(englishDateTime.EnglishDateTime.RestOfDateRegex); + this.laterEarlyPeriodRegex = recognizersText.RegExpUtility.getSafeRegExp(englishDateTime.EnglishDateTime.LaterEarlyPeriodRegex); + this.weekWithWeekDayRangeRegex = recognizersText.RegExpUtility.getSafeRegExp(englishDateTime.EnglishDateTime.WeekWithWeekDayRangeRegex); + this.tokenBeforeDate = englishDateTime.EnglishDateTime.TokenBeforeDate; + this.dayOfMonth = config.dayOfMonth; + this.monthOfYear = config.monthOfYear; + this.cardinalMap = config.cardinalMap; + this.seasonMap = config.seasonMap; + this.unitMap = config.unitMap; + } + getSwiftDayOrMonth(source) { + let trimmedSource = source.trim().toLowerCase(); + let swift = 0; + if (recognizersText.RegExpUtility.getMatches(this.nextPrefixRegex, trimmedSource).length > 0) { + swift = 1; + } + else if (recognizersText.RegExpUtility.getMatches(this.pastPrefixRegex, trimmedSource).length > 0) { + swift = -1; + } + return swift; + } + getSwiftYear(source) { + let trimmedSource = source.trim().toLowerCase(); + let swift = -10; + if (recognizersText.RegExpUtility.getMatches(this.nextPrefixRegex, trimmedSource).length > 0) { + swift = 1; + } + else if (recognizersText.RegExpUtility.getMatches(this.pastPrefixRegex, trimmedSource).length > 0) { + swift = -1; + } + else if (recognizersText.RegExpUtility.getMatches(this.thisPrefixRegex, trimmedSource).length > 0) { + swift = 0; + } + return swift; + } + isFuture(source) { + let trimmedSource = source.trim().toLowerCase(); + return (trimmedSource.startsWith('this') || trimmedSource.startsWith('next')); + } + isYearToDate(source) { + let trimmedSource = source.trim().toLowerCase(); + return trimmedSource === 'year to date'; + } + isMonthToDate(source) { + let trimmedSource = source.trim().toLowerCase(); + return trimmedSource === 'month to date'; + } + isWeekOnly(source) { + let trimmedSource = source.trim().toLowerCase(); + return trimmedSource.endsWith('week'); + } + isWeekend(source) { + let trimmedSource = source.trim().toLowerCase(); + return trimmedSource.endsWith('weekend'); + } + isMonthOnly(source) { + let trimmedSource = source.trim().toLowerCase(); + return trimmedSource.endsWith('month'); + } + isYearOnly(source) { + let trimmedSource = source.trim().toLowerCase(); + return trimmedSource.endsWith('year'); + } + isLastCardinal(source) { + let trimmedSource = source.trim().toLowerCase(); + return trimmedSource === 'last'; + } +} +exports.EnglishDatePeriodParserConfiguration = EnglishDatePeriodParserConfiguration; + +}); + +unwrapExports(datePeriodConfiguration); + +var dateTimePeriodConfiguration = createCommonjsModule(function (module, exports) { +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); + + + + + + + + + + + + + +class EnglishDateTimePeriodExtractorConfiguration { + constructor() { + this.cardinalExtractor = new recognizersTextNumber.EnglishCardinalExtractor(); + this.singleDateExtractor = new baseDate.BaseDateExtractor(new dateConfiguration.EnglishDateExtractorConfiguration()); + this.singleTimeExtractor = new baseTime.BaseTimeExtractor(new timeConfiguration.EnglishTimeExtractorConfiguration()); + this.singleDateTimeExtractor = new baseDateTime$2.BaseDateTimeExtractor(new dateTimeConfiguration.EnglishDateTimeExtractorConfiguration()); + this.durationExtractor = new baseDuration.BaseDurationExtractor(new durationConfiguration.EnglishDurationExtractorConfiguration()); + this.timePeriodExtractor = new baseTimePeriod.BaseTimePeriodExtractor(new timePeriodConfiguration.EnglishTimePeriodExtractorConfiguration()); + this.simpleCasesRegexes = [ + recognizersText.RegExpUtility.getSafeRegExp(englishDateTime.EnglishDateTime.PureNumFromTo), + recognizersText.RegExpUtility.getSafeRegExp(englishDateTime.EnglishDateTime.PureNumBetweenAnd), + ]; + this.prepositionRegex = recognizersText.RegExpUtility.getSafeRegExp(englishDateTime.EnglishDateTime.PrepositionRegex); + this.tillRegex = recognizersText.RegExpUtility.getSafeRegExp(englishDateTime.EnglishDateTime.TillRegex); + this.specificTimeOfDayRegex = recognizersText.RegExpUtility.getSafeRegExp(englishDateTime.EnglishDateTime.PeriodSpecificTimeOfDayRegex); + this.timeOfDayRegex = recognizersText.RegExpUtility.getSafeRegExp(englishDateTime.EnglishDateTime.PeriodTimeOfDayRegex); + this.periodTimeOfDayWithDateRegex = recognizersText.RegExpUtility.getSafeRegExp(englishDateTime.EnglishDateTime.PeriodTimeOfDayWithDateRegex); + this.followedUnit = recognizersText.RegExpUtility.getSafeRegExp(englishDateTime.EnglishDateTime.TimeFollowedUnit); + this.numberCombinedWithUnit = recognizersText.RegExpUtility.getSafeRegExp(englishDateTime.EnglishDateTime.TimeNumberCombinedWithUnit); + this.timeUnitRegex = recognizersText.RegExpUtility.getSafeRegExp(englishDateTime.EnglishDateTime.TimeUnitRegex); + this.pastPrefixRegex = recognizersText.RegExpUtility.getSafeRegExp(englishDateTime.EnglishDateTime.PastPrefixRegex); + this.nextPrefixRegex = recognizersText.RegExpUtility.getSafeRegExp(englishDateTime.EnglishDateTime.NextPrefixRegex); + this.rangeConnectorRegex = recognizersText.RegExpUtility.getSafeRegExp(englishDateTime.EnglishDateTime.RangeConnectorRegex); + this.relativeTimeUnitRegex = recognizersText.RegExpUtility.getSafeRegExp(englishDateTime.EnglishDateTime.RelativeTimeUnitRegex); + this.restOfDateTimeRegex = recognizersText.RegExpUtility.getSafeRegExp(englishDateTime.EnglishDateTime.RestOfDateTimeRegex); + this.generalEndingRegex = recognizersText.RegExpUtility.getSafeRegExp(englishDateTime.EnglishDateTime.GeneralEndingRegex); + this.middlePauseRegex = recognizersText.RegExpUtility.getSafeRegExp(englishDateTime.EnglishDateTime.MiddlePauseRegex); + } + getFromTokenIndex(source) { + let result = { matched: false, index: -1 }; + if (source.endsWith("from")) { + result.index = source.lastIndexOf("from"); + result.matched = true; + } + return result; + } + ; + getBetweenTokenIndex(source) { + let result = { matched: false, index: -1 }; + if (source.endsWith("between")) { + result.index = source.lastIndexOf("between"); + result.matched = true; + } + return result; + } + ; + hasConnectorToken(source) { + return recognizersText.RegExpUtility.getMatches(this.rangeConnectorRegex, source).length > 0; + } + ; +} +exports.EnglishDateTimePeriodExtractorConfiguration = EnglishDateTimePeriodExtractorConfiguration; +class EnglishDateTimePeriodParserConfiguration { + constructor(config) { + this.pureNumberFromToRegex = recognizersText.RegExpUtility.getSafeRegExp(englishDateTime.EnglishDateTime.PureNumFromTo); + this.pureNumberBetweenAndRegex = recognizersText.RegExpUtility.getSafeRegExp(englishDateTime.EnglishDateTime.PureNumBetweenAnd); + this.periodTimeOfDayWithDateRegex = recognizersText.RegExpUtility.getSafeRegExp(englishDateTime.EnglishDateTime.PeriodTimeOfDayWithDateRegex); + this.specificTimeOfDayRegex = recognizersText.RegExpUtility.getSafeRegExp(englishDateTime.EnglishDateTime.SpecificTimeOfDayRegex); + this.pastRegex = recognizersText.RegExpUtility.getSafeRegExp(englishDateTime.EnglishDateTime.PastPrefixRegex); + this.futureRegex = recognizersText.RegExpUtility.getSafeRegExp(englishDateTime.EnglishDateTime.NextPrefixRegex); + this.relativeTimeUnitRegex = recognizersText.RegExpUtility.getSafeRegExp(englishDateTime.EnglishDateTime.RelativeTimeUnitRegex); + this.numbers = config.numbers; + this.unitMap = config.unitMap; + this.dateExtractor = config.dateExtractor; + this.timePeriodExtractor = config.timePeriodExtractor; + this.timeExtractor = config.timeExtractor; + this.dateTimeExtractor = config.dateTimeExtractor; + this.durationExtractor = config.durationExtractor; + this.dateParser = config.dateParser; + this.timeParser = config.timeParser; + this.dateTimeParser = config.dateTimeParser; + this.timePeriodParser = config.timePeriodParser; + this.durationParser = config.durationParser; + this.morningStartEndRegex = recognizersText.RegExpUtility.getSafeRegExp(englishDateTime.EnglishDateTime.MorningStartEndRegex); + this.afternoonStartEndRegex = recognizersText.RegExpUtility.getSafeRegExp(englishDateTime.EnglishDateTime.AfternoonStartEndRegex); + this.eveningStartEndRegex = recognizersText.RegExpUtility.getSafeRegExp(englishDateTime.EnglishDateTime.EveningStartEndRegex); + this.nightStartEndRegex = recognizersText.RegExpUtility.getSafeRegExp(englishDateTime.EnglishDateTime.NightStartEndRegex); + this.restOfDateTimeRegex = recognizersText.RegExpUtility.getSafeRegExp(englishDateTime.EnglishDateTime.RestOfDateTimeRegex); + } + getMatchedTimeRange(source) { + let timeStr; + let beginHour = 0; + let endHour = 0; + let endMin = 0; + let success = false; + if (recognizersText.RegExpUtility.getMatches(this.morningStartEndRegex, source).length > 0) { + timeStr = 'TMO'; + beginHour = 8; + endHour = 12; + success = true; + } + else if (recognizersText.RegExpUtility.getMatches(this.afternoonStartEndRegex, source).length > 0) { + timeStr = 'TAF'; + beginHour = 12; + endHour = 16; + success = true; + } + else if (recognizersText.RegExpUtility.getMatches(this.eveningStartEndRegex, source).length > 0) { + timeStr = 'TEV'; + beginHour = 16; + endHour = 20; + success = true; + } + else if (recognizersText.RegExpUtility.getMatches(this.nightStartEndRegex, source).length > 0) { + timeStr = 'TNI'; + beginHour = 20; + endHour = 23; + endMin = 59; + success = true; + } + return { timeStr: timeStr, beginHour: beginHour, endHour: endHour, endMin: endMin, success: success }; + } + getSwiftPrefix(source) { + let swift = 0; + if (source.startsWith('next')) + swift = 1; + else if (source.startsWith('last')) + swift = -1; + return swift; + } +} +exports.EnglishDateTimePeriodParserConfiguration = EnglishDateTimePeriodParserConfiguration; + +}); + +unwrapExports(dateTimePeriodConfiguration); + +var parsers$6 = createCommonjsModule(function (module, exports) { +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); + + + + +class EnglishTimeParser extends baseTime.BaseTimeParser { + constructor(configuration) { + super(configuration); + } + internalParse(text, referenceTime) { + let innerResult = super.internalParse(text, referenceTime); + if (!innerResult.success) { + innerResult = this.parseIsh(text, referenceTime); + } + return innerResult; + } + // parse "noonish", "11-ish" + parseIsh(text, referenceTime) { + let ret = new utilities$2.DateTimeResolutionResult(); + let trimmedText = text.toLowerCase().trim(); + let matches = recognizersText.RegExpUtility.getMatches(timeConfiguration.EnglishTimeExtractorConfiguration.ishRegex, trimmedText); + if (matches.length > 0 && matches[0].length === trimmedText.length) { + let hourStr = matches[0].groups("hour").value; + let hour = 12; + if (hourStr) { + hour = Number.parseInt(hourStr, 10); + } + ret.timex = "T" + utilities$2.FormatUtil.toString(hour, 2); + ret.futureValue = + ret.pastValue = + new Date(referenceTime.getFullYear(), referenceTime.getMonth(), referenceTime.getDate(), hour, 0, 0); + ret.success = true; + return ret; + } + return ret; + } +} +exports.EnglishTimeParser = EnglishTimeParser; + +}); + +unwrapExports(parsers$6); + +var baseConfiguration = createCommonjsModule(function (module, exports) { +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); + + + + + + + + + + + + + + + + + + + + +class EnglishDateTimeUtilityConfiguration { + constructor() { + this.laterRegex = recognizersText.RegExpUtility.getSafeRegExp(englishDateTime.EnglishDateTime.LaterRegex); + this.agoRegex = recognizersText.RegExpUtility.getSafeRegExp(englishDateTime.EnglishDateTime.AgoRegex); + this.inConnectorRegex = recognizersText.RegExpUtility.getSafeRegExp(englishDateTime.EnglishDateTime.InConnectorRegex); + this.rangeUnitRegex = recognizersText.RegExpUtility.getSafeRegExp(englishDateTime.EnglishDateTime.RangeUnitRegex); + this.amDescRegex = recognizersText.RegExpUtility.getSafeRegExp(englishDateTime.EnglishDateTime.AmDescRegex); + this.pmDescRegex = recognizersText.RegExpUtility.getSafeRegExp(englishDateTime.EnglishDateTime.PmDescRegex); + this.amPmDescRegex = recognizersText.RegExpUtility.getSafeRegExp(englishDateTime.EnglishDateTime.AmPmDescRegex); + } +} +exports.EnglishDateTimeUtilityConfiguration = EnglishDateTimeUtilityConfiguration; +class EnglishCommonDateTimeParserConfiguration extends parsers$4.BaseDateParserConfiguration { + constructor() { + super(); + this.utilityConfiguration = new EnglishDateTimeUtilityConfiguration(); + this.unitMap = englishDateTime.EnglishDateTime.UnitMap; + this.unitValueMap = englishDateTime.EnglishDateTime.UnitValueMap; + this.seasonMap = englishDateTime.EnglishDateTime.SeasonMap; + this.cardinalMap = englishDateTime.EnglishDateTime.CardinalMap; + this.dayOfWeek = englishDateTime.EnglishDateTime.DayOfWeek; + this.monthOfYear = englishDateTime.EnglishDateTime.MonthOfYear; + this.numbers = englishDateTime.EnglishDateTime.Numbers; + this.doubleNumbers = englishDateTime.EnglishDateTime.DoubleNumbers; + this.cardinalExtractor = new recognizersTextNumber.EnglishCardinalExtractor(); + this.integerExtractor = new recognizersTextNumber.EnglishIntegerExtractor(); + this.ordinalExtractor = new recognizersTextNumber.EnglishOrdinalExtractor(); + this.dayOfMonth = new Map([...baseDateTime.BaseDateTime.DayOfMonthDictionary, ...englishDateTime.EnglishDateTime.DayOfMonth]); + this.numberParser = new recognizersTextNumber.BaseNumberParser(new recognizersTextNumber.EnglishNumberParserConfiguration()); + this.dateExtractor = new baseDate.BaseDateExtractor(new dateConfiguration.EnglishDateExtractorConfiguration()); + this.timeExtractor = new baseTime.BaseTimeExtractor(new timeConfiguration.EnglishTimeExtractorConfiguration()); + this.dateTimeExtractor = new baseDateTime$2.BaseDateTimeExtractor(new dateTimeConfiguration.EnglishDateTimeExtractorConfiguration()); + this.durationExtractor = new baseDuration.BaseDurationExtractor(new durationConfiguration.EnglishDurationExtractorConfiguration()); + this.datePeriodExtractor = new baseDatePeriod.BaseDatePeriodExtractor(new datePeriodConfiguration.EnglishDatePeriodExtractorConfiguration()); + this.timePeriodExtractor = new baseTimePeriod.BaseTimePeriodExtractor(new timePeriodConfiguration.EnglishTimePeriodExtractorConfiguration()); + this.dateTimePeriodExtractor = new baseDateTimePeriod.BaseDateTimePeriodExtractor(new dateTimePeriodConfiguration.EnglishDateTimePeriodExtractorConfiguration()); + this.durationParser = new baseDuration.BaseDurationParser(new durationConfiguration.EnglishDurationParserConfiguration(this)); + this.dateParser = new baseDate.BaseDateParser(new dateConfiguration.EnglishDateParserConfiguration(this)); + this.timeParser = new parsers$6.EnglishTimeParser(new timeConfiguration.EnglishTimeParserConfiguration(this)); + this.dateTimeParser = new baseDateTime$2.BaseDateTimeParser(new dateTimeConfiguration.EnglishDateTimeParserConfiguration(this)); + this.datePeriodParser = new baseDatePeriod.BaseDatePeriodParser(new datePeriodConfiguration.EnglishDatePeriodParserConfiguration(this)); + this.timePeriodParser = new baseTimePeriod.BaseTimePeriodParser(new timePeriodConfiguration.EnglishTimePeriodParserConfiguration(this)); + this.dateTimePeriodParser = new baseDateTimePeriod.BaseDateTimePeriodParser(new dateTimePeriodConfiguration.EnglishDateTimePeriodParserConfiguration(this)); + } +} +exports.EnglishCommonDateTimeParserConfiguration = EnglishCommonDateTimeParserConfiguration; + +}); + +unwrapExports(baseConfiguration); + +var baseSet = createCommonjsModule(function (module, exports) { +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); + + + + +class BaseSetExtractor { + constructor(config) { + this.extractorName = constants$2.Constants.SYS_DATETIME_SET; + this.config = config; + } + extract(source, refDate) { + if (!refDate) + refDate = new Date(); + let referenceDate = refDate; + let tokens = new Array() + .concat(this.matchEachUnit(source)) + .concat(this.matchPeriodic(source)) + .concat(this.matchEachDuration(source, referenceDate)) + .concat(this.timeEveryday(source, referenceDate)) + .concat(this.matchEach(this.config.dateExtractor, source, referenceDate)) + .concat(this.matchEach(this.config.timeExtractor, source, referenceDate)) + .concat(this.matchEach(this.config.dateTimeExtractor, source, referenceDate)) + .concat(this.matchEach(this.config.datePeriodExtractor, source, referenceDate)) + .concat(this.matchEach(this.config.timePeriodExtractor, source, referenceDate)) + .concat(this.matchEach(this.config.dateTimePeriodExtractor, source, referenceDate)); + let result = utilities$2.Token.mergeAllTokens(tokens, source, this.extractorName); + return result; + } + matchEachUnit(source) { + let ret = []; + recognizersText.RegExpUtility.getMatches(this.config.eachUnitRegex, source).forEach(match => { + ret.push(new utilities$2.Token(match.index, match.index + match.length)); + }); + return ret; + } + matchPeriodic(source) { + let ret = []; + recognizersText.RegExpUtility.getMatches(this.config.periodicRegex, source).forEach(match => { + ret.push(new utilities$2.Token(match.index, match.index + match.length)); + }); + return ret; + } + matchEachDuration(source, refDate) { + let ret = []; + this.config.durationExtractor.extract(source, refDate).forEach(er => { + if (recognizersText.RegExpUtility.getMatches(this.config.lastRegex, er.text).length > 0) + return; + let beforeStr = source.substr(0, er.start); + let matches = recognizersText.RegExpUtility.getMatches(this.config.eachPrefixRegex, beforeStr); + if (matches && matches.length > 0) { + ret.push(new utilities$2.Token(matches[0].index, er.start + er.length)); + } + }); + return ret; + } + timeEveryday(source, refDate) { + let ret = []; + this.config.timeExtractor.extract(source, refDate).forEach(er => { + let afterStr = source.substr(er.start + er.length); + if (recognizersText.StringUtility.isNullOrWhitespace(afterStr) && this.config.beforeEachDayRegex) { + let beforeStr = source.substr(0, er.start); + let beforeMatches = recognizersText.RegExpUtility.getMatches(this.config.beforeEachDayRegex, beforeStr); + if (beforeMatches && beforeMatches.length > 0) { + ret.push(new utilities$2.Token(beforeMatches[0].index, er.start + er.length)); + } + } + else { + let afterMatches = recognizersText.RegExpUtility.getMatches(this.config.eachDayRegex, afterStr); + if (afterMatches && afterMatches.length > 0) { + ret.push(new utilities$2.Token(er.start, er.start + er.length + afterMatches[0].length)); + } + } + }); + return ret; + } + matchEach(extractor, source, refDate) { + let ret = []; + recognizersText.RegExpUtility.getMatches(this.config.setEachRegex, source).forEach(match => { + let trimmedSource = source.substr(0, match.index) + source.substr(match.index + match.length); + extractor.extract(trimmedSource, refDate).forEach(er => { + if (er.start <= match.index && (er.start + er.length) > match.index) { + ret.push(new utilities$2.Token(er.start, er.start + match.length + er.length)); + } + }); + }); + recognizersText.RegExpUtility.getMatches(this.config.setWeekDayRegex, source).forEach(match => { + let trimmedSource = source.substr(0, match.index) + match.groups('weekday').value + source.substr(match.index + match.length); + extractor.extract(trimmedSource, refDate).forEach(er => { + if (er.start <= match.index && er.text.includes(match.groups('weekday').value)) { + let length = er.length + 1; + if (!recognizersText.StringUtility.isNullOrEmpty(match.groups('prefix').value)) { + length += match.groups('prefix').value.length; + } + ret.push(new utilities$2.Token(er.start, er.start + length)); + } + }); + }); + return ret; + } +} +exports.BaseSetExtractor = BaseSetExtractor; +class BaseSetParser { + constructor(configuration) { + this.config = configuration; + } + parse(er, referenceDate) { + if (!referenceDate) + referenceDate = new Date(); + let value = null; + if (er.type === BaseSetParser.ParserName) { + let innerResult = this.parseEachUnit(er.text); + if (!innerResult.success) { + innerResult = this.parseEachDuration(er.text, referenceDate); + } + if (!innerResult.success) { + innerResult = this.parserTimeEveryday(er.text, referenceDate); + } + // NOTE: Please do not change the order of following function + // datetimeperiod>dateperiod>timeperiod>datetime>date>time + if (!innerResult.success) { + innerResult = this.parseEach(this.config.dateTimePeriodExtractor, this.config.dateTimePeriodParser, er.text, referenceDate); + } + if (!innerResult.success) { + innerResult = this.parseEach(this.config.datePeriodExtractor, this.config.datePeriodParser, er.text, referenceDate); + } + if (!innerResult.success) { + innerResult = this.parseEach(this.config.timePeriodExtractor, this.config.timePeriodParser, er.text, referenceDate); + } + if (!innerResult.success) { + innerResult = this.parseEach(this.config.dateTimeExtractor, this.config.dateTimeParser, er.text, referenceDate); + } + if (!innerResult.success) { + innerResult = this.parseEach(this.config.dateExtractor, this.config.dateParser, er.text, referenceDate); + } + if (!innerResult.success) { + innerResult = this.parseEach(this.config.timeExtractor, this.config.timeParser, er.text, referenceDate); + } + if (innerResult.success) { + innerResult.futureResolution = {}; + innerResult.futureResolution[constants$2.TimeTypeConstants.SET] = innerResult.futureValue; + innerResult.pastResolution = {}; + innerResult.pastResolution[constants$2.TimeTypeConstants.SET] = innerResult.pastValue; + value = innerResult; + } + } + let ret = new parsers$4.DateTimeParseResult(er); + ret.value = value, ret.timexStr = value === null ? "" : value.timex, ret.resolutionStr = ""; + return ret; + } + parseEachDuration(text, refDate) { + let ret = new utilities$2.DateTimeResolutionResult(); + let ers = this.config.durationExtractor.extract(text, refDate); + if (ers.length !== 1 || text.substring(ers[0].start + ers[0].length || 0)) { + return ret; + } + let beforeStr = text.substring(0, ers[0].start || 0); + let matches = recognizersText.RegExpUtility.getMatches(this.config.eachPrefixRegex, beforeStr); + if (matches.length) { + let pr = this.config.durationParser.parse(ers[0], new Date()); + ret.timex = pr.timexStr; + ret.futureValue = ret.pastValue = "Set: " + pr.timexStr; + ret.success = true; + return ret; + } + return ret; + } + parseEachUnit(text) { + let ret = new utilities$2.DateTimeResolutionResult(); + // handle "daily", "weekly" + let matches = recognizersText.RegExpUtility.getMatches(this.config.periodicRegex, text); + if (matches.length) { + let getMatchedDailyTimex = this.config.getMatchedDailyTimex(text); + if (!getMatchedDailyTimex.matched) { + return ret; + } + ret.timex = getMatchedDailyTimex.timex; + ret.futureValue = ret.pastValue = "Set: " + ret.timex; + ret.success = true; + return ret; + } + // handle "each month" + matches = recognizersText.RegExpUtility.getMatches(this.config.eachUnitRegex, text); + if (matches.length && matches[0].length === text.length) { + let sourceUnit = matches[0].groups("unit").value; + if (sourceUnit && this.config.unitMap.has(sourceUnit)) { + let getMatchedUnitTimex = this.config.getMatchedUnitTimex(sourceUnit); + if (!getMatchedUnitTimex.matched) { + return ret; + } + if (!recognizersText.StringUtility.isNullOrEmpty(matches[0].groups('other').value)) { + getMatchedUnitTimex.timex = getMatchedUnitTimex.timex.replace('1', '2'); + } + ret.timex = getMatchedUnitTimex.timex; + ret.futureValue = ret.pastValue = "Set: " + ret.timex; + ret.success = true; + return ret; + } + } + return ret; + } + parserTimeEveryday(text, refDate) { + let ret = new utilities$2.DateTimeResolutionResult(); + let ers = this.config.timeExtractor.extract(text, refDate); + if (ers.length !== 1) { + return ret; + } + let afterStr = text.replace(ers[0].text, ""); + let matches = recognizersText.RegExpUtility.getMatches(this.config.eachDayRegex, afterStr); + if (matches.length) { + let pr = this.config.timeParser.parse(ers[0], new Date()); + ret.timex = pr.timexStr; + ret.futureValue = ret.pastValue = "Set: " + ret.timex; + ret.success = true; + return ret; + } + return ret; + } + parseEach(extractor, parser, text, refDate) { + let ret = new utilities$2.DateTimeResolutionResult(); + let success = false; + let er; + let match = recognizersText.RegExpUtility.getMatches(this.config.setEachRegex, text).pop(); + if (match) { + let trimmedText = text.substr(0, match.index) + text.substr(match.index + match.length); + er = extractor.extract(trimmedText, refDate); + if (er.length === 1 && er[0].length === trimmedText.length) { + success = true; + } + } + match = recognizersText.RegExpUtility.getMatches(this.config.setWeekDayRegex, text).pop(); + if (match) { + let trimmedText = text.substr(0, match.index) + match.groups('weekday').value + text.substr(match.index + match.length); + er = extractor.extract(trimmedText, refDate); + if (er.length === 1 && er[0].length === trimmedText.length) { + success = true; + } + } + if (success) { + let pr = parser.parse(er[0]); + ret.timex = pr.timexStr; + ret.futureValue = `Set: ${pr.timexStr}`; + ret.pastValue = `Set: ${pr.timexStr}`; + ret.success = true; + return ret; + } + return ret; + } +} +BaseSetParser.ParserName = constants$2.Constants.SYS_DATETIME_SET; +exports.BaseSetParser = BaseSetParser; + +}); + +unwrapExports(baseSet); + +var baseHoliday = createCommonjsModule(function (module, exports) { +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); + + + + + +class BaseHolidayExtractor { + constructor(config) { + this.extractorName = constants$2.Constants.SYS_DATETIME_DATE; + this.config = config; + } + extract(source, refDate) { + if (!refDate) + refDate = new Date(); + let tokens = new Array() + .concat(this.holidayMatch(source)); + let result = utilities$2.Token.mergeAllTokens(tokens, source, this.extractorName); + return result; + } + holidayMatch(source) { + let ret = []; + this.config.holidayRegexes.forEach(regex => { + recognizersText.RegExpUtility.getMatches(regex, source).forEach(match => { + ret.push(new utilities$2.Token(match.index, match.index + match.length)); + }); + }); + return ret; + } +} +exports.BaseHolidayExtractor = BaseHolidayExtractor; +class BaseHolidayParser { + constructor(config) { + this.config = config; + } + parse(er, referenceDate) { + if (!referenceDate) + referenceDate = new Date(); + let value = null; + if (er.type === BaseHolidayParser.ParserName) { + let innerResult = this.parseHolidayRegexMatch(er.text, referenceDate); + if (innerResult.success) { + innerResult.futureResolution = {}; + innerResult.futureResolution[constants$2.TimeTypeConstants.DATE] = utilities$2.FormatUtil.formatDate(innerResult.futureValue); + innerResult.pastResolution = {}; + innerResult.pastResolution[constants$2.TimeTypeConstants.DATE] = utilities$2.FormatUtil.formatDate(innerResult.pastValue); + value = innerResult; + } + } + let ret = new parsers$4.DateTimeParseResult(er); + ret.value = value; + ret.timexStr = value === null ? "" : value.timex; + ret.resolutionStr = ""; + return ret; + } + parseHolidayRegexMatch(text, referenceDate) { + let trimmedText = text.trim(); + for (let regex of this.config.holidayRegexList) { + let offset = 0; + let matches = recognizersText.RegExpUtility.getMatches(regex, trimmedText); + if (matches.length && matches[0].index === offset && matches[0].length === trimmedText.length) { + // LUIS value string will be set in Match2Date method + let ret = this.match2Date(matches[0], referenceDate); + return ret; + } + } + return new utilities$2.DateTimeResolutionResult(); + } + match2Date(match, referenceDate) { + let ret = new utilities$2.DateTimeResolutionResult(); + let holidayStr = this.config.sanitizeHolidayToken(match.groups("holiday").value.toLowerCase()); + // get year (if exist) + let yearStr = match.groups("year").value.toLowerCase(); + let orderStr = match.groups("order").value.toLowerCase(); + let year; + let hasYear = false; + if (yearStr) { + year = parseInt(yearStr, 10); + hasYear = true; + } + else if (orderStr) { + let swift = this.config.getSwiftYear(orderStr); + if (swift < -1) { + return ret; + } + year = referenceDate.getFullYear() + swift; + hasYear = true; + } + else { + year = referenceDate.getFullYear(); + } + let holidayKey; + for (holidayKey of this.config.holidayNames.keys()) { + if (this.config.holidayNames.get(holidayKey).indexOf(holidayStr) > -1) { + break; + } + } + if (holidayKey) { + let timexStr; + let value = referenceDate; + let func = this.config.holidayFuncDictionary.get(holidayKey); + if (func) { + value = func(year); + timexStr = this.config.variableHolidaysTimexDictionary.get(holidayKey); + if (!timexStr) { + timexStr = `-${utilities$2.FormatUtil.toString(value.getMonth() + 1, 2)}-${utilities$2.FormatUtil.toString(value.getDate(), 2)}`; + } + } + else { + return ret; + } + if (value.getTime() === utilities$2.DateUtils.minValue().getTime()) { + ret.timex = ''; + ret.futureValue = utilities$2.DateUtils.minValue(); + ret.pastValue = utilities$2.DateUtils.minValue(); + ret.success = true; + return ret; + } + if (hasYear) { + ret.timex = utilities$2.FormatUtil.toString(year, 4) + timexStr; + ret.futureValue = ret.pastValue = new Date(year, value.getMonth(), value.getDate()); + ret.success = true; + return ret; + } + ret.timex = "XXXX" + timexStr; + ret.futureValue = this.getFutureValue(value, referenceDate, holidayKey); + ret.pastValue = this.getPastValue(value, referenceDate, holidayKey); + ret.success = true; + return ret; + } + return ret; + } + getFutureValue(value, referenceDate, holiday) { + if (value < referenceDate) { + let func = this.config.holidayFuncDictionary.get(holiday); + if (func) { + return func(value.getFullYear() + 1); + } + } + return value; + } + getPastValue(value, referenceDate, holiday) { + if (value >= referenceDate) { + let func = this.config.holidayFuncDictionary.get(holiday); + if (func) { + return func(value.getFullYear() - 1); + } + } + return value; + } +} +BaseHolidayParser.ParserName = constants$2.Constants.SYS_DATETIME_DATE; // "Date"; +exports.BaseHolidayParser = BaseHolidayParser; +class BaseHolidayParserConfiguration { + constructor() { + this.variableHolidaysTimexDictionary = baseDateTime.BaseDateTime.VariableHolidaysTimexDictionary; + this.holidayFuncDictionary = this.initHolidayFuncs(); + } + // TODO auto-generate from YAML + initHolidayFuncs() { + return new Map([ + ["fathers", BaseHolidayParserConfiguration.FathersDay], + ["mothers", BaseHolidayParserConfiguration.MothersDay], + ["thanksgivingday", BaseHolidayParserConfiguration.ThanksgivingDay], + ["thanksgiving", BaseHolidayParserConfiguration.ThanksgivingDay], + ["martinlutherking", BaseHolidayParserConfiguration.MartinLutherKingDay], + ["washingtonsbirthday", BaseHolidayParserConfiguration.WashingtonsBirthday], + ["canberra", BaseHolidayParserConfiguration.CanberraDay], + ["labour", BaseHolidayParserConfiguration.LabourDay], + ["columbus", BaseHolidayParserConfiguration.ColumbusDay], + ["memorial", BaseHolidayParserConfiguration.MemorialDay] + ]); + } + // All months are zero-based (-1) + // TODO auto-generate from YAML + static MothersDay(year) { return new Date(year, 5 - 1, BaseHolidayParserConfiguration.getDay(year, 5 - 1, 1, utilities$2.DayOfWeek.Sunday)); } + static FathersDay(year) { return new Date(year, 6 - 1, BaseHolidayParserConfiguration.getDay(year, 6 - 1, 2, utilities$2.DayOfWeek.Sunday)); } + static MartinLutherKingDay(year) { return new Date(year, 1 - 1, BaseHolidayParserConfiguration.getDay(year, 1 - 1, 2, utilities$2.DayOfWeek.Monday)); } + static WashingtonsBirthday(year) { return new Date(year, 2 - 1, BaseHolidayParserConfiguration.getDay(year, 2 - 1, 2, utilities$2.DayOfWeek.Monday)); } + static CanberraDay(year) { return new Date(year, 3 - 1, BaseHolidayParserConfiguration.getDay(year, 3 - 1, 0, utilities$2.DayOfWeek.Monday)); } + static MemorialDay(year) { return new Date(year, 5 - 1, BaseHolidayParserConfiguration.getLastDay(year, 5 - 1, utilities$2.DayOfWeek.Monday)); } + static LabourDay(year) { return new Date(year, 9 - 1, BaseHolidayParserConfiguration.getDay(year, 9 - 1, 0, utilities$2.DayOfWeek.Monday)); } + static ColumbusDay(year) { return new Date(year, 10 - 1, BaseHolidayParserConfiguration.getDay(year, 10 - 1, 1, utilities$2.DayOfWeek.Monday)); } + static ThanksgivingDay(year) { return new Date(year, 11 - 1, BaseHolidayParserConfiguration.getDay(year, 11 - 1, 3, utilities$2.DayOfWeek.Thursday)); } + static getDay(year, month, week, dayOfWeek) { + let days = Array.apply(null, new Array(new Date(year, month, 0).getDate())).map(function (x, i) { return i + 1; }); + days = days.filter(function (day) { + return new Date(year, month, day).getDay() === dayOfWeek; + }); + return days[week]; + } + static getLastDay(year, month, dayOfWeek) { + let days = Array.apply(null, new Array(new Date(year, month, 0).getDate())).map(function (x, i) { return i + 1; }); + days = days.filter(function (day) { + return new Date(year, month, day).getDay() === dayOfWeek; + }); + return days[days.length - 1]; + } +} +exports.BaseHolidayParserConfiguration = BaseHolidayParserConfiguration; + +}); + +unwrapExports(baseHoliday); + +var setConfiguration = createCommonjsModule(function (module, exports) { +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); + + + + + + + + + + + + + + + + +class EnglishSetExtractorConfiguration { + constructor() { + this.durationExtractor = new baseDuration.BaseDurationExtractor(new durationConfiguration.EnglishDurationExtractorConfiguration()); + this.timeExtractor = new baseTime.BaseTimeExtractor(new timeConfiguration.EnglishTimeExtractorConfiguration()); + this.dateExtractor = new baseDate.BaseDateExtractor(new dateConfiguration.EnglishDateExtractorConfiguration()); + this.dateTimeExtractor = new baseDateTime$2.BaseDateTimeExtractor(new dateTimeConfiguration.EnglishDateTimeExtractorConfiguration()); + this.datePeriodExtractor = new baseDatePeriod.BaseDatePeriodExtractor(new datePeriodConfiguration.EnglishDatePeriodExtractorConfiguration()); + this.timePeriodExtractor = new baseTimePeriod.BaseTimePeriodExtractor(new timePeriodConfiguration.EnglishTimePeriodExtractorConfiguration()); + this.dateTimePeriodExtractor = new baseDateTimePeriod.BaseDateTimePeriodExtractor(new dateTimePeriodConfiguration.EnglishDateTimePeriodExtractorConfiguration()); + this.lastRegex = recognizersText.RegExpUtility.getSafeRegExp(englishDateTime.EnglishDateTime.SetLastRegex); + this.eachPrefixRegex = recognizersText.RegExpUtility.getSafeRegExp(englishDateTime.EnglishDateTime.EachPrefixRegex); + this.periodicRegex = recognizersText.RegExpUtility.getSafeRegExp(englishDateTime.EnglishDateTime.PeriodicRegex); + this.eachUnitRegex = recognizersText.RegExpUtility.getSafeRegExp(englishDateTime.EnglishDateTime.EachUnitRegex); + this.eachDayRegex = recognizersText.RegExpUtility.getSafeRegExp(englishDateTime.EnglishDateTime.EachDayRegex); + this.setWeekDayRegex = recognizersText.RegExpUtility.getSafeRegExp(englishDateTime.EnglishDateTime.SetWeekDayRegex); + this.setEachRegex = recognizersText.RegExpUtility.getSafeRegExp(englishDateTime.EnglishDateTime.SetEachRegex); + this.beforeEachDayRegex = null; + } +} +exports.EnglishSetExtractorConfiguration = EnglishSetExtractorConfiguration; +class EnglishSetParserConfiguration { + constructor(config) { + this.durationExtractor = config.durationExtractor; + this.timeExtractor = config.timeExtractor; + this.dateExtractor = config.dateExtractor; + this.dateTimeExtractor = config.dateTimeExtractor; + this.datePeriodExtractor = config.datePeriodExtractor; + this.timePeriodExtractor = config.timePeriodExtractor; + this.dateTimePeriodExtractor = config.dateTimePeriodExtractor; + this.durationParser = config.durationParser; + this.timeParser = config.timeParser; + this.dateParser = config.dateParser; + this.dateTimeParser = config.dateTimeParser; + this.datePeriodParser = config.datePeriodParser; + this.timePeriodParser = config.timePeriodParser; + this.dateTimePeriodParser = config.dateTimePeriodParser; + this.unitMap = config.unitMap; + this.eachPrefixRegex = recognizersText.RegExpUtility.getSafeRegExp(englishDateTime.EnglishDateTime.EachPrefixRegex); + this.periodicRegex = recognizersText.RegExpUtility.getSafeRegExp(englishDateTime.EnglishDateTime.PeriodicRegex); + this.eachUnitRegex = recognizersText.RegExpUtility.getSafeRegExp(englishDateTime.EnglishDateTime.EachUnitRegex); + this.eachDayRegex = recognizersText.RegExpUtility.getSafeRegExp(englishDateTime.EnglishDateTime.EachDayRegex); + this.setWeekDayRegex = recognizersText.RegExpUtility.getSafeRegExp(englishDateTime.EnglishDateTime.SetWeekDayRegex); + this.setEachRegex = recognizersText.RegExpUtility.getSafeRegExp(englishDateTime.EnglishDateTime.SetEachRegex); + } + getMatchedDailyTimex(text) { + let timex = ""; + let trimmedText = text.trim().toLowerCase(); + if (trimmedText === "daily") { + timex = "P1D"; + } + else if (trimmedText === "weekly") { + timex = "P1W"; + } + else if (trimmedText === "biweekly") { + timex = "P2W"; + } + else if (trimmedText === "monthly") { + timex = "P1M"; + } + else if (trimmedText === "yearly" || trimmedText === "annually" || trimmedText === "annual") { + timex = "P1Y"; + } + else { + timex = null; + return { matched: false, timex: timex }; + } + return { matched: true, timex: timex }; + } + getMatchedUnitTimex(text) { + let timex = ""; + let trimmedText = text.trim().toLowerCase(); + if (trimmedText === "day") { + timex = "P1D"; + } + else if (trimmedText === "week") { + timex = "P1W"; + } + else if (trimmedText === "month") { + timex = "P1M"; + } + else if (trimmedText === "year") { + timex = "P1Y"; + } + else { + timex = null; + return { matched: false, timex: timex }; + } + return { matched: true, timex: timex }; + } +} +exports.EnglishSetParserConfiguration = EnglishSetParserConfiguration; + +}); + +unwrapExports(setConfiguration); + +var holidayConfiguration = createCommonjsModule(function (module, exports) { +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); + + + + +class EnglishHolidayExtractorConfiguration { + constructor() { + this.holidayRegexes = [ + recognizersText.RegExpUtility.getSafeRegExp(englishDateTime.EnglishDateTime.HolidayRegex1, "gis"), + recognizersText.RegExpUtility.getSafeRegExp(englishDateTime.EnglishDateTime.HolidayRegex2, "gis"), + recognizersText.RegExpUtility.getSafeRegExp(englishDateTime.EnglishDateTime.HolidayRegex3, "gis") + ]; + } +} +exports.EnglishHolidayExtractorConfiguration = EnglishHolidayExtractorConfiguration; +class EnglishHolidayParserConfiguration extends baseHoliday.BaseHolidayParserConfiguration { + constructor() { + super(); + this.holidayRegexList = [ + recognizersText.RegExpUtility.getSafeRegExp(englishDateTime.EnglishDateTime.HolidayRegex1, "gis"), + recognizersText.RegExpUtility.getSafeRegExp(englishDateTime.EnglishDateTime.HolidayRegex2, "gis"), + recognizersText.RegExpUtility.getSafeRegExp(englishDateTime.EnglishDateTime.HolidayRegex3, "gis") + ]; + this.holidayNames = englishDateTime.EnglishDateTime.HolidayNames; + this.holidayFuncDictionary = this.initHolidayFuncs(); + } + initHolidayFuncs() { + return new Map([ + ...super.initHolidayFuncs(), + ["maosbirthday", EnglishHolidayParserConfiguration.MaoBirthday], + ["yuandan", EnglishHolidayParserConfiguration.NewYear], + ["teachersday", EnglishHolidayParserConfiguration.TeacherDay], + ["singleday", EnglishHolidayParserConfiguration.SinglesDay], + ["allsaintsday", EnglishHolidayParserConfiguration.HalloweenDay], + ["youthday", EnglishHolidayParserConfiguration.YouthDay], + ["childrenday", EnglishHolidayParserConfiguration.ChildrenDay], + ["femaleday", EnglishHolidayParserConfiguration.FemaleDay], + ["treeplantingday", EnglishHolidayParserConfiguration.TreePlantDay], + ["arborday", EnglishHolidayParserConfiguration.TreePlantDay], + ["girlsday", EnglishHolidayParserConfiguration.GirlsDay], + ["whiteloverday", EnglishHolidayParserConfiguration.WhiteLoverDay], + ["loverday", EnglishHolidayParserConfiguration.ValentinesDay], + ["christmas", EnglishHolidayParserConfiguration.ChristmasDay], + ["xmas", EnglishHolidayParserConfiguration.ChristmasDay], + ["newyear", EnglishHolidayParserConfiguration.NewYear], + ["newyearday", EnglishHolidayParserConfiguration.NewYear], + ["newyearsday", EnglishHolidayParserConfiguration.NewYear], + ["inaugurationday", EnglishHolidayParserConfiguration.InaugurationDay], + ["groundhougday", EnglishHolidayParserConfiguration.GroundhogDay], + ["valentinesday", EnglishHolidayParserConfiguration.ValentinesDay], + ["stpatrickday", EnglishHolidayParserConfiguration.StPatrickDay], + ["aprilfools", EnglishHolidayParserConfiguration.FoolDay], + ["stgeorgeday", EnglishHolidayParserConfiguration.StGeorgeDay], + ["mayday", EnglishHolidayParserConfiguration.Mayday], + ["cincodemayoday", EnglishHolidayParserConfiguration.CincoDeMayoday], + ["baptisteday", EnglishHolidayParserConfiguration.BaptisteDay], + ["usindependenceday", EnglishHolidayParserConfiguration.UsaIndependenceDay], + ["independenceday", EnglishHolidayParserConfiguration.UsaIndependenceDay], + ["bastilleday", EnglishHolidayParserConfiguration.BastilleDay], + ["halloweenday", EnglishHolidayParserConfiguration.HalloweenDay], + ["allhallowday", EnglishHolidayParserConfiguration.AllHallowDay], + ["allsoulsday", EnglishHolidayParserConfiguration.AllSoulsday], + ["guyfawkesday", EnglishHolidayParserConfiguration.GuyFawkesDay], + ["veteransday", EnglishHolidayParserConfiguration.Veteransday], + ["christmaseve", EnglishHolidayParserConfiguration.ChristmasEve], + ["newyeareve", EnglishHolidayParserConfiguration.NewYearEve], + ["easterday", EnglishHolidayParserConfiguration.EasterDay] + ]); + } + // All JavaScript dates are zero-based (-1) + static NewYear(year) { return new Date(year, 1 - 1, 1); } + static NewYearEve(year) { return new Date(year, 12 - 1, 31); } + static ChristmasDay(year) { return new Date(year, 12 - 1, 25); } + static ChristmasEve(year) { return new Date(year, 12 - 1, 24); } + static ValentinesDay(year) { return new Date(year, 2 - 1, 14); } + static WhiteLoverDay(year) { return new Date(year, 3 - 1, 14); } + static FoolDay(year) { return new Date(year, 4 - 1, 1); } + static GirlsDay(year) { return new Date(year, 3 - 1, 7); } + static TreePlantDay(year) { return new Date(year, 3 - 1, 12); } + static FemaleDay(year) { return new Date(year, 3 - 1, 8); } + static ChildrenDay(year) { return new Date(year, 6 - 1, 1); } + static YouthDay(year) { return new Date(year, 5 - 1, 4); } + static TeacherDay(year) { return new Date(year, 9 - 1, 10); } + static SinglesDay(year) { return new Date(year, 11 - 1, 11); } + static MaoBirthday(year) { return new Date(year, 12 - 1, 26); } + static InaugurationDay(year) { return new Date(year, 1 - 1, 20); } + static GroundhogDay(year) { return new Date(year, 2 - 1, 2); } + static StPatrickDay(year) { return new Date(year, 3 - 1, 17); } + static StGeorgeDay(year) { return new Date(year, 4 - 1, 23); } + static Mayday(year) { return new Date(year, 5 - 1, 1); } + static CincoDeMayoday(year) { return new Date(year, 5 - 1, 5); } + static BaptisteDay(year) { return new Date(year, 6 - 1, 24); } + static UsaIndependenceDay(year) { return new Date(year, 7 - 1, 4); } + static BastilleDay(year) { return new Date(year, 7 - 1, 14); } + static HalloweenDay(year) { return new Date(year, 10 - 1, 31); } + static AllHallowDay(year) { return new Date(year, 11 - 1, 1); } + static AllSoulsday(year) { return new Date(year, 11 - 1, 2); } + static GuyFawkesDay(year) { return new Date(year, 11 - 1, 5); } + static Veteransday(year) { return new Date(year, 11 - 1, 11); } + static EasterDay(year) { return utilities$2.DateUtils.minValue(); } + getSwiftYear(text) { + let trimmedText = text.trim().toLowerCase(); + let swift = -10; + if (trimmedText.startsWith("next")) { + swift = 1; + } + else if (trimmedText.startsWith("last")) { + swift = -1; + } + else if (trimmedText.startsWith("this")) { + swift = 0; + } + return swift; + } + sanitizeHolidayToken(holiday) { + return holiday.replace(/[ ']/g, ""); + } +} +exports.EnglishHolidayParserConfiguration = EnglishHolidayParserConfiguration; + +}); + +unwrapExports(holidayConfiguration); + +var mergedConfiguration = createCommonjsModule(function (module, exports) { +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); + + + + + + + + + + + + + + + + + + + + + +class EnglishMergedExtractorConfiguration { + constructor() { + this.dateExtractor = new baseDate.BaseDateExtractor(new dateConfiguration.EnglishDateExtractorConfiguration()); + this.timeExtractor = new baseTime.BaseTimeExtractor(new timeConfiguration.EnglishTimeExtractorConfiguration()); + this.dateTimeExtractor = new baseDateTime$2.BaseDateTimeExtractor(new dateTimeConfiguration.EnglishDateTimeExtractorConfiguration()); + this.datePeriodExtractor = new baseDatePeriod.BaseDatePeriodExtractor(new datePeriodConfiguration.EnglishDatePeriodExtractorConfiguration()); + this.timePeriodExtractor = new baseTimePeriod.BaseTimePeriodExtractor(new timePeriodConfiguration.EnglishTimePeriodExtractorConfiguration()); + this.dateTimePeriodExtractor = new baseDateTimePeriod.BaseDateTimePeriodExtractor(new dateTimePeriodConfiguration.EnglishDateTimePeriodExtractorConfiguration()); + this.holidayExtractor = new baseHoliday.BaseHolidayExtractor(new holidayConfiguration.EnglishHolidayExtractorConfiguration()); + this.durationExtractor = new baseDuration.BaseDurationExtractor(new durationConfiguration.EnglishDurationExtractorConfiguration()); + this.setExtractor = new baseSet.BaseSetExtractor(new setConfiguration.EnglishSetExtractorConfiguration()); + this.integerExtractor = new recognizersTextNumber.EnglishIntegerExtractor(); + this.afterRegex = recognizersText.RegExpUtility.getSafeRegExp(englishDateTime.EnglishDateTime.AfterRegex); + this.sinceRegex = recognizersText.RegExpUtility.getSafeRegExp(englishDateTime.EnglishDateTime.SinceRegex); + this.beforeRegex = recognizersText.RegExpUtility.getSafeRegExp(englishDateTime.EnglishDateTime.BeforeRegex); + this.fromToRegex = recognizersText.RegExpUtility.getSafeRegExp(englishDateTime.EnglishDateTime.FromToRegex); + this.singleAmbiguousMonthRegex = recognizersText.RegExpUtility.getSafeRegExp(englishDateTime.EnglishDateTime.SingleAmbiguousMonthRegex); + this.prepositionSuffixRegex = recognizersText.RegExpUtility.getSafeRegExp(englishDateTime.EnglishDateTime.PrepositionSuffixRegex); + this.numberEndingPattern = recognizersText.RegExpUtility.getSafeRegExp(englishDateTime.EnglishDateTime.NumberEndingPattern); + this.filterWordRegexList = [ + recognizersText.RegExpUtility.getSafeRegExp(englishDateTime.EnglishDateTime.OneOnOneRegex) + ]; + } +} +exports.EnglishMergedExtractorConfiguration = EnglishMergedExtractorConfiguration; +class EnglishMergedParserConfiguration { + constructor(config) { + this.beforeRegex = recognizersText.RegExpUtility.getSafeRegExp(englishDateTime.EnglishDateTime.BeforeRegex); + this.afterRegex = recognizersText.RegExpUtility.getSafeRegExp(englishDateTime.EnglishDateTime.AfterRegex); + this.sinceRegex = recognizersText.RegExpUtility.getSafeRegExp(englishDateTime.EnglishDateTime.SinceRegex); + this.holidayParser = new baseHoliday.BaseHolidayParser(new holidayConfiguration.EnglishHolidayParserConfiguration()); + this.dateParser = config.dateParser; + this.timeParser = config.timeParser; + this.dateTimeParser = config.dateTimeParser; + this.datePeriodParser = config.datePeriodParser; + this.timePeriodParser = config.timePeriodParser; + this.dateTimePeriodParser = config.dateTimePeriodParser; + this.durationParser = config.durationParser; + this.setParser = new baseSet.BaseSetParser(new setConfiguration.EnglishSetParserConfiguration(config)); + } +} +exports.EnglishMergedParserConfiguration = EnglishMergedParserConfiguration; + +}); + +unwrapExports(mergedConfiguration); + +var spanishDateTime = createCommonjsModule(function (module, exports) { +"use strict"; +// ------------------------------------------------------------------------------ +// +// This code was generated by a tool. +// Changes to this file may cause incorrect behavior and will be lost if +// the code is regenerated. +// +// ------------------------------------------------------------------------------ +Object.defineProperty(exports, "__esModule", { value: true }); + +var SpanishDateTime; +(function (SpanishDateTime) { + SpanishDateTime.TillRegex = `(?hasta|al|a|--|-|—|——)(\\s+(el|la(s)?))?`; + SpanishDateTime.AndRegex = `(?y|y\\s*el|--|-|—|——)`; + SpanishDateTime.DayRegex = `(?01|02|03|04|05|06|07|08|09|10|11|12|13|14|15|16|17|18|19|1|20|21|22|23|24|25|26|27|28|29|2|30|31|3|4|5|6|7|8|9)(?=\\b|t)`; + SpanishDateTime.MonthNumRegex = `(?01|02|03|04|05|06|07|08|09|10|11|12|1|2|3|4|5|6|7|8|9)\\b`; + SpanishDateTime.DescRegex = `(?pm\\b|am\\b|p\\.m\\.|a\\.m\\.)`; + SpanishDateTime.AmDescRegex = `(am\\b|a\\.m\\.|a m\\b|a\\. m\\.\\b|a\\.m\\b|a\\. m\\b)`; + SpanishDateTime.PmDescRegex = `(pm\\b|p\\.m\\.|p\\b|p m\\b|p\\. m\\.\\b|p\\.m\\b|p\\. m\\b)`; + SpanishDateTime.AmPmDescRegex = `(ampm)`; + SpanishDateTime.TwoDigitYearRegex = `\\b(?([0-27-9]\\d))(?!(\\s*((\\:)|${SpanishDateTime.AmDescRegex}|${SpanishDateTime.PmDescRegex}|\\.\\d)))\\b`; + SpanishDateTime.FullTextYearRegex = `^[\\*]`; + SpanishDateTime.YearRegex = `(${baseDateTime.BaseDateTime.FourDigitYearRegex}|${SpanishDateTime.FullTextYearRegex})`; + SpanishDateTime.RelativeMonthRegex = `(?(este|pr[oó]ximo|[uú]ltimo)\\s+mes)\\b`; + SpanishDateTime.MonthRegex = `(?Abril|Abr|Agosto|Ago|Diciembre|Dic|Febrero|Feb|Enero|Ene|Julio|Jul|Junio|Jun|Marzo|Mar|Mayo|May|Noviembre|Nov|Octubre|Oct|Septiembre|Setiembre|Sept|Set)`; + SpanishDateTime.MonthSuffixRegex = `(?(en\\s+|del\\s+|de\\s+)?(${SpanishDateTime.RelativeMonthRegex}|${SpanishDateTime.MonthRegex}))`; + SpanishDateTime.DateUnitRegex = `(?años|año|meses|mes|semanas|semana|d[ií]a(s)?)\\b`; + SpanishDateTime.PastRegex = `(?\\b(pasad(a|o)(s)?|[uú]ltim[oa](s)?|anterior(es)?|previo(s)?)\\b)`; + SpanishDateTime.FutureRegex = `(?\\b(siguiente(s)?|pr[oó]xim[oa](s)?|dentro\\s+de|en)\\b)`; + SpanishDateTime.SimpleCasesRegex = `\\b((desde\\s+el|desde|del)\\s+)?(${SpanishDateTime.DayRegex})\\s*${SpanishDateTime.TillRegex}\\s*(${SpanishDateTime.DayRegex})\\s+${SpanishDateTime.MonthSuffixRegex}((\\s+|\\s*,\\s*)${SpanishDateTime.YearRegex})?\\b`; + SpanishDateTime.MonthFrontSimpleCasesRegex = `\\b${SpanishDateTime.MonthSuffixRegex}\\s+((desde\\s+el|desde|del)\\s+)?(${SpanishDateTime.DayRegex})\\s*${SpanishDateTime.TillRegex}\\s*(${SpanishDateTime.DayRegex})((\\s+|\\s*,\\s*)${SpanishDateTime.YearRegex})?\\b`; + SpanishDateTime.MonthFrontBetweenRegex = `\\b${SpanishDateTime.MonthSuffixRegex}\\s+((entre|entre\\s+el)\\s+)(${SpanishDateTime.DayRegex})\\s*${SpanishDateTime.AndRegex}\\s*(${SpanishDateTime.DayRegex})((\\s+|\\s*,\\s*)${SpanishDateTime.YearRegex})?\\b`; + SpanishDateTime.DayBetweenRegex = `\\b((entre|entre\\s+el)\\s+)(${SpanishDateTime.DayRegex})\\s*${SpanishDateTime.AndRegex}\\s*(${SpanishDateTime.DayRegex})\\s+${SpanishDateTime.MonthSuffixRegex}((\\s+|\\s*,\\s*)${SpanishDateTime.YearRegex})?\\b`; + SpanishDateTime.OneWordPeriodRegex = `\\b(((pr[oó]xim[oa]?|est[ea]|[uú]ltim[oa]?|en)\\s+)?(?Abril|Abr|Agosto|Ago|Diciembre|Dic|Enero|Ene|Febrero|Feb|Julio|Jul|Junio|Jun|Marzo|Mar|Mayo|May|Noviembre|Nov|Octubre|Oct|Septiembre|Setiembre|Sept|Set)|(?<=\\b(del|de la|el|la)\\s+)?(pr[oó]xim[oa](s)?|[uú]ltim[oa]?|est(e|a))\\s+(fin de semana|semana|mes|año)|fin de semana|(mes|años)? a la fecha)\\b`; + SpanishDateTime.MonthWithYearRegex = `\\b(((pr[oó]xim[oa](s)?|este|esta|[uú]ltim[oa]?|en)\\s+)?(?Abril|Abr|Agosto|Ago|Diciembre|Dic|Enero|Ene|Febrero|Feb|Julio|Jul|Junio|Jun|Marzo|Mar|Mayo|May|Noviembre|Nov|Octubre|Oct|Septiembre|Setiembre|Sept|Set)\\s+((de|del|de la)\\s+)?(${SpanishDateTime.YearRegex}|(?pr[oó]ximo(s)?|[uú]ltimo?|este)\\s+año))\\b`; + SpanishDateTime.MonthNumWithYearRegex = `(${SpanishDateTime.YearRegex}(\\s*?)[/\\-\\.](\\s*?)${SpanishDateTime.MonthNumRegex})|(${SpanishDateTime.MonthNumRegex}(\\s*?)[/\\-](\\s*?)${SpanishDateTime.YearRegex})`; + SpanishDateTime.WeekOfMonthRegex = `(?(la\\s+)?(?primera?|1ra|segunda|2da|tercera?|3ra|cuarta|4ta|quinta|5ta|[uú]ltima)\\s+semana\\s+${SpanishDateTime.MonthSuffixRegex})`; + SpanishDateTime.WeekOfYearRegex = `(?(la\\s+)?(?primera?|1ra|segunda|2da|tercera?|3ra|cuarta|4ta|quinta|5ta|[uú]ltima?)\\s+semana(\\s+del?)?\\s+(${SpanishDateTime.YearRegex}|(?pr[oó]ximo|[uú]ltimo|este)\\s+año))`; + SpanishDateTime.FollowedDateUnit = `^\\s*${SpanishDateTime.DateUnitRegex}`; + SpanishDateTime.NumberCombinedWithDateUnit = `\\b(?\\d+(\\.\\d*)?)${SpanishDateTime.DateUnitRegex}`; + SpanishDateTime.QuarterRegex = `(el\\s+)?(?primer|1er|segundo|2do|tercer|3ro|cuarto|4to)\\s+cuatrimestre(\\s+de|\\s*,\\s*)?\\s+(${SpanishDateTime.YearRegex}|(?pr[oó]ximo(s)?|[uú]ltimo?|este)\\s+año)`; + SpanishDateTime.QuarterRegexYearFront = `(${SpanishDateTime.YearRegex}|(?pr[oó]ximo(s)?|[uú]ltimo?|este)\\s+año)\\s+(el\\s+)?(?(primer|primero)|1er|segundo|2do|(tercer|terceo)|3ro|cuarto|4to)\\s+cuatrimestre`; + SpanishDateTime.AllHalfYearRegex = `^[.]`; + SpanishDateTime.PrefixDayRegex = `^[.]`; + SpanishDateTime.CenturySuffixRegex = `^[.]`; + SpanishDateTime.SeasonRegex = `\\b(?(([uú]ltim[oa]|est[ea]|el|la|(pr[oó]xim[oa]s?|siguiente))\\s+)?(?primavera|verano|otoño|invierno)((\\s+del?|\\s*,\\s*)?\\s+(${SpanishDateTime.YearRegex}|(?pr[oó]ximo|[uú]ltimo|este)\\s+año))?)\\b`; + SpanishDateTime.WhichWeekRegex = `(semana)(\\s*)(?\\d\\d|\\d|0\\d)`; + SpanishDateTime.WeekOfRegex = `(semana)(\\s*)((do|da|de))`; + SpanishDateTime.MonthOfRegex = `(mes)(\\s*)((do|da|de))`; + SpanishDateTime.RangeUnitRegex = `\\b(?años|año|meses|mes|semanas|semana)\\b`; + SpanishDateTime.InConnectorRegex = `\\b(in)\\b`; + SpanishDateTime.WithinNextPrefixRegex = `^[.]`; + SpanishDateTime.FromRegex = `((desde|de)(\\s*la(s)?)?)$`; + SpanishDateTime.ConnectorAndRegex = `(y\\s*(la(s)?)?)$`; + SpanishDateTime.BetweenRegex = `(entre\\s*(la(s)?)?)`; + SpanishDateTime.WeekDayRegex = `\\b(?Domingos?|Lunes|Martes|Mi[eé]rcoles|Jueves|Viernes|S[aá]bados?|Lu|Ma|Mi|Ju|Vi|Sa|Do)\\b`; + SpanishDateTime.OnRegex = `(?<=\\ben\\s+)(${SpanishDateTime.DayRegex}s?)\\b`; + SpanishDateTime.RelaxedOnRegex = `(?<=\\b(en|el|del)\\s+)((?10|11|12|13|14|15|16|17|18|19|1st|20|21|22|23|24|25|26|27|28|29|2|30|31|3|4|5|6|7|8|9)s?)\\b`; + SpanishDateTime.ThisRegex = `\\b((este\\s*)${SpanishDateTime.WeekDayRegex})|(${SpanishDateTime.WeekDayRegex}\\s*((de\\s+)?esta\\s+semana))\\b`; + SpanishDateTime.LastDateRegex = `\\b(([uú]ltimo)\\s*${SpanishDateTime.WeekDayRegex})|(${SpanishDateTime.WeekDayRegex}(\\s+((de\\s+)?(esta|la)\\s+([uú]ltima\\s+)?semana)))\\b`; + SpanishDateTime.NextDateRegex = `\\b(((pr[oó]ximo|siguiente)\\s*)${SpanishDateTime.WeekDayRegex})|(${SpanishDateTime.WeekDayRegex}(\\s+(de\\s+)?(la\\s+)?(pr[oó]xima|siguiente)(\\s*semana)))\\b`; + SpanishDateTime.SpecialDayRegex = `\\b((el\\s+)?(d[ií]a\\s+antes\\s+de\\s+ayer|anteayer)|((el\\s+)?d[ií]a\\s+(despu[eé]s\\s+)?de\\s+mañana|pasado\\s+mañana)|(el\\s)?d[ií]a siguiente|(el\\s)?pr[oó]ximo\\s+d[ií]a|(el\\s+)?[uú]ltimo d[ií]a|(d)?el d[ií]a|ayer|mañana|hoy)\\b`; + SpanishDateTime.SpecialDayWithNumRegex = `^[.]`; + SpanishDateTime.ForTheRegex = `^[.]`; + SpanishDateTime.WeekDayAndDayOfMonthRegex = `^[.]`; + SpanishDateTime.WeekDayOfMonthRegex = `(?(el\\s+)?(?primer|1er|segundo|2do|tercer|3er|cuarto|4to|quinto|5to|[uú]ltimo)\\s+${SpanishDateTime.WeekDayRegex}\\s+${SpanishDateTime.MonthSuffixRegex})`; + SpanishDateTime.RelativeWeekDayRegex = `^[.]`; + SpanishDateTime.NumberEndingPattern = `^[.]`; + SpanishDateTime.SpecialDateRegex = `(?<=\\b(en)\\s+el\\s+)${SpanishDateTime.DayRegex}\\b`; + SpanishDateTime.OfMonthRegex = `^\\s*de\\s*${SpanishDateTime.MonthSuffixRegex}`; + SpanishDateTime.MonthEndRegex = `(${SpanishDateTime.MonthRegex}\\s*(el)?\\s*$)`; + SpanishDateTime.WeekDayEnd = `${SpanishDateTime.WeekDayRegex}\\s*,?\\s*$`; + SpanishDateTime.DateYearRegex = `(?${SpanishDateTime.YearRegex}|${SpanishDateTime.TwoDigitYearRegex})`; + SpanishDateTime.DateExtractor1 = `\\b(${SpanishDateTime.WeekDayRegex}(\\s+|\\s*,\\s*))?${SpanishDateTime.DayRegex}?((\\s*(de)|[/\\\\\\.\\-])\\s*)?${SpanishDateTime.MonthRegex}\\b`; + SpanishDateTime.DateExtractor2 = `\\b(${SpanishDateTime.WeekDayRegex}(\\s+|\\s*,\\s*))?${SpanishDateTime.DayRegex}\\s*([\\.\\-]|de)\\s*${SpanishDateTime.MonthRegex}(\\s*,\\s*|\\s*(del?)\\s*)${SpanishDateTime.DateYearRegex}\\b`; + SpanishDateTime.DateExtractor3 = `\\b(${SpanishDateTime.WeekDayRegex}(\\s+|\\s*,\\s*))?${SpanishDateTime.DayRegex}(\\s+|\\s*,\\s*|\\s+de\\s+|\\s*-\\s*)${SpanishDateTime.MonthRegex}((\\s+|\\s*,\\s*)${SpanishDateTime.DateYearRegex})?\\b`; + SpanishDateTime.DateExtractor4 = `\\b${SpanishDateTime.MonthNumRegex}\\s*[/\\\\\\-]\\s*${SpanishDateTime.DayRegex}\\s*[/\\\\\\-]\\s*${SpanishDateTime.DateYearRegex}`; + SpanishDateTime.DateExtractor5 = `\\b${SpanishDateTime.DayRegex}\\s*[/\\\\\\-\\.]\\s*${SpanishDateTime.MonthNumRegex}\\s*[/\\\\\\-\\.]\\s*${SpanishDateTime.DateYearRegex}`; + SpanishDateTime.DateExtractor6 = `(?<=\\b(en|el)\\s+)${SpanishDateTime.MonthNumRegex}[\\-\\.]${SpanishDateTime.DayRegex}\\b`; + SpanishDateTime.DateExtractor7 = `\\b${SpanishDateTime.MonthNumRegex}\\s*/\\s*${SpanishDateTime.DayRegex}((\\s+|\\s*,\\s*|\\s+de\\s+)${SpanishDateTime.DateYearRegex})?\\b`; + SpanishDateTime.DateExtractor8 = `(?<=\\b(en|el)\\s+)${SpanishDateTime.DayRegex}[\\\\\\-]${SpanishDateTime.MonthNumRegex}\\b`; + SpanishDateTime.DateExtractor9 = `\\b${SpanishDateTime.DayRegex}\\s*/\\s*${SpanishDateTime.MonthNumRegex}((\\s+|\\s*,\\s*|\\s+de\\s+)${SpanishDateTime.DateYearRegex})?\\b`; + SpanishDateTime.DateExtractor10 = `\\b${SpanishDateTime.YearRegex}\\s*[/\\\\\\-\\.]\\s*${SpanishDateTime.MonthNumRegex}\\s*[/\\\\\\-\\.]\\s*${SpanishDateTime.DayRegex}`; + SpanishDateTime.HourNumRegex = `\\b(?cero|una|dos|tres|cuatro|cinco|seis|siete|ocho|nueve|diez|once|doce)\\b`; + SpanishDateTime.MinuteNumRegex = `(?un|dos|tres|cuatro|cinco|seis|siete|ocho|nueve|diez|once|doce|trece|catorce|quince|dieciseis|diecisiete|dieciocho|diecinueve|veinte|treinta|cuarenta|cincuenta)`; + SpanishDateTime.DeltaMinuteNumRegex = `(?un|dos|tres|cuatro|cinco|seis|siete|ocho|nueve|diez|once|doce|trece|catorce|quince|dieciseis|diecisiete|dieciocho|diecinueve|veinte|treinta|cuarenta|cincuenta)`; + SpanishDateTime.OclockRegex = `(?en\\s+punto)`; + SpanishDateTime.PmRegex = `(?((por|de|a|en)\\s+la)\\s+(tarde|noche))`; + SpanishDateTime.AmRegex = `(?((por|de|a|en)\\s+la)\\s+(mañana|madrugada))`; + SpanishDateTime.AmTimeRegex = `(?(esta|(por|de|a|en)\\s+la)\\s+(mañana|madrugada))`; + SpanishDateTime.PmTimeRegex = `(?(esta|(por|de|a|en)\\s+la)\\s+(tarde|noche))`; + SpanishDateTime.LessThanOneHour = `(?((\\s+y\\s+)?cuarto|(\\s*)menos cuarto|(\\s+y\\s+)media|${baseDateTime.BaseDateTime.DeltaMinuteRegex}(\\s+(minuto|minutos|min|mins))|${SpanishDateTime.DeltaMinuteNumRegex}(\\s+(minuto|minutos|min|mins))))`; + SpanishDateTime.TensTimeRegex = `(?diez|veint(i|e)|treinta|cuarenta|cincuenta)`; + SpanishDateTime.WrittenTimeRegex = `(?${SpanishDateTime.HourNumRegex}\\s*((y|menos)\\s+)?(${SpanishDateTime.MinuteNumRegex}|(${SpanishDateTime.TensTimeRegex}((\\s*y\\s+)?${SpanishDateTime.MinuteNumRegex})?)))`; + SpanishDateTime.TimePrefix = `(?${SpanishDateTime.LessThanOneHour}(\\s+(pasad[ao]s)\\s+(de\\s+las|las)?|\\s+(para|antes\\s+de)?\\s+(las?))?)`; + SpanishDateTime.TimeSuffix = `(?(${SpanishDateTime.LessThanOneHour}\\s+)?(${SpanishDateTime.AmRegex}|${SpanishDateTime.PmRegex}|${SpanishDateTime.OclockRegex}))`; + SpanishDateTime.BasicTime = `(?${SpanishDateTime.WrittenTimeRegex}|${SpanishDateTime.HourNumRegex}|${baseDateTime.BaseDateTime.HourRegex}:${baseDateTime.BaseDateTime.MinuteRegex}(:${baseDateTime.BaseDateTime.SecondRegex})?|${baseDateTime.BaseDateTime.HourRegex})`; + SpanishDateTime.AtRegex = `\\b(?<=\\b(a las?)\\s+)(${SpanishDateTime.WrittenTimeRegex}|${SpanishDateTime.HourNumRegex}|${baseDateTime.BaseDateTime.HourRegex})\\b`; + SpanishDateTime.ConnectNumRegex = `(${baseDateTime.BaseDateTime.HourRegex}(?00|01|02|03|04|05|06|07|08|09|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)\\s*${SpanishDateTime.DescRegex})`; + SpanishDateTime.TimeRegex1 = `(\\b${SpanishDateTime.TimePrefix}\\s+)?(${SpanishDateTime.WrittenTimeRegex}|${SpanishDateTime.HourNumRegex}|${baseDateTime.BaseDateTime.HourRegex})\\s*(${SpanishDateTime.DescRegex})`; + SpanishDateTime.TimeRegex2 = `(\\b${SpanishDateTime.TimePrefix}\\s+)?(T)?${baseDateTime.BaseDateTime.HourRegex}(\\s*)?:(\\s*)?${baseDateTime.BaseDateTime.MinuteRegex}((\\s*)?:(\\s*)?${baseDateTime.BaseDateTime.SecondRegex})?((\\s*${SpanishDateTime.DescRegex})|\\b)`; + SpanishDateTime.TimeRegex3 = `(\\b${SpanishDateTime.TimePrefix}\\s+)?${baseDateTime.BaseDateTime.HourRegex}\\.${baseDateTime.BaseDateTime.MinuteRegex}(\\s*${SpanishDateTime.DescRegex})`; + SpanishDateTime.TimeRegex4 = `\\b((${SpanishDateTime.DescRegex}?)|(${SpanishDateTime.BasicTime}?)(${SpanishDateTime.DescRegex}?))(${SpanishDateTime.TimePrefix}\\s*)(${SpanishDateTime.HourNumRegex}|${baseDateTime.BaseDateTime.HourRegex})?(\\s+${SpanishDateTime.TensTimeRegex}(\\s+y\\s+)?${SpanishDateTime.MinuteNumRegex}?)?(${SpanishDateTime.OclockRegex})?\\b`; + SpanishDateTime.TimeRegex5 = `\\b(${SpanishDateTime.TimePrefix}|${SpanishDateTime.BasicTime}${SpanishDateTime.TimePrefix})\\s+(\\s*${SpanishDateTime.DescRegex})?${SpanishDateTime.BasicTime}?\\s*${SpanishDateTime.TimeSuffix}\\b`; + SpanishDateTime.TimeRegex6 = `(${SpanishDateTime.BasicTime}(\\s*${SpanishDateTime.DescRegex})?\\s+${SpanishDateTime.TimeSuffix}\\b)`; + SpanishDateTime.TimeRegex7 = `\\b${SpanishDateTime.TimeSuffix}\\s+a\\s+las\\s+${SpanishDateTime.BasicTime}((\\s*${SpanishDateTime.DescRegex})|\\b)`; + SpanishDateTime.TimeRegex8 = `\\b${SpanishDateTime.TimeSuffix}\\s+${SpanishDateTime.BasicTime}((\\s*${SpanishDateTime.DescRegex})|\\b)`; + SpanishDateTime.TimeRegex9 = `\\b(?${SpanishDateTime.HourNumRegex}\\s+(${SpanishDateTime.TensTimeRegex}\\s*)?(y\\s+)?${SpanishDateTime.MinuteNumRegex}?)\\b`; + SpanishDateTime.TimeRegex10 = `(a\\s+la|al)\\s+(madrugada|mañana|medio\\s*d[ií]a|tarde|noche)`; + SpanishDateTime.TimeRegex11 = `\\b(${SpanishDateTime.WrittenTimeRegex})(${SpanishDateTime.DescRegex}?)\\b`; + SpanishDateTime.TimeRegex12 = `(\\b${SpanishDateTime.TimePrefix}\\s+)?${baseDateTime.BaseDateTime.HourRegex}(\\s*h\\s*)${baseDateTime.BaseDateTime.MinuteRegex}(\\s*${SpanishDateTime.DescRegex})?`; + SpanishDateTime.PrepositionRegex = `(?(a(l)?|en|de(l)?)?(\\s*(la(s)?|el|los))?$)`; + SpanishDateTime.NowRegex = `\\b(?(justo\\s+)?ahora(\\s+mismo)?|en\\s+este\\s+momento|tan\\s+pronto\\s+como\\s+sea\\s+posible|tan\\s+pronto\\s+como\\s+(pueda|puedas|podamos|puedan)|lo\\s+m[aá]s\\s+pronto\\s+posible|recientemente|previamente)\\b`; + SpanishDateTime.SuffixRegex = `^\\s*(((y|a|en|por)\\s+la|al)\\s+)?(mañana|madrugada|medio\\s*d[ií]a|tarde|noche)\\b`; + SpanishDateTime.TimeOfDayRegex = `\\b(?mañana|madrugada|(pasado\\s+(el\\s+)?)?medio\\s?d[ií]a|tarde|noche|anoche)\\b`; + SpanishDateTime.SpecificTimeOfDayRegex = `\\b(((((a)?\\s+la|esta|siguiente|pr[oó]xim[oa]|[uú]ltim[oa])\\s+)?${SpanishDateTime.TimeOfDayRegex}))\\b`; + SpanishDateTime.TimeOfTodayAfterRegex = `^\\s*(,\\s*)?(en|de(l)?\\s+)?${SpanishDateTime.SpecificTimeOfDayRegex}`; + SpanishDateTime.TimeOfTodayBeforeRegex = `(${SpanishDateTime.SpecificTimeOfDayRegex}(\\s*,)?(\\s+(a\\s+la(s)?|para))?\\s*)`; + SpanishDateTime.SimpleTimeOfTodayAfterRegex = `(${SpanishDateTime.HourNumRegex}|${baseDateTime.BaseDateTime.HourRegex})\\s*(,\\s*)?((en|de(l)?)?\\s+)?${SpanishDateTime.SpecificTimeOfDayRegex}`; + SpanishDateTime.SimpleTimeOfTodayBeforeRegex = `(${SpanishDateTime.SpecificTimeOfDayRegex}(\\s*,)?(\\s+(a\\s+la|para))?\\s*(${SpanishDateTime.HourNumRegex}|${baseDateTime.BaseDateTime.HourRegex}))`; + SpanishDateTime.TheEndOfRegex = `((a|e)l\\s+)?fin(alizar|al)?(\\s+(el|de(l)?)(\\s+d[ií]a)?(\\s+de)?)?\\s*$`; + SpanishDateTime.UnitRegex = `(?años|año|meses|mes|semanas|semana|d[ií]as|d[ií]a|horas|hora|h|hr|hrs|hs|minutos|minuto|mins|min|segundos|segundo|segs|seg)\\b`; + SpanishDateTime.ConnectorRegex = `^(,|t|para la|para las|cerca de la|cerca de las)$`; + SpanishDateTime.TimeHourNumRegex = `(?veintiuno|veintidos|veintitres|veinticuatro|cero|uno|dos|tres|cuatro|cinco|seis|siete|ocho|nueve|diez|once|doce|trece|catorce|quince|diecis([eé])is|diecisiete|dieciocho|diecinueve|veinte)`; + SpanishDateTime.PureNumFromTo = `((desde|de)\\s+(la(s)?\\s+)?)?(${baseDateTime.BaseDateTime.HourRegex}|${SpanishDateTime.TimeHourNumRegex})(\\s*(?${SpanishDateTime.DescRegex}))?\\s*${SpanishDateTime.TillRegex}\\s*(${baseDateTime.BaseDateTime.HourRegex}|${SpanishDateTime.TimeHourNumRegex})\\s*(?${SpanishDateTime.PmRegex}|${SpanishDateTime.AmRegex}|${SpanishDateTime.DescRegex})?`; + SpanishDateTime.PureNumBetweenAnd = `(entre\\s+(la(s)?\\s+)?)(${baseDateTime.BaseDateTime.HourRegex}|${SpanishDateTime.TimeHourNumRegex})(\\s*(?${SpanishDateTime.DescRegex}))?\\s*y\\s*(la(s)?\\s+)?(${baseDateTime.BaseDateTime.HourRegex}|${SpanishDateTime.TimeHourNumRegex})\\s*(?${SpanishDateTime.PmRegex}|${SpanishDateTime.AmRegex}|${SpanishDateTime.DescRegex})?`; + SpanishDateTime.SpecificTimeFromTo = `^[.]`; + SpanishDateTime.SpecificTimeBetweenAnd = `^[.]`; + SpanishDateTime.TimeUnitRegex = `(?horas|hora|h|minutos|minuto|mins|min|segundos|segundo|secs|sec)\\b`; + SpanishDateTime.TimeFollowedUnit = `^\\s*${SpanishDateTime.TimeUnitRegex}`; + SpanishDateTime.TimeNumberCombinedWithUnit = `\\b(?\\d+(\\,\\d*)?)\\s*${SpanishDateTime.TimeUnitRegex}`; + SpanishDateTime.DateTimePeriodNumberCombinedWithUnit = `\\b(?\\d+(\\.\\d*)?)\\s*${SpanishDateTime.TimeUnitRegex}`; + SpanishDateTime.PeriodTimeOfDayWithDateRegex = `\\b(((y|a|en|por)\\s+la|al)\\s+)?(?mañana|madrugada|(pasado\\s+(el\\s+)?)?medio\\s?d[ií]a|tarde|noche|anoche)\\b`; + SpanishDateTime.RelativeTimeUnitRegex = `(${SpanishDateTime.PastRegex}|${SpanishDateTime.FutureRegex})\\s+${SpanishDateTime.UnitRegex}`; + SpanishDateTime.LessThanRegex = `^[.]`; + SpanishDateTime.MoreThanRegex = `^[.]`; + SpanishDateTime.SuffixAndRegex = `(?\\s*(y)\\s+((un|uno|una)\\s+)?(?media|cuarto))`; + SpanishDateTime.FollowedUnit = `^\\s*${SpanishDateTime.UnitRegex}`; + SpanishDateTime.DurationNumberCombinedWithUnit = `\\b(?\\d+(\\,\\d*)?)${SpanishDateTime.UnitRegex}`; + SpanishDateTime.AnUnitRegex = `\\b(un(a)?)\\s+${SpanishDateTime.UnitRegex}`; + SpanishDateTime.DuringRegex = `^[.]`; + SpanishDateTime.AllRegex = `\\b(?tod[oa]?\\s+(el|la)\\s+(?año|mes|semana|d[ií]a))\\b`; + SpanishDateTime.HalfRegex = `\\b(?medi[oa]\\s+(?ano|mes|semana|d[íi]a|hora))\\b`; + SpanishDateTime.ConjunctionRegex = `^[.]`; + SpanishDateTime.InexactNumberRegex = `\\b(pocos|poco|algo|varios)\\b`; + SpanishDateTime.InexactNumberUnitRegex = `\\b(pocos|poco|algo|varios)\\s+${SpanishDateTime.UnitRegex}`; + SpanishDateTime.HolidayRegex1 = `\\b(?viernes santo|mi[eé]rcoles de ceniza|martes de carnaval|d[ií]a (de|de los) presidentes?|clebraci[oó]n de mao|año nuevo chino|año nuevo|noche vieja|(festividad de )?los mayos|d[ií]a de los inocentes|navidad|noche buena|d[ií]a de acci[oó]n de gracias|acci[oó]n de gracias|yuandan|halloween|noches de brujas|pascuas)(\\s+(del?\\s+)?(${SpanishDateTime.YearRegex}|(?(pr[oó]xim[oa]?|est[ea]|[uú]ltim[oa]?|en))\\s+año))?\\b`; + SpanishDateTime.HolidayRegex2 = `\\b(?(d[ií]a( del?( la)?)? )?(martin luther king|todos los santos|blanco|san patricio|san valent[ií]n|san jorge|cinco de mayo|independencia|raza|trabajador))(\\s+(del?\\s+)?(${SpanishDateTime.YearRegex}|(?(pr[oó]xim[oa]?|est[ea]|[uú]ltim[oa]?|en))\\s+año))?\\b`; + SpanishDateTime.HolidayRegex3 = `\\b(?(d[ií]a( del?( las?)?)? )(trabajador|madres?|padres?|[aá]rbol|mujer(es)?|solteros?|niños?|marmota|san valent[ií]n|maestro))(\\s+(del?\\s+)?(${SpanishDateTime.YearRegex}|(?(pr[oó]xim[oa]?|est[ea]|[uú]ltim[oa]?|en))\\s+año))?\\b`; + SpanishDateTime.BeforeRegex = `(antes(\\s+del?(\\s+las?)?)?)`; + SpanishDateTime.AfterRegex = `(despues(\\s*del?(\\s+las?)?)?)`; + SpanishDateTime.SinceRegex = `(desde(\\s+(las?|el))?)`; + SpanishDateTime.AroundRegex = `^[.]`; + SpanishDateTime.PeriodicRegex = `\\b(?a\\s*diario|diariamente|mensualmente|semanalmente|quincenalmente|anualmente)\\b`; + SpanishDateTime.EachExpression = `cada|tod[oa]s\\s*(l[oa]s)?`; + SpanishDateTime.EachUnitRegex = `(?(${SpanishDateTime.EachExpression})\\s*${SpanishDateTime.UnitRegex})`; + SpanishDateTime.EachPrefixRegex = `(?(${SpanishDateTime.EachExpression})\\s*$)`; + SpanishDateTime.EachDayRegex = `\\s*(${SpanishDateTime.EachExpression})\\s*d[ií]as\\s*\\b`; + SpanishDateTime.BeforeEachDayRegex = `(${SpanishDateTime.EachExpression})\\s*d[ií]as(\\s+a\\s+las?)?\\s*\\b`; + SpanishDateTime.SetEachRegex = `(?(${SpanishDateTime.EachExpression})\\s*)`; + SpanishDateTime.LaterEarlyPeriodRegex = `^[.]`; + SpanishDateTime.WeekWithWeekDayRangeRegex = `^[.]`; + SpanishDateTime.GeneralEndingRegex = `^[.]`; + SpanishDateTime.MiddlePauseRegex = `^[.]`; + SpanishDateTime.PrefixArticleRegex = `^[\\.]`; + SpanishDateTime.OrRegex = `^[.]`; + SpanishDateTime.YearPlusNumberRegex = `^[.]`; + SpanishDateTime.NumberAsTimeRegex = `^[.]`; + SpanishDateTime.TimeBeforeAfterRegex = `^[.]`; + SpanishDateTime.DateNumberConnectorRegex = `^[.]`; + SpanishDateTime.CenturyRegex = `^[.]`; + SpanishDateTime.DecadeRegex = `^[.]`; + SpanishDateTime.DecadeWithCenturyRegex = `^[.]`; + SpanishDateTime.RelativeDecadeRegex = `^[.]`; + SpanishDateTime.ComplexDatePeriodRegex = `^[.]`; + SpanishDateTime.YearSuffix = `(,?\\s*(${SpanishDateTime.YearRegex}|${SpanishDateTime.FullTextYearRegex}))`; + SpanishDateTime.AgoRegex = `\\b(antes)\\b`; + SpanishDateTime.LaterRegex = `\\b(despu[eé]s|desde ahora)\\b`; + SpanishDateTime.Tomorrow = 'mañana'; + SpanishDateTime.UnitMap = new Map([["años", "Y"], ["año", "Y"], ["meses", "MON"], ["mes", "MON"], ["semanas", "W"], ["semana", "W"], ["dias", "D"], ["dia", "D"], ["días", "D"], ["día", "D"], ["horas", "H"], ["hora", "H"], ["hrs", "H"], ["hr", "H"], ["h", "H"], ["minutos", "M"], ["minuto", "M"], ["mins", "M"], ["min", "M"], ["segundos", "S"], ["segundo", "S"], ["segs", "S"], ["seg", "S"]]); + SpanishDateTime.UnitValueMap = new Map([["años", 31536000], ["año", 31536000], ["meses", 2592000], ["mes", 2592000], ["semanas", 604800], ["semana", 604800], ["dias", 86400], ["dia", 86400], ["días", 86400], ["día", 86400], ["horas", 3600], ["hora", 3600], ["hrs", 3600], ["hr", 3600], ["h", 3600], ["minutos", 60], ["minuto", 60], ["mins", 60], ["min", 60], ["segundos", 1], ["segundo", 1], ["segs", 1], ["seg", 1]]); + SpanishDateTime.SeasonMap = new Map([["primavera", "SP"], ["verano", "SU"], ["otoño", "FA"], ["invierno", "WI"]]); + SpanishDateTime.SeasonValueMap = new Map([["SP", 3], ["SU", 6], ["FA", 9], ["WI", 12]]); + SpanishDateTime.CardinalMap = new Map([["primer", 1], ["primero", 1], ["primera", 1], ["1er", 1], ["1ro", 1], ["1ra", 1], ["segundo", 2], ["segunda", 2], ["2do", 2], ["2da", 2], ["tercer", 3], ["tercero", 3], ["tercera", 3], ["3er", 3], ["3ro", 3], ["3ra", 3], ["cuarto", 4], ["cuarta", 4], ["4to", 4], ["4ta", 4], ["quinto", 5], ["quinta", 5], ["5to", 5], ["5ta", 5]]); + SpanishDateTime.DayOfWeek = new Map([["lunes", 1], ["martes", 2], ["miercoles", 3], ["miércoles", 3], ["jueves", 4], ["viernes", 5], ["sabado", 6], ["domingo", 0], ["lu", 1], ["ma", 2], ["mi", 3], ["ju", 4], ["vi", 5], ["sa", 6], ["do", 0]]); + SpanishDateTime.MonthOfYear = new Map([["1", 1], ["2", 2], ["3", 3], ["4", 4], ["5", 5], ["6", 6], ["7", 7], ["8", 8], ["9", 9], ["10", 10], ["11", 11], ["12", 12], ["enero", 1], ["febrero", 2], ["marzo", 3], ["abril", 4], ["mayo", 5], ["junio", 6], ["julio", 7], ["agosto", 8], ["septiembre", 9], ["setiembre", 9], ["octubre", 10], ["noviembre", 11], ["diciembre", 12], ["ene", 1], ["feb", 2], ["mar", 3], ["abr", 4], ["may", 5], ["jun", 6], ["jul", 7], ["ago", 8], ["sept", 9], ["set", 9], ["oct", 10], ["nov", 11], ["dic", 12], ["01", 1], ["02", 2], ["03", 3], ["04", 4], ["05", 5], ["06", 6], ["07", 7], ["08", 8], ["09", 9]]); + SpanishDateTime.Numbers = new Map([["cero", 0], ["un", 1], ["una", 1], ["uno", 1], ["dos", 2], ["tres", 3], ["cuatro", 4], ["cinco", 5], ["seis", 6], ["siete", 7], ["ocho", 8], ["nueve", 9], ["diez", 10], ["once", 11], ["doce", 12], ["docena", 12], ["docenas", 12], ["trece", 13], ["catorce", 14], ["quince", 15], ["dieciseis", 16], ["dieciséis", 16], ["diecisiete", 17], ["dieciocho", 18], ["diecinueve", 19], ["veinte", 20], ["ventiuna", 21], ["ventiuno", 21], ["veintiun", 21], ["veintiún", 21], ["veintiuno", 21], ["veintiuna", 21], ["veintidos", 22], ["veintidós", 22], ["veintitres", 23], ["veintitrés", 23], ["veinticuatro", 24], ["veinticinco", 25], ["veintiseis", 26], ["veintiséis", 26], ["veintisiete", 27], ["veintiocho", 28], ["veintinueve", 29], ["treinta", 30]]); + SpanishDateTime.HolidayNames = new Map([["padres", ["diadelpadre"]], ["madres", ["diadelamadre"]], ["acciondegracias", ["diadegracias", "diadeacciondegracias", "acciondegracias"]], ["trabajador", ["diadeltrabajador"]], ["delaraza", ["diadelaraza", "diadeladiversidadcultural"]], ["memoria", ["diadelamemoria"]], ["pascuas", ["diadepascuas", "pascuas"]], ["navidad", ["navidad", "diadenavidad"]], ["nochebuena", ["diadenochebuena", "nochebuena"]], ["añonuevo", ["añonuevo", "diadeañonuevo"]], ["nochevieja", ["nochevieja", "diadenochevieja"]], ["yuandan", ["yuandan"]], ["maestro", ["diadelmaestro"]], ["todoslossantos", ["todoslossantos"]], ["niño", ["diadelniño"]], ["mujer", ["diadelamujer"]]]); + SpanishDateTime.VariableHolidaysTimexDictionary = new Map([["padres", "-06-WXX-7-3"], ["madres", "-05-WXX-7-2"], ["acciondegracias", "-11-WXX-4-4"], ["trabajador", "-05-WXX-1-1"], ["delaraza", "-10-WXX-1-2"], ["memoria", "-03-WXX-2-4"]]); + SpanishDateTime.DoubleNumbers = new Map([["mitad", 0.5], ["cuarto", 0.25]]); + SpanishDateTime.DateTokenPrefix = 'en '; + SpanishDateTime.TimeTokenPrefix = 'a las '; + SpanishDateTime.TokenBeforeDate = 'el '; + SpanishDateTime.TokenBeforeTime = 'la '; + SpanishDateTime.NextPrefixRegex = `(pr[oó]xim[oa]|siguiente)\\b`; + SpanishDateTime.PastPrefixRegex = `([uú]ltim[oa])\\b`; + SpanishDateTime.ThisPrefixRegex = `(est[ea])\\b`; + SpanishDateTime.RelativeDayRegex = `^[\\.]`; + SpanishDateTime.RestOfDateRegex = `^[\\.]`; + SpanishDateTime.RelativeDurationUnitRegex = `^[\\.]`; + SpanishDateTime.ReferenceDatePeriodRegex = `^[.]`; + SpanishDateTime.FromToRegex = `\\b(from).+(to)\\b.+`; + SpanishDateTime.SingleAmbiguousMonthRegex = `^(the\\s+)?(may|march)$`; + SpanishDateTime.UnspecificDatePeriodRegex = `^[.]`; + SpanishDateTime.PrepositionSuffixRegex = `\\b(on|in|at|around|for|during|since|from|to)$`; + SpanishDateTime.RestOfDateTimeRegex = `^[\\.]`; + SpanishDateTime.SetWeekDayRegex = `^[\\.]`; + SpanishDateTime.NightRegex = `\\b(medionoche|noche)\\b`; + SpanishDateTime.CommonDatePrefixRegex = `^[\\.]`; + SpanishDateTime.DurationUnitRegex = `^[\\.]`; + SpanishDateTime.DurationConnectorRegex = `^[.]`; + SpanishDateTime.YearAfterRegex = `^[.]`; + SpanishDateTime.YearPeriodRegex = `^[.]`; + SpanishDateTime.FutureSuffixRegex = `^[.]`; + SpanishDateTime.WrittenDecades = new Map([["", 0]]); + SpanishDateTime.SpecialDecadeCases = new Map([["", 0]]); + SpanishDateTime.DefaultLanguageFallback = 'DMY'; + SpanishDateTime.DurationDateRestrictions = []; +})(SpanishDateTime = exports.SpanishDateTime || (exports.SpanishDateTime = {})); + +}); + +unwrapExports(spanishDateTime); + +var durationConfiguration$2 = createCommonjsModule(function (module, exports) { +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); + + + +class SpanishDurationExtractorConfiguration { + constructor() { + this.allRegex = recognizersText.RegExpUtility.getSafeRegExp(spanishDateTime.SpanishDateTime.AllRegex, "gis"); + this.halfRegex = recognizersText.RegExpUtility.getSafeRegExp(spanishDateTime.SpanishDateTime.HalfRegex, "gis"); + this.followedUnit = recognizersText.RegExpUtility.getSafeRegExp(spanishDateTime.SpanishDateTime.FollowedUnit, "gis"); + this.numberCombinedWithUnit = recognizersText.RegExpUtility.getSafeRegExp(spanishDateTime.SpanishDateTime.DurationNumberCombinedWithUnit, "gis"); + this.anUnitRegex = recognizersText.RegExpUtility.getSafeRegExp(spanishDateTime.SpanishDateTime.AnUnitRegex, "gis"); + this.inexactNumberUnitRegex = recognizersText.RegExpUtility.getSafeRegExp(spanishDateTime.SpanishDateTime.InexactNumberUnitRegex, "gis"); + this.suffixAndRegex = recognizersText.RegExpUtility.getSafeRegExp(spanishDateTime.SpanishDateTime.SuffixAndRegex, "gis"); + this.relativeDurationUnitRegex = recognizersText.RegExpUtility.getSafeRegExp(spanishDateTime.SpanishDateTime.RelativeDurationUnitRegex, "gis"); + this.moreThanRegex = recognizersText.RegExpUtility.getSafeRegExp(spanishDateTime.SpanishDateTime.MoreThanRegex, "gis"); + this.lessThanRegex = recognizersText.RegExpUtility.getSafeRegExp(spanishDateTime.SpanishDateTime.LessThanOneHour, "gis"); + this.cardinalExtractor = new recognizersTextNumber.SpanishCardinalExtractor(); + } +} +exports.SpanishDurationExtractorConfiguration = SpanishDurationExtractorConfiguration; +class SpanishDurationParserConfiguration { + constructor(config) { + this.cardinalExtractor = config.cardinalExtractor; + this.numberParser = config.numberParser; + this.followedUnit = recognizersText.RegExpUtility.getSafeRegExp(spanishDateTime.SpanishDateTime.FollowedUnit); + this.suffixAndRegex = recognizersText.RegExpUtility.getSafeRegExp(spanishDateTime.SpanishDateTime.SuffixAndRegex); + this.numberCombinedWithUnit = recognizersText.RegExpUtility.getSafeRegExp(spanishDateTime.SpanishDateTime.DurationNumberCombinedWithUnit); + this.anUnitRegex = recognizersText.RegExpUtility.getSafeRegExp(spanishDateTime.SpanishDateTime.AnUnitRegex); + this.allDateUnitRegex = recognizersText.RegExpUtility.getSafeRegExp(spanishDateTime.SpanishDateTime.AllRegex); + this.halfDateUnitRegex = recognizersText.RegExpUtility.getSafeRegExp(spanishDateTime.SpanishDateTime.HalfRegex); + this.inexactNumberUnitRegex = recognizersText.RegExpUtility.getSafeRegExp(spanishDateTime.SpanishDateTime.InexactNumberUnitRegex); + this.unitMap = config.unitMap; + this.unitValueMap = config.unitValueMap; + this.doubleNumbers = config.doubleNumbers; + } +} +exports.SpanishDurationParserConfiguration = SpanishDurationParserConfiguration; + +}); + +unwrapExports(durationConfiguration$2); + +var timeConfiguration$2 = createCommonjsModule(function (module, exports) { +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); + + + + +class SpanishTimeExtractorConfiguration { + constructor() { + this.atRegex = recognizersText.RegExpUtility.getSafeRegExp(spanishDateTime.SpanishDateTime.AtRegex, "gis"); + this.ishRegex = null; + this.timeRegexList = SpanishTimeExtractorConfiguration.getTimeRegexList(); + this.durationExtractor = new baseDuration.BaseDurationExtractor(new durationConfiguration$2.SpanishDurationExtractorConfiguration()); + } + static getTimeRegexList() { + return [ + recognizersText.RegExpUtility.getSafeRegExp(spanishDateTime.SpanishDateTime.TimeRegex1, "gis"), + recognizersText.RegExpUtility.getSafeRegExp(spanishDateTime.SpanishDateTime.TimeRegex2, "gis"), + recognizersText.RegExpUtility.getSafeRegExp(spanishDateTime.SpanishDateTime.TimeRegex3, "gis"), + recognizersText.RegExpUtility.getSafeRegExp(spanishDateTime.SpanishDateTime.TimeRegex4, "gis"), + recognizersText.RegExpUtility.getSafeRegExp(spanishDateTime.SpanishDateTime.TimeRegex5, "gis"), + recognizersText.RegExpUtility.getSafeRegExp(spanishDateTime.SpanishDateTime.TimeRegex6, "gis"), + recognizersText.RegExpUtility.getSafeRegExp(spanishDateTime.SpanishDateTime.TimeRegex7, "gis"), + recognizersText.RegExpUtility.getSafeRegExp(spanishDateTime.SpanishDateTime.TimeRegex8, "gis"), + recognizersText.RegExpUtility.getSafeRegExp(spanishDateTime.SpanishDateTime.TimeRegex9, "gis"), + recognizersText.RegExpUtility.getSafeRegExp(spanishDateTime.SpanishDateTime.TimeRegex10, "gis"), + recognizersText.RegExpUtility.getSafeRegExp(spanishDateTime.SpanishDateTime.TimeRegex11, "gis"), + recognizersText.RegExpUtility.getSafeRegExp(spanishDateTime.SpanishDateTime.TimeRegex12, "gis"), + recognizersText.RegExpUtility.getSafeRegExp(spanishDateTime.SpanishDateTime.ConnectNumRegex, "gis") + ]; + } +} +exports.SpanishTimeExtractorConfiguration = SpanishTimeExtractorConfiguration; +class SpanishTimeParserConfiguration { + constructor(config) { + this.timeTokenPrefix = spanishDateTime.SpanishDateTime.TimeTokenPrefix; + this.atRegex = recognizersText.RegExpUtility.getSafeRegExp(spanishDateTime.SpanishDateTime.AtRegex, "gis"); + this.timeRegexes = SpanishTimeExtractorConfiguration.getTimeRegexList(); + this.lessThanOneHour = recognizersText.RegExpUtility.getSafeRegExp(spanishDateTime.SpanishDateTime.LessThanOneHour, "gis"); + this.timeSuffix = recognizersText.RegExpUtility.getSafeRegExp(spanishDateTime.SpanishDateTime.TimeSuffix, "gis"); + this.utilityConfiguration = config.utilityConfiguration; + this.numbers = config.numbers; + } + adjustByPrefix(prefix, adjust) { + let deltaMin = 0; + let trimedPrefix = prefix.trim().toLowerCase(); + if (trimedPrefix.startsWith("cuarto") || trimedPrefix.startsWith("y cuarto")) { + deltaMin = 15; + } + else if (trimedPrefix.startsWith("menos cuarto")) { + deltaMin = -15; + } + else if (trimedPrefix.startsWith("media") || trimedPrefix.startsWith("y media")) { + deltaMin = 30; + } + else { + let matches = recognizersText.RegExpUtility.getMatches(this.lessThanOneHour, trimedPrefix); + if (matches.length) { + let match = matches[0]; + let minStr = match.groups("deltamin").value; + if (minStr) { + deltaMin = parseInt(minStr, 10); + } + else { + minStr = match.groups("deltaminnum").value.toLowerCase(); + if (this.numbers.has(minStr)) { + deltaMin = this.numbers.get(minStr); + } + } + } + } + if (trimedPrefix.endsWith("pasadas") || trimedPrefix.endsWith("pasados") || + trimedPrefix.endsWith("pasadas las") || trimedPrefix.endsWith("pasados las") || + trimedPrefix.endsWith("pasadas de las") || trimedPrefix.endsWith("pasados de las")) { + // deltaMin it's positive + } + else if (trimedPrefix.endsWith("para la") || trimedPrefix.endsWith("para las") || + trimedPrefix.endsWith("antes de la") || trimedPrefix.endsWith("antes de las")) { + deltaMin = -deltaMin; + } + adjust.min += deltaMin; + if (adjust.min < 0) { + adjust.min += 60; + adjust.hour -= 1; + } + adjust.hasMin = adjust.hasMin || adjust.min !== 0; + } + adjustBySuffix(suffix, adjust) { + let trimedSuffix = suffix.trim().toLowerCase(); + this.adjustByPrefix(trimedSuffix, adjust); + let deltaHour = 0; + let matches = recognizersText.RegExpUtility.getMatches(this.timeSuffix, trimedSuffix); + if (matches.length) { + let match = matches[0]; + if (match.index === 0 && match.length === trimedSuffix.length) { + let oclockStr = match.groups("oclock").value; + if (!oclockStr) { + let amStr = match.groups("am").value; + if (amStr) { + if (adjust.hour >= 12) { + deltaHour = -12; + } + adjust.hasAm = true; + } + let pmStr = match.groups("pm").value; + if (pmStr) { + if (adjust.hour < 12) { + deltaHour = 12; + } + adjust.hasPm = true; + } + } + } + } + adjust.hour = (adjust.hour + deltaHour) % 24; + } +} +exports.SpanishTimeParserConfiguration = SpanishTimeParserConfiguration; + +}); + +unwrapExports(timeConfiguration$2); + +var dateTimeConfiguration$2 = createCommonjsModule(function (module, exports) { +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); + + + + + + + + + +class SpanishDateTimeExtractorConfiguration { + constructor() { + this.prepositionRegex = recognizersText.RegExpUtility.getSafeRegExp(spanishDateTime.SpanishDateTime.PrepositionRegex, "gis"); + this.nowRegex = recognizersText.RegExpUtility.getSafeRegExp(spanishDateTime.SpanishDateTime.NowRegex, "gis"); + this.suffixRegex = recognizersText.RegExpUtility.getSafeRegExp(spanishDateTime.SpanishDateTime.SuffixRegex, "gis"); + this.timeOfDayRegex = recognizersText.RegExpUtility.getSafeRegExp(spanishDateTime.SpanishDateTime.TimeOfDayRegex, "gis"); + this.specificTimeOfDayRegex = recognizersText.RegExpUtility.getSafeRegExp(spanishDateTime.SpanishDateTime.SpecificTimeOfDayRegex, "gis"); + this.timeOfTodayAfterRegex = recognizersText.RegExpUtility.getSafeRegExp(spanishDateTime.SpanishDateTime.TimeOfTodayAfterRegex, "gis"); + this.timeOfTodayBeforeRegex = recognizersText.RegExpUtility.getSafeRegExp(spanishDateTime.SpanishDateTime.TimeOfTodayBeforeRegex, "gis"); + this.simpleTimeOfTodayAfterRegex = recognizersText.RegExpUtility.getSafeRegExp(spanishDateTime.SpanishDateTime.SimpleTimeOfTodayAfterRegex, "gis"); + this.simpleTimeOfTodayBeforeRegex = recognizersText.RegExpUtility.getSafeRegExp(spanishDateTime.SpanishDateTime.SimpleTimeOfTodayBeforeRegex, "gis"); + this.theEndOfRegex = recognizersText.RegExpUtility.getSafeRegExp(spanishDateTime.SpanishDateTime.TheEndOfRegex, "gis"); + this.unitRegex = recognizersText.RegExpUtility.getSafeRegExp(spanishDateTime.SpanishDateTime.UnitRegex, "gis"); + this.connectorRegex = recognizersText.RegExpUtility.getSafeRegExp(spanishDateTime.SpanishDateTime.ConnectorRegex, "gis"); + this.nightRegex = recognizersText.RegExpUtility.getSafeRegExp(spanishDateTime.SpanishDateTime.NightRegex, "gis"); + this.datePointExtractor = new baseDate.BaseDateExtractor(new dateConfiguration$2.SpanishDateExtractorConfiguration()); + this.timePointExtractor = new baseTime.BaseTimeExtractor(new timeConfiguration$2.SpanishTimeExtractorConfiguration()); + this.durationExtractor = new baseDuration.BaseDurationExtractor(new durationConfiguration$2.SpanishDurationExtractorConfiguration()); + this.utilityConfiguration = new baseConfiguration$2.SpanishDateTimeUtilityConfiguration(); + } + isConnectorToken(source) { + let trimmed = source.trim(); + return trimmed === "" + || recognizersText.RegExpUtility.getFirstMatchIndex(this.prepositionRegex, source).matched + || recognizersText.RegExpUtility.getFirstMatchIndex(this.connectorRegex, source).matched; + } +} +exports.SpanishDateTimeExtractorConfiguration = SpanishDateTimeExtractorConfiguration; +class SpanishDateTimeParserConfiguration { + constructor(config) { + this.tokenBeforeDate = spanishDateTime.SpanishDateTime.TokenBeforeDate; + this.tokenBeforeTime = spanishDateTime.SpanishDateTime.TokenBeforeTime; + this.nowRegex = recognizersText.RegExpUtility.getSafeRegExp(spanishDateTime.SpanishDateTime.NowRegex, "gis"); + this.amTimeRegex = recognizersText.RegExpUtility.getSafeRegExp(spanishDateTime.SpanishDateTime.AmTimeRegex, "gis"); + this.pmTimeRegex = recognizersText.RegExpUtility.getSafeRegExp(spanishDateTime.SpanishDateTime.PmTimeRegex, "gis"); + this.simpleTimeOfTodayAfterRegex = recognizersText.RegExpUtility.getSafeRegExp(spanishDateTime.SpanishDateTime.SimpleTimeOfTodayAfterRegex, "gis"); + this.simpleTimeOfTodayBeforeRegex = recognizersText.RegExpUtility.getSafeRegExp(spanishDateTime.SpanishDateTime.SimpleTimeOfTodayBeforeRegex, "gis"); + this.specificTimeOfDayRegex = recognizersText.RegExpUtility.getSafeRegExp(spanishDateTime.SpanishDateTime.SpecificTimeOfDayRegex, "gis"); + this.theEndOfRegex = recognizersText.RegExpUtility.getSafeRegExp(spanishDateTime.SpanishDateTime.TheEndOfRegex, "gis"); + this.unitRegex = recognizersText.RegExpUtility.getSafeRegExp(spanishDateTime.SpanishDateTime.UnitRegex, "gis"); + this.nextPrefixRegex = recognizersText.RegExpUtility.getSafeRegExp(spanishDateTime.SpanishDateTime.NextPrefixRegex, "gis"); + this.pastPrefixRegex = recognizersText.RegExpUtility.getSafeRegExp(spanishDateTime.SpanishDateTime.PastPrefixRegex, "gis"); + this.dateExtractor = config.dateExtractor; + this.timeExtractor = config.timeExtractor; + this.dateParser = config.dateParser; + this.timeParser = config.timeParser; + this.numbers = config.numbers; + this.cardinalExtractor = config.cardinalExtractor; + this.numberParser = config.numberParser; + this.durationExtractor = config.durationExtractor; + this.durationParser = config.durationParser; + this.unitMap = config.unitMap; + this.utilityConfiguration = config.utilityConfiguration; + } + haveAmbiguousToken(text, matchedText) { + return text.toLowerCase().includes("esta mañana") + && matchedText.toLocaleLowerCase().includes("mañana"); + } + getMatchedNowTimex(text) { + let trimedText = text.trim().toLowerCase(); + let timex = ""; + if (trimedText.endsWith("ahora") || trimedText.endsWith("mismo") || trimedText.endsWith("momento")) { + timex = "PRESENT_REF"; + } + else if (trimedText.endsWith("posible") || trimedText.endsWith("pueda") || + trimedText.endsWith("puedas") || trimedText.endsWith("podamos") || trimedText.endsWith("puedan")) { + timex = "FUTURE_REF"; + } + else if (trimedText.endsWith("mente")) { + timex = "PAST_REF"; + } + else { + return { + matched: false, + timex: null + }; + } + return { + matched: true, + timex: timex + }; + } + getSwiftDay(text) { + let trimedText = text.trim().toLowerCase(); + let swift = 0; + if (recognizersText.RegExpUtility.getFirstMatchIndex(this.pastPrefixRegex, trimedText).matched) { + swift = -1; + } + else if (recognizersText.RegExpUtility.getFirstMatchIndex(this.nextPrefixRegex, trimedText).matched) { + swift = 1; + } + return swift; + } + getHour(text, hour) { + let trimedText = text.trim().toLowerCase(); + let result = hour; + // TODO: Replace with a regex + if ((trimedText.endsWith("mañana") || trimedText.endsWith("madrugada")) && hour >= 12) { + result -= 12; + } + else if (!(trimedText.endsWith("mañana") || trimedText.endsWith("madrugada")) && hour < 12) { + result += 12; + } + return result; + } +} +exports.SpanishDateTimeParserConfiguration = SpanishDateTimeParserConfiguration; + +}); + +unwrapExports(dateTimeConfiguration$2); + +var datePeriodConfiguration$2 = createCommonjsModule(function (module, exports) { +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); + + + + + + + + +class SpanishDatePeriodExtractorConfiguration { + constructor() { + this.simpleCasesRegexes = [ + recognizersText.RegExpUtility.getSafeRegExp(spanishDateTime.SpanishDateTime.SimpleCasesRegex), + recognizersText.RegExpUtility.getSafeRegExp(spanishDateTime.SpanishDateTime.DayBetweenRegex), + recognizersText.RegExpUtility.getSafeRegExp(spanishDateTime.SpanishDateTime.SimpleCasesRegex), + recognizersText.RegExpUtility.getSafeRegExp(spanishDateTime.SpanishDateTime.DayBetweenRegex), + recognizersText.RegExpUtility.getSafeRegExp(spanishDateTime.SpanishDateTime.OneWordPeriodRegex), + recognizersText.RegExpUtility.getSafeRegExp(spanishDateTime.SpanishDateTime.MonthWithYearRegex), + recognizersText.RegExpUtility.getSafeRegExp(spanishDateTime.SpanishDateTime.MonthNumWithYearRegex), + recognizersText.RegExpUtility.getSafeRegExp(spanishDateTime.SpanishDateTime.YearRegex), + recognizersText.RegExpUtility.getSafeRegExp(spanishDateTime.SpanishDateTime.WeekOfMonthRegex), + recognizersText.RegExpUtility.getSafeRegExp(spanishDateTime.SpanishDateTime.WeekOfYearRegex), + recognizersText.RegExpUtility.getSafeRegExp(spanishDateTime.SpanishDateTime.MonthFrontBetweenRegex), + recognizersText.RegExpUtility.getSafeRegExp(spanishDateTime.SpanishDateTime.MonthFrontSimpleCasesRegex), + recognizersText.RegExpUtility.getSafeRegExp(spanishDateTime.SpanishDateTime.QuarterRegex), + recognizersText.RegExpUtility.getSafeRegExp(spanishDateTime.SpanishDateTime.QuarterRegexYearFront), + recognizersText.RegExpUtility.getSafeRegExp(spanishDateTime.SpanishDateTime.AllHalfYearRegex), + recognizersText.RegExpUtility.getSafeRegExp(spanishDateTime.SpanishDateTime.SeasonRegex), + recognizersText.RegExpUtility.getSafeRegExp(spanishDateTime.SpanishDateTime.RestOfDateRegex), + recognizersText.RegExpUtility.getSafeRegExp(spanishDateTime.SpanishDateTime.LaterEarlyPeriodRegex), + recognizersText.RegExpUtility.getSafeRegExp(spanishDateTime.SpanishDateTime.WeekWithWeekDayRangeRegex) + ]; + this.illegalYearRegex = recognizersText.RegExpUtility.getSafeRegExp(baseDateTime.BaseDateTime.IllegalYearRegex); + this.YearRegex = recognizersText.RegExpUtility.getSafeRegExp(spanishDateTime.SpanishDateTime.YearRegex); + this.tillRegex = recognizersText.RegExpUtility.getSafeRegExp(spanishDateTime.SpanishDateTime.TillRegex); + this.followedUnit = recognizersText.RegExpUtility.getSafeRegExp(spanishDateTime.SpanishDateTime.FollowedDateUnit); + this.numberCombinedWithUnit = recognizersText.RegExpUtility.getSafeRegExp(spanishDateTime.SpanishDateTime.NumberCombinedWithDateUnit); + this.pastRegex = recognizersText.RegExpUtility.getSafeRegExp(spanishDateTime.SpanishDateTime.PastRegex); + this.futureRegex = recognizersText.RegExpUtility.getSafeRegExp(spanishDateTime.SpanishDateTime.FutureRegex); + this.weekOfRegex = recognizersText.RegExpUtility.getSafeRegExp(spanishDateTime.SpanishDateTime.WeekOfRegex); + this.monthOfRegex = recognizersText.RegExpUtility.getSafeRegExp(spanishDateTime.SpanishDateTime.MonthOfRegex); + this.dateUnitRegex = recognizersText.RegExpUtility.getSafeRegExp(spanishDateTime.SpanishDateTime.DateUnitRegex); + this.inConnectorRegex = recognizersText.RegExpUtility.getSafeRegExp(spanishDateTime.SpanishDateTime.InConnectorRegex); + this.rangeUnitRegex = recognizersText.RegExpUtility.getSafeRegExp(spanishDateTime.SpanishDateTime.RangeUnitRegex); + this.fromRegex = recognizersText.RegExpUtility.getSafeRegExp(spanishDateTime.SpanishDateTime.FromRegex); + this.connectorAndRegex = recognizersText.RegExpUtility.getSafeRegExp(spanishDateTime.SpanishDateTime.ConnectorAndRegex); + this.betweenRegex = recognizersText.RegExpUtility.getSafeRegExp(spanishDateTime.SpanishDateTime.BetweenRegex); + this.datePointExtractor = new baseDate.BaseDateExtractor(new dateConfiguration$2.SpanishDateExtractorConfiguration()); + this.integerExtractor = new recognizersTextNumber.SpanishIntegerExtractor(); + this.numberParser = new recognizersTextNumber.BaseNumberParser(new recognizersTextNumber.SpanishNumberParserConfiguration()); + this.durationExtractor = new baseDuration.BaseDurationExtractor(new durationConfiguration$2.SpanishDurationExtractorConfiguration()); + } + getFromTokenIndex(source) { + return recognizersText.RegExpUtility.getFirstMatchIndex(this.fromRegex, source); + } + getBetweenTokenIndex(source) { + return recognizersText.RegExpUtility.getFirstMatchIndex(this.betweenRegex, source); + } + hasConnectorToken(source) { + return recognizersText.RegExpUtility.getFirstMatchIndex(this.connectorAndRegex, source).matched; + } +} +exports.SpanishDatePeriodExtractorConfiguration = SpanishDatePeriodExtractorConfiguration; +class SpanishDatePeriodParserConfiguration { + constructor(config) { + this.tokenBeforeDate = spanishDateTime.SpanishDateTime.TokenBeforeDate; + this.cardinalExtractor = config.cardinalExtractor; + this.numberParser = config.numberParser; + this.durationExtractor = config.durationExtractor; + this.dateExtractor = config.dateExtractor; + this.durationParser = config.durationParser; + this.dateParser = config.dateParser; + this.monthFrontBetweenRegex = recognizersText.RegExpUtility.getSafeRegExp(spanishDateTime.SpanishDateTime.MonthFrontBetweenRegex); + this.betweenRegex = recognizersText.RegExpUtility.getSafeRegExp(spanishDateTime.SpanishDateTime.DayBetweenRegex); + this.monthFrontSimpleCasesRegex = recognizersText.RegExpUtility.getSafeRegExp(spanishDateTime.SpanishDateTime.MonthFrontSimpleCasesRegex); + this.simpleCasesRegex = recognizersText.RegExpUtility.getSafeRegExp(spanishDateTime.SpanishDateTime.SimpleCasesRegex); + this.oneWordPeriodRegex = recognizersText.RegExpUtility.getSafeRegExp(spanishDateTime.SpanishDateTime.OneWordPeriodRegex); + this.monthWithYear = recognizersText.RegExpUtility.getSafeRegExp(spanishDateTime.SpanishDateTime.MonthWithYearRegex); + this.monthNumWithYear = recognizersText.RegExpUtility.getSafeRegExp(spanishDateTime.SpanishDateTime.MonthNumWithYearRegex); + this.yearRegex = recognizersText.RegExpUtility.getSafeRegExp(spanishDateTime.SpanishDateTime.YearRegex); + this.pastRegex = recognizersText.RegExpUtility.getSafeRegExp(spanishDateTime.SpanishDateTime.PastRegex); + this.futureRegex = recognizersText.RegExpUtility.getSafeRegExp(spanishDateTime.SpanishDateTime.FutureRegex); + this.numberCombinedWithUnit = recognizersText.RegExpUtility.getSafeRegExp(spanishDateTime.SpanishDateTime.DurationNumberCombinedWithUnit); + this.weekOfMonthRegex = recognizersText.RegExpUtility.getSafeRegExp(spanishDateTime.SpanishDateTime.WeekOfMonthRegex); + this.weekOfYearRegex = recognizersText.RegExpUtility.getSafeRegExp(spanishDateTime.SpanishDateTime.WeekOfYearRegex); + this.quarterRegex = recognizersText.RegExpUtility.getSafeRegExp(spanishDateTime.SpanishDateTime.QuarterRegex); + this.quarterRegexYearFront = recognizersText.RegExpUtility.getSafeRegExp(spanishDateTime.SpanishDateTime.QuarterRegexYearFront); + this.allHalfYearRegex = recognizersText.RegExpUtility.getSafeRegExp(spanishDateTime.SpanishDateTime.AllHalfYearRegex); + this.seasonRegex = recognizersText.RegExpUtility.getSafeRegExp(spanishDateTime.SpanishDateTime.SeasonRegex); + this.whichWeekRegex = recognizersText.RegExpUtility.getSafeRegExp(spanishDateTime.SpanishDateTime.WhichWeekRegex); + this.weekOfRegex = recognizersText.RegExpUtility.getSafeRegExp(spanishDateTime.SpanishDateTime.WeekOfRegex); + this.monthOfRegex = recognizersText.RegExpUtility.getSafeRegExp(spanishDateTime.SpanishDateTime.MonthOfRegex); + this.restOfDateRegex = recognizersText.RegExpUtility.getSafeRegExp(spanishDateTime.SpanishDateTime.RestOfDateRegex); + this.laterEarlyPeriodRegex = recognizersText.RegExpUtility.getSafeRegExp(spanishDateTime.SpanishDateTime.LaterEarlyPeriodRegex); + this.weekWithWeekDayRangeRegex = recognizersText.RegExpUtility.getSafeRegExp(spanishDateTime.SpanishDateTime.WeekWithWeekDayRangeRegex); + this.nextPrefixRegex = recognizersText.RegExpUtility.getSafeRegExp(spanishDateTime.SpanishDateTime.NextPrefixRegex); + this.pastPrefixRegex = recognizersText.RegExpUtility.getSafeRegExp(spanishDateTime.SpanishDateTime.PastPrefixRegex); + this.thisPrefixRegex = recognizersText.RegExpUtility.getSafeRegExp(spanishDateTime.SpanishDateTime.ThisPrefixRegex); + this.inConnectorRegex = config.utilityConfiguration.inConnectorRegex; + this.unitMap = config.unitMap; + this.cardinalMap = config.cardinalMap; + this.dayOfMonth = config.dayOfMonth; + this.monthOfYear = config.monthOfYear; + this.seasonMap = config.seasonMap; + } + getSwiftDayOrMonth(source) { + let trimedText = source.trim().toLowerCase(); + let swift = 0; + if (recognizersText.RegExpUtility.getFirstMatchIndex(this.nextPrefixRegex, trimedText).matched) { + swift = 1; + } + if (recognizersText.RegExpUtility.getFirstMatchIndex(this.pastPrefixRegex, trimedText).matched) { + swift = -1; + } + return swift; + } + getSwiftYear(source) { + let trimedText = source.trim().toLowerCase(); + let swift = -10; + if (recognizersText.RegExpUtility.getFirstMatchIndex(this.nextPrefixRegex, trimedText).matched) { + swift = 1; + } + if (recognizersText.RegExpUtility.getFirstMatchIndex(this.pastPrefixRegex, trimedText).matched) { + swift = -1; + } + else if (recognizersText.RegExpUtility.getFirstMatchIndex(this.thisPrefixRegex, trimedText).matched) { + swift = 0; + } + return swift; + } + isFuture(source) { + let trimedText = source.trim().toLowerCase(); + return recognizersText.RegExpUtility.getFirstMatchIndex(this.thisPrefixRegex, trimedText).matched + || recognizersText.RegExpUtility.getFirstMatchIndex(this.nextPrefixRegex, trimedText).matched; + } + isYearToDate(source) { + let trimedText = source.trim().toLowerCase(); + return trimedText === "año a la fecha" + || trimedText === "años a la fecha"; + } + isMonthToDate(source) { + let trimedText = source.trim().toLowerCase(); + return trimedText === "mes a la fecha" + || trimedText === "meses a la fecha"; + } + isWeekOnly(source) { + let trimedText = source.trim().toLowerCase(); + return trimedText.endsWith("semana") + && !trimedText.endsWith("fin de semana"); + } + isWeekend(source) { + let trimedText = source.trim().toLowerCase(); + return trimedText.endsWith("fin de semana"); + } + isMonthOnly(source) { + let trimedText = source.trim().toLowerCase(); + return trimedText.endsWith("mes") + || trimedText.endsWith("meses"); + } + isYearOnly(source) { + let trimedText = source.trim().toLowerCase(); + return trimedText.endsWith("año") + || trimedText.endsWith("años"); + } + isLastCardinal(source) { + let trimedText = source.trim().toLowerCase(); + return recognizersText.RegExpUtility.getFirstMatchIndex(this.pastPrefixRegex, trimedText).matched; + } +} +exports.SpanishDatePeriodParserConfiguration = SpanishDatePeriodParserConfiguration; + +}); + +unwrapExports(datePeriodConfiguration$2); + +var timePeriodConfiguration$2 = createCommonjsModule(function (module, exports) { +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); + + + + + + +class SpanishTimePeriodExtractorConfiguration { + constructor() { + this.singleTimeExtractor = new baseTime.BaseTimeExtractor(new timeConfiguration$2.SpanishTimeExtractorConfiguration()); + this.integerExtractor = new recognizersTextNumber.EnglishIntegerExtractor(); + this.utilityConfiguration = new baseConfiguration$2.SpanishDateTimeUtilityConfiguration(); + this.simpleCasesRegex = [ + recognizersText.RegExpUtility.getSafeRegExp(spanishDateTime.SpanishDateTime.PureNumFromTo, "gis"), + recognizersText.RegExpUtility.getSafeRegExp(spanishDateTime.SpanishDateTime.PureNumBetweenAnd, "gis") + ]; + this.tillRegex = recognizersText.RegExpUtility.getSafeRegExp(spanishDateTime.SpanishDateTime.TillRegex, "gis"); + this.timeOfDayRegex = recognizersText.RegExpUtility.getSafeRegExp(spanishDateTime.SpanishDateTime.TimeOfDayRegex, "gis"); + this.generalEndingRegex = recognizersText.RegExpUtility.getSafeRegExp(spanishDateTime.SpanishDateTime.GeneralEndingRegex, "gis"); + this.fromRegex = recognizersText.RegExpUtility.getSafeRegExp(spanishDateTime.SpanishDateTime.FromRegex, "gis"); + this.connectorAndRegex = recognizersText.RegExpUtility.getSafeRegExp(spanishDateTime.SpanishDateTime.ConnectorAndRegex, "gis"); + this.betweenRegex = recognizersText.RegExpUtility.getSafeRegExp(spanishDateTime.SpanishDateTime.BetweenRegex, "gis"); + } + getFromTokenIndex(text) { + return recognizersText.RegExpUtility.getFirstMatchIndex(this.fromRegex, text); + } + hasConnectorToken(text) { + return recognizersText.RegExpUtility.getFirstMatchIndex(this.connectorAndRegex, text).matched; + } + getBetweenTokenIndex(text) { + return recognizersText.RegExpUtility.getFirstMatchIndex(this.betweenRegex, text); + } +} +exports.SpanishTimePeriodExtractorConfiguration = SpanishTimePeriodExtractorConfiguration; +class SpanishTimePeriodParserConfiguration { + constructor(config) { + this.timeExtractor = config.timeExtractor; + this.timeParser = config.timeParser; + this.integerExtractor = config.integerExtractor; + this.numbers = config.numbers; + this.utilityConfiguration = config.utilityConfiguration; + this.pureNumberFromToRegex = recognizersText.RegExpUtility.getSafeRegExp(spanishDateTime.SpanishDateTime.PureNumFromTo, "gis"); + this.pureNumberBetweenAndRegex = recognizersText.RegExpUtility.getSafeRegExp(spanishDateTime.SpanishDateTime.PureNumBetweenAnd, "gis"); + this.timeOfDayRegex = recognizersText.RegExpUtility.getSafeRegExp(spanishDateTime.SpanishDateTime.TimeOfDayRegex, "gis"); + this.tillRegex = recognizersText.RegExpUtility.getSafeRegExp(spanishDateTime.SpanishDateTime.TillRegex, "gis"); + this.specificTimeFromToRegex = recognizersText.RegExpUtility.getSafeRegExp(spanishDateTime.SpanishDateTime.SpecificTimeFromTo); + this.specificTimeBetweenAndRegex = recognizersText.RegExpUtility.getSafeRegExp(spanishDateTime.SpanishDateTime.SpecificTimeBetweenAnd); + } + getMatchedTimexRange(text) { + let trimedText = text.trim().toLowerCase(); + let beginHour = 0; + let endHour = 0; + let endMin = 0; + let timex = ""; + if (trimedText.endsWith("madrugada")) { + timex = "TDA"; + beginHour = 4; + endHour = 8; + } + else if (trimedText.endsWith("mañana")) { + timex = "TMO"; + beginHour = 8; + endHour = 12; + } + else if (trimedText.includes("pasado mediodia") || trimedText.includes("pasado el mediodia")) { + timex = "TAF"; + beginHour = 12; + endHour = 16; + } + else if (trimedText.endsWith("tarde")) { + timex = "TEV"; + beginHour = 16; + endHour = 20; + } + else if (trimedText.endsWith("noche")) { + timex = "TNI"; + beginHour = 20; + endHour = 23; + endMin = 59; + } + else { + timex = null; + return { + matched: false, + timex, + beginHour, + endHour, + endMin + }; + } + return { + matched: true, + timex, + beginHour, + endHour, + endMin + }; + } +} +exports.SpanishTimePeriodParserConfiguration = SpanishTimePeriodParserConfiguration; + +}); + +unwrapExports(timePeriodConfiguration$2); + +var dateTimePeriodConfiguration$2 = createCommonjsModule(function (module, exports) { +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); + + + + + + + + + + + + + +class SpanishDateTimePeriodExtractorConfiguration { + constructor() { + this.simpleCasesRegexes = [ + recognizersText.RegExpUtility.getSafeRegExp(spanishDateTime.SpanishDateTime.PureNumFromTo), + recognizersText.RegExpUtility.getSafeRegExp(spanishDateTime.SpanishDateTime.PureNumBetweenAnd) + ]; + this.prepositionRegex = recognizersText.RegExpUtility.getSafeRegExp(spanishDateTime.SpanishDateTime.PrepositionRegex); + this.tillRegex = recognizersText.RegExpUtility.getSafeRegExp(spanishDateTime.SpanishDateTime.TillRegex); + this.specificTimeOfDayRegex = recognizersText.RegExpUtility.getSafeRegExp(spanishDateTime.SpanishDateTime.SpecificTimeOfDayRegex); + this.timeOfDayRegex = recognizersText.RegExpUtility.getSafeRegExp(spanishDateTime.SpanishDateTime.TimeOfDayRegex); + this.followedUnit = recognizersText.RegExpUtility.getSafeRegExp(spanishDateTime.SpanishDateTime.FollowedUnit); + this.timeUnitRegex = recognizersText.RegExpUtility.getSafeRegExp(spanishDateTime.SpanishDateTime.UnitRegex); + this.pastPrefixRegex = recognizersText.RegExpUtility.getSafeRegExp(spanishDateTime.SpanishDateTime.PastRegex); + this.nextPrefixRegex = recognizersText.RegExpUtility.getSafeRegExp(spanishDateTime.SpanishDateTime.FutureRegex); + this.numberCombinedWithUnit = recognizersText.RegExpUtility.getSafeRegExp(spanishDateTime.SpanishDateTime.DateTimePeriodNumberCombinedWithUnit); + this.weekDayRegex = recognizersText.RegExpUtility.getSafeRegExp(spanishDateTime.SpanishDateTime.WeekDayRegex); + this.periodTimeOfDayWithDateRegex = recognizersText.RegExpUtility.getSafeRegExp(spanishDateTime.SpanishDateTime.PeriodTimeOfDayWithDateRegex); + this.relativeTimeUnitRegex = recognizersText.RegExpUtility.getSafeRegExp(spanishDateTime.SpanishDateTime.RelativeTimeUnitRegex); + this.restOfDateTimeRegex = recognizersText.RegExpUtility.getSafeRegExp(spanishDateTime.SpanishDateTime.RestOfDateTimeRegex); + this.generalEndingRegex = recognizersText.RegExpUtility.getSafeRegExp(spanishDateTime.SpanishDateTime.GeneralEndingRegex); + this.middlePauseRegex = recognizersText.RegExpUtility.getSafeRegExp(spanishDateTime.SpanishDateTime.MiddlePauseRegex); + this.fromRegex = recognizersText.RegExpUtility.getSafeRegExp(spanishDateTime.SpanishDateTime.FromRegex); + this.connectorAndRegex = recognizersText.RegExpUtility.getSafeRegExp(spanishDateTime.SpanishDateTime.ConnectorAndRegex); + this.betweenRegex = recognizersText.RegExpUtility.getSafeRegExp(spanishDateTime.SpanishDateTime.BetweenRegex); + this.cardinalExtractor = new recognizersTextNumber.SpanishCardinalExtractor(); + this.singleDateExtractor = new baseDate.BaseDateExtractor(new dateConfiguration$2.SpanishDateExtractorConfiguration()); + this.singleTimeExtractor = new baseTime.BaseTimeExtractor(new timeConfiguration$2.SpanishTimeExtractorConfiguration()); + this.singleDateTimeExtractor = new baseDateTime$2.BaseDateTimeExtractor(new dateTimeConfiguration$2.SpanishDateTimeExtractorConfiguration()); + this.durationExtractor = new baseDuration.BaseDurationExtractor(new durationConfiguration$2.SpanishDurationExtractorConfiguration()); + this.timePeriodExtractor = new baseTimePeriod.BaseTimePeriodExtractor(new timePeriodConfiguration$2.SpanishTimePeriodExtractorConfiguration()); + } + getFromTokenIndex(source) { + return recognizersText.RegExpUtility.getFirstMatchIndex(this.fromRegex, source); + } + getBetweenTokenIndex(source) { + return recognizersText.RegExpUtility.getFirstMatchIndex(this.betweenRegex, source); + } + hasConnectorToken(source) { + return recognizersText.RegExpUtility.getFirstMatchIndex(this.connectorAndRegex, source).matched; + } +} +exports.SpanishDateTimePeriodExtractorConfiguration = SpanishDateTimePeriodExtractorConfiguration; +class SpanishDateTimePeriodParserConfiguration { + constructor(config) { + this.dateExtractor = config.dateExtractor; + this.timeExtractor = config.timeExtractor; + this.dateTimeExtractor = config.dateTimeExtractor; + this.timePeriodExtractor = config.timePeriodExtractor; + this.cardinalExtractor = config.cardinalExtractor; + this.durationExtractor = config.durationExtractor; + this.numberParser = config.numberParser; + this.dateParser = config.dateParser; + this.timeParser = config.timeParser; + this.dateTimeParser = config.dateTimeParser; + this.timePeriodParser = config.timePeriodParser; + this.durationParser = config.durationParser; + this.unitMap = config.unitMap; + this.numbers = config.numbers; + this.nextPrefixRegex = recognizersText.RegExpUtility.getSafeRegExp(spanishDateTime.SpanishDateTime.NextPrefixRegex); + this.pastPrefixRegex = recognizersText.RegExpUtility.getSafeRegExp(spanishDateTime.SpanishDateTime.PastPrefixRegex); + this.thisPrefixRegex = recognizersText.RegExpUtility.getSafeRegExp(spanishDateTime.SpanishDateTime.ThisPrefixRegex); + this.pureNumberFromToRegex = recognizersText.RegExpUtility.getSafeRegExp(spanishDateTime.SpanishDateTime.PureNumFromTo); + this.pureNumberBetweenAndRegex = recognizersText.RegExpUtility.getSafeRegExp(spanishDateTime.SpanishDateTime.PureNumBetweenAnd); + this.specificTimeOfDayRegex = recognizersText.RegExpUtility.getSafeRegExp(spanishDateTime.SpanishDateTime.SpecificTimeOfDayRegex); + this.timeOfDayRegex = recognizersText.RegExpUtility.getSafeRegExp(spanishDateTime.SpanishDateTime.TimeOfDayRegex); + this.pastRegex = recognizersText.RegExpUtility.getSafeRegExp(spanishDateTime.SpanishDateTime.PastRegex); + this.futureRegex = recognizersText.RegExpUtility.getSafeRegExp(spanishDateTime.SpanishDateTime.FutureRegex); + this.numberCombinedWithUnitRegex = recognizersText.RegExpUtility.getSafeRegExp(spanishDateTime.SpanishDateTime.DateTimePeriodNumberCombinedWithUnit); + this.unitRegex = recognizersText.RegExpUtility.getSafeRegExp(spanishDateTime.SpanishDateTime.UnitRegex); + this.periodTimeOfDayWithDateRegex = recognizersText.RegExpUtility.getSafeRegExp(spanishDateTime.SpanishDateTime.PeriodTimeOfDayWithDateRegex); + this.relativeTimeUnitRegex = recognizersText.RegExpUtility.getSafeRegExp(spanishDateTime.SpanishDateTime.RelativeTimeUnitRegex); + this.restOfDateTimeRegex = recognizersText.RegExpUtility.getSafeRegExp(spanishDateTime.SpanishDateTime.RestOfDateTimeRegex); + } + getMatchedTimeRange(source) { + let trimedText = source.trim().toLowerCase(); + let timeStr = ""; + let beginHour = 0; + let endHour = 0; + let endMin = 0; + if (trimedText.endsWith("madrugada")) { + timeStr = "TDA"; + beginHour = 4; + endHour = 8; + } + else if (trimedText.endsWith("mañana")) { + timeStr = "TMO"; + beginHour = 8; + endHour = 12; + } + else if (trimedText.includes("pasado mediodia") || trimedText.includes("pasado el mediodia")) { + timeStr = "TAF"; + beginHour = 12; + endHour = 16; + } + else if (trimedText.endsWith("tarde")) { + timeStr = "TEV"; + beginHour = 16; + endHour = 20; + } + else if (trimedText.endsWith("noche")) { + timeStr = "TNI"; + beginHour = 20; + endHour = 23; + endMin = 59; + } + else { + timeStr = null; + return { + success: false, + timeStr, + beginHour, + endHour, + endMin + }; + } + return { + success: true, + timeStr, + beginHour, + endHour, + endMin + }; + } + getSwiftPrefix(source) { + let trimedText = source.trim().toLowerCase(); + let swift = 0; + // TODO: Replace with a regex + if (recognizersText.RegExpUtility.getFirstMatchIndex(this.pastPrefixRegex, trimedText).matched || + trimedText === "anoche") { + swift = -1; + } + else if (recognizersText.RegExpUtility.getFirstMatchIndex(this.nextPrefixRegex, trimedText).matched) { + swift = 1; + } + return swift; + } +} +exports.SpanishDateTimePeriodParserConfiguration = SpanishDateTimePeriodParserConfiguration; + +}); + +unwrapExports(dateTimePeriodConfiguration$2); + +var baseConfiguration$2 = createCommonjsModule(function (module, exports) { +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); + + + + + + + + + + + + + + + + + + +class SpanishDateTimeUtilityConfiguration { + constructor() { + this.laterRegex = recognizersText.RegExpUtility.getSafeRegExp(spanishDateTime.SpanishDateTime.LaterRegex); + this.agoRegex = recognizersText.RegExpUtility.getSafeRegExp(spanishDateTime.SpanishDateTime.AgoRegex); + this.inConnectorRegex = recognizersText.RegExpUtility.getSafeRegExp(spanishDateTime.SpanishDateTime.InConnectorRegex); + this.rangeUnitRegex = recognizersText.RegExpUtility.getSafeRegExp(spanishDateTime.SpanishDateTime.RangeUnitRegex); + this.amDescRegex = recognizersText.RegExpUtility.getSafeRegExp(spanishDateTime.SpanishDateTime.AmDescRegex); + this.pmDescRegex = recognizersText.RegExpUtility.getSafeRegExp(spanishDateTime.SpanishDateTime.PmDescRegex); + this.amPmDescRegex = recognizersText.RegExpUtility.getSafeRegExp(spanishDateTime.SpanishDateTime.AmPmDescRegex); + } +} +exports.SpanishDateTimeUtilityConfiguration = SpanishDateTimeUtilityConfiguration; +class SpanishCommonDateTimeParserConfiguration extends parsers$4.BaseDateParserConfiguration { + constructor() { + super(); + this.utilityConfiguration = new SpanishDateTimeUtilityConfiguration(); + this.unitMap = spanishDateTime.SpanishDateTime.UnitMap; + this.unitValueMap = spanishDateTime.SpanishDateTime.UnitValueMap; + this.seasonMap = spanishDateTime.SpanishDateTime.SeasonMap; + this.cardinalMap = spanishDateTime.SpanishDateTime.CardinalMap; + this.dayOfWeek = spanishDateTime.SpanishDateTime.DayOfWeek; + this.monthOfYear = spanishDateTime.SpanishDateTime.MonthOfYear; + this.numbers = spanishDateTime.SpanishDateTime.Numbers; + this.doubleNumbers = spanishDateTime.SpanishDateTime.DoubleNumbers; + this.cardinalExtractor = new recognizersTextNumber.SpanishCardinalExtractor(); + this.integerExtractor = new recognizersTextNumber.SpanishIntegerExtractor(); + this.ordinalExtractor = new recognizersTextNumber.SpanishOrdinalExtractor(); + this.numberParser = new recognizersTextNumber.BaseNumberParser(new recognizersTextNumber.SpanishNumberParserConfiguration()); + this.dateExtractor = new baseDate.BaseDateExtractor(new dateConfiguration$2.SpanishDateExtractorConfiguration()); + this.timeExtractor = new baseTime.BaseTimeExtractor(new timeConfiguration$2.SpanishTimeExtractorConfiguration()); + this.dateTimeExtractor = new baseDateTime$2.BaseDateTimeExtractor(new dateTimeConfiguration$2.SpanishDateTimeExtractorConfiguration()); + this.durationExtractor = new baseDuration.BaseDurationExtractor(new durationConfiguration$2.SpanishDurationExtractorConfiguration()); + this.datePeriodExtractor = new baseDatePeriod.BaseDatePeriodExtractor(new datePeriodConfiguration$2.SpanishDatePeriodExtractorConfiguration()); + this.timePeriodExtractor = new baseTimePeriod.BaseTimePeriodExtractor(new timePeriodConfiguration$2.SpanishTimePeriodExtractorConfiguration()); + this.dateTimePeriodExtractor = new baseDateTimePeriod.BaseDateTimePeriodExtractor(new dateTimePeriodConfiguration$2.SpanishDateTimePeriodExtractorConfiguration()); + this.durationParser = new baseDuration.BaseDurationParser(new durationConfiguration$2.SpanishDurationParserConfiguration(this)); + this.dateParser = new baseDate.BaseDateParser(new dateConfiguration$2.SpanishDateParserConfiguration(this)); + this.timeParser = new baseTime.BaseTimeParser(new timeConfiguration$2.SpanishTimeParserConfiguration(this)); + this.dateTimeParser = new baseDateTime$2.BaseDateTimeParser(new dateTimeConfiguration$2.SpanishDateTimeParserConfiguration(this)); + this.datePeriodParser = new baseDatePeriod.BaseDatePeriodParser(new datePeriodConfiguration$2.SpanishDatePeriodParserConfiguration(this)); + this.timePeriodParser = new baseTimePeriod.BaseTimePeriodParser(new timePeriodConfiguration$2.SpanishTimePeriodParserConfiguration(this)); + this.dateTimePeriodParser = new baseDateTimePeriod.BaseDateTimePeriodParser(new dateTimePeriodConfiguration$2.SpanishDateTimePeriodParserConfiguration(this)); + } +} +exports.SpanishCommonDateTimeParserConfiguration = SpanishCommonDateTimeParserConfiguration; + +}); + +unwrapExports(baseConfiguration$2); + +var dateConfiguration$2 = createCommonjsModule(function (module, exports) { +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); + + + + + + + +class SpanishDateExtractorConfiguration { + constructor() { + this.dateRegexList = [ + recognizersText.RegExpUtility.getSafeRegExp(spanishDateTime.SpanishDateTime.DateExtractor1, "gis"), + recognizersText.RegExpUtility.getSafeRegExp(spanishDateTime.SpanishDateTime.DateExtractor2, "gis"), + recognizersText.RegExpUtility.getSafeRegExp(spanishDateTime.SpanishDateTime.DateExtractor3, "gis"), + spanishDateTime.SpanishDateTime.DefaultLanguageFallback === constants$2.Constants.DefaultLanguageFallback_DMY ? + recognizersText.RegExpUtility.getSafeRegExp(spanishDateTime.SpanishDateTime.DateExtractor5, "gis") : + recognizersText.RegExpUtility.getSafeRegExp(spanishDateTime.SpanishDateTime.DateExtractor4, "gis"), + spanishDateTime.SpanishDateTime.DefaultLanguageFallback === constants$2.Constants.DefaultLanguageFallback_DMY ? + recognizersText.RegExpUtility.getSafeRegExp(spanishDateTime.SpanishDateTime.DateExtractor4, "gis") : + recognizersText.RegExpUtility.getSafeRegExp(spanishDateTime.SpanishDateTime.DateExtractor5, "gis"), + spanishDateTime.SpanishDateTime.DefaultLanguageFallback === constants$2.Constants.DefaultLanguageFallback_DMY ? + recognizersText.RegExpUtility.getSafeRegExp(spanishDateTime.SpanishDateTime.DateExtractor8, "gis") : + recognizersText.RegExpUtility.getSafeRegExp(spanishDateTime.SpanishDateTime.DateExtractor6, "gis"), + spanishDateTime.SpanishDateTime.DefaultLanguageFallback === constants$2.Constants.DefaultLanguageFallback_DMY ? + recognizersText.RegExpUtility.getSafeRegExp(spanishDateTime.SpanishDateTime.DateExtractor6, "gis") : + recognizersText.RegExpUtility.getSafeRegExp(spanishDateTime.SpanishDateTime.DateExtractor8, "gis"), + spanishDateTime.SpanishDateTime.DefaultLanguageFallback === constants$2.Constants.DefaultLanguageFallback_DMY ? + recognizersText.RegExpUtility.getSafeRegExp(spanishDateTime.SpanishDateTime.DateExtractor9, "gis") : + recognizersText.RegExpUtility.getSafeRegExp(spanishDateTime.SpanishDateTime.DateExtractor7, "gis"), + spanishDateTime.SpanishDateTime.DefaultLanguageFallback === constants$2.Constants.DefaultLanguageFallback_DMY ? + recognizersText.RegExpUtility.getSafeRegExp(spanishDateTime.SpanishDateTime.DateExtractor7, "gis") : + recognizersText.RegExpUtility.getSafeRegExp(spanishDateTime.SpanishDateTime.DateExtractor9, "gis"), + recognizersText.RegExpUtility.getSafeRegExp(spanishDateTime.SpanishDateTime.DateExtractor10, "gis"), + ]; + this.implicitDateList = [ + recognizersText.RegExpUtility.getSafeRegExp(spanishDateTime.SpanishDateTime.OnRegex, "gis"), + recognizersText.RegExpUtility.getSafeRegExp(spanishDateTime.SpanishDateTime.RelaxedOnRegex, "gis"), + recognizersText.RegExpUtility.getSafeRegExp(spanishDateTime.SpanishDateTime.SpecialDayRegex, "gis"), + recognizersText.RegExpUtility.getSafeRegExp(spanishDateTime.SpanishDateTime.ThisRegex, "gis"), + recognizersText.RegExpUtility.getSafeRegExp(spanishDateTime.SpanishDateTime.LastDateRegex, "gis"), + recognizersText.RegExpUtility.getSafeRegExp(spanishDateTime.SpanishDateTime.NextDateRegex, "gis"), + recognizersText.RegExpUtility.getSafeRegExp(spanishDateTime.SpanishDateTime.WeekDayRegex, "gis"), + recognizersText.RegExpUtility.getSafeRegExp(spanishDateTime.SpanishDateTime.WeekDayOfMonthRegex, "gis"), + recognizersText.RegExpUtility.getSafeRegExp(spanishDateTime.SpanishDateTime.SpecialDateRegex, "gis") + ]; + this.monthEnd = recognizersText.RegExpUtility.getSafeRegExp(spanishDateTime.SpanishDateTime.MonthEndRegex, "gis"); + this.ofMonth = recognizersText.RegExpUtility.getSafeRegExp(spanishDateTime.SpanishDateTime.OfMonthRegex, "gis"); + this.dateUnitRegex = recognizersText.RegExpUtility.getSafeRegExp(spanishDateTime.SpanishDateTime.DateUnitRegex, "gis"); + this.forTheRegex = recognizersText.RegExpUtility.getSafeRegExp(spanishDateTime.SpanishDateTime.ForTheRegex, "gis"); + this.weekDayAndDayOfMonthRegex = recognizersText.RegExpUtility.getSafeRegExp(spanishDateTime.SpanishDateTime.WeekDayAndDayOfMonthRegex, "gis"); + this.relativeMonthRegex = recognizersText.RegExpUtility.getSafeRegExp(spanishDateTime.SpanishDateTime.RelativeMonthRegex, "gis"); + this.weekDayRegex = recognizersText.RegExpUtility.getSafeRegExp(spanishDateTime.SpanishDateTime.WeekDayRegex, "gis"); + this.dayOfWeek = spanishDateTime.SpanishDateTime.DayOfWeek; + this.ordinalExtractor = new recognizersTextNumber.SpanishOrdinalExtractor(); + this.integerExtractor = new recognizersTextNumber.SpanishIntegerExtractor(); + this.numberParser = new recognizersTextNumber.BaseNumberParser(new recognizersTextNumber.SpanishNumberParserConfiguration()); + this.durationExtractor = new baseDuration.BaseDurationExtractor(new durationConfiguration$2.SpanishDurationExtractorConfiguration()); + this.utilityConfiguration = new baseConfiguration$2.SpanishDateTimeUtilityConfiguration(); + } +} +exports.SpanishDateExtractorConfiguration = SpanishDateExtractorConfiguration; +class SpanishDateParserConfiguration { + constructor(config) { + this.ordinalExtractor = config.ordinalExtractor; + this.integerExtractor = config.integerExtractor; + this.cardinalExtractor = config.cardinalExtractor; + this.durationExtractor = config.durationExtractor; + this.numberParser = config.numberParser; + this.durationParser = config.durationParser; + this.monthOfYear = config.monthOfYear; + this.dayOfMonth = config.dayOfMonth; + this.dayOfWeek = config.dayOfWeek; + this.unitMap = config.unitMap; + this.cardinalMap = config.cardinalMap; + this.dateRegex = new SpanishDateExtractorConfiguration().dateRegexList; + this.onRegex = recognizersText.RegExpUtility.getSafeRegExp(spanishDateTime.SpanishDateTime.OnRegex, "gis"); + this.specialDayRegex = recognizersText.RegExpUtility.getSafeRegExp(spanishDateTime.SpanishDateTime.SpecialDayRegex, "gis"); + this.specialDayWithNumRegex = recognizersText.RegExpUtility.getSafeRegExp(spanishDateTime.SpanishDateTime.SpecialDayWithNumRegex, "gis"); + this.nextRegex = recognizersText.RegExpUtility.getSafeRegExp(spanishDateTime.SpanishDateTime.NextDateRegex, "gis"); + this.unitRegex = recognizersText.RegExpUtility.getSafeRegExp(spanishDateTime.SpanishDateTime.DateUnitRegex, "gis"); + this.monthRegex = recognizersText.RegExpUtility.getSafeRegExp(spanishDateTime.SpanishDateTime.MonthRegex, "gis"); + this.weekDayRegex = recognizersText.RegExpUtility.getSafeRegExp(spanishDateTime.SpanishDateTime.WeekDayRegex, "gis"); + this.lastRegex = recognizersText.RegExpUtility.getSafeRegExp(spanishDateTime.SpanishDateTime.LastDateRegex, "gis"); + this.thisRegex = recognizersText.RegExpUtility.getSafeRegExp(spanishDateTime.SpanishDateTime.ThisRegex, "gis"); + this.weekDayOfMonthRegex = recognizersText.RegExpUtility.getSafeRegExp(spanishDateTime.SpanishDateTime.WeekDayOfMonthRegex, "gis"); + this.forTheRegex = recognizersText.RegExpUtility.getSafeRegExp(spanishDateTime.SpanishDateTime.ForTheRegex, "gis"); + this.weekDayAndDayOfMonthRegex = recognizersText.RegExpUtility.getSafeRegExp(spanishDateTime.SpanishDateTime.WeekDayAndDayOfMonthRegex, "gis"); + this.relativeMonthRegex = recognizersText.RegExpUtility.getSafeRegExp(spanishDateTime.SpanishDateTime.RelativeMonthRegex, "gis"); + this.relativeWeekDayRegex = recognizersText.RegExpUtility.getSafeRegExp(spanishDateTime.SpanishDateTime.RelativeWeekDayRegex, "gis"); + this.utilityConfiguration = config.utilityConfiguration; + this.dateTokenPrefix = spanishDateTime.SpanishDateTime.DateTokenPrefix; + } + getSwiftDay(source) { + let trimedText = SpanishDateParserConfiguration.normalize(source.trim().toLowerCase()); + let swift = 0; + // TODO: add the relative day logic if needed. If yes, the whole method should be abstracted. + if (trimedText === "hoy" || trimedText === "el dia") { + swift = 0; + } + else if (trimedText === "mañana" || + trimedText.endsWith("dia siguiente") || + trimedText.endsWith("el dia de mañana") || + trimedText.endsWith("proximo dia")) { + swift = 1; + } + else if (trimedText === "ayer") { + swift = -1; + } + else if (trimedText.endsWith("pasado mañana") || + trimedText.endsWith("dia despues de mañana")) { + swift = 2; + } + else if (trimedText.endsWith("anteayer") || + trimedText.endsWith("dia antes de ayer")) { + swift = -2; + } + else if (trimedText.endsWith("ultimo dia")) { + swift = -1; + } + return swift; + } + getSwiftMonth(source) { + let trimedText = source.trim().toLowerCase(); + let swift = 0; + if (recognizersText.RegExpUtility.getMatches(SpanishDateParserConfiguration.nextPrefixRegex, trimedText).length) { + swift = 1; + } + if (recognizersText.RegExpUtility.getMatches(SpanishDateParserConfiguration.pastPrefixRegex, trimedText).length) { + swift = -1; + } + return swift; + } + isCardinalLast(source) { + let trimedText = source.trim().toLowerCase(); + return recognizersText.RegExpUtility.getMatches(SpanishDateParserConfiguration.pastPrefixRegex, trimedText).length > 0; + } + static normalize(source) { + return source + .replace(/á/g, "a") + .replace(/é/g, "e") + .replace(/í/g, "i") + .replace(/ó/g, "o") + .replace(/ú/g, "u"); + } +} +// TODO: implement the relative day regex if needed. If yes, they should be abstracted +SpanishDateParserConfiguration.relativeDayRegex = recognizersText.RegExpUtility.getSafeRegExp(spanishDateTime.SpanishDateTime.RelativeDayRegex); +SpanishDateParserConfiguration.nextPrefixRegex = recognizersText.RegExpUtility.getSafeRegExp(spanishDateTime.SpanishDateTime.NextPrefixRegex); +SpanishDateParserConfiguration.pastPrefixRegex = recognizersText.RegExpUtility.getSafeRegExp(spanishDateTime.SpanishDateTime.PastPrefixRegex); +exports.SpanishDateParserConfiguration = SpanishDateParserConfiguration; + +}); + +unwrapExports(dateConfiguration$2); + +var holidayConfiguration$2 = createCommonjsModule(function (module, exports) { +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); + + + + +class SpanishHolidayExtractorConfiguration { + constructor() { + this.holidayRegexes = [ + recognizersText.RegExpUtility.getSafeRegExp(spanishDateTime.SpanishDateTime.HolidayRegex1, "gis"), + recognizersText.RegExpUtility.getSafeRegExp(spanishDateTime.SpanishDateTime.HolidayRegex2, "gis"), + recognizersText.RegExpUtility.getSafeRegExp(spanishDateTime.SpanishDateTime.HolidayRegex3, "gis") + ]; + } +} +exports.SpanishHolidayExtractorConfiguration = SpanishHolidayExtractorConfiguration; +class SpanishHolidayParserConfiguration extends baseHoliday.BaseHolidayParserConfiguration { + constructor() { + super(); + this.holidayRegexList = [ + recognizersText.RegExpUtility.getSafeRegExp(spanishDateTime.SpanishDateTime.HolidayRegex1, "gis"), + recognizersText.RegExpUtility.getSafeRegExp(spanishDateTime.SpanishDateTime.HolidayRegex2, "gis"), + recognizersText.RegExpUtility.getSafeRegExp(spanishDateTime.SpanishDateTime.HolidayRegex3, "gis") + ]; + this.holidayNames = spanishDateTime.SpanishDateTime.HolidayNames; + this.holidayFuncDictionary = this.initHolidayFuncs(); + this.variableHolidaysTimexDictionary = spanishDateTime.SpanishDateTime.VariableHolidaysTimexDictionary; + this.nextPrefixRegex = recognizersText.RegExpUtility.getSafeRegExp(spanishDateTime.SpanishDateTime.NextPrefixRegex); + this.pastPrefixRegex = recognizersText.RegExpUtility.getSafeRegExp(spanishDateTime.SpanishDateTime.PastPrefixRegex); + this.thisPrefixRegex = recognizersText.RegExpUtility.getSafeRegExp(spanishDateTime.SpanishDateTime.ThisPrefixRegex); + } + initHolidayFuncs() { + return new Map([ + ...super.initHolidayFuncs(), + ["padres", SpanishHolidayParserConfiguration.FathersDay], + ["madres", SpanishHolidayParserConfiguration.MothersDay], + ["acciondegracias", SpanishHolidayParserConfiguration.ThanksgivingDay], + ["trabajador", SpanishHolidayParserConfiguration.LabourDay], + ["delaraza", SpanishHolidayParserConfiguration.ColumbusDay], + ["memoria", SpanishHolidayParserConfiguration.MemorialDay], + ["pascuas", SpanishHolidayParserConfiguration.EasterDay], + ["navidad", SpanishHolidayParserConfiguration.ChristmasDay], + ["nochebuena", SpanishHolidayParserConfiguration.ChristmasEve], + ["añonuevo", SpanishHolidayParserConfiguration.NewYear], + ["nochevieja", SpanishHolidayParserConfiguration.NewYearEve], + ["yuandan", SpanishHolidayParserConfiguration.NewYear], + ["maestro", SpanishHolidayParserConfiguration.TeacherDay], + ["todoslossantos", SpanishHolidayParserConfiguration.HalloweenDay], + ["niño", SpanishHolidayParserConfiguration.ChildrenDay], + ["mujer", SpanishHolidayParserConfiguration.FemaleDay] + ]); + } + // All JavaScript dates are zero-based (-1) + static NewYear(year) { return new Date(year, 1 - 1, 1); } + static NewYearEve(year) { return new Date(year, 12 - 1, 31); } + static ChristmasDay(year) { return new Date(year, 12 - 1, 25); } + static ChristmasEve(year) { return new Date(year, 12 - 1, 24); } + static FemaleDay(year) { return new Date(year, 3 - 1, 8); } + static ChildrenDay(year) { return new Date(year, 6 - 1, 1); } + static HalloweenDay(year) { return new Date(year, 10 - 1, 31); } + static TeacherDay(year) { return new Date(year, 9 - 1, 11); } + static EasterDay(year) { return utilities$2.DateUtils.minValue(); } + getSwiftYear(text) { + let trimedText = text.trim().toLowerCase(); + let swift = -10; + if (recognizersText.RegExpUtility.getFirstMatchIndex(this.nextPrefixRegex, trimedText).matched) { + swift = 1; + } + if (recognizersText.RegExpUtility.getFirstMatchIndex(this.pastPrefixRegex, trimedText).matched) { + swift = -1; + } + else if (recognizersText.RegExpUtility.getFirstMatchIndex(this.thisPrefixRegex, trimedText).matched) { + swift = 0; + } + return swift; + } + sanitizeHolidayToken(holiday) { + return holiday.replace(/ /g, "") + .replace(/á/g, "a") + .replace(/é/g, "e") + .replace(/í/g, "i") + .replace(/ó/g, "o") + .replace(/ú/g, "u"); + } +} +exports.SpanishHolidayParserConfiguration = SpanishHolidayParserConfiguration; + +}); + +unwrapExports(holidayConfiguration$2); + +var setConfiguration$2 = createCommonjsModule(function (module, exports) { +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); + + + + + + + + + + + + + + + + +class SpanishSetExtractorConfiguration { + constructor() { + this.lastRegex = recognizersText.RegExpUtility.getSafeRegExp(spanishDateTime.SpanishDateTime.LastDateRegex, "gis"); + this.periodicRegex = recognizersText.RegExpUtility.getSafeRegExp(spanishDateTime.SpanishDateTime.PeriodicRegex, "gis"); + this.eachUnitRegex = recognizersText.RegExpUtility.getSafeRegExp(spanishDateTime.SpanishDateTime.EachUnitRegex, "gis"); + this.eachPrefixRegex = recognizersText.RegExpUtility.getSafeRegExp(spanishDateTime.SpanishDateTime.EachPrefixRegex, "gis"); + this.eachDayRegex = recognizersText.RegExpUtility.getSafeRegExp(spanishDateTime.SpanishDateTime.EachDayRegex, "gis"); + this.beforeEachDayRegex = recognizersText.RegExpUtility.getSafeRegExp(spanishDateTime.SpanishDateTime.BeforeEachDayRegex, "gis"); + this.setEachRegex = recognizersText.RegExpUtility.getSafeRegExp(spanishDateTime.SpanishDateTime.SetEachRegex, "gis"); + this.setWeekDayRegex = recognizersText.RegExpUtility.getSafeRegExp(spanishDateTime.SpanishDateTime.SetWeekDayRegex, "gis"); + this.durationExtractor = new baseDuration.BaseDurationExtractor(new durationConfiguration$2.SpanishDurationExtractorConfiguration()); + this.timeExtractor = new baseTime.BaseTimeExtractor(new timeConfiguration$2.SpanishTimeExtractorConfiguration()); + this.dateExtractor = new baseDate.BaseDateExtractor(new dateConfiguration$2.SpanishDateExtractorConfiguration()); + this.dateTimeExtractor = new baseDateTime$2.BaseDateTimeExtractor(new dateTimeConfiguration$2.SpanishDateTimeExtractorConfiguration()); + this.datePeriodExtractor = new baseDatePeriod.BaseDatePeriodExtractor(new datePeriodConfiguration$2.SpanishDatePeriodExtractorConfiguration()); + this.timePeriodExtractor = new baseTimePeriod.BaseTimePeriodExtractor(new timePeriodConfiguration$2.SpanishTimePeriodExtractorConfiguration()); + this.dateTimePeriodExtractor = new baseDateTimePeriod.BaseDateTimePeriodExtractor(new dateTimePeriodConfiguration$2.SpanishDateTimePeriodExtractorConfiguration()); + } +} +exports.SpanishSetExtractorConfiguration = SpanishSetExtractorConfiguration; +class SpanishSetParserConfiguration { + constructor(config) { + this.durationExtractor = config.durationExtractor; + this.timeExtractor = config.timeExtractor; + this.dateExtractor = config.dateExtractor; + this.dateTimeExtractor = config.dateTimeExtractor; + this.datePeriodExtractor = config.datePeriodExtractor; + this.timePeriodExtractor = config.timePeriodExtractor; + this.dateTimePeriodExtractor = config.dateTimePeriodExtractor; + this.durationParser = config.durationParser; + this.timeParser = config.timeParser; + this.dateParser = config.dateParser; + this.dateTimeParser = config.dateTimeParser; + this.datePeriodParser = config.datePeriodParser; + this.timePeriodParser = config.timePeriodParser; + this.dateTimePeriodParser = config.dateTimePeriodParser; + this.unitMap = config.unitMap; + this.eachPrefixRegex = recognizersText.RegExpUtility.getSafeRegExp(spanishDateTime.SpanishDateTime.EachPrefixRegex, "gis"); + this.periodicRegex = recognizersText.RegExpUtility.getSafeRegExp(spanishDateTime.SpanishDateTime.PeriodicRegex, "gis"); + this.eachUnitRegex = recognizersText.RegExpUtility.getSafeRegExp(spanishDateTime.SpanishDateTime.EachUnitRegex, "gis"); + this.eachDayRegex = recognizersText.RegExpUtility.getSafeRegExp(spanishDateTime.SpanishDateTime.EachDayRegex, "gis"); + this.setWeekDayRegex = recognizersText.RegExpUtility.getSafeRegExp(spanishDateTime.SpanishDateTime.SetWeekDayRegex, "gis"); + this.setEachRegex = recognizersText.RegExpUtility.getSafeRegExp(spanishDateTime.SpanishDateTime.SetEachRegex, "gis"); + } + getMatchedDailyTimex(text) { + let trimedText = text.trim().toLowerCase(); + let timex = ""; + if (trimedText.endsWith("diario") || trimedText.endsWith("diariamente")) { + timex = "P1D"; + } + else if (trimedText === "semanalmente") { + timex = "P1W"; + } + else if (trimedText === "quincenalmente") { + timex = "P2W"; + } + else if (trimedText === "mensualmente") { + timex = "P1M"; + } + else if (trimedText === "anualmente") { + timex = "P1Y"; + } + else { + timex = null; + return { + timex, + matched: false + }; + } + return { + timex, + matched: true + }; + } + getMatchedUnitTimex(text) { + let trimedText = text.trim().toLowerCase(); + let timex = ""; + if (trimedText === "día" || trimedText === "dia" || + trimedText === "días" || trimedText === "dias") { + timex = "P1D"; + } + else if (trimedText === "semana" || trimedText === "semanas") { + timex = "P1W"; + } + else if (trimedText === "mes" || trimedText === "meses") { + timex = "P1M"; + } + else if (trimedText === "año" || trimedText === "años") { + timex = "P1Y"; + } + else { + timex = null; + return { + matched: false, + timex + }; + } + return { + matched: true, + timex + }; + } +} +exports.SpanishSetParserConfiguration = SpanishSetParserConfiguration; + +}); + +unwrapExports(setConfiguration$2); + +var dateTimePeriodParser = createCommonjsModule(function (module, exports) { +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); + + + + +class SpanishDateTimePeriodParser extends baseDateTimePeriod.BaseDateTimePeriodParser { + constructor(config) { + super(config); + } + parseSpecificTimeOfDay(source, referenceDate) { + let ret = new utilities$2.DateTimeResolutionResult(); + let trimedText = source.trim().toLowerCase(); + // handle morning, afternoon.. + let match = this.config.getMatchedTimeRange(trimedText); + let beginHour = match.beginHour; + let endHour = match.endHour; + let endMin = match.endMin; + let timeStr = match.timeStr; + if (!match.success) { + return ret; + } + let matches = recognizersText.RegExpUtility.getMatches(this.config.specificTimeOfDayRegex, trimedText); + if (matches.length && matches[0].index === 0 && matches[0].length === trimedText.length) { + let swift = this.config.getSwiftPrefix(trimedText); + let date = utilities$2.DateUtils.addDays(referenceDate, swift); + date.setHours(0, 0, 0, 0); + let day = date.getDate(); + let month = date.getMonth(); + let year = date.getFullYear(); + + ret.timex = utilities$2.FormatUtil.formatDate(date) + timeStr; + ret.pastValue = ret.futureValue = [ + utilities$2.DateUtils.safeCreateFromValue(utilities$2.DateUtils.minValue(), year, month, day, beginHour, 0, 0), + utilities$2.DateUtils.safeCreateFromValue(utilities$2.DateUtils.minValue(), year, month, day, endHour, endMin, endMin), + ]; + ret.success = true; + return ret; + } + let startIndex = trimedText.indexOf(spanishDateTime.SpanishDateTime.Tomorrow) === 0 ? spanishDateTime.SpanishDateTime.Tomorrow.length : 0; + // handle Date followed by morning, afternoon + // Add handling code to handle morning, afternoon followed by Date + // Add handling code to handle early/late morning, afternoon + // TODO: use regex from config: match = this.config.TimeOfDayRegex.Match(trimedText.Substring(startIndex)); + matches = recognizersText.RegExpUtility.getMatches(recognizersText.RegExpUtility.getSafeRegExp(spanishDateTime.SpanishDateTime.TimeOfDayRegex), trimedText.substring(startIndex)); + if (matches.length) { + let match = matches[0]; + let beforeStr = trimedText.substring(0, match.index + startIndex).trim(); + let ers = this.config.dateExtractor.extract(beforeStr, referenceDate); + if (ers.length === 0) { + return ret; + } + let pr = this.config.dateParser.parse(ers[0], referenceDate); + let futureDate = pr.value.futureValue; + let pastDate = pr.value.pastValue; + ret.timex = pr.timexStr + timeStr; + ret.futureValue = [ + utilities$2.DateUtils.safeCreateFromValue(utilities$2.DateUtils.minValue(), futureDate.getFullYear(), futureDate.getMonth(), futureDate.getDate(), beginHour, 0, 0), + utilities$2.DateUtils.safeCreateFromValue(utilities$2.DateUtils.minValue(), futureDate.getFullYear(), futureDate.getMonth(), futureDate.getDate(), endHour, endMin, endMin) + ]; + ret.pastValue = [ + utilities$2.DateUtils.safeCreateFromValue(utilities$2.DateUtils.minValue(), pastDate.getFullYear(), pastDate.getMonth(), pastDate.getDate(), beginHour, 0, 0), + utilities$2.DateUtils.safeCreateFromValue(utilities$2.DateUtils.minValue(), pastDate.getFullYear(), pastDate.getMonth(), pastDate.getDate(), endHour, endMin, endMin) + ]; + ret.success = true; + return ret; + } + return ret; + } +} +exports.SpanishDateTimePeriodParser = SpanishDateTimePeriodParser; + +}); + +unwrapExports(dateTimePeriodParser); + +var mergedConfiguration$2 = createCommonjsModule(function (module, exports) { +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); + + + + + + + + + + + + + + + + + + + + + + + +class SpanishMergedExtractorConfiguration { + constructor() { + this.beforeRegex = recognizersText.RegExpUtility.getSafeRegExp(spanishDateTime.SpanishDateTime.BeforeRegex); + this.afterRegex = recognizersText.RegExpUtility.getSafeRegExp(spanishDateTime.SpanishDateTime.AfterRegex); + this.sinceRegex = recognizersText.RegExpUtility.getSafeRegExp(spanishDateTime.SpanishDateTime.SinceRegex); + this.fromToRegex = recognizersText.RegExpUtility.getSafeRegExp(spanishDateTime.SpanishDateTime.FromToRegex); + this.singleAmbiguousMonthRegex = recognizersText.RegExpUtility.getSafeRegExp(spanishDateTime.SpanishDateTime.SingleAmbiguousMonthRegex); + this.prepositionSuffixRegex = recognizersText.RegExpUtility.getSafeRegExp(spanishDateTime.SpanishDateTime.PrepositionSuffixRegex); + this.numberEndingPattern = recognizersText.RegExpUtility.getSafeRegExp(spanishDateTime.SpanishDateTime.NumberEndingPattern); + this.dateExtractor = new baseDate.BaseDateExtractor(new dateConfiguration$2.SpanishDateExtractorConfiguration()); + this.timeExtractor = new baseTime.BaseTimeExtractor(new timeConfiguration$2.SpanishTimeExtractorConfiguration()); + this.dateTimeExtractor = new baseDateTime$2.BaseDateTimeExtractor(new dateTimeConfiguration$2.SpanishDateTimeExtractorConfiguration()); + this.datePeriodExtractor = new baseDatePeriod.BaseDatePeriodExtractor(new datePeriodConfiguration$2.SpanishDatePeriodExtractorConfiguration()); + this.timePeriodExtractor = new baseTimePeriod.BaseTimePeriodExtractor(new timePeriodConfiguration$2.SpanishTimePeriodExtractorConfiguration()); + this.dateTimePeriodExtractor = new baseDateTimePeriod.BaseDateTimePeriodExtractor(new dateTimePeriodConfiguration$2.SpanishDateTimePeriodExtractorConfiguration()); + this.durationExtractor = new baseDuration.BaseDurationExtractor(new durationConfiguration$2.SpanishDurationExtractorConfiguration()); + this.setExtractor = new baseSet.BaseSetExtractor(new setConfiguration$2.SpanishSetExtractorConfiguration()); + this.holidayExtractor = new baseHoliday.BaseHolidayExtractor(new holidayConfiguration$2.SpanishHolidayExtractorConfiguration()); + this.integerExtractor = new recognizersTextNumber.SpanishIntegerExtractor(); + this.filterWordRegexList = []; + } +} +exports.SpanishMergedExtractorConfiguration = SpanishMergedExtractorConfiguration; +class SpanishMergedParserConfiguration extends baseConfiguration$2.SpanishCommonDateTimeParserConfiguration { + constructor() { + super(); + this.beforeRegex = recognizersText.RegExpUtility.getSafeRegExp(spanishDateTime.SpanishDateTime.BeforeRegex); + this.afterRegex = recognizersText.RegExpUtility.getSafeRegExp(spanishDateTime.SpanishDateTime.AfterRegex); + this.sinceRegex = recognizersText.RegExpUtility.getSafeRegExp(spanishDateTime.SpanishDateTime.SinceRegex); + this.datePeriodParser = new baseDatePeriod.BaseDatePeriodParser(new datePeriodConfiguration$2.SpanishDatePeriodParserConfiguration(this)); + this.timePeriodParser = new baseTimePeriod.BaseTimePeriodParser(new timePeriodConfiguration$2.SpanishTimePeriodParserConfiguration(this)); + this.dateTimePeriodParser = new dateTimePeriodParser.SpanishDateTimePeriodParser(new dateTimePeriodConfiguration$2.SpanishDateTimePeriodParserConfiguration(this)); + this.setParser = new baseSet.BaseSetParser(new setConfiguration$2.SpanishSetParserConfiguration(this)); + this.holidayParser = new baseHoliday.BaseHolidayParser(new holidayConfiguration$2.SpanishHolidayParserConfiguration()); + } +} +exports.SpanishMergedParserConfiguration = SpanishMergedParserConfiguration; + +}); + +unwrapExports(mergedConfiguration$2); + +var frenchDateTime = createCommonjsModule(function (module, exports) { +"use strict"; +// ------------------------------------------------------------------------------ +// +// This code was generated by a tool. +// Changes to this file may cause incorrect behavior and will be lost if +// the code is regenerated. +// +// ------------------------------------------------------------------------------ +Object.defineProperty(exports, "__esModule", { value: true }); + +var FrenchDateTime; +(function (FrenchDateTime) { + FrenchDateTime.TillRegex = `(?au|[aà]|et|jusqu'[aà]|avant|--|-|—|——)`; + FrenchDateTime.RangeConnectorRegex = `(?et|de la|au|[aà]|et\\s*la|--|-|—|——)`; + FrenchDateTime.RelativeRegex = `(?prochain|prochaine|de|du|ce|cette|l[ae]|derni[eè]re|pr[eé]c[eé]dente|au\\s+cours+(de|du\\s*))`; + FrenchDateTime.NextSuffixRegex = `(?prochain|prochaine|prochaines|suivante)\\b`; + FrenchDateTime.PastSuffixRegex = `(?dernier|derni[eè]re|pr[eé]c[eé]dente)\\b`; + FrenchDateTime.ThisPrefixRegex = `(?ce|cette|au\\s+cours+(du|de))\\b`; + FrenchDateTime.DayRegex = `(?01|02|03|04|05|06|07|08|09|10|11|11e|12|12e|13|13e|14|14e|15|15e|16|16e|17|17e|18|18e|19|19e|1er|1|21|21e|20|20e|22|22e|23|23e|24|24e|25|25e|26|26e|27|27e|28|28e|29|29e|2|2e|30|30e|31|31e|3|3e|4|4e|5|5e|6|6e|7|7e|8|8e|9|9e)(?=\\b|t)`; + FrenchDateTime.MonthNumRegex = `(?01|02|03|04|05|06|07|08|09|10|11|12|1|2|3|4|5|6|7|8|9)\\b`; + FrenchDateTime.DescRegex = `(?h|ampm|am\\b|a\\.m\\.|a m\\b|a\\. m\\.|a\\.m\\b|a\\. m\\b|pm\\b|p\\.m\\.|p m\\b|p\\. m\\.|p\\.m\\b|p\\. m\\b|p\\b\\b)`; + FrenchDateTime.AmDescRegex = `(h|am\\b|a\\.m\\.|a m\\b|a\\. m\\.|a\\.m\\b|a\\. m\\b)`; + FrenchDateTime.PmDescRegex = `(h|pm\\b|p\\.m\\.|p\\b|p m\\b|p\\. m\\.|p\\.m\\b|p\\. m\\b)`; + FrenchDateTime.AmPmDescRegex = `(h|ampm)`; + FrenchDateTime.TwoDigitYearRegex = `\\b(?([0-27-9]\\d))(?!(\\s*((\\:)|${FrenchDateTime.AmDescRegex}|${FrenchDateTime.PmDescRegex}|\\.\\d)))\\b`; + FrenchDateTime.FullTextYearRegex = `^[\\*]`; + FrenchDateTime.YearRegex = `(${baseDateTime.BaseDateTime.FourDigitYearRegex}|${FrenchDateTime.FullTextYearRegex})`; + FrenchDateTime.WeekDayRegex = `(?Dimanche|Lundi|Mardi|Mercredi|Jeudi|Vendredi|Samedi|Lun|Mar|Mer|Jeu|Ven|Sam|Dim)\\b`; + FrenchDateTime.RelativeMonthRegex = `(?(${FrenchDateTime.ThisPrefixRegex}\\s+mois)|(mois\\s+${FrenchDateTime.PastSuffixRegex})|(mois\\s+${FrenchDateTime.NextSuffixRegex}))\\b`; + FrenchDateTime.WrittenMonthRegex = `(?Avril|Avr\\.|Avr|Août|D[eé]cembre|D[eé]c|D[eé]c\\.|F[eé]vrier|F[eé]v|F[eé]vr\\.|F[eé]vr|Javier|Jan|Janv\\.|Janv|Juillet|Jul|Juil|Juil\\.|Juin|Jun|Mars|Mar|Mai|Novembre|Nov|Nov\\.|Octobre|Oct|Oct\\.|Septembre|Sep|Sept|Sept\\.)`; + FrenchDateTime.MonthSuffixRegex = `(?(en\\s*|le\\s*|de\\s*|dans\\s*)?(${FrenchDateTime.RelativeMonthRegex}|${FrenchDateTime.WrittenMonthRegex}))`; + FrenchDateTime.DateUnitRegex = `(?l'ann[eé]e|ann[eé]es|an|mois|semaines|semaine|jours|jour|journ[eé]e|journ[eé]es)\\b`; + FrenchDateTime.SimpleCasesRegex = `\\b((d[ue])|entre\\s+)?(${FrenchDateTime.DayRegex})\\s*${FrenchDateTime.TillRegex}\\s*(${FrenchDateTime.DayRegex})\\s+${FrenchDateTime.MonthSuffixRegex}((\\s+|\\s*,\\s*)${FrenchDateTime.YearRegex})?\\b`; + FrenchDateTime.MonthFrontSimpleCasesRegex = `\\b((d[ue]|entre)\\s+)?${FrenchDateTime.MonthSuffixRegex}\\s+((d[ue]|entre)\\s+)?(${FrenchDateTime.DayRegex})\\s*${FrenchDateTime.TillRegex}\\s*(${FrenchDateTime.DayRegex})((\\s+|\\s*,\\s*)${FrenchDateTime.YearRegex})?\\b`; + FrenchDateTime.MonthFrontBetweenRegex = `\\b${FrenchDateTime.MonthSuffixRegex}\\s+(entre|d[ue]\\s+)(${FrenchDateTime.DayRegex})\\s*${FrenchDateTime.RangeConnectorRegex}\\s*(${FrenchDateTime.DayRegex})((\\s+|\\s*,\\s*)${FrenchDateTime.YearRegex})?\\b`; + FrenchDateTime.BetweenRegex = `\\b(entre\\s+)(${FrenchDateTime.DayRegex})\\s*${FrenchDateTime.RangeConnectorRegex}\\s*(${FrenchDateTime.DayRegex})\\s+${FrenchDateTime.MonthSuffixRegex}((\\s+|\\s*,\\s*)${FrenchDateTime.YearRegex})?\\b`; + FrenchDateTime.YearWordRegex = `\\b(?l'ann[ée]e)\\b`; + FrenchDateTime.MonthWithYear = `\\b((?Avril|Avr\\.|Avr|Août|Aout|D[ée]cembre|D[eé]c|Dec\\.|F[eé]v|F[eé]vr|Fev|F[eé]vrier|F[eé]v\\.|Janvier|Jan|Janv|Janv\\.|Jan\\.|Jul|Juillet|Juil\\.|Jun|Juin|Mar|Mars|Mai|Novembre|Nov|Nov\\.|Octobre|Oct|Oct\\.|Septembre|Sep|Sept|Sept\\.)(\\s*),?(\\s+de)?(\\s*)(${FrenchDateTime.YearRegex}|(?cette)\\s*${FrenchDateTime.YearWordRegex})|${FrenchDateTime.YearWordRegex}\\s*(${FrenchDateTime.PastSuffixRegex}|${FrenchDateTime.NextSuffixRegex}))`; + FrenchDateTime.OneWordPeriodRegex = `\\b((${FrenchDateTime.RelativeRegex}\\s+)?(?Avril|Avr\\.|Avr|Août|Aout|D[eé]cembre|D[ée]c|D[eé]c\\.|F[eé]vrier|Fev|F[eé]v\\.|F[eé]vr|Janvier|Janv\\.|Janv|Jan|Jan\\.|Jul|Juillet|Juil\\.|Jun|Juin|Mar|Mars|Mai|Nov|Novembre|Nov\\.|Oct|Octobre|Oct\\.|Sep|Septembre|Sept\\.)|${FrenchDateTime.RelativeRegex}\\s+(weekend|fin de semaine|week-end|semaine|mois|ans|l'année)|weekend|week-end|(mois|l'année))\\b`; + FrenchDateTime.MonthNumWithYear = `(${FrenchDateTime.YearRegex}(\\s*)[/\\-\\.](\\s*)${FrenchDateTime.MonthNumRegex})|(${FrenchDateTime.MonthNumRegex}(\\s*)[/\\-](\\s*)${FrenchDateTime.YearRegex})`; + FrenchDateTime.WeekOfMonthRegex = `(?(le\\s+)?(?premier|1er|duexi[èe]me|2|troisi[èe]me|3|quatri[èe]me|4|cinqi[èe]me|5)\\s+semaine\\s+${FrenchDateTime.MonthSuffixRegex})`; + FrenchDateTime.WeekOfYearRegex = `(?(le\\s+)?(?premier|1er|duexi[èe]me|2|troisi[èe]me|3|quatri[èe]me|4|cinqi[èe]me|5)\\s+semaine(\\s+de)?\\s+(${FrenchDateTime.YearRegex}|${FrenchDateTime.RelativeRegex}\\s+ann[ée]e))`; + FrenchDateTime.FollowedDateUnit = `^\\s*${FrenchDateTime.DateUnitRegex}`; + FrenchDateTime.NumberCombinedWithDateUnit = `\\b(?\\d+(\\.\\d*)?)${FrenchDateTime.DateUnitRegex}`; + FrenchDateTime.QuarterRegex = `(le\\s+)?(?premier|1er|duexi[èe]me|2|troisi[èe]me|3|quatri[èe]me|4)\\s+quart(\\s+de|\\s*,\\s*)?\\s+(${FrenchDateTime.YearRegex}|${FrenchDateTime.RelativeRegex}\\s+l'ann[eé]e)`; + FrenchDateTime.QuarterRegexYearFront = `(${FrenchDateTime.YearRegex}|l'année\\s+(${FrenchDateTime.PastSuffixRegex}|${FrenchDateTime.NextSuffixRegex})|${FrenchDateTime.RelativeRegex}\\s+ann[eé]e)\\s+(le\\s+)?(?premier|1er|duexi[èe]me|2|troisi[èe]me|3|quatri[èe]me|4)\\s+quarts`; + FrenchDateTime.AllHalfYearRegex = `^[.]`; + FrenchDateTime.PrefixDayRegex = `^[.]`; + FrenchDateTime.CenturySuffixRegex = `^[.]`; + FrenchDateTime.SeasonRegex = `\\b((printemps|été|automne|hiver)+\\s*(${FrenchDateTime.NextSuffixRegex}|${FrenchDateTime.PastSuffixRegex}))|(?(${FrenchDateTime.RelativeRegex}\\s+)?(?printemps|[ée]t[ée]|automne|hiver)((\\s+de|\\s*,\\s*)?\\s+(${FrenchDateTime.YearRegex}|${FrenchDateTime.RelativeRegex}\\s+l'ann[eé]e))?)\\b`; + FrenchDateTime.WhichWeekRegex = `(semaine)(\\s*)(?\\d\\d|\\d|0\\d)`; + FrenchDateTime.WeekOfRegex = `(semaine)(\\s*)(de)`; + FrenchDateTime.MonthOfRegex = `(mois)(\\s*)(de)`; + FrenchDateTime.MonthRegex = `(?Avril|Avr|Avr\\.|Août|Aout|D[ée]cembre|D[eé]c|Dec\\.|F[eé]vrier|F[eé]vr|Fev|F[eé]v|F[eé]v\\.|Janvier|Janv\\.|Janv|Jan|Jan\\.|Juillet|Juil|Juil\\.|Juin|Mars|Mai|Novembre|Nov|Nov\\.|Octobre|Oct|Oct\\.|Septembre|Sep|Sept|Sept\\.)`; + FrenchDateTime.OnRegex = `(?<=\\b(en|sur\\s*l[ea]|sur)\\s+)(${FrenchDateTime.DayRegex}s?)\\b`; + FrenchDateTime.RelaxedOnRegex = `(?<=\\b(en|le|dans|sur\\s*l[ea]|du|sur)\\s+)((?10e|11e|12e|13e|14e|15e|16e|17e|18e|19e|1er|20e|21e|22e|23e|24e|25e|26e|27e|28e|29e|2e|30e|31e|3e|4e|5e|6e|7e|8e|9e)s?)\\b`; + FrenchDateTime.ThisRegex = `\\b((cette(\\s*semaine)?\\s+)${FrenchDateTime.WeekDayRegex})|(${FrenchDateTime.WeekDayRegex}(\\s+cette\\s*semaine))\\b`; + FrenchDateTime.LastDateRegex = `\\b((${FrenchDateTime.WeekDayRegex}(\\s*(de)?\\s*la\\s*semaine\\s+${FrenchDateTime.PastSuffixRegex}))|(${FrenchDateTime.WeekDayRegex}(\\s+${FrenchDateTime.PastSuffixRegex})))\\b`; + FrenchDateTime.NextDateRegex = `\\b((${FrenchDateTime.WeekDayRegex}(\\s+${FrenchDateTime.NextSuffixRegex}))|(${FrenchDateTime.WeekDayRegex}(\\s*(de)?\\s*la\\s*semaine\\s+${FrenchDateTime.NextSuffixRegex})))\\b`; + FrenchDateTime.SpecialDayRegex = `\\b(avant[\\s|-]hier|apr[eè]s(-demain|\\s*demain)|(le\\s)?jour suivant|(le\\s+)?dernier jour|hier|lendemain|demain|de la journ[ée]e|aujourd'hui)\\b`; + FrenchDateTime.SpecialDayWithNumRegex = `^[.]`; + FrenchDateTime.StrictWeekDay = `\\b(?Dimanche|Lundi|Mardi|Mercredi|Jeudi|Vendredi|Samedi|Lun|Mar|Mer|Jeu|Ven|Sam|Dim)s?\\b`; + FrenchDateTime.SetWeekDayRegex = `\\b(?le\\s+)?(?matin|matin[ée]e|apres-midi|soir[ée]e|soir|Dimanche|Lundi|Mardi|Mercredi|Jeudi|Vendredi|Samedi)s\\b`; + FrenchDateTime.WeekDayOfMonthRegex = `(?(le\\s+)?(?premier|1er|duexi[èe]me|2|troisi[èe]me|3|quatri[èe]me|4|cinqi[èe]me|5)\\s+${FrenchDateTime.WeekDayRegex}\\s+${FrenchDateTime.MonthSuffixRegex})`; + FrenchDateTime.RelativeWeekDayRegex = `^[.]`; + FrenchDateTime.NumberEndingPattern = `^[.]`; + FrenchDateTime.SpecialDate = `(?<=\\b([àa]|au|le)\\s+)${FrenchDateTime.DayRegex}\\b`; + FrenchDateTime.DateYearRegex = `(?${FrenchDateTime.YearRegex}|${FrenchDateTime.TwoDigitYearRegex})`; + FrenchDateTime.DateExtractor1 = `\\b(${FrenchDateTime.WeekDayRegex}(\\s+|\\s*,\\s*))?${FrenchDateTime.MonthRegex}\\s*[/\\\\\\.\\-]?\\s*${FrenchDateTime.DayRegex}\\b`; + FrenchDateTime.DateExtractor2 = `\\b(${FrenchDateTime.WeekDayRegex}(\\s+|\\s*,\\s*))?${FrenchDateTime.DayRegex}(\\s+|\\s*,\\s*|\\s+)${FrenchDateTime.MonthRegex}\\s*[\\.\\-]?\\s*${FrenchDateTime.DateYearRegex}\\b`; + FrenchDateTime.DateExtractor3 = `\\b(${FrenchDateTime.WeekDayRegex}(\\s+|\\s*,\\s*))?${FrenchDateTime.DayRegex}(\\s+|\\s*,\\s*|\\s*-\\s*)${FrenchDateTime.MonthRegex}((\\s+|\\s*,\\s*)${FrenchDateTime.DateYearRegex})?\\b`; + FrenchDateTime.DateExtractor4 = `\\b${FrenchDateTime.MonthNumRegex}\\s*[/\\\\\\-]\\s*${FrenchDateTime.DayRegex}\\s*[/\\\\\\-]\\s*${FrenchDateTime.DateYearRegex}`; + FrenchDateTime.DateExtractor5 = `\\b${FrenchDateTime.DayRegex}\\s*[/\\\\\\-\\.]\\s*${FrenchDateTime.MonthNumRegex}\\s*[/\\\\\\-\\.]\\s*${FrenchDateTime.DateYearRegex}`; + FrenchDateTime.DateExtractor6 = `(?<=\\b(le|sur|sur l[ae])\\s+)${FrenchDateTime.MonthNumRegex}[\\-\\.\\/]${FrenchDateTime.DayRegex}\\b`; + FrenchDateTime.DateExtractor7 = `\\b${FrenchDateTime.DayRegex}\\s*/\\s*${FrenchDateTime.MonthNumRegex}((\\s+|\\s*,\\s*)${FrenchDateTime.DateYearRegex})?\\b`; + FrenchDateTime.DateExtractor8 = `(?<=\\b(le)\\s+)${FrenchDateTime.DayRegex}[\\\\\\-]${FrenchDateTime.MonthNumRegex}\\b`; + FrenchDateTime.DateExtractor9 = `\\b${FrenchDateTime.DayRegex}\\s*/\\s*${FrenchDateTime.MonthNumRegex}((\\s+|\\s*,\\s*)${FrenchDateTime.DateYearRegex})?\\b`; + FrenchDateTime.DateExtractorA = `\\b${FrenchDateTime.DateYearRegex}\\s*[/\\\\\\-\\.]\\s*${FrenchDateTime.MonthNumRegex}\\s*[/\\\\\\-\\.]\\s*${FrenchDateTime.DayRegex}`; + FrenchDateTime.OfMonth = `^\\s*de\\s*${FrenchDateTime.MonthRegex}`; + FrenchDateTime.MonthEnd = `${FrenchDateTime.MonthRegex}\\s*(le)?\\s*$`; + FrenchDateTime.WeekDayEnd = `${FrenchDateTime.WeekDayRegex}\\s*,?\\s*$`; + FrenchDateTime.RangeUnitRegex = `\\b(?l'année|ann[eé]e(s)?|mois|semaines|semaine)\\b`; + FrenchDateTime.HourNumRegex = `\\b(?zero|un|deux|trois|quatre|cinq|six|sept|huit|neuf|dix|onze|douze|treize|quatorze|quinze|dix-six|dix-sept|dix-huit|dix-neuf|vingt|vingt-et-un|vingt-deux|vingt-trois)\\b`; + FrenchDateTime.MinuteNumRegex = `(?un|deux|trois|quatre|cinq|six|sept|huit|neuf|dix|onze|douze|treize|quatorze|quinze|seize|dix-sept|dix-huit|dix-neuf|vingt|trente|quarante|cinquante)`; + FrenchDateTime.DeltaMinuteNumRegex = `(?un|deux|trois|quatre|cinq|six|sept|huit|neuf|dix|onze|douze|treize|quatorze|quinze|seize|dix-sept|dix-huit|dix-neuf|vingt|trente|quarante|cinquante)`; + FrenchDateTime.OclockRegex = `(?heure|heures|h)`; + FrenchDateTime.PmRegex = `(?(dans l'\\s*)?apr[eè]s(\\s*|-)midi|(du|ce|de|le)\\s*(soir[ée]e|soir)|(dans l[ea]\\s+)?(nuit|soir[eé]e))`; + FrenchDateTime.AmRegex = `(?(du|de|ce|(du|de|dans)\\s*l[ea]|le)?\\s*matin[ée]e|(du|de|ce|dans l[ea]|le)?\\s*matin)`; + FrenchDateTime.LessThanOneHour = `(?(une\\s+)?quart|trois quart(s)?|demie( heure)?|${baseDateTime.BaseDateTime.DeltaMinuteRegex}(\\s+(minute|minutes|min|mins))|${FrenchDateTime.DeltaMinuteNumRegex}(\\s+(minute|minutes|min|mins)))`; + FrenchDateTime.WrittenTimeRegex = `(?${FrenchDateTime.HourNumRegex}\\s+(${FrenchDateTime.MinuteNumRegex}|(?vingt|trente|quarante|cinquante)\\s+${FrenchDateTime.MinuteNumRegex}))`; + FrenchDateTime.TimePrefix = `(?(heures\\s*et\\s+${FrenchDateTime.LessThanOneHour}|et ${FrenchDateTime.LessThanOneHour}|${FrenchDateTime.LessThanOneHour} [àa]))`; + FrenchDateTime.TimeSuffix = `(?${FrenchDateTime.AmRegex}|${FrenchDateTime.PmRegex}|${FrenchDateTime.OclockRegex})`; + FrenchDateTime.BasicTime = `(?${FrenchDateTime.WrittenTimeRegex}|${FrenchDateTime.HourNumRegex}|${baseDateTime.BaseDateTime.HourRegex}:${baseDateTime.BaseDateTime.MinuteRegex}(:${baseDateTime.BaseDateTime.SecondRegex})?|${baseDateTime.BaseDateTime.HourRegex})`; + FrenchDateTime.MidnightRegex = `(?minuit)`; + FrenchDateTime.CommonDatePrefixRegex = `^[\\.]`; + FrenchDateTime.MorningRegex = `(?matin[ée]e|matin)`; + FrenchDateTime.AfternoonRegex = `(?(d'|l')?apr[eè]s(-|\\s*)midi)`; + FrenchDateTime.MidmorningRegex = `(?milieu\\s*d[ue]\\s*${FrenchDateTime.MorningRegex})`; + FrenchDateTime.MiddayRegex = `(?milieu(\\s*|-)d[eu]\\s*(jour|midi)|apr[eè]s(-|\\s*)midi)`; + FrenchDateTime.MidafternoonRegex = `(?milieu\\s*d'+${FrenchDateTime.AfternoonRegex})`; + FrenchDateTime.MidTimeRegex = `(?(${FrenchDateTime.MidnightRegex}|${FrenchDateTime.MidmorningRegex}|${FrenchDateTime.MidafternoonRegex}|${FrenchDateTime.MiddayRegex}))`; + FrenchDateTime.AtRegex = `\\b(((?<=\\b[àa]\\s+)(${FrenchDateTime.WrittenTimeRegex}|${FrenchDateTime.HourNumRegex}|${baseDateTime.BaseDateTime.HourRegex}|${FrenchDateTime.MidTimeRegex}))|${FrenchDateTime.MidTimeRegex})\\b`; + FrenchDateTime.IshRegex = `\\b(peu\\s*pr[èe]s\\s*${baseDateTime.BaseDateTime.HourRegex}|peu\\s*pr[èe]s\\s*${FrenchDateTime.WrittenTimeRegex}|peu\\s*pr[èe]s\\s*[àa]\\s*${baseDateTime.BaseDateTime.HourRegex}|peu pr[èe]s midi)\\b`; + FrenchDateTime.TimeUnitRegex = `(?heures|heure|hrs|hr|h|minutes|minute|mins|min|secondes|seconde|secs|sec)\\b`; + FrenchDateTime.RestrictedTimeUnitRegex = `(?huere|minute)\\b`; + FrenchDateTime.ConnectNumRegex = `${baseDateTime.BaseDateTime.HourRegex}(?00|01|02|03|04|05|06|07|08|09|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)\\s*${FrenchDateTime.DescRegex}`; + FrenchDateTime.FivesRegex = `(?(quinze|vingt(\\s*|-*(cinq))?|trente(\\s*|-*(cinq))?|quarante(\\s*|-*(cinq))??|cinquante(\\s*|-*(cinq))?|dix|cinq))\\b`; + FrenchDateTime.PeriodHourNumRegex = `(?vingt-et-un|vingt-deux|vingt-trois|vingt-quatre|zero|une|deux|trois|quatre|cinq|six|sept|huit|neuf|dix|onze|douze|treize|quatorze|quinze|seize|dix-sept|dix-huit|dix-neuf|vingt)`; + FrenchDateTime.TimeRegex1 = `\\b(${FrenchDateTime.WrittenTimeRegex}|${FrenchDateTime.HourNumRegex}|${baseDateTime.BaseDateTime.HourRegex})\\s*${FrenchDateTime.DescRegex}(\\s+${FrenchDateTime.TimePrefix})?`; + FrenchDateTime.TimeRegex2 = `(\\b${FrenchDateTime.TimePrefix}\\s+)?(T)?${baseDateTime.BaseDateTime.HourRegex}(\\s*)?:(\\s*)?${baseDateTime.BaseDateTime.MinuteRegex}((\\s*)?:(\\s*)?${baseDateTime.BaseDateTime.SecondRegex})?((\\s*${FrenchDateTime.DescRegex})|\\b)`; + FrenchDateTime.TimeRegex3 = `\\b${baseDateTime.BaseDateTime.HourRegex}\\.${baseDateTime.BaseDateTime.MinuteRegex}(\\s*${FrenchDateTime.DescRegex})(\\s+${FrenchDateTime.TimePrefix})?`; + FrenchDateTime.TimeRegex4 = `\\b${FrenchDateTime.BasicTime}(\\s*${FrenchDateTime.DescRegex})?(\\s+${FrenchDateTime.TimePrefix})?\\s+${FrenchDateTime.TimeSuffix}\\b`; + FrenchDateTime.TimeRegex5 = `\\b${FrenchDateTime.BasicTime}((\\s*${FrenchDateTime.DescRegex})|\\b)(\\s+${FrenchDateTime.TimePrefix})?`; + FrenchDateTime.TimeRegex6 = `${FrenchDateTime.BasicTime}(\\s*${FrenchDateTime.DescRegex})?\\s+${FrenchDateTime.TimeSuffix}\\b`; + FrenchDateTime.TimeRegex7 = `\\b${FrenchDateTime.TimeSuffix}\\s+[àa]\\s+${FrenchDateTime.BasicTime}((\\s*${FrenchDateTime.DescRegex})|\\b)`; + FrenchDateTime.TimeRegex8 = `\\b${FrenchDateTime.TimeSuffix}\\s+${FrenchDateTime.BasicTime}((\\s*${FrenchDateTime.DescRegex})|\\b)`; + FrenchDateTime.TimeRegex9 = `\\b${FrenchDateTime.PeriodHourNumRegex}\\s+${FrenchDateTime.FivesRegex}((\\s*${FrenchDateTime.DescRegex})|\\b)`; + FrenchDateTime.TimeRegex10 = `\\b${baseDateTime.BaseDateTime.HourRegex}(\\s*h\\s*)${baseDateTime.BaseDateTime.MinuteRegex}(\\s*${FrenchDateTime.DescRegex})?(\\s+${FrenchDateTime.TimePrefix})?`; + FrenchDateTime.HourRegex = `\\b${baseDateTime.BaseDateTime.HourRegex}`; + FrenchDateTime.PeriodDescRegex = `(?pm|am|p\\.m\\.|a\\.m\\.|p)`; + FrenchDateTime.PeriodPmRegex = `(?dans l'apr[eè]s-midi|ce soir|d[eu] soir|dans l[ea] soir[eé]e|dans la nuit|d[eu] soir[ée]e)s?`; + FrenchDateTime.PeriodAmRegex = `(?matin|d[eu] matin|matin[ée]e)s?`; + FrenchDateTime.PureNumFromTo = `((du|de|des|depuis)\\s+)?(${FrenchDateTime.HourRegex}|${FrenchDateTime.PeriodHourNumRegex})(\\s*(?${FrenchDateTime.PeriodDescRegex}))?\\s*${FrenchDateTime.TillRegex}\\s*(${FrenchDateTime.HourRegex}|${FrenchDateTime.PeriodHourNumRegex})\\s*(?${FrenchDateTime.PmRegex}|${FrenchDateTime.AmRegex}|${FrenchDateTime.PeriodDescRegex})?`; + FrenchDateTime.PureNumBetweenAnd = `(entre\\s+)(${FrenchDateTime.HourRegex}|${FrenchDateTime.PeriodHourNumRegex})(\\s*(?${FrenchDateTime.PeriodDescRegex}))?\\s*${FrenchDateTime.RangeConnectorRegex}\\s*(${FrenchDateTime.HourRegex}|${FrenchDateTime.PeriodHourNumRegex})\\s*(?${FrenchDateTime.PmRegex}|${FrenchDateTime.AmRegex}|${FrenchDateTime.PeriodDescRegex})?`; + FrenchDateTime.SpecificTimeFromTo = `^[.]`; + FrenchDateTime.SpecificTimeBetweenAnd = `^[.]`; + FrenchDateTime.PrepositionRegex = `(?^([aà] la|en|sur\\s*l[ea]|sur|de)$)`; + FrenchDateTime.TimeOfDayRegex = `\\b(?((((dans\\s+(l[ea])?\\s+)?((?d[eé]but(\\s+|-)|t[oô]t(\\s+|-)(l[ea]\\s*)?)|(?fin\\s*|fin de(\\s+(la)?)|tard\\s*))?(matin[ée]e|matin|((d|l)?'?)apr[eè]s[-|\\s*]midi|nuit|soir[eé]e|soir)))|(((\\s+(l[ea])?\\s+)?)(jour|journ[eé]e)))s?)\\b`; + FrenchDateTime.SpecificTimeOfDayRegex = `\\b((${FrenchDateTime.RelativeRegex}\\s+${FrenchDateTime.TimeOfDayRegex})|(${FrenchDateTime.TimeOfDayRegex}\\s*(${FrenchDateTime.NextSuffixRegex}))\\b|\\bsoir|\\bdu soir)s?\\b`; + FrenchDateTime.TimeFollowedUnit = `^\\s*${FrenchDateTime.TimeUnitRegex}`; + FrenchDateTime.TimeNumberCombinedWithUnit = `\\b(?\\d+(\\.\\d*)?)${FrenchDateTime.TimeUnitRegex}`; + FrenchDateTime.NowRegex = `\\b(?(ce\\s+)?moment|maintenant|d[eè]s que possible|dqp|r[eé]cemment|auparavant)\\b`; + FrenchDateTime.SuffixRegex = `^\\s*(dans\\s+l[ea]\\s+)|(en\\s+)|(du)?(matin|matin([eé]e)?|apr[eè]s-midi|soir[eé]e|nuit)\\b`; + FrenchDateTime.DateTimeTimeOfDayRegex = `\\b(?matin[ée]e|matin|apr[eè]s-midi|nuit|soir)\\b`; + FrenchDateTime.DateTimeSpecificTimeOfDayRegex = `\\b((${FrenchDateTime.RelativeRegex}\\s+${FrenchDateTime.DateTimeTimeOfDayRegex})\\b|\\b(ce|cette\\s+)(soir|nuit))\\b`; + FrenchDateTime.TimeOfTodayAfterRegex = `^\\s*(,\\s*)?(en|dans|du\\s+)?${FrenchDateTime.DateTimeSpecificTimeOfDayRegex}`; + FrenchDateTime.TimeOfTodayBeforeRegex = `${FrenchDateTime.DateTimeSpecificTimeOfDayRegex}(\\s*,)?(\\s+([àa]|pour))?\\s*$`; + FrenchDateTime.SimpleTimeOfTodayAfterRegex = `(${FrenchDateTime.HourNumRegex}|${baseDateTime.BaseDateTime.HourRegex})\\s*(,\\s*)?(en|[àa]\\s+)?${FrenchDateTime.DateTimeSpecificTimeOfDayRegex}`; + FrenchDateTime.SimpleTimeOfTodayBeforeRegex = `${FrenchDateTime.DateTimeSpecificTimeOfDayRegex}(\\s*,)?(\\s+([àa]|vers))?\\s*(${FrenchDateTime.HourNumRegex}|${baseDateTime.BaseDateTime.HourRegex})`; + FrenchDateTime.TheEndOfRegex = `(la\\s+)?fin(\\s+de\\s*|\\s*de*l[ea])?\\s*$`; + FrenchDateTime.PeriodTimeOfDayRegex = `\\b((dans\\s+(le)?\\s+)?((?d[eé]but(\\s+|-|d[ue]|de la)|t[oô]t)|(?tard\\s*|fin(\\s+|-|d[eu])?))?(?matin|((d|l)?'?)apr[eè]s-midi|nuit|soir[eé]e|soir))\\b`; + FrenchDateTime.PeriodSpecificTimeOfDayRegex = `\\b((${FrenchDateTime.RelativeRegex}\\s+${FrenchDateTime.PeriodTimeOfDayRegex})\\b|\\b(ce|cette\\s+)(soir|nuit))\\b`; + FrenchDateTime.PeriodTimeOfDayWithDateRegex = `\\b((${FrenchDateTime.TimeOfDayRegex}))\\b`; + FrenchDateTime.LessThanRegex = `^[.]`; + FrenchDateTime.MoreThanRegex = `^[.]`; + FrenchDateTime.DurationUnitRegex = `(?ans|ann[eé]e|mois|semaines|semaine|jour|jours|heures|heure|hrs|hr|h|minutes|minute|mins|min|secondes|seconde|secs|sec|ann[eé]es|journ[eé]e)\\b`; + FrenchDateTime.SuffixAndRegex = `(?\\s*(et)\\s+((un|une)\\s+)?(?demi|quart))`; + FrenchDateTime.PeriodicRegex = `\\b(?quotidienne|quotidien|journellement|mensuel|mensuelle|jour|jours|hebdomadaire|bihebdomadaire|annuellement|annuel)\\b`; + FrenchDateTime.EachUnitRegex = `(?(chaque|toutes les|tous les)(?\\s+autres)?\\s*${FrenchDateTime.DurationUnitRegex})`; + FrenchDateTime.EachPrefixRegex = `\\b(?(chaque|tous les|(toutes les))\\s*$)`; + FrenchDateTime.SetEachRegex = `\\b(?(chaque|tous les|(toutes les))\\s*)`; + FrenchDateTime.SetLastRegex = `(?prochain|dernier|derni[eè]re|pass[ée]s|pr[eé]c[eé]dent|courant|en\\s*cours)`; + FrenchDateTime.EachDayRegex = `^\\s*(chaque|tous les)\\s*(jour|jours)\\b`; + FrenchDateTime.DurationFollowedUnit = `^\\s*${FrenchDateTime.SuffixAndRegex}?(\\s+|-)?${FrenchDateTime.DurationUnitRegex}`; + FrenchDateTime.NumberCombinedWithDurationUnit = `\\b(?\\d+(\\.\\d*)?)(-)?${FrenchDateTime.DurationUnitRegex}`; + FrenchDateTime.AnUnitRegex = `\\b(((?demi\\s+)?(-)\\s+${FrenchDateTime.DurationUnitRegex}))`; + FrenchDateTime.DuringRegex = `^[.]`; + FrenchDateTime.AllRegex = `\\b(?toute\\s(l['ea])\\s?(?ann[eé]e|mois|semaine|semaines|jour|jours|journ[eé]e))\\b`; + FrenchDateTime.HalfRegex = `(((un|une)\\s*)|\\b)(?demi?(\\s*|-)+(?ann[eé]e|ans|mois|semaine|jour|heure))\\b`; + FrenchDateTime.ConjunctionRegex = `\\b((et(\\s+de|pour)?)|avec)\\b`; + FrenchDateTime.HolidayRegex1 = `\\b(?vendredi saint|mercredi des cendres|p[aâ]ques|l'action de gr[âa]ce|mardi gras|la saint-sylvestre|la saint sylvestre|la Saint-Valentin|la saint valentin|nouvel an chinois|nouvel an|r[eé]veillon de Nouvel an|jour de l'an|premier-mai|ler-mai|1-mai|poisson d'avril|r[eé]veillon de No[eë]l|veille de no[eë]l|noël|noel|thanksgiving|halloween|yuandan)(\\s+((d[ue]\\s+|d'))?(${FrenchDateTime.YearRegex}|(${FrenchDateTime.ThisPrefixRegex}\\s+)ann[eé]e|ann[eé]e\\s+(${FrenchDateTime.PastSuffixRegex}|${FrenchDateTime.NextSuffixRegex})))?\\b`; + FrenchDateTime.HolidayRegex2 = `\\b(?martin luther king|martin luther king jr|toussaint|st patrick|st george|cinco de mayo|l'ind[eé]pendance|guy fawkes)(\\s+(de\\s+)?(${FrenchDateTime.YearRegex}|${FrenchDateTime.ThisPrefixRegex}\\s+ann[eé]e|ann[eé]e\\s+(${FrenchDateTime.PastSuffixRegex}|${FrenchDateTime.NextSuffixRegex})))?\\b`; + FrenchDateTime.HolidayRegex3 = `(?(jour\\s*(d[eu]|des)\\s*(canberra|p[aâ]ques|colomb|bastille|la prise de la bastille|l'ind[eé]pendance|l'ind[eé]pendance am[eé]ricaine|thanks\\s*giving|bapt[êe]me|nationale|d'armistice|inaugueration|marmotte|assomption|femme|comm[ée]moratif)))(\\s+(de\\s+)?(${FrenchDateTime.YearRegex}|${FrenchDateTime.ThisPrefixRegex}\\s+ann[eé]e|ann[eé]e\\s+(${FrenchDateTime.PastSuffixRegex}|${FrenchDateTime.NextSuffixRegex})))?`; + FrenchDateTime.HolidayRegex4 = `(?(F[eê]te\\s*(d[eu]|des)\\s*)(travail|m[eè]re|m[eè]res|p[eè]re|p[eè]res))(\\s+(de\\s+)?(${FrenchDateTime.YearRegex}|${FrenchDateTime.ThisPrefixRegex}\\s+ann[eé]e|ann[eé]e\\s+(${FrenchDateTime.PastSuffixRegex}|${FrenchDateTime.NextSuffixRegex})))?\\b`; + FrenchDateTime.DateTokenPrefix = 'le '; + FrenchDateTime.TimeTokenPrefix = 'à '; + FrenchDateTime.TokenBeforeDate = 'le '; + FrenchDateTime.TokenBeforeTime = 'à '; + FrenchDateTime.AMTimeRegex = `(?matin[ée]e|matin)`; + FrenchDateTime.PMTimeRegex = `\\b(?(d'|l')?apr[eè]s-midi|soir|nuit|\\s*ce soir|du soir)\\b`; + FrenchDateTime.BeforeRegex = `\\b(avant)\\b`; + FrenchDateTime.BeforeRegex2 = `\\b(entre\\s*(le|la(s)?)?)\\b`; + FrenchDateTime.AfterRegex = `\\b(apres)\\b`; + FrenchDateTime.SinceRegex = `\\b(depuis)\\b`; + FrenchDateTime.AroundRegex = `^[.]`; + FrenchDateTime.AgoPrefixRegex = `\\b(y a)\\b`; + FrenchDateTime.LaterRegex = `\\b(plus tard)\\b`; + FrenchDateTime.AgoRegex = `^[.]`; + FrenchDateTime.InConnectorRegex = `\\b(dans|en|sur)\\b`; + FrenchDateTime.WithinNextPrefixRegex = `^[.]`; + FrenchDateTime.MorningStartEndRegex = `(^(matin))|((matin)$)`; + FrenchDateTime.AfternoonStartEndRegex = `(^((d'|l')?apr[eè]s-midi))|(((d'|l')?apr[eè]s-midi)$)`; + FrenchDateTime.EveningStartEndRegex = `(^(soir[ée]e|soir))|((soir[ée]e|soir)$)`; + FrenchDateTime.NightStartEndRegex = `(^(nuit))|((nuit)$)`; + FrenchDateTime.InexactNumberRegex = `\\b(quelque|quel qu[ée]s|quelqu[ée]s|plusieur|plusieurs|divers)\\b`; + FrenchDateTime.InexactNumberUnitRegex = `(${FrenchDateTime.InexactNumberRegex})\\s+(${FrenchDateTime.DurationUnitRegex})`; + FrenchDateTime.RelativeTimeUnitRegex = `((((${FrenchDateTime.ThisPrefixRegex})?)\\s+(${FrenchDateTime.TimeUnitRegex}(\\s*${FrenchDateTime.NextSuffixRegex}|${FrenchDateTime.PastSuffixRegex})?))|((le))\\s+(${FrenchDateTime.RestrictedTimeUnitRegex}))`; + FrenchDateTime.RelativeDurationUnitRegex = `(((?<=(${FrenchDateTime.ThisPrefixRegex})\\s+)?\\b(${FrenchDateTime.DurationUnitRegex})(\\s+${FrenchDateTime.NextSuffixRegex}|${FrenchDateTime.PastSuffixRegex})?)|((le|my))\\s+(${FrenchDateTime.RestrictedTimeUnitRegex}))`; + FrenchDateTime.ReferenceDatePeriodRegex = `^[.]`; + FrenchDateTime.ConnectorRegex = `^(,|pour|t|vers)$`; + FrenchDateTime.ConnectorAndRegex = `\\b(et\\s*(le|la(s)?)?)\\b.+`; + FrenchDateTime.FromRegex = `((de|du)?)$`; + FrenchDateTime.FromRegex2 = `((depuis|de)(\\s*la(s)?)?)$`; + FrenchDateTime.FromToRegex = `\\b(du|de|des|depuis).+(à|a|au)\\b.+`; + FrenchDateTime.SingleAmbiguousMonthRegex = `^(le\\s+)?(may|march)$`; + FrenchDateTime.UnspecificDatePeriodRegex = `^[.]`; + FrenchDateTime.PrepositionSuffixRegex = `\\b(du|de|[àa]|vers|dans)$`; + FrenchDateTime.FlexibleDayRegex = `(?([A-Za-z]+\\s)?[A-Za-z\\d]+)`; + FrenchDateTime.ForTheRegex = `\\b(((pour le ${FrenchDateTime.FlexibleDayRegex})|(dans (le\\s+)?${FrenchDateTime.FlexibleDayRegex}(?<=(st|nd|rd|th))))(?\\s*(,|\\.|!|\\?|$)))`; + FrenchDateTime.WeekDayAndDayOfMonthRegex = `\\b${FrenchDateTime.WeekDayRegex}\\s+(le\\s+${FrenchDateTime.FlexibleDayRegex})\\b`; + FrenchDateTime.RestOfDateRegex = `\\b(Reste|fin)\\s+(d[eu]\\s+)?((le|cette|ce)\\s+)?(?semaine|mois|l'ann[ée]e)\\b`; + FrenchDateTime.RestOfDateTimeRegex = `\\b(Reste|fin)\\s+(d[eu]\\s+)?((le|cette|ce)\\s+)?(?jour)\\b`; + FrenchDateTime.LaterEarlyPeriodRegex = `^[.]`; + FrenchDateTime.WeekWithWeekDayRangeRegex = `^[.]`; + FrenchDateTime.GeneralEndingRegex = `^[.]`; + FrenchDateTime.MiddlePauseRegex = `^[.]`; + FrenchDateTime.DurationConnectorRegex = `^[.]`; + FrenchDateTime.PrefixArticleRegex = `^[\\.]`; + FrenchDateTime.OrRegex = `^[.]`; + FrenchDateTime.YearPlusNumberRegex = `^[.]`; + FrenchDateTime.NumberAsTimeRegex = `^[.]`; + FrenchDateTime.TimeBeforeAfterRegex = `^[.]`; + FrenchDateTime.DateNumberConnectorRegex = `^[.]`; + FrenchDateTime.CenturyRegex = `^[.]`; + FrenchDateTime.DecadeRegex = `^[.]`; + FrenchDateTime.DecadeWithCenturyRegex = `^[.]`; + FrenchDateTime.RelativeDecadeRegex = `^[.]`; + FrenchDateTime.YearSuffix = `(,?\\s*(${FrenchDateTime.DateYearRegex}|${FrenchDateTime.FullTextYearRegex}))`; + FrenchDateTime.YearAfterRegex = `^[.]`; + FrenchDateTime.YearPeriodRegex = `^[.]`; + FrenchDateTime.FutureSuffixRegex = `^[.]`; + FrenchDateTime.ComplexDatePeriodRegex = `^[.]`; + FrenchDateTime.UnitMap = new Map([["annees", "Y"], ["annee", "Y"], ["ans", "Y"], ["mois", "MON"], ["semaines", "W"], ["semaine", "W"], ["journees", "D"], ["journee", "D"], ["jour", "D"], ["jours", "D"], ["heures", "H"], ["heure", "H"], ["hrs", "H"], ["hr", "H"], ["h", "H"], ["minutes", "M"], ["minute", "M"], ["mins", "M"], ["min", "M"], ["secondes", "S"], ["seconde", "S"], ["secs", "S"], ["sec", "S"]]); + FrenchDateTime.UnitValueMap = new Map([["annees", 31536000], ["annee", 31536000], ["l'annees", 31536000], ["l'annee", 31536000], ["ans", 31536000], ["mois", 2592000], ["semaines", 604800], ["semaine", 604800], ["journees", 86400], ["journee", 86400], ["jour", 86400], ["jours", 86400], ["heures", 3600], ["heure", 3600], ["hrs", 3600], ["hr", 3600], ["h", 3600], ["minutes", 60], ["minute", 60], ["mins", 60], ["min", 60], ["secondes", 1], ["seconde", 1], ["secs", 1], ["sec", 1]]); + FrenchDateTime.SeasonMap = new Map([["printemps", "SP"], ["été", "SU"], ["automne", "FA"], ["hiver", "WI"]]); + FrenchDateTime.SeasonValueMap = new Map([["SP", 3], ["SU", 6], ["FA", 9], ["WI", 12]]); + FrenchDateTime.CardinalMap = new Map([["premier", 1], ["1er", 1], ["deuxième", 2], ["2e", 2], ["troisième", 3], ["troisieme", 3], ["3e", 3], ["quatrième", 4], ["4e", 4], ["cinqième", 5], ["5e", 5]]); + FrenchDateTime.DayOfWeek = new Map([["lundi", 1], ["mardi", 2], ["mercredi", 3], ["jeudi", 4], ["vendredi", 5], ["samedi", 6], ["dimanche", 0], ["lun", 1], ["mar", 2], ["mer", 3], ["jeu", 4], ["ven", 5], ["sam", 6], ["dim", 0]]); + FrenchDateTime.MonthOfYear = new Map([["1", 1], ["2", 2], ["3", 3], ["4", 4], ["5", 5], ["6", 6], ["7", 7], ["8", 8], ["9", 9], ["10", 10], ["11", 11], ["12", 12], ["janvier", 1], ["fevrier", 2], ["février", 2], ["mars", 3], ["mar", 3], ["avril", 4], ["avr", 4], ["mai", 5], ["juin", 6], ["jun", 6], ["juillet", 7], ["aout", 8], ["août", 8], ["septembre", 9], ["octobre", 10], ["novembre", 11], ["decembre", 12], ["décembre", 12], ["janv", 1], ["janv.", 1], ["jan", 1], ["fevr", 2], ["fevr.", 2], ["févr.", 2], ["févr", 2], ["fev", 2], ["juil", 7], ["jul", 7], ["sep", 9], ["sept.", 9], ["sept", 9], ["oct", 10], ["oct.", 10], ["nov", 11], ["nov.", 11], ["dec", 12], ["déc.", 12], ["déc", 12], ["01", 1], ["02", 2], ["03", 3], ["04", 4], ["05", 5], ["06", 6], ["07", 7], ["08", 8], ["09", 9]]); + FrenchDateTime.Numbers = new Map([["zero", 0], ["un", 1], ["une", 1], ["a", 1], ["deux", 2], ["trois", 3], ["quatre", 4], ["cinq", 5], ["six", 6], ["sept", 7], ["huit", 8], ["neuf", 9], ["dix", 10], ["onze", 11], ["douze", 12], ["treize", 13], ["quatorze", 14], ["quinze", 15], ["seize", 16], ["dix-sept", 17], ["dix-huit", 18], ["dix-neuf", 19], ["vingt-et-un", 21], ["vingt et un", 21], ["vingt", 20], ["vingt deux", 22], ["vingt-deux", 22], ["vingt trois", 23], ["vingt-trois", 23], ["vingt quatre", 24], ["vingt-quatre", 24], ["vingt cinq", 25], ["vingt-cinq", 25], ["vingt six", 26], ["vingt-six", 26], ["vingt sept", 27], ["vingt-sept", 27], ["vingt huit", 28], ["vingt-huit", 28], ["vingt neuf", 29], ["vingt-neuf", 29], ["trente", 30], ["trente et un", 31], ["trente-et-un", 31], ["trente deux", 32], ["trente-deux", 32], ["trente trois", 33], ["trente-trois", 33], ["trente quatre", 34], ["trente-quatre", 34], ["trente cinq", 35], ["trente-cinq", 35], ["trente six", 36], ["trente-six", 36], ["trente sept", 37], ["trente-sept", 37], ["trente huit", 38], ["trente-huit", 38], ["trente neuf", 39], ["trente-neuf", 39], ["quarante", 40], ["quarante et un", 41], ["quarante-et-un", 41], ["quarante deux", 42], ["quarante-duex", 42], ["quarante trois", 43], ["quarante-trois", 43], ["quarante quatre", 44], ["quarante-quatre", 44], ["quarante cinq", 45], ["quarante-cinq", 45], ["quarante six", 46], ["quarante-six", 46], ["quarante sept", 47], ["quarante-sept", 47], ["quarante huit", 48], ["quarante-huit", 48], ["quarante neuf", 49], ["quarante-neuf", 49], ["cinquante", 50], ["cinquante et un", 51], ["cinquante-et-un", 51], ["cinquante deux", 52], ["cinquante-deux", 52], ["cinquante trois", 53], ["cinquante-trois", 53], ["cinquante quatre", 54], ["cinquante-quatre", 54], ["cinquante cinq", 55], ["cinquante-cinq", 55], ["cinquante six", 56], ["cinquante-six", 56], ["cinquante sept", 57], ["cinquante-sept", 57], ["cinquante huit", 58], ["cinquante-huit", 58], ["cinquante neuf", 59], ["cinquante-neuf", 59], ["soixante", 60], ["soixante et un", 61], ["soixante-et-un", 61], ["soixante deux", 62], ["soixante-deux", 62], ["soixante trois", 63], ["soixante-trois", 63], ["soixante quatre", 64], ["soixante-quatre", 64], ["soixante cinq", 65], ["soixante-cinq", 65], ["soixante six", 66], ["soixante-six", 66], ["soixante sept", 67], ["soixante-sept", 67], ["soixante huit", 68], ["soixante-huit", 68], ["soixante neuf", 69], ["soixante-neuf", 69], ["soixante dix", 70], ["soixante-dix", 70], ["soixante et onze", 71], ["soixante-et-onze", 71], ["soixante douze", 72], ["soixante-douze", 72], ["soixante treize", 73], ["soixante-treize", 73], ["soixante quatorze", 74], ["soixante-quatorze", 74], ["soixante quinze", 75], ["soixante-quinze", 75], ["soixante seize", 76], ["soixante-seize", 76], ["soixante dix sept", 77], ["soixante-dix-sept", 77], ["soixante dix huit", 78], ["soixante-dix-huit", 78], ["soixante dix neuf", 79], ["soixante-dix-neuf", 79], ["quatre vingt", 80], ["quatre-vingt", 80], ["quatre vingt un", 81], ["quatre-vingt-un", 81], ["quatre vingt deux", 82], ["quatre-vingt-duex", 82], ["quatre vingt trois", 83], ["quatre-vingt-trois", 83], ["quatre vingt quatre", 84], ["quatre-vingt-quatre", 84], ["quatre vingt cinq", 85], ["quatre-vingt-cinq", 85], ["quatre vingt six", 86], ["quatre-vingt-six", 86], ["quatre vingt sept", 87], ["quatre-vingt-sept", 87], ["quatre vingt huit", 88], ["quatre-vingt-huit", 88], ["quatre vingt neuf", 89], ["quatre-vingt-neuf", 89], ["quatre vingt dix", 90], ["quatre-vingt-dix", 90], ["quatre vingt onze", 91], ["quatre-vingt-onze", 91], ["quatre vingt douze", 92], ["quatre-vingt-douze", 92], ["quatre vingt treize", 93], ["quatre-vingt-treize", 93], ["quatre vingt quatorze", 94], ["quatre-vingt-quatorze", 94], ["quatre vingt quinze", 95], ["quatre-vingt-quinze", 95], ["quatre vingt seize", 96], ["quatre-vingt-seize", 96], ["quatre vingt dix sept", 97], ["quatre-vingt-dix-sept", 97], ["quatre vingt dix huit", 98], ["quatre-vingt-dix-huit", 98], ["quatre vingt dix neuf", 99], ["quatre-vingt-dix-neuf", 99], ["cent", 100]]); + FrenchDateTime.DayOfMonth = new Map([["1er", 1], ["2e", 2], ["3e", 3], ["4e", 4], ["5e", 5], ["6e", 6], ["7e", 7], ["8e", 8], ["9e", 9], ["10e", 10], ["11e", 11], ["12e", 12], ["13e", 13], ["14e", 14], ["15e", 15], ["16e", 16], ["17e", 17], ["18e", 18], ["19e", 19], ["20e", 20], ["21e", 21], ["22e", 22], ["23e", 23], ["24e", 24], ["25e", 25], ["26e", 26], ["27e", 27], ["28e", 28], ["29e", 29], ["30e", 30], ["31e", 31]]); + FrenchDateTime.DoubleNumbers = new Map([["demi", 0.5], ["quart", 0.25]]); + FrenchDateTime.HolidayNames = new Map([["fathers", ["peres", "pères", "fêtedespères", "fetedesperes"]], ["mothers", ["fêtedesmères", "fetedesmeres"]], ["thanksgiving", ["lactiondegrace", "lactiondegrâce", "jourdethanksgiving", "thanksgiving"]], ["martinlutherking", ["journeemartinlutherking", "martinlutherkingjr"]], ["washingtonsbirthday", ["washingtonsbirthday", "washingtonbirthday"]], ["canberra", ["canberraday"]], ["labour", ["fetedetravail", "travail", "fetedutravail"]], ["columbus", ["columbusday"]], ["memorial", ["jourcommémoratif", "jourcommemoratif"]], ["yuandan", ["yuandan", "nouvelanchinois"]], ["maosbirthday", ["maosbirthday"]], ["teachersday", ["teachersday", "teacherday"]], ["singleday", ["singleday"]], ["allsaintsday", ["allsaintsday"]], ["youthday", ["youthday"]], ["childrenday", ["childrenday", "childday"]], ["femaleday", ["femaleday"]], ["treeplantingday", ["treeplantingday"]], ["arborday", ["arborday"]], ["girlsday", ["girlsday"]], ["whiteloverday", ["whiteloverday"]], ["loverday", ["loverday"]], ["christmas", ["noel", "noël"]], ["xmas", ["xmas"]], ["newyear", ["nouvellesannees", "nouvelan"]], ["newyearday", ["jourdunouvelan"]], ["newyearsday", ["jourdel'an", "jourpremierdelannee", "jourpremierdelannée"]], ["inaugurationday", ["jourd'inaugueration", "inaugueration"]], ["groundhougday", ["marmotte"]], ["valentinesday", ["lasaint-valentin", "lasaintvalentin"]], ["stpatrickday", ["stpatrickday"]], ["aprilfools", ["poissond'avril"]], ["stgeorgeday", ["stgeorgeday"]], ["mayday", ["premier-mai", "ler-mai", "1-mai"]], ["cincodemayoday", ["cincodemayo"]], ["baptisteday", ["bapteme", "baptême"]], ["usindependenceday", ["l'independanceamericaine", "lindépendanceaméricaine"]], ["independenceday", ["l'indépendance", "lindependance"]], ["bastilleday", ["laprisedelabastille", "bastille"]], ["halloweenday", ["halloween"]], ["allhallowday", ["allhallowday"]], ["allsoulsday", ["allsoulsday"]], ["guyfawkesday", ["guyfawkesday"]], ["veteransday", ["veteransday"]], ["christmaseve", ["reveillondenoel", "réveillondenoël", "veilledenoel", "veilledenoël"]], ["newyeareve", ["réveillondenouvelan", "reveillondenouvelan", "lasaint-sylvestre", "lasaintsylvestre"]]]); + FrenchDateTime.NightRegex = `\\b(minuit|nuit)\\b`; + FrenchDateTime.WrittenDecades = new Map([["", 0]]); + FrenchDateTime.SpecialDecadeCases = new Map([["", 0]]); + FrenchDateTime.DefaultLanguageFallback = 'DMY'; + FrenchDateTime.DurationDateRestrictions = []; +})(FrenchDateTime = exports.FrenchDateTime || (exports.FrenchDateTime = {})); + +}); + +unwrapExports(frenchDateTime); + +var durationConfiguration$4 = createCommonjsModule(function (module, exports) { +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); + + + +class FrenchDurationExtractorConfiguration { + constructor() { + this.allRegex = recognizersText.RegExpUtility.getSafeRegExp(frenchDateTime.FrenchDateTime.AllRegex, "gis"); + this.halfRegex = recognizersText.RegExpUtility.getSafeRegExp(frenchDateTime.FrenchDateTime.HalfRegex, "gis"); + this.followedUnit = recognizersText.RegExpUtility.getSafeRegExp(frenchDateTime.FrenchDateTime.DurationFollowedUnit, "gis"); + this.numberCombinedWithUnit = recognizersText.RegExpUtility.getSafeRegExp(frenchDateTime.FrenchDateTime.NumberCombinedWithDurationUnit, "gis"); + this.anUnitRegex = recognizersText.RegExpUtility.getSafeRegExp(frenchDateTime.FrenchDateTime.AnUnitRegex, "gis"); + this.inexactNumberUnitRegex = recognizersText.RegExpUtility.getSafeRegExp(frenchDateTime.FrenchDateTime.InexactNumberUnitRegex, "gis"); + this.suffixAndRegex = recognizersText.RegExpUtility.getSafeRegExp(frenchDateTime.FrenchDateTime.SuffixAndRegex, "gis"); + this.relativeDurationUnitRegex = recognizersText.RegExpUtility.getSafeRegExp(frenchDateTime.FrenchDateTime.RelativeDurationUnitRegex, "gis"); + this.moreThanRegex = recognizersText.RegExpUtility.getSafeRegExp(frenchDateTime.FrenchDateTime.MoreThanRegex, "gis"); + this.lessThanRegex = recognizersText.RegExpUtility.getSafeRegExp(frenchDateTime.FrenchDateTime.LessThanOneHour, "gis"); + this.cardinalExtractor = new recognizersTextNumber.FrenchCardinalExtractor(); + } +} +exports.FrenchDurationExtractorConfiguration = FrenchDurationExtractorConfiguration; +class FrenchDurationParserConfiguration { + constructor(config) { + this.cardinalExtractor = config.cardinalExtractor; + this.numberParser = config.numberParser; + this.followedUnit = recognizersText.RegExpUtility.getSafeRegExp(frenchDateTime.FrenchDateTime.DurationFollowedUnit); + this.suffixAndRegex = recognizersText.RegExpUtility.getSafeRegExp(frenchDateTime.FrenchDateTime.SuffixAndRegex); + this.numberCombinedWithUnit = recognizersText.RegExpUtility.getSafeRegExp(frenchDateTime.FrenchDateTime.NumberCombinedWithDurationUnit); + this.anUnitRegex = recognizersText.RegExpUtility.getSafeRegExp(frenchDateTime.FrenchDateTime.AnUnitRegex); + this.allDateUnitRegex = recognizersText.RegExpUtility.getSafeRegExp(frenchDateTime.FrenchDateTime.AllRegex); + this.halfDateUnitRegex = recognizersText.RegExpUtility.getSafeRegExp(frenchDateTime.FrenchDateTime.HalfRegex); + this.inexactNumberUnitRegex = recognizersText.RegExpUtility.getSafeRegExp(frenchDateTime.FrenchDateTime.InexactNumberUnitRegex); + this.unitMap = config.unitMap; + this.unitValueMap = config.unitValueMap; + this.doubleNumbers = config.doubleNumbers; + } +} +exports.FrenchDurationParserConfiguration = FrenchDurationParserConfiguration; + +}); + +unwrapExports(durationConfiguration$4); + +var timeConfiguration$4 = createCommonjsModule(function (module, exports) { +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); + + + + +class FrenchTimeExtractorConfiguration { + constructor() { + this.atRegex = recognizersText.RegExpUtility.getSafeRegExp(frenchDateTime.FrenchDateTime.AtRegex, "gis"); + this.ishRegex = recognizersText.RegExpUtility.getSafeRegExp(frenchDateTime.FrenchDateTime.IshRegex, "gis"); + + this.timeRegexList = FrenchTimeExtractorConfiguration.getTimeRegexList(); + this.durationExtractor = new baseDuration.BaseDurationExtractor(new durationConfiguration$4.FrenchDurationExtractorConfiguration()); + } + static getTimeRegexList() { + return [ + recognizersText.RegExpUtility.getSafeRegExp(frenchDateTime.FrenchDateTime.TimeRegex1, "gis"), + recognizersText.RegExpUtility.getSafeRegExp(frenchDateTime.FrenchDateTime.TimeRegex2, "gis"), + recognizersText.RegExpUtility.getSafeRegExp(frenchDateTime.FrenchDateTime.TimeRegex3, "gis"), + recognizersText.RegExpUtility.getSafeRegExp(frenchDateTime.FrenchDateTime.TimeRegex4, "gis"), + recognizersText.RegExpUtility.getSafeRegExp(frenchDateTime.FrenchDateTime.TimeRegex5, "gis"), + recognizersText.RegExpUtility.getSafeRegExp(frenchDateTime.FrenchDateTime.TimeRegex6, "gis"), + recognizersText.RegExpUtility.getSafeRegExp(frenchDateTime.FrenchDateTime.TimeRegex7, "gis"), + recognizersText.RegExpUtility.getSafeRegExp(frenchDateTime.FrenchDateTime.TimeRegex8, "gis"), + recognizersText.RegExpUtility.getSafeRegExp(frenchDateTime.FrenchDateTime.TimeRegex9, "gis"), + recognizersText.RegExpUtility.getSafeRegExp(frenchDateTime.FrenchDateTime.TimeRegex10, "gis"), + recognizersText.RegExpUtility.getSafeRegExp(frenchDateTime.FrenchDateTime.ConnectNumRegex, "gis") + ]; + } +} +exports.FrenchTimeExtractorConfiguration = FrenchTimeExtractorConfiguration; +class FrenchTimeParserConfiguration { + constructor(config) { + this.timeTokenPrefix = frenchDateTime.FrenchDateTime.TimeTokenPrefix; + this.atRegex = recognizersText.RegExpUtility.getSafeRegExp(frenchDateTime.FrenchDateTime.AtRegex, "gis"); + this.timeRegexes = FrenchTimeExtractorConfiguration.getTimeRegexList(); + this.lessThanOneHour = recognizersText.RegExpUtility.getSafeRegExp(frenchDateTime.FrenchDateTime.LessThanOneHour, "gis"); + this.timeSuffix = recognizersText.RegExpUtility.getSafeRegExp(frenchDateTime.FrenchDateTime.TimeSuffix, "gis"); + this.utilityConfiguration = config.utilityConfiguration; + this.numbers = config.numbers; + } + adjustByPrefix(prefix, adjust) { + let deltaMin = 0; + let trimedPrefix = prefix.trim().toLowerCase(); + if (trimedPrefix.endsWith("demie")) { + deltaMin = 30; + } + else if (trimedPrefix.endsWith("un quart") || trimedPrefix.endsWith("quart")) { + deltaMin = 15; + } + else if (trimedPrefix.endsWith("trois quarts")) { + deltaMin = 45; + } + else { + let matches = recognizersText.RegExpUtility.getMatches(this.lessThanOneHour, trimedPrefix); + if (matches.length) { + let match = matches[0]; + let minStr = match.groups("deltamin").value; + if (minStr) { + deltaMin = parseInt(minStr, 10); + } + else { + minStr = match.groups("deltaminnum").value.toLowerCase(); + if (this.numbers.has(minStr)) { + deltaMin = this.numbers.get(minStr); + } + } + } + } + if (trimedPrefix.endsWith("à")) { + deltaMin = -deltaMin; + } + adjust.min += deltaMin; + if (adjust.min < 0) { + adjust.min += 60; + adjust.hour -= 1; + } + adjust.hasMin = true; + } + adjustBySuffix(suffix, adjust) { + let trimedSuffix = suffix.trim().toLowerCase(); + let deltaHour = 0; + let matches = recognizersText.RegExpUtility.getMatches(this.timeSuffix, trimedSuffix); + if (matches.length) { + let match = matches[0]; + if (match.index === 0 && match.length === trimedSuffix.length) { + let oclockStr = match.groups("heures").value; + if (!oclockStr) { + let amStr = match.groups("am").value; + if (amStr) { + if (adjust.hour >= 12) { + deltaHour = -12; + } + adjust.hasAm = true; + } + let pmStr = match.groups("pm").value; + if (pmStr) { + if (adjust.hour < 12) { + deltaHour = 12; + } + adjust.hasPm = true; + } + } + } + } + adjust.hour = (adjust.hour + deltaHour) % 24; + } +} +exports.FrenchTimeParserConfiguration = FrenchTimeParserConfiguration; + +}); + +unwrapExports(timeConfiguration$4); + +var dateTimeConfiguration$4 = createCommonjsModule(function (module, exports) { +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); + + + + + + + + + +class FrenchDateTimeExtractorConfiguration { + constructor() { + this.prepositionRegex = recognizersText.RegExpUtility.getSafeRegExp(frenchDateTime.FrenchDateTime.PrepositionRegex, "gis"); + this.nowRegex = recognizersText.RegExpUtility.getSafeRegExp(frenchDateTime.FrenchDateTime.NowRegex, "gis"); + this.suffixRegex = recognizersText.RegExpUtility.getSafeRegExp(frenchDateTime.FrenchDateTime.SuffixRegex, "gis"); + this.timeOfDayRegex = recognizersText.RegExpUtility.getSafeRegExp(frenchDateTime.FrenchDateTime.TimeOfDayRegex, "gis"); + this.specificTimeOfDayRegex = recognizersText.RegExpUtility.getSafeRegExp(frenchDateTime.FrenchDateTime.SpecificTimeOfDayRegex, "gis"); + this.timeOfTodayAfterRegex = recognizersText.RegExpUtility.getSafeRegExp(frenchDateTime.FrenchDateTime.TimeOfTodayAfterRegex, "gis"); + this.timeOfTodayBeforeRegex = recognizersText.RegExpUtility.getSafeRegExp(frenchDateTime.FrenchDateTime.TimeOfTodayBeforeRegex, "gis"); + this.simpleTimeOfTodayAfterRegex = recognizersText.RegExpUtility.getSafeRegExp(frenchDateTime.FrenchDateTime.SimpleTimeOfTodayAfterRegex, "gis"); + this.simpleTimeOfTodayBeforeRegex = recognizersText.RegExpUtility.getSafeRegExp(frenchDateTime.FrenchDateTime.SimpleTimeOfTodayBeforeRegex, "gis"); + this.theEndOfRegex = recognizersText.RegExpUtility.getSafeRegExp(frenchDateTime.FrenchDateTime.TheEndOfRegex, "gis"); + this.unitRegex = recognizersText.RegExpUtility.getSafeRegExp(frenchDateTime.FrenchDateTime.TimeUnitRegex, "gis"); + this.connectorRegex = recognizersText.RegExpUtility.getSafeRegExp(frenchDateTime.FrenchDateTime.ConnectorRegex, "gis"); + this.nightRegex = recognizersText.RegExpUtility.getSafeRegExp(frenchDateTime.FrenchDateTime.NightRegex, "gis"); + this.datePointExtractor = new baseDate.BaseDateExtractor(new dateConfiguration$4.FrenchDateExtractorConfiguration()); + this.timePointExtractor = new baseTime.BaseTimeExtractor(new timeConfiguration$4.FrenchTimeExtractorConfiguration()); + this.durationExtractor = new baseDuration.BaseDurationExtractor(new durationConfiguration$4.FrenchDurationExtractorConfiguration()); + this.utilityConfiguration = new baseConfiguration$4.FrenchDateTimeUtilityConfiguration(); + } + isConnectorToken(source) { + return (source === "" || source === "," || + recognizersText.RegExpUtility.getFirstMatchIndex(this.prepositionRegex, source).matched || + source === "t" || + source === "pour" || + source === "vers"); + } +} +exports.FrenchDateTimeExtractorConfiguration = FrenchDateTimeExtractorConfiguration; +class FrenchDateTimeParserConfiguration { + constructor(config) { + this.tokenBeforeDate = frenchDateTime.FrenchDateTime.TokenBeforeDate; + this.tokenBeforeTime = frenchDateTime.FrenchDateTime.TokenBeforeTime; + this.nowRegex = recognizersText.RegExpUtility.getSafeRegExp(frenchDateTime.FrenchDateTime.NowRegex, "gis"); + this.amTimeRegex = recognizersText.RegExpUtility.getSafeRegExp(frenchDateTime.FrenchDateTime.AMTimeRegex, "gis"); + this.pmTimeRegex = recognizersText.RegExpUtility.getSafeRegExp(frenchDateTime.FrenchDateTime.PMTimeRegex, "gis"); + this.simpleTimeOfTodayAfterRegex = recognizersText.RegExpUtility.getSafeRegExp(frenchDateTime.FrenchDateTime.SimpleTimeOfTodayAfterRegex, "gis"); + this.simpleTimeOfTodayBeforeRegex = recognizersText.RegExpUtility.getSafeRegExp(frenchDateTime.FrenchDateTime.SimpleTimeOfTodayBeforeRegex, "gis"); + this.specificTimeOfDayRegex = recognizersText.RegExpUtility.getSafeRegExp(frenchDateTime.FrenchDateTime.SpecificTimeOfDayRegex, "gis"); + this.theEndOfRegex = recognizersText.RegExpUtility.getSafeRegExp(frenchDateTime.FrenchDateTime.TheEndOfRegex, "gis"); + this.unitRegex = recognizersText.RegExpUtility.getSafeRegExp(frenchDateTime.FrenchDateTime.TimeUnitRegex, "gis"); + this.dateExtractor = config.dateExtractor; + this.timeExtractor = config.timeExtractor; + this.dateParser = config.dateParser; + this.timeParser = config.timeParser; + this.numbers = config.numbers; + this.cardinalExtractor = config.cardinalExtractor; + this.numberParser = config.numberParser; + this.durationExtractor = config.durationExtractor; + this.durationParser = config.durationParser; + this.unitMap = config.unitMap; + this.utilityConfiguration = config.utilityConfiguration; + } + haveAmbiguousToken(text, matchedText) { + return false; + } + getMatchedNowTimex(text) { + let trimedText = text.trim().toLowerCase(); + let timex = ""; + if (trimedText.endsWith("maintenant")) { + timex = "PRESENT_REF"; + } + else if (trimedText === "récemment" || + trimedText === "précédemment" || + trimedText === "auparavant") { + timex = "PAST_REF"; + } + else if (trimedText === "dès que possible" || + trimedText === "dqp") { + timex = "FUTURE_REF"; + } + else { + return { + matched: false, + timex: null + }; + } + return { + matched: true, + timex: timex + }; + } + getSwiftDay(text) { + let trimedText = text.trim().toLowerCase(); + let swift = 0; + if (trimedText.startsWith("prochain") || + trimedText.endsWith("prochain") || + trimedText.startsWith("prochaine") || + trimedText.endsWith("prochaine")) { + swift = 1; + } + else if (trimedText.startsWith("dernier") || + trimedText.startsWith("dernière") || + trimedText.endsWith("dernier") || + trimedText.endsWith("dernière")) { + swift = -1; + } + return swift; + } + getHour(text, hour) { + let trimedText = text.trim().toLowerCase(); + let result = hour; + // TODO: Replace with a regex + if (trimedText.endsWith("matin") && hour >= 12) { + result -= 12; + } + else if (!trimedText.endsWith("matin") && hour < 12) { + result += 12; + } + return result; + } +} +exports.FrenchDateTimeParserConfiguration = FrenchDateTimeParserConfiguration; + +}); + +unwrapExports(dateTimeConfiguration$4); + +var datePeriodConfiguration$4 = createCommonjsModule(function (module, exports) { +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); + + + + + + + + +class FrenchDatePeriodExtractorConfiguration { + constructor() { + this.simpleCasesRegexes = [ + recognizersText.RegExpUtility.getSafeRegExp(frenchDateTime.FrenchDateTime.SimpleCasesRegex), + recognizersText.RegExpUtility.getSafeRegExp(frenchDateTime.FrenchDateTime.BetweenRegex), + recognizersText.RegExpUtility.getSafeRegExp(frenchDateTime.FrenchDateTime.OneWordPeriodRegex), + recognizersText.RegExpUtility.getSafeRegExp(frenchDateTime.FrenchDateTime.MonthWithYear), + recognizersText.RegExpUtility.getSafeRegExp(frenchDateTime.FrenchDateTime.MonthNumWithYear), + recognizersText.RegExpUtility.getSafeRegExp(frenchDateTime.FrenchDateTime.YearRegex), + recognizersText.RegExpUtility.getSafeRegExp(frenchDateTime.FrenchDateTime.WeekDayOfMonthRegex), + recognizersText.RegExpUtility.getSafeRegExp(frenchDateTime.FrenchDateTime.WeekOfYearRegex), + recognizersText.RegExpUtility.getSafeRegExp(frenchDateTime.FrenchDateTime.MonthFrontBetweenRegex), + recognizersText.RegExpUtility.getSafeRegExp(frenchDateTime.FrenchDateTime.MonthFrontSimpleCasesRegex), + recognizersText.RegExpUtility.getSafeRegExp(frenchDateTime.FrenchDateTime.QuarterRegex), + recognizersText.RegExpUtility.getSafeRegExp(frenchDateTime.FrenchDateTime.QuarterRegexYearFront), + recognizersText.RegExpUtility.getSafeRegExp(frenchDateTime.FrenchDateTime.AllHalfYearRegex), + recognizersText.RegExpUtility.getSafeRegExp(frenchDateTime.FrenchDateTime.SeasonRegex), + recognizersText.RegExpUtility.getSafeRegExp(frenchDateTime.FrenchDateTime.PastSuffixRegex), + recognizersText.RegExpUtility.getSafeRegExp(frenchDateTime.FrenchDateTime.NextSuffixRegex), + recognizersText.RegExpUtility.getSafeRegExp(frenchDateTime.FrenchDateTime.ThisPrefixRegex), + recognizersText.RegExpUtility.getSafeRegExp(frenchDateTime.FrenchDateTime.LaterEarlyPeriodRegex), + recognizersText.RegExpUtility.getSafeRegExp(frenchDateTime.FrenchDateTime.WeekWithWeekDayRangeRegex) + ]; + this.illegalYearRegex = recognizersText.RegExpUtility.getSafeRegExp(baseDateTime.BaseDateTime.IllegalYearRegex); + this.YearRegex = recognizersText.RegExpUtility.getSafeRegExp(frenchDateTime.FrenchDateTime.YearRegex); + this.tillRegex = recognizersText.RegExpUtility.getSafeRegExp(frenchDateTime.FrenchDateTime.TillRegex); + this.followedUnit = recognizersText.RegExpUtility.getSafeRegExp(frenchDateTime.FrenchDateTime.FollowedDateUnit); + this.numberCombinedWithUnit = recognizersText.RegExpUtility.getSafeRegExp(frenchDateTime.FrenchDateTime.NumberCombinedWithDateUnit); + this.pastRegex = recognizersText.RegExpUtility.getSafeRegExp(frenchDateTime.FrenchDateTime.PastSuffixRegex); + this.futureRegex = recognizersText.RegExpUtility.getSafeRegExp(frenchDateTime.FrenchDateTime.NextSuffixRegex); + this.weekOfRegex = recognizersText.RegExpUtility.getSafeRegExp(frenchDateTime.FrenchDateTime.WeekOfRegex); + this.monthOfRegex = recognizersText.RegExpUtility.getSafeRegExp(frenchDateTime.FrenchDateTime.MonthOfRegex); + this.dateUnitRegex = recognizersText.RegExpUtility.getSafeRegExp(frenchDateTime.FrenchDateTime.DateUnitRegex); + this.inConnectorRegex = recognizersText.RegExpUtility.getSafeRegExp(frenchDateTime.FrenchDateTime.InConnectorRegex); + this.rangeUnitRegex = recognizersText.RegExpUtility.getSafeRegExp(frenchDateTime.FrenchDateTime.RangeUnitRegex); + this.weekDayOfMonthRegex = recognizersText.RegExpUtility.getSafeRegExp(frenchDateTime.FrenchDateTime.WeekDayOfMonthRegex); + this.fromRegex = recognizersText.RegExpUtility.getSafeRegExp(frenchDateTime.FrenchDateTime.FromRegex); + this.connectorAndRegex = recognizersText.RegExpUtility.getSafeRegExp(frenchDateTime.FrenchDateTime.ConnectorAndRegex); + this.beforeRegex = recognizersText.RegExpUtility.getSafeRegExp(frenchDateTime.FrenchDateTime.BeforeRegex2); + this.datePointExtractor = new baseDate.BaseDateExtractor(new dateConfiguration$4.FrenchDateExtractorConfiguration()); + this.integerExtractor = new recognizersTextNumber.FrenchIntegerExtractor(); + this.numberParser = new recognizersTextNumber.BaseNumberParser(new recognizersTextNumber.FrenchNumberParserConfiguration()); + this.durationExtractor = new baseDuration.BaseDurationExtractor(new durationConfiguration$4.FrenchDurationExtractorConfiguration()); + } + getFromTokenIndex(source) { + return recognizersText.RegExpUtility.getFirstMatchIndex(this.fromRegex, source); + } + getBetweenTokenIndex(source) { + return recognizersText.RegExpUtility.getFirstMatchIndex(this.beforeRegex, source); + } + hasConnectorToken(source) { + return recognizersText.RegExpUtility.getFirstMatchIndex(this.connectorAndRegex, source).matched; + } +} +exports.FrenchDatePeriodExtractorConfiguration = FrenchDatePeriodExtractorConfiguration; +class FrenchDatePeriodParserConfiguration { + constructor(config) { + this.tokenBeforeDate = frenchDateTime.FrenchDateTime.TokenBeforeDate; + this.cardinalExtractor = config.cardinalExtractor; + this.numberParser = config.numberParser; + this.durationExtractor = config.durationExtractor; + this.dateExtractor = config.dateExtractor; + this.durationParser = config.durationParser; + this.dateParser = config.dateParser; + this.monthFrontBetweenRegex = recognizersText.RegExpUtility.getSafeRegExp(frenchDateTime.FrenchDateTime.MonthFrontBetweenRegex); + this.betweenRegex = recognizersText.RegExpUtility.getSafeRegExp(frenchDateTime.FrenchDateTime.BetweenRegex); + this.monthFrontSimpleCasesRegex = recognizersText.RegExpUtility.getSafeRegExp(frenchDateTime.FrenchDateTime.MonthFrontSimpleCasesRegex); + this.simpleCasesRegex = recognizersText.RegExpUtility.getSafeRegExp(frenchDateTime.FrenchDateTime.SimpleCasesRegex); + this.oneWordPeriodRegex = recognizersText.RegExpUtility.getSafeRegExp(frenchDateTime.FrenchDateTime.OneWordPeriodRegex); + this.monthWithYear = recognizersText.RegExpUtility.getSafeRegExp(frenchDateTime.FrenchDateTime.MonthWithYear); + this.monthNumWithYear = recognizersText.RegExpUtility.getSafeRegExp(frenchDateTime.FrenchDateTime.MonthNumWithYear); + this.yearRegex = recognizersText.RegExpUtility.getSafeRegExp(frenchDateTime.FrenchDateTime.YearRegex); + this.pastRegex = recognizersText.RegExpUtility.getSafeRegExp(frenchDateTime.FrenchDateTime.PastSuffixRegex); + this.futureRegex = recognizersText.RegExpUtility.getSafeRegExp(frenchDateTime.FrenchDateTime.NextSuffixRegex); + this.numberCombinedWithUnit = recognizersText.RegExpUtility.getSafeRegExp(frenchDateTime.FrenchDateTime.NumberCombinedWithDurationUnit); + this.weekOfMonthRegex = recognizersText.RegExpUtility.getSafeRegExp(frenchDateTime.FrenchDateTime.WeekOfMonthRegex); + this.weekOfYearRegex = recognizersText.RegExpUtility.getSafeRegExp(frenchDateTime.FrenchDateTime.WeekOfYearRegex); + this.quarterRegex = recognizersText.RegExpUtility.getSafeRegExp(frenchDateTime.FrenchDateTime.QuarterRegex); + this.quarterRegexYearFront = recognizersText.RegExpUtility.getSafeRegExp(frenchDateTime.FrenchDateTime.QuarterRegexYearFront); + this.allHalfYearRegex = recognizersText.RegExpUtility.getSafeRegExp(frenchDateTime.FrenchDateTime.AllHalfYearRegex); + this.seasonRegex = recognizersText.RegExpUtility.getSafeRegExp(frenchDateTime.FrenchDateTime.SeasonRegex); + this.whichWeekRegex = recognizersText.RegExpUtility.getSafeRegExp(frenchDateTime.FrenchDateTime.WhichWeekRegex); + this.weekOfRegex = recognizersText.RegExpUtility.getSafeRegExp(frenchDateTime.FrenchDateTime.WeekOfRegex); + this.monthOfRegex = recognizersText.RegExpUtility.getSafeRegExp(frenchDateTime.FrenchDateTime.MonthOfRegex); + this.restOfDateRegex = recognizersText.RegExpUtility.getSafeRegExp(frenchDateTime.FrenchDateTime.RestOfDateRegex); + this.nextPrefixRegex = recognizersText.RegExpUtility.getSafeRegExp("(prochain|prochaine)\b"); + this.pastPrefixRegex = recognizersText.RegExpUtility.getSafeRegExp("(dernier)\b"); + this.thisPrefixRegex = recognizersText.RegExpUtility.getSafeRegExp("(ce|cette)\b"); + this.inConnectorRegex = config.utilityConfiguration.inConnectorRegex; + this.unitMap = config.unitMap; + this.cardinalMap = config.cardinalMap; + this.dayOfMonth = config.dayOfMonth; + this.monthOfYear = config.monthOfYear; + this.seasonMap = config.seasonMap; + } + getSwiftDayOrMonth(source) { + let trimedText = source.trim().toLowerCase(); + let swift = 0; + if (trimedText.endsWith("prochain") || trimedText.endsWith("prochaine")) { + swift = 1; + } + if (trimedText.endsWith("dernière") || + trimedText.endsWith("dernières") || + trimedText.endsWith("derniere") || + trimedText.endsWith("dernieres")) { + swift = -1; + } + return swift; + } + getSwiftYear(source) { + let trimedText = source.trim().toLowerCase(); + let swift = -10; + if (trimedText.endsWith("prochain") || trimedText.endsWith("prochaine")) { + swift = 1; + } + if (trimedText.endsWith("dernières") || + trimedText.endsWith("dernière") || + trimedText.endsWith("dernieres") || + trimedText.endsWith("derniere") || + trimedText.endsWith("dernier")) { + swift = -1; + } + else if (trimedText.startsWith("cette")) { + swift = 0; + } + return swift; + } + isFuture(source) { + let trimedText = source.trim().toLowerCase(); + return (trimedText.startsWith("cette") || + trimedText.endsWith("prochaine") || + trimedText.endsWith("prochain")); + } + isYearToDate(source) { + let trimedText = source.trim().toLowerCase(); + return (trimedText === "année à ce jour" || + trimedText === "an à ce jour"); + } + isMonthToDate(source) { + let trimedText = source.trim().toLowerCase(); + return trimedText === "mois à ce jour"; + } + isWeekOnly(source) { + let trimedText = source.trim().toLowerCase(); + return (trimedText.endsWith("semaine") && + !trimedText.endsWith("fin de semaine")); + } + isWeekend(source) { + let trimedText = source.trim().toLowerCase(); + return (trimedText.endsWith("fin de semaine") || + trimedText.endsWith("le weekend")); + } + isMonthOnly(source) { + let trimedText = source.trim().toLowerCase(); + return trimedText.endsWith("mois"); + } + isYearOnly(source) { + let trimedText = source.trim().toLowerCase(); + return (trimedText.endsWith("années") || + trimedText.endsWith("ans") || + (trimedText.endsWith("l'annees") || + trimedText.endsWith("l'annee"))); + } + isLastCardinal(source) { + let trimedText = source.trim().toLowerCase(); + return (trimedText === "dernières" || + trimedText === "dernière" || + trimedText === "dernieres" || + trimedText === "derniere" || + trimedText === "dernier"); + } +} +exports.FrenchDatePeriodParserConfiguration = FrenchDatePeriodParserConfiguration; + +}); + +unwrapExports(datePeriodConfiguration$4); + +var timePeriodConfiguration$4 = createCommonjsModule(function (module, exports) { +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); + + + + + + +class FrenchTimePeriodExtractorConfiguration { + constructor() { + this.singleTimeExtractor = new baseTime.BaseTimeExtractor(new timeConfiguration$4.FrenchTimeExtractorConfiguration()); + this.integerExtractor = new recognizersTextNumber.EnglishIntegerExtractor(); + this.utilityConfiguration = new baseConfiguration$4.FrenchDateTimeUtilityConfiguration(); + this.simpleCasesRegex = [ + recognizersText.RegExpUtility.getSafeRegExp(frenchDateTime.FrenchDateTime.PureNumFromTo, "gis"), + recognizersText.RegExpUtility.getSafeRegExp(frenchDateTime.FrenchDateTime.PureNumBetweenAnd, "gis"), + recognizersText.RegExpUtility.getSafeRegExp(frenchDateTime.FrenchDateTime.PmRegex, "gis"), + recognizersText.RegExpUtility.getSafeRegExp(frenchDateTime.FrenchDateTime.AmRegex, "gis") + ]; + this.tillRegex = recognizersText.RegExpUtility.getSafeRegExp(frenchDateTime.FrenchDateTime.TillRegex, "gis"); + this.timeOfDayRegex = recognizersText.RegExpUtility.getSafeRegExp(frenchDateTime.FrenchDateTime.TimeOfDayRegex, "gis"); + this.generalEndingRegex = recognizersText.RegExpUtility.getSafeRegExp(frenchDateTime.FrenchDateTime.GeneralEndingRegex, "gis"); + this.fromRegex = recognizersText.RegExpUtility.getSafeRegExp(frenchDateTime.FrenchDateTime.FromRegex2, "gis"); + this.connectorAndRegex = recognizersText.RegExpUtility.getSafeRegExp(frenchDateTime.FrenchDateTime.ConnectorAndRegex, "gis"); + this.beforeRegex = recognizersText.RegExpUtility.getSafeRegExp(frenchDateTime.FrenchDateTime.BeforeRegex2, "gis"); + } + getFromTokenIndex(text) { + return recognizersText.RegExpUtility.getFirstMatchIndex(this.fromRegex, text); + } + hasConnectorToken(text) { + return recognizersText.RegExpUtility.getFirstMatchIndex(this.connectorAndRegex, text).matched; + } + getBetweenTokenIndex(text) { + return recognizersText.RegExpUtility.getFirstMatchIndex(this.beforeRegex, text); + } +} +exports.FrenchTimePeriodExtractorConfiguration = FrenchTimePeriodExtractorConfiguration; +class FrenchTimePeriodParserConfiguration { + constructor(config) { + this.timeExtractor = config.timeExtractor; + this.timeParser = config.timeParser; + this.integerExtractor = config.integerExtractor; + this.numbers = config.numbers; + this.utilityConfiguration = config.utilityConfiguration; + this.pureNumberFromToRegex = recognizersText.RegExpUtility.getSafeRegExp(frenchDateTime.FrenchDateTime.PureNumFromTo, "gis"); + this.pureNumberBetweenAndRegex = recognizersText.RegExpUtility.getSafeRegExp(frenchDateTime.FrenchDateTime.PureNumBetweenAnd, "gis"); + this.timeOfDayRegex = recognizersText.RegExpUtility.getSafeRegExp(frenchDateTime.FrenchDateTime.TimeOfDayRegex, "gis"); + this.tillRegex = recognizersText.RegExpUtility.getSafeRegExp(frenchDateTime.FrenchDateTime.TillRegex, "gis"); + this.specificTimeFromToRegex = recognizersText.RegExpUtility.getSafeRegExp(frenchDateTime.FrenchDateTime.SpecificTimeFromTo); + this.specificTimeBetweenAndRegex = recognizersText.RegExpUtility.getSafeRegExp(frenchDateTime.FrenchDateTime.SpecificTimeBetweenAnd); + } + getMatchedTimexRange(text) { + let trimedText = text.trim().toLowerCase(); + if (trimedText.endsWith("s")) { + trimedText = trimedText.substring(0, trimedText.length - 1); + } + let beginHour = 0; + let endHour = 0; + let endMin = 0; + let timex = ""; + if (trimedText.endsWith("matinee") || + trimedText.endsWith("matin") || + trimedText.endsWith("matinée")) { + timex = "TMO"; + beginHour = 8; + endHour = 12; + } + else if (trimedText.endsWith("apres-midi") || + trimedText.endsWith("apres midi") || + trimedText.endsWith("après midi") || + trimedText.endsWith("après-midi")) { + timex = "TAF"; + beginHour = 12; + endHour = 16; + } + else if (trimedText.endsWith("soir") || + trimedText.endsWith("soiree") || + trimedText.endsWith("soirée")) { + timex = "TEV"; + beginHour = 16; + endHour = 20; + } + else if (trimedText === "jour" || + trimedText.endsWith("journee") || + trimedText.endsWith("journée")) { + timex = "TDT"; + beginHour = 8; + endHour = 18; + } + else if (trimedText.endsWith("nuit")) { + timex = "TNI"; + beginHour = 20; + endHour = 23; + endMin = 59; + } + else { + timex = null; + return { + matched: false, + timex, + beginHour, + endHour, + endMin + }; + } + return { + matched: true, + timex, + beginHour, + endHour, + endMin + }; + } +} +exports.FrenchTimePeriodParserConfiguration = FrenchTimePeriodParserConfiguration; + +}); + +unwrapExports(timePeriodConfiguration$4); + +var dateTimePeriodConfiguration$4 = createCommonjsModule(function (module, exports) { +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); + + + + + + + + + + + + + +class FrenchDateTimePeriodExtractorConfiguration { + constructor() { + this.simpleCasesRegexes = [ + recognizersText.RegExpUtility.getSafeRegExp(frenchDateTime.FrenchDateTime.PureNumFromTo), + recognizersText.RegExpUtility.getSafeRegExp(frenchDateTime.FrenchDateTime.PureNumBetweenAnd), + recognizersText.RegExpUtility.getSafeRegExp(frenchDateTime.FrenchDateTime.SpecificTimeOfDayRegex) + ]; + this.prepositionRegex = recognizersText.RegExpUtility.getSafeRegExp(frenchDateTime.FrenchDateTime.PrepositionRegex); + this.tillRegex = recognizersText.RegExpUtility.getSafeRegExp(frenchDateTime.FrenchDateTime.TillRegex); + this.specificTimeOfDayRegex = recognizersText.RegExpUtility.getSafeRegExp(frenchDateTime.FrenchDateTime.PeriodSpecificTimeOfDayRegex); + this.timeOfDayRegex = recognizersText.RegExpUtility.getSafeRegExp(frenchDateTime.FrenchDateTime.PeriodTimeOfDayRegex); + this.followedUnit = recognizersText.RegExpUtility.getSafeRegExp(frenchDateTime.FrenchDateTime.TimeFollowedUnit); + this.timeUnitRegex = recognizersText.RegExpUtility.getSafeRegExp(frenchDateTime.FrenchDateTime.TimeUnitRegex); + this.pastPrefixRegex = recognizersText.RegExpUtility.getSafeRegExp(frenchDateTime.FrenchDateTime.PastSuffixRegex); + this.nextPrefixRegex = recognizersText.RegExpUtility.getSafeRegExp(frenchDateTime.FrenchDateTime.NextSuffixRegex); + this.numberCombinedWithUnit = recognizersText.RegExpUtility.getSafeRegExp(frenchDateTime.FrenchDateTime.TimeNumberCombinedWithUnit); + this.weekDayRegex = recognizersText.RegExpUtility.getSafeRegExp(frenchDateTime.FrenchDateTime.WeekDayRegex); + this.periodTimeOfDayWithDateRegex = recognizersText.RegExpUtility.getSafeRegExp(frenchDateTime.FrenchDateTime.PeriodTimeOfDayWithDateRegex); + this.relativeTimeUnitRegex = recognizersText.RegExpUtility.getSafeRegExp(frenchDateTime.FrenchDateTime.RelativeTimeUnitRegex); + this.restOfDateTimeRegex = recognizersText.RegExpUtility.getSafeRegExp(frenchDateTime.FrenchDateTime.RestOfDateTimeRegex); + this.generalEndingRegex = recognizersText.RegExpUtility.getSafeRegExp(frenchDateTime.FrenchDateTime.GeneralEndingRegex); + this.middlePauseRegex = recognizersText.RegExpUtility.getSafeRegExp(frenchDateTime.FrenchDateTime.MiddlePauseRegex); + this.fromRegex = recognizersText.RegExpUtility.getSafeRegExp(frenchDateTime.FrenchDateTime.FromRegex2); + this.connectorAndRegex = recognizersText.RegExpUtility.getSafeRegExp(frenchDateTime.FrenchDateTime.ConnectorAndRegex); + this.beforeRegex = recognizersText.RegExpUtility.getSafeRegExp(frenchDateTime.FrenchDateTime.BeforeRegex); + this.cardinalExtractor = new recognizersTextNumber.FrenchCardinalExtractor(); + this.singleDateExtractor = new baseDate.BaseDateExtractor(new dateConfiguration$4.FrenchDateExtractorConfiguration()); + this.singleTimeExtractor = new baseTime.BaseTimeExtractor(new timeConfiguration$4.FrenchTimeExtractorConfiguration()); + this.singleDateTimeExtractor = new baseDateTime$2.BaseDateTimeExtractor(new dateTimeConfiguration$4.FrenchDateTimeExtractorConfiguration()); + this.durationExtractor = new baseDuration.BaseDurationExtractor(new durationConfiguration$4.FrenchDurationExtractorConfiguration()); + this.timePeriodExtractor = new baseTimePeriod.BaseTimePeriodExtractor(new timePeriodConfiguration$4.FrenchTimePeriodExtractorConfiguration()); + } + getFromTokenIndex(source) { + return recognizersText.RegExpUtility.getFirstMatchIndex(this.fromRegex, source); + } + getBetweenTokenIndex(source) { + return recognizersText.RegExpUtility.getFirstMatchIndex(this.beforeRegex, source); + } + hasConnectorToken(source) { + return recognizersText.RegExpUtility.getFirstMatchIndex(this.connectorAndRegex, source).matched; + } +} +exports.FrenchDateTimePeriodExtractorConfiguration = FrenchDateTimePeriodExtractorConfiguration; +class FrenchDateTimePeriodParserConfiguration { + constructor(config) { + this.dateExtractor = config.dateExtractor; + this.timeExtractor = config.timeExtractor; + this.dateTimeExtractor = config.dateTimeExtractor; + this.timePeriodExtractor = config.timePeriodExtractor; + this.cardinalExtractor = config.cardinalExtractor; + this.durationExtractor = config.durationExtractor; + this.numberParser = config.numberParser; + this.dateParser = config.dateParser; + this.timeParser = config.timeParser; + this.dateTimeParser = config.dateTimeParser; + this.timePeriodParser = config.timePeriodParser; + this.durationParser = config.durationParser; + this.unitMap = config.unitMap; + this.numbers = config.numbers; + this.nextPrefixRegex = recognizersText.RegExpUtility.getSafeRegExp(frenchDateTime.FrenchDateTime.NextSuffixRegex); + this.pastPrefixRegex = recognizersText.RegExpUtility.getSafeRegExp(frenchDateTime.FrenchDateTime.PastSuffixRegex); + this.thisPrefixRegex = recognizersText.RegExpUtility.getSafeRegExp(frenchDateTime.FrenchDateTime.ThisPrefixRegex); + this.morningStartEndRegex = recognizersText.RegExpUtility.getSafeRegExp(frenchDateTime.FrenchDateTime.MorningStartEndRegex); + this.afternoonStartEndRegex = recognizersText.RegExpUtility.getSafeRegExp(frenchDateTime.FrenchDateTime.AfternoonStartEndRegex); + this.eveningStartEndRegex = recognizersText.RegExpUtility.getSafeRegExp(frenchDateTime.FrenchDateTime.EveningStartEndRegex); + this.nightStartEndRegex = recognizersText.RegExpUtility.getSafeRegExp(frenchDateTime.FrenchDateTime.NightStartEndRegex); + this.pureNumberFromToRegex = recognizersText.RegExpUtility.getSafeRegExp(frenchDateTime.FrenchDateTime.PureNumFromTo); + this.pureNumberBetweenAndRegex = recognizersText.RegExpUtility.getSafeRegExp(frenchDateTime.FrenchDateTime.PureNumBetweenAnd); + this.specificTimeOfDayRegex = recognizersText.RegExpUtility.getSafeRegExp(frenchDateTime.FrenchDateTime.SpecificTimeOfDayRegex); + this.timeOfDayRegex = recognizersText.RegExpUtility.getSafeRegExp(frenchDateTime.FrenchDateTime.TimeOfDayRegex); + this.pastRegex = recognizersText.RegExpUtility.getSafeRegExp(frenchDateTime.FrenchDateTime.PastSuffixRegex); + this.futureRegex = recognizersText.RegExpUtility.getSafeRegExp(frenchDateTime.FrenchDateTime.NextSuffixRegex); + this.numberCombinedWithUnitRegex = recognizersText.RegExpUtility.getSafeRegExp(frenchDateTime.FrenchDateTime.TimeNumberCombinedWithUnit); + this.unitRegex = recognizersText.RegExpUtility.getSafeRegExp(frenchDateTime.FrenchDateTime.TimeUnitRegex); + this.periodTimeOfDayWithDateRegex = recognizersText.RegExpUtility.getSafeRegExp(frenchDateTime.FrenchDateTime.PeriodTimeOfDayWithDateRegex); + this.relativeTimeUnitRegex = recognizersText.RegExpUtility.getSafeRegExp(frenchDateTime.FrenchDateTime.RelativeTimeUnitRegex); + this.restOfDateTimeRegex = recognizersText.RegExpUtility.getSafeRegExp(frenchDateTime.FrenchDateTime.RestOfDateTimeRegex); + } + getMatchedTimeRange(source) { + let trimedText = source.trim().toLowerCase(); + let timeStr = ""; + let beginHour = 0; + let endHour = 0; + let endMin = 0; + if (recognizersText.RegExpUtility.getFirstMatchIndex(this.morningStartEndRegex, trimedText).matched) { + timeStr = "TMO"; + beginHour = 8; + endHour = 12; + } + else if (recognizersText.RegExpUtility.getFirstMatchIndex(this.afternoonStartEndRegex, trimedText).matched) { + timeStr = "TAF"; + beginHour = 12; + endHour = 16; + } + else if (recognizersText.RegExpUtility.getFirstMatchIndex(this.eveningStartEndRegex, trimedText).matched) { + timeStr = "TEV"; + beginHour = 16; + endHour = 20; + } + else if (recognizersText.RegExpUtility.getFirstMatchIndex(this.nightStartEndRegex, trimedText).matched) { + timeStr = "TNI"; + beginHour = 20; + endHour = 23; + endMin = 59; + } + else { + timeStr = null; + return { + success: false, + timeStr, + beginHour, + endHour, + endMin + }; + } + return { + success: true, + timeStr, + beginHour, + endHour, + endMin + }; + } + getSwiftPrefix(source) { + let trimedText = source.trim().toLowerCase(); + let swift = 0; + // TODO: Replace with a regex + if (trimedText.startsWith("prochain") || + trimedText.endsWith("prochain") || + trimedText.startsWith("prochaine") || + trimedText.endsWith("prochaine")) { + swift = 1; + } + else if (trimedText.startsWith("derniere") || + trimedText.startsWith("dernier") || + trimedText.endsWith("derniere") || + trimedText.endsWith("dernier")) { + swift = -1; + } + return swift; + } +} +exports.FrenchDateTimePeriodParserConfiguration = FrenchDateTimePeriodParserConfiguration; + +}); + +unwrapExports(dateTimePeriodConfiguration$4); + +var baseConfiguration$4 = createCommonjsModule(function (module, exports) { +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); + + + + + + + + + + + + + + + + + + + +class FrenchDateTimeUtilityConfiguration { + constructor() { + this.laterRegex = recognizersText.RegExpUtility.getSafeRegExp(frenchDateTime.FrenchDateTime.LaterRegex); + this.agoRegex = recognizersText.RegExpUtility.getSafeRegExp(frenchDateTime.FrenchDateTime.AgoPrefixRegex); + this.inConnectorRegex = recognizersText.RegExpUtility.getSafeRegExp(frenchDateTime.FrenchDateTime.InConnectorRegex); + this.rangeUnitRegex = recognizersText.RegExpUtility.getSafeRegExp(frenchDateTime.FrenchDateTime.RangeUnitRegex); + this.amDescRegex = recognizersText.RegExpUtility.getSafeRegExp(frenchDateTime.FrenchDateTime.AmDescRegex); + this.pmDescRegex = recognizersText.RegExpUtility.getSafeRegExp(frenchDateTime.FrenchDateTime.PmDescRegex); + this.amPmDescRegex = recognizersText.RegExpUtility.getSafeRegExp(frenchDateTime.FrenchDateTime.AmPmDescRegex); + } +} +exports.FrenchDateTimeUtilityConfiguration = FrenchDateTimeUtilityConfiguration; +class FrenchCommonDateTimeParserConfiguration extends parsers$4.BaseDateParserConfiguration { + constructor() { + super(); + this.utilityConfiguration = new FrenchDateTimeUtilityConfiguration(); + this.unitMap = frenchDateTime.FrenchDateTime.UnitMap; + this.unitValueMap = frenchDateTime.FrenchDateTime.UnitValueMap; + this.seasonMap = frenchDateTime.FrenchDateTime.SeasonMap; + this.cardinalMap = frenchDateTime.FrenchDateTime.CardinalMap; + this.dayOfWeek = frenchDateTime.FrenchDateTime.DayOfWeek; + this.monthOfYear = frenchDateTime.FrenchDateTime.MonthOfYear; + this.numbers = frenchDateTime.FrenchDateTime.Numbers; + this.doubleNumbers = frenchDateTime.FrenchDateTime.DoubleNumbers; + this.cardinalExtractor = new recognizersTextNumber.FrenchCardinalExtractor(); + this.integerExtractor = new recognizersTextNumber.FrenchIntegerExtractor(); + this.ordinalExtractor = new recognizersTextNumber.FrenchOrdinalExtractor(); + this.numberParser = new recognizersTextNumber.BaseNumberParser(new recognizersTextNumber.FrenchNumberParserConfiguration()); + this.dateExtractor = new baseDate.BaseDateExtractor(new dateConfiguration$4.FrenchDateExtractorConfiguration()); + this.timeExtractor = new baseTime.BaseTimeExtractor(new timeConfiguration$4.FrenchTimeExtractorConfiguration()); + this.dateTimeExtractor = new baseDateTime$2.BaseDateTimeExtractor(new dateTimeConfiguration$4.FrenchDateTimeExtractorConfiguration()); + this.durationExtractor = new baseDuration.BaseDurationExtractor(new durationConfiguration$4.FrenchDurationExtractorConfiguration()); + this.datePeriodExtractor = new baseDatePeriod.BaseDatePeriodExtractor(new datePeriodConfiguration$4.FrenchDatePeriodExtractorConfiguration()); + this.timePeriodExtractor = new baseTimePeriod.BaseTimePeriodExtractor(new timePeriodConfiguration$4.FrenchTimePeriodExtractorConfiguration()); + this.dateTimePeriodExtractor = new baseDateTimePeriod.BaseDateTimePeriodExtractor(new dateTimePeriodConfiguration$4.FrenchDateTimePeriodExtractorConfiguration()); + this.durationParser = new baseDuration.BaseDurationParser(new durationConfiguration$4.FrenchDurationParserConfiguration(this)); + this.dateParser = new baseDate.BaseDateParser(new dateConfiguration$4.FrenchDateParserConfiguration(this)); + this.timeParser = new baseTime.BaseTimeParser(new timeConfiguration$4.FrenchTimeParserConfiguration(this)); + this.dateTimeParser = new baseDateTime$2.BaseDateTimeParser(new dateTimeConfiguration$4.FrenchDateTimeParserConfiguration(this)); + this.datePeriodParser = new baseDatePeriod.BaseDatePeriodParser(new datePeriodConfiguration$4.FrenchDatePeriodParserConfiguration(this)); + this.timePeriodParser = new baseTimePeriod.BaseTimePeriodParser(new timePeriodConfiguration$4.FrenchTimePeriodParserConfiguration(this)); + this.dateTimePeriodParser = new baseDateTimePeriod.BaseDateTimePeriodParser(new dateTimePeriodConfiguration$4.FrenchDateTimePeriodParserConfiguration(this)); + this.dayOfMonth = new Map([...baseDateTime.BaseDateTime.DayOfMonthDictionary, ...frenchDateTime.FrenchDateTime.DayOfMonth]); + } +} +exports.FrenchCommonDateTimeParserConfiguration = FrenchCommonDateTimeParserConfiguration; + +}); + +unwrapExports(baseConfiguration$4); + +var dateConfiguration$4 = createCommonjsModule(function (module, exports) { +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); + + + + + + + +class FrenchDateExtractorConfiguration { + constructor() { + this.dateRegexList = [ + recognizersText.RegExpUtility.getSafeRegExp(frenchDateTime.FrenchDateTime.DateExtractor1, "gis"), + recognizersText.RegExpUtility.getSafeRegExp(frenchDateTime.FrenchDateTime.DateExtractor2, "gis"), + recognizersText.RegExpUtility.getSafeRegExp(frenchDateTime.FrenchDateTime.DateExtractor3, "gis"), + frenchDateTime.FrenchDateTime.DefaultLanguageFallback === constants$2.Constants.DefaultLanguageFallback_DMY ? + recognizersText.RegExpUtility.getSafeRegExp(frenchDateTime.FrenchDateTime.DateExtractor5, "gis") : + recognizersText.RegExpUtility.getSafeRegExp(frenchDateTime.FrenchDateTime.DateExtractor4, "gis"), + frenchDateTime.FrenchDateTime.DefaultLanguageFallback === constants$2.Constants.DefaultLanguageFallback_DMY ? + recognizersText.RegExpUtility.getSafeRegExp(frenchDateTime.FrenchDateTime.DateExtractor4, "gis") : + recognizersText.RegExpUtility.getSafeRegExp(frenchDateTime.FrenchDateTime.DateExtractor5, "gis"), + recognizersText.RegExpUtility.getSafeRegExp(frenchDateTime.FrenchDateTime.DateExtractor6, "gis"), + recognizersText.RegExpUtility.getSafeRegExp(frenchDateTime.FrenchDateTime.DateExtractor7, "gis"), + recognizersText.RegExpUtility.getSafeRegExp(frenchDateTime.FrenchDateTime.DateExtractor8, "gis"), + recognizersText.RegExpUtility.getSafeRegExp(frenchDateTime.FrenchDateTime.DateExtractor9, "gis"), + recognizersText.RegExpUtility.getSafeRegExp(frenchDateTime.FrenchDateTime.DateExtractorA, "gis"), + ]; + this.implicitDateList = [ + recognizersText.RegExpUtility.getSafeRegExp(frenchDateTime.FrenchDateTime.OnRegex, "gis"), + recognizersText.RegExpUtility.getSafeRegExp(frenchDateTime.FrenchDateTime.RelaxedOnRegex, "gis"), + recognizersText.RegExpUtility.getSafeRegExp(frenchDateTime.FrenchDateTime.SpecialDayRegex, "gis"), + recognizersText.RegExpUtility.getSafeRegExp(frenchDateTime.FrenchDateTime.ThisRegex, "gis"), + recognizersText.RegExpUtility.getSafeRegExp(frenchDateTime.FrenchDateTime.LastDateRegex, "gis"), + recognizersText.RegExpUtility.getSafeRegExp(frenchDateTime.FrenchDateTime.NextDateRegex, "gis"), + recognizersText.RegExpUtility.getSafeRegExp(frenchDateTime.FrenchDateTime.StrictWeekDay, "gis"), + recognizersText.RegExpUtility.getSafeRegExp(frenchDateTime.FrenchDateTime.WeekDayOfMonthRegex, "gis"), + recognizersText.RegExpUtility.getSafeRegExp(frenchDateTime.FrenchDateTime.SpecialDate, "gis") + ]; + this.monthEnd = recognizersText.RegExpUtility.getSafeRegExp(frenchDateTime.FrenchDateTime.MonthEnd, "gis"); + this.ofMonth = recognizersText.RegExpUtility.getSafeRegExp(frenchDateTime.FrenchDateTime.OfMonth, "gis"); + this.dateUnitRegex = recognizersText.RegExpUtility.getSafeRegExp(frenchDateTime.FrenchDateTime.DateUnitRegex, "gis"); + this.forTheRegex = recognizersText.RegExpUtility.getSafeRegExp(frenchDateTime.FrenchDateTime.ForTheRegex, "gis"); + this.weekDayAndDayOfMonthRegex = recognizersText.RegExpUtility.getSafeRegExp(frenchDateTime.FrenchDateTime.WeekDayAndDayOfMonthRegex, "gis"); + this.relativeMonthRegex = recognizersText.RegExpUtility.getSafeRegExp(frenchDateTime.FrenchDateTime.RelativeMonthRegex, "gis"); + this.weekDayRegex = recognizersText.RegExpUtility.getSafeRegExp(frenchDateTime.FrenchDateTime.WeekDayRegex, "gis"); + this.dayOfWeek = frenchDateTime.FrenchDateTime.DayOfWeek; + this.ordinalExtractor = new recognizersTextNumber.FrenchOrdinalExtractor(); + this.integerExtractor = new recognizersTextNumber.FrenchIntegerExtractor(); + this.numberParser = new recognizersTextNumber.BaseNumberParser(new recognizersTextNumber.FrenchNumberParserConfiguration()); + this.durationExtractor = new baseDuration.BaseDurationExtractor(new durationConfiguration$4.FrenchDurationExtractorConfiguration()); + this.utilityConfiguration = new baseConfiguration$4.FrenchDateTimeUtilityConfiguration(); + this.nonDateUnitRegex = recognizersText.RegExpUtility.getSafeRegExp("(?heure|heures|hrs|secondes|seconde|secs|sec|minutes|minute|mins)\b", "gis"); + } +} +exports.FrenchDateExtractorConfiguration = FrenchDateExtractorConfiguration; +class FrenchDateParserConfiguration { + constructor(config) { + this.ordinalExtractor = config.ordinalExtractor; + this.integerExtractor = config.integerExtractor; + this.cardinalExtractor = config.cardinalExtractor; + this.durationExtractor = config.durationExtractor; + this.numberParser = config.numberParser; + this.durationParser = config.durationParser; + this.monthOfYear = config.monthOfYear; + this.dayOfMonth = config.dayOfMonth; + this.dayOfWeek = config.dayOfWeek; + this.unitMap = config.unitMap; + this.cardinalMap = config.cardinalMap; + this.dateRegex = new FrenchDateExtractorConfiguration().dateRegexList; + this.onRegex = recognizersText.RegExpUtility.getSafeRegExp(frenchDateTime.FrenchDateTime.OnRegex, "gis"); + this.specialDayRegex = recognizersText.RegExpUtility.getSafeRegExp(frenchDateTime.FrenchDateTime.SpecialDayRegex, "gis"); + this.specialDayWithNumRegex = recognizersText.RegExpUtility.getSafeRegExp(frenchDateTime.FrenchDateTime.SpecialDayWithNumRegex, "gis"); + this.nextRegex = recognizersText.RegExpUtility.getSafeRegExp(frenchDateTime.FrenchDateTime.NextDateRegex, "gis"); + this.unitRegex = recognizersText.RegExpUtility.getSafeRegExp(frenchDateTime.FrenchDateTime.DateUnitRegex, "gis"); + this.monthRegex = recognizersText.RegExpUtility.getSafeRegExp(frenchDateTime.FrenchDateTime.MonthRegex, "gis"); + this.weekDayRegex = recognizersText.RegExpUtility.getSafeRegExp(frenchDateTime.FrenchDateTime.WeekDayRegex, "gis"); + this.strictWeekDay = recognizersText.RegExpUtility.getSafeRegExp(frenchDateTime.FrenchDateTime.StrictWeekDay, "gis"); + this.lastRegex = recognizersText.RegExpUtility.getSafeRegExp(frenchDateTime.FrenchDateTime.LastDateRegex, "gis"); + this.thisRegex = recognizersText.RegExpUtility.getSafeRegExp(frenchDateTime.FrenchDateTime.ThisRegex, "gis"); + this.weekDayOfMonthRegex = recognizersText.RegExpUtility.getSafeRegExp(frenchDateTime.FrenchDateTime.WeekDayOfMonthRegex, "gis"); + this.forTheRegex = recognizersText.RegExpUtility.getSafeRegExp(frenchDateTime.FrenchDateTime.ForTheRegex, "gis"); + this.weekDayAndDayOfMonthRegex = recognizersText.RegExpUtility.getSafeRegExp(frenchDateTime.FrenchDateTime.WeekDayAndDayOfMonthRegex, "gis"); + this.relativeMonthRegex = recognizersText.RegExpUtility.getSafeRegExp(frenchDateTime.FrenchDateTime.RelativeMonthRegex, "gis"); + this.relativeWeekDayRegex = recognizersText.RegExpUtility.getSafeRegExp(frenchDateTime.FrenchDateTime.RelativeWeekDayRegex, "gis"); + this.utilityConfiguration = config.utilityConfiguration; + this.dateTokenPrefix = frenchDateTime.FrenchDateTime.DateTokenPrefix; + } + getSwiftDay(source) { + let trimedText = source.trim().toLowerCase(); + let swift = 0; + if (trimedText === "aujourd'hui" || trimedText === "auj") { + swift = 0; + } + else if (trimedText === "demain" || + trimedText.endsWith("a2m1") || + trimedText.endsWith("lendemain") || + trimedText.endsWith("jour suivant")) { + swift = 1; + } + else if (trimedText === "hier") { + swift = -1; + } + else if (trimedText.endsWith("après demain") || + trimedText.endsWith("après-demain")) { + swift = 2; + } + else if (trimedText.endsWith("avant-hier") || + trimedText.endsWith("avant hier")) { + swift = -2; + } + else if (trimedText.endsWith("dernier")) { + swift = -1; + } + return swift; + } + getSwiftMonth(source) { + let trimedText = source.trim().toLowerCase(); + let swift = 0; + if (trimedText.endsWith("prochaine") || trimedText.endsWith("prochain")) { + swift = 1; + } + else if (trimedText === "dernière" || + trimedText.endsWith("dernières") || + trimedText.endsWith("derniere") || + trimedText.endsWith("dernieres")) { + swift = -1; + } + return swift; + } + isCardinalLast(source) { + let trimedText = source.trim().toLowerCase(); + return (trimedText.endsWith("dernière") || + trimedText.endsWith("dernières") || + trimedText.endsWith("derniere") || + trimedText.endsWith("dernieres")); + } +} +exports.FrenchDateParserConfiguration = FrenchDateParserConfiguration; + +}); + +unwrapExports(dateConfiguration$4); + +var holidayConfiguration$4 = createCommonjsModule(function (module, exports) { +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); + + + + +class FrenchHolidayExtractorConfiguration { + constructor() { + this.holidayRegexes = [ + recognizersText.RegExpUtility.getSafeRegExp(frenchDateTime.FrenchDateTime.HolidayRegex1, "gis"), + recognizersText.RegExpUtility.getSafeRegExp(frenchDateTime.FrenchDateTime.HolidayRegex2, "gis"), + recognizersText.RegExpUtility.getSafeRegExp(frenchDateTime.FrenchDateTime.HolidayRegex3, "gis"), + recognizersText.RegExpUtility.getSafeRegExp(frenchDateTime.FrenchDateTime.HolidayRegex4, "gis") + ]; + } +} +exports.FrenchHolidayExtractorConfiguration = FrenchHolidayExtractorConfiguration; +class FrenchHolidayParserConfiguration extends baseHoliday.BaseHolidayParserConfiguration { + constructor() { + super(); + this.holidayRegexList = [ + recognizersText.RegExpUtility.getSafeRegExp(frenchDateTime.FrenchDateTime.HolidayRegex1, "gis"), + recognizersText.RegExpUtility.getSafeRegExp(frenchDateTime.FrenchDateTime.HolidayRegex2, "gis"), + recognizersText.RegExpUtility.getSafeRegExp(frenchDateTime.FrenchDateTime.HolidayRegex3, "gis"), + recognizersText.RegExpUtility.getSafeRegExp(frenchDateTime.FrenchDateTime.HolidayRegex4, "gis") + ]; + this.holidayNames = frenchDateTime.FrenchDateTime.HolidayNames; + this.holidayFuncDictionary = this.initHolidayFuncs(); + } + initHolidayFuncs() { + return new Map([ + ...super.initHolidayFuncs(), + ["maosbirthday", FrenchHolidayParserConfiguration.MaoBirthday], + ["yuandan", FrenchHolidayParserConfiguration.NewYear], + ["teachersday", FrenchHolidayParserConfiguration.TeacherDay], + ["singleday", FrenchHolidayParserConfiguration.SinglesDay], + ["allsaintsday", FrenchHolidayParserConfiguration.HalloweenDay], + ["youthday", FrenchHolidayParserConfiguration.YouthDay], + ["childrenday", FrenchHolidayParserConfiguration.ChildrenDay], + ["femaleday", FrenchHolidayParserConfiguration.FemaleDay], + ["treeplantingday", FrenchHolidayParserConfiguration.TreePlantDay], + ["arborday", FrenchHolidayParserConfiguration.TreePlantDay], + ["girlsday", FrenchHolidayParserConfiguration.GirlsDay], + ["whiteloverday", FrenchHolidayParserConfiguration.WhiteLoverDay], + ["loverday", FrenchHolidayParserConfiguration.ValentinesDay], + ["christmas", FrenchHolidayParserConfiguration.ChristmasDay], + ["xmas", FrenchHolidayParserConfiguration.ChristmasDay], + ["newyear", FrenchHolidayParserConfiguration.NewYear], + ["newyearday", FrenchHolidayParserConfiguration.NewYear], + ["newyearsday", FrenchHolidayParserConfiguration.NewYear], + ["inaugurationday", FrenchHolidayParserConfiguration.InaugurationDay], + ["groundhougday", FrenchHolidayParserConfiguration.GroundhogDay], + ["valentinesday", FrenchHolidayParserConfiguration.ValentinesDay], + ["stpatrickday", FrenchHolidayParserConfiguration.StPatrickDay], + ["aprilfools", FrenchHolidayParserConfiguration.FoolDay], + ["stgeorgeday", FrenchHolidayParserConfiguration.StGeorgeDay], + ["mayday", FrenchHolidayParserConfiguration.Mayday], + ["cincodemayoday", FrenchHolidayParserConfiguration.CincoDeMayoday], + ["baptisteday", FrenchHolidayParserConfiguration.BaptisteDay], + ["usindependenceday", FrenchHolidayParserConfiguration.UsaIndependenceDay], + ["independenceday", FrenchHolidayParserConfiguration.UsaIndependenceDay], + ["bastilleday", FrenchHolidayParserConfiguration.BastilleDay], + ["halloweenday", FrenchHolidayParserConfiguration.HalloweenDay], + ["allhallowday", FrenchHolidayParserConfiguration.AllHallowDay], + ["allsoulsday", FrenchHolidayParserConfiguration.AllSoulsday], + ["guyfawkesday", FrenchHolidayParserConfiguration.GuyFawkesDay], + ["veteransday", FrenchHolidayParserConfiguration.Veteransday], + ["christmaseve", FrenchHolidayParserConfiguration.ChristmasEve], + ["newyeareve", FrenchHolidayParserConfiguration.NewYearEve], + ["fathersday", FrenchHolidayParserConfiguration.FathersDay], + ["mothersday", FrenchHolidayParserConfiguration.MothersDay], + ["labourday", FrenchHolidayParserConfiguration.LabourDay] + ]); + } + // All JavaScript dates are zero-based (-1) + static NewYear(year) { return new Date(year, 1 - 1, 1); } + static NewYearEve(year) { return new Date(year, 12 - 1, 31); } + static ChristmasDay(year) { return new Date(year, 12 - 1, 25); } + static ChristmasEve(year) { return new Date(year, 12 - 1, 24); } + static FemaleDay(year) { return new Date(year, 3 - 1, 8); } + static ChildrenDay(year) { return new Date(year, 6 - 1, 1); } + static HalloweenDay(year) { return new Date(year, 10 - 1, 31); } + static EasterDay(year) { return utilities$2.DateUtils.minValue(); } + static ValentinesDay(year) { return new Date(year, 2, 14); } + static WhiteLoverDay(year) { return new Date(year, 3, 14); } + static FoolDay(year) { return new Date(year, 4, 1); } + static GirlsDay(year) { return new Date(year, 3, 7); } + static TreePlantDay(year) { return new Date(year, 3, 12); } + static YouthDay(year) { return new Date(year, 5, 4); } + static TeacherDay(year) { return new Date(year, 9, 10); } + static SinglesDay(year) { return new Date(year, 11, 11); } + static MaoBirthday(year) { return new Date(year, 12, 26); } + static InaugurationDay(year) { return new Date(year, 1, 20); } + static GroundhogDay(year) { return new Date(year, 2, 2); } + static StPatrickDay(year) { return new Date(year, 3, 17); } + static StGeorgeDay(year) { return new Date(year, 4, 23); } + static Mayday(year) { return new Date(year, 5, 1); } + static CincoDeMayoday(year) { return new Date(year, 5, 5); } + static BaptisteDay(year) { return new Date(year, 6, 24); } + static UsaIndependenceDay(year) { return new Date(year, 7, 4); } + static BastilleDay(year) { return new Date(year, 7, 14); } + static AllHallowDay(year) { return new Date(year, 11, 1); } + static AllSoulsday(year) { return new Date(year, 11, 2); } + static GuyFawkesDay(year) { return new Date(year, 11, 5); } + static Veteransday(year) { return new Date(year, 11, 11); } + static FathersDay(year) { return new Date(year, 6, 17); } + static MothersDay(year) { return new Date(year, 5, 27); } + static LabourDay(year) { return new Date(year, 5, 1); } + getSwiftYear(text) { + let trimedText = text.trim().toLowerCase(); + let swift = -10; + if (trimedText.endsWith("prochain")) { // next - 'l'annee prochain') + swift = 1; + } + else if (trimedText.endsWith("dernier")) { // last - 'l'annee dernier' + swift = -1; + } + else if (trimedText.startsWith("cette")) { // this - 'cette annees' + swift = 0; + } + return swift; + } + sanitizeHolidayToken(holiday) { + return holiday.replace(/ /g, "") + .replace(/'/g, ""); + } +} +exports.FrenchHolidayParserConfiguration = FrenchHolidayParserConfiguration; + +}); + +unwrapExports(holidayConfiguration$4); + +var setConfiguration$4 = createCommonjsModule(function (module, exports) { +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); + + + + + + + + + + + + + + + + +class FrenchSetExtractorConfiguration { + constructor() { + this.lastRegex = recognizersText.RegExpUtility.getSafeRegExp(frenchDateTime.FrenchDateTime.SetLastRegex, "gis"); + this.periodicRegex = recognizersText.RegExpUtility.getSafeRegExp(frenchDateTime.FrenchDateTime.PeriodicRegex, "gis"); + this.eachUnitRegex = recognizersText.RegExpUtility.getSafeRegExp(frenchDateTime.FrenchDateTime.EachUnitRegex, "gis"); + this.eachPrefixRegex = recognizersText.RegExpUtility.getSafeRegExp(frenchDateTime.FrenchDateTime.EachPrefixRegex, "gis"); + this.eachDayRegex = recognizersText.RegExpUtility.getSafeRegExp(frenchDateTime.FrenchDateTime.EachDayRegex, "gis"); + this.beforeEachDayRegex = null; + this.setEachRegex = recognizersText.RegExpUtility.getSafeRegExp(frenchDateTime.FrenchDateTime.SetEachRegex, "gis"); + this.setWeekDayRegex = recognizersText.RegExpUtility.getSafeRegExp(frenchDateTime.FrenchDateTime.SetWeekDayRegex, "gis"); + this.durationExtractor = new baseDuration.BaseDurationExtractor(new durationConfiguration$4.FrenchDurationExtractorConfiguration()); + this.timeExtractor = new baseTime.BaseTimeExtractor(new timeConfiguration$4.FrenchTimeExtractorConfiguration()); + this.dateExtractor = new baseDate.BaseDateExtractor(new dateConfiguration$4.FrenchDateExtractorConfiguration()); + this.dateTimeExtractor = new baseDateTime$2.BaseDateTimeExtractor(new dateTimeConfiguration$4.FrenchDateTimeExtractorConfiguration()); + this.datePeriodExtractor = new baseDatePeriod.BaseDatePeriodExtractor(new datePeriodConfiguration$4.FrenchDatePeriodExtractorConfiguration()); + this.timePeriodExtractor = new baseTimePeriod.BaseTimePeriodExtractor(new timePeriodConfiguration$4.FrenchTimePeriodExtractorConfiguration()); + this.dateTimePeriodExtractor = new baseDateTimePeriod.BaseDateTimePeriodExtractor(new dateTimePeriodConfiguration$4.FrenchDateTimePeriodExtractorConfiguration()); + } +} +exports.FrenchSetExtractorConfiguration = FrenchSetExtractorConfiguration; +class FrenchSetParserConfiguration { + constructor(config) { + this.durationExtractor = config.durationExtractor; + this.timeExtractor = config.timeExtractor; + this.dateExtractor = config.dateExtractor; + this.dateTimeExtractor = config.dateTimeExtractor; + this.datePeriodExtractor = config.datePeriodExtractor; + this.timePeriodExtractor = config.timePeriodExtractor; + this.dateTimePeriodExtractor = config.dateTimePeriodExtractor; + this.durationParser = config.durationParser; + this.timeParser = config.timeParser; + this.dateParser = config.dateParser; + this.dateTimeParser = config.dateTimeParser; + this.datePeriodParser = config.datePeriodParser; + this.timePeriodParser = config.timePeriodParser; + this.dateTimePeriodParser = config.dateTimePeriodParser; + this.unitMap = config.unitMap; + this.eachPrefixRegex = recognizersText.RegExpUtility.getSafeRegExp(frenchDateTime.FrenchDateTime.EachPrefixRegex, "gis"); + this.periodicRegex = recognizersText.RegExpUtility.getSafeRegExp(frenchDateTime.FrenchDateTime.PeriodicRegex, "gis"); + this.eachUnitRegex = recognizersText.RegExpUtility.getSafeRegExp(frenchDateTime.FrenchDateTime.EachUnitRegex, "gis"); + this.eachDayRegex = recognizersText.RegExpUtility.getSafeRegExp(frenchDateTime.FrenchDateTime.EachDayRegex, "gis"); + this.setWeekDayRegex = recognizersText.RegExpUtility.getSafeRegExp(frenchDateTime.FrenchDateTime.SetWeekDayRegex, "gis"); + this.setEachRegex = recognizersText.RegExpUtility.getSafeRegExp(frenchDateTime.FrenchDateTime.SetEachRegex, "gis"); + } + getMatchedDailyTimex(text) { + let trimedText = text.trim().toLowerCase(); + let timex = ""; + if (trimedText === "quotidien" || trimedText === "quotidienne" || + trimedText === "jours" || trimedText === "journellement") { + timex = "P1D"; + } + else if (trimedText === "hebdomadaire") { + timex = "P1W"; + } + else if (trimedText === "bihebdomadaire") { + timex = "P2W"; + } + else if (trimedText === "mensuel" || trimedText === "mensuelle") { + timex = "P1M"; + } + else if (trimedText === "annuel" || trimedText === "annuellement") { + timex = "P1Y"; + } + else { + timex = null; + return { + timex, + matched: false + }; + } + return { + timex, + matched: true + }; + } + getMatchedUnitTimex(text) { + let trimedText = text.trim().toLowerCase(); + let timex = ""; + if (trimedText === "jour" || trimedText === "journee") { + timex = "P1D"; + } + else if (trimedText === "semaine") { + timex = "P1W"; + } + else if (trimedText === "mois") { + timex = "P1M"; + } + else if (trimedText === "an" || trimedText === "annee") { + timex = "P1Y"; + } + else { + timex = null; + return { + matched: false, + timex + }; + } + return { + matched: true, + timex + }; + } +} +exports.FrenchSetParserConfiguration = FrenchSetParserConfiguration; + +}); + +unwrapExports(setConfiguration$4); + +var mergedConfiguration$4 = createCommonjsModule(function (module, exports) { +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); + + + + + + + + + + + + + + + + + + + + + + +class FrenchMergedExtractorConfiguration { + constructor() { + this.beforeRegex = recognizersText.RegExpUtility.getSafeRegExp(frenchDateTime.FrenchDateTime.BeforeRegex); + this.afterRegex = recognizersText.RegExpUtility.getSafeRegExp(frenchDateTime.FrenchDateTime.AfterRegex); + this.sinceRegex = recognizersText.RegExpUtility.getSafeRegExp(frenchDateTime.FrenchDateTime.SinceRegex); + this.fromToRegex = recognizersText.RegExpUtility.getSafeRegExp(frenchDateTime.FrenchDateTime.FromToRegex); + this.singleAmbiguousMonthRegex = recognizersText.RegExpUtility.getSafeRegExp(frenchDateTime.FrenchDateTime.SingleAmbiguousMonthRegex); + this.prepositionSuffixRegex = recognizersText.RegExpUtility.getSafeRegExp(frenchDateTime.FrenchDateTime.PrepositionSuffixRegex); + this.numberEndingPattern = recognizersText.RegExpUtility.getSafeRegExp(frenchDateTime.FrenchDateTime.NumberEndingPattern); + this.dateExtractor = new baseDate.BaseDateExtractor(new dateConfiguration$4.FrenchDateExtractorConfiguration()); + this.timeExtractor = new baseTime.BaseTimeExtractor(new timeConfiguration$4.FrenchTimeExtractorConfiguration()); + this.dateTimeExtractor = new baseDateTime$2.BaseDateTimeExtractor(new dateTimeConfiguration$4.FrenchDateTimeExtractorConfiguration()); + this.datePeriodExtractor = new baseDatePeriod.BaseDatePeriodExtractor(new datePeriodConfiguration$4.FrenchDatePeriodExtractorConfiguration()); + this.timePeriodExtractor = new baseTimePeriod.BaseTimePeriodExtractor(new timePeriodConfiguration$4.FrenchTimePeriodExtractorConfiguration()); + this.dateTimePeriodExtractor = new baseDateTimePeriod.BaseDateTimePeriodExtractor(new dateTimePeriodConfiguration$4.FrenchDateTimePeriodExtractorConfiguration()); + this.durationExtractor = new baseDuration.BaseDurationExtractor(new durationConfiguration$4.FrenchDurationExtractorConfiguration()); + this.setExtractor = new baseSet.BaseSetExtractor(new setConfiguration$4.FrenchSetExtractorConfiguration()); + this.holidayExtractor = new baseHoliday.BaseHolidayExtractor(new holidayConfiguration$4.FrenchHolidayExtractorConfiguration()); + this.integerExtractor = new recognizersTextNumber.FrenchIntegerExtractor(); + this.filterWordRegexList = []; + } +} +exports.FrenchMergedExtractorConfiguration = FrenchMergedExtractorConfiguration; +class FrenchMergedParserConfiguration extends baseConfiguration$4.FrenchCommonDateTimeParserConfiguration { + constructor() { + super(); + this.beforeRegex = recognizersText.RegExpUtility.getSafeRegExp(frenchDateTime.FrenchDateTime.BeforeRegex); + this.afterRegex = recognizersText.RegExpUtility.getSafeRegExp(frenchDateTime.FrenchDateTime.AfterRegex); + this.sinceRegex = recognizersText.RegExpUtility.getSafeRegExp(frenchDateTime.FrenchDateTime.SinceRegex); + this.datePeriodParser = new baseDatePeriod.BaseDatePeriodParser(new datePeriodConfiguration$4.FrenchDatePeriodParserConfiguration(this)); + this.timePeriodParser = new baseTimePeriod.BaseTimePeriodParser(new timePeriodConfiguration$4.FrenchTimePeriodParserConfiguration(this)); + this.setParser = new baseSet.BaseSetParser(new setConfiguration$4.FrenchSetParserConfiguration(this)); + this.holidayParser = new baseHoliday.BaseHolidayParser(new holidayConfiguration$4.FrenchHolidayParserConfiguration()); + } +} +exports.FrenchMergedParserConfiguration = FrenchMergedParserConfiguration; + +}); + +unwrapExports(mergedConfiguration$4); + +var chineseDateTime = createCommonjsModule(function (module, exports) { +"use strict"; +// ------------------------------------------------------------------------------ +// +// This code was generated by a tool. +// Changes to this file may cause incorrect behavior and will be lost if +// the code is regenerated. +// +// ------------------------------------------------------------------------------ +Object.defineProperty(exports, "__esModule", { value: true }); + +var ChineseDateTime; +(function (ChineseDateTime) { + ChineseDateTime.MonthRegex = `(?正月|一月|二月|三月|四月|五月|六月|七月|八月|九月|十月|十一月|十二月|01月|02月|03月|04月|05月|06月|07月|08月|09月|10月|11月|12月|1月|2月|3月|4月|5月|6月|7月|8月|9月|大年)`; + ChineseDateTime.DayRegex = `(?01|02|03|04|05|06|07|08|09|10|11|12|13|14|15|16|17|18|19|20|21|22|23|24|25|26|27|28|29|30|31|1|2|3|4|5|6|7|8|9)`; + ChineseDateTime.DateDayRegexInChinese = `(?初一|三十|一日|十一日|二十一日|三十一日|二日|三日|四日|五日|六日|七日|八日|九日|十二日|十三日|十四日|十五日|十六日|十七日|十八日|十九日|二十二日|二十三日|二十四日|二十五日|二十六日|二十七日|二十八日|二十九日|一日|十一日|十日|二十一日|二十日|三十一日|三十日|二日|三日|四日|五日|六日|七日|八日|九日|十二日|十三日|十四日|十五日|十六日|十七日|十八日|十九日|二十二日|二十三日|二十四日|二十五日|二十六日|二十七日|二十八日|二十九日|十日|二十日|三十日|10日|11日|12日|13日|14日|15日|16日|17日|18日|19日|1日|20日|21日|22日|23日|24日|25日|26日|27日|28日|29日|2日|30日|31日|3日|4日|5日|6日|7日|8日|9日|一号|十一号|二十一号|三十一号|二号|三号|四号|五号|六号|七号|八号|九号|十二号|十三号|十四号|十五号|十六号|十七号|十八号|十九号|二十二号|二十三号|二十四号|二十五号|二十六号|二十七号|二十八号|二十九号|一号|十一号|十号|二十一号|二十号|三十一号|三十号|二号|三号|四号|五号|六号|七号|八号|九号|十二号|十三号|十四号|十五号|十六号|十七号|十八号|十九号|二十二号|二十三号|二十四号|二十五号|二十六号|二十七号|二十八号|二十九号|十号|二十号|三十号|10号|11号|12号|13号|14号|15号|16号|17号|18号|19号|1号|20号|21号|22号|23号|24号|25号|26号|27号|28号|29号|2号|30号|31号|3号|4号|5号|6号|7号|8号|9号)`; + ChineseDateTime.DayRegexNumInChinese = `(?一|十一|二十一|三十一|二|三|四|五|六|七|八|九|十二|十三|十四|十五|十六|十七|十八|十九|二十二|二十三|二十四|二十五|二十六|二十七|二十八|二十九|一|十一|十|二十一|二十|三十一|三十|二|三|四|五|六|七|八|九|十二|十三|十四|十五|十六|十七|十八|十九|二十二|二十三|二十四|二十五|二十六|二十七|二十八|二十九|十|二十|廿|卅)`; + ChineseDateTime.MonthNumRegex = `(?01|02|03|04|05|06|07|08|09|10|11|12|1|2|3|4|5|6|7|8|9)`; + ChineseDateTime.TwoNumYear = '50'; + ChineseDateTime.YearNumRegex = `(?((1[5-9]|20)\\d{2})|2100)`; + ChineseDateTime.YearRegex = `(?(\\d{2,4}))`; + ChineseDateTime.ZeroToNineIntegerRegexChs = `[一二三四五六七八九零壹贰叁肆伍陆柒捌玖〇两千俩倆仨]`; + ChineseDateTime.DateYearInChineseRegex = `(?(${ChineseDateTime.ZeroToNineIntegerRegexChs}${ChineseDateTime.ZeroToNineIntegerRegexChs}${ChineseDateTime.ZeroToNineIntegerRegexChs}${ChineseDateTime.ZeroToNineIntegerRegexChs}|${ChineseDateTime.ZeroToNineIntegerRegexChs}${ChineseDateTime.ZeroToNineIntegerRegexChs}|${ChineseDateTime.ZeroToNineIntegerRegexChs}${ChineseDateTime.ZeroToNineIntegerRegexChs}${ChineseDateTime.ZeroToNineIntegerRegexChs}))`; + ChineseDateTime.WeekDayRegex = `(?周日|周天|周一|周二|周三|周四|周五|周六|星期一|星期二|星期三|星期四|星期五|星期六|星期日|星期天|礼拜一|礼拜二|礼拜三|礼拜四|礼拜五|礼拜六|礼拜日|礼拜天|禮拜一|禮拜二|禮拜三|禮拜四|禮拜五|禮拜六|禮拜日|禮拜天|週日|週天|週一|週二|週三|週四|週五|週六)`; + ChineseDateTime.LunarRegex = `(农历|初一|正月|大年)`; + ChineseDateTime.DateThisRegex = `(这个|这一个|这|这一|本)${ChineseDateTime.WeekDayRegex}`; + ChineseDateTime.DateLastRegex = `(上一个|上个|上一|上|最后一个|最后)(的)?${ChineseDateTime.WeekDayRegex}`; + ChineseDateTime.DateNextRegex = `(下一个|下个|下一|下)(的)?${ChineseDateTime.WeekDayRegex}`; + ChineseDateTime.SpecialDayRegex = `(最近|前天|后天|昨天|明天|今天|今日|明日|昨日|大后天|大前天|後天|大後天)`; + ChineseDateTime.SpecialDayWithNumRegex = `^[.]`; + ChineseDateTime.WeekDayOfMonthRegex = `(((${ChineseDateTime.MonthRegex}|${ChineseDateTime.MonthNumRegex})的\\s*)(?第一个|第二个|第三个|第四个|第五个|最后一个)\\s*${ChineseDateTime.WeekDayRegex})`; + ChineseDateTime.DateThisRe = `这个|这一个|这|这一|本|今`; + ChineseDateTime.DateLastRe = `上个|上一个|上|上一|去`; + ChineseDateTime.DateNextRe = `下个|下一个|下|下一|明`; + ChineseDateTime.SpecialDate = `(?(${ChineseDateTime.DateThisRe}|${ChineseDateTime.DateLastRe}|${ChineseDateTime.DateNextRe})年)?(?(${ChineseDateTime.DateThisRe}|${ChineseDateTime.DateLastRe}|${ChineseDateTime.DateNextRe})月)?${ChineseDateTime.DateDayRegexInChinese}`; + ChineseDateTime.DateUnitRegex = `(?年|个月|周|日|天)`; + ChineseDateTime.BeforeRegex = `以前|之前|前`; + ChineseDateTime.AfterRegex = `以后|以後|之后|之後|后|後`; + ChineseDateTime.DateRegexList1 = `(${ChineseDateTime.LunarRegex}(\\s*))?(((${ChineseDateTime.YearRegex}|${ChineseDateTime.DateYearInChineseRegex})年)(\\s*))?${ChineseDateTime.MonthRegex}(\\s*)${ChineseDateTime.DateDayRegexInChinese}((\\s*|,|,)${ChineseDateTime.WeekDayRegex})?(${ChineseDateTime.BeforeRegex}|${ChineseDateTime.AfterRegex})?`; + ChineseDateTime.DateRegexList2 = `(((${ChineseDateTime.YearRegex}|${ChineseDateTime.DateYearInChineseRegex})年)(\\s*))?(${ChineseDateTime.LunarRegex}(\\s*))?${ChineseDateTime.MonthRegex}(\\s*)${ChineseDateTime.DateDayRegexInChinese}((\\s*|,|,)${ChineseDateTime.WeekDayRegex})?(${ChineseDateTime.BeforeRegex}|${ChineseDateTime.AfterRegex})?`; + ChineseDateTime.DateRegexList3 = `(((${ChineseDateTime.YearRegex}|${ChineseDateTime.DateYearInChineseRegex})年)(\\s*))?(${ChineseDateTime.LunarRegex}(\\s*))?${ChineseDateTime.MonthRegex}(\\s*)(${ChineseDateTime.DayRegexNumInChinese}|${ChineseDateTime.DayRegex})((\\s*|,|,)${ChineseDateTime.WeekDayRegex})?(${ChineseDateTime.BeforeRegex}|${ChineseDateTime.AfterRegex})?`; + ChineseDateTime.DateRegexList4 = `${ChineseDateTime.MonthNumRegex}\\s*/\\s*${ChineseDateTime.DayRegex}((\\s+|\\s*,\\s*)${ChineseDateTime.YearRegex})?`; + ChineseDateTime.DateRegexList5 = `${ChineseDateTime.DayRegex}\\s*/\\s*${ChineseDateTime.MonthNumRegex}((\\s+|\\s*,\\s*)${ChineseDateTime.YearRegex})?`; + ChineseDateTime.DateRegexList6 = `${ChineseDateTime.MonthNumRegex}\\s*[/\\\\\\-]\\s*${ChineseDateTime.DayRegex}\\s*[/\\\\\\-]\\s*${ChineseDateTime.YearRegex}`; + ChineseDateTime.DateRegexList7 = `${ChineseDateTime.DayRegex}\\s*[/\\\\\\-\\.]\\s*${ChineseDateTime.MonthNumRegex}\\s*[/\\\\\\-\\.]\\s*${ChineseDateTime.YearNumRegex}`; + ChineseDateTime.DateRegexList8 = `${ChineseDateTime.YearNumRegex}\\s*[/\\\\\\-\\. ]\\s*${ChineseDateTime.MonthNumRegex}\\s*[/\\\\\\-\\. ]\\s*${ChineseDateTime.DayRegex}`; + ChineseDateTime.DatePeriodTillRegex = `(?到|至|--|-|—|——|~|–)`; + ChineseDateTime.DatePeriodTillSuffixRequiredRegex = `(?与|和)`; + ChineseDateTime.DatePeriodDayRegexInChinese = `(?初一|三十|一日|十一日|二十一日|三十一日|二日|三日|四日|五日|六日|七日|八日|九日|十二日|十三日|十四日|十五日|十六日|十七日|十八日|十九日|二十二日|二十三日|二十四日|二十五日|二十六日|二十七日|二十八日|二十九日|一日|十一日|十日|二十一日|二十日|三十一日|三十日|二日|三日|四日|五日|六日|七日|八日|九日|十二日|十三日|十四日|十五日|十六日|十七日|十八日|十九日|二十二日|二十三日|二十四日|二十五日|二十六日|二十七日|二十八日|二十九日|十日|二十日|三十日|10日|11日|12日|13日|14日|15日|16日|17日|18日|19日|1日|20日|21日|22日|23日|24日|25日|26日|27日|28日|29日|2日|30日|31日|3日|4日|5日|6日|7日|8日|9日|一号|十一号|二十一号|三十一号|二号|三号|四号|五号|六号|七号|八号|九号|十二号|十三号|十四号|十五号|十六号|十七号|十八号|十九号|二十二号|二十三号|二十四号|二十五号|二十六号|二十七号|二十八号|二十九号|一号|十一号|十号|二十一号|二十号|三十一号|三十号|二号|三号|四号|五号|六号|七号|八号|九号|十二号|十三号|十四号|十五号|十六号|十七号|十八号|十九号|二十二号|二十三号|二十四号|二十五号|二十六号|二十七号|二十八号|二十九号|十号|二十号|三十号|10号|11号|12号|13号|14号|15号|16号|17号|18号|19号|1号|20号|21号|22号|23号|24号|25号|26号|27号|28号|29号|2号|30号|31号|3号|4号|5号|6号|7号|8号|9号|一|十一|二十一|三十一|二|三|四|五|六|七|八|九|十二|十三|十四|十五|十六|十七|十八|十九|二十二|二十三|二十四|二十五|二十六|二十七|二十八|二十九|一|十一|十|二十一|二十|三十一|三十|二|三|四|五|六|七|八|九|十二|十三|十四|十五|十六|十七|十八|十九|二十二|二十三|二十四|二十五|二十六|二十七|二十八|二十九|十|二十|三十||廿|卅)`; + ChineseDateTime.DatePeriodThisRegex = `这个|这一个|这|这一|本`; + ChineseDateTime.DatePeriodLastRegex = `上个|上一个|上|上一`; + ChineseDateTime.DatePeriodNextRegex = `下个|下一个|下|下一`; + ChineseDateTime.RelativeMonthRegex = `(?(${ChineseDateTime.DatePeriodThisRegex}|${ChineseDateTime.DatePeriodLastRegex}|${ChineseDateTime.DatePeriodNextRegex})\\s*月)`; + ChineseDateTime.DatePeriodYearRegex = `((${ChineseDateTime.YearNumRegex})(\\s*年)?|(${ChineseDateTime.YearRegex})\\s*年)(?=[\\u4E00-\\u9FFF]|\\s|$|\\W)`; + ChineseDateTime.StrictYearRegex = `${ChineseDateTime.DatePeriodYearRegex}`; + ChineseDateTime.YearRegexInNumber = `(?(\\d{3,4}))`; + ChineseDateTime.DatePeriodYearInChineseRegex = `(?(${ChineseDateTime.ZeroToNineIntegerRegexChs}${ChineseDateTime.ZeroToNineIntegerRegexChs}${ChineseDateTime.ZeroToNineIntegerRegexChs}${ChineseDateTime.ZeroToNineIntegerRegexChs}|${ChineseDateTime.ZeroToNineIntegerRegexChs}${ChineseDateTime.ZeroToNineIntegerRegexChs}|${ChineseDateTime.ZeroToNineIntegerRegexChs}${ChineseDateTime.ZeroToNineIntegerRegexChs}${ChineseDateTime.ZeroToNineIntegerRegexChs}))年`; + ChineseDateTime.MonthSuffixRegex = `(?(${ChineseDateTime.RelativeMonthRegex}|${ChineseDateTime.MonthRegex}))`; + ChineseDateTime.SimpleCasesRegex = `((从)\\s*)?((${ChineseDateTime.DatePeriodYearRegex}|${ChineseDateTime.DatePeriodYearInChineseRegex})\\s*)?${ChineseDateTime.MonthSuffixRegex}(${ChineseDateTime.DatePeriodDayRegexInChinese}|${ChineseDateTime.DayRegex})\\s*${ChineseDateTime.DatePeriodTillRegex}\\s*(${ChineseDateTime.DatePeriodDayRegexInChinese}|${ChineseDateTime.DayRegex})((\\s+|\\s*,\\s*)${ChineseDateTime.DatePeriodYearRegex})?`; + ChineseDateTime.YearAndMonth = `(${ChineseDateTime.DatePeriodYearInChineseRegex}|${ChineseDateTime.DatePeriodYearRegex})${ChineseDateTime.MonthRegex}`; + ChineseDateTime.PureNumYearAndMonth = `(${ChineseDateTime.YearRegexInNumber}\\s*[-\\.\\/]\\s*${ChineseDateTime.MonthNumRegex})|(${ChineseDateTime.MonthNumRegex}\\s*\\/\\s*${ChineseDateTime.YearRegexInNumber})`; + ChineseDateTime.OneWordPeriodRegex = `(((明年|今年|去年)\\s*)?${ChineseDateTime.MonthRegex}|(${ChineseDateTime.DatePeriodThisRegex}|${ChineseDateTime.DatePeriodLastRegex}|${ChineseDateTime.DatePeriodNextRegex})\\s*(周末|周|月|年)|周末|今年|明年|去年|前年|后年)`; + ChineseDateTime.WeekOfMonthRegex = `(?${ChineseDateTime.MonthSuffixRegex}的(?第一|第二|第三|第四|第五|最后一)\\s*周\\s*)`; + ChineseDateTime.UnitRegex = `(?年|(个)?月|周|日|天)`; + ChineseDateTime.FollowedUnit = `^\\s*${ChineseDateTime.UnitRegex}`; + ChineseDateTime.NumberCombinedWithUnit = `(?\\d+(\\.\\d*)?)${ChineseDateTime.UnitRegex}`; + ChineseDateTime.DateRangePrepositions = `((从|在|自)\\s*)?`; + ChineseDateTime.YearToYear = `(${ChineseDateTime.DateRangePrepositions})(${ChineseDateTime.DatePeriodYearInChineseRegex}|${ChineseDateTime.DatePeriodYearRegex})\\s*(${ChineseDateTime.DatePeriodTillRegex}|后|後|之后|之後)\\s*(${ChineseDateTime.DatePeriodYearInChineseRegex}|${ChineseDateTime.DatePeriodYearRegex})(\\s*((之间|之内|期间|中间|间)|前|之前))?`; + ChineseDateTime.YearToYearSuffixRequired = `(${ChineseDateTime.DateRangePrepositions})(${ChineseDateTime.DatePeriodYearInChineseRegex}|${ChineseDateTime.DatePeriodYearRegex})\\s*(${ChineseDateTime.DatePeriodTillSuffixRequiredRegex})\\s*(${ChineseDateTime.DatePeriodYearInChineseRegex}|${ChineseDateTime.DatePeriodYearRegex})\\s*(之间|之内|期间|中间|间)`; + ChineseDateTime.MonthToMonth = `(${ChineseDateTime.DateRangePrepositions})(${ChineseDateTime.MonthRegex})${ChineseDateTime.DatePeriodTillRegex}(${ChineseDateTime.MonthRegex})`; + ChineseDateTime.MonthToMonthSuffixRequired = `(${ChineseDateTime.DateRangePrepositions})(${ChineseDateTime.MonthRegex})${ChineseDateTime.DatePeriodTillSuffixRequiredRegex}(${ChineseDateTime.MonthRegex})\\s*(之间|之内|期间|中间|间)`; + ChineseDateTime.PastRegex = `(?(前|上|之前|近|过去))`; + ChineseDateTime.FutureRegex = `(?(后|後|(?春|夏|秋|冬)(天|季)?`; + ChineseDateTime.SeasonWithYear = `((${ChineseDateTime.DatePeriodYearRegex}|${ChineseDateTime.DatePeriodYearInChineseRegex}|(?明年|今年|去年))(的)?)?${ChineseDateTime.SeasonRegex}`; + ChineseDateTime.QuarterRegex = `((${ChineseDateTime.DatePeriodYearRegex}|${ChineseDateTime.DatePeriodYearInChineseRegex}|(?明年|今年|去年))(的)?)?(第(?1|2|3|4|一|二|三|四)季度)`; + ChineseDateTime.CenturyRegex = `(?\\d|1\\d|2\\d)世纪`; + ChineseDateTime.CenturyRegexInChinese = `(?一|二|三|四|五|六|七|八|九|十|十一|十二|十三|十四|十五|十六|十七|十八|十九|二十|二十一|二十二)世纪`; + ChineseDateTime.RelativeCenturyRegex = `(?(${ChineseDateTime.DatePeriodLastRegex}|${ChineseDateTime.DatePeriodThisRegex}|${ChineseDateTime.DatePeriodNextRegex}))世纪`; + ChineseDateTime.DecadeRegexInChinese = `(?十|一十|二十|三十|四十|五十|六十|七十|八十|九十)`; + ChineseDateTime.DecadeRegex = `(?(${ChineseDateTime.CenturyRegex}|${ChineseDateTime.CenturyRegexInChinese}|${ChineseDateTime.RelativeCenturyRegex}))?(?(\\d0|${ChineseDateTime.DecadeRegexInChinese}))年代`; + ChineseDateTime.PrepositionRegex = `(?^的|在$)`; + ChineseDateTime.NowRegex = `(?现在|马上|立刻|刚刚才|刚刚|刚才)`; + ChineseDateTime.NightRegex = `(?早|晚)`; + ChineseDateTime.TimeOfTodayRegex = `(今晚|今早|今晨|明晚|明早|明晨|昨晚)(的|在)?`; + ChineseDateTime.DateTimePeriodTillRegex = `(?到|直到|--|-|—|——)`; + ChineseDateTime.DateTimePeriodPrepositionRegex = `(?^\\s*的|在\\s*$)`; + ChineseDateTime.HourRegex = `\\b${baseDateTime.BaseDateTime.HourRegex}`; + ChineseDateTime.HourNumRegex = `(?[零〇一二两三四五六七八九]|二十[一二三四]?|十[一二三四五六七八九]?)`; + ChineseDateTime.ZhijianRegex = `^\\s*(之间|之内|期间|中间|间)`; + ChineseDateTime.DateTimePeriodThisRegex = `这个|这一个|这|这一`; + ChineseDateTime.DateTimePeriodLastRegex = `上个|上一个|上|上一`; + ChineseDateTime.DateTimePeriodNextRegex = `下个|下一个|下|下一`; + ChineseDateTime.AmPmDescRegex = `(?(am|a\\.m\\.|a m|a\\. m\\.|a\\.m|a\\. m|a m|pm|p\\.m\\.|p m|p\\. m\\.|p\\.m|p\\. m|p m))`; + ChineseDateTime.TimeOfDayRegex = `(?凌晨|清晨|早上|早|上午|中午|下午|午后|晚上|夜里|夜晚|半夜|夜间|深夜|傍晚|晚)`; + ChineseDateTime.SpecificTimeOfDayRegex = `(((${ChineseDateTime.DateTimePeriodThisRegex}|${ChineseDateTime.DateTimePeriodNextRegex}|${ChineseDateTime.DateTimePeriodLastRegex})\\s+${ChineseDateTime.TimeOfDayRegex})|(今晚|今早|今晨|明晚|明早|明晨|昨晚))`; + ChineseDateTime.DateTimePeriodUnitRegex = `(个)?(?(小时|分钟|秒钟|时|分|秒))`; + ChineseDateTime.DateTimePeriodFollowedUnit = `^\\s*${ChineseDateTime.DateTimePeriodUnitRegex}`; + ChineseDateTime.DateTimePeriodNumberCombinedWithUnit = `\\b(?\\d+(\\.\\d*)?)${ChineseDateTime.DateTimePeriodUnitRegex}`; + ChineseDateTime.DurationYearRegex = `((\\d{3,4})|0\\d|两千)\\s*年`; + ChineseDateTime.DurationHalfSuffixRegex = `半`; + ChineseDateTime.DurationSuffixList = new Map([["M", "分钟"], ["S", "秒钟|秒"], ["H", "个小时|小时"], ["D", "天"], ["W", "星期|个星期|周"], ["Mon", "个月"], ["Y", "年"]]); + ChineseDateTime.DurationAmbiguousUnits = ['分钟', '秒钟', '秒', '个小时', '小时', '天', '星期', '个星期', '周', '个月', '年']; + ChineseDateTime.LunarHolidayRegex = `((${ChineseDateTime.DatePeriodYearRegex}|${ChineseDateTime.DatePeriodYearInChineseRegex}|(?明年|今年|去年))(的)?)?(?除夕|春节|中秋节|中秋|元宵节|端午节|端午|重阳节)`; + ChineseDateTime.HolidayRegexList1 = `((${ChineseDateTime.DatePeriodYearRegex}|${ChineseDateTime.DatePeriodYearInChineseRegex}|(?明年|今年|去年))(的)?)?(?新年|五一|劳动节|元旦节|元旦|愚人节|圣诞节|植树节|国庆节|情人节|教师节|儿童节|妇女节|青年节|建军节|女生节|光棍节|双十一|清明节|清明)`; + ChineseDateTime.HolidayRegexList2 = `((${ChineseDateTime.DatePeriodYearRegex}|${ChineseDateTime.DatePeriodYearInChineseRegex}|(?明年|今年|去年))(的)?)?(?母亲节|父亲节|感恩节|万圣节)`; + ChineseDateTime.SetUnitRegex = `(?年|月|周|星期|日|天|小时|时|分钟|分|秒钟|秒)`; + ChineseDateTime.SetEachUnitRegex = `(?(每个|每一|每)\\s*${ChineseDateTime.SetUnitRegex})`; + ChineseDateTime.SetEachPrefixRegex = `(?(每)\\s*$)`; + ChineseDateTime.SetLastRegex = `(?last|this|next)`; + ChineseDateTime.SetEachDayRegex = `(每|每一)(天|日)\\s*$`; + ChineseDateTime.TimeHourNumRegex = `(00|01|02|03|04|05|06|07|08|09|0|10|11|12|13|14|15|16|17|18|19|20|21|22|23|24|1|2|3|4|5|6|7|8|9)`; + ChineseDateTime.TimeMinuteNumRegex = `(00|01|02|03|04|05|06|07|08|09|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|0|1|2|3|4|5|6|7|8|9)`; + ChineseDateTime.TimeSecondNumRegex = `(00|01|02|03|04|05|06|07|08|09|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|0|1|2|3|4|5|6|7|8|9)`; + ChineseDateTime.TimeHourChsRegex = `([零〇一二两三四五六七八九]|二十[一二三四]?|十[一二三四五六七八九]?)`; + ChineseDateTime.TimeMinuteChsRegex = `([二三四五]?十[一二三四五六七八九]?|六十|[零〇一二三四五六七八九])`; + ChineseDateTime.TimeSecondChsRegex = `${ChineseDateTime.TimeMinuteChsRegex}`; + ChineseDateTime.TimeClockDescRegex = `(点\\s*整|点\\s*钟|点|时)`; + ChineseDateTime.TimeMinuteDescRegex = `(分钟|分|)`; + ChineseDateTime.TimeSecondDescRegex = `(秒钟|秒)`; + ChineseDateTime.TimeBanHourPrefixRegex = `(第)`; + ChineseDateTime.TimeHourRegex = `(?${ChineseDateTime.TimeHourChsRegex}|${ChineseDateTime.TimeHourNumRegex})${ChineseDateTime.TimeClockDescRegex}`; + ChineseDateTime.TimeMinuteRegex = `(?${ChineseDateTime.TimeMinuteChsRegex}|${ChineseDateTime.TimeMinuteNumRegex})${ChineseDateTime.TimeMinuteDescRegex}`; + ChineseDateTime.TimeSecondRegex = `(?${ChineseDateTime.TimeSecondChsRegex}|${ChineseDateTime.TimeSecondNumRegex})${ChineseDateTime.TimeSecondDescRegex}`; + ChineseDateTime.TimeHalfRegex = `(?过半|半)`; + ChineseDateTime.TimeQuarterRegex = `(?[一两二三四1-4])\\s*(刻钟|刻)`; + ChineseDateTime.TimeChineseTimeRegex = `${ChineseDateTime.TimeHourRegex}(${ChineseDateTime.TimeQuarterRegex}|${ChineseDateTime.TimeHalfRegex}|((过|又)?${ChineseDateTime.TimeMinuteRegex})(${ChineseDateTime.TimeSecondRegex})?)?`; + ChineseDateTime.TimeDigitTimeRegex = `(?${ChineseDateTime.TimeHourNumRegex}):(?${ChineseDateTime.TimeMinuteNumRegex})(:(?${ChineseDateTime.TimeSecondNumRegex}))?`; + ChineseDateTime.TimeDayDescRegex = `(?凌晨|清晨|早上|早|上午|中午|下午|午后|晚上|夜里|夜晚|半夜|午夜|夜间|深夜|傍晚|晚)`; + ChineseDateTime.TimeApproximateDescPreffixRegex = `(大[约概]|差不多|可能|也许|约|不超过|不多[于过]|最[多长少]|少于|[超短长多]过|几乎要|将近|差点|快要|接近|至少|起码|超出|不到)`; + ChineseDateTime.TimeApproximateDescSuffixRegex = `(之前|以前|以后|以後|之后|之後|前|后|後|左右)`; + ChineseDateTime.TimeRegexes1 = `${ChineseDateTime.TimeApproximateDescPreffixRegex}?${ChineseDateTime.TimeDayDescRegex}?${ChineseDateTime.TimeChineseTimeRegex}${ChineseDateTime.TimeApproximateDescSuffixRegex}?`; + ChineseDateTime.TimeRegexes2 = `${ChineseDateTime.TimeApproximateDescPreffixRegex}?${ChineseDateTime.TimeDayDescRegex}?${ChineseDateTime.TimeDigitTimeRegex}${ChineseDateTime.TimeApproximateDescSuffixRegex}?(\\s*${ChineseDateTime.AmPmDescRegex}?)`; + ChineseDateTime.TimeRegexes3 = `差${ChineseDateTime.TimeMinuteRegex}${ChineseDateTime.TimeChineseTimeRegex}`; + ChineseDateTime.TimePeriodTimePeriodConnectWords = `(起|至|到|–|-|—|~|~)`; + ChineseDateTime.TimePeriodLeftChsTimeRegex = `(从)?(?${ChineseDateTime.TimeDayDescRegex}?(${ChineseDateTime.TimeChineseTimeRegex}))`; + ChineseDateTime.TimePeriodRightChsTimeRegex = `${ChineseDateTime.TimePeriodTimePeriodConnectWords}(?${ChineseDateTime.TimeDayDescRegex}?${ChineseDateTime.TimeChineseTimeRegex})(之间)?`; + ChineseDateTime.TimePeriodLeftDigitTimeRegex = `(从)?(?${ChineseDateTime.TimeDayDescRegex}?(${ChineseDateTime.TimeDigitTimeRegex}))`; + ChineseDateTime.TimePeriodRightDigitTimeRegex = `${ChineseDateTime.TimePeriodTimePeriodConnectWords}(?${ChineseDateTime.TimeDayDescRegex}?${ChineseDateTime.TimeDigitTimeRegex})(之间)?`; + ChineseDateTime.TimePeriodShortLeftChsTimeRegex = `(从)?(?${ChineseDateTime.TimeDayDescRegex}?(${ChineseDateTime.TimeHourChsRegex}))`; + ChineseDateTime.TimePeriodShortLeftDigitTimeRegex = `(从)?(?${ChineseDateTime.TimeDayDescRegex}?(${ChineseDateTime.TimeHourNumRegex}))`; + ChineseDateTime.TimePeriodRegexes1 = `(${ChineseDateTime.TimePeriodLeftDigitTimeRegex}${ChineseDateTime.TimePeriodRightDigitTimeRegex}|${ChineseDateTime.TimePeriodLeftChsTimeRegex}${ChineseDateTime.TimePeriodRightChsTimeRegex})`; + ChineseDateTime.TimePeriodRegexes2 = `(${ChineseDateTime.TimePeriodShortLeftDigitTimeRegex}${ChineseDateTime.TimePeriodRightDigitTimeRegex}|${ChineseDateTime.TimePeriodShortLeftChsTimeRegex}${ChineseDateTime.TimePeriodRightChsTimeRegex})`; + ChineseDateTime.ParserConfigurationBefore = `(之前|以前|前)`; + ChineseDateTime.ParserConfigurationAfter = `(之后|之後|以后|以後|后|後)`; + ChineseDateTime.ParserConfigurationUntil = `(直到|直至|截至|截止(到)?)`; + ChineseDateTime.ParserConfigurationSincePrefix = `(自从|自|自打|打)`; + ChineseDateTime.ParserConfigurationSinceSuffix = `(以来|开始)`; + ChineseDateTime.ParserConfigurationLastWeekDayToken = '最后一个'; + ChineseDateTime.ParserConfigurationNextMonthToken = '下一个'; + ChineseDateTime.ParserConfigurationLastMonthToken = '上一个'; + ChineseDateTime.ParserConfigurationDatePrefix = ' '; + ChineseDateTime.ParserConfigurationUnitMap = new Map([["年", "Y"], ["月", "MON"], ["个月", "MON"], ["日", "D"], ["周", "W"], ["天", "D"], ["小时", "H"], ["时", "H"], ["分钟", "M"], ["分", "M"], ["秒钟", "S"], ["秒", "S"], ["星期", "W"]]); + ChineseDateTime.ParserConfigurationUnitValueMap = new Map([["years", 31536000], ["year", 31536000], ["months", 2592000], ["month", 2592000], ["weeks", 604800], ["week", 604800], ["days", 86400], ["day", 86400], ["hours", 3600], ["hour", 3600], ["hrs", 3600], ["hr", 3600], ["h", 3600], ["minutes", 60], ["minute", 60], ["mins", 60], ["min", 60], ["seconds", 1], ["second", 1], ["secs", 1], ["sec", 1]]); + ChineseDateTime.ParserConfigurationSeasonMap = new Map([["春", "SP"], ["夏", "SU"], ["秋", "FA"], ["冬", "WI"]]); + ChineseDateTime.ParserConfigurationSeasonValueMap = new Map([["SP", 3], ["SU", 6], ["FA", 9], ["WI", 12]]); + ChineseDateTime.ParserConfigurationCardinalMap = new Map([["1", 1], ["2", 2], ["3", 3], ["4", 4], ["5", 5], ["一", 1], ["二", 2], ["三", 3], ["四", 4], ["五", 5], ["第一个", 1], ["第二个", 2], ["第三个", 3], ["第四个", 4], ["第五个", 5], ["第一", 1], ["第二", 2], ["第三", 3], ["第四", 4], ["第五", 5]]); + ChineseDateTime.ParserConfigurationDayOfMonth = new Map([["1", 1], ["2", 2], ["3", 3], ["4", 4], ["5", 5], ["6", 6], ["7", 7], ["8", 8], ["9", 9], ["10", 10], ["11", 11], ["12", 12], ["13", 13], ["14", 14], ["15", 15], ["16", 16], ["17", 17], ["18", 18], ["19", 19], ["20", 20], ["21", 21], ["22", 22], ["23", 23], ["24", 24], ["25", 25], ["26", 26], ["27", 27], ["28", 28], ["29", 29], ["30", 30], ["31", 31], ["01", 1], ["02", 2], ["03", 3], ["04", 4], ["05", 5], ["06", 6], ["07", 7], ["08", 8], ["09", 9], ["1日", 1], ["2日", 2], ["3日", 3], ["4日", 4], ["5日", 5], ["6日", 6], ["7日", 7], ["8日", 8], ["9日", 9], ["10日", 10], ["11日", 11], ["12日", 12], ["13日", 13], ["14日", 14], ["15日", 15], ["16日", 16], ["17日", 17], ["18日", 18], ["19日", 19], ["20日", 20], ["21日", 21], ["22日", 22], ["23日", 23], ["24日", 24], ["25日", 25], ["26日", 26], ["27日", 27], ["28日", 28], ["29日", 29], ["30日", 30], ["31日", 31], ["一日", 1], ["十一日", 11], ["二十日", 20], ["十日", 10], ["二十一日", 21], ["三十一日", 31], ["二日", 2], ["三日", 3], ["四日", 4], ["五日", 5], ["六日", 6], ["七日", 7], ["八日", 8], ["九日", 9], ["十二日", 12], ["十三日", 13], ["十四日", 14], ["十五日", 15], ["十六日", 16], ["十七日", 17], ["十八日", 18], ["十九日", 19], ["二十二日", 22], ["二十三日", 23], ["二十四日", 24], ["二十五日", 25], ["二十六日", 26], ["二十七日", 27], ["二十八日", 28], ["二十九日", 29], ["三十日", 30], ["1号", 1], ["2号", 2], ["3号", 3], ["4号", 4], ["5号", 5], ["6号", 6], ["7号", 7], ["8号", 8], ["9号", 9], ["10号", 10], ["11号", 11], ["12号", 12], ["13号", 13], ["14号", 14], ["15号", 15], ["16号", 16], ["17号", 17], ["18号", 18], ["19号", 19], ["20号", 20], ["21号", 21], ["22号", 22], ["23号", 23], ["24号", 24], ["25号", 25], ["26号", 26], ["27号", 27], ["28号", 28], ["29号", 29], ["30号", 30], ["31号", 31], ["一号", 1], ["十一号", 11], ["二十号", 20], ["十号", 10], ["二十一号", 21], ["三十一号", 31], ["二号", 2], ["三号", 3], ["四号", 4], ["五号", 5], ["六号", 6], ["七号", 7], ["八号", 8], ["九号", 9], ["十二号", 12], ["十三号", 13], ["十四号", 14], ["十五号", 15], ["十六号", 16], ["十七号", 17], ["十八号", 18], ["十九号", 19], ["二十二号", 22], ["二十三号", 23], ["二十四号", 24], ["二十五号", 25], ["二十六号", 26], ["二十七号", 27], ["二十八号", 28], ["二十九号", 29], ["三十号", 30], ["初一", 32], ["三十", 30], ["一", 1], ["十一", 11], ["二十", 20], ["十", 10], ["二十一", 21], ["三十一", 31], ["二", 2], ["三", 3], ["四", 4], ["五", 5], ["六", 6], ["七", 7], ["八", 8], ["九", 9], ["十二", 12], ["十三", 13], ["十四", 14], ["十五", 15], ["十六", 16], ["十七", 17], ["十八", 18], ["十九", 19], ["二十二", 22], ["二十三", 23], ["二十四", 24], ["二十五", 25], ["二十六", 26], ["二十七", 27], ["二十八", 28], ["二十九", 29]]); + ChineseDateTime.ParserConfigurationDayOfWeek = new Map([["星期一", 1], ["星期二", 2], ["星期三", 3], ["星期四", 4], ["星期五", 5], ["星期六", 6], ["星期天", 0], ["星期日", 0], ["礼拜一", 1], ["礼拜二", 2], ["礼拜三", 3], ["礼拜四", 4], ["礼拜五", 5], ["礼拜六", 6], ["礼拜天", 0], ["礼拜日", 0], ["周一", 1], ["周二", 2], ["周三", 3], ["周四", 4], ["周五", 5], ["周六", 6], ["周日", 0], ["周天", 0], ["禮拜一", 1], ["禮拜二", 2], ["禮拜三", 3], ["禮拜四", 4], ["禮拜五", 5], ["禮拜六", 6], ["禮拜天", 0], ["禮拜日", 0], ["週一", 1], ["週二", 2], ["週三", 3], ["週四", 4], ["週五", 5], ["週六", 6], ["週日", 0], ["週天", 0]]); + ChineseDateTime.ParserConfigurationMonthOfYear = new Map([["1", 1], ["2", 2], ["3", 3], ["4", 4], ["5", 5], ["6", 6], ["7", 7], ["8", 8], ["9", 9], ["10", 10], ["11", 11], ["12", 12], ["01", 1], ["02", 2], ["03", 3], ["04", 4], ["05", 5], ["06", 6], ["07", 7], ["08", 8], ["09", 9], ["一月", 1], ["二月", 2], ["三月", 3], ["四月", 4], ["五月", 5], ["六月", 6], ["七月", 7], ["八月", 8], ["九月", 9], ["十月", 10], ["十一月", 11], ["十二月", 12], ["1月", 1], ["2月", 2], ["3月", 3], ["4月", 4], ["5月", 5], ["6月", 6], ["7月", 7], ["8月", 8], ["9月", 9], ["10月", 10], ["11月", 11], ["12月", 12], ["01月", 1], ["02月", 2], ["03月", 3], ["04月", 4], ["05月", 5], ["06月", 6], ["07月", 7], ["08月", 8], ["09月", 9], ["正月", 13], ["大年", 13]]); + ChineseDateTime.DateTimeSimpleAmRegex = `(?早|晨)`; + ChineseDateTime.DateTimeSimplePmRegex = `(?晚)`; + ChineseDateTime.DateTimePeriodMORegex = `(凌晨|清晨|早上|早|上午)`; + ChineseDateTime.DateTimePeriodAFRegex = `(中午|下午|午后|傍晚)`; + ChineseDateTime.DateTimePeriodEVRegex = `(晚上|夜里|夜晚|晚)`; + ChineseDateTime.DateTimePeriodNIRegex = `(半夜|夜间|深夜)`; + ChineseDateTime.DurationUnitValueMap = new Map([["Y", 31536000], ["Mon", 2592000], ["W", 604800], ["D", 86400], ["H", 3600], ["M", 60], ["S", 1]]); + ChineseDateTime.HolidayNoFixedTimex = new Map([["父亲节", "-06-WXX-6-3"], ["母亲节", "-05-WXX-7-2"], ["感恩节", "-11-WXX-4-4"]]); + ChineseDateTime.MergedBeforeRegex = `(前|之前)$`; + ChineseDateTime.MergedAfterRegex = `(后|後|之后|之後)$`; + ChineseDateTime.TimeNumberDictionary = new Map([["零", 0], ["一", 1], ["二", 2], ["三", 3], ["四", 4], ["五", 5], ["六", 6], ["七", 7], ["八", 8], ["九", 9], ["〇", 0], ["两", 2], ["十", 10]]); + ChineseDateTime.TimeLowBoundDesc = new Map([["中午", 11], ["下午", 12], ["午后", 12], ["晚上", 18], ["夜里", 18], ["夜晚", 18], ["夜间", 18], ["深夜", 18], ["傍晚", 18], ["晚", 18], ["pm", 12]]); + ChineseDateTime.DefaultLanguageFallback = 'DMY'; +})(ChineseDateTime = exports.ChineseDateTime || (exports.ChineseDateTime = {})); + +}); + +unwrapExports(chineseDateTime); + +var models$6 = createCommonjsModule(function (module, exports) { +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); + +var CompositeEntityType; +(function (CompositeEntityType) { + CompositeEntityType[CompositeEntityType["Age"] = 0] = "Age"; + CompositeEntityType[CompositeEntityType["Currency"] = 1] = "Currency"; + CompositeEntityType[CompositeEntityType["Dimension"] = 2] = "Dimension"; + CompositeEntityType[CompositeEntityType["Temperature"] = 3] = "Temperature"; +})(CompositeEntityType = exports.CompositeEntityType || (exports.CompositeEntityType = {})); +class AbstractNumberWithUnitModel { + constructor(extractorParsersMap) { + this.extractorParsersMap = extractorParsersMap; + } + parse(query) { + query = recognizersText.FormatUtility.preProcess(query, false); + let extractionResults = new Array(); + for (let kv of this.extractorParsersMap.entries()) { + let extractor = kv[0]; + let parser = kv[1]; + let extractResults = extractor.extract(query); + let parseResults = []; + for (let i = 0; i < extractResults.length; i++) { + let r = parser.parse(extractResults[i]); + if (r.value !== null) { + if (r.value instanceof Array) { + for (let j = 0; j < r.value.length; j++) { + parseResults.push(r.value[j]); + } + } + else { + parseResults.push(r); + } + } + } + let modelResults = parseResults.map(o => ({ + start: o.start, + end: o.start + o.length - 1, + resolution: this.getResolution(o.value), + text: o.text, + typeName: this.modelTypeName + })); + modelResults.forEach(result => { + let bAdd = true; + extractionResults.forEach(extractionResult => { + if (extractionResult.start === result.start && extractionResult.end === result.end) { + bAdd = false; + } + }); + if (bAdd) { + extractionResults.push(result); + } + }); + } + return extractionResults; + } + getResolution(data) { + if (typeof data === 'undefined') + return null; + let result = typeof data === "string" + ? { value: data.toString() } + : { value: data.number, unit: data.unit }; + if (data.isoCurrency) { + result['isoCurrency'] = data.isoCurrency; + } + return result; + } +} +exports.AbstractNumberWithUnitModel = AbstractNumberWithUnitModel; +class AgeModel extends AbstractNumberWithUnitModel { + constructor() { + super(...arguments); + this.modelTypeName = "age"; + } +} +exports.AgeModel = AgeModel; +class CurrencyModel extends AbstractNumberWithUnitModel { + constructor() { + super(...arguments); + this.modelTypeName = "currency"; + } +} +exports.CurrencyModel = CurrencyModel; +class DimensionModel extends AbstractNumberWithUnitModel { + constructor() { + super(...arguments); + this.modelTypeName = "dimension"; + } +} +exports.DimensionModel = DimensionModel; +class TemperatureModel extends AbstractNumberWithUnitModel { + constructor() { + super(...arguments); + this.modelTypeName = "temperature"; + } +} +exports.TemperatureModel = TemperatureModel; + +}); + +unwrapExports(models$6); + +var baseUnits = createCommonjsModule(function (module, exports) { +"use strict"; +// ------------------------------------------------------------------------------ +// +// This code was generated by a tool. +// Changes to this file may cause incorrect behavior and will be lost if +// the code is regenerated. +// +// ------------------------------------------------------------------------------ +Object.defineProperty(exports, "__esModule", { value: true }); +var BaseUnits; +(function (BaseUnits) { + BaseUnits.HourRegex = `(?00|01|02|03|04|05|06|07|08|09|0|10|11|12|13|14|15|16|17|18|19|20|21|22|23|24|1|2|3|4|5|6|7|8|9)(h)?`; + BaseUnits.MinuteRegex = `(?00|01|02|03|04|05|06|07|08|09|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|0|1|2|3|4|5|6|7|8|9)(?!\\d)`; + BaseUnits.SecondRegex = `(?00|01|02|03|04|05|06|07|08|09|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|0|1|2|3|4|5|6|7|8|9)`; + BaseUnits.PmNonUnitRegex = `(${BaseUnits.HourRegex}\\s*:\\s*${BaseUnits.MinuteRegex}(\\s*:\\s*${BaseUnits.SecondRegex})?\\s*pm)`; + BaseUnits.AmbiguousTimeTerm = 'pm'; +})(BaseUnits = exports.BaseUnits || (exports.BaseUnits = {})); + +}); + +unwrapExports(baseUnits); + +var constants$4 = createCommonjsModule(function (module, exports) { +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); + +class Constants { +} +Constants.SYS_UNIT = "builtin.unit"; +Constants.SYS_UNIT_DIMENSION = "builtin.unit.dimension"; +Constants.SYS_UNIT_AGE = "builtin.unit.age"; +Constants.SYS_UNIT_AREA = "builtin.unit.area"; +Constants.SYS_UNIT_CURRENCY = "builtin.unit.currency"; +Constants.SYS_UNIT_LENGTH = "builtin.unit.length"; +Constants.SYS_UNIT_SPEED = "builtin.unit.speed"; +Constants.SYS_UNIT_TEMPERATURE = "builtin.unit.temperature"; +Constants.SYS_UNIT_VOLUME = "builtin.unit.volume"; +Constants.SYS_UNIT_WEIGHT = "builtin.unit.weight"; +Constants.SYS_NUM = "builtin.num"; +// For cases like '2:00 pm', both 'pm' and '00 pm' are not dimension +Constants.AMBIGUOUS_TIME_TERM = baseUnits.BaseUnits.AmbiguousTimeTerm; +// For currencies without ISO codes, we use internal values prefixed by '_'. +// These values should never be present in parse output. +Constants.FAKE_ISO_CODE_PREFIX = "_"; +exports.Constants = Constants; + +}); + +unwrapExports(constants$4); + +/** + * lodash (Custom Build) + * Build: `lodash modularize exports="npm" -o ./` + * Copyright jQuery Foundation and other contributors + * Released under MIT license + * Based on Underscore.js 1.8.3 + * Copyright Jeremy Ashkenas, DocumentCloud and Investigative Reporters & Editors + */ + +/** `Object#toString` result references. */ +var symbolTag$3 = '[object Symbol]'; + +/** Used for built-in method references. */ +var objectProto$3 = Object.prototype; + +/** + * Used to resolve the + * [`toStringTag`](http://ecma-international.org/ecma-262/6.0/#sec-object.prototype.tostring) + * of values. + */ +var objectToString$3 = objectProto$3.toString; + +/** + * The base implementation of methods like `_.max` and `_.min` which accepts a + * `comparator` to determine the extremum value. + * + * @private + * @param {Array} array The array to iterate over. + * @param {Function} iteratee The iteratee invoked per iteration. + * @param {Function} comparator The comparator used to compare values. + * @returns {*} Returns the extremum value. + */ +function baseExtremum(array, iteratee, comparator) { + var index = -1, + length = array.length; + + while (++index < length) { + var value = array[index], + current = iteratee(value); + + if (current != null && (computed === undefined + ? (current === current && !isSymbol$3(current)) + : comparator(current, computed) + )) { + var computed = current, + result = value; + } + } + return result; +} + +/** + * The base implementation of `_.gt` which doesn't coerce arguments to numbers. + * + * @private + * @param {*} value The value to compare. + * @param {*} other The other value to compare. + * @returns {boolean} Returns `true` if `value` is greater than `other`, + * else `false`. + */ +function baseGt(value, other) { + return value > other; +} + +/** + * Checks if `value` is object-like. A value is object-like if it's not `null` + * and has a `typeof` result of "object". + * + * @static + * @memberOf _ + * @since 4.0.0 + * @category Lang + * @param {*} value The value to check. + * @returns {boolean} Returns `true` if `value` is object-like, else `false`. + * @example + * + * _.isObjectLike({}); + * // => true + * + * _.isObjectLike([1, 2, 3]); + * // => true + * + * _.isObjectLike(_.noop); + * // => false + * + * _.isObjectLike(null); + * // => false + */ +function isObjectLike$3(value) { + return !!value && typeof value == 'object'; +} + +/** + * Checks if `value` is classified as a `Symbol` primitive or object. + * + * @static + * @memberOf _ + * @since 4.0.0 + * @category Lang + * @param {*} value The value to check. + * @returns {boolean} Returns `true` if `value` is correctly classified, + * else `false`. + * @example + * + * _.isSymbol(Symbol.iterator); + * // => true + * + * _.isSymbol('abc'); + * // => false + */ +function isSymbol$3(value) { + return typeof value == 'symbol' || + (isObjectLike$3(value) && objectToString$3.call(value) == symbolTag$3); +} + +/** + * This method returns the first argument given to it. + * + * @static + * @since 0.1.0 + * @memberOf _ + * @category Util + * @param {*} value Any value. + * @returns {*} Returns `value`. + * @example + * + * var object = { 'user': 'fred' }; + * + * _.identity(object) === object; + * // => true + */ +function identity(value) { + return value; +} + +/** + * Computes the maximum value of `array`. If `array` is empty or falsey, + * `undefined` is returned. + * + * @static + * @since 0.1.0 + * @memberOf _ + * @category Math + * @param {Array} array The array to iterate over. + * @returns {*} Returns the maximum value. + * @example + * + * _.max([4, 2, 8, 6]); + * // => 8 + * + * _.max([]); + * // => undefined + */ +function max(array) { + return (array && array.length) + ? baseExtremum(array, identity, baseGt) + : undefined; +} + +var lodash_max = max; + +var extractors$16 = createCommonjsModule(function (module, exports) { +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); + + + + + +class NumberWithUnitExtractor { + constructor(config) { + this.config = config; + if (this.config.suffixList && this.config.suffixList.size > 0) { + this.suffixRegexes = this.buildRegexFromSet(Array.from(this.config.suffixList.values())); + } + else { + this.suffixRegexes = new Set(); // empty + } + if (this.config.prefixList && this.config.prefixList.size > 0) { + let maxLength = 0; + this.config.prefixList.forEach(preMatch => { + let len = lodash_max(preMatch.split('|').filter(s => s && s.length).map(s => s.length)); + maxLength = maxLength >= len ? maxLength : len; + }); + // 2 is the maxium length of spaces. + this.maxPrefixMatchLen = maxLength + 2; + this.prefixRegexes = this.buildRegexFromSet(Array.from(this.config.prefixList.values())); + } + else { + this.prefixRegexes = new Set(); // empty + } + this.separateRegex = this.buildSeparateRegexFromSet(); + } + extract(source) { + if (!this.preCheckStr(source)) { + return new Array(); + } + let mappingPrefix = new Map(); + let matched = new Array(source.length); + let numbers = this.config.unitNumExtractor.extract(source); + let result = new Array(); + let sourceLen = source.length; + /* Mix prefix and numbers, make up a prefix-number combination */ + if (this.maxPrefixMatchLen !== 0) { + numbers.forEach(num => { + if (num.start === undefined || num.length === undefined) { + return; + } + let maxFindPref = Math.min(this.maxPrefixMatchLen, num.start); + if (maxFindPref === 0) { + return; + } + /* Scan from left to right , find the longest match */ + let leftStr = source.substring(num.start - maxFindPref, num.start - maxFindPref + maxFindPref); + + let lastIndex = leftStr.length; + let bestMatch = null; + this.prefixRegexes.forEach(regex => { + let collection = recognizersText.RegExpUtility.getMatches(regex, leftStr).filter(m => m.length); + if (collection.length === 0) { + return; + } + collection.forEach(match => { + if (leftStr.substring(match.index, lastIndex).trim() === match.value) { + if (bestMatch === null || bestMatch.index >= match.index) { + bestMatch = match; + } + } + }); + }); + if (bestMatch !== null) { + let unitStr = leftStr.substring(bestMatch.index, lastIndex); + mappingPrefix.set(num.start, { + offset: lastIndex - bestMatch.index, + unitString: unitStr + }); + } + }); + } + for (let num of numbers) { + if (num.start === undefined || num.length === undefined) { + continue; + } + let start = num.start; + let length = num.length; + let maxFindLen = sourceLen - start - length; + let prefixUnit = mappingPrefix.has(start) ? mappingPrefix.get(start) : null; + if (maxFindLen > 0) { + let rightSub = source.substring(start + length, start + length + maxFindLen); + let unitMatch = Array.from(this.suffixRegexes.values()).map(r => recognizersText.RegExpUtility.getMatches(r, rightSub)) + .filter(m => m.length > 0); + let maxlen = 0; + for (let i = 0; i < unitMatch.length; i++) { + for (let m of unitMatch[i]) { + if (m.length > 0) { + let endpos = m.index + m.length; + if (m.index >= 0) { + let midStr = rightSub.substring(0, Math.min(m.index, rightSub.length)); + if (maxlen < endpos && (recognizersText.StringUtility.isNullOrWhitespace(midStr) || midStr.trim() === this.config.connectorToken)) { + maxlen = endpos; + } + } + } + } + } + if (maxlen !== 0) { + for (let i = 0; i < length + maxlen; i++) { + matched[i + start] = true; + } + let substr = source.substring(start, start + length + maxlen); + let er = { + start: start, + length: length + maxlen, + text: substr, + type: this.config.extractType + }; + if (prefixUnit !== null) { + er.start -= prefixUnit.offset; + er.length += prefixUnit.offset; + er.text = prefixUnit.unitString + er.text; + } + /* Relative position will be used in Parser */ + num.start = start - er.start; + er.data = num; + let isDimensionFallsInPmTime = false; + if (er.type === constants$4.Constants.SYS_UNIT_DIMENSION) { + let nonUnitMatch = recognizersText.RegExpUtility.getMatches(this.config.pmNonUnitRegex, source); + nonUnitMatch.forEach(match => { + if (er.start >= match.index && er.start + er.length <= match.index + match.length) { + isDimensionFallsInPmTime = true; + } + }); + } + if (isDimensionFallsInPmTime) { + continue; + } + result.push(er); + continue; + } + } + if (prefixUnit !== null) { + let er = { + start: num.start - prefixUnit.offset, + length: num.length + prefixUnit.offset, + text: prefixUnit.unitString + num.text, + type: this.config.extractType + }; + /* Relative position will be used in Parser */ + num.start = start - er.start; + er.data = num; + result.push(er); + } + } + // extract Separate unit + if (this.separateRegex !== null) { + this.extractSeparateUnits(source, result); + } + return result; + } + validateUnit(source) { + return source.substring(0, 1) !== '-'; + } + preCheckStr(str) { + return str && str.length; + } + extractSeparateUnits(source, numDependResults) { + // Default is false + let matchResult = new Array(source.length); + numDependResults.forEach(numDependResult => { + let start = numDependResult.start; + let i = 0; + do { + matchResult[start + i++] = true; + } while (i < numDependResult.length); + }); + // Extract all SeparateUnits, then merge it with numDependResults + let matchCollection = recognizersText.RegExpUtility.getMatches(this.separateRegex, source); + if (matchCollection.length > 0) { + matchCollection.forEach(match => { + let i = 0; + while (i < match.length && !matchResult[match.index + i]) { + i++; + } + if (i === match.length) { + // Mark as extracted + for (let j = 0; j < i; j++) { + matchResult[j] = true; + } + let isDimensionFallsInPmTime = false; + if (match.value === constants$4.Constants.AMBIGUOUS_TIME_TERM) { + let nonUnitMatch = recognizersText.RegExpUtility.getMatches(this.config.pmNonUnitRegex, source); + nonUnitMatch.forEach(time => { + if (this.isDimensionFallsInTime(match, time)) { + isDimensionFallsInPmTime = true; + } + }); + } + if (isDimensionFallsInPmTime === false) { + numDependResults.push({ + start: match.index, + length: match.length, + text: match.value, + type: this.config.extractType, + data: null + }); + } + } + }); + } + } + buildRegexFromSet(collection, ignoreCase = true) { + return new Set(collection.map(regexString => { + let regexTokens = regexString.split('|').map(lodash_escaperegexp); + let pattern = `${this.config.buildPrefix}(${regexTokens.join('|')})${this.config.buildSuffix}`; + let options = "gs"; + if (ignoreCase) + options += "i"; + return recognizersText.RegExpUtility.getSafeRegExp(pattern, options); + })); + } + buildSeparateRegexFromSet(ignoreCase = true) { + let separateWords = new Set(); + if (this.config.prefixList && this.config.prefixList.size) { + for (let addWord of this.config.prefixList.values()) { + addWord.split('|').filter(s => s && s.length) + .filter(this.validateUnit) + .forEach(word => separateWords.add(word)); + } + } + if (this.config.suffixList && this.config.suffixList.size) { + for (let addWord of this.config.suffixList.values()) { + addWord.split('|').filter(s => s && s.length) + .filter(this.validateUnit) + .forEach(word => separateWords.add(word)); + } + } + if (this.config.ambiguousUnitList && this.config.ambiguousUnitList.length) { + for (let abandonWord of this.config.ambiguousUnitList) { + if (separateWords.has(abandonWord)) { + separateWords.delete(abandonWord); + } + } + } + let regexTokens = Array.from(separateWords.values()).map(lodash_escaperegexp); + if (regexTokens.length === 0) { + return null; + } + // Sort SeparateWords using descending length. + regexTokens = regexTokens.sort(this.dinoComparer); + let pattern = `${this.config.buildPrefix}(${regexTokens.join('|')})${this.config.buildSuffix}`; + let options = "gs"; + if (ignoreCase) + options += "i"; + return recognizersText.RegExpUtility.getSafeRegExp(pattern, options); + } + dinoComparer(x, y) { + if (x === null) { + if (y === null) { + // If x is null and y is null, they're + // equal. + return 0; + } + else { + // If x is null and y is not null, y + // is greater. + return 1; + } + } + else { + // If x is not null... + // + if (y === null) + // ...and y is null, x is greater. + { + return -1; + } + else { + // ...and y is not null, compare the + // lengths of the two strings. + // + let retval = y.length - x.length; + if (retval !== 0) { + // If the strings are not of equal length, + // the longer string is greater. + // + return retval; + } + else { + // If the strings are of equal length, + // sort them with ordinary string comparison. + // + let xl = x.toLowerCase(); + let yl = y.toLowerCase(); + if (xl < yl) { + return -1; + } + if (xl > yl) { + return 1; + } + return 0; + } + } + } + } + isDimensionFallsInTime(dimension, time) { + let isSubMatch = false; + if (dimension.index >= time.index && dimension.index + dimension.length <= time.index + time.length) { + isSubMatch = true; + } + return isSubMatch; + } +} +exports.NumberWithUnitExtractor = NumberWithUnitExtractor; +class BaseMergedUnitExtractor { + constructor(config) { + this.config = config; + this.innerExtractor = new NumberWithUnitExtractor(config); + } + extract(source) { + let result = new Array(); + if (this.config.extractType === constants$4.Constants.SYS_UNIT_CURRENCY) { + result = this.mergeCompoundUnits(source); + } + else { + result = this.innerExtractor.extract(source); + } + return result; + } + mergeCompoundUnits(source) { + let result = new Array(); + let ers = this.innerExtractor.extract(source); + this.MergePureNumber(source, ers); + let groups = []; + groups[0] = 0; + for (let i = 0; i < ers.length - 1; i++) { + if (ers[i].type !== ers[i + 1].type && ers[i].type !== recognizersTextNumber.Constants.SYS_NUM && ers[i + 1].type !== recognizersTextNumber.Constants.SYS_NUM) { + continue; + } + if (ers[i].data != null && ers[i].data.data != null && !ers[i].data.data.startsWith('Integer')) { + groups[i + 1] = groups[i] + 1; + continue; + } + let middleBegin = ers[i].start + ers[i].length; + let middleEnd = ers[i + 1].start; + let middleStr = source.substring(middleBegin, middleEnd).trim().toLowerCase(); + // Separated by whitespace + if (recognizersText.StringUtility.isNullOrEmpty(middleStr)) { + groups[i + 1] = groups[i]; + continue; + } + // Separated by connectors + let match = recognizersText.RegExpUtility.getMatches(this.config.compoundUnitConnectorRegex, middleStr).pop(); + if (match && match.index === 0 && match.length === middleStr.length) { + groups[i + 1] = groups[i]; + } + else { + groups[i + 1] = groups[i] + 1; + } + } + for (let i = 0; i < ers.length; i++) { + if (i === 0 || groups[i] !== groups[i - 1]) { + let tmpInner = new recognizersText.ExtractResult(); + tmpInner.data = ers[i].data; + tmpInner.length = ers[i].length; + tmpInner.start = ers[i].start; + tmpInner.text = ers[i].text; + tmpInner.type = ers[i].type; + let tmpExtractResult = ers[i]; + tmpExtractResult.data = new Array(); + tmpExtractResult.data.push(tmpInner); + result.push(tmpExtractResult); + } + // Reduce extract results in same group + if (i + 1 < ers.length && groups[i + 1] === groups[i]) { + let group = groups[i]; + let periodBegin = result[group].start; + let periodEnd = ers[i + 1].start + ers[i + 1].length; + result[group].length = periodEnd - periodBegin; + result[group].text = source.substring(periodBegin, periodEnd); + result[group].type = constants$4.Constants.SYS_UNIT_CURRENCY; + result[group].data.push(ers[i + 1]); + } + } + for (let i = 0; i < result.length; i++) { + let innerData = result[i].data; + if (innerData && innerData.length === 1) { + result[i] = innerData[0]; + } + } + result = result.filter(er => er.type !== recognizersTextNumber.Constants.SYS_NUM); + return result; + } + MergePureNumber(source, result) { + let numErs = this.config.unitNumExtractor.extract(source); + let unitNumbers = new Array(); + let i; + let j; + for (i = 0, j = 0; i < numErs.length; i++) { + let hasBehindExtraction = false; + while (j < result.length && result[j].start + result[j].length < numErs[i].start) { + hasBehindExtraction = true; + j++; + } + if (!hasBehindExtraction) { + continue; + } + let middleBegin = result[j - 1].start + result[j - 1].length; + let middleEnd = numErs[i].start; + let middleStr = source.substring(middleBegin, middleEnd).trim().toLowerCase(); + // Separated by whitespace + if (recognizersText.StringUtility.isNullOrEmpty(middleStr)) { + unitNumbers.push(numErs[i]); + continue; + } + // Separated by connectors + let match = recognizersText.RegExpUtility.getMatches(this.config.compoundUnitConnectorRegex, middleStr).pop(); + if (match && match.index === 0 && match.length === middleStr.length) { + unitNumbers.push(numErs[i]); + } + } + unitNumbers.forEach(extractResult => { + let overlap = false; + result.forEach(er => { + if (er.start <= extractResult.start && er.start + er.length >= extractResult.start) { + overlap = true; + } + }); + if (!overlap) { + result.push(extractResult); + } + }); + result.sort((x, y) => x.start - y.start); + } +} +exports.BaseMergedUnitExtractor = BaseMergedUnitExtractor; +class PrefixUnitResult { +} +exports.PrefixUnitResult = PrefixUnitResult; + +}); + +unwrapExports(extractors$16); + +/** + * lodash 3.0.0 (Custom Build) + * Build: `lodash modern modularize exports="npm" -o ./` + * Copyright 2012-2015 The Dojo Foundation + * Based on Underscore.js 1.7.0 + * Copyright 2009-2015 Jeremy Ashkenas, DocumentCloud and Investigative Reporters & Editors + * Available under MIT license + */ + +/** + * Gets the last element of `array`. + * + * @static + * @memberOf _ + * @category Array + * @param {Array} array The array to query. + * @returns {*} Returns the last element of `array`. + * @example + * + * _.last([1, 2, 3]); + * // => 3 + */ +function last(array) { + var length = array ? array.length : 0; + return length ? array[length - 1] : undefined; +} + +var lodash_last = last; + +var utilities$4 = createCommonjsModule(function (module, exports) { +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); + +class DictionaryUtils { + static bindDictionary(dictionary, source) { + if (dictionary === null) { + return; + } + dictionary.forEach((value, key) => { + if (recognizersText.StringUtility.isNullOrEmpty(key)) { + return; + } + this.bindUnitsString(source, key, value); + }); + } + static bindUnitsString(dictionary, key, source) { + let values = source.trim().split('|'); + values.forEach(token => { + if (recognizersText.StringUtility.isNullOrWhitespace(token) || dictionary.has(token)) { + return; + } + dictionary.set(token, key); + }); + } +} +exports.DictionaryUtils = DictionaryUtils; + +}); + +unwrapExports(utilities$4); + +var baseCurrency = createCommonjsModule(function (module, exports) { +"use strict"; +// ------------------------------------------------------------------------------ +// +// This code was generated by a tool. +// Changes to this file may cause incorrect behavior and will be lost if +// the code is regenerated. +// +// ------------------------------------------------------------------------------ +Object.defineProperty(exports, "__esModule", { value: true }); +var BaseCurrency; +(function (BaseCurrency) { + BaseCurrency.CurrencyFractionMapping = new Map([["CNY", "FEN|JIAO"], ["__D", "CENT"], ["RUB", "KOPEK"], ["AFN", "PUL"], ["EUR", "CENT"], ["ALL", "QINDARKE"], ["_ALP", "PENNY"], ["GBP", "PENNY"], ["_GGP", "PENNY"], ["DZD", "SANTEEM"], ["AOA", "CENTIMO"], ["ARS", "CENTAVO"], ["AMD", "LUMA"], ["AWG", "CENT"], ["_AP", "PENNY"], ["SHP", "PENNY"], ["AUD", "CENT"], ["AZN", "QƏPIK"], ["BSD", "CENT"], ["BHD", "FILS"], ["BDT", "POISHA"], ["BBD", "CENT"], ["BYN", "KAPYEYKA"], ["BZD", "CENT"], ["XOF", "CENTIME"], ["BMD", "CENT"], ["BTN", "CHETRUM"], ["INR", "PAISA"], ["BOB", "CENTAVO"], ["USD", "CENT"], ["BAM", "FENING"], ["BWP", "THEBE"], ["BRL", "CENTAVO"], ["_BD", "CENT"], ["BND", "SEN"], ["SGD", "CENT"], ["BGN", "STOTINKA"], ["BIF", "CENTIME"], ["KHR", "SEN"], ["XAF", "CENTIME"], ["CAD", "CENT"], ["CVE", "CENTAVO"], ["KYD", "CENT"], ["CLP", "CENTAVO"], ["COP", "CENTAVO"], ["KMF", "CENTIME"], ["CDF", "CENTIME"], ["NZD", "CENT"], ["_CKD", "CENT"], ["CRC", "CENTIMO"], ["HRK", "LIPA"], ["CUC", "CENTAVO"], ["CUP", "CENTAVO"], ["CZK", "HALER"], ["DKK", "ØRE"], ["DJF", "CENTIME"], ["DOP", "CENTAVO"], ["EGP", "PIASTRE"], ["ERN", "CENT"], ["ETB", "SANTIM"], ["FKP", "PENNY"], ["_FOK", "OYRA"], ["FJD", "CENT"], ["XPF", "CENTIME"], ["GMD", "BUTUT"], ["GEL", "TETRI"], ["GHS", "PESEWA"], ["GIP", "PENNY"], ["GTQ", "CENTAVO"], ["GNF", "CENTIME"], ["GYD", "CENT"], ["HTG", "CENTIME"], ["HNL", "CENTAVO"], ["HKD", "CENT"], ["HUF", "FILLER"], ["ISK", "EYRIR"], ["IDR", "SEN"], ["IRR", "DINAR"], ["IQD", "FILS"], ["IMP", "PENNY"], ["ILS", "AGORA"], ["JMD", "CENT"], ["JPY", "SEN"], ["JEP", "PENNY"], ["JOD", "PIASTRE"], ["KZT", "TIIN"], ["KES", "CENT"], ["_KID", "CENT"], ["KPW", "CHON"], ["KRW", "JEON"], ["KWD", "FILS"], ["KGS", "TYIYN"], ["LAK", "ATT"], ["LBP", "PIASTRE"], ["LSL", "SENTE"], ["ZAR", "CENT"], ["LRD", "CENT"], ["LYD", "DIRHAM"], ["CHF", "RAPPEN"], ["MOP", "AVO"], ["MKD", "DENI"], ["MGA", "IRAIMBILANJA"], ["MWK", "TAMBALA"], ["MYR", "SEN"], ["MVR", "LAARI"], ["MRO", "KHOUMS"], ["MUR", "CENT"], ["MXN", "CENTAVO"], ["_MD", "CENT"], ["MDL", "BAN"], ["MNT", "MONGO"], ["MAD", "CENTIME"], ["MZN", "CENTAVO"], ["MMK", "PYA"], ["NAD", "CENT"], ["_ND", "CENT"], ["NPR", "PAISA"], ["NIO", "CENTAVO"], ["NGN", "KOBO"], ["_NID", "CENT"], ["TRY", "KURUS"], ["NOK", "ØRE"], ["OMR", "BAISA"], ["PKR", "PAISA"], ["_PD", "CENT"], ["PAB", "CENTESIMO"], ["PGK", "TOEA"], ["PYG", "CENTIMO"], ["PEN", "CENTIMO"], ["_PND", "CENT"], ["PLN", "GROSZ"], ["QAR", "DIRHAM"], ["RON", "BAN"], ["RWF", "CENTIME"], ["WST", "SENE"], ["STD", "CENTIMO"], ["SAR", "HALALA"], ["RSD", "PARA"], ["SCR", "CENT"], ["SLL", "CENT"], ["SBD", "CENT"], ["SOS", "CENT"], ["_SS", "CENT"], ["_SP", "PENNY"], ["SSP", "PIASTRE"], ["LKR", "CENT"], ["SDG", "PIASTRE"], ["SRD", "CENT"], ["SZL", "CENT"], ["SEK", "ORE"], ["SYP", "PIASTRE"], ["TWD", "CENT"], ["TJS", "DIRAM"], ["TZS", "CENT"], ["THB", "SATANG"], ["PRB", "KOPEK"], ["TTD", "CENT"], ["_TP", "PENNY"], ["TND", "MILLIME"], ["TMT", "TENNESI"], ["TVD", "CENT"], ["UGX", "CENT"], ["UAH", "KOPIYKA"], ["AED", "FILS"], ["UYU", "CENTESIMO"], ["VEF", "CENTIMO"], ["YER", "FILS"], ["ZMW", "NGWEE"]]); + BaseCurrency.CurrencyFractionalRatios = new Map([["Kopek", 100], ["Pul", 100], ["Cent", 100], ["Qindarkë", 100], ["Penny", 100], ["Santeem", 100], ["Cêntimo", 100], ["Centavo", 100], ["Luma", 100], ["Qəpik", 100], ["Fils", 1000], ["Poisha", 100], ["Kapyeyka", 100], ["Centime", 100], ["Chetrum", 100], ["Paisa", 100], ["Fening", 100], ["Thebe", 100], ["Sen", 100], ["Stotinka", 100], ["Jiao", 10], ["Fen", 100], ["Céntimo", 100], ["Lipa", 100], ["Haléř", 100], ["Øre", 100], ["Piastre", 100], ["Santim", 100], ["Oyra", 100], ["Butut", 100], ["Tetri", 100], ["Pesewa", 100], ["Fillér", 100], ["Eyrir", 100], ["Dinar", 100], ["Agora", 100], ["Tïın", 100], ["Chon", 100], ["Jeon", 100], ["Tyiyn", 100], ["Att", 100], ["Sente", 100], ["Dirham", 1000], ["Rappen", 100], ["Avo", 100], ["Deni", 100], ["Iraimbilanja", 5], ["Tambala", 100], ["Laari", 100], ["Khoums", 5], ["Ban", 100], ["Möngö", 100], ["Pya", 100], ["Kobo", 100], ["Kuruş", 100], ["Baisa", 1000], ["Centésimo", 100], ["Toea", 100], ["Sentimo", 100], ["Grosz", 100], ["Sene", 100], ["Halala", 100], ["Para", 100], ["Öre", 100], ["Diram", 100], ["Satang", 100], ["Seniti", 100], ["Millime", 1000], ["Tennesi", 100], ["Kopiyka", 100], ["Tiyin", 100], ["Hào", 10], ["Ngwee", 100]]); +})(BaseCurrency = exports.BaseCurrency || (exports.BaseCurrency = {})); + +}); + +unwrapExports(baseCurrency); + +var parsers$8 = createCommonjsModule(function (module, exports) { +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); + + + + + + +class UnitValue { + constructor() { + this.number = ""; + this.unit = ""; + } +} +exports.UnitValue = UnitValue; +class UnitValueIso extends UnitValue { + constructor() { + super(...arguments); + this.isoCurrency = ""; + } +} +exports.UnitValueIso = UnitValueIso; +class BaseNumberWithUnitParserConfiguration { + constructor(cultureInfo) { + this.cultureInfo = cultureInfo; + this.unitMap = new Map(); + this.currencyFractionNumMap = baseCurrency.BaseCurrency.CurrencyFractionalRatios; + this.currencyFractionMapping = baseCurrency.BaseCurrency.CurrencyFractionMapping; + } + BindDictionary(dictionary) { + utilities$4.DictionaryUtils.bindDictionary(dictionary, this.unitMap); + } +} +exports.BaseNumberWithUnitParserConfiguration = BaseNumberWithUnitParserConfiguration; +class NumberWithUnitParser { + constructor(config) { + this.config = config; + } + parse(extResult) { + let ret = new recognizersText.ParseResult(extResult); + let numberResult; + if (extResult.data && typeof extResult.data === "object") { + numberResult = extResult.data; + } + else if (extResult.type === constants$4.Constants.SYS_NUM) { + ret.value = this.config.internalNumberParser.parse(extResult).value; + return ret; + } + else { + // if there is no unitResult, means there is just unit + numberResult = { start: -1, length: 0, text: null, type: null }; + } + // key contains units + let key = extResult.text; + let unitKeyBuild = ''; + let unitKeys = new Array(); + for (let i = 0; i <= key.length; i++) { + if (i === key.length) { + if (unitKeyBuild.length !== 0) { + this.addIfNotContained(unitKeys, unitKeyBuild.trim()); + } + } + // numberResult.start is a relative position + else if (i === numberResult.start) { + if (unitKeyBuild.length !== 0) { + this.addIfNotContained(unitKeys, unitKeyBuild.trim()); + unitKeyBuild = ''; + } + let o = numberResult.start + numberResult.length - 1; + if (o !== null && !isNaN(o)) { + i = o; + } + } + else { + unitKeyBuild += key[i]; + } + } + /* Unit type depends on last unit in suffix.*/ + let lastUnit = lodash_last(unitKeys); + let normalizedLastUnit = lastUnit.toLowerCase(); + if (this.config.connectorToken && this.config.connectorToken.length && normalizedLastUnit.indexOf(this.config.connectorToken) === 0) { + normalizedLastUnit = normalizedLastUnit.substring(this.config.connectorToken.length).trim(); + lastUnit = lastUnit.substring(this.config.connectorToken.length).trim(); + } + if (key && key.length && (this.config.unitMap !== null)) { + let unitValue = null; + if (this.config.unitMap.has(lastUnit)) { + unitValue = this.config.unitMap.get(lastUnit); + } + else if (this.config.unitMap.has(normalizedLastUnit)) { + unitValue = this.config.unitMap.get(normalizedLastUnit); + } + if (unitValue) { + let numValue = numberResult.text && numberResult.text.length ? this.config.internalNumberParser.parse(numberResult) : null; + let resolutionStr = numValue ? numValue.resolutionStr : null; + ret.value = { number: resolutionStr, unit: unitValue }; + ret.resolutionStr = (`${resolutionStr} ${unitValue}`).trim(); + } + } + return ret; + } + addIfNotContained(keys, newKey) { + if (!keys.some(key => key.includes(newKey))) { + keys.push(newKey); + } + } +} +exports.NumberWithUnitParser = NumberWithUnitParser; +class BaseCurrencyParser { + constructor(config) { + this.config = config; + this.numberWithUnitParser = new NumberWithUnitParser(config); + } + parse(extResult) { + let result = null; + if (extResult.data instanceof Array) { + result = this.mergeCompoundUnit(extResult); + } + else { + result = this.numberWithUnitParser.parse(extResult); + let value = result.value; + if (!this.config.currencyNameToIsoCodeMap.has(value.unit) || this.config.currencyNameToIsoCodeMap.get(value.unit).startsWith(constants$4.Constants.FAKE_ISO_CODE_PREFIX)) { + result.value = { + unit: value.unit, + number: value.number + }; + } + else { + result.value = { + unit: value.unit, + number: value.number, + isoCurrency: this.config.currencyNameToIsoCodeMap.get(value.unit) + }; + } + } + return result; + } + mergeCompoundUnit(compoundResult) { + let results = []; + let compoundUnit = compoundResult.data; + let count = 0; + let result = null; + let numberValue = 0.0; + let mainUnitValue = ''; + let mainUnitIsoCode = ''; + let fractionUnitsString = ''; + for (let i = 0; i < compoundUnit.length; i++) { + let extractResult = compoundUnit[i]; + let parseResult = this.numberWithUnitParser.parse(extractResult); + let parseResultValue = parseResult.value; + let unitValue = parseResultValue != null ? parseResultValue.unit : null; + // Process a new group + if (count === 0) { + if (extractResult.type !== constants$4.Constants.SYS_UNIT_CURRENCY) { + continue; + } + // Initialize a new result + result = new recognizersText.ParseResult(extractResult); + mainUnitValue = unitValue; + numberValue = parseFloat(parseResultValue.number); + result.resolutionStr = parseResult.resolutionStr; + if (this.config.currencyNameToIsoCodeMap.has(unitValue)) { + mainUnitIsoCode = this.config.currencyNameToIsoCodeMap.get(unitValue); + } + // If the main unit can't be recognized, finish process this group. + if (recognizersText.StringUtility.isNullOrEmpty(mainUnitIsoCode)) { + result.value = { + number: numberValue.toString(), + unit: mainUnitValue + }; + results.push(result); + result = null; + continue; + } + if (this.config.currencyFractionMapping.has(mainUnitIsoCode)) { + fractionUnitsString = this.config.currencyFractionMapping.get(mainUnitIsoCode); + } + } + else { + // Match pure number as fraction unit. + if (extractResult.type === recognizersTextNumber.Constants.SYS_NUM) { + numberValue += parseResult.value * (1.0 / 100); + result.resolutionStr += ' ' + parseResult.resolutionStr; + result.length = parseResult.start + parseResult.length - result.start; + count++; + continue; + } + let fractionUnitCode; + let fractionNumValue; + if (this.config.currencyFractionCodeList.has(unitValue)) { + fractionUnitCode = this.config.currencyFractionCodeList.get(unitValue); + } + if (this.config.currencyFractionNumMap.has(unitValue)) { + fractionNumValue = this.config.currencyFractionNumMap.get(unitValue); + } + if (fractionUnitCode && fractionNumValue !== 0 && this.checkUnitsStringContains(fractionUnitCode, fractionUnitsString)) { + numberValue += parseFloat(parseResultValue.number) * (1.0 / fractionNumValue); + result.resolutionStr += ' ' + parseResult.resolutionStr; + result.length = parseResult.start + parseResult.length - result.start; + } + else { + // If the fraction unit doesn't match the main unit, finish process this group. + if (result !== null) { + if (recognizersText.StringUtility.isNullOrEmpty(mainUnitIsoCode) || mainUnitIsoCode.startsWith(constants$4.Constants.FAKE_ISO_CODE_PREFIX)) { + result.value = { + number: numberValue.toString(), + unit: mainUnitValue + }; + } + else { + result.value = { + number: numberValue.toString(), + unit: mainUnitValue, + isoCurrency: mainUnitIsoCode + }; + } + results.push(result); + result = null; + } + count = 0; + i -= 1; + continue; + } + } + count++; + } + if (result !== null) { + if (recognizersText.StringUtility.isNullOrEmpty(mainUnitIsoCode) || mainUnitIsoCode.startsWith(constants$4.Constants.FAKE_ISO_CODE_PREFIX)) { + result.value = { + number: numberValue.toString(), + unit: mainUnitValue + }; + } + else { + result.value = { + number: numberValue.toString(), + unit: mainUnitValue, + isoCurrency: mainUnitIsoCode + }; + } + results.push(result); + } + this.resolveText(results, compoundResult.text, compoundResult.start); + return { value: results }; + } + checkUnitsStringContains(fractionUnitCode, fractionUnitsString) { + let unitsMap = new Map(); + utilities$4.DictionaryUtils.bindUnitsString(unitsMap, '', fractionUnitsString); + return unitsMap.has(fractionUnitCode); + } + resolveText(prs, source, bias) { + prs.forEach(parseResult => { + if (parseResult.start !== null && parseResult.length !== null) { + parseResult.text = source.substr(parseResult.start - bias, parseResult.length); + } + }); + } +} +exports.BaseCurrencyParser = BaseCurrencyParser; +class BaseMergedUnitParser { + constructor(config) { + this.config = config; + this.numberWithUnitParser = new NumberWithUnitParser(config); + this.currencyParser = new BaseCurrencyParser(config); + } + parse(extResult) { + let result; + if (extResult.type === constants$4.Constants.SYS_UNIT_CURRENCY) { + result = this.currencyParser.parse(extResult); + } + else { + result = this.numberWithUnitParser.parse(extResult); + } + return result; + } +} +exports.BaseMergedUnitParser = BaseMergedUnitParser; + +}); + +unwrapExports(parsers$8); + +var englishNumericWithUnit = createCommonjsModule(function (module, exports) { +"use strict"; +// ------------------------------------------------------------------------------ +// +// This code was generated by a tool. +// Changes to this file may cause incorrect behavior and will be lost if +// the code is regenerated. +// +// ------------------------------------------------------------------------------ +Object.defineProperty(exports, "__esModule", { value: true }); +var EnglishNumericWithUnit; +(function (EnglishNumericWithUnit) { + EnglishNumericWithUnit.AgeSuffixList = new Map([["Year", "years old|year old|year-old|years-old|-year-old|-years-old|years of age|year of age"], ["Month", "months old|month old|month-old|months-old|-month-old|-months-old|month of age|months of age"], ["Week", "weeks old|week old|week-old|weeks-old|-week-old|-weeks-old|week of age|weeks of age"], ["Day", "days old|day old|day-old|days-old|-day-old|-days-old|day of age|days of age"]]); + EnglishNumericWithUnit.AreaSuffixList = new Map([["Square kilometer", "sq km|sq kilometer|sq kilometre|sq kilometers|sq kilometres|square kilometer|square kilometre|square kilometers|square kilometres|km2|km^2|km²"], ["Square hectometer", "sq hm|sq hectometer|sq hectometre|sq hectometers|sq hectometres|square hectometer|square hectometre|square hectometers|square hectometres|hm2|hm^2|hm²|hectare|hectares"], ["Square decameter", "sq dam|sq decameter|sq decametre|sq decameters|sq decametres|square decameter|square decametre|square decameters|square decametres|sq dekameter|sq dekametre|sq dekameters|sq dekametres|square dekameter|square dekametre|square dekameters|square dekametres|dam2|dam^2|dam²"], ["Square meter", "sq m|sq meter|sq metre|sq meters|sq metres|sq metre|square meter|square meters|square metre|square metres|m2|m^2|m²"], ["Square decimeter", "sq dm|sq decimeter|sq decimetre|sq decimeters|sq decimetres|square decimeter|square decimetre|square decimeters|square decimetres|dm2|dm^2|dm²"], ["Square centimeter", "sq cm|sq centimeter|sq centimetre|sq centimeters|sq centimetres|square centimeter|square centimetre|square centimeters|square centimetres|cm2|cm^2|cm²"], ["Square millimeter", "sq mm|sq millimeter|sq millimetre|sq millimeters|sq millimetres|square millimeter|square millimetre|square millimeters|square millimetres|mm2|mm^2|mm²"], ["Square inch", "sq in|sq inch|square inch|square inches|in2|in^2|in²"], ["Square foot", "sqft|sq ft|sq foot|sq feet|square foot|square feet|feet2|feet^2|feet²|ft2|ft^2|ft²"], ["Square mile", "sq mi|sq mile|sqmiles|square mile|square miles|mi2|mi^2|mi²"], ["Square yard", "sq yd|sq yard|sq yards|square yard|square yards|yd2|yd^2|yd²"], ["Acre", "-acre|acre|acres"]]); + EnglishNumericWithUnit.CurrencySuffixList = new Map([["Abkhazian apsar", "abkhazian apsar|apsars"], ["Afghan afghani", "afghan afghani|؋|afn|afghanis|afghani"], ["Pul", "pul"], ["Euro", "euros|euro|€|eur"], ["Cent", "cents|cent|-cents|-cent|sen"], ["Albanian lek", "albanian lek|leks|lek"], ["Qindarkë", "qindarkë|qindarkës|qindarke|qindarkes"], ["Angolan kwanza", "angolan kwanza|kz|aoa|kwanza|kwanzas|angolan kwanzas"], ["Armenian dram", "armenian drams|armenian dram"], ["Aruban florin", "aruban florin|ƒ|awg|aruban florins"], ["Bangladeshi taka", "bangladeshi taka|৳|bdt|taka|takas|bangladeshi takas"], ["Paisa", "poisha|paisa"], ["Bhutanese ngultrum", "Bhutanese ngultrum|nu.|btn"], ["Chetrum", "chetrums|chetrum"], ["Bolivian boliviano", "bolivian boliviano|bob|bs.|bolivia boliviano|bolivia bolivianos|bolivian bolivianos"], ["Bosnia and Herzegovina convertible mark", "bosnia and herzegovina convertible mark|bam"], ["Fening", "fenings|fenings"], ["Botswana pula", "botswana pula|bwp|pula|pulas|botswana pulas"], ["Thebe", "thebe"], ["Brazilian real", "brazilian real|r$|brl|brazil real|brazil reals|brazilian reals"], ["Bulgarian lev", "bulgarian lev|bgn|лв|bulgaria lev|bulgaria levs|bulgarian levs"], ["Stotinka", "stotinki|stotinka"], ["Cambodian riel", "cambodian riel|khr|៛|cambodia riel|cambodia riels|cambodian riels"], ["Cape Verdean escudo", "cape verdean escudo|cve"], ["Costa Rican colón", "costa rican colón|costa rican colóns|crc|₡|costa rica colón|costa rica colóns|costa rican colon|costa rican colons|costa rica colon|costa rica colons"], ["Salvadoran colón", "svc|salvadoran colón|salvadoran colóns|salvador colón|salvador colóns|salvadoran colon|salvadoran colons|salvador colon|salvador colons"], ["Céntimo", "céntimo"], ["Croatian kuna", "croatian kuna|kn|hrk|croatia kuna|croatian kunas|croatian kuna kunas"], ["Lipa", "lipa"], ["Czech koruna", "czech koruna|czk|Kč|czech korunas"], ["Haléř", "haléř"], ["Eritrean nakfa", "eritrean nakfa|nfk|ern|eritrean nakfas"], ["Ethiopian birr", "ethiopian birr|etb"], ["Gambian dalasi", "gmd"], ["Butut", "bututs|butut"], ["Georgian lari", "Georgian lari|lari|gel|₾"], ["Tetri", "tetri"], ["Ghanaian cedi", "Ghanaian cedi|ghs|₵|gh₵"], ["Pesewa", "pesewas|pesewa"], ["Guatemalan quetzal", "guatemalan quetzal|gtq|guatemala quetzal"], ["Haitian gourde", "haitian gourde|htg"], ["Honduran lempira", "honduran lempira|hnl"], ["Hungarian forint", "hungarian forint|huf|ft|hungary forint|hungary forints|hungarian forints"], ["Fillér", "fillér"], ["Iranian rial", "iranian rial|irr|iran rial|iran rials|iranian rials"], ["Yemeni rial", "yemeni rial|yer|yemeni rials"], ["Israeli new shekel", "₪|ils|agora"], ["Lithuanian litas", "ltl|lithuanian litas|lithuan litas|lithuanian lit|lithuan lit"], ["Japanese yen", "japanese yen|jpy|yen|-yen|¥|yens|japanese yens|japan yen|japan yens"], ["Kazakhstani tenge", "Kazakhstani tenge|kzt"], ["Kenyan shilling", "kenyan shilling|sh|kes"], ["North Korean won", "north korean won|kpw|north korean wons"], ["South Korean won", "south korean won|krw|south korean wons"], ["Korean won", "korean won|₩|korean wons"], ["Kyrgyzstani som", "kyrgyzstani som|kgs"], ["Uzbekitan som", "uzbekitan som|uzs"], ["Lao kip", "lao kip|lak|₭n|₭"], ["Att", "att"], ["Lesotho loti", "lesotho loti|lsl|loti"], ["Sente", "sente|lisente"], ["South African rand", "south african rand|zar|south africa rand|south africa rands|south african rands"], ["Macanese pataca", "macanese pataca|mop$|mop"], ["Avo", "avos|avo"], ["Macedonian denar", "macedonian denar|mkd|ден"], ["Deni", "deni"], ["Malagasy ariary", "malagasy ariary|mga"], ["Iraimbilanja", "iraimbilanja"], ["Malawian kwacha", "malawian kwacha|mk|mwk"], ["Tambala", "tambala"], ["Malaysian ringgit", "malaysian ringgit|rm|myr|malaysia ringgit|malaysia ringgits|malaysian ringgits"], ["Mauritanian ouguiya", "mauritanian ouguiya|um|mro|mauritania ouguiya|mauritania ouguiyas|mauritanian ouguiyas"], ["Khoums", "khoums"], ["Mongolian tögrög", "mongolian tögrög|mnt|₮|mongolia tögrög|mongolia tögrögs|mongolian tögrögs|mongolian togrog|mongolian togrogs|mongolia togrog|mongolia togrogs"], ["Mozambican metical", "mozambican metical|mt|mzn|mozambica metical|mozambica meticals|mozambican meticals"], ["Burmese kyat", "Burmese kyat|ks|mmk"], ["Pya", "pya"], ["Nicaraguan córdoba", "nicaraguan córdoba|nio"], ["Nigerian naira", "nigerian naira|naira|ngn|₦|nigeria naira|nigeria nairas|nigerian nairas"], ["Kobo", "kobo"], ["Turkish lira", "turkish lira|try|tl|turkey lira|turkey liras|turkish liras"], ["Kuruş", "kuruş"], ["Omani rial", "omani rial|omr|ر.ع."], ["Panamanian balboa", "panamanian balboa|b/.|pab"], ["Centesimo", "centesimo|céntimo"], ["Papua New Guinean kina", "papua new guinean kina|kina|pgk"], ["Toea", "toea"], ["Paraguayan guaraní", "paraguayan guaraní|₲|pyg"], ["Peruvian sol", "peruvian sol|soles|sol|peruvian nuevo sol"], ["Polish złoty", "złoty|polish złoty|zł|pln|zloty|polish zloty|poland zloty|poland złoty"], ["Grosz", "groszy|grosz|grosze"], ["Qatari riyal", "qatari riyal|qar|qatari riyals|qatar riyal|qatar riyals"], ["Saudi riyal", "saudi riyal|sar|saudi riyals"], ["Riyal", "riyal|riyals|rial|﷼"], ["Dirham", "dirham|dirhem|dirhm"], ["Halala", "halalas|halala"], ["Samoan tālā", "samoan tālā|tālā|tala|ws$|samoa|wst|samoan tala"], ["Sene", "sene"], ["São Tomé and Príncipe dobra", "são tomé and príncipe dobra|dobras|dobra|std"], ["Sierra Leonean leone", "sierra Leonean leone|sll|leone|le"], ["Peseta", "pesetas|peseta"], ["Netherlands guilder", "florin|netherlands antillean guilder|ang|ƒ|nederlandse gulden|guilders|guilder|gulden|-guilders|-guilder|dutch guilders|dutch guilder|fl"], ["Swazi lilangeni", "swazi lilangeni|lilangeni|szl|emalangeni"], ["Tajikistani somoni", "tajikistani somoni|tjs|somoni"], ["Diram", "dirams|diram"], ["Thai baht", "thai baht|฿|thb|baht"], ["Satang", "satang|satangs"], ["Tongan paʻanga", "tongan paʻanga|paʻanga|tongan pa'anga|pa'anga"], ["Seniti", "seniti"], ["Ukrainian hryvnia", "ukrainian hryvnia|hyrvnia|uah|₴|ukrain hryvnia|ukrain hryvnias|ukrainian hryvnias"], ["Vanuatu vatu", "vanuatu vatu|vatu|vuv"], ["Venezuelan bolívar", "venezuelan bolívar|venezuelan bolívars|bs.f.|vef|bolívar fuerte|venezuelan bolivar|venezuelan bolivars|venezuela bolivar|venezuela bolivarsvenezuelan bolivar|venezuelan bolivars"], ["Vietnamese dong", "vietnamese dong|vnd|đồng|vietnam dong|vietnamese dongs|vietnam dongs"], ["Zambian kwacha", "zambian kwacha|zk|zmw|zambia kwacha|kwachas|zambian kwachas"], ["Moroccan dirham", "moroccan dirham|mad|د.م."], ["United Arab Emirates dirham", "united arab emirates dirham|د.إ|aed"], ["Azerbaijani manat", "azerbaijani manat|azn"], ["Turkmenistan manat", "turkmenistan manat|turkmenistan new manat|tmt"], ["Manat", "manats|manat"], ["Qəpik", "qəpik"], ["Somali shilling", "somali shillings|somali shilling|shilin soomaali|-shilin soomaali|scellino|shilin|sh.so.|sos"], ["Somaliland shilling", "somaliland shillings|somaliland shilling|soomaaliland shilin"], ["Tanzanian shilling", "tanzanian shilling|tanzanian shillings|tsh|tzs|tanzania shilling|tanzania shillings"], ["Ugandan shilling", "ugandan shilling|ugandan shillings|sh|ugx|uganda shilling|uganda shillings"], ["Romanian leu", "romanian leu|lei|ron|romania leu"], ["Moldovan leu", "moldovan leu|mdl|moldova leu"], ["Leu", "leu"], ["Ban", "bani|-ban|ban"], ["Nepalese rupee", "nepalese rupee|npr"], ["Pakistani rupee", "pakistani rupee|pkr"], ["Indian rupee", "indian rupee|inr|₹|india rupee"], ["Seychellois rupee", "seychellois rupee|scr|sr|sre"], ["Mauritian rupee", "mauritian rupee|mur"], ["Maldivian rufiyaa", "maldivian rufiyaa|rf|mvr|.ރ|maldive rufiyaa"], ["Sri Lankan rupee", "sri Lankan rupee|lkr|රු|ரூ"], ["Indonesian rupiah", "Indonesian rupiah|rupiah|perak|rp|idr"], ["Rupee", "rupee|rs"], ["Danish krone", "danish krone|dkk|denmark krone|denmark krones|danish krones"], ["Norwegian krone", "norwegian krone|nok|norway krone|norway krones|norwegian krones"], ["Faroese króna", "faroese króna|faroese krona"], ["Icelandic króna", "icelandic króna|isk|icelandic krona|iceland króna|iceland krona"], ["Swedish krona", "swedish krona|sek|swedan krona"], ["Krone", "kronor|krona|króna|krone|krones|kr|-kr"], ["Øre", "Øre|oyra|eyrir"], ["West African CFA franc", "west african cfa franc|xof|west africa cfa franc|west africa franc|west african franc"], ["Central African CFA franc", "central african cfa franc|xaf|central africa cfa franc|central african franc|central africa franc"], ["Comorian franc", "comorian franc|kmf"], ["Congolese franc", "congolese franc|cdf"], ["Burundian franc", "burundian franc|bif"], ["Djiboutian franc", "djiboutian franc|djf"], ["CFP franc", "cfp franc|xpf"], ["Guinean franc", "guinean franc|gnf"], ["Swiss franc", "swiss francs|swiss franc|chf|sfr."], ["Rwandan franc", "Rwandan franc|rwf|rf|r₣|frw"], ["Belgian franc", "belgian franc|bi.|b.fr.|bef|belgium franc"], ["Rappen", "rappen|-rappen"], ["Franc", "francs|franc|fr.|fs"], ["Centime", "centimes|centime|santim"], ["Russian ruble", "russian ruble|₽|rub|russia ruble|russia ₽|russian ₽|russian rubles|russia rubles"], ["New Belarusian ruble", "new belarusian ruble|byn|new belarus ruble|new belarus rubles|new belarusian rubles"], ["Old Belarusian ruble", "old belarusian ruble|byr|old belarus ruble|old belarus rubles|old belarusian rubles"], ["Transnistrian ruble", "transnistrian ruble|prb|р."], ["Belarusian ruble", "belarusian ruble|belarus ruble|belarus rubles|belarusian rubles"], ["Kopek", "kopek|kopeks"], ["Kapyeyka", "kapyeyka"], ["Ruble", "rubles|ruble|br"], ["Algerian dinar", "algerian dinar|د.ج|dzd|algerian dinars|algeria dinar|algeria dinars"], ["Bahraini dinar", "bahraini dinars|bahraini dinar|bhd|.د.ب"], ["Santeem", "santeem|santeems"], ["Iraqi dinar", "iraqi dinars|iraqi dinar|iraq dinars|iraq dinar|iqd|ع.د"], ["Jordanian dinar", "jordanian dinars|jordanian dinar|د.ا|jod|jordan dinar|jordan dinars"], ["Kuwaiti dinar", "kuwaiti dinars|kuwaiti dinar|kwd|د.ك"], ["Libyan dinar", "libyan dinars|libyan dinar|libya dinars|libya dinar|lyd"], ["Serbian dinar", "serbian dinars|serbian dinar|din.|rsd|дин.|serbia dinars|serbia dinar"], ["Tunisian dinar", "tunisian dinars|tunisian dinar|tnd|tunisia dinars|tunisia dinar"], ["Yugoslav dinar", "yugoslav dinars|yugoslav dinar|yun"], ["Dinar", "dinars|dinar|denar|-dinars|-dinar"], ["Fils", "fils|fulūs|-fils|-fil"], ["Para", "para|napa"], ["Millime", "millimes|millime"], ["Argentine peso", "argentine peso|ars|argetina peso|argetina pesos|argentine pesos"], ["Chilean peso", "chilean pesos|chilean peso|clp|chile peso|chile peso"], ["Colombian peso", "colombian pesos|colombian peso|cop|colombia peso|colombia pesos"], ["Cuban convertible peso", "cuban convertible pesos|cuban convertible peso|cuc|cuba convertible pesos|cuba convertible peso"], ["Cuban peso", "cuban pesos|cuban peso|cup|cuba pesos|cuba peso"], ["Dominican peso", "dominican pesos|dominican peso|dop|dominica pesos|dominica peso"], ["Mexican peso", "mexican pesos|mexican peso|mxn|mexico pesos|mexico peso"], ["Philippine peso", "piso|philippine pesos|philippine peso|₱|php"], ["Uruguayan peso", "uruguayan pesos|uruguayan peso|uyu"], ["Peso", "pesos|peso"], ["Centavo", "centavos|centavo"], ["Alderney pound", "alderney pounds|alderney pound|alderney £"], ["British pound", "british pounds|british pound|british £|gbp|pound sterling|pound sterlings|sterling|pound scot|pound scots"], ["Guernsey pound", "guernsey pounds|guernsey £|ggp"], ["Ascension pound", "ascension pounds|ascension pound|ascension £"], ["Saint Helena pound", "saint helena pounds|saint helena pound|saint helena £|shp"], ["Egyptian pound", "egyptian pounds|egyptian pound|egyptian £|egp|ج.م|egypt pounds|egypt pound"], ["Falkland Islands pound", "falkland islands pounds|falkland islands pound|falkland islands £|fkp|falkland island pounds|falkland island pound|falkland island £"], ["Gibraltar pound", "gibraltar pounds|gibraltar pound|gibraltar £|gip"], ["Manx pound", "manx pounds|manx pound|manx £|imp"], ["Jersey pound", "jersey pounds|jersey pound|jersey £|jep"], ["Lebanese pound", "lebanese pounds|lebanese pound|lebanese £|lebanan pounds|lebanan pound|lebanan £|lbp|ل.ل"], ["South Georgia and the South Sandwich Islands pound", "south georgia and the south sandwich islands pounds|south georgia and the south sandwich islands pound|south georgia and the south sandwich islands £"], ["South Sudanese pound", "south sudanese pounds|south sudanese pound|south sudanese £|ssp|south sudan pounds|south sudan pound|south sudan £"], ["Sudanese pound", "sudanese pounds|sudanese pound|sudanese £|ج.س.|sdg|sudan pounds|sudan pound|sudan £"], ["Syrian pound", "syrian pounds|syrian pound|syrian £|ل.س|syp|syria pounds|syria pound|syria £"], ["Tristan da Cunha pound", "tristan da cunha pounds|tristan da cunha pound|tristan da cunha £"], ["Pound", "pounds|pound|-pounds|-pound|£"], ["Pence", "pence"], ["Shilling", "shillings|shilling|shilingi"], ["Penny", "pennies|penny"], ["United States dollar", "united states dollars|united states dollar|united states $|u.s. dollars|u.s. dollar|u s dollar|u s dollars|usd|american dollars|american dollar|us$|us dollar|us dollars|u.s dollar|u.s dollars"], ["East Caribbean dollar", "east caribbean dollars|east caribbean dollar|east Caribbean $|xcd"], ["Australian dollar", "australian dollars|australian dollar|australian $|australian$|aud|australia dollars|australia dollar|australia $|australia$"], ["Bahamian dollar", "bahamian dollars|bahamian dollar|bahamian $|bahamian$|bsd|bahamia dollars|bahamia dollar|bahamia $|bahamia$"], ["Barbadian dollar", "barbadian dollars|barbadian dollar|barbadian $|bbd"], ["Belize dollar", "belize dollars|belize dollar|belize $|bzd"], ["Bermudian dollar", "bermudian dollars|bermudian dollar|bermudian $|bmd|bermudia dollars|bermudia dollar|bermudia $"], ["British Virgin Islands dollar", "british virgin islands dollars|british virgin islands dollar|british virgin islands $|bvi$|virgin islands dollars|virgin islands dolalr|virgin islands $|virgin island dollars|virgin island dollar|virgin island $"], ["Brunei dollar", "brunei dollar|brunei $|bnd"], ["Sen", "sen"], ["Singapore dollar", "singapore dollars|singapore dollar|singapore $|s$|sgd"], ["Canadian dollar", "canadian dollars|canadian dollar|canadian $|cad|can$|c$|canada dollars|canada dolllar|canada $"], ["Cayman Islands dollar", "cayman islands dollars|cayman islands dollar|cayman islands $|kyd|ci$|cayman island dollar|cayman island doolars|cayman island $"], ["New Zealand dollar", "new zealand dollars|new zealand dollar|new zealand $|nz$|nzd|kiwi"], ["Cook Islands dollar", "cook islands dollars|cook islands dollar|cook islands $|cook island dollars|cook island dollar|cook island $"], ["Fijian dollar", "fijian dollars|fijian dollar|fijian $|fjd|fiji dollars|fiji dollar|fiji $"], ["Guyanese dollar", "guyanese dollars|guyanese dollar|gyd|gy$"], ["Hong Kong dollar", "hong kong dollars|hong kong dollar|hong kong $|hk$|hkd|hk dollars|hk dollar|hk $|hongkong$"], ["Jamaican dollar", "jamaican dollars|jamaican dollar|jamaican $|j$|jamaica dollars|jamaica dollar|jamaica $|jmd"], ["Kiribati dollar", "kiribati dollars|kiribati dollar|kiribati $"], ["Liberian dollar", "liberian dollars|liberian dollar|liberian $|liberia dollars|liberia dollar|liberia $|lrd"], ["Micronesian dollar", "micronesian dollars|micronesian dollar|micronesian $"], ["Namibian dollar", "namibian dollars|namibian dollar|namibian $|nad|n$|namibia dollars|namibia dollar|namibia $"], ["Nauruan dollar", "nauruan dollars|nauruan dollar|nauruan $"], ["Niue dollar", "niue dollars|niue dollar|niue $"], ["Palauan dollar", "palauan dollars|palauan dollar|palauan $"], ["Pitcairn Islands dollar", "pitcairn islands dollars|pitcairn islands dollar|pitcairn islands $|pitcairn island dollars|pitcairn island dollar|pitcairn island $"], ["Solomon Islands dollar", "solomon islands dollars|solomon islands dollar|solomon islands $|si$|sbd|solomon island dollars|solomon island dollar|solomon island $"], ["Surinamese dollar", "surinamese dollars|surinamese dollar|surinamese $|srd"], ["New Taiwan dollar", "new taiwan dollars|new taiwan dollar|nt$|twd|ntd"], ["Trinidad and Tobago dollar", "trinidad and tobago dollars|trinidad and tobago dollar|trinidad and tobago $|trinidad $|trinidad dollar|trinidad dollars|trinidadian dollar|trinidadian dollars|trinidadian $|ttd"], ["Tuvaluan dollar", "tuvaluan dollars|tuvaluan dollar|tuvaluan $"], ["Dollar", "dollars|dollar|$"], ["Chinese yuan", "yuan|kuai|chinese yuan|renminbi|cny|rmb|¥|元"], ["Fen", "fen"], ["Jiao", "jiao|mao"], ["Finnish markka", "suomen markka|finnish markka|finsk mark|fim|markkaa|markka"], ["Penni", "penniä|penni"]]); + EnglishNumericWithUnit.CurrencyNameToIsoCodeMap = new Map([["Afghan afghani", "AFN"], ["Euro", "EUR"], ["Albanian lek", "ALL"], ["Angolan kwanza", "AOA"], ["Armenian dram", "AMD"], ["Aruban florin", "AWG"], ["Bangladeshi taka", "BDT"], ["Bhutanese ngultrum", "BTN"], ["Bolivian boliviano", "BOB"], ["Bosnia and Herzegovina convertible mark", "BAM"], ["Botswana pula", "BWP"], ["Brazilian real", "BRL"], ["Bulgarian lev", "BGN"], ["Cambodian riel", "KHR"], ["Cape Verdean escudo", "CVE"], ["Costa Rican colón", "CRC"], ["Croatian kuna", "HRK"], ["Czech koruna", "CZK"], ["Eritrean nakfa", "ERN"], ["Ethiopian birr", "ETB"], ["Gambian dalasi", "GMD"], ["Georgian lari", "GEL"], ["Ghanaian cedi", "GHS"], ["Guatemalan quetzal", "GTQ"], ["Haitian gourde", "HTG"], ["Honduran lempira", "HNL"], ["Hungarian forint", "HUF"], ["Iranian rial", "IRR"], ["Yemeni rial", "YER"], ["Israeli new shekel", "ILS"], ["Japanese yen", "JPY"], ["Kazakhstani tenge", "KZT"], ["Kenyan shilling", "KES"], ["North Korean won", "KPW"], ["South Korean won", "KRW"], ["Kyrgyzstani som", "KGS"], ["Lao kip", "LAK"], ["Lesotho loti", "LSL"], ["South African rand", "ZAR"], ["Macanese pataca", "MOP"], ["Macedonian denar", "MKD"], ["Malagasy ariary", "MGA"], ["Malawian kwacha", "MWK"], ["Malaysian ringgit", "MYR"], ["Mauritanian ouguiya", "MRO"], ["Mongolian tögrög", "MNT"], ["Mozambican metical", "MZN"], ["Burmese kyat", "MMK"], ["Nicaraguan córdoba", "NIO"], ["Nigerian naira", "NGN"], ["Turkish lira", "TRY"], ["Omani rial", "OMR"], ["Panamanian balboa", "PAB"], ["Papua New Guinean kina", "PGK"], ["Paraguayan guaraní", "PYG"], ["Peruvian sol", "PEN"], ["Polish złoty", "PLN"], ["Qatari riyal", "QAR"], ["Saudi riyal", "SAR"], ["Samoan tālā", "WST"], ["São Tomé and Príncipe dobra", "STD"], ["Sierra Leonean leone", "SLL"], ["Swazi lilangeni", "SZL"], ["Tajikistani somoni", "TJS"], ["Thai baht", "THB"], ["Ukrainian hryvnia", "UAH"], ["Vanuatu vatu", "VUV"], ["Venezuelan bolívar", "VEF"], ["Zambian kwacha", "ZMW"], ["Moroccan dirham", "MAD"], ["United Arab Emirates dirham", "AED"], ["Azerbaijani manat", "AZN"], ["Turkmenistan manat", "TMT"], ["Somali shilling", "SOS"], ["Tanzanian shilling", "TZS"], ["Ugandan shilling", "UGX"], ["Romanian leu", "RON"], ["Moldovan leu", "MDL"], ["Nepalese rupee", "NPR"], ["Pakistani rupee", "PKR"], ["Indian rupee", "INR"], ["Seychellois rupee", "SCR"], ["Mauritian rupee", "MUR"], ["Maldivian rufiyaa", "MVR"], ["Sri Lankan rupee", "LKR"], ["Indonesian rupiah", "IDR"], ["Danish krone", "DKK"], ["Norwegian krone", "NOK"], ["Icelandic króna", "ISK"], ["Swedish krona", "SEK"], ["West African CFA franc", "XOF"], ["Central African CFA franc", "XAF"], ["Comorian franc", "KMF"], ["Congolese franc", "CDF"], ["Burundian franc", "BIF"], ["Djiboutian franc", "DJF"], ["CFP franc", "XPF"], ["Guinean franc", "GNF"], ["Swiss franc", "CHF"], ["Rwandan franc", "RWF"], ["Russian ruble", "RUB"], ["Transnistrian ruble", "PRB"], ["Belarusian ruble", "BYN"], ["Algerian dinar", "DZD"], ["Bahraini dinar", "BHD"], ["Iraqi dinar", "IQD"], ["Jordanian dinar", "JOD"], ["Kuwaiti dinar", "KWD"], ["Libyan dinar", "LYD"], ["Serbian dinar", "RSD"], ["Tunisian dinar", "TND"], ["Argentine peso", "ARS"], ["Chilean peso", "CLP"], ["Colombian peso", "COP"], ["Cuban convertible peso", "CUC"], ["Cuban peso", "CUP"], ["Dominican peso", "DOP"], ["Mexican peso", "MXN"], ["Uruguayan peso", "UYU"], ["British pound", "GBP"], ["Saint Helena pound", "SHP"], ["Egyptian pound", "EGP"], ["Falkland Islands pound", "FKP"], ["Gibraltar pound", "GIP"], ["Manx pound", "IMP"], ["Jersey pound", "JEP"], ["Lebanese pound", "LBP"], ["South Sudanese pound", "SSP"], ["Sudanese pound", "SDG"], ["Syrian pound", "SYP"], ["United States dollar", "USD"], ["Australian dollar", "AUD"], ["Bahamian dollar", "BSD"], ["Barbadian dollar", "BBD"], ["Belize dollar", "BZD"], ["Bermudian dollar", "BMD"], ["Brunei dollar", "BND"], ["Singapore dollar", "SGD"], ["Canadian dollar", "CAD"], ["Cayman Islands dollar", "KYD"], ["New Zealand dollar", "NZD"], ["Fijian dollar", "FJD"], ["Guyanese dollar", "GYD"], ["Hong Kong dollar", "HKD"], ["Jamaican dollar", "JMD"], ["Liberian dollar", "LRD"], ["Namibian dollar", "NAD"], ["Solomon Islands dollar", "SBD"], ["Surinamese dollar", "SRD"], ["New Taiwan dollar", "TWD"], ["Trinidad and Tobago dollar", "TTD"], ["Tuvaluan dollar", "TVD"], ["Chinese yuan", "CNY"], ["Rial", "__RI"], ["Shiling", "__S"], ["Som", "__SO"], ["Dirham", "__DR"], ["Dinar", "_DN"], ["Dollar", "__D"], ["Manat", "__MA"], ["Rupee", "__R"], ["Krone", "__K"], ["Krona", "__K"], ["Crown", "__K"], ["Frank", "__F"], ["Mark", "__M"], ["Ruble", "__RB"], ["Peso", "__PE"], ["Pound", "__P"], ["Tristan da Cunha pound", "_TP"], ["South Georgia and the South Sandwich Islands pound", "_SP"], ["Somaliland shilling", "_SS"], ["Pitcairn Islands dollar", "_PND"], ["Palauan dollar", "_PD"], ["Niue dollar", "_NID"], ["Nauruan dollar", "_ND"], ["Micronesian dollar", "_MD"], ["Kiribati dollar", "_KID"], ["Guernsey pound", "_GGP"], ["Faroese króna", "_FOK"], ["Cook Islands dollar", "_CKD"], ["British Virgin Islands dollar", "_BD"], ["Ascension pound", "_AP"], ["Alderney pound", "_ALP"], ["Abkhazian apsar", "_AA"]]); + EnglishNumericWithUnit.FractionalUnitNameToCodeMap = new Map([["Jiao", "JIAO"], ["Kopek", "KOPEK"], ["Pul", "PUL"], ["Cent", "CENT"], ["Qindarkë", "QINDARKE"], ["Penny", "PENNY"], ["Santeem", "SANTEEM"], ["Cêntimo", "CENTIMO"], ["Centavo", "CENTAVO"], ["Luma", "LUMA"], ["Qəpik", "QƏPIK"], ["Fils", "FILS"], ["Poisha", "POISHA"], ["Kapyeyka", "KAPYEYKA"], ["Centime", "CENTIME"], ["Chetrum", "CHETRUM"], ["Paisa", "PAISA"], ["Fening", "FENING"], ["Thebe", "THEBE"], ["Sen", "SEN"], ["Stotinka", "STOTINKA"], ["Fen", "FEN"], ["Céntimo", "CENTIMO"], ["Lipa", "LIPA"], ["Haléř", "HALER"], ["Øre", "ØRE"], ["Piastre", "PIASTRE"], ["Santim", "SANTIM"], ["Oyra", "OYRA"], ["Butut", "BUTUT"], ["Tetri", "TETRI"], ["Pesewa", "PESEWA"], ["Fillér", "FILLER"], ["Eyrir", "EYRIR"], ["Dinar", "DINAR"], ["Agora", "AGORA"], ["Tïın", "TIIN"], ["Chon", "CHON"], ["Jeon", "JEON"], ["Tyiyn", "TYIYN"], ["Att", "ATT"], ["Sente", "SENTE"], ["Dirham", "DIRHAM"], ["Rappen", "RAPPEN"], ["Avo", "AVO"], ["Deni", "DENI"], ["Iraimbilanja", "IRAIMBILANJA"], ["Tambala", "TAMBALA"], ["Laari", "LAARI"], ["Khoums", "KHOUMS"], ["Ban", "BAN"], ["Möngö", "MONGO"], ["Pya", "PYA"], ["Kobo", "KOBO"], ["Kuruş", "KURUS"], ["Baisa", "BAISA"], ["Centésimo", "CENTESIMO"], ["Toea", "TOEA"], ["Sentimo", "SENTIMO"], ["Grosz", "GROSZ"], ["Sene", "SENE"], ["Halala", "HALALA"], ["Para", "PARA"], ["Öre", "ORE"], ["Diram", "DIRAM"], ["Satang", "SATANG"], ["Seniti", "SENITI"], ["Millime", "MILLIME"], ["Tennesi", "TENNESI"], ["Kopiyka", "KOPIYKA"], ["Tiyin", "TIYIN"], ["Hào", "HAO"], ["Ngwee", "NGWEE"]]); + EnglishNumericWithUnit.CompoundUnitConnectorRegex = `(?and)`; + EnglishNumericWithUnit.CurrencyPrefixList = new Map([["Dollar", "$"], ["United States dollar", "united states $|us$|us $|u.s. $|u.s $"], ["East Caribbean dollar", "east caribbean $"], ["Australian dollar", "australian $|australia $"], ["Bahamian dollar", "bahamian $|bahamia $"], ["Barbadian dollar", "barbadian $|barbadin $"], ["Belize dollar", "belize $"], ["Bermudian dollar", "bermudian $"], ["British Virgin Islands dollar", "british virgin islands $|bvi$|virgin islands $|virgin island $|british virgin island $"], ["Brunei dollar", "brunei $|b$"], ["Sen", "sen"], ["Singapore dollar", "singapore $|s$"], ["Canadian dollar", "canadian $|can$|c$|c $|canada $"], ["Cayman Islands dollar", "cayman islands $|ci$|cayman island $"], ["New Zealand dollar", "new zealand $|nz$|nz $"], ["Cook Islands dollar", "cook islands $|cook island $"], ["Fijian dollar", "fijian $|fiji $"], ["Guyanese dollar", "gy$|gy $|g$|g $"], ["Hong Kong dollar", "hong kong $|hk$|hkd|hk $"], ["Jamaican dollar", "jamaican $|j$|jamaica $"], ["Kiribati dollar", "kiribati $"], ["Liberian dollar", "liberian $|liberia $"], ["Micronesian dollar", "micronesian $"], ["Namibian dollar", "namibian $|nad|n$|namibia $"], ["Nauruan dollar", "nauruan $"], ["Niue dollar", "niue $"], ["Palauan dollar", "palauan $"], ["Pitcairn Islands dollar", "pitcairn islands $|pitcairn island $"], ["Solomon Islands dollar", "solomon islands $|si$|si $|solomon island $"], ["Surinamese dollar", "surinamese $|surinam $"], ["New Taiwan dollar", "nt$|nt $"], ["Trinidad and Tobago dollar", "trinidad and tobago $|trinidad $|trinidadian $"], ["Tuvaluan dollar", "tuvaluan $"], ["Samoan tālā", "ws$"], ["Chinese yuan", "¥"], ["Japanese yen", "¥"], ["Euro", "€"], ["Pound", "£"], ["Costa Rican colón", "₡"], ["Turkish lira", "₺"]]); + EnglishNumericWithUnit.AmbiguousCurrencyUnitList = ['din.', 'kiwi', 'kina', 'kobo', 'lari', 'lipa', 'napa', 'para', 'sfr.', 'taka', 'tala', 'toea', 'vatu', 'yuan', 'ang', 'ban', 'bob', 'btn', 'byr', 'cad', 'cop', 'cup', 'dop', 'gip', 'jod', 'kgs', 'lak', 'lei', 'mga', 'mop', 'nad', 'omr', 'pul', 'sar', 'sbd', 'scr', 'sdg', 'sek', 'sen', 'sol', 'sos', 'std', 'try', 'yer', 'yen']; + EnglishNumericWithUnit.InformationSuffixList = new Map([["Bit", "-bit|bit|bits"], ["Kilobit", "kilobit|kilobits|kb|Kb|kbit"], ["Megabit", "megabit|megabits|mb|Mb|mbit"], ["Gigabit", "gigabit|gigabits|gb|Gb|gbit"], ["Terabit", "terabit|terabits|tb|Tb|tbit"], ["Petabit", "petabit|petabits|pb|Pb|pbit"], ["Byte", "-byte|byte|bytes"], ["Kilobyte", "-kilobyte|-kilobytes|kilobyte|kB|KB|kilobytes|kilo byte|kilo bytes|kbyte"], ["Megabyte", "-megabyte|-megabytes|megabyte|mB|MB|megabytes|mega byte|mega bytes|mbyte"], ["Gigabyte", "-gigabyte|-gigabytes|gigabyte|gB|GB|gigabytes|giga byte|giga bytes|gbyte"], ["Terabyte", "-terabyte|-terabytes|terabyte|tB|TB|terabytes|tera byte|tera bytes|tbyte"], ["Petabyte", "-petabyte|-petabytes|petabyte|pB|PB|petabytes|peta byte|peta bytes|pbyte"]]); + EnglishNumericWithUnit.AmbiguousDimensionUnitList = ['barrel', 'barrels', 'grain', 'pound', 'stone', 'yards', 'yard', 'cord', 'dram', 'feet', 'foot', 'gill', 'knot', 'peck', 'cup', 'fps', 'pts', 'in', 'dm', '\"']; + EnglishNumericWithUnit.BuildPrefix = `(?<=(\\s|^))`; + EnglishNumericWithUnit.BuildSuffix = `(?=(\\s|\\W|$))`; + EnglishNumericWithUnit.LengthSuffixList = new Map([["Kilometer", "km|kilometer|kilometre|kilometers|kilometres|kilo meter|kilo meters|kilo metres|kilo metre"], ["Hectometer", "hm|hectometer|hectometre|hectometers|hectometres|hecto meter|hecto meters|hecto metres|hecto metre"], ["Decameter", "dam|decameter|decametre|decameters|decametres|deca meter|deca meters|deca metres|deca metre"], ["Meter", "m|meter|metre|meters|metres"], ["Decimeter", "dm|decimeter|decimeters|decimetre|decimetres|deci meter|deci meters|deci metres|deci metre"], ["Centimeter", "cm|centimeter|centimeters|centimetre|centimetres|centi meter|centi meters|centi metres|centi metre"], ["Millimeter", "mm|millimeter|millimeters|millimetre|millimetres|milli meter|milli meters|milli metres|milli metre"], ["Micrometer", "μm|micrometer|micrometre|micrometers|micrometres|micro meter|micro meters|micro metres|micro metre"], ["Nanometer", "nm|nanometer|nanometre|nanometers|nanometres|nano meter|nano meters|nano metres|nano metre"], ["Picometer", "pm|picometer|picometre|picometers|picometres|pico meter|pico meters|pico metres|pico metre"], ["Mile", "-mile|mile|miles"], ["Yard", "yard|yards"], ["Inch", "-inch|inch|inches|in|\""], ["Foot", "-foot|foot|feet|ft"], ["Light year", "light year|light-year|light years|light-years"], ["Pt", "pt|pts"]]); + EnglishNumericWithUnit.AmbiguousLengthUnitList = ['m', 'yard', 'yards', 'pm', 'pt', 'pts']; + EnglishNumericWithUnit.SpeedSuffixList = new Map([["Meter per second", "meters / second|m/s|meters per second|metres per second|meter per second|metre per second"], ["Kilometer per hour", "km/h|kilometres per hour|kilometers per hour|kilometer per hour|kilometre per hour"], ["Kilometer per minute", "km/min|kilometers per minute|kilometres per minute|kilometer per minute|kilometre per minute"], ["Kilometer per second", "km/s|kilometers per second|kilometres per second|kilometer per second|kilometre per second"], ["Mile per hour", "mph|mile per hour|miles per hour|mi/h|mile / hour|miles / hour|miles an hour"], ["Knot", "kt|knot|kn"], ["Foot per second", "ft/s|foot/s|foot per second|feet per second|fps"], ["Foot per minute", "ft/min|foot/min|foot per minute|feet per minute"], ["Yard per minute", "yards per minute|yard per minute|yards / minute|yards/min|yard/min"], ["Yard per second", "yards per second|yard per second|yards / second|yards/s|yard/s"]]); + EnglishNumericWithUnit.TemperatureSuffixList = new Map([["F", "degrees fahrenheit|degree fahrenheit|deg fahrenheit|degs fahrenheit|fahrenheit|°f|degrees farenheit|degree farenheit|deg farenheit|degs farenheit|degrees f|degree f|deg f|degs f|farenheit|f"], ["K", "k|kelvin"], ["R", "rankine|°r"], ["D", "delisle|°de"], ["C", "degrees celsius|degree celsius|deg celsius|degs celsius|celsius|degrees celcius|degree celcius|celcius|deg celcius|degs celcius|degrees centigrade|degree centigrade|centigrade|degrees centigrate|degree centigrate|degs centigrate|deg centigrate|centigrate|degrees c|degree c|deg c|degs c|°c|c"], ["Degree", "degree|degrees|deg.|deg|°"]]); + EnglishNumericWithUnit.AmbiguousTemperatureUnitList = ['c', 'f', 'k']; + EnglishNumericWithUnit.VolumeSuffixList = new Map([["Cubic meter", "m3|cubic meter|cubic meters|cubic metre|cubic metres"], ["Cubic centimeter", "cubic centimeter|cubic centimetre|cubic centimeters|cubic centimetres"], ["Cubic millimiter", "cubic millimiter|cubic millimitre|cubic millimiters|cubic millimitres"], ["Hectoliter", "hectoliter|hectolitre|hectoliters|hectolitres"], ["Decaliter", "decaliter|decalitre|dekaliter|dekalitre|decaliters|decalitres|dekaliters|dekalitres"], ["Liter", "l|litre|liter|liters|litres"], ["Deciliter", "dl|deciliter|decilitre|deciliters|decilitres"], ["Centiliter", "cl|centiliter|centilitre|centiliters|centilitres"], ["Milliliter", "ml|mls|millilitre|milliliter|millilitres|milliliters"], ["Cubic yard", "cubic yard|cubic yards"], ["Cubic inch", "cubic inch|cubic inches"], ["Cubic foot", "cubic foot|cubic feet"], ["Cubic mile", "cubic mile|cubic miles"], ["Fluid ounce", "fl oz|fluid ounce|fluid ounces"], ["Teaspoon", "teaspoon|teaspoons"], ["Tablespoon", "tablespoon|tablespoons"], ["Pint", "pint|pints"], ["Volume unit", "fluid dram|gill|quart|minim|barrel|cord|peck|bushel|hogshead"]]); + EnglishNumericWithUnit.AmbiguousVolumeUnitList = ['l', 'ounce', 'oz', 'cup', 'peck', 'cord', 'gill']; + EnglishNumericWithUnit.WeightSuffixList = new Map([["Kilogram", "kg|kilogram|kilograms|kilo|kilos"], ["Gram", "g|gram|grams"], ["Milligram", "mg|milligram|milligrams"], ["Barrel", "barrels|barrel"], ["Gallon", "-gallon|gallons|gallon"], ["Metric ton", "metric tons|metric ton"], ["Ton", "-ton|ton|tons|tonne|tonnes"], ["Pound", "pound|pounds|lb"], ["Ounce", "-ounce|ounce|oz|ounces"], ["Weight unit", "pennyweight|grain|british long ton|US short hundredweight|stone|dram"]]); + EnglishNumericWithUnit.AmbiguousWeightUnitList = ['g', 'oz', 'stone', 'dram']; +})(EnglishNumericWithUnit = exports.EnglishNumericWithUnit || (exports.EnglishNumericWithUnit = {})); + +}); + +unwrapExports(englishNumericWithUnit); + +var base = createCommonjsModule(function (module, exports) { +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); + + + + + +class EnglishNumberWithUnitExtractorConfiguration { + constructor(ci) { + this.cultureInfo = ci; + this.unitNumExtractor = new recognizersTextNumber.EnglishNumberExtractor(); + this.buildPrefix = englishNumericWithUnit.EnglishNumericWithUnit.BuildPrefix; + this.buildSuffix = englishNumericWithUnit.EnglishNumericWithUnit.BuildSuffix; + this.connectorToken = ''; + this.compoundUnitConnectorRegex = recognizersText.RegExpUtility.getSafeRegExp(englishNumericWithUnit.EnglishNumericWithUnit.CompoundUnitConnectorRegex); + this.pmNonUnitRegex = recognizersText.RegExpUtility.getSafeRegExp(baseUnits.BaseUnits.PmNonUnitRegex); + } +} +exports.EnglishNumberWithUnitExtractorConfiguration = EnglishNumberWithUnitExtractorConfiguration; +class EnglishNumberWithUnitParserConfiguration extends parsers$8.BaseNumberWithUnitParserConfiguration { + constructor(ci) { + super(ci); + this.internalNumberExtractor = new recognizersTextNumber.EnglishNumberExtractor(recognizersTextNumber.NumberMode.Default); + this.internalNumberParser = recognizersTextNumber.AgnosticNumberParserFactory.getParser(recognizersTextNumber.AgnosticNumberParserType.Number, new recognizersTextNumber.EnglishNumberParserConfiguration()); + this.connectorToken = ''; + this.currencyNameToIsoCodeMap = englishNumericWithUnit.EnglishNumericWithUnit.CurrencyNameToIsoCodeMap; + this.currencyFractionCodeList = englishNumericWithUnit.EnglishNumericWithUnit.FractionalUnitNameToCodeMap; + } +} +exports.EnglishNumberWithUnitParserConfiguration = EnglishNumberWithUnitParserConfiguration; + +}); + +unwrapExports(base); + +var currency = createCommonjsModule(function (module, exports) { +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); + + + + +class EnglishCurrencyExtractorConfiguration extends base.EnglishNumberWithUnitExtractorConfiguration { + constructor(ci) { + if (!ci) { + ci = new recognizersTextNumber.CultureInfo(recognizersTextNumber.Culture.English); + } + super(ci); + this.extractType = constants$4.Constants.SYS_UNIT_CURRENCY; + // Reference Source: https:// en.wikipedia.org/wiki/List_of_circulating_currencies + this.suffixList = englishNumericWithUnit.EnglishNumericWithUnit.CurrencySuffixList; + this.prefixList = englishNumericWithUnit.EnglishNumericWithUnit.CurrencyPrefixList; + this.ambiguousUnitList = englishNumericWithUnit.EnglishNumericWithUnit.AmbiguousCurrencyUnitList; + } +} +exports.EnglishCurrencyExtractorConfiguration = EnglishCurrencyExtractorConfiguration; +class EnglishCurrencyParserConfiguration extends base.EnglishNumberWithUnitParserConfiguration { + constructor(ci) { + if (!ci) { + ci = new recognizersTextNumber.CultureInfo(recognizersTextNumber.Culture.English); + } + super(ci); + this.BindDictionary(englishNumericWithUnit.EnglishNumericWithUnit.CurrencySuffixList); + this.BindDictionary(englishNumericWithUnit.EnglishNumericWithUnit.CurrencyPrefixList); + } +} +exports.EnglishCurrencyParserConfiguration = EnglishCurrencyParserConfiguration; + +}); + +unwrapExports(currency); + +var temperature = createCommonjsModule(function (module, exports) { +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); + + + + +class EnglishTemperatureExtractorConfiguration extends base.EnglishNumberWithUnitExtractorConfiguration { + constructor(ci) { + if (!ci) { + ci = new recognizersTextNumber.CultureInfo(recognizersTextNumber.Culture.English); + } + super(ci); + this.extractType = constants$4.Constants.SYS_UNIT_TEMPERATURE; + this.suffixList = englishNumericWithUnit.EnglishNumericWithUnit.TemperatureSuffixList; + this.prefixList = new Map(); + this.ambiguousUnitList = englishNumericWithUnit.EnglishNumericWithUnit.AmbiguousTemperatureUnitList; + } +} +exports.EnglishTemperatureExtractorConfiguration = EnglishTemperatureExtractorConfiguration; +class EnglishTemperatureParserConfiguration extends base.EnglishNumberWithUnitParserConfiguration { + constructor(ci) { + if (!ci) { + ci = new recognizersTextNumber.CultureInfo(recognizersTextNumber.Culture.English); + } + super(ci); + this.BindDictionary(englishNumericWithUnit.EnglishNumericWithUnit.TemperatureSuffixList); + } +} +exports.EnglishTemperatureParserConfiguration = EnglishTemperatureParserConfiguration; + +}); + +unwrapExports(temperature); + +var dimension = createCommonjsModule(function (module, exports) { +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); + + + + +const dimensionSuffixList = new Map([ + ...englishNumericWithUnit.EnglishNumericWithUnit.InformationSuffixList, + ...englishNumericWithUnit.EnglishNumericWithUnit.AreaSuffixList, + ...englishNumericWithUnit.EnglishNumericWithUnit.LengthSuffixList, + ...englishNumericWithUnit.EnglishNumericWithUnit.SpeedSuffixList, + ...englishNumericWithUnit.EnglishNumericWithUnit.VolumeSuffixList, + ...englishNumericWithUnit.EnglishNumericWithUnit.WeightSuffixList +]); +class EnglishDimensionExtractorConfiguration extends base.EnglishNumberWithUnitExtractorConfiguration { + constructor(ci) { + if (!ci) { + ci = new recognizersTextNumber.CultureInfo(recognizersTextNumber.Culture.English); + } + super(ci); + this.extractType = constants$4.Constants.SYS_UNIT_DIMENSION; + this.suffixList = dimensionSuffixList; + this.prefixList = new Map(); + this.ambiguousUnitList = englishNumericWithUnit.EnglishNumericWithUnit.AmbiguousDimensionUnitList; + } +} +exports.EnglishDimensionExtractorConfiguration = EnglishDimensionExtractorConfiguration; +class EnglishDimensionParserConfiguration extends base.EnglishNumberWithUnitParserConfiguration { + constructor(ci) { + if (!ci) { + ci = new recognizersTextNumber.CultureInfo(recognizersTextNumber.Culture.English); + } + super(ci); + this.BindDictionary(dimensionSuffixList); + } +} +exports.EnglishDimensionParserConfiguration = EnglishDimensionParserConfiguration; + +}); + +unwrapExports(dimension); + +var age = createCommonjsModule(function (module, exports) { +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); + + + + +class EnglishAgeExtractorConfiguration extends base.EnglishNumberWithUnitExtractorConfiguration { + constructor(ci) { + if (!ci) { + ci = new recognizersTextNumber.CultureInfo(recognizersTextNumber.Culture.English); + } + super(ci); + this.extractType = constants$4.Constants.SYS_UNIT_AGE; + this.suffixList = englishNumericWithUnit.EnglishNumericWithUnit.AgeSuffixList; + this.prefixList = new Map(); + this.ambiguousUnitList = new Array(); + } +} +exports.EnglishAgeExtractorConfiguration = EnglishAgeExtractorConfiguration; +class EnglishAgeParserConfiguration extends base.EnglishNumberWithUnitParserConfiguration { + constructor(ci) { + if (!ci) { + ci = new recognizersTextNumber.CultureInfo(recognizersTextNumber.Culture.English); + } + super(ci); + this.BindDictionary(englishNumericWithUnit.EnglishNumericWithUnit.AgeSuffixList); + } +} +exports.EnglishAgeParserConfiguration = EnglishAgeParserConfiguration; + +}); + +unwrapExports(age); + +var spanishNumericWithUnit = createCommonjsModule(function (module, exports) { +"use strict"; +// ------------------------------------------------------------------------------ +// +// This code was generated by a tool. +// Changes to this file may cause incorrect behavior and will be lost if +// the code is regenerated. +// +// ------------------------------------------------------------------------------ +Object.defineProperty(exports, "__esModule", { value: true }); +var SpanishNumericWithUnit; +(function (SpanishNumericWithUnit) { + SpanishNumericWithUnit.AgeSuffixList = new Map([["Año", "años|año"], ["Mes", "meses|mes"], ["Semana", "semanas|semana"], ["Día", "dias|días|día|dia"]]); + SpanishNumericWithUnit.AreaSuffixList = new Map([["Kilómetro cuadrado", "kilómetro cuadrado|kilómetros cuadrados|km2|km^2|km²"], ["Hectómetro cuadrado", "hectómetro cuadrado|hectómetros cuadrados|hm2|hm^2|hm²|hectárea|hectáreas"], ["Decámetro cuadrado", "decámetro cuadrado|decámetros cuadrados|dam2|dam^2|dam²|área|áreas"], ["Metro cuadrado", "metro cuadrado|metros cuadrados|m2|m^2|m²"], ["Decímetro cuadrado", "decímetro cuadrado|decímetros cuadrados|dm2|dm^2|dm²"], ["Centímetro cuadrado", "centímetro cuadrado|centímetros cuadrados|cm2|cm^2|cm²"], ["Milímetro cuadrado", "milímetro cuadrado|milímetros cuadrados|mm2|mm^2|mm²"], ["Pulgada cuadrado", "pulgada cuadrada|pulgadas cuadradas"], ["Pie cuadrado", "pie cuadrado|pies cuadrados|pie2|pie^2|pie²|ft2|ft^2|ft²"], ["Yarda cuadrado", "yarda cuadrada|yardas cuadradas|yd2|yd^2|yd²"], ["Acre", "acre|acres"]]); + SpanishNumericWithUnit.AreaAmbiguousValues = ['área', 'áreas']; + SpanishNumericWithUnit.CurrencySuffixList = new Map([["Dólar", "dólar|dólares"], ["Peso", "peso|pesos"], ["Rublo", "rublo|rublos"], ["Libra", "libra|libras"], ["Florín", "florín|florines"], ["Dinar", "dinar|dinares"], ["Franco", "franco|francos"], ["Rupia", "rupia|rupias"], ["Escudo", "escudo|escudos"], ["Chelín", "chelín|chelines"], ["Lira", "lira|liras"], ["Centavo", "centavo|centavos"], ["Céntimo", "céntimo|céntimos"], ["Centésimo", "centésimo|centésimos"], ["Penique", "penique|peniques"], ["Euro", "euro|euros|€|eur"], ["Céntimo de Euro", "céntimo de euro|céntimos de euros"], ["Dólar del Caribe Oriental", "dólar del Caribe Oriental|dólares del Caribe Oriental|ec$|xcd"], ["Centavo del Caribe Oriental", "centavo del Caribe Oriental|centavos del Caribe Oriental"], ["Franco CFA de África Occidental", "franco CFA de África Occidental|francos CFA de África Occidental|fcfa|xof"], ["Céntimo de CFA de África Occidental", "céntimo de CFA de África Occidental|céntimos de CFA de África Occidental"], ["Franco CFA de África Central", "franco CFA de África Central|francos CFA de África Central|xaf"], ["Céntimo de CFA de África Central", "céntimo de CFA de África Central|céntimos de CFA de África Central"], ["Apsar", "apsar|apsares"], ["Afgani afgano", "afgani afgano|؋|afn|afganis|afgani"], ["Pul", "pul|puls"], ["Lek albanés", "lek|lekë|lekes|lek albanés"], ["Qindarka", "qindarka|qindarkë|qindarkas"], ["Kwanza angoleño", "kwanza angoleño|kwanzas angoleños|kwanza angoleños|kwanzas angoleño|kwanzas|aoa|kz"], ["Cêntimo angoleño", "cêntimo angoleño|cêntimo|cêntimos"], ["Florín antillano neerlandés", "florín antillano neerlandés|florínes antillano neerlandés|ƒ antillano neerlandés|ang|naƒ"], ["Cent antillano neerlandés", "cent|centen"], ["Riyal saudí", "riyal saudí|riyales saudí|sar"], ["Halalá saudí", "halalá saudí|hallalah"], ["Dinar argelino", "dinar argelino|dinares argelinos|dzd"], ["Céntimo argelino", "centimo argelino|centimos argelinos|"], ["Peso argentino", "peso argentino|pesos argentinos|peso|pesos|ar$|ars"], ["Centavo argentino", "centavo argentino|centavos argentinos|centavo|ctvo.|ctvos."], ["Dram armenio", "dram armenio|dram armenios|dram|դր."], ["Luma armenio", "luma armenio|luma armenios"], ["Florín arubeño", "florín arubeño|florines arubeños|ƒ arubeños|aƒ|awg"], ["Yotin arubeño", "yotin arubeño|yotines arubeños"], ["Dólar australiano", "dólar australiano|dólares australianos|a$|aud"], ["Centavo australiano", "centavo australiano|centavos australianos"], ["Manat azerí", "manat azerí|man|azn"], ["Qəpik azerí", "qəpik azerí|qəpik"], ["Dólar bahameño", "dólar bahameño|dólares bahameños|b$|bsd"], ["Centavo bahameño", "centavo bahameño|centavos bahameños"], ["Dinar bahreiní", "dinar bahreiní|dinares bahreinies|bhd"], ["Fil bahreiní", "fil bahreiní|fils bahreinies"], ["Taka bangladeshí", "taka bangladeshí|takas bangladeshí|bdt"], ["Poisha bangladeshí", "poisha bangladeshí|poishas bangladeshí"], ["Dólar de Barbados", "dólar de barbados|dólares de barbados|bbd"], ["Centavo de Barbados", "centavo de barbados|centavos de barbados"], ["Dólar beliceño", "dólar beliceño|dólares beliceños|bz$|bzd"], ["Centavo beliceño", "centavo beliceño|centavos beliceños"], ["Dólar bermudeño", "dólar bermudeño|dólares bermudeños|bd$|bmd"], ["Centavo bermudeño", "centavo bermudeño|centavos bermudeños"], ["Rublo bielorruso", "rublo bielorruso|rublos bielorrusos|br|byr"], ["Kópek bielorruso", "kópek bielorruso|kópeks bielorrusos|kap"], ["Kyat birmano", "kyat birmano|kyats birmanos|mmk"], ["Pya birmano", "pya birmano|pyas birmanos"], ["Boliviano", "boliviano|bolivianos|bob|bs"], ["Centésimo Boliviano", "centésimo boliviano|centésimos bolivianos"], ["Marco bosnioherzegovino", "marco convertible|marco bosnioherzegovino|marcos convertibles|marcos bosnioherzegovinos|bam"], ["Feningas bosnioherzegovino", "feninga convertible|feninga bosnioherzegovina|feningas convertibles"], ["Pula", "pula|bwp"], ["Thebe", "thebe"], ["Real brasileño", "real brasileño|reales brasileños|r$|brl"], ["Centavo brasileño", "centavo brasileño|centavos brasileños"], ["Dólar de Brunéi", "dólar de brunei|dólares de brunéi|bnd"], ["Sen de Brunéi", "sen|sen de brunéi"], ["Lev búlgaro", "lev búlgaro|leva búlgaros|lv|bgn"], ["Stotinki búlgaro", "stotinka búlgaro|stotinki búlgaros"], ["Franco de Burundi", "franco de burundi|francos de burundi|fbu|fib"], ["Céntimo Burundi", "céntimo burundi|céntimos burundies"], ["Ngultrum butanés", "ngultrum butanés|ngultrum butaneses|btn"], ["Chetrum butanés", "chetrum butanés|chetrum butaneses"], ["Escudo caboverdiano", "escudo caboverdiano|escudos caboverdianos|cve"], ["Riel camboyano", "riel camboyano|rieles camboyanos|khr"], ["Dólar canadiense", "dólar canadiense|dólares canadienses|c$|cad"], ["Centavo canadiense", "centavo canadiense|centavos canadienses"], ["Peso chileno", "peso chileno|pesos chilenos|cpl"], ["Yuan chino", "yuan chino|yuanes chinos|yuan|yuanes|renminbi|rmb|cny|¥"], ["Peso colombiano", "peso colombiano|pesos colombianos|cop|col$"], ["Centavo colombiano", "centavo colombiano|centavos colombianos"], ["Franco comorano", "franco comorano|francos comoranos|kmf|₣"], ["Franco congoleño", "franco congoleño|francos congoleños|cdf"], ["Céntimo congoleño", "céntimo congoleño|céntimos congoleños"], ["Won norcoreano", "won norcoreano|wŏn norcoreano|wŏn norcoreanos|kpw"], ["Chon norcoreano", "chon norcoreano|chŏn norcoreano|chŏn norcoreanos|chon norcoreanos"], ["Won surcoreano", "wŏn surcoreano|won surcoreano|wŏnes surcoreanos|wones surcoreanos|krw"], ["Chon surcoreano", "chon surcoreano|chŏn surcoreano|chŏn surcoreanos|chon surcoreanos"], ["Colón costarricense", "colón costarricense|colones costarricenses|crc"], ["Kuna croata", "kuna croata|kuna croatas|hrk"], ["Lipa croata", "lipa croata|lipa croatas"], ["Peso cubano", "peso cubano|pesos cubanos|cup"], ["Peso cubano convertible", "peso cubano convertible|pesos cubanos convertible|cuc"], ["Corona danesa", "corona danesa|coronas danesas|dkk"], ["Libra egipcia", "libra egipcia|libras egipcias|egp|le"], ["Piastra egipcia", "piastra egipcia|piastras egipcias"], ["Colón salvadoreño", "colón salvadoreño|colones salvadoreños|svc"], ["Dirham de los Emiratos Árabes Unidos", "dirham|dirhams|dirham de los Emiratos Árabes Unidos|aed|dhs"], ["Nakfa", "nakfa|nfk|ern"], ["Céntimo de Nakfa", "céntimo de nakfa|céntimos de nakfa"], ["Peseta", "peseta|pesetas|pts.|ptas.|esp"], ["Dólar estadounidense", "dólar estadounidense|dólares estadounidenses|usd|u$d|us$"], ["Corona estonia", "corona estonia|coronas estonias|eek"], ["Senti estonia", "senti estonia|senti estonias"], ["Birr etíope", "birr etíope|birr etíopes|br|etb"], ["Santim etíope", "santim etíope|santim etíopes"], ["Peso filipino", "peso filipino|pesos filipinos|php"], ["Marco finlandés", "marco finlandés|marcos finlandeses"], ["Dólar fiyiano", "dólar fiyiano|dólares fiyianos|fj$|fjd"], ["Centavo fiyiano", "centavo fiyiano|centavos fiyianos"], ["Dalasi", "dalasi|gmd"], ["Bututs", "butut|bututs"], ["Lari georgiano", "lari georgiano|lari georgianos|gel"], ["Tetri georgiano", "tetri georgiano|tetri georgianos"], ["Cedi", "cedi|ghs|gh₵"], ["Pesewa", "pesewa"], ["Libra gibraltareña", "libra gibraltareña|libras gibraltareñas|gip"], ["Penique gibraltareña", "penique gibraltareña|peniques gibraltareñas"], ["Quetzal guatemalteco", "quetzal guatemalteco|quetzales guatemaltecos|quetzal|quetzales|gtq"], ["Centavo guatemalteco", "centavo guatemalteco|centavos guatemaltecos"], ["Libra de Guernsey", "libra de Guernsey|libras de Guernsey|ggp"], ["Penique de Guernsey", "penique de Guernsey|peniques de Guernsey"], ["Franco guineano", "franco guineano|francos guineanos|gnf|fg"], ["Céntimo guineano", "céntimo guineano|céntimos guineanos"], ["Dólar guyanés", "dólar guyanés|dólares guyaneses|gyd|gy"], ["Gourde haitiano", "gourde haitiano|gourde haitianos|htg"], ["Céntimo haitiano", "céntimo haitiano|céntimos haitianos"], ["Lempira hondureño", "lempira hondureño|lempira hondureños|hnl"], ["Centavo hondureño", "centavo hondureño|centavos hondureño"], ["Dólar de Hong Kong", "dólar de hong kong|dólares de hong kong|hk$|hkd"], ["Forinto húngaro", "forinto húngaro|forinto húngaros|huf"], ["Rupia india", "rupia india|rupias indias|inr"], ["Paisa india", "paisa india|paise indias"], ["Rupia indonesia", "rupia indonesia|rupias indonesias|idr"], ["Sen indonesia", "sen indonesia|sen indonesias"], ["Rial iraní", "rial iraní|rial iranies|irr"], ["Dinar iraquí", "dinar iraquí|dinares iraquies|iqd"], ["Fil iraquí", "fil iraquí|fils iraquies"], ["Libra manesa", "libra manesa|libras manesas|imp"], ["Penique manes", "penique manes|peniques maneses"], ["Corona islandesa", "corona islandesa|coronas islandesas|isk|íkr"], ["Aurar islandes", "aurar islandes|aurar islandeses"], ["Dólar de las Islas Caimán", "dólar de las Islas Caimán|dólares de las Islas Caimán|ci$|kyd"], ["Dólar de las Islas Cook", "dólar de las Islas Cook|dólares de las Islas Cook"], ["Corona feroesa", "corona feroesa|coronas feroesas|fkr"], ["Libra malvinense", "libra malvinense|libras malvinenses|fk£|fkp"], ["Dólar de las Islas Salomón", "dólar de las Islas Salomón|dólares de las Islas Salomón|sbd"], ["Nuevo shéquel", "nuevo shéquel|nuevos shéquel|ils"], ["Agorot", "agorot"], ["Dólar jamaiquino", "dólar jamaiquino|dólares jamaiquinos|j$|ja$|jmd"], ["Yen", "yen|yenes|jpy"], ["Libra de Jersey", "libra de Jersey|libras de Jersey|jep"], ["Dinar jordano", "dinar jordano|dinares jordanos|jd|jod"], ["Piastra jordano", "piastra jordano|piastras jordanos"], ["Tenge kazajo", "tenge|tenge kazajo|kzt"], ["Chelín keniano", "chelín keniano|chelines kenianos|ksh|kes"], ["Som kirguís", "som kirguís|kgs"], ["Tyiyn", "tyiyn"], ["Dólar de Kiribati", "dólar de Kiribati|dólares de Kiribati"], ["Dinar kuwaití", "dinar kuwaití|dinares kuwaití"], ["Kip laosiano", "kip|kip laosiano|kip laosianos|lak"], ["Att laosiano", "att|att laosiano|att laosianos"], ["Loti", "loti|maloti|lsl"], ["Sente", "sente|lisente"], ["Libra libanesa", "libra libanesa|libras libanesas|lbp"], ["Dólar liberiano", "dólar liberiano|dólares liberianos|l$|lrd"], ["Dinar libio", "dinar libio|dinares libios|ld|lyd"], ["Dirham libio", "dirham libio|dirhams libios"], ["Litas lituana", "litas lituana|litai lituanas|ltl"], ["Pataca macaense", "pataca macaense|patacas macaenses|mop$|mop"], ["Avo macaense", "avo macaense|avos macaenses"], ["Ho macaense", "ho macaense|ho macaenses"], ["Denar macedonio", "denar macedonio|denare macedonios|den|mkd"], ["Deni macedonio", "deni macedonio|deni macedonios"], ["Ariary malgache", "ariary malgache|ariary malgaches|mga"], ["Iraimbilanja malgache", "iraimbilanja malgache|iraimbilanja malgaches"], ["Ringgit malayo", "ringgit malayo|ringgit malayos|rm|myr"], ["Sen malayo", "sen malayo|sen malayos"], ["Kwacha malauí", "kwacha malauí|mk|mwk"], ["Támbala malauí", "támbala malauí"], ["Rupia de Maldivas", "rupia de Maldivas|rupias de Maldivas|mvr"], ["Dirham marroquí", "dirham marroquí|dirhams marroquies|mad"], ["Rupia de Mauricio", "rupia de Mauricio|rupias de Mauricio|mur"], ["Uguiya", "uguiya|uguiyas|mro"], ["Jum", "jum|jums"], ["Peso mexicano", "peso mexicano|pesos mexicanos|mxn"], ["Centavo mexicano", "centavo mexicano|centavos mexicanos"], ["Leu moldavo", "leu moldavo|lei moldavos|mdl"], ["Ban moldavo", "ban moldavo|bani moldavos"], ["Tugrik mongol", "tugrik mongol|tugrik|tugrik mongoles|tug|mnt"], ["Metical mozambiqueño", "metical|metical mozambiqueño|meticales|meticales mozambiqueños|mtn|mzn"], ["Dram de Nagorno Karabaj", "dram de Nagorno Karabaj|drams de Nagorno Karabaj|"], ["Luma de Nagorno Karabaj", "luma de Nagorno Karabaj"], ["Dólar namibio", "dólar namibio|dólares namibios|n$|nad"], ["Centavo namibio", "centavo namibio|centavos namibios"], ["Rupia nepalí", "rupia nepalí|rupias nepalies|npr"], ["Paisa nepalí", "paisa nepalí|paisas nepalies"], ["Córdoba nicaragüense", "córdoba nicaragüense|córdobas nicaragüenses|c$|nio"], ["Centavo nicaragüense", "centavo nicaragüense|centavos nicaragüenses"], ["Naira", "naira|ngn"], ["Kobo", "kobo"], ["Corona noruega", "corona noruega|coronas noruegas|nok"], ["Franco CFP", "franco cfp|francos cfp|xpf"], ["Dólar neozelandés", "dólar neozelandés|dólares neozelandeses|dólar de Nueva Zelanda|dólares de Nueva Zelanda|nz$|nzd"], ["Centavo neozelandés", "centavo neozelandés|centavo de Nueva Zelanda|centavos de Nueva Zelanda|centavos neozelandeses"], ["Rial omaní", "rial omaní|riales omanies|omr"], ["Baisa omaní", "baisa omaní|baisa omanies"], ["Florín neerlandés", "florín neerlandés|florines neerlandeses|nlg"], ["Rupia pakistaní", "rupia pakistaní|rupias pakistanies|pkr"], ["Paisa pakistaní", "paisa pakistaní|paisas pakistanies"], ["Balboa panameño", "balboa panameño|balboa panameños|pab"], ["Centésimo panameño", "centésimo panameño|centésimos panameños"], ["Kina", "kina|pkg|pgk"], ["Toea", "toea"], ["Guaraní", "guaraní|guaranies|gs|pyg"], ["Sol", "sol|soles|nuevo sol|pen|s#."], ["Céntimo de sol", "céntimo de sol|céntimos de sol"], ["Złoty", "złoty|esloti|eslotis|zł|pln"], ["Groszy", "groszy"], ["Riyal qatarí", "riyal qatarí|riyal qataries|qr|qar"], ["Dirham qatarí", "dirham qatarí|dirhams qataries"], ["Libra esterlina", "libra esterlina|libras esterlinas|gbp"], ["Corona checa", "corona checa|coronas checas|kc|czk"], ["Peso dominicano", "peso dominicano|pesos dominicanos|rd$|dop"], ["Centavo dominicano", "centavo dominicano|centavos dominicanos"], ["Franco ruandés", "franco ruandés|francos ruandeses|rf|rwf"], ["Céntimo ruandés", "céntimo ruandés|céntimos ruandeses"], ["Leu rumano", "leu rumano|lei rumanos|ron"], ["Ban rumano", "ban rumano|bani rumanos"], ["Rublo ruso", "rublo ruso|rublos rusos|rub"], ["Kopek ruso", "kopek ruso|kopeks rusos"], ["Tala", "tala|tālā|ws$|sat|wst"], ["Sene", "sene"], ["Libra de Santa Helena", "libra de Santa Helena|libras de Santa Helena|shp"], ["Penique de Santa Helena", "penique de Santa Helena|peniques de Santa Helena"], ["Dobra", "dobra|db|std"], ["Dinar serbio", "dinar serbio|dinares serbios|rsd"], ["Para serbio", "para serbio|para serbios"], ["Rupia de Seychelles", "rupia de Seychelles|rupias de Seychelles|scr"], ["Centavo de Seychelles", "centavo de Seychelles|centavos de Seychelles"], ["Leone", "leone|le|sll"], ["Dólar de Singapur", "dólar de singapur|dólares de singapur|sgb"], ["Centavo de Singapur", "centavo de Singapur|centavos de Singapur"], ["Libra siria", "libra siria|libras sirias|s£|syp"], ["Piastra siria", "piastra siria|piastras sirias"], ["Chelín somalí", "chelín somalí|chelines somalies|sos"], ["Centavo somalí", "centavo somalí|centavos somalies"], ["Chelín somalilandés", "chelín somalilandés|chelines somalilandeses"], ["Centavo somalilandés", "centavo somalilandés|centavos somalilandeses"], ["Rupia de Sri Lanka", "rupia de Sri Lanka|rupias de Sri Lanka|lkr"], ["Céntimo de Sri Lanka", "céntimo de Sri Lanka|céntimos de Sri Lanka"], ["Lilangeni", "lilangeni|emalangeni|szl"], ["Rand sudafricano", "rand|rand sudafricano|zar"], ["Libra sudanesa", "libra sudanesa|libras sudanesas|sdg"], ["Piastra sudanesa", "piastra sudanesa|piastras sudanesas"], ["Libra sursudanesa", "libra sursudanesa|libras sursudanesa|ssp"], ["Piastra sursudanesa", "piastra sursudanesa|piastras sursudanesas"], ["Corona sueca", "corona sueca|coronas suecas|sek"], ["Franco suizo", "franco suizo|francos suizos|sfr|chf"], ["Rappen suizo", "rappen suizo|rappens suizos"], ["Dólar surinamés", "óolar surinamés|dólares surinameses|srd"], ["Centavo surinamés", "centavo surinamés|centavos surinamés"], ["Baht tailandés", "baht tailandés|baht tailandeses|thb"], ["Satang tailandés", "satang tailandés|satang tailandeses"], ["Nuevo dólar taiwanés", "nuevo dólar taiwanés|dólar taiwanés|dólares taiwaneses|twd"], ["Centavo taiwanés", "centavo taiwanés|centavos taiwaneses"], ["Chelín tanzano", "chelín tanzano|chelines tanzanos|tzs"], ["Centavo tanzano", "centavo tanzano|centavos tanzanos"], ["Somoni tayiko", "somoni tayiko|somoni|tjs"], ["Diram", "diram|dirams"], ["Paʻanga", "dólar tongano|dólares tonganos|paʻanga|pa'anga|top"], ["Seniti", "seniti"], ["Rublo de Transnistria", "rublo de Transnistria|rublos de Transnistria"], ["Kopek de Transnistria", "kopek de Transnistria|kopeks de Transnistria"], ["Dólar trinitense", "dólar trinitense|dólares trinitenses|ttd"], ["Centavo trinitense", "centavo trinitense|centavos trinitenses"], ["Dinar tunecino", "dinar tunecino|dinares tunecinos|tnd"], ["Millime tunecino", "millime tunecino|millimes tunecinos"], ["Lira turca", "lira turca|liras turcas|try"], ["Kuruş turca", "kuruş turca|kuruş turcas"], ["Manat turkmeno", "manat turkmeno|manat turkmenos|tmt"], ["Tennesi turkmeno", "tennesi turkmeno|tenge turkmeno"], ["Dólar tuvaluano", "dólar tuvaluano|dólares tuvaluanos"], ["Centavo tuvaluano", "centavo tuvaluano|centavos tuvaluanos"], ["Grivna", "grivna|grivnas|uah"], ["Kopiyka", "kopiyka|kópeks"], ["Chelín ugandés", "chelín ugandés|chelines ugandeses|ugx"], ["Centavo ugandés", "centavo ugandés|centavos ugandeses"], ["Peso uruguayo", "peso uruguayo|pesos uruguayos|uyu"], ["Centésimo uruguayo", "centésimo uruguayo|centésimos uruguayos"], ["Som uzbeko", "som uzbeko|som uzbekos|uzs"], ["Tiyin uzbeko", "tiyin uzbeko|tiyin uzbekos"], ["Vatu", "vatu|vuv"], ["Bolívar fuerte", "bolívar fuerte|bolívar|bolívares|vef"], ["Céntimo de bolívar", "céntimo de bolívar|céntimos de bolívar"], ["Đồng vietnamita", "Đồng vietnamita|dong vietnamita|dong vietnamitas|vnd"], ["Hào vietnamita", "Hào vietnamita|hao vietnamita|hao vietnamitas"], ["Rial yemení", "rial yemení|riales yemenies|yer"], ["Fils yemení", "fils yemení|fils yemenies"], ["Franco yibutiano", "franco yibutiano|francos yibutianos|djf"], ["Dinar yugoslavo", "dinar yugoslavo|dinares yugoslavos|yud"], ["Kwacha zambiano", "kwacha zambiano|kwacha zambianos|zmw"], ["Ngwee zambiano", "ngwee zambiano|ngwee zambianos"]]); + SpanishNumericWithUnit.CompoundUnitConnectorRegex = `(?[^.])`; + SpanishNumericWithUnit.CurrencyPrefixList = new Map([["Dólar", "$"], ["Dólar estadounidense", "us$|u$d|usd"], ["Dólar del Caribe Oriental", "ec$|xcd"], ["Dólar australiano", "a$|aud"], ["Dólar bahameño", "b$|bsd"], ["Dólar de Barbados", "bds$|bbd"], ["Dólar beliceño", "bz$|bzd"], ["Dólar bermudeño", "bd$|bmd"], ["Dólar de Brunéi", "brunéi $|bnd"], ["Dólar de Singapur", "s$|sgd"], ["Dólar canadiense", "c$|can$|cad"], ["Dólar de las Islas Caimán", "ci$|kyd"], ["Dólar neozelandés", "nz$|nzd"], ["Dólar fiyiano", "fj$|fjd"], ["Dólar guyanés", "gy$|gyd"], ["Dólar de Hong Kong", "hk$|hkd"], ["Dólar jamaiquino", "j$|ja$|jmd"], ["Dólar liberiano", "l$|lrd"], ["Dólar namibio", "n$|nad"], ["Dólar de las Islas Salomón", "si$|sbd"], ["Nuevo dólar taiwanés", "nt$|twd"], ["Real brasileño", "r$|brl"], ["Guaraní", "₲|gs.|pyg"], ["Dólar trinitense", "tt$|ttd"], ["Yuan chino", "¥|cny|rmb"], ["Yen", "¥|jpy"], ["Euro", "€|eur"], ["Florín", "ƒ"], ["Libra", "£|gbp"], ["Colón costarricense", "₡"], ["Lira turca", "₺"]]); + SpanishNumericWithUnit.AmbiguousCurrencyUnitList = ['le']; + SpanishNumericWithUnit.DimensionSuffixList = new Map([["Kilómetro", "km|kilometro|kilómetro|kilometros|kilómetros"], ["Hectómetro", "hm|hectometro|hectómetro|hectometros|hectómetros"], ["Decámetro", "decametro|decámetro|decametros|decámetros|dam"], ["Metro", "m|m.|metro|metros"], ["Decímetro", "dm|decimetro|decímetro|decimetros|decímetros"], ["Centímetro", "cm|centimetro|centímetro|centimetros|centimetros"], ["Milímetro", "mm|milimetro|milímetro|milimetros|milímetros"], ["Micrómetro", "µm|um|micrometro|micrómetro|micrometros|micrómetros|micrón|micrónes"], ["Nanómetro", "nm|nanometro|nanómetro|nanometros|nanómetros"], ["Picómetro", "pm|picometro|picómetro|picometros|picometros"], ["Milla", "mi|milla|millas"], ["Yarda", "yd|yarda|yardas"], ["Pulgada", "pulgada|pulgadas|\""], ["Pie", "pie|pies|ft"], ["Año luz", "año luz|años luz|al"], ["Metro por segundo", "metro/segundo|m/s|metro por segundo|metros por segundo|metros por segundos"], ["Kilómetro por hora", "km/h|kilómetro por hora|kilometro por hora|kilómetros por hora|kilometros por hora|kilómetro/hora|kilometro/hora|kilómetros/hora|kilometros/hora"], ["Kilómetro por minuto", "km/min|kilómetro por minuto|kilometro por minuto|kilómetros por minuto|kilometros por minuto|kilómetro/minuto|kilometro/minuto|kilómetros/minuto|kilometros/minuto"], ["Kilómetro por segundo", "km/seg|kilómetro por segundo|kilometro por segundo|kilómetros por segundo|kilometros por segundo|kilómetro/segundo|kilometro/segundo|kilómetros/segundo|kilometros/segundo"], ["Milla por hora", "mph|milla por hora|mi/h|milla/hora|millas/hora|millas por hora"], ["Nudo", "kt|nudo|nudos|kn"], ["Pie por segundo", "ft/s|pie/s|ft/seg|pie/seg|pie por segundo|pies por segundo"], ["Pie por minuto", "ft/min|pie/min|pie por minuto|pies por minuto"], ["Yarda por minuto", "yardas por minuto|yardas/minuto|yardas/min"], ["Yarda por segundo", "yardas por segundo|yardas/segundo|yardas/seg"], ["Kilómetro cuadrado", "kilómetro cuadrado|kilómetros cuadrados|km2|km^2|km²"], ["Hectómetro cuadrado", "hectómetro cuadrado|hectómetros cuadrados|hm2|hm^2|hm²|hectárea|hectáreas"], ["Decámetro cuadrado", "decámetro cuadrado|decámetros cuadrados|dam2|dam^2|dam²|área|áreas"], ["Metro cuadrado", "metro cuadrado|metros cuadrados|m2|m^2|m²"], ["Decímetro cuadrado", "decímetro cuadrado|decímetros cuadrados|dm2|dm^2|dm²"], ["Centímetro cuadrado", "centímetro cuadrado|centímetros cuadrados|cm2|cm^2|cm²"], ["Milímetro cuadrado", "milímetro cuadrado|milímetros cuadrados|mm2|mm^2|mm²"], ["Pulgada cuadrado", "pulgada cuadrada|pulgadas cuadradas"], ["Pie cuadrado", "pie cuadrado|pies cuadrados|pie2|pie^2|pie²|ft2|ft^2|ft²"], ["Yarda cuadrado", "yarda cuadrada|yardas cuadradas|yd2|yd^2|yd²"], ["Acre", "acre|acres"], ["Kilómetro cúbico", "kilómetro cúbico|kilómetros cúbico|km3|km^3|km³"], ["Hectómetro cúbico", "hectómetro cúbico|hectómetros cúbico|hm3|hm^3|hm³"], ["Decámetro cúbico", "decámetro cúbico|decámetros cúbico|dam3|dam^3|dam³"], ["Metro cúbico", "metro cúbico|metros cúbico|m3|m^3|m³"], ["Decímetro cúbico", "decímetro cúbico|decímetros cúbico|dm3|dm^3|dm³"], ["Centímetro cúbico", "centímetro cúbico|centímetros cúbico|cc|cm3|cm^3|cm³"], ["Milímetro cúbico", "milímetro cúbico|milímetros cúbico|mm3|mm^3|mm³"], ["Pulgada cúbica", "pulgada cúbics|pulgadas cúbicas"], ["Pie cúbico", "pie cúbico|pies cúbicos|pie3|pie^3|pie³|ft3|ft^3|ft³"], ["Yarda cúbica", "yarda cúbica|yardas cúbicas|yd3|yd^3|yd³"], ["Hectolitro", "hectolitro|hectolitros|hl"], ["Litro", "litro|litros|lts|l"], ["Mililitro", "mililitro|mililitros|ml"], ["Galón", "galón|galones"], ["Pinta", "pinta|pintas"], ["Barril", "barril|barriles"], ["Onza líquida", "onza líquida|onzas líquidas"], ["Tonelada métrica", "tonelada métrica|toneladas métricas"], ["Tonelada", "ton|tonelada|toneladas"], ["Kilogramo", "kg|kilogramo|kilogramos"], ["Hectogramo", "hg|hectogramo|hectogramos"], ["Decagramo", "dag|decagramo|decagramos"], ["Gramo", "g|gr|gramo|gramos"], ["Decigramo", "dg|decigramo|decigramos"], ["Centigramo", "cg|centigramo|centigramos"], ["Miligramo", "mg|miligramo|miligramos"], ["Microgramo", "µg|ug|microgramo|microgramos"], ["Nanogramo", "ng|nanogramo|nanogramos"], ["Picogramo", "pg|picogramo|picogramos"], ["Libra", "lb|libra|libras"], ["Onza", "oz|onza|onzas"], ["Grano", "grano|granos"], ["Quilate", "ct|kt|quilate|quilates"], ["bit", "bit|bits"], ["kilobit", "kilobit|kilobits|kb|kbit"], ["megabit", "megabit|megabits|Mb|Mbit"], ["gigabit", "gigabit|gigabits|Gb|Gbit"], ["terabit", "terabit|terabits|Tb|Tbit"], ["petabit", "petabit|petabits|Pb|Pbit"], ["kibibit", "kibibit|kibibits|kib|kibit"], ["mebibit", "mebibit|mebibits|Mib|Mibit"], ["gibibit", "gibibit|gibibits|Gib|Gibit"], ["tebibit", "tebibit|tebibits|Tib|Tibit"], ["pebibit", "pebibit|pebibits|Pib|Pibit"], ["byte", "byte|bytes"], ["kilobyte", "kilobyte|kilobytes|kB|kByte"], ["megabyte", "megabyte|megabytes|MB|MByte"], ["gigabyte", "gigabyte|gigabytes|GB|GByte"], ["terabyte", "terabyte|terabytes|TB|TByte"], ["petabyte", "petabyte|petabytes|PB|PByte"], ["kibibyte", "kibibyte|kibibytes|kiB|kiByte"], ["mebibyte", "mebibyte|mebibytes|MiB|MiByte"], ["gibibyte", "gibibyte|gibibytes|GiB|GiByte"], ["tebibyte", "tebibyte|tebibytes|TiB|TiByte"], ["pebibyte", "pebibyte|pebibytes|PiB|PiByte"]]); + SpanishNumericWithUnit.AmbiguousDimensionUnitList = ['al', 'mi', 'área', 'áreas', 'pie', 'pies']; + SpanishNumericWithUnit.LengthSuffixList = new Map([["Kilómetro", "km|kilometro|kilómetro|kilometros|kilómetros"], ["Hectómetro", "hm|hectometro|hectómetro|hectometros|hectómetros"], ["Decámetro", "decametro|decámetro|decametros|decámetros|dam"], ["Metro", "m|m.|metro|metros"], ["Decímetro", "dm|decimetro|decímetro|decimetros|decímetros"], ["Centímetro", "cm|centimetro|centímetro|centimetros|centimetros"], ["Milímetro", "mm|milimetro|milímetro|milimetros|milímetros"], ["Micrómetro", "µm|um|micrometro|micrómetro|micrometros|micrómetros|micrón|micrónes"], ["Nanómetro", "nm|nanometro|nanómetro|nanometros|nanómetros"], ["Picómetro", "pm|picometro|picómetro|picometros|picómetros"], ["Milla", "mi|milla|millas"], ["Yarda", "yd|yarda|yardas"], ["Pulgada", "pulgada|pulgadas|\""], ["Pie", "pie|pies|ft"], ["Año luz", "año luz|años luz|al"]]); + SpanishNumericWithUnit.AmbiguousLengthUnitList = ['mi', 'área', 'áreas']; + SpanishNumericWithUnit.BuildPrefix = `(?<=(\\s|^|\\P{L}))`; + SpanishNumericWithUnit.BuildSuffix = `(?=(\\s|\\P{L}|$))`; + SpanishNumericWithUnit.ConnectorToken = 'de'; + SpanishNumericWithUnit.SpeedSuffixList = new Map([["Metro por segundo", "metro/segundo|m/s|metro por segundo|metros por segundo|metros por segundos"], ["Kilómetro por hora", "km/h|kilómetro por hora|kilometro por hora|kilómetros por hora|kilometros por hora|kilómetro/hora|kilometro/hora|kilómetros/hora|kilometros/hora"], ["Kilómetro por minuto", "km/min|kilómetro por minuto|kilometro por minuto|kilómetros por minuto|kilometros por minuto|kilómetro/minuto|kilometro/minuto|kilómetros/minuto|kilometros/minuto"], ["Kilómetro por segundo", "km/seg|kilómetro por segundo|kilometro por segundo|kilómetros por segundo|kilometros por segundo|kilómetro/segundo|kilometro/segundo|kilómetros/segundo|kilometros/segundo"], ["Milla por hora", "mph|milla por hora|mi/h|milla/hora|millas/hora|millas por hora"], ["Nudo", "kt|nudo|nudos|kn"], ["Pie por segundo", "ft/s|pie/s|ft/seg|pie/seg|pie por segundo|pies por segundo"], ["Pie por minuto", "ft/min|pie/min|pie por minuto|pies por minuto"], ["Yarda por minuto", "yardas por minuto|yardas/minuto|yardas/min"], ["Yarda por segundo", "yardas por segundo|yardas/segundo|yardas/seg"]]); + SpanishNumericWithUnit.AmbiguousSpeedUnitList = ['nudo', 'nudos']; + SpanishNumericWithUnit.TemperatureSuffixList = new Map([["Kelvin", "k|kelvin"], ["Rankine", "r|rankine"], ["Grado Celsius", "°c|grados c|grado celsius|grados celsius|celsius|grado centígrado|grados centígrados|centígrado|centígrados"], ["Grado Fahrenheit", "°f|grados f|grado fahrenheit|grados fahrenheit|fahrenheit"], ["Grado Réaumur", "°r|°re|grados r|grado réaumur|grados réaumur|réaumur"], ["Grado Delisle", "°d|grados d|grado delisle|grados delisle|delisle"], ["Grado", "°|grados|grado"]]); + SpanishNumericWithUnit.VolumeSuffixList = new Map([["Kilómetro cúbico", "kilómetro cúbico|kilómetros cúbico|km3|km^3|km³"], ["Hectómetro cúbico", "hectómetro cúbico|hectómetros cúbico|hm3|hm^3|hm³"], ["Decámetro cúbico", "decámetro cúbico|decámetros cúbico|dam3|dam^3|dam³"], ["Metro cúbico", "metro cúbico|metros cúbico|m3|m^3|m³"], ["Decímetro cúbico", "decímetro cúbico|decímetros cúbico|dm3|dm^3|dm³"], ["Centímetro cúbico", "centímetro cúbico|centímetros cúbico|cc|cm3|cm^3|cm³"], ["Milímetro cúbico", "milímetro cúbico|milímetros cúbico|mm3|mm^3|mm³"], ["Pulgada cúbica", "pulgada cúbica|pulgadas cúbicas"], ["Pie cúbico", "pie cúbico|pies cúbicos|pie3|pie^3|pie³|ft3|ft^3|ft³"], ["Yarda cúbica", "yarda cúbica|yardas cúbicas|yd3|yd^3|yd³"], ["Hectolitro", "hectolitro|hectolitros|hl"], ["Litro", "litro|litros|lts|l"], ["Mililitro", "mililitro|mililitros|ml"], ["Galón", "galón|galones"], ["Pinta", "pinta|pintas"], ["Barril", "barril|barriles|bbl"], ["Onza líquida", "onza líquida|onzas líquidas"]]); + SpanishNumericWithUnit.WeightSuffixList = new Map([["Tonelada métrica", "tonelada métrica|toneladas métricas"], ["Tonelada", "ton|tonelada|toneladas"], ["Kilogramo", "kg|kilogramo|kilogramos"], ["Hectogramo", "hg|hectogramo|hectogramos"], ["Decagramo", "dag|decagramo|decagramos"], ["Gramo", "g|gr|gramo|gramos"], ["Decigramo", "dg|decigramo|decigramos"], ["Centigramo", "cg|centigramo|centigramos"], ["Miligramo", "mg|miligramo|miligramos"], ["Microgramo", "µg|ug|microgramo|microgramos"], ["Nanogramo", "ng|nanogramo|nanogramos"], ["Picogramo", "pg|picogramo|picogramos"], ["Libra", "lb|libra|libras"], ["Onza", "oz|onza|onzas"], ["Grano", "grano|granos|gr"], ["Quilate", "ct|kt|quilate|quilates"]]); +})(SpanishNumericWithUnit = exports.SpanishNumericWithUnit || (exports.SpanishNumericWithUnit = {})); + +}); + +unwrapExports(spanishNumericWithUnit); + +var base$2 = createCommonjsModule(function (module, exports) { +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); + + + + + +class SpanishNumberWithUnitExtractorConfiguration { + constructor(ci) { + this.cultureInfo = ci; + this.unitNumExtractor = new recognizersTextNumber.SpanishNumberExtractor(); + this.buildPrefix = spanishNumericWithUnit.SpanishNumericWithUnit.BuildPrefix; + this.buildSuffix = spanishNumericWithUnit.SpanishNumericWithUnit.BuildSuffix; + this.connectorToken = spanishNumericWithUnit.SpanishNumericWithUnit.ConnectorToken; + this.compoundUnitConnectorRegex = recognizersText.RegExpUtility.getSafeRegExp(spanishNumericWithUnit.SpanishNumericWithUnit.CompoundUnitConnectorRegex); + this.pmNonUnitRegex = recognizersText.RegExpUtility.getSafeRegExp(baseUnits.BaseUnits.PmNonUnitRegex); + } +} +exports.SpanishNumberWithUnitExtractorConfiguration = SpanishNumberWithUnitExtractorConfiguration; +class SpanishNumberWithUnitParserConfiguration extends parsers$8.BaseNumberWithUnitParserConfiguration { + constructor(ci) { + super(ci); + this.internalNumberExtractor = new recognizersTextNumber.SpanishNumberExtractor(recognizersTextNumber.NumberMode.Default); + this.internalNumberParser = recognizersTextNumber.AgnosticNumberParserFactory.getParser(recognizersTextNumber.AgnosticNumberParserType.Number, new recognizersTextNumber.SpanishNumberParserConfiguration()); + this.connectorToken = spanishNumericWithUnit.SpanishNumericWithUnit.ConnectorToken; + } +} +exports.SpanishNumberWithUnitParserConfiguration = SpanishNumberWithUnitParserConfiguration; + +}); + +unwrapExports(base$2); + +var currency$2 = createCommonjsModule(function (module, exports) { +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); + + + + +class SpanishCurrencyExtractorConfiguration extends base$2.SpanishNumberWithUnitExtractorConfiguration { + constructor(ci) { + if (!ci) { + ci = new recognizersTextNumber.CultureInfo(recognizersTextNumber.Culture.Spanish); + } + super(ci); + this.extractType = constants$4.Constants.SYS_UNIT_CURRENCY; + // Reference Source: https:// en.wikipedia.org/wiki/List_of_circulating_currencies + this.suffixList = spanishNumericWithUnit.SpanishNumericWithUnit.CurrencySuffixList; + this.prefixList = spanishNumericWithUnit.SpanishNumericWithUnit.CurrencyPrefixList; + this.ambiguousUnitList = spanishNumericWithUnit.SpanishNumericWithUnit.AmbiguousCurrencyUnitList; + } +} +exports.SpanishCurrencyExtractorConfiguration = SpanishCurrencyExtractorConfiguration; +class SpanishCurrencyParserConfiguration extends base$2.SpanishNumberWithUnitParserConfiguration { + constructor(ci) { + if (!ci) { + ci = new recognizersTextNumber.CultureInfo(recognizersTextNumber.Culture.Spanish); + } + super(ci); + this.BindDictionary(spanishNumericWithUnit.SpanishNumericWithUnit.CurrencySuffixList); + this.BindDictionary(spanishNumericWithUnit.SpanishNumericWithUnit.CurrencyPrefixList); + } +} +exports.SpanishCurrencyParserConfiguration = SpanishCurrencyParserConfiguration; + +}); + +unwrapExports(currency$2); + +var temperature$2 = createCommonjsModule(function (module, exports) { +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); + + + + +class SpanishTemperatureExtractorConfiguration extends base$2.SpanishNumberWithUnitExtractorConfiguration { + constructor(ci) { + if (!ci) { + ci = new recognizersTextNumber.CultureInfo(recognizersTextNumber.Culture.Spanish); + } + super(ci); + this.extractType = constants$4.Constants.SYS_UNIT_TEMPERATURE; + this.suffixList = spanishNumericWithUnit.SpanishNumericWithUnit.TemperatureSuffixList; + this.prefixList = new Map(); + this.ambiguousUnitList = new Array(); + } +} +exports.SpanishTemperatureExtractorConfiguration = SpanishTemperatureExtractorConfiguration; +class SpanishTemperatureParserConfiguration extends base$2.SpanishNumberWithUnitParserConfiguration { + constructor(ci) { + if (!ci) { + ci = new recognizersTextNumber.CultureInfo(recognizersTextNumber.Culture.Spanish); + } + super(ci); + this.BindDictionary(spanishNumericWithUnit.SpanishNumericWithUnit.TemperatureSuffixList); + } +} +exports.SpanishTemperatureParserConfiguration = SpanishTemperatureParserConfiguration; + +}); + +unwrapExports(temperature$2); + +var dimension$2 = createCommonjsModule(function (module, exports) { +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); + + + + +class SpanishDimensionExtractorConfiguration extends base$2.SpanishNumberWithUnitExtractorConfiguration { + constructor(ci) { + if (!ci) { + ci = new recognizersTextNumber.CultureInfo(recognizersTextNumber.Culture.Spanish); + } + super(ci); + this.extractType = constants$4.Constants.SYS_UNIT_DIMENSION; + this.suffixList = spanishNumericWithUnit.SpanishNumericWithUnit.DimensionSuffixList; + this.prefixList = new Map(); + this.ambiguousUnitList = spanishNumericWithUnit.SpanishNumericWithUnit.AmbiguousDimensionUnitList; + } +} +exports.SpanishDimensionExtractorConfiguration = SpanishDimensionExtractorConfiguration; +class SpanishDimensionParserConfiguration extends base$2.SpanishNumberWithUnitParserConfiguration { + constructor(ci) { + if (!ci) { + ci = new recognizersTextNumber.CultureInfo(recognizersTextNumber.Culture.Spanish); + } + super(ci); + this.BindDictionary(spanishNumericWithUnit.SpanishNumericWithUnit.DimensionSuffixList); + } +} +exports.SpanishDimensionParserConfiguration = SpanishDimensionParserConfiguration; + +}); + +unwrapExports(dimension$2); + +var age$2 = createCommonjsModule(function (module, exports) { +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); + + + + +class SpanishAgeExtractorConfiguration extends base$2.SpanishNumberWithUnitExtractorConfiguration { + constructor(ci) { + if (!ci) { + ci = new recognizersTextNumber.CultureInfo(recognizersTextNumber.Culture.Spanish); + } + super(ci); + this.extractType = constants$4.Constants.SYS_UNIT_AGE; + this.suffixList = spanishNumericWithUnit.SpanishNumericWithUnit.AgeSuffixList; + this.prefixList = new Map(); + this.ambiguousUnitList = new Array(); + } +} +exports.SpanishAgeExtractorConfiguration = SpanishAgeExtractorConfiguration; +class SpanishAgeParserConfiguration extends base$2.SpanishNumberWithUnitParserConfiguration { + constructor(ci) { + if (!ci) { + ci = new recognizersTextNumber.CultureInfo(recognizersTextNumber.Culture.Spanish); + } + super(ci); + this.BindDictionary(spanishNumericWithUnit.SpanishNumericWithUnit.AgeSuffixList); + } +} +exports.SpanishAgeParserConfiguration = SpanishAgeParserConfiguration; + +}); + +unwrapExports(age$2); + +var portugueseNumericWithUnit = createCommonjsModule(function (module, exports) { +"use strict"; +// ------------------------------------------------------------------------------ +// +// This code was generated by a tool. +// Changes to this file may cause incorrect behavior and will be lost if +// the code is regenerated. +// +// ------------------------------------------------------------------------------ +Object.defineProperty(exports, "__esModule", { value: true }); +var PortugueseNumericWithUnit; +(function (PortugueseNumericWithUnit) { + PortugueseNumericWithUnit.AgeSuffixList = new Map([["Ano", "anos|ano"], ["Mês", "meses|mes|mês"], ["Semana", "semanas|semana"], ["Dia", "dias|dia"]]); + PortugueseNumericWithUnit.AreaSuffixList = new Map([["Quilômetro quadrado", "quilômetro quadrado|quilómetro quadrado|quilometro quadrado|quilômetros quadrados|quilómetros quadrados|quilomeros quadrados|km2|km^2|km²"], ["Hectare", "hectômetro quadrado|hectómetro quadrado|hectômetros quadrados|hectómetros cuadrados|hm2|hm^2|hm²|hectare|hectares"], ["Decâmetro quadrado", "decâmetro quadrado|decametro quadrado|decâmetros quadrados|decametro quadrado|dam2|dam^2|dam²|are|ares"], ["Metro quadrado", "metro quadrado|metros quadrados|m2|m^2|m²"], ["Decímetro quadrado", "decímetro quadrado|decimentro quadrado|decímetros quadrados|decimentros quadrados|dm2|dm^2|dm²"], ["Centímetro quadrado", "centímetro quadrado|centimetro quadrado|centímetros quadrados|centrimetros quadrados|cm2|cm^2|cm²"], ["Milímetro quadrado", "milímetro quadrado|milimetro quadrado|milímetros quadrados|militmetros quadrados|mm2|mm^2|mm²"], ["Polegada quadrada", "polegada quadrada|polegadas quadradas|in2|in^2|in²"], ["Pé quadrado", "pé quadrado|pe quadrado|pés quadrados|pes quadrados|pé2|pé^2|pé²|sqft|sq ft|ft2|ft^2|ft²"], ["Jarda quadrada", "jarda quadrada|jardas quadradas|yd2|yd^2|yd²"], ["Milha quadrada", "milha quadrada|milhas quadradas|mi2|mi^2|mi²"], ["Acre", "acre|acres"]]); + PortugueseNumericWithUnit.CurrencySuffixList = new Map([["Dólar", "dólar|dolar|dólares|dolares"], ["Peso", "peso|pesos"], ["Coroa", "coroa|coroas"], ["Rublo", "rublo|rublos"], ["Libra", "libra|libras"], ["Florim", "florim|florins|ƒ"], ["Dinar", "dinar|dinares"], ["Franco", "franco|francos"], ["Rupia", "rúpia|rupia|rúpias|rupias"], ["Escudo", "escudo|escudos"], ["Xelim", "xelim|xelins|xelims"], ["Lira", "lira|liras"], ["Centavo", "centavo|cêntimo|centimo|centavos|cêntimos|centimo"], ["Centésimo", "centésimo|centésimos"], ["Pêni", "pêni|péni|peni|penies|pennies"], ["Manat", "manat|manate|mánate|man|manats|manates|mánates"], ["Euro", "euro|euros|€|eur"], ["Centavo de Euro", "centavo de euro|cêntimo de euro|centimo de euro|centavos de euro|cêntimos de euro|centimos de euro"], ["Dólar do Caribe Oriental", "dólar do Caribe Oriental|dolar do Caribe Oriental|dólares do Caribe Oriental|dolares do Caribe Oriental|dólar das Caraíbas Orientais|dolar das Caraibas Orientais|dólares das Caraíbas Orientais|dolares das Caraibas Orientais|ec$|xcd"], ["Centavo do Caribe Oriental", "centavo do Caribe Oriental|centavo das Caraíbas Orientais|cêntimo do Caribe Oriental|cêntimo das Caraíbas Orientais|centavos do Caribe Oriental|centavos das Caraíbas Orientais|cêntimos do Caribe Oriental|cêntimos das Caraíbas Orientais"], ["Franco CFA da África Ocidental", "franco CFA da África Ocidental|franco CFA da Africa Ocidental|francos CFA da África Occidental|francos CFA da Africa Occidental|franco CFA Ocidental|xof"], ["Centavo de CFA da África Ocidental", "centavo de CFA da Africa Occidental|centavos de CFA da África Ocidental|cêntimo de CFA da Africa Occidental|cêntimos de CFA da África Ocidental"], ["Franco CFA da África Central", "franco CFA da África Central|franco CFA da Africa Central|francos CFA da África Central|francos CFA da Africa Central|franco CFA central|xaf"], ["Centavo de CFA da África Central", "centavo de CFA de África Central|centavos de CFA da África Central|cêntimo de CFA de África Central|cêntimos de CFA da África Central"], ["Apsar abcásio", "apsar abcásio|apsar abecásio|apsar abcasio|apsar|apsares"], ["Afegani afegão", "afegani afegão|afegane afegão|؋|afn|afegane|afgane|afegâni|afeganis|afeganes|afganes|afegânis"], ["Pul", "pul|pules|puls"], ["Lek albanês", "lek|lekë|lekes|lek albanês|leque|leques|all"], ["Qindarke", "qindarka|qindarkë|qindarke|qindarkas"], ["Kwanza angolano", "kwanza angolano|kwanzas angolanos|kwanza|kwanzas|aoa|kz"], ["Cêntimo angolano", "cêntimo angolano|cêntimo|cêntimos"], ["Florim das Antilhas Holandesas", "florim das antilhas holandesas|florim das antilhas neerlandesas|ang"], ["Rial saudita", "rial saudita|riais sauditas|riyal saudita|riyals sauditas|riyal|riyals|sar"], ["Halala saudita", "halala saudita|halala|hallalah"], ["Dinar argelino", "dinar argelino|dinares argelinos|dzd"], ["Cêntimo argelino", "centimo argelino|centimos argelinos|cêntimo argelino|cêntimos argelinos|centavo argelino|centavos argelinos"], ["Peso argentino", "peso argentino|pesos argentinos|peso|pesos|ar$|ars"], ["Centavo argentino", "centavo argentino|centavos argentinos|centavo|ctvo.|ctvos."], ["Dram armênio", "dram armênio|dram armênios|dram arménio|dram arménios|dram armenio|dram armenios|dram|drame|drames|դր."], ["Luma armênio", "luma armênio|lumas armênios|luma arménio|lumas arménios|luma armenio|lumas armenios|luma|lumas"], ["Florim arubano", "florín arubeño|florines arubeños|ƒ arubeños|aƒ|awg"], ["Dólar australiano", "dólar australiano|dólares australianos|dolar australiano|dolares australianos|a$|aud"], ["Centavo australiano", "centavo australiano|centavos australianos"], ["Manat azeri", "manat azeri|manats azeris|azn|manat azerbaijanês|manat azerbaijano|manats azerbaijaneses|manats azerbaijanos"], ["Qəpik azeri", "qəpik azeri|qəpik|qəpiks"], ["Dólar bahamense", "dólar bahamense|dólares bahamense|dolar bahamense|dolares bahamense|dólar baamiano|dólares baamiano|dolar baamiano|dolares baamiano|b$|bsd"], ["Centavo bahamense", "centavo bahamense|centavos bahamense"], ["Dinar bareinita", "dinar bareinita|dinar baremita|dinares bareinitas|dinares baremitas|bhd"], ["Fil bareinita", "fil bareinita|fil baremita|fils bareinitas|fils baremitas"], ["Taka bengali", "taka bengali|takas bengalis|taca|tacas|taka|takas|bdt"], ["Poisha bengali", "poisha bengali|poishas bengalis"], ["Dólar de Barbados", "dólar de barbados|dólares de barbados|dolar de barbados|dolares de barbados|dólar dos barbados|dólares dos barbados|bbd"], ["Centavo de Barbados", "centavo de barbados|centavos de barbados|centavo dos barbados|centavos dos barbados"], ["Dólar de Belize", "dólar de belize|dólares de belize|dolar de belize|dolares de belize|dólar do belize|dólares do belize|dolar do belize|dolares do belize|bz$|bzd"], ["Centavo de Belize", "centavo de belize|centavos de belize|cêntimo do belize|cêntimos do belize"], ["Dólar bermudense", "dólar bermudense|dólares bermudenses|bd$|bmd"], ["Centavo bermudense", "centavo bermudense|centavos bermudenses|cêntimo bermudense| cêntimos bermudenses"], ["Rublo bielorrusso", "rublo bielorrusso|rublos bielorrussos|br|byr"], ["Copeque bielorusso", "copeque bielorrusso|copeques bielorrussos|kopek bielorrusso|kopeks bielorrussos|kap"], ["Quiate mianmarense", "quiate mianmarense|quiates mianmarenses|kyat mianmarense|kyates mianmarenses|quiate myanmarense|quiates myanmarenses|kyat myanmarense|kyates myanmarenses|quiate birmanês|quite birmanes|quiates birmaneses|kyat birmanês|kyat birmanes|kyates birmaneses|mmk"], ["Pya mianmarense", "pya mianmarense|pyas mianmarenses|pya myanmarense|pyas myanmarenses|pya birmanês|pya birmanes|pyas birmaneses"], ["Boliviano", "boliviano|bolivianos|bob|bs"], ["Centavo Boliviano", "centavo boliviano|centavos bolivianos"], ["Marco da Bósnia e Herzegovina", "marco conversível|marco conversivel|marco convertível|marco convertivel|marcos conversíveis|marcos conversiveis|marcos convertíveis|marcos convertivies|bam"], ["Fening da Bósnia e Herzegovina", "fening conversível|fening conversivel|fening convertível|fening convertivel|fenings conversíveis|fenings conversiveis|fenings convertíveis|fenings convertiveis"], ["Pula", "pula|pulas|bwp"], ["Thebe", "thebe|thebes"], ["Real brasileiro", "real brasileiro|real do brasil|real|reais brasileiros|reais do brasil|reais|r$|brl"], ["Centavo brasileiro", "centavo de real|centavo brasileiro|centavos de real|centavos brasileiros"], ["Dólar de Brunei", "dólar de brunei|dolar de brunei|dólar do brunei|dolar do brunei|dólares de brunéi|dolares de brunei|dólares do brunei|dolares do brunei|bnd"], ["Sen de Brunei", "sen de brunei|sen do brunei|sens de brunei|sens do brunei"], ["Lev búlgaro", "lev búlgaro|leve búlgaro|leves búlgaros|lev bulgaro|leve bulgaro|leves bulgaros|lv|bgn"], ["Stotinka búlgaro", "stotinka búlgaro|stotinki búlgaros|stotinka bulgaro|stotinki bulgaros"], ["Franco do Burundi", "franco do burundi|francos do burundi|fbu|fib"], ["Centavo Burundi", "centavo burundi|cêntimo burundi|centimo burundi|centavos burundi|cêntimo burundi|centimo burundi"], ["Ngultrum butanês", "ngultrum butanês|ngultrum butanes|ngúltrume butanês|ngultrume butanes|ngultrum butaneses|ngúltrumes butaneses|ngultrumes butaneses|btn"], ["Chetrum butanês", "chetrum butanês|chetrum butanes|chetrum butaneses"], ["Escudo cabo-verdiano", "escudo cabo-verdiano|escudos cabo-verdianos|cve"], ["Riel cambojano", "riel cambojano|riéis cambojanos|rieis cambojanos|khr"], ["Dólar canadense", "dólar canadense|dolar canadense|dólares canadenses|dolares canadenses|c$|cad"], ["Centavo canadense", "centavo canadense|centavos canadenses"], ["Peso chileno", "peso chileno|pesos chilenos|cpl"], ["Yuan chinês", "yuan chinês|yuan chines|yuans chineses|yuan|yuans|renminbi|rmb|cny|¥"], ["Peso colombiano", "peso colombiano|pesos colombianos|cop|col$"], ["Centavo colombiano", "centavo colombiano|centavos colombianos"], ["Franco comorense", "franco comorense|francos comorenses|kmf|₣"], ["Franco congolês", "franco congolês|franco congoles|francos congoleses|cdf"], ["Centavo congolês", "centavo congolês|centavo congoles|centavos congoleses|cêntimo congolês|centimo congoles|cêntimos congoleses|cêntimos congoleses"], ["Won norte-coreano", "won norte-coreano|wŏn norte-coreano|won norte-coreanos|wŏn norte-coreanos|kpw"], ["Chon norte-coreano", "chon norte-coreano|chŏn norte-coreano|chŏn norte-coreanos|chon norte-coreanos"], ["Won sul-coreano", "wŏn sul-coreano|won sul-coreano|wŏnes sul-coreanos|wones sul-coreanos|krw"], ["Jeon sul-coreano", "jeons sul-coreano|jeons sul-coreanos"], ["Colón costarriquenho", "colón costarriquenho|colon costarriquenho|colons costarriquenho|colones costarriquenhos|crc"], ["Kuna croata", "kuna croata|kunas croatas|hrk"], ["Lipa croata", "lipa croata|lipas croatas"], ["Peso cubano", "peso cubano|pesos cubanos|cup"], ["Peso cubano convertível", "peso cubano conversível|pesos cubanos conversíveis|peso cubano conversivel|pesos cubanos conversiveis|peso cubano convertível|pesos cubanos convertíveis|peso cubano convertivel|pesos cubanos convertiveis|cuc"], ["Coroa dinamarquesa", "coroa dinamarquesa|coroas dinamarquesas|dkk"], ["Libra egípcia", "libra egípcia|libra egipcia|libras egípcias|libras egipcias|egp|le"], ["Piastra egípcia", "piastra egípcia|piastra egipcia|pisastras egípcias|piastras egipcias"], ["Dirham dos Emirados Árabes Unidos", "dirham|dirhams|dirham dos emirados arabes unidos|aed|dhs"], ["Nakfa", "nakfa|nfk|ern"], ["Centavo de Nakfa", "cêntimo de nakfa|cêntimos de nakfa|centavo de nafka|centavos de nafka"], ["Peseta", "peseta|pesetas|pts.|ptas.|esp"], ["Dólar estadunidense", "dólar dos estados unidos|dolar dos estados unidos|dólar estadunidense|dólar americano|dólares dos estados unidos|dolares dos estados unidos|dólares estadunidenses|dólares americanos|dolar estadunidense|dolar americano|dolares estadunidenses|dolares americanos|usd|u$d|us$"], ["Coroa estoniana", "coroa estoniana|coroas estonianas|eek"], ["Senti estoniano", "senti estoniano|senti estonianos"], ["Birr etíope", "birr etíope|birr etiope|birr etíopes|birr etiopes|br|etb"], ["Santim etíope", "santim etíope|santim etiope|santim etíopes|santim etiopes"], ["Peso filipino", "peso filipino|pesos filipinos|php"], ["Marco finlandês", "marco finlandês|marco finlandes|marcos finlandeses"], ["Dólar fijiano", "dólar fijiano|dolar fijiano|dólares fijianos|dolares fijianos|fj$|fjd"], ["Centavo fijiano", "centavo fijiano|centavos fijianos"], ["Dalasi gambiano", "dalasi|gmd"], ["Bututs", "butut|bututs"], ["Lari georgiano", "lari georgiano|lari georgianos|gel"], ["Tetri georgiano", "tetri georgiano|tetri georgianos"], ["Cedi", "cedi|ghs|gh₵"], ["Pesewa", "pesewa"], ["Libra de Gibraltar", "libra de gibraltar|libras de gibraltar|gip"], ["Peni de Gibraltar", "peni de gibraltar|penies de gibraltar"], ["Quetzal guatemalteco", "quetzal guatemalteco|quetzales guatemaltecos|quetzal|quetzales|gtq"], ["Centavo guatemalteco", "centavo guatemalteco|centavos guatemaltecos"], ["Libra de Guernsey", "libra de Guernsey|libras de Guernsey|ggp"], ["Peni de Guernsey", "peni de Guernsey|penies de Guernsey"], ["Franco da Guiné", "franco da guiné|franco da guine| franco guineense|francos da guiné|francos da guine|francos guineense|gnf|fg"], ["Centavo da Guiné", "cêntimo guineense|centimo guineense|centavo guineense|cêntimos guineenses|centimos guineenses|centavos guineenses"], ["Dólar guianense", "dólar guianense|dólares guianense|dolar guianense|dolares guianense|gyd|gy"], ["Gurde haitiano", "gurde haitiano|gourde|gurdes haitianos|htg"], ["Centavo haitiano", "cêntimo haitiano|cêntimos haitianos|centavo haitiano|centavos haitianos"], ["Lempira hondurenha", "lempira hondurenha|lempiras hondurenhas|lempira|lempiras|hnl"], ["Centavo hondurenho", "centavo hondurenho|centavos hondurehos|cêntimo hondurenho|cêntimos hondurenhos"], ["Dólar de Hong Kong", "dólar de hong kong|dolar de hong kong|dólares de hong kong|dolares de hong kong|hk$|hkd"], ["Florim húngaro", "florim húngaro|florim hungaro|florins húngaros|florins hungaros|forinte|forintes|huf"], ["Filér húngaro", "fillér|filér|filler|filer"], ["Rupia indiana", "rúpia indiana|rupia indiana|rupias indianas|inr"], ["Paisa indiana", "paisa indiana|paisas indianas"], ["Rupia indonésia", "rupia indonesia|rupia indonésia|rupias indonesias|rupias indonésias|idr"], ["Sen indonésio", "send indonésio|sen indonesio|sen indonésios|sen indonesios"], ["Rial iraniano", "rial iraniano|riais iranianos|irr"], ["Dinar iraquiano", "dinar iraquiano|dinares iraquianos|iqd"], ["Fil iraquiano", "fil iraquiano|fils iraquianos|files iraquianos"], ["Libra manesa", "libra manesa|libras manesas|imp"], ["Peni manês", "peni manes|peni manês|penies maneses"], ["Coroa islandesa", "coroa islandesa|coroas islandesas|isk|íkr"], ["Aurar islandês", "aurar islandês|aurar islandes|aurar islandeses|eyrir"], ["Dólar das Ilhas Cayman", "dólar das ilhas cayman|dolar das ilhas cayman|dólar das ilhas caimão|dólares das ilhas cayman|dolares das ilhas cayman|dólares das ilhas caimão|ci$|kyd"], ["Dólar das Ilhas Cook", "dólar das ilhas cook|dolar das ilhas cook|dólares das ilhas cook|dolares das ilhas cook"], ["Coroa feroesa", "coroa feroesa|coroas feroesas|fkr"], ["Libra das Malvinas", "libra das malvinas|libras das malvinas|fk£|fkp"], ["Dólar das Ilhas Salomão", "dólar das ilhas salomão|dolar das ilhas salomao|dólares das ilhas salomão|dolares das ilhas salomao|sbd"], ["Novo shekel israelense", "novo shekel|novos shekeles|novo shequel|novo siclo|novo xéquel|shekeles novos|novos sheqalim|sheqalim novos|ils"], ["Agora", "agora|agorot"], ["Dólar jamaicano", "dólar jamaicano|dolar jamaicano|dólares jamaicanos|dolares jamaicanos|j$|ja$|jmd"], ["Yen", "yen|iene|yenes|ienes|jpy"], ["Libra de Jersey", "libra de Jersey|libras de Jersey|jep"], ["Dinar jordaniano", "dinar jordaniano|dinar jordano|dinares jordanianos|dinares jordanos|jd|jod"], ["Piastra jordaniana", "piastra jordaniana|piastra jordano|piastras jordanianas|piastra jordaniano|piastras jordanianos|piastras jordanos"], ["Tengue cazaque", "tenge|tengue|tengué|tengue cazaque|kzt"], ["Tiyin", "tiyin|tiyins"], ["Xelim queniano", "xelim queniano|xelins quenianos|ksh|kes"], ["Som quirguiz", "som quirguiz|som quirguizes|soms quirguizes|kgs"], ["Tyiyn", "tyiyn|tyiyns"], ["Dólar de Kiribati", "dólar de kiribati|dolar de kiribati|dólares de kiribati|dolares de kiribati"], ["Dinar kuwaitiano", "dinar kuwaitiano|dinar cuaitiano|dinares kuwaitiano|dinares cuaitianos|kwd"], ["Quipe laosiano", "quipe|quipes|kipe|kipes|kip|kip laosiano|kip laociano|kips laosianos|kips laocianos|lak"], ["Att laosiano", "at|att|att laosiano|att laosianos"], ["Loti do Lesoto", "loti|lóti|maloti|lotis|lótis|lsl"], ["Sente", "sente|lisente"], ["Libra libanesa", "libra libanesa|libras libanesas|lbp"], ["Dólar liberiano", "dólar liberiano|dolar liberiano|dólares liberianos|dolares liberianos|l$|lrd"], ["Dinar libio", "dinar libio|dinar líbio|dinares libios|dinares líbios|ld|lyd"], ["Dirham libio", "dirham libio|dirhams libios|dirham líbio|dirhams líbios"], ["Litas lituana", "litas lituana|litai lituanas|ltl"], ["Pataca macaense", "pataca macaense|patacas macaenses|mop$|mop"], ["Avo macaense", "avo macaense|avos macaenses"], ["Ho macaense", "ho macaense|ho macaenses"], ["Dinar macedônio", "denar macedonio|denare macedonios|denar macedônio|denar macedónio|denare macedônio|denare macedónio|dinar macedonio|dinar macedônio|dinar macedónio|dinares macedonios|dinares macedônios|dinares macedónios|den|mkd"], ["Deni macedônio", "deni macedonio|deni macedônio|deni macedónio|denis macedonios|denis macedônios|denis macedónios"], ["Ariary malgaxe", "ariai malgaxe|ariary malgaxe|ariary malgaxes|ariaris|mga"], ["Iraimbilanja", "iraimbilanja|iraimbilanjas"], ["Ringuite malaio", "ringgit malaio|ringgit malaios|ringgits malaios|ringuite malaio|ringuites malaios|rm|myr"], ["Sen malaio", "sen malaio|sen malaios|centavo malaio|centavos malaios|cêntimo malaio|cêntimos malaios"], ["Kwacha do Malawi", "kwacha|cuacha|quacha|mk|mwk"], ["Tambala", "tambala|tambalas|tambala malawi"], ["Rupia maldiva", "rupia maldiva|rupias maldivas|rupia das maldivas| rupias das maldivas|mvr"], ["Dirame marroquino", "dirame marroquino|dirham marroquinho|dirhams marroquinos|dirames marroquinos|mad"], ["Rupia maurícia", "rupia maurícia|rupia de Maurício|rupia mauricia|rupia de mauricio|rupias de mauricio|rupias de maurício|rupias mauricias|rupias maurícias|mur"], ["Uguia", "uguia|uguias|oguia|ouguiya|oguias|mro"], ["Kume", "kumes|kume|khoums"], ["Peso mexicano", "peso mexicano|pesos mexicanos|mxn"], ["Centavo mexicano", "centavo mexicano|centavos mexicanos"], ["Leu moldávio", "leu moldavo|lei moldavos|leu moldávio|leu moldavio|lei moldávios|lei moldavios|leus moldavos|leus moldavios|leus moldávios|mdl"], ["Ban moldávio", "ban moldavo|bani moldavos"], ["Tugrik mongol", "tugrik mongol|tugrik|tugriks mongóis|tugriks mongois|tug|mnt"], ["Metical moçambicao", "metical|metical moçambicano|metical mocambicano|meticais|meticais moçambicanos|meticais mocambicanos|mtn|mzn"], ["Dólar namibiano", "dólar namibiano|dólares namibianos|dolar namibio|dolares namibios|n$|nad"], ["Centavo namibiano", "centavo namibiano|centavos namibianos|centavo namibio|centavos namibianos"], ["Rupia nepalesa", "rupia nepalesa|rupias nepalesas|npr"], ["Paisa nepalesa", "paisa nepalesa|paisas nepalesas"], ["Córdova nicaraguense", "córdova nicaraguense|cordova nicaraguense|cordova nicaraguana|córdoba nicaragüense|córdobas nicaragüenses|cordobas nicaraguenses|córdovas nicaraguenses|cordovas nicaraguenses|córdovas nicaraguanasc$|nio"], ["Centavo nicaraguense", "centavo nicaragüense|centavos nicaraguenses|centavo nicaraguano|centavos nicaraguenses|centavo nicaraguano|centavos nicaraguanos"], ["Naira", "naira|ngn"], ["Kobo", "kobo"], ["Coroa norueguesa", "coroa norueguesa|coroas norueguesas|nok"], ["Franco CFP", "franco cfp|francos cfp|xpf"], ["Dólar neozelandês", "dólar neozelandês|dolar neozelandes|dólares neozelandeses|dolares neozelandeses|dólar da nova zelândia|dolar da nova zelandia|dólares da nova zelândia|dolares da nova zelandia|nz$|nzd"], ["Centavo neozelandês", "centavo neozelandês|centavo neozelandes|centavo da nova zelandia|centavo da nova zelândia|centavos da nova zelandia|centavos neozelandeses|centavos da nova zelândia"], ["Rial omanense", "rial omani|riais omanis|rial omanense|riais omanenses|omr"], ["Baisa omanense", "baisa omani|baisas omanis|baisa omanense|baisas omanenses"], ["Florim holandês", "florim holandês|florim holandes|florins holandeses|nlg"], ["Rupia paquistanesa", "rupia paquistanesa|rupias paquistanesas|pkr"], ["Paisa paquistanesa", "paisa paquistanesa|paisas paquistanesasas"], ["Balboa panamenho", "balboa panamenho|balboas panamenhos|balboa|pab|balboa panamense|balboas panamenses"], ["Centavo panamenho", "centavo panamenho|cêntimo panamenho|centavos panamenhos|cêntimos panamenhos|cêntimo panamense|cêntimos panamenses"], ["Kina", "kina|kina papuásia|kinas|kinas papuásias|pkg|pgk"], ["Toea", "toea"], ["Guarani", "guarani|guaranis|gs|pyg"], ["Novo Sol", "novo sol peruano|novos sóis peruanos|sol|soles|sóis|nuevo sol|pen|s#."], ["Centavo de sol", "cêntimo de sol|cêntimos de sol|centavo de sol|centavos de sol"], ["Złoty", "złoty|złotys|zloty|zlotys|zloti|zlotis|zlóti|zlótis|zlote|zł|pln"], ["Groszy", "groszy|grosz"], ["Rial catariano", "rial qatari|riais qataris|rial catarense|riais catarenses|rial catariano|riais catarianos|qr|qar"], ["Dirame catariano", "dirame catariano|dirames catarianos|dirame qatari|dirames qataris|dirame catarense|dirames catarenses|dirham qatari|dirhams qataris|dirham catarense|dirhams catarenses|dirham catariano|dirhams catariano"], ["Libra esterlina", "libra esterlina|libras esterlinas|gbp"], ["Coroa checa", "coroa checa|coroas checas|kc|czk"], ["Peso dominicano", "peso dominicano|pesos dominicanos|rd$|dop"], ["Centavo dominicano", "centavo dominicano|centavos dominicanos"], ["Franco ruandês", "franco ruandês|franco ruandes|francos ruandeses|rf|rwf"], ["Céntimo ruandês", "cêntimo ruandês|centimo ruandes|centavo ruandês|centavo ruandes|cêntimos ruandeses|centimos ruandeses|centavos ruandeses"], ["Leu romeno", "leu romeno|lei romenos|leus romenos|ron"], ["Ban romeno", "ban romeno|bani romeno|bans romenos"], ["Rublo russo", "rublo russo|rublos russos|rub|р."], ["Copeque ruso", "copeque russo|copeques russos|kopek ruso|kopeks rusos|copeque|copeques|kopek|kopeks"], ["Tala samoano", "tala|tālā|talas|tala samonano|talas samoanos|ws$|sat|wst"], ["Sene samoano", "sene"], ["Libra de Santa Helena", "libra de santa helena|libras de santa helena|shp"], ["Pêni de Santa Helena", "peni de santa helena|penies de santa helena"], ["Dobra", "dobra|dobras|db|std"], ["Dinar sérvio", "dinar sérvio|dinar servio|dinar serbio|dinares sérvios|dinares servios|dinares serbios|rsd"], ["Para sérvio", "para sérvio|para servio|para serbio|paras sérvios|paras servios|paras serbios"], ["Rupia seichelense", "rupia de seicheles|rupias de seicheles|rupia seichelense|rupias seichelenses|scr"], ["Centavo seichelense", "centavo de seicheles|centavos de seicheles|centavo seichelense|centavos seichelenses"], ["Leone serra-leonino", "leone|leones|leone serra-leonino|leones serra-leoninos|le|sll"], ["Dólar de Cingapura", "dólar de singapura|dolar de singapura|dórar de cingapura|dolar de cingapura|dólares de singapura|dolares de singapura|dólares de cingapura|dolares de cingapura|sgb"], ["Centavo de Cingapura", "centavo de singapura|centavos de singapura|centavo de cingapura|centavos de cingapura"], ["Libra síria", "libra síria|libra siria|libras sírias|libras sirias|s£|syp"], ["Piastra síria", "piastra siria|piastras sirias|piastra síria|piastras sírias"], ["Xelim somali", "xelim somali|xelins somalis|xelim somaliano|xelins somalianos|sos"], ["Centavo somali", "centavo somapli|centavos somalis|centavo somaliano|centavos somalianos"], ["Xelim da Somalilândia", "xelim da somalilândia|xelins da somalilândia|xelim da somalilandia|xelins da somalilandia"], ["Centavo da Somalilândia", "centavo da somalilândia|centavos da somalilândia|centavo da somalilandia|centavos da somalilandia"], ["Rupia do Sri Lanka", "rupia do sri lanka|rupia do sri lanca|rupias do sri lanka|rupias do sri lanca|rupia cingalesa|rupias cingalesas|lkr"], ["Lilangeni", "lilangeni|lilangenis|emalangeni|szl"], ["Rand sul-africano", "rand|rand sul-africano|rands|rands sul-africanos|zar"], ["Libra sudanesa", "libra sudanesa|libras sudanesas|sdg"], ["Piastra sudanesa", "piastra sudanesa|piastras sudanesas"], ["Libra sul-sudanesa", "libra sul-sudanesa|libras sul-sudanesas|ssp"], ["Piastra sul-sudanesa", "piastra sul-sudanesa|piastras sul-sudanesas"], ["Coroa sueca", "coroa sueca|coroas suecas|sek"], ["Franco suíço", "franco suíço|franco suico|francos suíços|francos suicos|sfr|chf"], ["Rappen suíço", "rappen suíço|rappen suico|rappens suíços|rappens suicos"], ["Dólar surinamês", "dólar surinamês|dolar surinames|dólar do Suriname|dolar do Suriname|dólares surinameses|dolares surinameses|dólares do Suriname|dolares do Suriname|srd"], ["Centavo surinamês", "centavo surinamês|centavo surinames|centavos surinameses"], ["Baht tailandês", "baht tailandês|bath tailandes|baht tailandeses|thb"], ["Satang tailandês", "satang tailandês|satang tailandes|satang tailandeses"], ["Novo dólar taiwanês", "novo dólar taiwanês|novo dolar taiwanes|dólar taiwanês|dolar taiwanes|dólares taiwaneses|dolares taiwaneses|twd"], ["Centavo taiwanês", "centavo taiwanês|centavo taiwanes|centavos taiwaneses"], ["Xelim tanzaniano", "xelim tanzaniano|xelins tanzanianos|tzs"], ["Centavo tanzaniano", "centavo tanzaniano|centavos tanzanianos"], ["Somoni tajique", "somoni tajique|somoni|somonis tajiques|somonis|tjs"], ["Diram tajique", "diram tajique|dirams tajiques|dirames tajiques"], ["Paʻanga", "paanga|paangas|paʻanga|pa'anga|top"], ["Seniti", "seniti"], ["Rublo transdniestriano", "rublo transdniestriano|rublos transdniestriano"], ["Copeque transdniestriano", "copeque transdniestriano|copeques transdniestriano"], ["Dólar de Trinidade e Tobago", "dólar de trinidade e tobago|dólares trinidade e tobago|dolar de trinidade e tobago|dolares trinidade e tobago|dólar de trinidad e tobago|dólares trinidad e tobago|ttd"], ["Centavo de Trinidade e Tobago", "centavo de trinidade e tobago|centavos de trinidade e tobago|centavo de trinidad e tobago|centavos de trinidad e tobago"], ["Dinar tunisiano", "dinar tunisiano|dinares tunisianos|dinar tunisino|dinares tunisinos|tnd"], ["Milim tunisiano", "milim tunisiano|milim tunesianos|millime tunisianos|millimes tunisianos|milim tunisino|milim tunisinos|millime tunisinos|millimes tunisinos"], ["Lira turca", "lira turca|liras turcas|try"], ["Kuruş turco", "kuruş turco|kuruş turcos"], ["Manat turcomeno", "manat turcomeno|manats turcomenos|tmt"], ["Tennesi turcomeno", "tennesi turcomeno|tennesis turcomenos|tenge turcomenos|tenges turcomenos"], ["Dólar tuvaluano", "dólar tuvaluano|dolar tuvaluano|dólares tuvaluanos|dolares tuvaluanos"], ["Centavo tuvaluano", "centavo tuvaluano|centavos tuvaluanos"], ["Grívnia", "grívnia|grivnia|grívnias|grivnias|grivna|grivnas|uah"], ["Copeque ucraniano", "kopiyka|copeque ucraniano|copeques ucranianos"], ["Xelim ugandês", "xelim ugandês|xelim ugandes|xelins ugandeses|ugx"], ["Centavo ugandês", "centavo ugandês|centavo ugandes|centavos ugandeses"], ["Peso uruguaio", "peso uruguaio|pesos uruguayis|uyu"], ["Centésimo uruguayo", "centésimo uruguaio|centesimo uruguaio|centésimos uruguaios|centesimos uruguaios"], ["Som uzbeque", "som uzbeque|som uzbeques|soms uzbeques|somes uzbeques|som usbeque|som usbeques|soms usbeques|somes usbeques|uzs"], ["Tiyin uzbeque", "tiyin uzbeque|tiyin uzbeques|tiyins uzbeques|tiyin usbeque|tiyin usbeques|tiyins usbeques"], ["Vatu", "vatu|vatus|vuv"], ["Bolívar forte venezuelano", "bolívar forte|bolivar forte|bolívar|bolivar|bolívares|bolivares|vef"], ["Centavo de bolívar", "cêntimo de bolívar|cêntimos de bolívar|centavo de bolívar|centavo de bolivar|centavos de bolívar|centavos de bolivar"], ["Dongue vietnamita", "dongue vietnamita|Đồng vietnamita|dong vietnamita|dongues vietnamitas|dongs vietnamitas|vnd"], ["Hào vietnamita", "hào vietnamita|hao vietnamita|hào vietnamitas|hàos vietnamitas|haos vietnamitas"], ["Rial iemenita", "rial iemenita|riais iemenitas|yer"], ["Fils iemenita", "fils iemenita|fils iemenitas"], ["Franco djibutiano", "franco djibutiano|francos djibutianos|franco jibutiano|francos jibutianos|djf"], ["Dinar iugoslavo", "dinar iugoslavo|dinares iugoslavos|dinar jugoslavo|dinares jugoslavos|yud"], ["Kwacha zambiano", "kwacha zambiano|kwacha zambianos|kwachas zambianos|zmw"], ["Ngwee zambiano", "ngwee zambiano|ngwee zambianos|ngwees zambianos"]]); + PortugueseNumericWithUnit.CompoundUnitConnectorRegex = `(?[^.])`; + PortugueseNumericWithUnit.CurrencyPrefixList = new Map([["Dólar", "$"], ["Dólar estadunidense", "us$|u$d|usd"], ["Dólar do Caribe Oriental", "ec$|xcd"], ["Dólar australiano", "a$|aud"], ["Dólar bahamense", "b$|bsd"], ["Dólar de Barbados", "bds$|bbd"], ["Dólar de Belizebe", "bz$|bzd"], ["Dólar bermudense", "bd$|bmd"], ["Dólar de Brunebi", "brunéi $|bnd"], ["Dólar de Cingapura", "s$|sgd"], ["Dólar canadense", "c$|can$|cad"], ["Dólar das Ilhas Cayman", "ci$|kyd"], ["Dólar neozelandês", "nz$|nzd"], ["Dólar fijgiano", "fj$|fjd"], ["Dólar guianense", "gy$|gyd"], ["Dólar de Hong Kong", "hk$|hkd"], ["Dólar jamaicano", "j$|ja$|jmd"], ["Dólar liberiano", "l$|lrd"], ["Dólar namibiano", "n$|nad"], ["Dólar das Ilhas Salomão", "si$|sbd"], ["Novo dólar taiwanês", "nt$|twd"], ["Real brasileiro", "r$|brl"], ["Guarani", "₲|gs.|pyg"], ["Dólar de Trinidade e Tobago", "tt$|ttd"], ["Yuan chinês", "¥|cny|rmb"], ["Yen", "¥|jpy"], ["Euro", "€|eur"], ["Florim", "ƒ"], ["Libra", "£|gbp"], ["Colón costarriquenho", "₡"], ["Lira turca", "₺"]]); + PortugueseNumericWithUnit.AmbiguousCurrencyUnitList = ['le']; + PortugueseNumericWithUnit.InformationSuffixList = new Map([["bit", "bit|bits"], ["kilobit", "kilobit|kilobits|kb|kbit"], ["megabit", "megabit|megabits|Mb|Mbit"], ["gigabit", "gigabit|gigabits|Gb|Gbit"], ["terabit", "terabit|terabits|Tb|Tbit"], ["petabit", "petabit|petabits|Pb|Pbit"], ["kibibit", "kibibit|kibibits|kib|kibit"], ["mebibit", "mebibit|mebibits|Mib|Mibit"], ["gibibit", "gibibit|gibibits|Gib|Gibit"], ["tebibit", "tebibit|tebibits|Tib|Tibit"], ["pebibit", "pebibit|pebibits|Pib|Pibit"], ["byte", "byte|bytes"], ["kilobyte", "kilobyte|kilobytes|kB|kByte"], ["megabyte", "megabyte|megabytes|MB|MByte"], ["gigabyte", "gigabyte|gigabytes|GB|GByte"], ["terabyte", "terabyte|terabytes|TB|TByte"], ["petabyte", "petabyte|petabytes|PB|PByte"], ["kibibyte", "kibibyte|kibibytes|kiB|kiByte"], ["mebibyte", "mebibyte|mebibytes|MiB|MiByte"], ["gibibyte", "gibibyte|gibibytes|GiB|GiByte"], ["tebibyte", "tebibyte|tebibytes|TiB|TiByte"], ["pebibyte", "pebibyte|pebibytes|PiB|PiByte"]]); + PortugueseNumericWithUnit.AmbiguousDimensionUnitList = ['ton', 'tonelada', 'área', 'area', 'áreas', 'areas', 'milha', 'milhas']; + PortugueseNumericWithUnit.BuildPrefix = `(?<=(\\s|^|\\P{L}))`; + PortugueseNumericWithUnit.BuildSuffix = `(?=(\\s|\\P{L}|$))`; + PortugueseNumericWithUnit.ConnectorToken = 'de'; + PortugueseNumericWithUnit.LengthSuffixList = new Map([["Quilômetro", "km|quilometro|quilômetro|quilómetro|quilometros|quilômetros|quilómetros"], ["Hectômetro", "hm|hectometro|hectômetro|hectómetro|hectometros|hectômetros|hectómetros"], ["Decâmetro", "decametro|decâmetro|decámetro|decametros|decâmetro|decámetros|dam"], ["Metro", "m|m.|metro|metros"], ["Decímetro", "dm|decimetro|decímetro|decimetros|decímetros"], ["Centímetro", "cm|centimetro|centímetro|centimetros|centimetros"], ["Milímetro", "mm|milimetro|milímetro|milimetros|milímetros"], ["Micrômetro", "µm|um|micrometro|micrômetro|micrómetro|micrometros|micrômetros|micrómetros|micron|mícron|microns|mícrons|micra"], ["Nanômetro", "nm|nanometro|nanômetro|nanómetro|nanometros|nanômetros|nanómetros|milimicron|milimícron|milimicrons|milimícrons"], ["Picômetro", "pm|picometro|picômetro|picómetro|picometros|picômetros|picómetros"], ["Milha", "mi|milha|milhas"], ["Jarda", "yd|jarda|jardas"], ["Polegada", "polegada|polegadas|\""], ["Pé", "pé|pe|pés|pes|ft"], ["Ano luz", "ano luz|anos luz|al"]]); + PortugueseNumericWithUnit.AmbiguousLengthUnitList = ['mi', 'milha', 'milhas']; + PortugueseNumericWithUnit.SpeedSuffixList = new Map([["Metro por segundo", "metro/segundo|m/s|metro por segundo|metros por segundo|metros por segundos"], ["Quilômetro por hora", "km/h|quilômetro por hora|quilómetro por hora|quilometro por hora|quilômetros por hora|quilómetros por hora|quilometros por hora|quilômetro/hora|quilómetro/hora|quilometro/hora|quilômetros/hora|quilómetros/hora|quilometros/hora"], ["Quilômetro por minuto", "km/min|quilômetro por minuto|quilómetro por minuto|quilometro por minuto|quilômetros por minuto|quilómetros por minuto|quilometros por minuto|quilômetro/minuto|quilómetro/minuto|quilometro/minuto|quilômetros/minuto|quilómetros/minuto|quilometros/minuto"], ["Quilômetro por segundo", "km/seg|quilômetro por segundo|quilómetro por segundo|quilometro por segundo|quilômetros por segundo|quilómetros por segundo|quilometros por segundo|quilômetro/segundo|quilómetro/segundo|quilometro/segundo|quilômetros/segundo|quilómetros/segundo|quilometros/segundo"], ["Milha por hora", "mph|milha por hora|mi/h|milha/hora|milhas/hora|milhas por hora"], ["Nó", "kt|nó|nós|kn"], ["Pé por segundo", "ft/s|pé/s|pe/s|ft/seg|pé/seg|pe/seg|pé por segundo|pe por segundo|pés por segundo|pes por segundo"], ["Pé por minuto", "ft/min|pé/mind|pe/min|pé por minuto|pe por minuto|pés por minuto|pes por minuto"], ["Jarda por minuto", "jardas por minuto|jardas/minuto|jardas/min"], ["Jarda por segundo", "jardas por segundo|jardas/segundo|jardas/seg"]]); + PortugueseNumericWithUnit.AmbiguousSpeedUnitList = ['nó', 'no', 'nós', 'nos']; + PortugueseNumericWithUnit.TemperatureSuffixList = new Map([["Kelvin", "k|kelvin"], ["Grau Rankine", "r|°r|°ra|grau rankine|graus rankine| rankine"], ["Grau Celsius", "°c|grau c|grau celsius|graus c|graus celsius|celsius|grau centígrado|grau centrigrado|graus centígrados|graus centigrados|centígrado|centígrados|centigrado|centigrados"], ["Grau Fahrenheit", "°f|grau f|graus f|grau fahrenheit|graus fahrenheit|fahrenheit"], ["Grau", "°|graus|grau"]]); + PortugueseNumericWithUnit.VolumeSuffixList = new Map([["Quilômetro cúbico", "quilômetro cúbico|quilómetro cúbico|quilometro cubico|quilômetros cúbicos|quilómetros cúbicos|quilometros cubicos|km3|km^3|km³"], ["Hectômetro cúbico", "hectômetro cúbico|hectómetro cúbico|hectometro cubico|hectômetros cúbicos|hectómetros cúbicos|hectometros cubicos|hm3|hm^3|hm³"], ["Decâmetro cúbico", "decâmetro cúbico|decámetro cúbico|decametro cubico|decâmetros cúbicos|decámetros cúbicos|decametros cubicosdam3|dam^3|dam³"], ["Metro cúbico", "metro cúbico|metro cubico|metros cúbicos|metros cubicos|m3|m^3|m³"], ["Decímetro cúbico", "decímetro cúbico|decimetro cubico|decímetros cúbicos|decimetros cubicos|dm3|dm^3|dm³"], ["Centímetro cúbico", "centímetro cúbico|centimetro cubico|centímetros cúbicos|centrimetros cubicos|cc|cm3|cm^3|cm³"], ["Milímetro cúbico", "milímetro cúbico|milimetro cubico|milímetros cúbicos|milimetros cubicos|mm3|mm^3|mm³"], ["Polegada cúbica", "polegada cúbica|polegada cubica|polegadas cúbicas|polegadas cubicas"], ["Pé cúbico", "pé cúbico|pe cubico|pés cúbicos|pes cubicos|pé3|pe3|pé^3|pe^3|pé³|pe³|ft3|ft^3|ft³"], ["Jarda cúbica", "jarda cúbica|jarda cubica|jardas cúbicas|jardas cubicas|yd3|yd^3|yd³"], ["Hectolitro", "hectolitro|hectolitros|hl"], ["Litro", "litro|litros|lts|l"], ["Mililitro", "mililitro|mililitros|ml"], ["Galão", "galão|galões|galao|galoes"], ["Pint", "pinta|pintas|pinto|pintos|quartilho|quartilhos|pint|pints"], ["Barril", "barril|barris|bbl"], ["Onça líquida", "onça líquida|onca liquida|onças líquidas|oncas liquidas"]]); + PortugueseNumericWithUnit.WeightSuffixList = new Map([["Tonelada métrica", "tonelada métrica|tonelada metrica|toneladas métricas|toneladas metricas"], ["Tonelada", "ton|tonelada|toneladas"], ["Quilograma", "kg|quilograma|quilogramas|quilo|quilos|kilo|kilos"], ["Hectograma", "hg|hectograma|hectogramas"], ["Decagrama", "dag|decagrama|decagramas"], ["Grama", "g|gr|grama|gramas"], ["Decigrama", "dg|decigrama|decigramas"], ["Centigrama", "cg|centigrama|centigramas"], ["Miligrama", "mg|miligrama|miligramas"], ["Micrograma", "µg|ug|micrograma|microgramas"], ["Nanograma", "ng|nanograma|nanogramas"], ["Picograma", "pg|picograma|picogramas"], ["Libra", "lb|libra|libras"], ["Onça", "oz|onça|onca|onças|oncas"], ["Grão", "grão|grao|grãos|graos|gr"], ["Quilate", "ct|kt|quilate|quilates"]]); +})(PortugueseNumericWithUnit = exports.PortugueseNumericWithUnit || (exports.PortugueseNumericWithUnit = {})); + +}); + +unwrapExports(portugueseNumericWithUnit); + +var base$4 = createCommonjsModule(function (module, exports) { +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); + + + + + +class PortugueseNumberWithUnitExtractorConfiguration { + constructor(ci) { + this.cultureInfo = ci; + this.unitNumExtractor = new recognizersTextNumber.PortugueseNumberExtractor(); + this.buildPrefix = portugueseNumericWithUnit.PortugueseNumericWithUnit.BuildPrefix; + this.buildSuffix = portugueseNumericWithUnit.PortugueseNumericWithUnit.BuildSuffix; + this.connectorToken = portugueseNumericWithUnit.PortugueseNumericWithUnit.ConnectorToken; + this.compoundUnitConnectorRegex = recognizersText.RegExpUtility.getSafeRegExp(portugueseNumericWithUnit.PortugueseNumericWithUnit.CompoundUnitConnectorRegex); + this.pmNonUnitRegex = recognizersText.RegExpUtility.getSafeRegExp(baseUnits.BaseUnits.PmNonUnitRegex); + } +} +exports.PortugueseNumberWithUnitExtractorConfiguration = PortugueseNumberWithUnitExtractorConfiguration; +class PortugueseNumberWithUnitParserConfiguration extends parsers$8.BaseNumberWithUnitParserConfiguration { + constructor(ci) { + super(ci); + this.internalNumberExtractor = new recognizersTextNumber.PortugueseNumberExtractor(recognizersTextNumber.NumberMode.Default); + this.internalNumberParser = recognizersTextNumber.AgnosticNumberParserFactory.getParser(recognizersTextNumber.AgnosticNumberParserType.Number, new recognizersTextNumber.PortugueseNumberParserConfiguration()); + this.connectorToken = portugueseNumericWithUnit.PortugueseNumericWithUnit.ConnectorToken; + } +} +exports.PortugueseNumberWithUnitParserConfiguration = PortugueseNumberWithUnitParserConfiguration; + +}); + +unwrapExports(base$4); + +var currency$4 = createCommonjsModule(function (module, exports) { +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); + + + + +class PortugueseCurrencyExtractorConfiguration extends base$4.PortugueseNumberWithUnitExtractorConfiguration { + constructor(ci) { + if (!ci) { + ci = new recognizersTextNumber.CultureInfo(recognizersTextNumber.Culture.Portuguese); + } + super(ci); + this.extractType = constants$4.Constants.SYS_UNIT_CURRENCY; + // Reference Source: https:// en.wikipedia.org/wiki/List_of_circulating_currencies + this.suffixList = portugueseNumericWithUnit.PortugueseNumericWithUnit.CurrencySuffixList; + this.prefixList = portugueseNumericWithUnit.PortugueseNumericWithUnit.CurrencyPrefixList; + this.ambiguousUnitList = portugueseNumericWithUnit.PortugueseNumericWithUnit.AmbiguousCurrencyUnitList; + } +} +exports.PortugueseCurrencyExtractorConfiguration = PortugueseCurrencyExtractorConfiguration; +class PortugueseCurrencyParserConfiguration extends base$4.PortugueseNumberWithUnitParserConfiguration { + constructor(ci) { + if (!ci) { + ci = new recognizersTextNumber.CultureInfo(recognizersTextNumber.Culture.Portuguese); + } + super(ci); + this.BindDictionary(portugueseNumericWithUnit.PortugueseNumericWithUnit.CurrencySuffixList); + this.BindDictionary(portugueseNumericWithUnit.PortugueseNumericWithUnit.CurrencyPrefixList); + } +} +exports.PortugueseCurrencyParserConfiguration = PortugueseCurrencyParserConfiguration; + +}); + +unwrapExports(currency$4); + +var temperature$4 = createCommonjsModule(function (module, exports) { +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); + + + + +class PortugueseTemperatureExtractorConfiguration extends base$4.PortugueseNumberWithUnitExtractorConfiguration { + constructor(ci) { + if (!ci) { + ci = new recognizersTextNumber.CultureInfo(recognizersTextNumber.Culture.Portuguese); + } + super(ci); + this.extractType = constants$4.Constants.SYS_UNIT_TEMPERATURE; + this.suffixList = portugueseNumericWithUnit.PortugueseNumericWithUnit.TemperatureSuffixList; + this.prefixList = new Map(); + this.ambiguousUnitList = new Array(); + } +} +exports.PortugueseTemperatureExtractorConfiguration = PortugueseTemperatureExtractorConfiguration; +class PortugueseTemperatureParserConfiguration extends base$4.PortugueseNumberWithUnitParserConfiguration { + constructor(ci) { + if (!ci) { + ci = new recognizersTextNumber.CultureInfo(recognizersTextNumber.Culture.Portuguese); + } + super(ci); + this.BindDictionary(portugueseNumericWithUnit.PortugueseNumericWithUnit.TemperatureSuffixList); + } +} +exports.PortugueseTemperatureParserConfiguration = PortugueseTemperatureParserConfiguration; + +}); + +unwrapExports(temperature$4); + +var dimension$4 = createCommonjsModule(function (module, exports) { +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); + + + + +const dimensionSuffixList = new Map([ + ...portugueseNumericWithUnit.PortugueseNumericWithUnit.InformationSuffixList, + ...portugueseNumericWithUnit.PortugueseNumericWithUnit.AreaSuffixList, + ...portugueseNumericWithUnit.PortugueseNumericWithUnit.LengthSuffixList, + ...portugueseNumericWithUnit.PortugueseNumericWithUnit.SpeedSuffixList, + ...portugueseNumericWithUnit.PortugueseNumericWithUnit.VolumeSuffixList, + ...portugueseNumericWithUnit.PortugueseNumericWithUnit.WeightSuffixList +]); +class PortugueseDimensionExtractorConfiguration extends base$4.PortugueseNumberWithUnitExtractorConfiguration { + constructor(ci) { + if (!ci) { + ci = new recognizersTextNumber.CultureInfo(recognizersTextNumber.Culture.Portuguese); + } + super(ci); + this.extractType = constants$4.Constants.SYS_UNIT_DIMENSION; + this.suffixList = dimensionSuffixList; + this.prefixList = new Map(); + this.ambiguousUnitList = portugueseNumericWithUnit.PortugueseNumericWithUnit.AmbiguousDimensionUnitList; + } +} +exports.PortugueseDimensionExtractorConfiguration = PortugueseDimensionExtractorConfiguration; +class PortugueseDimensionParserConfiguration extends base$4.PortugueseNumberWithUnitParserConfiguration { + constructor(ci) { + if (!ci) { + ci = new recognizersTextNumber.CultureInfo(recognizersTextNumber.Culture.Portuguese); + } + super(ci); + this.BindDictionary(dimensionSuffixList); + } +} +exports.PortugueseDimensionParserConfiguration = PortugueseDimensionParserConfiguration; + +}); + +unwrapExports(dimension$4); + +var age$4 = createCommonjsModule(function (module, exports) { +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); + + + + +class PortugueseAgeExtractorConfiguration extends base$4.PortugueseNumberWithUnitExtractorConfiguration { + constructor(ci) { + if (!ci) { + ci = new recognizersTextNumber.CultureInfo(recognizersTextNumber.Culture.Portuguese); + } + super(ci); + this.extractType = constants$4.Constants.SYS_UNIT_AGE; + this.suffixList = portugueseNumericWithUnit.PortugueseNumericWithUnit.AgeSuffixList; + this.prefixList = new Map(); + this.ambiguousUnitList = new Array(); + } +} +exports.PortugueseAgeExtractorConfiguration = PortugueseAgeExtractorConfiguration; +class PortugueseAgeParserConfiguration extends base$4.PortugueseNumberWithUnitParserConfiguration { + constructor(ci) { + if (!ci) { + ci = new recognizersTextNumber.CultureInfo(recognizersTextNumber.Culture.Portuguese); + } + super(ci); + this.BindDictionary(portugueseNumericWithUnit.PortugueseNumericWithUnit.AgeSuffixList); + } +} +exports.PortugueseAgeParserConfiguration = PortugueseAgeParserConfiguration; + +}); + +unwrapExports(age$4); + +var chineseNumericWithUnit = createCommonjsModule(function (module, exports) { +"use strict"; +// ------------------------------------------------------------------------------ +// +// This code was generated by a tool. +// Changes to this file may cause incorrect behavior and will be lost if +// the code is regenerated. +// +// ------------------------------------------------------------------------------ +Object.defineProperty(exports, "__esModule", { value: true }); +var ChineseNumericWithUnit; +(function (ChineseNumericWithUnit) { + ChineseNumericWithUnit.AgeAmbiguousValues = ['岁']; + ChineseNumericWithUnit.AgeSuffixList = new Map([["Year", "岁|周岁"], ["Month", "个月大|月大"], ["Week", "周大"], ["Day", "天大"]]); + ChineseNumericWithUnit.BuildPrefix = ''; + ChineseNumericWithUnit.BuildSuffix = ''; + ChineseNumericWithUnit.ConnectorToken = ''; + ChineseNumericWithUnit.CurrencySuffixList = new Map([["Afghan afghani", "阿富汗尼"], ["Pul", "普尔"], ["Euro", "欧元"], ["Cent", "美分"], ["Albanian lek", "阿尔巴尼亚列克|列克"], ["Angolan kwanza", "安哥拉宽扎|宽扎"], ["Armenian dram", "亚美尼亚德拉姆"], ["Aruban florin", "阿鲁巴弗罗林|阿鲁巴币"], ["Bangladeshi taka", "塔卡|孟加拉塔卡"], ["Paisa", "派萨|帕萨"], ["Bhutanese ngultrum", "不丹努尔特鲁姆|不丹努扎姆|努扎姆"], ["Chetrum", "切特鲁姆"], ["Bolivian boliviano", "玻利维亚诺|玻利维亚币"], ["Bosnia and Herzegovina convertible mark", "波斯尼亚和黑塞哥维那可兑换马克|波赫可兑换马克"], ["Botswana pula", "博茨瓦纳普拉|普拉"], ["Thebe", "thebe"], ["Brazilian real", "巴西雷亚尔"], ["Bulgarian lev", "保加利亚列弗|保加利亚列瓦"], ["Stotinka", "斯托丁卡"], ["Cambodian riel", "瑞尔"], ["Cape Verdean escudo", "佛得角埃斯库多|维德角埃斯库多"], ["Croatian kuna", "克罗地亚库纳|克罗地亚库那|克罗埃西亚库纳"], ["Lipa", "利巴"], ["Eritrean nakfa", "厄立特里亚纳克法"], ["Ethiopian birr", "埃塞俄比亚比尔|埃塞俄比亚元"], ["Gambian dalasi", "冈比亚达拉西|甘比亚达拉西"], ["Butut", "布达|布图"], ["Georgian lari", "格鲁吉亚拉里"], ["Tetri", "特特里|泰特里"], ["Ghanaian cedi", "塞地|加纳塞地"], ["Pesewa", "比塞瓦"], ["Guatemalan quetzal", "瓜地马拉格查尔"], ["Haitian gourde", "海地古德"], ["Honduran lempira", "洪都拉斯伦皮拉"], ["Hungarian forint", "匈牙利福林|匈牙利货币|匈牙利福林币"], ["Iranian rial", "伊朗里亚尔|伊朗莱尔"], ["Yemeni rial", "叶门莱尔|叶门里亚尔"], ["Israeli new shekel", "₪|ils|以色列币|以色列新克尔|谢克尔"], ["Japanese yen", "日元|日本元|日币|日圆"], ["Sen", "日本銭"], ["Kazakhstani tenge", "哈萨克斯坦坚戈"], ["Kenyan shilling", "肯尼亚先令"], ["North Korean won", "朝鲜圆|朝鲜元"], ["South Korean won", "韩元|韩圆"], ["Korean won", "₩"], ["Kyrgyzstani som", "吉尔吉斯斯坦索姆"], ["Lao kip", "基普|老挝基普|老挝币"], ["Att", "att"], ["Lesotho loti", "莱索托洛提|莱索托马洛蒂"], ["South African rand", "南非兰特"], ["Macedonian denar", "马其顿代纳尔|马其顿币|第纳尔|代纳尔"], ["Deni", "第尼"], ["Malagasy ariary", "马达加斯加阿里亚里"], ["Iraimbilanja", "伊莱姆比拉贾"], ["Malawian kwacha", "马拉威克瓦查"], ["Tambala", "坦巴拉"], ["Malaysian ringgit", "马来西亚币|马币|马来西亚林吉特"], ["Mauritanian ouguiya", "毛里塔尼亚乌吉亚"], ["Khoums", "库姆斯"], ["Mozambican metical", "莫桑比克梅蒂卡尔|梅蒂卡尔"], ["Burmese kyat", "缅甸元|缅元"], ["Pya", "缅分"], ["Nigerian naira", "尼日利亚奈拉|尼日利亚币|奈拉"], ["Kobo", "考包"], ["Turkish lira", "土耳其里拉"], ["Kuruş", "库鲁"], ["Omani rial", "阿曼里亚尔|阿曼莱尔"], ["Panamanian balboa", "巴拿马巴波亚"], ["Centesimo", "意大利分|乌拉圭分|巴拿马分"], ["Papua New Guinean kina", "基那"], ["Toea", "托亚|托伊"], ["Peruvian sol", "秘鲁索尔"], ["Polish złoty", "波兰币|波兰兹罗提|兹罗提"], ["Grosz", "格罗希"], ["Qatari riyal", "卡达里亚尔"], ["Saudi riyal", "沙特里亚尔"], ["Riyal", "里亚尔|"], ["Dirham", "迪拉姆"], ["Halala", "哈拉"], ["Samoan tālā", "萨摩亚塔拉"], ["Sierra Leonean leone", "塞拉利昂利昂|利昂"], ["Peseta", "比塞塔|西班牙比塞塔|西班牙币"], ["Swazi lilangeni", "斯威士兰里兰吉尼|兰吉尼"], ["Tajikistani somoni", "塔吉克斯坦索莫尼"], ["Thai baht", "泰铢|泰元"], ["Satang", "萨当"], ["Tongan paʻanga", "汤加潘加|潘加"], ["Ukrainian hryvnia", "乌克兰格里夫纳|格里夫纳"], ["Vanuatu vatu", "瓦努阿图瓦图"], ["Vietnamese dong", "越南盾"], ["Indonesian rupiah", "印度尼西亚盾"], ["Netherlands guilder", "荷兰盾|荷属安的列斯盾|列斯盾"], ["Surinam florin", "苏里南盾"], ["Guilder", "盾"], ["Zambian kwacha", "赞比亚克瓦查"], ["Moroccan dirham", "摩洛哥迪拉姆"], ["United Arab Emirates dirham", "阿联酋迪拉姆"], ["Azerbaijani manat", "阿塞拜疆马纳特"], ["Turkmenistan manat", "土库曼马纳特"], ["Manat", "马纳特"], ["Somali shilling", "索马里先令|索马利先令"], ["Somaliland shilling", "索马里兰先令"], ["Tanzanian shilling", "坦桑尼亚先令"], ["Ugandan shilling", "乌干达先令"], ["Romanian leu", "罗马尼亚列伊"], ["Moldovan leu", "摩尔多瓦列伊"], ["Leu", "列伊"], ["Ban", "巴尼"], ["Nepalese rupee", "尼泊尔卢比"], ["Pakistani rupee", "巴基斯坦卢比"], ["Indian rupee", "印度卢比"], ["Seychellois rupee", "塞舌尔卢比"], ["Mauritian rupee", "毛里求斯卢比"], ["Maldivian rufiyaa", "马尔代夫卢比"], ["Sri Lankan rupee", "斯里兰卡卢比"], ["Rupee", "卢比"], ["Czech koruna", "捷克克朗"], ["Danish krone", "丹麦克朗|丹麦克郎"], ["Norwegian krone", "挪威克朗"], ["Faroese króna", "法罗克朗"], ["Icelandic króna", "冰岛克朗"], ["Swedish krona", "瑞典克朗"], ["Krone", "克朗"], ["Øre", "奥依拉|奥拉|埃利"], ["West African CFA franc", "非共体法郎"], ["Central African CFA franc", "中非法郎|中非金融合作法郎"], ["Comorian franc", "科摩罗法郎"], ["Congolese franc", "刚果法郎"], ["Burundian franc", "布隆迪法郎"], ["Djiboutian franc", "吉布提法郎"], ["CFP franc", "太平洋法郎"], ["Guinean franc", "几内亚法郎"], ["Swiss franc", "瑞士法郎"], ["Rwandan franc", "卢旺达法郎"], ["Belgian franc", "比利时法郎"], ["Rappen", "瑞士分|瑞士生丁"], ["Franc", "法郎"], ["Centime", "生丁|仙士"], ["Russian ruble", "俄国卢布|俄罗斯卢布"], ["Transnistrian ruble", "德涅斯特卢布"], ["Belarusian ruble", "白俄罗斯卢布"], ["Kopek", "戈比"], ["Ruble", "卢布"], ["Algerian dinar", "阿尔及利亚第纳尔"], ["Bahraini dinar", "巴林第纳尔"], ["Iraqi dinar", "伊拉克第纳尔|"], ["Jordanian dinar", "约旦第纳尔"], ["Kuwaiti dinar", "科威特第纳尔|科威特币"], ["Libyan dinar", "利比亚第纳尔"], ["Serbian dinar", "塞尔维亚第纳尔|塞尔维亚币"], ["Tunisian dinar", "突尼斯第纳尔"], ["Dinar", "第纳尔"], ["Fils", "费尔"], ["Para", "帕拉"], ["Millime", "米利姆"], ["Argentine peso", "阿根廷比索"], ["Chilean peso", "智利比索"], ["Colombian peso", "哥伦比亚比索"], ["Cuban peso", "古巴比索"], ["Dominican peso", "多米尼加比索"], ["Mexican peso", "墨西哥比索"], ["Philippine peso", "菲律宾比索"], ["Uruguayan peso", "乌拉圭比索"], ["Peso", "比索"], ["Centavo", "仙|菲辅币"], ["Alderney pound", "奥尔德尼镑"], ["British pound", "英镑"], ["Guernsey pound", "根西镑"], ["Saint Helena pound", "圣赫勒拿镑"], ["Egyptian pound", "埃及镑"], ["Falkland Islands pound", "福克兰镑"], ["Gibraltar pound", "直布罗陀镑"], ["Manx pound", "马恩岛镑"], ["Jersey pound", "泽西岛镑"], ["Lebanese pound", "黎巴嫩镑"], ["South Sudanese pound", "南苏丹镑"], ["Sudanese pound", "苏丹镑"], ["Syrian pound", "叙利亚镑"], ["Pound", "英镑"], ["Pence", "便士"], ["Shilling", "先令"], ["United States dollar", "美元|美金|美圆"], ["East Caribbean dollar", "东加勒比元"], ["Australian dollar", "澳大利亚元|澳元"], ["Bahamian dollar", "巴哈马元"], ["Barbadian dollar", "巴巴多斯元"], ["Belize dollar", "伯利兹元"], ["Bermudian dollar", "百慕大元"], ["Brunei dollar", "文莱元"], ["Singapore dollar", "新加坡元|新元"], ["Canadian dollar", "加元|加拿大元"], ["Cayman Islands dollar", "开曼岛元|"], ["New Zealand dollar", "新西兰元|纽元"], ["Cook Islands dollar", "库克群岛元"], ["Fijian dollar", "斐济元|斐币"], ["Guyanese dollar", "圭亚那元"], ["Hong Kong dollar", "蚊|港元|港圆|港币"], ["Macau Pataca", "澳元|澳门币|澳门元"], ["New Taiwan dollar", "箍|新台币|台币"], ["Jamaican dollar", "牙买加元"], ["Kiribati dollar", "吉里巴斯元"], ["Liberian dollar", "利比里亚元"], ["Namibian dollar", "纳米比亚元"], ["Surinamese dollar", "苏里南元"], ["Trinidad and Tobago dollar", "特立尼达多巴哥元"], ["Tuvaluan dollar", "吐瓦鲁元"], ["Chinese yuan", "人民币|人民币元|块钱|块|元|圆"], ["Fen", "分钱|分"], ["Jiao", "毛钱|毛|角钱|角"], ["Finnish markka", "芬兰马克"], ["Penni", "盆尼"]]); + ChineseNumericWithUnit.CurrencyNameToIsoCodeMap = new Map([["Afghan afghani", "AFN"], ["Euro", "EUR"], ["Albanian lek", "ALL"], ["Angolan kwanza", "AOA"], ["Armenian dram", "AMD"], ["Aruban florin", "AWG"], ["Bangladeshi taka", "BDT"], ["Bhutanese ngultrum", "BTN"], ["Bolivian boliviano", "BOB"], ["Bosnia and Herzegovina convertible mark", "BAM"], ["Botswana pula", "BWP"], ["Brazilian real", "BRL"], ["Bulgarian lev", "BGN"], ["Cambodian riel", "KHR"], ["Cape Verdean escudo", "CVE"], ["Costa Rican colón", "CRC"], ["Croatian kuna", "HRK"], ["Czech koruna", "CZK"], ["Eritrean nakfa", "ERN"], ["Ethiopian birr", "ETB"], ["Gambian dalasi", "GMD"], ["Georgian lari", "GEL"], ["Ghanaian cedi", "GHS"], ["Guatemalan quetzal", "GTQ"], ["Haitian gourde", "HTG"], ["Honduran lempira", "HNL"], ["Hungarian forint", "HUF"], ["Iranian rial", "IRR"], ["Yemeni rial", "YER"], ["Israeli new shekel", "ILS"], ["Japanese yen", "JPY"], ["Kazakhstani tenge", "KZT"], ["Kenyan shilling", "KES"], ["North Korean won", "KPW"], ["South Korean won", "KRW"], ["Kyrgyzstani som", "KGS"], ["Lao kip", "LAK"], ["Lesotho loti", "LSL"], ["South African rand", "ZAR"], ["Macanese pataca", "MOP"], ["Macedonian denar", "MKD"], ["Malagasy ariary", "MGA"], ["Malawian kwacha", "MWK"], ["Malaysian ringgit", "MYR"], ["Mauritanian ouguiya", "MRO"], ["Mongolian tögrög", "MNT"], ["Mozambican metical", "MZN"], ["Burmese kyat", "MMK"], ["Nicaraguan córdoba", "NIO"], ["Nigerian naira", "NGN"], ["Turkish lira", "TRY"], ["Omani rial", "OMR"], ["Panamanian balboa", "PAB"], ["Papua New Guinean kina", "PGK"], ["Paraguayan guaraní", "PYG"], ["Peruvian sol", "PEN"], ["Polish złoty", "PLN"], ["Qatari riyal", "QAR"], ["Saudi riyal", "SAR"], ["Samoan tālā", "WST"], ["São Tomé and Príncipe dobra", "STD"], ["Sierra Leonean leone", "SLL"], ["Swazi lilangeni", "SZL"], ["Tajikistani somoni", "TJS"], ["Thai baht", "THB"], ["Ukrainian hryvnia", "UAH"], ["Vanuatu vatu", "VUV"], ["Venezuelan bolívar", "VEF"], ["Zambian kwacha", "ZMW"], ["Moroccan dirham", "MAD"], ["United Arab Emirates dirham", "AED"], ["Azerbaijani manat", "AZN"], ["Turkmenistan manat", "TMT"], ["Somali shilling", "SOS"], ["Tanzanian shilling", "TZS"], ["Ugandan shilling", "UGX"], ["Romanian leu", "RON"], ["Moldovan leu", "MDL"], ["Nepalese rupee", "NPR"], ["Pakistani rupee", "PKR"], ["Indian rupee", "INR"], ["Seychellois rupee", "SCR"], ["Mauritian rupee", "MUR"], ["Maldivian rufiyaa", "MVR"], ["Sri Lankan rupee", "LKR"], ["Indonesian rupiah", "IDR"], ["Danish krone", "DKK"], ["Norwegian krone", "NOK"], ["Icelandic króna", "ISK"], ["Swedish krona", "SEK"], ["West African CFA franc", "XOF"], ["Central African CFA franc", "XAF"], ["Comorian franc", "KMF"], ["Congolese franc", "CDF"], ["Burundian franc", "BIF"], ["Djiboutian franc", "DJF"], ["CFP franc", "XPF"], ["Guinean franc", "GNF"], ["Swiss franc", "CHF"], ["Rwandan franc", "RWF"], ["Russian ruble", "RUB"], ["Transnistrian ruble", "PRB"], ["Belarusian ruble", "BYN"], ["Algerian dinar", "DZD"], ["Bahraini dinar", "BHD"], ["Iraqi dinar", "IQD"], ["Jordanian dinar", "JOD"], ["Kuwaiti dinar", "KWD"], ["Libyan dinar", "LYD"], ["Serbian dinar", "RSD"], ["Tunisian dinar", "TND"], ["Argentine peso", "ARS"], ["Chilean peso", "CLP"], ["Colombian peso", "COP"], ["Cuban convertible peso", "CUC"], ["Cuban peso", "CUP"], ["Dominican peso", "DOP"], ["Mexican peso", "MXN"], ["Uruguayan peso", "UYU"], ["British pound", "GBP"], ["Saint Helena pound", "SHP"], ["Egyptian pound", "EGP"], ["Falkland Islands pound", "FKP"], ["Gibraltar pound", "GIP"], ["Manx pound", "IMP"], ["Jersey pound", "JEP"], ["Lebanese pound", "LBP"], ["South Sudanese pound", "SSP"], ["Sudanese pound", "SDG"], ["Syrian pound", "SYP"], ["United States dollar", "USD"], ["Australian dollar", "AUD"], ["Bahamian dollar", "BSD"], ["Barbadian dollar", "BBD"], ["Belize dollar", "BZD"], ["Bermudian dollar", "BMD"], ["Brunei dollar", "BND"], ["Singapore dollar", "SGD"], ["Canadian dollar", "CAD"], ["Cayman Islands dollar", "KYD"], ["New Zealand dollar", "NZD"], ["Fijian dollar", "FJD"], ["Guyanese dollar", "GYD"], ["Hong Kong dollar", "HKD"], ["Jamaican dollar", "JMD"], ["Liberian dollar", "LRD"], ["Namibian dollar", "NAD"], ["Solomon Islands dollar", "SBD"], ["Surinamese dollar", "SRD"], ["New Taiwan dollar", "TWD"], ["Trinidad and Tobago dollar", "TTD"], ["Tuvaluan dollar", "TVD"], ["Chinese yuan", "CNY"], ["Rial", "__RI"], ["Shiling", "__S"], ["Som", "__SO"], ["Dirham", "__DR"], ["Dinar", "_DN"], ["Dollar", "__D"], ["Manat", "__MA"], ["Rupee", "__R"], ["Krone", "__K"], ["Krona", "__K"], ["Crown", "__K"], ["Frank", "__F"], ["Mark", "__M"], ["Ruble", "__RB"], ["Peso", "__PE"], ["Pound", "__P"], ["Tristan da Cunha pound", "_TP"], ["South Georgia and the South Sandwich Islands pound", "_SP"], ["Somaliland shilling", "_SS"], ["Pitcairn Islands dollar", "_PND"], ["Palauan dollar", "_PD"], ["Niue dollar", "_NID"], ["Nauruan dollar", "_ND"], ["Micronesian dollar", "_MD"], ["Kiribati dollar", "_KID"], ["Guernsey pound", "_GGP"], ["Faroese króna", "_FOK"], ["Cook Islands dollar", "_CKD"], ["British Virgin Islands dollar", "_BD"], ["Ascension pound", "_AP"], ["Alderney pound", "_ALP"], ["Abkhazian apsar", "_AA"]]); + ChineseNumericWithUnit.FractionalUnitNameToCodeMap = new Map([["Jiao", "JIAO"], ["Kopek", "KOPEK"], ["Pul", "PUL"], ["Cent", "CENT"], ["Qindarkë", "QINDARKE"], ["Penny", "PENNY"], ["Santeem", "SANTEEM"], ["Cêntimo", "CENTIMO"], ["Centavo", "CENTAVO"], ["Luma", "LUMA"], ["Qəpik", "QƏPIK"], ["Fils", "FILS"], ["Poisha", "POISHA"], ["Kapyeyka", "KAPYEYKA"], ["Centime", "CENTIME"], ["Chetrum", "CHETRUM"], ["Paisa", "PAISA"], ["Fening", "FENING"], ["Thebe", "THEBE"], ["Sen", "SEN"], ["Stotinka", "STOTINKA"], ["Fen", "FEN"], ["Céntimo", "CENTIMO"], ["Lipa", "LIPA"], ["Haléř", "HALER"], ["Øre", "ØRE"], ["Piastre", "PIASTRE"], ["Santim", "SANTIM"], ["Oyra", "OYRA"], ["Butut", "BUTUT"], ["Tetri", "TETRI"], ["Pesewa", "PESEWA"], ["Fillér", "FILLER"], ["Eyrir", "EYRIR"], ["Dinar", "DINAR"], ["Agora", "AGORA"], ["Tïın", "TIIN"], ["Chon", "CHON"], ["Jeon", "JEON"], ["Tyiyn", "TYIYN"], ["Att", "ATT"], ["Sente", "SENTE"], ["Dirham", "DIRHAM"], ["Rappen", "RAPPEN"], ["Avo", "AVO"], ["Deni", "DENI"], ["Iraimbilanja", "IRAIMBILANJA"], ["Tambala", "TAMBALA"], ["Laari", "LAARI"], ["Khoums", "KHOUMS"], ["Ban", "BAN"], ["Möngö", "MONGO"], ["Pya", "PYA"], ["Kobo", "KOBO"], ["Kuruş", "KURUS"], ["Baisa", "BAISA"], ["Centésimo", "CENTESIMO"], ["Toea", "TOEA"], ["Sentimo", "SENTIMO"], ["Grosz", "GROSZ"], ["Sene", "SENE"], ["Halala", "HALALA"], ["Para", "PARA"], ["Öre", "ORE"], ["Diram", "DIRAM"], ["Satang", "SATANG"], ["Seniti", "SENITI"], ["Millime", "MILLIME"], ["Tennesi", "TENNESI"], ["Kopiyka", "KOPIYKA"], ["Tiyin", "TIYIN"], ["Hào", "HAO"], ["Ngwee", "NGWEE"]]); + ChineseNumericWithUnit.CompoundUnitConnectorRegex = `(?又|再)`; + ChineseNumericWithUnit.CurrencyPrefixList = new Map([["Dollar", "$"], ["United States dollar", "us$"], ["British Virgin Islands dollar", "bvi$"], ["Brunei dollar", "b$"], ["Sen", "sen"], ["Singapore dollar", "s$"], ["Canadian dollar", "can$|c$|c $"], ["Cayman Islands dollar", "ci$"], ["New Zealand dollar", "nz$|nz $"], ["Guyanese dollar", "gy$|gy $|g$|g $"], ["Hong Kong dollar", "hk$|hkd|hk $"], ["Jamaican dollar", "j$"], ["Namibian dollar", "nad|n$|n $"], ["Solomon Islands dollar", "si$|si $"], ["New Taiwan dollar", "nt$|nt $"], ["Samoan tālā", "ws$"], ["Chinese yuan", "¥"], ["Japanese yen", "¥"], ["Turkish lira", "₺"], ["Euro", "€"], ["Pound", "£"], ["Costa Rican colón", "₡"]]); + ChineseNumericWithUnit.CurrencyAmbiguousValues = ['元', '仙', '分', '圆', '块', '毛', '盾', '箍', '蚊', '角']; + ChineseNumericWithUnit.DimensionSuffixList = new Map([["Meter", "米|公尺|m"], ["Kilometer", "千米|公里|km"], ["Decimeter", "分米|公寸|dm"], ["Centimeter", "釐米|厘米|公分|cm"], ["Micrometer", "毫米|公釐|mm"], ["Microns", "微米"], ["Picometer", "皮米"], ["Nanometer", "纳米"], ["Li", "里|市里"], ["Zhang", "丈"], ["Chi", "市尺|尺"], ["Cun", "市寸|寸"], ["Fen", "市分|分"], ["Hao", "毫"], ["Mile", "英里"], ["Inch", "英寸"], ["Foot", "呎|英尺"], ["Yard", "码"], ["Knot", "海里"], ["Light year", "光年"], ["Meter per second", "米每秒|米/秒|m/s"], ["Kilometer per hour", "公里每小时|千米每小时|公里/小时|千米/小时|km/h"], ["Kilometer per minute", "公里每分钟|千米每分钟|公里/分钟|千米/分钟|km/min"], ["Kilometer per second", "公里每秒|千米每秒|公里/秒|千米/秒|km/s"], ["Mile per hour", "英里每小时|英里/小时"], ["Foot per second", "英尺每小时|英尺/小时"], ["Foot per minute", "英尺每分钟|英尺/分钟"], ["Yard per minute", "码每分|码/分"], ["Yard per second", "码每秒|码/秒"], ["Square centimetre", "平方厘米"], ["Square decimeter", "平方分米"], ["Square meter", "平方米"], ["Square kilometer", "平方公里"], ["Acre", "英亩|公亩"], ["Hectare", "公顷"], ["Mu", "亩|市亩"], ["Liter", "公升|升|l"], ["Milliliter", "毫升|ml"], ["Cubic meter", "立方米"], ["Cubic decimeter", "立方分米"], ["Cubic millimeter", "立方毫米"], ["Cubic feet", "立方英尺"], ["Gallon", "加仑"], ["Pint", "品脱"], ["Dou", "市斗|斗"], ["Dan", "市石|石"], ["Kilogram", "千克|公斤|kg"], ["Jin", "市斤|斤"], ["Milligram", "毫克|mg"], ["Barrel", "桶"], ["Pot", "罐"], ["Gram", "克|g"], ["Ton", "公吨|吨|t"], ["Pound", "磅"], ["Ounce", "盎司"], ["Bit", "比特|位|b"], ["Byte", "字节|byte"], ["Kilobyte", "千字节|kb"], ["Megabyte", "兆字节|mb"], ["Gigabyte", "十亿字节|千兆字节|gb"], ["Terabyte", "万亿字节|兆兆字节|tb"], ["Petabyte", "千兆兆|千万亿字节|pb"]]); + ChineseNumericWithUnit.DimensionAmbiguousValues = ['丈', '位', '克', '分', '升', '寸', '尺', '斗', '斤', '桶', '毫', '石', '码', '磅', '米', '罐', '里', 'm', 'km', 'dm', 'cm', 'mm', 'l', 'ml', 'kg', 'mg', 'g', 't', 'b', 'byte', 'kb', 'mb', 'gb', 'tb', 'pb']; + ChineseNumericWithUnit.TemperatureSuffixList = new Map([["F", "华氏温度|华氏度|°f"], ["K", "k|开尔文温度|开氏度|凯氏度"], ["R", "兰氏温度|°r"], ["C", "摄氏温度|摄氏度|°c"], ["Degree", "度"]]); + ChineseNumericWithUnit.TemperaturePrefixList = new Map([["F", "华氏温度|华氏"], ["K", "开氏温度|开氏"], ["R", "兰氏温度|兰氏"], ["C", "摄氏温度|摄氏"]]); + ChineseNumericWithUnit.TemperatureAmbiguousValues = ['度', 'k']; +})(ChineseNumericWithUnit = exports.ChineseNumericWithUnit || (exports.ChineseNumericWithUnit = {})); + +}); + +unwrapExports(chineseNumericWithUnit); + +var base$6 = createCommonjsModule(function (module, exports) { +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); + + + + + +class ChineseNumberWithUnitExtractorConfiguration { + constructor(ci) { + this.cultureInfo = ci; + this.unitNumExtractor = new recognizersTextNumber.ChineseNumberExtractor(recognizersTextNumber.ChineseNumberExtractorMode.ExtractAll); + this.buildPrefix = chineseNumericWithUnit.ChineseNumericWithUnit.BuildPrefix; + this.buildSuffix = chineseNumericWithUnit.ChineseNumericWithUnit.BuildSuffix; + this.connectorToken = chineseNumericWithUnit.ChineseNumericWithUnit.ConnectorToken; + this.compoundUnitConnectorRegex = recognizersText.RegExpUtility.getSafeRegExp(chineseNumericWithUnit.ChineseNumericWithUnit.CompoundUnitConnectorRegex); + this.pmNonUnitRegex = recognizersText.RegExpUtility.getSafeRegExp(baseUnits.BaseUnits.PmNonUnitRegex); + } +} +exports.ChineseNumberWithUnitExtractorConfiguration = ChineseNumberWithUnitExtractorConfiguration; +class ChineseNumberWithUnitParserConfiguration extends parsers$8.BaseNumberWithUnitParserConfiguration { + constructor(ci) { + super(ci); + this.internalNumberExtractor = new recognizersTextNumber.ChineseNumberExtractor(recognizersTextNumber.ChineseNumberExtractorMode.Default); + this.internalNumberParser = recognizersTextNumber.AgnosticNumberParserFactory.getParser(recognizersTextNumber.AgnosticNumberParserType.Number, new recognizersTextNumber.ChineseNumberParserConfiguration()); + this.connectorToken = ''; + this.currencyNameToIsoCodeMap = chineseNumericWithUnit.ChineseNumericWithUnit.CurrencyNameToIsoCodeMap; + this.currencyFractionCodeList = chineseNumericWithUnit.ChineseNumericWithUnit.FractionalUnitNameToCodeMap; + } +} +exports.ChineseNumberWithUnitParserConfiguration = ChineseNumberWithUnitParserConfiguration; + +}); + +unwrapExports(base$6); + +var currency$6 = createCommonjsModule(function (module, exports) { +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); + + + + +class ChineseCurrencyExtractorConfiguration extends base$6.ChineseNumberWithUnitExtractorConfiguration { + constructor(ci) { + if (!ci) { + ci = new recognizersTextNumber.CultureInfo(recognizersTextNumber.Culture.Chinese); + } + super(ci); + this.extractType = constants$4.Constants.SYS_UNIT_CURRENCY; + // Reference Source: https:// en.wikipedia.org/wiki/List_of_circulating_currencies + this.suffixList = chineseNumericWithUnit.ChineseNumericWithUnit.CurrencySuffixList; + this.prefixList = chineseNumericWithUnit.ChineseNumericWithUnit.CurrencyPrefixList; + this.ambiguousUnitList = chineseNumericWithUnit.ChineseNumericWithUnit.CurrencyAmbiguousValues; + + } +} +exports.ChineseCurrencyExtractorConfiguration = ChineseCurrencyExtractorConfiguration; +class ChineseCurrencyParserConfiguration extends base$6.ChineseNumberWithUnitParserConfiguration { + constructor(ci) { + if (!ci) { + ci = new recognizersTextNumber.CultureInfo(recognizersTextNumber.Culture.Chinese); + } + super(ci); + this.BindDictionary(chineseNumericWithUnit.ChineseNumericWithUnit.CurrencySuffixList); + this.BindDictionary(chineseNumericWithUnit.ChineseNumericWithUnit.CurrencyPrefixList); + } +} +exports.ChineseCurrencyParserConfiguration = ChineseCurrencyParserConfiguration; + +}); + +unwrapExports(currency$6); + +var temperature$6 = createCommonjsModule(function (module, exports) { +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); + + + + +class ChineseTemperatureExtractorConfiguration extends base$6.ChineseNumberWithUnitExtractorConfiguration { + constructor(ci) { + if (!ci) { + ci = new recognizersTextNumber.CultureInfo(recognizersTextNumber.Culture.Chinese); + } + super(ci); + this.extractType = constants$4.Constants.SYS_UNIT_TEMPERATURE; + this.suffixList = chineseNumericWithUnit.ChineseNumericWithUnit.TemperatureSuffixList; + this.prefixList = chineseNumericWithUnit.ChineseNumericWithUnit.TemperaturePrefixList; + this.ambiguousUnitList = chineseNumericWithUnit.ChineseNumericWithUnit.TemperatureAmbiguousValues; + } +} +exports.ChineseTemperatureExtractorConfiguration = ChineseTemperatureExtractorConfiguration; +class ChineseTemperatureParserConfiguration extends base$6.ChineseNumberWithUnitParserConfiguration { + constructor(ci) { + if (!ci) { + ci = new recognizersTextNumber.CultureInfo(recognizersTextNumber.Culture.Chinese); + } + super(ci); + this.BindDictionary(chineseNumericWithUnit.ChineseNumericWithUnit.TemperaturePrefixList); + this.BindDictionary(chineseNumericWithUnit.ChineseNumericWithUnit.TemperatureSuffixList); + } +} +exports.ChineseTemperatureParserConfiguration = ChineseTemperatureParserConfiguration; + +}); + +unwrapExports(temperature$6); + +var dimension$6 = createCommonjsModule(function (module, exports) { +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); + + + + +class ChineseDimensionExtractorConfiguration extends base$6.ChineseNumberWithUnitExtractorConfiguration { + constructor(ci) { + if (!ci) { + ci = new recognizersTextNumber.CultureInfo(recognizersTextNumber.Culture.Chinese); + } + super(ci); + this.extractType = constants$4.Constants.SYS_UNIT_DIMENSION; + this.suffixList = chineseNumericWithUnit.ChineseNumericWithUnit.DimensionSuffixList; + this.prefixList = new Map(); + this.ambiguousUnitList = chineseNumericWithUnit.ChineseNumericWithUnit.DimensionAmbiguousValues; + } +} +exports.ChineseDimensionExtractorConfiguration = ChineseDimensionExtractorConfiguration; +class ChineseDimensionParserConfiguration extends base$6.ChineseNumberWithUnitParserConfiguration { + constructor(ci) { + if (!ci) { + ci = new recognizersTextNumber.CultureInfo(recognizersTextNumber.Culture.Chinese); + } + super(ci); + this.BindDictionary(chineseNumericWithUnit.ChineseNumericWithUnit.DimensionSuffixList); + } +} +exports.ChineseDimensionParserConfiguration = ChineseDimensionParserConfiguration; + +}); + +unwrapExports(dimension$6); + +var age$6 = createCommonjsModule(function (module, exports) { +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); + + + + +class ChineseAgeExtractorConfiguration extends base$6.ChineseNumberWithUnitExtractorConfiguration { + constructor(ci) { + if (!ci) { + ci = new recognizersTextNumber.CultureInfo(recognizersTextNumber.Culture.Chinese); + } + super(ci); + this.extractType = constants$4.Constants.SYS_UNIT_AGE; + this.suffixList = chineseNumericWithUnit.ChineseNumericWithUnit.AgeSuffixList; + this.prefixList = new Map(); + this.ambiguousUnitList = chineseNumericWithUnit.ChineseNumericWithUnit.AgeAmbiguousValues; + } +} +exports.ChineseAgeExtractorConfiguration = ChineseAgeExtractorConfiguration; +class ChineseAgeParserConfiguration extends base$6.ChineseNumberWithUnitParserConfiguration { + constructor(ci) { + if (!ci) { + ci = new recognizersTextNumber.CultureInfo(recognizersTextNumber.Culture.Chinese); + } + super(ci); + this.BindDictionary(chineseNumericWithUnit.ChineseNumericWithUnit.AgeSuffixList); + } +} +exports.ChineseAgeParserConfiguration = ChineseAgeParserConfiguration; + +}); + +unwrapExports(age$6); + +var japaneseNumericWithUnit = createCommonjsModule(function (module, exports) { +"use strict"; +// ------------------------------------------------------------------------------ +// +// This code was generated by a tool. +// Changes to this file may cause incorrect behavior and will be lost if +// the code is regenerated. +// +// ------------------------------------------------------------------------------ +Object.defineProperty(exports, "__esModule", { value: true }); +var JapaneseNumericWithUnit; +(function (JapaneseNumericWithUnit) { + JapaneseNumericWithUnit.AgeAmbiguousValues = ['歳']; + JapaneseNumericWithUnit.AgeSuffixList = new Map([["Year", "歳"], ["Month", "ヶ月"], ["Week", "週間|週"], ["Day", "日間|日齢|日大"]]); + JapaneseNumericWithUnit.BuildPrefix = ''; + JapaneseNumericWithUnit.BuildSuffix = ''; + JapaneseNumericWithUnit.ConnectorToken = ''; + JapaneseNumericWithUnit.CurrencySuffixList = new Map([["Afghan afghani", "アフガニ"], ["Pul", "プル"], ["Euro", "ユーロ"], ["Cent", "セント"], ["Albanian lek", "アルバニアレク|アルバニア・レク|レク"], ["Angolan kwanza", "アンゴラクワンザ|アンゴラ・クワンザ|クワンザ"], ["Armenian dram", "アルメニアドラム|アルメニア・ドラム|ドラム"], ["Aruban florin", "アルバ・フロリン|フロリン"], ["Bangladeshi taka", "タカ|バングラデシュ・タカ"], ["Paisa", "パイサ"], ["Bhutanese ngultrum", "ニュルタム|ブータン・ニュルタム|ブータンニュルタム"], ["Chetrum", "チェルタム"], ["Bolivian boliviano", "ボリビアーノ"], ["Bosnia and Herzegovina convertible mark", "兌換マルク"], ["Botswana pula", "ボツワナ・プラ|ボツワナプラ|プラ"], ["Thebe", "テベ"], ["Brazilian real", "ブラジル・レアル|ブラジルレアル|レアル"], ["Bulgarian lev", "ブルガリア・レフ|ブルガリアレフ|レフ"], ["Stotinka", "ストティンカ"], ["Cambodian riel", "カンボジア・リエル|カンボジアリエル|リエル"], ["Cape Verdean escudo", "カーボベルデ・エスクード"], ["Croatian kuna", "クロアチアクーナ|クロアチア・クーナ|クーナ"], ["Lipa", "リパ"], ["Eritrean nakfa", "エリトリア・ナクファ|エリトリアナクファ|ナクファ"], ["Ethiopian birr", "エチオピア・ブル|エチオピアブル|ブル"], ["Gambian dalasi", "ガンビア・ダラシ|ガンビアダラシ|ダラシ"], ["Butut", "ブトゥツ"], ["Georgian lari", "ジョージア・ラリ|ジョージアラリ|ラリ"], ["Tetri", "テトリ"], ["Ghanaian cedi", "ガーナ・セディ|ガーナセディ|セディ"], ["Pesewa", "ペセワ"], ["Guatemalan quetzal", "グアテマラ・ケツァル|グアテマラケツァル|ケツァル"], ["Haitian gourde", "ハイチ・グールド|ハイチグールド|グールド"], ["Honduran lempira", "ホンジュラス・レンピラ|ホンジュラスレンピラ|レンピラ"], ["Hungarian forint", "ハンガリー・フォリント|ハンガリーフォリント|フォリント"], ["Iranian rial", "イラン・リアル"], ["Yemeni rial", "イエメン・リアル"], ["Israeli new shekel", "₪|ils|イスラエル・新シェケル|イスラエル新シェケル"], ["Japanese yen", "円"], ["Sen", "銭"], ["Kazakhstani tenge", "テンゲ|カザフスタン・テンゲ|カザフスタンテンゲ"], ["Kenyan shilling", "ケニア・シリング"], ["North Korean won", "北朝鮮ウォン"], ["South Korean won", "韓国ウォン"], ["Korean won", "₩"], ["Kyrgyzstani som", "キルギス・ソム|ソム"], ["Lao kip", "キップ|ラオス・キップ|ラオスキップ"], ["Att", "att"], ["Lesotho loti", "ロチ|レソト・ロチ|レソトロチ"], ["South African rand", "ランド|南アフリカ・ランド|南アフリカランド"], ["Macedonian denar", "マケドニア・デナール"], ["Deni", "デニ"], ["Malagasy ariary", "アリアリ|マダガスカル・アリアリ|マダガスカルアリアリ"], ["Iraimbilanja", "イライムビランジャ"], ["Malawian kwacha", "マラウイ・クワチャ"], ["Tambala", "タンバラ"], ["Malaysian ringgit", "リンギット|マレーシア・リンギット"], ["Mauritanian ouguiya", "ウギア|モーリタニア・ウギア|モーリタニアウギア"], ["Khoums", "コウム"], ["Mozambican metical", "メティカル|モザンビーク・メティカル|モザンビークメティカル"], ["Burmese kyat", "チャット|ミャンマー・チャット|ミャンマーチャット"], ["Pya", "ピャー"], ["Nigerian naira", "ナイラ|ナイジェリア・ナイラ|ナイジェリアナイラ"], ["Kobo", "コボ"], ["Turkish lira", "トルコリラ"], ["Kuruş", "クルシュ"], ["Omani rial", "オマーン・リアル"], ["Panamanian balboa", "バルボア|パナマ・バルボア|パナマバルボア"], ["Centesimo", "センテシモ"], ["Papua New Guinean kina", "キナ|パプア・ニューギニア・キナ"], ["Toea", "トエア"], ["Peruvian sol", "ヌエボ・ソル"], ["Polish złoty", "ズウォティ|ポーランド・ズウォティ|ポーランドズウォティ"], ["Grosz", "グロシュ"], ["Qatari riyal", "カタール・リヤル"], ["Saudi riyal", "サウジアラビア・リヤル"], ["Riyal", "リヤル"], ["Dirham", "ディルハム"], ["Halala", "ハララ"], ["Samoan tālā", "タラ|サモア・タラ|サモアタラ"], ["Sierra Leonean leone", "レオン|シエラレオネ・レオン|シエラレオネレオン"], ["Peseta", "ユーロ"], ["Swazi lilangeni", "リランゲニ|スワジランド・リランゲニ|スワジランドリランゲニ"], ["Tajikistani somoni", "ソモニ|タジキスタン・ソモニ|タジキスタンソモニ"], ["Thai baht", "バーツ|タイ・バーツ|タイバーツ"], ["Satang", "サタン"], ["Tongan paʻanga", "パアンガ|トンガ・パアンガ|トンガパアンガ"], ["Ukrainian hryvnia", "フリヴニャ|ウクライナ・フリヴニャ|ウクライナフリヴニャ"], ["Vanuatu vatu", "バツ|バヌアツ・バツ|バヌアツバツ"], ["Vietnamese dong", "ドン|ベトナム・ドン|ベトナムドン"], ["Indonesian rupiah", "ルピア|インドネシア・ルピア|インドネシアルピア"], ["Netherlands guilder", "ユーロ|オランダ・ユーロ"], ["Surinam florin", "スリナム・ドル"], ["Zambian kwacha", "ザンビア・クワチャ"], ["Moroccan dirham", "モロッコ・ディルハム"], ["United Arab Emirates dirham", "UAEディルハム"], ["Azerbaijani manat", "アゼルバイジャン・マナト"], ["Turkmenistan manat", "トルクメニスタン・マナト"], ["Manat", "マナト"], ["Somali shilling", "ソマリア・シリング"], ["Somaliland shilling", "ソマリランド・シリング"], ["Tanzanian shilling", "タンザニア・シリング"], ["Ugandan shilling", "ウガンダ・シリング"], ["Romanian leu", "ルーマニア・レウ"], ["Moldovan leu", "モルドバ・レウ"], ["Leu", "レウ"], ["Ban", "バン"], ["Nepalese rupee", "ネパール・ルピー"], ["Pakistani rupee", "パキスタン・ルピー"], ["Indian rupee", "インド・ルピー"], ["Seychellois rupee", "セーシェル・ルピー"], ["Mauritian rupee", "モーリシャス・ルピー"], ["Maldivian rufiyaa", "ルフィヤ|モルディブ・ルフィヤ|モルディブルフィヤ"], ["Sri Lankan rupee", "スリランカ・ルピー"], ["Rupee", "ルピー"], ["Czech koruna", "チェコ・コルナ"], ["Danish krone", "デンマーク・クローネ"], ["Norwegian krone", "ノルウェー・クローネ"], ["Faroese króna", "フェロー・クローネ"], ["Icelandic króna", "アイスランド・クローナ"], ["Swedish krona", "スウェーデン・クローナ"], ["Krone", "クローナ"], ["Øre", "オーレ"], ["West African CFA franc", "CFAフラン"], ["Central African CFA franc", "CFAフラン"], ["Comorian franc", "コモロ・フラン"], ["Congolese franc", "コンゴ・フラン"], ["Burundian franc", "ブルンジ・フラン"], ["Djiboutian franc", "ジブチ・フラン"], ["CFP franc", "CFPフラン"], ["Guinean franc", "ギニア・フラン"], ["Swiss franc", "スイス・フラン"], ["Rwandan franc", "ルワンダ・フラン"], ["Belgian franc", "ベルギー・フラン"], ["Rappen", "Rappen"], ["Franc", "フラン"], ["Centime", "サンチーム"], ["Russian ruble", "ロシア・ルーブル"], ["Transnistrian ruble", "沿ドニエストル・ルーブル"], ["Belarusian ruble", "ベラルーシ・ルーブル"], ["Kopek", "カペイカ"], ["Ruble", "ルーブル"], ["Algerian dinar", "アルジェリア・ディナール"], ["Bahraini dinar", "バーレーン・ディナール"], ["Iraqi dinar", "イラク・ディナール"], ["Jordanian dinar", "ヨルダン・ディナール"], ["Kuwaiti dinar", "クウェート・ディナール"], ["Libyan dinar", "リビア・ディナール"], ["Serbian dinar", "セルビア・ディナール"], ["Tunisian dinar", "チュニジア・ディナール"], ["Dinar", "ディナール"], ["Fils", "フィルス"], ["Para", "パラ"], ["Millime", "ミリム"], ["Argentine peso", "ペソ|アルゼンチン・ペソ"], ["Chilean peso", "チリ・ペソ"], ["Colombian peso", "コロンビア・ペソ"], ["Cuban peso", "兌換ペソ"], ["Dominican peso", "ドミニカ・ペソ"], ["Mexican peso", "メキシコ・ペソ"], ["Philippine peso", "フィリピン・ペソ"], ["Uruguayan peso", "ウルグアイ・ペソ"], ["Peso", "ペソ"], ["Centavo", "センターボ"], ["Alderney pound", "ガーンジー・ポンド"], ["British pound", "UKポンド"], ["Guernsey pound", "ガーンジー・ポンド"], ["Saint Helena pound", "セントヘレナ・ポンド"], ["Egyptian pound", "エジプト・ポンド"], ["Falkland Islands pound", "フォークランド諸島ポンド"], ["Gibraltar pound", "ジブラルタル・ポンド"], ["Manx pound", "マン島ポンド"], ["Jersey pound", "ジャージー・ポンド"], ["Lebanese pound", "レバノン・ポンド"], ["South Sudanese pound", "南スーダン・ポンド"], ["Sudanese pound", "スーダン・ポンド"], ["Syrian pound", "シリア・ポンド"], ["Pound", "ポンド"], ["Pence", "ペニー"], ["Shilling", "シリング"], ["United States dollar", "ドル|USドル"], ["East Caribbean dollar", "東カリブ・ドル"], ["Australian dollar", "オーストラリア・ドル"], ["Bahamian dollar", "バハマ・ドル"], ["Barbadian dollar", "バルバドス・ドル"], ["Belize dollar", "ベリーズ・ドル"], ["Bermudian dollar", "バミューダ・ドル"], ["Brunei dollar", "ブルネイ・ドル"], ["Singapore dollar", "シンガポール・ドル"], ["Canadian dollar", "カナダ・ドル"], ["Cayman Islands dollar", "ケイマン諸島・ドル"], ["New Zealand dollar", "ニュージーランド・ドル"], ["Cook Islands dollar", "ニュージーランド・ドル|ニュージーランド・ドル"], ["Fijian dollar", "フィジー・ドル|フィジー・ドル"], ["Guyanese dollar", "ガイアナ・ドル|ガイアナ・ドル"], ["Hong Kong dollar", "香港ドル"], ["Macau Pataca", "マカオ・パタカ|マカオ・パタカ"], ["New Taiwan dollar", "ニュー台湾ドル|ニュー台湾ドル"], ["Jamaican dollar", "ジャマイカ・ドル|ジャマイカドル"], ["Kiribati dollar", "オーストラリア・ドル|オーストラリアドル"], ["Liberian dollar", "リベリア・ドル|リベリアドル"], ["Namibian dollar", "ナミビア・ドル|ナミビアドル"], ["Surinamese dollar", "スリナム・ドル|スリナムドル"], ["Trinidad and Tobago dollar", "トリニダード・トバゴ・ドル|トリニダードトバゴ・ドル"], ["Tuvaluan dollar", "ツバル・ドル|ツバルドル"], ["Chinese yuan", "人民元"], ["Fen", "分"], ["Jiao", "角"], ["Finnish markka", "フィンランド・マルカ"], ["Penni", "ペニー"]]); + JapaneseNumericWithUnit.CurrencyNameToIsoCodeMap = new Map([["Afghan afghani", "AFN"], ["Euro", "EUR"], ["Albanian lek", "ALL"], ["Angolan kwanza", "AOA"], ["Armenian dram", "AMD"], ["Aruban florin", "AWG"], ["Bangladeshi taka", "BDT"], ["Bhutanese ngultrum", "BTN"], ["Bolivian boliviano", "BOB"], ["Bosnia and Herzegovina convertible mark", "BAM"], ["Botswana pula", "BWP"], ["Brazilian real", "BRL"], ["Bulgarian lev", "BGN"], ["Cambodian riel", "KHR"], ["Cape Verdean escudo", "CVE"], ["Costa Rican colón", "CRC"], ["Croatian kuna", "HRK"], ["Czech koruna", "CZK"], ["Eritrean nakfa", "ERN"], ["Ethiopian birr", "ETB"], ["Gambian dalasi", "GMD"], ["Georgian lari", "GEL"], ["Ghanaian cedi", "GHS"], ["Guatemalan quetzal", "GTQ"], ["Haitian gourde", "HTG"], ["Honduran lempira", "HNL"], ["Hungarian forint", "HUF"], ["Iranian rial", "IRR"], ["Yemeni rial", "YER"], ["Israeli new shekel", "ILS"], ["Japanese yen", "JPY"], ["Kazakhstani tenge", "KZT"], ["Kenyan shilling", "KES"], ["North Korean won", "KPW"], ["South Korean won", "KRW"], ["Kyrgyzstani som", "KGS"], ["Lao kip", "LAK"], ["Lesotho loti", "LSL"], ["South African rand", "ZAR"], ["Macanese pataca", "MOP"], ["Macedonian denar", "MKD"], ["Malagasy ariary", "MGA"], ["Malawian kwacha", "MWK"], ["Malaysian ringgit", "MYR"], ["Mauritanian ouguiya", "MRO"], ["Mongolian tögrög", "MNT"], ["Mozambican metical", "MZN"], ["Burmese kyat", "MMK"], ["Nicaraguan córdoba", "NIO"], ["Nigerian naira", "NGN"], ["Turkish lira", "TRY"], ["Omani rial", "OMR"], ["Panamanian balboa", "PAB"], ["Papua New Guinean kina", "PGK"], ["Paraguayan guaraní", "PYG"], ["Peruvian sol", "PEN"], ["Polish złoty", "PLN"], ["Qatari riyal", "QAR"], ["Saudi riyal", "SAR"], ["Samoan tālā", "WST"], ["São Tomé and Príncipe dobra", "STD"], ["Sierra Leonean leone", "SLL"], ["Swazi lilangeni", "SZL"], ["Tajikistani somoni", "TJS"], ["Thai baht", "THB"], ["Ukrainian hryvnia", "UAH"], ["Vanuatu vatu", "VUV"], ["Venezuelan bolívar", "VEF"], ["Zambian kwacha", "ZMW"], ["Moroccan dirham", "MAD"], ["United Arab Emirates dirham", "AED"], ["Azerbaijani manat", "AZN"], ["Turkmenistan manat", "TMT"], ["Somali shilling", "SOS"], ["Tanzanian shilling", "TZS"], ["Ugandan shilling", "UGX"], ["Romanian leu", "RON"], ["Moldovan leu", "MDL"], ["Nepalese rupee", "NPR"], ["Pakistani rupee", "PKR"], ["Indian rupee", "INR"], ["Seychellois rupee", "SCR"], ["Mauritian rupee", "MUR"], ["Maldivian rufiyaa", "MVR"], ["Sri Lankan rupee", "LKR"], ["Indonesian rupiah", "IDR"], ["Danish krone", "DKK"], ["Norwegian krone", "NOK"], ["Icelandic króna", "ISK"], ["Swedish krona", "SEK"], ["West African CFA franc", "XOF"], ["Central African CFA franc", "XAF"], ["Comorian franc", "KMF"], ["Congolese franc", "CDF"], ["Burundian franc", "BIF"], ["Djiboutian franc", "DJF"], ["CFP franc", "XPF"], ["Guinean franc", "GNF"], ["Swiss franc", "CHF"], ["Rwandan franc", "RWF"], ["Russian ruble", "RUB"], ["Transnistrian ruble", "PRB"], ["Belarusian ruble", "BYN"], ["Algerian dinar", "DZD"], ["Bahraini dinar", "BHD"], ["Iraqi dinar", "IQD"], ["Jordanian dinar", "JOD"], ["Kuwaiti dinar", "KWD"], ["Libyan dinar", "LYD"], ["Serbian dinar", "RSD"], ["Tunisian dinar", "TND"], ["Argentine peso", "ARS"], ["Chilean peso", "CLP"], ["Colombian peso", "COP"], ["Cuban convertible peso", "CUC"], ["Cuban peso", "CUP"], ["Dominican peso", "DOP"], ["Mexican peso", "MXN"], ["Uruguayan peso", "UYU"], ["British pound", "GBP"], ["Saint Helena pound", "SHP"], ["Egyptian pound", "EGP"], ["Falkland Islands pound", "FKP"], ["Gibraltar pound", "GIP"], ["Manx pound", "IMP"], ["Jersey pound", "JEP"], ["Lebanese pound", "LBP"], ["South Sudanese pound", "SSP"], ["Sudanese pound", "SDG"], ["Syrian pound", "SYP"], ["United States dollar", "USD"], ["Australian dollar", "AUD"], ["Bahamian dollar", "BSD"], ["Barbadian dollar", "BBD"], ["Belize dollar", "BZD"], ["Bermudian dollar", "BMD"], ["Brunei dollar", "BND"], ["Singapore dollar", "SGD"], ["Canadian dollar", "CAD"], ["Cayman Islands dollar", "KYD"], ["New Zealand dollar", "NZD"], ["Fijian dollar", "FJD"], ["Guyanese dollar", "GYD"], ["Hong Kong dollar", "HKD"], ["Jamaican dollar", "JMD"], ["Liberian dollar", "LRD"], ["Namibian dollar", "NAD"], ["Solomon Islands dollar", "SBD"], ["Surinamese dollar", "SRD"], ["New Taiwan dollar", "TWD"], ["Trinidad and Tobago dollar", "TTD"], ["Tuvaluan dollar", "TVD"], ["Chinese yuan", "CNY"], ["Rial", "__RI"], ["Shiling", "__S"], ["Som", "__SO"], ["Dirham", "__DR"], ["Dinar", "_DN"], ["Dollar", "__D"], ["Manat", "__MA"], ["Rupee", "__R"], ["Krone", "__K"], ["Krona", "__K"], ["Crown", "__K"], ["Frank", "__F"], ["Mark", "__M"], ["Ruble", "__RB"], ["Peso", "__PE"], ["Pound", "__P"], ["Tristan da Cunha pound", "_TP"], ["South Georgia and the South Sandwich Islands pound", "_SP"], ["Somaliland shilling", "_SS"], ["Pitcairn Islands dollar", "_PND"], ["Palauan dollar", "_PD"], ["Niue dollar", "_NID"], ["Nauruan dollar", "_ND"], ["Micronesian dollar", "_MD"], ["Kiribati dollar", "_KID"], ["Guernsey pound", "_GGP"], ["Faroese króna", "_FOK"], ["Cook Islands dollar", "_CKD"], ["British Virgin Islands dollar", "_BD"], ["Ascension pound", "_AP"], ["Alderney pound", "_ALP"], ["Abkhazian apsar", "_AA"]]); + JapaneseNumericWithUnit.FractionalUnitNameToCodeMap = new Map([["Jiao", "JIAO"], ["Kopek", "KOPEK"], ["Pul", "PUL"], ["Cent", "CENT"], ["Qindarkë", "QINDARKE"], ["Penny", "PENNY"], ["Santeem", "SANTEEM"], ["Cêntimo", "CENTIMO"], ["Centavo", "CENTAVO"], ["Luma", "LUMA"], ["Qəpik", "QƏPIK"], ["Fils", "FILS"], ["Poisha", "POISHA"], ["Kapyeyka", "KAPYEYKA"], ["Centime", "CENTIME"], ["Chetrum", "CHETRUM"], ["Paisa", "PAISA"], ["Fening", "FENING"], ["Thebe", "THEBE"], ["Sen", "SEN"], ["Stotinka", "STOTINKA"], ["Fen", "FEN"], ["Céntimo", "CENTIMO"], ["Lipa", "LIPA"], ["Haléř", "HALER"], ["Øre", "ØRE"], ["Piastre", "PIASTRE"], ["Santim", "SANTIM"], ["Oyra", "OYRA"], ["Butut", "BUTUT"], ["Tetri", "TETRI"], ["Pesewa", "PESEWA"], ["Fillér", "FILLER"], ["Eyrir", "EYRIR"], ["Dinar", "DINAR"], ["Agora", "AGORA"], ["Tïın", "TIIN"], ["Chon", "CHON"], ["Jeon", "JEON"], ["Tyiyn", "TYIYN"], ["Att", "ATT"], ["Sente", "SENTE"], ["Dirham", "DIRHAM"], ["Rappen", "RAPPEN"], ["Avo", "AVO"], ["Deni", "DENI"], ["Iraimbilanja", "IRAIMBILANJA"], ["Tambala", "TAMBALA"], ["Laari", "LAARI"], ["Khoums", "KHOUMS"], ["Ban", "BAN"], ["Möngö", "MONGO"], ["Pya", "PYA"], ["Kobo", "KOBO"], ["Kuruş", "KURUS"], ["Baisa", "BAISA"], ["Centésimo", "CENTESIMO"], ["Toea", "TOEA"], ["Sentimo", "SENTIMO"], ["Grosz", "GROSZ"], ["Sene", "SENE"], ["Halala", "HALALA"], ["Para", "PARA"], ["Öre", "ORE"], ["Diram", "DIRAM"], ["Satang", "SATANG"], ["Seniti", "SENITI"], ["Millime", "MILLIME"], ["Tennesi", "TENNESI"], ["Kopiyka", "KOPIYKA"], ["Tiyin", "TIYIN"], ["Hào", "HAO"], ["Ngwee", "NGWEE"]]); + JapaneseNumericWithUnit.CompoundUnitConnectorRegex = `(?と)`; + JapaneseNumericWithUnit.CurrencyPrefixList = new Map([["Dollar", "$"], ["United States dollar", "us$"], ["British Virgin Islands dollar", "bvi$"], ["Brunei dollar", "b$"], ["Sen", "sen"], ["Singapore dollar", "s$"], ["Canadian dollar", "can$|c$|c $"], ["Cayman Islands dollar", "ci$"], ["New Zealand dollar", "nz$|nz $"], ["Guyanese dollar", "gy$|gy $|g$|g $"], ["Hong Kong dollar", "hk$|hkd|hk $"], ["Jamaican dollar", "j$"], ["Namibian dollar", "nad|n$|n $"], ["Solomon Islands dollar", "si$|si $"], ["New Taiwan dollar", "nt$|nt $"], ["Samoan tālā", "ws$"], ["Chinese yuan", "¥"], ["Japanese yen", "¥|\\"], ["Turkish lira", "₺"], ["Euro", "€"], ["Pound", "£"], ["Costa Rican colón", "₡"]]); + JapaneseNumericWithUnit.CurrencyAmbiguousValues = ['円', '銭', '\\']; +})(JapaneseNumericWithUnit = exports.JapaneseNumericWithUnit || (exports.JapaneseNumericWithUnit = {})); + +}); + +unwrapExports(japaneseNumericWithUnit); + +var base$8 = createCommonjsModule(function (module, exports) { +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); + + + + + +class JapaneseNumberWithUnitExtractorConfiguration { + constructor(ci) { + this.cultureInfo = ci; + this.unitNumExtractor = new recognizersTextNumber.JapaneseNumberExtractor(recognizersTextNumber.JapaneseNumberExtractorMode.ExtractAll); + this.buildPrefix = japaneseNumericWithUnit.JapaneseNumericWithUnit.BuildPrefix; + this.buildSuffix = japaneseNumericWithUnit.JapaneseNumericWithUnit.BuildSuffix; + this.connectorToken = japaneseNumericWithUnit.JapaneseNumericWithUnit.ConnectorToken; + this.compoundUnitConnectorRegex = recognizersText.RegExpUtility.getSafeRegExp(japaneseNumericWithUnit.JapaneseNumericWithUnit.CompoundUnitConnectorRegex); + this.pmNonUnitRegex = recognizersText.RegExpUtility.getSafeRegExp(baseUnits.BaseUnits.PmNonUnitRegex); + } +} +exports.JapaneseNumberWithUnitExtractorConfiguration = JapaneseNumberWithUnitExtractorConfiguration; +class JapaneseNumberWithUnitParserConfiguration extends parsers$8.BaseNumberWithUnitParserConfiguration { + constructor(ci) { + super(ci); + this.internalNumberExtractor = new recognizersTextNumber.JapaneseNumberExtractor(recognizersTextNumber.JapaneseNumberExtractorMode.Default); + this.internalNumberParser = recognizersTextNumber.AgnosticNumberParserFactory.getParser(recognizersTextNumber.AgnosticNumberParserType.Number, new recognizersTextNumber.JapaneseNumberParserConfiguration()); + this.connectorToken = ''; + this.currencyNameToIsoCodeMap = japaneseNumericWithUnit.JapaneseNumericWithUnit.CurrencyNameToIsoCodeMap; + this.currencyFractionCodeList = japaneseNumericWithUnit.JapaneseNumericWithUnit.FractionalUnitNameToCodeMap; + } +} +exports.JapaneseNumberWithUnitParserConfiguration = JapaneseNumberWithUnitParserConfiguration; + +}); + +unwrapExports(base$8); + +var currency$8 = createCommonjsModule(function (module, exports) { +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); + + + + +class JapaneseCurrencyExtractorConfiguration extends base$8.JapaneseNumberWithUnitExtractorConfiguration { + constructor(ci) { + if (!ci) { + ci = new recognizersTextNumber.CultureInfo(recognizersTextNumber.Culture.Japanese); + } + super(ci); + this.extractType = constants$4.Constants.SYS_UNIT_CURRENCY; + // Reference Source: https:// en.wikipedia.org/wiki/List_of_circulating_currencies + this.suffixList = japaneseNumericWithUnit.JapaneseNumericWithUnit.CurrencySuffixList; + this.prefixList = japaneseNumericWithUnit.JapaneseNumericWithUnit.CurrencyPrefixList; + this.ambiguousUnitList = japaneseNumericWithUnit.JapaneseNumericWithUnit.CurrencyAmbiguousValues; + + } +} +exports.JapaneseCurrencyExtractorConfiguration = JapaneseCurrencyExtractorConfiguration; +class JapaneseCurrencyParserConfiguration extends base$8.JapaneseNumberWithUnitParserConfiguration { + constructor(ci) { + if (!ci) { + ci = new recognizersTextNumber.CultureInfo(recognizersTextNumber.Culture.Japanese); + } + super(ci); + this.BindDictionary(japaneseNumericWithUnit.JapaneseNumericWithUnit.CurrencySuffixList); + this.BindDictionary(japaneseNumericWithUnit.JapaneseNumericWithUnit.CurrencyPrefixList); + } +} +exports.JapaneseCurrencyParserConfiguration = JapaneseCurrencyParserConfiguration; + +}); + +unwrapExports(currency$8); + +var age$8 = createCommonjsModule(function (module, exports) { +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); + + + + +class JapaneseAgeExtractorConfiguration extends base$8.JapaneseNumberWithUnitExtractorConfiguration { + constructor(ci) { + if (!ci) { + ci = new recognizersTextNumber.CultureInfo(recognizersTextNumber.Culture.Japanese); + } + super(ci); + this.extractType = constants$4.Constants.SYS_UNIT_AGE; + this.suffixList = japaneseNumericWithUnit.JapaneseNumericWithUnit.AgeSuffixList; + this.prefixList = new Map(); + this.ambiguousUnitList = japaneseNumericWithUnit.JapaneseNumericWithUnit.AgeAmbiguousValues; + } +} +exports.JapaneseAgeExtractorConfiguration = JapaneseAgeExtractorConfiguration; +class JapaneseAgeParserConfiguration extends base$8.JapaneseNumberWithUnitParserConfiguration { + constructor(ci) { + if (!ci) { + ci = new recognizersTextNumber.CultureInfo(recognizersTextNumber.Culture.Japanese); + } + super(ci); + this.BindDictionary(japaneseNumericWithUnit.JapaneseNumericWithUnit.AgeSuffixList); + } +} +exports.JapaneseAgeParserConfiguration = JapaneseAgeParserConfiguration; + +}); + +unwrapExports(age$8); + +var frenchNumericWithUnit = createCommonjsModule(function (module, exports) { +"use strict"; +// ------------------------------------------------------------------------------ +// +// This code was generated by a tool. +// Changes to this file may cause incorrect behavior and will be lost if +// the code is regenerated. +// +// ------------------------------------------------------------------------------ +Object.defineProperty(exports, "__esModule", { value: true }); +var FrenchNumericWithUnit; +(function (FrenchNumericWithUnit) { + FrenchNumericWithUnit.AgeSuffixList = new Map([["Ans", "ans"], ["Mois", "mois d'âge|mois d'age|mois"], ["Semaines", "semaine|semaines|semaines d'âge|semaines d'age"], ["Jour", "jours|jour"]]); + FrenchNumericWithUnit.AreaSuffixList = new Map([["Kilomètre carré", "km2|km^2|km²|kilomètres carrés|kilomètre carré"], ["Hectomètre carré", "hm2|hm^2|hm²|hectomètre carré|hectomètres carrés"], ["Décamètre carré", "dam2|dam^2|dam²|décamètre carré|décamètres carrés"], ["Mètre carré", "m2|m^2|m²|mètre carré|mètres carrés"], ["Décimètre carré", "dm2|dm^2|dm²|décimètre carré|décimètres carrés"], ["Centimètre carré", "cm2|cm^2|cm²|centimètre carré|centimètres carrés"], ["Millimètre carré", "mm2|mm^2|mm²|millimètre carré|millimètres carrés"], ["Pouce carré", "pouces2|po2|pouce carré|pouces carrés|in^2|in²|in2"], ["Pied carré", "pied carré|pieds carrés|pi2|pi^2|pi²"], ["Mile carré", "mile carré|miles carrés|mi2|mi^2|mi²"], ["Acre", "acre|acres"]]); + FrenchNumericWithUnit.CurrencySuffixList = new Map([["Abkhazie apsar", "abkhazie apsar|apsars"], ["Afghan afghani", "afghan afghani|؋|afn|afghanis|afghani"], ["Pul", "pul"], ["Euro", "euros|euro|€|eur|d'euros"], ["Cent", "cents|cent|-cents|-cent|sen"], ["lek Albanais", "lek albanais|leks|lek"], ["Qindarkë", "qindarkë|qindarkës|qindarke|qindarkes"], ["Kwanza angolais", "kwanza angolais|kz|aoa|kwanza|kwanzas"], ["Dram arménien", "dram arménien|drams arméniens"], ["Florins d'Aruba", "florins aruba|ƒ|awg"], ["Bangladeshi taka", "bangladeshi taka|৳|bdt|taka|takas|bangladeshi takas"], ["Paisa", "poisha|paisa"], ["Ngultrum bhoutanais", "ngultrum bhoutanais|nu.|btn"], ["Chetrum", "chetrums|chetrum"], ["Boliviano bolivien", "boliviano bolivien|bolivianos bolivien|bolivianos bolivie|boliviano bolivie|bob|bs."], ["Bosnie-Herzégovine mark convertible", "bosnie-herzégovine mark convertible|bosnie-et-herzégovine mark convertible|bam"], ["Fening", "fening|fenings"], ["Pula", "pula|bwp"], ["Thebe", "thebe"], ["Réal brésilien", "réal brésilien|réals brésilien|r$|brl|real bresil|reals bresilien"], ["Lev bulgare", "lev bulgare|levs bulgare|lv|bgn"], ["Stotinki búlgaro", "stotinki bulgare"], ["Riel cambodgien", "riel cambodgien|khr|៛"], ["Escudo du cap-vert", "escudo cap-verdien|cve"], ["Colon du costa rica", "colon du costa rica|colons du costa rica|crc|₡"], ["Colon du salvador", "colon du salvador|colons du salvador|svc"], ["Kuna croate", "kuna croate|kunas croate|kn|hrk"], ["Lipa", "lipa"], ["Couronne tchèque", "couronne tchèque|couronnes tchèque|czk|Kč"], ["Haléř", "haléř"], ["Nakfas érythréens", "nakfas érythréens|nfk|ern|nakfa érythréens"], ["Birr éthiopien", "birr éthiopien|birrs éthiopien|etb"], ["Dalasi gambienne", "gmd"], ["Butut", "bututs|butut"], ["Lari géorgien", "lari géorgie|lari géorgiens|gel|₾"], ["Tetri géorgien", "tetri géorgie|tetris géorgiens"], ["Cedi", "cedi|ghs|cedi ghanéen|gh₵"], ["Pesewa", "pesewa|pesewas"], ["Quetzal guatémaltèque", "quetzal guatémaltèque|gtq|quetzal|quetzales"], ["Gourdes haïtiennes", "gourdes haïtiennes|gourdes|htg|gourde haïtienne"], ["Lempira hondurien", "lempira hondurien|hnl"], ["Forint hongrois", "forint hongrois|huf|fg|forints hongrois"], ["Fillér", "fillér"], ["Rial iranien", "rial iranien|irr|rials iranien|rials iraniens"], ["Litas lituanien", "litas lituanien|ltl|lit lithuanien|litas lithuanie"], ["Yen Japonais", "yen japonais|yen japon|yens|jpy|yen|¥|-yen"], ["Tenge kazakh", "tenge kazakh|kzt"], ["Shilling kényan", "shilling kényan|sh|kes|shillings kényans"], ["Won coréen", "won coréen|won coréens|₩"], ["Won sud-coréen", "won sud-coréen|won sud coréen|won sud-coréens|krw"], ["Corée du nord won", "corée du nord won|corée nord won|kpw"], ["Som Kirghizie", "som kirghizie|kgs"], ["Sum Ouzbékistan", "sum ouzbékistan|sum ouzbeks|sum ouzbéks|uzs"], ["Kip laotien", "kip laotien|lak|₭n|₭"], ["Att", "att"], ["Loti", "loti|maloti|lsl"], ["Sente", "sente|lisente"], ["Rand sud-africain", "rand sud-africain|zar"], ["Pataca macanais", "pataca macanais|mop$|mop"], ["Avo", "avos|avo"], ["Dinar macédonien", "dinar macédonien|mkd|ден"], ["Deni", "deni"], ["Ariary malagache", "ariary malagache|mga"], ["Iraimbilanja", "Iraimbilanja"], ["Kwacha malawien", "kwacha malawien|mk|mwk"], ["Tambala", "Tambala"], ["Ringitt malaisien", "ringitt malaisien|rm|myr|ringitts malaisien"], ["Ouguiya mauritanienne", "ouguiya|um|mro|ouguiya mauritanien|ouguiya mauritanienne"], ["Khoums", "khoums"], ["Togrogs mongoles", "togrogs mongoles|togrogs|tugriks|tögrög|mnt|₮|tögrög mongoles|tögrög mongolie|togrogs mongolie"], ["Metical mozambique", "metical du mozambique|metical mozambique|mt|mzn|meticals mozambique"], ["Kyat birmanie", "kyat birmanie|ks|mmk"], ["Pya", "pya"], ["Cordoba nicaraguayen", "cordoba nicaraguayen|córdoba nicaraguayen|nio|córdoba oro|cordoba oro nicaraguayen"], ["Naira nigérians", "naira nigérians|naira|ngm|₦|nairas nigérians"], ["Livre turque", "livre turque|try|tl|livre turques"], ["Kuruş", "kuruş"], ["Rials omanais", "rials omanais|omr|ر.ع.|rial omanais"], ["Balboa panaméennes", "balboa panaméennes|balboa|pab"], ["Kina", "kina|pkg|pgk"], ["Toea", "toea"], ["Guaraní paraguayen", "guaraní paraguayen|₲|pyg"], ["Sol péruvien", "nuevo sol péruvien|soles|sol|sol péruvien"], ["Złoty polonais", "złoty polonais|złoty|zł|pln|zloty|zloty polonais"], ["Groxz", "groszy|grosz|grosze"], ["Riyal qatari", "riyal qatari|qar|riyals qatari"], ["Riyal saudi", "riyal saudi|sar|riyals saudi"], ["Riyal", "riyal|riyals|rial|﷼"], ["Dirham", "dirham|dirhem|dirhm"], ["Halala", "halalas|halala"], ["Tala", "tala|tālā|ws$|sat|wst"], ["Sene", "sene"], ["Dobra", "dobra|db|std"], ["Leone", "leone|sll"], ["Florins Néerlandais", "florins hollandais|florins néerlandais|florins|ang|ƒ|florin|fl |"], ["Lilangeni", "lilangeni|szl"], ["Somoni tadjikistan", "somoni tadjikistan|tjs|somoni"], ["Diram", "dirams|diram"], ["Baht thaïlandais", "baht thaïlandais|baht thailandais|baht thaï|baht thai|baht|฿|thb"], ["Satang", "satang|satangs"], ["Paʻanga", "paʻanga|pa'anga|top"], ["Hryvnia ukrainien", "hryvnia ukrainien|hyrvnia|uah|₴|hryvnias ukrainien|hryvnia ukrainienne"], ["Vanuatu vatu", "vanuatu vatu|vatu|vuv"], ["Bolívar vénézuélien", "bolívar vénézuélien|bolivar venezuelien|bs.f.|vef|bolívars vénézuélien|bolivars venezuelien"], ["Dong vietnamien", "dong vietnamien|dongs vietnamiens|dong|đồng|vnd|dông|dông vietnamiens"], ["Kwacha de Zambie", "kwacha de zambie|zk|zmw|kwachas"], ["Dirham marocain", "dirham marocain|mad|د.م."], ["Dirham des Émirats arabes unis", "dirham des Émirats arabes unis|د.إ|aed"], ["Manat azerbaïdjanais", "manat azerbaïdjanais|manat azerbaidjanais|azn"], ["Manat turkmène", "manat turkmène|tmt|manat turkmene"], ["Manat", "manats|manat"], ["Qəpik", "qəpik"], ["Shilling somalien", "shilling somalien|shillings somalien|sos"], ["Shilling tanzanien", "shilling tanzanien|shillings tanzanien|tzs|tsh|shilling tanzanienne|shillings tanzanienne"], ["Shilling ougandais", "shilling ougandais|shillings ougandais|sh|ugx"], ["Leu roumain", "leu roumain|lei|leu roumaine|ron"], ["Leu moldave", "leu meoldave|mdl"], ["Leu", "leu"], ["Ban", "bani|-ban|ban"], ["Roupie népalaise", "roupie népalaise|roupie nepalaise|npr"], ["Roupie pakistanaise", "roupie pakistanaise|pkr"], ["Roupie indienne", "roupie indienne|inr|roupie indien|inr|₹"], ["Roupie seychelloise", "roupie seychelloise|scr|sr|sre"], ["Roupie mauricienne", "roupie mauricienne|mur"], ["Rufiyaa maldives", "rufiyaa maldives|mvr|.ރ|rf"], ["Roupie srilankaise", "roupie srilankaise|lrk|රු|ரூ"], ["Rupiah Indonésie", "rupia indonésie|rupia indonesie|rupiah|rp|idr"], ["Roupie", "roupie"], ["Couronne danoise", "couronne danoise|dkk|couronnes danoise|couronne danemark|couronnes danemark"], ["Couronne norvégienne", "couronne norvégienne|couronne norvegienne|couronnes norvégienne|couronnes norvegienne|nok"], ["Couronne féroïenne", "couronne féroïenne|couronne feroienne"], ["Couronne suédoise", "couronne suédoise|couronne suéde|sek|couronnes suédoise|couronne suedoise"], ["Couronne", "couronne|couronnes"], ["Øre", "Øre|oyra|eyrir"], ["Franc CFA de l'Afrique de l'Ouest", "franc cfa de l''afrique de l''ouest|franc cfa ouest africain|franc cfa|francs cfa|fcfa|frs cfa|cfa francs|xof"], ["Franc CFA d'Afrique centrale", "franc cfa d''afrique centrale|franc cfa centrale|frs cfa centrale|xaf"], ["Franc comorien", "franc comorien|kmf"], ["Franc congolais", "franc congolais|cdf"], ["Franc burundais", "franc burundais|bif"], ["Franc djiboutienne", "franc djiboutienne|djf"], ["Franc CFP", "franc cfp|xpf"], ["Franc guinéen", "franc guinéen|gnf"], ["Franc Suisse", "franc suisse|chf|sfr.|francs suisses"], ["Franc rwandais", "franc rwandais|rwf|rw|r₣|frw"], ["Franc belge", "franc belge|bi.|b.fr.|bef"], ["Rappen", "rappen|-rappen"], ["Franc", "francs|franc|fr.|fs"], ["Centimes", "centimes|centime|santim"], ["Rouble russe", "rouble russe|rub|₽|₽ russe|roubles russe|roubles russes|₽ russes"], ["Nouveau rouble biélorusse", "nouveau rouble biélorusse|byn|nouveau roubles biélorusse|nouveau rouble bielorusse|nouveau roubles biélorusse"], ["Rouble transnistriens", "rouble transnistriens|prb"], ["Rouble biélorusses", "rouble biélorusses|roubles biélorusses|rouble bielorusses|roubles bielorusses"], ["Kopek", "kopek|kopeks"], ["Kapyeyka", "kapyeyka"], ["Rouble", "roubles|rouble|br"], ["Dinar algérien", "dinar algérien|د.ج|dzd|dinars algérien|dinar algerien|dinars algerien"], ["Dinar de bahreïn", "dinar de bahreïn|bhd|.د.ب|dinar de bahrein"], ["Santeem", "santeem|santeems"], ["Dinar iraquien", "dinar iraquien|dinars iraquien|iqd|ع.د|dinar iraquienne|dinars iraquienne"], ["Dinar jordanien", "dinar jordanien|dinars jordanien|د.ا|jod"], ["Dinar koweïtien", "dinar koweïtien|dinar koweitien|dinars koweïtien|kwd|د.ك"], ["Dinar libyen", "dinar libyen|dinars libyen|lyd"], ["Dinar serbe", "dinar serbe|dinars serbe|rsd|дин."], ["Dinar tunisien", "dinar tunisien|dinars tunisien|tnd"], ["Dinar yougoslave", "dinar yougoslave|dinars yougoslave|yun"], ["Dinar", "dinars|dinar|denar|-dinars|-dinar"], ["Fils", "fils|fulūs|-fils|-fil"], ["Para", "para|napa"], ["Millime", "millimes|millime"], ["Peso argentin", "peso argentin|ars|pesos argentin|peso argentine|pesos argentine"], ["Peso chilien", "peso chilien|pesos chilien|clp"], ["Peso colombien", "peso colombien|pesos colombien|cop|peso colombie|pesos colombien"], ["Peso cubains convertibles", "peso cubains convertibles|pesos cubains convertibles|cuc"], ["Peso cubains", "peso cubaines|pesos cubaines|peso cubaine|pesos cubaines|cup"], ["Peso dominicain", "peso dominicain|pesos dominicain|dop|peso dominicaine|pesos dominicaine"], ["Peso philippin", "peso philippin|pesos philippin|piso|₱|php"], ["Peso uruguayen", "peso uruguayen|pesos uruguayen|uyu"], ["Peso", "pesos|Peso"], ["Centavo", "centavos|Centavo"], ["Livre britannique", "livre britannique|livres britannique|gbp|£ britannique"], ["Livre guernesey", "livre guernesey|£ guernesey|ggp"], ["Livre ascension", "livre ascension|livres ascension|£ ascension"], ["Livre sainte-hélène", "livre de sainte-hélène|livre sainte-hélène|livre sainte-helene|livre de sainte hélène|shp"], ["Livre égyptienne", "livre égyptienne|livre egyptienne|egp|ج.م"], ["Livre des îles falkland", "livre des îles falkland|livre des iles falkland|fkp|£ iles falkland"], ["Livre gibraltar", "livre gibraltar|livre de gibraltar|£ gibraltar|gip"], ["Livre manx", "imp|livre manx|£ manx"], ["Livre jersey", "livre de jersey|livre jersey|jep|£ jersey"], ["Livre libanaise", "livre libanaise|£ libanaise|livres libanaise|lbp|ل.ل"], ["Livre des îles malouines", "livre des îles malouines|livre des iles malouines|£ iles malouines"], ["Livre sud-soudanaise", "livre sud-soudanaise|livre sud soudanaise|livre du soudan du sud|livres sud-soudanaises|livre sud soudan|livre soudan sud"], ["Livre soudanaise", "livre soudanaise|livres soudanaise|sdg|£ soudan|ج.س.|livre soudan|livres soudan"], ["Livre syrienne", "livre syrienne|ل.س|syp|livre syrie|livres syrie|£ syrie"], ["Livre", "livre|livres|-livre|-livres|£"], ["Pence", "pence"], ["Shilling", "shilling|shillings"], ["Penny", "penny|sou|centime"], ["Dollar Américain", "dollar américain|$ américain|$ americain|usd|$usd|$ usd|dollar americain|dollar États-Unis|dollar des États-Unis|dollar États Unis|dollar etats unis|dollar etats-unis|$ etats-unis|$ États-Unis"], ["Dollar des Caraïbes orientales", "dollar des caraïbes orientales|dollar des caraibes orientales|xcd|$ caraibes orientales|$ caraïbes orientales"], ["Dollar Australien", "dollar australien|dollars australiens|$ australien|aud|$australien|australien $|$ australie|dollar australie"], ["Dollar des bahamas", "dollar des bahamas|dollar bahamas|$ bahamas|bsd|bahama $|dollar bahama|$ bahamas"], ["Dollar bermudes", "dollar des bermudes|dollar bermude|dollar bermudes|$ bermudes|bmd"], ["Dollar belize", "dollar de Belize|dollar belizien|bzd|$ belize"], ["Dollar îles Vierges britanniques", "dollar îles vierges britanniques|dollar iles vierges britanniques|$ iles vierges britanniques"], ["Dollar brunei", "dollar de brunei|$ brunei|bnd|dollar brunei"], ["Sen", "sen"], ["Dollar singapour", "dollar de singapour|dollar singapour|$ sinapour|sgd|$s"], ["Dollar Canadien", "dollar canadien|dollars canadien|$ canadien|cad|$can|$c|$ c|dollar canada|dollar canadienne|$ canada|$cad|cad$"], ["Dollar iles caimanes", "dollars des îles caïmanes|dollar des îles caïmanes|dollars des iles caimanes|dollar iles caimanes|kyd|$ci"], ["Dollar néo-zélandais", "dollar néo-zélandais|dollar néo zélandais|dollar neo-zelandais|dollar neo zelandais|$nz|$ néo-zélandais|$ neo zelandais"], ["Dollar îles cook", "dollar îles cook|dollar iles cook|$ iles cook"], ["Dollar des fidji", "dollar des fidji|$ fidji|dollar fidji|dollar de fidji|dollars des fidji|dollars de fidji"], ["Dollar guyanien", "dollar guyanien|dollar du guyana|dollar dre guyana|$ guayana|gyd|$gy"], ["Dollar de Hong Kong", "dollar hong kong|dollar hongkong|dollar de hong kong|dollar de hongkong|$hk|$ hk|hkd|hk $|hk$|dollar hk|$hongkong|dollars hongkong|dollars hong kong"], ["Dollar jamaïcain", "dollar jamaïcain|dollars jamaïcain|dollar jamaicain|dollars jamaicain|$j|$ jamaïque|dollar jamaïque|jmd"], ["Dollar libérien", "dollar libérien|dollars libérien|dollar liberien|dollars liberien|lrd|$ libérien|$ liberia|$ liberien"], ["Dollar namibien", "dollar namibien|dollars namibien|$ namibien|nad|$n|dollar namibie|dollars namibie|$ namibie"], ["Dollar des îles salomon", "dollar des îles Salomon|dollar des iles salomon|$si|sbd|$ iles salomon|$ îles salomon"], ["Dollar du suriname", "dollar du suriname|srd|$ du suriname|$ suriname|dollar suriname|dollars suriname|dollars du suriname"], ["Nouveau dollar de Taïwan", "nouveau dollar de taïwan|nouveau dollar de taiwan|twd|ntd|$nt"], ["Dollar trinidadien", "dollar trinidadien|dollars trinidadien|ttd|$ trinidadien"], ["Dollar", "dollar|$|dollars"], ["Yuan Chinois", "yuan|yuans|yuan chinois|renminbi|cny|rmb|¥"], ["Fen", "fen"], ["Jiao", "jiao"], ["Mark Finlandais", "marks finlandais|mark finlandais|fim|mark"]]); + FrenchNumericWithUnit.CompoundUnitConnectorRegex = `(?[^.])`; + FrenchNumericWithUnit.CurrencyPrefixList = new Map([["Dollar", "$"], ["Dollar États-Unis", "$us|usd|us$"], ["Dollar Caraïbes orientales", "xcd|$ec"], ["Dollar australien", "a$|$a|aud"], ["Dollar bahamas", "bsd|b$"], ["Dollar barbadien", "bbd|bds$"], ["Dollar de belize", "bz$|bzd"], ["Dollar des bermudes", "bd$|bmd"], ["Dollar de brunei", "brunei $|bnd"], ["Dollar de Singapour", "s$|sgd"], ["Dollar Canadien", "cad|$ ca|$ca|$ c"], ["Dollar des îles Caïmans", "ci$|kyd"], ["Dollar néo-zélandais", "nz$|nzd"], ["Dollar de Fidji", "$fj|fjd"], ["Dolar guyanien", "g$|gyd"], ["Dollar de Hong Kong", "hkd|hk$"], ["Dollar jamaïcain", "j$|jmd"], ["Dollar libérien", "lrd|l$"], ["Dollar namibien", "nad|n$"], ["Dollar des îles Salomon", "$ si|$si|sbd"], ["Nouveau dollar de Taïwan", "nt$|twd"], ["Réal brésilien", "r$|brl|reais"], ["Guaraní paraguayen", "₲|gs.|pyg"], ["Dollar trinidadien", "ttd|titis"], ["Yuan renminbi", "cny|rmb|¥|元"], ["Yen", "¥|jpy"], ["Euro", "€|eur"], ["Pound", "£"], ["Florín", "ƒ"], ["Livre", "£|gbp"]]); + FrenchNumericWithUnit.AmbiguousCurrencyUnitList = ['din.', 'kina', 'lari', 'taka', 'tala', 'vatu', 'yuan', 'bob', 'btn', 'cop', 'cup', 'dop', 'gip', 'jod', 'kgs', 'lak', 'mga', 'mop', 'nad', 'omr', 'sar', 'sbd', 'scr', 'sdg', 'sek', 'sos', 'std', 'try', 'yer']; + FrenchNumericWithUnit.InformationSuffixList = new Map([["Bit", "-bit|bit|bits"], ["Kilobit", "kilobit|kilobits|kb|kbit|kbits"], ["Megabit", "megabit|megabits|Mb|Mbit|mégabit|mégabits"], ["Gigabit", "gigabit|gigabits|Gb|Gbit"], ["Terabit", "terabit|terabits|Tb|Tbit|térabit|térabits"], ["Petabit", "petabit|petabits|Pb|Pbit|pétabit|pétabits"], ["octet", "octet|octets|-octet"], ["Kilooctet", "kilo-octet|kilo-octets|kilooctet|kilooctets|ko|kio|kB|KiB|kilobyte|kilobytes"], ["Mégaoctet", "mégaoctet|mégaoctets|méga-octet|méga-octets|Mo|Mio|MB|mégabyte|mégabytes"], ["Gigaoctet", "gigaoctet|gigaoctets|Go|Gio|GB|GiB|gigabyte|gigabytes"], ["Téraoctet", "téraoctet|téraoctets|To|Tio|TB|TiB|térabyte|térabytes"], ["Pétaoctet", "pétaoctet|pétaoctets|Po|Pio|PB|PiB|pétabyte|pétabytes"]]); + FrenchNumericWithUnit.AmbiguousDimensionUnitList = ['mi', 'barils', 'grain', 'l', 'pierre', 'fps', 'pts']; + FrenchNumericWithUnit.BuildPrefix = `(?<=(\\s|^|\\P{L}))`; + FrenchNumericWithUnit.BuildSuffix = `(?=(\\s|\\P{L}|$))`; + FrenchNumericWithUnit.ConnectorToken = 'de'; + FrenchNumericWithUnit.LengthSuffixList = new Map([["Kilomètres", "km|kilomètres|kilomètre|kilometres|kilometre|-km"], ["Hectomètre", "hm|hectomètre|hectomètres|hectometre|hectometres|-hm"], ["Décamètre", "dam|décamètre|décamètres|decametre|decametres|-dm"], ["Mètres", "m|mètres|mètre|metres|metre|m.|-m"], ["Décimètres", "dm|décimètres|décimètre|decimetres|decimetre"], ["Centimètres", "cm|centimètres|centimètre|centimetres|centimetre"], ["Millimètres", "mm|millimètres|millimètre|millimetre|millimetres"], ["Micromètres", "µm|um|micromètres|micromètre|micrometres|micrometre"], ["Nanomètres", "nm|nanometre|nanometres|nanomètres|nanomètre"], ["Picomètres", "pm|picomètre|picomètres|picometres|picometre"], ["Mile", "mi|mile|miles"], ["Pied", "pied|pieds"], ["Yard", "yards|yard|yd"], ["Pouce", "pouce|pouces"]]); + FrenchNumericWithUnit.AmbiguousLengthUnitList = ['m', 'yard', 'yards', 'pm', 'pt', 'pts']; + FrenchNumericWithUnit.AmbuguousLengthUnitList = ['m', 'pouce', 'pm']; + FrenchNumericWithUnit.SpeedSuffixList = new Map([["Mètre par seconde", "m/s|metres/seconde|metres par seconde|metre par seconde|metres par secondes|mètre par seconde|mètres par seconde|mètres par secondes"], ["Kilomètre par heure", "km/h|kilomètre par heure|kilomètres par heure|kilomètres par heures|kilometres par heure|kilometre par heure"], ["Kilomètre par minute", "km/m|kilomètre par minute|kilomètres par minute|kilomètres par minutes|kilometre par minute|kilometre par minutes"], ["Kilomètre par seconde", "km/s|km à la seconde|km a la seconde|kilomètre par seconde|kilomètres par seconde|kilometre par seconde|kilometres par seconde"], ["Miles par heure", "mph|miles par heure|miles à l'heure|miles a l'heure|miles un heure"], ["Noeuds", "noeud|noeuds|nuds"], ["Pied par seconde", "ft/s|pied par seconde|pieds par seconde|pied/s|pieds/s"], ["Pied par minute", "pieds/minute|pied/minute|ft/minute|ft/min|pied/min"]]); + FrenchNumericWithUnit.TemperatureSuffixList = new Map([["Kelvin", "k|K|kelvin"], ["F", "°f|degres f|degrés f|deg f|° f|degrés fahrenheit|degres fahrenheit|fahrenheit"], ["R", "rankine|°r|° r"], ["C", "°c|deg c|degrés celsius|degrés c|degres celsius|celsius|deg celsius|degs celsius|centigrade|deg centigrade|degs centigrade|degrés centigrade|degres centigrade|degré centigrade|degre centigrade"], ["Degré", "degrés|degres|deg.|°| °|degré|degre|deg"]]); + FrenchNumericWithUnit.VolumeSuffixList = new Map([["Mètre cube", "m3|m^3|m³|mètre cube|mètres cube|metre cube|metres cube"], ["Centimètre cube", "cm3|cm^3|cm³|centimètre cube|centimètres cube|centimetre cube|centimetres cube"], ["Millimètre cube", "mm3|mm^3|mm³|millimètre cube|millimètres cube|millimetre cube|millimetres cube"], ["Kilomètre cube", "km3|km^3|km³|kilomètre cube|kilomètres cube|kilometre cube|kilometres cube"], ["Pieds cube", "pieds cubes|pieds cube|pied cube|pied cubes"], ["Litre", "litre|litres|lts|l"], ["Millilitre", "ml|millilitre|millilitres"], ["Gallon", "gallon|gallons"], ["Pintes", "pintes"], ["Onces", "onces|once|oz"], ["Décilitre", "dl|décilitre|decilitre|décilitres|decilitres"], ["Centilitre", "cl|centilitres|centilitre"], ["Onces liquides", "onces liquides|once liquide|once liquides"], ["Baril", "baril|barils|bbl"]]); + FrenchNumericWithUnit.AmbiguousVolumeUnitList = ['ounce', 'oz', 'l', 'cup', 'peck', 'cord', 'gill']; + FrenchNumericWithUnit.WeightSuffixList = new Map([["Kilogramme", "kg|kilogramme|kilogrammes|kilo|kilos"], ["Gram", "g|gramme|grammes"], ["Milligramme", "mg|milligramme|milligrammes"], ["Tonne métrique", "tonne métrique|tonnes métrique|tonnes métriques|tonne metrique|tonnes metrique"], ["Tonne", "tonne|tonnes|-tonnes|-tonne"], ["Livre", "livre|livres"]]); + FrenchNumericWithUnit.AmbiguousWeightUnitList = ['g', 'oz', 'stone', 'dram']; +})(FrenchNumericWithUnit = exports.FrenchNumericWithUnit || (exports.FrenchNumericWithUnit = {})); + +}); + +unwrapExports(frenchNumericWithUnit); + +var base$10 = createCommonjsModule(function (module, exports) { +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); + + + + + +class FrenchNumberWithUnitExtractorConfiguration { + constructor(ci) { + this.cultureInfo = ci; + this.unitNumExtractor = new recognizersTextNumber.FrenchNumberExtractor(); + this.buildPrefix = frenchNumericWithUnit.FrenchNumericWithUnit.BuildPrefix; + this.buildSuffix = frenchNumericWithUnit.FrenchNumericWithUnit.BuildSuffix; + this.connectorToken = frenchNumericWithUnit.FrenchNumericWithUnit.ConnectorToken; + this.compoundUnitConnectorRegex = recognizersText.RegExpUtility.getSafeRegExp(frenchNumericWithUnit.FrenchNumericWithUnit.CompoundUnitConnectorRegex); + this.pmNonUnitRegex = recognizersText.RegExpUtility.getSafeRegExp(baseUnits.BaseUnits.PmNonUnitRegex); + } +} +exports.FrenchNumberWithUnitExtractorConfiguration = FrenchNumberWithUnitExtractorConfiguration; +class FrenchNumberWithUnitParserConfiguration extends parsers$8.BaseNumberWithUnitParserConfiguration { + constructor(ci) { + super(ci); + this.internalNumberExtractor = new recognizersTextNumber.FrenchNumberExtractor(recognizersTextNumber.NumberMode.Default); + this.internalNumberParser = recognizersTextNumber.AgnosticNumberParserFactory.getParser(recognizersTextNumber.AgnosticNumberParserType.Number, new recognizersTextNumber.FrenchNumberParserConfiguration()); + this.connectorToken = frenchNumericWithUnit.FrenchNumericWithUnit.ConnectorToken; + } +} +exports.FrenchNumberWithUnitParserConfiguration = FrenchNumberWithUnitParserConfiguration; + +}); + +unwrapExports(base$10); + +var currency$10 = createCommonjsModule(function (module, exports) { +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); + + + + +class FrenchCurrencyExtractorConfiguration extends base$10.FrenchNumberWithUnitExtractorConfiguration { + constructor(ci) { + if (!ci) { + ci = new recognizersTextNumber.CultureInfo(recognizersTextNumber.Culture.French); + } + super(ci); + this.extractType = constants$4.Constants.SYS_UNIT_CURRENCY; + // Reference Source: https:// en.wikipedia.org/wiki/List_of_circulating_currencies + this.suffixList = frenchNumericWithUnit.FrenchNumericWithUnit.CurrencySuffixList; + this.prefixList = frenchNumericWithUnit.FrenchNumericWithUnit.CurrencyPrefixList; + this.ambiguousUnitList = frenchNumericWithUnit.FrenchNumericWithUnit.AmbiguousCurrencyUnitList; + } +} +exports.FrenchCurrencyExtractorConfiguration = FrenchCurrencyExtractorConfiguration; +class FrenchCurrencyParserConfiguration extends base$10.FrenchNumberWithUnitParserConfiguration { + constructor(ci) { + if (!ci) { + ci = new recognizersTextNumber.CultureInfo(recognizersTextNumber.Culture.French); + } + super(ci); + this.BindDictionary(frenchNumericWithUnit.FrenchNumericWithUnit.CurrencySuffixList); + this.BindDictionary(frenchNumericWithUnit.FrenchNumericWithUnit.CurrencyPrefixList); + } +} +exports.FrenchCurrencyParserConfiguration = FrenchCurrencyParserConfiguration; + +}); + +unwrapExports(currency$10); + +var temperature$8 = createCommonjsModule(function (module, exports) { +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); + + + + +class FrenchTemperatureExtractorConfiguration extends base$10.FrenchNumberWithUnitExtractorConfiguration { + constructor(ci) { + if (!ci) { + ci = new recognizersTextNumber.CultureInfo(recognizersTextNumber.Culture.French); + } + super(ci); + this.extractType = constants$4.Constants.SYS_UNIT_TEMPERATURE; + this.suffixList = frenchNumericWithUnit.FrenchNumericWithUnit.TemperatureSuffixList; + this.prefixList = new Map(); + this.ambiguousUnitList = new Array(); + } +} +exports.FrenchTemperatureExtractorConfiguration = FrenchTemperatureExtractorConfiguration; +class FrenchTemperatureParserConfiguration extends base$10.FrenchNumberWithUnitParserConfiguration { + constructor(ci) { + if (!ci) { + ci = new recognizersTextNumber.CultureInfo(recognizersTextNumber.Culture.French); + } + super(ci); + this.connectorToken = null; + this.BindDictionary(frenchNumericWithUnit.FrenchNumericWithUnit.TemperatureSuffixList); + } +} +exports.FrenchTemperatureParserConfiguration = FrenchTemperatureParserConfiguration; + +}); + +unwrapExports(temperature$8); + +var dimension$8 = createCommonjsModule(function (module, exports) { +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); + + + + +const dimensionSuffixList = new Map([ + ...frenchNumericWithUnit.FrenchNumericWithUnit.InformationSuffixList, + ...frenchNumericWithUnit.FrenchNumericWithUnit.AreaSuffixList, + ...frenchNumericWithUnit.FrenchNumericWithUnit.LengthSuffixList, + ...frenchNumericWithUnit.FrenchNumericWithUnit.SpeedSuffixList, + ...frenchNumericWithUnit.FrenchNumericWithUnit.VolumeSuffixList, + ...frenchNumericWithUnit.FrenchNumericWithUnit.WeightSuffixList +]); +class FrenchDimensionExtractorConfiguration extends base$10.FrenchNumberWithUnitExtractorConfiguration { + constructor(ci) { + if (!ci) { + ci = new recognizersTextNumber.CultureInfo(recognizersTextNumber.Culture.French); + } + super(ci); + this.extractType = constants$4.Constants.SYS_UNIT_DIMENSION; + this.suffixList = dimensionSuffixList; + this.prefixList = new Map(); + this.ambiguousUnitList = frenchNumericWithUnit.FrenchNumericWithUnit.AmbiguousDimensionUnitList; + } +} +exports.FrenchDimensionExtractorConfiguration = FrenchDimensionExtractorConfiguration; +class FrenchDimensionParserConfiguration extends base$10.FrenchNumberWithUnitParserConfiguration { + constructor(ci) { + if (!ci) { + ci = new recognizersTextNumber.CultureInfo(recognizersTextNumber.Culture.French); + } + super(ci); + this.BindDictionary(dimensionSuffixList); + } +} +exports.FrenchDimensionParserConfiguration = FrenchDimensionParserConfiguration; + +}); + +unwrapExports(dimension$8); + +var age$10 = createCommonjsModule(function (module, exports) { +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); + + + + +class FrenchAgeExtractorConfiguration extends base$10.FrenchNumberWithUnitExtractorConfiguration { + constructor(ci) { + if (!ci) { + ci = new recognizersTextNumber.CultureInfo(recognizersTextNumber.Culture.French); + } + super(ci); + this.extractType = constants$4.Constants.SYS_UNIT_AGE; + this.suffixList = frenchNumericWithUnit.FrenchNumericWithUnit.AgeSuffixList; + this.prefixList = new Map(); + this.ambiguousUnitList = new Array(); + } +} +exports.FrenchAgeExtractorConfiguration = FrenchAgeExtractorConfiguration; +class FrenchAgeParserConfiguration extends base$10.FrenchNumberWithUnitParserConfiguration { + constructor(ci) { + if (!ci) { + ci = new recognizersTextNumber.CultureInfo(recognizersTextNumber.Culture.French); + } + super(ci); + this.BindDictionary(frenchNumericWithUnit.FrenchNumericWithUnit.AgeSuffixList); + } +} +exports.FrenchAgeParserConfiguration = FrenchAgeParserConfiguration; + +}); + +unwrapExports(age$10); + +var numberWithUnitRecognizer = createCommonjsModule(function (module, exports) { +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); + + + + + + + + + + + + + + + + + + + + + + + + + + + +var NumberWithUnitOptions; +(function (NumberWithUnitOptions) { + NumberWithUnitOptions[NumberWithUnitOptions["None"] = 0] = "None"; +})(NumberWithUnitOptions = exports.NumberWithUnitOptions || (exports.NumberWithUnitOptions = {})); +function recognizeCurrency(query, culture, options = NumberWithUnitOptions.None, fallbackToDefaultCulture = true) { + return recognizeByModel(recognizer => recognizer.getCurrencyModel(culture, fallbackToDefaultCulture), query, culture, options); +} +exports.recognizeCurrency = recognizeCurrency; +function recognizeTemperature(query, culture, options = NumberWithUnitOptions.None, fallbackToDefaultCulture = true) { + return recognizeByModel(recognizer => recognizer.getTemperatureModel(culture, fallbackToDefaultCulture), query, culture, options); +} +exports.recognizeTemperature = recognizeTemperature; +function recognizeDimension(query, culture, options = NumberWithUnitOptions.None, fallbackToDefaultCulture = true) { + return recognizeByModel(recognizer => recognizer.getDimensionModel(culture, fallbackToDefaultCulture), query, culture, options); +} +exports.recognizeDimension = recognizeDimension; +function recognizeAge(query, culture, options = NumberWithUnitOptions.None, fallbackToDefaultCulture = true) { + return recognizeByModel(recognizer => recognizer.getAgeModel(culture, fallbackToDefaultCulture), query, culture, options); +} +exports.recognizeAge = recognizeAge; +function recognizeByModel(getModelFunc, query, culture, options) { + let recognizer = new NumberWithUnitRecognizer(culture, options); + let model = getModelFunc(recognizer); + return model.parse(query); +} +class NumberWithUnitRecognizer extends recognizersText.Recognizer { + constructor(culture, options = NumberWithUnitOptions.None, lazyInitialization = false) { + super(culture, options, lazyInitialization); + } + InitializeConfiguration() { + //#region English + this.registerModel("CurrencyModel", recognizersTextNumber.Culture.English, (options) => new models$6.CurrencyModel(new Map([ + [new extractors$16.BaseMergedUnitExtractor(new currency.EnglishCurrencyExtractorConfiguration()), new parsers$8.BaseMergedUnitParser(new currency.EnglishCurrencyParserConfiguration())] + ]))); + this.registerModel("TemperatureModel", recognizersTextNumber.Culture.English, (options) => new models$6.TemperatureModel(new Map([ + [new extractors$16.NumberWithUnitExtractor(new temperature.EnglishTemperatureExtractorConfiguration()), new parsers$8.NumberWithUnitParser(new temperature.EnglishTemperatureParserConfiguration())] + ]))); + this.registerModel("DimensionModel", recognizersTextNumber.Culture.English, (options) => new models$6.DimensionModel(new Map([ + [new extractors$16.NumberWithUnitExtractor(new dimension.EnglishDimensionExtractorConfiguration()), new parsers$8.NumberWithUnitParser(new dimension.EnglishDimensionParserConfiguration())] + ]))); + this.registerModel("AgeModel", recognizersTextNumber.Culture.English, (options) => new models$6.AgeModel(new Map([ + [new extractors$16.NumberWithUnitExtractor(new age.EnglishAgeExtractorConfiguration()), new parsers$8.NumberWithUnitParser(new age.EnglishAgeParserConfiguration())] + ]))); + //#endregion + //#region Spanish + this.registerModel("CurrencyModel", recognizersTextNumber.Culture.Spanish, (options) => new models$6.CurrencyModel(new Map([ + [new extractors$16.NumberWithUnitExtractor(new currency$2.SpanishCurrencyExtractorConfiguration()), new parsers$8.NumberWithUnitParser(new currency$2.SpanishCurrencyParserConfiguration())] + ]))); + this.registerModel("TemperatureModel", recognizersTextNumber.Culture.Spanish, (options) => new models$6.TemperatureModel(new Map([ + [new extractors$16.NumberWithUnitExtractor(new temperature$2.SpanishTemperatureExtractorConfiguration()), new parsers$8.NumberWithUnitParser(new temperature$2.SpanishTemperatureParserConfiguration())] + ]))); + this.registerModel("DimensionModel", recognizersTextNumber.Culture.Spanish, (options) => new models$6.DimensionModel(new Map([ + [new extractors$16.NumberWithUnitExtractor(new dimension$2.SpanishDimensionExtractorConfiguration()), new parsers$8.NumberWithUnitParser(new dimension$2.SpanishDimensionParserConfiguration())] + ]))); + this.registerModel("AgeModel", recognizersTextNumber.Culture.Spanish, (options) => new models$6.AgeModel(new Map([ + [new extractors$16.NumberWithUnitExtractor(new age$2.SpanishAgeExtractorConfiguration()), new parsers$8.NumberWithUnitParser(new age$2.SpanishAgeParserConfiguration())] + ]))); + //#endregion + //#region Portuguese + this.registerModel("CurrencyModel", recognizersTextNumber.Culture.Portuguese, (options) => new models$6.CurrencyModel(new Map([ + [new extractors$16.NumberWithUnitExtractor(new currency$4.PortugueseCurrencyExtractorConfiguration()), new parsers$8.NumberWithUnitParser(new currency$4.PortugueseCurrencyParserConfiguration())] + ]))); + this.registerModel("TemperatureModel", recognizersTextNumber.Culture.Portuguese, (options) => new models$6.TemperatureModel(new Map([ + [new extractors$16.NumberWithUnitExtractor(new temperature$4.PortugueseTemperatureExtractorConfiguration()), new parsers$8.NumberWithUnitParser(new temperature$4.PortugueseTemperatureParserConfiguration())] + ]))); + this.registerModel("DimensionModel", recognizersTextNumber.Culture.Portuguese, (options) => new models$6.DimensionModel(new Map([ + [new extractors$16.NumberWithUnitExtractor(new dimension$4.PortugueseDimensionExtractorConfiguration()), new parsers$8.NumberWithUnitParser(new dimension$4.PortugueseDimensionParserConfiguration())] + ]))); + this.registerModel("AgeModel", recognizersTextNumber.Culture.Portuguese, (options) => new models$6.AgeModel(new Map([ + [new extractors$16.NumberWithUnitExtractor(new age$4.PortugueseAgeExtractorConfiguration()), new parsers$8.NumberWithUnitParser(new age$4.PortugueseAgeParserConfiguration())] + ]))); + //#endregion + //#region Chinese + this.registerModel("CurrencyModel", recognizersTextNumber.Culture.Chinese, (options) => new models$6.CurrencyModel(new Map([ + [new extractors$16.BaseMergedUnitExtractor(new currency$6.ChineseCurrencyExtractorConfiguration()), new parsers$8.BaseMergedUnitParser(new currency$6.ChineseCurrencyParserConfiguration())], + [new extractors$16.NumberWithUnitExtractor(new currency.EnglishCurrencyExtractorConfiguration()), new parsers$8.NumberWithUnitParser(new currency.EnglishCurrencyParserConfiguration())] + ]))); + this.registerModel("TemperatureModel", recognizersTextNumber.Culture.Chinese, (options) => new models$6.TemperatureModel(new Map([ + [new extractors$16.NumberWithUnitExtractor(new temperature$6.ChineseTemperatureExtractorConfiguration()), new parsers$8.NumberWithUnitParser(new temperature$6.ChineseTemperatureParserConfiguration())], + [new extractors$16.NumberWithUnitExtractor(new temperature.EnglishTemperatureExtractorConfiguration()), new parsers$8.NumberWithUnitParser(new temperature.EnglishTemperatureParserConfiguration())] + ]))); + this.registerModel("DimensionModel", recognizersTextNumber.Culture.Chinese, (options) => new models$6.DimensionModel(new Map([ + [new extractors$16.NumberWithUnitExtractor(new dimension$6.ChineseDimensionExtractorConfiguration()), new parsers$8.NumberWithUnitParser(new dimension$6.ChineseDimensionParserConfiguration())], + [new extractors$16.NumberWithUnitExtractor(new dimension.EnglishDimensionExtractorConfiguration()), new parsers$8.NumberWithUnitParser(new dimension.EnglishDimensionParserConfiguration())] + ]))); + this.registerModel("AgeModel", recognizersTextNumber.Culture.Chinese, (options) => new models$6.AgeModel(new Map([ + [new extractors$16.NumberWithUnitExtractor(new age$6.ChineseAgeExtractorConfiguration()), new parsers$8.NumberWithUnitParser(new age$6.ChineseAgeParserConfiguration())], + [new extractors$16.NumberWithUnitExtractor(new age.EnglishAgeExtractorConfiguration()), new parsers$8.NumberWithUnitParser(new age.EnglishAgeParserConfiguration())] + ]))); + //#endregion + //#region Japanese + this.registerModel("CurrencyModel", recognizersTextNumber.Culture.Japanese, (options) => new models$6.CurrencyModel(new Map([ + [new extractors$16.BaseMergedUnitExtractor(new currency$8.JapaneseCurrencyExtractorConfiguration()), new parsers$8.BaseMergedUnitParser(new currency$8.JapaneseCurrencyParserConfiguration())], + [new extractors$16.NumberWithUnitExtractor(new currency.EnglishCurrencyExtractorConfiguration()), new parsers$8.NumberWithUnitParser(new currency.EnglishCurrencyParserConfiguration())] + ]))); + this.registerModel("AgeModel", recognizersTextNumber.Culture.Japanese, (options) => new models$6.AgeModel(new Map([ + [new extractors$16.NumberWithUnitExtractor(new age$8.JapaneseAgeExtractorConfiguration()), new parsers$8.NumberWithUnitParser(new age$8.JapaneseAgeParserConfiguration())], + [new extractors$16.NumberWithUnitExtractor(new age.EnglishAgeExtractorConfiguration()), new parsers$8.NumberWithUnitParser(new age.EnglishAgeParserConfiguration())] + ]))); + //#endregion + //#region French + this.registerModel("CurrencyModel", recognizersTextNumber.Culture.French, (options) => new models$6.CurrencyModel(new Map([ + [new extractors$16.NumberWithUnitExtractor(new currency$10.FrenchCurrencyExtractorConfiguration()), new parsers$8.NumberWithUnitParser(new currency$10.FrenchCurrencyParserConfiguration())] + ]))); + this.registerModel("TemperatureModel", recognizersTextNumber.Culture.French, (options) => new models$6.TemperatureModel(new Map([ + [new extractors$16.NumberWithUnitExtractor(new temperature$8.FrenchTemperatureExtractorConfiguration()), new parsers$8.NumberWithUnitParser(new temperature$8.FrenchTemperatureParserConfiguration())] + ]))); + this.registerModel("DimensionModel", recognizersTextNumber.Culture.French, (options) => new models$6.DimensionModel(new Map([ + [new extractors$16.NumberWithUnitExtractor(new dimension$8.FrenchDimensionExtractorConfiguration()), new parsers$8.NumberWithUnitParser(new dimension$8.FrenchDimensionParserConfiguration())] + ]))); + this.registerModel("AgeModel", recognizersTextNumber.Culture.French, (options) => new models$6.AgeModel(new Map([ + [new extractors$16.NumberWithUnitExtractor(new age$10.FrenchAgeExtractorConfiguration()), new parsers$8.NumberWithUnitParser(new age$10.FrenchAgeParserConfiguration())] + ]))); + //#endregion + } + IsValidOptions(options) { + return options >= 0 && options <= NumberWithUnitOptions.None; + } + getCurrencyModel(culture = null, fallbackToDefaultCulture = true) { + return this.getModel("CurrencyModel", culture, fallbackToDefaultCulture); + } + getTemperatureModel(culture = null, fallbackToDefaultCulture = true) { + return this.getModel("TemperatureModel", culture, fallbackToDefaultCulture); + } + getDimensionModel(culture = null, fallbackToDefaultCulture = true) { + return this.getModel("DimensionModel", culture, fallbackToDefaultCulture); + } + getAgeModel(culture = null, fallbackToDefaultCulture = true) { + return this.getModel("AgeModel", culture, fallbackToDefaultCulture); + } +} +exports.default = NumberWithUnitRecognizer; + +}); + +unwrapExports(numberWithUnitRecognizer); + +var recognizersTextNumberWithUnit = createCommonjsModule(function (module, exports) { +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); + +exports.NumberWithUnitRecognizer = numberWithUnitRecognizer.default; +exports.NumberWithUnitOptions = numberWithUnitRecognizer.NumberWithUnitOptions; +exports.recognizeTemperature = numberWithUnitRecognizer.recognizeTemperature; +exports.recognizeDimension = numberWithUnitRecognizer.recognizeDimension; +exports.recognizeCurrency = numberWithUnitRecognizer.recognizeCurrency; +exports.recognizeAge = numberWithUnitRecognizer.recognizeAge; + +exports.Culture = recognizersTextNumber.Culture; +exports.CultureInfo = recognizersTextNumber.CultureInfo; + +exports.Constants = constants$4.Constants; + +exports.NumberWithUnitExtractor = extractors$16.NumberWithUnitExtractor; +exports.PrefixUnitResult = extractors$16.PrefixUnitResult; +exports.BaseMergedUnitExtractor = extractors$16.BaseMergedUnitExtractor; + +exports.CompositeEntityType = models$6.CompositeEntityType; +exports.AbstractNumberWithUnitModel = models$6.AbstractNumberWithUnitModel; +exports.AgeModel = models$6.AgeModel; +exports.CurrencyModel = models$6.CurrencyModel; +exports.DimensionModel = models$6.DimensionModel; +exports.TemperatureModel = models$6.TemperatureModel; + +exports.UnitValue = parsers$8.UnitValue; +exports.UnitValueIso = parsers$8.UnitValueIso; +exports.NumberWithUnitParser = parsers$8.NumberWithUnitParser; +exports.BaseNumberWithUnitParserConfiguration = parsers$8.BaseNumberWithUnitParserConfiguration; +exports.BaseCurrencyParser = parsers$8.BaseCurrencyParser; +exports.BaseMergedUnitParser = parsers$8.BaseMergedUnitParser; + +exports.EnglishAgeExtractorConfiguration = age.EnglishAgeExtractorConfiguration; +exports.EnglishAgeParserConfiguration = age.EnglishAgeParserConfiguration; + +exports.EnglishNumberWithUnitExtractorConfiguration = base.EnglishNumberWithUnitExtractorConfiguration; +exports.EnglishNumberWithUnitParserConfiguration = base.EnglishNumberWithUnitParserConfiguration; + +exports.EnglishCurrencyExtractorConfiguration = currency.EnglishCurrencyExtractorConfiguration; +exports.EnglishCurrencyParserConfiguration = currency.EnglishCurrencyParserConfiguration; + +exports.EnglishDimensionExtractorConfiguration = dimension.EnglishDimensionExtractorConfiguration; +exports.EnglishDimensionParserConfiguration = dimension.EnglishDimensionParserConfiguration; + +exports.EnglishTemperatureExtractorConfiguration = temperature.EnglishTemperatureExtractorConfiguration; +exports.EnglishTemperatureParserConfiguration = temperature.EnglishTemperatureParserConfiguration; + +exports.SpanishAgeExtractorConfiguration = age$2.SpanishAgeExtractorConfiguration; +exports.SpanishAgeParserConfiguration = age$2.SpanishAgeParserConfiguration; + +exports.SpanishNumberWithUnitExtractorConfiguration = base$2.SpanishNumberWithUnitExtractorConfiguration; +exports.SpanishNumberWithUnitParserConfiguration = base$2.SpanishNumberWithUnitParserConfiguration; + +exports.SpanishCurrencyExtractorConfiguration = currency$2.SpanishCurrencyExtractorConfiguration; +exports.SpanishCurrencyParserConfiguration = currency$2.SpanishCurrencyParserConfiguration; + +exports.SpanishDimensionExtractorConfiguration = dimension$2.SpanishDimensionExtractorConfiguration; +exports.SpanishDimensionParserConfiguration = dimension$2.SpanishDimensionParserConfiguration; + +exports.SpanishTemperatureExtractorConfiguration = temperature$2.SpanishTemperatureExtractorConfiguration; +exports.SpanishTemperatureParserConfiguration = temperature$2.SpanishTemperatureParserConfiguration; + +exports.PortugueseAgeExtractorConfiguration = age$4.PortugueseAgeExtractorConfiguration; +exports.PortugueseAgeParserConfiguration = age$4.PortugueseAgeParserConfiguration; + +exports.PortugueseNumberWithUnitExtractorConfiguration = base$4.PortugueseNumberWithUnitExtractorConfiguration; +exports.PortugueseNumberWithUnitParserConfiguration = base$4.PortugueseNumberWithUnitParserConfiguration; + +exports.PortugueseCurrencyExtractorConfiguration = currency$4.PortugueseCurrencyExtractorConfiguration; +exports.PortugueseCurrencyParserConfiguration = currency$4.PortugueseCurrencyParserConfiguration; + +exports.PortugueseDimensionExtractorConfiguration = dimension$4.PortugueseDimensionExtractorConfiguration; +exports.PortugueseDimensionParserConfiguration = dimension$4.PortugueseDimensionParserConfiguration; + +exports.PortugueseTemperatureExtractorConfiguration = temperature$4.PortugueseTemperatureExtractorConfiguration; +exports.PortugueseTemperatureParserConfiguration = temperature$4.PortugueseTemperatureParserConfiguration; + +exports.ChineseAgeExtractorConfiguration = age$6.ChineseAgeExtractorConfiguration; +exports.ChineseAgeParserConfiguration = age$6.ChineseAgeParserConfiguration; + +exports.ChineseNumberWithUnitExtractorConfiguration = base$6.ChineseNumberWithUnitExtractorConfiguration; +exports.ChineseNumberWithUnitParserConfiguration = base$6.ChineseNumberWithUnitParserConfiguration; + +exports.ChineseCurrencyExtractorConfiguration = currency$6.ChineseCurrencyExtractorConfiguration; +exports.ChineseCurrencyParserConfiguration = currency$6.ChineseCurrencyParserConfiguration; + +exports.ChineseDimensionExtractorConfiguration = dimension$6.ChineseDimensionExtractorConfiguration; +exports.ChineseDimensionParserConfiguration = dimension$6.ChineseDimensionParserConfiguration; + +exports.ChineseTemperatureExtractorConfiguration = temperature$6.ChineseTemperatureExtractorConfiguration; +exports.ChineseTemperatureParserConfiguration = temperature$6.ChineseTemperatureParserConfiguration; + +exports.JapaneseAgeExtractorConfiguration = age$8.JapaneseAgeExtractorConfiguration; +exports.JapaneseAgeParserConfiguration = age$8.JapaneseAgeParserConfiguration; + +exports.JapaneseNumberWithUnitExtractorConfiguration = base$8.JapaneseNumberWithUnitExtractorConfiguration; +exports.JapaneseNumberWithUnitParserConfiguration = base$8.JapaneseNumberWithUnitParserConfiguration; + +exports.JapaneseCurrencyExtractorConfiguration = currency$8.JapaneseCurrencyExtractorConfiguration; +exports.JapaneseCurrencyParserConfiguration = currency$8.JapaneseCurrencyParserConfiguration; + +exports.EnglishNumericWithUnit = englishNumericWithUnit.EnglishNumericWithUnit; + +exports.SpanishNumericWithUnit = spanishNumericWithUnit.SpanishNumericWithUnit; + +exports.PortugueseNumericWithUnit = portugueseNumericWithUnit.PortugueseNumericWithUnit; + +exports.ChineseNumericWithUnit = chineseNumericWithUnit.ChineseNumericWithUnit; + +exports.JapaneseNumericWithUnit = japaneseNumericWithUnit.JapaneseNumericWithUnit; + +}); + +unwrapExports(recognizersTextNumberWithUnit); + +var baseDateTime$4 = createCommonjsModule(function (module, exports) { +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); + +class TimeResult { + constructor(hour, minute, second, lowBound) { + this.hour = hour; + this.minute = minute; + this.second = second; + this.lowBound = lowBound ? lowBound : -1; + } +} +exports.TimeResult = TimeResult; +class BaseDateTimeExtractor { + constructor(regexesDictionary) { + this.regexesDictionary = regexesDictionary; + } + extract(source, refDate) { + if (!refDate) + refDate = new Date(); + let results = new Array(); + if (recognizersTextNumber.StringUtility.isNullOrEmpty(source)) { + return results; + } + let matchSource = new Map(); + let matched = new Array(source.length); + for (let i = 0; i < source.length; i++) { + matched[i] = false; + } + let collections = []; + this.regexesDictionary.forEach((value, regex) => { + let matches = recognizersTextNumber.RegExpUtility.getMatches(regex, source); + if (matches.length > 0) { + collections.push({ matches: matches, value: value }); + } + }); + collections.forEach(collection => { + collection.matches.forEach(m => { + for (let j = 0; j < m.length; j++) { + matched[m.index + j] = true; + } + // Keep Source Data for extra information + matchSource.set(m, collection.value); + }); + }); + let last = -1; + for (let i = 0; i < source.length; i++) { + if (matched[i]) { + if (i + 1 === source.length || !matched[i + 1]) { + let start = last + 1; + let length = i - last; + let substr = source.substring(start, start + length).trim(); + let srcMatch = Array.from(matchSource.keys()).find(m => m.index === start && m.length === length); + if (srcMatch) { + results.push({ + start: start, + length: length, + text: substr, + type: this.extractorName, + data: matchSource.has(srcMatch) + ? { dataType: matchSource.get(srcMatch), namedEntity: (key) => srcMatch.groups(key) } + : null + }); + } + } + } + else { + last = i; + } + } + return results; + } +} +exports.BaseDateTimeExtractor = BaseDateTimeExtractor; +class TimeResolutionUtils { + static addDescription(lowBoundMap, timeResult, description) { + description = TimeResolutionUtils.normalizeDesc(description); + if (lowBoundMap.has(description) && timeResult.hour < lowBoundMap.get(description)) { + timeResult.hour += 12; + timeResult.lowBound = lowBoundMap.get(description); + } + else { + timeResult.lowBound = 0; + } + } + static normalizeDesc(description) { + description = description.replace(/\s/g, ''); + description = description.replace(/\./g, ''); + return description; + } + static matchToValue(onlyDigitMatch, numbersMap, source) { + if (recognizersTextNumber.StringUtility.isNullOrEmpty(source)) { + return -1; + } + if (recognizersTextNumber.RegExpUtility.isMatch(onlyDigitMatch, source)) { + return Number.parseInt(source); + } + if (source.length === 1) { + return numbersMap.get(source); + } + let value = 1; + for (let index = 0; index < source.length; index++) { + let char = source.charAt(index); + if (char === '十') { + value *= 10; + } + else if (index === 0) { + value *= numbersMap.get(char); + } + else { + value += numbersMap.get(char); + } + } + return value; + } +} +exports.TimeResolutionUtils = TimeResolutionUtils; + +}); + +unwrapExports(baseDateTime$4); + +var durationConfiguration$6 = createCommonjsModule(function (module, exports) { +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); + + + + + + + + + +var DurationType; +(function (DurationType) { + DurationType[DurationType["WithNumber"] = 0] = "WithNumber"; +})(DurationType = exports.DurationType || (exports.DurationType = {})); +class DurationExtractorConfiguration extends recognizersTextNumberWithUnit.ChineseNumberWithUnitExtractorConfiguration { + constructor() { + super(new recognizersTextNumber.CultureInfo(recognizersTextNumber.Culture.Chinese)); + this.extractType = constants$2.Constants.SYS_DATETIME_DURATION; + this.suffixList = chineseDateTime.ChineseDateTime.DurationSuffixList; + this.prefixList = new Map(); + this.ambiguousUnitList = chineseDateTime.ChineseDateTime.DurationAmbiguousUnits; + } +} +class ChineseDurationExtractor extends baseDateTime$4.BaseDateTimeExtractor { + constructor() { + super(null); + this.extractorName = constants$2.Constants.SYS_DATETIME_DURATION; // "Duration"; + this.extractor = new recognizersTextNumberWithUnit.NumberWithUnitExtractor(new DurationExtractorConfiguration()); + this.yearRegex = recognizersText.RegExpUtility.getSafeRegExp(chineseDateTime.ChineseDateTime.DurationYearRegex); + this.halfSuffixRegex = recognizersText.RegExpUtility.getSafeRegExp(chineseDateTime.ChineseDateTime.DurationHalfSuffixRegex); + } + extract(source, refDate) { + if (!refDate) + refDate = new Date(); + let results = new Array(); + this.extractor.extract(source).forEach(result => { + // filter + if (recognizersText.RegExpUtility.isMatch(this.yearRegex, result.text)) { + return; + } + // match suffix + let suffix = source.substr(result.start + result.length); + let suffixMatch = recognizersText.RegExpUtility.getMatches(this.halfSuffixRegex, suffix).pop(); + if (suffixMatch && suffixMatch.index === 0) { + result.text = result.text + suffixMatch.value; + result.length += suffixMatch.length; + } + results.push(result); + }); + return results; + } +} +exports.ChineseDurationExtractor = ChineseDurationExtractor; +class ChineseDurationParserConfiguration { + constructor() { + this.unitValueMap = chineseDateTime.ChineseDateTime.DurationUnitValueMap; + } +} +class DurationParserConfiguration extends recognizersTextNumberWithUnit.ChineseNumberWithUnitParserConfiguration { + constructor() { + super(new recognizersTextNumber.CultureInfo(recognizersTextNumber.Culture.Chinese)); + this.BindDictionary(chineseDateTime.ChineseDateTime.DurationSuffixList); + } +} +class ChineseDurationParser extends baseDuration.BaseDurationParser { + constructor() { + let config = new ChineseDurationParserConfiguration(); + super(config); + this.internalParser = new recognizersTextNumberWithUnit.NumberWithUnitParser(new DurationParserConfiguration()); + } + parse(extractorResult, referenceDate) { + if (!referenceDate) + referenceDate = new Date(); + let resultValue; + if (extractorResult.type === this.parserName) { + let innerResult = new utilities$2.DateTimeResolutionResult(); + let hasHalfSuffix = extractorResult.text.endsWith('半'); + if (hasHalfSuffix) { + extractorResult.length--; + extractorResult.text = extractorResult.text.substr(0, extractorResult.length); + } + let parserResult = this.internalParser.parse(extractorResult); + let unitResult = parserResult.value; + if (!unitResult) { + return new parsers$4.DateTimeParseResult(); + } + let unitStr = unitResult.unit; + let numberStr = unitResult.number; + if (hasHalfSuffix) { + numberStr = (Number.parseFloat(numberStr) + 0.5).toString(); + } + innerResult.timex = `P${this.isLessThanDay(unitStr) ? 'T' : ''}${numberStr}${unitStr.charAt(0)}`; + innerResult.futureValue = Number.parseFloat(numberStr) * this.config.unitValueMap.get(unitStr); + innerResult.pastValue = Number.parseFloat(numberStr) * this.config.unitValueMap.get(unitStr); + innerResult.futureResolution = {}; + innerResult.futureResolution[constants$2.TimeTypeConstants.DURATION] = innerResult.futureValue.toString(); + innerResult.pastResolution = {}; + innerResult.pastResolution[constants$2.TimeTypeConstants.DURATION] = innerResult.pastValue.toString(); + innerResult.success = true; + resultValue = innerResult; + } + let result = new parsers$4.DateTimeParseResult(extractorResult); + result.value = resultValue; + result.timexStr = resultValue ? resultValue.timex : ''; + result.resolutionStr = ''; + return result; + } +} +exports.ChineseDurationParser = ChineseDurationParser; + +}); + +unwrapExports(durationConfiguration$6); + +var timeConfiguration$6 = createCommonjsModule(function (module, exports) { +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); + + + + + + + +var TimeType; +(function (TimeType) { + TimeType[TimeType["ChineseTime"] = 0] = "ChineseTime"; + TimeType[TimeType["LessTime"] = 1] = "LessTime"; + TimeType[TimeType["DigitTime"] = 2] = "DigitTime"; +})(TimeType = exports.TimeType || (exports.TimeType = {})); +class ChineseTimeExtractor extends baseDateTime$4.BaseDateTimeExtractor { + constructor() { + super(new Map([ + [recognizersText.RegExpUtility.getSafeRegExp(chineseDateTime.ChineseDateTime.TimeRegexes1), TimeType.ChineseTime], + [recognizersText.RegExpUtility.getSafeRegExp(chineseDateTime.ChineseDateTime.TimeRegexes2), TimeType.DigitTime], + [recognizersText.RegExpUtility.getSafeRegExp(chineseDateTime.ChineseDateTime.TimeRegexes3), TimeType.LessTime] + ])); + this.extractorName = constants$2.Constants.SYS_DATETIME_TIME; // "Time"; + } +} +exports.ChineseTimeExtractor = ChineseTimeExtractor; +class ChineseTimeParser extends baseTime.BaseTimeParser { + constructor() { + super(null); + this.functionMap = new Map([ + [TimeType.DigitTime, x => this.handleDigit(x)], + [TimeType.ChineseTime, x => this.handleChinese(x)], + [TimeType.LessTime, x => this.handleLess(x)] + ]); + this.onlyDigitMatch = recognizersText.RegExpUtility.getSafeRegExp('\\d+'); + this.numbersMap = chineseDateTime.ChineseDateTime.TimeNumberDictionary; + this.lowBoundMap = chineseDateTime.ChineseDateTime.TimeLowBoundDesc; + this.innerExtractor = new ChineseTimeExtractor(); + } + parse(er, referenceTime) { + if (!referenceTime) + referenceTime = new Date(); + let extra = er.data; + if (!extra) { + let innerResult = this.innerExtractor.extract(er.text, referenceTime).pop(); + extra = innerResult.data; + } + let timeResult = this.functionMap.get(extra.dataType)(extra); + let parseResult = this.packTimeResult(extra, timeResult, referenceTime); + if (parseResult.success) { + parseResult.futureResolution = {}; + parseResult.futureResolution[constants$2.TimeTypeConstants.TIME] = utilities$2.FormatUtil.formatTime(parseResult.futureValue); + parseResult.pastResolution = {}; + parseResult.pastResolution[constants$2.TimeTypeConstants.TIME] = utilities$2.FormatUtil.formatTime(parseResult.pastValue); + } + let result = new parsers$4.DateTimeParseResult(er); + result.value = parseResult; + result.data = timeResult; + result.resolutionStr = ''; + result.timexStr = parseResult.timex; + return result; + } + handleLess(extra) { + let hour = this.matchToValue(extra.namedEntity('hour').value); + let quarter = this.matchToValue(extra.namedEntity('quarter').value); + let minute = !recognizersText.StringUtility.isNullOrEmpty(extra.namedEntity('half').value) + ? 30 + : quarter !== -1 ? quarter * 15 : 0; + let second = this.matchToValue(extra.namedEntity('sec').value); + let less = this.matchToValue(extra.namedEntity('min').value); + let all = hour * 60 + minute - less; + if (all < 0) { + all += 1440; + } + return new baseDateTime$4.TimeResult(all / 60, all % 60, second); + } + handleChinese(extra) { + let hour = this.matchToValue(extra.namedEntity('hour').value); + let quarter = this.matchToValue(extra.namedEntity('quarter').value); + let minute = !recognizersText.StringUtility.isNullOrEmpty(extra.namedEntity('half').value) + ? 30 + : quarter !== -1 ? quarter * 15 + : this.matchToValue(extra.namedEntity('min').value); + let second = this.matchToValue(extra.namedEntity('sec').value); + return new baseDateTime$4.TimeResult(hour, minute, second); + } + handleDigit(extra) { + return new baseDateTime$4.TimeResult(this.matchToValue(extra.namedEntity('hour').value), this.matchToValue(extra.namedEntity('min').value), this.matchToValue(extra.namedEntity('sec').value)); + } + packTimeResult(extra, timeResult, referenceTime) { + let result = new utilities$2.DateTimeResolutionResult(); + let dayDescription = extra.namedEntity('daydesc').value; + let noDescription = recognizersText.StringUtility.isNullOrEmpty(dayDescription); + if (noDescription) { + result.comment = 'ampm'; + } + else { + this.addDescription(timeResult, dayDescription); + } + let hour = timeResult.hour > 0 ? timeResult.hour : 0; + let min = timeResult.minute > 0 ? timeResult.minute : 0; + let sec = timeResult.second > 0 ? timeResult.second : 0; + let day = referenceTime.getDate(); + let month = referenceTime.getMonth(); + let year = referenceTime.getFullYear(); + let timex = 'T'; + if (timeResult.hour >= 0) { + timex = timex + utilities$2.FormatUtil.toString(timeResult.hour, 2); + if (timeResult.minute >= 0) { + timex = timex + ':' + utilities$2.FormatUtil.toString(timeResult.minute, 2); + if (timeResult.second >= 0) { + timex = timex + ':' + utilities$2.FormatUtil.toString(timeResult.second, 2); + } + } + } + if (hour === 24) { + hour = 0; + } + result.futureValue = utilities$2.DateUtils.safeCreateFromMinValue(year, month, day, hour, min, sec); + result.pastValue = utilities$2.DateUtils.safeCreateFromMinValue(year, month, day, hour, min, sec); + result.timex = timex; + result.success = true; + return result; + } + matchToValue(source) { + return baseDateTime$4.TimeResolutionUtils.matchToValue(this.onlyDigitMatch, this.numbersMap, source); + } + addDescription(timeResult, description) { + baseDateTime$4.TimeResolutionUtils.addDescription(this.lowBoundMap, timeResult, description); + } +} +exports.ChineseTimeParser = ChineseTimeParser; + +}); + +unwrapExports(timeConfiguration$6); + +var dateConfiguration$6 = createCommonjsModule(function (module, exports) { +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); + + +const recognizers_text_number_2 = recognizersTextNumber; + + + + + + +class ChineseDateExtractorConfiguration { + constructor() { + this.dateRegexList = [ + recognizersText.RegExpUtility.getSafeRegExp(chineseDateTime.ChineseDateTime.DateRegexList1), + recognizersText.RegExpUtility.getSafeRegExp(chineseDateTime.ChineseDateTime.DateRegexList2), + recognizersText.RegExpUtility.getSafeRegExp(chineseDateTime.ChineseDateTime.DateRegexList3), + recognizersText.RegExpUtility.getSafeRegExp(chineseDateTime.ChineseDateTime.DateRegexList4), + recognizersText.RegExpUtility.getSafeRegExp(chineseDateTime.ChineseDateTime.DateRegexList5), + chineseDateTime.ChineseDateTime.DefaultLanguageFallback === constants$2.Constants.DefaultLanguageFallback_DMY ? + recognizersText.RegExpUtility.getSafeRegExp(chineseDateTime.ChineseDateTime.DateRegexList7) : + recognizersText.RegExpUtility.getSafeRegExp(chineseDateTime.ChineseDateTime.DateRegexList6), + chineseDateTime.ChineseDateTime.DefaultLanguageFallback === constants$2.Constants.DefaultLanguageFallback_DMY ? + recognizersText.RegExpUtility.getSafeRegExp(chineseDateTime.ChineseDateTime.DateRegexList6) : + recognizersText.RegExpUtility.getSafeRegExp(chineseDateTime.ChineseDateTime.DateRegexList7), + recognizersText.RegExpUtility.getSafeRegExp(chineseDateTime.ChineseDateTime.DateRegexList8) + ]; + this.implicitDateList = [ + recognizersText.RegExpUtility.getSafeRegExp(chineseDateTime.ChineseDateTime.LunarRegex), + recognizersText.RegExpUtility.getSafeRegExp(chineseDateTime.ChineseDateTime.SpecialDayRegex), + recognizersText.RegExpUtility.getSafeRegExp(chineseDateTime.ChineseDateTime.DateThisRegex), + recognizersText.RegExpUtility.getSafeRegExp(chineseDateTime.ChineseDateTime.DateLastRegex), + recognizersText.RegExpUtility.getSafeRegExp(chineseDateTime.ChineseDateTime.DateNextRegex), + recognizersText.RegExpUtility.getSafeRegExp(chineseDateTime.ChineseDateTime.WeekDayRegex), + recognizersText.RegExpUtility.getSafeRegExp(chineseDateTime.ChineseDateTime.WeekDayOfMonthRegex), + recognizersText.RegExpUtility.getSafeRegExp(chineseDateTime.ChineseDateTime.SpecialDate) + ]; + } +} +class ChineseDateExtractor extends baseDate.BaseDateExtractor { + constructor() { + super(new ChineseDateExtractorConfiguration()); + this.durationExtractor = new durationConfiguration$6.ChineseDurationExtractor(); + } + extract(source, refDate) { + if (!refDate) + refDate = new Date(); + let referenceDate = refDate; + let tokens = new Array() + .concat(super.basicRegexMatch(source)) + .concat(super.implicitDate(source)) + .concat(this.durationWithBeforeAndAfter(source, referenceDate)); + let result = utilities$2.Token.mergeAllTokens(tokens, source, this.extractorName); + return result; + } + durationWithBeforeAndAfter(source, refDate) { + let ret = []; + let durEx = this.durationExtractor.extract(source, refDate); + durEx.forEach(er => { + let pos = er.start + er.length; + if (pos < source.length) { + let nextChar = source.substr(pos, 1); + if (nextChar === '前' || nextChar === '后') { + ret.push(new utilities$2.Token(er.start, pos + 1)); + } + } + }); + return ret; + } +} +exports.ChineseDateExtractor = ChineseDateExtractor; +class ChineseDateParserConfiguration { + getSwiftDay(source) { + let trimmedSource = source.trim().toLowerCase(); + let swift = 0; + if (trimmedSource === '今天' || trimmedSource === '今日' || trimmedSource === '最近') { + swift = 0; + } + else if (trimmedSource.startsWith('明')) { + swift = 1; + } + else if (trimmedSource.startsWith('昨')) { + swift = -1; + } + else if (trimmedSource === '大后天' || trimmedSource === '大後天') { + swift = 3; + } + else if (trimmedSource === '大前天') { + swift = -3; + } + else if (trimmedSource === '后天' || trimmedSource === '後天') { + swift = 2; + } + else if (trimmedSource === '前天') { + swift = -2; + } + return swift; + } + getSwiftMonth(source) { + let trimmedSource = source.trim().toLowerCase(); + let swift = 0; + if (trimmedSource.startsWith(chineseDateTime.ChineseDateTime.ParserConfigurationNextMonthToken)) { + swift = 1; + } + else if (trimmedSource.startsWith(chineseDateTime.ChineseDateTime.ParserConfigurationLastMonthToken)) { + swift = -1; + } + return swift; + } + getSwift(source) { + return null; + } + isCardinalLast(source) { + return source === chineseDateTime.ChineseDateTime.ParserConfigurationLastWeekDayToken; + } + constructor() { + this.dateRegex = new ChineseDateExtractorConfiguration().dateRegexList; + this.monthOfYear = chineseDateTime.ChineseDateTime.ParserConfigurationMonthOfYear; + this.dayOfMonth = chineseDateTime.ChineseDateTime.ParserConfigurationDayOfMonth; + this.dayOfWeek = chineseDateTime.ChineseDateTime.ParserConfigurationDayOfWeek; + this.specialDayRegex = recognizersText.RegExpUtility.getSafeRegExp(chineseDateTime.ChineseDateTime.SpecialDayRegex); + this.specialDayWithNumRegex = recognizersText.RegExpUtility.getSafeRegExp(chineseDateTime.ChineseDateTime.SpecialDayWithNumRegex); + this.thisRegex = recognizersText.RegExpUtility.getSafeRegExp(chineseDateTime.ChineseDateTime.DateThisRegex); + this.nextRegex = recognizersText.RegExpUtility.getSafeRegExp(chineseDateTime.ChineseDateTime.DateNextRegex); + this.lastRegex = recognizersText.RegExpUtility.getSafeRegExp(chineseDateTime.ChineseDateTime.DateLastRegex); + this.weekDayRegex = recognizersText.RegExpUtility.getSafeRegExp(chineseDateTime.ChineseDateTime.WeekDayRegex); + this.integerExtractor = new recognizersTextNumber.ChineseIntegerExtractor(); + this.numberParser = recognizersTextNumber.AgnosticNumberParserFactory.getParser(recognizersTextNumber.AgnosticNumberParserType.Number, new recognizersTextNumber.ChineseNumberParserConfiguration()); + } +} +class ChineseDateParser extends baseDate.BaseDateParser { + constructor() { + let config = new ChineseDateParserConfiguration(); + super(config); + this.lunarRegex = recognizersText.RegExpUtility.getSafeRegExp(chineseDateTime.ChineseDateTime.LunarRegex); + this.specialDateRegex = recognizersText.RegExpUtility.getSafeRegExp(chineseDateTime.ChineseDateTime.SpecialDate); + this.tokenNextRegex = recognizersText.RegExpUtility.getSafeRegExp(chineseDateTime.ChineseDateTime.DateNextRe); + this.tokenLastRegex = recognizersText.RegExpUtility.getSafeRegExp(chineseDateTime.ChineseDateTime.DateLastRe); + this.monthMaxDays = [31, 29, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31]; + } + parse(extractorResult, referenceDate) { + if (!referenceDate) + referenceDate = new Date(); + let resultValue; + if (extractorResult.type === this.parserName) { + let source = extractorResult.text.toLowerCase(); + let innerResult = this.parseBasicRegexMatch(source, referenceDate); + if (!innerResult.success) { + innerResult = this.parseImplicitDate(source, referenceDate); + } + if (!innerResult.success) { + innerResult = this.parseWeekdayOfMonth(source, referenceDate); + } + if (!innerResult.success) { + // TODO create test + innerResult = this.parserDurationWithAgoAndLater(source, referenceDate); + } + if (innerResult.success) { + innerResult.futureResolution = {}; + innerResult.futureResolution[constants$2.TimeTypeConstants.DATE] = utilities$2.FormatUtil.formatDate(innerResult.futureValue); + innerResult.pastResolution = {}; + innerResult.pastResolution[constants$2.TimeTypeConstants.DATE] = utilities$2.FormatUtil.formatDate(innerResult.pastValue); + innerResult.isLunar = this.parseLunarCalendar(source); + resultValue = innerResult; + } + } + let result = new parsers$4.DateTimeParseResult(extractorResult); + result.value = resultValue; + result.timexStr = resultValue ? resultValue.timex : ''; + result.resolutionStr = ''; + return result; + } + parseLunarCalendar(source) { + return recognizersText.RegExpUtility.isMatch(this.lunarRegex, source.trim()); + } + parseBasicRegexMatch(source, referenceDate) { + let trimmedSource = source.trim(); + let result = new utilities$2.DateTimeResolutionResult(); + this.config.dateRegex.some(regex => { + let match = recognizersText.RegExpUtility.getMatches(regex, trimmedSource).pop(); + if (match && match.index === 0 && match.length === trimmedSource.length) { + result = this.matchToDate(match, referenceDate); + return true; + } + }); + return result; + } + parseImplicitDate(source, referenceDate) { + let trimmedSource = source.trim(); + let result = new utilities$2.DateTimeResolutionResult(); + // handle "on 12" + let match = recognizersText.RegExpUtility.getMatches(this.specialDateRegex, trimmedSource).pop(); + if (match && match.length === trimmedSource.length) { + let day = 0; + let month = referenceDate.getMonth(); + let year = referenceDate.getFullYear(); + let yearStr = match.groups('thisyear').value; + let monthStr = match.groups('thismonth').value; + let dayStr = match.groups('day').value; + day = this.config.dayOfMonth.get(dayStr); + let hasYear = !recognizersText.StringUtility.isNullOrEmpty(yearStr); + let hasMonth = !recognizersText.StringUtility.isNullOrEmpty(monthStr); + if (hasMonth) { + if (recognizersText.RegExpUtility.isMatch(this.tokenNextRegex, monthStr)) { + month++; + if (month === 12) { + month = 0; + year++; + } + } + else if (recognizersText.RegExpUtility.isMatch(this.tokenLastRegex, monthStr)) { + month--; + if (month === -1) { + month = 12; + year--; + } + } + if (hasYear) { + if (recognizersText.RegExpUtility.isMatch(this.tokenNextRegex, yearStr)) { + year++; + } + else if (recognizersText.RegExpUtility.isMatch(this.tokenLastRegex, yearStr)) { + year--; + } + } + } + result.timex = utilities$2.FormatUtil.luisDate(hasYear ? year : -1, hasMonth ? month : -1, day); + let futureDate; + let pastDate; + if (day > this.monthMaxDays[month]) { + futureDate = utilities$2.DateUtils.safeCreateFromMinValue(year, month + 1, day); + pastDate = utilities$2.DateUtils.safeCreateFromMinValue(year, month - 1, day); + } + else { + futureDate = utilities$2.DateUtils.safeCreateFromMinValue(year, month, day); + pastDate = utilities$2.DateUtils.safeCreateFromMinValue(year, month, day); + if (!hasMonth) { + if (futureDate < referenceDate) + futureDate = utilities$2.DateUtils.addMonths(futureDate, 1); + if (pastDate >= referenceDate) + pastDate = utilities$2.DateUtils.addMonths(pastDate, -1); + } + else if (hasMonth && !hasYear) { + if (futureDate < referenceDate) + futureDate = utilities$2.DateUtils.addYears(futureDate, 1); + if (pastDate >= referenceDate) + pastDate = utilities$2.DateUtils.addYears(pastDate, -1); + } + } + result.futureValue = futureDate; + result.pastValue = pastDate; + result.success = true; + return result; + } + // handle cases like "昨日", "明日", "大后天" + match = recognizersText.RegExpUtility.getMatches(this.config.specialDayRegex, trimmedSource).pop(); + if (match && match.index === 0 && match.length === trimmedSource.length) { + let swift = this.config.getSwiftDay(match.value); + let value = utilities$2.DateUtils.addDays(referenceDate, swift); + result.timex = utilities$2.FormatUtil.luisDateFromDate(value); + result.futureValue = value; + result.pastValue = value; + result.success = true; + return result; + } + // handle "this Friday" + match = recognizersText.RegExpUtility.getMatches(this.config.thisRegex, trimmedSource).pop(); + if (match && match.index === 0 && match.length === trimmedSource.length) { + let weekdayStr = match.groups('weekday').value; + let value = utilities$2.DateUtils.this(referenceDate, this.config.dayOfWeek.get(weekdayStr)); + result.timex = utilities$2.FormatUtil.luisDateFromDate(value); + result.futureValue = value; + result.pastValue = value; + result.success = true; + return result; + } + // handle "next Sunday" + match = recognizersText.RegExpUtility.getMatches(this.config.nextRegex, trimmedSource).pop(); + if (match && match.index === 0 && match.length === trimmedSource.length) { + let weekdayStr = match.groups('weekday').value; + let value = utilities$2.DateUtils.next(referenceDate, this.config.dayOfWeek.get(weekdayStr)); + result.timex = utilities$2.FormatUtil.luisDateFromDate(value); + result.futureValue = value; + result.pastValue = value; + result.success = true; + return result; + } + // handle "last Friday", "last mon" + match = recognizersText.RegExpUtility.getMatches(this.config.lastRegex, trimmedSource).pop(); + if (match && match.index === 0 && match.length === trimmedSource.length) { + let weekdayStr = match.groups('weekday').value; + let value = utilities$2.DateUtils.last(referenceDate, this.config.dayOfWeek.get(weekdayStr)); + result.timex = utilities$2.FormatUtil.luisDateFromDate(value); + result.futureValue = value; + result.pastValue = value; + result.success = true; + return result; + } + // handle "Friday" + match = recognizersText.RegExpUtility.getMatches(this.config.weekDayRegex, trimmedSource).pop(); + if (match && match.index === 0 && match.length === trimmedSource.length) { + let weekdayStr = match.groups('weekday').value; + let weekday = this.config.dayOfWeek.get(weekdayStr); + let value = utilities$2.DateUtils.this(referenceDate, weekday); + if (weekday === 0) + weekday = 7; + if (weekday < referenceDate.getDay()) + value = utilities$2.DateUtils.next(referenceDate, weekday); + result.timex = 'XXXX-WXX-' + weekday; + let futureDate = new Date(value); + let pastDate = new Date(value); + if (futureDate < referenceDate) + futureDate = utilities$2.DateUtils.addDays(futureDate, 7); + if (pastDate >= referenceDate) + pastDate = utilities$2.DateUtils.addDays(pastDate, -7); + result.futureValue = futureDate; + result.pastValue = pastDate; + result.success = true; + return result; + } + return result; + } + matchToDate(match, referenceDate) { + let result = new utilities$2.DateTimeResolutionResult(); + let yearStr = match.groups('year').value; + let yearChs = match.groups('yearchs').value; + let monthStr = match.groups('month').value; + let dayStr = match.groups('day').value; + let month = 0; + let day = 0; + let year = 0; + let yearTemp = this.convertChineseYearToNumber(yearChs); + year = yearTemp === -1 ? 0 : yearTemp; + if (this.config.monthOfYear.has(monthStr) && this.config.dayOfMonth.has(dayStr)) { + month = this.getMonthOfYear(monthStr); + day = this.getDayOfMonth(dayStr); + if (!recognizersText.StringUtility.isNullOrEmpty(yearStr)) { + year = Number.parseInt(yearStr, 10); + if (year < 100 && year >= constants$2.Constants.MinTwoDigitYearPastNum) + year += 1900; + else if (year >= 0 && year < constants$2.Constants.MaxTwoDigitYearFutureNum) + year += 2000; + } + } + let noYear = false; + if (year === 0) { + year = referenceDate.getFullYear(); + result.timex = utilities$2.FormatUtil.luisDate(-1, month, day); + noYear = true; + } + else { + result.timex = utilities$2.FormatUtil.luisDate(year, month, day); + } + let futureDate = utilities$2.DateUtils.safeCreateFromMinValue(year, month, day); + let pastDate = utilities$2.DateUtils.safeCreateFromMinValue(year, month, day); + if (noYear && futureDate < referenceDate) { + futureDate = utilities$2.DateUtils.safeCreateFromMinValue(year + 1, month, day); + } + if (noYear && pastDate >= referenceDate) { + pastDate = utilities$2.DateUtils.safeCreateFromMinValue(year - 1, month, day); + } + result.futureValue = futureDate; + result.pastValue = pastDate; + result.success = true; + return result; + } + convertChineseYearToNumber(source) { + let year = 0; + let er = this.config.integerExtractor.extract(source).pop(); + if (er && er.type === recognizers_text_number_2.Constants.SYS_NUM_INTEGER) { + year = Number.parseInt(this.config.numberParser.parse(er).value); + } + if (year < 10) { + year = 0; + for (let i = 0; i < source.length; i++) { + let char = source.charAt(i); + year *= 10; + let er = this.config.integerExtractor.extract(char).pop(); + if (er && er.type === recognizers_text_number_2.Constants.SYS_NUM_INTEGER) { + year += Number.parseInt(this.config.numberParser.parse(er).value); + } + } + } + return year < 10 ? -1 : year; + } + getMonthOfYear(source) { + let month = this.config.monthOfYear.get(source) > 12 + ? this.config.monthOfYear.get(source) % 12 + : this.config.monthOfYear.get(source); + return month - 1; + } + getDayOfMonth(source) { + return this.config.dayOfMonth.get(source) > 31 + ? this.config.dayOfMonth.get(source) % 31 + : this.config.dayOfMonth.get(source); + } +} +exports.ChineseDateParser = ChineseDateParser; + +}); + +unwrapExports(dateConfiguration$6); + +var dateTimeConfiguration$6 = createCommonjsModule(function (module, exports) { +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); + + + + + + + + +class ChineseDateTimeExtractorConfiguration { + constructor() { + this.datePointExtractor = new dateConfiguration$6.ChineseDateExtractor(); + this.timePointExtractor = new timeConfiguration$6.ChineseTimeExtractor(); + this.prepositionRegex = recognizersText.RegExpUtility.getSafeRegExp(chineseDateTime.ChineseDateTime.PrepositionRegex); + this.nowRegex = recognizersText.RegExpUtility.getSafeRegExp(chineseDateTime.ChineseDateTime.NowRegex); + this.nightRegex = recognizersText.RegExpUtility.getSafeRegExp(chineseDateTime.ChineseDateTime.NightRegex); + this.timeOfTodayBeforeRegex = recognizersText.RegExpUtility.getSafeRegExp(chineseDateTime.ChineseDateTime.TimeOfTodayRegex); + } + isConnectorToken(source) { + return recognizersText.StringUtility.isNullOrEmpty(source) + || source === ',' + || recognizersText.RegExpUtility.isMatch(this.prepositionRegex, source); + } +} +class ChineseDateTimeExtractor extends baseDateTime$2.BaseDateTimeExtractor { + constructor() { + super(new ChineseDateTimeExtractorConfiguration()); + } + extract(source, refDate) { + if (!refDate) + refDate = new Date(); + let referenceDate = refDate; + let tokens = new Array() + .concat(this.mergeDateAndTime(source, referenceDate)) + .concat(this.basicRegexMatch(source)) + .concat(this.timeOfToday(source, referenceDate)); + let result = utilities$2.Token.mergeAllTokens(tokens, source, this.extractorName); + return result; + } + mergeDateAndTime(source, refDate) { + let tokens = new Array(); + let ers = this.config.datePointExtractor.extract(source, refDate); + if (ers.length < 1) + return tokens; + ers = ers.concat(this.config.timePointExtractor.extract(source, refDate)); + if (ers.length < 2) + return tokens; + ers = ers.sort((erA, erB) => erA.start < erB.start ? -1 : erA.start === erB.start ? 0 : 1); + let i = 0; + while (i < ers.length - 1) { + let j = i + 1; + while (j < ers.length && recognizersText.ExtractResult.isOverlap(ers[i], ers[j])) { + j++; + } + if (j >= ers.length) + break; + if (ers[i].type === constants$2.Constants.SYS_DATETIME_DATE && ers[j].type === constants$2.Constants.SYS_DATETIME_TIME) { + let middleBegin = ers[i].start + ers[i].length; + let middleEnd = ers[j].start; + if (middleBegin > middleEnd) { + continue; + } + let middleStr = source.substr(middleBegin, middleEnd - middleBegin).trim().toLowerCase(); + if (this.config.isConnectorToken(middleStr)) { + let begin = ers[i].start; + let end = ers[j].start + ers[j].length; + tokens.push(new utilities$2.Token(begin, end)); + } + i = j + 1; + continue; + } + i = j; + } + return tokens; + } + timeOfToday(source, refDate) { + let tokens = new Array(); + this.config.timePointExtractor.extract(source, refDate).forEach(er => { + let beforeStr = source.substr(0, er.start); + let innerMatch = recognizersText.RegExpUtility.getMatches(this.config.nightRegex, er.text).pop(); + if (innerMatch && innerMatch.index === 0) { + beforeStr = source.substr(0, er.start + innerMatch.length); + } + if (recognizersText.StringUtility.isNullOrWhitespace(beforeStr)) + return; + let match = recognizersText.RegExpUtility.getMatches(this.config.timeOfTodayBeforeRegex, beforeStr).pop(); + if (match && recognizersText.StringUtility.isNullOrWhitespace(beforeStr.substr(match.index + match.length))) { + let begin = match.index; + let end = er.start + er.length; + tokens.push(new utilities$2.Token(begin, end)); + } + }); + return tokens; + } +} +exports.ChineseDateTimeExtractor = ChineseDateTimeExtractor; +class ChineseDateTimeParserConfiguration { + constructor() { + this.dateExtractor = new dateConfiguration$6.ChineseDateExtractor(); + this.timeExtractor = new timeConfiguration$6.ChineseTimeExtractor(); + this.dateParser = new dateConfiguration$6.ChineseDateParser(); + this.timeParser = new timeConfiguration$6.ChineseTimeParser(); + this.pmTimeRegex = recognizersText.RegExpUtility.getSafeRegExp(chineseDateTime.ChineseDateTime.DateTimeSimplePmRegex); + this.amTimeRegex = recognizersText.RegExpUtility.getSafeRegExp(chineseDateTime.ChineseDateTime.DateTimeSimpleAmRegex); + this.specificTimeOfDayRegex = recognizersText.RegExpUtility.getSafeRegExp(chineseDateTime.ChineseDateTime.TimeOfTodayRegex); + this.nowRegex = recognizersText.RegExpUtility.getSafeRegExp(chineseDateTime.ChineseDateTime.NowRegex); + } + haveAmbiguousToken(text, matchedText) { + return null; + } + getMatchedNowTimex(text) { + let trimmedText = text.trim().toLowerCase(); + if (trimmedText.endsWith('现在')) { + return { matched: true, timex: 'PRESENT_REF' }; + } + else if (trimmedText === '刚刚才' || trimmedText === '刚刚' || trimmedText === '刚才') { + return { matched: true, timex: 'PAST_REF' }; + } + else if (trimmedText === '立刻' || trimmedText === '马上') { + return { matched: true, timex: 'FUTURE_REF' }; + } + return { matched: false, timex: null }; + } + getSwiftDay(text) { + let swift = 0; + if (text === '明晚' || text === '明早' || text === '明晨') { + swift = 1; + } + else if (text === '昨晚') { + swift = -1; + } + return swift; + } + getHour(text, hour) { + let result = hour; + if (hour < 12 && ['今晚', '明晚', '昨晚'].some(o => o === text)) { + result += 12; + } + else if (hour >= 12 && ['今早', '今晨', '明早', '明晨'].some(o => o === text)) { + result -= 12; + } + return result; + } +} +class ChineseDateTimeParser extends baseDateTime$2.BaseDateTimeParser { + constructor() { + let config = new ChineseDateTimeParserConfiguration(); + super(config); + } + parse(er, refTime) { + if (!refTime) + refTime = new Date(); + let referenceTime = refTime; + let value = null; + if (er.type === baseDateTime$2.BaseDateTimeParser.ParserName) { + let innerResult = this.mergeDateAndTime(er.text, referenceTime); + if (!innerResult.success) { + innerResult = this.parseBasicRegex(er.text, referenceTime); + } + if (!innerResult.success) { + innerResult = this.parseTimeOfToday(er.text, referenceTime); + } + if (innerResult.success) { + innerResult.futureResolution = {}; + innerResult.futureResolution[constants$2.TimeTypeConstants.DATETIME] = utilities$2.FormatUtil.formatDateTime(innerResult.futureValue); + innerResult.pastResolution = {}; + innerResult.pastResolution[constants$2.TimeTypeConstants.DATETIME] = utilities$2.FormatUtil.formatDateTime(innerResult.pastValue); + value = innerResult; + } + } + let ret = new parsers$4.DateTimeParseResult(er); + { + ret.value = value, ret.timexStr = value === null ? "" : value.timex, ret.resolutionStr = ""; + } + + return ret; + } + // merge a Date entity and a Time entity + mergeDateAndTime(text, referenceTime) { + let ret = new utilities$2.DateTimeResolutionResult(); + let er1 = this.config.dateExtractor.extract(text, referenceTime); + if (er1.length === 0) { + return ret; + } + let er2 = this.config.timeExtractor.extract(text, referenceTime); + if (er2.length === 0) { + return ret; + } + let pr1 = this.config.dateParser.parse(er1[0], new Date(referenceTime.toDateString())); + let pr2 = this.config.timeParser.parse(er2[0], referenceTime); + if (pr1.value === null || pr2.value === null) { + return ret; + } + let futureDate = pr1.value.futureValue; + let pastDate = pr1.value.pastValue; + let time = pr2.value.futureValue; + let hour = time.getHours(); + let min = time.getMinutes(); + let sec = time.getSeconds(); + // handle morning, afternoon + if (recognizersText.RegExpUtility.getMatches(this.config.pmTimeRegex, text).length && hour < 12) { + hour += 12; + } + else if (recognizersText.RegExpUtility.getMatches(this.config.amTimeRegex, text).length && hour >= 12) { + hour -= 12; + } + let timeStr = pr2.timexStr; + if (timeStr.endsWith("ampm")) { + timeStr = timeStr.substring(0, timeStr.length - 4); + } + timeStr = "T" + utilities$2.FormatUtil.toString(hour, 2) + timeStr.substring(3); + ret.timex = pr1.timexStr + timeStr; + let val = pr2.value; + if (hour <= 12 && !recognizersText.RegExpUtility.getMatches(this.config.pmTimeRegex, text).length + && !recognizersText.RegExpUtility.getMatches(this.config.amTimeRegex, text).length && val.comment) { + ret.comment = "ampm"; + } + ret.futureValue = new Date(futureDate.getFullYear(), futureDate.getMonth(), futureDate.getDate(), hour, min, sec); + ret.pastValue = new Date(pastDate.getFullYear(), pastDate.getMonth(), pastDate.getDate(), hour, min, sec); + ret.success = true; + return ret; + } + parseTimeOfToday(text, referenceTime) { + let ret = new utilities$2.DateTimeResolutionResult(); + let ers = this.config.timeExtractor.extract(text, referenceTime); + if (ers.length !== 1) { + return ret; + } + let pr = this.config.timeParser.parse(ers[0], referenceTime); + if (pr.value === null) { + return ret; + } + let time = pr.value.futureValue; + let hour = time.getHours(); + let min = time.getMinutes(); + let sec = time.getSeconds(); + let timeStr = pr.timexStr; + let match = recognizersText.RegExpUtility.getMatches(this.config.specificTimeOfDayRegex, text).pop(); + if (match) { + let matchStr = match.value.toLowerCase(); + // handle "last", "next" + let swift = this.config.getSwiftDay(matchStr); + let date = utilities$2.DateUtils.addDays(referenceTime, swift); + hour = this.config.getHour(matchStr, hour); + // in this situation, luisStr cannot end up with "ampm", because we always have a "morning" or "night" + if (timeStr.endsWith("ampm")) { + timeStr = timeStr.substring(0, timeStr.length - 4); + } + timeStr = "T" + utilities$2.FormatUtil.toString(hour, 2) + timeStr.substring(3); + ret.timex = utilities$2.FormatUtil.formatDate(date) + timeStr; + ret.futureValue = ret.pastValue = new Date(date.getFullYear(), date.getMonth(), date.getDate(), hour, min, sec); + ret.success = true; + return ret; + } + return ret; + } +} +exports.ChineseDateTimeParser = ChineseDateTimeParser; + +}); + +unwrapExports(dateTimeConfiguration$6); + +var timePeriodConfiguration$6 = createCommonjsModule(function (module, exports) { +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); + + + + + + + + + +var TimePeriodType; +(function (TimePeriodType) { + TimePeriodType[TimePeriodType["ShortTime"] = 0] = "ShortTime"; + TimePeriodType[TimePeriodType["FullTime"] = 1] = "FullTime"; +})(TimePeriodType = exports.TimePeriodType || (exports.TimePeriodType = {})); +class ChineseTimePeriodExtractor extends baseDateTime$4.BaseDateTimeExtractor { + constructor() { + super(new Map([ + [recognizersText.RegExpUtility.getSafeRegExp(chineseDateTime.ChineseDateTime.TimePeriodRegexes1), TimePeriodType.FullTime], + [recognizersText.RegExpUtility.getSafeRegExp(chineseDateTime.ChineseDateTime.TimePeriodRegexes2), TimePeriodType.ShortTime], + [recognizersText.RegExpUtility.getSafeRegExp(chineseDateTime.ChineseDateTime.TimeOfDayRegex), TimePeriodType.ShortTime] + ])); + this.extractorName = constants$2.Constants.SYS_DATETIME_TIMEPERIOD; // "time range"; + } +} +exports.ChineseTimePeriodExtractor = ChineseTimePeriodExtractor; +class ChineseTimePeriodParserConfiguration { + constructor() { + this.timeParser = new timeConfiguration$6.ChineseTimeParser(); + this.integerExtractor = new recognizersTextNumber.EnglishIntegerExtractor(); + } + getMatchedTimexRange(text) { return null; } +} +class ChineseTimePeriodParser extends baseTimePeriod.BaseTimePeriodParser { + constructor() { + let config = new ChineseTimePeriodParserConfiguration(); + super(config); + this.dayDescriptionRegex = recognizersText.RegExpUtility.getSafeRegExp(chineseDateTime.ChineseDateTime.TimeDayDescRegex); + this.onlyDigitMatch = recognizersText.RegExpUtility.getSafeRegExp('\\d+'); + this.numbersMap = chineseDateTime.ChineseDateTime.TimeNumberDictionary; + this.lowBoundMap = chineseDateTime.ChineseDateTime.TimeLowBoundDesc; + } + parse(er, referenceTime) { + if (!referenceTime) + referenceTime = new Date(); + let result = new parsers$4.DateTimeParseResult(er); + let extra = er.data; + if (!extra) { + return result; + } + let parseResult = this.parseChineseTimeOfDay(er.text, referenceTime); + if (!parseResult.success) { + parseResult = this.parseTimePeriod(extra, referenceTime); + } + if (parseResult.success) { + parseResult.futureResolution = {}; + parseResult.futureResolution[constants$2.TimeTypeConstants.START_TIME] = utilities$2.FormatUtil.formatTime(parseResult.futureValue.item1); + parseResult.futureResolution[constants$2.TimeTypeConstants.END_TIME] = utilities$2.FormatUtil.formatTime(parseResult.futureValue.item2); + parseResult.pastResolution = {}; + parseResult.pastResolution[constants$2.TimeTypeConstants.START_TIME] = utilities$2.FormatUtil.formatTime(parseResult.pastValue.item1); + parseResult.pastResolution[constants$2.TimeTypeConstants.END_TIME] = utilities$2.FormatUtil.formatTime(parseResult.pastValue.item2); + } + result.value = parseResult; + result.resolutionStr = ''; + result.timexStr = parseResult.timex; + return result; + } + parseChineseTimeOfDay(text, referenceTime) { + let day = referenceTime.getDay(), month = referenceTime.getMonth(), year = referenceTime.getFullYear(); + let ret = new utilities$2.DateTimeResolutionResult(); + let parameters = this.GetMatchedTimexRange(text); + if (!parameters.matched) { + return new utilities$2.DateTimeResolutionResult(); + } + ret.timex = parameters.timex; + ret.futureValue = ret.pastValue = { + item1: utilities$2.DateUtils.safeCreateFromMinValue(year, month, day, parameters.beginHour, 0, 0), + item2: utilities$2.DateUtils.safeCreateFromMinValue(year, month, day, parameters.endHour, parameters.endMin, 0) + }; + ret.success = true; + return ret; + } + GetMatchedTimexRange(text) { + let trimmedText = text.trim(), matched = false, timex = null, beginHour = 0, endHour = 0, endMin = 0; + if (trimmedText.endsWith("上午")) { + timex = "TMO"; + beginHour = 8; + endHour = 12; + } + else if (trimmedText.endsWith("下午")) { + timex = "TAF"; + beginHour = 12; + endHour = 16; + } + else if (trimmedText.endsWith("晚上")) { + timex = "TEV"; + beginHour = 16; + endHour = 20; + } + else if (trimmedText.localeCompare("白天") == 0) { + timex = "TDT"; + beginHour = 8; + endHour = 18; + } + else if (trimmedText.endsWith("深夜")) { + timex = "TNI"; + beginHour = 20; + endHour = 23; + endMin = 59; + } + else { + timex = null; + matched = false; + return { matched, timex, beginHour, endHour, endMin }; + } + matched = true; + return { matched, timex, beginHour, endHour, endMin }; + } + parseTimePeriod(extra, referenceTime) { + let result = new utilities$2.DateTimeResolutionResult(); + let leftEntity = extra.namedEntity('left'); + let leftResult = extra.dataType === TimePeriodType.FullTime + ? this.getParseTimeResult(leftEntity, referenceTime) + : this.getShortLeft(leftEntity.value); + let rightEntity = extra.namedEntity('right'); + let rightResult = this.getParseTimeResult(rightEntity, referenceTime); + // the right side doesn't contain desc while the left side does + if (rightResult.lowBound === -1 && leftResult.lowBound !== -1 && rightResult.hour <= leftResult.lowBound) { + rightResult.hour += 12; + } + let leftDate = this.buildDate(leftResult, referenceTime); + let rightDate = this.buildDate(rightResult, referenceTime); + if (rightDate.getHours() < leftDate.getHours()) { + rightDate = utilities$2.DateUtils.addDays(rightDate, 1); + } + result.futureValue = result.pastValue = { + item1: leftDate, + item2: rightDate + }; + let leftTimex = this.buildTimex(leftResult); + let rightTimex = this.buildTimex(rightResult); + let spanTimex = this.buildSpan(leftResult, rightResult); + result.timex = `(${leftTimex},${rightTimex},${spanTimex})`; + result.success = true; + return result; + } + getParseTimeResult(entity, referenceTime) { + let extractResult = { + start: entity.index, + length: entity.length, + text: entity.value, + type: constants$2.Constants.SYS_DATETIME_TIME + }; + let result = this.config.timeParser.parse(extractResult, referenceTime); + return result.data; + } + getShortLeft(source) { + let description = ''; + if (recognizersText.RegExpUtility.isMatch(this.dayDescriptionRegex, source)) { + description = source.substr(0, source.length - 1); + } + let hour = baseDateTime$4.TimeResolutionUtils.matchToValue(this.onlyDigitMatch, this.numbersMap, source.substr(source.length - 1)); + let timeResult = new baseDateTime$4.TimeResult(hour, -1, -1); + baseDateTime$4.TimeResolutionUtils.addDescription(this.lowBoundMap, timeResult, description); + return timeResult; + } + buildDate(time, referenceTime) { + let day = referenceTime.getDate(); + let month = referenceTime.getMonth(); + let year = referenceTime.getFullYear(); + let hour = time.hour > 0 ? time.hour : 0; + let min = time.minute > 0 ? time.minute : 0; + let sec = time.second > 0 ? time.second : 0; + return utilities$2.DateUtils.safeCreateFromMinValue(year, month, day, hour, min, sec); + } + buildTimex(timeResult) { + let timex = 'T'; + if (timeResult.hour >= 0) { + timex = timex + utilities$2.FormatUtil.toString(timeResult.hour, 2); + if (timeResult.minute >= 0) { + timex = timex + ':' + utilities$2.FormatUtil.toString(timeResult.minute, 2); + if (timeResult.second >= 0) { + timex = timex + ':' + utilities$2.FormatUtil.toString(timeResult.second, 2); + } + } + } + return timex; + } + buildSpan(left, right) { + left = this.sanitizeTimeResult(left); + right = this.sanitizeTimeResult(right); + let spanHour = right.hour - left.hour; + let spanMin = right.minute - left.minute; + let spanSec = right.second - left.second; + if (spanSec < 0) { + spanSec += 60; + spanMin -= 1; + } + if (spanMin < 0) { + spanMin += 60; + spanHour -= 1; + } + if (spanHour < 0) { + spanHour += 24; + } + let spanTimex = `PT${spanHour}H`; + if (spanMin !== 0 && spanSec === 0) { + spanTimex = spanTimex + `${spanMin}M`; + } + else if (spanSec !== 0) { + spanTimex = spanTimex + `${spanMin}M${spanSec}S`; + } + return spanTimex; + } + sanitizeTimeResult(timeResult) { + return new baseDateTime$4.TimeResult(timeResult.hour, timeResult.minute === -1 ? 0 : timeResult.minute, timeResult.second === -1 ? 0 : timeResult.second); + } +} +exports.ChineseTimePeriodParser = ChineseTimePeriodParser; + +}); + +unwrapExports(timePeriodConfiguration$6); + +var datePeriodConfiguration$6 = createCommonjsModule(function (module, exports) { +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); + + +const recognizers_text_number_2 = recognizersTextNumber; + + + + + + + + +class ChineseDatePeriodExtractorConfiguration { + constructor() { + this.simpleCasesRegexes = [ + recognizersText.RegExpUtility.getSafeRegExp(chineseDateTime.ChineseDateTime.SimpleCasesRegex), + recognizersText.RegExpUtility.getSafeRegExp(chineseDateTime.ChineseDateTime.OneWordPeriodRegex), + recognizersText.RegExpUtility.getSafeRegExp(chineseDateTime.ChineseDateTime.StrictYearRegex), + recognizersText.RegExpUtility.getSafeRegExp(chineseDateTime.ChineseDateTime.YearToYear), + recognizersText.RegExpUtility.getSafeRegExp(chineseDateTime.ChineseDateTime.YearToYearSuffixRequired), + recognizersText.RegExpUtility.getSafeRegExp(chineseDateTime.ChineseDateTime.YearAndMonth), + recognizersText.RegExpUtility.getSafeRegExp(chineseDateTime.ChineseDateTime.PureNumYearAndMonth), + recognizersText.RegExpUtility.getSafeRegExp(chineseDateTime.ChineseDateTime.DatePeriodYearInChineseRegex), + recognizersText.RegExpUtility.getSafeRegExp(chineseDateTime.ChineseDateTime.WeekOfMonthRegex), + recognizersText.RegExpUtility.getSafeRegExp(chineseDateTime.ChineseDateTime.SeasonWithYear), + recognizersText.RegExpUtility.getSafeRegExp(chineseDateTime.ChineseDateTime.QuarterRegex), + ]; + this.datePointExtractor = new dateConfiguration$6.ChineseDateExtractor(); + this.integerExtractor = new recognizersTextNumber.ChineseIntegerExtractor(); + this.numberParser = new recognizersTextNumber.BaseNumberParser(new recognizersTextNumber.ChineseNumberParserConfiguration()); + this.illegalYearRegex = recognizersText.RegExpUtility.getSafeRegExp(baseDateTime.BaseDateTime.IllegalYearRegex); + this.tillRegex = recognizersText.RegExpUtility.getSafeRegExp(chineseDateTime.ChineseDateTime.DatePeriodTillRegex); + this.followedUnit = recognizersText.RegExpUtility.getSafeRegExp(chineseDateTime.ChineseDateTime.FollowedUnit); + this.numberCombinedWithUnit = recognizersText.RegExpUtility.getSafeRegExp(chineseDateTime.ChineseDateTime.NumberCombinedWithUnit); + this.pastRegex = recognizersText.RegExpUtility.getSafeRegExp(chineseDateTime.ChineseDateTime.PastRegex); + this.futureRegex = recognizersText.RegExpUtility.getSafeRegExp(chineseDateTime.ChineseDateTime.FutureRegex); + } + getFromTokenIndex(source) { + let result = { matched: false, index: -1 }; + if (source.endsWith("从")) { + result.index = source.lastIndexOf("从"); + result.matched = true; + } + return result; + } + ; + getBetweenTokenIndex(source) { + return { matched: false, index: -1 }; + } + ; + hasConnectorToken(source) { + return false; + } +} +class ChineseDatePeriodExtractor extends baseDatePeriod.BaseDatePeriodExtractor { + constructor() { + super(new ChineseDatePeriodExtractorConfiguration()); + } + extract(source, refDate) { + if (!refDate) + refDate = new Date(); + let tokens = new Array() + .concat(super.matchSimpleCases(source)) + .concat(super.mergeTwoTimePoints(source, refDate)) + .concat(this.matchNumberWithUnit(source)); + let result = utilities$2.Token.mergeAllTokens(tokens, source, this.extractorName); + return result; + } + matchNumberWithUnit(source) { + let tokens = new Array(); + let durations = new Array(); + this.config.integerExtractor.extract(source).forEach(er => { + let afterStr = source.substr(er.start + er.length); + let followedUnitMatch = recognizersText.RegExpUtility.getMatches(this.config.followedUnit, afterStr).pop(); + if (followedUnitMatch && followedUnitMatch.index === 0) { + durations.push(new utilities$2.Token(er.start, er.start + er.length + followedUnitMatch.length)); + } + }); + recognizersText.RegExpUtility.getMatches(this.config.numberCombinedWithUnit, source).forEach(match => { + durations.push(new utilities$2.Token(match.index, match.index + match.length)); + }); + durations.forEach(duration => { + let beforeStr = source.substr(0, duration.start).toLowerCase(); + if (recognizersText.StringUtility.isNullOrWhitespace(beforeStr)) { + return; + } + let match = recognizersText.RegExpUtility.getMatches(this.config.pastRegex, beforeStr).pop(); + if (match && recognizersText.StringUtility.isNullOrWhitespace(beforeStr.substr(match.index + match.length))) { + tokens.push(new utilities$2.Token(match.index, duration.end)); + return; + } + match = recognizersText.RegExpUtility.getMatches(this.config.futureRegex, beforeStr).pop(); + if (match && recognizersText.StringUtility.isNullOrWhitespace(beforeStr.substr(match.index + match.length))) { + tokens.push(new utilities$2.Token(match.index, duration.end)); + return; + } + }); + return tokens; + } +} +exports.ChineseDatePeriodExtractor = ChineseDatePeriodExtractor; +class ChineseDatePeriodParserConfiguration { + constructor() { + this.simpleCasesRegex = recognizersText.RegExpUtility.getSafeRegExp(chineseDateTime.ChineseDateTime.SimpleCasesRegex); + this.yearRegex = recognizersText.RegExpUtility.getSafeRegExp(chineseDateTime.ChineseDateTime.DatePeriodYearRegex); + this.seasonRegex = recognizersText.RegExpUtility.getSafeRegExp(chineseDateTime.ChineseDateTime.SeasonRegex); + this.seasonMap = chineseDateTime.ChineseDateTime.ParserConfigurationSeasonMap; + this.quarterRegex = recognizersText.RegExpUtility.getSafeRegExp(chineseDateTime.ChineseDateTime.QuarterRegex); + this.cardinalMap = chineseDateTime.ChineseDateTime.ParserConfigurationCardinalMap; + this.unitMap = chineseDateTime.ChineseDateTime.ParserConfigurationUnitMap; + this.durationExtractor = new durationConfiguration$6.ChineseDurationExtractor(); + this.pastRegex = recognizersText.RegExpUtility.getSafeRegExp(chineseDateTime.ChineseDateTime.PastRegex); + this.futureRegex = recognizersText.RegExpUtility.getSafeRegExp(chineseDateTime.ChineseDateTime.FutureRegex); + this.monthOfYear = chineseDateTime.ChineseDateTime.ParserConfigurationMonthOfYear; + this.dayOfMonth = chineseDateTime.ChineseDateTime.ParserConfigurationDayOfMonth; + this.monthOfYear = chineseDateTime.ChineseDateTime.ParserConfigurationMonthOfYear; + this.oneWordPeriodRegex = recognizersText.RegExpUtility.getSafeRegExp(chineseDateTime.ChineseDateTime.OneWordPeriodRegex); + this.dateExtractor = new dateConfiguration$6.ChineseDateExtractor(); + this.dateParser = new dateConfiguration$6.ChineseDateParser(); + this.tokenBeforeDate = 'on '; + this.weekOfMonthRegex = recognizersText.RegExpUtility.getSafeRegExp(chineseDateTime.ChineseDateTime.WeekOfMonthRegex); + this.thisPrefixRegex = recognizersText.RegExpUtility.getSafeRegExp(chineseDateTime.ChineseDateTime.DatePeriodThisRegex); + this.nextPrefixRegex = recognizersText.RegExpUtility.getSafeRegExp(chineseDateTime.ChineseDateTime.DatePeriodNextRegex); + this.pastPrefixRegex = recognizersText.RegExpUtility.getSafeRegExp(chineseDateTime.ChineseDateTime.DatePeriodLastRegex); + } + getSwiftDayOrMonth(source) { + let trimmedSource = source.trim().toLowerCase(); + if (trimmedSource.endsWith('去年')) { + return -1; + } + if (trimmedSource.endsWith('明年')) { + return 1; + } + if (trimmedSource.endsWith('前年')) { + return -2; + } + if (trimmedSource.endsWith('后年')) { + return 2; + } + if (trimmedSource.startsWith('下个')) { + return 1; + } + if (trimmedSource.startsWith('上个')) { + return -1; + } + if (recognizersText.RegExpUtility.isMatch(this.thisPrefixRegex, trimmedSource)) { + return 0; + } + if (recognizersText.RegExpUtility.isMatch(this.nextPrefixRegex, trimmedSource)) { + return 1; + } + if (recognizersText.RegExpUtility.isMatch(this.pastPrefixRegex, trimmedSource)) { + return -1; + } + return 0; + } + getSwiftYear(source) { + let trimmedSource = source.trim().toLowerCase(); + let swift = -10; + if (trimmedSource.startsWith('明年')) { + swift = 1; + } + else if (trimmedSource.startsWith('去年')) { + swift = -1; + } + else if (trimmedSource.startsWith('今年')) { + swift = 0; + } + return swift; + } + isFuture(source) { + return (recognizersText.RegExpUtility.isMatch(this.thisPrefixRegex, source) + || recognizersText.RegExpUtility.isMatch(this.nextPrefixRegex, source)); + } + isYearToDate(source) { + let trimmedSource = source.trim().toLowerCase(); + return trimmedSource === '今年'; + } + isMonthToDate(source) { + return false; + } + isWeekOnly(source) { + let trimmedSource = source.trim().toLowerCase(); + return trimmedSource.endsWith('周') || trimmedSource.endsWith('星期'); + } + isWeekend(source) { + let trimmedSource = source.trim().toLowerCase(); + return trimmedSource.endsWith('周末'); + } + isMonthOnly(source) { + let trimmedSource = source.trim().toLowerCase(); + return trimmedSource.endsWith('月'); + } + isYearOnly(source) { + let trimmedSource = source.trim().toLowerCase(); + return trimmedSource.endsWith('年'); + } + isLastCardinal(source) { + return source === '最后一'; + } +} +class ChineseDatePeriodParser extends baseDatePeriod.BaseDatePeriodParser { + constructor() { + let config = new ChineseDatePeriodParserConfiguration(); + super(config, false); + this.integerExtractor = new recognizersTextNumber.ChineseIntegerExtractor(); + this.numberParser = recognizersTextNumber.AgnosticNumberParserFactory.getParser(recognizersTextNumber.AgnosticNumberParserType.Integer, new recognizersTextNumber.ChineseNumberParserConfiguration()); + this.yearInChineseRegex = recognizersText.RegExpUtility.getSafeRegExp(chineseDateTime.ChineseDateTime.DatePeriodYearInChineseRegex); + this.numberCombinedWithUnitRegex = recognizersText.RegExpUtility.getSafeRegExp(chineseDateTime.ChineseDateTime.NumberCombinedWithUnit); + this.unitRegex = recognizersText.RegExpUtility.getSafeRegExp(chineseDateTime.ChineseDateTime.UnitRegex); + this.yearAndMonthRegex = recognizersText.RegExpUtility.getSafeRegExp(chineseDateTime.ChineseDateTime.YearAndMonth); + this.pureNumberYearAndMonthRegex = recognizersText.RegExpUtility.getSafeRegExp(chineseDateTime.ChineseDateTime.PureNumYearAndMonth); + this.yearToYearRegex = recognizersText.RegExpUtility.getSafeRegExp(chineseDateTime.ChineseDateTime.YearToYear); + this.YearToYearSuffixRequired = recognizersText.RegExpUtility.getSafeRegExp(chineseDateTime.ChineseDateTime.YearToYearSuffixRequired); + this.chineseYearRegex = recognizersText.RegExpUtility.getSafeRegExp(chineseDateTime.ChineseDateTime.DatePeriodYearInChineseRegex); + this.seasonWithYearRegex = recognizersText.RegExpUtility.getSafeRegExp(chineseDateTime.ChineseDateTime.SeasonWithYear); + } + parse(extractorResult, referenceDate) { + if (!referenceDate) + referenceDate = new Date(); + let resultValue; + if (extractorResult.type === this.parserName) { + let source = extractorResult.text.trim().toLowerCase(); + let innerResult = this.parseSimpleCases(source, referenceDate); + if (!innerResult.success) { + innerResult = this.parseOneWordPeriod(source, referenceDate); + } + if (!innerResult.success) { + innerResult = this.mergeTwoTimePoints(source, referenceDate); + } + if (!innerResult.success) { + innerResult = this.parseNumberWithUnit(source, referenceDate); + } + if (!innerResult.success) { + innerResult = this.parseDuration(source, referenceDate); + } + if (!innerResult.success) { + innerResult = this.parseYearAndMonth(source, referenceDate); + } + if (!innerResult.success) { + innerResult = this.parseYearToYear(source, referenceDate); + } + if (!innerResult.success) { + innerResult = this.parseYear(source, referenceDate); + } + if (!innerResult.success) { + innerResult = this.parseWeekOfMonth(source, referenceDate); + } + if (!innerResult.success) { + innerResult = this.parseSeason(source, referenceDate); + } + if (!innerResult.success) { + innerResult = this.parseQuarter(source, referenceDate); + } + if (innerResult.success) { + if (innerResult.futureValue && innerResult.pastValue) { + innerResult.futureResolution = {}; + innerResult.futureResolution[constants$2.TimeTypeConstants.START_DATE] = utilities$2.FormatUtil.formatDate(innerResult.futureValue[0]); + innerResult.futureResolution[constants$2.TimeTypeConstants.END_DATE] = utilities$2.FormatUtil.formatDate(innerResult.futureValue[1]); + innerResult.pastResolution = {}; + innerResult.pastResolution[constants$2.TimeTypeConstants.START_DATE] = utilities$2.FormatUtil.formatDate(innerResult.pastValue[0]); + innerResult.pastResolution[constants$2.TimeTypeConstants.END_DATE] = utilities$2.FormatUtil.formatDate(innerResult.pastValue[1]); + } + else { + innerResult.futureResolution = {}; + innerResult.pastResolution = {}; + } + resultValue = innerResult; + } + } + let result = new parsers$4.DateTimeParseResult(extractorResult); + result.value = resultValue; + result.timexStr = resultValue ? resultValue.timex : ''; + result.resolutionStr = ''; + return result; + } + getMatchSimpleCase(source) { + return recognizersText.RegExpUtility.getMatches(this.config.simpleCasesRegex, source).pop(); + } + parseSimpleCases(source, referenceDate) { + let result = new utilities$2.DateTimeResolutionResult(); + let year = referenceDate.getFullYear(); + let month = referenceDate.getMonth(); + let noYear = false; + let inputYear = false; + let match = this.getMatchSimpleCase(source); + if (!match || match.index !== 0 || match.length !== source.length) + return result; + let days = match.groups('day'); + let beginDay = this.config.dayOfMonth.get(days.captures[0]); + let endDay = this.config.dayOfMonth.get(days.captures[1]); + let monthStr = match.groups('month').value; + if (!recognizersText.StringUtility.isNullOrEmpty(monthStr)) { + month = this.config.monthOfYear.get(monthStr) - 1; + } + else { + monthStr = match.groups('relmonth').value; + month += this.config.getSwiftDayOrMonth(monthStr); + if (month < 0) { + month = 0; + year--; + } + else if (month > 11) { + month = 11; + year++; + } + } + let yearStr = match.groups('year').value; + if (!recognizersText.StringUtility.isNullOrEmpty(yearStr)) { + year = Number.parseInt(yearStr, 10); + inputYear = true; + } + else { + noYear = true; + } + let beginDateLuis = utilities$2.FormatUtil.luisDate(inputYear || this.config.isFuture(monthStr) ? year : -1, month, beginDay); + let endDateLuis = utilities$2.FormatUtil.luisDate(inputYear || this.config.isFuture(monthStr) ? year : -1, month, endDay); + let futureYear = year; + let pastYear = year; + let startDate = utilities$2.DateUtils.safeCreateFromValue(utilities$2.DateUtils.minValue(), year, month, beginDay); + if (noYear && startDate < referenceDate) + futureYear++; + if (noYear && startDate >= referenceDate) + pastYear--; + result.timex = `(${beginDateLuis},${endDateLuis},P${endDay - beginDay}D)`; + result.futureValue = [ + utilities$2.DateUtils.safeCreateFromValue(utilities$2.DateUtils.minValue(), futureYear, month, beginDay), + utilities$2.DateUtils.safeCreateFromValue(utilities$2.DateUtils.minValue(), futureYear, month, endDay), + ]; + result.pastValue = [ + utilities$2.DateUtils.safeCreateFromValue(utilities$2.DateUtils.minValue(), pastYear, month, beginDay), + utilities$2.DateUtils.safeCreateFromValue(utilities$2.DateUtils.minValue(), pastYear, month, endDay), + ]; + result.success = true; + return result; + } + parseYear(source, referenceDate) { + let trimmedSource = source.trim(); + let result = new utilities$2.DateTimeResolutionResult(); + let isChinese = false; + let match = recognizersText.RegExpUtility.getMatches(this.config.yearRegex, trimmedSource).pop(); + if (!match || match.length !== trimmedSource.length) { + match = recognizersText.RegExpUtility.getMatches(this.yearInChineseRegex, trimmedSource).pop(); + isChinese = (match && match.length === trimmedSource.length); + } + if (!match || match.length !== trimmedSource.length) { + return result; + } + let yearStr = match.value; + if (this.config.isYearOnly(yearStr)) { + yearStr = yearStr.substr(0, yearStr.length - 1).trim(); + } + let year = this.convertYear(yearStr, isChinese); + if (yearStr.length === 2) { + if (year < 100 && year >= 30) { + year += 1900; + } + else if (year < 30) { + year += 2000; + } + } + let beginDay = utilities$2.DateUtils.safeCreateFromMinValue(year, 0, 1); + let endDay = utilities$2.DateUtils.safeCreateFromMinValue(year + 1, 0, 1); + result.timex = utilities$2.FormatUtil.toString(year, 4); + result.futureValue = [beginDay, endDay]; + result.pastValue = [beginDay, endDay]; + result.success = true; + return result; + } + convertYear(yearStr, isChinese) { + let year = -1; + let er; + if (isChinese) { + let yearNum = 0; + er = this.integerExtractor.extract(yearStr).pop(); + if (er && er.type === recognizers_text_number_2.Constants.SYS_NUM_INTEGER) { + yearNum = Number.parseInt(this.numberParser.parse(er).value); + } + if (yearNum < 10) { + yearNum = 0; + for (let index = 0; index < yearStr.length; index++) { + let char = yearStr.charAt(index); + yearNum *= 10; + er = this.integerExtractor.extract(char).pop(); + if (er && er.type === recognizers_text_number_2.Constants.SYS_NUM_INTEGER) { + yearNum += Number.parseInt(this.numberParser.parse(er).value); + } + } + year = yearNum; + } + else { + year = yearNum; + } + } + else { + year = Number.parseInt(yearStr, 10); + } + return year === 0 ? -1 : year; + } + getWeekOfMonth(cardinal, month, year, referenceDate, noYear) { + let result = new utilities$2.DateTimeResolutionResult(); + let seedDate = this.computeDate(cardinal, 1, month, year); + let futureDate = new Date(seedDate); + let pastDate = new Date(seedDate); + if (noYear && futureDate < referenceDate) { + futureDate = this.computeDate(cardinal, 1, month, year + 1); + if (futureDate.getMonth() !== month) { + futureDate.setDate(futureDate.getDate() - 7); + } + } + if (noYear && pastDate >= referenceDate) { + pastDate = this.computeDate(cardinal, 1, month, year - 1); + if (pastDate.getMonth() !== month) { + pastDate.setDate(pastDate.getDate() - 7); + } + } + result.timex = noYear ? + `XXXX-${utilities$2.FormatUtil.toString(month + 1, 2)}-W${utilities$2.FormatUtil.toString(cardinal, 2)}` : + `${utilities$2.FormatUtil.toString(year, 4)}-${utilities$2.FormatUtil.toString(month + 1, 2)}-W${utilities$2.FormatUtil.toString(cardinal, 2)}`; + result.futureValue = [futureDate, utilities$2.DateUtils.addDays(futureDate, this.inclusiveEndPeriod ? 6 : 7)]; + result.pastValue = [pastDate, utilities$2.DateUtils.addDays(pastDate, this.inclusiveEndPeriod ? 6 : 7)]; + result.success = true; + return result; + } + computeDate(cardinal, weekday, month, year) { + let firstDay = new Date(year, month, 1); + let firstWeekday = utilities$2.DateUtils.this(firstDay, weekday); + if (weekday === 0) + weekday = 7; + if (weekday < firstDay.getDay()) + firstWeekday = utilities$2.DateUtils.next(firstDay, weekday); + firstWeekday.setDate(firstWeekday.getDate() + (7 * (cardinal - 1))); + return firstWeekday; + } + parseSeason(source, referenceDate) { + let result = new utilities$2.DateTimeResolutionResult(); + let match = recognizersText.RegExpUtility.getMatches(this.seasonWithYearRegex, source).pop(); + if (!match || match.length !== source.length) + return result; + let year = referenceDate.getFullYear(); + let yearNum = match.groups('year').value; + let yearChinese = match.groups('yearchs').value; + let yearRelative = match.groups('yearrel').value; + let hasYear = false; + if (!recognizersText.StringUtility.isNullOrEmpty(yearNum)) { + hasYear = true; + if (this.config.isYearOnly(yearNum)) { + yearNum = yearNum.substr(0, yearNum.length - 1); + } + year = this.convertYear(yearNum, false); + } + else if (!recognizersText.StringUtility.isNullOrEmpty(yearChinese)) { + hasYear = true; + if (this.config.isYearOnly(yearChinese)) { + yearChinese = yearChinese.substr(0, yearChinese.length - 1); + } + year = this.convertYear(yearChinese, true); + } + else if (!recognizersText.StringUtility.isNullOrEmpty(yearRelative)) { + hasYear = true; + year += this.config.getSwiftDayOrMonth(yearRelative); + } + if (year < 100 && year >= 90) { + year += 1900; + } + else if (year < 100 && year < 20) { + year += 2000; + } + let seasonStr = match.groups('season').value; + let season = this.config.seasonMap.get(seasonStr); + if (hasYear) { + result.timex = `${utilities$2.FormatUtil.toString(year, 4)}-${season}`; + } + result.success = true; + return result; + } + parseQuarter(source, referenceDate) { + let result = new utilities$2.DateTimeResolutionResult(); + let match = recognizersText.RegExpUtility.getMatches(this.config.quarterRegex, source).pop(); + if (!match || match.length !== source.length) + return result; + let year = referenceDate.getFullYear(); + let yearNum = match.groups('year').value; + let yearChinese = match.groups('yearchs').value; + let yearRelative = match.groups('yearrel').value; + if (!recognizersText.StringUtility.isNullOrEmpty(yearNum)) { + if (this.config.isYearOnly(yearNum)) { + yearNum = yearNum.substr(0, yearNum.length - 1); + } + year = this.convertYear(yearNum, false); + } + else if (!recognizersText.StringUtility.isNullOrEmpty(yearChinese)) { + if (this.config.isYearOnly(yearChinese)) { + yearChinese = yearChinese.substr(0, yearChinese.length - 1); + } + year = this.convertYear(yearChinese, true); + } + else if (!recognizersText.StringUtility.isNullOrEmpty(yearRelative)) { + year += this.config.getSwiftDayOrMonth(yearRelative); + } + if (year < 100 && year >= 90) { + year += 1900; + } + else if (year < 100 && year < 20) { + year += 2000; + } + let cardinalStr = match.groups('cardinal').value; + let quarterNum = this.config.cardinalMap.get(cardinalStr); + let beginDate = utilities$2.DateUtils.safeCreateFromValue(utilities$2.DateUtils.minValue(), year, quarterNum * 3 - 3, 1); + let endDate = utilities$2.DateUtils.safeCreateFromValue(utilities$2.DateUtils.minValue(), year, quarterNum * 3, 1); + result.futureValue = [beginDate, endDate]; + result.pastValue = [beginDate, endDate]; + result.timex = `(${utilities$2.FormatUtil.luisDateFromDate(beginDate)},${utilities$2.FormatUtil.luisDateFromDate(endDate)},P3M)`; + result.success = true; + return result; + } + parseNumberWithUnit(source, referenceDate) { + let result = new utilities$2.DateTimeResolutionResult(); + // if there are NO spaces between number and unit + let match = recognizersText.RegExpUtility.getMatches(this.numberCombinedWithUnitRegex, source).pop(); + if (!match) + return result; + let sourceUnit = match.groups('unit').value.trim().toLowerCase(); + if (!this.config.unitMap.has(sourceUnit)) + return result; + let numStr = match.groups('num').value; + let beforeStr = source.substr(0, match.index).trim().toLowerCase(); + return this.parseCommonDurationWithUnit(beforeStr, sourceUnit, numStr, referenceDate); + } + parseDuration(source, referenceDate) { + let result = new utilities$2.DateTimeResolutionResult(); + // for case "前两年" "后三年" + let durationResult = this.config.durationExtractor.extract(source, referenceDate).pop(); + if (!durationResult) + return result; + let match = recognizersText.RegExpUtility.getMatches(this.unitRegex, durationResult.text).pop(); + if (!match) + return result; + let sourceUnit = match.groups('unit').value.trim().toLowerCase(); + if (!this.config.unitMap.has(sourceUnit)) + return result; + let beforeStr = source.substr(0, durationResult.start).trim().toLowerCase(); + let numberStr = durationResult.text.substr(0, match.index).trim().toLowerCase(); + let numberValue = this.convertChineseToNumber(numberStr); + let numStr = numberValue.toString(); + return this.parseCommonDurationWithUnit(beforeStr, sourceUnit, numStr, referenceDate); + } + parseCommonDurationWithUnit(beforeStr, sourceUnit, numStr, referenceDate) { + let result = new utilities$2.DateTimeResolutionResult(); + let unitStr = this.config.unitMap.get(sourceUnit); + let pastMatch = recognizersText.RegExpUtility.getMatches(this.config.pastRegex, beforeStr).pop(); + let hasPast = pastMatch && pastMatch.length === beforeStr.length; + let futureMatch = recognizersText.RegExpUtility.getMatches(this.config.futureRegex, beforeStr).pop(); + let hasFuture = futureMatch && futureMatch.length === beforeStr.length; + if (!hasFuture && !hasPast) { + return result; + } + let beginDate = new Date(referenceDate); + let endDate = new Date(referenceDate); + let difference = Number.parseFloat(numStr); + switch (unitStr) { + case 'D': + beginDate = hasPast ? utilities$2.DateUtils.addDays(referenceDate, -difference) : beginDate; + endDate = hasFuture ? utilities$2.DateUtils.addDays(referenceDate, difference) : endDate; + break; + case 'W': + beginDate = hasPast ? utilities$2.DateUtils.addDays(referenceDate, -7 * difference) : beginDate; + endDate = hasFuture ? utilities$2.DateUtils.addDays(referenceDate, 7 * difference) : endDate; + break; + case 'MON': + beginDate = hasPast ? utilities$2.DateUtils.addMonths(referenceDate, -Math.round(difference)) : beginDate; + endDate = hasFuture ? utilities$2.DateUtils.addMonths(referenceDate, Math.round(difference)) : endDate; + break; + case 'Y': + beginDate = hasPast ? utilities$2.DateUtils.addYears(referenceDate, -Math.round(difference)) : beginDate; + endDate = hasFuture ? utilities$2.DateUtils.addYears(referenceDate, Math.round(difference)) : endDate; + break; + default: return result; + } + if (hasFuture) { + beginDate = utilities$2.DateUtils.addDays(beginDate, 1); + endDate = utilities$2.DateUtils.addDays(endDate, 1); + } + let beginTimex = utilities$2.FormatUtil.luisDateFromDate(beginDate); + let endTimex = utilities$2.FormatUtil.luisDateFromDate(endDate); + result.timex = `(${beginTimex},${endTimex},P${numStr}${unitStr.charAt(0)})`; + result.futureValue = [beginDate, endDate]; + result.pastValue = [beginDate, endDate]; + result.success = true; + return result; + } + convertChineseToNumber(source) { + let num = -1; + let er = this.integerExtractor.extract(source).pop(); + if (er && er.type === recognizers_text_number_2.Constants.SYS_NUM_INTEGER) { + num = Number.parseInt(this.numberParser.parse(er).value); + } + return num; + } + parseYearAndMonth(source, referenceDate) { + let result = new utilities$2.DateTimeResolutionResult(); + let match = recognizersText.RegExpUtility.getMatches(this.yearAndMonthRegex, source).pop(); + if (!match || match.length !== source.length) { + match = recognizersText.RegExpUtility.getMatches(this.pureNumberYearAndMonthRegex, source).pop(); + } + if (!match || match.length !== source.length) { + return result; + } + // parse year + let year = referenceDate.getFullYear(); + let yearNum = match.groups('year').value; + let yearChinese = match.groups('yearchs').value; + let yearRelative = match.groups('yearrel').value; + if (!recognizersText.StringUtility.isNullOrEmpty(yearNum)) { + if (this.config.isYearOnly(yearNum)) { + yearNum = yearNum.substr(0, yearNum.length - 1); + } + year = this.convertYear(yearNum, false); + } + else if (!recognizersText.StringUtility.isNullOrEmpty(yearChinese)) { + if (this.config.isYearOnly(yearChinese)) { + yearChinese = yearChinese.substr(0, yearChinese.length - 1); + } + year = this.convertYear(yearChinese, true); + } + else if (!recognizersText.StringUtility.isNullOrEmpty(yearRelative)) { + year += this.config.getSwiftDayOrMonth(yearRelative); + } + if (year < 100 && year >= 90) { + year += 1900; + } + else if (year < 100 && year < 20) { + year += 2000; + } + let monthStr = match.groups('month').value.toLowerCase(); + let month = (this.config.monthOfYear.get(monthStr) % 12) - 1; + let beginDate = utilities$2.DateUtils.safeCreateFromMinValue(year, month, 1); + let endDate = month === 11 + ? utilities$2.DateUtils.safeCreateFromMinValue(year + 1, 0, 1) + : utilities$2.DateUtils.safeCreateFromMinValue(year, month + 1, 1); + result.timex = utilities$2.FormatUtil.toString(year, 4) + '-' + utilities$2.FormatUtil.toString(month, 2); + result.futureValue = [beginDate, endDate]; + result.pastValue = [beginDate, endDate]; + result.success = true; + return result; + } + parseYearToYear(source, referenceDate) { + let result = new utilities$2.DateTimeResolutionResult(); + let match = recognizersText.RegExpUtility.getMatches(this.yearToYearRegex, source).pop(); + if (!match) { + let match = recognizersText.RegExpUtility.getMatches(this.YearToYearSuffixRequired, source).pop(); + if (!match) { + return result; + } + } + let yearMatches = recognizersText.RegExpUtility.getMatches(this.config.yearRegex, source); + let chineseYearMatches = recognizersText.RegExpUtility.getMatches(this.chineseYearRegex, source); + let beginYear = 0; + let endYear = 0; + if (yearMatches.length === 2) { + beginYear = this.convertChineseToNumber(yearMatches[0].groups('year').value); + endYear = this.convertChineseToNumber(yearMatches[1].groups('year').value); + } + else if (chineseYearMatches.length === 2) { + beginYear = this.convertYear(chineseYearMatches[0].groups('yearchs').value, true); + endYear = this.convertYear(chineseYearMatches[1].groups('yearchs').value, true); + } + else if (yearMatches.length === 1 && chineseYearMatches.length === 1) { + if (yearMatches[0].index < chineseYearMatches[0].index) { + beginYear = this.convertChineseToNumber(yearMatches[0].groups('year').value); + endYear = this.convertChineseToNumber(chineseYearMatches[0].groups('yearchs').value); + } + else { + beginYear = this.convertChineseToNumber(chineseYearMatches[0].groups('yearchs').value); + endYear = this.convertChineseToNumber(yearMatches[0].groups('year').value); + } + } + beginYear = this.sanitizeYear(beginYear); + endYear = this.sanitizeYear(endYear); + let beginDate = utilities$2.DateUtils.safeCreateFromMinValue(beginYear, 0, 1); + let endDate = utilities$2.DateUtils.safeCreateFromMinValue(endYear, 0, 1); + let beginTimex = utilities$2.FormatUtil.luisDateFromDate(beginDate); + let endTimex = utilities$2.FormatUtil.luisDateFromDate(endDate); + result.timex = `(${beginTimex},${endTimex},P${endYear - beginYear}Y)`; + result.futureValue = [beginDate, endDate]; + result.pastValue = [beginDate, endDate]; + result.success = true; + return result; + } + sanitizeYear(year) { + let result = year; + if (year < 100 && year >= 90) { + result += 1900; + } + else if (year < 100 && year < 20) { + result += 2000; + } + return result; + } +} +exports.ChineseDatePeriodParser = ChineseDatePeriodParser; + +}); + +unwrapExports(datePeriodConfiguration$6); + +var dateTimePeriodConfiguration$6 = createCommonjsModule(function (module, exports) { +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); + + + + + + + + + + + +class ChineseDateTimePeriodExtractorConfiguration { + getFromTokenIndex(source) { + let result = { matched: false, index: -1 }; + if (source.endsWith("从")) { + result.index = source.lastIndexOf("从"); + result.matched = true; + } + return result; + } + ; + getBetweenTokenIndex(source) { + return { matched: false, index: -1 }; + } + ; + hasConnectorToken(source) { + return (source === '和' || source === ' 与' || source === '到'); + } + ; + constructor() { + this.singleDateExtractor = new dateConfiguration$6.ChineseDateExtractor(); + this.singleTimeExtractor = new timeConfiguration$6.ChineseTimeExtractor(); + this.singleDateTimeExtractor = new dateTimeConfiguration$6.ChineseDateTimeExtractor(); + this.prepositionRegex = recognizersText.RegExpUtility.getSafeRegExp(chineseDateTime.ChineseDateTime.DateTimePeriodPrepositionRegex); + this.tillRegex = recognizersText.RegExpUtility.getSafeRegExp(chineseDateTime.ChineseDateTime.DateTimePeriodTillRegex); + this.cardinalExtractor = new recognizersTextNumber.ChineseCardinalExtractor(); + this.followedUnit = recognizersText.RegExpUtility.getSafeRegExp(chineseDateTime.ChineseDateTime.DateTimePeriodFollowedUnit); + this.timeUnitRegex = recognizersText.RegExpUtility.getSafeRegExp(chineseDateTime.ChineseDateTime.DateTimePeriodUnitRegex); + this.specificTimeOfDayRegex = recognizersText.RegExpUtility.getSafeRegExp(chineseDateTime.ChineseDateTime.SpecificTimeOfDayRegex); + this.timeOfDayRegex = recognizersText.RegExpUtility.getSafeRegExp(chineseDateTime.ChineseDateTime.TimeOfDayRegex); + } +} +class ChineseDateTimePeriodExtractor extends baseDateTimePeriod.BaseDateTimePeriodExtractor { + constructor() { + super(new ChineseDateTimePeriodExtractorConfiguration()); + this.zhijianRegex = recognizersText.RegExpUtility.getSafeRegExp(chineseDateTime.ChineseDateTime.ZhijianRegex); + this.pastRegex = recognizersText.RegExpUtility.getSafeRegExp(chineseDateTime.ChineseDateTime.PastRegex); + this.futureRegex = recognizersText.RegExpUtility.getSafeRegExp(chineseDateTime.ChineseDateTime.FutureRegex); + } + extract(source, refDate) { + if (!refDate) + refDate = new Date(); + let referenceDate = refDate; + let tokens = new Array() + .concat(this.mergeDateAndTimePeriod(source, referenceDate)) + .concat(this.mergeTwoTimePoints(source, referenceDate)) + .concat(this.matchNubmerWithUnit(source)) + .concat(this.matchNight(source, referenceDate)); + let result = utilities$2.Token.mergeAllTokens(tokens, source, this.extractorName); + return result; + } + mergeDateAndTimePeriod(source, refDate) { + let tokens = new Array(); + let ersDate = this.config.singleDateExtractor.extract(source, refDate); + let ersTime = this.config.singleTimeExtractor.extract(source, refDate); + let timeResults = new Array(); + let j = 0; + for (let i = 0; i < ersDate.length; i++) { + timeResults.push(ersDate[i]); + while (j < ersTime.length && ersTime[j].start + ersTime[j].length <= ersDate[i].start) { + timeResults.push(ersTime[j]); + j++; + } + while (j < ersTime.length && recognizersText.ExtractResult.isOverlap(ersTime[j], ersDate[i])) { + j++; + } + } + for (j; j < ersTime.length; j++) { + timeResults.push(ersTime[j]); + } + timeResults = timeResults.sort((a, b) => a.start > b.start ? 1 : a.start < b.start ? -1 : 0); + let idx = 0; + while (idx < timeResults.length - 1) { + let current = timeResults[idx]; + let next = timeResults[idx + 1]; + if (current.type === constants$2.Constants.SYS_DATETIME_DATE && next.type === constants$2.Constants.SYS_DATETIME_TIMEPERIOD) { + let middleBegin = current.start + current.length; + let middleEnd = next.start; + let middleStr = source.substring(middleBegin, middleEnd).trim(); + if (recognizersText.StringUtility.isNullOrWhitespace(middleStr) || recognizersText.RegExpUtility.isMatch(this.config.prepositionRegex, middleStr)) { + let periodBegin = current.start; + let periodEnd = next.start + next.length; + tokens.push(new utilities$2.Token(periodBegin, periodEnd)); + } + idx++; + } + idx++; + } + return tokens; + } + mergeTwoTimePoints(source, refDate) { + let tokens = new Array(); + let ersDateTime = this.config.singleDateTimeExtractor.extract(source, refDate); + let ersTime = this.config.singleTimeExtractor.extract(source, refDate); + let innerMarks = []; + let j = 0; + ersDateTime.forEach((erDateTime, index) => { + innerMarks.push(erDateTime); + while (j < ersTime.length && ersTime[j].start + ersTime[j].length < erDateTime.start) { + innerMarks.push(ersTime[j++]); + } + while (j < ersTime.length && recognizersText.ExtractResult.isOverlap(ersTime[j], erDateTime)) { + j++; + } + }); + while (j < ersTime.length) { + innerMarks.push(ersTime[j++]); + } + innerMarks = innerMarks.sort((erA, erB) => erA.start < erB.start ? -1 : erA.start === erB.start ? 0 : 1); + let idx = 0; + while (idx < innerMarks.length - 1) { + let currentMark = innerMarks[idx]; + let nextMark = innerMarks[idx + 1]; + if (currentMark.type === constants$2.Constants.SYS_DATETIME_TIME && nextMark.type === constants$2.Constants.SYS_DATETIME_TIME) { + idx++; + continue; + } + let middleBegin = currentMark.start + currentMark.length; + let middleEnd = nextMark.start; + let middleStr = source.substr(middleBegin, middleEnd - middleBegin).trim().toLowerCase(); + let matches = recognizersText.RegExpUtility.getMatches(this.config.tillRegex, middleStr); + if (matches && matches.length > 0 && matches[0].index === 0 && matches[0].length === middleStr.length) { + let periodBegin = currentMark.start; + let periodEnd = nextMark.start + nextMark.length; + let beforeStr = source.substr(0, periodBegin).trim().toLowerCase(); + let fromTokenIndex = this.config.getFromTokenIndex(beforeStr); + if (fromTokenIndex.matched) { + periodBegin = fromTokenIndex.index; + } + tokens.push(new utilities$2.Token(periodBegin, periodEnd)); + idx += 2; + continue; + } + if (this.config.hasConnectorToken(middleStr)) { + let periodBegin = currentMark.start; + let periodEnd = nextMark.start + nextMark.length; + let afterStr = source.substr(periodEnd).trim().toLowerCase(); + let match = recognizersText.RegExpUtility.getMatches(this.zhijianRegex, afterStr).pop(); + if (match) { + tokens.push(new utilities$2.Token(periodBegin, periodEnd + match.length)); + idx += 2; + continue; + } + } + idx++; + } + + return tokens; + } + matchNubmerWithUnit(source) { + let tokens = new Array(); + let durations = new Array(); + this.config.cardinalExtractor.extract(source).forEach(er => { + let afterStr = source.substr(er.start + er.length); + let followedUnitMatch = recognizersText.RegExpUtility.getMatches(this.config.followedUnit, afterStr).pop(); + if (followedUnitMatch && followedUnitMatch.index === 0) { + durations.push(new utilities$2.Token(er.start, er.start + er.length + followedUnitMatch.length)); + } + }); + recognizersText.RegExpUtility.getMatches(this.config.timeUnitRegex, source).forEach(match => { + durations.push(new utilities$2.Token(match.index, match.index + match.length)); + }); + durations.forEach(duration => { + let beforeStr = source.substr(0, duration.start).toLowerCase(); + if (recognizersText.StringUtility.isNullOrWhitespace(beforeStr)) { + return; + } + let match = recognizersText.RegExpUtility.getMatches(this.pastRegex, beforeStr).pop(); + if (match && recognizersText.StringUtility.isNullOrWhitespace(beforeStr.substr(match.index + match.length))) { + tokens.push(new utilities$2.Token(match.index, duration.end)); + return; + } + match = recognizersText.RegExpUtility.getMatches(this.futureRegex, beforeStr).pop(); + if (match && recognizersText.StringUtility.isNullOrWhitespace(beforeStr.substr(match.index + match.length))) { + tokens.push(new utilities$2.Token(match.index, duration.end)); + return; + } + }); + return tokens; + } + matchNight(source, refDate) { + let tokens = new Array(); + recognizersText.RegExpUtility.getMatches(this.config.specificTimeOfDayRegex, source).forEach(match => { + tokens.push(new utilities$2.Token(match.index, match.index + match.length)); + }); + this.config.singleDateExtractor.extract(source, refDate).forEach(er => { + let afterStr = source.substr(er.start + er.length); + let match = recognizersText.RegExpUtility.getMatches(this.config.timeOfDayRegex, afterStr).pop(); + if (match) { + let middleStr = source.substr(0, match.index); + if (recognizersText.StringUtility.isNullOrWhitespace(middleStr) || recognizersText.RegExpUtility.isMatch(this.config.prepositionRegex, middleStr)) { + tokens.push(new utilities$2.Token(er.start, er.start + er.length + match.index + match.length)); + } + } + }); + return tokens; + } +} +exports.ChineseDateTimePeriodExtractor = ChineseDateTimePeriodExtractor; +class ChineseDateTimePeriodParserConfiguration { + constructor() { + this.dateExtractor = new dateConfiguration$6.ChineseDateExtractor(); + this.timeExtractor = new timeConfiguration$6.ChineseTimeExtractor(); + this.dateTimeExtractor = new dateTimeConfiguration$6.ChineseDateTimeExtractor(); + this.timePeriodExtractor = new timePeriodConfiguration$6.ChineseTimePeriodExtractor(); + this.dateParser = new dateConfiguration$6.ChineseDateParser(); + this.timeParser = new timeConfiguration$6.ChineseTimeParser(); + this.dateTimeParser = new dateTimeConfiguration$6.ChineseDateTimeParser(); + this.timePeriodParser = new timePeriodConfiguration$6.ChineseTimePeriodParser(); + this.specificTimeOfDayRegex = recognizersText.RegExpUtility.getSafeRegExp(chineseDateTime.ChineseDateTime.SpecificTimeOfDayRegex); + this.relativeTimeUnitRegex = recognizersText.RegExpUtility.getSafeRegExp(chineseDateTime.ChineseDateTime.TimeOfDayRegex); + this.pastRegex = recognizersText.RegExpUtility.getSafeRegExp(chineseDateTime.ChineseDateTime.PastRegex); + this.futureRegex = recognizersText.RegExpUtility.getSafeRegExp(chineseDateTime.ChineseDateTime.FutureRegex); + this.unitMap = chineseDateTime.ChineseDateTime.ParserConfigurationUnitMap; + } + getMatchedTimeRange(source) { + let swift = 0; + let beginHour = 0; + let endHour = 0; + let endMin = 0; + let timeStr = ''; + switch (source) { + case '今晚': + swift = 0; + timeStr = 'TEV'; + beginHour = 16; + endHour = 20; + break; + case '今早': + case '今晨': + swift = 0; + timeStr = 'TMO'; + beginHour = 8; + endHour = 12; + break; + case '明晚': + swift = 1; + timeStr = 'TEV'; + beginHour = 16; + endHour = 20; + break; + case '明早': + case '明晨': + swift = 1; + timeStr = 'TMO'; + beginHour = 8; + endHour = 12; + break; + case '昨晚': + swift = -1; + timeStr = 'TEV'; + beginHour = 16; + endHour = 20; + break; + default: + return { + timeStr: '', + beginHour: 0, + endHour: 0, + endMin: 0, + swift: 0, + success: false + }; + } + return { + timeStr: timeStr, + beginHour: beginHour, + endHour: endHour, + endMin: endMin, + swift: swift, + success: true + }; + } + getSwiftPrefix(source) { + return null; + } +} +class ChineseDateTimePeriodParser extends baseDateTimePeriod.BaseDateTimePeriodParser { + constructor() { + let config = new ChineseDateTimePeriodParserConfiguration(); + super(config); + this.TMORegex = recognizersText.RegExpUtility.getSafeRegExp(chineseDateTime.ChineseDateTime.DateTimePeriodMORegex); + this.TAFRegex = recognizersText.RegExpUtility.getSafeRegExp(chineseDateTime.ChineseDateTime.DateTimePeriodAFRegex); + this.TEVRegex = recognizersText.RegExpUtility.getSafeRegExp(chineseDateTime.ChineseDateTime.DateTimePeriodEVRegex); + this.TNIRegex = recognizersText.RegExpUtility.getSafeRegExp(chineseDateTime.ChineseDateTime.DateTimePeriodNIRegex); + this.unitRegex = recognizersText.RegExpUtility.getSafeRegExp(chineseDateTime.ChineseDateTime.DateTimePeriodUnitRegex); + this.timeOfDayRegex = recognizersText.RegExpUtility.getSafeRegExp(chineseDateTime.ChineseDateTime.TimeOfDayRegex); + this.cardinalExtractor = new recognizersTextNumber.ChineseCardinalExtractor(); + this.cardinalParser = recognizersTextNumber.AgnosticNumberParserFactory.getParser(recognizersTextNumber.AgnosticNumberParserType.Cardinal, new recognizersTextNumber.ChineseNumberParserConfiguration()); + } + parse(extractorResult, referenceDate) { + if (!referenceDate) + referenceDate = new Date(); + let resultValue; + if (extractorResult.type === this.parserName) { + let source = extractorResult.text.trim().toLowerCase(); + let innerResult = this.mergeDateAndTimePeriods(source, referenceDate); + if (!innerResult.success) { + innerResult = this.mergeTwoTimePoints(source, referenceDate); + } + if (!innerResult.success) { + innerResult = this.parseSpecificTimeOfDay(source, referenceDate); + } + if (!innerResult.success) { + innerResult = this.parseNumberWithUnit(source, referenceDate); + } + if (innerResult.success) { + innerResult.futureResolution = {}; + innerResult.futureResolution[constants$2.TimeTypeConstants.START_DATETIME] = utilities$2.FormatUtil.formatDateTime(innerResult.futureValue[0]); + innerResult.futureResolution[constants$2.TimeTypeConstants.END_DATETIME] = utilities$2.FormatUtil.formatDateTime(innerResult.futureValue[1]); + innerResult.pastResolution = {}; + innerResult.pastResolution[constants$2.TimeTypeConstants.START_DATETIME] = utilities$2.FormatUtil.formatDateTime(innerResult.pastValue[0]); + innerResult.pastResolution[constants$2.TimeTypeConstants.END_DATETIME] = utilities$2.FormatUtil.formatDateTime(innerResult.pastValue[1]); + resultValue = innerResult; + } + } + let result = new parsers$4.DateTimeParseResult(extractorResult); + result.value = resultValue; + result.timexStr = resultValue ? resultValue.timex : ''; + result.resolutionStr = ''; + return result; + } + mergeDateAndTimePeriods(text, referenceTime) { + let result = new utilities$2.DateTimeResolutionResult(); + let erDate = this.config.dateExtractor.extract(text, referenceTime).pop(); + let erTimePeriod = this.config.timePeriodExtractor.extract(text, referenceTime).pop(); + if (!erDate || !erTimePeriod) + return result; + let prDate = this.config.dateParser.parse(erDate, referenceTime); + let prTimePeriod = this.config.timePeriodParser.parse(erTimePeriod, referenceTime); + let split = prTimePeriod.timexStr.split('T'); + if (split.length !== 4) { + return result; + } + let beginTime = prTimePeriod.value.futureValue.item1; + let endTime = prTimePeriod.value.futureValue.item2; + let futureDate = prDate.value.futureValue; + let pastDate = prDate.value.pastValue; + result.futureValue = [ + utilities$2.DateUtils.safeCreateFromMinValueWithDateAndTime(futureDate, beginTime), + utilities$2.DateUtils.safeCreateFromMinValueWithDateAndTime(futureDate, endTime) + ]; + result.pastValue = [ + utilities$2.DateUtils.safeCreateFromMinValueWithDateAndTime(pastDate, beginTime), + utilities$2.DateUtils.safeCreateFromMinValueWithDateAndTime(pastDate, endTime) + ]; + let dateTimex = prDate.timexStr; + result.timex = `${split[0]}${dateTimex}T${split[1]}${dateTimex}T${split[2]}T${split[3]}`; + result.success = true; + return result; + } + mergeTwoTimePoints(text, referenceTime) { + let result = new utilities$2.DateTimeResolutionResult(); + let prs; + let timeErs = this.config.timeExtractor.extract(text, referenceTime); + let datetimeErs = this.config.dateTimeExtractor.extract(text, referenceTime); + let bothHasDate = false; + let beginHasDate = false; + let endHasDate = false; + if (datetimeErs.length === 2) { + prs = this.getTwoPoints(datetimeErs[0], datetimeErs[1], this.config.dateTimeParser, this.config.dateTimeParser, referenceTime); + bothHasDate = true; + } + else if (datetimeErs.length === 1 && timeErs.length === 2) { + if (recognizersText.ExtractResult.isOverlap(datetimeErs[0], timeErs[0])) { + prs = this.getTwoPoints(datetimeErs[0], timeErs[1], this.config.dateTimeParser, this.config.timeParser, referenceTime); + beginHasDate = true; + } + else { + prs = this.getTwoPoints(timeErs[0], datetimeErs[0], this.config.timeParser, this.config.dateTimeParser, referenceTime); + endHasDate = true; + } + } + else if (datetimeErs.length === 1 && timeErs.length === 1) { + if (timeErs[0].start < datetimeErs[0].start) { + prs = this.getTwoPoints(timeErs[0], datetimeErs[0], this.config.timeParser, this.config.dateTimeParser, referenceTime); + endHasDate = true; + } + else { + prs = this.getTwoPoints(datetimeErs[0], timeErs[0], this.config.dateTimeParser, this.config.timeParser, referenceTime); + beginHasDate = true; + } + } + if (!prs || !prs.begin.value || !prs.end.value) + return result; + let futureBegin = prs.begin.value.futureValue; + let futureEnd = prs.end.value.futureValue; + let pastBegin = prs.begin.value.pastValue; + let pastEnd = prs.end.value.pastValue; + if (futureBegin.getTime() > futureEnd.getTime()) + futureBegin = pastBegin; + if (pastEnd.getTime() < pastBegin.getTime()) + pastEnd = futureEnd; + let rightTime = utilities$2.DateUtils.safeCreateFromMinValueWithDateAndTime(referenceTime); + let leftTime = utilities$2.DateUtils.safeCreateFromMinValueWithDateAndTime(referenceTime); + if (bothHasDate) { + rightTime = utilities$2.DateUtils.safeCreateFromMinValueWithDateAndTime(futureEnd); + leftTime = utilities$2.DateUtils.safeCreateFromMinValueWithDateAndTime(futureBegin); + } + else if (beginHasDate) { + // TODO: Handle "明天下午两点到五点" + futureEnd = utilities$2.DateUtils.safeCreateFromMinValueWithDateAndTime(futureBegin, futureEnd); + pastEnd = utilities$2.DateUtils.safeCreateFromMinValueWithDateAndTime(pastBegin, pastEnd); + leftTime = utilities$2.DateUtils.safeCreateFromMinValueWithDateAndTime(futureBegin); + } + else if (endHasDate) { + // TODO: Handle "明天下午两点到五点" + futureBegin = utilities$2.DateUtils.safeCreateFromMinValueWithDateAndTime(futureEnd, futureBegin); + pastBegin = utilities$2.DateUtils.safeCreateFromMinValueWithDateAndTime(pastEnd, pastBegin); + rightTime = utilities$2.DateUtils.safeCreateFromMinValueWithDateAndTime(futureEnd); + } + let leftResult = prs.begin.value; + let rightResult = prs.end.value; + let leftResultTime = leftResult.futureValue; + let rightResultTime = rightResult.futureValue; + leftTime = utilities$2.DateUtils.addTime(leftTime, leftResultTime); + rightTime = utilities$2.DateUtils.addTime(rightTime, rightResultTime); + // the right side time contains "ampm", while the left side doesn't + if (rightResult.comment === 'ampm' && !leftResult.comment && rightTime.getTime() < leftTime.getTime()) { + rightTime = utilities$2.DateUtils.addHours(rightTime, 12); + } + if (rightTime.getTime() < leftTime.getTime()) { + rightTime = utilities$2.DateUtils.addDays(rightTime, 1); + } + result.futureValue = [leftTime, rightTime]; + result.pastValue = [leftTime, rightTime]; + let hasFuzzyTimex = prs.begin.timexStr.includes('X') || prs.end.timexStr.includes('X'); + let leftTimex = hasFuzzyTimex ? prs.begin.timexStr : utilities$2.FormatUtil.luisDateTime(leftTime); + let rightTimex = hasFuzzyTimex ? prs.end.timexStr : utilities$2.FormatUtil.luisDateTime(rightTime); + let hoursBetween = utilities$2.DateUtils.totalHours(rightTime, leftTime); + result.timex = `(${leftTimex},${rightTimex},PT${hoursBetween}H)`; + result.success = true; + return result; + } + parseSpecificTimeOfDay(text, referenceTime) { + let result = new utilities$2.DateTimeResolutionResult(); + let source = text.trim().toLowerCase(); + let match = recognizersText.RegExpUtility.getMatches(this.config.specificTimeOfDayRegex, source).pop(); + if (match && match.index === 0 && match.length === source.length) { + let values = this.config.getMatchedTimeRange(source); + if (!values.success) { + return result; + } + let swift = values.swift; + let date = utilities$2.DateUtils.addDays(referenceTime, swift); + date.setHours(0); + date.setMinutes(0); + date.setSeconds(0); + result.timex = utilities$2.FormatUtil.formatDate(date) + values.timeStr; + result.futureValue = [ + utilities$2.DateUtils.safeCreateFromMinValue(date.getFullYear(), date.getMonth(), date.getDate(), values.beginHour, 0, 0), + utilities$2.DateUtils.safeCreateFromMinValue(date.getFullYear(), date.getMonth(), date.getDate(), values.endHour, values.endMin, values.endMin) + ]; + result.pastValue = [ + utilities$2.DateUtils.safeCreateFromMinValue(date.getFullYear(), date.getMonth(), date.getDate(), values.beginHour, 0, 0), + utilities$2.DateUtils.safeCreateFromMinValue(date.getFullYear(), date.getMonth(), date.getDate(), values.endHour, values.endMin, values.endMin) + ]; + result.success = true; + return result; + } + let beginHour = 0; + let endHour = 0; + let endMin = 0; + let timeStr = ''; + // handle morning, afternoon.. + if (recognizersText.RegExpUtility.isMatch(this.TMORegex, source)) { + timeStr = 'TMO'; + beginHour = 8; + endHour = 12; + } + else if (recognizersText.RegExpUtility.isMatch(this.TAFRegex, source)) { + timeStr = 'TAF'; + beginHour = 12; + endHour = 16; + } + else if (recognizersText.RegExpUtility.isMatch(this.TEVRegex, source)) { + timeStr = 'TEV'; + beginHour = 16; + endHour = 20; + } + else if (recognizersText.RegExpUtility.isMatch(this.TNIRegex, source)) { + timeStr = 'TNI'; + beginHour = 20; + endHour = 23; + endMin = 59; + } + else { + return result; + } + // handle Date followed by morning, afternoon + let timeMatch = recognizersText.RegExpUtility.getMatches(this.timeOfDayRegex, source).pop(); + if (!timeMatch) + return result; + let beforeStr = source.substr(0, timeMatch.index).trim(); + let erDate = this.config.dateExtractor.extract(beforeStr, referenceTime).pop(); + if (!erDate || erDate.length !== beforeStr.length) + return result; + let prDate = this.config.dateParser.parse(erDate, referenceTime); + let futureDate = prDate.value.futureValue; + let pastDate = prDate.value.pastValue; + result.timex = prDate.timexStr + timeStr; + result.futureValue = [ + utilities$2.DateUtils.safeCreateFromMinValue(futureDate.getFullYear(), futureDate.getMonth(), futureDate.getDate(), beginHour, 0, 0), + utilities$2.DateUtils.safeCreateFromMinValue(futureDate.getFullYear(), futureDate.getMonth(), futureDate.getDate(), endHour, endMin, endMin) + ]; + result.pastValue = [ + utilities$2.DateUtils.safeCreateFromMinValue(pastDate.getFullYear(), pastDate.getMonth(), pastDate.getDate(), beginHour, 0, 0), + utilities$2.DateUtils.safeCreateFromMinValue(pastDate.getFullYear(), pastDate.getMonth(), pastDate.getDate(), endHour, endMin, endMin) + ]; + result.success = true; + return result; + } + parseNumberWithUnit(text, referenceTime) { + let result = new utilities$2.DateTimeResolutionResult(); + let ers = this.cardinalExtractor.extract(text); + if (ers.length === 1) { + let er = ers[0]; + let pr = this.cardinalParser.parse(er); + let sourceUnit = text.substr(er.start + er.length).trim().toLowerCase(); + if (sourceUnit.startsWith('个')) { + sourceUnit = sourceUnit.substr(1); + } + let beforeStr = text.substr(0, er.start).trim().toLowerCase(); + return this.parseCommonDurationWithUnit(beforeStr, sourceUnit, pr.resolutionStr, pr.value, referenceTime); + } + // handle "last hour" + let match = recognizersText.RegExpUtility.getMatches(this.unitRegex, text).pop(); + if (match) { + let srcUnit = match.groups('unit').value; + let beforeStr = text.substr(0, match.index).trim().toLowerCase(); + return this.parseCommonDurationWithUnit(beforeStr, srcUnit, '1', 1, referenceTime); + } + return result; + } + parseDuration(text, referenceTime) { + let result = new utilities$2.DateTimeResolutionResult(); + let match = recognizersText.RegExpUtility.getMatches(this.config.relativeTimeUnitRegex, text).pop(); + if (!match) + return result; + let sourceUnit = match.groups('unit').value.toLowerCase(); + let beforeStr = text.substr(0, match.index).trim().toLowerCase(); + return this.parseCommonDurationWithUnit(beforeStr, sourceUnit, '1', 1, referenceTime); + } + parseCommonDurationWithUnit(beforeStr, sourceUnit, numStr, swift, referenceDate) { + let result = new utilities$2.DateTimeResolutionResult(); + if (!this.config.unitMap.has(sourceUnit)) + return result; + let unitStr = this.config.unitMap.get(sourceUnit); + let pastMatch = recognizersText.RegExpUtility.getMatches(this.config.pastRegex, beforeStr).pop(); + let hasPast = pastMatch && pastMatch.length === beforeStr.length; + let futureMatch = recognizersText.RegExpUtility.getMatches(this.config.futureRegex, beforeStr).pop(); + let hasFuture = futureMatch && futureMatch.length === beforeStr.length; + if (!hasPast && !hasFuture) + return result; + let beginDate = new Date(referenceDate); + let endDate = new Date(referenceDate); + switch (unitStr) { + case 'H': + beginDate = hasPast ? utilities$2.DateUtils.addHours(beginDate, -swift) : beginDate; + endDate = hasFuture ? utilities$2.DateUtils.addHours(endDate, swift) : endDate; + break; + case 'M': + beginDate = hasPast ? utilities$2.DateUtils.addMinutes(beginDate, -swift) : beginDate; + endDate = hasFuture ? utilities$2.DateUtils.addMinutes(endDate, swift) : endDate; + break; + case 'S': + beginDate = hasPast ? utilities$2.DateUtils.addSeconds(beginDate, -swift) : beginDate; + endDate = hasFuture ? utilities$2.DateUtils.addSeconds(endDate, swift) : endDate; + break; + default: return result; + } + let beginTimex = `${utilities$2.FormatUtil.luisDateFromDate(beginDate)}T${utilities$2.FormatUtil.luisTimeFromDate(beginDate)}`; + let endTimex = `${utilities$2.FormatUtil.luisDateFromDate(endDate)}T${utilities$2.FormatUtil.luisTimeFromDate(endDate)}`; + result.timex = `(${beginTimex},${endTimex},PT${numStr}${unitStr.charAt(0)})`; + result.futureValue = [beginDate, endDate]; + result.pastValue = [beginDate, endDate]; + result.success = true; + return result; + } +} +exports.ChineseDateTimePeriodParser = ChineseDateTimePeriodParser; + +}); + +unwrapExports(dateTimePeriodConfiguration$6); + +var setConfiguration$6 = createCommonjsModule(function (module, exports) { +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); + + + + + + + + + + +class ChineseSetExtractorConfiguration { + constructor() { + this.eachUnitRegex = recognizersText.RegExpUtility.getSafeRegExp(chineseDateTime.ChineseDateTime.SetEachUnitRegex); + this.durationExtractor = new durationConfiguration$6.ChineseDurationExtractor(); + this.lastRegex = recognizersText.RegExpUtility.getSafeRegExp(chineseDateTime.ChineseDateTime.SetLastRegex); + this.eachPrefixRegex = recognizersText.RegExpUtility.getSafeRegExp(chineseDateTime.ChineseDateTime.SetEachPrefixRegex); + this.timeExtractor = new timeConfiguration$6.ChineseTimeExtractor(); + this.beforeEachDayRegex = recognizersText.RegExpUtility.getSafeRegExp(chineseDateTime.ChineseDateTime.SetEachDayRegex); + this.eachDayRegex = recognizersText.RegExpUtility.getSafeRegExp(chineseDateTime.ChineseDateTime.SetEachDayRegex); + this.dateExtractor = new dateConfiguration$6.ChineseDateExtractor(); + this.dateTimeExtractor = new dateTimeConfiguration$6.ChineseDateTimeExtractor(); + } +} +class ChineseSetExtractor extends baseSet.BaseSetExtractor { + constructor() { + super(new ChineseSetExtractorConfiguration()); + } + extract(source, refDate) { + if (!refDate) + refDate = new Date(); + let referenceDate = refDate; + let tokens = new Array() + .concat(super.matchEachUnit(source)) + .concat(super.matchEachDuration(source, referenceDate)) + .concat(this.matchEachSpecific(this.config.timeExtractor, this.config.eachDayRegex, source, referenceDate)) + .concat(this.matchEachSpecific(this.config.dateExtractor, this.config.eachPrefixRegex, source, referenceDate)) + .concat(this.matchEachSpecific(this.config.dateTimeExtractor, this.config.eachPrefixRegex, source, referenceDate)); + let result = utilities$2.Token.mergeAllTokens(tokens, source, this.extractorName); + return result; + } + matchEachSpecific(extractor, eachRegex, source, refDate) { + let ret = []; + extractor.extract(source, refDate).forEach(er => { + let beforeStr = source.substr(0, er.start); + let beforeMatch = recognizersText.RegExpUtility.getMatches(eachRegex, beforeStr).pop(); + if (beforeMatch) { + ret.push(new utilities$2.Token(beforeMatch.index, er.start + er.length)); + } + }); + return ret; + } +} +exports.ChineseSetExtractor = ChineseSetExtractor; +class ChineseSetParserConfiguration { + constructor() { + this.dateExtractor = new dateConfiguration$6.ChineseDateExtractor(); + this.timeExtractor = new timeConfiguration$6.ChineseTimeExtractor(); + this.durationExtractor = new durationConfiguration$6.ChineseDurationExtractor(); + this.dateTimeExtractor = new dateTimeConfiguration$6.ChineseDateTimeExtractor(); + this.dateParser = new dateConfiguration$6.ChineseDateParser(); + this.timeParser = new timeConfiguration$6.ChineseTimeParser(); + this.durationParser = new durationConfiguration$6.ChineseDurationParser(); + this.dateTimeParser = new dateTimeConfiguration$6.ChineseDateTimeParser(); + this.unitMap = chineseDateTime.ChineseDateTime.ParserConfigurationUnitMap; + this.eachUnitRegex = recognizersText.RegExpUtility.getSafeRegExp(chineseDateTime.ChineseDateTime.SetEachUnitRegex); + this.eachDayRegex = recognizersText.RegExpUtility.getSafeRegExp(chineseDateTime.ChineseDateTime.SetEachDayRegex); + this.eachPrefixRegex = recognizersText.RegExpUtility.getSafeRegExp(chineseDateTime.ChineseDateTime.SetEachPrefixRegex); + } + getMatchedDailyTimex(text) { + return null; + } + getMatchedUnitTimex(source) { + let timex = ''; + if (source === '天' || source === '日') + timex = 'P1D'; + else if (source === '周' || source === '星期') + timex = 'P1W'; + else if (source === '月') + timex = 'P1M'; + else if (source === '年') + timex = 'P1Y'; + return { matched: timex !== '', timex: timex }; + } +} +class ChineseSetParser extends baseSet.BaseSetParser { + constructor() { + let config = new ChineseSetParserConfiguration(); + super(config); + } + parse(er, referenceDate) { + if (!referenceDate) + referenceDate = new Date(); + let value = null; + if (er.type === baseSet.BaseSetParser.ParserName) { + let innerResult = this.parseEachUnit(er.text); + if (!innerResult.success) { + innerResult = this.parseEachDuration(er.text, referenceDate); + } + if (!innerResult.success) { + innerResult = this.parserTimeEveryday(er.text, referenceDate); + } + if (!innerResult.success) { + innerResult = this.parseEach(this.config.dateTimeExtractor, this.config.dateTimeParser, er.text, referenceDate); + } + if (!innerResult.success) { + innerResult = this.parseEach(this.config.dateExtractor, this.config.dateParser, er.text, referenceDate); + } + if (innerResult.success) { + innerResult.futureResolution = {}; + innerResult.futureResolution[constants$2.TimeTypeConstants.SET] = innerResult.futureValue; + innerResult.pastResolution = {}; + innerResult.pastResolution[constants$2.TimeTypeConstants.SET] = innerResult.pastValue; + value = innerResult; + } + } + let ret = new parsers$4.DateTimeParseResult(er); + ret.value = value, ret.timexStr = value === null ? "" : value.timex, ret.resolutionStr = ""; + return ret; + } + parseEachUnit(text) { + let ret = new utilities$2.DateTimeResolutionResult(); + // handle "each month" + let match = recognizersText.RegExpUtility.getMatches(this.config.eachUnitRegex, text).pop(); + if (!match || match.length !== text.length) + return ret; + let sourceUnit = match.groups("unit").value; + if (recognizersText.StringUtility.isNullOrEmpty(sourceUnit) || !this.config.unitMap.has(sourceUnit)) + return ret; + let getMatchedUnitTimex = this.config.getMatchedUnitTimex(sourceUnit); + if (!getMatchedUnitTimex.matched) + return ret; + ret.timex = getMatchedUnitTimex.timex; + ret.futureValue = "Set: " + ret.timex; + ret.pastValue = "Set: " + ret.timex; + ret.success = true; + return ret; + } + parserTimeEveryday(text, refDate) { + let result = new utilities$2.DateTimeResolutionResult(); + let ers = this.config.timeExtractor.extract(text, refDate); + if (ers.length !== 1) + return result; + let er = ers[0]; + let beforeStr = text.substr(0, er.start); + let match = recognizersText.RegExpUtility.getMatches(this.config.eachDayRegex, beforeStr).pop(); + if (!match) + return result; + let pr = this.config.timeParser.parse(er); + result.timex = pr.timexStr; + result.futureValue = "Set: " + result.timex; + result.pastValue = "Set: " + result.timex; + result.success = true; + return result; + } + parseEach(extractor, parser, text, refDate) { + let result = new utilities$2.DateTimeResolutionResult(); + let ers = extractor.extract(text, refDate); + if (ers.length !== 1) + return result; + let er = ers[0]; + let beforeStr = text.substr(0, er.start); + let match = recognizersText.RegExpUtility.getMatches(this.config.eachPrefixRegex, beforeStr).pop(); + if (!match) + return result; + let timex = parser.parse(er).timexStr; + result.timex = timex; + result.futureValue = `Set: ${timex}`; + result.pastValue = `Set: ${timex}`; + result.success = true; + return result; + } +} +exports.ChineseSetParser = ChineseSetParser; + +}); + +unwrapExports(setConfiguration$6); + +var holidayConfiguration$6 = createCommonjsModule(function (module, exports) { +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); + + + +const recognizers_text_number_2 = recognizersTextNumber; + + + + +class ChineseHolidayExtractorConfiguration { + constructor() { + this.holidayRegexes = [ + recognizersText.RegExpUtility.getSafeRegExp(chineseDateTime.ChineseDateTime.HolidayRegexList1), + recognizersText.RegExpUtility.getSafeRegExp(chineseDateTime.ChineseDateTime.HolidayRegexList2), + recognizersText.RegExpUtility.getSafeRegExp(chineseDateTime.ChineseDateTime.LunarHolidayRegex) + ]; + } +} +exports.ChineseHolidayExtractorConfiguration = ChineseHolidayExtractorConfiguration; +class ChineseHolidayParserConfiguration extends baseHoliday.BaseHolidayParserConfiguration { + constructor() { + super(); + this.holidayRegexList = [ + recognizersText.RegExpUtility.getSafeRegExp(chineseDateTime.ChineseDateTime.HolidayRegexList1), + recognizersText.RegExpUtility.getSafeRegExp(chineseDateTime.ChineseDateTime.HolidayRegexList2), + recognizersText.RegExpUtility.getSafeRegExp(chineseDateTime.ChineseDateTime.LunarHolidayRegex) + ]; + this.holidayFuncDictionary = this.initHolidayFuncs(); + this.variableHolidaysTimexDictionary = chineseDateTime.ChineseDateTime.HolidayNoFixedTimex; + } + getSwiftYear(source) { + if (source.endsWith('年')) + return 0; + if (source.endsWith('去年')) + return -1; + if (source.endsWith('明年')) + return 1; + return null; + } + sanitizeHolidayToken(holiday) { + return holiday; + } + initHolidayFuncs() { + return new Map([ + ...super.initHolidayFuncs(), + ['父亲节', baseHoliday.BaseHolidayParserConfiguration.FathersDay], + ['母亲节', baseHoliday.BaseHolidayParserConfiguration.MothersDay], + ['感恩节', baseHoliday.BaseHolidayParserConfiguration.ThanksgivingDay] + ]); + } +} +class ChineseHolidayParser extends baseHoliday.BaseHolidayParser { + constructor() { + let config = new ChineseHolidayParserConfiguration(); + super(config); + this.lunarHolidayRegex = recognizersText.RegExpUtility.getSafeRegExp(chineseDateTime.ChineseDateTime.LunarHolidayRegex); + this.integerExtractor = new recognizersTextNumber.ChineseIntegerExtractor(); + this.numberParser = recognizersTextNumber.AgnosticNumberParserFactory.getParser(recognizersTextNumber.AgnosticNumberParserType.Integer, new recognizersTextNumber.ChineseNumberParserConfiguration()); + this.fixedHolidayDictionary = new Map([ + ['元旦', ChineseHolidayParser.NewYear], + ['元旦节', ChineseHolidayParser.NewYear], + ['教师节', ChineseHolidayParser.TeacherDay], + ['青年节', ChineseHolidayParser.YouthDay], + ['儿童节', ChineseHolidayParser.ChildrenDay], + ['妇女节', ChineseHolidayParser.FemaleDay], + ['植树节', ChineseHolidayParser.TreePlantDay], + ['情人节', ChineseHolidayParser.LoverDay], + ['圣诞节', ChineseHolidayParser.ChristmasDay], + ['新年', ChineseHolidayParser.NewYear], + ['愚人节', ChineseHolidayParser.FoolDay], + ['五一', ChineseHolidayParser.LaborDay], + ['劳动节', ChineseHolidayParser.LaborDay], + ['万圣节', ChineseHolidayParser.HalloweenDay], + ['中秋节', ChineseHolidayParser.MidautumnDay], + ['中秋', ChineseHolidayParser.MidautumnDay], + ['春节', ChineseHolidayParser.SpringDay], + ['除夕', ChineseHolidayParser.NewYearEve], + ['元宵节', ChineseHolidayParser.LanternDay], + ['清明节', ChineseHolidayParser.QingMingDay], + ['清明', ChineseHolidayParser.QingMingDay], + ['端午节', ChineseHolidayParser.DragonBoatDay], + ['端午', ChineseHolidayParser.DragonBoatDay], + ['国庆节', ChineseHolidayParser.ChsNationalDay], + ['建军节', ChineseHolidayParser.ChsMilBuildDay], + ['女生节', ChineseHolidayParser.GirlsDay], + ['光棍节', ChineseHolidayParser.SinglesDay], + ['双十一', ChineseHolidayParser.SinglesDay], + ['重阳节', ChineseHolidayParser.ChongYangDay] + ]); + } + static NewYear(year) { return new Date(year, 1 - 1, 1); } + static ChsNationalDay(year) { return new Date(year, 10 - 1, 1); } + static LaborDay(year) { return new Date(year, 5 - 1, 1); } + static ChristmasDay(year) { return new Date(year, 12 - 1, 25); } + static LoverDay(year) { return new Date(year, 2 - 1, 14); } + static ChsMilBuildDay(year) { return new Date(year, 8 - 1, 1); } + static FoolDay(year) { return new Date(year, 4 - 1, 1); } + static GirlsDay(year) { return new Date(year, 3 - 1, 7); } + static TreePlantDay(year) { return new Date(year, 3 - 1, 12); } + static FemaleDay(year) { return new Date(year, 3 - 1, 8); } + static ChildrenDay(year) { return new Date(year, 6 - 1, 1); } + static YouthDay(year) { return new Date(year, 5 - 1, 4); } + static TeacherDay(year) { return new Date(year, 9 - 1, 10); } + static SinglesDay(year) { return new Date(year, 11 - 1, 11); } + static HalloweenDay(year) { return new Date(year, 10 - 1, 31); } + static MidautumnDay(year) { return new Date(year, 8 - 1, 15); } + static SpringDay(year) { return new Date(year, 1 - 1, 1); } + static NewYearEve(year) { return utilities$2.DateUtils.addDays(new Date(year, 1 - 1, 1), -1); } + static LanternDay(year) { return new Date(year, 1 - 1, 15); } + static QingMingDay(year) { return new Date(year, 4 - 1, 4); } + static DragonBoatDay(year) { return new Date(year, 5 - 1, 5); } + static ChongYangDay(year) { return new Date(year, 9 - 1, 9); } + parse(er, referenceDate) { + if (!referenceDate) + referenceDate = new Date(); + let value = null; + if (er.type === baseHoliday.BaseHolidayParser.ParserName) { + let innerResult = this.parseHolidayRegexMatch(er.text, referenceDate); + if (innerResult.success) { + innerResult.futureResolution = {}; + innerResult.futureResolution[constants$2.TimeTypeConstants.DATE] = utilities$2.FormatUtil.formatDate(innerResult.futureValue); + innerResult.pastResolution = {}; + innerResult.pastResolution[constants$2.TimeTypeConstants.DATE] = utilities$2.FormatUtil.formatDate(innerResult.pastValue); + innerResult.isLunar = this.isLunar(er.text); + value = innerResult; + } + } + let ret = new parsers$4.DateTimeParseResult(er); + ret.value = value; + ret.timexStr = value === null ? "" : value.timex; + ret.resolutionStr = ""; + return ret; + } + isLunar(source) { + return recognizersText.RegExpUtility.isMatch(this.lunarHolidayRegex, source); + } + match2Date(match, referenceDate) { + let ret = new utilities$2.DateTimeResolutionResult(); + let holidayStr = this.config.sanitizeHolidayToken(match.groups("holiday").value.toLowerCase()); + if (recognizersText.StringUtility.isNullOrEmpty(holidayStr)) + return ret; + // get year (if exist) + let year = referenceDate.getFullYear(); + let yearNum = match.groups('year').value; + let yearChinese = match.groups('yearchs').value; + let yearRelative = match.groups('yearrel').value; + let hasYear = false; + if (!recognizersText.StringUtility.isNullOrEmpty(yearNum)) { + hasYear = true; + if (this.config.getSwiftYear(yearNum) === 0) { + yearNum = yearNum.substr(0, yearNum.length - 1); + } + year = this.convertYear(yearNum, false); + } + else if (!recognizersText.StringUtility.isNullOrEmpty(yearChinese)) { + hasYear = true; + if (this.config.getSwiftYear(yearChinese) === 0) { + yearChinese = yearChinese.substr(0, yearChinese.length - 1); + } + year = this.convertYear(yearChinese, true); + } + else if (!recognizersText.StringUtility.isNullOrEmpty(yearRelative)) { + hasYear = true; + year += this.config.getSwiftYear(yearRelative); + } + if (year < 100 && year >= 90) { + year += 1900; + } + else if (year < 100 && year < 20) { + year += 2000; + } + let timex = ''; + let date = new Date(referenceDate); + if (this.fixedHolidayDictionary.has(holidayStr)) { + date = this.fixedHolidayDictionary.get(holidayStr)(year); + timex = `-${utilities$2.FormatUtil.toString(date.getMonth() + 1, 2)}-${utilities$2.FormatUtil.toString(date.getDate(), 2)}`; + } + else if (this.config.holidayFuncDictionary.has(holidayStr)) { + date = this.config.holidayFuncDictionary.get(holidayStr)(year); + timex = this.config.variableHolidaysTimexDictionary.get(holidayStr); + } + else { + return ret; + } + if (hasYear) { + ret.timex = utilities$2.FormatUtil.toString(year, 4) + timex; + ret.futureValue = new Date(year, date.getMonth(), date.getDate()); + ret.pastValue = new Date(year, date.getMonth(), date.getDate()); + } + else { + ret.timex = "XXXX" + timex; + ret.futureValue = this.getDateValue(date, referenceDate, holidayStr, 1, (d, r) => d.getTime() < r.getTime()); + ret.pastValue = this.getDateValue(date, referenceDate, holidayStr, -1, (d, r) => d.getTime() >= r.getTime()); + } + ret.success = true; + return ret; + } + convertYear(yearStr, isChinese) { + let year = -1; + let er; + if (isChinese) { + let yearNum = 0; + er = this.integerExtractor.extract(yearStr).pop(); + if (er && er.type === recognizers_text_number_2.Constants.SYS_NUM_INTEGER) { + yearNum = Number.parseInt(this.numberParser.parse(er).value); + } + if (yearNum < 10) { + yearNum = 0; + for (let index = 0; index < yearStr.length; index++) { + let char = yearStr.charAt[index]; + yearNum *= 10; + er = this.integerExtractor.extract(char).pop(); + if (er && er.type === recognizers_text_number_2.Constants.SYS_NUM_INTEGER) { + yearNum += Number.parseInt(this.numberParser.parse(er).value); + } + } + } + else { + year = yearNum; + } + } + else { + year = Number.parseInt(yearStr, 10); + } + return year === 0 ? -1 : year; + } + getDateValue(date, referenceDate, holiday, swift, comparer) { + let result = new Date(date); + if (comparer(date, referenceDate)) { + if (this.fixedHolidayDictionary.has(holiday)) { + return utilities$2.DateUtils.addYears(date, swift); + } + if (this.config.holidayFuncDictionary.has(holiday)) { + result = this.config.holidayFuncDictionary.get(holiday)(referenceDate.getFullYear() + swift); + } + } + return result; + } +} +exports.ChineseHolidayParser = ChineseHolidayParser; + +}); + +unwrapExports(holidayConfiguration$6); + +var mergedConfiguration$6 = createCommonjsModule(function (module, exports) { +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); + + + + + + + + + + + + + + + +class ChineseMergedExtractorConfiguration { + constructor() { + this.dateExtractor = new dateConfiguration$6.ChineseDateExtractor(); + this.timeExtractor = new timeConfiguration$6.ChineseTimeExtractor(); + this.dateTimeExtractor = new dateTimeConfiguration$6.ChineseDateTimeExtractor(); + this.datePeriodExtractor = new datePeriodConfiguration$6.ChineseDatePeriodExtractor(); + this.timePeriodExtractor = new timePeriodConfiguration$6.ChineseTimePeriodExtractor(); + this.dateTimePeriodExtractor = new dateTimePeriodConfiguration$6.ChineseDateTimePeriodExtractor(); + this.setExtractor = new setConfiguration$6.ChineseSetExtractor(); + this.holidayExtractor = new baseHoliday.BaseHolidayExtractor(new holidayConfiguration$6.ChineseHolidayExtractorConfiguration()); + this.durationExtractor = new durationConfiguration$6.ChineseDurationExtractor(); + } +} +class ChineseMergedExtractor extends baseMerged.BaseMergedExtractor { + constructor(options) { + let config = new ChineseMergedExtractorConfiguration(); + super(config, options); + this.dayOfMonthRegex = recognizersText.RegExpUtility.getSafeRegExp(`^\\d{1,2}号`, 'gi'); + } + extract(source, refDate) { + if (!refDate) + refDate = new Date(); + let referenceDate = refDate; + let result = new Array(); + this.addTo(result, this.config.dateExtractor.extract(source, referenceDate), source); + this.addTo(result, this.config.timeExtractor.extract(source, referenceDate), source); + this.addTo(result, this.config.durationExtractor.extract(source, referenceDate), source); + this.addTo(result, this.config.datePeriodExtractor.extract(source, referenceDate), source); + this.addTo(result, this.config.dateTimeExtractor.extract(source, referenceDate), source); + this.addTo(result, this.config.timePeriodExtractor.extract(source, referenceDate), source); + this.addTo(result, this.config.dateTimePeriodExtractor.extract(source, referenceDate), source); + this.addTo(result, this.config.setExtractor.extract(source, referenceDate), source); + this.addTo(result, this.config.holidayExtractor.extract(source, referenceDate), source); + result = this.checkBlackList(result, source); + result = result.sort((a, b) => a.start - b.start); + return result; + } + addTo(destination, source, sourceStr) { + source.forEach(er => { + let isFound = false; + let rmIndex = -1; + let rmLength = 1; + for (let index = 0; index < destination.length; index++) { + if (recognizersText.ExtractResult.isOverlap(destination[index], er)) { + isFound = true; + if (er.length > destination[index].length) { + rmIndex = index; + let j = index + 1; + while (j < destination.length && recognizersText.ExtractResult.isOverlap(destination[j], er)) { + rmLength++; + j++; + } + } + break; + } + } + if (!isFound) { + destination.push(er); + } + else if (rmIndex >= 0) { + destination.splice(rmIndex, rmLength); + destination.splice(0, destination.length, ...this.moveOverlap(destination, er)); + destination.splice(rmIndex, 0, er); + } + }); + } + moveOverlap(destination, result) { + let duplicated = new Array(); + for (let i = 0; i < destination.length; i++) { + if (result.text.includes(destination[i].text) + && (result.start === destination[i].start || result.start + result.length === destination[i].start + destination[i].length)) { + duplicated.push(i); + } + } + return destination.filter((_, i) => duplicated.indexOf(i) < 0); + } + // ported from CheckBlackList + checkBlackList(destination, source) { + return destination.filter(value => { + let valueEnd = value.start + value.length; + if (valueEnd !== source.length) { + let lastChar = source.substr(valueEnd, 1); + if (value.text.endsWith('周') && lastChar === '岁') { + return false; + } + } + if (recognizersText.RegExpUtility.isMatch(this.dayOfMonthRegex, value.text)) { + return false; + } + return true; + }); + } +} +exports.ChineseMergedExtractor = ChineseMergedExtractor; +class ChineseMergedParserConfiguration { + constructor() { + this.beforeRegex = recognizersText.RegExpUtility.getSafeRegExp(chineseDateTime.ChineseDateTime.MergedBeforeRegex); + this.afterRegex = recognizersText.RegExpUtility.getSafeRegExp(chineseDateTime.ChineseDateTime.MergedAfterRegex); + this.sinceRegex = recognizersText.RegExpUtility.getSafeRegExp(chineseDateTime.ChineseDateTime.MergedAfterRegex); + this.dateParser = new dateConfiguration$6.ChineseDateParser(); + this.holidayParser = new holidayConfiguration$6.ChineseHolidayParser(); + this.timeParser = new timeConfiguration$6.ChineseTimeParser(); + this.dateTimeParser = new dateTimeConfiguration$6.ChineseDateTimeParser(); + this.datePeriodParser = new datePeriodConfiguration$6.ChineseDatePeriodParser(); + this.timePeriodParser = new timePeriodConfiguration$6.ChineseTimePeriodParser(); + this.dateTimePeriodParser = new dateTimePeriodConfiguration$6.ChineseDateTimePeriodParser(); + this.durationParser = new durationConfiguration$6.ChineseDurationParser(); + this.setParser = new setConfiguration$6.ChineseSetParser(); + } +} +class ChineseMergedParser extends baseMerged.BaseMergedParser { + constructor() { + let config = new ChineseMergedParserConfiguration(); + super(config, 0); + } + parse(er, refTime) { + let referenceTime = refTime || new Date(); + let pr = null; + // push, save teh MOD string + let hasBefore = recognizersText.RegExpUtility.isMatch(this.config.beforeRegex, er.text); + let hasAfter = recognizersText.RegExpUtility.isMatch(this.config.afterRegex, er.text); + let hasSince = recognizersText.RegExpUtility.isMatch(this.config.sinceRegex, er.text); + if (er.type === constants$2.Constants.SYS_DATETIME_DATE) { + pr = this.config.dateParser.parse(er, referenceTime); + if (pr.value === null || pr.value === undefined) { + pr = this.config.holidayParser.parse(er, referenceTime); + } + } + else if (er.type === constants$2.Constants.SYS_DATETIME_TIME) { + pr = this.config.timeParser.parse(er, referenceTime); + } + else if (er.type === constants$2.Constants.SYS_DATETIME_DATETIME) { + pr = this.config.dateTimeParser.parse(er, referenceTime); + } + else if (er.type === constants$2.Constants.SYS_DATETIME_DATEPERIOD) { + pr = this.config.datePeriodParser.parse(er, referenceTime); + } + else if (er.type === constants$2.Constants.SYS_DATETIME_TIMEPERIOD) { + pr = this.config.timePeriodParser.parse(er, referenceTime); + } + else if (er.type === constants$2.Constants.SYS_DATETIME_DATETIMEPERIOD) { + pr = this.config.dateTimePeriodParser.parse(er, referenceTime); + } + else if (er.type === constants$2.Constants.SYS_DATETIME_DURATION) { + pr = this.config.durationParser.parse(er, referenceTime); + } + else if (er.type === constants$2.Constants.SYS_DATETIME_SET) { + pr = this.config.setParser.parse(er, referenceTime); + } + else { + return null; + } + // pop, restore the MOD string + if (hasBefore && pr.value !== null) { + let val = pr.value; + val.mod = constants$2.TimeTypeConstants.beforeMod; + pr.value = val; + } + if (hasAfter && pr.value !== null) { + let val = pr.value; + val.mod = constants$2.TimeTypeConstants.afterMod; + pr.value = val; + } + if (hasSince && pr.value !== null) { + let val = pr.value; + val.mod = constants$2.TimeTypeConstants.sinceMod; + pr.value = val; + } + pr.value = this.dateTimeResolution(pr, hasBefore, hasAfter, hasSince); + pr.type = `${this.parserTypeName}.${this.determineDateTimeType(er.type, hasBefore, hasAfter, hasSince)}`; + return pr; + } +} +exports.ChineseMergedParser = ChineseMergedParser; +class ChineseFullMergedParser extends baseMerged.BaseMergedParser { + constructor() { + let config = new ChineseMergedParserConfiguration(); + super(config, 0); + } + parse(er, refTime) { + let referenceTime = refTime || new Date(); + let pr = null; + // push, save teh MOD string + let hasBefore = false; + let hasAfter = false; + let modStr = ""; + let beforeMatch = recognizersText.RegExpUtility.getMatches(this.config.beforeRegex, er.text).pop(); + let afterMatch = recognizersText.RegExpUtility.getMatches(this.config.afterRegex, er.text).pop(); + if (beforeMatch) { + hasBefore = true; + er.start += beforeMatch.length; + er.length -= beforeMatch.length; + er.text = er.text.substring(beforeMatch.length); + modStr = beforeMatch.value; + } + else if (afterMatch) { + hasAfter = true; + er.start += afterMatch.length; + er.length -= afterMatch.length; + er.text = er.text.substring(afterMatch.length); + modStr = afterMatch.value; + } + if (er.type === constants$2.Constants.SYS_DATETIME_DATE) { + pr = this.config.dateParser.parse(er, referenceTime); + if (pr.value === null || pr.value === undefined) { + pr = this.config.holidayParser.parse(er, referenceTime); + } + } + else if (er.type === constants$2.Constants.SYS_DATETIME_TIME) { + pr = this.config.timeParser.parse(er, referenceTime); + } + else if (er.type === constants$2.Constants.SYS_DATETIME_DATETIME) { + pr = this.config.dateTimeParser.parse(er, referenceTime); + } + else if (er.type === constants$2.Constants.SYS_DATETIME_DATEPERIOD) { + pr = this.config.datePeriodParser.parse(er, referenceTime); + } + else if (er.type === constants$2.Constants.SYS_DATETIME_TIMEPERIOD) { + pr = this.config.timePeriodParser.parse(er, referenceTime); + } + else if (er.type === constants$2.Constants.SYS_DATETIME_DATETIMEPERIOD) { + pr = this.config.dateTimePeriodParser.parse(er, referenceTime); + } + else if (er.type === constants$2.Constants.SYS_DATETIME_DURATION) { + pr = this.config.durationParser.parse(er, referenceTime); + } + else if (er.type === constants$2.Constants.SYS_DATETIME_SET) { + pr = this.config.setParser.parse(er, referenceTime); + } + else { + return null; + } + // pop, restore the MOD string + if (hasBefore && pr.value !== null) { + pr.length += modStr.length; + pr.start -= modStr.length; + pr.text = modStr + pr.text; + let val = pr.value; + val.mod = constants$2.TimeTypeConstants.beforeMod; + pr.value = val; + } + if (hasAfter && pr.value !== null) { + pr.length += modStr.length; + pr.start -= modStr.length; + pr.text = modStr + pr.text; + let val = pr.value; + val.mod = constants$2.TimeTypeConstants.afterMod; + pr.value = val; + } + pr.value = this.dateTimeResolution(pr, hasBefore, hasAfter); + pr.type = `${this.parserTypeName}.${this.determineDateTimeType(er.type, hasBefore, hasAfter)}`; + return pr; + } + dateTimeResolution(slot, hasBefore, hasAfter, hasSince = false) { + if (!slot) + return null; + let result = new Map(); + let resolutions = new Array(); + let type = slot.type; + let outputType = this.determineDateTimeType(type, hasBefore, hasAfter); + let timex = slot.timexStr; + let value = slot.value; + if (!value) + return null; + let isLunar = value.isLunar; + let mod = value.mod; + let comment = value.comment; + // the following should added to res first since the ResolveAmPm is using these fields + this.addResolutionFieldsAny(result, constants$2.Constants.TimexKey, timex); + this.addResolutionFieldsAny(result, constants$2.Constants.CommentKey, comment); + this.addResolutionFieldsAny(result, constants$2.Constants.ModKey, mod); + this.addResolutionFieldsAny(result, constants$2.Constants.TypeKey, outputType); + let futureResolution = value.futureResolution; + let pastResolution = value.pastResolution; + let future = this.generateFromResolution(type, futureResolution, mod); + let past = this.generateFromResolution(type, pastResolution, mod); + let futureValues = Array.from(this.getValues(future)).sort(); + let pastValues = Array.from(this.getValues(past)).sort(); + if (lodash_isequal(futureValues, pastValues)) { + if (pastValues.length > 0) + this.addResolutionFieldsAny(result, constants$2.Constants.ResolveKey, past); + } + else { + if (pastValues.length > 0) + this.addResolutionFieldsAny(result, constants$2.Constants.ResolveToPastKey, past); + if (futureValues.length > 0) + this.addResolutionFieldsAny(result, constants$2.Constants.ResolveToFutureKey, future); + } + if (comment && comment === 'ampm') { + if (result.has('resolve')) { + this.resolveAMPM(result, 'resolve'); + } + else { + this.resolveAMPM(result, 'resolveToPast'); + this.resolveAMPM(result, 'resolveToFuture'); + } + } + if (isLunar) { + this.addResolutionFieldsAny(result, constants$2.Constants.IsLunarKey, isLunar); + } + result.forEach((value, key) => { + if (this.isObject(value)) { + // is "StringMap" + let newValues = {}; + this.addResolutionFields(newValues, constants$2.Constants.TimexKey, timex); + this.addResolutionFields(newValues, constants$2.Constants.ModKey, mod); + this.addResolutionFields(newValues, constants$2.Constants.TypeKey, outputType); + Object.keys(value).forEach((innerKey) => { + newValues[innerKey] = value[innerKey]; + }); + resolutions.push(newValues); + } + }); + if (Object.keys(past).length === 0 && Object.keys(future).length === 0) { + let o = {}; + o['timex'] = timex; + o['type'] = outputType; + o['value'] = 'not resolved'; + resolutions.push(o); + } + return { + values: resolutions + }; + } + determineDateTimeType(type, hasBefore, hasAfter, hasSince = false) { + if (hasBefore || hasAfter || hasSince) { + if (type === constants$2.Constants.SYS_DATETIME_DATE) + return constants$2.Constants.SYS_DATETIME_DATEPERIOD; + if (type === constants$2.Constants.SYS_DATETIME_TIME) + return constants$2.Constants.SYS_DATETIME_TIMEPERIOD; + if (type === constants$2.Constants.SYS_DATETIME_DATETIME) + return constants$2.Constants.SYS_DATETIME_DATETIMEPERIOD; + } + return type; + } +} +exports.ChineseFullMergedParser = ChineseFullMergedParser; + +}); + +unwrapExports(mergedConfiguration$6); + +var dateTimeRecognizer = createCommonjsModule(function (module, exports) { +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); + + + + + + + + + +var DateTimeOptions; +(function (DateTimeOptions) { + DateTimeOptions[DateTimeOptions["None"] = 0] = "None"; + DateTimeOptions[DateTimeOptions["SkipFromToMerge"] = 1] = "SkipFromToMerge"; + DateTimeOptions[DateTimeOptions["SplitDateAndTime"] = 2] = "SplitDateAndTime"; + DateTimeOptions[DateTimeOptions["Calendar"] = 4] = "Calendar"; +})(DateTimeOptions = exports.DateTimeOptions || (exports.DateTimeOptions = {})); +function recognizeDateTime(query, culture, options = DateTimeOptions.None, referenceDate = new Date(), fallbackToDefaultCulture = true) { + let recognizer = new DateTimeRecognizer(culture, options); + let model = recognizer.getDateTimeModel(culture, fallbackToDefaultCulture); + return model.parse(query, referenceDate); +} +exports.recognizeDateTime = recognizeDateTime; +class DateTimeRecognizer extends recognizersText.Recognizer { + constructor(culture, options = DateTimeOptions.None, lazyInitialization = false) { + super(culture, options, lazyInitialization); + } + InitializeConfiguration() { + //#region English + this.registerModel("DateTimeModel", recognizersTextNumber.Culture.English, (options) => new models$4.DateTimeModel(new baseMerged.BaseMergedParser(new mergedConfiguration.EnglishMergedParserConfiguration(new baseConfiguration.EnglishCommonDateTimeParserConfiguration()), this.Options), new baseMerged.BaseMergedExtractor(new mergedConfiguration.EnglishMergedExtractorConfiguration(), this.Options))); + //#endregion + //#region Spanish + this.registerModel("DateTimeModel", recognizersTextNumber.Culture.Spanish, (options) => new models$4.DateTimeModel(new baseMerged.BaseMergedParser(new mergedConfiguration$2.SpanishMergedParserConfiguration(), this.Options), new baseMerged.BaseMergedExtractor(new mergedConfiguration$2.SpanishMergedExtractorConfiguration(), this.Options))); + //#endregion + //#region Chinese + this.registerModel("DateTimeModel", recognizersTextNumber.Culture.Chinese, (options) => new models$4.DateTimeModel(new mergedConfiguration$6.ChineseFullMergedParser(), new mergedConfiguration$6.ChineseMergedExtractor(this.Options))); + //#endregion + //#region French + this.registerModel("DateTimeModel", recognizersTextNumber.Culture.French, (options) => new models$4.DateTimeModel(new baseMerged.BaseMergedParser(new mergedConfiguration$4.FrenchMergedParserConfiguration(), this.Options), new baseMerged.BaseMergedExtractor(new mergedConfiguration$4.FrenchMergedExtractorConfiguration(), this.Options))); + //#endregion + } + IsValidOptions(options) { + return options >= 0 && options <= DateTimeOptions.None + DateTimeOptions.SkipFromToMerge + DateTimeOptions.SplitDateAndTime + DateTimeOptions.Calendar; + } + getDateTimeModel(culture = null, fallbackToDefaultCulture = true) { + return this.getModel("DateTimeModel", culture, fallbackToDefaultCulture); + } +} +exports.default = DateTimeRecognizer; + +}); + +unwrapExports(dateTimeRecognizer); + +var timeParser = createCommonjsModule(function (module, exports) { +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); + + + + +class FrenchTimeParser extends baseTime.BaseTimeParser { + constructor(config) { + super(config); + } + internalParse(text, referenceTime) { + let ret = super.internalParse(text, referenceTime); + if (!ret.success) { + ret = this.parseIsh(text, referenceTime); + } + return ret; + } + parseIsh(text, referenceTime) { + let ret = new utilities$2.DateTimeResolutionResult(); + let trimedText = text.trim().toLowerCase(); + let matches = recognizersText.RegExpUtility.getMatches(recognizersText.RegExpUtility.getSafeRegExp(frenchDateTime.FrenchDateTime.IshRegex), text); + if (matches.length && matches[0].index === 0 && matches[0].length === trimedText.length) { + let hourStr = matches[0].groups("hour").value; + let hour = 12; + if (hourStr) { + hour = parseInt(hourStr, 10); + } + ret.timex = "T" + utilities$2.FormatUtil.toString(hour, 2); + ret.futureValue = + ret.pastValue = + utilities$2.DateUtils.safeCreateFromMinValue(referenceTime.getFullYear(), referenceTime.getMonth(), referenceTime.getDate(), hour, 0, 0); + ret.success = true; + } + return ret; + } +} +exports.FrenchTimeParser = FrenchTimeParser; + +}); + +unwrapExports(timeParser); + +var recognizersTextDateTime = createCommonjsModule(function (module, exports) { +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); + +exports.DateTimeRecognizer = dateTimeRecognizer.default; +exports.DateTimeOptions = dateTimeRecognizer.DateTimeOptions; +exports.recognizeDateTime = dateTimeRecognizer.recognizeDateTime; + +exports.Culture = recognizersTextNumber.Culture; +exports.CultureInfo = recognizersTextNumber.CultureInfo; + +exports.BaseDateExtractor = baseDate.BaseDateExtractor; +exports.BaseDateParser = baseDate.BaseDateParser; + +exports.BaseTimeExtractor = baseTime.BaseTimeExtractor; +exports.BaseTimeParser = baseTime.BaseTimeParser; + +exports.BaseDatePeriodExtractor = baseDatePeriod.BaseDatePeriodExtractor; +exports.BaseDatePeriodParser = baseDatePeriod.BaseDatePeriodParser; + +exports.BaseTimePeriodExtractor = baseTimePeriod.BaseTimePeriodExtractor; +exports.BaseTimePeriodParser = baseTimePeriod.BaseTimePeriodParser; + +exports.BaseDateTimeExtractor = baseDateTime$2.BaseDateTimeExtractor; +exports.BaseDateTimeParser = baseDateTime$2.BaseDateTimeParser; + +exports.BaseDateTimePeriodExtractor = baseDateTimePeriod.BaseDateTimePeriodExtractor; +exports.BaseDateTimePeriodParser = baseDateTimePeriod.BaseDateTimePeriodParser; + +exports.BaseDurationExtractor = baseDuration.BaseDurationExtractor; +exports.BaseDurationParser = baseDuration.BaseDurationParser; + +exports.BaseSetExtractor = baseSet.BaseSetExtractor; +exports.BaseSetParser = baseSet.BaseSetParser; + +exports.BaseHolidayExtractor = baseHoliday.BaseHolidayExtractor; +exports.BaseHolidayParser = baseHoliday.BaseHolidayParser; +exports.BaseHolidayParserConfiguration = baseHoliday.BaseHolidayParserConfiguration; + +exports.BaseMergedExtractor = baseMerged.BaseMergedExtractor; +exports.BaseMergedParser = baseMerged.BaseMergedParser; + +exports.Constants = constants$2.Constants; +exports.TimeTypeConstants = constants$2.TimeTypeConstants; + +exports.DateTimeModelResult = models$4.DateTimeModelResult; +exports.DateTimeModel = models$4.DateTimeModel; + +exports.DateTimeParseResult = parsers$4.DateTimeParseResult; +exports.BaseDateParserConfiguration = parsers$4.BaseDateParserConfiguration; + +exports.Token = utilities$2.Token; +exports.AgoLaterMode = utilities$2.AgoLaterMode; +exports.AgoLaterUtil = utilities$2.AgoLaterUtil; +exports.MatchingUtil = utilities$2.MatchingUtil; +exports.FormatUtil = utilities$2.FormatUtil; +exports.DateTimeResolutionResult = utilities$2.DateTimeResolutionResult; +exports.DateUtils = utilities$2.DateUtils; +exports.DayOfWeek = utilities$2.DayOfWeek; + +exports.EnglishCommonDateTimeParserConfiguration = baseConfiguration.EnglishCommonDateTimeParserConfiguration; +exports.EnglishDateTimeUtilityConfiguration = baseConfiguration.EnglishDateTimeUtilityConfiguration; + +exports.EnglishDateExtractorConfiguration = dateConfiguration.EnglishDateExtractorConfiguration; +exports.EnglishDateParserConfiguration = dateConfiguration.EnglishDateParserConfiguration; + +exports.EnglishTimeExtractorConfiguration = timeConfiguration.EnglishTimeExtractorConfiguration; +exports.EnglishTimeParserConfiguration = timeConfiguration.EnglishTimeParserConfiguration; + +exports.EnglishDatePeriodExtractorConfiguration = datePeriodConfiguration.EnglishDatePeriodExtractorConfiguration; +exports.EnglishDatePeriodParserConfiguration = datePeriodConfiguration.EnglishDatePeriodParserConfiguration; + +exports.EnglishTimePeriodExtractorConfiguration = timePeriodConfiguration.EnglishTimePeriodExtractorConfiguration; +exports.EnglishTimePeriodParserConfiguration = timePeriodConfiguration.EnglishTimePeriodParserConfiguration; + +exports.EnglishDateTimeExtractorConfiguration = dateTimeConfiguration.EnglishDateTimeExtractorConfiguration; +exports.EnglishDateTimeParserConfiguration = dateTimeConfiguration.EnglishDateTimeParserConfiguration; + +exports.EnglishDateTimePeriodExtractorConfiguration = dateTimePeriodConfiguration.EnglishDateTimePeriodExtractorConfiguration; +exports.EnglishDateTimePeriodParserConfiguration = dateTimePeriodConfiguration.EnglishDateTimePeriodParserConfiguration; + +exports.EnglishSetExtractorConfiguration = setConfiguration.EnglishSetExtractorConfiguration; +exports.EnglishSetParserConfiguration = setConfiguration.EnglishSetParserConfiguration; + +exports.EnglishDurationExtractorConfiguration = durationConfiguration.EnglishDurationExtractorConfiguration; +exports.EnglishDurationParserConfiguration = durationConfiguration.EnglishDurationParserConfiguration; + +exports.EnglishHolidayExtractorConfiguration = holidayConfiguration.EnglishHolidayExtractorConfiguration; +exports.EnglishHolidayParserConfiguration = holidayConfiguration.EnglishHolidayParserConfiguration; + +exports.EnglishMergedExtractorConfiguration = mergedConfiguration.EnglishMergedExtractorConfiguration; +exports.EnglishMergedParserConfiguration = mergedConfiguration.EnglishMergedParserConfiguration; + +exports.EnglishTimeParser = parsers$6.EnglishTimeParser; + +exports.SpanishCommonDateTimeParserConfiguration = baseConfiguration$2.SpanishCommonDateTimeParserConfiguration; +exports.SpanishDateTimeUtilityConfiguration = baseConfiguration$2.SpanishDateTimeUtilityConfiguration; + +exports.SpanishDateExtractorConfiguration = dateConfiguration$2.SpanishDateExtractorConfiguration; +exports.SpanishDateParserConfiguration = dateConfiguration$2.SpanishDateParserConfiguration; + +exports.SpanishTimeExtractorConfiguration = timeConfiguration$2.SpanishTimeExtractorConfiguration; +exports.SpanishTimeParserConfiguration = timeConfiguration$2.SpanishTimeParserConfiguration; + +exports.SpanishDatePeriodExtractorConfiguration = datePeriodConfiguration$2.SpanishDatePeriodExtractorConfiguration; +exports.SpanishDatePeriodParserConfiguration = datePeriodConfiguration$2.SpanishDatePeriodParserConfiguration; + +exports.SpanishTimePeriodExtractorConfiguration = timePeriodConfiguration$2.SpanishTimePeriodExtractorConfiguration; +exports.SpanishTimePeriodParserConfiguration = timePeriodConfiguration$2.SpanishTimePeriodParserConfiguration; + +exports.SpanishDateTimeExtractorConfiguration = dateTimeConfiguration$2.SpanishDateTimeExtractorConfiguration; +exports.SpanishDateTimeParserConfiguration = dateTimeConfiguration$2.SpanishDateTimeParserConfiguration; + +exports.SpanishDateTimePeriodExtractorConfiguration = dateTimePeriodConfiguration$2.SpanishDateTimePeriodExtractorConfiguration; +exports.SpanishDateTimePeriodParserConfiguration = dateTimePeriodConfiguration$2.SpanishDateTimePeriodParserConfiguration; + +exports.SpanishSetExtractorConfiguration = setConfiguration$2.SpanishSetExtractorConfiguration; +exports.SpanishSetParserConfiguration = setConfiguration$2.SpanishSetParserConfiguration; + +exports.SpanishDurationExtractorConfiguration = durationConfiguration$2.SpanishDurationExtractorConfiguration; +exports.SpanishDurationParserConfiguration = durationConfiguration$2.SpanishDurationParserConfiguration; + +exports.SpanishHolidayExtractorConfiguration = holidayConfiguration$2.SpanishHolidayExtractorConfiguration; +exports.SpanishHolidayParserConfiguration = holidayConfiguration$2.SpanishHolidayParserConfiguration; + +exports.SpanishMergedExtractorConfiguration = mergedConfiguration$2.SpanishMergedExtractorConfiguration; +exports.SpanishMergedParserConfiguration = mergedConfiguration$2.SpanishMergedParserConfiguration; + +exports.SpanishDateTimePeriodParser = dateTimePeriodParser.SpanishDateTimePeriodParser; + +exports.FrenchCommonDateTimeParserConfiguration = baseConfiguration$4.FrenchCommonDateTimeParserConfiguration; +exports.FrenchDateTimeUtilityConfiguration = baseConfiguration$4.FrenchDateTimeUtilityConfiguration; + +exports.FrenchDateExtractorConfiguration = dateConfiguration$4.FrenchDateExtractorConfiguration; +exports.FrenchDateParserConfiguration = dateConfiguration$4.FrenchDateParserConfiguration; + +exports.FrenchTimeExtractorConfiguration = timeConfiguration$4.FrenchTimeExtractorConfiguration; +exports.FrenchTimeParserConfiguration = timeConfiguration$4.FrenchTimeParserConfiguration; + +exports.FrenchDatePeriodExtractorConfiguration = datePeriodConfiguration$4.FrenchDatePeriodExtractorConfiguration; +exports.FrenchDatePeriodParserConfiguration = datePeriodConfiguration$4.FrenchDatePeriodParserConfiguration; + +exports.FrenchTimePeriodExtractorConfiguration = timePeriodConfiguration$4.FrenchTimePeriodExtractorConfiguration; +exports.FrenchTimePeriodParserConfiguration = timePeriodConfiguration$4.FrenchTimePeriodParserConfiguration; + +exports.FrenchDateTimeExtractorConfiguration = dateTimeConfiguration$4.FrenchDateTimeExtractorConfiguration; +exports.FrenchDateTimeParserConfiguration = dateTimeConfiguration$4.FrenchDateTimeParserConfiguration; + +exports.FrenchDateTimePeriodExtractorConfiguration = dateTimePeriodConfiguration$4.FrenchDateTimePeriodExtractorConfiguration; +exports.FrenchDateTimePeriodParserConfiguration = dateTimePeriodConfiguration$4.FrenchDateTimePeriodParserConfiguration; + +exports.FrenchSetExtractorConfiguration = setConfiguration$4.FrenchSetExtractorConfiguration; +exports.FrenchSetParserConfiguration = setConfiguration$4.FrenchSetParserConfiguration; + +exports.FrenchDurationExtractorConfiguration = durationConfiguration$4.FrenchDurationExtractorConfiguration; +exports.FrenchDurationParserConfiguration = durationConfiguration$4.FrenchDurationParserConfiguration; + +exports.FrenchHolidayExtractorConfiguration = holidayConfiguration$4.FrenchHolidayExtractorConfiguration; +exports.FrenchHolidayParserConfiguration = holidayConfiguration$4.FrenchHolidayParserConfiguration; + +exports.FrenchMergedExtractorConfiguration = mergedConfiguration$4.FrenchMergedExtractorConfiguration; +exports.FrenchMergedParserConfiguration = mergedConfiguration$4.FrenchMergedParserConfiguration; + +exports.FrenchTimeParser = timeParser.FrenchTimeParser; + +exports.ChineseDurationExtractor = durationConfiguration$6.ChineseDurationExtractor; +exports.ChineseDurationParser = durationConfiguration$6.ChineseDurationParser; + +exports.ChineseTimeExtractor = timeConfiguration$6.ChineseTimeExtractor; +exports.ChineseTimeParser = timeConfiguration$6.ChineseTimeParser; + +exports.ChineseTimePeriodExtractor = timePeriodConfiguration$6.ChineseTimePeriodExtractor; +exports.ChineseTimePeriodParser = timePeriodConfiguration$6.ChineseTimePeriodParser; + +exports.ChineseDateExtractor = dateConfiguration$6.ChineseDateExtractor; +exports.ChineseDateParser = dateConfiguration$6.ChineseDateParser; + +exports.ChineseDatePeriodExtractor = datePeriodConfiguration$6.ChineseDatePeriodExtractor; +exports.ChineseDatePeriodParser = datePeriodConfiguration$6.ChineseDatePeriodParser; + +exports.ChineseDateTimeExtractor = dateTimeConfiguration$6.ChineseDateTimeExtractor; +exports.ChineseDateTimeParser = dateTimeConfiguration$6.ChineseDateTimeParser; + +exports.ChineseDateTimePeriodExtractor = dateTimePeriodConfiguration$6.ChineseDateTimePeriodExtractor; +exports.ChineseDateTimePeriodParser = dateTimePeriodConfiguration$6.ChineseDateTimePeriodParser; + +exports.ChineseSetExtractor = setConfiguration$6.ChineseSetExtractor; +exports.ChineseSetParser = setConfiguration$6.ChineseSetParser; + +exports.ChineseHolidayExtractorConfiguration = holidayConfiguration$6.ChineseHolidayExtractorConfiguration; +exports.ChineseHolidayParser = holidayConfiguration$6.ChineseHolidayParser; + +exports.ChineseMergedExtractor = mergedConfiguration$6.ChineseMergedExtractor; +exports.ChineseMergedParser = mergedConfiguration$6.ChineseMergedParser; +exports.ChineseFullMergedParser = mergedConfiguration$6.ChineseFullMergedParser; + +exports.BaseDateTime = baseDateTime.BaseDateTime; + +exports.EnglishDateTime = englishDateTime.EnglishDateTime; + +exports.SpanishDateTime = spanishDateTime.SpanishDateTime; + +exports.FrenchDateTime = frenchDateTime.FrenchDateTime; + +exports.ChineseDateTime = chineseDateTime.ChineseDateTime; + +}); + +var recognizersTextDateTime$1 = unwrapExports(recognizersTextDateTime); +var recognizersTextDateTime_1 = recognizersTextDateTime.DateTimeRecognizer; +var recognizersTextDateTime_2 = recognizersTextDateTime.DateTimeOptions; +var recognizersTextDateTime_3 = recognizersTextDateTime.recognizeDateTime; +var recognizersTextDateTime_4 = recognizersTextDateTime.Culture; +var recognizersTextDateTime_5 = recognizersTextDateTime.CultureInfo; +var recognizersTextDateTime_6 = recognizersTextDateTime.BaseDateExtractor; +var recognizersTextDateTime_7 = recognizersTextDateTime.BaseDateParser; +var recognizersTextDateTime_8 = recognizersTextDateTime.BaseTimeExtractor; +var recognizersTextDateTime_9 = recognizersTextDateTime.BaseTimeParser; +var recognizersTextDateTime_10 = recognizersTextDateTime.BaseDatePeriodExtractor; +var recognizersTextDateTime_11 = recognizersTextDateTime.BaseDatePeriodParser; +var recognizersTextDateTime_12 = recognizersTextDateTime.BaseTimePeriodExtractor; +var recognizersTextDateTime_13 = recognizersTextDateTime.BaseTimePeriodParser; +var recognizersTextDateTime_14 = recognizersTextDateTime.BaseDateTimeExtractor; +var recognizersTextDateTime_15 = recognizersTextDateTime.BaseDateTimeParser; +var recognizersTextDateTime_16 = recognizersTextDateTime.BaseDateTimePeriodExtractor; +var recognizersTextDateTime_17 = recognizersTextDateTime.BaseDateTimePeriodParser; +var recognizersTextDateTime_18 = recognizersTextDateTime.BaseDurationExtractor; +var recognizersTextDateTime_19 = recognizersTextDateTime.BaseDurationParser; +var recognizersTextDateTime_20 = recognizersTextDateTime.BaseSetExtractor; +var recognizersTextDateTime_21 = recognizersTextDateTime.BaseSetParser; +var recognizersTextDateTime_22 = recognizersTextDateTime.BaseHolidayExtractor; +var recognizersTextDateTime_23 = recognizersTextDateTime.BaseHolidayParser; +var recognizersTextDateTime_24 = recognizersTextDateTime.BaseHolidayParserConfiguration; +var recognizersTextDateTime_25 = recognizersTextDateTime.BaseMergedExtractor; +var recognizersTextDateTime_26 = recognizersTextDateTime.BaseMergedParser; +var recognizersTextDateTime_27 = recognizersTextDateTime.Constants; +var recognizersTextDateTime_28 = recognizersTextDateTime.TimeTypeConstants; +var recognizersTextDateTime_29 = recognizersTextDateTime.DateTimeModelResult; +var recognizersTextDateTime_30 = recognizersTextDateTime.DateTimeModel; +var recognizersTextDateTime_31 = recognizersTextDateTime.DateTimeParseResult; +var recognizersTextDateTime_32 = recognizersTextDateTime.BaseDateParserConfiguration; +var recognizersTextDateTime_33 = recognizersTextDateTime.Token; +var recognizersTextDateTime_34 = recognizersTextDateTime.AgoLaterMode; +var recognizersTextDateTime_35 = recognizersTextDateTime.AgoLaterUtil; +var recognizersTextDateTime_36 = recognizersTextDateTime.MatchingUtil; +var recognizersTextDateTime_37 = recognizersTextDateTime.FormatUtil; +var recognizersTextDateTime_38 = recognizersTextDateTime.DateTimeResolutionResult; +var recognizersTextDateTime_39 = recognizersTextDateTime.DateUtils; +var recognizersTextDateTime_40 = recognizersTextDateTime.DayOfWeek; +var recognizersTextDateTime_41 = recognizersTextDateTime.EnglishCommonDateTimeParserConfiguration; +var recognizersTextDateTime_42 = recognizersTextDateTime.EnglishDateTimeUtilityConfiguration; +var recognizersTextDateTime_43 = recognizersTextDateTime.EnglishDateExtractorConfiguration; +var recognizersTextDateTime_44 = recognizersTextDateTime.EnglishDateParserConfiguration; +var recognizersTextDateTime_45 = recognizersTextDateTime.EnglishTimeExtractorConfiguration; +var recognizersTextDateTime_46 = recognizersTextDateTime.EnglishTimeParserConfiguration; +var recognizersTextDateTime_47 = recognizersTextDateTime.EnglishDatePeriodExtractorConfiguration; +var recognizersTextDateTime_48 = recognizersTextDateTime.EnglishDatePeriodParserConfiguration; +var recognizersTextDateTime_49 = recognizersTextDateTime.EnglishTimePeriodExtractorConfiguration; +var recognizersTextDateTime_50 = recognizersTextDateTime.EnglishTimePeriodParserConfiguration; +var recognizersTextDateTime_51 = recognizersTextDateTime.EnglishDateTimeExtractorConfiguration; +var recognizersTextDateTime_52 = recognizersTextDateTime.EnglishDateTimeParserConfiguration; +var recognizersTextDateTime_53 = recognizersTextDateTime.EnglishDateTimePeriodExtractorConfiguration; +var recognizersTextDateTime_54 = recognizersTextDateTime.EnglishDateTimePeriodParserConfiguration; +var recognizersTextDateTime_55 = recognizersTextDateTime.EnglishSetExtractorConfiguration; +var recognizersTextDateTime_56 = recognizersTextDateTime.EnglishSetParserConfiguration; +var recognizersTextDateTime_57 = recognizersTextDateTime.EnglishDurationExtractorConfiguration; +var recognizersTextDateTime_58 = recognizersTextDateTime.EnglishDurationParserConfiguration; +var recognizersTextDateTime_59 = recognizersTextDateTime.EnglishHolidayExtractorConfiguration; +var recognizersTextDateTime_60 = recognizersTextDateTime.EnglishHolidayParserConfiguration; +var recognizersTextDateTime_61 = recognizersTextDateTime.EnglishMergedExtractorConfiguration; +var recognizersTextDateTime_62 = recognizersTextDateTime.EnglishMergedParserConfiguration; +var recognizersTextDateTime_63 = recognizersTextDateTime.EnglishTimeParser; +var recognizersTextDateTime_64 = recognizersTextDateTime.SpanishCommonDateTimeParserConfiguration; +var recognizersTextDateTime_65 = recognizersTextDateTime.SpanishDateTimeUtilityConfiguration; +var recognizersTextDateTime_66 = recognizersTextDateTime.SpanishDateExtractorConfiguration; +var recognizersTextDateTime_67 = recognizersTextDateTime.SpanishDateParserConfiguration; +var recognizersTextDateTime_68 = recognizersTextDateTime.SpanishTimeExtractorConfiguration; +var recognizersTextDateTime_69 = recognizersTextDateTime.SpanishTimeParserConfiguration; +var recognizersTextDateTime_70 = recognizersTextDateTime.SpanishDatePeriodExtractorConfiguration; +var recognizersTextDateTime_71 = recognizersTextDateTime.SpanishDatePeriodParserConfiguration; +var recognizersTextDateTime_72 = recognizersTextDateTime.SpanishTimePeriodExtractorConfiguration; +var recognizersTextDateTime_73 = recognizersTextDateTime.SpanishTimePeriodParserConfiguration; +var recognizersTextDateTime_74 = recognizersTextDateTime.SpanishDateTimeExtractorConfiguration; +var recognizersTextDateTime_75 = recognizersTextDateTime.SpanishDateTimeParserConfiguration; +var recognizersTextDateTime_76 = recognizersTextDateTime.SpanishDateTimePeriodExtractorConfiguration; +var recognizersTextDateTime_77 = recognizersTextDateTime.SpanishDateTimePeriodParserConfiguration; +var recognizersTextDateTime_78 = recognizersTextDateTime.SpanishSetExtractorConfiguration; +var recognizersTextDateTime_79 = recognizersTextDateTime.SpanishSetParserConfiguration; +var recognizersTextDateTime_80 = recognizersTextDateTime.SpanishDurationExtractorConfiguration; +var recognizersTextDateTime_81 = recognizersTextDateTime.SpanishDurationParserConfiguration; +var recognizersTextDateTime_82 = recognizersTextDateTime.SpanishHolidayExtractorConfiguration; +var recognizersTextDateTime_83 = recognizersTextDateTime.SpanishHolidayParserConfiguration; +var recognizersTextDateTime_84 = recognizersTextDateTime.SpanishMergedExtractorConfiguration; +var recognizersTextDateTime_85 = recognizersTextDateTime.SpanishMergedParserConfiguration; +var recognizersTextDateTime_86 = recognizersTextDateTime.SpanishDateTimePeriodParser; +var recognizersTextDateTime_87 = recognizersTextDateTime.FrenchCommonDateTimeParserConfiguration; +var recognizersTextDateTime_88 = recognizersTextDateTime.FrenchDateTimeUtilityConfiguration; +var recognizersTextDateTime_89 = recognizersTextDateTime.FrenchDateExtractorConfiguration; +var recognizersTextDateTime_90 = recognizersTextDateTime.FrenchDateParserConfiguration; +var recognizersTextDateTime_91 = recognizersTextDateTime.FrenchTimeExtractorConfiguration; +var recognizersTextDateTime_92 = recognizersTextDateTime.FrenchTimeParserConfiguration; +var recognizersTextDateTime_93 = recognizersTextDateTime.FrenchDatePeriodExtractorConfiguration; +var recognizersTextDateTime_94 = recognizersTextDateTime.FrenchDatePeriodParserConfiguration; +var recognizersTextDateTime_95 = recognizersTextDateTime.FrenchTimePeriodExtractorConfiguration; +var recognizersTextDateTime_96 = recognizersTextDateTime.FrenchTimePeriodParserConfiguration; +var recognizersTextDateTime_97 = recognizersTextDateTime.FrenchDateTimeExtractorConfiguration; +var recognizersTextDateTime_98 = recognizersTextDateTime.FrenchDateTimeParserConfiguration; +var recognizersTextDateTime_99 = recognizersTextDateTime.FrenchDateTimePeriodExtractorConfiguration; +var recognizersTextDateTime_100 = recognizersTextDateTime.FrenchDateTimePeriodParserConfiguration; +var recognizersTextDateTime_101 = recognizersTextDateTime.FrenchSetExtractorConfiguration; +var recognizersTextDateTime_102 = recognizersTextDateTime.FrenchSetParserConfiguration; +var recognizersTextDateTime_103 = recognizersTextDateTime.FrenchDurationExtractorConfiguration; +var recognizersTextDateTime_104 = recognizersTextDateTime.FrenchDurationParserConfiguration; +var recognizersTextDateTime_105 = recognizersTextDateTime.FrenchHolidayExtractorConfiguration; +var recognizersTextDateTime_106 = recognizersTextDateTime.FrenchHolidayParserConfiguration; +var recognizersTextDateTime_107 = recognizersTextDateTime.FrenchMergedExtractorConfiguration; +var recognizersTextDateTime_108 = recognizersTextDateTime.FrenchMergedParserConfiguration; +var recognizersTextDateTime_109 = recognizersTextDateTime.FrenchTimeParser; +var recognizersTextDateTime_110 = recognizersTextDateTime.ChineseDurationExtractor; +var recognizersTextDateTime_111 = recognizersTextDateTime.ChineseDurationParser; +var recognizersTextDateTime_112 = recognizersTextDateTime.ChineseTimeExtractor; +var recognizersTextDateTime_113 = recognizersTextDateTime.ChineseTimeParser; +var recognizersTextDateTime_114 = recognizersTextDateTime.ChineseTimePeriodExtractor; +var recognizersTextDateTime_115 = recognizersTextDateTime.ChineseTimePeriodParser; +var recognizersTextDateTime_116 = recognizersTextDateTime.ChineseDateExtractor; +var recognizersTextDateTime_117 = recognizersTextDateTime.ChineseDateParser; +var recognizersTextDateTime_118 = recognizersTextDateTime.ChineseDatePeriodExtractor; +var recognizersTextDateTime_119 = recognizersTextDateTime.ChineseDatePeriodParser; +var recognizersTextDateTime_120 = recognizersTextDateTime.ChineseDateTimeExtractor; +var recognizersTextDateTime_121 = recognizersTextDateTime.ChineseDateTimeParser; +var recognizersTextDateTime_122 = recognizersTextDateTime.ChineseDateTimePeriodExtractor; +var recognizersTextDateTime_123 = recognizersTextDateTime.ChineseDateTimePeriodParser; +var recognizersTextDateTime_124 = recognizersTextDateTime.ChineseSetExtractor; +var recognizersTextDateTime_125 = recognizersTextDateTime.ChineseSetParser; +var recognizersTextDateTime_126 = recognizersTextDateTime.ChineseHolidayExtractorConfiguration; +var recognizersTextDateTime_127 = recognizersTextDateTime.ChineseHolidayParser; +var recognizersTextDateTime_128 = recognizersTextDateTime.ChineseMergedExtractor; +var recognizersTextDateTime_129 = recognizersTextDateTime.ChineseMergedParser; +var recognizersTextDateTime_130 = recognizersTextDateTime.ChineseFullMergedParser; +var recognizersTextDateTime_131 = recognizersTextDateTime.BaseDateTime; +var recognizersTextDateTime_132 = recognizersTextDateTime.EnglishDateTime; +var recognizersTextDateTime_133 = recognizersTextDateTime.SpanishDateTime; +var recognizersTextDateTime_134 = recognizersTextDateTime.FrenchDateTime; +var recognizersTextDateTime_135 = recognizersTextDateTime.ChineseDateTime; + +exports['default'] = recognizersTextDateTime$1; +exports.DateTimeRecognizer = recognizersTextDateTime_1; +exports.DateTimeOptions = recognizersTextDateTime_2; +exports.recognizeDateTime = recognizersTextDateTime_3; +exports.Culture = recognizersTextDateTime_4; +exports.CultureInfo = recognizersTextDateTime_5; +exports.BaseDateExtractor = recognizersTextDateTime_6; +exports.BaseDateParser = recognizersTextDateTime_7; +exports.BaseTimeExtractor = recognizersTextDateTime_8; +exports.BaseTimeParser = recognizersTextDateTime_9; +exports.BaseDatePeriodExtractor = recognizersTextDateTime_10; +exports.BaseDatePeriodParser = recognizersTextDateTime_11; +exports.BaseTimePeriodExtractor = recognizersTextDateTime_12; +exports.BaseTimePeriodParser = recognizersTextDateTime_13; +exports.BaseDateTimeExtractor = recognizersTextDateTime_14; +exports.BaseDateTimeParser = recognizersTextDateTime_15; +exports.BaseDateTimePeriodExtractor = recognizersTextDateTime_16; +exports.BaseDateTimePeriodParser = recognizersTextDateTime_17; +exports.BaseDurationExtractor = recognizersTextDateTime_18; +exports.BaseDurationParser = recognizersTextDateTime_19; +exports.BaseSetExtractor = recognizersTextDateTime_20; +exports.BaseSetParser = recognizersTextDateTime_21; +exports.BaseHolidayExtractor = recognizersTextDateTime_22; +exports.BaseHolidayParser = recognizersTextDateTime_23; +exports.BaseHolidayParserConfiguration = recognizersTextDateTime_24; +exports.BaseMergedExtractor = recognizersTextDateTime_25; +exports.BaseMergedParser = recognizersTextDateTime_26; +exports.Constants = recognizersTextDateTime_27; +exports.TimeTypeConstants = recognizersTextDateTime_28; +exports.DateTimeModelResult = recognizersTextDateTime_29; +exports.DateTimeModel = recognizersTextDateTime_30; +exports.DateTimeParseResult = recognizersTextDateTime_31; +exports.BaseDateParserConfiguration = recognizersTextDateTime_32; +exports.Token = recognizersTextDateTime_33; +exports.AgoLaterMode = recognizersTextDateTime_34; +exports.AgoLaterUtil = recognizersTextDateTime_35; +exports.MatchingUtil = recognizersTextDateTime_36; +exports.FormatUtil = recognizersTextDateTime_37; +exports.DateTimeResolutionResult = recognizersTextDateTime_38; +exports.DateUtils = recognizersTextDateTime_39; +exports.DayOfWeek = recognizersTextDateTime_40; +exports.EnglishCommonDateTimeParserConfiguration = recognizersTextDateTime_41; +exports.EnglishDateTimeUtilityConfiguration = recognizersTextDateTime_42; +exports.EnglishDateExtractorConfiguration = recognizersTextDateTime_43; +exports.EnglishDateParserConfiguration = recognizersTextDateTime_44; +exports.EnglishTimeExtractorConfiguration = recognizersTextDateTime_45; +exports.EnglishTimeParserConfiguration = recognizersTextDateTime_46; +exports.EnglishDatePeriodExtractorConfiguration = recognizersTextDateTime_47; +exports.EnglishDatePeriodParserConfiguration = recognizersTextDateTime_48; +exports.EnglishTimePeriodExtractorConfiguration = recognizersTextDateTime_49; +exports.EnglishTimePeriodParserConfiguration = recognizersTextDateTime_50; +exports.EnglishDateTimeExtractorConfiguration = recognizersTextDateTime_51; +exports.EnglishDateTimeParserConfiguration = recognizersTextDateTime_52; +exports.EnglishDateTimePeriodExtractorConfiguration = recognizersTextDateTime_53; +exports.EnglishDateTimePeriodParserConfiguration = recognizersTextDateTime_54; +exports.EnglishSetExtractorConfiguration = recognizersTextDateTime_55; +exports.EnglishSetParserConfiguration = recognizersTextDateTime_56; +exports.EnglishDurationExtractorConfiguration = recognizersTextDateTime_57; +exports.EnglishDurationParserConfiguration = recognizersTextDateTime_58; +exports.EnglishHolidayExtractorConfiguration = recognizersTextDateTime_59; +exports.EnglishHolidayParserConfiguration = recognizersTextDateTime_60; +exports.EnglishMergedExtractorConfiguration = recognizersTextDateTime_61; +exports.EnglishMergedParserConfiguration = recognizersTextDateTime_62; +exports.EnglishTimeParser = recognizersTextDateTime_63; +exports.SpanishCommonDateTimeParserConfiguration = recognizersTextDateTime_64; +exports.SpanishDateTimeUtilityConfiguration = recognizersTextDateTime_65; +exports.SpanishDateExtractorConfiguration = recognizersTextDateTime_66; +exports.SpanishDateParserConfiguration = recognizersTextDateTime_67; +exports.SpanishTimeExtractorConfiguration = recognizersTextDateTime_68; +exports.SpanishTimeParserConfiguration = recognizersTextDateTime_69; +exports.SpanishDatePeriodExtractorConfiguration = recognizersTextDateTime_70; +exports.SpanishDatePeriodParserConfiguration = recognizersTextDateTime_71; +exports.SpanishTimePeriodExtractorConfiguration = recognizersTextDateTime_72; +exports.SpanishTimePeriodParserConfiguration = recognizersTextDateTime_73; +exports.SpanishDateTimeExtractorConfiguration = recognizersTextDateTime_74; +exports.SpanishDateTimeParserConfiguration = recognizersTextDateTime_75; +exports.SpanishDateTimePeriodExtractorConfiguration = recognizersTextDateTime_76; +exports.SpanishDateTimePeriodParserConfiguration = recognizersTextDateTime_77; +exports.SpanishSetExtractorConfiguration = recognizersTextDateTime_78; +exports.SpanishSetParserConfiguration = recognizersTextDateTime_79; +exports.SpanishDurationExtractorConfiguration = recognizersTextDateTime_80; +exports.SpanishDurationParserConfiguration = recognizersTextDateTime_81; +exports.SpanishHolidayExtractorConfiguration = recognizersTextDateTime_82; +exports.SpanishHolidayParserConfiguration = recognizersTextDateTime_83; +exports.SpanishMergedExtractorConfiguration = recognizersTextDateTime_84; +exports.SpanishMergedParserConfiguration = recognizersTextDateTime_85; +exports.SpanishDateTimePeriodParser = recognizersTextDateTime_86; +exports.FrenchCommonDateTimeParserConfiguration = recognizersTextDateTime_87; +exports.FrenchDateTimeUtilityConfiguration = recognizersTextDateTime_88; +exports.FrenchDateExtractorConfiguration = recognizersTextDateTime_89; +exports.FrenchDateParserConfiguration = recognizersTextDateTime_90; +exports.FrenchTimeExtractorConfiguration = recognizersTextDateTime_91; +exports.FrenchTimeParserConfiguration = recognizersTextDateTime_92; +exports.FrenchDatePeriodExtractorConfiguration = recognizersTextDateTime_93; +exports.FrenchDatePeriodParserConfiguration = recognizersTextDateTime_94; +exports.FrenchTimePeriodExtractorConfiguration = recognizersTextDateTime_95; +exports.FrenchTimePeriodParserConfiguration = recognizersTextDateTime_96; +exports.FrenchDateTimeExtractorConfiguration = recognizersTextDateTime_97; +exports.FrenchDateTimeParserConfiguration = recognizersTextDateTime_98; +exports.FrenchDateTimePeriodExtractorConfiguration = recognizersTextDateTime_99; +exports.FrenchDateTimePeriodParserConfiguration = recognizersTextDateTime_100; +exports.FrenchSetExtractorConfiguration = recognizersTextDateTime_101; +exports.FrenchSetParserConfiguration = recognizersTextDateTime_102; +exports.FrenchDurationExtractorConfiguration = recognizersTextDateTime_103; +exports.FrenchDurationParserConfiguration = recognizersTextDateTime_104; +exports.FrenchHolidayExtractorConfiguration = recognizersTextDateTime_105; +exports.FrenchHolidayParserConfiguration = recognizersTextDateTime_106; +exports.FrenchMergedExtractorConfiguration = recognizersTextDateTime_107; +exports.FrenchMergedParserConfiguration = recognizersTextDateTime_108; +exports.FrenchTimeParser = recognizersTextDateTime_109; +exports.ChineseDurationExtractor = recognizersTextDateTime_110; +exports.ChineseDurationParser = recognizersTextDateTime_111; +exports.ChineseTimeExtractor = recognizersTextDateTime_112; +exports.ChineseTimeParser = recognizersTextDateTime_113; +exports.ChineseTimePeriodExtractor = recognizersTextDateTime_114; +exports.ChineseTimePeriodParser = recognizersTextDateTime_115; +exports.ChineseDateExtractor = recognizersTextDateTime_116; +exports.ChineseDateParser = recognizersTextDateTime_117; +exports.ChineseDatePeriodExtractor = recognizersTextDateTime_118; +exports.ChineseDatePeriodParser = recognizersTextDateTime_119; +exports.ChineseDateTimeExtractor = recognizersTextDateTime_120; +exports.ChineseDateTimeParser = recognizersTextDateTime_121; +exports.ChineseDateTimePeriodExtractor = recognizersTextDateTime_122; +exports.ChineseDateTimePeriodParser = recognizersTextDateTime_123; +exports.ChineseSetExtractor = recognizersTextDateTime_124; +exports.ChineseSetParser = recognizersTextDateTime_125; +exports.ChineseHolidayExtractorConfiguration = recognizersTextDateTime_126; +exports.ChineseHolidayParser = recognizersTextDateTime_127; +exports.ChineseMergedExtractor = recognizersTextDateTime_128; +exports.ChineseMergedParser = recognizersTextDateTime_129; +exports.ChineseFullMergedParser = recognizersTextDateTime_130; +exports.BaseDateTime = recognizersTextDateTime_131; +exports.EnglishDateTime = recognizersTextDateTime_132; +exports.SpanishDateTime = recognizersTextDateTime_133; +exports.FrenchDateTime = recognizersTextDateTime_134; +exports.ChineseDateTime = recognizersTextDateTime_135; + +return exports; + +}({})); +//# sourceMappingURL=recognizers-text-date-time.browser.js.map diff --git a/libraries/botbuilder-stdlib/vendors/@microsoft/recognizers-text-date-time/dist/recognizers-text-date-time.es5.js b/libraries/botbuilder-stdlib/vendors/@microsoft/recognizers-text-date-time/dist/recognizers-text-date-time.es5.js new file mode 100644 index 0000000000..54b1d079ef --- /dev/null +++ b/libraries/botbuilder-stdlib/vendors/@microsoft/recognizers-text-date-time/dist/recognizers-text-date-time.es5.js @@ -0,0 +1,35124 @@ +var commonjsGlobal = typeof window !== 'undefined' ? window : typeof global !== 'undefined' ? global : typeof self !== 'undefined' ? self : {}; + + + +function unwrapExports (x) { + return x && x.__esModule && Object.prototype.hasOwnProperty.call(x, 'default') ? x['default'] : x; +} + +function createCommonjsModule(fn, module) { + return module = { exports: {} }, fn(module, module.exports), module.exports; +} + +var culture = createCommonjsModule(function (module, exports) { +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +class Culture { + constructor(cultureName, cultureCode) { + this.cultureName = cultureName; + this.cultureCode = cultureCode; + } + static getSupportedCultureCodes() { + return Culture.supportedCultures.map(c => c.cultureCode); + } + static mapToNearestLanguage(cultureCode) { + if (cultureCode !== undefined) { + cultureCode = cultureCode.toLowerCase(); + var supportedCultureCodes = Culture.getSupportedCultureCodes(); + if (supportedCultureCodes.indexOf(cultureCode) < 0) { + var culturePrefix = cultureCode.split('-')[0].trim(); + supportedCultureCodes.forEach(function (supportedCultureCode) { + if (supportedCultureCode.startsWith(culturePrefix)) { + cultureCode = supportedCultureCode; + } + }); + } + } + return cultureCode; + } +} +Culture.English = "en-us"; +Culture.Chinese = "zh-cn"; +Culture.Spanish = "es-es"; +Culture.Portuguese = "pt-br"; +Culture.French = "fr-fr"; +Culture.German = "de-de"; +Culture.Japanese = "ja-jp"; +Culture.Dutch = "nl-nl"; +Culture.Italian = "it-it"; +Culture.supportedCultures = [ + new Culture("English", Culture.English), + new Culture("Chinese", Culture.Chinese), + new Culture("Spanish", Culture.Spanish), + new Culture("Portuguese", Culture.Portuguese), + new Culture("French", Culture.French), + new Culture("German", Culture.German), + new Culture("Japanese", Culture.Japanese), + new Culture("Dutch", Culture.Dutch), + new Culture("Italian", Culture.Italian) +]; +exports.Culture = Culture; +class CultureInfo { + static getCultureInfo(cultureCode) { + return new CultureInfo(cultureCode); + } + constructor(cultureName) { + this.code = cultureName; + } +} +exports.CultureInfo = CultureInfo; + +}); + +unwrapExports(culture); + +var xregexp = createCommonjsModule(function (module, exports) { +"use strict"; + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.default = void 0; + +function _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _nonIterableRest(); } + +function _nonIterableRest() { throw new TypeError("Invalid attempt to destructure non-iterable instance"); } + +function _iterableToArrayLimit(arr, i) { var _arr = []; var _n = true; var _d = false; var _e = undefined; try { for (var _i = arr[Symbol.iterator](), _s; !(_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; } + +function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; } + +/*! + * XRegExp 4.2.0 + * + * Steven Levithan (c) 2007-present MIT License + */ + +/** + * XRegExp provides augmented, extensible regular expressions. You get additional regex syntax and + * flags, beyond what browsers support natively. XRegExp is also a regex utility belt with tools to + * make your client-side grepping simpler and more powerful, while freeing you from related + * cross-browser inconsistencies. + */ +// ==--------------------------== +// Private stuff +// ==--------------------------== +// Property name used for extended regex instance data +var REGEX_DATA = 'xregexp'; // Optional features that can be installed and uninstalled + +var features = { + astral: false, + namespacing: false +}; // Native methods to use and restore ('native' is an ES3 reserved keyword) + +var nativ = { + exec: RegExp.prototype.exec, + test: RegExp.prototype.test, + match: String.prototype.match, + replace: String.prototype.replace, + split: String.prototype.split +}; // Storage for fixed/extended native methods + +var fixed = {}; // Storage for regexes cached by `XRegExp.cache` + +var regexCache = {}; // Storage for pattern details cached by the `XRegExp` constructor + +var patternCache = {}; // Storage for regex syntax tokens added internally or by `XRegExp.addToken` + +var tokens = []; // Token scopes + +var defaultScope = 'default'; +var classScope = 'class'; // Regexes that match native regex syntax, including octals + +var nativeTokens = { + // Any native multicharacter token in default scope, or any single character + 'default': /\\(?:0(?:[0-3][0-7]{0,2}|[4-7][0-7]?)?|[1-9]\d*|x[\dA-Fa-f]{2}|u(?:[\dA-Fa-f]{4}|{[\dA-Fa-f]+})|c[A-Za-z]|[\s\S])|\(\?(?:[:=!]|<[=!])|[?*+]\?|{\d+(?:,\d*)?}\??|[\s\S]/, + // Any native multicharacter token in character class scope, or any single character + 'class': /\\(?:[0-3][0-7]{0,2}|[4-7][0-7]?|x[\dA-Fa-f]{2}|u(?:[\dA-Fa-f]{4}|{[\dA-Fa-f]+})|c[A-Za-z]|[\s\S])|[\s\S]/ +}; // Any backreference or dollar-prefixed character in replacement strings + +var replacementToken = /\$(?:{([\w$]+)}|<([\w$]+)>|(\d\d?|[\s\S]))/g; // Check for correct `exec` handling of nonparticipating capturing groups + +var correctExecNpcg = nativ.exec.call(/()??/, '')[1] === undefined; // Check for ES6 `flags` prop support + +var hasFlagsProp = /x/.flags !== undefined; // Shortcut to `Object.prototype.toString` + +var _ref = {}, + toString = _ref.toString; + +function hasNativeFlag(flag) { + // Can't check based on the presence of properties/getters since browsers might support such + // properties even when they don't support the corresponding flag in regex construction (tested + // in Chrome 48, where `'unicode' in /x/` is true but trying to construct a regex with flag `u` + // throws an error) + var isSupported = true; + + try { + // Can't use regex literals for testing even in a `try` because regex literals with + // unsupported flags cause a compilation error in IE + new RegExp('', flag); + } catch (exception) { + isSupported = false; + } + + return isSupported; +} // Check for ES6 `u` flag support + + +var hasNativeU = hasNativeFlag('u'); // Check for ES6 `y` flag support + +var hasNativeY = hasNativeFlag('y'); // Tracker for known flags, including addon flags + +var registeredFlags = { + g: true, + i: true, + m: true, + u: hasNativeU, + y: hasNativeY +}; +/** + * Attaches extended data and `XRegExp.prototype` properties to a regex object. + * + * @private + * @param {RegExp} regex Regex to augment. + * @param {Array} captureNames Array with capture names, or `null`. + * @param {String} xSource XRegExp pattern used to generate `regex`, or `null` if N/A. + * @param {String} xFlags XRegExp flags used to generate `regex`, or `null` if N/A. + * @param {Boolean} [isInternalOnly=false] Whether the regex will be used only for internal + * operations, and never exposed to users. For internal-only regexes, we can improve perf by + * skipping some operations like attaching `XRegExp.prototype` properties. + * @returns {RegExp} Augmented regex. + */ + +function augment(regex, captureNames, xSource, xFlags, isInternalOnly) { + regex[REGEX_DATA] = { + captureNames: captureNames + }; + + if (isInternalOnly) { + return regex; + } // Can't auto-inherit these since the XRegExp constructor returns a nonprimitive value + + + if (regex.__proto__) { + regex.__proto__ = XRegExp.prototype; + } else { + for (var p in XRegExp.prototype) { + // An `XRegExp.prototype.hasOwnProperty(p)` check wouldn't be worth it here, since this + // is performance sensitive, and enumerable `Object.prototype` or `RegExp.prototype` + // extensions exist on `regex.prototype` anyway + regex[p] = XRegExp.prototype[p]; + } + } + + regex[REGEX_DATA].source = xSource; // Emulate the ES6 `flags` prop by ensuring flags are in alphabetical order + + regex[REGEX_DATA].flags = xFlags ? xFlags.split('').sort().join('') : xFlags; + return regex; +} +/** + * Removes any duplicate characters from the provided string. + * + * @private + * @param {String} str String to remove duplicate characters from. + * @returns {String} String with any duplicate characters removed. + */ + + +function clipDuplicates(str) { + return nativ.replace.call(str, /([\s\S])(?=[\s\S]*\1)/g, ''); +} +/** + * Copies a regex object while preserving extended data and augmenting with `XRegExp.prototype` + * properties. The copy has a fresh `lastIndex` property (set to zero). Allows adding and removing + * flags g and y while copying the regex. + * + * @private + * @param {RegExp} regex Regex to copy. + * @param {Object} [options] Options object with optional properties: + * - `addG` {Boolean} Add flag g while copying the regex. + * - `addY` {Boolean} Add flag y while copying the regex. + * - `removeG` {Boolean} Remove flag g while copying the regex. + * - `removeY` {Boolean} Remove flag y while copying the regex. + * - `isInternalOnly` {Boolean} Whether the copied regex will be used only for internal + * operations, and never exposed to users. For internal-only regexes, we can improve perf by + * skipping some operations like attaching `XRegExp.prototype` properties. + * - `source` {String} Overrides `.source`, for special cases. + * @returns {RegExp} Copy of the provided regex, possibly with modified flags. + */ + + +function copyRegex(regex, options) { + if (!XRegExp.isRegExp(regex)) { + throw new TypeError('Type RegExp expected'); + } + + var xData = regex[REGEX_DATA] || {}; + var flags = getNativeFlags(regex); + var flagsToAdd = ''; + var flagsToRemove = ''; + var xregexpSource = null; + var xregexpFlags = null; + options = options || {}; + + if (options.removeG) { + flagsToRemove += 'g'; + } + + if (options.removeY) { + flagsToRemove += 'y'; + } + + if (flagsToRemove) { + flags = nativ.replace.call(flags, new RegExp("[".concat(flagsToRemove, "]+"), 'g'), ''); + } + + if (options.addG) { + flagsToAdd += 'g'; + } + + if (options.addY) { + flagsToAdd += 'y'; + } + + if (flagsToAdd) { + flags = clipDuplicates(flags + flagsToAdd); + } + + if (!options.isInternalOnly) { + if (xData.source !== undefined) { + xregexpSource = xData.source; + } // null or undefined; don't want to add to `flags` if the previous value was null, since + // that indicates we're not tracking original precompilation flags + + + if (xData.flags != null) { + // Flags are only added for non-internal regexes by `XRegExp.globalize`. Flags are never + // removed for non-internal regexes, so don't need to handle it + xregexpFlags = flagsToAdd ? clipDuplicates(xData.flags + flagsToAdd) : xData.flags; + } + } // Augment with `XRegExp.prototype` properties, but use the native `RegExp` constructor to avoid + // searching for special tokens. That would be wrong for regexes constructed by `RegExp`, and + // unnecessary for regexes constructed by `XRegExp` because the regex has already undergone the + // translation to native regex syntax + + + regex = augment(new RegExp(options.source || regex.source, flags), hasNamedCapture(regex) ? xData.captureNames.slice(0) : null, xregexpSource, xregexpFlags, options.isInternalOnly); + return regex; +} +/** + * Converts hexadecimal to decimal. + * + * @private + * @param {String} hex + * @returns {Number} + */ + + +function dec(hex) { + return parseInt(hex, 16); +} +/** + * Returns a pattern that can be used in a native RegExp in place of an ignorable token such as an + * inline comment or whitespace with flag x. This is used directly as a token handler function + * passed to `XRegExp.addToken`. + * + * @private + * @param {String} match Match arg of `XRegExp.addToken` handler + * @param {String} scope Scope arg of `XRegExp.addToken` handler + * @param {String} flags Flags arg of `XRegExp.addToken` handler + * @returns {String} Either '' or '(?:)', depending on which is needed in the context of the match. + */ + + +function getContextualTokenSeparator(match, scope, flags) { + if ( // No need to separate tokens if at the beginning or end of a group + match.input[match.index - 1] === '(' || match.input[match.index + match[0].length] === ')' || // No need to separate tokens if before or after a `|` + match.input[match.index - 1] === '|' || match.input[match.index + match[0].length] === '|' || // No need to separate tokens if at the beginning or end of the pattern + match.index < 1 || match.index + match[0].length >= match.input.length || // No need to separate tokens if at the beginning of a noncapturing group or lookahead. + // The way this is written relies on: + // - The search regex matching only 3-char strings. + // - Although `substr` gives chars from the end of the string if given a negative index, + // the resulting substring will be too short to match. Ex: `'abcd'.substr(-1, 3) === 'd'` + nativ.test.call(/^\(\?[:=!]/, match.input.substr(match.index - 3, 3)) || // Avoid separating tokens when the following token is a quantifier + isQuantifierNext(match.input, match.index + match[0].length, flags)) { + return ''; + } // Keep tokens separated. This avoids e.g. inadvertedly changing `\1 1` or `\1(?#)1` to `\11`. + // This also ensures all tokens remain as discrete atoms, e.g. it avoids converting the syntax + // error `(? :` into `(?:`. + + + return '(?:)'; +} +/** + * Returns native `RegExp` flags used by a regex object. + * + * @private + * @param {RegExp} regex Regex to check. + * @returns {String} Native flags in use. + */ + + +function getNativeFlags(regex) { + return hasFlagsProp ? regex.flags : // Explicitly using `RegExp.prototype.toString` (rather than e.g. `String` or concatenation + // with an empty string) allows this to continue working predictably when + // `XRegExp.proptotype.toString` is overridden + nativ.exec.call(/\/([a-z]*)$/i, RegExp.prototype.toString.call(regex))[1]; +} +/** + * Determines whether a regex has extended instance data used to track capture names. + * + * @private + * @param {RegExp} regex Regex to check. + * @returns {Boolean} Whether the regex uses named capture. + */ + + +function hasNamedCapture(regex) { + return !!(regex[REGEX_DATA] && regex[REGEX_DATA].captureNames); +} +/** + * Converts decimal to hexadecimal. + * + * @private + * @param {Number|String} dec + * @returns {String} + */ + + +function hex(dec) { + return parseInt(dec, 10).toString(16); +} +/** + * Checks whether the next nonignorable token after the specified position is a quantifier. + * + * @private + * @param {String} pattern Pattern to search within. + * @param {Number} pos Index in `pattern` to search at. + * @param {String} flags Flags used by the pattern. + * @returns {Boolean} Whether the next nonignorable token is a quantifier. + */ + + +function isQuantifierNext(pattern, pos, flags) { + return nativ.test.call(flags.indexOf('x') !== -1 ? // Ignore any leading whitespace, line comments, and inline comments + /^(?:\s|#[^#\n]*|\(\?#[^)]*\))*(?:[?*+]|{\d+(?:,\d*)?})/ : // Ignore any leading inline comments + /^(?:\(\?#[^)]*\))*(?:[?*+]|{\d+(?:,\d*)?})/, pattern.slice(pos)); +} +/** + * Determines whether a value is of the specified type, by resolving its internal [[Class]]. + * + * @private + * @param {*} value Object to check. + * @param {String} type Type to check for, in TitleCase. + * @returns {Boolean} Whether the object matches the type. + */ + + +function isType(value, type) { + return toString.call(value) === "[object ".concat(type, "]"); +} +/** + * Adds leading zeros if shorter than four characters. Used for fixed-length hexadecimal values. + * + * @private + * @param {String} str + * @returns {String} + */ + + +function pad4(str) { + while (str.length < 4) { + str = "0".concat(str); + } + + return str; +} +/** + * Checks for flag-related errors, and strips/applies flags in a leading mode modifier. Offloads + * the flag preparation logic from the `XRegExp` constructor. + * + * @private + * @param {String} pattern Regex pattern, possibly with a leading mode modifier. + * @param {String} flags Any combination of flags. + * @returns {Object} Object with properties `pattern` and `flags`. + */ + + +function prepareFlags(pattern, flags) { + // Recent browsers throw on duplicate flags, so copy this behavior for nonnative flags + if (clipDuplicates(flags) !== flags) { + throw new SyntaxError("Invalid duplicate regex flag ".concat(flags)); + } // Strip and apply a leading mode modifier with any combination of flags except g or y + + + pattern = nativ.replace.call(pattern, /^\(\?([\w$]+)\)/, function ($0, $1) { + if (nativ.test.call(/[gy]/, $1)) { + throw new SyntaxError("Cannot use flag g or y in mode modifier ".concat($0)); + } // Allow duplicate flags within the mode modifier + + + flags = clipDuplicates(flags + $1); + return ''; + }); // Throw on unknown native or nonnative flags + + var _iteratorNormalCompletion = true; + var _didIteratorError = false; + var _iteratorError = undefined; + + try { + for (var _iterator = flags[Symbol.iterator](), _step; !(_iteratorNormalCompletion = (_step = _iterator.next()).done); _iteratorNormalCompletion = true) { + var flag = _step.value; + + if (!registeredFlags[flag]) { + throw new SyntaxError("Unknown regex flag ".concat(flag)); + } + } + } catch (err) { + _didIteratorError = true; + _iteratorError = err; + } finally { + try { + if (!_iteratorNormalCompletion && _iterator.return != null) { + _iterator.return(); + } + } finally { + if (_didIteratorError) { + throw _iteratorError; + } + } + } + + return { + pattern: pattern, + flags: flags + }; +} +/** + * Prepares an options object from the given value. + * + * @private + * @param {String|Object} value Value to convert to an options object. + * @returns {Object} Options object. + */ + + +function prepareOptions(value) { + var options = {}; + + if (isType(value, 'String')) { + XRegExp.forEach(value, /[^\s,]+/, function (match) { + options[match] = true; + }); + return options; + } + + return value; +} +/** + * Registers a flag so it doesn't throw an 'unknown flag' error. + * + * @private + * @param {String} flag Single-character flag to register. + */ + + +function registerFlag(flag) { + if (!/^[\w$]$/.test(flag)) { + throw new Error('Flag must be a single character A-Za-z0-9_$'); + } + + registeredFlags[flag] = true; +} +/** + * Runs built-in and custom regex syntax tokens in reverse insertion order at the specified + * position, until a match is found. + * + * @private + * @param {String} pattern Original pattern from which an XRegExp object is being built. + * @param {String} flags Flags being used to construct the regex. + * @param {Number} pos Position to search for tokens within `pattern`. + * @param {Number} scope Regex scope to apply: 'default' or 'class'. + * @param {Object} context Context object to use for token handler functions. + * @returns {Object} Object with properties `matchLength`, `output`, and `reparse`; or `null`. + */ + + +function runTokens(pattern, flags, pos, scope, context) { + var i = tokens.length; + var leadChar = pattern[pos]; + var result = null; + var match; + var t; // Run in reverse insertion order + + while (i--) { + t = tokens[i]; + + if (t.leadChar && t.leadChar !== leadChar || t.scope !== scope && t.scope !== 'all' || t.flag && !(flags.indexOf(t.flag) !== -1)) { + continue; + } + + match = XRegExp.exec(pattern, t.regex, pos, 'sticky'); + + if (match) { + result = { + matchLength: match[0].length, + output: t.handler.call(context, match, scope, flags), + reparse: t.reparse + }; // Finished with token tests + + break; + } + } + + return result; +} +/** + * Enables or disables implicit astral mode opt-in. When enabled, flag A is automatically added to + * all new regexes created by XRegExp. This causes an error to be thrown when creating regexes if + * the Unicode Base addon is not available, since flag A is registered by that addon. + * + * @private + * @param {Boolean} on `true` to enable; `false` to disable. + */ + + +function setAstral(on) { + features.astral = on; +} +/** + * Adds named capture groups to the `groups` property of match arrays. See here for details: + * https://github.com/tc39/proposal-regexp-named-groups + * + * @private + * @param {Boolean} on `true` to enable; `false` to disable. + */ + + +function setNamespacing(on) { + features.namespacing = on; +} +/** + * Returns the object, or throws an error if it is `null` or `undefined`. This is used to follow + * the ES5 abstract operation `ToObject`. + * + * @private + * @param {*} value Object to check and return. + * @returns {*} The provided object. + */ + + +function toObject(value) { + // null or undefined + if (value == null) { + throw new TypeError('Cannot convert null or undefined to object'); + } + + return value; +} // ==--------------------------== +// Constructor +// ==--------------------------== + +/** + * Creates an extended regular expression object for matching text with a pattern. Differs from a + * native regular expression in that additional syntax and flags are supported. The returned object + * is in fact a native `RegExp` and works with all native methods. + * + * @class XRegExp + * @constructor + * @param {String|RegExp} pattern Regex pattern string, or an existing regex object to copy. + * @param {String} [flags] Any combination of flags. + * Native flags: + * - `g` - global + * - `i` - ignore case + * - `m` - multiline anchors + * - `u` - unicode (ES6) + * - `y` - sticky (Firefox 3+, ES6) + * Additional XRegExp flags: + * - `n` - explicit capture + * - `s` - dot matches all (aka singleline) + * - `x` - free-spacing and line comments (aka extended) + * - `A` - astral (requires the Unicode Base addon) + * Flags cannot be provided when constructing one `RegExp` from another. + * @returns {RegExp} Extended regular expression object. + * @example + * + * // With named capture and flag x + * XRegExp(`(? [0-9]{4} ) -? # year + * (? [0-9]{2} ) -? # month + * (? [0-9]{2} ) # day`, 'x'); + * + * // Providing a regex object copies it. Native regexes are recompiled using native (not XRegExp) + * // syntax. Copies maintain extended data, are augmented with `XRegExp.prototype` properties, and + * // have fresh `lastIndex` properties (set to zero). + * XRegExp(/regex/); + */ + + +function XRegExp(pattern, flags) { + if (XRegExp.isRegExp(pattern)) { + if (flags !== undefined) { + throw new TypeError('Cannot supply flags when copying a RegExp'); + } + + return copyRegex(pattern); + } // Copy the argument behavior of `RegExp` + + + pattern = pattern === undefined ? '' : String(pattern); + flags = flags === undefined ? '' : String(flags); + + if (XRegExp.isInstalled('astral') && !(flags.indexOf('A') !== -1)) { + // This causes an error to be thrown if the Unicode Base addon is not available + flags += 'A'; + } + + if (!patternCache[pattern]) { + patternCache[pattern] = {}; + } + + if (!patternCache[pattern][flags]) { + var context = { + hasNamedCapture: false, + captureNames: [] + }; + var scope = defaultScope; + var output = ''; + var pos = 0; + var result; // Check for flag-related errors, and strip/apply flags in a leading mode modifier + + var applied = prepareFlags(pattern, flags); + var appliedPattern = applied.pattern; + var appliedFlags = applied.flags; // Use XRegExp's tokens to translate the pattern to a native regex pattern. + // `appliedPattern.length` may change on each iteration if tokens use `reparse` + + while (pos < appliedPattern.length) { + do { + // Check for custom tokens at the current position + result = runTokens(appliedPattern, appliedFlags, pos, scope, context); // If the matched token used the `reparse` option, splice its output into the + // pattern before running tokens again at the same position + + if (result && result.reparse) { + appliedPattern = appliedPattern.slice(0, pos) + result.output + appliedPattern.slice(pos + result.matchLength); + } + } while (result && result.reparse); + + if (result) { + output += result.output; + pos += result.matchLength || 1; + } else { + // Get the native token at the current position + var _XRegExp$exec = XRegExp.exec(appliedPattern, nativeTokens[scope], pos, 'sticky'), + _XRegExp$exec2 = _slicedToArray(_XRegExp$exec, 1), + token = _XRegExp$exec2[0]; + + output += token; + pos += token.length; + + if (token === '[' && scope === defaultScope) { + scope = classScope; + } else if (token === ']' && scope === classScope) { + scope = defaultScope; + } + } + } + + patternCache[pattern][flags] = { + // Use basic cleanup to collapse repeated empty groups like `(?:)(?:)` to `(?:)`. Empty + // groups are sometimes inserted during regex transpilation in order to keep tokens + // separated. However, more than one empty group in a row is never needed. + pattern: nativ.replace.call(output, /(?:\(\?:\))+/g, '(?:)'), + // Strip all but native flags + flags: nativ.replace.call(appliedFlags, /[^gimuy]+/g, ''), + // `context.captureNames` has an item for each capturing group, even if unnamed + captures: context.hasNamedCapture ? context.captureNames : null + }; + } + + var generated = patternCache[pattern][flags]; + return augment(new RegExp(generated.pattern, generated.flags), generated.captures, pattern, flags); +} // Add `RegExp.prototype` to the prototype chain + + +XRegExp.prototype = /(?:)/; // ==--------------------------== +// Public properties +// ==--------------------------== + +/** + * The XRegExp version number as a string containing three dot-separated parts. For example, + * '2.0.0-beta-3'. + * + * @static + * @memberOf XRegExp + * @type String + */ + +XRegExp.version = '4.2.0'; // ==--------------------------== +// Public methods +// ==--------------------------== +// Intentionally undocumented; used in tests and addons + +XRegExp._clipDuplicates = clipDuplicates; +XRegExp._hasNativeFlag = hasNativeFlag; +XRegExp._dec = dec; +XRegExp._hex = hex; +XRegExp._pad4 = pad4; +/** + * Extends XRegExp syntax and allows custom flags. This is used internally and can be used to + * create XRegExp addons. If more than one token can match the same string, the last added wins. + * + * @memberOf XRegExp + * @param {RegExp} regex Regex object that matches the new token. + * @param {Function} handler Function that returns a new pattern string (using native regex syntax) + * to replace the matched token within all future XRegExp regexes. Has access to persistent + * properties of the regex being built, through `this`. Invoked with three arguments: + * - The match array, with named backreference properties. + * - The regex scope where the match was found: 'default' or 'class'. + * - The flags used by the regex, including any flags in a leading mode modifier. + * The handler function becomes part of the XRegExp construction process, so be careful not to + * construct XRegExps within the function or you will trigger infinite recursion. + * @param {Object} [options] Options object with optional properties: + * - `scope` {String} Scope where the token applies: 'default', 'class', or 'all'. + * - `flag` {String} Single-character flag that triggers the token. This also registers the + * flag, which prevents XRegExp from throwing an 'unknown flag' error when the flag is used. + * - `optionalFlags` {String} Any custom flags checked for within the token `handler` that are + * not required to trigger the token. This registers the flags, to prevent XRegExp from + * throwing an 'unknown flag' error when any of the flags are used. + * - `reparse` {Boolean} Whether the `handler` function's output should not be treated as + * final, and instead be reparseable by other tokens (including the current token). Allows + * token chaining or deferring. + * - `leadChar` {String} Single character that occurs at the beginning of any successful match + * of the token (not always applicable). This doesn't change the behavior of the token unless + * you provide an erroneous value. However, providing it can increase the token's performance + * since the token can be skipped at any positions where this character doesn't appear. + * @example + * + * // Basic usage: Add \a for the ALERT control code + * XRegExp.addToken( + * /\\a/, + * () => '\\x07', + * {scope: 'all'} + * ); + * XRegExp('\\a[\\a-\\n]+').test('\x07\n\x07'); // -> true + * + * // Add the U (ungreedy) flag from PCRE and RE2, which reverses greedy and lazy quantifiers. + * // Since `scope` is not specified, it uses 'default' (i.e., transformations apply outside of + * // character classes only) + * XRegExp.addToken( + * /([?*+]|{\d+(?:,\d*)?})(\??)/, + * (match) => `${match[1]}${match[2] ? '' : '?'}`, + * {flag: 'U'} + * ); + * XRegExp('a+', 'U').exec('aaa')[0]; // -> 'a' + * XRegExp('a+?', 'U').exec('aaa')[0]; // -> 'aaa' + */ + +XRegExp.addToken = function (regex, handler, options) { + options = options || {}; + var _options = options, + optionalFlags = _options.optionalFlags; + + if (options.flag) { + registerFlag(options.flag); + } + + if (optionalFlags) { + optionalFlags = nativ.split.call(optionalFlags, ''); + var _iteratorNormalCompletion2 = true; + var _didIteratorError2 = false; + var _iteratorError2 = undefined; + + try { + for (var _iterator2 = optionalFlags[Symbol.iterator](), _step2; !(_iteratorNormalCompletion2 = (_step2 = _iterator2.next()).done); _iteratorNormalCompletion2 = true) { + var flag = _step2.value; + registerFlag(flag); + } + } catch (err) { + _didIteratorError2 = true; + _iteratorError2 = err; + } finally { + try { + if (!_iteratorNormalCompletion2 && _iterator2.return != null) { + _iterator2.return(); + } + } finally { + if (_didIteratorError2) { + throw _iteratorError2; + } + } + } + } // Add to the private list of syntax tokens + + + tokens.push({ + regex: copyRegex(regex, { + addG: true, + addY: hasNativeY, + isInternalOnly: true + }), + handler: handler, + scope: options.scope || defaultScope, + flag: options.flag, + reparse: options.reparse, + leadChar: options.leadChar + }); // Reset the pattern cache used by the `XRegExp` constructor, since the same pattern and flags + // might now produce different results + + XRegExp.cache.flush('patterns'); +}; +/** + * Caches and returns the result of calling `XRegExp(pattern, flags)`. On any subsequent call with + * the same pattern and flag combination, the cached copy of the regex is returned. + * + * @memberOf XRegExp + * @param {String} pattern Regex pattern string. + * @param {String} [flags] Any combination of XRegExp flags. + * @returns {RegExp} Cached XRegExp object. + * @example + * + * while (match = XRegExp.cache('.', 'gs').exec(str)) { + * // The regex is compiled once only + * } + */ + + +XRegExp.cache = function (pattern, flags) { + if (!regexCache[pattern]) { + regexCache[pattern] = {}; + } + + return regexCache[pattern][flags] || (regexCache[pattern][flags] = XRegExp(pattern, flags)); +}; // Intentionally undocumented; used in tests + + +XRegExp.cache.flush = function (cacheName) { + if (cacheName === 'patterns') { + // Flush the pattern cache used by the `XRegExp` constructor + patternCache = {}; + } else { + // Flush the regex cache populated by `XRegExp.cache` + regexCache = {}; + } +}; +/** + * Escapes any regular expression metacharacters, for use when matching literal strings. The result + * can safely be used at any point within a regex that uses any flags. + * + * @memberOf XRegExp + * @param {String} str String to escape. + * @returns {String} String with regex metacharacters escaped. + * @example + * + * XRegExp.escape('Escaped? <.>'); + * // -> 'Escaped\?\ <\.>' + */ + + +XRegExp.escape = function (str) { + return nativ.replace.call(toObject(str), /[-\[\]{}()*+?.,\\^$|#\s]/g, '\\$&'); +}; +/** + * Executes a regex search in a specified string. Returns a match array or `null`. If the provided + * regex uses named capture, named backreference properties are included on the match array. + * Optional `pos` and `sticky` arguments specify the search start position, and whether the match + * must start at the specified position only. The `lastIndex` property of the provided regex is not + * used, but is updated for compatibility. Also fixes browser bugs compared to the native + * `RegExp.prototype.exec` and can be used reliably cross-browser. + * + * @memberOf XRegExp + * @param {String} str String to search. + * @param {RegExp} regex Regex to search with. + * @param {Number} [pos=0] Zero-based index at which to start the search. + * @param {Boolean|String} [sticky=false] Whether the match must start at the specified position + * only. The string `'sticky'` is accepted as an alternative to `true`. + * @returns {Array} Match array with named backreference properties, or `null`. + * @example + * + * // Basic use, with named backreference + * let match = XRegExp.exec('U+2620', XRegExp('U\\+(?[0-9A-F]{4})')); + * match.hex; // -> '2620' + * + * // With pos and sticky, in a loop + * let pos = 2, result = [], match; + * while (match = XRegExp.exec('<1><2><3><4>5<6>', /<(\d)>/, pos, 'sticky')) { + * result.push(match[1]); + * pos = match.index + match[0].length; + * } + * // result -> ['2', '3', '4'] + */ + + +XRegExp.exec = function (str, regex, pos, sticky) { + var cacheKey = 'g'; + var addY = false; + var fakeY = false; + var match; + addY = hasNativeY && !!(sticky || regex.sticky && sticky !== false); + + if (addY) { + cacheKey += 'y'; + } else if (sticky) { + // Simulate sticky matching by appending an empty capture to the original regex. The + // resulting regex will succeed no matter what at the current index (set with `lastIndex`), + // and will not search the rest of the subject string. We'll know that the original regex + // has failed if that last capture is `''` rather than `undefined` (i.e., if that last + // capture participated in the match). + fakeY = true; + cacheKey += 'FakeY'; + } + + regex[REGEX_DATA] = regex[REGEX_DATA] || {}; // Shares cached copies with `XRegExp.match`/`replace` + + var r2 = regex[REGEX_DATA][cacheKey] || (regex[REGEX_DATA][cacheKey] = copyRegex(regex, { + addG: true, + addY: addY, + source: fakeY ? "".concat(regex.source, "|()") : undefined, + removeY: sticky === false, + isInternalOnly: true + })); + pos = pos || 0; + r2.lastIndex = pos; // Fixed `exec` required for `lastIndex` fix, named backreferences, etc. + + match = fixed.exec.call(r2, str); // Get rid of the capture added by the pseudo-sticky matcher if needed. An empty string means + // the original regexp failed (see above). + + if (fakeY && match && match.pop() === '') { + match = null; + } + + if (regex.global) { + regex.lastIndex = match ? r2.lastIndex : 0; + } + + return match; +}; +/** + * Executes a provided function once per regex match. Searches always start at the beginning of the + * string and continue until the end, regardless of the state of the regex's `global` property and + * initial `lastIndex`. + * + * @memberOf XRegExp + * @param {String} str String to search. + * @param {RegExp} regex Regex to search with. + * @param {Function} callback Function to execute for each match. Invoked with four arguments: + * - The match array, with named backreference properties. + * - The zero-based match index. + * - The string being traversed. + * - The regex object being used to traverse the string. + * @example + * + * // Extracts every other digit from a string + * const evens = []; + * XRegExp.forEach('1a2345', /\d/, (match, i) => { + * if (i % 2) evens.push(+match[0]); + * }); + * // evens -> [2, 4] + */ + + +XRegExp.forEach = function (str, regex, callback) { + var pos = 0; + var i = -1; + var match; + + while (match = XRegExp.exec(str, regex, pos)) { + // Because `regex` is provided to `callback`, the function could use the deprecated/ + // nonstandard `RegExp.prototype.compile` to mutate the regex. However, since `XRegExp.exec` + // doesn't use `lastIndex` to set the search position, this can't lead to an infinite loop, + // at least. Actually, because of the way `XRegExp.exec` caches globalized versions of + // regexes, mutating the regex will not have any effect on the iteration or matched strings, + // which is a nice side effect that brings extra safety. + callback(match, ++i, str, regex); + pos = match.index + (match[0].length || 1); + } +}; +/** + * Copies a regex object and adds flag `g`. The copy maintains extended data, is augmented with + * `XRegExp.prototype` properties, and has a fresh `lastIndex` property (set to zero). Native + * regexes are not recompiled using XRegExp syntax. + * + * @memberOf XRegExp + * @param {RegExp} regex Regex to globalize. + * @returns {RegExp} Copy of the provided regex with flag `g` added. + * @example + * + * const globalCopy = XRegExp.globalize(/regex/); + * globalCopy.global; // -> true + */ + + +XRegExp.globalize = function (regex) { + return copyRegex(regex, { + addG: true + }); +}; +/** + * Installs optional features according to the specified options. Can be undone using + * `XRegExp.uninstall`. + * + * @memberOf XRegExp + * @param {Object|String} options Options object or string. + * @example + * + * // With an options object + * XRegExp.install({ + * // Enables support for astral code points in Unicode addons (implicitly sets flag A) + * astral: true, + * + * // Adds named capture groups to the `groups` property of matches + * namespacing: true + * }); + * + * // With an options string + * XRegExp.install('astral namespacing'); + */ + + +XRegExp.install = function (options) { + options = prepareOptions(options); + + if (!features.astral && options.astral) { + setAstral(true); + } + + if (!features.namespacing && options.namespacing) { + setNamespacing(true); + } +}; +/** + * Checks whether an individual optional feature is installed. + * + * @memberOf XRegExp + * @param {String} feature Name of the feature to check. One of: + * - `astral` + * - `namespacing` + * @returns {Boolean} Whether the feature is installed. + * @example + * + * XRegExp.isInstalled('astral'); + */ + + +XRegExp.isInstalled = function (feature) { + return !!features[feature]; +}; +/** + * Returns `true` if an object is a regex; `false` if it isn't. This works correctly for regexes + * created in another frame, when `instanceof` and `constructor` checks would fail. + * + * @memberOf XRegExp + * @param {*} value Object to check. + * @returns {Boolean} Whether the object is a `RegExp` object. + * @example + * + * XRegExp.isRegExp('string'); // -> false + * XRegExp.isRegExp(/regex/i); // -> true + * XRegExp.isRegExp(RegExp('^', 'm')); // -> true + * XRegExp.isRegExp(XRegExp('(?s).')); // -> true + */ + + +XRegExp.isRegExp = function (value) { + return toString.call(value) === '[object RegExp]'; +}; // isType(value, 'RegExp'); + +/** + * Returns the first matched string, or in global mode, an array containing all matched strings. + * This is essentially a more convenient re-implementation of `String.prototype.match` that gives + * the result types you actually want (string instead of `exec`-style array in match-first mode, + * and an empty array instead of `null` when no matches are found in match-all mode). It also lets + * you override flag g and ignore `lastIndex`, and fixes browser bugs. + * + * @memberOf XRegExp + * @param {String} str String to search. + * @param {RegExp} regex Regex to search with. + * @param {String} [scope='one'] Use 'one' to return the first match as a string. Use 'all' to + * return an array of all matched strings. If not explicitly specified and `regex` uses flag g, + * `scope` is 'all'. + * @returns {String|Array} In match-first mode: First match as a string, or `null`. In match-all + * mode: Array of all matched strings, or an empty array. + * @example + * + * // Match first + * XRegExp.match('abc', /\w/); // -> 'a' + * XRegExp.match('abc', /\w/g, 'one'); // -> 'a' + * XRegExp.match('abc', /x/g, 'one'); // -> null + * + * // Match all + * XRegExp.match('abc', /\w/g); // -> ['a', 'b', 'c'] + * XRegExp.match('abc', /\w/, 'all'); // -> ['a', 'b', 'c'] + * XRegExp.match('abc', /x/, 'all'); // -> [] + */ + + +XRegExp.match = function (str, regex, scope) { + var global = regex.global && scope !== 'one' || scope === 'all'; + var cacheKey = (global ? 'g' : '') + (regex.sticky ? 'y' : '') || 'noGY'; + regex[REGEX_DATA] = regex[REGEX_DATA] || {}; // Shares cached copies with `XRegExp.exec`/`replace` + + var r2 = regex[REGEX_DATA][cacheKey] || (regex[REGEX_DATA][cacheKey] = copyRegex(regex, { + addG: !!global, + removeG: scope === 'one', + isInternalOnly: true + })); + var result = nativ.match.call(toObject(str), r2); + + if (regex.global) { + regex.lastIndex = scope === 'one' && result ? // Can't use `r2.lastIndex` since `r2` is nonglobal in this case + result.index + result[0].length : 0; + } + + return global ? result || [] : result && result[0]; +}; +/** + * Retrieves the matches from searching a string using a chain of regexes that successively search + * within previous matches. The provided `chain` array can contain regexes and or objects with + * `regex` and `backref` properties. When a backreference is specified, the named or numbered + * backreference is passed forward to the next regex or returned. + * + * @memberOf XRegExp + * @param {String} str String to search. + * @param {Array} chain Regexes that each search for matches within preceding results. + * @returns {Array} Matches by the last regex in the chain, or an empty array. + * @example + * + * // Basic usage; matches numbers within tags + * XRegExp.matchChain('1 2 3 4 a 56', [ + * XRegExp('(?is).*?'), + * /\d+/ + * ]); + * // -> ['2', '4', '56'] + * + * // Passing forward and returning specific backreferences + * html = '
XRegExp\ + * Google'; + * XRegExp.matchChain(html, [ + * {regex: //i, backref: 1}, + * {regex: XRegExp('(?i)^https?://(?[^/?#]+)'), backref: 'domain'} + * ]); + * // -> ['xregexp.com', 'www.google.com'] + */ + + +XRegExp.matchChain = function (str, chain) { + return function recurseChain(values, level) { + var item = chain[level].regex ? chain[level] : { + regex: chain[level] + }; + var matches = []; + + function addMatch(match) { + if (item.backref) { + var ERR_UNDEFINED_GROUP = "Backreference to undefined group: ".concat(item.backref); + var isNamedBackref = isNaN(item.backref); + + if (isNamedBackref && XRegExp.isInstalled('namespacing')) { + // `groups` has `null` as prototype, so using `in` instead of `hasOwnProperty` + if (!(item.backref in match.groups)) { + throw new ReferenceError(ERR_UNDEFINED_GROUP); + } + } else if (!match.hasOwnProperty(item.backref)) { + throw new ReferenceError(ERR_UNDEFINED_GROUP); + } + + var backrefValue = isNamedBackref && XRegExp.isInstalled('namespacing') ? match.groups[item.backref] : match[item.backref]; + matches.push(backrefValue || ''); + } else { + matches.push(match[0]); + } + } + + var _iteratorNormalCompletion3 = true; + var _didIteratorError3 = false; + var _iteratorError3 = undefined; + + try { + for (var _iterator3 = values[Symbol.iterator](), _step3; !(_iteratorNormalCompletion3 = (_step3 = _iterator3.next()).done); _iteratorNormalCompletion3 = true) { + var value = _step3.value; + XRegExp.forEach(value, item.regex, addMatch); + } + } catch (err) { + _didIteratorError3 = true; + _iteratorError3 = err; + } finally { + try { + if (!_iteratorNormalCompletion3 && _iterator3.return != null) { + _iterator3.return(); + } + } finally { + if (_didIteratorError3) { + throw _iteratorError3; + } + } + } + + return level === chain.length - 1 || !matches.length ? matches : recurseChain(matches, level + 1); + }([str], 0); +}; +/** + * Returns a new string with one or all matches of a pattern replaced. The pattern can be a string + * or regex, and the replacement can be a string or a function to be called for each match. To + * perform a global search and replace, use the optional `scope` argument or include flag g if using + * a regex. Replacement strings can use `${n}` or `$` for named and numbered backreferences. + * Replacement functions can use named backreferences via `arguments[0].name`. Also fixes browser + * bugs compared to the native `String.prototype.replace` and can be used reliably cross-browser. + * + * @memberOf XRegExp + * @param {String} str String to search. + * @param {RegExp|String} search Search pattern to be replaced. + * @param {String|Function} replacement Replacement string or a function invoked to create it. + * Replacement strings can include special replacement syntax: + * - $$ - Inserts a literal $ character. + * - $&, $0 - Inserts the matched substring. + * - $` - Inserts the string that precedes the matched substring (left context). + * - $' - Inserts the string that follows the matched substring (right context). + * - $n, $nn - Where n/nn are digits referencing an existent capturing group, inserts + * backreference n/nn. + * - ${n}, $ - Where n is a name or any number of digits that reference an existent capturing + * group, inserts backreference n. + * Replacement functions are invoked with three or more arguments: + * - The matched substring (corresponds to $& above). Named backreferences are accessible as + * properties of this first argument. + * - 0..n arguments, one for each backreference (corresponding to $1, $2, etc. above). + * - The zero-based index of the match within the total search string. + * - The total string being searched. + * @param {String} [scope='one'] Use 'one' to replace the first match only, or 'all'. If not + * explicitly specified and using a regex with flag g, `scope` is 'all'. + * @returns {String} New string with one or all matches replaced. + * @example + * + * // Regex search, using named backreferences in replacement string + * const name = XRegExp('(?\\w+) (?\\w+)'); + * XRegExp.replace('John Smith', name, '$, $'); + * // -> 'Smith, John' + * + * // Regex search, using named backreferences in replacement function + * XRegExp.replace('John Smith', name, (match) => `${match.last}, ${match.first}`); + * // -> 'Smith, John' + * + * // String search, with replace-all + * XRegExp.replace('RegExp builds RegExps', 'RegExp', 'XRegExp', 'all'); + * // -> 'XRegExp builds XRegExps' + */ + + +XRegExp.replace = function (str, search, replacement, scope) { + var isRegex = XRegExp.isRegExp(search); + var global = search.global && scope !== 'one' || scope === 'all'; + var cacheKey = (global ? 'g' : '') + (search.sticky ? 'y' : '') || 'noGY'; + var s2 = search; + + if (isRegex) { + search[REGEX_DATA] = search[REGEX_DATA] || {}; // Shares cached copies with `XRegExp.exec`/`match`. Since a copy is used, `search`'s + // `lastIndex` isn't updated *during* replacement iterations + + s2 = search[REGEX_DATA][cacheKey] || (search[REGEX_DATA][cacheKey] = copyRegex(search, { + addG: !!global, + removeG: scope === 'one', + isInternalOnly: true + })); + } else if (global) { + s2 = new RegExp(XRegExp.escape(String(search)), 'g'); + } // Fixed `replace` required for named backreferences, etc. + + + var result = fixed.replace.call(toObject(str), s2, replacement); + + if (isRegex && search.global) { + // Fixes IE, Safari bug (last tested IE 9, Safari 5.1) + search.lastIndex = 0; + } + + return result; +}; +/** + * Performs batch processing of string replacements. Used like `XRegExp.replace`, but accepts an + * array of replacement details. Later replacements operate on the output of earlier replacements. + * Replacement details are accepted as an array with a regex or string to search for, the + * replacement string or function, and an optional scope of 'one' or 'all'. Uses the XRegExp + * replacement text syntax, which supports named backreference properties via `${name}` or + * `$`. + * + * @memberOf XRegExp + * @param {String} str String to search. + * @param {Array} replacements Array of replacement detail arrays. + * @returns {String} New string with all replacements. + * @example + * + * str = XRegExp.replaceEach(str, [ + * [XRegExp('(?a)'), 'z${name}'], + * [/b/gi, 'y'], + * [/c/g, 'x', 'one'], // scope 'one' overrides /g + * [/d/, 'w', 'all'], // scope 'all' overrides lack of /g + * ['e', 'v', 'all'], // scope 'all' allows replace-all for strings + * [/f/g, ($0) => $0.toUpperCase()] + * ]); + */ + + +XRegExp.replaceEach = function (str, replacements) { + var _iteratorNormalCompletion4 = true; + var _didIteratorError4 = false; + var _iteratorError4 = undefined; + + try { + for (var _iterator4 = replacements[Symbol.iterator](), _step4; !(_iteratorNormalCompletion4 = (_step4 = _iterator4.next()).done); _iteratorNormalCompletion4 = true) { + var r = _step4.value; + str = XRegExp.replace(str, r[0], r[1], r[2]); + } + } catch (err) { + _didIteratorError4 = true; + _iteratorError4 = err; + } finally { + try { + if (!_iteratorNormalCompletion4 && _iterator4.return != null) { + _iterator4.return(); + } + } finally { + if (_didIteratorError4) { + throw _iteratorError4; + } + } + } + + return str; +}; +/** + * Splits a string into an array of strings using a regex or string separator. Matches of the + * separator are not included in the result array. However, if `separator` is a regex that contains + * capturing groups, backreferences are spliced into the result each time `separator` is matched. + * Fixes browser bugs compared to the native `String.prototype.split` and can be used reliably + * cross-browser. + * + * @memberOf XRegExp + * @param {String} str String to split. + * @param {RegExp|String} separator Regex or string to use for separating the string. + * @param {Number} [limit] Maximum number of items to include in the result array. + * @returns {Array} Array of substrings. + * @example + * + * // Basic use + * XRegExp.split('a b c', ' '); + * // -> ['a', 'b', 'c'] + * + * // With limit + * XRegExp.split('a b c', ' ', 2); + * // -> ['a', 'b'] + * + * // Backreferences in result array + * XRegExp.split('..word1..', /([a-z]+)(\d+)/i); + * // -> ['..', 'word', '1', '..'] + */ + + +XRegExp.split = function (str, separator, limit) { + return fixed.split.call(toObject(str), separator, limit); +}; +/** + * Executes a regex search in a specified string. Returns `true` or `false`. Optional `pos` and + * `sticky` arguments specify the search start position, and whether the match must start at the + * specified position only. The `lastIndex` property of the provided regex is not used, but is + * updated for compatibility. Also fixes browser bugs compared to the native + * `RegExp.prototype.test` and can be used reliably cross-browser. + * + * @memberOf XRegExp + * @param {String} str String to search. + * @param {RegExp} regex Regex to search with. + * @param {Number} [pos=0] Zero-based index at which to start the search. + * @param {Boolean|String} [sticky=false] Whether the match must start at the specified position + * only. The string `'sticky'` is accepted as an alternative to `true`. + * @returns {Boolean} Whether the regex matched the provided value. + * @example + * + * // Basic use + * XRegExp.test('abc', /c/); // -> true + * + * // With pos and sticky + * XRegExp.test('abc', /c/, 0, 'sticky'); // -> false + * XRegExp.test('abc', /c/, 2, 'sticky'); // -> true + */ +// Do this the easy way :-) + + +XRegExp.test = function (str, regex, pos, sticky) { + return !!XRegExp.exec(str, regex, pos, sticky); +}; +/** + * Uninstalls optional features according to the specified options. All optional features start out + * uninstalled, so this is used to undo the actions of `XRegExp.install`. + * + * @memberOf XRegExp + * @param {Object|String} options Options object or string. + * @example + * + * // With an options object + * XRegExp.uninstall({ + * // Disables support for astral code points in Unicode addons + * astral: true, + * + * // Don't add named capture groups to the `groups` property of matches + * namespacing: true + * }); + * + * // With an options string + * XRegExp.uninstall('astral namespacing'); + */ + + +XRegExp.uninstall = function (options) { + options = prepareOptions(options); + + if (features.astral && options.astral) { + setAstral(false); + } + + if (features.namespacing && options.namespacing) { + setNamespacing(false); + } +}; +/** + * Returns an XRegExp object that is the union of the given patterns. Patterns can be provided as + * regex objects or strings. Metacharacters are escaped in patterns provided as strings. + * Backreferences in provided regex objects are automatically renumbered to work correctly within + * the larger combined pattern. Native flags used by provided regexes are ignored in favor of the + * `flags` argument. + * + * @memberOf XRegExp + * @param {Array} patterns Regexes and strings to combine. + * @param {String} [flags] Any combination of XRegExp flags. + * @param {Object} [options] Options object with optional properties: + * - `conjunction` {String} Type of conjunction to use: 'or' (default) or 'none'. + * @returns {RegExp} Union of the provided regexes and strings. + * @example + * + * XRegExp.union(['a+b*c', /(dogs)\1/, /(cats)\1/], 'i'); + * // -> /a\+b\*c|(dogs)\1|(cats)\2/i + * + * XRegExp.union([/man/, /bear/, /pig/], 'i', {conjunction: 'none'}); + * // -> /manbearpig/i + */ + + +XRegExp.union = function (patterns, flags, options) { + options = options || {}; + var conjunction = options.conjunction || 'or'; + var numCaptures = 0; + var numPriorCaptures; + var captureNames; + + function rewrite(match, paren, backref) { + var name = captureNames[numCaptures - numPriorCaptures]; // Capturing group + + if (paren) { + ++numCaptures; // If the current capture has a name, preserve the name + + if (name) { + return "(?<".concat(name, ">"); + } // Backreference + + } else if (backref) { + // Rewrite the backreference + return "\\".concat(+backref + numPriorCaptures); + } + + return match; + } + + if (!(isType(patterns, 'Array') && patterns.length)) { + throw new TypeError('Must provide a nonempty array of patterns to merge'); + } + + var parts = /(\()(?!\?)|\\([1-9]\d*)|\\[\s\S]|\[(?:[^\\\]]|\\[\s\S])*\]/g; + var output = []; + var _iteratorNormalCompletion5 = true; + var _didIteratorError5 = false; + var _iteratorError5 = undefined; + + try { + for (var _iterator5 = patterns[Symbol.iterator](), _step5; !(_iteratorNormalCompletion5 = (_step5 = _iterator5.next()).done); _iteratorNormalCompletion5 = true) { + var pattern = _step5.value; + + if (XRegExp.isRegExp(pattern)) { + numPriorCaptures = numCaptures; + captureNames = pattern[REGEX_DATA] && pattern[REGEX_DATA].captureNames || []; // Rewrite backreferences. Passing to XRegExp dies on octals and ensures patterns are + // independently valid; helps keep this simple. Named captures are put back + + output.push(nativ.replace.call(XRegExp(pattern.source).source, parts, rewrite)); + } else { + output.push(XRegExp.escape(pattern)); + } + } + } catch (err) { + _didIteratorError5 = true; + _iteratorError5 = err; + } finally { + try { + if (!_iteratorNormalCompletion5 && _iterator5.return != null) { + _iterator5.return(); + } + } finally { + if (_didIteratorError5) { + throw _iteratorError5; + } + } + } + + var separator = conjunction === 'none' ? '' : '|'; + return XRegExp(output.join(separator), flags); +}; // ==--------------------------== +// Fixed/extended native methods +// ==--------------------------== + +/** + * Adds named capture support (with backreferences returned as `result.name`), and fixes browser + * bugs in the native `RegExp.prototype.exec`. Use via `XRegExp.exec`. + * + * @memberOf RegExp + * @param {String} str String to search. + * @returns {Array} Match array with named backreference properties, or `null`. + */ + + +fixed.exec = function (str) { + var origLastIndex = this.lastIndex; + var match = nativ.exec.apply(this, arguments); + + if (match) { + // Fix browsers whose `exec` methods don't return `undefined` for nonparticipating capturing + // groups. This fixes IE 5.5-8, but not IE 9's quirks mode or emulation of older IEs. IE 9 + // in standards mode follows the spec. + if (!correctExecNpcg && match.length > 1 && match.indexOf('') !== -1) { + var r2 = copyRegex(this, { + removeG: true, + isInternalOnly: true + }); // Using `str.slice(match.index)` rather than `match[0]` in case lookahead allowed + // matching due to characters outside the match + + nativ.replace.call(String(str).slice(match.index), r2, function () { + var len = arguments.length; // Skip index 0 and the last 2 + + for (var i = 1; i < len - 2; ++i) { + if ((i < 0 || arguments.length <= i ? undefined : arguments[i]) === undefined) { + match[i] = undefined; + } + } + }); + } // Attach named capture properties + + + var groupsObject = match; + + if (XRegExp.isInstalled('namespacing')) { + // https://tc39.github.io/proposal-regexp-named-groups/#sec-regexpbuiltinexec + match.groups = Object.create(null); + groupsObject = match.groups; + } + + if (this[REGEX_DATA] && this[REGEX_DATA].captureNames) { + // Skip index 0 + for (var i = 1; i < match.length; ++i) { + var name = this[REGEX_DATA].captureNames[i - 1]; + + if (name) { + groupsObject[name] = match[i]; + } + } + } // Fix browsers that increment `lastIndex` after zero-length matches + + + if (this.global && !match[0].length && this.lastIndex > match.index) { + this.lastIndex = match.index; + } + } + + if (!this.global) { + // Fixes IE, Opera bug (last tested IE 9, Opera 11.6) + this.lastIndex = origLastIndex; + } + + return match; +}; +/** + * Fixes browser bugs in the native `RegExp.prototype.test`. + * + * @memberOf RegExp + * @param {String} str String to search. + * @returns {Boolean} Whether the regex matched the provided value. + */ + + +fixed.test = function (str) { + // Do this the easy way :-) + return !!fixed.exec.call(this, str); +}; +/** + * Adds named capture support (with backreferences returned as `result.name`), and fixes browser + * bugs in the native `String.prototype.match`. + * + * @memberOf String + * @param {RegExp|*} regex Regex to search with. If not a regex object, it is passed to `RegExp`. + * @returns {Array} If `regex` uses flag g, an array of match strings or `null`. Without flag g, + * the result of calling `regex.exec(this)`. + */ + + +fixed.match = function (regex) { + if (!XRegExp.isRegExp(regex)) { + // Use the native `RegExp` rather than `XRegExp` + regex = new RegExp(regex); + } else if (regex.global) { + var result = nativ.match.apply(this, arguments); // Fixes IE bug + + regex.lastIndex = 0; + return result; + } + + return fixed.exec.call(regex, toObject(this)); +}; +/** + * Adds support for `${n}` (or `$`) tokens for named and numbered backreferences in replacement + * text, and provides named backreferences to replacement functions as `arguments[0].name`. Also + * fixes browser bugs in replacement text syntax when performing a replacement using a nonregex + * search value, and the value of a replacement regex's `lastIndex` property during replacement + * iterations and upon completion. Note that this doesn't support SpiderMonkey's proprietary third + * (`flags`) argument. Use via `XRegExp.replace`. + * + * @memberOf String + * @param {RegExp|String} search Search pattern to be replaced. + * @param {String|Function} replacement Replacement string or a function invoked to create it. + * @returns {String} New string with one or all matches replaced. + */ + + +fixed.replace = function (search, replacement) { + var isRegex = XRegExp.isRegExp(search); + var origLastIndex; + var captureNames; + var result; + + if (isRegex) { + if (search[REGEX_DATA]) { + captureNames = search[REGEX_DATA].captureNames; + } // Only needed if `search` is nonglobal + + + origLastIndex = search.lastIndex; + } else { + search += ''; // Type-convert + } // Don't use `typeof`; some older browsers return 'function' for regex objects + + + if (isType(replacement, 'Function')) { + // Stringifying `this` fixes a bug in IE < 9 where the last argument in replacement + // functions isn't type-converted to a string + result = nativ.replace.call(String(this), search, function () { + for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) { + args[_key] = arguments[_key]; + } + + if (captureNames) { + var groupsObject; + + if (XRegExp.isInstalled('namespacing')) { + // https://tc39.github.io/proposal-regexp-named-groups/#sec-regexpbuiltinexec + groupsObject = Object.create(null); + args.push(groupsObject); + } else { + // Change the `args[0]` string primitive to a `String` object that can store + // properties. This really does need to use `String` as a constructor + args[0] = new String(args[0]); + groupsObject = args[0]; + } // Store named backreferences + + + for (var i = 0; i < captureNames.length; ++i) { + if (captureNames[i]) { + groupsObject[captureNames[i]] = args[i + 1]; + } + } + } // Update `lastIndex` before calling `replacement`. Fixes IE, Chrome, Firefox, Safari + // bug (last tested IE 9, Chrome 17, Firefox 11, Safari 5.1) + + + if (isRegex && search.global) { + search.lastIndex = args[args.length - 2] + args[0].length; + } // ES6 specs the context for replacement functions as `undefined` + + + return replacement.apply(void 0, args); + }); + } else { + // Ensure that the last value of `args` will be a string when given nonstring `this`, + // while still throwing on null or undefined context + result = nativ.replace.call(this == null ? this : String(this), search, function () { + for (var _len2 = arguments.length, args = new Array(_len2), _key2 = 0; _key2 < _len2; _key2++) { + args[_key2] = arguments[_key2]; + } + + return nativ.replace.call(String(replacement), replacementToken, replacer); + + function replacer($0, bracketed, angled, dollarToken) { + bracketed = bracketed || angled; // Named or numbered backreference with curly or angled braces + + if (bracketed) { + // XRegExp behavior for `${n}` or `$`: + // 1. Backreference to numbered capture, if `n` is an integer. Use `0` for the + // entire match. Any number of leading zeros may be used. + // 2. Backreference to named capture `n`, if it exists and is not an integer + // overridden by numbered capture. In practice, this does not overlap with + // numbered capture since XRegExp does not allow named capture to use a bare + // integer as the name. + // 3. If the name or number does not refer to an existing capturing group, it's + // an error. + var n = +bracketed; // Type-convert; drop leading zeros + + if (n <= args.length - 3) { + return args[n] || ''; + } // Groups with the same name is an error, else would need `lastIndexOf` + + + n = captureNames ? captureNames.indexOf(bracketed) : -1; + + if (n < 0) { + throw new SyntaxError("Backreference to undefined group ".concat($0)); + } + + return args[n + 1] || ''; + } // Else, special variable or numbered backreference without curly braces + + + if (dollarToken === '$') { + // $$ + return '$'; + } + + if (dollarToken === '&' || +dollarToken === 0) { + // $&, $0 (not followed by 1-9), $00 + return args[0]; + } + + if (dollarToken === '`') { + // $` (left context) + return args[args.length - 1].slice(0, args[args.length - 2]); + } + + if (dollarToken === "'") { + // $' (right context) + return args[args.length - 1].slice(args[args.length - 2] + args[0].length); + } // Else, numbered backreference without braces + + + dollarToken = +dollarToken; // Type-convert; drop leading zero + // XRegExp behavior for `$n` and `$nn`: + // - Backrefs end after 1 or 2 digits. Use `${..}` or `$<..>` for more digits. + // - `$1` is an error if no capturing groups. + // - `$10` is an error if less than 10 capturing groups. Use `${1}0` or `$<1>0` + // instead. + // - `$01` is `$1` if at least one capturing group, else it's an error. + // - `$0` (not followed by 1-9) and `$00` are the entire match. + // Native behavior, for comparison: + // - Backrefs end after 1 or 2 digits. Cannot reference capturing group 100+. + // - `$1` is a literal `$1` if no capturing groups. + // - `$10` is `$1` followed by a literal `0` if less than 10 capturing groups. + // - `$01` is `$1` if at least one capturing group, else it's a literal `$01`. + // - `$0` is a literal `$0`. + + if (!isNaN(dollarToken)) { + if (dollarToken > args.length - 3) { + throw new SyntaxError("Backreference to undefined group ".concat($0)); + } + + return args[dollarToken] || ''; + } // `$` followed by an unsupported char is an error, unlike native JS + + + throw new SyntaxError("Invalid token ".concat($0)); + } + }); + } + + if (isRegex) { + if (search.global) { + // Fixes IE, Safari bug (last tested IE 9, Safari 5.1) + search.lastIndex = 0; + } else { + // Fixes IE, Opera bug (last tested IE 9, Opera 11.6) + search.lastIndex = origLastIndex; + } + } + + return result; +}; +/** + * Fixes browser bugs in the native `String.prototype.split`. Use via `XRegExp.split`. + * + * @memberOf String + * @param {RegExp|String} separator Regex or string to use for separating the string. + * @param {Number} [limit] Maximum number of items to include in the result array. + * @returns {Array} Array of substrings. + */ + + +fixed.split = function (separator, limit) { + if (!XRegExp.isRegExp(separator)) { + // Browsers handle nonregex split correctly, so use the faster native method + return nativ.split.apply(this, arguments); + } + + var str = String(this); + var output = []; + var origLastIndex = separator.lastIndex; + var lastLastIndex = 0; + var lastLength; // Values for `limit`, per the spec: + // If undefined: pow(2,32) - 1 + // If 0, Infinity, or NaN: 0 + // If positive number: limit = floor(limit); if (limit >= pow(2,32)) limit -= pow(2,32); + // If negative number: pow(2,32) - floor(abs(limit)) + // If other: Type-convert, then use the above rules + // This line fails in very strange ways for some values of `limit` in Opera 10.5-10.63, unless + // Opera Dragonfly is open (go figure). It works in at least Opera 9.5-10.1 and 11+ + + limit = (limit === undefined ? -1 : limit) >>> 0; + XRegExp.forEach(str, separator, function (match) { + // This condition is not the same as `if (match[0].length)` + if (match.index + match[0].length > lastLastIndex) { + output.push(str.slice(lastLastIndex, match.index)); + + if (match.length > 1 && match.index < str.length) { + Array.prototype.push.apply(output, match.slice(1)); + } + + lastLength = match[0].length; + lastLastIndex = match.index + lastLength; + } + }); + + if (lastLastIndex === str.length) { + if (!nativ.test.call(separator, '') || lastLength) { + output.push(''); + } + } else { + output.push(str.slice(lastLastIndex)); + } + + separator.lastIndex = origLastIndex; + return output.length > limit ? output.slice(0, limit) : output; +}; // ==--------------------------== +// Built-in syntax/flag tokens +// ==--------------------------== + +/* + * Letter escapes that natively match literal characters: `\a`, `\A`, etc. These should be + * SyntaxErrors but are allowed in web reality. XRegExp makes them errors for cross-browser + * consistency and to reserve their syntax, but lets them be superseded by addons. + */ + + +XRegExp.addToken(/\\([ABCE-RTUVXYZaeg-mopqyz]|c(?![A-Za-z])|u(?![\dA-Fa-f]{4}|{[\dA-Fa-f]+})|x(?![\dA-Fa-f]{2}))/, function (match, scope) { + // \B is allowed in default scope only + if (match[1] === 'B' && scope === defaultScope) { + return match[0]; + } + + throw new SyntaxError("Invalid escape ".concat(match[0])); +}, { + scope: 'all', + leadChar: '\\' +}); +/* + * Unicode code point escape with curly braces: `\u{N..}`. `N..` is any one or more digit + * hexadecimal number from 0-10FFFF, and can include leading zeros. Requires the native ES6 `u` flag + * to support code points greater than U+FFFF. Avoids converting code points above U+FFFF to + * surrogate pairs (which could be done without flag `u`), since that could lead to broken behavior + * if you follow a `\u{N..}` token that references a code point above U+FFFF with a quantifier, or + * if you use the same in a character class. + */ + +XRegExp.addToken(/\\u{([\dA-Fa-f]+)}/, function (match, scope, flags) { + var code = dec(match[1]); + + if (code > 0x10FFFF) { + throw new SyntaxError("Invalid Unicode code point ".concat(match[0])); + } + + if (code <= 0xFFFF) { + // Converting to \uNNNN avoids needing to escape the literal character and keep it + // separate from preceding tokens + return "\\u".concat(pad4(hex(code))); + } // If `code` is between 0xFFFF and 0x10FFFF, require and defer to native handling + + + if (hasNativeU && flags.indexOf('u') !== -1) { + return match[0]; + } + + throw new SyntaxError('Cannot use Unicode code point above \\u{FFFF} without flag u'); +}, { + scope: 'all', + leadChar: '\\' +}); +/* + * Empty character class: `[]` or `[^]`. This fixes a critical cross-browser syntax inconsistency. + * Unless this is standardized (per the ES spec), regex syntax can't be accurately parsed because + * character class endings can't be determined. + */ + +XRegExp.addToken(/\[(\^?)\]/, // For cross-browser compatibility with ES3, convert [] to \b\B and [^] to [\s\S]. +// (?!) should work like \b\B, but is unreliable in some versions of Firefox + +/* eslint-disable no-confusing-arrow */ +function (match) { + return match[1] ? '[\\s\\S]' : '\\b\\B'; +}, +/* eslint-enable no-confusing-arrow */ +{ + leadChar: '[' +}); +/* + * Comment pattern: `(?# )`. Inline comments are an alternative to the line comments allowed in + * free-spacing mode (flag x). + */ + +XRegExp.addToken(/\(\?#[^)]*\)/, getContextualTokenSeparator, { + leadChar: '(' +}); +/* + * Whitespace and line comments, in free-spacing mode (aka extended mode, flag x) only. + */ + +XRegExp.addToken(/\s+|#[^\n]*\n?/, getContextualTokenSeparator, { + flag: 'x' +}); +/* + * Dot, in dotall mode (aka singleline mode, flag s) only. + */ + +XRegExp.addToken(/\./, function () { + return '[\\s\\S]'; +}, { + flag: 's', + leadChar: '.' +}); +/* + * Named backreference: `\k`. Backreference names can use the characters A-Z, a-z, 0-9, _, + * and $ only. Also allows numbered backreferences as `\k`. + */ + +XRegExp.addToken(/\\k<([\w$]+)>/, function (match) { + // Groups with the same name is an error, else would need `lastIndexOf` + var index = isNaN(match[1]) ? this.captureNames.indexOf(match[1]) + 1 : +match[1]; + var endIndex = match.index + match[0].length; + + if (!index || index > this.captureNames.length) { + throw new SyntaxError("Backreference to undefined group ".concat(match[0])); + } // Keep backreferences separate from subsequent literal numbers. This avoids e.g. + // inadvertedly changing `(?)\k1` to `()\11`. + + + return "\\".concat(index).concat(endIndex === match.input.length || isNaN(match.input[endIndex]) ? '' : '(?:)'); +}, { + leadChar: '\\' +}); +/* + * Numbered backreference or octal, plus any following digits: `\0`, `\11`, etc. Octals except `\0` + * not followed by 0-9 and backreferences to unopened capture groups throw an error. Other matches + * are returned unaltered. IE < 9 doesn't support backreferences above `\99` in regex syntax. + */ + +XRegExp.addToken(/\\(\d+)/, function (match, scope) { + if (!(scope === defaultScope && /^[1-9]/.test(match[1]) && +match[1] <= this.captureNames.length) && match[1] !== '0') { + throw new SyntaxError("Cannot use octal escape or backreference to undefined group ".concat(match[0])); + } + + return match[0]; +}, { + scope: 'all', + leadChar: '\\' +}); +/* + * Named capturing group; match the opening delimiter only: `(?`. Capture names can use the + * characters A-Z, a-z, 0-9, _, and $ only. Names can't be integers. Supports Python-style + * `(?P` as an alternate syntax to avoid issues in some older versions of Opera which natively + * supported the Python-style syntax. Otherwise, XRegExp might treat numbered backreferences to + * Python-style named capture as octals. + */ + +XRegExp.addToken(/\(\?P?<([\w$]+)>/, function (match) { + // Disallow bare integers as names because named backreferences are added to match arrays + // and therefore numeric properties may lead to incorrect lookups + if (!isNaN(match[1])) { + throw new SyntaxError("Cannot use integer as capture name ".concat(match[0])); + } + + if (!XRegExp.isInstalled('namespacing') && (match[1] === 'length' || match[1] === '__proto__')) { + throw new SyntaxError("Cannot use reserved word as capture name ".concat(match[0])); + } + + if (this.captureNames.indexOf(match[1]) !== -1) { + throw new SyntaxError("Cannot use same name for multiple groups ".concat(match[0])); + } + + this.captureNames.push(match[1]); + this.hasNamedCapture = true; + return '('; +}, { + leadChar: '(' +}); +/* + * Capturing group; match the opening parenthesis only. Required for support of named capturing + * groups. Also adds explicit capture mode (flag n). + */ + +XRegExp.addToken(/\((?!\?)/, function (match, scope, flags) { + if (flags.indexOf('n') !== -1) { + return '(?:'; + } + + this.captureNames.push(null); + return '('; +}, { + optionalFlags: 'n', + leadChar: '(' +}); +var _default = XRegExp; +exports.default = _default; +module.exports = exports["default"]; +}); + +unwrapExports(xregexp); + +var build = createCommonjsModule(function (module, exports) { +"use strict"; + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.default = void 0; + +/*! + * XRegExp.build 4.2.0 + * + * Steven Levithan (c) 2012-present MIT License + */ +var _default = function _default(XRegExp) { + var REGEX_DATA = 'xregexp'; + var subParts = /(\()(?!\?)|\\([1-9]\d*)|\\[\s\S]|\[(?:[^\\\]]|\\[\s\S])*\]/g; + var parts = XRegExp.union([/\({{([\w$]+)}}\)|{{([\w$]+)}}/, subParts], 'g', { + conjunction: 'or' + }); + /** + * Strips a leading `^` and trailing unescaped `$`, if both are present. + * + * @private + * @param {String} pattern Pattern to process. + * @returns {String} Pattern with edge anchors removed. + */ + + function deanchor(pattern) { + // Allow any number of empty noncapturing groups before/after anchors, because regexes + // built/generated by XRegExp sometimes include them + var leadingAnchor = /^(?:\(\?:\))*\^/; + var trailingAnchor = /\$(?:\(\?:\))*$/; + + if (leadingAnchor.test(pattern) && trailingAnchor.test(pattern) && // Ensure that the trailing `$` isn't escaped + trailingAnchor.test(pattern.replace(/\\[\s\S]/g, ''))) { + return pattern.replace(leadingAnchor, '').replace(trailingAnchor, ''); + } + + return pattern; + } + /** + * Converts the provided value to an XRegExp. Native RegExp flags are not preserved. + * + * @private + * @param {String|RegExp} value Value to convert. + * @param {Boolean} [addFlagX] Whether to apply the `x` flag in cases when `value` is not + * already a regex generated by XRegExp + * @returns {RegExp} XRegExp object with XRegExp syntax applied. + */ + + + function asXRegExp(value, addFlagX) { + var flags = addFlagX ? 'x' : ''; + return XRegExp.isRegExp(value) ? value[REGEX_DATA] && value[REGEX_DATA].captureNames ? // Don't recompile, to preserve capture names + value : // Recompile as XRegExp + XRegExp(value.source, flags) : // Compile string as XRegExp + XRegExp(value, flags); + } + + function interpolate(substitution) { + return substitution instanceof RegExp ? substitution : XRegExp.escape(substitution); + } + + function reduceToSubpatternsObject(subpatterns, interpolated, subpatternIndex) { + subpatterns["subpattern".concat(subpatternIndex)] = interpolated; + return subpatterns; + } + + function embedSubpatternAfter(raw, subpatternIndex, rawLiterals) { + var hasSubpattern = subpatternIndex < rawLiterals.length - 1; + return raw + (hasSubpattern ? "{{subpattern".concat(subpatternIndex, "}}") : ''); + } + /** + * Provides tagged template literals that create regexes with XRegExp syntax and flags. The + * provided pattern is handled as a raw string, so backslashes don't need to be escaped. + * + * Interpolation of strings and regexes shares the features of `XRegExp.build`. Interpolated + * patterns are treated as atomic units when quantified, interpolated strings have their special + * characters escaped, a leading `^` and trailing unescaped `$` are stripped from interpolated + * regexes if both are present, and any backreferences within an interpolated regex are + * rewritten to work within the overall pattern. + * + * @memberOf XRegExp + * @param {String} [flags] Any combination of XRegExp flags. + * @returns {Function} Handler for template literals that construct regexes with XRegExp syntax. + * @example + * + * const h12 = /1[0-2]|0?[1-9]/; + * const h24 = /2[0-3]|[01][0-9]/; + * const hours = XRegExp.tag('x')`${h12} : | ${h24}`; + * const minutes = /^[0-5][0-9]$/; + * // Note that explicitly naming the 'minutes' group is required for named backreferences + * const time = XRegExp.tag('x')`^ ${hours} (?${minutes}) $`; + * time.test('10:59'); // -> true + * XRegExp.exec('10:59', time).minutes; // -> '59' + */ + + + XRegExp.tag = function (flags) { + return function (literals) { + for (var _len = arguments.length, substitutions = new Array(_len > 1 ? _len - 1 : 0), _key = 1; _key < _len; _key++) { + substitutions[_key - 1] = arguments[_key]; + } + + var subpatterns = substitutions.map(interpolate).reduce(reduceToSubpatternsObject, {}); + var pattern = literals.raw.map(embedSubpatternAfter).join(''); + return XRegExp.build(pattern, subpatterns, flags); + }; + }; + /** + * Builds regexes using named subpatterns, for readability and pattern reuse. Backreferences in + * the outer pattern and provided subpatterns are automatically renumbered to work correctly. + * Native flags used by provided subpatterns are ignored in favor of the `flags` argument. + * + * @memberOf XRegExp + * @param {String} pattern XRegExp pattern using `{{name}}` for embedded subpatterns. Allows + * `({{name}})` as shorthand for `(?{{name}})`. Patterns cannot be embedded within + * character classes. + * @param {Object} subs Lookup object for named subpatterns. Values can be strings or regexes. A + * leading `^` and trailing unescaped `$` are stripped from subpatterns, if both are present. + * @param {String} [flags] Any combination of XRegExp flags. + * @returns {RegExp} Regex with interpolated subpatterns. + * @example + * + * const time = XRegExp.build('(?x)^ {{hours}} ({{minutes}}) $', { + * hours: XRegExp.build('{{h12}} : | {{h24}}', { + * h12: /1[0-2]|0?[1-9]/, + * h24: /2[0-3]|[01][0-9]/ + * }, 'x'), + * minutes: /^[0-5][0-9]$/ + * }); + * time.test('10:59'); // -> true + * XRegExp.exec('10:59', time).minutes; // -> '59' + */ + + + XRegExp.build = function (pattern, subs, flags) { + flags = flags || ''; // Used with `asXRegExp` calls for `pattern` and subpatterns in `subs`, to work around how + // some browsers convert `RegExp('\n')` to a regex that contains the literal characters `\` + // and `n`. See more details at . + + var addFlagX = flags.indexOf('x') !== -1; + var inlineFlags = /^\(\?([\w$]+)\)/.exec(pattern); // Add flags within a leading mode modifier to the overall pattern's flags + + if (inlineFlags) { + flags = XRegExp._clipDuplicates(flags + inlineFlags[1]); + } + + var data = {}; + + for (var p in subs) { + if (subs.hasOwnProperty(p)) { + // Passing to XRegExp enables extended syntax and ensures independent validity, + // lest an unescaped `(`, `)`, `[`, or trailing `\` breaks the `(?:)` wrapper. For + // subpatterns provided as native regexes, it dies on octals and adds the property + // used to hold extended regex instance data, for simplicity. + var sub = asXRegExp(subs[p], addFlagX); + data[p] = { + // Deanchoring allows embedding independently useful anchored regexes. If you + // really need to keep your anchors, double them (i.e., `^^...$$`). + pattern: deanchor(sub.source), + names: sub[REGEX_DATA].captureNames || [] + }; + } + } // Passing to XRegExp dies on octals and ensures the outer pattern is independently valid; + // helps keep this simple. Named captures will be put back. + + + var patternAsRegex = asXRegExp(pattern, addFlagX); // 'Caps' is short for 'captures' + + var numCaps = 0; + var numPriorCaps; + var numOuterCaps = 0; + var outerCapsMap = [0]; + var outerCapNames = patternAsRegex[REGEX_DATA].captureNames || []; + var output = patternAsRegex.source.replace(parts, function ($0, $1, $2, $3, $4) { + var subName = $1 || $2; + var capName; + var intro; + var localCapIndex; // Named subpattern + + if (subName) { + if (!data.hasOwnProperty(subName)) { + throw new ReferenceError("Undefined property ".concat($0)); + } // Named subpattern was wrapped in a capturing group + + + if ($1) { + capName = outerCapNames[numOuterCaps]; + outerCapsMap[++numOuterCaps] = ++numCaps; // If it's a named group, preserve the name. Otherwise, use the subpattern name + // as the capture name + + intro = "(?<".concat(capName || subName, ">"); + } else { + intro = '(?:'; + } + + numPriorCaps = numCaps; + var rewrittenSubpattern = data[subName].pattern.replace(subParts, function (match, paren, backref) { + // Capturing group + if (paren) { + capName = data[subName].names[numCaps - numPriorCaps]; + ++numCaps; // If the current capture has a name, preserve the name + + if (capName) { + return "(?<".concat(capName, ">"); + } // Backreference + + } else if (backref) { + localCapIndex = +backref - 1; // Rewrite the backreference + + return data[subName].names[localCapIndex] ? // Need to preserve the backreference name in case using flag `n` + "\\k<".concat(data[subName].names[localCapIndex], ">") : "\\".concat(+backref + numPriorCaps); + } + + return match; + }); + return "".concat(intro).concat(rewrittenSubpattern, ")"); + } // Capturing group + + + if ($3) { + capName = outerCapNames[numOuterCaps]; + outerCapsMap[++numOuterCaps] = ++numCaps; // If the current capture has a name, preserve the name + + if (capName) { + return "(?<".concat(capName, ">"); + } // Backreference + + } else if ($4) { + localCapIndex = +$4 - 1; // Rewrite the backreference + + return outerCapNames[localCapIndex] ? // Need to preserve the backreference name in case using flag `n` + "\\k<".concat(outerCapNames[localCapIndex], ">") : "\\".concat(outerCapsMap[+$4]); + } + + return $0; + }); + return XRegExp(output, flags); + }; +}; + +exports.default = _default; +module.exports = exports["default"]; +}); + +unwrapExports(build); + +var matchrecursive = createCommonjsModule(function (module, exports) { +"use strict"; + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.default = void 0; + +/*! + * XRegExp.matchRecursive 4.2.0 + * + * Steven Levithan (c) 2009-present MIT License + */ +var _default = function _default(XRegExp) { + /** + * Returns a match detail object composed of the provided values. + * + * @private + */ + function row(name, value, start, end) { + return { + name: name, + value: value, + start: start, + end: end + }; + } + /** + * Returns an array of match strings between outermost left and right delimiters, or an array of + * objects with detailed match parts and position data. An error is thrown if delimiters are + * unbalanced within the data. + * + * @memberOf XRegExp + * @param {String} str String to search. + * @param {String} left Left delimiter as an XRegExp pattern. + * @param {String} right Right delimiter as an XRegExp pattern. + * @param {String} [flags] Any native or XRegExp flags, used for the left and right delimiters. + * @param {Object} [options] Lets you specify `valueNames` and `escapeChar` options. + * @returns {Array} Array of matches, or an empty array. + * @example + * + * // Basic usage + * let str = '(t((e))s)t()(ing)'; + * XRegExp.matchRecursive(str, '\\(', '\\)', 'g'); + * // -> ['t((e))s', '', 'ing'] + * + * // Extended information mode with valueNames + * str = 'Here is
an
example'; + * XRegExp.matchRecursive(str, '', '', 'gi', { + * valueNames: ['between', 'left', 'match', 'right'] + * }); + * // -> [ + * // {name: 'between', value: 'Here is ', start: 0, end: 8}, + * // {name: 'left', value: '
', start: 8, end: 13}, + * // {name: 'match', value: '
an
', start: 13, end: 27}, + * // {name: 'right', value: '
', start: 27, end: 33}, + * // {name: 'between', value: ' example', start: 33, end: 41} + * // ] + * + * // Omitting unneeded parts with null valueNames, and using escapeChar + * str = '...{1}.\\{{function(x,y){return {y:x}}}'; + * XRegExp.matchRecursive(str, '{', '}', 'g', { + * valueNames: ['literal', null, 'value', null], + * escapeChar: '\\' + * }); + * // -> [ + * // {name: 'literal', value: '...', start: 0, end: 3}, + * // {name: 'value', value: '1', start: 4, end: 5}, + * // {name: 'literal', value: '.\\{', start: 6, end: 9}, + * // {name: 'value', value: 'function(x,y){return {y:x}}', start: 10, end: 37} + * // ] + * + * // Sticky mode via flag y + * str = '<1><<<2>>><3>4<5>'; + * XRegExp.matchRecursive(str, '<', '>', 'gy'); + * // -> ['1', '<<2>>', '3'] + */ + + + XRegExp.matchRecursive = function (str, left, right, flags, options) { + flags = flags || ''; + options = options || {}; + var global = flags.indexOf('g') !== -1; + var sticky = flags.indexOf('y') !== -1; // Flag `y` is controlled internally + + var basicFlags = flags.replace(/y/g, ''); + var _options = options, + escapeChar = _options.escapeChar; + var vN = options.valueNames; + var output = []; + var openTokens = 0; + var delimStart = 0; + var delimEnd = 0; + var lastOuterEnd = 0; + var outerStart; + var innerStart; + var leftMatch; + var rightMatch; + var esc; + left = XRegExp(left, basicFlags); + right = XRegExp(right, basicFlags); + + if (escapeChar) { + if (escapeChar.length > 1) { + throw new Error('Cannot use more than one escape character'); + } + + escapeChar = XRegExp.escape(escapeChar); // Example of concatenated `esc` regex: + // `escapeChar`: '%' + // `left`: '<' + // `right`: '>' + // Regex is: /(?:%[\S\s]|(?:(?!<|>)[^%])+)+/ + + esc = new RegExp("(?:".concat(escapeChar, "[\\S\\s]|(?:(?!").concat( // Using `XRegExp.union` safely rewrites backreferences in `left` and `right`. + // Intentionally not passing `basicFlags` to `XRegExp.union` since any syntax + // transformation resulting from those flags was already applied to `left` and + // `right` when they were passed through the XRegExp constructor above. + XRegExp.union([left, right], '', { + conjunction: 'or' + }).source, ")[^").concat(escapeChar, "])+)+"), // Flags `gy` not needed here + flags.replace(/[^imu]+/g, '')); + } + + while (true) { + // If using an escape character, advance to the delimiter's next starting position, + // skipping any escaped characters in between + if (escapeChar) { + delimEnd += (XRegExp.exec(str, esc, delimEnd, 'sticky') || [''])[0].length; + } + + leftMatch = XRegExp.exec(str, left, delimEnd); + rightMatch = XRegExp.exec(str, right, delimEnd); // Keep the leftmost match only + + if (leftMatch && rightMatch) { + if (leftMatch.index <= rightMatch.index) { + rightMatch = null; + } else { + leftMatch = null; + } + } // Paths (LM: leftMatch, RM: rightMatch, OT: openTokens): + // LM | RM | OT | Result + // 1 | 0 | 1 | loop + // 1 | 0 | 0 | loop + // 0 | 1 | 1 | loop + // 0 | 1 | 0 | throw + // 0 | 0 | 1 | throw + // 0 | 0 | 0 | break + // The paths above don't include the sticky mode special case. The loop ends after the + // first completed match if not `global`. + + + if (leftMatch || rightMatch) { + delimStart = (leftMatch || rightMatch).index; + delimEnd = delimStart + (leftMatch || rightMatch)[0].length; + } else if (!openTokens) { + break; + } + + if (sticky && !openTokens && delimStart > lastOuterEnd) { + break; + } + + if (leftMatch) { + if (!openTokens) { + outerStart = delimStart; + innerStart = delimEnd; + } + + ++openTokens; + } else if (rightMatch && openTokens) { + if (! --openTokens) { + if (vN) { + if (vN[0] && outerStart > lastOuterEnd) { + output.push(row(vN[0], str.slice(lastOuterEnd, outerStart), lastOuterEnd, outerStart)); + } + + if (vN[1]) { + output.push(row(vN[1], str.slice(outerStart, innerStart), outerStart, innerStart)); + } + + if (vN[2]) { + output.push(row(vN[2], str.slice(innerStart, delimStart), innerStart, delimStart)); + } + + if (vN[3]) { + output.push(row(vN[3], str.slice(delimStart, delimEnd), delimStart, delimEnd)); + } + } else { + output.push(str.slice(innerStart, delimStart)); + } + + lastOuterEnd = delimEnd; + + if (!global) { + break; + } + } + } else { + throw new Error('Unbalanced delimiter found in string'); + } // If the delimiter matched an empty string, avoid an infinite loop + + + if (delimStart === delimEnd) { + ++delimEnd; + } + } + + if (global && !sticky && vN && vN[0] && str.length > lastOuterEnd) { + output.push(row(vN[0], str.slice(lastOuterEnd), lastOuterEnd, str.length)); + } + + return output; + }; +}; + +exports.default = _default; +module.exports = exports["default"]; +}); + +unwrapExports(matchrecursive); + +var unicodeBase = createCommonjsModule(function (module, exports) { +"use strict"; + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.default = void 0; + +/*! + * XRegExp Unicode Base 4.2.0 + * + * Steven Levithan (c) 2008-present MIT License + */ +var _default = function _default(XRegExp) { + /** + * Adds base support for Unicode matching: + * - Adds syntax `\p{..}` for matching Unicode tokens. Tokens can be inverted using `\P{..}` or + * `\p{^..}`. Token names ignore case, spaces, hyphens, and underscores. You can omit the + * braces for token names that are a single letter (e.g. `\pL` or `PL`). + * - Adds flag A (astral), which enables 21-bit Unicode support. + * - Adds the `XRegExp.addUnicodeData` method used by other addons to provide character data. + * + * Unicode Base relies on externally provided Unicode character data. Official addons are + * available to provide data for Unicode categories, scripts, blocks, and properties. + * + * @requires XRegExp + */ + // ==--------------------------== + // Private stuff + // ==--------------------------== + // Storage for Unicode data + var unicode = {}; // Reuse utils + + var dec = XRegExp._dec; + var hex = XRegExp._hex; + var pad4 = XRegExp._pad4; // Generates a token lookup name: lowercase, with hyphens, spaces, and underscores removed + + function normalize(name) { + return name.replace(/[- _]+/g, '').toLowerCase(); + } // Gets the decimal code of a literal code unit, \xHH, \uHHHH, or a backslash-escaped literal + + + function charCode(chr) { + var esc = /^\\[xu](.+)/.exec(chr); + return esc ? dec(esc[1]) : chr.charCodeAt(chr[0] === '\\' ? 1 : 0); + } // Inverts a list of ordered BMP characters and ranges + + + function invertBmp(range) { + var output = ''; + var lastEnd = -1; + XRegExp.forEach(range, /(\\x..|\\u....|\\?[\s\S])(?:-(\\x..|\\u....|\\?[\s\S]))?/, function (m) { + var start = charCode(m[1]); + + if (start > lastEnd + 1) { + output += "\\u".concat(pad4(hex(lastEnd + 1))); + + if (start > lastEnd + 2) { + output += "-\\u".concat(pad4(hex(start - 1))); + } + } + + lastEnd = charCode(m[2] || m[1]); + }); + + if (lastEnd < 0xFFFF) { + output += "\\u".concat(pad4(hex(lastEnd + 1))); + + if (lastEnd < 0xFFFE) { + output += '-\\uFFFF'; + } + } + + return output; + } // Generates an inverted BMP range on first use + + + function cacheInvertedBmp(slug) { + var prop = 'b!'; + return unicode[slug][prop] || (unicode[slug][prop] = invertBmp(unicode[slug].bmp)); + } // Combines and optionally negates BMP and astral data + + + function buildAstral(slug, isNegated) { + var item = unicode[slug]; + var combined = ''; + + if (item.bmp && !item.isBmpLast) { + combined = "[".concat(item.bmp, "]").concat(item.astral ? '|' : ''); + } + + if (item.astral) { + combined += item.astral; + } + + if (item.isBmpLast && item.bmp) { + combined += "".concat(item.astral ? '|' : '', "[").concat(item.bmp, "]"); + } // Astral Unicode tokens always match a code point, never a code unit + + + return isNegated ? "(?:(?!".concat(combined, ")(?:[\uD800-\uDBFF][\uDC00-\uDFFF]|[\0-\uFFFF]))") : "(?:".concat(combined, ")"); + } // Builds a complete astral pattern on first use + + + function cacheAstral(slug, isNegated) { + var prop = isNegated ? 'a!' : 'a='; + return unicode[slug][prop] || (unicode[slug][prop] = buildAstral(slug, isNegated)); + } // ==--------------------------== + // Core functionality + // ==--------------------------== + + /* + * Add astral mode (flag A) and Unicode token syntax: `\p{..}`, `\P{..}`, `\p{^..}`, `\pC`. + */ + + + XRegExp.addToken( // Use `*` instead of `+` to avoid capturing `^` as the token name in `\p{^}` + /\\([pP])(?:{(\^?)([^}]*)}|([A-Za-z]))/, function (match, scope, flags) { + var ERR_DOUBLE_NEG = 'Invalid double negation '; + var ERR_UNKNOWN_NAME = 'Unknown Unicode token '; + var ERR_UNKNOWN_REF = 'Unicode token missing data '; + var ERR_ASTRAL_ONLY = 'Astral mode required for Unicode token '; + var ERR_ASTRAL_IN_CLASS = 'Astral mode does not support Unicode tokens within character classes'; // Negated via \P{..} or \p{^..} + + var isNegated = match[1] === 'P' || !!match[2]; // Switch from BMP (0-FFFF) to astral (0-10FFFF) mode via flag A + + var isAstralMode = flags.indexOf('A') !== -1; // Token lookup name. Check `[4]` first to avoid passing `undefined` via `\p{}` + + var slug = normalize(match[4] || match[3]); // Token data object + + var item = unicode[slug]; + + if (match[1] === 'P' && match[2]) { + throw new SyntaxError(ERR_DOUBLE_NEG + match[0]); + } + + if (!unicode.hasOwnProperty(slug)) { + throw new SyntaxError(ERR_UNKNOWN_NAME + match[0]); + } // Switch to the negated form of the referenced Unicode token + + + if (item.inverseOf) { + slug = normalize(item.inverseOf); + + if (!unicode.hasOwnProperty(slug)) { + throw new ReferenceError("".concat(ERR_UNKNOWN_REF + match[0], " -> ").concat(item.inverseOf)); + } + + item = unicode[slug]; + isNegated = !isNegated; + } + + if (!(item.bmp || isAstralMode)) { + throw new SyntaxError(ERR_ASTRAL_ONLY + match[0]); + } + + if (isAstralMode) { + if (scope === 'class') { + throw new SyntaxError(ERR_ASTRAL_IN_CLASS); + } + + return cacheAstral(slug, isNegated); + } + + return scope === 'class' ? isNegated ? cacheInvertedBmp(slug) : item.bmp : "".concat((isNegated ? '[^' : '[') + item.bmp, "]"); + }, { + scope: 'all', + optionalFlags: 'A', + leadChar: '\\' + }); + /** + * Adds to the list of Unicode tokens that XRegExp regexes can match via `\p` or `\P`. + * + * @memberOf XRegExp + * @param {Array} data Objects with named character ranges. Each object may have properties + * `name`, `alias`, `isBmpLast`, `inverseOf`, `bmp`, and `astral`. All but `name` are + * optional, although one of `bmp` or `astral` is required (unless `inverseOf` is set). If + * `astral` is absent, the `bmp` data is used for BMP and astral modes. If `bmp` is absent, + * the name errors in BMP mode but works in astral mode. If both `bmp` and `astral` are + * provided, the `bmp` data only is used in BMP mode, and the combination of `bmp` and + * `astral` data is used in astral mode. `isBmpLast` is needed when a token matches orphan + * high surrogates *and* uses surrogate pairs to match astral code points. The `bmp` and + * `astral` data should be a combination of literal characters and `\xHH` or `\uHHHH` escape + * sequences, with hyphens to create ranges. Any regex metacharacters in the data should be + * escaped, apart from range-creating hyphens. The `astral` data can additionally use + * character classes and alternation, and should use surrogate pairs to represent astral code + * points. `inverseOf` can be used to avoid duplicating character data if a Unicode token is + * defined as the exact inverse of another token. + * @example + * + * // Basic use + * XRegExp.addUnicodeData([{ + * name: 'XDigit', + * alias: 'Hexadecimal', + * bmp: '0-9A-Fa-f' + * }]); + * XRegExp('\\p{XDigit}:\\p{Hexadecimal}+').test('0:3D'); // -> true + */ + + XRegExp.addUnicodeData = function (data) { + var ERR_NO_NAME = 'Unicode token requires name'; + var ERR_NO_DATA = 'Unicode token has no character data '; + var _iteratorNormalCompletion = true; + var _didIteratorError = false; + var _iteratorError = undefined; + + try { + for (var _iterator = data[Symbol.iterator](), _step; !(_iteratorNormalCompletion = (_step = _iterator.next()).done); _iteratorNormalCompletion = true) { + var item = _step.value; + + if (!item.name) { + throw new Error(ERR_NO_NAME); + } + + if (!(item.inverseOf || item.bmp || item.astral)) { + throw new Error(ERR_NO_DATA + item.name); + } + + unicode[normalize(item.name)] = item; + + if (item.alias) { + unicode[normalize(item.alias)] = item; + } + } // Reset the pattern cache used by the `XRegExp` constructor, since the same pattern and + // flags might now produce different results + + } catch (err) { + _didIteratorError = true; + _iteratorError = err; + } finally { + try { + if (!_iteratorNormalCompletion && _iterator.return != null) { + _iterator.return(); + } + } finally { + if (_didIteratorError) { + throw _iteratorError; + } + } + } + + XRegExp.cache.flush('patterns'); + }; + /** + * @ignore + * + * Return a reference to the internal Unicode definition structure for the given Unicode + * Property if the given name is a legal Unicode Property for use in XRegExp `\p` or `\P` regex + * constructs. + * + * @memberOf XRegExp + * @param {String} name Name by which the Unicode Property may be recognized (case-insensitive), + * e.g. `'N'` or `'Number'`. The given name is matched against all registered Unicode + * Properties and Property Aliases. + * @returns {Object} Reference to definition structure when the name matches a Unicode Property. + * + * @note + * For more info on Unicode Properties, see also http://unicode.org/reports/tr18/#Categories. + * + * @note + * This method is *not* part of the officially documented API and may change or be removed in + * the future. It is meant for userland code that wishes to reuse the (large) internal Unicode + * structures set up by XRegExp. + */ + + + XRegExp._getUnicodeProperty = function (name) { + var slug = normalize(name); + return unicode[slug]; + }; +}; + +exports.default = _default; +module.exports = exports["default"]; +}); + +unwrapExports(unicodeBase); + +var blocks = [ + { + 'name': 'InAdlam', + 'astral': '\uD83A[\uDD00-\uDD5F]' + }, + { + 'name': 'InAegean_Numbers', + 'astral': '\uD800[\uDD00-\uDD3F]' + }, + { + 'name': 'InAhom', + 'astral': '\uD805[\uDF00-\uDF3F]' + }, + { + 'name': 'InAlchemical_Symbols', + 'astral': '\uD83D[\uDF00-\uDF7F]' + }, + { + 'name': 'InAlphabetic_Presentation_Forms', + 'bmp': '\uFB00-\uFB4F' + }, + { + 'name': 'InAnatolian_Hieroglyphs', + 'astral': '\uD811[\uDC00-\uDE7F]' + }, + { + 'name': 'InAncient_Greek_Musical_Notation', + 'astral': '\uD834[\uDE00-\uDE4F]' + }, + { + 'name': 'InAncient_Greek_Numbers', + 'astral': '\uD800[\uDD40-\uDD8F]' + }, + { + 'name': 'InAncient_Symbols', + 'astral': '\uD800[\uDD90-\uDDCF]' + }, + { + 'name': 'InArabic', + 'bmp': '\u0600-\u06FF' + }, + { + 'name': 'InArabic_Extended_A', + 'bmp': '\u08A0-\u08FF' + }, + { + 'name': 'InArabic_Mathematical_Alphabetic_Symbols', + 'astral': '\uD83B[\uDE00-\uDEFF]' + }, + { + 'name': 'InArabic_Presentation_Forms_A', + 'bmp': '\uFB50-\uFDFF' + }, + { + 'name': 'InArabic_Presentation_Forms_B', + 'bmp': '\uFE70-\uFEFF' + }, + { + 'name': 'InArabic_Supplement', + 'bmp': '\u0750-\u077F' + }, + { + 'name': 'InArmenian', + 'bmp': '\u0530-\u058F' + }, + { + 'name': 'InArrows', + 'bmp': '\u2190-\u21FF' + }, + { + 'name': 'InAvestan', + 'astral': '\uD802[\uDF00-\uDF3F]' + }, + { + 'name': 'InBalinese', + 'bmp': '\u1B00-\u1B7F' + }, + { + 'name': 'InBamum', + 'bmp': '\uA6A0-\uA6FF' + }, + { + 'name': 'InBamum_Supplement', + 'astral': '\uD81A[\uDC00-\uDE3F]' + }, + { + 'name': 'InBasic_Latin', + 'bmp': '\0-\x7F' + }, + { + 'name': 'InBassa_Vah', + 'astral': '\uD81A[\uDED0-\uDEFF]' + }, + { + 'name': 'InBatak', + 'bmp': '\u1BC0-\u1BFF' + }, + { + 'name': 'InBengali', + 'bmp': '\u0980-\u09FF' + }, + { + 'name': 'InBhaiksuki', + 'astral': '\uD807[\uDC00-\uDC6F]' + }, + { + 'name': 'InBlock_Elements', + 'bmp': '\u2580-\u259F' + }, + { + 'name': 'InBopomofo', + 'bmp': '\u3100-\u312F' + }, + { + 'name': 'InBopomofo_Extended', + 'bmp': '\u31A0-\u31BF' + }, + { + 'name': 'InBox_Drawing', + 'bmp': '\u2500-\u257F' + }, + { + 'name': 'InBrahmi', + 'astral': '\uD804[\uDC00-\uDC7F]' + }, + { + 'name': 'InBraille_Patterns', + 'bmp': '\u2800-\u28FF' + }, + { + 'name': 'InBuginese', + 'bmp': '\u1A00-\u1A1F' + }, + { + 'name': 'InBuhid', + 'bmp': '\u1740-\u175F' + }, + { + 'name': 'InByzantine_Musical_Symbols', + 'astral': '\uD834[\uDC00-\uDCFF]' + }, + { + 'name': 'InCJK_Compatibility', + 'bmp': '\u3300-\u33FF' + }, + { + 'name': 'InCJK_Compatibility_Forms', + 'bmp': '\uFE30-\uFE4F' + }, + { + 'name': 'InCJK_Compatibility_Ideographs', + 'bmp': '\uF900-\uFAFF' + }, + { + 'name': 'InCJK_Compatibility_Ideographs_Supplement', + 'astral': '\uD87E[\uDC00-\uDE1F]' + }, + { + 'name': 'InCJK_Radicals_Supplement', + 'bmp': '\u2E80-\u2EFF' + }, + { + 'name': 'InCJK_Strokes', + 'bmp': '\u31C0-\u31EF' + }, + { + 'name': 'InCJK_Symbols_And_Punctuation', + 'bmp': '\u3000-\u303F' + }, + { + 'name': 'InCJK_Unified_Ideographs', + 'bmp': '\u4E00-\u9FFF' + }, + { + 'name': 'InCJK_Unified_Ideographs_Extension_A', + 'bmp': '\u3400-\u4DBF' + }, + { + 'name': 'InCJK_Unified_Ideographs_Extension_B', + 'astral': '[\uD840-\uD868][\uDC00-\uDFFF]|\uD869[\uDC00-\uDEDF]' + }, + { + 'name': 'InCJK_Unified_Ideographs_Extension_C', + 'astral': '\uD869[\uDF00-\uDFFF]|[\uD86A-\uD86C][\uDC00-\uDFFF]|\uD86D[\uDC00-\uDF3F]' + }, + { + 'name': 'InCJK_Unified_Ideographs_Extension_D', + 'astral': '\uD86D[\uDF40-\uDFFF]|\uD86E[\uDC00-\uDC1F]' + }, + { + 'name': 'InCJK_Unified_Ideographs_Extension_E', + 'astral': '\uD86E[\uDC20-\uDFFF]|[\uD86F-\uD872][\uDC00-\uDFFF]|\uD873[\uDC00-\uDEAF]' + }, + { + 'name': 'InCJK_Unified_Ideographs_Extension_F', + 'astral': '\uD873[\uDEB0-\uDFFF]|[\uD874-\uD879][\uDC00-\uDFFF]|\uD87A[\uDC00-\uDFEF]' + }, + { + 'name': 'InCarian', + 'astral': '\uD800[\uDEA0-\uDEDF]' + }, + { + 'name': 'InCaucasian_Albanian', + 'astral': '\uD801[\uDD30-\uDD6F]' + }, + { + 'name': 'InChakma', + 'astral': '\uD804[\uDD00-\uDD4F]' + }, + { + 'name': 'InCham', + 'bmp': '\uAA00-\uAA5F' + }, + { + 'name': 'InCherokee', + 'bmp': '\u13A0-\u13FF' + }, + { + 'name': 'InCherokee_Supplement', + 'bmp': '\uAB70-\uABBF' + }, + { + 'name': 'InChess_Symbols', + 'astral': '\uD83E[\uDE00-\uDE6F]' + }, + { + 'name': 'InCombining_Diacritical_Marks', + 'bmp': '\u0300-\u036F' + }, + { + 'name': 'InCombining_Diacritical_Marks_Extended', + 'bmp': '\u1AB0-\u1AFF' + }, + { + 'name': 'InCombining_Diacritical_Marks_For_Symbols', + 'bmp': '\u20D0-\u20FF' + }, + { + 'name': 'InCombining_Diacritical_Marks_Supplement', + 'bmp': '\u1DC0-\u1DFF' + }, + { + 'name': 'InCombining_Half_Marks', + 'bmp': '\uFE20-\uFE2F' + }, + { + 'name': 'InCommon_Indic_Number_Forms', + 'bmp': '\uA830-\uA83F' + }, + { + 'name': 'InControl_Pictures', + 'bmp': '\u2400-\u243F' + }, + { + 'name': 'InCoptic', + 'bmp': '\u2C80-\u2CFF' + }, + { + 'name': 'InCoptic_Epact_Numbers', + 'astral': '\uD800[\uDEE0-\uDEFF]' + }, + { + 'name': 'InCounting_Rod_Numerals', + 'astral': '\uD834[\uDF60-\uDF7F]' + }, + { + 'name': 'InCuneiform', + 'astral': '\uD808[\uDC00-\uDFFF]' + }, + { + 'name': 'InCuneiform_Numbers_And_Punctuation', + 'astral': '\uD809[\uDC00-\uDC7F]' + }, + { + 'name': 'InCurrency_Symbols', + 'bmp': '\u20A0-\u20CF' + }, + { + 'name': 'InCypriot_Syllabary', + 'astral': '\uD802[\uDC00-\uDC3F]' + }, + { + 'name': 'InCyrillic', + 'bmp': '\u0400-\u04FF' + }, + { + 'name': 'InCyrillic_Extended_A', + 'bmp': '\u2DE0-\u2DFF' + }, + { + 'name': 'InCyrillic_Extended_B', + 'bmp': '\uA640-\uA69F' + }, + { + 'name': 'InCyrillic_Extended_C', + 'bmp': '\u1C80-\u1C8F' + }, + { + 'name': 'InCyrillic_Supplement', + 'bmp': '\u0500-\u052F' + }, + { + 'name': 'InDeseret', + 'astral': '\uD801[\uDC00-\uDC4F]' + }, + { + 'name': 'InDevanagari', + 'bmp': '\u0900-\u097F' + }, + { + 'name': 'InDevanagari_Extended', + 'bmp': '\uA8E0-\uA8FF' + }, + { + 'name': 'InDingbats', + 'bmp': '\u2700-\u27BF' + }, + { + 'name': 'InDogra', + 'astral': '\uD806[\uDC00-\uDC4F]' + }, + { + 'name': 'InDomino_Tiles', + 'astral': '\uD83C[\uDC30-\uDC9F]' + }, + { + 'name': 'InDuployan', + 'astral': '\uD82F[\uDC00-\uDC9F]' + }, + { + 'name': 'InEarly_Dynastic_Cuneiform', + 'astral': '\uD809[\uDC80-\uDD4F]' + }, + { + 'name': 'InEgyptian_Hieroglyphs', + 'astral': '\uD80C[\uDC00-\uDFFF]|\uD80D[\uDC00-\uDC2F]' + }, + { + 'name': 'InElbasan', + 'astral': '\uD801[\uDD00-\uDD2F]' + }, + { + 'name': 'InEmoticons', + 'astral': '\uD83D[\uDE00-\uDE4F]' + }, + { + 'name': 'InEnclosed_Alphanumeric_Supplement', + 'astral': '\uD83C[\uDD00-\uDDFF]' + }, + { + 'name': 'InEnclosed_Alphanumerics', + 'bmp': '\u2460-\u24FF' + }, + { + 'name': 'InEnclosed_CJK_Letters_And_Months', + 'bmp': '\u3200-\u32FF' + }, + { + 'name': 'InEnclosed_Ideographic_Supplement', + 'astral': '\uD83C[\uDE00-\uDEFF]' + }, + { + 'name': 'InEthiopic', + 'bmp': '\u1200-\u137F' + }, + { + 'name': 'InEthiopic_Extended', + 'bmp': '\u2D80-\u2DDF' + }, + { + 'name': 'InEthiopic_Extended_A', + 'bmp': '\uAB00-\uAB2F' + }, + { + 'name': 'InEthiopic_Supplement', + 'bmp': '\u1380-\u139F' + }, + { + 'name': 'InGeneral_Punctuation', + 'bmp': '\u2000-\u206F' + }, + { + 'name': 'InGeometric_Shapes', + 'bmp': '\u25A0-\u25FF' + }, + { + 'name': 'InGeometric_Shapes_Extended', + 'astral': '\uD83D[\uDF80-\uDFFF]' + }, + { + 'name': 'InGeorgian', + 'bmp': '\u10A0-\u10FF' + }, + { + 'name': 'InGeorgian_Extended', + 'bmp': '\u1C90-\u1CBF' + }, + { + 'name': 'InGeorgian_Supplement', + 'bmp': '\u2D00-\u2D2F' + }, + { + 'name': 'InGlagolitic', + 'bmp': '\u2C00-\u2C5F' + }, + { + 'name': 'InGlagolitic_Supplement', + 'astral': '\uD838[\uDC00-\uDC2F]' + }, + { + 'name': 'InGothic', + 'astral': '\uD800[\uDF30-\uDF4F]' + }, + { + 'name': 'InGrantha', + 'astral': '\uD804[\uDF00-\uDF7F]' + }, + { + 'name': 'InGreek_And_Coptic', + 'bmp': '\u0370-\u03FF' + }, + { + 'name': 'InGreek_Extended', + 'bmp': '\u1F00-\u1FFF' + }, + { + 'name': 'InGujarati', + 'bmp': '\u0A80-\u0AFF' + }, + { + 'name': 'InGunjala_Gondi', + 'astral': '\uD807[\uDD60-\uDDAF]' + }, + { + 'name': 'InGurmukhi', + 'bmp': '\u0A00-\u0A7F' + }, + { + 'name': 'InHalfwidth_And_Fullwidth_Forms', + 'bmp': '\uFF00-\uFFEF' + }, + { + 'name': 'InHangul_Compatibility_Jamo', + 'bmp': '\u3130-\u318F' + }, + { + 'name': 'InHangul_Jamo', + 'bmp': '\u1100-\u11FF' + }, + { + 'name': 'InHangul_Jamo_Extended_A', + 'bmp': '\uA960-\uA97F' + }, + { + 'name': 'InHangul_Jamo_Extended_B', + 'bmp': '\uD7B0-\uD7FF' + }, + { + 'name': 'InHangul_Syllables', + 'bmp': '\uAC00-\uD7AF' + }, + { + 'name': 'InHanifi_Rohingya', + 'astral': '\uD803[\uDD00-\uDD3F]' + }, + { + 'name': 'InHanunoo', + 'bmp': '\u1720-\u173F' + }, + { + 'name': 'InHatran', + 'astral': '\uD802[\uDCE0-\uDCFF]' + }, + { + 'name': 'InHebrew', + 'bmp': '\u0590-\u05FF' + }, + { + 'name': 'InHigh_Private_Use_Surrogates', + 'bmp': '\uDB80-\uDBFF' + }, + { + 'name': 'InHigh_Surrogates', + 'bmp': '\uD800-\uDB7F' + }, + { + 'name': 'InHiragana', + 'bmp': '\u3040-\u309F' + }, + { + 'name': 'InIPA_Extensions', + 'bmp': '\u0250-\u02AF' + }, + { + 'name': 'InIdeographic_Description_Characters', + 'bmp': '\u2FF0-\u2FFF' + }, + { + 'name': 'InIdeographic_Symbols_And_Punctuation', + 'astral': '\uD81B[\uDFE0-\uDFFF]' + }, + { + 'name': 'InImperial_Aramaic', + 'astral': '\uD802[\uDC40-\uDC5F]' + }, + { + 'name': 'InIndic_Siyaq_Numbers', + 'astral': '\uD83B[\uDC70-\uDCBF]' + }, + { + 'name': 'InInscriptional_Pahlavi', + 'astral': '\uD802[\uDF60-\uDF7F]' + }, + { + 'name': 'InInscriptional_Parthian', + 'astral': '\uD802[\uDF40-\uDF5F]' + }, + { + 'name': 'InJavanese', + 'bmp': '\uA980-\uA9DF' + }, + { + 'name': 'InKaithi', + 'astral': '\uD804[\uDC80-\uDCCF]' + }, + { + 'name': 'InKana_Extended_A', + 'astral': '\uD82C[\uDD00-\uDD2F]' + }, + { + 'name': 'InKana_Supplement', + 'astral': '\uD82C[\uDC00-\uDCFF]' + }, + { + 'name': 'InKanbun', + 'bmp': '\u3190-\u319F' + }, + { + 'name': 'InKangxi_Radicals', + 'bmp': '\u2F00-\u2FDF' + }, + { + 'name': 'InKannada', + 'bmp': '\u0C80-\u0CFF' + }, + { + 'name': 'InKatakana', + 'bmp': '\u30A0-\u30FF' + }, + { + 'name': 'InKatakana_Phonetic_Extensions', + 'bmp': '\u31F0-\u31FF' + }, + { + 'name': 'InKayah_Li', + 'bmp': '\uA900-\uA92F' + }, + { + 'name': 'InKharoshthi', + 'astral': '\uD802[\uDE00-\uDE5F]' + }, + { + 'name': 'InKhmer', + 'bmp': '\u1780-\u17FF' + }, + { + 'name': 'InKhmer_Symbols', + 'bmp': '\u19E0-\u19FF' + }, + { + 'name': 'InKhojki', + 'astral': '\uD804[\uDE00-\uDE4F]' + }, + { + 'name': 'InKhudawadi', + 'astral': '\uD804[\uDEB0-\uDEFF]' + }, + { + 'name': 'InLao', + 'bmp': '\u0E80-\u0EFF' + }, + { + 'name': 'InLatin_1_Supplement', + 'bmp': '\x80-\xFF' + }, + { + 'name': 'InLatin_Extended_A', + 'bmp': '\u0100-\u017F' + }, + { + 'name': 'InLatin_Extended_Additional', + 'bmp': '\u1E00-\u1EFF' + }, + { + 'name': 'InLatin_Extended_B', + 'bmp': '\u0180-\u024F' + }, + { + 'name': 'InLatin_Extended_C', + 'bmp': '\u2C60-\u2C7F' + }, + { + 'name': 'InLatin_Extended_D', + 'bmp': '\uA720-\uA7FF' + }, + { + 'name': 'InLatin_Extended_E', + 'bmp': '\uAB30-\uAB6F' + }, + { + 'name': 'InLepcha', + 'bmp': '\u1C00-\u1C4F' + }, + { + 'name': 'InLetterlike_Symbols', + 'bmp': '\u2100-\u214F' + }, + { + 'name': 'InLimbu', + 'bmp': '\u1900-\u194F' + }, + { + 'name': 'InLinear_A', + 'astral': '\uD801[\uDE00-\uDF7F]' + }, + { + 'name': 'InLinear_B_Ideograms', + 'astral': '\uD800[\uDC80-\uDCFF]' + }, + { + 'name': 'InLinear_B_Syllabary', + 'astral': '\uD800[\uDC00-\uDC7F]' + }, + { + 'name': 'InLisu', + 'bmp': '\uA4D0-\uA4FF' + }, + { + 'name': 'InLow_Surrogates', + 'bmp': '\uDC00-\uDFFF' + }, + { + 'name': 'InLycian', + 'astral': '\uD800[\uDE80-\uDE9F]' + }, + { + 'name': 'InLydian', + 'astral': '\uD802[\uDD20-\uDD3F]' + }, + { + 'name': 'InMahajani', + 'astral': '\uD804[\uDD50-\uDD7F]' + }, + { + 'name': 'InMahjong_Tiles', + 'astral': '\uD83C[\uDC00-\uDC2F]' + }, + { + 'name': 'InMakasar', + 'astral': '\uD807[\uDEE0-\uDEFF]' + }, + { + 'name': 'InMalayalam', + 'bmp': '\u0D00-\u0D7F' + }, + { + 'name': 'InMandaic', + 'bmp': '\u0840-\u085F' + }, + { + 'name': 'InManichaean', + 'astral': '\uD802[\uDEC0-\uDEFF]' + }, + { + 'name': 'InMarchen', + 'astral': '\uD807[\uDC70-\uDCBF]' + }, + { + 'name': 'InMasaram_Gondi', + 'astral': '\uD807[\uDD00-\uDD5F]' + }, + { + 'name': 'InMathematical_Alphanumeric_Symbols', + 'astral': '\uD835[\uDC00-\uDFFF]' + }, + { + 'name': 'InMathematical_Operators', + 'bmp': '\u2200-\u22FF' + }, + { + 'name': 'InMayan_Numerals', + 'astral': '\uD834[\uDEE0-\uDEFF]' + }, + { + 'name': 'InMedefaidrin', + 'astral': '\uD81B[\uDE40-\uDE9F]' + }, + { + 'name': 'InMeetei_Mayek', + 'bmp': '\uABC0-\uABFF' + }, + { + 'name': 'InMeetei_Mayek_Extensions', + 'bmp': '\uAAE0-\uAAFF' + }, + { + 'name': 'InMende_Kikakui', + 'astral': '\uD83A[\uDC00-\uDCDF]' + }, + { + 'name': 'InMeroitic_Cursive', + 'astral': '\uD802[\uDDA0-\uDDFF]' + }, + { + 'name': 'InMeroitic_Hieroglyphs', + 'astral': '\uD802[\uDD80-\uDD9F]' + }, + { + 'name': 'InMiao', + 'astral': '\uD81B[\uDF00-\uDF9F]' + }, + { + 'name': 'InMiscellaneous_Mathematical_Symbols_A', + 'bmp': '\u27C0-\u27EF' + }, + { + 'name': 'InMiscellaneous_Mathematical_Symbols_B', + 'bmp': '\u2980-\u29FF' + }, + { + 'name': 'InMiscellaneous_Symbols', + 'bmp': '\u2600-\u26FF' + }, + { + 'name': 'InMiscellaneous_Symbols_And_Arrows', + 'bmp': '\u2B00-\u2BFF' + }, + { + 'name': 'InMiscellaneous_Symbols_And_Pictographs', + 'astral': '\uD83C[\uDF00-\uDFFF]|\uD83D[\uDC00-\uDDFF]' + }, + { + 'name': 'InMiscellaneous_Technical', + 'bmp': '\u2300-\u23FF' + }, + { + 'name': 'InModi', + 'astral': '\uD805[\uDE00-\uDE5F]' + }, + { + 'name': 'InModifier_Tone_Letters', + 'bmp': '\uA700-\uA71F' + }, + { + 'name': 'InMongolian', + 'bmp': '\u1800-\u18AF' + }, + { + 'name': 'InMongolian_Supplement', + 'astral': '\uD805[\uDE60-\uDE7F]' + }, + { + 'name': 'InMro', + 'astral': '\uD81A[\uDE40-\uDE6F]' + }, + { + 'name': 'InMultani', + 'astral': '\uD804[\uDE80-\uDEAF]' + }, + { + 'name': 'InMusical_Symbols', + 'astral': '\uD834[\uDD00-\uDDFF]' + }, + { + 'name': 'InMyanmar', + 'bmp': '\u1000-\u109F' + }, + { + 'name': 'InMyanmar_Extended_A', + 'bmp': '\uAA60-\uAA7F' + }, + { + 'name': 'InMyanmar_Extended_B', + 'bmp': '\uA9E0-\uA9FF' + }, + { + 'name': 'InNKo', + 'bmp': '\u07C0-\u07FF' + }, + { + 'name': 'InNabataean', + 'astral': '\uD802[\uDC80-\uDCAF]' + }, + { + 'name': 'InNew_Tai_Lue', + 'bmp': '\u1980-\u19DF' + }, + { + 'name': 'InNewa', + 'astral': '\uD805[\uDC00-\uDC7F]' + }, + { + 'name': 'InNumber_Forms', + 'bmp': '\u2150-\u218F' + }, + { + 'name': 'InNushu', + 'astral': '\uD82C[\uDD70-\uDEFF]' + }, + { + 'name': 'InOgham', + 'bmp': '\u1680-\u169F' + }, + { + 'name': 'InOl_Chiki', + 'bmp': '\u1C50-\u1C7F' + }, + { + 'name': 'InOld_Hungarian', + 'astral': '\uD803[\uDC80-\uDCFF]' + }, + { + 'name': 'InOld_Italic', + 'astral': '\uD800[\uDF00-\uDF2F]' + }, + { + 'name': 'InOld_North_Arabian', + 'astral': '\uD802[\uDE80-\uDE9F]' + }, + { + 'name': 'InOld_Permic', + 'astral': '\uD800[\uDF50-\uDF7F]' + }, + { + 'name': 'InOld_Persian', + 'astral': '\uD800[\uDFA0-\uDFDF]' + }, + { + 'name': 'InOld_Sogdian', + 'astral': '\uD803[\uDF00-\uDF2F]' + }, + { + 'name': 'InOld_South_Arabian', + 'astral': '\uD802[\uDE60-\uDE7F]' + }, + { + 'name': 'InOld_Turkic', + 'astral': '\uD803[\uDC00-\uDC4F]' + }, + { + 'name': 'InOptical_Character_Recognition', + 'bmp': '\u2440-\u245F' + }, + { + 'name': 'InOriya', + 'bmp': '\u0B00-\u0B7F' + }, + { + 'name': 'InOrnamental_Dingbats', + 'astral': '\uD83D[\uDE50-\uDE7F]' + }, + { + 'name': 'InOsage', + 'astral': '\uD801[\uDCB0-\uDCFF]' + }, + { + 'name': 'InOsmanya', + 'astral': '\uD801[\uDC80-\uDCAF]' + }, + { + 'name': 'InPahawh_Hmong', + 'astral': '\uD81A[\uDF00-\uDF8F]' + }, + { + 'name': 'InPalmyrene', + 'astral': '\uD802[\uDC60-\uDC7F]' + }, + { + 'name': 'InPau_Cin_Hau', + 'astral': '\uD806[\uDEC0-\uDEFF]' + }, + { + 'name': 'InPhags_Pa', + 'bmp': '\uA840-\uA87F' + }, + { + 'name': 'InPhaistos_Disc', + 'astral': '\uD800[\uDDD0-\uDDFF]' + }, + { + 'name': 'InPhoenician', + 'astral': '\uD802[\uDD00-\uDD1F]' + }, + { + 'name': 'InPhonetic_Extensions', + 'bmp': '\u1D00-\u1D7F' + }, + { + 'name': 'InPhonetic_Extensions_Supplement', + 'bmp': '\u1D80-\u1DBF' + }, + { + 'name': 'InPlaying_Cards', + 'astral': '\uD83C[\uDCA0-\uDCFF]' + }, + { + 'name': 'InPrivate_Use_Area', + 'bmp': '\uE000-\uF8FF' + }, + { + 'name': 'InPsalter_Pahlavi', + 'astral': '\uD802[\uDF80-\uDFAF]' + }, + { + 'name': 'InRejang', + 'bmp': '\uA930-\uA95F' + }, + { + 'name': 'InRumi_Numeral_Symbols', + 'astral': '\uD803[\uDE60-\uDE7F]' + }, + { + 'name': 'InRunic', + 'bmp': '\u16A0-\u16FF' + }, + { + 'name': 'InSamaritan', + 'bmp': '\u0800-\u083F' + }, + { + 'name': 'InSaurashtra', + 'bmp': '\uA880-\uA8DF' + }, + { + 'name': 'InSharada', + 'astral': '\uD804[\uDD80-\uDDDF]' + }, + { + 'name': 'InShavian', + 'astral': '\uD801[\uDC50-\uDC7F]' + }, + { + 'name': 'InShorthand_Format_Controls', + 'astral': '\uD82F[\uDCA0-\uDCAF]' + }, + { + 'name': 'InSiddham', + 'astral': '\uD805[\uDD80-\uDDFF]' + }, + { + 'name': 'InSinhala', + 'bmp': '\u0D80-\u0DFF' + }, + { + 'name': 'InSinhala_Archaic_Numbers', + 'astral': '\uD804[\uDDE0-\uDDFF]' + }, + { + 'name': 'InSmall_Form_Variants', + 'bmp': '\uFE50-\uFE6F' + }, + { + 'name': 'InSogdian', + 'astral': '\uD803[\uDF30-\uDF6F]' + }, + { + 'name': 'InSora_Sompeng', + 'astral': '\uD804[\uDCD0-\uDCFF]' + }, + { + 'name': 'InSoyombo', + 'astral': '\uD806[\uDE50-\uDEAF]' + }, + { + 'name': 'InSpacing_Modifier_Letters', + 'bmp': '\u02B0-\u02FF' + }, + { + 'name': 'InSpecials', + 'bmp': '\uFFF0-\uFFFF' + }, + { + 'name': 'InSundanese', + 'bmp': '\u1B80-\u1BBF' + }, + { + 'name': 'InSundanese_Supplement', + 'bmp': '\u1CC0-\u1CCF' + }, + { + 'name': 'InSuperscripts_And_Subscripts', + 'bmp': '\u2070-\u209F' + }, + { + 'name': 'InSupplemental_Arrows_A', + 'bmp': '\u27F0-\u27FF' + }, + { + 'name': 'InSupplemental_Arrows_B', + 'bmp': '\u2900-\u297F' + }, + { + 'name': 'InSupplemental_Arrows_C', + 'astral': '\uD83E[\uDC00-\uDCFF]' + }, + { + 'name': 'InSupplemental_Mathematical_Operators', + 'bmp': '\u2A00-\u2AFF' + }, + { + 'name': 'InSupplemental_Punctuation', + 'bmp': '\u2E00-\u2E7F' + }, + { + 'name': 'InSupplemental_Symbols_And_Pictographs', + 'astral': '\uD83E[\uDD00-\uDDFF]' + }, + { + 'name': 'InSupplementary_Private_Use_Area_A', + 'astral': '[\uDB80-\uDBBF][\uDC00-\uDFFF]' + }, + { + 'name': 'InSupplementary_Private_Use_Area_B', + 'astral': '[\uDBC0-\uDBFF][\uDC00-\uDFFF]' + }, + { + 'name': 'InSutton_SignWriting', + 'astral': '\uD836[\uDC00-\uDEAF]' + }, + { + 'name': 'InSyloti_Nagri', + 'bmp': '\uA800-\uA82F' + }, + { + 'name': 'InSyriac', + 'bmp': '\u0700-\u074F' + }, + { + 'name': 'InSyriac_Supplement', + 'bmp': '\u0860-\u086F' + }, + { + 'name': 'InTagalog', + 'bmp': '\u1700-\u171F' + }, + { + 'name': 'InTagbanwa', + 'bmp': '\u1760-\u177F' + }, + { + 'name': 'InTags', + 'astral': '\uDB40[\uDC00-\uDC7F]' + }, + { + 'name': 'InTai_Le', + 'bmp': '\u1950-\u197F' + }, + { + 'name': 'InTai_Tham', + 'bmp': '\u1A20-\u1AAF' + }, + { + 'name': 'InTai_Viet', + 'bmp': '\uAA80-\uAADF' + }, + { + 'name': 'InTai_Xuan_Jing_Symbols', + 'astral': '\uD834[\uDF00-\uDF5F]' + }, + { + 'name': 'InTakri', + 'astral': '\uD805[\uDE80-\uDECF]' + }, + { + 'name': 'InTamil', + 'bmp': '\u0B80-\u0BFF' + }, + { + 'name': 'InTangut', + 'astral': '[\uD81C-\uD821][\uDC00-\uDFFF]' + }, + { + 'name': 'InTangut_Components', + 'astral': '\uD822[\uDC00-\uDEFF]' + }, + { + 'name': 'InTelugu', + 'bmp': '\u0C00-\u0C7F' + }, + { + 'name': 'InThaana', + 'bmp': '\u0780-\u07BF' + }, + { + 'name': 'InThai', + 'bmp': '\u0E00-\u0E7F' + }, + { + 'name': 'InTibetan', + 'bmp': '\u0F00-\u0FFF' + }, + { + 'name': 'InTifinagh', + 'bmp': '\u2D30-\u2D7F' + }, + { + 'name': 'InTirhuta', + 'astral': '\uD805[\uDC80-\uDCDF]' + }, + { + 'name': 'InTransport_And_Map_Symbols', + 'astral': '\uD83D[\uDE80-\uDEFF]' + }, + { + 'name': 'InUgaritic', + 'astral': '\uD800[\uDF80-\uDF9F]' + }, + { + 'name': 'InUnified_Canadian_Aboriginal_Syllabics', + 'bmp': '\u1400-\u167F' + }, + { + 'name': 'InUnified_Canadian_Aboriginal_Syllabics_Extended', + 'bmp': '\u18B0-\u18FF' + }, + { + 'name': 'InVai', + 'bmp': '\uA500-\uA63F' + }, + { + 'name': 'InVariation_Selectors', + 'bmp': '\uFE00-\uFE0F' + }, + { + 'name': 'InVariation_Selectors_Supplement', + 'astral': '\uDB40[\uDD00-\uDDEF]' + }, + { + 'name': 'InVedic_Extensions', + 'bmp': '\u1CD0-\u1CFF' + }, + { + 'name': 'InVertical_Forms', + 'bmp': '\uFE10-\uFE1F' + }, + { + 'name': 'InWarang_Citi', + 'astral': '\uD806[\uDCA0-\uDCFF]' + }, + { + 'name': 'InYi_Radicals', + 'bmp': '\uA490-\uA4CF' + }, + { + 'name': 'InYi_Syllables', + 'bmp': '\uA000-\uA48F' + }, + { + 'name': 'InYijing_Hexagram_Symbols', + 'bmp': '\u4DC0-\u4DFF' + }, + { + 'name': 'InZanabazar_Square', + 'astral': '\uD806[\uDE00-\uDE4F]' + } +]; + +var unicodeBlocks = createCommonjsModule(function (module, exports) { +"use strict"; + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.default = void 0; + +var _blocks = _interopRequireDefault(blocks); + +function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } + +/*! + * XRegExp Unicode Blocks 4.2.0 + * + * Steven Levithan (c) 2010-present MIT License + * Unicode data by Mathias Bynens + */ +var _default = function _default(XRegExp) { + /** + * Adds support for all Unicode blocks. Block names use the prefix 'In'. E.g., + * `\p{InBasicLatin}`. Token names are case insensitive, and any spaces, hyphens, and + * underscores are ignored. + * + * Uses Unicode 11.0.0. + * + * @requires XRegExp, Unicode Base + */ + if (!XRegExp.addUnicodeData) { + throw new ReferenceError('Unicode Base must be loaded before Unicode Blocks'); + } + + XRegExp.addUnicodeData(_blocks.default); +}; + +exports.default = _default; +module.exports = exports["default"]; +}); + +unwrapExports(unicodeBlocks); + +var categories = [ + { + 'name': 'C', + 'alias': 'Other', + 'isBmpLast': true, + 'bmp': '\0-\x1F\x7F-\x9F\xAD\u0378\u0379\u0380-\u0383\u038B\u038D\u03A2\u0530\u0557\u0558\u058B\u058C\u0590\u05C8-\u05CF\u05EB-\u05EE\u05F5-\u0605\u061C\u061D\u06DD\u070E\u070F\u074B\u074C\u07B2-\u07BF\u07FB\u07FC\u082E\u082F\u083F\u085C\u085D\u085F\u086B-\u089F\u08B5\u08BE-\u08D2\u08E2\u0984\u098D\u098E\u0991\u0992\u09A9\u09B1\u09B3-\u09B5\u09BA\u09BB\u09C5\u09C6\u09C9\u09CA\u09CF-\u09D6\u09D8-\u09DB\u09DE\u09E4\u09E5\u09FF\u0A00\u0A04\u0A0B-\u0A0E\u0A11\u0A12\u0A29\u0A31\u0A34\u0A37\u0A3A\u0A3B\u0A3D\u0A43-\u0A46\u0A49\u0A4A\u0A4E-\u0A50\u0A52-\u0A58\u0A5D\u0A5F-\u0A65\u0A77-\u0A80\u0A84\u0A8E\u0A92\u0AA9\u0AB1\u0AB4\u0ABA\u0ABB\u0AC6\u0ACA\u0ACE\u0ACF\u0AD1-\u0ADF\u0AE4\u0AE5\u0AF2-\u0AF8\u0B00\u0B04\u0B0D\u0B0E\u0B11\u0B12\u0B29\u0B31\u0B34\u0B3A\u0B3B\u0B45\u0B46\u0B49\u0B4A\u0B4E-\u0B55\u0B58-\u0B5B\u0B5E\u0B64\u0B65\u0B78-\u0B81\u0B84\u0B8B-\u0B8D\u0B91\u0B96-\u0B98\u0B9B\u0B9D\u0BA0-\u0BA2\u0BA5-\u0BA7\u0BAB-\u0BAD\u0BBA-\u0BBD\u0BC3-\u0BC5\u0BC9\u0BCE\u0BCF\u0BD1-\u0BD6\u0BD8-\u0BE5\u0BFB-\u0BFF\u0C0D\u0C11\u0C29\u0C3A-\u0C3C\u0C45\u0C49\u0C4E-\u0C54\u0C57\u0C5B-\u0C5F\u0C64\u0C65\u0C70-\u0C77\u0C8D\u0C91\u0CA9\u0CB4\u0CBA\u0CBB\u0CC5\u0CC9\u0CCE-\u0CD4\u0CD7-\u0CDD\u0CDF\u0CE4\u0CE5\u0CF0\u0CF3-\u0CFF\u0D04\u0D0D\u0D11\u0D45\u0D49\u0D50-\u0D53\u0D64\u0D65\u0D80\u0D81\u0D84\u0D97-\u0D99\u0DB2\u0DBC\u0DBE\u0DBF\u0DC7-\u0DC9\u0DCB-\u0DCE\u0DD5\u0DD7\u0DE0-\u0DE5\u0DF0\u0DF1\u0DF5-\u0E00\u0E3B-\u0E3E\u0E5C-\u0E80\u0E83\u0E85\u0E86\u0E89\u0E8B\u0E8C\u0E8E-\u0E93\u0E98\u0EA0\u0EA4\u0EA6\u0EA8\u0EA9\u0EAC\u0EBA\u0EBE\u0EBF\u0EC5\u0EC7\u0ECE\u0ECF\u0EDA\u0EDB\u0EE0-\u0EFF\u0F48\u0F6D-\u0F70\u0F98\u0FBD\u0FCD\u0FDB-\u0FFF\u10C6\u10C8-\u10CC\u10CE\u10CF\u1249\u124E\u124F\u1257\u1259\u125E\u125F\u1289\u128E\u128F\u12B1\u12B6\u12B7\u12BF\u12C1\u12C6\u12C7\u12D7\u1311\u1316\u1317\u135B\u135C\u137D-\u137F\u139A-\u139F\u13F6\u13F7\u13FE\u13FF\u169D-\u169F\u16F9-\u16FF\u170D\u1715-\u171F\u1737-\u173F\u1754-\u175F\u176D\u1771\u1774-\u177F\u17DE\u17DF\u17EA-\u17EF\u17FA-\u17FF\u180E\u180F\u181A-\u181F\u1879-\u187F\u18AB-\u18AF\u18F6-\u18FF\u191F\u192C-\u192F\u193C-\u193F\u1941-\u1943\u196E\u196F\u1975-\u197F\u19AC-\u19AF\u19CA-\u19CF\u19DB-\u19DD\u1A1C\u1A1D\u1A5F\u1A7D\u1A7E\u1A8A-\u1A8F\u1A9A-\u1A9F\u1AAE\u1AAF\u1ABF-\u1AFF\u1B4C-\u1B4F\u1B7D-\u1B7F\u1BF4-\u1BFB\u1C38-\u1C3A\u1C4A-\u1C4C\u1C89-\u1C8F\u1CBB\u1CBC\u1CC8-\u1CCF\u1CFA-\u1CFF\u1DFA\u1F16\u1F17\u1F1E\u1F1F\u1F46\u1F47\u1F4E\u1F4F\u1F58\u1F5A\u1F5C\u1F5E\u1F7E\u1F7F\u1FB5\u1FC5\u1FD4\u1FD5\u1FDC\u1FF0\u1FF1\u1FF5\u1FFF\u200B-\u200F\u202A-\u202E\u2060-\u206F\u2072\u2073\u208F\u209D-\u209F\u20C0-\u20CF\u20F1-\u20FF\u218C-\u218F\u2427-\u243F\u244B-\u245F\u2B74\u2B75\u2B96\u2B97\u2BC9\u2BFF\u2C2F\u2C5F\u2CF4-\u2CF8\u2D26\u2D28-\u2D2C\u2D2E\u2D2F\u2D68-\u2D6E\u2D71-\u2D7E\u2D97-\u2D9F\u2DA7\u2DAF\u2DB7\u2DBF\u2DC7\u2DCF\u2DD7\u2DDF\u2E4F-\u2E7F\u2E9A\u2EF4-\u2EFF\u2FD6-\u2FEF\u2FFC-\u2FFF\u3040\u3097\u3098\u3100-\u3104\u3130\u318F\u31BB-\u31BF\u31E4-\u31EF\u321F\u32FF\u4DB6-\u4DBF\u9FF0-\u9FFF\uA48D-\uA48F\uA4C7-\uA4CF\uA62C-\uA63F\uA6F8-\uA6FF\uA7BA-\uA7F6\uA82C-\uA82F\uA83A-\uA83F\uA878-\uA87F\uA8C6-\uA8CD\uA8DA-\uA8DF\uA954-\uA95E\uA97D-\uA97F\uA9CE\uA9DA-\uA9DD\uA9FF\uAA37-\uAA3F\uAA4E\uAA4F\uAA5A\uAA5B\uAAC3-\uAADA\uAAF7-\uAB00\uAB07\uAB08\uAB0F\uAB10\uAB17-\uAB1F\uAB27\uAB2F\uAB66-\uAB6F\uABEE\uABEF\uABFA-\uABFF\uD7A4-\uD7AF\uD7C7-\uD7CA\uD7FC-\uF8FF\uFA6E\uFA6F\uFADA-\uFAFF\uFB07-\uFB12\uFB18-\uFB1C\uFB37\uFB3D\uFB3F\uFB42\uFB45\uFBC2-\uFBD2\uFD40-\uFD4F\uFD90\uFD91\uFDC8-\uFDEF\uFDFE\uFDFF\uFE1A-\uFE1F\uFE53\uFE67\uFE6C-\uFE6F\uFE75\uFEFD-\uFF00\uFFBF-\uFFC1\uFFC8\uFFC9\uFFD0\uFFD1\uFFD8\uFFD9\uFFDD-\uFFDF\uFFE7\uFFEF-\uFFFB\uFFFE\uFFFF', + 'astral': '\uD800[\uDC0C\uDC27\uDC3B\uDC3E\uDC4E\uDC4F\uDC5E-\uDC7F\uDCFB-\uDCFF\uDD03-\uDD06\uDD34-\uDD36\uDD8F\uDD9C-\uDD9F\uDDA1-\uDDCF\uDDFE-\uDE7F\uDE9D-\uDE9F\uDED1-\uDEDF\uDEFC-\uDEFF\uDF24-\uDF2C\uDF4B-\uDF4F\uDF7B-\uDF7F\uDF9E\uDFC4-\uDFC7\uDFD6-\uDFFF]|\uD801[\uDC9E\uDC9F\uDCAA-\uDCAF\uDCD4-\uDCD7\uDCFC-\uDCFF\uDD28-\uDD2F\uDD64-\uDD6E\uDD70-\uDDFF\uDF37-\uDF3F\uDF56-\uDF5F\uDF68-\uDFFF]|\uD802[\uDC06\uDC07\uDC09\uDC36\uDC39-\uDC3B\uDC3D\uDC3E\uDC56\uDC9F-\uDCA6\uDCB0-\uDCDF\uDCF3\uDCF6-\uDCFA\uDD1C-\uDD1E\uDD3A-\uDD3E\uDD40-\uDD7F\uDDB8-\uDDBB\uDDD0\uDDD1\uDE04\uDE07-\uDE0B\uDE14\uDE18\uDE36\uDE37\uDE3B-\uDE3E\uDE49-\uDE4F\uDE59-\uDE5F\uDEA0-\uDEBF\uDEE7-\uDEEA\uDEF7-\uDEFF\uDF36-\uDF38\uDF56\uDF57\uDF73-\uDF77\uDF92-\uDF98\uDF9D-\uDFA8\uDFB0-\uDFFF]|\uD803[\uDC49-\uDC7F\uDCB3-\uDCBF\uDCF3-\uDCF9\uDD28-\uDD2F\uDD3A-\uDE5F\uDE7F-\uDEFF\uDF28-\uDF2F\uDF5A-\uDFFF]|\uD804[\uDC4E-\uDC51\uDC70-\uDC7E\uDCBD\uDCC2-\uDCCF\uDCE9-\uDCEF\uDCFA-\uDCFF\uDD35\uDD47-\uDD4F\uDD77-\uDD7F\uDDCE\uDDCF\uDDE0\uDDF5-\uDDFF\uDE12\uDE3F-\uDE7F\uDE87\uDE89\uDE8E\uDE9E\uDEAA-\uDEAF\uDEEB-\uDEEF\uDEFA-\uDEFF\uDF04\uDF0D\uDF0E\uDF11\uDF12\uDF29\uDF31\uDF34\uDF3A\uDF45\uDF46\uDF49\uDF4A\uDF4E\uDF4F\uDF51-\uDF56\uDF58-\uDF5C\uDF64\uDF65\uDF6D-\uDF6F\uDF75-\uDFFF]|\uD805[\uDC5A\uDC5C\uDC5F-\uDC7F\uDCC8-\uDCCF\uDCDA-\uDD7F\uDDB6\uDDB7\uDDDE-\uDDFF\uDE45-\uDE4F\uDE5A-\uDE5F\uDE6D-\uDE7F\uDEB8-\uDEBF\uDECA-\uDEFF\uDF1B\uDF1C\uDF2C-\uDF2F\uDF40-\uDFFF]|\uD806[\uDC3C-\uDC9F\uDCF3-\uDCFE\uDD00-\uDDFF\uDE48-\uDE4F\uDE84\uDE85\uDEA3-\uDEBF\uDEF9-\uDFFF]|\uD807[\uDC09\uDC37\uDC46-\uDC4F\uDC6D-\uDC6F\uDC90\uDC91\uDCA8\uDCB7-\uDCFF\uDD07\uDD0A\uDD37-\uDD39\uDD3B\uDD3E\uDD48-\uDD4F\uDD5A-\uDD5F\uDD66\uDD69\uDD8F\uDD92\uDD99-\uDD9F\uDDAA-\uDEDF\uDEF9-\uDFFF]|\uD808[\uDF9A-\uDFFF]|\uD809[\uDC6F\uDC75-\uDC7F\uDD44-\uDFFF]|[\uD80A\uD80B\uD80E-\uD810\uD812-\uD819\uD823-\uD82B\uD82D\uD82E\uD830-\uD833\uD837\uD839\uD83F\uD87B-\uD87D\uD87F-\uDB3F\uDB41-\uDBFF][\uDC00-\uDFFF]|\uD80D[\uDC2F-\uDFFF]|\uD811[\uDE47-\uDFFF]|\uD81A[\uDE39-\uDE3F\uDE5F\uDE6A-\uDE6D\uDE70-\uDECF\uDEEE\uDEEF\uDEF6-\uDEFF\uDF46-\uDF4F\uDF5A\uDF62\uDF78-\uDF7C\uDF90-\uDFFF]|\uD81B[\uDC00-\uDE3F\uDE9B-\uDEFF\uDF45-\uDF4F\uDF7F-\uDF8E\uDFA0-\uDFDF\uDFE2-\uDFFF]|\uD821[\uDFF2-\uDFFF]|\uD822[\uDEF3-\uDFFF]|\uD82C[\uDD1F-\uDD6F\uDEFC-\uDFFF]|\uD82F[\uDC6B-\uDC6F\uDC7D-\uDC7F\uDC89-\uDC8F\uDC9A\uDC9B\uDCA0-\uDFFF]|\uD834[\uDCF6-\uDCFF\uDD27\uDD28\uDD73-\uDD7A\uDDE9-\uDDFF\uDE46-\uDEDF\uDEF4-\uDEFF\uDF57-\uDF5F\uDF79-\uDFFF]|\uD835[\uDC55\uDC9D\uDCA0\uDCA1\uDCA3\uDCA4\uDCA7\uDCA8\uDCAD\uDCBA\uDCBC\uDCC4\uDD06\uDD0B\uDD0C\uDD15\uDD1D\uDD3A\uDD3F\uDD45\uDD47-\uDD49\uDD51\uDEA6\uDEA7\uDFCC\uDFCD]|\uD836[\uDE8C-\uDE9A\uDEA0\uDEB0-\uDFFF]|\uD838[\uDC07\uDC19\uDC1A\uDC22\uDC25\uDC2B-\uDFFF]|\uD83A[\uDCC5\uDCC6\uDCD7-\uDCFF\uDD4B-\uDD4F\uDD5A-\uDD5D\uDD60-\uDFFF]|\uD83B[\uDC00-\uDC70\uDCB5-\uDDFF\uDE04\uDE20\uDE23\uDE25\uDE26\uDE28\uDE33\uDE38\uDE3A\uDE3C-\uDE41\uDE43-\uDE46\uDE48\uDE4A\uDE4C\uDE50\uDE53\uDE55\uDE56\uDE58\uDE5A\uDE5C\uDE5E\uDE60\uDE63\uDE65\uDE66\uDE6B\uDE73\uDE78\uDE7D\uDE7F\uDE8A\uDE9C-\uDEA0\uDEA4\uDEAA\uDEBC-\uDEEF\uDEF2-\uDFFF]|\uD83C[\uDC2C-\uDC2F\uDC94-\uDC9F\uDCAF\uDCB0\uDCC0\uDCD0\uDCF6-\uDCFF\uDD0D-\uDD0F\uDD6C-\uDD6F\uDDAD-\uDDE5\uDE03-\uDE0F\uDE3C-\uDE3F\uDE49-\uDE4F\uDE52-\uDE5F\uDE66-\uDEFF]|\uD83D[\uDED5-\uDEDF\uDEED-\uDEEF\uDEFA-\uDEFF\uDF74-\uDF7F\uDFD9-\uDFFF]|\uD83E[\uDC0C-\uDC0F\uDC48-\uDC4F\uDC5A-\uDC5F\uDC88-\uDC8F\uDCAE-\uDCFF\uDD0C-\uDD0F\uDD3F\uDD71\uDD72\uDD77-\uDD79\uDD7B\uDDA3-\uDDAF\uDDBA-\uDDBF\uDDC3-\uDDCF\uDE00-\uDE5F\uDE6E-\uDFFF]|\uD869[\uDED7-\uDEFF]|\uD86D[\uDF35-\uDF3F]|\uD86E[\uDC1E\uDC1F]|\uD873[\uDEA2-\uDEAF]|\uD87A[\uDFE1-\uDFFF]|\uD87E[\uDE1E-\uDFFF]|\uDB40[\uDC00-\uDCFF\uDDF0-\uDFFF]' + }, + { + 'name': 'Cc', + 'alias': 'Control', + 'bmp': '\0-\x1F\x7F-\x9F' + }, + { + 'name': 'Cf', + 'alias': 'Format', + 'bmp': '\xAD\u0600-\u0605\u061C\u06DD\u070F\u08E2\u180E\u200B-\u200F\u202A-\u202E\u2060-\u2064\u2066-\u206F\uFEFF\uFFF9-\uFFFB', + 'astral': '\uD804[\uDCBD\uDCCD]|\uD82F[\uDCA0-\uDCA3]|\uD834[\uDD73-\uDD7A]|\uDB40[\uDC01\uDC20-\uDC7F]' + }, + { + 'name': 'Cn', + 'alias': 'Unassigned', + 'bmp': '\u0378\u0379\u0380-\u0383\u038B\u038D\u03A2\u0530\u0557\u0558\u058B\u058C\u0590\u05C8-\u05CF\u05EB-\u05EE\u05F5-\u05FF\u061D\u070E\u074B\u074C\u07B2-\u07BF\u07FB\u07FC\u082E\u082F\u083F\u085C\u085D\u085F\u086B-\u089F\u08B5\u08BE-\u08D2\u0984\u098D\u098E\u0991\u0992\u09A9\u09B1\u09B3-\u09B5\u09BA\u09BB\u09C5\u09C6\u09C9\u09CA\u09CF-\u09D6\u09D8-\u09DB\u09DE\u09E4\u09E5\u09FF\u0A00\u0A04\u0A0B-\u0A0E\u0A11\u0A12\u0A29\u0A31\u0A34\u0A37\u0A3A\u0A3B\u0A3D\u0A43-\u0A46\u0A49\u0A4A\u0A4E-\u0A50\u0A52-\u0A58\u0A5D\u0A5F-\u0A65\u0A77-\u0A80\u0A84\u0A8E\u0A92\u0AA9\u0AB1\u0AB4\u0ABA\u0ABB\u0AC6\u0ACA\u0ACE\u0ACF\u0AD1-\u0ADF\u0AE4\u0AE5\u0AF2-\u0AF8\u0B00\u0B04\u0B0D\u0B0E\u0B11\u0B12\u0B29\u0B31\u0B34\u0B3A\u0B3B\u0B45\u0B46\u0B49\u0B4A\u0B4E-\u0B55\u0B58-\u0B5B\u0B5E\u0B64\u0B65\u0B78-\u0B81\u0B84\u0B8B-\u0B8D\u0B91\u0B96-\u0B98\u0B9B\u0B9D\u0BA0-\u0BA2\u0BA5-\u0BA7\u0BAB-\u0BAD\u0BBA-\u0BBD\u0BC3-\u0BC5\u0BC9\u0BCE\u0BCF\u0BD1-\u0BD6\u0BD8-\u0BE5\u0BFB-\u0BFF\u0C0D\u0C11\u0C29\u0C3A-\u0C3C\u0C45\u0C49\u0C4E-\u0C54\u0C57\u0C5B-\u0C5F\u0C64\u0C65\u0C70-\u0C77\u0C8D\u0C91\u0CA9\u0CB4\u0CBA\u0CBB\u0CC5\u0CC9\u0CCE-\u0CD4\u0CD7-\u0CDD\u0CDF\u0CE4\u0CE5\u0CF0\u0CF3-\u0CFF\u0D04\u0D0D\u0D11\u0D45\u0D49\u0D50-\u0D53\u0D64\u0D65\u0D80\u0D81\u0D84\u0D97-\u0D99\u0DB2\u0DBC\u0DBE\u0DBF\u0DC7-\u0DC9\u0DCB-\u0DCE\u0DD5\u0DD7\u0DE0-\u0DE5\u0DF0\u0DF1\u0DF5-\u0E00\u0E3B-\u0E3E\u0E5C-\u0E80\u0E83\u0E85\u0E86\u0E89\u0E8B\u0E8C\u0E8E-\u0E93\u0E98\u0EA0\u0EA4\u0EA6\u0EA8\u0EA9\u0EAC\u0EBA\u0EBE\u0EBF\u0EC5\u0EC7\u0ECE\u0ECF\u0EDA\u0EDB\u0EE0-\u0EFF\u0F48\u0F6D-\u0F70\u0F98\u0FBD\u0FCD\u0FDB-\u0FFF\u10C6\u10C8-\u10CC\u10CE\u10CF\u1249\u124E\u124F\u1257\u1259\u125E\u125F\u1289\u128E\u128F\u12B1\u12B6\u12B7\u12BF\u12C1\u12C6\u12C7\u12D7\u1311\u1316\u1317\u135B\u135C\u137D-\u137F\u139A-\u139F\u13F6\u13F7\u13FE\u13FF\u169D-\u169F\u16F9-\u16FF\u170D\u1715-\u171F\u1737-\u173F\u1754-\u175F\u176D\u1771\u1774-\u177F\u17DE\u17DF\u17EA-\u17EF\u17FA-\u17FF\u180F\u181A-\u181F\u1879-\u187F\u18AB-\u18AF\u18F6-\u18FF\u191F\u192C-\u192F\u193C-\u193F\u1941-\u1943\u196E\u196F\u1975-\u197F\u19AC-\u19AF\u19CA-\u19CF\u19DB-\u19DD\u1A1C\u1A1D\u1A5F\u1A7D\u1A7E\u1A8A-\u1A8F\u1A9A-\u1A9F\u1AAE\u1AAF\u1ABF-\u1AFF\u1B4C-\u1B4F\u1B7D-\u1B7F\u1BF4-\u1BFB\u1C38-\u1C3A\u1C4A-\u1C4C\u1C89-\u1C8F\u1CBB\u1CBC\u1CC8-\u1CCF\u1CFA-\u1CFF\u1DFA\u1F16\u1F17\u1F1E\u1F1F\u1F46\u1F47\u1F4E\u1F4F\u1F58\u1F5A\u1F5C\u1F5E\u1F7E\u1F7F\u1FB5\u1FC5\u1FD4\u1FD5\u1FDC\u1FF0\u1FF1\u1FF5\u1FFF\u2065\u2072\u2073\u208F\u209D-\u209F\u20C0-\u20CF\u20F1-\u20FF\u218C-\u218F\u2427-\u243F\u244B-\u245F\u2B74\u2B75\u2B96\u2B97\u2BC9\u2BFF\u2C2F\u2C5F\u2CF4-\u2CF8\u2D26\u2D28-\u2D2C\u2D2E\u2D2F\u2D68-\u2D6E\u2D71-\u2D7E\u2D97-\u2D9F\u2DA7\u2DAF\u2DB7\u2DBF\u2DC7\u2DCF\u2DD7\u2DDF\u2E4F-\u2E7F\u2E9A\u2EF4-\u2EFF\u2FD6-\u2FEF\u2FFC-\u2FFF\u3040\u3097\u3098\u3100-\u3104\u3130\u318F\u31BB-\u31BF\u31E4-\u31EF\u321F\u32FF\u4DB6-\u4DBF\u9FF0-\u9FFF\uA48D-\uA48F\uA4C7-\uA4CF\uA62C-\uA63F\uA6F8-\uA6FF\uA7BA-\uA7F6\uA82C-\uA82F\uA83A-\uA83F\uA878-\uA87F\uA8C6-\uA8CD\uA8DA-\uA8DF\uA954-\uA95E\uA97D-\uA97F\uA9CE\uA9DA-\uA9DD\uA9FF\uAA37-\uAA3F\uAA4E\uAA4F\uAA5A\uAA5B\uAAC3-\uAADA\uAAF7-\uAB00\uAB07\uAB08\uAB0F\uAB10\uAB17-\uAB1F\uAB27\uAB2F\uAB66-\uAB6F\uABEE\uABEF\uABFA-\uABFF\uD7A4-\uD7AF\uD7C7-\uD7CA\uD7FC-\uD7FF\uFA6E\uFA6F\uFADA-\uFAFF\uFB07-\uFB12\uFB18-\uFB1C\uFB37\uFB3D\uFB3F\uFB42\uFB45\uFBC2-\uFBD2\uFD40-\uFD4F\uFD90\uFD91\uFDC8-\uFDEF\uFDFE\uFDFF\uFE1A-\uFE1F\uFE53\uFE67\uFE6C-\uFE6F\uFE75\uFEFD\uFEFE\uFF00\uFFBF-\uFFC1\uFFC8\uFFC9\uFFD0\uFFD1\uFFD8\uFFD9\uFFDD-\uFFDF\uFFE7\uFFEF-\uFFF8\uFFFE\uFFFF', + 'astral': '\uD800[\uDC0C\uDC27\uDC3B\uDC3E\uDC4E\uDC4F\uDC5E-\uDC7F\uDCFB-\uDCFF\uDD03-\uDD06\uDD34-\uDD36\uDD8F\uDD9C-\uDD9F\uDDA1-\uDDCF\uDDFE-\uDE7F\uDE9D-\uDE9F\uDED1-\uDEDF\uDEFC-\uDEFF\uDF24-\uDF2C\uDF4B-\uDF4F\uDF7B-\uDF7F\uDF9E\uDFC4-\uDFC7\uDFD6-\uDFFF]|\uD801[\uDC9E\uDC9F\uDCAA-\uDCAF\uDCD4-\uDCD7\uDCFC-\uDCFF\uDD28-\uDD2F\uDD64-\uDD6E\uDD70-\uDDFF\uDF37-\uDF3F\uDF56-\uDF5F\uDF68-\uDFFF]|\uD802[\uDC06\uDC07\uDC09\uDC36\uDC39-\uDC3B\uDC3D\uDC3E\uDC56\uDC9F-\uDCA6\uDCB0-\uDCDF\uDCF3\uDCF6-\uDCFA\uDD1C-\uDD1E\uDD3A-\uDD3E\uDD40-\uDD7F\uDDB8-\uDDBB\uDDD0\uDDD1\uDE04\uDE07-\uDE0B\uDE14\uDE18\uDE36\uDE37\uDE3B-\uDE3E\uDE49-\uDE4F\uDE59-\uDE5F\uDEA0-\uDEBF\uDEE7-\uDEEA\uDEF7-\uDEFF\uDF36-\uDF38\uDF56\uDF57\uDF73-\uDF77\uDF92-\uDF98\uDF9D-\uDFA8\uDFB0-\uDFFF]|\uD803[\uDC49-\uDC7F\uDCB3-\uDCBF\uDCF3-\uDCF9\uDD28-\uDD2F\uDD3A-\uDE5F\uDE7F-\uDEFF\uDF28-\uDF2F\uDF5A-\uDFFF]|\uD804[\uDC4E-\uDC51\uDC70-\uDC7E\uDCC2-\uDCCC\uDCCE\uDCCF\uDCE9-\uDCEF\uDCFA-\uDCFF\uDD35\uDD47-\uDD4F\uDD77-\uDD7F\uDDCE\uDDCF\uDDE0\uDDF5-\uDDFF\uDE12\uDE3F-\uDE7F\uDE87\uDE89\uDE8E\uDE9E\uDEAA-\uDEAF\uDEEB-\uDEEF\uDEFA-\uDEFF\uDF04\uDF0D\uDF0E\uDF11\uDF12\uDF29\uDF31\uDF34\uDF3A\uDF45\uDF46\uDF49\uDF4A\uDF4E\uDF4F\uDF51-\uDF56\uDF58-\uDF5C\uDF64\uDF65\uDF6D-\uDF6F\uDF75-\uDFFF]|\uD805[\uDC5A\uDC5C\uDC5F-\uDC7F\uDCC8-\uDCCF\uDCDA-\uDD7F\uDDB6\uDDB7\uDDDE-\uDDFF\uDE45-\uDE4F\uDE5A-\uDE5F\uDE6D-\uDE7F\uDEB8-\uDEBF\uDECA-\uDEFF\uDF1B\uDF1C\uDF2C-\uDF2F\uDF40-\uDFFF]|\uD806[\uDC3C-\uDC9F\uDCF3-\uDCFE\uDD00-\uDDFF\uDE48-\uDE4F\uDE84\uDE85\uDEA3-\uDEBF\uDEF9-\uDFFF]|\uD807[\uDC09\uDC37\uDC46-\uDC4F\uDC6D-\uDC6F\uDC90\uDC91\uDCA8\uDCB7-\uDCFF\uDD07\uDD0A\uDD37-\uDD39\uDD3B\uDD3E\uDD48-\uDD4F\uDD5A-\uDD5F\uDD66\uDD69\uDD8F\uDD92\uDD99-\uDD9F\uDDAA-\uDEDF\uDEF9-\uDFFF]|\uD808[\uDF9A-\uDFFF]|\uD809[\uDC6F\uDC75-\uDC7F\uDD44-\uDFFF]|[\uD80A\uD80B\uD80E-\uD810\uD812-\uD819\uD823-\uD82B\uD82D\uD82E\uD830-\uD833\uD837\uD839\uD83F\uD87B-\uD87D\uD87F-\uDB3F\uDB41-\uDB7F][\uDC00-\uDFFF]|\uD80D[\uDC2F-\uDFFF]|\uD811[\uDE47-\uDFFF]|\uD81A[\uDE39-\uDE3F\uDE5F\uDE6A-\uDE6D\uDE70-\uDECF\uDEEE\uDEEF\uDEF6-\uDEFF\uDF46-\uDF4F\uDF5A\uDF62\uDF78-\uDF7C\uDF90-\uDFFF]|\uD81B[\uDC00-\uDE3F\uDE9B-\uDEFF\uDF45-\uDF4F\uDF7F-\uDF8E\uDFA0-\uDFDF\uDFE2-\uDFFF]|\uD821[\uDFF2-\uDFFF]|\uD822[\uDEF3-\uDFFF]|\uD82C[\uDD1F-\uDD6F\uDEFC-\uDFFF]|\uD82F[\uDC6B-\uDC6F\uDC7D-\uDC7F\uDC89-\uDC8F\uDC9A\uDC9B\uDCA4-\uDFFF]|\uD834[\uDCF6-\uDCFF\uDD27\uDD28\uDDE9-\uDDFF\uDE46-\uDEDF\uDEF4-\uDEFF\uDF57-\uDF5F\uDF79-\uDFFF]|\uD835[\uDC55\uDC9D\uDCA0\uDCA1\uDCA3\uDCA4\uDCA7\uDCA8\uDCAD\uDCBA\uDCBC\uDCC4\uDD06\uDD0B\uDD0C\uDD15\uDD1D\uDD3A\uDD3F\uDD45\uDD47-\uDD49\uDD51\uDEA6\uDEA7\uDFCC\uDFCD]|\uD836[\uDE8C-\uDE9A\uDEA0\uDEB0-\uDFFF]|\uD838[\uDC07\uDC19\uDC1A\uDC22\uDC25\uDC2B-\uDFFF]|\uD83A[\uDCC5\uDCC6\uDCD7-\uDCFF\uDD4B-\uDD4F\uDD5A-\uDD5D\uDD60-\uDFFF]|\uD83B[\uDC00-\uDC70\uDCB5-\uDDFF\uDE04\uDE20\uDE23\uDE25\uDE26\uDE28\uDE33\uDE38\uDE3A\uDE3C-\uDE41\uDE43-\uDE46\uDE48\uDE4A\uDE4C\uDE50\uDE53\uDE55\uDE56\uDE58\uDE5A\uDE5C\uDE5E\uDE60\uDE63\uDE65\uDE66\uDE6B\uDE73\uDE78\uDE7D\uDE7F\uDE8A\uDE9C-\uDEA0\uDEA4\uDEAA\uDEBC-\uDEEF\uDEF2-\uDFFF]|\uD83C[\uDC2C-\uDC2F\uDC94-\uDC9F\uDCAF\uDCB0\uDCC0\uDCD0\uDCF6-\uDCFF\uDD0D-\uDD0F\uDD6C-\uDD6F\uDDAD-\uDDE5\uDE03-\uDE0F\uDE3C-\uDE3F\uDE49-\uDE4F\uDE52-\uDE5F\uDE66-\uDEFF]|\uD83D[\uDED5-\uDEDF\uDEED-\uDEEF\uDEFA-\uDEFF\uDF74-\uDF7F\uDFD9-\uDFFF]|\uD83E[\uDC0C-\uDC0F\uDC48-\uDC4F\uDC5A-\uDC5F\uDC88-\uDC8F\uDCAE-\uDCFF\uDD0C-\uDD0F\uDD3F\uDD71\uDD72\uDD77-\uDD79\uDD7B\uDDA3-\uDDAF\uDDBA-\uDDBF\uDDC3-\uDDCF\uDE00-\uDE5F\uDE6E-\uDFFF]|\uD869[\uDED7-\uDEFF]|\uD86D[\uDF35-\uDF3F]|\uD86E[\uDC1E\uDC1F]|\uD873[\uDEA2-\uDEAF]|\uD87A[\uDFE1-\uDFFF]|\uD87E[\uDE1E-\uDFFF]|\uDB40[\uDC00\uDC02-\uDC1F\uDC80-\uDCFF\uDDF0-\uDFFF]|[\uDBBF\uDBFF][\uDFFE\uDFFF]' + }, + { + 'name': 'Co', + 'alias': 'Private_Use', + 'bmp': '\uE000-\uF8FF', + 'astral': '[\uDB80-\uDBBE\uDBC0-\uDBFE][\uDC00-\uDFFF]|[\uDBBF\uDBFF][\uDC00-\uDFFD]' + }, + { + 'name': 'Cs', + 'alias': 'Surrogate', + 'bmp': '\uD800-\uDFFF' + }, + { + 'name': 'L', + 'alias': 'Letter', + 'bmp': 'A-Za-z\xAA\xB5\xBA\xC0-\xD6\xD8-\xF6\xF8-\u02C1\u02C6-\u02D1\u02E0-\u02E4\u02EC\u02EE\u0370-\u0374\u0376\u0377\u037A-\u037D\u037F\u0386\u0388-\u038A\u038C\u038E-\u03A1\u03A3-\u03F5\u03F7-\u0481\u048A-\u052F\u0531-\u0556\u0559\u0560-\u0588\u05D0-\u05EA\u05EF-\u05F2\u0620-\u064A\u066E\u066F\u0671-\u06D3\u06D5\u06E5\u06E6\u06EE\u06EF\u06FA-\u06FC\u06FF\u0710\u0712-\u072F\u074D-\u07A5\u07B1\u07CA-\u07EA\u07F4\u07F5\u07FA\u0800-\u0815\u081A\u0824\u0828\u0840-\u0858\u0860-\u086A\u08A0-\u08B4\u08B6-\u08BD\u0904-\u0939\u093D\u0950\u0958-\u0961\u0971-\u0980\u0985-\u098C\u098F\u0990\u0993-\u09A8\u09AA-\u09B0\u09B2\u09B6-\u09B9\u09BD\u09CE\u09DC\u09DD\u09DF-\u09E1\u09F0\u09F1\u09FC\u0A05-\u0A0A\u0A0F\u0A10\u0A13-\u0A28\u0A2A-\u0A30\u0A32\u0A33\u0A35\u0A36\u0A38\u0A39\u0A59-\u0A5C\u0A5E\u0A72-\u0A74\u0A85-\u0A8D\u0A8F-\u0A91\u0A93-\u0AA8\u0AAA-\u0AB0\u0AB2\u0AB3\u0AB5-\u0AB9\u0ABD\u0AD0\u0AE0\u0AE1\u0AF9\u0B05-\u0B0C\u0B0F\u0B10\u0B13-\u0B28\u0B2A-\u0B30\u0B32\u0B33\u0B35-\u0B39\u0B3D\u0B5C\u0B5D\u0B5F-\u0B61\u0B71\u0B83\u0B85-\u0B8A\u0B8E-\u0B90\u0B92-\u0B95\u0B99\u0B9A\u0B9C\u0B9E\u0B9F\u0BA3\u0BA4\u0BA8-\u0BAA\u0BAE-\u0BB9\u0BD0\u0C05-\u0C0C\u0C0E-\u0C10\u0C12-\u0C28\u0C2A-\u0C39\u0C3D\u0C58-\u0C5A\u0C60\u0C61\u0C80\u0C85-\u0C8C\u0C8E-\u0C90\u0C92-\u0CA8\u0CAA-\u0CB3\u0CB5-\u0CB9\u0CBD\u0CDE\u0CE0\u0CE1\u0CF1\u0CF2\u0D05-\u0D0C\u0D0E-\u0D10\u0D12-\u0D3A\u0D3D\u0D4E\u0D54-\u0D56\u0D5F-\u0D61\u0D7A-\u0D7F\u0D85-\u0D96\u0D9A-\u0DB1\u0DB3-\u0DBB\u0DBD\u0DC0-\u0DC6\u0E01-\u0E30\u0E32\u0E33\u0E40-\u0E46\u0E81\u0E82\u0E84\u0E87\u0E88\u0E8A\u0E8D\u0E94-\u0E97\u0E99-\u0E9F\u0EA1-\u0EA3\u0EA5\u0EA7\u0EAA\u0EAB\u0EAD-\u0EB0\u0EB2\u0EB3\u0EBD\u0EC0-\u0EC4\u0EC6\u0EDC-\u0EDF\u0F00\u0F40-\u0F47\u0F49-\u0F6C\u0F88-\u0F8C\u1000-\u102A\u103F\u1050-\u1055\u105A-\u105D\u1061\u1065\u1066\u106E-\u1070\u1075-\u1081\u108E\u10A0-\u10C5\u10C7\u10CD\u10D0-\u10FA\u10FC-\u1248\u124A-\u124D\u1250-\u1256\u1258\u125A-\u125D\u1260-\u1288\u128A-\u128D\u1290-\u12B0\u12B2-\u12B5\u12B8-\u12BE\u12C0\u12C2-\u12C5\u12C8-\u12D6\u12D8-\u1310\u1312-\u1315\u1318-\u135A\u1380-\u138F\u13A0-\u13F5\u13F8-\u13FD\u1401-\u166C\u166F-\u167F\u1681-\u169A\u16A0-\u16EA\u16F1-\u16F8\u1700-\u170C\u170E-\u1711\u1720-\u1731\u1740-\u1751\u1760-\u176C\u176E-\u1770\u1780-\u17B3\u17D7\u17DC\u1820-\u1878\u1880-\u1884\u1887-\u18A8\u18AA\u18B0-\u18F5\u1900-\u191E\u1950-\u196D\u1970-\u1974\u1980-\u19AB\u19B0-\u19C9\u1A00-\u1A16\u1A20-\u1A54\u1AA7\u1B05-\u1B33\u1B45-\u1B4B\u1B83-\u1BA0\u1BAE\u1BAF\u1BBA-\u1BE5\u1C00-\u1C23\u1C4D-\u1C4F\u1C5A-\u1C7D\u1C80-\u1C88\u1C90-\u1CBA\u1CBD-\u1CBF\u1CE9-\u1CEC\u1CEE-\u1CF1\u1CF5\u1CF6\u1D00-\u1DBF\u1E00-\u1F15\u1F18-\u1F1D\u1F20-\u1F45\u1F48-\u1F4D\u1F50-\u1F57\u1F59\u1F5B\u1F5D\u1F5F-\u1F7D\u1F80-\u1FB4\u1FB6-\u1FBC\u1FBE\u1FC2-\u1FC4\u1FC6-\u1FCC\u1FD0-\u1FD3\u1FD6-\u1FDB\u1FE0-\u1FEC\u1FF2-\u1FF4\u1FF6-\u1FFC\u2071\u207F\u2090-\u209C\u2102\u2107\u210A-\u2113\u2115\u2119-\u211D\u2124\u2126\u2128\u212A-\u212D\u212F-\u2139\u213C-\u213F\u2145-\u2149\u214E\u2183\u2184\u2C00-\u2C2E\u2C30-\u2C5E\u2C60-\u2CE4\u2CEB-\u2CEE\u2CF2\u2CF3\u2D00-\u2D25\u2D27\u2D2D\u2D30-\u2D67\u2D6F\u2D80-\u2D96\u2DA0-\u2DA6\u2DA8-\u2DAE\u2DB0-\u2DB6\u2DB8-\u2DBE\u2DC0-\u2DC6\u2DC8-\u2DCE\u2DD0-\u2DD6\u2DD8-\u2DDE\u2E2F\u3005\u3006\u3031-\u3035\u303B\u303C\u3041-\u3096\u309D-\u309F\u30A1-\u30FA\u30FC-\u30FF\u3105-\u312F\u3131-\u318E\u31A0-\u31BA\u31F0-\u31FF\u3400-\u4DB5\u4E00-\u9FEF\uA000-\uA48C\uA4D0-\uA4FD\uA500-\uA60C\uA610-\uA61F\uA62A\uA62B\uA640-\uA66E\uA67F-\uA69D\uA6A0-\uA6E5\uA717-\uA71F\uA722-\uA788\uA78B-\uA7B9\uA7F7-\uA801\uA803-\uA805\uA807-\uA80A\uA80C-\uA822\uA840-\uA873\uA882-\uA8B3\uA8F2-\uA8F7\uA8FB\uA8FD\uA8FE\uA90A-\uA925\uA930-\uA946\uA960-\uA97C\uA984-\uA9B2\uA9CF\uA9E0-\uA9E4\uA9E6-\uA9EF\uA9FA-\uA9FE\uAA00-\uAA28\uAA40-\uAA42\uAA44-\uAA4B\uAA60-\uAA76\uAA7A\uAA7E-\uAAAF\uAAB1\uAAB5\uAAB6\uAAB9-\uAABD\uAAC0\uAAC2\uAADB-\uAADD\uAAE0-\uAAEA\uAAF2-\uAAF4\uAB01-\uAB06\uAB09-\uAB0E\uAB11-\uAB16\uAB20-\uAB26\uAB28-\uAB2E\uAB30-\uAB5A\uAB5C-\uAB65\uAB70-\uABE2\uAC00-\uD7A3\uD7B0-\uD7C6\uD7CB-\uD7FB\uF900-\uFA6D\uFA70-\uFAD9\uFB00-\uFB06\uFB13-\uFB17\uFB1D\uFB1F-\uFB28\uFB2A-\uFB36\uFB38-\uFB3C\uFB3E\uFB40\uFB41\uFB43\uFB44\uFB46-\uFBB1\uFBD3-\uFD3D\uFD50-\uFD8F\uFD92-\uFDC7\uFDF0-\uFDFB\uFE70-\uFE74\uFE76-\uFEFC\uFF21-\uFF3A\uFF41-\uFF5A\uFF66-\uFFBE\uFFC2-\uFFC7\uFFCA-\uFFCF\uFFD2-\uFFD7\uFFDA-\uFFDC', + 'astral': '\uD800[\uDC00-\uDC0B\uDC0D-\uDC26\uDC28-\uDC3A\uDC3C\uDC3D\uDC3F-\uDC4D\uDC50-\uDC5D\uDC80-\uDCFA\uDE80-\uDE9C\uDEA0-\uDED0\uDF00-\uDF1F\uDF2D-\uDF40\uDF42-\uDF49\uDF50-\uDF75\uDF80-\uDF9D\uDFA0-\uDFC3\uDFC8-\uDFCF]|\uD801[\uDC00-\uDC9D\uDCB0-\uDCD3\uDCD8-\uDCFB\uDD00-\uDD27\uDD30-\uDD63\uDE00-\uDF36\uDF40-\uDF55\uDF60-\uDF67]|\uD802[\uDC00-\uDC05\uDC08\uDC0A-\uDC35\uDC37\uDC38\uDC3C\uDC3F-\uDC55\uDC60-\uDC76\uDC80-\uDC9E\uDCE0-\uDCF2\uDCF4\uDCF5\uDD00-\uDD15\uDD20-\uDD39\uDD80-\uDDB7\uDDBE\uDDBF\uDE00\uDE10-\uDE13\uDE15-\uDE17\uDE19-\uDE35\uDE60-\uDE7C\uDE80-\uDE9C\uDEC0-\uDEC7\uDEC9-\uDEE4\uDF00-\uDF35\uDF40-\uDF55\uDF60-\uDF72\uDF80-\uDF91]|\uD803[\uDC00-\uDC48\uDC80-\uDCB2\uDCC0-\uDCF2\uDD00-\uDD23\uDF00-\uDF1C\uDF27\uDF30-\uDF45]|\uD804[\uDC03-\uDC37\uDC83-\uDCAF\uDCD0-\uDCE8\uDD03-\uDD26\uDD44\uDD50-\uDD72\uDD76\uDD83-\uDDB2\uDDC1-\uDDC4\uDDDA\uDDDC\uDE00-\uDE11\uDE13-\uDE2B\uDE80-\uDE86\uDE88\uDE8A-\uDE8D\uDE8F-\uDE9D\uDE9F-\uDEA8\uDEB0-\uDEDE\uDF05-\uDF0C\uDF0F\uDF10\uDF13-\uDF28\uDF2A-\uDF30\uDF32\uDF33\uDF35-\uDF39\uDF3D\uDF50\uDF5D-\uDF61]|\uD805[\uDC00-\uDC34\uDC47-\uDC4A\uDC80-\uDCAF\uDCC4\uDCC5\uDCC7\uDD80-\uDDAE\uDDD8-\uDDDB\uDE00-\uDE2F\uDE44\uDE80-\uDEAA\uDF00-\uDF1A]|\uD806[\uDC00-\uDC2B\uDCA0-\uDCDF\uDCFF\uDE00\uDE0B-\uDE32\uDE3A\uDE50\uDE5C-\uDE83\uDE86-\uDE89\uDE9D\uDEC0-\uDEF8]|\uD807[\uDC00-\uDC08\uDC0A-\uDC2E\uDC40\uDC72-\uDC8F\uDD00-\uDD06\uDD08\uDD09\uDD0B-\uDD30\uDD46\uDD60-\uDD65\uDD67\uDD68\uDD6A-\uDD89\uDD98\uDEE0-\uDEF2]|\uD808[\uDC00-\uDF99]|\uD809[\uDC80-\uDD43]|[\uD80C\uD81C-\uD820\uD840-\uD868\uD86A-\uD86C\uD86F-\uD872\uD874-\uD879][\uDC00-\uDFFF]|\uD80D[\uDC00-\uDC2E]|\uD811[\uDC00-\uDE46]|\uD81A[\uDC00-\uDE38\uDE40-\uDE5E\uDED0-\uDEED\uDF00-\uDF2F\uDF40-\uDF43\uDF63-\uDF77\uDF7D-\uDF8F]|\uD81B[\uDE40-\uDE7F\uDF00-\uDF44\uDF50\uDF93-\uDF9F\uDFE0\uDFE1]|\uD821[\uDC00-\uDFF1]|\uD822[\uDC00-\uDEF2]|\uD82C[\uDC00-\uDD1E\uDD70-\uDEFB]|\uD82F[\uDC00-\uDC6A\uDC70-\uDC7C\uDC80-\uDC88\uDC90-\uDC99]|\uD835[\uDC00-\uDC54\uDC56-\uDC9C\uDC9E\uDC9F\uDCA2\uDCA5\uDCA6\uDCA9-\uDCAC\uDCAE-\uDCB9\uDCBB\uDCBD-\uDCC3\uDCC5-\uDD05\uDD07-\uDD0A\uDD0D-\uDD14\uDD16-\uDD1C\uDD1E-\uDD39\uDD3B-\uDD3E\uDD40-\uDD44\uDD46\uDD4A-\uDD50\uDD52-\uDEA5\uDEA8-\uDEC0\uDEC2-\uDEDA\uDEDC-\uDEFA\uDEFC-\uDF14\uDF16-\uDF34\uDF36-\uDF4E\uDF50-\uDF6E\uDF70-\uDF88\uDF8A-\uDFA8\uDFAA-\uDFC2\uDFC4-\uDFCB]|\uD83A[\uDC00-\uDCC4\uDD00-\uDD43]|\uD83B[\uDE00-\uDE03\uDE05-\uDE1F\uDE21\uDE22\uDE24\uDE27\uDE29-\uDE32\uDE34-\uDE37\uDE39\uDE3B\uDE42\uDE47\uDE49\uDE4B\uDE4D-\uDE4F\uDE51\uDE52\uDE54\uDE57\uDE59\uDE5B\uDE5D\uDE5F\uDE61\uDE62\uDE64\uDE67-\uDE6A\uDE6C-\uDE72\uDE74-\uDE77\uDE79-\uDE7C\uDE7E\uDE80-\uDE89\uDE8B-\uDE9B\uDEA1-\uDEA3\uDEA5-\uDEA9\uDEAB-\uDEBB]|\uD869[\uDC00-\uDED6\uDF00-\uDFFF]|\uD86D[\uDC00-\uDF34\uDF40-\uDFFF]|\uD86E[\uDC00-\uDC1D\uDC20-\uDFFF]|\uD873[\uDC00-\uDEA1\uDEB0-\uDFFF]|\uD87A[\uDC00-\uDFE0]|\uD87E[\uDC00-\uDE1D]' + }, + { + 'name': 'LC', + 'alias': 'Cased_Letter', + 'bmp': 'A-Za-z\xB5\xC0-\xD6\xD8-\xF6\xF8-\u01BA\u01BC-\u01BF\u01C4-\u0293\u0295-\u02AF\u0370-\u0373\u0376\u0377\u037B-\u037D\u037F\u0386\u0388-\u038A\u038C\u038E-\u03A1\u03A3-\u03F5\u03F7-\u0481\u048A-\u052F\u0531-\u0556\u0560-\u0588\u10A0-\u10C5\u10C7\u10CD\u10D0-\u10FA\u10FD-\u10FF\u13A0-\u13F5\u13F8-\u13FD\u1C80-\u1C88\u1C90-\u1CBA\u1CBD-\u1CBF\u1D00-\u1D2B\u1D6B-\u1D77\u1D79-\u1D9A\u1E00-\u1F15\u1F18-\u1F1D\u1F20-\u1F45\u1F48-\u1F4D\u1F50-\u1F57\u1F59\u1F5B\u1F5D\u1F5F-\u1F7D\u1F80-\u1FB4\u1FB6-\u1FBC\u1FBE\u1FC2-\u1FC4\u1FC6-\u1FCC\u1FD0-\u1FD3\u1FD6-\u1FDB\u1FE0-\u1FEC\u1FF2-\u1FF4\u1FF6-\u1FFC\u2102\u2107\u210A-\u2113\u2115\u2119-\u211D\u2124\u2126\u2128\u212A-\u212D\u212F-\u2134\u2139\u213C-\u213F\u2145-\u2149\u214E\u2183\u2184\u2C00-\u2C2E\u2C30-\u2C5E\u2C60-\u2C7B\u2C7E-\u2CE4\u2CEB-\u2CEE\u2CF2\u2CF3\u2D00-\u2D25\u2D27\u2D2D\uA640-\uA66D\uA680-\uA69B\uA722-\uA76F\uA771-\uA787\uA78B-\uA78E\uA790-\uA7B9\uA7FA\uAB30-\uAB5A\uAB60-\uAB65\uAB70-\uABBF\uFB00-\uFB06\uFB13-\uFB17\uFF21-\uFF3A\uFF41-\uFF5A', + 'astral': '\uD801[\uDC00-\uDC4F\uDCB0-\uDCD3\uDCD8-\uDCFB]|\uD803[\uDC80-\uDCB2\uDCC0-\uDCF2]|\uD806[\uDCA0-\uDCDF]|\uD81B[\uDE40-\uDE7F]|\uD835[\uDC00-\uDC54\uDC56-\uDC9C\uDC9E\uDC9F\uDCA2\uDCA5\uDCA6\uDCA9-\uDCAC\uDCAE-\uDCB9\uDCBB\uDCBD-\uDCC3\uDCC5-\uDD05\uDD07-\uDD0A\uDD0D-\uDD14\uDD16-\uDD1C\uDD1E-\uDD39\uDD3B-\uDD3E\uDD40-\uDD44\uDD46\uDD4A-\uDD50\uDD52-\uDEA5\uDEA8-\uDEC0\uDEC2-\uDEDA\uDEDC-\uDEFA\uDEFC-\uDF14\uDF16-\uDF34\uDF36-\uDF4E\uDF50-\uDF6E\uDF70-\uDF88\uDF8A-\uDFA8\uDFAA-\uDFC2\uDFC4-\uDFCB]|\uD83A[\uDD00-\uDD43]' + }, + { + 'name': 'Ll', + 'alias': 'Lowercase_Letter', + 'bmp': 'a-z\xB5\xDF-\xF6\xF8-\xFF\u0101\u0103\u0105\u0107\u0109\u010B\u010D\u010F\u0111\u0113\u0115\u0117\u0119\u011B\u011D\u011F\u0121\u0123\u0125\u0127\u0129\u012B\u012D\u012F\u0131\u0133\u0135\u0137\u0138\u013A\u013C\u013E\u0140\u0142\u0144\u0146\u0148\u0149\u014B\u014D\u014F\u0151\u0153\u0155\u0157\u0159\u015B\u015D\u015F\u0161\u0163\u0165\u0167\u0169\u016B\u016D\u016F\u0171\u0173\u0175\u0177\u017A\u017C\u017E-\u0180\u0183\u0185\u0188\u018C\u018D\u0192\u0195\u0199-\u019B\u019E\u01A1\u01A3\u01A5\u01A8\u01AA\u01AB\u01AD\u01B0\u01B4\u01B6\u01B9\u01BA\u01BD-\u01BF\u01C6\u01C9\u01CC\u01CE\u01D0\u01D2\u01D4\u01D6\u01D8\u01DA\u01DC\u01DD\u01DF\u01E1\u01E3\u01E5\u01E7\u01E9\u01EB\u01ED\u01EF\u01F0\u01F3\u01F5\u01F9\u01FB\u01FD\u01FF\u0201\u0203\u0205\u0207\u0209\u020B\u020D\u020F\u0211\u0213\u0215\u0217\u0219\u021B\u021D\u021F\u0221\u0223\u0225\u0227\u0229\u022B\u022D\u022F\u0231\u0233-\u0239\u023C\u023F\u0240\u0242\u0247\u0249\u024B\u024D\u024F-\u0293\u0295-\u02AF\u0371\u0373\u0377\u037B-\u037D\u0390\u03AC-\u03CE\u03D0\u03D1\u03D5-\u03D7\u03D9\u03DB\u03DD\u03DF\u03E1\u03E3\u03E5\u03E7\u03E9\u03EB\u03ED\u03EF-\u03F3\u03F5\u03F8\u03FB\u03FC\u0430-\u045F\u0461\u0463\u0465\u0467\u0469\u046B\u046D\u046F\u0471\u0473\u0475\u0477\u0479\u047B\u047D\u047F\u0481\u048B\u048D\u048F\u0491\u0493\u0495\u0497\u0499\u049B\u049D\u049F\u04A1\u04A3\u04A5\u04A7\u04A9\u04AB\u04AD\u04AF\u04B1\u04B3\u04B5\u04B7\u04B9\u04BB\u04BD\u04BF\u04C2\u04C4\u04C6\u04C8\u04CA\u04CC\u04CE\u04CF\u04D1\u04D3\u04D5\u04D7\u04D9\u04DB\u04DD\u04DF\u04E1\u04E3\u04E5\u04E7\u04E9\u04EB\u04ED\u04EF\u04F1\u04F3\u04F5\u04F7\u04F9\u04FB\u04FD\u04FF\u0501\u0503\u0505\u0507\u0509\u050B\u050D\u050F\u0511\u0513\u0515\u0517\u0519\u051B\u051D\u051F\u0521\u0523\u0525\u0527\u0529\u052B\u052D\u052F\u0560-\u0588\u10D0-\u10FA\u10FD-\u10FF\u13F8-\u13FD\u1C80-\u1C88\u1D00-\u1D2B\u1D6B-\u1D77\u1D79-\u1D9A\u1E01\u1E03\u1E05\u1E07\u1E09\u1E0B\u1E0D\u1E0F\u1E11\u1E13\u1E15\u1E17\u1E19\u1E1B\u1E1D\u1E1F\u1E21\u1E23\u1E25\u1E27\u1E29\u1E2B\u1E2D\u1E2F\u1E31\u1E33\u1E35\u1E37\u1E39\u1E3B\u1E3D\u1E3F\u1E41\u1E43\u1E45\u1E47\u1E49\u1E4B\u1E4D\u1E4F\u1E51\u1E53\u1E55\u1E57\u1E59\u1E5B\u1E5D\u1E5F\u1E61\u1E63\u1E65\u1E67\u1E69\u1E6B\u1E6D\u1E6F\u1E71\u1E73\u1E75\u1E77\u1E79\u1E7B\u1E7D\u1E7F\u1E81\u1E83\u1E85\u1E87\u1E89\u1E8B\u1E8D\u1E8F\u1E91\u1E93\u1E95-\u1E9D\u1E9F\u1EA1\u1EA3\u1EA5\u1EA7\u1EA9\u1EAB\u1EAD\u1EAF\u1EB1\u1EB3\u1EB5\u1EB7\u1EB9\u1EBB\u1EBD\u1EBF\u1EC1\u1EC3\u1EC5\u1EC7\u1EC9\u1ECB\u1ECD\u1ECF\u1ED1\u1ED3\u1ED5\u1ED7\u1ED9\u1EDB\u1EDD\u1EDF\u1EE1\u1EE3\u1EE5\u1EE7\u1EE9\u1EEB\u1EED\u1EEF\u1EF1\u1EF3\u1EF5\u1EF7\u1EF9\u1EFB\u1EFD\u1EFF-\u1F07\u1F10-\u1F15\u1F20-\u1F27\u1F30-\u1F37\u1F40-\u1F45\u1F50-\u1F57\u1F60-\u1F67\u1F70-\u1F7D\u1F80-\u1F87\u1F90-\u1F97\u1FA0-\u1FA7\u1FB0-\u1FB4\u1FB6\u1FB7\u1FBE\u1FC2-\u1FC4\u1FC6\u1FC7\u1FD0-\u1FD3\u1FD6\u1FD7\u1FE0-\u1FE7\u1FF2-\u1FF4\u1FF6\u1FF7\u210A\u210E\u210F\u2113\u212F\u2134\u2139\u213C\u213D\u2146-\u2149\u214E\u2184\u2C30-\u2C5E\u2C61\u2C65\u2C66\u2C68\u2C6A\u2C6C\u2C71\u2C73\u2C74\u2C76-\u2C7B\u2C81\u2C83\u2C85\u2C87\u2C89\u2C8B\u2C8D\u2C8F\u2C91\u2C93\u2C95\u2C97\u2C99\u2C9B\u2C9D\u2C9F\u2CA1\u2CA3\u2CA5\u2CA7\u2CA9\u2CAB\u2CAD\u2CAF\u2CB1\u2CB3\u2CB5\u2CB7\u2CB9\u2CBB\u2CBD\u2CBF\u2CC1\u2CC3\u2CC5\u2CC7\u2CC9\u2CCB\u2CCD\u2CCF\u2CD1\u2CD3\u2CD5\u2CD7\u2CD9\u2CDB\u2CDD\u2CDF\u2CE1\u2CE3\u2CE4\u2CEC\u2CEE\u2CF3\u2D00-\u2D25\u2D27\u2D2D\uA641\uA643\uA645\uA647\uA649\uA64B\uA64D\uA64F\uA651\uA653\uA655\uA657\uA659\uA65B\uA65D\uA65F\uA661\uA663\uA665\uA667\uA669\uA66B\uA66D\uA681\uA683\uA685\uA687\uA689\uA68B\uA68D\uA68F\uA691\uA693\uA695\uA697\uA699\uA69B\uA723\uA725\uA727\uA729\uA72B\uA72D\uA72F-\uA731\uA733\uA735\uA737\uA739\uA73B\uA73D\uA73F\uA741\uA743\uA745\uA747\uA749\uA74B\uA74D\uA74F\uA751\uA753\uA755\uA757\uA759\uA75B\uA75D\uA75F\uA761\uA763\uA765\uA767\uA769\uA76B\uA76D\uA76F\uA771-\uA778\uA77A\uA77C\uA77F\uA781\uA783\uA785\uA787\uA78C\uA78E\uA791\uA793-\uA795\uA797\uA799\uA79B\uA79D\uA79F\uA7A1\uA7A3\uA7A5\uA7A7\uA7A9\uA7AF\uA7B5\uA7B7\uA7B9\uA7FA\uAB30-\uAB5A\uAB60-\uAB65\uAB70-\uABBF\uFB00-\uFB06\uFB13-\uFB17\uFF41-\uFF5A', + 'astral': '\uD801[\uDC28-\uDC4F\uDCD8-\uDCFB]|\uD803[\uDCC0-\uDCF2]|\uD806[\uDCC0-\uDCDF]|\uD81B[\uDE60-\uDE7F]|\uD835[\uDC1A-\uDC33\uDC4E-\uDC54\uDC56-\uDC67\uDC82-\uDC9B\uDCB6-\uDCB9\uDCBB\uDCBD-\uDCC3\uDCC5-\uDCCF\uDCEA-\uDD03\uDD1E-\uDD37\uDD52-\uDD6B\uDD86-\uDD9F\uDDBA-\uDDD3\uDDEE-\uDE07\uDE22-\uDE3B\uDE56-\uDE6F\uDE8A-\uDEA5\uDEC2-\uDEDA\uDEDC-\uDEE1\uDEFC-\uDF14\uDF16-\uDF1B\uDF36-\uDF4E\uDF50-\uDF55\uDF70-\uDF88\uDF8A-\uDF8F\uDFAA-\uDFC2\uDFC4-\uDFC9\uDFCB]|\uD83A[\uDD22-\uDD43]' + }, + { + 'name': 'Lm', + 'alias': 'Modifier_Letter', + 'bmp': '\u02B0-\u02C1\u02C6-\u02D1\u02E0-\u02E4\u02EC\u02EE\u0374\u037A\u0559\u0640\u06E5\u06E6\u07F4\u07F5\u07FA\u081A\u0824\u0828\u0971\u0E46\u0EC6\u10FC\u17D7\u1843\u1AA7\u1C78-\u1C7D\u1D2C-\u1D6A\u1D78\u1D9B-\u1DBF\u2071\u207F\u2090-\u209C\u2C7C\u2C7D\u2D6F\u2E2F\u3005\u3031-\u3035\u303B\u309D\u309E\u30FC-\u30FE\uA015\uA4F8-\uA4FD\uA60C\uA67F\uA69C\uA69D\uA717-\uA71F\uA770\uA788\uA7F8\uA7F9\uA9CF\uA9E6\uAA70\uAADD\uAAF3\uAAF4\uAB5C-\uAB5F\uFF70\uFF9E\uFF9F', + 'astral': '\uD81A[\uDF40-\uDF43]|\uD81B[\uDF93-\uDF9F\uDFE0\uDFE1]' + }, + { + 'name': 'Lo', + 'alias': 'Other_Letter', + 'bmp': '\xAA\xBA\u01BB\u01C0-\u01C3\u0294\u05D0-\u05EA\u05EF-\u05F2\u0620-\u063F\u0641-\u064A\u066E\u066F\u0671-\u06D3\u06D5\u06EE\u06EF\u06FA-\u06FC\u06FF\u0710\u0712-\u072F\u074D-\u07A5\u07B1\u07CA-\u07EA\u0800-\u0815\u0840-\u0858\u0860-\u086A\u08A0-\u08B4\u08B6-\u08BD\u0904-\u0939\u093D\u0950\u0958-\u0961\u0972-\u0980\u0985-\u098C\u098F\u0990\u0993-\u09A8\u09AA-\u09B0\u09B2\u09B6-\u09B9\u09BD\u09CE\u09DC\u09DD\u09DF-\u09E1\u09F0\u09F1\u09FC\u0A05-\u0A0A\u0A0F\u0A10\u0A13-\u0A28\u0A2A-\u0A30\u0A32\u0A33\u0A35\u0A36\u0A38\u0A39\u0A59-\u0A5C\u0A5E\u0A72-\u0A74\u0A85-\u0A8D\u0A8F-\u0A91\u0A93-\u0AA8\u0AAA-\u0AB0\u0AB2\u0AB3\u0AB5-\u0AB9\u0ABD\u0AD0\u0AE0\u0AE1\u0AF9\u0B05-\u0B0C\u0B0F\u0B10\u0B13-\u0B28\u0B2A-\u0B30\u0B32\u0B33\u0B35-\u0B39\u0B3D\u0B5C\u0B5D\u0B5F-\u0B61\u0B71\u0B83\u0B85-\u0B8A\u0B8E-\u0B90\u0B92-\u0B95\u0B99\u0B9A\u0B9C\u0B9E\u0B9F\u0BA3\u0BA4\u0BA8-\u0BAA\u0BAE-\u0BB9\u0BD0\u0C05-\u0C0C\u0C0E-\u0C10\u0C12-\u0C28\u0C2A-\u0C39\u0C3D\u0C58-\u0C5A\u0C60\u0C61\u0C80\u0C85-\u0C8C\u0C8E-\u0C90\u0C92-\u0CA8\u0CAA-\u0CB3\u0CB5-\u0CB9\u0CBD\u0CDE\u0CE0\u0CE1\u0CF1\u0CF2\u0D05-\u0D0C\u0D0E-\u0D10\u0D12-\u0D3A\u0D3D\u0D4E\u0D54-\u0D56\u0D5F-\u0D61\u0D7A-\u0D7F\u0D85-\u0D96\u0D9A-\u0DB1\u0DB3-\u0DBB\u0DBD\u0DC0-\u0DC6\u0E01-\u0E30\u0E32\u0E33\u0E40-\u0E45\u0E81\u0E82\u0E84\u0E87\u0E88\u0E8A\u0E8D\u0E94-\u0E97\u0E99-\u0E9F\u0EA1-\u0EA3\u0EA5\u0EA7\u0EAA\u0EAB\u0EAD-\u0EB0\u0EB2\u0EB3\u0EBD\u0EC0-\u0EC4\u0EDC-\u0EDF\u0F00\u0F40-\u0F47\u0F49-\u0F6C\u0F88-\u0F8C\u1000-\u102A\u103F\u1050-\u1055\u105A-\u105D\u1061\u1065\u1066\u106E-\u1070\u1075-\u1081\u108E\u1100-\u1248\u124A-\u124D\u1250-\u1256\u1258\u125A-\u125D\u1260-\u1288\u128A-\u128D\u1290-\u12B0\u12B2-\u12B5\u12B8-\u12BE\u12C0\u12C2-\u12C5\u12C8-\u12D6\u12D8-\u1310\u1312-\u1315\u1318-\u135A\u1380-\u138F\u1401-\u166C\u166F-\u167F\u1681-\u169A\u16A0-\u16EA\u16F1-\u16F8\u1700-\u170C\u170E-\u1711\u1720-\u1731\u1740-\u1751\u1760-\u176C\u176E-\u1770\u1780-\u17B3\u17DC\u1820-\u1842\u1844-\u1878\u1880-\u1884\u1887-\u18A8\u18AA\u18B0-\u18F5\u1900-\u191E\u1950-\u196D\u1970-\u1974\u1980-\u19AB\u19B0-\u19C9\u1A00-\u1A16\u1A20-\u1A54\u1B05-\u1B33\u1B45-\u1B4B\u1B83-\u1BA0\u1BAE\u1BAF\u1BBA-\u1BE5\u1C00-\u1C23\u1C4D-\u1C4F\u1C5A-\u1C77\u1CE9-\u1CEC\u1CEE-\u1CF1\u1CF5\u1CF6\u2135-\u2138\u2D30-\u2D67\u2D80-\u2D96\u2DA0-\u2DA6\u2DA8-\u2DAE\u2DB0-\u2DB6\u2DB8-\u2DBE\u2DC0-\u2DC6\u2DC8-\u2DCE\u2DD0-\u2DD6\u2DD8-\u2DDE\u3006\u303C\u3041-\u3096\u309F\u30A1-\u30FA\u30FF\u3105-\u312F\u3131-\u318E\u31A0-\u31BA\u31F0-\u31FF\u3400-\u4DB5\u4E00-\u9FEF\uA000-\uA014\uA016-\uA48C\uA4D0-\uA4F7\uA500-\uA60B\uA610-\uA61F\uA62A\uA62B\uA66E\uA6A0-\uA6E5\uA78F\uA7F7\uA7FB-\uA801\uA803-\uA805\uA807-\uA80A\uA80C-\uA822\uA840-\uA873\uA882-\uA8B3\uA8F2-\uA8F7\uA8FB\uA8FD\uA8FE\uA90A-\uA925\uA930-\uA946\uA960-\uA97C\uA984-\uA9B2\uA9E0-\uA9E4\uA9E7-\uA9EF\uA9FA-\uA9FE\uAA00-\uAA28\uAA40-\uAA42\uAA44-\uAA4B\uAA60-\uAA6F\uAA71-\uAA76\uAA7A\uAA7E-\uAAAF\uAAB1\uAAB5\uAAB6\uAAB9-\uAABD\uAAC0\uAAC2\uAADB\uAADC\uAAE0-\uAAEA\uAAF2\uAB01-\uAB06\uAB09-\uAB0E\uAB11-\uAB16\uAB20-\uAB26\uAB28-\uAB2E\uABC0-\uABE2\uAC00-\uD7A3\uD7B0-\uD7C6\uD7CB-\uD7FB\uF900-\uFA6D\uFA70-\uFAD9\uFB1D\uFB1F-\uFB28\uFB2A-\uFB36\uFB38-\uFB3C\uFB3E\uFB40\uFB41\uFB43\uFB44\uFB46-\uFBB1\uFBD3-\uFD3D\uFD50-\uFD8F\uFD92-\uFDC7\uFDF0-\uFDFB\uFE70-\uFE74\uFE76-\uFEFC\uFF66-\uFF6F\uFF71-\uFF9D\uFFA0-\uFFBE\uFFC2-\uFFC7\uFFCA-\uFFCF\uFFD2-\uFFD7\uFFDA-\uFFDC', + 'astral': '\uD800[\uDC00-\uDC0B\uDC0D-\uDC26\uDC28-\uDC3A\uDC3C\uDC3D\uDC3F-\uDC4D\uDC50-\uDC5D\uDC80-\uDCFA\uDE80-\uDE9C\uDEA0-\uDED0\uDF00-\uDF1F\uDF2D-\uDF40\uDF42-\uDF49\uDF50-\uDF75\uDF80-\uDF9D\uDFA0-\uDFC3\uDFC8-\uDFCF]|\uD801[\uDC50-\uDC9D\uDD00-\uDD27\uDD30-\uDD63\uDE00-\uDF36\uDF40-\uDF55\uDF60-\uDF67]|\uD802[\uDC00-\uDC05\uDC08\uDC0A-\uDC35\uDC37\uDC38\uDC3C\uDC3F-\uDC55\uDC60-\uDC76\uDC80-\uDC9E\uDCE0-\uDCF2\uDCF4\uDCF5\uDD00-\uDD15\uDD20-\uDD39\uDD80-\uDDB7\uDDBE\uDDBF\uDE00\uDE10-\uDE13\uDE15-\uDE17\uDE19-\uDE35\uDE60-\uDE7C\uDE80-\uDE9C\uDEC0-\uDEC7\uDEC9-\uDEE4\uDF00-\uDF35\uDF40-\uDF55\uDF60-\uDF72\uDF80-\uDF91]|\uD803[\uDC00-\uDC48\uDD00-\uDD23\uDF00-\uDF1C\uDF27\uDF30-\uDF45]|\uD804[\uDC03-\uDC37\uDC83-\uDCAF\uDCD0-\uDCE8\uDD03-\uDD26\uDD44\uDD50-\uDD72\uDD76\uDD83-\uDDB2\uDDC1-\uDDC4\uDDDA\uDDDC\uDE00-\uDE11\uDE13-\uDE2B\uDE80-\uDE86\uDE88\uDE8A-\uDE8D\uDE8F-\uDE9D\uDE9F-\uDEA8\uDEB0-\uDEDE\uDF05-\uDF0C\uDF0F\uDF10\uDF13-\uDF28\uDF2A-\uDF30\uDF32\uDF33\uDF35-\uDF39\uDF3D\uDF50\uDF5D-\uDF61]|\uD805[\uDC00-\uDC34\uDC47-\uDC4A\uDC80-\uDCAF\uDCC4\uDCC5\uDCC7\uDD80-\uDDAE\uDDD8-\uDDDB\uDE00-\uDE2F\uDE44\uDE80-\uDEAA\uDF00-\uDF1A]|\uD806[\uDC00-\uDC2B\uDCFF\uDE00\uDE0B-\uDE32\uDE3A\uDE50\uDE5C-\uDE83\uDE86-\uDE89\uDE9D\uDEC0-\uDEF8]|\uD807[\uDC00-\uDC08\uDC0A-\uDC2E\uDC40\uDC72-\uDC8F\uDD00-\uDD06\uDD08\uDD09\uDD0B-\uDD30\uDD46\uDD60-\uDD65\uDD67\uDD68\uDD6A-\uDD89\uDD98\uDEE0-\uDEF2]|\uD808[\uDC00-\uDF99]|\uD809[\uDC80-\uDD43]|[\uD80C\uD81C-\uD820\uD840-\uD868\uD86A-\uD86C\uD86F-\uD872\uD874-\uD879][\uDC00-\uDFFF]|\uD80D[\uDC00-\uDC2E]|\uD811[\uDC00-\uDE46]|\uD81A[\uDC00-\uDE38\uDE40-\uDE5E\uDED0-\uDEED\uDF00-\uDF2F\uDF63-\uDF77\uDF7D-\uDF8F]|\uD81B[\uDF00-\uDF44\uDF50]|\uD821[\uDC00-\uDFF1]|\uD822[\uDC00-\uDEF2]|\uD82C[\uDC00-\uDD1E\uDD70-\uDEFB]|\uD82F[\uDC00-\uDC6A\uDC70-\uDC7C\uDC80-\uDC88\uDC90-\uDC99]|\uD83A[\uDC00-\uDCC4]|\uD83B[\uDE00-\uDE03\uDE05-\uDE1F\uDE21\uDE22\uDE24\uDE27\uDE29-\uDE32\uDE34-\uDE37\uDE39\uDE3B\uDE42\uDE47\uDE49\uDE4B\uDE4D-\uDE4F\uDE51\uDE52\uDE54\uDE57\uDE59\uDE5B\uDE5D\uDE5F\uDE61\uDE62\uDE64\uDE67-\uDE6A\uDE6C-\uDE72\uDE74-\uDE77\uDE79-\uDE7C\uDE7E\uDE80-\uDE89\uDE8B-\uDE9B\uDEA1-\uDEA3\uDEA5-\uDEA9\uDEAB-\uDEBB]|\uD869[\uDC00-\uDED6\uDF00-\uDFFF]|\uD86D[\uDC00-\uDF34\uDF40-\uDFFF]|\uD86E[\uDC00-\uDC1D\uDC20-\uDFFF]|\uD873[\uDC00-\uDEA1\uDEB0-\uDFFF]|\uD87A[\uDC00-\uDFE0]|\uD87E[\uDC00-\uDE1D]' + }, + { + 'name': 'Lt', + 'alias': 'Titlecase_Letter', + 'bmp': '\u01C5\u01C8\u01CB\u01F2\u1F88-\u1F8F\u1F98-\u1F9F\u1FA8-\u1FAF\u1FBC\u1FCC\u1FFC' + }, + { + 'name': 'Lu', + 'alias': 'Uppercase_Letter', + 'bmp': 'A-Z\xC0-\xD6\xD8-\xDE\u0100\u0102\u0104\u0106\u0108\u010A\u010C\u010E\u0110\u0112\u0114\u0116\u0118\u011A\u011C\u011E\u0120\u0122\u0124\u0126\u0128\u012A\u012C\u012E\u0130\u0132\u0134\u0136\u0139\u013B\u013D\u013F\u0141\u0143\u0145\u0147\u014A\u014C\u014E\u0150\u0152\u0154\u0156\u0158\u015A\u015C\u015E\u0160\u0162\u0164\u0166\u0168\u016A\u016C\u016E\u0170\u0172\u0174\u0176\u0178\u0179\u017B\u017D\u0181\u0182\u0184\u0186\u0187\u0189-\u018B\u018E-\u0191\u0193\u0194\u0196-\u0198\u019C\u019D\u019F\u01A0\u01A2\u01A4\u01A6\u01A7\u01A9\u01AC\u01AE\u01AF\u01B1-\u01B3\u01B5\u01B7\u01B8\u01BC\u01C4\u01C7\u01CA\u01CD\u01CF\u01D1\u01D3\u01D5\u01D7\u01D9\u01DB\u01DE\u01E0\u01E2\u01E4\u01E6\u01E8\u01EA\u01EC\u01EE\u01F1\u01F4\u01F6-\u01F8\u01FA\u01FC\u01FE\u0200\u0202\u0204\u0206\u0208\u020A\u020C\u020E\u0210\u0212\u0214\u0216\u0218\u021A\u021C\u021E\u0220\u0222\u0224\u0226\u0228\u022A\u022C\u022E\u0230\u0232\u023A\u023B\u023D\u023E\u0241\u0243-\u0246\u0248\u024A\u024C\u024E\u0370\u0372\u0376\u037F\u0386\u0388-\u038A\u038C\u038E\u038F\u0391-\u03A1\u03A3-\u03AB\u03CF\u03D2-\u03D4\u03D8\u03DA\u03DC\u03DE\u03E0\u03E2\u03E4\u03E6\u03E8\u03EA\u03EC\u03EE\u03F4\u03F7\u03F9\u03FA\u03FD-\u042F\u0460\u0462\u0464\u0466\u0468\u046A\u046C\u046E\u0470\u0472\u0474\u0476\u0478\u047A\u047C\u047E\u0480\u048A\u048C\u048E\u0490\u0492\u0494\u0496\u0498\u049A\u049C\u049E\u04A0\u04A2\u04A4\u04A6\u04A8\u04AA\u04AC\u04AE\u04B0\u04B2\u04B4\u04B6\u04B8\u04BA\u04BC\u04BE\u04C0\u04C1\u04C3\u04C5\u04C7\u04C9\u04CB\u04CD\u04D0\u04D2\u04D4\u04D6\u04D8\u04DA\u04DC\u04DE\u04E0\u04E2\u04E4\u04E6\u04E8\u04EA\u04EC\u04EE\u04F0\u04F2\u04F4\u04F6\u04F8\u04FA\u04FC\u04FE\u0500\u0502\u0504\u0506\u0508\u050A\u050C\u050E\u0510\u0512\u0514\u0516\u0518\u051A\u051C\u051E\u0520\u0522\u0524\u0526\u0528\u052A\u052C\u052E\u0531-\u0556\u10A0-\u10C5\u10C7\u10CD\u13A0-\u13F5\u1C90-\u1CBA\u1CBD-\u1CBF\u1E00\u1E02\u1E04\u1E06\u1E08\u1E0A\u1E0C\u1E0E\u1E10\u1E12\u1E14\u1E16\u1E18\u1E1A\u1E1C\u1E1E\u1E20\u1E22\u1E24\u1E26\u1E28\u1E2A\u1E2C\u1E2E\u1E30\u1E32\u1E34\u1E36\u1E38\u1E3A\u1E3C\u1E3E\u1E40\u1E42\u1E44\u1E46\u1E48\u1E4A\u1E4C\u1E4E\u1E50\u1E52\u1E54\u1E56\u1E58\u1E5A\u1E5C\u1E5E\u1E60\u1E62\u1E64\u1E66\u1E68\u1E6A\u1E6C\u1E6E\u1E70\u1E72\u1E74\u1E76\u1E78\u1E7A\u1E7C\u1E7E\u1E80\u1E82\u1E84\u1E86\u1E88\u1E8A\u1E8C\u1E8E\u1E90\u1E92\u1E94\u1E9E\u1EA0\u1EA2\u1EA4\u1EA6\u1EA8\u1EAA\u1EAC\u1EAE\u1EB0\u1EB2\u1EB4\u1EB6\u1EB8\u1EBA\u1EBC\u1EBE\u1EC0\u1EC2\u1EC4\u1EC6\u1EC8\u1ECA\u1ECC\u1ECE\u1ED0\u1ED2\u1ED4\u1ED6\u1ED8\u1EDA\u1EDC\u1EDE\u1EE0\u1EE2\u1EE4\u1EE6\u1EE8\u1EEA\u1EEC\u1EEE\u1EF0\u1EF2\u1EF4\u1EF6\u1EF8\u1EFA\u1EFC\u1EFE\u1F08-\u1F0F\u1F18-\u1F1D\u1F28-\u1F2F\u1F38-\u1F3F\u1F48-\u1F4D\u1F59\u1F5B\u1F5D\u1F5F\u1F68-\u1F6F\u1FB8-\u1FBB\u1FC8-\u1FCB\u1FD8-\u1FDB\u1FE8-\u1FEC\u1FF8-\u1FFB\u2102\u2107\u210B-\u210D\u2110-\u2112\u2115\u2119-\u211D\u2124\u2126\u2128\u212A-\u212D\u2130-\u2133\u213E\u213F\u2145\u2183\u2C00-\u2C2E\u2C60\u2C62-\u2C64\u2C67\u2C69\u2C6B\u2C6D-\u2C70\u2C72\u2C75\u2C7E-\u2C80\u2C82\u2C84\u2C86\u2C88\u2C8A\u2C8C\u2C8E\u2C90\u2C92\u2C94\u2C96\u2C98\u2C9A\u2C9C\u2C9E\u2CA0\u2CA2\u2CA4\u2CA6\u2CA8\u2CAA\u2CAC\u2CAE\u2CB0\u2CB2\u2CB4\u2CB6\u2CB8\u2CBA\u2CBC\u2CBE\u2CC0\u2CC2\u2CC4\u2CC6\u2CC8\u2CCA\u2CCC\u2CCE\u2CD0\u2CD2\u2CD4\u2CD6\u2CD8\u2CDA\u2CDC\u2CDE\u2CE0\u2CE2\u2CEB\u2CED\u2CF2\uA640\uA642\uA644\uA646\uA648\uA64A\uA64C\uA64E\uA650\uA652\uA654\uA656\uA658\uA65A\uA65C\uA65E\uA660\uA662\uA664\uA666\uA668\uA66A\uA66C\uA680\uA682\uA684\uA686\uA688\uA68A\uA68C\uA68E\uA690\uA692\uA694\uA696\uA698\uA69A\uA722\uA724\uA726\uA728\uA72A\uA72C\uA72E\uA732\uA734\uA736\uA738\uA73A\uA73C\uA73E\uA740\uA742\uA744\uA746\uA748\uA74A\uA74C\uA74E\uA750\uA752\uA754\uA756\uA758\uA75A\uA75C\uA75E\uA760\uA762\uA764\uA766\uA768\uA76A\uA76C\uA76E\uA779\uA77B\uA77D\uA77E\uA780\uA782\uA784\uA786\uA78B\uA78D\uA790\uA792\uA796\uA798\uA79A\uA79C\uA79E\uA7A0\uA7A2\uA7A4\uA7A6\uA7A8\uA7AA-\uA7AE\uA7B0-\uA7B4\uA7B6\uA7B8\uFF21-\uFF3A', + 'astral': '\uD801[\uDC00-\uDC27\uDCB0-\uDCD3]|\uD803[\uDC80-\uDCB2]|\uD806[\uDCA0-\uDCBF]|\uD81B[\uDE40-\uDE5F]|\uD835[\uDC00-\uDC19\uDC34-\uDC4D\uDC68-\uDC81\uDC9C\uDC9E\uDC9F\uDCA2\uDCA5\uDCA6\uDCA9-\uDCAC\uDCAE-\uDCB5\uDCD0-\uDCE9\uDD04\uDD05\uDD07-\uDD0A\uDD0D-\uDD14\uDD16-\uDD1C\uDD38\uDD39\uDD3B-\uDD3E\uDD40-\uDD44\uDD46\uDD4A-\uDD50\uDD6C-\uDD85\uDDA0-\uDDB9\uDDD4-\uDDED\uDE08-\uDE21\uDE3C-\uDE55\uDE70-\uDE89\uDEA8-\uDEC0\uDEE2-\uDEFA\uDF1C-\uDF34\uDF56-\uDF6E\uDF90-\uDFA8\uDFCA]|\uD83A[\uDD00-\uDD21]' + }, + { + 'name': 'M', + 'alias': 'Mark', + 'bmp': '\u0300-\u036F\u0483-\u0489\u0591-\u05BD\u05BF\u05C1\u05C2\u05C4\u05C5\u05C7\u0610-\u061A\u064B-\u065F\u0670\u06D6-\u06DC\u06DF-\u06E4\u06E7\u06E8\u06EA-\u06ED\u0711\u0730-\u074A\u07A6-\u07B0\u07EB-\u07F3\u07FD\u0816-\u0819\u081B-\u0823\u0825-\u0827\u0829-\u082D\u0859-\u085B\u08D3-\u08E1\u08E3-\u0903\u093A-\u093C\u093E-\u094F\u0951-\u0957\u0962\u0963\u0981-\u0983\u09BC\u09BE-\u09C4\u09C7\u09C8\u09CB-\u09CD\u09D7\u09E2\u09E3\u09FE\u0A01-\u0A03\u0A3C\u0A3E-\u0A42\u0A47\u0A48\u0A4B-\u0A4D\u0A51\u0A70\u0A71\u0A75\u0A81-\u0A83\u0ABC\u0ABE-\u0AC5\u0AC7-\u0AC9\u0ACB-\u0ACD\u0AE2\u0AE3\u0AFA-\u0AFF\u0B01-\u0B03\u0B3C\u0B3E-\u0B44\u0B47\u0B48\u0B4B-\u0B4D\u0B56\u0B57\u0B62\u0B63\u0B82\u0BBE-\u0BC2\u0BC6-\u0BC8\u0BCA-\u0BCD\u0BD7\u0C00-\u0C04\u0C3E-\u0C44\u0C46-\u0C48\u0C4A-\u0C4D\u0C55\u0C56\u0C62\u0C63\u0C81-\u0C83\u0CBC\u0CBE-\u0CC4\u0CC6-\u0CC8\u0CCA-\u0CCD\u0CD5\u0CD6\u0CE2\u0CE3\u0D00-\u0D03\u0D3B\u0D3C\u0D3E-\u0D44\u0D46-\u0D48\u0D4A-\u0D4D\u0D57\u0D62\u0D63\u0D82\u0D83\u0DCA\u0DCF-\u0DD4\u0DD6\u0DD8-\u0DDF\u0DF2\u0DF3\u0E31\u0E34-\u0E3A\u0E47-\u0E4E\u0EB1\u0EB4-\u0EB9\u0EBB\u0EBC\u0EC8-\u0ECD\u0F18\u0F19\u0F35\u0F37\u0F39\u0F3E\u0F3F\u0F71-\u0F84\u0F86\u0F87\u0F8D-\u0F97\u0F99-\u0FBC\u0FC6\u102B-\u103E\u1056-\u1059\u105E-\u1060\u1062-\u1064\u1067-\u106D\u1071-\u1074\u1082-\u108D\u108F\u109A-\u109D\u135D-\u135F\u1712-\u1714\u1732-\u1734\u1752\u1753\u1772\u1773\u17B4-\u17D3\u17DD\u180B-\u180D\u1885\u1886\u18A9\u1920-\u192B\u1930-\u193B\u1A17-\u1A1B\u1A55-\u1A5E\u1A60-\u1A7C\u1A7F\u1AB0-\u1ABE\u1B00-\u1B04\u1B34-\u1B44\u1B6B-\u1B73\u1B80-\u1B82\u1BA1-\u1BAD\u1BE6-\u1BF3\u1C24-\u1C37\u1CD0-\u1CD2\u1CD4-\u1CE8\u1CED\u1CF2-\u1CF4\u1CF7-\u1CF9\u1DC0-\u1DF9\u1DFB-\u1DFF\u20D0-\u20F0\u2CEF-\u2CF1\u2D7F\u2DE0-\u2DFF\u302A-\u302F\u3099\u309A\uA66F-\uA672\uA674-\uA67D\uA69E\uA69F\uA6F0\uA6F1\uA802\uA806\uA80B\uA823-\uA827\uA880\uA881\uA8B4-\uA8C5\uA8E0-\uA8F1\uA8FF\uA926-\uA92D\uA947-\uA953\uA980-\uA983\uA9B3-\uA9C0\uA9E5\uAA29-\uAA36\uAA43\uAA4C\uAA4D\uAA7B-\uAA7D\uAAB0\uAAB2-\uAAB4\uAAB7\uAAB8\uAABE\uAABF\uAAC1\uAAEB-\uAAEF\uAAF5\uAAF6\uABE3-\uABEA\uABEC\uABED\uFB1E\uFE00-\uFE0F\uFE20-\uFE2F', + 'astral': '\uD800[\uDDFD\uDEE0\uDF76-\uDF7A]|\uD802[\uDE01-\uDE03\uDE05\uDE06\uDE0C-\uDE0F\uDE38-\uDE3A\uDE3F\uDEE5\uDEE6]|\uD803[\uDD24-\uDD27\uDF46-\uDF50]|\uD804[\uDC00-\uDC02\uDC38-\uDC46\uDC7F-\uDC82\uDCB0-\uDCBA\uDD00-\uDD02\uDD27-\uDD34\uDD45\uDD46\uDD73\uDD80-\uDD82\uDDB3-\uDDC0\uDDC9-\uDDCC\uDE2C-\uDE37\uDE3E\uDEDF-\uDEEA\uDF00-\uDF03\uDF3B\uDF3C\uDF3E-\uDF44\uDF47\uDF48\uDF4B-\uDF4D\uDF57\uDF62\uDF63\uDF66-\uDF6C\uDF70-\uDF74]|\uD805[\uDC35-\uDC46\uDC5E\uDCB0-\uDCC3\uDDAF-\uDDB5\uDDB8-\uDDC0\uDDDC\uDDDD\uDE30-\uDE40\uDEAB-\uDEB7\uDF1D-\uDF2B]|\uD806[\uDC2C-\uDC3A\uDE01-\uDE0A\uDE33-\uDE39\uDE3B-\uDE3E\uDE47\uDE51-\uDE5B\uDE8A-\uDE99]|\uD807[\uDC2F-\uDC36\uDC38-\uDC3F\uDC92-\uDCA7\uDCA9-\uDCB6\uDD31-\uDD36\uDD3A\uDD3C\uDD3D\uDD3F-\uDD45\uDD47\uDD8A-\uDD8E\uDD90\uDD91\uDD93-\uDD97\uDEF3-\uDEF6]|\uD81A[\uDEF0-\uDEF4\uDF30-\uDF36]|\uD81B[\uDF51-\uDF7E\uDF8F-\uDF92]|\uD82F[\uDC9D\uDC9E]|\uD834[\uDD65-\uDD69\uDD6D-\uDD72\uDD7B-\uDD82\uDD85-\uDD8B\uDDAA-\uDDAD\uDE42-\uDE44]|\uD836[\uDE00-\uDE36\uDE3B-\uDE6C\uDE75\uDE84\uDE9B-\uDE9F\uDEA1-\uDEAF]|\uD838[\uDC00-\uDC06\uDC08-\uDC18\uDC1B-\uDC21\uDC23\uDC24\uDC26-\uDC2A]|\uD83A[\uDCD0-\uDCD6\uDD44-\uDD4A]|\uDB40[\uDD00-\uDDEF]' + }, + { + 'name': 'Mc', + 'alias': 'Spacing_Mark', + 'bmp': '\u0903\u093B\u093E-\u0940\u0949-\u094C\u094E\u094F\u0982\u0983\u09BE-\u09C0\u09C7\u09C8\u09CB\u09CC\u09D7\u0A03\u0A3E-\u0A40\u0A83\u0ABE-\u0AC0\u0AC9\u0ACB\u0ACC\u0B02\u0B03\u0B3E\u0B40\u0B47\u0B48\u0B4B\u0B4C\u0B57\u0BBE\u0BBF\u0BC1\u0BC2\u0BC6-\u0BC8\u0BCA-\u0BCC\u0BD7\u0C01-\u0C03\u0C41-\u0C44\u0C82\u0C83\u0CBE\u0CC0-\u0CC4\u0CC7\u0CC8\u0CCA\u0CCB\u0CD5\u0CD6\u0D02\u0D03\u0D3E-\u0D40\u0D46-\u0D48\u0D4A-\u0D4C\u0D57\u0D82\u0D83\u0DCF-\u0DD1\u0DD8-\u0DDF\u0DF2\u0DF3\u0F3E\u0F3F\u0F7F\u102B\u102C\u1031\u1038\u103B\u103C\u1056\u1057\u1062-\u1064\u1067-\u106D\u1083\u1084\u1087-\u108C\u108F\u109A-\u109C\u17B6\u17BE-\u17C5\u17C7\u17C8\u1923-\u1926\u1929-\u192B\u1930\u1931\u1933-\u1938\u1A19\u1A1A\u1A55\u1A57\u1A61\u1A63\u1A64\u1A6D-\u1A72\u1B04\u1B35\u1B3B\u1B3D-\u1B41\u1B43\u1B44\u1B82\u1BA1\u1BA6\u1BA7\u1BAA\u1BE7\u1BEA-\u1BEC\u1BEE\u1BF2\u1BF3\u1C24-\u1C2B\u1C34\u1C35\u1CE1\u1CF2\u1CF3\u1CF7\u302E\u302F\uA823\uA824\uA827\uA880\uA881\uA8B4-\uA8C3\uA952\uA953\uA983\uA9B4\uA9B5\uA9BA\uA9BB\uA9BD-\uA9C0\uAA2F\uAA30\uAA33\uAA34\uAA4D\uAA7B\uAA7D\uAAEB\uAAEE\uAAEF\uAAF5\uABE3\uABE4\uABE6\uABE7\uABE9\uABEA\uABEC', + 'astral': '\uD804[\uDC00\uDC02\uDC82\uDCB0-\uDCB2\uDCB7\uDCB8\uDD2C\uDD45\uDD46\uDD82\uDDB3-\uDDB5\uDDBF\uDDC0\uDE2C-\uDE2E\uDE32\uDE33\uDE35\uDEE0-\uDEE2\uDF02\uDF03\uDF3E\uDF3F\uDF41-\uDF44\uDF47\uDF48\uDF4B-\uDF4D\uDF57\uDF62\uDF63]|\uD805[\uDC35-\uDC37\uDC40\uDC41\uDC45\uDCB0-\uDCB2\uDCB9\uDCBB-\uDCBE\uDCC1\uDDAF-\uDDB1\uDDB8-\uDDBB\uDDBE\uDE30-\uDE32\uDE3B\uDE3C\uDE3E\uDEAC\uDEAE\uDEAF\uDEB6\uDF20\uDF21\uDF26]|\uD806[\uDC2C-\uDC2E\uDC38\uDE39\uDE57\uDE58\uDE97]|\uD807[\uDC2F\uDC3E\uDCA9\uDCB1\uDCB4\uDD8A-\uDD8E\uDD93\uDD94\uDD96\uDEF5\uDEF6]|\uD81B[\uDF51-\uDF7E]|\uD834[\uDD65\uDD66\uDD6D-\uDD72]' + }, + { + 'name': 'Me', + 'alias': 'Enclosing_Mark', + 'bmp': '\u0488\u0489\u1ABE\u20DD-\u20E0\u20E2-\u20E4\uA670-\uA672' + }, + { + 'name': 'Mn', + 'alias': 'Nonspacing_Mark', + 'bmp': '\u0300-\u036F\u0483-\u0487\u0591-\u05BD\u05BF\u05C1\u05C2\u05C4\u05C5\u05C7\u0610-\u061A\u064B-\u065F\u0670\u06D6-\u06DC\u06DF-\u06E4\u06E7\u06E8\u06EA-\u06ED\u0711\u0730-\u074A\u07A6-\u07B0\u07EB-\u07F3\u07FD\u0816-\u0819\u081B-\u0823\u0825-\u0827\u0829-\u082D\u0859-\u085B\u08D3-\u08E1\u08E3-\u0902\u093A\u093C\u0941-\u0948\u094D\u0951-\u0957\u0962\u0963\u0981\u09BC\u09C1-\u09C4\u09CD\u09E2\u09E3\u09FE\u0A01\u0A02\u0A3C\u0A41\u0A42\u0A47\u0A48\u0A4B-\u0A4D\u0A51\u0A70\u0A71\u0A75\u0A81\u0A82\u0ABC\u0AC1-\u0AC5\u0AC7\u0AC8\u0ACD\u0AE2\u0AE3\u0AFA-\u0AFF\u0B01\u0B3C\u0B3F\u0B41-\u0B44\u0B4D\u0B56\u0B62\u0B63\u0B82\u0BC0\u0BCD\u0C00\u0C04\u0C3E-\u0C40\u0C46-\u0C48\u0C4A-\u0C4D\u0C55\u0C56\u0C62\u0C63\u0C81\u0CBC\u0CBF\u0CC6\u0CCC\u0CCD\u0CE2\u0CE3\u0D00\u0D01\u0D3B\u0D3C\u0D41-\u0D44\u0D4D\u0D62\u0D63\u0DCA\u0DD2-\u0DD4\u0DD6\u0E31\u0E34-\u0E3A\u0E47-\u0E4E\u0EB1\u0EB4-\u0EB9\u0EBB\u0EBC\u0EC8-\u0ECD\u0F18\u0F19\u0F35\u0F37\u0F39\u0F71-\u0F7E\u0F80-\u0F84\u0F86\u0F87\u0F8D-\u0F97\u0F99-\u0FBC\u0FC6\u102D-\u1030\u1032-\u1037\u1039\u103A\u103D\u103E\u1058\u1059\u105E-\u1060\u1071-\u1074\u1082\u1085\u1086\u108D\u109D\u135D-\u135F\u1712-\u1714\u1732-\u1734\u1752\u1753\u1772\u1773\u17B4\u17B5\u17B7-\u17BD\u17C6\u17C9-\u17D3\u17DD\u180B-\u180D\u1885\u1886\u18A9\u1920-\u1922\u1927\u1928\u1932\u1939-\u193B\u1A17\u1A18\u1A1B\u1A56\u1A58-\u1A5E\u1A60\u1A62\u1A65-\u1A6C\u1A73-\u1A7C\u1A7F\u1AB0-\u1ABD\u1B00-\u1B03\u1B34\u1B36-\u1B3A\u1B3C\u1B42\u1B6B-\u1B73\u1B80\u1B81\u1BA2-\u1BA5\u1BA8\u1BA9\u1BAB-\u1BAD\u1BE6\u1BE8\u1BE9\u1BED\u1BEF-\u1BF1\u1C2C-\u1C33\u1C36\u1C37\u1CD0-\u1CD2\u1CD4-\u1CE0\u1CE2-\u1CE8\u1CED\u1CF4\u1CF8\u1CF9\u1DC0-\u1DF9\u1DFB-\u1DFF\u20D0-\u20DC\u20E1\u20E5-\u20F0\u2CEF-\u2CF1\u2D7F\u2DE0-\u2DFF\u302A-\u302D\u3099\u309A\uA66F\uA674-\uA67D\uA69E\uA69F\uA6F0\uA6F1\uA802\uA806\uA80B\uA825\uA826\uA8C4\uA8C5\uA8E0-\uA8F1\uA8FF\uA926-\uA92D\uA947-\uA951\uA980-\uA982\uA9B3\uA9B6-\uA9B9\uA9BC\uA9E5\uAA29-\uAA2E\uAA31\uAA32\uAA35\uAA36\uAA43\uAA4C\uAA7C\uAAB0\uAAB2-\uAAB4\uAAB7\uAAB8\uAABE\uAABF\uAAC1\uAAEC\uAAED\uAAF6\uABE5\uABE8\uABED\uFB1E\uFE00-\uFE0F\uFE20-\uFE2F', + 'astral': '\uD800[\uDDFD\uDEE0\uDF76-\uDF7A]|\uD802[\uDE01-\uDE03\uDE05\uDE06\uDE0C-\uDE0F\uDE38-\uDE3A\uDE3F\uDEE5\uDEE6]|\uD803[\uDD24-\uDD27\uDF46-\uDF50]|\uD804[\uDC01\uDC38-\uDC46\uDC7F-\uDC81\uDCB3-\uDCB6\uDCB9\uDCBA\uDD00-\uDD02\uDD27-\uDD2B\uDD2D-\uDD34\uDD73\uDD80\uDD81\uDDB6-\uDDBE\uDDC9-\uDDCC\uDE2F-\uDE31\uDE34\uDE36\uDE37\uDE3E\uDEDF\uDEE3-\uDEEA\uDF00\uDF01\uDF3B\uDF3C\uDF40\uDF66-\uDF6C\uDF70-\uDF74]|\uD805[\uDC38-\uDC3F\uDC42-\uDC44\uDC46\uDC5E\uDCB3-\uDCB8\uDCBA\uDCBF\uDCC0\uDCC2\uDCC3\uDDB2-\uDDB5\uDDBC\uDDBD\uDDBF\uDDC0\uDDDC\uDDDD\uDE33-\uDE3A\uDE3D\uDE3F\uDE40\uDEAB\uDEAD\uDEB0-\uDEB5\uDEB7\uDF1D-\uDF1F\uDF22-\uDF25\uDF27-\uDF2B]|\uD806[\uDC2F-\uDC37\uDC39\uDC3A\uDE01-\uDE0A\uDE33-\uDE38\uDE3B-\uDE3E\uDE47\uDE51-\uDE56\uDE59-\uDE5B\uDE8A-\uDE96\uDE98\uDE99]|\uD807[\uDC30-\uDC36\uDC38-\uDC3D\uDC3F\uDC92-\uDCA7\uDCAA-\uDCB0\uDCB2\uDCB3\uDCB5\uDCB6\uDD31-\uDD36\uDD3A\uDD3C\uDD3D\uDD3F-\uDD45\uDD47\uDD90\uDD91\uDD95\uDD97\uDEF3\uDEF4]|\uD81A[\uDEF0-\uDEF4\uDF30-\uDF36]|\uD81B[\uDF8F-\uDF92]|\uD82F[\uDC9D\uDC9E]|\uD834[\uDD67-\uDD69\uDD7B-\uDD82\uDD85-\uDD8B\uDDAA-\uDDAD\uDE42-\uDE44]|\uD836[\uDE00-\uDE36\uDE3B-\uDE6C\uDE75\uDE84\uDE9B-\uDE9F\uDEA1-\uDEAF]|\uD838[\uDC00-\uDC06\uDC08-\uDC18\uDC1B-\uDC21\uDC23\uDC24\uDC26-\uDC2A]|\uD83A[\uDCD0-\uDCD6\uDD44-\uDD4A]|\uDB40[\uDD00-\uDDEF]' + }, + { + 'name': 'N', + 'alias': 'Number', + 'bmp': '0-9\xB2\xB3\xB9\xBC-\xBE\u0660-\u0669\u06F0-\u06F9\u07C0-\u07C9\u0966-\u096F\u09E6-\u09EF\u09F4-\u09F9\u0A66-\u0A6F\u0AE6-\u0AEF\u0B66-\u0B6F\u0B72-\u0B77\u0BE6-\u0BF2\u0C66-\u0C6F\u0C78-\u0C7E\u0CE6-\u0CEF\u0D58-\u0D5E\u0D66-\u0D78\u0DE6-\u0DEF\u0E50-\u0E59\u0ED0-\u0ED9\u0F20-\u0F33\u1040-\u1049\u1090-\u1099\u1369-\u137C\u16EE-\u16F0\u17E0-\u17E9\u17F0-\u17F9\u1810-\u1819\u1946-\u194F\u19D0-\u19DA\u1A80-\u1A89\u1A90-\u1A99\u1B50-\u1B59\u1BB0-\u1BB9\u1C40-\u1C49\u1C50-\u1C59\u2070\u2074-\u2079\u2080-\u2089\u2150-\u2182\u2185-\u2189\u2460-\u249B\u24EA-\u24FF\u2776-\u2793\u2CFD\u3007\u3021-\u3029\u3038-\u303A\u3192-\u3195\u3220-\u3229\u3248-\u324F\u3251-\u325F\u3280-\u3289\u32B1-\u32BF\uA620-\uA629\uA6E6-\uA6EF\uA830-\uA835\uA8D0-\uA8D9\uA900-\uA909\uA9D0-\uA9D9\uA9F0-\uA9F9\uAA50-\uAA59\uABF0-\uABF9\uFF10-\uFF19', + 'astral': '\uD800[\uDD07-\uDD33\uDD40-\uDD78\uDD8A\uDD8B\uDEE1-\uDEFB\uDF20-\uDF23\uDF41\uDF4A\uDFD1-\uDFD5]|\uD801[\uDCA0-\uDCA9]|\uD802[\uDC58-\uDC5F\uDC79-\uDC7F\uDCA7-\uDCAF\uDCFB-\uDCFF\uDD16-\uDD1B\uDDBC\uDDBD\uDDC0-\uDDCF\uDDD2-\uDDFF\uDE40-\uDE48\uDE7D\uDE7E\uDE9D-\uDE9F\uDEEB-\uDEEF\uDF58-\uDF5F\uDF78-\uDF7F\uDFA9-\uDFAF]|\uD803[\uDCFA-\uDCFF\uDD30-\uDD39\uDE60-\uDE7E\uDF1D-\uDF26\uDF51-\uDF54]|\uD804[\uDC52-\uDC6F\uDCF0-\uDCF9\uDD36-\uDD3F\uDDD0-\uDDD9\uDDE1-\uDDF4\uDEF0-\uDEF9]|\uD805[\uDC50-\uDC59\uDCD0-\uDCD9\uDE50-\uDE59\uDEC0-\uDEC9\uDF30-\uDF3B]|\uD806[\uDCE0-\uDCF2]|\uD807[\uDC50-\uDC6C\uDD50-\uDD59\uDDA0-\uDDA9]|\uD809[\uDC00-\uDC6E]|\uD81A[\uDE60-\uDE69\uDF50-\uDF59\uDF5B-\uDF61]|\uD81B[\uDE80-\uDE96]|\uD834[\uDEE0-\uDEF3\uDF60-\uDF78]|\uD835[\uDFCE-\uDFFF]|\uD83A[\uDCC7-\uDCCF\uDD50-\uDD59]|\uD83B[\uDC71-\uDCAB\uDCAD-\uDCAF\uDCB1-\uDCB4]|\uD83C[\uDD00-\uDD0C]' + }, + { + 'name': 'Nd', + 'alias': 'Decimal_Number', + 'bmp': '0-9\u0660-\u0669\u06F0-\u06F9\u07C0-\u07C9\u0966-\u096F\u09E6-\u09EF\u0A66-\u0A6F\u0AE6-\u0AEF\u0B66-\u0B6F\u0BE6-\u0BEF\u0C66-\u0C6F\u0CE6-\u0CEF\u0D66-\u0D6F\u0DE6-\u0DEF\u0E50-\u0E59\u0ED0-\u0ED9\u0F20-\u0F29\u1040-\u1049\u1090-\u1099\u17E0-\u17E9\u1810-\u1819\u1946-\u194F\u19D0-\u19D9\u1A80-\u1A89\u1A90-\u1A99\u1B50-\u1B59\u1BB0-\u1BB9\u1C40-\u1C49\u1C50-\u1C59\uA620-\uA629\uA8D0-\uA8D9\uA900-\uA909\uA9D0-\uA9D9\uA9F0-\uA9F9\uAA50-\uAA59\uABF0-\uABF9\uFF10-\uFF19', + 'astral': '\uD801[\uDCA0-\uDCA9]|\uD803[\uDD30-\uDD39]|\uD804[\uDC66-\uDC6F\uDCF0-\uDCF9\uDD36-\uDD3F\uDDD0-\uDDD9\uDEF0-\uDEF9]|\uD805[\uDC50-\uDC59\uDCD0-\uDCD9\uDE50-\uDE59\uDEC0-\uDEC9\uDF30-\uDF39]|\uD806[\uDCE0-\uDCE9]|\uD807[\uDC50-\uDC59\uDD50-\uDD59\uDDA0-\uDDA9]|\uD81A[\uDE60-\uDE69\uDF50-\uDF59]|\uD835[\uDFCE-\uDFFF]|\uD83A[\uDD50-\uDD59]' + }, + { + 'name': 'Nl', + 'alias': 'Letter_Number', + 'bmp': '\u16EE-\u16F0\u2160-\u2182\u2185-\u2188\u3007\u3021-\u3029\u3038-\u303A\uA6E6-\uA6EF', + 'astral': '\uD800[\uDD40-\uDD74\uDF41\uDF4A\uDFD1-\uDFD5]|\uD809[\uDC00-\uDC6E]' + }, + { + 'name': 'No', + 'alias': 'Other_Number', + 'bmp': '\xB2\xB3\xB9\xBC-\xBE\u09F4-\u09F9\u0B72-\u0B77\u0BF0-\u0BF2\u0C78-\u0C7E\u0D58-\u0D5E\u0D70-\u0D78\u0F2A-\u0F33\u1369-\u137C\u17F0-\u17F9\u19DA\u2070\u2074-\u2079\u2080-\u2089\u2150-\u215F\u2189\u2460-\u249B\u24EA-\u24FF\u2776-\u2793\u2CFD\u3192-\u3195\u3220-\u3229\u3248-\u324F\u3251-\u325F\u3280-\u3289\u32B1-\u32BF\uA830-\uA835', + 'astral': '\uD800[\uDD07-\uDD33\uDD75-\uDD78\uDD8A\uDD8B\uDEE1-\uDEFB\uDF20-\uDF23]|\uD802[\uDC58-\uDC5F\uDC79-\uDC7F\uDCA7-\uDCAF\uDCFB-\uDCFF\uDD16-\uDD1B\uDDBC\uDDBD\uDDC0-\uDDCF\uDDD2-\uDDFF\uDE40-\uDE48\uDE7D\uDE7E\uDE9D-\uDE9F\uDEEB-\uDEEF\uDF58-\uDF5F\uDF78-\uDF7F\uDFA9-\uDFAF]|\uD803[\uDCFA-\uDCFF\uDE60-\uDE7E\uDF1D-\uDF26\uDF51-\uDF54]|\uD804[\uDC52-\uDC65\uDDE1-\uDDF4]|\uD805[\uDF3A\uDF3B]|\uD806[\uDCEA-\uDCF2]|\uD807[\uDC5A-\uDC6C]|\uD81A[\uDF5B-\uDF61]|\uD81B[\uDE80-\uDE96]|\uD834[\uDEE0-\uDEF3\uDF60-\uDF78]|\uD83A[\uDCC7-\uDCCF]|\uD83B[\uDC71-\uDCAB\uDCAD-\uDCAF\uDCB1-\uDCB4]|\uD83C[\uDD00-\uDD0C]' + }, + { + 'name': 'P', + 'alias': 'Punctuation', + 'bmp': '!-#%-\\*,-\\/:;\\?@\\[-\\]_\\{\\}\xA1\xA7\xAB\xB6\xB7\xBB\xBF\u037E\u0387\u055A-\u055F\u0589\u058A\u05BE\u05C0\u05C3\u05C6\u05F3\u05F4\u0609\u060A\u060C\u060D\u061B\u061E\u061F\u066A-\u066D\u06D4\u0700-\u070D\u07F7-\u07F9\u0830-\u083E\u085E\u0964\u0965\u0970\u09FD\u0A76\u0AF0\u0C84\u0DF4\u0E4F\u0E5A\u0E5B\u0F04-\u0F12\u0F14\u0F3A-\u0F3D\u0F85\u0FD0-\u0FD4\u0FD9\u0FDA\u104A-\u104F\u10FB\u1360-\u1368\u1400\u166D\u166E\u169B\u169C\u16EB-\u16ED\u1735\u1736\u17D4-\u17D6\u17D8-\u17DA\u1800-\u180A\u1944\u1945\u1A1E\u1A1F\u1AA0-\u1AA6\u1AA8-\u1AAD\u1B5A-\u1B60\u1BFC-\u1BFF\u1C3B-\u1C3F\u1C7E\u1C7F\u1CC0-\u1CC7\u1CD3\u2010-\u2027\u2030-\u2043\u2045-\u2051\u2053-\u205E\u207D\u207E\u208D\u208E\u2308-\u230B\u2329\u232A\u2768-\u2775\u27C5\u27C6\u27E6-\u27EF\u2983-\u2998\u29D8-\u29DB\u29FC\u29FD\u2CF9-\u2CFC\u2CFE\u2CFF\u2D70\u2E00-\u2E2E\u2E30-\u2E4E\u3001-\u3003\u3008-\u3011\u3014-\u301F\u3030\u303D\u30A0\u30FB\uA4FE\uA4FF\uA60D-\uA60F\uA673\uA67E\uA6F2-\uA6F7\uA874-\uA877\uA8CE\uA8CF\uA8F8-\uA8FA\uA8FC\uA92E\uA92F\uA95F\uA9C1-\uA9CD\uA9DE\uA9DF\uAA5C-\uAA5F\uAADE\uAADF\uAAF0\uAAF1\uABEB\uFD3E\uFD3F\uFE10-\uFE19\uFE30-\uFE52\uFE54-\uFE61\uFE63\uFE68\uFE6A\uFE6B\uFF01-\uFF03\uFF05-\uFF0A\uFF0C-\uFF0F\uFF1A\uFF1B\uFF1F\uFF20\uFF3B-\uFF3D\uFF3F\uFF5B\uFF5D\uFF5F-\uFF65', + 'astral': '\uD800[\uDD00-\uDD02\uDF9F\uDFD0]|\uD801\uDD6F|\uD802[\uDC57\uDD1F\uDD3F\uDE50-\uDE58\uDE7F\uDEF0-\uDEF6\uDF39-\uDF3F\uDF99-\uDF9C]|\uD803[\uDF55-\uDF59]|\uD804[\uDC47-\uDC4D\uDCBB\uDCBC\uDCBE-\uDCC1\uDD40-\uDD43\uDD74\uDD75\uDDC5-\uDDC8\uDDCD\uDDDB\uDDDD-\uDDDF\uDE38-\uDE3D\uDEA9]|\uD805[\uDC4B-\uDC4F\uDC5B\uDC5D\uDCC6\uDDC1-\uDDD7\uDE41-\uDE43\uDE60-\uDE6C\uDF3C-\uDF3E]|\uD806[\uDC3B\uDE3F-\uDE46\uDE9A-\uDE9C\uDE9E-\uDEA2]|\uD807[\uDC41-\uDC45\uDC70\uDC71\uDEF7\uDEF8]|\uD809[\uDC70-\uDC74]|\uD81A[\uDE6E\uDE6F\uDEF5\uDF37-\uDF3B\uDF44]|\uD81B[\uDE97-\uDE9A]|\uD82F\uDC9F|\uD836[\uDE87-\uDE8B]|\uD83A[\uDD5E\uDD5F]' + }, + { + 'name': 'Pc', + 'alias': 'Connector_Punctuation', + 'bmp': '_\u203F\u2040\u2054\uFE33\uFE34\uFE4D-\uFE4F\uFF3F' + }, + { + 'name': 'Pd', + 'alias': 'Dash_Punctuation', + 'bmp': '\\-\u058A\u05BE\u1400\u1806\u2010-\u2015\u2E17\u2E1A\u2E3A\u2E3B\u2E40\u301C\u3030\u30A0\uFE31\uFE32\uFE58\uFE63\uFF0D' + }, + { + 'name': 'Pe', + 'alias': 'Close_Punctuation', + 'bmp': '\\)\\]\\}\u0F3B\u0F3D\u169C\u2046\u207E\u208E\u2309\u230B\u232A\u2769\u276B\u276D\u276F\u2771\u2773\u2775\u27C6\u27E7\u27E9\u27EB\u27ED\u27EF\u2984\u2986\u2988\u298A\u298C\u298E\u2990\u2992\u2994\u2996\u2998\u29D9\u29DB\u29FD\u2E23\u2E25\u2E27\u2E29\u3009\u300B\u300D\u300F\u3011\u3015\u3017\u3019\u301B\u301E\u301F\uFD3E\uFE18\uFE36\uFE38\uFE3A\uFE3C\uFE3E\uFE40\uFE42\uFE44\uFE48\uFE5A\uFE5C\uFE5E\uFF09\uFF3D\uFF5D\uFF60\uFF63' + }, + { + 'name': 'Pf', + 'alias': 'Final_Punctuation', + 'bmp': '\xBB\u2019\u201D\u203A\u2E03\u2E05\u2E0A\u2E0D\u2E1D\u2E21' + }, + { + 'name': 'Pi', + 'alias': 'Initial_Punctuation', + 'bmp': '\xAB\u2018\u201B\u201C\u201F\u2039\u2E02\u2E04\u2E09\u2E0C\u2E1C\u2E20' + }, + { + 'name': 'Po', + 'alias': 'Other_Punctuation', + 'bmp': '!-#%-\'\\*,\\.\\/:;\\?@\\\xA1\xA7\xB6\xB7\xBF\u037E\u0387\u055A-\u055F\u0589\u05C0\u05C3\u05C6\u05F3\u05F4\u0609\u060A\u060C\u060D\u061B\u061E\u061F\u066A-\u066D\u06D4\u0700-\u070D\u07F7-\u07F9\u0830-\u083E\u085E\u0964\u0965\u0970\u09FD\u0A76\u0AF0\u0C84\u0DF4\u0E4F\u0E5A\u0E5B\u0F04-\u0F12\u0F14\u0F85\u0FD0-\u0FD4\u0FD9\u0FDA\u104A-\u104F\u10FB\u1360-\u1368\u166D\u166E\u16EB-\u16ED\u1735\u1736\u17D4-\u17D6\u17D8-\u17DA\u1800-\u1805\u1807-\u180A\u1944\u1945\u1A1E\u1A1F\u1AA0-\u1AA6\u1AA8-\u1AAD\u1B5A-\u1B60\u1BFC-\u1BFF\u1C3B-\u1C3F\u1C7E\u1C7F\u1CC0-\u1CC7\u1CD3\u2016\u2017\u2020-\u2027\u2030-\u2038\u203B-\u203E\u2041-\u2043\u2047-\u2051\u2053\u2055-\u205E\u2CF9-\u2CFC\u2CFE\u2CFF\u2D70\u2E00\u2E01\u2E06-\u2E08\u2E0B\u2E0E-\u2E16\u2E18\u2E19\u2E1B\u2E1E\u2E1F\u2E2A-\u2E2E\u2E30-\u2E39\u2E3C-\u2E3F\u2E41\u2E43-\u2E4E\u3001-\u3003\u303D\u30FB\uA4FE\uA4FF\uA60D-\uA60F\uA673\uA67E\uA6F2-\uA6F7\uA874-\uA877\uA8CE\uA8CF\uA8F8-\uA8FA\uA8FC\uA92E\uA92F\uA95F\uA9C1-\uA9CD\uA9DE\uA9DF\uAA5C-\uAA5F\uAADE\uAADF\uAAF0\uAAF1\uABEB\uFE10-\uFE16\uFE19\uFE30\uFE45\uFE46\uFE49-\uFE4C\uFE50-\uFE52\uFE54-\uFE57\uFE5F-\uFE61\uFE68\uFE6A\uFE6B\uFF01-\uFF03\uFF05-\uFF07\uFF0A\uFF0C\uFF0E\uFF0F\uFF1A\uFF1B\uFF1F\uFF20\uFF3C\uFF61\uFF64\uFF65', + 'astral': '\uD800[\uDD00-\uDD02\uDF9F\uDFD0]|\uD801\uDD6F|\uD802[\uDC57\uDD1F\uDD3F\uDE50-\uDE58\uDE7F\uDEF0-\uDEF6\uDF39-\uDF3F\uDF99-\uDF9C]|\uD803[\uDF55-\uDF59]|\uD804[\uDC47-\uDC4D\uDCBB\uDCBC\uDCBE-\uDCC1\uDD40-\uDD43\uDD74\uDD75\uDDC5-\uDDC8\uDDCD\uDDDB\uDDDD-\uDDDF\uDE38-\uDE3D\uDEA9]|\uD805[\uDC4B-\uDC4F\uDC5B\uDC5D\uDCC6\uDDC1-\uDDD7\uDE41-\uDE43\uDE60-\uDE6C\uDF3C-\uDF3E]|\uD806[\uDC3B\uDE3F-\uDE46\uDE9A-\uDE9C\uDE9E-\uDEA2]|\uD807[\uDC41-\uDC45\uDC70\uDC71\uDEF7\uDEF8]|\uD809[\uDC70-\uDC74]|\uD81A[\uDE6E\uDE6F\uDEF5\uDF37-\uDF3B\uDF44]|\uD81B[\uDE97-\uDE9A]|\uD82F\uDC9F|\uD836[\uDE87-\uDE8B]|\uD83A[\uDD5E\uDD5F]' + }, + { + 'name': 'Ps', + 'alias': 'Open_Punctuation', + 'bmp': '\\(\\[\\{\u0F3A\u0F3C\u169B\u201A\u201E\u2045\u207D\u208D\u2308\u230A\u2329\u2768\u276A\u276C\u276E\u2770\u2772\u2774\u27C5\u27E6\u27E8\u27EA\u27EC\u27EE\u2983\u2985\u2987\u2989\u298B\u298D\u298F\u2991\u2993\u2995\u2997\u29D8\u29DA\u29FC\u2E22\u2E24\u2E26\u2E28\u2E42\u3008\u300A\u300C\u300E\u3010\u3014\u3016\u3018\u301A\u301D\uFD3F\uFE17\uFE35\uFE37\uFE39\uFE3B\uFE3D\uFE3F\uFE41\uFE43\uFE47\uFE59\uFE5B\uFE5D\uFF08\uFF3B\uFF5B\uFF5F\uFF62' + }, + { + 'name': 'S', + 'alias': 'Symbol', + 'bmp': '\\$\\+<->\\^`\\|~\xA2-\xA6\xA8\xA9\xAC\xAE-\xB1\xB4\xB8\xD7\xF7\u02C2-\u02C5\u02D2-\u02DF\u02E5-\u02EB\u02ED\u02EF-\u02FF\u0375\u0384\u0385\u03F6\u0482\u058D-\u058F\u0606-\u0608\u060B\u060E\u060F\u06DE\u06E9\u06FD\u06FE\u07F6\u07FE\u07FF\u09F2\u09F3\u09FA\u09FB\u0AF1\u0B70\u0BF3-\u0BFA\u0C7F\u0D4F\u0D79\u0E3F\u0F01-\u0F03\u0F13\u0F15-\u0F17\u0F1A-\u0F1F\u0F34\u0F36\u0F38\u0FBE-\u0FC5\u0FC7-\u0FCC\u0FCE\u0FCF\u0FD5-\u0FD8\u109E\u109F\u1390-\u1399\u17DB\u1940\u19DE-\u19FF\u1B61-\u1B6A\u1B74-\u1B7C\u1FBD\u1FBF-\u1FC1\u1FCD-\u1FCF\u1FDD-\u1FDF\u1FED-\u1FEF\u1FFD\u1FFE\u2044\u2052\u207A-\u207C\u208A-\u208C\u20A0-\u20BF\u2100\u2101\u2103-\u2106\u2108\u2109\u2114\u2116-\u2118\u211E-\u2123\u2125\u2127\u2129\u212E\u213A\u213B\u2140-\u2144\u214A-\u214D\u214F\u218A\u218B\u2190-\u2307\u230C-\u2328\u232B-\u2426\u2440-\u244A\u249C-\u24E9\u2500-\u2767\u2794-\u27C4\u27C7-\u27E5\u27F0-\u2982\u2999-\u29D7\u29DC-\u29FB\u29FE-\u2B73\u2B76-\u2B95\u2B98-\u2BC8\u2BCA-\u2BFE\u2CE5-\u2CEA\u2E80-\u2E99\u2E9B-\u2EF3\u2F00-\u2FD5\u2FF0-\u2FFB\u3004\u3012\u3013\u3020\u3036\u3037\u303E\u303F\u309B\u309C\u3190\u3191\u3196-\u319F\u31C0-\u31E3\u3200-\u321E\u322A-\u3247\u3250\u3260-\u327F\u328A-\u32B0\u32C0-\u32FE\u3300-\u33FF\u4DC0-\u4DFF\uA490-\uA4C6\uA700-\uA716\uA720\uA721\uA789\uA78A\uA828-\uA82B\uA836-\uA839\uAA77-\uAA79\uAB5B\uFB29\uFBB2-\uFBC1\uFDFC\uFDFD\uFE62\uFE64-\uFE66\uFE69\uFF04\uFF0B\uFF1C-\uFF1E\uFF3E\uFF40\uFF5C\uFF5E\uFFE0-\uFFE6\uFFE8-\uFFEE\uFFFC\uFFFD', + 'astral': '\uD800[\uDD37-\uDD3F\uDD79-\uDD89\uDD8C-\uDD8E\uDD90-\uDD9B\uDDA0\uDDD0-\uDDFC]|\uD802[\uDC77\uDC78\uDEC8]|\uD805\uDF3F|\uD81A[\uDF3C-\uDF3F\uDF45]|\uD82F\uDC9C|\uD834[\uDC00-\uDCF5\uDD00-\uDD26\uDD29-\uDD64\uDD6A-\uDD6C\uDD83\uDD84\uDD8C-\uDDA9\uDDAE-\uDDE8\uDE00-\uDE41\uDE45\uDF00-\uDF56]|\uD835[\uDEC1\uDEDB\uDEFB\uDF15\uDF35\uDF4F\uDF6F\uDF89\uDFA9\uDFC3]|\uD836[\uDC00-\uDDFF\uDE37-\uDE3A\uDE6D-\uDE74\uDE76-\uDE83\uDE85\uDE86]|\uD83B[\uDCAC\uDCB0\uDEF0\uDEF1]|\uD83C[\uDC00-\uDC2B\uDC30-\uDC93\uDCA0-\uDCAE\uDCB1-\uDCBF\uDCC1-\uDCCF\uDCD1-\uDCF5\uDD10-\uDD6B\uDD70-\uDDAC\uDDE6-\uDE02\uDE10-\uDE3B\uDE40-\uDE48\uDE50\uDE51\uDE60-\uDE65\uDF00-\uDFFF]|\uD83D[\uDC00-\uDED4\uDEE0-\uDEEC\uDEF0-\uDEF9\uDF00-\uDF73\uDF80-\uDFD8]|\uD83E[\uDC00-\uDC0B\uDC10-\uDC47\uDC50-\uDC59\uDC60-\uDC87\uDC90-\uDCAD\uDD00-\uDD0B\uDD10-\uDD3E\uDD40-\uDD70\uDD73-\uDD76\uDD7A\uDD7C-\uDDA2\uDDB0-\uDDB9\uDDC0-\uDDC2\uDDD0-\uDDFF\uDE60-\uDE6D]' + }, + { + 'name': 'Sc', + 'alias': 'Currency_Symbol', + 'bmp': '\\$\xA2-\xA5\u058F\u060B\u07FE\u07FF\u09F2\u09F3\u09FB\u0AF1\u0BF9\u0E3F\u17DB\u20A0-\u20BF\uA838\uFDFC\uFE69\uFF04\uFFE0\uFFE1\uFFE5\uFFE6', + 'astral': '\uD83B\uDCB0' + }, + { + 'name': 'Sk', + 'alias': 'Modifier_Symbol', + 'bmp': '\\^`\xA8\xAF\xB4\xB8\u02C2-\u02C5\u02D2-\u02DF\u02E5-\u02EB\u02ED\u02EF-\u02FF\u0375\u0384\u0385\u1FBD\u1FBF-\u1FC1\u1FCD-\u1FCF\u1FDD-\u1FDF\u1FED-\u1FEF\u1FFD\u1FFE\u309B\u309C\uA700-\uA716\uA720\uA721\uA789\uA78A\uAB5B\uFBB2-\uFBC1\uFF3E\uFF40\uFFE3', + 'astral': '\uD83C[\uDFFB-\uDFFF]' + }, + { + 'name': 'Sm', + 'alias': 'Math_Symbol', + 'bmp': '\\+<->\\|~\xAC\xB1\xD7\xF7\u03F6\u0606-\u0608\u2044\u2052\u207A-\u207C\u208A-\u208C\u2118\u2140-\u2144\u214B\u2190-\u2194\u219A\u219B\u21A0\u21A3\u21A6\u21AE\u21CE\u21CF\u21D2\u21D4\u21F4-\u22FF\u2320\u2321\u237C\u239B-\u23B3\u23DC-\u23E1\u25B7\u25C1\u25F8-\u25FF\u266F\u27C0-\u27C4\u27C7-\u27E5\u27F0-\u27FF\u2900-\u2982\u2999-\u29D7\u29DC-\u29FB\u29FE-\u2AFF\u2B30-\u2B44\u2B47-\u2B4C\uFB29\uFE62\uFE64-\uFE66\uFF0B\uFF1C-\uFF1E\uFF5C\uFF5E\uFFE2\uFFE9-\uFFEC', + 'astral': '\uD835[\uDEC1\uDEDB\uDEFB\uDF15\uDF35\uDF4F\uDF6F\uDF89\uDFA9\uDFC3]|\uD83B[\uDEF0\uDEF1]' + }, + { + 'name': 'So', + 'alias': 'Other_Symbol', + 'bmp': '\xA6\xA9\xAE\xB0\u0482\u058D\u058E\u060E\u060F\u06DE\u06E9\u06FD\u06FE\u07F6\u09FA\u0B70\u0BF3-\u0BF8\u0BFA\u0C7F\u0D4F\u0D79\u0F01-\u0F03\u0F13\u0F15-\u0F17\u0F1A-\u0F1F\u0F34\u0F36\u0F38\u0FBE-\u0FC5\u0FC7-\u0FCC\u0FCE\u0FCF\u0FD5-\u0FD8\u109E\u109F\u1390-\u1399\u1940\u19DE-\u19FF\u1B61-\u1B6A\u1B74-\u1B7C\u2100\u2101\u2103-\u2106\u2108\u2109\u2114\u2116\u2117\u211E-\u2123\u2125\u2127\u2129\u212E\u213A\u213B\u214A\u214C\u214D\u214F\u218A\u218B\u2195-\u2199\u219C-\u219F\u21A1\u21A2\u21A4\u21A5\u21A7-\u21AD\u21AF-\u21CD\u21D0\u21D1\u21D3\u21D5-\u21F3\u2300-\u2307\u230C-\u231F\u2322-\u2328\u232B-\u237B\u237D-\u239A\u23B4-\u23DB\u23E2-\u2426\u2440-\u244A\u249C-\u24E9\u2500-\u25B6\u25B8-\u25C0\u25C2-\u25F7\u2600-\u266E\u2670-\u2767\u2794-\u27BF\u2800-\u28FF\u2B00-\u2B2F\u2B45\u2B46\u2B4D-\u2B73\u2B76-\u2B95\u2B98-\u2BC8\u2BCA-\u2BFE\u2CE5-\u2CEA\u2E80-\u2E99\u2E9B-\u2EF3\u2F00-\u2FD5\u2FF0-\u2FFB\u3004\u3012\u3013\u3020\u3036\u3037\u303E\u303F\u3190\u3191\u3196-\u319F\u31C0-\u31E3\u3200-\u321E\u322A-\u3247\u3250\u3260-\u327F\u328A-\u32B0\u32C0-\u32FE\u3300-\u33FF\u4DC0-\u4DFF\uA490-\uA4C6\uA828-\uA82B\uA836\uA837\uA839\uAA77-\uAA79\uFDFD\uFFE4\uFFE8\uFFED\uFFEE\uFFFC\uFFFD', + 'astral': '\uD800[\uDD37-\uDD3F\uDD79-\uDD89\uDD8C-\uDD8E\uDD90-\uDD9B\uDDA0\uDDD0-\uDDFC]|\uD802[\uDC77\uDC78\uDEC8]|\uD805\uDF3F|\uD81A[\uDF3C-\uDF3F\uDF45]|\uD82F\uDC9C|\uD834[\uDC00-\uDCF5\uDD00-\uDD26\uDD29-\uDD64\uDD6A-\uDD6C\uDD83\uDD84\uDD8C-\uDDA9\uDDAE-\uDDE8\uDE00-\uDE41\uDE45\uDF00-\uDF56]|\uD836[\uDC00-\uDDFF\uDE37-\uDE3A\uDE6D-\uDE74\uDE76-\uDE83\uDE85\uDE86]|\uD83B\uDCAC|\uD83C[\uDC00-\uDC2B\uDC30-\uDC93\uDCA0-\uDCAE\uDCB1-\uDCBF\uDCC1-\uDCCF\uDCD1-\uDCF5\uDD10-\uDD6B\uDD70-\uDDAC\uDDE6-\uDE02\uDE10-\uDE3B\uDE40-\uDE48\uDE50\uDE51\uDE60-\uDE65\uDF00-\uDFFA]|\uD83D[\uDC00-\uDED4\uDEE0-\uDEEC\uDEF0-\uDEF9\uDF00-\uDF73\uDF80-\uDFD8]|\uD83E[\uDC00-\uDC0B\uDC10-\uDC47\uDC50-\uDC59\uDC60-\uDC87\uDC90-\uDCAD\uDD00-\uDD0B\uDD10-\uDD3E\uDD40-\uDD70\uDD73-\uDD76\uDD7A\uDD7C-\uDDA2\uDDB0-\uDDB9\uDDC0-\uDDC2\uDDD0-\uDDFF\uDE60-\uDE6D]' + }, + { + 'name': 'Z', + 'alias': 'Separator', + 'bmp': ' \xA0\u1680\u2000-\u200A\u2028\u2029\u202F\u205F\u3000' + }, + { + 'name': 'Zl', + 'alias': 'Line_Separator', + 'bmp': '\u2028' + }, + { + 'name': 'Zp', + 'alias': 'Paragraph_Separator', + 'bmp': '\u2029' + }, + { + 'name': 'Zs', + 'alias': 'Space_Separator', + 'bmp': ' \xA0\u1680\u2000-\u200A\u202F\u205F\u3000' + } +]; + +var unicodeCategories = createCommonjsModule(function (module, exports) { +"use strict"; + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.default = void 0; + +var _categories = _interopRequireDefault(categories); + +function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } + +/*! + * XRegExp Unicode Categories 4.2.0 + * + * Steven Levithan (c) 2010-present MIT License + * Unicode data by Mathias Bynens + */ +var _default = function _default(XRegExp) { + /** + * Adds support for Unicode's general categories. E.g., `\p{Lu}` or `\p{Uppercase Letter}`. See + * category descriptions in UAX #44 . Token + * names are case insensitive, and any spaces, hyphens, and underscores are ignored. + * + * Uses Unicode 11.0.0. + * + * @requires XRegExp, Unicode Base + */ + if (!XRegExp.addUnicodeData) { + throw new ReferenceError('Unicode Base must be loaded before Unicode Categories'); + } + + XRegExp.addUnicodeData(_categories.default); +}; + +exports.default = _default; +module.exports = exports["default"]; +}); + +unwrapExports(unicodeCategories); + +var properties = [ + { + 'name': 'ASCII', + 'bmp': '\0-\x7F' + }, + { + 'name': 'Alphabetic', + 'bmp': 'A-Za-z\xAA\xB5\xBA\xC0-\xD6\xD8-\xF6\xF8-\u02C1\u02C6-\u02D1\u02E0-\u02E4\u02EC\u02EE\u0345\u0370-\u0374\u0376\u0377\u037A-\u037D\u037F\u0386\u0388-\u038A\u038C\u038E-\u03A1\u03A3-\u03F5\u03F7-\u0481\u048A-\u052F\u0531-\u0556\u0559\u0560-\u0588\u05B0-\u05BD\u05BF\u05C1\u05C2\u05C4\u05C5\u05C7\u05D0-\u05EA\u05EF-\u05F2\u0610-\u061A\u0620-\u0657\u0659-\u065F\u066E-\u06D3\u06D5-\u06DC\u06E1-\u06E8\u06ED-\u06EF\u06FA-\u06FC\u06FF\u0710-\u073F\u074D-\u07B1\u07CA-\u07EA\u07F4\u07F5\u07FA\u0800-\u0817\u081A-\u082C\u0840-\u0858\u0860-\u086A\u08A0-\u08B4\u08B6-\u08BD\u08D4-\u08DF\u08E3-\u08E9\u08F0-\u093B\u093D-\u094C\u094E-\u0950\u0955-\u0963\u0971-\u0983\u0985-\u098C\u098F\u0990\u0993-\u09A8\u09AA-\u09B0\u09B2\u09B6-\u09B9\u09BD-\u09C4\u09C7\u09C8\u09CB\u09CC\u09CE\u09D7\u09DC\u09DD\u09DF-\u09E3\u09F0\u09F1\u09FC\u0A01-\u0A03\u0A05-\u0A0A\u0A0F\u0A10\u0A13-\u0A28\u0A2A-\u0A30\u0A32\u0A33\u0A35\u0A36\u0A38\u0A39\u0A3E-\u0A42\u0A47\u0A48\u0A4B\u0A4C\u0A51\u0A59-\u0A5C\u0A5E\u0A70-\u0A75\u0A81-\u0A83\u0A85-\u0A8D\u0A8F-\u0A91\u0A93-\u0AA8\u0AAA-\u0AB0\u0AB2\u0AB3\u0AB5-\u0AB9\u0ABD-\u0AC5\u0AC7-\u0AC9\u0ACB\u0ACC\u0AD0\u0AE0-\u0AE3\u0AF9-\u0AFC\u0B01-\u0B03\u0B05-\u0B0C\u0B0F\u0B10\u0B13-\u0B28\u0B2A-\u0B30\u0B32\u0B33\u0B35-\u0B39\u0B3D-\u0B44\u0B47\u0B48\u0B4B\u0B4C\u0B56\u0B57\u0B5C\u0B5D\u0B5F-\u0B63\u0B71\u0B82\u0B83\u0B85-\u0B8A\u0B8E-\u0B90\u0B92-\u0B95\u0B99\u0B9A\u0B9C\u0B9E\u0B9F\u0BA3\u0BA4\u0BA8-\u0BAA\u0BAE-\u0BB9\u0BBE-\u0BC2\u0BC6-\u0BC8\u0BCA-\u0BCC\u0BD0\u0BD7\u0C00-\u0C03\u0C05-\u0C0C\u0C0E-\u0C10\u0C12-\u0C28\u0C2A-\u0C39\u0C3D-\u0C44\u0C46-\u0C48\u0C4A-\u0C4C\u0C55\u0C56\u0C58-\u0C5A\u0C60-\u0C63\u0C80-\u0C83\u0C85-\u0C8C\u0C8E-\u0C90\u0C92-\u0CA8\u0CAA-\u0CB3\u0CB5-\u0CB9\u0CBD-\u0CC4\u0CC6-\u0CC8\u0CCA-\u0CCC\u0CD5\u0CD6\u0CDE\u0CE0-\u0CE3\u0CF1\u0CF2\u0D00-\u0D03\u0D05-\u0D0C\u0D0E-\u0D10\u0D12-\u0D3A\u0D3D-\u0D44\u0D46-\u0D48\u0D4A-\u0D4C\u0D4E\u0D54-\u0D57\u0D5F-\u0D63\u0D7A-\u0D7F\u0D82\u0D83\u0D85-\u0D96\u0D9A-\u0DB1\u0DB3-\u0DBB\u0DBD\u0DC0-\u0DC6\u0DCF-\u0DD4\u0DD6\u0DD8-\u0DDF\u0DF2\u0DF3\u0E01-\u0E3A\u0E40-\u0E46\u0E4D\u0E81\u0E82\u0E84\u0E87\u0E88\u0E8A\u0E8D\u0E94-\u0E97\u0E99-\u0E9F\u0EA1-\u0EA3\u0EA5\u0EA7\u0EAA\u0EAB\u0EAD-\u0EB9\u0EBB-\u0EBD\u0EC0-\u0EC4\u0EC6\u0ECD\u0EDC-\u0EDF\u0F00\u0F40-\u0F47\u0F49-\u0F6C\u0F71-\u0F81\u0F88-\u0F97\u0F99-\u0FBC\u1000-\u1036\u1038\u103B-\u103F\u1050-\u1062\u1065-\u1068\u106E-\u1086\u108E\u109C\u109D\u10A0-\u10C5\u10C7\u10CD\u10D0-\u10FA\u10FC-\u1248\u124A-\u124D\u1250-\u1256\u1258\u125A-\u125D\u1260-\u1288\u128A-\u128D\u1290-\u12B0\u12B2-\u12B5\u12B8-\u12BE\u12C0\u12C2-\u12C5\u12C8-\u12D6\u12D8-\u1310\u1312-\u1315\u1318-\u135A\u135F\u1380-\u138F\u13A0-\u13F5\u13F8-\u13FD\u1401-\u166C\u166F-\u167F\u1681-\u169A\u16A0-\u16EA\u16EE-\u16F8\u1700-\u170C\u170E-\u1713\u1720-\u1733\u1740-\u1753\u1760-\u176C\u176E-\u1770\u1772\u1773\u1780-\u17B3\u17B6-\u17C8\u17D7\u17DC\u1820-\u1878\u1880-\u18AA\u18B0-\u18F5\u1900-\u191E\u1920-\u192B\u1930-\u1938\u1950-\u196D\u1970-\u1974\u1980-\u19AB\u19B0-\u19C9\u1A00-\u1A1B\u1A20-\u1A5E\u1A61-\u1A74\u1AA7\u1B00-\u1B33\u1B35-\u1B43\u1B45-\u1B4B\u1B80-\u1BA9\u1BAC-\u1BAF\u1BBA-\u1BE5\u1BE7-\u1BF1\u1C00-\u1C35\u1C4D-\u1C4F\u1C5A-\u1C7D\u1C80-\u1C88\u1C90-\u1CBA\u1CBD-\u1CBF\u1CE9-\u1CEC\u1CEE-\u1CF3\u1CF5\u1CF6\u1D00-\u1DBF\u1DE7-\u1DF4\u1E00-\u1F15\u1F18-\u1F1D\u1F20-\u1F45\u1F48-\u1F4D\u1F50-\u1F57\u1F59\u1F5B\u1F5D\u1F5F-\u1F7D\u1F80-\u1FB4\u1FB6-\u1FBC\u1FBE\u1FC2-\u1FC4\u1FC6-\u1FCC\u1FD0-\u1FD3\u1FD6-\u1FDB\u1FE0-\u1FEC\u1FF2-\u1FF4\u1FF6-\u1FFC\u2071\u207F\u2090-\u209C\u2102\u2107\u210A-\u2113\u2115\u2119-\u211D\u2124\u2126\u2128\u212A-\u212D\u212F-\u2139\u213C-\u213F\u2145-\u2149\u214E\u2160-\u2188\u24B6-\u24E9\u2C00-\u2C2E\u2C30-\u2C5E\u2C60-\u2CE4\u2CEB-\u2CEE\u2CF2\u2CF3\u2D00-\u2D25\u2D27\u2D2D\u2D30-\u2D67\u2D6F\u2D80-\u2D96\u2DA0-\u2DA6\u2DA8-\u2DAE\u2DB0-\u2DB6\u2DB8-\u2DBE\u2DC0-\u2DC6\u2DC8-\u2DCE\u2DD0-\u2DD6\u2DD8-\u2DDE\u2DE0-\u2DFF\u2E2F\u3005-\u3007\u3021-\u3029\u3031-\u3035\u3038-\u303C\u3041-\u3096\u309D-\u309F\u30A1-\u30FA\u30FC-\u30FF\u3105-\u312F\u3131-\u318E\u31A0-\u31BA\u31F0-\u31FF\u3400-\u4DB5\u4E00-\u9FEF\uA000-\uA48C\uA4D0-\uA4FD\uA500-\uA60C\uA610-\uA61F\uA62A\uA62B\uA640-\uA66E\uA674-\uA67B\uA67F-\uA6EF\uA717-\uA71F\uA722-\uA788\uA78B-\uA7B9\uA7F7-\uA801\uA803-\uA805\uA807-\uA80A\uA80C-\uA827\uA840-\uA873\uA880-\uA8C3\uA8C5\uA8F2-\uA8F7\uA8FB\uA8FD\uA8FE\uA90A-\uA92A\uA930-\uA952\uA960-\uA97C\uA980-\uA9B2\uA9B4-\uA9BF\uA9CF\uA9E0-\uA9E4\uA9E6-\uA9EF\uA9FA-\uA9FE\uAA00-\uAA36\uAA40-\uAA4D\uAA60-\uAA76\uAA7A\uAA7E-\uAABE\uAAC0\uAAC2\uAADB-\uAADD\uAAE0-\uAAEF\uAAF2-\uAAF5\uAB01-\uAB06\uAB09-\uAB0E\uAB11-\uAB16\uAB20-\uAB26\uAB28-\uAB2E\uAB30-\uAB5A\uAB5C-\uAB65\uAB70-\uABEA\uAC00-\uD7A3\uD7B0-\uD7C6\uD7CB-\uD7FB\uF900-\uFA6D\uFA70-\uFAD9\uFB00-\uFB06\uFB13-\uFB17\uFB1D-\uFB28\uFB2A-\uFB36\uFB38-\uFB3C\uFB3E\uFB40\uFB41\uFB43\uFB44\uFB46-\uFBB1\uFBD3-\uFD3D\uFD50-\uFD8F\uFD92-\uFDC7\uFDF0-\uFDFB\uFE70-\uFE74\uFE76-\uFEFC\uFF21-\uFF3A\uFF41-\uFF5A\uFF66-\uFFBE\uFFC2-\uFFC7\uFFCA-\uFFCF\uFFD2-\uFFD7\uFFDA-\uFFDC', + 'astral': '\uD800[\uDC00-\uDC0B\uDC0D-\uDC26\uDC28-\uDC3A\uDC3C\uDC3D\uDC3F-\uDC4D\uDC50-\uDC5D\uDC80-\uDCFA\uDD40-\uDD74\uDE80-\uDE9C\uDEA0-\uDED0\uDF00-\uDF1F\uDF2D-\uDF4A\uDF50-\uDF7A\uDF80-\uDF9D\uDFA0-\uDFC3\uDFC8-\uDFCF\uDFD1-\uDFD5]|\uD801[\uDC00-\uDC9D\uDCB0-\uDCD3\uDCD8-\uDCFB\uDD00-\uDD27\uDD30-\uDD63\uDE00-\uDF36\uDF40-\uDF55\uDF60-\uDF67]|\uD802[\uDC00-\uDC05\uDC08\uDC0A-\uDC35\uDC37\uDC38\uDC3C\uDC3F-\uDC55\uDC60-\uDC76\uDC80-\uDC9E\uDCE0-\uDCF2\uDCF4\uDCF5\uDD00-\uDD15\uDD20-\uDD39\uDD80-\uDDB7\uDDBE\uDDBF\uDE00-\uDE03\uDE05\uDE06\uDE0C-\uDE13\uDE15-\uDE17\uDE19-\uDE35\uDE60-\uDE7C\uDE80-\uDE9C\uDEC0-\uDEC7\uDEC9-\uDEE4\uDF00-\uDF35\uDF40-\uDF55\uDF60-\uDF72\uDF80-\uDF91]|\uD803[\uDC00-\uDC48\uDC80-\uDCB2\uDCC0-\uDCF2\uDD00-\uDD27\uDF00-\uDF1C\uDF27\uDF30-\uDF45]|\uD804[\uDC00-\uDC45\uDC82-\uDCB8\uDCD0-\uDCE8\uDD00-\uDD32\uDD44-\uDD46\uDD50-\uDD72\uDD76\uDD80-\uDDBF\uDDC1-\uDDC4\uDDDA\uDDDC\uDE00-\uDE11\uDE13-\uDE34\uDE37\uDE3E\uDE80-\uDE86\uDE88\uDE8A-\uDE8D\uDE8F-\uDE9D\uDE9F-\uDEA8\uDEB0-\uDEE8\uDF00-\uDF03\uDF05-\uDF0C\uDF0F\uDF10\uDF13-\uDF28\uDF2A-\uDF30\uDF32\uDF33\uDF35-\uDF39\uDF3D-\uDF44\uDF47\uDF48\uDF4B\uDF4C\uDF50\uDF57\uDF5D-\uDF63]|\uD805[\uDC00-\uDC41\uDC43-\uDC45\uDC47-\uDC4A\uDC80-\uDCC1\uDCC4\uDCC5\uDCC7\uDD80-\uDDB5\uDDB8-\uDDBE\uDDD8-\uDDDD\uDE00-\uDE3E\uDE40\uDE44\uDE80-\uDEB5\uDF00-\uDF1A\uDF1D-\uDF2A]|\uD806[\uDC00-\uDC38\uDCA0-\uDCDF\uDCFF\uDE00-\uDE32\uDE35-\uDE3E\uDE50-\uDE83\uDE86-\uDE97\uDE9D\uDEC0-\uDEF8]|\uD807[\uDC00-\uDC08\uDC0A-\uDC36\uDC38-\uDC3E\uDC40\uDC72-\uDC8F\uDC92-\uDCA7\uDCA9-\uDCB6\uDD00-\uDD06\uDD08\uDD09\uDD0B-\uDD36\uDD3A\uDD3C\uDD3D\uDD3F-\uDD41\uDD43\uDD46\uDD47\uDD60-\uDD65\uDD67\uDD68\uDD6A-\uDD8E\uDD90\uDD91\uDD93-\uDD96\uDD98\uDEE0-\uDEF6]|\uD808[\uDC00-\uDF99]|\uD809[\uDC00-\uDC6E\uDC80-\uDD43]|[\uD80C\uD81C-\uD820\uD840-\uD868\uD86A-\uD86C\uD86F-\uD872\uD874-\uD879][\uDC00-\uDFFF]|\uD80D[\uDC00-\uDC2E]|\uD811[\uDC00-\uDE46]|\uD81A[\uDC00-\uDE38\uDE40-\uDE5E\uDED0-\uDEED\uDF00-\uDF36\uDF40-\uDF43\uDF63-\uDF77\uDF7D-\uDF8F]|\uD81B[\uDE40-\uDE7F\uDF00-\uDF44\uDF50-\uDF7E\uDF93-\uDF9F\uDFE0\uDFE1]|\uD821[\uDC00-\uDFF1]|\uD822[\uDC00-\uDEF2]|\uD82C[\uDC00-\uDD1E\uDD70-\uDEFB]|\uD82F[\uDC00-\uDC6A\uDC70-\uDC7C\uDC80-\uDC88\uDC90-\uDC99\uDC9E]|\uD835[\uDC00-\uDC54\uDC56-\uDC9C\uDC9E\uDC9F\uDCA2\uDCA5\uDCA6\uDCA9-\uDCAC\uDCAE-\uDCB9\uDCBB\uDCBD-\uDCC3\uDCC5-\uDD05\uDD07-\uDD0A\uDD0D-\uDD14\uDD16-\uDD1C\uDD1E-\uDD39\uDD3B-\uDD3E\uDD40-\uDD44\uDD46\uDD4A-\uDD50\uDD52-\uDEA5\uDEA8-\uDEC0\uDEC2-\uDEDA\uDEDC-\uDEFA\uDEFC-\uDF14\uDF16-\uDF34\uDF36-\uDF4E\uDF50-\uDF6E\uDF70-\uDF88\uDF8A-\uDFA8\uDFAA-\uDFC2\uDFC4-\uDFCB]|\uD838[\uDC00-\uDC06\uDC08-\uDC18\uDC1B-\uDC21\uDC23\uDC24\uDC26-\uDC2A]|\uD83A[\uDC00-\uDCC4\uDD00-\uDD43\uDD47]|\uD83B[\uDE00-\uDE03\uDE05-\uDE1F\uDE21\uDE22\uDE24\uDE27\uDE29-\uDE32\uDE34-\uDE37\uDE39\uDE3B\uDE42\uDE47\uDE49\uDE4B\uDE4D-\uDE4F\uDE51\uDE52\uDE54\uDE57\uDE59\uDE5B\uDE5D\uDE5F\uDE61\uDE62\uDE64\uDE67-\uDE6A\uDE6C-\uDE72\uDE74-\uDE77\uDE79-\uDE7C\uDE7E\uDE80-\uDE89\uDE8B-\uDE9B\uDEA1-\uDEA3\uDEA5-\uDEA9\uDEAB-\uDEBB]|\uD83C[\uDD30-\uDD49\uDD50-\uDD69\uDD70-\uDD89]|\uD869[\uDC00-\uDED6\uDF00-\uDFFF]|\uD86D[\uDC00-\uDF34\uDF40-\uDFFF]|\uD86E[\uDC00-\uDC1D\uDC20-\uDFFF]|\uD873[\uDC00-\uDEA1\uDEB0-\uDFFF]|\uD87A[\uDC00-\uDFE0]|\uD87E[\uDC00-\uDE1D]' + }, + { + 'name': 'Any', + 'isBmpLast': true, + 'bmp': '\0-\uFFFF', + 'astral': '[\uD800-\uDBFF][\uDC00-\uDFFF]' + }, + { + 'name': 'Default_Ignorable_Code_Point', + 'bmp': '\xAD\u034F\u061C\u115F\u1160\u17B4\u17B5\u180B-\u180E\u200B-\u200F\u202A-\u202E\u2060-\u206F\u3164\uFE00-\uFE0F\uFEFF\uFFA0\uFFF0-\uFFF8', + 'astral': '\uD82F[\uDCA0-\uDCA3]|\uD834[\uDD73-\uDD7A]|[\uDB40-\uDB43][\uDC00-\uDFFF]' + }, + { + 'name': 'Lowercase', + 'bmp': 'a-z\xAA\xB5\xBA\xDF-\xF6\xF8-\xFF\u0101\u0103\u0105\u0107\u0109\u010B\u010D\u010F\u0111\u0113\u0115\u0117\u0119\u011B\u011D\u011F\u0121\u0123\u0125\u0127\u0129\u012B\u012D\u012F\u0131\u0133\u0135\u0137\u0138\u013A\u013C\u013E\u0140\u0142\u0144\u0146\u0148\u0149\u014B\u014D\u014F\u0151\u0153\u0155\u0157\u0159\u015B\u015D\u015F\u0161\u0163\u0165\u0167\u0169\u016B\u016D\u016F\u0171\u0173\u0175\u0177\u017A\u017C\u017E-\u0180\u0183\u0185\u0188\u018C\u018D\u0192\u0195\u0199-\u019B\u019E\u01A1\u01A3\u01A5\u01A8\u01AA\u01AB\u01AD\u01B0\u01B4\u01B6\u01B9\u01BA\u01BD-\u01BF\u01C6\u01C9\u01CC\u01CE\u01D0\u01D2\u01D4\u01D6\u01D8\u01DA\u01DC\u01DD\u01DF\u01E1\u01E3\u01E5\u01E7\u01E9\u01EB\u01ED\u01EF\u01F0\u01F3\u01F5\u01F9\u01FB\u01FD\u01FF\u0201\u0203\u0205\u0207\u0209\u020B\u020D\u020F\u0211\u0213\u0215\u0217\u0219\u021B\u021D\u021F\u0221\u0223\u0225\u0227\u0229\u022B\u022D\u022F\u0231\u0233-\u0239\u023C\u023F\u0240\u0242\u0247\u0249\u024B\u024D\u024F-\u0293\u0295-\u02B8\u02C0\u02C1\u02E0-\u02E4\u0345\u0371\u0373\u0377\u037A-\u037D\u0390\u03AC-\u03CE\u03D0\u03D1\u03D5-\u03D7\u03D9\u03DB\u03DD\u03DF\u03E1\u03E3\u03E5\u03E7\u03E9\u03EB\u03ED\u03EF-\u03F3\u03F5\u03F8\u03FB\u03FC\u0430-\u045F\u0461\u0463\u0465\u0467\u0469\u046B\u046D\u046F\u0471\u0473\u0475\u0477\u0479\u047B\u047D\u047F\u0481\u048B\u048D\u048F\u0491\u0493\u0495\u0497\u0499\u049B\u049D\u049F\u04A1\u04A3\u04A5\u04A7\u04A9\u04AB\u04AD\u04AF\u04B1\u04B3\u04B5\u04B7\u04B9\u04BB\u04BD\u04BF\u04C2\u04C4\u04C6\u04C8\u04CA\u04CC\u04CE\u04CF\u04D1\u04D3\u04D5\u04D7\u04D9\u04DB\u04DD\u04DF\u04E1\u04E3\u04E5\u04E7\u04E9\u04EB\u04ED\u04EF\u04F1\u04F3\u04F5\u04F7\u04F9\u04FB\u04FD\u04FF\u0501\u0503\u0505\u0507\u0509\u050B\u050D\u050F\u0511\u0513\u0515\u0517\u0519\u051B\u051D\u051F\u0521\u0523\u0525\u0527\u0529\u052B\u052D\u052F\u0560-\u0588\u10D0-\u10FA\u10FD-\u10FF\u13F8-\u13FD\u1C80-\u1C88\u1D00-\u1DBF\u1E01\u1E03\u1E05\u1E07\u1E09\u1E0B\u1E0D\u1E0F\u1E11\u1E13\u1E15\u1E17\u1E19\u1E1B\u1E1D\u1E1F\u1E21\u1E23\u1E25\u1E27\u1E29\u1E2B\u1E2D\u1E2F\u1E31\u1E33\u1E35\u1E37\u1E39\u1E3B\u1E3D\u1E3F\u1E41\u1E43\u1E45\u1E47\u1E49\u1E4B\u1E4D\u1E4F\u1E51\u1E53\u1E55\u1E57\u1E59\u1E5B\u1E5D\u1E5F\u1E61\u1E63\u1E65\u1E67\u1E69\u1E6B\u1E6D\u1E6F\u1E71\u1E73\u1E75\u1E77\u1E79\u1E7B\u1E7D\u1E7F\u1E81\u1E83\u1E85\u1E87\u1E89\u1E8B\u1E8D\u1E8F\u1E91\u1E93\u1E95-\u1E9D\u1E9F\u1EA1\u1EA3\u1EA5\u1EA7\u1EA9\u1EAB\u1EAD\u1EAF\u1EB1\u1EB3\u1EB5\u1EB7\u1EB9\u1EBB\u1EBD\u1EBF\u1EC1\u1EC3\u1EC5\u1EC7\u1EC9\u1ECB\u1ECD\u1ECF\u1ED1\u1ED3\u1ED5\u1ED7\u1ED9\u1EDB\u1EDD\u1EDF\u1EE1\u1EE3\u1EE5\u1EE7\u1EE9\u1EEB\u1EED\u1EEF\u1EF1\u1EF3\u1EF5\u1EF7\u1EF9\u1EFB\u1EFD\u1EFF-\u1F07\u1F10-\u1F15\u1F20-\u1F27\u1F30-\u1F37\u1F40-\u1F45\u1F50-\u1F57\u1F60-\u1F67\u1F70-\u1F7D\u1F80-\u1F87\u1F90-\u1F97\u1FA0-\u1FA7\u1FB0-\u1FB4\u1FB6\u1FB7\u1FBE\u1FC2-\u1FC4\u1FC6\u1FC7\u1FD0-\u1FD3\u1FD6\u1FD7\u1FE0-\u1FE7\u1FF2-\u1FF4\u1FF6\u1FF7\u2071\u207F\u2090-\u209C\u210A\u210E\u210F\u2113\u212F\u2134\u2139\u213C\u213D\u2146-\u2149\u214E\u2170-\u217F\u2184\u24D0-\u24E9\u2C30-\u2C5E\u2C61\u2C65\u2C66\u2C68\u2C6A\u2C6C\u2C71\u2C73\u2C74\u2C76-\u2C7D\u2C81\u2C83\u2C85\u2C87\u2C89\u2C8B\u2C8D\u2C8F\u2C91\u2C93\u2C95\u2C97\u2C99\u2C9B\u2C9D\u2C9F\u2CA1\u2CA3\u2CA5\u2CA7\u2CA9\u2CAB\u2CAD\u2CAF\u2CB1\u2CB3\u2CB5\u2CB7\u2CB9\u2CBB\u2CBD\u2CBF\u2CC1\u2CC3\u2CC5\u2CC7\u2CC9\u2CCB\u2CCD\u2CCF\u2CD1\u2CD3\u2CD5\u2CD7\u2CD9\u2CDB\u2CDD\u2CDF\u2CE1\u2CE3\u2CE4\u2CEC\u2CEE\u2CF3\u2D00-\u2D25\u2D27\u2D2D\uA641\uA643\uA645\uA647\uA649\uA64B\uA64D\uA64F\uA651\uA653\uA655\uA657\uA659\uA65B\uA65D\uA65F\uA661\uA663\uA665\uA667\uA669\uA66B\uA66D\uA681\uA683\uA685\uA687\uA689\uA68B\uA68D\uA68F\uA691\uA693\uA695\uA697\uA699\uA69B-\uA69D\uA723\uA725\uA727\uA729\uA72B\uA72D\uA72F-\uA731\uA733\uA735\uA737\uA739\uA73B\uA73D\uA73F\uA741\uA743\uA745\uA747\uA749\uA74B\uA74D\uA74F\uA751\uA753\uA755\uA757\uA759\uA75B\uA75D\uA75F\uA761\uA763\uA765\uA767\uA769\uA76B\uA76D\uA76F-\uA778\uA77A\uA77C\uA77F\uA781\uA783\uA785\uA787\uA78C\uA78E\uA791\uA793-\uA795\uA797\uA799\uA79B\uA79D\uA79F\uA7A1\uA7A3\uA7A5\uA7A7\uA7A9\uA7AF\uA7B5\uA7B7\uA7B9\uA7F8-\uA7FA\uAB30-\uAB5A\uAB5C-\uAB65\uAB70-\uABBF\uFB00-\uFB06\uFB13-\uFB17\uFF41-\uFF5A', + 'astral': '\uD801[\uDC28-\uDC4F\uDCD8-\uDCFB]|\uD803[\uDCC0-\uDCF2]|\uD806[\uDCC0-\uDCDF]|\uD81B[\uDE60-\uDE7F]|\uD835[\uDC1A-\uDC33\uDC4E-\uDC54\uDC56-\uDC67\uDC82-\uDC9B\uDCB6-\uDCB9\uDCBB\uDCBD-\uDCC3\uDCC5-\uDCCF\uDCEA-\uDD03\uDD1E-\uDD37\uDD52-\uDD6B\uDD86-\uDD9F\uDDBA-\uDDD3\uDDEE-\uDE07\uDE22-\uDE3B\uDE56-\uDE6F\uDE8A-\uDEA5\uDEC2-\uDEDA\uDEDC-\uDEE1\uDEFC-\uDF14\uDF16-\uDF1B\uDF36-\uDF4E\uDF50-\uDF55\uDF70-\uDF88\uDF8A-\uDF8F\uDFAA-\uDFC2\uDFC4-\uDFC9\uDFCB]|\uD83A[\uDD22-\uDD43]' + }, + { + 'name': 'Noncharacter_Code_Point', + 'bmp': '\uFDD0-\uFDEF\uFFFE\uFFFF', + 'astral': '[\uD83F\uD87F\uD8BF\uD8FF\uD93F\uD97F\uD9BF\uD9FF\uDA3F\uDA7F\uDABF\uDAFF\uDB3F\uDB7F\uDBBF\uDBFF][\uDFFE\uDFFF]' + }, + { + 'name': 'Uppercase', + 'bmp': 'A-Z\xC0-\xD6\xD8-\xDE\u0100\u0102\u0104\u0106\u0108\u010A\u010C\u010E\u0110\u0112\u0114\u0116\u0118\u011A\u011C\u011E\u0120\u0122\u0124\u0126\u0128\u012A\u012C\u012E\u0130\u0132\u0134\u0136\u0139\u013B\u013D\u013F\u0141\u0143\u0145\u0147\u014A\u014C\u014E\u0150\u0152\u0154\u0156\u0158\u015A\u015C\u015E\u0160\u0162\u0164\u0166\u0168\u016A\u016C\u016E\u0170\u0172\u0174\u0176\u0178\u0179\u017B\u017D\u0181\u0182\u0184\u0186\u0187\u0189-\u018B\u018E-\u0191\u0193\u0194\u0196-\u0198\u019C\u019D\u019F\u01A0\u01A2\u01A4\u01A6\u01A7\u01A9\u01AC\u01AE\u01AF\u01B1-\u01B3\u01B5\u01B7\u01B8\u01BC\u01C4\u01C7\u01CA\u01CD\u01CF\u01D1\u01D3\u01D5\u01D7\u01D9\u01DB\u01DE\u01E0\u01E2\u01E4\u01E6\u01E8\u01EA\u01EC\u01EE\u01F1\u01F4\u01F6-\u01F8\u01FA\u01FC\u01FE\u0200\u0202\u0204\u0206\u0208\u020A\u020C\u020E\u0210\u0212\u0214\u0216\u0218\u021A\u021C\u021E\u0220\u0222\u0224\u0226\u0228\u022A\u022C\u022E\u0230\u0232\u023A\u023B\u023D\u023E\u0241\u0243-\u0246\u0248\u024A\u024C\u024E\u0370\u0372\u0376\u037F\u0386\u0388-\u038A\u038C\u038E\u038F\u0391-\u03A1\u03A3-\u03AB\u03CF\u03D2-\u03D4\u03D8\u03DA\u03DC\u03DE\u03E0\u03E2\u03E4\u03E6\u03E8\u03EA\u03EC\u03EE\u03F4\u03F7\u03F9\u03FA\u03FD-\u042F\u0460\u0462\u0464\u0466\u0468\u046A\u046C\u046E\u0470\u0472\u0474\u0476\u0478\u047A\u047C\u047E\u0480\u048A\u048C\u048E\u0490\u0492\u0494\u0496\u0498\u049A\u049C\u049E\u04A0\u04A2\u04A4\u04A6\u04A8\u04AA\u04AC\u04AE\u04B0\u04B2\u04B4\u04B6\u04B8\u04BA\u04BC\u04BE\u04C0\u04C1\u04C3\u04C5\u04C7\u04C9\u04CB\u04CD\u04D0\u04D2\u04D4\u04D6\u04D8\u04DA\u04DC\u04DE\u04E0\u04E2\u04E4\u04E6\u04E8\u04EA\u04EC\u04EE\u04F0\u04F2\u04F4\u04F6\u04F8\u04FA\u04FC\u04FE\u0500\u0502\u0504\u0506\u0508\u050A\u050C\u050E\u0510\u0512\u0514\u0516\u0518\u051A\u051C\u051E\u0520\u0522\u0524\u0526\u0528\u052A\u052C\u052E\u0531-\u0556\u10A0-\u10C5\u10C7\u10CD\u13A0-\u13F5\u1C90-\u1CBA\u1CBD-\u1CBF\u1E00\u1E02\u1E04\u1E06\u1E08\u1E0A\u1E0C\u1E0E\u1E10\u1E12\u1E14\u1E16\u1E18\u1E1A\u1E1C\u1E1E\u1E20\u1E22\u1E24\u1E26\u1E28\u1E2A\u1E2C\u1E2E\u1E30\u1E32\u1E34\u1E36\u1E38\u1E3A\u1E3C\u1E3E\u1E40\u1E42\u1E44\u1E46\u1E48\u1E4A\u1E4C\u1E4E\u1E50\u1E52\u1E54\u1E56\u1E58\u1E5A\u1E5C\u1E5E\u1E60\u1E62\u1E64\u1E66\u1E68\u1E6A\u1E6C\u1E6E\u1E70\u1E72\u1E74\u1E76\u1E78\u1E7A\u1E7C\u1E7E\u1E80\u1E82\u1E84\u1E86\u1E88\u1E8A\u1E8C\u1E8E\u1E90\u1E92\u1E94\u1E9E\u1EA0\u1EA2\u1EA4\u1EA6\u1EA8\u1EAA\u1EAC\u1EAE\u1EB0\u1EB2\u1EB4\u1EB6\u1EB8\u1EBA\u1EBC\u1EBE\u1EC0\u1EC2\u1EC4\u1EC6\u1EC8\u1ECA\u1ECC\u1ECE\u1ED0\u1ED2\u1ED4\u1ED6\u1ED8\u1EDA\u1EDC\u1EDE\u1EE0\u1EE2\u1EE4\u1EE6\u1EE8\u1EEA\u1EEC\u1EEE\u1EF0\u1EF2\u1EF4\u1EF6\u1EF8\u1EFA\u1EFC\u1EFE\u1F08-\u1F0F\u1F18-\u1F1D\u1F28-\u1F2F\u1F38-\u1F3F\u1F48-\u1F4D\u1F59\u1F5B\u1F5D\u1F5F\u1F68-\u1F6F\u1FB8-\u1FBB\u1FC8-\u1FCB\u1FD8-\u1FDB\u1FE8-\u1FEC\u1FF8-\u1FFB\u2102\u2107\u210B-\u210D\u2110-\u2112\u2115\u2119-\u211D\u2124\u2126\u2128\u212A-\u212D\u2130-\u2133\u213E\u213F\u2145\u2160-\u216F\u2183\u24B6-\u24CF\u2C00-\u2C2E\u2C60\u2C62-\u2C64\u2C67\u2C69\u2C6B\u2C6D-\u2C70\u2C72\u2C75\u2C7E-\u2C80\u2C82\u2C84\u2C86\u2C88\u2C8A\u2C8C\u2C8E\u2C90\u2C92\u2C94\u2C96\u2C98\u2C9A\u2C9C\u2C9E\u2CA0\u2CA2\u2CA4\u2CA6\u2CA8\u2CAA\u2CAC\u2CAE\u2CB0\u2CB2\u2CB4\u2CB6\u2CB8\u2CBA\u2CBC\u2CBE\u2CC0\u2CC2\u2CC4\u2CC6\u2CC8\u2CCA\u2CCC\u2CCE\u2CD0\u2CD2\u2CD4\u2CD6\u2CD8\u2CDA\u2CDC\u2CDE\u2CE0\u2CE2\u2CEB\u2CED\u2CF2\uA640\uA642\uA644\uA646\uA648\uA64A\uA64C\uA64E\uA650\uA652\uA654\uA656\uA658\uA65A\uA65C\uA65E\uA660\uA662\uA664\uA666\uA668\uA66A\uA66C\uA680\uA682\uA684\uA686\uA688\uA68A\uA68C\uA68E\uA690\uA692\uA694\uA696\uA698\uA69A\uA722\uA724\uA726\uA728\uA72A\uA72C\uA72E\uA732\uA734\uA736\uA738\uA73A\uA73C\uA73E\uA740\uA742\uA744\uA746\uA748\uA74A\uA74C\uA74E\uA750\uA752\uA754\uA756\uA758\uA75A\uA75C\uA75E\uA760\uA762\uA764\uA766\uA768\uA76A\uA76C\uA76E\uA779\uA77B\uA77D\uA77E\uA780\uA782\uA784\uA786\uA78B\uA78D\uA790\uA792\uA796\uA798\uA79A\uA79C\uA79E\uA7A0\uA7A2\uA7A4\uA7A6\uA7A8\uA7AA-\uA7AE\uA7B0-\uA7B4\uA7B6\uA7B8\uFF21-\uFF3A', + 'astral': '\uD801[\uDC00-\uDC27\uDCB0-\uDCD3]|\uD803[\uDC80-\uDCB2]|\uD806[\uDCA0-\uDCBF]|\uD81B[\uDE40-\uDE5F]|\uD835[\uDC00-\uDC19\uDC34-\uDC4D\uDC68-\uDC81\uDC9C\uDC9E\uDC9F\uDCA2\uDCA5\uDCA6\uDCA9-\uDCAC\uDCAE-\uDCB5\uDCD0-\uDCE9\uDD04\uDD05\uDD07-\uDD0A\uDD0D-\uDD14\uDD16-\uDD1C\uDD38\uDD39\uDD3B-\uDD3E\uDD40-\uDD44\uDD46\uDD4A-\uDD50\uDD6C-\uDD85\uDDA0-\uDDB9\uDDD4-\uDDED\uDE08-\uDE21\uDE3C-\uDE55\uDE70-\uDE89\uDEA8-\uDEC0\uDEE2-\uDEFA\uDF1C-\uDF34\uDF56-\uDF6E\uDF90-\uDFA8\uDFCA]|\uD83A[\uDD00-\uDD21]|\uD83C[\uDD30-\uDD49\uDD50-\uDD69\uDD70-\uDD89]' + }, + { + 'name': 'White_Space', + 'bmp': '\t-\r \x85\xA0\u1680\u2000-\u200A\u2028\u2029\u202F\u205F\u3000' + } +]; + +var unicodeProperties = createCommonjsModule(function (module, exports) { +"use strict"; + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.default = void 0; + +var _properties = _interopRequireDefault(properties); + +function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } + +/*! + * XRegExp Unicode Properties 4.2.0 + * + * Steven Levithan (c) 2012-present MIT License + * Unicode data by Mathias Bynens + */ +var _default = function _default(XRegExp) { + /** + * Adds properties to meet the UTS #18 Level 1 RL1.2 requirements for Unicode regex support. See + * . Following are definitions of these properties from + * UAX #44 : + * + * - Alphabetic + * Characters with the Alphabetic property. Generated from: Lowercase + Uppercase + Lt + Lm + + * Lo + Nl + Other_Alphabetic. + * + * - Default_Ignorable_Code_Point + * For programmatic determination of default ignorable code points. New characters that should + * be ignored in rendering (unless explicitly supported) will be assigned in these ranges, + * permitting programs to correctly handle the default rendering of such characters when not + * otherwise supported. + * + * - Lowercase + * Characters with the Lowercase property. Generated from: Ll + Other_Lowercase. + * + * - Noncharacter_Code_Point + * Code points permanently reserved for internal use. + * + * - Uppercase + * Characters with the Uppercase property. Generated from: Lu + Other_Uppercase. + * + * - White_Space + * Spaces, separator characters and other control characters which should be treated by + * programming languages as "white space" for the purpose of parsing elements. + * + * The properties ASCII, Any, and Assigned are also included but are not defined in UAX #44. UTS + * #18 RL1.2 additionally requires support for Unicode scripts and general categories. These are + * included in XRegExp's Unicode Categories and Unicode Scripts addons. + * + * Token names are case insensitive, and any spaces, hyphens, and underscores are ignored. + * + * Uses Unicode 11.0.0. + * + * @requires XRegExp, Unicode Base + */ + if (!XRegExp.addUnicodeData) { + throw new ReferenceError('Unicode Base must be loaded before Unicode Properties'); + } + + var unicodeData = _properties.default; // Add non-generated data + + unicodeData.push({ + name: 'Assigned', + // Since this is defined as the inverse of Unicode category Cn (Unassigned), the Unicode + // Categories addon is required to use this property + inverseOf: 'Cn' + }); + XRegExp.addUnicodeData(unicodeData); +}; + +exports.default = _default; +module.exports = exports["default"]; +}); + +unwrapExports(unicodeProperties); + +var scripts = [ + { + 'name': 'Adlam', + 'astral': '\uD83A[\uDD00-\uDD4A\uDD50-\uDD59\uDD5E\uDD5F]' + }, + { + 'name': 'Ahom', + 'astral': '\uD805[\uDF00-\uDF1A\uDF1D-\uDF2B\uDF30-\uDF3F]' + }, + { + 'name': 'Anatolian_Hieroglyphs', + 'astral': '\uD811[\uDC00-\uDE46]' + }, + { + 'name': 'Arabic', + 'bmp': '\u0600-\u0604\u0606-\u060B\u060D-\u061A\u061C\u061E\u0620-\u063F\u0641-\u064A\u0656-\u066F\u0671-\u06DC\u06DE-\u06FF\u0750-\u077F\u08A0-\u08B4\u08B6-\u08BD\u08D3-\u08E1\u08E3-\u08FF\uFB50-\uFBC1\uFBD3-\uFD3D\uFD50-\uFD8F\uFD92-\uFDC7\uFDF0-\uFDFD\uFE70-\uFE74\uFE76-\uFEFC', + 'astral': '\uD803[\uDE60-\uDE7E]|\uD83B[\uDE00-\uDE03\uDE05-\uDE1F\uDE21\uDE22\uDE24\uDE27\uDE29-\uDE32\uDE34-\uDE37\uDE39\uDE3B\uDE42\uDE47\uDE49\uDE4B\uDE4D-\uDE4F\uDE51\uDE52\uDE54\uDE57\uDE59\uDE5B\uDE5D\uDE5F\uDE61\uDE62\uDE64\uDE67-\uDE6A\uDE6C-\uDE72\uDE74-\uDE77\uDE79-\uDE7C\uDE7E\uDE80-\uDE89\uDE8B-\uDE9B\uDEA1-\uDEA3\uDEA5-\uDEA9\uDEAB-\uDEBB\uDEF0\uDEF1]' + }, + { + 'name': 'Armenian', + 'bmp': '\u0531-\u0556\u0559-\u0588\u058A\u058D-\u058F\uFB13-\uFB17' + }, + { + 'name': 'Avestan', + 'astral': '\uD802[\uDF00-\uDF35\uDF39-\uDF3F]' + }, + { + 'name': 'Balinese', + 'bmp': '\u1B00-\u1B4B\u1B50-\u1B7C' + }, + { + 'name': 'Bamum', + 'bmp': '\uA6A0-\uA6F7', + 'astral': '\uD81A[\uDC00-\uDE38]' + }, + { + 'name': 'Bassa_Vah', + 'astral': '\uD81A[\uDED0-\uDEED\uDEF0-\uDEF5]' + }, + { + 'name': 'Batak', + 'bmp': '\u1BC0-\u1BF3\u1BFC-\u1BFF' + }, + { + 'name': 'Bengali', + 'bmp': '\u0980-\u0983\u0985-\u098C\u098F\u0990\u0993-\u09A8\u09AA-\u09B0\u09B2\u09B6-\u09B9\u09BC-\u09C4\u09C7\u09C8\u09CB-\u09CE\u09D7\u09DC\u09DD\u09DF-\u09E3\u09E6-\u09FE' + }, + { + 'name': 'Bhaiksuki', + 'astral': '\uD807[\uDC00-\uDC08\uDC0A-\uDC36\uDC38-\uDC45\uDC50-\uDC6C]' + }, + { + 'name': 'Bopomofo', + 'bmp': '\u02EA\u02EB\u3105-\u312F\u31A0-\u31BA' + }, + { + 'name': 'Brahmi', + 'astral': '\uD804[\uDC00-\uDC4D\uDC52-\uDC6F\uDC7F]' + }, + { + 'name': 'Braille', + 'bmp': '\u2800-\u28FF' + }, + { + 'name': 'Buginese', + 'bmp': '\u1A00-\u1A1B\u1A1E\u1A1F' + }, + { + 'name': 'Buhid', + 'bmp': '\u1740-\u1753' + }, + { + 'name': 'Canadian_Aboriginal', + 'bmp': '\u1400-\u167F\u18B0-\u18F5' + }, + { + 'name': 'Carian', + 'astral': '\uD800[\uDEA0-\uDED0]' + }, + { + 'name': 'Caucasian_Albanian', + 'astral': '\uD801[\uDD30-\uDD63\uDD6F]' + }, + { + 'name': 'Chakma', + 'astral': '\uD804[\uDD00-\uDD34\uDD36-\uDD46]' + }, + { + 'name': 'Cham', + 'bmp': '\uAA00-\uAA36\uAA40-\uAA4D\uAA50-\uAA59\uAA5C-\uAA5F' + }, + { + 'name': 'Cherokee', + 'bmp': '\u13A0-\u13F5\u13F8-\u13FD\uAB70-\uABBF' + }, + { + 'name': 'Common', + 'bmp': '\0-@\\[-`\\{-\xA9\xAB-\xB9\xBB-\xBF\xD7\xF7\u02B9-\u02DF\u02E5-\u02E9\u02EC-\u02FF\u0374\u037E\u0385\u0387\u0589\u0605\u060C\u061B\u061F\u0640\u06DD\u08E2\u0964\u0965\u0E3F\u0FD5-\u0FD8\u10FB\u16EB-\u16ED\u1735\u1736\u1802\u1803\u1805\u1CD3\u1CE1\u1CE9-\u1CEC\u1CEE-\u1CF3\u1CF5-\u1CF7\u2000-\u200B\u200E-\u2064\u2066-\u2070\u2074-\u207E\u2080-\u208E\u20A0-\u20BF\u2100-\u2125\u2127-\u2129\u212C-\u2131\u2133-\u214D\u214F-\u215F\u2189-\u218B\u2190-\u2426\u2440-\u244A\u2460-\u27FF\u2900-\u2B73\u2B76-\u2B95\u2B98-\u2BC8\u2BCA-\u2BFE\u2E00-\u2E4E\u2FF0-\u2FFB\u3000-\u3004\u3006\u3008-\u3020\u3030-\u3037\u303C-\u303F\u309B\u309C\u30A0\u30FB\u30FC\u3190-\u319F\u31C0-\u31E3\u3220-\u325F\u327F-\u32CF\u3358-\u33FF\u4DC0-\u4DFF\uA700-\uA721\uA788-\uA78A\uA830-\uA839\uA92E\uA9CF\uAB5B\uFD3E\uFD3F\uFE10-\uFE19\uFE30-\uFE52\uFE54-\uFE66\uFE68-\uFE6B\uFEFF\uFF01-\uFF20\uFF3B-\uFF40\uFF5B-\uFF65\uFF70\uFF9E\uFF9F\uFFE0-\uFFE6\uFFE8-\uFFEE\uFFF9-\uFFFD', + 'astral': '\uD800[\uDD00-\uDD02\uDD07-\uDD33\uDD37-\uDD3F\uDD90-\uDD9B\uDDD0-\uDDFC\uDEE1-\uDEFB]|\uD82F[\uDCA0-\uDCA3]|\uD834[\uDC00-\uDCF5\uDD00-\uDD26\uDD29-\uDD66\uDD6A-\uDD7A\uDD83\uDD84\uDD8C-\uDDA9\uDDAE-\uDDE8\uDEE0-\uDEF3\uDF00-\uDF56\uDF60-\uDF78]|\uD835[\uDC00-\uDC54\uDC56-\uDC9C\uDC9E\uDC9F\uDCA2\uDCA5\uDCA6\uDCA9-\uDCAC\uDCAE-\uDCB9\uDCBB\uDCBD-\uDCC3\uDCC5-\uDD05\uDD07-\uDD0A\uDD0D-\uDD14\uDD16-\uDD1C\uDD1E-\uDD39\uDD3B-\uDD3E\uDD40-\uDD44\uDD46\uDD4A-\uDD50\uDD52-\uDEA5\uDEA8-\uDFCB\uDFCE-\uDFFF]|\uD83B[\uDC71-\uDCB4]|\uD83C[\uDC00-\uDC2B\uDC30-\uDC93\uDCA0-\uDCAE\uDCB1-\uDCBF\uDCC1-\uDCCF\uDCD1-\uDCF5\uDD00-\uDD0C\uDD10-\uDD6B\uDD70-\uDDAC\uDDE6-\uDDFF\uDE01\uDE02\uDE10-\uDE3B\uDE40-\uDE48\uDE50\uDE51\uDE60-\uDE65\uDF00-\uDFFF]|\uD83D[\uDC00-\uDED4\uDEE0-\uDEEC\uDEF0-\uDEF9\uDF00-\uDF73\uDF80-\uDFD8]|\uD83E[\uDC00-\uDC0B\uDC10-\uDC47\uDC50-\uDC59\uDC60-\uDC87\uDC90-\uDCAD\uDD00-\uDD0B\uDD10-\uDD3E\uDD40-\uDD70\uDD73-\uDD76\uDD7A\uDD7C-\uDDA2\uDDB0-\uDDB9\uDDC0-\uDDC2\uDDD0-\uDDFF\uDE60-\uDE6D]|\uDB40[\uDC01\uDC20-\uDC7F]' + }, + { + 'name': 'Coptic', + 'bmp': '\u03E2-\u03EF\u2C80-\u2CF3\u2CF9-\u2CFF' + }, + { + 'name': 'Cuneiform', + 'astral': '\uD808[\uDC00-\uDF99]|\uD809[\uDC00-\uDC6E\uDC70-\uDC74\uDC80-\uDD43]' + }, + { + 'name': 'Cypriot', + 'astral': '\uD802[\uDC00-\uDC05\uDC08\uDC0A-\uDC35\uDC37\uDC38\uDC3C\uDC3F]' + }, + { + 'name': 'Cyrillic', + 'bmp': '\u0400-\u0484\u0487-\u052F\u1C80-\u1C88\u1D2B\u1D78\u2DE0-\u2DFF\uA640-\uA69F\uFE2E\uFE2F' + }, + { + 'name': 'Deseret', + 'astral': '\uD801[\uDC00-\uDC4F]' + }, + { + 'name': 'Devanagari', + 'bmp': '\u0900-\u0950\u0953-\u0963\u0966-\u097F\uA8E0-\uA8FF' + }, + { + 'name': 'Dogra', + 'astral': '\uD806[\uDC00-\uDC3B]' + }, + { + 'name': 'Duployan', + 'astral': '\uD82F[\uDC00-\uDC6A\uDC70-\uDC7C\uDC80-\uDC88\uDC90-\uDC99\uDC9C-\uDC9F]' + }, + { + 'name': 'Egyptian_Hieroglyphs', + 'astral': '\uD80C[\uDC00-\uDFFF]|\uD80D[\uDC00-\uDC2E]' + }, + { + 'name': 'Elbasan', + 'astral': '\uD801[\uDD00-\uDD27]' + }, + { + 'name': 'Ethiopic', + 'bmp': '\u1200-\u1248\u124A-\u124D\u1250-\u1256\u1258\u125A-\u125D\u1260-\u1288\u128A-\u128D\u1290-\u12B0\u12B2-\u12B5\u12B8-\u12BE\u12C0\u12C2-\u12C5\u12C8-\u12D6\u12D8-\u1310\u1312-\u1315\u1318-\u135A\u135D-\u137C\u1380-\u1399\u2D80-\u2D96\u2DA0-\u2DA6\u2DA8-\u2DAE\u2DB0-\u2DB6\u2DB8-\u2DBE\u2DC0-\u2DC6\u2DC8-\u2DCE\u2DD0-\u2DD6\u2DD8-\u2DDE\uAB01-\uAB06\uAB09-\uAB0E\uAB11-\uAB16\uAB20-\uAB26\uAB28-\uAB2E' + }, + { + 'name': 'Georgian', + 'bmp': '\u10A0-\u10C5\u10C7\u10CD\u10D0-\u10FA\u10FC-\u10FF\u1C90-\u1CBA\u1CBD-\u1CBF\u2D00-\u2D25\u2D27\u2D2D' + }, + { + 'name': 'Glagolitic', + 'bmp': '\u2C00-\u2C2E\u2C30-\u2C5E', + 'astral': '\uD838[\uDC00-\uDC06\uDC08-\uDC18\uDC1B-\uDC21\uDC23\uDC24\uDC26-\uDC2A]' + }, + { + 'name': 'Gothic', + 'astral': '\uD800[\uDF30-\uDF4A]' + }, + { + 'name': 'Grantha', + 'astral': '\uD804[\uDF00-\uDF03\uDF05-\uDF0C\uDF0F\uDF10\uDF13-\uDF28\uDF2A-\uDF30\uDF32\uDF33\uDF35-\uDF39\uDF3C-\uDF44\uDF47\uDF48\uDF4B-\uDF4D\uDF50\uDF57\uDF5D-\uDF63\uDF66-\uDF6C\uDF70-\uDF74]' + }, + { + 'name': 'Greek', + 'bmp': '\u0370-\u0373\u0375-\u0377\u037A-\u037D\u037F\u0384\u0386\u0388-\u038A\u038C\u038E-\u03A1\u03A3-\u03E1\u03F0-\u03FF\u1D26-\u1D2A\u1D5D-\u1D61\u1D66-\u1D6A\u1DBF\u1F00-\u1F15\u1F18-\u1F1D\u1F20-\u1F45\u1F48-\u1F4D\u1F50-\u1F57\u1F59\u1F5B\u1F5D\u1F5F-\u1F7D\u1F80-\u1FB4\u1FB6-\u1FC4\u1FC6-\u1FD3\u1FD6-\u1FDB\u1FDD-\u1FEF\u1FF2-\u1FF4\u1FF6-\u1FFE\u2126\uAB65', + 'astral': '\uD800[\uDD40-\uDD8E\uDDA0]|\uD834[\uDE00-\uDE45]' + }, + { + 'name': 'Gujarati', + 'bmp': '\u0A81-\u0A83\u0A85-\u0A8D\u0A8F-\u0A91\u0A93-\u0AA8\u0AAA-\u0AB0\u0AB2\u0AB3\u0AB5-\u0AB9\u0ABC-\u0AC5\u0AC7-\u0AC9\u0ACB-\u0ACD\u0AD0\u0AE0-\u0AE3\u0AE6-\u0AF1\u0AF9-\u0AFF' + }, + { + 'name': 'Gunjala_Gondi', + 'astral': '\uD807[\uDD60-\uDD65\uDD67\uDD68\uDD6A-\uDD8E\uDD90\uDD91\uDD93-\uDD98\uDDA0-\uDDA9]' + }, + { + 'name': 'Gurmukhi', + 'bmp': '\u0A01-\u0A03\u0A05-\u0A0A\u0A0F\u0A10\u0A13-\u0A28\u0A2A-\u0A30\u0A32\u0A33\u0A35\u0A36\u0A38\u0A39\u0A3C\u0A3E-\u0A42\u0A47\u0A48\u0A4B-\u0A4D\u0A51\u0A59-\u0A5C\u0A5E\u0A66-\u0A76' + }, + { + 'name': 'Han', + 'bmp': '\u2E80-\u2E99\u2E9B-\u2EF3\u2F00-\u2FD5\u3005\u3007\u3021-\u3029\u3038-\u303B\u3400-\u4DB5\u4E00-\u9FEF\uF900-\uFA6D\uFA70-\uFAD9', + 'astral': '[\uD840-\uD868\uD86A-\uD86C\uD86F-\uD872\uD874-\uD879][\uDC00-\uDFFF]|\uD869[\uDC00-\uDED6\uDF00-\uDFFF]|\uD86D[\uDC00-\uDF34\uDF40-\uDFFF]|\uD86E[\uDC00-\uDC1D\uDC20-\uDFFF]|\uD873[\uDC00-\uDEA1\uDEB0-\uDFFF]|\uD87A[\uDC00-\uDFE0]|\uD87E[\uDC00-\uDE1D]' + }, + { + 'name': 'Hangul', + 'bmp': '\u1100-\u11FF\u302E\u302F\u3131-\u318E\u3200-\u321E\u3260-\u327E\uA960-\uA97C\uAC00-\uD7A3\uD7B0-\uD7C6\uD7CB-\uD7FB\uFFA0-\uFFBE\uFFC2-\uFFC7\uFFCA-\uFFCF\uFFD2-\uFFD7\uFFDA-\uFFDC' + }, + { + 'name': 'Hanifi_Rohingya', + 'astral': '\uD803[\uDD00-\uDD27\uDD30-\uDD39]' + }, + { + 'name': 'Hanunoo', + 'bmp': '\u1720-\u1734' + }, + { + 'name': 'Hatran', + 'astral': '\uD802[\uDCE0-\uDCF2\uDCF4\uDCF5\uDCFB-\uDCFF]' + }, + { + 'name': 'Hebrew', + 'bmp': '\u0591-\u05C7\u05D0-\u05EA\u05EF-\u05F4\uFB1D-\uFB36\uFB38-\uFB3C\uFB3E\uFB40\uFB41\uFB43\uFB44\uFB46-\uFB4F' + }, + { + 'name': 'Hiragana', + 'bmp': '\u3041-\u3096\u309D-\u309F', + 'astral': '\uD82C[\uDC01-\uDD1E]|\uD83C\uDE00' + }, + { + 'name': 'Imperial_Aramaic', + 'astral': '\uD802[\uDC40-\uDC55\uDC57-\uDC5F]' + }, + { + 'name': 'Inherited', + 'bmp': '\u0300-\u036F\u0485\u0486\u064B-\u0655\u0670\u0951\u0952\u1AB0-\u1ABE\u1CD0-\u1CD2\u1CD4-\u1CE0\u1CE2-\u1CE8\u1CED\u1CF4\u1CF8\u1CF9\u1DC0-\u1DF9\u1DFB-\u1DFF\u200C\u200D\u20D0-\u20F0\u302A-\u302D\u3099\u309A\uFE00-\uFE0F\uFE20-\uFE2D', + 'astral': '\uD800[\uDDFD\uDEE0]|\uD804\uDF3B|\uD834[\uDD67-\uDD69\uDD7B-\uDD82\uDD85-\uDD8B\uDDAA-\uDDAD]|\uDB40[\uDD00-\uDDEF]' + }, + { + 'name': 'Inscriptional_Pahlavi', + 'astral': '\uD802[\uDF60-\uDF72\uDF78-\uDF7F]' + }, + { + 'name': 'Inscriptional_Parthian', + 'astral': '\uD802[\uDF40-\uDF55\uDF58-\uDF5F]' + }, + { + 'name': 'Javanese', + 'bmp': '\uA980-\uA9CD\uA9D0-\uA9D9\uA9DE\uA9DF' + }, + { + 'name': 'Kaithi', + 'astral': '\uD804[\uDC80-\uDCC1\uDCCD]' + }, + { + 'name': 'Kannada', + 'bmp': '\u0C80-\u0C8C\u0C8E-\u0C90\u0C92-\u0CA8\u0CAA-\u0CB3\u0CB5-\u0CB9\u0CBC-\u0CC4\u0CC6-\u0CC8\u0CCA-\u0CCD\u0CD5\u0CD6\u0CDE\u0CE0-\u0CE3\u0CE6-\u0CEF\u0CF1\u0CF2' + }, + { + 'name': 'Katakana', + 'bmp': '\u30A1-\u30FA\u30FD-\u30FF\u31F0-\u31FF\u32D0-\u32FE\u3300-\u3357\uFF66-\uFF6F\uFF71-\uFF9D', + 'astral': '\uD82C\uDC00' + }, + { + 'name': 'Kayah_Li', + 'bmp': '\uA900-\uA92D\uA92F' + }, + { + 'name': 'Kharoshthi', + 'astral': '\uD802[\uDE00-\uDE03\uDE05\uDE06\uDE0C-\uDE13\uDE15-\uDE17\uDE19-\uDE35\uDE38-\uDE3A\uDE3F-\uDE48\uDE50-\uDE58]' + }, + { + 'name': 'Khmer', + 'bmp': '\u1780-\u17DD\u17E0-\u17E9\u17F0-\u17F9\u19E0-\u19FF' + }, + { + 'name': 'Khojki', + 'astral': '\uD804[\uDE00-\uDE11\uDE13-\uDE3E]' + }, + { + 'name': 'Khudawadi', + 'astral': '\uD804[\uDEB0-\uDEEA\uDEF0-\uDEF9]' + }, + { + 'name': 'Lao', + 'bmp': '\u0E81\u0E82\u0E84\u0E87\u0E88\u0E8A\u0E8D\u0E94-\u0E97\u0E99-\u0E9F\u0EA1-\u0EA3\u0EA5\u0EA7\u0EAA\u0EAB\u0EAD-\u0EB9\u0EBB-\u0EBD\u0EC0-\u0EC4\u0EC6\u0EC8-\u0ECD\u0ED0-\u0ED9\u0EDC-\u0EDF' + }, + { + 'name': 'Latin', + 'bmp': 'A-Za-z\xAA\xBA\xC0-\xD6\xD8-\xF6\xF8-\u02B8\u02E0-\u02E4\u1D00-\u1D25\u1D2C-\u1D5C\u1D62-\u1D65\u1D6B-\u1D77\u1D79-\u1DBE\u1E00-\u1EFF\u2071\u207F\u2090-\u209C\u212A\u212B\u2132\u214E\u2160-\u2188\u2C60-\u2C7F\uA722-\uA787\uA78B-\uA7B9\uA7F7-\uA7FF\uAB30-\uAB5A\uAB5C-\uAB64\uFB00-\uFB06\uFF21-\uFF3A\uFF41-\uFF5A' + }, + { + 'name': 'Lepcha', + 'bmp': '\u1C00-\u1C37\u1C3B-\u1C49\u1C4D-\u1C4F' + }, + { + 'name': 'Limbu', + 'bmp': '\u1900-\u191E\u1920-\u192B\u1930-\u193B\u1940\u1944-\u194F' + }, + { + 'name': 'Linear_A', + 'astral': '\uD801[\uDE00-\uDF36\uDF40-\uDF55\uDF60-\uDF67]' + }, + { + 'name': 'Linear_B', + 'astral': '\uD800[\uDC00-\uDC0B\uDC0D-\uDC26\uDC28-\uDC3A\uDC3C\uDC3D\uDC3F-\uDC4D\uDC50-\uDC5D\uDC80-\uDCFA]' + }, + { + 'name': 'Lisu', + 'bmp': '\uA4D0-\uA4FF' + }, + { + 'name': 'Lycian', + 'astral': '\uD800[\uDE80-\uDE9C]' + }, + { + 'name': 'Lydian', + 'astral': '\uD802[\uDD20-\uDD39\uDD3F]' + }, + { + 'name': 'Mahajani', + 'astral': '\uD804[\uDD50-\uDD76]' + }, + { + 'name': 'Makasar', + 'astral': '\uD807[\uDEE0-\uDEF8]' + }, + { + 'name': 'Malayalam', + 'bmp': '\u0D00-\u0D03\u0D05-\u0D0C\u0D0E-\u0D10\u0D12-\u0D44\u0D46-\u0D48\u0D4A-\u0D4F\u0D54-\u0D63\u0D66-\u0D7F' + }, + { + 'name': 'Mandaic', + 'bmp': '\u0840-\u085B\u085E' + }, + { + 'name': 'Manichaean', + 'astral': '\uD802[\uDEC0-\uDEE6\uDEEB-\uDEF6]' + }, + { + 'name': 'Marchen', + 'astral': '\uD807[\uDC70-\uDC8F\uDC92-\uDCA7\uDCA9-\uDCB6]' + }, + { + 'name': 'Masaram_Gondi', + 'astral': '\uD807[\uDD00-\uDD06\uDD08\uDD09\uDD0B-\uDD36\uDD3A\uDD3C\uDD3D\uDD3F-\uDD47\uDD50-\uDD59]' + }, + { + 'name': 'Medefaidrin', + 'astral': '\uD81B[\uDE40-\uDE9A]' + }, + { + 'name': 'Meetei_Mayek', + 'bmp': '\uAAE0-\uAAF6\uABC0-\uABED\uABF0-\uABF9' + }, + { + 'name': 'Mende_Kikakui', + 'astral': '\uD83A[\uDC00-\uDCC4\uDCC7-\uDCD6]' + }, + { + 'name': 'Meroitic_Cursive', + 'astral': '\uD802[\uDDA0-\uDDB7\uDDBC-\uDDCF\uDDD2-\uDDFF]' + }, + { + 'name': 'Meroitic_Hieroglyphs', + 'astral': '\uD802[\uDD80-\uDD9F]' + }, + { + 'name': 'Miao', + 'astral': '\uD81B[\uDF00-\uDF44\uDF50-\uDF7E\uDF8F-\uDF9F]' + }, + { + 'name': 'Modi', + 'astral': '\uD805[\uDE00-\uDE44\uDE50-\uDE59]' + }, + { + 'name': 'Mongolian', + 'bmp': '\u1800\u1801\u1804\u1806-\u180E\u1810-\u1819\u1820-\u1878\u1880-\u18AA', + 'astral': '\uD805[\uDE60-\uDE6C]' + }, + { + 'name': 'Mro', + 'astral': '\uD81A[\uDE40-\uDE5E\uDE60-\uDE69\uDE6E\uDE6F]' + }, + { + 'name': 'Multani', + 'astral': '\uD804[\uDE80-\uDE86\uDE88\uDE8A-\uDE8D\uDE8F-\uDE9D\uDE9F-\uDEA9]' + }, + { + 'name': 'Myanmar', + 'bmp': '\u1000-\u109F\uA9E0-\uA9FE\uAA60-\uAA7F' + }, + { + 'name': 'Nabataean', + 'astral': '\uD802[\uDC80-\uDC9E\uDCA7-\uDCAF]' + }, + { + 'name': 'New_Tai_Lue', + 'bmp': '\u1980-\u19AB\u19B0-\u19C9\u19D0-\u19DA\u19DE\u19DF' + }, + { + 'name': 'Newa', + 'astral': '\uD805[\uDC00-\uDC59\uDC5B\uDC5D\uDC5E]' + }, + { + 'name': 'Nko', + 'bmp': '\u07C0-\u07FA\u07FD-\u07FF' + }, + { + 'name': 'Nushu', + 'astral': '\uD81B\uDFE1|\uD82C[\uDD70-\uDEFB]' + }, + { + 'name': 'Ogham', + 'bmp': '\u1680-\u169C' + }, + { + 'name': 'Ol_Chiki', + 'bmp': '\u1C50-\u1C7F' + }, + { + 'name': 'Old_Hungarian', + 'astral': '\uD803[\uDC80-\uDCB2\uDCC0-\uDCF2\uDCFA-\uDCFF]' + }, + { + 'name': 'Old_Italic', + 'astral': '\uD800[\uDF00-\uDF23\uDF2D-\uDF2F]' + }, + { + 'name': 'Old_North_Arabian', + 'astral': '\uD802[\uDE80-\uDE9F]' + }, + { + 'name': 'Old_Permic', + 'astral': '\uD800[\uDF50-\uDF7A]' + }, + { + 'name': 'Old_Persian', + 'astral': '\uD800[\uDFA0-\uDFC3\uDFC8-\uDFD5]' + }, + { + 'name': 'Old_Sogdian', + 'astral': '\uD803[\uDF00-\uDF27]' + }, + { + 'name': 'Old_South_Arabian', + 'astral': '\uD802[\uDE60-\uDE7F]' + }, + { + 'name': 'Old_Turkic', + 'astral': '\uD803[\uDC00-\uDC48]' + }, + { + 'name': 'Oriya', + 'bmp': '\u0B01-\u0B03\u0B05-\u0B0C\u0B0F\u0B10\u0B13-\u0B28\u0B2A-\u0B30\u0B32\u0B33\u0B35-\u0B39\u0B3C-\u0B44\u0B47\u0B48\u0B4B-\u0B4D\u0B56\u0B57\u0B5C\u0B5D\u0B5F-\u0B63\u0B66-\u0B77' + }, + { + 'name': 'Osage', + 'astral': '\uD801[\uDCB0-\uDCD3\uDCD8-\uDCFB]' + }, + { + 'name': 'Osmanya', + 'astral': '\uD801[\uDC80-\uDC9D\uDCA0-\uDCA9]' + }, + { + 'name': 'Pahawh_Hmong', + 'astral': '\uD81A[\uDF00-\uDF45\uDF50-\uDF59\uDF5B-\uDF61\uDF63-\uDF77\uDF7D-\uDF8F]' + }, + { + 'name': 'Palmyrene', + 'astral': '\uD802[\uDC60-\uDC7F]' + }, + { + 'name': 'Pau_Cin_Hau', + 'astral': '\uD806[\uDEC0-\uDEF8]' + }, + { + 'name': 'Phags_Pa', + 'bmp': '\uA840-\uA877' + }, + { + 'name': 'Phoenician', + 'astral': '\uD802[\uDD00-\uDD1B\uDD1F]' + }, + { + 'name': 'Psalter_Pahlavi', + 'astral': '\uD802[\uDF80-\uDF91\uDF99-\uDF9C\uDFA9-\uDFAF]' + }, + { + 'name': 'Rejang', + 'bmp': '\uA930-\uA953\uA95F' + }, + { + 'name': 'Runic', + 'bmp': '\u16A0-\u16EA\u16EE-\u16F8' + }, + { + 'name': 'Samaritan', + 'bmp': '\u0800-\u082D\u0830-\u083E' + }, + { + 'name': 'Saurashtra', + 'bmp': '\uA880-\uA8C5\uA8CE-\uA8D9' + }, + { + 'name': 'Sharada', + 'astral': '\uD804[\uDD80-\uDDCD\uDDD0-\uDDDF]' + }, + { + 'name': 'Shavian', + 'astral': '\uD801[\uDC50-\uDC7F]' + }, + { + 'name': 'Siddham', + 'astral': '\uD805[\uDD80-\uDDB5\uDDB8-\uDDDD]' + }, + { + 'name': 'SignWriting', + 'astral': '\uD836[\uDC00-\uDE8B\uDE9B-\uDE9F\uDEA1-\uDEAF]' + }, + { + 'name': 'Sinhala', + 'bmp': '\u0D82\u0D83\u0D85-\u0D96\u0D9A-\u0DB1\u0DB3-\u0DBB\u0DBD\u0DC0-\u0DC6\u0DCA\u0DCF-\u0DD4\u0DD6\u0DD8-\u0DDF\u0DE6-\u0DEF\u0DF2-\u0DF4', + 'astral': '\uD804[\uDDE1-\uDDF4]' + }, + { + 'name': 'Sogdian', + 'astral': '\uD803[\uDF30-\uDF59]' + }, + { + 'name': 'Sora_Sompeng', + 'astral': '\uD804[\uDCD0-\uDCE8\uDCF0-\uDCF9]' + }, + { + 'name': 'Soyombo', + 'astral': '\uD806[\uDE50-\uDE83\uDE86-\uDEA2]' + }, + { + 'name': 'Sundanese', + 'bmp': '\u1B80-\u1BBF\u1CC0-\u1CC7' + }, + { + 'name': 'Syloti_Nagri', + 'bmp': '\uA800-\uA82B' + }, + { + 'name': 'Syriac', + 'bmp': '\u0700-\u070D\u070F-\u074A\u074D-\u074F\u0860-\u086A' + }, + { + 'name': 'Tagalog', + 'bmp': '\u1700-\u170C\u170E-\u1714' + }, + { + 'name': 'Tagbanwa', + 'bmp': '\u1760-\u176C\u176E-\u1770\u1772\u1773' + }, + { + 'name': 'Tai_Le', + 'bmp': '\u1950-\u196D\u1970-\u1974' + }, + { + 'name': 'Tai_Tham', + 'bmp': '\u1A20-\u1A5E\u1A60-\u1A7C\u1A7F-\u1A89\u1A90-\u1A99\u1AA0-\u1AAD' + }, + { + 'name': 'Tai_Viet', + 'bmp': '\uAA80-\uAAC2\uAADB-\uAADF' + }, + { + 'name': 'Takri', + 'astral': '\uD805[\uDE80-\uDEB7\uDEC0-\uDEC9]' + }, + { + 'name': 'Tamil', + 'bmp': '\u0B82\u0B83\u0B85-\u0B8A\u0B8E-\u0B90\u0B92-\u0B95\u0B99\u0B9A\u0B9C\u0B9E\u0B9F\u0BA3\u0BA4\u0BA8-\u0BAA\u0BAE-\u0BB9\u0BBE-\u0BC2\u0BC6-\u0BC8\u0BCA-\u0BCD\u0BD0\u0BD7\u0BE6-\u0BFA' + }, + { + 'name': 'Tangut', + 'astral': '\uD81B\uDFE0|[\uD81C-\uD820][\uDC00-\uDFFF]|\uD821[\uDC00-\uDFF1]|\uD822[\uDC00-\uDEF2]' + }, + { + 'name': 'Telugu', + 'bmp': '\u0C00-\u0C0C\u0C0E-\u0C10\u0C12-\u0C28\u0C2A-\u0C39\u0C3D-\u0C44\u0C46-\u0C48\u0C4A-\u0C4D\u0C55\u0C56\u0C58-\u0C5A\u0C60-\u0C63\u0C66-\u0C6F\u0C78-\u0C7F' + }, + { + 'name': 'Thaana', + 'bmp': '\u0780-\u07B1' + }, + { + 'name': 'Thai', + 'bmp': '\u0E01-\u0E3A\u0E40-\u0E5B' + }, + { + 'name': 'Tibetan', + 'bmp': '\u0F00-\u0F47\u0F49-\u0F6C\u0F71-\u0F97\u0F99-\u0FBC\u0FBE-\u0FCC\u0FCE-\u0FD4\u0FD9\u0FDA' + }, + { + 'name': 'Tifinagh', + 'bmp': '\u2D30-\u2D67\u2D6F\u2D70\u2D7F' + }, + { + 'name': 'Tirhuta', + 'astral': '\uD805[\uDC80-\uDCC7\uDCD0-\uDCD9]' + }, + { + 'name': 'Ugaritic', + 'astral': '\uD800[\uDF80-\uDF9D\uDF9F]' + }, + { + 'name': 'Vai', + 'bmp': '\uA500-\uA62B' + }, + { + 'name': 'Warang_Citi', + 'astral': '\uD806[\uDCA0-\uDCF2\uDCFF]' + }, + { + 'name': 'Yi', + 'bmp': '\uA000-\uA48C\uA490-\uA4C6' + }, + { + 'name': 'Zanabazar_Square', + 'astral': '\uD806[\uDE00-\uDE47]' + } +]; + +var unicodeScripts = createCommonjsModule(function (module, exports) { +"use strict"; + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.default = void 0; + +var _scripts = _interopRequireDefault(scripts); + +function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } + +/*! + * XRegExp Unicode Scripts 4.2.0 + * + * Steven Levithan (c) 2010-present MIT License + * Unicode data by Mathias Bynens + */ +var _default = function _default(XRegExp) { + /** + * Adds support for all Unicode scripts. E.g., `\p{Latin}`. Token names are case insensitive, + * and any spaces, hyphens, and underscores are ignored. + * + * Uses Unicode 11.0.0. + * + * @requires XRegExp, Unicode Base + */ + if (!XRegExp.addUnicodeData) { + throw new ReferenceError('Unicode Base must be loaded before Unicode Scripts'); + } + + XRegExp.addUnicodeData(_scripts.default); +}; + +exports.default = _default; +module.exports = exports["default"]; +}); + +unwrapExports(unicodeScripts); + +var lib = createCommonjsModule(function (module, exports) { +"use strict"; + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.default = void 0; + +var _xregexp = _interopRequireDefault(xregexp); + +var _build = _interopRequireDefault(build); + +var _matchrecursive = _interopRequireDefault(matchrecursive); + +var _unicodeBase = _interopRequireDefault(unicodeBase); + +var _unicodeBlocks = _interopRequireDefault(unicodeBlocks); + +var _unicodeCategories = _interopRequireDefault(unicodeCategories); + +var _unicodeProperties = _interopRequireDefault(unicodeProperties); + +var _unicodeScripts = _interopRequireDefault(unicodeScripts); + +function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } + +(_build.default)(_xregexp.default); +(_matchrecursive.default)(_xregexp.default); +(_unicodeBase.default)(_xregexp.default); +(_unicodeBlocks.default)(_xregexp.default); +(_unicodeCategories.default)(_xregexp.default); +(_unicodeProperties.default)(_xregexp.default); +(_unicodeScripts.default)(_xregexp.default); +var _default = _xregexp.default; +exports.default = _default; +module.exports = exports["default"]; +}); + +unwrapExports(lib); + +var utilities = createCommonjsModule(function (module, exports) { +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); + +class FormatUtility { + static preProcess(query, toLower = true) { + if (toLower) { + query = query.toLowerCase(); + } + return query + .replace(/0/g, "0") + .replace(/1/g, "1") + .replace(/2/g, "2") + .replace(/3/g, "3") + .replace(/4/g, "4") + .replace(/5/g, "5") + .replace(/6/g, "6") + .replace(/7/g, "7") + .replace(/8/g, "8") + .replace(/9/g, "9") + .replace(/:/g, ":") + .replace(/-/g, "-") + .replace(/,/g, ",") + .replace(///g, "/") + .replace(/G/g, "G") + .replace(/M/g, "M") + .replace(/T/g, "T") + .replace(/K/g, "K") + .replace(/k/g, "k") + .replace(/./g, ".") + .replace(/(/g, "(") + .replace(/)/g, ")"); + } +} +exports.FormatUtility = FormatUtility; +class Match { + constructor(index, length, value, groups) { + this.index = index; + this.length = length; + this.value = value; + this.innerGroups = groups; + } + groups(key) { + return this.innerGroups[key] ? this.innerGroups[key] : { value: '', index: 0, length: 0, captures: [] }; + } +} +exports.Match = Match; +class RegExpUtility { + static getMatches(regex, source) { + if (!regex) + return []; + let rawRegex = regex.xregexp.source; + if (!rawRegex.includes('(?= 0) { + closePos = this.getClosePos(rawRegex, startPos); + let nlbRegex = lib(rawRegex.substring(startPos, closePos + 1), flags); + let nextRegex = RegExpUtility.getNextRegex(rawRegex, startPos); + nlbRegex.nextRegex = nextRegex ? lib(nextRegex, flags) : null; + negativeLookbehindRegexes.push(nlbRegex); + rawRegex = rawRegex.substr(0, startPos) + rawRegex.substr(closePos + 1); + startPos = rawRegex.indexOf('(? { + let clean = true; + negativeLookbehindRegexes.forEach(regex => { + let negativeLookbehindMatches = RegExpUtility.getMatchesSimple(regex, source); + negativeLookbehindMatches.forEach(negativeLookbehindMatch => { + let negativeLookbehindEnd = negativeLookbehindMatch.index + negativeLookbehindMatch.length; + let nextRegex = regex.nextRegex; + if (match.index === negativeLookbehindEnd) { + if (!nextRegex) { + clean = false; + return; + } + else { + let nextMatch = RegExpUtility.getFirstMatchIndex(nextRegex, source.substring(negativeLookbehindMatch.index)); + if (nextMatch.matched && ((nextMatch.index === negativeLookbehindMatch.length) || (source.includes(nextMatch.value + match.value)))) { + clean = false; + return; + } + } + } + if (negativeLookbehindMatch.value.includes(match.value)) { + let preMatches = RegExpUtility.getMatchesSimple(regex, source.substring(0, match.index)); + preMatches.forEach(preMatch => { + if (source.includes(preMatch.value + match.value)) { + clean = false; + return; + } + }); + } + }); + if (!clean) { + return; + } + }); + if (clean) { + realMatches.push(match); + } + }); + return realMatches; + } + static getMatchesSimple(regex, source) { + // Word boundary (\b) in JS is not unicode-aware, so words starting/ending with accentuated characters will not match + // use a normalized string to match, the return matches' values using the original one + // http://blog.stevenlevithan.com/archives/javascript-regex-and-unicode + // https://stackoverflow.com/questions/2881445/utf-8-word-boundary-regex-in-javascript + let normalized = StringUtility.removeDiacriticsFromWordBoundaries(source); + let matches = new Array(); + lib.forEach(normalized, regex, match => { + let positiveLookbehinds = []; + let groups = {}; + let lastGroup = ''; + Object.keys(match).forEach(key => { + if (!key.includes('__')) + return; + if (key.startsWith('plb') && match[key]) { + if (match[0].indexOf(match[key]) !== 0 && !StringUtility.isNullOrEmpty(lastGroup)) { + let index = match.index + match[0].indexOf(match[key]); + let length = match[key].length; + let value = source.substr(index, length); + groups[lastGroup].value = groups[lastGroup].value + value; + } + positiveLookbehinds.push({ key: key, value: match[key] }); + return; + } + if (key.startsWith('nlb')) { + return; + } + let groupKey = key.substr(0, key.lastIndexOf('__')); + lastGroup = groupKey; + if (!groups[groupKey]) + groups[groupKey] = { value: '', index: 0, length: 0, captures: [] }; + if (match[key]) { + let index = match.index + match[0].indexOf(match[key]); + let length = match[key].length; + let value = source.substr(index, length); + groups[groupKey].index = index; + groups[groupKey].length = length; + groups[groupKey].value = value; + groups[groupKey].captures.push(value); + } + }); + let value = match[0]; + let index = match.index; + let length = value.length; + if (positiveLookbehinds && positiveLookbehinds.length > 0 && value.indexOf(positiveLookbehinds[0].value) === 0) { + value = source.substr(index, length).substr(positiveLookbehinds[0].value.length); + index += positiveLookbehinds[0].value.length; + length -= positiveLookbehinds[0].value.length; + } + else { + value = source.substr(index, length); + } + matches.push(new Match(index, length, value, groups)); + }); + return matches; + } + static getSafeRegExp(source, flags) { + let sanitizedSource = this.sanitizeGroups(source); + return lib(sanitizedSource, flags || 'gis'); + } + static getFirstMatchIndex(regex, source) { + let matches = RegExpUtility.getMatches(regex, source); + if (matches.length) { + return { + matched: true, + index: matches[0].index, + value: matches[0].value + }; + } + return { matched: false, index: -1, value: null }; + } + static split(regex, source) { + return lib.split(source, regex); + } + static isMatch(regex, source) { + return !StringUtility.isNullOrEmpty(source) + && this.getMatches(regex, source).length > 0; + } + static sanitizeGroups(source) { + let index = 0; + let result = lib.replace(source, this.matchGroup, (match, name) => match.replace(name, `${name}__${index++}`)); + index = 0; + result = lib.replace(result, this.matchPositiveLookbehind, () => `(?`); + index = 0; + result = lib.replace(result, this.matchNegativeLookbehind, () => `(?`); + return result; + } + static getNextRegex(source, startPos) { + startPos = RegExpUtility.getClosePos(source, startPos) + 1; + let closePos = RegExpUtility.getClosePos(source, startPos); + if (source[startPos] !== '(') { + closePos--; + } + let next = (startPos === closePos) + ? null + : source.substring(startPos, closePos + 1); + return next; + } + static getClosePos(source, startPos) { + let counter = 1; + let closePos = startPos; + while (counter > 0 && closePos < source.length) { + let c = source[++closePos]; + if (c === '(') + counter++; + else if (c === ')') + counter--; + } + return closePos; + } +} +RegExpUtility.matchGroup = lib(String.raw `\?<(?\w+)>`, 'gis'); +RegExpUtility.matchPositiveLookbehind = lib(String.raw `\(\?<=`, 'gis'); +RegExpUtility.matchNegativeLookbehind = lib(String.raw `\(\? { + let length = s.length; + if (length === 0) + return s; + let first = StringUtility.removeDiacritics(s.substring(0, 1)); + if (length === 1) + return first; + let last = length > 1 ? StringUtility.removeDiacritics(s.substring(length - 1)) : ''; + let mid = s.substring(1, length - 1); + // console.log(first + mid + last) + return first + mid + last; + }) + .join(' '); + } + static removeDiacritics(c) { + let clean = StringUtility.diacriticsRemovalMap[c]; + return !clean ? c : clean; + } +} +StringUtility.diacriticsRemovalMap = { + "Ⓐ": "A", + "A": "A", + "À": "A", + "Á": "A", + "Â": "A", + "Ầ": "A", + "Ấ": "A", + "Ẫ": "A", + "Ẩ": "A", + "Ã": "A", + "Ā": "A", + "Ă": "A", + "Ằ": "A", + "Ắ": "A", + "Ẵ": "A", + "Ẳ": "A", + "Ȧ": "A", + "Ǡ": "A", + "Ä": "A", + "Ǟ": "A", + "Ả": "A", + "Å": "A", + "Ǻ": "A", + "Ǎ": "A", + "Ȁ": "A", + "Ȃ": "A", + "Ạ": "A", + "Ậ": "A", + "Ặ": "A", + "Ḁ": "A", + "Ą": "A", + "Ⱥ": "A", + "Ɐ": "A", + "Ⓑ": "B", + "B": "B", + "Ḃ": "B", + "Ḅ": "B", + "Ḇ": "B", + "Ƀ": "B", + "Ƃ": "B", + "Ɓ": "B", + "Ⓒ": "C", + "C": "C", + "Ć": "C", + "Ĉ": "C", + "Ċ": "C", + "Č": "C", + "Ç": "C", + "Ḉ": "C", + "Ƈ": "C", + "Ȼ": "C", + "Ꜿ": "C", + "Ⓓ": "D", + "D": "D", + "Ḋ": "D", + "Ď": "D", + "Ḍ": "D", + "Ḑ": "D", + "Ḓ": "D", + "Ḏ": "D", + "Đ": "D", + "Ƌ": "D", + "Ɗ": "D", + "Ɖ": "D", + "Ꝺ": "D", + "Ⓔ": "E", + "E": "E", + "È": "E", + "É": "E", + "Ê": "E", + "Ề": "E", + "Ế": "E", + "Ễ": "E", + "Ể": "E", + "Ẽ": "E", + "Ē": "E", + "Ḕ": "E", + "Ḗ": "E", + "Ĕ": "E", + "Ė": "E", + "Ë": "E", + "Ẻ": "E", + "Ě": "E", + "Ȅ": "E", + "Ȇ": "E", + "Ẹ": "E", + "Ệ": "E", + "Ȩ": "E", + "Ḝ": "E", + "Ę": "E", + "Ḙ": "E", + "Ḛ": "E", + "Ɛ": "E", + "Ǝ": "E", + "Ⓕ": "F", + "F": "F", + "Ḟ": "F", + "Ƒ": "F", + "Ꝼ": "F", + "Ⓖ": "G", + "G": "G", + "Ǵ": "G", + "Ĝ": "G", + "Ḡ": "G", + "Ğ": "G", + "Ġ": "G", + "Ǧ": "G", + "Ģ": "G", + "Ǥ": "G", + "Ɠ": "G", + "Ꞡ": "G", + "Ᵹ": "G", + "Ꝿ": "G", + "Ⓗ": "H", + "H": "H", + "Ĥ": "H", + "Ḣ": "H", + "Ḧ": "H", + "Ȟ": "H", + "Ḥ": "H", + "Ḩ": "H", + "Ḫ": "H", + "Ħ": "H", + "Ⱨ": "H", + "Ⱶ": "H", + "Ɥ": "H", + "Ⓘ": "I", + "I": "I", + "Ì": "I", + "Í": "I", + "Î": "I", + "Ĩ": "I", + "Ī": "I", + "Ĭ": "I", + "İ": "I", + "Ï": "I", + "Ḯ": "I", + "Ỉ": "I", + "Ǐ": "I", + "Ȉ": "I", + "Ȋ": "I", + "Ị": "I", + "Į": "I", + "Ḭ": "I", + "Ɨ": "I", + "Ⓙ": "J", + "J": "J", + "Ĵ": "J", + "Ɉ": "J", + "Ⓚ": "K", + "K": "K", + "Ḱ": "K", + "Ǩ": "K", + "Ḳ": "K", + "Ķ": "K", + "Ḵ": "K", + "Ƙ": "K", + "Ⱪ": "K", + "Ꝁ": "K", + "Ꝃ": "K", + "Ꝅ": "K", + "Ꞣ": "K", + "Ⓛ": "L", + "L": "L", + "Ŀ": "L", + "Ĺ": "L", + "Ľ": "L", + "Ḷ": "L", + "Ḹ": "L", + "Ļ": "L", + "Ḽ": "L", + "Ḻ": "L", + "Ł": "L", + "Ƚ": "L", + "Ɫ": "L", + "Ⱡ": "L", + "Ꝉ": "L", + "Ꝇ": "L", + "Ꞁ": "L", + "Ⓜ": "M", + "M": "M", + "Ḿ": "M", + "Ṁ": "M", + "Ṃ": "M", + "Ɱ": "M", + "Ɯ": "M", + "Ⓝ": "N", + "N": "N", + "Ǹ": "N", + "Ń": "N", + "Ñ": "N", + "Ṅ": "N", + "Ň": "N", + "Ṇ": "N", + "Ņ": "N", + "Ṋ": "N", + "Ṉ": "N", + "Ƞ": "N", + "Ɲ": "N", + "Ꞑ": "N", + "Ꞥ": "N", + "Ⓞ": "O", + "O": "O", + "Ò": "O", + "Ó": "O", + "Ô": "O", + "Ồ": "O", + "Ố": "O", + "Ỗ": "O", + "Ổ": "O", + "Õ": "O", + "Ṍ": "O", + "Ȭ": "O", + "Ṏ": "O", + "Ō": "O", + "Ṑ": "O", + "Ṓ": "O", + "Ŏ": "O", + "Ȯ": "O", + "Ȱ": "O", + "Ö": "O", + "Ȫ": "O", + "Ỏ": "O", + "Ő": "O", + "Ǒ": "O", + "Ȍ": "O", + "Ȏ": "O", + "Ơ": "O", + "Ờ": "O", + "Ớ": "O", + "Ỡ": "O", + "Ở": "O", + "Ợ": "O", + "Ọ": "O", + "Ộ": "O", + "Ǫ": "O", + "Ǭ": "O", + "Ø": "O", + "Ǿ": "O", + "Ɔ": "O", + "Ɵ": "O", + "Ꝋ": "O", + "Ꝍ": "O", + "Ⓟ": "P", + "P": "P", + "Ṕ": "P", + "Ṗ": "P", + "Ƥ": "P", + "Ᵽ": "P", + "Ꝑ": "P", + "Ꝓ": "P", + "Ꝕ": "P", + "Ⓠ": "Q", + "Q": "Q", + "Ꝗ": "Q", + "Ꝙ": "Q", + "Ɋ": "Q", + "Ⓡ": "R", + "R": "R", + "Ŕ": "R", + "Ṙ": "R", + "Ř": "R", + "Ȑ": "R", + "Ȓ": "R", + "Ṛ": "R", + "Ṝ": "R", + "Ŗ": "R", + "Ṟ": "R", + "Ɍ": "R", + "Ɽ": "R", + "Ꝛ": "R", + "Ꞧ": "R", + "Ꞃ": "R", + "Ⓢ": "S", + "S": "S", + "ẞ": "S", + "Ś": "S", + "Ṥ": "S", + "Ŝ": "S", + "Ṡ": "S", + "Š": "S", + "Ṧ": "S", + "Ṣ": "S", + "Ṩ": "S", + "Ș": "S", + "Ş": "S", + "Ȿ": "S", + "Ꞩ": "S", + "Ꞅ": "S", + "Ⓣ": "T", + "T": "T", + "Ṫ": "T", + "Ť": "T", + "Ṭ": "T", + "Ț": "T", + "Ţ": "T", + "Ṱ": "T", + "Ṯ": "T", + "Ŧ": "T", + "Ƭ": "T", + "Ʈ": "T", + "Ⱦ": "T", + "Ꞇ": "T", + "Ⓤ": "U", + "U": "U", + "Ù": "U", + "Ú": "U", + "Û": "U", + "Ũ": "U", + "Ṹ": "U", + "Ū": "U", + "Ṻ": "U", + "Ŭ": "U", + "Ü": "U", + "Ǜ": "U", + "Ǘ": "U", + "Ǖ": "U", + "Ǚ": "U", + "Ủ": "U", + "Ů": "U", + "Ű": "U", + "Ǔ": "U", + "Ȕ": "U", + "Ȗ": "U", + "Ư": "U", + "Ừ": "U", + "Ứ": "U", + "Ữ": "U", + "Ử": "U", + "Ự": "U", + "Ụ": "U", + "Ṳ": "U", + "Ų": "U", + "Ṷ": "U", + "Ṵ": "U", + "Ʉ": "U", + "Ⓥ": "V", + "V": "V", + "Ṽ": "V", + "Ṿ": "V", + "Ʋ": "V", + "Ꝟ": "V", + "Ʌ": "V", + "Ⓦ": "W", + "W": "W", + "Ẁ": "W", + "Ẃ": "W", + "Ŵ": "W", + "Ẇ": "W", + "Ẅ": "W", + "Ẉ": "W", + "Ⱳ": "W", + "Ⓧ": "X", + "X": "X", + "Ẋ": "X", + "Ẍ": "X", + "Ⓨ": "Y", + "Y": "Y", + "Ỳ": "Y", + "Ý": "Y", + "Ŷ": "Y", + "Ỹ": "Y", + "Ȳ": "Y", + "Ẏ": "Y", + "Ÿ": "Y", + "Ỷ": "Y", + "Ỵ": "Y", + "Ƴ": "Y", + "Ɏ": "Y", + "Ỿ": "Y", + "Ⓩ": "Z", + "Z": "Z", + "Ź": "Z", + "Ẑ": "Z", + "Ż": "Z", + "Ž": "Z", + "Ẓ": "Z", + "Ẕ": "Z", + "Ƶ": "Z", + "Ȥ": "Z", + "Ɀ": "Z", + "Ⱬ": "Z", + "Ꝣ": "Z", + "ⓐ": "a", + "a": "a", + "ẚ": "a", + "à": "a", + "á": "a", + "â": "a", + "ầ": "a", + "ấ": "a", + "ẫ": "a", + "ẩ": "a", + "ã": "a", + "ā": "a", + "ă": "a", + "ằ": "a", + "ắ": "a", + "ẵ": "a", + "ẳ": "a", + "ȧ": "a", + "ǡ": "a", + "ä": "a", + "ǟ": "a", + "ả": "a", + "å": "a", + "ǻ": "a", + "ǎ": "a", + "ȁ": "a", + "ȃ": "a", + "ạ": "a", + "ậ": "a", + "ặ": "a", + "ḁ": "a", + "ą": "a", + "ⱥ": "a", + "ɐ": "a", + "ⓑ": "b", + "b": "b", + "ḃ": "b", + "ḅ": "b", + "ḇ": "b", + "ƀ": "b", + "ƃ": "b", + "ɓ": "b", + "ⓒ": "c", + "c": "c", + "ć": "c", + "ĉ": "c", + "ċ": "c", + "č": "c", + "ç": "c", + "ḉ": "c", + "ƈ": "c", + "ȼ": "c", + "ꜿ": "c", + "ↄ": "c", + "ⓓ": "d", + "d": "d", + "ḋ": "d", + "ď": "d", + "ḍ": "d", + "ḑ": "d", + "ḓ": "d", + "ḏ": "d", + "đ": "d", + "ƌ": "d", + "ɖ": "d", + "ɗ": "d", + "ꝺ": "d", + "ⓔ": "e", + "e": "e", + "è": "e", + "é": "e", + "ê": "e", + "ề": "e", + "ế": "e", + "ễ": "e", + "ể": "e", + "ẽ": "e", + "ē": "e", + "ḕ": "e", + "ḗ": "e", + "ĕ": "e", + "ė": "e", + "ë": "e", + "ẻ": "e", + "ě": "e", + "ȅ": "e", + "ȇ": "e", + "ẹ": "e", + "ệ": "e", + "ȩ": "e", + "ḝ": "e", + "ę": "e", + "ḙ": "e", + "ḛ": "e", + "ɇ": "e", + "ɛ": "e", + "ǝ": "e", + "ⓕ": "f", + "f": "f", + "ḟ": "f", + "ƒ": "f", + "ꝼ": "f", + "ⓖ": "g", + "g": "g", + "ǵ": "g", + "ĝ": "g", + "ḡ": "g", + "ğ": "g", + "ġ": "g", + "ǧ": "g", + "ģ": "g", + "ǥ": "g", + "ɠ": "g", + "ꞡ": "g", + "ᵹ": "g", + "ꝿ": "g", + "ⓗ": "h", + "h": "h", + "ĥ": "h", + "ḣ": "h", + "ḧ": "h", + "ȟ": "h", + "ḥ": "h", + "ḩ": "h", + "ḫ": "h", + "ẖ": "h", + "ħ": "h", + "ⱨ": "h", + "ⱶ": "h", + "ɥ": "h", + "ⓘ": "i", + "i": "i", + "ì": "i", + "í": "i", + "î": "i", + "ĩ": "i", + "ī": "i", + "ĭ": "i", + "ï": "i", + "ḯ": "i", + "ỉ": "i", + "ǐ": "i", + "ȉ": "i", + "ȋ": "i", + "ị": "i", + "į": "i", + "ḭ": "i", + "ɨ": "i", + "ı": "i", + "ⓙ": "j", + "j": "j", + "ĵ": "j", + "ǰ": "j", + "ɉ": "j", + "ⓚ": "k", + "k": "k", + "ḱ": "k", + "ǩ": "k", + "ḳ": "k", + "ķ": "k", + "ḵ": "k", + "ƙ": "k", + "ⱪ": "k", + "ꝁ": "k", + "ꝃ": "k", + "ꝅ": "k", + "ꞣ": "k", + "ⓛ": "l", + "l": "l", + "ŀ": "l", + "ĺ": "l", + "ľ": "l", + "ḷ": "l", + "ḹ": "l", + "ļ": "l", + "ḽ": "l", + "ḻ": "l", + "ſ": "l", + "ł": "l", + "ƚ": "l", + "ɫ": "l", + "ⱡ": "l", + "ꝉ": "l", + "ꞁ": "l", + "ꝇ": "l", + "ⓜ": "m", + "m": "m", + "ḿ": "m", + "ṁ": "m", + "ṃ": "m", + "ɱ": "m", + "ɯ": "m", + "ⓝ": "n", + "n": "n", + "ǹ": "n", + "ń": "n", + "ñ": "n", + "ṅ": "n", + "ň": "n", + "ṇ": "n", + "ņ": "n", + "ṋ": "n", + "ṉ": "n", + "ƞ": "n", + "ɲ": "n", + "ʼn": "n", + "ꞑ": "n", + "ꞥ": "n", + "ⓞ": "o", + "o": "o", + "ò": "o", + "ó": "o", + "ô": "o", + "ồ": "o", + "ố": "o", + "ỗ": "o", + "ổ": "o", + "õ": "o", + "ṍ": "o", + "ȭ": "o", + "ṏ": "o", + "ō": "o", + "ṑ": "o", + "ṓ": "o", + "ŏ": "o", + "ȯ": "o", + "ȱ": "o", + "ö": "o", + "ȫ": "o", + "ỏ": "o", + "ő": "o", + "ǒ": "o", + "ȍ": "o", + "ȏ": "o", + "ơ": "o", + "ờ": "o", + "ớ": "o", + "ỡ": "o", + "ở": "o", + "ợ": "o", + "ọ": "o", + "ộ": "o", + "ǫ": "o", + "ǭ": "o", + "ø": "o", + "ǿ": "o", + "ɔ": "o", + "ꝋ": "o", + "ꝍ": "o", + "ɵ": "o", + "ⓟ": "p", + "p": "p", + "ṕ": "p", + "ṗ": "p", + "ƥ": "p", + "ᵽ": "p", + "ꝑ": "p", + "ꝓ": "p", + "ꝕ": "p", + "ⓠ": "q", + "q": "q", + "ɋ": "q", + "ꝗ": "q", + "ꝙ": "q", + "ⓡ": "r", + "r": "r", + "ŕ": "r", + "ṙ": "r", + "ř": "r", + "ȑ": "r", + "ȓ": "r", + "ṛ": "r", + "ṝ": "r", + "ŗ": "r", + "ṟ": "r", + "ɍ": "r", + "ɽ": "r", + "ꝛ": "r", + "ꞧ": "r", + "ꞃ": "r", + "ⓢ": "s", + "s": "s", + "ß": "s", + "ś": "s", + "ṥ": "s", + "ŝ": "s", + "ṡ": "s", + "š": "s", + "ṧ": "s", + "ṣ": "s", + "ṩ": "s", + "ș": "s", + "ş": "s", + "ȿ": "s", + "ꞩ": "s", + "ꞅ": "s", + "ẛ": "s", + "ⓣ": "t", + "t": "t", + "ṫ": "t", + "ẗ": "t", + "ť": "t", + "ṭ": "t", + "ț": "t", + "ţ": "t", + "ṱ": "t", + "ṯ": "t", + "ŧ": "t", + "ƭ": "t", + "ʈ": "t", + "ⱦ": "t", + "ꞇ": "t", + "ⓤ": "u", + "u": "u", + "ù": "u", + "ú": "u", + "û": "u", + "ũ": "u", + "ṹ": "u", + "ū": "u", + "ṻ": "u", + "ŭ": "u", + "ü": "u", + "ǜ": "u", + "ǘ": "u", + "ǖ": "u", + "ǚ": "u", + "ủ": "u", + "ů": "u", + "ű": "u", + "ǔ": "u", + "ȕ": "u", + "ȗ": "u", + "ư": "u", + "ừ": "u", + "ứ": "u", + "ữ": "u", + "ử": "u", + "ự": "u", + "ụ": "u", + "ṳ": "u", + "ų": "u", + "ṷ": "u", + "ṵ": "u", + "ʉ": "u", + "ⓥ": "v", + "v": "v", + "ṽ": "v", + "ṿ": "v", + "ʋ": "v", + "ꝟ": "v", + "ʌ": "v", + "ⓦ": "w", + "w": "w", + "ẁ": "w", + "ẃ": "w", + "ŵ": "w", + "ẇ": "w", + "ẅ": "w", + "ẘ": "w", + "ẉ": "w", + "ⱳ": "w", + "ⓧ": "x", + "x": "x", + "ẋ": "x", + "ẍ": "x", + "ⓨ": "y", + "y": "y", + "ỳ": "y", + "ý": "y", + "ŷ": "y", + "ỹ": "y", + "ȳ": "y", + "ẏ": "y", + "ÿ": "y", + "ỷ": "y", + "ẙ": "y", + "ỵ": "y", + "ƴ": "y", + "ɏ": "y", + "ỿ": "y", + "ⓩ": "z", + "z": "z", + "ź": "z", + "ẑ": "z", + "ż": "z", + "ž": "z", + "ẓ": "z", + "ẕ": "z", + "ƶ": "z", + "ȥ": "z", + "ɀ": "z", + "ⱬ": "z", + "ꝣ": "z" +}; +exports.StringUtility = StringUtility; + +}); + +unwrapExports(utilities); + +var models = createCommonjsModule(function (module, exports) { +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); + + +class ModelResult { +} +exports.ModelResult = ModelResult; +class ExtendedModelResult extends ModelResult { + constructor(source = null) { + super(); + if (source) { + this.text = source.text; + this.start = source.start; + this.end = source.end; + this.typeName = source.typeName; + this.resolution = source.resolution; + } + } +} +exports.ExtendedModelResult = ExtendedModelResult; +class ModelFactoryKey { + constructor(culture$$1, modelType, options = null) { + this.culture = culture$$1 ? culture$$1.toLowerCase() : null; + this.modelType = modelType; + this.options = options; + } + toString() { + return JSON.stringify(this); + } + static fromString(key) { + return JSON.parse(key); + } +} +class ModelFactory { + constructor() { + this.modelFactories = new Map(); + } + getModel(modelTypeName, culture$$1, fallbackToDefaultCulture, options) { + let result = this.tryGetModel(modelTypeName, culture$$1, options); + if (!result.containsModel && fallbackToDefaultCulture) { + result = this.tryGetModel(modelTypeName, ModelFactory.fallbackCulture, options); + } + if (result.containsModel) { + return result.model; + } + throw new Error(`Could not find Model with the specified configuration: ${culture$$1},${modelTypeName}`); + } + tryGetModel(modelTypeName, culture$$1, options) { + culture$$1 = culture.Culture.mapToNearestLanguage(culture$$1); + let cacheResult = this.getModelFromCache(modelTypeName, culture$$1, options); + if (cacheResult) + return { containsModel: true, model: cacheResult }; + let key = this.generateKey(modelTypeName, culture$$1); + if (this.modelFactories.has(key)) { + let model = this.modelFactories.get(key)(options); + this.registerModelInCache(modelTypeName, culture$$1, options, model); + return { containsModel: true, model: model }; + } + return { containsModel: false }; + } + registerModel(modelTypeName, culture$$1, modelCreator) { + let key = this.generateKey(modelTypeName, culture$$1); + if (this.modelFactories.has(key)) { + throw new Error(`${culture$$1}-${modelTypeName} has already been registered.`); + } + this.modelFactories.set(key, modelCreator); + } + initializeModels(targetCulture, options) { + this.modelFactories.forEach((value, key) => { + let modelFactoryKey = ModelFactoryKey.fromString(key); + if (utilities.StringUtility.isNullOrEmpty(targetCulture) || modelFactoryKey.culture === targetCulture) { + this.tryGetModel(modelFactoryKey.modelType, modelFactoryKey.culture, modelFactoryKey.options); + } + }); + } + generateKey(modelTypeName, culture$$1) { + return new ModelFactoryKey(culture$$1, modelTypeName).toString(); + } + getModelFromCache(modelTypeName, culture$$1, options) { + let key = this.generateCacheKey(modelTypeName, culture$$1, options); + return ModelFactory.cache.get(key); + } + registerModelInCache(modelTypeName, culture$$1, options, model) { + let key = this.generateCacheKey(modelTypeName, culture$$1, options); + ModelFactory.cache.set(key, model); + } + generateCacheKey(modelTypeName, culture$$1, options) { + return new ModelFactoryKey(culture$$1, modelTypeName, options).toString(); + } +} +ModelFactory.fallbackCulture = culture.Culture.English; +ModelFactory.cache = new Map(); +exports.ModelFactory = ModelFactory; + +}); + +unwrapExports(models); + +var recognizer = createCommonjsModule(function (module, exports) { +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); + +class Recognizer { + constructor(targetCulture, options, lazyInitialization) { + this.modelFactory = new models.ModelFactory(); + if (!this.IsValidOptions(options)) + throw new Error(`${options} is not a valid options value.`); + this.TargetCulture = targetCulture; + this.Options = options; + this.InitializeConfiguration(); + if (!lazyInitialization) { + this.initializeModels(targetCulture, options); + } + } + getModel(modelTypeName, culture, fallbackToDefaultCulture) { + return this.modelFactory.getModel(modelTypeName, culture || this.TargetCulture, fallbackToDefaultCulture, this.Options); + } + registerModel(modelTypeName, culture, modelCreator) { + this.modelFactory.registerModel(modelTypeName, culture, modelCreator); + } + initializeModels(targetCulture, options) { + this.modelFactory.initializeModels(targetCulture, options); + } +} +exports.Recognizer = Recognizer; + +}); + +unwrapExports(recognizer); + +var extractors = createCommonjsModule(function (module, exports) { +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +class ExtractResult { + static isOverlap(erA, erB) { + return !(erA.start >= erB.start + erB.length) && !(erB.start >= erA.start + erA.length); + } + static isCover(er1, er2) { + return ((er2.start < er1.start) && ((er2.start + er2.length) >= (er1.start + er1.length))) + || ((er2.start <= er1.start) && ((er2.start + er2.length) > (er1.start + er1.length))); + } + static getFromText(source) { + return { + start: 0, + length: source.length, + text: source, + type: 'custom' + }; + } +} +exports.ExtractResult = ExtractResult; + +}); + +unwrapExports(extractors); + +var parsers = createCommonjsModule(function (module, exports) { +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); + +class ParseResult extends extractors.ExtractResult { + constructor(er) { + super(); + if (er) { + this.length = er.length; + this.start = er.start; + this.data = er.data; + this.text = er.text; + this.type = er.type; + } + this.resolutionStr = ""; + } +} +exports.ParseResult = ParseResult; + +}); + +unwrapExports(parsers); + +var recognizersText = createCommonjsModule(function (module, exports) { +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); + +exports.Culture = culture.Culture; +exports.CultureInfo = culture.CultureInfo; + +exports.ModelResult = models.ModelResult; +exports.ModelFactory = models.ModelFactory; + +exports.Recognizer = recognizer.Recognizer; + +exports.ExtractResult = extractors.ExtractResult; + +exports.ParseResult = parsers.ParseResult; + +exports.FormatUtility = utilities.FormatUtility; +exports.StringUtility = utilities.StringUtility; +exports.Match = utilities.Match; +exports.RegExpUtility = utilities.RegExpUtility; + +}); + +unwrapExports(recognizersText); + +/** + * lodash (Custom Build) + * Build: `lodash modularize exports="npm" -o ./` + * Copyright jQuery Foundation and other contributors + * Released under MIT license + * Based on Underscore.js 1.8.3 + * Copyright Jeremy Ashkenas, DocumentCloud and Investigative Reporters & Editors + */ + +/** Used as references for various `Number` constants. */ +var INFINITY = 1 / 0; + +/** `Object#toString` result references. */ +var symbolTag = '[object Symbol]'; + +/** Used to match leading and trailing whitespace. */ +var reTrimEnd = /\s+$/; + +/** Used to compose unicode character classes. */ +var rsAstralRange = '\\ud800-\\udfff'; +var rsComboMarksRange = '\\u0300-\\u036f\\ufe20-\\ufe23'; +var rsComboSymbolsRange = '\\u20d0-\\u20f0'; +var rsVarRange = '\\ufe0e\\ufe0f'; + +/** Used to compose unicode capture groups. */ +var rsAstral = '[' + rsAstralRange + ']'; +var rsCombo = '[' + rsComboMarksRange + rsComboSymbolsRange + ']'; +var rsFitz = '\\ud83c[\\udffb-\\udfff]'; +var rsModifier = '(?:' + rsCombo + '|' + rsFitz + ')'; +var rsNonAstral = '[^' + rsAstralRange + ']'; +var rsRegional = '(?:\\ud83c[\\udde6-\\uddff]){2}'; +var rsSurrPair = '[\\ud800-\\udbff][\\udc00-\\udfff]'; +var rsZWJ = '\\u200d'; + +/** Used to compose unicode regexes. */ +var reOptMod = rsModifier + '?'; +var rsOptVar = '[' + rsVarRange + ']?'; +var rsOptJoin = '(?:' + rsZWJ + '(?:' + [rsNonAstral, rsRegional, rsSurrPair].join('|') + ')' + rsOptVar + reOptMod + ')*'; +var rsSeq = rsOptVar + reOptMod + rsOptJoin; +var rsSymbol = '(?:' + [rsNonAstral + rsCombo + '?', rsCombo, rsRegional, rsSurrPair, rsAstral].join('|') + ')'; + +/** Used to match [string symbols](https://mathiasbynens.be/notes/javascript-unicode). */ +var reUnicode = RegExp(rsFitz + '(?=' + rsFitz + ')|' + rsSymbol + rsSeq, 'g'); + +/** Used to detect strings with [zero-width joiners or code points from the astral planes](http://eev.ee/blog/2015/09/12/dark-corners-of-unicode/). */ +var reHasUnicode = RegExp('[' + rsZWJ + rsAstralRange + rsComboMarksRange + rsComboSymbolsRange + rsVarRange + ']'); + +/** Detect free variable `global` from Node.js. */ +var freeGlobal = typeof commonjsGlobal == 'object' && commonjsGlobal && commonjsGlobal.Object === Object && commonjsGlobal; + +/** Detect free variable `self`. */ +var freeSelf = typeof self == 'object' && self && self.Object === Object && self; + +/** Used as a reference to the global object. */ +var root = freeGlobal || freeSelf || Function('return this')(); + +/** + * Converts an ASCII `string` to an array. + * + * @private + * @param {string} string The string to convert. + * @returns {Array} Returns the converted array. + */ +function asciiToArray(string) { + return string.split(''); +} + +/** + * The base implementation of `_.findIndex` and `_.findLastIndex` without + * support for iteratee shorthands. + * + * @private + * @param {Array} array The array to inspect. + * @param {Function} predicate The function invoked per iteration. + * @param {number} fromIndex The index to search from. + * @param {boolean} [fromRight] Specify iterating from right to left. + * @returns {number} Returns the index of the matched value, else `-1`. + */ +function baseFindIndex(array, predicate, fromIndex, fromRight) { + var length = array.length, + index = fromIndex + (fromRight ? 1 : -1); + + while ((fromRight ? index-- : ++index < length)) { + if (predicate(array[index], index, array)) { + return index; + } + } + return -1; +} + +/** + * The base implementation of `_.indexOf` without `fromIndex` bounds checks. + * + * @private + * @param {Array} array The array to inspect. + * @param {*} value The value to search for. + * @param {number} fromIndex The index to search from. + * @returns {number} Returns the index of the matched value, else `-1`. + */ +function baseIndexOf(array, value, fromIndex) { + if (value !== value) { + return baseFindIndex(array, baseIsNaN, fromIndex); + } + var index = fromIndex - 1, + length = array.length; + + while (++index < length) { + if (array[index] === value) { + return index; + } + } + return -1; +} + +/** + * The base implementation of `_.isNaN` without support for number objects. + * + * @private + * @param {*} value The value to check. + * @returns {boolean} Returns `true` if `value` is `NaN`, else `false`. + */ +function baseIsNaN(value) { + return value !== value; +} + +/** + * Used by `_.trim` and `_.trimEnd` to get the index of the last string symbol + * that is not found in the character symbols. + * + * @private + * @param {Array} strSymbols The string symbols to inspect. + * @param {Array} chrSymbols The character symbols to find. + * @returns {number} Returns the index of the last unmatched string symbol. + */ +function charsEndIndex(strSymbols, chrSymbols) { + var index = strSymbols.length; + + while (index-- && baseIndexOf(chrSymbols, strSymbols[index], 0) > -1) {} + return index; +} + +/** + * Checks if `string` contains Unicode symbols. + * + * @private + * @param {string} string The string to inspect. + * @returns {boolean} Returns `true` if a symbol is found, else `false`. + */ +function hasUnicode(string) { + return reHasUnicode.test(string); +} + +/** + * Converts `string` to an array. + * + * @private + * @param {string} string The string to convert. + * @returns {Array} Returns the converted array. + */ +function stringToArray(string) { + return hasUnicode(string) + ? unicodeToArray(string) + : asciiToArray(string); +} + +/** + * Converts a Unicode `string` to an array. + * + * @private + * @param {string} string The string to convert. + * @returns {Array} Returns the converted array. + */ +function unicodeToArray(string) { + return string.match(reUnicode) || []; +} + +/** Used for built-in method references. */ +var objectProto = Object.prototype; + +/** + * Used to resolve the + * [`toStringTag`](http://ecma-international.org/ecma-262/7.0/#sec-object.prototype.tostring) + * of values. + */ +var objectToString = objectProto.toString; + +/** Built-in value references. */ +var Symbol$1 = root.Symbol; + +/** Used to convert symbols to primitives and strings. */ +var symbolProto = Symbol$1 ? Symbol$1.prototype : undefined; +var symbolToString = symbolProto ? symbolProto.toString : undefined; + +/** + * The base implementation of `_.slice` without an iteratee call guard. + * + * @private + * @param {Array} array The array to slice. + * @param {number} [start=0] The start position. + * @param {number} [end=array.length] The end position. + * @returns {Array} Returns the slice of `array`. + */ +function baseSlice(array, start, end) { + var index = -1, + length = array.length; + + if (start < 0) { + start = -start > length ? 0 : (length + start); + } + end = end > length ? length : end; + if (end < 0) { + end += length; + } + length = start > end ? 0 : ((end - start) >>> 0); + start >>>= 0; + + var result = Array(length); + while (++index < length) { + result[index] = array[index + start]; + } + return result; +} + +/** + * The base implementation of `_.toString` which doesn't convert nullish + * values to empty strings. + * + * @private + * @param {*} value The value to process. + * @returns {string} Returns the string. + */ +function baseToString(value) { + // Exit early for strings to avoid a performance hit in some environments. + if (typeof value == 'string') { + return value; + } + if (isSymbol(value)) { + return symbolToString ? symbolToString.call(value) : ''; + } + var result = (value + ''); + return (result == '0' && (1 / value) == -INFINITY) ? '-0' : result; +} + +/** + * Casts `array` to a slice if it's needed. + * + * @private + * @param {Array} array The array to inspect. + * @param {number} start The start position. + * @param {number} [end=array.length] The end position. + * @returns {Array} Returns the cast slice. + */ +function castSlice(array, start, end) { + var length = array.length; + end = end === undefined ? length : end; + return (!start && end >= length) ? array : baseSlice(array, start, end); +} + +/** + * Checks if `value` is object-like. A value is object-like if it's not `null` + * and has a `typeof` result of "object". + * + * @static + * @memberOf _ + * @since 4.0.0 + * @category Lang + * @param {*} value The value to check. + * @returns {boolean} Returns `true` if `value` is object-like, else `false`. + * @example + * + * _.isObjectLike({}); + * // => true + * + * _.isObjectLike([1, 2, 3]); + * // => true + * + * _.isObjectLike(_.noop); + * // => false + * + * _.isObjectLike(null); + * // => false + */ +function isObjectLike(value) { + return !!value && typeof value == 'object'; +} + +/** + * Checks if `value` is classified as a `Symbol` primitive or object. + * + * @static + * @memberOf _ + * @since 4.0.0 + * @category Lang + * @param {*} value The value to check. + * @returns {boolean} Returns `true` if `value` is a symbol, else `false`. + * @example + * + * _.isSymbol(Symbol.iterator); + * // => true + * + * _.isSymbol('abc'); + * // => false + */ +function isSymbol(value) { + return typeof value == 'symbol' || + (isObjectLike(value) && objectToString.call(value) == symbolTag); +} + +/** + * Converts `value` to a string. An empty string is returned for `null` + * and `undefined` values. The sign of `-0` is preserved. + * + * @static + * @memberOf _ + * @since 4.0.0 + * @category Lang + * @param {*} value The value to process. + * @returns {string} Returns the string. + * @example + * + * _.toString(null); + * // => '' + * + * _.toString(-0); + * // => '-0' + * + * _.toString([1, 2, 3]); + * // => '1,2,3' + */ +function toString(value) { + return value == null ? '' : baseToString(value); +} + +/** + * Removes trailing whitespace or specified characters from `string`. + * + * @static + * @memberOf _ + * @since 4.0.0 + * @category String + * @param {string} [string=''] The string to trim. + * @param {string} [chars=whitespace] The characters to trim. + * @param- {Object} [guard] Enables use as an iteratee for methods like `_.map`. + * @returns {string} Returns the trimmed string. + * @example + * + * _.trimEnd(' abc '); + * // => ' abc' + * + * _.trimEnd('-_-abc-_-', '_-'); + * // => '-_-abc' + */ +function trimEnd(string, chars, guard) { + string = toString(string); + if (string && (guard || chars === undefined)) { + return string.replace(reTrimEnd, ''); + } + if (!string || !(chars = baseToString(chars))) { + return string; + } + var strSymbols = stringToArray(string), + end = charsEndIndex(strSymbols, stringToArray(chars)) + 1; + + return castSlice(strSymbols, 0, end).join(''); +} + +var lodash_trimend = trimEnd; + +var bignumber = createCommonjsModule(function (module) { +(function (globalObject) { + 'use strict'; + +/* + * bignumber.js v7.2.1 + * A JavaScript library for arbitrary-precision arithmetic. + * https://github.com/MikeMcl/bignumber.js + * Copyright (c) 2018 Michael Mclaughlin + * MIT Licensed. + * + * BigNumber.prototype methods | BigNumber methods + * | + * absoluteValue abs | clone + * comparedTo | config set + * decimalPlaces dp | DECIMAL_PLACES + * dividedBy div | ROUNDING_MODE + * dividedToIntegerBy idiv | EXPONENTIAL_AT + * exponentiatedBy pow | RANGE + * integerValue | CRYPTO + * isEqualTo eq | MODULO_MODE + * isFinite | POW_PRECISION + * isGreaterThan gt | FORMAT + * isGreaterThanOrEqualTo gte | ALPHABET + * isInteger | isBigNumber + * isLessThan lt | maximum max + * isLessThanOrEqualTo lte | minimum min + * isNaN | random + * isNegative | + * isPositive | + * isZero | + * minus | + * modulo mod | + * multipliedBy times | + * negated | + * plus | + * precision sd | + * shiftedBy | + * squareRoot sqrt | + * toExponential | + * toFixed | + * toFormat | + * toFraction | + * toJSON | + * toNumber | + * toPrecision | + * toString | + * valueOf | + * + */ + + + var BigNumber, + isNumeric = /^-?(?:\d+(?:\.\d*)?|\.\d+)(?:e[+-]?\d+)?$/i, + + mathceil = Math.ceil, + mathfloor = Math.floor, + + bignumberError = '[BigNumber Error] ', + tooManyDigits = bignumberError + 'Number primitive has more than 15 significant digits: ', + + BASE = 1e14, + LOG_BASE = 14, + MAX_SAFE_INTEGER = 0x1fffffffffffff, // 2^53 - 1 + // MAX_INT32 = 0x7fffffff, // 2^31 - 1 + POWS_TEN = [1, 10, 100, 1e3, 1e4, 1e5, 1e6, 1e7, 1e8, 1e9, 1e10, 1e11, 1e12, 1e13], + SQRT_BASE = 1e7, + + // EDITABLE + // The limit on the value of DECIMAL_PLACES, TO_EXP_NEG, TO_EXP_POS, MIN_EXP, MAX_EXP, and + // the arguments to toExponential, toFixed, toFormat, and toPrecision. + MAX = 1E9; // 0 to MAX_INT32 + + + /* + * Create and return a BigNumber constructor. + */ + function clone(configObject) { + var div, convertBase, parseNumeric, + P = BigNumber.prototype = { constructor: BigNumber, toString: null, valueOf: null }, + ONE = new BigNumber(1), + + + //----------------------------- EDITABLE CONFIG DEFAULTS ------------------------------- + + + // The default values below must be integers within the inclusive ranges stated. + // The values can also be changed at run-time using BigNumber.set. + + // The maximum number of decimal places for operations involving division. + DECIMAL_PLACES = 20, // 0 to MAX + + // The rounding mode used when rounding to the above decimal places, and when using + // toExponential, toFixed, toFormat and toPrecision, and round (default value). + // UP 0 Away from zero. + // DOWN 1 Towards zero. + // CEIL 2 Towards +Infinity. + // FLOOR 3 Towards -Infinity. + // HALF_UP 4 Towards nearest neighbour. If equidistant, up. + // HALF_DOWN 5 Towards nearest neighbour. If equidistant, down. + // HALF_EVEN 6 Towards nearest neighbour. If equidistant, towards even neighbour. + // HALF_CEIL 7 Towards nearest neighbour. If equidistant, towards +Infinity. + // HALF_FLOOR 8 Towards nearest neighbour. If equidistant, towards -Infinity. + ROUNDING_MODE = 4, // 0 to 8 + + // EXPONENTIAL_AT : [TO_EXP_NEG , TO_EXP_POS] + + // The exponent value at and beneath which toString returns exponential notation. + // Number type: -7 + TO_EXP_NEG = -7, // 0 to -MAX + + // The exponent value at and above which toString returns exponential notation. + // Number type: 21 + TO_EXP_POS = 21, // 0 to MAX + + // RANGE : [MIN_EXP, MAX_EXP] + + // The minimum exponent value, beneath which underflow to zero occurs. + // Number type: -324 (5e-324) + MIN_EXP = -1e7, // -1 to -MAX + + // The maximum exponent value, above which overflow to Infinity occurs. + // Number type: 308 (1.7976931348623157e+308) + // For MAX_EXP > 1e7, e.g. new BigNumber('1e100000000').plus(1) may be slow. + MAX_EXP = 1e7, // 1 to MAX + + // Whether to use cryptographically-secure random number generation, if available. + CRYPTO = false, // true or false + + // The modulo mode used when calculating the modulus: a mod n. + // The quotient (q = a / n) is calculated according to the corresponding rounding mode. + // The remainder (r) is calculated as: r = a - n * q. + // + // UP 0 The remainder is positive if the dividend is negative, else is negative. + // DOWN 1 The remainder has the same sign as the dividend. + // This modulo mode is commonly known as 'truncated division' and is + // equivalent to (a % n) in JavaScript. + // FLOOR 3 The remainder has the same sign as the divisor (Python %). + // HALF_EVEN 6 This modulo mode implements the IEEE 754 remainder function. + // EUCLID 9 Euclidian division. q = sign(n) * floor(a / abs(n)). + // The remainder is always positive. + // + // The truncated division, floored division, Euclidian division and IEEE 754 remainder + // modes are commonly used for the modulus operation. + // Although the other rounding modes can also be used, they may not give useful results. + MODULO_MODE = 1, // 0 to 9 + + // The maximum number of significant digits of the result of the exponentiatedBy operation. + // If POW_PRECISION is 0, there will be unlimited significant digits. + POW_PRECISION = 0, // 0 to MAX + + // The format specification used by the BigNumber.prototype.toFormat method. + FORMAT = { + decimalSeparator: '.', + groupSeparator: ',', + groupSize: 3, + secondaryGroupSize: 0, + fractionGroupSeparator: '\xA0', // non-breaking space + fractionGroupSize: 0 + }, + + // The alphabet used for base conversion. + // It must be at least 2 characters long, with no '.' or repeated character. + // '0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ$_' + ALPHABET = '0123456789abcdefghijklmnopqrstuvwxyz'; + + + //------------------------------------------------------------------------------------------ + + + // CONSTRUCTOR + + + /* + * The BigNumber constructor and exported function. + * Create and return a new instance of a BigNumber object. + * + * n {number|string|BigNumber} A numeric value. + * [b] {number} The base of n. Integer, 2 to ALPHABET.length inclusive. + */ + function BigNumber(n, b) { + var alphabet, c, caseChanged, e, i, isNum, len, str, + x = this; + + // Enable constructor usage without new. + if (!(x instanceof BigNumber)) { + + // Don't throw on constructor call without new (#81). + // '[BigNumber Error] Constructor call without new: {n}' + //throw Error(bignumberError + ' Constructor call without new: ' + n); + return new BigNumber(n, b); + } + + if (b == null) { + + // Duplicate. + if (n instanceof BigNumber) { + x.s = n.s; + x.e = n.e; + x.c = (n = n.c) ? n.slice() : n; + return; + } + + isNum = typeof n == 'number'; + + if (isNum && n * 0 == 0) { + + // Use `1 / n` to handle minus zero also. + x.s = 1 / n < 0 ? (n = -n, -1) : 1; + + // Faster path for integers. + if (n === ~~n) { + for (e = 0, i = n; i >= 10; i /= 10, e++); + x.e = e; + x.c = [n]; + return; + } + + str = n + ''; + } else { + if (!isNumeric.test(str = n + '')) return parseNumeric(x, str, isNum); + x.s = str.charCodeAt(0) == 45 ? (str = str.slice(1), -1) : 1; + } + + // Decimal point? + if ((e = str.indexOf('.')) > -1) str = str.replace('.', ''); + + // Exponential form? + if ((i = str.search(/e/i)) > 0) { + + // Determine exponent. + if (e < 0) e = i; + e += +str.slice(i + 1); + str = str.substring(0, i); + } else if (e < 0) { + + // Integer. + e = str.length; + } + + } else { + + // '[BigNumber Error] Base {not a primitive number|not an integer|out of range}: {b}' + intCheck(b, 2, ALPHABET.length, 'Base'); + str = n + ''; + + // Allow exponential notation to be used with base 10 argument, while + // also rounding to DECIMAL_PLACES as with other bases. + if (b == 10) { + x = new BigNumber(n instanceof BigNumber ? n : str); + return round(x, DECIMAL_PLACES + x.e + 1, ROUNDING_MODE); + } + + isNum = typeof n == 'number'; + + if (isNum) { + + // Avoid potential interpretation of Infinity and NaN as base 44+ values. + if (n * 0 != 0) return parseNumeric(x, str, isNum, b); + + x.s = 1 / n < 0 ? (str = str.slice(1), -1) : 1; + + // '[BigNumber Error] Number primitive has more than 15 significant digits: {n}' + if (BigNumber.DEBUG && str.replace(/^0\.0*|\./, '').length > 15) { + throw Error + (tooManyDigits + n); + } + + // Prevent later check for length on converted number. + isNum = false; + } else { + x.s = str.charCodeAt(0) === 45 ? (str = str.slice(1), -1) : 1; + } + + alphabet = ALPHABET.slice(0, b); + e = i = 0; + + // Check that str is a valid base b number. + // Don't use RegExp so alphabet can contain special characters. + for (len = str.length; i < len; i++) { + if (alphabet.indexOf(c = str.charAt(i)) < 0) { + if (c == '.') { + + // If '.' is not the first character and it has not be found before. + if (i > e) { + e = len; + continue; + } + } else if (!caseChanged) { + + // Allow e.g. hexadecimal 'FF' as well as 'ff'. + if (str == str.toUpperCase() && (str = str.toLowerCase()) || + str == str.toLowerCase() && (str = str.toUpperCase())) { + caseChanged = true; + i = -1; + e = 0; + continue; + } + } + + return parseNumeric(x, n + '', isNum, b); + } + } + + str = convertBase(str, b, 10, x.s); + + // Decimal point? + if ((e = str.indexOf('.')) > -1) str = str.replace('.', ''); + else e = str.length; + } + + // Determine leading zeros. + for (i = 0; str.charCodeAt(i) === 48; i++); + + // Determine trailing zeros. + for (len = str.length; str.charCodeAt(--len) === 48;); + + str = str.slice(i, ++len); + + if (str) { + len -= i; + + // '[BigNumber Error] Number primitive has more than 15 significant digits: {n}' + if (isNum && BigNumber.DEBUG && + len > 15 && (n > MAX_SAFE_INTEGER || n !== mathfloor(n))) { + throw Error + (tooManyDigits + (x.s * n)); + } + + e = e - i - 1; + + // Overflow? + if (e > MAX_EXP) { + + // Infinity. + x.c = x.e = null; + + // Underflow? + } else if (e < MIN_EXP) { + + // Zero. + x.c = [x.e = 0]; + } else { + x.e = e; + x.c = []; + + // Transform base + + // e is the base 10 exponent. + // i is where to slice str to get the first element of the coefficient array. + i = (e + 1) % LOG_BASE; + if (e < 0) i += LOG_BASE; + + if (i < len) { + if (i) x.c.push(+str.slice(0, i)); + + for (len -= LOG_BASE; i < len;) { + x.c.push(+str.slice(i, i += LOG_BASE)); + } + + str = str.slice(i); + i = LOG_BASE - str.length; + } else { + i -= len; + } + + for (; i--; str += '0'); + x.c.push(+str); + } + } else { + + // Zero. + x.c = [x.e = 0]; + } + } + + + // CONSTRUCTOR PROPERTIES + + + BigNumber.clone = clone; + + BigNumber.ROUND_UP = 0; + BigNumber.ROUND_DOWN = 1; + BigNumber.ROUND_CEIL = 2; + BigNumber.ROUND_FLOOR = 3; + BigNumber.ROUND_HALF_UP = 4; + BigNumber.ROUND_HALF_DOWN = 5; + BigNumber.ROUND_HALF_EVEN = 6; + BigNumber.ROUND_HALF_CEIL = 7; + BigNumber.ROUND_HALF_FLOOR = 8; + BigNumber.EUCLID = 9; + + + /* + * Configure infrequently-changing library-wide settings. + * + * Accept an object with the following optional properties (if the value of a property is + * a number, it must be an integer within the inclusive range stated): + * + * DECIMAL_PLACES {number} 0 to MAX + * ROUNDING_MODE {number} 0 to 8 + * EXPONENTIAL_AT {number|number[]} -MAX to MAX or [-MAX to 0, 0 to MAX] + * RANGE {number|number[]} -MAX to MAX (not zero) or [-MAX to -1, 1 to MAX] + * CRYPTO {boolean} true or false + * MODULO_MODE {number} 0 to 9 + * POW_PRECISION {number} 0 to MAX + * ALPHABET {string} A string of two or more unique characters which does + * not contain '.'. + * FORMAT {object} An object with some of the following properties: + * decimalSeparator {string} + * groupSeparator {string} + * groupSize {number} + * secondaryGroupSize {number} + * fractionGroupSeparator {string} + * fractionGroupSize {number} + * + * (The values assigned to the above FORMAT object properties are not checked for validity.) + * + * E.g. + * BigNumber.config({ DECIMAL_PLACES : 20, ROUNDING_MODE : 4 }) + * + * Ignore properties/parameters set to null or undefined, except for ALPHABET. + * + * Return an object with the properties current values. + */ + BigNumber.config = BigNumber.set = function (obj) { + var p, v; + + if (obj != null) { + + if (typeof obj == 'object') { + + // DECIMAL_PLACES {number} Integer, 0 to MAX inclusive. + // '[BigNumber Error] DECIMAL_PLACES {not a primitive number|not an integer|out of range}: {v}' + if (obj.hasOwnProperty(p = 'DECIMAL_PLACES')) { + v = obj[p]; + intCheck(v, 0, MAX, p); + DECIMAL_PLACES = v; + } + + // ROUNDING_MODE {number} Integer, 0 to 8 inclusive. + // '[BigNumber Error] ROUNDING_MODE {not a primitive number|not an integer|out of range}: {v}' + if (obj.hasOwnProperty(p = 'ROUNDING_MODE')) { + v = obj[p]; + intCheck(v, 0, 8, p); + ROUNDING_MODE = v; + } + + // EXPONENTIAL_AT {number|number[]} + // Integer, -MAX to MAX inclusive or + // [integer -MAX to 0 inclusive, 0 to MAX inclusive]. + // '[BigNumber Error] EXPONENTIAL_AT {not a primitive number|not an integer|out of range}: {v}' + if (obj.hasOwnProperty(p = 'EXPONENTIAL_AT')) { + v = obj[p]; + if (isArray(v)) { + intCheck(v[0], -MAX, 0, p); + intCheck(v[1], 0, MAX, p); + TO_EXP_NEG = v[0]; + TO_EXP_POS = v[1]; + } else { + intCheck(v, -MAX, MAX, p); + TO_EXP_NEG = -(TO_EXP_POS = v < 0 ? -v : v); + } + } + + // RANGE {number|number[]} Non-zero integer, -MAX to MAX inclusive or + // [integer -MAX to -1 inclusive, integer 1 to MAX inclusive]. + // '[BigNumber Error] RANGE {not a primitive number|not an integer|out of range|cannot be zero}: {v}' + if (obj.hasOwnProperty(p = 'RANGE')) { + v = obj[p]; + if (isArray(v)) { + intCheck(v[0], -MAX, -1, p); + intCheck(v[1], 1, MAX, p); + MIN_EXP = v[0]; + MAX_EXP = v[1]; + } else { + intCheck(v, -MAX, MAX, p); + if (v) { + MIN_EXP = -(MAX_EXP = v < 0 ? -v : v); + } else { + throw Error + (bignumberError + p + ' cannot be zero: ' + v); + } + } + } + + // CRYPTO {boolean} true or false. + // '[BigNumber Error] CRYPTO not true or false: {v}' + // '[BigNumber Error] crypto unavailable' + if (obj.hasOwnProperty(p = 'CRYPTO')) { + v = obj[p]; + if (v === !!v) { + if (v) { + if (typeof crypto != 'undefined' && crypto && + (crypto.getRandomValues || crypto.randomBytes)) { + CRYPTO = v; + } else { + CRYPTO = !v; + throw Error + (bignumberError + 'crypto unavailable'); + } + } else { + CRYPTO = v; + } + } else { + throw Error + (bignumberError + p + ' not true or false: ' + v); + } + } + + // MODULO_MODE {number} Integer, 0 to 9 inclusive. + // '[BigNumber Error] MODULO_MODE {not a primitive number|not an integer|out of range}: {v}' + if (obj.hasOwnProperty(p = 'MODULO_MODE')) { + v = obj[p]; + intCheck(v, 0, 9, p); + MODULO_MODE = v; + } + + // POW_PRECISION {number} Integer, 0 to MAX inclusive. + // '[BigNumber Error] POW_PRECISION {not a primitive number|not an integer|out of range}: {v}' + if (obj.hasOwnProperty(p = 'POW_PRECISION')) { + v = obj[p]; + intCheck(v, 0, MAX, p); + POW_PRECISION = v; + } + + // FORMAT {object} + // '[BigNumber Error] FORMAT not an object: {v}' + if (obj.hasOwnProperty(p = 'FORMAT')) { + v = obj[p]; + if (typeof v == 'object') FORMAT = v; + else throw Error + (bignumberError + p + ' not an object: ' + v); + } + + // ALPHABET {string} + // '[BigNumber Error] ALPHABET invalid: {v}' + if (obj.hasOwnProperty(p = 'ALPHABET')) { + v = obj[p]; + + // Disallow if only one character, or contains '.' or a repeated character. + if (typeof v == 'string' && !/^.$|\.|(.).*\1/.test(v)) { + ALPHABET = v; + } else { + throw Error + (bignumberError + p + ' invalid: ' + v); + } + } + + } else { + + // '[BigNumber Error] Object expected: {v}' + throw Error + (bignumberError + 'Object expected: ' + obj); + } + } + + return { + DECIMAL_PLACES: DECIMAL_PLACES, + ROUNDING_MODE: ROUNDING_MODE, + EXPONENTIAL_AT: [TO_EXP_NEG, TO_EXP_POS], + RANGE: [MIN_EXP, MAX_EXP], + CRYPTO: CRYPTO, + MODULO_MODE: MODULO_MODE, + POW_PRECISION: POW_PRECISION, + FORMAT: FORMAT, + ALPHABET: ALPHABET + }; + }; + + + /* + * Return true if v is a BigNumber instance, otherwise return false. + * + * v {any} + */ + BigNumber.isBigNumber = function (v) { + return v instanceof BigNumber || v && v._isBigNumber === true || false; + }; + + + /* + * Return a new BigNumber whose value is the maximum of the arguments. + * + * arguments {number|string|BigNumber} + */ + BigNumber.maximum = BigNumber.max = function () { + return maxOrMin(arguments, P.lt); + }; + + + /* + * Return a new BigNumber whose value is the minimum of the arguments. + * + * arguments {number|string|BigNumber} + */ + BigNumber.minimum = BigNumber.min = function () { + return maxOrMin(arguments, P.gt); + }; + + + /* + * Return a new BigNumber with a random value equal to or greater than 0 and less than 1, + * and with dp, or DECIMAL_PLACES if dp is omitted, decimal places (or less if trailing + * zeros are produced). + * + * [dp] {number} Decimal places. Integer, 0 to MAX inclusive. + * + * '[BigNumber Error] Argument {not a primitive number|not an integer|out of range}: {dp}' + * '[BigNumber Error] crypto unavailable' + */ + BigNumber.random = (function () { + var pow2_53 = 0x20000000000000; + + // Return a 53 bit integer n, where 0 <= n < 9007199254740992. + // Check if Math.random() produces more than 32 bits of randomness. + // If it does, assume at least 53 bits are produced, otherwise assume at least 30 bits. + // 0x40000000 is 2^30, 0x800000 is 2^23, 0x1fffff is 2^21 - 1. + var random53bitInt = (Math.random() * pow2_53) & 0x1fffff + ? function () { return mathfloor(Math.random() * pow2_53); } + : function () { return ((Math.random() * 0x40000000 | 0) * 0x800000) + + (Math.random() * 0x800000 | 0); }; + + return function (dp) { + var a, b, e, k, v, + i = 0, + c = [], + rand = new BigNumber(ONE); + + if (dp == null) dp = DECIMAL_PLACES; + else intCheck(dp, 0, MAX); + + k = mathceil(dp / LOG_BASE); + + if (CRYPTO) { + + // Browsers supporting crypto.getRandomValues. + if (crypto.getRandomValues) { + + a = crypto.getRandomValues(new Uint32Array(k *= 2)); + + for (; i < k;) { + + // 53 bits: + // ((Math.pow(2, 32) - 1) * Math.pow(2, 21)).toString(2) + // 11111 11111111 11111111 11111111 11100000 00000000 00000000 + // ((Math.pow(2, 32) - 1) >>> 11).toString(2) + // 11111 11111111 11111111 + // 0x20000 is 2^21. + v = a[i] * 0x20000 + (a[i + 1] >>> 11); + + // Rejection sampling: + // 0 <= v < 9007199254740992 + // Probability that v >= 9e15, is + // 7199254740992 / 9007199254740992 ~= 0.0008, i.e. 1 in 1251 + if (v >= 9e15) { + b = crypto.getRandomValues(new Uint32Array(2)); + a[i] = b[0]; + a[i + 1] = b[1]; + } else { + + // 0 <= v <= 8999999999999999 + // 0 <= (v % 1e14) <= 99999999999999 + c.push(v % 1e14); + i += 2; + } + } + i = k / 2; + + // Node.js supporting crypto.randomBytes. + } else if (crypto.randomBytes) { + + // buffer + a = crypto.randomBytes(k *= 7); + + for (; i < k;) { + + // 0x1000000000000 is 2^48, 0x10000000000 is 2^40 + // 0x100000000 is 2^32, 0x1000000 is 2^24 + // 11111 11111111 11111111 11111111 11111111 11111111 11111111 + // 0 <= v < 9007199254740992 + v = ((a[i] & 31) * 0x1000000000000) + (a[i + 1] * 0x10000000000) + + (a[i + 2] * 0x100000000) + (a[i + 3] * 0x1000000) + + (a[i + 4] << 16) + (a[i + 5] << 8) + a[i + 6]; + + if (v >= 9e15) { + crypto.randomBytes(7).copy(a, i); + } else { + + // 0 <= (v % 1e14) <= 99999999999999 + c.push(v % 1e14); + i += 7; + } + } + i = k / 7; + } else { + CRYPTO = false; + throw Error + (bignumberError + 'crypto unavailable'); + } + } + + // Use Math.random. + if (!CRYPTO) { + + for (; i < k;) { + v = random53bitInt(); + if (v < 9e15) c[i++] = v % 1e14; + } + } + + k = c[--i]; + dp %= LOG_BASE; + + // Convert trailing digits to zeros according to dp. + if (k && dp) { + v = POWS_TEN[LOG_BASE - dp]; + c[i] = mathfloor(k / v) * v; + } + + // Remove trailing elements which are zero. + for (; c[i] === 0; c.pop(), i--); + + // Zero? + if (i < 0) { + c = [e = 0]; + } else { + + // Remove leading elements which are zero and adjust exponent accordingly. + for (e = -1 ; c[0] === 0; c.splice(0, 1), e -= LOG_BASE); + + // Count the digits of the first element of c to determine leading zeros, and... + for (i = 1, v = c[0]; v >= 10; v /= 10, i++); + + // adjust the exponent accordingly. + if (i < LOG_BASE) e -= LOG_BASE - i; + } + + rand.e = e; + rand.c = c; + return rand; + }; + })(); + + + // PRIVATE FUNCTIONS + + + // Called by BigNumber and BigNumber.prototype.toString. + convertBase = (function () { + var decimal = '0123456789'; + + /* + * Convert string of baseIn to an array of numbers of baseOut. + * Eg. toBaseOut('255', 10, 16) returns [15, 15]. + * Eg. toBaseOut('ff', 16, 10) returns [2, 5, 5]. + */ + function toBaseOut(str, baseIn, baseOut, alphabet) { + var j, + arr = [0], + arrL, + i = 0, + len = str.length; + + for (; i < len;) { + for (arrL = arr.length; arrL--; arr[arrL] *= baseIn); + + arr[0] += alphabet.indexOf(str.charAt(i++)); + + for (j = 0; j < arr.length; j++) { + + if (arr[j] > baseOut - 1) { + if (arr[j + 1] == null) arr[j + 1] = 0; + arr[j + 1] += arr[j] / baseOut | 0; + arr[j] %= baseOut; + } + } + } + + return arr.reverse(); + } + + // Convert a numeric string of baseIn to a numeric string of baseOut. + // If the caller is toString, we are converting from base 10 to baseOut. + // If the caller is BigNumber, we are converting from baseIn to base 10. + return function (str, baseIn, baseOut, sign, callerIsToString) { + var alphabet, d, e, k, r, x, xc, y, + i = str.indexOf('.'), + dp = DECIMAL_PLACES, + rm = ROUNDING_MODE; + + // Non-integer. + if (i >= 0) { + k = POW_PRECISION; + + // Unlimited precision. + POW_PRECISION = 0; + str = str.replace('.', ''); + y = new BigNumber(baseIn); + x = y.pow(str.length - i); + POW_PRECISION = k; + + // Convert str as if an integer, then restore the fraction part by dividing the + // result by its base raised to a power. + + y.c = toBaseOut(toFixedPoint(coeffToString(x.c), x.e, '0'), + 10, baseOut, decimal); + y.e = y.c.length; + } + + // Convert the number as integer. + + xc = toBaseOut(str, baseIn, baseOut, callerIsToString + ? (alphabet = ALPHABET, decimal) + : (alphabet = decimal, ALPHABET)); + + // xc now represents str as an integer and converted to baseOut. e is the exponent. + e = k = xc.length; + + // Remove trailing zeros. + for (; xc[--k] == 0; xc.pop()); + + // Zero? + if (!xc[0]) return alphabet.charAt(0); + + // Does str represent an integer? If so, no need for the division. + if (i < 0) { + --e; + } else { + x.c = xc; + x.e = e; + + // The sign is needed for correct rounding. + x.s = sign; + x = div(x, y, dp, rm, baseOut); + xc = x.c; + r = x.r; + e = x.e; + } + + // xc now represents str converted to baseOut. + + // THe index of the rounding digit. + d = e + dp + 1; + + // The rounding digit: the digit to the right of the digit that may be rounded up. + i = xc[d]; + + // Look at the rounding digits and mode to determine whether to round up. + + k = baseOut / 2; + r = r || d < 0 || xc[d + 1] != null; + + r = rm < 4 ? (i != null || r) && (rm == 0 || rm == (x.s < 0 ? 3 : 2)) + : i > k || i == k &&(rm == 4 || r || rm == 6 && xc[d - 1] & 1 || + rm == (x.s < 0 ? 8 : 7)); + + // If the index of the rounding digit is not greater than zero, or xc represents + // zero, then the result of the base conversion is zero or, if rounding up, a value + // such as 0.00001. + if (d < 1 || !xc[0]) { + + // 1^-dp or 0 + str = r ? toFixedPoint(alphabet.charAt(1), -dp, alphabet.charAt(0)) + : alphabet.charAt(0); + } else { + + // Truncate xc to the required number of decimal places. + xc.length = d; + + // Round up? + if (r) { + + // Rounding up may mean the previous digit has to be rounded up and so on. + for (--baseOut; ++xc[--d] > baseOut;) { + xc[d] = 0; + + if (!d) { + ++e; + xc = [1].concat(xc); + } + } + } + + // Determine trailing zeros. + for (k = xc.length; !xc[--k];); + + // E.g. [4, 11, 15] becomes 4bf. + for (i = 0, str = ''; i <= k; str += alphabet.charAt(xc[i++])); + + // Add leading zeros, decimal point and trailing zeros as required. + str = toFixedPoint(str, e, alphabet.charAt(0)); + } + + // The caller will add the sign. + return str; + }; + })(); + + + // Perform division in the specified base. Called by div and convertBase. + div = (function () { + + // Assume non-zero x and k. + function multiply(x, k, base) { + var m, temp, xlo, xhi, + carry = 0, + i = x.length, + klo = k % SQRT_BASE, + khi = k / SQRT_BASE | 0; + + for (x = x.slice(); i--;) { + xlo = x[i] % SQRT_BASE; + xhi = x[i] / SQRT_BASE | 0; + m = khi * xlo + xhi * klo; + temp = klo * xlo + ((m % SQRT_BASE) * SQRT_BASE) + carry; + carry = (temp / base | 0) + (m / SQRT_BASE | 0) + khi * xhi; + x[i] = temp % base; + } + + if (carry) x = [carry].concat(x); + + return x; + } + + function compare(a, b, aL, bL) { + var i, cmp; + + if (aL != bL) { + cmp = aL > bL ? 1 : -1; + } else { + + for (i = cmp = 0; i < aL; i++) { + + if (a[i] != b[i]) { + cmp = a[i] > b[i] ? 1 : -1; + break; + } + } + } + + return cmp; + } + + function subtract(a, b, aL, base) { + var i = 0; + + // Subtract b from a. + for (; aL--;) { + a[aL] -= i; + i = a[aL] < b[aL] ? 1 : 0; + a[aL] = i * base + a[aL] - b[aL]; + } + + // Remove leading zeros. + for (; !a[0] && a.length > 1; a.splice(0, 1)); + } + + // x: dividend, y: divisor. + return function (x, y, dp, rm, base) { + var cmp, e, i, more, n, prod, prodL, q, qc, rem, remL, rem0, xi, xL, yc0, + yL, yz, + s = x.s == y.s ? 1 : -1, + xc = x.c, + yc = y.c; + + // Either NaN, Infinity or 0? + if (!xc || !xc[0] || !yc || !yc[0]) { + + return new BigNumber( + + // Return NaN if either NaN, or both Infinity or 0. + !x.s || !y.s || (xc ? yc && xc[0] == yc[0] : !yc) ? NaN : + + // Return ±0 if x is ±0 or y is ±Infinity, or return ±Infinity as y is ±0. + xc && xc[0] == 0 || !yc ? s * 0 : s / 0 + ); + } + + q = new BigNumber(s); + qc = q.c = []; + e = x.e - y.e; + s = dp + e + 1; + + if (!base) { + base = BASE; + e = bitFloor(x.e / LOG_BASE) - bitFloor(y.e / LOG_BASE); + s = s / LOG_BASE | 0; + } + + // Result exponent may be one less then the current value of e. + // The coefficients of the BigNumbers from convertBase may have trailing zeros. + for (i = 0; yc[i] == (xc[i] || 0); i++); + + if (yc[i] > (xc[i] || 0)) e--; + + if (s < 0) { + qc.push(1); + more = true; + } else { + xL = xc.length; + yL = yc.length; + i = 0; + s += 2; + + // Normalise xc and yc so highest order digit of yc is >= base / 2. + + n = mathfloor(base / (yc[0] + 1)); + + // Not necessary, but to handle odd bases where yc[0] == (base / 2) - 1. + // if (n > 1 || n++ == 1 && yc[0] < base / 2) { + if (n > 1) { + yc = multiply(yc, n, base); + xc = multiply(xc, n, base); + yL = yc.length; + xL = xc.length; + } + + xi = yL; + rem = xc.slice(0, yL); + remL = rem.length; + + // Add zeros to make remainder as long as divisor. + for (; remL < yL; rem[remL++] = 0); + yz = yc.slice(); + yz = [0].concat(yz); + yc0 = yc[0]; + if (yc[1] >= base / 2) yc0++; + // Not necessary, but to prevent trial digit n > base, when using base 3. + // else if (base == 3 && yc0 == 1) yc0 = 1 + 1e-15; + + do { + n = 0; + + // Compare divisor and remainder. + cmp = compare(yc, rem, yL, remL); + + // If divisor < remainder. + if (cmp < 0) { + + // Calculate trial digit, n. + + rem0 = rem[0]; + if (yL != remL) rem0 = rem0 * base + (rem[1] || 0); + + // n is how many times the divisor goes into the current remainder. + n = mathfloor(rem0 / yc0); + + // Algorithm: + // product = divisor multiplied by trial digit (n). + // Compare product and remainder. + // If product is greater than remainder: + // Subtract divisor from product, decrement trial digit. + // Subtract product from remainder. + // If product was less than remainder at the last compare: + // Compare new remainder and divisor. + // If remainder is greater than divisor: + // Subtract divisor from remainder, increment trial digit. + + if (n > 1) { + + // n may be > base only when base is 3. + if (n >= base) n = base - 1; + + // product = divisor * trial digit. + prod = multiply(yc, n, base); + prodL = prod.length; + remL = rem.length; + + // Compare product and remainder. + // If product > remainder then trial digit n too high. + // n is 1 too high about 5% of the time, and is not known to have + // ever been more than 1 too high. + while (compare(prod, rem, prodL, remL) == 1) { + n--; + + // Subtract divisor from product. + subtract(prod, yL < prodL ? yz : yc, prodL, base); + prodL = prod.length; + cmp = 1; + } + } else { + + // n is 0 or 1, cmp is -1. + // If n is 0, there is no need to compare yc and rem again below, + // so change cmp to 1 to avoid it. + // If n is 1, leave cmp as -1, so yc and rem are compared again. + if (n == 0) { + + // divisor < remainder, so n must be at least 1. + cmp = n = 1; + } + + // product = divisor + prod = yc.slice(); + prodL = prod.length; + } + + if (prodL < remL) prod = [0].concat(prod); + + // Subtract product from remainder. + subtract(rem, prod, remL, base); + remL = rem.length; + + // If product was < remainder. + if (cmp == -1) { + + // Compare divisor and new remainder. + // If divisor < new remainder, subtract divisor from remainder. + // Trial digit n too low. + // n is 1 too low about 5% of the time, and very rarely 2 too low. + while (compare(yc, rem, yL, remL) < 1) { + n++; + + // Subtract divisor from remainder. + subtract(rem, yL < remL ? yz : yc, remL, base); + remL = rem.length; + } + } + } else if (cmp === 0) { + n++; + rem = [0]; + } // else cmp === 1 and n will be 0 + + // Add the next digit, n, to the result array. + qc[i++] = n; + + // Update the remainder. + if (rem[0]) { + rem[remL++] = xc[xi] || 0; + } else { + rem = [xc[xi]]; + remL = 1; + } + } while ((xi++ < xL || rem[0] != null) && s--); + + more = rem[0] != null; + + // Leading zero? + if (!qc[0]) qc.splice(0, 1); + } + + if (base == BASE) { + + // To calculate q.e, first get the number of digits of qc[0]. + for (i = 1, s = qc[0]; s >= 10; s /= 10, i++); + + round(q, dp + (q.e = i + e * LOG_BASE - 1) + 1, rm, more); + + // Caller is convertBase. + } else { + q.e = e; + q.r = +more; + } + + return q; + }; + })(); + + + /* + * Return a string representing the value of BigNumber n in fixed-point or exponential + * notation rounded to the specified decimal places or significant digits. + * + * n: a BigNumber. + * i: the index of the last digit required (i.e. the digit that may be rounded up). + * rm: the rounding mode. + * id: 1 (toExponential) or 2 (toPrecision). + */ + function format(n, i, rm, id) { + var c0, e, ne, len, str; + + if (rm == null) rm = ROUNDING_MODE; + else intCheck(rm, 0, 8); + + if (!n.c) return n.toString(); + + c0 = n.c[0]; + ne = n.e; + + if (i == null) { + str = coeffToString(n.c); + str = id == 1 || id == 2 && ne <= TO_EXP_NEG + ? toExponential(str, ne) + : toFixedPoint(str, ne, '0'); + } else { + n = round(new BigNumber(n), i, rm); + + // n.e may have changed if the value was rounded up. + e = n.e; + + str = coeffToString(n.c); + len = str.length; + + // toPrecision returns exponential notation if the number of significant digits + // specified is less than the number of digits necessary to represent the integer + // part of the value in fixed-point notation. + + // Exponential notation. + if (id == 1 || id == 2 && (i <= e || e <= TO_EXP_NEG)) { + + // Append zeros? + for (; len < i; str += '0', len++); + str = toExponential(str, e); + + // Fixed-point notation. + } else { + i -= ne; + str = toFixedPoint(str, e, '0'); + + // Append zeros? + if (e + 1 > len) { + if (--i > 0) for (str += '.'; i--; str += '0'); + } else { + i += e - len; + if (i > 0) { + if (e + 1 == len) str += '.'; + for (; i--; str += '0'); + } + } + } + } + + return n.s < 0 && c0 ? '-' + str : str; + } + + + // Handle BigNumber.max and BigNumber.min. + function maxOrMin(args, method) { + var m, n, + i = 0; + + if (isArray(args[0])) args = args[0]; + m = new BigNumber(args[0]); + + for (; ++i < args.length;) { + n = new BigNumber(args[i]); + + // If any number is NaN, return NaN. + if (!n.s) { + m = n; + break; + } else if (method.call(m, n)) { + m = n; + } + } + + return m; + } + + + /* + * Strip trailing zeros, calculate base 10 exponent and check against MIN_EXP and MAX_EXP. + * Called by minus, plus and times. + */ + function normalise(n, c, e) { + var i = 1, + j = c.length; + + // Remove trailing zeros. + for (; !c[--j]; c.pop()); + + // Calculate the base 10 exponent. First get the number of digits of c[0]. + for (j = c[0]; j >= 10; j /= 10, i++); + + // Overflow? + if ((e = i + e * LOG_BASE - 1) > MAX_EXP) { + + // Infinity. + n.c = n.e = null; + + // Underflow? + } else if (e < MIN_EXP) { + + // Zero. + n.c = [n.e = 0]; + } else { + n.e = e; + n.c = c; + } + + return n; + } + + + // Handle values that fail the validity test in BigNumber. + parseNumeric = (function () { + var basePrefix = /^(-?)0([xbo])(?=\w[\w.]*$)/i, + dotAfter = /^([^.]+)\.$/, + dotBefore = /^\.([^.]+)$/, + isInfinityOrNaN = /^-?(Infinity|NaN)$/, + whitespaceOrPlus = /^\s*\+(?=[\w.])|^\s+|\s+$/g; + + return function (x, str, isNum, b) { + var base, + s = isNum ? str : str.replace(whitespaceOrPlus, ''); + + // No exception on ±Infinity or NaN. + if (isInfinityOrNaN.test(s)) { + x.s = isNaN(s) ? null : s < 0 ? -1 : 1; + x.c = x.e = null; + } else { + if (!isNum) { + + // basePrefix = /^(-?)0([xbo])(?=\w[\w.]*$)/i + s = s.replace(basePrefix, function (m, p1, p2) { + base = (p2 = p2.toLowerCase()) == 'x' ? 16 : p2 == 'b' ? 2 : 8; + return !b || b == base ? p1 : m; + }); + + if (b) { + base = b; + + // E.g. '1.' to '1', '.1' to '0.1' + s = s.replace(dotAfter, '$1').replace(dotBefore, '0.$1'); + } + + if (str != s) return new BigNumber(s, base); + } + + // '[BigNumber Error] Not a number: {n}' + // '[BigNumber Error] Not a base {b} number: {n}' + if (BigNumber.DEBUG) { + throw Error + (bignumberError + 'Not a' + (b ? ' base ' + b : '') + ' number: ' + str); + } + + // NaN + x.c = x.e = x.s = null; + } + } + })(); + + + /* + * Round x to sd significant digits using rounding mode rm. Check for over/under-flow. + * If r is truthy, it is known that there are more digits after the rounding digit. + */ + function round(x, sd, rm, r) { + var d, i, j, k, n, ni, rd, + xc = x.c, + pows10 = POWS_TEN; + + // if x is not Infinity or NaN... + if (xc) { + + // rd is the rounding digit, i.e. the digit after the digit that may be rounded up. + // n is a base 1e14 number, the value of the element of array x.c containing rd. + // ni is the index of n within x.c. + // d is the number of digits of n. + // i is the index of rd within n including leading zeros. + // j is the actual index of rd within n (if < 0, rd is a leading zero). + out: { + + // Get the number of digits of the first element of xc. + for (d = 1, k = xc[0]; k >= 10; k /= 10, d++); + i = sd - d; + + // If the rounding digit is in the first element of xc... + if (i < 0) { + i += LOG_BASE; + j = sd; + n = xc[ni = 0]; + + // Get the rounding digit at index j of n. + rd = n / pows10[d - j - 1] % 10 | 0; + } else { + ni = mathceil((i + 1) / LOG_BASE); + + if (ni >= xc.length) { + + if (r) { + + // Needed by sqrt. + for (; xc.length <= ni; xc.push(0)); + n = rd = 0; + d = 1; + i %= LOG_BASE; + j = i - LOG_BASE + 1; + } else { + break out; + } + } else { + n = k = xc[ni]; + + // Get the number of digits of n. + for (d = 1; k >= 10; k /= 10, d++); + + // Get the index of rd within n. + i %= LOG_BASE; + + // Get the index of rd within n, adjusted for leading zeros. + // The number of leading zeros of n is given by LOG_BASE - d. + j = i - LOG_BASE + d; + + // Get the rounding digit at index j of n. + rd = j < 0 ? 0 : n / pows10[d - j - 1] % 10 | 0; + } + } + + r = r || sd < 0 || + + // Are there any non-zero digits after the rounding digit? + // The expression n % pows10[d - j - 1] returns all digits of n to the right + // of the digit at j, e.g. if n is 908714 and j is 2, the expression gives 714. + xc[ni + 1] != null || (j < 0 ? n : n % pows10[d - j - 1]); + + r = rm < 4 + ? (rd || r) && (rm == 0 || rm == (x.s < 0 ? 3 : 2)) + : rd > 5 || rd == 5 && (rm == 4 || r || rm == 6 && + + // Check whether the digit to the left of the rounding digit is odd. + ((i > 0 ? j > 0 ? n / pows10[d - j] : 0 : xc[ni - 1]) % 10) & 1 || + rm == (x.s < 0 ? 8 : 7)); + + if (sd < 1 || !xc[0]) { + xc.length = 0; + + if (r) { + + // Convert sd to decimal places. + sd -= x.e + 1; + + // 1, 0.1, 0.01, 0.001, 0.0001 etc. + xc[0] = pows10[(LOG_BASE - sd % LOG_BASE) % LOG_BASE]; + x.e = -sd || 0; + } else { + + // Zero. + xc[0] = x.e = 0; + } + + return x; + } + + // Remove excess digits. + if (i == 0) { + xc.length = ni; + k = 1; + ni--; + } else { + xc.length = ni + 1; + k = pows10[LOG_BASE - i]; + + // E.g. 56700 becomes 56000 if 7 is the rounding digit. + // j > 0 means i > number of leading zeros of n. + xc[ni] = j > 0 ? mathfloor(n / pows10[d - j] % pows10[j]) * k : 0; + } + + // Round up? + if (r) { + + for (; ;) { + + // If the digit to be rounded up is in the first element of xc... + if (ni == 0) { + + // i will be the length of xc[0] before k is added. + for (i = 1, j = xc[0]; j >= 10; j /= 10, i++); + j = xc[0] += k; + for (k = 1; j >= 10; j /= 10, k++); + + // if i != k the length has increased. + if (i != k) { + x.e++; + if (xc[0] == BASE) xc[0] = 1; + } + + break; + } else { + xc[ni] += k; + if (xc[ni] != BASE) break; + xc[ni--] = 0; + k = 1; + } + } + } + + // Remove trailing zeros. + for (i = xc.length; xc[--i] === 0; xc.pop()); + } + + // Overflow? Infinity. + if (x.e > MAX_EXP) { + x.c = x.e = null; + + // Underflow? Zero. + } else if (x.e < MIN_EXP) { + x.c = [x.e = 0]; + } + } + + return x; + } + + + // PROTOTYPE/INSTANCE METHODS + + + /* + * Return a new BigNumber whose value is the absolute value of this BigNumber. + */ + P.absoluteValue = P.abs = function () { + var x = new BigNumber(this); + if (x.s < 0) x.s = 1; + return x; + }; + + + /* + * Return + * 1 if the value of this BigNumber is greater than the value of BigNumber(y, b), + * -1 if the value of this BigNumber is less than the value of BigNumber(y, b), + * 0 if they have the same value, + * or null if the value of either is NaN. + */ + P.comparedTo = function (y, b) { + return compare(this, new BigNumber(y, b)); + }; + + + /* + * If dp is undefined or null or true or false, return the number of decimal places of the + * value of this BigNumber, or null if the value of this BigNumber is ±Infinity or NaN. + * + * Otherwise, if dp is a number, return a new BigNumber whose value is the value of this + * BigNumber rounded to a maximum of dp decimal places using rounding mode rm, or + * ROUNDING_MODE if rm is omitted. + * + * [dp] {number} Decimal places: integer, 0 to MAX inclusive. + * [rm] {number} Rounding mode. Integer, 0 to 8 inclusive. + * + * '[BigNumber Error] Argument {not a primitive number|not an integer|out of range}: {dp|rm}' + */ + P.decimalPlaces = P.dp = function (dp, rm) { + var c, n, v, + x = this; + + if (dp != null) { + intCheck(dp, 0, MAX); + if (rm == null) rm = ROUNDING_MODE; + else intCheck(rm, 0, 8); + + return round(new BigNumber(x), dp + x.e + 1, rm); + } + + if (!(c = x.c)) return null; + n = ((v = c.length - 1) - bitFloor(this.e / LOG_BASE)) * LOG_BASE; + + // Subtract the number of trailing zeros of the last number. + if (v = c[v]) for (; v % 10 == 0; v /= 10, n--); + if (n < 0) n = 0; + + return n; + }; + + + /* + * n / 0 = I + * n / N = N + * n / I = 0 + * 0 / n = 0 + * 0 / 0 = N + * 0 / N = N + * 0 / I = 0 + * N / n = N + * N / 0 = N + * N / N = N + * N / I = N + * I / n = I + * I / 0 = I + * I / N = N + * I / I = N + * + * Return a new BigNumber whose value is the value of this BigNumber divided by the value of + * BigNumber(y, b), rounded according to DECIMAL_PLACES and ROUNDING_MODE. + */ + P.dividedBy = P.div = function (y, b) { + return div(this, new BigNumber(y, b), DECIMAL_PLACES, ROUNDING_MODE); + }; + + + /* + * Return a new BigNumber whose value is the integer part of dividing the value of this + * BigNumber by the value of BigNumber(y, b). + */ + P.dividedToIntegerBy = P.idiv = function (y, b) { + return div(this, new BigNumber(y, b), 0, 1); + }; + + + /* + * Return a BigNumber whose value is the value of this BigNumber exponentiated by n. + * + * If m is present, return the result modulo m. + * If n is negative round according to DECIMAL_PLACES and ROUNDING_MODE. + * If POW_PRECISION is non-zero and m is not present, round to POW_PRECISION using ROUNDING_MODE. + * + * The modular power operation works efficiently when x, n, and m are integers, otherwise it + * is equivalent to calculating x.exponentiatedBy(n).modulo(m) with a POW_PRECISION of 0. + * + * n {number|string|BigNumber} The exponent. An integer. + * [m] {number|string|BigNumber} The modulus. + * + * '[BigNumber Error] Exponent not an integer: {n}' + */ + P.exponentiatedBy = P.pow = function (n, m) { + var half, isModExp, k, more, nIsBig, nIsNeg, nIsOdd, y, + x = this; + + n = new BigNumber(n); + + // Allow NaN and ±Infinity, but not other non-integers. + if (n.c && !n.isInteger()) { + throw Error + (bignumberError + 'Exponent not an integer: ' + n); + } + + if (m != null) m = new BigNumber(m); + + // Exponent of MAX_SAFE_INTEGER is 15. + nIsBig = n.e > 14; + + // If x is NaN, ±Infinity, ±0 or ±1, or n is ±Infinity, NaN or ±0. + if (!x.c || !x.c[0] || x.c[0] == 1 && !x.e && x.c.length == 1 || !n.c || !n.c[0]) { + + // The sign of the result of pow when x is negative depends on the evenness of n. + // If +n overflows to ±Infinity, the evenness of n would be not be known. + y = new BigNumber(Math.pow(+x.valueOf(), nIsBig ? 2 - isOdd(n) : +n)); + return m ? y.mod(m) : y; + } + + nIsNeg = n.s < 0; + + if (m) { + + // x % m returns NaN if abs(m) is zero, or m is NaN. + if (m.c ? !m.c[0] : !m.s) return new BigNumber(NaN); + + isModExp = !nIsNeg && x.isInteger() && m.isInteger(); + + if (isModExp) x = x.mod(m); + + // Overflow to ±Infinity: >=2**1e10 or >=1.0000024**1e15. + // Underflow to ±0: <=0.79**1e10 or <=0.9999975**1e15. + } else if (n.e > 9 && (x.e > 0 || x.e < -1 || (x.e == 0 + // [1, 240000000] + ? x.c[0] > 1 || nIsBig && x.c[1] >= 24e7 + // [80000000000000] [99999750000000] + : x.c[0] < 8e13 || nIsBig && x.c[0] <= 9999975e7))) { + + // If x is negative and n is odd, k = -0, else k = 0. + k = x.s < 0 && isOdd(n) ? -0 : 0; + + // If x >= 1, k = ±Infinity. + if (x.e > -1) k = 1 / k; + + // If n is negative return ±0, else return ±Infinity. + return new BigNumber(nIsNeg ? 1 / k : k); + + } else if (POW_PRECISION) { + + // Truncating each coefficient array to a length of k after each multiplication + // equates to truncating significant digits to POW_PRECISION + [28, 41], + // i.e. there will be a minimum of 28 guard digits retained. + k = mathceil(POW_PRECISION / LOG_BASE + 2); + } + + if (nIsBig) { + half = new BigNumber(0.5); + nIsOdd = isOdd(n); + } else { + nIsOdd = n % 2; + } + + if (nIsNeg) n.s = 1; + + y = new BigNumber(ONE); + + // Performs 54 loop iterations for n of 9007199254740991. + for (; ;) { + + if (nIsOdd) { + y = y.times(x); + if (!y.c) break; + + if (k) { + if (y.c.length > k) y.c.length = k; + } else if (isModExp) { + y = y.mod(m); //y = y.minus(div(y, m, 0, MODULO_MODE).times(m)); + } + } + + if (nIsBig) { + n = n.times(half); + round(n, n.e + 1, 1); + if (!n.c[0]) break; + nIsBig = n.e > 14; + nIsOdd = isOdd(n); + } else { + n = mathfloor(n / 2); + if (!n) break; + nIsOdd = n % 2; + } + + x = x.times(x); + + if (k) { + if (x.c && x.c.length > k) x.c.length = k; + } else if (isModExp) { + x = x.mod(m); //x = x.minus(div(x, m, 0, MODULO_MODE).times(m)); + } + } + + if (isModExp) return y; + if (nIsNeg) y = ONE.div(y); + + return m ? y.mod(m) : k ? round(y, POW_PRECISION, ROUNDING_MODE, more) : y; + }; + + + /* + * Return a new BigNumber whose value is the value of this BigNumber rounded to an integer + * using rounding mode rm, or ROUNDING_MODE if rm is omitted. + * + * [rm] {number} Rounding mode. Integer, 0 to 8 inclusive. + * + * '[BigNumber Error] Argument {not a primitive number|not an integer|out of range}: {rm}' + */ + P.integerValue = function (rm) { + var n = new BigNumber(this); + if (rm == null) rm = ROUNDING_MODE; + else intCheck(rm, 0, 8); + return round(n, n.e + 1, rm); + }; + + + /* + * Return true if the value of this BigNumber is equal to the value of BigNumber(y, b), + * otherwise return false. + */ + P.isEqualTo = P.eq = function (y, b) { + return compare(this, new BigNumber(y, b)) === 0; + }; + + + /* + * Return true if the value of this BigNumber is a finite number, otherwise return false. + */ + P.isFinite = function () { + return !!this.c; + }; + + + /* + * Return true if the value of this BigNumber is greater than the value of BigNumber(y, b), + * otherwise return false. + */ + P.isGreaterThan = P.gt = function (y, b) { + return compare(this, new BigNumber(y, b)) > 0; + }; + + + /* + * Return true if the value of this BigNumber is greater than or equal to the value of + * BigNumber(y, b), otherwise return false. + */ + P.isGreaterThanOrEqualTo = P.gte = function (y, b) { + return (b = compare(this, new BigNumber(y, b))) === 1 || b === 0; + + }; + + + /* + * Return true if the value of this BigNumber is an integer, otherwise return false. + */ + P.isInteger = function () { + return !!this.c && bitFloor(this.e / LOG_BASE) > this.c.length - 2; + }; + + + /* + * Return true if the value of this BigNumber is less than the value of BigNumber(y, b), + * otherwise return false. + */ + P.isLessThan = P.lt = function (y, b) { + return compare(this, new BigNumber(y, b)) < 0; + }; + + + /* + * Return true if the value of this BigNumber is less than or equal to the value of + * BigNumber(y, b), otherwise return false. + */ + P.isLessThanOrEqualTo = P.lte = function (y, b) { + return (b = compare(this, new BigNumber(y, b))) === -1 || b === 0; + }; + + + /* + * Return true if the value of this BigNumber is NaN, otherwise return false. + */ + P.isNaN = function () { + return !this.s; + }; + + + /* + * Return true if the value of this BigNumber is negative, otherwise return false. + */ + P.isNegative = function () { + return this.s < 0; + }; + + + /* + * Return true if the value of this BigNumber is positive, otherwise return false. + */ + P.isPositive = function () { + return this.s > 0; + }; + + + /* + * Return true if the value of this BigNumber is 0 or -0, otherwise return false. + */ + P.isZero = function () { + return !!this.c && this.c[0] == 0; + }; + + + /* + * n - 0 = n + * n - N = N + * n - I = -I + * 0 - n = -n + * 0 - 0 = 0 + * 0 - N = N + * 0 - I = -I + * N - n = N + * N - 0 = N + * N - N = N + * N - I = N + * I - n = I + * I - 0 = I + * I - N = N + * I - I = N + * + * Return a new BigNumber whose value is the value of this BigNumber minus the value of + * BigNumber(y, b). + */ + P.minus = function (y, b) { + var i, j, t, xLTy, + x = this, + a = x.s; + + y = new BigNumber(y, b); + b = y.s; + + // Either NaN? + if (!a || !b) return new BigNumber(NaN); + + // Signs differ? + if (a != b) { + y.s = -b; + return x.plus(y); + } + + var xe = x.e / LOG_BASE, + ye = y.e / LOG_BASE, + xc = x.c, + yc = y.c; + + if (!xe || !ye) { + + // Either Infinity? + if (!xc || !yc) return xc ? (y.s = -b, y) : new BigNumber(yc ? x : NaN); + + // Either zero? + if (!xc[0] || !yc[0]) { + + // Return y if y is non-zero, x if x is non-zero, or zero if both are zero. + return yc[0] ? (y.s = -b, y) : new BigNumber(xc[0] ? x : + + // IEEE 754 (2008) 6.3: n - n = -0 when rounding to -Infinity + ROUNDING_MODE == 3 ? -0 : 0); + } + } + + xe = bitFloor(xe); + ye = bitFloor(ye); + xc = xc.slice(); + + // Determine which is the bigger number. + if (a = xe - ye) { + + if (xLTy = a < 0) { + a = -a; + t = xc; + } else { + ye = xe; + t = yc; + } + + t.reverse(); + + // Prepend zeros to equalise exponents. + for (b = a; b--; t.push(0)); + t.reverse(); + } else { + + // Exponents equal. Check digit by digit. + j = (xLTy = (a = xc.length) < (b = yc.length)) ? a : b; + + for (a = b = 0; b < j; b++) { + + if (xc[b] != yc[b]) { + xLTy = xc[b] < yc[b]; + break; + } + } + } + + // x < y? Point xc to the array of the bigger number. + if (xLTy) t = xc, xc = yc, yc = t, y.s = -y.s; + + b = (j = yc.length) - (i = xc.length); + + // Append zeros to xc if shorter. + // No need to add zeros to yc if shorter as subtract only needs to start at yc.length. + if (b > 0) for (; b--; xc[i++] = 0); + b = BASE - 1; + + // Subtract yc from xc. + for (; j > a;) { + + if (xc[--j] < yc[j]) { + for (i = j; i && !xc[--i]; xc[i] = b); + --xc[i]; + xc[j] += BASE; + } + + xc[j] -= yc[j]; + } + + // Remove leading zeros and adjust exponent accordingly. + for (; xc[0] == 0; xc.splice(0, 1), --ye); + + // Zero? + if (!xc[0]) { + + // Following IEEE 754 (2008) 6.3, + // n - n = +0 but n - n = -0 when rounding towards -Infinity. + y.s = ROUNDING_MODE == 3 ? -1 : 1; + y.c = [y.e = 0]; + return y; + } + + // No need to check for Infinity as +x - +y != Infinity && -x - -y != Infinity + // for finite x and y. + return normalise(y, xc, ye); + }; + + + /* + * n % 0 = N + * n % N = N + * n % I = n + * 0 % n = 0 + * -0 % n = -0 + * 0 % 0 = N + * 0 % N = N + * 0 % I = 0 + * N % n = N + * N % 0 = N + * N % N = N + * N % I = N + * I % n = N + * I % 0 = N + * I % N = N + * I % I = N + * + * Return a new BigNumber whose value is the value of this BigNumber modulo the value of + * BigNumber(y, b). The result depends on the value of MODULO_MODE. + */ + P.modulo = P.mod = function (y, b) { + var q, s, + x = this; + + y = new BigNumber(y, b); + + // Return NaN if x is Infinity or NaN, or y is NaN or zero. + if (!x.c || !y.s || y.c && !y.c[0]) { + return new BigNumber(NaN); + + // Return x if y is Infinity or x is zero. + } else if (!y.c || x.c && !x.c[0]) { + return new BigNumber(x); + } + + if (MODULO_MODE == 9) { + + // Euclidian division: q = sign(y) * floor(x / abs(y)) + // r = x - qy where 0 <= r < abs(y) + s = y.s; + y.s = 1; + q = div(x, y, 0, 3); + y.s = s; + q.s *= s; + } else { + q = div(x, y, 0, MODULO_MODE); + } + + y = x.minus(q.times(y)); + + // To match JavaScript %, ensure sign of zero is sign of dividend. + if (!y.c[0] && MODULO_MODE == 1) y.s = x.s; + + return y; + }; + + + /* + * n * 0 = 0 + * n * N = N + * n * I = I + * 0 * n = 0 + * 0 * 0 = 0 + * 0 * N = N + * 0 * I = N + * N * n = N + * N * 0 = N + * N * N = N + * N * I = N + * I * n = I + * I * 0 = N + * I * N = N + * I * I = I + * + * Return a new BigNumber whose value is the value of this BigNumber multiplied by the value + * of BigNumber(y, b). + */ + P.multipliedBy = P.times = function (y, b) { + var c, e, i, j, k, m, xcL, xlo, xhi, ycL, ylo, yhi, zc, + base, sqrtBase, + x = this, + xc = x.c, + yc = (y = new BigNumber(y, b)).c; + + // Either NaN, ±Infinity or ±0? + if (!xc || !yc || !xc[0] || !yc[0]) { + + // Return NaN if either is NaN, or one is 0 and the other is Infinity. + if (!x.s || !y.s || xc && !xc[0] && !yc || yc && !yc[0] && !xc) { + y.c = y.e = y.s = null; + } else { + y.s *= x.s; + + // Return ±Infinity if either is ±Infinity. + if (!xc || !yc) { + y.c = y.e = null; + + // Return ±0 if either is ±0. + } else { + y.c = [0]; + y.e = 0; + } + } + + return y; + } + + e = bitFloor(x.e / LOG_BASE) + bitFloor(y.e / LOG_BASE); + y.s *= x.s; + xcL = xc.length; + ycL = yc.length; + + // Ensure xc points to longer array and xcL to its length. + if (xcL < ycL) zc = xc, xc = yc, yc = zc, i = xcL, xcL = ycL, ycL = i; + + // Initialise the result array with zeros. + for (i = xcL + ycL, zc = []; i--; zc.push(0)); + + base = BASE; + sqrtBase = SQRT_BASE; + + for (i = ycL; --i >= 0;) { + c = 0; + ylo = yc[i] % sqrtBase; + yhi = yc[i] / sqrtBase | 0; + + for (k = xcL, j = i + k; j > i;) { + xlo = xc[--k] % sqrtBase; + xhi = xc[k] / sqrtBase | 0; + m = yhi * xlo + xhi * ylo; + xlo = ylo * xlo + ((m % sqrtBase) * sqrtBase) + zc[j] + c; + c = (xlo / base | 0) + (m / sqrtBase | 0) + yhi * xhi; + zc[j--] = xlo % base; + } + + zc[j] = c; + } + + if (c) { + ++e; + } else { + zc.splice(0, 1); + } + + return normalise(y, zc, e); + }; + + + /* + * Return a new BigNumber whose value is the value of this BigNumber negated, + * i.e. multiplied by -1. + */ + P.negated = function () { + var x = new BigNumber(this); + x.s = -x.s || null; + return x; + }; + + + /* + * n + 0 = n + * n + N = N + * n + I = I + * 0 + n = n + * 0 + 0 = 0 + * 0 + N = N + * 0 + I = I + * N + n = N + * N + 0 = N + * N + N = N + * N + I = N + * I + n = I + * I + 0 = I + * I + N = N + * I + I = I + * + * Return a new BigNumber whose value is the value of this BigNumber plus the value of + * BigNumber(y, b). + */ + P.plus = function (y, b) { + var t, + x = this, + a = x.s; + + y = new BigNumber(y, b); + b = y.s; + + // Either NaN? + if (!a || !b) return new BigNumber(NaN); + + // Signs differ? + if (a != b) { + y.s = -b; + return x.minus(y); + } + + var xe = x.e / LOG_BASE, + ye = y.e / LOG_BASE, + xc = x.c, + yc = y.c; + + if (!xe || !ye) { + + // Return ±Infinity if either ±Infinity. + if (!xc || !yc) return new BigNumber(a / 0); + + // Either zero? + // Return y if y is non-zero, x if x is non-zero, or zero if both are zero. + if (!xc[0] || !yc[0]) return yc[0] ? y : new BigNumber(xc[0] ? x : a * 0); + } + + xe = bitFloor(xe); + ye = bitFloor(ye); + xc = xc.slice(); + + // Prepend zeros to equalise exponents. Faster to use reverse then do unshifts. + if (a = xe - ye) { + if (a > 0) { + ye = xe; + t = yc; + } else { + a = -a; + t = xc; + } + + t.reverse(); + for (; a--; t.push(0)); + t.reverse(); + } + + a = xc.length; + b = yc.length; + + // Point xc to the longer array, and b to the shorter length. + if (a - b < 0) t = yc, yc = xc, xc = t, b = a; + + // Only start adding at yc.length - 1 as the further digits of xc can be ignored. + for (a = 0; b;) { + a = (xc[--b] = xc[b] + yc[b] + a) / BASE | 0; + xc[b] = BASE === xc[b] ? 0 : xc[b] % BASE; + } + + if (a) { + xc = [a].concat(xc); + ++ye; + } + + // No need to check for zero, as +x + +y != 0 && -x + -y != 0 + // ye = MAX_EXP + 1 possible + return normalise(y, xc, ye); + }; + + + /* + * If sd is undefined or null or true or false, return the number of significant digits of + * the value of this BigNumber, or null if the value of this BigNumber is ±Infinity or NaN. + * If sd is true include integer-part trailing zeros in the count. + * + * Otherwise, if sd is a number, return a new BigNumber whose value is the value of this + * BigNumber rounded to a maximum of sd significant digits using rounding mode rm, or + * ROUNDING_MODE if rm is omitted. + * + * sd {number|boolean} number: significant digits: integer, 1 to MAX inclusive. + * boolean: whether to count integer-part trailing zeros: true or false. + * [rm] {number} Rounding mode. Integer, 0 to 8 inclusive. + * + * '[BigNumber Error] Argument {not a primitive number|not an integer|out of range}: {sd|rm}' + */ + P.precision = P.sd = function (sd, rm) { + var c, n, v, + x = this; + + if (sd != null && sd !== !!sd) { + intCheck(sd, 1, MAX); + if (rm == null) rm = ROUNDING_MODE; + else intCheck(rm, 0, 8); + + return round(new BigNumber(x), sd, rm); + } + + if (!(c = x.c)) return null; + v = c.length - 1; + n = v * LOG_BASE + 1; + + if (v = c[v]) { + + // Subtract the number of trailing zeros of the last element. + for (; v % 10 == 0; v /= 10, n--); + + // Add the number of digits of the first element. + for (v = c[0]; v >= 10; v /= 10, n++); + } + + if (sd && x.e + 1 > n) n = x.e + 1; + + return n; + }; + + + /* + * Return a new BigNumber whose value is the value of this BigNumber shifted by k places + * (powers of 10). Shift to the right if n > 0, and to the left if n < 0. + * + * k {number} Integer, -MAX_SAFE_INTEGER to MAX_SAFE_INTEGER inclusive. + * + * '[BigNumber Error] Argument {not a primitive number|not an integer|out of range}: {k}' + */ + P.shiftedBy = function (k) { + intCheck(k, -MAX_SAFE_INTEGER, MAX_SAFE_INTEGER); + return this.times('1e' + k); + }; + + + /* + * sqrt(-n) = N + * sqrt(N) = N + * sqrt(-I) = N + * sqrt(I) = I + * sqrt(0) = 0 + * sqrt(-0) = -0 + * + * Return a new BigNumber whose value is the square root of the value of this BigNumber, + * rounded according to DECIMAL_PLACES and ROUNDING_MODE. + */ + P.squareRoot = P.sqrt = function () { + var m, n, r, rep, t, + x = this, + c = x.c, + s = x.s, + e = x.e, + dp = DECIMAL_PLACES + 4, + half = new BigNumber('0.5'); + + // Negative/NaN/Infinity/zero? + if (s !== 1 || !c || !c[0]) { + return new BigNumber(!s || s < 0 && (!c || c[0]) ? NaN : c ? x : 1 / 0); + } + + // Initial estimate. + s = Math.sqrt(+x); + + // Math.sqrt underflow/overflow? + // Pass x to Math.sqrt as integer, then adjust the exponent of the result. + if (s == 0 || s == 1 / 0) { + n = coeffToString(c); + if ((n.length + e) % 2 == 0) n += '0'; + s = Math.sqrt(n); + e = bitFloor((e + 1) / 2) - (e < 0 || e % 2); + + if (s == 1 / 0) { + n = '1e' + e; + } else { + n = s.toExponential(); + n = n.slice(0, n.indexOf('e') + 1) + e; + } + + r = new BigNumber(n); + } else { + r = new BigNumber(s + ''); + } + + // Check for zero. + // r could be zero if MIN_EXP is changed after the this value was created. + // This would cause a division by zero (x/t) and hence Infinity below, which would cause + // coeffToString to throw. + if (r.c[0]) { + e = r.e; + s = e + dp; + if (s < 3) s = 0; + + // Newton-Raphson iteration. + for (; ;) { + t = r; + r = half.times(t.plus(div(x, t, dp, 1))); + + if (coeffToString(t.c ).slice(0, s) === (n = + coeffToString(r.c)).slice(0, s)) { + + // The exponent of r may here be one less than the final result exponent, + // e.g 0.0009999 (e-4) --> 0.001 (e-3), so adjust s so the rounding digits + // are indexed correctly. + if (r.e < e) --s; + n = n.slice(s - 3, s + 1); + + // The 4th rounding digit may be in error by -1 so if the 4 rounding digits + // are 9999 or 4999 (i.e. approaching a rounding boundary) continue the + // iteration. + if (n == '9999' || !rep && n == '4999') { + + // On the first iteration only, check to see if rounding up gives the + // exact result as the nines may infinitely repeat. + if (!rep) { + round(t, t.e + DECIMAL_PLACES + 2, 0); + + if (t.times(t).eq(x)) { + r = t; + break; + } + } + + dp += 4; + s += 4; + rep = 1; + } else { + + // If rounding digits are null, 0{0,4} or 50{0,3}, check for exact + // result. If not, then there are further digits and m will be truthy. + if (!+n || !+n.slice(1) && n.charAt(0) == '5') { + + // Truncate to the first rounding digit. + round(r, r.e + DECIMAL_PLACES + 2, 1); + m = !r.times(r).eq(x); + } + + break; + } + } + } + } + + return round(r, r.e + DECIMAL_PLACES + 1, ROUNDING_MODE, m); + }; + + + /* + * Return a string representing the value of this BigNumber in exponential notation and + * rounded using ROUNDING_MODE to dp fixed decimal places. + * + * [dp] {number} Decimal places. Integer, 0 to MAX inclusive. + * [rm] {number} Rounding mode. Integer, 0 to 8 inclusive. + * + * '[BigNumber Error] Argument {not a primitive number|not an integer|out of range}: {dp|rm}' + */ + P.toExponential = function (dp, rm) { + if (dp != null) { + intCheck(dp, 0, MAX); + dp++; + } + return format(this, dp, rm, 1); + }; + + + /* + * Return a string representing the value of this BigNumber in fixed-point notation rounding + * to dp fixed decimal places using rounding mode rm, or ROUNDING_MODE if rm is omitted. + * + * Note: as with JavaScript's number type, (-0).toFixed(0) is '0', + * but e.g. (-0.00001).toFixed(0) is '-0'. + * + * [dp] {number} Decimal places. Integer, 0 to MAX inclusive. + * [rm] {number} Rounding mode. Integer, 0 to 8 inclusive. + * + * '[BigNumber Error] Argument {not a primitive number|not an integer|out of range}: {dp|rm}' + */ + P.toFixed = function (dp, rm) { + if (dp != null) { + intCheck(dp, 0, MAX); + dp = dp + this.e + 1; + } + return format(this, dp, rm); + }; + + + /* + * Return a string representing the value of this BigNumber in fixed-point notation rounded + * using rm or ROUNDING_MODE to dp decimal places, and formatted according to the properties + * of the FORMAT object (see BigNumber.set). + * + * FORMAT = { + * decimalSeparator : '.', + * groupSeparator : ',', + * groupSize : 3, + * secondaryGroupSize : 0, + * fractionGroupSeparator : '\xA0', // non-breaking space + * fractionGroupSize : 0 + * }; + * + * [dp] {number} Decimal places. Integer, 0 to MAX inclusive. + * [rm] {number} Rounding mode. Integer, 0 to 8 inclusive. + * + * '[BigNumber Error] Argument {not a primitive number|not an integer|out of range}: {dp|rm}' + */ + P.toFormat = function (dp, rm) { + var str = this.toFixed(dp, rm); + + if (this.c) { + var i, + arr = str.split('.'), + g1 = +FORMAT.groupSize, + g2 = +FORMAT.secondaryGroupSize, + groupSeparator = FORMAT.groupSeparator, + intPart = arr[0], + fractionPart = arr[1], + isNeg = this.s < 0, + intDigits = isNeg ? intPart.slice(1) : intPart, + len = intDigits.length; + + if (g2) i = g1, g1 = g2, g2 = i, len -= i; + + if (g1 > 0 && len > 0) { + i = len % g1 || g1; + intPart = intDigits.substr(0, i); + + for (; i < len; i += g1) { + intPart += groupSeparator + intDigits.substr(i, g1); + } + + if (g2 > 0) intPart += groupSeparator + intDigits.slice(i); + if (isNeg) intPart = '-' + intPart; + } + + str = fractionPart + ? intPart + FORMAT.decimalSeparator + ((g2 = +FORMAT.fractionGroupSize) + ? fractionPart.replace(new RegExp('\\d{' + g2 + '}\\B', 'g'), + '$&' + FORMAT.fractionGroupSeparator) + : fractionPart) + : intPart; + } + + return str; + }; + + + /* + * Return a string array representing the value of this BigNumber as a simple fraction with + * an integer numerator and an integer denominator. The denominator will be a positive + * non-zero value less than or equal to the specified maximum denominator. If a maximum + * denominator is not specified, the denominator will be the lowest value necessary to + * represent the number exactly. + * + * [md] {number|string|BigNumber} Integer >= 1, or Infinity. The maximum denominator. + * + * '[BigNumber Error] Argument {not an integer|out of range} : {md}' + */ + P.toFraction = function (md) { + var arr, d, d0, d1, d2, e, exp, n, n0, n1, q, s, + x = this, + xc = x.c; + + if (md != null) { + n = new BigNumber(md); + + // Throw if md is less than one or is not an integer, unless it is Infinity. + if (!n.isInteger() && (n.c || n.s !== 1) || n.lt(ONE)) { + throw Error + (bignumberError + 'Argument ' + + (n.isInteger() ? 'out of range: ' : 'not an integer: ') + md); + } + } + + if (!xc) return x.toString(); + + d = new BigNumber(ONE); + n1 = d0 = new BigNumber(ONE); + d1 = n0 = new BigNumber(ONE); + s = coeffToString(xc); + + // Determine initial denominator. + // d is a power of 10 and the minimum max denominator that specifies the value exactly. + e = d.e = s.length - x.e - 1; + d.c[0] = POWS_TEN[(exp = e % LOG_BASE) < 0 ? LOG_BASE + exp : exp]; + md = !md || n.comparedTo(d) > 0 ? (e > 0 ? d : n1) : n; + + exp = MAX_EXP; + MAX_EXP = 1 / 0; + n = new BigNumber(s); + + // n0 = d1 = 0 + n0.c[0] = 0; + + for (; ;) { + q = div(n, d, 0, 1); + d2 = d0.plus(q.times(d1)); + if (d2.comparedTo(md) == 1) break; + d0 = d1; + d1 = d2; + n1 = n0.plus(q.times(d2 = n1)); + n0 = d2; + d = n.minus(q.times(d2 = d)); + n = d2; + } + + d2 = div(md.minus(d0), d1, 0, 1); + n0 = n0.plus(d2.times(n1)); + d0 = d0.plus(d2.times(d1)); + n0.s = n1.s = x.s; + e *= 2; + + // Determine which fraction is closer to x, n0/d0 or n1/d1 + arr = div(n1, d1, e, ROUNDING_MODE).minus(x).abs().comparedTo( + div(n0, d0, e, ROUNDING_MODE).minus(x).abs()) < 1 + ? [n1.toString(), d1.toString()] + : [n0.toString(), d0.toString()]; + + MAX_EXP = exp; + return arr; + }; + + + /* + * Return the value of this BigNumber converted to a number primitive. + */ + P.toNumber = function () { + return +this; + }; + + + /* + * Return a string representing the value of this BigNumber rounded to sd significant digits + * using rounding mode rm or ROUNDING_MODE. If sd is less than the number of digits + * necessary to represent the integer part of the value in fixed-point notation, then use + * exponential notation. + * + * [sd] {number} Significant digits. Integer, 1 to MAX inclusive. + * [rm] {number} Rounding mode. Integer, 0 to 8 inclusive. + * + * '[BigNumber Error] Argument {not a primitive number|not an integer|out of range}: {sd|rm}' + */ + P.toPrecision = function (sd, rm) { + if (sd != null) intCheck(sd, 1, MAX); + return format(this, sd, rm, 2); + }; + + + /* + * Return a string representing the value of this BigNumber in base b, or base 10 if b is + * omitted. If a base is specified, including base 10, round according to DECIMAL_PLACES and + * ROUNDING_MODE. If a base is not specified, and this BigNumber has a positive exponent + * that is equal to or greater than TO_EXP_POS, or a negative exponent equal to or less than + * TO_EXP_NEG, return exponential notation. + * + * [b] {number} Integer, 2 to ALPHABET.length inclusive. + * + * '[BigNumber Error] Base {not a primitive number|not an integer|out of range}: {b}' + */ + P.toString = function (b) { + var str, + n = this, + s = n.s, + e = n.e; + + // Infinity or NaN? + if (e === null) { + + if (s) { + str = 'Infinity'; + if (s < 0) str = '-' + str; + } else { + str = 'NaN'; + } + } else { + str = coeffToString(n.c); + + if (b == null) { + str = e <= TO_EXP_NEG || e >= TO_EXP_POS + ? toExponential(str, e) + : toFixedPoint(str, e, '0'); + } else { + intCheck(b, 2, ALPHABET.length, 'Base'); + str = convertBase(toFixedPoint(str, e, '0'), 10, b, s, true); + } + + if (s < 0 && n.c[0]) str = '-' + str; + } + + return str; + }; + + + /* + * Return as toString, but do not accept a base argument, and include the minus sign for + * negative zero. + */ + P.valueOf = P.toJSON = function () { + var str, + n = this, + e = n.e; + + if (e === null) return n.toString(); + + str = coeffToString(n.c); + + str = e <= TO_EXP_NEG || e >= TO_EXP_POS + ? toExponential(str, e) + : toFixedPoint(str, e, '0'); + + return n.s < 0 ? '-' + str : str; + }; + + + P._isBigNumber = true; + + if (configObject != null) BigNumber.set(configObject); + + return BigNumber; + } + + + // PRIVATE HELPER FUNCTIONS + + + function bitFloor(n) { + var i = n | 0; + return n > 0 || n === i ? i : i - 1; + } + + + // Return a coefficient array as a string of base 10 digits. + function coeffToString(a) { + var s, z, + i = 1, + j = a.length, + r = a[0] + ''; + + for (; i < j;) { + s = a[i++] + ''; + z = LOG_BASE - s.length; + for (; z--; s = '0' + s); + r += s; + } + + // Determine trailing zeros. + for (j = r.length; r.charCodeAt(--j) === 48;); + return r.slice(0, j + 1 || 1); + } + + + // Compare the value of BigNumbers x and y. + function compare(x, y) { + var a, b, + xc = x.c, + yc = y.c, + i = x.s, + j = y.s, + k = x.e, + l = y.e; + + // Either NaN? + if (!i || !j) return null; + + a = xc && !xc[0]; + b = yc && !yc[0]; + + // Either zero? + if (a || b) return a ? b ? 0 : -j : i; + + // Signs differ? + if (i != j) return i; + + a = i < 0; + b = k == l; + + // Either Infinity? + if (!xc || !yc) return b ? 0 : !xc ^ a ? 1 : -1; + + // Compare exponents. + if (!b) return k > l ^ a ? 1 : -1; + + j = (k = xc.length) < (l = yc.length) ? k : l; + + // Compare digit by digit. + for (i = 0; i < j; i++) if (xc[i] != yc[i]) return xc[i] > yc[i] ^ a ? 1 : -1; + + // Compare lengths. + return k == l ? 0 : k > l ^ a ? 1 : -1; + } + + + /* + * Check that n is a primitive number, an integer, and in range, otherwise throw. + */ + function intCheck(n, min, max, name) { + if (n < min || n > max || n !== (n < 0 ? mathceil(n) : mathfloor(n))) { + throw Error + (bignumberError + (name || 'Argument') + (typeof n == 'number' + ? n < min || n > max ? ' out of range: ' : ' not an integer: ' + : ' not a primitive number: ') + n); + } + } + + + function isArray(obj) { + return Object.prototype.toString.call(obj) == '[object Array]'; + } + + + // Assumes finite n. + function isOdd(n) { + var k = n.c.length - 1; + return bitFloor(n.e / LOG_BASE) == k && n.c[k] % 2 != 0; + } + + + function toExponential(str, e) { + return (str.length > 1 ? str.charAt(0) + '.' + str.slice(1) : str) + + (e < 0 ? 'e' : 'e+') + e; + } + + + function toFixedPoint(str, e, z) { + var len, zs; + + // Negative exponent? + if (e < 0) { + + // Prepend zeros. + for (zs = z + '.'; ++e; zs += z); + str = zs + str; + + // Positive exponent + } else { + len = str.length; + + // Append zeros. + if (++e > len) { + for (zs = z, e -= len; --e; zs += z); + str += zs; + } else if (e < len) { + str = str.slice(0, e) + '.' + str.slice(e); + } + } + + return str; + } + + + // EXPORT + + + BigNumber = clone(); + BigNumber['default'] = BigNumber.BigNumber = BigNumber; + + // AMD. + if (typeof undefined == 'function' && undefined.amd) { + undefined(function () { return BigNumber; }); + + // Node.js and other environments that support module.exports. + } else if ('object' != 'undefined' && module.exports) { + module.exports = BigNumber; + + // Browser. + } else { + if (!globalObject) { + globalObject = typeof self != 'undefined' && self ? self : window; + } + + globalObject.BigNumber = BigNumber; + } +})(commonjsGlobal); +}); + +var constants = createCommonjsModule(function (module, exports) { +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +class Constants { +} +Constants.SYS_NUM_CARDINAL = "builtin.num.cardinal"; +Constants.SYS_NUM_DOUBLE = "builtin.num.double"; +Constants.SYS_NUM_FRACTION = "builtin.num.fraction"; +Constants.SYS_NUM_INTEGER = "builtin.num.integer"; +Constants.SYS_NUM = "builtin.num"; +Constants.SYS_NUM_ORDINAL = "builtin.num.ordinal"; +Constants.SYS_NUM_PERCENTAGE = "builtin.num.percentage"; +// NARROW NO-BREAK SPACE +Constants.NO_BREAK_SPACE = '\u202f'; +exports.Constants = Constants; + +}); + +unwrapExports(constants); + +var models$2 = createCommonjsModule(function (module, exports) { +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); + +var NumberMode; +(function (NumberMode) { + // Default is for unit and datetime + NumberMode[NumberMode["Default"] = 0] = "Default"; + // Add 67.5 billion & million support. + NumberMode[NumberMode["Currency"] = 1] = "Currency"; + // Don't extract number from cases like 16ml + NumberMode[NumberMode["PureNumber"] = 2] = "PureNumber"; +})(NumberMode = exports.NumberMode || (exports.NumberMode = {})); +class LongFormatType { + constructor(thousandsMark, decimalsMark) { + this.thousandsMark = thousandsMark; + this.decimalsMark = decimalsMark; + } +} +// Reference : https://www.wikiwand.com/en/Decimal_mark +// Value : 1234567.89 +// 1,234,567 +LongFormatType.integerNumComma = new LongFormatType(',', '\0'); +// 1.234.567 +LongFormatType.integerNumDot = new LongFormatType('.', '\0'); +// 1 234 567 +LongFormatType.integerNumBlank = new LongFormatType(' ', '\0'); +// 1 234 567 +LongFormatType.integerNumNoBreakSpace = new LongFormatType(constants.Constants.NO_BREAK_SPACE, '\0'); +// 1'234'567 +LongFormatType.integerNumQuote = new LongFormatType('\'', '\0'); +// 1,234,567.89 +LongFormatType.doubleNumCommaDot = new LongFormatType(',', '.'); +// 1,234,567·89 +LongFormatType.doubleNumCommaCdot = new LongFormatType(',', '·'); +// 1 234 567,89 +LongFormatType.doubleNumBlankComma = new LongFormatType(' ', ','); +// 1 234 567,89 +LongFormatType.doubleNumNoBreakSpaceComma = new LongFormatType(constants.Constants.NO_BREAK_SPACE, ','); +// 1 234 567.89 +LongFormatType.doubleNumBlankDot = new LongFormatType(' ', '.'); +// 1 234 567.89 +LongFormatType.doubleNumNoBreakSpaceDot = new LongFormatType(constants.Constants.NO_BREAK_SPACE, '.'); +// 1.234.567,89 +LongFormatType.doubleNumDotComma = new LongFormatType('.', ','); +// 1'234'567,89 +LongFormatType.doubleNumQuoteComma = new LongFormatType('\'', ','); +exports.LongFormatType = LongFormatType; +class AbstractNumberModel { + constructor(parser, extractor) { + this.extractor = extractor; + this.parser = parser; + } + parse(query) { + let extractResults = this.extractor.extract(query); + let parseNums = extractResults.map(r => this.parser.parse(r)); + return parseNums + .map(o => o) + .map(o => ({ + start: o.start, + end: o.start + o.length - 1, + resolution: { value: o.resolutionStr }, + text: o.text, + typeName: this.modelTypeName + })); + } +} +exports.AbstractNumberModel = AbstractNumberModel; +class NumberModel extends AbstractNumberModel { + constructor() { + super(...arguments); + this.modelTypeName = "number"; + } +} +exports.NumberModel = NumberModel; +class OrdinalModel extends AbstractNumberModel { + constructor() { + super(...arguments); + this.modelTypeName = "ordinal"; + } +} +exports.OrdinalModel = OrdinalModel; +class PercentModel extends AbstractNumberModel { + constructor() { + super(...arguments); + this.modelTypeName = "percentage"; + } +} +exports.PercentModel = PercentModel; + +}); + +unwrapExports(models$2); + +var culture$2 = createCommonjsModule(function (module, exports) { +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); + + + + +class Culture extends recognizersText.Culture { + constructor(cultureName, cultureCode, longFormat) { + super(cultureName, cultureCode); + this.longFormat = longFormat; + } +} +Culture.supportedCultures = [ + new Culture("English", Culture.English, new models$2.LongFormatType(',', '.')), + new Culture("Chinese", Culture.Chinese, null), + new Culture("Spanish", Culture.Spanish, new models$2.LongFormatType('.', ',')), + new Culture("Portuguese", Culture.Portuguese, new models$2.LongFormatType('.', ',')), + new Culture("French", Culture.French, new models$2.LongFormatType('.', ',')), + new Culture("Japanese", Culture.Japanese, new models$2.LongFormatType(',', '.')) +]; +exports.Culture = Culture; +class CultureInfo extends recognizersText.CultureInfo { + format(value) { + let bigNumber = new bignumber.BigNumber(value); + let s; + if (bigNumber.decimalPlaces()) { + s = bigNumber.precision(15, bignumber.BigNumber.ROUND_HALF_UP).toString(); + } + else { + s = bigNumber.toString().toUpperCase(); + } + if (s.indexOf('.') > -1) { + // trim leading 0 from decimal places + s = lodash_trimend(s, '0'); + } + if (s.indexOf('e-') > -1) { + // mimic .NET behavior by adding leading 0 to exponential. E.g.: 1E-07 + let p = s.split('e-'); + p[1] = p[1].length === 1 ? ('0' + p[1]) : p[1]; + s = p.join('E-'); + } + // TODO: Use BigNumber.toFormat instead + let culture = Culture.supportedCultures.find(c => c.cultureCode === this.code); + if (culture && culture.longFormat) { + return s + .split(',') + .map(t => t.split('.').join(culture.longFormat.decimalsMark)) + .join(culture.longFormat.thousandsMark); + } + return s; + } +} +exports.CultureInfo = CultureInfo; + +}); + +unwrapExports(culture$2); + +var lodash_sortby = createCommonjsModule(function (module, exports) { +/** + * lodash (Custom Build) + * Build: `lodash modularize exports="npm" -o ./` + * Copyright jQuery Foundation and other contributors + * Released under MIT license + * Based on Underscore.js 1.8.3 + * Copyright Jeremy Ashkenas, DocumentCloud and Investigative Reporters & Editors + */ + +/** Used as the size to enable large array optimizations. */ +var LARGE_ARRAY_SIZE = 200; + +/** Used as the `TypeError` message for "Functions" methods. */ +var FUNC_ERROR_TEXT = 'Expected a function'; + +/** Used to stand-in for `undefined` hash values. */ +var HASH_UNDEFINED = '__lodash_hash_undefined__'; + +/** Used to compose bitmasks for comparison styles. */ +var UNORDERED_COMPARE_FLAG = 1, + PARTIAL_COMPARE_FLAG = 2; + +/** Used as references for various `Number` constants. */ +var INFINITY = 1 / 0, + MAX_SAFE_INTEGER = 9007199254740991; + +/** `Object#toString` result references. */ +var argsTag = '[object Arguments]', + arrayTag = '[object Array]', + boolTag = '[object Boolean]', + dateTag = '[object Date]', + errorTag = '[object Error]', + funcTag = '[object Function]', + genTag = '[object GeneratorFunction]', + mapTag = '[object Map]', + numberTag = '[object Number]', + objectTag = '[object Object]', + promiseTag = '[object Promise]', + regexpTag = '[object RegExp]', + setTag = '[object Set]', + stringTag = '[object String]', + symbolTag = '[object Symbol]', + weakMapTag = '[object WeakMap]'; + +var arrayBufferTag = '[object ArrayBuffer]', + dataViewTag = '[object DataView]', + float32Tag = '[object Float32Array]', + float64Tag = '[object Float64Array]', + int8Tag = '[object Int8Array]', + int16Tag = '[object Int16Array]', + int32Tag = '[object Int32Array]', + uint8Tag = '[object Uint8Array]', + uint8ClampedTag = '[object Uint8ClampedArray]', + uint16Tag = '[object Uint16Array]', + uint32Tag = '[object Uint32Array]'; + +/** Used to match property names within property paths. */ +var reIsDeepProp = /\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/, + reIsPlainProp = /^\w*$/, + reLeadingDot = /^\./, + rePropName = /[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g; + +/** + * Used to match `RegExp` + * [syntax characters](http://ecma-international.org/ecma-262/7.0/#sec-patterns). + */ +var reRegExpChar = /[\\^$.*+?()[\]{}|]/g; + +/** Used to match backslashes in property paths. */ +var reEscapeChar = /\\(\\)?/g; + +/** Used to detect host constructors (Safari). */ +var reIsHostCtor = /^\[object .+?Constructor\]$/; + +/** Used to detect unsigned integer values. */ +var reIsUint = /^(?:0|[1-9]\d*)$/; + +/** Used to identify `toStringTag` values of typed arrays. */ +var typedArrayTags = {}; +typedArrayTags[float32Tag] = typedArrayTags[float64Tag] = +typedArrayTags[int8Tag] = typedArrayTags[int16Tag] = +typedArrayTags[int32Tag] = typedArrayTags[uint8Tag] = +typedArrayTags[uint8ClampedTag] = typedArrayTags[uint16Tag] = +typedArrayTags[uint32Tag] = true; +typedArrayTags[argsTag] = typedArrayTags[arrayTag] = +typedArrayTags[arrayBufferTag] = typedArrayTags[boolTag] = +typedArrayTags[dataViewTag] = typedArrayTags[dateTag] = +typedArrayTags[errorTag] = typedArrayTags[funcTag] = +typedArrayTags[mapTag] = typedArrayTags[numberTag] = +typedArrayTags[objectTag] = typedArrayTags[regexpTag] = +typedArrayTags[setTag] = typedArrayTags[stringTag] = +typedArrayTags[weakMapTag] = false; + +/** Detect free variable `global` from Node.js. */ +var freeGlobal = typeof commonjsGlobal == 'object' && commonjsGlobal && commonjsGlobal.Object === Object && commonjsGlobal; + +/** Detect free variable `self`. */ +var freeSelf = typeof self == 'object' && self && self.Object === Object && self; + +/** Used as a reference to the global object. */ +var root = freeGlobal || freeSelf || Function('return this')(); + +/** Detect free variable `exports`. */ +var freeExports = 'object' == 'object' && exports && !exports.nodeType && exports; + +/** Detect free variable `module`. */ +var freeModule = freeExports && 'object' == 'object' && module && !module.nodeType && module; + +/** Detect the popular CommonJS extension `module.exports`. */ +var moduleExports = freeModule && freeModule.exports === freeExports; + +/** Detect free variable `process` from Node.js. */ +var freeProcess = moduleExports && freeGlobal.process; + +/** Used to access faster Node.js helpers. */ +var nodeUtil = (function() { + try { + return freeProcess && freeProcess.binding('util'); + } catch (e) {} +}()); + +/* Node.js helper references. */ +var nodeIsTypedArray = nodeUtil && nodeUtil.isTypedArray; + +/** + * A faster alternative to `Function#apply`, this function invokes `func` + * with the `this` binding of `thisArg` and the arguments of `args`. + * + * @private + * @param {Function} func The function to invoke. + * @param {*} thisArg The `this` binding of `func`. + * @param {Array} args The arguments to invoke `func` with. + * @returns {*} Returns the result of `func`. + */ +function apply(func, thisArg, args) { + switch (args.length) { + case 0: return func.call(thisArg); + case 1: return func.call(thisArg, args[0]); + case 2: return func.call(thisArg, args[0], args[1]); + case 3: return func.call(thisArg, args[0], args[1], args[2]); + } + return func.apply(thisArg, args); +} + +/** + * A specialized version of `_.map` for arrays without support for iteratee + * shorthands. + * + * @private + * @param {Array} [array] The array to iterate over. + * @param {Function} iteratee The function invoked per iteration. + * @returns {Array} Returns the new mapped array. + */ +function arrayMap(array, iteratee) { + var index = -1, + length = array ? array.length : 0, + result = Array(length); + + while (++index < length) { + result[index] = iteratee(array[index], index, array); + } + return result; +} + +/** + * Appends the elements of `values` to `array`. + * + * @private + * @param {Array} array The array to modify. + * @param {Array} values The values to append. + * @returns {Array} Returns `array`. + */ +function arrayPush(array, values) { + var index = -1, + length = values.length, + offset = array.length; + + while (++index < length) { + array[offset + index] = values[index]; + } + return array; +} + +/** + * A specialized version of `_.some` for arrays without support for iteratee + * shorthands. + * + * @private + * @param {Array} [array] The array to iterate over. + * @param {Function} predicate The function invoked per iteration. + * @returns {boolean} Returns `true` if any element passes the predicate check, + * else `false`. + */ +function arraySome(array, predicate) { + var index = -1, + length = array ? array.length : 0; + + while (++index < length) { + if (predicate(array[index], index, array)) { + return true; + } + } + return false; +} + +/** + * The base implementation of `_.property` without support for deep paths. + * + * @private + * @param {string} key The key of the property to get. + * @returns {Function} Returns the new accessor function. + */ +function baseProperty(key) { + return function(object) { + return object == null ? undefined : object[key]; + }; +} + +/** + * The base implementation of `_.sortBy` which uses `comparer` to define the + * sort order of `array` and replaces criteria objects with their corresponding + * values. + * + * @private + * @param {Array} array The array to sort. + * @param {Function} comparer The function to define sort order. + * @returns {Array} Returns `array`. + */ +function baseSortBy(array, comparer) { + var length = array.length; + + array.sort(comparer); + while (length--) { + array[length] = array[length].value; + } + return array; +} + +/** + * The base implementation of `_.times` without support for iteratee shorthands + * or max array length checks. + * + * @private + * @param {number} n The number of times to invoke `iteratee`. + * @param {Function} iteratee The function invoked per iteration. + * @returns {Array} Returns the array of results. + */ +function baseTimes(n, iteratee) { + var index = -1, + result = Array(n); + + while (++index < n) { + result[index] = iteratee(index); + } + return result; +} + +/** + * The base implementation of `_.unary` without support for storing metadata. + * + * @private + * @param {Function} func The function to cap arguments for. + * @returns {Function} Returns the new capped function. + */ +function baseUnary(func) { + return function(value) { + return func(value); + }; +} + +/** + * Gets the value at `key` of `object`. + * + * @private + * @param {Object} [object] The object to query. + * @param {string} key The key of the property to get. + * @returns {*} Returns the property value. + */ +function getValue(object, key) { + return object == null ? undefined : object[key]; +} + +/** + * Checks if `value` is a host object in IE < 9. + * + * @private + * @param {*} value The value to check. + * @returns {boolean} Returns `true` if `value` is a host object, else `false`. + */ +function isHostObject(value) { + // Many host objects are `Object` objects that can coerce to strings + // despite having improperly defined `toString` methods. + var result = false; + if (value != null && typeof value.toString != 'function') { + try { + result = !!(value + ''); + } catch (e) {} + } + return result; +} + +/** + * Converts `map` to its key-value pairs. + * + * @private + * @param {Object} map The map to convert. + * @returns {Array} Returns the key-value pairs. + */ +function mapToArray(map) { + var index = -1, + result = Array(map.size); + + map.forEach(function(value, key) { + result[++index] = [key, value]; + }); + return result; +} + +/** + * Creates a unary function that invokes `func` with its argument transformed. + * + * @private + * @param {Function} func The function to wrap. + * @param {Function} transform The argument transform. + * @returns {Function} Returns the new function. + */ +function overArg(func, transform) { + return function(arg) { + return func(transform(arg)); + }; +} + +/** + * Converts `set` to an array of its values. + * + * @private + * @param {Object} set The set to convert. + * @returns {Array} Returns the values. + */ +function setToArray(set) { + var index = -1, + result = Array(set.size); + + set.forEach(function(value) { + result[++index] = value; + }); + return result; +} + +/** Used for built-in method references. */ +var arrayProto = Array.prototype, + funcProto = Function.prototype, + objectProto = Object.prototype; + +/** Used to detect overreaching core-js shims. */ +var coreJsData = root['__core-js_shared__']; + +/** Used to detect methods masquerading as native. */ +var maskSrcKey = (function() { + var uid = /[^.]+$/.exec(coreJsData && coreJsData.keys && coreJsData.keys.IE_PROTO || ''); + return uid ? ('Symbol(src)_1.' + uid) : ''; +}()); + +/** Used to resolve the decompiled source of functions. */ +var funcToString = funcProto.toString; + +/** Used to check objects for own properties. */ +var hasOwnProperty = objectProto.hasOwnProperty; + +/** + * Used to resolve the + * [`toStringTag`](http://ecma-international.org/ecma-262/7.0/#sec-object.prototype.tostring) + * of values. + */ +var objectToString = objectProto.toString; + +/** Used to detect if a method is native. */ +var reIsNative = RegExp('^' + + funcToString.call(hasOwnProperty).replace(reRegExpChar, '\\$&') + .replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g, '$1.*?') + '$' +); + +/** Built-in value references. */ +var Symbol = root.Symbol, + Uint8Array = root.Uint8Array, + propertyIsEnumerable = objectProto.propertyIsEnumerable, + splice = arrayProto.splice, + spreadableSymbol = Symbol ? Symbol.isConcatSpreadable : undefined; + +/* Built-in method references for those with the same name as other `lodash` methods. */ +var nativeKeys = overArg(Object.keys, Object), + nativeMax = Math.max; + +/* Built-in method references that are verified to be native. */ +var DataView = getNative(root, 'DataView'), + Map = getNative(root, 'Map'), + Promise = getNative(root, 'Promise'), + Set = getNative(root, 'Set'), + WeakMap = getNative(root, 'WeakMap'), + nativeCreate = getNative(Object, 'create'); + +/** Used to detect maps, sets, and weakmaps. */ +var dataViewCtorString = toSource(DataView), + mapCtorString = toSource(Map), + promiseCtorString = toSource(Promise), + setCtorString = toSource(Set), + weakMapCtorString = toSource(WeakMap); + +/** Used to convert symbols to primitives and strings. */ +var symbolProto = Symbol ? Symbol.prototype : undefined, + symbolValueOf = symbolProto ? symbolProto.valueOf : undefined, + symbolToString = symbolProto ? symbolProto.toString : undefined; + +/** + * Creates a hash object. + * + * @private + * @constructor + * @param {Array} [entries] The key-value pairs to cache. + */ +function Hash(entries) { + var index = -1, + length = entries ? entries.length : 0; + + this.clear(); + while (++index < length) { + var entry = entries[index]; + this.set(entry[0], entry[1]); + } +} + +/** + * Removes all key-value entries from the hash. + * + * @private + * @name clear + * @memberOf Hash + */ +function hashClear() { + this.__data__ = nativeCreate ? nativeCreate(null) : {}; +} + +/** + * Removes `key` and its value from the hash. + * + * @private + * @name delete + * @memberOf Hash + * @param {Object} hash The hash to modify. + * @param {string} key The key of the value to remove. + * @returns {boolean} Returns `true` if the entry was removed, else `false`. + */ +function hashDelete(key) { + return this.has(key) && delete this.__data__[key]; +} + +/** + * Gets the hash value for `key`. + * + * @private + * @name get + * @memberOf Hash + * @param {string} key The key of the value to get. + * @returns {*} Returns the entry value. + */ +function hashGet(key) { + var data = this.__data__; + if (nativeCreate) { + var result = data[key]; + return result === HASH_UNDEFINED ? undefined : result; + } + return hasOwnProperty.call(data, key) ? data[key] : undefined; +} + +/** + * Checks if a hash value for `key` exists. + * + * @private + * @name has + * @memberOf Hash + * @param {string} key The key of the entry to check. + * @returns {boolean} Returns `true` if an entry for `key` exists, else `false`. + */ +function hashHas(key) { + var data = this.__data__; + return nativeCreate ? data[key] !== undefined : hasOwnProperty.call(data, key); +} + +/** + * Sets the hash `key` to `value`. + * + * @private + * @name set + * @memberOf Hash + * @param {string} key The key of the value to set. + * @param {*} value The value to set. + * @returns {Object} Returns the hash instance. + */ +function hashSet(key, value) { + var data = this.__data__; + data[key] = (nativeCreate && value === undefined) ? HASH_UNDEFINED : value; + return this; +} + +// Add methods to `Hash`. +Hash.prototype.clear = hashClear; +Hash.prototype['delete'] = hashDelete; +Hash.prototype.get = hashGet; +Hash.prototype.has = hashHas; +Hash.prototype.set = hashSet; + +/** + * Creates an list cache object. + * + * @private + * @constructor + * @param {Array} [entries] The key-value pairs to cache. + */ +function ListCache(entries) { + var index = -1, + length = entries ? entries.length : 0; + + this.clear(); + while (++index < length) { + var entry = entries[index]; + this.set(entry[0], entry[1]); + } +} + +/** + * Removes all key-value entries from the list cache. + * + * @private + * @name clear + * @memberOf ListCache + */ +function listCacheClear() { + this.__data__ = []; +} + +/** + * Removes `key` and its value from the list cache. + * + * @private + * @name delete + * @memberOf ListCache + * @param {string} key The key of the value to remove. + * @returns {boolean} Returns `true` if the entry was removed, else `false`. + */ +function listCacheDelete(key) { + var data = this.__data__, + index = assocIndexOf(data, key); + + if (index < 0) { + return false; + } + var lastIndex = data.length - 1; + if (index == lastIndex) { + data.pop(); + } else { + splice.call(data, index, 1); + } + return true; +} + +/** + * Gets the list cache value for `key`. + * + * @private + * @name get + * @memberOf ListCache + * @param {string} key The key of the value to get. + * @returns {*} Returns the entry value. + */ +function listCacheGet(key) { + var data = this.__data__, + index = assocIndexOf(data, key); + + return index < 0 ? undefined : data[index][1]; +} + +/** + * Checks if a list cache value for `key` exists. + * + * @private + * @name has + * @memberOf ListCache + * @param {string} key The key of the entry to check. + * @returns {boolean} Returns `true` if an entry for `key` exists, else `false`. + */ +function listCacheHas(key) { + return assocIndexOf(this.__data__, key) > -1; +} + +/** + * Sets the list cache `key` to `value`. + * + * @private + * @name set + * @memberOf ListCache + * @param {string} key The key of the value to set. + * @param {*} value The value to set. + * @returns {Object} Returns the list cache instance. + */ +function listCacheSet(key, value) { + var data = this.__data__, + index = assocIndexOf(data, key); + + if (index < 0) { + data.push([key, value]); + } else { + data[index][1] = value; + } + return this; +} + +// Add methods to `ListCache`. +ListCache.prototype.clear = listCacheClear; +ListCache.prototype['delete'] = listCacheDelete; +ListCache.prototype.get = listCacheGet; +ListCache.prototype.has = listCacheHas; +ListCache.prototype.set = listCacheSet; + +/** + * Creates a map cache object to store key-value pairs. + * + * @private + * @constructor + * @param {Array} [entries] The key-value pairs to cache. + */ +function MapCache(entries) { + var index = -1, + length = entries ? entries.length : 0; + + this.clear(); + while (++index < length) { + var entry = entries[index]; + this.set(entry[0], entry[1]); + } +} + +/** + * Removes all key-value entries from the map. + * + * @private + * @name clear + * @memberOf MapCache + */ +function mapCacheClear() { + this.__data__ = { + 'hash': new Hash, + 'map': new (Map || ListCache), + 'string': new Hash + }; +} + +/** + * Removes `key` and its value from the map. + * + * @private + * @name delete + * @memberOf MapCache + * @param {string} key The key of the value to remove. + * @returns {boolean} Returns `true` if the entry was removed, else `false`. + */ +function mapCacheDelete(key) { + return getMapData(this, key)['delete'](key); +} + +/** + * Gets the map value for `key`. + * + * @private + * @name get + * @memberOf MapCache + * @param {string} key The key of the value to get. + * @returns {*} Returns the entry value. + */ +function mapCacheGet(key) { + return getMapData(this, key).get(key); +} + +/** + * Checks if a map value for `key` exists. + * + * @private + * @name has + * @memberOf MapCache + * @param {string} key The key of the entry to check. + * @returns {boolean} Returns `true` if an entry for `key` exists, else `false`. + */ +function mapCacheHas(key) { + return getMapData(this, key).has(key); +} + +/** + * Sets the map `key` to `value`. + * + * @private + * @name set + * @memberOf MapCache + * @param {string} key The key of the value to set. + * @param {*} value The value to set. + * @returns {Object} Returns the map cache instance. + */ +function mapCacheSet(key, value) { + getMapData(this, key).set(key, value); + return this; +} + +// Add methods to `MapCache`. +MapCache.prototype.clear = mapCacheClear; +MapCache.prototype['delete'] = mapCacheDelete; +MapCache.prototype.get = mapCacheGet; +MapCache.prototype.has = mapCacheHas; +MapCache.prototype.set = mapCacheSet; + +/** + * + * Creates an array cache object to store unique values. + * + * @private + * @constructor + * @param {Array} [values] The values to cache. + */ +function SetCache(values) { + var index = -1, + length = values ? values.length : 0; + + this.__data__ = new MapCache; + while (++index < length) { + this.add(values[index]); + } +} + +/** + * Adds `value` to the array cache. + * + * @private + * @name add + * @memberOf SetCache + * @alias push + * @param {*} value The value to cache. + * @returns {Object} Returns the cache instance. + */ +function setCacheAdd(value) { + this.__data__.set(value, HASH_UNDEFINED); + return this; +} + +/** + * Checks if `value` is in the array cache. + * + * @private + * @name has + * @memberOf SetCache + * @param {*} value The value to search for. + * @returns {number} Returns `true` if `value` is found, else `false`. + */ +function setCacheHas(value) { + return this.__data__.has(value); +} + +// Add methods to `SetCache`. +SetCache.prototype.add = SetCache.prototype.push = setCacheAdd; +SetCache.prototype.has = setCacheHas; + +/** + * Creates a stack cache object to store key-value pairs. + * + * @private + * @constructor + * @param {Array} [entries] The key-value pairs to cache. + */ +function Stack(entries) { + this.__data__ = new ListCache(entries); +} + +/** + * Removes all key-value entries from the stack. + * + * @private + * @name clear + * @memberOf Stack + */ +function stackClear() { + this.__data__ = new ListCache; +} + +/** + * Removes `key` and its value from the stack. + * + * @private + * @name delete + * @memberOf Stack + * @param {string} key The key of the value to remove. + * @returns {boolean} Returns `true` if the entry was removed, else `false`. + */ +function stackDelete(key) { + return this.__data__['delete'](key); +} + +/** + * Gets the stack value for `key`. + * + * @private + * @name get + * @memberOf Stack + * @param {string} key The key of the value to get. + * @returns {*} Returns the entry value. + */ +function stackGet(key) { + return this.__data__.get(key); +} + +/** + * Checks if a stack value for `key` exists. + * + * @private + * @name has + * @memberOf Stack + * @param {string} key The key of the entry to check. + * @returns {boolean} Returns `true` if an entry for `key` exists, else `false`. + */ +function stackHas(key) { + return this.__data__.has(key); +} + +/** + * Sets the stack `key` to `value`. + * + * @private + * @name set + * @memberOf Stack + * @param {string} key The key of the value to set. + * @param {*} value The value to set. + * @returns {Object} Returns the stack cache instance. + */ +function stackSet(key, value) { + var cache = this.__data__; + if (cache instanceof ListCache) { + var pairs = cache.__data__; + if (!Map || (pairs.length < LARGE_ARRAY_SIZE - 1)) { + pairs.push([key, value]); + return this; + } + cache = this.__data__ = new MapCache(pairs); + } + cache.set(key, value); + return this; +} + +// Add methods to `Stack`. +Stack.prototype.clear = stackClear; +Stack.prototype['delete'] = stackDelete; +Stack.prototype.get = stackGet; +Stack.prototype.has = stackHas; +Stack.prototype.set = stackSet; + +/** + * Creates an array of the enumerable property names of the array-like `value`. + * + * @private + * @param {*} value The value to query. + * @param {boolean} inherited Specify returning inherited property names. + * @returns {Array} Returns the array of property names. + */ +function arrayLikeKeys(value, inherited) { + // Safari 8.1 makes `arguments.callee` enumerable in strict mode. + // Safari 9 makes `arguments.length` enumerable in strict mode. + var result = (isArray(value) || isArguments(value)) + ? baseTimes(value.length, String) + : []; + + var length = result.length, + skipIndexes = !!length; + + for (var key in value) { + if ((inherited || hasOwnProperty.call(value, key)) && + !(skipIndexes && (key == 'length' || isIndex(key, length)))) { + result.push(key); + } + } + return result; +} + +/** + * Gets the index at which the `key` is found in `array` of key-value pairs. + * + * @private + * @param {Array} array The array to inspect. + * @param {*} key The key to search for. + * @returns {number} Returns the index of the matched value, else `-1`. + */ +function assocIndexOf(array, key) { + var length = array.length; + while (length--) { + if (eq(array[length][0], key)) { + return length; + } + } + return -1; +} + +/** + * The base implementation of `_.forEach` without support for iteratee shorthands. + * + * @private + * @param {Array|Object} collection The collection to iterate over. + * @param {Function} iteratee The function invoked per iteration. + * @returns {Array|Object} Returns `collection`. + */ +var baseEach = createBaseEach(baseForOwn); + +/** + * The base implementation of `_.flatten` with support for restricting flattening. + * + * @private + * @param {Array} array The array to flatten. + * @param {number} depth The maximum recursion depth. + * @param {boolean} [predicate=isFlattenable] The function invoked per iteration. + * @param {boolean} [isStrict] Restrict to values that pass `predicate` checks. + * @param {Array} [result=[]] The initial result value. + * @returns {Array} Returns the new flattened array. + */ +function baseFlatten(array, depth, predicate, isStrict, result) { + var index = -1, + length = array.length; + + predicate || (predicate = isFlattenable); + result || (result = []); + + while (++index < length) { + var value = array[index]; + if (depth > 0 && predicate(value)) { + if (depth > 1) { + // Recursively flatten arrays (susceptible to call stack limits). + baseFlatten(value, depth - 1, predicate, isStrict, result); + } else { + arrayPush(result, value); + } + } else if (!isStrict) { + result[result.length] = value; + } + } + return result; +} + +/** + * The base implementation of `baseForOwn` which iterates over `object` + * properties returned by `keysFunc` and invokes `iteratee` for each property. + * Iteratee functions may exit iteration early by explicitly returning `false`. + * + * @private + * @param {Object} object The object to iterate over. + * @param {Function} iteratee The function invoked per iteration. + * @param {Function} keysFunc The function to get the keys of `object`. + * @returns {Object} Returns `object`. + */ +var baseFor = createBaseFor(); + +/** + * The base implementation of `_.forOwn` without support for iteratee shorthands. + * + * @private + * @param {Object} object The object to iterate over. + * @param {Function} iteratee The function invoked per iteration. + * @returns {Object} Returns `object`. + */ +function baseForOwn(object, iteratee) { + return object && baseFor(object, iteratee, keys); +} + +/** + * The base implementation of `_.get` without support for default values. + * + * @private + * @param {Object} object The object to query. + * @param {Array|string} path The path of the property to get. + * @returns {*} Returns the resolved value. + */ +function baseGet(object, path) { + path = isKey(path, object) ? [path] : castPath(path); + + var index = 0, + length = path.length; + + while (object != null && index < length) { + object = object[toKey(path[index++])]; + } + return (index && index == length) ? object : undefined; +} + +/** + * The base implementation of `getTag`. + * + * @private + * @param {*} value The value to query. + * @returns {string} Returns the `toStringTag`. + */ +function baseGetTag(value) { + return objectToString.call(value); +} + +/** + * The base implementation of `_.hasIn` without support for deep paths. + * + * @private + * @param {Object} [object] The object to query. + * @param {Array|string} key The key to check. + * @returns {boolean} Returns `true` if `key` exists, else `false`. + */ +function baseHasIn(object, key) { + return object != null && key in Object(object); +} + +/** + * The base implementation of `_.isEqual` which supports partial comparisons + * and tracks traversed objects. + * + * @private + * @param {*} value The value to compare. + * @param {*} other The other value to compare. + * @param {Function} [customizer] The function to customize comparisons. + * @param {boolean} [bitmask] The bitmask of comparison flags. + * The bitmask may be composed of the following flags: + * 1 - Unordered comparison + * 2 - Partial comparison + * @param {Object} [stack] Tracks traversed `value` and `other` objects. + * @returns {boolean} Returns `true` if the values are equivalent, else `false`. + */ +function baseIsEqual(value, other, customizer, bitmask, stack) { + if (value === other) { + return true; + } + if (value == null || other == null || (!isObject(value) && !isObjectLike(other))) { + return value !== value && other !== other; + } + return baseIsEqualDeep(value, other, baseIsEqual, customizer, bitmask, stack); +} + +/** + * A specialized version of `baseIsEqual` for arrays and objects which performs + * deep comparisons and tracks traversed objects enabling objects with circular + * references to be compared. + * + * @private + * @param {Object} object The object to compare. + * @param {Object} other The other object to compare. + * @param {Function} equalFunc The function to determine equivalents of values. + * @param {Function} [customizer] The function to customize comparisons. + * @param {number} [bitmask] The bitmask of comparison flags. See `baseIsEqual` + * for more details. + * @param {Object} [stack] Tracks traversed `object` and `other` objects. + * @returns {boolean} Returns `true` if the objects are equivalent, else `false`. + */ +function baseIsEqualDeep(object, other, equalFunc, customizer, bitmask, stack) { + var objIsArr = isArray(object), + othIsArr = isArray(other), + objTag = arrayTag, + othTag = arrayTag; + + if (!objIsArr) { + objTag = getTag(object); + objTag = objTag == argsTag ? objectTag : objTag; + } + if (!othIsArr) { + othTag = getTag(other); + othTag = othTag == argsTag ? objectTag : othTag; + } + var objIsObj = objTag == objectTag && !isHostObject(object), + othIsObj = othTag == objectTag && !isHostObject(other), + isSameTag = objTag == othTag; + + if (isSameTag && !objIsObj) { + stack || (stack = new Stack); + return (objIsArr || isTypedArray(object)) + ? equalArrays(object, other, equalFunc, customizer, bitmask, stack) + : equalByTag(object, other, objTag, equalFunc, customizer, bitmask, stack); + } + if (!(bitmask & PARTIAL_COMPARE_FLAG)) { + var objIsWrapped = objIsObj && hasOwnProperty.call(object, '__wrapped__'), + othIsWrapped = othIsObj && hasOwnProperty.call(other, '__wrapped__'); + + if (objIsWrapped || othIsWrapped) { + var objUnwrapped = objIsWrapped ? object.value() : object, + othUnwrapped = othIsWrapped ? other.value() : other; + + stack || (stack = new Stack); + return equalFunc(objUnwrapped, othUnwrapped, customizer, bitmask, stack); + } + } + if (!isSameTag) { + return false; + } + stack || (stack = new Stack); + return equalObjects(object, other, equalFunc, customizer, bitmask, stack); +} + +/** + * The base implementation of `_.isMatch` without support for iteratee shorthands. + * + * @private + * @param {Object} object The object to inspect. + * @param {Object} source The object of property values to match. + * @param {Array} matchData The property names, values, and compare flags to match. + * @param {Function} [customizer] The function to customize comparisons. + * @returns {boolean} Returns `true` if `object` is a match, else `false`. + */ +function baseIsMatch(object, source, matchData, customizer) { + var index = matchData.length, + length = index, + noCustomizer = !customizer; + + if (object == null) { + return !length; + } + object = Object(object); + while (index--) { + var data = matchData[index]; + if ((noCustomizer && data[2]) + ? data[1] !== object[data[0]] + : !(data[0] in object) + ) { + return false; + } + } + while (++index < length) { + data = matchData[index]; + var key = data[0], + objValue = object[key], + srcValue = data[1]; + + if (noCustomizer && data[2]) { + if (objValue === undefined && !(key in object)) { + return false; + } + } else { + var stack = new Stack; + if (customizer) { + var result = customizer(objValue, srcValue, key, object, source, stack); + } + if (!(result === undefined + ? baseIsEqual(srcValue, objValue, customizer, UNORDERED_COMPARE_FLAG | PARTIAL_COMPARE_FLAG, stack) + : result + )) { + return false; + } + } + } + return true; +} + +/** + * The base implementation of `_.isNative` without bad shim checks. + * + * @private + * @param {*} value The value to check. + * @returns {boolean} Returns `true` if `value` is a native function, + * else `false`. + */ +function baseIsNative(value) { + if (!isObject(value) || isMasked(value)) { + return false; + } + var pattern = (isFunction(value) || isHostObject(value)) ? reIsNative : reIsHostCtor; + return pattern.test(toSource(value)); +} + +/** + * The base implementation of `_.isTypedArray` without Node.js optimizations. + * + * @private + * @param {*} value The value to check. + * @returns {boolean} Returns `true` if `value` is a typed array, else `false`. + */ +function baseIsTypedArray(value) { + return isObjectLike(value) && + isLength(value.length) && !!typedArrayTags[objectToString.call(value)]; +} + +/** + * The base implementation of `_.iteratee`. + * + * @private + * @param {*} [value=_.identity] The value to convert to an iteratee. + * @returns {Function} Returns the iteratee. + */ +function baseIteratee(value) { + // Don't store the `typeof` result in a variable to avoid a JIT bug in Safari 9. + // See https://bugs.webkit.org/show_bug.cgi?id=156034 for more details. + if (typeof value == 'function') { + return value; + } + if (value == null) { + return identity; + } + if (typeof value == 'object') { + return isArray(value) + ? baseMatchesProperty(value[0], value[1]) + : baseMatches(value); + } + return property(value); +} + +/** + * The base implementation of `_.keys` which doesn't treat sparse arrays as dense. + * + * @private + * @param {Object} object The object to query. + * @returns {Array} Returns the array of property names. + */ +function baseKeys(object) { + if (!isPrototype(object)) { + return nativeKeys(object); + } + var result = []; + for (var key in Object(object)) { + if (hasOwnProperty.call(object, key) && key != 'constructor') { + result.push(key); + } + } + return result; +} + +/** + * The base implementation of `_.map` without support for iteratee shorthands. + * + * @private + * @param {Array|Object} collection The collection to iterate over. + * @param {Function} iteratee The function invoked per iteration. + * @returns {Array} Returns the new mapped array. + */ +function baseMap(collection, iteratee) { + var index = -1, + result = isArrayLike(collection) ? Array(collection.length) : []; + + baseEach(collection, function(value, key, collection) { + result[++index] = iteratee(value, key, collection); + }); + return result; +} + +/** + * The base implementation of `_.matches` which doesn't clone `source`. + * + * @private + * @param {Object} source The object of property values to match. + * @returns {Function} Returns the new spec function. + */ +function baseMatches(source) { + var matchData = getMatchData(source); + if (matchData.length == 1 && matchData[0][2]) { + return matchesStrictComparable(matchData[0][0], matchData[0][1]); + } + return function(object) { + return object === source || baseIsMatch(object, source, matchData); + }; +} + +/** + * The base implementation of `_.matchesProperty` which doesn't clone `srcValue`. + * + * @private + * @param {string} path The path of the property to get. + * @param {*} srcValue The value to match. + * @returns {Function} Returns the new spec function. + */ +function baseMatchesProperty(path, srcValue) { + if (isKey(path) && isStrictComparable(srcValue)) { + return matchesStrictComparable(toKey(path), srcValue); + } + return function(object) { + var objValue = get(object, path); + return (objValue === undefined && objValue === srcValue) + ? hasIn(object, path) + : baseIsEqual(srcValue, objValue, undefined, UNORDERED_COMPARE_FLAG | PARTIAL_COMPARE_FLAG); + }; +} + +/** + * The base implementation of `_.orderBy` without param guards. + * + * @private + * @param {Array|Object} collection The collection to iterate over. + * @param {Function[]|Object[]|string[]} iteratees The iteratees to sort by. + * @param {string[]} orders The sort orders of `iteratees`. + * @returns {Array} Returns the new sorted array. + */ +function baseOrderBy(collection, iteratees, orders) { + var index = -1; + iteratees = arrayMap(iteratees.length ? iteratees : [identity], baseUnary(baseIteratee)); + + var result = baseMap(collection, function(value, key, collection) { + var criteria = arrayMap(iteratees, function(iteratee) { + return iteratee(value); + }); + return { 'criteria': criteria, 'index': ++index, 'value': value }; + }); + + return baseSortBy(result, function(object, other) { + return compareMultiple(object, other, orders); + }); +} + +/** + * A specialized version of `baseProperty` which supports deep paths. + * + * @private + * @param {Array|string} path The path of the property to get. + * @returns {Function} Returns the new accessor function. + */ +function basePropertyDeep(path) { + return function(object) { + return baseGet(object, path); + }; +} + +/** + * The base implementation of `_.rest` which doesn't validate or coerce arguments. + * + * @private + * @param {Function} func The function to apply a rest parameter to. + * @param {number} [start=func.length-1] The start position of the rest parameter. + * @returns {Function} Returns the new function. + */ +function baseRest(func, start) { + start = nativeMax(start === undefined ? (func.length - 1) : start, 0); + return function() { + var args = arguments, + index = -1, + length = nativeMax(args.length - start, 0), + array = Array(length); + + while (++index < length) { + array[index] = args[start + index]; + } + index = -1; + var otherArgs = Array(start + 1); + while (++index < start) { + otherArgs[index] = args[index]; + } + otherArgs[start] = array; + return apply(func, this, otherArgs); + }; +} + +/** + * The base implementation of `_.toString` which doesn't convert nullish + * values to empty strings. + * + * @private + * @param {*} value The value to process. + * @returns {string} Returns the string. + */ +function baseToString(value) { + // Exit early for strings to avoid a performance hit in some environments. + if (typeof value == 'string') { + return value; + } + if (isSymbol(value)) { + return symbolToString ? symbolToString.call(value) : ''; + } + var result = (value + ''); + return (result == '0' && (1 / value) == -INFINITY) ? '-0' : result; +} + +/** + * Casts `value` to a path array if it's not one. + * + * @private + * @param {*} value The value to inspect. + * @returns {Array} Returns the cast property path array. + */ +function castPath(value) { + return isArray(value) ? value : stringToPath(value); +} + +/** + * Compares values to sort them in ascending order. + * + * @private + * @param {*} value The value to compare. + * @param {*} other The other value to compare. + * @returns {number} Returns the sort order indicator for `value`. + */ +function compareAscending(value, other) { + if (value !== other) { + var valIsDefined = value !== undefined, + valIsNull = value === null, + valIsReflexive = value === value, + valIsSymbol = isSymbol(value); + + var othIsDefined = other !== undefined, + othIsNull = other === null, + othIsReflexive = other === other, + othIsSymbol = isSymbol(other); + + if ((!othIsNull && !othIsSymbol && !valIsSymbol && value > other) || + (valIsSymbol && othIsDefined && othIsReflexive && !othIsNull && !othIsSymbol) || + (valIsNull && othIsDefined && othIsReflexive) || + (!valIsDefined && othIsReflexive) || + !valIsReflexive) { + return 1; + } + if ((!valIsNull && !valIsSymbol && !othIsSymbol && value < other) || + (othIsSymbol && valIsDefined && valIsReflexive && !valIsNull && !valIsSymbol) || + (othIsNull && valIsDefined && valIsReflexive) || + (!othIsDefined && valIsReflexive) || + !othIsReflexive) { + return -1; + } + } + return 0; +} + +/** + * Used by `_.orderBy` to compare multiple properties of a value to another + * and stable sort them. + * + * If `orders` is unspecified, all values are sorted in ascending order. Otherwise, + * specify an order of "desc" for descending or "asc" for ascending sort order + * of corresponding values. + * + * @private + * @param {Object} object The object to compare. + * @param {Object} other The other object to compare. + * @param {boolean[]|string[]} orders The order to sort by for each property. + * @returns {number} Returns the sort order indicator for `object`. + */ +function compareMultiple(object, other, orders) { + var index = -1, + objCriteria = object.criteria, + othCriteria = other.criteria, + length = objCriteria.length, + ordersLength = orders.length; + + while (++index < length) { + var result = compareAscending(objCriteria[index], othCriteria[index]); + if (result) { + if (index >= ordersLength) { + return result; + } + var order = orders[index]; + return result * (order == 'desc' ? -1 : 1); + } + } + // Fixes an `Array#sort` bug in the JS engine embedded in Adobe applications + // that causes it, under certain circumstances, to provide the same value for + // `object` and `other`. See https://github.com/jashkenas/underscore/pull/1247 + // for more details. + // + // This also ensures a stable sort in V8 and other engines. + // See https://bugs.chromium.org/p/v8/issues/detail?id=90 for more details. + return object.index - other.index; +} + +/** + * Creates a `baseEach` or `baseEachRight` function. + * + * @private + * @param {Function} eachFunc The function to iterate over a collection. + * @param {boolean} [fromRight] Specify iterating from right to left. + * @returns {Function} Returns the new base function. + */ +function createBaseEach(eachFunc, fromRight) { + return function(collection, iteratee) { + if (collection == null) { + return collection; + } + if (!isArrayLike(collection)) { + return eachFunc(collection, iteratee); + } + var length = collection.length, + index = fromRight ? length : -1, + iterable = Object(collection); + + while ((fromRight ? index-- : ++index < length)) { + if (iteratee(iterable[index], index, iterable) === false) { + break; + } + } + return collection; + }; +} + +/** + * Creates a base function for methods like `_.forIn` and `_.forOwn`. + * + * @private + * @param {boolean} [fromRight] Specify iterating from right to left. + * @returns {Function} Returns the new base function. + */ +function createBaseFor(fromRight) { + return function(object, iteratee, keysFunc) { + var index = -1, + iterable = Object(object), + props = keysFunc(object), + length = props.length; + + while (length--) { + var key = props[fromRight ? length : ++index]; + if (iteratee(iterable[key], key, iterable) === false) { + break; + } + } + return object; + }; +} + +/** + * A specialized version of `baseIsEqualDeep` for arrays with support for + * partial deep comparisons. + * + * @private + * @param {Array} array The array to compare. + * @param {Array} other The other array to compare. + * @param {Function} equalFunc The function to determine equivalents of values. + * @param {Function} customizer The function to customize comparisons. + * @param {number} bitmask The bitmask of comparison flags. See `baseIsEqual` + * for more details. + * @param {Object} stack Tracks traversed `array` and `other` objects. + * @returns {boolean} Returns `true` if the arrays are equivalent, else `false`. + */ +function equalArrays(array, other, equalFunc, customizer, bitmask, stack) { + var isPartial = bitmask & PARTIAL_COMPARE_FLAG, + arrLength = array.length, + othLength = other.length; + + if (arrLength != othLength && !(isPartial && othLength > arrLength)) { + return false; + } + // Assume cyclic values are equal. + var stacked = stack.get(array); + if (stacked && stack.get(other)) { + return stacked == other; + } + var index = -1, + result = true, + seen = (bitmask & UNORDERED_COMPARE_FLAG) ? new SetCache : undefined; + + stack.set(array, other); + stack.set(other, array); + + // Ignore non-index properties. + while (++index < arrLength) { + var arrValue = array[index], + othValue = other[index]; + + if (customizer) { + var compared = isPartial + ? customizer(othValue, arrValue, index, other, array, stack) + : customizer(arrValue, othValue, index, array, other, stack); + } + if (compared !== undefined) { + if (compared) { + continue; + } + result = false; + break; + } + // Recursively compare arrays (susceptible to call stack limits). + if (seen) { + if (!arraySome(other, function(othValue, othIndex) { + if (!seen.has(othIndex) && + (arrValue === othValue || equalFunc(arrValue, othValue, customizer, bitmask, stack))) { + return seen.add(othIndex); + } + })) { + result = false; + break; + } + } else if (!( + arrValue === othValue || + equalFunc(arrValue, othValue, customizer, bitmask, stack) + )) { + result = false; + break; + } + } + stack['delete'](array); + stack['delete'](other); + return result; +} + +/** + * A specialized version of `baseIsEqualDeep` for comparing objects of + * the same `toStringTag`. + * + * **Note:** This function only supports comparing values with tags of + * `Boolean`, `Date`, `Error`, `Number`, `RegExp`, or `String`. + * + * @private + * @param {Object} object The object to compare. + * @param {Object} other The other object to compare. + * @param {string} tag The `toStringTag` of the objects to compare. + * @param {Function} equalFunc The function to determine equivalents of values. + * @param {Function} customizer The function to customize comparisons. + * @param {number} bitmask The bitmask of comparison flags. See `baseIsEqual` + * for more details. + * @param {Object} stack Tracks traversed `object` and `other` objects. + * @returns {boolean} Returns `true` if the objects are equivalent, else `false`. + */ +function equalByTag(object, other, tag, equalFunc, customizer, bitmask, stack) { + switch (tag) { + case dataViewTag: + if ((object.byteLength != other.byteLength) || + (object.byteOffset != other.byteOffset)) { + return false; + } + object = object.buffer; + other = other.buffer; + + case arrayBufferTag: + if ((object.byteLength != other.byteLength) || + !equalFunc(new Uint8Array(object), new Uint8Array(other))) { + return false; + } + return true; + + case boolTag: + case dateTag: + case numberTag: + // Coerce booleans to `1` or `0` and dates to milliseconds. + // Invalid dates are coerced to `NaN`. + return eq(+object, +other); + + case errorTag: + return object.name == other.name && object.message == other.message; + + case regexpTag: + case stringTag: + // Coerce regexes to strings and treat strings, primitives and objects, + // as equal. See http://www.ecma-international.org/ecma-262/7.0/#sec-regexp.prototype.tostring + // for more details. + return object == (other + ''); + + case mapTag: + var convert = mapToArray; + + case setTag: + var isPartial = bitmask & PARTIAL_COMPARE_FLAG; + convert || (convert = setToArray); + + if (object.size != other.size && !isPartial) { + return false; + } + // Assume cyclic values are equal. + var stacked = stack.get(object); + if (stacked) { + return stacked == other; + } + bitmask |= UNORDERED_COMPARE_FLAG; + + // Recursively compare objects (susceptible to call stack limits). + stack.set(object, other); + var result = equalArrays(convert(object), convert(other), equalFunc, customizer, bitmask, stack); + stack['delete'](object); + return result; + + case symbolTag: + if (symbolValueOf) { + return symbolValueOf.call(object) == symbolValueOf.call(other); + } + } + return false; +} + +/** + * A specialized version of `baseIsEqualDeep` for objects with support for + * partial deep comparisons. + * + * @private + * @param {Object} object The object to compare. + * @param {Object} other The other object to compare. + * @param {Function} equalFunc The function to determine equivalents of values. + * @param {Function} customizer The function to customize comparisons. + * @param {number} bitmask The bitmask of comparison flags. See `baseIsEqual` + * for more details. + * @param {Object} stack Tracks traversed `object` and `other` objects. + * @returns {boolean} Returns `true` if the objects are equivalent, else `false`. + */ +function equalObjects(object, other, equalFunc, customizer, bitmask, stack) { + var isPartial = bitmask & PARTIAL_COMPARE_FLAG, + objProps = keys(object), + objLength = objProps.length, + othProps = keys(other), + othLength = othProps.length; + + if (objLength != othLength && !isPartial) { + return false; + } + var index = objLength; + while (index--) { + var key = objProps[index]; + if (!(isPartial ? key in other : hasOwnProperty.call(other, key))) { + return false; + } + } + // Assume cyclic values are equal. + var stacked = stack.get(object); + if (stacked && stack.get(other)) { + return stacked == other; + } + var result = true; + stack.set(object, other); + stack.set(other, object); + + var skipCtor = isPartial; + while (++index < objLength) { + key = objProps[index]; + var objValue = object[key], + othValue = other[key]; + + if (customizer) { + var compared = isPartial + ? customizer(othValue, objValue, key, other, object, stack) + : customizer(objValue, othValue, key, object, other, stack); + } + // Recursively compare objects (susceptible to call stack limits). + if (!(compared === undefined + ? (objValue === othValue || equalFunc(objValue, othValue, customizer, bitmask, stack)) + : compared + )) { + result = false; + break; + } + skipCtor || (skipCtor = key == 'constructor'); + } + if (result && !skipCtor) { + var objCtor = object.constructor, + othCtor = other.constructor; + + // Non `Object` object instances with different constructors are not equal. + if (objCtor != othCtor && + ('constructor' in object && 'constructor' in other) && + !(typeof objCtor == 'function' && objCtor instanceof objCtor && + typeof othCtor == 'function' && othCtor instanceof othCtor)) { + result = false; + } + } + stack['delete'](object); + stack['delete'](other); + return result; +} + +/** + * Gets the data for `map`. + * + * @private + * @param {Object} map The map to query. + * @param {string} key The reference key. + * @returns {*} Returns the map data. + */ +function getMapData(map, key) { + var data = map.__data__; + return isKeyable(key) + ? data[typeof key == 'string' ? 'string' : 'hash'] + : data.map; +} + +/** + * Gets the property names, values, and compare flags of `object`. + * + * @private + * @param {Object} object The object to query. + * @returns {Array} Returns the match data of `object`. + */ +function getMatchData(object) { + var result = keys(object), + length = result.length; + + while (length--) { + var key = result[length], + value = object[key]; + + result[length] = [key, value, isStrictComparable(value)]; + } + return result; +} + +/** + * Gets the native function at `key` of `object`. + * + * @private + * @param {Object} object The object to query. + * @param {string} key The key of the method to get. + * @returns {*} Returns the function if it's native, else `undefined`. + */ +function getNative(object, key) { + var value = getValue(object, key); + return baseIsNative(value) ? value : undefined; +} + +/** + * Gets the `toStringTag` of `value`. + * + * @private + * @param {*} value The value to query. + * @returns {string} Returns the `toStringTag`. + */ +var getTag = baseGetTag; + +// Fallback for data views, maps, sets, and weak maps in IE 11, +// for data views in Edge < 14, and promises in Node.js. +if ((DataView && getTag(new DataView(new ArrayBuffer(1))) != dataViewTag) || + (Map && getTag(new Map) != mapTag) || + (Promise && getTag(Promise.resolve()) != promiseTag) || + (Set && getTag(new Set) != setTag) || + (WeakMap && getTag(new WeakMap) != weakMapTag)) { + getTag = function(value) { + var result = objectToString.call(value), + Ctor = result == objectTag ? value.constructor : undefined, + ctorString = Ctor ? toSource(Ctor) : undefined; + + if (ctorString) { + switch (ctorString) { + case dataViewCtorString: return dataViewTag; + case mapCtorString: return mapTag; + case promiseCtorString: return promiseTag; + case setCtorString: return setTag; + case weakMapCtorString: return weakMapTag; + } + } + return result; + }; +} + +/** + * Checks if `path` exists on `object`. + * + * @private + * @param {Object} object The object to query. + * @param {Array|string} path The path to check. + * @param {Function} hasFunc The function to check properties. + * @returns {boolean} Returns `true` if `path` exists, else `false`. + */ +function hasPath(object, path, hasFunc) { + path = isKey(path, object) ? [path] : castPath(path); + + var result, + index = -1, + length = path.length; + + while (++index < length) { + var key = toKey(path[index]); + if (!(result = object != null && hasFunc(object, key))) { + break; + } + object = object[key]; + } + if (result) { + return result; + } + var length = object ? object.length : 0; + return !!length && isLength(length) && isIndex(key, length) && + (isArray(object) || isArguments(object)); +} + +/** + * Checks if `value` is a flattenable `arguments` object or array. + * + * @private + * @param {*} value The value to check. + * @returns {boolean} Returns `true` if `value` is flattenable, else `false`. + */ +function isFlattenable(value) { + return isArray(value) || isArguments(value) || + !!(spreadableSymbol && value && value[spreadableSymbol]); +} + +/** + * Checks if `value` is a valid array-like index. + * + * @private + * @param {*} value The value to check. + * @param {number} [length=MAX_SAFE_INTEGER] The upper bounds of a valid index. + * @returns {boolean} Returns `true` if `value` is a valid index, else `false`. + */ +function isIndex(value, length) { + length = length == null ? MAX_SAFE_INTEGER : length; + return !!length && + (typeof value == 'number' || reIsUint.test(value)) && + (value > -1 && value % 1 == 0 && value < length); +} + +/** + * Checks if the given arguments are from an iteratee call. + * + * @private + * @param {*} value The potential iteratee value argument. + * @param {*} index The potential iteratee index or key argument. + * @param {*} object The potential iteratee object argument. + * @returns {boolean} Returns `true` if the arguments are from an iteratee call, + * else `false`. + */ +function isIterateeCall(value, index, object) { + if (!isObject(object)) { + return false; + } + var type = typeof index; + if (type == 'number' + ? (isArrayLike(object) && isIndex(index, object.length)) + : (type == 'string' && index in object) + ) { + return eq(object[index], value); + } + return false; +} + +/** + * Checks if `value` is a property name and not a property path. + * + * @private + * @param {*} value The value to check. + * @param {Object} [object] The object to query keys on. + * @returns {boolean} Returns `true` if `value` is a property name, else `false`. + */ +function isKey(value, object) { + if (isArray(value)) { + return false; + } + var type = typeof value; + if (type == 'number' || type == 'symbol' || type == 'boolean' || + value == null || isSymbol(value)) { + return true; + } + return reIsPlainProp.test(value) || !reIsDeepProp.test(value) || + (object != null && value in Object(object)); +} + +/** + * Checks if `value` is suitable for use as unique object key. + * + * @private + * @param {*} value The value to check. + * @returns {boolean} Returns `true` if `value` is suitable, else `false`. + */ +function isKeyable(value) { + var type = typeof value; + return (type == 'string' || type == 'number' || type == 'symbol' || type == 'boolean') + ? (value !== '__proto__') + : (value === null); +} + +/** + * Checks if `func` has its source masked. + * + * @private + * @param {Function} func The function to check. + * @returns {boolean} Returns `true` if `func` is masked, else `false`. + */ +function isMasked(func) { + return !!maskSrcKey && (maskSrcKey in func); +} + +/** + * Checks if `value` is likely a prototype object. + * + * @private + * @param {*} value The value to check. + * @returns {boolean} Returns `true` if `value` is a prototype, else `false`. + */ +function isPrototype(value) { + var Ctor = value && value.constructor, + proto = (typeof Ctor == 'function' && Ctor.prototype) || objectProto; + + return value === proto; +} + +/** + * Checks if `value` is suitable for strict equality comparisons, i.e. `===`. + * + * @private + * @param {*} value The value to check. + * @returns {boolean} Returns `true` if `value` if suitable for strict + * equality comparisons, else `false`. + */ +function isStrictComparable(value) { + return value === value && !isObject(value); +} + +/** + * A specialized version of `matchesProperty` for source values suitable + * for strict equality comparisons, i.e. `===`. + * + * @private + * @param {string} key The key of the property to get. + * @param {*} srcValue The value to match. + * @returns {Function} Returns the new spec function. + */ +function matchesStrictComparable(key, srcValue) { + return function(object) { + if (object == null) { + return false; + } + return object[key] === srcValue && + (srcValue !== undefined || (key in Object(object))); + }; +} + +/** + * Converts `string` to a property path array. + * + * @private + * @param {string} string The string to convert. + * @returns {Array} Returns the property path array. + */ +var stringToPath = memoize(function(string) { + string = toString(string); + + var result = []; + if (reLeadingDot.test(string)) { + result.push(''); + } + string.replace(rePropName, function(match, number, quote, string) { + result.push(quote ? string.replace(reEscapeChar, '$1') : (number || match)); + }); + return result; +}); + +/** + * Converts `value` to a string key if it's not a string or symbol. + * + * @private + * @param {*} value The value to inspect. + * @returns {string|symbol} Returns the key. + */ +function toKey(value) { + if (typeof value == 'string' || isSymbol(value)) { + return value; + } + var result = (value + ''); + return (result == '0' && (1 / value) == -INFINITY) ? '-0' : result; +} + +/** + * Converts `func` to its source code. + * + * @private + * @param {Function} func The function to process. + * @returns {string} Returns the source code. + */ +function toSource(func) { + if (func != null) { + try { + return funcToString.call(func); + } catch (e) {} + try { + return (func + ''); + } catch (e) {} + } + return ''; +} + +/** + * Creates an array of elements, sorted in ascending order by the results of + * running each element in a collection thru each iteratee. This method + * performs a stable sort, that is, it preserves the original sort order of + * equal elements. The iteratees are invoked with one argument: (value). + * + * @static + * @memberOf _ + * @since 0.1.0 + * @category Collection + * @param {Array|Object} collection The collection to iterate over. + * @param {...(Function|Function[])} [iteratees=[_.identity]] + * The iteratees to sort by. + * @returns {Array} Returns the new sorted array. + * @example + * + * var users = [ + * { 'user': 'fred', 'age': 48 }, + * { 'user': 'barney', 'age': 36 }, + * { 'user': 'fred', 'age': 40 }, + * { 'user': 'barney', 'age': 34 } + * ]; + * + * _.sortBy(users, function(o) { return o.user; }); + * // => objects for [['barney', 36], ['barney', 34], ['fred', 48], ['fred', 40]] + * + * _.sortBy(users, ['user', 'age']); + * // => objects for [['barney', 34], ['barney', 36], ['fred', 40], ['fred', 48]] + * + * _.sortBy(users, 'user', function(o) { + * return Math.floor(o.age / 10); + * }); + * // => objects for [['barney', 36], ['barney', 34], ['fred', 48], ['fred', 40]] + */ +var sortBy = baseRest(function(collection, iteratees) { + if (collection == null) { + return []; + } + var length = iteratees.length; + if (length > 1 && isIterateeCall(collection, iteratees[0], iteratees[1])) { + iteratees = []; + } else if (length > 2 && isIterateeCall(iteratees[0], iteratees[1], iteratees[2])) { + iteratees = [iteratees[0]]; + } + return baseOrderBy(collection, baseFlatten(iteratees, 1), []); +}); + +/** + * Creates a function that memoizes the result of `func`. If `resolver` is + * provided, it determines the cache key for storing the result based on the + * arguments provided to the memoized function. By default, the first argument + * provided to the memoized function is used as the map cache key. The `func` + * is invoked with the `this` binding of the memoized function. + * + * **Note:** The cache is exposed as the `cache` property on the memoized + * function. Its creation may be customized by replacing the `_.memoize.Cache` + * constructor with one whose instances implement the + * [`Map`](http://ecma-international.org/ecma-262/7.0/#sec-properties-of-the-map-prototype-object) + * method interface of `delete`, `get`, `has`, and `set`. + * + * @static + * @memberOf _ + * @since 0.1.0 + * @category Function + * @param {Function} func The function to have its output memoized. + * @param {Function} [resolver] The function to resolve the cache key. + * @returns {Function} Returns the new memoized function. + * @example + * + * var object = { 'a': 1, 'b': 2 }; + * var other = { 'c': 3, 'd': 4 }; + * + * var values = _.memoize(_.values); + * values(object); + * // => [1, 2] + * + * values(other); + * // => [3, 4] + * + * object.a = 2; + * values(object); + * // => [1, 2] + * + * // Modify the result cache. + * values.cache.set(object, ['a', 'b']); + * values(object); + * // => ['a', 'b'] + * + * // Replace `_.memoize.Cache`. + * _.memoize.Cache = WeakMap; + */ +function memoize(func, resolver) { + if (typeof func != 'function' || (resolver && typeof resolver != 'function')) { + throw new TypeError(FUNC_ERROR_TEXT); + } + var memoized = function() { + var args = arguments, + key = resolver ? resolver.apply(this, args) : args[0], + cache = memoized.cache; + + if (cache.has(key)) { + return cache.get(key); + } + var result = func.apply(this, args); + memoized.cache = cache.set(key, result); + return result; + }; + memoized.cache = new (memoize.Cache || MapCache); + return memoized; +} + +// Assign cache to `_.memoize`. +memoize.Cache = MapCache; + +/** + * Performs a + * [`SameValueZero`](http://ecma-international.org/ecma-262/7.0/#sec-samevaluezero) + * comparison between two values to determine if they are equivalent. + * + * @static + * @memberOf _ + * @since 4.0.0 + * @category Lang + * @param {*} value The value to compare. + * @param {*} other The other value to compare. + * @returns {boolean} Returns `true` if the values are equivalent, else `false`. + * @example + * + * var object = { 'a': 1 }; + * var other = { 'a': 1 }; + * + * _.eq(object, object); + * // => true + * + * _.eq(object, other); + * // => false + * + * _.eq('a', 'a'); + * // => true + * + * _.eq('a', Object('a')); + * // => false + * + * _.eq(NaN, NaN); + * // => true + */ +function eq(value, other) { + return value === other || (value !== value && other !== other); +} + +/** + * Checks if `value` is likely an `arguments` object. + * + * @static + * @memberOf _ + * @since 0.1.0 + * @category Lang + * @param {*} value The value to check. + * @returns {boolean} Returns `true` if `value` is an `arguments` object, + * else `false`. + * @example + * + * _.isArguments(function() { return arguments; }()); + * // => true + * + * _.isArguments([1, 2, 3]); + * // => false + */ +function isArguments(value) { + // Safari 8.1 makes `arguments.callee` enumerable in strict mode. + return isArrayLikeObject(value) && hasOwnProperty.call(value, 'callee') && + (!propertyIsEnumerable.call(value, 'callee') || objectToString.call(value) == argsTag); +} + +/** + * Checks if `value` is classified as an `Array` object. + * + * @static + * @memberOf _ + * @since 0.1.0 + * @category Lang + * @param {*} value The value to check. + * @returns {boolean} Returns `true` if `value` is an array, else `false`. + * @example + * + * _.isArray([1, 2, 3]); + * // => true + * + * _.isArray(document.body.children); + * // => false + * + * _.isArray('abc'); + * // => false + * + * _.isArray(_.noop); + * // => false + */ +var isArray = Array.isArray; + +/** + * Checks if `value` is array-like. A value is considered array-like if it's + * not a function and has a `value.length` that's an integer greater than or + * equal to `0` and less than or equal to `Number.MAX_SAFE_INTEGER`. + * + * @static + * @memberOf _ + * @since 4.0.0 + * @category Lang + * @param {*} value The value to check. + * @returns {boolean} Returns `true` if `value` is array-like, else `false`. + * @example + * + * _.isArrayLike([1, 2, 3]); + * // => true + * + * _.isArrayLike(document.body.children); + * // => true + * + * _.isArrayLike('abc'); + * // => true + * + * _.isArrayLike(_.noop); + * // => false + */ +function isArrayLike(value) { + return value != null && isLength(value.length) && !isFunction(value); +} + +/** + * This method is like `_.isArrayLike` except that it also checks if `value` + * is an object. + * + * @static + * @memberOf _ + * @since 4.0.0 + * @category Lang + * @param {*} value The value to check. + * @returns {boolean} Returns `true` if `value` is an array-like object, + * else `false`. + * @example + * + * _.isArrayLikeObject([1, 2, 3]); + * // => true + * + * _.isArrayLikeObject(document.body.children); + * // => true + * + * _.isArrayLikeObject('abc'); + * // => false + * + * _.isArrayLikeObject(_.noop); + * // => false + */ +function isArrayLikeObject(value) { + return isObjectLike(value) && isArrayLike(value); +} + +/** + * Checks if `value` is classified as a `Function` object. + * + * @static + * @memberOf _ + * @since 0.1.0 + * @category Lang + * @param {*} value The value to check. + * @returns {boolean} Returns `true` if `value` is a function, else `false`. + * @example + * + * _.isFunction(_); + * // => true + * + * _.isFunction(/abc/); + * // => false + */ +function isFunction(value) { + // The use of `Object#toString` avoids issues with the `typeof` operator + // in Safari 8-9 which returns 'object' for typed array and other constructors. + var tag = isObject(value) ? objectToString.call(value) : ''; + return tag == funcTag || tag == genTag; +} + +/** + * Checks if `value` is a valid array-like length. + * + * **Note:** This method is loosely based on + * [`ToLength`](http://ecma-international.org/ecma-262/7.0/#sec-tolength). + * + * @static + * @memberOf _ + * @since 4.0.0 + * @category Lang + * @param {*} value The value to check. + * @returns {boolean} Returns `true` if `value` is a valid length, else `false`. + * @example + * + * _.isLength(3); + * // => true + * + * _.isLength(Number.MIN_VALUE); + * // => false + * + * _.isLength(Infinity); + * // => false + * + * _.isLength('3'); + * // => false + */ +function isLength(value) { + return typeof value == 'number' && + value > -1 && value % 1 == 0 && value <= MAX_SAFE_INTEGER; +} + +/** + * Checks if `value` is the + * [language type](http://www.ecma-international.org/ecma-262/7.0/#sec-ecmascript-language-types) + * of `Object`. (e.g. arrays, functions, objects, regexes, `new Number(0)`, and `new String('')`) + * + * @static + * @memberOf _ + * @since 0.1.0 + * @category Lang + * @param {*} value The value to check. + * @returns {boolean} Returns `true` if `value` is an object, else `false`. + * @example + * + * _.isObject({}); + * // => true + * + * _.isObject([1, 2, 3]); + * // => true + * + * _.isObject(_.noop); + * // => true + * + * _.isObject(null); + * // => false + */ +function isObject(value) { + var type = typeof value; + return !!value && (type == 'object' || type == 'function'); +} + +/** + * Checks if `value` is object-like. A value is object-like if it's not `null` + * and has a `typeof` result of "object". + * + * @static + * @memberOf _ + * @since 4.0.0 + * @category Lang + * @param {*} value The value to check. + * @returns {boolean} Returns `true` if `value` is object-like, else `false`. + * @example + * + * _.isObjectLike({}); + * // => true + * + * _.isObjectLike([1, 2, 3]); + * // => true + * + * _.isObjectLike(_.noop); + * // => false + * + * _.isObjectLike(null); + * // => false + */ +function isObjectLike(value) { + return !!value && typeof value == 'object'; +} + +/** + * Checks if `value` is classified as a `Symbol` primitive or object. + * + * @static + * @memberOf _ + * @since 4.0.0 + * @category Lang + * @param {*} value The value to check. + * @returns {boolean} Returns `true` if `value` is a symbol, else `false`. + * @example + * + * _.isSymbol(Symbol.iterator); + * // => true + * + * _.isSymbol('abc'); + * // => false + */ +function isSymbol(value) { + return typeof value == 'symbol' || + (isObjectLike(value) && objectToString.call(value) == symbolTag); +} + +/** + * Checks if `value` is classified as a typed array. + * + * @static + * @memberOf _ + * @since 3.0.0 + * @category Lang + * @param {*} value The value to check. + * @returns {boolean} Returns `true` if `value` is a typed array, else `false`. + * @example + * + * _.isTypedArray(new Uint8Array); + * // => true + * + * _.isTypedArray([]); + * // => false + */ +var isTypedArray = nodeIsTypedArray ? baseUnary(nodeIsTypedArray) : baseIsTypedArray; + +/** + * Converts `value` to a string. An empty string is returned for `null` + * and `undefined` values. The sign of `-0` is preserved. + * + * @static + * @memberOf _ + * @since 4.0.0 + * @category Lang + * @param {*} value The value to process. + * @returns {string} Returns the string. + * @example + * + * _.toString(null); + * // => '' + * + * _.toString(-0); + * // => '-0' + * + * _.toString([1, 2, 3]); + * // => '1,2,3' + */ +function toString(value) { + return value == null ? '' : baseToString(value); +} + +/** + * Gets the value at `path` of `object`. If the resolved value is + * `undefined`, the `defaultValue` is returned in its place. + * + * @static + * @memberOf _ + * @since 3.7.0 + * @category Object + * @param {Object} object The object to query. + * @param {Array|string} path The path of the property to get. + * @param {*} [defaultValue] The value returned for `undefined` resolved values. + * @returns {*} Returns the resolved value. + * @example + * + * var object = { 'a': [{ 'b': { 'c': 3 } }] }; + * + * _.get(object, 'a[0].b.c'); + * // => 3 + * + * _.get(object, ['a', '0', 'b', 'c']); + * // => 3 + * + * _.get(object, 'a.b.c', 'default'); + * // => 'default' + */ +function get(object, path, defaultValue) { + var result = object == null ? undefined : baseGet(object, path); + return result === undefined ? defaultValue : result; +} + +/** + * Checks if `path` is a direct or inherited property of `object`. + * + * @static + * @memberOf _ + * @since 4.0.0 + * @category Object + * @param {Object} object The object to query. + * @param {Array|string} path The path to check. + * @returns {boolean} Returns `true` if `path` exists, else `false`. + * @example + * + * var object = _.create({ 'a': _.create({ 'b': 2 }) }); + * + * _.hasIn(object, 'a'); + * // => true + * + * _.hasIn(object, 'a.b'); + * // => true + * + * _.hasIn(object, ['a', 'b']); + * // => true + * + * _.hasIn(object, 'b'); + * // => false + */ +function hasIn(object, path) { + return object != null && hasPath(object, path, baseHasIn); +} + +/** + * Creates an array of the own enumerable property names of `object`. + * + * **Note:** Non-object values are coerced to objects. See the + * [ES spec](http://ecma-international.org/ecma-262/7.0/#sec-object.keys) + * for more details. + * + * @static + * @since 0.1.0 + * @memberOf _ + * @category Object + * @param {Object} object The object to query. + * @returns {Array} Returns the array of property names. + * @example + * + * function Foo() { + * this.a = 1; + * this.b = 2; + * } + * + * Foo.prototype.c = 3; + * + * _.keys(new Foo); + * // => ['a', 'b'] (iteration order is not guaranteed) + * + * _.keys('hi'); + * // => ['0', '1'] + */ +function keys(object) { + return isArrayLike(object) ? arrayLikeKeys(object) : baseKeys(object); +} + +/** + * This method returns the first argument it receives. + * + * @static + * @since 0.1.0 + * @memberOf _ + * @category Util + * @param {*} value Any value. + * @returns {*} Returns `value`. + * @example + * + * var object = { 'a': 1 }; + * + * console.log(_.identity(object) === object); + * // => true + */ +function identity(value) { + return value; +} + +/** + * Creates a function that returns the value at `path` of a given object. + * + * @static + * @memberOf _ + * @since 2.4.0 + * @category Util + * @param {Array|string} path The path of the property to get. + * @returns {Function} Returns the new accessor function. + * @example + * + * var objects = [ + * { 'a': { 'b': 2 } }, + * { 'a': { 'b': 1 } } + * ]; + * + * _.map(objects, _.property('a.b')); + * // => [2, 1] + * + * _.map(_.sortBy(objects, _.property(['a', 'b'])), 'a.b'); + * // => [1, 2] + */ +function property(path) { + return isKey(path) ? baseProperty(toKey(path)) : basePropertyDeep(path); +} + +module.exports = sortBy; +}); + +var parsers$2 = createCommonjsModule(function (module, exports) { +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); + + + + +// The exponent value(s) at which toString returns exponential notation. +bignumber.BigNumber.config({ EXPONENTIAL_AT: [-5, 15] }); +class BaseNumberParser { + constructor(config) { + this.config = config; + let singleIntFrac = `${this.config.wordSeparatorToken}| -|${this.getKeyRegex(this.config.cardinalNumberMap)}|${this.getKeyRegex(this.config.ordinalNumberMap)}`; + this.textNumberRegex = recognizersText.RegExpUtility.getSafeRegExp(String.raw `(?=\b)(${singleIntFrac})(?=\b)`, "gis"); + this.arabicNumberRegex = recognizersText.RegExpUtility.getSafeRegExp(String.raw `\d+`, "is"); + this.roundNumberSet = new Set(); + this.config.roundNumberMap.forEach((value, key) => this.roundNumberSet.add(key)); + } + parse(extResult) { + // check if the parser is configured to support specific types + if (this.supportedTypes && !this.supportedTypes.find(t => t === extResult.type)) { + return null; + } + let ret = null; + let extra = extResult.data; + if (!extra) { + if (this.arabicNumberRegex.test(extResult.text)) { + extra = "Num"; + } + else { + extra = this.config.langMarker; + } + } + // Resolve symbol prefix + let isNegative = false; + let matchNegative = extResult.text.match(this.config.negativeNumberSignRegex); + if (matchNegative) { + isNegative = true; + extResult.text = extResult.text.substr(matchNegative[1].length); + } + if (extra.includes("Num")) { + ret = this.digitNumberParse(extResult); + } + else if (extra.includes(`Frac${this.config.langMarker}`)) // Frac is a special number, parse via another method + { + ret = this.fracLikeNumberParse(extResult); + } + else if (extra.includes(this.config.langMarker)) { + ret = this.textNumberParse(extResult); + } + else if (extra.includes("Pow")) { + ret = this.powerNumberParse(extResult); + } + if (ret && ret.value !== null) { + if (isNegative) { + // Recover to the original extracted Text + ret.text = matchNegative[1] + extResult.text; + // Check if ret.value is a BigNumber + if (typeof ret.value === "number") { + ret.value = -ret.value; + } + else { + ret.value.s = -1; + } + } + ret.resolutionStr = this.config.cultureInfo + ? this.config.cultureInfo.format(ret.value) + : ret.value.toString(); + } + return ret; + } + getKeyRegex(regexMap) { + let keys = new Array(); + regexMap.forEach((value, key) => keys.push(key)); + let sortKeys = lodash_sortby(keys, key => key.length).reverse(); + return sortKeys.join('|'); + } + digitNumberParse(extResult) { + let result = { + start: extResult.start, + length: extResult.length, + text: extResult.text, + type: extResult.type + }; + // [1] 24 + // [2] 12 32/33 + // [3] 1,000,000 + // [4] 234.567 + // [5] 44/55 + // [6] 2 hundred + // dot occured. + let power = 1; + let tmpIndex = -1; + let startIndex = 0; + let handle = extResult.text.toLowerCase(); + let matches = recognizersText.RegExpUtility.getMatches(this.config.digitalNumberRegex, handle); + if (matches) { + matches.forEach(match => { + // HACK: Matching regex may be buggy, may include a digit before the unit + match.value = match.value.replace(/\d/g, ''); + match.length = match.value.length; + let rep = this.config.roundNumberMap.get(match.value); + // \\s+ for filter the spaces. + power *= rep; + // tslint:disable-next-line:no-conditional-assignment + while ((tmpIndex = handle.indexOf(match.value, startIndex)) >= 0) { + let front = lodash_trimend(handle.substring(0, tmpIndex)); + startIndex = front.length; + handle = front + handle.substring(tmpIndex + match.length); + } + }); + } + // scale used in the calculate of double + result.value = this.getDigitalValue(handle, power); + return result; + } + isDigit(c) { + return c >= '0' && c <= '9'; + } + fracLikeNumberParse(extResult) { + let result = { + start: extResult.start, + length: extResult.length, + text: extResult.text, + type: extResult.type + }; + let resultText = extResult.text.toLowerCase(); + if (resultText.includes(this.config.fractionMarkerToken)) { + let overIndex = resultText.indexOf(this.config.fractionMarkerToken); + let smallPart = resultText.substring(0, overIndex).trim(); + let bigPart = resultText.substring(overIndex + this.config.fractionMarkerToken.length, resultText.length).trim(); + let smallValue = this.isDigit(smallPart[0]) + ? this.getDigitalValue(smallPart, 1) + : this.getIntValue(this.getMatches(smallPart)); + let bigValue = this.isDigit(bigPart[0]) + ? this.getDigitalValue(bigPart, 1) + : this.getIntValue(this.getMatches(bigPart)); + result.value = smallValue / bigValue; + } + else { + let words = resultText.split(" ").filter(s => s && s.length); + let fracWords = Array.from(this.config.normalizeTokenSet(words, result)); + // Split fraction with integer + let splitIndex = fracWords.length - 1; + let currentValue = this.config.resolveCompositeNumber(fracWords[splitIndex]); + let roundValue = 1; + for (splitIndex = fracWords.length - 2; splitIndex >= 0; splitIndex--) { + if (this.config.writtenFractionSeparatorTexts.indexOf(fracWords[splitIndex]) > -1 || + this.config.writtenIntegerSeparatorTexts.indexOf(fracWords[splitIndex]) > -1) { + continue; + } + let previousValue = currentValue; + currentValue = this.config.resolveCompositeNumber(fracWords[splitIndex]); + let smHundreds = 100; + // previous : hundred + // current : one + if ((previousValue >= smHundreds && previousValue > currentValue) + || (previousValue < smHundreds && this.isComposable(currentValue, previousValue))) { + if (previousValue < smHundreds && currentValue >= roundValue) { + roundValue = currentValue; + } + else if (previousValue < smHundreds && currentValue < roundValue) { + splitIndex++; + break; + } + // current is the first word + if (splitIndex === 0) { + // scan, skip the first word + splitIndex = 1; + while (splitIndex <= fracWords.length - 2) { + // e.g. one hundred thousand + // frac[i+1] % 100 && frac[i] % 100 = 0 + if (this.config.resolveCompositeNumber(fracWords[splitIndex]) >= smHundreds + && !(this.config.writtenFractionSeparatorTexts.indexOf(fracWords[splitIndex + 1]) > -1) + && this.config.resolveCompositeNumber(fracWords[splitIndex + 1]) < smHundreds) { + splitIndex++; + break; + } + splitIndex++; + } + break; + } + continue; + } + splitIndex++; + break; + } + let fracPart = new Array(); + for (let i = splitIndex; i < fracWords.length; i++) { + if (fracWords[i].indexOf("-") > -1) { + let split = fracWords[i].split('-'); + fracPart.push(split[0]); + fracPart.push("-"); + fracPart.push(split[1]); + } + else { + fracPart.push(fracWords[i]); + } + } + fracWords.splice(splitIndex, fracWords.length - splitIndex); + // denomi = denominator + let denomiValue = this.getIntValue(fracPart); + // Split mixed number with fraction + let numerValue = 0; + let intValue = 0; + let mixedIndex = fracWords.length; + for (let i = fracWords.length - 1; i >= 0; i--) { + if (i < fracWords.length - 1 && this.config.writtenFractionSeparatorTexts.indexOf(fracWords[i]) > -1) { + let numerStr = fracWords.slice(i + 1, fracWords.length).join(" "); + numerValue = this.getIntValue(this.getMatches(numerStr)); + mixedIndex = i + 1; + break; + } + } + let intStr = fracWords.slice(0, mixedIndex).join(" "); + intValue = this.getIntValue(this.getMatches(intStr)); + // Find mixed number + if (mixedIndex !== fracWords.length && numerValue < denomiValue) { + // intValue + numerValue / denomiValue + result.value = new bignumber.BigNumber(intValue).plus(new bignumber.BigNumber(numerValue).dividedBy(denomiValue)); + } + else { + // (intValue + numerValue) / denomiValue + result.value = new bignumber.BigNumber(intValue + numerValue).dividedBy(denomiValue); + } + } + return result; + } + textNumberParse(extResult) { + let result = { + start: extResult.start, + length: extResult.length, + text: extResult.text, + type: extResult.type + }; + let handle = extResult.text.toLowerCase(); + handle = handle.replace(this.config.halfADozenRegex, this.config.halfADozenText); + let numGroup = this.splitMulti(handle, Array.from(this.config.writtenDecimalSeparatorTexts)).filter(s => s && s.length > 0); + let intPart = numGroup[0]; + let matchStrs = intPart + ? intPart.match(this.textNumberRegex).map(s => s.toLowerCase()) + : new Array(); + // Get the value recursively + let intPartRet = this.getIntValue(matchStrs); + let pointPartRet = 0; + if (numGroup.length === 2) { + let pointPart = numGroup[1]; + let matchStrs = pointPart.match(this.textNumberRegex).map(s => s.toLowerCase()); + pointPartRet += this.getPointValue(matchStrs); + } + result.value = intPartRet + pointPartRet; + return result; + } + powerNumberParse(extResult) { + let result = { + start: extResult.start, + length: extResult.length, + text: extResult.text, + type: extResult.type + }; + let handle = extResult.text.toUpperCase(); + let isE = !extResult.text.includes("^"); + // [1] 1e10 + // [2] 1.1^-23 + let calStack = new Array(); + let scale = new bignumber.BigNumber(10); + let dot = false; + let isNegative = false; + let tmp = new bignumber.BigNumber(0); + for (let i = 0; i < handle.length; i++) { + let ch = handle[i]; + if (ch === '^' || ch === 'E') { + if (isNegative) { + calStack.push(tmp.negated()); + } + else { + calStack.push(tmp); + } + tmp = new bignumber.BigNumber(0); + scale = new bignumber.BigNumber(10); + dot = false; + isNegative = false; + } + else if (ch.charCodeAt(0) - 48 >= 0 && ch.charCodeAt(0) - 48 <= 9) { + if (dot) { + // tmp = tmp + scale * (ch.charCodeAt(0) - 48); + // scale *= 0.1; + tmp = tmp.plus(scale.times(ch.charCodeAt(0) - 48)); + scale = scale.times(0.1); + } + else { + // tmp = tmp * scale + (ch.charCodeAt(0) - 48); + tmp = tmp.times(scale).plus(ch.charCodeAt(0) - 48); + } + } + else if (ch === this.config.decimalSeparatorChar) { + dot = true; + scale = new bignumber.BigNumber(0.1); + } + else if (ch === '-') { + isNegative = !isNegative; + } + else if (ch === '+') { + continue; + } + if (i === handle.length - 1) { + if (isNegative) { + calStack.push(tmp.negated()); + } + else { + calStack.push(tmp); + } + } + } + let ret = 0; + if (isE) { + // ret = calStack.shift() * Math.pow(10, calStack.shift()); + ret = calStack.shift().times(Math.pow(10, calStack.shift().toNumber())).toNumber(); + } + else { + ret = Math.pow(calStack.shift().toNumber(), calStack.shift().toNumber()); + } + result.value = ret; + result.resolutionStr = ret.toString(); // @TODO Possible Culture bug. + return result; + } + splitMulti(str, tokens) { + let tempChar = tokens[0]; // We can use the first token as a temporary join character + for (let i = 0; i < tokens.length; i++) { + str = str.split(tokens[i]).join(tempChar); + } + return str.split(tempChar); + } + getMatches(input) { + let matches = input.match(this.textNumberRegex); + return (matches || []).map(match => { + return match.toLowerCase(); + }); + } + // Test if big and combine with small. + // e.g. "hundred" can combine with "thirty" but "twenty" can't combine with "thirty". + isComposable(big, small) { + let baseNumber = small > 10 ? 100 : 10; + if (big % baseNumber === 0 && big / baseNumber >= 1) { + return true; + } + return false; + } + getIntValue(matchStrs) { + let isEnd = new Array(matchStrs.length); + for (let i = 0; i < isEnd.length; i++) { + isEnd[i] = false; + } + let tempValue = 0; + let endFlag = 1; + // Scan from end to start, find the end word + for (let i = matchStrs.length - 1; i >= 0; i--) { + if (this.roundNumberSet.has(matchStrs[i])) { + // if false,then continue + // You will meet hundred first, then thousand. + if (endFlag > this.config.roundNumberMap.get(matchStrs[i])) { + continue; + } + isEnd[i] = true; + endFlag = this.config.roundNumberMap.get(matchStrs[i]); + } + } + if (endFlag === 1) { + let tempStack = new Array(); + let oldSym = ""; + matchStrs.forEach(matchStr => { + let isCardinal = this.config.cardinalNumberMap.has(matchStr); + let isOrdinal = this.config.ordinalNumberMap.has(matchStr); + if (isCardinal || isOrdinal) { + let matchValue = isCardinal + ? this.config.cardinalNumberMap.get(matchStr) + : this.config.ordinalNumberMap.get(matchStr); + // This is just for ordinal now. Not for fraction ever. + if (isOrdinal) { + let fracPart = this.config.ordinalNumberMap.get(matchStr); + if (tempStack.length > 0) { + let intPart = tempStack.pop(); + // if intPart >= fracPart, it means it is an ordinal number + // it begins with an integer, ends with an ordinal + // e.g. ninety-ninth + if (intPart >= fracPart) { + tempStack.push(intPart + fracPart); + } + // another case of the type is ordinal + // e.g. three hundredth + else { + while (tempStack.length > 0) { + intPart = intPart + tempStack.pop(); + } + tempStack.push(intPart * fracPart); + } + } + else { + tempStack.push(fracPart); + } + } + else if (this.config.cardinalNumberMap.has(matchStr)) { + if (oldSym === "-") { + let sum = tempStack.pop() + matchValue; + tempStack.push(sum); + } + else if (oldSym === this.config.writtenIntegerSeparatorTexts[0] || tempStack.length < 2) { + tempStack.push(matchValue); + } + else if (tempStack.length >= 2) { + let sum = tempStack.pop() + matchValue; + sum = tempStack.pop() + sum; + tempStack.push(sum); + } + } + } + else { + let complexValue = this.config.resolveCompositeNumber(matchStr); + if (complexValue !== 0) { + tempStack.push(complexValue); + } + } + oldSym = matchStr; + }); + tempStack.forEach(stackValue => { + tempValue += stackValue; + }); + } + else { + let lastIndex = 0; + let mulValue = 1; + let partValue = 1; + for (let i = 0; i < isEnd.length; i++) { + if (isEnd[i]) { + mulValue = this.config.roundNumberMap.get(matchStrs[i]); + partValue = 1; + if (i !== 0) { + partValue = this.getIntValue(matchStrs.slice(lastIndex, i)); + } + tempValue += mulValue * partValue; + lastIndex = i + 1; + } + } + // Calculate the part like "thirty-one" + mulValue = 1; + if (lastIndex !== isEnd.length) { + partValue = this.getIntValue(matchStrs.slice(lastIndex, isEnd.length)); + tempValue += mulValue * partValue; + } + } + return tempValue; + } + getPointValue(matchStrs) { + let ret = 0; + let firstMatch = matchStrs[0]; + if (this.config.cardinalNumberMap.has(firstMatch) && this.config.cardinalNumberMap.get(firstMatch) >= 10) { + let prefix = "0."; + let tempInt = this.getIntValue(matchStrs); + let all = prefix + tempInt; + ret = parseFloat(all); + } + else { + let scale = new bignumber.BigNumber(0.1); + for (let i = 0; i < matchStrs.length; i++) { + ret += scale.times(this.config.cardinalNumberMap.get(matchStrs[i])).toNumber(); + // scale *= 0.1; + scale = scale.times(0.1); + } + } + return ret; + } + skipNonDecimalSeparator(ch, distance, culture) { + var decimalLength = 3; + // Special cases for multi-language countries where decimal separators can be used interchangeably. Mostly informally. + // Ex: South Africa, Namibia; Puerto Rico in ES; or in Canada for EN and FR. + // "me pidio $5.00 prestados" and "me pidio $5,00 prestados" -> currency $5 + var cultureRegex = recognizersText.RegExpUtility.getSafeRegExp(String.raw `^(en|es|fr)(-)?\b`, "is"); + return (ch == this.config.nonDecimalSeparatorChar && !(distance <= decimalLength && (cultureRegex.exec(culture.code) !== null))); + } + getDigitalValue(digitsStr, power) { + let tmp = new bignumber.BigNumber(0); + let scale = new bignumber.BigNumber(10); + let decimalSeparator = false; + var strLength = digitsStr.length; + let isNegative = false; + let isFrac = digitsStr.includes('/'); + let calStack = new Array(); + for (let i = 0; i < digitsStr.length; i++) { + let ch = digitsStr[i]; + var skippableNonDecimal = this.skipNonDecimalSeparator(ch, strLength - i, this.config.cultureInfo); + if (!isFrac && (ch === ' ' || skippableNonDecimal)) { + continue; + } + if (ch === ' ' || ch === '/') { + calStack.push(tmp); + tmp = new bignumber.BigNumber(0); + } + else if (ch >= '0' && ch <= '9') { + if (decimalSeparator) { + // tmp = tmp + scale * (ch.charCodeAt(0) - 48); + // scale *= 0.1; + tmp = tmp.plus(scale.times(ch.charCodeAt(0) - 48)); + scale = scale.times(0.1); + } + else { + // tmp = tmp * scale + (ch.charCodeAt(0) - 48); + tmp = tmp.times(scale).plus(ch.charCodeAt(0) - 48); + } + } + else if (ch === this.config.decimalSeparatorChar || (!skippableNonDecimal && ch == this.config.nonDecimalSeparatorChar)) { + decimalSeparator = true; + scale = new bignumber.BigNumber(0.1); + } + else if (ch === '-') { + isNegative = true; + } + } + calStack.push(tmp); + // if the number is a fraction. + let calResult = new bignumber.BigNumber(0); + if (isFrac) { + let deno = calStack.pop(); + let mole = calStack.pop(); + // calResult += mole / deno; + calResult = calResult.plus(mole.dividedBy(deno)); + } + while (calStack.length > 0) { + calResult = calResult.plus(calStack.pop()); + } + // calResult *= power; + calResult = calResult.times(power); + if (isNegative) { + return calResult.negated().toNumber(); + } + return calResult.toNumber(); + } +} +exports.BaseNumberParser = BaseNumberParser; +class BasePercentageParser extends BaseNumberParser { + parse(extResult) { + let originText = extResult.text; + // do replace text & data from extended info + if (extResult.data && extResult.data instanceof Array) { + extResult.text = extResult.data[0]; + extResult.data = extResult.data[1].data; + } + let ret = super.parse(extResult); + if (ret.resolutionStr && ret.resolutionStr.length > 0) { + if (!ret.resolutionStr.trim().endsWith("%")) { + ret.resolutionStr = ret.resolutionStr.trim() + "%"; + } + } + ret.data = extResult.text; + ret.text = originText; + return ret; + } +} +exports.BasePercentageParser = BasePercentageParser; + +}); + +unwrapExports(parsers$2); + +var cjkParsers = createCommonjsModule(function (module, exports) { +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); + + + +const recognizers_text_2 = recognizersText; +class BaseCJKNumberParser extends parsers$2.BaseNumberParser { + constructor(config) { + super(config); + this.config = config; + } + toString(value) { + return this.config.cultureInfo + ? this.config.cultureInfo.format(value) + : value.toString(); + } + parse(extResult) { + let extra = ''; + let result; + extra = extResult.data; + let getExtResult = { + start: extResult.start, + length: extResult.length, + data: extResult.data, + text: this.replaceTraditionalWithSimplified(extResult.text), + type: extResult.type + }; + if (!extra) { + return result; + } + if (extra.includes("Per")) { + result = this.perParseCJK(getExtResult); + } + else if (extra.includes("Num")) { + getExtResult.text = this.replaceFullWithHalf(getExtResult.text); + result = this.digitNumberParse(getExtResult); + if (this.config.negativeNumberSignRegex.test(getExtResult.text) && result.value > 0) { + result.value = -result.value; + } + result.resolutionStr = this.toString(result.value); + } + else if (extra.includes("Pow")) { + getExtResult.text = this.replaceFullWithHalf(getExtResult.text); + result = this.powerNumberParse(getExtResult); + result.resolutionStr = this.toString(result.value); + } + else if (extra.includes("Frac")) { + result = this.fracParseCJK(getExtResult); + } + else if (extra.includes("Dou")) { + result = this.douParseCJK(getExtResult); + } + else if (extra.includes("Integer")) { + result = this.intParseCJK(getExtResult); + } + else if (extra.includes("Ordinal")) { + result = this.ordParseCJK(getExtResult); + } + if (result) { + result.text = extResult.text; + } + return result; + } + replaceTraditionalWithSimplified(value) { + if (recognizers_text_2.StringUtility.isNullOrWhitespace(value)) { + return value; + } + if (this.config.tratoSimMap == null) { + return value; + } + let result = ''; + for (let index = 0; index < value.length; index++) { + result = result.concat(this.config.tratoSimMap.get(value.charAt(index)) || value.charAt(index)); + } + return result; + } + replaceFullWithHalf(value) { + if (recognizers_text_2.StringUtility.isNullOrWhitespace(value)) { + return value; + } + let result = ''; + for (let index = 0; index < value.length; index++) { + result = result.concat(this.config.fullToHalfMap.get(value.charAt(index)) || value.charAt(index)); + } + return result; + } + replaceUnit(value) { + if (recognizers_text_2.StringUtility.isNullOrEmpty(value)) + return value; + let result = value; + this.config.unitMap.forEach((value, key) => { + result = result.replace(new RegExp(key, 'g'), value); + }); + return result; + } + perParseCJK(extResult) { + let result = new recognizersText.ParseResult(extResult); + let resultText = extResult.text; + let power = 1; + if (extResult.data.includes("Spe")) { + resultText = this.replaceFullWithHalf(resultText); + resultText = this.replaceUnit(resultText); + if (resultText === "半額" || resultText === "半折" || resultText === "半折") { + result.value = 50; + } + else if (resultText === "10成" || resultText === "10割" || resultText === "十割") { + result.value = 100; + } + else { + let matches = recognizers_text_2.RegExpUtility.getMatches(this.config.speGetNumberRegex, resultText); + let intNumber; + if (matches.length === 2) { + let intNumberChar = matches[0].value.charAt(0); + if (intNumberChar === '対' || intNumberChar === "对") { + intNumber = 5; + } + else if (intNumberChar === "十" || intNumberChar === "拾") { + intNumber = 10; + } + else { + intNumber = this.config.zeroToNineMap.get(intNumberChar); + } + let pointNumberChar = matches[1].value.charAt(0); + let pointNumber; + if (pointNumberChar === "半") { + pointNumber = 0.5; + } + else { + pointNumber = this.config.zeroToNineMap.get(pointNumberChar) * 0.1; + } + result.value = (intNumber + pointNumber) * 10; + } + else if (matches.length === 5) { + // Deal the Japanese percentage case like "xxx割xxx分xxx厘", get the integer value and convert into result. + let intNumberChar = matches[0].value.charAt(0); + let pointNumberChar = matches[1].value.charAt(0); + let dotNumberChar = matches[3].value.charAt(0); + let pointNumber = this.config.zeroToNineMap.get(pointNumberChar) * 0.1; + let dotNumber = this.config.zeroToNineMap.get(dotNumberChar) * 0.01; + intNumber = this.config.zeroToNineMap.get(intNumberChar); + result.value = (intNumber + pointNumber + dotNumber) * 10; + } + else { + let intNumberChar = matches[0].value.charAt(0); + if (intNumberChar === '対' || intNumberChar === "对") { + intNumber = 5; + } + else if (intNumberChar === "十" || intNumberChar === "拾") { + intNumber = 10; + } + else { + intNumber = this.config.zeroToNineMap.get(intNumberChar); + } + result.value = intNumber * 10; + } + } + } + else if (extResult.data.includes("Num")) { + let doubleMatch = recognizers_text_2.RegExpUtility.getMatches(this.config.percentageRegex, resultText).pop(); + let doubleText = doubleMatch.value; + if (doubleText.includes("k") || doubleText.includes("K") || doubleText.includes("k") || doubleText.includes("K")) { + power = 1000; + } + if (doubleText.includes("M") || doubleText.includes("M")) { + power = 1000000; + } + if (doubleText.includes("G") || doubleText.includes("G")) { + power = 1000000000; + } + if (doubleText.includes("T") || doubleText.includes("T")) { + power = 1000000000000; + } + result.value = this.getDigitValueCJK(resultText, power); + } + else { + let doubleMatch = recognizers_text_2.RegExpUtility.getMatches(this.config.percentageRegex, resultText).pop(); + let doubleText = this.replaceUnit(doubleMatch.value); + let splitResult = recognizers_text_2.RegExpUtility.split(this.config.pointRegex, doubleText); + if (splitResult[0] === "") { + splitResult[0] = "零"; + } + let doubleValue = this.getIntValueCJK(splitResult[0]); + if (splitResult.length === 2) { + if (recognizers_text_2.RegExpUtility.isMatch(this.config.negativeNumberSignRegex, splitResult[0])) { + doubleValue -= this.getPointValueCJK(splitResult[1]); + } + else { + doubleValue += this.getPointValueCJK(splitResult[1]); + } + } + result.value = doubleValue; + } + result.resolutionStr = this.toString(result.value) + "%"; + return result; + } + fracParseCJK(extResult) { + let result = new recognizersText.ParseResult(extResult); + let resultText = extResult.text; + let splitResult = recognizers_text_2.RegExpUtility.split(this.config.fracSplitRegex, resultText); + let intPart = ""; + let demoPart = ""; + let numPart = ""; + if (splitResult.length === 3) { + intPart = splitResult[0] || ""; + demoPart = splitResult[1] || ""; + numPart = splitResult[2] || ""; + } + else { + intPart = "零"; + demoPart = splitResult[0] || ""; + numPart = splitResult[1] || ""; + } + let intValue = this.isDigitCJK(intPart) + ? this.getDigitValueCJK(intPart, 1.0) + : this.getIntValueCJK(intPart); + let numValue = this.isDigitCJK(numPart) + ? this.getDigitValueCJK(numPart, 1.0) + : this.getIntValueCJK(numPart); + let demoValue = this.isDigitCJK(demoPart) + ? this.getDigitValueCJK(demoPart, 1.0) + : this.getIntValueCJK(demoPart); + if (recognizers_text_2.RegExpUtility.isMatch(this.config.negativeNumberSignRegex, intPart)) { + result.value = intValue - numValue / demoValue; + } + else { + result.value = intValue + numValue / demoValue; + } + result.resolutionStr = this.toString(result.value); + return result; + } + douParseCJK(extResult) { + let result = new recognizersText.ParseResult(extResult); + let resultText = extResult.text; + if (recognizers_text_2.RegExpUtility.isMatch(this.config.doubleAndRoundRegex, resultText)) { + resultText = this.replaceUnit(resultText); + let power = this.config.roundNumberMapChar.get(resultText.charAt(resultText.length - 1)); + result.value = this.getDigitValueCJK(resultText.substr(0, resultText.length - 1), power); + } + else { + resultText = this.replaceUnit(resultText); + let splitResult = recognizers_text_2.RegExpUtility.split(this.config.pointRegex, resultText); + if (splitResult[0] === "") { + splitResult[0] = "零"; + } + if (recognizers_text_2.RegExpUtility.isMatch(this.config.negativeNumberSignRegex, splitResult[0])) { + result.value = this.getIntValueCJK(splitResult[0]) - this.getPointValueCJK(splitResult[1]); + } + else { + result.value = this.getIntValueCJK(splitResult[0]) + this.getPointValueCJK(splitResult[1]); + } + } + result.resolutionStr = this.toString(result.value); + return result; + } + intParseCJK(extResult) { + let result = new recognizersText.ParseResult(extResult); + result.value = this.getIntValueCJK(extResult.text); + result.resolutionStr = this.toString(result.value); + return result; + } + ordParseCJK(extResult) { + let result = new recognizersText.ParseResult(extResult); + let resultText = extResult.text.substr(1); + if (recognizers_text_2.RegExpUtility.isMatch(this.config.digitNumRegex, resultText) && !recognizers_text_2.RegExpUtility.isMatch(this.config.roundNumberIntegerRegex, resultText)) { + result.value = this.getDigitValueCJK(resultText, 1); + } + else { + result.value = this.getIntValueCJK(resultText); + } + result.resolutionStr = this.toString(result.value); + return result; + } + getDigitValueCJK(value, power) { + let isNegative = false; + let resultStr = value; + if (recognizers_text_2.RegExpUtility.isMatch(this.config.negativeNumberSignRegex, resultStr)) { + isNegative = true; + resultStr = resultStr.substr(1); + } + resultStr = this.replaceFullWithHalf(resultStr); + let result = this.getDigitalValue(resultStr, power); + if (isNegative) { + result = -result; + } + return result; + } + getIntValueCJK(value) { + let resultStr = value; + let isDozen = false; + let isPair = false; + if (recognizers_text_2.RegExpUtility.isMatch(this.config.dozenRegex, resultStr)) { + isDozen = true; + if (this.config.cultureInfo.code.toLowerCase() === culture$2.Culture.Chinese) { + resultStr = resultStr.substr(0, resultStr.length - 1); + } + else if (this.config.cultureInfo.code.toLowerCase() === culture$2.Culture.Japanese) { + resultStr = resultStr.substr(0, resultStr.length - 3); + } + } + else if (recognizers_text_2.RegExpUtility.isMatch(this.config.pairRegex, resultStr)) { + isPair = true; + resultStr = resultStr.substr(0, resultStr.length - 1); + } + resultStr = this.replaceUnit(resultStr); + let intValue = 0; + let partValue = 0; + let beforeValue = 0; + let isRoundBefore = false; + let roundBefore = -1; + let roundDefault = 1; + let isNegative = false; + let hasNumber = false; + if (recognizers_text_2.RegExpUtility.isMatch(this.config.negativeNumberSignRegex, resultStr)) { + isNegative = true; + resultStr = resultStr.substr(1); + } + for (let index = 0; index < resultStr.length; index++) { + let currentChar = resultStr.charAt(index); + if (this.config.roundNumberMapChar.has(currentChar)) { + let roundRecent = this.config.roundNumberMapChar.get(currentChar); + if (!hasNumber) { + beforeValue = 1; + } + if (roundBefore !== -1 && roundRecent > roundBefore) { + if (isRoundBefore) { + intValue += partValue * roundRecent; + isRoundBefore = false; + } + else { + partValue += beforeValue * roundDefault; + intValue += partValue * roundRecent; + } + roundBefore = -1; + partValue = 0; + } + else { + isRoundBefore = true; + partValue += beforeValue * roundRecent; + roundBefore = roundRecent; + if ((index === resultStr.length - 1) || this.config.roundDirectList.some(o => o === currentChar)) { + intValue += partValue; + partValue = 0; + } + } + hasNumber = false; + beforeValue = 0; + roundDefault = roundRecent / 10; + } + else if (this.config.zeroToNineMap.has(currentChar)) { + hasNumber = true; + if (index !== resultStr.length - 1) { + if ((currentChar === "零") && !this.config.roundNumberMapChar.has(resultStr.charAt(index + 1))) { + roundDefault = 1; + } + else { + beforeValue = beforeValue * 10 + this.config.zeroToNineMap.get(currentChar); + isRoundBefore = false; + } + } + else { + if (index === resultStr.length - 1 && this.config.cultureInfo.code.toLowerCase() === culture$2.Culture.Japanese) { + roundDefault = 1; + } + partValue += beforeValue * 10; + partValue += this.config.zeroToNineMap.get(currentChar) * roundDefault; + intValue += partValue; + partValue = 0; + } + } + } + if (isNegative) { + intValue = -intValue; + } + if (isDozen) { + intValue = intValue * 12; + } + if (isPair) { + intValue = intValue * 2; + } + return intValue; + } + getPointValueCJK(value) { + let result = 0; + let scale = 0.1; + for (let index = 0; index < value.length; index++) { + result += scale * this.config.zeroToNineMap.get(value.charAt(index)); + scale *= 0.1; + } + return result; + } + isDigitCJK(value) { + return !recognizers_text_2.StringUtility.isNullOrEmpty(value) + && recognizers_text_2.RegExpUtility.isMatch(this.config.digitNumRegex, value); + } +} +exports.BaseCJKNumberParser = BaseCJKNumberParser; + +}); + +unwrapExports(cjkParsers); + +var agnosticNumberParser = createCommonjsModule(function (module, exports) { +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); + + + + +var AgnosticNumberParserType; +(function (AgnosticNumberParserType) { + AgnosticNumberParserType[AgnosticNumberParserType["Cardinal"] = 0] = "Cardinal"; + AgnosticNumberParserType[AgnosticNumberParserType["Double"] = 1] = "Double"; + AgnosticNumberParserType[AgnosticNumberParserType["Fraction"] = 2] = "Fraction"; + AgnosticNumberParserType[AgnosticNumberParserType["Integer"] = 3] = "Integer"; + AgnosticNumberParserType[AgnosticNumberParserType["Number"] = 4] = "Number"; + AgnosticNumberParserType[AgnosticNumberParserType["Ordinal"] = 5] = "Ordinal"; + AgnosticNumberParserType[AgnosticNumberParserType["Percentage"] = 6] = "Percentage"; +})(AgnosticNumberParserType = exports.AgnosticNumberParserType || (exports.AgnosticNumberParserType = {})); +class AgnosticNumberParserFactory { + static getParser(type, languageConfiguration) { + let isChinese = languageConfiguration.cultureInfo.code.toLowerCase() === culture$2.Culture.Chinese; + let isJapanese = languageConfiguration.cultureInfo.code.toLowerCase() === culture$2.Culture.Japanese; + let parser; + if (isChinese) { + parser = new cjkParsers.BaseCJKNumberParser(languageConfiguration); + } + else if (isJapanese) { + parser = new cjkParsers.BaseCJKNumberParser(languageConfiguration); + } + else { + parser = new parsers$2.BaseNumberParser(languageConfiguration); + } + switch (type) { + case AgnosticNumberParserType.Cardinal: + parser.supportedTypes = [constants.Constants.SYS_NUM_CARDINAL, constants.Constants.SYS_NUM_INTEGER, constants.Constants.SYS_NUM_DOUBLE]; + break; + case AgnosticNumberParserType.Double: + parser.supportedTypes = [constants.Constants.SYS_NUM_DOUBLE]; + break; + case AgnosticNumberParserType.Fraction: + parser.supportedTypes = [constants.Constants.SYS_NUM_FRACTION]; + break; + case AgnosticNumberParserType.Integer: + parser.supportedTypes = [constants.Constants.SYS_NUM_INTEGER]; + break; + case AgnosticNumberParserType.Ordinal: + parser.supportedTypes = [constants.Constants.SYS_NUM_ORDINAL]; + break; + case AgnosticNumberParserType.Percentage: + if (!isChinese && !isJapanese) { + parser = new parsers$2.BasePercentageParser(languageConfiguration); + } + break; + } + return parser; + } +} +exports.AgnosticNumberParserFactory = AgnosticNumberParserFactory; + +}); + +unwrapExports(agnosticNumberParser); + +var baseNumbers = createCommonjsModule(function (module, exports) { +"use strict"; +// ------------------------------------------------------------------------------ +// +// This code was generated by a tool. +// Changes to this file may cause incorrect behavior and will be lost if +// the code is regenerated. +// +// ------------------------------------------------------------------------------ +Object.defineProperty(exports, "__esModule", { value: true }); +var BaseNumbers; +(function (BaseNumbers) { + BaseNumbers.NumberReplaceToken = '@builtin.num'; + BaseNumbers.FractionNumberReplaceToken = '@builtin.num.fraction'; + BaseNumbers.IntegerRegexDefinition = (placeholder, thousandsmark) => { return `(((? { return `(((? +// This code was generated by a tool. +// Changes to this file may cause incorrect behavior and will be lost if +// the code is regenerated. +// +// ------------------------------------------------------------------------------ +Object.defineProperty(exports, "__esModule", { value: true }); + +var EnglishNumeric; +(function (EnglishNumeric) { + EnglishNumeric.LangMarker = 'Eng'; + EnglishNumeric.RoundNumberIntegerRegex = `(hundred|thousand|million|billion|trillion)`; + EnglishNumeric.ZeroToNineIntegerRegex = `(three|seven|eight|four|five|zero|nine|one|two|six)`; + EnglishNumeric.NegativeNumberTermsRegex = `((minus|negative)\\s+)`; + EnglishNumeric.NegativeNumberSignRegex = `^${EnglishNumeric.NegativeNumberTermsRegex}.*`; + EnglishNumeric.AnIntRegex = `(an|a)(?=\\s)`; + EnglishNumeric.TenToNineteenIntegerRegex = `(seventeen|thirteen|fourteen|eighteen|nineteen|fifteen|sixteen|eleven|twelve|ten)`; + EnglishNumeric.TensNumberIntegerRegex = `(seventy|twenty|thirty|eighty|ninety|forty|fifty|sixty)`; + EnglishNumeric.SeparaIntRegex = `(((${EnglishNumeric.TenToNineteenIntegerRegex}|(${EnglishNumeric.TensNumberIntegerRegex}(\\s+(and\\s+)?|\\s*-\\s*)${EnglishNumeric.ZeroToNineIntegerRegex})|${EnglishNumeric.TensNumberIntegerRegex}|${EnglishNumeric.ZeroToNineIntegerRegex})(\\s+${EnglishNumeric.RoundNumberIntegerRegex})*))|((${EnglishNumeric.AnIntRegex}(\\s+${EnglishNumeric.RoundNumberIntegerRegex})+))`; + EnglishNumeric.AllIntRegex = `((((${EnglishNumeric.TenToNineteenIntegerRegex}|(${EnglishNumeric.TensNumberIntegerRegex}(\\s+(and\\s+)?|\\s*-\\s*)${EnglishNumeric.ZeroToNineIntegerRegex})|${EnglishNumeric.TensNumberIntegerRegex}|${EnglishNumeric.ZeroToNineIntegerRegex}|${EnglishNumeric.AnIntRegex})(\\s+${EnglishNumeric.RoundNumberIntegerRegex})+)\\s+(and\\s+)?)*${EnglishNumeric.SeparaIntRegex})`; + EnglishNumeric.PlaceHolderPureNumber = `\\b`; + EnglishNumeric.PlaceHolderDefault = `\\D|\\b`; + EnglishNumeric.NumbersWithPlaceHolder = (placeholder) => { return `(((?(${EnglishNumeric.AllIntRegex})|((?(${EnglishNumeric.AllIntRegex})|(\\d+)(?![\\.,]))(?=\\b)`; + EnglishNumeric.FractionPrepositionWithinPercentModeRegex = `(?<=\\b)(?(${EnglishNumeric.AllIntRegex})|((?(${EnglishNumeric.AllIntRegex})|(\\d+)(?![\\.,]))(?=\\b)`; + EnglishNumeric.AllPointRegex = `((\\s+${EnglishNumeric.ZeroToNineIntegerRegex})+|(\\s+${EnglishNumeric.SeparaIntRegex}))`; + EnglishNumeric.AllFloatRegex = `${EnglishNumeric.AllIntRegex}(\\s+point)${EnglishNumeric.AllPointRegex}`; + EnglishNumeric.DoubleWithMultiplierRegex = `(((? { return `(((? { return `(?<=\\s|^)(?and)`; + EnglishNumeric.NumberWithSuffixPercentage = `(?)`; + EnglishNumeric.LessRegex = `((less|lower|smaller|fewer)(\\s+than)?|below|under|(?|=)<)`; + EnglishNumeric.EqualRegex = `(equal(s|ing)?(\\s+(to|than))?|(?)=)`; + EnglishNumeric.MoreOrEqualPrefix = `((no\\s+${EnglishNumeric.LessRegex})|(at\\s+least))`; + EnglishNumeric.MoreOrEqual = `((${EnglishNumeric.MoreRegex}\\s+(or)?\\s+${EnglishNumeric.EqualRegex})|(${EnglishNumeric.EqualRegex}\\s+(or)?\\s+${EnglishNumeric.MoreRegex})|${EnglishNumeric.MoreOrEqualPrefix}(\\s+(or)?\\s+${EnglishNumeric.EqualRegex})?|(${EnglishNumeric.EqualRegex}\\s+(or)?\\s+)?${EnglishNumeric.MoreOrEqualPrefix}|>\\s*=)`; + EnglishNumeric.MoreOrEqualSuffix = `((and|or)\\s+(more|greater|higher|larger|bigger)((?!\\s+than)|(\\s+than(?!(\\s*\\d+)))))`; + EnglishNumeric.LessOrEqualPrefix = `((no\\s+${EnglishNumeric.MoreRegex})|(at\\s+most))`; + EnglishNumeric.LessOrEqual = `((${EnglishNumeric.LessRegex}\\s+(or)?\\s+${EnglishNumeric.EqualRegex})|(${EnglishNumeric.EqualRegex}\\s+(or)?\\s+${EnglishNumeric.LessRegex})|${EnglishNumeric.LessOrEqualPrefix}(\\s+(or)?\\s+${EnglishNumeric.EqualRegex})?|(${EnglishNumeric.EqualRegex}\\s+(or)?\\s+)?${EnglishNumeric.LessOrEqualPrefix}|<\\s*=)`; + EnglishNumeric.LessOrEqualSuffix = `((and|or)\\s+(less|lower|smaller|fewer)((?!\\s+than)|(\\s+than(?!(\\s*\\d+)))))`; + EnglishNumeric.NumberSplitMark = `(?![,.](?!\\d+))`; + EnglishNumeric.MoreRegexNoNumberSucceed = `((bigger|greater|more|higher|larger)((?!\\s+than)|\\s+(than(?!(\\s*\\d+))))|(above|over)(?!(\\s*\\d+)))`; + EnglishNumeric.LessRegexNoNumberSucceed = `((less|lower|smaller|fewer)((?!\\s+than)|\\s+(than(?!(\\s*\\d+))))|(below|under)(?!(\\s*\\d+)))`; + EnglishNumeric.EqualRegexNoNumberSucceed = `(equal(s|ing)?((?!\\s+(to|than))|(\\s+(to|than)(?!(\\s*\\d+)))))`; + EnglishNumeric.OneNumberRangeMoreRegex1 = `(${EnglishNumeric.MoreOrEqual}|${EnglishNumeric.MoreRegex})\\s*(the\\s+)?(?(${EnglishNumeric.NumberSplitMark}.)+)`; + EnglishNumeric.OneNumberRangeMoreRegex2 = `(?(${EnglishNumeric.NumberSplitMark}.)+)\\s*${EnglishNumeric.MoreOrEqualSuffix}`; + EnglishNumeric.OneNumberRangeMoreSeparateRegex = `(${EnglishNumeric.EqualRegex}\\s+(?(${EnglishNumeric.NumberSplitMark}.)+)(\\s+or\\s+)${EnglishNumeric.MoreRegexNoNumberSucceed})|(${EnglishNumeric.MoreRegex}\\s+(?(${EnglishNumeric.NumberSplitMark}.)+)(\\s+or\\s+)${EnglishNumeric.EqualRegexNoNumberSucceed})`; + EnglishNumeric.OneNumberRangeLessRegex1 = `(${EnglishNumeric.LessOrEqual}|${EnglishNumeric.LessRegex})\\s*(the\\s+)?(?(${EnglishNumeric.NumberSplitMark}.)+)`; + EnglishNumeric.OneNumberRangeLessRegex2 = `(?(${EnglishNumeric.NumberSplitMark}.)+)\\s*${EnglishNumeric.LessOrEqualSuffix}`; + EnglishNumeric.OneNumberRangeLessSeparateRegex = `(${EnglishNumeric.EqualRegex}\\s+(?(${EnglishNumeric.NumberSplitMark}.)+)(\\s+or\\s+)${EnglishNumeric.LessRegexNoNumberSucceed})|(${EnglishNumeric.LessRegex}\\s+(?(${EnglishNumeric.NumberSplitMark}.)+)(\\s+or\\s+)${EnglishNumeric.EqualRegexNoNumberSucceed})`; + EnglishNumeric.OneNumberRangeEqualRegex = `${EnglishNumeric.EqualRegex}\\s*(the\\s+)?(?(${EnglishNumeric.NumberSplitMark}.)+)`; + EnglishNumeric.TwoNumberRangeRegex1 = `between\\s*(the\\s+)?(?(${EnglishNumeric.NumberSplitMark}.)+)\\s*and\\s*(the\\s+)?(?(${EnglishNumeric.NumberSplitMark}.)+)`; + EnglishNumeric.TwoNumberRangeRegex2 = `(${EnglishNumeric.OneNumberRangeMoreRegex1}|${EnglishNumeric.OneNumberRangeMoreRegex2})\\s*(and|but|,)\\s*(${EnglishNumeric.OneNumberRangeLessRegex1}|${EnglishNumeric.OneNumberRangeLessRegex2})`; + EnglishNumeric.TwoNumberRangeRegex3 = `(${EnglishNumeric.OneNumberRangeLessRegex1}|${EnglishNumeric.OneNumberRangeLessRegex2})\\s*(and|but|,)\\s*(${EnglishNumeric.OneNumberRangeMoreRegex1}|${EnglishNumeric.OneNumberRangeMoreRegex2})`; + EnglishNumeric.TwoNumberRangeRegex4 = `(from\\s+)?(?(${EnglishNumeric.NumberSplitMark}(?!\\bfrom\\b).)+)\\s*${EnglishNumeric.TillRegex}\\s*(the\\s+)?(?(${EnglishNumeric.NumberSplitMark}.)+)`; + EnglishNumeric.AmbiguousFractionConnectorsRegex = `(\\bin\\b)`; + EnglishNumeric.DecimalSeparatorChar = '.'; + EnglishNumeric.FractionMarkerToken = 'over'; + EnglishNumeric.NonDecimalSeparatorChar = ','; + EnglishNumeric.HalfADozenText = 'six'; + EnglishNumeric.WordSeparatorToken = 'and'; + EnglishNumeric.WrittenDecimalSeparatorTexts = ['point']; + EnglishNumeric.WrittenGroupSeparatorTexts = ['punto']; + EnglishNumeric.WrittenIntegerSeparatorTexts = ['and']; + EnglishNumeric.WrittenFractionSeparatorTexts = ['and']; + EnglishNumeric.HalfADozenRegex = `half\\s+a\\s+dozen`; + EnglishNumeric.DigitalNumberRegex = `((?<=\\b)(hundred|thousand|million|billion|trillion|dozen(s)?)(?=\\b))|((?<=(\\d|\\b))(k|t|m|g|b)(?=\\b))`; + EnglishNumeric.CardinalNumberMap = new Map([["a", 1], ["zero", 0], ["an", 1], ["one", 1], ["two", 2], ["three", 3], ["four", 4], ["five", 5], ["six", 6], ["seven", 7], ["eight", 8], ["nine", 9], ["ten", 10], ["eleven", 11], ["twelve", 12], ["dozen", 12], ["dozens", 12], ["thirteen", 13], ["fourteen", 14], ["fifteen", 15], ["sixteen", 16], ["seventeen", 17], ["eighteen", 18], ["nineteen", 19], ["twenty", 20], ["thirty", 30], ["forty", 40], ["fifty", 50], ["sixty", 60], ["seventy", 70], ["eighty", 80], ["ninety", 90], ["hundred", 100], ["thousand", 1000], ["million", 1000000], ["billion", 1000000000], ["trillion", 1000000000000]]); + EnglishNumeric.OrdinalNumberMap = new Map([["first", 1], ["second", 2], ["secondary", 2], ["half", 2], ["third", 3], ["fourth", 4], ["quarter", 4], ["fifth", 5], ["sixth", 6], ["seventh", 7], ["eighth", 8], ["ninth", 9], ["tenth", 10], ["eleventh", 11], ["twelfth", 12], ["thirteenth", 13], ["fourteenth", 14], ["fifteenth", 15], ["sixteenth", 16], ["seventeenth", 17], ["eighteenth", 18], ["nineteenth", 19], ["twentieth", 20], ["thirtieth", 30], ["fortieth", 40], ["fiftieth", 50], ["sixtieth", 60], ["seventieth", 70], ["eightieth", 80], ["ninetieth", 90], ["hundredth", 100], ["thousandth", 1000], ["millionth", 1000000], ["billionth", 1000000000], ["trillionth", 1000000000000], ["firsts", 1], ["halves", 2], ["thirds", 3], ["fourths", 4], ["quarters", 4], ["fifths", 5], ["sixths", 6], ["sevenths", 7], ["eighths", 8], ["ninths", 9], ["tenths", 10], ["elevenths", 11], ["twelfths", 12], ["thirteenths", 13], ["fourteenths", 14], ["fifteenths", 15], ["sixteenths", 16], ["seventeenths", 17], ["eighteenths", 18], ["nineteenths", 19], ["twentieths", 20], ["thirtieths", 30], ["fortieths", 40], ["fiftieths", 50], ["sixtieths", 60], ["seventieths", 70], ["eightieths", 80], ["ninetieths", 90], ["hundredths", 100], ["thousandths", 1000], ["millionths", 1000000], ["billionths", 1000000000], ["trillionths", 1000000000000]]); + EnglishNumeric.RoundNumberMap = new Map([["hundred", 100], ["thousand", 1000], ["million", 1000000], ["billion", 1000000000], ["trillion", 1000000000000], ["hundredth", 100], ["thousandth", 1000], ["millionth", 1000000], ["billionth", 1000000000], ["trillionth", 1000000000000], ["hundredths", 100], ["thousandths", 1000], ["millionths", 1000000], ["billionths", 1000000000], ["trillionths", 1000000000000], ["dozen", 12], ["dozens", 12], ["k", 1000], ["m", 1000000], ["g", 1000000000], ["b", 1000000000], ["t", 1000000000000]]); + EnglishNumeric.AmbiguityFiltersDict = new Map([["\\bone\\b", "\\b(the|this|that|which)\\s+(one)\\b"]]); +})(EnglishNumeric = exports.EnglishNumeric || (exports.EnglishNumeric = {})); + +}); + +unwrapExports(englishNumeric); + +var parserConfiguration = createCommonjsModule(function (module, exports) { +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); + + + +class EnglishNumberParserConfiguration { + constructor(ci) { + if (!ci) { + ci = new culture$2.CultureInfo(culture$2.Culture.English); + } + this.cultureInfo = ci; + this.langMarker = englishNumeric.EnglishNumeric.LangMarker; + this.decimalSeparatorChar = englishNumeric.EnglishNumeric.DecimalSeparatorChar; + this.fractionMarkerToken = englishNumeric.EnglishNumeric.FractionMarkerToken; + this.nonDecimalSeparatorChar = englishNumeric.EnglishNumeric.NonDecimalSeparatorChar; + this.halfADozenText = englishNumeric.EnglishNumeric.HalfADozenText; + this.wordSeparatorToken = englishNumeric.EnglishNumeric.WordSeparatorToken; + this.writtenDecimalSeparatorTexts = englishNumeric.EnglishNumeric.WrittenDecimalSeparatorTexts; + this.writtenGroupSeparatorTexts = englishNumeric.EnglishNumeric.WrittenGroupSeparatorTexts; + this.writtenIntegerSeparatorTexts = englishNumeric.EnglishNumeric.WrittenIntegerSeparatorTexts; + this.writtenFractionSeparatorTexts = englishNumeric.EnglishNumeric.WrittenFractionSeparatorTexts; + this.cardinalNumberMap = englishNumeric.EnglishNumeric.CardinalNumberMap; + this.ordinalNumberMap = englishNumeric.EnglishNumeric.OrdinalNumberMap; + this.roundNumberMap = englishNumeric.EnglishNumeric.RoundNumberMap; + this.negativeNumberSignRegex = recognizersText.RegExpUtility.getSafeRegExp(englishNumeric.EnglishNumeric.NegativeNumberSignRegex, "is"); + this.halfADozenRegex = recognizersText.RegExpUtility.getSafeRegExp(englishNumeric.EnglishNumeric.HalfADozenRegex, "gis"); + this.digitalNumberRegex = recognizersText.RegExpUtility.getSafeRegExp(englishNumeric.EnglishNumeric.DigitalNumberRegex, "gis"); + } + normalizeTokenSet(tokens, context) { + let fracWords = new Array(); + let tokenList = Array.from(tokens); + let tokenLen = tokenList.length; + for (let i = 0; i < tokenLen; i++) { + if (tokenList[i].includes("-")) { + let spiltedTokens = tokenList[i].split("-"); + if (spiltedTokens.length === 2 && this.ordinalNumberMap.has(spiltedTokens[1])) { + fracWords.push(spiltedTokens[0]); + fracWords.push(spiltedTokens[1]); + } + else { + fracWords.push(tokenList[i]); + } + } + else if ((i < tokenLen - 2) && tokenList[i + 1] === "-") { + if (this.ordinalNumberMap.has(tokenList[i + 2])) { + fracWords.push(tokenList[i]); + fracWords.push(tokenList[i + 2]); + } + else { + fracWords.push(tokenList[i] + tokenList[i + 1] + tokenList[i + 2]); + } + i += 2; + } + else { + fracWords.push(tokenList[i]); + } + } + return fracWords; + } + resolveCompositeNumber(numberStr) { + if (numberStr.includes("-")) { + let numbers = numberStr.split('-'); + let ret = 0; + numbers.forEach(num => { + if (this.ordinalNumberMap.has(num)) { + ret += this.ordinalNumberMap.get(num); + } + else if (this.cardinalNumberMap.has(num)) { + ret += this.cardinalNumberMap.get(num); + } + }); + return ret; + } + if (this.ordinalNumberMap.has(numberStr)) { + return this.ordinalNumberMap.get(numberStr); + } + if (this.cardinalNumberMap.has(numberStr)) { + return this.cardinalNumberMap.get(numberStr); + } + return 0; + } +} +exports.EnglishNumberParserConfiguration = EnglishNumberParserConfiguration; + +}); + +unwrapExports(parserConfiguration); + +var spanishNumeric = createCommonjsModule(function (module, exports) { +"use strict"; +// ------------------------------------------------------------------------------ +// +// This code was generated by a tool. +// Changes to this file may cause incorrect behavior and will be lost if +// the code is regenerated. +// +// ------------------------------------------------------------------------------ +Object.defineProperty(exports, "__esModule", { value: true }); + +var SpanishNumeric; +(function (SpanishNumeric) { + SpanishNumeric.LangMarker = 'Spa'; + SpanishNumeric.HundredsNumberIntegerRegex = `(cuatrocient[ao]s|trescient[ao]s|seiscient[ao]s|setecient[ao]s|ochocient[ao]s|novecient[ao]s|doscient[ao]s|quinient[ao]s|(? { return `(((?(${SpanishNumeric.AllIntRegex})|((?(${SpanishNumeric.AllIntRegex})|((\\d+)(?!\\.)))(?=\\b)`; + SpanishNumeric.AllPointRegex = `((\\s+${SpanishNumeric.ZeroToNineIntegerRegex})+|(\\s+${SpanishNumeric.AllIntRegex}))`; + SpanishNumeric.AllFloatRegex = `${SpanishNumeric.AllIntRegex}(\\s+(coma|con))${SpanishNumeric.AllPointRegex}`; + SpanishNumeric.DoubleDecimalPointRegex = (placeholder) => { return `(((? { return `(?<=\\s|^)(? { + spanishNumeric.SpanishNumeric.SuffixOrdinalMap.forEach((suffixValue, suffixKey) => { + if (!ordinalNumberMap.has(prefixKey + suffixKey)) { + ordinalNumberMap.set(prefixKey + suffixKey, prefixValue * suffixValue); + } + }); + }); + this.cardinalNumberMap = spanishNumeric.SpanishNumeric.CardinalNumberMap; + this.ordinalNumberMap = ordinalNumberMap; + this.roundNumberMap = spanishNumeric.SpanishNumeric.RoundNumberMap; + this.negativeNumberSignRegex = recognizersText.RegExpUtility.getSafeRegExp(spanishNumeric.SpanishNumeric.NegativeNumberSignRegex, "is"); + this.halfADozenRegex = recognizersText.RegExpUtility.getSafeRegExp(spanishNumeric.SpanishNumeric.HalfADozenRegex); + this.digitalNumberRegex = recognizersText.RegExpUtility.getSafeRegExp(spanishNumeric.SpanishNumeric.DigitalNumberRegex); + } + normalizeTokenSet(tokens, context) { + let result = new Array(); + tokens.forEach((token) => { + let tempWord = token.replace(/^s+/, '').replace(/s+$/, ''); + if (this.ordinalNumberMap.has(tempWord)) { + result.push(tempWord); + return; + } + if (tempWord.endsWith("avo") || tempWord.endsWith("ava")) { + let origTempWord = tempWord; + let newLength = origTempWord.length; + tempWord = origTempWord.substring(0, newLength - 3); + if (this.cardinalNumberMap.has(tempWord)) { + result.push(tempWord); + return; + } + else { + tempWord = origTempWord.substring(0, newLength - 2); + if (this.cardinalNumberMap.has(tempWord)) { + result.push(tempWord); + return; + } + } + } + result.push(token); + }); + return result; + } + resolveCompositeNumber(numberStr) { + if (this.ordinalNumberMap.has(numberStr)) { + return this.ordinalNumberMap.get(numberStr); + } + if (this.cardinalNumberMap.has(numberStr)) { + return this.cardinalNumberMap.get(numberStr); + } + let value = 0; + let finalValue = 0; + let strBuilder = ""; + let lastGoodChar = 0; + for (let i = 0; i < numberStr.length; i++) { + strBuilder = strBuilder.concat(numberStr[i]); + if (this.cardinalNumberMap.has(strBuilder) && this.cardinalNumberMap.get(strBuilder) > value) { + lastGoodChar = i; + value = this.cardinalNumberMap.get(strBuilder); + } + if ((i + 1) === numberStr.length) { + finalValue += value; + strBuilder = ""; + i = lastGoodChar++; + value = 0; + } + } + return finalValue; + } +} +exports.SpanishNumberParserConfiguration = SpanishNumberParserConfiguration; + +}); + +unwrapExports(parserConfiguration$2); + +var portugueseNumeric = createCommonjsModule(function (module, exports) { +"use strict"; +// ------------------------------------------------------------------------------ +// +// This code was generated by a tool. +// Changes to this file may cause incorrect behavior and will be lost if +// the code is regenerated. +// +// ------------------------------------------------------------------------------ +Object.defineProperty(exports, "__esModule", { value: true }); + +var PortugueseNumeric; +(function (PortugueseNumeric) { + PortugueseNumeric.LangMarker = 'Por'; + PortugueseNumeric.HundredsNumberIntegerRegex = `(quatrocent[ao]s|trezent[ao]s|seiscent[ao]s|setecent[ao]s|oitocent[ao]s|novecent[ao]s|duzent[ao]s|quinhent[ao]s|cem|(? { return `(((?(${PortugueseNumeric.AllIntRegex})|((?(${PortugueseNumeric.AllIntRegex})|((\\d+)(?!\\.)))(?=\\b)`; + PortugueseNumeric.AllFloatRegex = `${PortugueseNumeric.AllIntRegex}(\\s+(vírgula|virgula|e|ponto))${PortugueseNumeric.AllPointRegex}`; + PortugueseNumeric.DoubleWithMultiplierRegex = `(((? { return `(((? { return `(?<=\\s|^)(? { + portugueseNumeric.PortugueseNumeric.SuffixOrdinalMap.forEach((suffixValue, suffixKey) => { + if (!ordinalNumberMap.has(prefixKey + suffixKey)) { + ordinalNumberMap.set(prefixKey + suffixKey, prefixValue * suffixValue); + } + }); + }); + this.cardinalNumberMap = portugueseNumeric.PortugueseNumeric.CardinalNumberMap; + this.ordinalNumberMap = ordinalNumberMap; + this.roundNumberMap = portugueseNumeric.PortugueseNumeric.RoundNumberMap; + this.negativeNumberSignRegex = recognizersText.RegExpUtility.getSafeRegExp(portugueseNumeric.PortugueseNumeric.NegativeNumberSignRegex, "is"); + this.halfADozenRegex = recognizersText.RegExpUtility.getSafeRegExp(portugueseNumeric.PortugueseNumeric.HalfADozenRegex); + this.digitalNumberRegex = recognizersText.RegExpUtility.getSafeRegExp(portugueseNumeric.PortugueseNumeric.DigitalNumberRegex); + } + normalizeTokenSet(tokens, context) { + let result = new Array(); + tokens.forEach((token) => { + let tempWord = token.replace(/^s+/, '').replace(/s+$/, ''); + if (this.ordinalNumberMap.has(tempWord)) { + result.push(tempWord); + return; + } + // ends with 'avo' or 'ava' + if (portugueseNumeric.PortugueseNumeric.WrittenFractionSuffix.some(suffix => tempWord.endsWith(suffix))) { + let origTempWord = tempWord; + let newLength = origTempWord.length; + tempWord = origTempWord.substring(0, newLength - 3); + if (!tempWord) { + return; + } + else if (this.cardinalNumberMap.has(tempWord)) { + result.push(tempWord); + return; + } + else { + tempWord = origTempWord.substring(0, newLength - 2); + if (this.cardinalNumberMap.has(tempWord)) { + result.push(tempWord); + return; + } + } + } + result.push(token); + }); + return result; + } + resolveCompositeNumber(numberStr) { + if (this.ordinalNumberMap.has(numberStr)) { + return this.ordinalNumberMap.get(numberStr); + } + if (this.cardinalNumberMap.has(numberStr)) { + return this.cardinalNumberMap.get(numberStr); + } + let value = 0; + let finalValue = 0; + let strBuilder = ""; + let lastGoodChar = 0; + for (let i = 0; i < numberStr.length; i++) { + strBuilder = strBuilder.concat(numberStr[i]); + if (this.cardinalNumberMap.has(strBuilder) && this.cardinalNumberMap.get(strBuilder) > value) { + lastGoodChar = i; + value = this.cardinalNumberMap.get(strBuilder); + } + if ((i + 1) === numberStr.length) { + finalValue += value; + strBuilder = ""; + i = lastGoodChar++; + value = 0; + } + } + return finalValue; + } +} +exports.PortugueseNumberParserConfiguration = PortugueseNumberParserConfiguration; + +}); + +unwrapExports(parserConfiguration$4); + +var frenchNumeric = createCommonjsModule(function (module, exports) { +"use strict"; +// ------------------------------------------------------------------------------ +// +// This code was generated by a tool. +// Changes to this file may cause incorrect behavior and will be lost if +// the code is regenerated. +// +// ------------------------------------------------------------------------------ +Object.defineProperty(exports, "__esModule", { value: true }); + +var FrenchNumeric; +(function (FrenchNumeric) { + FrenchNumeric.LangMarker = 'Fr'; + FrenchNumeric.RoundNumberIntegerRegex = `(cent|mille|millions|million|milliard|milliards|billion|billions)`; + FrenchNumeric.ZeroToNineIntegerRegex = `(et un|un|une|deux|trois|quatre|cinq|six|sept|huit|neuf)`; + FrenchNumeric.TenToNineteenIntegerRegex = `((seize|quinze|quatorze|treize|douze|onze)|dix(\\Wneuf|\\Whuit|\\Wsept)?)`; + FrenchNumeric.TensNumberIntegerRegex = `(quatre\\Wvingt(s|\\Wdix)?|soixante\\Wdix|vingt|trente|quarante|cinquante|soixante|septante|octante|huitante|nonante)`; + FrenchNumeric.DigitsNumberRegex = `\\d|\\d{1,3}(\\.\\d{3})`; + FrenchNumeric.NegativeNumberTermsRegex = `^[.]`; + FrenchNumeric.NegativeNumberSignRegex = `^(${FrenchNumeric.NegativeNumberTermsRegex}\\s+).*`; + FrenchNumeric.HundredsNumberIntegerRegex = `((${FrenchNumeric.ZeroToNineIntegerRegex}(\\s+cent))|cent|((\\s+cent\\s)+${FrenchNumeric.TensNumberIntegerRegex}))`; + FrenchNumeric.BelowHundredsRegex = `((${FrenchNumeric.TenToNineteenIntegerRegex}|(${FrenchNumeric.TensNumberIntegerRegex}([-\\s]+(${FrenchNumeric.TenToNineteenIntegerRegex}|${FrenchNumeric.ZeroToNineIntegerRegex}))?))|${FrenchNumeric.ZeroToNineIntegerRegex})`; + FrenchNumeric.BelowThousandsRegex = `((${FrenchNumeric.HundredsNumberIntegerRegex}(\\s+${FrenchNumeric.BelowHundredsRegex})?|${FrenchNumeric.BelowHundredsRegex}|${FrenchNumeric.TenToNineteenIntegerRegex})|cent\\s+${FrenchNumeric.TenToNineteenIntegerRegex})`; + FrenchNumeric.SupportThousandsRegex = `((${FrenchNumeric.BelowThousandsRegex}|${FrenchNumeric.BelowHundredsRegex})\\s+${FrenchNumeric.RoundNumberIntegerRegex}(\\s+${FrenchNumeric.RoundNumberIntegerRegex})?)`; + FrenchNumeric.SeparaIntRegex = `(${FrenchNumeric.SupportThousandsRegex}(\\s+${FrenchNumeric.SupportThousandsRegex})*(\\s+${FrenchNumeric.BelowThousandsRegex})?|${FrenchNumeric.BelowThousandsRegex})`; + FrenchNumeric.AllIntRegex = `(${FrenchNumeric.SeparaIntRegex}|mille(\\s+${FrenchNumeric.BelowThousandsRegex})?)`; + FrenchNumeric.NumbersWithPlaceHolder = (placeholder) => { return `(((?(${FrenchNumeric.AllIntRegex})|((?(${FrenchNumeric.AllIntRegex})|((\\d+)(?!\\.)))(?=\\b)`; + FrenchNumeric.AllPointRegex = `((\\s+${FrenchNumeric.ZeroToNineIntegerRegex})+|(\\s+${FrenchNumeric.SeparaIntRegex}))`; + FrenchNumeric.AllFloatRegex = `(${FrenchNumeric.AllIntRegex}(\\s+(virgule|point))${FrenchNumeric.AllPointRegex})`; + FrenchNumeric.DoubleDecimalPointRegex = (placeholder) => { return `(((? { return `(?<=\\s|^)(? value) { + lastGoodChar = i; + value = this.cardinalNumberMap.get(strBuilder); + } + if ((i + 1) === numberStr.length) { + finalValue += value; + strBuilder = ""; + i = lastGoodChar++; + value = 0; + } + } + return finalValue; + } +} +exports.FrenchNumberParserConfiguration = FrenchNumberParserConfiguration; + +}); + +unwrapExports(parserConfiguration$6); + +var chineseNumeric = createCommonjsModule(function (module, exports) { +"use strict"; +// ------------------------------------------------------------------------------ +// +// This code was generated by a tool. +// Changes to this file may cause incorrect behavior and will be lost if +// the code is regenerated. +// +// ------------------------------------------------------------------------------ +Object.defineProperty(exports, "__esModule", { value: true }); +var ChineseNumeric; +(function (ChineseNumeric) { + ChineseNumeric.LangMarker = ''; + ChineseNumeric.DecimalSeparatorChar = '.'; + ChineseNumeric.FractionMarkerToken = ''; + ChineseNumeric.NonDecimalSeparatorChar = ' '; + ChineseNumeric.HalfADozenText = ''; + ChineseNumeric.WordSeparatorToken = ''; + ChineseNumeric.RoundNumberMap = new Map([["k", 1000], ["m", 1000000], ["g", 1000000000], ["t", 1000000000000]]); + ChineseNumeric.RoundNumberMapChar = new Map([["十", 10], ["百", 100], ["千", 1000], ["万", 10000], ["亿", 100000000], ["兆", 1000000000000], ["拾", 10], ["佰", 100], ["仟", 1000], ["萬", 10000], ["億", 100000000]]); + ChineseNumeric.ZeroToNineMap = new Map([["0", 0], ["1", 1], ["2", 2], ["3", 3], ["4", 4], ["5", 5], ["6", 6], ["7", 7], ["8", 8], ["9", 9], ["零", 0], ["一", 1], ["二", 2], ["三", 3], ["四", 4], ["五", 5], ["六", 6], ["七", 7], ["八", 8], ["九", 9], ["〇", 0], ["壹", 1], ["贰", 2], ["貳", 2], ["叁", 3], ["肆", 4], ["伍", 5], ["陆", 6], ["陸", 6], ["柒", 7], ["捌", 8], ["玖", 9], ["0", 0], ["1", 1], ["2", 2], ["3", 3], ["4", 4], ["5", 5], ["6", 6], ["7", 7], ["8", 8], ["9", 9], ["半", 0.5], ["两", 2], ["兩", 2], ["俩", 2], ["倆", 2], ["仨", 3]]); + ChineseNumeric.FullToHalfMap = new Map([["0", "0"], ["1", "1"], ["2", "2"], ["3", "3"], ["4", "4"], ["5", "5"], ["6", "6"], ["7", "7"], ["8", "8"], ["9", "9"], ["/", "/"], ["-", "-"], [",", "\'"], ["G", "G"], ["M", "M"], ["T", "T"], ["K", "K"], ["k", "k"], [".", "."]]); + ChineseNumeric.TratoSimMap = new Map([["佰", "百"], ["點", "点"], ["個", "个"], ["幾", "几"], ["對", "对"], ["雙", "双"]]); + ChineseNumeric.UnitMap = new Map([["萬萬", "億"], ["億萬", "兆"], ["萬億", "兆"], ["万万", "亿"], ["万亿", "兆"], ["亿万", "兆"], [" ", ""], ["多", ""], ["余", ""], ["几", ""]]); + ChineseNumeric.RoundDirectList = ['万', '萬', '亿', '兆', '億']; + ChineseNumeric.DigitalNumberRegex = `((?<=(\\d|\\b))(k|t|m|g)(?=\\b))`; + ChineseNumeric.ZeroToNineFullHalfRegex = `[\\d1234567890]`; + ChineseNumeric.DigitNumRegex = `${ChineseNumeric.ZeroToNineFullHalfRegex}+`; + ChineseNumeric.DozenRegex = `.*打$`; + ChineseNumeric.PercentageRegex = `(?<=百\\s*分\\s*之).+|.+(?=个\\s*百\\s*分\\s*点)|.*(?=[%%])`; + ChineseNumeric.DoubleAndRoundRegex = `${ChineseNumeric.ZeroToNineFullHalfRegex}+(\\.${ChineseNumeric.ZeroToNineFullHalfRegex}+)?\\s*[多几余]?[万亿萬億]{1,2}`; + ChineseNumeric.FracSplitRegex = `又|分\\s*之`; + ChineseNumeric.ZeroToNineIntegerRegex = `[一二三四五六七八九零壹贰貳叁肆伍陆陸柒捌玖〇两兩俩倆仨]`; + ChineseNumeric.NegativeNumberTermsRegex = `[负負]`; + ChineseNumeric.NegativeNumberTermsRegexNum = `((?)`; + ChineseNumeric.LessRegex = `(小于|少于|低于|小於|少於|低於|不到|不足|<)`; + ChineseNumeric.EqualRegex = `(等于|等於|=)`; + ChineseNumeric.MoreOrEqual = `((${ChineseNumeric.MoreRegex}\\s*(或|或者)?\\s*${ChineseNumeric.EqualRegex})|至少|最少|不${ChineseNumeric.LessRegex})`; + ChineseNumeric.MoreOrEqualSuffix = `(或|或者)\\s*(以上|之上|更[大多高])`; + ChineseNumeric.LessOrEqual = `((${ChineseNumeric.LessRegex}\\s*(或|或者)?\\s*${ChineseNumeric.EqualRegex})|至多|最多|不${ChineseNumeric.MoreRegex})`; + ChineseNumeric.LessOrEqualSuffix = `(或|或者)\\s*(以下|之下|更[小少低])`; + ChineseNumeric.OneNumberRangeMoreRegex1 = `(${ChineseNumeric.MoreOrEqual}|${ChineseNumeric.MoreRegex})\\s*(?((?!([并且而並的同時时]|(,(?!\\d+))|(,(?!\\d+))|。)).)+)`; + ChineseNumeric.OneNumberRangeMoreRegex2 = `比\\s*(?((?!((,(?!\\d+))|(,(?!\\d+))|。)).)+)\\s*更?[大多高]`; + ChineseNumeric.OneNumberRangeMoreRegex3 = `(?((?!((,(?!\\d+))|(,(?!\\d+))|。|[或者])).)+)\\s*(或|或者)?\\s*([多几余幾餘]|以上|之上|更[大多高])(?![万亿萬億]{1,2})`; + ChineseNumeric.OneNumberRangeLessRegex1 = `(${ChineseNumeric.LessOrEqual}|${ChineseNumeric.LessRegex})\\s*(?((?!([并且而並的同時时]|(,(?!\\d+))|(,(?!\\d+))|。)).)+)`; + ChineseNumeric.OneNumberRangeLessRegex2 = `比\\s*(?((?!((,(?!\\d+))|(,(?!\\d+))|。)).)+)\\s*更?[小少低]`; + ChineseNumeric.OneNumberRangeLessRegex3 = `(?((?!((,(?!\\d+))|(,(?!\\d+))|。|[或者])).)+)\\s*(或|或者)?\\s*(以下|之下|更[小少低])`; + ChineseNumeric.OneNumberRangeMoreSeparateRegex = `^[.]`; + ChineseNumeric.OneNumberRangeLessSeparateRegex = `^[.]`; + ChineseNumeric.OneNumberRangeEqualRegex = `${ChineseNumeric.EqualRegex}\\s*(?((?!((,(?!\\d+))|(,(?!\\d+))|。)).)+)`; + ChineseNumeric.TwoNumberRangeRegex1 = `((位于|在|位於)|(?=(\\d|\\+|\\-)))\\s*(?((?!((,(?!\\d+))|(,(?!\\d+))|。)).)+)\\s*(和|与|與|${ChineseNumeric.TillRegex})\\s*(?((?!((,(?!\\d+))|(,(?!\\d+))|。))[^之])+)\\s*(之)?(间|間)`; + ChineseNumeric.TwoNumberRangeRegex2 = `(${ChineseNumeric.OneNumberRangeMoreRegex1}|${ChineseNumeric.OneNumberRangeMoreRegex2}|${ChineseNumeric.OneNumberRangeMoreRegex3})\\s*(且|并且|而且|並且|((的)?同時)|((的)?同时)|,)?\\s*(${ChineseNumeric.OneNumberRangeLessRegex1}|${ChineseNumeric.OneNumberRangeLessRegex2}|${ChineseNumeric.OneNumberRangeLessRegex3})`; + ChineseNumeric.TwoNumberRangeRegex3 = `(${ChineseNumeric.OneNumberRangeLessRegex1}|${ChineseNumeric.OneNumberRangeLessRegex2}|${ChineseNumeric.OneNumberRangeLessRegex3})\\s*(且|并且|而且|並且|((的)?同時)|((的)?同时)|,)?\\s*(${ChineseNumeric.OneNumberRangeMoreRegex1}|${ChineseNumeric.OneNumberRangeMoreRegex2}|${ChineseNumeric.OneNumberRangeMoreRegex3})`; + ChineseNumeric.TwoNumberRangeRegex4 = `(?((?!((,(?!\\d+))|(,(?!\\d+))|。)).)+)\\s*${ChineseNumeric.TillRegex}\\s*(?((?!((,(?!\\d+))|(,(?!\\d+))|。)).)+)`; + ChineseNumeric.AmbiguousFractionConnectorsRegex = `^[.]`; +})(ChineseNumeric = exports.ChineseNumeric || (exports.ChineseNumeric = {})); + +}); + +unwrapExports(chineseNumeric); + +var parserConfiguration$8 = createCommonjsModule(function (module, exports) { +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); + + + +class ChineseNumberParserConfiguration { + constructor(ci) { + if (!ci) { + ci = new culture$2.CultureInfo(culture$2.Culture.Chinese); + } + this.cultureInfo = ci; + this.langMarker = chineseNumeric.ChineseNumeric.LangMarker; + this.decimalSeparatorChar = chineseNumeric.ChineseNumeric.DecimalSeparatorChar; + this.fractionMarkerToken = chineseNumeric.ChineseNumeric.FractionMarkerToken; + this.nonDecimalSeparatorChar = chineseNumeric.ChineseNumeric.NonDecimalSeparatorChar; + this.halfADozenText = chineseNumeric.ChineseNumeric.HalfADozenText; + this.wordSeparatorToken = chineseNumeric.ChineseNumeric.WordSeparatorToken; + this.writtenDecimalSeparatorTexts = []; + this.writtenGroupSeparatorTexts = []; + this.writtenIntegerSeparatorTexts = []; + this.writtenFractionSeparatorTexts = []; + this.cardinalNumberMap = new Map(); + this.ordinalNumberMap = new Map(); + this.roundNumberMap = chineseNumeric.ChineseNumeric.RoundNumberMap; + this.halfADozenRegex = null; + this.digitalNumberRegex = recognizersText.RegExpUtility.getSafeRegExp(chineseNumeric.ChineseNumeric.DigitalNumberRegex, "gis"); + this.zeroToNineMap = chineseNumeric.ChineseNumeric.ZeroToNineMap; + this.roundNumberMapChar = chineseNumeric.ChineseNumeric.RoundNumberMapChar; + this.fullToHalfMap = chineseNumeric.ChineseNumeric.FullToHalfMap; + this.tratoSimMap = chineseNumeric.ChineseNumeric.TratoSimMap; + this.unitMap = chineseNumeric.ChineseNumeric.UnitMap; + this.roundDirectList = chineseNumeric.ChineseNumeric.RoundDirectList; + this.digitNumRegex = recognizersText.RegExpUtility.getSafeRegExp(chineseNumeric.ChineseNumeric.DigitNumRegex, "gis"); + this.dozenRegex = recognizersText.RegExpUtility.getSafeRegExp(chineseNumeric.ChineseNumeric.DozenRegex, "gis"); + this.percentageRegex = recognizersText.RegExpUtility.getSafeRegExp(chineseNumeric.ChineseNumeric.PercentageRegex, "gis"); + this.doubleAndRoundRegex = recognizersText.RegExpUtility.getSafeRegExp(chineseNumeric.ChineseNumeric.DoubleAndRoundRegex, "gis"); + this.fracSplitRegex = recognizersText.RegExpUtility.getSafeRegExp(chineseNumeric.ChineseNumeric.FracSplitRegex, "gis"); + this.negativeNumberSignRegex = recognizersText.RegExpUtility.getSafeRegExp(chineseNumeric.ChineseNumeric.NegativeNumberSignRegex, "gis"); + this.pointRegex = recognizersText.RegExpUtility.getSafeRegExp(chineseNumeric.ChineseNumeric.PointRegex, "gis"); + this.speGetNumberRegex = recognizersText.RegExpUtility.getSafeRegExp(chineseNumeric.ChineseNumeric.SpeGetNumberRegex, "gis"); + this.pairRegex = recognizersText.RegExpUtility.getSafeRegExp(chineseNumeric.ChineseNumeric.PairRegex, "gis"); + this.roundNumberIntegerRegex = recognizersText.RegExpUtility.getSafeRegExp(chineseNumeric.ChineseNumeric.RoundNumberIntegerRegex, "gis"); + } + normalizeTokenSet(tokens, context) { + return tokens; + } + resolveCompositeNumber(numberStr) { + return 0; + } +} +exports.ChineseNumberParserConfiguration = ChineseNumberParserConfiguration; + +}); + +unwrapExports(parserConfiguration$8); + +var japaneseNumeric = createCommonjsModule(function (module, exports) { +"use strict"; +// ------------------------------------------------------------------------------ +// +// This code was generated by a tool. +// Changes to this file may cause incorrect behavior and will be lost if +// the code is regenerated. +// +// ------------------------------------------------------------------------------ +Object.defineProperty(exports, "__esModule", { value: true }); +var JapaneseNumeric; +(function (JapaneseNumeric) { + JapaneseNumeric.LangMarker = ''; + JapaneseNumeric.DecimalSeparatorChar = '.'; + JapaneseNumeric.FractionMarkerToken = ''; + JapaneseNumeric.NonDecimalSeparatorChar = ' '; + JapaneseNumeric.HalfADozenText = ''; + JapaneseNumeric.WordSeparatorToken = ''; + JapaneseNumeric.RoundNumberMap = new Map([["k", 1000], ["m", 1000000], ["g", 1000000000], ["t", 1000000000000]]); + JapaneseNumeric.RoundNumberMapChar = new Map([["十", 10], ["百", 100], ["千", 1000], ["万", 10000], ["億", 100000000], ["兆", 1000000000000]]); + JapaneseNumeric.ZeroToNineMap = new Map([["0", 0], ["1", 1], ["2", 2], ["3", 3], ["4", 4], ["5", 5], ["6", 6], ["7", 7], ["8", 8], ["9", 9], ["零", 0], ["一", 1], ["二", 2], ["三", 3], ["四", 4], ["五", 5], ["六", 6], ["七", 7], ["八", 8], ["九", 9], ["半", 0.5]]); + JapaneseNumeric.FullToHalfMap = new Map([["0", "0"], ["1", "1"], ["2", "2"], ["3", "3"], ["4", "4"], ["5", "5"], ["6", "6"], ["7", "7"], ["8", "8"], ["9", "9"], ["/", "/"], ["-", "-"], [",", "\'"], ["、", "\'"], ["G", "G"], ["M", "M"], ["T", "T"], ["K", "K"], ["k", "k"], [".", "."]]); + JapaneseNumeric.UnitMap = new Map([["万万", "億"], ["億万", "兆"], ["万億", "兆"], [" ", ""]]); + JapaneseNumeric.RoundDirectList = ['万', '億', '兆']; + JapaneseNumeric.DigitalNumberRegex = `((?<=(\\d|\\b))(k|t|m|g)(?=\\b))`; + JapaneseNumeric.ZeroToNineFullHalfRegex = `[\\d1234567890]`; + JapaneseNumeric.DigitNumRegex = `${JapaneseNumeric.ZeroToNineFullHalfRegex}+`; + JapaneseNumeric.DozenRegex = `.*ダース$`; + JapaneseNumeric.PercentageRegex = `.+(?=パ\\s*ー\\s*セ\\s*ン\\s*ト)|.*(?=[%%])`; + JapaneseNumeric.DoubleAndRoundRegex = `${JapaneseNumeric.ZeroToNineFullHalfRegex}+(\\.${JapaneseNumeric.ZeroToNineFullHalfRegex}+)?\\s*[万億]{1,2}(\\s*(以上))?`; + JapaneseNumeric.FracSplitRegex = `[はと]|分\\s*の`; + JapaneseNumeric.ZeroToNineIntegerRegex = `[一二三四五六七八九]`; + JapaneseNumeric.NegativeNumberTermsRegex = `(マ\\s*イ\\s*ナ\\s*ス)`; + JapaneseNumeric.NegativeNumberTermsRegexNum = `(?)`; + JapaneseNumeric.LessRegex = `(小なり|小さい|低い|<)`; + JapaneseNumeric.EqualRegex = `(等しい|イコール|=)`; + JapaneseNumeric.MoreOrEqual = `((大なりかイコール)|(大きいかイコール)|(大なりか等しい)|(大きいか等しい)|小さくない|以上|最低)`; + JapaneseNumeric.MoreOrEqualSuffix = `(より(大なりイコール|小さくない))`; + JapaneseNumeric.LessOrEqual = `((${JapaneseNumeric.LessRegex}\\s*(或|或者)?\\s*${JapaneseNumeric.EqualRegex})|(小なりかイコール)|(小なりか等しい)|(小さいかイコール)|(小さいか等しい)|(小さいか等しい)|大さくない|以下|最大)`; + JapaneseNumeric.LessOrEqualSuffix = `(小なりイコール|大さくない)`; + JapaneseNumeric.OneNumberRangeMoreRegex1 = `(?((?!(((,|、)(?!\\d+))|((,|、)(?!\\d+))|。)).)+)\\s*((より)\\s*((${JapaneseNumeric.MoreOrEqual}|${JapaneseNumeric.MoreRegex}))|超える|を超える)`; + JapaneseNumeric.OneNumberRangeMoreRegex2 = `(?((?!((,|、(?!\\d+))|(,|、(?!\\d+))|。)).)+)\\s*(より)?(大なり)`; + JapaneseNumeric.OneNumberRangeMoreRegex3 = `(?((?!((,(?!\\d+))|(,(?!\\d+))|。)).)+)\\s*(以上|最低)(?![万億]{1,2})`; + JapaneseNumeric.OneNumberRangeMoreRegex4 = `(${JapaneseNumeric.MoreOrEqual}|${JapaneseNumeric.MoreRegex})\\s*(?((?!(と|は|((と)?同時に)|((と)?そして)|が|,|、|,|(,(?!\\d+))|(,(?!\\d+))|。)).)+)`; + JapaneseNumeric.OneNumberRangeMoreSeparateRegex = `^[.]`; + JapaneseNumeric.OneNumberRangeLessSeparateRegex = `^[.]`; + JapaneseNumeric.OneNumberRangeLessRegex1 = `(?((?!(((,|、)(?!\\d+))|((,|、)(?!\\d+))|。)).)+)\\s*(より)\\s*(${JapaneseNumeric.LessOrEqual}|${JapaneseNumeric.LessRegex})`; + JapaneseNumeric.OneNumberRangeLessRegex2 = `(?((?!((,(?!\\d+))|(,(?!\\d+))|。)).)+)\\s*(より)?(小な)`; + JapaneseNumeric.OneNumberRangeLessRegex3 = `(?((?!((,(?!\\d+))|(,(?!\\d+))|。)).)+)\\s*(以下|未満)(?![万億]{1,2})`; + JapaneseNumeric.OneNumberRangeLessRegex4 = `(${JapaneseNumeric.LessOrEqual}|${JapaneseNumeric.LessRegex})\\s*(?((?!(と|は|((と)?同時に)|((と)?そして)|が|,|、|,|(,(?!\\d+))|(,(?!\\d+))|。)).)+)`; + JapaneseNumeric.OneNumberRangeEqualRegex = `(((?((?!((,(?!\\d+))|(,(?!\\d+))|。)).)+)\\s*(に)\\s*${JapaneseNumeric.EqualRegex})|(${JapaneseNumeric.EqualRegex}\\s*(?((?!((,(?!\\d+))|(,(?!\\d+))|。)).)+)))`; + JapaneseNumeric.TwoNumberRangeRegex1 = `(?((?!((,(?!\\d+))|(,(?!\\d+))|。)).)+)\\s*(と|${JapaneseNumeric.TillRegex})\\s*(?((?!((,(?!\\d+))|(,(?!\\d+))|。)).)+)\\s*(の間)`; + JapaneseNumeric.TwoNumberRangeRegex2 = `(${JapaneseNumeric.OneNumberRangeMoreRegex1}|${JapaneseNumeric.OneNumberRangeMoreRegex2}|${JapaneseNumeric.OneNumberRangeMoreRegex3}|${JapaneseNumeric.OneNumberRangeMoreRegex4})\\s*(と|は|((と)?同時に)|((と)?そして)|が|,|、|,)?\\s*(${JapaneseNumeric.OneNumberRangeLessRegex1}|${JapaneseNumeric.OneNumberRangeLessRegex2}|${JapaneseNumeric.OneNumberRangeLessRegex3}|${JapaneseNumeric.OneNumberRangeLessRegex4})`; + JapaneseNumeric.TwoNumberRangeRegex3 = `(${JapaneseNumeric.OneNumberRangeLessRegex1}|${JapaneseNumeric.OneNumberRangeLessRegex2}|${JapaneseNumeric.OneNumberRangeLessRegex3}|${JapaneseNumeric.OneNumberRangeLessRegex4})\\s*(と|は|((と)?同時に)|((と)?そして)|が|,|、|,)?\\s*(${JapaneseNumeric.OneNumberRangeMoreRegex1}|${JapaneseNumeric.OneNumberRangeMoreRegex2}|${JapaneseNumeric.OneNumberRangeMoreRegex3}|${JapaneseNumeric.OneNumberRangeMoreRegex4})`; + JapaneseNumeric.TwoNumberRangeRegex4 = `(?((?!((,(?!\\d+))|(,(?!\\d+))|。)).)+)\\s*${JapaneseNumeric.TillRegex}\\s*(?((?!((,(?!\\d+))|(,(?!\\d+))|。)).)+)`; + JapaneseNumeric.AmbiguousFractionConnectorsRegex = `^[.]`; +})(JapaneseNumeric = exports.JapaneseNumeric || (exports.JapaneseNumeric = {})); + +}); + +unwrapExports(japaneseNumeric); + +var parserConfiguration$10 = createCommonjsModule(function (module, exports) { +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); + + + +class JapaneseNumberParserConfiguration { + // readonly NumberOptions Options { get; } + // readonly Regex FractionPrepositionRegex { get; } + // readonly string NonDecimalSeparatorText + constructor(ci) { + if (!ci) { + ci = new culture$2.CultureInfo(culture$2.Culture.Japanese); + } + this.cultureInfo = ci; + this.langMarker = japaneseNumeric.JapaneseNumeric.LangMarker; + this.decimalSeparatorChar = japaneseNumeric.JapaneseNumeric.DecimalSeparatorChar; + this.fractionMarkerToken = japaneseNumeric.JapaneseNumeric.FractionMarkerToken; + this.nonDecimalSeparatorChar = japaneseNumeric.JapaneseNumeric.NonDecimalSeparatorChar; + this.halfADozenText = japaneseNumeric.JapaneseNumeric.HalfADozenText; + this.wordSeparatorToken = japaneseNumeric.JapaneseNumeric.WordSeparatorToken; + this.writtenDecimalSeparatorTexts = []; + this.writtenGroupSeparatorTexts = []; + this.writtenIntegerSeparatorTexts = []; + this.writtenFractionSeparatorTexts = []; + this.cardinalNumberMap = new Map(); + this.ordinalNumberMap = new Map(); + this.roundNumberMap = japaneseNumeric.JapaneseNumeric.RoundNumberMap; + this.halfADozenRegex = null; + this.digitalNumberRegex = recognizersText.RegExpUtility.getSafeRegExp(japaneseNumeric.JapaneseNumeric.DigitalNumberRegex, "gis"); + this.zeroToNineMap = japaneseNumeric.JapaneseNumeric.ZeroToNineMap; + this.roundNumberMapChar = japaneseNumeric.JapaneseNumeric.RoundNumberMapChar; + this.fullToHalfMap = japaneseNumeric.JapaneseNumeric.FullToHalfMap; + this.tratoSimMap = null; + this.unitMap = japaneseNumeric.JapaneseNumeric.UnitMap; + this.roundDirectList = japaneseNumeric.JapaneseNumeric.RoundDirectList; + this.digitNumRegex = recognizersText.RegExpUtility.getSafeRegExp(japaneseNumeric.JapaneseNumeric.DigitNumRegex, "gis"); + this.dozenRegex = recognizersText.RegExpUtility.getSafeRegExp(japaneseNumeric.JapaneseNumeric.DozenRegex, "gis"); + this.percentageRegex = recognizersText.RegExpUtility.getSafeRegExp(japaneseNumeric.JapaneseNumeric.PercentageRegex, "gis"); + this.doubleAndRoundRegex = recognizersText.RegExpUtility.getSafeRegExp(japaneseNumeric.JapaneseNumeric.DoubleAndRoundRegex, "gis"); + this.fracSplitRegex = recognizersText.RegExpUtility.getSafeRegExp(japaneseNumeric.JapaneseNumeric.FracSplitRegex, "gis"); + this.negativeNumberSignRegex = recognizersText.RegExpUtility.getSafeRegExp(japaneseNumeric.JapaneseNumeric.NegativeNumberSignRegex, "is"); + this.pointRegex = recognizersText.RegExpUtility.getSafeRegExp(japaneseNumeric.JapaneseNumeric.PointRegex, "gis"); + this.speGetNumberRegex = recognizersText.RegExpUtility.getSafeRegExp(japaneseNumeric.JapaneseNumeric.SpeGetNumberRegex, "gis"); + this.pairRegex = recognizersText.RegExpUtility.getSafeRegExp(japaneseNumeric.JapaneseNumeric.PairRegex, "gis"); + this.roundNumberIntegerRegex = recognizersText.RegExpUtility.getSafeRegExp(japaneseNumeric.JapaneseNumeric.RoundNumberIntegerRegex, "gis"); + } + normalizeTokenSet(tokens, context) { + return tokens; + } + resolveCompositeNumber(numberStr) { + return 0; + } +} +exports.JapaneseNumberParserConfiguration = JapaneseNumberParserConfiguration; + +}); + +unwrapExports(parserConfiguration$10); + +/** + * lodash (Custom Build) + * Build: `lodash modularize exports="npm" -o ./` + * Copyright jQuery Foundation and other contributors + * Released under MIT license + * Based on Underscore.js 1.8.3 + * Copyright Jeremy Ashkenas, DocumentCloud and Investigative Reporters & Editors + */ + +/** Used as references for various `Number` constants. */ +var INFINITY$1 = 1 / 0; + +/** `Object#toString` result references. */ +var symbolTag$1 = '[object Symbol]'; + +/** + * Used to match `RegExp` + * [syntax characters](http://ecma-international.org/ecma-262/6.0/#sec-patterns). + */ +var reRegExpChar = /[\\^$.*+?()[\]{}|]/g; +var reHasRegExpChar = RegExp(reRegExpChar.source); + +/** Detect free variable `global` from Node.js. */ +var freeGlobal$1 = typeof commonjsGlobal == 'object' && commonjsGlobal && commonjsGlobal.Object === Object && commonjsGlobal; + +/** Detect free variable `self`. */ +var freeSelf$1 = typeof self == 'object' && self && self.Object === Object && self; + +/** Used as a reference to the global object. */ +var root$1 = freeGlobal$1 || freeSelf$1 || Function('return this')(); + +/** Used for built-in method references. */ +var objectProto$1 = Object.prototype; + +/** + * Used to resolve the + * [`toStringTag`](http://ecma-international.org/ecma-262/6.0/#sec-object.prototype.tostring) + * of values. + */ +var objectToString$1 = objectProto$1.toString; + +/** Built-in value references. */ +var Symbol$2 = root$1.Symbol; + +/** Used to convert symbols to primitives and strings. */ +var symbolProto$1 = Symbol$2 ? Symbol$2.prototype : undefined; +var symbolToString$1 = symbolProto$1 ? symbolProto$1.toString : undefined; + +/** + * The base implementation of `_.toString` which doesn't convert nullish + * values to empty strings. + * + * @private + * @param {*} value The value to process. + * @returns {string} Returns the string. + */ +function baseToString$1(value) { + // Exit early for strings to avoid a performance hit in some environments. + if (typeof value == 'string') { + return value; + } + if (isSymbol$1(value)) { + return symbolToString$1 ? symbolToString$1.call(value) : ''; + } + var result = (value + ''); + return (result == '0' && (1 / value) == -INFINITY$1) ? '-0' : result; +} + +/** + * Checks if `value` is object-like. A value is object-like if it's not `null` + * and has a `typeof` result of "object". + * + * @static + * @memberOf _ + * @since 4.0.0 + * @category Lang + * @param {*} value The value to check. + * @returns {boolean} Returns `true` if `value` is object-like, else `false`. + * @example + * + * _.isObjectLike({}); + * // => true + * + * _.isObjectLike([1, 2, 3]); + * // => true + * + * _.isObjectLike(_.noop); + * // => false + * + * _.isObjectLike(null); + * // => false + */ +function isObjectLike$1(value) { + return !!value && typeof value == 'object'; +} + +/** + * Checks if `value` is classified as a `Symbol` primitive or object. + * + * @static + * @memberOf _ + * @since 4.0.0 + * @category Lang + * @param {*} value The value to check. + * @returns {boolean} Returns `true` if `value` is a symbol, else `false`. + * @example + * + * _.isSymbol(Symbol.iterator); + * // => true + * + * _.isSymbol('abc'); + * // => false + */ +function isSymbol$1(value) { + return typeof value == 'symbol' || + (isObjectLike$1(value) && objectToString$1.call(value) == symbolTag$1); +} + +/** + * Converts `value` to a string. An empty string is returned for `null` + * and `undefined` values. The sign of `-0` is preserved. + * + * @static + * @memberOf _ + * @since 4.0.0 + * @category Lang + * @param {*} value The value to process. + * @returns {string} Returns the string. + * @example + * + * _.toString(null); + * // => '' + * + * _.toString(-0); + * // => '-0' + * + * _.toString([1, 2, 3]); + * // => '1,2,3' + */ +function toString$1(value) { + return value == null ? '' : baseToString$1(value); +} + +/** + * Escapes the `RegExp` special characters "^", "$", "\", ".", "*", "+", + * "?", "(", ")", "[", "]", "{", "}", and "|" in `string`. + * + * @static + * @memberOf _ + * @since 3.0.0 + * @category String + * @param {string} [string=''] The string to escape. + * @returns {string} Returns the escaped string. + * @example + * + * _.escapeRegExp('[lodash](https://lodash.com/)'); + * // => '\[lodash\]\(https://lodash\.com/\)' + */ +function escapeRegExp(string) { + string = toString$1(string); + return (string && reHasRegExpChar.test(string)) + ? string.replace(reRegExpChar, '\\$&') + : string; +} + +var lodash_escaperegexp = escapeRegExp; + +var extractors$4 = createCommonjsModule(function (module, exports) { +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); + + + + +class BaseNumberExtractor { + constructor() { + this.extractType = ""; + this.negativeNumberTermsRegex = null; + } + extract(source) { + if (!source || source.trim().length === 0) { + return []; + } + let result = new Array(); + let matchSource = new Map(); + let matched = new Array(source.length); + for (let i = 0; i < source.length; i++) { + matched[i] = false; + } + let collections = this.regexes + .map(o => ({ matches: recognizersText.RegExpUtility.getMatches(o.regExp, source), value: o.value })) + .filter(o => o.matches && o.matches.length); + collections.forEach(collection => { + collection.matches.forEach(m => { + for (let j = 0; j < m.length; j++) { + matched[m.index + j] = true; + } + // Keep Source Data for extra information + matchSource.set(m, collection.value); + }); + }); + let last = -1; + for (let i = 0; i < source.length; i++) { + if (matched[i]) { + if (i + 1 === source.length || !matched[i + 1]) { + let start = last + 1; + let length = i - last; + let substr = source.substring(start, start + length); + let srcMatch = Array.from(matchSource.keys()).find(m => m.index === start && m.length === length); + // Extract negative numbers + if (this.negativeNumberTermsRegex !== null) { + let match = source.substr(0, start).match(this.negativeNumberTermsRegex); + if (match) { + start = match.index; + length = length + match[0].length; + substr = match[0] + substr; + } + } + if (srcMatch) { + result.push({ + start: start, + length: length, + text: substr, + type: this.extractType, + data: matchSource.has(srcMatch) ? matchSource.get(srcMatch) : null + }); + } + } + } + else { + last = i; + } + } + return result; + } + generateLongFormatNumberRegexes(type, placeholder = baseNumbers.BaseNumbers.PlaceHolderDefault) { + let thousandsMark = lodash_escaperegexp(type.thousandsMark); + let decimalsMark = lodash_escaperegexp(type.decimalsMark); + let regexDefinition = type.decimalsMark === '\0' + ? baseNumbers.BaseNumbers.IntegerRegexDefinition(placeholder, thousandsMark) + : baseNumbers.BaseNumbers.DoubleRegexDefinition(placeholder, thousandsMark, decimalsMark); + return recognizersText.RegExpUtility.getSafeRegExp(regexDefinition, "gis"); + } +} +exports.BaseNumberExtractor = BaseNumberExtractor; +class BasePercentageExtractor { + constructor(numberExtractor) { + this.extractType = constants.Constants.SYS_NUM_PERCENTAGE; + this.numberExtractor = numberExtractor; + this.regexes = this.initRegexes(); + } + extract(source) { + let originSource = source; + let positionMap; + let numExtResults; + // preprocess the source sentence via extracting and replacing the numbers in it + let preprocess = this.preprocessStrWithNumberExtracted(originSource); + source = preprocess.source; + positionMap = preprocess.positionMap; + numExtResults = preprocess.numExtResults; + let allMatches = this.regexes.map(rx => recognizersText.RegExpUtility.getMatches(rx, source)); + let matched = new Array(source.length); + for (let i = 0; i < source.length; i++) { + matched[i] = false; + } + for (let i = 0; i < allMatches.length; i++) { + allMatches[i].forEach(match => { + for (let j = 0; j < match.length; j++) { + matched[j + match.index] = true; + } + }); + } + let result = new Array(); + let last = -1; + // get index of each matched results + for (let i = 0; i < source.length; i++) { + if (matched[i]) { + if (i + 1 === source.length || matched[i + 1] === false) { + let start = last + 1; + let length = i - last; + let substr = source.substring(start, start + length); + let er = { + start: start, + length: length, + text: substr, + type: this.extractType + }; + result.push(er); + } + } + else { + last = i; + } + } + // post-processing, restoring the extracted numbers + this.postProcessing(result, originSource, positionMap, numExtResults); + return result; + } + // get the number extractor results and convert the extracted numbers to @sys.num, so that the regexes can work + preprocessStrWithNumberExtracted(str) { + let positionMap = new Map(); + let numExtResults = this.numberExtractor.extract(str); + let replaceText = baseNumbers.BaseNumbers.NumberReplaceToken; + let match = new Array(str.length); + let strParts = new Array(); + let start; + let end; + for (let i = 0; i < str.length; i++) { + match[i] = -1; + } + for (let i = 0; i < numExtResults.length; i++) { + let extraction = numExtResults[i]; + start = extraction.start; + end = extraction.length + start; + for (let j = start; j < end; j++) { + if (match[j] === -1) { + match[j] = i; + } + } + } + start = 0; + for (let i = 1; i < str.length; i++) { + if (match[i] !== match[i - 1]) { + strParts.push([start, i - 1]); + start = i; + } + } + strParts.push([start, str.length - 1]); + let ret = ""; + let index = 0; + strParts.forEach(strPart => { + start = strPart[0]; + end = strPart[1]; + let type = match[start]; + if (type === -1) { + ret += str.substring(start, end + 1); + for (let i = start; i <= end; i++) { + positionMap.set(index++, i); + } + } + else { + let originalText = str.substring(start, end + 1); + ret += replaceText; + for (let i = 0; i < replaceText.length; i++) { + positionMap.set(index++, start); + } + } + }); + positionMap.set(index++, str.length); + return { + numExtResults: numExtResults, + source: ret, + positionMap: positionMap + }; + } + // replace the @sys.num to the real patterns, directly modifies the ExtractResult + postProcessing(results, originSource, positionMap, numExtResults) { + let replaceText = baseNumbers.BaseNumbers.NumberReplaceToken; + for (let i = 0; i < results.length; i++) { + let start = results[i].start; + let end = start + results[i].length; + let str = results[i].text; + if (positionMap.has(start) && positionMap.has(end)) { + let originStart = positionMap.get(start); + let originLenth = positionMap.get(end) - originStart; + results[i].start = originStart; + results[i].length = originLenth; + results[i].text = originSource.substring(originStart, originStart + originLenth).trim(); + let numStart = str.indexOf(replaceText); + if (numStart !== -1) { + let numOriginStart = start + numStart; + if (positionMap.has(numStart)) { + let dataKey = originSource.substring(positionMap.get(numOriginStart), positionMap.get(numOriginStart + replaceText.length)); + for (let j = i; j < numExtResults.length; j++) { + if (results[i].start === numExtResults[j].start && results[i].text.includes(numExtResults[j].text)) { + results[i].data = [dataKey, numExtResults[j]]; + break; + } + } + } + } + } + } + } + // read the rules + buildRegexes(regexStrs, ignoreCase = true) { + return regexStrs.map(regexStr => { + let options = "gs"; + if (ignoreCase) { + options += "i"; + } + return recognizersText.RegExpUtility.getSafeRegExp(regexStr, options); + }); + } +} +BasePercentageExtractor.numExtType = constants.Constants.SYS_NUM; +exports.BasePercentageExtractor = BasePercentageExtractor; + +}); + +unwrapExports(extractors$4); + +var extractors$2 = createCommonjsModule(function (module, exports) { +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); + + + + + +class EnglishNumberExtractor extends extractors$4.BaseNumberExtractor { + constructor(mode = models$2.NumberMode.Default) { + super(); + this.extractType = constants.Constants.SYS_NUM; + this.negativeNumberTermsRegex = recognizersText.RegExpUtility.getSafeRegExp(englishNumeric.EnglishNumeric.NegativeNumberTermsRegex + "$", "is"); + let regexes = new Array(); + // Add Cardinal + let cardExtract = null; + switch (mode) { + case models$2.NumberMode.PureNumber: + cardExtract = new EnglishCardinalExtractor(englishNumeric.EnglishNumeric.PlaceHolderPureNumber); + break; + case models$2.NumberMode.Currency: + regexes.push({ regExp: recognizersText.RegExpUtility.getSafeRegExp(englishNumeric.EnglishNumeric.CurrencyRegex, "gs"), value: "IntegerNum" }); + break; + case models$2.NumberMode.Default: + break; + } + if (cardExtract === null) { + cardExtract = new EnglishCardinalExtractor(); + } + cardExtract.regexes.forEach(r => regexes.push(r)); + // Add Fraction + let fracExtract = new EnglishFractionExtractor(); + fracExtract.regexes.forEach(r => regexes.push(r)); + this.regexes = regexes; + } +} +exports.EnglishNumberExtractor = EnglishNumberExtractor; +class EnglishCardinalExtractor extends extractors$4.BaseNumberExtractor { + constructor(placeholder = englishNumeric.EnglishNumeric.PlaceHolderDefault) { + super(); + this.extractType = constants.Constants.SYS_NUM_CARDINAL; + let regexes = new Array(); + // Add Integer Regexes + let intExtract = new EnglishIntegerExtractor(placeholder); + intExtract.regexes.forEach(r => regexes.push(r)); + // Add Double Regexes + let doubleExtract = new EnglishDoubleExtractor(placeholder); + doubleExtract.regexes.forEach(r => regexes.push(r)); + this.regexes = regexes; + } +} +exports.EnglishCardinalExtractor = EnglishCardinalExtractor; +class EnglishIntegerExtractor extends extractors$4.BaseNumberExtractor { + constructor(placeholder = englishNumeric.EnglishNumeric.PlaceHolderDefault) { + super(); + this.extractType = constants.Constants.SYS_NUM_INTEGER; + let regexes = new Array({ + regExp: recognizersText.RegExpUtility.getSafeRegExp(englishNumeric.EnglishNumeric.NumbersWithPlaceHolder(placeholder), "gi"), + value: "IntegerNum" + }, { + regExp: recognizersText.RegExpUtility.getSafeRegExp(englishNumeric.EnglishNumeric.NumbersWithSuffix, "gs"), + value: "IntegerNum" + }, { + regExp: this.generateLongFormatNumberRegexes(models$2.LongFormatType.integerNumComma, placeholder), + value: "IntegerNum" + }, { + regExp: this.generateLongFormatNumberRegexes(models$2.LongFormatType.integerNumBlank, placeholder), + value: "IntegerNum" + }, { + regExp: this.generateLongFormatNumberRegexes(models$2.LongFormatType.integerNumNoBreakSpace, placeholder), + value: "IntegerNum" + }, { + regExp: recognizersText.RegExpUtility.getSafeRegExp(englishNumeric.EnglishNumeric.RoundNumberIntegerRegexWithLocks, "gis"), + value: "IntegerNum" + }, { + regExp: recognizersText.RegExpUtility.getSafeRegExp(englishNumeric.EnglishNumeric.NumbersWithDozenSuffix, "gis"), + value: "IntegerNum" + }, { + regExp: recognizersText.RegExpUtility.getSafeRegExp(englishNumeric.EnglishNumeric.AllIntRegexWithLocks, "gis"), + value: "IntegerEng" + }, { + regExp: recognizersText.RegExpUtility.getSafeRegExp(englishNumeric.EnglishNumeric.AllIntRegexWithDozenSuffixLocks, "gis"), + value: "IntegerEng" + }); + this.regexes = regexes; + } +} +exports.EnglishIntegerExtractor = EnglishIntegerExtractor; +class EnglishDoubleExtractor extends extractors$4.BaseNumberExtractor { + constructor(placeholder = englishNumeric.EnglishNumeric.PlaceHolderDefault) { + super(); + this.extractType = constants.Constants.SYS_NUM_DOUBLE; + let regexes = new Array({ + regExp: recognizersText.RegExpUtility.getSafeRegExp(englishNumeric.EnglishNumeric.DoubleDecimalPointRegex(placeholder), "gis"), + value: "DoubleNum" + }, { + regExp: recognizersText.RegExpUtility.getSafeRegExp(englishNumeric.EnglishNumeric.DoubleWithoutIntegralRegex(placeholder), "gis"), + value: "DoubleNum" + }, { + regExp: this.generateLongFormatNumberRegexes(models$2.LongFormatType.doubleNumCommaDot, placeholder), + value: "DoubleNum" + }, { + regExp: this.generateLongFormatNumberRegexes(models$2.LongFormatType.doubleNumNoBreakSpaceDot, placeholder), + value: "DoubleNum" + }, { + regExp: recognizersText.RegExpUtility.getSafeRegExp(englishNumeric.EnglishNumeric.DoubleWithMultiplierRegex, "gs"), + value: "DoubleNum" + }, { + regExp: recognizersText.RegExpUtility.getSafeRegExp(englishNumeric.EnglishNumeric.DoubleWithRoundNumber, "gis"), + value: "DoubleNum" + }, { + regExp: recognizersText.RegExpUtility.getSafeRegExp(englishNumeric.EnglishNumeric.DoubleAllFloatRegex, "gis"), + value: "DoubleEng" + }, { + regExp: recognizersText.RegExpUtility.getSafeRegExp(englishNumeric.EnglishNumeric.DoubleExponentialNotationRegex, "gis"), + value: "DoublePow" + }, { + regExp: recognizersText.RegExpUtility.getSafeRegExp(englishNumeric.EnglishNumeric.DoubleCaretExponentialNotationRegex, "gis"), + value: "DoublePow" + }); + this.regexes = regexes; + } +} +exports.EnglishDoubleExtractor = EnglishDoubleExtractor; +class EnglishFractionExtractor extends extractors$4.BaseNumberExtractor { + constructor() { + super(); + this.extractType = constants.Constants.SYS_NUM_FRACTION; + let regexes = new Array({ + regExp: recognizersText.RegExpUtility.getSafeRegExp(englishNumeric.EnglishNumeric.FractionNotationWithSpacesRegex, "gis"), + value: "FracNum" + }, { + regExp: recognizersText.RegExpUtility.getSafeRegExp(englishNumeric.EnglishNumeric.FractionNotationRegex, "gis"), + value: "FracNum" + }, { + regExp: recognizersText.RegExpUtility.getSafeRegExp(englishNumeric.EnglishNumeric.FractionNounRegex, "gis"), + value: "FracEng" + }, { + regExp: recognizersText.RegExpUtility.getSafeRegExp(englishNumeric.EnglishNumeric.FractionNounWithArticleRegex, "gis"), + value: "FracEng" + }, { + regExp: recognizersText.RegExpUtility.getSafeRegExp(englishNumeric.EnglishNumeric.FractionPrepositionRegex, "gis"), + value: "FracEng" + }); + this.regexes = regexes; + } +} +exports.EnglishFractionExtractor = EnglishFractionExtractor; +class EnglishOrdinalExtractor extends extractors$4.BaseNumberExtractor { + constructor() { + super(); + this.extractType = constants.Constants.SYS_NUM_ORDINAL; + let regexes = new Array({ + regExp: recognizersText.RegExpUtility.getSafeRegExp(englishNumeric.EnglishNumeric.OrdinalSuffixRegex, "gis"), + value: "OrdinalNum" + }, { + regExp: recognizersText.RegExpUtility.getSafeRegExp(englishNumeric.EnglishNumeric.OrdinalNumericRegex, "gis"), + value: "OrdinalNum" + }, { + regExp: recognizersText.RegExpUtility.getSafeRegExp(englishNumeric.EnglishNumeric.OrdinalEnglishRegex, "gis"), + value: "OrdEng" + }, { + regExp: recognizersText.RegExpUtility.getSafeRegExp(englishNumeric.EnglishNumeric.OrdinalRoundNumberRegex, "gis"), + value: "OrdEng" + }); + this.regexes = regexes; + } +} +exports.EnglishOrdinalExtractor = EnglishOrdinalExtractor; +class EnglishPercentageExtractor extends extractors$4.BasePercentageExtractor { + constructor() { + super(new EnglishNumberExtractor()); + } + initRegexes() { + let regexStrs = [ + englishNumeric.EnglishNumeric.NumberWithSuffixPercentage, + englishNumeric.EnglishNumeric.NumberWithPrefixPercentage + ]; + return this.buildRegexes(regexStrs); + } +} +exports.EnglishPercentageExtractor = EnglishPercentageExtractor; + +}); + +unwrapExports(extractors$2); + +var extractors$6 = createCommonjsModule(function (module, exports) { +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); + + + + + +class SpanishNumberExtractor extends extractors$4.BaseNumberExtractor { + constructor(mode = models$2.NumberMode.Default) { + super(); + this.extractType = constants.Constants.SYS_NUM; + let regexes = new Array(); + // Add Cardinal + let cardExtract = null; + switch (mode) { + case models$2.NumberMode.PureNumber: + cardExtract = new SpanishCardinalExtractor(spanishNumeric.SpanishNumeric.PlaceHolderPureNumber); + break; + case models$2.NumberMode.Currency: + regexes.push({ regExp: recognizersText.RegExpUtility.getSafeRegExp(spanishNumeric.SpanishNumeric.CurrencyRegex, "gs"), value: "IntegerNum" }); + break; + case models$2.NumberMode.Default: + break; + } + if (cardExtract === null) { + cardExtract = new SpanishCardinalExtractor(); + } + cardExtract.regexes.forEach(r => regexes.push(r)); + // Add Fraction + let fracExtract = new SpanishFractionExtractor(); + fracExtract.regexes.forEach(r => regexes.push(r)); + this.regexes = regexes; + } +} +exports.SpanishNumberExtractor = SpanishNumberExtractor; +class SpanishCardinalExtractor extends extractors$4.BaseNumberExtractor { + constructor(placeholder = spanishNumeric.SpanishNumeric.PlaceHolderDefault) { + super(); + this.extractType = constants.Constants.SYS_NUM_CARDINAL; + let regexes = new Array(); + // Add Integer Regexes + let intExtract = new SpanishIntegerExtractor(placeholder); + intExtract.regexes.forEach(r => regexes.push(r)); + // Add Double Regexes + let doubleExtract = new SpanishDoubleExtractor(placeholder); + doubleExtract.regexes.forEach(r => regexes.push(r)); + this.regexes = regexes; + } +} +exports.SpanishCardinalExtractor = SpanishCardinalExtractor; +class SpanishIntegerExtractor extends extractors$4.BaseNumberExtractor { + constructor(placeholder = spanishNumeric.SpanishNumeric.PlaceHolderDefault) { + super(); + this.extractType = constants.Constants.SYS_NUM_INTEGER; + let regexes = new Array({ + regExp: recognizersText.RegExpUtility.getSafeRegExp(spanishNumeric.SpanishNumeric.NumbersWithPlaceHolder(placeholder), "gi"), + value: "IntegerNum" + }, { + regExp: recognizersText.RegExpUtility.getSafeRegExp(spanishNumeric.SpanishNumeric.NumbersWithSuffix, "gs"), + value: "IntegerNum" + }, { + regExp: this.generateLongFormatNumberRegexes(models$2.LongFormatType.integerNumDot, placeholder), + value: "IntegerNum" + }, { + regExp: this.generateLongFormatNumberRegexes(models$2.LongFormatType.integerNumBlank, placeholder), + value: "IntegerNum" + }, { + regExp: this.generateLongFormatNumberRegexes(models$2.LongFormatType.integerNumNoBreakSpace, placeholder), + value: "IntegerNum" + }, { + regExp: recognizersText.RegExpUtility.getSafeRegExp(spanishNumeric.SpanishNumeric.RoundNumberIntegerRegexWithLocks), + value: "IntegerNum" + }, { + regExp: recognizersText.RegExpUtility.getSafeRegExp(spanishNumeric.SpanishNumeric.NumbersWithDozenSuffix), + value: "IntegerNum" + }, { + regExp: recognizersText.RegExpUtility.getSafeRegExp(spanishNumeric.SpanishNumeric.AllIntRegexWithLocks), + value: "IntegerSpa" + }, { + regExp: recognizersText.RegExpUtility.getSafeRegExp(spanishNumeric.SpanishNumeric.AllIntRegexWithDozenSuffixLocks), + value: "IntegerSpa" + }); + this.regexes = regexes; + } +} +exports.SpanishIntegerExtractor = SpanishIntegerExtractor; +class SpanishDoubleExtractor extends extractors$4.BaseNumberExtractor { + constructor(placeholder = spanishNumeric.SpanishNumeric.PlaceHolderDefault) { + super(); + this.extractType = constants.Constants.SYS_NUM_DOUBLE; + let regexes = new Array({ + regExp: recognizersText.RegExpUtility.getSafeRegExp(spanishNumeric.SpanishNumeric.DoubleDecimalPointRegex(placeholder)), + value: "DoubleNum" + }, { + regExp: recognizersText.RegExpUtility.getSafeRegExp(spanishNumeric.SpanishNumeric.DoubleWithoutIntegralRegex(placeholder)), + value: "DoubleNum" + }, { + regExp: recognizersText.RegExpUtility.getSafeRegExp(spanishNumeric.SpanishNumeric.DoubleWithMultiplierRegex, "gs"), + value: "DoubleNum" + }, { + regExp: recognizersText.RegExpUtility.getSafeRegExp(spanishNumeric.SpanishNumeric.DoubleWithRoundNumber), + value: "DoubleNum" + }, { + regExp: recognizersText.RegExpUtility.getSafeRegExp(spanishNumeric.SpanishNumeric.DoubleAllFloatRegex), + value: "DoubleSpa" + }, { + regExp: recognizersText.RegExpUtility.getSafeRegExp(spanishNumeric.SpanishNumeric.DoubleExponentialNotationRegex), + value: "DoublePow" + }, { + regExp: recognizersText.RegExpUtility.getSafeRegExp(spanishNumeric.SpanishNumeric.DoubleCaretExponentialNotationRegex), + value: "DoublePow" + }, { + regExp: this.generateLongFormatNumberRegexes(models$2.LongFormatType.doubleNumDotComma, placeholder), + value: "DoubleNum" + }, { + regExp: this.generateLongFormatNumberRegexes(models$2.LongFormatType.doubleNumNoBreakSpaceComma, placeholder), + value: "DoubleNum" + }); + this.regexes = regexes; + } +} +exports.SpanishDoubleExtractor = SpanishDoubleExtractor; +class SpanishFractionExtractor extends extractors$4.BaseNumberExtractor { + constructor() { + super(); + this.extractType = constants.Constants.SYS_NUM_FRACTION; + let regexes = new Array({ + regExp: recognizersText.RegExpUtility.getSafeRegExp(spanishNumeric.SpanishNumeric.FractionNotationRegex), + value: "FracNum" + }, { + regExp: recognizersText.RegExpUtility.getSafeRegExp(spanishNumeric.SpanishNumeric.FractionNotationWithSpacesRegex), + value: "FracNum" + }, { + regExp: recognizersText.RegExpUtility.getSafeRegExp(spanishNumeric.SpanishNumeric.FractionNounRegex), + value: "FracSpa" + }, { + regExp: recognizersText.RegExpUtility.getSafeRegExp(spanishNumeric.SpanishNumeric.FractionNounWithArticleRegex), + value: "FracSpa" + }, { + regExp: recognizersText.RegExpUtility.getSafeRegExp(spanishNumeric.SpanishNumeric.FractionPrepositionRegex), + value: "FracSpa" + }); + this.regexes = regexes; + } +} +exports.SpanishFractionExtractor = SpanishFractionExtractor; +class SpanishOrdinalExtractor extends extractors$4.BaseNumberExtractor { + constructor() { + super(); + this.extractType = constants.Constants.SYS_NUM_ORDINAL; + let regexes = new Array({ + regExp: recognizersText.RegExpUtility.getSafeRegExp(spanishNumeric.SpanishNumeric.OrdinalSuffixRegex), + value: "OrdinalNum" + }, { + regExp: recognizersText.RegExpUtility.getSafeRegExp(spanishNumeric.SpanishNumeric.OrdinalNounRegex), + value: "OrdSpa" + }); + this.regexes = regexes; + } +} +exports.SpanishOrdinalExtractor = SpanishOrdinalExtractor; +class SpanishPercentageExtractor extends extractors$4.BasePercentageExtractor { + constructor() { + super(new SpanishNumberExtractor()); + } + initRegexes() { + let regexStrs = [ + spanishNumeric.SpanishNumeric.NumberWithPrefixPercentage + ]; + return this.buildRegexes(regexStrs); + } +} +exports.SpanishPercentageExtractor = SpanishPercentageExtractor; + +}); + +unwrapExports(extractors$6); + +var extractors$8 = createCommonjsModule(function (module, exports) { +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); + + + + + +class PortugueseNumberExtractor extends extractors$4.BaseNumberExtractor { + constructor(mode = models$2.NumberMode.Default) { + super(); + this.extractType = constants.Constants.SYS_NUM; + let regexes = new Array(); + // Add Cardinal + let cardExtract = null; + switch (mode) { + case models$2.NumberMode.PureNumber: + cardExtract = new PortugueseCardinalExtractor(portugueseNumeric.PortugueseNumeric.PlaceHolderPureNumber); + break; + case models$2.NumberMode.Currency: + regexes.push({ regExp: recognizersText.RegExpUtility.getSafeRegExp(portugueseNumeric.PortugueseNumeric.CurrencyRegex, "gs"), value: "IntegerNum" }); + break; + case models$2.NumberMode.Default: + break; + } + if (cardExtract === null) { + cardExtract = new PortugueseCardinalExtractor(); + } + cardExtract.regexes.forEach(r => regexes.push(r)); + // Add Fraction + let fracExtract = new PortugueseFractionExtractor(); + fracExtract.regexes.forEach(r => regexes.push(r)); + this.regexes = regexes; + } +} +exports.PortugueseNumberExtractor = PortugueseNumberExtractor; +class PortugueseCardinalExtractor extends extractors$4.BaseNumberExtractor { + constructor(placeholder = portugueseNumeric.PortugueseNumeric.PlaceHolderDefault) { + super(); + this.extractType = constants.Constants.SYS_NUM_CARDINAL; + let regexes = new Array(); + // Add Integer Regexes + let intExtract = new PortugueseIntegerExtractor(placeholder); + intExtract.regexes.forEach(r => regexes.push(r)); + // Add Double Regexes + let doubleExtract = new PortugueseDoubleExtractor(placeholder); + doubleExtract.regexes.forEach(r => regexes.push(r)); + this.regexes = regexes; + } +} +exports.PortugueseCardinalExtractor = PortugueseCardinalExtractor; +class PortugueseIntegerExtractor extends extractors$4.BaseNumberExtractor { + constructor(placeholder = portugueseNumeric.PortugueseNumeric.PlaceHolderDefault) { + super(); + this.extractType = constants.Constants.SYS_NUM_INTEGER; + let regexes = new Array({ + regExp: recognizersText.RegExpUtility.getSafeRegExp(portugueseNumeric.PortugueseNumeric.NumbersWithPlaceHolder(placeholder), "gi"), + value: "IntegerNum" + }, { + regExp: recognizersText.RegExpUtility.getSafeRegExp(portugueseNumeric.PortugueseNumeric.NumbersWithSuffix, "gs"), + value: "IntegerNum" + }, { + regExp: this.generateLongFormatNumberRegexes(models$2.LongFormatType.integerNumDot, placeholder), + value: "IntegerNum" + }, { + regExp: this.generateLongFormatNumberRegexes(models$2.LongFormatType.integerNumBlank, placeholder), + value: "IntegerNum" + }, { + regExp: this.generateLongFormatNumberRegexes(models$2.LongFormatType.integerNumNoBreakSpace, placeholder), + value: "IntegerNum" + }, { + regExp: recognizersText.RegExpUtility.getSafeRegExp(portugueseNumeric.PortugueseNumeric.RoundNumberIntegerRegexWithLocks), + value: "IntegerNum" + }, { + regExp: recognizersText.RegExpUtility.getSafeRegExp(portugueseNumeric.PortugueseNumeric.NumbersWithDozen2Suffix), + value: "IntegerNum" + }, { + regExp: recognizersText.RegExpUtility.getSafeRegExp(portugueseNumeric.PortugueseNumeric.NumbersWithDozenSuffix), + value: "IntegerNum" + }, { + regExp: recognizersText.RegExpUtility.getSafeRegExp(portugueseNumeric.PortugueseNumeric.AllIntRegexWithLocks), + value: "IntegerPor" + }, { + regExp: recognizersText.RegExpUtility.getSafeRegExp(portugueseNumeric.PortugueseNumeric.AllIntRegexWithDozenSuffixLocks), + value: "IntegerPor" + }); + this.regexes = regexes; + } +} +exports.PortugueseIntegerExtractor = PortugueseIntegerExtractor; +class PortugueseDoubleExtractor extends extractors$4.BaseNumberExtractor { + constructor(placeholder = portugueseNumeric.PortugueseNumeric.PlaceHolderDefault) { + super(); + this.extractType = constants.Constants.SYS_NUM_DOUBLE; + let regexes = new Array({ + regExp: recognizersText.RegExpUtility.getSafeRegExp(portugueseNumeric.PortugueseNumeric.DoubleDecimalPointRegex(placeholder)), + value: "DoubleNum" + }, { + regExp: recognizersText.RegExpUtility.getSafeRegExp(portugueseNumeric.PortugueseNumeric.DoubleWithoutIntegralRegex(placeholder)), + value: "DoubleNum" + }, { + regExp: recognizersText.RegExpUtility.getSafeRegExp(portugueseNumeric.PortugueseNumeric.DoubleWithMultiplierRegex, "gs"), + value: "DoubleNum" + }, { + regExp: recognizersText.RegExpUtility.getSafeRegExp(portugueseNumeric.PortugueseNumeric.DoubleWithRoundNumber), + value: "DoubleNum" + }, { + regExp: recognizersText.RegExpUtility.getSafeRegExp(portugueseNumeric.PortugueseNumeric.DoubleAllFloatRegex), + value: "DoublePor" + }, { + regExp: recognizersText.RegExpUtility.getSafeRegExp(portugueseNumeric.PortugueseNumeric.DoubleExponentialNotationRegex), + value: "DoublePow" + }, { + regExp: recognizersText.RegExpUtility.getSafeRegExp(portugueseNumeric.PortugueseNumeric.DoubleCaretExponentialNotationRegex), + value: "DoublePow" + }, { + regExp: this.generateLongFormatNumberRegexes(models$2.LongFormatType.doubleNumDotComma, placeholder), + value: "DoubleNum" + }, { + regExp: this.generateLongFormatNumberRegexes(models$2.LongFormatType.doubleNumNoBreakSpaceComma, placeholder), + value: "DoubleNum" + }); + this.regexes = regexes; + } +} +exports.PortugueseDoubleExtractor = PortugueseDoubleExtractor; +class PortugueseFractionExtractor extends extractors$4.BaseNumberExtractor { + constructor() { + super(); + this.extractType = constants.Constants.SYS_NUM_FRACTION; + let regexes = new Array({ + regExp: recognizersText.RegExpUtility.getSafeRegExp(portugueseNumeric.PortugueseNumeric.FractionNotationRegex), + value: "FracNum" + }, { + regExp: recognizersText.RegExpUtility.getSafeRegExp(portugueseNumeric.PortugueseNumeric.FractionNotationWithSpacesRegex), + value: "FracNum" + }, { + regExp: recognizersText.RegExpUtility.getSafeRegExp(portugueseNumeric.PortugueseNumeric.FractionNounRegex), + value: "FracPor" + }, { + regExp: recognizersText.RegExpUtility.getSafeRegExp(portugueseNumeric.PortugueseNumeric.FractionNounWithArticleRegex), + value: "FracPor" + }, { + regExp: recognizersText.RegExpUtility.getSafeRegExp(portugueseNumeric.PortugueseNumeric.FractionPrepositionRegex), + value: "FracPor" + }); + this.regexes = regexes; + } +} +exports.PortugueseFractionExtractor = PortugueseFractionExtractor; +class PortugueseOrdinalExtractor extends extractors$4.BaseNumberExtractor { + constructor() { + super(); + this.extractType = constants.Constants.SYS_NUM_ORDINAL; + let regexes = new Array({ + regExp: recognizersText.RegExpUtility.getSafeRegExp(portugueseNumeric.PortugueseNumeric.OrdinalSuffixRegex), + value: "OrdinalNum" + }, { + regExp: recognizersText.RegExpUtility.getSafeRegExp(portugueseNumeric.PortugueseNumeric.OrdinalEnglishRegex), + value: "OrdinalPor" + }); + this.regexes = regexes; + } +} +exports.PortugueseOrdinalExtractor = PortugueseOrdinalExtractor; +class PortuguesePercentageExtractor extends extractors$4.BasePercentageExtractor { + constructor() { + super(new PortugueseNumberExtractor()); + } + initRegexes() { + let regexStrs = [ + portugueseNumeric.PortugueseNumeric.NumberWithSuffixPercentage + ]; + return this.buildRegexes(regexStrs); + } +} +exports.PortuguesePercentageExtractor = PortuguesePercentageExtractor; + +}); + +unwrapExports(extractors$8); + +var extractors$10 = createCommonjsModule(function (module, exports) { +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); + + + + + +class FrenchNumberExtractor extends extractors$4.BaseNumberExtractor { + constructor(mode = models$2.NumberMode.Default) { + super(); + this.extractType = constants.Constants.SYS_NUM; + let regexes = new Array(); + // Add Cardinal + let cardExtract = null; + switch (mode) { + case models$2.NumberMode.PureNumber: + cardExtract = new FrenchCardinalExtractor(frenchNumeric.FrenchNumeric.PlaceHolderPureNumber); + break; + case models$2.NumberMode.Currency: + regexes.push({ regExp: recognizersText.RegExpUtility.getSafeRegExp(frenchNumeric.FrenchNumeric.CurrencyRegex, "gs"), value: "IntegerNum" }); + break; + case models$2.NumberMode.Default: + break; + } + if (cardExtract === null) { + cardExtract = new FrenchCardinalExtractor(); + } + cardExtract.regexes.forEach(r => regexes.push(r)); + // Add Fraction + let fracExtract = new FrenchFractionExtractor(); + fracExtract.regexes.forEach(r => regexes.push(r)); + this.regexes = regexes; + } +} +exports.FrenchNumberExtractor = FrenchNumberExtractor; +class FrenchCardinalExtractor extends extractors$4.BaseNumberExtractor { + constructor(placeholder = frenchNumeric.FrenchNumeric.PlaceHolderDefault) { + super(); + this.extractType = constants.Constants.SYS_NUM_CARDINAL; + let regexes = new Array(); + // Add Integer Regexes + let intExtract = new FrenchIntegerExtractor(placeholder); + intExtract.regexes.forEach(r => regexes.push(r)); + // Add Double Regexes + let doubleExtract = new FrenchDoubleExtractor(placeholder); + doubleExtract.regexes.forEach(r => regexes.push(r)); + this.regexes = regexes; + } +} +exports.FrenchCardinalExtractor = FrenchCardinalExtractor; +class FrenchIntegerExtractor extends extractors$4.BaseNumberExtractor { + constructor(placeholder = frenchNumeric.FrenchNumeric.PlaceHolderDefault) { + super(); + this.extractType = constants.Constants.SYS_NUM_INTEGER; + let regexes = new Array({ + regExp: recognizersText.RegExpUtility.getSafeRegExp(frenchNumeric.FrenchNumeric.NumbersWithPlaceHolder(placeholder), "gi"), + value: "IntegerNum" + }, { + regExp: recognizersText.RegExpUtility.getSafeRegExp(frenchNumeric.FrenchNumeric.NumbersWithSuffix, "gs"), + value: "IntegerNum" + }, { + regExp: this.generateLongFormatNumberRegexes(models$2.LongFormatType.integerNumDot, placeholder), + value: "IntegerNum" + }, { + regExp: this.generateLongFormatNumberRegexes(models$2.LongFormatType.integerNumBlank, placeholder), + value: "IntegerNum" + }, { + regExp: this.generateLongFormatNumberRegexes(models$2.LongFormatType.integerNumNoBreakSpace, placeholder), + value: "IntegerNum" + }, { + regExp: recognizersText.RegExpUtility.getSafeRegExp(frenchNumeric.FrenchNumeric.RoundNumberIntegerRegexWithLocks), + value: "IntegerNum" + }, { + regExp: recognizersText.RegExpUtility.getSafeRegExp(frenchNumeric.FrenchNumeric.NumbersWithDozenSuffix), + value: "IntegerNum" + }, { + regExp: recognizersText.RegExpUtility.getSafeRegExp(frenchNumeric.FrenchNumeric.AllIntRegexWithLocks), + value: "IntegerFr" + }, { + regExp: recognizersText.RegExpUtility.getSafeRegExp(frenchNumeric.FrenchNumeric.AllIntRegexWithDozenSuffixLocks), + value: "IntegerFr" + }); + this.regexes = regexes; + } +} +exports.FrenchIntegerExtractor = FrenchIntegerExtractor; +class FrenchDoubleExtractor extends extractors$4.BaseNumberExtractor { + constructor(placeholder = frenchNumeric.FrenchNumeric.PlaceHolderDefault) { + super(); + this.extractType = constants.Constants.SYS_NUM_DOUBLE; + let regexes = new Array({ + regExp: recognizersText.RegExpUtility.getSafeRegExp(frenchNumeric.FrenchNumeric.DoubleDecimalPointRegex(placeholder)), + value: "DoubleNum" + }, { + regExp: recognizersText.RegExpUtility.getSafeRegExp(frenchNumeric.FrenchNumeric.DoubleWithoutIntegralRegex(placeholder)), + value: "DoubleNum" + }, { + regExp: recognizersText.RegExpUtility.getSafeRegExp(frenchNumeric.FrenchNumeric.DoubleWithMultiplierRegex, "gs"), + value: "DoubleNum" + }, { + regExp: recognizersText.RegExpUtility.getSafeRegExp(frenchNumeric.FrenchNumeric.DoubleWithRoundNumber), + value: "DoubleNum" + }, { + regExp: recognizersText.RegExpUtility.getSafeRegExp(frenchNumeric.FrenchNumeric.DoubleAllFloatRegex), + value: "DoubleFr" + }, { + regExp: recognizersText.RegExpUtility.getSafeRegExp(frenchNumeric.FrenchNumeric.DoubleExponentialNotationRegex), + value: "DoublePow" + }, { + regExp: recognizersText.RegExpUtility.getSafeRegExp(frenchNumeric.FrenchNumeric.DoubleCaretExponentialNotationRegex), + value: "DoublePow" + }, { + regExp: this.generateLongFormatNumberRegexes(models$2.LongFormatType.doubleNumDotComma, placeholder), + value: "DoubleNum" + }, { + regExp: this.generateLongFormatNumberRegexes(models$2.LongFormatType.doubleNumNoBreakSpaceComma, placeholder), + value: "DoubleNum" + }); + this.regexes = regexes; + } +} +exports.FrenchDoubleExtractor = FrenchDoubleExtractor; +class FrenchFractionExtractor extends extractors$4.BaseNumberExtractor { + constructor() { + super(); + this.extractType = constants.Constants.SYS_NUM_FRACTION; + let regexes = new Array({ + regExp: recognizersText.RegExpUtility.getSafeRegExp(frenchNumeric.FrenchNumeric.FractionNotationRegex), + value: "FracNum" + }, { + regExp: recognizersText.RegExpUtility.getSafeRegExp(frenchNumeric.FrenchNumeric.FractionNotationWithSpacesRegex), + value: "FracNum" + }, { + regExp: recognizersText.RegExpUtility.getSafeRegExp(frenchNumeric.FrenchNumeric.FractionNounRegex), + value: "FracFr" + }, { + regExp: recognizersText.RegExpUtility.getSafeRegExp(frenchNumeric.FrenchNumeric.FractionNounWithArticleRegex), + value: "FracFr" + }, { + regExp: recognizersText.RegExpUtility.getSafeRegExp(frenchNumeric.FrenchNumeric.FractionPrepositionRegex), + value: "FracFr" + }); + this.regexes = regexes; + } +} +exports.FrenchFractionExtractor = FrenchFractionExtractor; +class FrenchOrdinalExtractor extends extractors$4.BaseNumberExtractor { + constructor() { + super(); + this.extractType = constants.Constants.SYS_NUM_ORDINAL; + let regexes = new Array({ + regExp: recognizersText.RegExpUtility.getSafeRegExp(frenchNumeric.FrenchNumeric.OrdinalSuffixRegex), + value: "OrdinalNum" + }, { + regExp: recognizersText.RegExpUtility.getSafeRegExp(frenchNumeric.FrenchNumeric.OrdinalFrenchRegex), + value: "OrdFr" + }); + this.regexes = regexes; + } +} +exports.FrenchOrdinalExtractor = FrenchOrdinalExtractor; +class FrenchPercentageExtractor extends extractors$4.BasePercentageExtractor { + constructor() { + super(new FrenchNumberExtractor()); + } + initRegexes() { + let regexStrs = [ + frenchNumeric.FrenchNumeric.NumberWithSuffixPercentage, + frenchNumeric.FrenchNumeric.NumberWithPrefixPercentage + ]; + return this.buildRegexes(regexStrs); + } +} +exports.FrenchPercentageExtractor = FrenchPercentageExtractor; + +}); + +unwrapExports(extractors$10); + +var extractors$12 = createCommonjsModule(function (module, exports) { +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); + + + + +var ChineseNumberExtractorMode; +(function (ChineseNumberExtractorMode) { + // Number extraction with an allow list that filters what numbers to extract. + ChineseNumberExtractorMode[ChineseNumberExtractorMode["Default"] = 0] = "Default"; + // Extract all number-related terms aggressively. + ChineseNumberExtractorMode[ChineseNumberExtractorMode["ExtractAll"] = 1] = "ExtractAll"; +})(ChineseNumberExtractorMode = exports.ChineseNumberExtractorMode || (exports.ChineseNumberExtractorMode = {})); +class ChineseNumberExtractor extends extractors$4.BaseNumberExtractor { + constructor(mode = ChineseNumberExtractorMode.Default) { + super(); + this.extractType = constants.Constants.SYS_NUM; + let regexes = new Array(); + // Add Cardinal + let cardExtract = new ChineseCardinalExtractor(mode); + cardExtract.regexes.forEach(r => regexes.push(r)); + // Add Fraction + let fracExtract = new ChineseFractionExtractor(); + fracExtract.regexes.forEach(r => regexes.push(r)); + this.regexes = regexes; + } +} +exports.ChineseNumberExtractor = ChineseNumberExtractor; +class ChineseCardinalExtractor extends extractors$4.BaseNumberExtractor { + constructor(mode = ChineseNumberExtractorMode.Default) { + super(); + this.extractType = constants.Constants.SYS_NUM_CARDINAL; + let regexes = new Array(); + // Add Integer Regexes + let intExtract = new ChineseIntegerExtractor(mode); + intExtract.regexes.forEach(r => regexes.push(r)); + // Add Double Regexes + let doubleExtract = new ChineseDoubleExtractor(); + doubleExtract.regexes.forEach(r => regexes.push(r)); + this.regexes = regexes; + } +} +exports.ChineseCardinalExtractor = ChineseCardinalExtractor; +class ChineseIntegerExtractor extends extractors$4.BaseNumberExtractor { + constructor(mode = ChineseNumberExtractorMode.Default) { + super(); + this.extractType = constants.Constants.SYS_NUM_INTEGER; + let regexes = new Array({ + regExp: recognizersText.RegExpUtility.getSafeRegExp(chineseNumeric.ChineseNumeric.NumbersSpecialsChars, "gi"), + value: "IntegerNum" + }, { + regExp: recognizersText.RegExpUtility.getSafeRegExp(chineseNumeric.ChineseNumeric.NumbersSpecialsCharsWithSuffix, "gs"), + value: "IntegerNum" + }, { + regExp: recognizersText.RegExpUtility.getSafeRegExp(chineseNumeric.ChineseNumeric.DottedNumbersSpecialsChar, "gis"), + value: "IntegerNum" + }, { + regExp: recognizersText.RegExpUtility.getSafeRegExp(chineseNumeric.ChineseNumeric.NumbersWithHalfDozen, "gis"), + value: "IntegerChs" + }, { + regExp: recognizersText.RegExpUtility.getSafeRegExp(chineseNumeric.ChineseNumeric.NumbersWithDozen, "gis"), + value: "IntegerChs" + }); + switch (mode) { + case ChineseNumberExtractorMode.Default: + regexes.push({ + regExp: recognizersText.RegExpUtility.getSafeRegExp(chineseNumeric.ChineseNumeric.NumbersWithAllowListRegex, "gi"), + value: "IntegerChs" + }); + break; + case ChineseNumberExtractorMode.ExtractAll: + regexes.push({ + regExp: recognizersText.RegExpUtility.getSafeRegExp(chineseNumeric.ChineseNumeric.NumbersAggressiveRegex, "gi"), + value: "IntegerChs" + }); + break; + } + this.regexes = regexes; + } +} +exports.ChineseIntegerExtractor = ChineseIntegerExtractor; +class ChineseDoubleExtractor extends extractors$4.BaseNumberExtractor { + constructor() { + super(); + this.extractType = constants.Constants.SYS_NUM_DOUBLE; + let regexes = new Array({ + regExp: recognizersText.RegExpUtility.getSafeRegExp(chineseNumeric.ChineseNumeric.DoubleSpecialsChars, "gis"), + value: "DoubleNum" + }, { + regExp: recognizersText.RegExpUtility.getSafeRegExp(chineseNumeric.ChineseNumeric.DoubleSpecialsCharsWithNegatives, "gis"), + value: "DoubleNum" + }, { + regExp: recognizersText.RegExpUtility.getSafeRegExp(chineseNumeric.ChineseNumeric.SimpleDoubleSpecialsChars, "gis"), + value: "DoubleNum" + }, { + regExp: recognizersText.RegExpUtility.getSafeRegExp(chineseNumeric.ChineseNumeric.DoubleWithMultiplierRegex, "gi"), + value: "DoubleNum" + }, { + regExp: recognizersText.RegExpUtility.getSafeRegExp(chineseNumeric.ChineseNumeric.DoubleWithThousandsRegex, "gi"), + value: "DoubleChs" + }, { + regExp: recognizersText.RegExpUtility.getSafeRegExp(chineseNumeric.ChineseNumeric.DoubleAllFloatRegex, "gi"), + value: "DoubleChs" + }, { + regExp: recognizersText.RegExpUtility.getSafeRegExp(chineseNumeric.ChineseNumeric.DoubleExponentialNotationRegex, "gis"), + value: "DoublePow" + }, { + regExp: recognizersText.RegExpUtility.getSafeRegExp(chineseNumeric.ChineseNumeric.DoubleScientificNotationRegex, "gis"), + value: "DoublePow" + }); + this.regexes = regexes; + } +} +exports.ChineseDoubleExtractor = ChineseDoubleExtractor; +class ChineseFractionExtractor extends extractors$4.BaseNumberExtractor { + constructor() { + super(); + this.extractType = constants.Constants.SYS_NUM_FRACTION; + let regexes = new Array({ + regExp: recognizersText.RegExpUtility.getSafeRegExp(chineseNumeric.ChineseNumeric.FractionNotationSpecialsCharsRegex, "gis"), + value: "FracNum" + }, { + regExp: recognizersText.RegExpUtility.getSafeRegExp(chineseNumeric.ChineseNumeric.FractionNotationRegex, "gis"), + value: "FracNum" + }, { + regExp: recognizersText.RegExpUtility.getSafeRegExp(chineseNumeric.ChineseNumeric.AllFractionNumber, "gi"), + value: "FracChs" + }); + this.regexes = regexes; + } +} +exports.ChineseFractionExtractor = ChineseFractionExtractor; +class ChineseOrdinalExtractor extends extractors$4.BaseNumberExtractor { + constructor() { + super(); + this.extractType = constants.Constants.SYS_NUM_ORDINAL; + let regexes = new Array({ + regExp: recognizersText.RegExpUtility.getSafeRegExp(chineseNumeric.ChineseNumeric.OrdinalRegex, "gi"), + value: "OrdinalChs" + }, { + regExp: recognizersText.RegExpUtility.getSafeRegExp(chineseNumeric.ChineseNumeric.OrdinalNumbersRegex, "gi"), + value: "OrdinalChs" + }); + this.regexes = regexes; + } +} +exports.ChineseOrdinalExtractor = ChineseOrdinalExtractor; +class ChinesePercentageExtractor extends extractors$4.BaseNumberExtractor { + constructor() { + super(); + this.extractType = constants.Constants.SYS_NUM_PERCENTAGE; + let regexes = new Array({ + regExp: recognizersText.RegExpUtility.getSafeRegExp(chineseNumeric.ChineseNumeric.PercentagePointRegex, "gi"), + value: "PerChs" + }, { + regExp: recognizersText.RegExpUtility.getSafeRegExp(chineseNumeric.ChineseNumeric.SimplePercentageRegex, "gi"), + value: "PerChs" + }, { + regExp: recognizersText.RegExpUtility.getSafeRegExp(chineseNumeric.ChineseNumeric.NumbersPercentagePointRegex, "gis"), + value: "PerNum" + }, { + regExp: recognizersText.RegExpUtility.getSafeRegExp(chineseNumeric.ChineseNumeric.NumbersPercentageWithSeparatorRegex, "gis"), + value: "PerNum" + }, { + regExp: recognizersText.RegExpUtility.getSafeRegExp(chineseNumeric.ChineseNumeric.NumbersPercentageWithMultiplierRegex, "gi"), + value: "PerNum" + }, { + regExp: recognizersText.RegExpUtility.getSafeRegExp(chineseNumeric.ChineseNumeric.FractionPercentagePointRegex, "gis"), + value: "PerNum" + }, { + regExp: recognizersText.RegExpUtility.getSafeRegExp(chineseNumeric.ChineseNumeric.FractionPercentageWithSeparatorRegex, "gis"), + value: "PerNum" + }, { + regExp: recognizersText.RegExpUtility.getSafeRegExp(chineseNumeric.ChineseNumeric.FractionPercentageWithMultiplierRegex, "gi"), + value: "PerNum" + }, { + regExp: recognizersText.RegExpUtility.getSafeRegExp(chineseNumeric.ChineseNumeric.SimpleNumbersPercentageRegex, "gis"), + value: "PerNum" + }, { + regExp: recognizersText.RegExpUtility.getSafeRegExp(chineseNumeric.ChineseNumeric.SimpleNumbersPercentageWithMultiplierRegex, "gi"), + value: "PerNum" + }, { + regExp: recognizersText.RegExpUtility.getSafeRegExp(chineseNumeric.ChineseNumeric.SimpleNumbersPercentagePointRegex, "gis"), + value: "PerNum" + }, { + regExp: recognizersText.RegExpUtility.getSafeRegExp(chineseNumeric.ChineseNumeric.IntegerPercentageRegex, "gis"), + value: "PerNum" + }, { + regExp: recognizersText.RegExpUtility.getSafeRegExp(chineseNumeric.ChineseNumeric.IntegerPercentageWithMultiplierRegex, "gi"), + value: "PerNum" + }, { + regExp: recognizersText.RegExpUtility.getSafeRegExp(chineseNumeric.ChineseNumeric.NumbersFractionPercentageRegex, "gis"), + value: "PerNum" + }, { + regExp: recognizersText.RegExpUtility.getSafeRegExp(chineseNumeric.ChineseNumeric.SimpleIntegerPercentageRegex, "gis"), + value: "PerNum" + }, { + regExp: recognizersText.RegExpUtility.getSafeRegExp(chineseNumeric.ChineseNumeric.NumbersFoldsPercentageRegex, "gis"), + value: "PerSpe" + }, { + regExp: recognizersText.RegExpUtility.getSafeRegExp(chineseNumeric.ChineseNumeric.FoldsPercentageRegex, "gis"), + value: "PerSpe" + }, { + regExp: recognizersText.RegExpUtility.getSafeRegExp(chineseNumeric.ChineseNumeric.SimpleFoldsPercentageRegex, "gis"), + value: "PerSpe" + }, { + regExp: recognizersText.RegExpUtility.getSafeRegExp(chineseNumeric.ChineseNumeric.SpecialsPercentageRegex, "gis"), + value: "PerSpe" + }, { + regExp: recognizersText.RegExpUtility.getSafeRegExp(chineseNumeric.ChineseNumeric.NumbersSpecialsPercentageRegex, "gis"), + value: "PerSpe" + }, { + regExp: recognizersText.RegExpUtility.getSafeRegExp(chineseNumeric.ChineseNumeric.SimpleSpecialsPercentageRegex, "gis"), + value: "PerSpe" + }, { + regExp: recognizersText.RegExpUtility.getSafeRegExp(chineseNumeric.ChineseNumeric.SpecialsFoldsPercentageRegex, "gis"), + value: "PerSpe" + }); + this.regexes = regexes; + } +} +exports.ChinesePercentageExtractor = ChinesePercentageExtractor; + +}); + +unwrapExports(extractors$12); + +var extractors$14 = createCommonjsModule(function (module, exports) { +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); + + + + +var JapaneseNumberExtractorMode; +(function (JapaneseNumberExtractorMode) { + // Number extraction with an allow list that filters what numbers to extract. + JapaneseNumberExtractorMode[JapaneseNumberExtractorMode["Default"] = 0] = "Default"; + // Extract all number-related terms aggressively. + JapaneseNumberExtractorMode[JapaneseNumberExtractorMode["ExtractAll"] = 1] = "ExtractAll"; +})(JapaneseNumberExtractorMode = exports.JapaneseNumberExtractorMode || (exports.JapaneseNumberExtractorMode = {})); +class JapaneseNumberExtractor extends extractors$4.BaseNumberExtractor { + constructor(mode = JapaneseNumberExtractorMode.Default) { + super(); + this.extractType = constants.Constants.SYS_NUM; + let regexes = new Array(); + // Add Cardinal + let cardExtract = new JapaneseCardinalExtractor(mode); + cardExtract.regexes.forEach(r => regexes.push(r)); + // Add Fraction + let fracExtract = new JapaneseFractionExtractor(); + fracExtract.regexes.forEach(r => regexes.push(r)); + this.regexes = regexes; + } +} +exports.JapaneseNumberExtractor = JapaneseNumberExtractor; +class JapaneseCardinalExtractor extends extractors$4.BaseNumberExtractor { + constructor(mode = JapaneseNumberExtractorMode.Default) { + super(); + this.extractType = constants.Constants.SYS_NUM_CARDINAL; + let regexes = new Array(); + // Add Integer Regexes + let intExtract = new JapaneseIntegerExtractor(mode); + intExtract.regexes.forEach(r => regexes.push(r)); + // Add Double Regexes + let doubleExtract = new JapaneseDoubleExtractor(); + doubleExtract.regexes.forEach(r => regexes.push(r)); + this.regexes = regexes; + } +} +exports.JapaneseCardinalExtractor = JapaneseCardinalExtractor; +class JapaneseIntegerExtractor extends extractors$4.BaseNumberExtractor { + constructor(mode = JapaneseNumberExtractorMode.Default) { + super(); + this.extractType = constants.Constants.SYS_NUM_INTEGER; + let regexes = new Array({ + regExp: recognizersText.RegExpUtility.getSafeRegExp(japaneseNumeric.JapaneseNumeric.NumbersSpecialsChars, "gi"), + value: "IntegerNum" + }, { + regExp: recognizersText.RegExpUtility.getSafeRegExp(japaneseNumeric.JapaneseNumeric.NumbersSpecialsCharsWithSuffix, "gi"), + value: "IntegerNum" + }, { + regExp: recognizersText.RegExpUtility.getSafeRegExp(japaneseNumeric.JapaneseNumeric.DottedNumbersSpecialsChar, "gi"), + value: "IntegerNum" + }, { + regExp: recognizersText.RegExpUtility.getSafeRegExp(japaneseNumeric.JapaneseNumeric.NumbersWithHalfDozen, "gi"), + value: "IntegerJpn" + }, { + regExp: recognizersText.RegExpUtility.getSafeRegExp(japaneseNumeric.JapaneseNumeric.NumbersWithDozen, "gi"), + value: "IntegerJpn" + }); + switch (mode) { + case JapaneseNumberExtractorMode.Default: + regexes.push({ + regExp: recognizersText.RegExpUtility.getSafeRegExp(japaneseNumeric.JapaneseNumeric.NumbersWithAllowListRegex, "gi"), + value: "IntegerJpn" + }); + break; + case JapaneseNumberExtractorMode.ExtractAll: + regexes.push({ + regExp: recognizersText.RegExpUtility.getSafeRegExp(japaneseNumeric.JapaneseNumeric.NumbersAggressiveRegex, "gi"), + value: "IntegerJpn" + }); + break; + } + this.regexes = regexes; + } +} +exports.JapaneseIntegerExtractor = JapaneseIntegerExtractor; +class JapaneseDoubleExtractor extends extractors$4.BaseNumberExtractor { + constructor() { + super(); + this.extractType = constants.Constants.SYS_NUM_DOUBLE; + let regexes = new Array({ + regExp: recognizersText.RegExpUtility.getSafeRegExp(japaneseNumeric.JapaneseNumeric.DoubleSpecialsChars, "gis"), + value: "DoubleNum" + }, { + regExp: recognizersText.RegExpUtility.getSafeRegExp(japaneseNumeric.JapaneseNumeric.DoubleSpecialsCharsWithNegatives, "gis"), + value: "DoubleNum" + }, { + regExp: recognizersText.RegExpUtility.getSafeRegExp(japaneseNumeric.JapaneseNumeric.SimpleDoubleSpecialsChars, "gis"), + value: "DoubleNum" + }, { + regExp: recognizersText.RegExpUtility.getSafeRegExp(japaneseNumeric.JapaneseNumeric.DoubleWithMultiplierRegex, "gis"), + value: "DoubleNum" + }, { + regExp: recognizersText.RegExpUtility.getSafeRegExp(japaneseNumeric.JapaneseNumeric.DoubleWithThousandsRegex, "gis"), + value: "DoubleJpn" + }, { + regExp: recognizersText.RegExpUtility.getSafeRegExp(japaneseNumeric.JapaneseNumeric.DoubleExponentialNotationRegex, "gis"), + value: "DoublePow" + }, { + regExp: recognizersText.RegExpUtility.getSafeRegExp(japaneseNumeric.JapaneseNumeric.DoubleScientificNotationRegex, "gis"), + value: "DoublePow" + }); + this.regexes = regexes; + } +} +exports.JapaneseDoubleExtractor = JapaneseDoubleExtractor; +class JapaneseFractionExtractor extends extractors$4.BaseNumberExtractor { + constructor() { + super(); + this.extractType = constants.Constants.SYS_NUM_FRACTION; + let regexes = new Array({ + regExp: recognizersText.RegExpUtility.getSafeRegExp(japaneseNumeric.JapaneseNumeric.FractionNotationSpecialsCharsRegex, "gis"), + value: "FracNum" + }, { + regExp: recognizersText.RegExpUtility.getSafeRegExp(japaneseNumeric.JapaneseNumeric.FractionNotationRegex, "gis"), + value: "FracNum" + }, { + regExp: recognizersText.RegExpUtility.getSafeRegExp(japaneseNumeric.JapaneseNumeric.AllFractionNumber, "gis"), + value: "FracJpn" + }); + this.regexes = regexes; + } +} +exports.JapaneseFractionExtractor = JapaneseFractionExtractor; +class JapaneseOrdinalExtractor extends extractors$4.BaseNumberExtractor { + constructor() { + super(); + this.extractType = constants.Constants.SYS_NUM_ORDINAL; + let regexes = new Array({ + regExp: recognizersText.RegExpUtility.getSafeRegExp(japaneseNumeric.JapaneseNumeric.OrdinalRegex, "gi"), + value: "OrdinalJpn" + }, { + regExp: recognizersText.RegExpUtility.getSafeRegExp(japaneseNumeric.JapaneseNumeric.OrdinalNumbersRegex, "gi"), + value: "OrdinalJpn" + }, { + regExp: recognizersText.RegExpUtility.getSafeRegExp(japaneseNumeric.JapaneseNumeric.NumbersFoldsPercentageRegex, "gi"), + value: "OrdinalJpn" + }); + this.regexes = regexes; + } +} +exports.JapaneseOrdinalExtractor = JapaneseOrdinalExtractor; +class JapanesePercentageExtractor extends extractors$4.BaseNumberExtractor { + constructor() { + super(); + this.extractType = constants.Constants.SYS_NUM_PERCENTAGE; + let regexes = new Array({ + regExp: recognizersText.RegExpUtility.getSafeRegExp(japaneseNumeric.JapaneseNumeric.SimplePercentageRegex, "gi"), + value: "PerJpn" + }, { + regExp: recognizersText.RegExpUtility.getSafeRegExp(japaneseNumeric.JapaneseNumeric.NumbersPercentagePointRegex, "gis"), + value: "PerNum" + }, { + regExp: recognizersText.RegExpUtility.getSafeRegExp(japaneseNumeric.JapaneseNumeric.NumbersPercentageWithSeparatorRegex, "gis"), + value: "PerNum" + }, { + regExp: recognizersText.RegExpUtility.getSafeRegExp(japaneseNumeric.JapaneseNumeric.NumbersPercentageWithMultiplierRegex, "gi"), + value: "PerNum" + }, { + regExp: recognizersText.RegExpUtility.getSafeRegExp(japaneseNumeric.JapaneseNumeric.SimpleNumbersPercentageWithMultiplierRegex, "gi"), + value: "PerNum" + }, { + regExp: recognizersText.RegExpUtility.getSafeRegExp(japaneseNumeric.JapaneseNumeric.SimpleIntegerPercentageRegex, "gis"), + value: "PerNum" + }, { + regExp: recognizersText.RegExpUtility.getSafeRegExp(japaneseNumeric.JapaneseNumeric.NumbersFoldsPercentageRegex, "gis"), + value: "PerSpe" + }, { + regExp: recognizersText.RegExpUtility.getSafeRegExp(japaneseNumeric.JapaneseNumeric.FoldsPercentageRegex, "gis"), + value: "PerSpe" + }, { + regExp: recognizersText.RegExpUtility.getSafeRegExp(japaneseNumeric.JapaneseNumeric.SimpleFoldsPercentageRegex, "gis"), + value: "PerSpe" + }, { + regExp: recognizersText.RegExpUtility.getSafeRegExp(japaneseNumeric.JapaneseNumeric.SpecialsPercentageRegex, "gis"), + value: "PerSpe" + }, { + regExp: recognizersText.RegExpUtility.getSafeRegExp(japaneseNumeric.JapaneseNumeric.NumbersSpecialsPercentageRegex, "gis"), + value: "PerSpe" + }, { + regExp: recognizersText.RegExpUtility.getSafeRegExp(japaneseNumeric.JapaneseNumeric.SimpleSpecialsPercentageRegex, "gis"), + value: "PerSpe" + }, { + regExp: recognizersText.RegExpUtility.getSafeRegExp(japaneseNumeric.JapaneseNumeric.SpecialsFoldsPercentageRegex, "gis"), + value: "PerSpe" + }); + this.regexes = regexes; + } +} +exports.JapanesePercentageExtractor = JapanesePercentageExtractor; + +}); + +unwrapExports(extractors$14); + +var numberRecognizer = createCommonjsModule(function (module, exports) { +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); + + + + + + + + + + + + + + + + +var NumberOptions; +(function (NumberOptions) { + NumberOptions[NumberOptions["None"] = 0] = "None"; +})(NumberOptions = exports.NumberOptions || (exports.NumberOptions = {})); +function recognizeNumber(query, culture, options = NumberOptions.None, fallbackToDefaultCulture = true) { + return recognizeByModel(recognizer => recognizer.getNumberModel(culture, fallbackToDefaultCulture), query, culture, options); +} +exports.recognizeNumber = recognizeNumber; +function recognizeOrdinal(query, culture, options = NumberOptions.None, fallbackToDefaultCulture = true) { + return recognizeByModel(recognizer => recognizer.getOrdinalModel(culture, fallbackToDefaultCulture), query, culture, options); +} +exports.recognizeOrdinal = recognizeOrdinal; +function recognizePercentage(query, culture, options = NumberOptions.None, fallbackToDefaultCulture = true) { + return recognizeByModel(recognizer => recognizer.getPercentageModel(culture, fallbackToDefaultCulture), query, culture, options); +} +exports.recognizePercentage = recognizePercentage; +function recognizeByModel(getModelFunc, query, culture, options) { + let recognizer = new NumberRecognizer(culture, options); + let model = getModelFunc(recognizer); + return model.parse(query); +} +class NumberRecognizer extends recognizersText.Recognizer { + constructor(culture, options = NumberOptions.None, lazyInitialization = false) { + super(culture, options, lazyInitialization); + } + InitializeConfiguration() { + //#region English + this.registerModel("NumberModel", culture$2.Culture.English, (options) => new models$2.NumberModel(agnosticNumberParser.AgnosticNumberParserFactory.getParser(agnosticNumberParser.AgnosticNumberParserType.Number, new parserConfiguration.EnglishNumberParserConfiguration()), new extractors$2.EnglishNumberExtractor(models$2.NumberMode.PureNumber))); + this.registerModel("OrdinalModel", culture$2.Culture.English, (options) => new models$2.OrdinalModel(agnosticNumberParser.AgnosticNumberParserFactory.getParser(agnosticNumberParser.AgnosticNumberParserType.Ordinal, new parserConfiguration.EnglishNumberParserConfiguration()), new extractors$2.EnglishOrdinalExtractor())); + this.registerModel("PercentModel", culture$2.Culture.English, (options) => new models$2.PercentModel(agnosticNumberParser.AgnosticNumberParserFactory.getParser(agnosticNumberParser.AgnosticNumberParserType.Percentage, new parserConfiguration.EnglishNumberParserConfiguration()), new extractors$2.EnglishPercentageExtractor())); + //#endregion + //#region Spanish + this.registerModel("NumberModel", culture$2.Culture.Spanish, (options) => new models$2.NumberModel(agnosticNumberParser.AgnosticNumberParserFactory.getParser(agnosticNumberParser.AgnosticNumberParserType.Number, new parserConfiguration$2.SpanishNumberParserConfiguration()), new extractors$6.SpanishNumberExtractor(models$2.NumberMode.PureNumber))); + this.registerModel("OrdinalModel", culture$2.Culture.Spanish, (options) => new models$2.OrdinalModel(agnosticNumberParser.AgnosticNumberParserFactory.getParser(agnosticNumberParser.AgnosticNumberParserType.Ordinal, new parserConfiguration$2.SpanishNumberParserConfiguration()), new extractors$6.SpanishOrdinalExtractor())); + this.registerModel("PercentModel", culture$2.Culture.Spanish, (options) => new models$2.PercentModel(agnosticNumberParser.AgnosticNumberParserFactory.getParser(agnosticNumberParser.AgnosticNumberParserType.Percentage, new parserConfiguration$2.SpanishNumberParserConfiguration()), new extractors$6.SpanishPercentageExtractor())); + //#endregion + //#region Portuguese + this.registerModel("NumberModel", culture$2.Culture.Portuguese, (options) => new models$2.NumberModel(agnosticNumberParser.AgnosticNumberParserFactory.getParser(agnosticNumberParser.AgnosticNumberParserType.Number, new parserConfiguration$4.PortugueseNumberParserConfiguration()), new extractors$8.PortugueseNumberExtractor(models$2.NumberMode.PureNumber))); + this.registerModel("OrdinalModel", culture$2.Culture.Portuguese, (options) => new models$2.OrdinalModel(agnosticNumberParser.AgnosticNumberParserFactory.getParser(agnosticNumberParser.AgnosticNumberParserType.Ordinal, new parserConfiguration$4.PortugueseNumberParserConfiguration()), new extractors$8.PortugueseOrdinalExtractor())); + this.registerModel("PercentModel", culture$2.Culture.Portuguese, (options) => new models$2.PercentModel(agnosticNumberParser.AgnosticNumberParserFactory.getParser(agnosticNumberParser.AgnosticNumberParserType.Percentage, new parserConfiguration$4.PortugueseNumberParserConfiguration()), new extractors$8.PortuguesePercentageExtractor())); + //#endregion + //#region Chinese + this.registerModel("NumberModel", culture$2.Culture.Chinese, (options) => new models$2.NumberModel(agnosticNumberParser.AgnosticNumberParserFactory.getParser(agnosticNumberParser.AgnosticNumberParserType.Number, new parserConfiguration$8.ChineseNumberParserConfiguration()), new extractors$12.ChineseNumberExtractor())); + this.registerModel("OrdinalModel", culture$2.Culture.Chinese, (options) => new models$2.OrdinalModel(agnosticNumberParser.AgnosticNumberParserFactory.getParser(agnosticNumberParser.AgnosticNumberParserType.Ordinal, new parserConfiguration$8.ChineseNumberParserConfiguration()), new extractors$12.ChineseOrdinalExtractor())); + this.registerModel("PercentModel", culture$2.Culture.Chinese, (options) => new models$2.PercentModel(agnosticNumberParser.AgnosticNumberParserFactory.getParser(agnosticNumberParser.AgnosticNumberParserType.Percentage, new parserConfiguration$8.ChineseNumberParserConfiguration()), new extractors$12.ChinesePercentageExtractor())); + //#endregion + //#region Japanese + this.registerModel("NumberModel", culture$2.Culture.Japanese, (options) => new models$2.NumberModel(agnosticNumberParser.AgnosticNumberParserFactory.getParser(agnosticNumberParser.AgnosticNumberParserType.Number, new parserConfiguration$10.JapaneseNumberParserConfiguration()), new extractors$14.JapaneseNumberExtractor())); + this.registerModel("OrdinalModel", culture$2.Culture.Japanese, (options) => new models$2.OrdinalModel(agnosticNumberParser.AgnosticNumberParserFactory.getParser(agnosticNumberParser.AgnosticNumberParserType.Ordinal, new parserConfiguration$10.JapaneseNumberParserConfiguration()), new extractors$14.JapaneseOrdinalExtractor())); + this.registerModel("PercentModel", culture$2.Culture.Japanese, (options) => new models$2.PercentModel(agnosticNumberParser.AgnosticNumberParserFactory.getParser(agnosticNumberParser.AgnosticNumberParserType.Percentage, new parserConfiguration$10.JapaneseNumberParserConfiguration()), new extractors$14.JapanesePercentageExtractor())); + //#endregion + //#region French + this.registerModel("NumberModel", culture$2.Culture.French, (options) => new models$2.NumberModel(agnosticNumberParser.AgnosticNumberParserFactory.getParser(agnosticNumberParser.AgnosticNumberParserType.Number, new parserConfiguration$6.FrenchNumberParserConfiguration()), new extractors$10.FrenchNumberExtractor(models$2.NumberMode.PureNumber))); + this.registerModel("OrdinalModel", culture$2.Culture.French, (options) => new models$2.OrdinalModel(agnosticNumberParser.AgnosticNumberParserFactory.getParser(agnosticNumberParser.AgnosticNumberParserType.Ordinal, new parserConfiguration$6.FrenchNumberParserConfiguration()), new extractors$10.FrenchOrdinalExtractor())); + this.registerModel("PercentModel", culture$2.Culture.French, (options) => new models$2.PercentModel(agnosticNumberParser.AgnosticNumberParserFactory.getParser(agnosticNumberParser.AgnosticNumberParserType.Percentage, new parserConfiguration$6.FrenchNumberParserConfiguration()), new extractors$10.FrenchPercentageExtractor())); + //#endregion + } + IsValidOptions(options) { + return options >= 0 && options <= NumberOptions.None; + } + getNumberModel(culture = null, fallbackToDefaultCulture = true) { + return this.getModel("NumberModel", culture, fallbackToDefaultCulture); + } + getOrdinalModel(culture = null, fallbackToDefaultCulture = true) { + return this.getModel("OrdinalModel", culture, fallbackToDefaultCulture); + } + getPercentageModel(culture = null, fallbackToDefaultCulture = true) { + return this.getModel("PercentModel", culture, fallbackToDefaultCulture); + } +} +exports.default = NumberRecognizer; + +}); + +unwrapExports(numberRecognizer); + +var recognizersTextNumber = createCommonjsModule(function (module, exports) { +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); + +exports.NumberRecognizer = numberRecognizer.default; +exports.NumberOptions = numberRecognizer.NumberOptions; +exports.recognizeNumber = numberRecognizer.recognizeNumber; +exports.recognizeOrdinal = numberRecognizer.recognizeOrdinal; +exports.recognizePercentage = numberRecognizer.recognizePercentage; + +exports.Culture = culture$2.Culture; +exports.CultureInfo = culture$2.CultureInfo; + +exports.FormatUtility = recognizersText.FormatUtility; +exports.StringUtility = recognizersText.StringUtility; +exports.Match = recognizersText.Match; +exports.RegExpUtility = recognizersText.RegExpUtility; + +exports.BaseNumbers = baseNumbers.BaseNumbers; + +exports.EnglishNumeric = englishNumeric.EnglishNumeric; + +exports.SpanishNumeric = spanishNumeric.SpanishNumeric; + +exports.FrenchNumeric = frenchNumeric.FrenchNumeric; + +exports.ChineseNumeric = chineseNumeric.ChineseNumeric; + +exports.JapaneseNumeric = japaneseNumeric.JapaneseNumeric; + +exports.Constants = constants.Constants; + +exports.BaseNumberExtractor = extractors$4.BaseNumberExtractor; +exports.BasePercentageExtractor = extractors$4.BasePercentageExtractor; + +exports.NumberMode = models$2.NumberMode; +exports.LongFormatType = models$2.LongFormatType; +exports.AbstractNumberModel = models$2.AbstractNumberModel; +exports.NumberModel = models$2.NumberModel; +exports.OrdinalModel = models$2.OrdinalModel; +exports.PercentModel = models$2.PercentModel; + +exports.AgnosticNumberParserType = agnosticNumberParser.AgnosticNumberParserType; +exports.AgnosticNumberParserFactory = agnosticNumberParser.AgnosticNumberParserFactory; + +exports.BaseNumberParser = parsers$2.BaseNumberParser; +exports.BasePercentageParser = parsers$2.BasePercentageParser; + +exports.EnglishCardinalExtractor = extractors$2.EnglishCardinalExtractor; +exports.EnglishDoubleExtractor = extractors$2.EnglishDoubleExtractor; +exports.EnglishFractionExtractor = extractors$2.EnglishFractionExtractor; +exports.EnglishIntegerExtractor = extractors$2.EnglishIntegerExtractor; +exports.EnglishNumberExtractor = extractors$2.EnglishNumberExtractor; +exports.EnglishOrdinalExtractor = extractors$2.EnglishOrdinalExtractor; +exports.EnglishPercentageExtractor = extractors$2.EnglishPercentageExtractor; + +exports.EnglishNumberParserConfiguration = parserConfiguration.EnglishNumberParserConfiguration; + +exports.SpanishCardinalExtractor = extractors$6.SpanishCardinalExtractor; +exports.SpanishDoubleExtractor = extractors$6.SpanishDoubleExtractor; +exports.SpanishFractionExtractor = extractors$6.SpanishFractionExtractor; +exports.SpanishIntegerExtractor = extractors$6.SpanishIntegerExtractor; +exports.SpanishNumberExtractor = extractors$6.SpanishNumberExtractor; +exports.SpanishOrdinalExtractor = extractors$6.SpanishOrdinalExtractor; +exports.SpanishPercentageExtractor = extractors$6.SpanishPercentageExtractor; + +exports.SpanishNumberParserConfiguration = parserConfiguration$2.SpanishNumberParserConfiguration; + +exports.PortugueseCardinalExtractor = extractors$8.PortugueseCardinalExtractor; +exports.PortugueseDoubleExtractor = extractors$8.PortugueseDoubleExtractor; +exports.PortugueseFractionExtractor = extractors$8.PortugueseFractionExtractor; +exports.PortugueseIntegerExtractor = extractors$8.PortugueseIntegerExtractor; +exports.PortugueseNumberExtractor = extractors$8.PortugueseNumberExtractor; +exports.PortugueseOrdinalExtractor = extractors$8.PortugueseOrdinalExtractor; +exports.PortuguesePercentageExtractor = extractors$8.PortuguesePercentageExtractor; + +exports.PortugueseNumberParserConfiguration = parserConfiguration$4.PortugueseNumberParserConfiguration; + +exports.FrenchCardinalExtractor = extractors$10.FrenchCardinalExtractor; +exports.FrenchDoubleExtractor = extractors$10.FrenchDoubleExtractor; +exports.FrenchFractionExtractor = extractors$10.FrenchFractionExtractor; +exports.FrenchIntegerExtractor = extractors$10.FrenchIntegerExtractor; +exports.FrenchNumberExtractor = extractors$10.FrenchNumberExtractor; +exports.FrenchOrdinalExtractor = extractors$10.FrenchOrdinalExtractor; +exports.FrenchPercentageExtractor = extractors$10.FrenchPercentageExtractor; + +exports.FrenchNumberParserConfiguration = parserConfiguration$6.FrenchNumberParserConfiguration; + +exports.ChineseCardinalExtractor = extractors$12.ChineseCardinalExtractor; +exports.ChineseDoubleExtractor = extractors$12.ChineseDoubleExtractor; +exports.ChineseFractionExtractor = extractors$12.ChineseFractionExtractor; +exports.ChineseIntegerExtractor = extractors$12.ChineseIntegerExtractor; +exports.ChineseNumberExtractor = extractors$12.ChineseNumberExtractor; +exports.ChineseOrdinalExtractor = extractors$12.ChineseOrdinalExtractor; +exports.ChinesePercentageExtractor = extractors$12.ChinesePercentageExtractor; +exports.ChineseNumberExtractorMode = extractors$12.ChineseNumberExtractorMode; + +exports.ChineseNumberParserConfiguration = parserConfiguration$8.ChineseNumberParserConfiguration; + +exports.JapaneseCardinalExtractor = extractors$14.JapaneseCardinalExtractor; +exports.JapaneseDoubleExtractor = extractors$14.JapaneseDoubleExtractor; +exports.JapaneseFractionExtractor = extractors$14.JapaneseFractionExtractor; +exports.JapaneseIntegerExtractor = extractors$14.JapaneseIntegerExtractor; +exports.JapaneseNumberExtractor = extractors$14.JapaneseNumberExtractor; +exports.JapaneseOrdinalExtractor = extractors$14.JapaneseOrdinalExtractor; +exports.JapanesePercentageExtractor = extractors$14.JapanesePercentageExtractor; +exports.JapaneseNumberExtractorMode = extractors$14.JapaneseNumberExtractorMode; + +exports.JapaneseNumberParserConfiguration = parserConfiguration$10.JapaneseNumberParserConfiguration; + +}); + +unwrapExports(recognizersTextNumber); + +var models$4 = createCommonjsModule(function (module, exports) { +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); + +class DateTimeModelResult extends recognizersText.ModelResult { +} +exports.DateTimeModelResult = DateTimeModelResult; +class DateTimeModel { + constructor(parser, extractor) { + this.modelTypeName = "datetime"; + this.extractor = extractor; + this.parser = parser; + } + parse(query, referenceDate = new Date()) { + query = recognizersText.FormatUtility.preProcess(query); + let extractResults = this.extractor.extract(query, referenceDate); + let parseDates = new Array(); + for (let result of extractResults) { + let parseResult = this.parser.parse(result, referenceDate); + if (Array.isArray(parseResult.value)) { + parseDates.push(...parseResult.value); + } + else { + parseDates.push(parseResult); + } + } + return parseDates + .map(o => ({ + start: o.start, + end: o.start + o.length - 1, + resolution: o.value, + text: o.text, + typeName: o.type + })); + } +} +exports.DateTimeModel = DateTimeModel; + +}); + +unwrapExports(models$4); + +var baseDateTime = createCommonjsModule(function (module, exports) { +"use strict"; +// ------------------------------------------------------------------------------ +// +// This code was generated by a tool. +// Changes to this file may cause incorrect behavior and will be lost if +// the code is regenerated. +// +// ------------------------------------------------------------------------------ +Object.defineProperty(exports, "__esModule", { value: true }); +var BaseDateTime; +(function (BaseDateTime) { + BaseDateTime.HourRegex = `(?00|01|02|03|04|05|06|07|08|09|0|10|11|12|13|14|15|16|17|18|19|20|21|22|23|24|1|2|3|4|5|6|7|8|9)(h)?`; + BaseDateTime.MinuteRegex = `(?00|01|02|03|04|05|06|07|08|09|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|0|1|2|3|4|5|6|7|8|9)(?!\\d)`; + BaseDateTime.DeltaMinuteRegex = `(?00|01|02|03|04|05|06|07|08|09|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|0|1|2|3|4|5|6|7|8|9)`; + BaseDateTime.SecondRegex = `(?00|01|02|03|04|05|06|07|08|09|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|0|1|2|3|4|5|6|7|8|9)`; + BaseDateTime.FourDigitYearRegex = `\\b(?((1\\d|20)\\d{2})|2100)(?!\\.0\\b)\\b`; + BaseDateTime.IllegalYearRegex = `([-])(${BaseDateTime.FourDigitYearRegex})([-])`; + BaseDateTime.MinYearNum = '1500'; + BaseDateTime.MaxYearNum = '2100'; + BaseDateTime.MaxTwoDigitYearFutureNum = '30'; + BaseDateTime.MinTwoDigitYearPastNum = '70'; + BaseDateTime.DayOfMonthDictionary = new Map([["1", 1], ["2", 2], ["3", 3], ["4", 4], ["5", 5], ["6", 6], ["7", 7], ["8", 8], ["9", 9], ["10", 10], ["11", 11], ["12", 12], ["13", 13], ["14", 14], ["15", 15], ["16", 16], ["17", 17], ["18", 18], ["19", 19], ["20", 20], ["21", 21], ["22", 22], ["23", 23], ["24", 24], ["25", 25], ["26", 26], ["27", 27], ["28", 28], ["29", 29], ["30", 30], ["31", 31], ["01", 1], ["02", 2], ["03", 3], ["04", 4], ["05", 5], ["06", 6], ["07", 7], ["08", 8], ["09", 9]]); + BaseDateTime.VariableHolidaysTimexDictionary = new Map([["fathers", "-06-WXX-7-3"], ["mothers", "-05-WXX-7-2"], ["thanksgiving", "-11-WXX-4-4"], ["martinlutherking", "-01-WXX-1-3"], ["washingtonsbirthday", "-02-WXX-1-3"], ["canberra", "-03-WXX-1-1"], ["labour", "-09-WXX-1-1"], ["columbus", "-10-WXX-1-2"], ["memorial", "-05-WXX-1-4"]]); +})(BaseDateTime = exports.BaseDateTime || (exports.BaseDateTime = {})); + +}); + +unwrapExports(baseDateTime); + +var constants$2 = createCommonjsModule(function (module, exports) { +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); + +class Constants { +} +Constants.SYS_DATETIME_DATE = "date"; +Constants.SYS_DATETIME_TIME = "time"; +Constants.SYS_DATETIME_DATEPERIOD = "daterange"; +Constants.SYS_DATETIME_DATETIME = "datetime"; +Constants.SYS_DATETIME_TIMEPERIOD = "timerange"; +Constants.SYS_DATETIME_DATETIMEPERIOD = "datetimerange"; +Constants.SYS_DATETIME_DURATION = "duration"; +Constants.SYS_DATETIME_SET = "set"; +// key +Constants.TimexKey = "timex"; +Constants.ModKey = "Mod"; +Constants.TypeKey = "type"; +Constants.IsLunarKey = "isLunar"; +Constants.ResolveKey = "resolve"; +Constants.ResolveToPastKey = "resolveToPast"; +Constants.ResolveToFutureKey = "resolveToFuture"; +Constants.CommentKey = "Comment"; +Constants.CommentAmPm = "ampm"; +Constants.SemesterMonthCount = 6; +Constants.TrimesterMonthCount = 3; +Constants.FourDigitsYearLength = 4; +Constants.DefaultLanguageFallback_MDY = 'MDY'; +Constants.DefaultLanguageFallback_DMY = 'DMY'; +Constants.MinYearNum = parseInt(baseDateTime.BaseDateTime.MinYearNum); +Constants.MaxYearNum = parseInt(baseDateTime.BaseDateTime.MaxYearNum); +Constants.MaxTwoDigitYearFutureNum = parseInt(baseDateTime.BaseDateTime.MaxTwoDigitYearFutureNum); +Constants.MinTwoDigitYearPastNum = parseInt(baseDateTime.BaseDateTime.MinTwoDigitYearPastNum); +// Mod Value +// "before" -> To mean "preceding in time". I.e. Does not include the extracted datetime entity in the resolution's ending point. Equivalent to "<" +Constants.BEFORE_MOD = 'before'; +// "after" -> To mean "following in time". I.e. Does not include the extracted datetime entity in the resolution's starting point. Equivalent to ">" +Constants.AFTER_MOD = 'after'; +// "since" -> Same as "after", but including the extracted datetime entity. Equivalent to ">=" +Constants.SINCE_MOD = 'since'; +// "until" -> Same as "before", but including the extracted datetime entity. Equivalent to "<=" +Constants.UNTIL_MOD = 'until'; +Constants.EARLY_MOD = 'start'; +Constants.MID_MOD = 'mid'; +Constants.LATE_MOD = 'end'; +Constants.MORE_THAN_MOD = 'more'; +Constants.LESS_THAN_MOD = 'less'; +Constants.REF_UNDEF_MOD = 'ref_undef'; +exports.Constants = Constants; +class TimeTypeConstants { +} +TimeTypeConstants.DATE = "date"; +TimeTypeConstants.START_DATE = "startDate"; +TimeTypeConstants.END_DATE = "endDate"; +TimeTypeConstants.DATETIME = "dateTime"; +TimeTypeConstants.START_DATETIME = "startDateTime"; +TimeTypeConstants.END_DATETIME = "endDateTime"; +TimeTypeConstants.DURATION = "duration"; +TimeTypeConstants.SET = "set"; +TimeTypeConstants.TIME = "time"; +TimeTypeConstants.VALUE = "value"; +TimeTypeConstants.START_TIME = "startTime"; +TimeTypeConstants.END_TIME = "endTime"; +TimeTypeConstants.START = "start"; +TimeTypeConstants.END = "end"; +TimeTypeConstants.beforeMod = "before"; +TimeTypeConstants.afterMod = "after"; +TimeTypeConstants.sinceMod = "since"; +TimeTypeConstants.moreThanMod = "more"; +TimeTypeConstants.lessThanMod = "less"; +exports.TimeTypeConstants = TimeTypeConstants; + +}); + +unwrapExports(constants$2); + +var utilities$2 = createCommonjsModule(function (module, exports) { +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); + + +class Token { + constructor(start, end) { + this.start = start; + this.end = end; + } + get length() { + return this.end - this.start; + } + static mergeAllTokens(tokens, source, extractorName) { + let ret = []; + let mergedTokens = []; + tokens = tokens.sort((a, b) => { return a.start < b.start ? -1 : 1; }); + tokens.forEach(token => { + if (token) { + let bAdd = true; + for (let index = 0; index < mergedTokens.length && bAdd; index++) { + let mergedToken = mergedTokens[index]; + if (token.start >= mergedToken.start && token.end <= mergedToken.end) { + bAdd = false; + } + if (token.start > mergedToken.start && token.start < mergedToken.end) { + bAdd = false; + } + if (token.start <= mergedToken.start && token.end >= mergedToken.end) { + bAdd = false; + mergedTokens[index] = token; + } + } + if (bAdd) { + mergedTokens.push(token); + } + } + }); + mergedTokens.forEach(token => { + ret.push({ + start: token.start, + length: token.length, + text: source.substr(token.start, token.length), + type: extractorName + }); + }); + return ret; + } +} +exports.Token = Token; +var AgoLaterMode; +(function (AgoLaterMode) { + AgoLaterMode[AgoLaterMode["Date"] = 0] = "Date"; + AgoLaterMode[AgoLaterMode["DateTime"] = 1] = "DateTime"; +})(AgoLaterMode = exports.AgoLaterMode || (exports.AgoLaterMode = {})); +class AgoLaterUtil { + static extractorDurationWithBeforeAndAfter(source, er, ret, config) { + let pos = er.start + er.length; + if (pos <= source.length) { + let afterString = source.substring(pos); + let beforeString = source.substring(0, er.start); + let value = MatchingUtil.getAgoLaterIndex(afterString, config.agoRegex); + if (value.matched) { + ret.push(new Token(er.start, er.start + er.length + value.index)); + } + else { + value = MatchingUtil.getAgoLaterIndex(afterString, config.laterRegex); + if (value.matched) { + ret.push(new Token(er.start, er.start + er.length + value.index)); + } + else { + value = MatchingUtil.getInIndex(beforeString, config.inConnectorRegex); + // for range unit like "week, month, year", it should output dateRange or datetimeRange + if (recognizersText.RegExpUtility.getMatches(config.rangeUnitRegex, er.text).length > 0) + return ret; + if (value.matched && er.start && er.length && er.start >= value.index) { + ret.push(new Token(er.start - value.index, er.start + er.length)); + } + } + } + } + return ret; + } + static parseDurationWithAgoAndLater(source, referenceDate, durationExtractor, durationParser, unitMap, unitRegex, utilityConfiguration, mode) { + let result = new DateTimeResolutionResult(); + let duration = durationExtractor.extract(source, referenceDate).pop(); + if (!duration) + return result; + let pr = durationParser.parse(duration, referenceDate); + if (!pr) + return result; + let match = recognizersText.RegExpUtility.getMatches(unitRegex, source).pop(); + if (!match) + return result; + let afterStr = source.substr(duration.start + duration.length); + let beforeStr = source.substr(0, duration.start); + let srcUnit = match.groups('unit').value; + let durationResult = pr.value; + let numStr = durationResult.timex.substr(0, durationResult.timex.length - 1) + .replace('P', '') + .replace('T', ''); + let num = Number.parseInt(numStr, 10); + if (!num) + return result; + return AgoLaterUtil.getAgoLaterResult(pr, num, unitMap, srcUnit, afterStr, beforeStr, referenceDate, utilityConfiguration, mode); + } + static getAgoLaterResult(durationParseResult, num, unitMap, srcUnit, afterStr, beforeStr, referenceDate, utilityConfiguration, mode) { + let result = new DateTimeResolutionResult(); + let unitStr = unitMap.get(srcUnit); + if (!unitStr) + return result; + let numStr = num.toString(); + let containsAgo = MatchingUtil.containsAgoLaterIndex(afterStr, utilityConfiguration.agoRegex); + let containsLaterOrIn = MatchingUtil.containsAgoLaterIndex(afterStr, utilityConfiguration.laterRegex) || MatchingUtil.containsInIndex(beforeStr, utilityConfiguration.inConnectorRegex); + if (containsAgo) { + result = AgoLaterUtil.getDateResult(unitStr, num, referenceDate, false, mode); + durationParseResult.value.mod = constants$2.TimeTypeConstants.beforeMod; + result.subDateTimeEntities = [durationParseResult]; + return result; + } + if (containsLaterOrIn) { + result = AgoLaterUtil.getDateResult(unitStr, num, referenceDate, true, mode); + durationParseResult.value.mod = constants$2.TimeTypeConstants.afterMod; + result.subDateTimeEntities = [durationParseResult]; + return result; + } + return result; + } + static getDateResult(unitStr, num, referenceDate, isFuture, mode) { + let value = new Date(referenceDate); + let result = new DateTimeResolutionResult(); + let swift = isFuture ? 1 : -1; + switch (unitStr) { + case 'D': + value.setDate(referenceDate.getDate() + (num * swift)); + break; + case 'W': + value.setDate(referenceDate.getDate() + (num * swift * 7)); + break; + case 'MON': + value.setMonth(referenceDate.getMonth() + (num * swift)); + break; + case 'Y': + value.setFullYear(referenceDate.getFullYear() + (num * swift)); + break; + case 'H': + value.setHours(referenceDate.getHours() + (num * swift)); + break; + case 'M': + value.setMinutes(referenceDate.getMinutes() + (num * swift)); + break; + case 'S': + value.setSeconds(referenceDate.getSeconds() + (num * swift)); + break; + default: return result; + } + result.timex = mode === AgoLaterMode.Date ? FormatUtil.luisDateFromDate(value) : FormatUtil.luisDateTime(value); + result.futureValue = value; + result.pastValue = value; + result.success = true; + return result; + } +} +exports.AgoLaterUtil = AgoLaterUtil; +class MatchingUtil { + static getAgoLaterIndex(source, regex) { + let result = { matched: false, index: -1 }; + let referencedMatches = recognizersText.RegExpUtility.getMatches(regex, source.trim().toLowerCase()); + if (referencedMatches && referencedMatches.length > 0 && referencedMatches[0].index === 0) { + result.index = source.toLowerCase().indexOf(referencedMatches[0].value) + referencedMatches[0].length; + result.matched = true; + } + return result; + } + static getInIndex(source, regex) { + let result = { matched: false, index: -1 }; + let referencedMatch = recognizersText.RegExpUtility.getMatches(regex, source.trim().toLowerCase().split(' ').pop()); + if (referencedMatch && referencedMatch.length > 0) { + result.index = source.length - source.toLowerCase().lastIndexOf(referencedMatch[0].value); + result.matched = true; + } + return result; + } + static containsAgoLaterIndex(source, regex) { + return this.getAgoLaterIndex(source, regex).matched; + } + static containsInIndex(source, regex) { + return this.getInIndex(source, regex).matched; + } +} +exports.MatchingUtil = MatchingUtil; +class FormatUtil { + // Emulates .NET ToString("D{size}") + static toString(num, size) { + let s = "000000" + (num || ""); + return s.substr(s.length - size); + } + static luisDate(year, month, day) { + if (year === -1) { + if (month === -1) { + return new Array("XXXX", "XX", FormatUtil.toString(day, 2)).join("-"); + } + return new Array("XXXX", FormatUtil.toString(month + 1, 2), FormatUtil.toString(day, 2)).join("-"); + } + return new Array(FormatUtil.toString(year, 4), FormatUtil.toString(month + 1, 2), FormatUtil.toString(day, 2)).join("-"); + } + static luisDateFromDate(date) { + return FormatUtil.luisDate(date.getFullYear(), date.getMonth(), date.getDate()); + } + static luisTime(hour, min, second) { + return new Array(FormatUtil.toString(hour, 2), FormatUtil.toString(min, 2), FormatUtil.toString(second, 2)).join(":"); + } + static luisTimeFromDate(time) { + return FormatUtil.luisTime(time.getHours(), time.getMinutes(), time.getSeconds()); + } + static luisDateTime(time) { + return `${FormatUtil.luisDateFromDate(time)}T${FormatUtil.luisTimeFromDate(time)}`; + } + static formatDate(date) { + return new Array(FormatUtil.toString(date.getFullYear(), 4), FormatUtil.toString(date.getMonth() + 1, 2), FormatUtil.toString(date.getDate(), 2)).join("-"); + } + static formatTime(time) { + return new Array(FormatUtil.toString(time.getHours(), 2), FormatUtil.toString(time.getMinutes(), 2), FormatUtil.toString(time.getSeconds(), 2)).join(":"); + } + static formatDateTime(datetime) { + return `${FormatUtil.formatDate(datetime)} ${FormatUtil.formatTime(datetime)}`; + } + static shortTime(hour, minute, second) { + if (minute < 0 && second < 0) { + return `T${FormatUtil.toString(hour, 2)}`; + } + else if (second < 0) { + return `T${FormatUtil.toString(hour, 2)}:${FormatUtil.toString(minute, 2)}`; + } + return `T${FormatUtil.toString(hour, 2)}:${FormatUtil.toString(minute, 2)}:${FormatUtil.toString(second, 2)}`; + } + static luisTimeSpan(from, to) { + let result = 'PT'; + let span = DateUtils.totalHoursFloor(from, to); + if (span > 0) { + result = `${result}${span}H`; + } + span = DateUtils.totalMinutesFloor(from, to) - (span * 60); + if (span > 0 && span < 60) { + result = `${result}${span}M`; + } + span = DateUtils.totalSeconds(from, to) - (span * 60); + if (span > 0 && span < 60) { + result = `${result}${span}S`; + } + return result; + } + static allStringToPm(timeStr) { + let matches = recognizersText.RegExpUtility.getMatches(FormatUtil.HourTimexRegex, timeStr); + let split = Array(); + let lastPos = 0; + matches.forEach(match => { + if (lastPos !== match.index) + split.push(timeStr.substring(lastPos, match.index)); + split.push(timeStr.substring(match.index, match.index + match.length)); + lastPos = match.index + match.length; + }); + if (timeStr.substring(lastPos)) { + split.push(timeStr.substring(lastPos)); + } + for (let i = 0; i < split.length; i += 1) { + if (recognizersText.RegExpUtility.getMatches(FormatUtil.HourTimexRegex, split[i]).length > 0) { + split[i] = FormatUtil.toPm(split[i]); + } + } + return split.join(''); + } + static toPm(timeStr) { + let hasT = false; + if (timeStr.startsWith("T")) { + hasT = true; + timeStr = timeStr.substring(1); + } + let split = timeStr.split(':'); + let hour = parseInt(split[0], 10); + hour = (hour === 12) ? 0 : hour + 12; + split[0] = FormatUtil.toString(hour, 2); + return (hasT ? "T" : "") + split.join(":"); + } +} +FormatUtil.HourTimexRegex = recognizersText.RegExpUtility.getSafeRegExp(String.raw `(?= 12) { + year += (month + 1) / 12; + month %= 12; + } + return this.safeCreateFromMinValue(year, month, day); + } + static safeCreateFromMinValueWithDateAndTime(date, time) { + return this.safeCreateFromMinValue(date.getFullYear(), date.getMonth(), date.getDate(), time ? time.getHours() : 0, time ? time.getMinutes() : 0, time ? time.getSeconds() : 0); + } + static isLeapYear(year) { + return ((year % 4 === 0) && (year % 100 !== 0)) || (year % 400 === 0); + } + static dayOfYear(date) { + let start = new Date(date.getFullYear(), 0, 1); + let diffDays = date.valueOf() - start.valueOf(); + return Math.floor(diffDays / DateUtils.oneDay); + } + static validDays(year) { return [31, this.isLeapYear(year) ? 29 : 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31]; } + static isValidDate(year, month, day) { + return year > 0 && year <= 9999 + && month >= 0 && month < 12 + && day > 0 && day <= this.validDays(year)[month]; + } + static isValidTime(hour, minute, second) { + return hour >= 0 && hour < 24 + && minute >= 0 && minute < 60 + && second >= 0 && minute < 60; + } +} +DateUtils.oneDay = 24 * 60 * 60 * 1000; +DateUtils.oneHour = 60 * 60 * 1000; +DateUtils.oneMinute = 60 * 1000; +DateUtils.oneSecond = 1000; +exports.DateUtils = DateUtils; + +}); + +unwrapExports(utilities$2); + +var lodash_isequal = createCommonjsModule(function (module, exports) { +/** + * Lodash (Custom Build) + * Build: `lodash modularize exports="npm" -o ./` + * Copyright JS Foundation and other contributors + * Released under MIT license + * Based on Underscore.js 1.8.3 + * Copyright Jeremy Ashkenas, DocumentCloud and Investigative Reporters & Editors + */ + +/** Used as the size to enable large array optimizations. */ +var LARGE_ARRAY_SIZE = 200; + +/** Used to stand-in for `undefined` hash values. */ +var HASH_UNDEFINED = '__lodash_hash_undefined__'; + +/** Used to compose bitmasks for value comparisons. */ +var COMPARE_PARTIAL_FLAG = 1, + COMPARE_UNORDERED_FLAG = 2; + +/** Used as references for various `Number` constants. */ +var MAX_SAFE_INTEGER = 9007199254740991; + +/** `Object#toString` result references. */ +var argsTag = '[object Arguments]', + arrayTag = '[object Array]', + asyncTag = '[object AsyncFunction]', + boolTag = '[object Boolean]', + dateTag = '[object Date]', + errorTag = '[object Error]', + funcTag = '[object Function]', + genTag = '[object GeneratorFunction]', + mapTag = '[object Map]', + numberTag = '[object Number]', + nullTag = '[object Null]', + objectTag = '[object Object]', + promiseTag = '[object Promise]', + proxyTag = '[object Proxy]', + regexpTag = '[object RegExp]', + setTag = '[object Set]', + stringTag = '[object String]', + symbolTag = '[object Symbol]', + undefinedTag = '[object Undefined]', + weakMapTag = '[object WeakMap]'; + +var arrayBufferTag = '[object ArrayBuffer]', + dataViewTag = '[object DataView]', + float32Tag = '[object Float32Array]', + float64Tag = '[object Float64Array]', + int8Tag = '[object Int8Array]', + int16Tag = '[object Int16Array]', + int32Tag = '[object Int32Array]', + uint8Tag = '[object Uint8Array]', + uint8ClampedTag = '[object Uint8ClampedArray]', + uint16Tag = '[object Uint16Array]', + uint32Tag = '[object Uint32Array]'; + +/** + * Used to match `RegExp` + * [syntax characters](http://ecma-international.org/ecma-262/7.0/#sec-patterns). + */ +var reRegExpChar = /[\\^$.*+?()[\]{}|]/g; + +/** Used to detect host constructors (Safari). */ +var reIsHostCtor = /^\[object .+?Constructor\]$/; + +/** Used to detect unsigned integer values. */ +var reIsUint = /^(?:0|[1-9]\d*)$/; + +/** Used to identify `toStringTag` values of typed arrays. */ +var typedArrayTags = {}; +typedArrayTags[float32Tag] = typedArrayTags[float64Tag] = +typedArrayTags[int8Tag] = typedArrayTags[int16Tag] = +typedArrayTags[int32Tag] = typedArrayTags[uint8Tag] = +typedArrayTags[uint8ClampedTag] = typedArrayTags[uint16Tag] = +typedArrayTags[uint32Tag] = true; +typedArrayTags[argsTag] = typedArrayTags[arrayTag] = +typedArrayTags[arrayBufferTag] = typedArrayTags[boolTag] = +typedArrayTags[dataViewTag] = typedArrayTags[dateTag] = +typedArrayTags[errorTag] = typedArrayTags[funcTag] = +typedArrayTags[mapTag] = typedArrayTags[numberTag] = +typedArrayTags[objectTag] = typedArrayTags[regexpTag] = +typedArrayTags[setTag] = typedArrayTags[stringTag] = +typedArrayTags[weakMapTag] = false; + +/** Detect free variable `global` from Node.js. */ +var freeGlobal = typeof commonjsGlobal == 'object' && commonjsGlobal && commonjsGlobal.Object === Object && commonjsGlobal; + +/** Detect free variable `self`. */ +var freeSelf = typeof self == 'object' && self && self.Object === Object && self; + +/** Used as a reference to the global object. */ +var root = freeGlobal || freeSelf || Function('return this')(); + +/** Detect free variable `exports`. */ +var freeExports = 'object' == 'object' && exports && !exports.nodeType && exports; + +/** Detect free variable `module`. */ +var freeModule = freeExports && 'object' == 'object' && module && !module.nodeType && module; + +/** Detect the popular CommonJS extension `module.exports`. */ +var moduleExports = freeModule && freeModule.exports === freeExports; + +/** Detect free variable `process` from Node.js. */ +var freeProcess = moduleExports && freeGlobal.process; + +/** Used to access faster Node.js helpers. */ +var nodeUtil = (function() { + try { + return freeProcess && freeProcess.binding && freeProcess.binding('util'); + } catch (e) {} +}()); + +/* Node.js helper references. */ +var nodeIsTypedArray = nodeUtil && nodeUtil.isTypedArray; + +/** + * A specialized version of `_.filter` for arrays without support for + * iteratee shorthands. + * + * @private + * @param {Array} [array] The array to iterate over. + * @param {Function} predicate The function invoked per iteration. + * @returns {Array} Returns the new filtered array. + */ +function arrayFilter(array, predicate) { + var index = -1, + length = array == null ? 0 : array.length, + resIndex = 0, + result = []; + + while (++index < length) { + var value = array[index]; + if (predicate(value, index, array)) { + result[resIndex++] = value; + } + } + return result; +} + +/** + * Appends the elements of `values` to `array`. + * + * @private + * @param {Array} array The array to modify. + * @param {Array} values The values to append. + * @returns {Array} Returns `array`. + */ +function arrayPush(array, values) { + var index = -1, + length = values.length, + offset = array.length; + + while (++index < length) { + array[offset + index] = values[index]; + } + return array; +} + +/** + * A specialized version of `_.some` for arrays without support for iteratee + * shorthands. + * + * @private + * @param {Array} [array] The array to iterate over. + * @param {Function} predicate The function invoked per iteration. + * @returns {boolean} Returns `true` if any element passes the predicate check, + * else `false`. + */ +function arraySome(array, predicate) { + var index = -1, + length = array == null ? 0 : array.length; + + while (++index < length) { + if (predicate(array[index], index, array)) { + return true; + } + } + return false; +} + +/** + * The base implementation of `_.times` without support for iteratee shorthands + * or max array length checks. + * + * @private + * @param {number} n The number of times to invoke `iteratee`. + * @param {Function} iteratee The function invoked per iteration. + * @returns {Array} Returns the array of results. + */ +function baseTimes(n, iteratee) { + var index = -1, + result = Array(n); + + while (++index < n) { + result[index] = iteratee(index); + } + return result; +} + +/** + * The base implementation of `_.unary` without support for storing metadata. + * + * @private + * @param {Function} func The function to cap arguments for. + * @returns {Function} Returns the new capped function. + */ +function baseUnary(func) { + return function(value) { + return func(value); + }; +} + +/** + * Checks if a `cache` value for `key` exists. + * + * @private + * @param {Object} cache The cache to query. + * @param {string} key The key of the entry to check. + * @returns {boolean} Returns `true` if an entry for `key` exists, else `false`. + */ +function cacheHas(cache, key) { + return cache.has(key); +} + +/** + * Gets the value at `key` of `object`. + * + * @private + * @param {Object} [object] The object to query. + * @param {string} key The key of the property to get. + * @returns {*} Returns the property value. + */ +function getValue(object, key) { + return object == null ? undefined : object[key]; +} + +/** + * Converts `map` to its key-value pairs. + * + * @private + * @param {Object} map The map to convert. + * @returns {Array} Returns the key-value pairs. + */ +function mapToArray(map) { + var index = -1, + result = Array(map.size); + + map.forEach(function(value, key) { + result[++index] = [key, value]; + }); + return result; +} + +/** + * Creates a unary function that invokes `func` with its argument transformed. + * + * @private + * @param {Function} func The function to wrap. + * @param {Function} transform The argument transform. + * @returns {Function} Returns the new function. + */ +function overArg(func, transform) { + return function(arg) { + return func(transform(arg)); + }; +} + +/** + * Converts `set` to an array of its values. + * + * @private + * @param {Object} set The set to convert. + * @returns {Array} Returns the values. + */ +function setToArray(set) { + var index = -1, + result = Array(set.size); + + set.forEach(function(value) { + result[++index] = value; + }); + return result; +} + +/** Used for built-in method references. */ +var arrayProto = Array.prototype, + funcProto = Function.prototype, + objectProto = Object.prototype; + +/** Used to detect overreaching core-js shims. */ +var coreJsData = root['__core-js_shared__']; + +/** Used to resolve the decompiled source of functions. */ +var funcToString = funcProto.toString; + +/** Used to check objects for own properties. */ +var hasOwnProperty = objectProto.hasOwnProperty; + +/** Used to detect methods masquerading as native. */ +var maskSrcKey = (function() { + var uid = /[^.]+$/.exec(coreJsData && coreJsData.keys && coreJsData.keys.IE_PROTO || ''); + return uid ? ('Symbol(src)_1.' + uid) : ''; +}()); + +/** + * Used to resolve the + * [`toStringTag`](http://ecma-international.org/ecma-262/7.0/#sec-object.prototype.tostring) + * of values. + */ +var nativeObjectToString = objectProto.toString; + +/** Used to detect if a method is native. */ +var reIsNative = RegExp('^' + + funcToString.call(hasOwnProperty).replace(reRegExpChar, '\\$&') + .replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g, '$1.*?') + '$' +); + +/** Built-in value references. */ +var Buffer = moduleExports ? root.Buffer : undefined, + Symbol = root.Symbol, + Uint8Array = root.Uint8Array, + propertyIsEnumerable = objectProto.propertyIsEnumerable, + splice = arrayProto.splice, + symToStringTag = Symbol ? Symbol.toStringTag : undefined; + +/* Built-in method references for those with the same name as other `lodash` methods. */ +var nativeGetSymbols = Object.getOwnPropertySymbols, + nativeIsBuffer = Buffer ? Buffer.isBuffer : undefined, + nativeKeys = overArg(Object.keys, Object); + +/* Built-in method references that are verified to be native. */ +var DataView = getNative(root, 'DataView'), + Map = getNative(root, 'Map'), + Promise = getNative(root, 'Promise'), + Set = getNative(root, 'Set'), + WeakMap = getNative(root, 'WeakMap'), + nativeCreate = getNative(Object, 'create'); + +/** Used to detect maps, sets, and weakmaps. */ +var dataViewCtorString = toSource(DataView), + mapCtorString = toSource(Map), + promiseCtorString = toSource(Promise), + setCtorString = toSource(Set), + weakMapCtorString = toSource(WeakMap); + +/** Used to convert symbols to primitives and strings. */ +var symbolProto = Symbol ? Symbol.prototype : undefined, + symbolValueOf = symbolProto ? symbolProto.valueOf : undefined; + +/** + * Creates a hash object. + * + * @private + * @constructor + * @param {Array} [entries] The key-value pairs to cache. + */ +function Hash(entries) { + var index = -1, + length = entries == null ? 0 : entries.length; + + this.clear(); + while (++index < length) { + var entry = entries[index]; + this.set(entry[0], entry[1]); + } +} + +/** + * Removes all key-value entries from the hash. + * + * @private + * @name clear + * @memberOf Hash + */ +function hashClear() { + this.__data__ = nativeCreate ? nativeCreate(null) : {}; + this.size = 0; +} + +/** + * Removes `key` and its value from the hash. + * + * @private + * @name delete + * @memberOf Hash + * @param {Object} hash The hash to modify. + * @param {string} key The key of the value to remove. + * @returns {boolean} Returns `true` if the entry was removed, else `false`. + */ +function hashDelete(key) { + var result = this.has(key) && delete this.__data__[key]; + this.size -= result ? 1 : 0; + return result; +} + +/** + * Gets the hash value for `key`. + * + * @private + * @name get + * @memberOf Hash + * @param {string} key The key of the value to get. + * @returns {*} Returns the entry value. + */ +function hashGet(key) { + var data = this.__data__; + if (nativeCreate) { + var result = data[key]; + return result === HASH_UNDEFINED ? undefined : result; + } + return hasOwnProperty.call(data, key) ? data[key] : undefined; +} + +/** + * Checks if a hash value for `key` exists. + * + * @private + * @name has + * @memberOf Hash + * @param {string} key The key of the entry to check. + * @returns {boolean} Returns `true` if an entry for `key` exists, else `false`. + */ +function hashHas(key) { + var data = this.__data__; + return nativeCreate ? (data[key] !== undefined) : hasOwnProperty.call(data, key); +} + +/** + * Sets the hash `key` to `value`. + * + * @private + * @name set + * @memberOf Hash + * @param {string} key The key of the value to set. + * @param {*} value The value to set. + * @returns {Object} Returns the hash instance. + */ +function hashSet(key, value) { + var data = this.__data__; + this.size += this.has(key) ? 0 : 1; + data[key] = (nativeCreate && value === undefined) ? HASH_UNDEFINED : value; + return this; +} + +// Add methods to `Hash`. +Hash.prototype.clear = hashClear; +Hash.prototype['delete'] = hashDelete; +Hash.prototype.get = hashGet; +Hash.prototype.has = hashHas; +Hash.prototype.set = hashSet; + +/** + * Creates an list cache object. + * + * @private + * @constructor + * @param {Array} [entries] The key-value pairs to cache. + */ +function ListCache(entries) { + var index = -1, + length = entries == null ? 0 : entries.length; + + this.clear(); + while (++index < length) { + var entry = entries[index]; + this.set(entry[0], entry[1]); + } +} + +/** + * Removes all key-value entries from the list cache. + * + * @private + * @name clear + * @memberOf ListCache + */ +function listCacheClear() { + this.__data__ = []; + this.size = 0; +} + +/** + * Removes `key` and its value from the list cache. + * + * @private + * @name delete + * @memberOf ListCache + * @param {string} key The key of the value to remove. + * @returns {boolean} Returns `true` if the entry was removed, else `false`. + */ +function listCacheDelete(key) { + var data = this.__data__, + index = assocIndexOf(data, key); + + if (index < 0) { + return false; + } + var lastIndex = data.length - 1; + if (index == lastIndex) { + data.pop(); + } else { + splice.call(data, index, 1); + } + --this.size; + return true; +} + +/** + * Gets the list cache value for `key`. + * + * @private + * @name get + * @memberOf ListCache + * @param {string} key The key of the value to get. + * @returns {*} Returns the entry value. + */ +function listCacheGet(key) { + var data = this.__data__, + index = assocIndexOf(data, key); + + return index < 0 ? undefined : data[index][1]; +} + +/** + * Checks if a list cache value for `key` exists. + * + * @private + * @name has + * @memberOf ListCache + * @param {string} key The key of the entry to check. + * @returns {boolean} Returns `true` if an entry for `key` exists, else `false`. + */ +function listCacheHas(key) { + return assocIndexOf(this.__data__, key) > -1; +} + +/** + * Sets the list cache `key` to `value`. + * + * @private + * @name set + * @memberOf ListCache + * @param {string} key The key of the value to set. + * @param {*} value The value to set. + * @returns {Object} Returns the list cache instance. + */ +function listCacheSet(key, value) { + var data = this.__data__, + index = assocIndexOf(data, key); + + if (index < 0) { + ++this.size; + data.push([key, value]); + } else { + data[index][1] = value; + } + return this; +} + +// Add methods to `ListCache`. +ListCache.prototype.clear = listCacheClear; +ListCache.prototype['delete'] = listCacheDelete; +ListCache.prototype.get = listCacheGet; +ListCache.prototype.has = listCacheHas; +ListCache.prototype.set = listCacheSet; + +/** + * Creates a map cache object to store key-value pairs. + * + * @private + * @constructor + * @param {Array} [entries] The key-value pairs to cache. + */ +function MapCache(entries) { + var index = -1, + length = entries == null ? 0 : entries.length; + + this.clear(); + while (++index < length) { + var entry = entries[index]; + this.set(entry[0], entry[1]); + } +} + +/** + * Removes all key-value entries from the map. + * + * @private + * @name clear + * @memberOf MapCache + */ +function mapCacheClear() { + this.size = 0; + this.__data__ = { + 'hash': new Hash, + 'map': new (Map || ListCache), + 'string': new Hash + }; +} + +/** + * Removes `key` and its value from the map. + * + * @private + * @name delete + * @memberOf MapCache + * @param {string} key The key of the value to remove. + * @returns {boolean} Returns `true` if the entry was removed, else `false`. + */ +function mapCacheDelete(key) { + var result = getMapData(this, key)['delete'](key); + this.size -= result ? 1 : 0; + return result; +} + +/** + * Gets the map value for `key`. + * + * @private + * @name get + * @memberOf MapCache + * @param {string} key The key of the value to get. + * @returns {*} Returns the entry value. + */ +function mapCacheGet(key) { + return getMapData(this, key).get(key); +} + +/** + * Checks if a map value for `key` exists. + * + * @private + * @name has + * @memberOf MapCache + * @param {string} key The key of the entry to check. + * @returns {boolean} Returns `true` if an entry for `key` exists, else `false`. + */ +function mapCacheHas(key) { + return getMapData(this, key).has(key); +} + +/** + * Sets the map `key` to `value`. + * + * @private + * @name set + * @memberOf MapCache + * @param {string} key The key of the value to set. + * @param {*} value The value to set. + * @returns {Object} Returns the map cache instance. + */ +function mapCacheSet(key, value) { + var data = getMapData(this, key), + size = data.size; + + data.set(key, value); + this.size += data.size == size ? 0 : 1; + return this; +} + +// Add methods to `MapCache`. +MapCache.prototype.clear = mapCacheClear; +MapCache.prototype['delete'] = mapCacheDelete; +MapCache.prototype.get = mapCacheGet; +MapCache.prototype.has = mapCacheHas; +MapCache.prototype.set = mapCacheSet; + +/** + * + * Creates an array cache object to store unique values. + * + * @private + * @constructor + * @param {Array} [values] The values to cache. + */ +function SetCache(values) { + var index = -1, + length = values == null ? 0 : values.length; + + this.__data__ = new MapCache; + while (++index < length) { + this.add(values[index]); + } +} + +/** + * Adds `value` to the array cache. + * + * @private + * @name add + * @memberOf SetCache + * @alias push + * @param {*} value The value to cache. + * @returns {Object} Returns the cache instance. + */ +function setCacheAdd(value) { + this.__data__.set(value, HASH_UNDEFINED); + return this; +} + +/** + * Checks if `value` is in the array cache. + * + * @private + * @name has + * @memberOf SetCache + * @param {*} value The value to search for. + * @returns {number} Returns `true` if `value` is found, else `false`. + */ +function setCacheHas(value) { + return this.__data__.has(value); +} + +// Add methods to `SetCache`. +SetCache.prototype.add = SetCache.prototype.push = setCacheAdd; +SetCache.prototype.has = setCacheHas; + +/** + * Creates a stack cache object to store key-value pairs. + * + * @private + * @constructor + * @param {Array} [entries] The key-value pairs to cache. + */ +function Stack(entries) { + var data = this.__data__ = new ListCache(entries); + this.size = data.size; +} + +/** + * Removes all key-value entries from the stack. + * + * @private + * @name clear + * @memberOf Stack + */ +function stackClear() { + this.__data__ = new ListCache; + this.size = 0; +} + +/** + * Removes `key` and its value from the stack. + * + * @private + * @name delete + * @memberOf Stack + * @param {string} key The key of the value to remove. + * @returns {boolean} Returns `true` if the entry was removed, else `false`. + */ +function stackDelete(key) { + var data = this.__data__, + result = data['delete'](key); + + this.size = data.size; + return result; +} + +/** + * Gets the stack value for `key`. + * + * @private + * @name get + * @memberOf Stack + * @param {string} key The key of the value to get. + * @returns {*} Returns the entry value. + */ +function stackGet(key) { + return this.__data__.get(key); +} + +/** + * Checks if a stack value for `key` exists. + * + * @private + * @name has + * @memberOf Stack + * @param {string} key The key of the entry to check. + * @returns {boolean} Returns `true` if an entry for `key` exists, else `false`. + */ +function stackHas(key) { + return this.__data__.has(key); +} + +/** + * Sets the stack `key` to `value`. + * + * @private + * @name set + * @memberOf Stack + * @param {string} key The key of the value to set. + * @param {*} value The value to set. + * @returns {Object} Returns the stack cache instance. + */ +function stackSet(key, value) { + var data = this.__data__; + if (data instanceof ListCache) { + var pairs = data.__data__; + if (!Map || (pairs.length < LARGE_ARRAY_SIZE - 1)) { + pairs.push([key, value]); + this.size = ++data.size; + return this; + } + data = this.__data__ = new MapCache(pairs); + } + data.set(key, value); + this.size = data.size; + return this; +} + +// Add methods to `Stack`. +Stack.prototype.clear = stackClear; +Stack.prototype['delete'] = stackDelete; +Stack.prototype.get = stackGet; +Stack.prototype.has = stackHas; +Stack.prototype.set = stackSet; + +/** + * Creates an array of the enumerable property names of the array-like `value`. + * + * @private + * @param {*} value The value to query. + * @param {boolean} inherited Specify returning inherited property names. + * @returns {Array} Returns the array of property names. + */ +function arrayLikeKeys(value, inherited) { + var isArr = isArray(value), + isArg = !isArr && isArguments(value), + isBuff = !isArr && !isArg && isBuffer(value), + isType = !isArr && !isArg && !isBuff && isTypedArray(value), + skipIndexes = isArr || isArg || isBuff || isType, + result = skipIndexes ? baseTimes(value.length, String) : [], + length = result.length; + + for (var key in value) { + if ((inherited || hasOwnProperty.call(value, key)) && + !(skipIndexes && ( + // Safari 9 has enumerable `arguments.length` in strict mode. + key == 'length' || + // Node.js 0.10 has enumerable non-index properties on buffers. + (isBuff && (key == 'offset' || key == 'parent')) || + // PhantomJS 2 has enumerable non-index properties on typed arrays. + (isType && (key == 'buffer' || key == 'byteLength' || key == 'byteOffset')) || + // Skip index properties. + isIndex(key, length) + ))) { + result.push(key); + } + } + return result; +} + +/** + * Gets the index at which the `key` is found in `array` of key-value pairs. + * + * @private + * @param {Array} array The array to inspect. + * @param {*} key The key to search for. + * @returns {number} Returns the index of the matched value, else `-1`. + */ +function assocIndexOf(array, key) { + var length = array.length; + while (length--) { + if (eq(array[length][0], key)) { + return length; + } + } + return -1; +} + +/** + * The base implementation of `getAllKeys` and `getAllKeysIn` which uses + * `keysFunc` and `symbolsFunc` to get the enumerable property names and + * symbols of `object`. + * + * @private + * @param {Object} object The object to query. + * @param {Function} keysFunc The function to get the keys of `object`. + * @param {Function} symbolsFunc The function to get the symbols of `object`. + * @returns {Array} Returns the array of property names and symbols. + */ +function baseGetAllKeys(object, keysFunc, symbolsFunc) { + var result = keysFunc(object); + return isArray(object) ? result : arrayPush(result, symbolsFunc(object)); +} + +/** + * The base implementation of `getTag` without fallbacks for buggy environments. + * + * @private + * @param {*} value The value to query. + * @returns {string} Returns the `toStringTag`. + */ +function baseGetTag(value) { + if (value == null) { + return value === undefined ? undefinedTag : nullTag; + } + return (symToStringTag && symToStringTag in Object(value)) + ? getRawTag(value) + : objectToString(value); +} + +/** + * The base implementation of `_.isArguments`. + * + * @private + * @param {*} value The value to check. + * @returns {boolean} Returns `true` if `value` is an `arguments` object, + */ +function baseIsArguments(value) { + return isObjectLike(value) && baseGetTag(value) == argsTag; +} + +/** + * The base implementation of `_.isEqual` which supports partial comparisons + * and tracks traversed objects. + * + * @private + * @param {*} value The value to compare. + * @param {*} other The other value to compare. + * @param {boolean} bitmask The bitmask flags. + * 1 - Unordered comparison + * 2 - Partial comparison + * @param {Function} [customizer] The function to customize comparisons. + * @param {Object} [stack] Tracks traversed `value` and `other` objects. + * @returns {boolean} Returns `true` if the values are equivalent, else `false`. + */ +function baseIsEqual(value, other, bitmask, customizer, stack) { + if (value === other) { + return true; + } + if (value == null || other == null || (!isObjectLike(value) && !isObjectLike(other))) { + return value !== value && other !== other; + } + return baseIsEqualDeep(value, other, bitmask, customizer, baseIsEqual, stack); +} + +/** + * A specialized version of `baseIsEqual` for arrays and objects which performs + * deep comparisons and tracks traversed objects enabling objects with circular + * references to be compared. + * + * @private + * @param {Object} object The object to compare. + * @param {Object} other The other object to compare. + * @param {number} bitmask The bitmask flags. See `baseIsEqual` for more details. + * @param {Function} customizer The function to customize comparisons. + * @param {Function} equalFunc The function to determine equivalents of values. + * @param {Object} [stack] Tracks traversed `object` and `other` objects. + * @returns {boolean} Returns `true` if the objects are equivalent, else `false`. + */ +function baseIsEqualDeep(object, other, bitmask, customizer, equalFunc, stack) { + var objIsArr = isArray(object), + othIsArr = isArray(other), + objTag = objIsArr ? arrayTag : getTag(object), + othTag = othIsArr ? arrayTag : getTag(other); + + objTag = objTag == argsTag ? objectTag : objTag; + othTag = othTag == argsTag ? objectTag : othTag; + + var objIsObj = objTag == objectTag, + othIsObj = othTag == objectTag, + isSameTag = objTag == othTag; + + if (isSameTag && isBuffer(object)) { + if (!isBuffer(other)) { + return false; + } + objIsArr = true; + objIsObj = false; + } + if (isSameTag && !objIsObj) { + stack || (stack = new Stack); + return (objIsArr || isTypedArray(object)) + ? equalArrays(object, other, bitmask, customizer, equalFunc, stack) + : equalByTag(object, other, objTag, bitmask, customizer, equalFunc, stack); + } + if (!(bitmask & COMPARE_PARTIAL_FLAG)) { + var objIsWrapped = objIsObj && hasOwnProperty.call(object, '__wrapped__'), + othIsWrapped = othIsObj && hasOwnProperty.call(other, '__wrapped__'); + + if (objIsWrapped || othIsWrapped) { + var objUnwrapped = objIsWrapped ? object.value() : object, + othUnwrapped = othIsWrapped ? other.value() : other; + + stack || (stack = new Stack); + return equalFunc(objUnwrapped, othUnwrapped, bitmask, customizer, stack); + } + } + if (!isSameTag) { + return false; + } + stack || (stack = new Stack); + return equalObjects(object, other, bitmask, customizer, equalFunc, stack); +} + +/** + * The base implementation of `_.isNative` without bad shim checks. + * + * @private + * @param {*} value The value to check. + * @returns {boolean} Returns `true` if `value` is a native function, + * else `false`. + */ +function baseIsNative(value) { + if (!isObject(value) || isMasked(value)) { + return false; + } + var pattern = isFunction(value) ? reIsNative : reIsHostCtor; + return pattern.test(toSource(value)); +} + +/** + * The base implementation of `_.isTypedArray` without Node.js optimizations. + * + * @private + * @param {*} value The value to check. + * @returns {boolean} Returns `true` if `value` is a typed array, else `false`. + */ +function baseIsTypedArray(value) { + return isObjectLike(value) && + isLength(value.length) && !!typedArrayTags[baseGetTag(value)]; +} + +/** + * The base implementation of `_.keys` which doesn't treat sparse arrays as dense. + * + * @private + * @param {Object} object The object to query. + * @returns {Array} Returns the array of property names. + */ +function baseKeys(object) { + if (!isPrototype(object)) { + return nativeKeys(object); + } + var result = []; + for (var key in Object(object)) { + if (hasOwnProperty.call(object, key) && key != 'constructor') { + result.push(key); + } + } + return result; +} + +/** + * A specialized version of `baseIsEqualDeep` for arrays with support for + * partial deep comparisons. + * + * @private + * @param {Array} array The array to compare. + * @param {Array} other The other array to compare. + * @param {number} bitmask The bitmask flags. See `baseIsEqual` for more details. + * @param {Function} customizer The function to customize comparisons. + * @param {Function} equalFunc The function to determine equivalents of values. + * @param {Object} stack Tracks traversed `array` and `other` objects. + * @returns {boolean} Returns `true` if the arrays are equivalent, else `false`. + */ +function equalArrays(array, other, bitmask, customizer, equalFunc, stack) { + var isPartial = bitmask & COMPARE_PARTIAL_FLAG, + arrLength = array.length, + othLength = other.length; + + if (arrLength != othLength && !(isPartial && othLength > arrLength)) { + return false; + } + // Assume cyclic values are equal. + var stacked = stack.get(array); + if (stacked && stack.get(other)) { + return stacked == other; + } + var index = -1, + result = true, + seen = (bitmask & COMPARE_UNORDERED_FLAG) ? new SetCache : undefined; + + stack.set(array, other); + stack.set(other, array); + + // Ignore non-index properties. + while (++index < arrLength) { + var arrValue = array[index], + othValue = other[index]; + + if (customizer) { + var compared = isPartial + ? customizer(othValue, arrValue, index, other, array, stack) + : customizer(arrValue, othValue, index, array, other, stack); + } + if (compared !== undefined) { + if (compared) { + continue; + } + result = false; + break; + } + // Recursively compare arrays (susceptible to call stack limits). + if (seen) { + if (!arraySome(other, function(othValue, othIndex) { + if (!cacheHas(seen, othIndex) && + (arrValue === othValue || equalFunc(arrValue, othValue, bitmask, customizer, stack))) { + return seen.push(othIndex); + } + })) { + result = false; + break; + } + } else if (!( + arrValue === othValue || + equalFunc(arrValue, othValue, bitmask, customizer, stack) + )) { + result = false; + break; + } + } + stack['delete'](array); + stack['delete'](other); + return result; +} + +/** + * A specialized version of `baseIsEqualDeep` for comparing objects of + * the same `toStringTag`. + * + * **Note:** This function only supports comparing values with tags of + * `Boolean`, `Date`, `Error`, `Number`, `RegExp`, or `String`. + * + * @private + * @param {Object} object The object to compare. + * @param {Object} other The other object to compare. + * @param {string} tag The `toStringTag` of the objects to compare. + * @param {number} bitmask The bitmask flags. See `baseIsEqual` for more details. + * @param {Function} customizer The function to customize comparisons. + * @param {Function} equalFunc The function to determine equivalents of values. + * @param {Object} stack Tracks traversed `object` and `other` objects. + * @returns {boolean} Returns `true` if the objects are equivalent, else `false`. + */ +function equalByTag(object, other, tag, bitmask, customizer, equalFunc, stack) { + switch (tag) { + case dataViewTag: + if ((object.byteLength != other.byteLength) || + (object.byteOffset != other.byteOffset)) { + return false; + } + object = object.buffer; + other = other.buffer; + + case arrayBufferTag: + if ((object.byteLength != other.byteLength) || + !equalFunc(new Uint8Array(object), new Uint8Array(other))) { + return false; + } + return true; + + case boolTag: + case dateTag: + case numberTag: + // Coerce booleans to `1` or `0` and dates to milliseconds. + // Invalid dates are coerced to `NaN`. + return eq(+object, +other); + + case errorTag: + return object.name == other.name && object.message == other.message; + + case regexpTag: + case stringTag: + // Coerce regexes to strings and treat strings, primitives and objects, + // as equal. See http://www.ecma-international.org/ecma-262/7.0/#sec-regexp.prototype.tostring + // for more details. + return object == (other + ''); + + case mapTag: + var convert = mapToArray; + + case setTag: + var isPartial = bitmask & COMPARE_PARTIAL_FLAG; + convert || (convert = setToArray); + + if (object.size != other.size && !isPartial) { + return false; + } + // Assume cyclic values are equal. + var stacked = stack.get(object); + if (stacked) { + return stacked == other; + } + bitmask |= COMPARE_UNORDERED_FLAG; + + // Recursively compare objects (susceptible to call stack limits). + stack.set(object, other); + var result = equalArrays(convert(object), convert(other), bitmask, customizer, equalFunc, stack); + stack['delete'](object); + return result; + + case symbolTag: + if (symbolValueOf) { + return symbolValueOf.call(object) == symbolValueOf.call(other); + } + } + return false; +} + +/** + * A specialized version of `baseIsEqualDeep` for objects with support for + * partial deep comparisons. + * + * @private + * @param {Object} object The object to compare. + * @param {Object} other The other object to compare. + * @param {number} bitmask The bitmask flags. See `baseIsEqual` for more details. + * @param {Function} customizer The function to customize comparisons. + * @param {Function} equalFunc The function to determine equivalents of values. + * @param {Object} stack Tracks traversed `object` and `other` objects. + * @returns {boolean} Returns `true` if the objects are equivalent, else `false`. + */ +function equalObjects(object, other, bitmask, customizer, equalFunc, stack) { + var isPartial = bitmask & COMPARE_PARTIAL_FLAG, + objProps = getAllKeys(object), + objLength = objProps.length, + othProps = getAllKeys(other), + othLength = othProps.length; + + if (objLength != othLength && !isPartial) { + return false; + } + var index = objLength; + while (index--) { + var key = objProps[index]; + if (!(isPartial ? key in other : hasOwnProperty.call(other, key))) { + return false; + } + } + // Assume cyclic values are equal. + var stacked = stack.get(object); + if (stacked && stack.get(other)) { + return stacked == other; + } + var result = true; + stack.set(object, other); + stack.set(other, object); + + var skipCtor = isPartial; + while (++index < objLength) { + key = objProps[index]; + var objValue = object[key], + othValue = other[key]; + + if (customizer) { + var compared = isPartial + ? customizer(othValue, objValue, key, other, object, stack) + : customizer(objValue, othValue, key, object, other, stack); + } + // Recursively compare objects (susceptible to call stack limits). + if (!(compared === undefined + ? (objValue === othValue || equalFunc(objValue, othValue, bitmask, customizer, stack)) + : compared + )) { + result = false; + break; + } + skipCtor || (skipCtor = key == 'constructor'); + } + if (result && !skipCtor) { + var objCtor = object.constructor, + othCtor = other.constructor; + + // Non `Object` object instances with different constructors are not equal. + if (objCtor != othCtor && + ('constructor' in object && 'constructor' in other) && + !(typeof objCtor == 'function' && objCtor instanceof objCtor && + typeof othCtor == 'function' && othCtor instanceof othCtor)) { + result = false; + } + } + stack['delete'](object); + stack['delete'](other); + return result; +} + +/** + * Creates an array of own enumerable property names and symbols of `object`. + * + * @private + * @param {Object} object The object to query. + * @returns {Array} Returns the array of property names and symbols. + */ +function getAllKeys(object) { + return baseGetAllKeys(object, keys, getSymbols); +} + +/** + * Gets the data for `map`. + * + * @private + * @param {Object} map The map to query. + * @param {string} key The reference key. + * @returns {*} Returns the map data. + */ +function getMapData(map, key) { + var data = map.__data__; + return isKeyable(key) + ? data[typeof key == 'string' ? 'string' : 'hash'] + : data.map; +} + +/** + * Gets the native function at `key` of `object`. + * + * @private + * @param {Object} object The object to query. + * @param {string} key The key of the method to get. + * @returns {*} Returns the function if it's native, else `undefined`. + */ +function getNative(object, key) { + var value = getValue(object, key); + return baseIsNative(value) ? value : undefined; +} + +/** + * A specialized version of `baseGetTag` which ignores `Symbol.toStringTag` values. + * + * @private + * @param {*} value The value to query. + * @returns {string} Returns the raw `toStringTag`. + */ +function getRawTag(value) { + var isOwn = hasOwnProperty.call(value, symToStringTag), + tag = value[symToStringTag]; + + try { + value[symToStringTag] = undefined; + var unmasked = true; + } catch (e) {} + + var result = nativeObjectToString.call(value); + if (unmasked) { + if (isOwn) { + value[symToStringTag] = tag; + } else { + delete value[symToStringTag]; + } + } + return result; +} + +/** + * Creates an array of the own enumerable symbols of `object`. + * + * @private + * @param {Object} object The object to query. + * @returns {Array} Returns the array of symbols. + */ +var getSymbols = !nativeGetSymbols ? stubArray : function(object) { + if (object == null) { + return []; + } + object = Object(object); + return arrayFilter(nativeGetSymbols(object), function(symbol) { + return propertyIsEnumerable.call(object, symbol); + }); +}; + +/** + * Gets the `toStringTag` of `value`. + * + * @private + * @param {*} value The value to query. + * @returns {string} Returns the `toStringTag`. + */ +var getTag = baseGetTag; + +// Fallback for data views, maps, sets, and weak maps in IE 11 and promises in Node.js < 6. +if ((DataView && getTag(new DataView(new ArrayBuffer(1))) != dataViewTag) || + (Map && getTag(new Map) != mapTag) || + (Promise && getTag(Promise.resolve()) != promiseTag) || + (Set && getTag(new Set) != setTag) || + (WeakMap && getTag(new WeakMap) != weakMapTag)) { + getTag = function(value) { + var result = baseGetTag(value), + Ctor = result == objectTag ? value.constructor : undefined, + ctorString = Ctor ? toSource(Ctor) : ''; + + if (ctorString) { + switch (ctorString) { + case dataViewCtorString: return dataViewTag; + case mapCtorString: return mapTag; + case promiseCtorString: return promiseTag; + case setCtorString: return setTag; + case weakMapCtorString: return weakMapTag; + } + } + return result; + }; +} + +/** + * Checks if `value` is a valid array-like index. + * + * @private + * @param {*} value The value to check. + * @param {number} [length=MAX_SAFE_INTEGER] The upper bounds of a valid index. + * @returns {boolean} Returns `true` if `value` is a valid index, else `false`. + */ +function isIndex(value, length) { + length = length == null ? MAX_SAFE_INTEGER : length; + return !!length && + (typeof value == 'number' || reIsUint.test(value)) && + (value > -1 && value % 1 == 0 && value < length); +} + +/** + * Checks if `value` is suitable for use as unique object key. + * + * @private + * @param {*} value The value to check. + * @returns {boolean} Returns `true` if `value` is suitable, else `false`. + */ +function isKeyable(value) { + var type = typeof value; + return (type == 'string' || type == 'number' || type == 'symbol' || type == 'boolean') + ? (value !== '__proto__') + : (value === null); +} + +/** + * Checks if `func` has its source masked. + * + * @private + * @param {Function} func The function to check. + * @returns {boolean} Returns `true` if `func` is masked, else `false`. + */ +function isMasked(func) { + return !!maskSrcKey && (maskSrcKey in func); +} + +/** + * Checks if `value` is likely a prototype object. + * + * @private + * @param {*} value The value to check. + * @returns {boolean} Returns `true` if `value` is a prototype, else `false`. + */ +function isPrototype(value) { + var Ctor = value && value.constructor, + proto = (typeof Ctor == 'function' && Ctor.prototype) || objectProto; + + return value === proto; +} + +/** + * Converts `value` to a string using `Object.prototype.toString`. + * + * @private + * @param {*} value The value to convert. + * @returns {string} Returns the converted string. + */ +function objectToString(value) { + return nativeObjectToString.call(value); +} + +/** + * Converts `func` to its source code. + * + * @private + * @param {Function} func The function to convert. + * @returns {string} Returns the source code. + */ +function toSource(func) { + if (func != null) { + try { + return funcToString.call(func); + } catch (e) {} + try { + return (func + ''); + } catch (e) {} + } + return ''; +} + +/** + * Performs a + * [`SameValueZero`](http://ecma-international.org/ecma-262/7.0/#sec-samevaluezero) + * comparison between two values to determine if they are equivalent. + * + * @static + * @memberOf _ + * @since 4.0.0 + * @category Lang + * @param {*} value The value to compare. + * @param {*} other The other value to compare. + * @returns {boolean} Returns `true` if the values are equivalent, else `false`. + * @example + * + * var object = { 'a': 1 }; + * var other = { 'a': 1 }; + * + * _.eq(object, object); + * // => true + * + * _.eq(object, other); + * // => false + * + * _.eq('a', 'a'); + * // => true + * + * _.eq('a', Object('a')); + * // => false + * + * _.eq(NaN, NaN); + * // => true + */ +function eq(value, other) { + return value === other || (value !== value && other !== other); +} + +/** + * Checks if `value` is likely an `arguments` object. + * + * @static + * @memberOf _ + * @since 0.1.0 + * @category Lang + * @param {*} value The value to check. + * @returns {boolean} Returns `true` if `value` is an `arguments` object, + * else `false`. + * @example + * + * _.isArguments(function() { return arguments; }()); + * // => true + * + * _.isArguments([1, 2, 3]); + * // => false + */ +var isArguments = baseIsArguments(function() { return arguments; }()) ? baseIsArguments : function(value) { + return isObjectLike(value) && hasOwnProperty.call(value, 'callee') && + !propertyIsEnumerable.call(value, 'callee'); +}; + +/** + * Checks if `value` is classified as an `Array` object. + * + * @static + * @memberOf _ + * @since 0.1.0 + * @category Lang + * @param {*} value The value to check. + * @returns {boolean} Returns `true` if `value` is an array, else `false`. + * @example + * + * _.isArray([1, 2, 3]); + * // => true + * + * _.isArray(document.body.children); + * // => false + * + * _.isArray('abc'); + * // => false + * + * _.isArray(_.noop); + * // => false + */ +var isArray = Array.isArray; + +/** + * Checks if `value` is array-like. A value is considered array-like if it's + * not a function and has a `value.length` that's an integer greater than or + * equal to `0` and less than or equal to `Number.MAX_SAFE_INTEGER`. + * + * @static + * @memberOf _ + * @since 4.0.0 + * @category Lang + * @param {*} value The value to check. + * @returns {boolean} Returns `true` if `value` is array-like, else `false`. + * @example + * + * _.isArrayLike([1, 2, 3]); + * // => true + * + * _.isArrayLike(document.body.children); + * // => true + * + * _.isArrayLike('abc'); + * // => true + * + * _.isArrayLike(_.noop); + * // => false + */ +function isArrayLike(value) { + return value != null && isLength(value.length) && !isFunction(value); +} + +/** + * Checks if `value` is a buffer. + * + * @static + * @memberOf _ + * @since 4.3.0 + * @category Lang + * @param {*} value The value to check. + * @returns {boolean} Returns `true` if `value` is a buffer, else `false`. + * @example + * + * _.isBuffer(new Buffer(2)); + * // => true + * + * _.isBuffer(new Uint8Array(2)); + * // => false + */ +var isBuffer = nativeIsBuffer || stubFalse; + +/** + * Performs a deep comparison between two values to determine if they are + * equivalent. + * + * **Note:** This method supports comparing arrays, array buffers, booleans, + * date objects, error objects, maps, numbers, `Object` objects, regexes, + * sets, strings, symbols, and typed arrays. `Object` objects are compared + * by their own, not inherited, enumerable properties. Functions and DOM + * nodes are compared by strict equality, i.e. `===`. + * + * @static + * @memberOf _ + * @since 0.1.0 + * @category Lang + * @param {*} value The value to compare. + * @param {*} other The other value to compare. + * @returns {boolean} Returns `true` if the values are equivalent, else `false`. + * @example + * + * var object = { 'a': 1 }; + * var other = { 'a': 1 }; + * + * _.isEqual(object, other); + * // => true + * + * object === other; + * // => false + */ +function isEqual(value, other) { + return baseIsEqual(value, other); +} + +/** + * Checks if `value` is classified as a `Function` object. + * + * @static + * @memberOf _ + * @since 0.1.0 + * @category Lang + * @param {*} value The value to check. + * @returns {boolean} Returns `true` if `value` is a function, else `false`. + * @example + * + * _.isFunction(_); + * // => true + * + * _.isFunction(/abc/); + * // => false + */ +function isFunction(value) { + if (!isObject(value)) { + return false; + } + // The use of `Object#toString` avoids issues with the `typeof` operator + // in Safari 9 which returns 'object' for typed arrays and other constructors. + var tag = baseGetTag(value); + return tag == funcTag || tag == genTag || tag == asyncTag || tag == proxyTag; +} + +/** + * Checks if `value` is a valid array-like length. + * + * **Note:** This method is loosely based on + * [`ToLength`](http://ecma-international.org/ecma-262/7.0/#sec-tolength). + * + * @static + * @memberOf _ + * @since 4.0.0 + * @category Lang + * @param {*} value The value to check. + * @returns {boolean} Returns `true` if `value` is a valid length, else `false`. + * @example + * + * _.isLength(3); + * // => true + * + * _.isLength(Number.MIN_VALUE); + * // => false + * + * _.isLength(Infinity); + * // => false + * + * _.isLength('3'); + * // => false + */ +function isLength(value) { + return typeof value == 'number' && + value > -1 && value % 1 == 0 && value <= MAX_SAFE_INTEGER; +} + +/** + * Checks if `value` is the + * [language type](http://www.ecma-international.org/ecma-262/7.0/#sec-ecmascript-language-types) + * of `Object`. (e.g. arrays, functions, objects, regexes, `new Number(0)`, and `new String('')`) + * + * @static + * @memberOf _ + * @since 0.1.0 + * @category Lang + * @param {*} value The value to check. + * @returns {boolean} Returns `true` if `value` is an object, else `false`. + * @example + * + * _.isObject({}); + * // => true + * + * _.isObject([1, 2, 3]); + * // => true + * + * _.isObject(_.noop); + * // => true + * + * _.isObject(null); + * // => false + */ +function isObject(value) { + var type = typeof value; + return value != null && (type == 'object' || type == 'function'); +} + +/** + * Checks if `value` is object-like. A value is object-like if it's not `null` + * and has a `typeof` result of "object". + * + * @static + * @memberOf _ + * @since 4.0.0 + * @category Lang + * @param {*} value The value to check. + * @returns {boolean} Returns `true` if `value` is object-like, else `false`. + * @example + * + * _.isObjectLike({}); + * // => true + * + * _.isObjectLike([1, 2, 3]); + * // => true + * + * _.isObjectLike(_.noop); + * // => false + * + * _.isObjectLike(null); + * // => false + */ +function isObjectLike(value) { + return value != null && typeof value == 'object'; +} + +/** + * Checks if `value` is classified as a typed array. + * + * @static + * @memberOf _ + * @since 3.0.0 + * @category Lang + * @param {*} value The value to check. + * @returns {boolean} Returns `true` if `value` is a typed array, else `false`. + * @example + * + * _.isTypedArray(new Uint8Array); + * // => true + * + * _.isTypedArray([]); + * // => false + */ +var isTypedArray = nodeIsTypedArray ? baseUnary(nodeIsTypedArray) : baseIsTypedArray; + +/** + * Creates an array of the own enumerable property names of `object`. + * + * **Note:** Non-object values are coerced to objects. See the + * [ES spec](http://ecma-international.org/ecma-262/7.0/#sec-object.keys) + * for more details. + * + * @static + * @since 0.1.0 + * @memberOf _ + * @category Object + * @param {Object} object The object to query. + * @returns {Array} Returns the array of property names. + * @example + * + * function Foo() { + * this.a = 1; + * this.b = 2; + * } + * + * Foo.prototype.c = 3; + * + * _.keys(new Foo); + * // => ['a', 'b'] (iteration order is not guaranteed) + * + * _.keys('hi'); + * // => ['0', '1'] + */ +function keys(object) { + return isArrayLike(object) ? arrayLikeKeys(object) : baseKeys(object); +} + +/** + * This method returns a new empty array. + * + * @static + * @memberOf _ + * @since 4.13.0 + * @category Util + * @returns {Array} Returns the new empty array. + * @example + * + * var arrays = _.times(2, _.stubArray); + * + * console.log(arrays); + * // => [[], []] + * + * console.log(arrays[0] === arrays[1]); + * // => false + */ +function stubArray() { + return []; +} + +/** + * This method returns `false`. + * + * @static + * @memberOf _ + * @since 4.13.0 + * @category Util + * @returns {boolean} Returns `false`. + * @example + * + * _.times(2, _.stubFalse); + * // => [false, false] + */ +function stubFalse() { + return false; +} + +module.exports = isEqual; +}); + +var baseMerged = createCommonjsModule(function (module, exports) { +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); + + + + + + +class BaseMergedExtractor { + constructor(config, options) { + this.config = config; + this.options = options; + } + extract(source, refDate) { + if (!refDate) + refDate = new Date(); + let referenceDate = refDate; + let result = new Array(); + this.addTo(result, this.config.dateExtractor.extract(source, referenceDate), source); + this.addTo(result, this.config.timeExtractor.extract(source, referenceDate), source); + this.addTo(result, this.config.durationExtractor.extract(source, referenceDate), source); + this.addTo(result, this.config.datePeriodExtractor.extract(source, referenceDate), source); + this.addTo(result, this.config.dateTimeExtractor.extract(source, referenceDate), source); + this.addTo(result, this.config.timePeriodExtractor.extract(source, referenceDate), source); + this.addTo(result, this.config.dateTimePeriodExtractor.extract(source, referenceDate), source); + this.addTo(result, this.config.setExtractor.extract(source, referenceDate), source); + this.addTo(result, this.config.holidayExtractor.extract(source, referenceDate), source); + // this should be at the end since if need the extractor to determine the previous text contains time or not + this.addTo(result, this.numberEndingRegexMatch(source, result), source); + this.addMod(result, source); + // filtering + if ((this.options & dateTimeRecognizer.DateTimeOptions.Calendar) !== 0) { + this.checkCalendarFilterList(result, source); + } + result = result.sort((a, b) => a.start - b.start); + return result; + } + checkCalendarFilterList(ers, text) { + for (let er of ers.reverse()) { + for (let negRegex of this.config.filterWordRegexList) { + let match = recognizersTextNumber.RegExpUtility.getMatches(negRegex, er.text).pop(); + if (match) { + ers.splice(ers.indexOf(er)); + } + } + } + } + // handle cases like "move 3pm appointment to 4" + numberEndingRegexMatch(text, extractResults) { + let tokens = new Array(); + extractResults.forEach(extractResult => { + if (extractResult.type === constants$2.Constants.SYS_DATETIME_TIME + || extractResult.type === constants$2.Constants.SYS_DATETIME_DATETIME) { + let stringAfter = text.substring(extractResult.start + extractResult.length); + let match = recognizersTextNumber.RegExpUtility.getMatches(this.config.numberEndingPattern, stringAfter); + if (match != null && match.length) { + let newTime = match[0].groups("newTime"); + let numRes = this.config.integerExtractor.extract(newTime.value); + if (numRes.length === 0) { + return; + } + let startPosition = extractResult.start + extractResult.length + newTime.index; + tokens.push(new utilities$2.Token(startPosition, startPosition + newTime.length)); + } + } + }); + return utilities$2.Token.mergeAllTokens(tokens, text, constants$2.Constants.SYS_DATETIME_TIME); + } + addTo(destination, source, text) { + source.forEach(value => { + if (this.options === dateTimeRecognizer.DateTimeOptions.SkipFromToMerge && this.shouldSkipFromMerge(value)) + return; + let isFound = false; + let overlapIndexes = new Array(); + let firstIndex = -1; + destination.forEach((dest, index) => { + if (recognizersText.ExtractResult.isOverlap(dest, value)) { + isFound = true; + if (recognizersText.ExtractResult.isCover(dest, value)) { + if (firstIndex === -1) { + firstIndex = index; + } + overlapIndexes.push(index); + } + else { + return; + } + } + }); + if (!isFound) { + destination.push(value); + } + else if (overlapIndexes.length) { + let tempDst = new Array(); + for (let i = 0; i < destination.length; i++) { + if (overlapIndexes.indexOf(i) === -1) { + tempDst.push(destination[i]); + } + } + // insert at the first overlap occurrence to keep the order + tempDst.splice(firstIndex, 0, value); + destination.length = 0; + destination.push.apply(destination, tempDst); + } + }); + } + shouldSkipFromMerge(er) { + return recognizersTextNumber.RegExpUtility.getMatches(this.config.fromToRegex, er.text).length > 0; + } + filterAmbiguousSingleWord(er, text) { + let matches = recognizersTextNumber.RegExpUtility.getMatches(this.config.singleAmbiguousMonthRegex, er.text.toLowerCase()); + if (matches.length) { + let stringBefore = text.substring(0, er.start).replace(/\s+$/, ''); + matches = recognizersTextNumber.RegExpUtility.getMatches(this.config.prepositionSuffixRegex, stringBefore); + if (!matches.length) { + return true; + } + } + return false; + } + addMod(ers, source) { + let lastEnd = 0; + ers.forEach(er => { + let beforeStr = source.substr(lastEnd, er.start).toLowerCase(); + let before = this.hasTokenIndex(beforeStr.trim(), this.config.beforeRegex); + if (before.matched) { + let modLength = beforeStr.length - before.index; + er.length += modLength; + er.start -= modLength; + er.text = source.substr(er.start, er.length); + } + let after = this.hasTokenIndex(beforeStr.trim(), this.config.afterRegex); + if (after.matched) { + let modLength = beforeStr.length - after.index; + er.length += modLength; + er.start -= modLength; + er.text = source.substr(er.start, er.length); + } + let since = this.hasTokenIndex(beforeStr.trim(), this.config.sinceRegex); + if (since.matched) { + let modLength = beforeStr.length - since.index; + er.length += modLength; + er.start -= modLength; + er.text = source.substr(er.start, er.length); + } + }); + } + hasTokenIndex(source, regex) { + let result = { matched: false, index: -1 }; + let match = recognizersTextNumber.RegExpUtility.getMatches(regex, source).pop(); + if (match) { + result.matched = true; + result.index = match.index; + } + return result; + } +} +exports.BaseMergedExtractor = BaseMergedExtractor; +class BaseMergedParser { + constructor(config, options) { + this.parserTypeName = 'datetimeV2'; + this.dateMinValue = utilities$2.FormatUtil.formatDate(utilities$2.DateUtils.minValue()); + this.dateTimeMinValue = utilities$2.FormatUtil.formatDateTime(utilities$2.DateUtils.minValue()); + this.config = config; + this.options = options; + } + parse(er, refTime) { + let referenceTime = refTime || new Date(); + let pr = null; + // push, save teh MOD string + let hasBefore = false; + let hasAfter = false; + let hasSince = false; + let modStr = ""; + let beforeMatch = recognizersTextNumber.RegExpUtility.getMatches(this.config.beforeRegex, er.text).shift(); + let afterMatch = recognizersTextNumber.RegExpUtility.getMatches(this.config.afterRegex, er.text).shift(); + let sinceMatch = recognizersTextNumber.RegExpUtility.getMatches(this.config.sinceRegex, er.text).shift(); + if (beforeMatch && beforeMatch.index === 0) { + hasBefore = true; + er.start += beforeMatch.length; + er.length -= beforeMatch.length; + er.text = er.text.substring(beforeMatch.length); + modStr = beforeMatch.value; + } + else if (afterMatch && afterMatch.index === 0) { + hasAfter = true; + er.start += afterMatch.length; + er.length -= afterMatch.length; + er.text = er.text.substring(afterMatch.length); + modStr = afterMatch.value; + } + else if (sinceMatch && sinceMatch.index === 0) { + hasSince = true; + er.start += sinceMatch.length; + er.length -= sinceMatch.length; + er.text = er.text.substring(sinceMatch.length); + modStr = sinceMatch.value; + } + if (er.type === constants$2.Constants.SYS_DATETIME_DATE) { + pr = this.config.dateParser.parse(er, referenceTime); + if (pr.value === null || pr.value === undefined) { + pr = this.config.holidayParser.parse(er, referenceTime); + } + } + else if (er.type === constants$2.Constants.SYS_DATETIME_TIME) { + pr = this.config.timeParser.parse(er, referenceTime); + } + else if (er.type === constants$2.Constants.SYS_DATETIME_DATETIME) { + pr = this.config.dateTimeParser.parse(er, referenceTime); + } + else if (er.type === constants$2.Constants.SYS_DATETIME_DATEPERIOD) { + pr = this.config.datePeriodParser.parse(er, referenceTime); + } + else if (er.type === constants$2.Constants.SYS_DATETIME_TIMEPERIOD) { + pr = this.config.timePeriodParser.parse(er, referenceTime); + } + else if (er.type === constants$2.Constants.SYS_DATETIME_DATETIMEPERIOD) { + pr = this.config.dateTimePeriodParser.parse(er, referenceTime); + } + else if (er.type === constants$2.Constants.SYS_DATETIME_DURATION) { + pr = this.config.durationParser.parse(er, referenceTime); + } + else if (er.type === constants$2.Constants.SYS_DATETIME_SET) { + pr = this.config.setParser.parse(er, referenceTime); + } + else { + return null; + } + // pop, restore the MOD string + if (hasBefore && pr.value !== null) { + pr.length += modStr.length; + pr.start -= modStr.length; + pr.text = modStr + pr.text; + let val = pr.value; + val.mod = constants$2.TimeTypeConstants.beforeMod; + pr.value = val; + } + if (hasAfter && pr.value !== null) { + pr.length += modStr.length; + pr.start -= modStr.length; + pr.text = modStr + pr.text; + let val = pr.value; + val.mod = constants$2.TimeTypeConstants.afterMod; + pr.value = val; + } + if (hasSince && pr.value !== null) { + pr.length += modStr.length; + pr.start -= modStr.length; + pr.text = modStr + pr.text; + let val = pr.value; + val.mod = constants$2.TimeTypeConstants.sinceMod; + pr.value = val; + } + if ((this.options & dateTimeRecognizer.DateTimeOptions.SplitDateAndTime) === dateTimeRecognizer.DateTimeOptions.SplitDateAndTime + && pr.value && pr.value.subDateTimeEntities != null) { + pr.value = this.dateTimeResolutionForSplit(pr); + } + else { + pr = this.setParseResult(pr, hasBefore, hasAfter, hasSince); + } + return pr; + } + setParseResult(slot, hasBefore, hasAfter, hasSince) { + slot.value = this.dateTimeResolution(slot, hasBefore, hasAfter, hasSince); + // change the type at last for the after or before mode + slot.type = `${this.parserTypeName}.${this.determineDateTimeType(slot.type, hasBefore, hasAfter, hasSince)}`; + return slot; + } + getParseResult(extractorResult, referenceDate) { + let extractorType = extractorResult.type; + if (extractorType === constants$2.Constants.SYS_DATETIME_DATE) { + let pr = this.config.dateParser.parse(extractorResult, referenceDate); + if (!pr || !pr.value) + return this.config.holidayParser.parse(extractorResult, referenceDate); + return pr; + } + if (extractorType === constants$2.Constants.SYS_DATETIME_TIME) { + return this.config.timeParser.parse(extractorResult, referenceDate); + } + if (extractorType === constants$2.Constants.SYS_DATETIME_DATETIME) { + return this.config.dateTimeParser.parse(extractorResult, referenceDate); + } + if (extractorType === constants$2.Constants.SYS_DATETIME_DATEPERIOD) { + return this.config.datePeriodParser.parse(extractorResult, referenceDate); + } + if (extractorType === constants$2.Constants.SYS_DATETIME_TIMEPERIOD) { + return this.config.timePeriodParser.parse(extractorResult, referenceDate); + } + if (extractorType === constants$2.Constants.SYS_DATETIME_DATETIMEPERIOD) { + return this.config.dateTimePeriodParser.parse(extractorResult, referenceDate); + } + if (extractorType === constants$2.Constants.SYS_DATETIME_DURATION) { + return this.config.durationParser.parse(extractorResult, referenceDate); + } + if (extractorType === constants$2.Constants.SYS_DATETIME_SET) { + return this.config.setParser.parse(extractorResult, referenceDate); + } + return null; + } + determineDateTimeType(type, hasBefore, hasAfter, hasSince) { + if ((this.options & dateTimeRecognizer.DateTimeOptions.SplitDateAndTime) === dateTimeRecognizer.DateTimeOptions.SplitDateAndTime) { + if (type === constants$2.Constants.SYS_DATETIME_DATETIME) { + return constants$2.Constants.SYS_DATETIME_TIME; + } + } + else { + if (hasBefore || hasAfter || hasSince) { + if (type === constants$2.Constants.SYS_DATETIME_DATE) + return constants$2.Constants.SYS_DATETIME_DATEPERIOD; + if (type === constants$2.Constants.SYS_DATETIME_TIME) + return constants$2.Constants.SYS_DATETIME_TIMEPERIOD; + if (type === constants$2.Constants.SYS_DATETIME_DATETIME) + return constants$2.Constants.SYS_DATETIME_DATETIMEPERIOD; + } + } + return type; + } + dateTimeResolutionForSplit(slot) { + let results = new Array(); + if (slot.value.subDateTimeEntities != null) { + let subEntities = slot.value.subDateTimeEntities; + for (let subEntity of subEntities) { + let result = subEntity; + results.push(...this.dateTimeResolutionForSplit(result)); + } + } + else { + slot.value = this.dateTimeResolution(slot, false, false, false); + slot.type = `${this.parserTypeName}.${this.determineDateTimeType(slot.type, false, false, false)}`; + results.push(slot); + } + return results; + } + dateTimeResolution(slot, hasBefore, hasAfter, hasSince) { + if (!slot) + return null; + let result = new Map(); + let resolutions = new Array(); + let type = slot.type; + let outputType = this.determineDateTimeType(type, hasBefore, hasAfter, hasSince); + let timex = slot.timexStr; + let value = slot.value; + if (!value) + return null; + let isLunar = value.isLunar; + let mod = value.mod; + let comment = value.comment; + // the following should added to res first since the ResolveAmPm is using these fields + this.addResolutionFieldsAny(result, constants$2.Constants.TimexKey, timex); + this.addResolutionFieldsAny(result, constants$2.Constants.CommentKey, comment); + this.addResolutionFieldsAny(result, constants$2.Constants.ModKey, mod); + this.addResolutionFieldsAny(result, constants$2.Constants.TypeKey, outputType); + this.addResolutionFieldsAny(result, constants$2.Constants.IsLunarKey, isLunar ? String(isLunar) : ""); + let futureResolution = value.futureResolution; + let pastResolution = value.pastResolution; + let future = this.generateFromResolution(type, futureResolution, mod); + let past = this.generateFromResolution(type, pastResolution, mod); + let futureValues = Array.from(this.getValues(future)).sort(); + let pastValues = Array.from(this.getValues(past)).sort(); + if (lodash_isequal(futureValues, pastValues)) { + if (pastValues.length > 0) + this.addResolutionFieldsAny(result, constants$2.Constants.ResolveKey, past); + } + else { + if (pastValues.length > 0) + this.addResolutionFieldsAny(result, constants$2.Constants.ResolveToPastKey, past); + if (futureValues.length > 0) + this.addResolutionFieldsAny(result, constants$2.Constants.ResolveToFutureKey, future); + } + if (comment && comment === 'ampm') { + if (result.has('resolve')) { + this.resolveAMPM(result, 'resolve'); + } + else { + this.resolveAMPM(result, 'resolveToPast'); + this.resolveAMPM(result, 'resolveToFuture'); + } + } + result.forEach((value, key) => { + if (this.isObject(value)) { + // is "StringMap" + let newValues = {}; + this.addResolutionFields(newValues, constants$2.Constants.TimexKey, timex); + this.addResolutionFields(newValues, constants$2.Constants.ModKey, mod); + this.addResolutionFields(newValues, constants$2.Constants.TypeKey, outputType); + this.addResolutionFields(newValues, constants$2.Constants.IsLunarKey, isLunar ? String(isLunar) : ""); + Object.keys(value).forEach((innerKey) => { + newValues[innerKey] = value[innerKey]; + }); + resolutions.push(newValues); + } + }); + if (Object.keys(past).length === 0 && Object.keys(future).length === 0) { + let o = {}; + o['timex'] = timex; + o['type'] = outputType; + o['value'] = 'not resolved'; + resolutions.push(o); + } + return { + values: resolutions + }; + } + isObject(o) { + return (!!o) && (o.constructor === Object); + } + addResolutionFieldsAny(dic, key, value) { + if (value instanceof String) { + if (!recognizersTextNumber.StringUtility.isNullOrEmpty(value)) { + dic.set(key, value); + } + } + else { + dic.set(key, value); + } + } + addResolutionFields(dic, key, value) { + if (!recognizersTextNumber.StringUtility.isNullOrEmpty(value)) { + dic[key] = value; + } + } + generateFromResolution(type, resolutions, mod) { + let result = {}; + switch (type) { + case constants$2.Constants.SYS_DATETIME_DATETIME: + this.addSingleDateTimeToResolution(resolutions, constants$2.TimeTypeConstants.DATETIME, mod, result); + break; + case constants$2.Constants.SYS_DATETIME_TIME: + this.addSingleDateTimeToResolution(resolutions, constants$2.TimeTypeConstants.TIME, mod, result); + break; + case constants$2.Constants.SYS_DATETIME_DATE: + this.addSingleDateTimeToResolution(resolutions, constants$2.TimeTypeConstants.DATE, mod, result); + break; + case constants$2.Constants.SYS_DATETIME_DURATION: + if (resolutions.hasOwnProperty(constants$2.TimeTypeConstants.DURATION)) { + result[constants$2.TimeTypeConstants.VALUE] = resolutions[constants$2.TimeTypeConstants.DURATION]; + } + break; + case constants$2.Constants.SYS_DATETIME_TIMEPERIOD: + this.addPeriodToResolution(resolutions, constants$2.TimeTypeConstants.START_TIME, constants$2.TimeTypeConstants.END_TIME, mod, result); + break; + case constants$2.Constants.SYS_DATETIME_DATEPERIOD: + this.addPeriodToResolution(resolutions, constants$2.TimeTypeConstants.START_DATE, constants$2.TimeTypeConstants.END_DATE, mod, result); + break; + case constants$2.Constants.SYS_DATETIME_DATETIMEPERIOD: + this.addPeriodToResolution(resolutions, constants$2.TimeTypeConstants.START_DATETIME, constants$2.TimeTypeConstants.END_DATETIME, mod, result); + break; + } + return result; + } + addSingleDateTimeToResolution(resolutions, type, mod, result) { + let key = constants$2.TimeTypeConstants.VALUE; + let value = resolutions[type]; + if (!value || this.dateMinValue === value || this.dateTimeMinValue === value) + return; + if (!recognizersTextNumber.StringUtility.isNullOrEmpty(mod)) { + if (mod === constants$2.TimeTypeConstants.beforeMod) { + key = constants$2.TimeTypeConstants.END; + } + else if (mod === constants$2.TimeTypeConstants.afterMod) { + key = constants$2.TimeTypeConstants.START; + } + else if (mod === constants$2.TimeTypeConstants.sinceMod) { + key = constants$2.TimeTypeConstants.START; + } + } + result[key] = value; + } + addPeriodToResolution(resolutions, startType, endType, mod, result) { + let start = resolutions[startType]; + let end = resolutions[endType]; + if (!recognizersTextNumber.StringUtility.isNullOrEmpty(mod)) { + // For the 'before' mod + // 1. Cases like "Before December", the start of the period should be the end of the new period, not the start + // 2. Cases like "More than 3 days before today", the date point should be the end of the new period + if (mod === constants$2.TimeTypeConstants.beforeMod) { + if (!recognizersTextNumber.StringUtility.isNullOrEmpty(start) && !recognizersTextNumber.StringUtility.isNullOrEmpty(end)) { + result[constants$2.TimeTypeConstants.END] = start; + } + else { + result[constants$2.TimeTypeConstants.END] = end; + } + return; + } + // For the 'after' mod + // 1. Cases like "After January". the end of the period should be the start of the new period, not the end + // 2. Cases like "More than 3 days after today", the date point should be the start of the new period + if (mod === constants$2.TimeTypeConstants.afterMod) { + // For cases like "After January" or "After 2018" + // The "end" of the period is not inclusive by default ("January", the end should be "XXXX-02-01" / "2018", the end should be "2019-01-01") + // Mod "after" is also not inclusive the "start" ("After January", the start should be "XXXX-01-31" / "After 2018", the start should be "2017-12-31") + // So here the START day should be the inclusive end of the period, which is one day previous to the default end (exclusive end) + if (!recognizersTextNumber.StringUtility.isNullOrEmpty(start) && !recognizersTextNumber.StringUtility.isNullOrEmpty(end)) { + var dateObj = new Date(end); + dateObj.setDate(dateObj.getDate() - 1); + result[constants$2.TimeTypeConstants.START] = utilities$2.FormatUtil.formatDate(dateObj); + } + else { + result[constants$2.TimeTypeConstants.START] = start; + } + return; + } + if (mod === constants$2.TimeTypeConstants.sinceMod) { + result[constants$2.TimeTypeConstants.START] = start; + return; + } + } + if (recognizersTextNumber.StringUtility.isNullOrEmpty(start) || recognizersTextNumber.StringUtility.isNullOrEmpty(end)) + return; + result[constants$2.TimeTypeConstants.START] = start; + result[constants$2.TimeTypeConstants.END] = end; + } + getValues(obj) { + return Object.keys(obj).map(key => obj[key]); + } + resolveAMPM(valuesMap, keyName) { + if (!valuesMap.has(keyName)) + return; + let resolution = valuesMap.get(keyName); + if (!valuesMap.has('timex')) + return; + let timex = valuesMap.get('timex'); + valuesMap.delete(keyName); + valuesMap.set(keyName + 'Am', resolution); + let resolutionPm = {}; + switch (valuesMap.get('type')) { + case constants$2.Constants.SYS_DATETIME_TIME: + resolutionPm[constants$2.TimeTypeConstants.VALUE] = utilities$2.FormatUtil.toPm(resolution[constants$2.TimeTypeConstants.VALUE]); + resolutionPm['timex'] = utilities$2.FormatUtil.toPm(timex); + break; + case constants$2.Constants.SYS_DATETIME_DATETIME: + let splitValue = resolution[constants$2.TimeTypeConstants.VALUE].split(' '); + resolutionPm[constants$2.TimeTypeConstants.VALUE] = `${splitValue[0]} ${utilities$2.FormatUtil.toPm(splitValue[1])}`; + resolutionPm['timex'] = utilities$2.FormatUtil.allStringToPm(timex); + break; + case constants$2.Constants.SYS_DATETIME_TIMEPERIOD: + if (resolution.hasOwnProperty(constants$2.TimeTypeConstants.START)) + resolutionPm[constants$2.TimeTypeConstants.START] = utilities$2.FormatUtil.toPm(resolution[constants$2.TimeTypeConstants.START]); + if (resolution.hasOwnProperty(constants$2.TimeTypeConstants.END)) + resolutionPm[constants$2.TimeTypeConstants.END] = utilities$2.FormatUtil.toPm(resolution[constants$2.TimeTypeConstants.END]); + resolutionPm['timex'] = utilities$2.FormatUtil.allStringToPm(timex); + break; + case constants$2.Constants.SYS_DATETIME_DATETIMEPERIOD: + if (resolution.hasOwnProperty(constants$2.TimeTypeConstants.START)) { + let splitValue = resolution[constants$2.TimeTypeConstants.START].split(' '); + resolutionPm[constants$2.TimeTypeConstants.START] = `${splitValue[0]} ${utilities$2.FormatUtil.toPm(splitValue[1])}`; + } + if (resolution.hasOwnProperty(constants$2.TimeTypeConstants.END)) { + let splitValue = resolution[constants$2.TimeTypeConstants.END].split(' '); + resolutionPm[constants$2.TimeTypeConstants.END] = `${splitValue[0]} ${utilities$2.FormatUtil.toPm(splitValue[1])}`; + } + resolutionPm['timex'] = utilities$2.FormatUtil.allStringToPm(timex); + break; + } + valuesMap.set(keyName + 'Pm', resolutionPm); + } +} +exports.BaseMergedParser = BaseMergedParser; + +}); + +unwrapExports(baseMerged); + +var englishDateTime = createCommonjsModule(function (module, exports) { +"use strict"; +// ------------------------------------------------------------------------------ +// +// This code was generated by a tool. +// Changes to this file may cause incorrect behavior and will be lost if +// the code is regenerated. +// +// ------------------------------------------------------------------------------ +Object.defineProperty(exports, "__esModule", { value: true }); + +var EnglishDateTime; +(function (EnglishDateTime) { + EnglishDateTime.TillRegex = `(?\\b(to|till|til|until|thru|through)\\b|(--|-|—|——|~|–))`; + EnglishDateTime.RangeConnectorRegex = `(?\\b(and|through|to)\\b|(--|-|—|——|~|–))`; + EnglishDateTime.RelativeRegex = `\\b(?following|next|coming|upcoming|this|last|past|previous|current|the)\\b`; + EnglishDateTime.StrictRelativeRegex = `\\b(?following|next|coming|upcoming|this|last|past|previous|current)\\b`; + EnglishDateTime.NextPrefixRegex = `\\b(following|next|upcoming|coming)\\b`; + EnglishDateTime.AfterNextSuffixRegex = `\\b(after\\s+(the\\s+)?next)\\b`; + EnglishDateTime.PastPrefixRegex = `(last|past|previous)\\b`; + EnglishDateTime.ThisPrefixRegex = `(this|current)\\b`; + EnglishDateTime.CenturySuffixRegex = `(^century)\\b`; + EnglishDateTime.ReferencePrefixRegex = `(that|same)\\b`; + EnglishDateTime.FutureSuffixRegex = `\\b(in\\s+the\\s+)?(future|hence)\\b`; + EnglishDateTime.DayRegex = `(the\\s*)?(?01|02|03|04|05|06|07|08|09|10th|10|11th|11st|11|12nd|12th|12|13rd|13th|13|14th|14|15th|15|16th|16|17th|17|18th|18|19th|19|1st|1|20th|20|21st|21th|21|22nd|22th|22|23rd|23th|23|24th|24|25th|25|26th|26|27th|27|28th|28|29th|29|2nd|2|30th|30|31st|31|3rd|3|4th|4|5th|5|6th|6|7th|7|8th|8|9th|9)(?=\\b|t)`; + EnglishDateTime.ImplicitDayRegex = `(the\\s*)?(?10th|11th|11st|12nd|12th|13rd|13th|14th|15th|16th|17th|18th|19th|1st|20th|21st|21th|22nd|22th|23rd|23th|24th|25th|26th|27th|28th|29th|2nd|30th|31st|3rd|4th|5th|6th|7th|8th|9th)\\b`; + EnglishDateTime.MonthNumRegex = `(?01|02|03|04|05|06|07|08|09|10|11|12|1|2|3|4|5|6|7|8|9)\\b`; + EnglishDateTime.CenturyRegex = `\\b(?((one|two)\\s+thousand(\\s+and)?(\\s+(one|two|three|four|five|six|seven|eight|nine)\\s+hundred(\\s+and)?)?)|((twenty one|twenty two|one|two|three|four|five|six|seven|eight|nine|ten|eleven|twelve|thirteen|fourteen|fifteen|sixteen|seventeen|eighteen|nineteen|twenty)(\\s+hundred)?(\\s+and)?))\\b`; + EnglishDateTime.WrittenNumRegex = `(one|two|three|four|five|six|seven|eight|nine|ten|eleven|twelve|thirteen|fourteen|fifteen|sixteen|seventeen|eighteen|nineteen|twenty|thirty|forty|fourty|fifty|sixty|seventy|eighty|ninety)`; + EnglishDateTime.FullTextYearRegex = `\\b((?${EnglishDateTime.CenturyRegex})\\s+(?((zero|twenty|thirty|forty|fourty|fifty|sixty|seventy|eighty|ninety)\\s+${EnglishDateTime.WrittenNumRegex})|${EnglishDateTime.WrittenNumRegex}))\\b|\\b(?${EnglishDateTime.CenturyRegex})\\b`; + EnglishDateTime.AmDescRegex = `(am\\b|a\\.m\\.|a m\\b|a\\. m\\.|a\\.m\\b|a\\. m\\b|a m\\b)`; + EnglishDateTime.PmDescRegex = `(pm\\b|p\\.m\\.|p\\b|p m\\b|p\\. m\\.|p\\.m\\b|p\\. m\\b|p m\\b)`; + EnglishDateTime.TwoDigitYearRegex = `\\b(?([0-27-9]\\d))(?!(\\s*((\\:)|${EnglishDateTime.AmDescRegex}|${EnglishDateTime.PmDescRegex}|\\.\\d)))\\b`; + EnglishDateTime.YearRegex = `(${baseDateTime.BaseDateTime.FourDigitYearRegex}|${EnglishDateTime.FullTextYearRegex})`; + EnglishDateTime.WeekDayRegex = `\\b(?Sunday|Monday|Tuesday|Wednesday|Thursday|Friday|Saturday|Mon|Tues|Tue|Wedn|Weds|Wed|Thurs|Thur|Thu|Fri|Sat|Sun)s?\\b`; + EnglishDateTime.SingleWeekDayRegex = `\\b(?Sunday|Monday|Tuesday|Wednesday|Thursday|Friday|Saturday|Mon|Tue|Tues|Wedn|Weds|Wed|Thurs|Thur|Thu|Fri|((?<=on\\s+)(Sat|Sun)))\\b`; + EnglishDateTime.RelativeMonthRegex = `(?(of\\s+)?${EnglishDateTime.RelativeRegex}\\s+month)\\b`; + EnglishDateTime.WrittenMonthRegex = `(((the\\s+)?month of\\s+)?(?April|Apr|August|Aug|December|Dec|February|Feb|January|Jan|July|Jul|June|Jun|March|Mar|May|November|Nov|October|Oct|September|Sept|Sep))`; + EnglishDateTime.MonthSuffixRegex = `(?(in\\s+|of\\s+|on\\s+)?(${EnglishDateTime.RelativeMonthRegex}|${EnglishDateTime.WrittenMonthRegex}))`; + EnglishDateTime.DateUnitRegex = `(?decades?|years?|months?|weeks?|(?business\\s+)?days?)\\b`; + EnglishDateTime.DateTokenPrefix = 'on '; + EnglishDateTime.TimeTokenPrefix = 'at '; + EnglishDateTime.TokenBeforeDate = 'on '; + EnglishDateTime.TokenBeforeTime = 'at '; + EnglishDateTime.SimpleCasesRegex = `\\b((from|between)\\s+)?(${EnglishDateTime.DayRegex})\\s*${EnglishDateTime.TillRegex}\\s*(${EnglishDateTime.DayRegex}\\s+${EnglishDateTime.MonthSuffixRegex}|${EnglishDateTime.MonthSuffixRegex}\\s+${EnglishDateTime.DayRegex})((\\s+|\\s*,\\s*)${EnglishDateTime.YearRegex})?\\b`; + EnglishDateTime.MonthFrontSimpleCasesRegex = `\\b((from|between)\\s+)?${EnglishDateTime.MonthSuffixRegex}\\s+((from)\\s+)?(${EnglishDateTime.DayRegex})\\s*${EnglishDateTime.TillRegex}\\s*(${EnglishDateTime.DayRegex})((\\s+|\\s*,\\s*)${EnglishDateTime.YearRegex})?\\b`; + EnglishDateTime.MonthFrontBetweenRegex = `\\b${EnglishDateTime.MonthSuffixRegex}\\s+(between\\s+)(${EnglishDateTime.DayRegex})\\s*${EnglishDateTime.RangeConnectorRegex}\\s*(${EnglishDateTime.DayRegex})((\\s+|\\s*,\\s*)${EnglishDateTime.YearRegex})?\\b`; + EnglishDateTime.BetweenRegex = `\\b(between\\s+)(${EnglishDateTime.DayRegex})\\s*${EnglishDateTime.RangeConnectorRegex}\\s*(${EnglishDateTime.DayRegex})\\s+${EnglishDateTime.MonthSuffixRegex}((\\s+|\\s*,\\s*)${EnglishDateTime.YearRegex})?\\b`; + EnglishDateTime.MonthWithYear = `\\b((${EnglishDateTime.WrittenMonthRegex}(\\.)?(\\s*),?(\\s+of)?(\\s*)(${EnglishDateTime.YearRegex}|(?following|next|last|this)\\s+year))|((${EnglishDateTime.YearRegex}|(?following|next|last|this)\\s+year)(\\s*),?(\\s*)${EnglishDateTime.WrittenMonthRegex}))\\b`; + EnglishDateTime.OneWordPeriodRegex = `\\b((((the\\s+)?month of\\s+)?(${EnglishDateTime.StrictRelativeRegex}\\s+)?(?April|Apr|August|Aug|December|Dec|February|Feb|January|Jan|July|Jul|June|Jun|March|Mar|May|November|Nov|October|Oct|September|Sep|Sept))|(month|year) to date|(${EnglishDateTime.RelativeRegex}\\s+)?(my\\s+)?(weekend|week|month|year)(?!((\\s+of)?\\s+\\d+|\\s+to\\s+date))(\\s+${EnglishDateTime.AfterNextSuffixRegex})?)\\b`; + EnglishDateTime.MonthNumWithYear = `\\b((${baseDateTime.BaseDateTime.FourDigitYearRegex}(\\s*)[/\\-\\.](\\s*)${EnglishDateTime.MonthNumRegex})|(${EnglishDateTime.MonthNumRegex}(\\s*)[/\\-](\\s*)${baseDateTime.BaseDateTime.FourDigitYearRegex}))\\b`; + EnglishDateTime.WeekOfMonthRegex = `\\b(?(the\\s+)?(?first|1st|second|2nd|third|3rd|fourth|4th|fifth|5th|last)\\s+week\\s+${EnglishDateTime.MonthSuffixRegex})\\b`; + EnglishDateTime.WeekOfYearRegex = `\\b(?(the\\s+)?(?first|1st|second|2nd|third|3rd|fourth|4th|fifth|5th|last)\\s+week(\\s+of)?\\s+(${EnglishDateTime.YearRegex}|${EnglishDateTime.RelativeRegex}\\s+year))\\b`; + EnglishDateTime.FollowedDateUnit = `^\\s*${EnglishDateTime.DateUnitRegex}`; + EnglishDateTime.NumberCombinedWithDateUnit = `\\b(?\\d+(\\.\\d*)?)${EnglishDateTime.DateUnitRegex}`; + EnglishDateTime.QuarterTermRegex = `\\b(((?first|1st|second|2nd|third|3rd|fourth|4th)[ -]+quarter)|(Q(?[1-4])))\\b`; + EnglishDateTime.QuarterRegex = `(the\\s+)?${EnglishDateTime.QuarterTermRegex}((\\s+of|\\s*,\\s*)?\\s+(${EnglishDateTime.YearRegex}|${EnglishDateTime.RelativeRegex}\\s+year))?`; + EnglishDateTime.QuarterRegexYearFront = `(${EnglishDateTime.YearRegex}|${EnglishDateTime.RelativeRegex}\\s+year)('s)?\\s+(the\\s+)?${EnglishDateTime.QuarterTermRegex}`; + EnglishDateTime.HalfYearTermRegex = `(?first|1st|second|2nd)\\s+half`; + EnglishDateTime.HalfYearFrontRegex = `(?((1[5-9]|20)\\d{2})|2100)\\s*(the\\s+)?H(?[1-2])`; + EnglishDateTime.HalfYearBackRegex = `(the\\s+)?(H(?[1-2])|(${EnglishDateTime.HalfYearTermRegex}))(\\s+of|\\s*,\\s*)?\\s+(${EnglishDateTime.YearRegex})`; + EnglishDateTime.HalfYearRelativeRegex = `(the\\s+)?${EnglishDateTime.HalfYearTermRegex}(\\s+of|\\s*,\\s*)?\\s+(${EnglishDateTime.RelativeRegex}\\s+year)`; + EnglishDateTime.AllHalfYearRegex = `(${EnglishDateTime.HalfYearFrontRegex})|(${EnglishDateTime.HalfYearBackRegex})|(${EnglishDateTime.HalfYearRelativeRegex})`; + EnglishDateTime.EarlyPrefixRegex = `\\b(?early|beginning of|start of|(?earlier(\\s+in)?))\\b`; + EnglishDateTime.MidPrefixRegex = `\\b(?mid-?|middle of)\\b`; + EnglishDateTime.LaterPrefixRegex = `\\b(?late|end of|(?later(\\s+in)?))\\b`; + EnglishDateTime.PrefixPeriodRegex = `(${EnglishDateTime.EarlyPrefixRegex}|${EnglishDateTime.MidPrefixRegex}|${EnglishDateTime.LaterPrefixRegex})`; + EnglishDateTime.PrefixDayRegex = `\\b((?early)|(?mid|middle)|(?late|later))(\\s+in)?(\\s+the\\s+day)?$`; + EnglishDateTime.SeasonDescRegex = `(?spring|summer|fall|autumn|winter)`; + EnglishDateTime.SeasonRegex = `\\b(?(${EnglishDateTime.PrefixPeriodRegex}\\s+)?(${EnglishDateTime.RelativeRegex}\\s+)?${EnglishDateTime.SeasonDescRegex}((\\s+of|\\s*,\\s*)?\\s+(${EnglishDateTime.YearRegex}|${EnglishDateTime.RelativeRegex}\\s+year))?)\\b`; + EnglishDateTime.WhichWeekRegex = `(week)(\\s*)(?\\d\\d|\\d|0\\d)`; + EnglishDateTime.WeekOfRegex = `(the\\s+)?(week)(\\s+of)(\\s+the)?`; + EnglishDateTime.MonthOfRegex = `(month)(\\s*)(of)`; + EnglishDateTime.MonthRegex = `(?April|Apr|August|Aug|December|Dec|February|Feb|January|Jan|July|Jul|June|Jun|March|Mar|May|November|Nov|October|Oct|September|Sept|Sep)`; + EnglishDateTime.AmbiguousMonthP0Regex = `\\b((^may i)|(i|you|he|she|we|they)\\s+may|(may\\s+((((also|not|(also not)|well)\\s+)?(be|contain|constitute|email|e-mail|take|have|result|involve|get|work|reply))|(or may not))))\\b`; + EnglishDateTime.DateYearRegex = `(?${baseDateTime.BaseDateTime.FourDigitYearRegex}|${EnglishDateTime.TwoDigitYearRegex})`; + EnglishDateTime.YearSuffix = `(,?\\s*(${EnglishDateTime.DateYearRegex}|${EnglishDateTime.FullTextYearRegex}))`; + EnglishDateTime.OnRegex = `(?<=\\bon\\s+)(${EnglishDateTime.DayRegex}s?)\\b`; + EnglishDateTime.RelaxedOnRegex = `(?<=\\b(on|at|in)\\s+)((?10th|11th|11st|12nd|12th|13rd|13th|14th|15th|16th|17th|18th|19th|1st|20th|21st|21th|22nd|22th|23rd|23th|24th|25th|26th|27th|28th|29th|2nd|30th|31st|3rd|4th|5th|6th|7th|8th|9th)s?)\\b`; + EnglishDateTime.ThisRegex = `\\b((this(\\s*week)?(\\s*on)?\\s+)${EnglishDateTime.WeekDayRegex})|(${EnglishDateTime.WeekDayRegex}((\\s+of)?\\s+this\\s*week))\\b`; + EnglishDateTime.LastDateRegex = `\\b(${EnglishDateTime.PastPrefixRegex}(\\s*week)?\\s+${EnglishDateTime.WeekDayRegex})|(${EnglishDateTime.WeekDayRegex}(\\s+last\\s*week))\\b`; + EnglishDateTime.NextDateRegex = `\\b(${EnglishDateTime.NextPrefixRegex}(\\s*week(\\s*,?\\s*on)?)?\\s+${EnglishDateTime.WeekDayRegex})|((on\\s+)?${EnglishDateTime.WeekDayRegex}((\\s+of)?\\s+(the\\s+following|(the\\s+)?next)\\s*week))\\b`; + EnglishDateTime.SpecialDayRegex = `\\b((the\\s+)?day before yesterday|(the\\s+)?day after (tomorrow|tmr)|((the\\s+)?(${EnglishDateTime.RelativeRegex}|my)\\s+day)|yesterday|tomorrow|tmr|today)\\b`; + EnglishDateTime.SpecialDayWithNumRegex = `\\b((?${EnglishDateTime.WrittenNumRegex})\\s+days?\\s+from\\s+(?yesterday|tomorrow|tmr|today))\\b`; + EnglishDateTime.RelativeDayRegex = `\\b(((the\\s+)?${EnglishDateTime.RelativeRegex}\\s+day))\\b`; + EnglishDateTime.SetWeekDayRegex = `\\b(?on\\s+)?(?morning|afternoon|evening|night|Sunday|Monday|Tuesday|Wednesday|Thursday|Friday|Saturday)s\\b`; + EnglishDateTime.WeekDayOfMonthRegex = `(?(the\\s+)?(?first|1st|second|2nd|third|3rd|fourth|4th|fifth|5th|last)\\s+${EnglishDateTime.WeekDayRegex}\\s+${EnglishDateTime.MonthSuffixRegex})`; + EnglishDateTime.RelativeWeekDayRegex = `\\b(${EnglishDateTime.WrittenNumRegex}\\s+${EnglishDateTime.WeekDayRegex}\\s+(from\\s+now|later))\\b`; + EnglishDateTime.SpecialDate = `(?=\\b(on|at)\\s+the\\s+)${EnglishDateTime.DayRegex}\\b`; + EnglishDateTime.DatePreposition = `\\b(on|in)`; + EnglishDateTime.DateExtractor1 = `\\b((this\\s+)?${EnglishDateTime.WeekDayRegex}\\s*[,-]?\\s*)?((${EnglishDateTime.MonthRegex}(\\.)?\\s*[/\\\\.,-]?\\s*${EnglishDateTime.DayRegex})|(\\(${EnglishDateTime.MonthRegex}\\s*[-.]\\s*${EnglishDateTime.DayRegex}\\)))(\\s*\\(\\s*${EnglishDateTime.WeekDayRegex}\\s*\\))?`; + EnglishDateTime.DateExtractor2 = `\\b${EnglishDateTime.DateExtractor1}(\\s+|\\s*,\\s*|\\s+of\\s+)${EnglishDateTime.DateYearRegex}\\b`; + EnglishDateTime.DateExtractor3 = `\\b(${EnglishDateTime.WeekDayRegex}(\\s+|\\s*,\\s*))?${EnglishDateTime.DayRegex}(\\.)?(\\s+|\\s*,\\s*|\\s+of\\s+|\\s*-\\s*)${EnglishDateTime.MonthRegex}(\\.)?((\\s+|\\s*,\\s*)${EnglishDateTime.DateYearRegex})?\\b`; + EnglishDateTime.DateExtractor4 = `\\b${EnglishDateTime.MonthNumRegex}\\s*[/\\\\\\-]\\s*${EnglishDateTime.DayRegex}(\\.)?\\s*[/\\\\\\-]\\s*${EnglishDateTime.DateYearRegex}`; + EnglishDateTime.DateExtractor5 = `\\b${EnglishDateTime.DayRegex}\\s*[/\\\\\\-\\.]\\s*${EnglishDateTime.MonthNumRegex}\\s*[/\\\\\\-\\.]\\s*${EnglishDateTime.DateYearRegex}`; + EnglishDateTime.DateExtractor6 = `(?<=${EnglishDateTime.DatePreposition}\\s+)(${EnglishDateTime.WeekDayRegex}\\s+)?${EnglishDateTime.MonthNumRegex}[\\-\\.]${EnglishDateTime.DayRegex}(?![%])\\b`; + EnglishDateTime.DateExtractor7 = `\\b(${EnglishDateTime.WeekDayRegex}\\s+)?${EnglishDateTime.MonthNumRegex}\\s*/\\s*${EnglishDateTime.DayRegex}((\\s+|\\s*,\\s*|\\s+of\\s+)${EnglishDateTime.DateYearRegex})?(?![%])\\b`; + EnglishDateTime.DateExtractor8 = `(?<=${EnglishDateTime.DatePreposition}\\s+)(${EnglishDateTime.WeekDayRegex}\\s+)?${EnglishDateTime.DayRegex}[\\\\\\-]${EnglishDateTime.MonthNumRegex}(?![%])\\b`; + EnglishDateTime.DateExtractor9 = `\\b(${EnglishDateTime.WeekDayRegex}\\s+)?${EnglishDateTime.DayRegex}\\s*/\\s*${EnglishDateTime.MonthNumRegex}((\\s+|\\s*,\\s*|\\s+of\\s+)${EnglishDateTime.DateYearRegex})?(?![%])\\b`; + EnglishDateTime.DateExtractorA = `\\b(${EnglishDateTime.WeekDayRegex}\\s+)?${EnglishDateTime.DateYearRegex}\\s*[/\\\\\\-\\.]\\s*${EnglishDateTime.MonthNumRegex}\\s*[/\\\\\\-\\.]\\s*${EnglishDateTime.DayRegex}`; + EnglishDateTime.OfMonth = `^\\s*of\\s*${EnglishDateTime.MonthRegex}`; + EnglishDateTime.MonthEnd = `${EnglishDateTime.MonthRegex}\\s*(the)?\\s*$`; + EnglishDateTime.WeekDayEnd = `(this\\s+)?${EnglishDateTime.WeekDayRegex}\\s*,?\\s*$`; + EnglishDateTime.RangeUnitRegex = `\\b(?years|year|months|month|weeks|week)\\b`; + EnglishDateTime.OclockRegex = `(?o\\s*’\\s*clock|o\\s*‘\\s*clock|o\\s*'\\s*clock|o\\s*clock)`; + EnglishDateTime.DescRegex = `(((${EnglishDateTime.OclockRegex}\\s+)?(?ampm|am\\b|a\\.m\\.|a m\\b|a\\. m\\.|a\\.m\\b|a\\. m\\b|a m\\b|pm\\b|p\\.m\\.|p m\\b|p\\. m\\.|p\\.m\\b|p\\. m\\b|p\\b|p m\\b))|${EnglishDateTime.OclockRegex})`; + EnglishDateTime.HourNumRegex = `\\b(?zero|one|two|three|four|five|six|seven|eight|nine|ten|eleven|twelve)\\b`; + EnglishDateTime.MinuteNumRegex = `(?one|two|three|four|five|six|seven|eight|nine|ten|eleven|twelve|thirteen|fourteen|fifteen|sixteen|seventeen|eighteen|nineteen|twenty|thirty|forty|fifty)`; + EnglishDateTime.DeltaMinuteNumRegex = `(?one|two|three|four|five|six|seven|eight|nine|ten|eleven|twelve|thirteen|fourteen|fifteen|sixteen|seventeen|eighteen|nineteen|twenty|thirty|forty|fifty)`; + EnglishDateTime.PmRegex = `(?(((at|in|around|on|for)\\s+(the\\s+)?)?(afternoon|evening|midnight|lunchtime))|((at|in|around|on|for)\\s+(the\\s+)?night))`; + EnglishDateTime.PmRegexFull = `(?((at|in|around|on|for)\\s+(the\\s+)?)?(afternoon|evening|midnight|night|lunchtime))`; + EnglishDateTime.AmRegex = `(?((at|in|around|on|for)\\s+(the\\s+)?)?(morning))`; + EnglishDateTime.LunchRegex = `\\b(lunchtime)\\b`; + EnglishDateTime.NightRegex = `\\b(midnight|night)\\b`; + EnglishDateTime.CommonDatePrefixRegex = `^[\\.]`; + EnglishDateTime.LessThanOneHour = `(?(a\\s+)?quarter|three quarter(s)?|half( an hour)?|${baseDateTime.BaseDateTime.DeltaMinuteRegex}(\\s+(minute|minutes|min|mins))|${EnglishDateTime.DeltaMinuteNumRegex}(\\s+(minute|minutes|min|mins)))`; + EnglishDateTime.WrittenTimeRegex = `(?${EnglishDateTime.HourNumRegex}\\s+(${EnglishDateTime.MinuteNumRegex}|(?twenty|thirty|forty|fourty|fifty)\\s+${EnglishDateTime.MinuteNumRegex}))`; + EnglishDateTime.TimePrefix = `(?(${EnglishDateTime.LessThanOneHour} past|${EnglishDateTime.LessThanOneHour} to))`; + EnglishDateTime.TimeSuffix = `(?${EnglishDateTime.AmRegex}|${EnglishDateTime.PmRegex}|${EnglishDateTime.OclockRegex})`; + EnglishDateTime.TimeSuffixFull = `(?${EnglishDateTime.AmRegex}|${EnglishDateTime.PmRegexFull}|${EnglishDateTime.OclockRegex})`; + EnglishDateTime.BasicTime = `\\b(?${EnglishDateTime.WrittenTimeRegex}|${EnglishDateTime.HourNumRegex}|${baseDateTime.BaseDateTime.HourRegex}:${baseDateTime.BaseDateTime.MinuteRegex}(:${baseDateTime.BaseDateTime.SecondRegex})?|${baseDateTime.BaseDateTime.HourRegex})`; + EnglishDateTime.MidnightRegex = `(?midnight|mid-night|mid night)`; + EnglishDateTime.MidmorningRegex = `(?midmorning|mid-morning|mid morning)`; + EnglishDateTime.MidafternoonRegex = `(?midafternoon|mid-afternoon|mid afternoon)`; + EnglishDateTime.MiddayRegex = `(?midday|mid-day|mid day|((12\\s)?noon))`; + EnglishDateTime.MidTimeRegex = `(?(${EnglishDateTime.MidnightRegex}|${EnglishDateTime.MidmorningRegex}|${EnglishDateTime.MidafternoonRegex}|${EnglishDateTime.MiddayRegex}))`; + EnglishDateTime.AtRegex = `\\b(((?<=\\bat\\s+)(${EnglishDateTime.WrittenTimeRegex}|${EnglishDateTime.HourNumRegex}|${baseDateTime.BaseDateTime.HourRegex}(?!\\.\\d)(\\s*((?a)|(?p)))?|${EnglishDateTime.MidTimeRegex}))|${EnglishDateTime.MidTimeRegex})\\b`; + EnglishDateTime.IshRegex = `\\b(${baseDateTime.BaseDateTime.HourRegex}(-|——)?ish|noonish|noon)\\b`; + EnglishDateTime.TimeUnitRegex = `([^A-Za-z]{1,}|\\b)(?hours|hour|hrs|hr|h|minutes|minute|mins|min|seconds|second|secs|sec)\\b`; + EnglishDateTime.RestrictedTimeUnitRegex = `(?hour|minute)\\b`; + EnglishDateTime.FivesRegex = `(?(fifteen|twenty(\\s*five)?|thirty(\\s*five)?|forty(\\s*five)?|fourty(\\s*five)?|fifty(\\s*five)?|ten|five))\\b`; + EnglishDateTime.HourRegex = `\\b${baseDateTime.BaseDateTime.HourRegex}`; + EnglishDateTime.PeriodHourNumRegex = `\\b(?twenty one|twenty two|twenty three|twenty four|zero|one|two|three|four|five|six|seven|eight|nine|ten|eleven|twelve|thirteen|fourteen|fifteen|sixteen|seventeen|eighteen|nineteen|twenty)\\b`; + EnglishDateTime.ConnectNumRegex = `\\b${baseDateTime.BaseDateTime.HourRegex}(?00|01|02|03|04|05|06|07|08|09|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)\\s*${EnglishDateTime.DescRegex}`; + EnglishDateTime.TimeRegexWithDotConnector = `(${baseDateTime.BaseDateTime.HourRegex}(\\s*\\.\\s*)${baseDateTime.BaseDateTime.MinuteRegex})`; + EnglishDateTime.TimeRegex1 = `\\b(${EnglishDateTime.TimePrefix}\\s+)?(${EnglishDateTime.WrittenTimeRegex}|${EnglishDateTime.HourNumRegex}|${baseDateTime.BaseDateTime.HourRegex})\\s*${EnglishDateTime.DescRegex}`; + EnglishDateTime.TimeRegex2 = `(\\b${EnglishDateTime.TimePrefix}\\s+)?(T)?${baseDateTime.BaseDateTime.HourRegex}(\\s*)?:(\\s*)?${baseDateTime.BaseDateTime.MinuteRegex}((\\s*)?:(\\s*)?${baseDateTime.BaseDateTime.SecondRegex})?((\\s*${EnglishDateTime.DescRegex})|\\b)`; + EnglishDateTime.TimeRegex3 = `(\\b${EnglishDateTime.TimePrefix}\\s+)?${baseDateTime.BaseDateTime.HourRegex}\\.${baseDateTime.BaseDateTime.MinuteRegex}(\\s*${EnglishDateTime.DescRegex})`; + EnglishDateTime.TimeRegex4 = `\\b${EnglishDateTime.TimePrefix}\\s+${EnglishDateTime.BasicTime}(\\s*${EnglishDateTime.DescRegex})?\\s+${EnglishDateTime.TimeSuffix}\\b`; + EnglishDateTime.TimeRegex5 = `\\b${EnglishDateTime.TimePrefix}\\s+${EnglishDateTime.BasicTime}((\\s*${EnglishDateTime.DescRegex})|\\b)`; + EnglishDateTime.TimeRegex6 = `${EnglishDateTime.BasicTime}(\\s*${EnglishDateTime.DescRegex})?\\s+${EnglishDateTime.TimeSuffix}\\b`; + EnglishDateTime.TimeRegex7 = `\\b${EnglishDateTime.TimeSuffixFull}\\s+at\\s+${EnglishDateTime.BasicTime}((\\s*${EnglishDateTime.DescRegex})|\\b)`; + EnglishDateTime.TimeRegex8 = `\\b${EnglishDateTime.TimeSuffixFull}\\s+${EnglishDateTime.BasicTime}((\\s*${EnglishDateTime.DescRegex})|\\b)`; + EnglishDateTime.TimeRegex9 = `\\b${EnglishDateTime.PeriodHourNumRegex}\\s+${EnglishDateTime.FivesRegex}((\\s*${EnglishDateTime.DescRegex})|\\b)`; + EnglishDateTime.TimeRegex10 = `\\b(${EnglishDateTime.TimePrefix}\\s+)?${baseDateTime.BaseDateTime.HourRegex}(\\s*h\\s*)${baseDateTime.BaseDateTime.MinuteRegex}(\\s*${EnglishDateTime.DescRegex})?`; + EnglishDateTime.TimeRegex11 = `\\b((${EnglishDateTime.TimeTokenPrefix}${EnglishDateTime.TimeRegexWithDotConnector})(?!\\s*per\\s*cent|%)|(${EnglishDateTime.TimeRegexWithDotConnector}(\\s*${EnglishDateTime.DescRegex})))`; + EnglishDateTime.FirstTimeRegexInTimeRange = `\\b${EnglishDateTime.TimeRegexWithDotConnector}(\\s*${EnglishDateTime.DescRegex})?`; + EnglishDateTime.PureNumFromTo = `((from|between)\\s+)?(${EnglishDateTime.HourRegex}|${EnglishDateTime.PeriodHourNumRegex})(\\s*(?${EnglishDateTime.DescRegex}))?\\s*${EnglishDateTime.TillRegex}\\s*(${EnglishDateTime.HourRegex}|${EnglishDateTime.PeriodHourNumRegex})(?\\s*(${EnglishDateTime.PmRegex}|${EnglishDateTime.AmRegex}|${EnglishDateTime.DescRegex}))?`; + EnglishDateTime.PureNumBetweenAnd = `(between\\s+)(${EnglishDateTime.HourRegex}|${EnglishDateTime.PeriodHourNumRegex})(\\s*(?${EnglishDateTime.DescRegex}))?\\s*${EnglishDateTime.RangeConnectorRegex}\\s*(${EnglishDateTime.HourRegex}|${EnglishDateTime.PeriodHourNumRegex})(?\\s*(${EnglishDateTime.PmRegex}|${EnglishDateTime.AmRegex}|${EnglishDateTime.DescRegex}))?`; + EnglishDateTime.SpecificTimeFromTo = `((from|between)\\s+)?(?((${EnglishDateTime.TimeRegex2}|${EnglishDateTime.FirstTimeRegexInTimeRange})|(${EnglishDateTime.HourRegex}|${EnglishDateTime.PeriodHourNumRegex})(\\s*(?${EnglishDateTime.DescRegex}))?))\\s*${EnglishDateTime.TillRegex}\\s*(?((${EnglishDateTime.TimeRegex2}|${EnglishDateTime.TimeRegexWithDotConnector}(?\\s*${EnglishDateTime.DescRegex}))|(${EnglishDateTime.HourRegex}|${EnglishDateTime.PeriodHourNumRegex})(\\s*(?${EnglishDateTime.DescRegex}))?))`; + EnglishDateTime.SpecificTimeBetweenAnd = `(between\\s+)(?((${EnglishDateTime.TimeRegex2}|${EnglishDateTime.FirstTimeRegexInTimeRange})|(${EnglishDateTime.HourRegex}|${EnglishDateTime.PeriodHourNumRegex})(\\s*(?${EnglishDateTime.DescRegex}))?))\\s*${EnglishDateTime.RangeConnectorRegex}\\s*(?((${EnglishDateTime.TimeRegex2}|${EnglishDateTime.TimeRegexWithDotConnector}(?\\s*${EnglishDateTime.DescRegex}))|(${EnglishDateTime.HourRegex}|${EnglishDateTime.PeriodHourNumRegex})(\\s*(?${EnglishDateTime.DescRegex}))?))`; + EnglishDateTime.PrepositionRegex = `(?^(at|on|of)(\\s+the)?$)`; + EnglishDateTime.TimeOfDayRegex = `\\b(?((((in\\s+(the)?\\s+)?((?early(\\s+|-))|(?late(\\s+|-)))?(morning|afternoon|night|evening)))|(((in\\s+(the)?\\s+)?)(daytime|business\\s+hour)))s?)\\b`; + EnglishDateTime.SpecificTimeOfDayRegex = `\\b((${EnglishDateTime.StrictRelativeRegex}\\s+${EnglishDateTime.TimeOfDayRegex})\\b|\\btonight)s?\\b`; + EnglishDateTime.TimeFollowedUnit = `^\\s*${EnglishDateTime.TimeUnitRegex}`; + EnglishDateTime.TimeNumberCombinedWithUnit = `\\b(?\\d+(\\.\\d*)?)${EnglishDateTime.TimeUnitRegex}`; + EnglishDateTime.BusinessHourSplitStrings = ['business', 'hour']; + EnglishDateTime.NowRegex = `\\b(?(right\\s+)?now|as soon as possible|asap|recently|previously)\\b`; + EnglishDateTime.SuffixRegex = `^\\s*(in the\\s+)?(morning|afternoon|evening|night)\\b`; + EnglishDateTime.DateTimeTimeOfDayRegex = `\\b(?morning|afternoon|night|evening)\\b`; + EnglishDateTime.DateTimeSpecificTimeOfDayRegex = `\\b((${EnglishDateTime.RelativeRegex}\\s+${EnglishDateTime.DateTimeTimeOfDayRegex})\\b|\\btonight)\\b`; + EnglishDateTime.TimeOfTodayAfterRegex = `^\\s*(,\\s*)?(in\\s+)?${EnglishDateTime.DateTimeSpecificTimeOfDayRegex}`; + EnglishDateTime.TimeOfTodayBeforeRegex = `${EnglishDateTime.DateTimeSpecificTimeOfDayRegex}(\\s*,)?(\\s+(at|around|in|on))?\\s*$`; + EnglishDateTime.SimpleTimeOfTodayAfterRegex = `(${EnglishDateTime.HourNumRegex}|${baseDateTime.BaseDateTime.HourRegex})\\s*(,\\s*)?(in\\s+)?${EnglishDateTime.DateTimeSpecificTimeOfDayRegex}`; + EnglishDateTime.SimpleTimeOfTodayBeforeRegex = `\\b${EnglishDateTime.DateTimeSpecificTimeOfDayRegex}(\\s*,)?(\\s+(at|around))?\\s*(${EnglishDateTime.HourNumRegex}|${baseDateTime.BaseDateTime.HourRegex})\\b`; + EnglishDateTime.TheEndOfRegex = `(the\\s+)?end of(\\s+the)?\\s*$`; + EnglishDateTime.PeriodTimeOfDayRegex = `\\b((in\\s+(the)?\\s+)?((?early(\\s+|-))|(?late(\\s+|-)))?(?morning|afternoon|night|evening))\\b`; + EnglishDateTime.PeriodSpecificTimeOfDayRegex = `\\b((${EnglishDateTime.StrictRelativeRegex}\\s+${EnglishDateTime.PeriodTimeOfDayRegex})\\b|\\btonight)\\b`; + EnglishDateTime.PeriodTimeOfDayWithDateRegex = `\\b((${EnglishDateTime.TimeOfDayRegex}(\\s+(on|of))?))\\b`; + EnglishDateTime.LessThanRegex = `\\b(less\\s+than)\\b`; + EnglishDateTime.MoreThanRegex = `\\b(more\\s+than)\\b`; + EnglishDateTime.DurationUnitRegex = `(?${EnglishDateTime.DateUnitRegex}|hours?|hrs?|h|minutes?|mins?|seconds?|secs?)\\b`; + EnglishDateTime.SuffixAndRegex = `(?\\s*(and)\\s+((an|a)\\s+)?(?half|quarter))`; + EnglishDateTime.PeriodicRegex = `\\b(?daily|monthly|weekly|biweekly|yearly|annually|annual)\\b`; + EnglishDateTime.EachUnitRegex = `(?(each|every)(?\\s+other)?\\s*${EnglishDateTime.DurationUnitRegex})`; + EnglishDateTime.EachPrefixRegex = `\\b(?(each|(every))\\s*$)`; + EnglishDateTime.SetEachRegex = `\\b(?(each|(every))\\s*)`; + EnglishDateTime.SetLastRegex = `(?following|next|upcoming|this|last|past|previous|current)`; + EnglishDateTime.EachDayRegex = `^\\s*(each|every)\\s*day\\b`; + EnglishDateTime.DurationFollowedUnit = `^\\s*${EnglishDateTime.SuffixAndRegex}?(\\s+|-)?${EnglishDateTime.DurationUnitRegex}`; + EnglishDateTime.NumberCombinedWithDurationUnit = `\\b(?\\d+(\\.\\d*)?)(-)?${EnglishDateTime.DurationUnitRegex}`; + EnglishDateTime.AnUnitRegex = `\\b((?half\\s+)?(an|a)|another)\\s+${EnglishDateTime.DurationUnitRegex}`; + EnglishDateTime.DuringRegex = `\\b(for|during)\\s+the\\s+(?year|month|week|day)\\b`; + EnglishDateTime.AllRegex = `\\b(?(all|full|whole)(\\s+|-)(?year|month|week|day))\\b`; + EnglishDateTime.HalfRegex = `(((a|an)\\s*)|\\b)(?half\\s+(?year|month|week|day|hour))\\b`; + EnglishDateTime.ConjunctionRegex = `\\b((and(\\s+for)?)|with)\\b`; + EnglishDateTime.HolidayRegex1 = `\\b(?clean monday|good friday|ash wednesday|mardi gras|washington's birthday|mao's birthday|chinese new Year|new years' eve|new year's eve|new year 's eve|new years eve|new year eve|new years'|new year's|new year 's|new years|new year|may\\s*day|yuan dan|april fools|christmas eve|christmas|xmas|thanksgiving|halloween|yuandan|easter)(\\s+(of\\s+)?(${EnglishDateTime.YearRegex}|${EnglishDateTime.RelativeRegex}\\s+year))?\\b`; + EnglishDateTime.HolidayRegex2 = `\\b(?all saint's|tree planting day|white lover|st patrick|st george|cinco de mayo|us independence|all hallow|all souls|guy fawkes)(\\s+(of\\s+)?(${EnglishDateTime.YearRegex}|${EnglishDateTime.RelativeRegex}\\s+year))?\\b`; + EnglishDateTime.HolidayRegex3 = `(?(independence|mlk|martin luther king|martin luther king jr|canberra|easter|columbus|thanks\\s*giving|christmas|xmas|labour|(international|int'l)\\s+workers'?|mother's|mother|mothers|father's|father|fathers|female|single|teacher's|youth|children|arbor|girls|chsmilbuild|lover|labor|inauguration|groundhog|valentine's|baptiste|bastille|halloween|veterans|memorial|mid(-| )autumn|moon|spring|lantern|qingming|dragon boat|new years'|new year's|new year 's|new years|new year)\\s+(day))(\\s+(of\\s+)?(${EnglishDateTime.YearRegex}|${EnglishDateTime.RelativeRegex}\\s+year))?`; + EnglishDateTime.AMTimeRegex = `(?morning)`; + EnglishDateTime.PMTimeRegex = `\\b(?afternoon|evening|night)\\b`; + EnglishDateTime.InclusiveModPrepositions = `(?((on|in|at)\\s+or\\s+)|(\\s+or\\s+(on|in|at)))`; + EnglishDateTime.BeforeRegex = `(\\b${EnglishDateTime.InclusiveModPrepositions}?(before|in\\s+advance\\s+of|prior\\s+to|(no\\s+later|earlier|sooner)\\s+than|ending\\s+(with|on)|by|till|til|until|(?as\\s+late\\s+as))${EnglishDateTime.InclusiveModPrepositions}?\\b\\s*)|(?)((?<=)|<)`; + EnglishDateTime.AfterRegex = `(\\b${EnglishDateTime.InclusiveModPrepositions}?((after|(?>=)|>)`; + EnglishDateTime.SinceRegex = `(\\b(since|after\\s+or\\s+equal\\s+to|starting\\s+(from|on|with)|as\\s+early\\s+as|any\\s+time\\s+from)\\b\\s*)|(?=)`; + EnglishDateTime.AroundRegex = `(\\b(around|circa)\\s*\\b)`; + EnglishDateTime.AgoRegex = `\\b(ago|before\\s+(?yesterday|today))\\b`; + EnglishDateTime.LaterRegex = `\\b(later|from now|(from|after) (?tomorrow|tmr|today))\\b`; + EnglishDateTime.InConnectorRegex = `\\b(in)\\b`; + EnglishDateTime.WithinNextPrefixRegex = `\\b(within(\\s+the)?(\\s+(?${EnglishDateTime.NextPrefixRegex}))?)\\b`; + EnglishDateTime.AmPmDescRegex = `(ampm)`; + EnglishDateTime.MorningStartEndRegex = `(^(morning|${EnglishDateTime.AmDescRegex}))|((morning|${EnglishDateTime.AmDescRegex})$)`; + EnglishDateTime.AfternoonStartEndRegex = `(^(afternoon|${EnglishDateTime.PmDescRegex}))|((afternoon|${EnglishDateTime.PmDescRegex})$)`; + EnglishDateTime.EveningStartEndRegex = `(^(evening))|((evening)$)`; + EnglishDateTime.NightStartEndRegex = `(^(overnight|tonight|night))|((overnight|tonight|night)$)`; + EnglishDateTime.InexactNumberRegex = `\\b(a few|few|some|several|(?(a\\s+)?couple(\\s+of)?))\\b`; + EnglishDateTime.InexactNumberUnitRegex = `(${EnglishDateTime.InexactNumberRegex})\\s+(${EnglishDateTime.DurationUnitRegex})`; + EnglishDateTime.RelativeTimeUnitRegex = `(((${EnglishDateTime.NextPrefixRegex}|${EnglishDateTime.PastPrefixRegex}|${EnglishDateTime.ThisPrefixRegex})\\s+(${EnglishDateTime.TimeUnitRegex}))|((the|my))\\s+(${EnglishDateTime.RestrictedTimeUnitRegex}))`; + EnglishDateTime.RelativeDurationUnitRegex = `(((?<=(${EnglishDateTime.NextPrefixRegex}|${EnglishDateTime.PastPrefixRegex}|${EnglishDateTime.ThisPrefixRegex})\\s+)(${EnglishDateTime.DurationUnitRegex}))|((the|my))\\s+(${EnglishDateTime.RestrictedTimeUnitRegex}))`; + EnglishDateTime.ReferenceDatePeriodRegex = `\\b${EnglishDateTime.ReferencePrefixRegex}\\s+(?week|month|year|decade|weekend)\\b`; + EnglishDateTime.ConnectorRegex = `^(-|,|for|t|around|@)$`; + EnglishDateTime.FromToRegex = `\\b(from).+(to)\\b.+`; + EnglishDateTime.SingleAmbiguousMonthRegex = `^(the\\s+)?(may|march)$`; + EnglishDateTime.SingleAmbiguousTermsRegex = `^(the\\s+)?(day|week|month|year)$`; + EnglishDateTime.UnspecificDatePeriodRegex = `^(week|weekend|month|year)$`; + EnglishDateTime.PrepositionSuffixRegex = `\\b(on|in|at|around|from|to)$`; + EnglishDateTime.FlexibleDayRegex = `(?([A-Za-z]+\\s)?[A-Za-z\\d]+)`; + EnglishDateTime.ForTheRegex = `\\b((((?<=for\\s+)the\\s+${EnglishDateTime.FlexibleDayRegex})|((?<=on\\s+)(the\\s+)?${EnglishDateTime.FlexibleDayRegex}(?<=(st|nd|rd|th))))(?\\s*(,|\\.|!|\\?|$)))`; + EnglishDateTime.WeekDayAndDayOfMonthRegex = `\\b${EnglishDateTime.WeekDayRegex}\\s+(the\\s+${EnglishDateTime.FlexibleDayRegex})\\b`; + EnglishDateTime.RestOfDateRegex = `\\bRest\\s+(of\\s+)?((the|my|this|current)\\s+)?(?week|month|year|decade)\\b`; + EnglishDateTime.RestOfDateTimeRegex = `\\bRest\\s+(of\\s+)?((the|my|this|current)\\s+)?(?day)\\b`; + EnglishDateTime.MealTimeRegex = `\\b(at\\s+)?(?lunchtime)\\b`; + EnglishDateTime.NumberEndingPattern = `^(\\s+(?meeting|appointment|conference|call|skype call)\\s+to\\s+(?${EnglishDateTime.PeriodHourNumRegex}|${EnglishDateTime.HourRegex})((\\.)?$|(\\.,|,|!|\\?)))`; + EnglishDateTime.OneOnOneRegex = `\\b(1\\s*:\\s*1)|(one (on )?one|one\\s*-\\s*one|one\\s*:\\s*one)\\b`; + EnglishDateTime.LaterEarlyPeriodRegex = `\\b(${EnglishDateTime.PrefixPeriodRegex})\\s*\\b\\s*(?${EnglishDateTime.OneWordPeriodRegex})\\b`; + EnglishDateTime.WeekWithWeekDayRangeRegex = `\\b((?(${EnglishDateTime.NextPrefixRegex}|${EnglishDateTime.PastPrefixRegex}|this)\\s+week)((\\s+between\\s+${EnglishDateTime.WeekDayRegex}\\s+and\\s+${EnglishDateTime.WeekDayRegex})|(\\s+from\\s+${EnglishDateTime.WeekDayRegex}\\s+to\\s+${EnglishDateTime.WeekDayRegex})))\\b`; + EnglishDateTime.GeneralEndingRegex = `^\\s*((\\.,)|\\.|,|!|\\?)?\\s*$`; + EnglishDateTime.MiddlePauseRegex = `\\s*(,)\\s*`; + EnglishDateTime.DurationConnectorRegex = `^\\s*(?\\s+|and|,)\\s*$`; + EnglishDateTime.PrefixArticleRegex = `\\bthe\\s+`; + EnglishDateTime.OrRegex = `\\s*((\\b|,\\s*)(or|and)\\b|,)\\s*`; + EnglishDateTime.YearPlusNumberRegex = `\\b(Year\\s+((?(\\d{3,4}))|${EnglishDateTime.FullTextYearRegex}))\\b`; + EnglishDateTime.NumberAsTimeRegex = `\\b(${EnglishDateTime.WrittenTimeRegex}|${EnglishDateTime.PeriodHourNumRegex}|${baseDateTime.BaseDateTime.HourRegex})\\b`; + EnglishDateTime.TimeBeforeAfterRegex = `\\b(((?<=\\b(before|no later than|by|after)\\s+)(${EnglishDateTime.WrittenTimeRegex}|${EnglishDateTime.HourNumRegex}|${baseDateTime.BaseDateTime.HourRegex}|${EnglishDateTime.MidTimeRegex}))|${EnglishDateTime.MidTimeRegex})\\b`; + EnglishDateTime.DateNumberConnectorRegex = `^\\s*(?\\s+at)\\s*$`; + EnglishDateTime.DecadeRegex = `(?noughties|twenties|thirties|forties|fifties|sixties|seventies|eighties|nineties|two thousands)`; + EnglishDateTime.DecadeWithCenturyRegex = `(the\\s+)?(((?\\d|1\\d|2\\d)?(')?(?\\d0)(')?s)|((${EnglishDateTime.CenturyRegex}(\\s+|-)(and\\s+)?)?${EnglishDateTime.DecadeRegex})|(${EnglishDateTime.CenturyRegex}(\\s+|-)(and\\s+)?(?tens|hundreds)))`; + EnglishDateTime.RelativeDecadeRegex = `\\b((the\\s+)?${EnglishDateTime.RelativeRegex}\\s+((?[\\w,]+)\\s+)?decades?)\\b`; + EnglishDateTime.DateAfterRegex = `\\b((or|and)\\s+(above|after|later|greater)(?!\\s+than))\\b`; + EnglishDateTime.YearPeriodRegex = `((((from|during|in)\\s+)?${EnglishDateTime.YearRegex}\\s*(${EnglishDateTime.TillRegex})\\s*${EnglishDateTime.YearRegex})|(((between)\\s+)${EnglishDateTime.YearRegex}\\s*(${EnglishDateTime.RangeConnectorRegex})\\s*${EnglishDateTime.YearRegex}))`; + EnglishDateTime.ComplexDatePeriodRegex = `(((from|during|in)\\s+)?(?.+)\\s*(${EnglishDateTime.TillRegex})\\s*(?.+)|((between)\\s+)(?.+)\\s*(${EnglishDateTime.RangeConnectorRegex})\\s*(?.+))`; + EnglishDateTime.UnitMap = new Map([["decades", "10Y"], ["decade", "10Y"], ["years", "Y"], ["year", "Y"], ["months", "MON"], ["month", "MON"], ["weeks", "W"], ["week", "W"], ["days", "D"], ["day", "D"], ["hours", "H"], ["hour", "H"], ["hrs", "H"], ["hr", "H"], ["h", "H"], ["minutes", "M"], ["minute", "M"], ["mins", "M"], ["min", "M"], ["seconds", "S"], ["second", "S"], ["secs", "S"], ["sec", "S"]]); + EnglishDateTime.UnitValueMap = new Map([["decades", 315360000], ["decade", 315360000], ["years", 31536000], ["year", 31536000], ["months", 2592000], ["month", 2592000], ["weeks", 604800], ["week", 604800], ["days", 86400], ["day", 86400], ["hours", 3600], ["hour", 3600], ["hrs", 3600], ["hr", 3600], ["h", 3600], ["minutes", 60], ["minute", 60], ["mins", 60], ["min", 60], ["seconds", 1], ["second", 1], ["secs", 1], ["sec", 1]]); + EnglishDateTime.SeasonMap = new Map([["spring", "SP"], ["summer", "SU"], ["fall", "FA"], ["autumn", "FA"], ["winter", "WI"]]); + EnglishDateTime.SeasonValueMap = new Map([["SP", 3], ["SU", 6], ["FA", 9], ["WI", 12]]); + EnglishDateTime.CardinalMap = new Map([["first", 1], ["1st", 1], ["second", 2], ["2nd", 2], ["third", 3], ["3rd", 3], ["fourth", 4], ["4th", 4], ["fifth", 5], ["5th", 5]]); + EnglishDateTime.DayOfWeek = new Map([["monday", 1], ["tuesday", 2], ["wednesday", 3], ["thursday", 4], ["friday", 5], ["saturday", 6], ["sunday", 0], ["mon", 1], ["tue", 2], ["tues", 2], ["wed", 3], ["wedn", 3], ["weds", 3], ["thu", 4], ["thur", 4], ["thurs", 4], ["fri", 5], ["sat", 6], ["sun", 0]]); + EnglishDateTime.MonthOfYear = new Map([["1", 1], ["2", 2], ["3", 3], ["4", 4], ["5", 5], ["6", 6], ["7", 7], ["8", 8], ["9", 9], ["10", 10], ["11", 11], ["12", 12], ["january", 1], ["february", 2], ["march", 3], ["april", 4], ["may", 5], ["june", 6], ["july", 7], ["august", 8], ["september", 9], ["october", 10], ["november", 11], ["december", 12], ["jan", 1], ["feb", 2], ["mar", 3], ["apr", 4], ["jun", 6], ["jul", 7], ["aug", 8], ["sep", 9], ["sept", 9], ["oct", 10], ["nov", 11], ["dec", 12], ["01", 1], ["02", 2], ["03", 3], ["04", 4], ["05", 5], ["06", 6], ["07", 7], ["08", 8], ["09", 9]]); + EnglishDateTime.Numbers = new Map([["zero", 0], ["one", 1], ["a", 1], ["an", 1], ["two", 2], ["three", 3], ["four", 4], ["five", 5], ["six", 6], ["seven", 7], ["eight", 8], ["nine", 9], ["ten", 10], ["eleven", 11], ["twelve", 12], ["thirteen", 13], ["fourteen", 14], ["fifteen", 15], ["sixteen", 16], ["seventeen", 17], ["eighteen", 18], ["nineteen", 19], ["twenty", 20], ["twenty one", 21], ["twenty two", 22], ["twenty three", 23], ["twenty four", 24], ["twenty five", 25], ["twenty six", 26], ["twenty seven", 27], ["twenty eight", 28], ["twenty nine", 29], ["thirty", 30], ["thirty one", 31], ["thirty two", 32], ["thirty three", 33], ["thirty four", 34], ["thirty five", 35], ["thirty six", 36], ["thirty seven", 37], ["thirty eight", 38], ["thirty nine", 39], ["forty", 40], ["forty one", 41], ["forty two", 42], ["forty three", 43], ["forty four", 44], ["forty five", 45], ["forty six", 46], ["forty seven", 47], ["forty eight", 48], ["forty nine", 49], ["fifty", 50], ["fifty one", 51], ["fifty two", 52], ["fifty three", 53], ["fifty four", 54], ["fifty five", 55], ["fifty six", 56], ["fifty seven", 57], ["fifty eight", 58], ["fifty nine", 59], ["sixty", 60], ["sixty one", 61], ["sixty two", 62], ["sixty three", 63], ["sixty four", 64], ["sixty five", 65], ["sixty six", 66], ["sixty seven", 67], ["sixty eight", 68], ["sixty nine", 69], ["seventy", 70], ["seventy one", 71], ["seventy two", 72], ["seventy three", 73], ["seventy four", 74], ["seventy five", 75], ["seventy six", 76], ["seventy seven", 77], ["seventy eight", 78], ["seventy nine", 79], ["eighty", 80], ["eighty one", 81], ["eighty two", 82], ["eighty three", 83], ["eighty four", 84], ["eighty five", 85], ["eighty six", 86], ["eighty seven", 87], ["eighty eight", 88], ["eighty nine", 89], ["ninety", 90], ["ninety one", 91], ["ninety two", 92], ["ninety three", 93], ["ninety four", 94], ["ninety five", 95], ["ninety six", 96], ["ninety seven", 97], ["ninety eight", 98], ["ninety nine", 99], ["one hundred", 100]]); + EnglishDateTime.DayOfMonth = new Map([["1st", 1], ["2nd", 2], ["3rd", 3], ["4th", 4], ["5th", 5], ["6th", 6], ["7th", 7], ["8th", 8], ["9th", 9], ["10th", 10], ["11th", 11], ["11st", 11], ["12th", 12], ["12nd", 12], ["13th", 13], ["13rd", 13], ["14th", 14], ["15th", 15], ["16th", 16], ["17th", 17], ["18th", 18], ["19th", 19], ["20th", 20], ["21st", 21], ["21th", 21], ["22nd", 22], ["22th", 22], ["23rd", 23], ["23th", 23], ["24th", 24], ["25th", 25], ["26th", 26], ["27th", 27], ["28th", 28], ["29th", 29], ["30th", 30], ["31st", 31]]); + EnglishDateTime.DoubleNumbers = new Map([["half", 0.5], ["quarter", 0.25]]); + EnglishDateTime.HolidayNames = new Map([["easterday", ["easterday", "easter"]], ["fathers", ["fatherday", "fathersday"]], ["mothers", ["motherday", "mothersday"]], ["thanksgiving", ["thanksgivingday", "thanksgiving"]], ["martinlutherking", ["mlkday", "martinlutherkingday", "martinlutherkingjrday"]], ["washingtonsbirthday", ["washingtonsbirthday", "washingtonbirthday"]], ["canberra", ["canberraday"]], ["labour", ["labourday", "laborday"]], ["columbus", ["columbusday"]], ["memorial", ["memorialday"]], ["yuandan", ["yuandan"]], ["maosbirthday", ["maosbirthday"]], ["teachersday", ["teachersday", "teacherday"]], ["singleday", ["singleday"]], ["allsaintsday", ["allsaintsday"]], ["youthday", ["youthday"]], ["childrenday", ["childrenday", "childday"]], ["femaleday", ["femaleday"]], ["treeplantingday", ["treeplantingday"]], ["arborday", ["arborday"]], ["girlsday", ["girlsday"]], ["whiteloverday", ["whiteloverday"]], ["loverday", ["loverday"]], ["christmas", ["christmasday", "christmas"]], ["xmas", ["xmasday", "xmas"]], ["newyear", ["newyear"]], ["newyearday", ["newyearday"]], ["newyearsday", ["newyearsday"]], ["inaugurationday", ["inaugurationday"]], ["groundhougday", ["groundhougday"]], ["valentinesday", ["valentinesday"]], ["stpatrickday", ["stpatrickday"]], ["aprilfools", ["aprilfools"]], ["stgeorgeday", ["stgeorgeday"]], ["mayday", ["mayday", "intlworkersday", "internationalworkersday"]], ["cincodemayoday", ["cincodemayoday"]], ["baptisteday", ["baptisteday"]], ["usindependenceday", ["usindependenceday"]], ["independenceday", ["independenceday"]], ["bastilleday", ["bastilleday"]], ["halloweenday", ["halloweenday"]], ["allhallowday", ["allhallowday"]], ["allsoulsday", ["allsoulsday"]], ["guyfawkesday", ["guyfawkesday"]], ["veteransday", ["veteransday"]], ["christmaseve", ["christmaseve"]], ["newyeareve", ["newyearseve", "newyeareve"]]]); + EnglishDateTime.WrittenDecades = new Map([["hundreds", 0], ["tens", 10], ["twenties", 20], ["thirties", 30], ["forties", 40], ["fifties", 50], ["sixties", 60], ["seventies", 70], ["eighties", 80], ["nineties", 90]]); + EnglishDateTime.SpecialDecadeCases = new Map([["noughties", 2000], ["two thousands", 2000]]); + EnglishDateTime.DefaultLanguageFallback = 'MDY'; + EnglishDateTime.SuperfluousWordList = ['preferably', 'how about', 'maybe', 'say', 'like']; + EnglishDateTime.DurationDateRestrictions = ['today', 'now']; + EnglishDateTime.AmbiguityFiltersDict = new Map([["\\bmorning|afternoon|evening|night|day\\b", "\\bgood\\s+(morning|afternoon|evening|night|day)\\b"], ["\\bmay\\b", "\\b((^may i)|(i|you|he|she|we|they)\\s+may|(may\\s+((((also|not|(also not)|well)\\s+)?(be|contain|constitute|email|e-mail|take|have|result|involve|get|work|reply))|(or may not))))\\b"]]); +})(EnglishDateTime = exports.EnglishDateTime || (exports.EnglishDateTime = {})); + +}); + +unwrapExports(englishDateTime); + +var parsers$4 = createCommonjsModule(function (module, exports) { +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); + + +class DateTimeParseResult extends recognizersText.ParseResult { +} +exports.DateTimeParseResult = DateTimeParseResult; +class BaseDateParserConfiguration { + constructor() { + this.dayOfMonth = baseDateTime.BaseDateTime.DayOfMonthDictionary; + } +} +exports.BaseDateParserConfiguration = BaseDateParserConfiguration; + +}); + +unwrapExports(parsers$4); + +/** + * lodash (Custom Build) + * Build: `lodash modularize exports="npm" -o ./` + * Copyright jQuery Foundation and other contributors + * Released under MIT license + * Based on Underscore.js 1.8.3 + * Copyright Jeremy Ashkenas, DocumentCloud and Investigative Reporters & Editors + */ + +/** Used as references for various `Number` constants. */ +var NAN = 0 / 0; + +/** `Object#toString` result references. */ +var symbolTag$2 = '[object Symbol]'; + +/** Used to match leading and trailing whitespace. */ +var reTrim = /^\s+|\s+$/g; + +/** Used to detect bad signed hexadecimal string values. */ +var reIsBadHex = /^[-+]0x[0-9a-f]+$/i; + +/** Used to detect binary string values. */ +var reIsBinary = /^0b[01]+$/i; + +/** Used to detect octal string values. */ +var reIsOctal = /^0o[0-7]+$/i; + +/** Built-in method references without a dependency on `root`. */ +var freeParseInt = parseInt; + +/** Used for built-in method references. */ +var objectProto$2 = Object.prototype; + +/** + * Used to resolve the + * [`toStringTag`](http://ecma-international.org/ecma-262/7.0/#sec-object.prototype.tostring) + * of values. + */ +var objectToString$2 = objectProto$2.toString; + +/** + * Checks if `value` is the + * [language type](http://www.ecma-international.org/ecma-262/7.0/#sec-ecmascript-language-types) + * of `Object`. (e.g. arrays, functions, objects, regexes, `new Number(0)`, and `new String('')`) + * + * @static + * @memberOf _ + * @since 0.1.0 + * @category Lang + * @param {*} value The value to check. + * @returns {boolean} Returns `true` if `value` is an object, else `false`. + * @example + * + * _.isObject({}); + * // => true + * + * _.isObject([1, 2, 3]); + * // => true + * + * _.isObject(_.noop); + * // => true + * + * _.isObject(null); + * // => false + */ +function isObject(value) { + var type = typeof value; + return !!value && (type == 'object' || type == 'function'); +} + +/** + * Checks if `value` is object-like. A value is object-like if it's not `null` + * and has a `typeof` result of "object". + * + * @static + * @memberOf _ + * @since 4.0.0 + * @category Lang + * @param {*} value The value to check. + * @returns {boolean} Returns `true` if `value` is object-like, else `false`. + * @example + * + * _.isObjectLike({}); + * // => true + * + * _.isObjectLike([1, 2, 3]); + * // => true + * + * _.isObjectLike(_.noop); + * // => false + * + * _.isObjectLike(null); + * // => false + */ +function isObjectLike$2(value) { + return !!value && typeof value == 'object'; +} + +/** + * Checks if `value` is classified as a `Symbol` primitive or object. + * + * @static + * @memberOf _ + * @since 4.0.0 + * @category Lang + * @param {*} value The value to check. + * @returns {boolean} Returns `true` if `value` is a symbol, else `false`. + * @example + * + * _.isSymbol(Symbol.iterator); + * // => true + * + * _.isSymbol('abc'); + * // => false + */ +function isSymbol$2(value) { + return typeof value == 'symbol' || + (isObjectLike$2(value) && objectToString$2.call(value) == symbolTag$2); +} + +/** + * Converts `value` to a number. + * + * @static + * @memberOf _ + * @since 4.0.0 + * @category Lang + * @param {*} value The value to process. + * @returns {number} Returns the number. + * @example + * + * _.toNumber(3.2); + * // => 3.2 + * + * _.toNumber(Number.MIN_VALUE); + * // => 5e-324 + * + * _.toNumber(Infinity); + * // => Infinity + * + * _.toNumber('3.2'); + * // => 3.2 + */ +function toNumber(value) { + if (typeof value == 'number') { + return value; + } + if (isSymbol$2(value)) { + return NAN; + } + if (isObject(value)) { + var other = typeof value.valueOf == 'function' ? value.valueOf() : value; + value = isObject(other) ? (other + '') : other; + } + if (typeof value != 'string') { + return value === 0 ? value : +value; + } + value = value.replace(reTrim, ''); + var isBinary = reIsBinary.test(value); + return (isBinary || reIsOctal.test(value)) + ? freeParseInt(value.slice(2), isBinary ? 2 : 8) + : (reIsBadHex.test(value) ? NAN : +value); +} + +var lodash_tonumber = toNumber; + +var baseDate = createCommonjsModule(function (module, exports) { +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); + + + + + + +class BaseDateExtractor { + constructor(config) { + this.extractorName = constants$2.Constants.SYS_DATETIME_DATE; + this.config = config; + } + extract(source, refDate) { + if (!refDate) + refDate = new Date(); + let referenceDate = refDate; + let tokens = new Array(); + tokens = tokens.concat(this.basicRegexMatch(source)); + tokens = tokens.concat(this.implicitDate(source)); + tokens = tokens.concat(this.numberWithMonth(source, referenceDate)); + tokens = tokens.concat(this.durationWithBeforeAndAfter(source, referenceDate)); + let result = utilities$2.Token.mergeAllTokens(tokens, source, this.extractorName); + return result; + } + basicRegexMatch(source) { + let ret = []; + this.config.dateRegexList.forEach(regexp => { + let matches = recognizersText.RegExpUtility.getMatches(regexp, source); + matches.forEach(match => { + ret.push(new utilities$2.Token(match.index, match.index + match.length)); + }); + }); + return ret; + } + implicitDate(source) { + let ret = []; + this.config.implicitDateList.forEach(regexp => { + let matches = recognizersText.RegExpUtility.getMatches(regexp, source); + matches.forEach(match => { + ret.push(new utilities$2.Token(match.index, match.index + match.length)); + }); + }); + return ret; + } + numberWithMonth(source, refDate) { + let ret = []; + let er = this.config.ordinalExtractor.extract(source).concat(this.config.integerExtractor.extract(source)); + er.forEach(result => { + let num = lodash_tonumber(this.config.numberParser.parse(result).value); + if (num < 1 || num > 31) { + return; + } + if (result.start >= 0) { + let frontString = source.substring(0, result.start | 0); + let match = recognizersText.RegExpUtility.getMatches(this.config.monthEnd, frontString)[0]; + if (match && match.length) { + ret.push(new utilities$2.Token(match.index, match.index + match.length + result.length)); + return; + } + // handling cases like 'for the 25th' + let matches = recognizersText.RegExpUtility.getMatches(this.config.forTheRegex, source); + let isFound = false; + matches.forEach(matchCase => { + if (matchCase) { + let ordinalNum = matchCase.groups('DayOfMonth').value; + if (ordinalNum === result.text) { + let length = matchCase.groups('end').value.length; + ret.push(new utilities$2.Token(matchCase.index, matchCase.index + matchCase.length - length)); + isFound = true; + } + } + }); + if (isFound) { + return; + } + // handling cases like 'Thursday the 21st', which both 'Thursday' and '21st' refer to a same date + matches = recognizersText.RegExpUtility.getMatches(this.config.weekDayAndDayOfMonthRegex, source); + matches.forEach(matchCase => { + if (matchCase) { + let ordinalNum = matchCase.groups('DayOfMonth').value; + if (ordinalNum === result.text) { + let month = refDate.getMonth(); + let year = refDate.getFullYear(); + // get week of day for the ordinal number which is regarded as a date of reference month + let date = utilities$2.DateUtils.safeCreateFromMinValue(year, month, num); + let numWeekDayStr = utilities$2.DayOfWeek[date.getDay()].toString().toLowerCase(); + // get week day from text directly, compare it with the weekday generated above + // to see whether they refer to a same week day + let extractedWeekDayStr = matchCase.groups("weekday").value.toString().toLowerCase(); + if (date !== utilities$2.DateUtils.minValue() && + this.config.dayOfWeek.get(numWeekDayStr) === this.config.dayOfWeek.get(extractedWeekDayStr)) { + ret.push(new utilities$2.Token(matchCase.index, result.start + result.length)); + isFound = true; + } + } + } + }); + if (isFound) { + return; + } + // handling cases like '20th of next month' + let suffixStr = source.substr(result.start + result.length).toLowerCase(); + match = recognizersText.RegExpUtility.getMatches(this.config.relativeMonthRegex, suffixStr.trim()).pop(); + if (match && match.index === 0) { + let spaceLen = suffixStr.length - suffixStr.trim().length; + ret.push(new utilities$2.Token(result.start, result.start + result.length + spaceLen + match.length)); + } + // handling cases like 'second Sunday' + match = recognizersText.RegExpUtility.getMatches(this.config.weekDayRegex, suffixStr.trim()).pop(); + if (match && match.index === 0 && num >= 1 && num <= 5 + && result.type === recognizersTextNumber.Constants.SYS_NUM_ORDINAL) { + let weekDayStr = match.groups('weekday').value; + if (this.config.dayOfWeek.has(weekDayStr)) { + let spaceLen = suffixStr.length - suffixStr.trim().length; + ret.push(new utilities$2.Token(result.start, result.start + result.length + spaceLen + match.length)); + } + } + } + if (result.start + result.length < source.length) { + let afterString = source.substring(result.start + result.length); + let match = recognizersText.RegExpUtility.getMatches(this.config.ofMonth, afterString)[0]; + if (match && match.length) { + ret.push(new utilities$2.Token(result.start, result.start + result.length + match.length)); + return; + } + } + }); + return ret; + } + durationWithBeforeAndAfter(source, refDate) { + let ret = []; + let durEx = this.config.durationExtractor.extract(source, refDate); + durEx.forEach(er => { + let match = recognizersText.RegExpUtility.getMatches(this.config.dateUnitRegex, er.text).pop(); + if (!match) + return; + ret = utilities$2.AgoLaterUtil.extractorDurationWithBeforeAndAfter(source, er, ret, this.config.utilityConfiguration); + }); + return ret; + } +} +exports.BaseDateExtractor = BaseDateExtractor; +class BaseDateParser { + constructor(config) { + this.parserName = constants$2.Constants.SYS_DATETIME_DATE; + this.config = config; + } + parse(extractorResult, referenceDate) { + if (!referenceDate) + referenceDate = new Date(); + let resultValue; + if (extractorResult.type === this.parserName) { + let source = extractorResult.text.toLowerCase(); + let innerResult = this.parseBasicRegexMatch(source, referenceDate); + if (!innerResult.success) { + innerResult = this.parseImplicitDate(source, referenceDate); + } + if (!innerResult.success) { + innerResult = this.parseWeekdayOfMonth(source, referenceDate); + } + if (!innerResult.success) { + innerResult = this.parserDurationWithAgoAndLater(source, referenceDate); + } + if (!innerResult.success) { + innerResult = this.parseNumberWithMonth(source, referenceDate); + } + if (!innerResult.success) { + innerResult = this.parseSingleNumber(source, referenceDate); + } + if (innerResult.success) { + innerResult.futureResolution = {}; + innerResult.futureResolution[constants$2.TimeTypeConstants.DATE] = utilities$2.FormatUtil.formatDate(innerResult.futureValue); + innerResult.pastResolution = {}; + innerResult.pastResolution[constants$2.TimeTypeConstants.DATE] = utilities$2.FormatUtil.formatDate(innerResult.pastValue); + resultValue = innerResult; + } + } + let result = new parsers$4.DateTimeParseResult(extractorResult); + result.value = resultValue; + result.timexStr = resultValue ? resultValue.timex : ''; + result.resolutionStr = ''; + return result; + } + parseBasicRegexMatch(source, referenceDate) { + let trimmedSource = source.trim(); + let result = new utilities$2.DateTimeResolutionResult(); + this.config.dateRegex.some(regex => { + let offset = 0; + let match = recognizersText.RegExpUtility.getMatches(regex, trimmedSource).pop(); + if (!match) { + match = recognizersText.RegExpUtility.getMatches(regex, this.config.dateTokenPrefix + trimmedSource).pop(); + offset = this.config.dateTokenPrefix.length; + } + if (match && match.index === offset && match.length === trimmedSource.length) { + result = this.matchToDate(match, referenceDate); + return true; + } + }); + return result; + } + parseImplicitDate(source, referenceDate) { + let trimmedSource = source.trim(); + let result = new utilities$2.DateTimeResolutionResult(); + // handle "on 12" + let match = recognizersText.RegExpUtility.getMatches(this.config.onRegex, this.config.dateTokenPrefix + trimmedSource).pop(); + if (match && match.index === this.config.dateTokenPrefix.length && match.length === trimmedSource.length) { + let day = 0; + let month = referenceDate.getMonth(); + let year = referenceDate.getFullYear(); + let dayStr = match.groups('day').value; + day = this.config.dayOfMonth.get(dayStr); + result.timex = utilities$2.FormatUtil.luisDate(-1, -1, day); + let tryStr = utilities$2.FormatUtil.luisDate(year, month, day); + let tryDate = Date.parse(tryStr); + let futureDate; + let pastDate; + if (tryDate && !isNaN(tryDate)) { + futureDate = utilities$2.DateUtils.safeCreateFromMinValue(year, month, day); + pastDate = utilities$2.DateUtils.safeCreateFromMinValue(year, month, day); + if (futureDate < referenceDate) { + futureDate.setMonth(futureDate.getMonth() + 1); + } + if (pastDate >= referenceDate) { + pastDate.setMonth(pastDate.getMonth() - 1); + } + } + else { + futureDate = utilities$2.DateUtils.safeCreateFromMinValue(year, month + 1, day); + pastDate = utilities$2.DateUtils.safeCreateFromMinValue(year, month - 1, day); + } + result.futureValue = futureDate; + result.pastValue = pastDate; + result.success = true; + return result; + } + // handle "today", "the day before yesterday" + match = recognizersText.RegExpUtility.getMatches(this.config.specialDayRegex, trimmedSource).pop(); + if (match && match.index === 0 && match.length === trimmedSource.length) { + let swift = this.config.getSwiftDay(match.value); + let value = utilities$2.DateUtils.addDays(referenceDate, swift); + result.timex = utilities$2.FormatUtil.luisDateFromDate(value); + result.futureValue = value; + result.pastValue = value; + result.success = true; + return result; + } + // handle "two days from tomorrow" + match = recognizersText.RegExpUtility.getMatches(this.config.specialDayWithNumRegex, trimmedSource).pop(); + if (match && match.index === 0 && match.length === trimmedSource.length) { + let swift = this.config.getSwiftDay(match.groups('day').value); + let numErs = this.config.integerExtractor.extract(trimmedSource); + let numOfDays = Number.parseInt(this.config.numberParser.parse(numErs[0]).value); + let value = utilities$2.DateUtils.addDays(referenceDate, swift + numOfDays); + result.timex = utilities$2.FormatUtil.luisDateFromDate(value); + result.futureValue = value; + result.pastValue = value; + result.success = true; + return result; + } + // handle "two sundays from now" + match = recognizersText.RegExpUtility.getMatches(this.config.relativeWeekDayRegex, trimmedSource).pop(); + if (match && match.index === 0 && match.length === trimmedSource.length) { + let numErs = this.config.integerExtractor.extract(trimmedSource); + let num = Number.parseInt(this.config.numberParser.parse(numErs[0]).value); + let weekdayStr = match.groups('weekday').value.toLowerCase(); + let value = referenceDate; + // Check whether the determined day of this week has passed. + if (value.getDay() > this.config.dayOfWeek.get(weekdayStr)) { + num--; + } + while (num-- > 0) { + value = utilities$2.DateUtils.next(value, this.config.dayOfWeek.get(weekdayStr)); + } + result.timex = utilities$2.FormatUtil.luisDateFromDate(value); + result.futureValue = value; + result.pastValue = value; + result.success = true; + return result; + } + // handle "next Sunday" + match = recognizersText.RegExpUtility.getMatches(this.config.nextRegex, trimmedSource).pop(); + if (match && match.index === 0 && match.length === trimmedSource.length) { + let weekdayStr = match.groups('weekday').value; + let value = utilities$2.DateUtils.next(referenceDate, this.config.dayOfWeek.get(weekdayStr)); + result.timex = utilities$2.FormatUtil.luisDateFromDate(value); + result.futureValue = value; + result.pastValue = value; + result.success = true; + return result; + } + // handle "this Friday" + match = recognizersText.RegExpUtility.getMatches(this.config.thisRegex, trimmedSource).pop(); + if (match && match.index === 0 && match.length === trimmedSource.length) { + let weekdayStr = match.groups('weekday').value; + let value = utilities$2.DateUtils.this(referenceDate, this.config.dayOfWeek.get(weekdayStr)); + result.timex = utilities$2.FormatUtil.luisDateFromDate(value); + result.futureValue = value; + result.pastValue = value; + result.success = true; + return result; + } + // handle "last Friday", "last mon" + match = recognizersText.RegExpUtility.getMatches(this.config.lastRegex, trimmedSource).pop(); + if (match && match.index === 0 && match.length === trimmedSource.length) { + let weekdayStr = match.groups('weekday').value; + let value = utilities$2.DateUtils.last(referenceDate, this.config.dayOfWeek.get(weekdayStr)); + result.timex = utilities$2.FormatUtil.luisDateFromDate(value); + result.futureValue = value; + result.pastValue = value; + result.success = true; + return result; + } + // handle "Friday" + match = recognizersText.RegExpUtility.getMatches(this.config.weekDayRegex, trimmedSource).pop(); + if (match && match.index === 0 && match.length === trimmedSource.length) { + let weekdayStr = match.groups('weekday').value; + let weekday = this.config.dayOfWeek.get(weekdayStr); + let value = utilities$2.DateUtils.this(referenceDate, this.config.dayOfWeek.get(weekdayStr)); + if (weekday === 0) + weekday = 7; + if (weekday < referenceDate.getDay()) + value = utilities$2.DateUtils.next(referenceDate, weekday); + result.timex = 'XXXX-WXX-' + weekday; + let futureDate = new Date(value); + let pastDate = new Date(value); + if (futureDate < referenceDate) + futureDate.setDate(value.getDate() + 7); + if (pastDate >= referenceDate) + pastDate.setDate(value.getDate() - 7); + result.futureValue = futureDate; + result.pastValue = pastDate; + result.success = true; + return result; + } + // handle "for the 27th." + match = recognizersText.RegExpUtility.getMatches(this.config.forTheRegex, trimmedSource).pop(); + if (match) { + let dayStr = match.groups('DayOfMonth').value; + let er = recognizersText.ExtractResult.getFromText(dayStr); + let day = Number.parseInt(this.config.numberParser.parse(er).value); + let month = referenceDate.getMonth(); + let year = referenceDate.getFullYear(); + result.timex = utilities$2.FormatUtil.luisDate(-1, -1, day); + let date = new Date(year, month, day); + result.futureValue = date; + result.pastValue = date; + result.success = true; + return result; + } + // handling cases like 'Thursday the 21st', which both 'Thursday' and '21st' refer to a same date + match = recognizersText.RegExpUtility.getMatches(this.config.weekDayAndDayOfMonthRegex, trimmedSource).pop(); + if (match) { + let dayStr = match.groups('DayOfMonth').value; + let er = recognizersText.ExtractResult.getFromText(dayStr); + let day = Number.parseInt(this.config.numberParser.parse(er).value); + let month = referenceDate.getMonth(); + let year = referenceDate.getFullYear(); + // the validity of the phrase is guaranteed in the Date Extractor + result.timex = utilities$2.FormatUtil.luisDate(year, month, day); + result.futureValue = new Date(year, month, day); + result.pastValue = new Date(year, month, day); + result.success = true; + return result; + } + return result; + } + parseNumberWithMonth(source, referenceDate) { + let trimmedSource = source.trim(); + let ambiguous = true; + let result = new utilities$2.DateTimeResolutionResult(); + let ers = this.config.ordinalExtractor.extract(trimmedSource); + if (!ers || ers.length === 0) { + ers = this.config.integerExtractor.extract(trimmedSource); + } + if (!ers || ers.length === 0) + return result; + let num = Number.parseInt(this.config.numberParser.parse(ers[0]).value); + let day = 1; + let month = 0; + let match = recognizersText.RegExpUtility.getMatches(this.config.monthRegex, trimmedSource).pop(); + if (match) { + month = this.config.monthOfYear.get(match.value) - 1; + day = num; + } + else { + // handling relative month + match = recognizersText.RegExpUtility.getMatches(this.config.relativeMonthRegex, trimmedSource).pop(); + if (match) { + let monthStr = match.groups('order').value; + let swift = this.config.getSwiftMonth(monthStr); + let date = new Date(referenceDate); + date.setMonth(referenceDate.getMonth() + swift); + month = date.getMonth(); + day = num; + ambiguous = false; + } + } + // handling casesd like 'second Sunday' + if (!match) { + match = recognizersText.RegExpUtility.getMatches(this.config.weekDayRegex, trimmedSource).pop(); + if (match) { + month = referenceDate.getMonth(); + // resolve the date of wanted week day + let wantedWeekDay = this.config.dayOfWeek.get(match.groups('weekday').value); + let firstDate = utilities$2.DateUtils.safeCreateFromMinValue(referenceDate.getFullYear(), referenceDate.getMonth(), 1); + let firstWeekday = firstDate.getDay(); + let firstWantedWeekDay = new Date(firstDate); + firstWantedWeekDay.setDate(firstDate.getDate() + ((wantedWeekDay > firstWeekday) ? wantedWeekDay - firstWeekday : wantedWeekDay - firstWeekday + 7)); + day = firstWantedWeekDay.getDate() + ((num - 1) * 7); + ambiguous = false; + } + } + if (!match) + return result; + let year = referenceDate.getFullYear(); + // for LUIS format value string + let futureDate = utilities$2.DateUtils.safeCreateFromMinValue(year, month, day); + let pastDate = utilities$2.DateUtils.safeCreateFromMinValue(year, month, day); + if (ambiguous) { + result.timex = utilities$2.FormatUtil.luisDate(-1, month, day); + if (futureDate < referenceDate) + futureDate.setFullYear(year + 1); + if (pastDate >= referenceDate) + pastDate.setFullYear(year - 1); + } + else { + result.timex = utilities$2.FormatUtil.luisDate(year, month, day); + } + result.futureValue = futureDate; + result.pastValue = pastDate; + result.success = true; + return result; + } + // handle cases like "the 27th". In the extractor, only the unmatched weekday and date will output this date. + parseSingleNumber(source, referenceDate) { + let trimmedSource = source.trim(); + let result = new utilities$2.DateTimeResolutionResult(); + let er = this.config.ordinalExtractor.extract(trimmedSource).pop(); + if (!er || recognizersText.StringUtility.isNullOrEmpty(er.text)) { + er = this.config.integerExtractor.extract(trimmedSource).pop(); + } + if (!er || recognizersText.StringUtility.isNullOrEmpty(er.text)) + return result; + let day = Number.parseInt(this.config.numberParser.parse(er).value); + let month = referenceDate.getMonth(); + let year = referenceDate.getFullYear(); + result.timex = utilities$2.FormatUtil.luisDate(-1, -1, day); + let pastDate = utilities$2.DateUtils.safeCreateFromMinValue(year, month, day); + let futureDate = utilities$2.DateUtils.safeCreateFromMinValue(year, month, day); + if (futureDate !== utilities$2.DateUtils.minValue() && futureDate < referenceDate) + futureDate.setMonth(month + 1); + if (pastDate !== utilities$2.DateUtils.minValue() && pastDate >= referenceDate) + pastDate.setMonth(month - 1); + result.futureValue = futureDate; + result.pastValue = pastDate; + result.success = true; + return result; + } + parserDurationWithAgoAndLater(source, referenceDate) { + return utilities$2.AgoLaterUtil.parseDurationWithAgoAndLater(source, referenceDate, this.config.durationExtractor, this.config.durationParser, this.config.unitMap, this.config.unitRegex, this.config.utilityConfiguration, utilities$2.AgoLaterMode.Date); + } + parseWeekdayOfMonth(source, referenceDate) { + let trimmedSource = source.trim(); + let result = new utilities$2.DateTimeResolutionResult(); + let match = recognizersText.RegExpUtility.getMatches(this.config.weekDayOfMonthRegex, trimmedSource).pop(); + if (!match) + return result; + let cardinalStr = match.groups('cardinal').value; + let weekdayStr = match.groups('weekday').value; + let monthStr = match.groups('month').value; + let noYear = false; + let cardinal = this.config.isCardinalLast(cardinalStr) ? 5 : this.config.cardinalMap.get(cardinalStr); + let weekday = this.config.dayOfWeek.get(weekdayStr); + let month = referenceDate.getMonth(); + let year = referenceDate.getFullYear(); + if (recognizersText.StringUtility.isNullOrEmpty(monthStr)) { + let swift = this.config.getSwiftMonth(trimmedSource); + let temp = new Date(referenceDate); + temp.setMonth(referenceDate.getMonth() + swift); + month = temp.getMonth(); + year = temp.getFullYear(); + } + else { + month = this.config.monthOfYear.get(monthStr) - 1; + noYear = true; + } + let value = this.computeDate(cardinal, weekday, month, year); + if (value.getMonth() !== month) { + cardinal -= 1; + value.setDate(value.getDate() - 7); + } + let futureDate = value; + let pastDate = value; + if (noYear && futureDate < referenceDate) { + futureDate = this.computeDate(cardinal, weekday, month, year + 1); + if (futureDate.getMonth() !== month) + futureDate.setDate(futureDate.getDate() - 7); + } + if (noYear && pastDate >= referenceDate) { + pastDate = this.computeDate(cardinal, weekday, month, year - 1); + if (pastDate.getMonth() !== month) + pastDate.setDate(pastDate.getDate() - 7); + } + result.timex = ['XXXX', utilities$2.FormatUtil.toString(month + 1, 2), 'WXX', weekday, '#' + cardinal].join('-'); + result.futureValue = futureDate; + result.pastValue = pastDate; + result.success = true; + return result; + } + matchToDate(match, referenceDate) { + let result = new utilities$2.DateTimeResolutionResult(); + let yearStr = match.groups('year').value; + let monthStr = match.groups('month').value; + let dayStr = match.groups('day').value; + let month = 0; + let day = 0; + let year = 0; + if (this.config.monthOfYear.has(monthStr) && this.config.dayOfMonth.has(dayStr)) { + month = this.config.monthOfYear.get(monthStr) - 1; + day = this.config.dayOfMonth.get(dayStr); + if (!recognizersText.StringUtility.isNullOrEmpty(yearStr)) { + year = Number.parseInt(yearStr, 10); + if (year < 100 && year >= constants$2.Constants.MinTwoDigitYearPastNum) + year += 1900; + else if (year >= 0 && year < constants$2.Constants.MaxTwoDigitYearFutureNum) + year += 2000; + } + } + let noYear = false; + if (year === 0) { + year = referenceDate.getFullYear(); + result.timex = utilities$2.FormatUtil.luisDate(-1, month, day); + noYear = true; + } + else { + result.timex = utilities$2.FormatUtil.luisDate(year, month, day); + } + let futureDate = utilities$2.DateUtils.safeCreateFromMinValue(year, month, day); + let pastDate = utilities$2.DateUtils.safeCreateFromMinValue(year, month, day); + if (noYear && futureDate < referenceDate) { + futureDate = utilities$2.DateUtils.safeCreateFromMinValue(year + 1, month, day); + } + if (noYear && pastDate >= referenceDate) { + pastDate = utilities$2.DateUtils.safeCreateFromMinValue(year - 1, month, day); + } + result.futureValue = futureDate; + result.pastValue = pastDate; + result.success = true; + return result; + } + computeDate(cardinal, weekday, month, year) { + let firstDay = new Date(year, month, 1); + let firstWeekday = utilities$2.DateUtils.this(firstDay, weekday); + let dayOfWeekOfFirstDay = firstDay.getDay(); + if (weekday === 0) + weekday = 7; + if (dayOfWeekOfFirstDay === 0) + dayOfWeekOfFirstDay = 7; + if (weekday < dayOfWeekOfFirstDay) + firstWeekday = utilities$2.DateUtils.next(firstDay, weekday); + firstWeekday.setDate(firstWeekday.getDate() + (7 * (cardinal - 1))); + return firstWeekday; + } +} +exports.BaseDateParser = BaseDateParser; + +}); + +unwrapExports(baseDate); + +var baseTime = createCommonjsModule(function (module, exports) { +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); + + + + +class BaseTimeExtractor { + constructor(config) { + this.extractorName = constants$2.Constants.SYS_DATETIME_TIME; // "Time"; + this.config = config; + } + extract(text, refDate) { + if (!refDate) + refDate = new Date(); + let referenceDate = refDate; + let tokens = new Array() + .concat(this.basicRegexMatch(text)) + .concat(this.atRegexMatch(text)) + .concat(this.specialsRegexMatch(text, referenceDate)); + let result = utilities$2.Token.mergeAllTokens(tokens, text, this.extractorName); + return result; + } + basicRegexMatch(text) { + let ret = []; + this.config.timeRegexList.forEach(regexp => { + let matches = recognizersTextNumber.RegExpUtility.getMatches(regexp, text); + matches.forEach(match => { + ret.push(new utilities$2.Token(match.index, match.index + match.length)); + }); + }); + return ret; + } + atRegexMatch(text) { + let ret = []; + // handle "at 5", "at seven" + let matches = recognizersTextNumber.RegExpUtility.getMatches(this.config.atRegex, text); + matches.forEach(match => { + if (match.index + match.length < text.length && + text.charAt(match.index + match.length) === '%') { + return; + } + ret.push(new utilities$2.Token(match.index, match.index + match.length)); + }); + return ret; + } + specialsRegexMatch(text, refDate) { + let ret = []; + // handle "ish" + if (this.config.ishRegex !== null) { + let matches = recognizersTextNumber.RegExpUtility.getMatches(this.config.ishRegex, text); + matches.forEach(match => { + ret.push(new utilities$2.Token(match.index, match.index + match.length)); + }); + } + return ret; + } +} +exports.BaseTimeExtractor = BaseTimeExtractor; +class BaseTimeParser { + constructor(configuration) { + this.ParserName = constants$2.Constants.SYS_DATETIME_TIME; // "Time"; + this.config = configuration; + } + parse(er, referenceTime) { + if (!referenceTime) + referenceTime = new Date(); + let value = null; + if (er.type === this.ParserName) { + let innerResult = this.internalParse(er.text, referenceTime); + if (innerResult.success) { + innerResult.futureResolution = {}; + innerResult.futureResolution[constants$2.TimeTypeConstants.TIME] = utilities$2.FormatUtil.formatTime(innerResult.futureValue); + innerResult.pastResolution = {}; + innerResult.pastResolution[constants$2.TimeTypeConstants.TIME] = utilities$2.FormatUtil.formatTime(innerResult.pastValue); + value = innerResult; + } + } + let ret = new parsers$4.DateTimeParseResult(er); + ret.value = value, ret.timexStr = value === null ? "" : value.timex, ret.resolutionStr = ""; + return ret; + } + internalParse(text, referenceTime) { + let innerResult = this.parseBasicRegexMatch(text, referenceTime); + return innerResult; + } + // parse basic patterns in TimeRegexList + parseBasicRegexMatch(text, referenceTime) { + let trimmedText = text.trim().toLowerCase(); + let offset = 0; + let matches = recognizersTextNumber.RegExpUtility.getMatches(this.config.atRegex, trimmedText); + if (matches.length === 0) { + matches = recognizersTextNumber.RegExpUtility.getMatches(this.config.atRegex, this.config.timeTokenPrefix + trimmedText); + offset = this.config.timeTokenPrefix.length; + } + if (matches.length > 0 && matches[0].index === offset && matches[0].length === trimmedText.length) { + return this.match2Time(matches[0], referenceTime); + } + // parse hour pattern, like "twenty one", "16" + // create a extract result which content the pass-in text + let hour = this.config.numbers.get(text) || Number(text); + if (hour) { + if (hour >= 0 && hour <= 24) { + let ret = new utilities$2.DateTimeResolutionResult(); + if (hour === 24) { + hour = 0; + } + if (hour <= 12 && hour !== 0) { + ret.comment = "ampm"; + } + ret.timex = "T" + utilities$2.FormatUtil.toString(hour, 2); + ret.futureValue = ret.pastValue = + utilities$2.DateUtils.safeCreateFromMinValue(referenceTime.getFullYear(), referenceTime.getMonth(), referenceTime.getDate(), hour, 0, 0); + ret.success = true; + return ret; + } + } + for (let regex of this.config.timeRegexes) { + offset = 0; + matches = recognizersTextNumber.RegExpUtility.getMatches(regex, trimmedText); + if (matches.length && matches[0].index === offset && matches[0].length === trimmedText.length) { + return this.match2Time(matches[0], referenceTime); + } + } + return new utilities$2.DateTimeResolutionResult(); + } + match2Time(match, referenceTime) { + let ret = new utilities$2.DateTimeResolutionResult(); + let hour = 0; + let min = 0; + let second = 0; + let day = referenceTime.getDate(); + let month = referenceTime.getMonth(); + let year = referenceTime.getFullYear(); + let hasMin = false; + let hasSec = false; + let hasAm = false; + let hasPm = false; + let hasMid = false; + let engTimeStr = match.groups('engtime').value; + if (!recognizersTextNumber.StringUtility.isNullOrWhitespace(engTimeStr)) { + // get hour + let hourStr = match.groups('hournum').value.toLowerCase(); + hour = this.config.numbers.get(hourStr); + // get minute + let minStr = match.groups('minnum').value; + let tensStr = match.groups('tens').value; + if (!recognizersTextNumber.StringUtility.isNullOrWhitespace(minStr)) { + min = this.config.numbers.get(minStr); + if (tensStr) { + min += this.config.numbers.get(tensStr); + } + hasMin = true; + } + } + else if (!recognizersTextNumber.StringUtility.isNullOrWhitespace(match.groups('mid').value)) { + hasMid = true; + if (!recognizersTextNumber.StringUtility.isNullOrWhitespace(match.groups('midnight').value)) { + hour = 0; + min = 0; + second = 0; + } + else if (!recognizersTextNumber.StringUtility.isNullOrWhitespace(match.groups('midmorning').value)) { + hour = 10; + min = 0; + second = 0; + } + else if (!recognizersTextNumber.StringUtility.isNullOrWhitespace(match.groups('midafternoon').value)) { + hour = 14; + min = 0; + second = 0; + } + else if (!recognizersTextNumber.StringUtility.isNullOrWhitespace(match.groups('midday').value)) { + hour = 12; + min = 0; + second = 0; + } + } + else { + // get hour + let hourStr = match.groups('hour').value; + if (recognizersTextNumber.StringUtility.isNullOrWhitespace(hourStr)) { + hourStr = match.groups('hournum').value.toLowerCase(); + hour = this.config.numbers.get(hourStr); + if (!hour) { + return ret; + } + } + else { + hour = Number.parseInt(hourStr, 10); + if (!hour) { + hour = this.config.numbers.get(hourStr); + if (!hour) { + return ret; + } + } + } + // get minute + let minStr = match.groups('min').value.toLowerCase(); + if (recognizersTextNumber.StringUtility.isNullOrWhitespace(minStr)) { + minStr = match.groups('minnum').value; + if (!recognizersTextNumber.StringUtility.isNullOrWhitespace(minStr)) { + min = this.config.numbers.get(minStr); + hasMin = true; + } + let tensStr = match.groups('tens').value; + if (!recognizersTextNumber.StringUtility.isNullOrWhitespace(tensStr)) { + min += this.config.numbers.get(tensStr); + hasMin = true; + } + } + else { + min = Number.parseInt(minStr, 10); + hasMin = true; + } + // get second + let secStr = match.groups('sec').value.toLowerCase(); + if (!recognizersTextNumber.StringUtility.isNullOrWhitespace(secStr)) { + second = Number.parseInt(secStr, 10); + hasSec = true; + } + } + // adjust by desc string + let descStr = match.groups('desc').value.toLowerCase(); + if (recognizersTextNumber.RegExpUtility.getMatches(this.config.utilityConfiguration.amDescRegex, descStr).length > 0 + || recognizersTextNumber.RegExpUtility.getMatches(this.config.utilityConfiguration.amPmDescRegex, descStr).length > 0 + || !recognizersTextNumber.StringUtility.isNullOrEmpty(match.groups('iam').value)) { + if (hour >= 12) { + hour -= 12; + } + if (recognizersTextNumber.RegExpUtility.getMatches(this.config.utilityConfiguration.amPmDescRegex, descStr).length === 0) { + hasAm = true; + } + } + else if (recognizersTextNumber.RegExpUtility.getMatches(this.config.utilityConfiguration.pmDescRegex, descStr).length > 0 + || !recognizersTextNumber.StringUtility.isNullOrEmpty(match.groups('ipm').value)) { + if (hour < 12) { + hour += 12; + } + hasPm = true; + } + // adjust min by prefix + let timePrefix = match.groups('prefix').value.toLowerCase(); + if (!recognizersTextNumber.StringUtility.isNullOrWhitespace(timePrefix)) { + let adjust = { hour: hour, min: min, hasMin: hasMin }; + this.config.adjustByPrefix(timePrefix, adjust); + hour = adjust.hour; + min = adjust.min; + hasMin = adjust.hasMin; + } + // adjust hour by suffix + let timeSuffix = match.groups('suffix').value.toLowerCase(); + if (!recognizersTextNumber.StringUtility.isNullOrWhitespace(timeSuffix)) { + let adjust = { hour: hour, min: min, hasMin: hasMin, hasAm: hasAm, hasPm: hasPm }; + this.config.adjustBySuffix(timeSuffix, adjust); + hour = adjust.hour; + min = adjust.min; + hasMin = adjust.hasMin; + hasAm = adjust.hasAm; + hasPm = adjust.hasPm; + } + if (hour === 24) { + hour = 0; + } + ret.timex = "T" + utilities$2.FormatUtil.toString(hour, 2); + if (hasMin) { + ret.timex += ":" + utilities$2.FormatUtil.toString(min, 2); + } + if (hasSec) { + ret.timex += ":" + utilities$2.FormatUtil.toString(second, 2); + } + if (hour <= 12 && !hasPm && !hasAm && !hasMid) { + ret.comment = "ampm"; + } + ret.futureValue = ret.pastValue = new Date(year, month, day, hour, min, second); + ret.success = true; + return ret; + } +} +exports.BaseTimeParser = BaseTimeParser; + +}); + +unwrapExports(baseTime); + +var baseDatePeriod = createCommonjsModule(function (module, exports) { +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); + + + + +class BaseDatePeriodExtractor { + constructor(config) { + this.extractorName = constants$2.Constants.SYS_DATETIME_DATEPERIOD; + this.config = config; + } + extract(source, refDate) { + if (!refDate) + refDate = new Date(); + let referenceDate = refDate; + let tokens = new Array(); + tokens = tokens.concat(this.matchSimpleCases(source)); + tokens = tokens.concat(this.mergeTwoTimePoints(source, referenceDate)); + tokens = tokens.concat(this.matchDuration(source, referenceDate)); + tokens = tokens.concat(this.singleTimePointWithPatterns(source, referenceDate)); + let result = utilities$2.Token.mergeAllTokens(tokens, source, this.extractorName); + return result; + } + matchSimpleCases(source) { + let tokens = new Array(); + this.config.simpleCasesRegexes.forEach(regexp => { + recognizersText.RegExpUtility.getMatches(regexp, source).forEach(match => { + let addToken = true; + let matchYear = recognizersText.RegExpUtility.getMatches(this.config.YearRegex, match.value).pop(); + if (matchYear && matchYear.length === match.value.length) { + let yearStr = matchYear.groups('year').value; + if (recognizersText.StringUtility.isNullOrEmpty(yearStr)) { + let year = this.getYearFromText(matchYear); + if (!(year >= constants$2.Constants.MinYearNum && year <= constants$2.Constants.MaxYearNum)) { + addToken = false; + } + } + } + if (match.length === constants$2.Constants.FourDigitsYearLength && recognizersText.RegExpUtility.isMatch(this.config.YearRegex, match.value) && this.infixBoundaryCheck(match, source)) { + let substr = source.substr(match.index - 1, 6); + if (recognizersText.RegExpUtility.isMatch(this.config.illegalYearRegex, substr)) { + addToken = false; + } + } + if (addToken) { + tokens.push(new utilities$2.Token(match.index, match.index + match.length)); + } + }); + }); + return tokens; + } + getYearFromText(match) { + let firstTwoYearNumStr = match.groups('firsttwoyearnum').value; + if (!recognizersText.StringUtility.isNullOrEmpty(firstTwoYearNumStr)) { + let er = new recognizersText.ExtractResult(); + er.text = firstTwoYearNumStr; + er.start = match.groups('firsttwoyearnum').index; + er.length = match.groups('firsttwoyearnum').length; + let firstTwoYearNum = Number.parseInt(this.config.numberParser.parse(er).value); + let lastTwoYearNum = 0; + let lastTwoYearNumStr = match.groups('lasttwoyearnum').value; + if (!recognizersText.StringUtility.isNullOrEmpty(lastTwoYearNumStr)) { + er.text = lastTwoYearNumStr; + er.start = match.groups('lasttwoyearnum').index; + er.length = match.groups('lasttwoyearnum').length; + lastTwoYearNum = Number.parseInt(this.config.numberParser.parse(er).value); + } + if (firstTwoYearNum < 100 && lastTwoYearNum === 0 || firstTwoYearNum < 100 && firstTwoYearNum % 10 === 0 && lastTwoYearNumStr.trim().split(' ').length === 1) { + return -1; + } + if (firstTwoYearNum >= 100) { + return (firstTwoYearNum + lastTwoYearNum); + } + else { + return (firstTwoYearNum * 100 + lastTwoYearNum); + } + } + else { + return -1; + } + } + mergeTwoTimePoints(source, refDate) { + let tokens = new Array(); + let er = this.config.datePointExtractor.extract(source, refDate); + if (er.length <= 1) { + return tokens; + } + let idx = 0; + while (idx < er.length - 1) { + let middleBegin = er[idx].start + (er[idx].length || 0); + let middleEnd = er[idx + 1].start || 0; + if (middleBegin >= middleEnd) { + idx++; + continue; + } + let middleStr = source.substr(middleBegin, middleEnd - middleBegin).trim().toLowerCase(); + let match = recognizersText.RegExpUtility.getMatches(this.config.tillRegex, middleStr); + if (match && match.length > 0 && match[0].index === 0 && match[0].length === middleStr.length) { + let periodBegin = er[idx].start || 0; + let periodEnd = (er[idx + 1].start || 0) + (er[idx + 1].length || 0); + let beforeStr = source.substring(0, periodBegin).trim().toLowerCase(); + let fromTokenIndex = this.config.getFromTokenIndex(beforeStr); + let betweenTokenIndex = this.config.getBetweenTokenIndex(beforeStr); + if (fromTokenIndex.matched || betweenTokenIndex.matched) { + periodBegin = fromTokenIndex.matched ? fromTokenIndex.index : betweenTokenIndex.index; + } + tokens.push(new utilities$2.Token(periodBegin, periodEnd)); + idx += 2; + continue; + } + if (this.config.hasConnectorToken(middleStr)) { + let periodBegin = er[idx].start || 0; + let periodEnd = (er[idx + 1].start || 0) + (er[idx + 1].length || 0); + let beforeStr = source.substring(0, periodBegin).trim().toLowerCase(); + let betweenTokenIndex = this.config.getBetweenTokenIndex(beforeStr); + if (betweenTokenIndex.matched) { + periodBegin = betweenTokenIndex.index; + tokens.push(new utilities$2.Token(periodBegin, periodEnd)); + idx += 2; + continue; + } + } + idx++; + } + return tokens; + } + matchDuration(source, refDate) { + let tokens = new Array(); + let durations = new Array(); + this.config.durationExtractor.extract(source, refDate).forEach(durationEx => { + let match = recognizersText.RegExpUtility.getMatches(this.config.dateUnitRegex, durationEx.text).pop(); + if (match) { + durations.push(new utilities$2.Token(durationEx.start, durationEx.start + durationEx.length)); + } + }); + durations.forEach(duration => { + let beforeStr = source.substring(0, duration.start).toLowerCase(); + if (recognizersText.StringUtility.isNullOrWhitespace(beforeStr)) + return; + let match = recognizersText.RegExpUtility.getMatches(this.config.pastRegex, beforeStr).pop(); + if (this.matchRegexInPrefix(beforeStr, match)) { + tokens.push(new utilities$2.Token(match.index, duration.end)); + return; + } + match = recognizersText.RegExpUtility.getMatches(this.config.futureRegex, beforeStr).pop(); + if (this.matchRegexInPrefix(beforeStr, match)) { + tokens.push(new utilities$2.Token(match.index, duration.end)); + return; + } + match = recognizersText.RegExpUtility.getMatches(this.config.inConnectorRegex, beforeStr).pop(); + if (this.matchRegexInPrefix(beforeStr, match)) { + let rangeStr = source.substr(duration.start, duration.length); + let rangeMatch = recognizersText.RegExpUtility.getMatches(this.config.rangeUnitRegex, rangeStr).pop(); + if (rangeMatch) { + tokens.push(new utilities$2.Token(match.index, duration.end)); + } + return; + } + }); + return tokens; + } + singleTimePointWithPatterns(source, refDate) { + let tokens = new Array(); + let ers = this.config.datePointExtractor.extract(source, refDate); + if (ers.length < 1) + return tokens; + ers.forEach(er => { + if (er.start && er.length) { + let beforeStr = source.substring(0, er.start); + tokens = tokens + .concat(this.getTokenForRegexMatching(beforeStr, this.config.weekOfRegex, er)) + .concat(this.getTokenForRegexMatching(beforeStr, this.config.monthOfRegex, er)); + } + }); + return tokens; + } + getTokenForRegexMatching(source, regexp, er) { + let tokens = new Array(); + let match = recognizersText.RegExpUtility.getMatches(regexp, source).shift(); + if (match && source.trim().endsWith(match.value.trim())) { + let startIndex = source.lastIndexOf(match.value); + tokens.push(new utilities$2.Token(startIndex, er.start + er.length)); + } + return tokens; + } + matchRegexInPrefix(source, match) { + return (match && recognizersText.StringUtility.isNullOrWhitespace(source.substring(match.index + match.length))); + } + infixBoundaryCheck(match, source) { + let isMatchInfixOfSource = false; + if (match.index > 0 && match.index + match.length < source.length) { + if (source.substr(match.index, match.length) === match.value) { + isMatchInfixOfSource = true; + } + } + return isMatchInfixOfSource; + } +} +exports.BaseDatePeriodExtractor = BaseDatePeriodExtractor; +class BaseDatePeriodParser { + constructor(config, inclusiveEndPeriod = false) { + this.parserName = constants$2.Constants.SYS_DATETIME_DATEPERIOD; + this.weekOfComment = 'WeekOf'; + this.monthOfComment = 'MonthOf'; + this.config = config; + this.inclusiveEndPeriod = inclusiveEndPeriod; + } + parse(extractorResult, referenceDate) { + if (!referenceDate) + referenceDate = new Date(); + let resultValue; + if (extractorResult.type === this.parserName) { + let source = extractorResult.text.trim().toLowerCase(); + let innerResult = this.parseMonthWithYear(source, referenceDate); + if (!innerResult.success) { + innerResult = this.parseSimpleCases(source, referenceDate); + } + if (!innerResult.success) { + innerResult = this.parseOneWordPeriod(source, referenceDate); + } + if (!innerResult.success) { + innerResult = this.mergeTwoTimePoints(source, referenceDate); + } + if (!innerResult.success) { + innerResult = this.parseYear(source, referenceDate); + } + if (!innerResult.success) { + innerResult = this.parseWeekOfMonth(source, referenceDate); + } + if (!innerResult.success) { + innerResult = this.parseWeekOfYear(source, referenceDate); + } + if (!innerResult.success) { + innerResult = this.parseHalfYear(source, referenceDate); + } + if (!innerResult.success) { + innerResult = this.parseQuarter(source, referenceDate); + } + if (!innerResult.success) { + innerResult = this.parseSeason(source, referenceDate); + } + if (!innerResult.success) { + innerResult = this.parseWhichWeek(source, referenceDate); + } + if (!innerResult.success) { + innerResult = this.parseWeekOfDate(source, referenceDate); + } + if (!innerResult.success) { + innerResult = this.parseMonthOfDate(source, referenceDate); + } + // parse duration should be at the end since it will extract "the last week" from "the last week of July" + if (!innerResult.success) { + innerResult = this.parseDuration(source, referenceDate); + } + if (innerResult.success) { + if (innerResult.futureValue && innerResult.pastValue) { + innerResult.futureResolution = {}; + innerResult.futureResolution[constants$2.TimeTypeConstants.START_DATE] = utilities$2.FormatUtil.formatDate(innerResult.futureValue[0]); + innerResult.futureResolution[constants$2.TimeTypeConstants.END_DATE] = utilities$2.FormatUtil.formatDate(innerResult.futureValue[1]); + innerResult.pastResolution = {}; + innerResult.pastResolution[constants$2.TimeTypeConstants.START_DATE] = utilities$2.FormatUtil.formatDate(innerResult.pastValue[0]); + innerResult.pastResolution[constants$2.TimeTypeConstants.END_DATE] = utilities$2.FormatUtil.formatDate(innerResult.pastValue[1]); + } + else { + innerResult.futureResolution = {}; + innerResult.pastResolution = {}; + } + resultValue = innerResult; + } + } + let result = new parsers$4.DateTimeParseResult(extractorResult); + result.value = resultValue; + result.timexStr = resultValue ? resultValue.timex : ''; + result.resolutionStr = ''; + return result; + } + parseMonthWithYear(source, referenceDate) { + let trimmedSource = source.trim().toLowerCase(); + let result = new utilities$2.DateTimeResolutionResult(); + let match = recognizersText.RegExpUtility.getMatches(this.config.monthWithYear, trimmedSource).pop(); + if (!match) { + match = recognizersText.RegExpUtility.getMatches(this.config.monthNumWithYear, trimmedSource).pop(); + } + if (!match || match.length !== trimmedSource.length) + return result; + let monthStr = match.groups('month').value; + let yearStr = match.groups('year').value; + let orderStr = match.groups('order').value; + let month = this.config.monthOfYear.get(monthStr) - 1; + let year = Number.parseInt(yearStr, 10); + if (!year || isNaN(year)) { + let swift = this.config.getSwiftYear(orderStr); + if (swift < -1) + return result; + year = referenceDate.getFullYear() + swift; + } + let beginDate = utilities$2.DateUtils.safeCreateFromValue(utilities$2.DateUtils.minValue(), year, month, 1); + let endDate = utilities$2.DateUtils.addDays(utilities$2.DateUtils.addMonths(beginDate, 1), this.inclusiveEndPeriod ? -1 : 0); + result.futureValue = [beginDate, endDate]; + result.pastValue = [beginDate, endDate]; + result.timex = `${utilities$2.FormatUtil.toString(year, 4)}-${utilities$2.FormatUtil.toString(month + 1, 2)}`; + result.success = true; + return result; + } + getMatchSimpleCase(source) { + let match = recognizersText.RegExpUtility.getMatches(this.config.monthFrontBetweenRegex, source).pop(); + if (!match) { + match = recognizersText.RegExpUtility.getMatches(this.config.betweenRegex, source).pop(); + } + if (!match) { + match = recognizersText.RegExpUtility.getMatches(this.config.monthFrontSimpleCasesRegex, source).pop(); + } + if (!match) { + match = recognizersText.RegExpUtility.getMatches(this.config.simpleCasesRegex, source).pop(); + } + return match; + } + parseSimpleCases(source, referenceDate) { + let result = new utilities$2.DateTimeResolutionResult(); + let year = referenceDate.getFullYear(); + let month = referenceDate.getMonth(); + let noYear = true; + let match = this.getMatchSimpleCase(source); + if (!match || match.index !== 0 || match.length !== source.length) + return result; + let days = match.groups('day'); + let beginDay = this.config.dayOfMonth.get(days.captures[0]); + let endDay = this.config.dayOfMonth.get(days.captures[1]); + let yearStr = match.groups('year').value; + if (!recognizersText.StringUtility.isNullOrEmpty(yearStr)) { + year = Number.parseInt(yearStr, 10); + noYear = false; + } + let monthStr = match.groups('month').value; + if (!recognizersText.StringUtility.isNullOrEmpty(monthStr)) { + month = this.config.monthOfYear.get(monthStr) - 1; + } + else { + monthStr = match.groups('relmonth').value; + month += this.config.getSwiftDayOrMonth(monthStr); + if (month < 0) { + month = 0; + year--; + } + else if (month > 11) { + month = 11; + year++; + } + if (this.config.isFuture(monthStr)) { + noYear = false; + } + } + let beginDateLuis = utilities$2.FormatUtil.luisDate(noYear ? -1 : year, month, beginDay); + let endDateLuis = utilities$2.FormatUtil.luisDate(noYear ? -1 : year, month, endDay); + let futureYear = year; + let pastYear = year; + let startDate = utilities$2.DateUtils.safeCreateFromValue(utilities$2.DateUtils.minValue(), year, month, beginDay); + if (noYear && startDate < referenceDate) + futureYear++; + if (noYear && startDate >= referenceDate) + pastYear--; + result.timex = `(${beginDateLuis},${endDateLuis},P${endDay - beginDay}D)`; + result.futureValue = [ + utilities$2.DateUtils.safeCreateFromValue(utilities$2.DateUtils.minValue(), futureYear, month, beginDay), + utilities$2.DateUtils.safeCreateFromValue(utilities$2.DateUtils.minValue(), futureYear, month, endDay), + ]; + result.pastValue = [ + utilities$2.DateUtils.safeCreateFromValue(utilities$2.DateUtils.minValue(), pastYear, month, beginDay), + utilities$2.DateUtils.safeCreateFromValue(utilities$2.DateUtils.minValue(), pastYear, month, endDay), + ]; + result.success = true; + return result; + } + parseOneWordPeriod(source, referenceDate) { + let result = new utilities$2.DateTimeResolutionResult(); + let year = referenceDate.getFullYear(); + let month = referenceDate.getMonth(); + let earlyPrefix = false; + let latePrefix = false; + let earlierPrefix = false; + let laterPrefix = false; + if (this.config.isYearToDate(source)) { + result.timex = utilities$2.FormatUtil.toString(year, 4); + result.futureValue = [utilities$2.DateUtils.safeCreateFromValue(utilities$2.DateUtils.minValue(), year, 0, 1), referenceDate]; + result.pastValue = [utilities$2.DateUtils.safeCreateFromValue(utilities$2.DateUtils.minValue(), year, 0, 1), referenceDate]; + result.success = true; + return result; + } + if (this.config.isMonthToDate(source)) { + result.timex = `${utilities$2.FormatUtil.toString(year, 4)}-${utilities$2.FormatUtil.toString(month + 1, 2)}`; + result.futureValue = [utilities$2.DateUtils.safeCreateFromValue(utilities$2.DateUtils.minValue(), year, month, 1), referenceDate]; + result.pastValue = [utilities$2.DateUtils.safeCreateFromValue(utilities$2.DateUtils.minValue(), year, month, 1), referenceDate]; + result.success = true; + return result; + } + let futureYear = year; + let pastYear = year; + let trimedText = source.trim().toLowerCase(); + let match = recognizersText.RegExpUtility.getMatches(this.config.oneWordPeriodRegex, trimedText).pop(); + if (!(match && match.index === 0 && match.length === trimedText.length)) { + match = recognizersText.RegExpUtility.getMatches(this.config.laterEarlyPeriodRegex, trimedText).pop(); + } + if (!match || match.index !== 0 || match.length !== trimedText.length) + return result; + if (match.groups("EarlyPrefix").value) { + earlyPrefix = true; + trimedText = match.groups("suffix").value; + result.mod = constants$2.Constants.EARLY_MOD; + } + if (match.groups("LatePrefix").value) { + latePrefix = true; + trimedText = match.groups("suffix").value; + result.mod = constants$2.Constants.LATE_MOD; + } + if (match.groups("MidPrefix").value) { + latePrefix = true; + trimedText = match.groups("suffix").value; + result.mod = constants$2.Constants.MID_MOD; + } + if (match.groups("RelEarly").value) { + earlierPrefix = true; + result.mod = null; + } + if (match.groups("RelLate").value) { + laterPrefix = true; + result.mod = null; + } + let monthStr = match.groups('month').value; + if (!recognizersText.StringUtility.isNullOrEmpty(monthStr)) { + let swift = this.config.getSwiftYear(trimedText); + month = this.config.monthOfYear.get(monthStr) - 1; + if (swift >= -1) { + result.timex = `${utilities$2.FormatUtil.toString(year + swift, 4)}-${utilities$2.FormatUtil.toString(month + 1, 2)}`; + year += swift; + futureYear = year; + pastYear = year; + } + else { + result.timex = `XXXX-${utilities$2.FormatUtil.toString(month + 1, 2)}`; + if (month < referenceDate.getMonth()) + futureYear++; + if (month >= referenceDate.getMonth()) + pastYear--; + } + } + else { + let swift = this.config.getSwiftDayOrMonth(trimedText); + if (this.config.isWeekOnly(trimedText)) { + let monday = utilities$2.DateUtils.addDays(utilities$2.DateUtils.this(referenceDate, utilities$2.DayOfWeek.Monday), 7 * swift); + result.timex = `${utilities$2.FormatUtil.toString(monday.getFullYear(), 4)}-W${utilities$2.FormatUtil.toString(utilities$2.DateUtils.getWeekNumber(monday).weekNo, 2)}`; + let beginDate = utilities$2.DateUtils.addDays(utilities$2.DateUtils.this(referenceDate, utilities$2.DayOfWeek.Monday), 7 * swift); + let endDate = this.inclusiveEndPeriod + ? utilities$2.DateUtils.addDays(utilities$2.DateUtils.this(referenceDate, utilities$2.DayOfWeek.Sunday), 7 * swift) + : utilities$2.DateUtils.addDays(utilities$2.DateUtils.addDays(utilities$2.DateUtils.this(referenceDate, utilities$2.DayOfWeek.Sunday), 7 * swift), 1); + if (earlyPrefix) { + endDate = this.inclusiveEndPeriod + ? utilities$2.DateUtils.addDays(utilities$2.DateUtils.this(referenceDate, utilities$2.DayOfWeek.Wednesday), 7 * swift) + : utilities$2.DateUtils.addDays(utilities$2.DateUtils.addDays(utilities$2.DateUtils.this(referenceDate, utilities$2.DayOfWeek.Wednesday), 7 * swift), 1); + } + if (latePrefix) { + beginDate = utilities$2.DateUtils.addDays(utilities$2.DateUtils.this(referenceDate, utilities$2.DayOfWeek.Thursday), 7 * swift); + } + if (earlierPrefix && swift === 0) { + if (endDate > referenceDate) { + endDate = referenceDate; + } + } + else if (laterPrefix && swift === 0) { + if (beginDate < referenceDate) { + beginDate = referenceDate; + } + } + result.futureValue = [beginDate, endDate]; + result.pastValue = [beginDate, endDate]; + result.success = true; + return result; + } + if (this.config.isWeekend(trimedText)) { + let beginDate = utilities$2.DateUtils.addDays(utilities$2.DateUtils.this(referenceDate, utilities$2.DayOfWeek.Saturday), 7 * swift); + let endDate = utilities$2.DateUtils.addDays(utilities$2.DateUtils.this(referenceDate, utilities$2.DayOfWeek.Sunday), (7 * swift) + (this.inclusiveEndPeriod ? 0 : 1)); + result.timex = `${utilities$2.FormatUtil.toString(beginDate.getFullYear(), 4)}-W${utilities$2.FormatUtil.toString(utilities$2.DateUtils.getWeekNumber(beginDate).weekNo, 2)}-WE`; + result.futureValue = [beginDate, endDate]; + result.pastValue = [beginDate, endDate]; + result.success = true; + return result; + } + if (this.config.isMonthOnly(trimedText)) { + let tempDate = new Date(referenceDate); + tempDate.setMonth(referenceDate.getMonth() + swift); + month = tempDate.getMonth(); + year = tempDate.getFullYear(); + result.timex = `${utilities$2.FormatUtil.toString(year, 4)}-${utilities$2.FormatUtil.toString(month + 1, 2)}`; + futureYear = year; + pastYear = year; + } + else if (this.config.isYearOnly(trimedText)) { + let tempDate = new Date(referenceDate); + tempDate.setFullYear(referenceDate.getFullYear() + swift); + year = tempDate.getFullYear(); + let beginDate = utilities$2.DateUtils.safeCreateFromMinValue(year, 0, 1); + let endDate = this.inclusiveEndPeriod + ? utilities$2.DateUtils.safeCreateFromMinValue(year, 11, 31) + : utilities$2.DateUtils.addDays(utilities$2.DateUtils.safeCreateFromMinValue(year, 11, 31), 1); + if (earlyPrefix) { + endDate = this.inclusiveEndPeriod + ? utilities$2.DateUtils.safeCreateFromMinValue(year, 5, 30) + : utilities$2.DateUtils.addDays(utilities$2.DateUtils.safeCreateFromMinValue(year, 5, 30), 1); + } + if (latePrefix) { + beginDate = utilities$2.DateUtils.safeCreateFromMinValue(year, 6, 1); + } + if (earlierPrefix && swift === 0) { + if (endDate > referenceDate) { + endDate = referenceDate; + } + } + else if (laterPrefix && swift === 0) { + if (beginDate < referenceDate) { + beginDate = referenceDate; + } + } + result.timex = utilities$2.FormatUtil.toString(year, 4); + result.futureValue = [beginDate, endDate]; + result.pastValue = [beginDate, endDate]; + result.success = true; + return result; + } + } + // only "month" will come to here + let futureStart = utilities$2.DateUtils.safeCreateFromMinValue(futureYear, month, 1); + let futureEnd = this.inclusiveEndPeriod + ? utilities$2.DateUtils.addDays(utilities$2.DateUtils.addMonths(utilities$2.DateUtils.safeCreateFromMinValue(futureYear, month, 1), 1), -1) + : utilities$2.DateUtils.addMonths(utilities$2.DateUtils.safeCreateFromMinValue(futureYear, month, 1), 1); + let pastStart = utilities$2.DateUtils.safeCreateFromMinValue(pastYear, month, 1); + let pastEnd = this.inclusiveEndPeriod + ? utilities$2.DateUtils.addDays(utilities$2.DateUtils.addMonths(utilities$2.DateUtils.safeCreateFromMinValue(pastYear, month, 1), 1), -1) + : utilities$2.DateUtils.addMonths(utilities$2.DateUtils.safeCreateFromMinValue(pastYear, month, 1), 1); + if (earlyPrefix) { + futureEnd = this.inclusiveEndPeriod + ? utilities$2.DateUtils.safeCreateFromMinValue(futureYear, month, 15) + : utilities$2.DateUtils.addDays(utilities$2.DateUtils.safeCreateFromMinValue(futureYear, month, 15), 1); + pastEnd = this.inclusiveEndPeriod + ? utilities$2.DateUtils.safeCreateFromMinValue(pastYear, month, 15) + : utilities$2.DateUtils.addDays(utilities$2.DateUtils.safeCreateFromMinValue(pastYear, month, 15), 1); + } + else if (latePrefix) { + futureStart = utilities$2.DateUtils.safeCreateFromMinValue(futureYear, month, 16); + pastStart = utilities$2.DateUtils.safeCreateFromMinValue(pastYear, month, 16); + } + if (earlierPrefix && futureYear === pastYear) { + if (futureEnd > referenceDate) { + futureEnd = pastEnd = referenceDate; + } + } + else if (laterPrefix && futureYear === pastYear) { + if (futureStart < referenceDate) { + futureStart = pastStart = referenceDate; + } + } + result.futureValue = [futureStart, futureEnd]; + result.pastValue = [pastStart, pastEnd]; + result.success = true; + return result; + } + mergeTwoTimePoints(source, referenceDate) { + let trimmedSource = source.trim(); + let result = new utilities$2.DateTimeResolutionResult(); + let ers = this.config.dateExtractor.extract(trimmedSource, referenceDate); + if (!ers || ers.length < 2) { + ers = this.config.dateExtractor.extract(this.config.tokenBeforeDate + trimmedSource, referenceDate) + .map(er => { + er.start -= this.config.tokenBeforeDate.length; + return er; + }); + if (!ers || ers.length < 2) + return result; + } + let match = recognizersText.RegExpUtility.getMatches(this.config.weekWithWeekDayRangeRegex, source).pop(); + let weekPrefix = null; + if (match) { + weekPrefix = match.groups("week").value; + } + if (!recognizersText.StringUtility.isNullOrWhitespace(weekPrefix)) { + ers[0].text = weekPrefix + " " + ers[0].text; + ers[1].text = weekPrefix + " " + ers[1].text; + } + let prs = ers.map(er => this.config.dateParser.parse(er, referenceDate)).filter(pr => pr); + if (prs.length < 2) + return result; + let prBegin = prs[0]; + let prEnd = prs[1]; + let futureBegin = prBegin.value.futureValue; + let futureEnd = prEnd.value.futureValue; + let pastBegin = prBegin.value.pastValue; + let pastEnd = prEnd.value.pastValue; + result.subDateTimeEntities = prs; + result.timex = `(${prBegin.timexStr},${prEnd.timexStr},P${utilities$2.DateUtils.diffDays(futureEnd, futureBegin)}D)`; + result.futureValue = [futureBegin, futureEnd]; + result.pastValue = [pastBegin, pastEnd]; + result.success = true; + return result; + } + parseYear(source, referenceDate) { + let trimmedSource = source.trim(); + let result = new utilities$2.DateTimeResolutionResult(); + let match = recognizersText.RegExpUtility.getMatches(this.config.yearRegex, trimmedSource).pop(); + if (!match || match.length !== trimmedSource.length) + return result; + let year = Number.parseInt(match.value, 10); + let beginDate = utilities$2.DateUtils.safeCreateFromValue(utilities$2.DateUtils.minValue(), year, 0, 1); + let endDate = utilities$2.DateUtils.addDays(utilities$2.DateUtils.safeCreateFromValue(utilities$2.DateUtils.minValue(), year + 1, 0, 1), this.inclusiveEndPeriod ? -1 : 0); + result.timex = utilities$2.FormatUtil.toString(year, 4); + result.futureValue = [beginDate, endDate]; + result.pastValue = [beginDate, endDate]; + result.success = true; + return result; + } + parseDuration(source, referenceDate) { + let result = new utilities$2.DateTimeResolutionResult(); + let ers = this.config.durationExtractor.extract(source, referenceDate); + let beginDate = new Date(referenceDate); + let endDate = new Date(referenceDate); + let restNowSunday = false; + let durationTimex = ''; + if (ers.length === 1) { + let pr = this.config.durationParser.parse(ers[0]); + if (pr === null) + return result; + let beforeStr = source.substr(0, pr.start).trim(); + let mod; + let durationResult = pr.value; + if (recognizersText.StringUtility.isNullOrEmpty(durationResult.timex)) + return result; + let prefixMatch = recognizersText.RegExpUtility.getMatches(this.config.pastRegex, beforeStr).pop(); + if (prefixMatch) { + mod = constants$2.TimeTypeConstants.beforeMod; + beginDate = this.getSwiftDate(endDate, durationResult.timex, false); + } + prefixMatch = recognizersText.RegExpUtility.getMatches(this.config.futureRegex, beforeStr).pop(); + if (prefixMatch && prefixMatch.length === beforeStr.length) { + mod = constants$2.TimeTypeConstants.afterMod; + // for future the beginDate should add 1 first + beginDate = new Date(referenceDate.getFullYear(), referenceDate.getMonth(), referenceDate.getDate() + 1); + endDate = this.getSwiftDate(beginDate, durationResult.timex, true); + } + prefixMatch = recognizersText.RegExpUtility.getMatches(this.config.inConnectorRegex, beforeStr).pop(); + if (prefixMatch && prefixMatch.length === beforeStr.length) { + mod = constants$2.TimeTypeConstants.afterMod; + beginDate = new Date(referenceDate.getFullYear(), referenceDate.getMonth(), referenceDate.getDate() + 1); + endDate = this.getSwiftDate(beginDate, durationResult.timex, true); + let unit = durationResult.timex.substr(durationResult.timex.length - 1); + durationResult.timex = `P1${unit}`; + beginDate = this.getSwiftDate(endDate, durationResult.timex, false); + } + if (mod) { + pr.value.mod = mod; + } + durationTimex = durationResult.timex; + result.subDateTimeEntities = [pr]; + } + // parse rest of + let match = recognizersText.RegExpUtility.getMatches(this.config.restOfDateRegex, source).pop(); + if (match) { + let diffDays = 0; + let durationStr = match.groups('duration').value; + let durationUnit = this.config.unitMap.get(durationStr); + switch (durationUnit) { + case 'W': + diffDays = 7 - ((beginDate.getDay() === 0) ? 7 : beginDate.getDay()); + endDate = utilities$2.DateUtils.addDays(referenceDate, diffDays); + restNowSunday = (diffDays === 0); + break; + case 'MON': + endDate = utilities$2.DateUtils.safeCreateFromMinValue(beginDate.getFullYear(), beginDate.getMonth(), 1); + endDate.setMonth(beginDate.getMonth() + 1); + endDate.setDate(endDate.getDate() - 1); + diffDays = endDate.getDate() - beginDate.getDate() + 1; + break; + case 'Y': + endDate = utilities$2.DateUtils.safeCreateFromMinValue(beginDate.getFullYear(), 11, 1); + endDate.setMonth(endDate.getMonth() + 1); + endDate.setDate(endDate.getDate() - 1); + diffDays = utilities$2.DateUtils.dayOfYear(endDate) - utilities$2.DateUtils.dayOfYear(beginDate) + 1; + break; + } + durationTimex = `P${diffDays}D`; + } + if (beginDate.getTime() !== endDate.getTime() || restNowSunday) { + endDate = utilities$2.DateUtils.addDays(endDate, this.inclusiveEndPeriod ? -1 : 0); + result.timex = `(${utilities$2.FormatUtil.luisDateFromDate(beginDate)},${utilities$2.FormatUtil.luisDateFromDate(endDate)},${durationTimex})`; + result.futureValue = [beginDate, endDate]; + result.pastValue = [beginDate, endDate]; + result.success = true; + } + return result; + } + getSwiftDate(date, timex, isPositiveSwift) { + let result = new Date(date); + let numStr = timex.replace('P', '').substr(0, timex.length - 2); + let unitStr = timex.substr(timex.length - 1); + let swift = Number.parseInt(numStr, 10) || 0; + if (swift === 0) + return result; + if (!isPositiveSwift) + swift *= -1; + switch (unitStr) { + case 'D': + result.setDate(date.getDate() + swift); + break; + case 'W': + result.setDate(date.getDate() + (7 * swift)); + break; + case 'M': + result.setMonth(date.getMonth() + swift); + break; + case 'Y': + result.setFullYear(date.getFullYear() + swift); + break; + } + return result; + } + parseWeekOfMonth(source, referenceDate) { + let result = new utilities$2.DateTimeResolutionResult(); + let match = recognizersText.RegExpUtility.getMatches(this.config.weekOfMonthRegex, source).pop(); + if (!match || match.length !== source.length) + return result; + let cardinalStr = match.groups('cardinal').value; + let monthStr = match.groups('month').value; + let month = referenceDate.getMonth(); + let year = referenceDate.getFullYear(); + let noYear = false; + let cardinal = this.config.isLastCardinal(cardinalStr) ? 5 + : this.config.cardinalMap.get(cardinalStr); + if (recognizersText.StringUtility.isNullOrEmpty(monthStr)) { + let swift = this.config.getSwiftDayOrMonth(source); + let tempDate = new Date(referenceDate); + tempDate.setMonth(referenceDate.getMonth() + swift); + month = tempDate.getMonth(); + year = tempDate.getFullYear(); + } + else { + month = this.config.monthOfYear.get(monthStr) - 1; + noYear = true; + } + return this.getWeekOfMonth(cardinal, month, year, referenceDate, noYear); + } + getWeekOfMonth(cardinal, month, year, referenceDate, noYear) { + let result = new utilities$2.DateTimeResolutionResult(); + let seedDate = this.computeDate(cardinal, 1, month, year); + if (seedDate.getMonth() !== month) { + cardinal--; + seedDate.setDate(seedDate.getDate() - 7); + } + let futureDate = new Date(seedDate); + let pastDate = new Date(seedDate); + if (noYear && futureDate < referenceDate) { + futureDate = this.computeDate(cardinal, 1, month, year + 1); + if (futureDate.getMonth() !== month) { + futureDate.setDate(futureDate.getDate() - 7); + } + } + if (noYear && pastDate >= referenceDate) { + pastDate = this.computeDate(cardinal, 1, month, year - 1); + if (pastDate.getMonth() !== month) { + pastDate.setDate(pastDate.getDate() - 7); + } + } + result.timex = noYear ? + `XXXX-${utilities$2.FormatUtil.toString(month + 1, 2)}-W${utilities$2.FormatUtil.toString(cardinal, 2)}` : + `${utilities$2.FormatUtil.toString(year, 4)}-${utilities$2.FormatUtil.toString(month + 1, 2)}-W${utilities$2.FormatUtil.toString(cardinal, 2)}`; + result.futureValue = [futureDate, utilities$2.DateUtils.addDays(futureDate, this.inclusiveEndPeriod ? 6 : 7)]; + result.pastValue = [pastDate, utilities$2.DateUtils.addDays(pastDate, this.inclusiveEndPeriod ? 6 : 7)]; + result.success = true; + return result; + } + parseWeekOfYear(source, referenceDate) { + let result = new utilities$2.DateTimeResolutionResult(); + let match = recognizersText.RegExpUtility.getMatches(this.config.weekOfYearRegex, source).pop(); + if (!match || match.length !== source.length) + return result; + let cardinalStr = match.groups('cardinal').value; + let yearStr = match.groups('year').value; + let orderStr = match.groups('order').value; + let year = Number.parseInt(yearStr, 10); + if (isNaN(year)) { + let swift = this.config.getSwiftYear(orderStr); + if (swift < -1) + return result; + year = referenceDate.getFullYear() + swift; + } + let targetWeekMonday; + if (this.config.isLastCardinal(cardinalStr)) { + let lastDay = utilities$2.DateUtils.safeCreateFromMinValue(year, 11, 31); + let lastDayWeekMonday = utilities$2.DateUtils.this(lastDay, utilities$2.DayOfWeek.Monday); + let weekNum = utilities$2.DateUtils.getWeekNumber(lastDay).weekNo; + if (weekNum === 1) { + lastDayWeekMonday = utilities$2.DateUtils.this(utilities$2.DateUtils.addDays(lastDay, -7), utilities$2.DayOfWeek.Monday); + } + targetWeekMonday = lastDayWeekMonday; + weekNum = utilities$2.DateUtils.getWeekNumber(targetWeekMonday).weekNo; + result.timex = `${utilities$2.FormatUtil.toString(year, 4)}-${utilities$2.FormatUtil.toString(targetWeekMonday.getMonth() + 1, 2)}-W${utilities$2.FormatUtil.toString(weekNum, 2)}`; + } + else { + let cardinal = this.config.cardinalMap.get(cardinalStr); + let firstDay = utilities$2.DateUtils.safeCreateFromMinValue(year, 0, 1); + let firstDayWeekMonday = utilities$2.DateUtils.this(firstDay, utilities$2.DayOfWeek.Monday); + let weekNum = utilities$2.DateUtils.getWeekNumber(firstDay).weekNo; + if (weekNum !== 1) { + firstDayWeekMonday = utilities$2.DateUtils.this(utilities$2.DateUtils.addDays(firstDay, 7), utilities$2.DayOfWeek.Monday); + } + targetWeekMonday = utilities$2.DateUtils.addDays(firstDayWeekMonday, 7 * (cardinal - 1)); + let targetWeekSunday = utilities$2.DateUtils.this(targetWeekMonday, utilities$2.DayOfWeek.Sunday); + result.timex = `${utilities$2.FormatUtil.toString(year, 4)}-${utilities$2.FormatUtil.toString(targetWeekSunday.getMonth() + 1, 2)}-W${utilities$2.FormatUtil.toString(cardinal, 2)}`; + } + result.futureValue = [targetWeekMonday, utilities$2.DateUtils.addDays(targetWeekMonday, this.inclusiveEndPeriod ? 6 : 7)]; + result.pastValue = [targetWeekMonday, utilities$2.DateUtils.addDays(targetWeekMonday, this.inclusiveEndPeriod ? 6 : 7)]; + result.success = true; + return result; + } + parseHalfYear(source, referenceDate) { + let result = new utilities$2.DateTimeResolutionResult(); + let match = recognizersText.RegExpUtility.getMatches(this.config.allHalfYearRegex, source).pop(); + if (!match || match.length !== source.length) + return result; + let cardinalStr = match.groups('cardinal').value; + let yearStr = match.groups('year').value; + let orderStr = match.groups('order').value; + let numberStr = match.groups('number').value; + let year = Number.parseInt(yearStr, 10); + if (isNaN(year)) { + let swift = this.config.getSwiftYear(orderStr); + if (swift < -1) { + return result; + } + year = referenceDate.getFullYear() + swift; + } + let quarterNum; + if (!numberStr) { + quarterNum = this.config.cardinalMap.get(cardinalStr); + } + else { + quarterNum = parseInt(numberStr); + } + let beginDate = utilities$2.DateUtils.safeCreateDateResolveOverflow(year, (quarterNum - 1) * constants$2.Constants.SemesterMonthCount, 1); + let endDate = utilities$2.DateUtils.safeCreateDateResolveOverflow(year, quarterNum * constants$2.Constants.SemesterMonthCount, 1); + result.futureValue = [beginDate, endDate]; + result.pastValue = [beginDate, endDate]; + result.timex = `(${utilities$2.FormatUtil.luisDateFromDate(beginDate)},${utilities$2.FormatUtil.luisDateFromDate(endDate)},P6M)`; + result.success = true; + return result; + } + parseQuarter(source, referenceDate) { + let result = new utilities$2.DateTimeResolutionResult(); + let match = recognizersText.RegExpUtility.getMatches(this.config.quarterRegex, source).pop(); + if (!match || match.length !== source.length) { + match = recognizersText.RegExpUtility.getMatches(this.config.quarterRegexYearFront, source).pop(); + } + if (!match || match.length !== source.length) + return result; + let cardinalStr = match.groups('cardinal').value; + let yearStr = match.groups('year').value; + let orderStr = match.groups('order').value; + let numberStr = match.groups('number').value; + let noSpecificYear = false; + let year = Number.parseInt(yearStr, 10); + if (isNaN(year)) { + let swift = this.config.getSwiftYear(orderStr); + if (swift < -1) { + swift = 0; + noSpecificYear = true; + } + year = referenceDate.getFullYear() + swift; + } + let quarterNum; + if (!numberStr) { + quarterNum = this.config.cardinalMap.get(cardinalStr); + } + else { + quarterNum = parseInt(numberStr); + } + let beginDate = utilities$2.DateUtils.safeCreateDateResolveOverflow(year, (quarterNum - 1) * constants$2.Constants.TrimesterMonthCount, 1); + let endDate = utilities$2.DateUtils.safeCreateDateResolveOverflow(year, quarterNum * constants$2.Constants.TrimesterMonthCount, 1); + if (noSpecificYear) { + if (endDate < referenceDate) { + result.pastValue = [beginDate, endDate]; + let futureBeginDate = utilities$2.DateUtils.safeCreateDateResolveOverflow(year + 1, (quarterNum - 1) * constants$2.Constants.TrimesterMonthCount, 1); + let futureEndDate = utilities$2.DateUtils.safeCreateDateResolveOverflow(year + 1, quarterNum * constants$2.Constants.TrimesterMonthCount, 1); + result.futureValue = [futureBeginDate, futureEndDate]; + } + else if (endDate > referenceDate) { + result.futureValue = [beginDate, endDate]; + let pastBeginDate = utilities$2.DateUtils.safeCreateDateResolveOverflow(year - 1, (quarterNum - 1) * constants$2.Constants.TrimesterMonthCount, 1); + let pastEndDate = utilities$2.DateUtils.safeCreateDateResolveOverflow(year - 1, quarterNum * constants$2.Constants.TrimesterMonthCount, 1); + result.pastValue = [pastBeginDate, pastEndDate]; + } + else { + result.futureValue = [beginDate, endDate]; + result.pastValue = [beginDate, endDate]; + } + } + else { + result.futureValue = [beginDate, endDate]; + result.pastValue = [beginDate, endDate]; + } + result.timex = `(${utilities$2.FormatUtil.luisDateFromDate(beginDate)},${utilities$2.FormatUtil.luisDateFromDate(endDate)},P3M)`; + result.success = true; + return result; + } + parseSeason(source, referenceDate) { + let result = new utilities$2.DateTimeResolutionResult(); + let match = recognizersText.RegExpUtility.getMatches(this.config.seasonRegex, source).pop(); + if (!match || match.length !== source.length) + return result; + let swift = this.config.getSwiftYear(source); + let yearStr = match.groups('year').value; + let year = referenceDate.getFullYear(); + let seasonStr = match.groups('seas').value; + let season = this.config.seasonMap.get(seasonStr); + if (swift >= -1 || !recognizersText.StringUtility.isNullOrEmpty(yearStr)) { + if (recognizersText.StringUtility.isNullOrEmpty(yearStr)) + yearStr = utilities$2.FormatUtil.toString(year + swift, 4); + result.timex = `${yearStr}-${season}`; + } + else { + result.timex = season; + } + result.success = true; + return result; + } + parseWhichWeek(source, referenceDate) { + let result = new utilities$2.DateTimeResolutionResult(); + let match = recognizersText.RegExpUtility.getMatches(this.config.whichWeekRegex, source).pop(); + if (!match) + return result; + let num = Number.parseInt(match.groups('number').value, 10); + let year = referenceDate.getFullYear(); + let firstDay = utilities$2.DateUtils.safeCreateFromValue(utilities$2.DateUtils.minValue(), year, 0, 1); + let firstWeekday = utilities$2.DateUtils.this(firstDay, utilities$2.DayOfWeek.Monday); + let resultDate = utilities$2.DateUtils.addDays(firstWeekday, 7 * num); + result.timex = `${utilities$2.FormatUtil.toString(year, 4)}-W${utilities$2.FormatUtil.toString(num, 2)}`; + result.futureValue = [resultDate, utilities$2.DateUtils.addDays(resultDate, 7)]; + result.pastValue = [resultDate, utilities$2.DateUtils.addDays(resultDate, 7)]; + result.success = true; + return result; + } + parseWeekOfDate(source, referenceDate) { + let result = new utilities$2.DateTimeResolutionResult(); + let match = recognizersText.RegExpUtility.getMatches(this.config.weekOfRegex, source).pop(); + let ers = this.config.dateExtractor.extract(source, referenceDate); + if (!match || ers.length !== 1) + return result; + let dateResolution = this.config.dateParser.parse(ers[0], referenceDate).value; + result.timex = dateResolution.timex; + result.comment = this.weekOfComment; + result.futureValue = this.getWeekRangeFromDate(dateResolution.futureValue); + result.pastValue = this.getWeekRangeFromDate(dateResolution.pastValue); + result.success = true; + return result; + } + parseMonthOfDate(source, referenceDate) { + let result = new utilities$2.DateTimeResolutionResult(); + let match = recognizersText.RegExpUtility.getMatches(this.config.monthOfRegex, source).pop(); + let ers = this.config.dateExtractor.extract(source, referenceDate); + if (!match || ers.length !== 1) + return result; + let dateResolution = this.config.dateParser.parse(ers[0], referenceDate).value; + result.timex = dateResolution.timex; + result.comment = this.monthOfComment; + result.futureValue = this.getMonthRangeFromDate(dateResolution.futureValue); + result.pastValue = this.getMonthRangeFromDate(dateResolution.pastValue); + result.success = true; + return result; + } + computeDate(cardinal, weekday, month, year) { + let firstDay = new Date(year, month, 1); + let firstWeekday = utilities$2.DateUtils.this(firstDay, weekday); + if (weekday === 0) + weekday = 7; + let firstDayOfWeek = firstDay.getDay() !== 0 ? firstDay.getDay() : 7; + if (weekday < firstDayOfWeek) + firstWeekday = utilities$2.DateUtils.next(firstDay, weekday); + firstWeekday.setDate(firstWeekday.getDate() + (7 * (cardinal - 1))); + return firstWeekday; + } + getWeekRangeFromDate(seedDate) { + let beginDate = utilities$2.DateUtils.this(seedDate, utilities$2.DayOfWeek.Monday); + let endDate = utilities$2.DateUtils.addDays(beginDate, this.inclusiveEndPeriod ? 6 : 7); + return [beginDate, endDate]; + } + getMonthRangeFromDate(seedDate) { + let beginDate = utilities$2.DateUtils.safeCreateFromValue(utilities$2.DateUtils.minValue(), seedDate.getFullYear(), seedDate.getMonth(), 1); + let endDate = utilities$2.DateUtils.safeCreateFromValue(utilities$2.DateUtils.minValue(), seedDate.getFullYear(), seedDate.getMonth() + 1, 1); + endDate.setDate(endDate.getDate() + (this.inclusiveEndPeriod ? -1 : 0)); + return [beginDate, endDate]; + } +} +exports.BaseDatePeriodParser = BaseDatePeriodParser; + +}); + +unwrapExports(baseDatePeriod); + +var baseTimePeriod = createCommonjsModule(function (module, exports) { +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); + + + + +class BaseTimePeriodExtractor { + constructor(config) { + this.extractorName = constants$2.Constants.SYS_DATETIME_TIMEPERIOD; // "TimePeriod"; + this.config = config; + } + extract(source, refDate) { + if (!refDate) + refDate = new Date(); + let referenceDate = refDate; + let tokens = new Array() + .concat(this.matchSimpleCases(source)) + .concat(this.mergeTwoTimePoints(source, referenceDate)) + .concat(this.matchNight(source)); + let result = utilities$2.Token.mergeAllTokens(tokens, source, this.extractorName); + return result; + } + matchSimpleCases(text) { + let ret = []; + this.config.simpleCasesRegex.forEach(regex => { + let matches = recognizersText.RegExpUtility.getMatches(regex, text); + matches.forEach(match => { + // is there "pm" or "am" ? + let pmStr = match.groups("pm").value; + let amStr = match.groups("am").value; + let descStr = match.groups("desc").value; + // check "pm", "am" + if (pmStr || amStr || descStr) { + ret.push(new utilities$2.Token(match.index, match.index + match.length)); + } + }); + }); + return ret; + } + mergeTwoTimePoints(text, refDate) { + let ret = []; + let ers = this.config.singleTimeExtractor.extract(text, refDate); + let numErs = this.config.integerExtractor.extract(text); + // Check if it is an ending number + if (numErs.length > 0) { + let timeNumbers = []; + // check if it is a ending number + let endingNumber = false; + let num = numErs[numErs.length - 1]; + if (num.start + num.length === text.length) { + endingNumber = true; + } + else { + let afterStr = text.substr(num.start + num.length); + let endingMatch = afterStr.match(this.config.generalEndingRegex); + if (endingMatch) { + endingNumber = true; + } + } + if (endingNumber) { + timeNumbers.push(num); + } + let i = 0; + let j = 0; + while (i < numErs.length) { + // find subsequent time point + let numEndPoint = numErs[i].start + numErs[i].length; + while (j < ers.length && ers[j].start <= numEndPoint) { + j++; + } + if (j >= ers.length) { + break; + } + // check connector string + let midStr = text.substr(numEndPoint, ers[j].start - numEndPoint); + let match = midStr.match(this.config.tillRegex); + if (match && match[0].length === midStr.trim().length) { + timeNumbers.push(numErs[i]); + } + i++; + } + // check overlap + for (let timeNum of timeNumbers) { + let overlap = false; + for (let er of ers) { + if (er.start <= timeNum.start && er.start + er.length >= timeNum.start) { + overlap = true; + } + } + if (!overlap) { + ers.push(timeNum); + } + } + ers = ers.sort((x, y) => (x.start - y.start)); + } + // merge "{TimePoint} to {TimePoint}", "between {TimePoint} and {TimePoint}" + let idx = 0; + while (idx < ers.length - 1) { + let middleBegin = ers[idx].start + ers[idx].length || 0; + let middleEnd = ers[idx + 1].start || 0; + let middleStr = text.substring(middleBegin, middleEnd).trim().toLowerCase(); + let matches = recognizersText.RegExpUtility.getMatches(this.config.tillRegex, middleStr); + // handle "{TimePoint} to {TimePoint}" + if (matches.length > 0 && matches[0].index === 0 && matches[0].length === middleStr.length) { + let periodBegin = ers[idx].start || 0; + let periodEnd = (ers[idx + 1].start || 0) + (ers[idx + 1].length || 0); + // handle "from" + let beforeStr = text.substring(0, periodBegin).trim().toLowerCase(); + let fromIndex = this.config.getFromTokenIndex(beforeStr); + if (fromIndex.matched) { + periodBegin = fromIndex.index; + } + // handle "between" + let betweenIndex = this.config.getBetweenTokenIndex(beforeStr); + if (betweenIndex.matched) { + periodBegin = betweenIndex.index; + } + ret.push(new utilities$2.Token(periodBegin, periodEnd)); + idx += 2; + continue; + } + // handle "between {TimePoint} and {TimePoint}" + if (this.config.hasConnectorToken(middleStr)) { + let periodBegin = ers[idx].start || 0; + let periodEnd = (ers[idx + 1].start || 0) + (ers[idx + 1].length || 0); + // handle "between" + let beforeStr = text.substring(0, periodBegin).trim().toLowerCase(); + let betweenIndex = this.config.getBetweenTokenIndex(beforeStr); + if (betweenIndex.matched) { + periodBegin = betweenIndex.index; + ret.push(new utilities$2.Token(periodBegin, periodEnd)); + idx += 2; + continue; + } + } + idx++; + } + return ret; + } + matchNight(source) { + let ret = []; + let matches = recognizersText.RegExpUtility.getMatches(this.config.timeOfDayRegex, source); + matches.forEach(match => { + ret.push(new utilities$2.Token(match.index, match.index + match.length)); + }); + return ret; + } +} +exports.BaseTimePeriodExtractor = BaseTimePeriodExtractor; +class BaseTimePeriodParser { + constructor(configuration) { + this.config = configuration; + } + parse(er, refTime) { + let referenceTime = refTime || new Date(); + let value = null; + if (er.type === BaseTimePeriodParser.ParserName) { + let innerResult = this.parseSimpleCases(er.text, referenceTime); + if (!innerResult.success) { + innerResult = this.mergeTwoTimePoints(er.text, referenceTime); + } + if (!innerResult.success) { + innerResult = this.parseTimeOfDay(er.text, referenceTime); + } + if (innerResult.success) { + innerResult.futureResolution = {}; + innerResult.futureResolution[constants$2.TimeTypeConstants.START_TIME] = utilities$2.FormatUtil.formatTime(innerResult.futureValue.item1); + innerResult.futureResolution[constants$2.TimeTypeConstants.END_TIME] = utilities$2.FormatUtil.formatTime(innerResult.futureValue.item2); + innerResult.pastResolution = {}; + innerResult.pastResolution[constants$2.TimeTypeConstants.START_TIME] = utilities$2.FormatUtil.formatTime(innerResult.pastValue.item1); + innerResult.pastResolution[constants$2.TimeTypeConstants.END_TIME] = utilities$2.FormatUtil.formatTime(innerResult.pastValue.item2); + value = innerResult; + } + } + let ret = new parsers$4.DateTimeParseResult(er); + ret.value = value; + ret.timexStr = value === null ? "" : value.timex; + ret.resolutionStr = ""; + return ret; + } + parseSimpleCases(source, reference) { + // Cases like "from 3 to 5pm" or "between 4 and 6am", time point is pure number without colon + let result = this.parsePureNumCases(source, reference); + if (!result.success) { + // Cases like "from 3:30 to 5" or "between 3:30am to 6pm", at least one of the time point contains colon + result = this.parseSpecificTimeCases(source, reference); + } + return result; + } + parsePureNumCases(text, referenceTime) { + let ret = new utilities$2.DateTimeResolutionResult(); + let year = referenceTime.getFullYear(); + let month = referenceTime.getMonth(); + let day = referenceTime.getDate(); + let trimmedText = text.trim().toLowerCase(); + let matches = recognizersText.RegExpUtility.getMatches(this.config.pureNumberFromToRegex, trimmedText); + if (!matches.length) { + matches = recognizersText.RegExpUtility.getMatches(this.config.pureNumberBetweenAndRegex, trimmedText); + } + if (matches.length && matches[0].index === 0) { + // this "from .. to .." pattern is valid if followed by a Date OR "pm" + let isValid = false; + // get hours + let hourGroup = matches[0].groups('hour'); + let hourStr = hourGroup.captures[0]; + let afterHourIndex = hourGroup.index + hourGroup.length; + // hard to integrate this part into the regex + if (afterHourIndex === trimmedText.length || !trimmedText.substr(afterHourIndex).trim().startsWith(':')) { + let beginHour = this.config.numbers.get(hourStr); + if (!beginHour) { + beginHour = Number.parseInt(hourStr, 10); + } + hourStr = hourGroup.captures[1]; + afterHourIndex = trimmedText.indexOf(hourStr, hourGroup.index + 1) + hourStr.length; + if (afterHourIndex === trimmedText.length || !trimmedText.substr(afterHourIndex).trim().startsWith(':')) { + let endHour = this.config.numbers.get(hourStr); + if (!endHour) { + endHour = Number.parseInt(hourStr, 10); + } + // parse "pm" + let leftDesc = matches[0].groups("leftDesc").value; + let rightDesc = matches[0].groups("rightDesc").value; + let pmStr = matches[0].groups("pm").value; + let amStr = matches[0].groups("am").value; + // The "ampm" only occurs in time, don't have to consider it here + if (recognizersText.StringUtility.isNullOrWhitespace(leftDesc)) { + let rightAmValid = !recognizersText.StringUtility.isNullOrEmpty(rightDesc) && + recognizersText.RegExpUtility.getMatches(this.config.utilityConfiguration.amDescRegex, rightDesc.toLowerCase()).length; + let rightPmValid = !recognizersText.StringUtility.isNullOrEmpty(rightDesc) && + recognizersText.RegExpUtility.getMatches(this.config.utilityConfiguration.pmDescRegex, rightDesc.toLowerCase()).length; + if (!recognizersText.StringUtility.isNullOrEmpty(amStr) || rightAmValid) { + if (endHour >= 12) { + endHour -= 12; + } + if (beginHour >= 12 && beginHour - 12 < endHour) { + beginHour -= 12; + } + // Resolve case like "11 to 3am" + if (beginHour < 12 && beginHour > endHour) { + beginHour += 12; + } + isValid = true; + } + else if (!recognizersText.StringUtility.isNullOrEmpty(pmStr) || rightPmValid) { + if (endHour < 12) { + endHour += 12; + } + // Resolve case like "11 to 3pm" + if (beginHour + 12 < endHour) { + beginHour += 12; + } + isValid = true; + } + } + if (isValid) { + let beginStr = "T" + utilities$2.FormatUtil.toString(beginHour, 2); + let endStr = "T" + utilities$2.FormatUtil.toString(endHour, 2); + if (beginHour >= endHour) { + endHour += 24; + } + ret.timex = `(${beginStr},${endStr},PT${endHour - beginHour}H)`; + ret.futureValue = ret.pastValue = { + item1: new Date(year, month, day, beginHour, 0, 0), + item2: new Date(year, month, day, endHour, 0, 0) + }; + ret.success = true; + return ret; + } + } + } + } + return ret; + } + parseSpecificTimeCases(source, reference) { + let result = new utilities$2.DateTimeResolutionResult(); + let year = reference.getFullYear(); + let month = reference.getMonth(); + let day = reference.getDate(); + let trimmedText = source.trim().toLowerCase(); + // Handle cases like "from 4:30 to 5" + let match = recognizersText.RegExpUtility.getMatches(this.config.specificTimeFromToRegex, source).pop(); + if (!match) { + // Handle cases like "between 5:10 and 7" + match = recognizersText.RegExpUtility.getMatches(this.config.specificTimeBetweenAndRegex, source).pop(); + } + if (match && match.index === 0 && match.index + match.length === trimmedText.length) { + // Cases like "half past seven" are not handled here + if (match.groups('prefix').value !== '') { + return result; + } + // Cases like "4" is different with "4:00" as the Timex is different "T04H" vs "T04H00M" + // Uses this invalidFlag to differentiate + let beginHour; + let invalidFlag = -1; + let beginMinute = invalidFlag; + let beginSecond = invalidFlag; + let endHour; + let endMinute = invalidFlag; + let endSecond = invalidFlag; + // Get time1 and time2 + let hourGroup = match.groups('hour'); + let hourStr = hourGroup.captures[0]; + if (this.config.numbers.has(hourStr)) { + beginHour = this.config.numbers[hourStr]; + } + else { + beginHour = parseInt(hourStr, 10); + } + hourStr = hourGroup.captures[1]; + if (this.config.numbers.has(hourStr)) { + endHour = this.config.numbers[hourStr]; + } + else { + endHour = parseInt(hourStr, 10); + } + let time1StartIndex = match.groups('time1').index; + let time1EndIndex = time1StartIndex + match.groups('time1').length; + let time2StartIndex = match.groups('time2').index; + let time2EndIndex = time2StartIndex + match.groups('time2').length; + // Get beginMinute (if exists) and endMinute (if exists) + let lastGroupIndex = 0; + for (let i = 0; i < match.groups('min').captures.length; i++) { + let minuteCapture = match.groups('min').captures[i]; + let minuteCaptureIndex = source.indexOf(minuteCapture, lastGroupIndex); + if (minuteCaptureIndex >= time1StartIndex && minuteCaptureIndex + minuteCapture.length <= time1EndIndex) { + beginMinute = parseInt(minuteCapture, 10); + } + else if (minuteCaptureIndex >= time2StartIndex && minuteCaptureIndex + minuteCapture.length <= time2EndIndex) { + endMinute = parseInt(minuteCapture, 10); + } + lastGroupIndex = minuteCaptureIndex + 1; + } + lastGroupIndex = 0; + // Get beginSecond (if exists) and endSecond (if exists) + for (let i = 0; i < match.groups('sec').captures.length; i++) { + let secondCapture = match.groups('sec').captures[i]; + let secondCaptureIndex = source.indexOf(secondCapture, lastGroupIndex); + if (secondCaptureIndex >= time1StartIndex && secondCaptureIndex + secondCapture.length <= time1EndIndex) { + beginSecond = parseInt(secondCapture, 10); + } + else if (secondCaptureIndex >= time2StartIndex && secondCaptureIndex + secondCapture.length <= time2EndIndex) { + endSecond = parseInt(secondCapture, 10); + } + lastGroupIndex = secondCaptureIndex + 1; + } + lastGroupIndex = 0; + // Desc here means descriptions like "am / pm / o'clock" + // Get leftDesc (if exists) and rightDesc (if exists) + let leftDesc = match.groups('leftDesc').value; + let rightDesc = match.groups('rightDesc').value; + for (let i = 0; i < match.groups('desc').captures.length; i++) { + let descCapture = match.groups('desc').captures[i]; + let descCaptureIndex = source.indexOf(descCapture, lastGroupIndex); + if (descCaptureIndex >= time1StartIndex && descCaptureIndex + descCapture.length <= time1EndIndex && recognizersText.StringUtility.isNullOrEmpty(leftDesc)) { + leftDesc = descCapture; + } + else if (descCaptureIndex >= time2StartIndex && descCaptureIndex + descCapture.length <= time2EndIndex && recognizersText.StringUtility.isNullOrEmpty(rightDesc)) { + rightDesc = descCapture; + } + lastGroupIndex = descCaptureIndex + 1; + } + let beginDateTime = utilities$2.DateUtils.safeCreateFromMinValue(year, month, day, beginHour, beginMinute >= 0 ? beginMinute : 0, beginSecond >= 0 ? beginSecond : 0); + let endDateTime = utilities$2.DateUtils.safeCreateFromMinValue(year, month, day, endHour, endMinute >= 0 ? endMinute : 0, endSecond >= 0 ? endSecond : 0); + let hasLeftAm = !recognizersText.StringUtility.isNullOrEmpty(leftDesc) && leftDesc.toLowerCase().startsWith('a'); + let hasLeftPm = !recognizersText.StringUtility.isNullOrEmpty(leftDesc) && leftDesc.toLowerCase().startsWith('p'); + let hasRightAm = !recognizersText.StringUtility.isNullOrEmpty(rightDesc) && rightDesc.toLowerCase().startsWith('a'); + let hasRightPm = !recognizersText.StringUtility.isNullOrEmpty(rightDesc) && rightDesc.toLowerCase().startsWith('p'); + let hasLeft = hasLeftAm || hasLeftPm; + let hasRight = hasRightAm || hasRightPm; + // Both timepoint has description like 'am' or 'pm' + if (hasLeft && hasRight) { + if (hasLeftAm) { + if (beginHour >= 12) { + beginDateTime = utilities$2.DateUtils.addHours(beginDateTime, -12); + } + } + else if (hasLeftPm) { + if (beginHour < 12) { + beginDateTime = utilities$2.DateUtils.addHours(beginDateTime, 12); + } + } + if (hasRightAm) { + if (endHour >= 12) { + endDateTime = utilities$2.DateUtils.addHours(endDateTime, -12); + } + } + else if (hasRightPm) { + if (endHour < 12) { + endDateTime = utilities$2.DateUtils.addHours(endDateTime, 12); + } + } + } + else if (hasLeft || hasRight) { + if (hasLeftAm) { + if (beginHour >= 12) { + beginDateTime = utilities$2.DateUtils.addHours(beginDateTime, -12); + } + if (endHour < 12) { + if (endDateTime < beginDateTime) { + endDateTime = utilities$2.DateUtils.addHours(endDateTime, 12); + } + } + } + else if (hasLeftPm) { + if (beginHour < 12) { + beginDateTime = utilities$2.DateUtils.addHours(beginDateTime, 12); + } + if (endHour < 12) { + if (endDateTime.getTime() < beginDateTime.getTime()) { + let span = utilities$2.DateUtils.totalHoursFloor(beginDateTime, endDateTime); + if (span >= 12) { + endDateTime = utilities$2.DateUtils.addHours(endDateTime, 24); + } + else { + endDateTime = utilities$2.DateUtils.addHours(endDateTime, 12); + } + } + } + } + if (hasRightAm) { + if (endHour >= 12) { + endDateTime = utilities$2.DateUtils.addHours(endDateTime, -12); + } + if (beginHour < 12) { + if (endDateTime.getTime() < beginDateTime.getTime()) { + beginDateTime = utilities$2.DateUtils.addHours(beginDateTime, -12); + } + } + } + else if (hasRightPm) { + if (endHour < 12) { + endDateTime = utilities$2.DateUtils.addHours(endDateTime, 12); + } + if (beginHour < 12) { + if (endDateTime.getTime() < beginDateTime.getTime()) { + beginDateTime = utilities$2.DateUtils.addHours(beginDateTime, -12); + } + else { + let span = utilities$2.DateUtils.totalHoursFloor(endDateTime, beginDateTime); + if (span > 12) { + beginDateTime = utilities$2.DateUtils.addHours(beginDateTime, 12); + } + } + } + } + } + else if (!hasLeft && !hasRight && beginHour <= 12 && endHour <= 12) { + if (beginHour > endHour) { + if (beginHour === 12) { + beginDateTime = utilities$2.DateUtils.addHours(beginDateTime, -12); + } + else { + endDateTime = utilities$2.DateUtils.addHours(endDateTime, 12); + } + } + result.comment = constants$2.Constants.CommentAmPm; + } + if (endDateTime.getTime() < beginDateTime.getTime()) { + endDateTime = utilities$2.DateUtils.addHours(endDateTime, 24); + } + let beginStr = utilities$2.FormatUtil.shortTime(beginDateTime.getHours(), beginMinute, beginSecond); + let endStr = utilities$2.FormatUtil.shortTime(endDateTime.getHours(), endMinute, endSecond); + result.success = true; + result.timex = `(${beginStr},${endStr},${utilities$2.FormatUtil.luisTimeSpan(endDateTime, beginDateTime)})`; + result.futureValue = result.pastValue = { item1: beginDateTime, item2: endDateTime }; + result.subDateTimeEntities = []; + // In SplitDateAndTime mode, time points will be get from these SubDateTimeEntities + // Cases like "from 4 to 5pm", "4" should not be treated as SubDateTimeEntity + if (hasLeft || beginMinute !== invalidFlag || beginSecond !== invalidFlag) { + let er = { + start: time1StartIndex, + length: time1EndIndex - time1StartIndex, + text: source.substring(time1StartIndex, time1EndIndex), + type: constants$2.Constants.SYS_DATETIME_TIME + }; + let pr = this.config.timeParser.parse(er, reference); + result.subDateTimeEntities.push(pr); + } + // Cases like "from 4am to 5", "5" should not be treated as SubDateTimeEntity + if (hasRight || endMinute !== invalidFlag || endSecond !== invalidFlag) { + let er = { + start: time2StartIndex, + length: time2EndIndex - time2StartIndex, + text: source.substring(time2StartIndex, time2EndIndex), + type: constants$2.Constants.SYS_DATETIME_TIME + }; + let pr = this.config.timeParser.parse(er, reference); + result.subDateTimeEntities.push(pr); + } + } + return result; + } + mergeTwoTimePoints(text, referenceTime) { + let ret = new utilities$2.DateTimeResolutionResult(); + let ers = this.config.timeExtractor.extract(text, referenceTime); + let pr1 = null; + let pr2 = null; + let validTimeNumber = false; + if (ers.length !== 2) { + if (ers.length === 1) { + let numErs = this.config.integerExtractor.extract(text); + for (let num of numErs) { + let midStrBegin = 0; + let midStrEnd = 0; + // ending number + if (num.start > ers[0].start + ers[0].length) { + midStrBegin = ers[0].start + ers[0].length; + midStrEnd = num.start - midStrBegin; + } + else if (num.start + num.length < ers[0].start) { + midStrBegin = num.start + num.length; + midStrEnd = ers[0].start - midStrBegin; + } + // check if the middle string between the time point and the valid number is a connect string. + let middleStr = text.substr(midStrBegin, midStrEnd); + let tillMatch = middleStr.match(this.config.tillRegex); + if (tillMatch) { + num.type = constants$2.Constants.SYS_DATETIME_TIME; + ers.push(num); + validTimeNumber = true; + break; + } + } + ers = ers.sort((x, y) => (x.start - y.start)); + } + if (!validTimeNumber) { + return ret; + } + } + if (ers.length !== 2) { + return ret; + } + pr1 = this.config.timeParser.parse(ers[0], referenceTime); + pr2 = this.config.timeParser.parse(ers[1], referenceTime); + if (pr1.value === null || pr2.value === null) { + return ret; + } + let ampmStr1 = pr1.value.comment; + let ampmStr2 = pr2.value.comment; + let beginTime = pr1.value.futureValue; + let endTime = pr2.value.futureValue; + if (!recognizersText.StringUtility.isNullOrEmpty(ampmStr2) && ampmStr2.endsWith("ampm") + && endTime <= beginTime && utilities$2.DateUtils.addHours(endTime, 12) > beginTime) { + endTime = utilities$2.DateUtils.addHours(endTime, 12); + pr2.value.futureValue = endTime; + pr2.timexStr = `T${endTime.getHours()}`; + if (endTime.getMinutes() > 0) { + pr2.timexStr = `${pr2.timexStr}:${endTime.getMinutes()}`; + } + } + if (!recognizersText.StringUtility.isNullOrEmpty(ampmStr1) && ampmStr1.endsWith("ampm") + && endTime > utilities$2.DateUtils.addHours(beginTime, 12)) { + beginTime = utilities$2.DateUtils.addHours(beginTime, 12); + pr1.value.futureValue = beginTime; + pr1.timexStr = `T${beginTime.getHours()}`; + if (beginTime.getMinutes() > 0) { + pr1.timexStr = `${pr1.timexStr}:${beginTime.getMinutes()}`; + } + } + if (endTime < beginTime) { + endTime = utilities$2.DateUtils.addDays(endTime, 1); + } + let hours = utilities$2.DateUtils.totalHoursFloor(endTime, beginTime); + let minutes = utilities$2.DateUtils.totalMinutesFloor(endTime, beginTime) % 60; + ret.timex = `(${pr1.timexStr},${pr2.timexStr},PT` + + (hours > 0 ? `${hours}H` : '') + + (minutes > 0 ? `${minutes}M` : '') + + ')'; + ret.futureValue = ret.pastValue = { item1: beginTime, item2: endTime }; + ret.success = true; + if (ampmStr1 && ampmStr1.endsWith("ampm") && ampmStr2 && ampmStr2.endsWith("ampm")) { + ret.comment = "ampm"; + } + ret.subDateTimeEntities = [pr1, pr2]; + return ret; + } + // parse "morning", "afternoon", "night" + parseTimeOfDay(text, referenceTime) { + let day = referenceTime.getDate(); + let month = referenceTime.getMonth(); + let year = referenceTime.getFullYear(); + let ret = new utilities$2.DateTimeResolutionResult(); + // extract early/late prefix from text + let matches = recognizersText.RegExpUtility.getMatches(this.config.timeOfDayRegex, text); + let hasEarly = false; + let hasLate = false; + if (matches.length) { + if (!recognizersText.StringUtility.isNullOrEmpty(matches[0].groups("early").value)) { + let early = matches[0].groups("early").value; + text = text.replace(early, ""); + hasEarly = true; + ret.comment = "early"; + } + if (!hasEarly && !recognizersText.StringUtility.isNullOrEmpty(matches[0].groups("late").value)) { + let late = matches[0].groups("late").value; + text = text.replace(late, ""); + hasLate = true; + ret.comment = "late"; + } + } + let timexRange = this.config.getMatchedTimexRange(text); + if (!timexRange.matched) { + return new utilities$2.DateTimeResolutionResult(); + } + // modify time period if "early" or "late" is existed + if (hasEarly) { + timexRange.endHour = timexRange.beginHour + 2; + // handling case: night end with 23:59 + if (timexRange.endMin === 59) { + timexRange.endMin = 0; + } + } + else if (hasLate) { + timexRange.beginHour = timexRange.beginHour + 2; + } + ret.timex = timexRange.timex; + ret.futureValue = ret.pastValue = { + item1: new Date(year, month, day, timexRange.beginHour, 0, 0), + item2: new Date(year, month, day, timexRange.endHour, timexRange.endMin, timexRange.endMin) + }; + ret.success = true; + return ret; + } +} +BaseTimePeriodParser.ParserName = constants$2.Constants.SYS_DATETIME_TIMEPERIOD; // "TimePeriod"; +exports.BaseTimePeriodParser = BaseTimePeriodParser; + +}); + +unwrapExports(baseTimePeriod); + +var baseDateTime$2 = createCommonjsModule(function (module, exports) { +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); + + + + +class BaseDateTimeExtractor { + constructor(config) { + this.extractorName = constants$2.Constants.SYS_DATETIME_DATETIME; + this.config = config; + } + extract(source, refDate) { + if (!refDate) + refDate = new Date(); + let referenceDate = refDate; + let tokens = new Array(); + tokens = tokens.concat(this.mergeDateAndTime(source, referenceDate)); + tokens = tokens.concat(this.basicRegexMatch(source)); + tokens = tokens.concat(this.timeOfTodayBefore(source, referenceDate)); + tokens = tokens.concat(this.timeOfTodayAfter(source, referenceDate)); + tokens = tokens.concat(this.specialTimeOfDate(source, referenceDate)); + tokens = tokens.concat(this.durationWithBeforeAndAfter(source, referenceDate)); + let result = utilities$2.Token.mergeAllTokens(tokens, source, this.extractorName); + return result; + } + mergeDateAndTime(source, refDate) { + let tokens = new Array(); + let ers = this.config.datePointExtractor.extract(source, refDate); + if (ers.length < 1) + return tokens; + ers = ers.concat(this.config.timePointExtractor.extract(source, refDate)); + if (ers.length < 2) + return tokens; + ers = ers.sort((erA, erB) => erA.start < erB.start ? -1 : erA.start === erB.start ? 0 : 1); + let i = 0; + while (i < ers.length - 1) { + let j = i + 1; + while (j < ers.length && recognizersText.ExtractResult.isOverlap(ers[i], ers[j])) { + j++; + } + if (j >= ers.length) + break; + if ((ers[i].type === constants$2.Constants.SYS_DATETIME_DATE && ers[j].type === constants$2.Constants.SYS_DATETIME_TIME) || + (ers[i].type === constants$2.Constants.SYS_DATETIME_TIME && ers[j].type === constants$2.Constants.SYS_DATETIME_DATE)) { + let middleBegin = ers[i].start + ers[i].length; + let middleEnd = ers[j].start; + if (middleBegin > middleEnd) { + i = j + 1; + continue; + } + let middleStr = source.substr(middleBegin, middleEnd - middleBegin).trim().toLowerCase(); + if (this.config.isConnectorToken(middleStr)) { + let begin = ers[i].start; + let end = ers[j].start + ers[j].length; + tokens.push(new utilities$2.Token(begin, end)); + } + i = j + 1; + continue; + } + i = j; + } + tokens.forEach((token, index) => { + let afterStr = source.substr(token.end); + let match = recognizersText.RegExpUtility.getMatches(this.config.suffixRegex, afterStr); + if (match && match.length > 0) { + // TODO: verify element + token.end += match[0].length; + } + }); + return tokens; + } + basicRegexMatch(source) { + let tokens = new Array(); + recognizersText.RegExpUtility.getMatches(this.config.nowRegex, source) + .forEach(match => { + tokens.push(new utilities$2.Token(match.index, match.index + match.length)); + }); + return tokens; + } + timeOfTodayBefore(source, refDate) { + let tokens = new Array(); + let ers = this.config.timePointExtractor.extract(source, refDate); + ers.forEach(er => { + let beforeStr = source.substr(0, er.start); + let innerMatches = recognizersText.RegExpUtility.getMatches(this.config.nightRegex, er.text); + if (innerMatches && innerMatches.length > 0 && innerMatches[0].index === 0) { + beforeStr = source.substr(0, er.start + innerMatches[0].length); + } + if (recognizersText.StringUtility.isNullOrWhitespace(beforeStr)) + return; + let matches = recognizersText.RegExpUtility.getMatches(this.config.timeOfTodayBeforeRegex, beforeStr); + if (matches && matches.length > 0) { + let begin = matches[0].index; + let end = er.start + er.length; + tokens.push(new utilities$2.Token(begin, end)); + } + }); + recognizersText.RegExpUtility.getMatches(this.config.simpleTimeOfTodayBeforeRegex, source) + .forEach(match => { + tokens.push(new utilities$2.Token(match.index, match.index + match.length)); + }); + return tokens; + } + timeOfTodayAfter(source, refDate) { + let tokens = new Array(); + let ers = this.config.timePointExtractor.extract(source, refDate); + ers.forEach(er => { + let afterStr = source.substr(er.start + er.length); + if (recognizersText.StringUtility.isNullOrWhitespace(afterStr)) + return; + let matches = recognizersText.RegExpUtility.getMatches(this.config.timeOfTodayAfterRegex, afterStr); + if (matches && matches.length > 0) { + let begin = er.start; + let end = er.start + er.length + matches[0].length; + tokens.push(new utilities$2.Token(begin, end)); + } + }); + recognizersText.RegExpUtility.getMatches(this.config.simpleTimeOfTodayAfterRegex, source) + .forEach(match => { + tokens.push(new utilities$2.Token(match.index, match.index + match.length)); + }); + return tokens; + } + specialTimeOfDate(source, refDate) { + let tokens = new Array(); + let ers = this.config.datePointExtractor.extract(source, refDate); + ers.forEach(er => { + let beforeStr = source.substr(0, er.start); + let beforeMatches = recognizersText.RegExpUtility.getMatches(this.config.theEndOfRegex, beforeStr); + if (beforeMatches && beforeMatches.length > 0) { + tokens.push(new utilities$2.Token(beforeMatches[0].index, er.start + er.length)); + } + else { + let afterStr = source.substr(er.start + er.length); + let afterMatches = recognizersText.RegExpUtility.getMatches(this.config.theEndOfRegex, afterStr); + if (afterMatches && afterMatches.length > 0) { + tokens.push(new utilities$2.Token(er.start, er.start + er.length + afterMatches[0].index + afterMatches[0].length)); + } + } + }); + return tokens; + } + durationWithBeforeAndAfter(source, refDate) { + let tokens = new Array(); + this.config.durationExtractor.extract(source, refDate).forEach(er => { + let matches = recognizersText.RegExpUtility.getMatches(this.config.unitRegex, er.text); + if (matches && matches.length > 0) { + tokens = utilities$2.AgoLaterUtil.extractorDurationWithBeforeAndAfter(source, er, tokens, this.config.utilityConfiguration); + } + }); + return tokens; + } +} +exports.BaseDateTimeExtractor = BaseDateTimeExtractor; +class BaseDateTimeParser { + constructor(configuration) { + this.config = configuration; + } + parse(er, refTime) { + if (!refTime) + refTime = new Date(); + let referenceTime = refTime; + let value = null; + if (er.type === BaseDateTimeParser.ParserName) { + let innerResult = this.mergeDateAndTime(er.text, referenceTime); + if (!innerResult.success) { + innerResult = this.parseBasicRegex(er.text, referenceTime); + } + if (!innerResult.success) { + innerResult = this.parseTimeOfToday(er.text, referenceTime); + } + if (!innerResult.success) { + innerResult = this.parseSpecialTimeOfDate(er.text, referenceTime); + } + if (!innerResult.success) { + innerResult = this.parserDurationWithAgoAndLater(er.text, referenceTime); + } + if (innerResult.success) { + innerResult.futureResolution = {}; + innerResult.futureResolution[constants$2.TimeTypeConstants.DATETIME] = utilities$2.FormatUtil.formatDateTime(innerResult.futureValue); + innerResult.pastResolution = {}; + innerResult.pastResolution[constants$2.TimeTypeConstants.DATETIME] = utilities$2.FormatUtil.formatDateTime(innerResult.pastValue); + value = innerResult; + } + } + let ret = new parsers$4.DateTimeParseResult(er); + { + ret.value = value, ret.timexStr = value === null ? "" : value.timex, ret.resolutionStr = ""; + } + + return ret; + } + parseBasicRegex(text, referenceTime) { + let ret = new utilities$2.DateTimeResolutionResult(); + let trimmedText = text.trim().toLowerCase(); + // handle "now" + let matches = recognizersText.RegExpUtility.getMatches(this.config.nowRegex, trimmedText); + if (matches.length && matches[0].index === 0 && matches[0].length === trimmedText.length) { + let getMatchedNowTimex = this.config.getMatchedNowTimex(trimmedText); + ret.timex = getMatchedNowTimex.timex; + ret.futureValue = ret.pastValue = referenceTime; + ret.success = true; + return ret; + } + return ret; + } + // merge a Date entity and a Time entity + mergeDateAndTime(text, referenceTime) { + let ret = new utilities$2.DateTimeResolutionResult(); + let er1 = this.config.dateExtractor.extract(text, referenceTime); + if (er1.length === 0) { + er1 = this.config.dateExtractor.extract(this.config.tokenBeforeDate + text, referenceTime); + if (er1.length === 1) { + er1[0].start -= this.config.tokenBeforeDate.length; + } + else { + return ret; + } + } + else { + // this is to understand if there is an ambiguous token in the text. For some languages (e.g. spanish) + // the same word could mean different things (e.g a time in the day or an specific day). + if (this.config.haveAmbiguousToken(text, er1[0].text)) { + return ret; + } + } + let er2 = this.config.timeExtractor.extract(text, referenceTime); + if (er2.length === 0) { + // here we filter out "morning, afternoon, night..." time entities + er2 = this.config.timeExtractor.extract(this.config.tokenBeforeTime + text, referenceTime); + if (er2.length === 1) { + er2[0].start -= this.config.tokenBeforeTime.length; + } + else { + return ret; + } + } + // handle case "Oct. 5 in the afternoon at 7:00" + // in this case "5 in the afternoon" will be extract as a Time entity + let correctTimeIdx = 0; + while (correctTimeIdx < er2.length && recognizersText.ExtractResult.isOverlap(er2[correctTimeIdx], er1[0])) { + correctTimeIdx++; + } + if (correctTimeIdx >= er2.length) { + return ret; + } + let pr1 = this.config.dateParser.parse(er1[0], new Date(referenceTime.toDateString())); + let pr2 = this.config.timeParser.parse(er2[correctTimeIdx], referenceTime); + if (pr1.value === null || pr2.value === null) { + return ret; + } + let futureDate = pr1.value.futureValue; + let pastDate = pr1.value.pastValue; + let time = pr2.value.futureValue; + let hour = time.getHours(); + let min = time.getMinutes(); + let sec = time.getSeconds(); + // handle morning, afternoon + if (recognizersText.RegExpUtility.getMatches(this.config.pmTimeRegex, text).length && hour < 12) { + hour += 12; + } + else if (recognizersText.RegExpUtility.getMatches(this.config.amTimeRegex, text).length && hour >= 12) { + hour -= 12; + } + let timeStr = pr2.timexStr; + if (timeStr.endsWith("ampm")) { + timeStr = timeStr.substring(0, timeStr.length - 4); + } + timeStr = "T" + utilities$2.FormatUtil.toString(hour, 2) + timeStr.substring(3); + ret.timex = pr1.timexStr + timeStr; + let val = pr2.value; + if (hour <= 12 && !recognizersText.RegExpUtility.getMatches(this.config.pmTimeRegex, text).length + && !recognizersText.RegExpUtility.getMatches(this.config.amTimeRegex, text).length && val.comment) { + ret.comment = "ampm"; + } + ret.futureValue = new Date(futureDate.getFullYear(), futureDate.getMonth(), futureDate.getDate(), hour, min, sec); + ret.pastValue = new Date(pastDate.getFullYear(), pastDate.getMonth(), pastDate.getDate(), hour, min, sec); + ret.success = true; + // change the value of time object + pr2.timexStr = timeStr; + if (!recognizersText.StringUtility.isNullOrEmpty(ret.comment)) { + pr2.value.comment = ret.comment === "ampm" ? "ampm" : ""; + } + // add the date and time object in case we want to split them + ret.subDateTimeEntities = [pr1, pr2]; + return ret; + } + parseTimeOfToday(text, referenceTime) { + let ret = new utilities$2.DateTimeResolutionResult(); + let trimmedText = text.toLowerCase().trim(); + let hour = 0; + let min = 0; + let sec = 0; + let timeStr; + let wholeMatches = recognizersText.RegExpUtility.getMatches(this.config.simpleTimeOfTodayAfterRegex, trimmedText); + if (!(wholeMatches.length && wholeMatches[0].length === trimmedText.length)) { + wholeMatches = recognizersText.RegExpUtility.getMatches(this.config.simpleTimeOfTodayBeforeRegex, trimmedText); + } + if (wholeMatches.length && wholeMatches[0].length === trimmedText.length) { + let hourStr = wholeMatches[0].groups("hour").value; + if (!hourStr) { + hourStr = wholeMatches[0].groups("hournum").value.toLowerCase(); + hour = this.config.numbers.get(hourStr); + } + else { + hour = parseInt(hourStr, 10); + } + timeStr = "T" + utilities$2.FormatUtil.toString(hour, 2); + } + else { + let ers = this.config.timeExtractor.extract(trimmedText, referenceTime); + if (ers.length !== 1) { + ers = this.config.timeExtractor.extract(this.config.tokenBeforeTime + trimmedText, referenceTime); + if (ers.length === 1) { + ers[0].start -= this.config.tokenBeforeTime.length; + } + else { + return ret; + } + } + let pr = this.config.timeParser.parse(ers[0], referenceTime); + if (pr.value === null) { + return ret; + } + let time = pr.value.futureValue; + hour = time.getHours(); + min = time.getMinutes(); + sec = time.getSeconds(); + timeStr = pr.timexStr; + } + let matches = recognizersText.RegExpUtility.getMatches(this.config.specificTimeOfDayRegex, trimmedText); + if (matches.length) { + let matchStr = matches[0].value.toLowerCase(); + // handle "last", "next" + let swift = this.config.getSwiftDay(matchStr); + let date = new Date(referenceTime); + date.setDate(date.getDate() + swift); + // handle "morning", "afternoon" + hour = this.config.getHour(matchStr, hour); + // in this situation, luisStr cannot end up with "ampm", because we always have a "morning" or "night" + if (timeStr.endsWith("ampm")) { + timeStr = timeStr.substring(0, timeStr.length - 4); + } + timeStr = "T" + utilities$2.FormatUtil.toString(hour, 2) + timeStr.substring(3); + ret.timex = utilities$2.FormatUtil.formatDate(date) + timeStr; + ret.futureValue = ret.pastValue = new Date(date.getFullYear(), date.getMonth(), date.getDate(), hour, min, sec); + ret.success = true; + return ret; + } + return ret; + } + parseSpecialTimeOfDate(text, refDateTime) { + let ret = new utilities$2.DateTimeResolutionResult(); + let ers = this.config.dateExtractor.extract(text, refDateTime); + if (ers.length !== 1) { + return ret; + } + let beforeStr = text.substring(0, ers[0].start || 0); + if (recognizersText.RegExpUtility.getMatches(this.config.theEndOfRegex, beforeStr).length) { + let pr = this.config.dateParser.parse(ers[0], refDateTime); + let futureDate = new Date(pr.value.futureValue); + let pastDate = new Date(pr.value.pastValue); + ret.timex = pr.timexStr + "T23:59"; + futureDate.setDate(futureDate.getDate() + 1); + futureDate.setMinutes(futureDate.getMinutes() - 1); + ret.futureValue = futureDate; + pastDate.setDate(pastDate.getDate() + 1); + pastDate.setMinutes(pastDate.getMinutes() - 1); + ret.pastValue = pastDate; + ret.success = true; + return ret; + } + return ret; + } + // handle like "two hours ago" + parserDurationWithAgoAndLater(text, referenceTime) { + return utilities$2.AgoLaterUtil.parseDurationWithAgoAndLater(text, referenceTime, this.config.durationExtractor, this.config.durationParser, this.config.unitMap, this.config.unitRegex, this.config.utilityConfiguration, utilities$2.AgoLaterMode.DateTime); + } +} +BaseDateTimeParser.ParserName = constants$2.Constants.SYS_DATETIME_DATETIME; // "DateTime"; +exports.BaseDateTimeParser = BaseDateTimeParser; + +}); + +unwrapExports(baseDateTime$2); + +var baseDateTimePeriod = createCommonjsModule(function (module, exports) { +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); + + + + +class BaseDateTimePeriodExtractor { + constructor(config) { + this.extractorName = constants$2.Constants.SYS_DATETIME_DATETIMEPERIOD; + this.config = config; + } + extract(source, refDate) { + if (!refDate) + refDate = new Date(); + let referenceDate = refDate; + let tokens = new Array() + .concat(this.matchSimpleCases(source, referenceDate)) + .concat(this.mergeTwoTimePoints(source, referenceDate)) + .concat(this.matchDuration(source, referenceDate)) + .concat(this.matchNight(source, referenceDate)) + .concat(this.matchRelativeUnit(source)); + let result = utilities$2.Token.mergeAllTokens(tokens, source, this.extractorName); + return result; + } + matchSimpleCases(source, refDate) { + let tokens = new Array(); + this.config.simpleCasesRegexes.forEach(regexp => { + recognizersText.RegExpUtility.getMatches(regexp, source).forEach(match => { + // has a date before? + let hasBeforeDate = false; + let beforeStr = source.substr(0, match.index); + if (!recognizersText.StringUtility.isNullOrWhitespace(beforeStr)) { + let ers = this.config.singleDateExtractor.extract(beforeStr, refDate); + if (ers && ers.length > 0) { + let er = ers[ers.length - 1]; + let begin = er.start; + let middleStr = beforeStr.substr(begin + er.length).trim().toLowerCase(); + if (recognizersText.StringUtility.isNullOrWhitespace(middleStr) || recognizersText.RegExpUtility.getMatches(this.config.prepositionRegex, middleStr).length > 0) { + tokens.push(new utilities$2.Token(begin, match.index + match.length)); + hasBeforeDate = true; + } + } + } + let followedStr = source.substr(match.index + match.length); + if (!recognizersText.StringUtility.isNullOrWhitespace(followedStr) && !hasBeforeDate) { + let ers = this.config.singleDateExtractor.extract(followedStr, refDate); + if (ers && ers.length > 0) { + let er = ers[0]; + let begin = er.start; + let end = er.start + er.length; + let middleStr = followedStr.substr(0, begin).trim().toLowerCase(); + if (recognizersText.StringUtility.isNullOrWhitespace(middleStr) || recognizersText.RegExpUtility.getMatches(this.config.prepositionRegex, middleStr).length > 0) { + tokens.push(new utilities$2.Token(match.index, match.index + match.length + end)); + } + } + } + }); + }); + return tokens; + } + mergeTwoTimePoints(source, refDate) { + let tokens = new Array(); + let ersDateTime = this.config.singleDateTimeExtractor.extract(source, refDate); + let ersTime = this.config.singleTimeExtractor.extract(source, refDate); + let innerMarks = []; + let j = 0; + ersDateTime.forEach((erDateTime, index) => { + innerMarks.push(erDateTime); + while (j < ersTime.length && ersTime[j].start + ersTime[j].length < erDateTime.start) { + innerMarks.push(ersTime[j++]); + } + while (j < ersTime.length && recognizersText.ExtractResult.isOverlap(ersTime[j], erDateTime)) { + j++; + } + }); + while (j < ersTime.length) { + innerMarks.push(ersTime[j++]); + } + innerMarks = innerMarks.sort((erA, erB) => erA.start < erB.start ? -1 : erA.start === erB.start ? 0 : 1); + let idx = 0; + while (idx < innerMarks.length - 1) { + let currentMark = innerMarks[idx]; + let nextMark = innerMarks[idx + 1]; + if (currentMark.type === constants$2.Constants.SYS_DATETIME_TIME && nextMark.type === constants$2.Constants.SYS_DATETIME_TIME) { + idx++; + continue; + } + let middleBegin = currentMark.start + currentMark.length; + let middleEnd = nextMark.start; + let middleStr = source.substr(middleBegin, middleEnd - middleBegin).trim().toLowerCase(); + let matches = recognizersText.RegExpUtility.getMatches(this.config.tillRegex, middleStr); + if (matches && matches.length > 0 && matches[0].index === 0 && matches[0].length === middleStr.length) { + let periodBegin = currentMark.start; + let periodEnd = nextMark.start + nextMark.length; + let beforeStr = source.substr(0, periodBegin).trim().toLowerCase(); + let matchFrom = this.config.getFromTokenIndex(beforeStr); + let fromTokenIndex = matchFrom.matched ? matchFrom : this.config.getBetweenTokenIndex(beforeStr); + if (fromTokenIndex.matched) { + periodBegin = fromTokenIndex.index; + } + tokens.push(new utilities$2.Token(periodBegin, periodEnd)); + idx += 2; + continue; + } + if (this.config.hasConnectorToken(middleStr)) { + let periodBegin = currentMark.start; + let periodEnd = nextMark.start + nextMark.length; + let beforeStr = source.substr(0, periodBegin).trim().toLowerCase(); + let betweenTokenIndex = this.config.getBetweenTokenIndex(beforeStr); + if (betweenTokenIndex.matched) { + periodBegin = betweenTokenIndex.index; + tokens.push(new utilities$2.Token(periodBegin, periodEnd)); + idx += 2; + continue; + } + } + idx++; + } + + return tokens; + } + matchDuration(source, refDate) { + let tokens = new Array(); + let durations = new Array(); + this.config.durationExtractor.extract(source, refDate).forEach(duration => { + let match = recognizersText.RegExpUtility.getMatches(this.config.timeUnitRegex, duration.text).pop(); + if (match) { + durations.push(new utilities$2.Token(duration.start, duration.start + duration.length)); + } + }); + durations.forEach(duration => { + let beforeStr = source.substr(0, duration.start).toLowerCase(); + if (recognizersText.StringUtility.isNullOrWhitespace(beforeStr)) + return; + let match = recognizersText.RegExpUtility.getMatches(this.config.pastPrefixRegex, beforeStr).pop(); + if (match && recognizersText.StringUtility.isNullOrWhitespace(beforeStr.substr(match.index + match.length))) { + tokens.push(new utilities$2.Token(match.index, duration.end)); + return; + } + match = recognizersText.RegExpUtility.getMatches(this.config.nextPrefixRegex, beforeStr).pop(); + if (match && recognizersText.StringUtility.isNullOrWhitespace(beforeStr.substr(match.index + match.length))) { + tokens.push(new utilities$2.Token(match.index, duration.end)); + } + }); + return tokens; + } + matchNight(source, refDate) { + let tokens = new Array(); + recognizersText.RegExpUtility.getMatches(this.config.specificTimeOfDayRegex, source).forEach(match => { + tokens.push(new utilities$2.Token(match.index, match.index + match.length)); + }); + this.config.singleDateExtractor.extract(source, refDate).forEach(er => { + let afterStr = source.substr(er.start + er.length); + let match = recognizersText.RegExpUtility.getMatches(this.config.periodTimeOfDayWithDateRegex, afterStr).pop(); + if (match) { + if (recognizersText.StringUtility.isNullOrWhitespace(afterStr.substr(0, match.index))) { + tokens.push(new utilities$2.Token(er.start, er.start + er.length + match.index + match.length)); + } + else { + let pauseMatch = recognizersText.RegExpUtility.getMatches(this.config.middlePauseRegex, afterStr.substr(0, match.index)).pop(); + if (pauseMatch) { + // TODO: should use trimStart() instead? + let suffix = afterStr.substr(match.index + match.length).trim(); + let endingMatch = recognizersText.RegExpUtility.getMatches(this.config.generalEndingRegex, suffix).pop(); + if (endingMatch) { + tokens.push(new utilities$2.Token(er.start || 0, er.start + er.length + match.index + match.length || 0)); + } + } + } + } + let beforeStr = source.substr(0, er.start); + match = recognizersText.RegExpUtility.getMatches(this.config.periodTimeOfDayWithDateRegex, beforeStr).pop(); + if (match) { + if (recognizersText.StringUtility.isNullOrWhitespace(beforeStr.substr(match.index + match.length))) { + let middleStr = source.substr(match.index + match.length, er.start - match.index - match.length); + if (recognizersText.StringUtility.isWhitespace(middleStr)) { + tokens.push(new utilities$2.Token(match.index, er.start + er.length)); + } + } + else { + let pauseMatch = recognizersText.RegExpUtility.getMatches(this.config.middlePauseRegex, beforeStr.substr(match.index + match.length)).pop(); + if (pauseMatch) { + // TODO: should use trimStart() instead? + let suffix = source.substr(er.start + er.length || 0).trim(); + let endingMatch = recognizersText.RegExpUtility.getMatches(this.config.generalEndingRegex, suffix).pop(); + if (endingMatch) { + tokens.push(new utilities$2.Token(match.index, er.start + er.length || 0)); + } + } + } + } + // check whether there are adjacent time period strings, before or after + for (let e of tokens) { + // try to extract a time period in before-string + if (e.start > 0) { + let beforeStr = source.substr(0, e.start); + if (!recognizersText.StringUtility.isNullOrWhitespace(beforeStr)) { + let timeErs = this.config.timePeriodExtractor.extract(beforeStr); + if (timeErs.length > 0) { + for (let tp of timeErs) { + let midStr = beforeStr.substr(tp.start + tp.length || 0); + if (recognizersText.StringUtility.isNullOrWhitespace(midStr)) { + tokens.push(new utilities$2.Token(tp.start || 0, tp.start + tp.length + midStr.length + e.length || 0)); + } + } + } + } + } + // try to extract a time period in after-string + if (e.start + e.length <= source.length) { + let afterStr = source.substr(e.start + e.length); + if (!recognizersText.StringUtility.isNullOrWhitespace(afterStr)) { + let timeErs = this.config.timePeriodExtractor.extract(afterStr); + if (timeErs.length > 0) { + for (let tp of timeErs) { + let midStr = afterStr.substr(0, tp.start || 0); + if (recognizersText.StringUtility.isNullOrWhitespace(midStr)) { + tokens.push(new utilities$2.Token(e.start, e.start + e.length + midStr.length + tp.length || 0)); + } + } + } + } + } + } + }); + return tokens; + } + matchRelativeUnit(source) { + let tokens = new Array(); + let matches = recognizersText.RegExpUtility.getMatches(this.config.relativeTimeUnitRegex, source); + if (matches.length === 0) { + matches = recognizersText.RegExpUtility.getMatches(this.config.restOfDateTimeRegex, source); + } + matches.forEach(match => { + tokens.push(new utilities$2.Token(match.index, match.index + match.length)); + }); + return tokens; + } +} +exports.BaseDateTimePeriodExtractor = BaseDateTimePeriodExtractor; +class BaseDateTimePeriodParser { + constructor(config) { + this.parserName = constants$2.Constants.SYS_DATETIME_DATETIMEPERIOD; + this.config = config; + } + parse(extractorResult, referenceDate) { + if (!referenceDate) + referenceDate = new Date(); + let resultValue; + if (extractorResult.type === this.parserName) { + let source = extractorResult.text.trim().toLowerCase(); + let innerResult = this.mergeDateAndTimePeriods(source, referenceDate); + if (!innerResult.success) { + innerResult = this.mergeTwoTimePoints(source, referenceDate); + } + if (!innerResult.success) { + innerResult = this.parseSpecificTimeOfDay(source, referenceDate); + } + if (!innerResult.success) { + innerResult = this.parseDuration(source, referenceDate); + } + if (!innerResult.success) { + innerResult = this.parseRelativeUnit(source, referenceDate); + } + if (innerResult.success) { + innerResult.futureResolution = {}; + innerResult.futureResolution[constants$2.TimeTypeConstants.START_DATETIME] = utilities$2.FormatUtil.formatDateTime(innerResult.futureValue[0]); + innerResult.futureResolution[constants$2.TimeTypeConstants.END_DATETIME] = utilities$2.FormatUtil.formatDateTime(innerResult.futureValue[1]); + innerResult.pastResolution = {}; + innerResult.pastResolution[constants$2.TimeTypeConstants.START_DATETIME] = utilities$2.FormatUtil.formatDateTime(innerResult.pastValue[0]); + innerResult.pastResolution[constants$2.TimeTypeConstants.END_DATETIME] = utilities$2.FormatUtil.formatDateTime(innerResult.pastValue[1]); + resultValue = innerResult; + } + } + let result = new parsers$4.DateTimeParseResult(extractorResult); + result.value = resultValue; + result.timexStr = resultValue ? resultValue.timex : ''; + result.resolutionStr = ''; + return result; + } + mergeDateAndTimePeriods(text, referenceTime) { + let ret = new utilities$2.DateTimeResolutionResult(); + let trimedText = text.trim().toLowerCase(); + let er = this.config.timePeriodExtractor.extract(trimedText, referenceTime); + if (er.length !== 1) { + return this.parseSimpleCases(text, referenceTime); + } + let timePeriodParseResult = this.config.timePeriodParser.parse(er[0]); + let timePeriodResolutionResult = timePeriodParseResult.value; + if (!timePeriodResolutionResult) { + return this.parseSimpleCases(text, referenceTime); + } + let timePeriodTimex = timePeriodResolutionResult.timex; + // if it is a range type timex + if (!recognizersText.StringUtility.isNullOrEmpty(timePeriodTimex) + && timePeriodTimex.startsWith("(")) { + let dateResult = this.config.dateExtractor.extract(trimedText.replace(er[0].text, ""), referenceTime); + let dateStr = ""; + let futureTime; + let pastTime; + if (dateResult.length === 1 && trimedText.replace(er[0].text, "").trim() === dateResult[0].text) { + let pr = this.config.dateParser.parse(dateResult[0], referenceTime); + if (pr.value) { + futureTime = pr.value.futureValue; + pastTime = pr.value.pastValue; + dateStr = pr.timexStr; + } + else { + return this.parseSimpleCases(text, referenceTime); + } + timePeriodTimex = timePeriodTimex.replace("(", "").replace(")", ""); + let timePeriodTimexArray = timePeriodTimex.split(','); + let timePeriodFutureValue = timePeriodResolutionResult.futureValue; + let beginTime = timePeriodFutureValue.item1; + let endTime = timePeriodFutureValue.item2; + if (timePeriodTimexArray.length === 3) { + let beginStr = dateStr + timePeriodTimexArray[0]; + let endStr = dateStr + timePeriodTimexArray[1]; + ret.timex = `(${beginStr},${endStr},${timePeriodTimexArray[2]})`; + ret.futureValue = [ + utilities$2.DateUtils.safeCreateFromMinValue(futureTime.getFullYear(), futureTime.getMonth(), futureTime.getDate(), beginTime.getHours(), beginTime.getMinutes(), beginTime.getSeconds()), + utilities$2.DateUtils.safeCreateFromMinValue(futureTime.getFullYear(), futureTime.getMonth(), futureTime.getDate(), endTime.getHours(), endTime.getMinutes(), endTime.getSeconds()) + ]; + ret.pastValue = [ + utilities$2.DateUtils.safeCreateFromMinValue(pastTime.getFullYear(), pastTime.getMonth(), pastTime.getDate(), beginTime.getHours(), beginTime.getMinutes(), beginTime.getSeconds()), + utilities$2.DateUtils.safeCreateFromMinValue(pastTime.getFullYear(), pastTime.getMonth(), pastTime.getDate(), endTime.getHours(), endTime.getMinutes(), endTime.getSeconds()) + ]; + if (!recognizersText.StringUtility.isNullOrEmpty(timePeriodResolutionResult.comment) + && timePeriodResolutionResult.comment === "ampm") { + ret.comment = "ampm"; + } + ret.success = true; + ret.subDateTimeEntities = [pr, timePeriodParseResult]; + return ret; + } + } + else { + return this.parseSimpleCases(text, referenceTime); + } + } + return this.parseSimpleCases(text, referenceTime); + } + parseSimpleCases(source, referenceDate) { + let result = new utilities$2.DateTimeResolutionResult(); + let match = recognizersText.RegExpUtility.getMatches(this.config.pureNumberFromToRegex, source).pop(); + if (!match) { + match = recognizersText.RegExpUtility.getMatches(this.config.pureNumberBetweenAndRegex, source).pop(); + } + if (!match || (match.index !== 0 && match.index + match.length !== source.length)) + return result; + let hourGroup = match.groups('hour'); + let beginHour = this.config.numbers.get(hourGroup.captures[0]) || Number.parseInt(hourGroup.captures[0], 10) || 0; + let endHour = this.config.numbers.get(hourGroup.captures[1]) || Number.parseInt(hourGroup.captures[1], 10) || 0; + let er = this.config.dateExtractor.extract(source.replace(match.value, ""), referenceDate).pop(); + if (!er) + return result; + let pr = this.config.dateParser.parse(er, referenceDate); + if (!pr) + return result; + let dateResult = pr.value; + let futureDate = dateResult.futureValue; + let pastDate = dateResult.pastValue; + let dateStr = pr.timexStr; + let hasAm = false; + let hasPm = false; + let pmStr = match.groups('pm').value; + let amStr = match.groups('am').value; + let descStr = match.groups('desc').value; + if (!recognizersText.StringUtility.isNullOrEmpty(amStr) || descStr.startsWith('a')) { + if (beginHour >= 12) + beginHour -= 12; + if (endHour >= 12) + endHour -= 12; + hasAm = true; + } + if (!recognizersText.StringUtility.isNullOrEmpty(pmStr) || descStr.startsWith('p')) { + if (beginHour < 12) + beginHour += 12; + if (endHour < 12) + endHour += 12; + hasPm = true; + } + if (!hasAm && !hasPm && beginHour <= 12 && endHour <= 12) { + result.comment = "ampm"; + } + let beginStr = `${dateStr}T${utilities$2.FormatUtil.toString(beginHour, 2)}`; + let endStr = `${dateStr}T${utilities$2.FormatUtil.toString(endHour, 2)}`; + result.timex = `(${beginStr},${endStr},PT${endHour - beginHour}H)`; + result.futureValue = [ + utilities$2.DateUtils.safeCreateFromMinValue(futureDate.getFullYear(), futureDate.getMonth(), futureDate.getDate(), beginHour, 0, 0), + utilities$2.DateUtils.safeCreateFromMinValue(futureDate.getFullYear(), futureDate.getMonth(), futureDate.getDate(), endHour, 0, 0) + ]; + result.pastValue = [ + utilities$2.DateUtils.safeCreateFromMinValue(pastDate.getFullYear(), pastDate.getMonth(), pastDate.getDate(), beginHour, 0, 0), + utilities$2.DateUtils.safeCreateFromMinValue(pastDate.getFullYear(), pastDate.getMonth(), pastDate.getDate(), endHour, 0, 0) + ]; + result.success = true; + return result; + } + mergeTwoTimePoints(source, referenceDate) { + let result = new utilities$2.DateTimeResolutionResult(); + let prs; + let timeErs = this.config.timeExtractor.extract(source, referenceDate); + let datetimeErs = this.config.dateTimeExtractor.extract(source, referenceDate); + let bothHasDate = false; + let beginHasDate = false; + let endHasDate = false; + if (datetimeErs.length === 2) { + prs = this.getTwoPoints(datetimeErs[0], datetimeErs[1], this.config.dateTimeParser, this.config.dateTimeParser, referenceDate); + bothHasDate = true; + } + else if (datetimeErs.length === 1 && timeErs.length === 2) { + if (recognizersText.ExtractResult.isOverlap(datetimeErs[0], timeErs[0])) { + prs = this.getTwoPoints(datetimeErs[0], timeErs[1], this.config.dateTimeParser, this.config.timeParser, referenceDate); + beginHasDate = true; + } + else { + prs = this.getTwoPoints(timeErs[0], datetimeErs[0], this.config.timeParser, this.config.dateTimeParser, referenceDate); + endHasDate = true; + } + } + else if (datetimeErs.length === 1 && timeErs.length === 1) { + if (timeErs[0].start < datetimeErs[0].start) { + prs = this.getTwoPoints(timeErs[0], datetimeErs[0], this.config.timeParser, this.config.dateTimeParser, referenceDate); + endHasDate = true; + } + else { + prs = this.getTwoPoints(datetimeErs[0], timeErs[0], this.config.dateTimeParser, this.config.timeParser, referenceDate); + beginHasDate = true; + } + } + if (!prs || !prs.begin.value || !prs.end.value) + return result; + let begin = prs.begin.value; + let end = prs.end.value; + let futureBegin = begin.futureValue; + let futureEnd = end.futureValue; + let pastBegin = begin.pastValue; + let pastEnd = end.pastValue; + if (bothHasDate) { + if (futureBegin > futureEnd) + futureBegin = pastBegin; + if (pastEnd < pastBegin) + pastEnd = futureEnd; + result.timex = `(${prs.begin.timexStr},${prs.end.timexStr},PT${utilities$2.DateUtils.totalHours(futureEnd, futureBegin)}H)`; + } + else if (beginHasDate) { + futureEnd = utilities$2.DateUtils.safeCreateFromMinValue(futureBegin.getFullYear(), futureBegin.getMonth(), futureBegin.getDate(), futureEnd.getHours(), futureEnd.getMinutes(), futureEnd.getSeconds()); + pastEnd = utilities$2.DateUtils.safeCreateFromMinValue(pastBegin.getFullYear(), pastBegin.getMonth(), pastBegin.getDate(), pastEnd.getHours(), pastEnd.getMinutes(), pastEnd.getSeconds()); + let dateStr = prs.begin.timexStr.split('T').pop(); + result.timex = `(${prs.begin.timexStr},${dateStr}${prs.end.timexStr},PT${utilities$2.DateUtils.totalHours(futureEnd, futureBegin)}H)`; + } + else if (endHasDate) { + futureBegin = utilities$2.DateUtils.safeCreateFromMinValue(futureEnd.getFullYear(), futureEnd.getMonth(), futureEnd.getDate(), futureBegin.getHours(), futureBegin.getMinutes(), futureBegin.getSeconds()); + pastBegin = utilities$2.DateUtils.safeCreateFromMinValue(pastEnd.getFullYear(), pastEnd.getMonth(), pastEnd.getDate(), pastBegin.getHours(), pastBegin.getMinutes(), pastBegin.getSeconds()); + let dateStr = prs.end.timexStr.split('T')[0]; + result.timex = `(${dateStr}${prs.begin.timexStr},${prs.end.timexStr},PT${utilities$2.DateUtils.totalHours(futureEnd, futureBegin)}H)`; + } + if (!recognizersText.StringUtility.isNullOrEmpty(begin.comment) && begin.comment.endsWith('ampm') && !recognizersText.StringUtility.isNullOrEmpty(end.comment) && end.comment.endsWith('ampm')) { + result.comment = 'ampm'; + } + result.futureValue = [futureBegin, futureEnd]; + result.pastValue = [pastBegin, pastEnd]; + result.success = true; + result.subDateTimeEntities = [prs.begin, prs.end]; + return result; + } + getTwoPoints(beginEr, endEr, beginParser, endParser, referenceDate) { + let beginPr = beginParser.parse(beginEr, referenceDate); + let endPr = endParser.parse(endEr, referenceDate); + return { begin: beginPr, end: endPr }; + } + parseSpecificTimeOfDay(source, referenceDate) { + let result = new utilities$2.DateTimeResolutionResult(); + let timeText = source; + let hasEarly = false; + let hasLate = false; + let match = recognizersText.RegExpUtility.getMatches(this.config.periodTimeOfDayWithDateRegex, source).pop(); + if (match) { + timeText = match.groups('timeOfDay').value; + if (!recognizersText.StringUtility.isNullOrEmpty(match.groups('early').value)) { + hasEarly = true; + result.comment = 'early'; + } + else if (!recognizersText.StringUtility.isNullOrEmpty(match.groups('late').value)) { + hasLate = true; + result.comment = 'late'; + } + } + let matched = this.config.getMatchedTimeRange(timeText); + if (!matched || !matched.success) + return result; + if (hasEarly) { + matched.endHour = matched.beginHour + 2; + if (matched.endMin === 59) + matched.endMin = 0; + } + else if (hasLate) { + matched.beginHour += 2; + } + match = recognizersText.RegExpUtility.getMatches(this.config.specificTimeOfDayRegex, source).pop(); + if (match && match.index === 0 && match.length === source.length) { + let swift = this.config.getSwiftPrefix(source); + let date = utilities$2.DateUtils.addDays(referenceDate, swift); + result.timex = utilities$2.FormatUtil.formatDate(date) + matched.timeStr; + result.futureValue = [ + utilities$2.DateUtils.safeCreateFromMinValue(date.getFullYear(), date.getMonth(), date.getDate(), matched.beginHour, 0, 0), + utilities$2.DateUtils.safeCreateFromMinValue(date.getFullYear(), date.getMonth(), date.getDate(), matched.endHour, matched.endMin, matched.endMin), + ]; + result.pastValue = [ + utilities$2.DateUtils.safeCreateFromMinValue(date.getFullYear(), date.getMonth(), date.getDate(), matched.beginHour, 0, 0), + utilities$2.DateUtils.safeCreateFromMinValue(date.getFullYear(), date.getMonth(), date.getDate(), matched.endHour, matched.endMin, matched.endMin), + ]; + result.success = true; + return result; + } + match = recognizersText.RegExpUtility.getMatches(this.config.periodTimeOfDayWithDateRegex, source).pop(); + if (!match) + return result; + let beforeStr = source.substr(0, match.index).trim(); + let afterStr = source.substr(match.index + match.length).trim(); + let ers = this.config.dateExtractor.extract(beforeStr, referenceDate); + // eliminate time period, if any + let timePeriodErs = this.config.timePeriodExtractor.extract(beforeStr); + if (timePeriodErs.length > 0) { + beforeStr = beforeStr.slice(timePeriodErs[0].start || 0, timePeriodErs[0].start + timePeriodErs[0].length || 0).trim(); + } + else { + timePeriodErs = this.config.timePeriodExtractor.extract(afterStr); + if (timePeriodErs.length > 0) { + afterStr = afterStr.slice(timePeriodErs[0].start || 0, timePeriodErs[0].start + timePeriodErs[0].length || 0).trim(); + } + } + if (ers.length === 0 || ers[0].length !== beforeStr.length) { + let valid = false; + if (ers.length > 0 && ers[0].start === 0) { + let midStr = beforeStr.substr(ers[0].start + ers[0].length || 0); + if (recognizersText.StringUtility.isNullOrWhitespace(midStr.replace(',', ' '))) { + valid = true; + } + } + if (!valid) { + ers = this.config.dateExtractor.extract(afterStr); + if (ers.length === 0 || ers[0].length !== afterStr.length) { + if (ers.length > 0 && ers[0].start + ers[0].length === afterStr.length) { + let midStr = afterStr.substr(0, ers[0].start || 0); + if (recognizersText.StringUtility.isNullOrWhitespace(midStr.replace(',', ' '))) { + valid = true; + } + } + } + else { + valid = true; + } + if (!valid) { + return result; + } + } + } + let hasSpecificTimePeriod = false; + if (timePeriodErs.length > 0) { + let TimePr = this.config.timePeriodParser.parse(timePeriodErs[0], referenceDate); + if (TimePr != null) { + let periodFuture = TimePr.value.futureValue; + let periodPast = TimePr.value.pastValue; + if (periodFuture === periodPast) { + matched.beginHour = periodFuture.item1.getHours(); + matched.endHour = periodFuture.item2.getHours(); + } + else { + if (periodFuture.item1.Hour >= matched.beginHour || periodFuture.item2.Hour <= matched.endHour) { + matched.beginHour = periodFuture.item1.getHours(); + matched.endHour = periodFuture.item2.getHours(); + } + else { + matched.beginHour = periodPast.item1.getHours(); + matched.endHour = periodPast.item2.getHours(); + } + } + hasSpecificTimePeriod = true; + } + } + let pr = this.config.dateParser.parse(ers[0], referenceDate); + if (!pr) + return result; + let futureDate = pr.value.futureValue; + let pastDate = pr.value.pastValue; + if (!hasSpecificTimePeriod) { + result.timex = pr.timexStr + matched.timeStr; + } + else { + result.timex = `(${pr.timexStr}T${matched.beginHour},${pr.timexStr}T${matched.endHour},PT${matched.endHour - matched.beginHour}H)`; + } + result.futureValue = [ + utilities$2.DateUtils.safeCreateFromMinValue(futureDate.getFullYear(), futureDate.getMonth(), futureDate.getDate(), matched.beginHour, 0, 0), + utilities$2.DateUtils.safeCreateFromMinValue(futureDate.getFullYear(), futureDate.getMonth(), futureDate.getDate(), matched.endHour, matched.endMin, matched.endMin), + ]; + result.pastValue = [ + utilities$2.DateUtils.safeCreateFromMinValue(pastDate.getFullYear(), pastDate.getMonth(), pastDate.getDate(), matched.beginHour, 0, 0), + utilities$2.DateUtils.safeCreateFromMinValue(pastDate.getFullYear(), pastDate.getMonth(), pastDate.getDate(), matched.endHour, matched.endMin, matched.endMin), + ]; + result.success = true; + return result; + } + parseDuration(source, referenceDate) { + let result = new utilities$2.DateTimeResolutionResult(); + // for rest of datetime, it will be handled in next function + let restOfDateTimeMatch = recognizersText.RegExpUtility.getMatches(this.config.restOfDateTimeRegex, source); + if (restOfDateTimeMatch.length) { + return result; + } + let ers = this.config.durationExtractor.extract(source, referenceDate); + if (!ers || ers.length !== 1) + return result; + let pr = this.config.durationParser.parse(ers[0], referenceDate); + if (!pr) + return result; + let beforeStr = source.substr(0, pr.start).trim(); + let durationResult = pr.value; + let swiftSecond = 0; + let mod; + if (Number.isFinite(durationResult.pastValue) && Number.isFinite(durationResult.futureValue)) { + swiftSecond = Math.round(durationResult.futureValue); + } + let beginTime = new Date(referenceDate); + let endTime = new Date(referenceDate); + let prefixMatch = recognizersText.RegExpUtility.getMatches(this.config.pastRegex, beforeStr).pop(); + if (prefixMatch && prefixMatch.length === beforeStr.length) { + mod = constants$2.TimeTypeConstants.beforeMod; + beginTime.setSeconds(referenceDate.getSeconds() - swiftSecond); + } + prefixMatch = recognizersText.RegExpUtility.getMatches(this.config.futureRegex, beforeStr).pop(); + if (prefixMatch && prefixMatch.length === beforeStr.length) { + mod = constants$2.TimeTypeConstants.afterMod; + endTime = new Date(beginTime); + endTime.setSeconds(beginTime.getSeconds() + swiftSecond); + } + let luisDateBegin = utilities$2.FormatUtil.luisDateFromDate(beginTime); + let luisTimeBegin = utilities$2.FormatUtil.luisTimeFromDate(beginTime); + let luisDateEnd = utilities$2.FormatUtil.luisDateFromDate(endTime); + let luisTimeEnd = utilities$2.FormatUtil.luisTimeFromDate(endTime); + result.timex = `(${luisDateBegin}T${luisTimeBegin},${luisDateEnd}T${luisTimeEnd},${durationResult.timex})`; + result.futureValue = [beginTime, endTime]; + result.pastValue = [beginTime, endTime]; + result.success = true; + if (mod) { + pr.value.mod = mod; + } + result.subDateTimeEntities = [pr]; + return result; + } + isFloat(value) { + return Number.isFinite(value) && !Number.isInteger(value); + } + parseRelativeUnit(source, referenceDate) { + let result = new utilities$2.DateTimeResolutionResult(); + let match = recognizersText.RegExpUtility.getMatches(this.config.relativeTimeUnitRegex, source).pop(); + if (!match) { + match = recognizersText.RegExpUtility.getMatches(this.config.restOfDateTimeRegex, source).pop(); + } + if (!match) + return result; + let srcUnit = match.groups('unit').value; + let unitStr = this.config.unitMap.get(srcUnit); + if (!unitStr) + return result; + let swift = 1; + let prefixMatch = recognizersText.RegExpUtility.getMatches(this.config.pastRegex, source).pop(); + if (prefixMatch) + swift = -1; + let beginTime = new Date(referenceDate); + let endTime = new Date(referenceDate); + let ptTimex = ''; + switch (unitStr) { + case 'D': + endTime = utilities$2.DateUtils.safeCreateFromMinValue(beginTime.getFullYear(), beginTime.getMonth(), beginTime.getDate()); + endTime.setDate(endTime.getDate() + 1); + endTime.setSeconds(endTime.getSeconds() - 1); + ptTimex = `PT${utilities$2.DateUtils.totalSeconds(endTime, beginTime)}S`; + break; + case 'H': + beginTime.setHours(beginTime.getHours() + (swift > 0 ? 0 : swift)); + endTime.setHours(endTime.getHours() + (swift > 0 ? swift : 0)); + ptTimex = `PT1H`; + break; + case 'M': + beginTime.setMinutes(beginTime.getMinutes() + (swift > 0 ? 0 : swift)); + endTime.setMinutes(endTime.getMinutes() + (swift > 0 ? swift : 0)); + ptTimex = `PT1M`; + break; + case 'S': + beginTime.setSeconds(beginTime.getSeconds() + (swift > 0 ? 0 : swift)); + endTime.setSeconds(endTime.getSeconds() + (swift > 0 ? swift : 0)); + ptTimex = `PT1S`; + break; + default: return result; + } + let luisDateBegin = utilities$2.FormatUtil.luisDateFromDate(beginTime); + let luisTimeBegin = utilities$2.FormatUtil.luisTimeFromDate(beginTime); + let luisDateEnd = utilities$2.FormatUtil.luisDateFromDate(endTime); + let luisTimeEnd = utilities$2.FormatUtil.luisTimeFromDate(endTime); + result.timex = `(${luisDateBegin}T${luisTimeBegin},${luisDateEnd}T${luisTimeEnd},${ptTimex})`; + result.futureValue = [beginTime, endTime]; + result.pastValue = [beginTime, endTime]; + result.success = true; + return result; + } +} +exports.BaseDateTimePeriodParser = BaseDateTimePeriodParser; + +}); + +unwrapExports(baseDateTimePeriod); + +var baseDuration = createCommonjsModule(function (module, exports) { +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); + + + + +class BaseDurationExtractor { + constructor(config) { + this.extractorName = constants$2.Constants.SYS_DATETIME_DURATION; + this.config = config; + } + extract(source, refDate) { + if (!refDate) + refDate = new Date(); + let baseTokens = this.numberWithUnit(source); + let tokens = new Array() + .concat(baseTokens) + .concat(this.numberWithUnitAndSuffix(source, baseTokens)) + .concat(this.implicitDuration(source)); + let result = utilities$2.Token.mergeAllTokens(tokens, source, this.extractorName); + this.resolveMoreThanOrLessThanPrefix(source, result); + return result; + } + // handle cases look like: {more than | less than} {duration}? + resolveMoreThanOrLessThanPrefix(text, ers) { + for (let er of ers) { + var beforeString = text.substr(0, er.start); + let match = recognizersText.RegExpUtility.getMatches(this.config.moreThanRegex, beforeString); + if (match && match.length) { + er.data = constants$2.TimeTypeConstants.moreThanMod; + } + if (!match || match.length === 0) { + match = recognizersText.RegExpUtility.getMatches(this.config.lessThanRegex, beforeString); + if (match && match.length) { + er.data = constants$2.TimeTypeConstants.lessThanMod; + } + } + if (match && match.length) { + er.length += er.start - match[0].index; + er.start = match[0].index; + er.text = text.substr(er.start, er.length); + } + } + } + numberWithUnit(source) { + return this.config.cardinalExtractor.extract(source) + .map(o => { + let afterString = source.substring(o.start + o.length); + let match = recognizersText.RegExpUtility.getMatches(this.config.followedUnit, afterString)[0]; + if (match && match.index === 0) { + return new utilities$2.Token(o.start | 0, o.start + o.length + match.length); + } + }).filter(o => o !== undefined) + .concat(this.getTokensFromRegex(this.config.numberCombinedWithUnit, source)) + .concat(this.getTokensFromRegex(this.config.anUnitRegex, source)) + .concat(this.getTokensFromRegex(this.config.inexactNumberUnitRegex, source)); + } + numberWithUnitAndSuffix(source, ers) { + return ers.map(o => { + let afterString = source.substring(o.start + o.length); + let match = recognizersText.RegExpUtility.getMatches(this.config.suffixAndRegex, afterString)[0]; + if (match && match.index === 0) { + return new utilities$2.Token(o.start | 0, o.start + o.length + match.length); + } + }); + } + implicitDuration(source) { + // handle "all day", "all year" + return this.getTokensFromRegex(this.config.allRegex, source) + // handle "half day", "half year" + .concat(this.getTokensFromRegex(this.config.halfRegex, source)) + // handle "next day", "last year" + .concat(this.getTokensFromRegex(this.config.relativeDurationUnitRegex, source)); + } + getTokensFromRegex(regexp, source) { + return recognizersText.RegExpUtility.getMatches(regexp, source) + .map(o => new utilities$2.Token(o.index, o.index + o.length)); + } +} +exports.BaseDurationExtractor = BaseDurationExtractor; +class BaseDurationParser { + constructor(config) { + this.parserName = constants$2.Constants.SYS_DATETIME_DURATION; + this.config = config; + } + parse(extractorResult, referenceDate) { + if (!referenceDate) + referenceDate = new Date(); + let resultValue; + if (extractorResult.type === this.parserName) { + let source = extractorResult.text.toLowerCase(); + let innerResult = this.parseNumberWithUnit(source, referenceDate); + if (!innerResult.success) { + innerResult = this.parseImplicitDuration(source, referenceDate); + } + if (innerResult.success) { + innerResult.futureResolution = {}; + innerResult.futureResolution[constants$2.TimeTypeConstants.DURATION] = innerResult.futureValue.toString(); + innerResult.pastResolution = {}; + innerResult.pastResolution[constants$2.TimeTypeConstants.DURATION] = innerResult.pastValue.toString(); + resultValue = innerResult; + } + } + var value = resultValue; + if (value && extractorResult.data) { + if (extractorResult.data === constants$2.TimeTypeConstants.moreThanMod || + extractorResult.data === constants$2.TimeTypeConstants.lessThanMod) { + value.mod = extractorResult.data; + } + } + let result = new parsers$4.DateTimeParseResult(extractorResult); + result.value = resultValue; + result.timexStr = resultValue ? resultValue.timex : ''; + result.resolutionStr = ''; + return result; + } + parseNumberWithUnit(source, referenceDate) { + let trimmedSource = source.trim(); + let result = this.parseNumberSpaceUnit(trimmedSource); + if (!result.success) { + result = this.parseNumberCombinedUnit(trimmedSource); + } + if (!result.success) { + result = this.parseAnUnit(trimmedSource); + } + if (!result.success) { + result = this.parseInexactNumberUnit(trimmedSource); + } + return result; + } + parseImplicitDuration(source, referenceDate) { + let trimmedSource = source.trim(); + // handle "all day" "all year" + let result = this.getResultFromRegex(this.config.allDateUnitRegex, trimmedSource, 1); + // handle "half day", "half year" + if (!result.success) { + result = this.getResultFromRegex(this.config.halfDateUnitRegex, trimmedSource, 0.5); + } + // handle single duration unit, it is filtered in the extraction that there is a relative word in advance + if (!result.success) { + result = this.getResultFromRegex(this.config.followedUnit, trimmedSource, 1); + } + return result; + } + getResultFromRegex(regex, source, num) { + let result = new utilities$2.DateTimeResolutionResult(); + let match = recognizersText.RegExpUtility.getMatches(regex, source).pop(); + if (!match) + return result; + let sourceUnit = match.groups('unit').value; + if (!this.config.unitMap.has(sourceUnit)) + return result; + let unitStr = this.config.unitMap.get(sourceUnit); + result.timex = `P${this.isLessThanDay(unitStr) ? 'T' : ''}${num}${unitStr[0]}`; + result.futureValue = num * this.config.unitValueMap.get(sourceUnit); + result.pastValue = result.futureValue; + result.success = true; + return result; + } + parseNumberSpaceUnit(source) { + let result = new utilities$2.DateTimeResolutionResult(); + let suffixStr = source; + let ers = this.config.cardinalExtractor.extract(source); + if (ers && ers.length === 1) { + let er = ers[0]; + let sourceUnit = ''; + let pr = this.config.numberParser.parse(er); + let noNumStr = source.substr(er.start + er.length).trim().toLowerCase(); + let match = recognizersText.RegExpUtility.getMatches(this.config.followedUnit, noNumStr).pop(); + if (match) { + sourceUnit = match.groups('unit').value; + suffixStr = match.groups('suffix').value; + } + if (this.config.unitMap.has(sourceUnit)) { + let num = Number.parseFloat(pr.value) + this.parseNumberWithUnitAndSuffix(suffixStr); + let unitStr = this.config.unitMap.get(sourceUnit); + result.timex = `P${this.isLessThanDay(unitStr) ? 'T' : ''}${num}${unitStr[0]}`; + result.futureValue = num * this.config.unitValueMap.get(sourceUnit); + result.pastValue = result.futureValue; + result.success = true; + return result; + } + } + return result; + } + parseNumberWithUnitAndSuffix(source) { + let match = recognizersText.RegExpUtility.getMatches(this.config.suffixAndRegex, source).pop(); + if (match) { + let numStr = match.groups('suffix_num').value; + if (this.config.doubleNumbers.has(numStr)) { + return this.config.doubleNumbers.get(numStr); + } + } + return 0; + } + parseNumberCombinedUnit(source) { + let result = new utilities$2.DateTimeResolutionResult(); + let match = recognizersText.RegExpUtility.getMatches(this.config.numberCombinedWithUnit, source).pop(); + if (!match) + return result; + let num = Number.parseFloat(match.groups('num').value) + this.parseNumberWithUnitAndSuffix(source); + let sourceUnit = match.groups('unit').value; + if (this.config.unitMap.has(sourceUnit)) { + let unitStr = this.config.unitMap.get(sourceUnit); + if (num > 1000 && (unitStr === 'Y' || unitStr === 'MON' || unitStr === 'W')) { + return result; + } + result.timex = `P${this.isLessThanDay(unitStr) ? 'T' : ''}${num}${unitStr[0]}`; + result.futureValue = num * this.config.unitValueMap.get(sourceUnit); + result.pastValue = result.futureValue; + result.success = true; + return result; + } + return result; + } + parseAnUnit(source) { + let result = new utilities$2.DateTimeResolutionResult(); + let match = recognizersText.RegExpUtility.getMatches(this.config.anUnitRegex, source).pop(); + if (!match) { + match = recognizersText.RegExpUtility.getMatches(this.config.halfDateUnitRegex, source).pop(); + } + if (!match) + return result; + let num = recognizersText.StringUtility.isNullOrEmpty(match.groups('half').value) ? 1 : 0.5; + num += this.parseNumberWithUnitAndSuffix(source); + let sourceUnit = match.groups('unit').value; + if (this.config.unitMap.has(sourceUnit)) { + let unitStr = this.config.unitMap.get(sourceUnit); + result.timex = `P${this.isLessThanDay(unitStr) ? 'T' : ''}${num}${unitStr[0]}`; + result.futureValue = num * this.config.unitValueMap.get(sourceUnit); + result.pastValue = result.futureValue; + result.success = true; + return result; + } + return result; + } + parseInexactNumberUnit(source) { + let result = new utilities$2.DateTimeResolutionResult(); + let match = recognizersText.RegExpUtility.getMatches(this.config.inexactNumberUnitRegex, source).pop(); + if (!match) + return result; + let num; + if (match.groups('NumTwoTerm').value) { + num = 2; + } + else { + // set the inexact number "few", "some" to 3 for now + num = 3; + } + let sourceUnit = match.groups('unit').value; + if (this.config.unitMap.has(sourceUnit)) { + let unitStr = this.config.unitMap.get(sourceUnit); + if (num > 1000 && (unitStr === 'Y' || unitStr === 'MON' || unitStr === 'W')) { + return result; + } + result.timex = `P${this.isLessThanDay(unitStr) ? 'T' : ''}${num}${unitStr[0]}`; + result.futureValue = num * this.config.unitValueMap.get(sourceUnit); + result.pastValue = result.futureValue; + result.success = true; + return result; + } + return result; + } + isLessThanDay(source) { + return (source === 'S') || (source === 'M') || (source === 'H'); + } +} +exports.BaseDurationParser = BaseDurationParser; + +}); + +unwrapExports(baseDuration); + +var durationConfiguration = createCommonjsModule(function (module, exports) { +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); + + + +class EnglishDurationExtractorConfiguration { + constructor() { + this.allRegex = recognizersText.RegExpUtility.getSafeRegExp(englishDateTime.EnglishDateTime.AllRegex); + this.halfRegex = recognizersText.RegExpUtility.getSafeRegExp(englishDateTime.EnglishDateTime.HalfRegex); + this.followedUnit = recognizersText.RegExpUtility.getSafeRegExp(englishDateTime.EnglishDateTime.DurationFollowedUnit); + this.numberCombinedWithUnit = recognizersText.RegExpUtility.getSafeRegExp(englishDateTime.EnglishDateTime.NumberCombinedWithDurationUnit); + this.anUnitRegex = recognizersText.RegExpUtility.getSafeRegExp(englishDateTime.EnglishDateTime.AnUnitRegex); + this.inexactNumberUnitRegex = recognizersText.RegExpUtility.getSafeRegExp(englishDateTime.EnglishDateTime.InexactNumberUnitRegex); + this.suffixAndRegex = recognizersText.RegExpUtility.getSafeRegExp(englishDateTime.EnglishDateTime.SuffixAndRegex); + this.relativeDurationUnitRegex = recognizersText.RegExpUtility.getSafeRegExp(englishDateTime.EnglishDateTime.RelativeDurationUnitRegex); + this.moreThanRegex = recognizersText.RegExpUtility.getSafeRegExp(englishDateTime.EnglishDateTime.MoreThanRegex); + this.lessThanRegex = recognizersText.RegExpUtility.getSafeRegExp(englishDateTime.EnglishDateTime.LessThanRegex); + this.cardinalExtractor = new recognizersTextNumber.EnglishCardinalExtractor(); + } +} +exports.EnglishDurationExtractorConfiguration = EnglishDurationExtractorConfiguration; +class EnglishDurationParserConfiguration { + constructor(config) { + this.cardinalExtractor = config.cardinalExtractor; + this.numberParser = config.numberParser; + this.followedUnit = recognizersText.RegExpUtility.getSafeRegExp(englishDateTime.EnglishDateTime.DurationFollowedUnit); + this.suffixAndRegex = recognizersText.RegExpUtility.getSafeRegExp(englishDateTime.EnglishDateTime.SuffixAndRegex); + this.numberCombinedWithUnit = recognizersText.RegExpUtility.getSafeRegExp(englishDateTime.EnglishDateTime.NumberCombinedWithDurationUnit); + this.anUnitRegex = recognizersText.RegExpUtility.getSafeRegExp(englishDateTime.EnglishDateTime.AnUnitRegex); + this.allDateUnitRegex = recognizersText.RegExpUtility.getSafeRegExp(englishDateTime.EnglishDateTime.AllRegex); + this.halfDateUnitRegex = recognizersText.RegExpUtility.getSafeRegExp(englishDateTime.EnglishDateTime.HalfRegex); + this.inexactNumberUnitRegex = recognizersText.RegExpUtility.getSafeRegExp(englishDateTime.EnglishDateTime.InexactNumberUnitRegex); + this.unitMap = config.unitMap; + this.unitValueMap = config.unitValueMap; + this.doubleNumbers = config.doubleNumbers; + } +} +exports.EnglishDurationParserConfiguration = EnglishDurationParserConfiguration; + +}); + +unwrapExports(durationConfiguration); + +var timeConfiguration = createCommonjsModule(function (module, exports) { +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); + + +class EnglishTimeExtractorConfiguration { + constructor() { + this.timeRegexList = EnglishTimeExtractorConfiguration.timeRegexList; + this.atRegex = EnglishTimeExtractorConfiguration.atRegex; + this.ishRegex = EnglishTimeExtractorConfiguration.ishRegex; + } +} +EnglishTimeExtractorConfiguration.timeRegexList = [ + // (three min past)? seven|7|(seven thirty) pm + recognizersText.RegExpUtility.getSafeRegExp(englishDateTime.EnglishDateTime.TimeRegex1, "gis"), + // (three min past)? 3:00(:00)? (pm)? + recognizersText.RegExpUtility.getSafeRegExp(englishDateTime.EnglishDateTime.TimeRegex2, "gis"), + // (three min past)? 3.00 (pm) + recognizersText.RegExpUtility.getSafeRegExp(englishDateTime.EnglishDateTime.TimeRegex3, "gis"), + // (three min past) (five thirty|seven|7|7:00(:00)?) (pm)? (in the night) + recognizersText.RegExpUtility.getSafeRegExp(englishDateTime.EnglishDateTime.TimeRegex4, "gis"), + // (three min past) (five thirty|seven|7|7:00(:00)?) (pm)? + recognizersText.RegExpUtility.getSafeRegExp(englishDateTime.EnglishDateTime.TimeRegex5, "gis"), + // (five thirty|seven|7|7:00(:00)?) (pm)? (in the night) + recognizersText.RegExpUtility.getSafeRegExp(englishDateTime.EnglishDateTime.TimeRegex6, "gis"), + // (in the night) at (five thirty|seven|7|7:00(:00)?) (pm)? + recognizersText.RegExpUtility.getSafeRegExp(englishDateTime.EnglishDateTime.TimeRegex7, "gis"), + // (in the night) (five thirty|seven|7|7:00(:00)?) (pm)? + recognizersText.RegExpUtility.getSafeRegExp(englishDateTime.EnglishDateTime.TimeRegex8, "gis"), + recognizersText.RegExpUtility.getSafeRegExp(englishDateTime.EnglishDateTime.TimeRegex9, "gis"), + // (three min past)? 3h00 (pm)? + recognizersText.RegExpUtility.getSafeRegExp(englishDateTime.EnglishDateTime.TimeRegex10, "gis"), + // at 2.30, before 6.30pm. 'at' prefix or 'am/pm' suffix is required here + recognizersText.RegExpUtility.getSafeRegExp(englishDateTime.EnglishDateTime.TimeRegex11, "gis"), + // 340pm + recognizersText.RegExpUtility.getSafeRegExp(englishDateTime.EnglishDateTime.ConnectNumRegex, "gis") +]; +EnglishTimeExtractorConfiguration.atRegex = recognizersText.RegExpUtility.getSafeRegExp(englishDateTime.EnglishDateTime.AtRegex, "gis"); +EnglishTimeExtractorConfiguration.lessThanOneHour = recognizersText.RegExpUtility.getSafeRegExp(englishDateTime.EnglishDateTime.LessThanOneHour, "gis"); +EnglishTimeExtractorConfiguration.timeSuffix = recognizersText.RegExpUtility.getSafeRegExp(englishDateTime.EnglishDateTime.TimeSuffix, "gis"); +EnglishTimeExtractorConfiguration.timeSuffixFull = recognizersText.RegExpUtility.getSafeRegExp(englishDateTime.EnglishDateTime.TimeSuffixFull, "gis"); +EnglishTimeExtractorConfiguration.ishRegex = recognizersText.RegExpUtility.getSafeRegExp(englishDateTime.EnglishDateTime.IshRegex, "gis"); +exports.EnglishTimeExtractorConfiguration = EnglishTimeExtractorConfiguration; +class EnglishTimeParserConfiguration { + constructor(config) { + this.timeTokenPrefix = englishDateTime.EnglishDateTime.TimeTokenPrefix; + this.atRegex = EnglishTimeExtractorConfiguration.atRegex; + this.timeRegexes = EnglishTimeExtractorConfiguration.timeRegexList; + this.numbers = config.numbers; + this.lunchRegex = recognizersText.RegExpUtility.getSafeRegExp(englishDateTime.EnglishDateTime.LunchRegex); + this.timeSuffixFull = recognizersText.RegExpUtility.getSafeRegExp(englishDateTime.EnglishDateTime.TimeSuffixFull); + this.nightRegex = recognizersText.RegExpUtility.getSafeRegExp(englishDateTime.EnglishDateTime.NightRegex); + this.utilityConfiguration = config.utilityConfiguration; + } + adjustByPrefix(prefix, adjust) { + let deltaMin = 0; + let trimmedPrefix = prefix.trim().toLowerCase(); + if (trimmedPrefix.startsWith("half")) { + deltaMin = 30; + } + else if (trimmedPrefix.startsWith("a quarter") || trimmedPrefix.startsWith("quarter")) { + deltaMin = 15; + } + else if (trimmedPrefix.startsWith("three quarter")) { + deltaMin = 45; + } + else { + let match = recognizersText.RegExpUtility.getMatches(EnglishTimeExtractorConfiguration.lessThanOneHour, trimmedPrefix); + let minStr = match[0].groups("deltamin").value; + if (minStr) { + deltaMin = Number.parseInt(minStr, 10); + } + else { + minStr = match[0].groups("deltaminnum").value.toLowerCase(); + deltaMin = this.numbers.get(minStr); + } + } + if (trimmedPrefix.endsWith("to")) { + deltaMin = -deltaMin; + } + adjust.min += deltaMin; + if (adjust.min < 0) { + adjust.min += 60; + adjust.hour -= 1; + } + adjust.hasMin = true; + } + adjustBySuffix(suffix, adjust) { + let trimmedSuffix = suffix.trim().toLowerCase(); + let deltaHour = 0; + let matches = recognizersText.RegExpUtility.getMatches(EnglishTimeExtractorConfiguration.timeSuffixFull, trimmedSuffix); + if (matches.length > 0 && matches[0].index === 0 && matches[0].length === trimmedSuffix.length) { + let oclockStr = matches[0].groups("oclock").value; + if (!oclockStr) { + let amStr = matches[0].groups("am").value; + if (amStr) { + if (adjust.hour >= 12) { + deltaHour = -12; + } + else { + adjust.hasAm = true; + } + } + let pmStr = matches[0].groups("pm").value; + if (pmStr) { + if (adjust.hour < 12) { + deltaHour = 12; + } + if (recognizersText.RegExpUtility.getMatches(this.lunchRegex, pmStr).length > 0) { + // for hour>=10, <12 + if (adjust.hour >= 10 && adjust.hour <= 12) { + deltaHour = 0; + if (adjust.hour === 12) { + adjust.hasPm = true; + } + else { + adjust.hasAm = true; + } + } + else { + adjust.hasPm = true; + } + } + else if (recognizersText.RegExpUtility.getMatches(this.nightRegex, pmStr).length > 0) { + // for hour <=3 or === 12, we treat it as am, for example 1 in the night (midnight) === 1am + if (adjust.hour <= 3 || adjust.hour === 12) { + if (adjust.hour === 12) { + adjust.hour = 0; + } + deltaHour = 0; + adjust.hasAm = true; + } + else { + adjust.hasPm = true; + } + } + else { + adjust.hasPm = true; + } + } + } + } + adjust.hour = (adjust.hour + deltaHour) % 24; + } +} +exports.EnglishTimeParserConfiguration = EnglishTimeParserConfiguration; + +}); + +unwrapExports(timeConfiguration); + +var dateConfiguration = createCommonjsModule(function (module, exports) { +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); + + + + + + + +class EnglishDateExtractorConfiguration { + constructor() { + this.dateRegexList = [ + recognizersText.RegExpUtility.getSafeRegExp(englishDateTime.EnglishDateTime.DateExtractor1), + recognizersText.RegExpUtility.getSafeRegExp(englishDateTime.EnglishDateTime.DateExtractor2), + recognizersText.RegExpUtility.getSafeRegExp(englishDateTime.EnglishDateTime.DateExtractor3), + englishDateTime.EnglishDateTime.DefaultLanguageFallback === constants$2.Constants.DefaultLanguageFallback_MDY ? + recognizersText.RegExpUtility.getSafeRegExp(englishDateTime.EnglishDateTime.DateExtractor4) : + recognizersText.RegExpUtility.getSafeRegExp(englishDateTime.EnglishDateTime.DateExtractor5), + englishDateTime.EnglishDateTime.DefaultLanguageFallback === constants$2.Constants.DefaultLanguageFallback_MDY ? + recognizersText.RegExpUtility.getSafeRegExp(englishDateTime.EnglishDateTime.DateExtractor5) : + recognizersText.RegExpUtility.getSafeRegExp(englishDateTime.EnglishDateTime.DateExtractor4), + recognizersText.RegExpUtility.getSafeRegExp(englishDateTime.EnglishDateTime.DateExtractor6), + recognizersText.RegExpUtility.getSafeRegExp(englishDateTime.EnglishDateTime.DateExtractor7), + recognizersText.RegExpUtility.getSafeRegExp(englishDateTime.EnglishDateTime.DateExtractor8), + recognizersText.RegExpUtility.getSafeRegExp(englishDateTime.EnglishDateTime.DateExtractor9), + recognizersText.RegExpUtility.getSafeRegExp(englishDateTime.EnglishDateTime.DateExtractorA), + ]; + this.implicitDateList = [ + recognizersText.RegExpUtility.getSafeRegExp(englishDateTime.EnglishDateTime.OnRegex), + recognizersText.RegExpUtility.getSafeRegExp(englishDateTime.EnglishDateTime.RelaxedOnRegex), + recognizersText.RegExpUtility.getSafeRegExp(englishDateTime.EnglishDateTime.SpecialDayRegex), + recognizersText.RegExpUtility.getSafeRegExp(englishDateTime.EnglishDateTime.SpecialDayWithNumRegex), + recognizersText.RegExpUtility.getSafeRegExp(englishDateTime.EnglishDateTime.ThisRegex), + recognizersText.RegExpUtility.getSafeRegExp(englishDateTime.EnglishDateTime.LastDateRegex), + recognizersText.RegExpUtility.getSafeRegExp(englishDateTime.EnglishDateTime.NextDateRegex), + recognizersText.RegExpUtility.getSafeRegExp(englishDateTime.EnglishDateTime.SingleWeekDayRegex), + recognizersText.RegExpUtility.getSafeRegExp(englishDateTime.EnglishDateTime.WeekDayOfMonthRegex), + recognizersText.RegExpUtility.getSafeRegExp(englishDateTime.EnglishDateTime.SpecialDate), + recognizersText.RegExpUtility.getSafeRegExp(englishDateTime.EnglishDateTime.RelativeWeekDayRegex), + ]; + this.monthEnd = recognizersText.RegExpUtility.getSafeRegExp(englishDateTime.EnglishDateTime.MonthEnd); + this.ofMonth = recognizersText.RegExpUtility.getSafeRegExp(englishDateTime.EnglishDateTime.OfMonth); + this.dateUnitRegex = recognizersText.RegExpUtility.getSafeRegExp(englishDateTime.EnglishDateTime.DateUnitRegex); + this.forTheRegex = recognizersText.RegExpUtility.getSafeRegExp(englishDateTime.EnglishDateTime.ForTheRegex); + this.weekDayAndDayOfMonthRegex = recognizersText.RegExpUtility.getSafeRegExp(englishDateTime.EnglishDateTime.WeekDayAndDayOfMonthRegex); + this.relativeMonthRegex = recognizersText.RegExpUtility.getSafeRegExp(englishDateTime.EnglishDateTime.RelativeMonthRegex); + this.weekDayRegex = recognizersText.RegExpUtility.getSafeRegExp(englishDateTime.EnglishDateTime.WeekDayRegex); + this.dayOfWeek = englishDateTime.EnglishDateTime.DayOfWeek; + this.ordinalExtractor = new recognizersTextNumber.EnglishOrdinalExtractor(); + this.integerExtractor = new recognizersTextNumber.EnglishIntegerExtractor(); + this.numberParser = new recognizersTextNumber.BaseNumberParser(new recognizersTextNumber.EnglishNumberParserConfiguration()); + this.durationExtractor = new baseDuration.BaseDurationExtractor(new durationConfiguration.EnglishDurationExtractorConfiguration()); + this.utilityConfiguration = new baseConfiguration.EnglishDateTimeUtilityConfiguration(); + } +} +exports.EnglishDateExtractorConfiguration = EnglishDateExtractorConfiguration; +class EnglishDateParserConfiguration { + constructor(config) { + this.ordinalExtractor = config.ordinalExtractor; + this.integerExtractor = config.integerExtractor; + this.cardinalExtractor = config.cardinalExtractor; + this.durationExtractor = config.durationExtractor; + this.numberParser = config.numberParser; + this.durationParser = config.durationParser; + this.monthOfYear = config.monthOfYear; + this.dayOfMonth = config.dayOfMonth; + this.dayOfWeek = config.dayOfWeek; + this.unitMap = config.unitMap; + this.cardinalMap = config.cardinalMap; + this.dateRegex = new EnglishDateExtractorConfiguration().dateRegexList; + this.onRegex = recognizersText.RegExpUtility.getSafeRegExp(englishDateTime.EnglishDateTime.OnRegex); + this.specialDayRegex = recognizersText.RegExpUtility.getSafeRegExp(englishDateTime.EnglishDateTime.SpecialDayRegex); + this.specialDayWithNumRegex = recognizersText.RegExpUtility.getSafeRegExp(englishDateTime.EnglishDateTime.SpecialDayWithNumRegex); + this.nextRegex = recognizersText.RegExpUtility.getSafeRegExp(englishDateTime.EnglishDateTime.NextDateRegex); + this.unitRegex = recognizersText.RegExpUtility.getSafeRegExp(englishDateTime.EnglishDateTime.DateUnitRegex); + this.monthRegex = recognizersText.RegExpUtility.getSafeRegExp(englishDateTime.EnglishDateTime.MonthRegex); + this.weekDayRegex = recognizersText.RegExpUtility.getSafeRegExp(englishDateTime.EnglishDateTime.WeekDayRegex); + this.lastRegex = recognizersText.RegExpUtility.getSafeRegExp(englishDateTime.EnglishDateTime.LastDateRegex); + this.thisRegex = recognizersText.RegExpUtility.getSafeRegExp(englishDateTime.EnglishDateTime.ThisRegex); + this.weekDayOfMonthRegex = recognizersText.RegExpUtility.getSafeRegExp(englishDateTime.EnglishDateTime.WeekDayOfMonthRegex); + this.forTheRegex = recognizersText.RegExpUtility.getSafeRegExp(englishDateTime.EnglishDateTime.ForTheRegex); + this.weekDayAndDayOfMonthRegex = recognizersText.RegExpUtility.getSafeRegExp(englishDateTime.EnglishDateTime.WeekDayAndDayOfMonthRegex); + this.relativeMonthRegex = recognizersText.RegExpUtility.getSafeRegExp(englishDateTime.EnglishDateTime.RelativeMonthRegex); + this.relativeWeekDayRegex = recognizersText.RegExpUtility.getSafeRegExp(englishDateTime.EnglishDateTime.RelativeWeekDayRegex); + this.utilityConfiguration = config.utilityConfiguration; + this.dateTokenPrefix = englishDateTime.EnglishDateTime.DateTokenPrefix; + } + getSwiftDay(source) { + let trimmedText = source.trim().toLowerCase(); + let swift = 0; + let matches = recognizersText.RegExpUtility.getMatches(EnglishDateParserConfiguration.relativeDayRegex, source); + if (trimmedText === "today") { + swift = 0; + } + else if (trimmedText === "tomorrow" || trimmedText === "tmr") { + swift = 1; + } + else if (trimmedText === "yesterday") { + swift = -1; + } + else if (trimmedText.endsWith("day after tomorrow") || + trimmedText.endsWith("day after tmr")) { + swift = 2; + } + else if (trimmedText.endsWith("day before yesterday")) { + swift = -2; + } + else if (matches.length) { + swift = this.getSwift(source); + } + return swift; + } + getSwiftMonth(source) { + return this.getSwift(source); + } + getSwift(source) { + let trimmedText = source.trim().toLowerCase(); + let swift = 0; + let nextPrefixMatches = recognizersText.RegExpUtility.getMatches(EnglishDateParserConfiguration.nextPrefixRegex, trimmedText); + let pastPrefixMatches = recognizersText.RegExpUtility.getMatches(EnglishDateParserConfiguration.pastPrefixRegex, trimmedText); + if (nextPrefixMatches.length) { + swift = 1; + } + else if (pastPrefixMatches.length) { + swift = -1; + } + return swift; + } + isCardinalLast(source) { + let trimmedText = source.trim().toLowerCase(); + return trimmedText === "last"; + } +} +// The following three regexes only used in this configuration +// They are not used in the base parser, therefore they are not extracted +// If the spanish date parser need the same regexes, they should be extracted +EnglishDateParserConfiguration.relativeDayRegex = recognizersText.RegExpUtility.getSafeRegExp(englishDateTime.EnglishDateTime.RelativeDayRegex); +EnglishDateParserConfiguration.nextPrefixRegex = recognizersText.RegExpUtility.getSafeRegExp(englishDateTime.EnglishDateTime.NextPrefixRegex); +EnglishDateParserConfiguration.pastPrefixRegex = recognizersText.RegExpUtility.getSafeRegExp(englishDateTime.EnglishDateTime.PastPrefixRegex); +exports.EnglishDateParserConfiguration = EnglishDateParserConfiguration; + +}); + +unwrapExports(dateConfiguration); + +var dateTimeConfiguration = createCommonjsModule(function (module, exports) { +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); + + + + + + + + + +class EnglishDateTimeExtractorConfiguration { + constructor() { + this.datePointExtractor = new baseDate.BaseDateExtractor(new dateConfiguration.EnglishDateExtractorConfiguration()); + this.timePointExtractor = new baseTime.BaseTimeExtractor(new timeConfiguration.EnglishTimeExtractorConfiguration()); + this.durationExtractor = new baseDuration.BaseDurationExtractor(new durationConfiguration.EnglishDurationExtractorConfiguration()); + this.suffixRegex = recognizersText.RegExpUtility.getSafeRegExp(englishDateTime.EnglishDateTime.SuffixRegex); + this.nowRegex = recognizersText.RegExpUtility.getSafeRegExp(englishDateTime.EnglishDateTime.NowRegex); + this.timeOfTodayAfterRegex = recognizersText.RegExpUtility.getSafeRegExp(englishDateTime.EnglishDateTime.TimeOfTodayAfterRegex); + this.simpleTimeOfTodayAfterRegex = recognizersText.RegExpUtility.getSafeRegExp(englishDateTime.EnglishDateTime.SimpleTimeOfTodayAfterRegex); + this.nightRegex = recognizersText.RegExpUtility.getSafeRegExp(englishDateTime.EnglishDateTime.TimeOfDayRegex); + this.timeOfTodayBeforeRegex = recognizersText.RegExpUtility.getSafeRegExp(englishDateTime.EnglishDateTime.TimeOfTodayBeforeRegex); + this.simpleTimeOfTodayBeforeRegex = recognizersText.RegExpUtility.getSafeRegExp(englishDateTime.EnglishDateTime.SimpleTimeOfTodayBeforeRegex); + this.theEndOfRegex = recognizersText.RegExpUtility.getSafeRegExp(englishDateTime.EnglishDateTime.TheEndOfRegex); + this.unitRegex = recognizersText.RegExpUtility.getSafeRegExp(englishDateTime.EnglishDateTime.TimeUnitRegex); + this.prepositionRegex = recognizersText.RegExpUtility.getSafeRegExp(englishDateTime.EnglishDateTime.PrepositionRegex); + this.connectorRegex = recognizersText.RegExpUtility.getSafeRegExp(englishDateTime.EnglishDateTime.ConnectorRegex); + this.utilityConfiguration = new baseConfiguration.EnglishDateTimeUtilityConfiguration(); + } + isConnectorToken(source) { + return (recognizersText.StringUtility.isNullOrWhitespace(source) + || recognizersText.RegExpUtility.getMatches(this.connectorRegex, source).length > 0 + || recognizersText.RegExpUtility.getMatches(this.prepositionRegex, source).length > 0); + } +} +exports.EnglishDateTimeExtractorConfiguration = EnglishDateTimeExtractorConfiguration; +class EnglishDateTimeParserConfiguration { + constructor(config) { + this.tokenBeforeDate = englishDateTime.EnglishDateTime.TokenBeforeDate; + this.tokenBeforeTime = englishDateTime.EnglishDateTime.TokenBeforeTime; + this.dateExtractor = config.dateExtractor; + this.timeExtractor = config.timeExtractor; + this.dateParser = config.dateParser; + this.timeParser = config.timeParser; + this.nowRegex = recognizersText.RegExpUtility.getSafeRegExp(englishDateTime.EnglishDateTime.NowRegex); + this.amTimeRegex = recognizersText.RegExpUtility.getSafeRegExp(englishDateTime.EnglishDateTime.AMTimeRegex); + this.pmTimeRegex = recognizersText.RegExpUtility.getSafeRegExp(englishDateTime.EnglishDateTime.PMTimeRegex); + this.simpleTimeOfTodayAfterRegex = recognizersText.RegExpUtility.getSafeRegExp(englishDateTime.EnglishDateTime.SimpleTimeOfTodayAfterRegex); + this.simpleTimeOfTodayBeforeRegex = recognizersText.RegExpUtility.getSafeRegExp(englishDateTime.EnglishDateTime.SimpleTimeOfTodayBeforeRegex); + this.specificTimeOfDayRegex = recognizersText.RegExpUtility.getSafeRegExp(englishDateTime.EnglishDateTime.SpecificTimeOfDayRegex); + this.theEndOfRegex = recognizersText.RegExpUtility.getSafeRegExp(englishDateTime.EnglishDateTime.TheEndOfRegex); + this.unitRegex = recognizersText.RegExpUtility.getSafeRegExp(englishDateTime.EnglishDateTime.TimeUnitRegex); + this.numbers = config.numbers; + this.cardinalExtractor = config.cardinalExtractor; + this.numberParser = config.numberParser; + this.durationExtractor = config.durationExtractor; + this.durationParser = config.durationParser; + this.unitMap = config.unitMap; + this.utilityConfiguration = config.utilityConfiguration; + } + getHour(text, hour) { + let trimmedText = text.trim().toLowerCase(); + let result = hour; + if (trimmedText.endsWith("morning") && hour >= 12) { + result -= 12; + } + else if (!trimmedText.endsWith("morning") && hour < 12) { + result += 12; + } + return result; + } + getMatchedNowTimex(text) { + let trimmedText = text.trim().toLowerCase(); + let timex; + if (trimmedText.endsWith("now")) { + timex = "PRESENT_REF"; + } + else if (trimmedText === "recently" || trimmedText === "previously") { + timex = "PAST_REF"; + } + else if (trimmedText === "as soon as possible" || trimmedText === "asap") { + timex = "FUTURE_REF"; + } + else { + timex = null; + return { matched: false, timex: timex }; + } + return { matched: true, timex: timex }; + } + getSwiftDay(text) { + let trimmedText = text.trim().toLowerCase(); + let swift = 0; + if (trimmedText.startsWith("next")) { + swift = 1; + } + else if (trimmedText.startsWith("last")) { + swift = -1; + } + return swift; + } + haveAmbiguousToken(text, matchedText) { return false; } +} +exports.EnglishDateTimeParserConfiguration = EnglishDateTimeParserConfiguration; + +}); + +unwrapExports(dateTimeConfiguration); + +var timePeriodConfiguration = createCommonjsModule(function (module, exports) { +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); + + + + + +class EnglishTimePeriodExtractorConfiguration { + constructor() { + this.simpleCasesRegex = [ + recognizersText.RegExpUtility.getSafeRegExp(englishDateTime.EnglishDateTime.PureNumFromTo, "gis"), + recognizersText.RegExpUtility.getSafeRegExp(englishDateTime.EnglishDateTime.PureNumBetweenAnd, "gis") + ]; + this.tillRegex = recognizersText.RegExpUtility.getSafeRegExp(englishDateTime.EnglishDateTime.TillRegex, "gis"); + this.timeOfDayRegex = recognizersText.RegExpUtility.getSafeRegExp(englishDateTime.EnglishDateTime.TimeOfDayRegex, "gis"); + this.generalEndingRegex = recognizersText.RegExpUtility.getSafeRegExp(englishDateTime.EnglishDateTime.GeneralEndingRegex, "gis"); + this.singleTimeExtractor = new baseTime.BaseTimeExtractor(new timeConfiguration.EnglishTimeExtractorConfiguration()); + this.integerExtractor = new recognizersTextNumber.EnglishIntegerExtractor(); + } + getFromTokenIndex(source) { + let index = -1; + if (source.endsWith("from")) { + index = source.lastIndexOf("from"); + return { matched: true, index: index }; + } + return { matched: false, index: index }; + } + getBetweenTokenIndex(source) { + let index = -1; + if (source.endsWith("between")) { + index = source.lastIndexOf("between"); + return { matched: true, index: index }; + } + return { matched: false, index: index }; + } + hasConnectorToken(source) { + return source === "and"; + } +} +exports.EnglishTimePeriodExtractorConfiguration = EnglishTimePeriodExtractorConfiguration; +class EnglishTimePeriodParserConfiguration { + constructor(config) { + this.timeExtractor = config.timeExtractor; + this.timeParser = config.timeParser; + this.integerExtractor = config.integerExtractor; + this.pureNumberFromToRegex = recognizersText.RegExpUtility.getSafeRegExp(englishDateTime.EnglishDateTime.PureNumFromTo); + this.pureNumberBetweenAndRegex = recognizersText.RegExpUtility.getSafeRegExp(englishDateTime.EnglishDateTime.PureNumBetweenAnd); + this.timeOfDayRegex = recognizersText.RegExpUtility.getSafeRegExp(englishDateTime.EnglishDateTime.TimeOfDayRegex); + this.tillRegex = recognizersText.RegExpUtility.getSafeRegExp(englishDateTime.EnglishDateTime.TillRegex, "gis"); + this.numbers = config.numbers; + this.utilityConfiguration = config.utilityConfiguration; + this.specificTimeFromToRegex = recognizersText.RegExpUtility.getSafeRegExp(englishDateTime.EnglishDateTime.SpecificTimeFromTo); + this.specificTimeBetweenAndRegex = recognizersText.RegExpUtility.getSafeRegExp(englishDateTime.EnglishDateTime.SpecificTimeBetweenAnd); + } + getMatchedTimexRange(text) { + let trimmedText = text.trim().toLowerCase(); + if (trimmedText.endsWith("s")) { + trimmedText = trimmedText.substring(0, trimmedText.length - 1); + } + let result = { + matched: false, + timex: '', + beginHour: 0, + endHour: 0, + endMin: 0 + }; + if (trimmedText.endsWith("morning")) { + result.timex = "TMO"; + result.beginHour = 8; + result.endHour = 12; + } + else if (trimmedText.endsWith("afternoon")) { + result.timex = "TAF"; + result.beginHour = 12; + result.endHour = 16; + } + else if (trimmedText.endsWith("evening")) { + result.timex = "TEV"; + result.beginHour = 16; + result.endHour = 20; + } + else if (trimmedText === "daytime") { + result.timex = "TDT"; + result.beginHour = 8; + result.endHour = 18; + } + else if (trimmedText.endsWith("night")) { + result.timex = "TNI"; + result.beginHour = 20; + result.endHour = 23; + result.endMin = 59; + } + else { + result.timex = null; + result.matched = false; + return result; + } + result.matched = true; + return result; + } +} +exports.EnglishTimePeriodParserConfiguration = EnglishTimePeriodParserConfiguration; + +}); + +unwrapExports(timePeriodConfiguration); + +var datePeriodConfiguration = createCommonjsModule(function (module, exports) { +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); + + + + + + + + +class EnglishDatePeriodExtractorConfiguration { + constructor() { + this.simpleCasesRegexes = [ + recognizersText.RegExpUtility.getSafeRegExp(englishDateTime.EnglishDateTime.SimpleCasesRegex), + recognizersText.RegExpUtility.getSafeRegExp(englishDateTime.EnglishDateTime.BetweenRegex), + recognizersText.RegExpUtility.getSafeRegExp(englishDateTime.EnglishDateTime.OneWordPeriodRegex), + recognizersText.RegExpUtility.getSafeRegExp(englishDateTime.EnglishDateTime.MonthWithYear), + recognizersText.RegExpUtility.getSafeRegExp(englishDateTime.EnglishDateTime.MonthNumWithYear), + recognizersText.RegExpUtility.getSafeRegExp(englishDateTime.EnglishDateTime.YearRegex), + recognizersText.RegExpUtility.getSafeRegExp(englishDateTime.EnglishDateTime.WeekOfMonthRegex), + recognizersText.RegExpUtility.getSafeRegExp(englishDateTime.EnglishDateTime.WeekOfYearRegex), + recognizersText.RegExpUtility.getSafeRegExp(englishDateTime.EnglishDateTime.MonthFrontBetweenRegex), + recognizersText.RegExpUtility.getSafeRegExp(englishDateTime.EnglishDateTime.MonthFrontSimpleCasesRegex), + recognizersText.RegExpUtility.getSafeRegExp(englishDateTime.EnglishDateTime.QuarterRegex), + recognizersText.RegExpUtility.getSafeRegExp(englishDateTime.EnglishDateTime.QuarterRegexYearFront), + recognizersText.RegExpUtility.getSafeRegExp(englishDateTime.EnglishDateTime.AllHalfYearRegex), + recognizersText.RegExpUtility.getSafeRegExp(englishDateTime.EnglishDateTime.SeasonRegex), + recognizersText.RegExpUtility.getSafeRegExp(englishDateTime.EnglishDateTime.WhichWeekRegex), + recognizersText.RegExpUtility.getSafeRegExp(englishDateTime.EnglishDateTime.RestOfDateRegex), + recognizersText.RegExpUtility.getSafeRegExp(englishDateTime.EnglishDateTime.LaterEarlyPeriodRegex), + recognizersText.RegExpUtility.getSafeRegExp(englishDateTime.EnglishDateTime.WeekWithWeekDayRangeRegex) + ]; + this.illegalYearRegex = recognizersText.RegExpUtility.getSafeRegExp(baseDateTime.BaseDateTime.IllegalYearRegex); + this.YearRegex = recognizersText.RegExpUtility.getSafeRegExp(englishDateTime.EnglishDateTime.YearRegex); + this.tillRegex = recognizersText.RegExpUtility.getSafeRegExp(englishDateTime.EnglishDateTime.TillRegex); + this.followedUnit = recognizersText.RegExpUtility.getSafeRegExp(englishDateTime.EnglishDateTime.FollowedDateUnit); + this.numberCombinedWithUnit = recognizersText.RegExpUtility.getSafeRegExp(englishDateTime.EnglishDateTime.NumberCombinedWithDateUnit); + this.pastRegex = recognizersText.RegExpUtility.getSafeRegExp(englishDateTime.EnglishDateTime.PastPrefixRegex); + this.futureRegex = recognizersText.RegExpUtility.getSafeRegExp(englishDateTime.EnglishDateTime.NextPrefixRegex); + this.weekOfRegex = recognizersText.RegExpUtility.getSafeRegExp(englishDateTime.EnglishDateTime.WeekOfRegex); + this.monthOfRegex = recognizersText.RegExpUtility.getSafeRegExp(englishDateTime.EnglishDateTime.MonthOfRegex); + this.dateUnitRegex = recognizersText.RegExpUtility.getSafeRegExp(englishDateTime.EnglishDateTime.DateUnitRegex); + this.inConnectorRegex = recognizersText.RegExpUtility.getSafeRegExp(englishDateTime.EnglishDateTime.InConnectorRegex); + this.rangeUnitRegex = recognizersText.RegExpUtility.getSafeRegExp(englishDateTime.EnglishDateTime.RangeUnitRegex); + this.datePointExtractor = new baseDate.BaseDateExtractor(new dateConfiguration.EnglishDateExtractorConfiguration()); + this.integerExtractor = new recognizersTextNumber.EnglishIntegerExtractor(); + this.numberParser = new recognizersTextNumber.BaseNumberParser(new recognizersTextNumber.EnglishNumberParserConfiguration()); + this.durationExtractor = new baseDuration.BaseDurationExtractor(new durationConfiguration.EnglishDurationExtractorConfiguration()); + this.rangeConnectorRegex = recognizersText.RegExpUtility.getSafeRegExp(englishDateTime.EnglishDateTime.RangeConnectorRegex); + } + getFromTokenIndex(source) { + let result = { matched: false, index: -1 }; + if (source.endsWith("from")) { + result.index = source.lastIndexOf("from"); + result.matched = true; + } + return result; + } + ; + getBetweenTokenIndex(source) { + let result = { matched: false, index: -1 }; + if (source.endsWith("between")) { + result.index = source.lastIndexOf("between"); + result.matched = true; + } + return result; + } + ; + hasConnectorToken(source) { + let match = recognizersText.RegExpUtility.getMatches(this.rangeConnectorRegex, source).pop(); + return match && match.length === source.length; + } + ; +} +exports.EnglishDatePeriodExtractorConfiguration = EnglishDatePeriodExtractorConfiguration; +class EnglishDatePeriodParserConfiguration { + constructor(config) { + this.dateExtractor = config.dateExtractor; + this.dateParser = config.dateParser; + this.durationExtractor = config.durationExtractor; + this.durationParser = config.durationParser; + this.monthFrontBetweenRegex = recognizersText.RegExpUtility.getSafeRegExp(englishDateTime.EnglishDateTime.MonthFrontBetweenRegex); + this.betweenRegex = recognizersText.RegExpUtility.getSafeRegExp(englishDateTime.EnglishDateTime.BetweenRegex); + this.monthFrontSimpleCasesRegex = recognizersText.RegExpUtility.getSafeRegExp(englishDateTime.EnglishDateTime.MonthFrontSimpleCasesRegex); + this.simpleCasesRegex = recognizersText.RegExpUtility.getSafeRegExp(englishDateTime.EnglishDateTime.SimpleCasesRegex); + this.oneWordPeriodRegex = recognizersText.RegExpUtility.getSafeRegExp(englishDateTime.EnglishDateTime.OneWordPeriodRegex); + this.monthWithYear = recognizersText.RegExpUtility.getSafeRegExp(englishDateTime.EnglishDateTime.MonthWithYear); + this.monthNumWithYear = recognizersText.RegExpUtility.getSafeRegExp(englishDateTime.EnglishDateTime.MonthNumWithYear); + this.yearRegex = recognizersText.RegExpUtility.getSafeRegExp(englishDateTime.EnglishDateTime.YearRegex); + this.pastRegex = recognizersText.RegExpUtility.getSafeRegExp(englishDateTime.EnglishDateTime.PastPrefixRegex); + this.futureRegex = recognizersText.RegExpUtility.getSafeRegExp(englishDateTime.EnglishDateTime.NextPrefixRegex); + this.inConnectorRegex = config.utilityConfiguration.inConnectorRegex; + this.weekOfMonthRegex = recognizersText.RegExpUtility.getSafeRegExp(englishDateTime.EnglishDateTime.WeekOfMonthRegex); + this.weekOfYearRegex = recognizersText.RegExpUtility.getSafeRegExp(englishDateTime.EnglishDateTime.WeekOfYearRegex); + this.quarterRegex = recognizersText.RegExpUtility.getSafeRegExp(englishDateTime.EnglishDateTime.QuarterRegex); + this.quarterRegexYearFront = recognizersText.RegExpUtility.getSafeRegExp(englishDateTime.EnglishDateTime.QuarterRegexYearFront); + this.allHalfYearRegex = recognizersText.RegExpUtility.getSafeRegExp(englishDateTime.EnglishDateTime.AllHalfYearRegex); + this.seasonRegex = recognizersText.RegExpUtility.getSafeRegExp(englishDateTime.EnglishDateTime.SeasonRegex); + this.weekOfRegex = recognizersText.RegExpUtility.getSafeRegExp(englishDateTime.EnglishDateTime.WeekOfRegex); + this.monthOfRegex = recognizersText.RegExpUtility.getSafeRegExp(englishDateTime.EnglishDateTime.MonthOfRegex); + this.whichWeekRegex = recognizersText.RegExpUtility.getSafeRegExp(englishDateTime.EnglishDateTime.WhichWeekRegex); + this.nextPrefixRegex = recognizersText.RegExpUtility.getSafeRegExp(englishDateTime.EnglishDateTime.NextPrefixRegex); + this.pastPrefixRegex = recognizersText.RegExpUtility.getSafeRegExp(englishDateTime.EnglishDateTime.PastPrefixRegex); + this.thisPrefixRegex = recognizersText.RegExpUtility.getSafeRegExp(englishDateTime.EnglishDateTime.ThisPrefixRegex); + this.restOfDateRegex = recognizersText.RegExpUtility.getSafeRegExp(englishDateTime.EnglishDateTime.RestOfDateRegex); + this.laterEarlyPeriodRegex = recognizersText.RegExpUtility.getSafeRegExp(englishDateTime.EnglishDateTime.LaterEarlyPeriodRegex); + this.weekWithWeekDayRangeRegex = recognizersText.RegExpUtility.getSafeRegExp(englishDateTime.EnglishDateTime.WeekWithWeekDayRangeRegex); + this.tokenBeforeDate = englishDateTime.EnglishDateTime.TokenBeforeDate; + this.dayOfMonth = config.dayOfMonth; + this.monthOfYear = config.monthOfYear; + this.cardinalMap = config.cardinalMap; + this.seasonMap = config.seasonMap; + this.unitMap = config.unitMap; + } + getSwiftDayOrMonth(source) { + let trimmedSource = source.trim().toLowerCase(); + let swift = 0; + if (recognizersText.RegExpUtility.getMatches(this.nextPrefixRegex, trimmedSource).length > 0) { + swift = 1; + } + else if (recognizersText.RegExpUtility.getMatches(this.pastPrefixRegex, trimmedSource).length > 0) { + swift = -1; + } + return swift; + } + getSwiftYear(source) { + let trimmedSource = source.trim().toLowerCase(); + let swift = -10; + if (recognizersText.RegExpUtility.getMatches(this.nextPrefixRegex, trimmedSource).length > 0) { + swift = 1; + } + else if (recognizersText.RegExpUtility.getMatches(this.pastPrefixRegex, trimmedSource).length > 0) { + swift = -1; + } + else if (recognizersText.RegExpUtility.getMatches(this.thisPrefixRegex, trimmedSource).length > 0) { + swift = 0; + } + return swift; + } + isFuture(source) { + let trimmedSource = source.trim().toLowerCase(); + return (trimmedSource.startsWith('this') || trimmedSource.startsWith('next')); + } + isYearToDate(source) { + let trimmedSource = source.trim().toLowerCase(); + return trimmedSource === 'year to date'; + } + isMonthToDate(source) { + let trimmedSource = source.trim().toLowerCase(); + return trimmedSource === 'month to date'; + } + isWeekOnly(source) { + let trimmedSource = source.trim().toLowerCase(); + return trimmedSource.endsWith('week'); + } + isWeekend(source) { + let trimmedSource = source.trim().toLowerCase(); + return trimmedSource.endsWith('weekend'); + } + isMonthOnly(source) { + let trimmedSource = source.trim().toLowerCase(); + return trimmedSource.endsWith('month'); + } + isYearOnly(source) { + let trimmedSource = source.trim().toLowerCase(); + return trimmedSource.endsWith('year'); + } + isLastCardinal(source) { + let trimmedSource = source.trim().toLowerCase(); + return trimmedSource === 'last'; + } +} +exports.EnglishDatePeriodParserConfiguration = EnglishDatePeriodParserConfiguration; + +}); + +unwrapExports(datePeriodConfiguration); + +var dateTimePeriodConfiguration = createCommonjsModule(function (module, exports) { +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); + + + + + + + + + + + + + +class EnglishDateTimePeriodExtractorConfiguration { + constructor() { + this.cardinalExtractor = new recognizersTextNumber.EnglishCardinalExtractor(); + this.singleDateExtractor = new baseDate.BaseDateExtractor(new dateConfiguration.EnglishDateExtractorConfiguration()); + this.singleTimeExtractor = new baseTime.BaseTimeExtractor(new timeConfiguration.EnglishTimeExtractorConfiguration()); + this.singleDateTimeExtractor = new baseDateTime$2.BaseDateTimeExtractor(new dateTimeConfiguration.EnglishDateTimeExtractorConfiguration()); + this.durationExtractor = new baseDuration.BaseDurationExtractor(new durationConfiguration.EnglishDurationExtractorConfiguration()); + this.timePeriodExtractor = new baseTimePeriod.BaseTimePeriodExtractor(new timePeriodConfiguration.EnglishTimePeriodExtractorConfiguration()); + this.simpleCasesRegexes = [ + recognizersText.RegExpUtility.getSafeRegExp(englishDateTime.EnglishDateTime.PureNumFromTo), + recognizersText.RegExpUtility.getSafeRegExp(englishDateTime.EnglishDateTime.PureNumBetweenAnd), + ]; + this.prepositionRegex = recognizersText.RegExpUtility.getSafeRegExp(englishDateTime.EnglishDateTime.PrepositionRegex); + this.tillRegex = recognizersText.RegExpUtility.getSafeRegExp(englishDateTime.EnglishDateTime.TillRegex); + this.specificTimeOfDayRegex = recognizersText.RegExpUtility.getSafeRegExp(englishDateTime.EnglishDateTime.PeriodSpecificTimeOfDayRegex); + this.timeOfDayRegex = recognizersText.RegExpUtility.getSafeRegExp(englishDateTime.EnglishDateTime.PeriodTimeOfDayRegex); + this.periodTimeOfDayWithDateRegex = recognizersText.RegExpUtility.getSafeRegExp(englishDateTime.EnglishDateTime.PeriodTimeOfDayWithDateRegex); + this.followedUnit = recognizersText.RegExpUtility.getSafeRegExp(englishDateTime.EnglishDateTime.TimeFollowedUnit); + this.numberCombinedWithUnit = recognizersText.RegExpUtility.getSafeRegExp(englishDateTime.EnglishDateTime.TimeNumberCombinedWithUnit); + this.timeUnitRegex = recognizersText.RegExpUtility.getSafeRegExp(englishDateTime.EnglishDateTime.TimeUnitRegex); + this.pastPrefixRegex = recognizersText.RegExpUtility.getSafeRegExp(englishDateTime.EnglishDateTime.PastPrefixRegex); + this.nextPrefixRegex = recognizersText.RegExpUtility.getSafeRegExp(englishDateTime.EnglishDateTime.NextPrefixRegex); + this.rangeConnectorRegex = recognizersText.RegExpUtility.getSafeRegExp(englishDateTime.EnglishDateTime.RangeConnectorRegex); + this.relativeTimeUnitRegex = recognizersText.RegExpUtility.getSafeRegExp(englishDateTime.EnglishDateTime.RelativeTimeUnitRegex); + this.restOfDateTimeRegex = recognizersText.RegExpUtility.getSafeRegExp(englishDateTime.EnglishDateTime.RestOfDateTimeRegex); + this.generalEndingRegex = recognizersText.RegExpUtility.getSafeRegExp(englishDateTime.EnglishDateTime.GeneralEndingRegex); + this.middlePauseRegex = recognizersText.RegExpUtility.getSafeRegExp(englishDateTime.EnglishDateTime.MiddlePauseRegex); + } + getFromTokenIndex(source) { + let result = { matched: false, index: -1 }; + if (source.endsWith("from")) { + result.index = source.lastIndexOf("from"); + result.matched = true; + } + return result; + } + ; + getBetweenTokenIndex(source) { + let result = { matched: false, index: -1 }; + if (source.endsWith("between")) { + result.index = source.lastIndexOf("between"); + result.matched = true; + } + return result; + } + ; + hasConnectorToken(source) { + return recognizersText.RegExpUtility.getMatches(this.rangeConnectorRegex, source).length > 0; + } + ; +} +exports.EnglishDateTimePeriodExtractorConfiguration = EnglishDateTimePeriodExtractorConfiguration; +class EnglishDateTimePeriodParserConfiguration { + constructor(config) { + this.pureNumberFromToRegex = recognizersText.RegExpUtility.getSafeRegExp(englishDateTime.EnglishDateTime.PureNumFromTo); + this.pureNumberBetweenAndRegex = recognizersText.RegExpUtility.getSafeRegExp(englishDateTime.EnglishDateTime.PureNumBetweenAnd); + this.periodTimeOfDayWithDateRegex = recognizersText.RegExpUtility.getSafeRegExp(englishDateTime.EnglishDateTime.PeriodTimeOfDayWithDateRegex); + this.specificTimeOfDayRegex = recognizersText.RegExpUtility.getSafeRegExp(englishDateTime.EnglishDateTime.SpecificTimeOfDayRegex); + this.pastRegex = recognizersText.RegExpUtility.getSafeRegExp(englishDateTime.EnglishDateTime.PastPrefixRegex); + this.futureRegex = recognizersText.RegExpUtility.getSafeRegExp(englishDateTime.EnglishDateTime.NextPrefixRegex); + this.relativeTimeUnitRegex = recognizersText.RegExpUtility.getSafeRegExp(englishDateTime.EnglishDateTime.RelativeTimeUnitRegex); + this.numbers = config.numbers; + this.unitMap = config.unitMap; + this.dateExtractor = config.dateExtractor; + this.timePeriodExtractor = config.timePeriodExtractor; + this.timeExtractor = config.timeExtractor; + this.dateTimeExtractor = config.dateTimeExtractor; + this.durationExtractor = config.durationExtractor; + this.dateParser = config.dateParser; + this.timeParser = config.timeParser; + this.dateTimeParser = config.dateTimeParser; + this.timePeriodParser = config.timePeriodParser; + this.durationParser = config.durationParser; + this.morningStartEndRegex = recognizersText.RegExpUtility.getSafeRegExp(englishDateTime.EnglishDateTime.MorningStartEndRegex); + this.afternoonStartEndRegex = recognizersText.RegExpUtility.getSafeRegExp(englishDateTime.EnglishDateTime.AfternoonStartEndRegex); + this.eveningStartEndRegex = recognizersText.RegExpUtility.getSafeRegExp(englishDateTime.EnglishDateTime.EveningStartEndRegex); + this.nightStartEndRegex = recognizersText.RegExpUtility.getSafeRegExp(englishDateTime.EnglishDateTime.NightStartEndRegex); + this.restOfDateTimeRegex = recognizersText.RegExpUtility.getSafeRegExp(englishDateTime.EnglishDateTime.RestOfDateTimeRegex); + } + getMatchedTimeRange(source) { + let timeStr; + let beginHour = 0; + let endHour = 0; + let endMin = 0; + let success = false; + if (recognizersText.RegExpUtility.getMatches(this.morningStartEndRegex, source).length > 0) { + timeStr = 'TMO'; + beginHour = 8; + endHour = 12; + success = true; + } + else if (recognizersText.RegExpUtility.getMatches(this.afternoonStartEndRegex, source).length > 0) { + timeStr = 'TAF'; + beginHour = 12; + endHour = 16; + success = true; + } + else if (recognizersText.RegExpUtility.getMatches(this.eveningStartEndRegex, source).length > 0) { + timeStr = 'TEV'; + beginHour = 16; + endHour = 20; + success = true; + } + else if (recognizersText.RegExpUtility.getMatches(this.nightStartEndRegex, source).length > 0) { + timeStr = 'TNI'; + beginHour = 20; + endHour = 23; + endMin = 59; + success = true; + } + return { timeStr: timeStr, beginHour: beginHour, endHour: endHour, endMin: endMin, success: success }; + } + getSwiftPrefix(source) { + let swift = 0; + if (source.startsWith('next')) + swift = 1; + else if (source.startsWith('last')) + swift = -1; + return swift; + } +} +exports.EnglishDateTimePeriodParserConfiguration = EnglishDateTimePeriodParserConfiguration; + +}); + +unwrapExports(dateTimePeriodConfiguration); + +var parsers$6 = createCommonjsModule(function (module, exports) { +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); + + + + +class EnglishTimeParser extends baseTime.BaseTimeParser { + constructor(configuration) { + super(configuration); + } + internalParse(text, referenceTime) { + let innerResult = super.internalParse(text, referenceTime); + if (!innerResult.success) { + innerResult = this.parseIsh(text, referenceTime); + } + return innerResult; + } + // parse "noonish", "11-ish" + parseIsh(text, referenceTime) { + let ret = new utilities$2.DateTimeResolutionResult(); + let trimmedText = text.toLowerCase().trim(); + let matches = recognizersText.RegExpUtility.getMatches(timeConfiguration.EnglishTimeExtractorConfiguration.ishRegex, trimmedText); + if (matches.length > 0 && matches[0].length === trimmedText.length) { + let hourStr = matches[0].groups("hour").value; + let hour = 12; + if (hourStr) { + hour = Number.parseInt(hourStr, 10); + } + ret.timex = "T" + utilities$2.FormatUtil.toString(hour, 2); + ret.futureValue = + ret.pastValue = + new Date(referenceTime.getFullYear(), referenceTime.getMonth(), referenceTime.getDate(), hour, 0, 0); + ret.success = true; + return ret; + } + return ret; + } +} +exports.EnglishTimeParser = EnglishTimeParser; + +}); + +unwrapExports(parsers$6); + +var baseConfiguration = createCommonjsModule(function (module, exports) { +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); + + + + + + + + + + + + + + + + + + + + +class EnglishDateTimeUtilityConfiguration { + constructor() { + this.laterRegex = recognizersText.RegExpUtility.getSafeRegExp(englishDateTime.EnglishDateTime.LaterRegex); + this.agoRegex = recognizersText.RegExpUtility.getSafeRegExp(englishDateTime.EnglishDateTime.AgoRegex); + this.inConnectorRegex = recognizersText.RegExpUtility.getSafeRegExp(englishDateTime.EnglishDateTime.InConnectorRegex); + this.rangeUnitRegex = recognizersText.RegExpUtility.getSafeRegExp(englishDateTime.EnglishDateTime.RangeUnitRegex); + this.amDescRegex = recognizersText.RegExpUtility.getSafeRegExp(englishDateTime.EnglishDateTime.AmDescRegex); + this.pmDescRegex = recognizersText.RegExpUtility.getSafeRegExp(englishDateTime.EnglishDateTime.PmDescRegex); + this.amPmDescRegex = recognizersText.RegExpUtility.getSafeRegExp(englishDateTime.EnglishDateTime.AmPmDescRegex); + } +} +exports.EnglishDateTimeUtilityConfiguration = EnglishDateTimeUtilityConfiguration; +class EnglishCommonDateTimeParserConfiguration extends parsers$4.BaseDateParserConfiguration { + constructor() { + super(); + this.utilityConfiguration = new EnglishDateTimeUtilityConfiguration(); + this.unitMap = englishDateTime.EnglishDateTime.UnitMap; + this.unitValueMap = englishDateTime.EnglishDateTime.UnitValueMap; + this.seasonMap = englishDateTime.EnglishDateTime.SeasonMap; + this.cardinalMap = englishDateTime.EnglishDateTime.CardinalMap; + this.dayOfWeek = englishDateTime.EnglishDateTime.DayOfWeek; + this.monthOfYear = englishDateTime.EnglishDateTime.MonthOfYear; + this.numbers = englishDateTime.EnglishDateTime.Numbers; + this.doubleNumbers = englishDateTime.EnglishDateTime.DoubleNumbers; + this.cardinalExtractor = new recognizersTextNumber.EnglishCardinalExtractor(); + this.integerExtractor = new recognizersTextNumber.EnglishIntegerExtractor(); + this.ordinalExtractor = new recognizersTextNumber.EnglishOrdinalExtractor(); + this.dayOfMonth = new Map([...baseDateTime.BaseDateTime.DayOfMonthDictionary, ...englishDateTime.EnglishDateTime.DayOfMonth]); + this.numberParser = new recognizersTextNumber.BaseNumberParser(new recognizersTextNumber.EnglishNumberParserConfiguration()); + this.dateExtractor = new baseDate.BaseDateExtractor(new dateConfiguration.EnglishDateExtractorConfiguration()); + this.timeExtractor = new baseTime.BaseTimeExtractor(new timeConfiguration.EnglishTimeExtractorConfiguration()); + this.dateTimeExtractor = new baseDateTime$2.BaseDateTimeExtractor(new dateTimeConfiguration.EnglishDateTimeExtractorConfiguration()); + this.durationExtractor = new baseDuration.BaseDurationExtractor(new durationConfiguration.EnglishDurationExtractorConfiguration()); + this.datePeriodExtractor = new baseDatePeriod.BaseDatePeriodExtractor(new datePeriodConfiguration.EnglishDatePeriodExtractorConfiguration()); + this.timePeriodExtractor = new baseTimePeriod.BaseTimePeriodExtractor(new timePeriodConfiguration.EnglishTimePeriodExtractorConfiguration()); + this.dateTimePeriodExtractor = new baseDateTimePeriod.BaseDateTimePeriodExtractor(new dateTimePeriodConfiguration.EnglishDateTimePeriodExtractorConfiguration()); + this.durationParser = new baseDuration.BaseDurationParser(new durationConfiguration.EnglishDurationParserConfiguration(this)); + this.dateParser = new baseDate.BaseDateParser(new dateConfiguration.EnglishDateParserConfiguration(this)); + this.timeParser = new parsers$6.EnglishTimeParser(new timeConfiguration.EnglishTimeParserConfiguration(this)); + this.dateTimeParser = new baseDateTime$2.BaseDateTimeParser(new dateTimeConfiguration.EnglishDateTimeParserConfiguration(this)); + this.datePeriodParser = new baseDatePeriod.BaseDatePeriodParser(new datePeriodConfiguration.EnglishDatePeriodParserConfiguration(this)); + this.timePeriodParser = new baseTimePeriod.BaseTimePeriodParser(new timePeriodConfiguration.EnglishTimePeriodParserConfiguration(this)); + this.dateTimePeriodParser = new baseDateTimePeriod.BaseDateTimePeriodParser(new dateTimePeriodConfiguration.EnglishDateTimePeriodParserConfiguration(this)); + } +} +exports.EnglishCommonDateTimeParserConfiguration = EnglishCommonDateTimeParserConfiguration; + +}); + +unwrapExports(baseConfiguration); + +var baseSet = createCommonjsModule(function (module, exports) { +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); + + + + +class BaseSetExtractor { + constructor(config) { + this.extractorName = constants$2.Constants.SYS_DATETIME_SET; + this.config = config; + } + extract(source, refDate) { + if (!refDate) + refDate = new Date(); + let referenceDate = refDate; + let tokens = new Array() + .concat(this.matchEachUnit(source)) + .concat(this.matchPeriodic(source)) + .concat(this.matchEachDuration(source, referenceDate)) + .concat(this.timeEveryday(source, referenceDate)) + .concat(this.matchEach(this.config.dateExtractor, source, referenceDate)) + .concat(this.matchEach(this.config.timeExtractor, source, referenceDate)) + .concat(this.matchEach(this.config.dateTimeExtractor, source, referenceDate)) + .concat(this.matchEach(this.config.datePeriodExtractor, source, referenceDate)) + .concat(this.matchEach(this.config.timePeriodExtractor, source, referenceDate)) + .concat(this.matchEach(this.config.dateTimePeriodExtractor, source, referenceDate)); + let result = utilities$2.Token.mergeAllTokens(tokens, source, this.extractorName); + return result; + } + matchEachUnit(source) { + let ret = []; + recognizersText.RegExpUtility.getMatches(this.config.eachUnitRegex, source).forEach(match => { + ret.push(new utilities$2.Token(match.index, match.index + match.length)); + }); + return ret; + } + matchPeriodic(source) { + let ret = []; + recognizersText.RegExpUtility.getMatches(this.config.periodicRegex, source).forEach(match => { + ret.push(new utilities$2.Token(match.index, match.index + match.length)); + }); + return ret; + } + matchEachDuration(source, refDate) { + let ret = []; + this.config.durationExtractor.extract(source, refDate).forEach(er => { + if (recognizersText.RegExpUtility.getMatches(this.config.lastRegex, er.text).length > 0) + return; + let beforeStr = source.substr(0, er.start); + let matches = recognizersText.RegExpUtility.getMatches(this.config.eachPrefixRegex, beforeStr); + if (matches && matches.length > 0) { + ret.push(new utilities$2.Token(matches[0].index, er.start + er.length)); + } + }); + return ret; + } + timeEveryday(source, refDate) { + let ret = []; + this.config.timeExtractor.extract(source, refDate).forEach(er => { + let afterStr = source.substr(er.start + er.length); + if (recognizersText.StringUtility.isNullOrWhitespace(afterStr) && this.config.beforeEachDayRegex) { + let beforeStr = source.substr(0, er.start); + let beforeMatches = recognizersText.RegExpUtility.getMatches(this.config.beforeEachDayRegex, beforeStr); + if (beforeMatches && beforeMatches.length > 0) { + ret.push(new utilities$2.Token(beforeMatches[0].index, er.start + er.length)); + } + } + else { + let afterMatches = recognizersText.RegExpUtility.getMatches(this.config.eachDayRegex, afterStr); + if (afterMatches && afterMatches.length > 0) { + ret.push(new utilities$2.Token(er.start, er.start + er.length + afterMatches[0].length)); + } + } + }); + return ret; + } + matchEach(extractor, source, refDate) { + let ret = []; + recognizersText.RegExpUtility.getMatches(this.config.setEachRegex, source).forEach(match => { + let trimmedSource = source.substr(0, match.index) + source.substr(match.index + match.length); + extractor.extract(trimmedSource, refDate).forEach(er => { + if (er.start <= match.index && (er.start + er.length) > match.index) { + ret.push(new utilities$2.Token(er.start, er.start + match.length + er.length)); + } + }); + }); + recognizersText.RegExpUtility.getMatches(this.config.setWeekDayRegex, source).forEach(match => { + let trimmedSource = source.substr(0, match.index) + match.groups('weekday').value + source.substr(match.index + match.length); + extractor.extract(trimmedSource, refDate).forEach(er => { + if (er.start <= match.index && er.text.includes(match.groups('weekday').value)) { + let length = er.length + 1; + if (!recognizersText.StringUtility.isNullOrEmpty(match.groups('prefix').value)) { + length += match.groups('prefix').value.length; + } + ret.push(new utilities$2.Token(er.start, er.start + length)); + } + }); + }); + return ret; + } +} +exports.BaseSetExtractor = BaseSetExtractor; +class BaseSetParser { + constructor(configuration) { + this.config = configuration; + } + parse(er, referenceDate) { + if (!referenceDate) + referenceDate = new Date(); + let value = null; + if (er.type === BaseSetParser.ParserName) { + let innerResult = this.parseEachUnit(er.text); + if (!innerResult.success) { + innerResult = this.parseEachDuration(er.text, referenceDate); + } + if (!innerResult.success) { + innerResult = this.parserTimeEveryday(er.text, referenceDate); + } + // NOTE: Please do not change the order of following function + // datetimeperiod>dateperiod>timeperiod>datetime>date>time + if (!innerResult.success) { + innerResult = this.parseEach(this.config.dateTimePeriodExtractor, this.config.dateTimePeriodParser, er.text, referenceDate); + } + if (!innerResult.success) { + innerResult = this.parseEach(this.config.datePeriodExtractor, this.config.datePeriodParser, er.text, referenceDate); + } + if (!innerResult.success) { + innerResult = this.parseEach(this.config.timePeriodExtractor, this.config.timePeriodParser, er.text, referenceDate); + } + if (!innerResult.success) { + innerResult = this.parseEach(this.config.dateTimeExtractor, this.config.dateTimeParser, er.text, referenceDate); + } + if (!innerResult.success) { + innerResult = this.parseEach(this.config.dateExtractor, this.config.dateParser, er.text, referenceDate); + } + if (!innerResult.success) { + innerResult = this.parseEach(this.config.timeExtractor, this.config.timeParser, er.text, referenceDate); + } + if (innerResult.success) { + innerResult.futureResolution = {}; + innerResult.futureResolution[constants$2.TimeTypeConstants.SET] = innerResult.futureValue; + innerResult.pastResolution = {}; + innerResult.pastResolution[constants$2.TimeTypeConstants.SET] = innerResult.pastValue; + value = innerResult; + } + } + let ret = new parsers$4.DateTimeParseResult(er); + ret.value = value, ret.timexStr = value === null ? "" : value.timex, ret.resolutionStr = ""; + return ret; + } + parseEachDuration(text, refDate) { + let ret = new utilities$2.DateTimeResolutionResult(); + let ers = this.config.durationExtractor.extract(text, refDate); + if (ers.length !== 1 || text.substring(ers[0].start + ers[0].length || 0)) { + return ret; + } + let beforeStr = text.substring(0, ers[0].start || 0); + let matches = recognizersText.RegExpUtility.getMatches(this.config.eachPrefixRegex, beforeStr); + if (matches.length) { + let pr = this.config.durationParser.parse(ers[0], new Date()); + ret.timex = pr.timexStr; + ret.futureValue = ret.pastValue = "Set: " + pr.timexStr; + ret.success = true; + return ret; + } + return ret; + } + parseEachUnit(text) { + let ret = new utilities$2.DateTimeResolutionResult(); + // handle "daily", "weekly" + let matches = recognizersText.RegExpUtility.getMatches(this.config.periodicRegex, text); + if (matches.length) { + let getMatchedDailyTimex = this.config.getMatchedDailyTimex(text); + if (!getMatchedDailyTimex.matched) { + return ret; + } + ret.timex = getMatchedDailyTimex.timex; + ret.futureValue = ret.pastValue = "Set: " + ret.timex; + ret.success = true; + return ret; + } + // handle "each month" + matches = recognizersText.RegExpUtility.getMatches(this.config.eachUnitRegex, text); + if (matches.length && matches[0].length === text.length) { + let sourceUnit = matches[0].groups("unit").value; + if (sourceUnit && this.config.unitMap.has(sourceUnit)) { + let getMatchedUnitTimex = this.config.getMatchedUnitTimex(sourceUnit); + if (!getMatchedUnitTimex.matched) { + return ret; + } + if (!recognizersText.StringUtility.isNullOrEmpty(matches[0].groups('other').value)) { + getMatchedUnitTimex.timex = getMatchedUnitTimex.timex.replace('1', '2'); + } + ret.timex = getMatchedUnitTimex.timex; + ret.futureValue = ret.pastValue = "Set: " + ret.timex; + ret.success = true; + return ret; + } + } + return ret; + } + parserTimeEveryday(text, refDate) { + let ret = new utilities$2.DateTimeResolutionResult(); + let ers = this.config.timeExtractor.extract(text, refDate); + if (ers.length !== 1) { + return ret; + } + let afterStr = text.replace(ers[0].text, ""); + let matches = recognizersText.RegExpUtility.getMatches(this.config.eachDayRegex, afterStr); + if (matches.length) { + let pr = this.config.timeParser.parse(ers[0], new Date()); + ret.timex = pr.timexStr; + ret.futureValue = ret.pastValue = "Set: " + ret.timex; + ret.success = true; + return ret; + } + return ret; + } + parseEach(extractor, parser, text, refDate) { + let ret = new utilities$2.DateTimeResolutionResult(); + let success = false; + let er; + let match = recognizersText.RegExpUtility.getMatches(this.config.setEachRegex, text).pop(); + if (match) { + let trimmedText = text.substr(0, match.index) + text.substr(match.index + match.length); + er = extractor.extract(trimmedText, refDate); + if (er.length === 1 && er[0].length === trimmedText.length) { + success = true; + } + } + match = recognizersText.RegExpUtility.getMatches(this.config.setWeekDayRegex, text).pop(); + if (match) { + let trimmedText = text.substr(0, match.index) + match.groups('weekday').value + text.substr(match.index + match.length); + er = extractor.extract(trimmedText, refDate); + if (er.length === 1 && er[0].length === trimmedText.length) { + success = true; + } + } + if (success) { + let pr = parser.parse(er[0]); + ret.timex = pr.timexStr; + ret.futureValue = `Set: ${pr.timexStr}`; + ret.pastValue = `Set: ${pr.timexStr}`; + ret.success = true; + return ret; + } + return ret; + } +} +BaseSetParser.ParserName = constants$2.Constants.SYS_DATETIME_SET; +exports.BaseSetParser = BaseSetParser; + +}); + +unwrapExports(baseSet); + +var baseHoliday = createCommonjsModule(function (module, exports) { +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); + + + + + +class BaseHolidayExtractor { + constructor(config) { + this.extractorName = constants$2.Constants.SYS_DATETIME_DATE; + this.config = config; + } + extract(source, refDate) { + if (!refDate) + refDate = new Date(); + let tokens = new Array() + .concat(this.holidayMatch(source)); + let result = utilities$2.Token.mergeAllTokens(tokens, source, this.extractorName); + return result; + } + holidayMatch(source) { + let ret = []; + this.config.holidayRegexes.forEach(regex => { + recognizersText.RegExpUtility.getMatches(regex, source).forEach(match => { + ret.push(new utilities$2.Token(match.index, match.index + match.length)); + }); + }); + return ret; + } +} +exports.BaseHolidayExtractor = BaseHolidayExtractor; +class BaseHolidayParser { + constructor(config) { + this.config = config; + } + parse(er, referenceDate) { + if (!referenceDate) + referenceDate = new Date(); + let value = null; + if (er.type === BaseHolidayParser.ParserName) { + let innerResult = this.parseHolidayRegexMatch(er.text, referenceDate); + if (innerResult.success) { + innerResult.futureResolution = {}; + innerResult.futureResolution[constants$2.TimeTypeConstants.DATE] = utilities$2.FormatUtil.formatDate(innerResult.futureValue); + innerResult.pastResolution = {}; + innerResult.pastResolution[constants$2.TimeTypeConstants.DATE] = utilities$2.FormatUtil.formatDate(innerResult.pastValue); + value = innerResult; + } + } + let ret = new parsers$4.DateTimeParseResult(er); + ret.value = value; + ret.timexStr = value === null ? "" : value.timex; + ret.resolutionStr = ""; + return ret; + } + parseHolidayRegexMatch(text, referenceDate) { + let trimmedText = text.trim(); + for (let regex of this.config.holidayRegexList) { + let offset = 0; + let matches = recognizersText.RegExpUtility.getMatches(regex, trimmedText); + if (matches.length && matches[0].index === offset && matches[0].length === trimmedText.length) { + // LUIS value string will be set in Match2Date method + let ret = this.match2Date(matches[0], referenceDate); + return ret; + } + } + return new utilities$2.DateTimeResolutionResult(); + } + match2Date(match, referenceDate) { + let ret = new utilities$2.DateTimeResolutionResult(); + let holidayStr = this.config.sanitizeHolidayToken(match.groups("holiday").value.toLowerCase()); + // get year (if exist) + let yearStr = match.groups("year").value.toLowerCase(); + let orderStr = match.groups("order").value.toLowerCase(); + let year; + let hasYear = false; + if (yearStr) { + year = parseInt(yearStr, 10); + hasYear = true; + } + else if (orderStr) { + let swift = this.config.getSwiftYear(orderStr); + if (swift < -1) { + return ret; + } + year = referenceDate.getFullYear() + swift; + hasYear = true; + } + else { + year = referenceDate.getFullYear(); + } + let holidayKey; + for (holidayKey of this.config.holidayNames.keys()) { + if (this.config.holidayNames.get(holidayKey).indexOf(holidayStr) > -1) { + break; + } + } + if (holidayKey) { + let timexStr; + let value = referenceDate; + let func = this.config.holidayFuncDictionary.get(holidayKey); + if (func) { + value = func(year); + timexStr = this.config.variableHolidaysTimexDictionary.get(holidayKey); + if (!timexStr) { + timexStr = `-${utilities$2.FormatUtil.toString(value.getMonth() + 1, 2)}-${utilities$2.FormatUtil.toString(value.getDate(), 2)}`; + } + } + else { + return ret; + } + if (value.getTime() === utilities$2.DateUtils.minValue().getTime()) { + ret.timex = ''; + ret.futureValue = utilities$2.DateUtils.minValue(); + ret.pastValue = utilities$2.DateUtils.minValue(); + ret.success = true; + return ret; + } + if (hasYear) { + ret.timex = utilities$2.FormatUtil.toString(year, 4) + timexStr; + ret.futureValue = ret.pastValue = new Date(year, value.getMonth(), value.getDate()); + ret.success = true; + return ret; + } + ret.timex = "XXXX" + timexStr; + ret.futureValue = this.getFutureValue(value, referenceDate, holidayKey); + ret.pastValue = this.getPastValue(value, referenceDate, holidayKey); + ret.success = true; + return ret; + } + return ret; + } + getFutureValue(value, referenceDate, holiday) { + if (value < referenceDate) { + let func = this.config.holidayFuncDictionary.get(holiday); + if (func) { + return func(value.getFullYear() + 1); + } + } + return value; + } + getPastValue(value, referenceDate, holiday) { + if (value >= referenceDate) { + let func = this.config.holidayFuncDictionary.get(holiday); + if (func) { + return func(value.getFullYear() - 1); + } + } + return value; + } +} +BaseHolidayParser.ParserName = constants$2.Constants.SYS_DATETIME_DATE; // "Date"; +exports.BaseHolidayParser = BaseHolidayParser; +class BaseHolidayParserConfiguration { + constructor() { + this.variableHolidaysTimexDictionary = baseDateTime.BaseDateTime.VariableHolidaysTimexDictionary; + this.holidayFuncDictionary = this.initHolidayFuncs(); + } + // TODO auto-generate from YAML + initHolidayFuncs() { + return new Map([ + ["fathers", BaseHolidayParserConfiguration.FathersDay], + ["mothers", BaseHolidayParserConfiguration.MothersDay], + ["thanksgivingday", BaseHolidayParserConfiguration.ThanksgivingDay], + ["thanksgiving", BaseHolidayParserConfiguration.ThanksgivingDay], + ["martinlutherking", BaseHolidayParserConfiguration.MartinLutherKingDay], + ["washingtonsbirthday", BaseHolidayParserConfiguration.WashingtonsBirthday], + ["canberra", BaseHolidayParserConfiguration.CanberraDay], + ["labour", BaseHolidayParserConfiguration.LabourDay], + ["columbus", BaseHolidayParserConfiguration.ColumbusDay], + ["memorial", BaseHolidayParserConfiguration.MemorialDay] + ]); + } + // All months are zero-based (-1) + // TODO auto-generate from YAML + static MothersDay(year) { return new Date(year, 5 - 1, BaseHolidayParserConfiguration.getDay(year, 5 - 1, 1, utilities$2.DayOfWeek.Sunday)); } + static FathersDay(year) { return new Date(year, 6 - 1, BaseHolidayParserConfiguration.getDay(year, 6 - 1, 2, utilities$2.DayOfWeek.Sunday)); } + static MartinLutherKingDay(year) { return new Date(year, 1 - 1, BaseHolidayParserConfiguration.getDay(year, 1 - 1, 2, utilities$2.DayOfWeek.Monday)); } + static WashingtonsBirthday(year) { return new Date(year, 2 - 1, BaseHolidayParserConfiguration.getDay(year, 2 - 1, 2, utilities$2.DayOfWeek.Monday)); } + static CanberraDay(year) { return new Date(year, 3 - 1, BaseHolidayParserConfiguration.getDay(year, 3 - 1, 0, utilities$2.DayOfWeek.Monday)); } + static MemorialDay(year) { return new Date(year, 5 - 1, BaseHolidayParserConfiguration.getLastDay(year, 5 - 1, utilities$2.DayOfWeek.Monday)); } + static LabourDay(year) { return new Date(year, 9 - 1, BaseHolidayParserConfiguration.getDay(year, 9 - 1, 0, utilities$2.DayOfWeek.Monday)); } + static ColumbusDay(year) { return new Date(year, 10 - 1, BaseHolidayParserConfiguration.getDay(year, 10 - 1, 1, utilities$2.DayOfWeek.Monday)); } + static ThanksgivingDay(year) { return new Date(year, 11 - 1, BaseHolidayParserConfiguration.getDay(year, 11 - 1, 3, utilities$2.DayOfWeek.Thursday)); } + static getDay(year, month, week, dayOfWeek) { + let days = Array.apply(null, new Array(new Date(year, month, 0).getDate())).map(function (x, i) { return i + 1; }); + days = days.filter(function (day) { + return new Date(year, month, day).getDay() === dayOfWeek; + }); + return days[week]; + } + static getLastDay(year, month, dayOfWeek) { + let days = Array.apply(null, new Array(new Date(year, month, 0).getDate())).map(function (x, i) { return i + 1; }); + days = days.filter(function (day) { + return new Date(year, month, day).getDay() === dayOfWeek; + }); + return days[days.length - 1]; + } +} +exports.BaseHolidayParserConfiguration = BaseHolidayParserConfiguration; + +}); + +unwrapExports(baseHoliday); + +var setConfiguration = createCommonjsModule(function (module, exports) { +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); + + + + + + + + + + + + + + + + +class EnglishSetExtractorConfiguration { + constructor() { + this.durationExtractor = new baseDuration.BaseDurationExtractor(new durationConfiguration.EnglishDurationExtractorConfiguration()); + this.timeExtractor = new baseTime.BaseTimeExtractor(new timeConfiguration.EnglishTimeExtractorConfiguration()); + this.dateExtractor = new baseDate.BaseDateExtractor(new dateConfiguration.EnglishDateExtractorConfiguration()); + this.dateTimeExtractor = new baseDateTime$2.BaseDateTimeExtractor(new dateTimeConfiguration.EnglishDateTimeExtractorConfiguration()); + this.datePeriodExtractor = new baseDatePeriod.BaseDatePeriodExtractor(new datePeriodConfiguration.EnglishDatePeriodExtractorConfiguration()); + this.timePeriodExtractor = new baseTimePeriod.BaseTimePeriodExtractor(new timePeriodConfiguration.EnglishTimePeriodExtractorConfiguration()); + this.dateTimePeriodExtractor = new baseDateTimePeriod.BaseDateTimePeriodExtractor(new dateTimePeriodConfiguration.EnglishDateTimePeriodExtractorConfiguration()); + this.lastRegex = recognizersText.RegExpUtility.getSafeRegExp(englishDateTime.EnglishDateTime.SetLastRegex); + this.eachPrefixRegex = recognizersText.RegExpUtility.getSafeRegExp(englishDateTime.EnglishDateTime.EachPrefixRegex); + this.periodicRegex = recognizersText.RegExpUtility.getSafeRegExp(englishDateTime.EnglishDateTime.PeriodicRegex); + this.eachUnitRegex = recognizersText.RegExpUtility.getSafeRegExp(englishDateTime.EnglishDateTime.EachUnitRegex); + this.eachDayRegex = recognizersText.RegExpUtility.getSafeRegExp(englishDateTime.EnglishDateTime.EachDayRegex); + this.setWeekDayRegex = recognizersText.RegExpUtility.getSafeRegExp(englishDateTime.EnglishDateTime.SetWeekDayRegex); + this.setEachRegex = recognizersText.RegExpUtility.getSafeRegExp(englishDateTime.EnglishDateTime.SetEachRegex); + this.beforeEachDayRegex = null; + } +} +exports.EnglishSetExtractorConfiguration = EnglishSetExtractorConfiguration; +class EnglishSetParserConfiguration { + constructor(config) { + this.durationExtractor = config.durationExtractor; + this.timeExtractor = config.timeExtractor; + this.dateExtractor = config.dateExtractor; + this.dateTimeExtractor = config.dateTimeExtractor; + this.datePeriodExtractor = config.datePeriodExtractor; + this.timePeriodExtractor = config.timePeriodExtractor; + this.dateTimePeriodExtractor = config.dateTimePeriodExtractor; + this.durationParser = config.durationParser; + this.timeParser = config.timeParser; + this.dateParser = config.dateParser; + this.dateTimeParser = config.dateTimeParser; + this.datePeriodParser = config.datePeriodParser; + this.timePeriodParser = config.timePeriodParser; + this.dateTimePeriodParser = config.dateTimePeriodParser; + this.unitMap = config.unitMap; + this.eachPrefixRegex = recognizersText.RegExpUtility.getSafeRegExp(englishDateTime.EnglishDateTime.EachPrefixRegex); + this.periodicRegex = recognizersText.RegExpUtility.getSafeRegExp(englishDateTime.EnglishDateTime.PeriodicRegex); + this.eachUnitRegex = recognizersText.RegExpUtility.getSafeRegExp(englishDateTime.EnglishDateTime.EachUnitRegex); + this.eachDayRegex = recognizersText.RegExpUtility.getSafeRegExp(englishDateTime.EnglishDateTime.EachDayRegex); + this.setWeekDayRegex = recognizersText.RegExpUtility.getSafeRegExp(englishDateTime.EnglishDateTime.SetWeekDayRegex); + this.setEachRegex = recognizersText.RegExpUtility.getSafeRegExp(englishDateTime.EnglishDateTime.SetEachRegex); + } + getMatchedDailyTimex(text) { + let timex = ""; + let trimmedText = text.trim().toLowerCase(); + if (trimmedText === "daily") { + timex = "P1D"; + } + else if (trimmedText === "weekly") { + timex = "P1W"; + } + else if (trimmedText === "biweekly") { + timex = "P2W"; + } + else if (trimmedText === "monthly") { + timex = "P1M"; + } + else if (trimmedText === "yearly" || trimmedText === "annually" || trimmedText === "annual") { + timex = "P1Y"; + } + else { + timex = null; + return { matched: false, timex: timex }; + } + return { matched: true, timex: timex }; + } + getMatchedUnitTimex(text) { + let timex = ""; + let trimmedText = text.trim().toLowerCase(); + if (trimmedText === "day") { + timex = "P1D"; + } + else if (trimmedText === "week") { + timex = "P1W"; + } + else if (trimmedText === "month") { + timex = "P1M"; + } + else if (trimmedText === "year") { + timex = "P1Y"; + } + else { + timex = null; + return { matched: false, timex: timex }; + } + return { matched: true, timex: timex }; + } +} +exports.EnglishSetParserConfiguration = EnglishSetParserConfiguration; + +}); + +unwrapExports(setConfiguration); + +var holidayConfiguration = createCommonjsModule(function (module, exports) { +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); + + + + +class EnglishHolidayExtractorConfiguration { + constructor() { + this.holidayRegexes = [ + recognizersText.RegExpUtility.getSafeRegExp(englishDateTime.EnglishDateTime.HolidayRegex1, "gis"), + recognizersText.RegExpUtility.getSafeRegExp(englishDateTime.EnglishDateTime.HolidayRegex2, "gis"), + recognizersText.RegExpUtility.getSafeRegExp(englishDateTime.EnglishDateTime.HolidayRegex3, "gis") + ]; + } +} +exports.EnglishHolidayExtractorConfiguration = EnglishHolidayExtractorConfiguration; +class EnglishHolidayParserConfiguration extends baseHoliday.BaseHolidayParserConfiguration { + constructor() { + super(); + this.holidayRegexList = [ + recognizersText.RegExpUtility.getSafeRegExp(englishDateTime.EnglishDateTime.HolidayRegex1, "gis"), + recognizersText.RegExpUtility.getSafeRegExp(englishDateTime.EnglishDateTime.HolidayRegex2, "gis"), + recognizersText.RegExpUtility.getSafeRegExp(englishDateTime.EnglishDateTime.HolidayRegex3, "gis") + ]; + this.holidayNames = englishDateTime.EnglishDateTime.HolidayNames; + this.holidayFuncDictionary = this.initHolidayFuncs(); + } + initHolidayFuncs() { + return new Map([ + ...super.initHolidayFuncs(), + ["maosbirthday", EnglishHolidayParserConfiguration.MaoBirthday], + ["yuandan", EnglishHolidayParserConfiguration.NewYear], + ["teachersday", EnglishHolidayParserConfiguration.TeacherDay], + ["singleday", EnglishHolidayParserConfiguration.SinglesDay], + ["allsaintsday", EnglishHolidayParserConfiguration.HalloweenDay], + ["youthday", EnglishHolidayParserConfiguration.YouthDay], + ["childrenday", EnglishHolidayParserConfiguration.ChildrenDay], + ["femaleday", EnglishHolidayParserConfiguration.FemaleDay], + ["treeplantingday", EnglishHolidayParserConfiguration.TreePlantDay], + ["arborday", EnglishHolidayParserConfiguration.TreePlantDay], + ["girlsday", EnglishHolidayParserConfiguration.GirlsDay], + ["whiteloverday", EnglishHolidayParserConfiguration.WhiteLoverDay], + ["loverday", EnglishHolidayParserConfiguration.ValentinesDay], + ["christmas", EnglishHolidayParserConfiguration.ChristmasDay], + ["xmas", EnglishHolidayParserConfiguration.ChristmasDay], + ["newyear", EnglishHolidayParserConfiguration.NewYear], + ["newyearday", EnglishHolidayParserConfiguration.NewYear], + ["newyearsday", EnglishHolidayParserConfiguration.NewYear], + ["inaugurationday", EnglishHolidayParserConfiguration.InaugurationDay], + ["groundhougday", EnglishHolidayParserConfiguration.GroundhogDay], + ["valentinesday", EnglishHolidayParserConfiguration.ValentinesDay], + ["stpatrickday", EnglishHolidayParserConfiguration.StPatrickDay], + ["aprilfools", EnglishHolidayParserConfiguration.FoolDay], + ["stgeorgeday", EnglishHolidayParserConfiguration.StGeorgeDay], + ["mayday", EnglishHolidayParserConfiguration.Mayday], + ["cincodemayoday", EnglishHolidayParserConfiguration.CincoDeMayoday], + ["baptisteday", EnglishHolidayParserConfiguration.BaptisteDay], + ["usindependenceday", EnglishHolidayParserConfiguration.UsaIndependenceDay], + ["independenceday", EnglishHolidayParserConfiguration.UsaIndependenceDay], + ["bastilleday", EnglishHolidayParserConfiguration.BastilleDay], + ["halloweenday", EnglishHolidayParserConfiguration.HalloweenDay], + ["allhallowday", EnglishHolidayParserConfiguration.AllHallowDay], + ["allsoulsday", EnglishHolidayParserConfiguration.AllSoulsday], + ["guyfawkesday", EnglishHolidayParserConfiguration.GuyFawkesDay], + ["veteransday", EnglishHolidayParserConfiguration.Veteransday], + ["christmaseve", EnglishHolidayParserConfiguration.ChristmasEve], + ["newyeareve", EnglishHolidayParserConfiguration.NewYearEve], + ["easterday", EnglishHolidayParserConfiguration.EasterDay] + ]); + } + // All JavaScript dates are zero-based (-1) + static NewYear(year) { return new Date(year, 1 - 1, 1); } + static NewYearEve(year) { return new Date(year, 12 - 1, 31); } + static ChristmasDay(year) { return new Date(year, 12 - 1, 25); } + static ChristmasEve(year) { return new Date(year, 12 - 1, 24); } + static ValentinesDay(year) { return new Date(year, 2 - 1, 14); } + static WhiteLoverDay(year) { return new Date(year, 3 - 1, 14); } + static FoolDay(year) { return new Date(year, 4 - 1, 1); } + static GirlsDay(year) { return new Date(year, 3 - 1, 7); } + static TreePlantDay(year) { return new Date(year, 3 - 1, 12); } + static FemaleDay(year) { return new Date(year, 3 - 1, 8); } + static ChildrenDay(year) { return new Date(year, 6 - 1, 1); } + static YouthDay(year) { return new Date(year, 5 - 1, 4); } + static TeacherDay(year) { return new Date(year, 9 - 1, 10); } + static SinglesDay(year) { return new Date(year, 11 - 1, 11); } + static MaoBirthday(year) { return new Date(year, 12 - 1, 26); } + static InaugurationDay(year) { return new Date(year, 1 - 1, 20); } + static GroundhogDay(year) { return new Date(year, 2 - 1, 2); } + static StPatrickDay(year) { return new Date(year, 3 - 1, 17); } + static StGeorgeDay(year) { return new Date(year, 4 - 1, 23); } + static Mayday(year) { return new Date(year, 5 - 1, 1); } + static CincoDeMayoday(year) { return new Date(year, 5 - 1, 5); } + static BaptisteDay(year) { return new Date(year, 6 - 1, 24); } + static UsaIndependenceDay(year) { return new Date(year, 7 - 1, 4); } + static BastilleDay(year) { return new Date(year, 7 - 1, 14); } + static HalloweenDay(year) { return new Date(year, 10 - 1, 31); } + static AllHallowDay(year) { return new Date(year, 11 - 1, 1); } + static AllSoulsday(year) { return new Date(year, 11 - 1, 2); } + static GuyFawkesDay(year) { return new Date(year, 11 - 1, 5); } + static Veteransday(year) { return new Date(year, 11 - 1, 11); } + static EasterDay(year) { return utilities$2.DateUtils.minValue(); } + getSwiftYear(text) { + let trimmedText = text.trim().toLowerCase(); + let swift = -10; + if (trimmedText.startsWith("next")) { + swift = 1; + } + else if (trimmedText.startsWith("last")) { + swift = -1; + } + else if (trimmedText.startsWith("this")) { + swift = 0; + } + return swift; + } + sanitizeHolidayToken(holiday) { + return holiday.replace(/[ ']/g, ""); + } +} +exports.EnglishHolidayParserConfiguration = EnglishHolidayParserConfiguration; + +}); + +unwrapExports(holidayConfiguration); + +var mergedConfiguration = createCommonjsModule(function (module, exports) { +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); + + + + + + + + + + + + + + + + + + + + + +class EnglishMergedExtractorConfiguration { + constructor() { + this.dateExtractor = new baseDate.BaseDateExtractor(new dateConfiguration.EnglishDateExtractorConfiguration()); + this.timeExtractor = new baseTime.BaseTimeExtractor(new timeConfiguration.EnglishTimeExtractorConfiguration()); + this.dateTimeExtractor = new baseDateTime$2.BaseDateTimeExtractor(new dateTimeConfiguration.EnglishDateTimeExtractorConfiguration()); + this.datePeriodExtractor = new baseDatePeriod.BaseDatePeriodExtractor(new datePeriodConfiguration.EnglishDatePeriodExtractorConfiguration()); + this.timePeriodExtractor = new baseTimePeriod.BaseTimePeriodExtractor(new timePeriodConfiguration.EnglishTimePeriodExtractorConfiguration()); + this.dateTimePeriodExtractor = new baseDateTimePeriod.BaseDateTimePeriodExtractor(new dateTimePeriodConfiguration.EnglishDateTimePeriodExtractorConfiguration()); + this.holidayExtractor = new baseHoliday.BaseHolidayExtractor(new holidayConfiguration.EnglishHolidayExtractorConfiguration()); + this.durationExtractor = new baseDuration.BaseDurationExtractor(new durationConfiguration.EnglishDurationExtractorConfiguration()); + this.setExtractor = new baseSet.BaseSetExtractor(new setConfiguration.EnglishSetExtractorConfiguration()); + this.integerExtractor = new recognizersTextNumber.EnglishIntegerExtractor(); + this.afterRegex = recognizersText.RegExpUtility.getSafeRegExp(englishDateTime.EnglishDateTime.AfterRegex); + this.sinceRegex = recognizersText.RegExpUtility.getSafeRegExp(englishDateTime.EnglishDateTime.SinceRegex); + this.beforeRegex = recognizersText.RegExpUtility.getSafeRegExp(englishDateTime.EnglishDateTime.BeforeRegex); + this.fromToRegex = recognizersText.RegExpUtility.getSafeRegExp(englishDateTime.EnglishDateTime.FromToRegex); + this.singleAmbiguousMonthRegex = recognizersText.RegExpUtility.getSafeRegExp(englishDateTime.EnglishDateTime.SingleAmbiguousMonthRegex); + this.prepositionSuffixRegex = recognizersText.RegExpUtility.getSafeRegExp(englishDateTime.EnglishDateTime.PrepositionSuffixRegex); + this.numberEndingPattern = recognizersText.RegExpUtility.getSafeRegExp(englishDateTime.EnglishDateTime.NumberEndingPattern); + this.filterWordRegexList = [ + recognizersText.RegExpUtility.getSafeRegExp(englishDateTime.EnglishDateTime.OneOnOneRegex) + ]; + } +} +exports.EnglishMergedExtractorConfiguration = EnglishMergedExtractorConfiguration; +class EnglishMergedParserConfiguration { + constructor(config) { + this.beforeRegex = recognizersText.RegExpUtility.getSafeRegExp(englishDateTime.EnglishDateTime.BeforeRegex); + this.afterRegex = recognizersText.RegExpUtility.getSafeRegExp(englishDateTime.EnglishDateTime.AfterRegex); + this.sinceRegex = recognizersText.RegExpUtility.getSafeRegExp(englishDateTime.EnglishDateTime.SinceRegex); + this.holidayParser = new baseHoliday.BaseHolidayParser(new holidayConfiguration.EnglishHolidayParserConfiguration()); + this.dateParser = config.dateParser; + this.timeParser = config.timeParser; + this.dateTimeParser = config.dateTimeParser; + this.datePeriodParser = config.datePeriodParser; + this.timePeriodParser = config.timePeriodParser; + this.dateTimePeriodParser = config.dateTimePeriodParser; + this.durationParser = config.durationParser; + this.setParser = new baseSet.BaseSetParser(new setConfiguration.EnglishSetParserConfiguration(config)); + } +} +exports.EnglishMergedParserConfiguration = EnglishMergedParserConfiguration; + +}); + +unwrapExports(mergedConfiguration); + +var spanishDateTime = createCommonjsModule(function (module, exports) { +"use strict"; +// ------------------------------------------------------------------------------ +// +// This code was generated by a tool. +// Changes to this file may cause incorrect behavior and will be lost if +// the code is regenerated. +// +// ------------------------------------------------------------------------------ +Object.defineProperty(exports, "__esModule", { value: true }); + +var SpanishDateTime; +(function (SpanishDateTime) { + SpanishDateTime.TillRegex = `(?hasta|al|a|--|-|—|——)(\\s+(el|la(s)?))?`; + SpanishDateTime.AndRegex = `(?y|y\\s*el|--|-|—|——)`; + SpanishDateTime.DayRegex = `(?01|02|03|04|05|06|07|08|09|10|11|12|13|14|15|16|17|18|19|1|20|21|22|23|24|25|26|27|28|29|2|30|31|3|4|5|6|7|8|9)(?=\\b|t)`; + SpanishDateTime.MonthNumRegex = `(?01|02|03|04|05|06|07|08|09|10|11|12|1|2|3|4|5|6|7|8|9)\\b`; + SpanishDateTime.DescRegex = `(?pm\\b|am\\b|p\\.m\\.|a\\.m\\.)`; + SpanishDateTime.AmDescRegex = `(am\\b|a\\.m\\.|a m\\b|a\\. m\\.\\b|a\\.m\\b|a\\. m\\b)`; + SpanishDateTime.PmDescRegex = `(pm\\b|p\\.m\\.|p\\b|p m\\b|p\\. m\\.\\b|p\\.m\\b|p\\. m\\b)`; + SpanishDateTime.AmPmDescRegex = `(ampm)`; + SpanishDateTime.TwoDigitYearRegex = `\\b(?([0-27-9]\\d))(?!(\\s*((\\:)|${SpanishDateTime.AmDescRegex}|${SpanishDateTime.PmDescRegex}|\\.\\d)))\\b`; + SpanishDateTime.FullTextYearRegex = `^[\\*]`; + SpanishDateTime.YearRegex = `(${baseDateTime.BaseDateTime.FourDigitYearRegex}|${SpanishDateTime.FullTextYearRegex})`; + SpanishDateTime.RelativeMonthRegex = `(?(este|pr[oó]ximo|[uú]ltimo)\\s+mes)\\b`; + SpanishDateTime.MonthRegex = `(?Abril|Abr|Agosto|Ago|Diciembre|Dic|Febrero|Feb|Enero|Ene|Julio|Jul|Junio|Jun|Marzo|Mar|Mayo|May|Noviembre|Nov|Octubre|Oct|Septiembre|Setiembre|Sept|Set)`; + SpanishDateTime.MonthSuffixRegex = `(?(en\\s+|del\\s+|de\\s+)?(${SpanishDateTime.RelativeMonthRegex}|${SpanishDateTime.MonthRegex}))`; + SpanishDateTime.DateUnitRegex = `(?años|año|meses|mes|semanas|semana|d[ií]a(s)?)\\b`; + SpanishDateTime.PastRegex = `(?\\b(pasad(a|o)(s)?|[uú]ltim[oa](s)?|anterior(es)?|previo(s)?)\\b)`; + SpanishDateTime.FutureRegex = `(?\\b(siguiente(s)?|pr[oó]xim[oa](s)?|dentro\\s+de|en)\\b)`; + SpanishDateTime.SimpleCasesRegex = `\\b((desde\\s+el|desde|del)\\s+)?(${SpanishDateTime.DayRegex})\\s*${SpanishDateTime.TillRegex}\\s*(${SpanishDateTime.DayRegex})\\s+${SpanishDateTime.MonthSuffixRegex}((\\s+|\\s*,\\s*)${SpanishDateTime.YearRegex})?\\b`; + SpanishDateTime.MonthFrontSimpleCasesRegex = `\\b${SpanishDateTime.MonthSuffixRegex}\\s+((desde\\s+el|desde|del)\\s+)?(${SpanishDateTime.DayRegex})\\s*${SpanishDateTime.TillRegex}\\s*(${SpanishDateTime.DayRegex})((\\s+|\\s*,\\s*)${SpanishDateTime.YearRegex})?\\b`; + SpanishDateTime.MonthFrontBetweenRegex = `\\b${SpanishDateTime.MonthSuffixRegex}\\s+((entre|entre\\s+el)\\s+)(${SpanishDateTime.DayRegex})\\s*${SpanishDateTime.AndRegex}\\s*(${SpanishDateTime.DayRegex})((\\s+|\\s*,\\s*)${SpanishDateTime.YearRegex})?\\b`; + SpanishDateTime.DayBetweenRegex = `\\b((entre|entre\\s+el)\\s+)(${SpanishDateTime.DayRegex})\\s*${SpanishDateTime.AndRegex}\\s*(${SpanishDateTime.DayRegex})\\s+${SpanishDateTime.MonthSuffixRegex}((\\s+|\\s*,\\s*)${SpanishDateTime.YearRegex})?\\b`; + SpanishDateTime.OneWordPeriodRegex = `\\b(((pr[oó]xim[oa]?|est[ea]|[uú]ltim[oa]?|en)\\s+)?(?Abril|Abr|Agosto|Ago|Diciembre|Dic|Enero|Ene|Febrero|Feb|Julio|Jul|Junio|Jun|Marzo|Mar|Mayo|May|Noviembre|Nov|Octubre|Oct|Septiembre|Setiembre|Sept|Set)|(?<=\\b(del|de la|el|la)\\s+)?(pr[oó]xim[oa](s)?|[uú]ltim[oa]?|est(e|a))\\s+(fin de semana|semana|mes|año)|fin de semana|(mes|años)? a la fecha)\\b`; + SpanishDateTime.MonthWithYearRegex = `\\b(((pr[oó]xim[oa](s)?|este|esta|[uú]ltim[oa]?|en)\\s+)?(?Abril|Abr|Agosto|Ago|Diciembre|Dic|Enero|Ene|Febrero|Feb|Julio|Jul|Junio|Jun|Marzo|Mar|Mayo|May|Noviembre|Nov|Octubre|Oct|Septiembre|Setiembre|Sept|Set)\\s+((de|del|de la)\\s+)?(${SpanishDateTime.YearRegex}|(?pr[oó]ximo(s)?|[uú]ltimo?|este)\\s+año))\\b`; + SpanishDateTime.MonthNumWithYearRegex = `(${SpanishDateTime.YearRegex}(\\s*?)[/\\-\\.](\\s*?)${SpanishDateTime.MonthNumRegex})|(${SpanishDateTime.MonthNumRegex}(\\s*?)[/\\-](\\s*?)${SpanishDateTime.YearRegex})`; + SpanishDateTime.WeekOfMonthRegex = `(?(la\\s+)?(?primera?|1ra|segunda|2da|tercera?|3ra|cuarta|4ta|quinta|5ta|[uú]ltima)\\s+semana\\s+${SpanishDateTime.MonthSuffixRegex})`; + SpanishDateTime.WeekOfYearRegex = `(?(la\\s+)?(?primera?|1ra|segunda|2da|tercera?|3ra|cuarta|4ta|quinta|5ta|[uú]ltima?)\\s+semana(\\s+del?)?\\s+(${SpanishDateTime.YearRegex}|(?pr[oó]ximo|[uú]ltimo|este)\\s+año))`; + SpanishDateTime.FollowedDateUnit = `^\\s*${SpanishDateTime.DateUnitRegex}`; + SpanishDateTime.NumberCombinedWithDateUnit = `\\b(?\\d+(\\.\\d*)?)${SpanishDateTime.DateUnitRegex}`; + SpanishDateTime.QuarterRegex = `(el\\s+)?(?primer|1er|segundo|2do|tercer|3ro|cuarto|4to)\\s+cuatrimestre(\\s+de|\\s*,\\s*)?\\s+(${SpanishDateTime.YearRegex}|(?pr[oó]ximo(s)?|[uú]ltimo?|este)\\s+año)`; + SpanishDateTime.QuarterRegexYearFront = `(${SpanishDateTime.YearRegex}|(?pr[oó]ximo(s)?|[uú]ltimo?|este)\\s+año)\\s+(el\\s+)?(?(primer|primero)|1er|segundo|2do|(tercer|terceo)|3ro|cuarto|4to)\\s+cuatrimestre`; + SpanishDateTime.AllHalfYearRegex = `^[.]`; + SpanishDateTime.PrefixDayRegex = `^[.]`; + SpanishDateTime.CenturySuffixRegex = `^[.]`; + SpanishDateTime.SeasonRegex = `\\b(?(([uú]ltim[oa]|est[ea]|el|la|(pr[oó]xim[oa]s?|siguiente))\\s+)?(?primavera|verano|otoño|invierno)((\\s+del?|\\s*,\\s*)?\\s+(${SpanishDateTime.YearRegex}|(?pr[oó]ximo|[uú]ltimo|este)\\s+año))?)\\b`; + SpanishDateTime.WhichWeekRegex = `(semana)(\\s*)(?\\d\\d|\\d|0\\d)`; + SpanishDateTime.WeekOfRegex = `(semana)(\\s*)((do|da|de))`; + SpanishDateTime.MonthOfRegex = `(mes)(\\s*)((do|da|de))`; + SpanishDateTime.RangeUnitRegex = `\\b(?años|año|meses|mes|semanas|semana)\\b`; + SpanishDateTime.InConnectorRegex = `\\b(in)\\b`; + SpanishDateTime.WithinNextPrefixRegex = `^[.]`; + SpanishDateTime.FromRegex = `((desde|de)(\\s*la(s)?)?)$`; + SpanishDateTime.ConnectorAndRegex = `(y\\s*(la(s)?)?)$`; + SpanishDateTime.BetweenRegex = `(entre\\s*(la(s)?)?)`; + SpanishDateTime.WeekDayRegex = `\\b(?Domingos?|Lunes|Martes|Mi[eé]rcoles|Jueves|Viernes|S[aá]bados?|Lu|Ma|Mi|Ju|Vi|Sa|Do)\\b`; + SpanishDateTime.OnRegex = `(?<=\\ben\\s+)(${SpanishDateTime.DayRegex}s?)\\b`; + SpanishDateTime.RelaxedOnRegex = `(?<=\\b(en|el|del)\\s+)((?10|11|12|13|14|15|16|17|18|19|1st|20|21|22|23|24|25|26|27|28|29|2|30|31|3|4|5|6|7|8|9)s?)\\b`; + SpanishDateTime.ThisRegex = `\\b((este\\s*)${SpanishDateTime.WeekDayRegex})|(${SpanishDateTime.WeekDayRegex}\\s*((de\\s+)?esta\\s+semana))\\b`; + SpanishDateTime.LastDateRegex = `\\b(([uú]ltimo)\\s*${SpanishDateTime.WeekDayRegex})|(${SpanishDateTime.WeekDayRegex}(\\s+((de\\s+)?(esta|la)\\s+([uú]ltima\\s+)?semana)))\\b`; + SpanishDateTime.NextDateRegex = `\\b(((pr[oó]ximo|siguiente)\\s*)${SpanishDateTime.WeekDayRegex})|(${SpanishDateTime.WeekDayRegex}(\\s+(de\\s+)?(la\\s+)?(pr[oó]xima|siguiente)(\\s*semana)))\\b`; + SpanishDateTime.SpecialDayRegex = `\\b((el\\s+)?(d[ií]a\\s+antes\\s+de\\s+ayer|anteayer)|((el\\s+)?d[ií]a\\s+(despu[eé]s\\s+)?de\\s+mañana|pasado\\s+mañana)|(el\\s)?d[ií]a siguiente|(el\\s)?pr[oó]ximo\\s+d[ií]a|(el\\s+)?[uú]ltimo d[ií]a|(d)?el d[ií]a|ayer|mañana|hoy)\\b`; + SpanishDateTime.SpecialDayWithNumRegex = `^[.]`; + SpanishDateTime.ForTheRegex = `^[.]`; + SpanishDateTime.WeekDayAndDayOfMonthRegex = `^[.]`; + SpanishDateTime.WeekDayOfMonthRegex = `(?(el\\s+)?(?primer|1er|segundo|2do|tercer|3er|cuarto|4to|quinto|5to|[uú]ltimo)\\s+${SpanishDateTime.WeekDayRegex}\\s+${SpanishDateTime.MonthSuffixRegex})`; + SpanishDateTime.RelativeWeekDayRegex = `^[.]`; + SpanishDateTime.NumberEndingPattern = `^[.]`; + SpanishDateTime.SpecialDateRegex = `(?<=\\b(en)\\s+el\\s+)${SpanishDateTime.DayRegex}\\b`; + SpanishDateTime.OfMonthRegex = `^\\s*de\\s*${SpanishDateTime.MonthSuffixRegex}`; + SpanishDateTime.MonthEndRegex = `(${SpanishDateTime.MonthRegex}\\s*(el)?\\s*$)`; + SpanishDateTime.WeekDayEnd = `${SpanishDateTime.WeekDayRegex}\\s*,?\\s*$`; + SpanishDateTime.DateYearRegex = `(?${SpanishDateTime.YearRegex}|${SpanishDateTime.TwoDigitYearRegex})`; + SpanishDateTime.DateExtractor1 = `\\b(${SpanishDateTime.WeekDayRegex}(\\s+|\\s*,\\s*))?${SpanishDateTime.DayRegex}?((\\s*(de)|[/\\\\\\.\\-])\\s*)?${SpanishDateTime.MonthRegex}\\b`; + SpanishDateTime.DateExtractor2 = `\\b(${SpanishDateTime.WeekDayRegex}(\\s+|\\s*,\\s*))?${SpanishDateTime.DayRegex}\\s*([\\.\\-]|de)\\s*${SpanishDateTime.MonthRegex}(\\s*,\\s*|\\s*(del?)\\s*)${SpanishDateTime.DateYearRegex}\\b`; + SpanishDateTime.DateExtractor3 = `\\b(${SpanishDateTime.WeekDayRegex}(\\s+|\\s*,\\s*))?${SpanishDateTime.DayRegex}(\\s+|\\s*,\\s*|\\s+de\\s+|\\s*-\\s*)${SpanishDateTime.MonthRegex}((\\s+|\\s*,\\s*)${SpanishDateTime.DateYearRegex})?\\b`; + SpanishDateTime.DateExtractor4 = `\\b${SpanishDateTime.MonthNumRegex}\\s*[/\\\\\\-]\\s*${SpanishDateTime.DayRegex}\\s*[/\\\\\\-]\\s*${SpanishDateTime.DateYearRegex}`; + SpanishDateTime.DateExtractor5 = `\\b${SpanishDateTime.DayRegex}\\s*[/\\\\\\-\\.]\\s*${SpanishDateTime.MonthNumRegex}\\s*[/\\\\\\-\\.]\\s*${SpanishDateTime.DateYearRegex}`; + SpanishDateTime.DateExtractor6 = `(?<=\\b(en|el)\\s+)${SpanishDateTime.MonthNumRegex}[\\-\\.]${SpanishDateTime.DayRegex}\\b`; + SpanishDateTime.DateExtractor7 = `\\b${SpanishDateTime.MonthNumRegex}\\s*/\\s*${SpanishDateTime.DayRegex}((\\s+|\\s*,\\s*|\\s+de\\s+)${SpanishDateTime.DateYearRegex})?\\b`; + SpanishDateTime.DateExtractor8 = `(?<=\\b(en|el)\\s+)${SpanishDateTime.DayRegex}[\\\\\\-]${SpanishDateTime.MonthNumRegex}\\b`; + SpanishDateTime.DateExtractor9 = `\\b${SpanishDateTime.DayRegex}\\s*/\\s*${SpanishDateTime.MonthNumRegex}((\\s+|\\s*,\\s*|\\s+de\\s+)${SpanishDateTime.DateYearRegex})?\\b`; + SpanishDateTime.DateExtractor10 = `\\b${SpanishDateTime.YearRegex}\\s*[/\\\\\\-\\.]\\s*${SpanishDateTime.MonthNumRegex}\\s*[/\\\\\\-\\.]\\s*${SpanishDateTime.DayRegex}`; + SpanishDateTime.HourNumRegex = `\\b(?cero|una|dos|tres|cuatro|cinco|seis|siete|ocho|nueve|diez|once|doce)\\b`; + SpanishDateTime.MinuteNumRegex = `(?un|dos|tres|cuatro|cinco|seis|siete|ocho|nueve|diez|once|doce|trece|catorce|quince|dieciseis|diecisiete|dieciocho|diecinueve|veinte|treinta|cuarenta|cincuenta)`; + SpanishDateTime.DeltaMinuteNumRegex = `(?un|dos|tres|cuatro|cinco|seis|siete|ocho|nueve|diez|once|doce|trece|catorce|quince|dieciseis|diecisiete|dieciocho|diecinueve|veinte|treinta|cuarenta|cincuenta)`; + SpanishDateTime.OclockRegex = `(?en\\s+punto)`; + SpanishDateTime.PmRegex = `(?((por|de|a|en)\\s+la)\\s+(tarde|noche))`; + SpanishDateTime.AmRegex = `(?((por|de|a|en)\\s+la)\\s+(mañana|madrugada))`; + SpanishDateTime.AmTimeRegex = `(?(esta|(por|de|a|en)\\s+la)\\s+(mañana|madrugada))`; + SpanishDateTime.PmTimeRegex = `(?(esta|(por|de|a|en)\\s+la)\\s+(tarde|noche))`; + SpanishDateTime.LessThanOneHour = `(?((\\s+y\\s+)?cuarto|(\\s*)menos cuarto|(\\s+y\\s+)media|${baseDateTime.BaseDateTime.DeltaMinuteRegex}(\\s+(minuto|minutos|min|mins))|${SpanishDateTime.DeltaMinuteNumRegex}(\\s+(minuto|minutos|min|mins))))`; + SpanishDateTime.TensTimeRegex = `(?diez|veint(i|e)|treinta|cuarenta|cincuenta)`; + SpanishDateTime.WrittenTimeRegex = `(?${SpanishDateTime.HourNumRegex}\\s*((y|menos)\\s+)?(${SpanishDateTime.MinuteNumRegex}|(${SpanishDateTime.TensTimeRegex}((\\s*y\\s+)?${SpanishDateTime.MinuteNumRegex})?)))`; + SpanishDateTime.TimePrefix = `(?${SpanishDateTime.LessThanOneHour}(\\s+(pasad[ao]s)\\s+(de\\s+las|las)?|\\s+(para|antes\\s+de)?\\s+(las?))?)`; + SpanishDateTime.TimeSuffix = `(?(${SpanishDateTime.LessThanOneHour}\\s+)?(${SpanishDateTime.AmRegex}|${SpanishDateTime.PmRegex}|${SpanishDateTime.OclockRegex}))`; + SpanishDateTime.BasicTime = `(?${SpanishDateTime.WrittenTimeRegex}|${SpanishDateTime.HourNumRegex}|${baseDateTime.BaseDateTime.HourRegex}:${baseDateTime.BaseDateTime.MinuteRegex}(:${baseDateTime.BaseDateTime.SecondRegex})?|${baseDateTime.BaseDateTime.HourRegex})`; + SpanishDateTime.AtRegex = `\\b(?<=\\b(a las?)\\s+)(${SpanishDateTime.WrittenTimeRegex}|${SpanishDateTime.HourNumRegex}|${baseDateTime.BaseDateTime.HourRegex})\\b`; + SpanishDateTime.ConnectNumRegex = `(${baseDateTime.BaseDateTime.HourRegex}(?00|01|02|03|04|05|06|07|08|09|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)\\s*${SpanishDateTime.DescRegex})`; + SpanishDateTime.TimeRegex1 = `(\\b${SpanishDateTime.TimePrefix}\\s+)?(${SpanishDateTime.WrittenTimeRegex}|${SpanishDateTime.HourNumRegex}|${baseDateTime.BaseDateTime.HourRegex})\\s*(${SpanishDateTime.DescRegex})`; + SpanishDateTime.TimeRegex2 = `(\\b${SpanishDateTime.TimePrefix}\\s+)?(T)?${baseDateTime.BaseDateTime.HourRegex}(\\s*)?:(\\s*)?${baseDateTime.BaseDateTime.MinuteRegex}((\\s*)?:(\\s*)?${baseDateTime.BaseDateTime.SecondRegex})?((\\s*${SpanishDateTime.DescRegex})|\\b)`; + SpanishDateTime.TimeRegex3 = `(\\b${SpanishDateTime.TimePrefix}\\s+)?${baseDateTime.BaseDateTime.HourRegex}\\.${baseDateTime.BaseDateTime.MinuteRegex}(\\s*${SpanishDateTime.DescRegex})`; + SpanishDateTime.TimeRegex4 = `\\b((${SpanishDateTime.DescRegex}?)|(${SpanishDateTime.BasicTime}?)(${SpanishDateTime.DescRegex}?))(${SpanishDateTime.TimePrefix}\\s*)(${SpanishDateTime.HourNumRegex}|${baseDateTime.BaseDateTime.HourRegex})?(\\s+${SpanishDateTime.TensTimeRegex}(\\s+y\\s+)?${SpanishDateTime.MinuteNumRegex}?)?(${SpanishDateTime.OclockRegex})?\\b`; + SpanishDateTime.TimeRegex5 = `\\b(${SpanishDateTime.TimePrefix}|${SpanishDateTime.BasicTime}${SpanishDateTime.TimePrefix})\\s+(\\s*${SpanishDateTime.DescRegex})?${SpanishDateTime.BasicTime}?\\s*${SpanishDateTime.TimeSuffix}\\b`; + SpanishDateTime.TimeRegex6 = `(${SpanishDateTime.BasicTime}(\\s*${SpanishDateTime.DescRegex})?\\s+${SpanishDateTime.TimeSuffix}\\b)`; + SpanishDateTime.TimeRegex7 = `\\b${SpanishDateTime.TimeSuffix}\\s+a\\s+las\\s+${SpanishDateTime.BasicTime}((\\s*${SpanishDateTime.DescRegex})|\\b)`; + SpanishDateTime.TimeRegex8 = `\\b${SpanishDateTime.TimeSuffix}\\s+${SpanishDateTime.BasicTime}((\\s*${SpanishDateTime.DescRegex})|\\b)`; + SpanishDateTime.TimeRegex9 = `\\b(?${SpanishDateTime.HourNumRegex}\\s+(${SpanishDateTime.TensTimeRegex}\\s*)?(y\\s+)?${SpanishDateTime.MinuteNumRegex}?)\\b`; + SpanishDateTime.TimeRegex10 = `(a\\s+la|al)\\s+(madrugada|mañana|medio\\s*d[ií]a|tarde|noche)`; + SpanishDateTime.TimeRegex11 = `\\b(${SpanishDateTime.WrittenTimeRegex})(${SpanishDateTime.DescRegex}?)\\b`; + SpanishDateTime.TimeRegex12 = `(\\b${SpanishDateTime.TimePrefix}\\s+)?${baseDateTime.BaseDateTime.HourRegex}(\\s*h\\s*)${baseDateTime.BaseDateTime.MinuteRegex}(\\s*${SpanishDateTime.DescRegex})?`; + SpanishDateTime.PrepositionRegex = `(?(a(l)?|en|de(l)?)?(\\s*(la(s)?|el|los))?$)`; + SpanishDateTime.NowRegex = `\\b(?(justo\\s+)?ahora(\\s+mismo)?|en\\s+este\\s+momento|tan\\s+pronto\\s+como\\s+sea\\s+posible|tan\\s+pronto\\s+como\\s+(pueda|puedas|podamos|puedan)|lo\\s+m[aá]s\\s+pronto\\s+posible|recientemente|previamente)\\b`; + SpanishDateTime.SuffixRegex = `^\\s*(((y|a|en|por)\\s+la|al)\\s+)?(mañana|madrugada|medio\\s*d[ií]a|tarde|noche)\\b`; + SpanishDateTime.TimeOfDayRegex = `\\b(?mañana|madrugada|(pasado\\s+(el\\s+)?)?medio\\s?d[ií]a|tarde|noche|anoche)\\b`; + SpanishDateTime.SpecificTimeOfDayRegex = `\\b(((((a)?\\s+la|esta|siguiente|pr[oó]xim[oa]|[uú]ltim[oa])\\s+)?${SpanishDateTime.TimeOfDayRegex}))\\b`; + SpanishDateTime.TimeOfTodayAfterRegex = `^\\s*(,\\s*)?(en|de(l)?\\s+)?${SpanishDateTime.SpecificTimeOfDayRegex}`; + SpanishDateTime.TimeOfTodayBeforeRegex = `(${SpanishDateTime.SpecificTimeOfDayRegex}(\\s*,)?(\\s+(a\\s+la(s)?|para))?\\s*)`; + SpanishDateTime.SimpleTimeOfTodayAfterRegex = `(${SpanishDateTime.HourNumRegex}|${baseDateTime.BaseDateTime.HourRegex})\\s*(,\\s*)?((en|de(l)?)?\\s+)?${SpanishDateTime.SpecificTimeOfDayRegex}`; + SpanishDateTime.SimpleTimeOfTodayBeforeRegex = `(${SpanishDateTime.SpecificTimeOfDayRegex}(\\s*,)?(\\s+(a\\s+la|para))?\\s*(${SpanishDateTime.HourNumRegex}|${baseDateTime.BaseDateTime.HourRegex}))`; + SpanishDateTime.TheEndOfRegex = `((a|e)l\\s+)?fin(alizar|al)?(\\s+(el|de(l)?)(\\s+d[ií]a)?(\\s+de)?)?\\s*$`; + SpanishDateTime.UnitRegex = `(?años|año|meses|mes|semanas|semana|d[ií]as|d[ií]a|horas|hora|h|hr|hrs|hs|minutos|minuto|mins|min|segundos|segundo|segs|seg)\\b`; + SpanishDateTime.ConnectorRegex = `^(,|t|para la|para las|cerca de la|cerca de las)$`; + SpanishDateTime.TimeHourNumRegex = `(?veintiuno|veintidos|veintitres|veinticuatro|cero|uno|dos|tres|cuatro|cinco|seis|siete|ocho|nueve|diez|once|doce|trece|catorce|quince|diecis([eé])is|diecisiete|dieciocho|diecinueve|veinte)`; + SpanishDateTime.PureNumFromTo = `((desde|de)\\s+(la(s)?\\s+)?)?(${baseDateTime.BaseDateTime.HourRegex}|${SpanishDateTime.TimeHourNumRegex})(\\s*(?${SpanishDateTime.DescRegex}))?\\s*${SpanishDateTime.TillRegex}\\s*(${baseDateTime.BaseDateTime.HourRegex}|${SpanishDateTime.TimeHourNumRegex})\\s*(?${SpanishDateTime.PmRegex}|${SpanishDateTime.AmRegex}|${SpanishDateTime.DescRegex})?`; + SpanishDateTime.PureNumBetweenAnd = `(entre\\s+(la(s)?\\s+)?)(${baseDateTime.BaseDateTime.HourRegex}|${SpanishDateTime.TimeHourNumRegex})(\\s*(?${SpanishDateTime.DescRegex}))?\\s*y\\s*(la(s)?\\s+)?(${baseDateTime.BaseDateTime.HourRegex}|${SpanishDateTime.TimeHourNumRegex})\\s*(?${SpanishDateTime.PmRegex}|${SpanishDateTime.AmRegex}|${SpanishDateTime.DescRegex})?`; + SpanishDateTime.SpecificTimeFromTo = `^[.]`; + SpanishDateTime.SpecificTimeBetweenAnd = `^[.]`; + SpanishDateTime.TimeUnitRegex = `(?horas|hora|h|minutos|minuto|mins|min|segundos|segundo|secs|sec)\\b`; + SpanishDateTime.TimeFollowedUnit = `^\\s*${SpanishDateTime.TimeUnitRegex}`; + SpanishDateTime.TimeNumberCombinedWithUnit = `\\b(?\\d+(\\,\\d*)?)\\s*${SpanishDateTime.TimeUnitRegex}`; + SpanishDateTime.DateTimePeriodNumberCombinedWithUnit = `\\b(?\\d+(\\.\\d*)?)\\s*${SpanishDateTime.TimeUnitRegex}`; + SpanishDateTime.PeriodTimeOfDayWithDateRegex = `\\b(((y|a|en|por)\\s+la|al)\\s+)?(?mañana|madrugada|(pasado\\s+(el\\s+)?)?medio\\s?d[ií]a|tarde|noche|anoche)\\b`; + SpanishDateTime.RelativeTimeUnitRegex = `(${SpanishDateTime.PastRegex}|${SpanishDateTime.FutureRegex})\\s+${SpanishDateTime.UnitRegex}`; + SpanishDateTime.LessThanRegex = `^[.]`; + SpanishDateTime.MoreThanRegex = `^[.]`; + SpanishDateTime.SuffixAndRegex = `(?\\s*(y)\\s+((un|uno|una)\\s+)?(?media|cuarto))`; + SpanishDateTime.FollowedUnit = `^\\s*${SpanishDateTime.UnitRegex}`; + SpanishDateTime.DurationNumberCombinedWithUnit = `\\b(?\\d+(\\,\\d*)?)${SpanishDateTime.UnitRegex}`; + SpanishDateTime.AnUnitRegex = `\\b(un(a)?)\\s+${SpanishDateTime.UnitRegex}`; + SpanishDateTime.DuringRegex = `^[.]`; + SpanishDateTime.AllRegex = `\\b(?tod[oa]?\\s+(el|la)\\s+(?año|mes|semana|d[ií]a))\\b`; + SpanishDateTime.HalfRegex = `\\b(?medi[oa]\\s+(?ano|mes|semana|d[íi]a|hora))\\b`; + SpanishDateTime.ConjunctionRegex = `^[.]`; + SpanishDateTime.InexactNumberRegex = `\\b(pocos|poco|algo|varios)\\b`; + SpanishDateTime.InexactNumberUnitRegex = `\\b(pocos|poco|algo|varios)\\s+${SpanishDateTime.UnitRegex}`; + SpanishDateTime.HolidayRegex1 = `\\b(?viernes santo|mi[eé]rcoles de ceniza|martes de carnaval|d[ií]a (de|de los) presidentes?|clebraci[oó]n de mao|año nuevo chino|año nuevo|noche vieja|(festividad de )?los mayos|d[ií]a de los inocentes|navidad|noche buena|d[ií]a de acci[oó]n de gracias|acci[oó]n de gracias|yuandan|halloween|noches de brujas|pascuas)(\\s+(del?\\s+)?(${SpanishDateTime.YearRegex}|(?(pr[oó]xim[oa]?|est[ea]|[uú]ltim[oa]?|en))\\s+año))?\\b`; + SpanishDateTime.HolidayRegex2 = `\\b(?(d[ií]a( del?( la)?)? )?(martin luther king|todos los santos|blanco|san patricio|san valent[ií]n|san jorge|cinco de mayo|independencia|raza|trabajador))(\\s+(del?\\s+)?(${SpanishDateTime.YearRegex}|(?(pr[oó]xim[oa]?|est[ea]|[uú]ltim[oa]?|en))\\s+año))?\\b`; + SpanishDateTime.HolidayRegex3 = `\\b(?(d[ií]a( del?( las?)?)? )(trabajador|madres?|padres?|[aá]rbol|mujer(es)?|solteros?|niños?|marmota|san valent[ií]n|maestro))(\\s+(del?\\s+)?(${SpanishDateTime.YearRegex}|(?(pr[oó]xim[oa]?|est[ea]|[uú]ltim[oa]?|en))\\s+año))?\\b`; + SpanishDateTime.BeforeRegex = `(antes(\\s+del?(\\s+las?)?)?)`; + SpanishDateTime.AfterRegex = `(despues(\\s*del?(\\s+las?)?)?)`; + SpanishDateTime.SinceRegex = `(desde(\\s+(las?|el))?)`; + SpanishDateTime.AroundRegex = `^[.]`; + SpanishDateTime.PeriodicRegex = `\\b(?a\\s*diario|diariamente|mensualmente|semanalmente|quincenalmente|anualmente)\\b`; + SpanishDateTime.EachExpression = `cada|tod[oa]s\\s*(l[oa]s)?`; + SpanishDateTime.EachUnitRegex = `(?(${SpanishDateTime.EachExpression})\\s*${SpanishDateTime.UnitRegex})`; + SpanishDateTime.EachPrefixRegex = `(?(${SpanishDateTime.EachExpression})\\s*$)`; + SpanishDateTime.EachDayRegex = `\\s*(${SpanishDateTime.EachExpression})\\s*d[ií]as\\s*\\b`; + SpanishDateTime.BeforeEachDayRegex = `(${SpanishDateTime.EachExpression})\\s*d[ií]as(\\s+a\\s+las?)?\\s*\\b`; + SpanishDateTime.SetEachRegex = `(?(${SpanishDateTime.EachExpression})\\s*)`; + SpanishDateTime.LaterEarlyPeriodRegex = `^[.]`; + SpanishDateTime.WeekWithWeekDayRangeRegex = `^[.]`; + SpanishDateTime.GeneralEndingRegex = `^[.]`; + SpanishDateTime.MiddlePauseRegex = `^[.]`; + SpanishDateTime.PrefixArticleRegex = `^[\\.]`; + SpanishDateTime.OrRegex = `^[.]`; + SpanishDateTime.YearPlusNumberRegex = `^[.]`; + SpanishDateTime.NumberAsTimeRegex = `^[.]`; + SpanishDateTime.TimeBeforeAfterRegex = `^[.]`; + SpanishDateTime.DateNumberConnectorRegex = `^[.]`; + SpanishDateTime.CenturyRegex = `^[.]`; + SpanishDateTime.DecadeRegex = `^[.]`; + SpanishDateTime.DecadeWithCenturyRegex = `^[.]`; + SpanishDateTime.RelativeDecadeRegex = `^[.]`; + SpanishDateTime.ComplexDatePeriodRegex = `^[.]`; + SpanishDateTime.YearSuffix = `(,?\\s*(${SpanishDateTime.YearRegex}|${SpanishDateTime.FullTextYearRegex}))`; + SpanishDateTime.AgoRegex = `\\b(antes)\\b`; + SpanishDateTime.LaterRegex = `\\b(despu[eé]s|desde ahora)\\b`; + SpanishDateTime.Tomorrow = 'mañana'; + SpanishDateTime.UnitMap = new Map([["años", "Y"], ["año", "Y"], ["meses", "MON"], ["mes", "MON"], ["semanas", "W"], ["semana", "W"], ["dias", "D"], ["dia", "D"], ["días", "D"], ["día", "D"], ["horas", "H"], ["hora", "H"], ["hrs", "H"], ["hr", "H"], ["h", "H"], ["minutos", "M"], ["minuto", "M"], ["mins", "M"], ["min", "M"], ["segundos", "S"], ["segundo", "S"], ["segs", "S"], ["seg", "S"]]); + SpanishDateTime.UnitValueMap = new Map([["años", 31536000], ["año", 31536000], ["meses", 2592000], ["mes", 2592000], ["semanas", 604800], ["semana", 604800], ["dias", 86400], ["dia", 86400], ["días", 86400], ["día", 86400], ["horas", 3600], ["hora", 3600], ["hrs", 3600], ["hr", 3600], ["h", 3600], ["minutos", 60], ["minuto", 60], ["mins", 60], ["min", 60], ["segundos", 1], ["segundo", 1], ["segs", 1], ["seg", 1]]); + SpanishDateTime.SeasonMap = new Map([["primavera", "SP"], ["verano", "SU"], ["otoño", "FA"], ["invierno", "WI"]]); + SpanishDateTime.SeasonValueMap = new Map([["SP", 3], ["SU", 6], ["FA", 9], ["WI", 12]]); + SpanishDateTime.CardinalMap = new Map([["primer", 1], ["primero", 1], ["primera", 1], ["1er", 1], ["1ro", 1], ["1ra", 1], ["segundo", 2], ["segunda", 2], ["2do", 2], ["2da", 2], ["tercer", 3], ["tercero", 3], ["tercera", 3], ["3er", 3], ["3ro", 3], ["3ra", 3], ["cuarto", 4], ["cuarta", 4], ["4to", 4], ["4ta", 4], ["quinto", 5], ["quinta", 5], ["5to", 5], ["5ta", 5]]); + SpanishDateTime.DayOfWeek = new Map([["lunes", 1], ["martes", 2], ["miercoles", 3], ["miércoles", 3], ["jueves", 4], ["viernes", 5], ["sabado", 6], ["domingo", 0], ["lu", 1], ["ma", 2], ["mi", 3], ["ju", 4], ["vi", 5], ["sa", 6], ["do", 0]]); + SpanishDateTime.MonthOfYear = new Map([["1", 1], ["2", 2], ["3", 3], ["4", 4], ["5", 5], ["6", 6], ["7", 7], ["8", 8], ["9", 9], ["10", 10], ["11", 11], ["12", 12], ["enero", 1], ["febrero", 2], ["marzo", 3], ["abril", 4], ["mayo", 5], ["junio", 6], ["julio", 7], ["agosto", 8], ["septiembre", 9], ["setiembre", 9], ["octubre", 10], ["noviembre", 11], ["diciembre", 12], ["ene", 1], ["feb", 2], ["mar", 3], ["abr", 4], ["may", 5], ["jun", 6], ["jul", 7], ["ago", 8], ["sept", 9], ["set", 9], ["oct", 10], ["nov", 11], ["dic", 12], ["01", 1], ["02", 2], ["03", 3], ["04", 4], ["05", 5], ["06", 6], ["07", 7], ["08", 8], ["09", 9]]); + SpanishDateTime.Numbers = new Map([["cero", 0], ["un", 1], ["una", 1], ["uno", 1], ["dos", 2], ["tres", 3], ["cuatro", 4], ["cinco", 5], ["seis", 6], ["siete", 7], ["ocho", 8], ["nueve", 9], ["diez", 10], ["once", 11], ["doce", 12], ["docena", 12], ["docenas", 12], ["trece", 13], ["catorce", 14], ["quince", 15], ["dieciseis", 16], ["dieciséis", 16], ["diecisiete", 17], ["dieciocho", 18], ["diecinueve", 19], ["veinte", 20], ["ventiuna", 21], ["ventiuno", 21], ["veintiun", 21], ["veintiún", 21], ["veintiuno", 21], ["veintiuna", 21], ["veintidos", 22], ["veintidós", 22], ["veintitres", 23], ["veintitrés", 23], ["veinticuatro", 24], ["veinticinco", 25], ["veintiseis", 26], ["veintiséis", 26], ["veintisiete", 27], ["veintiocho", 28], ["veintinueve", 29], ["treinta", 30]]); + SpanishDateTime.HolidayNames = new Map([["padres", ["diadelpadre"]], ["madres", ["diadelamadre"]], ["acciondegracias", ["diadegracias", "diadeacciondegracias", "acciondegracias"]], ["trabajador", ["diadeltrabajador"]], ["delaraza", ["diadelaraza", "diadeladiversidadcultural"]], ["memoria", ["diadelamemoria"]], ["pascuas", ["diadepascuas", "pascuas"]], ["navidad", ["navidad", "diadenavidad"]], ["nochebuena", ["diadenochebuena", "nochebuena"]], ["añonuevo", ["añonuevo", "diadeañonuevo"]], ["nochevieja", ["nochevieja", "diadenochevieja"]], ["yuandan", ["yuandan"]], ["maestro", ["diadelmaestro"]], ["todoslossantos", ["todoslossantos"]], ["niño", ["diadelniño"]], ["mujer", ["diadelamujer"]]]); + SpanishDateTime.VariableHolidaysTimexDictionary = new Map([["padres", "-06-WXX-7-3"], ["madres", "-05-WXX-7-2"], ["acciondegracias", "-11-WXX-4-4"], ["trabajador", "-05-WXX-1-1"], ["delaraza", "-10-WXX-1-2"], ["memoria", "-03-WXX-2-4"]]); + SpanishDateTime.DoubleNumbers = new Map([["mitad", 0.5], ["cuarto", 0.25]]); + SpanishDateTime.DateTokenPrefix = 'en '; + SpanishDateTime.TimeTokenPrefix = 'a las '; + SpanishDateTime.TokenBeforeDate = 'el '; + SpanishDateTime.TokenBeforeTime = 'la '; + SpanishDateTime.NextPrefixRegex = `(pr[oó]xim[oa]|siguiente)\\b`; + SpanishDateTime.PastPrefixRegex = `([uú]ltim[oa])\\b`; + SpanishDateTime.ThisPrefixRegex = `(est[ea])\\b`; + SpanishDateTime.RelativeDayRegex = `^[\\.]`; + SpanishDateTime.RestOfDateRegex = `^[\\.]`; + SpanishDateTime.RelativeDurationUnitRegex = `^[\\.]`; + SpanishDateTime.ReferenceDatePeriodRegex = `^[.]`; + SpanishDateTime.FromToRegex = `\\b(from).+(to)\\b.+`; + SpanishDateTime.SingleAmbiguousMonthRegex = `^(the\\s+)?(may|march)$`; + SpanishDateTime.UnspecificDatePeriodRegex = `^[.]`; + SpanishDateTime.PrepositionSuffixRegex = `\\b(on|in|at|around|for|during|since|from|to)$`; + SpanishDateTime.RestOfDateTimeRegex = `^[\\.]`; + SpanishDateTime.SetWeekDayRegex = `^[\\.]`; + SpanishDateTime.NightRegex = `\\b(medionoche|noche)\\b`; + SpanishDateTime.CommonDatePrefixRegex = `^[\\.]`; + SpanishDateTime.DurationUnitRegex = `^[\\.]`; + SpanishDateTime.DurationConnectorRegex = `^[.]`; + SpanishDateTime.YearAfterRegex = `^[.]`; + SpanishDateTime.YearPeriodRegex = `^[.]`; + SpanishDateTime.FutureSuffixRegex = `^[.]`; + SpanishDateTime.WrittenDecades = new Map([["", 0]]); + SpanishDateTime.SpecialDecadeCases = new Map([["", 0]]); + SpanishDateTime.DefaultLanguageFallback = 'DMY'; + SpanishDateTime.DurationDateRestrictions = []; +})(SpanishDateTime = exports.SpanishDateTime || (exports.SpanishDateTime = {})); + +}); + +unwrapExports(spanishDateTime); + +var durationConfiguration$2 = createCommonjsModule(function (module, exports) { +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); + + + +class SpanishDurationExtractorConfiguration { + constructor() { + this.allRegex = recognizersText.RegExpUtility.getSafeRegExp(spanishDateTime.SpanishDateTime.AllRegex, "gis"); + this.halfRegex = recognizersText.RegExpUtility.getSafeRegExp(spanishDateTime.SpanishDateTime.HalfRegex, "gis"); + this.followedUnit = recognizersText.RegExpUtility.getSafeRegExp(spanishDateTime.SpanishDateTime.FollowedUnit, "gis"); + this.numberCombinedWithUnit = recognizersText.RegExpUtility.getSafeRegExp(spanishDateTime.SpanishDateTime.DurationNumberCombinedWithUnit, "gis"); + this.anUnitRegex = recognizersText.RegExpUtility.getSafeRegExp(spanishDateTime.SpanishDateTime.AnUnitRegex, "gis"); + this.inexactNumberUnitRegex = recognizersText.RegExpUtility.getSafeRegExp(spanishDateTime.SpanishDateTime.InexactNumberUnitRegex, "gis"); + this.suffixAndRegex = recognizersText.RegExpUtility.getSafeRegExp(spanishDateTime.SpanishDateTime.SuffixAndRegex, "gis"); + this.relativeDurationUnitRegex = recognizersText.RegExpUtility.getSafeRegExp(spanishDateTime.SpanishDateTime.RelativeDurationUnitRegex, "gis"); + this.moreThanRegex = recognizersText.RegExpUtility.getSafeRegExp(spanishDateTime.SpanishDateTime.MoreThanRegex, "gis"); + this.lessThanRegex = recognizersText.RegExpUtility.getSafeRegExp(spanishDateTime.SpanishDateTime.LessThanOneHour, "gis"); + this.cardinalExtractor = new recognizersTextNumber.SpanishCardinalExtractor(); + } +} +exports.SpanishDurationExtractorConfiguration = SpanishDurationExtractorConfiguration; +class SpanishDurationParserConfiguration { + constructor(config) { + this.cardinalExtractor = config.cardinalExtractor; + this.numberParser = config.numberParser; + this.followedUnit = recognizersText.RegExpUtility.getSafeRegExp(spanishDateTime.SpanishDateTime.FollowedUnit); + this.suffixAndRegex = recognizersText.RegExpUtility.getSafeRegExp(spanishDateTime.SpanishDateTime.SuffixAndRegex); + this.numberCombinedWithUnit = recognizersText.RegExpUtility.getSafeRegExp(spanishDateTime.SpanishDateTime.DurationNumberCombinedWithUnit); + this.anUnitRegex = recognizersText.RegExpUtility.getSafeRegExp(spanishDateTime.SpanishDateTime.AnUnitRegex); + this.allDateUnitRegex = recognizersText.RegExpUtility.getSafeRegExp(spanishDateTime.SpanishDateTime.AllRegex); + this.halfDateUnitRegex = recognizersText.RegExpUtility.getSafeRegExp(spanishDateTime.SpanishDateTime.HalfRegex); + this.inexactNumberUnitRegex = recognizersText.RegExpUtility.getSafeRegExp(spanishDateTime.SpanishDateTime.InexactNumberUnitRegex); + this.unitMap = config.unitMap; + this.unitValueMap = config.unitValueMap; + this.doubleNumbers = config.doubleNumbers; + } +} +exports.SpanishDurationParserConfiguration = SpanishDurationParserConfiguration; + +}); + +unwrapExports(durationConfiguration$2); + +var timeConfiguration$2 = createCommonjsModule(function (module, exports) { +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); + + + + +class SpanishTimeExtractorConfiguration { + constructor() { + this.atRegex = recognizersText.RegExpUtility.getSafeRegExp(spanishDateTime.SpanishDateTime.AtRegex, "gis"); + this.ishRegex = null; + this.timeRegexList = SpanishTimeExtractorConfiguration.getTimeRegexList(); + this.durationExtractor = new baseDuration.BaseDurationExtractor(new durationConfiguration$2.SpanishDurationExtractorConfiguration()); + } + static getTimeRegexList() { + return [ + recognizersText.RegExpUtility.getSafeRegExp(spanishDateTime.SpanishDateTime.TimeRegex1, "gis"), + recognizersText.RegExpUtility.getSafeRegExp(spanishDateTime.SpanishDateTime.TimeRegex2, "gis"), + recognizersText.RegExpUtility.getSafeRegExp(spanishDateTime.SpanishDateTime.TimeRegex3, "gis"), + recognizersText.RegExpUtility.getSafeRegExp(spanishDateTime.SpanishDateTime.TimeRegex4, "gis"), + recognizersText.RegExpUtility.getSafeRegExp(spanishDateTime.SpanishDateTime.TimeRegex5, "gis"), + recognizersText.RegExpUtility.getSafeRegExp(spanishDateTime.SpanishDateTime.TimeRegex6, "gis"), + recognizersText.RegExpUtility.getSafeRegExp(spanishDateTime.SpanishDateTime.TimeRegex7, "gis"), + recognizersText.RegExpUtility.getSafeRegExp(spanishDateTime.SpanishDateTime.TimeRegex8, "gis"), + recognizersText.RegExpUtility.getSafeRegExp(spanishDateTime.SpanishDateTime.TimeRegex9, "gis"), + recognizersText.RegExpUtility.getSafeRegExp(spanishDateTime.SpanishDateTime.TimeRegex10, "gis"), + recognizersText.RegExpUtility.getSafeRegExp(spanishDateTime.SpanishDateTime.TimeRegex11, "gis"), + recognizersText.RegExpUtility.getSafeRegExp(spanishDateTime.SpanishDateTime.TimeRegex12, "gis"), + recognizersText.RegExpUtility.getSafeRegExp(spanishDateTime.SpanishDateTime.ConnectNumRegex, "gis") + ]; + } +} +exports.SpanishTimeExtractorConfiguration = SpanishTimeExtractorConfiguration; +class SpanishTimeParserConfiguration { + constructor(config) { + this.timeTokenPrefix = spanishDateTime.SpanishDateTime.TimeTokenPrefix; + this.atRegex = recognizersText.RegExpUtility.getSafeRegExp(spanishDateTime.SpanishDateTime.AtRegex, "gis"); + this.timeRegexes = SpanishTimeExtractorConfiguration.getTimeRegexList(); + this.lessThanOneHour = recognizersText.RegExpUtility.getSafeRegExp(spanishDateTime.SpanishDateTime.LessThanOneHour, "gis"); + this.timeSuffix = recognizersText.RegExpUtility.getSafeRegExp(spanishDateTime.SpanishDateTime.TimeSuffix, "gis"); + this.utilityConfiguration = config.utilityConfiguration; + this.numbers = config.numbers; + } + adjustByPrefix(prefix, adjust) { + let deltaMin = 0; + let trimedPrefix = prefix.trim().toLowerCase(); + if (trimedPrefix.startsWith("cuarto") || trimedPrefix.startsWith("y cuarto")) { + deltaMin = 15; + } + else if (trimedPrefix.startsWith("menos cuarto")) { + deltaMin = -15; + } + else if (trimedPrefix.startsWith("media") || trimedPrefix.startsWith("y media")) { + deltaMin = 30; + } + else { + let matches = recognizersText.RegExpUtility.getMatches(this.lessThanOneHour, trimedPrefix); + if (matches.length) { + let match = matches[0]; + let minStr = match.groups("deltamin").value; + if (minStr) { + deltaMin = parseInt(minStr, 10); + } + else { + minStr = match.groups("deltaminnum").value.toLowerCase(); + if (this.numbers.has(minStr)) { + deltaMin = this.numbers.get(minStr); + } + } + } + } + if (trimedPrefix.endsWith("pasadas") || trimedPrefix.endsWith("pasados") || + trimedPrefix.endsWith("pasadas las") || trimedPrefix.endsWith("pasados las") || + trimedPrefix.endsWith("pasadas de las") || trimedPrefix.endsWith("pasados de las")) { + // deltaMin it's positive + } + else if (trimedPrefix.endsWith("para la") || trimedPrefix.endsWith("para las") || + trimedPrefix.endsWith("antes de la") || trimedPrefix.endsWith("antes de las")) { + deltaMin = -deltaMin; + } + adjust.min += deltaMin; + if (adjust.min < 0) { + adjust.min += 60; + adjust.hour -= 1; + } + adjust.hasMin = adjust.hasMin || adjust.min !== 0; + } + adjustBySuffix(suffix, adjust) { + let trimedSuffix = suffix.trim().toLowerCase(); + this.adjustByPrefix(trimedSuffix, adjust); + let deltaHour = 0; + let matches = recognizersText.RegExpUtility.getMatches(this.timeSuffix, trimedSuffix); + if (matches.length) { + let match = matches[0]; + if (match.index === 0 && match.length === trimedSuffix.length) { + let oclockStr = match.groups("oclock").value; + if (!oclockStr) { + let amStr = match.groups("am").value; + if (amStr) { + if (adjust.hour >= 12) { + deltaHour = -12; + } + adjust.hasAm = true; + } + let pmStr = match.groups("pm").value; + if (pmStr) { + if (adjust.hour < 12) { + deltaHour = 12; + } + adjust.hasPm = true; + } + } + } + } + adjust.hour = (adjust.hour + deltaHour) % 24; + } +} +exports.SpanishTimeParserConfiguration = SpanishTimeParserConfiguration; + +}); + +unwrapExports(timeConfiguration$2); + +var dateTimeConfiguration$2 = createCommonjsModule(function (module, exports) { +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); + + + + + + + + + +class SpanishDateTimeExtractorConfiguration { + constructor() { + this.prepositionRegex = recognizersText.RegExpUtility.getSafeRegExp(spanishDateTime.SpanishDateTime.PrepositionRegex, "gis"); + this.nowRegex = recognizersText.RegExpUtility.getSafeRegExp(spanishDateTime.SpanishDateTime.NowRegex, "gis"); + this.suffixRegex = recognizersText.RegExpUtility.getSafeRegExp(spanishDateTime.SpanishDateTime.SuffixRegex, "gis"); + this.timeOfDayRegex = recognizersText.RegExpUtility.getSafeRegExp(spanishDateTime.SpanishDateTime.TimeOfDayRegex, "gis"); + this.specificTimeOfDayRegex = recognizersText.RegExpUtility.getSafeRegExp(spanishDateTime.SpanishDateTime.SpecificTimeOfDayRegex, "gis"); + this.timeOfTodayAfterRegex = recognizersText.RegExpUtility.getSafeRegExp(spanishDateTime.SpanishDateTime.TimeOfTodayAfterRegex, "gis"); + this.timeOfTodayBeforeRegex = recognizersText.RegExpUtility.getSafeRegExp(spanishDateTime.SpanishDateTime.TimeOfTodayBeforeRegex, "gis"); + this.simpleTimeOfTodayAfterRegex = recognizersText.RegExpUtility.getSafeRegExp(spanishDateTime.SpanishDateTime.SimpleTimeOfTodayAfterRegex, "gis"); + this.simpleTimeOfTodayBeforeRegex = recognizersText.RegExpUtility.getSafeRegExp(spanishDateTime.SpanishDateTime.SimpleTimeOfTodayBeforeRegex, "gis"); + this.theEndOfRegex = recognizersText.RegExpUtility.getSafeRegExp(spanishDateTime.SpanishDateTime.TheEndOfRegex, "gis"); + this.unitRegex = recognizersText.RegExpUtility.getSafeRegExp(spanishDateTime.SpanishDateTime.UnitRegex, "gis"); + this.connectorRegex = recognizersText.RegExpUtility.getSafeRegExp(spanishDateTime.SpanishDateTime.ConnectorRegex, "gis"); + this.nightRegex = recognizersText.RegExpUtility.getSafeRegExp(spanishDateTime.SpanishDateTime.NightRegex, "gis"); + this.datePointExtractor = new baseDate.BaseDateExtractor(new dateConfiguration$2.SpanishDateExtractorConfiguration()); + this.timePointExtractor = new baseTime.BaseTimeExtractor(new timeConfiguration$2.SpanishTimeExtractorConfiguration()); + this.durationExtractor = new baseDuration.BaseDurationExtractor(new durationConfiguration$2.SpanishDurationExtractorConfiguration()); + this.utilityConfiguration = new baseConfiguration$2.SpanishDateTimeUtilityConfiguration(); + } + isConnectorToken(source) { + let trimmed = source.trim(); + return trimmed === "" + || recognizersText.RegExpUtility.getFirstMatchIndex(this.prepositionRegex, source).matched + || recognizersText.RegExpUtility.getFirstMatchIndex(this.connectorRegex, source).matched; + } +} +exports.SpanishDateTimeExtractorConfiguration = SpanishDateTimeExtractorConfiguration; +class SpanishDateTimeParserConfiguration { + constructor(config) { + this.tokenBeforeDate = spanishDateTime.SpanishDateTime.TokenBeforeDate; + this.tokenBeforeTime = spanishDateTime.SpanishDateTime.TokenBeforeTime; + this.nowRegex = recognizersText.RegExpUtility.getSafeRegExp(spanishDateTime.SpanishDateTime.NowRegex, "gis"); + this.amTimeRegex = recognizersText.RegExpUtility.getSafeRegExp(spanishDateTime.SpanishDateTime.AmTimeRegex, "gis"); + this.pmTimeRegex = recognizersText.RegExpUtility.getSafeRegExp(spanishDateTime.SpanishDateTime.PmTimeRegex, "gis"); + this.simpleTimeOfTodayAfterRegex = recognizersText.RegExpUtility.getSafeRegExp(spanishDateTime.SpanishDateTime.SimpleTimeOfTodayAfterRegex, "gis"); + this.simpleTimeOfTodayBeforeRegex = recognizersText.RegExpUtility.getSafeRegExp(spanishDateTime.SpanishDateTime.SimpleTimeOfTodayBeforeRegex, "gis"); + this.specificTimeOfDayRegex = recognizersText.RegExpUtility.getSafeRegExp(spanishDateTime.SpanishDateTime.SpecificTimeOfDayRegex, "gis"); + this.theEndOfRegex = recognizersText.RegExpUtility.getSafeRegExp(spanishDateTime.SpanishDateTime.TheEndOfRegex, "gis"); + this.unitRegex = recognizersText.RegExpUtility.getSafeRegExp(spanishDateTime.SpanishDateTime.UnitRegex, "gis"); + this.nextPrefixRegex = recognizersText.RegExpUtility.getSafeRegExp(spanishDateTime.SpanishDateTime.NextPrefixRegex, "gis"); + this.pastPrefixRegex = recognizersText.RegExpUtility.getSafeRegExp(spanishDateTime.SpanishDateTime.PastPrefixRegex, "gis"); + this.dateExtractor = config.dateExtractor; + this.timeExtractor = config.timeExtractor; + this.dateParser = config.dateParser; + this.timeParser = config.timeParser; + this.numbers = config.numbers; + this.cardinalExtractor = config.cardinalExtractor; + this.numberParser = config.numberParser; + this.durationExtractor = config.durationExtractor; + this.durationParser = config.durationParser; + this.unitMap = config.unitMap; + this.utilityConfiguration = config.utilityConfiguration; + } + haveAmbiguousToken(text, matchedText) { + return text.toLowerCase().includes("esta mañana") + && matchedText.toLocaleLowerCase().includes("mañana"); + } + getMatchedNowTimex(text) { + let trimedText = text.trim().toLowerCase(); + let timex = ""; + if (trimedText.endsWith("ahora") || trimedText.endsWith("mismo") || trimedText.endsWith("momento")) { + timex = "PRESENT_REF"; + } + else if (trimedText.endsWith("posible") || trimedText.endsWith("pueda") || + trimedText.endsWith("puedas") || trimedText.endsWith("podamos") || trimedText.endsWith("puedan")) { + timex = "FUTURE_REF"; + } + else if (trimedText.endsWith("mente")) { + timex = "PAST_REF"; + } + else { + return { + matched: false, + timex: null + }; + } + return { + matched: true, + timex: timex + }; + } + getSwiftDay(text) { + let trimedText = text.trim().toLowerCase(); + let swift = 0; + if (recognizersText.RegExpUtility.getFirstMatchIndex(this.pastPrefixRegex, trimedText).matched) { + swift = -1; + } + else if (recognizersText.RegExpUtility.getFirstMatchIndex(this.nextPrefixRegex, trimedText).matched) { + swift = 1; + } + return swift; + } + getHour(text, hour) { + let trimedText = text.trim().toLowerCase(); + let result = hour; + // TODO: Replace with a regex + if ((trimedText.endsWith("mañana") || trimedText.endsWith("madrugada")) && hour >= 12) { + result -= 12; + } + else if (!(trimedText.endsWith("mañana") || trimedText.endsWith("madrugada")) && hour < 12) { + result += 12; + } + return result; + } +} +exports.SpanishDateTimeParserConfiguration = SpanishDateTimeParserConfiguration; + +}); + +unwrapExports(dateTimeConfiguration$2); + +var datePeriodConfiguration$2 = createCommonjsModule(function (module, exports) { +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); + + + + + + + + +class SpanishDatePeriodExtractorConfiguration { + constructor() { + this.simpleCasesRegexes = [ + recognizersText.RegExpUtility.getSafeRegExp(spanishDateTime.SpanishDateTime.SimpleCasesRegex), + recognizersText.RegExpUtility.getSafeRegExp(spanishDateTime.SpanishDateTime.DayBetweenRegex), + recognizersText.RegExpUtility.getSafeRegExp(spanishDateTime.SpanishDateTime.SimpleCasesRegex), + recognizersText.RegExpUtility.getSafeRegExp(spanishDateTime.SpanishDateTime.DayBetweenRegex), + recognizersText.RegExpUtility.getSafeRegExp(spanishDateTime.SpanishDateTime.OneWordPeriodRegex), + recognizersText.RegExpUtility.getSafeRegExp(spanishDateTime.SpanishDateTime.MonthWithYearRegex), + recognizersText.RegExpUtility.getSafeRegExp(spanishDateTime.SpanishDateTime.MonthNumWithYearRegex), + recognizersText.RegExpUtility.getSafeRegExp(spanishDateTime.SpanishDateTime.YearRegex), + recognizersText.RegExpUtility.getSafeRegExp(spanishDateTime.SpanishDateTime.WeekOfMonthRegex), + recognizersText.RegExpUtility.getSafeRegExp(spanishDateTime.SpanishDateTime.WeekOfYearRegex), + recognizersText.RegExpUtility.getSafeRegExp(spanishDateTime.SpanishDateTime.MonthFrontBetweenRegex), + recognizersText.RegExpUtility.getSafeRegExp(spanishDateTime.SpanishDateTime.MonthFrontSimpleCasesRegex), + recognizersText.RegExpUtility.getSafeRegExp(spanishDateTime.SpanishDateTime.QuarterRegex), + recognizersText.RegExpUtility.getSafeRegExp(spanishDateTime.SpanishDateTime.QuarterRegexYearFront), + recognizersText.RegExpUtility.getSafeRegExp(spanishDateTime.SpanishDateTime.AllHalfYearRegex), + recognizersText.RegExpUtility.getSafeRegExp(spanishDateTime.SpanishDateTime.SeasonRegex), + recognizersText.RegExpUtility.getSafeRegExp(spanishDateTime.SpanishDateTime.RestOfDateRegex), + recognizersText.RegExpUtility.getSafeRegExp(spanishDateTime.SpanishDateTime.LaterEarlyPeriodRegex), + recognizersText.RegExpUtility.getSafeRegExp(spanishDateTime.SpanishDateTime.WeekWithWeekDayRangeRegex) + ]; + this.illegalYearRegex = recognizersText.RegExpUtility.getSafeRegExp(baseDateTime.BaseDateTime.IllegalYearRegex); + this.YearRegex = recognizersText.RegExpUtility.getSafeRegExp(spanishDateTime.SpanishDateTime.YearRegex); + this.tillRegex = recognizersText.RegExpUtility.getSafeRegExp(spanishDateTime.SpanishDateTime.TillRegex); + this.followedUnit = recognizersText.RegExpUtility.getSafeRegExp(spanishDateTime.SpanishDateTime.FollowedDateUnit); + this.numberCombinedWithUnit = recognizersText.RegExpUtility.getSafeRegExp(spanishDateTime.SpanishDateTime.NumberCombinedWithDateUnit); + this.pastRegex = recognizersText.RegExpUtility.getSafeRegExp(spanishDateTime.SpanishDateTime.PastRegex); + this.futureRegex = recognizersText.RegExpUtility.getSafeRegExp(spanishDateTime.SpanishDateTime.FutureRegex); + this.weekOfRegex = recognizersText.RegExpUtility.getSafeRegExp(spanishDateTime.SpanishDateTime.WeekOfRegex); + this.monthOfRegex = recognizersText.RegExpUtility.getSafeRegExp(spanishDateTime.SpanishDateTime.MonthOfRegex); + this.dateUnitRegex = recognizersText.RegExpUtility.getSafeRegExp(spanishDateTime.SpanishDateTime.DateUnitRegex); + this.inConnectorRegex = recognizersText.RegExpUtility.getSafeRegExp(spanishDateTime.SpanishDateTime.InConnectorRegex); + this.rangeUnitRegex = recognizersText.RegExpUtility.getSafeRegExp(spanishDateTime.SpanishDateTime.RangeUnitRegex); + this.fromRegex = recognizersText.RegExpUtility.getSafeRegExp(spanishDateTime.SpanishDateTime.FromRegex); + this.connectorAndRegex = recognizersText.RegExpUtility.getSafeRegExp(spanishDateTime.SpanishDateTime.ConnectorAndRegex); + this.betweenRegex = recognizersText.RegExpUtility.getSafeRegExp(spanishDateTime.SpanishDateTime.BetweenRegex); + this.datePointExtractor = new baseDate.BaseDateExtractor(new dateConfiguration$2.SpanishDateExtractorConfiguration()); + this.integerExtractor = new recognizersTextNumber.SpanishIntegerExtractor(); + this.numberParser = new recognizersTextNumber.BaseNumberParser(new recognizersTextNumber.SpanishNumberParserConfiguration()); + this.durationExtractor = new baseDuration.BaseDurationExtractor(new durationConfiguration$2.SpanishDurationExtractorConfiguration()); + } + getFromTokenIndex(source) { + return recognizersText.RegExpUtility.getFirstMatchIndex(this.fromRegex, source); + } + getBetweenTokenIndex(source) { + return recognizersText.RegExpUtility.getFirstMatchIndex(this.betweenRegex, source); + } + hasConnectorToken(source) { + return recognizersText.RegExpUtility.getFirstMatchIndex(this.connectorAndRegex, source).matched; + } +} +exports.SpanishDatePeriodExtractorConfiguration = SpanishDatePeriodExtractorConfiguration; +class SpanishDatePeriodParserConfiguration { + constructor(config) { + this.tokenBeforeDate = spanishDateTime.SpanishDateTime.TokenBeforeDate; + this.cardinalExtractor = config.cardinalExtractor; + this.numberParser = config.numberParser; + this.durationExtractor = config.durationExtractor; + this.dateExtractor = config.dateExtractor; + this.durationParser = config.durationParser; + this.dateParser = config.dateParser; + this.monthFrontBetweenRegex = recognizersText.RegExpUtility.getSafeRegExp(spanishDateTime.SpanishDateTime.MonthFrontBetweenRegex); + this.betweenRegex = recognizersText.RegExpUtility.getSafeRegExp(spanishDateTime.SpanishDateTime.DayBetweenRegex); + this.monthFrontSimpleCasesRegex = recognizersText.RegExpUtility.getSafeRegExp(spanishDateTime.SpanishDateTime.MonthFrontSimpleCasesRegex); + this.simpleCasesRegex = recognizersText.RegExpUtility.getSafeRegExp(spanishDateTime.SpanishDateTime.SimpleCasesRegex); + this.oneWordPeriodRegex = recognizersText.RegExpUtility.getSafeRegExp(spanishDateTime.SpanishDateTime.OneWordPeriodRegex); + this.monthWithYear = recognizersText.RegExpUtility.getSafeRegExp(spanishDateTime.SpanishDateTime.MonthWithYearRegex); + this.monthNumWithYear = recognizersText.RegExpUtility.getSafeRegExp(spanishDateTime.SpanishDateTime.MonthNumWithYearRegex); + this.yearRegex = recognizersText.RegExpUtility.getSafeRegExp(spanishDateTime.SpanishDateTime.YearRegex); + this.pastRegex = recognizersText.RegExpUtility.getSafeRegExp(spanishDateTime.SpanishDateTime.PastRegex); + this.futureRegex = recognizersText.RegExpUtility.getSafeRegExp(spanishDateTime.SpanishDateTime.FutureRegex); + this.numberCombinedWithUnit = recognizersText.RegExpUtility.getSafeRegExp(spanishDateTime.SpanishDateTime.DurationNumberCombinedWithUnit); + this.weekOfMonthRegex = recognizersText.RegExpUtility.getSafeRegExp(spanishDateTime.SpanishDateTime.WeekOfMonthRegex); + this.weekOfYearRegex = recognizersText.RegExpUtility.getSafeRegExp(spanishDateTime.SpanishDateTime.WeekOfYearRegex); + this.quarterRegex = recognizersText.RegExpUtility.getSafeRegExp(spanishDateTime.SpanishDateTime.QuarterRegex); + this.quarterRegexYearFront = recognizersText.RegExpUtility.getSafeRegExp(spanishDateTime.SpanishDateTime.QuarterRegexYearFront); + this.allHalfYearRegex = recognizersText.RegExpUtility.getSafeRegExp(spanishDateTime.SpanishDateTime.AllHalfYearRegex); + this.seasonRegex = recognizersText.RegExpUtility.getSafeRegExp(spanishDateTime.SpanishDateTime.SeasonRegex); + this.whichWeekRegex = recognizersText.RegExpUtility.getSafeRegExp(spanishDateTime.SpanishDateTime.WhichWeekRegex); + this.weekOfRegex = recognizersText.RegExpUtility.getSafeRegExp(spanishDateTime.SpanishDateTime.WeekOfRegex); + this.monthOfRegex = recognizersText.RegExpUtility.getSafeRegExp(spanishDateTime.SpanishDateTime.MonthOfRegex); + this.restOfDateRegex = recognizersText.RegExpUtility.getSafeRegExp(spanishDateTime.SpanishDateTime.RestOfDateRegex); + this.laterEarlyPeriodRegex = recognizersText.RegExpUtility.getSafeRegExp(spanishDateTime.SpanishDateTime.LaterEarlyPeriodRegex); + this.weekWithWeekDayRangeRegex = recognizersText.RegExpUtility.getSafeRegExp(spanishDateTime.SpanishDateTime.WeekWithWeekDayRangeRegex); + this.nextPrefixRegex = recognizersText.RegExpUtility.getSafeRegExp(spanishDateTime.SpanishDateTime.NextPrefixRegex); + this.pastPrefixRegex = recognizersText.RegExpUtility.getSafeRegExp(spanishDateTime.SpanishDateTime.PastPrefixRegex); + this.thisPrefixRegex = recognizersText.RegExpUtility.getSafeRegExp(spanishDateTime.SpanishDateTime.ThisPrefixRegex); + this.inConnectorRegex = config.utilityConfiguration.inConnectorRegex; + this.unitMap = config.unitMap; + this.cardinalMap = config.cardinalMap; + this.dayOfMonth = config.dayOfMonth; + this.monthOfYear = config.monthOfYear; + this.seasonMap = config.seasonMap; + } + getSwiftDayOrMonth(source) { + let trimedText = source.trim().toLowerCase(); + let swift = 0; + if (recognizersText.RegExpUtility.getFirstMatchIndex(this.nextPrefixRegex, trimedText).matched) { + swift = 1; + } + if (recognizersText.RegExpUtility.getFirstMatchIndex(this.pastPrefixRegex, trimedText).matched) { + swift = -1; + } + return swift; + } + getSwiftYear(source) { + let trimedText = source.trim().toLowerCase(); + let swift = -10; + if (recognizersText.RegExpUtility.getFirstMatchIndex(this.nextPrefixRegex, trimedText).matched) { + swift = 1; + } + if (recognizersText.RegExpUtility.getFirstMatchIndex(this.pastPrefixRegex, trimedText).matched) { + swift = -1; + } + else if (recognizersText.RegExpUtility.getFirstMatchIndex(this.thisPrefixRegex, trimedText).matched) { + swift = 0; + } + return swift; + } + isFuture(source) { + let trimedText = source.trim().toLowerCase(); + return recognizersText.RegExpUtility.getFirstMatchIndex(this.thisPrefixRegex, trimedText).matched + || recognizersText.RegExpUtility.getFirstMatchIndex(this.nextPrefixRegex, trimedText).matched; + } + isYearToDate(source) { + let trimedText = source.trim().toLowerCase(); + return trimedText === "año a la fecha" + || trimedText === "años a la fecha"; + } + isMonthToDate(source) { + let trimedText = source.trim().toLowerCase(); + return trimedText === "mes a la fecha" + || trimedText === "meses a la fecha"; + } + isWeekOnly(source) { + let trimedText = source.trim().toLowerCase(); + return trimedText.endsWith("semana") + && !trimedText.endsWith("fin de semana"); + } + isWeekend(source) { + let trimedText = source.trim().toLowerCase(); + return trimedText.endsWith("fin de semana"); + } + isMonthOnly(source) { + let trimedText = source.trim().toLowerCase(); + return trimedText.endsWith("mes") + || trimedText.endsWith("meses"); + } + isYearOnly(source) { + let trimedText = source.trim().toLowerCase(); + return trimedText.endsWith("año") + || trimedText.endsWith("años"); + } + isLastCardinal(source) { + let trimedText = source.trim().toLowerCase(); + return recognizersText.RegExpUtility.getFirstMatchIndex(this.pastPrefixRegex, trimedText).matched; + } +} +exports.SpanishDatePeriodParserConfiguration = SpanishDatePeriodParserConfiguration; + +}); + +unwrapExports(datePeriodConfiguration$2); + +var timePeriodConfiguration$2 = createCommonjsModule(function (module, exports) { +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); + + + + + + +class SpanishTimePeriodExtractorConfiguration { + constructor() { + this.singleTimeExtractor = new baseTime.BaseTimeExtractor(new timeConfiguration$2.SpanishTimeExtractorConfiguration()); + this.integerExtractor = new recognizersTextNumber.EnglishIntegerExtractor(); + this.utilityConfiguration = new baseConfiguration$2.SpanishDateTimeUtilityConfiguration(); + this.simpleCasesRegex = [ + recognizersText.RegExpUtility.getSafeRegExp(spanishDateTime.SpanishDateTime.PureNumFromTo, "gis"), + recognizersText.RegExpUtility.getSafeRegExp(spanishDateTime.SpanishDateTime.PureNumBetweenAnd, "gis") + ]; + this.tillRegex = recognizersText.RegExpUtility.getSafeRegExp(spanishDateTime.SpanishDateTime.TillRegex, "gis"); + this.timeOfDayRegex = recognizersText.RegExpUtility.getSafeRegExp(spanishDateTime.SpanishDateTime.TimeOfDayRegex, "gis"); + this.generalEndingRegex = recognizersText.RegExpUtility.getSafeRegExp(spanishDateTime.SpanishDateTime.GeneralEndingRegex, "gis"); + this.fromRegex = recognizersText.RegExpUtility.getSafeRegExp(spanishDateTime.SpanishDateTime.FromRegex, "gis"); + this.connectorAndRegex = recognizersText.RegExpUtility.getSafeRegExp(spanishDateTime.SpanishDateTime.ConnectorAndRegex, "gis"); + this.betweenRegex = recognizersText.RegExpUtility.getSafeRegExp(spanishDateTime.SpanishDateTime.BetweenRegex, "gis"); + } + getFromTokenIndex(text) { + return recognizersText.RegExpUtility.getFirstMatchIndex(this.fromRegex, text); + } + hasConnectorToken(text) { + return recognizersText.RegExpUtility.getFirstMatchIndex(this.connectorAndRegex, text).matched; + } + getBetweenTokenIndex(text) { + return recognizersText.RegExpUtility.getFirstMatchIndex(this.betweenRegex, text); + } +} +exports.SpanishTimePeriodExtractorConfiguration = SpanishTimePeriodExtractorConfiguration; +class SpanishTimePeriodParserConfiguration { + constructor(config) { + this.timeExtractor = config.timeExtractor; + this.timeParser = config.timeParser; + this.integerExtractor = config.integerExtractor; + this.numbers = config.numbers; + this.utilityConfiguration = config.utilityConfiguration; + this.pureNumberFromToRegex = recognizersText.RegExpUtility.getSafeRegExp(spanishDateTime.SpanishDateTime.PureNumFromTo, "gis"); + this.pureNumberBetweenAndRegex = recognizersText.RegExpUtility.getSafeRegExp(spanishDateTime.SpanishDateTime.PureNumBetweenAnd, "gis"); + this.timeOfDayRegex = recognizersText.RegExpUtility.getSafeRegExp(spanishDateTime.SpanishDateTime.TimeOfDayRegex, "gis"); + this.tillRegex = recognizersText.RegExpUtility.getSafeRegExp(spanishDateTime.SpanishDateTime.TillRegex, "gis"); + this.specificTimeFromToRegex = recognizersText.RegExpUtility.getSafeRegExp(spanishDateTime.SpanishDateTime.SpecificTimeFromTo); + this.specificTimeBetweenAndRegex = recognizersText.RegExpUtility.getSafeRegExp(spanishDateTime.SpanishDateTime.SpecificTimeBetweenAnd); + } + getMatchedTimexRange(text) { + let trimedText = text.trim().toLowerCase(); + let beginHour = 0; + let endHour = 0; + let endMin = 0; + let timex = ""; + if (trimedText.endsWith("madrugada")) { + timex = "TDA"; + beginHour = 4; + endHour = 8; + } + else if (trimedText.endsWith("mañana")) { + timex = "TMO"; + beginHour = 8; + endHour = 12; + } + else if (trimedText.includes("pasado mediodia") || trimedText.includes("pasado el mediodia")) { + timex = "TAF"; + beginHour = 12; + endHour = 16; + } + else if (trimedText.endsWith("tarde")) { + timex = "TEV"; + beginHour = 16; + endHour = 20; + } + else if (trimedText.endsWith("noche")) { + timex = "TNI"; + beginHour = 20; + endHour = 23; + endMin = 59; + } + else { + timex = null; + return { + matched: false, + timex, + beginHour, + endHour, + endMin + }; + } + return { + matched: true, + timex, + beginHour, + endHour, + endMin + }; + } +} +exports.SpanishTimePeriodParserConfiguration = SpanishTimePeriodParserConfiguration; + +}); + +unwrapExports(timePeriodConfiguration$2); + +var dateTimePeriodConfiguration$2 = createCommonjsModule(function (module, exports) { +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); + + + + + + + + + + + + + +class SpanishDateTimePeriodExtractorConfiguration { + constructor() { + this.simpleCasesRegexes = [ + recognizersText.RegExpUtility.getSafeRegExp(spanishDateTime.SpanishDateTime.PureNumFromTo), + recognizersText.RegExpUtility.getSafeRegExp(spanishDateTime.SpanishDateTime.PureNumBetweenAnd) + ]; + this.prepositionRegex = recognizersText.RegExpUtility.getSafeRegExp(spanishDateTime.SpanishDateTime.PrepositionRegex); + this.tillRegex = recognizersText.RegExpUtility.getSafeRegExp(spanishDateTime.SpanishDateTime.TillRegex); + this.specificTimeOfDayRegex = recognizersText.RegExpUtility.getSafeRegExp(spanishDateTime.SpanishDateTime.SpecificTimeOfDayRegex); + this.timeOfDayRegex = recognizersText.RegExpUtility.getSafeRegExp(spanishDateTime.SpanishDateTime.TimeOfDayRegex); + this.followedUnit = recognizersText.RegExpUtility.getSafeRegExp(spanishDateTime.SpanishDateTime.FollowedUnit); + this.timeUnitRegex = recognizersText.RegExpUtility.getSafeRegExp(spanishDateTime.SpanishDateTime.UnitRegex); + this.pastPrefixRegex = recognizersText.RegExpUtility.getSafeRegExp(spanishDateTime.SpanishDateTime.PastRegex); + this.nextPrefixRegex = recognizersText.RegExpUtility.getSafeRegExp(spanishDateTime.SpanishDateTime.FutureRegex); + this.numberCombinedWithUnit = recognizersText.RegExpUtility.getSafeRegExp(spanishDateTime.SpanishDateTime.DateTimePeriodNumberCombinedWithUnit); + this.weekDayRegex = recognizersText.RegExpUtility.getSafeRegExp(spanishDateTime.SpanishDateTime.WeekDayRegex); + this.periodTimeOfDayWithDateRegex = recognizersText.RegExpUtility.getSafeRegExp(spanishDateTime.SpanishDateTime.PeriodTimeOfDayWithDateRegex); + this.relativeTimeUnitRegex = recognizersText.RegExpUtility.getSafeRegExp(spanishDateTime.SpanishDateTime.RelativeTimeUnitRegex); + this.restOfDateTimeRegex = recognizersText.RegExpUtility.getSafeRegExp(spanishDateTime.SpanishDateTime.RestOfDateTimeRegex); + this.generalEndingRegex = recognizersText.RegExpUtility.getSafeRegExp(spanishDateTime.SpanishDateTime.GeneralEndingRegex); + this.middlePauseRegex = recognizersText.RegExpUtility.getSafeRegExp(spanishDateTime.SpanishDateTime.MiddlePauseRegex); + this.fromRegex = recognizersText.RegExpUtility.getSafeRegExp(spanishDateTime.SpanishDateTime.FromRegex); + this.connectorAndRegex = recognizersText.RegExpUtility.getSafeRegExp(spanishDateTime.SpanishDateTime.ConnectorAndRegex); + this.betweenRegex = recognizersText.RegExpUtility.getSafeRegExp(spanishDateTime.SpanishDateTime.BetweenRegex); + this.cardinalExtractor = new recognizersTextNumber.SpanishCardinalExtractor(); + this.singleDateExtractor = new baseDate.BaseDateExtractor(new dateConfiguration$2.SpanishDateExtractorConfiguration()); + this.singleTimeExtractor = new baseTime.BaseTimeExtractor(new timeConfiguration$2.SpanishTimeExtractorConfiguration()); + this.singleDateTimeExtractor = new baseDateTime$2.BaseDateTimeExtractor(new dateTimeConfiguration$2.SpanishDateTimeExtractorConfiguration()); + this.durationExtractor = new baseDuration.BaseDurationExtractor(new durationConfiguration$2.SpanishDurationExtractorConfiguration()); + this.timePeriodExtractor = new baseTimePeriod.BaseTimePeriodExtractor(new timePeriodConfiguration$2.SpanishTimePeriodExtractorConfiguration()); + } + getFromTokenIndex(source) { + return recognizersText.RegExpUtility.getFirstMatchIndex(this.fromRegex, source); + } + getBetweenTokenIndex(source) { + return recognizersText.RegExpUtility.getFirstMatchIndex(this.betweenRegex, source); + } + hasConnectorToken(source) { + return recognizersText.RegExpUtility.getFirstMatchIndex(this.connectorAndRegex, source).matched; + } +} +exports.SpanishDateTimePeriodExtractorConfiguration = SpanishDateTimePeriodExtractorConfiguration; +class SpanishDateTimePeriodParserConfiguration { + constructor(config) { + this.dateExtractor = config.dateExtractor; + this.timeExtractor = config.timeExtractor; + this.dateTimeExtractor = config.dateTimeExtractor; + this.timePeriodExtractor = config.timePeriodExtractor; + this.cardinalExtractor = config.cardinalExtractor; + this.durationExtractor = config.durationExtractor; + this.numberParser = config.numberParser; + this.dateParser = config.dateParser; + this.timeParser = config.timeParser; + this.dateTimeParser = config.dateTimeParser; + this.timePeriodParser = config.timePeriodParser; + this.durationParser = config.durationParser; + this.unitMap = config.unitMap; + this.numbers = config.numbers; + this.nextPrefixRegex = recognizersText.RegExpUtility.getSafeRegExp(spanishDateTime.SpanishDateTime.NextPrefixRegex); + this.pastPrefixRegex = recognizersText.RegExpUtility.getSafeRegExp(spanishDateTime.SpanishDateTime.PastPrefixRegex); + this.thisPrefixRegex = recognizersText.RegExpUtility.getSafeRegExp(spanishDateTime.SpanishDateTime.ThisPrefixRegex); + this.pureNumberFromToRegex = recognizersText.RegExpUtility.getSafeRegExp(spanishDateTime.SpanishDateTime.PureNumFromTo); + this.pureNumberBetweenAndRegex = recognizersText.RegExpUtility.getSafeRegExp(spanishDateTime.SpanishDateTime.PureNumBetweenAnd); + this.specificTimeOfDayRegex = recognizersText.RegExpUtility.getSafeRegExp(spanishDateTime.SpanishDateTime.SpecificTimeOfDayRegex); + this.timeOfDayRegex = recognizersText.RegExpUtility.getSafeRegExp(spanishDateTime.SpanishDateTime.TimeOfDayRegex); + this.pastRegex = recognizersText.RegExpUtility.getSafeRegExp(spanishDateTime.SpanishDateTime.PastRegex); + this.futureRegex = recognizersText.RegExpUtility.getSafeRegExp(spanishDateTime.SpanishDateTime.FutureRegex); + this.numberCombinedWithUnitRegex = recognizersText.RegExpUtility.getSafeRegExp(spanishDateTime.SpanishDateTime.DateTimePeriodNumberCombinedWithUnit); + this.unitRegex = recognizersText.RegExpUtility.getSafeRegExp(spanishDateTime.SpanishDateTime.UnitRegex); + this.periodTimeOfDayWithDateRegex = recognizersText.RegExpUtility.getSafeRegExp(spanishDateTime.SpanishDateTime.PeriodTimeOfDayWithDateRegex); + this.relativeTimeUnitRegex = recognizersText.RegExpUtility.getSafeRegExp(spanishDateTime.SpanishDateTime.RelativeTimeUnitRegex); + this.restOfDateTimeRegex = recognizersText.RegExpUtility.getSafeRegExp(spanishDateTime.SpanishDateTime.RestOfDateTimeRegex); + } + getMatchedTimeRange(source) { + let trimedText = source.trim().toLowerCase(); + let timeStr = ""; + let beginHour = 0; + let endHour = 0; + let endMin = 0; + if (trimedText.endsWith("madrugada")) { + timeStr = "TDA"; + beginHour = 4; + endHour = 8; + } + else if (trimedText.endsWith("mañana")) { + timeStr = "TMO"; + beginHour = 8; + endHour = 12; + } + else if (trimedText.includes("pasado mediodia") || trimedText.includes("pasado el mediodia")) { + timeStr = "TAF"; + beginHour = 12; + endHour = 16; + } + else if (trimedText.endsWith("tarde")) { + timeStr = "TEV"; + beginHour = 16; + endHour = 20; + } + else if (trimedText.endsWith("noche")) { + timeStr = "TNI"; + beginHour = 20; + endHour = 23; + endMin = 59; + } + else { + timeStr = null; + return { + success: false, + timeStr, + beginHour, + endHour, + endMin + }; + } + return { + success: true, + timeStr, + beginHour, + endHour, + endMin + }; + } + getSwiftPrefix(source) { + let trimedText = source.trim().toLowerCase(); + let swift = 0; + // TODO: Replace with a regex + if (recognizersText.RegExpUtility.getFirstMatchIndex(this.pastPrefixRegex, trimedText).matched || + trimedText === "anoche") { + swift = -1; + } + else if (recognizersText.RegExpUtility.getFirstMatchIndex(this.nextPrefixRegex, trimedText).matched) { + swift = 1; + } + return swift; + } +} +exports.SpanishDateTimePeriodParserConfiguration = SpanishDateTimePeriodParserConfiguration; + +}); + +unwrapExports(dateTimePeriodConfiguration$2); + +var baseConfiguration$2 = createCommonjsModule(function (module, exports) { +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); + + + + + + + + + + + + + + + + + + +class SpanishDateTimeUtilityConfiguration { + constructor() { + this.laterRegex = recognizersText.RegExpUtility.getSafeRegExp(spanishDateTime.SpanishDateTime.LaterRegex); + this.agoRegex = recognizersText.RegExpUtility.getSafeRegExp(spanishDateTime.SpanishDateTime.AgoRegex); + this.inConnectorRegex = recognizersText.RegExpUtility.getSafeRegExp(spanishDateTime.SpanishDateTime.InConnectorRegex); + this.rangeUnitRegex = recognizersText.RegExpUtility.getSafeRegExp(spanishDateTime.SpanishDateTime.RangeUnitRegex); + this.amDescRegex = recognizersText.RegExpUtility.getSafeRegExp(spanishDateTime.SpanishDateTime.AmDescRegex); + this.pmDescRegex = recognizersText.RegExpUtility.getSafeRegExp(spanishDateTime.SpanishDateTime.PmDescRegex); + this.amPmDescRegex = recognizersText.RegExpUtility.getSafeRegExp(spanishDateTime.SpanishDateTime.AmPmDescRegex); + } +} +exports.SpanishDateTimeUtilityConfiguration = SpanishDateTimeUtilityConfiguration; +class SpanishCommonDateTimeParserConfiguration extends parsers$4.BaseDateParserConfiguration { + constructor() { + super(); + this.utilityConfiguration = new SpanishDateTimeUtilityConfiguration(); + this.unitMap = spanishDateTime.SpanishDateTime.UnitMap; + this.unitValueMap = spanishDateTime.SpanishDateTime.UnitValueMap; + this.seasonMap = spanishDateTime.SpanishDateTime.SeasonMap; + this.cardinalMap = spanishDateTime.SpanishDateTime.CardinalMap; + this.dayOfWeek = spanishDateTime.SpanishDateTime.DayOfWeek; + this.monthOfYear = spanishDateTime.SpanishDateTime.MonthOfYear; + this.numbers = spanishDateTime.SpanishDateTime.Numbers; + this.doubleNumbers = spanishDateTime.SpanishDateTime.DoubleNumbers; + this.cardinalExtractor = new recognizersTextNumber.SpanishCardinalExtractor(); + this.integerExtractor = new recognizersTextNumber.SpanishIntegerExtractor(); + this.ordinalExtractor = new recognizersTextNumber.SpanishOrdinalExtractor(); + this.numberParser = new recognizersTextNumber.BaseNumberParser(new recognizersTextNumber.SpanishNumberParserConfiguration()); + this.dateExtractor = new baseDate.BaseDateExtractor(new dateConfiguration$2.SpanishDateExtractorConfiguration()); + this.timeExtractor = new baseTime.BaseTimeExtractor(new timeConfiguration$2.SpanishTimeExtractorConfiguration()); + this.dateTimeExtractor = new baseDateTime$2.BaseDateTimeExtractor(new dateTimeConfiguration$2.SpanishDateTimeExtractorConfiguration()); + this.durationExtractor = new baseDuration.BaseDurationExtractor(new durationConfiguration$2.SpanishDurationExtractorConfiguration()); + this.datePeriodExtractor = new baseDatePeriod.BaseDatePeriodExtractor(new datePeriodConfiguration$2.SpanishDatePeriodExtractorConfiguration()); + this.timePeriodExtractor = new baseTimePeriod.BaseTimePeriodExtractor(new timePeriodConfiguration$2.SpanishTimePeriodExtractorConfiguration()); + this.dateTimePeriodExtractor = new baseDateTimePeriod.BaseDateTimePeriodExtractor(new dateTimePeriodConfiguration$2.SpanishDateTimePeriodExtractorConfiguration()); + this.durationParser = new baseDuration.BaseDurationParser(new durationConfiguration$2.SpanishDurationParserConfiguration(this)); + this.dateParser = new baseDate.BaseDateParser(new dateConfiguration$2.SpanishDateParserConfiguration(this)); + this.timeParser = new baseTime.BaseTimeParser(new timeConfiguration$2.SpanishTimeParserConfiguration(this)); + this.dateTimeParser = new baseDateTime$2.BaseDateTimeParser(new dateTimeConfiguration$2.SpanishDateTimeParserConfiguration(this)); + this.datePeriodParser = new baseDatePeriod.BaseDatePeriodParser(new datePeriodConfiguration$2.SpanishDatePeriodParserConfiguration(this)); + this.timePeriodParser = new baseTimePeriod.BaseTimePeriodParser(new timePeriodConfiguration$2.SpanishTimePeriodParserConfiguration(this)); + this.dateTimePeriodParser = new baseDateTimePeriod.BaseDateTimePeriodParser(new dateTimePeriodConfiguration$2.SpanishDateTimePeriodParserConfiguration(this)); + } +} +exports.SpanishCommonDateTimeParserConfiguration = SpanishCommonDateTimeParserConfiguration; + +}); + +unwrapExports(baseConfiguration$2); + +var dateConfiguration$2 = createCommonjsModule(function (module, exports) { +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); + + + + + + + +class SpanishDateExtractorConfiguration { + constructor() { + this.dateRegexList = [ + recognizersText.RegExpUtility.getSafeRegExp(spanishDateTime.SpanishDateTime.DateExtractor1, "gis"), + recognizersText.RegExpUtility.getSafeRegExp(spanishDateTime.SpanishDateTime.DateExtractor2, "gis"), + recognizersText.RegExpUtility.getSafeRegExp(spanishDateTime.SpanishDateTime.DateExtractor3, "gis"), + spanishDateTime.SpanishDateTime.DefaultLanguageFallback === constants$2.Constants.DefaultLanguageFallback_DMY ? + recognizersText.RegExpUtility.getSafeRegExp(spanishDateTime.SpanishDateTime.DateExtractor5, "gis") : + recognizersText.RegExpUtility.getSafeRegExp(spanishDateTime.SpanishDateTime.DateExtractor4, "gis"), + spanishDateTime.SpanishDateTime.DefaultLanguageFallback === constants$2.Constants.DefaultLanguageFallback_DMY ? + recognizersText.RegExpUtility.getSafeRegExp(spanishDateTime.SpanishDateTime.DateExtractor4, "gis") : + recognizersText.RegExpUtility.getSafeRegExp(spanishDateTime.SpanishDateTime.DateExtractor5, "gis"), + spanishDateTime.SpanishDateTime.DefaultLanguageFallback === constants$2.Constants.DefaultLanguageFallback_DMY ? + recognizersText.RegExpUtility.getSafeRegExp(spanishDateTime.SpanishDateTime.DateExtractor8, "gis") : + recognizersText.RegExpUtility.getSafeRegExp(spanishDateTime.SpanishDateTime.DateExtractor6, "gis"), + spanishDateTime.SpanishDateTime.DefaultLanguageFallback === constants$2.Constants.DefaultLanguageFallback_DMY ? + recognizersText.RegExpUtility.getSafeRegExp(spanishDateTime.SpanishDateTime.DateExtractor6, "gis") : + recognizersText.RegExpUtility.getSafeRegExp(spanishDateTime.SpanishDateTime.DateExtractor8, "gis"), + spanishDateTime.SpanishDateTime.DefaultLanguageFallback === constants$2.Constants.DefaultLanguageFallback_DMY ? + recognizersText.RegExpUtility.getSafeRegExp(spanishDateTime.SpanishDateTime.DateExtractor9, "gis") : + recognizersText.RegExpUtility.getSafeRegExp(spanishDateTime.SpanishDateTime.DateExtractor7, "gis"), + spanishDateTime.SpanishDateTime.DefaultLanguageFallback === constants$2.Constants.DefaultLanguageFallback_DMY ? + recognizersText.RegExpUtility.getSafeRegExp(spanishDateTime.SpanishDateTime.DateExtractor7, "gis") : + recognizersText.RegExpUtility.getSafeRegExp(spanishDateTime.SpanishDateTime.DateExtractor9, "gis"), + recognizersText.RegExpUtility.getSafeRegExp(spanishDateTime.SpanishDateTime.DateExtractor10, "gis"), + ]; + this.implicitDateList = [ + recognizersText.RegExpUtility.getSafeRegExp(spanishDateTime.SpanishDateTime.OnRegex, "gis"), + recognizersText.RegExpUtility.getSafeRegExp(spanishDateTime.SpanishDateTime.RelaxedOnRegex, "gis"), + recognizersText.RegExpUtility.getSafeRegExp(spanishDateTime.SpanishDateTime.SpecialDayRegex, "gis"), + recognizersText.RegExpUtility.getSafeRegExp(spanishDateTime.SpanishDateTime.ThisRegex, "gis"), + recognizersText.RegExpUtility.getSafeRegExp(spanishDateTime.SpanishDateTime.LastDateRegex, "gis"), + recognizersText.RegExpUtility.getSafeRegExp(spanishDateTime.SpanishDateTime.NextDateRegex, "gis"), + recognizersText.RegExpUtility.getSafeRegExp(spanishDateTime.SpanishDateTime.WeekDayRegex, "gis"), + recognizersText.RegExpUtility.getSafeRegExp(spanishDateTime.SpanishDateTime.WeekDayOfMonthRegex, "gis"), + recognizersText.RegExpUtility.getSafeRegExp(spanishDateTime.SpanishDateTime.SpecialDateRegex, "gis") + ]; + this.monthEnd = recognizersText.RegExpUtility.getSafeRegExp(spanishDateTime.SpanishDateTime.MonthEndRegex, "gis"); + this.ofMonth = recognizersText.RegExpUtility.getSafeRegExp(spanishDateTime.SpanishDateTime.OfMonthRegex, "gis"); + this.dateUnitRegex = recognizersText.RegExpUtility.getSafeRegExp(spanishDateTime.SpanishDateTime.DateUnitRegex, "gis"); + this.forTheRegex = recognizersText.RegExpUtility.getSafeRegExp(spanishDateTime.SpanishDateTime.ForTheRegex, "gis"); + this.weekDayAndDayOfMonthRegex = recognizersText.RegExpUtility.getSafeRegExp(spanishDateTime.SpanishDateTime.WeekDayAndDayOfMonthRegex, "gis"); + this.relativeMonthRegex = recognizersText.RegExpUtility.getSafeRegExp(spanishDateTime.SpanishDateTime.RelativeMonthRegex, "gis"); + this.weekDayRegex = recognizersText.RegExpUtility.getSafeRegExp(spanishDateTime.SpanishDateTime.WeekDayRegex, "gis"); + this.dayOfWeek = spanishDateTime.SpanishDateTime.DayOfWeek; + this.ordinalExtractor = new recognizersTextNumber.SpanishOrdinalExtractor(); + this.integerExtractor = new recognizersTextNumber.SpanishIntegerExtractor(); + this.numberParser = new recognizersTextNumber.BaseNumberParser(new recognizersTextNumber.SpanishNumberParserConfiguration()); + this.durationExtractor = new baseDuration.BaseDurationExtractor(new durationConfiguration$2.SpanishDurationExtractorConfiguration()); + this.utilityConfiguration = new baseConfiguration$2.SpanishDateTimeUtilityConfiguration(); + } +} +exports.SpanishDateExtractorConfiguration = SpanishDateExtractorConfiguration; +class SpanishDateParserConfiguration { + constructor(config) { + this.ordinalExtractor = config.ordinalExtractor; + this.integerExtractor = config.integerExtractor; + this.cardinalExtractor = config.cardinalExtractor; + this.durationExtractor = config.durationExtractor; + this.numberParser = config.numberParser; + this.durationParser = config.durationParser; + this.monthOfYear = config.monthOfYear; + this.dayOfMonth = config.dayOfMonth; + this.dayOfWeek = config.dayOfWeek; + this.unitMap = config.unitMap; + this.cardinalMap = config.cardinalMap; + this.dateRegex = new SpanishDateExtractorConfiguration().dateRegexList; + this.onRegex = recognizersText.RegExpUtility.getSafeRegExp(spanishDateTime.SpanishDateTime.OnRegex, "gis"); + this.specialDayRegex = recognizersText.RegExpUtility.getSafeRegExp(spanishDateTime.SpanishDateTime.SpecialDayRegex, "gis"); + this.specialDayWithNumRegex = recognizersText.RegExpUtility.getSafeRegExp(spanishDateTime.SpanishDateTime.SpecialDayWithNumRegex, "gis"); + this.nextRegex = recognizersText.RegExpUtility.getSafeRegExp(spanishDateTime.SpanishDateTime.NextDateRegex, "gis"); + this.unitRegex = recognizersText.RegExpUtility.getSafeRegExp(spanishDateTime.SpanishDateTime.DateUnitRegex, "gis"); + this.monthRegex = recognizersText.RegExpUtility.getSafeRegExp(spanishDateTime.SpanishDateTime.MonthRegex, "gis"); + this.weekDayRegex = recognizersText.RegExpUtility.getSafeRegExp(spanishDateTime.SpanishDateTime.WeekDayRegex, "gis"); + this.lastRegex = recognizersText.RegExpUtility.getSafeRegExp(spanishDateTime.SpanishDateTime.LastDateRegex, "gis"); + this.thisRegex = recognizersText.RegExpUtility.getSafeRegExp(spanishDateTime.SpanishDateTime.ThisRegex, "gis"); + this.weekDayOfMonthRegex = recognizersText.RegExpUtility.getSafeRegExp(spanishDateTime.SpanishDateTime.WeekDayOfMonthRegex, "gis"); + this.forTheRegex = recognizersText.RegExpUtility.getSafeRegExp(spanishDateTime.SpanishDateTime.ForTheRegex, "gis"); + this.weekDayAndDayOfMonthRegex = recognizersText.RegExpUtility.getSafeRegExp(spanishDateTime.SpanishDateTime.WeekDayAndDayOfMonthRegex, "gis"); + this.relativeMonthRegex = recognizersText.RegExpUtility.getSafeRegExp(spanishDateTime.SpanishDateTime.RelativeMonthRegex, "gis"); + this.relativeWeekDayRegex = recognizersText.RegExpUtility.getSafeRegExp(spanishDateTime.SpanishDateTime.RelativeWeekDayRegex, "gis"); + this.utilityConfiguration = config.utilityConfiguration; + this.dateTokenPrefix = spanishDateTime.SpanishDateTime.DateTokenPrefix; + } + getSwiftDay(source) { + let trimedText = SpanishDateParserConfiguration.normalize(source.trim().toLowerCase()); + let swift = 0; + // TODO: add the relative day logic if needed. If yes, the whole method should be abstracted. + if (trimedText === "hoy" || trimedText === "el dia") { + swift = 0; + } + else if (trimedText === "mañana" || + trimedText.endsWith("dia siguiente") || + trimedText.endsWith("el dia de mañana") || + trimedText.endsWith("proximo dia")) { + swift = 1; + } + else if (trimedText === "ayer") { + swift = -1; + } + else if (trimedText.endsWith("pasado mañana") || + trimedText.endsWith("dia despues de mañana")) { + swift = 2; + } + else if (trimedText.endsWith("anteayer") || + trimedText.endsWith("dia antes de ayer")) { + swift = -2; + } + else if (trimedText.endsWith("ultimo dia")) { + swift = -1; + } + return swift; + } + getSwiftMonth(source) { + let trimedText = source.trim().toLowerCase(); + let swift = 0; + if (recognizersText.RegExpUtility.getMatches(SpanishDateParserConfiguration.nextPrefixRegex, trimedText).length) { + swift = 1; + } + if (recognizersText.RegExpUtility.getMatches(SpanishDateParserConfiguration.pastPrefixRegex, trimedText).length) { + swift = -1; + } + return swift; + } + isCardinalLast(source) { + let trimedText = source.trim().toLowerCase(); + return recognizersText.RegExpUtility.getMatches(SpanishDateParserConfiguration.pastPrefixRegex, trimedText).length > 0; + } + static normalize(source) { + return source + .replace(/á/g, "a") + .replace(/é/g, "e") + .replace(/í/g, "i") + .replace(/ó/g, "o") + .replace(/ú/g, "u"); + } +} +// TODO: implement the relative day regex if needed. If yes, they should be abstracted +SpanishDateParserConfiguration.relativeDayRegex = recognizersText.RegExpUtility.getSafeRegExp(spanishDateTime.SpanishDateTime.RelativeDayRegex); +SpanishDateParserConfiguration.nextPrefixRegex = recognizersText.RegExpUtility.getSafeRegExp(spanishDateTime.SpanishDateTime.NextPrefixRegex); +SpanishDateParserConfiguration.pastPrefixRegex = recognizersText.RegExpUtility.getSafeRegExp(spanishDateTime.SpanishDateTime.PastPrefixRegex); +exports.SpanishDateParserConfiguration = SpanishDateParserConfiguration; + +}); + +unwrapExports(dateConfiguration$2); + +var holidayConfiguration$2 = createCommonjsModule(function (module, exports) { +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); + + + + +class SpanishHolidayExtractorConfiguration { + constructor() { + this.holidayRegexes = [ + recognizersText.RegExpUtility.getSafeRegExp(spanishDateTime.SpanishDateTime.HolidayRegex1, "gis"), + recognizersText.RegExpUtility.getSafeRegExp(spanishDateTime.SpanishDateTime.HolidayRegex2, "gis"), + recognizersText.RegExpUtility.getSafeRegExp(spanishDateTime.SpanishDateTime.HolidayRegex3, "gis") + ]; + } +} +exports.SpanishHolidayExtractorConfiguration = SpanishHolidayExtractorConfiguration; +class SpanishHolidayParserConfiguration extends baseHoliday.BaseHolidayParserConfiguration { + constructor() { + super(); + this.holidayRegexList = [ + recognizersText.RegExpUtility.getSafeRegExp(spanishDateTime.SpanishDateTime.HolidayRegex1, "gis"), + recognizersText.RegExpUtility.getSafeRegExp(spanishDateTime.SpanishDateTime.HolidayRegex2, "gis"), + recognizersText.RegExpUtility.getSafeRegExp(spanishDateTime.SpanishDateTime.HolidayRegex3, "gis") + ]; + this.holidayNames = spanishDateTime.SpanishDateTime.HolidayNames; + this.holidayFuncDictionary = this.initHolidayFuncs(); + this.variableHolidaysTimexDictionary = spanishDateTime.SpanishDateTime.VariableHolidaysTimexDictionary; + this.nextPrefixRegex = recognizersText.RegExpUtility.getSafeRegExp(spanishDateTime.SpanishDateTime.NextPrefixRegex); + this.pastPrefixRegex = recognizersText.RegExpUtility.getSafeRegExp(spanishDateTime.SpanishDateTime.PastPrefixRegex); + this.thisPrefixRegex = recognizersText.RegExpUtility.getSafeRegExp(spanishDateTime.SpanishDateTime.ThisPrefixRegex); + } + initHolidayFuncs() { + return new Map([ + ...super.initHolidayFuncs(), + ["padres", SpanishHolidayParserConfiguration.FathersDay], + ["madres", SpanishHolidayParserConfiguration.MothersDay], + ["acciondegracias", SpanishHolidayParserConfiguration.ThanksgivingDay], + ["trabajador", SpanishHolidayParserConfiguration.LabourDay], + ["delaraza", SpanishHolidayParserConfiguration.ColumbusDay], + ["memoria", SpanishHolidayParserConfiguration.MemorialDay], + ["pascuas", SpanishHolidayParserConfiguration.EasterDay], + ["navidad", SpanishHolidayParserConfiguration.ChristmasDay], + ["nochebuena", SpanishHolidayParserConfiguration.ChristmasEve], + ["añonuevo", SpanishHolidayParserConfiguration.NewYear], + ["nochevieja", SpanishHolidayParserConfiguration.NewYearEve], + ["yuandan", SpanishHolidayParserConfiguration.NewYear], + ["maestro", SpanishHolidayParserConfiguration.TeacherDay], + ["todoslossantos", SpanishHolidayParserConfiguration.HalloweenDay], + ["niño", SpanishHolidayParserConfiguration.ChildrenDay], + ["mujer", SpanishHolidayParserConfiguration.FemaleDay] + ]); + } + // All JavaScript dates are zero-based (-1) + static NewYear(year) { return new Date(year, 1 - 1, 1); } + static NewYearEve(year) { return new Date(year, 12 - 1, 31); } + static ChristmasDay(year) { return new Date(year, 12 - 1, 25); } + static ChristmasEve(year) { return new Date(year, 12 - 1, 24); } + static FemaleDay(year) { return new Date(year, 3 - 1, 8); } + static ChildrenDay(year) { return new Date(year, 6 - 1, 1); } + static HalloweenDay(year) { return new Date(year, 10 - 1, 31); } + static TeacherDay(year) { return new Date(year, 9 - 1, 11); } + static EasterDay(year) { return utilities$2.DateUtils.minValue(); } + getSwiftYear(text) { + let trimedText = text.trim().toLowerCase(); + let swift = -10; + if (recognizersText.RegExpUtility.getFirstMatchIndex(this.nextPrefixRegex, trimedText).matched) { + swift = 1; + } + if (recognizersText.RegExpUtility.getFirstMatchIndex(this.pastPrefixRegex, trimedText).matched) { + swift = -1; + } + else if (recognizersText.RegExpUtility.getFirstMatchIndex(this.thisPrefixRegex, trimedText).matched) { + swift = 0; + } + return swift; + } + sanitizeHolidayToken(holiday) { + return holiday.replace(/ /g, "") + .replace(/á/g, "a") + .replace(/é/g, "e") + .replace(/í/g, "i") + .replace(/ó/g, "o") + .replace(/ú/g, "u"); + } +} +exports.SpanishHolidayParserConfiguration = SpanishHolidayParserConfiguration; + +}); + +unwrapExports(holidayConfiguration$2); + +var setConfiguration$2 = createCommonjsModule(function (module, exports) { +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); + + + + + + + + + + + + + + + + +class SpanishSetExtractorConfiguration { + constructor() { + this.lastRegex = recognizersText.RegExpUtility.getSafeRegExp(spanishDateTime.SpanishDateTime.LastDateRegex, "gis"); + this.periodicRegex = recognizersText.RegExpUtility.getSafeRegExp(spanishDateTime.SpanishDateTime.PeriodicRegex, "gis"); + this.eachUnitRegex = recognizersText.RegExpUtility.getSafeRegExp(spanishDateTime.SpanishDateTime.EachUnitRegex, "gis"); + this.eachPrefixRegex = recognizersText.RegExpUtility.getSafeRegExp(spanishDateTime.SpanishDateTime.EachPrefixRegex, "gis"); + this.eachDayRegex = recognizersText.RegExpUtility.getSafeRegExp(spanishDateTime.SpanishDateTime.EachDayRegex, "gis"); + this.beforeEachDayRegex = recognizersText.RegExpUtility.getSafeRegExp(spanishDateTime.SpanishDateTime.BeforeEachDayRegex, "gis"); + this.setEachRegex = recognizersText.RegExpUtility.getSafeRegExp(spanishDateTime.SpanishDateTime.SetEachRegex, "gis"); + this.setWeekDayRegex = recognizersText.RegExpUtility.getSafeRegExp(spanishDateTime.SpanishDateTime.SetWeekDayRegex, "gis"); + this.durationExtractor = new baseDuration.BaseDurationExtractor(new durationConfiguration$2.SpanishDurationExtractorConfiguration()); + this.timeExtractor = new baseTime.BaseTimeExtractor(new timeConfiguration$2.SpanishTimeExtractorConfiguration()); + this.dateExtractor = new baseDate.BaseDateExtractor(new dateConfiguration$2.SpanishDateExtractorConfiguration()); + this.dateTimeExtractor = new baseDateTime$2.BaseDateTimeExtractor(new dateTimeConfiguration$2.SpanishDateTimeExtractorConfiguration()); + this.datePeriodExtractor = new baseDatePeriod.BaseDatePeriodExtractor(new datePeriodConfiguration$2.SpanishDatePeriodExtractorConfiguration()); + this.timePeriodExtractor = new baseTimePeriod.BaseTimePeriodExtractor(new timePeriodConfiguration$2.SpanishTimePeriodExtractorConfiguration()); + this.dateTimePeriodExtractor = new baseDateTimePeriod.BaseDateTimePeriodExtractor(new dateTimePeriodConfiguration$2.SpanishDateTimePeriodExtractorConfiguration()); + } +} +exports.SpanishSetExtractorConfiguration = SpanishSetExtractorConfiguration; +class SpanishSetParserConfiguration { + constructor(config) { + this.durationExtractor = config.durationExtractor; + this.timeExtractor = config.timeExtractor; + this.dateExtractor = config.dateExtractor; + this.dateTimeExtractor = config.dateTimeExtractor; + this.datePeriodExtractor = config.datePeriodExtractor; + this.timePeriodExtractor = config.timePeriodExtractor; + this.dateTimePeriodExtractor = config.dateTimePeriodExtractor; + this.durationParser = config.durationParser; + this.timeParser = config.timeParser; + this.dateParser = config.dateParser; + this.dateTimeParser = config.dateTimeParser; + this.datePeriodParser = config.datePeriodParser; + this.timePeriodParser = config.timePeriodParser; + this.dateTimePeriodParser = config.dateTimePeriodParser; + this.unitMap = config.unitMap; + this.eachPrefixRegex = recognizersText.RegExpUtility.getSafeRegExp(spanishDateTime.SpanishDateTime.EachPrefixRegex, "gis"); + this.periodicRegex = recognizersText.RegExpUtility.getSafeRegExp(spanishDateTime.SpanishDateTime.PeriodicRegex, "gis"); + this.eachUnitRegex = recognizersText.RegExpUtility.getSafeRegExp(spanishDateTime.SpanishDateTime.EachUnitRegex, "gis"); + this.eachDayRegex = recognizersText.RegExpUtility.getSafeRegExp(spanishDateTime.SpanishDateTime.EachDayRegex, "gis"); + this.setWeekDayRegex = recognizersText.RegExpUtility.getSafeRegExp(spanishDateTime.SpanishDateTime.SetWeekDayRegex, "gis"); + this.setEachRegex = recognizersText.RegExpUtility.getSafeRegExp(spanishDateTime.SpanishDateTime.SetEachRegex, "gis"); + } + getMatchedDailyTimex(text) { + let trimedText = text.trim().toLowerCase(); + let timex = ""; + if (trimedText.endsWith("diario") || trimedText.endsWith("diariamente")) { + timex = "P1D"; + } + else if (trimedText === "semanalmente") { + timex = "P1W"; + } + else if (trimedText === "quincenalmente") { + timex = "P2W"; + } + else if (trimedText === "mensualmente") { + timex = "P1M"; + } + else if (trimedText === "anualmente") { + timex = "P1Y"; + } + else { + timex = null; + return { + timex, + matched: false + }; + } + return { + timex, + matched: true + }; + } + getMatchedUnitTimex(text) { + let trimedText = text.trim().toLowerCase(); + let timex = ""; + if (trimedText === "día" || trimedText === "dia" || + trimedText === "días" || trimedText === "dias") { + timex = "P1D"; + } + else if (trimedText === "semana" || trimedText === "semanas") { + timex = "P1W"; + } + else if (trimedText === "mes" || trimedText === "meses") { + timex = "P1M"; + } + else if (trimedText === "año" || trimedText === "años") { + timex = "P1Y"; + } + else { + timex = null; + return { + matched: false, + timex + }; + } + return { + matched: true, + timex + }; + } +} +exports.SpanishSetParserConfiguration = SpanishSetParserConfiguration; + +}); + +unwrapExports(setConfiguration$2); + +var dateTimePeriodParser = createCommonjsModule(function (module, exports) { +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); + + + + +class SpanishDateTimePeriodParser extends baseDateTimePeriod.BaseDateTimePeriodParser { + constructor(config) { + super(config); + } + parseSpecificTimeOfDay(source, referenceDate) { + let ret = new utilities$2.DateTimeResolutionResult(); + let trimedText = source.trim().toLowerCase(); + // handle morning, afternoon.. + let match = this.config.getMatchedTimeRange(trimedText); + let beginHour = match.beginHour; + let endHour = match.endHour; + let endMin = match.endMin; + let timeStr = match.timeStr; + if (!match.success) { + return ret; + } + let matches = recognizersText.RegExpUtility.getMatches(this.config.specificTimeOfDayRegex, trimedText); + if (matches.length && matches[0].index === 0 && matches[0].length === trimedText.length) { + let swift = this.config.getSwiftPrefix(trimedText); + let date = utilities$2.DateUtils.addDays(referenceDate, swift); + date.setHours(0, 0, 0, 0); + let day = date.getDate(); + let month = date.getMonth(); + let year = date.getFullYear(); + + ret.timex = utilities$2.FormatUtil.formatDate(date) + timeStr; + ret.pastValue = ret.futureValue = [ + utilities$2.DateUtils.safeCreateFromValue(utilities$2.DateUtils.minValue(), year, month, day, beginHour, 0, 0), + utilities$2.DateUtils.safeCreateFromValue(utilities$2.DateUtils.minValue(), year, month, day, endHour, endMin, endMin), + ]; + ret.success = true; + return ret; + } + let startIndex = trimedText.indexOf(spanishDateTime.SpanishDateTime.Tomorrow) === 0 ? spanishDateTime.SpanishDateTime.Tomorrow.length : 0; + // handle Date followed by morning, afternoon + // Add handling code to handle morning, afternoon followed by Date + // Add handling code to handle early/late morning, afternoon + // TODO: use regex from config: match = this.config.TimeOfDayRegex.Match(trimedText.Substring(startIndex)); + matches = recognizersText.RegExpUtility.getMatches(recognizersText.RegExpUtility.getSafeRegExp(spanishDateTime.SpanishDateTime.TimeOfDayRegex), trimedText.substring(startIndex)); + if (matches.length) { + let match = matches[0]; + let beforeStr = trimedText.substring(0, match.index + startIndex).trim(); + let ers = this.config.dateExtractor.extract(beforeStr, referenceDate); + if (ers.length === 0) { + return ret; + } + let pr = this.config.dateParser.parse(ers[0], referenceDate); + let futureDate = pr.value.futureValue; + let pastDate = pr.value.pastValue; + ret.timex = pr.timexStr + timeStr; + ret.futureValue = [ + utilities$2.DateUtils.safeCreateFromValue(utilities$2.DateUtils.minValue(), futureDate.getFullYear(), futureDate.getMonth(), futureDate.getDate(), beginHour, 0, 0), + utilities$2.DateUtils.safeCreateFromValue(utilities$2.DateUtils.minValue(), futureDate.getFullYear(), futureDate.getMonth(), futureDate.getDate(), endHour, endMin, endMin) + ]; + ret.pastValue = [ + utilities$2.DateUtils.safeCreateFromValue(utilities$2.DateUtils.minValue(), pastDate.getFullYear(), pastDate.getMonth(), pastDate.getDate(), beginHour, 0, 0), + utilities$2.DateUtils.safeCreateFromValue(utilities$2.DateUtils.minValue(), pastDate.getFullYear(), pastDate.getMonth(), pastDate.getDate(), endHour, endMin, endMin) + ]; + ret.success = true; + return ret; + } + return ret; + } +} +exports.SpanishDateTimePeriodParser = SpanishDateTimePeriodParser; + +}); + +unwrapExports(dateTimePeriodParser); + +var mergedConfiguration$2 = createCommonjsModule(function (module, exports) { +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); + + + + + + + + + + + + + + + + + + + + + + + +class SpanishMergedExtractorConfiguration { + constructor() { + this.beforeRegex = recognizersText.RegExpUtility.getSafeRegExp(spanishDateTime.SpanishDateTime.BeforeRegex); + this.afterRegex = recognizersText.RegExpUtility.getSafeRegExp(spanishDateTime.SpanishDateTime.AfterRegex); + this.sinceRegex = recognizersText.RegExpUtility.getSafeRegExp(spanishDateTime.SpanishDateTime.SinceRegex); + this.fromToRegex = recognizersText.RegExpUtility.getSafeRegExp(spanishDateTime.SpanishDateTime.FromToRegex); + this.singleAmbiguousMonthRegex = recognizersText.RegExpUtility.getSafeRegExp(spanishDateTime.SpanishDateTime.SingleAmbiguousMonthRegex); + this.prepositionSuffixRegex = recognizersText.RegExpUtility.getSafeRegExp(spanishDateTime.SpanishDateTime.PrepositionSuffixRegex); + this.numberEndingPattern = recognizersText.RegExpUtility.getSafeRegExp(spanishDateTime.SpanishDateTime.NumberEndingPattern); + this.dateExtractor = new baseDate.BaseDateExtractor(new dateConfiguration$2.SpanishDateExtractorConfiguration()); + this.timeExtractor = new baseTime.BaseTimeExtractor(new timeConfiguration$2.SpanishTimeExtractorConfiguration()); + this.dateTimeExtractor = new baseDateTime$2.BaseDateTimeExtractor(new dateTimeConfiguration$2.SpanishDateTimeExtractorConfiguration()); + this.datePeriodExtractor = new baseDatePeriod.BaseDatePeriodExtractor(new datePeriodConfiguration$2.SpanishDatePeriodExtractorConfiguration()); + this.timePeriodExtractor = new baseTimePeriod.BaseTimePeriodExtractor(new timePeriodConfiguration$2.SpanishTimePeriodExtractorConfiguration()); + this.dateTimePeriodExtractor = new baseDateTimePeriod.BaseDateTimePeriodExtractor(new dateTimePeriodConfiguration$2.SpanishDateTimePeriodExtractorConfiguration()); + this.durationExtractor = new baseDuration.BaseDurationExtractor(new durationConfiguration$2.SpanishDurationExtractorConfiguration()); + this.setExtractor = new baseSet.BaseSetExtractor(new setConfiguration$2.SpanishSetExtractorConfiguration()); + this.holidayExtractor = new baseHoliday.BaseHolidayExtractor(new holidayConfiguration$2.SpanishHolidayExtractorConfiguration()); + this.integerExtractor = new recognizersTextNumber.SpanishIntegerExtractor(); + this.filterWordRegexList = []; + } +} +exports.SpanishMergedExtractorConfiguration = SpanishMergedExtractorConfiguration; +class SpanishMergedParserConfiguration extends baseConfiguration$2.SpanishCommonDateTimeParserConfiguration { + constructor() { + super(); + this.beforeRegex = recognizersText.RegExpUtility.getSafeRegExp(spanishDateTime.SpanishDateTime.BeforeRegex); + this.afterRegex = recognizersText.RegExpUtility.getSafeRegExp(spanishDateTime.SpanishDateTime.AfterRegex); + this.sinceRegex = recognizersText.RegExpUtility.getSafeRegExp(spanishDateTime.SpanishDateTime.SinceRegex); + this.datePeriodParser = new baseDatePeriod.BaseDatePeriodParser(new datePeriodConfiguration$2.SpanishDatePeriodParserConfiguration(this)); + this.timePeriodParser = new baseTimePeriod.BaseTimePeriodParser(new timePeriodConfiguration$2.SpanishTimePeriodParserConfiguration(this)); + this.dateTimePeriodParser = new dateTimePeriodParser.SpanishDateTimePeriodParser(new dateTimePeriodConfiguration$2.SpanishDateTimePeriodParserConfiguration(this)); + this.setParser = new baseSet.BaseSetParser(new setConfiguration$2.SpanishSetParserConfiguration(this)); + this.holidayParser = new baseHoliday.BaseHolidayParser(new holidayConfiguration$2.SpanishHolidayParserConfiguration()); + } +} +exports.SpanishMergedParserConfiguration = SpanishMergedParserConfiguration; + +}); + +unwrapExports(mergedConfiguration$2); + +var frenchDateTime = createCommonjsModule(function (module, exports) { +"use strict"; +// ------------------------------------------------------------------------------ +// +// This code was generated by a tool. +// Changes to this file may cause incorrect behavior and will be lost if +// the code is regenerated. +// +// ------------------------------------------------------------------------------ +Object.defineProperty(exports, "__esModule", { value: true }); + +var FrenchDateTime; +(function (FrenchDateTime) { + FrenchDateTime.TillRegex = `(?au|[aà]|et|jusqu'[aà]|avant|--|-|—|——)`; + FrenchDateTime.RangeConnectorRegex = `(?et|de la|au|[aà]|et\\s*la|--|-|—|——)`; + FrenchDateTime.RelativeRegex = `(?prochain|prochaine|de|du|ce|cette|l[ae]|derni[eè]re|pr[eé]c[eé]dente|au\\s+cours+(de|du\\s*))`; + FrenchDateTime.NextSuffixRegex = `(?prochain|prochaine|prochaines|suivante)\\b`; + FrenchDateTime.PastSuffixRegex = `(?dernier|derni[eè]re|pr[eé]c[eé]dente)\\b`; + FrenchDateTime.ThisPrefixRegex = `(?ce|cette|au\\s+cours+(du|de))\\b`; + FrenchDateTime.DayRegex = `(?01|02|03|04|05|06|07|08|09|10|11|11e|12|12e|13|13e|14|14e|15|15e|16|16e|17|17e|18|18e|19|19e|1er|1|21|21e|20|20e|22|22e|23|23e|24|24e|25|25e|26|26e|27|27e|28|28e|29|29e|2|2e|30|30e|31|31e|3|3e|4|4e|5|5e|6|6e|7|7e|8|8e|9|9e)(?=\\b|t)`; + FrenchDateTime.MonthNumRegex = `(?01|02|03|04|05|06|07|08|09|10|11|12|1|2|3|4|5|6|7|8|9)\\b`; + FrenchDateTime.DescRegex = `(?h|ampm|am\\b|a\\.m\\.|a m\\b|a\\. m\\.|a\\.m\\b|a\\. m\\b|pm\\b|p\\.m\\.|p m\\b|p\\. m\\.|p\\.m\\b|p\\. m\\b|p\\b\\b)`; + FrenchDateTime.AmDescRegex = `(h|am\\b|a\\.m\\.|a m\\b|a\\. m\\.|a\\.m\\b|a\\. m\\b)`; + FrenchDateTime.PmDescRegex = `(h|pm\\b|p\\.m\\.|p\\b|p m\\b|p\\. m\\.|p\\.m\\b|p\\. m\\b)`; + FrenchDateTime.AmPmDescRegex = `(h|ampm)`; + FrenchDateTime.TwoDigitYearRegex = `\\b(?([0-27-9]\\d))(?!(\\s*((\\:)|${FrenchDateTime.AmDescRegex}|${FrenchDateTime.PmDescRegex}|\\.\\d)))\\b`; + FrenchDateTime.FullTextYearRegex = `^[\\*]`; + FrenchDateTime.YearRegex = `(${baseDateTime.BaseDateTime.FourDigitYearRegex}|${FrenchDateTime.FullTextYearRegex})`; + FrenchDateTime.WeekDayRegex = `(?Dimanche|Lundi|Mardi|Mercredi|Jeudi|Vendredi|Samedi|Lun|Mar|Mer|Jeu|Ven|Sam|Dim)\\b`; + FrenchDateTime.RelativeMonthRegex = `(?(${FrenchDateTime.ThisPrefixRegex}\\s+mois)|(mois\\s+${FrenchDateTime.PastSuffixRegex})|(mois\\s+${FrenchDateTime.NextSuffixRegex}))\\b`; + FrenchDateTime.WrittenMonthRegex = `(?Avril|Avr\\.|Avr|Août|D[eé]cembre|D[eé]c|D[eé]c\\.|F[eé]vrier|F[eé]v|F[eé]vr\\.|F[eé]vr|Javier|Jan|Janv\\.|Janv|Juillet|Jul|Juil|Juil\\.|Juin|Jun|Mars|Mar|Mai|Novembre|Nov|Nov\\.|Octobre|Oct|Oct\\.|Septembre|Sep|Sept|Sept\\.)`; + FrenchDateTime.MonthSuffixRegex = `(?(en\\s*|le\\s*|de\\s*|dans\\s*)?(${FrenchDateTime.RelativeMonthRegex}|${FrenchDateTime.WrittenMonthRegex}))`; + FrenchDateTime.DateUnitRegex = `(?l'ann[eé]e|ann[eé]es|an|mois|semaines|semaine|jours|jour|journ[eé]e|journ[eé]es)\\b`; + FrenchDateTime.SimpleCasesRegex = `\\b((d[ue])|entre\\s+)?(${FrenchDateTime.DayRegex})\\s*${FrenchDateTime.TillRegex}\\s*(${FrenchDateTime.DayRegex})\\s+${FrenchDateTime.MonthSuffixRegex}((\\s+|\\s*,\\s*)${FrenchDateTime.YearRegex})?\\b`; + FrenchDateTime.MonthFrontSimpleCasesRegex = `\\b((d[ue]|entre)\\s+)?${FrenchDateTime.MonthSuffixRegex}\\s+((d[ue]|entre)\\s+)?(${FrenchDateTime.DayRegex})\\s*${FrenchDateTime.TillRegex}\\s*(${FrenchDateTime.DayRegex})((\\s+|\\s*,\\s*)${FrenchDateTime.YearRegex})?\\b`; + FrenchDateTime.MonthFrontBetweenRegex = `\\b${FrenchDateTime.MonthSuffixRegex}\\s+(entre|d[ue]\\s+)(${FrenchDateTime.DayRegex})\\s*${FrenchDateTime.RangeConnectorRegex}\\s*(${FrenchDateTime.DayRegex})((\\s+|\\s*,\\s*)${FrenchDateTime.YearRegex})?\\b`; + FrenchDateTime.BetweenRegex = `\\b(entre\\s+)(${FrenchDateTime.DayRegex})\\s*${FrenchDateTime.RangeConnectorRegex}\\s*(${FrenchDateTime.DayRegex})\\s+${FrenchDateTime.MonthSuffixRegex}((\\s+|\\s*,\\s*)${FrenchDateTime.YearRegex})?\\b`; + FrenchDateTime.YearWordRegex = `\\b(?l'ann[ée]e)\\b`; + FrenchDateTime.MonthWithYear = `\\b((?Avril|Avr\\.|Avr|Août|Aout|D[ée]cembre|D[eé]c|Dec\\.|F[eé]v|F[eé]vr|Fev|F[eé]vrier|F[eé]v\\.|Janvier|Jan|Janv|Janv\\.|Jan\\.|Jul|Juillet|Juil\\.|Jun|Juin|Mar|Mars|Mai|Novembre|Nov|Nov\\.|Octobre|Oct|Oct\\.|Septembre|Sep|Sept|Sept\\.)(\\s*),?(\\s+de)?(\\s*)(${FrenchDateTime.YearRegex}|(?cette)\\s*${FrenchDateTime.YearWordRegex})|${FrenchDateTime.YearWordRegex}\\s*(${FrenchDateTime.PastSuffixRegex}|${FrenchDateTime.NextSuffixRegex}))`; + FrenchDateTime.OneWordPeriodRegex = `\\b((${FrenchDateTime.RelativeRegex}\\s+)?(?Avril|Avr\\.|Avr|Août|Aout|D[eé]cembre|D[ée]c|D[eé]c\\.|F[eé]vrier|Fev|F[eé]v\\.|F[eé]vr|Janvier|Janv\\.|Janv|Jan|Jan\\.|Jul|Juillet|Juil\\.|Jun|Juin|Mar|Mars|Mai|Nov|Novembre|Nov\\.|Oct|Octobre|Oct\\.|Sep|Septembre|Sept\\.)|${FrenchDateTime.RelativeRegex}\\s+(weekend|fin de semaine|week-end|semaine|mois|ans|l'année)|weekend|week-end|(mois|l'année))\\b`; + FrenchDateTime.MonthNumWithYear = `(${FrenchDateTime.YearRegex}(\\s*)[/\\-\\.](\\s*)${FrenchDateTime.MonthNumRegex})|(${FrenchDateTime.MonthNumRegex}(\\s*)[/\\-](\\s*)${FrenchDateTime.YearRegex})`; + FrenchDateTime.WeekOfMonthRegex = `(?(le\\s+)?(?premier|1er|duexi[èe]me|2|troisi[èe]me|3|quatri[èe]me|4|cinqi[èe]me|5)\\s+semaine\\s+${FrenchDateTime.MonthSuffixRegex})`; + FrenchDateTime.WeekOfYearRegex = `(?(le\\s+)?(?premier|1er|duexi[èe]me|2|troisi[èe]me|3|quatri[èe]me|4|cinqi[èe]me|5)\\s+semaine(\\s+de)?\\s+(${FrenchDateTime.YearRegex}|${FrenchDateTime.RelativeRegex}\\s+ann[ée]e))`; + FrenchDateTime.FollowedDateUnit = `^\\s*${FrenchDateTime.DateUnitRegex}`; + FrenchDateTime.NumberCombinedWithDateUnit = `\\b(?\\d+(\\.\\d*)?)${FrenchDateTime.DateUnitRegex}`; + FrenchDateTime.QuarterRegex = `(le\\s+)?(?premier|1er|duexi[èe]me|2|troisi[èe]me|3|quatri[èe]me|4)\\s+quart(\\s+de|\\s*,\\s*)?\\s+(${FrenchDateTime.YearRegex}|${FrenchDateTime.RelativeRegex}\\s+l'ann[eé]e)`; + FrenchDateTime.QuarterRegexYearFront = `(${FrenchDateTime.YearRegex}|l'année\\s+(${FrenchDateTime.PastSuffixRegex}|${FrenchDateTime.NextSuffixRegex})|${FrenchDateTime.RelativeRegex}\\s+ann[eé]e)\\s+(le\\s+)?(?premier|1er|duexi[èe]me|2|troisi[èe]me|3|quatri[èe]me|4)\\s+quarts`; + FrenchDateTime.AllHalfYearRegex = `^[.]`; + FrenchDateTime.PrefixDayRegex = `^[.]`; + FrenchDateTime.CenturySuffixRegex = `^[.]`; + FrenchDateTime.SeasonRegex = `\\b((printemps|été|automne|hiver)+\\s*(${FrenchDateTime.NextSuffixRegex}|${FrenchDateTime.PastSuffixRegex}))|(?(${FrenchDateTime.RelativeRegex}\\s+)?(?printemps|[ée]t[ée]|automne|hiver)((\\s+de|\\s*,\\s*)?\\s+(${FrenchDateTime.YearRegex}|${FrenchDateTime.RelativeRegex}\\s+l'ann[eé]e))?)\\b`; + FrenchDateTime.WhichWeekRegex = `(semaine)(\\s*)(?\\d\\d|\\d|0\\d)`; + FrenchDateTime.WeekOfRegex = `(semaine)(\\s*)(de)`; + FrenchDateTime.MonthOfRegex = `(mois)(\\s*)(de)`; + FrenchDateTime.MonthRegex = `(?Avril|Avr|Avr\\.|Août|Aout|D[ée]cembre|D[eé]c|Dec\\.|F[eé]vrier|F[eé]vr|Fev|F[eé]v|F[eé]v\\.|Janvier|Janv\\.|Janv|Jan|Jan\\.|Juillet|Juil|Juil\\.|Juin|Mars|Mai|Novembre|Nov|Nov\\.|Octobre|Oct|Oct\\.|Septembre|Sep|Sept|Sept\\.)`; + FrenchDateTime.OnRegex = `(?<=\\b(en|sur\\s*l[ea]|sur)\\s+)(${FrenchDateTime.DayRegex}s?)\\b`; + FrenchDateTime.RelaxedOnRegex = `(?<=\\b(en|le|dans|sur\\s*l[ea]|du|sur)\\s+)((?10e|11e|12e|13e|14e|15e|16e|17e|18e|19e|1er|20e|21e|22e|23e|24e|25e|26e|27e|28e|29e|2e|30e|31e|3e|4e|5e|6e|7e|8e|9e)s?)\\b`; + FrenchDateTime.ThisRegex = `\\b((cette(\\s*semaine)?\\s+)${FrenchDateTime.WeekDayRegex})|(${FrenchDateTime.WeekDayRegex}(\\s+cette\\s*semaine))\\b`; + FrenchDateTime.LastDateRegex = `\\b((${FrenchDateTime.WeekDayRegex}(\\s*(de)?\\s*la\\s*semaine\\s+${FrenchDateTime.PastSuffixRegex}))|(${FrenchDateTime.WeekDayRegex}(\\s+${FrenchDateTime.PastSuffixRegex})))\\b`; + FrenchDateTime.NextDateRegex = `\\b((${FrenchDateTime.WeekDayRegex}(\\s+${FrenchDateTime.NextSuffixRegex}))|(${FrenchDateTime.WeekDayRegex}(\\s*(de)?\\s*la\\s*semaine\\s+${FrenchDateTime.NextSuffixRegex})))\\b`; + FrenchDateTime.SpecialDayRegex = `\\b(avant[\\s|-]hier|apr[eè]s(-demain|\\s*demain)|(le\\s)?jour suivant|(le\\s+)?dernier jour|hier|lendemain|demain|de la journ[ée]e|aujourd'hui)\\b`; + FrenchDateTime.SpecialDayWithNumRegex = `^[.]`; + FrenchDateTime.StrictWeekDay = `\\b(?Dimanche|Lundi|Mardi|Mercredi|Jeudi|Vendredi|Samedi|Lun|Mar|Mer|Jeu|Ven|Sam|Dim)s?\\b`; + FrenchDateTime.SetWeekDayRegex = `\\b(?le\\s+)?(?matin|matin[ée]e|apres-midi|soir[ée]e|soir|Dimanche|Lundi|Mardi|Mercredi|Jeudi|Vendredi|Samedi)s\\b`; + FrenchDateTime.WeekDayOfMonthRegex = `(?(le\\s+)?(?premier|1er|duexi[èe]me|2|troisi[èe]me|3|quatri[èe]me|4|cinqi[èe]me|5)\\s+${FrenchDateTime.WeekDayRegex}\\s+${FrenchDateTime.MonthSuffixRegex})`; + FrenchDateTime.RelativeWeekDayRegex = `^[.]`; + FrenchDateTime.NumberEndingPattern = `^[.]`; + FrenchDateTime.SpecialDate = `(?<=\\b([àa]|au|le)\\s+)${FrenchDateTime.DayRegex}\\b`; + FrenchDateTime.DateYearRegex = `(?${FrenchDateTime.YearRegex}|${FrenchDateTime.TwoDigitYearRegex})`; + FrenchDateTime.DateExtractor1 = `\\b(${FrenchDateTime.WeekDayRegex}(\\s+|\\s*,\\s*))?${FrenchDateTime.MonthRegex}\\s*[/\\\\\\.\\-]?\\s*${FrenchDateTime.DayRegex}\\b`; + FrenchDateTime.DateExtractor2 = `\\b(${FrenchDateTime.WeekDayRegex}(\\s+|\\s*,\\s*))?${FrenchDateTime.DayRegex}(\\s+|\\s*,\\s*|\\s+)${FrenchDateTime.MonthRegex}\\s*[\\.\\-]?\\s*${FrenchDateTime.DateYearRegex}\\b`; + FrenchDateTime.DateExtractor3 = `\\b(${FrenchDateTime.WeekDayRegex}(\\s+|\\s*,\\s*))?${FrenchDateTime.DayRegex}(\\s+|\\s*,\\s*|\\s*-\\s*)${FrenchDateTime.MonthRegex}((\\s+|\\s*,\\s*)${FrenchDateTime.DateYearRegex})?\\b`; + FrenchDateTime.DateExtractor4 = `\\b${FrenchDateTime.MonthNumRegex}\\s*[/\\\\\\-]\\s*${FrenchDateTime.DayRegex}\\s*[/\\\\\\-]\\s*${FrenchDateTime.DateYearRegex}`; + FrenchDateTime.DateExtractor5 = `\\b${FrenchDateTime.DayRegex}\\s*[/\\\\\\-\\.]\\s*${FrenchDateTime.MonthNumRegex}\\s*[/\\\\\\-\\.]\\s*${FrenchDateTime.DateYearRegex}`; + FrenchDateTime.DateExtractor6 = `(?<=\\b(le|sur|sur l[ae])\\s+)${FrenchDateTime.MonthNumRegex}[\\-\\.\\/]${FrenchDateTime.DayRegex}\\b`; + FrenchDateTime.DateExtractor7 = `\\b${FrenchDateTime.DayRegex}\\s*/\\s*${FrenchDateTime.MonthNumRegex}((\\s+|\\s*,\\s*)${FrenchDateTime.DateYearRegex})?\\b`; + FrenchDateTime.DateExtractor8 = `(?<=\\b(le)\\s+)${FrenchDateTime.DayRegex}[\\\\\\-]${FrenchDateTime.MonthNumRegex}\\b`; + FrenchDateTime.DateExtractor9 = `\\b${FrenchDateTime.DayRegex}\\s*/\\s*${FrenchDateTime.MonthNumRegex}((\\s+|\\s*,\\s*)${FrenchDateTime.DateYearRegex})?\\b`; + FrenchDateTime.DateExtractorA = `\\b${FrenchDateTime.DateYearRegex}\\s*[/\\\\\\-\\.]\\s*${FrenchDateTime.MonthNumRegex}\\s*[/\\\\\\-\\.]\\s*${FrenchDateTime.DayRegex}`; + FrenchDateTime.OfMonth = `^\\s*de\\s*${FrenchDateTime.MonthRegex}`; + FrenchDateTime.MonthEnd = `${FrenchDateTime.MonthRegex}\\s*(le)?\\s*$`; + FrenchDateTime.WeekDayEnd = `${FrenchDateTime.WeekDayRegex}\\s*,?\\s*$`; + FrenchDateTime.RangeUnitRegex = `\\b(?l'année|ann[eé]e(s)?|mois|semaines|semaine)\\b`; + FrenchDateTime.HourNumRegex = `\\b(?zero|un|deux|trois|quatre|cinq|six|sept|huit|neuf|dix|onze|douze|treize|quatorze|quinze|dix-six|dix-sept|dix-huit|dix-neuf|vingt|vingt-et-un|vingt-deux|vingt-trois)\\b`; + FrenchDateTime.MinuteNumRegex = `(?un|deux|trois|quatre|cinq|six|sept|huit|neuf|dix|onze|douze|treize|quatorze|quinze|seize|dix-sept|dix-huit|dix-neuf|vingt|trente|quarante|cinquante)`; + FrenchDateTime.DeltaMinuteNumRegex = `(?un|deux|trois|quatre|cinq|six|sept|huit|neuf|dix|onze|douze|treize|quatorze|quinze|seize|dix-sept|dix-huit|dix-neuf|vingt|trente|quarante|cinquante)`; + FrenchDateTime.OclockRegex = `(?heure|heures|h)`; + FrenchDateTime.PmRegex = `(?(dans l'\\s*)?apr[eè]s(\\s*|-)midi|(du|ce|de|le)\\s*(soir[ée]e|soir)|(dans l[ea]\\s+)?(nuit|soir[eé]e))`; + FrenchDateTime.AmRegex = `(?(du|de|ce|(du|de|dans)\\s*l[ea]|le)?\\s*matin[ée]e|(du|de|ce|dans l[ea]|le)?\\s*matin)`; + FrenchDateTime.LessThanOneHour = `(?(une\\s+)?quart|trois quart(s)?|demie( heure)?|${baseDateTime.BaseDateTime.DeltaMinuteRegex}(\\s+(minute|minutes|min|mins))|${FrenchDateTime.DeltaMinuteNumRegex}(\\s+(minute|minutes|min|mins)))`; + FrenchDateTime.WrittenTimeRegex = `(?${FrenchDateTime.HourNumRegex}\\s+(${FrenchDateTime.MinuteNumRegex}|(?vingt|trente|quarante|cinquante)\\s+${FrenchDateTime.MinuteNumRegex}))`; + FrenchDateTime.TimePrefix = `(?(heures\\s*et\\s+${FrenchDateTime.LessThanOneHour}|et ${FrenchDateTime.LessThanOneHour}|${FrenchDateTime.LessThanOneHour} [àa]))`; + FrenchDateTime.TimeSuffix = `(?${FrenchDateTime.AmRegex}|${FrenchDateTime.PmRegex}|${FrenchDateTime.OclockRegex})`; + FrenchDateTime.BasicTime = `(?${FrenchDateTime.WrittenTimeRegex}|${FrenchDateTime.HourNumRegex}|${baseDateTime.BaseDateTime.HourRegex}:${baseDateTime.BaseDateTime.MinuteRegex}(:${baseDateTime.BaseDateTime.SecondRegex})?|${baseDateTime.BaseDateTime.HourRegex})`; + FrenchDateTime.MidnightRegex = `(?minuit)`; + FrenchDateTime.CommonDatePrefixRegex = `^[\\.]`; + FrenchDateTime.MorningRegex = `(?matin[ée]e|matin)`; + FrenchDateTime.AfternoonRegex = `(?(d'|l')?apr[eè]s(-|\\s*)midi)`; + FrenchDateTime.MidmorningRegex = `(?milieu\\s*d[ue]\\s*${FrenchDateTime.MorningRegex})`; + FrenchDateTime.MiddayRegex = `(?milieu(\\s*|-)d[eu]\\s*(jour|midi)|apr[eè]s(-|\\s*)midi)`; + FrenchDateTime.MidafternoonRegex = `(?milieu\\s*d'+${FrenchDateTime.AfternoonRegex})`; + FrenchDateTime.MidTimeRegex = `(?(${FrenchDateTime.MidnightRegex}|${FrenchDateTime.MidmorningRegex}|${FrenchDateTime.MidafternoonRegex}|${FrenchDateTime.MiddayRegex}))`; + FrenchDateTime.AtRegex = `\\b(((?<=\\b[àa]\\s+)(${FrenchDateTime.WrittenTimeRegex}|${FrenchDateTime.HourNumRegex}|${baseDateTime.BaseDateTime.HourRegex}|${FrenchDateTime.MidTimeRegex}))|${FrenchDateTime.MidTimeRegex})\\b`; + FrenchDateTime.IshRegex = `\\b(peu\\s*pr[èe]s\\s*${baseDateTime.BaseDateTime.HourRegex}|peu\\s*pr[èe]s\\s*${FrenchDateTime.WrittenTimeRegex}|peu\\s*pr[èe]s\\s*[àa]\\s*${baseDateTime.BaseDateTime.HourRegex}|peu pr[èe]s midi)\\b`; + FrenchDateTime.TimeUnitRegex = `(?heures|heure|hrs|hr|h|minutes|minute|mins|min|secondes|seconde|secs|sec)\\b`; + FrenchDateTime.RestrictedTimeUnitRegex = `(?huere|minute)\\b`; + FrenchDateTime.ConnectNumRegex = `${baseDateTime.BaseDateTime.HourRegex}(?00|01|02|03|04|05|06|07|08|09|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)\\s*${FrenchDateTime.DescRegex}`; + FrenchDateTime.FivesRegex = `(?(quinze|vingt(\\s*|-*(cinq))?|trente(\\s*|-*(cinq))?|quarante(\\s*|-*(cinq))??|cinquante(\\s*|-*(cinq))?|dix|cinq))\\b`; + FrenchDateTime.PeriodHourNumRegex = `(?vingt-et-un|vingt-deux|vingt-trois|vingt-quatre|zero|une|deux|trois|quatre|cinq|six|sept|huit|neuf|dix|onze|douze|treize|quatorze|quinze|seize|dix-sept|dix-huit|dix-neuf|vingt)`; + FrenchDateTime.TimeRegex1 = `\\b(${FrenchDateTime.WrittenTimeRegex}|${FrenchDateTime.HourNumRegex}|${baseDateTime.BaseDateTime.HourRegex})\\s*${FrenchDateTime.DescRegex}(\\s+${FrenchDateTime.TimePrefix})?`; + FrenchDateTime.TimeRegex2 = `(\\b${FrenchDateTime.TimePrefix}\\s+)?(T)?${baseDateTime.BaseDateTime.HourRegex}(\\s*)?:(\\s*)?${baseDateTime.BaseDateTime.MinuteRegex}((\\s*)?:(\\s*)?${baseDateTime.BaseDateTime.SecondRegex})?((\\s*${FrenchDateTime.DescRegex})|\\b)`; + FrenchDateTime.TimeRegex3 = `\\b${baseDateTime.BaseDateTime.HourRegex}\\.${baseDateTime.BaseDateTime.MinuteRegex}(\\s*${FrenchDateTime.DescRegex})(\\s+${FrenchDateTime.TimePrefix})?`; + FrenchDateTime.TimeRegex4 = `\\b${FrenchDateTime.BasicTime}(\\s*${FrenchDateTime.DescRegex})?(\\s+${FrenchDateTime.TimePrefix})?\\s+${FrenchDateTime.TimeSuffix}\\b`; + FrenchDateTime.TimeRegex5 = `\\b${FrenchDateTime.BasicTime}((\\s*${FrenchDateTime.DescRegex})|\\b)(\\s+${FrenchDateTime.TimePrefix})?`; + FrenchDateTime.TimeRegex6 = `${FrenchDateTime.BasicTime}(\\s*${FrenchDateTime.DescRegex})?\\s+${FrenchDateTime.TimeSuffix}\\b`; + FrenchDateTime.TimeRegex7 = `\\b${FrenchDateTime.TimeSuffix}\\s+[àa]\\s+${FrenchDateTime.BasicTime}((\\s*${FrenchDateTime.DescRegex})|\\b)`; + FrenchDateTime.TimeRegex8 = `\\b${FrenchDateTime.TimeSuffix}\\s+${FrenchDateTime.BasicTime}((\\s*${FrenchDateTime.DescRegex})|\\b)`; + FrenchDateTime.TimeRegex9 = `\\b${FrenchDateTime.PeriodHourNumRegex}\\s+${FrenchDateTime.FivesRegex}((\\s*${FrenchDateTime.DescRegex})|\\b)`; + FrenchDateTime.TimeRegex10 = `\\b${baseDateTime.BaseDateTime.HourRegex}(\\s*h\\s*)${baseDateTime.BaseDateTime.MinuteRegex}(\\s*${FrenchDateTime.DescRegex})?(\\s+${FrenchDateTime.TimePrefix})?`; + FrenchDateTime.HourRegex = `\\b${baseDateTime.BaseDateTime.HourRegex}`; + FrenchDateTime.PeriodDescRegex = `(?pm|am|p\\.m\\.|a\\.m\\.|p)`; + FrenchDateTime.PeriodPmRegex = `(?dans l'apr[eè]s-midi|ce soir|d[eu] soir|dans l[ea] soir[eé]e|dans la nuit|d[eu] soir[ée]e)s?`; + FrenchDateTime.PeriodAmRegex = `(?matin|d[eu] matin|matin[ée]e)s?`; + FrenchDateTime.PureNumFromTo = `((du|de|des|depuis)\\s+)?(${FrenchDateTime.HourRegex}|${FrenchDateTime.PeriodHourNumRegex})(\\s*(?${FrenchDateTime.PeriodDescRegex}))?\\s*${FrenchDateTime.TillRegex}\\s*(${FrenchDateTime.HourRegex}|${FrenchDateTime.PeriodHourNumRegex})\\s*(?${FrenchDateTime.PmRegex}|${FrenchDateTime.AmRegex}|${FrenchDateTime.PeriodDescRegex})?`; + FrenchDateTime.PureNumBetweenAnd = `(entre\\s+)(${FrenchDateTime.HourRegex}|${FrenchDateTime.PeriodHourNumRegex})(\\s*(?${FrenchDateTime.PeriodDescRegex}))?\\s*${FrenchDateTime.RangeConnectorRegex}\\s*(${FrenchDateTime.HourRegex}|${FrenchDateTime.PeriodHourNumRegex})\\s*(?${FrenchDateTime.PmRegex}|${FrenchDateTime.AmRegex}|${FrenchDateTime.PeriodDescRegex})?`; + FrenchDateTime.SpecificTimeFromTo = `^[.]`; + FrenchDateTime.SpecificTimeBetweenAnd = `^[.]`; + FrenchDateTime.PrepositionRegex = `(?^([aà] la|en|sur\\s*l[ea]|sur|de)$)`; + FrenchDateTime.TimeOfDayRegex = `\\b(?((((dans\\s+(l[ea])?\\s+)?((?d[eé]but(\\s+|-)|t[oô]t(\\s+|-)(l[ea]\\s*)?)|(?fin\\s*|fin de(\\s+(la)?)|tard\\s*))?(matin[ée]e|matin|((d|l)?'?)apr[eè]s[-|\\s*]midi|nuit|soir[eé]e|soir)))|(((\\s+(l[ea])?\\s+)?)(jour|journ[eé]e)))s?)\\b`; + FrenchDateTime.SpecificTimeOfDayRegex = `\\b((${FrenchDateTime.RelativeRegex}\\s+${FrenchDateTime.TimeOfDayRegex})|(${FrenchDateTime.TimeOfDayRegex}\\s*(${FrenchDateTime.NextSuffixRegex}))\\b|\\bsoir|\\bdu soir)s?\\b`; + FrenchDateTime.TimeFollowedUnit = `^\\s*${FrenchDateTime.TimeUnitRegex}`; + FrenchDateTime.TimeNumberCombinedWithUnit = `\\b(?\\d+(\\.\\d*)?)${FrenchDateTime.TimeUnitRegex}`; + FrenchDateTime.NowRegex = `\\b(?(ce\\s+)?moment|maintenant|d[eè]s que possible|dqp|r[eé]cemment|auparavant)\\b`; + FrenchDateTime.SuffixRegex = `^\\s*(dans\\s+l[ea]\\s+)|(en\\s+)|(du)?(matin|matin([eé]e)?|apr[eè]s-midi|soir[eé]e|nuit)\\b`; + FrenchDateTime.DateTimeTimeOfDayRegex = `\\b(?matin[ée]e|matin|apr[eè]s-midi|nuit|soir)\\b`; + FrenchDateTime.DateTimeSpecificTimeOfDayRegex = `\\b((${FrenchDateTime.RelativeRegex}\\s+${FrenchDateTime.DateTimeTimeOfDayRegex})\\b|\\b(ce|cette\\s+)(soir|nuit))\\b`; + FrenchDateTime.TimeOfTodayAfterRegex = `^\\s*(,\\s*)?(en|dans|du\\s+)?${FrenchDateTime.DateTimeSpecificTimeOfDayRegex}`; + FrenchDateTime.TimeOfTodayBeforeRegex = `${FrenchDateTime.DateTimeSpecificTimeOfDayRegex}(\\s*,)?(\\s+([àa]|pour))?\\s*$`; + FrenchDateTime.SimpleTimeOfTodayAfterRegex = `(${FrenchDateTime.HourNumRegex}|${baseDateTime.BaseDateTime.HourRegex})\\s*(,\\s*)?(en|[àa]\\s+)?${FrenchDateTime.DateTimeSpecificTimeOfDayRegex}`; + FrenchDateTime.SimpleTimeOfTodayBeforeRegex = `${FrenchDateTime.DateTimeSpecificTimeOfDayRegex}(\\s*,)?(\\s+([àa]|vers))?\\s*(${FrenchDateTime.HourNumRegex}|${baseDateTime.BaseDateTime.HourRegex})`; + FrenchDateTime.TheEndOfRegex = `(la\\s+)?fin(\\s+de\\s*|\\s*de*l[ea])?\\s*$`; + FrenchDateTime.PeriodTimeOfDayRegex = `\\b((dans\\s+(le)?\\s+)?((?d[eé]but(\\s+|-|d[ue]|de la)|t[oô]t)|(?tard\\s*|fin(\\s+|-|d[eu])?))?(?matin|((d|l)?'?)apr[eè]s-midi|nuit|soir[eé]e|soir))\\b`; + FrenchDateTime.PeriodSpecificTimeOfDayRegex = `\\b((${FrenchDateTime.RelativeRegex}\\s+${FrenchDateTime.PeriodTimeOfDayRegex})\\b|\\b(ce|cette\\s+)(soir|nuit))\\b`; + FrenchDateTime.PeriodTimeOfDayWithDateRegex = `\\b((${FrenchDateTime.TimeOfDayRegex}))\\b`; + FrenchDateTime.LessThanRegex = `^[.]`; + FrenchDateTime.MoreThanRegex = `^[.]`; + FrenchDateTime.DurationUnitRegex = `(?ans|ann[eé]e|mois|semaines|semaine|jour|jours|heures|heure|hrs|hr|h|minutes|minute|mins|min|secondes|seconde|secs|sec|ann[eé]es|journ[eé]e)\\b`; + FrenchDateTime.SuffixAndRegex = `(?\\s*(et)\\s+((un|une)\\s+)?(?demi|quart))`; + FrenchDateTime.PeriodicRegex = `\\b(?quotidienne|quotidien|journellement|mensuel|mensuelle|jour|jours|hebdomadaire|bihebdomadaire|annuellement|annuel)\\b`; + FrenchDateTime.EachUnitRegex = `(?(chaque|toutes les|tous les)(?\\s+autres)?\\s*${FrenchDateTime.DurationUnitRegex})`; + FrenchDateTime.EachPrefixRegex = `\\b(?(chaque|tous les|(toutes les))\\s*$)`; + FrenchDateTime.SetEachRegex = `\\b(?(chaque|tous les|(toutes les))\\s*)`; + FrenchDateTime.SetLastRegex = `(?prochain|dernier|derni[eè]re|pass[ée]s|pr[eé]c[eé]dent|courant|en\\s*cours)`; + FrenchDateTime.EachDayRegex = `^\\s*(chaque|tous les)\\s*(jour|jours)\\b`; + FrenchDateTime.DurationFollowedUnit = `^\\s*${FrenchDateTime.SuffixAndRegex}?(\\s+|-)?${FrenchDateTime.DurationUnitRegex}`; + FrenchDateTime.NumberCombinedWithDurationUnit = `\\b(?\\d+(\\.\\d*)?)(-)?${FrenchDateTime.DurationUnitRegex}`; + FrenchDateTime.AnUnitRegex = `\\b(((?demi\\s+)?(-)\\s+${FrenchDateTime.DurationUnitRegex}))`; + FrenchDateTime.DuringRegex = `^[.]`; + FrenchDateTime.AllRegex = `\\b(?toute\\s(l['ea])\\s?(?ann[eé]e|mois|semaine|semaines|jour|jours|journ[eé]e))\\b`; + FrenchDateTime.HalfRegex = `(((un|une)\\s*)|\\b)(?demi?(\\s*|-)+(?ann[eé]e|ans|mois|semaine|jour|heure))\\b`; + FrenchDateTime.ConjunctionRegex = `\\b((et(\\s+de|pour)?)|avec)\\b`; + FrenchDateTime.HolidayRegex1 = `\\b(?vendredi saint|mercredi des cendres|p[aâ]ques|l'action de gr[âa]ce|mardi gras|la saint-sylvestre|la saint sylvestre|la Saint-Valentin|la saint valentin|nouvel an chinois|nouvel an|r[eé]veillon de Nouvel an|jour de l'an|premier-mai|ler-mai|1-mai|poisson d'avril|r[eé]veillon de No[eë]l|veille de no[eë]l|noël|noel|thanksgiving|halloween|yuandan)(\\s+((d[ue]\\s+|d'))?(${FrenchDateTime.YearRegex}|(${FrenchDateTime.ThisPrefixRegex}\\s+)ann[eé]e|ann[eé]e\\s+(${FrenchDateTime.PastSuffixRegex}|${FrenchDateTime.NextSuffixRegex})))?\\b`; + FrenchDateTime.HolidayRegex2 = `\\b(?martin luther king|martin luther king jr|toussaint|st patrick|st george|cinco de mayo|l'ind[eé]pendance|guy fawkes)(\\s+(de\\s+)?(${FrenchDateTime.YearRegex}|${FrenchDateTime.ThisPrefixRegex}\\s+ann[eé]e|ann[eé]e\\s+(${FrenchDateTime.PastSuffixRegex}|${FrenchDateTime.NextSuffixRegex})))?\\b`; + FrenchDateTime.HolidayRegex3 = `(?(jour\\s*(d[eu]|des)\\s*(canberra|p[aâ]ques|colomb|bastille|la prise de la bastille|l'ind[eé]pendance|l'ind[eé]pendance am[eé]ricaine|thanks\\s*giving|bapt[êe]me|nationale|d'armistice|inaugueration|marmotte|assomption|femme|comm[ée]moratif)))(\\s+(de\\s+)?(${FrenchDateTime.YearRegex}|${FrenchDateTime.ThisPrefixRegex}\\s+ann[eé]e|ann[eé]e\\s+(${FrenchDateTime.PastSuffixRegex}|${FrenchDateTime.NextSuffixRegex})))?`; + FrenchDateTime.HolidayRegex4 = `(?(F[eê]te\\s*(d[eu]|des)\\s*)(travail|m[eè]re|m[eè]res|p[eè]re|p[eè]res))(\\s+(de\\s+)?(${FrenchDateTime.YearRegex}|${FrenchDateTime.ThisPrefixRegex}\\s+ann[eé]e|ann[eé]e\\s+(${FrenchDateTime.PastSuffixRegex}|${FrenchDateTime.NextSuffixRegex})))?\\b`; + FrenchDateTime.DateTokenPrefix = 'le '; + FrenchDateTime.TimeTokenPrefix = 'à '; + FrenchDateTime.TokenBeforeDate = 'le '; + FrenchDateTime.TokenBeforeTime = 'à '; + FrenchDateTime.AMTimeRegex = `(?matin[ée]e|matin)`; + FrenchDateTime.PMTimeRegex = `\\b(?(d'|l')?apr[eè]s-midi|soir|nuit|\\s*ce soir|du soir)\\b`; + FrenchDateTime.BeforeRegex = `\\b(avant)\\b`; + FrenchDateTime.BeforeRegex2 = `\\b(entre\\s*(le|la(s)?)?)\\b`; + FrenchDateTime.AfterRegex = `\\b(apres)\\b`; + FrenchDateTime.SinceRegex = `\\b(depuis)\\b`; + FrenchDateTime.AroundRegex = `^[.]`; + FrenchDateTime.AgoPrefixRegex = `\\b(y a)\\b`; + FrenchDateTime.LaterRegex = `\\b(plus tard)\\b`; + FrenchDateTime.AgoRegex = `^[.]`; + FrenchDateTime.InConnectorRegex = `\\b(dans|en|sur)\\b`; + FrenchDateTime.WithinNextPrefixRegex = `^[.]`; + FrenchDateTime.MorningStartEndRegex = `(^(matin))|((matin)$)`; + FrenchDateTime.AfternoonStartEndRegex = `(^((d'|l')?apr[eè]s-midi))|(((d'|l')?apr[eè]s-midi)$)`; + FrenchDateTime.EveningStartEndRegex = `(^(soir[ée]e|soir))|((soir[ée]e|soir)$)`; + FrenchDateTime.NightStartEndRegex = `(^(nuit))|((nuit)$)`; + FrenchDateTime.InexactNumberRegex = `\\b(quelque|quel qu[ée]s|quelqu[ée]s|plusieur|plusieurs|divers)\\b`; + FrenchDateTime.InexactNumberUnitRegex = `(${FrenchDateTime.InexactNumberRegex})\\s+(${FrenchDateTime.DurationUnitRegex})`; + FrenchDateTime.RelativeTimeUnitRegex = `((((${FrenchDateTime.ThisPrefixRegex})?)\\s+(${FrenchDateTime.TimeUnitRegex}(\\s*${FrenchDateTime.NextSuffixRegex}|${FrenchDateTime.PastSuffixRegex})?))|((le))\\s+(${FrenchDateTime.RestrictedTimeUnitRegex}))`; + FrenchDateTime.RelativeDurationUnitRegex = `(((?<=(${FrenchDateTime.ThisPrefixRegex})\\s+)?\\b(${FrenchDateTime.DurationUnitRegex})(\\s+${FrenchDateTime.NextSuffixRegex}|${FrenchDateTime.PastSuffixRegex})?)|((le|my))\\s+(${FrenchDateTime.RestrictedTimeUnitRegex}))`; + FrenchDateTime.ReferenceDatePeriodRegex = `^[.]`; + FrenchDateTime.ConnectorRegex = `^(,|pour|t|vers)$`; + FrenchDateTime.ConnectorAndRegex = `\\b(et\\s*(le|la(s)?)?)\\b.+`; + FrenchDateTime.FromRegex = `((de|du)?)$`; + FrenchDateTime.FromRegex2 = `((depuis|de)(\\s*la(s)?)?)$`; + FrenchDateTime.FromToRegex = `\\b(du|de|des|depuis).+(à|a|au)\\b.+`; + FrenchDateTime.SingleAmbiguousMonthRegex = `^(le\\s+)?(may|march)$`; + FrenchDateTime.UnspecificDatePeriodRegex = `^[.]`; + FrenchDateTime.PrepositionSuffixRegex = `\\b(du|de|[àa]|vers|dans)$`; + FrenchDateTime.FlexibleDayRegex = `(?([A-Za-z]+\\s)?[A-Za-z\\d]+)`; + FrenchDateTime.ForTheRegex = `\\b(((pour le ${FrenchDateTime.FlexibleDayRegex})|(dans (le\\s+)?${FrenchDateTime.FlexibleDayRegex}(?<=(st|nd|rd|th))))(?\\s*(,|\\.|!|\\?|$)))`; + FrenchDateTime.WeekDayAndDayOfMonthRegex = `\\b${FrenchDateTime.WeekDayRegex}\\s+(le\\s+${FrenchDateTime.FlexibleDayRegex})\\b`; + FrenchDateTime.RestOfDateRegex = `\\b(Reste|fin)\\s+(d[eu]\\s+)?((le|cette|ce)\\s+)?(?semaine|mois|l'ann[ée]e)\\b`; + FrenchDateTime.RestOfDateTimeRegex = `\\b(Reste|fin)\\s+(d[eu]\\s+)?((le|cette|ce)\\s+)?(?jour)\\b`; + FrenchDateTime.LaterEarlyPeriodRegex = `^[.]`; + FrenchDateTime.WeekWithWeekDayRangeRegex = `^[.]`; + FrenchDateTime.GeneralEndingRegex = `^[.]`; + FrenchDateTime.MiddlePauseRegex = `^[.]`; + FrenchDateTime.DurationConnectorRegex = `^[.]`; + FrenchDateTime.PrefixArticleRegex = `^[\\.]`; + FrenchDateTime.OrRegex = `^[.]`; + FrenchDateTime.YearPlusNumberRegex = `^[.]`; + FrenchDateTime.NumberAsTimeRegex = `^[.]`; + FrenchDateTime.TimeBeforeAfterRegex = `^[.]`; + FrenchDateTime.DateNumberConnectorRegex = `^[.]`; + FrenchDateTime.CenturyRegex = `^[.]`; + FrenchDateTime.DecadeRegex = `^[.]`; + FrenchDateTime.DecadeWithCenturyRegex = `^[.]`; + FrenchDateTime.RelativeDecadeRegex = `^[.]`; + FrenchDateTime.YearSuffix = `(,?\\s*(${FrenchDateTime.DateYearRegex}|${FrenchDateTime.FullTextYearRegex}))`; + FrenchDateTime.YearAfterRegex = `^[.]`; + FrenchDateTime.YearPeriodRegex = `^[.]`; + FrenchDateTime.FutureSuffixRegex = `^[.]`; + FrenchDateTime.ComplexDatePeriodRegex = `^[.]`; + FrenchDateTime.UnitMap = new Map([["annees", "Y"], ["annee", "Y"], ["ans", "Y"], ["mois", "MON"], ["semaines", "W"], ["semaine", "W"], ["journees", "D"], ["journee", "D"], ["jour", "D"], ["jours", "D"], ["heures", "H"], ["heure", "H"], ["hrs", "H"], ["hr", "H"], ["h", "H"], ["minutes", "M"], ["minute", "M"], ["mins", "M"], ["min", "M"], ["secondes", "S"], ["seconde", "S"], ["secs", "S"], ["sec", "S"]]); + FrenchDateTime.UnitValueMap = new Map([["annees", 31536000], ["annee", 31536000], ["l'annees", 31536000], ["l'annee", 31536000], ["ans", 31536000], ["mois", 2592000], ["semaines", 604800], ["semaine", 604800], ["journees", 86400], ["journee", 86400], ["jour", 86400], ["jours", 86400], ["heures", 3600], ["heure", 3600], ["hrs", 3600], ["hr", 3600], ["h", 3600], ["minutes", 60], ["minute", 60], ["mins", 60], ["min", 60], ["secondes", 1], ["seconde", 1], ["secs", 1], ["sec", 1]]); + FrenchDateTime.SeasonMap = new Map([["printemps", "SP"], ["été", "SU"], ["automne", "FA"], ["hiver", "WI"]]); + FrenchDateTime.SeasonValueMap = new Map([["SP", 3], ["SU", 6], ["FA", 9], ["WI", 12]]); + FrenchDateTime.CardinalMap = new Map([["premier", 1], ["1er", 1], ["deuxième", 2], ["2e", 2], ["troisième", 3], ["troisieme", 3], ["3e", 3], ["quatrième", 4], ["4e", 4], ["cinqième", 5], ["5e", 5]]); + FrenchDateTime.DayOfWeek = new Map([["lundi", 1], ["mardi", 2], ["mercredi", 3], ["jeudi", 4], ["vendredi", 5], ["samedi", 6], ["dimanche", 0], ["lun", 1], ["mar", 2], ["mer", 3], ["jeu", 4], ["ven", 5], ["sam", 6], ["dim", 0]]); + FrenchDateTime.MonthOfYear = new Map([["1", 1], ["2", 2], ["3", 3], ["4", 4], ["5", 5], ["6", 6], ["7", 7], ["8", 8], ["9", 9], ["10", 10], ["11", 11], ["12", 12], ["janvier", 1], ["fevrier", 2], ["février", 2], ["mars", 3], ["mar", 3], ["avril", 4], ["avr", 4], ["mai", 5], ["juin", 6], ["jun", 6], ["juillet", 7], ["aout", 8], ["août", 8], ["septembre", 9], ["octobre", 10], ["novembre", 11], ["decembre", 12], ["décembre", 12], ["janv", 1], ["janv.", 1], ["jan", 1], ["fevr", 2], ["fevr.", 2], ["févr.", 2], ["févr", 2], ["fev", 2], ["juil", 7], ["jul", 7], ["sep", 9], ["sept.", 9], ["sept", 9], ["oct", 10], ["oct.", 10], ["nov", 11], ["nov.", 11], ["dec", 12], ["déc.", 12], ["déc", 12], ["01", 1], ["02", 2], ["03", 3], ["04", 4], ["05", 5], ["06", 6], ["07", 7], ["08", 8], ["09", 9]]); + FrenchDateTime.Numbers = new Map([["zero", 0], ["un", 1], ["une", 1], ["a", 1], ["deux", 2], ["trois", 3], ["quatre", 4], ["cinq", 5], ["six", 6], ["sept", 7], ["huit", 8], ["neuf", 9], ["dix", 10], ["onze", 11], ["douze", 12], ["treize", 13], ["quatorze", 14], ["quinze", 15], ["seize", 16], ["dix-sept", 17], ["dix-huit", 18], ["dix-neuf", 19], ["vingt-et-un", 21], ["vingt et un", 21], ["vingt", 20], ["vingt deux", 22], ["vingt-deux", 22], ["vingt trois", 23], ["vingt-trois", 23], ["vingt quatre", 24], ["vingt-quatre", 24], ["vingt cinq", 25], ["vingt-cinq", 25], ["vingt six", 26], ["vingt-six", 26], ["vingt sept", 27], ["vingt-sept", 27], ["vingt huit", 28], ["vingt-huit", 28], ["vingt neuf", 29], ["vingt-neuf", 29], ["trente", 30], ["trente et un", 31], ["trente-et-un", 31], ["trente deux", 32], ["trente-deux", 32], ["trente trois", 33], ["trente-trois", 33], ["trente quatre", 34], ["trente-quatre", 34], ["trente cinq", 35], ["trente-cinq", 35], ["trente six", 36], ["trente-six", 36], ["trente sept", 37], ["trente-sept", 37], ["trente huit", 38], ["trente-huit", 38], ["trente neuf", 39], ["trente-neuf", 39], ["quarante", 40], ["quarante et un", 41], ["quarante-et-un", 41], ["quarante deux", 42], ["quarante-duex", 42], ["quarante trois", 43], ["quarante-trois", 43], ["quarante quatre", 44], ["quarante-quatre", 44], ["quarante cinq", 45], ["quarante-cinq", 45], ["quarante six", 46], ["quarante-six", 46], ["quarante sept", 47], ["quarante-sept", 47], ["quarante huit", 48], ["quarante-huit", 48], ["quarante neuf", 49], ["quarante-neuf", 49], ["cinquante", 50], ["cinquante et un", 51], ["cinquante-et-un", 51], ["cinquante deux", 52], ["cinquante-deux", 52], ["cinquante trois", 53], ["cinquante-trois", 53], ["cinquante quatre", 54], ["cinquante-quatre", 54], ["cinquante cinq", 55], ["cinquante-cinq", 55], ["cinquante six", 56], ["cinquante-six", 56], ["cinquante sept", 57], ["cinquante-sept", 57], ["cinquante huit", 58], ["cinquante-huit", 58], ["cinquante neuf", 59], ["cinquante-neuf", 59], ["soixante", 60], ["soixante et un", 61], ["soixante-et-un", 61], ["soixante deux", 62], ["soixante-deux", 62], ["soixante trois", 63], ["soixante-trois", 63], ["soixante quatre", 64], ["soixante-quatre", 64], ["soixante cinq", 65], ["soixante-cinq", 65], ["soixante six", 66], ["soixante-six", 66], ["soixante sept", 67], ["soixante-sept", 67], ["soixante huit", 68], ["soixante-huit", 68], ["soixante neuf", 69], ["soixante-neuf", 69], ["soixante dix", 70], ["soixante-dix", 70], ["soixante et onze", 71], ["soixante-et-onze", 71], ["soixante douze", 72], ["soixante-douze", 72], ["soixante treize", 73], ["soixante-treize", 73], ["soixante quatorze", 74], ["soixante-quatorze", 74], ["soixante quinze", 75], ["soixante-quinze", 75], ["soixante seize", 76], ["soixante-seize", 76], ["soixante dix sept", 77], ["soixante-dix-sept", 77], ["soixante dix huit", 78], ["soixante-dix-huit", 78], ["soixante dix neuf", 79], ["soixante-dix-neuf", 79], ["quatre vingt", 80], ["quatre-vingt", 80], ["quatre vingt un", 81], ["quatre-vingt-un", 81], ["quatre vingt deux", 82], ["quatre-vingt-duex", 82], ["quatre vingt trois", 83], ["quatre-vingt-trois", 83], ["quatre vingt quatre", 84], ["quatre-vingt-quatre", 84], ["quatre vingt cinq", 85], ["quatre-vingt-cinq", 85], ["quatre vingt six", 86], ["quatre-vingt-six", 86], ["quatre vingt sept", 87], ["quatre-vingt-sept", 87], ["quatre vingt huit", 88], ["quatre-vingt-huit", 88], ["quatre vingt neuf", 89], ["quatre-vingt-neuf", 89], ["quatre vingt dix", 90], ["quatre-vingt-dix", 90], ["quatre vingt onze", 91], ["quatre-vingt-onze", 91], ["quatre vingt douze", 92], ["quatre-vingt-douze", 92], ["quatre vingt treize", 93], ["quatre-vingt-treize", 93], ["quatre vingt quatorze", 94], ["quatre-vingt-quatorze", 94], ["quatre vingt quinze", 95], ["quatre-vingt-quinze", 95], ["quatre vingt seize", 96], ["quatre-vingt-seize", 96], ["quatre vingt dix sept", 97], ["quatre-vingt-dix-sept", 97], ["quatre vingt dix huit", 98], ["quatre-vingt-dix-huit", 98], ["quatre vingt dix neuf", 99], ["quatre-vingt-dix-neuf", 99], ["cent", 100]]); + FrenchDateTime.DayOfMonth = new Map([["1er", 1], ["2e", 2], ["3e", 3], ["4e", 4], ["5e", 5], ["6e", 6], ["7e", 7], ["8e", 8], ["9e", 9], ["10e", 10], ["11e", 11], ["12e", 12], ["13e", 13], ["14e", 14], ["15e", 15], ["16e", 16], ["17e", 17], ["18e", 18], ["19e", 19], ["20e", 20], ["21e", 21], ["22e", 22], ["23e", 23], ["24e", 24], ["25e", 25], ["26e", 26], ["27e", 27], ["28e", 28], ["29e", 29], ["30e", 30], ["31e", 31]]); + FrenchDateTime.DoubleNumbers = new Map([["demi", 0.5], ["quart", 0.25]]); + FrenchDateTime.HolidayNames = new Map([["fathers", ["peres", "pères", "fêtedespères", "fetedesperes"]], ["mothers", ["fêtedesmères", "fetedesmeres"]], ["thanksgiving", ["lactiondegrace", "lactiondegrâce", "jourdethanksgiving", "thanksgiving"]], ["martinlutherking", ["journeemartinlutherking", "martinlutherkingjr"]], ["washingtonsbirthday", ["washingtonsbirthday", "washingtonbirthday"]], ["canberra", ["canberraday"]], ["labour", ["fetedetravail", "travail", "fetedutravail"]], ["columbus", ["columbusday"]], ["memorial", ["jourcommémoratif", "jourcommemoratif"]], ["yuandan", ["yuandan", "nouvelanchinois"]], ["maosbirthday", ["maosbirthday"]], ["teachersday", ["teachersday", "teacherday"]], ["singleday", ["singleday"]], ["allsaintsday", ["allsaintsday"]], ["youthday", ["youthday"]], ["childrenday", ["childrenday", "childday"]], ["femaleday", ["femaleday"]], ["treeplantingday", ["treeplantingday"]], ["arborday", ["arborday"]], ["girlsday", ["girlsday"]], ["whiteloverday", ["whiteloverday"]], ["loverday", ["loverday"]], ["christmas", ["noel", "noël"]], ["xmas", ["xmas"]], ["newyear", ["nouvellesannees", "nouvelan"]], ["newyearday", ["jourdunouvelan"]], ["newyearsday", ["jourdel'an", "jourpremierdelannee", "jourpremierdelannée"]], ["inaugurationday", ["jourd'inaugueration", "inaugueration"]], ["groundhougday", ["marmotte"]], ["valentinesday", ["lasaint-valentin", "lasaintvalentin"]], ["stpatrickday", ["stpatrickday"]], ["aprilfools", ["poissond'avril"]], ["stgeorgeday", ["stgeorgeday"]], ["mayday", ["premier-mai", "ler-mai", "1-mai"]], ["cincodemayoday", ["cincodemayo"]], ["baptisteday", ["bapteme", "baptême"]], ["usindependenceday", ["l'independanceamericaine", "lindépendanceaméricaine"]], ["independenceday", ["l'indépendance", "lindependance"]], ["bastilleday", ["laprisedelabastille", "bastille"]], ["halloweenday", ["halloween"]], ["allhallowday", ["allhallowday"]], ["allsoulsday", ["allsoulsday"]], ["guyfawkesday", ["guyfawkesday"]], ["veteransday", ["veteransday"]], ["christmaseve", ["reveillondenoel", "réveillondenoël", "veilledenoel", "veilledenoël"]], ["newyeareve", ["réveillondenouvelan", "reveillondenouvelan", "lasaint-sylvestre", "lasaintsylvestre"]]]); + FrenchDateTime.NightRegex = `\\b(minuit|nuit)\\b`; + FrenchDateTime.WrittenDecades = new Map([["", 0]]); + FrenchDateTime.SpecialDecadeCases = new Map([["", 0]]); + FrenchDateTime.DefaultLanguageFallback = 'DMY'; + FrenchDateTime.DurationDateRestrictions = []; +})(FrenchDateTime = exports.FrenchDateTime || (exports.FrenchDateTime = {})); + +}); + +unwrapExports(frenchDateTime); + +var durationConfiguration$4 = createCommonjsModule(function (module, exports) { +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); + + + +class FrenchDurationExtractorConfiguration { + constructor() { + this.allRegex = recognizersText.RegExpUtility.getSafeRegExp(frenchDateTime.FrenchDateTime.AllRegex, "gis"); + this.halfRegex = recognizersText.RegExpUtility.getSafeRegExp(frenchDateTime.FrenchDateTime.HalfRegex, "gis"); + this.followedUnit = recognizersText.RegExpUtility.getSafeRegExp(frenchDateTime.FrenchDateTime.DurationFollowedUnit, "gis"); + this.numberCombinedWithUnit = recognizersText.RegExpUtility.getSafeRegExp(frenchDateTime.FrenchDateTime.NumberCombinedWithDurationUnit, "gis"); + this.anUnitRegex = recognizersText.RegExpUtility.getSafeRegExp(frenchDateTime.FrenchDateTime.AnUnitRegex, "gis"); + this.inexactNumberUnitRegex = recognizersText.RegExpUtility.getSafeRegExp(frenchDateTime.FrenchDateTime.InexactNumberUnitRegex, "gis"); + this.suffixAndRegex = recognizersText.RegExpUtility.getSafeRegExp(frenchDateTime.FrenchDateTime.SuffixAndRegex, "gis"); + this.relativeDurationUnitRegex = recognizersText.RegExpUtility.getSafeRegExp(frenchDateTime.FrenchDateTime.RelativeDurationUnitRegex, "gis"); + this.moreThanRegex = recognizersText.RegExpUtility.getSafeRegExp(frenchDateTime.FrenchDateTime.MoreThanRegex, "gis"); + this.lessThanRegex = recognizersText.RegExpUtility.getSafeRegExp(frenchDateTime.FrenchDateTime.LessThanOneHour, "gis"); + this.cardinalExtractor = new recognizersTextNumber.FrenchCardinalExtractor(); + } +} +exports.FrenchDurationExtractorConfiguration = FrenchDurationExtractorConfiguration; +class FrenchDurationParserConfiguration { + constructor(config) { + this.cardinalExtractor = config.cardinalExtractor; + this.numberParser = config.numberParser; + this.followedUnit = recognizersText.RegExpUtility.getSafeRegExp(frenchDateTime.FrenchDateTime.DurationFollowedUnit); + this.suffixAndRegex = recognizersText.RegExpUtility.getSafeRegExp(frenchDateTime.FrenchDateTime.SuffixAndRegex); + this.numberCombinedWithUnit = recognizersText.RegExpUtility.getSafeRegExp(frenchDateTime.FrenchDateTime.NumberCombinedWithDurationUnit); + this.anUnitRegex = recognizersText.RegExpUtility.getSafeRegExp(frenchDateTime.FrenchDateTime.AnUnitRegex); + this.allDateUnitRegex = recognizersText.RegExpUtility.getSafeRegExp(frenchDateTime.FrenchDateTime.AllRegex); + this.halfDateUnitRegex = recognizersText.RegExpUtility.getSafeRegExp(frenchDateTime.FrenchDateTime.HalfRegex); + this.inexactNumberUnitRegex = recognizersText.RegExpUtility.getSafeRegExp(frenchDateTime.FrenchDateTime.InexactNumberUnitRegex); + this.unitMap = config.unitMap; + this.unitValueMap = config.unitValueMap; + this.doubleNumbers = config.doubleNumbers; + } +} +exports.FrenchDurationParserConfiguration = FrenchDurationParserConfiguration; + +}); + +unwrapExports(durationConfiguration$4); + +var timeConfiguration$4 = createCommonjsModule(function (module, exports) { +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); + + + + +class FrenchTimeExtractorConfiguration { + constructor() { + this.atRegex = recognizersText.RegExpUtility.getSafeRegExp(frenchDateTime.FrenchDateTime.AtRegex, "gis"); + this.ishRegex = recognizersText.RegExpUtility.getSafeRegExp(frenchDateTime.FrenchDateTime.IshRegex, "gis"); + + this.timeRegexList = FrenchTimeExtractorConfiguration.getTimeRegexList(); + this.durationExtractor = new baseDuration.BaseDurationExtractor(new durationConfiguration$4.FrenchDurationExtractorConfiguration()); + } + static getTimeRegexList() { + return [ + recognizersText.RegExpUtility.getSafeRegExp(frenchDateTime.FrenchDateTime.TimeRegex1, "gis"), + recognizersText.RegExpUtility.getSafeRegExp(frenchDateTime.FrenchDateTime.TimeRegex2, "gis"), + recognizersText.RegExpUtility.getSafeRegExp(frenchDateTime.FrenchDateTime.TimeRegex3, "gis"), + recognizersText.RegExpUtility.getSafeRegExp(frenchDateTime.FrenchDateTime.TimeRegex4, "gis"), + recognizersText.RegExpUtility.getSafeRegExp(frenchDateTime.FrenchDateTime.TimeRegex5, "gis"), + recognizersText.RegExpUtility.getSafeRegExp(frenchDateTime.FrenchDateTime.TimeRegex6, "gis"), + recognizersText.RegExpUtility.getSafeRegExp(frenchDateTime.FrenchDateTime.TimeRegex7, "gis"), + recognizersText.RegExpUtility.getSafeRegExp(frenchDateTime.FrenchDateTime.TimeRegex8, "gis"), + recognizersText.RegExpUtility.getSafeRegExp(frenchDateTime.FrenchDateTime.TimeRegex9, "gis"), + recognizersText.RegExpUtility.getSafeRegExp(frenchDateTime.FrenchDateTime.TimeRegex10, "gis"), + recognizersText.RegExpUtility.getSafeRegExp(frenchDateTime.FrenchDateTime.ConnectNumRegex, "gis") + ]; + } +} +exports.FrenchTimeExtractorConfiguration = FrenchTimeExtractorConfiguration; +class FrenchTimeParserConfiguration { + constructor(config) { + this.timeTokenPrefix = frenchDateTime.FrenchDateTime.TimeTokenPrefix; + this.atRegex = recognizersText.RegExpUtility.getSafeRegExp(frenchDateTime.FrenchDateTime.AtRegex, "gis"); + this.timeRegexes = FrenchTimeExtractorConfiguration.getTimeRegexList(); + this.lessThanOneHour = recognizersText.RegExpUtility.getSafeRegExp(frenchDateTime.FrenchDateTime.LessThanOneHour, "gis"); + this.timeSuffix = recognizersText.RegExpUtility.getSafeRegExp(frenchDateTime.FrenchDateTime.TimeSuffix, "gis"); + this.utilityConfiguration = config.utilityConfiguration; + this.numbers = config.numbers; + } + adjustByPrefix(prefix, adjust) { + let deltaMin = 0; + let trimedPrefix = prefix.trim().toLowerCase(); + if (trimedPrefix.endsWith("demie")) { + deltaMin = 30; + } + else if (trimedPrefix.endsWith("un quart") || trimedPrefix.endsWith("quart")) { + deltaMin = 15; + } + else if (trimedPrefix.endsWith("trois quarts")) { + deltaMin = 45; + } + else { + let matches = recognizersText.RegExpUtility.getMatches(this.lessThanOneHour, trimedPrefix); + if (matches.length) { + let match = matches[0]; + let minStr = match.groups("deltamin").value; + if (minStr) { + deltaMin = parseInt(minStr, 10); + } + else { + minStr = match.groups("deltaminnum").value.toLowerCase(); + if (this.numbers.has(minStr)) { + deltaMin = this.numbers.get(minStr); + } + } + } + } + if (trimedPrefix.endsWith("à")) { + deltaMin = -deltaMin; + } + adjust.min += deltaMin; + if (adjust.min < 0) { + adjust.min += 60; + adjust.hour -= 1; + } + adjust.hasMin = true; + } + adjustBySuffix(suffix, adjust) { + let trimedSuffix = suffix.trim().toLowerCase(); + let deltaHour = 0; + let matches = recognizersText.RegExpUtility.getMatches(this.timeSuffix, trimedSuffix); + if (matches.length) { + let match = matches[0]; + if (match.index === 0 && match.length === trimedSuffix.length) { + let oclockStr = match.groups("heures").value; + if (!oclockStr) { + let amStr = match.groups("am").value; + if (amStr) { + if (adjust.hour >= 12) { + deltaHour = -12; + } + adjust.hasAm = true; + } + let pmStr = match.groups("pm").value; + if (pmStr) { + if (adjust.hour < 12) { + deltaHour = 12; + } + adjust.hasPm = true; + } + } + } + } + adjust.hour = (adjust.hour + deltaHour) % 24; + } +} +exports.FrenchTimeParserConfiguration = FrenchTimeParserConfiguration; + +}); + +unwrapExports(timeConfiguration$4); + +var dateTimeConfiguration$4 = createCommonjsModule(function (module, exports) { +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); + + + + + + + + + +class FrenchDateTimeExtractorConfiguration { + constructor() { + this.prepositionRegex = recognizersText.RegExpUtility.getSafeRegExp(frenchDateTime.FrenchDateTime.PrepositionRegex, "gis"); + this.nowRegex = recognizersText.RegExpUtility.getSafeRegExp(frenchDateTime.FrenchDateTime.NowRegex, "gis"); + this.suffixRegex = recognizersText.RegExpUtility.getSafeRegExp(frenchDateTime.FrenchDateTime.SuffixRegex, "gis"); + this.timeOfDayRegex = recognizersText.RegExpUtility.getSafeRegExp(frenchDateTime.FrenchDateTime.TimeOfDayRegex, "gis"); + this.specificTimeOfDayRegex = recognizersText.RegExpUtility.getSafeRegExp(frenchDateTime.FrenchDateTime.SpecificTimeOfDayRegex, "gis"); + this.timeOfTodayAfterRegex = recognizersText.RegExpUtility.getSafeRegExp(frenchDateTime.FrenchDateTime.TimeOfTodayAfterRegex, "gis"); + this.timeOfTodayBeforeRegex = recognizersText.RegExpUtility.getSafeRegExp(frenchDateTime.FrenchDateTime.TimeOfTodayBeforeRegex, "gis"); + this.simpleTimeOfTodayAfterRegex = recognizersText.RegExpUtility.getSafeRegExp(frenchDateTime.FrenchDateTime.SimpleTimeOfTodayAfterRegex, "gis"); + this.simpleTimeOfTodayBeforeRegex = recognizersText.RegExpUtility.getSafeRegExp(frenchDateTime.FrenchDateTime.SimpleTimeOfTodayBeforeRegex, "gis"); + this.theEndOfRegex = recognizersText.RegExpUtility.getSafeRegExp(frenchDateTime.FrenchDateTime.TheEndOfRegex, "gis"); + this.unitRegex = recognizersText.RegExpUtility.getSafeRegExp(frenchDateTime.FrenchDateTime.TimeUnitRegex, "gis"); + this.connectorRegex = recognizersText.RegExpUtility.getSafeRegExp(frenchDateTime.FrenchDateTime.ConnectorRegex, "gis"); + this.nightRegex = recognizersText.RegExpUtility.getSafeRegExp(frenchDateTime.FrenchDateTime.NightRegex, "gis"); + this.datePointExtractor = new baseDate.BaseDateExtractor(new dateConfiguration$4.FrenchDateExtractorConfiguration()); + this.timePointExtractor = new baseTime.BaseTimeExtractor(new timeConfiguration$4.FrenchTimeExtractorConfiguration()); + this.durationExtractor = new baseDuration.BaseDurationExtractor(new durationConfiguration$4.FrenchDurationExtractorConfiguration()); + this.utilityConfiguration = new baseConfiguration$4.FrenchDateTimeUtilityConfiguration(); + } + isConnectorToken(source) { + return (source === "" || source === "," || + recognizersText.RegExpUtility.getFirstMatchIndex(this.prepositionRegex, source).matched || + source === "t" || + source === "pour" || + source === "vers"); + } +} +exports.FrenchDateTimeExtractorConfiguration = FrenchDateTimeExtractorConfiguration; +class FrenchDateTimeParserConfiguration { + constructor(config) { + this.tokenBeforeDate = frenchDateTime.FrenchDateTime.TokenBeforeDate; + this.tokenBeforeTime = frenchDateTime.FrenchDateTime.TokenBeforeTime; + this.nowRegex = recognizersText.RegExpUtility.getSafeRegExp(frenchDateTime.FrenchDateTime.NowRegex, "gis"); + this.amTimeRegex = recognizersText.RegExpUtility.getSafeRegExp(frenchDateTime.FrenchDateTime.AMTimeRegex, "gis"); + this.pmTimeRegex = recognizersText.RegExpUtility.getSafeRegExp(frenchDateTime.FrenchDateTime.PMTimeRegex, "gis"); + this.simpleTimeOfTodayAfterRegex = recognizersText.RegExpUtility.getSafeRegExp(frenchDateTime.FrenchDateTime.SimpleTimeOfTodayAfterRegex, "gis"); + this.simpleTimeOfTodayBeforeRegex = recognizersText.RegExpUtility.getSafeRegExp(frenchDateTime.FrenchDateTime.SimpleTimeOfTodayBeforeRegex, "gis"); + this.specificTimeOfDayRegex = recognizersText.RegExpUtility.getSafeRegExp(frenchDateTime.FrenchDateTime.SpecificTimeOfDayRegex, "gis"); + this.theEndOfRegex = recognizersText.RegExpUtility.getSafeRegExp(frenchDateTime.FrenchDateTime.TheEndOfRegex, "gis"); + this.unitRegex = recognizersText.RegExpUtility.getSafeRegExp(frenchDateTime.FrenchDateTime.TimeUnitRegex, "gis"); + this.dateExtractor = config.dateExtractor; + this.timeExtractor = config.timeExtractor; + this.dateParser = config.dateParser; + this.timeParser = config.timeParser; + this.numbers = config.numbers; + this.cardinalExtractor = config.cardinalExtractor; + this.numberParser = config.numberParser; + this.durationExtractor = config.durationExtractor; + this.durationParser = config.durationParser; + this.unitMap = config.unitMap; + this.utilityConfiguration = config.utilityConfiguration; + } + haveAmbiguousToken(text, matchedText) { + return false; + } + getMatchedNowTimex(text) { + let trimedText = text.trim().toLowerCase(); + let timex = ""; + if (trimedText.endsWith("maintenant")) { + timex = "PRESENT_REF"; + } + else if (trimedText === "récemment" || + trimedText === "précédemment" || + trimedText === "auparavant") { + timex = "PAST_REF"; + } + else if (trimedText === "dès que possible" || + trimedText === "dqp") { + timex = "FUTURE_REF"; + } + else { + return { + matched: false, + timex: null + }; + } + return { + matched: true, + timex: timex + }; + } + getSwiftDay(text) { + let trimedText = text.trim().toLowerCase(); + let swift = 0; + if (trimedText.startsWith("prochain") || + trimedText.endsWith("prochain") || + trimedText.startsWith("prochaine") || + trimedText.endsWith("prochaine")) { + swift = 1; + } + else if (trimedText.startsWith("dernier") || + trimedText.startsWith("dernière") || + trimedText.endsWith("dernier") || + trimedText.endsWith("dernière")) { + swift = -1; + } + return swift; + } + getHour(text, hour) { + let trimedText = text.trim().toLowerCase(); + let result = hour; + // TODO: Replace with a regex + if (trimedText.endsWith("matin") && hour >= 12) { + result -= 12; + } + else if (!trimedText.endsWith("matin") && hour < 12) { + result += 12; + } + return result; + } +} +exports.FrenchDateTimeParserConfiguration = FrenchDateTimeParserConfiguration; + +}); + +unwrapExports(dateTimeConfiguration$4); + +var datePeriodConfiguration$4 = createCommonjsModule(function (module, exports) { +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); + + + + + + + + +class FrenchDatePeriodExtractorConfiguration { + constructor() { + this.simpleCasesRegexes = [ + recognizersText.RegExpUtility.getSafeRegExp(frenchDateTime.FrenchDateTime.SimpleCasesRegex), + recognizersText.RegExpUtility.getSafeRegExp(frenchDateTime.FrenchDateTime.BetweenRegex), + recognizersText.RegExpUtility.getSafeRegExp(frenchDateTime.FrenchDateTime.OneWordPeriodRegex), + recognizersText.RegExpUtility.getSafeRegExp(frenchDateTime.FrenchDateTime.MonthWithYear), + recognizersText.RegExpUtility.getSafeRegExp(frenchDateTime.FrenchDateTime.MonthNumWithYear), + recognizersText.RegExpUtility.getSafeRegExp(frenchDateTime.FrenchDateTime.YearRegex), + recognizersText.RegExpUtility.getSafeRegExp(frenchDateTime.FrenchDateTime.WeekDayOfMonthRegex), + recognizersText.RegExpUtility.getSafeRegExp(frenchDateTime.FrenchDateTime.WeekOfYearRegex), + recognizersText.RegExpUtility.getSafeRegExp(frenchDateTime.FrenchDateTime.MonthFrontBetweenRegex), + recognizersText.RegExpUtility.getSafeRegExp(frenchDateTime.FrenchDateTime.MonthFrontSimpleCasesRegex), + recognizersText.RegExpUtility.getSafeRegExp(frenchDateTime.FrenchDateTime.QuarterRegex), + recognizersText.RegExpUtility.getSafeRegExp(frenchDateTime.FrenchDateTime.QuarterRegexYearFront), + recognizersText.RegExpUtility.getSafeRegExp(frenchDateTime.FrenchDateTime.AllHalfYearRegex), + recognizersText.RegExpUtility.getSafeRegExp(frenchDateTime.FrenchDateTime.SeasonRegex), + recognizersText.RegExpUtility.getSafeRegExp(frenchDateTime.FrenchDateTime.PastSuffixRegex), + recognizersText.RegExpUtility.getSafeRegExp(frenchDateTime.FrenchDateTime.NextSuffixRegex), + recognizersText.RegExpUtility.getSafeRegExp(frenchDateTime.FrenchDateTime.ThisPrefixRegex), + recognizersText.RegExpUtility.getSafeRegExp(frenchDateTime.FrenchDateTime.LaterEarlyPeriodRegex), + recognizersText.RegExpUtility.getSafeRegExp(frenchDateTime.FrenchDateTime.WeekWithWeekDayRangeRegex) + ]; + this.illegalYearRegex = recognizersText.RegExpUtility.getSafeRegExp(baseDateTime.BaseDateTime.IllegalYearRegex); + this.YearRegex = recognizersText.RegExpUtility.getSafeRegExp(frenchDateTime.FrenchDateTime.YearRegex); + this.tillRegex = recognizersText.RegExpUtility.getSafeRegExp(frenchDateTime.FrenchDateTime.TillRegex); + this.followedUnit = recognizersText.RegExpUtility.getSafeRegExp(frenchDateTime.FrenchDateTime.FollowedDateUnit); + this.numberCombinedWithUnit = recognizersText.RegExpUtility.getSafeRegExp(frenchDateTime.FrenchDateTime.NumberCombinedWithDateUnit); + this.pastRegex = recognizersText.RegExpUtility.getSafeRegExp(frenchDateTime.FrenchDateTime.PastSuffixRegex); + this.futureRegex = recognizersText.RegExpUtility.getSafeRegExp(frenchDateTime.FrenchDateTime.NextSuffixRegex); + this.weekOfRegex = recognizersText.RegExpUtility.getSafeRegExp(frenchDateTime.FrenchDateTime.WeekOfRegex); + this.monthOfRegex = recognizersText.RegExpUtility.getSafeRegExp(frenchDateTime.FrenchDateTime.MonthOfRegex); + this.dateUnitRegex = recognizersText.RegExpUtility.getSafeRegExp(frenchDateTime.FrenchDateTime.DateUnitRegex); + this.inConnectorRegex = recognizersText.RegExpUtility.getSafeRegExp(frenchDateTime.FrenchDateTime.InConnectorRegex); + this.rangeUnitRegex = recognizersText.RegExpUtility.getSafeRegExp(frenchDateTime.FrenchDateTime.RangeUnitRegex); + this.weekDayOfMonthRegex = recognizersText.RegExpUtility.getSafeRegExp(frenchDateTime.FrenchDateTime.WeekDayOfMonthRegex); + this.fromRegex = recognizersText.RegExpUtility.getSafeRegExp(frenchDateTime.FrenchDateTime.FromRegex); + this.connectorAndRegex = recognizersText.RegExpUtility.getSafeRegExp(frenchDateTime.FrenchDateTime.ConnectorAndRegex); + this.beforeRegex = recognizersText.RegExpUtility.getSafeRegExp(frenchDateTime.FrenchDateTime.BeforeRegex2); + this.datePointExtractor = new baseDate.BaseDateExtractor(new dateConfiguration$4.FrenchDateExtractorConfiguration()); + this.integerExtractor = new recognizersTextNumber.FrenchIntegerExtractor(); + this.numberParser = new recognizersTextNumber.BaseNumberParser(new recognizersTextNumber.FrenchNumberParserConfiguration()); + this.durationExtractor = new baseDuration.BaseDurationExtractor(new durationConfiguration$4.FrenchDurationExtractorConfiguration()); + } + getFromTokenIndex(source) { + return recognizersText.RegExpUtility.getFirstMatchIndex(this.fromRegex, source); + } + getBetweenTokenIndex(source) { + return recognizersText.RegExpUtility.getFirstMatchIndex(this.beforeRegex, source); + } + hasConnectorToken(source) { + return recognizersText.RegExpUtility.getFirstMatchIndex(this.connectorAndRegex, source).matched; + } +} +exports.FrenchDatePeriodExtractorConfiguration = FrenchDatePeriodExtractorConfiguration; +class FrenchDatePeriodParserConfiguration { + constructor(config) { + this.tokenBeforeDate = frenchDateTime.FrenchDateTime.TokenBeforeDate; + this.cardinalExtractor = config.cardinalExtractor; + this.numberParser = config.numberParser; + this.durationExtractor = config.durationExtractor; + this.dateExtractor = config.dateExtractor; + this.durationParser = config.durationParser; + this.dateParser = config.dateParser; + this.monthFrontBetweenRegex = recognizersText.RegExpUtility.getSafeRegExp(frenchDateTime.FrenchDateTime.MonthFrontBetweenRegex); + this.betweenRegex = recognizersText.RegExpUtility.getSafeRegExp(frenchDateTime.FrenchDateTime.BetweenRegex); + this.monthFrontSimpleCasesRegex = recognizersText.RegExpUtility.getSafeRegExp(frenchDateTime.FrenchDateTime.MonthFrontSimpleCasesRegex); + this.simpleCasesRegex = recognizersText.RegExpUtility.getSafeRegExp(frenchDateTime.FrenchDateTime.SimpleCasesRegex); + this.oneWordPeriodRegex = recognizersText.RegExpUtility.getSafeRegExp(frenchDateTime.FrenchDateTime.OneWordPeriodRegex); + this.monthWithYear = recognizersText.RegExpUtility.getSafeRegExp(frenchDateTime.FrenchDateTime.MonthWithYear); + this.monthNumWithYear = recognizersText.RegExpUtility.getSafeRegExp(frenchDateTime.FrenchDateTime.MonthNumWithYear); + this.yearRegex = recognizersText.RegExpUtility.getSafeRegExp(frenchDateTime.FrenchDateTime.YearRegex); + this.pastRegex = recognizersText.RegExpUtility.getSafeRegExp(frenchDateTime.FrenchDateTime.PastSuffixRegex); + this.futureRegex = recognizersText.RegExpUtility.getSafeRegExp(frenchDateTime.FrenchDateTime.NextSuffixRegex); + this.numberCombinedWithUnit = recognizersText.RegExpUtility.getSafeRegExp(frenchDateTime.FrenchDateTime.NumberCombinedWithDurationUnit); + this.weekOfMonthRegex = recognizersText.RegExpUtility.getSafeRegExp(frenchDateTime.FrenchDateTime.WeekOfMonthRegex); + this.weekOfYearRegex = recognizersText.RegExpUtility.getSafeRegExp(frenchDateTime.FrenchDateTime.WeekOfYearRegex); + this.quarterRegex = recognizersText.RegExpUtility.getSafeRegExp(frenchDateTime.FrenchDateTime.QuarterRegex); + this.quarterRegexYearFront = recognizersText.RegExpUtility.getSafeRegExp(frenchDateTime.FrenchDateTime.QuarterRegexYearFront); + this.allHalfYearRegex = recognizersText.RegExpUtility.getSafeRegExp(frenchDateTime.FrenchDateTime.AllHalfYearRegex); + this.seasonRegex = recognizersText.RegExpUtility.getSafeRegExp(frenchDateTime.FrenchDateTime.SeasonRegex); + this.whichWeekRegex = recognizersText.RegExpUtility.getSafeRegExp(frenchDateTime.FrenchDateTime.WhichWeekRegex); + this.weekOfRegex = recognizersText.RegExpUtility.getSafeRegExp(frenchDateTime.FrenchDateTime.WeekOfRegex); + this.monthOfRegex = recognizersText.RegExpUtility.getSafeRegExp(frenchDateTime.FrenchDateTime.MonthOfRegex); + this.restOfDateRegex = recognizersText.RegExpUtility.getSafeRegExp(frenchDateTime.FrenchDateTime.RestOfDateRegex); + this.nextPrefixRegex = recognizersText.RegExpUtility.getSafeRegExp("(prochain|prochaine)\b"); + this.pastPrefixRegex = recognizersText.RegExpUtility.getSafeRegExp("(dernier)\b"); + this.thisPrefixRegex = recognizersText.RegExpUtility.getSafeRegExp("(ce|cette)\b"); + this.inConnectorRegex = config.utilityConfiguration.inConnectorRegex; + this.unitMap = config.unitMap; + this.cardinalMap = config.cardinalMap; + this.dayOfMonth = config.dayOfMonth; + this.monthOfYear = config.monthOfYear; + this.seasonMap = config.seasonMap; + } + getSwiftDayOrMonth(source) { + let trimedText = source.trim().toLowerCase(); + let swift = 0; + if (trimedText.endsWith("prochain") || trimedText.endsWith("prochaine")) { + swift = 1; + } + if (trimedText.endsWith("dernière") || + trimedText.endsWith("dernières") || + trimedText.endsWith("derniere") || + trimedText.endsWith("dernieres")) { + swift = -1; + } + return swift; + } + getSwiftYear(source) { + let trimedText = source.trim().toLowerCase(); + let swift = -10; + if (trimedText.endsWith("prochain") || trimedText.endsWith("prochaine")) { + swift = 1; + } + if (trimedText.endsWith("dernières") || + trimedText.endsWith("dernière") || + trimedText.endsWith("dernieres") || + trimedText.endsWith("derniere") || + trimedText.endsWith("dernier")) { + swift = -1; + } + else if (trimedText.startsWith("cette")) { + swift = 0; + } + return swift; + } + isFuture(source) { + let trimedText = source.trim().toLowerCase(); + return (trimedText.startsWith("cette") || + trimedText.endsWith("prochaine") || + trimedText.endsWith("prochain")); + } + isYearToDate(source) { + let trimedText = source.trim().toLowerCase(); + return (trimedText === "année à ce jour" || + trimedText === "an à ce jour"); + } + isMonthToDate(source) { + let trimedText = source.trim().toLowerCase(); + return trimedText === "mois à ce jour"; + } + isWeekOnly(source) { + let trimedText = source.trim().toLowerCase(); + return (trimedText.endsWith("semaine") && + !trimedText.endsWith("fin de semaine")); + } + isWeekend(source) { + let trimedText = source.trim().toLowerCase(); + return (trimedText.endsWith("fin de semaine") || + trimedText.endsWith("le weekend")); + } + isMonthOnly(source) { + let trimedText = source.trim().toLowerCase(); + return trimedText.endsWith("mois"); + } + isYearOnly(source) { + let trimedText = source.trim().toLowerCase(); + return (trimedText.endsWith("années") || + trimedText.endsWith("ans") || + (trimedText.endsWith("l'annees") || + trimedText.endsWith("l'annee"))); + } + isLastCardinal(source) { + let trimedText = source.trim().toLowerCase(); + return (trimedText === "dernières" || + trimedText === "dernière" || + trimedText === "dernieres" || + trimedText === "derniere" || + trimedText === "dernier"); + } +} +exports.FrenchDatePeriodParserConfiguration = FrenchDatePeriodParserConfiguration; + +}); + +unwrapExports(datePeriodConfiguration$4); + +var timePeriodConfiguration$4 = createCommonjsModule(function (module, exports) { +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); + + + + + + +class FrenchTimePeriodExtractorConfiguration { + constructor() { + this.singleTimeExtractor = new baseTime.BaseTimeExtractor(new timeConfiguration$4.FrenchTimeExtractorConfiguration()); + this.integerExtractor = new recognizersTextNumber.EnglishIntegerExtractor(); + this.utilityConfiguration = new baseConfiguration$4.FrenchDateTimeUtilityConfiguration(); + this.simpleCasesRegex = [ + recognizersText.RegExpUtility.getSafeRegExp(frenchDateTime.FrenchDateTime.PureNumFromTo, "gis"), + recognizersText.RegExpUtility.getSafeRegExp(frenchDateTime.FrenchDateTime.PureNumBetweenAnd, "gis"), + recognizersText.RegExpUtility.getSafeRegExp(frenchDateTime.FrenchDateTime.PmRegex, "gis"), + recognizersText.RegExpUtility.getSafeRegExp(frenchDateTime.FrenchDateTime.AmRegex, "gis") + ]; + this.tillRegex = recognizersText.RegExpUtility.getSafeRegExp(frenchDateTime.FrenchDateTime.TillRegex, "gis"); + this.timeOfDayRegex = recognizersText.RegExpUtility.getSafeRegExp(frenchDateTime.FrenchDateTime.TimeOfDayRegex, "gis"); + this.generalEndingRegex = recognizersText.RegExpUtility.getSafeRegExp(frenchDateTime.FrenchDateTime.GeneralEndingRegex, "gis"); + this.fromRegex = recognizersText.RegExpUtility.getSafeRegExp(frenchDateTime.FrenchDateTime.FromRegex2, "gis"); + this.connectorAndRegex = recognizersText.RegExpUtility.getSafeRegExp(frenchDateTime.FrenchDateTime.ConnectorAndRegex, "gis"); + this.beforeRegex = recognizersText.RegExpUtility.getSafeRegExp(frenchDateTime.FrenchDateTime.BeforeRegex2, "gis"); + } + getFromTokenIndex(text) { + return recognizersText.RegExpUtility.getFirstMatchIndex(this.fromRegex, text); + } + hasConnectorToken(text) { + return recognizersText.RegExpUtility.getFirstMatchIndex(this.connectorAndRegex, text).matched; + } + getBetweenTokenIndex(text) { + return recognizersText.RegExpUtility.getFirstMatchIndex(this.beforeRegex, text); + } +} +exports.FrenchTimePeriodExtractorConfiguration = FrenchTimePeriodExtractorConfiguration; +class FrenchTimePeriodParserConfiguration { + constructor(config) { + this.timeExtractor = config.timeExtractor; + this.timeParser = config.timeParser; + this.integerExtractor = config.integerExtractor; + this.numbers = config.numbers; + this.utilityConfiguration = config.utilityConfiguration; + this.pureNumberFromToRegex = recognizersText.RegExpUtility.getSafeRegExp(frenchDateTime.FrenchDateTime.PureNumFromTo, "gis"); + this.pureNumberBetweenAndRegex = recognizersText.RegExpUtility.getSafeRegExp(frenchDateTime.FrenchDateTime.PureNumBetweenAnd, "gis"); + this.timeOfDayRegex = recognizersText.RegExpUtility.getSafeRegExp(frenchDateTime.FrenchDateTime.TimeOfDayRegex, "gis"); + this.tillRegex = recognizersText.RegExpUtility.getSafeRegExp(frenchDateTime.FrenchDateTime.TillRegex, "gis"); + this.specificTimeFromToRegex = recognizersText.RegExpUtility.getSafeRegExp(frenchDateTime.FrenchDateTime.SpecificTimeFromTo); + this.specificTimeBetweenAndRegex = recognizersText.RegExpUtility.getSafeRegExp(frenchDateTime.FrenchDateTime.SpecificTimeBetweenAnd); + } + getMatchedTimexRange(text) { + let trimedText = text.trim().toLowerCase(); + if (trimedText.endsWith("s")) { + trimedText = trimedText.substring(0, trimedText.length - 1); + } + let beginHour = 0; + let endHour = 0; + let endMin = 0; + let timex = ""; + if (trimedText.endsWith("matinee") || + trimedText.endsWith("matin") || + trimedText.endsWith("matinée")) { + timex = "TMO"; + beginHour = 8; + endHour = 12; + } + else if (trimedText.endsWith("apres-midi") || + trimedText.endsWith("apres midi") || + trimedText.endsWith("après midi") || + trimedText.endsWith("après-midi")) { + timex = "TAF"; + beginHour = 12; + endHour = 16; + } + else if (trimedText.endsWith("soir") || + trimedText.endsWith("soiree") || + trimedText.endsWith("soirée")) { + timex = "TEV"; + beginHour = 16; + endHour = 20; + } + else if (trimedText === "jour" || + trimedText.endsWith("journee") || + trimedText.endsWith("journée")) { + timex = "TDT"; + beginHour = 8; + endHour = 18; + } + else if (trimedText.endsWith("nuit")) { + timex = "TNI"; + beginHour = 20; + endHour = 23; + endMin = 59; + } + else { + timex = null; + return { + matched: false, + timex, + beginHour, + endHour, + endMin + }; + } + return { + matched: true, + timex, + beginHour, + endHour, + endMin + }; + } +} +exports.FrenchTimePeriodParserConfiguration = FrenchTimePeriodParserConfiguration; + +}); + +unwrapExports(timePeriodConfiguration$4); + +var dateTimePeriodConfiguration$4 = createCommonjsModule(function (module, exports) { +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); + + + + + + + + + + + + + +class FrenchDateTimePeriodExtractorConfiguration { + constructor() { + this.simpleCasesRegexes = [ + recognizersText.RegExpUtility.getSafeRegExp(frenchDateTime.FrenchDateTime.PureNumFromTo), + recognizersText.RegExpUtility.getSafeRegExp(frenchDateTime.FrenchDateTime.PureNumBetweenAnd), + recognizersText.RegExpUtility.getSafeRegExp(frenchDateTime.FrenchDateTime.SpecificTimeOfDayRegex) + ]; + this.prepositionRegex = recognizersText.RegExpUtility.getSafeRegExp(frenchDateTime.FrenchDateTime.PrepositionRegex); + this.tillRegex = recognizersText.RegExpUtility.getSafeRegExp(frenchDateTime.FrenchDateTime.TillRegex); + this.specificTimeOfDayRegex = recognizersText.RegExpUtility.getSafeRegExp(frenchDateTime.FrenchDateTime.PeriodSpecificTimeOfDayRegex); + this.timeOfDayRegex = recognizersText.RegExpUtility.getSafeRegExp(frenchDateTime.FrenchDateTime.PeriodTimeOfDayRegex); + this.followedUnit = recognizersText.RegExpUtility.getSafeRegExp(frenchDateTime.FrenchDateTime.TimeFollowedUnit); + this.timeUnitRegex = recognizersText.RegExpUtility.getSafeRegExp(frenchDateTime.FrenchDateTime.TimeUnitRegex); + this.pastPrefixRegex = recognizersText.RegExpUtility.getSafeRegExp(frenchDateTime.FrenchDateTime.PastSuffixRegex); + this.nextPrefixRegex = recognizersText.RegExpUtility.getSafeRegExp(frenchDateTime.FrenchDateTime.NextSuffixRegex); + this.numberCombinedWithUnit = recognizersText.RegExpUtility.getSafeRegExp(frenchDateTime.FrenchDateTime.TimeNumberCombinedWithUnit); + this.weekDayRegex = recognizersText.RegExpUtility.getSafeRegExp(frenchDateTime.FrenchDateTime.WeekDayRegex); + this.periodTimeOfDayWithDateRegex = recognizersText.RegExpUtility.getSafeRegExp(frenchDateTime.FrenchDateTime.PeriodTimeOfDayWithDateRegex); + this.relativeTimeUnitRegex = recognizersText.RegExpUtility.getSafeRegExp(frenchDateTime.FrenchDateTime.RelativeTimeUnitRegex); + this.restOfDateTimeRegex = recognizersText.RegExpUtility.getSafeRegExp(frenchDateTime.FrenchDateTime.RestOfDateTimeRegex); + this.generalEndingRegex = recognizersText.RegExpUtility.getSafeRegExp(frenchDateTime.FrenchDateTime.GeneralEndingRegex); + this.middlePauseRegex = recognizersText.RegExpUtility.getSafeRegExp(frenchDateTime.FrenchDateTime.MiddlePauseRegex); + this.fromRegex = recognizersText.RegExpUtility.getSafeRegExp(frenchDateTime.FrenchDateTime.FromRegex2); + this.connectorAndRegex = recognizersText.RegExpUtility.getSafeRegExp(frenchDateTime.FrenchDateTime.ConnectorAndRegex); + this.beforeRegex = recognizersText.RegExpUtility.getSafeRegExp(frenchDateTime.FrenchDateTime.BeforeRegex); + this.cardinalExtractor = new recognizersTextNumber.FrenchCardinalExtractor(); + this.singleDateExtractor = new baseDate.BaseDateExtractor(new dateConfiguration$4.FrenchDateExtractorConfiguration()); + this.singleTimeExtractor = new baseTime.BaseTimeExtractor(new timeConfiguration$4.FrenchTimeExtractorConfiguration()); + this.singleDateTimeExtractor = new baseDateTime$2.BaseDateTimeExtractor(new dateTimeConfiguration$4.FrenchDateTimeExtractorConfiguration()); + this.durationExtractor = new baseDuration.BaseDurationExtractor(new durationConfiguration$4.FrenchDurationExtractorConfiguration()); + this.timePeriodExtractor = new baseTimePeriod.BaseTimePeriodExtractor(new timePeriodConfiguration$4.FrenchTimePeriodExtractorConfiguration()); + } + getFromTokenIndex(source) { + return recognizersText.RegExpUtility.getFirstMatchIndex(this.fromRegex, source); + } + getBetweenTokenIndex(source) { + return recognizersText.RegExpUtility.getFirstMatchIndex(this.beforeRegex, source); + } + hasConnectorToken(source) { + return recognizersText.RegExpUtility.getFirstMatchIndex(this.connectorAndRegex, source).matched; + } +} +exports.FrenchDateTimePeriodExtractorConfiguration = FrenchDateTimePeriodExtractorConfiguration; +class FrenchDateTimePeriodParserConfiguration { + constructor(config) { + this.dateExtractor = config.dateExtractor; + this.timeExtractor = config.timeExtractor; + this.dateTimeExtractor = config.dateTimeExtractor; + this.timePeriodExtractor = config.timePeriodExtractor; + this.cardinalExtractor = config.cardinalExtractor; + this.durationExtractor = config.durationExtractor; + this.numberParser = config.numberParser; + this.dateParser = config.dateParser; + this.timeParser = config.timeParser; + this.dateTimeParser = config.dateTimeParser; + this.timePeriodParser = config.timePeriodParser; + this.durationParser = config.durationParser; + this.unitMap = config.unitMap; + this.numbers = config.numbers; + this.nextPrefixRegex = recognizersText.RegExpUtility.getSafeRegExp(frenchDateTime.FrenchDateTime.NextSuffixRegex); + this.pastPrefixRegex = recognizersText.RegExpUtility.getSafeRegExp(frenchDateTime.FrenchDateTime.PastSuffixRegex); + this.thisPrefixRegex = recognizersText.RegExpUtility.getSafeRegExp(frenchDateTime.FrenchDateTime.ThisPrefixRegex); + this.morningStartEndRegex = recognizersText.RegExpUtility.getSafeRegExp(frenchDateTime.FrenchDateTime.MorningStartEndRegex); + this.afternoonStartEndRegex = recognizersText.RegExpUtility.getSafeRegExp(frenchDateTime.FrenchDateTime.AfternoonStartEndRegex); + this.eveningStartEndRegex = recognizersText.RegExpUtility.getSafeRegExp(frenchDateTime.FrenchDateTime.EveningStartEndRegex); + this.nightStartEndRegex = recognizersText.RegExpUtility.getSafeRegExp(frenchDateTime.FrenchDateTime.NightStartEndRegex); + this.pureNumberFromToRegex = recognizersText.RegExpUtility.getSafeRegExp(frenchDateTime.FrenchDateTime.PureNumFromTo); + this.pureNumberBetweenAndRegex = recognizersText.RegExpUtility.getSafeRegExp(frenchDateTime.FrenchDateTime.PureNumBetweenAnd); + this.specificTimeOfDayRegex = recognizersText.RegExpUtility.getSafeRegExp(frenchDateTime.FrenchDateTime.SpecificTimeOfDayRegex); + this.timeOfDayRegex = recognizersText.RegExpUtility.getSafeRegExp(frenchDateTime.FrenchDateTime.TimeOfDayRegex); + this.pastRegex = recognizersText.RegExpUtility.getSafeRegExp(frenchDateTime.FrenchDateTime.PastSuffixRegex); + this.futureRegex = recognizersText.RegExpUtility.getSafeRegExp(frenchDateTime.FrenchDateTime.NextSuffixRegex); + this.numberCombinedWithUnitRegex = recognizersText.RegExpUtility.getSafeRegExp(frenchDateTime.FrenchDateTime.TimeNumberCombinedWithUnit); + this.unitRegex = recognizersText.RegExpUtility.getSafeRegExp(frenchDateTime.FrenchDateTime.TimeUnitRegex); + this.periodTimeOfDayWithDateRegex = recognizersText.RegExpUtility.getSafeRegExp(frenchDateTime.FrenchDateTime.PeriodTimeOfDayWithDateRegex); + this.relativeTimeUnitRegex = recognizersText.RegExpUtility.getSafeRegExp(frenchDateTime.FrenchDateTime.RelativeTimeUnitRegex); + this.restOfDateTimeRegex = recognizersText.RegExpUtility.getSafeRegExp(frenchDateTime.FrenchDateTime.RestOfDateTimeRegex); + } + getMatchedTimeRange(source) { + let trimedText = source.trim().toLowerCase(); + let timeStr = ""; + let beginHour = 0; + let endHour = 0; + let endMin = 0; + if (recognizersText.RegExpUtility.getFirstMatchIndex(this.morningStartEndRegex, trimedText).matched) { + timeStr = "TMO"; + beginHour = 8; + endHour = 12; + } + else if (recognizersText.RegExpUtility.getFirstMatchIndex(this.afternoonStartEndRegex, trimedText).matched) { + timeStr = "TAF"; + beginHour = 12; + endHour = 16; + } + else if (recognizersText.RegExpUtility.getFirstMatchIndex(this.eveningStartEndRegex, trimedText).matched) { + timeStr = "TEV"; + beginHour = 16; + endHour = 20; + } + else if (recognizersText.RegExpUtility.getFirstMatchIndex(this.nightStartEndRegex, trimedText).matched) { + timeStr = "TNI"; + beginHour = 20; + endHour = 23; + endMin = 59; + } + else { + timeStr = null; + return { + success: false, + timeStr, + beginHour, + endHour, + endMin + }; + } + return { + success: true, + timeStr, + beginHour, + endHour, + endMin + }; + } + getSwiftPrefix(source) { + let trimedText = source.trim().toLowerCase(); + let swift = 0; + // TODO: Replace with a regex + if (trimedText.startsWith("prochain") || + trimedText.endsWith("prochain") || + trimedText.startsWith("prochaine") || + trimedText.endsWith("prochaine")) { + swift = 1; + } + else if (trimedText.startsWith("derniere") || + trimedText.startsWith("dernier") || + trimedText.endsWith("derniere") || + trimedText.endsWith("dernier")) { + swift = -1; + } + return swift; + } +} +exports.FrenchDateTimePeriodParserConfiguration = FrenchDateTimePeriodParserConfiguration; + +}); + +unwrapExports(dateTimePeriodConfiguration$4); + +var baseConfiguration$4 = createCommonjsModule(function (module, exports) { +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); + + + + + + + + + + + + + + + + + + + +class FrenchDateTimeUtilityConfiguration { + constructor() { + this.laterRegex = recognizersText.RegExpUtility.getSafeRegExp(frenchDateTime.FrenchDateTime.LaterRegex); + this.agoRegex = recognizersText.RegExpUtility.getSafeRegExp(frenchDateTime.FrenchDateTime.AgoPrefixRegex); + this.inConnectorRegex = recognizersText.RegExpUtility.getSafeRegExp(frenchDateTime.FrenchDateTime.InConnectorRegex); + this.rangeUnitRegex = recognizersText.RegExpUtility.getSafeRegExp(frenchDateTime.FrenchDateTime.RangeUnitRegex); + this.amDescRegex = recognizersText.RegExpUtility.getSafeRegExp(frenchDateTime.FrenchDateTime.AmDescRegex); + this.pmDescRegex = recognizersText.RegExpUtility.getSafeRegExp(frenchDateTime.FrenchDateTime.PmDescRegex); + this.amPmDescRegex = recognizersText.RegExpUtility.getSafeRegExp(frenchDateTime.FrenchDateTime.AmPmDescRegex); + } +} +exports.FrenchDateTimeUtilityConfiguration = FrenchDateTimeUtilityConfiguration; +class FrenchCommonDateTimeParserConfiguration extends parsers$4.BaseDateParserConfiguration { + constructor() { + super(); + this.utilityConfiguration = new FrenchDateTimeUtilityConfiguration(); + this.unitMap = frenchDateTime.FrenchDateTime.UnitMap; + this.unitValueMap = frenchDateTime.FrenchDateTime.UnitValueMap; + this.seasonMap = frenchDateTime.FrenchDateTime.SeasonMap; + this.cardinalMap = frenchDateTime.FrenchDateTime.CardinalMap; + this.dayOfWeek = frenchDateTime.FrenchDateTime.DayOfWeek; + this.monthOfYear = frenchDateTime.FrenchDateTime.MonthOfYear; + this.numbers = frenchDateTime.FrenchDateTime.Numbers; + this.doubleNumbers = frenchDateTime.FrenchDateTime.DoubleNumbers; + this.cardinalExtractor = new recognizersTextNumber.FrenchCardinalExtractor(); + this.integerExtractor = new recognizersTextNumber.FrenchIntegerExtractor(); + this.ordinalExtractor = new recognizersTextNumber.FrenchOrdinalExtractor(); + this.numberParser = new recognizersTextNumber.BaseNumberParser(new recognizersTextNumber.FrenchNumberParserConfiguration()); + this.dateExtractor = new baseDate.BaseDateExtractor(new dateConfiguration$4.FrenchDateExtractorConfiguration()); + this.timeExtractor = new baseTime.BaseTimeExtractor(new timeConfiguration$4.FrenchTimeExtractorConfiguration()); + this.dateTimeExtractor = new baseDateTime$2.BaseDateTimeExtractor(new dateTimeConfiguration$4.FrenchDateTimeExtractorConfiguration()); + this.durationExtractor = new baseDuration.BaseDurationExtractor(new durationConfiguration$4.FrenchDurationExtractorConfiguration()); + this.datePeriodExtractor = new baseDatePeriod.BaseDatePeriodExtractor(new datePeriodConfiguration$4.FrenchDatePeriodExtractorConfiguration()); + this.timePeriodExtractor = new baseTimePeriod.BaseTimePeriodExtractor(new timePeriodConfiguration$4.FrenchTimePeriodExtractorConfiguration()); + this.dateTimePeriodExtractor = new baseDateTimePeriod.BaseDateTimePeriodExtractor(new dateTimePeriodConfiguration$4.FrenchDateTimePeriodExtractorConfiguration()); + this.durationParser = new baseDuration.BaseDurationParser(new durationConfiguration$4.FrenchDurationParserConfiguration(this)); + this.dateParser = new baseDate.BaseDateParser(new dateConfiguration$4.FrenchDateParserConfiguration(this)); + this.timeParser = new baseTime.BaseTimeParser(new timeConfiguration$4.FrenchTimeParserConfiguration(this)); + this.dateTimeParser = new baseDateTime$2.BaseDateTimeParser(new dateTimeConfiguration$4.FrenchDateTimeParserConfiguration(this)); + this.datePeriodParser = new baseDatePeriod.BaseDatePeriodParser(new datePeriodConfiguration$4.FrenchDatePeriodParserConfiguration(this)); + this.timePeriodParser = new baseTimePeriod.BaseTimePeriodParser(new timePeriodConfiguration$4.FrenchTimePeriodParserConfiguration(this)); + this.dateTimePeriodParser = new baseDateTimePeriod.BaseDateTimePeriodParser(new dateTimePeriodConfiguration$4.FrenchDateTimePeriodParserConfiguration(this)); + this.dayOfMonth = new Map([...baseDateTime.BaseDateTime.DayOfMonthDictionary, ...frenchDateTime.FrenchDateTime.DayOfMonth]); + } +} +exports.FrenchCommonDateTimeParserConfiguration = FrenchCommonDateTimeParserConfiguration; + +}); + +unwrapExports(baseConfiguration$4); + +var dateConfiguration$4 = createCommonjsModule(function (module, exports) { +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); + + + + + + + +class FrenchDateExtractorConfiguration { + constructor() { + this.dateRegexList = [ + recognizersText.RegExpUtility.getSafeRegExp(frenchDateTime.FrenchDateTime.DateExtractor1, "gis"), + recognizersText.RegExpUtility.getSafeRegExp(frenchDateTime.FrenchDateTime.DateExtractor2, "gis"), + recognizersText.RegExpUtility.getSafeRegExp(frenchDateTime.FrenchDateTime.DateExtractor3, "gis"), + frenchDateTime.FrenchDateTime.DefaultLanguageFallback === constants$2.Constants.DefaultLanguageFallback_DMY ? + recognizersText.RegExpUtility.getSafeRegExp(frenchDateTime.FrenchDateTime.DateExtractor5, "gis") : + recognizersText.RegExpUtility.getSafeRegExp(frenchDateTime.FrenchDateTime.DateExtractor4, "gis"), + frenchDateTime.FrenchDateTime.DefaultLanguageFallback === constants$2.Constants.DefaultLanguageFallback_DMY ? + recognizersText.RegExpUtility.getSafeRegExp(frenchDateTime.FrenchDateTime.DateExtractor4, "gis") : + recognizersText.RegExpUtility.getSafeRegExp(frenchDateTime.FrenchDateTime.DateExtractor5, "gis"), + recognizersText.RegExpUtility.getSafeRegExp(frenchDateTime.FrenchDateTime.DateExtractor6, "gis"), + recognizersText.RegExpUtility.getSafeRegExp(frenchDateTime.FrenchDateTime.DateExtractor7, "gis"), + recognizersText.RegExpUtility.getSafeRegExp(frenchDateTime.FrenchDateTime.DateExtractor8, "gis"), + recognizersText.RegExpUtility.getSafeRegExp(frenchDateTime.FrenchDateTime.DateExtractor9, "gis"), + recognizersText.RegExpUtility.getSafeRegExp(frenchDateTime.FrenchDateTime.DateExtractorA, "gis"), + ]; + this.implicitDateList = [ + recognizersText.RegExpUtility.getSafeRegExp(frenchDateTime.FrenchDateTime.OnRegex, "gis"), + recognizersText.RegExpUtility.getSafeRegExp(frenchDateTime.FrenchDateTime.RelaxedOnRegex, "gis"), + recognizersText.RegExpUtility.getSafeRegExp(frenchDateTime.FrenchDateTime.SpecialDayRegex, "gis"), + recognizersText.RegExpUtility.getSafeRegExp(frenchDateTime.FrenchDateTime.ThisRegex, "gis"), + recognizersText.RegExpUtility.getSafeRegExp(frenchDateTime.FrenchDateTime.LastDateRegex, "gis"), + recognizersText.RegExpUtility.getSafeRegExp(frenchDateTime.FrenchDateTime.NextDateRegex, "gis"), + recognizersText.RegExpUtility.getSafeRegExp(frenchDateTime.FrenchDateTime.StrictWeekDay, "gis"), + recognizersText.RegExpUtility.getSafeRegExp(frenchDateTime.FrenchDateTime.WeekDayOfMonthRegex, "gis"), + recognizersText.RegExpUtility.getSafeRegExp(frenchDateTime.FrenchDateTime.SpecialDate, "gis") + ]; + this.monthEnd = recognizersText.RegExpUtility.getSafeRegExp(frenchDateTime.FrenchDateTime.MonthEnd, "gis"); + this.ofMonth = recognizersText.RegExpUtility.getSafeRegExp(frenchDateTime.FrenchDateTime.OfMonth, "gis"); + this.dateUnitRegex = recognizersText.RegExpUtility.getSafeRegExp(frenchDateTime.FrenchDateTime.DateUnitRegex, "gis"); + this.forTheRegex = recognizersText.RegExpUtility.getSafeRegExp(frenchDateTime.FrenchDateTime.ForTheRegex, "gis"); + this.weekDayAndDayOfMonthRegex = recognizersText.RegExpUtility.getSafeRegExp(frenchDateTime.FrenchDateTime.WeekDayAndDayOfMonthRegex, "gis"); + this.relativeMonthRegex = recognizersText.RegExpUtility.getSafeRegExp(frenchDateTime.FrenchDateTime.RelativeMonthRegex, "gis"); + this.weekDayRegex = recognizersText.RegExpUtility.getSafeRegExp(frenchDateTime.FrenchDateTime.WeekDayRegex, "gis"); + this.dayOfWeek = frenchDateTime.FrenchDateTime.DayOfWeek; + this.ordinalExtractor = new recognizersTextNumber.FrenchOrdinalExtractor(); + this.integerExtractor = new recognizersTextNumber.FrenchIntegerExtractor(); + this.numberParser = new recognizersTextNumber.BaseNumberParser(new recognizersTextNumber.FrenchNumberParserConfiguration()); + this.durationExtractor = new baseDuration.BaseDurationExtractor(new durationConfiguration$4.FrenchDurationExtractorConfiguration()); + this.utilityConfiguration = new baseConfiguration$4.FrenchDateTimeUtilityConfiguration(); + this.nonDateUnitRegex = recognizersText.RegExpUtility.getSafeRegExp("(?heure|heures|hrs|secondes|seconde|secs|sec|minutes|minute|mins)\b", "gis"); + } +} +exports.FrenchDateExtractorConfiguration = FrenchDateExtractorConfiguration; +class FrenchDateParserConfiguration { + constructor(config) { + this.ordinalExtractor = config.ordinalExtractor; + this.integerExtractor = config.integerExtractor; + this.cardinalExtractor = config.cardinalExtractor; + this.durationExtractor = config.durationExtractor; + this.numberParser = config.numberParser; + this.durationParser = config.durationParser; + this.monthOfYear = config.monthOfYear; + this.dayOfMonth = config.dayOfMonth; + this.dayOfWeek = config.dayOfWeek; + this.unitMap = config.unitMap; + this.cardinalMap = config.cardinalMap; + this.dateRegex = new FrenchDateExtractorConfiguration().dateRegexList; + this.onRegex = recognizersText.RegExpUtility.getSafeRegExp(frenchDateTime.FrenchDateTime.OnRegex, "gis"); + this.specialDayRegex = recognizersText.RegExpUtility.getSafeRegExp(frenchDateTime.FrenchDateTime.SpecialDayRegex, "gis"); + this.specialDayWithNumRegex = recognizersText.RegExpUtility.getSafeRegExp(frenchDateTime.FrenchDateTime.SpecialDayWithNumRegex, "gis"); + this.nextRegex = recognizersText.RegExpUtility.getSafeRegExp(frenchDateTime.FrenchDateTime.NextDateRegex, "gis"); + this.unitRegex = recognizersText.RegExpUtility.getSafeRegExp(frenchDateTime.FrenchDateTime.DateUnitRegex, "gis"); + this.monthRegex = recognizersText.RegExpUtility.getSafeRegExp(frenchDateTime.FrenchDateTime.MonthRegex, "gis"); + this.weekDayRegex = recognizersText.RegExpUtility.getSafeRegExp(frenchDateTime.FrenchDateTime.WeekDayRegex, "gis"); + this.strictWeekDay = recognizersText.RegExpUtility.getSafeRegExp(frenchDateTime.FrenchDateTime.StrictWeekDay, "gis"); + this.lastRegex = recognizersText.RegExpUtility.getSafeRegExp(frenchDateTime.FrenchDateTime.LastDateRegex, "gis"); + this.thisRegex = recognizersText.RegExpUtility.getSafeRegExp(frenchDateTime.FrenchDateTime.ThisRegex, "gis"); + this.weekDayOfMonthRegex = recognizersText.RegExpUtility.getSafeRegExp(frenchDateTime.FrenchDateTime.WeekDayOfMonthRegex, "gis"); + this.forTheRegex = recognizersText.RegExpUtility.getSafeRegExp(frenchDateTime.FrenchDateTime.ForTheRegex, "gis"); + this.weekDayAndDayOfMonthRegex = recognizersText.RegExpUtility.getSafeRegExp(frenchDateTime.FrenchDateTime.WeekDayAndDayOfMonthRegex, "gis"); + this.relativeMonthRegex = recognizersText.RegExpUtility.getSafeRegExp(frenchDateTime.FrenchDateTime.RelativeMonthRegex, "gis"); + this.relativeWeekDayRegex = recognizersText.RegExpUtility.getSafeRegExp(frenchDateTime.FrenchDateTime.RelativeWeekDayRegex, "gis"); + this.utilityConfiguration = config.utilityConfiguration; + this.dateTokenPrefix = frenchDateTime.FrenchDateTime.DateTokenPrefix; + } + getSwiftDay(source) { + let trimedText = source.trim().toLowerCase(); + let swift = 0; + if (trimedText === "aujourd'hui" || trimedText === "auj") { + swift = 0; + } + else if (trimedText === "demain" || + trimedText.endsWith("a2m1") || + trimedText.endsWith("lendemain") || + trimedText.endsWith("jour suivant")) { + swift = 1; + } + else if (trimedText === "hier") { + swift = -1; + } + else if (trimedText.endsWith("après demain") || + trimedText.endsWith("après-demain")) { + swift = 2; + } + else if (trimedText.endsWith("avant-hier") || + trimedText.endsWith("avant hier")) { + swift = -2; + } + else if (trimedText.endsWith("dernier")) { + swift = -1; + } + return swift; + } + getSwiftMonth(source) { + let trimedText = source.trim().toLowerCase(); + let swift = 0; + if (trimedText.endsWith("prochaine") || trimedText.endsWith("prochain")) { + swift = 1; + } + else if (trimedText === "dernière" || + trimedText.endsWith("dernières") || + trimedText.endsWith("derniere") || + trimedText.endsWith("dernieres")) { + swift = -1; + } + return swift; + } + isCardinalLast(source) { + let trimedText = source.trim().toLowerCase(); + return (trimedText.endsWith("dernière") || + trimedText.endsWith("dernières") || + trimedText.endsWith("derniere") || + trimedText.endsWith("dernieres")); + } +} +exports.FrenchDateParserConfiguration = FrenchDateParserConfiguration; + +}); + +unwrapExports(dateConfiguration$4); + +var holidayConfiguration$4 = createCommonjsModule(function (module, exports) { +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); + + + + +class FrenchHolidayExtractorConfiguration { + constructor() { + this.holidayRegexes = [ + recognizersText.RegExpUtility.getSafeRegExp(frenchDateTime.FrenchDateTime.HolidayRegex1, "gis"), + recognizersText.RegExpUtility.getSafeRegExp(frenchDateTime.FrenchDateTime.HolidayRegex2, "gis"), + recognizersText.RegExpUtility.getSafeRegExp(frenchDateTime.FrenchDateTime.HolidayRegex3, "gis"), + recognizersText.RegExpUtility.getSafeRegExp(frenchDateTime.FrenchDateTime.HolidayRegex4, "gis") + ]; + } +} +exports.FrenchHolidayExtractorConfiguration = FrenchHolidayExtractorConfiguration; +class FrenchHolidayParserConfiguration extends baseHoliday.BaseHolidayParserConfiguration { + constructor() { + super(); + this.holidayRegexList = [ + recognizersText.RegExpUtility.getSafeRegExp(frenchDateTime.FrenchDateTime.HolidayRegex1, "gis"), + recognizersText.RegExpUtility.getSafeRegExp(frenchDateTime.FrenchDateTime.HolidayRegex2, "gis"), + recognizersText.RegExpUtility.getSafeRegExp(frenchDateTime.FrenchDateTime.HolidayRegex3, "gis"), + recognizersText.RegExpUtility.getSafeRegExp(frenchDateTime.FrenchDateTime.HolidayRegex4, "gis") + ]; + this.holidayNames = frenchDateTime.FrenchDateTime.HolidayNames; + this.holidayFuncDictionary = this.initHolidayFuncs(); + } + initHolidayFuncs() { + return new Map([ + ...super.initHolidayFuncs(), + ["maosbirthday", FrenchHolidayParserConfiguration.MaoBirthday], + ["yuandan", FrenchHolidayParserConfiguration.NewYear], + ["teachersday", FrenchHolidayParserConfiguration.TeacherDay], + ["singleday", FrenchHolidayParserConfiguration.SinglesDay], + ["allsaintsday", FrenchHolidayParserConfiguration.HalloweenDay], + ["youthday", FrenchHolidayParserConfiguration.YouthDay], + ["childrenday", FrenchHolidayParserConfiguration.ChildrenDay], + ["femaleday", FrenchHolidayParserConfiguration.FemaleDay], + ["treeplantingday", FrenchHolidayParserConfiguration.TreePlantDay], + ["arborday", FrenchHolidayParserConfiguration.TreePlantDay], + ["girlsday", FrenchHolidayParserConfiguration.GirlsDay], + ["whiteloverday", FrenchHolidayParserConfiguration.WhiteLoverDay], + ["loverday", FrenchHolidayParserConfiguration.ValentinesDay], + ["christmas", FrenchHolidayParserConfiguration.ChristmasDay], + ["xmas", FrenchHolidayParserConfiguration.ChristmasDay], + ["newyear", FrenchHolidayParserConfiguration.NewYear], + ["newyearday", FrenchHolidayParserConfiguration.NewYear], + ["newyearsday", FrenchHolidayParserConfiguration.NewYear], + ["inaugurationday", FrenchHolidayParserConfiguration.InaugurationDay], + ["groundhougday", FrenchHolidayParserConfiguration.GroundhogDay], + ["valentinesday", FrenchHolidayParserConfiguration.ValentinesDay], + ["stpatrickday", FrenchHolidayParserConfiguration.StPatrickDay], + ["aprilfools", FrenchHolidayParserConfiguration.FoolDay], + ["stgeorgeday", FrenchHolidayParserConfiguration.StGeorgeDay], + ["mayday", FrenchHolidayParserConfiguration.Mayday], + ["cincodemayoday", FrenchHolidayParserConfiguration.CincoDeMayoday], + ["baptisteday", FrenchHolidayParserConfiguration.BaptisteDay], + ["usindependenceday", FrenchHolidayParserConfiguration.UsaIndependenceDay], + ["independenceday", FrenchHolidayParserConfiguration.UsaIndependenceDay], + ["bastilleday", FrenchHolidayParserConfiguration.BastilleDay], + ["halloweenday", FrenchHolidayParserConfiguration.HalloweenDay], + ["allhallowday", FrenchHolidayParserConfiguration.AllHallowDay], + ["allsoulsday", FrenchHolidayParserConfiguration.AllSoulsday], + ["guyfawkesday", FrenchHolidayParserConfiguration.GuyFawkesDay], + ["veteransday", FrenchHolidayParserConfiguration.Veteransday], + ["christmaseve", FrenchHolidayParserConfiguration.ChristmasEve], + ["newyeareve", FrenchHolidayParserConfiguration.NewYearEve], + ["fathersday", FrenchHolidayParserConfiguration.FathersDay], + ["mothersday", FrenchHolidayParserConfiguration.MothersDay], + ["labourday", FrenchHolidayParserConfiguration.LabourDay] + ]); + } + // All JavaScript dates are zero-based (-1) + static NewYear(year) { return new Date(year, 1 - 1, 1); } + static NewYearEve(year) { return new Date(year, 12 - 1, 31); } + static ChristmasDay(year) { return new Date(year, 12 - 1, 25); } + static ChristmasEve(year) { return new Date(year, 12 - 1, 24); } + static FemaleDay(year) { return new Date(year, 3 - 1, 8); } + static ChildrenDay(year) { return new Date(year, 6 - 1, 1); } + static HalloweenDay(year) { return new Date(year, 10 - 1, 31); } + static EasterDay(year) { return utilities$2.DateUtils.minValue(); } + static ValentinesDay(year) { return new Date(year, 2, 14); } + static WhiteLoverDay(year) { return new Date(year, 3, 14); } + static FoolDay(year) { return new Date(year, 4, 1); } + static GirlsDay(year) { return new Date(year, 3, 7); } + static TreePlantDay(year) { return new Date(year, 3, 12); } + static YouthDay(year) { return new Date(year, 5, 4); } + static TeacherDay(year) { return new Date(year, 9, 10); } + static SinglesDay(year) { return new Date(year, 11, 11); } + static MaoBirthday(year) { return new Date(year, 12, 26); } + static InaugurationDay(year) { return new Date(year, 1, 20); } + static GroundhogDay(year) { return new Date(year, 2, 2); } + static StPatrickDay(year) { return new Date(year, 3, 17); } + static StGeorgeDay(year) { return new Date(year, 4, 23); } + static Mayday(year) { return new Date(year, 5, 1); } + static CincoDeMayoday(year) { return new Date(year, 5, 5); } + static BaptisteDay(year) { return new Date(year, 6, 24); } + static UsaIndependenceDay(year) { return new Date(year, 7, 4); } + static BastilleDay(year) { return new Date(year, 7, 14); } + static AllHallowDay(year) { return new Date(year, 11, 1); } + static AllSoulsday(year) { return new Date(year, 11, 2); } + static GuyFawkesDay(year) { return new Date(year, 11, 5); } + static Veteransday(year) { return new Date(year, 11, 11); } + static FathersDay(year) { return new Date(year, 6, 17); } + static MothersDay(year) { return new Date(year, 5, 27); } + static LabourDay(year) { return new Date(year, 5, 1); } + getSwiftYear(text) { + let trimedText = text.trim().toLowerCase(); + let swift = -10; + if (trimedText.endsWith("prochain")) { // next - 'l'annee prochain') + swift = 1; + } + else if (trimedText.endsWith("dernier")) { // last - 'l'annee dernier' + swift = -1; + } + else if (trimedText.startsWith("cette")) { // this - 'cette annees' + swift = 0; + } + return swift; + } + sanitizeHolidayToken(holiday) { + return holiday.replace(/ /g, "") + .replace(/'/g, ""); + } +} +exports.FrenchHolidayParserConfiguration = FrenchHolidayParserConfiguration; + +}); + +unwrapExports(holidayConfiguration$4); + +var setConfiguration$4 = createCommonjsModule(function (module, exports) { +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); + + + + + + + + + + + + + + + + +class FrenchSetExtractorConfiguration { + constructor() { + this.lastRegex = recognizersText.RegExpUtility.getSafeRegExp(frenchDateTime.FrenchDateTime.SetLastRegex, "gis"); + this.periodicRegex = recognizersText.RegExpUtility.getSafeRegExp(frenchDateTime.FrenchDateTime.PeriodicRegex, "gis"); + this.eachUnitRegex = recognizersText.RegExpUtility.getSafeRegExp(frenchDateTime.FrenchDateTime.EachUnitRegex, "gis"); + this.eachPrefixRegex = recognizersText.RegExpUtility.getSafeRegExp(frenchDateTime.FrenchDateTime.EachPrefixRegex, "gis"); + this.eachDayRegex = recognizersText.RegExpUtility.getSafeRegExp(frenchDateTime.FrenchDateTime.EachDayRegex, "gis"); + this.beforeEachDayRegex = null; + this.setEachRegex = recognizersText.RegExpUtility.getSafeRegExp(frenchDateTime.FrenchDateTime.SetEachRegex, "gis"); + this.setWeekDayRegex = recognizersText.RegExpUtility.getSafeRegExp(frenchDateTime.FrenchDateTime.SetWeekDayRegex, "gis"); + this.durationExtractor = new baseDuration.BaseDurationExtractor(new durationConfiguration$4.FrenchDurationExtractorConfiguration()); + this.timeExtractor = new baseTime.BaseTimeExtractor(new timeConfiguration$4.FrenchTimeExtractorConfiguration()); + this.dateExtractor = new baseDate.BaseDateExtractor(new dateConfiguration$4.FrenchDateExtractorConfiguration()); + this.dateTimeExtractor = new baseDateTime$2.BaseDateTimeExtractor(new dateTimeConfiguration$4.FrenchDateTimeExtractorConfiguration()); + this.datePeriodExtractor = new baseDatePeriod.BaseDatePeriodExtractor(new datePeriodConfiguration$4.FrenchDatePeriodExtractorConfiguration()); + this.timePeriodExtractor = new baseTimePeriod.BaseTimePeriodExtractor(new timePeriodConfiguration$4.FrenchTimePeriodExtractorConfiguration()); + this.dateTimePeriodExtractor = new baseDateTimePeriod.BaseDateTimePeriodExtractor(new dateTimePeriodConfiguration$4.FrenchDateTimePeriodExtractorConfiguration()); + } +} +exports.FrenchSetExtractorConfiguration = FrenchSetExtractorConfiguration; +class FrenchSetParserConfiguration { + constructor(config) { + this.durationExtractor = config.durationExtractor; + this.timeExtractor = config.timeExtractor; + this.dateExtractor = config.dateExtractor; + this.dateTimeExtractor = config.dateTimeExtractor; + this.datePeriodExtractor = config.datePeriodExtractor; + this.timePeriodExtractor = config.timePeriodExtractor; + this.dateTimePeriodExtractor = config.dateTimePeriodExtractor; + this.durationParser = config.durationParser; + this.timeParser = config.timeParser; + this.dateParser = config.dateParser; + this.dateTimeParser = config.dateTimeParser; + this.datePeriodParser = config.datePeriodParser; + this.timePeriodParser = config.timePeriodParser; + this.dateTimePeriodParser = config.dateTimePeriodParser; + this.unitMap = config.unitMap; + this.eachPrefixRegex = recognizersText.RegExpUtility.getSafeRegExp(frenchDateTime.FrenchDateTime.EachPrefixRegex, "gis"); + this.periodicRegex = recognizersText.RegExpUtility.getSafeRegExp(frenchDateTime.FrenchDateTime.PeriodicRegex, "gis"); + this.eachUnitRegex = recognizersText.RegExpUtility.getSafeRegExp(frenchDateTime.FrenchDateTime.EachUnitRegex, "gis"); + this.eachDayRegex = recognizersText.RegExpUtility.getSafeRegExp(frenchDateTime.FrenchDateTime.EachDayRegex, "gis"); + this.setWeekDayRegex = recognizersText.RegExpUtility.getSafeRegExp(frenchDateTime.FrenchDateTime.SetWeekDayRegex, "gis"); + this.setEachRegex = recognizersText.RegExpUtility.getSafeRegExp(frenchDateTime.FrenchDateTime.SetEachRegex, "gis"); + } + getMatchedDailyTimex(text) { + let trimedText = text.trim().toLowerCase(); + let timex = ""; + if (trimedText === "quotidien" || trimedText === "quotidienne" || + trimedText === "jours" || trimedText === "journellement") { + timex = "P1D"; + } + else if (trimedText === "hebdomadaire") { + timex = "P1W"; + } + else if (trimedText === "bihebdomadaire") { + timex = "P2W"; + } + else if (trimedText === "mensuel" || trimedText === "mensuelle") { + timex = "P1M"; + } + else if (trimedText === "annuel" || trimedText === "annuellement") { + timex = "P1Y"; + } + else { + timex = null; + return { + timex, + matched: false + }; + } + return { + timex, + matched: true + }; + } + getMatchedUnitTimex(text) { + let trimedText = text.trim().toLowerCase(); + let timex = ""; + if (trimedText === "jour" || trimedText === "journee") { + timex = "P1D"; + } + else if (trimedText === "semaine") { + timex = "P1W"; + } + else if (trimedText === "mois") { + timex = "P1M"; + } + else if (trimedText === "an" || trimedText === "annee") { + timex = "P1Y"; + } + else { + timex = null; + return { + matched: false, + timex + }; + } + return { + matched: true, + timex + }; + } +} +exports.FrenchSetParserConfiguration = FrenchSetParserConfiguration; + +}); + +unwrapExports(setConfiguration$4); + +var mergedConfiguration$4 = createCommonjsModule(function (module, exports) { +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); + + + + + + + + + + + + + + + + + + + + + + +class FrenchMergedExtractorConfiguration { + constructor() { + this.beforeRegex = recognizersText.RegExpUtility.getSafeRegExp(frenchDateTime.FrenchDateTime.BeforeRegex); + this.afterRegex = recognizersText.RegExpUtility.getSafeRegExp(frenchDateTime.FrenchDateTime.AfterRegex); + this.sinceRegex = recognizersText.RegExpUtility.getSafeRegExp(frenchDateTime.FrenchDateTime.SinceRegex); + this.fromToRegex = recognizersText.RegExpUtility.getSafeRegExp(frenchDateTime.FrenchDateTime.FromToRegex); + this.singleAmbiguousMonthRegex = recognizersText.RegExpUtility.getSafeRegExp(frenchDateTime.FrenchDateTime.SingleAmbiguousMonthRegex); + this.prepositionSuffixRegex = recognizersText.RegExpUtility.getSafeRegExp(frenchDateTime.FrenchDateTime.PrepositionSuffixRegex); + this.numberEndingPattern = recognizersText.RegExpUtility.getSafeRegExp(frenchDateTime.FrenchDateTime.NumberEndingPattern); + this.dateExtractor = new baseDate.BaseDateExtractor(new dateConfiguration$4.FrenchDateExtractorConfiguration()); + this.timeExtractor = new baseTime.BaseTimeExtractor(new timeConfiguration$4.FrenchTimeExtractorConfiguration()); + this.dateTimeExtractor = new baseDateTime$2.BaseDateTimeExtractor(new dateTimeConfiguration$4.FrenchDateTimeExtractorConfiguration()); + this.datePeriodExtractor = new baseDatePeriod.BaseDatePeriodExtractor(new datePeriodConfiguration$4.FrenchDatePeriodExtractorConfiguration()); + this.timePeriodExtractor = new baseTimePeriod.BaseTimePeriodExtractor(new timePeriodConfiguration$4.FrenchTimePeriodExtractorConfiguration()); + this.dateTimePeriodExtractor = new baseDateTimePeriod.BaseDateTimePeriodExtractor(new dateTimePeriodConfiguration$4.FrenchDateTimePeriodExtractorConfiguration()); + this.durationExtractor = new baseDuration.BaseDurationExtractor(new durationConfiguration$4.FrenchDurationExtractorConfiguration()); + this.setExtractor = new baseSet.BaseSetExtractor(new setConfiguration$4.FrenchSetExtractorConfiguration()); + this.holidayExtractor = new baseHoliday.BaseHolidayExtractor(new holidayConfiguration$4.FrenchHolidayExtractorConfiguration()); + this.integerExtractor = new recognizersTextNumber.FrenchIntegerExtractor(); + this.filterWordRegexList = []; + } +} +exports.FrenchMergedExtractorConfiguration = FrenchMergedExtractorConfiguration; +class FrenchMergedParserConfiguration extends baseConfiguration$4.FrenchCommonDateTimeParserConfiguration { + constructor() { + super(); + this.beforeRegex = recognizersText.RegExpUtility.getSafeRegExp(frenchDateTime.FrenchDateTime.BeforeRegex); + this.afterRegex = recognizersText.RegExpUtility.getSafeRegExp(frenchDateTime.FrenchDateTime.AfterRegex); + this.sinceRegex = recognizersText.RegExpUtility.getSafeRegExp(frenchDateTime.FrenchDateTime.SinceRegex); + this.datePeriodParser = new baseDatePeriod.BaseDatePeriodParser(new datePeriodConfiguration$4.FrenchDatePeriodParserConfiguration(this)); + this.timePeriodParser = new baseTimePeriod.BaseTimePeriodParser(new timePeriodConfiguration$4.FrenchTimePeriodParserConfiguration(this)); + this.setParser = new baseSet.BaseSetParser(new setConfiguration$4.FrenchSetParserConfiguration(this)); + this.holidayParser = new baseHoliday.BaseHolidayParser(new holidayConfiguration$4.FrenchHolidayParserConfiguration()); + } +} +exports.FrenchMergedParserConfiguration = FrenchMergedParserConfiguration; + +}); + +unwrapExports(mergedConfiguration$4); + +var chineseDateTime = createCommonjsModule(function (module, exports) { +"use strict"; +// ------------------------------------------------------------------------------ +// +// This code was generated by a tool. +// Changes to this file may cause incorrect behavior and will be lost if +// the code is regenerated. +// +// ------------------------------------------------------------------------------ +Object.defineProperty(exports, "__esModule", { value: true }); + +var ChineseDateTime; +(function (ChineseDateTime) { + ChineseDateTime.MonthRegex = `(?正月|一月|二月|三月|四月|五月|六月|七月|八月|九月|十月|十一月|十二月|01月|02月|03月|04月|05月|06月|07月|08月|09月|10月|11月|12月|1月|2月|3月|4月|5月|6月|7月|8月|9月|大年)`; + ChineseDateTime.DayRegex = `(?01|02|03|04|05|06|07|08|09|10|11|12|13|14|15|16|17|18|19|20|21|22|23|24|25|26|27|28|29|30|31|1|2|3|4|5|6|7|8|9)`; + ChineseDateTime.DateDayRegexInChinese = `(?初一|三十|一日|十一日|二十一日|三十一日|二日|三日|四日|五日|六日|七日|八日|九日|十二日|十三日|十四日|十五日|十六日|十七日|十八日|十九日|二十二日|二十三日|二十四日|二十五日|二十六日|二十七日|二十八日|二十九日|一日|十一日|十日|二十一日|二十日|三十一日|三十日|二日|三日|四日|五日|六日|七日|八日|九日|十二日|十三日|十四日|十五日|十六日|十七日|十八日|十九日|二十二日|二十三日|二十四日|二十五日|二十六日|二十七日|二十八日|二十九日|十日|二十日|三十日|10日|11日|12日|13日|14日|15日|16日|17日|18日|19日|1日|20日|21日|22日|23日|24日|25日|26日|27日|28日|29日|2日|30日|31日|3日|4日|5日|6日|7日|8日|9日|一号|十一号|二十一号|三十一号|二号|三号|四号|五号|六号|七号|八号|九号|十二号|十三号|十四号|十五号|十六号|十七号|十八号|十九号|二十二号|二十三号|二十四号|二十五号|二十六号|二十七号|二十八号|二十九号|一号|十一号|十号|二十一号|二十号|三十一号|三十号|二号|三号|四号|五号|六号|七号|八号|九号|十二号|十三号|十四号|十五号|十六号|十七号|十八号|十九号|二十二号|二十三号|二十四号|二十五号|二十六号|二十七号|二十八号|二十九号|十号|二十号|三十号|10号|11号|12号|13号|14号|15号|16号|17号|18号|19号|1号|20号|21号|22号|23号|24号|25号|26号|27号|28号|29号|2号|30号|31号|3号|4号|5号|6号|7号|8号|9号)`; + ChineseDateTime.DayRegexNumInChinese = `(?一|十一|二十一|三十一|二|三|四|五|六|七|八|九|十二|十三|十四|十五|十六|十七|十八|十九|二十二|二十三|二十四|二十五|二十六|二十七|二十八|二十九|一|十一|十|二十一|二十|三十一|三十|二|三|四|五|六|七|八|九|十二|十三|十四|十五|十六|十七|十八|十九|二十二|二十三|二十四|二十五|二十六|二十七|二十八|二十九|十|二十|廿|卅)`; + ChineseDateTime.MonthNumRegex = `(?01|02|03|04|05|06|07|08|09|10|11|12|1|2|3|4|5|6|7|8|9)`; + ChineseDateTime.TwoNumYear = '50'; + ChineseDateTime.YearNumRegex = `(?((1[5-9]|20)\\d{2})|2100)`; + ChineseDateTime.YearRegex = `(?(\\d{2,4}))`; + ChineseDateTime.ZeroToNineIntegerRegexChs = `[一二三四五六七八九零壹贰叁肆伍陆柒捌玖〇两千俩倆仨]`; + ChineseDateTime.DateYearInChineseRegex = `(?(${ChineseDateTime.ZeroToNineIntegerRegexChs}${ChineseDateTime.ZeroToNineIntegerRegexChs}${ChineseDateTime.ZeroToNineIntegerRegexChs}${ChineseDateTime.ZeroToNineIntegerRegexChs}|${ChineseDateTime.ZeroToNineIntegerRegexChs}${ChineseDateTime.ZeroToNineIntegerRegexChs}|${ChineseDateTime.ZeroToNineIntegerRegexChs}${ChineseDateTime.ZeroToNineIntegerRegexChs}${ChineseDateTime.ZeroToNineIntegerRegexChs}))`; + ChineseDateTime.WeekDayRegex = `(?周日|周天|周一|周二|周三|周四|周五|周六|星期一|星期二|星期三|星期四|星期五|星期六|星期日|星期天|礼拜一|礼拜二|礼拜三|礼拜四|礼拜五|礼拜六|礼拜日|礼拜天|禮拜一|禮拜二|禮拜三|禮拜四|禮拜五|禮拜六|禮拜日|禮拜天|週日|週天|週一|週二|週三|週四|週五|週六)`; + ChineseDateTime.LunarRegex = `(农历|初一|正月|大年)`; + ChineseDateTime.DateThisRegex = `(这个|这一个|这|这一|本)${ChineseDateTime.WeekDayRegex}`; + ChineseDateTime.DateLastRegex = `(上一个|上个|上一|上|最后一个|最后)(的)?${ChineseDateTime.WeekDayRegex}`; + ChineseDateTime.DateNextRegex = `(下一个|下个|下一|下)(的)?${ChineseDateTime.WeekDayRegex}`; + ChineseDateTime.SpecialDayRegex = `(最近|前天|后天|昨天|明天|今天|今日|明日|昨日|大后天|大前天|後天|大後天)`; + ChineseDateTime.SpecialDayWithNumRegex = `^[.]`; + ChineseDateTime.WeekDayOfMonthRegex = `(((${ChineseDateTime.MonthRegex}|${ChineseDateTime.MonthNumRegex})的\\s*)(?第一个|第二个|第三个|第四个|第五个|最后一个)\\s*${ChineseDateTime.WeekDayRegex})`; + ChineseDateTime.DateThisRe = `这个|这一个|这|这一|本|今`; + ChineseDateTime.DateLastRe = `上个|上一个|上|上一|去`; + ChineseDateTime.DateNextRe = `下个|下一个|下|下一|明`; + ChineseDateTime.SpecialDate = `(?(${ChineseDateTime.DateThisRe}|${ChineseDateTime.DateLastRe}|${ChineseDateTime.DateNextRe})年)?(?(${ChineseDateTime.DateThisRe}|${ChineseDateTime.DateLastRe}|${ChineseDateTime.DateNextRe})月)?${ChineseDateTime.DateDayRegexInChinese}`; + ChineseDateTime.DateUnitRegex = `(?年|个月|周|日|天)`; + ChineseDateTime.BeforeRegex = `以前|之前|前`; + ChineseDateTime.AfterRegex = `以后|以後|之后|之後|后|後`; + ChineseDateTime.DateRegexList1 = `(${ChineseDateTime.LunarRegex}(\\s*))?(((${ChineseDateTime.YearRegex}|${ChineseDateTime.DateYearInChineseRegex})年)(\\s*))?${ChineseDateTime.MonthRegex}(\\s*)${ChineseDateTime.DateDayRegexInChinese}((\\s*|,|,)${ChineseDateTime.WeekDayRegex})?(${ChineseDateTime.BeforeRegex}|${ChineseDateTime.AfterRegex})?`; + ChineseDateTime.DateRegexList2 = `(((${ChineseDateTime.YearRegex}|${ChineseDateTime.DateYearInChineseRegex})年)(\\s*))?(${ChineseDateTime.LunarRegex}(\\s*))?${ChineseDateTime.MonthRegex}(\\s*)${ChineseDateTime.DateDayRegexInChinese}((\\s*|,|,)${ChineseDateTime.WeekDayRegex})?(${ChineseDateTime.BeforeRegex}|${ChineseDateTime.AfterRegex})?`; + ChineseDateTime.DateRegexList3 = `(((${ChineseDateTime.YearRegex}|${ChineseDateTime.DateYearInChineseRegex})年)(\\s*))?(${ChineseDateTime.LunarRegex}(\\s*))?${ChineseDateTime.MonthRegex}(\\s*)(${ChineseDateTime.DayRegexNumInChinese}|${ChineseDateTime.DayRegex})((\\s*|,|,)${ChineseDateTime.WeekDayRegex})?(${ChineseDateTime.BeforeRegex}|${ChineseDateTime.AfterRegex})?`; + ChineseDateTime.DateRegexList4 = `${ChineseDateTime.MonthNumRegex}\\s*/\\s*${ChineseDateTime.DayRegex}((\\s+|\\s*,\\s*)${ChineseDateTime.YearRegex})?`; + ChineseDateTime.DateRegexList5 = `${ChineseDateTime.DayRegex}\\s*/\\s*${ChineseDateTime.MonthNumRegex}((\\s+|\\s*,\\s*)${ChineseDateTime.YearRegex})?`; + ChineseDateTime.DateRegexList6 = `${ChineseDateTime.MonthNumRegex}\\s*[/\\\\\\-]\\s*${ChineseDateTime.DayRegex}\\s*[/\\\\\\-]\\s*${ChineseDateTime.YearRegex}`; + ChineseDateTime.DateRegexList7 = `${ChineseDateTime.DayRegex}\\s*[/\\\\\\-\\.]\\s*${ChineseDateTime.MonthNumRegex}\\s*[/\\\\\\-\\.]\\s*${ChineseDateTime.YearNumRegex}`; + ChineseDateTime.DateRegexList8 = `${ChineseDateTime.YearNumRegex}\\s*[/\\\\\\-\\. ]\\s*${ChineseDateTime.MonthNumRegex}\\s*[/\\\\\\-\\. ]\\s*${ChineseDateTime.DayRegex}`; + ChineseDateTime.DatePeriodTillRegex = `(?到|至|--|-|—|——|~|–)`; + ChineseDateTime.DatePeriodTillSuffixRequiredRegex = `(?与|和)`; + ChineseDateTime.DatePeriodDayRegexInChinese = `(?初一|三十|一日|十一日|二十一日|三十一日|二日|三日|四日|五日|六日|七日|八日|九日|十二日|十三日|十四日|十五日|十六日|十七日|十八日|十九日|二十二日|二十三日|二十四日|二十五日|二十六日|二十七日|二十八日|二十九日|一日|十一日|十日|二十一日|二十日|三十一日|三十日|二日|三日|四日|五日|六日|七日|八日|九日|十二日|十三日|十四日|十五日|十六日|十七日|十八日|十九日|二十二日|二十三日|二十四日|二十五日|二十六日|二十七日|二十八日|二十九日|十日|二十日|三十日|10日|11日|12日|13日|14日|15日|16日|17日|18日|19日|1日|20日|21日|22日|23日|24日|25日|26日|27日|28日|29日|2日|30日|31日|3日|4日|5日|6日|7日|8日|9日|一号|十一号|二十一号|三十一号|二号|三号|四号|五号|六号|七号|八号|九号|十二号|十三号|十四号|十五号|十六号|十七号|十八号|十九号|二十二号|二十三号|二十四号|二十五号|二十六号|二十七号|二十八号|二十九号|一号|十一号|十号|二十一号|二十号|三十一号|三十号|二号|三号|四号|五号|六号|七号|八号|九号|十二号|十三号|十四号|十五号|十六号|十七号|十八号|十九号|二十二号|二十三号|二十四号|二十五号|二十六号|二十七号|二十八号|二十九号|十号|二十号|三十号|10号|11号|12号|13号|14号|15号|16号|17号|18号|19号|1号|20号|21号|22号|23号|24号|25号|26号|27号|28号|29号|2号|30号|31号|3号|4号|5号|6号|7号|8号|9号|一|十一|二十一|三十一|二|三|四|五|六|七|八|九|十二|十三|十四|十五|十六|十七|十八|十九|二十二|二十三|二十四|二十五|二十六|二十七|二十八|二十九|一|十一|十|二十一|二十|三十一|三十|二|三|四|五|六|七|八|九|十二|十三|十四|十五|十六|十七|十八|十九|二十二|二十三|二十四|二十五|二十六|二十七|二十八|二十九|十|二十|三十||廿|卅)`; + ChineseDateTime.DatePeriodThisRegex = `这个|这一个|这|这一|本`; + ChineseDateTime.DatePeriodLastRegex = `上个|上一个|上|上一`; + ChineseDateTime.DatePeriodNextRegex = `下个|下一个|下|下一`; + ChineseDateTime.RelativeMonthRegex = `(?(${ChineseDateTime.DatePeriodThisRegex}|${ChineseDateTime.DatePeriodLastRegex}|${ChineseDateTime.DatePeriodNextRegex})\\s*月)`; + ChineseDateTime.DatePeriodYearRegex = `((${ChineseDateTime.YearNumRegex})(\\s*年)?|(${ChineseDateTime.YearRegex})\\s*年)(?=[\\u4E00-\\u9FFF]|\\s|$|\\W)`; + ChineseDateTime.StrictYearRegex = `${ChineseDateTime.DatePeriodYearRegex}`; + ChineseDateTime.YearRegexInNumber = `(?(\\d{3,4}))`; + ChineseDateTime.DatePeriodYearInChineseRegex = `(?(${ChineseDateTime.ZeroToNineIntegerRegexChs}${ChineseDateTime.ZeroToNineIntegerRegexChs}${ChineseDateTime.ZeroToNineIntegerRegexChs}${ChineseDateTime.ZeroToNineIntegerRegexChs}|${ChineseDateTime.ZeroToNineIntegerRegexChs}${ChineseDateTime.ZeroToNineIntegerRegexChs}|${ChineseDateTime.ZeroToNineIntegerRegexChs}${ChineseDateTime.ZeroToNineIntegerRegexChs}${ChineseDateTime.ZeroToNineIntegerRegexChs}))年`; + ChineseDateTime.MonthSuffixRegex = `(?(${ChineseDateTime.RelativeMonthRegex}|${ChineseDateTime.MonthRegex}))`; + ChineseDateTime.SimpleCasesRegex = `((从)\\s*)?((${ChineseDateTime.DatePeriodYearRegex}|${ChineseDateTime.DatePeriodYearInChineseRegex})\\s*)?${ChineseDateTime.MonthSuffixRegex}(${ChineseDateTime.DatePeriodDayRegexInChinese}|${ChineseDateTime.DayRegex})\\s*${ChineseDateTime.DatePeriodTillRegex}\\s*(${ChineseDateTime.DatePeriodDayRegexInChinese}|${ChineseDateTime.DayRegex})((\\s+|\\s*,\\s*)${ChineseDateTime.DatePeriodYearRegex})?`; + ChineseDateTime.YearAndMonth = `(${ChineseDateTime.DatePeriodYearInChineseRegex}|${ChineseDateTime.DatePeriodYearRegex})${ChineseDateTime.MonthRegex}`; + ChineseDateTime.PureNumYearAndMonth = `(${ChineseDateTime.YearRegexInNumber}\\s*[-\\.\\/]\\s*${ChineseDateTime.MonthNumRegex})|(${ChineseDateTime.MonthNumRegex}\\s*\\/\\s*${ChineseDateTime.YearRegexInNumber})`; + ChineseDateTime.OneWordPeriodRegex = `(((明年|今年|去年)\\s*)?${ChineseDateTime.MonthRegex}|(${ChineseDateTime.DatePeriodThisRegex}|${ChineseDateTime.DatePeriodLastRegex}|${ChineseDateTime.DatePeriodNextRegex})\\s*(周末|周|月|年)|周末|今年|明年|去年|前年|后年)`; + ChineseDateTime.WeekOfMonthRegex = `(?${ChineseDateTime.MonthSuffixRegex}的(?第一|第二|第三|第四|第五|最后一)\\s*周\\s*)`; + ChineseDateTime.UnitRegex = `(?年|(个)?月|周|日|天)`; + ChineseDateTime.FollowedUnit = `^\\s*${ChineseDateTime.UnitRegex}`; + ChineseDateTime.NumberCombinedWithUnit = `(?\\d+(\\.\\d*)?)${ChineseDateTime.UnitRegex}`; + ChineseDateTime.DateRangePrepositions = `((从|在|自)\\s*)?`; + ChineseDateTime.YearToYear = `(${ChineseDateTime.DateRangePrepositions})(${ChineseDateTime.DatePeriodYearInChineseRegex}|${ChineseDateTime.DatePeriodYearRegex})\\s*(${ChineseDateTime.DatePeriodTillRegex}|后|後|之后|之後)\\s*(${ChineseDateTime.DatePeriodYearInChineseRegex}|${ChineseDateTime.DatePeriodYearRegex})(\\s*((之间|之内|期间|中间|间)|前|之前))?`; + ChineseDateTime.YearToYearSuffixRequired = `(${ChineseDateTime.DateRangePrepositions})(${ChineseDateTime.DatePeriodYearInChineseRegex}|${ChineseDateTime.DatePeriodYearRegex})\\s*(${ChineseDateTime.DatePeriodTillSuffixRequiredRegex})\\s*(${ChineseDateTime.DatePeriodYearInChineseRegex}|${ChineseDateTime.DatePeriodYearRegex})\\s*(之间|之内|期间|中间|间)`; + ChineseDateTime.MonthToMonth = `(${ChineseDateTime.DateRangePrepositions})(${ChineseDateTime.MonthRegex})${ChineseDateTime.DatePeriodTillRegex}(${ChineseDateTime.MonthRegex})`; + ChineseDateTime.MonthToMonthSuffixRequired = `(${ChineseDateTime.DateRangePrepositions})(${ChineseDateTime.MonthRegex})${ChineseDateTime.DatePeriodTillSuffixRequiredRegex}(${ChineseDateTime.MonthRegex})\\s*(之间|之内|期间|中间|间)`; + ChineseDateTime.PastRegex = `(?(前|上|之前|近|过去))`; + ChineseDateTime.FutureRegex = `(?(后|後|(?春|夏|秋|冬)(天|季)?`; + ChineseDateTime.SeasonWithYear = `((${ChineseDateTime.DatePeriodYearRegex}|${ChineseDateTime.DatePeriodYearInChineseRegex}|(?明年|今年|去年))(的)?)?${ChineseDateTime.SeasonRegex}`; + ChineseDateTime.QuarterRegex = `((${ChineseDateTime.DatePeriodYearRegex}|${ChineseDateTime.DatePeriodYearInChineseRegex}|(?明年|今年|去年))(的)?)?(第(?1|2|3|4|一|二|三|四)季度)`; + ChineseDateTime.CenturyRegex = `(?\\d|1\\d|2\\d)世纪`; + ChineseDateTime.CenturyRegexInChinese = `(?一|二|三|四|五|六|七|八|九|十|十一|十二|十三|十四|十五|十六|十七|十八|十九|二十|二十一|二十二)世纪`; + ChineseDateTime.RelativeCenturyRegex = `(?(${ChineseDateTime.DatePeriodLastRegex}|${ChineseDateTime.DatePeriodThisRegex}|${ChineseDateTime.DatePeriodNextRegex}))世纪`; + ChineseDateTime.DecadeRegexInChinese = `(?十|一十|二十|三十|四十|五十|六十|七十|八十|九十)`; + ChineseDateTime.DecadeRegex = `(?(${ChineseDateTime.CenturyRegex}|${ChineseDateTime.CenturyRegexInChinese}|${ChineseDateTime.RelativeCenturyRegex}))?(?(\\d0|${ChineseDateTime.DecadeRegexInChinese}))年代`; + ChineseDateTime.PrepositionRegex = `(?^的|在$)`; + ChineseDateTime.NowRegex = `(?现在|马上|立刻|刚刚才|刚刚|刚才)`; + ChineseDateTime.NightRegex = `(?早|晚)`; + ChineseDateTime.TimeOfTodayRegex = `(今晚|今早|今晨|明晚|明早|明晨|昨晚)(的|在)?`; + ChineseDateTime.DateTimePeriodTillRegex = `(?到|直到|--|-|—|——)`; + ChineseDateTime.DateTimePeriodPrepositionRegex = `(?^\\s*的|在\\s*$)`; + ChineseDateTime.HourRegex = `\\b${baseDateTime.BaseDateTime.HourRegex}`; + ChineseDateTime.HourNumRegex = `(?[零〇一二两三四五六七八九]|二十[一二三四]?|十[一二三四五六七八九]?)`; + ChineseDateTime.ZhijianRegex = `^\\s*(之间|之内|期间|中间|间)`; + ChineseDateTime.DateTimePeriodThisRegex = `这个|这一个|这|这一`; + ChineseDateTime.DateTimePeriodLastRegex = `上个|上一个|上|上一`; + ChineseDateTime.DateTimePeriodNextRegex = `下个|下一个|下|下一`; + ChineseDateTime.AmPmDescRegex = `(?(am|a\\.m\\.|a m|a\\. m\\.|a\\.m|a\\. m|a m|pm|p\\.m\\.|p m|p\\. m\\.|p\\.m|p\\. m|p m))`; + ChineseDateTime.TimeOfDayRegex = `(?凌晨|清晨|早上|早|上午|中午|下午|午后|晚上|夜里|夜晚|半夜|夜间|深夜|傍晚|晚)`; + ChineseDateTime.SpecificTimeOfDayRegex = `(((${ChineseDateTime.DateTimePeriodThisRegex}|${ChineseDateTime.DateTimePeriodNextRegex}|${ChineseDateTime.DateTimePeriodLastRegex})\\s+${ChineseDateTime.TimeOfDayRegex})|(今晚|今早|今晨|明晚|明早|明晨|昨晚))`; + ChineseDateTime.DateTimePeriodUnitRegex = `(个)?(?(小时|分钟|秒钟|时|分|秒))`; + ChineseDateTime.DateTimePeriodFollowedUnit = `^\\s*${ChineseDateTime.DateTimePeriodUnitRegex}`; + ChineseDateTime.DateTimePeriodNumberCombinedWithUnit = `\\b(?\\d+(\\.\\d*)?)${ChineseDateTime.DateTimePeriodUnitRegex}`; + ChineseDateTime.DurationYearRegex = `((\\d{3,4})|0\\d|两千)\\s*年`; + ChineseDateTime.DurationHalfSuffixRegex = `半`; + ChineseDateTime.DurationSuffixList = new Map([["M", "分钟"], ["S", "秒钟|秒"], ["H", "个小时|小时"], ["D", "天"], ["W", "星期|个星期|周"], ["Mon", "个月"], ["Y", "年"]]); + ChineseDateTime.DurationAmbiguousUnits = ['分钟', '秒钟', '秒', '个小时', '小时', '天', '星期', '个星期', '周', '个月', '年']; + ChineseDateTime.LunarHolidayRegex = `((${ChineseDateTime.DatePeriodYearRegex}|${ChineseDateTime.DatePeriodYearInChineseRegex}|(?明年|今年|去年))(的)?)?(?除夕|春节|中秋节|中秋|元宵节|端午节|端午|重阳节)`; + ChineseDateTime.HolidayRegexList1 = `((${ChineseDateTime.DatePeriodYearRegex}|${ChineseDateTime.DatePeriodYearInChineseRegex}|(?明年|今年|去年))(的)?)?(?新年|五一|劳动节|元旦节|元旦|愚人节|圣诞节|植树节|国庆节|情人节|教师节|儿童节|妇女节|青年节|建军节|女生节|光棍节|双十一|清明节|清明)`; + ChineseDateTime.HolidayRegexList2 = `((${ChineseDateTime.DatePeriodYearRegex}|${ChineseDateTime.DatePeriodYearInChineseRegex}|(?明年|今年|去年))(的)?)?(?母亲节|父亲节|感恩节|万圣节)`; + ChineseDateTime.SetUnitRegex = `(?年|月|周|星期|日|天|小时|时|分钟|分|秒钟|秒)`; + ChineseDateTime.SetEachUnitRegex = `(?(每个|每一|每)\\s*${ChineseDateTime.SetUnitRegex})`; + ChineseDateTime.SetEachPrefixRegex = `(?(每)\\s*$)`; + ChineseDateTime.SetLastRegex = `(?last|this|next)`; + ChineseDateTime.SetEachDayRegex = `(每|每一)(天|日)\\s*$`; + ChineseDateTime.TimeHourNumRegex = `(00|01|02|03|04|05|06|07|08|09|0|10|11|12|13|14|15|16|17|18|19|20|21|22|23|24|1|2|3|4|5|6|7|8|9)`; + ChineseDateTime.TimeMinuteNumRegex = `(00|01|02|03|04|05|06|07|08|09|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|0|1|2|3|4|5|6|7|8|9)`; + ChineseDateTime.TimeSecondNumRegex = `(00|01|02|03|04|05|06|07|08|09|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|0|1|2|3|4|5|6|7|8|9)`; + ChineseDateTime.TimeHourChsRegex = `([零〇一二两三四五六七八九]|二十[一二三四]?|十[一二三四五六七八九]?)`; + ChineseDateTime.TimeMinuteChsRegex = `([二三四五]?十[一二三四五六七八九]?|六十|[零〇一二三四五六七八九])`; + ChineseDateTime.TimeSecondChsRegex = `${ChineseDateTime.TimeMinuteChsRegex}`; + ChineseDateTime.TimeClockDescRegex = `(点\\s*整|点\\s*钟|点|时)`; + ChineseDateTime.TimeMinuteDescRegex = `(分钟|分|)`; + ChineseDateTime.TimeSecondDescRegex = `(秒钟|秒)`; + ChineseDateTime.TimeBanHourPrefixRegex = `(第)`; + ChineseDateTime.TimeHourRegex = `(?${ChineseDateTime.TimeHourChsRegex}|${ChineseDateTime.TimeHourNumRegex})${ChineseDateTime.TimeClockDescRegex}`; + ChineseDateTime.TimeMinuteRegex = `(?${ChineseDateTime.TimeMinuteChsRegex}|${ChineseDateTime.TimeMinuteNumRegex})${ChineseDateTime.TimeMinuteDescRegex}`; + ChineseDateTime.TimeSecondRegex = `(?${ChineseDateTime.TimeSecondChsRegex}|${ChineseDateTime.TimeSecondNumRegex})${ChineseDateTime.TimeSecondDescRegex}`; + ChineseDateTime.TimeHalfRegex = `(?过半|半)`; + ChineseDateTime.TimeQuarterRegex = `(?[一两二三四1-4])\\s*(刻钟|刻)`; + ChineseDateTime.TimeChineseTimeRegex = `${ChineseDateTime.TimeHourRegex}(${ChineseDateTime.TimeQuarterRegex}|${ChineseDateTime.TimeHalfRegex}|((过|又)?${ChineseDateTime.TimeMinuteRegex})(${ChineseDateTime.TimeSecondRegex})?)?`; + ChineseDateTime.TimeDigitTimeRegex = `(?${ChineseDateTime.TimeHourNumRegex}):(?${ChineseDateTime.TimeMinuteNumRegex})(:(?${ChineseDateTime.TimeSecondNumRegex}))?`; + ChineseDateTime.TimeDayDescRegex = `(?凌晨|清晨|早上|早|上午|中午|下午|午后|晚上|夜里|夜晚|半夜|午夜|夜间|深夜|傍晚|晚)`; + ChineseDateTime.TimeApproximateDescPreffixRegex = `(大[约概]|差不多|可能|也许|约|不超过|不多[于过]|最[多长少]|少于|[超短长多]过|几乎要|将近|差点|快要|接近|至少|起码|超出|不到)`; + ChineseDateTime.TimeApproximateDescSuffixRegex = `(之前|以前|以后|以後|之后|之後|前|后|後|左右)`; + ChineseDateTime.TimeRegexes1 = `${ChineseDateTime.TimeApproximateDescPreffixRegex}?${ChineseDateTime.TimeDayDescRegex}?${ChineseDateTime.TimeChineseTimeRegex}${ChineseDateTime.TimeApproximateDescSuffixRegex}?`; + ChineseDateTime.TimeRegexes2 = `${ChineseDateTime.TimeApproximateDescPreffixRegex}?${ChineseDateTime.TimeDayDescRegex}?${ChineseDateTime.TimeDigitTimeRegex}${ChineseDateTime.TimeApproximateDescSuffixRegex}?(\\s*${ChineseDateTime.AmPmDescRegex}?)`; + ChineseDateTime.TimeRegexes3 = `差${ChineseDateTime.TimeMinuteRegex}${ChineseDateTime.TimeChineseTimeRegex}`; + ChineseDateTime.TimePeriodTimePeriodConnectWords = `(起|至|到|–|-|—|~|~)`; + ChineseDateTime.TimePeriodLeftChsTimeRegex = `(从)?(?${ChineseDateTime.TimeDayDescRegex}?(${ChineseDateTime.TimeChineseTimeRegex}))`; + ChineseDateTime.TimePeriodRightChsTimeRegex = `${ChineseDateTime.TimePeriodTimePeriodConnectWords}(?${ChineseDateTime.TimeDayDescRegex}?${ChineseDateTime.TimeChineseTimeRegex})(之间)?`; + ChineseDateTime.TimePeriodLeftDigitTimeRegex = `(从)?(?${ChineseDateTime.TimeDayDescRegex}?(${ChineseDateTime.TimeDigitTimeRegex}))`; + ChineseDateTime.TimePeriodRightDigitTimeRegex = `${ChineseDateTime.TimePeriodTimePeriodConnectWords}(?${ChineseDateTime.TimeDayDescRegex}?${ChineseDateTime.TimeDigitTimeRegex})(之间)?`; + ChineseDateTime.TimePeriodShortLeftChsTimeRegex = `(从)?(?${ChineseDateTime.TimeDayDescRegex}?(${ChineseDateTime.TimeHourChsRegex}))`; + ChineseDateTime.TimePeriodShortLeftDigitTimeRegex = `(从)?(?${ChineseDateTime.TimeDayDescRegex}?(${ChineseDateTime.TimeHourNumRegex}))`; + ChineseDateTime.TimePeriodRegexes1 = `(${ChineseDateTime.TimePeriodLeftDigitTimeRegex}${ChineseDateTime.TimePeriodRightDigitTimeRegex}|${ChineseDateTime.TimePeriodLeftChsTimeRegex}${ChineseDateTime.TimePeriodRightChsTimeRegex})`; + ChineseDateTime.TimePeriodRegexes2 = `(${ChineseDateTime.TimePeriodShortLeftDigitTimeRegex}${ChineseDateTime.TimePeriodRightDigitTimeRegex}|${ChineseDateTime.TimePeriodShortLeftChsTimeRegex}${ChineseDateTime.TimePeriodRightChsTimeRegex})`; + ChineseDateTime.ParserConfigurationBefore = `(之前|以前|前)`; + ChineseDateTime.ParserConfigurationAfter = `(之后|之後|以后|以後|后|後)`; + ChineseDateTime.ParserConfigurationUntil = `(直到|直至|截至|截止(到)?)`; + ChineseDateTime.ParserConfigurationSincePrefix = `(自从|自|自打|打)`; + ChineseDateTime.ParserConfigurationSinceSuffix = `(以来|开始)`; + ChineseDateTime.ParserConfigurationLastWeekDayToken = '最后一个'; + ChineseDateTime.ParserConfigurationNextMonthToken = '下一个'; + ChineseDateTime.ParserConfigurationLastMonthToken = '上一个'; + ChineseDateTime.ParserConfigurationDatePrefix = ' '; + ChineseDateTime.ParserConfigurationUnitMap = new Map([["年", "Y"], ["月", "MON"], ["个月", "MON"], ["日", "D"], ["周", "W"], ["天", "D"], ["小时", "H"], ["时", "H"], ["分钟", "M"], ["分", "M"], ["秒钟", "S"], ["秒", "S"], ["星期", "W"]]); + ChineseDateTime.ParserConfigurationUnitValueMap = new Map([["years", 31536000], ["year", 31536000], ["months", 2592000], ["month", 2592000], ["weeks", 604800], ["week", 604800], ["days", 86400], ["day", 86400], ["hours", 3600], ["hour", 3600], ["hrs", 3600], ["hr", 3600], ["h", 3600], ["minutes", 60], ["minute", 60], ["mins", 60], ["min", 60], ["seconds", 1], ["second", 1], ["secs", 1], ["sec", 1]]); + ChineseDateTime.ParserConfigurationSeasonMap = new Map([["春", "SP"], ["夏", "SU"], ["秋", "FA"], ["冬", "WI"]]); + ChineseDateTime.ParserConfigurationSeasonValueMap = new Map([["SP", 3], ["SU", 6], ["FA", 9], ["WI", 12]]); + ChineseDateTime.ParserConfigurationCardinalMap = new Map([["1", 1], ["2", 2], ["3", 3], ["4", 4], ["5", 5], ["一", 1], ["二", 2], ["三", 3], ["四", 4], ["五", 5], ["第一个", 1], ["第二个", 2], ["第三个", 3], ["第四个", 4], ["第五个", 5], ["第一", 1], ["第二", 2], ["第三", 3], ["第四", 4], ["第五", 5]]); + ChineseDateTime.ParserConfigurationDayOfMonth = new Map([["1", 1], ["2", 2], ["3", 3], ["4", 4], ["5", 5], ["6", 6], ["7", 7], ["8", 8], ["9", 9], ["10", 10], ["11", 11], ["12", 12], ["13", 13], ["14", 14], ["15", 15], ["16", 16], ["17", 17], ["18", 18], ["19", 19], ["20", 20], ["21", 21], ["22", 22], ["23", 23], ["24", 24], ["25", 25], ["26", 26], ["27", 27], ["28", 28], ["29", 29], ["30", 30], ["31", 31], ["01", 1], ["02", 2], ["03", 3], ["04", 4], ["05", 5], ["06", 6], ["07", 7], ["08", 8], ["09", 9], ["1日", 1], ["2日", 2], ["3日", 3], ["4日", 4], ["5日", 5], ["6日", 6], ["7日", 7], ["8日", 8], ["9日", 9], ["10日", 10], ["11日", 11], ["12日", 12], ["13日", 13], ["14日", 14], ["15日", 15], ["16日", 16], ["17日", 17], ["18日", 18], ["19日", 19], ["20日", 20], ["21日", 21], ["22日", 22], ["23日", 23], ["24日", 24], ["25日", 25], ["26日", 26], ["27日", 27], ["28日", 28], ["29日", 29], ["30日", 30], ["31日", 31], ["一日", 1], ["十一日", 11], ["二十日", 20], ["十日", 10], ["二十一日", 21], ["三十一日", 31], ["二日", 2], ["三日", 3], ["四日", 4], ["五日", 5], ["六日", 6], ["七日", 7], ["八日", 8], ["九日", 9], ["十二日", 12], ["十三日", 13], ["十四日", 14], ["十五日", 15], ["十六日", 16], ["十七日", 17], ["十八日", 18], ["十九日", 19], ["二十二日", 22], ["二十三日", 23], ["二十四日", 24], ["二十五日", 25], ["二十六日", 26], ["二十七日", 27], ["二十八日", 28], ["二十九日", 29], ["三十日", 30], ["1号", 1], ["2号", 2], ["3号", 3], ["4号", 4], ["5号", 5], ["6号", 6], ["7号", 7], ["8号", 8], ["9号", 9], ["10号", 10], ["11号", 11], ["12号", 12], ["13号", 13], ["14号", 14], ["15号", 15], ["16号", 16], ["17号", 17], ["18号", 18], ["19号", 19], ["20号", 20], ["21号", 21], ["22号", 22], ["23号", 23], ["24号", 24], ["25号", 25], ["26号", 26], ["27号", 27], ["28号", 28], ["29号", 29], ["30号", 30], ["31号", 31], ["一号", 1], ["十一号", 11], ["二十号", 20], ["十号", 10], ["二十一号", 21], ["三十一号", 31], ["二号", 2], ["三号", 3], ["四号", 4], ["五号", 5], ["六号", 6], ["七号", 7], ["八号", 8], ["九号", 9], ["十二号", 12], ["十三号", 13], ["十四号", 14], ["十五号", 15], ["十六号", 16], ["十七号", 17], ["十八号", 18], ["十九号", 19], ["二十二号", 22], ["二十三号", 23], ["二十四号", 24], ["二十五号", 25], ["二十六号", 26], ["二十七号", 27], ["二十八号", 28], ["二十九号", 29], ["三十号", 30], ["初一", 32], ["三十", 30], ["一", 1], ["十一", 11], ["二十", 20], ["十", 10], ["二十一", 21], ["三十一", 31], ["二", 2], ["三", 3], ["四", 4], ["五", 5], ["六", 6], ["七", 7], ["八", 8], ["九", 9], ["十二", 12], ["十三", 13], ["十四", 14], ["十五", 15], ["十六", 16], ["十七", 17], ["十八", 18], ["十九", 19], ["二十二", 22], ["二十三", 23], ["二十四", 24], ["二十五", 25], ["二十六", 26], ["二十七", 27], ["二十八", 28], ["二十九", 29]]); + ChineseDateTime.ParserConfigurationDayOfWeek = new Map([["星期一", 1], ["星期二", 2], ["星期三", 3], ["星期四", 4], ["星期五", 5], ["星期六", 6], ["星期天", 0], ["星期日", 0], ["礼拜一", 1], ["礼拜二", 2], ["礼拜三", 3], ["礼拜四", 4], ["礼拜五", 5], ["礼拜六", 6], ["礼拜天", 0], ["礼拜日", 0], ["周一", 1], ["周二", 2], ["周三", 3], ["周四", 4], ["周五", 5], ["周六", 6], ["周日", 0], ["周天", 0], ["禮拜一", 1], ["禮拜二", 2], ["禮拜三", 3], ["禮拜四", 4], ["禮拜五", 5], ["禮拜六", 6], ["禮拜天", 0], ["禮拜日", 0], ["週一", 1], ["週二", 2], ["週三", 3], ["週四", 4], ["週五", 5], ["週六", 6], ["週日", 0], ["週天", 0]]); + ChineseDateTime.ParserConfigurationMonthOfYear = new Map([["1", 1], ["2", 2], ["3", 3], ["4", 4], ["5", 5], ["6", 6], ["7", 7], ["8", 8], ["9", 9], ["10", 10], ["11", 11], ["12", 12], ["01", 1], ["02", 2], ["03", 3], ["04", 4], ["05", 5], ["06", 6], ["07", 7], ["08", 8], ["09", 9], ["一月", 1], ["二月", 2], ["三月", 3], ["四月", 4], ["五月", 5], ["六月", 6], ["七月", 7], ["八月", 8], ["九月", 9], ["十月", 10], ["十一月", 11], ["十二月", 12], ["1月", 1], ["2月", 2], ["3月", 3], ["4月", 4], ["5月", 5], ["6月", 6], ["7月", 7], ["8月", 8], ["9月", 9], ["10月", 10], ["11月", 11], ["12月", 12], ["01月", 1], ["02月", 2], ["03月", 3], ["04月", 4], ["05月", 5], ["06月", 6], ["07月", 7], ["08月", 8], ["09月", 9], ["正月", 13], ["大年", 13]]); + ChineseDateTime.DateTimeSimpleAmRegex = `(?早|晨)`; + ChineseDateTime.DateTimeSimplePmRegex = `(?晚)`; + ChineseDateTime.DateTimePeriodMORegex = `(凌晨|清晨|早上|早|上午)`; + ChineseDateTime.DateTimePeriodAFRegex = `(中午|下午|午后|傍晚)`; + ChineseDateTime.DateTimePeriodEVRegex = `(晚上|夜里|夜晚|晚)`; + ChineseDateTime.DateTimePeriodNIRegex = `(半夜|夜间|深夜)`; + ChineseDateTime.DurationUnitValueMap = new Map([["Y", 31536000], ["Mon", 2592000], ["W", 604800], ["D", 86400], ["H", 3600], ["M", 60], ["S", 1]]); + ChineseDateTime.HolidayNoFixedTimex = new Map([["父亲节", "-06-WXX-6-3"], ["母亲节", "-05-WXX-7-2"], ["感恩节", "-11-WXX-4-4"]]); + ChineseDateTime.MergedBeforeRegex = `(前|之前)$`; + ChineseDateTime.MergedAfterRegex = `(后|後|之后|之後)$`; + ChineseDateTime.TimeNumberDictionary = new Map([["零", 0], ["一", 1], ["二", 2], ["三", 3], ["四", 4], ["五", 5], ["六", 6], ["七", 7], ["八", 8], ["九", 9], ["〇", 0], ["两", 2], ["十", 10]]); + ChineseDateTime.TimeLowBoundDesc = new Map([["中午", 11], ["下午", 12], ["午后", 12], ["晚上", 18], ["夜里", 18], ["夜晚", 18], ["夜间", 18], ["深夜", 18], ["傍晚", 18], ["晚", 18], ["pm", 12]]); + ChineseDateTime.DefaultLanguageFallback = 'DMY'; +})(ChineseDateTime = exports.ChineseDateTime || (exports.ChineseDateTime = {})); + +}); + +unwrapExports(chineseDateTime); + +var models$6 = createCommonjsModule(function (module, exports) { +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); + +var CompositeEntityType; +(function (CompositeEntityType) { + CompositeEntityType[CompositeEntityType["Age"] = 0] = "Age"; + CompositeEntityType[CompositeEntityType["Currency"] = 1] = "Currency"; + CompositeEntityType[CompositeEntityType["Dimension"] = 2] = "Dimension"; + CompositeEntityType[CompositeEntityType["Temperature"] = 3] = "Temperature"; +})(CompositeEntityType = exports.CompositeEntityType || (exports.CompositeEntityType = {})); +class AbstractNumberWithUnitModel { + constructor(extractorParsersMap) { + this.extractorParsersMap = extractorParsersMap; + } + parse(query) { + query = recognizersText.FormatUtility.preProcess(query, false); + let extractionResults = new Array(); + for (let kv of this.extractorParsersMap.entries()) { + let extractor = kv[0]; + let parser = kv[1]; + let extractResults = extractor.extract(query); + let parseResults = []; + for (let i = 0; i < extractResults.length; i++) { + let r = parser.parse(extractResults[i]); + if (r.value !== null) { + if (r.value instanceof Array) { + for (let j = 0; j < r.value.length; j++) { + parseResults.push(r.value[j]); + } + } + else { + parseResults.push(r); + } + } + } + let modelResults = parseResults.map(o => ({ + start: o.start, + end: o.start + o.length - 1, + resolution: this.getResolution(o.value), + text: o.text, + typeName: this.modelTypeName + })); + modelResults.forEach(result => { + let bAdd = true; + extractionResults.forEach(extractionResult => { + if (extractionResult.start === result.start && extractionResult.end === result.end) { + bAdd = false; + } + }); + if (bAdd) { + extractionResults.push(result); + } + }); + } + return extractionResults; + } + getResolution(data) { + if (typeof data === 'undefined') + return null; + let result = typeof data === "string" + ? { value: data.toString() } + : { value: data.number, unit: data.unit }; + if (data.isoCurrency) { + result['isoCurrency'] = data.isoCurrency; + } + return result; + } +} +exports.AbstractNumberWithUnitModel = AbstractNumberWithUnitModel; +class AgeModel extends AbstractNumberWithUnitModel { + constructor() { + super(...arguments); + this.modelTypeName = "age"; + } +} +exports.AgeModel = AgeModel; +class CurrencyModel extends AbstractNumberWithUnitModel { + constructor() { + super(...arguments); + this.modelTypeName = "currency"; + } +} +exports.CurrencyModel = CurrencyModel; +class DimensionModel extends AbstractNumberWithUnitModel { + constructor() { + super(...arguments); + this.modelTypeName = "dimension"; + } +} +exports.DimensionModel = DimensionModel; +class TemperatureModel extends AbstractNumberWithUnitModel { + constructor() { + super(...arguments); + this.modelTypeName = "temperature"; + } +} +exports.TemperatureModel = TemperatureModel; + +}); + +unwrapExports(models$6); + +var baseUnits = createCommonjsModule(function (module, exports) { +"use strict"; +// ------------------------------------------------------------------------------ +// +// This code was generated by a tool. +// Changes to this file may cause incorrect behavior and will be lost if +// the code is regenerated. +// +// ------------------------------------------------------------------------------ +Object.defineProperty(exports, "__esModule", { value: true }); +var BaseUnits; +(function (BaseUnits) { + BaseUnits.HourRegex = `(?00|01|02|03|04|05|06|07|08|09|0|10|11|12|13|14|15|16|17|18|19|20|21|22|23|24|1|2|3|4|5|6|7|8|9)(h)?`; + BaseUnits.MinuteRegex = `(?00|01|02|03|04|05|06|07|08|09|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|0|1|2|3|4|5|6|7|8|9)(?!\\d)`; + BaseUnits.SecondRegex = `(?00|01|02|03|04|05|06|07|08|09|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|0|1|2|3|4|5|6|7|8|9)`; + BaseUnits.PmNonUnitRegex = `(${BaseUnits.HourRegex}\\s*:\\s*${BaseUnits.MinuteRegex}(\\s*:\\s*${BaseUnits.SecondRegex})?\\s*pm)`; + BaseUnits.AmbiguousTimeTerm = 'pm'; +})(BaseUnits = exports.BaseUnits || (exports.BaseUnits = {})); + +}); + +unwrapExports(baseUnits); + +var constants$4 = createCommonjsModule(function (module, exports) { +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); + +class Constants { +} +Constants.SYS_UNIT = "builtin.unit"; +Constants.SYS_UNIT_DIMENSION = "builtin.unit.dimension"; +Constants.SYS_UNIT_AGE = "builtin.unit.age"; +Constants.SYS_UNIT_AREA = "builtin.unit.area"; +Constants.SYS_UNIT_CURRENCY = "builtin.unit.currency"; +Constants.SYS_UNIT_LENGTH = "builtin.unit.length"; +Constants.SYS_UNIT_SPEED = "builtin.unit.speed"; +Constants.SYS_UNIT_TEMPERATURE = "builtin.unit.temperature"; +Constants.SYS_UNIT_VOLUME = "builtin.unit.volume"; +Constants.SYS_UNIT_WEIGHT = "builtin.unit.weight"; +Constants.SYS_NUM = "builtin.num"; +// For cases like '2:00 pm', both 'pm' and '00 pm' are not dimension +Constants.AMBIGUOUS_TIME_TERM = baseUnits.BaseUnits.AmbiguousTimeTerm; +// For currencies without ISO codes, we use internal values prefixed by '_'. +// These values should never be present in parse output. +Constants.FAKE_ISO_CODE_PREFIX = "_"; +exports.Constants = Constants; + +}); + +unwrapExports(constants$4); + +/** + * lodash (Custom Build) + * Build: `lodash modularize exports="npm" -o ./` + * Copyright jQuery Foundation and other contributors + * Released under MIT license + * Based on Underscore.js 1.8.3 + * Copyright Jeremy Ashkenas, DocumentCloud and Investigative Reporters & Editors + */ + +/** `Object#toString` result references. */ +var symbolTag$3 = '[object Symbol]'; + +/** Used for built-in method references. */ +var objectProto$3 = Object.prototype; + +/** + * Used to resolve the + * [`toStringTag`](http://ecma-international.org/ecma-262/6.0/#sec-object.prototype.tostring) + * of values. + */ +var objectToString$3 = objectProto$3.toString; + +/** + * The base implementation of methods like `_.max` and `_.min` which accepts a + * `comparator` to determine the extremum value. + * + * @private + * @param {Array} array The array to iterate over. + * @param {Function} iteratee The iteratee invoked per iteration. + * @param {Function} comparator The comparator used to compare values. + * @returns {*} Returns the extremum value. + */ +function baseExtremum(array, iteratee, comparator) { + var index = -1, + length = array.length; + + while (++index < length) { + var value = array[index], + current = iteratee(value); + + if (current != null && (computed === undefined + ? (current === current && !isSymbol$3(current)) + : comparator(current, computed) + )) { + var computed = current, + result = value; + } + } + return result; +} + +/** + * The base implementation of `_.gt` which doesn't coerce arguments to numbers. + * + * @private + * @param {*} value The value to compare. + * @param {*} other The other value to compare. + * @returns {boolean} Returns `true` if `value` is greater than `other`, + * else `false`. + */ +function baseGt(value, other) { + return value > other; +} + +/** + * Checks if `value` is object-like. A value is object-like if it's not `null` + * and has a `typeof` result of "object". + * + * @static + * @memberOf _ + * @since 4.0.0 + * @category Lang + * @param {*} value The value to check. + * @returns {boolean} Returns `true` if `value` is object-like, else `false`. + * @example + * + * _.isObjectLike({}); + * // => true + * + * _.isObjectLike([1, 2, 3]); + * // => true + * + * _.isObjectLike(_.noop); + * // => false + * + * _.isObjectLike(null); + * // => false + */ +function isObjectLike$3(value) { + return !!value && typeof value == 'object'; +} + +/** + * Checks if `value` is classified as a `Symbol` primitive or object. + * + * @static + * @memberOf _ + * @since 4.0.0 + * @category Lang + * @param {*} value The value to check. + * @returns {boolean} Returns `true` if `value` is correctly classified, + * else `false`. + * @example + * + * _.isSymbol(Symbol.iterator); + * // => true + * + * _.isSymbol('abc'); + * // => false + */ +function isSymbol$3(value) { + return typeof value == 'symbol' || + (isObjectLike$3(value) && objectToString$3.call(value) == symbolTag$3); +} + +/** + * This method returns the first argument given to it. + * + * @static + * @since 0.1.0 + * @memberOf _ + * @category Util + * @param {*} value Any value. + * @returns {*} Returns `value`. + * @example + * + * var object = { 'user': 'fred' }; + * + * _.identity(object) === object; + * // => true + */ +function identity(value) { + return value; +} + +/** + * Computes the maximum value of `array`. If `array` is empty or falsey, + * `undefined` is returned. + * + * @static + * @since 0.1.0 + * @memberOf _ + * @category Math + * @param {Array} array The array to iterate over. + * @returns {*} Returns the maximum value. + * @example + * + * _.max([4, 2, 8, 6]); + * // => 8 + * + * _.max([]); + * // => undefined + */ +function max(array) { + return (array && array.length) + ? baseExtremum(array, identity, baseGt) + : undefined; +} + +var lodash_max = max; + +var extractors$16 = createCommonjsModule(function (module, exports) { +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); + + + + + +class NumberWithUnitExtractor { + constructor(config) { + this.config = config; + if (this.config.suffixList && this.config.suffixList.size > 0) { + this.suffixRegexes = this.buildRegexFromSet(Array.from(this.config.suffixList.values())); + } + else { + this.suffixRegexes = new Set(); // empty + } + if (this.config.prefixList && this.config.prefixList.size > 0) { + let maxLength = 0; + this.config.prefixList.forEach(preMatch => { + let len = lodash_max(preMatch.split('|').filter(s => s && s.length).map(s => s.length)); + maxLength = maxLength >= len ? maxLength : len; + }); + // 2 is the maxium length of spaces. + this.maxPrefixMatchLen = maxLength + 2; + this.prefixRegexes = this.buildRegexFromSet(Array.from(this.config.prefixList.values())); + } + else { + this.prefixRegexes = new Set(); // empty + } + this.separateRegex = this.buildSeparateRegexFromSet(); + } + extract(source) { + if (!this.preCheckStr(source)) { + return new Array(); + } + let mappingPrefix = new Map(); + let matched = new Array(source.length); + let numbers = this.config.unitNumExtractor.extract(source); + let result = new Array(); + let sourceLen = source.length; + /* Mix prefix and numbers, make up a prefix-number combination */ + if (this.maxPrefixMatchLen !== 0) { + numbers.forEach(num => { + if (num.start === undefined || num.length === undefined) { + return; + } + let maxFindPref = Math.min(this.maxPrefixMatchLen, num.start); + if (maxFindPref === 0) { + return; + } + /* Scan from left to right , find the longest match */ + let leftStr = source.substring(num.start - maxFindPref, num.start - maxFindPref + maxFindPref); + + let lastIndex = leftStr.length; + let bestMatch = null; + this.prefixRegexes.forEach(regex => { + let collection = recognizersText.RegExpUtility.getMatches(regex, leftStr).filter(m => m.length); + if (collection.length === 0) { + return; + } + collection.forEach(match => { + if (leftStr.substring(match.index, lastIndex).trim() === match.value) { + if (bestMatch === null || bestMatch.index >= match.index) { + bestMatch = match; + } + } + }); + }); + if (bestMatch !== null) { + let unitStr = leftStr.substring(bestMatch.index, lastIndex); + mappingPrefix.set(num.start, { + offset: lastIndex - bestMatch.index, + unitString: unitStr + }); + } + }); + } + for (let num of numbers) { + if (num.start === undefined || num.length === undefined) { + continue; + } + let start = num.start; + let length = num.length; + let maxFindLen = sourceLen - start - length; + let prefixUnit = mappingPrefix.has(start) ? mappingPrefix.get(start) : null; + if (maxFindLen > 0) { + let rightSub = source.substring(start + length, start + length + maxFindLen); + let unitMatch = Array.from(this.suffixRegexes.values()).map(r => recognizersText.RegExpUtility.getMatches(r, rightSub)) + .filter(m => m.length > 0); + let maxlen = 0; + for (let i = 0; i < unitMatch.length; i++) { + for (let m of unitMatch[i]) { + if (m.length > 0) { + let endpos = m.index + m.length; + if (m.index >= 0) { + let midStr = rightSub.substring(0, Math.min(m.index, rightSub.length)); + if (maxlen < endpos && (recognizersText.StringUtility.isNullOrWhitespace(midStr) || midStr.trim() === this.config.connectorToken)) { + maxlen = endpos; + } + } + } + } + } + if (maxlen !== 0) { + for (let i = 0; i < length + maxlen; i++) { + matched[i + start] = true; + } + let substr = source.substring(start, start + length + maxlen); + let er = { + start: start, + length: length + maxlen, + text: substr, + type: this.config.extractType + }; + if (prefixUnit !== null) { + er.start -= prefixUnit.offset; + er.length += prefixUnit.offset; + er.text = prefixUnit.unitString + er.text; + } + /* Relative position will be used in Parser */ + num.start = start - er.start; + er.data = num; + let isDimensionFallsInPmTime = false; + if (er.type === constants$4.Constants.SYS_UNIT_DIMENSION) { + let nonUnitMatch = recognizersText.RegExpUtility.getMatches(this.config.pmNonUnitRegex, source); + nonUnitMatch.forEach(match => { + if (er.start >= match.index && er.start + er.length <= match.index + match.length) { + isDimensionFallsInPmTime = true; + } + }); + } + if (isDimensionFallsInPmTime) { + continue; + } + result.push(er); + continue; + } + } + if (prefixUnit !== null) { + let er = { + start: num.start - prefixUnit.offset, + length: num.length + prefixUnit.offset, + text: prefixUnit.unitString + num.text, + type: this.config.extractType + }; + /* Relative position will be used in Parser */ + num.start = start - er.start; + er.data = num; + result.push(er); + } + } + // extract Separate unit + if (this.separateRegex !== null) { + this.extractSeparateUnits(source, result); + } + return result; + } + validateUnit(source) { + return source.substring(0, 1) !== '-'; + } + preCheckStr(str) { + return str && str.length; + } + extractSeparateUnits(source, numDependResults) { + // Default is false + let matchResult = new Array(source.length); + numDependResults.forEach(numDependResult => { + let start = numDependResult.start; + let i = 0; + do { + matchResult[start + i++] = true; + } while (i < numDependResult.length); + }); + // Extract all SeparateUnits, then merge it with numDependResults + let matchCollection = recognizersText.RegExpUtility.getMatches(this.separateRegex, source); + if (matchCollection.length > 0) { + matchCollection.forEach(match => { + let i = 0; + while (i < match.length && !matchResult[match.index + i]) { + i++; + } + if (i === match.length) { + // Mark as extracted + for (let j = 0; j < i; j++) { + matchResult[j] = true; + } + let isDimensionFallsInPmTime = false; + if (match.value === constants$4.Constants.AMBIGUOUS_TIME_TERM) { + let nonUnitMatch = recognizersText.RegExpUtility.getMatches(this.config.pmNonUnitRegex, source); + nonUnitMatch.forEach(time => { + if (this.isDimensionFallsInTime(match, time)) { + isDimensionFallsInPmTime = true; + } + }); + } + if (isDimensionFallsInPmTime === false) { + numDependResults.push({ + start: match.index, + length: match.length, + text: match.value, + type: this.config.extractType, + data: null + }); + } + } + }); + } + } + buildRegexFromSet(collection, ignoreCase = true) { + return new Set(collection.map(regexString => { + let regexTokens = regexString.split('|').map(lodash_escaperegexp); + let pattern = `${this.config.buildPrefix}(${regexTokens.join('|')})${this.config.buildSuffix}`; + let options = "gs"; + if (ignoreCase) + options += "i"; + return recognizersText.RegExpUtility.getSafeRegExp(pattern, options); + })); + } + buildSeparateRegexFromSet(ignoreCase = true) { + let separateWords = new Set(); + if (this.config.prefixList && this.config.prefixList.size) { + for (let addWord of this.config.prefixList.values()) { + addWord.split('|').filter(s => s && s.length) + .filter(this.validateUnit) + .forEach(word => separateWords.add(word)); + } + } + if (this.config.suffixList && this.config.suffixList.size) { + for (let addWord of this.config.suffixList.values()) { + addWord.split('|').filter(s => s && s.length) + .filter(this.validateUnit) + .forEach(word => separateWords.add(word)); + } + } + if (this.config.ambiguousUnitList && this.config.ambiguousUnitList.length) { + for (let abandonWord of this.config.ambiguousUnitList) { + if (separateWords.has(abandonWord)) { + separateWords.delete(abandonWord); + } + } + } + let regexTokens = Array.from(separateWords.values()).map(lodash_escaperegexp); + if (regexTokens.length === 0) { + return null; + } + // Sort SeparateWords using descending length. + regexTokens = regexTokens.sort(this.dinoComparer); + let pattern = `${this.config.buildPrefix}(${regexTokens.join('|')})${this.config.buildSuffix}`; + let options = "gs"; + if (ignoreCase) + options += "i"; + return recognizersText.RegExpUtility.getSafeRegExp(pattern, options); + } + dinoComparer(x, y) { + if (x === null) { + if (y === null) { + // If x is null and y is null, they're + // equal. + return 0; + } + else { + // If x is null and y is not null, y + // is greater. + return 1; + } + } + else { + // If x is not null... + // + if (y === null) + // ...and y is null, x is greater. + { + return -1; + } + else { + // ...and y is not null, compare the + // lengths of the two strings. + // + let retval = y.length - x.length; + if (retval !== 0) { + // If the strings are not of equal length, + // the longer string is greater. + // + return retval; + } + else { + // If the strings are of equal length, + // sort them with ordinary string comparison. + // + let xl = x.toLowerCase(); + let yl = y.toLowerCase(); + if (xl < yl) { + return -1; + } + if (xl > yl) { + return 1; + } + return 0; + } + } + } + } + isDimensionFallsInTime(dimension, time) { + let isSubMatch = false; + if (dimension.index >= time.index && dimension.index + dimension.length <= time.index + time.length) { + isSubMatch = true; + } + return isSubMatch; + } +} +exports.NumberWithUnitExtractor = NumberWithUnitExtractor; +class BaseMergedUnitExtractor { + constructor(config) { + this.config = config; + this.innerExtractor = new NumberWithUnitExtractor(config); + } + extract(source) { + let result = new Array(); + if (this.config.extractType === constants$4.Constants.SYS_UNIT_CURRENCY) { + result = this.mergeCompoundUnits(source); + } + else { + result = this.innerExtractor.extract(source); + } + return result; + } + mergeCompoundUnits(source) { + let result = new Array(); + let ers = this.innerExtractor.extract(source); + this.MergePureNumber(source, ers); + let groups = []; + groups[0] = 0; + for (let i = 0; i < ers.length - 1; i++) { + if (ers[i].type !== ers[i + 1].type && ers[i].type !== recognizersTextNumber.Constants.SYS_NUM && ers[i + 1].type !== recognizersTextNumber.Constants.SYS_NUM) { + continue; + } + if (ers[i].data != null && ers[i].data.data != null && !ers[i].data.data.startsWith('Integer')) { + groups[i + 1] = groups[i] + 1; + continue; + } + let middleBegin = ers[i].start + ers[i].length; + let middleEnd = ers[i + 1].start; + let middleStr = source.substring(middleBegin, middleEnd).trim().toLowerCase(); + // Separated by whitespace + if (recognizersText.StringUtility.isNullOrEmpty(middleStr)) { + groups[i + 1] = groups[i]; + continue; + } + // Separated by connectors + let match = recognizersText.RegExpUtility.getMatches(this.config.compoundUnitConnectorRegex, middleStr).pop(); + if (match && match.index === 0 && match.length === middleStr.length) { + groups[i + 1] = groups[i]; + } + else { + groups[i + 1] = groups[i] + 1; + } + } + for (let i = 0; i < ers.length; i++) { + if (i === 0 || groups[i] !== groups[i - 1]) { + let tmpInner = new recognizersText.ExtractResult(); + tmpInner.data = ers[i].data; + tmpInner.length = ers[i].length; + tmpInner.start = ers[i].start; + tmpInner.text = ers[i].text; + tmpInner.type = ers[i].type; + let tmpExtractResult = ers[i]; + tmpExtractResult.data = new Array(); + tmpExtractResult.data.push(tmpInner); + result.push(tmpExtractResult); + } + // Reduce extract results in same group + if (i + 1 < ers.length && groups[i + 1] === groups[i]) { + let group = groups[i]; + let periodBegin = result[group].start; + let periodEnd = ers[i + 1].start + ers[i + 1].length; + result[group].length = periodEnd - periodBegin; + result[group].text = source.substring(periodBegin, periodEnd); + result[group].type = constants$4.Constants.SYS_UNIT_CURRENCY; + result[group].data.push(ers[i + 1]); + } + } + for (let i = 0; i < result.length; i++) { + let innerData = result[i].data; + if (innerData && innerData.length === 1) { + result[i] = innerData[0]; + } + } + result = result.filter(er => er.type !== recognizersTextNumber.Constants.SYS_NUM); + return result; + } + MergePureNumber(source, result) { + let numErs = this.config.unitNumExtractor.extract(source); + let unitNumbers = new Array(); + let i; + let j; + for (i = 0, j = 0; i < numErs.length; i++) { + let hasBehindExtraction = false; + while (j < result.length && result[j].start + result[j].length < numErs[i].start) { + hasBehindExtraction = true; + j++; + } + if (!hasBehindExtraction) { + continue; + } + let middleBegin = result[j - 1].start + result[j - 1].length; + let middleEnd = numErs[i].start; + let middleStr = source.substring(middleBegin, middleEnd).trim().toLowerCase(); + // Separated by whitespace + if (recognizersText.StringUtility.isNullOrEmpty(middleStr)) { + unitNumbers.push(numErs[i]); + continue; + } + // Separated by connectors + let match = recognizersText.RegExpUtility.getMatches(this.config.compoundUnitConnectorRegex, middleStr).pop(); + if (match && match.index === 0 && match.length === middleStr.length) { + unitNumbers.push(numErs[i]); + } + } + unitNumbers.forEach(extractResult => { + let overlap = false; + result.forEach(er => { + if (er.start <= extractResult.start && er.start + er.length >= extractResult.start) { + overlap = true; + } + }); + if (!overlap) { + result.push(extractResult); + } + }); + result.sort((x, y) => x.start - y.start); + } +} +exports.BaseMergedUnitExtractor = BaseMergedUnitExtractor; +class PrefixUnitResult { +} +exports.PrefixUnitResult = PrefixUnitResult; + +}); + +unwrapExports(extractors$16); + +/** + * lodash 3.0.0 (Custom Build) + * Build: `lodash modern modularize exports="npm" -o ./` + * Copyright 2012-2015 The Dojo Foundation + * Based on Underscore.js 1.7.0 + * Copyright 2009-2015 Jeremy Ashkenas, DocumentCloud and Investigative Reporters & Editors + * Available under MIT license + */ + +/** + * Gets the last element of `array`. + * + * @static + * @memberOf _ + * @category Array + * @param {Array} array The array to query. + * @returns {*} Returns the last element of `array`. + * @example + * + * _.last([1, 2, 3]); + * // => 3 + */ +function last(array) { + var length = array ? array.length : 0; + return length ? array[length - 1] : undefined; +} + +var lodash_last = last; + +var utilities$4 = createCommonjsModule(function (module, exports) { +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); + +class DictionaryUtils { + static bindDictionary(dictionary, source) { + if (dictionary === null) { + return; + } + dictionary.forEach((value, key) => { + if (recognizersText.StringUtility.isNullOrEmpty(key)) { + return; + } + this.bindUnitsString(source, key, value); + }); + } + static bindUnitsString(dictionary, key, source) { + let values = source.trim().split('|'); + values.forEach(token => { + if (recognizersText.StringUtility.isNullOrWhitespace(token) || dictionary.has(token)) { + return; + } + dictionary.set(token, key); + }); + } +} +exports.DictionaryUtils = DictionaryUtils; + +}); + +unwrapExports(utilities$4); + +var baseCurrency = createCommonjsModule(function (module, exports) { +"use strict"; +// ------------------------------------------------------------------------------ +// +// This code was generated by a tool. +// Changes to this file may cause incorrect behavior and will be lost if +// the code is regenerated. +// +// ------------------------------------------------------------------------------ +Object.defineProperty(exports, "__esModule", { value: true }); +var BaseCurrency; +(function (BaseCurrency) { + BaseCurrency.CurrencyFractionMapping = new Map([["CNY", "FEN|JIAO"], ["__D", "CENT"], ["RUB", "KOPEK"], ["AFN", "PUL"], ["EUR", "CENT"], ["ALL", "QINDARKE"], ["_ALP", "PENNY"], ["GBP", "PENNY"], ["_GGP", "PENNY"], ["DZD", "SANTEEM"], ["AOA", "CENTIMO"], ["ARS", "CENTAVO"], ["AMD", "LUMA"], ["AWG", "CENT"], ["_AP", "PENNY"], ["SHP", "PENNY"], ["AUD", "CENT"], ["AZN", "QƏPIK"], ["BSD", "CENT"], ["BHD", "FILS"], ["BDT", "POISHA"], ["BBD", "CENT"], ["BYN", "KAPYEYKA"], ["BZD", "CENT"], ["XOF", "CENTIME"], ["BMD", "CENT"], ["BTN", "CHETRUM"], ["INR", "PAISA"], ["BOB", "CENTAVO"], ["USD", "CENT"], ["BAM", "FENING"], ["BWP", "THEBE"], ["BRL", "CENTAVO"], ["_BD", "CENT"], ["BND", "SEN"], ["SGD", "CENT"], ["BGN", "STOTINKA"], ["BIF", "CENTIME"], ["KHR", "SEN"], ["XAF", "CENTIME"], ["CAD", "CENT"], ["CVE", "CENTAVO"], ["KYD", "CENT"], ["CLP", "CENTAVO"], ["COP", "CENTAVO"], ["KMF", "CENTIME"], ["CDF", "CENTIME"], ["NZD", "CENT"], ["_CKD", "CENT"], ["CRC", "CENTIMO"], ["HRK", "LIPA"], ["CUC", "CENTAVO"], ["CUP", "CENTAVO"], ["CZK", "HALER"], ["DKK", "ØRE"], ["DJF", "CENTIME"], ["DOP", "CENTAVO"], ["EGP", "PIASTRE"], ["ERN", "CENT"], ["ETB", "SANTIM"], ["FKP", "PENNY"], ["_FOK", "OYRA"], ["FJD", "CENT"], ["XPF", "CENTIME"], ["GMD", "BUTUT"], ["GEL", "TETRI"], ["GHS", "PESEWA"], ["GIP", "PENNY"], ["GTQ", "CENTAVO"], ["GNF", "CENTIME"], ["GYD", "CENT"], ["HTG", "CENTIME"], ["HNL", "CENTAVO"], ["HKD", "CENT"], ["HUF", "FILLER"], ["ISK", "EYRIR"], ["IDR", "SEN"], ["IRR", "DINAR"], ["IQD", "FILS"], ["IMP", "PENNY"], ["ILS", "AGORA"], ["JMD", "CENT"], ["JPY", "SEN"], ["JEP", "PENNY"], ["JOD", "PIASTRE"], ["KZT", "TIIN"], ["KES", "CENT"], ["_KID", "CENT"], ["KPW", "CHON"], ["KRW", "JEON"], ["KWD", "FILS"], ["KGS", "TYIYN"], ["LAK", "ATT"], ["LBP", "PIASTRE"], ["LSL", "SENTE"], ["ZAR", "CENT"], ["LRD", "CENT"], ["LYD", "DIRHAM"], ["CHF", "RAPPEN"], ["MOP", "AVO"], ["MKD", "DENI"], ["MGA", "IRAIMBILANJA"], ["MWK", "TAMBALA"], ["MYR", "SEN"], ["MVR", "LAARI"], ["MRO", "KHOUMS"], ["MUR", "CENT"], ["MXN", "CENTAVO"], ["_MD", "CENT"], ["MDL", "BAN"], ["MNT", "MONGO"], ["MAD", "CENTIME"], ["MZN", "CENTAVO"], ["MMK", "PYA"], ["NAD", "CENT"], ["_ND", "CENT"], ["NPR", "PAISA"], ["NIO", "CENTAVO"], ["NGN", "KOBO"], ["_NID", "CENT"], ["TRY", "KURUS"], ["NOK", "ØRE"], ["OMR", "BAISA"], ["PKR", "PAISA"], ["_PD", "CENT"], ["PAB", "CENTESIMO"], ["PGK", "TOEA"], ["PYG", "CENTIMO"], ["PEN", "CENTIMO"], ["_PND", "CENT"], ["PLN", "GROSZ"], ["QAR", "DIRHAM"], ["RON", "BAN"], ["RWF", "CENTIME"], ["WST", "SENE"], ["STD", "CENTIMO"], ["SAR", "HALALA"], ["RSD", "PARA"], ["SCR", "CENT"], ["SLL", "CENT"], ["SBD", "CENT"], ["SOS", "CENT"], ["_SS", "CENT"], ["_SP", "PENNY"], ["SSP", "PIASTRE"], ["LKR", "CENT"], ["SDG", "PIASTRE"], ["SRD", "CENT"], ["SZL", "CENT"], ["SEK", "ORE"], ["SYP", "PIASTRE"], ["TWD", "CENT"], ["TJS", "DIRAM"], ["TZS", "CENT"], ["THB", "SATANG"], ["PRB", "KOPEK"], ["TTD", "CENT"], ["_TP", "PENNY"], ["TND", "MILLIME"], ["TMT", "TENNESI"], ["TVD", "CENT"], ["UGX", "CENT"], ["UAH", "KOPIYKA"], ["AED", "FILS"], ["UYU", "CENTESIMO"], ["VEF", "CENTIMO"], ["YER", "FILS"], ["ZMW", "NGWEE"]]); + BaseCurrency.CurrencyFractionalRatios = new Map([["Kopek", 100], ["Pul", 100], ["Cent", 100], ["Qindarkë", 100], ["Penny", 100], ["Santeem", 100], ["Cêntimo", 100], ["Centavo", 100], ["Luma", 100], ["Qəpik", 100], ["Fils", 1000], ["Poisha", 100], ["Kapyeyka", 100], ["Centime", 100], ["Chetrum", 100], ["Paisa", 100], ["Fening", 100], ["Thebe", 100], ["Sen", 100], ["Stotinka", 100], ["Jiao", 10], ["Fen", 100], ["Céntimo", 100], ["Lipa", 100], ["Haléř", 100], ["Øre", 100], ["Piastre", 100], ["Santim", 100], ["Oyra", 100], ["Butut", 100], ["Tetri", 100], ["Pesewa", 100], ["Fillér", 100], ["Eyrir", 100], ["Dinar", 100], ["Agora", 100], ["Tïın", 100], ["Chon", 100], ["Jeon", 100], ["Tyiyn", 100], ["Att", 100], ["Sente", 100], ["Dirham", 1000], ["Rappen", 100], ["Avo", 100], ["Deni", 100], ["Iraimbilanja", 5], ["Tambala", 100], ["Laari", 100], ["Khoums", 5], ["Ban", 100], ["Möngö", 100], ["Pya", 100], ["Kobo", 100], ["Kuruş", 100], ["Baisa", 1000], ["Centésimo", 100], ["Toea", 100], ["Sentimo", 100], ["Grosz", 100], ["Sene", 100], ["Halala", 100], ["Para", 100], ["Öre", 100], ["Diram", 100], ["Satang", 100], ["Seniti", 100], ["Millime", 1000], ["Tennesi", 100], ["Kopiyka", 100], ["Tiyin", 100], ["Hào", 10], ["Ngwee", 100]]); +})(BaseCurrency = exports.BaseCurrency || (exports.BaseCurrency = {})); + +}); + +unwrapExports(baseCurrency); + +var parsers$8 = createCommonjsModule(function (module, exports) { +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); + + + + + + +class UnitValue { + constructor() { + this.number = ""; + this.unit = ""; + } +} +exports.UnitValue = UnitValue; +class UnitValueIso extends UnitValue { + constructor() { + super(...arguments); + this.isoCurrency = ""; + } +} +exports.UnitValueIso = UnitValueIso; +class BaseNumberWithUnitParserConfiguration { + constructor(cultureInfo) { + this.cultureInfo = cultureInfo; + this.unitMap = new Map(); + this.currencyFractionNumMap = baseCurrency.BaseCurrency.CurrencyFractionalRatios; + this.currencyFractionMapping = baseCurrency.BaseCurrency.CurrencyFractionMapping; + } + BindDictionary(dictionary) { + utilities$4.DictionaryUtils.bindDictionary(dictionary, this.unitMap); + } +} +exports.BaseNumberWithUnitParserConfiguration = BaseNumberWithUnitParserConfiguration; +class NumberWithUnitParser { + constructor(config) { + this.config = config; + } + parse(extResult) { + let ret = new recognizersText.ParseResult(extResult); + let numberResult; + if (extResult.data && typeof extResult.data === "object") { + numberResult = extResult.data; + } + else if (extResult.type === constants$4.Constants.SYS_NUM) { + ret.value = this.config.internalNumberParser.parse(extResult).value; + return ret; + } + else { + // if there is no unitResult, means there is just unit + numberResult = { start: -1, length: 0, text: null, type: null }; + } + // key contains units + let key = extResult.text; + let unitKeyBuild = ''; + let unitKeys = new Array(); + for (let i = 0; i <= key.length; i++) { + if (i === key.length) { + if (unitKeyBuild.length !== 0) { + this.addIfNotContained(unitKeys, unitKeyBuild.trim()); + } + } + // numberResult.start is a relative position + else if (i === numberResult.start) { + if (unitKeyBuild.length !== 0) { + this.addIfNotContained(unitKeys, unitKeyBuild.trim()); + unitKeyBuild = ''; + } + let o = numberResult.start + numberResult.length - 1; + if (o !== null && !isNaN(o)) { + i = o; + } + } + else { + unitKeyBuild += key[i]; + } + } + /* Unit type depends on last unit in suffix.*/ + let lastUnit = lodash_last(unitKeys); + let normalizedLastUnit = lastUnit.toLowerCase(); + if (this.config.connectorToken && this.config.connectorToken.length && normalizedLastUnit.indexOf(this.config.connectorToken) === 0) { + normalizedLastUnit = normalizedLastUnit.substring(this.config.connectorToken.length).trim(); + lastUnit = lastUnit.substring(this.config.connectorToken.length).trim(); + } + if (key && key.length && (this.config.unitMap !== null)) { + let unitValue = null; + if (this.config.unitMap.has(lastUnit)) { + unitValue = this.config.unitMap.get(lastUnit); + } + else if (this.config.unitMap.has(normalizedLastUnit)) { + unitValue = this.config.unitMap.get(normalizedLastUnit); + } + if (unitValue) { + let numValue = numberResult.text && numberResult.text.length ? this.config.internalNumberParser.parse(numberResult) : null; + let resolutionStr = numValue ? numValue.resolutionStr : null; + ret.value = { number: resolutionStr, unit: unitValue }; + ret.resolutionStr = (`${resolutionStr} ${unitValue}`).trim(); + } + } + return ret; + } + addIfNotContained(keys, newKey) { + if (!keys.some(key => key.includes(newKey))) { + keys.push(newKey); + } + } +} +exports.NumberWithUnitParser = NumberWithUnitParser; +class BaseCurrencyParser { + constructor(config) { + this.config = config; + this.numberWithUnitParser = new NumberWithUnitParser(config); + } + parse(extResult) { + let result = null; + if (extResult.data instanceof Array) { + result = this.mergeCompoundUnit(extResult); + } + else { + result = this.numberWithUnitParser.parse(extResult); + let value = result.value; + if (!this.config.currencyNameToIsoCodeMap.has(value.unit) || this.config.currencyNameToIsoCodeMap.get(value.unit).startsWith(constants$4.Constants.FAKE_ISO_CODE_PREFIX)) { + result.value = { + unit: value.unit, + number: value.number + }; + } + else { + result.value = { + unit: value.unit, + number: value.number, + isoCurrency: this.config.currencyNameToIsoCodeMap.get(value.unit) + }; + } + } + return result; + } + mergeCompoundUnit(compoundResult) { + let results = []; + let compoundUnit = compoundResult.data; + let count = 0; + let result = null; + let numberValue = 0.0; + let mainUnitValue = ''; + let mainUnitIsoCode = ''; + let fractionUnitsString = ''; + for (let i = 0; i < compoundUnit.length; i++) { + let extractResult = compoundUnit[i]; + let parseResult = this.numberWithUnitParser.parse(extractResult); + let parseResultValue = parseResult.value; + let unitValue = parseResultValue != null ? parseResultValue.unit : null; + // Process a new group + if (count === 0) { + if (extractResult.type !== constants$4.Constants.SYS_UNIT_CURRENCY) { + continue; + } + // Initialize a new result + result = new recognizersText.ParseResult(extractResult); + mainUnitValue = unitValue; + numberValue = parseFloat(parseResultValue.number); + result.resolutionStr = parseResult.resolutionStr; + if (this.config.currencyNameToIsoCodeMap.has(unitValue)) { + mainUnitIsoCode = this.config.currencyNameToIsoCodeMap.get(unitValue); + } + // If the main unit can't be recognized, finish process this group. + if (recognizersText.StringUtility.isNullOrEmpty(mainUnitIsoCode)) { + result.value = { + number: numberValue.toString(), + unit: mainUnitValue + }; + results.push(result); + result = null; + continue; + } + if (this.config.currencyFractionMapping.has(mainUnitIsoCode)) { + fractionUnitsString = this.config.currencyFractionMapping.get(mainUnitIsoCode); + } + } + else { + // Match pure number as fraction unit. + if (extractResult.type === recognizersTextNumber.Constants.SYS_NUM) { + numberValue += parseResult.value * (1.0 / 100); + result.resolutionStr += ' ' + parseResult.resolutionStr; + result.length = parseResult.start + parseResult.length - result.start; + count++; + continue; + } + let fractionUnitCode; + let fractionNumValue; + if (this.config.currencyFractionCodeList.has(unitValue)) { + fractionUnitCode = this.config.currencyFractionCodeList.get(unitValue); + } + if (this.config.currencyFractionNumMap.has(unitValue)) { + fractionNumValue = this.config.currencyFractionNumMap.get(unitValue); + } + if (fractionUnitCode && fractionNumValue !== 0 && this.checkUnitsStringContains(fractionUnitCode, fractionUnitsString)) { + numberValue += parseFloat(parseResultValue.number) * (1.0 / fractionNumValue); + result.resolutionStr += ' ' + parseResult.resolutionStr; + result.length = parseResult.start + parseResult.length - result.start; + } + else { + // If the fraction unit doesn't match the main unit, finish process this group. + if (result !== null) { + if (recognizersText.StringUtility.isNullOrEmpty(mainUnitIsoCode) || mainUnitIsoCode.startsWith(constants$4.Constants.FAKE_ISO_CODE_PREFIX)) { + result.value = { + number: numberValue.toString(), + unit: mainUnitValue + }; + } + else { + result.value = { + number: numberValue.toString(), + unit: mainUnitValue, + isoCurrency: mainUnitIsoCode + }; + } + results.push(result); + result = null; + } + count = 0; + i -= 1; + continue; + } + } + count++; + } + if (result !== null) { + if (recognizersText.StringUtility.isNullOrEmpty(mainUnitIsoCode) || mainUnitIsoCode.startsWith(constants$4.Constants.FAKE_ISO_CODE_PREFIX)) { + result.value = { + number: numberValue.toString(), + unit: mainUnitValue + }; + } + else { + result.value = { + number: numberValue.toString(), + unit: mainUnitValue, + isoCurrency: mainUnitIsoCode + }; + } + results.push(result); + } + this.resolveText(results, compoundResult.text, compoundResult.start); + return { value: results }; + } + checkUnitsStringContains(fractionUnitCode, fractionUnitsString) { + let unitsMap = new Map(); + utilities$4.DictionaryUtils.bindUnitsString(unitsMap, '', fractionUnitsString); + return unitsMap.has(fractionUnitCode); + } + resolveText(prs, source, bias) { + prs.forEach(parseResult => { + if (parseResult.start !== null && parseResult.length !== null) { + parseResult.text = source.substr(parseResult.start - bias, parseResult.length); + } + }); + } +} +exports.BaseCurrencyParser = BaseCurrencyParser; +class BaseMergedUnitParser { + constructor(config) { + this.config = config; + this.numberWithUnitParser = new NumberWithUnitParser(config); + this.currencyParser = new BaseCurrencyParser(config); + } + parse(extResult) { + let result; + if (extResult.type === constants$4.Constants.SYS_UNIT_CURRENCY) { + result = this.currencyParser.parse(extResult); + } + else { + result = this.numberWithUnitParser.parse(extResult); + } + return result; + } +} +exports.BaseMergedUnitParser = BaseMergedUnitParser; + +}); + +unwrapExports(parsers$8); + +var englishNumericWithUnit = createCommonjsModule(function (module, exports) { +"use strict"; +// ------------------------------------------------------------------------------ +// +// This code was generated by a tool. +// Changes to this file may cause incorrect behavior and will be lost if +// the code is regenerated. +// +// ------------------------------------------------------------------------------ +Object.defineProperty(exports, "__esModule", { value: true }); +var EnglishNumericWithUnit; +(function (EnglishNumericWithUnit) { + EnglishNumericWithUnit.AgeSuffixList = new Map([["Year", "years old|year old|year-old|years-old|-year-old|-years-old|years of age|year of age"], ["Month", "months old|month old|month-old|months-old|-month-old|-months-old|month of age|months of age"], ["Week", "weeks old|week old|week-old|weeks-old|-week-old|-weeks-old|week of age|weeks of age"], ["Day", "days old|day old|day-old|days-old|-day-old|-days-old|day of age|days of age"]]); + EnglishNumericWithUnit.AreaSuffixList = new Map([["Square kilometer", "sq km|sq kilometer|sq kilometre|sq kilometers|sq kilometres|square kilometer|square kilometre|square kilometers|square kilometres|km2|km^2|km²"], ["Square hectometer", "sq hm|sq hectometer|sq hectometre|sq hectometers|sq hectometres|square hectometer|square hectometre|square hectometers|square hectometres|hm2|hm^2|hm²|hectare|hectares"], ["Square decameter", "sq dam|sq decameter|sq decametre|sq decameters|sq decametres|square decameter|square decametre|square decameters|square decametres|sq dekameter|sq dekametre|sq dekameters|sq dekametres|square dekameter|square dekametre|square dekameters|square dekametres|dam2|dam^2|dam²"], ["Square meter", "sq m|sq meter|sq metre|sq meters|sq metres|sq metre|square meter|square meters|square metre|square metres|m2|m^2|m²"], ["Square decimeter", "sq dm|sq decimeter|sq decimetre|sq decimeters|sq decimetres|square decimeter|square decimetre|square decimeters|square decimetres|dm2|dm^2|dm²"], ["Square centimeter", "sq cm|sq centimeter|sq centimetre|sq centimeters|sq centimetres|square centimeter|square centimetre|square centimeters|square centimetres|cm2|cm^2|cm²"], ["Square millimeter", "sq mm|sq millimeter|sq millimetre|sq millimeters|sq millimetres|square millimeter|square millimetre|square millimeters|square millimetres|mm2|mm^2|mm²"], ["Square inch", "sq in|sq inch|square inch|square inches|in2|in^2|in²"], ["Square foot", "sqft|sq ft|sq foot|sq feet|square foot|square feet|feet2|feet^2|feet²|ft2|ft^2|ft²"], ["Square mile", "sq mi|sq mile|sqmiles|square mile|square miles|mi2|mi^2|mi²"], ["Square yard", "sq yd|sq yard|sq yards|square yard|square yards|yd2|yd^2|yd²"], ["Acre", "-acre|acre|acres"]]); + EnglishNumericWithUnit.CurrencySuffixList = new Map([["Abkhazian apsar", "abkhazian apsar|apsars"], ["Afghan afghani", "afghan afghani|؋|afn|afghanis|afghani"], ["Pul", "pul"], ["Euro", "euros|euro|€|eur"], ["Cent", "cents|cent|-cents|-cent|sen"], ["Albanian lek", "albanian lek|leks|lek"], ["Qindarkë", "qindarkë|qindarkës|qindarke|qindarkes"], ["Angolan kwanza", "angolan kwanza|kz|aoa|kwanza|kwanzas|angolan kwanzas"], ["Armenian dram", "armenian drams|armenian dram"], ["Aruban florin", "aruban florin|ƒ|awg|aruban florins"], ["Bangladeshi taka", "bangladeshi taka|৳|bdt|taka|takas|bangladeshi takas"], ["Paisa", "poisha|paisa"], ["Bhutanese ngultrum", "Bhutanese ngultrum|nu.|btn"], ["Chetrum", "chetrums|chetrum"], ["Bolivian boliviano", "bolivian boliviano|bob|bs.|bolivia boliviano|bolivia bolivianos|bolivian bolivianos"], ["Bosnia and Herzegovina convertible mark", "bosnia and herzegovina convertible mark|bam"], ["Fening", "fenings|fenings"], ["Botswana pula", "botswana pula|bwp|pula|pulas|botswana pulas"], ["Thebe", "thebe"], ["Brazilian real", "brazilian real|r$|brl|brazil real|brazil reals|brazilian reals"], ["Bulgarian lev", "bulgarian lev|bgn|лв|bulgaria lev|bulgaria levs|bulgarian levs"], ["Stotinka", "stotinki|stotinka"], ["Cambodian riel", "cambodian riel|khr|៛|cambodia riel|cambodia riels|cambodian riels"], ["Cape Verdean escudo", "cape verdean escudo|cve"], ["Costa Rican colón", "costa rican colón|costa rican colóns|crc|₡|costa rica colón|costa rica colóns|costa rican colon|costa rican colons|costa rica colon|costa rica colons"], ["Salvadoran colón", "svc|salvadoran colón|salvadoran colóns|salvador colón|salvador colóns|salvadoran colon|salvadoran colons|salvador colon|salvador colons"], ["Céntimo", "céntimo"], ["Croatian kuna", "croatian kuna|kn|hrk|croatia kuna|croatian kunas|croatian kuna kunas"], ["Lipa", "lipa"], ["Czech koruna", "czech koruna|czk|Kč|czech korunas"], ["Haléř", "haléř"], ["Eritrean nakfa", "eritrean nakfa|nfk|ern|eritrean nakfas"], ["Ethiopian birr", "ethiopian birr|etb"], ["Gambian dalasi", "gmd"], ["Butut", "bututs|butut"], ["Georgian lari", "Georgian lari|lari|gel|₾"], ["Tetri", "tetri"], ["Ghanaian cedi", "Ghanaian cedi|ghs|₵|gh₵"], ["Pesewa", "pesewas|pesewa"], ["Guatemalan quetzal", "guatemalan quetzal|gtq|guatemala quetzal"], ["Haitian gourde", "haitian gourde|htg"], ["Honduran lempira", "honduran lempira|hnl"], ["Hungarian forint", "hungarian forint|huf|ft|hungary forint|hungary forints|hungarian forints"], ["Fillér", "fillér"], ["Iranian rial", "iranian rial|irr|iran rial|iran rials|iranian rials"], ["Yemeni rial", "yemeni rial|yer|yemeni rials"], ["Israeli new shekel", "₪|ils|agora"], ["Lithuanian litas", "ltl|lithuanian litas|lithuan litas|lithuanian lit|lithuan lit"], ["Japanese yen", "japanese yen|jpy|yen|-yen|¥|yens|japanese yens|japan yen|japan yens"], ["Kazakhstani tenge", "Kazakhstani tenge|kzt"], ["Kenyan shilling", "kenyan shilling|sh|kes"], ["North Korean won", "north korean won|kpw|north korean wons"], ["South Korean won", "south korean won|krw|south korean wons"], ["Korean won", "korean won|₩|korean wons"], ["Kyrgyzstani som", "kyrgyzstani som|kgs"], ["Uzbekitan som", "uzbekitan som|uzs"], ["Lao kip", "lao kip|lak|₭n|₭"], ["Att", "att"], ["Lesotho loti", "lesotho loti|lsl|loti"], ["Sente", "sente|lisente"], ["South African rand", "south african rand|zar|south africa rand|south africa rands|south african rands"], ["Macanese pataca", "macanese pataca|mop$|mop"], ["Avo", "avos|avo"], ["Macedonian denar", "macedonian denar|mkd|ден"], ["Deni", "deni"], ["Malagasy ariary", "malagasy ariary|mga"], ["Iraimbilanja", "iraimbilanja"], ["Malawian kwacha", "malawian kwacha|mk|mwk"], ["Tambala", "tambala"], ["Malaysian ringgit", "malaysian ringgit|rm|myr|malaysia ringgit|malaysia ringgits|malaysian ringgits"], ["Mauritanian ouguiya", "mauritanian ouguiya|um|mro|mauritania ouguiya|mauritania ouguiyas|mauritanian ouguiyas"], ["Khoums", "khoums"], ["Mongolian tögrög", "mongolian tögrög|mnt|₮|mongolia tögrög|mongolia tögrögs|mongolian tögrögs|mongolian togrog|mongolian togrogs|mongolia togrog|mongolia togrogs"], ["Mozambican metical", "mozambican metical|mt|mzn|mozambica metical|mozambica meticals|mozambican meticals"], ["Burmese kyat", "Burmese kyat|ks|mmk"], ["Pya", "pya"], ["Nicaraguan córdoba", "nicaraguan córdoba|nio"], ["Nigerian naira", "nigerian naira|naira|ngn|₦|nigeria naira|nigeria nairas|nigerian nairas"], ["Kobo", "kobo"], ["Turkish lira", "turkish lira|try|tl|turkey lira|turkey liras|turkish liras"], ["Kuruş", "kuruş"], ["Omani rial", "omani rial|omr|ر.ع."], ["Panamanian balboa", "panamanian balboa|b/.|pab"], ["Centesimo", "centesimo|céntimo"], ["Papua New Guinean kina", "papua new guinean kina|kina|pgk"], ["Toea", "toea"], ["Paraguayan guaraní", "paraguayan guaraní|₲|pyg"], ["Peruvian sol", "peruvian sol|soles|sol|peruvian nuevo sol"], ["Polish złoty", "złoty|polish złoty|zł|pln|zloty|polish zloty|poland zloty|poland złoty"], ["Grosz", "groszy|grosz|grosze"], ["Qatari riyal", "qatari riyal|qar|qatari riyals|qatar riyal|qatar riyals"], ["Saudi riyal", "saudi riyal|sar|saudi riyals"], ["Riyal", "riyal|riyals|rial|﷼"], ["Dirham", "dirham|dirhem|dirhm"], ["Halala", "halalas|halala"], ["Samoan tālā", "samoan tālā|tālā|tala|ws$|samoa|wst|samoan tala"], ["Sene", "sene"], ["São Tomé and Príncipe dobra", "são tomé and príncipe dobra|dobras|dobra|std"], ["Sierra Leonean leone", "sierra Leonean leone|sll|leone|le"], ["Peseta", "pesetas|peseta"], ["Netherlands guilder", "florin|netherlands antillean guilder|ang|ƒ|nederlandse gulden|guilders|guilder|gulden|-guilders|-guilder|dutch guilders|dutch guilder|fl"], ["Swazi lilangeni", "swazi lilangeni|lilangeni|szl|emalangeni"], ["Tajikistani somoni", "tajikistani somoni|tjs|somoni"], ["Diram", "dirams|diram"], ["Thai baht", "thai baht|฿|thb|baht"], ["Satang", "satang|satangs"], ["Tongan paʻanga", "tongan paʻanga|paʻanga|tongan pa'anga|pa'anga"], ["Seniti", "seniti"], ["Ukrainian hryvnia", "ukrainian hryvnia|hyrvnia|uah|₴|ukrain hryvnia|ukrain hryvnias|ukrainian hryvnias"], ["Vanuatu vatu", "vanuatu vatu|vatu|vuv"], ["Venezuelan bolívar", "venezuelan bolívar|venezuelan bolívars|bs.f.|vef|bolívar fuerte|venezuelan bolivar|venezuelan bolivars|venezuela bolivar|venezuela bolivarsvenezuelan bolivar|venezuelan bolivars"], ["Vietnamese dong", "vietnamese dong|vnd|đồng|vietnam dong|vietnamese dongs|vietnam dongs"], ["Zambian kwacha", "zambian kwacha|zk|zmw|zambia kwacha|kwachas|zambian kwachas"], ["Moroccan dirham", "moroccan dirham|mad|د.م."], ["United Arab Emirates dirham", "united arab emirates dirham|د.إ|aed"], ["Azerbaijani manat", "azerbaijani manat|azn"], ["Turkmenistan manat", "turkmenistan manat|turkmenistan new manat|tmt"], ["Manat", "manats|manat"], ["Qəpik", "qəpik"], ["Somali shilling", "somali shillings|somali shilling|shilin soomaali|-shilin soomaali|scellino|shilin|sh.so.|sos"], ["Somaliland shilling", "somaliland shillings|somaliland shilling|soomaaliland shilin"], ["Tanzanian shilling", "tanzanian shilling|tanzanian shillings|tsh|tzs|tanzania shilling|tanzania shillings"], ["Ugandan shilling", "ugandan shilling|ugandan shillings|sh|ugx|uganda shilling|uganda shillings"], ["Romanian leu", "romanian leu|lei|ron|romania leu"], ["Moldovan leu", "moldovan leu|mdl|moldova leu"], ["Leu", "leu"], ["Ban", "bani|-ban|ban"], ["Nepalese rupee", "nepalese rupee|npr"], ["Pakistani rupee", "pakistani rupee|pkr"], ["Indian rupee", "indian rupee|inr|₹|india rupee"], ["Seychellois rupee", "seychellois rupee|scr|sr|sre"], ["Mauritian rupee", "mauritian rupee|mur"], ["Maldivian rufiyaa", "maldivian rufiyaa|rf|mvr|.ރ|maldive rufiyaa"], ["Sri Lankan rupee", "sri Lankan rupee|lkr|රු|ரூ"], ["Indonesian rupiah", "Indonesian rupiah|rupiah|perak|rp|idr"], ["Rupee", "rupee|rs"], ["Danish krone", "danish krone|dkk|denmark krone|denmark krones|danish krones"], ["Norwegian krone", "norwegian krone|nok|norway krone|norway krones|norwegian krones"], ["Faroese króna", "faroese króna|faroese krona"], ["Icelandic króna", "icelandic króna|isk|icelandic krona|iceland króna|iceland krona"], ["Swedish krona", "swedish krona|sek|swedan krona"], ["Krone", "kronor|krona|króna|krone|krones|kr|-kr"], ["Øre", "Øre|oyra|eyrir"], ["West African CFA franc", "west african cfa franc|xof|west africa cfa franc|west africa franc|west african franc"], ["Central African CFA franc", "central african cfa franc|xaf|central africa cfa franc|central african franc|central africa franc"], ["Comorian franc", "comorian franc|kmf"], ["Congolese franc", "congolese franc|cdf"], ["Burundian franc", "burundian franc|bif"], ["Djiboutian franc", "djiboutian franc|djf"], ["CFP franc", "cfp franc|xpf"], ["Guinean franc", "guinean franc|gnf"], ["Swiss franc", "swiss francs|swiss franc|chf|sfr."], ["Rwandan franc", "Rwandan franc|rwf|rf|r₣|frw"], ["Belgian franc", "belgian franc|bi.|b.fr.|bef|belgium franc"], ["Rappen", "rappen|-rappen"], ["Franc", "francs|franc|fr.|fs"], ["Centime", "centimes|centime|santim"], ["Russian ruble", "russian ruble|₽|rub|russia ruble|russia ₽|russian ₽|russian rubles|russia rubles"], ["New Belarusian ruble", "new belarusian ruble|byn|new belarus ruble|new belarus rubles|new belarusian rubles"], ["Old Belarusian ruble", "old belarusian ruble|byr|old belarus ruble|old belarus rubles|old belarusian rubles"], ["Transnistrian ruble", "transnistrian ruble|prb|р."], ["Belarusian ruble", "belarusian ruble|belarus ruble|belarus rubles|belarusian rubles"], ["Kopek", "kopek|kopeks"], ["Kapyeyka", "kapyeyka"], ["Ruble", "rubles|ruble|br"], ["Algerian dinar", "algerian dinar|د.ج|dzd|algerian dinars|algeria dinar|algeria dinars"], ["Bahraini dinar", "bahraini dinars|bahraini dinar|bhd|.د.ب"], ["Santeem", "santeem|santeems"], ["Iraqi dinar", "iraqi dinars|iraqi dinar|iraq dinars|iraq dinar|iqd|ع.د"], ["Jordanian dinar", "jordanian dinars|jordanian dinar|د.ا|jod|jordan dinar|jordan dinars"], ["Kuwaiti dinar", "kuwaiti dinars|kuwaiti dinar|kwd|د.ك"], ["Libyan dinar", "libyan dinars|libyan dinar|libya dinars|libya dinar|lyd"], ["Serbian dinar", "serbian dinars|serbian dinar|din.|rsd|дин.|serbia dinars|serbia dinar"], ["Tunisian dinar", "tunisian dinars|tunisian dinar|tnd|tunisia dinars|tunisia dinar"], ["Yugoslav dinar", "yugoslav dinars|yugoslav dinar|yun"], ["Dinar", "dinars|dinar|denar|-dinars|-dinar"], ["Fils", "fils|fulūs|-fils|-fil"], ["Para", "para|napa"], ["Millime", "millimes|millime"], ["Argentine peso", "argentine peso|ars|argetina peso|argetina pesos|argentine pesos"], ["Chilean peso", "chilean pesos|chilean peso|clp|chile peso|chile peso"], ["Colombian peso", "colombian pesos|colombian peso|cop|colombia peso|colombia pesos"], ["Cuban convertible peso", "cuban convertible pesos|cuban convertible peso|cuc|cuba convertible pesos|cuba convertible peso"], ["Cuban peso", "cuban pesos|cuban peso|cup|cuba pesos|cuba peso"], ["Dominican peso", "dominican pesos|dominican peso|dop|dominica pesos|dominica peso"], ["Mexican peso", "mexican pesos|mexican peso|mxn|mexico pesos|mexico peso"], ["Philippine peso", "piso|philippine pesos|philippine peso|₱|php"], ["Uruguayan peso", "uruguayan pesos|uruguayan peso|uyu"], ["Peso", "pesos|peso"], ["Centavo", "centavos|centavo"], ["Alderney pound", "alderney pounds|alderney pound|alderney £"], ["British pound", "british pounds|british pound|british £|gbp|pound sterling|pound sterlings|sterling|pound scot|pound scots"], ["Guernsey pound", "guernsey pounds|guernsey £|ggp"], ["Ascension pound", "ascension pounds|ascension pound|ascension £"], ["Saint Helena pound", "saint helena pounds|saint helena pound|saint helena £|shp"], ["Egyptian pound", "egyptian pounds|egyptian pound|egyptian £|egp|ج.م|egypt pounds|egypt pound"], ["Falkland Islands pound", "falkland islands pounds|falkland islands pound|falkland islands £|fkp|falkland island pounds|falkland island pound|falkland island £"], ["Gibraltar pound", "gibraltar pounds|gibraltar pound|gibraltar £|gip"], ["Manx pound", "manx pounds|manx pound|manx £|imp"], ["Jersey pound", "jersey pounds|jersey pound|jersey £|jep"], ["Lebanese pound", "lebanese pounds|lebanese pound|lebanese £|lebanan pounds|lebanan pound|lebanan £|lbp|ل.ل"], ["South Georgia and the South Sandwich Islands pound", "south georgia and the south sandwich islands pounds|south georgia and the south sandwich islands pound|south georgia and the south sandwich islands £"], ["South Sudanese pound", "south sudanese pounds|south sudanese pound|south sudanese £|ssp|south sudan pounds|south sudan pound|south sudan £"], ["Sudanese pound", "sudanese pounds|sudanese pound|sudanese £|ج.س.|sdg|sudan pounds|sudan pound|sudan £"], ["Syrian pound", "syrian pounds|syrian pound|syrian £|ل.س|syp|syria pounds|syria pound|syria £"], ["Tristan da Cunha pound", "tristan da cunha pounds|tristan da cunha pound|tristan da cunha £"], ["Pound", "pounds|pound|-pounds|-pound|£"], ["Pence", "pence"], ["Shilling", "shillings|shilling|shilingi"], ["Penny", "pennies|penny"], ["United States dollar", "united states dollars|united states dollar|united states $|u.s. dollars|u.s. dollar|u s dollar|u s dollars|usd|american dollars|american dollar|us$|us dollar|us dollars|u.s dollar|u.s dollars"], ["East Caribbean dollar", "east caribbean dollars|east caribbean dollar|east Caribbean $|xcd"], ["Australian dollar", "australian dollars|australian dollar|australian $|australian$|aud|australia dollars|australia dollar|australia $|australia$"], ["Bahamian dollar", "bahamian dollars|bahamian dollar|bahamian $|bahamian$|bsd|bahamia dollars|bahamia dollar|bahamia $|bahamia$"], ["Barbadian dollar", "barbadian dollars|barbadian dollar|barbadian $|bbd"], ["Belize dollar", "belize dollars|belize dollar|belize $|bzd"], ["Bermudian dollar", "bermudian dollars|bermudian dollar|bermudian $|bmd|bermudia dollars|bermudia dollar|bermudia $"], ["British Virgin Islands dollar", "british virgin islands dollars|british virgin islands dollar|british virgin islands $|bvi$|virgin islands dollars|virgin islands dolalr|virgin islands $|virgin island dollars|virgin island dollar|virgin island $"], ["Brunei dollar", "brunei dollar|brunei $|bnd"], ["Sen", "sen"], ["Singapore dollar", "singapore dollars|singapore dollar|singapore $|s$|sgd"], ["Canadian dollar", "canadian dollars|canadian dollar|canadian $|cad|can$|c$|canada dollars|canada dolllar|canada $"], ["Cayman Islands dollar", "cayman islands dollars|cayman islands dollar|cayman islands $|kyd|ci$|cayman island dollar|cayman island doolars|cayman island $"], ["New Zealand dollar", "new zealand dollars|new zealand dollar|new zealand $|nz$|nzd|kiwi"], ["Cook Islands dollar", "cook islands dollars|cook islands dollar|cook islands $|cook island dollars|cook island dollar|cook island $"], ["Fijian dollar", "fijian dollars|fijian dollar|fijian $|fjd|fiji dollars|fiji dollar|fiji $"], ["Guyanese dollar", "guyanese dollars|guyanese dollar|gyd|gy$"], ["Hong Kong dollar", "hong kong dollars|hong kong dollar|hong kong $|hk$|hkd|hk dollars|hk dollar|hk $|hongkong$"], ["Jamaican dollar", "jamaican dollars|jamaican dollar|jamaican $|j$|jamaica dollars|jamaica dollar|jamaica $|jmd"], ["Kiribati dollar", "kiribati dollars|kiribati dollar|kiribati $"], ["Liberian dollar", "liberian dollars|liberian dollar|liberian $|liberia dollars|liberia dollar|liberia $|lrd"], ["Micronesian dollar", "micronesian dollars|micronesian dollar|micronesian $"], ["Namibian dollar", "namibian dollars|namibian dollar|namibian $|nad|n$|namibia dollars|namibia dollar|namibia $"], ["Nauruan dollar", "nauruan dollars|nauruan dollar|nauruan $"], ["Niue dollar", "niue dollars|niue dollar|niue $"], ["Palauan dollar", "palauan dollars|palauan dollar|palauan $"], ["Pitcairn Islands dollar", "pitcairn islands dollars|pitcairn islands dollar|pitcairn islands $|pitcairn island dollars|pitcairn island dollar|pitcairn island $"], ["Solomon Islands dollar", "solomon islands dollars|solomon islands dollar|solomon islands $|si$|sbd|solomon island dollars|solomon island dollar|solomon island $"], ["Surinamese dollar", "surinamese dollars|surinamese dollar|surinamese $|srd"], ["New Taiwan dollar", "new taiwan dollars|new taiwan dollar|nt$|twd|ntd"], ["Trinidad and Tobago dollar", "trinidad and tobago dollars|trinidad and tobago dollar|trinidad and tobago $|trinidad $|trinidad dollar|trinidad dollars|trinidadian dollar|trinidadian dollars|trinidadian $|ttd"], ["Tuvaluan dollar", "tuvaluan dollars|tuvaluan dollar|tuvaluan $"], ["Dollar", "dollars|dollar|$"], ["Chinese yuan", "yuan|kuai|chinese yuan|renminbi|cny|rmb|¥|元"], ["Fen", "fen"], ["Jiao", "jiao|mao"], ["Finnish markka", "suomen markka|finnish markka|finsk mark|fim|markkaa|markka"], ["Penni", "penniä|penni"]]); + EnglishNumericWithUnit.CurrencyNameToIsoCodeMap = new Map([["Afghan afghani", "AFN"], ["Euro", "EUR"], ["Albanian lek", "ALL"], ["Angolan kwanza", "AOA"], ["Armenian dram", "AMD"], ["Aruban florin", "AWG"], ["Bangladeshi taka", "BDT"], ["Bhutanese ngultrum", "BTN"], ["Bolivian boliviano", "BOB"], ["Bosnia and Herzegovina convertible mark", "BAM"], ["Botswana pula", "BWP"], ["Brazilian real", "BRL"], ["Bulgarian lev", "BGN"], ["Cambodian riel", "KHR"], ["Cape Verdean escudo", "CVE"], ["Costa Rican colón", "CRC"], ["Croatian kuna", "HRK"], ["Czech koruna", "CZK"], ["Eritrean nakfa", "ERN"], ["Ethiopian birr", "ETB"], ["Gambian dalasi", "GMD"], ["Georgian lari", "GEL"], ["Ghanaian cedi", "GHS"], ["Guatemalan quetzal", "GTQ"], ["Haitian gourde", "HTG"], ["Honduran lempira", "HNL"], ["Hungarian forint", "HUF"], ["Iranian rial", "IRR"], ["Yemeni rial", "YER"], ["Israeli new shekel", "ILS"], ["Japanese yen", "JPY"], ["Kazakhstani tenge", "KZT"], ["Kenyan shilling", "KES"], ["North Korean won", "KPW"], ["South Korean won", "KRW"], ["Kyrgyzstani som", "KGS"], ["Lao kip", "LAK"], ["Lesotho loti", "LSL"], ["South African rand", "ZAR"], ["Macanese pataca", "MOP"], ["Macedonian denar", "MKD"], ["Malagasy ariary", "MGA"], ["Malawian kwacha", "MWK"], ["Malaysian ringgit", "MYR"], ["Mauritanian ouguiya", "MRO"], ["Mongolian tögrög", "MNT"], ["Mozambican metical", "MZN"], ["Burmese kyat", "MMK"], ["Nicaraguan córdoba", "NIO"], ["Nigerian naira", "NGN"], ["Turkish lira", "TRY"], ["Omani rial", "OMR"], ["Panamanian balboa", "PAB"], ["Papua New Guinean kina", "PGK"], ["Paraguayan guaraní", "PYG"], ["Peruvian sol", "PEN"], ["Polish złoty", "PLN"], ["Qatari riyal", "QAR"], ["Saudi riyal", "SAR"], ["Samoan tālā", "WST"], ["São Tomé and Príncipe dobra", "STD"], ["Sierra Leonean leone", "SLL"], ["Swazi lilangeni", "SZL"], ["Tajikistani somoni", "TJS"], ["Thai baht", "THB"], ["Ukrainian hryvnia", "UAH"], ["Vanuatu vatu", "VUV"], ["Venezuelan bolívar", "VEF"], ["Zambian kwacha", "ZMW"], ["Moroccan dirham", "MAD"], ["United Arab Emirates dirham", "AED"], ["Azerbaijani manat", "AZN"], ["Turkmenistan manat", "TMT"], ["Somali shilling", "SOS"], ["Tanzanian shilling", "TZS"], ["Ugandan shilling", "UGX"], ["Romanian leu", "RON"], ["Moldovan leu", "MDL"], ["Nepalese rupee", "NPR"], ["Pakistani rupee", "PKR"], ["Indian rupee", "INR"], ["Seychellois rupee", "SCR"], ["Mauritian rupee", "MUR"], ["Maldivian rufiyaa", "MVR"], ["Sri Lankan rupee", "LKR"], ["Indonesian rupiah", "IDR"], ["Danish krone", "DKK"], ["Norwegian krone", "NOK"], ["Icelandic króna", "ISK"], ["Swedish krona", "SEK"], ["West African CFA franc", "XOF"], ["Central African CFA franc", "XAF"], ["Comorian franc", "KMF"], ["Congolese franc", "CDF"], ["Burundian franc", "BIF"], ["Djiboutian franc", "DJF"], ["CFP franc", "XPF"], ["Guinean franc", "GNF"], ["Swiss franc", "CHF"], ["Rwandan franc", "RWF"], ["Russian ruble", "RUB"], ["Transnistrian ruble", "PRB"], ["Belarusian ruble", "BYN"], ["Algerian dinar", "DZD"], ["Bahraini dinar", "BHD"], ["Iraqi dinar", "IQD"], ["Jordanian dinar", "JOD"], ["Kuwaiti dinar", "KWD"], ["Libyan dinar", "LYD"], ["Serbian dinar", "RSD"], ["Tunisian dinar", "TND"], ["Argentine peso", "ARS"], ["Chilean peso", "CLP"], ["Colombian peso", "COP"], ["Cuban convertible peso", "CUC"], ["Cuban peso", "CUP"], ["Dominican peso", "DOP"], ["Mexican peso", "MXN"], ["Uruguayan peso", "UYU"], ["British pound", "GBP"], ["Saint Helena pound", "SHP"], ["Egyptian pound", "EGP"], ["Falkland Islands pound", "FKP"], ["Gibraltar pound", "GIP"], ["Manx pound", "IMP"], ["Jersey pound", "JEP"], ["Lebanese pound", "LBP"], ["South Sudanese pound", "SSP"], ["Sudanese pound", "SDG"], ["Syrian pound", "SYP"], ["United States dollar", "USD"], ["Australian dollar", "AUD"], ["Bahamian dollar", "BSD"], ["Barbadian dollar", "BBD"], ["Belize dollar", "BZD"], ["Bermudian dollar", "BMD"], ["Brunei dollar", "BND"], ["Singapore dollar", "SGD"], ["Canadian dollar", "CAD"], ["Cayman Islands dollar", "KYD"], ["New Zealand dollar", "NZD"], ["Fijian dollar", "FJD"], ["Guyanese dollar", "GYD"], ["Hong Kong dollar", "HKD"], ["Jamaican dollar", "JMD"], ["Liberian dollar", "LRD"], ["Namibian dollar", "NAD"], ["Solomon Islands dollar", "SBD"], ["Surinamese dollar", "SRD"], ["New Taiwan dollar", "TWD"], ["Trinidad and Tobago dollar", "TTD"], ["Tuvaluan dollar", "TVD"], ["Chinese yuan", "CNY"], ["Rial", "__RI"], ["Shiling", "__S"], ["Som", "__SO"], ["Dirham", "__DR"], ["Dinar", "_DN"], ["Dollar", "__D"], ["Manat", "__MA"], ["Rupee", "__R"], ["Krone", "__K"], ["Krona", "__K"], ["Crown", "__K"], ["Frank", "__F"], ["Mark", "__M"], ["Ruble", "__RB"], ["Peso", "__PE"], ["Pound", "__P"], ["Tristan da Cunha pound", "_TP"], ["South Georgia and the South Sandwich Islands pound", "_SP"], ["Somaliland shilling", "_SS"], ["Pitcairn Islands dollar", "_PND"], ["Palauan dollar", "_PD"], ["Niue dollar", "_NID"], ["Nauruan dollar", "_ND"], ["Micronesian dollar", "_MD"], ["Kiribati dollar", "_KID"], ["Guernsey pound", "_GGP"], ["Faroese króna", "_FOK"], ["Cook Islands dollar", "_CKD"], ["British Virgin Islands dollar", "_BD"], ["Ascension pound", "_AP"], ["Alderney pound", "_ALP"], ["Abkhazian apsar", "_AA"]]); + EnglishNumericWithUnit.FractionalUnitNameToCodeMap = new Map([["Jiao", "JIAO"], ["Kopek", "KOPEK"], ["Pul", "PUL"], ["Cent", "CENT"], ["Qindarkë", "QINDARKE"], ["Penny", "PENNY"], ["Santeem", "SANTEEM"], ["Cêntimo", "CENTIMO"], ["Centavo", "CENTAVO"], ["Luma", "LUMA"], ["Qəpik", "QƏPIK"], ["Fils", "FILS"], ["Poisha", "POISHA"], ["Kapyeyka", "KAPYEYKA"], ["Centime", "CENTIME"], ["Chetrum", "CHETRUM"], ["Paisa", "PAISA"], ["Fening", "FENING"], ["Thebe", "THEBE"], ["Sen", "SEN"], ["Stotinka", "STOTINKA"], ["Fen", "FEN"], ["Céntimo", "CENTIMO"], ["Lipa", "LIPA"], ["Haléř", "HALER"], ["Øre", "ØRE"], ["Piastre", "PIASTRE"], ["Santim", "SANTIM"], ["Oyra", "OYRA"], ["Butut", "BUTUT"], ["Tetri", "TETRI"], ["Pesewa", "PESEWA"], ["Fillér", "FILLER"], ["Eyrir", "EYRIR"], ["Dinar", "DINAR"], ["Agora", "AGORA"], ["Tïın", "TIIN"], ["Chon", "CHON"], ["Jeon", "JEON"], ["Tyiyn", "TYIYN"], ["Att", "ATT"], ["Sente", "SENTE"], ["Dirham", "DIRHAM"], ["Rappen", "RAPPEN"], ["Avo", "AVO"], ["Deni", "DENI"], ["Iraimbilanja", "IRAIMBILANJA"], ["Tambala", "TAMBALA"], ["Laari", "LAARI"], ["Khoums", "KHOUMS"], ["Ban", "BAN"], ["Möngö", "MONGO"], ["Pya", "PYA"], ["Kobo", "KOBO"], ["Kuruş", "KURUS"], ["Baisa", "BAISA"], ["Centésimo", "CENTESIMO"], ["Toea", "TOEA"], ["Sentimo", "SENTIMO"], ["Grosz", "GROSZ"], ["Sene", "SENE"], ["Halala", "HALALA"], ["Para", "PARA"], ["Öre", "ORE"], ["Diram", "DIRAM"], ["Satang", "SATANG"], ["Seniti", "SENITI"], ["Millime", "MILLIME"], ["Tennesi", "TENNESI"], ["Kopiyka", "KOPIYKA"], ["Tiyin", "TIYIN"], ["Hào", "HAO"], ["Ngwee", "NGWEE"]]); + EnglishNumericWithUnit.CompoundUnitConnectorRegex = `(?and)`; + EnglishNumericWithUnit.CurrencyPrefixList = new Map([["Dollar", "$"], ["United States dollar", "united states $|us$|us $|u.s. $|u.s $"], ["East Caribbean dollar", "east caribbean $"], ["Australian dollar", "australian $|australia $"], ["Bahamian dollar", "bahamian $|bahamia $"], ["Barbadian dollar", "barbadian $|barbadin $"], ["Belize dollar", "belize $"], ["Bermudian dollar", "bermudian $"], ["British Virgin Islands dollar", "british virgin islands $|bvi$|virgin islands $|virgin island $|british virgin island $"], ["Brunei dollar", "brunei $|b$"], ["Sen", "sen"], ["Singapore dollar", "singapore $|s$"], ["Canadian dollar", "canadian $|can$|c$|c $|canada $"], ["Cayman Islands dollar", "cayman islands $|ci$|cayman island $"], ["New Zealand dollar", "new zealand $|nz$|nz $"], ["Cook Islands dollar", "cook islands $|cook island $"], ["Fijian dollar", "fijian $|fiji $"], ["Guyanese dollar", "gy$|gy $|g$|g $"], ["Hong Kong dollar", "hong kong $|hk$|hkd|hk $"], ["Jamaican dollar", "jamaican $|j$|jamaica $"], ["Kiribati dollar", "kiribati $"], ["Liberian dollar", "liberian $|liberia $"], ["Micronesian dollar", "micronesian $"], ["Namibian dollar", "namibian $|nad|n$|namibia $"], ["Nauruan dollar", "nauruan $"], ["Niue dollar", "niue $"], ["Palauan dollar", "palauan $"], ["Pitcairn Islands dollar", "pitcairn islands $|pitcairn island $"], ["Solomon Islands dollar", "solomon islands $|si$|si $|solomon island $"], ["Surinamese dollar", "surinamese $|surinam $"], ["New Taiwan dollar", "nt$|nt $"], ["Trinidad and Tobago dollar", "trinidad and tobago $|trinidad $|trinidadian $"], ["Tuvaluan dollar", "tuvaluan $"], ["Samoan tālā", "ws$"], ["Chinese yuan", "¥"], ["Japanese yen", "¥"], ["Euro", "€"], ["Pound", "£"], ["Costa Rican colón", "₡"], ["Turkish lira", "₺"]]); + EnglishNumericWithUnit.AmbiguousCurrencyUnitList = ['din.', 'kiwi', 'kina', 'kobo', 'lari', 'lipa', 'napa', 'para', 'sfr.', 'taka', 'tala', 'toea', 'vatu', 'yuan', 'ang', 'ban', 'bob', 'btn', 'byr', 'cad', 'cop', 'cup', 'dop', 'gip', 'jod', 'kgs', 'lak', 'lei', 'mga', 'mop', 'nad', 'omr', 'pul', 'sar', 'sbd', 'scr', 'sdg', 'sek', 'sen', 'sol', 'sos', 'std', 'try', 'yer', 'yen']; + EnglishNumericWithUnit.InformationSuffixList = new Map([["Bit", "-bit|bit|bits"], ["Kilobit", "kilobit|kilobits|kb|Kb|kbit"], ["Megabit", "megabit|megabits|mb|Mb|mbit"], ["Gigabit", "gigabit|gigabits|gb|Gb|gbit"], ["Terabit", "terabit|terabits|tb|Tb|tbit"], ["Petabit", "petabit|petabits|pb|Pb|pbit"], ["Byte", "-byte|byte|bytes"], ["Kilobyte", "-kilobyte|-kilobytes|kilobyte|kB|KB|kilobytes|kilo byte|kilo bytes|kbyte"], ["Megabyte", "-megabyte|-megabytes|megabyte|mB|MB|megabytes|mega byte|mega bytes|mbyte"], ["Gigabyte", "-gigabyte|-gigabytes|gigabyte|gB|GB|gigabytes|giga byte|giga bytes|gbyte"], ["Terabyte", "-terabyte|-terabytes|terabyte|tB|TB|terabytes|tera byte|tera bytes|tbyte"], ["Petabyte", "-petabyte|-petabytes|petabyte|pB|PB|petabytes|peta byte|peta bytes|pbyte"]]); + EnglishNumericWithUnit.AmbiguousDimensionUnitList = ['barrel', 'barrels', 'grain', 'pound', 'stone', 'yards', 'yard', 'cord', 'dram', 'feet', 'foot', 'gill', 'knot', 'peck', 'cup', 'fps', 'pts', 'in', 'dm', '\"']; + EnglishNumericWithUnit.BuildPrefix = `(?<=(\\s|^))`; + EnglishNumericWithUnit.BuildSuffix = `(?=(\\s|\\W|$))`; + EnglishNumericWithUnit.LengthSuffixList = new Map([["Kilometer", "km|kilometer|kilometre|kilometers|kilometres|kilo meter|kilo meters|kilo metres|kilo metre"], ["Hectometer", "hm|hectometer|hectometre|hectometers|hectometres|hecto meter|hecto meters|hecto metres|hecto metre"], ["Decameter", "dam|decameter|decametre|decameters|decametres|deca meter|deca meters|deca metres|deca metre"], ["Meter", "m|meter|metre|meters|metres"], ["Decimeter", "dm|decimeter|decimeters|decimetre|decimetres|deci meter|deci meters|deci metres|deci metre"], ["Centimeter", "cm|centimeter|centimeters|centimetre|centimetres|centi meter|centi meters|centi metres|centi metre"], ["Millimeter", "mm|millimeter|millimeters|millimetre|millimetres|milli meter|milli meters|milli metres|milli metre"], ["Micrometer", "μm|micrometer|micrometre|micrometers|micrometres|micro meter|micro meters|micro metres|micro metre"], ["Nanometer", "nm|nanometer|nanometre|nanometers|nanometres|nano meter|nano meters|nano metres|nano metre"], ["Picometer", "pm|picometer|picometre|picometers|picometres|pico meter|pico meters|pico metres|pico metre"], ["Mile", "-mile|mile|miles"], ["Yard", "yard|yards"], ["Inch", "-inch|inch|inches|in|\""], ["Foot", "-foot|foot|feet|ft"], ["Light year", "light year|light-year|light years|light-years"], ["Pt", "pt|pts"]]); + EnglishNumericWithUnit.AmbiguousLengthUnitList = ['m', 'yard', 'yards', 'pm', 'pt', 'pts']; + EnglishNumericWithUnit.SpeedSuffixList = new Map([["Meter per second", "meters / second|m/s|meters per second|metres per second|meter per second|metre per second"], ["Kilometer per hour", "km/h|kilometres per hour|kilometers per hour|kilometer per hour|kilometre per hour"], ["Kilometer per minute", "km/min|kilometers per minute|kilometres per minute|kilometer per minute|kilometre per minute"], ["Kilometer per second", "km/s|kilometers per second|kilometres per second|kilometer per second|kilometre per second"], ["Mile per hour", "mph|mile per hour|miles per hour|mi/h|mile / hour|miles / hour|miles an hour"], ["Knot", "kt|knot|kn"], ["Foot per second", "ft/s|foot/s|foot per second|feet per second|fps"], ["Foot per minute", "ft/min|foot/min|foot per minute|feet per minute"], ["Yard per minute", "yards per minute|yard per minute|yards / minute|yards/min|yard/min"], ["Yard per second", "yards per second|yard per second|yards / second|yards/s|yard/s"]]); + EnglishNumericWithUnit.TemperatureSuffixList = new Map([["F", "degrees fahrenheit|degree fahrenheit|deg fahrenheit|degs fahrenheit|fahrenheit|°f|degrees farenheit|degree farenheit|deg farenheit|degs farenheit|degrees f|degree f|deg f|degs f|farenheit|f"], ["K", "k|kelvin"], ["R", "rankine|°r"], ["D", "delisle|°de"], ["C", "degrees celsius|degree celsius|deg celsius|degs celsius|celsius|degrees celcius|degree celcius|celcius|deg celcius|degs celcius|degrees centigrade|degree centigrade|centigrade|degrees centigrate|degree centigrate|degs centigrate|deg centigrate|centigrate|degrees c|degree c|deg c|degs c|°c|c"], ["Degree", "degree|degrees|deg.|deg|°"]]); + EnglishNumericWithUnit.AmbiguousTemperatureUnitList = ['c', 'f', 'k']; + EnglishNumericWithUnit.VolumeSuffixList = new Map([["Cubic meter", "m3|cubic meter|cubic meters|cubic metre|cubic metres"], ["Cubic centimeter", "cubic centimeter|cubic centimetre|cubic centimeters|cubic centimetres"], ["Cubic millimiter", "cubic millimiter|cubic millimitre|cubic millimiters|cubic millimitres"], ["Hectoliter", "hectoliter|hectolitre|hectoliters|hectolitres"], ["Decaliter", "decaliter|decalitre|dekaliter|dekalitre|decaliters|decalitres|dekaliters|dekalitres"], ["Liter", "l|litre|liter|liters|litres"], ["Deciliter", "dl|deciliter|decilitre|deciliters|decilitres"], ["Centiliter", "cl|centiliter|centilitre|centiliters|centilitres"], ["Milliliter", "ml|mls|millilitre|milliliter|millilitres|milliliters"], ["Cubic yard", "cubic yard|cubic yards"], ["Cubic inch", "cubic inch|cubic inches"], ["Cubic foot", "cubic foot|cubic feet"], ["Cubic mile", "cubic mile|cubic miles"], ["Fluid ounce", "fl oz|fluid ounce|fluid ounces"], ["Teaspoon", "teaspoon|teaspoons"], ["Tablespoon", "tablespoon|tablespoons"], ["Pint", "pint|pints"], ["Volume unit", "fluid dram|gill|quart|minim|barrel|cord|peck|bushel|hogshead"]]); + EnglishNumericWithUnit.AmbiguousVolumeUnitList = ['l', 'ounce', 'oz', 'cup', 'peck', 'cord', 'gill']; + EnglishNumericWithUnit.WeightSuffixList = new Map([["Kilogram", "kg|kilogram|kilograms|kilo|kilos"], ["Gram", "g|gram|grams"], ["Milligram", "mg|milligram|milligrams"], ["Barrel", "barrels|barrel"], ["Gallon", "-gallon|gallons|gallon"], ["Metric ton", "metric tons|metric ton"], ["Ton", "-ton|ton|tons|tonne|tonnes"], ["Pound", "pound|pounds|lb"], ["Ounce", "-ounce|ounce|oz|ounces"], ["Weight unit", "pennyweight|grain|british long ton|US short hundredweight|stone|dram"]]); + EnglishNumericWithUnit.AmbiguousWeightUnitList = ['g', 'oz', 'stone', 'dram']; +})(EnglishNumericWithUnit = exports.EnglishNumericWithUnit || (exports.EnglishNumericWithUnit = {})); + +}); + +unwrapExports(englishNumericWithUnit); + +var base = createCommonjsModule(function (module, exports) { +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); + + + + + +class EnglishNumberWithUnitExtractorConfiguration { + constructor(ci) { + this.cultureInfo = ci; + this.unitNumExtractor = new recognizersTextNumber.EnglishNumberExtractor(); + this.buildPrefix = englishNumericWithUnit.EnglishNumericWithUnit.BuildPrefix; + this.buildSuffix = englishNumericWithUnit.EnglishNumericWithUnit.BuildSuffix; + this.connectorToken = ''; + this.compoundUnitConnectorRegex = recognizersText.RegExpUtility.getSafeRegExp(englishNumericWithUnit.EnglishNumericWithUnit.CompoundUnitConnectorRegex); + this.pmNonUnitRegex = recognizersText.RegExpUtility.getSafeRegExp(baseUnits.BaseUnits.PmNonUnitRegex); + } +} +exports.EnglishNumberWithUnitExtractorConfiguration = EnglishNumberWithUnitExtractorConfiguration; +class EnglishNumberWithUnitParserConfiguration extends parsers$8.BaseNumberWithUnitParserConfiguration { + constructor(ci) { + super(ci); + this.internalNumberExtractor = new recognizersTextNumber.EnglishNumberExtractor(recognizersTextNumber.NumberMode.Default); + this.internalNumberParser = recognizersTextNumber.AgnosticNumberParserFactory.getParser(recognizersTextNumber.AgnosticNumberParserType.Number, new recognizersTextNumber.EnglishNumberParserConfiguration()); + this.connectorToken = ''; + this.currencyNameToIsoCodeMap = englishNumericWithUnit.EnglishNumericWithUnit.CurrencyNameToIsoCodeMap; + this.currencyFractionCodeList = englishNumericWithUnit.EnglishNumericWithUnit.FractionalUnitNameToCodeMap; + } +} +exports.EnglishNumberWithUnitParserConfiguration = EnglishNumberWithUnitParserConfiguration; + +}); + +unwrapExports(base); + +var currency = createCommonjsModule(function (module, exports) { +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); + + + + +class EnglishCurrencyExtractorConfiguration extends base.EnglishNumberWithUnitExtractorConfiguration { + constructor(ci) { + if (!ci) { + ci = new recognizersTextNumber.CultureInfo(recognizersTextNumber.Culture.English); + } + super(ci); + this.extractType = constants$4.Constants.SYS_UNIT_CURRENCY; + // Reference Source: https:// en.wikipedia.org/wiki/List_of_circulating_currencies + this.suffixList = englishNumericWithUnit.EnglishNumericWithUnit.CurrencySuffixList; + this.prefixList = englishNumericWithUnit.EnglishNumericWithUnit.CurrencyPrefixList; + this.ambiguousUnitList = englishNumericWithUnit.EnglishNumericWithUnit.AmbiguousCurrencyUnitList; + } +} +exports.EnglishCurrencyExtractorConfiguration = EnglishCurrencyExtractorConfiguration; +class EnglishCurrencyParserConfiguration extends base.EnglishNumberWithUnitParserConfiguration { + constructor(ci) { + if (!ci) { + ci = new recognizersTextNumber.CultureInfo(recognizersTextNumber.Culture.English); + } + super(ci); + this.BindDictionary(englishNumericWithUnit.EnglishNumericWithUnit.CurrencySuffixList); + this.BindDictionary(englishNumericWithUnit.EnglishNumericWithUnit.CurrencyPrefixList); + } +} +exports.EnglishCurrencyParserConfiguration = EnglishCurrencyParserConfiguration; + +}); + +unwrapExports(currency); + +var temperature = createCommonjsModule(function (module, exports) { +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); + + + + +class EnglishTemperatureExtractorConfiguration extends base.EnglishNumberWithUnitExtractorConfiguration { + constructor(ci) { + if (!ci) { + ci = new recognizersTextNumber.CultureInfo(recognizersTextNumber.Culture.English); + } + super(ci); + this.extractType = constants$4.Constants.SYS_UNIT_TEMPERATURE; + this.suffixList = englishNumericWithUnit.EnglishNumericWithUnit.TemperatureSuffixList; + this.prefixList = new Map(); + this.ambiguousUnitList = englishNumericWithUnit.EnglishNumericWithUnit.AmbiguousTemperatureUnitList; + } +} +exports.EnglishTemperatureExtractorConfiguration = EnglishTemperatureExtractorConfiguration; +class EnglishTemperatureParserConfiguration extends base.EnglishNumberWithUnitParserConfiguration { + constructor(ci) { + if (!ci) { + ci = new recognizersTextNumber.CultureInfo(recognizersTextNumber.Culture.English); + } + super(ci); + this.BindDictionary(englishNumericWithUnit.EnglishNumericWithUnit.TemperatureSuffixList); + } +} +exports.EnglishTemperatureParserConfiguration = EnglishTemperatureParserConfiguration; + +}); + +unwrapExports(temperature); + +var dimension = createCommonjsModule(function (module, exports) { +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); + + + + +const dimensionSuffixList = new Map([ + ...englishNumericWithUnit.EnglishNumericWithUnit.InformationSuffixList, + ...englishNumericWithUnit.EnglishNumericWithUnit.AreaSuffixList, + ...englishNumericWithUnit.EnglishNumericWithUnit.LengthSuffixList, + ...englishNumericWithUnit.EnglishNumericWithUnit.SpeedSuffixList, + ...englishNumericWithUnit.EnglishNumericWithUnit.VolumeSuffixList, + ...englishNumericWithUnit.EnglishNumericWithUnit.WeightSuffixList +]); +class EnglishDimensionExtractorConfiguration extends base.EnglishNumberWithUnitExtractorConfiguration { + constructor(ci) { + if (!ci) { + ci = new recognizersTextNumber.CultureInfo(recognizersTextNumber.Culture.English); + } + super(ci); + this.extractType = constants$4.Constants.SYS_UNIT_DIMENSION; + this.suffixList = dimensionSuffixList; + this.prefixList = new Map(); + this.ambiguousUnitList = englishNumericWithUnit.EnglishNumericWithUnit.AmbiguousDimensionUnitList; + } +} +exports.EnglishDimensionExtractorConfiguration = EnglishDimensionExtractorConfiguration; +class EnglishDimensionParserConfiguration extends base.EnglishNumberWithUnitParserConfiguration { + constructor(ci) { + if (!ci) { + ci = new recognizersTextNumber.CultureInfo(recognizersTextNumber.Culture.English); + } + super(ci); + this.BindDictionary(dimensionSuffixList); + } +} +exports.EnglishDimensionParserConfiguration = EnglishDimensionParserConfiguration; + +}); + +unwrapExports(dimension); + +var age = createCommonjsModule(function (module, exports) { +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); + + + + +class EnglishAgeExtractorConfiguration extends base.EnglishNumberWithUnitExtractorConfiguration { + constructor(ci) { + if (!ci) { + ci = new recognizersTextNumber.CultureInfo(recognizersTextNumber.Culture.English); + } + super(ci); + this.extractType = constants$4.Constants.SYS_UNIT_AGE; + this.suffixList = englishNumericWithUnit.EnglishNumericWithUnit.AgeSuffixList; + this.prefixList = new Map(); + this.ambiguousUnitList = new Array(); + } +} +exports.EnglishAgeExtractorConfiguration = EnglishAgeExtractorConfiguration; +class EnglishAgeParserConfiguration extends base.EnglishNumberWithUnitParserConfiguration { + constructor(ci) { + if (!ci) { + ci = new recognizersTextNumber.CultureInfo(recognizersTextNumber.Culture.English); + } + super(ci); + this.BindDictionary(englishNumericWithUnit.EnglishNumericWithUnit.AgeSuffixList); + } +} +exports.EnglishAgeParserConfiguration = EnglishAgeParserConfiguration; + +}); + +unwrapExports(age); + +var spanishNumericWithUnit = createCommonjsModule(function (module, exports) { +"use strict"; +// ------------------------------------------------------------------------------ +// +// This code was generated by a tool. +// Changes to this file may cause incorrect behavior and will be lost if +// the code is regenerated. +// +// ------------------------------------------------------------------------------ +Object.defineProperty(exports, "__esModule", { value: true }); +var SpanishNumericWithUnit; +(function (SpanishNumericWithUnit) { + SpanishNumericWithUnit.AgeSuffixList = new Map([["Año", "años|año"], ["Mes", "meses|mes"], ["Semana", "semanas|semana"], ["Día", "dias|días|día|dia"]]); + SpanishNumericWithUnit.AreaSuffixList = new Map([["Kilómetro cuadrado", "kilómetro cuadrado|kilómetros cuadrados|km2|km^2|km²"], ["Hectómetro cuadrado", "hectómetro cuadrado|hectómetros cuadrados|hm2|hm^2|hm²|hectárea|hectáreas"], ["Decámetro cuadrado", "decámetro cuadrado|decámetros cuadrados|dam2|dam^2|dam²|área|áreas"], ["Metro cuadrado", "metro cuadrado|metros cuadrados|m2|m^2|m²"], ["Decímetro cuadrado", "decímetro cuadrado|decímetros cuadrados|dm2|dm^2|dm²"], ["Centímetro cuadrado", "centímetro cuadrado|centímetros cuadrados|cm2|cm^2|cm²"], ["Milímetro cuadrado", "milímetro cuadrado|milímetros cuadrados|mm2|mm^2|mm²"], ["Pulgada cuadrado", "pulgada cuadrada|pulgadas cuadradas"], ["Pie cuadrado", "pie cuadrado|pies cuadrados|pie2|pie^2|pie²|ft2|ft^2|ft²"], ["Yarda cuadrado", "yarda cuadrada|yardas cuadradas|yd2|yd^2|yd²"], ["Acre", "acre|acres"]]); + SpanishNumericWithUnit.AreaAmbiguousValues = ['área', 'áreas']; + SpanishNumericWithUnit.CurrencySuffixList = new Map([["Dólar", "dólar|dólares"], ["Peso", "peso|pesos"], ["Rublo", "rublo|rublos"], ["Libra", "libra|libras"], ["Florín", "florín|florines"], ["Dinar", "dinar|dinares"], ["Franco", "franco|francos"], ["Rupia", "rupia|rupias"], ["Escudo", "escudo|escudos"], ["Chelín", "chelín|chelines"], ["Lira", "lira|liras"], ["Centavo", "centavo|centavos"], ["Céntimo", "céntimo|céntimos"], ["Centésimo", "centésimo|centésimos"], ["Penique", "penique|peniques"], ["Euro", "euro|euros|€|eur"], ["Céntimo de Euro", "céntimo de euro|céntimos de euros"], ["Dólar del Caribe Oriental", "dólar del Caribe Oriental|dólares del Caribe Oriental|ec$|xcd"], ["Centavo del Caribe Oriental", "centavo del Caribe Oriental|centavos del Caribe Oriental"], ["Franco CFA de África Occidental", "franco CFA de África Occidental|francos CFA de África Occidental|fcfa|xof"], ["Céntimo de CFA de África Occidental", "céntimo de CFA de África Occidental|céntimos de CFA de África Occidental"], ["Franco CFA de África Central", "franco CFA de África Central|francos CFA de África Central|xaf"], ["Céntimo de CFA de África Central", "céntimo de CFA de África Central|céntimos de CFA de África Central"], ["Apsar", "apsar|apsares"], ["Afgani afgano", "afgani afgano|؋|afn|afganis|afgani"], ["Pul", "pul|puls"], ["Lek albanés", "lek|lekë|lekes|lek albanés"], ["Qindarka", "qindarka|qindarkë|qindarkas"], ["Kwanza angoleño", "kwanza angoleño|kwanzas angoleños|kwanza angoleños|kwanzas angoleño|kwanzas|aoa|kz"], ["Cêntimo angoleño", "cêntimo angoleño|cêntimo|cêntimos"], ["Florín antillano neerlandés", "florín antillano neerlandés|florínes antillano neerlandés|ƒ antillano neerlandés|ang|naƒ"], ["Cent antillano neerlandés", "cent|centen"], ["Riyal saudí", "riyal saudí|riyales saudí|sar"], ["Halalá saudí", "halalá saudí|hallalah"], ["Dinar argelino", "dinar argelino|dinares argelinos|dzd"], ["Céntimo argelino", "centimo argelino|centimos argelinos|"], ["Peso argentino", "peso argentino|pesos argentinos|peso|pesos|ar$|ars"], ["Centavo argentino", "centavo argentino|centavos argentinos|centavo|ctvo.|ctvos."], ["Dram armenio", "dram armenio|dram armenios|dram|դր."], ["Luma armenio", "luma armenio|luma armenios"], ["Florín arubeño", "florín arubeño|florines arubeños|ƒ arubeños|aƒ|awg"], ["Yotin arubeño", "yotin arubeño|yotines arubeños"], ["Dólar australiano", "dólar australiano|dólares australianos|a$|aud"], ["Centavo australiano", "centavo australiano|centavos australianos"], ["Manat azerí", "manat azerí|man|azn"], ["Qəpik azerí", "qəpik azerí|qəpik"], ["Dólar bahameño", "dólar bahameño|dólares bahameños|b$|bsd"], ["Centavo bahameño", "centavo bahameño|centavos bahameños"], ["Dinar bahreiní", "dinar bahreiní|dinares bahreinies|bhd"], ["Fil bahreiní", "fil bahreiní|fils bahreinies"], ["Taka bangladeshí", "taka bangladeshí|takas bangladeshí|bdt"], ["Poisha bangladeshí", "poisha bangladeshí|poishas bangladeshí"], ["Dólar de Barbados", "dólar de barbados|dólares de barbados|bbd"], ["Centavo de Barbados", "centavo de barbados|centavos de barbados"], ["Dólar beliceño", "dólar beliceño|dólares beliceños|bz$|bzd"], ["Centavo beliceño", "centavo beliceño|centavos beliceños"], ["Dólar bermudeño", "dólar bermudeño|dólares bermudeños|bd$|bmd"], ["Centavo bermudeño", "centavo bermudeño|centavos bermudeños"], ["Rublo bielorruso", "rublo bielorruso|rublos bielorrusos|br|byr"], ["Kópek bielorruso", "kópek bielorruso|kópeks bielorrusos|kap"], ["Kyat birmano", "kyat birmano|kyats birmanos|mmk"], ["Pya birmano", "pya birmano|pyas birmanos"], ["Boliviano", "boliviano|bolivianos|bob|bs"], ["Centésimo Boliviano", "centésimo boliviano|centésimos bolivianos"], ["Marco bosnioherzegovino", "marco convertible|marco bosnioherzegovino|marcos convertibles|marcos bosnioherzegovinos|bam"], ["Feningas bosnioherzegovino", "feninga convertible|feninga bosnioherzegovina|feningas convertibles"], ["Pula", "pula|bwp"], ["Thebe", "thebe"], ["Real brasileño", "real brasileño|reales brasileños|r$|brl"], ["Centavo brasileño", "centavo brasileño|centavos brasileños"], ["Dólar de Brunéi", "dólar de brunei|dólares de brunéi|bnd"], ["Sen de Brunéi", "sen|sen de brunéi"], ["Lev búlgaro", "lev búlgaro|leva búlgaros|lv|bgn"], ["Stotinki búlgaro", "stotinka búlgaro|stotinki búlgaros"], ["Franco de Burundi", "franco de burundi|francos de burundi|fbu|fib"], ["Céntimo Burundi", "céntimo burundi|céntimos burundies"], ["Ngultrum butanés", "ngultrum butanés|ngultrum butaneses|btn"], ["Chetrum butanés", "chetrum butanés|chetrum butaneses"], ["Escudo caboverdiano", "escudo caboverdiano|escudos caboverdianos|cve"], ["Riel camboyano", "riel camboyano|rieles camboyanos|khr"], ["Dólar canadiense", "dólar canadiense|dólares canadienses|c$|cad"], ["Centavo canadiense", "centavo canadiense|centavos canadienses"], ["Peso chileno", "peso chileno|pesos chilenos|cpl"], ["Yuan chino", "yuan chino|yuanes chinos|yuan|yuanes|renminbi|rmb|cny|¥"], ["Peso colombiano", "peso colombiano|pesos colombianos|cop|col$"], ["Centavo colombiano", "centavo colombiano|centavos colombianos"], ["Franco comorano", "franco comorano|francos comoranos|kmf|₣"], ["Franco congoleño", "franco congoleño|francos congoleños|cdf"], ["Céntimo congoleño", "céntimo congoleño|céntimos congoleños"], ["Won norcoreano", "won norcoreano|wŏn norcoreano|wŏn norcoreanos|kpw"], ["Chon norcoreano", "chon norcoreano|chŏn norcoreano|chŏn norcoreanos|chon norcoreanos"], ["Won surcoreano", "wŏn surcoreano|won surcoreano|wŏnes surcoreanos|wones surcoreanos|krw"], ["Chon surcoreano", "chon surcoreano|chŏn surcoreano|chŏn surcoreanos|chon surcoreanos"], ["Colón costarricense", "colón costarricense|colones costarricenses|crc"], ["Kuna croata", "kuna croata|kuna croatas|hrk"], ["Lipa croata", "lipa croata|lipa croatas"], ["Peso cubano", "peso cubano|pesos cubanos|cup"], ["Peso cubano convertible", "peso cubano convertible|pesos cubanos convertible|cuc"], ["Corona danesa", "corona danesa|coronas danesas|dkk"], ["Libra egipcia", "libra egipcia|libras egipcias|egp|le"], ["Piastra egipcia", "piastra egipcia|piastras egipcias"], ["Colón salvadoreño", "colón salvadoreño|colones salvadoreños|svc"], ["Dirham de los Emiratos Árabes Unidos", "dirham|dirhams|dirham de los Emiratos Árabes Unidos|aed|dhs"], ["Nakfa", "nakfa|nfk|ern"], ["Céntimo de Nakfa", "céntimo de nakfa|céntimos de nakfa"], ["Peseta", "peseta|pesetas|pts.|ptas.|esp"], ["Dólar estadounidense", "dólar estadounidense|dólares estadounidenses|usd|u$d|us$"], ["Corona estonia", "corona estonia|coronas estonias|eek"], ["Senti estonia", "senti estonia|senti estonias"], ["Birr etíope", "birr etíope|birr etíopes|br|etb"], ["Santim etíope", "santim etíope|santim etíopes"], ["Peso filipino", "peso filipino|pesos filipinos|php"], ["Marco finlandés", "marco finlandés|marcos finlandeses"], ["Dólar fiyiano", "dólar fiyiano|dólares fiyianos|fj$|fjd"], ["Centavo fiyiano", "centavo fiyiano|centavos fiyianos"], ["Dalasi", "dalasi|gmd"], ["Bututs", "butut|bututs"], ["Lari georgiano", "lari georgiano|lari georgianos|gel"], ["Tetri georgiano", "tetri georgiano|tetri georgianos"], ["Cedi", "cedi|ghs|gh₵"], ["Pesewa", "pesewa"], ["Libra gibraltareña", "libra gibraltareña|libras gibraltareñas|gip"], ["Penique gibraltareña", "penique gibraltareña|peniques gibraltareñas"], ["Quetzal guatemalteco", "quetzal guatemalteco|quetzales guatemaltecos|quetzal|quetzales|gtq"], ["Centavo guatemalteco", "centavo guatemalteco|centavos guatemaltecos"], ["Libra de Guernsey", "libra de Guernsey|libras de Guernsey|ggp"], ["Penique de Guernsey", "penique de Guernsey|peniques de Guernsey"], ["Franco guineano", "franco guineano|francos guineanos|gnf|fg"], ["Céntimo guineano", "céntimo guineano|céntimos guineanos"], ["Dólar guyanés", "dólar guyanés|dólares guyaneses|gyd|gy"], ["Gourde haitiano", "gourde haitiano|gourde haitianos|htg"], ["Céntimo haitiano", "céntimo haitiano|céntimos haitianos"], ["Lempira hondureño", "lempira hondureño|lempira hondureños|hnl"], ["Centavo hondureño", "centavo hondureño|centavos hondureño"], ["Dólar de Hong Kong", "dólar de hong kong|dólares de hong kong|hk$|hkd"], ["Forinto húngaro", "forinto húngaro|forinto húngaros|huf"], ["Rupia india", "rupia india|rupias indias|inr"], ["Paisa india", "paisa india|paise indias"], ["Rupia indonesia", "rupia indonesia|rupias indonesias|idr"], ["Sen indonesia", "sen indonesia|sen indonesias"], ["Rial iraní", "rial iraní|rial iranies|irr"], ["Dinar iraquí", "dinar iraquí|dinares iraquies|iqd"], ["Fil iraquí", "fil iraquí|fils iraquies"], ["Libra manesa", "libra manesa|libras manesas|imp"], ["Penique manes", "penique manes|peniques maneses"], ["Corona islandesa", "corona islandesa|coronas islandesas|isk|íkr"], ["Aurar islandes", "aurar islandes|aurar islandeses"], ["Dólar de las Islas Caimán", "dólar de las Islas Caimán|dólares de las Islas Caimán|ci$|kyd"], ["Dólar de las Islas Cook", "dólar de las Islas Cook|dólares de las Islas Cook"], ["Corona feroesa", "corona feroesa|coronas feroesas|fkr"], ["Libra malvinense", "libra malvinense|libras malvinenses|fk£|fkp"], ["Dólar de las Islas Salomón", "dólar de las Islas Salomón|dólares de las Islas Salomón|sbd"], ["Nuevo shéquel", "nuevo shéquel|nuevos shéquel|ils"], ["Agorot", "agorot"], ["Dólar jamaiquino", "dólar jamaiquino|dólares jamaiquinos|j$|ja$|jmd"], ["Yen", "yen|yenes|jpy"], ["Libra de Jersey", "libra de Jersey|libras de Jersey|jep"], ["Dinar jordano", "dinar jordano|dinares jordanos|jd|jod"], ["Piastra jordano", "piastra jordano|piastras jordanos"], ["Tenge kazajo", "tenge|tenge kazajo|kzt"], ["Chelín keniano", "chelín keniano|chelines kenianos|ksh|kes"], ["Som kirguís", "som kirguís|kgs"], ["Tyiyn", "tyiyn"], ["Dólar de Kiribati", "dólar de Kiribati|dólares de Kiribati"], ["Dinar kuwaití", "dinar kuwaití|dinares kuwaití"], ["Kip laosiano", "kip|kip laosiano|kip laosianos|lak"], ["Att laosiano", "att|att laosiano|att laosianos"], ["Loti", "loti|maloti|lsl"], ["Sente", "sente|lisente"], ["Libra libanesa", "libra libanesa|libras libanesas|lbp"], ["Dólar liberiano", "dólar liberiano|dólares liberianos|l$|lrd"], ["Dinar libio", "dinar libio|dinares libios|ld|lyd"], ["Dirham libio", "dirham libio|dirhams libios"], ["Litas lituana", "litas lituana|litai lituanas|ltl"], ["Pataca macaense", "pataca macaense|patacas macaenses|mop$|mop"], ["Avo macaense", "avo macaense|avos macaenses"], ["Ho macaense", "ho macaense|ho macaenses"], ["Denar macedonio", "denar macedonio|denare macedonios|den|mkd"], ["Deni macedonio", "deni macedonio|deni macedonios"], ["Ariary malgache", "ariary malgache|ariary malgaches|mga"], ["Iraimbilanja malgache", "iraimbilanja malgache|iraimbilanja malgaches"], ["Ringgit malayo", "ringgit malayo|ringgit malayos|rm|myr"], ["Sen malayo", "sen malayo|sen malayos"], ["Kwacha malauí", "kwacha malauí|mk|mwk"], ["Támbala malauí", "támbala malauí"], ["Rupia de Maldivas", "rupia de Maldivas|rupias de Maldivas|mvr"], ["Dirham marroquí", "dirham marroquí|dirhams marroquies|mad"], ["Rupia de Mauricio", "rupia de Mauricio|rupias de Mauricio|mur"], ["Uguiya", "uguiya|uguiyas|mro"], ["Jum", "jum|jums"], ["Peso mexicano", "peso mexicano|pesos mexicanos|mxn"], ["Centavo mexicano", "centavo mexicano|centavos mexicanos"], ["Leu moldavo", "leu moldavo|lei moldavos|mdl"], ["Ban moldavo", "ban moldavo|bani moldavos"], ["Tugrik mongol", "tugrik mongol|tugrik|tugrik mongoles|tug|mnt"], ["Metical mozambiqueño", "metical|metical mozambiqueño|meticales|meticales mozambiqueños|mtn|mzn"], ["Dram de Nagorno Karabaj", "dram de Nagorno Karabaj|drams de Nagorno Karabaj|"], ["Luma de Nagorno Karabaj", "luma de Nagorno Karabaj"], ["Dólar namibio", "dólar namibio|dólares namibios|n$|nad"], ["Centavo namibio", "centavo namibio|centavos namibios"], ["Rupia nepalí", "rupia nepalí|rupias nepalies|npr"], ["Paisa nepalí", "paisa nepalí|paisas nepalies"], ["Córdoba nicaragüense", "córdoba nicaragüense|córdobas nicaragüenses|c$|nio"], ["Centavo nicaragüense", "centavo nicaragüense|centavos nicaragüenses"], ["Naira", "naira|ngn"], ["Kobo", "kobo"], ["Corona noruega", "corona noruega|coronas noruegas|nok"], ["Franco CFP", "franco cfp|francos cfp|xpf"], ["Dólar neozelandés", "dólar neozelandés|dólares neozelandeses|dólar de Nueva Zelanda|dólares de Nueva Zelanda|nz$|nzd"], ["Centavo neozelandés", "centavo neozelandés|centavo de Nueva Zelanda|centavos de Nueva Zelanda|centavos neozelandeses"], ["Rial omaní", "rial omaní|riales omanies|omr"], ["Baisa omaní", "baisa omaní|baisa omanies"], ["Florín neerlandés", "florín neerlandés|florines neerlandeses|nlg"], ["Rupia pakistaní", "rupia pakistaní|rupias pakistanies|pkr"], ["Paisa pakistaní", "paisa pakistaní|paisas pakistanies"], ["Balboa panameño", "balboa panameño|balboa panameños|pab"], ["Centésimo panameño", "centésimo panameño|centésimos panameños"], ["Kina", "kina|pkg|pgk"], ["Toea", "toea"], ["Guaraní", "guaraní|guaranies|gs|pyg"], ["Sol", "sol|soles|nuevo sol|pen|s#."], ["Céntimo de sol", "céntimo de sol|céntimos de sol"], ["Złoty", "złoty|esloti|eslotis|zł|pln"], ["Groszy", "groszy"], ["Riyal qatarí", "riyal qatarí|riyal qataries|qr|qar"], ["Dirham qatarí", "dirham qatarí|dirhams qataries"], ["Libra esterlina", "libra esterlina|libras esterlinas|gbp"], ["Corona checa", "corona checa|coronas checas|kc|czk"], ["Peso dominicano", "peso dominicano|pesos dominicanos|rd$|dop"], ["Centavo dominicano", "centavo dominicano|centavos dominicanos"], ["Franco ruandés", "franco ruandés|francos ruandeses|rf|rwf"], ["Céntimo ruandés", "céntimo ruandés|céntimos ruandeses"], ["Leu rumano", "leu rumano|lei rumanos|ron"], ["Ban rumano", "ban rumano|bani rumanos"], ["Rublo ruso", "rublo ruso|rublos rusos|rub"], ["Kopek ruso", "kopek ruso|kopeks rusos"], ["Tala", "tala|tālā|ws$|sat|wst"], ["Sene", "sene"], ["Libra de Santa Helena", "libra de Santa Helena|libras de Santa Helena|shp"], ["Penique de Santa Helena", "penique de Santa Helena|peniques de Santa Helena"], ["Dobra", "dobra|db|std"], ["Dinar serbio", "dinar serbio|dinares serbios|rsd"], ["Para serbio", "para serbio|para serbios"], ["Rupia de Seychelles", "rupia de Seychelles|rupias de Seychelles|scr"], ["Centavo de Seychelles", "centavo de Seychelles|centavos de Seychelles"], ["Leone", "leone|le|sll"], ["Dólar de Singapur", "dólar de singapur|dólares de singapur|sgb"], ["Centavo de Singapur", "centavo de Singapur|centavos de Singapur"], ["Libra siria", "libra siria|libras sirias|s£|syp"], ["Piastra siria", "piastra siria|piastras sirias"], ["Chelín somalí", "chelín somalí|chelines somalies|sos"], ["Centavo somalí", "centavo somalí|centavos somalies"], ["Chelín somalilandés", "chelín somalilandés|chelines somalilandeses"], ["Centavo somalilandés", "centavo somalilandés|centavos somalilandeses"], ["Rupia de Sri Lanka", "rupia de Sri Lanka|rupias de Sri Lanka|lkr"], ["Céntimo de Sri Lanka", "céntimo de Sri Lanka|céntimos de Sri Lanka"], ["Lilangeni", "lilangeni|emalangeni|szl"], ["Rand sudafricano", "rand|rand sudafricano|zar"], ["Libra sudanesa", "libra sudanesa|libras sudanesas|sdg"], ["Piastra sudanesa", "piastra sudanesa|piastras sudanesas"], ["Libra sursudanesa", "libra sursudanesa|libras sursudanesa|ssp"], ["Piastra sursudanesa", "piastra sursudanesa|piastras sursudanesas"], ["Corona sueca", "corona sueca|coronas suecas|sek"], ["Franco suizo", "franco suizo|francos suizos|sfr|chf"], ["Rappen suizo", "rappen suizo|rappens suizos"], ["Dólar surinamés", "óolar surinamés|dólares surinameses|srd"], ["Centavo surinamés", "centavo surinamés|centavos surinamés"], ["Baht tailandés", "baht tailandés|baht tailandeses|thb"], ["Satang tailandés", "satang tailandés|satang tailandeses"], ["Nuevo dólar taiwanés", "nuevo dólar taiwanés|dólar taiwanés|dólares taiwaneses|twd"], ["Centavo taiwanés", "centavo taiwanés|centavos taiwaneses"], ["Chelín tanzano", "chelín tanzano|chelines tanzanos|tzs"], ["Centavo tanzano", "centavo tanzano|centavos tanzanos"], ["Somoni tayiko", "somoni tayiko|somoni|tjs"], ["Diram", "diram|dirams"], ["Paʻanga", "dólar tongano|dólares tonganos|paʻanga|pa'anga|top"], ["Seniti", "seniti"], ["Rublo de Transnistria", "rublo de Transnistria|rublos de Transnistria"], ["Kopek de Transnistria", "kopek de Transnistria|kopeks de Transnistria"], ["Dólar trinitense", "dólar trinitense|dólares trinitenses|ttd"], ["Centavo trinitense", "centavo trinitense|centavos trinitenses"], ["Dinar tunecino", "dinar tunecino|dinares tunecinos|tnd"], ["Millime tunecino", "millime tunecino|millimes tunecinos"], ["Lira turca", "lira turca|liras turcas|try"], ["Kuruş turca", "kuruş turca|kuruş turcas"], ["Manat turkmeno", "manat turkmeno|manat turkmenos|tmt"], ["Tennesi turkmeno", "tennesi turkmeno|tenge turkmeno"], ["Dólar tuvaluano", "dólar tuvaluano|dólares tuvaluanos"], ["Centavo tuvaluano", "centavo tuvaluano|centavos tuvaluanos"], ["Grivna", "grivna|grivnas|uah"], ["Kopiyka", "kopiyka|kópeks"], ["Chelín ugandés", "chelín ugandés|chelines ugandeses|ugx"], ["Centavo ugandés", "centavo ugandés|centavos ugandeses"], ["Peso uruguayo", "peso uruguayo|pesos uruguayos|uyu"], ["Centésimo uruguayo", "centésimo uruguayo|centésimos uruguayos"], ["Som uzbeko", "som uzbeko|som uzbekos|uzs"], ["Tiyin uzbeko", "tiyin uzbeko|tiyin uzbekos"], ["Vatu", "vatu|vuv"], ["Bolívar fuerte", "bolívar fuerte|bolívar|bolívares|vef"], ["Céntimo de bolívar", "céntimo de bolívar|céntimos de bolívar"], ["Đồng vietnamita", "Đồng vietnamita|dong vietnamita|dong vietnamitas|vnd"], ["Hào vietnamita", "Hào vietnamita|hao vietnamita|hao vietnamitas"], ["Rial yemení", "rial yemení|riales yemenies|yer"], ["Fils yemení", "fils yemení|fils yemenies"], ["Franco yibutiano", "franco yibutiano|francos yibutianos|djf"], ["Dinar yugoslavo", "dinar yugoslavo|dinares yugoslavos|yud"], ["Kwacha zambiano", "kwacha zambiano|kwacha zambianos|zmw"], ["Ngwee zambiano", "ngwee zambiano|ngwee zambianos"]]); + SpanishNumericWithUnit.CompoundUnitConnectorRegex = `(?[^.])`; + SpanishNumericWithUnit.CurrencyPrefixList = new Map([["Dólar", "$"], ["Dólar estadounidense", "us$|u$d|usd"], ["Dólar del Caribe Oriental", "ec$|xcd"], ["Dólar australiano", "a$|aud"], ["Dólar bahameño", "b$|bsd"], ["Dólar de Barbados", "bds$|bbd"], ["Dólar beliceño", "bz$|bzd"], ["Dólar bermudeño", "bd$|bmd"], ["Dólar de Brunéi", "brunéi $|bnd"], ["Dólar de Singapur", "s$|sgd"], ["Dólar canadiense", "c$|can$|cad"], ["Dólar de las Islas Caimán", "ci$|kyd"], ["Dólar neozelandés", "nz$|nzd"], ["Dólar fiyiano", "fj$|fjd"], ["Dólar guyanés", "gy$|gyd"], ["Dólar de Hong Kong", "hk$|hkd"], ["Dólar jamaiquino", "j$|ja$|jmd"], ["Dólar liberiano", "l$|lrd"], ["Dólar namibio", "n$|nad"], ["Dólar de las Islas Salomón", "si$|sbd"], ["Nuevo dólar taiwanés", "nt$|twd"], ["Real brasileño", "r$|brl"], ["Guaraní", "₲|gs.|pyg"], ["Dólar trinitense", "tt$|ttd"], ["Yuan chino", "¥|cny|rmb"], ["Yen", "¥|jpy"], ["Euro", "€|eur"], ["Florín", "ƒ"], ["Libra", "£|gbp"], ["Colón costarricense", "₡"], ["Lira turca", "₺"]]); + SpanishNumericWithUnit.AmbiguousCurrencyUnitList = ['le']; + SpanishNumericWithUnit.DimensionSuffixList = new Map([["Kilómetro", "km|kilometro|kilómetro|kilometros|kilómetros"], ["Hectómetro", "hm|hectometro|hectómetro|hectometros|hectómetros"], ["Decámetro", "decametro|decámetro|decametros|decámetros|dam"], ["Metro", "m|m.|metro|metros"], ["Decímetro", "dm|decimetro|decímetro|decimetros|decímetros"], ["Centímetro", "cm|centimetro|centímetro|centimetros|centimetros"], ["Milímetro", "mm|milimetro|milímetro|milimetros|milímetros"], ["Micrómetro", "µm|um|micrometro|micrómetro|micrometros|micrómetros|micrón|micrónes"], ["Nanómetro", "nm|nanometro|nanómetro|nanometros|nanómetros"], ["Picómetro", "pm|picometro|picómetro|picometros|picometros"], ["Milla", "mi|milla|millas"], ["Yarda", "yd|yarda|yardas"], ["Pulgada", "pulgada|pulgadas|\""], ["Pie", "pie|pies|ft"], ["Año luz", "año luz|años luz|al"], ["Metro por segundo", "metro/segundo|m/s|metro por segundo|metros por segundo|metros por segundos"], ["Kilómetro por hora", "km/h|kilómetro por hora|kilometro por hora|kilómetros por hora|kilometros por hora|kilómetro/hora|kilometro/hora|kilómetros/hora|kilometros/hora"], ["Kilómetro por minuto", "km/min|kilómetro por minuto|kilometro por minuto|kilómetros por minuto|kilometros por minuto|kilómetro/minuto|kilometro/minuto|kilómetros/minuto|kilometros/minuto"], ["Kilómetro por segundo", "km/seg|kilómetro por segundo|kilometro por segundo|kilómetros por segundo|kilometros por segundo|kilómetro/segundo|kilometro/segundo|kilómetros/segundo|kilometros/segundo"], ["Milla por hora", "mph|milla por hora|mi/h|milla/hora|millas/hora|millas por hora"], ["Nudo", "kt|nudo|nudos|kn"], ["Pie por segundo", "ft/s|pie/s|ft/seg|pie/seg|pie por segundo|pies por segundo"], ["Pie por minuto", "ft/min|pie/min|pie por minuto|pies por minuto"], ["Yarda por minuto", "yardas por minuto|yardas/minuto|yardas/min"], ["Yarda por segundo", "yardas por segundo|yardas/segundo|yardas/seg"], ["Kilómetro cuadrado", "kilómetro cuadrado|kilómetros cuadrados|km2|km^2|km²"], ["Hectómetro cuadrado", "hectómetro cuadrado|hectómetros cuadrados|hm2|hm^2|hm²|hectárea|hectáreas"], ["Decámetro cuadrado", "decámetro cuadrado|decámetros cuadrados|dam2|dam^2|dam²|área|áreas"], ["Metro cuadrado", "metro cuadrado|metros cuadrados|m2|m^2|m²"], ["Decímetro cuadrado", "decímetro cuadrado|decímetros cuadrados|dm2|dm^2|dm²"], ["Centímetro cuadrado", "centímetro cuadrado|centímetros cuadrados|cm2|cm^2|cm²"], ["Milímetro cuadrado", "milímetro cuadrado|milímetros cuadrados|mm2|mm^2|mm²"], ["Pulgada cuadrado", "pulgada cuadrada|pulgadas cuadradas"], ["Pie cuadrado", "pie cuadrado|pies cuadrados|pie2|pie^2|pie²|ft2|ft^2|ft²"], ["Yarda cuadrado", "yarda cuadrada|yardas cuadradas|yd2|yd^2|yd²"], ["Acre", "acre|acres"], ["Kilómetro cúbico", "kilómetro cúbico|kilómetros cúbico|km3|km^3|km³"], ["Hectómetro cúbico", "hectómetro cúbico|hectómetros cúbico|hm3|hm^3|hm³"], ["Decámetro cúbico", "decámetro cúbico|decámetros cúbico|dam3|dam^3|dam³"], ["Metro cúbico", "metro cúbico|metros cúbico|m3|m^3|m³"], ["Decímetro cúbico", "decímetro cúbico|decímetros cúbico|dm3|dm^3|dm³"], ["Centímetro cúbico", "centímetro cúbico|centímetros cúbico|cc|cm3|cm^3|cm³"], ["Milímetro cúbico", "milímetro cúbico|milímetros cúbico|mm3|mm^3|mm³"], ["Pulgada cúbica", "pulgada cúbics|pulgadas cúbicas"], ["Pie cúbico", "pie cúbico|pies cúbicos|pie3|pie^3|pie³|ft3|ft^3|ft³"], ["Yarda cúbica", "yarda cúbica|yardas cúbicas|yd3|yd^3|yd³"], ["Hectolitro", "hectolitro|hectolitros|hl"], ["Litro", "litro|litros|lts|l"], ["Mililitro", "mililitro|mililitros|ml"], ["Galón", "galón|galones"], ["Pinta", "pinta|pintas"], ["Barril", "barril|barriles"], ["Onza líquida", "onza líquida|onzas líquidas"], ["Tonelada métrica", "tonelada métrica|toneladas métricas"], ["Tonelada", "ton|tonelada|toneladas"], ["Kilogramo", "kg|kilogramo|kilogramos"], ["Hectogramo", "hg|hectogramo|hectogramos"], ["Decagramo", "dag|decagramo|decagramos"], ["Gramo", "g|gr|gramo|gramos"], ["Decigramo", "dg|decigramo|decigramos"], ["Centigramo", "cg|centigramo|centigramos"], ["Miligramo", "mg|miligramo|miligramos"], ["Microgramo", "µg|ug|microgramo|microgramos"], ["Nanogramo", "ng|nanogramo|nanogramos"], ["Picogramo", "pg|picogramo|picogramos"], ["Libra", "lb|libra|libras"], ["Onza", "oz|onza|onzas"], ["Grano", "grano|granos"], ["Quilate", "ct|kt|quilate|quilates"], ["bit", "bit|bits"], ["kilobit", "kilobit|kilobits|kb|kbit"], ["megabit", "megabit|megabits|Mb|Mbit"], ["gigabit", "gigabit|gigabits|Gb|Gbit"], ["terabit", "terabit|terabits|Tb|Tbit"], ["petabit", "petabit|petabits|Pb|Pbit"], ["kibibit", "kibibit|kibibits|kib|kibit"], ["mebibit", "mebibit|mebibits|Mib|Mibit"], ["gibibit", "gibibit|gibibits|Gib|Gibit"], ["tebibit", "tebibit|tebibits|Tib|Tibit"], ["pebibit", "pebibit|pebibits|Pib|Pibit"], ["byte", "byte|bytes"], ["kilobyte", "kilobyte|kilobytes|kB|kByte"], ["megabyte", "megabyte|megabytes|MB|MByte"], ["gigabyte", "gigabyte|gigabytes|GB|GByte"], ["terabyte", "terabyte|terabytes|TB|TByte"], ["petabyte", "petabyte|petabytes|PB|PByte"], ["kibibyte", "kibibyte|kibibytes|kiB|kiByte"], ["mebibyte", "mebibyte|mebibytes|MiB|MiByte"], ["gibibyte", "gibibyte|gibibytes|GiB|GiByte"], ["tebibyte", "tebibyte|tebibytes|TiB|TiByte"], ["pebibyte", "pebibyte|pebibytes|PiB|PiByte"]]); + SpanishNumericWithUnit.AmbiguousDimensionUnitList = ['al', 'mi', 'área', 'áreas', 'pie', 'pies']; + SpanishNumericWithUnit.LengthSuffixList = new Map([["Kilómetro", "km|kilometro|kilómetro|kilometros|kilómetros"], ["Hectómetro", "hm|hectometro|hectómetro|hectometros|hectómetros"], ["Decámetro", "decametro|decámetro|decametros|decámetros|dam"], ["Metro", "m|m.|metro|metros"], ["Decímetro", "dm|decimetro|decímetro|decimetros|decímetros"], ["Centímetro", "cm|centimetro|centímetro|centimetros|centimetros"], ["Milímetro", "mm|milimetro|milímetro|milimetros|milímetros"], ["Micrómetro", "µm|um|micrometro|micrómetro|micrometros|micrómetros|micrón|micrónes"], ["Nanómetro", "nm|nanometro|nanómetro|nanometros|nanómetros"], ["Picómetro", "pm|picometro|picómetro|picometros|picómetros"], ["Milla", "mi|milla|millas"], ["Yarda", "yd|yarda|yardas"], ["Pulgada", "pulgada|pulgadas|\""], ["Pie", "pie|pies|ft"], ["Año luz", "año luz|años luz|al"]]); + SpanishNumericWithUnit.AmbiguousLengthUnitList = ['mi', 'área', 'áreas']; + SpanishNumericWithUnit.BuildPrefix = `(?<=(\\s|^|\\P{L}))`; + SpanishNumericWithUnit.BuildSuffix = `(?=(\\s|\\P{L}|$))`; + SpanishNumericWithUnit.ConnectorToken = 'de'; + SpanishNumericWithUnit.SpeedSuffixList = new Map([["Metro por segundo", "metro/segundo|m/s|metro por segundo|metros por segundo|metros por segundos"], ["Kilómetro por hora", "km/h|kilómetro por hora|kilometro por hora|kilómetros por hora|kilometros por hora|kilómetro/hora|kilometro/hora|kilómetros/hora|kilometros/hora"], ["Kilómetro por minuto", "km/min|kilómetro por minuto|kilometro por minuto|kilómetros por minuto|kilometros por minuto|kilómetro/minuto|kilometro/minuto|kilómetros/minuto|kilometros/minuto"], ["Kilómetro por segundo", "km/seg|kilómetro por segundo|kilometro por segundo|kilómetros por segundo|kilometros por segundo|kilómetro/segundo|kilometro/segundo|kilómetros/segundo|kilometros/segundo"], ["Milla por hora", "mph|milla por hora|mi/h|milla/hora|millas/hora|millas por hora"], ["Nudo", "kt|nudo|nudos|kn"], ["Pie por segundo", "ft/s|pie/s|ft/seg|pie/seg|pie por segundo|pies por segundo"], ["Pie por minuto", "ft/min|pie/min|pie por minuto|pies por minuto"], ["Yarda por minuto", "yardas por minuto|yardas/minuto|yardas/min"], ["Yarda por segundo", "yardas por segundo|yardas/segundo|yardas/seg"]]); + SpanishNumericWithUnit.AmbiguousSpeedUnitList = ['nudo', 'nudos']; + SpanishNumericWithUnit.TemperatureSuffixList = new Map([["Kelvin", "k|kelvin"], ["Rankine", "r|rankine"], ["Grado Celsius", "°c|grados c|grado celsius|grados celsius|celsius|grado centígrado|grados centígrados|centígrado|centígrados"], ["Grado Fahrenheit", "°f|grados f|grado fahrenheit|grados fahrenheit|fahrenheit"], ["Grado Réaumur", "°r|°re|grados r|grado réaumur|grados réaumur|réaumur"], ["Grado Delisle", "°d|grados d|grado delisle|grados delisle|delisle"], ["Grado", "°|grados|grado"]]); + SpanishNumericWithUnit.VolumeSuffixList = new Map([["Kilómetro cúbico", "kilómetro cúbico|kilómetros cúbico|km3|km^3|km³"], ["Hectómetro cúbico", "hectómetro cúbico|hectómetros cúbico|hm3|hm^3|hm³"], ["Decámetro cúbico", "decámetro cúbico|decámetros cúbico|dam3|dam^3|dam³"], ["Metro cúbico", "metro cúbico|metros cúbico|m3|m^3|m³"], ["Decímetro cúbico", "decímetro cúbico|decímetros cúbico|dm3|dm^3|dm³"], ["Centímetro cúbico", "centímetro cúbico|centímetros cúbico|cc|cm3|cm^3|cm³"], ["Milímetro cúbico", "milímetro cúbico|milímetros cúbico|mm3|mm^3|mm³"], ["Pulgada cúbica", "pulgada cúbica|pulgadas cúbicas"], ["Pie cúbico", "pie cúbico|pies cúbicos|pie3|pie^3|pie³|ft3|ft^3|ft³"], ["Yarda cúbica", "yarda cúbica|yardas cúbicas|yd3|yd^3|yd³"], ["Hectolitro", "hectolitro|hectolitros|hl"], ["Litro", "litro|litros|lts|l"], ["Mililitro", "mililitro|mililitros|ml"], ["Galón", "galón|galones"], ["Pinta", "pinta|pintas"], ["Barril", "barril|barriles|bbl"], ["Onza líquida", "onza líquida|onzas líquidas"]]); + SpanishNumericWithUnit.WeightSuffixList = new Map([["Tonelada métrica", "tonelada métrica|toneladas métricas"], ["Tonelada", "ton|tonelada|toneladas"], ["Kilogramo", "kg|kilogramo|kilogramos"], ["Hectogramo", "hg|hectogramo|hectogramos"], ["Decagramo", "dag|decagramo|decagramos"], ["Gramo", "g|gr|gramo|gramos"], ["Decigramo", "dg|decigramo|decigramos"], ["Centigramo", "cg|centigramo|centigramos"], ["Miligramo", "mg|miligramo|miligramos"], ["Microgramo", "µg|ug|microgramo|microgramos"], ["Nanogramo", "ng|nanogramo|nanogramos"], ["Picogramo", "pg|picogramo|picogramos"], ["Libra", "lb|libra|libras"], ["Onza", "oz|onza|onzas"], ["Grano", "grano|granos|gr"], ["Quilate", "ct|kt|quilate|quilates"]]); +})(SpanishNumericWithUnit = exports.SpanishNumericWithUnit || (exports.SpanishNumericWithUnit = {})); + +}); + +unwrapExports(spanishNumericWithUnit); + +var base$2 = createCommonjsModule(function (module, exports) { +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); + + + + + +class SpanishNumberWithUnitExtractorConfiguration { + constructor(ci) { + this.cultureInfo = ci; + this.unitNumExtractor = new recognizersTextNumber.SpanishNumberExtractor(); + this.buildPrefix = spanishNumericWithUnit.SpanishNumericWithUnit.BuildPrefix; + this.buildSuffix = spanishNumericWithUnit.SpanishNumericWithUnit.BuildSuffix; + this.connectorToken = spanishNumericWithUnit.SpanishNumericWithUnit.ConnectorToken; + this.compoundUnitConnectorRegex = recognizersText.RegExpUtility.getSafeRegExp(spanishNumericWithUnit.SpanishNumericWithUnit.CompoundUnitConnectorRegex); + this.pmNonUnitRegex = recognizersText.RegExpUtility.getSafeRegExp(baseUnits.BaseUnits.PmNonUnitRegex); + } +} +exports.SpanishNumberWithUnitExtractorConfiguration = SpanishNumberWithUnitExtractorConfiguration; +class SpanishNumberWithUnitParserConfiguration extends parsers$8.BaseNumberWithUnitParserConfiguration { + constructor(ci) { + super(ci); + this.internalNumberExtractor = new recognizersTextNumber.SpanishNumberExtractor(recognizersTextNumber.NumberMode.Default); + this.internalNumberParser = recognizersTextNumber.AgnosticNumberParserFactory.getParser(recognizersTextNumber.AgnosticNumberParserType.Number, new recognizersTextNumber.SpanishNumberParserConfiguration()); + this.connectorToken = spanishNumericWithUnit.SpanishNumericWithUnit.ConnectorToken; + } +} +exports.SpanishNumberWithUnitParserConfiguration = SpanishNumberWithUnitParserConfiguration; + +}); + +unwrapExports(base$2); + +var currency$2 = createCommonjsModule(function (module, exports) { +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); + + + + +class SpanishCurrencyExtractorConfiguration extends base$2.SpanishNumberWithUnitExtractorConfiguration { + constructor(ci) { + if (!ci) { + ci = new recognizersTextNumber.CultureInfo(recognizersTextNumber.Culture.Spanish); + } + super(ci); + this.extractType = constants$4.Constants.SYS_UNIT_CURRENCY; + // Reference Source: https:// en.wikipedia.org/wiki/List_of_circulating_currencies + this.suffixList = spanishNumericWithUnit.SpanishNumericWithUnit.CurrencySuffixList; + this.prefixList = spanishNumericWithUnit.SpanishNumericWithUnit.CurrencyPrefixList; + this.ambiguousUnitList = spanishNumericWithUnit.SpanishNumericWithUnit.AmbiguousCurrencyUnitList; + } +} +exports.SpanishCurrencyExtractorConfiguration = SpanishCurrencyExtractorConfiguration; +class SpanishCurrencyParserConfiguration extends base$2.SpanishNumberWithUnitParserConfiguration { + constructor(ci) { + if (!ci) { + ci = new recognizersTextNumber.CultureInfo(recognizersTextNumber.Culture.Spanish); + } + super(ci); + this.BindDictionary(spanishNumericWithUnit.SpanishNumericWithUnit.CurrencySuffixList); + this.BindDictionary(spanishNumericWithUnit.SpanishNumericWithUnit.CurrencyPrefixList); + } +} +exports.SpanishCurrencyParserConfiguration = SpanishCurrencyParserConfiguration; + +}); + +unwrapExports(currency$2); + +var temperature$2 = createCommonjsModule(function (module, exports) { +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); + + + + +class SpanishTemperatureExtractorConfiguration extends base$2.SpanishNumberWithUnitExtractorConfiguration { + constructor(ci) { + if (!ci) { + ci = new recognizersTextNumber.CultureInfo(recognizersTextNumber.Culture.Spanish); + } + super(ci); + this.extractType = constants$4.Constants.SYS_UNIT_TEMPERATURE; + this.suffixList = spanishNumericWithUnit.SpanishNumericWithUnit.TemperatureSuffixList; + this.prefixList = new Map(); + this.ambiguousUnitList = new Array(); + } +} +exports.SpanishTemperatureExtractorConfiguration = SpanishTemperatureExtractorConfiguration; +class SpanishTemperatureParserConfiguration extends base$2.SpanishNumberWithUnitParserConfiguration { + constructor(ci) { + if (!ci) { + ci = new recognizersTextNumber.CultureInfo(recognizersTextNumber.Culture.Spanish); + } + super(ci); + this.BindDictionary(spanishNumericWithUnit.SpanishNumericWithUnit.TemperatureSuffixList); + } +} +exports.SpanishTemperatureParserConfiguration = SpanishTemperatureParserConfiguration; + +}); + +unwrapExports(temperature$2); + +var dimension$2 = createCommonjsModule(function (module, exports) { +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); + + + + +class SpanishDimensionExtractorConfiguration extends base$2.SpanishNumberWithUnitExtractorConfiguration { + constructor(ci) { + if (!ci) { + ci = new recognizersTextNumber.CultureInfo(recognizersTextNumber.Culture.Spanish); + } + super(ci); + this.extractType = constants$4.Constants.SYS_UNIT_DIMENSION; + this.suffixList = spanishNumericWithUnit.SpanishNumericWithUnit.DimensionSuffixList; + this.prefixList = new Map(); + this.ambiguousUnitList = spanishNumericWithUnit.SpanishNumericWithUnit.AmbiguousDimensionUnitList; + } +} +exports.SpanishDimensionExtractorConfiguration = SpanishDimensionExtractorConfiguration; +class SpanishDimensionParserConfiguration extends base$2.SpanishNumberWithUnitParserConfiguration { + constructor(ci) { + if (!ci) { + ci = new recognizersTextNumber.CultureInfo(recognizersTextNumber.Culture.Spanish); + } + super(ci); + this.BindDictionary(spanishNumericWithUnit.SpanishNumericWithUnit.DimensionSuffixList); + } +} +exports.SpanishDimensionParserConfiguration = SpanishDimensionParserConfiguration; + +}); + +unwrapExports(dimension$2); + +var age$2 = createCommonjsModule(function (module, exports) { +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); + + + + +class SpanishAgeExtractorConfiguration extends base$2.SpanishNumberWithUnitExtractorConfiguration { + constructor(ci) { + if (!ci) { + ci = new recognizersTextNumber.CultureInfo(recognizersTextNumber.Culture.Spanish); + } + super(ci); + this.extractType = constants$4.Constants.SYS_UNIT_AGE; + this.suffixList = spanishNumericWithUnit.SpanishNumericWithUnit.AgeSuffixList; + this.prefixList = new Map(); + this.ambiguousUnitList = new Array(); + } +} +exports.SpanishAgeExtractorConfiguration = SpanishAgeExtractorConfiguration; +class SpanishAgeParserConfiguration extends base$2.SpanishNumberWithUnitParserConfiguration { + constructor(ci) { + if (!ci) { + ci = new recognizersTextNumber.CultureInfo(recognizersTextNumber.Culture.Spanish); + } + super(ci); + this.BindDictionary(spanishNumericWithUnit.SpanishNumericWithUnit.AgeSuffixList); + } +} +exports.SpanishAgeParserConfiguration = SpanishAgeParserConfiguration; + +}); + +unwrapExports(age$2); + +var portugueseNumericWithUnit = createCommonjsModule(function (module, exports) { +"use strict"; +// ------------------------------------------------------------------------------ +// +// This code was generated by a tool. +// Changes to this file may cause incorrect behavior and will be lost if +// the code is regenerated. +// +// ------------------------------------------------------------------------------ +Object.defineProperty(exports, "__esModule", { value: true }); +var PortugueseNumericWithUnit; +(function (PortugueseNumericWithUnit) { + PortugueseNumericWithUnit.AgeSuffixList = new Map([["Ano", "anos|ano"], ["Mês", "meses|mes|mês"], ["Semana", "semanas|semana"], ["Dia", "dias|dia"]]); + PortugueseNumericWithUnit.AreaSuffixList = new Map([["Quilômetro quadrado", "quilômetro quadrado|quilómetro quadrado|quilometro quadrado|quilômetros quadrados|quilómetros quadrados|quilomeros quadrados|km2|km^2|km²"], ["Hectare", "hectômetro quadrado|hectómetro quadrado|hectômetros quadrados|hectómetros cuadrados|hm2|hm^2|hm²|hectare|hectares"], ["Decâmetro quadrado", "decâmetro quadrado|decametro quadrado|decâmetros quadrados|decametro quadrado|dam2|dam^2|dam²|are|ares"], ["Metro quadrado", "metro quadrado|metros quadrados|m2|m^2|m²"], ["Decímetro quadrado", "decímetro quadrado|decimentro quadrado|decímetros quadrados|decimentros quadrados|dm2|dm^2|dm²"], ["Centímetro quadrado", "centímetro quadrado|centimetro quadrado|centímetros quadrados|centrimetros quadrados|cm2|cm^2|cm²"], ["Milímetro quadrado", "milímetro quadrado|milimetro quadrado|milímetros quadrados|militmetros quadrados|mm2|mm^2|mm²"], ["Polegada quadrada", "polegada quadrada|polegadas quadradas|in2|in^2|in²"], ["Pé quadrado", "pé quadrado|pe quadrado|pés quadrados|pes quadrados|pé2|pé^2|pé²|sqft|sq ft|ft2|ft^2|ft²"], ["Jarda quadrada", "jarda quadrada|jardas quadradas|yd2|yd^2|yd²"], ["Milha quadrada", "milha quadrada|milhas quadradas|mi2|mi^2|mi²"], ["Acre", "acre|acres"]]); + PortugueseNumericWithUnit.CurrencySuffixList = new Map([["Dólar", "dólar|dolar|dólares|dolares"], ["Peso", "peso|pesos"], ["Coroa", "coroa|coroas"], ["Rublo", "rublo|rublos"], ["Libra", "libra|libras"], ["Florim", "florim|florins|ƒ"], ["Dinar", "dinar|dinares"], ["Franco", "franco|francos"], ["Rupia", "rúpia|rupia|rúpias|rupias"], ["Escudo", "escudo|escudos"], ["Xelim", "xelim|xelins|xelims"], ["Lira", "lira|liras"], ["Centavo", "centavo|cêntimo|centimo|centavos|cêntimos|centimo"], ["Centésimo", "centésimo|centésimos"], ["Pêni", "pêni|péni|peni|penies|pennies"], ["Manat", "manat|manate|mánate|man|manats|manates|mánates"], ["Euro", "euro|euros|€|eur"], ["Centavo de Euro", "centavo de euro|cêntimo de euro|centimo de euro|centavos de euro|cêntimos de euro|centimos de euro"], ["Dólar do Caribe Oriental", "dólar do Caribe Oriental|dolar do Caribe Oriental|dólares do Caribe Oriental|dolares do Caribe Oriental|dólar das Caraíbas Orientais|dolar das Caraibas Orientais|dólares das Caraíbas Orientais|dolares das Caraibas Orientais|ec$|xcd"], ["Centavo do Caribe Oriental", "centavo do Caribe Oriental|centavo das Caraíbas Orientais|cêntimo do Caribe Oriental|cêntimo das Caraíbas Orientais|centavos do Caribe Oriental|centavos das Caraíbas Orientais|cêntimos do Caribe Oriental|cêntimos das Caraíbas Orientais"], ["Franco CFA da África Ocidental", "franco CFA da África Ocidental|franco CFA da Africa Ocidental|francos CFA da África Occidental|francos CFA da Africa Occidental|franco CFA Ocidental|xof"], ["Centavo de CFA da África Ocidental", "centavo de CFA da Africa Occidental|centavos de CFA da África Ocidental|cêntimo de CFA da Africa Occidental|cêntimos de CFA da África Ocidental"], ["Franco CFA da África Central", "franco CFA da África Central|franco CFA da Africa Central|francos CFA da África Central|francos CFA da Africa Central|franco CFA central|xaf"], ["Centavo de CFA da África Central", "centavo de CFA de África Central|centavos de CFA da África Central|cêntimo de CFA de África Central|cêntimos de CFA da África Central"], ["Apsar abcásio", "apsar abcásio|apsar abecásio|apsar abcasio|apsar|apsares"], ["Afegani afegão", "afegani afegão|afegane afegão|؋|afn|afegane|afgane|afegâni|afeganis|afeganes|afganes|afegânis"], ["Pul", "pul|pules|puls"], ["Lek albanês", "lek|lekë|lekes|lek albanês|leque|leques|all"], ["Qindarke", "qindarka|qindarkë|qindarke|qindarkas"], ["Kwanza angolano", "kwanza angolano|kwanzas angolanos|kwanza|kwanzas|aoa|kz"], ["Cêntimo angolano", "cêntimo angolano|cêntimo|cêntimos"], ["Florim das Antilhas Holandesas", "florim das antilhas holandesas|florim das antilhas neerlandesas|ang"], ["Rial saudita", "rial saudita|riais sauditas|riyal saudita|riyals sauditas|riyal|riyals|sar"], ["Halala saudita", "halala saudita|halala|hallalah"], ["Dinar argelino", "dinar argelino|dinares argelinos|dzd"], ["Cêntimo argelino", "centimo argelino|centimos argelinos|cêntimo argelino|cêntimos argelinos|centavo argelino|centavos argelinos"], ["Peso argentino", "peso argentino|pesos argentinos|peso|pesos|ar$|ars"], ["Centavo argentino", "centavo argentino|centavos argentinos|centavo|ctvo.|ctvos."], ["Dram armênio", "dram armênio|dram armênios|dram arménio|dram arménios|dram armenio|dram armenios|dram|drame|drames|դր."], ["Luma armênio", "luma armênio|lumas armênios|luma arménio|lumas arménios|luma armenio|lumas armenios|luma|lumas"], ["Florim arubano", "florín arubeño|florines arubeños|ƒ arubeños|aƒ|awg"], ["Dólar australiano", "dólar australiano|dólares australianos|dolar australiano|dolares australianos|a$|aud"], ["Centavo australiano", "centavo australiano|centavos australianos"], ["Manat azeri", "manat azeri|manats azeris|azn|manat azerbaijanês|manat azerbaijano|manats azerbaijaneses|manats azerbaijanos"], ["Qəpik azeri", "qəpik azeri|qəpik|qəpiks"], ["Dólar bahamense", "dólar bahamense|dólares bahamense|dolar bahamense|dolares bahamense|dólar baamiano|dólares baamiano|dolar baamiano|dolares baamiano|b$|bsd"], ["Centavo bahamense", "centavo bahamense|centavos bahamense"], ["Dinar bareinita", "dinar bareinita|dinar baremita|dinares bareinitas|dinares baremitas|bhd"], ["Fil bareinita", "fil bareinita|fil baremita|fils bareinitas|fils baremitas"], ["Taka bengali", "taka bengali|takas bengalis|taca|tacas|taka|takas|bdt"], ["Poisha bengali", "poisha bengali|poishas bengalis"], ["Dólar de Barbados", "dólar de barbados|dólares de barbados|dolar de barbados|dolares de barbados|dólar dos barbados|dólares dos barbados|bbd"], ["Centavo de Barbados", "centavo de barbados|centavos de barbados|centavo dos barbados|centavos dos barbados"], ["Dólar de Belize", "dólar de belize|dólares de belize|dolar de belize|dolares de belize|dólar do belize|dólares do belize|dolar do belize|dolares do belize|bz$|bzd"], ["Centavo de Belize", "centavo de belize|centavos de belize|cêntimo do belize|cêntimos do belize"], ["Dólar bermudense", "dólar bermudense|dólares bermudenses|bd$|bmd"], ["Centavo bermudense", "centavo bermudense|centavos bermudenses|cêntimo bermudense| cêntimos bermudenses"], ["Rublo bielorrusso", "rublo bielorrusso|rublos bielorrussos|br|byr"], ["Copeque bielorusso", "copeque bielorrusso|copeques bielorrussos|kopek bielorrusso|kopeks bielorrussos|kap"], ["Quiate mianmarense", "quiate mianmarense|quiates mianmarenses|kyat mianmarense|kyates mianmarenses|quiate myanmarense|quiates myanmarenses|kyat myanmarense|kyates myanmarenses|quiate birmanês|quite birmanes|quiates birmaneses|kyat birmanês|kyat birmanes|kyates birmaneses|mmk"], ["Pya mianmarense", "pya mianmarense|pyas mianmarenses|pya myanmarense|pyas myanmarenses|pya birmanês|pya birmanes|pyas birmaneses"], ["Boliviano", "boliviano|bolivianos|bob|bs"], ["Centavo Boliviano", "centavo boliviano|centavos bolivianos"], ["Marco da Bósnia e Herzegovina", "marco conversível|marco conversivel|marco convertível|marco convertivel|marcos conversíveis|marcos conversiveis|marcos convertíveis|marcos convertivies|bam"], ["Fening da Bósnia e Herzegovina", "fening conversível|fening conversivel|fening convertível|fening convertivel|fenings conversíveis|fenings conversiveis|fenings convertíveis|fenings convertiveis"], ["Pula", "pula|pulas|bwp"], ["Thebe", "thebe|thebes"], ["Real brasileiro", "real brasileiro|real do brasil|real|reais brasileiros|reais do brasil|reais|r$|brl"], ["Centavo brasileiro", "centavo de real|centavo brasileiro|centavos de real|centavos brasileiros"], ["Dólar de Brunei", "dólar de brunei|dolar de brunei|dólar do brunei|dolar do brunei|dólares de brunéi|dolares de brunei|dólares do brunei|dolares do brunei|bnd"], ["Sen de Brunei", "sen de brunei|sen do brunei|sens de brunei|sens do brunei"], ["Lev búlgaro", "lev búlgaro|leve búlgaro|leves búlgaros|lev bulgaro|leve bulgaro|leves bulgaros|lv|bgn"], ["Stotinka búlgaro", "stotinka búlgaro|stotinki búlgaros|stotinka bulgaro|stotinki bulgaros"], ["Franco do Burundi", "franco do burundi|francos do burundi|fbu|fib"], ["Centavo Burundi", "centavo burundi|cêntimo burundi|centimo burundi|centavos burundi|cêntimo burundi|centimo burundi"], ["Ngultrum butanês", "ngultrum butanês|ngultrum butanes|ngúltrume butanês|ngultrume butanes|ngultrum butaneses|ngúltrumes butaneses|ngultrumes butaneses|btn"], ["Chetrum butanês", "chetrum butanês|chetrum butanes|chetrum butaneses"], ["Escudo cabo-verdiano", "escudo cabo-verdiano|escudos cabo-verdianos|cve"], ["Riel cambojano", "riel cambojano|riéis cambojanos|rieis cambojanos|khr"], ["Dólar canadense", "dólar canadense|dolar canadense|dólares canadenses|dolares canadenses|c$|cad"], ["Centavo canadense", "centavo canadense|centavos canadenses"], ["Peso chileno", "peso chileno|pesos chilenos|cpl"], ["Yuan chinês", "yuan chinês|yuan chines|yuans chineses|yuan|yuans|renminbi|rmb|cny|¥"], ["Peso colombiano", "peso colombiano|pesos colombianos|cop|col$"], ["Centavo colombiano", "centavo colombiano|centavos colombianos"], ["Franco comorense", "franco comorense|francos comorenses|kmf|₣"], ["Franco congolês", "franco congolês|franco congoles|francos congoleses|cdf"], ["Centavo congolês", "centavo congolês|centavo congoles|centavos congoleses|cêntimo congolês|centimo congoles|cêntimos congoleses|cêntimos congoleses"], ["Won norte-coreano", "won norte-coreano|wŏn norte-coreano|won norte-coreanos|wŏn norte-coreanos|kpw"], ["Chon norte-coreano", "chon norte-coreano|chŏn norte-coreano|chŏn norte-coreanos|chon norte-coreanos"], ["Won sul-coreano", "wŏn sul-coreano|won sul-coreano|wŏnes sul-coreanos|wones sul-coreanos|krw"], ["Jeon sul-coreano", "jeons sul-coreano|jeons sul-coreanos"], ["Colón costarriquenho", "colón costarriquenho|colon costarriquenho|colons costarriquenho|colones costarriquenhos|crc"], ["Kuna croata", "kuna croata|kunas croatas|hrk"], ["Lipa croata", "lipa croata|lipas croatas"], ["Peso cubano", "peso cubano|pesos cubanos|cup"], ["Peso cubano convertível", "peso cubano conversível|pesos cubanos conversíveis|peso cubano conversivel|pesos cubanos conversiveis|peso cubano convertível|pesos cubanos convertíveis|peso cubano convertivel|pesos cubanos convertiveis|cuc"], ["Coroa dinamarquesa", "coroa dinamarquesa|coroas dinamarquesas|dkk"], ["Libra egípcia", "libra egípcia|libra egipcia|libras egípcias|libras egipcias|egp|le"], ["Piastra egípcia", "piastra egípcia|piastra egipcia|pisastras egípcias|piastras egipcias"], ["Dirham dos Emirados Árabes Unidos", "dirham|dirhams|dirham dos emirados arabes unidos|aed|dhs"], ["Nakfa", "nakfa|nfk|ern"], ["Centavo de Nakfa", "cêntimo de nakfa|cêntimos de nakfa|centavo de nafka|centavos de nafka"], ["Peseta", "peseta|pesetas|pts.|ptas.|esp"], ["Dólar estadunidense", "dólar dos estados unidos|dolar dos estados unidos|dólar estadunidense|dólar americano|dólares dos estados unidos|dolares dos estados unidos|dólares estadunidenses|dólares americanos|dolar estadunidense|dolar americano|dolares estadunidenses|dolares americanos|usd|u$d|us$"], ["Coroa estoniana", "coroa estoniana|coroas estonianas|eek"], ["Senti estoniano", "senti estoniano|senti estonianos"], ["Birr etíope", "birr etíope|birr etiope|birr etíopes|birr etiopes|br|etb"], ["Santim etíope", "santim etíope|santim etiope|santim etíopes|santim etiopes"], ["Peso filipino", "peso filipino|pesos filipinos|php"], ["Marco finlandês", "marco finlandês|marco finlandes|marcos finlandeses"], ["Dólar fijiano", "dólar fijiano|dolar fijiano|dólares fijianos|dolares fijianos|fj$|fjd"], ["Centavo fijiano", "centavo fijiano|centavos fijianos"], ["Dalasi gambiano", "dalasi|gmd"], ["Bututs", "butut|bututs"], ["Lari georgiano", "lari georgiano|lari georgianos|gel"], ["Tetri georgiano", "tetri georgiano|tetri georgianos"], ["Cedi", "cedi|ghs|gh₵"], ["Pesewa", "pesewa"], ["Libra de Gibraltar", "libra de gibraltar|libras de gibraltar|gip"], ["Peni de Gibraltar", "peni de gibraltar|penies de gibraltar"], ["Quetzal guatemalteco", "quetzal guatemalteco|quetzales guatemaltecos|quetzal|quetzales|gtq"], ["Centavo guatemalteco", "centavo guatemalteco|centavos guatemaltecos"], ["Libra de Guernsey", "libra de Guernsey|libras de Guernsey|ggp"], ["Peni de Guernsey", "peni de Guernsey|penies de Guernsey"], ["Franco da Guiné", "franco da guiné|franco da guine| franco guineense|francos da guiné|francos da guine|francos guineense|gnf|fg"], ["Centavo da Guiné", "cêntimo guineense|centimo guineense|centavo guineense|cêntimos guineenses|centimos guineenses|centavos guineenses"], ["Dólar guianense", "dólar guianense|dólares guianense|dolar guianense|dolares guianense|gyd|gy"], ["Gurde haitiano", "gurde haitiano|gourde|gurdes haitianos|htg"], ["Centavo haitiano", "cêntimo haitiano|cêntimos haitianos|centavo haitiano|centavos haitianos"], ["Lempira hondurenha", "lempira hondurenha|lempiras hondurenhas|lempira|lempiras|hnl"], ["Centavo hondurenho", "centavo hondurenho|centavos hondurehos|cêntimo hondurenho|cêntimos hondurenhos"], ["Dólar de Hong Kong", "dólar de hong kong|dolar de hong kong|dólares de hong kong|dolares de hong kong|hk$|hkd"], ["Florim húngaro", "florim húngaro|florim hungaro|florins húngaros|florins hungaros|forinte|forintes|huf"], ["Filér húngaro", "fillér|filér|filler|filer"], ["Rupia indiana", "rúpia indiana|rupia indiana|rupias indianas|inr"], ["Paisa indiana", "paisa indiana|paisas indianas"], ["Rupia indonésia", "rupia indonesia|rupia indonésia|rupias indonesias|rupias indonésias|idr"], ["Sen indonésio", "send indonésio|sen indonesio|sen indonésios|sen indonesios"], ["Rial iraniano", "rial iraniano|riais iranianos|irr"], ["Dinar iraquiano", "dinar iraquiano|dinares iraquianos|iqd"], ["Fil iraquiano", "fil iraquiano|fils iraquianos|files iraquianos"], ["Libra manesa", "libra manesa|libras manesas|imp"], ["Peni manês", "peni manes|peni manês|penies maneses"], ["Coroa islandesa", "coroa islandesa|coroas islandesas|isk|íkr"], ["Aurar islandês", "aurar islandês|aurar islandes|aurar islandeses|eyrir"], ["Dólar das Ilhas Cayman", "dólar das ilhas cayman|dolar das ilhas cayman|dólar das ilhas caimão|dólares das ilhas cayman|dolares das ilhas cayman|dólares das ilhas caimão|ci$|kyd"], ["Dólar das Ilhas Cook", "dólar das ilhas cook|dolar das ilhas cook|dólares das ilhas cook|dolares das ilhas cook"], ["Coroa feroesa", "coroa feroesa|coroas feroesas|fkr"], ["Libra das Malvinas", "libra das malvinas|libras das malvinas|fk£|fkp"], ["Dólar das Ilhas Salomão", "dólar das ilhas salomão|dolar das ilhas salomao|dólares das ilhas salomão|dolares das ilhas salomao|sbd"], ["Novo shekel israelense", "novo shekel|novos shekeles|novo shequel|novo siclo|novo xéquel|shekeles novos|novos sheqalim|sheqalim novos|ils"], ["Agora", "agora|agorot"], ["Dólar jamaicano", "dólar jamaicano|dolar jamaicano|dólares jamaicanos|dolares jamaicanos|j$|ja$|jmd"], ["Yen", "yen|iene|yenes|ienes|jpy"], ["Libra de Jersey", "libra de Jersey|libras de Jersey|jep"], ["Dinar jordaniano", "dinar jordaniano|dinar jordano|dinares jordanianos|dinares jordanos|jd|jod"], ["Piastra jordaniana", "piastra jordaniana|piastra jordano|piastras jordanianas|piastra jordaniano|piastras jordanianos|piastras jordanos"], ["Tengue cazaque", "tenge|tengue|tengué|tengue cazaque|kzt"], ["Tiyin", "tiyin|tiyins"], ["Xelim queniano", "xelim queniano|xelins quenianos|ksh|kes"], ["Som quirguiz", "som quirguiz|som quirguizes|soms quirguizes|kgs"], ["Tyiyn", "tyiyn|tyiyns"], ["Dólar de Kiribati", "dólar de kiribati|dolar de kiribati|dólares de kiribati|dolares de kiribati"], ["Dinar kuwaitiano", "dinar kuwaitiano|dinar cuaitiano|dinares kuwaitiano|dinares cuaitianos|kwd"], ["Quipe laosiano", "quipe|quipes|kipe|kipes|kip|kip laosiano|kip laociano|kips laosianos|kips laocianos|lak"], ["Att laosiano", "at|att|att laosiano|att laosianos"], ["Loti do Lesoto", "loti|lóti|maloti|lotis|lótis|lsl"], ["Sente", "sente|lisente"], ["Libra libanesa", "libra libanesa|libras libanesas|lbp"], ["Dólar liberiano", "dólar liberiano|dolar liberiano|dólares liberianos|dolares liberianos|l$|lrd"], ["Dinar libio", "dinar libio|dinar líbio|dinares libios|dinares líbios|ld|lyd"], ["Dirham libio", "dirham libio|dirhams libios|dirham líbio|dirhams líbios"], ["Litas lituana", "litas lituana|litai lituanas|ltl"], ["Pataca macaense", "pataca macaense|patacas macaenses|mop$|mop"], ["Avo macaense", "avo macaense|avos macaenses"], ["Ho macaense", "ho macaense|ho macaenses"], ["Dinar macedônio", "denar macedonio|denare macedonios|denar macedônio|denar macedónio|denare macedônio|denare macedónio|dinar macedonio|dinar macedônio|dinar macedónio|dinares macedonios|dinares macedônios|dinares macedónios|den|mkd"], ["Deni macedônio", "deni macedonio|deni macedônio|deni macedónio|denis macedonios|denis macedônios|denis macedónios"], ["Ariary malgaxe", "ariai malgaxe|ariary malgaxe|ariary malgaxes|ariaris|mga"], ["Iraimbilanja", "iraimbilanja|iraimbilanjas"], ["Ringuite malaio", "ringgit malaio|ringgit malaios|ringgits malaios|ringuite malaio|ringuites malaios|rm|myr"], ["Sen malaio", "sen malaio|sen malaios|centavo malaio|centavos malaios|cêntimo malaio|cêntimos malaios"], ["Kwacha do Malawi", "kwacha|cuacha|quacha|mk|mwk"], ["Tambala", "tambala|tambalas|tambala malawi"], ["Rupia maldiva", "rupia maldiva|rupias maldivas|rupia das maldivas| rupias das maldivas|mvr"], ["Dirame marroquino", "dirame marroquino|dirham marroquinho|dirhams marroquinos|dirames marroquinos|mad"], ["Rupia maurícia", "rupia maurícia|rupia de Maurício|rupia mauricia|rupia de mauricio|rupias de mauricio|rupias de maurício|rupias mauricias|rupias maurícias|mur"], ["Uguia", "uguia|uguias|oguia|ouguiya|oguias|mro"], ["Kume", "kumes|kume|khoums"], ["Peso mexicano", "peso mexicano|pesos mexicanos|mxn"], ["Centavo mexicano", "centavo mexicano|centavos mexicanos"], ["Leu moldávio", "leu moldavo|lei moldavos|leu moldávio|leu moldavio|lei moldávios|lei moldavios|leus moldavos|leus moldavios|leus moldávios|mdl"], ["Ban moldávio", "ban moldavo|bani moldavos"], ["Tugrik mongol", "tugrik mongol|tugrik|tugriks mongóis|tugriks mongois|tug|mnt"], ["Metical moçambicao", "metical|metical moçambicano|metical mocambicano|meticais|meticais moçambicanos|meticais mocambicanos|mtn|mzn"], ["Dólar namibiano", "dólar namibiano|dólares namibianos|dolar namibio|dolares namibios|n$|nad"], ["Centavo namibiano", "centavo namibiano|centavos namibianos|centavo namibio|centavos namibianos"], ["Rupia nepalesa", "rupia nepalesa|rupias nepalesas|npr"], ["Paisa nepalesa", "paisa nepalesa|paisas nepalesas"], ["Córdova nicaraguense", "córdova nicaraguense|cordova nicaraguense|cordova nicaraguana|córdoba nicaragüense|córdobas nicaragüenses|cordobas nicaraguenses|córdovas nicaraguenses|cordovas nicaraguenses|córdovas nicaraguanasc$|nio"], ["Centavo nicaraguense", "centavo nicaragüense|centavos nicaraguenses|centavo nicaraguano|centavos nicaraguenses|centavo nicaraguano|centavos nicaraguanos"], ["Naira", "naira|ngn"], ["Kobo", "kobo"], ["Coroa norueguesa", "coroa norueguesa|coroas norueguesas|nok"], ["Franco CFP", "franco cfp|francos cfp|xpf"], ["Dólar neozelandês", "dólar neozelandês|dolar neozelandes|dólares neozelandeses|dolares neozelandeses|dólar da nova zelândia|dolar da nova zelandia|dólares da nova zelândia|dolares da nova zelandia|nz$|nzd"], ["Centavo neozelandês", "centavo neozelandês|centavo neozelandes|centavo da nova zelandia|centavo da nova zelândia|centavos da nova zelandia|centavos neozelandeses|centavos da nova zelândia"], ["Rial omanense", "rial omani|riais omanis|rial omanense|riais omanenses|omr"], ["Baisa omanense", "baisa omani|baisas omanis|baisa omanense|baisas omanenses"], ["Florim holandês", "florim holandês|florim holandes|florins holandeses|nlg"], ["Rupia paquistanesa", "rupia paquistanesa|rupias paquistanesas|pkr"], ["Paisa paquistanesa", "paisa paquistanesa|paisas paquistanesasas"], ["Balboa panamenho", "balboa panamenho|balboas panamenhos|balboa|pab|balboa panamense|balboas panamenses"], ["Centavo panamenho", "centavo panamenho|cêntimo panamenho|centavos panamenhos|cêntimos panamenhos|cêntimo panamense|cêntimos panamenses"], ["Kina", "kina|kina papuásia|kinas|kinas papuásias|pkg|pgk"], ["Toea", "toea"], ["Guarani", "guarani|guaranis|gs|pyg"], ["Novo Sol", "novo sol peruano|novos sóis peruanos|sol|soles|sóis|nuevo sol|pen|s#."], ["Centavo de sol", "cêntimo de sol|cêntimos de sol|centavo de sol|centavos de sol"], ["Złoty", "złoty|złotys|zloty|zlotys|zloti|zlotis|zlóti|zlótis|zlote|zł|pln"], ["Groszy", "groszy|grosz"], ["Rial catariano", "rial qatari|riais qataris|rial catarense|riais catarenses|rial catariano|riais catarianos|qr|qar"], ["Dirame catariano", "dirame catariano|dirames catarianos|dirame qatari|dirames qataris|dirame catarense|dirames catarenses|dirham qatari|dirhams qataris|dirham catarense|dirhams catarenses|dirham catariano|dirhams catariano"], ["Libra esterlina", "libra esterlina|libras esterlinas|gbp"], ["Coroa checa", "coroa checa|coroas checas|kc|czk"], ["Peso dominicano", "peso dominicano|pesos dominicanos|rd$|dop"], ["Centavo dominicano", "centavo dominicano|centavos dominicanos"], ["Franco ruandês", "franco ruandês|franco ruandes|francos ruandeses|rf|rwf"], ["Céntimo ruandês", "cêntimo ruandês|centimo ruandes|centavo ruandês|centavo ruandes|cêntimos ruandeses|centimos ruandeses|centavos ruandeses"], ["Leu romeno", "leu romeno|lei romenos|leus romenos|ron"], ["Ban romeno", "ban romeno|bani romeno|bans romenos"], ["Rublo russo", "rublo russo|rublos russos|rub|р."], ["Copeque ruso", "copeque russo|copeques russos|kopek ruso|kopeks rusos|copeque|copeques|kopek|kopeks"], ["Tala samoano", "tala|tālā|talas|tala samonano|talas samoanos|ws$|sat|wst"], ["Sene samoano", "sene"], ["Libra de Santa Helena", "libra de santa helena|libras de santa helena|shp"], ["Pêni de Santa Helena", "peni de santa helena|penies de santa helena"], ["Dobra", "dobra|dobras|db|std"], ["Dinar sérvio", "dinar sérvio|dinar servio|dinar serbio|dinares sérvios|dinares servios|dinares serbios|rsd"], ["Para sérvio", "para sérvio|para servio|para serbio|paras sérvios|paras servios|paras serbios"], ["Rupia seichelense", "rupia de seicheles|rupias de seicheles|rupia seichelense|rupias seichelenses|scr"], ["Centavo seichelense", "centavo de seicheles|centavos de seicheles|centavo seichelense|centavos seichelenses"], ["Leone serra-leonino", "leone|leones|leone serra-leonino|leones serra-leoninos|le|sll"], ["Dólar de Cingapura", "dólar de singapura|dolar de singapura|dórar de cingapura|dolar de cingapura|dólares de singapura|dolares de singapura|dólares de cingapura|dolares de cingapura|sgb"], ["Centavo de Cingapura", "centavo de singapura|centavos de singapura|centavo de cingapura|centavos de cingapura"], ["Libra síria", "libra síria|libra siria|libras sírias|libras sirias|s£|syp"], ["Piastra síria", "piastra siria|piastras sirias|piastra síria|piastras sírias"], ["Xelim somali", "xelim somali|xelins somalis|xelim somaliano|xelins somalianos|sos"], ["Centavo somali", "centavo somapli|centavos somalis|centavo somaliano|centavos somalianos"], ["Xelim da Somalilândia", "xelim da somalilândia|xelins da somalilândia|xelim da somalilandia|xelins da somalilandia"], ["Centavo da Somalilândia", "centavo da somalilândia|centavos da somalilândia|centavo da somalilandia|centavos da somalilandia"], ["Rupia do Sri Lanka", "rupia do sri lanka|rupia do sri lanca|rupias do sri lanka|rupias do sri lanca|rupia cingalesa|rupias cingalesas|lkr"], ["Lilangeni", "lilangeni|lilangenis|emalangeni|szl"], ["Rand sul-africano", "rand|rand sul-africano|rands|rands sul-africanos|zar"], ["Libra sudanesa", "libra sudanesa|libras sudanesas|sdg"], ["Piastra sudanesa", "piastra sudanesa|piastras sudanesas"], ["Libra sul-sudanesa", "libra sul-sudanesa|libras sul-sudanesas|ssp"], ["Piastra sul-sudanesa", "piastra sul-sudanesa|piastras sul-sudanesas"], ["Coroa sueca", "coroa sueca|coroas suecas|sek"], ["Franco suíço", "franco suíço|franco suico|francos suíços|francos suicos|sfr|chf"], ["Rappen suíço", "rappen suíço|rappen suico|rappens suíços|rappens suicos"], ["Dólar surinamês", "dólar surinamês|dolar surinames|dólar do Suriname|dolar do Suriname|dólares surinameses|dolares surinameses|dólares do Suriname|dolares do Suriname|srd"], ["Centavo surinamês", "centavo surinamês|centavo surinames|centavos surinameses"], ["Baht tailandês", "baht tailandês|bath tailandes|baht tailandeses|thb"], ["Satang tailandês", "satang tailandês|satang tailandes|satang tailandeses"], ["Novo dólar taiwanês", "novo dólar taiwanês|novo dolar taiwanes|dólar taiwanês|dolar taiwanes|dólares taiwaneses|dolares taiwaneses|twd"], ["Centavo taiwanês", "centavo taiwanês|centavo taiwanes|centavos taiwaneses"], ["Xelim tanzaniano", "xelim tanzaniano|xelins tanzanianos|tzs"], ["Centavo tanzaniano", "centavo tanzaniano|centavos tanzanianos"], ["Somoni tajique", "somoni tajique|somoni|somonis tajiques|somonis|tjs"], ["Diram tajique", "diram tajique|dirams tajiques|dirames tajiques"], ["Paʻanga", "paanga|paangas|paʻanga|pa'anga|top"], ["Seniti", "seniti"], ["Rublo transdniestriano", "rublo transdniestriano|rublos transdniestriano"], ["Copeque transdniestriano", "copeque transdniestriano|copeques transdniestriano"], ["Dólar de Trinidade e Tobago", "dólar de trinidade e tobago|dólares trinidade e tobago|dolar de trinidade e tobago|dolares trinidade e tobago|dólar de trinidad e tobago|dólares trinidad e tobago|ttd"], ["Centavo de Trinidade e Tobago", "centavo de trinidade e tobago|centavos de trinidade e tobago|centavo de trinidad e tobago|centavos de trinidad e tobago"], ["Dinar tunisiano", "dinar tunisiano|dinares tunisianos|dinar tunisino|dinares tunisinos|tnd"], ["Milim tunisiano", "milim tunisiano|milim tunesianos|millime tunisianos|millimes tunisianos|milim tunisino|milim tunisinos|millime tunisinos|millimes tunisinos"], ["Lira turca", "lira turca|liras turcas|try"], ["Kuruş turco", "kuruş turco|kuruş turcos"], ["Manat turcomeno", "manat turcomeno|manats turcomenos|tmt"], ["Tennesi turcomeno", "tennesi turcomeno|tennesis turcomenos|tenge turcomenos|tenges turcomenos"], ["Dólar tuvaluano", "dólar tuvaluano|dolar tuvaluano|dólares tuvaluanos|dolares tuvaluanos"], ["Centavo tuvaluano", "centavo tuvaluano|centavos tuvaluanos"], ["Grívnia", "grívnia|grivnia|grívnias|grivnias|grivna|grivnas|uah"], ["Copeque ucraniano", "kopiyka|copeque ucraniano|copeques ucranianos"], ["Xelim ugandês", "xelim ugandês|xelim ugandes|xelins ugandeses|ugx"], ["Centavo ugandês", "centavo ugandês|centavo ugandes|centavos ugandeses"], ["Peso uruguaio", "peso uruguaio|pesos uruguayis|uyu"], ["Centésimo uruguayo", "centésimo uruguaio|centesimo uruguaio|centésimos uruguaios|centesimos uruguaios"], ["Som uzbeque", "som uzbeque|som uzbeques|soms uzbeques|somes uzbeques|som usbeque|som usbeques|soms usbeques|somes usbeques|uzs"], ["Tiyin uzbeque", "tiyin uzbeque|tiyin uzbeques|tiyins uzbeques|tiyin usbeque|tiyin usbeques|tiyins usbeques"], ["Vatu", "vatu|vatus|vuv"], ["Bolívar forte venezuelano", "bolívar forte|bolivar forte|bolívar|bolivar|bolívares|bolivares|vef"], ["Centavo de bolívar", "cêntimo de bolívar|cêntimos de bolívar|centavo de bolívar|centavo de bolivar|centavos de bolívar|centavos de bolivar"], ["Dongue vietnamita", "dongue vietnamita|Đồng vietnamita|dong vietnamita|dongues vietnamitas|dongs vietnamitas|vnd"], ["Hào vietnamita", "hào vietnamita|hao vietnamita|hào vietnamitas|hàos vietnamitas|haos vietnamitas"], ["Rial iemenita", "rial iemenita|riais iemenitas|yer"], ["Fils iemenita", "fils iemenita|fils iemenitas"], ["Franco djibutiano", "franco djibutiano|francos djibutianos|franco jibutiano|francos jibutianos|djf"], ["Dinar iugoslavo", "dinar iugoslavo|dinares iugoslavos|dinar jugoslavo|dinares jugoslavos|yud"], ["Kwacha zambiano", "kwacha zambiano|kwacha zambianos|kwachas zambianos|zmw"], ["Ngwee zambiano", "ngwee zambiano|ngwee zambianos|ngwees zambianos"]]); + PortugueseNumericWithUnit.CompoundUnitConnectorRegex = `(?[^.])`; + PortugueseNumericWithUnit.CurrencyPrefixList = new Map([["Dólar", "$"], ["Dólar estadunidense", "us$|u$d|usd"], ["Dólar do Caribe Oriental", "ec$|xcd"], ["Dólar australiano", "a$|aud"], ["Dólar bahamense", "b$|bsd"], ["Dólar de Barbados", "bds$|bbd"], ["Dólar de Belizebe", "bz$|bzd"], ["Dólar bermudense", "bd$|bmd"], ["Dólar de Brunebi", "brunéi $|bnd"], ["Dólar de Cingapura", "s$|sgd"], ["Dólar canadense", "c$|can$|cad"], ["Dólar das Ilhas Cayman", "ci$|kyd"], ["Dólar neozelandês", "nz$|nzd"], ["Dólar fijgiano", "fj$|fjd"], ["Dólar guianense", "gy$|gyd"], ["Dólar de Hong Kong", "hk$|hkd"], ["Dólar jamaicano", "j$|ja$|jmd"], ["Dólar liberiano", "l$|lrd"], ["Dólar namibiano", "n$|nad"], ["Dólar das Ilhas Salomão", "si$|sbd"], ["Novo dólar taiwanês", "nt$|twd"], ["Real brasileiro", "r$|brl"], ["Guarani", "₲|gs.|pyg"], ["Dólar de Trinidade e Tobago", "tt$|ttd"], ["Yuan chinês", "¥|cny|rmb"], ["Yen", "¥|jpy"], ["Euro", "€|eur"], ["Florim", "ƒ"], ["Libra", "£|gbp"], ["Colón costarriquenho", "₡"], ["Lira turca", "₺"]]); + PortugueseNumericWithUnit.AmbiguousCurrencyUnitList = ['le']; + PortugueseNumericWithUnit.InformationSuffixList = new Map([["bit", "bit|bits"], ["kilobit", "kilobit|kilobits|kb|kbit"], ["megabit", "megabit|megabits|Mb|Mbit"], ["gigabit", "gigabit|gigabits|Gb|Gbit"], ["terabit", "terabit|terabits|Tb|Tbit"], ["petabit", "petabit|petabits|Pb|Pbit"], ["kibibit", "kibibit|kibibits|kib|kibit"], ["mebibit", "mebibit|mebibits|Mib|Mibit"], ["gibibit", "gibibit|gibibits|Gib|Gibit"], ["tebibit", "tebibit|tebibits|Tib|Tibit"], ["pebibit", "pebibit|pebibits|Pib|Pibit"], ["byte", "byte|bytes"], ["kilobyte", "kilobyte|kilobytes|kB|kByte"], ["megabyte", "megabyte|megabytes|MB|MByte"], ["gigabyte", "gigabyte|gigabytes|GB|GByte"], ["terabyte", "terabyte|terabytes|TB|TByte"], ["petabyte", "petabyte|petabytes|PB|PByte"], ["kibibyte", "kibibyte|kibibytes|kiB|kiByte"], ["mebibyte", "mebibyte|mebibytes|MiB|MiByte"], ["gibibyte", "gibibyte|gibibytes|GiB|GiByte"], ["tebibyte", "tebibyte|tebibytes|TiB|TiByte"], ["pebibyte", "pebibyte|pebibytes|PiB|PiByte"]]); + PortugueseNumericWithUnit.AmbiguousDimensionUnitList = ['ton', 'tonelada', 'área', 'area', 'áreas', 'areas', 'milha', 'milhas']; + PortugueseNumericWithUnit.BuildPrefix = `(?<=(\\s|^|\\P{L}))`; + PortugueseNumericWithUnit.BuildSuffix = `(?=(\\s|\\P{L}|$))`; + PortugueseNumericWithUnit.ConnectorToken = 'de'; + PortugueseNumericWithUnit.LengthSuffixList = new Map([["Quilômetro", "km|quilometro|quilômetro|quilómetro|quilometros|quilômetros|quilómetros"], ["Hectômetro", "hm|hectometro|hectômetro|hectómetro|hectometros|hectômetros|hectómetros"], ["Decâmetro", "decametro|decâmetro|decámetro|decametros|decâmetro|decámetros|dam"], ["Metro", "m|m.|metro|metros"], ["Decímetro", "dm|decimetro|decímetro|decimetros|decímetros"], ["Centímetro", "cm|centimetro|centímetro|centimetros|centimetros"], ["Milímetro", "mm|milimetro|milímetro|milimetros|milímetros"], ["Micrômetro", "µm|um|micrometro|micrômetro|micrómetro|micrometros|micrômetros|micrómetros|micron|mícron|microns|mícrons|micra"], ["Nanômetro", "nm|nanometro|nanômetro|nanómetro|nanometros|nanômetros|nanómetros|milimicron|milimícron|milimicrons|milimícrons"], ["Picômetro", "pm|picometro|picômetro|picómetro|picometros|picômetros|picómetros"], ["Milha", "mi|milha|milhas"], ["Jarda", "yd|jarda|jardas"], ["Polegada", "polegada|polegadas|\""], ["Pé", "pé|pe|pés|pes|ft"], ["Ano luz", "ano luz|anos luz|al"]]); + PortugueseNumericWithUnit.AmbiguousLengthUnitList = ['mi', 'milha', 'milhas']; + PortugueseNumericWithUnit.SpeedSuffixList = new Map([["Metro por segundo", "metro/segundo|m/s|metro por segundo|metros por segundo|metros por segundos"], ["Quilômetro por hora", "km/h|quilômetro por hora|quilómetro por hora|quilometro por hora|quilômetros por hora|quilómetros por hora|quilometros por hora|quilômetro/hora|quilómetro/hora|quilometro/hora|quilômetros/hora|quilómetros/hora|quilometros/hora"], ["Quilômetro por minuto", "km/min|quilômetro por minuto|quilómetro por minuto|quilometro por minuto|quilômetros por minuto|quilómetros por minuto|quilometros por minuto|quilômetro/minuto|quilómetro/minuto|quilometro/minuto|quilômetros/minuto|quilómetros/minuto|quilometros/minuto"], ["Quilômetro por segundo", "km/seg|quilômetro por segundo|quilómetro por segundo|quilometro por segundo|quilômetros por segundo|quilómetros por segundo|quilometros por segundo|quilômetro/segundo|quilómetro/segundo|quilometro/segundo|quilômetros/segundo|quilómetros/segundo|quilometros/segundo"], ["Milha por hora", "mph|milha por hora|mi/h|milha/hora|milhas/hora|milhas por hora"], ["Nó", "kt|nó|nós|kn"], ["Pé por segundo", "ft/s|pé/s|pe/s|ft/seg|pé/seg|pe/seg|pé por segundo|pe por segundo|pés por segundo|pes por segundo"], ["Pé por minuto", "ft/min|pé/mind|pe/min|pé por minuto|pe por minuto|pés por minuto|pes por minuto"], ["Jarda por minuto", "jardas por minuto|jardas/minuto|jardas/min"], ["Jarda por segundo", "jardas por segundo|jardas/segundo|jardas/seg"]]); + PortugueseNumericWithUnit.AmbiguousSpeedUnitList = ['nó', 'no', 'nós', 'nos']; + PortugueseNumericWithUnit.TemperatureSuffixList = new Map([["Kelvin", "k|kelvin"], ["Grau Rankine", "r|°r|°ra|grau rankine|graus rankine| rankine"], ["Grau Celsius", "°c|grau c|grau celsius|graus c|graus celsius|celsius|grau centígrado|grau centrigrado|graus centígrados|graus centigrados|centígrado|centígrados|centigrado|centigrados"], ["Grau Fahrenheit", "°f|grau f|graus f|grau fahrenheit|graus fahrenheit|fahrenheit"], ["Grau", "°|graus|grau"]]); + PortugueseNumericWithUnit.VolumeSuffixList = new Map([["Quilômetro cúbico", "quilômetro cúbico|quilómetro cúbico|quilometro cubico|quilômetros cúbicos|quilómetros cúbicos|quilometros cubicos|km3|km^3|km³"], ["Hectômetro cúbico", "hectômetro cúbico|hectómetro cúbico|hectometro cubico|hectômetros cúbicos|hectómetros cúbicos|hectometros cubicos|hm3|hm^3|hm³"], ["Decâmetro cúbico", "decâmetro cúbico|decámetro cúbico|decametro cubico|decâmetros cúbicos|decámetros cúbicos|decametros cubicosdam3|dam^3|dam³"], ["Metro cúbico", "metro cúbico|metro cubico|metros cúbicos|metros cubicos|m3|m^3|m³"], ["Decímetro cúbico", "decímetro cúbico|decimetro cubico|decímetros cúbicos|decimetros cubicos|dm3|dm^3|dm³"], ["Centímetro cúbico", "centímetro cúbico|centimetro cubico|centímetros cúbicos|centrimetros cubicos|cc|cm3|cm^3|cm³"], ["Milímetro cúbico", "milímetro cúbico|milimetro cubico|milímetros cúbicos|milimetros cubicos|mm3|mm^3|mm³"], ["Polegada cúbica", "polegada cúbica|polegada cubica|polegadas cúbicas|polegadas cubicas"], ["Pé cúbico", "pé cúbico|pe cubico|pés cúbicos|pes cubicos|pé3|pe3|pé^3|pe^3|pé³|pe³|ft3|ft^3|ft³"], ["Jarda cúbica", "jarda cúbica|jarda cubica|jardas cúbicas|jardas cubicas|yd3|yd^3|yd³"], ["Hectolitro", "hectolitro|hectolitros|hl"], ["Litro", "litro|litros|lts|l"], ["Mililitro", "mililitro|mililitros|ml"], ["Galão", "galão|galões|galao|galoes"], ["Pint", "pinta|pintas|pinto|pintos|quartilho|quartilhos|pint|pints"], ["Barril", "barril|barris|bbl"], ["Onça líquida", "onça líquida|onca liquida|onças líquidas|oncas liquidas"]]); + PortugueseNumericWithUnit.WeightSuffixList = new Map([["Tonelada métrica", "tonelada métrica|tonelada metrica|toneladas métricas|toneladas metricas"], ["Tonelada", "ton|tonelada|toneladas"], ["Quilograma", "kg|quilograma|quilogramas|quilo|quilos|kilo|kilos"], ["Hectograma", "hg|hectograma|hectogramas"], ["Decagrama", "dag|decagrama|decagramas"], ["Grama", "g|gr|grama|gramas"], ["Decigrama", "dg|decigrama|decigramas"], ["Centigrama", "cg|centigrama|centigramas"], ["Miligrama", "mg|miligrama|miligramas"], ["Micrograma", "µg|ug|micrograma|microgramas"], ["Nanograma", "ng|nanograma|nanogramas"], ["Picograma", "pg|picograma|picogramas"], ["Libra", "lb|libra|libras"], ["Onça", "oz|onça|onca|onças|oncas"], ["Grão", "grão|grao|grãos|graos|gr"], ["Quilate", "ct|kt|quilate|quilates"]]); +})(PortugueseNumericWithUnit = exports.PortugueseNumericWithUnit || (exports.PortugueseNumericWithUnit = {})); + +}); + +unwrapExports(portugueseNumericWithUnit); + +var base$4 = createCommonjsModule(function (module, exports) { +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); + + + + + +class PortugueseNumberWithUnitExtractorConfiguration { + constructor(ci) { + this.cultureInfo = ci; + this.unitNumExtractor = new recognizersTextNumber.PortugueseNumberExtractor(); + this.buildPrefix = portugueseNumericWithUnit.PortugueseNumericWithUnit.BuildPrefix; + this.buildSuffix = portugueseNumericWithUnit.PortugueseNumericWithUnit.BuildSuffix; + this.connectorToken = portugueseNumericWithUnit.PortugueseNumericWithUnit.ConnectorToken; + this.compoundUnitConnectorRegex = recognizersText.RegExpUtility.getSafeRegExp(portugueseNumericWithUnit.PortugueseNumericWithUnit.CompoundUnitConnectorRegex); + this.pmNonUnitRegex = recognizersText.RegExpUtility.getSafeRegExp(baseUnits.BaseUnits.PmNonUnitRegex); + } +} +exports.PortugueseNumberWithUnitExtractorConfiguration = PortugueseNumberWithUnitExtractorConfiguration; +class PortugueseNumberWithUnitParserConfiguration extends parsers$8.BaseNumberWithUnitParserConfiguration { + constructor(ci) { + super(ci); + this.internalNumberExtractor = new recognizersTextNumber.PortugueseNumberExtractor(recognizersTextNumber.NumberMode.Default); + this.internalNumberParser = recognizersTextNumber.AgnosticNumberParserFactory.getParser(recognizersTextNumber.AgnosticNumberParserType.Number, new recognizersTextNumber.PortugueseNumberParserConfiguration()); + this.connectorToken = portugueseNumericWithUnit.PortugueseNumericWithUnit.ConnectorToken; + } +} +exports.PortugueseNumberWithUnitParserConfiguration = PortugueseNumberWithUnitParserConfiguration; + +}); + +unwrapExports(base$4); + +var currency$4 = createCommonjsModule(function (module, exports) { +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); + + + + +class PortugueseCurrencyExtractorConfiguration extends base$4.PortugueseNumberWithUnitExtractorConfiguration { + constructor(ci) { + if (!ci) { + ci = new recognizersTextNumber.CultureInfo(recognizersTextNumber.Culture.Portuguese); + } + super(ci); + this.extractType = constants$4.Constants.SYS_UNIT_CURRENCY; + // Reference Source: https:// en.wikipedia.org/wiki/List_of_circulating_currencies + this.suffixList = portugueseNumericWithUnit.PortugueseNumericWithUnit.CurrencySuffixList; + this.prefixList = portugueseNumericWithUnit.PortugueseNumericWithUnit.CurrencyPrefixList; + this.ambiguousUnitList = portugueseNumericWithUnit.PortugueseNumericWithUnit.AmbiguousCurrencyUnitList; + } +} +exports.PortugueseCurrencyExtractorConfiguration = PortugueseCurrencyExtractorConfiguration; +class PortugueseCurrencyParserConfiguration extends base$4.PortugueseNumberWithUnitParserConfiguration { + constructor(ci) { + if (!ci) { + ci = new recognizersTextNumber.CultureInfo(recognizersTextNumber.Culture.Portuguese); + } + super(ci); + this.BindDictionary(portugueseNumericWithUnit.PortugueseNumericWithUnit.CurrencySuffixList); + this.BindDictionary(portugueseNumericWithUnit.PortugueseNumericWithUnit.CurrencyPrefixList); + } +} +exports.PortugueseCurrencyParserConfiguration = PortugueseCurrencyParserConfiguration; + +}); + +unwrapExports(currency$4); + +var temperature$4 = createCommonjsModule(function (module, exports) { +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); + + + + +class PortugueseTemperatureExtractorConfiguration extends base$4.PortugueseNumberWithUnitExtractorConfiguration { + constructor(ci) { + if (!ci) { + ci = new recognizersTextNumber.CultureInfo(recognizersTextNumber.Culture.Portuguese); + } + super(ci); + this.extractType = constants$4.Constants.SYS_UNIT_TEMPERATURE; + this.suffixList = portugueseNumericWithUnit.PortugueseNumericWithUnit.TemperatureSuffixList; + this.prefixList = new Map(); + this.ambiguousUnitList = new Array(); + } +} +exports.PortugueseTemperatureExtractorConfiguration = PortugueseTemperatureExtractorConfiguration; +class PortugueseTemperatureParserConfiguration extends base$4.PortugueseNumberWithUnitParserConfiguration { + constructor(ci) { + if (!ci) { + ci = new recognizersTextNumber.CultureInfo(recognizersTextNumber.Culture.Portuguese); + } + super(ci); + this.BindDictionary(portugueseNumericWithUnit.PortugueseNumericWithUnit.TemperatureSuffixList); + } +} +exports.PortugueseTemperatureParserConfiguration = PortugueseTemperatureParserConfiguration; + +}); + +unwrapExports(temperature$4); + +var dimension$4 = createCommonjsModule(function (module, exports) { +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); + + + + +const dimensionSuffixList = new Map([ + ...portugueseNumericWithUnit.PortugueseNumericWithUnit.InformationSuffixList, + ...portugueseNumericWithUnit.PortugueseNumericWithUnit.AreaSuffixList, + ...portugueseNumericWithUnit.PortugueseNumericWithUnit.LengthSuffixList, + ...portugueseNumericWithUnit.PortugueseNumericWithUnit.SpeedSuffixList, + ...portugueseNumericWithUnit.PortugueseNumericWithUnit.VolumeSuffixList, + ...portugueseNumericWithUnit.PortugueseNumericWithUnit.WeightSuffixList +]); +class PortugueseDimensionExtractorConfiguration extends base$4.PortugueseNumberWithUnitExtractorConfiguration { + constructor(ci) { + if (!ci) { + ci = new recognizersTextNumber.CultureInfo(recognizersTextNumber.Culture.Portuguese); + } + super(ci); + this.extractType = constants$4.Constants.SYS_UNIT_DIMENSION; + this.suffixList = dimensionSuffixList; + this.prefixList = new Map(); + this.ambiguousUnitList = portugueseNumericWithUnit.PortugueseNumericWithUnit.AmbiguousDimensionUnitList; + } +} +exports.PortugueseDimensionExtractorConfiguration = PortugueseDimensionExtractorConfiguration; +class PortugueseDimensionParserConfiguration extends base$4.PortugueseNumberWithUnitParserConfiguration { + constructor(ci) { + if (!ci) { + ci = new recognizersTextNumber.CultureInfo(recognizersTextNumber.Culture.Portuguese); + } + super(ci); + this.BindDictionary(dimensionSuffixList); + } +} +exports.PortugueseDimensionParserConfiguration = PortugueseDimensionParserConfiguration; + +}); + +unwrapExports(dimension$4); + +var age$4 = createCommonjsModule(function (module, exports) { +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); + + + + +class PortugueseAgeExtractorConfiguration extends base$4.PortugueseNumberWithUnitExtractorConfiguration { + constructor(ci) { + if (!ci) { + ci = new recognizersTextNumber.CultureInfo(recognizersTextNumber.Culture.Portuguese); + } + super(ci); + this.extractType = constants$4.Constants.SYS_UNIT_AGE; + this.suffixList = portugueseNumericWithUnit.PortugueseNumericWithUnit.AgeSuffixList; + this.prefixList = new Map(); + this.ambiguousUnitList = new Array(); + } +} +exports.PortugueseAgeExtractorConfiguration = PortugueseAgeExtractorConfiguration; +class PortugueseAgeParserConfiguration extends base$4.PortugueseNumberWithUnitParserConfiguration { + constructor(ci) { + if (!ci) { + ci = new recognizersTextNumber.CultureInfo(recognizersTextNumber.Culture.Portuguese); + } + super(ci); + this.BindDictionary(portugueseNumericWithUnit.PortugueseNumericWithUnit.AgeSuffixList); + } +} +exports.PortugueseAgeParserConfiguration = PortugueseAgeParserConfiguration; + +}); + +unwrapExports(age$4); + +var chineseNumericWithUnit = createCommonjsModule(function (module, exports) { +"use strict"; +// ------------------------------------------------------------------------------ +// +// This code was generated by a tool. +// Changes to this file may cause incorrect behavior and will be lost if +// the code is regenerated. +// +// ------------------------------------------------------------------------------ +Object.defineProperty(exports, "__esModule", { value: true }); +var ChineseNumericWithUnit; +(function (ChineseNumericWithUnit) { + ChineseNumericWithUnit.AgeAmbiguousValues = ['岁']; + ChineseNumericWithUnit.AgeSuffixList = new Map([["Year", "岁|周岁"], ["Month", "个月大|月大"], ["Week", "周大"], ["Day", "天大"]]); + ChineseNumericWithUnit.BuildPrefix = ''; + ChineseNumericWithUnit.BuildSuffix = ''; + ChineseNumericWithUnit.ConnectorToken = ''; + ChineseNumericWithUnit.CurrencySuffixList = new Map([["Afghan afghani", "阿富汗尼"], ["Pul", "普尔"], ["Euro", "欧元"], ["Cent", "美分"], ["Albanian lek", "阿尔巴尼亚列克|列克"], ["Angolan kwanza", "安哥拉宽扎|宽扎"], ["Armenian dram", "亚美尼亚德拉姆"], ["Aruban florin", "阿鲁巴弗罗林|阿鲁巴币"], ["Bangladeshi taka", "塔卡|孟加拉塔卡"], ["Paisa", "派萨|帕萨"], ["Bhutanese ngultrum", "不丹努尔特鲁姆|不丹努扎姆|努扎姆"], ["Chetrum", "切特鲁姆"], ["Bolivian boliviano", "玻利维亚诺|玻利维亚币"], ["Bosnia and Herzegovina convertible mark", "波斯尼亚和黑塞哥维那可兑换马克|波赫可兑换马克"], ["Botswana pula", "博茨瓦纳普拉|普拉"], ["Thebe", "thebe"], ["Brazilian real", "巴西雷亚尔"], ["Bulgarian lev", "保加利亚列弗|保加利亚列瓦"], ["Stotinka", "斯托丁卡"], ["Cambodian riel", "瑞尔"], ["Cape Verdean escudo", "佛得角埃斯库多|维德角埃斯库多"], ["Croatian kuna", "克罗地亚库纳|克罗地亚库那|克罗埃西亚库纳"], ["Lipa", "利巴"], ["Eritrean nakfa", "厄立特里亚纳克法"], ["Ethiopian birr", "埃塞俄比亚比尔|埃塞俄比亚元"], ["Gambian dalasi", "冈比亚达拉西|甘比亚达拉西"], ["Butut", "布达|布图"], ["Georgian lari", "格鲁吉亚拉里"], ["Tetri", "特特里|泰特里"], ["Ghanaian cedi", "塞地|加纳塞地"], ["Pesewa", "比塞瓦"], ["Guatemalan quetzal", "瓜地马拉格查尔"], ["Haitian gourde", "海地古德"], ["Honduran lempira", "洪都拉斯伦皮拉"], ["Hungarian forint", "匈牙利福林|匈牙利货币|匈牙利福林币"], ["Iranian rial", "伊朗里亚尔|伊朗莱尔"], ["Yemeni rial", "叶门莱尔|叶门里亚尔"], ["Israeli new shekel", "₪|ils|以色列币|以色列新克尔|谢克尔"], ["Japanese yen", "日元|日本元|日币|日圆"], ["Sen", "日本銭"], ["Kazakhstani tenge", "哈萨克斯坦坚戈"], ["Kenyan shilling", "肯尼亚先令"], ["North Korean won", "朝鲜圆|朝鲜元"], ["South Korean won", "韩元|韩圆"], ["Korean won", "₩"], ["Kyrgyzstani som", "吉尔吉斯斯坦索姆"], ["Lao kip", "基普|老挝基普|老挝币"], ["Att", "att"], ["Lesotho loti", "莱索托洛提|莱索托马洛蒂"], ["South African rand", "南非兰特"], ["Macedonian denar", "马其顿代纳尔|马其顿币|第纳尔|代纳尔"], ["Deni", "第尼"], ["Malagasy ariary", "马达加斯加阿里亚里"], ["Iraimbilanja", "伊莱姆比拉贾"], ["Malawian kwacha", "马拉威克瓦查"], ["Tambala", "坦巴拉"], ["Malaysian ringgit", "马来西亚币|马币|马来西亚林吉特"], ["Mauritanian ouguiya", "毛里塔尼亚乌吉亚"], ["Khoums", "库姆斯"], ["Mozambican metical", "莫桑比克梅蒂卡尔|梅蒂卡尔"], ["Burmese kyat", "缅甸元|缅元"], ["Pya", "缅分"], ["Nigerian naira", "尼日利亚奈拉|尼日利亚币|奈拉"], ["Kobo", "考包"], ["Turkish lira", "土耳其里拉"], ["Kuruş", "库鲁"], ["Omani rial", "阿曼里亚尔|阿曼莱尔"], ["Panamanian balboa", "巴拿马巴波亚"], ["Centesimo", "意大利分|乌拉圭分|巴拿马分"], ["Papua New Guinean kina", "基那"], ["Toea", "托亚|托伊"], ["Peruvian sol", "秘鲁索尔"], ["Polish złoty", "波兰币|波兰兹罗提|兹罗提"], ["Grosz", "格罗希"], ["Qatari riyal", "卡达里亚尔"], ["Saudi riyal", "沙特里亚尔"], ["Riyal", "里亚尔|"], ["Dirham", "迪拉姆"], ["Halala", "哈拉"], ["Samoan tālā", "萨摩亚塔拉"], ["Sierra Leonean leone", "塞拉利昂利昂|利昂"], ["Peseta", "比塞塔|西班牙比塞塔|西班牙币"], ["Swazi lilangeni", "斯威士兰里兰吉尼|兰吉尼"], ["Tajikistani somoni", "塔吉克斯坦索莫尼"], ["Thai baht", "泰铢|泰元"], ["Satang", "萨当"], ["Tongan paʻanga", "汤加潘加|潘加"], ["Ukrainian hryvnia", "乌克兰格里夫纳|格里夫纳"], ["Vanuatu vatu", "瓦努阿图瓦图"], ["Vietnamese dong", "越南盾"], ["Indonesian rupiah", "印度尼西亚盾"], ["Netherlands guilder", "荷兰盾|荷属安的列斯盾|列斯盾"], ["Surinam florin", "苏里南盾"], ["Guilder", "盾"], ["Zambian kwacha", "赞比亚克瓦查"], ["Moroccan dirham", "摩洛哥迪拉姆"], ["United Arab Emirates dirham", "阿联酋迪拉姆"], ["Azerbaijani manat", "阿塞拜疆马纳特"], ["Turkmenistan manat", "土库曼马纳特"], ["Manat", "马纳特"], ["Somali shilling", "索马里先令|索马利先令"], ["Somaliland shilling", "索马里兰先令"], ["Tanzanian shilling", "坦桑尼亚先令"], ["Ugandan shilling", "乌干达先令"], ["Romanian leu", "罗马尼亚列伊"], ["Moldovan leu", "摩尔多瓦列伊"], ["Leu", "列伊"], ["Ban", "巴尼"], ["Nepalese rupee", "尼泊尔卢比"], ["Pakistani rupee", "巴基斯坦卢比"], ["Indian rupee", "印度卢比"], ["Seychellois rupee", "塞舌尔卢比"], ["Mauritian rupee", "毛里求斯卢比"], ["Maldivian rufiyaa", "马尔代夫卢比"], ["Sri Lankan rupee", "斯里兰卡卢比"], ["Rupee", "卢比"], ["Czech koruna", "捷克克朗"], ["Danish krone", "丹麦克朗|丹麦克郎"], ["Norwegian krone", "挪威克朗"], ["Faroese króna", "法罗克朗"], ["Icelandic króna", "冰岛克朗"], ["Swedish krona", "瑞典克朗"], ["Krone", "克朗"], ["Øre", "奥依拉|奥拉|埃利"], ["West African CFA franc", "非共体法郎"], ["Central African CFA franc", "中非法郎|中非金融合作法郎"], ["Comorian franc", "科摩罗法郎"], ["Congolese franc", "刚果法郎"], ["Burundian franc", "布隆迪法郎"], ["Djiboutian franc", "吉布提法郎"], ["CFP franc", "太平洋法郎"], ["Guinean franc", "几内亚法郎"], ["Swiss franc", "瑞士法郎"], ["Rwandan franc", "卢旺达法郎"], ["Belgian franc", "比利时法郎"], ["Rappen", "瑞士分|瑞士生丁"], ["Franc", "法郎"], ["Centime", "生丁|仙士"], ["Russian ruble", "俄国卢布|俄罗斯卢布"], ["Transnistrian ruble", "德涅斯特卢布"], ["Belarusian ruble", "白俄罗斯卢布"], ["Kopek", "戈比"], ["Ruble", "卢布"], ["Algerian dinar", "阿尔及利亚第纳尔"], ["Bahraini dinar", "巴林第纳尔"], ["Iraqi dinar", "伊拉克第纳尔|"], ["Jordanian dinar", "约旦第纳尔"], ["Kuwaiti dinar", "科威特第纳尔|科威特币"], ["Libyan dinar", "利比亚第纳尔"], ["Serbian dinar", "塞尔维亚第纳尔|塞尔维亚币"], ["Tunisian dinar", "突尼斯第纳尔"], ["Dinar", "第纳尔"], ["Fils", "费尔"], ["Para", "帕拉"], ["Millime", "米利姆"], ["Argentine peso", "阿根廷比索"], ["Chilean peso", "智利比索"], ["Colombian peso", "哥伦比亚比索"], ["Cuban peso", "古巴比索"], ["Dominican peso", "多米尼加比索"], ["Mexican peso", "墨西哥比索"], ["Philippine peso", "菲律宾比索"], ["Uruguayan peso", "乌拉圭比索"], ["Peso", "比索"], ["Centavo", "仙|菲辅币"], ["Alderney pound", "奥尔德尼镑"], ["British pound", "英镑"], ["Guernsey pound", "根西镑"], ["Saint Helena pound", "圣赫勒拿镑"], ["Egyptian pound", "埃及镑"], ["Falkland Islands pound", "福克兰镑"], ["Gibraltar pound", "直布罗陀镑"], ["Manx pound", "马恩岛镑"], ["Jersey pound", "泽西岛镑"], ["Lebanese pound", "黎巴嫩镑"], ["South Sudanese pound", "南苏丹镑"], ["Sudanese pound", "苏丹镑"], ["Syrian pound", "叙利亚镑"], ["Pound", "英镑"], ["Pence", "便士"], ["Shilling", "先令"], ["United States dollar", "美元|美金|美圆"], ["East Caribbean dollar", "东加勒比元"], ["Australian dollar", "澳大利亚元|澳元"], ["Bahamian dollar", "巴哈马元"], ["Barbadian dollar", "巴巴多斯元"], ["Belize dollar", "伯利兹元"], ["Bermudian dollar", "百慕大元"], ["Brunei dollar", "文莱元"], ["Singapore dollar", "新加坡元|新元"], ["Canadian dollar", "加元|加拿大元"], ["Cayman Islands dollar", "开曼岛元|"], ["New Zealand dollar", "新西兰元|纽元"], ["Cook Islands dollar", "库克群岛元"], ["Fijian dollar", "斐济元|斐币"], ["Guyanese dollar", "圭亚那元"], ["Hong Kong dollar", "蚊|港元|港圆|港币"], ["Macau Pataca", "澳元|澳门币|澳门元"], ["New Taiwan dollar", "箍|新台币|台币"], ["Jamaican dollar", "牙买加元"], ["Kiribati dollar", "吉里巴斯元"], ["Liberian dollar", "利比里亚元"], ["Namibian dollar", "纳米比亚元"], ["Surinamese dollar", "苏里南元"], ["Trinidad and Tobago dollar", "特立尼达多巴哥元"], ["Tuvaluan dollar", "吐瓦鲁元"], ["Chinese yuan", "人民币|人民币元|块钱|块|元|圆"], ["Fen", "分钱|分"], ["Jiao", "毛钱|毛|角钱|角"], ["Finnish markka", "芬兰马克"], ["Penni", "盆尼"]]); + ChineseNumericWithUnit.CurrencyNameToIsoCodeMap = new Map([["Afghan afghani", "AFN"], ["Euro", "EUR"], ["Albanian lek", "ALL"], ["Angolan kwanza", "AOA"], ["Armenian dram", "AMD"], ["Aruban florin", "AWG"], ["Bangladeshi taka", "BDT"], ["Bhutanese ngultrum", "BTN"], ["Bolivian boliviano", "BOB"], ["Bosnia and Herzegovina convertible mark", "BAM"], ["Botswana pula", "BWP"], ["Brazilian real", "BRL"], ["Bulgarian lev", "BGN"], ["Cambodian riel", "KHR"], ["Cape Verdean escudo", "CVE"], ["Costa Rican colón", "CRC"], ["Croatian kuna", "HRK"], ["Czech koruna", "CZK"], ["Eritrean nakfa", "ERN"], ["Ethiopian birr", "ETB"], ["Gambian dalasi", "GMD"], ["Georgian lari", "GEL"], ["Ghanaian cedi", "GHS"], ["Guatemalan quetzal", "GTQ"], ["Haitian gourde", "HTG"], ["Honduran lempira", "HNL"], ["Hungarian forint", "HUF"], ["Iranian rial", "IRR"], ["Yemeni rial", "YER"], ["Israeli new shekel", "ILS"], ["Japanese yen", "JPY"], ["Kazakhstani tenge", "KZT"], ["Kenyan shilling", "KES"], ["North Korean won", "KPW"], ["South Korean won", "KRW"], ["Kyrgyzstani som", "KGS"], ["Lao kip", "LAK"], ["Lesotho loti", "LSL"], ["South African rand", "ZAR"], ["Macanese pataca", "MOP"], ["Macedonian denar", "MKD"], ["Malagasy ariary", "MGA"], ["Malawian kwacha", "MWK"], ["Malaysian ringgit", "MYR"], ["Mauritanian ouguiya", "MRO"], ["Mongolian tögrög", "MNT"], ["Mozambican metical", "MZN"], ["Burmese kyat", "MMK"], ["Nicaraguan córdoba", "NIO"], ["Nigerian naira", "NGN"], ["Turkish lira", "TRY"], ["Omani rial", "OMR"], ["Panamanian balboa", "PAB"], ["Papua New Guinean kina", "PGK"], ["Paraguayan guaraní", "PYG"], ["Peruvian sol", "PEN"], ["Polish złoty", "PLN"], ["Qatari riyal", "QAR"], ["Saudi riyal", "SAR"], ["Samoan tālā", "WST"], ["São Tomé and Príncipe dobra", "STD"], ["Sierra Leonean leone", "SLL"], ["Swazi lilangeni", "SZL"], ["Tajikistani somoni", "TJS"], ["Thai baht", "THB"], ["Ukrainian hryvnia", "UAH"], ["Vanuatu vatu", "VUV"], ["Venezuelan bolívar", "VEF"], ["Zambian kwacha", "ZMW"], ["Moroccan dirham", "MAD"], ["United Arab Emirates dirham", "AED"], ["Azerbaijani manat", "AZN"], ["Turkmenistan manat", "TMT"], ["Somali shilling", "SOS"], ["Tanzanian shilling", "TZS"], ["Ugandan shilling", "UGX"], ["Romanian leu", "RON"], ["Moldovan leu", "MDL"], ["Nepalese rupee", "NPR"], ["Pakistani rupee", "PKR"], ["Indian rupee", "INR"], ["Seychellois rupee", "SCR"], ["Mauritian rupee", "MUR"], ["Maldivian rufiyaa", "MVR"], ["Sri Lankan rupee", "LKR"], ["Indonesian rupiah", "IDR"], ["Danish krone", "DKK"], ["Norwegian krone", "NOK"], ["Icelandic króna", "ISK"], ["Swedish krona", "SEK"], ["West African CFA franc", "XOF"], ["Central African CFA franc", "XAF"], ["Comorian franc", "KMF"], ["Congolese franc", "CDF"], ["Burundian franc", "BIF"], ["Djiboutian franc", "DJF"], ["CFP franc", "XPF"], ["Guinean franc", "GNF"], ["Swiss franc", "CHF"], ["Rwandan franc", "RWF"], ["Russian ruble", "RUB"], ["Transnistrian ruble", "PRB"], ["Belarusian ruble", "BYN"], ["Algerian dinar", "DZD"], ["Bahraini dinar", "BHD"], ["Iraqi dinar", "IQD"], ["Jordanian dinar", "JOD"], ["Kuwaiti dinar", "KWD"], ["Libyan dinar", "LYD"], ["Serbian dinar", "RSD"], ["Tunisian dinar", "TND"], ["Argentine peso", "ARS"], ["Chilean peso", "CLP"], ["Colombian peso", "COP"], ["Cuban convertible peso", "CUC"], ["Cuban peso", "CUP"], ["Dominican peso", "DOP"], ["Mexican peso", "MXN"], ["Uruguayan peso", "UYU"], ["British pound", "GBP"], ["Saint Helena pound", "SHP"], ["Egyptian pound", "EGP"], ["Falkland Islands pound", "FKP"], ["Gibraltar pound", "GIP"], ["Manx pound", "IMP"], ["Jersey pound", "JEP"], ["Lebanese pound", "LBP"], ["South Sudanese pound", "SSP"], ["Sudanese pound", "SDG"], ["Syrian pound", "SYP"], ["United States dollar", "USD"], ["Australian dollar", "AUD"], ["Bahamian dollar", "BSD"], ["Barbadian dollar", "BBD"], ["Belize dollar", "BZD"], ["Bermudian dollar", "BMD"], ["Brunei dollar", "BND"], ["Singapore dollar", "SGD"], ["Canadian dollar", "CAD"], ["Cayman Islands dollar", "KYD"], ["New Zealand dollar", "NZD"], ["Fijian dollar", "FJD"], ["Guyanese dollar", "GYD"], ["Hong Kong dollar", "HKD"], ["Jamaican dollar", "JMD"], ["Liberian dollar", "LRD"], ["Namibian dollar", "NAD"], ["Solomon Islands dollar", "SBD"], ["Surinamese dollar", "SRD"], ["New Taiwan dollar", "TWD"], ["Trinidad and Tobago dollar", "TTD"], ["Tuvaluan dollar", "TVD"], ["Chinese yuan", "CNY"], ["Rial", "__RI"], ["Shiling", "__S"], ["Som", "__SO"], ["Dirham", "__DR"], ["Dinar", "_DN"], ["Dollar", "__D"], ["Manat", "__MA"], ["Rupee", "__R"], ["Krone", "__K"], ["Krona", "__K"], ["Crown", "__K"], ["Frank", "__F"], ["Mark", "__M"], ["Ruble", "__RB"], ["Peso", "__PE"], ["Pound", "__P"], ["Tristan da Cunha pound", "_TP"], ["South Georgia and the South Sandwich Islands pound", "_SP"], ["Somaliland shilling", "_SS"], ["Pitcairn Islands dollar", "_PND"], ["Palauan dollar", "_PD"], ["Niue dollar", "_NID"], ["Nauruan dollar", "_ND"], ["Micronesian dollar", "_MD"], ["Kiribati dollar", "_KID"], ["Guernsey pound", "_GGP"], ["Faroese króna", "_FOK"], ["Cook Islands dollar", "_CKD"], ["British Virgin Islands dollar", "_BD"], ["Ascension pound", "_AP"], ["Alderney pound", "_ALP"], ["Abkhazian apsar", "_AA"]]); + ChineseNumericWithUnit.FractionalUnitNameToCodeMap = new Map([["Jiao", "JIAO"], ["Kopek", "KOPEK"], ["Pul", "PUL"], ["Cent", "CENT"], ["Qindarkë", "QINDARKE"], ["Penny", "PENNY"], ["Santeem", "SANTEEM"], ["Cêntimo", "CENTIMO"], ["Centavo", "CENTAVO"], ["Luma", "LUMA"], ["Qəpik", "QƏPIK"], ["Fils", "FILS"], ["Poisha", "POISHA"], ["Kapyeyka", "KAPYEYKA"], ["Centime", "CENTIME"], ["Chetrum", "CHETRUM"], ["Paisa", "PAISA"], ["Fening", "FENING"], ["Thebe", "THEBE"], ["Sen", "SEN"], ["Stotinka", "STOTINKA"], ["Fen", "FEN"], ["Céntimo", "CENTIMO"], ["Lipa", "LIPA"], ["Haléř", "HALER"], ["Øre", "ØRE"], ["Piastre", "PIASTRE"], ["Santim", "SANTIM"], ["Oyra", "OYRA"], ["Butut", "BUTUT"], ["Tetri", "TETRI"], ["Pesewa", "PESEWA"], ["Fillér", "FILLER"], ["Eyrir", "EYRIR"], ["Dinar", "DINAR"], ["Agora", "AGORA"], ["Tïın", "TIIN"], ["Chon", "CHON"], ["Jeon", "JEON"], ["Tyiyn", "TYIYN"], ["Att", "ATT"], ["Sente", "SENTE"], ["Dirham", "DIRHAM"], ["Rappen", "RAPPEN"], ["Avo", "AVO"], ["Deni", "DENI"], ["Iraimbilanja", "IRAIMBILANJA"], ["Tambala", "TAMBALA"], ["Laari", "LAARI"], ["Khoums", "KHOUMS"], ["Ban", "BAN"], ["Möngö", "MONGO"], ["Pya", "PYA"], ["Kobo", "KOBO"], ["Kuruş", "KURUS"], ["Baisa", "BAISA"], ["Centésimo", "CENTESIMO"], ["Toea", "TOEA"], ["Sentimo", "SENTIMO"], ["Grosz", "GROSZ"], ["Sene", "SENE"], ["Halala", "HALALA"], ["Para", "PARA"], ["Öre", "ORE"], ["Diram", "DIRAM"], ["Satang", "SATANG"], ["Seniti", "SENITI"], ["Millime", "MILLIME"], ["Tennesi", "TENNESI"], ["Kopiyka", "KOPIYKA"], ["Tiyin", "TIYIN"], ["Hào", "HAO"], ["Ngwee", "NGWEE"]]); + ChineseNumericWithUnit.CompoundUnitConnectorRegex = `(?又|再)`; + ChineseNumericWithUnit.CurrencyPrefixList = new Map([["Dollar", "$"], ["United States dollar", "us$"], ["British Virgin Islands dollar", "bvi$"], ["Brunei dollar", "b$"], ["Sen", "sen"], ["Singapore dollar", "s$"], ["Canadian dollar", "can$|c$|c $"], ["Cayman Islands dollar", "ci$"], ["New Zealand dollar", "nz$|nz $"], ["Guyanese dollar", "gy$|gy $|g$|g $"], ["Hong Kong dollar", "hk$|hkd|hk $"], ["Jamaican dollar", "j$"], ["Namibian dollar", "nad|n$|n $"], ["Solomon Islands dollar", "si$|si $"], ["New Taiwan dollar", "nt$|nt $"], ["Samoan tālā", "ws$"], ["Chinese yuan", "¥"], ["Japanese yen", "¥"], ["Turkish lira", "₺"], ["Euro", "€"], ["Pound", "£"], ["Costa Rican colón", "₡"]]); + ChineseNumericWithUnit.CurrencyAmbiguousValues = ['元', '仙', '分', '圆', '块', '毛', '盾', '箍', '蚊', '角']; + ChineseNumericWithUnit.DimensionSuffixList = new Map([["Meter", "米|公尺|m"], ["Kilometer", "千米|公里|km"], ["Decimeter", "分米|公寸|dm"], ["Centimeter", "釐米|厘米|公分|cm"], ["Micrometer", "毫米|公釐|mm"], ["Microns", "微米"], ["Picometer", "皮米"], ["Nanometer", "纳米"], ["Li", "里|市里"], ["Zhang", "丈"], ["Chi", "市尺|尺"], ["Cun", "市寸|寸"], ["Fen", "市分|分"], ["Hao", "毫"], ["Mile", "英里"], ["Inch", "英寸"], ["Foot", "呎|英尺"], ["Yard", "码"], ["Knot", "海里"], ["Light year", "光年"], ["Meter per second", "米每秒|米/秒|m/s"], ["Kilometer per hour", "公里每小时|千米每小时|公里/小时|千米/小时|km/h"], ["Kilometer per minute", "公里每分钟|千米每分钟|公里/分钟|千米/分钟|km/min"], ["Kilometer per second", "公里每秒|千米每秒|公里/秒|千米/秒|km/s"], ["Mile per hour", "英里每小时|英里/小时"], ["Foot per second", "英尺每小时|英尺/小时"], ["Foot per minute", "英尺每分钟|英尺/分钟"], ["Yard per minute", "码每分|码/分"], ["Yard per second", "码每秒|码/秒"], ["Square centimetre", "平方厘米"], ["Square decimeter", "平方分米"], ["Square meter", "平方米"], ["Square kilometer", "平方公里"], ["Acre", "英亩|公亩"], ["Hectare", "公顷"], ["Mu", "亩|市亩"], ["Liter", "公升|升|l"], ["Milliliter", "毫升|ml"], ["Cubic meter", "立方米"], ["Cubic decimeter", "立方分米"], ["Cubic millimeter", "立方毫米"], ["Cubic feet", "立方英尺"], ["Gallon", "加仑"], ["Pint", "品脱"], ["Dou", "市斗|斗"], ["Dan", "市石|石"], ["Kilogram", "千克|公斤|kg"], ["Jin", "市斤|斤"], ["Milligram", "毫克|mg"], ["Barrel", "桶"], ["Pot", "罐"], ["Gram", "克|g"], ["Ton", "公吨|吨|t"], ["Pound", "磅"], ["Ounce", "盎司"], ["Bit", "比特|位|b"], ["Byte", "字节|byte"], ["Kilobyte", "千字节|kb"], ["Megabyte", "兆字节|mb"], ["Gigabyte", "十亿字节|千兆字节|gb"], ["Terabyte", "万亿字节|兆兆字节|tb"], ["Petabyte", "千兆兆|千万亿字节|pb"]]); + ChineseNumericWithUnit.DimensionAmbiguousValues = ['丈', '位', '克', '分', '升', '寸', '尺', '斗', '斤', '桶', '毫', '石', '码', '磅', '米', '罐', '里', 'm', 'km', 'dm', 'cm', 'mm', 'l', 'ml', 'kg', 'mg', 'g', 't', 'b', 'byte', 'kb', 'mb', 'gb', 'tb', 'pb']; + ChineseNumericWithUnit.TemperatureSuffixList = new Map([["F", "华氏温度|华氏度|°f"], ["K", "k|开尔文温度|开氏度|凯氏度"], ["R", "兰氏温度|°r"], ["C", "摄氏温度|摄氏度|°c"], ["Degree", "度"]]); + ChineseNumericWithUnit.TemperaturePrefixList = new Map([["F", "华氏温度|华氏"], ["K", "开氏温度|开氏"], ["R", "兰氏温度|兰氏"], ["C", "摄氏温度|摄氏"]]); + ChineseNumericWithUnit.TemperatureAmbiguousValues = ['度', 'k']; +})(ChineseNumericWithUnit = exports.ChineseNumericWithUnit || (exports.ChineseNumericWithUnit = {})); + +}); + +unwrapExports(chineseNumericWithUnit); + +var base$6 = createCommonjsModule(function (module, exports) { +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); + + + + + +class ChineseNumberWithUnitExtractorConfiguration { + constructor(ci) { + this.cultureInfo = ci; + this.unitNumExtractor = new recognizersTextNumber.ChineseNumberExtractor(recognizersTextNumber.ChineseNumberExtractorMode.ExtractAll); + this.buildPrefix = chineseNumericWithUnit.ChineseNumericWithUnit.BuildPrefix; + this.buildSuffix = chineseNumericWithUnit.ChineseNumericWithUnit.BuildSuffix; + this.connectorToken = chineseNumericWithUnit.ChineseNumericWithUnit.ConnectorToken; + this.compoundUnitConnectorRegex = recognizersText.RegExpUtility.getSafeRegExp(chineseNumericWithUnit.ChineseNumericWithUnit.CompoundUnitConnectorRegex); + this.pmNonUnitRegex = recognizersText.RegExpUtility.getSafeRegExp(baseUnits.BaseUnits.PmNonUnitRegex); + } +} +exports.ChineseNumberWithUnitExtractorConfiguration = ChineseNumberWithUnitExtractorConfiguration; +class ChineseNumberWithUnitParserConfiguration extends parsers$8.BaseNumberWithUnitParserConfiguration { + constructor(ci) { + super(ci); + this.internalNumberExtractor = new recognizersTextNumber.ChineseNumberExtractor(recognizersTextNumber.ChineseNumberExtractorMode.Default); + this.internalNumberParser = recognizersTextNumber.AgnosticNumberParserFactory.getParser(recognizersTextNumber.AgnosticNumberParserType.Number, new recognizersTextNumber.ChineseNumberParserConfiguration()); + this.connectorToken = ''; + this.currencyNameToIsoCodeMap = chineseNumericWithUnit.ChineseNumericWithUnit.CurrencyNameToIsoCodeMap; + this.currencyFractionCodeList = chineseNumericWithUnit.ChineseNumericWithUnit.FractionalUnitNameToCodeMap; + } +} +exports.ChineseNumberWithUnitParserConfiguration = ChineseNumberWithUnitParserConfiguration; + +}); + +unwrapExports(base$6); + +var currency$6 = createCommonjsModule(function (module, exports) { +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); + + + + +class ChineseCurrencyExtractorConfiguration extends base$6.ChineseNumberWithUnitExtractorConfiguration { + constructor(ci) { + if (!ci) { + ci = new recognizersTextNumber.CultureInfo(recognizersTextNumber.Culture.Chinese); + } + super(ci); + this.extractType = constants$4.Constants.SYS_UNIT_CURRENCY; + // Reference Source: https:// en.wikipedia.org/wiki/List_of_circulating_currencies + this.suffixList = chineseNumericWithUnit.ChineseNumericWithUnit.CurrencySuffixList; + this.prefixList = chineseNumericWithUnit.ChineseNumericWithUnit.CurrencyPrefixList; + this.ambiguousUnitList = chineseNumericWithUnit.ChineseNumericWithUnit.CurrencyAmbiguousValues; + + } +} +exports.ChineseCurrencyExtractorConfiguration = ChineseCurrencyExtractorConfiguration; +class ChineseCurrencyParserConfiguration extends base$6.ChineseNumberWithUnitParserConfiguration { + constructor(ci) { + if (!ci) { + ci = new recognizersTextNumber.CultureInfo(recognizersTextNumber.Culture.Chinese); + } + super(ci); + this.BindDictionary(chineseNumericWithUnit.ChineseNumericWithUnit.CurrencySuffixList); + this.BindDictionary(chineseNumericWithUnit.ChineseNumericWithUnit.CurrencyPrefixList); + } +} +exports.ChineseCurrencyParserConfiguration = ChineseCurrencyParserConfiguration; + +}); + +unwrapExports(currency$6); + +var temperature$6 = createCommonjsModule(function (module, exports) { +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); + + + + +class ChineseTemperatureExtractorConfiguration extends base$6.ChineseNumberWithUnitExtractorConfiguration { + constructor(ci) { + if (!ci) { + ci = new recognizersTextNumber.CultureInfo(recognizersTextNumber.Culture.Chinese); + } + super(ci); + this.extractType = constants$4.Constants.SYS_UNIT_TEMPERATURE; + this.suffixList = chineseNumericWithUnit.ChineseNumericWithUnit.TemperatureSuffixList; + this.prefixList = chineseNumericWithUnit.ChineseNumericWithUnit.TemperaturePrefixList; + this.ambiguousUnitList = chineseNumericWithUnit.ChineseNumericWithUnit.TemperatureAmbiguousValues; + } +} +exports.ChineseTemperatureExtractorConfiguration = ChineseTemperatureExtractorConfiguration; +class ChineseTemperatureParserConfiguration extends base$6.ChineseNumberWithUnitParserConfiguration { + constructor(ci) { + if (!ci) { + ci = new recognizersTextNumber.CultureInfo(recognizersTextNumber.Culture.Chinese); + } + super(ci); + this.BindDictionary(chineseNumericWithUnit.ChineseNumericWithUnit.TemperaturePrefixList); + this.BindDictionary(chineseNumericWithUnit.ChineseNumericWithUnit.TemperatureSuffixList); + } +} +exports.ChineseTemperatureParserConfiguration = ChineseTemperatureParserConfiguration; + +}); + +unwrapExports(temperature$6); + +var dimension$6 = createCommonjsModule(function (module, exports) { +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); + + + + +class ChineseDimensionExtractorConfiguration extends base$6.ChineseNumberWithUnitExtractorConfiguration { + constructor(ci) { + if (!ci) { + ci = new recognizersTextNumber.CultureInfo(recognizersTextNumber.Culture.Chinese); + } + super(ci); + this.extractType = constants$4.Constants.SYS_UNIT_DIMENSION; + this.suffixList = chineseNumericWithUnit.ChineseNumericWithUnit.DimensionSuffixList; + this.prefixList = new Map(); + this.ambiguousUnitList = chineseNumericWithUnit.ChineseNumericWithUnit.DimensionAmbiguousValues; + } +} +exports.ChineseDimensionExtractorConfiguration = ChineseDimensionExtractorConfiguration; +class ChineseDimensionParserConfiguration extends base$6.ChineseNumberWithUnitParserConfiguration { + constructor(ci) { + if (!ci) { + ci = new recognizersTextNumber.CultureInfo(recognizersTextNumber.Culture.Chinese); + } + super(ci); + this.BindDictionary(chineseNumericWithUnit.ChineseNumericWithUnit.DimensionSuffixList); + } +} +exports.ChineseDimensionParserConfiguration = ChineseDimensionParserConfiguration; + +}); + +unwrapExports(dimension$6); + +var age$6 = createCommonjsModule(function (module, exports) { +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); + + + + +class ChineseAgeExtractorConfiguration extends base$6.ChineseNumberWithUnitExtractorConfiguration { + constructor(ci) { + if (!ci) { + ci = new recognizersTextNumber.CultureInfo(recognizersTextNumber.Culture.Chinese); + } + super(ci); + this.extractType = constants$4.Constants.SYS_UNIT_AGE; + this.suffixList = chineseNumericWithUnit.ChineseNumericWithUnit.AgeSuffixList; + this.prefixList = new Map(); + this.ambiguousUnitList = chineseNumericWithUnit.ChineseNumericWithUnit.AgeAmbiguousValues; + } +} +exports.ChineseAgeExtractorConfiguration = ChineseAgeExtractorConfiguration; +class ChineseAgeParserConfiguration extends base$6.ChineseNumberWithUnitParserConfiguration { + constructor(ci) { + if (!ci) { + ci = new recognizersTextNumber.CultureInfo(recognizersTextNumber.Culture.Chinese); + } + super(ci); + this.BindDictionary(chineseNumericWithUnit.ChineseNumericWithUnit.AgeSuffixList); + } +} +exports.ChineseAgeParserConfiguration = ChineseAgeParserConfiguration; + +}); + +unwrapExports(age$6); + +var japaneseNumericWithUnit = createCommonjsModule(function (module, exports) { +"use strict"; +// ------------------------------------------------------------------------------ +// +// This code was generated by a tool. +// Changes to this file may cause incorrect behavior and will be lost if +// the code is regenerated. +// +// ------------------------------------------------------------------------------ +Object.defineProperty(exports, "__esModule", { value: true }); +var JapaneseNumericWithUnit; +(function (JapaneseNumericWithUnit) { + JapaneseNumericWithUnit.AgeAmbiguousValues = ['歳']; + JapaneseNumericWithUnit.AgeSuffixList = new Map([["Year", "歳"], ["Month", "ヶ月"], ["Week", "週間|週"], ["Day", "日間|日齢|日大"]]); + JapaneseNumericWithUnit.BuildPrefix = ''; + JapaneseNumericWithUnit.BuildSuffix = ''; + JapaneseNumericWithUnit.ConnectorToken = ''; + JapaneseNumericWithUnit.CurrencySuffixList = new Map([["Afghan afghani", "アフガニ"], ["Pul", "プル"], ["Euro", "ユーロ"], ["Cent", "セント"], ["Albanian lek", "アルバニアレク|アルバニア・レク|レク"], ["Angolan kwanza", "アンゴラクワンザ|アンゴラ・クワンザ|クワンザ"], ["Armenian dram", "アルメニアドラム|アルメニア・ドラム|ドラム"], ["Aruban florin", "アルバ・フロリン|フロリン"], ["Bangladeshi taka", "タカ|バングラデシュ・タカ"], ["Paisa", "パイサ"], ["Bhutanese ngultrum", "ニュルタム|ブータン・ニュルタム|ブータンニュルタム"], ["Chetrum", "チェルタム"], ["Bolivian boliviano", "ボリビアーノ"], ["Bosnia and Herzegovina convertible mark", "兌換マルク"], ["Botswana pula", "ボツワナ・プラ|ボツワナプラ|プラ"], ["Thebe", "テベ"], ["Brazilian real", "ブラジル・レアル|ブラジルレアル|レアル"], ["Bulgarian lev", "ブルガリア・レフ|ブルガリアレフ|レフ"], ["Stotinka", "ストティンカ"], ["Cambodian riel", "カンボジア・リエル|カンボジアリエル|リエル"], ["Cape Verdean escudo", "カーボベルデ・エスクード"], ["Croatian kuna", "クロアチアクーナ|クロアチア・クーナ|クーナ"], ["Lipa", "リパ"], ["Eritrean nakfa", "エリトリア・ナクファ|エリトリアナクファ|ナクファ"], ["Ethiopian birr", "エチオピア・ブル|エチオピアブル|ブル"], ["Gambian dalasi", "ガンビア・ダラシ|ガンビアダラシ|ダラシ"], ["Butut", "ブトゥツ"], ["Georgian lari", "ジョージア・ラリ|ジョージアラリ|ラリ"], ["Tetri", "テトリ"], ["Ghanaian cedi", "ガーナ・セディ|ガーナセディ|セディ"], ["Pesewa", "ペセワ"], ["Guatemalan quetzal", "グアテマラ・ケツァル|グアテマラケツァル|ケツァル"], ["Haitian gourde", "ハイチ・グールド|ハイチグールド|グールド"], ["Honduran lempira", "ホンジュラス・レンピラ|ホンジュラスレンピラ|レンピラ"], ["Hungarian forint", "ハンガリー・フォリント|ハンガリーフォリント|フォリント"], ["Iranian rial", "イラン・リアル"], ["Yemeni rial", "イエメン・リアル"], ["Israeli new shekel", "₪|ils|イスラエル・新シェケル|イスラエル新シェケル"], ["Japanese yen", "円"], ["Sen", "銭"], ["Kazakhstani tenge", "テンゲ|カザフスタン・テンゲ|カザフスタンテンゲ"], ["Kenyan shilling", "ケニア・シリング"], ["North Korean won", "北朝鮮ウォン"], ["South Korean won", "韓国ウォン"], ["Korean won", "₩"], ["Kyrgyzstani som", "キルギス・ソム|ソム"], ["Lao kip", "キップ|ラオス・キップ|ラオスキップ"], ["Att", "att"], ["Lesotho loti", "ロチ|レソト・ロチ|レソトロチ"], ["South African rand", "ランド|南アフリカ・ランド|南アフリカランド"], ["Macedonian denar", "マケドニア・デナール"], ["Deni", "デニ"], ["Malagasy ariary", "アリアリ|マダガスカル・アリアリ|マダガスカルアリアリ"], ["Iraimbilanja", "イライムビランジャ"], ["Malawian kwacha", "マラウイ・クワチャ"], ["Tambala", "タンバラ"], ["Malaysian ringgit", "リンギット|マレーシア・リンギット"], ["Mauritanian ouguiya", "ウギア|モーリタニア・ウギア|モーリタニアウギア"], ["Khoums", "コウム"], ["Mozambican metical", "メティカル|モザンビーク・メティカル|モザンビークメティカル"], ["Burmese kyat", "チャット|ミャンマー・チャット|ミャンマーチャット"], ["Pya", "ピャー"], ["Nigerian naira", "ナイラ|ナイジェリア・ナイラ|ナイジェリアナイラ"], ["Kobo", "コボ"], ["Turkish lira", "トルコリラ"], ["Kuruş", "クルシュ"], ["Omani rial", "オマーン・リアル"], ["Panamanian balboa", "バルボア|パナマ・バルボア|パナマバルボア"], ["Centesimo", "センテシモ"], ["Papua New Guinean kina", "キナ|パプア・ニューギニア・キナ"], ["Toea", "トエア"], ["Peruvian sol", "ヌエボ・ソル"], ["Polish złoty", "ズウォティ|ポーランド・ズウォティ|ポーランドズウォティ"], ["Grosz", "グロシュ"], ["Qatari riyal", "カタール・リヤル"], ["Saudi riyal", "サウジアラビア・リヤル"], ["Riyal", "リヤル"], ["Dirham", "ディルハム"], ["Halala", "ハララ"], ["Samoan tālā", "タラ|サモア・タラ|サモアタラ"], ["Sierra Leonean leone", "レオン|シエラレオネ・レオン|シエラレオネレオン"], ["Peseta", "ユーロ"], ["Swazi lilangeni", "リランゲニ|スワジランド・リランゲニ|スワジランドリランゲニ"], ["Tajikistani somoni", "ソモニ|タジキスタン・ソモニ|タジキスタンソモニ"], ["Thai baht", "バーツ|タイ・バーツ|タイバーツ"], ["Satang", "サタン"], ["Tongan paʻanga", "パアンガ|トンガ・パアンガ|トンガパアンガ"], ["Ukrainian hryvnia", "フリヴニャ|ウクライナ・フリヴニャ|ウクライナフリヴニャ"], ["Vanuatu vatu", "バツ|バヌアツ・バツ|バヌアツバツ"], ["Vietnamese dong", "ドン|ベトナム・ドン|ベトナムドン"], ["Indonesian rupiah", "ルピア|インドネシア・ルピア|インドネシアルピア"], ["Netherlands guilder", "ユーロ|オランダ・ユーロ"], ["Surinam florin", "スリナム・ドル"], ["Zambian kwacha", "ザンビア・クワチャ"], ["Moroccan dirham", "モロッコ・ディルハム"], ["United Arab Emirates dirham", "UAEディルハム"], ["Azerbaijani manat", "アゼルバイジャン・マナト"], ["Turkmenistan manat", "トルクメニスタン・マナト"], ["Manat", "マナト"], ["Somali shilling", "ソマリア・シリング"], ["Somaliland shilling", "ソマリランド・シリング"], ["Tanzanian shilling", "タンザニア・シリング"], ["Ugandan shilling", "ウガンダ・シリング"], ["Romanian leu", "ルーマニア・レウ"], ["Moldovan leu", "モルドバ・レウ"], ["Leu", "レウ"], ["Ban", "バン"], ["Nepalese rupee", "ネパール・ルピー"], ["Pakistani rupee", "パキスタン・ルピー"], ["Indian rupee", "インド・ルピー"], ["Seychellois rupee", "セーシェル・ルピー"], ["Mauritian rupee", "モーリシャス・ルピー"], ["Maldivian rufiyaa", "ルフィヤ|モルディブ・ルフィヤ|モルディブルフィヤ"], ["Sri Lankan rupee", "スリランカ・ルピー"], ["Rupee", "ルピー"], ["Czech koruna", "チェコ・コルナ"], ["Danish krone", "デンマーク・クローネ"], ["Norwegian krone", "ノルウェー・クローネ"], ["Faroese króna", "フェロー・クローネ"], ["Icelandic króna", "アイスランド・クローナ"], ["Swedish krona", "スウェーデン・クローナ"], ["Krone", "クローナ"], ["Øre", "オーレ"], ["West African CFA franc", "CFAフラン"], ["Central African CFA franc", "CFAフラン"], ["Comorian franc", "コモロ・フラン"], ["Congolese franc", "コンゴ・フラン"], ["Burundian franc", "ブルンジ・フラン"], ["Djiboutian franc", "ジブチ・フラン"], ["CFP franc", "CFPフラン"], ["Guinean franc", "ギニア・フラン"], ["Swiss franc", "スイス・フラン"], ["Rwandan franc", "ルワンダ・フラン"], ["Belgian franc", "ベルギー・フラン"], ["Rappen", "Rappen"], ["Franc", "フラン"], ["Centime", "サンチーム"], ["Russian ruble", "ロシア・ルーブル"], ["Transnistrian ruble", "沿ドニエストル・ルーブル"], ["Belarusian ruble", "ベラルーシ・ルーブル"], ["Kopek", "カペイカ"], ["Ruble", "ルーブル"], ["Algerian dinar", "アルジェリア・ディナール"], ["Bahraini dinar", "バーレーン・ディナール"], ["Iraqi dinar", "イラク・ディナール"], ["Jordanian dinar", "ヨルダン・ディナール"], ["Kuwaiti dinar", "クウェート・ディナール"], ["Libyan dinar", "リビア・ディナール"], ["Serbian dinar", "セルビア・ディナール"], ["Tunisian dinar", "チュニジア・ディナール"], ["Dinar", "ディナール"], ["Fils", "フィルス"], ["Para", "パラ"], ["Millime", "ミリム"], ["Argentine peso", "ペソ|アルゼンチン・ペソ"], ["Chilean peso", "チリ・ペソ"], ["Colombian peso", "コロンビア・ペソ"], ["Cuban peso", "兌換ペソ"], ["Dominican peso", "ドミニカ・ペソ"], ["Mexican peso", "メキシコ・ペソ"], ["Philippine peso", "フィリピン・ペソ"], ["Uruguayan peso", "ウルグアイ・ペソ"], ["Peso", "ペソ"], ["Centavo", "センターボ"], ["Alderney pound", "ガーンジー・ポンド"], ["British pound", "UKポンド"], ["Guernsey pound", "ガーンジー・ポンド"], ["Saint Helena pound", "セントヘレナ・ポンド"], ["Egyptian pound", "エジプト・ポンド"], ["Falkland Islands pound", "フォークランド諸島ポンド"], ["Gibraltar pound", "ジブラルタル・ポンド"], ["Manx pound", "マン島ポンド"], ["Jersey pound", "ジャージー・ポンド"], ["Lebanese pound", "レバノン・ポンド"], ["South Sudanese pound", "南スーダン・ポンド"], ["Sudanese pound", "スーダン・ポンド"], ["Syrian pound", "シリア・ポンド"], ["Pound", "ポンド"], ["Pence", "ペニー"], ["Shilling", "シリング"], ["United States dollar", "ドル|USドル"], ["East Caribbean dollar", "東カリブ・ドル"], ["Australian dollar", "オーストラリア・ドル"], ["Bahamian dollar", "バハマ・ドル"], ["Barbadian dollar", "バルバドス・ドル"], ["Belize dollar", "ベリーズ・ドル"], ["Bermudian dollar", "バミューダ・ドル"], ["Brunei dollar", "ブルネイ・ドル"], ["Singapore dollar", "シンガポール・ドル"], ["Canadian dollar", "カナダ・ドル"], ["Cayman Islands dollar", "ケイマン諸島・ドル"], ["New Zealand dollar", "ニュージーランド・ドル"], ["Cook Islands dollar", "ニュージーランド・ドル|ニュージーランド・ドル"], ["Fijian dollar", "フィジー・ドル|フィジー・ドル"], ["Guyanese dollar", "ガイアナ・ドル|ガイアナ・ドル"], ["Hong Kong dollar", "香港ドル"], ["Macau Pataca", "マカオ・パタカ|マカオ・パタカ"], ["New Taiwan dollar", "ニュー台湾ドル|ニュー台湾ドル"], ["Jamaican dollar", "ジャマイカ・ドル|ジャマイカドル"], ["Kiribati dollar", "オーストラリア・ドル|オーストラリアドル"], ["Liberian dollar", "リベリア・ドル|リベリアドル"], ["Namibian dollar", "ナミビア・ドル|ナミビアドル"], ["Surinamese dollar", "スリナム・ドル|スリナムドル"], ["Trinidad and Tobago dollar", "トリニダード・トバゴ・ドル|トリニダードトバゴ・ドル"], ["Tuvaluan dollar", "ツバル・ドル|ツバルドル"], ["Chinese yuan", "人民元"], ["Fen", "分"], ["Jiao", "角"], ["Finnish markka", "フィンランド・マルカ"], ["Penni", "ペニー"]]); + JapaneseNumericWithUnit.CurrencyNameToIsoCodeMap = new Map([["Afghan afghani", "AFN"], ["Euro", "EUR"], ["Albanian lek", "ALL"], ["Angolan kwanza", "AOA"], ["Armenian dram", "AMD"], ["Aruban florin", "AWG"], ["Bangladeshi taka", "BDT"], ["Bhutanese ngultrum", "BTN"], ["Bolivian boliviano", "BOB"], ["Bosnia and Herzegovina convertible mark", "BAM"], ["Botswana pula", "BWP"], ["Brazilian real", "BRL"], ["Bulgarian lev", "BGN"], ["Cambodian riel", "KHR"], ["Cape Verdean escudo", "CVE"], ["Costa Rican colón", "CRC"], ["Croatian kuna", "HRK"], ["Czech koruna", "CZK"], ["Eritrean nakfa", "ERN"], ["Ethiopian birr", "ETB"], ["Gambian dalasi", "GMD"], ["Georgian lari", "GEL"], ["Ghanaian cedi", "GHS"], ["Guatemalan quetzal", "GTQ"], ["Haitian gourde", "HTG"], ["Honduran lempira", "HNL"], ["Hungarian forint", "HUF"], ["Iranian rial", "IRR"], ["Yemeni rial", "YER"], ["Israeli new shekel", "ILS"], ["Japanese yen", "JPY"], ["Kazakhstani tenge", "KZT"], ["Kenyan shilling", "KES"], ["North Korean won", "KPW"], ["South Korean won", "KRW"], ["Kyrgyzstani som", "KGS"], ["Lao kip", "LAK"], ["Lesotho loti", "LSL"], ["South African rand", "ZAR"], ["Macanese pataca", "MOP"], ["Macedonian denar", "MKD"], ["Malagasy ariary", "MGA"], ["Malawian kwacha", "MWK"], ["Malaysian ringgit", "MYR"], ["Mauritanian ouguiya", "MRO"], ["Mongolian tögrög", "MNT"], ["Mozambican metical", "MZN"], ["Burmese kyat", "MMK"], ["Nicaraguan córdoba", "NIO"], ["Nigerian naira", "NGN"], ["Turkish lira", "TRY"], ["Omani rial", "OMR"], ["Panamanian balboa", "PAB"], ["Papua New Guinean kina", "PGK"], ["Paraguayan guaraní", "PYG"], ["Peruvian sol", "PEN"], ["Polish złoty", "PLN"], ["Qatari riyal", "QAR"], ["Saudi riyal", "SAR"], ["Samoan tālā", "WST"], ["São Tomé and Príncipe dobra", "STD"], ["Sierra Leonean leone", "SLL"], ["Swazi lilangeni", "SZL"], ["Tajikistani somoni", "TJS"], ["Thai baht", "THB"], ["Ukrainian hryvnia", "UAH"], ["Vanuatu vatu", "VUV"], ["Venezuelan bolívar", "VEF"], ["Zambian kwacha", "ZMW"], ["Moroccan dirham", "MAD"], ["United Arab Emirates dirham", "AED"], ["Azerbaijani manat", "AZN"], ["Turkmenistan manat", "TMT"], ["Somali shilling", "SOS"], ["Tanzanian shilling", "TZS"], ["Ugandan shilling", "UGX"], ["Romanian leu", "RON"], ["Moldovan leu", "MDL"], ["Nepalese rupee", "NPR"], ["Pakistani rupee", "PKR"], ["Indian rupee", "INR"], ["Seychellois rupee", "SCR"], ["Mauritian rupee", "MUR"], ["Maldivian rufiyaa", "MVR"], ["Sri Lankan rupee", "LKR"], ["Indonesian rupiah", "IDR"], ["Danish krone", "DKK"], ["Norwegian krone", "NOK"], ["Icelandic króna", "ISK"], ["Swedish krona", "SEK"], ["West African CFA franc", "XOF"], ["Central African CFA franc", "XAF"], ["Comorian franc", "KMF"], ["Congolese franc", "CDF"], ["Burundian franc", "BIF"], ["Djiboutian franc", "DJF"], ["CFP franc", "XPF"], ["Guinean franc", "GNF"], ["Swiss franc", "CHF"], ["Rwandan franc", "RWF"], ["Russian ruble", "RUB"], ["Transnistrian ruble", "PRB"], ["Belarusian ruble", "BYN"], ["Algerian dinar", "DZD"], ["Bahraini dinar", "BHD"], ["Iraqi dinar", "IQD"], ["Jordanian dinar", "JOD"], ["Kuwaiti dinar", "KWD"], ["Libyan dinar", "LYD"], ["Serbian dinar", "RSD"], ["Tunisian dinar", "TND"], ["Argentine peso", "ARS"], ["Chilean peso", "CLP"], ["Colombian peso", "COP"], ["Cuban convertible peso", "CUC"], ["Cuban peso", "CUP"], ["Dominican peso", "DOP"], ["Mexican peso", "MXN"], ["Uruguayan peso", "UYU"], ["British pound", "GBP"], ["Saint Helena pound", "SHP"], ["Egyptian pound", "EGP"], ["Falkland Islands pound", "FKP"], ["Gibraltar pound", "GIP"], ["Manx pound", "IMP"], ["Jersey pound", "JEP"], ["Lebanese pound", "LBP"], ["South Sudanese pound", "SSP"], ["Sudanese pound", "SDG"], ["Syrian pound", "SYP"], ["United States dollar", "USD"], ["Australian dollar", "AUD"], ["Bahamian dollar", "BSD"], ["Barbadian dollar", "BBD"], ["Belize dollar", "BZD"], ["Bermudian dollar", "BMD"], ["Brunei dollar", "BND"], ["Singapore dollar", "SGD"], ["Canadian dollar", "CAD"], ["Cayman Islands dollar", "KYD"], ["New Zealand dollar", "NZD"], ["Fijian dollar", "FJD"], ["Guyanese dollar", "GYD"], ["Hong Kong dollar", "HKD"], ["Jamaican dollar", "JMD"], ["Liberian dollar", "LRD"], ["Namibian dollar", "NAD"], ["Solomon Islands dollar", "SBD"], ["Surinamese dollar", "SRD"], ["New Taiwan dollar", "TWD"], ["Trinidad and Tobago dollar", "TTD"], ["Tuvaluan dollar", "TVD"], ["Chinese yuan", "CNY"], ["Rial", "__RI"], ["Shiling", "__S"], ["Som", "__SO"], ["Dirham", "__DR"], ["Dinar", "_DN"], ["Dollar", "__D"], ["Manat", "__MA"], ["Rupee", "__R"], ["Krone", "__K"], ["Krona", "__K"], ["Crown", "__K"], ["Frank", "__F"], ["Mark", "__M"], ["Ruble", "__RB"], ["Peso", "__PE"], ["Pound", "__P"], ["Tristan da Cunha pound", "_TP"], ["South Georgia and the South Sandwich Islands pound", "_SP"], ["Somaliland shilling", "_SS"], ["Pitcairn Islands dollar", "_PND"], ["Palauan dollar", "_PD"], ["Niue dollar", "_NID"], ["Nauruan dollar", "_ND"], ["Micronesian dollar", "_MD"], ["Kiribati dollar", "_KID"], ["Guernsey pound", "_GGP"], ["Faroese króna", "_FOK"], ["Cook Islands dollar", "_CKD"], ["British Virgin Islands dollar", "_BD"], ["Ascension pound", "_AP"], ["Alderney pound", "_ALP"], ["Abkhazian apsar", "_AA"]]); + JapaneseNumericWithUnit.FractionalUnitNameToCodeMap = new Map([["Jiao", "JIAO"], ["Kopek", "KOPEK"], ["Pul", "PUL"], ["Cent", "CENT"], ["Qindarkë", "QINDARKE"], ["Penny", "PENNY"], ["Santeem", "SANTEEM"], ["Cêntimo", "CENTIMO"], ["Centavo", "CENTAVO"], ["Luma", "LUMA"], ["Qəpik", "QƏPIK"], ["Fils", "FILS"], ["Poisha", "POISHA"], ["Kapyeyka", "KAPYEYKA"], ["Centime", "CENTIME"], ["Chetrum", "CHETRUM"], ["Paisa", "PAISA"], ["Fening", "FENING"], ["Thebe", "THEBE"], ["Sen", "SEN"], ["Stotinka", "STOTINKA"], ["Fen", "FEN"], ["Céntimo", "CENTIMO"], ["Lipa", "LIPA"], ["Haléř", "HALER"], ["Øre", "ØRE"], ["Piastre", "PIASTRE"], ["Santim", "SANTIM"], ["Oyra", "OYRA"], ["Butut", "BUTUT"], ["Tetri", "TETRI"], ["Pesewa", "PESEWA"], ["Fillér", "FILLER"], ["Eyrir", "EYRIR"], ["Dinar", "DINAR"], ["Agora", "AGORA"], ["Tïın", "TIIN"], ["Chon", "CHON"], ["Jeon", "JEON"], ["Tyiyn", "TYIYN"], ["Att", "ATT"], ["Sente", "SENTE"], ["Dirham", "DIRHAM"], ["Rappen", "RAPPEN"], ["Avo", "AVO"], ["Deni", "DENI"], ["Iraimbilanja", "IRAIMBILANJA"], ["Tambala", "TAMBALA"], ["Laari", "LAARI"], ["Khoums", "KHOUMS"], ["Ban", "BAN"], ["Möngö", "MONGO"], ["Pya", "PYA"], ["Kobo", "KOBO"], ["Kuruş", "KURUS"], ["Baisa", "BAISA"], ["Centésimo", "CENTESIMO"], ["Toea", "TOEA"], ["Sentimo", "SENTIMO"], ["Grosz", "GROSZ"], ["Sene", "SENE"], ["Halala", "HALALA"], ["Para", "PARA"], ["Öre", "ORE"], ["Diram", "DIRAM"], ["Satang", "SATANG"], ["Seniti", "SENITI"], ["Millime", "MILLIME"], ["Tennesi", "TENNESI"], ["Kopiyka", "KOPIYKA"], ["Tiyin", "TIYIN"], ["Hào", "HAO"], ["Ngwee", "NGWEE"]]); + JapaneseNumericWithUnit.CompoundUnitConnectorRegex = `(?と)`; + JapaneseNumericWithUnit.CurrencyPrefixList = new Map([["Dollar", "$"], ["United States dollar", "us$"], ["British Virgin Islands dollar", "bvi$"], ["Brunei dollar", "b$"], ["Sen", "sen"], ["Singapore dollar", "s$"], ["Canadian dollar", "can$|c$|c $"], ["Cayman Islands dollar", "ci$"], ["New Zealand dollar", "nz$|nz $"], ["Guyanese dollar", "gy$|gy $|g$|g $"], ["Hong Kong dollar", "hk$|hkd|hk $"], ["Jamaican dollar", "j$"], ["Namibian dollar", "nad|n$|n $"], ["Solomon Islands dollar", "si$|si $"], ["New Taiwan dollar", "nt$|nt $"], ["Samoan tālā", "ws$"], ["Chinese yuan", "¥"], ["Japanese yen", "¥|\\"], ["Turkish lira", "₺"], ["Euro", "€"], ["Pound", "£"], ["Costa Rican colón", "₡"]]); + JapaneseNumericWithUnit.CurrencyAmbiguousValues = ['円', '銭', '\\']; +})(JapaneseNumericWithUnit = exports.JapaneseNumericWithUnit || (exports.JapaneseNumericWithUnit = {})); + +}); + +unwrapExports(japaneseNumericWithUnit); + +var base$8 = createCommonjsModule(function (module, exports) { +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); + + + + + +class JapaneseNumberWithUnitExtractorConfiguration { + constructor(ci) { + this.cultureInfo = ci; + this.unitNumExtractor = new recognizersTextNumber.JapaneseNumberExtractor(recognizersTextNumber.JapaneseNumberExtractorMode.ExtractAll); + this.buildPrefix = japaneseNumericWithUnit.JapaneseNumericWithUnit.BuildPrefix; + this.buildSuffix = japaneseNumericWithUnit.JapaneseNumericWithUnit.BuildSuffix; + this.connectorToken = japaneseNumericWithUnit.JapaneseNumericWithUnit.ConnectorToken; + this.compoundUnitConnectorRegex = recognizersText.RegExpUtility.getSafeRegExp(japaneseNumericWithUnit.JapaneseNumericWithUnit.CompoundUnitConnectorRegex); + this.pmNonUnitRegex = recognizersText.RegExpUtility.getSafeRegExp(baseUnits.BaseUnits.PmNonUnitRegex); + } +} +exports.JapaneseNumberWithUnitExtractorConfiguration = JapaneseNumberWithUnitExtractorConfiguration; +class JapaneseNumberWithUnitParserConfiguration extends parsers$8.BaseNumberWithUnitParserConfiguration { + constructor(ci) { + super(ci); + this.internalNumberExtractor = new recognizersTextNumber.JapaneseNumberExtractor(recognizersTextNumber.JapaneseNumberExtractorMode.Default); + this.internalNumberParser = recognizersTextNumber.AgnosticNumberParserFactory.getParser(recognizersTextNumber.AgnosticNumberParserType.Number, new recognizersTextNumber.JapaneseNumberParserConfiguration()); + this.connectorToken = ''; + this.currencyNameToIsoCodeMap = japaneseNumericWithUnit.JapaneseNumericWithUnit.CurrencyNameToIsoCodeMap; + this.currencyFractionCodeList = japaneseNumericWithUnit.JapaneseNumericWithUnit.FractionalUnitNameToCodeMap; + } +} +exports.JapaneseNumberWithUnitParserConfiguration = JapaneseNumberWithUnitParserConfiguration; + +}); + +unwrapExports(base$8); + +var currency$8 = createCommonjsModule(function (module, exports) { +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); + + + + +class JapaneseCurrencyExtractorConfiguration extends base$8.JapaneseNumberWithUnitExtractorConfiguration { + constructor(ci) { + if (!ci) { + ci = new recognizersTextNumber.CultureInfo(recognizersTextNumber.Culture.Japanese); + } + super(ci); + this.extractType = constants$4.Constants.SYS_UNIT_CURRENCY; + // Reference Source: https:// en.wikipedia.org/wiki/List_of_circulating_currencies + this.suffixList = japaneseNumericWithUnit.JapaneseNumericWithUnit.CurrencySuffixList; + this.prefixList = japaneseNumericWithUnit.JapaneseNumericWithUnit.CurrencyPrefixList; + this.ambiguousUnitList = japaneseNumericWithUnit.JapaneseNumericWithUnit.CurrencyAmbiguousValues; + + } +} +exports.JapaneseCurrencyExtractorConfiguration = JapaneseCurrencyExtractorConfiguration; +class JapaneseCurrencyParserConfiguration extends base$8.JapaneseNumberWithUnitParserConfiguration { + constructor(ci) { + if (!ci) { + ci = new recognizersTextNumber.CultureInfo(recognizersTextNumber.Culture.Japanese); + } + super(ci); + this.BindDictionary(japaneseNumericWithUnit.JapaneseNumericWithUnit.CurrencySuffixList); + this.BindDictionary(japaneseNumericWithUnit.JapaneseNumericWithUnit.CurrencyPrefixList); + } +} +exports.JapaneseCurrencyParserConfiguration = JapaneseCurrencyParserConfiguration; + +}); + +unwrapExports(currency$8); + +var age$8 = createCommonjsModule(function (module, exports) { +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); + + + + +class JapaneseAgeExtractorConfiguration extends base$8.JapaneseNumberWithUnitExtractorConfiguration { + constructor(ci) { + if (!ci) { + ci = new recognizersTextNumber.CultureInfo(recognizersTextNumber.Culture.Japanese); + } + super(ci); + this.extractType = constants$4.Constants.SYS_UNIT_AGE; + this.suffixList = japaneseNumericWithUnit.JapaneseNumericWithUnit.AgeSuffixList; + this.prefixList = new Map(); + this.ambiguousUnitList = japaneseNumericWithUnit.JapaneseNumericWithUnit.AgeAmbiguousValues; + } +} +exports.JapaneseAgeExtractorConfiguration = JapaneseAgeExtractorConfiguration; +class JapaneseAgeParserConfiguration extends base$8.JapaneseNumberWithUnitParserConfiguration { + constructor(ci) { + if (!ci) { + ci = new recognizersTextNumber.CultureInfo(recognizersTextNumber.Culture.Japanese); + } + super(ci); + this.BindDictionary(japaneseNumericWithUnit.JapaneseNumericWithUnit.AgeSuffixList); + } +} +exports.JapaneseAgeParserConfiguration = JapaneseAgeParserConfiguration; + +}); + +unwrapExports(age$8); + +var frenchNumericWithUnit = createCommonjsModule(function (module, exports) { +"use strict"; +// ------------------------------------------------------------------------------ +// +// This code was generated by a tool. +// Changes to this file may cause incorrect behavior and will be lost if +// the code is regenerated. +// +// ------------------------------------------------------------------------------ +Object.defineProperty(exports, "__esModule", { value: true }); +var FrenchNumericWithUnit; +(function (FrenchNumericWithUnit) { + FrenchNumericWithUnit.AgeSuffixList = new Map([["Ans", "ans"], ["Mois", "mois d'âge|mois d'age|mois"], ["Semaines", "semaine|semaines|semaines d'âge|semaines d'age"], ["Jour", "jours|jour"]]); + FrenchNumericWithUnit.AreaSuffixList = new Map([["Kilomètre carré", "km2|km^2|km²|kilomètres carrés|kilomètre carré"], ["Hectomètre carré", "hm2|hm^2|hm²|hectomètre carré|hectomètres carrés"], ["Décamètre carré", "dam2|dam^2|dam²|décamètre carré|décamètres carrés"], ["Mètre carré", "m2|m^2|m²|mètre carré|mètres carrés"], ["Décimètre carré", "dm2|dm^2|dm²|décimètre carré|décimètres carrés"], ["Centimètre carré", "cm2|cm^2|cm²|centimètre carré|centimètres carrés"], ["Millimètre carré", "mm2|mm^2|mm²|millimètre carré|millimètres carrés"], ["Pouce carré", "pouces2|po2|pouce carré|pouces carrés|in^2|in²|in2"], ["Pied carré", "pied carré|pieds carrés|pi2|pi^2|pi²"], ["Mile carré", "mile carré|miles carrés|mi2|mi^2|mi²"], ["Acre", "acre|acres"]]); + FrenchNumericWithUnit.CurrencySuffixList = new Map([["Abkhazie apsar", "abkhazie apsar|apsars"], ["Afghan afghani", "afghan afghani|؋|afn|afghanis|afghani"], ["Pul", "pul"], ["Euro", "euros|euro|€|eur|d'euros"], ["Cent", "cents|cent|-cents|-cent|sen"], ["lek Albanais", "lek albanais|leks|lek"], ["Qindarkë", "qindarkë|qindarkës|qindarke|qindarkes"], ["Kwanza angolais", "kwanza angolais|kz|aoa|kwanza|kwanzas"], ["Dram arménien", "dram arménien|drams arméniens"], ["Florins d'Aruba", "florins aruba|ƒ|awg"], ["Bangladeshi taka", "bangladeshi taka|৳|bdt|taka|takas|bangladeshi takas"], ["Paisa", "poisha|paisa"], ["Ngultrum bhoutanais", "ngultrum bhoutanais|nu.|btn"], ["Chetrum", "chetrums|chetrum"], ["Boliviano bolivien", "boliviano bolivien|bolivianos bolivien|bolivianos bolivie|boliviano bolivie|bob|bs."], ["Bosnie-Herzégovine mark convertible", "bosnie-herzégovine mark convertible|bosnie-et-herzégovine mark convertible|bam"], ["Fening", "fening|fenings"], ["Pula", "pula|bwp"], ["Thebe", "thebe"], ["Réal brésilien", "réal brésilien|réals brésilien|r$|brl|real bresil|reals bresilien"], ["Lev bulgare", "lev bulgare|levs bulgare|lv|bgn"], ["Stotinki búlgaro", "stotinki bulgare"], ["Riel cambodgien", "riel cambodgien|khr|៛"], ["Escudo du cap-vert", "escudo cap-verdien|cve"], ["Colon du costa rica", "colon du costa rica|colons du costa rica|crc|₡"], ["Colon du salvador", "colon du salvador|colons du salvador|svc"], ["Kuna croate", "kuna croate|kunas croate|kn|hrk"], ["Lipa", "lipa"], ["Couronne tchèque", "couronne tchèque|couronnes tchèque|czk|Kč"], ["Haléř", "haléř"], ["Nakfas érythréens", "nakfas érythréens|nfk|ern|nakfa érythréens"], ["Birr éthiopien", "birr éthiopien|birrs éthiopien|etb"], ["Dalasi gambienne", "gmd"], ["Butut", "bututs|butut"], ["Lari géorgien", "lari géorgie|lari géorgiens|gel|₾"], ["Tetri géorgien", "tetri géorgie|tetris géorgiens"], ["Cedi", "cedi|ghs|cedi ghanéen|gh₵"], ["Pesewa", "pesewa|pesewas"], ["Quetzal guatémaltèque", "quetzal guatémaltèque|gtq|quetzal|quetzales"], ["Gourdes haïtiennes", "gourdes haïtiennes|gourdes|htg|gourde haïtienne"], ["Lempira hondurien", "lempira hondurien|hnl"], ["Forint hongrois", "forint hongrois|huf|fg|forints hongrois"], ["Fillér", "fillér"], ["Rial iranien", "rial iranien|irr|rials iranien|rials iraniens"], ["Litas lituanien", "litas lituanien|ltl|lit lithuanien|litas lithuanie"], ["Yen Japonais", "yen japonais|yen japon|yens|jpy|yen|¥|-yen"], ["Tenge kazakh", "tenge kazakh|kzt"], ["Shilling kényan", "shilling kényan|sh|kes|shillings kényans"], ["Won coréen", "won coréen|won coréens|₩"], ["Won sud-coréen", "won sud-coréen|won sud coréen|won sud-coréens|krw"], ["Corée du nord won", "corée du nord won|corée nord won|kpw"], ["Som Kirghizie", "som kirghizie|kgs"], ["Sum Ouzbékistan", "sum ouzbékistan|sum ouzbeks|sum ouzbéks|uzs"], ["Kip laotien", "kip laotien|lak|₭n|₭"], ["Att", "att"], ["Loti", "loti|maloti|lsl"], ["Sente", "sente|lisente"], ["Rand sud-africain", "rand sud-africain|zar"], ["Pataca macanais", "pataca macanais|mop$|mop"], ["Avo", "avos|avo"], ["Dinar macédonien", "dinar macédonien|mkd|ден"], ["Deni", "deni"], ["Ariary malagache", "ariary malagache|mga"], ["Iraimbilanja", "Iraimbilanja"], ["Kwacha malawien", "kwacha malawien|mk|mwk"], ["Tambala", "Tambala"], ["Ringitt malaisien", "ringitt malaisien|rm|myr|ringitts malaisien"], ["Ouguiya mauritanienne", "ouguiya|um|mro|ouguiya mauritanien|ouguiya mauritanienne"], ["Khoums", "khoums"], ["Togrogs mongoles", "togrogs mongoles|togrogs|tugriks|tögrög|mnt|₮|tögrög mongoles|tögrög mongolie|togrogs mongolie"], ["Metical mozambique", "metical du mozambique|metical mozambique|mt|mzn|meticals mozambique"], ["Kyat birmanie", "kyat birmanie|ks|mmk"], ["Pya", "pya"], ["Cordoba nicaraguayen", "cordoba nicaraguayen|córdoba nicaraguayen|nio|córdoba oro|cordoba oro nicaraguayen"], ["Naira nigérians", "naira nigérians|naira|ngm|₦|nairas nigérians"], ["Livre turque", "livre turque|try|tl|livre turques"], ["Kuruş", "kuruş"], ["Rials omanais", "rials omanais|omr|ر.ع.|rial omanais"], ["Balboa panaméennes", "balboa panaméennes|balboa|pab"], ["Kina", "kina|pkg|pgk"], ["Toea", "toea"], ["Guaraní paraguayen", "guaraní paraguayen|₲|pyg"], ["Sol péruvien", "nuevo sol péruvien|soles|sol|sol péruvien"], ["Złoty polonais", "złoty polonais|złoty|zł|pln|zloty|zloty polonais"], ["Groxz", "groszy|grosz|grosze"], ["Riyal qatari", "riyal qatari|qar|riyals qatari"], ["Riyal saudi", "riyal saudi|sar|riyals saudi"], ["Riyal", "riyal|riyals|rial|﷼"], ["Dirham", "dirham|dirhem|dirhm"], ["Halala", "halalas|halala"], ["Tala", "tala|tālā|ws$|sat|wst"], ["Sene", "sene"], ["Dobra", "dobra|db|std"], ["Leone", "leone|sll"], ["Florins Néerlandais", "florins hollandais|florins néerlandais|florins|ang|ƒ|florin|fl |"], ["Lilangeni", "lilangeni|szl"], ["Somoni tadjikistan", "somoni tadjikistan|tjs|somoni"], ["Diram", "dirams|diram"], ["Baht thaïlandais", "baht thaïlandais|baht thailandais|baht thaï|baht thai|baht|฿|thb"], ["Satang", "satang|satangs"], ["Paʻanga", "paʻanga|pa'anga|top"], ["Hryvnia ukrainien", "hryvnia ukrainien|hyrvnia|uah|₴|hryvnias ukrainien|hryvnia ukrainienne"], ["Vanuatu vatu", "vanuatu vatu|vatu|vuv"], ["Bolívar vénézuélien", "bolívar vénézuélien|bolivar venezuelien|bs.f.|vef|bolívars vénézuélien|bolivars venezuelien"], ["Dong vietnamien", "dong vietnamien|dongs vietnamiens|dong|đồng|vnd|dông|dông vietnamiens"], ["Kwacha de Zambie", "kwacha de zambie|zk|zmw|kwachas"], ["Dirham marocain", "dirham marocain|mad|د.م."], ["Dirham des Émirats arabes unis", "dirham des Émirats arabes unis|د.إ|aed"], ["Manat azerbaïdjanais", "manat azerbaïdjanais|manat azerbaidjanais|azn"], ["Manat turkmène", "manat turkmène|tmt|manat turkmene"], ["Manat", "manats|manat"], ["Qəpik", "qəpik"], ["Shilling somalien", "shilling somalien|shillings somalien|sos"], ["Shilling tanzanien", "shilling tanzanien|shillings tanzanien|tzs|tsh|shilling tanzanienne|shillings tanzanienne"], ["Shilling ougandais", "shilling ougandais|shillings ougandais|sh|ugx"], ["Leu roumain", "leu roumain|lei|leu roumaine|ron"], ["Leu moldave", "leu meoldave|mdl"], ["Leu", "leu"], ["Ban", "bani|-ban|ban"], ["Roupie népalaise", "roupie népalaise|roupie nepalaise|npr"], ["Roupie pakistanaise", "roupie pakistanaise|pkr"], ["Roupie indienne", "roupie indienne|inr|roupie indien|inr|₹"], ["Roupie seychelloise", "roupie seychelloise|scr|sr|sre"], ["Roupie mauricienne", "roupie mauricienne|mur"], ["Rufiyaa maldives", "rufiyaa maldives|mvr|.ރ|rf"], ["Roupie srilankaise", "roupie srilankaise|lrk|රු|ரூ"], ["Rupiah Indonésie", "rupia indonésie|rupia indonesie|rupiah|rp|idr"], ["Roupie", "roupie"], ["Couronne danoise", "couronne danoise|dkk|couronnes danoise|couronne danemark|couronnes danemark"], ["Couronne norvégienne", "couronne norvégienne|couronne norvegienne|couronnes norvégienne|couronnes norvegienne|nok"], ["Couronne féroïenne", "couronne féroïenne|couronne feroienne"], ["Couronne suédoise", "couronne suédoise|couronne suéde|sek|couronnes suédoise|couronne suedoise"], ["Couronne", "couronne|couronnes"], ["Øre", "Øre|oyra|eyrir"], ["Franc CFA de l'Afrique de l'Ouest", "franc cfa de l''afrique de l''ouest|franc cfa ouest africain|franc cfa|francs cfa|fcfa|frs cfa|cfa francs|xof"], ["Franc CFA d'Afrique centrale", "franc cfa d''afrique centrale|franc cfa centrale|frs cfa centrale|xaf"], ["Franc comorien", "franc comorien|kmf"], ["Franc congolais", "franc congolais|cdf"], ["Franc burundais", "franc burundais|bif"], ["Franc djiboutienne", "franc djiboutienne|djf"], ["Franc CFP", "franc cfp|xpf"], ["Franc guinéen", "franc guinéen|gnf"], ["Franc Suisse", "franc suisse|chf|sfr.|francs suisses"], ["Franc rwandais", "franc rwandais|rwf|rw|r₣|frw"], ["Franc belge", "franc belge|bi.|b.fr.|bef"], ["Rappen", "rappen|-rappen"], ["Franc", "francs|franc|fr.|fs"], ["Centimes", "centimes|centime|santim"], ["Rouble russe", "rouble russe|rub|₽|₽ russe|roubles russe|roubles russes|₽ russes"], ["Nouveau rouble biélorusse", "nouveau rouble biélorusse|byn|nouveau roubles biélorusse|nouveau rouble bielorusse|nouveau roubles biélorusse"], ["Rouble transnistriens", "rouble transnistriens|prb"], ["Rouble biélorusses", "rouble biélorusses|roubles biélorusses|rouble bielorusses|roubles bielorusses"], ["Kopek", "kopek|kopeks"], ["Kapyeyka", "kapyeyka"], ["Rouble", "roubles|rouble|br"], ["Dinar algérien", "dinar algérien|د.ج|dzd|dinars algérien|dinar algerien|dinars algerien"], ["Dinar de bahreïn", "dinar de bahreïn|bhd|.د.ب|dinar de bahrein"], ["Santeem", "santeem|santeems"], ["Dinar iraquien", "dinar iraquien|dinars iraquien|iqd|ع.د|dinar iraquienne|dinars iraquienne"], ["Dinar jordanien", "dinar jordanien|dinars jordanien|د.ا|jod"], ["Dinar koweïtien", "dinar koweïtien|dinar koweitien|dinars koweïtien|kwd|د.ك"], ["Dinar libyen", "dinar libyen|dinars libyen|lyd"], ["Dinar serbe", "dinar serbe|dinars serbe|rsd|дин."], ["Dinar tunisien", "dinar tunisien|dinars tunisien|tnd"], ["Dinar yougoslave", "dinar yougoslave|dinars yougoslave|yun"], ["Dinar", "dinars|dinar|denar|-dinars|-dinar"], ["Fils", "fils|fulūs|-fils|-fil"], ["Para", "para|napa"], ["Millime", "millimes|millime"], ["Peso argentin", "peso argentin|ars|pesos argentin|peso argentine|pesos argentine"], ["Peso chilien", "peso chilien|pesos chilien|clp"], ["Peso colombien", "peso colombien|pesos colombien|cop|peso colombie|pesos colombien"], ["Peso cubains convertibles", "peso cubains convertibles|pesos cubains convertibles|cuc"], ["Peso cubains", "peso cubaines|pesos cubaines|peso cubaine|pesos cubaines|cup"], ["Peso dominicain", "peso dominicain|pesos dominicain|dop|peso dominicaine|pesos dominicaine"], ["Peso philippin", "peso philippin|pesos philippin|piso|₱|php"], ["Peso uruguayen", "peso uruguayen|pesos uruguayen|uyu"], ["Peso", "pesos|Peso"], ["Centavo", "centavos|Centavo"], ["Livre britannique", "livre britannique|livres britannique|gbp|£ britannique"], ["Livre guernesey", "livre guernesey|£ guernesey|ggp"], ["Livre ascension", "livre ascension|livres ascension|£ ascension"], ["Livre sainte-hélène", "livre de sainte-hélène|livre sainte-hélène|livre sainte-helene|livre de sainte hélène|shp"], ["Livre égyptienne", "livre égyptienne|livre egyptienne|egp|ج.م"], ["Livre des îles falkland", "livre des îles falkland|livre des iles falkland|fkp|£ iles falkland"], ["Livre gibraltar", "livre gibraltar|livre de gibraltar|£ gibraltar|gip"], ["Livre manx", "imp|livre manx|£ manx"], ["Livre jersey", "livre de jersey|livre jersey|jep|£ jersey"], ["Livre libanaise", "livre libanaise|£ libanaise|livres libanaise|lbp|ل.ل"], ["Livre des îles malouines", "livre des îles malouines|livre des iles malouines|£ iles malouines"], ["Livre sud-soudanaise", "livre sud-soudanaise|livre sud soudanaise|livre du soudan du sud|livres sud-soudanaises|livre sud soudan|livre soudan sud"], ["Livre soudanaise", "livre soudanaise|livres soudanaise|sdg|£ soudan|ج.س.|livre soudan|livres soudan"], ["Livre syrienne", "livre syrienne|ل.س|syp|livre syrie|livres syrie|£ syrie"], ["Livre", "livre|livres|-livre|-livres|£"], ["Pence", "pence"], ["Shilling", "shilling|shillings"], ["Penny", "penny|sou|centime"], ["Dollar Américain", "dollar américain|$ américain|$ americain|usd|$usd|$ usd|dollar americain|dollar États-Unis|dollar des États-Unis|dollar États Unis|dollar etats unis|dollar etats-unis|$ etats-unis|$ États-Unis"], ["Dollar des Caraïbes orientales", "dollar des caraïbes orientales|dollar des caraibes orientales|xcd|$ caraibes orientales|$ caraïbes orientales"], ["Dollar Australien", "dollar australien|dollars australiens|$ australien|aud|$australien|australien $|$ australie|dollar australie"], ["Dollar des bahamas", "dollar des bahamas|dollar bahamas|$ bahamas|bsd|bahama $|dollar bahama|$ bahamas"], ["Dollar bermudes", "dollar des bermudes|dollar bermude|dollar bermudes|$ bermudes|bmd"], ["Dollar belize", "dollar de Belize|dollar belizien|bzd|$ belize"], ["Dollar îles Vierges britanniques", "dollar îles vierges britanniques|dollar iles vierges britanniques|$ iles vierges britanniques"], ["Dollar brunei", "dollar de brunei|$ brunei|bnd|dollar brunei"], ["Sen", "sen"], ["Dollar singapour", "dollar de singapour|dollar singapour|$ sinapour|sgd|$s"], ["Dollar Canadien", "dollar canadien|dollars canadien|$ canadien|cad|$can|$c|$ c|dollar canada|dollar canadienne|$ canada|$cad|cad$"], ["Dollar iles caimanes", "dollars des îles caïmanes|dollar des îles caïmanes|dollars des iles caimanes|dollar iles caimanes|kyd|$ci"], ["Dollar néo-zélandais", "dollar néo-zélandais|dollar néo zélandais|dollar neo-zelandais|dollar neo zelandais|$nz|$ néo-zélandais|$ neo zelandais"], ["Dollar îles cook", "dollar îles cook|dollar iles cook|$ iles cook"], ["Dollar des fidji", "dollar des fidji|$ fidji|dollar fidji|dollar de fidji|dollars des fidji|dollars de fidji"], ["Dollar guyanien", "dollar guyanien|dollar du guyana|dollar dre guyana|$ guayana|gyd|$gy"], ["Dollar de Hong Kong", "dollar hong kong|dollar hongkong|dollar de hong kong|dollar de hongkong|$hk|$ hk|hkd|hk $|hk$|dollar hk|$hongkong|dollars hongkong|dollars hong kong"], ["Dollar jamaïcain", "dollar jamaïcain|dollars jamaïcain|dollar jamaicain|dollars jamaicain|$j|$ jamaïque|dollar jamaïque|jmd"], ["Dollar libérien", "dollar libérien|dollars libérien|dollar liberien|dollars liberien|lrd|$ libérien|$ liberia|$ liberien"], ["Dollar namibien", "dollar namibien|dollars namibien|$ namibien|nad|$n|dollar namibie|dollars namibie|$ namibie"], ["Dollar des îles salomon", "dollar des îles Salomon|dollar des iles salomon|$si|sbd|$ iles salomon|$ îles salomon"], ["Dollar du suriname", "dollar du suriname|srd|$ du suriname|$ suriname|dollar suriname|dollars suriname|dollars du suriname"], ["Nouveau dollar de Taïwan", "nouveau dollar de taïwan|nouveau dollar de taiwan|twd|ntd|$nt"], ["Dollar trinidadien", "dollar trinidadien|dollars trinidadien|ttd|$ trinidadien"], ["Dollar", "dollar|$|dollars"], ["Yuan Chinois", "yuan|yuans|yuan chinois|renminbi|cny|rmb|¥"], ["Fen", "fen"], ["Jiao", "jiao"], ["Mark Finlandais", "marks finlandais|mark finlandais|fim|mark"]]); + FrenchNumericWithUnit.CompoundUnitConnectorRegex = `(?[^.])`; + FrenchNumericWithUnit.CurrencyPrefixList = new Map([["Dollar", "$"], ["Dollar États-Unis", "$us|usd|us$"], ["Dollar Caraïbes orientales", "xcd|$ec"], ["Dollar australien", "a$|$a|aud"], ["Dollar bahamas", "bsd|b$"], ["Dollar barbadien", "bbd|bds$"], ["Dollar de belize", "bz$|bzd"], ["Dollar des bermudes", "bd$|bmd"], ["Dollar de brunei", "brunei $|bnd"], ["Dollar de Singapour", "s$|sgd"], ["Dollar Canadien", "cad|$ ca|$ca|$ c"], ["Dollar des îles Caïmans", "ci$|kyd"], ["Dollar néo-zélandais", "nz$|nzd"], ["Dollar de Fidji", "$fj|fjd"], ["Dolar guyanien", "g$|gyd"], ["Dollar de Hong Kong", "hkd|hk$"], ["Dollar jamaïcain", "j$|jmd"], ["Dollar libérien", "lrd|l$"], ["Dollar namibien", "nad|n$"], ["Dollar des îles Salomon", "$ si|$si|sbd"], ["Nouveau dollar de Taïwan", "nt$|twd"], ["Réal brésilien", "r$|brl|reais"], ["Guaraní paraguayen", "₲|gs.|pyg"], ["Dollar trinidadien", "ttd|titis"], ["Yuan renminbi", "cny|rmb|¥|元"], ["Yen", "¥|jpy"], ["Euro", "€|eur"], ["Pound", "£"], ["Florín", "ƒ"], ["Livre", "£|gbp"]]); + FrenchNumericWithUnit.AmbiguousCurrencyUnitList = ['din.', 'kina', 'lari', 'taka', 'tala', 'vatu', 'yuan', 'bob', 'btn', 'cop', 'cup', 'dop', 'gip', 'jod', 'kgs', 'lak', 'mga', 'mop', 'nad', 'omr', 'sar', 'sbd', 'scr', 'sdg', 'sek', 'sos', 'std', 'try', 'yer']; + FrenchNumericWithUnit.InformationSuffixList = new Map([["Bit", "-bit|bit|bits"], ["Kilobit", "kilobit|kilobits|kb|kbit|kbits"], ["Megabit", "megabit|megabits|Mb|Mbit|mégabit|mégabits"], ["Gigabit", "gigabit|gigabits|Gb|Gbit"], ["Terabit", "terabit|terabits|Tb|Tbit|térabit|térabits"], ["Petabit", "petabit|petabits|Pb|Pbit|pétabit|pétabits"], ["octet", "octet|octets|-octet"], ["Kilooctet", "kilo-octet|kilo-octets|kilooctet|kilooctets|ko|kio|kB|KiB|kilobyte|kilobytes"], ["Mégaoctet", "mégaoctet|mégaoctets|méga-octet|méga-octets|Mo|Mio|MB|mégabyte|mégabytes"], ["Gigaoctet", "gigaoctet|gigaoctets|Go|Gio|GB|GiB|gigabyte|gigabytes"], ["Téraoctet", "téraoctet|téraoctets|To|Tio|TB|TiB|térabyte|térabytes"], ["Pétaoctet", "pétaoctet|pétaoctets|Po|Pio|PB|PiB|pétabyte|pétabytes"]]); + FrenchNumericWithUnit.AmbiguousDimensionUnitList = ['mi', 'barils', 'grain', 'l', 'pierre', 'fps', 'pts']; + FrenchNumericWithUnit.BuildPrefix = `(?<=(\\s|^|\\P{L}))`; + FrenchNumericWithUnit.BuildSuffix = `(?=(\\s|\\P{L}|$))`; + FrenchNumericWithUnit.ConnectorToken = 'de'; + FrenchNumericWithUnit.LengthSuffixList = new Map([["Kilomètres", "km|kilomètres|kilomètre|kilometres|kilometre|-km"], ["Hectomètre", "hm|hectomètre|hectomètres|hectometre|hectometres|-hm"], ["Décamètre", "dam|décamètre|décamètres|decametre|decametres|-dm"], ["Mètres", "m|mètres|mètre|metres|metre|m.|-m"], ["Décimètres", "dm|décimètres|décimètre|decimetres|decimetre"], ["Centimètres", "cm|centimètres|centimètre|centimetres|centimetre"], ["Millimètres", "mm|millimètres|millimètre|millimetre|millimetres"], ["Micromètres", "µm|um|micromètres|micromètre|micrometres|micrometre"], ["Nanomètres", "nm|nanometre|nanometres|nanomètres|nanomètre"], ["Picomètres", "pm|picomètre|picomètres|picometres|picometre"], ["Mile", "mi|mile|miles"], ["Pied", "pied|pieds"], ["Yard", "yards|yard|yd"], ["Pouce", "pouce|pouces"]]); + FrenchNumericWithUnit.AmbiguousLengthUnitList = ['m', 'yard', 'yards', 'pm', 'pt', 'pts']; + FrenchNumericWithUnit.AmbuguousLengthUnitList = ['m', 'pouce', 'pm']; + FrenchNumericWithUnit.SpeedSuffixList = new Map([["Mètre par seconde", "m/s|metres/seconde|metres par seconde|metre par seconde|metres par secondes|mètre par seconde|mètres par seconde|mètres par secondes"], ["Kilomètre par heure", "km/h|kilomètre par heure|kilomètres par heure|kilomètres par heures|kilometres par heure|kilometre par heure"], ["Kilomètre par minute", "km/m|kilomètre par minute|kilomètres par minute|kilomètres par minutes|kilometre par minute|kilometre par minutes"], ["Kilomètre par seconde", "km/s|km à la seconde|km a la seconde|kilomètre par seconde|kilomètres par seconde|kilometre par seconde|kilometres par seconde"], ["Miles par heure", "mph|miles par heure|miles à l'heure|miles a l'heure|miles un heure"], ["Noeuds", "noeud|noeuds|nuds"], ["Pied par seconde", "ft/s|pied par seconde|pieds par seconde|pied/s|pieds/s"], ["Pied par minute", "pieds/minute|pied/minute|ft/minute|ft/min|pied/min"]]); + FrenchNumericWithUnit.TemperatureSuffixList = new Map([["Kelvin", "k|K|kelvin"], ["F", "°f|degres f|degrés f|deg f|° f|degrés fahrenheit|degres fahrenheit|fahrenheit"], ["R", "rankine|°r|° r"], ["C", "°c|deg c|degrés celsius|degrés c|degres celsius|celsius|deg celsius|degs celsius|centigrade|deg centigrade|degs centigrade|degrés centigrade|degres centigrade|degré centigrade|degre centigrade"], ["Degré", "degrés|degres|deg.|°| °|degré|degre|deg"]]); + FrenchNumericWithUnit.VolumeSuffixList = new Map([["Mètre cube", "m3|m^3|m³|mètre cube|mètres cube|metre cube|metres cube"], ["Centimètre cube", "cm3|cm^3|cm³|centimètre cube|centimètres cube|centimetre cube|centimetres cube"], ["Millimètre cube", "mm3|mm^3|mm³|millimètre cube|millimètres cube|millimetre cube|millimetres cube"], ["Kilomètre cube", "km3|km^3|km³|kilomètre cube|kilomètres cube|kilometre cube|kilometres cube"], ["Pieds cube", "pieds cubes|pieds cube|pied cube|pied cubes"], ["Litre", "litre|litres|lts|l"], ["Millilitre", "ml|millilitre|millilitres"], ["Gallon", "gallon|gallons"], ["Pintes", "pintes"], ["Onces", "onces|once|oz"], ["Décilitre", "dl|décilitre|decilitre|décilitres|decilitres"], ["Centilitre", "cl|centilitres|centilitre"], ["Onces liquides", "onces liquides|once liquide|once liquides"], ["Baril", "baril|barils|bbl"]]); + FrenchNumericWithUnit.AmbiguousVolumeUnitList = ['ounce', 'oz', 'l', 'cup', 'peck', 'cord', 'gill']; + FrenchNumericWithUnit.WeightSuffixList = new Map([["Kilogramme", "kg|kilogramme|kilogrammes|kilo|kilos"], ["Gram", "g|gramme|grammes"], ["Milligramme", "mg|milligramme|milligrammes"], ["Tonne métrique", "tonne métrique|tonnes métrique|tonnes métriques|tonne metrique|tonnes metrique"], ["Tonne", "tonne|tonnes|-tonnes|-tonne"], ["Livre", "livre|livres"]]); + FrenchNumericWithUnit.AmbiguousWeightUnitList = ['g', 'oz', 'stone', 'dram']; +})(FrenchNumericWithUnit = exports.FrenchNumericWithUnit || (exports.FrenchNumericWithUnit = {})); + +}); + +unwrapExports(frenchNumericWithUnit); + +var base$10 = createCommonjsModule(function (module, exports) { +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); + + + + + +class FrenchNumberWithUnitExtractorConfiguration { + constructor(ci) { + this.cultureInfo = ci; + this.unitNumExtractor = new recognizersTextNumber.FrenchNumberExtractor(); + this.buildPrefix = frenchNumericWithUnit.FrenchNumericWithUnit.BuildPrefix; + this.buildSuffix = frenchNumericWithUnit.FrenchNumericWithUnit.BuildSuffix; + this.connectorToken = frenchNumericWithUnit.FrenchNumericWithUnit.ConnectorToken; + this.compoundUnitConnectorRegex = recognizersText.RegExpUtility.getSafeRegExp(frenchNumericWithUnit.FrenchNumericWithUnit.CompoundUnitConnectorRegex); + this.pmNonUnitRegex = recognizersText.RegExpUtility.getSafeRegExp(baseUnits.BaseUnits.PmNonUnitRegex); + } +} +exports.FrenchNumberWithUnitExtractorConfiguration = FrenchNumberWithUnitExtractorConfiguration; +class FrenchNumberWithUnitParserConfiguration extends parsers$8.BaseNumberWithUnitParserConfiguration { + constructor(ci) { + super(ci); + this.internalNumberExtractor = new recognizersTextNumber.FrenchNumberExtractor(recognizersTextNumber.NumberMode.Default); + this.internalNumberParser = recognizersTextNumber.AgnosticNumberParserFactory.getParser(recognizersTextNumber.AgnosticNumberParserType.Number, new recognizersTextNumber.FrenchNumberParserConfiguration()); + this.connectorToken = frenchNumericWithUnit.FrenchNumericWithUnit.ConnectorToken; + } +} +exports.FrenchNumberWithUnitParserConfiguration = FrenchNumberWithUnitParserConfiguration; + +}); + +unwrapExports(base$10); + +var currency$10 = createCommonjsModule(function (module, exports) { +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); + + + + +class FrenchCurrencyExtractorConfiguration extends base$10.FrenchNumberWithUnitExtractorConfiguration { + constructor(ci) { + if (!ci) { + ci = new recognizersTextNumber.CultureInfo(recognizersTextNumber.Culture.French); + } + super(ci); + this.extractType = constants$4.Constants.SYS_UNIT_CURRENCY; + // Reference Source: https:// en.wikipedia.org/wiki/List_of_circulating_currencies + this.suffixList = frenchNumericWithUnit.FrenchNumericWithUnit.CurrencySuffixList; + this.prefixList = frenchNumericWithUnit.FrenchNumericWithUnit.CurrencyPrefixList; + this.ambiguousUnitList = frenchNumericWithUnit.FrenchNumericWithUnit.AmbiguousCurrencyUnitList; + } +} +exports.FrenchCurrencyExtractorConfiguration = FrenchCurrencyExtractorConfiguration; +class FrenchCurrencyParserConfiguration extends base$10.FrenchNumberWithUnitParserConfiguration { + constructor(ci) { + if (!ci) { + ci = new recognizersTextNumber.CultureInfo(recognizersTextNumber.Culture.French); + } + super(ci); + this.BindDictionary(frenchNumericWithUnit.FrenchNumericWithUnit.CurrencySuffixList); + this.BindDictionary(frenchNumericWithUnit.FrenchNumericWithUnit.CurrencyPrefixList); + } +} +exports.FrenchCurrencyParserConfiguration = FrenchCurrencyParserConfiguration; + +}); + +unwrapExports(currency$10); + +var temperature$8 = createCommonjsModule(function (module, exports) { +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); + + + + +class FrenchTemperatureExtractorConfiguration extends base$10.FrenchNumberWithUnitExtractorConfiguration { + constructor(ci) { + if (!ci) { + ci = new recognizersTextNumber.CultureInfo(recognizersTextNumber.Culture.French); + } + super(ci); + this.extractType = constants$4.Constants.SYS_UNIT_TEMPERATURE; + this.suffixList = frenchNumericWithUnit.FrenchNumericWithUnit.TemperatureSuffixList; + this.prefixList = new Map(); + this.ambiguousUnitList = new Array(); + } +} +exports.FrenchTemperatureExtractorConfiguration = FrenchTemperatureExtractorConfiguration; +class FrenchTemperatureParserConfiguration extends base$10.FrenchNumberWithUnitParserConfiguration { + constructor(ci) { + if (!ci) { + ci = new recognizersTextNumber.CultureInfo(recognizersTextNumber.Culture.French); + } + super(ci); + this.connectorToken = null; + this.BindDictionary(frenchNumericWithUnit.FrenchNumericWithUnit.TemperatureSuffixList); + } +} +exports.FrenchTemperatureParserConfiguration = FrenchTemperatureParserConfiguration; + +}); + +unwrapExports(temperature$8); + +var dimension$8 = createCommonjsModule(function (module, exports) { +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); + + + + +const dimensionSuffixList = new Map([ + ...frenchNumericWithUnit.FrenchNumericWithUnit.InformationSuffixList, + ...frenchNumericWithUnit.FrenchNumericWithUnit.AreaSuffixList, + ...frenchNumericWithUnit.FrenchNumericWithUnit.LengthSuffixList, + ...frenchNumericWithUnit.FrenchNumericWithUnit.SpeedSuffixList, + ...frenchNumericWithUnit.FrenchNumericWithUnit.VolumeSuffixList, + ...frenchNumericWithUnit.FrenchNumericWithUnit.WeightSuffixList +]); +class FrenchDimensionExtractorConfiguration extends base$10.FrenchNumberWithUnitExtractorConfiguration { + constructor(ci) { + if (!ci) { + ci = new recognizersTextNumber.CultureInfo(recognizersTextNumber.Culture.French); + } + super(ci); + this.extractType = constants$4.Constants.SYS_UNIT_DIMENSION; + this.suffixList = dimensionSuffixList; + this.prefixList = new Map(); + this.ambiguousUnitList = frenchNumericWithUnit.FrenchNumericWithUnit.AmbiguousDimensionUnitList; + } +} +exports.FrenchDimensionExtractorConfiguration = FrenchDimensionExtractorConfiguration; +class FrenchDimensionParserConfiguration extends base$10.FrenchNumberWithUnitParserConfiguration { + constructor(ci) { + if (!ci) { + ci = new recognizersTextNumber.CultureInfo(recognizersTextNumber.Culture.French); + } + super(ci); + this.BindDictionary(dimensionSuffixList); + } +} +exports.FrenchDimensionParserConfiguration = FrenchDimensionParserConfiguration; + +}); + +unwrapExports(dimension$8); + +var age$10 = createCommonjsModule(function (module, exports) { +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); + + + + +class FrenchAgeExtractorConfiguration extends base$10.FrenchNumberWithUnitExtractorConfiguration { + constructor(ci) { + if (!ci) { + ci = new recognizersTextNumber.CultureInfo(recognizersTextNumber.Culture.French); + } + super(ci); + this.extractType = constants$4.Constants.SYS_UNIT_AGE; + this.suffixList = frenchNumericWithUnit.FrenchNumericWithUnit.AgeSuffixList; + this.prefixList = new Map(); + this.ambiguousUnitList = new Array(); + } +} +exports.FrenchAgeExtractorConfiguration = FrenchAgeExtractorConfiguration; +class FrenchAgeParserConfiguration extends base$10.FrenchNumberWithUnitParserConfiguration { + constructor(ci) { + if (!ci) { + ci = new recognizersTextNumber.CultureInfo(recognizersTextNumber.Culture.French); + } + super(ci); + this.BindDictionary(frenchNumericWithUnit.FrenchNumericWithUnit.AgeSuffixList); + } +} +exports.FrenchAgeParserConfiguration = FrenchAgeParserConfiguration; + +}); + +unwrapExports(age$10); + +var numberWithUnitRecognizer = createCommonjsModule(function (module, exports) { +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); + + + + + + + + + + + + + + + + + + + + + + + + + + + +var NumberWithUnitOptions; +(function (NumberWithUnitOptions) { + NumberWithUnitOptions[NumberWithUnitOptions["None"] = 0] = "None"; +})(NumberWithUnitOptions = exports.NumberWithUnitOptions || (exports.NumberWithUnitOptions = {})); +function recognizeCurrency(query, culture, options = NumberWithUnitOptions.None, fallbackToDefaultCulture = true) { + return recognizeByModel(recognizer => recognizer.getCurrencyModel(culture, fallbackToDefaultCulture), query, culture, options); +} +exports.recognizeCurrency = recognizeCurrency; +function recognizeTemperature(query, culture, options = NumberWithUnitOptions.None, fallbackToDefaultCulture = true) { + return recognizeByModel(recognizer => recognizer.getTemperatureModel(culture, fallbackToDefaultCulture), query, culture, options); +} +exports.recognizeTemperature = recognizeTemperature; +function recognizeDimension(query, culture, options = NumberWithUnitOptions.None, fallbackToDefaultCulture = true) { + return recognizeByModel(recognizer => recognizer.getDimensionModel(culture, fallbackToDefaultCulture), query, culture, options); +} +exports.recognizeDimension = recognizeDimension; +function recognizeAge(query, culture, options = NumberWithUnitOptions.None, fallbackToDefaultCulture = true) { + return recognizeByModel(recognizer => recognizer.getAgeModel(culture, fallbackToDefaultCulture), query, culture, options); +} +exports.recognizeAge = recognizeAge; +function recognizeByModel(getModelFunc, query, culture, options) { + let recognizer = new NumberWithUnitRecognizer(culture, options); + let model = getModelFunc(recognizer); + return model.parse(query); +} +class NumberWithUnitRecognizer extends recognizersText.Recognizer { + constructor(culture, options = NumberWithUnitOptions.None, lazyInitialization = false) { + super(culture, options, lazyInitialization); + } + InitializeConfiguration() { + //#region English + this.registerModel("CurrencyModel", recognizersTextNumber.Culture.English, (options) => new models$6.CurrencyModel(new Map([ + [new extractors$16.BaseMergedUnitExtractor(new currency.EnglishCurrencyExtractorConfiguration()), new parsers$8.BaseMergedUnitParser(new currency.EnglishCurrencyParserConfiguration())] + ]))); + this.registerModel("TemperatureModel", recognizersTextNumber.Culture.English, (options) => new models$6.TemperatureModel(new Map([ + [new extractors$16.NumberWithUnitExtractor(new temperature.EnglishTemperatureExtractorConfiguration()), new parsers$8.NumberWithUnitParser(new temperature.EnglishTemperatureParserConfiguration())] + ]))); + this.registerModel("DimensionModel", recognizersTextNumber.Culture.English, (options) => new models$6.DimensionModel(new Map([ + [new extractors$16.NumberWithUnitExtractor(new dimension.EnglishDimensionExtractorConfiguration()), new parsers$8.NumberWithUnitParser(new dimension.EnglishDimensionParserConfiguration())] + ]))); + this.registerModel("AgeModel", recognizersTextNumber.Culture.English, (options) => new models$6.AgeModel(new Map([ + [new extractors$16.NumberWithUnitExtractor(new age.EnglishAgeExtractorConfiguration()), new parsers$8.NumberWithUnitParser(new age.EnglishAgeParserConfiguration())] + ]))); + //#endregion + //#region Spanish + this.registerModel("CurrencyModel", recognizersTextNumber.Culture.Spanish, (options) => new models$6.CurrencyModel(new Map([ + [new extractors$16.NumberWithUnitExtractor(new currency$2.SpanishCurrencyExtractorConfiguration()), new parsers$8.NumberWithUnitParser(new currency$2.SpanishCurrencyParserConfiguration())] + ]))); + this.registerModel("TemperatureModel", recognizersTextNumber.Culture.Spanish, (options) => new models$6.TemperatureModel(new Map([ + [new extractors$16.NumberWithUnitExtractor(new temperature$2.SpanishTemperatureExtractorConfiguration()), new parsers$8.NumberWithUnitParser(new temperature$2.SpanishTemperatureParserConfiguration())] + ]))); + this.registerModel("DimensionModel", recognizersTextNumber.Culture.Spanish, (options) => new models$6.DimensionModel(new Map([ + [new extractors$16.NumberWithUnitExtractor(new dimension$2.SpanishDimensionExtractorConfiguration()), new parsers$8.NumberWithUnitParser(new dimension$2.SpanishDimensionParserConfiguration())] + ]))); + this.registerModel("AgeModel", recognizersTextNumber.Culture.Spanish, (options) => new models$6.AgeModel(new Map([ + [new extractors$16.NumberWithUnitExtractor(new age$2.SpanishAgeExtractorConfiguration()), new parsers$8.NumberWithUnitParser(new age$2.SpanishAgeParserConfiguration())] + ]))); + //#endregion + //#region Portuguese + this.registerModel("CurrencyModel", recognizersTextNumber.Culture.Portuguese, (options) => new models$6.CurrencyModel(new Map([ + [new extractors$16.NumberWithUnitExtractor(new currency$4.PortugueseCurrencyExtractorConfiguration()), new parsers$8.NumberWithUnitParser(new currency$4.PortugueseCurrencyParserConfiguration())] + ]))); + this.registerModel("TemperatureModel", recognizersTextNumber.Culture.Portuguese, (options) => new models$6.TemperatureModel(new Map([ + [new extractors$16.NumberWithUnitExtractor(new temperature$4.PortugueseTemperatureExtractorConfiguration()), new parsers$8.NumberWithUnitParser(new temperature$4.PortugueseTemperatureParserConfiguration())] + ]))); + this.registerModel("DimensionModel", recognizersTextNumber.Culture.Portuguese, (options) => new models$6.DimensionModel(new Map([ + [new extractors$16.NumberWithUnitExtractor(new dimension$4.PortugueseDimensionExtractorConfiguration()), new parsers$8.NumberWithUnitParser(new dimension$4.PortugueseDimensionParserConfiguration())] + ]))); + this.registerModel("AgeModel", recognizersTextNumber.Culture.Portuguese, (options) => new models$6.AgeModel(new Map([ + [new extractors$16.NumberWithUnitExtractor(new age$4.PortugueseAgeExtractorConfiguration()), new parsers$8.NumberWithUnitParser(new age$4.PortugueseAgeParserConfiguration())] + ]))); + //#endregion + //#region Chinese + this.registerModel("CurrencyModel", recognizersTextNumber.Culture.Chinese, (options) => new models$6.CurrencyModel(new Map([ + [new extractors$16.BaseMergedUnitExtractor(new currency$6.ChineseCurrencyExtractorConfiguration()), new parsers$8.BaseMergedUnitParser(new currency$6.ChineseCurrencyParserConfiguration())], + [new extractors$16.NumberWithUnitExtractor(new currency.EnglishCurrencyExtractorConfiguration()), new parsers$8.NumberWithUnitParser(new currency.EnglishCurrencyParserConfiguration())] + ]))); + this.registerModel("TemperatureModel", recognizersTextNumber.Culture.Chinese, (options) => new models$6.TemperatureModel(new Map([ + [new extractors$16.NumberWithUnitExtractor(new temperature$6.ChineseTemperatureExtractorConfiguration()), new parsers$8.NumberWithUnitParser(new temperature$6.ChineseTemperatureParserConfiguration())], + [new extractors$16.NumberWithUnitExtractor(new temperature.EnglishTemperatureExtractorConfiguration()), new parsers$8.NumberWithUnitParser(new temperature.EnglishTemperatureParserConfiguration())] + ]))); + this.registerModel("DimensionModel", recognizersTextNumber.Culture.Chinese, (options) => new models$6.DimensionModel(new Map([ + [new extractors$16.NumberWithUnitExtractor(new dimension$6.ChineseDimensionExtractorConfiguration()), new parsers$8.NumberWithUnitParser(new dimension$6.ChineseDimensionParserConfiguration())], + [new extractors$16.NumberWithUnitExtractor(new dimension.EnglishDimensionExtractorConfiguration()), new parsers$8.NumberWithUnitParser(new dimension.EnglishDimensionParserConfiguration())] + ]))); + this.registerModel("AgeModel", recognizersTextNumber.Culture.Chinese, (options) => new models$6.AgeModel(new Map([ + [new extractors$16.NumberWithUnitExtractor(new age$6.ChineseAgeExtractorConfiguration()), new parsers$8.NumberWithUnitParser(new age$6.ChineseAgeParserConfiguration())], + [new extractors$16.NumberWithUnitExtractor(new age.EnglishAgeExtractorConfiguration()), new parsers$8.NumberWithUnitParser(new age.EnglishAgeParserConfiguration())] + ]))); + //#endregion + //#region Japanese + this.registerModel("CurrencyModel", recognizersTextNumber.Culture.Japanese, (options) => new models$6.CurrencyModel(new Map([ + [new extractors$16.BaseMergedUnitExtractor(new currency$8.JapaneseCurrencyExtractorConfiguration()), new parsers$8.BaseMergedUnitParser(new currency$8.JapaneseCurrencyParserConfiguration())], + [new extractors$16.NumberWithUnitExtractor(new currency.EnglishCurrencyExtractorConfiguration()), new parsers$8.NumberWithUnitParser(new currency.EnglishCurrencyParserConfiguration())] + ]))); + this.registerModel("AgeModel", recognizersTextNumber.Culture.Japanese, (options) => new models$6.AgeModel(new Map([ + [new extractors$16.NumberWithUnitExtractor(new age$8.JapaneseAgeExtractorConfiguration()), new parsers$8.NumberWithUnitParser(new age$8.JapaneseAgeParserConfiguration())], + [new extractors$16.NumberWithUnitExtractor(new age.EnglishAgeExtractorConfiguration()), new parsers$8.NumberWithUnitParser(new age.EnglishAgeParserConfiguration())] + ]))); + //#endregion + //#region French + this.registerModel("CurrencyModel", recognizersTextNumber.Culture.French, (options) => new models$6.CurrencyModel(new Map([ + [new extractors$16.NumberWithUnitExtractor(new currency$10.FrenchCurrencyExtractorConfiguration()), new parsers$8.NumberWithUnitParser(new currency$10.FrenchCurrencyParserConfiguration())] + ]))); + this.registerModel("TemperatureModel", recognizersTextNumber.Culture.French, (options) => new models$6.TemperatureModel(new Map([ + [new extractors$16.NumberWithUnitExtractor(new temperature$8.FrenchTemperatureExtractorConfiguration()), new parsers$8.NumberWithUnitParser(new temperature$8.FrenchTemperatureParserConfiguration())] + ]))); + this.registerModel("DimensionModel", recognizersTextNumber.Culture.French, (options) => new models$6.DimensionModel(new Map([ + [new extractors$16.NumberWithUnitExtractor(new dimension$8.FrenchDimensionExtractorConfiguration()), new parsers$8.NumberWithUnitParser(new dimension$8.FrenchDimensionParserConfiguration())] + ]))); + this.registerModel("AgeModel", recognizersTextNumber.Culture.French, (options) => new models$6.AgeModel(new Map([ + [new extractors$16.NumberWithUnitExtractor(new age$10.FrenchAgeExtractorConfiguration()), new parsers$8.NumberWithUnitParser(new age$10.FrenchAgeParserConfiguration())] + ]))); + //#endregion + } + IsValidOptions(options) { + return options >= 0 && options <= NumberWithUnitOptions.None; + } + getCurrencyModel(culture = null, fallbackToDefaultCulture = true) { + return this.getModel("CurrencyModel", culture, fallbackToDefaultCulture); + } + getTemperatureModel(culture = null, fallbackToDefaultCulture = true) { + return this.getModel("TemperatureModel", culture, fallbackToDefaultCulture); + } + getDimensionModel(culture = null, fallbackToDefaultCulture = true) { + return this.getModel("DimensionModel", culture, fallbackToDefaultCulture); + } + getAgeModel(culture = null, fallbackToDefaultCulture = true) { + return this.getModel("AgeModel", culture, fallbackToDefaultCulture); + } +} +exports.default = NumberWithUnitRecognizer; + +}); + +unwrapExports(numberWithUnitRecognizer); + +var recognizersTextNumberWithUnit = createCommonjsModule(function (module, exports) { +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); + +exports.NumberWithUnitRecognizer = numberWithUnitRecognizer.default; +exports.NumberWithUnitOptions = numberWithUnitRecognizer.NumberWithUnitOptions; +exports.recognizeTemperature = numberWithUnitRecognizer.recognizeTemperature; +exports.recognizeDimension = numberWithUnitRecognizer.recognizeDimension; +exports.recognizeCurrency = numberWithUnitRecognizer.recognizeCurrency; +exports.recognizeAge = numberWithUnitRecognizer.recognizeAge; + +exports.Culture = recognizersTextNumber.Culture; +exports.CultureInfo = recognizersTextNumber.CultureInfo; + +exports.Constants = constants$4.Constants; + +exports.NumberWithUnitExtractor = extractors$16.NumberWithUnitExtractor; +exports.PrefixUnitResult = extractors$16.PrefixUnitResult; +exports.BaseMergedUnitExtractor = extractors$16.BaseMergedUnitExtractor; + +exports.CompositeEntityType = models$6.CompositeEntityType; +exports.AbstractNumberWithUnitModel = models$6.AbstractNumberWithUnitModel; +exports.AgeModel = models$6.AgeModel; +exports.CurrencyModel = models$6.CurrencyModel; +exports.DimensionModel = models$6.DimensionModel; +exports.TemperatureModel = models$6.TemperatureModel; + +exports.UnitValue = parsers$8.UnitValue; +exports.UnitValueIso = parsers$8.UnitValueIso; +exports.NumberWithUnitParser = parsers$8.NumberWithUnitParser; +exports.BaseNumberWithUnitParserConfiguration = parsers$8.BaseNumberWithUnitParserConfiguration; +exports.BaseCurrencyParser = parsers$8.BaseCurrencyParser; +exports.BaseMergedUnitParser = parsers$8.BaseMergedUnitParser; + +exports.EnglishAgeExtractorConfiguration = age.EnglishAgeExtractorConfiguration; +exports.EnglishAgeParserConfiguration = age.EnglishAgeParserConfiguration; + +exports.EnglishNumberWithUnitExtractorConfiguration = base.EnglishNumberWithUnitExtractorConfiguration; +exports.EnglishNumberWithUnitParserConfiguration = base.EnglishNumberWithUnitParserConfiguration; + +exports.EnglishCurrencyExtractorConfiguration = currency.EnglishCurrencyExtractorConfiguration; +exports.EnglishCurrencyParserConfiguration = currency.EnglishCurrencyParserConfiguration; + +exports.EnglishDimensionExtractorConfiguration = dimension.EnglishDimensionExtractorConfiguration; +exports.EnglishDimensionParserConfiguration = dimension.EnglishDimensionParserConfiguration; + +exports.EnglishTemperatureExtractorConfiguration = temperature.EnglishTemperatureExtractorConfiguration; +exports.EnglishTemperatureParserConfiguration = temperature.EnglishTemperatureParserConfiguration; + +exports.SpanishAgeExtractorConfiguration = age$2.SpanishAgeExtractorConfiguration; +exports.SpanishAgeParserConfiguration = age$2.SpanishAgeParserConfiguration; + +exports.SpanishNumberWithUnitExtractorConfiguration = base$2.SpanishNumberWithUnitExtractorConfiguration; +exports.SpanishNumberWithUnitParserConfiguration = base$2.SpanishNumberWithUnitParserConfiguration; + +exports.SpanishCurrencyExtractorConfiguration = currency$2.SpanishCurrencyExtractorConfiguration; +exports.SpanishCurrencyParserConfiguration = currency$2.SpanishCurrencyParserConfiguration; + +exports.SpanishDimensionExtractorConfiguration = dimension$2.SpanishDimensionExtractorConfiguration; +exports.SpanishDimensionParserConfiguration = dimension$2.SpanishDimensionParserConfiguration; + +exports.SpanishTemperatureExtractorConfiguration = temperature$2.SpanishTemperatureExtractorConfiguration; +exports.SpanishTemperatureParserConfiguration = temperature$2.SpanishTemperatureParserConfiguration; + +exports.PortugueseAgeExtractorConfiguration = age$4.PortugueseAgeExtractorConfiguration; +exports.PortugueseAgeParserConfiguration = age$4.PortugueseAgeParserConfiguration; + +exports.PortugueseNumberWithUnitExtractorConfiguration = base$4.PortugueseNumberWithUnitExtractorConfiguration; +exports.PortugueseNumberWithUnitParserConfiguration = base$4.PortugueseNumberWithUnitParserConfiguration; + +exports.PortugueseCurrencyExtractorConfiguration = currency$4.PortugueseCurrencyExtractorConfiguration; +exports.PortugueseCurrencyParserConfiguration = currency$4.PortugueseCurrencyParserConfiguration; + +exports.PortugueseDimensionExtractorConfiguration = dimension$4.PortugueseDimensionExtractorConfiguration; +exports.PortugueseDimensionParserConfiguration = dimension$4.PortugueseDimensionParserConfiguration; + +exports.PortugueseTemperatureExtractorConfiguration = temperature$4.PortugueseTemperatureExtractorConfiguration; +exports.PortugueseTemperatureParserConfiguration = temperature$4.PortugueseTemperatureParserConfiguration; + +exports.ChineseAgeExtractorConfiguration = age$6.ChineseAgeExtractorConfiguration; +exports.ChineseAgeParserConfiguration = age$6.ChineseAgeParserConfiguration; + +exports.ChineseNumberWithUnitExtractorConfiguration = base$6.ChineseNumberWithUnitExtractorConfiguration; +exports.ChineseNumberWithUnitParserConfiguration = base$6.ChineseNumberWithUnitParserConfiguration; + +exports.ChineseCurrencyExtractorConfiguration = currency$6.ChineseCurrencyExtractorConfiguration; +exports.ChineseCurrencyParserConfiguration = currency$6.ChineseCurrencyParserConfiguration; + +exports.ChineseDimensionExtractorConfiguration = dimension$6.ChineseDimensionExtractorConfiguration; +exports.ChineseDimensionParserConfiguration = dimension$6.ChineseDimensionParserConfiguration; + +exports.ChineseTemperatureExtractorConfiguration = temperature$6.ChineseTemperatureExtractorConfiguration; +exports.ChineseTemperatureParserConfiguration = temperature$6.ChineseTemperatureParserConfiguration; + +exports.JapaneseAgeExtractorConfiguration = age$8.JapaneseAgeExtractorConfiguration; +exports.JapaneseAgeParserConfiguration = age$8.JapaneseAgeParserConfiguration; + +exports.JapaneseNumberWithUnitExtractorConfiguration = base$8.JapaneseNumberWithUnitExtractorConfiguration; +exports.JapaneseNumberWithUnitParserConfiguration = base$8.JapaneseNumberWithUnitParserConfiguration; + +exports.JapaneseCurrencyExtractorConfiguration = currency$8.JapaneseCurrencyExtractorConfiguration; +exports.JapaneseCurrencyParserConfiguration = currency$8.JapaneseCurrencyParserConfiguration; + +exports.EnglishNumericWithUnit = englishNumericWithUnit.EnglishNumericWithUnit; + +exports.SpanishNumericWithUnit = spanishNumericWithUnit.SpanishNumericWithUnit; + +exports.PortugueseNumericWithUnit = portugueseNumericWithUnit.PortugueseNumericWithUnit; + +exports.ChineseNumericWithUnit = chineseNumericWithUnit.ChineseNumericWithUnit; + +exports.JapaneseNumericWithUnit = japaneseNumericWithUnit.JapaneseNumericWithUnit; + +}); + +unwrapExports(recognizersTextNumberWithUnit); + +var baseDateTime$4 = createCommonjsModule(function (module, exports) { +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); + +class TimeResult { + constructor(hour, minute, second, lowBound) { + this.hour = hour; + this.minute = minute; + this.second = second; + this.lowBound = lowBound ? lowBound : -1; + } +} +exports.TimeResult = TimeResult; +class BaseDateTimeExtractor { + constructor(regexesDictionary) { + this.regexesDictionary = regexesDictionary; + } + extract(source, refDate) { + if (!refDate) + refDate = new Date(); + let results = new Array(); + if (recognizersTextNumber.StringUtility.isNullOrEmpty(source)) { + return results; + } + let matchSource = new Map(); + let matched = new Array(source.length); + for (let i = 0; i < source.length; i++) { + matched[i] = false; + } + let collections = []; + this.regexesDictionary.forEach((value, regex) => { + let matches = recognizersTextNumber.RegExpUtility.getMatches(regex, source); + if (matches.length > 0) { + collections.push({ matches: matches, value: value }); + } + }); + collections.forEach(collection => { + collection.matches.forEach(m => { + for (let j = 0; j < m.length; j++) { + matched[m.index + j] = true; + } + // Keep Source Data for extra information + matchSource.set(m, collection.value); + }); + }); + let last = -1; + for (let i = 0; i < source.length; i++) { + if (matched[i]) { + if (i + 1 === source.length || !matched[i + 1]) { + let start = last + 1; + let length = i - last; + let substr = source.substring(start, start + length).trim(); + let srcMatch = Array.from(matchSource.keys()).find(m => m.index === start && m.length === length); + if (srcMatch) { + results.push({ + start: start, + length: length, + text: substr, + type: this.extractorName, + data: matchSource.has(srcMatch) + ? { dataType: matchSource.get(srcMatch), namedEntity: (key) => srcMatch.groups(key) } + : null + }); + } + } + } + else { + last = i; + } + } + return results; + } +} +exports.BaseDateTimeExtractor = BaseDateTimeExtractor; +class TimeResolutionUtils { + static addDescription(lowBoundMap, timeResult, description) { + description = TimeResolutionUtils.normalizeDesc(description); + if (lowBoundMap.has(description) && timeResult.hour < lowBoundMap.get(description)) { + timeResult.hour += 12; + timeResult.lowBound = lowBoundMap.get(description); + } + else { + timeResult.lowBound = 0; + } + } + static normalizeDesc(description) { + description = description.replace(/\s/g, ''); + description = description.replace(/\./g, ''); + return description; + } + static matchToValue(onlyDigitMatch, numbersMap, source) { + if (recognizersTextNumber.StringUtility.isNullOrEmpty(source)) { + return -1; + } + if (recognizersTextNumber.RegExpUtility.isMatch(onlyDigitMatch, source)) { + return Number.parseInt(source); + } + if (source.length === 1) { + return numbersMap.get(source); + } + let value = 1; + for (let index = 0; index < source.length; index++) { + let char = source.charAt(index); + if (char === '十') { + value *= 10; + } + else if (index === 0) { + value *= numbersMap.get(char); + } + else { + value += numbersMap.get(char); + } + } + return value; + } +} +exports.TimeResolutionUtils = TimeResolutionUtils; + +}); + +unwrapExports(baseDateTime$4); + +var durationConfiguration$6 = createCommonjsModule(function (module, exports) { +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); + + + + + + + + + +var DurationType; +(function (DurationType) { + DurationType[DurationType["WithNumber"] = 0] = "WithNumber"; +})(DurationType = exports.DurationType || (exports.DurationType = {})); +class DurationExtractorConfiguration extends recognizersTextNumberWithUnit.ChineseNumberWithUnitExtractorConfiguration { + constructor() { + super(new recognizersTextNumber.CultureInfo(recognizersTextNumber.Culture.Chinese)); + this.extractType = constants$2.Constants.SYS_DATETIME_DURATION; + this.suffixList = chineseDateTime.ChineseDateTime.DurationSuffixList; + this.prefixList = new Map(); + this.ambiguousUnitList = chineseDateTime.ChineseDateTime.DurationAmbiguousUnits; + } +} +class ChineseDurationExtractor extends baseDateTime$4.BaseDateTimeExtractor { + constructor() { + super(null); + this.extractorName = constants$2.Constants.SYS_DATETIME_DURATION; // "Duration"; + this.extractor = new recognizersTextNumberWithUnit.NumberWithUnitExtractor(new DurationExtractorConfiguration()); + this.yearRegex = recognizersText.RegExpUtility.getSafeRegExp(chineseDateTime.ChineseDateTime.DurationYearRegex); + this.halfSuffixRegex = recognizersText.RegExpUtility.getSafeRegExp(chineseDateTime.ChineseDateTime.DurationHalfSuffixRegex); + } + extract(source, refDate) { + if (!refDate) + refDate = new Date(); + let results = new Array(); + this.extractor.extract(source).forEach(result => { + // filter + if (recognizersText.RegExpUtility.isMatch(this.yearRegex, result.text)) { + return; + } + // match suffix + let suffix = source.substr(result.start + result.length); + let suffixMatch = recognizersText.RegExpUtility.getMatches(this.halfSuffixRegex, suffix).pop(); + if (suffixMatch && suffixMatch.index === 0) { + result.text = result.text + suffixMatch.value; + result.length += suffixMatch.length; + } + results.push(result); + }); + return results; + } +} +exports.ChineseDurationExtractor = ChineseDurationExtractor; +class ChineseDurationParserConfiguration { + constructor() { + this.unitValueMap = chineseDateTime.ChineseDateTime.DurationUnitValueMap; + } +} +class DurationParserConfiguration extends recognizersTextNumberWithUnit.ChineseNumberWithUnitParserConfiguration { + constructor() { + super(new recognizersTextNumber.CultureInfo(recognizersTextNumber.Culture.Chinese)); + this.BindDictionary(chineseDateTime.ChineseDateTime.DurationSuffixList); + } +} +class ChineseDurationParser extends baseDuration.BaseDurationParser { + constructor() { + let config = new ChineseDurationParserConfiguration(); + super(config); + this.internalParser = new recognizersTextNumberWithUnit.NumberWithUnitParser(new DurationParserConfiguration()); + } + parse(extractorResult, referenceDate) { + if (!referenceDate) + referenceDate = new Date(); + let resultValue; + if (extractorResult.type === this.parserName) { + let innerResult = new utilities$2.DateTimeResolutionResult(); + let hasHalfSuffix = extractorResult.text.endsWith('半'); + if (hasHalfSuffix) { + extractorResult.length--; + extractorResult.text = extractorResult.text.substr(0, extractorResult.length); + } + let parserResult = this.internalParser.parse(extractorResult); + let unitResult = parserResult.value; + if (!unitResult) { + return new parsers$4.DateTimeParseResult(); + } + let unitStr = unitResult.unit; + let numberStr = unitResult.number; + if (hasHalfSuffix) { + numberStr = (Number.parseFloat(numberStr) + 0.5).toString(); + } + innerResult.timex = `P${this.isLessThanDay(unitStr) ? 'T' : ''}${numberStr}${unitStr.charAt(0)}`; + innerResult.futureValue = Number.parseFloat(numberStr) * this.config.unitValueMap.get(unitStr); + innerResult.pastValue = Number.parseFloat(numberStr) * this.config.unitValueMap.get(unitStr); + innerResult.futureResolution = {}; + innerResult.futureResolution[constants$2.TimeTypeConstants.DURATION] = innerResult.futureValue.toString(); + innerResult.pastResolution = {}; + innerResult.pastResolution[constants$2.TimeTypeConstants.DURATION] = innerResult.pastValue.toString(); + innerResult.success = true; + resultValue = innerResult; + } + let result = new parsers$4.DateTimeParseResult(extractorResult); + result.value = resultValue; + result.timexStr = resultValue ? resultValue.timex : ''; + result.resolutionStr = ''; + return result; + } +} +exports.ChineseDurationParser = ChineseDurationParser; + +}); + +unwrapExports(durationConfiguration$6); + +var timeConfiguration$6 = createCommonjsModule(function (module, exports) { +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); + + + + + + + +var TimeType; +(function (TimeType) { + TimeType[TimeType["ChineseTime"] = 0] = "ChineseTime"; + TimeType[TimeType["LessTime"] = 1] = "LessTime"; + TimeType[TimeType["DigitTime"] = 2] = "DigitTime"; +})(TimeType = exports.TimeType || (exports.TimeType = {})); +class ChineseTimeExtractor extends baseDateTime$4.BaseDateTimeExtractor { + constructor() { + super(new Map([ + [recognizersText.RegExpUtility.getSafeRegExp(chineseDateTime.ChineseDateTime.TimeRegexes1), TimeType.ChineseTime], + [recognizersText.RegExpUtility.getSafeRegExp(chineseDateTime.ChineseDateTime.TimeRegexes2), TimeType.DigitTime], + [recognizersText.RegExpUtility.getSafeRegExp(chineseDateTime.ChineseDateTime.TimeRegexes3), TimeType.LessTime] + ])); + this.extractorName = constants$2.Constants.SYS_DATETIME_TIME; // "Time"; + } +} +exports.ChineseTimeExtractor = ChineseTimeExtractor; +class ChineseTimeParser extends baseTime.BaseTimeParser { + constructor() { + super(null); + this.functionMap = new Map([ + [TimeType.DigitTime, x => this.handleDigit(x)], + [TimeType.ChineseTime, x => this.handleChinese(x)], + [TimeType.LessTime, x => this.handleLess(x)] + ]); + this.onlyDigitMatch = recognizersText.RegExpUtility.getSafeRegExp('\\d+'); + this.numbersMap = chineseDateTime.ChineseDateTime.TimeNumberDictionary; + this.lowBoundMap = chineseDateTime.ChineseDateTime.TimeLowBoundDesc; + this.innerExtractor = new ChineseTimeExtractor(); + } + parse(er, referenceTime) { + if (!referenceTime) + referenceTime = new Date(); + let extra = er.data; + if (!extra) { + let innerResult = this.innerExtractor.extract(er.text, referenceTime).pop(); + extra = innerResult.data; + } + let timeResult = this.functionMap.get(extra.dataType)(extra); + let parseResult = this.packTimeResult(extra, timeResult, referenceTime); + if (parseResult.success) { + parseResult.futureResolution = {}; + parseResult.futureResolution[constants$2.TimeTypeConstants.TIME] = utilities$2.FormatUtil.formatTime(parseResult.futureValue); + parseResult.pastResolution = {}; + parseResult.pastResolution[constants$2.TimeTypeConstants.TIME] = utilities$2.FormatUtil.formatTime(parseResult.pastValue); + } + let result = new parsers$4.DateTimeParseResult(er); + result.value = parseResult; + result.data = timeResult; + result.resolutionStr = ''; + result.timexStr = parseResult.timex; + return result; + } + handleLess(extra) { + let hour = this.matchToValue(extra.namedEntity('hour').value); + let quarter = this.matchToValue(extra.namedEntity('quarter').value); + let minute = !recognizersText.StringUtility.isNullOrEmpty(extra.namedEntity('half').value) + ? 30 + : quarter !== -1 ? quarter * 15 : 0; + let second = this.matchToValue(extra.namedEntity('sec').value); + let less = this.matchToValue(extra.namedEntity('min').value); + let all = hour * 60 + minute - less; + if (all < 0) { + all += 1440; + } + return new baseDateTime$4.TimeResult(all / 60, all % 60, second); + } + handleChinese(extra) { + let hour = this.matchToValue(extra.namedEntity('hour').value); + let quarter = this.matchToValue(extra.namedEntity('quarter').value); + let minute = !recognizersText.StringUtility.isNullOrEmpty(extra.namedEntity('half').value) + ? 30 + : quarter !== -1 ? quarter * 15 + : this.matchToValue(extra.namedEntity('min').value); + let second = this.matchToValue(extra.namedEntity('sec').value); + return new baseDateTime$4.TimeResult(hour, minute, second); + } + handleDigit(extra) { + return new baseDateTime$4.TimeResult(this.matchToValue(extra.namedEntity('hour').value), this.matchToValue(extra.namedEntity('min').value), this.matchToValue(extra.namedEntity('sec').value)); + } + packTimeResult(extra, timeResult, referenceTime) { + let result = new utilities$2.DateTimeResolutionResult(); + let dayDescription = extra.namedEntity('daydesc').value; + let noDescription = recognizersText.StringUtility.isNullOrEmpty(dayDescription); + if (noDescription) { + result.comment = 'ampm'; + } + else { + this.addDescription(timeResult, dayDescription); + } + let hour = timeResult.hour > 0 ? timeResult.hour : 0; + let min = timeResult.minute > 0 ? timeResult.minute : 0; + let sec = timeResult.second > 0 ? timeResult.second : 0; + let day = referenceTime.getDate(); + let month = referenceTime.getMonth(); + let year = referenceTime.getFullYear(); + let timex = 'T'; + if (timeResult.hour >= 0) { + timex = timex + utilities$2.FormatUtil.toString(timeResult.hour, 2); + if (timeResult.minute >= 0) { + timex = timex + ':' + utilities$2.FormatUtil.toString(timeResult.minute, 2); + if (timeResult.second >= 0) { + timex = timex + ':' + utilities$2.FormatUtil.toString(timeResult.second, 2); + } + } + } + if (hour === 24) { + hour = 0; + } + result.futureValue = utilities$2.DateUtils.safeCreateFromMinValue(year, month, day, hour, min, sec); + result.pastValue = utilities$2.DateUtils.safeCreateFromMinValue(year, month, day, hour, min, sec); + result.timex = timex; + result.success = true; + return result; + } + matchToValue(source) { + return baseDateTime$4.TimeResolutionUtils.matchToValue(this.onlyDigitMatch, this.numbersMap, source); + } + addDescription(timeResult, description) { + baseDateTime$4.TimeResolutionUtils.addDescription(this.lowBoundMap, timeResult, description); + } +} +exports.ChineseTimeParser = ChineseTimeParser; + +}); + +unwrapExports(timeConfiguration$6); + +var dateConfiguration$6 = createCommonjsModule(function (module, exports) { +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); + + +const recognizers_text_number_2 = recognizersTextNumber; + + + + + + +class ChineseDateExtractorConfiguration { + constructor() { + this.dateRegexList = [ + recognizersText.RegExpUtility.getSafeRegExp(chineseDateTime.ChineseDateTime.DateRegexList1), + recognizersText.RegExpUtility.getSafeRegExp(chineseDateTime.ChineseDateTime.DateRegexList2), + recognizersText.RegExpUtility.getSafeRegExp(chineseDateTime.ChineseDateTime.DateRegexList3), + recognizersText.RegExpUtility.getSafeRegExp(chineseDateTime.ChineseDateTime.DateRegexList4), + recognizersText.RegExpUtility.getSafeRegExp(chineseDateTime.ChineseDateTime.DateRegexList5), + chineseDateTime.ChineseDateTime.DefaultLanguageFallback === constants$2.Constants.DefaultLanguageFallback_DMY ? + recognizersText.RegExpUtility.getSafeRegExp(chineseDateTime.ChineseDateTime.DateRegexList7) : + recognizersText.RegExpUtility.getSafeRegExp(chineseDateTime.ChineseDateTime.DateRegexList6), + chineseDateTime.ChineseDateTime.DefaultLanguageFallback === constants$2.Constants.DefaultLanguageFallback_DMY ? + recognizersText.RegExpUtility.getSafeRegExp(chineseDateTime.ChineseDateTime.DateRegexList6) : + recognizersText.RegExpUtility.getSafeRegExp(chineseDateTime.ChineseDateTime.DateRegexList7), + recognizersText.RegExpUtility.getSafeRegExp(chineseDateTime.ChineseDateTime.DateRegexList8) + ]; + this.implicitDateList = [ + recognizersText.RegExpUtility.getSafeRegExp(chineseDateTime.ChineseDateTime.LunarRegex), + recognizersText.RegExpUtility.getSafeRegExp(chineseDateTime.ChineseDateTime.SpecialDayRegex), + recognizersText.RegExpUtility.getSafeRegExp(chineseDateTime.ChineseDateTime.DateThisRegex), + recognizersText.RegExpUtility.getSafeRegExp(chineseDateTime.ChineseDateTime.DateLastRegex), + recognizersText.RegExpUtility.getSafeRegExp(chineseDateTime.ChineseDateTime.DateNextRegex), + recognizersText.RegExpUtility.getSafeRegExp(chineseDateTime.ChineseDateTime.WeekDayRegex), + recognizersText.RegExpUtility.getSafeRegExp(chineseDateTime.ChineseDateTime.WeekDayOfMonthRegex), + recognizersText.RegExpUtility.getSafeRegExp(chineseDateTime.ChineseDateTime.SpecialDate) + ]; + } +} +class ChineseDateExtractor extends baseDate.BaseDateExtractor { + constructor() { + super(new ChineseDateExtractorConfiguration()); + this.durationExtractor = new durationConfiguration$6.ChineseDurationExtractor(); + } + extract(source, refDate) { + if (!refDate) + refDate = new Date(); + let referenceDate = refDate; + let tokens = new Array() + .concat(super.basicRegexMatch(source)) + .concat(super.implicitDate(source)) + .concat(this.durationWithBeforeAndAfter(source, referenceDate)); + let result = utilities$2.Token.mergeAllTokens(tokens, source, this.extractorName); + return result; + } + durationWithBeforeAndAfter(source, refDate) { + let ret = []; + let durEx = this.durationExtractor.extract(source, refDate); + durEx.forEach(er => { + let pos = er.start + er.length; + if (pos < source.length) { + let nextChar = source.substr(pos, 1); + if (nextChar === '前' || nextChar === '后') { + ret.push(new utilities$2.Token(er.start, pos + 1)); + } + } + }); + return ret; + } +} +exports.ChineseDateExtractor = ChineseDateExtractor; +class ChineseDateParserConfiguration { + getSwiftDay(source) { + let trimmedSource = source.trim().toLowerCase(); + let swift = 0; + if (trimmedSource === '今天' || trimmedSource === '今日' || trimmedSource === '最近') { + swift = 0; + } + else if (trimmedSource.startsWith('明')) { + swift = 1; + } + else if (trimmedSource.startsWith('昨')) { + swift = -1; + } + else if (trimmedSource === '大后天' || trimmedSource === '大後天') { + swift = 3; + } + else if (trimmedSource === '大前天') { + swift = -3; + } + else if (trimmedSource === '后天' || trimmedSource === '後天') { + swift = 2; + } + else if (trimmedSource === '前天') { + swift = -2; + } + return swift; + } + getSwiftMonth(source) { + let trimmedSource = source.trim().toLowerCase(); + let swift = 0; + if (trimmedSource.startsWith(chineseDateTime.ChineseDateTime.ParserConfigurationNextMonthToken)) { + swift = 1; + } + else if (trimmedSource.startsWith(chineseDateTime.ChineseDateTime.ParserConfigurationLastMonthToken)) { + swift = -1; + } + return swift; + } + getSwift(source) { + return null; + } + isCardinalLast(source) { + return source === chineseDateTime.ChineseDateTime.ParserConfigurationLastWeekDayToken; + } + constructor() { + this.dateRegex = new ChineseDateExtractorConfiguration().dateRegexList; + this.monthOfYear = chineseDateTime.ChineseDateTime.ParserConfigurationMonthOfYear; + this.dayOfMonth = chineseDateTime.ChineseDateTime.ParserConfigurationDayOfMonth; + this.dayOfWeek = chineseDateTime.ChineseDateTime.ParserConfigurationDayOfWeek; + this.specialDayRegex = recognizersText.RegExpUtility.getSafeRegExp(chineseDateTime.ChineseDateTime.SpecialDayRegex); + this.specialDayWithNumRegex = recognizersText.RegExpUtility.getSafeRegExp(chineseDateTime.ChineseDateTime.SpecialDayWithNumRegex); + this.thisRegex = recognizersText.RegExpUtility.getSafeRegExp(chineseDateTime.ChineseDateTime.DateThisRegex); + this.nextRegex = recognizersText.RegExpUtility.getSafeRegExp(chineseDateTime.ChineseDateTime.DateNextRegex); + this.lastRegex = recognizersText.RegExpUtility.getSafeRegExp(chineseDateTime.ChineseDateTime.DateLastRegex); + this.weekDayRegex = recognizersText.RegExpUtility.getSafeRegExp(chineseDateTime.ChineseDateTime.WeekDayRegex); + this.integerExtractor = new recognizersTextNumber.ChineseIntegerExtractor(); + this.numberParser = recognizersTextNumber.AgnosticNumberParserFactory.getParser(recognizersTextNumber.AgnosticNumberParserType.Number, new recognizersTextNumber.ChineseNumberParserConfiguration()); + } +} +class ChineseDateParser extends baseDate.BaseDateParser { + constructor() { + let config = new ChineseDateParserConfiguration(); + super(config); + this.lunarRegex = recognizersText.RegExpUtility.getSafeRegExp(chineseDateTime.ChineseDateTime.LunarRegex); + this.specialDateRegex = recognizersText.RegExpUtility.getSafeRegExp(chineseDateTime.ChineseDateTime.SpecialDate); + this.tokenNextRegex = recognizersText.RegExpUtility.getSafeRegExp(chineseDateTime.ChineseDateTime.DateNextRe); + this.tokenLastRegex = recognizersText.RegExpUtility.getSafeRegExp(chineseDateTime.ChineseDateTime.DateLastRe); + this.monthMaxDays = [31, 29, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31]; + } + parse(extractorResult, referenceDate) { + if (!referenceDate) + referenceDate = new Date(); + let resultValue; + if (extractorResult.type === this.parserName) { + let source = extractorResult.text.toLowerCase(); + let innerResult = this.parseBasicRegexMatch(source, referenceDate); + if (!innerResult.success) { + innerResult = this.parseImplicitDate(source, referenceDate); + } + if (!innerResult.success) { + innerResult = this.parseWeekdayOfMonth(source, referenceDate); + } + if (!innerResult.success) { + // TODO create test + innerResult = this.parserDurationWithAgoAndLater(source, referenceDate); + } + if (innerResult.success) { + innerResult.futureResolution = {}; + innerResult.futureResolution[constants$2.TimeTypeConstants.DATE] = utilities$2.FormatUtil.formatDate(innerResult.futureValue); + innerResult.pastResolution = {}; + innerResult.pastResolution[constants$2.TimeTypeConstants.DATE] = utilities$2.FormatUtil.formatDate(innerResult.pastValue); + innerResult.isLunar = this.parseLunarCalendar(source); + resultValue = innerResult; + } + } + let result = new parsers$4.DateTimeParseResult(extractorResult); + result.value = resultValue; + result.timexStr = resultValue ? resultValue.timex : ''; + result.resolutionStr = ''; + return result; + } + parseLunarCalendar(source) { + return recognizersText.RegExpUtility.isMatch(this.lunarRegex, source.trim()); + } + parseBasicRegexMatch(source, referenceDate) { + let trimmedSource = source.trim(); + let result = new utilities$2.DateTimeResolutionResult(); + this.config.dateRegex.some(regex => { + let match = recognizersText.RegExpUtility.getMatches(regex, trimmedSource).pop(); + if (match && match.index === 0 && match.length === trimmedSource.length) { + result = this.matchToDate(match, referenceDate); + return true; + } + }); + return result; + } + parseImplicitDate(source, referenceDate) { + let trimmedSource = source.trim(); + let result = new utilities$2.DateTimeResolutionResult(); + // handle "on 12" + let match = recognizersText.RegExpUtility.getMatches(this.specialDateRegex, trimmedSource).pop(); + if (match && match.length === trimmedSource.length) { + let day = 0; + let month = referenceDate.getMonth(); + let year = referenceDate.getFullYear(); + let yearStr = match.groups('thisyear').value; + let monthStr = match.groups('thismonth').value; + let dayStr = match.groups('day').value; + day = this.config.dayOfMonth.get(dayStr); + let hasYear = !recognizersText.StringUtility.isNullOrEmpty(yearStr); + let hasMonth = !recognizersText.StringUtility.isNullOrEmpty(monthStr); + if (hasMonth) { + if (recognizersText.RegExpUtility.isMatch(this.tokenNextRegex, monthStr)) { + month++; + if (month === 12) { + month = 0; + year++; + } + } + else if (recognizersText.RegExpUtility.isMatch(this.tokenLastRegex, monthStr)) { + month--; + if (month === -1) { + month = 12; + year--; + } + } + if (hasYear) { + if (recognizersText.RegExpUtility.isMatch(this.tokenNextRegex, yearStr)) { + year++; + } + else if (recognizersText.RegExpUtility.isMatch(this.tokenLastRegex, yearStr)) { + year--; + } + } + } + result.timex = utilities$2.FormatUtil.luisDate(hasYear ? year : -1, hasMonth ? month : -1, day); + let futureDate; + let pastDate; + if (day > this.monthMaxDays[month]) { + futureDate = utilities$2.DateUtils.safeCreateFromMinValue(year, month + 1, day); + pastDate = utilities$2.DateUtils.safeCreateFromMinValue(year, month - 1, day); + } + else { + futureDate = utilities$2.DateUtils.safeCreateFromMinValue(year, month, day); + pastDate = utilities$2.DateUtils.safeCreateFromMinValue(year, month, day); + if (!hasMonth) { + if (futureDate < referenceDate) + futureDate = utilities$2.DateUtils.addMonths(futureDate, 1); + if (pastDate >= referenceDate) + pastDate = utilities$2.DateUtils.addMonths(pastDate, -1); + } + else if (hasMonth && !hasYear) { + if (futureDate < referenceDate) + futureDate = utilities$2.DateUtils.addYears(futureDate, 1); + if (pastDate >= referenceDate) + pastDate = utilities$2.DateUtils.addYears(pastDate, -1); + } + } + result.futureValue = futureDate; + result.pastValue = pastDate; + result.success = true; + return result; + } + // handle cases like "昨日", "明日", "大后天" + match = recognizersText.RegExpUtility.getMatches(this.config.specialDayRegex, trimmedSource).pop(); + if (match && match.index === 0 && match.length === trimmedSource.length) { + let swift = this.config.getSwiftDay(match.value); + let value = utilities$2.DateUtils.addDays(referenceDate, swift); + result.timex = utilities$2.FormatUtil.luisDateFromDate(value); + result.futureValue = value; + result.pastValue = value; + result.success = true; + return result; + } + // handle "this Friday" + match = recognizersText.RegExpUtility.getMatches(this.config.thisRegex, trimmedSource).pop(); + if (match && match.index === 0 && match.length === trimmedSource.length) { + let weekdayStr = match.groups('weekday').value; + let value = utilities$2.DateUtils.this(referenceDate, this.config.dayOfWeek.get(weekdayStr)); + result.timex = utilities$2.FormatUtil.luisDateFromDate(value); + result.futureValue = value; + result.pastValue = value; + result.success = true; + return result; + } + // handle "next Sunday" + match = recognizersText.RegExpUtility.getMatches(this.config.nextRegex, trimmedSource).pop(); + if (match && match.index === 0 && match.length === trimmedSource.length) { + let weekdayStr = match.groups('weekday').value; + let value = utilities$2.DateUtils.next(referenceDate, this.config.dayOfWeek.get(weekdayStr)); + result.timex = utilities$2.FormatUtil.luisDateFromDate(value); + result.futureValue = value; + result.pastValue = value; + result.success = true; + return result; + } + // handle "last Friday", "last mon" + match = recognizersText.RegExpUtility.getMatches(this.config.lastRegex, trimmedSource).pop(); + if (match && match.index === 0 && match.length === trimmedSource.length) { + let weekdayStr = match.groups('weekday').value; + let value = utilities$2.DateUtils.last(referenceDate, this.config.dayOfWeek.get(weekdayStr)); + result.timex = utilities$2.FormatUtil.luisDateFromDate(value); + result.futureValue = value; + result.pastValue = value; + result.success = true; + return result; + } + // handle "Friday" + match = recognizersText.RegExpUtility.getMatches(this.config.weekDayRegex, trimmedSource).pop(); + if (match && match.index === 0 && match.length === trimmedSource.length) { + let weekdayStr = match.groups('weekday').value; + let weekday = this.config.dayOfWeek.get(weekdayStr); + let value = utilities$2.DateUtils.this(referenceDate, weekday); + if (weekday === 0) + weekday = 7; + if (weekday < referenceDate.getDay()) + value = utilities$2.DateUtils.next(referenceDate, weekday); + result.timex = 'XXXX-WXX-' + weekday; + let futureDate = new Date(value); + let pastDate = new Date(value); + if (futureDate < referenceDate) + futureDate = utilities$2.DateUtils.addDays(futureDate, 7); + if (pastDate >= referenceDate) + pastDate = utilities$2.DateUtils.addDays(pastDate, -7); + result.futureValue = futureDate; + result.pastValue = pastDate; + result.success = true; + return result; + } + return result; + } + matchToDate(match, referenceDate) { + let result = new utilities$2.DateTimeResolutionResult(); + let yearStr = match.groups('year').value; + let yearChs = match.groups('yearchs').value; + let monthStr = match.groups('month').value; + let dayStr = match.groups('day').value; + let month = 0; + let day = 0; + let year = 0; + let yearTemp = this.convertChineseYearToNumber(yearChs); + year = yearTemp === -1 ? 0 : yearTemp; + if (this.config.monthOfYear.has(monthStr) && this.config.dayOfMonth.has(dayStr)) { + month = this.getMonthOfYear(monthStr); + day = this.getDayOfMonth(dayStr); + if (!recognizersText.StringUtility.isNullOrEmpty(yearStr)) { + year = Number.parseInt(yearStr, 10); + if (year < 100 && year >= constants$2.Constants.MinTwoDigitYearPastNum) + year += 1900; + else if (year >= 0 && year < constants$2.Constants.MaxTwoDigitYearFutureNum) + year += 2000; + } + } + let noYear = false; + if (year === 0) { + year = referenceDate.getFullYear(); + result.timex = utilities$2.FormatUtil.luisDate(-1, month, day); + noYear = true; + } + else { + result.timex = utilities$2.FormatUtil.luisDate(year, month, day); + } + let futureDate = utilities$2.DateUtils.safeCreateFromMinValue(year, month, day); + let pastDate = utilities$2.DateUtils.safeCreateFromMinValue(year, month, day); + if (noYear && futureDate < referenceDate) { + futureDate = utilities$2.DateUtils.safeCreateFromMinValue(year + 1, month, day); + } + if (noYear && pastDate >= referenceDate) { + pastDate = utilities$2.DateUtils.safeCreateFromMinValue(year - 1, month, day); + } + result.futureValue = futureDate; + result.pastValue = pastDate; + result.success = true; + return result; + } + convertChineseYearToNumber(source) { + let year = 0; + let er = this.config.integerExtractor.extract(source).pop(); + if (er && er.type === recognizers_text_number_2.Constants.SYS_NUM_INTEGER) { + year = Number.parseInt(this.config.numberParser.parse(er).value); + } + if (year < 10) { + year = 0; + for (let i = 0; i < source.length; i++) { + let char = source.charAt(i); + year *= 10; + let er = this.config.integerExtractor.extract(char).pop(); + if (er && er.type === recognizers_text_number_2.Constants.SYS_NUM_INTEGER) { + year += Number.parseInt(this.config.numberParser.parse(er).value); + } + } + } + return year < 10 ? -1 : year; + } + getMonthOfYear(source) { + let month = this.config.monthOfYear.get(source) > 12 + ? this.config.monthOfYear.get(source) % 12 + : this.config.monthOfYear.get(source); + return month - 1; + } + getDayOfMonth(source) { + return this.config.dayOfMonth.get(source) > 31 + ? this.config.dayOfMonth.get(source) % 31 + : this.config.dayOfMonth.get(source); + } +} +exports.ChineseDateParser = ChineseDateParser; + +}); + +unwrapExports(dateConfiguration$6); + +var dateTimeConfiguration$6 = createCommonjsModule(function (module, exports) { +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); + + + + + + + + +class ChineseDateTimeExtractorConfiguration { + constructor() { + this.datePointExtractor = new dateConfiguration$6.ChineseDateExtractor(); + this.timePointExtractor = new timeConfiguration$6.ChineseTimeExtractor(); + this.prepositionRegex = recognizersText.RegExpUtility.getSafeRegExp(chineseDateTime.ChineseDateTime.PrepositionRegex); + this.nowRegex = recognizersText.RegExpUtility.getSafeRegExp(chineseDateTime.ChineseDateTime.NowRegex); + this.nightRegex = recognizersText.RegExpUtility.getSafeRegExp(chineseDateTime.ChineseDateTime.NightRegex); + this.timeOfTodayBeforeRegex = recognizersText.RegExpUtility.getSafeRegExp(chineseDateTime.ChineseDateTime.TimeOfTodayRegex); + } + isConnectorToken(source) { + return recognizersText.StringUtility.isNullOrEmpty(source) + || source === ',' + || recognizersText.RegExpUtility.isMatch(this.prepositionRegex, source); + } +} +class ChineseDateTimeExtractor extends baseDateTime$2.BaseDateTimeExtractor { + constructor() { + super(new ChineseDateTimeExtractorConfiguration()); + } + extract(source, refDate) { + if (!refDate) + refDate = new Date(); + let referenceDate = refDate; + let tokens = new Array() + .concat(this.mergeDateAndTime(source, referenceDate)) + .concat(this.basicRegexMatch(source)) + .concat(this.timeOfToday(source, referenceDate)); + let result = utilities$2.Token.mergeAllTokens(tokens, source, this.extractorName); + return result; + } + mergeDateAndTime(source, refDate) { + let tokens = new Array(); + let ers = this.config.datePointExtractor.extract(source, refDate); + if (ers.length < 1) + return tokens; + ers = ers.concat(this.config.timePointExtractor.extract(source, refDate)); + if (ers.length < 2) + return tokens; + ers = ers.sort((erA, erB) => erA.start < erB.start ? -1 : erA.start === erB.start ? 0 : 1); + let i = 0; + while (i < ers.length - 1) { + let j = i + 1; + while (j < ers.length && recognizersText.ExtractResult.isOverlap(ers[i], ers[j])) { + j++; + } + if (j >= ers.length) + break; + if (ers[i].type === constants$2.Constants.SYS_DATETIME_DATE && ers[j].type === constants$2.Constants.SYS_DATETIME_TIME) { + let middleBegin = ers[i].start + ers[i].length; + let middleEnd = ers[j].start; + if (middleBegin > middleEnd) { + continue; + } + let middleStr = source.substr(middleBegin, middleEnd - middleBegin).trim().toLowerCase(); + if (this.config.isConnectorToken(middleStr)) { + let begin = ers[i].start; + let end = ers[j].start + ers[j].length; + tokens.push(new utilities$2.Token(begin, end)); + } + i = j + 1; + continue; + } + i = j; + } + return tokens; + } + timeOfToday(source, refDate) { + let tokens = new Array(); + this.config.timePointExtractor.extract(source, refDate).forEach(er => { + let beforeStr = source.substr(0, er.start); + let innerMatch = recognizersText.RegExpUtility.getMatches(this.config.nightRegex, er.text).pop(); + if (innerMatch && innerMatch.index === 0) { + beforeStr = source.substr(0, er.start + innerMatch.length); + } + if (recognizersText.StringUtility.isNullOrWhitespace(beforeStr)) + return; + let match = recognizersText.RegExpUtility.getMatches(this.config.timeOfTodayBeforeRegex, beforeStr).pop(); + if (match && recognizersText.StringUtility.isNullOrWhitespace(beforeStr.substr(match.index + match.length))) { + let begin = match.index; + let end = er.start + er.length; + tokens.push(new utilities$2.Token(begin, end)); + } + }); + return tokens; + } +} +exports.ChineseDateTimeExtractor = ChineseDateTimeExtractor; +class ChineseDateTimeParserConfiguration { + constructor() { + this.dateExtractor = new dateConfiguration$6.ChineseDateExtractor(); + this.timeExtractor = new timeConfiguration$6.ChineseTimeExtractor(); + this.dateParser = new dateConfiguration$6.ChineseDateParser(); + this.timeParser = new timeConfiguration$6.ChineseTimeParser(); + this.pmTimeRegex = recognizersText.RegExpUtility.getSafeRegExp(chineseDateTime.ChineseDateTime.DateTimeSimplePmRegex); + this.amTimeRegex = recognizersText.RegExpUtility.getSafeRegExp(chineseDateTime.ChineseDateTime.DateTimeSimpleAmRegex); + this.specificTimeOfDayRegex = recognizersText.RegExpUtility.getSafeRegExp(chineseDateTime.ChineseDateTime.TimeOfTodayRegex); + this.nowRegex = recognizersText.RegExpUtility.getSafeRegExp(chineseDateTime.ChineseDateTime.NowRegex); + } + haveAmbiguousToken(text, matchedText) { + return null; + } + getMatchedNowTimex(text) { + let trimmedText = text.trim().toLowerCase(); + if (trimmedText.endsWith('现在')) { + return { matched: true, timex: 'PRESENT_REF' }; + } + else if (trimmedText === '刚刚才' || trimmedText === '刚刚' || trimmedText === '刚才') { + return { matched: true, timex: 'PAST_REF' }; + } + else if (trimmedText === '立刻' || trimmedText === '马上') { + return { matched: true, timex: 'FUTURE_REF' }; + } + return { matched: false, timex: null }; + } + getSwiftDay(text) { + let swift = 0; + if (text === '明晚' || text === '明早' || text === '明晨') { + swift = 1; + } + else if (text === '昨晚') { + swift = -1; + } + return swift; + } + getHour(text, hour) { + let result = hour; + if (hour < 12 && ['今晚', '明晚', '昨晚'].some(o => o === text)) { + result += 12; + } + else if (hour >= 12 && ['今早', '今晨', '明早', '明晨'].some(o => o === text)) { + result -= 12; + } + return result; + } +} +class ChineseDateTimeParser extends baseDateTime$2.BaseDateTimeParser { + constructor() { + let config = new ChineseDateTimeParserConfiguration(); + super(config); + } + parse(er, refTime) { + if (!refTime) + refTime = new Date(); + let referenceTime = refTime; + let value = null; + if (er.type === baseDateTime$2.BaseDateTimeParser.ParserName) { + let innerResult = this.mergeDateAndTime(er.text, referenceTime); + if (!innerResult.success) { + innerResult = this.parseBasicRegex(er.text, referenceTime); + } + if (!innerResult.success) { + innerResult = this.parseTimeOfToday(er.text, referenceTime); + } + if (innerResult.success) { + innerResult.futureResolution = {}; + innerResult.futureResolution[constants$2.TimeTypeConstants.DATETIME] = utilities$2.FormatUtil.formatDateTime(innerResult.futureValue); + innerResult.pastResolution = {}; + innerResult.pastResolution[constants$2.TimeTypeConstants.DATETIME] = utilities$2.FormatUtil.formatDateTime(innerResult.pastValue); + value = innerResult; + } + } + let ret = new parsers$4.DateTimeParseResult(er); + { + ret.value = value, ret.timexStr = value === null ? "" : value.timex, ret.resolutionStr = ""; + } + + return ret; + } + // merge a Date entity and a Time entity + mergeDateAndTime(text, referenceTime) { + let ret = new utilities$2.DateTimeResolutionResult(); + let er1 = this.config.dateExtractor.extract(text, referenceTime); + if (er1.length === 0) { + return ret; + } + let er2 = this.config.timeExtractor.extract(text, referenceTime); + if (er2.length === 0) { + return ret; + } + let pr1 = this.config.dateParser.parse(er1[0], new Date(referenceTime.toDateString())); + let pr2 = this.config.timeParser.parse(er2[0], referenceTime); + if (pr1.value === null || pr2.value === null) { + return ret; + } + let futureDate = pr1.value.futureValue; + let pastDate = pr1.value.pastValue; + let time = pr2.value.futureValue; + let hour = time.getHours(); + let min = time.getMinutes(); + let sec = time.getSeconds(); + // handle morning, afternoon + if (recognizersText.RegExpUtility.getMatches(this.config.pmTimeRegex, text).length && hour < 12) { + hour += 12; + } + else if (recognizersText.RegExpUtility.getMatches(this.config.amTimeRegex, text).length && hour >= 12) { + hour -= 12; + } + let timeStr = pr2.timexStr; + if (timeStr.endsWith("ampm")) { + timeStr = timeStr.substring(0, timeStr.length - 4); + } + timeStr = "T" + utilities$2.FormatUtil.toString(hour, 2) + timeStr.substring(3); + ret.timex = pr1.timexStr + timeStr; + let val = pr2.value; + if (hour <= 12 && !recognizersText.RegExpUtility.getMatches(this.config.pmTimeRegex, text).length + && !recognizersText.RegExpUtility.getMatches(this.config.amTimeRegex, text).length && val.comment) { + ret.comment = "ampm"; + } + ret.futureValue = new Date(futureDate.getFullYear(), futureDate.getMonth(), futureDate.getDate(), hour, min, sec); + ret.pastValue = new Date(pastDate.getFullYear(), pastDate.getMonth(), pastDate.getDate(), hour, min, sec); + ret.success = true; + return ret; + } + parseTimeOfToday(text, referenceTime) { + let ret = new utilities$2.DateTimeResolutionResult(); + let ers = this.config.timeExtractor.extract(text, referenceTime); + if (ers.length !== 1) { + return ret; + } + let pr = this.config.timeParser.parse(ers[0], referenceTime); + if (pr.value === null) { + return ret; + } + let time = pr.value.futureValue; + let hour = time.getHours(); + let min = time.getMinutes(); + let sec = time.getSeconds(); + let timeStr = pr.timexStr; + let match = recognizersText.RegExpUtility.getMatches(this.config.specificTimeOfDayRegex, text).pop(); + if (match) { + let matchStr = match.value.toLowerCase(); + // handle "last", "next" + let swift = this.config.getSwiftDay(matchStr); + let date = utilities$2.DateUtils.addDays(referenceTime, swift); + hour = this.config.getHour(matchStr, hour); + // in this situation, luisStr cannot end up with "ampm", because we always have a "morning" or "night" + if (timeStr.endsWith("ampm")) { + timeStr = timeStr.substring(0, timeStr.length - 4); + } + timeStr = "T" + utilities$2.FormatUtil.toString(hour, 2) + timeStr.substring(3); + ret.timex = utilities$2.FormatUtil.formatDate(date) + timeStr; + ret.futureValue = ret.pastValue = new Date(date.getFullYear(), date.getMonth(), date.getDate(), hour, min, sec); + ret.success = true; + return ret; + } + return ret; + } +} +exports.ChineseDateTimeParser = ChineseDateTimeParser; + +}); + +unwrapExports(dateTimeConfiguration$6); + +var timePeriodConfiguration$6 = createCommonjsModule(function (module, exports) { +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); + + + + + + + + + +var TimePeriodType; +(function (TimePeriodType) { + TimePeriodType[TimePeriodType["ShortTime"] = 0] = "ShortTime"; + TimePeriodType[TimePeriodType["FullTime"] = 1] = "FullTime"; +})(TimePeriodType = exports.TimePeriodType || (exports.TimePeriodType = {})); +class ChineseTimePeriodExtractor extends baseDateTime$4.BaseDateTimeExtractor { + constructor() { + super(new Map([ + [recognizersText.RegExpUtility.getSafeRegExp(chineseDateTime.ChineseDateTime.TimePeriodRegexes1), TimePeriodType.FullTime], + [recognizersText.RegExpUtility.getSafeRegExp(chineseDateTime.ChineseDateTime.TimePeriodRegexes2), TimePeriodType.ShortTime], + [recognizersText.RegExpUtility.getSafeRegExp(chineseDateTime.ChineseDateTime.TimeOfDayRegex), TimePeriodType.ShortTime] + ])); + this.extractorName = constants$2.Constants.SYS_DATETIME_TIMEPERIOD; // "time range"; + } +} +exports.ChineseTimePeriodExtractor = ChineseTimePeriodExtractor; +class ChineseTimePeriodParserConfiguration { + constructor() { + this.timeParser = new timeConfiguration$6.ChineseTimeParser(); + this.integerExtractor = new recognizersTextNumber.EnglishIntegerExtractor(); + } + getMatchedTimexRange(text) { return null; } +} +class ChineseTimePeriodParser extends baseTimePeriod.BaseTimePeriodParser { + constructor() { + let config = new ChineseTimePeriodParserConfiguration(); + super(config); + this.dayDescriptionRegex = recognizersText.RegExpUtility.getSafeRegExp(chineseDateTime.ChineseDateTime.TimeDayDescRegex); + this.onlyDigitMatch = recognizersText.RegExpUtility.getSafeRegExp('\\d+'); + this.numbersMap = chineseDateTime.ChineseDateTime.TimeNumberDictionary; + this.lowBoundMap = chineseDateTime.ChineseDateTime.TimeLowBoundDesc; + } + parse(er, referenceTime) { + if (!referenceTime) + referenceTime = new Date(); + let result = new parsers$4.DateTimeParseResult(er); + let extra = er.data; + if (!extra) { + return result; + } + let parseResult = this.parseChineseTimeOfDay(er.text, referenceTime); + if (!parseResult.success) { + parseResult = this.parseTimePeriod(extra, referenceTime); + } + if (parseResult.success) { + parseResult.futureResolution = {}; + parseResult.futureResolution[constants$2.TimeTypeConstants.START_TIME] = utilities$2.FormatUtil.formatTime(parseResult.futureValue.item1); + parseResult.futureResolution[constants$2.TimeTypeConstants.END_TIME] = utilities$2.FormatUtil.formatTime(parseResult.futureValue.item2); + parseResult.pastResolution = {}; + parseResult.pastResolution[constants$2.TimeTypeConstants.START_TIME] = utilities$2.FormatUtil.formatTime(parseResult.pastValue.item1); + parseResult.pastResolution[constants$2.TimeTypeConstants.END_TIME] = utilities$2.FormatUtil.formatTime(parseResult.pastValue.item2); + } + result.value = parseResult; + result.resolutionStr = ''; + result.timexStr = parseResult.timex; + return result; + } + parseChineseTimeOfDay(text, referenceTime) { + let day = referenceTime.getDay(), month = referenceTime.getMonth(), year = referenceTime.getFullYear(); + let ret = new utilities$2.DateTimeResolutionResult(); + let parameters = this.GetMatchedTimexRange(text); + if (!parameters.matched) { + return new utilities$2.DateTimeResolutionResult(); + } + ret.timex = parameters.timex; + ret.futureValue = ret.pastValue = { + item1: utilities$2.DateUtils.safeCreateFromMinValue(year, month, day, parameters.beginHour, 0, 0), + item2: utilities$2.DateUtils.safeCreateFromMinValue(year, month, day, parameters.endHour, parameters.endMin, 0) + }; + ret.success = true; + return ret; + } + GetMatchedTimexRange(text) { + let trimmedText = text.trim(), matched = false, timex = null, beginHour = 0, endHour = 0, endMin = 0; + if (trimmedText.endsWith("上午")) { + timex = "TMO"; + beginHour = 8; + endHour = 12; + } + else if (trimmedText.endsWith("下午")) { + timex = "TAF"; + beginHour = 12; + endHour = 16; + } + else if (trimmedText.endsWith("晚上")) { + timex = "TEV"; + beginHour = 16; + endHour = 20; + } + else if (trimmedText.localeCompare("白天") == 0) { + timex = "TDT"; + beginHour = 8; + endHour = 18; + } + else if (trimmedText.endsWith("深夜")) { + timex = "TNI"; + beginHour = 20; + endHour = 23; + endMin = 59; + } + else { + timex = null; + matched = false; + return { matched, timex, beginHour, endHour, endMin }; + } + matched = true; + return { matched, timex, beginHour, endHour, endMin }; + } + parseTimePeriod(extra, referenceTime) { + let result = new utilities$2.DateTimeResolutionResult(); + let leftEntity = extra.namedEntity('left'); + let leftResult = extra.dataType === TimePeriodType.FullTime + ? this.getParseTimeResult(leftEntity, referenceTime) + : this.getShortLeft(leftEntity.value); + let rightEntity = extra.namedEntity('right'); + let rightResult = this.getParseTimeResult(rightEntity, referenceTime); + // the right side doesn't contain desc while the left side does + if (rightResult.lowBound === -1 && leftResult.lowBound !== -1 && rightResult.hour <= leftResult.lowBound) { + rightResult.hour += 12; + } + let leftDate = this.buildDate(leftResult, referenceTime); + let rightDate = this.buildDate(rightResult, referenceTime); + if (rightDate.getHours() < leftDate.getHours()) { + rightDate = utilities$2.DateUtils.addDays(rightDate, 1); + } + result.futureValue = result.pastValue = { + item1: leftDate, + item2: rightDate + }; + let leftTimex = this.buildTimex(leftResult); + let rightTimex = this.buildTimex(rightResult); + let spanTimex = this.buildSpan(leftResult, rightResult); + result.timex = `(${leftTimex},${rightTimex},${spanTimex})`; + result.success = true; + return result; + } + getParseTimeResult(entity, referenceTime) { + let extractResult = { + start: entity.index, + length: entity.length, + text: entity.value, + type: constants$2.Constants.SYS_DATETIME_TIME + }; + let result = this.config.timeParser.parse(extractResult, referenceTime); + return result.data; + } + getShortLeft(source) { + let description = ''; + if (recognizersText.RegExpUtility.isMatch(this.dayDescriptionRegex, source)) { + description = source.substr(0, source.length - 1); + } + let hour = baseDateTime$4.TimeResolutionUtils.matchToValue(this.onlyDigitMatch, this.numbersMap, source.substr(source.length - 1)); + let timeResult = new baseDateTime$4.TimeResult(hour, -1, -1); + baseDateTime$4.TimeResolutionUtils.addDescription(this.lowBoundMap, timeResult, description); + return timeResult; + } + buildDate(time, referenceTime) { + let day = referenceTime.getDate(); + let month = referenceTime.getMonth(); + let year = referenceTime.getFullYear(); + let hour = time.hour > 0 ? time.hour : 0; + let min = time.minute > 0 ? time.minute : 0; + let sec = time.second > 0 ? time.second : 0; + return utilities$2.DateUtils.safeCreateFromMinValue(year, month, day, hour, min, sec); + } + buildTimex(timeResult) { + let timex = 'T'; + if (timeResult.hour >= 0) { + timex = timex + utilities$2.FormatUtil.toString(timeResult.hour, 2); + if (timeResult.minute >= 0) { + timex = timex + ':' + utilities$2.FormatUtil.toString(timeResult.minute, 2); + if (timeResult.second >= 0) { + timex = timex + ':' + utilities$2.FormatUtil.toString(timeResult.second, 2); + } + } + } + return timex; + } + buildSpan(left, right) { + left = this.sanitizeTimeResult(left); + right = this.sanitizeTimeResult(right); + let spanHour = right.hour - left.hour; + let spanMin = right.minute - left.minute; + let spanSec = right.second - left.second; + if (spanSec < 0) { + spanSec += 60; + spanMin -= 1; + } + if (spanMin < 0) { + spanMin += 60; + spanHour -= 1; + } + if (spanHour < 0) { + spanHour += 24; + } + let spanTimex = `PT${spanHour}H`; + if (spanMin !== 0 && spanSec === 0) { + spanTimex = spanTimex + `${spanMin}M`; + } + else if (spanSec !== 0) { + spanTimex = spanTimex + `${spanMin}M${spanSec}S`; + } + return spanTimex; + } + sanitizeTimeResult(timeResult) { + return new baseDateTime$4.TimeResult(timeResult.hour, timeResult.minute === -1 ? 0 : timeResult.minute, timeResult.second === -1 ? 0 : timeResult.second); + } +} +exports.ChineseTimePeriodParser = ChineseTimePeriodParser; + +}); + +unwrapExports(timePeriodConfiguration$6); + +var datePeriodConfiguration$6 = createCommonjsModule(function (module, exports) { +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); + + +const recognizers_text_number_2 = recognizersTextNumber; + + + + + + + + +class ChineseDatePeriodExtractorConfiguration { + constructor() { + this.simpleCasesRegexes = [ + recognizersText.RegExpUtility.getSafeRegExp(chineseDateTime.ChineseDateTime.SimpleCasesRegex), + recognizersText.RegExpUtility.getSafeRegExp(chineseDateTime.ChineseDateTime.OneWordPeriodRegex), + recognizersText.RegExpUtility.getSafeRegExp(chineseDateTime.ChineseDateTime.StrictYearRegex), + recognizersText.RegExpUtility.getSafeRegExp(chineseDateTime.ChineseDateTime.YearToYear), + recognizersText.RegExpUtility.getSafeRegExp(chineseDateTime.ChineseDateTime.YearToYearSuffixRequired), + recognizersText.RegExpUtility.getSafeRegExp(chineseDateTime.ChineseDateTime.YearAndMonth), + recognizersText.RegExpUtility.getSafeRegExp(chineseDateTime.ChineseDateTime.PureNumYearAndMonth), + recognizersText.RegExpUtility.getSafeRegExp(chineseDateTime.ChineseDateTime.DatePeriodYearInChineseRegex), + recognizersText.RegExpUtility.getSafeRegExp(chineseDateTime.ChineseDateTime.WeekOfMonthRegex), + recognizersText.RegExpUtility.getSafeRegExp(chineseDateTime.ChineseDateTime.SeasonWithYear), + recognizersText.RegExpUtility.getSafeRegExp(chineseDateTime.ChineseDateTime.QuarterRegex), + ]; + this.datePointExtractor = new dateConfiguration$6.ChineseDateExtractor(); + this.integerExtractor = new recognizersTextNumber.ChineseIntegerExtractor(); + this.numberParser = new recognizersTextNumber.BaseNumberParser(new recognizersTextNumber.ChineseNumberParserConfiguration()); + this.illegalYearRegex = recognizersText.RegExpUtility.getSafeRegExp(baseDateTime.BaseDateTime.IllegalYearRegex); + this.tillRegex = recognizersText.RegExpUtility.getSafeRegExp(chineseDateTime.ChineseDateTime.DatePeriodTillRegex); + this.followedUnit = recognizersText.RegExpUtility.getSafeRegExp(chineseDateTime.ChineseDateTime.FollowedUnit); + this.numberCombinedWithUnit = recognizersText.RegExpUtility.getSafeRegExp(chineseDateTime.ChineseDateTime.NumberCombinedWithUnit); + this.pastRegex = recognizersText.RegExpUtility.getSafeRegExp(chineseDateTime.ChineseDateTime.PastRegex); + this.futureRegex = recognizersText.RegExpUtility.getSafeRegExp(chineseDateTime.ChineseDateTime.FutureRegex); + } + getFromTokenIndex(source) { + let result = { matched: false, index: -1 }; + if (source.endsWith("从")) { + result.index = source.lastIndexOf("从"); + result.matched = true; + } + return result; + } + ; + getBetweenTokenIndex(source) { + return { matched: false, index: -1 }; + } + ; + hasConnectorToken(source) { + return false; + } +} +class ChineseDatePeriodExtractor extends baseDatePeriod.BaseDatePeriodExtractor { + constructor() { + super(new ChineseDatePeriodExtractorConfiguration()); + } + extract(source, refDate) { + if (!refDate) + refDate = new Date(); + let tokens = new Array() + .concat(super.matchSimpleCases(source)) + .concat(super.mergeTwoTimePoints(source, refDate)) + .concat(this.matchNumberWithUnit(source)); + let result = utilities$2.Token.mergeAllTokens(tokens, source, this.extractorName); + return result; + } + matchNumberWithUnit(source) { + let tokens = new Array(); + let durations = new Array(); + this.config.integerExtractor.extract(source).forEach(er => { + let afterStr = source.substr(er.start + er.length); + let followedUnitMatch = recognizersText.RegExpUtility.getMatches(this.config.followedUnit, afterStr).pop(); + if (followedUnitMatch && followedUnitMatch.index === 0) { + durations.push(new utilities$2.Token(er.start, er.start + er.length + followedUnitMatch.length)); + } + }); + recognizersText.RegExpUtility.getMatches(this.config.numberCombinedWithUnit, source).forEach(match => { + durations.push(new utilities$2.Token(match.index, match.index + match.length)); + }); + durations.forEach(duration => { + let beforeStr = source.substr(0, duration.start).toLowerCase(); + if (recognizersText.StringUtility.isNullOrWhitespace(beforeStr)) { + return; + } + let match = recognizersText.RegExpUtility.getMatches(this.config.pastRegex, beforeStr).pop(); + if (match && recognizersText.StringUtility.isNullOrWhitespace(beforeStr.substr(match.index + match.length))) { + tokens.push(new utilities$2.Token(match.index, duration.end)); + return; + } + match = recognizersText.RegExpUtility.getMatches(this.config.futureRegex, beforeStr).pop(); + if (match && recognizersText.StringUtility.isNullOrWhitespace(beforeStr.substr(match.index + match.length))) { + tokens.push(new utilities$2.Token(match.index, duration.end)); + return; + } + }); + return tokens; + } +} +exports.ChineseDatePeriodExtractor = ChineseDatePeriodExtractor; +class ChineseDatePeriodParserConfiguration { + constructor() { + this.simpleCasesRegex = recognizersText.RegExpUtility.getSafeRegExp(chineseDateTime.ChineseDateTime.SimpleCasesRegex); + this.yearRegex = recognizersText.RegExpUtility.getSafeRegExp(chineseDateTime.ChineseDateTime.DatePeriodYearRegex); + this.seasonRegex = recognizersText.RegExpUtility.getSafeRegExp(chineseDateTime.ChineseDateTime.SeasonRegex); + this.seasonMap = chineseDateTime.ChineseDateTime.ParserConfigurationSeasonMap; + this.quarterRegex = recognizersText.RegExpUtility.getSafeRegExp(chineseDateTime.ChineseDateTime.QuarterRegex); + this.cardinalMap = chineseDateTime.ChineseDateTime.ParserConfigurationCardinalMap; + this.unitMap = chineseDateTime.ChineseDateTime.ParserConfigurationUnitMap; + this.durationExtractor = new durationConfiguration$6.ChineseDurationExtractor(); + this.pastRegex = recognizersText.RegExpUtility.getSafeRegExp(chineseDateTime.ChineseDateTime.PastRegex); + this.futureRegex = recognizersText.RegExpUtility.getSafeRegExp(chineseDateTime.ChineseDateTime.FutureRegex); + this.monthOfYear = chineseDateTime.ChineseDateTime.ParserConfigurationMonthOfYear; + this.dayOfMonth = chineseDateTime.ChineseDateTime.ParserConfigurationDayOfMonth; + this.monthOfYear = chineseDateTime.ChineseDateTime.ParserConfigurationMonthOfYear; + this.oneWordPeriodRegex = recognizersText.RegExpUtility.getSafeRegExp(chineseDateTime.ChineseDateTime.OneWordPeriodRegex); + this.dateExtractor = new dateConfiguration$6.ChineseDateExtractor(); + this.dateParser = new dateConfiguration$6.ChineseDateParser(); + this.tokenBeforeDate = 'on '; + this.weekOfMonthRegex = recognizersText.RegExpUtility.getSafeRegExp(chineseDateTime.ChineseDateTime.WeekOfMonthRegex); + this.thisPrefixRegex = recognizersText.RegExpUtility.getSafeRegExp(chineseDateTime.ChineseDateTime.DatePeriodThisRegex); + this.nextPrefixRegex = recognizersText.RegExpUtility.getSafeRegExp(chineseDateTime.ChineseDateTime.DatePeriodNextRegex); + this.pastPrefixRegex = recognizersText.RegExpUtility.getSafeRegExp(chineseDateTime.ChineseDateTime.DatePeriodLastRegex); + } + getSwiftDayOrMonth(source) { + let trimmedSource = source.trim().toLowerCase(); + if (trimmedSource.endsWith('去年')) { + return -1; + } + if (trimmedSource.endsWith('明年')) { + return 1; + } + if (trimmedSource.endsWith('前年')) { + return -2; + } + if (trimmedSource.endsWith('后年')) { + return 2; + } + if (trimmedSource.startsWith('下个')) { + return 1; + } + if (trimmedSource.startsWith('上个')) { + return -1; + } + if (recognizersText.RegExpUtility.isMatch(this.thisPrefixRegex, trimmedSource)) { + return 0; + } + if (recognizersText.RegExpUtility.isMatch(this.nextPrefixRegex, trimmedSource)) { + return 1; + } + if (recognizersText.RegExpUtility.isMatch(this.pastPrefixRegex, trimmedSource)) { + return -1; + } + return 0; + } + getSwiftYear(source) { + let trimmedSource = source.trim().toLowerCase(); + let swift = -10; + if (trimmedSource.startsWith('明年')) { + swift = 1; + } + else if (trimmedSource.startsWith('去年')) { + swift = -1; + } + else if (trimmedSource.startsWith('今年')) { + swift = 0; + } + return swift; + } + isFuture(source) { + return (recognizersText.RegExpUtility.isMatch(this.thisPrefixRegex, source) + || recognizersText.RegExpUtility.isMatch(this.nextPrefixRegex, source)); + } + isYearToDate(source) { + let trimmedSource = source.trim().toLowerCase(); + return trimmedSource === '今年'; + } + isMonthToDate(source) { + return false; + } + isWeekOnly(source) { + let trimmedSource = source.trim().toLowerCase(); + return trimmedSource.endsWith('周') || trimmedSource.endsWith('星期'); + } + isWeekend(source) { + let trimmedSource = source.trim().toLowerCase(); + return trimmedSource.endsWith('周末'); + } + isMonthOnly(source) { + let trimmedSource = source.trim().toLowerCase(); + return trimmedSource.endsWith('月'); + } + isYearOnly(source) { + let trimmedSource = source.trim().toLowerCase(); + return trimmedSource.endsWith('年'); + } + isLastCardinal(source) { + return source === '最后一'; + } +} +class ChineseDatePeriodParser extends baseDatePeriod.BaseDatePeriodParser { + constructor() { + let config = new ChineseDatePeriodParserConfiguration(); + super(config, false); + this.integerExtractor = new recognizersTextNumber.ChineseIntegerExtractor(); + this.numberParser = recognizersTextNumber.AgnosticNumberParserFactory.getParser(recognizersTextNumber.AgnosticNumberParserType.Integer, new recognizersTextNumber.ChineseNumberParserConfiguration()); + this.yearInChineseRegex = recognizersText.RegExpUtility.getSafeRegExp(chineseDateTime.ChineseDateTime.DatePeriodYearInChineseRegex); + this.numberCombinedWithUnitRegex = recognizersText.RegExpUtility.getSafeRegExp(chineseDateTime.ChineseDateTime.NumberCombinedWithUnit); + this.unitRegex = recognizersText.RegExpUtility.getSafeRegExp(chineseDateTime.ChineseDateTime.UnitRegex); + this.yearAndMonthRegex = recognizersText.RegExpUtility.getSafeRegExp(chineseDateTime.ChineseDateTime.YearAndMonth); + this.pureNumberYearAndMonthRegex = recognizersText.RegExpUtility.getSafeRegExp(chineseDateTime.ChineseDateTime.PureNumYearAndMonth); + this.yearToYearRegex = recognizersText.RegExpUtility.getSafeRegExp(chineseDateTime.ChineseDateTime.YearToYear); + this.YearToYearSuffixRequired = recognizersText.RegExpUtility.getSafeRegExp(chineseDateTime.ChineseDateTime.YearToYearSuffixRequired); + this.chineseYearRegex = recognizersText.RegExpUtility.getSafeRegExp(chineseDateTime.ChineseDateTime.DatePeriodYearInChineseRegex); + this.seasonWithYearRegex = recognizersText.RegExpUtility.getSafeRegExp(chineseDateTime.ChineseDateTime.SeasonWithYear); + } + parse(extractorResult, referenceDate) { + if (!referenceDate) + referenceDate = new Date(); + let resultValue; + if (extractorResult.type === this.parserName) { + let source = extractorResult.text.trim().toLowerCase(); + let innerResult = this.parseSimpleCases(source, referenceDate); + if (!innerResult.success) { + innerResult = this.parseOneWordPeriod(source, referenceDate); + } + if (!innerResult.success) { + innerResult = this.mergeTwoTimePoints(source, referenceDate); + } + if (!innerResult.success) { + innerResult = this.parseNumberWithUnit(source, referenceDate); + } + if (!innerResult.success) { + innerResult = this.parseDuration(source, referenceDate); + } + if (!innerResult.success) { + innerResult = this.parseYearAndMonth(source, referenceDate); + } + if (!innerResult.success) { + innerResult = this.parseYearToYear(source, referenceDate); + } + if (!innerResult.success) { + innerResult = this.parseYear(source, referenceDate); + } + if (!innerResult.success) { + innerResult = this.parseWeekOfMonth(source, referenceDate); + } + if (!innerResult.success) { + innerResult = this.parseSeason(source, referenceDate); + } + if (!innerResult.success) { + innerResult = this.parseQuarter(source, referenceDate); + } + if (innerResult.success) { + if (innerResult.futureValue && innerResult.pastValue) { + innerResult.futureResolution = {}; + innerResult.futureResolution[constants$2.TimeTypeConstants.START_DATE] = utilities$2.FormatUtil.formatDate(innerResult.futureValue[0]); + innerResult.futureResolution[constants$2.TimeTypeConstants.END_DATE] = utilities$2.FormatUtil.formatDate(innerResult.futureValue[1]); + innerResult.pastResolution = {}; + innerResult.pastResolution[constants$2.TimeTypeConstants.START_DATE] = utilities$2.FormatUtil.formatDate(innerResult.pastValue[0]); + innerResult.pastResolution[constants$2.TimeTypeConstants.END_DATE] = utilities$2.FormatUtil.formatDate(innerResult.pastValue[1]); + } + else { + innerResult.futureResolution = {}; + innerResult.pastResolution = {}; + } + resultValue = innerResult; + } + } + let result = new parsers$4.DateTimeParseResult(extractorResult); + result.value = resultValue; + result.timexStr = resultValue ? resultValue.timex : ''; + result.resolutionStr = ''; + return result; + } + getMatchSimpleCase(source) { + return recognizersText.RegExpUtility.getMatches(this.config.simpleCasesRegex, source).pop(); + } + parseSimpleCases(source, referenceDate) { + let result = new utilities$2.DateTimeResolutionResult(); + let year = referenceDate.getFullYear(); + let month = referenceDate.getMonth(); + let noYear = false; + let inputYear = false; + let match = this.getMatchSimpleCase(source); + if (!match || match.index !== 0 || match.length !== source.length) + return result; + let days = match.groups('day'); + let beginDay = this.config.dayOfMonth.get(days.captures[0]); + let endDay = this.config.dayOfMonth.get(days.captures[1]); + let monthStr = match.groups('month').value; + if (!recognizersText.StringUtility.isNullOrEmpty(monthStr)) { + month = this.config.monthOfYear.get(monthStr) - 1; + } + else { + monthStr = match.groups('relmonth').value; + month += this.config.getSwiftDayOrMonth(monthStr); + if (month < 0) { + month = 0; + year--; + } + else if (month > 11) { + month = 11; + year++; + } + } + let yearStr = match.groups('year').value; + if (!recognizersText.StringUtility.isNullOrEmpty(yearStr)) { + year = Number.parseInt(yearStr, 10); + inputYear = true; + } + else { + noYear = true; + } + let beginDateLuis = utilities$2.FormatUtil.luisDate(inputYear || this.config.isFuture(monthStr) ? year : -1, month, beginDay); + let endDateLuis = utilities$2.FormatUtil.luisDate(inputYear || this.config.isFuture(monthStr) ? year : -1, month, endDay); + let futureYear = year; + let pastYear = year; + let startDate = utilities$2.DateUtils.safeCreateFromValue(utilities$2.DateUtils.minValue(), year, month, beginDay); + if (noYear && startDate < referenceDate) + futureYear++; + if (noYear && startDate >= referenceDate) + pastYear--; + result.timex = `(${beginDateLuis},${endDateLuis},P${endDay - beginDay}D)`; + result.futureValue = [ + utilities$2.DateUtils.safeCreateFromValue(utilities$2.DateUtils.minValue(), futureYear, month, beginDay), + utilities$2.DateUtils.safeCreateFromValue(utilities$2.DateUtils.minValue(), futureYear, month, endDay), + ]; + result.pastValue = [ + utilities$2.DateUtils.safeCreateFromValue(utilities$2.DateUtils.minValue(), pastYear, month, beginDay), + utilities$2.DateUtils.safeCreateFromValue(utilities$2.DateUtils.minValue(), pastYear, month, endDay), + ]; + result.success = true; + return result; + } + parseYear(source, referenceDate) { + let trimmedSource = source.trim(); + let result = new utilities$2.DateTimeResolutionResult(); + let isChinese = false; + let match = recognizersText.RegExpUtility.getMatches(this.config.yearRegex, trimmedSource).pop(); + if (!match || match.length !== trimmedSource.length) { + match = recognizersText.RegExpUtility.getMatches(this.yearInChineseRegex, trimmedSource).pop(); + isChinese = (match && match.length === trimmedSource.length); + } + if (!match || match.length !== trimmedSource.length) { + return result; + } + let yearStr = match.value; + if (this.config.isYearOnly(yearStr)) { + yearStr = yearStr.substr(0, yearStr.length - 1).trim(); + } + let year = this.convertYear(yearStr, isChinese); + if (yearStr.length === 2) { + if (year < 100 && year >= 30) { + year += 1900; + } + else if (year < 30) { + year += 2000; + } + } + let beginDay = utilities$2.DateUtils.safeCreateFromMinValue(year, 0, 1); + let endDay = utilities$2.DateUtils.safeCreateFromMinValue(year + 1, 0, 1); + result.timex = utilities$2.FormatUtil.toString(year, 4); + result.futureValue = [beginDay, endDay]; + result.pastValue = [beginDay, endDay]; + result.success = true; + return result; + } + convertYear(yearStr, isChinese) { + let year = -1; + let er; + if (isChinese) { + let yearNum = 0; + er = this.integerExtractor.extract(yearStr).pop(); + if (er && er.type === recognizers_text_number_2.Constants.SYS_NUM_INTEGER) { + yearNum = Number.parseInt(this.numberParser.parse(er).value); + } + if (yearNum < 10) { + yearNum = 0; + for (let index = 0; index < yearStr.length; index++) { + let char = yearStr.charAt(index); + yearNum *= 10; + er = this.integerExtractor.extract(char).pop(); + if (er && er.type === recognizers_text_number_2.Constants.SYS_NUM_INTEGER) { + yearNum += Number.parseInt(this.numberParser.parse(er).value); + } + } + year = yearNum; + } + else { + year = yearNum; + } + } + else { + year = Number.parseInt(yearStr, 10); + } + return year === 0 ? -1 : year; + } + getWeekOfMonth(cardinal, month, year, referenceDate, noYear) { + let result = new utilities$2.DateTimeResolutionResult(); + let seedDate = this.computeDate(cardinal, 1, month, year); + let futureDate = new Date(seedDate); + let pastDate = new Date(seedDate); + if (noYear && futureDate < referenceDate) { + futureDate = this.computeDate(cardinal, 1, month, year + 1); + if (futureDate.getMonth() !== month) { + futureDate.setDate(futureDate.getDate() - 7); + } + } + if (noYear && pastDate >= referenceDate) { + pastDate = this.computeDate(cardinal, 1, month, year - 1); + if (pastDate.getMonth() !== month) { + pastDate.setDate(pastDate.getDate() - 7); + } + } + result.timex = noYear ? + `XXXX-${utilities$2.FormatUtil.toString(month + 1, 2)}-W${utilities$2.FormatUtil.toString(cardinal, 2)}` : + `${utilities$2.FormatUtil.toString(year, 4)}-${utilities$2.FormatUtil.toString(month + 1, 2)}-W${utilities$2.FormatUtil.toString(cardinal, 2)}`; + result.futureValue = [futureDate, utilities$2.DateUtils.addDays(futureDate, this.inclusiveEndPeriod ? 6 : 7)]; + result.pastValue = [pastDate, utilities$2.DateUtils.addDays(pastDate, this.inclusiveEndPeriod ? 6 : 7)]; + result.success = true; + return result; + } + computeDate(cardinal, weekday, month, year) { + let firstDay = new Date(year, month, 1); + let firstWeekday = utilities$2.DateUtils.this(firstDay, weekday); + if (weekday === 0) + weekday = 7; + if (weekday < firstDay.getDay()) + firstWeekday = utilities$2.DateUtils.next(firstDay, weekday); + firstWeekday.setDate(firstWeekday.getDate() + (7 * (cardinal - 1))); + return firstWeekday; + } + parseSeason(source, referenceDate) { + let result = new utilities$2.DateTimeResolutionResult(); + let match = recognizersText.RegExpUtility.getMatches(this.seasonWithYearRegex, source).pop(); + if (!match || match.length !== source.length) + return result; + let year = referenceDate.getFullYear(); + let yearNum = match.groups('year').value; + let yearChinese = match.groups('yearchs').value; + let yearRelative = match.groups('yearrel').value; + let hasYear = false; + if (!recognizersText.StringUtility.isNullOrEmpty(yearNum)) { + hasYear = true; + if (this.config.isYearOnly(yearNum)) { + yearNum = yearNum.substr(0, yearNum.length - 1); + } + year = this.convertYear(yearNum, false); + } + else if (!recognizersText.StringUtility.isNullOrEmpty(yearChinese)) { + hasYear = true; + if (this.config.isYearOnly(yearChinese)) { + yearChinese = yearChinese.substr(0, yearChinese.length - 1); + } + year = this.convertYear(yearChinese, true); + } + else if (!recognizersText.StringUtility.isNullOrEmpty(yearRelative)) { + hasYear = true; + year += this.config.getSwiftDayOrMonth(yearRelative); + } + if (year < 100 && year >= 90) { + year += 1900; + } + else if (year < 100 && year < 20) { + year += 2000; + } + let seasonStr = match.groups('season').value; + let season = this.config.seasonMap.get(seasonStr); + if (hasYear) { + result.timex = `${utilities$2.FormatUtil.toString(year, 4)}-${season}`; + } + result.success = true; + return result; + } + parseQuarter(source, referenceDate) { + let result = new utilities$2.DateTimeResolutionResult(); + let match = recognizersText.RegExpUtility.getMatches(this.config.quarterRegex, source).pop(); + if (!match || match.length !== source.length) + return result; + let year = referenceDate.getFullYear(); + let yearNum = match.groups('year').value; + let yearChinese = match.groups('yearchs').value; + let yearRelative = match.groups('yearrel').value; + if (!recognizersText.StringUtility.isNullOrEmpty(yearNum)) { + if (this.config.isYearOnly(yearNum)) { + yearNum = yearNum.substr(0, yearNum.length - 1); + } + year = this.convertYear(yearNum, false); + } + else if (!recognizersText.StringUtility.isNullOrEmpty(yearChinese)) { + if (this.config.isYearOnly(yearChinese)) { + yearChinese = yearChinese.substr(0, yearChinese.length - 1); + } + year = this.convertYear(yearChinese, true); + } + else if (!recognizersText.StringUtility.isNullOrEmpty(yearRelative)) { + year += this.config.getSwiftDayOrMonth(yearRelative); + } + if (year < 100 && year >= 90) { + year += 1900; + } + else if (year < 100 && year < 20) { + year += 2000; + } + let cardinalStr = match.groups('cardinal').value; + let quarterNum = this.config.cardinalMap.get(cardinalStr); + let beginDate = utilities$2.DateUtils.safeCreateFromValue(utilities$2.DateUtils.minValue(), year, quarterNum * 3 - 3, 1); + let endDate = utilities$2.DateUtils.safeCreateFromValue(utilities$2.DateUtils.minValue(), year, quarterNum * 3, 1); + result.futureValue = [beginDate, endDate]; + result.pastValue = [beginDate, endDate]; + result.timex = `(${utilities$2.FormatUtil.luisDateFromDate(beginDate)},${utilities$2.FormatUtil.luisDateFromDate(endDate)},P3M)`; + result.success = true; + return result; + } + parseNumberWithUnit(source, referenceDate) { + let result = new utilities$2.DateTimeResolutionResult(); + // if there are NO spaces between number and unit + let match = recognizersText.RegExpUtility.getMatches(this.numberCombinedWithUnitRegex, source).pop(); + if (!match) + return result; + let sourceUnit = match.groups('unit').value.trim().toLowerCase(); + if (!this.config.unitMap.has(sourceUnit)) + return result; + let numStr = match.groups('num').value; + let beforeStr = source.substr(0, match.index).trim().toLowerCase(); + return this.parseCommonDurationWithUnit(beforeStr, sourceUnit, numStr, referenceDate); + } + parseDuration(source, referenceDate) { + let result = new utilities$2.DateTimeResolutionResult(); + // for case "前两年" "后三年" + let durationResult = this.config.durationExtractor.extract(source, referenceDate).pop(); + if (!durationResult) + return result; + let match = recognizersText.RegExpUtility.getMatches(this.unitRegex, durationResult.text).pop(); + if (!match) + return result; + let sourceUnit = match.groups('unit').value.trim().toLowerCase(); + if (!this.config.unitMap.has(sourceUnit)) + return result; + let beforeStr = source.substr(0, durationResult.start).trim().toLowerCase(); + let numberStr = durationResult.text.substr(0, match.index).trim().toLowerCase(); + let numberValue = this.convertChineseToNumber(numberStr); + let numStr = numberValue.toString(); + return this.parseCommonDurationWithUnit(beforeStr, sourceUnit, numStr, referenceDate); + } + parseCommonDurationWithUnit(beforeStr, sourceUnit, numStr, referenceDate) { + let result = new utilities$2.DateTimeResolutionResult(); + let unitStr = this.config.unitMap.get(sourceUnit); + let pastMatch = recognizersText.RegExpUtility.getMatches(this.config.pastRegex, beforeStr).pop(); + let hasPast = pastMatch && pastMatch.length === beforeStr.length; + let futureMatch = recognizersText.RegExpUtility.getMatches(this.config.futureRegex, beforeStr).pop(); + let hasFuture = futureMatch && futureMatch.length === beforeStr.length; + if (!hasFuture && !hasPast) { + return result; + } + let beginDate = new Date(referenceDate); + let endDate = new Date(referenceDate); + let difference = Number.parseFloat(numStr); + switch (unitStr) { + case 'D': + beginDate = hasPast ? utilities$2.DateUtils.addDays(referenceDate, -difference) : beginDate; + endDate = hasFuture ? utilities$2.DateUtils.addDays(referenceDate, difference) : endDate; + break; + case 'W': + beginDate = hasPast ? utilities$2.DateUtils.addDays(referenceDate, -7 * difference) : beginDate; + endDate = hasFuture ? utilities$2.DateUtils.addDays(referenceDate, 7 * difference) : endDate; + break; + case 'MON': + beginDate = hasPast ? utilities$2.DateUtils.addMonths(referenceDate, -Math.round(difference)) : beginDate; + endDate = hasFuture ? utilities$2.DateUtils.addMonths(referenceDate, Math.round(difference)) : endDate; + break; + case 'Y': + beginDate = hasPast ? utilities$2.DateUtils.addYears(referenceDate, -Math.round(difference)) : beginDate; + endDate = hasFuture ? utilities$2.DateUtils.addYears(referenceDate, Math.round(difference)) : endDate; + break; + default: return result; + } + if (hasFuture) { + beginDate = utilities$2.DateUtils.addDays(beginDate, 1); + endDate = utilities$2.DateUtils.addDays(endDate, 1); + } + let beginTimex = utilities$2.FormatUtil.luisDateFromDate(beginDate); + let endTimex = utilities$2.FormatUtil.luisDateFromDate(endDate); + result.timex = `(${beginTimex},${endTimex},P${numStr}${unitStr.charAt(0)})`; + result.futureValue = [beginDate, endDate]; + result.pastValue = [beginDate, endDate]; + result.success = true; + return result; + } + convertChineseToNumber(source) { + let num = -1; + let er = this.integerExtractor.extract(source).pop(); + if (er && er.type === recognizers_text_number_2.Constants.SYS_NUM_INTEGER) { + num = Number.parseInt(this.numberParser.parse(er).value); + } + return num; + } + parseYearAndMonth(source, referenceDate) { + let result = new utilities$2.DateTimeResolutionResult(); + let match = recognizersText.RegExpUtility.getMatches(this.yearAndMonthRegex, source).pop(); + if (!match || match.length !== source.length) { + match = recognizersText.RegExpUtility.getMatches(this.pureNumberYearAndMonthRegex, source).pop(); + } + if (!match || match.length !== source.length) { + return result; + } + // parse year + let year = referenceDate.getFullYear(); + let yearNum = match.groups('year').value; + let yearChinese = match.groups('yearchs').value; + let yearRelative = match.groups('yearrel').value; + if (!recognizersText.StringUtility.isNullOrEmpty(yearNum)) { + if (this.config.isYearOnly(yearNum)) { + yearNum = yearNum.substr(0, yearNum.length - 1); + } + year = this.convertYear(yearNum, false); + } + else if (!recognizersText.StringUtility.isNullOrEmpty(yearChinese)) { + if (this.config.isYearOnly(yearChinese)) { + yearChinese = yearChinese.substr(0, yearChinese.length - 1); + } + year = this.convertYear(yearChinese, true); + } + else if (!recognizersText.StringUtility.isNullOrEmpty(yearRelative)) { + year += this.config.getSwiftDayOrMonth(yearRelative); + } + if (year < 100 && year >= 90) { + year += 1900; + } + else if (year < 100 && year < 20) { + year += 2000; + } + let monthStr = match.groups('month').value.toLowerCase(); + let month = (this.config.monthOfYear.get(monthStr) % 12) - 1; + let beginDate = utilities$2.DateUtils.safeCreateFromMinValue(year, month, 1); + let endDate = month === 11 + ? utilities$2.DateUtils.safeCreateFromMinValue(year + 1, 0, 1) + : utilities$2.DateUtils.safeCreateFromMinValue(year, month + 1, 1); + result.timex = utilities$2.FormatUtil.toString(year, 4) + '-' + utilities$2.FormatUtil.toString(month, 2); + result.futureValue = [beginDate, endDate]; + result.pastValue = [beginDate, endDate]; + result.success = true; + return result; + } + parseYearToYear(source, referenceDate) { + let result = new utilities$2.DateTimeResolutionResult(); + let match = recognizersText.RegExpUtility.getMatches(this.yearToYearRegex, source).pop(); + if (!match) { + let match = recognizersText.RegExpUtility.getMatches(this.YearToYearSuffixRequired, source).pop(); + if (!match) { + return result; + } + } + let yearMatches = recognizersText.RegExpUtility.getMatches(this.config.yearRegex, source); + let chineseYearMatches = recognizersText.RegExpUtility.getMatches(this.chineseYearRegex, source); + let beginYear = 0; + let endYear = 0; + if (yearMatches.length === 2) { + beginYear = this.convertChineseToNumber(yearMatches[0].groups('year').value); + endYear = this.convertChineseToNumber(yearMatches[1].groups('year').value); + } + else if (chineseYearMatches.length === 2) { + beginYear = this.convertYear(chineseYearMatches[0].groups('yearchs').value, true); + endYear = this.convertYear(chineseYearMatches[1].groups('yearchs').value, true); + } + else if (yearMatches.length === 1 && chineseYearMatches.length === 1) { + if (yearMatches[0].index < chineseYearMatches[0].index) { + beginYear = this.convertChineseToNumber(yearMatches[0].groups('year').value); + endYear = this.convertChineseToNumber(chineseYearMatches[0].groups('yearchs').value); + } + else { + beginYear = this.convertChineseToNumber(chineseYearMatches[0].groups('yearchs').value); + endYear = this.convertChineseToNumber(yearMatches[0].groups('year').value); + } + } + beginYear = this.sanitizeYear(beginYear); + endYear = this.sanitizeYear(endYear); + let beginDate = utilities$2.DateUtils.safeCreateFromMinValue(beginYear, 0, 1); + let endDate = utilities$2.DateUtils.safeCreateFromMinValue(endYear, 0, 1); + let beginTimex = utilities$2.FormatUtil.luisDateFromDate(beginDate); + let endTimex = utilities$2.FormatUtil.luisDateFromDate(endDate); + result.timex = `(${beginTimex},${endTimex},P${endYear - beginYear}Y)`; + result.futureValue = [beginDate, endDate]; + result.pastValue = [beginDate, endDate]; + result.success = true; + return result; + } + sanitizeYear(year) { + let result = year; + if (year < 100 && year >= 90) { + result += 1900; + } + else if (year < 100 && year < 20) { + result += 2000; + } + return result; + } +} +exports.ChineseDatePeriodParser = ChineseDatePeriodParser; + +}); + +unwrapExports(datePeriodConfiguration$6); + +var dateTimePeriodConfiguration$6 = createCommonjsModule(function (module, exports) { +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); + + + + + + + + + + + +class ChineseDateTimePeriodExtractorConfiguration { + getFromTokenIndex(source) { + let result = { matched: false, index: -1 }; + if (source.endsWith("从")) { + result.index = source.lastIndexOf("从"); + result.matched = true; + } + return result; + } + ; + getBetweenTokenIndex(source) { + return { matched: false, index: -1 }; + } + ; + hasConnectorToken(source) { + return (source === '和' || source === ' 与' || source === '到'); + } + ; + constructor() { + this.singleDateExtractor = new dateConfiguration$6.ChineseDateExtractor(); + this.singleTimeExtractor = new timeConfiguration$6.ChineseTimeExtractor(); + this.singleDateTimeExtractor = new dateTimeConfiguration$6.ChineseDateTimeExtractor(); + this.prepositionRegex = recognizersText.RegExpUtility.getSafeRegExp(chineseDateTime.ChineseDateTime.DateTimePeriodPrepositionRegex); + this.tillRegex = recognizersText.RegExpUtility.getSafeRegExp(chineseDateTime.ChineseDateTime.DateTimePeriodTillRegex); + this.cardinalExtractor = new recognizersTextNumber.ChineseCardinalExtractor(); + this.followedUnit = recognizersText.RegExpUtility.getSafeRegExp(chineseDateTime.ChineseDateTime.DateTimePeriodFollowedUnit); + this.timeUnitRegex = recognizersText.RegExpUtility.getSafeRegExp(chineseDateTime.ChineseDateTime.DateTimePeriodUnitRegex); + this.specificTimeOfDayRegex = recognizersText.RegExpUtility.getSafeRegExp(chineseDateTime.ChineseDateTime.SpecificTimeOfDayRegex); + this.timeOfDayRegex = recognizersText.RegExpUtility.getSafeRegExp(chineseDateTime.ChineseDateTime.TimeOfDayRegex); + } +} +class ChineseDateTimePeriodExtractor extends baseDateTimePeriod.BaseDateTimePeriodExtractor { + constructor() { + super(new ChineseDateTimePeriodExtractorConfiguration()); + this.zhijianRegex = recognizersText.RegExpUtility.getSafeRegExp(chineseDateTime.ChineseDateTime.ZhijianRegex); + this.pastRegex = recognizersText.RegExpUtility.getSafeRegExp(chineseDateTime.ChineseDateTime.PastRegex); + this.futureRegex = recognizersText.RegExpUtility.getSafeRegExp(chineseDateTime.ChineseDateTime.FutureRegex); + } + extract(source, refDate) { + if (!refDate) + refDate = new Date(); + let referenceDate = refDate; + let tokens = new Array() + .concat(this.mergeDateAndTimePeriod(source, referenceDate)) + .concat(this.mergeTwoTimePoints(source, referenceDate)) + .concat(this.matchNubmerWithUnit(source)) + .concat(this.matchNight(source, referenceDate)); + let result = utilities$2.Token.mergeAllTokens(tokens, source, this.extractorName); + return result; + } + mergeDateAndTimePeriod(source, refDate) { + let tokens = new Array(); + let ersDate = this.config.singleDateExtractor.extract(source, refDate); + let ersTime = this.config.singleTimeExtractor.extract(source, refDate); + let timeResults = new Array(); + let j = 0; + for (let i = 0; i < ersDate.length; i++) { + timeResults.push(ersDate[i]); + while (j < ersTime.length && ersTime[j].start + ersTime[j].length <= ersDate[i].start) { + timeResults.push(ersTime[j]); + j++; + } + while (j < ersTime.length && recognizersText.ExtractResult.isOverlap(ersTime[j], ersDate[i])) { + j++; + } + } + for (j; j < ersTime.length; j++) { + timeResults.push(ersTime[j]); + } + timeResults = timeResults.sort((a, b) => a.start > b.start ? 1 : a.start < b.start ? -1 : 0); + let idx = 0; + while (idx < timeResults.length - 1) { + let current = timeResults[idx]; + let next = timeResults[idx + 1]; + if (current.type === constants$2.Constants.SYS_DATETIME_DATE && next.type === constants$2.Constants.SYS_DATETIME_TIMEPERIOD) { + let middleBegin = current.start + current.length; + let middleEnd = next.start; + let middleStr = source.substring(middleBegin, middleEnd).trim(); + if (recognizersText.StringUtility.isNullOrWhitespace(middleStr) || recognizersText.RegExpUtility.isMatch(this.config.prepositionRegex, middleStr)) { + let periodBegin = current.start; + let periodEnd = next.start + next.length; + tokens.push(new utilities$2.Token(periodBegin, periodEnd)); + } + idx++; + } + idx++; + } + return tokens; + } + mergeTwoTimePoints(source, refDate) { + let tokens = new Array(); + let ersDateTime = this.config.singleDateTimeExtractor.extract(source, refDate); + let ersTime = this.config.singleTimeExtractor.extract(source, refDate); + let innerMarks = []; + let j = 0; + ersDateTime.forEach((erDateTime, index) => { + innerMarks.push(erDateTime); + while (j < ersTime.length && ersTime[j].start + ersTime[j].length < erDateTime.start) { + innerMarks.push(ersTime[j++]); + } + while (j < ersTime.length && recognizersText.ExtractResult.isOverlap(ersTime[j], erDateTime)) { + j++; + } + }); + while (j < ersTime.length) { + innerMarks.push(ersTime[j++]); + } + innerMarks = innerMarks.sort((erA, erB) => erA.start < erB.start ? -1 : erA.start === erB.start ? 0 : 1); + let idx = 0; + while (idx < innerMarks.length - 1) { + let currentMark = innerMarks[idx]; + let nextMark = innerMarks[idx + 1]; + if (currentMark.type === constants$2.Constants.SYS_DATETIME_TIME && nextMark.type === constants$2.Constants.SYS_DATETIME_TIME) { + idx++; + continue; + } + let middleBegin = currentMark.start + currentMark.length; + let middleEnd = nextMark.start; + let middleStr = source.substr(middleBegin, middleEnd - middleBegin).trim().toLowerCase(); + let matches = recognizersText.RegExpUtility.getMatches(this.config.tillRegex, middleStr); + if (matches && matches.length > 0 && matches[0].index === 0 && matches[0].length === middleStr.length) { + let periodBegin = currentMark.start; + let periodEnd = nextMark.start + nextMark.length; + let beforeStr = source.substr(0, periodBegin).trim().toLowerCase(); + let fromTokenIndex = this.config.getFromTokenIndex(beforeStr); + if (fromTokenIndex.matched) { + periodBegin = fromTokenIndex.index; + } + tokens.push(new utilities$2.Token(periodBegin, periodEnd)); + idx += 2; + continue; + } + if (this.config.hasConnectorToken(middleStr)) { + let periodBegin = currentMark.start; + let periodEnd = nextMark.start + nextMark.length; + let afterStr = source.substr(periodEnd).trim().toLowerCase(); + let match = recognizersText.RegExpUtility.getMatches(this.zhijianRegex, afterStr).pop(); + if (match) { + tokens.push(new utilities$2.Token(periodBegin, periodEnd + match.length)); + idx += 2; + continue; + } + } + idx++; + } + + return tokens; + } + matchNubmerWithUnit(source) { + let tokens = new Array(); + let durations = new Array(); + this.config.cardinalExtractor.extract(source).forEach(er => { + let afterStr = source.substr(er.start + er.length); + let followedUnitMatch = recognizersText.RegExpUtility.getMatches(this.config.followedUnit, afterStr).pop(); + if (followedUnitMatch && followedUnitMatch.index === 0) { + durations.push(new utilities$2.Token(er.start, er.start + er.length + followedUnitMatch.length)); + } + }); + recognizersText.RegExpUtility.getMatches(this.config.timeUnitRegex, source).forEach(match => { + durations.push(new utilities$2.Token(match.index, match.index + match.length)); + }); + durations.forEach(duration => { + let beforeStr = source.substr(0, duration.start).toLowerCase(); + if (recognizersText.StringUtility.isNullOrWhitespace(beforeStr)) { + return; + } + let match = recognizersText.RegExpUtility.getMatches(this.pastRegex, beforeStr).pop(); + if (match && recognizersText.StringUtility.isNullOrWhitespace(beforeStr.substr(match.index + match.length))) { + tokens.push(new utilities$2.Token(match.index, duration.end)); + return; + } + match = recognizersText.RegExpUtility.getMatches(this.futureRegex, beforeStr).pop(); + if (match && recognizersText.StringUtility.isNullOrWhitespace(beforeStr.substr(match.index + match.length))) { + tokens.push(new utilities$2.Token(match.index, duration.end)); + return; + } + }); + return tokens; + } + matchNight(source, refDate) { + let tokens = new Array(); + recognizersText.RegExpUtility.getMatches(this.config.specificTimeOfDayRegex, source).forEach(match => { + tokens.push(new utilities$2.Token(match.index, match.index + match.length)); + }); + this.config.singleDateExtractor.extract(source, refDate).forEach(er => { + let afterStr = source.substr(er.start + er.length); + let match = recognizersText.RegExpUtility.getMatches(this.config.timeOfDayRegex, afterStr).pop(); + if (match) { + let middleStr = source.substr(0, match.index); + if (recognizersText.StringUtility.isNullOrWhitespace(middleStr) || recognizersText.RegExpUtility.isMatch(this.config.prepositionRegex, middleStr)) { + tokens.push(new utilities$2.Token(er.start, er.start + er.length + match.index + match.length)); + } + } + }); + return tokens; + } +} +exports.ChineseDateTimePeriodExtractor = ChineseDateTimePeriodExtractor; +class ChineseDateTimePeriodParserConfiguration { + constructor() { + this.dateExtractor = new dateConfiguration$6.ChineseDateExtractor(); + this.timeExtractor = new timeConfiguration$6.ChineseTimeExtractor(); + this.dateTimeExtractor = new dateTimeConfiguration$6.ChineseDateTimeExtractor(); + this.timePeriodExtractor = new timePeriodConfiguration$6.ChineseTimePeriodExtractor(); + this.dateParser = new dateConfiguration$6.ChineseDateParser(); + this.timeParser = new timeConfiguration$6.ChineseTimeParser(); + this.dateTimeParser = new dateTimeConfiguration$6.ChineseDateTimeParser(); + this.timePeriodParser = new timePeriodConfiguration$6.ChineseTimePeriodParser(); + this.specificTimeOfDayRegex = recognizersText.RegExpUtility.getSafeRegExp(chineseDateTime.ChineseDateTime.SpecificTimeOfDayRegex); + this.relativeTimeUnitRegex = recognizersText.RegExpUtility.getSafeRegExp(chineseDateTime.ChineseDateTime.TimeOfDayRegex); + this.pastRegex = recognizersText.RegExpUtility.getSafeRegExp(chineseDateTime.ChineseDateTime.PastRegex); + this.futureRegex = recognizersText.RegExpUtility.getSafeRegExp(chineseDateTime.ChineseDateTime.FutureRegex); + this.unitMap = chineseDateTime.ChineseDateTime.ParserConfigurationUnitMap; + } + getMatchedTimeRange(source) { + let swift = 0; + let beginHour = 0; + let endHour = 0; + let endMin = 0; + let timeStr = ''; + switch (source) { + case '今晚': + swift = 0; + timeStr = 'TEV'; + beginHour = 16; + endHour = 20; + break; + case '今早': + case '今晨': + swift = 0; + timeStr = 'TMO'; + beginHour = 8; + endHour = 12; + break; + case '明晚': + swift = 1; + timeStr = 'TEV'; + beginHour = 16; + endHour = 20; + break; + case '明早': + case '明晨': + swift = 1; + timeStr = 'TMO'; + beginHour = 8; + endHour = 12; + break; + case '昨晚': + swift = -1; + timeStr = 'TEV'; + beginHour = 16; + endHour = 20; + break; + default: + return { + timeStr: '', + beginHour: 0, + endHour: 0, + endMin: 0, + swift: 0, + success: false + }; + } + return { + timeStr: timeStr, + beginHour: beginHour, + endHour: endHour, + endMin: endMin, + swift: swift, + success: true + }; + } + getSwiftPrefix(source) { + return null; + } +} +class ChineseDateTimePeriodParser extends baseDateTimePeriod.BaseDateTimePeriodParser { + constructor() { + let config = new ChineseDateTimePeriodParserConfiguration(); + super(config); + this.TMORegex = recognizersText.RegExpUtility.getSafeRegExp(chineseDateTime.ChineseDateTime.DateTimePeriodMORegex); + this.TAFRegex = recognizersText.RegExpUtility.getSafeRegExp(chineseDateTime.ChineseDateTime.DateTimePeriodAFRegex); + this.TEVRegex = recognizersText.RegExpUtility.getSafeRegExp(chineseDateTime.ChineseDateTime.DateTimePeriodEVRegex); + this.TNIRegex = recognizersText.RegExpUtility.getSafeRegExp(chineseDateTime.ChineseDateTime.DateTimePeriodNIRegex); + this.unitRegex = recognizersText.RegExpUtility.getSafeRegExp(chineseDateTime.ChineseDateTime.DateTimePeriodUnitRegex); + this.timeOfDayRegex = recognizersText.RegExpUtility.getSafeRegExp(chineseDateTime.ChineseDateTime.TimeOfDayRegex); + this.cardinalExtractor = new recognizersTextNumber.ChineseCardinalExtractor(); + this.cardinalParser = recognizersTextNumber.AgnosticNumberParserFactory.getParser(recognizersTextNumber.AgnosticNumberParserType.Cardinal, new recognizersTextNumber.ChineseNumberParserConfiguration()); + } + parse(extractorResult, referenceDate) { + if (!referenceDate) + referenceDate = new Date(); + let resultValue; + if (extractorResult.type === this.parserName) { + let source = extractorResult.text.trim().toLowerCase(); + let innerResult = this.mergeDateAndTimePeriods(source, referenceDate); + if (!innerResult.success) { + innerResult = this.mergeTwoTimePoints(source, referenceDate); + } + if (!innerResult.success) { + innerResult = this.parseSpecificTimeOfDay(source, referenceDate); + } + if (!innerResult.success) { + innerResult = this.parseNumberWithUnit(source, referenceDate); + } + if (innerResult.success) { + innerResult.futureResolution = {}; + innerResult.futureResolution[constants$2.TimeTypeConstants.START_DATETIME] = utilities$2.FormatUtil.formatDateTime(innerResult.futureValue[0]); + innerResult.futureResolution[constants$2.TimeTypeConstants.END_DATETIME] = utilities$2.FormatUtil.formatDateTime(innerResult.futureValue[1]); + innerResult.pastResolution = {}; + innerResult.pastResolution[constants$2.TimeTypeConstants.START_DATETIME] = utilities$2.FormatUtil.formatDateTime(innerResult.pastValue[0]); + innerResult.pastResolution[constants$2.TimeTypeConstants.END_DATETIME] = utilities$2.FormatUtil.formatDateTime(innerResult.pastValue[1]); + resultValue = innerResult; + } + } + let result = new parsers$4.DateTimeParseResult(extractorResult); + result.value = resultValue; + result.timexStr = resultValue ? resultValue.timex : ''; + result.resolutionStr = ''; + return result; + } + mergeDateAndTimePeriods(text, referenceTime) { + let result = new utilities$2.DateTimeResolutionResult(); + let erDate = this.config.dateExtractor.extract(text, referenceTime).pop(); + let erTimePeriod = this.config.timePeriodExtractor.extract(text, referenceTime).pop(); + if (!erDate || !erTimePeriod) + return result; + let prDate = this.config.dateParser.parse(erDate, referenceTime); + let prTimePeriod = this.config.timePeriodParser.parse(erTimePeriod, referenceTime); + let split = prTimePeriod.timexStr.split('T'); + if (split.length !== 4) { + return result; + } + let beginTime = prTimePeriod.value.futureValue.item1; + let endTime = prTimePeriod.value.futureValue.item2; + let futureDate = prDate.value.futureValue; + let pastDate = prDate.value.pastValue; + result.futureValue = [ + utilities$2.DateUtils.safeCreateFromMinValueWithDateAndTime(futureDate, beginTime), + utilities$2.DateUtils.safeCreateFromMinValueWithDateAndTime(futureDate, endTime) + ]; + result.pastValue = [ + utilities$2.DateUtils.safeCreateFromMinValueWithDateAndTime(pastDate, beginTime), + utilities$2.DateUtils.safeCreateFromMinValueWithDateAndTime(pastDate, endTime) + ]; + let dateTimex = prDate.timexStr; + result.timex = `${split[0]}${dateTimex}T${split[1]}${dateTimex}T${split[2]}T${split[3]}`; + result.success = true; + return result; + } + mergeTwoTimePoints(text, referenceTime) { + let result = new utilities$2.DateTimeResolutionResult(); + let prs; + let timeErs = this.config.timeExtractor.extract(text, referenceTime); + let datetimeErs = this.config.dateTimeExtractor.extract(text, referenceTime); + let bothHasDate = false; + let beginHasDate = false; + let endHasDate = false; + if (datetimeErs.length === 2) { + prs = this.getTwoPoints(datetimeErs[0], datetimeErs[1], this.config.dateTimeParser, this.config.dateTimeParser, referenceTime); + bothHasDate = true; + } + else if (datetimeErs.length === 1 && timeErs.length === 2) { + if (recognizersText.ExtractResult.isOverlap(datetimeErs[0], timeErs[0])) { + prs = this.getTwoPoints(datetimeErs[0], timeErs[1], this.config.dateTimeParser, this.config.timeParser, referenceTime); + beginHasDate = true; + } + else { + prs = this.getTwoPoints(timeErs[0], datetimeErs[0], this.config.timeParser, this.config.dateTimeParser, referenceTime); + endHasDate = true; + } + } + else if (datetimeErs.length === 1 && timeErs.length === 1) { + if (timeErs[0].start < datetimeErs[0].start) { + prs = this.getTwoPoints(timeErs[0], datetimeErs[0], this.config.timeParser, this.config.dateTimeParser, referenceTime); + endHasDate = true; + } + else { + prs = this.getTwoPoints(datetimeErs[0], timeErs[0], this.config.dateTimeParser, this.config.timeParser, referenceTime); + beginHasDate = true; + } + } + if (!prs || !prs.begin.value || !prs.end.value) + return result; + let futureBegin = prs.begin.value.futureValue; + let futureEnd = prs.end.value.futureValue; + let pastBegin = prs.begin.value.pastValue; + let pastEnd = prs.end.value.pastValue; + if (futureBegin.getTime() > futureEnd.getTime()) + futureBegin = pastBegin; + if (pastEnd.getTime() < pastBegin.getTime()) + pastEnd = futureEnd; + let rightTime = utilities$2.DateUtils.safeCreateFromMinValueWithDateAndTime(referenceTime); + let leftTime = utilities$2.DateUtils.safeCreateFromMinValueWithDateAndTime(referenceTime); + if (bothHasDate) { + rightTime = utilities$2.DateUtils.safeCreateFromMinValueWithDateAndTime(futureEnd); + leftTime = utilities$2.DateUtils.safeCreateFromMinValueWithDateAndTime(futureBegin); + } + else if (beginHasDate) { + // TODO: Handle "明天下午两点到五点" + futureEnd = utilities$2.DateUtils.safeCreateFromMinValueWithDateAndTime(futureBegin, futureEnd); + pastEnd = utilities$2.DateUtils.safeCreateFromMinValueWithDateAndTime(pastBegin, pastEnd); + leftTime = utilities$2.DateUtils.safeCreateFromMinValueWithDateAndTime(futureBegin); + } + else if (endHasDate) { + // TODO: Handle "明天下午两点到五点" + futureBegin = utilities$2.DateUtils.safeCreateFromMinValueWithDateAndTime(futureEnd, futureBegin); + pastBegin = utilities$2.DateUtils.safeCreateFromMinValueWithDateAndTime(pastEnd, pastBegin); + rightTime = utilities$2.DateUtils.safeCreateFromMinValueWithDateAndTime(futureEnd); + } + let leftResult = prs.begin.value; + let rightResult = prs.end.value; + let leftResultTime = leftResult.futureValue; + let rightResultTime = rightResult.futureValue; + leftTime = utilities$2.DateUtils.addTime(leftTime, leftResultTime); + rightTime = utilities$2.DateUtils.addTime(rightTime, rightResultTime); + // the right side time contains "ampm", while the left side doesn't + if (rightResult.comment === 'ampm' && !leftResult.comment && rightTime.getTime() < leftTime.getTime()) { + rightTime = utilities$2.DateUtils.addHours(rightTime, 12); + } + if (rightTime.getTime() < leftTime.getTime()) { + rightTime = utilities$2.DateUtils.addDays(rightTime, 1); + } + result.futureValue = [leftTime, rightTime]; + result.pastValue = [leftTime, rightTime]; + let hasFuzzyTimex = prs.begin.timexStr.includes('X') || prs.end.timexStr.includes('X'); + let leftTimex = hasFuzzyTimex ? prs.begin.timexStr : utilities$2.FormatUtil.luisDateTime(leftTime); + let rightTimex = hasFuzzyTimex ? prs.end.timexStr : utilities$2.FormatUtil.luisDateTime(rightTime); + let hoursBetween = utilities$2.DateUtils.totalHours(rightTime, leftTime); + result.timex = `(${leftTimex},${rightTimex},PT${hoursBetween}H)`; + result.success = true; + return result; + } + parseSpecificTimeOfDay(text, referenceTime) { + let result = new utilities$2.DateTimeResolutionResult(); + let source = text.trim().toLowerCase(); + let match = recognizersText.RegExpUtility.getMatches(this.config.specificTimeOfDayRegex, source).pop(); + if (match && match.index === 0 && match.length === source.length) { + let values = this.config.getMatchedTimeRange(source); + if (!values.success) { + return result; + } + let swift = values.swift; + let date = utilities$2.DateUtils.addDays(referenceTime, swift); + date.setHours(0); + date.setMinutes(0); + date.setSeconds(0); + result.timex = utilities$2.FormatUtil.formatDate(date) + values.timeStr; + result.futureValue = [ + utilities$2.DateUtils.safeCreateFromMinValue(date.getFullYear(), date.getMonth(), date.getDate(), values.beginHour, 0, 0), + utilities$2.DateUtils.safeCreateFromMinValue(date.getFullYear(), date.getMonth(), date.getDate(), values.endHour, values.endMin, values.endMin) + ]; + result.pastValue = [ + utilities$2.DateUtils.safeCreateFromMinValue(date.getFullYear(), date.getMonth(), date.getDate(), values.beginHour, 0, 0), + utilities$2.DateUtils.safeCreateFromMinValue(date.getFullYear(), date.getMonth(), date.getDate(), values.endHour, values.endMin, values.endMin) + ]; + result.success = true; + return result; + } + let beginHour = 0; + let endHour = 0; + let endMin = 0; + let timeStr = ''; + // handle morning, afternoon.. + if (recognizersText.RegExpUtility.isMatch(this.TMORegex, source)) { + timeStr = 'TMO'; + beginHour = 8; + endHour = 12; + } + else if (recognizersText.RegExpUtility.isMatch(this.TAFRegex, source)) { + timeStr = 'TAF'; + beginHour = 12; + endHour = 16; + } + else if (recognizersText.RegExpUtility.isMatch(this.TEVRegex, source)) { + timeStr = 'TEV'; + beginHour = 16; + endHour = 20; + } + else if (recognizersText.RegExpUtility.isMatch(this.TNIRegex, source)) { + timeStr = 'TNI'; + beginHour = 20; + endHour = 23; + endMin = 59; + } + else { + return result; + } + // handle Date followed by morning, afternoon + let timeMatch = recognizersText.RegExpUtility.getMatches(this.timeOfDayRegex, source).pop(); + if (!timeMatch) + return result; + let beforeStr = source.substr(0, timeMatch.index).trim(); + let erDate = this.config.dateExtractor.extract(beforeStr, referenceTime).pop(); + if (!erDate || erDate.length !== beforeStr.length) + return result; + let prDate = this.config.dateParser.parse(erDate, referenceTime); + let futureDate = prDate.value.futureValue; + let pastDate = prDate.value.pastValue; + result.timex = prDate.timexStr + timeStr; + result.futureValue = [ + utilities$2.DateUtils.safeCreateFromMinValue(futureDate.getFullYear(), futureDate.getMonth(), futureDate.getDate(), beginHour, 0, 0), + utilities$2.DateUtils.safeCreateFromMinValue(futureDate.getFullYear(), futureDate.getMonth(), futureDate.getDate(), endHour, endMin, endMin) + ]; + result.pastValue = [ + utilities$2.DateUtils.safeCreateFromMinValue(pastDate.getFullYear(), pastDate.getMonth(), pastDate.getDate(), beginHour, 0, 0), + utilities$2.DateUtils.safeCreateFromMinValue(pastDate.getFullYear(), pastDate.getMonth(), pastDate.getDate(), endHour, endMin, endMin) + ]; + result.success = true; + return result; + } + parseNumberWithUnit(text, referenceTime) { + let result = new utilities$2.DateTimeResolutionResult(); + let ers = this.cardinalExtractor.extract(text); + if (ers.length === 1) { + let er = ers[0]; + let pr = this.cardinalParser.parse(er); + let sourceUnit = text.substr(er.start + er.length).trim().toLowerCase(); + if (sourceUnit.startsWith('个')) { + sourceUnit = sourceUnit.substr(1); + } + let beforeStr = text.substr(0, er.start).trim().toLowerCase(); + return this.parseCommonDurationWithUnit(beforeStr, sourceUnit, pr.resolutionStr, pr.value, referenceTime); + } + // handle "last hour" + let match = recognizersText.RegExpUtility.getMatches(this.unitRegex, text).pop(); + if (match) { + let srcUnit = match.groups('unit').value; + let beforeStr = text.substr(0, match.index).trim().toLowerCase(); + return this.parseCommonDurationWithUnit(beforeStr, srcUnit, '1', 1, referenceTime); + } + return result; + } + parseDuration(text, referenceTime) { + let result = new utilities$2.DateTimeResolutionResult(); + let match = recognizersText.RegExpUtility.getMatches(this.config.relativeTimeUnitRegex, text).pop(); + if (!match) + return result; + let sourceUnit = match.groups('unit').value.toLowerCase(); + let beforeStr = text.substr(0, match.index).trim().toLowerCase(); + return this.parseCommonDurationWithUnit(beforeStr, sourceUnit, '1', 1, referenceTime); + } + parseCommonDurationWithUnit(beforeStr, sourceUnit, numStr, swift, referenceDate) { + let result = new utilities$2.DateTimeResolutionResult(); + if (!this.config.unitMap.has(sourceUnit)) + return result; + let unitStr = this.config.unitMap.get(sourceUnit); + let pastMatch = recognizersText.RegExpUtility.getMatches(this.config.pastRegex, beforeStr).pop(); + let hasPast = pastMatch && pastMatch.length === beforeStr.length; + let futureMatch = recognizersText.RegExpUtility.getMatches(this.config.futureRegex, beforeStr).pop(); + let hasFuture = futureMatch && futureMatch.length === beforeStr.length; + if (!hasPast && !hasFuture) + return result; + let beginDate = new Date(referenceDate); + let endDate = new Date(referenceDate); + switch (unitStr) { + case 'H': + beginDate = hasPast ? utilities$2.DateUtils.addHours(beginDate, -swift) : beginDate; + endDate = hasFuture ? utilities$2.DateUtils.addHours(endDate, swift) : endDate; + break; + case 'M': + beginDate = hasPast ? utilities$2.DateUtils.addMinutes(beginDate, -swift) : beginDate; + endDate = hasFuture ? utilities$2.DateUtils.addMinutes(endDate, swift) : endDate; + break; + case 'S': + beginDate = hasPast ? utilities$2.DateUtils.addSeconds(beginDate, -swift) : beginDate; + endDate = hasFuture ? utilities$2.DateUtils.addSeconds(endDate, swift) : endDate; + break; + default: return result; + } + let beginTimex = `${utilities$2.FormatUtil.luisDateFromDate(beginDate)}T${utilities$2.FormatUtil.luisTimeFromDate(beginDate)}`; + let endTimex = `${utilities$2.FormatUtil.luisDateFromDate(endDate)}T${utilities$2.FormatUtil.luisTimeFromDate(endDate)}`; + result.timex = `(${beginTimex},${endTimex},PT${numStr}${unitStr.charAt(0)})`; + result.futureValue = [beginDate, endDate]; + result.pastValue = [beginDate, endDate]; + result.success = true; + return result; + } +} +exports.ChineseDateTimePeriodParser = ChineseDateTimePeriodParser; + +}); + +unwrapExports(dateTimePeriodConfiguration$6); + +var setConfiguration$6 = createCommonjsModule(function (module, exports) { +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); + + + + + + + + + + +class ChineseSetExtractorConfiguration { + constructor() { + this.eachUnitRegex = recognizersText.RegExpUtility.getSafeRegExp(chineseDateTime.ChineseDateTime.SetEachUnitRegex); + this.durationExtractor = new durationConfiguration$6.ChineseDurationExtractor(); + this.lastRegex = recognizersText.RegExpUtility.getSafeRegExp(chineseDateTime.ChineseDateTime.SetLastRegex); + this.eachPrefixRegex = recognizersText.RegExpUtility.getSafeRegExp(chineseDateTime.ChineseDateTime.SetEachPrefixRegex); + this.timeExtractor = new timeConfiguration$6.ChineseTimeExtractor(); + this.beforeEachDayRegex = recognizersText.RegExpUtility.getSafeRegExp(chineseDateTime.ChineseDateTime.SetEachDayRegex); + this.eachDayRegex = recognizersText.RegExpUtility.getSafeRegExp(chineseDateTime.ChineseDateTime.SetEachDayRegex); + this.dateExtractor = new dateConfiguration$6.ChineseDateExtractor(); + this.dateTimeExtractor = new dateTimeConfiguration$6.ChineseDateTimeExtractor(); + } +} +class ChineseSetExtractor extends baseSet.BaseSetExtractor { + constructor() { + super(new ChineseSetExtractorConfiguration()); + } + extract(source, refDate) { + if (!refDate) + refDate = new Date(); + let referenceDate = refDate; + let tokens = new Array() + .concat(super.matchEachUnit(source)) + .concat(super.matchEachDuration(source, referenceDate)) + .concat(this.matchEachSpecific(this.config.timeExtractor, this.config.eachDayRegex, source, referenceDate)) + .concat(this.matchEachSpecific(this.config.dateExtractor, this.config.eachPrefixRegex, source, referenceDate)) + .concat(this.matchEachSpecific(this.config.dateTimeExtractor, this.config.eachPrefixRegex, source, referenceDate)); + let result = utilities$2.Token.mergeAllTokens(tokens, source, this.extractorName); + return result; + } + matchEachSpecific(extractor, eachRegex, source, refDate) { + let ret = []; + extractor.extract(source, refDate).forEach(er => { + let beforeStr = source.substr(0, er.start); + let beforeMatch = recognizersText.RegExpUtility.getMatches(eachRegex, beforeStr).pop(); + if (beforeMatch) { + ret.push(new utilities$2.Token(beforeMatch.index, er.start + er.length)); + } + }); + return ret; + } +} +exports.ChineseSetExtractor = ChineseSetExtractor; +class ChineseSetParserConfiguration { + constructor() { + this.dateExtractor = new dateConfiguration$6.ChineseDateExtractor(); + this.timeExtractor = new timeConfiguration$6.ChineseTimeExtractor(); + this.durationExtractor = new durationConfiguration$6.ChineseDurationExtractor(); + this.dateTimeExtractor = new dateTimeConfiguration$6.ChineseDateTimeExtractor(); + this.dateParser = new dateConfiguration$6.ChineseDateParser(); + this.timeParser = new timeConfiguration$6.ChineseTimeParser(); + this.durationParser = new durationConfiguration$6.ChineseDurationParser(); + this.dateTimeParser = new dateTimeConfiguration$6.ChineseDateTimeParser(); + this.unitMap = chineseDateTime.ChineseDateTime.ParserConfigurationUnitMap; + this.eachUnitRegex = recognizersText.RegExpUtility.getSafeRegExp(chineseDateTime.ChineseDateTime.SetEachUnitRegex); + this.eachDayRegex = recognizersText.RegExpUtility.getSafeRegExp(chineseDateTime.ChineseDateTime.SetEachDayRegex); + this.eachPrefixRegex = recognizersText.RegExpUtility.getSafeRegExp(chineseDateTime.ChineseDateTime.SetEachPrefixRegex); + } + getMatchedDailyTimex(text) { + return null; + } + getMatchedUnitTimex(source) { + let timex = ''; + if (source === '天' || source === '日') + timex = 'P1D'; + else if (source === '周' || source === '星期') + timex = 'P1W'; + else if (source === '月') + timex = 'P1M'; + else if (source === '年') + timex = 'P1Y'; + return { matched: timex !== '', timex: timex }; + } +} +class ChineseSetParser extends baseSet.BaseSetParser { + constructor() { + let config = new ChineseSetParserConfiguration(); + super(config); + } + parse(er, referenceDate) { + if (!referenceDate) + referenceDate = new Date(); + let value = null; + if (er.type === baseSet.BaseSetParser.ParserName) { + let innerResult = this.parseEachUnit(er.text); + if (!innerResult.success) { + innerResult = this.parseEachDuration(er.text, referenceDate); + } + if (!innerResult.success) { + innerResult = this.parserTimeEveryday(er.text, referenceDate); + } + if (!innerResult.success) { + innerResult = this.parseEach(this.config.dateTimeExtractor, this.config.dateTimeParser, er.text, referenceDate); + } + if (!innerResult.success) { + innerResult = this.parseEach(this.config.dateExtractor, this.config.dateParser, er.text, referenceDate); + } + if (innerResult.success) { + innerResult.futureResolution = {}; + innerResult.futureResolution[constants$2.TimeTypeConstants.SET] = innerResult.futureValue; + innerResult.pastResolution = {}; + innerResult.pastResolution[constants$2.TimeTypeConstants.SET] = innerResult.pastValue; + value = innerResult; + } + } + let ret = new parsers$4.DateTimeParseResult(er); + ret.value = value, ret.timexStr = value === null ? "" : value.timex, ret.resolutionStr = ""; + return ret; + } + parseEachUnit(text) { + let ret = new utilities$2.DateTimeResolutionResult(); + // handle "each month" + let match = recognizersText.RegExpUtility.getMatches(this.config.eachUnitRegex, text).pop(); + if (!match || match.length !== text.length) + return ret; + let sourceUnit = match.groups("unit").value; + if (recognizersText.StringUtility.isNullOrEmpty(sourceUnit) || !this.config.unitMap.has(sourceUnit)) + return ret; + let getMatchedUnitTimex = this.config.getMatchedUnitTimex(sourceUnit); + if (!getMatchedUnitTimex.matched) + return ret; + ret.timex = getMatchedUnitTimex.timex; + ret.futureValue = "Set: " + ret.timex; + ret.pastValue = "Set: " + ret.timex; + ret.success = true; + return ret; + } + parserTimeEveryday(text, refDate) { + let result = new utilities$2.DateTimeResolutionResult(); + let ers = this.config.timeExtractor.extract(text, refDate); + if (ers.length !== 1) + return result; + let er = ers[0]; + let beforeStr = text.substr(0, er.start); + let match = recognizersText.RegExpUtility.getMatches(this.config.eachDayRegex, beforeStr).pop(); + if (!match) + return result; + let pr = this.config.timeParser.parse(er); + result.timex = pr.timexStr; + result.futureValue = "Set: " + result.timex; + result.pastValue = "Set: " + result.timex; + result.success = true; + return result; + } + parseEach(extractor, parser, text, refDate) { + let result = new utilities$2.DateTimeResolutionResult(); + let ers = extractor.extract(text, refDate); + if (ers.length !== 1) + return result; + let er = ers[0]; + let beforeStr = text.substr(0, er.start); + let match = recognizersText.RegExpUtility.getMatches(this.config.eachPrefixRegex, beforeStr).pop(); + if (!match) + return result; + let timex = parser.parse(er).timexStr; + result.timex = timex; + result.futureValue = `Set: ${timex}`; + result.pastValue = `Set: ${timex}`; + result.success = true; + return result; + } +} +exports.ChineseSetParser = ChineseSetParser; + +}); + +unwrapExports(setConfiguration$6); + +var holidayConfiguration$6 = createCommonjsModule(function (module, exports) { +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); + + + +const recognizers_text_number_2 = recognizersTextNumber; + + + + +class ChineseHolidayExtractorConfiguration { + constructor() { + this.holidayRegexes = [ + recognizersText.RegExpUtility.getSafeRegExp(chineseDateTime.ChineseDateTime.HolidayRegexList1), + recognizersText.RegExpUtility.getSafeRegExp(chineseDateTime.ChineseDateTime.HolidayRegexList2), + recognizersText.RegExpUtility.getSafeRegExp(chineseDateTime.ChineseDateTime.LunarHolidayRegex) + ]; + } +} +exports.ChineseHolidayExtractorConfiguration = ChineseHolidayExtractorConfiguration; +class ChineseHolidayParserConfiguration extends baseHoliday.BaseHolidayParserConfiguration { + constructor() { + super(); + this.holidayRegexList = [ + recognizersText.RegExpUtility.getSafeRegExp(chineseDateTime.ChineseDateTime.HolidayRegexList1), + recognizersText.RegExpUtility.getSafeRegExp(chineseDateTime.ChineseDateTime.HolidayRegexList2), + recognizersText.RegExpUtility.getSafeRegExp(chineseDateTime.ChineseDateTime.LunarHolidayRegex) + ]; + this.holidayFuncDictionary = this.initHolidayFuncs(); + this.variableHolidaysTimexDictionary = chineseDateTime.ChineseDateTime.HolidayNoFixedTimex; + } + getSwiftYear(source) { + if (source.endsWith('年')) + return 0; + if (source.endsWith('去年')) + return -1; + if (source.endsWith('明年')) + return 1; + return null; + } + sanitizeHolidayToken(holiday) { + return holiday; + } + initHolidayFuncs() { + return new Map([ + ...super.initHolidayFuncs(), + ['父亲节', baseHoliday.BaseHolidayParserConfiguration.FathersDay], + ['母亲节', baseHoliday.BaseHolidayParserConfiguration.MothersDay], + ['感恩节', baseHoliday.BaseHolidayParserConfiguration.ThanksgivingDay] + ]); + } +} +class ChineseHolidayParser extends baseHoliday.BaseHolidayParser { + constructor() { + let config = new ChineseHolidayParserConfiguration(); + super(config); + this.lunarHolidayRegex = recognizersText.RegExpUtility.getSafeRegExp(chineseDateTime.ChineseDateTime.LunarHolidayRegex); + this.integerExtractor = new recognizersTextNumber.ChineseIntegerExtractor(); + this.numberParser = recognizersTextNumber.AgnosticNumberParserFactory.getParser(recognizersTextNumber.AgnosticNumberParserType.Integer, new recognizersTextNumber.ChineseNumberParserConfiguration()); + this.fixedHolidayDictionary = new Map([ + ['元旦', ChineseHolidayParser.NewYear], + ['元旦节', ChineseHolidayParser.NewYear], + ['教师节', ChineseHolidayParser.TeacherDay], + ['青年节', ChineseHolidayParser.YouthDay], + ['儿童节', ChineseHolidayParser.ChildrenDay], + ['妇女节', ChineseHolidayParser.FemaleDay], + ['植树节', ChineseHolidayParser.TreePlantDay], + ['情人节', ChineseHolidayParser.LoverDay], + ['圣诞节', ChineseHolidayParser.ChristmasDay], + ['新年', ChineseHolidayParser.NewYear], + ['愚人节', ChineseHolidayParser.FoolDay], + ['五一', ChineseHolidayParser.LaborDay], + ['劳动节', ChineseHolidayParser.LaborDay], + ['万圣节', ChineseHolidayParser.HalloweenDay], + ['中秋节', ChineseHolidayParser.MidautumnDay], + ['中秋', ChineseHolidayParser.MidautumnDay], + ['春节', ChineseHolidayParser.SpringDay], + ['除夕', ChineseHolidayParser.NewYearEve], + ['元宵节', ChineseHolidayParser.LanternDay], + ['清明节', ChineseHolidayParser.QingMingDay], + ['清明', ChineseHolidayParser.QingMingDay], + ['端午节', ChineseHolidayParser.DragonBoatDay], + ['端午', ChineseHolidayParser.DragonBoatDay], + ['国庆节', ChineseHolidayParser.ChsNationalDay], + ['建军节', ChineseHolidayParser.ChsMilBuildDay], + ['女生节', ChineseHolidayParser.GirlsDay], + ['光棍节', ChineseHolidayParser.SinglesDay], + ['双十一', ChineseHolidayParser.SinglesDay], + ['重阳节', ChineseHolidayParser.ChongYangDay] + ]); + } + static NewYear(year) { return new Date(year, 1 - 1, 1); } + static ChsNationalDay(year) { return new Date(year, 10 - 1, 1); } + static LaborDay(year) { return new Date(year, 5 - 1, 1); } + static ChristmasDay(year) { return new Date(year, 12 - 1, 25); } + static LoverDay(year) { return new Date(year, 2 - 1, 14); } + static ChsMilBuildDay(year) { return new Date(year, 8 - 1, 1); } + static FoolDay(year) { return new Date(year, 4 - 1, 1); } + static GirlsDay(year) { return new Date(year, 3 - 1, 7); } + static TreePlantDay(year) { return new Date(year, 3 - 1, 12); } + static FemaleDay(year) { return new Date(year, 3 - 1, 8); } + static ChildrenDay(year) { return new Date(year, 6 - 1, 1); } + static YouthDay(year) { return new Date(year, 5 - 1, 4); } + static TeacherDay(year) { return new Date(year, 9 - 1, 10); } + static SinglesDay(year) { return new Date(year, 11 - 1, 11); } + static HalloweenDay(year) { return new Date(year, 10 - 1, 31); } + static MidautumnDay(year) { return new Date(year, 8 - 1, 15); } + static SpringDay(year) { return new Date(year, 1 - 1, 1); } + static NewYearEve(year) { return utilities$2.DateUtils.addDays(new Date(year, 1 - 1, 1), -1); } + static LanternDay(year) { return new Date(year, 1 - 1, 15); } + static QingMingDay(year) { return new Date(year, 4 - 1, 4); } + static DragonBoatDay(year) { return new Date(year, 5 - 1, 5); } + static ChongYangDay(year) { return new Date(year, 9 - 1, 9); } + parse(er, referenceDate) { + if (!referenceDate) + referenceDate = new Date(); + let value = null; + if (er.type === baseHoliday.BaseHolidayParser.ParserName) { + let innerResult = this.parseHolidayRegexMatch(er.text, referenceDate); + if (innerResult.success) { + innerResult.futureResolution = {}; + innerResult.futureResolution[constants$2.TimeTypeConstants.DATE] = utilities$2.FormatUtil.formatDate(innerResult.futureValue); + innerResult.pastResolution = {}; + innerResult.pastResolution[constants$2.TimeTypeConstants.DATE] = utilities$2.FormatUtil.formatDate(innerResult.pastValue); + innerResult.isLunar = this.isLunar(er.text); + value = innerResult; + } + } + let ret = new parsers$4.DateTimeParseResult(er); + ret.value = value; + ret.timexStr = value === null ? "" : value.timex; + ret.resolutionStr = ""; + return ret; + } + isLunar(source) { + return recognizersText.RegExpUtility.isMatch(this.lunarHolidayRegex, source); + } + match2Date(match, referenceDate) { + let ret = new utilities$2.DateTimeResolutionResult(); + let holidayStr = this.config.sanitizeHolidayToken(match.groups("holiday").value.toLowerCase()); + if (recognizersText.StringUtility.isNullOrEmpty(holidayStr)) + return ret; + // get year (if exist) + let year = referenceDate.getFullYear(); + let yearNum = match.groups('year').value; + let yearChinese = match.groups('yearchs').value; + let yearRelative = match.groups('yearrel').value; + let hasYear = false; + if (!recognizersText.StringUtility.isNullOrEmpty(yearNum)) { + hasYear = true; + if (this.config.getSwiftYear(yearNum) === 0) { + yearNum = yearNum.substr(0, yearNum.length - 1); + } + year = this.convertYear(yearNum, false); + } + else if (!recognizersText.StringUtility.isNullOrEmpty(yearChinese)) { + hasYear = true; + if (this.config.getSwiftYear(yearChinese) === 0) { + yearChinese = yearChinese.substr(0, yearChinese.length - 1); + } + year = this.convertYear(yearChinese, true); + } + else if (!recognizersText.StringUtility.isNullOrEmpty(yearRelative)) { + hasYear = true; + year += this.config.getSwiftYear(yearRelative); + } + if (year < 100 && year >= 90) { + year += 1900; + } + else if (year < 100 && year < 20) { + year += 2000; + } + let timex = ''; + let date = new Date(referenceDate); + if (this.fixedHolidayDictionary.has(holidayStr)) { + date = this.fixedHolidayDictionary.get(holidayStr)(year); + timex = `-${utilities$2.FormatUtil.toString(date.getMonth() + 1, 2)}-${utilities$2.FormatUtil.toString(date.getDate(), 2)}`; + } + else if (this.config.holidayFuncDictionary.has(holidayStr)) { + date = this.config.holidayFuncDictionary.get(holidayStr)(year); + timex = this.config.variableHolidaysTimexDictionary.get(holidayStr); + } + else { + return ret; + } + if (hasYear) { + ret.timex = utilities$2.FormatUtil.toString(year, 4) + timex; + ret.futureValue = new Date(year, date.getMonth(), date.getDate()); + ret.pastValue = new Date(year, date.getMonth(), date.getDate()); + } + else { + ret.timex = "XXXX" + timex; + ret.futureValue = this.getDateValue(date, referenceDate, holidayStr, 1, (d, r) => d.getTime() < r.getTime()); + ret.pastValue = this.getDateValue(date, referenceDate, holidayStr, -1, (d, r) => d.getTime() >= r.getTime()); + } + ret.success = true; + return ret; + } + convertYear(yearStr, isChinese) { + let year = -1; + let er; + if (isChinese) { + let yearNum = 0; + er = this.integerExtractor.extract(yearStr).pop(); + if (er && er.type === recognizers_text_number_2.Constants.SYS_NUM_INTEGER) { + yearNum = Number.parseInt(this.numberParser.parse(er).value); + } + if (yearNum < 10) { + yearNum = 0; + for (let index = 0; index < yearStr.length; index++) { + let char = yearStr.charAt[index]; + yearNum *= 10; + er = this.integerExtractor.extract(char).pop(); + if (er && er.type === recognizers_text_number_2.Constants.SYS_NUM_INTEGER) { + yearNum += Number.parseInt(this.numberParser.parse(er).value); + } + } + } + else { + year = yearNum; + } + } + else { + year = Number.parseInt(yearStr, 10); + } + return year === 0 ? -1 : year; + } + getDateValue(date, referenceDate, holiday, swift, comparer) { + let result = new Date(date); + if (comparer(date, referenceDate)) { + if (this.fixedHolidayDictionary.has(holiday)) { + return utilities$2.DateUtils.addYears(date, swift); + } + if (this.config.holidayFuncDictionary.has(holiday)) { + result = this.config.holidayFuncDictionary.get(holiday)(referenceDate.getFullYear() + swift); + } + } + return result; + } +} +exports.ChineseHolidayParser = ChineseHolidayParser; + +}); + +unwrapExports(holidayConfiguration$6); + +var mergedConfiguration$6 = createCommonjsModule(function (module, exports) { +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); + + + + + + + + + + + + + + + +class ChineseMergedExtractorConfiguration { + constructor() { + this.dateExtractor = new dateConfiguration$6.ChineseDateExtractor(); + this.timeExtractor = new timeConfiguration$6.ChineseTimeExtractor(); + this.dateTimeExtractor = new dateTimeConfiguration$6.ChineseDateTimeExtractor(); + this.datePeriodExtractor = new datePeriodConfiguration$6.ChineseDatePeriodExtractor(); + this.timePeriodExtractor = new timePeriodConfiguration$6.ChineseTimePeriodExtractor(); + this.dateTimePeriodExtractor = new dateTimePeriodConfiguration$6.ChineseDateTimePeriodExtractor(); + this.setExtractor = new setConfiguration$6.ChineseSetExtractor(); + this.holidayExtractor = new baseHoliday.BaseHolidayExtractor(new holidayConfiguration$6.ChineseHolidayExtractorConfiguration()); + this.durationExtractor = new durationConfiguration$6.ChineseDurationExtractor(); + } +} +class ChineseMergedExtractor extends baseMerged.BaseMergedExtractor { + constructor(options) { + let config = new ChineseMergedExtractorConfiguration(); + super(config, options); + this.dayOfMonthRegex = recognizersText.RegExpUtility.getSafeRegExp(`^\\d{1,2}号`, 'gi'); + } + extract(source, refDate) { + if (!refDate) + refDate = new Date(); + let referenceDate = refDate; + let result = new Array(); + this.addTo(result, this.config.dateExtractor.extract(source, referenceDate), source); + this.addTo(result, this.config.timeExtractor.extract(source, referenceDate), source); + this.addTo(result, this.config.durationExtractor.extract(source, referenceDate), source); + this.addTo(result, this.config.datePeriodExtractor.extract(source, referenceDate), source); + this.addTo(result, this.config.dateTimeExtractor.extract(source, referenceDate), source); + this.addTo(result, this.config.timePeriodExtractor.extract(source, referenceDate), source); + this.addTo(result, this.config.dateTimePeriodExtractor.extract(source, referenceDate), source); + this.addTo(result, this.config.setExtractor.extract(source, referenceDate), source); + this.addTo(result, this.config.holidayExtractor.extract(source, referenceDate), source); + result = this.checkBlackList(result, source); + result = result.sort((a, b) => a.start - b.start); + return result; + } + addTo(destination, source, sourceStr) { + source.forEach(er => { + let isFound = false; + let rmIndex = -1; + let rmLength = 1; + for (let index = 0; index < destination.length; index++) { + if (recognizersText.ExtractResult.isOverlap(destination[index], er)) { + isFound = true; + if (er.length > destination[index].length) { + rmIndex = index; + let j = index + 1; + while (j < destination.length && recognizersText.ExtractResult.isOverlap(destination[j], er)) { + rmLength++; + j++; + } + } + break; + } + } + if (!isFound) { + destination.push(er); + } + else if (rmIndex >= 0) { + destination.splice(rmIndex, rmLength); + destination.splice(0, destination.length, ...this.moveOverlap(destination, er)); + destination.splice(rmIndex, 0, er); + } + }); + } + moveOverlap(destination, result) { + let duplicated = new Array(); + for (let i = 0; i < destination.length; i++) { + if (result.text.includes(destination[i].text) + && (result.start === destination[i].start || result.start + result.length === destination[i].start + destination[i].length)) { + duplicated.push(i); + } + } + return destination.filter((_, i) => duplicated.indexOf(i) < 0); + } + // ported from CheckBlackList + checkBlackList(destination, source) { + return destination.filter(value => { + let valueEnd = value.start + value.length; + if (valueEnd !== source.length) { + let lastChar = source.substr(valueEnd, 1); + if (value.text.endsWith('周') && lastChar === '岁') { + return false; + } + } + if (recognizersText.RegExpUtility.isMatch(this.dayOfMonthRegex, value.text)) { + return false; + } + return true; + }); + } +} +exports.ChineseMergedExtractor = ChineseMergedExtractor; +class ChineseMergedParserConfiguration { + constructor() { + this.beforeRegex = recognizersText.RegExpUtility.getSafeRegExp(chineseDateTime.ChineseDateTime.MergedBeforeRegex); + this.afterRegex = recognizersText.RegExpUtility.getSafeRegExp(chineseDateTime.ChineseDateTime.MergedAfterRegex); + this.sinceRegex = recognizersText.RegExpUtility.getSafeRegExp(chineseDateTime.ChineseDateTime.MergedAfterRegex); + this.dateParser = new dateConfiguration$6.ChineseDateParser(); + this.holidayParser = new holidayConfiguration$6.ChineseHolidayParser(); + this.timeParser = new timeConfiguration$6.ChineseTimeParser(); + this.dateTimeParser = new dateTimeConfiguration$6.ChineseDateTimeParser(); + this.datePeriodParser = new datePeriodConfiguration$6.ChineseDatePeriodParser(); + this.timePeriodParser = new timePeriodConfiguration$6.ChineseTimePeriodParser(); + this.dateTimePeriodParser = new dateTimePeriodConfiguration$6.ChineseDateTimePeriodParser(); + this.durationParser = new durationConfiguration$6.ChineseDurationParser(); + this.setParser = new setConfiguration$6.ChineseSetParser(); + } +} +class ChineseMergedParser extends baseMerged.BaseMergedParser { + constructor() { + let config = new ChineseMergedParserConfiguration(); + super(config, 0); + } + parse(er, refTime) { + let referenceTime = refTime || new Date(); + let pr = null; + // push, save teh MOD string + let hasBefore = recognizersText.RegExpUtility.isMatch(this.config.beforeRegex, er.text); + let hasAfter = recognizersText.RegExpUtility.isMatch(this.config.afterRegex, er.text); + let hasSince = recognizersText.RegExpUtility.isMatch(this.config.sinceRegex, er.text); + if (er.type === constants$2.Constants.SYS_DATETIME_DATE) { + pr = this.config.dateParser.parse(er, referenceTime); + if (pr.value === null || pr.value === undefined) { + pr = this.config.holidayParser.parse(er, referenceTime); + } + } + else if (er.type === constants$2.Constants.SYS_DATETIME_TIME) { + pr = this.config.timeParser.parse(er, referenceTime); + } + else if (er.type === constants$2.Constants.SYS_DATETIME_DATETIME) { + pr = this.config.dateTimeParser.parse(er, referenceTime); + } + else if (er.type === constants$2.Constants.SYS_DATETIME_DATEPERIOD) { + pr = this.config.datePeriodParser.parse(er, referenceTime); + } + else if (er.type === constants$2.Constants.SYS_DATETIME_TIMEPERIOD) { + pr = this.config.timePeriodParser.parse(er, referenceTime); + } + else if (er.type === constants$2.Constants.SYS_DATETIME_DATETIMEPERIOD) { + pr = this.config.dateTimePeriodParser.parse(er, referenceTime); + } + else if (er.type === constants$2.Constants.SYS_DATETIME_DURATION) { + pr = this.config.durationParser.parse(er, referenceTime); + } + else if (er.type === constants$2.Constants.SYS_DATETIME_SET) { + pr = this.config.setParser.parse(er, referenceTime); + } + else { + return null; + } + // pop, restore the MOD string + if (hasBefore && pr.value !== null) { + let val = pr.value; + val.mod = constants$2.TimeTypeConstants.beforeMod; + pr.value = val; + } + if (hasAfter && pr.value !== null) { + let val = pr.value; + val.mod = constants$2.TimeTypeConstants.afterMod; + pr.value = val; + } + if (hasSince && pr.value !== null) { + let val = pr.value; + val.mod = constants$2.TimeTypeConstants.sinceMod; + pr.value = val; + } + pr.value = this.dateTimeResolution(pr, hasBefore, hasAfter, hasSince); + pr.type = `${this.parserTypeName}.${this.determineDateTimeType(er.type, hasBefore, hasAfter, hasSince)}`; + return pr; + } +} +exports.ChineseMergedParser = ChineseMergedParser; +class ChineseFullMergedParser extends baseMerged.BaseMergedParser { + constructor() { + let config = new ChineseMergedParserConfiguration(); + super(config, 0); + } + parse(er, refTime) { + let referenceTime = refTime || new Date(); + let pr = null; + // push, save teh MOD string + let hasBefore = false; + let hasAfter = false; + let modStr = ""; + let beforeMatch = recognizersText.RegExpUtility.getMatches(this.config.beforeRegex, er.text).pop(); + let afterMatch = recognizersText.RegExpUtility.getMatches(this.config.afterRegex, er.text).pop(); + if (beforeMatch) { + hasBefore = true; + er.start += beforeMatch.length; + er.length -= beforeMatch.length; + er.text = er.text.substring(beforeMatch.length); + modStr = beforeMatch.value; + } + else if (afterMatch) { + hasAfter = true; + er.start += afterMatch.length; + er.length -= afterMatch.length; + er.text = er.text.substring(afterMatch.length); + modStr = afterMatch.value; + } + if (er.type === constants$2.Constants.SYS_DATETIME_DATE) { + pr = this.config.dateParser.parse(er, referenceTime); + if (pr.value === null || pr.value === undefined) { + pr = this.config.holidayParser.parse(er, referenceTime); + } + } + else if (er.type === constants$2.Constants.SYS_DATETIME_TIME) { + pr = this.config.timeParser.parse(er, referenceTime); + } + else if (er.type === constants$2.Constants.SYS_DATETIME_DATETIME) { + pr = this.config.dateTimeParser.parse(er, referenceTime); + } + else if (er.type === constants$2.Constants.SYS_DATETIME_DATEPERIOD) { + pr = this.config.datePeriodParser.parse(er, referenceTime); + } + else if (er.type === constants$2.Constants.SYS_DATETIME_TIMEPERIOD) { + pr = this.config.timePeriodParser.parse(er, referenceTime); + } + else if (er.type === constants$2.Constants.SYS_DATETIME_DATETIMEPERIOD) { + pr = this.config.dateTimePeriodParser.parse(er, referenceTime); + } + else if (er.type === constants$2.Constants.SYS_DATETIME_DURATION) { + pr = this.config.durationParser.parse(er, referenceTime); + } + else if (er.type === constants$2.Constants.SYS_DATETIME_SET) { + pr = this.config.setParser.parse(er, referenceTime); + } + else { + return null; + } + // pop, restore the MOD string + if (hasBefore && pr.value !== null) { + pr.length += modStr.length; + pr.start -= modStr.length; + pr.text = modStr + pr.text; + let val = pr.value; + val.mod = constants$2.TimeTypeConstants.beforeMod; + pr.value = val; + } + if (hasAfter && pr.value !== null) { + pr.length += modStr.length; + pr.start -= modStr.length; + pr.text = modStr + pr.text; + let val = pr.value; + val.mod = constants$2.TimeTypeConstants.afterMod; + pr.value = val; + } + pr.value = this.dateTimeResolution(pr, hasBefore, hasAfter); + pr.type = `${this.parserTypeName}.${this.determineDateTimeType(er.type, hasBefore, hasAfter)}`; + return pr; + } + dateTimeResolution(slot, hasBefore, hasAfter, hasSince = false) { + if (!slot) + return null; + let result = new Map(); + let resolutions = new Array(); + let type = slot.type; + let outputType = this.determineDateTimeType(type, hasBefore, hasAfter); + let timex = slot.timexStr; + let value = slot.value; + if (!value) + return null; + let isLunar = value.isLunar; + let mod = value.mod; + let comment = value.comment; + // the following should added to res first since the ResolveAmPm is using these fields + this.addResolutionFieldsAny(result, constants$2.Constants.TimexKey, timex); + this.addResolutionFieldsAny(result, constants$2.Constants.CommentKey, comment); + this.addResolutionFieldsAny(result, constants$2.Constants.ModKey, mod); + this.addResolutionFieldsAny(result, constants$2.Constants.TypeKey, outputType); + let futureResolution = value.futureResolution; + let pastResolution = value.pastResolution; + let future = this.generateFromResolution(type, futureResolution, mod); + let past = this.generateFromResolution(type, pastResolution, mod); + let futureValues = Array.from(this.getValues(future)).sort(); + let pastValues = Array.from(this.getValues(past)).sort(); + if (lodash_isequal(futureValues, pastValues)) { + if (pastValues.length > 0) + this.addResolutionFieldsAny(result, constants$2.Constants.ResolveKey, past); + } + else { + if (pastValues.length > 0) + this.addResolutionFieldsAny(result, constants$2.Constants.ResolveToPastKey, past); + if (futureValues.length > 0) + this.addResolutionFieldsAny(result, constants$2.Constants.ResolveToFutureKey, future); + } + if (comment && comment === 'ampm') { + if (result.has('resolve')) { + this.resolveAMPM(result, 'resolve'); + } + else { + this.resolveAMPM(result, 'resolveToPast'); + this.resolveAMPM(result, 'resolveToFuture'); + } + } + if (isLunar) { + this.addResolutionFieldsAny(result, constants$2.Constants.IsLunarKey, isLunar); + } + result.forEach((value, key) => { + if (this.isObject(value)) { + // is "StringMap" + let newValues = {}; + this.addResolutionFields(newValues, constants$2.Constants.TimexKey, timex); + this.addResolutionFields(newValues, constants$2.Constants.ModKey, mod); + this.addResolutionFields(newValues, constants$2.Constants.TypeKey, outputType); + Object.keys(value).forEach((innerKey) => { + newValues[innerKey] = value[innerKey]; + }); + resolutions.push(newValues); + } + }); + if (Object.keys(past).length === 0 && Object.keys(future).length === 0) { + let o = {}; + o['timex'] = timex; + o['type'] = outputType; + o['value'] = 'not resolved'; + resolutions.push(o); + } + return { + values: resolutions + }; + } + determineDateTimeType(type, hasBefore, hasAfter, hasSince = false) { + if (hasBefore || hasAfter || hasSince) { + if (type === constants$2.Constants.SYS_DATETIME_DATE) + return constants$2.Constants.SYS_DATETIME_DATEPERIOD; + if (type === constants$2.Constants.SYS_DATETIME_TIME) + return constants$2.Constants.SYS_DATETIME_TIMEPERIOD; + if (type === constants$2.Constants.SYS_DATETIME_DATETIME) + return constants$2.Constants.SYS_DATETIME_DATETIMEPERIOD; + } + return type; + } +} +exports.ChineseFullMergedParser = ChineseFullMergedParser; + +}); + +unwrapExports(mergedConfiguration$6); + +var dateTimeRecognizer = createCommonjsModule(function (module, exports) { +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); + + + + + + + + + +var DateTimeOptions; +(function (DateTimeOptions) { + DateTimeOptions[DateTimeOptions["None"] = 0] = "None"; + DateTimeOptions[DateTimeOptions["SkipFromToMerge"] = 1] = "SkipFromToMerge"; + DateTimeOptions[DateTimeOptions["SplitDateAndTime"] = 2] = "SplitDateAndTime"; + DateTimeOptions[DateTimeOptions["Calendar"] = 4] = "Calendar"; +})(DateTimeOptions = exports.DateTimeOptions || (exports.DateTimeOptions = {})); +function recognizeDateTime(query, culture, options = DateTimeOptions.None, referenceDate = new Date(), fallbackToDefaultCulture = true) { + let recognizer = new DateTimeRecognizer(culture, options); + let model = recognizer.getDateTimeModel(culture, fallbackToDefaultCulture); + return model.parse(query, referenceDate); +} +exports.recognizeDateTime = recognizeDateTime; +class DateTimeRecognizer extends recognizersText.Recognizer { + constructor(culture, options = DateTimeOptions.None, lazyInitialization = false) { + super(culture, options, lazyInitialization); + } + InitializeConfiguration() { + //#region English + this.registerModel("DateTimeModel", recognizersTextNumber.Culture.English, (options) => new models$4.DateTimeModel(new baseMerged.BaseMergedParser(new mergedConfiguration.EnglishMergedParserConfiguration(new baseConfiguration.EnglishCommonDateTimeParserConfiguration()), this.Options), new baseMerged.BaseMergedExtractor(new mergedConfiguration.EnglishMergedExtractorConfiguration(), this.Options))); + //#endregion + //#region Spanish + this.registerModel("DateTimeModel", recognizersTextNumber.Culture.Spanish, (options) => new models$4.DateTimeModel(new baseMerged.BaseMergedParser(new mergedConfiguration$2.SpanishMergedParserConfiguration(), this.Options), new baseMerged.BaseMergedExtractor(new mergedConfiguration$2.SpanishMergedExtractorConfiguration(), this.Options))); + //#endregion + //#region Chinese + this.registerModel("DateTimeModel", recognizersTextNumber.Culture.Chinese, (options) => new models$4.DateTimeModel(new mergedConfiguration$6.ChineseFullMergedParser(), new mergedConfiguration$6.ChineseMergedExtractor(this.Options))); + //#endregion + //#region French + this.registerModel("DateTimeModel", recognizersTextNumber.Culture.French, (options) => new models$4.DateTimeModel(new baseMerged.BaseMergedParser(new mergedConfiguration$4.FrenchMergedParserConfiguration(), this.Options), new baseMerged.BaseMergedExtractor(new mergedConfiguration$4.FrenchMergedExtractorConfiguration(), this.Options))); + //#endregion + } + IsValidOptions(options) { + return options >= 0 && options <= DateTimeOptions.None + DateTimeOptions.SkipFromToMerge + DateTimeOptions.SplitDateAndTime + DateTimeOptions.Calendar; + } + getDateTimeModel(culture = null, fallbackToDefaultCulture = true) { + return this.getModel("DateTimeModel", culture, fallbackToDefaultCulture); + } +} +exports.default = DateTimeRecognizer; + +}); + +unwrapExports(dateTimeRecognizer); + +var timeParser = createCommonjsModule(function (module, exports) { +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); + + + + +class FrenchTimeParser extends baseTime.BaseTimeParser { + constructor(config) { + super(config); + } + internalParse(text, referenceTime) { + let ret = super.internalParse(text, referenceTime); + if (!ret.success) { + ret = this.parseIsh(text, referenceTime); + } + return ret; + } + parseIsh(text, referenceTime) { + let ret = new utilities$2.DateTimeResolutionResult(); + let trimedText = text.trim().toLowerCase(); + let matches = recognizersText.RegExpUtility.getMatches(recognizersText.RegExpUtility.getSafeRegExp(frenchDateTime.FrenchDateTime.IshRegex), text); + if (matches.length && matches[0].index === 0 && matches[0].length === trimedText.length) { + let hourStr = matches[0].groups("hour").value; + let hour = 12; + if (hourStr) { + hour = parseInt(hourStr, 10); + } + ret.timex = "T" + utilities$2.FormatUtil.toString(hour, 2); + ret.futureValue = + ret.pastValue = + utilities$2.DateUtils.safeCreateFromMinValue(referenceTime.getFullYear(), referenceTime.getMonth(), referenceTime.getDate(), hour, 0, 0); + ret.success = true; + } + return ret; + } +} +exports.FrenchTimeParser = FrenchTimeParser; + +}); + +unwrapExports(timeParser); + +var recognizersTextDateTime = createCommonjsModule(function (module, exports) { +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); + +exports.DateTimeRecognizer = dateTimeRecognizer.default; +exports.DateTimeOptions = dateTimeRecognizer.DateTimeOptions; +exports.recognizeDateTime = dateTimeRecognizer.recognizeDateTime; + +exports.Culture = recognizersTextNumber.Culture; +exports.CultureInfo = recognizersTextNumber.CultureInfo; + +exports.BaseDateExtractor = baseDate.BaseDateExtractor; +exports.BaseDateParser = baseDate.BaseDateParser; + +exports.BaseTimeExtractor = baseTime.BaseTimeExtractor; +exports.BaseTimeParser = baseTime.BaseTimeParser; + +exports.BaseDatePeriodExtractor = baseDatePeriod.BaseDatePeriodExtractor; +exports.BaseDatePeriodParser = baseDatePeriod.BaseDatePeriodParser; + +exports.BaseTimePeriodExtractor = baseTimePeriod.BaseTimePeriodExtractor; +exports.BaseTimePeriodParser = baseTimePeriod.BaseTimePeriodParser; + +exports.BaseDateTimeExtractor = baseDateTime$2.BaseDateTimeExtractor; +exports.BaseDateTimeParser = baseDateTime$2.BaseDateTimeParser; + +exports.BaseDateTimePeriodExtractor = baseDateTimePeriod.BaseDateTimePeriodExtractor; +exports.BaseDateTimePeriodParser = baseDateTimePeriod.BaseDateTimePeriodParser; + +exports.BaseDurationExtractor = baseDuration.BaseDurationExtractor; +exports.BaseDurationParser = baseDuration.BaseDurationParser; + +exports.BaseSetExtractor = baseSet.BaseSetExtractor; +exports.BaseSetParser = baseSet.BaseSetParser; + +exports.BaseHolidayExtractor = baseHoliday.BaseHolidayExtractor; +exports.BaseHolidayParser = baseHoliday.BaseHolidayParser; +exports.BaseHolidayParserConfiguration = baseHoliday.BaseHolidayParserConfiguration; + +exports.BaseMergedExtractor = baseMerged.BaseMergedExtractor; +exports.BaseMergedParser = baseMerged.BaseMergedParser; + +exports.Constants = constants$2.Constants; +exports.TimeTypeConstants = constants$2.TimeTypeConstants; + +exports.DateTimeModelResult = models$4.DateTimeModelResult; +exports.DateTimeModel = models$4.DateTimeModel; + +exports.DateTimeParseResult = parsers$4.DateTimeParseResult; +exports.BaseDateParserConfiguration = parsers$4.BaseDateParserConfiguration; + +exports.Token = utilities$2.Token; +exports.AgoLaterMode = utilities$2.AgoLaterMode; +exports.AgoLaterUtil = utilities$2.AgoLaterUtil; +exports.MatchingUtil = utilities$2.MatchingUtil; +exports.FormatUtil = utilities$2.FormatUtil; +exports.DateTimeResolutionResult = utilities$2.DateTimeResolutionResult; +exports.DateUtils = utilities$2.DateUtils; +exports.DayOfWeek = utilities$2.DayOfWeek; + +exports.EnglishCommonDateTimeParserConfiguration = baseConfiguration.EnglishCommonDateTimeParserConfiguration; +exports.EnglishDateTimeUtilityConfiguration = baseConfiguration.EnglishDateTimeUtilityConfiguration; + +exports.EnglishDateExtractorConfiguration = dateConfiguration.EnglishDateExtractorConfiguration; +exports.EnglishDateParserConfiguration = dateConfiguration.EnglishDateParserConfiguration; + +exports.EnglishTimeExtractorConfiguration = timeConfiguration.EnglishTimeExtractorConfiguration; +exports.EnglishTimeParserConfiguration = timeConfiguration.EnglishTimeParserConfiguration; + +exports.EnglishDatePeriodExtractorConfiguration = datePeriodConfiguration.EnglishDatePeriodExtractorConfiguration; +exports.EnglishDatePeriodParserConfiguration = datePeriodConfiguration.EnglishDatePeriodParserConfiguration; + +exports.EnglishTimePeriodExtractorConfiguration = timePeriodConfiguration.EnglishTimePeriodExtractorConfiguration; +exports.EnglishTimePeriodParserConfiguration = timePeriodConfiguration.EnglishTimePeriodParserConfiguration; + +exports.EnglishDateTimeExtractorConfiguration = dateTimeConfiguration.EnglishDateTimeExtractorConfiguration; +exports.EnglishDateTimeParserConfiguration = dateTimeConfiguration.EnglishDateTimeParserConfiguration; + +exports.EnglishDateTimePeriodExtractorConfiguration = dateTimePeriodConfiguration.EnglishDateTimePeriodExtractorConfiguration; +exports.EnglishDateTimePeriodParserConfiguration = dateTimePeriodConfiguration.EnglishDateTimePeriodParserConfiguration; + +exports.EnglishSetExtractorConfiguration = setConfiguration.EnglishSetExtractorConfiguration; +exports.EnglishSetParserConfiguration = setConfiguration.EnglishSetParserConfiguration; + +exports.EnglishDurationExtractorConfiguration = durationConfiguration.EnglishDurationExtractorConfiguration; +exports.EnglishDurationParserConfiguration = durationConfiguration.EnglishDurationParserConfiguration; + +exports.EnglishHolidayExtractorConfiguration = holidayConfiguration.EnglishHolidayExtractorConfiguration; +exports.EnglishHolidayParserConfiguration = holidayConfiguration.EnglishHolidayParserConfiguration; + +exports.EnglishMergedExtractorConfiguration = mergedConfiguration.EnglishMergedExtractorConfiguration; +exports.EnglishMergedParserConfiguration = mergedConfiguration.EnglishMergedParserConfiguration; + +exports.EnglishTimeParser = parsers$6.EnglishTimeParser; + +exports.SpanishCommonDateTimeParserConfiguration = baseConfiguration$2.SpanishCommonDateTimeParserConfiguration; +exports.SpanishDateTimeUtilityConfiguration = baseConfiguration$2.SpanishDateTimeUtilityConfiguration; + +exports.SpanishDateExtractorConfiguration = dateConfiguration$2.SpanishDateExtractorConfiguration; +exports.SpanishDateParserConfiguration = dateConfiguration$2.SpanishDateParserConfiguration; + +exports.SpanishTimeExtractorConfiguration = timeConfiguration$2.SpanishTimeExtractorConfiguration; +exports.SpanishTimeParserConfiguration = timeConfiguration$2.SpanishTimeParserConfiguration; + +exports.SpanishDatePeriodExtractorConfiguration = datePeriodConfiguration$2.SpanishDatePeriodExtractorConfiguration; +exports.SpanishDatePeriodParserConfiguration = datePeriodConfiguration$2.SpanishDatePeriodParserConfiguration; + +exports.SpanishTimePeriodExtractorConfiguration = timePeriodConfiguration$2.SpanishTimePeriodExtractorConfiguration; +exports.SpanishTimePeriodParserConfiguration = timePeriodConfiguration$2.SpanishTimePeriodParserConfiguration; + +exports.SpanishDateTimeExtractorConfiguration = dateTimeConfiguration$2.SpanishDateTimeExtractorConfiguration; +exports.SpanishDateTimeParserConfiguration = dateTimeConfiguration$2.SpanishDateTimeParserConfiguration; + +exports.SpanishDateTimePeriodExtractorConfiguration = dateTimePeriodConfiguration$2.SpanishDateTimePeriodExtractorConfiguration; +exports.SpanishDateTimePeriodParserConfiguration = dateTimePeriodConfiguration$2.SpanishDateTimePeriodParserConfiguration; + +exports.SpanishSetExtractorConfiguration = setConfiguration$2.SpanishSetExtractorConfiguration; +exports.SpanishSetParserConfiguration = setConfiguration$2.SpanishSetParserConfiguration; + +exports.SpanishDurationExtractorConfiguration = durationConfiguration$2.SpanishDurationExtractorConfiguration; +exports.SpanishDurationParserConfiguration = durationConfiguration$2.SpanishDurationParserConfiguration; + +exports.SpanishHolidayExtractorConfiguration = holidayConfiguration$2.SpanishHolidayExtractorConfiguration; +exports.SpanishHolidayParserConfiguration = holidayConfiguration$2.SpanishHolidayParserConfiguration; + +exports.SpanishMergedExtractorConfiguration = mergedConfiguration$2.SpanishMergedExtractorConfiguration; +exports.SpanishMergedParserConfiguration = mergedConfiguration$2.SpanishMergedParserConfiguration; + +exports.SpanishDateTimePeriodParser = dateTimePeriodParser.SpanishDateTimePeriodParser; + +exports.FrenchCommonDateTimeParserConfiguration = baseConfiguration$4.FrenchCommonDateTimeParserConfiguration; +exports.FrenchDateTimeUtilityConfiguration = baseConfiguration$4.FrenchDateTimeUtilityConfiguration; + +exports.FrenchDateExtractorConfiguration = dateConfiguration$4.FrenchDateExtractorConfiguration; +exports.FrenchDateParserConfiguration = dateConfiguration$4.FrenchDateParserConfiguration; + +exports.FrenchTimeExtractorConfiguration = timeConfiguration$4.FrenchTimeExtractorConfiguration; +exports.FrenchTimeParserConfiguration = timeConfiguration$4.FrenchTimeParserConfiguration; + +exports.FrenchDatePeriodExtractorConfiguration = datePeriodConfiguration$4.FrenchDatePeriodExtractorConfiguration; +exports.FrenchDatePeriodParserConfiguration = datePeriodConfiguration$4.FrenchDatePeriodParserConfiguration; + +exports.FrenchTimePeriodExtractorConfiguration = timePeriodConfiguration$4.FrenchTimePeriodExtractorConfiguration; +exports.FrenchTimePeriodParserConfiguration = timePeriodConfiguration$4.FrenchTimePeriodParserConfiguration; + +exports.FrenchDateTimeExtractorConfiguration = dateTimeConfiguration$4.FrenchDateTimeExtractorConfiguration; +exports.FrenchDateTimeParserConfiguration = dateTimeConfiguration$4.FrenchDateTimeParserConfiguration; + +exports.FrenchDateTimePeriodExtractorConfiguration = dateTimePeriodConfiguration$4.FrenchDateTimePeriodExtractorConfiguration; +exports.FrenchDateTimePeriodParserConfiguration = dateTimePeriodConfiguration$4.FrenchDateTimePeriodParserConfiguration; + +exports.FrenchSetExtractorConfiguration = setConfiguration$4.FrenchSetExtractorConfiguration; +exports.FrenchSetParserConfiguration = setConfiguration$4.FrenchSetParserConfiguration; + +exports.FrenchDurationExtractorConfiguration = durationConfiguration$4.FrenchDurationExtractorConfiguration; +exports.FrenchDurationParserConfiguration = durationConfiguration$4.FrenchDurationParserConfiguration; + +exports.FrenchHolidayExtractorConfiguration = holidayConfiguration$4.FrenchHolidayExtractorConfiguration; +exports.FrenchHolidayParserConfiguration = holidayConfiguration$4.FrenchHolidayParserConfiguration; + +exports.FrenchMergedExtractorConfiguration = mergedConfiguration$4.FrenchMergedExtractorConfiguration; +exports.FrenchMergedParserConfiguration = mergedConfiguration$4.FrenchMergedParserConfiguration; + +exports.FrenchTimeParser = timeParser.FrenchTimeParser; + +exports.ChineseDurationExtractor = durationConfiguration$6.ChineseDurationExtractor; +exports.ChineseDurationParser = durationConfiguration$6.ChineseDurationParser; + +exports.ChineseTimeExtractor = timeConfiguration$6.ChineseTimeExtractor; +exports.ChineseTimeParser = timeConfiguration$6.ChineseTimeParser; + +exports.ChineseTimePeriodExtractor = timePeriodConfiguration$6.ChineseTimePeriodExtractor; +exports.ChineseTimePeriodParser = timePeriodConfiguration$6.ChineseTimePeriodParser; + +exports.ChineseDateExtractor = dateConfiguration$6.ChineseDateExtractor; +exports.ChineseDateParser = dateConfiguration$6.ChineseDateParser; + +exports.ChineseDatePeriodExtractor = datePeriodConfiguration$6.ChineseDatePeriodExtractor; +exports.ChineseDatePeriodParser = datePeriodConfiguration$6.ChineseDatePeriodParser; + +exports.ChineseDateTimeExtractor = dateTimeConfiguration$6.ChineseDateTimeExtractor; +exports.ChineseDateTimeParser = dateTimeConfiguration$6.ChineseDateTimeParser; + +exports.ChineseDateTimePeriodExtractor = dateTimePeriodConfiguration$6.ChineseDateTimePeriodExtractor; +exports.ChineseDateTimePeriodParser = dateTimePeriodConfiguration$6.ChineseDateTimePeriodParser; + +exports.ChineseSetExtractor = setConfiguration$6.ChineseSetExtractor; +exports.ChineseSetParser = setConfiguration$6.ChineseSetParser; + +exports.ChineseHolidayExtractorConfiguration = holidayConfiguration$6.ChineseHolidayExtractorConfiguration; +exports.ChineseHolidayParser = holidayConfiguration$6.ChineseHolidayParser; + +exports.ChineseMergedExtractor = mergedConfiguration$6.ChineseMergedExtractor; +exports.ChineseMergedParser = mergedConfiguration$6.ChineseMergedParser; +exports.ChineseFullMergedParser = mergedConfiguration$6.ChineseFullMergedParser; + +exports.BaseDateTime = baseDateTime.BaseDateTime; + +exports.EnglishDateTime = englishDateTime.EnglishDateTime; + +exports.SpanishDateTime = spanishDateTime.SpanishDateTime; + +exports.FrenchDateTime = frenchDateTime.FrenchDateTime; + +exports.ChineseDateTime = chineseDateTime.ChineseDateTime; + +}); + +var recognizersTextDateTime$1 = unwrapExports(recognizersTextDateTime); +var recognizersTextDateTime_1 = recognizersTextDateTime.DateTimeRecognizer; +var recognizersTextDateTime_2 = recognizersTextDateTime.DateTimeOptions; +var recognizersTextDateTime_3 = recognizersTextDateTime.recognizeDateTime; +var recognizersTextDateTime_4 = recognizersTextDateTime.Culture; +var recognizersTextDateTime_5 = recognizersTextDateTime.CultureInfo; +var recognizersTextDateTime_6 = recognizersTextDateTime.BaseDateExtractor; +var recognizersTextDateTime_7 = recognizersTextDateTime.BaseDateParser; +var recognizersTextDateTime_8 = recognizersTextDateTime.BaseTimeExtractor; +var recognizersTextDateTime_9 = recognizersTextDateTime.BaseTimeParser; +var recognizersTextDateTime_10 = recognizersTextDateTime.BaseDatePeriodExtractor; +var recognizersTextDateTime_11 = recognizersTextDateTime.BaseDatePeriodParser; +var recognizersTextDateTime_12 = recognizersTextDateTime.BaseTimePeriodExtractor; +var recognizersTextDateTime_13 = recognizersTextDateTime.BaseTimePeriodParser; +var recognizersTextDateTime_14 = recognizersTextDateTime.BaseDateTimeExtractor; +var recognizersTextDateTime_15 = recognizersTextDateTime.BaseDateTimeParser; +var recognizersTextDateTime_16 = recognizersTextDateTime.BaseDateTimePeriodExtractor; +var recognizersTextDateTime_17 = recognizersTextDateTime.BaseDateTimePeriodParser; +var recognizersTextDateTime_18 = recognizersTextDateTime.BaseDurationExtractor; +var recognizersTextDateTime_19 = recognizersTextDateTime.BaseDurationParser; +var recognizersTextDateTime_20 = recognizersTextDateTime.BaseSetExtractor; +var recognizersTextDateTime_21 = recognizersTextDateTime.BaseSetParser; +var recognizersTextDateTime_22 = recognizersTextDateTime.BaseHolidayExtractor; +var recognizersTextDateTime_23 = recognizersTextDateTime.BaseHolidayParser; +var recognizersTextDateTime_24 = recognizersTextDateTime.BaseHolidayParserConfiguration; +var recognizersTextDateTime_25 = recognizersTextDateTime.BaseMergedExtractor; +var recognizersTextDateTime_26 = recognizersTextDateTime.BaseMergedParser; +var recognizersTextDateTime_27 = recognizersTextDateTime.Constants; +var recognizersTextDateTime_28 = recognizersTextDateTime.TimeTypeConstants; +var recognizersTextDateTime_29 = recognizersTextDateTime.DateTimeModelResult; +var recognizersTextDateTime_30 = recognizersTextDateTime.DateTimeModel; +var recognizersTextDateTime_31 = recognizersTextDateTime.DateTimeParseResult; +var recognizersTextDateTime_32 = recognizersTextDateTime.BaseDateParserConfiguration; +var recognizersTextDateTime_33 = recognizersTextDateTime.Token; +var recognizersTextDateTime_34 = recognizersTextDateTime.AgoLaterMode; +var recognizersTextDateTime_35 = recognizersTextDateTime.AgoLaterUtil; +var recognizersTextDateTime_36 = recognizersTextDateTime.MatchingUtil; +var recognizersTextDateTime_37 = recognizersTextDateTime.FormatUtil; +var recognizersTextDateTime_38 = recognizersTextDateTime.DateTimeResolutionResult; +var recognizersTextDateTime_39 = recognizersTextDateTime.DateUtils; +var recognizersTextDateTime_40 = recognizersTextDateTime.DayOfWeek; +var recognizersTextDateTime_41 = recognizersTextDateTime.EnglishCommonDateTimeParserConfiguration; +var recognizersTextDateTime_42 = recognizersTextDateTime.EnglishDateTimeUtilityConfiguration; +var recognizersTextDateTime_43 = recognizersTextDateTime.EnglishDateExtractorConfiguration; +var recognizersTextDateTime_44 = recognizersTextDateTime.EnglishDateParserConfiguration; +var recognizersTextDateTime_45 = recognizersTextDateTime.EnglishTimeExtractorConfiguration; +var recognizersTextDateTime_46 = recognizersTextDateTime.EnglishTimeParserConfiguration; +var recognizersTextDateTime_47 = recognizersTextDateTime.EnglishDatePeriodExtractorConfiguration; +var recognizersTextDateTime_48 = recognizersTextDateTime.EnglishDatePeriodParserConfiguration; +var recognizersTextDateTime_49 = recognizersTextDateTime.EnglishTimePeriodExtractorConfiguration; +var recognizersTextDateTime_50 = recognizersTextDateTime.EnglishTimePeriodParserConfiguration; +var recognizersTextDateTime_51 = recognizersTextDateTime.EnglishDateTimeExtractorConfiguration; +var recognizersTextDateTime_52 = recognizersTextDateTime.EnglishDateTimeParserConfiguration; +var recognizersTextDateTime_53 = recognizersTextDateTime.EnglishDateTimePeriodExtractorConfiguration; +var recognizersTextDateTime_54 = recognizersTextDateTime.EnglishDateTimePeriodParserConfiguration; +var recognizersTextDateTime_55 = recognizersTextDateTime.EnglishSetExtractorConfiguration; +var recognizersTextDateTime_56 = recognizersTextDateTime.EnglishSetParserConfiguration; +var recognizersTextDateTime_57 = recognizersTextDateTime.EnglishDurationExtractorConfiguration; +var recognizersTextDateTime_58 = recognizersTextDateTime.EnglishDurationParserConfiguration; +var recognizersTextDateTime_59 = recognizersTextDateTime.EnglishHolidayExtractorConfiguration; +var recognizersTextDateTime_60 = recognizersTextDateTime.EnglishHolidayParserConfiguration; +var recognizersTextDateTime_61 = recognizersTextDateTime.EnglishMergedExtractorConfiguration; +var recognizersTextDateTime_62 = recognizersTextDateTime.EnglishMergedParserConfiguration; +var recognizersTextDateTime_63 = recognizersTextDateTime.EnglishTimeParser; +var recognizersTextDateTime_64 = recognizersTextDateTime.SpanishCommonDateTimeParserConfiguration; +var recognizersTextDateTime_65 = recognizersTextDateTime.SpanishDateTimeUtilityConfiguration; +var recognizersTextDateTime_66 = recognizersTextDateTime.SpanishDateExtractorConfiguration; +var recognizersTextDateTime_67 = recognizersTextDateTime.SpanishDateParserConfiguration; +var recognizersTextDateTime_68 = recognizersTextDateTime.SpanishTimeExtractorConfiguration; +var recognizersTextDateTime_69 = recognizersTextDateTime.SpanishTimeParserConfiguration; +var recognizersTextDateTime_70 = recognizersTextDateTime.SpanishDatePeriodExtractorConfiguration; +var recognizersTextDateTime_71 = recognizersTextDateTime.SpanishDatePeriodParserConfiguration; +var recognizersTextDateTime_72 = recognizersTextDateTime.SpanishTimePeriodExtractorConfiguration; +var recognizersTextDateTime_73 = recognizersTextDateTime.SpanishTimePeriodParserConfiguration; +var recognizersTextDateTime_74 = recognizersTextDateTime.SpanishDateTimeExtractorConfiguration; +var recognizersTextDateTime_75 = recognizersTextDateTime.SpanishDateTimeParserConfiguration; +var recognizersTextDateTime_76 = recognizersTextDateTime.SpanishDateTimePeriodExtractorConfiguration; +var recognizersTextDateTime_77 = recognizersTextDateTime.SpanishDateTimePeriodParserConfiguration; +var recognizersTextDateTime_78 = recognizersTextDateTime.SpanishSetExtractorConfiguration; +var recognizersTextDateTime_79 = recognizersTextDateTime.SpanishSetParserConfiguration; +var recognizersTextDateTime_80 = recognizersTextDateTime.SpanishDurationExtractorConfiguration; +var recognizersTextDateTime_81 = recognizersTextDateTime.SpanishDurationParserConfiguration; +var recognizersTextDateTime_82 = recognizersTextDateTime.SpanishHolidayExtractorConfiguration; +var recognizersTextDateTime_83 = recognizersTextDateTime.SpanishHolidayParserConfiguration; +var recognizersTextDateTime_84 = recognizersTextDateTime.SpanishMergedExtractorConfiguration; +var recognizersTextDateTime_85 = recognizersTextDateTime.SpanishMergedParserConfiguration; +var recognizersTextDateTime_86 = recognizersTextDateTime.SpanishDateTimePeriodParser; +var recognizersTextDateTime_87 = recognizersTextDateTime.FrenchCommonDateTimeParserConfiguration; +var recognizersTextDateTime_88 = recognizersTextDateTime.FrenchDateTimeUtilityConfiguration; +var recognizersTextDateTime_89 = recognizersTextDateTime.FrenchDateExtractorConfiguration; +var recognizersTextDateTime_90 = recognizersTextDateTime.FrenchDateParserConfiguration; +var recognizersTextDateTime_91 = recognizersTextDateTime.FrenchTimeExtractorConfiguration; +var recognizersTextDateTime_92 = recognizersTextDateTime.FrenchTimeParserConfiguration; +var recognizersTextDateTime_93 = recognizersTextDateTime.FrenchDatePeriodExtractorConfiguration; +var recognizersTextDateTime_94 = recognizersTextDateTime.FrenchDatePeriodParserConfiguration; +var recognizersTextDateTime_95 = recognizersTextDateTime.FrenchTimePeriodExtractorConfiguration; +var recognizersTextDateTime_96 = recognizersTextDateTime.FrenchTimePeriodParserConfiguration; +var recognizersTextDateTime_97 = recognizersTextDateTime.FrenchDateTimeExtractorConfiguration; +var recognizersTextDateTime_98 = recognizersTextDateTime.FrenchDateTimeParserConfiguration; +var recognizersTextDateTime_99 = recognizersTextDateTime.FrenchDateTimePeriodExtractorConfiguration; +var recognizersTextDateTime_100 = recognizersTextDateTime.FrenchDateTimePeriodParserConfiguration; +var recognizersTextDateTime_101 = recognizersTextDateTime.FrenchSetExtractorConfiguration; +var recognizersTextDateTime_102 = recognizersTextDateTime.FrenchSetParserConfiguration; +var recognizersTextDateTime_103 = recognizersTextDateTime.FrenchDurationExtractorConfiguration; +var recognizersTextDateTime_104 = recognizersTextDateTime.FrenchDurationParserConfiguration; +var recognizersTextDateTime_105 = recognizersTextDateTime.FrenchHolidayExtractorConfiguration; +var recognizersTextDateTime_106 = recognizersTextDateTime.FrenchHolidayParserConfiguration; +var recognizersTextDateTime_107 = recognizersTextDateTime.FrenchMergedExtractorConfiguration; +var recognizersTextDateTime_108 = recognizersTextDateTime.FrenchMergedParserConfiguration; +var recognizersTextDateTime_109 = recognizersTextDateTime.FrenchTimeParser; +var recognizersTextDateTime_110 = recognizersTextDateTime.ChineseDurationExtractor; +var recognizersTextDateTime_111 = recognizersTextDateTime.ChineseDurationParser; +var recognizersTextDateTime_112 = recognizersTextDateTime.ChineseTimeExtractor; +var recognizersTextDateTime_113 = recognizersTextDateTime.ChineseTimeParser; +var recognizersTextDateTime_114 = recognizersTextDateTime.ChineseTimePeriodExtractor; +var recognizersTextDateTime_115 = recognizersTextDateTime.ChineseTimePeriodParser; +var recognizersTextDateTime_116 = recognizersTextDateTime.ChineseDateExtractor; +var recognizersTextDateTime_117 = recognizersTextDateTime.ChineseDateParser; +var recognizersTextDateTime_118 = recognizersTextDateTime.ChineseDatePeriodExtractor; +var recognizersTextDateTime_119 = recognizersTextDateTime.ChineseDatePeriodParser; +var recognizersTextDateTime_120 = recognizersTextDateTime.ChineseDateTimeExtractor; +var recognizersTextDateTime_121 = recognizersTextDateTime.ChineseDateTimeParser; +var recognizersTextDateTime_122 = recognizersTextDateTime.ChineseDateTimePeriodExtractor; +var recognizersTextDateTime_123 = recognizersTextDateTime.ChineseDateTimePeriodParser; +var recognizersTextDateTime_124 = recognizersTextDateTime.ChineseSetExtractor; +var recognizersTextDateTime_125 = recognizersTextDateTime.ChineseSetParser; +var recognizersTextDateTime_126 = recognizersTextDateTime.ChineseHolidayExtractorConfiguration; +var recognizersTextDateTime_127 = recognizersTextDateTime.ChineseHolidayParser; +var recognizersTextDateTime_128 = recognizersTextDateTime.ChineseMergedExtractor; +var recognizersTextDateTime_129 = recognizersTextDateTime.ChineseMergedParser; +var recognizersTextDateTime_130 = recognizersTextDateTime.ChineseFullMergedParser; +var recognizersTextDateTime_131 = recognizersTextDateTime.BaseDateTime; +var recognizersTextDateTime_132 = recognizersTextDateTime.EnglishDateTime; +var recognizersTextDateTime_133 = recognizersTextDateTime.SpanishDateTime; +var recognizersTextDateTime_134 = recognizersTextDateTime.FrenchDateTime; +var recognizersTextDateTime_135 = recognizersTextDateTime.ChineseDateTime; + +export { recognizersTextDateTime_1 as DateTimeRecognizer, recognizersTextDateTime_2 as DateTimeOptions, recognizersTextDateTime_3 as recognizeDateTime, recognizersTextDateTime_4 as Culture, recognizersTextDateTime_5 as CultureInfo, recognizersTextDateTime_6 as BaseDateExtractor, recognizersTextDateTime_7 as BaseDateParser, recognizersTextDateTime_8 as BaseTimeExtractor, recognizersTextDateTime_9 as BaseTimeParser, recognizersTextDateTime_10 as BaseDatePeriodExtractor, recognizersTextDateTime_11 as BaseDatePeriodParser, recognizersTextDateTime_12 as BaseTimePeriodExtractor, recognizersTextDateTime_13 as BaseTimePeriodParser, recognizersTextDateTime_14 as BaseDateTimeExtractor, recognizersTextDateTime_15 as BaseDateTimeParser, recognizersTextDateTime_16 as BaseDateTimePeriodExtractor, recognizersTextDateTime_17 as BaseDateTimePeriodParser, recognizersTextDateTime_18 as BaseDurationExtractor, recognizersTextDateTime_19 as BaseDurationParser, recognizersTextDateTime_20 as BaseSetExtractor, recognizersTextDateTime_21 as BaseSetParser, recognizersTextDateTime_22 as BaseHolidayExtractor, recognizersTextDateTime_23 as BaseHolidayParser, recognizersTextDateTime_24 as BaseHolidayParserConfiguration, recognizersTextDateTime_25 as BaseMergedExtractor, recognizersTextDateTime_26 as BaseMergedParser, recognizersTextDateTime_27 as Constants, recognizersTextDateTime_28 as TimeTypeConstants, recognizersTextDateTime_29 as DateTimeModelResult, recognizersTextDateTime_30 as DateTimeModel, recognizersTextDateTime_31 as DateTimeParseResult, recognizersTextDateTime_32 as BaseDateParserConfiguration, recognizersTextDateTime_33 as Token, recognizersTextDateTime_34 as AgoLaterMode, recognizersTextDateTime_35 as AgoLaterUtil, recognizersTextDateTime_36 as MatchingUtil, recognizersTextDateTime_37 as FormatUtil, recognizersTextDateTime_38 as DateTimeResolutionResult, recognizersTextDateTime_39 as DateUtils, recognizersTextDateTime_40 as DayOfWeek, recognizersTextDateTime_41 as EnglishCommonDateTimeParserConfiguration, recognizersTextDateTime_42 as EnglishDateTimeUtilityConfiguration, recognizersTextDateTime_43 as EnglishDateExtractorConfiguration, recognizersTextDateTime_44 as EnglishDateParserConfiguration, recognizersTextDateTime_45 as EnglishTimeExtractorConfiguration, recognizersTextDateTime_46 as EnglishTimeParserConfiguration, recognizersTextDateTime_47 as EnglishDatePeriodExtractorConfiguration, recognizersTextDateTime_48 as EnglishDatePeriodParserConfiguration, recognizersTextDateTime_49 as EnglishTimePeriodExtractorConfiguration, recognizersTextDateTime_50 as EnglishTimePeriodParserConfiguration, recognizersTextDateTime_51 as EnglishDateTimeExtractorConfiguration, recognizersTextDateTime_52 as EnglishDateTimeParserConfiguration, recognizersTextDateTime_53 as EnglishDateTimePeriodExtractorConfiguration, recognizersTextDateTime_54 as EnglishDateTimePeriodParserConfiguration, recognizersTextDateTime_55 as EnglishSetExtractorConfiguration, recognizersTextDateTime_56 as EnglishSetParserConfiguration, recognizersTextDateTime_57 as EnglishDurationExtractorConfiguration, recognizersTextDateTime_58 as EnglishDurationParserConfiguration, recognizersTextDateTime_59 as EnglishHolidayExtractorConfiguration, recognizersTextDateTime_60 as EnglishHolidayParserConfiguration, recognizersTextDateTime_61 as EnglishMergedExtractorConfiguration, recognizersTextDateTime_62 as EnglishMergedParserConfiguration, recognizersTextDateTime_63 as EnglishTimeParser, recognizersTextDateTime_64 as SpanishCommonDateTimeParserConfiguration, recognizersTextDateTime_65 as SpanishDateTimeUtilityConfiguration, recognizersTextDateTime_66 as SpanishDateExtractorConfiguration, recognizersTextDateTime_67 as SpanishDateParserConfiguration, recognizersTextDateTime_68 as SpanishTimeExtractorConfiguration, recognizersTextDateTime_69 as SpanishTimeParserConfiguration, recognizersTextDateTime_70 as SpanishDatePeriodExtractorConfiguration, recognizersTextDateTime_71 as SpanishDatePeriodParserConfiguration, recognizersTextDateTime_72 as SpanishTimePeriodExtractorConfiguration, recognizersTextDateTime_73 as SpanishTimePeriodParserConfiguration, recognizersTextDateTime_74 as SpanishDateTimeExtractorConfiguration, recognizersTextDateTime_75 as SpanishDateTimeParserConfiguration, recognizersTextDateTime_76 as SpanishDateTimePeriodExtractorConfiguration, recognizersTextDateTime_77 as SpanishDateTimePeriodParserConfiguration, recognizersTextDateTime_78 as SpanishSetExtractorConfiguration, recognizersTextDateTime_79 as SpanishSetParserConfiguration, recognizersTextDateTime_80 as SpanishDurationExtractorConfiguration, recognizersTextDateTime_81 as SpanishDurationParserConfiguration, recognizersTextDateTime_82 as SpanishHolidayExtractorConfiguration, recognizersTextDateTime_83 as SpanishHolidayParserConfiguration, recognizersTextDateTime_84 as SpanishMergedExtractorConfiguration, recognizersTextDateTime_85 as SpanishMergedParserConfiguration, recognizersTextDateTime_86 as SpanishDateTimePeriodParser, recognizersTextDateTime_87 as FrenchCommonDateTimeParserConfiguration, recognizersTextDateTime_88 as FrenchDateTimeUtilityConfiguration, recognizersTextDateTime_89 as FrenchDateExtractorConfiguration, recognizersTextDateTime_90 as FrenchDateParserConfiguration, recognizersTextDateTime_91 as FrenchTimeExtractorConfiguration, recognizersTextDateTime_92 as FrenchTimeParserConfiguration, recognizersTextDateTime_93 as FrenchDatePeriodExtractorConfiguration, recognizersTextDateTime_94 as FrenchDatePeriodParserConfiguration, recognizersTextDateTime_95 as FrenchTimePeriodExtractorConfiguration, recognizersTextDateTime_96 as FrenchTimePeriodParserConfiguration, recognizersTextDateTime_97 as FrenchDateTimeExtractorConfiguration, recognizersTextDateTime_98 as FrenchDateTimeParserConfiguration, recognizersTextDateTime_99 as FrenchDateTimePeriodExtractorConfiguration, recognizersTextDateTime_100 as FrenchDateTimePeriodParserConfiguration, recognizersTextDateTime_101 as FrenchSetExtractorConfiguration, recognizersTextDateTime_102 as FrenchSetParserConfiguration, recognizersTextDateTime_103 as FrenchDurationExtractorConfiguration, recognizersTextDateTime_104 as FrenchDurationParserConfiguration, recognizersTextDateTime_105 as FrenchHolidayExtractorConfiguration, recognizersTextDateTime_106 as FrenchHolidayParserConfiguration, recognizersTextDateTime_107 as FrenchMergedExtractorConfiguration, recognizersTextDateTime_108 as FrenchMergedParserConfiguration, recognizersTextDateTime_109 as FrenchTimeParser, recognizersTextDateTime_110 as ChineseDurationExtractor, recognizersTextDateTime_111 as ChineseDurationParser, recognizersTextDateTime_112 as ChineseTimeExtractor, recognizersTextDateTime_113 as ChineseTimeParser, recognizersTextDateTime_114 as ChineseTimePeriodExtractor, recognizersTextDateTime_115 as ChineseTimePeriodParser, recognizersTextDateTime_116 as ChineseDateExtractor, recognizersTextDateTime_117 as ChineseDateParser, recognizersTextDateTime_118 as ChineseDatePeriodExtractor, recognizersTextDateTime_119 as ChineseDatePeriodParser, recognizersTextDateTime_120 as ChineseDateTimeExtractor, recognizersTextDateTime_121 as ChineseDateTimeParser, recognizersTextDateTime_122 as ChineseDateTimePeriodExtractor, recognizersTextDateTime_123 as ChineseDateTimePeriodParser, recognizersTextDateTime_124 as ChineseSetExtractor, recognizersTextDateTime_125 as ChineseSetParser, recognizersTextDateTime_126 as ChineseHolidayExtractorConfiguration, recognizersTextDateTime_127 as ChineseHolidayParser, recognizersTextDateTime_128 as ChineseMergedExtractor, recognizersTextDateTime_129 as ChineseMergedParser, recognizersTextDateTime_130 as ChineseFullMergedParser, recognizersTextDateTime_131 as BaseDateTime, recognizersTextDateTime_132 as EnglishDateTime, recognizersTextDateTime_133 as SpanishDateTime, recognizersTextDateTime_134 as FrenchDateTime, recognizersTextDateTime_135 as ChineseDateTime }; +export default recognizersTextDateTime$1; +//# sourceMappingURL=recognizers-text-date-time.es5.js.map diff --git a/libraries/botbuilder-stdlib/vendors/@microsoft/recognizers-text-date-time/dist/recognizers-text-date-time.umd.js b/libraries/botbuilder-stdlib/vendors/@microsoft/recognizers-text-date-time/dist/recognizers-text-date-time.umd.js new file mode 100644 index 0000000000..b97af778c9 --- /dev/null +++ b/libraries/botbuilder-stdlib/vendors/@microsoft/recognizers-text-date-time/dist/recognizers-text-date-time.umd.js @@ -0,0 +1,35268 @@ +(function (global, factory) { + typeof exports === 'object' && typeof module !== 'undefined' ? factory(exports) : + typeof define === 'function' && define.amd ? define(['exports'], factory) : + (factory((global.microsoftRecognizersTextDateTime = {}))); +}(this, (function (exports) { 'use strict'; + +var commonjsGlobal = typeof window !== 'undefined' ? window : typeof global !== 'undefined' ? global : typeof self !== 'undefined' ? self : {}; + + + +function unwrapExports (x) { + return x && x.__esModule && Object.prototype.hasOwnProperty.call(x, 'default') ? x['default'] : x; +} + +function createCommonjsModule(fn, module) { + return module = { exports: {} }, fn(module, module.exports), module.exports; +} + +var culture = createCommonjsModule(function (module, exports) { +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +class Culture { + constructor(cultureName, cultureCode) { + this.cultureName = cultureName; + this.cultureCode = cultureCode; + } + static getSupportedCultureCodes() { + return Culture.supportedCultures.map(c => c.cultureCode); + } + static mapToNearestLanguage(cultureCode) { + if (cultureCode !== undefined) { + cultureCode = cultureCode.toLowerCase(); + var supportedCultureCodes = Culture.getSupportedCultureCodes(); + if (supportedCultureCodes.indexOf(cultureCode) < 0) { + var culturePrefix = cultureCode.split('-')[0].trim(); + supportedCultureCodes.forEach(function (supportedCultureCode) { + if (supportedCultureCode.startsWith(culturePrefix)) { + cultureCode = supportedCultureCode; + } + }); + } + } + return cultureCode; + } +} +Culture.English = "en-us"; +Culture.Chinese = "zh-cn"; +Culture.Spanish = "es-es"; +Culture.Portuguese = "pt-br"; +Culture.French = "fr-fr"; +Culture.German = "de-de"; +Culture.Japanese = "ja-jp"; +Culture.Dutch = "nl-nl"; +Culture.Italian = "it-it"; +Culture.supportedCultures = [ + new Culture("English", Culture.English), + new Culture("Chinese", Culture.Chinese), + new Culture("Spanish", Culture.Spanish), + new Culture("Portuguese", Culture.Portuguese), + new Culture("French", Culture.French), + new Culture("German", Culture.German), + new Culture("Japanese", Culture.Japanese), + new Culture("Dutch", Culture.Dutch), + new Culture("Italian", Culture.Italian) +]; +exports.Culture = Culture; +class CultureInfo { + static getCultureInfo(cultureCode) { + return new CultureInfo(cultureCode); + } + constructor(cultureName) { + this.code = cultureName; + } +} +exports.CultureInfo = CultureInfo; + +}); + +unwrapExports(culture); + +var xregexp = createCommonjsModule(function (module, exports) { +"use strict"; + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.default = void 0; + +function _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _nonIterableRest(); } + +function _nonIterableRest() { throw new TypeError("Invalid attempt to destructure non-iterable instance"); } + +function _iterableToArrayLimit(arr, i) { var _arr = []; var _n = true; var _d = false; var _e = undefined; try { for (var _i = arr[Symbol.iterator](), _s; !(_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; } + +function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; } + +/*! + * XRegExp 4.2.0 + * + * Steven Levithan (c) 2007-present MIT License + */ + +/** + * XRegExp provides augmented, extensible regular expressions. You get additional regex syntax and + * flags, beyond what browsers support natively. XRegExp is also a regex utility belt with tools to + * make your client-side grepping simpler and more powerful, while freeing you from related + * cross-browser inconsistencies. + */ +// ==--------------------------== +// Private stuff +// ==--------------------------== +// Property name used for extended regex instance data +var REGEX_DATA = 'xregexp'; // Optional features that can be installed and uninstalled + +var features = { + astral: false, + namespacing: false +}; // Native methods to use and restore ('native' is an ES3 reserved keyword) + +var nativ = { + exec: RegExp.prototype.exec, + test: RegExp.prototype.test, + match: String.prototype.match, + replace: String.prototype.replace, + split: String.prototype.split +}; // Storage for fixed/extended native methods + +var fixed = {}; // Storage for regexes cached by `XRegExp.cache` + +var regexCache = {}; // Storage for pattern details cached by the `XRegExp` constructor + +var patternCache = {}; // Storage for regex syntax tokens added internally or by `XRegExp.addToken` + +var tokens = []; // Token scopes + +var defaultScope = 'default'; +var classScope = 'class'; // Regexes that match native regex syntax, including octals + +var nativeTokens = { + // Any native multicharacter token in default scope, or any single character + 'default': /\\(?:0(?:[0-3][0-7]{0,2}|[4-7][0-7]?)?|[1-9]\d*|x[\dA-Fa-f]{2}|u(?:[\dA-Fa-f]{4}|{[\dA-Fa-f]+})|c[A-Za-z]|[\s\S])|\(\?(?:[:=!]|<[=!])|[?*+]\?|{\d+(?:,\d*)?}\??|[\s\S]/, + // Any native multicharacter token in character class scope, or any single character + 'class': /\\(?:[0-3][0-7]{0,2}|[4-7][0-7]?|x[\dA-Fa-f]{2}|u(?:[\dA-Fa-f]{4}|{[\dA-Fa-f]+})|c[A-Za-z]|[\s\S])|[\s\S]/ +}; // Any backreference or dollar-prefixed character in replacement strings + +var replacementToken = /\$(?:{([\w$]+)}|<([\w$]+)>|(\d\d?|[\s\S]))/g; // Check for correct `exec` handling of nonparticipating capturing groups + +var correctExecNpcg = nativ.exec.call(/()??/, '')[1] === undefined; // Check for ES6 `flags` prop support + +var hasFlagsProp = /x/.flags !== undefined; // Shortcut to `Object.prototype.toString` + +var _ref = {}, + toString = _ref.toString; + +function hasNativeFlag(flag) { + // Can't check based on the presence of properties/getters since browsers might support such + // properties even when they don't support the corresponding flag in regex construction (tested + // in Chrome 48, where `'unicode' in /x/` is true but trying to construct a regex with flag `u` + // throws an error) + var isSupported = true; + + try { + // Can't use regex literals for testing even in a `try` because regex literals with + // unsupported flags cause a compilation error in IE + new RegExp('', flag); + } catch (exception) { + isSupported = false; + } + + return isSupported; +} // Check for ES6 `u` flag support + + +var hasNativeU = hasNativeFlag('u'); // Check for ES6 `y` flag support + +var hasNativeY = hasNativeFlag('y'); // Tracker for known flags, including addon flags + +var registeredFlags = { + g: true, + i: true, + m: true, + u: hasNativeU, + y: hasNativeY +}; +/** + * Attaches extended data and `XRegExp.prototype` properties to a regex object. + * + * @private + * @param {RegExp} regex Regex to augment. + * @param {Array} captureNames Array with capture names, or `null`. + * @param {String} xSource XRegExp pattern used to generate `regex`, or `null` if N/A. + * @param {String} xFlags XRegExp flags used to generate `regex`, or `null` if N/A. + * @param {Boolean} [isInternalOnly=false] Whether the regex will be used only for internal + * operations, and never exposed to users. For internal-only regexes, we can improve perf by + * skipping some operations like attaching `XRegExp.prototype` properties. + * @returns {RegExp} Augmented regex. + */ + +function augment(regex, captureNames, xSource, xFlags, isInternalOnly) { + regex[REGEX_DATA] = { + captureNames: captureNames + }; + + if (isInternalOnly) { + return regex; + } // Can't auto-inherit these since the XRegExp constructor returns a nonprimitive value + + + if (regex.__proto__) { + regex.__proto__ = XRegExp.prototype; + } else { + for (var p in XRegExp.prototype) { + // An `XRegExp.prototype.hasOwnProperty(p)` check wouldn't be worth it here, since this + // is performance sensitive, and enumerable `Object.prototype` or `RegExp.prototype` + // extensions exist on `regex.prototype` anyway + regex[p] = XRegExp.prototype[p]; + } + } + + regex[REGEX_DATA].source = xSource; // Emulate the ES6 `flags` prop by ensuring flags are in alphabetical order + + regex[REGEX_DATA].flags = xFlags ? xFlags.split('').sort().join('') : xFlags; + return regex; +} +/** + * Removes any duplicate characters from the provided string. + * + * @private + * @param {String} str String to remove duplicate characters from. + * @returns {String} String with any duplicate characters removed. + */ + + +function clipDuplicates(str) { + return nativ.replace.call(str, /([\s\S])(?=[\s\S]*\1)/g, ''); +} +/** + * Copies a regex object while preserving extended data and augmenting with `XRegExp.prototype` + * properties. The copy has a fresh `lastIndex` property (set to zero). Allows adding and removing + * flags g and y while copying the regex. + * + * @private + * @param {RegExp} regex Regex to copy. + * @param {Object} [options] Options object with optional properties: + * - `addG` {Boolean} Add flag g while copying the regex. + * - `addY` {Boolean} Add flag y while copying the regex. + * - `removeG` {Boolean} Remove flag g while copying the regex. + * - `removeY` {Boolean} Remove flag y while copying the regex. + * - `isInternalOnly` {Boolean} Whether the copied regex will be used only for internal + * operations, and never exposed to users. For internal-only regexes, we can improve perf by + * skipping some operations like attaching `XRegExp.prototype` properties. + * - `source` {String} Overrides `.source`, for special cases. + * @returns {RegExp} Copy of the provided regex, possibly with modified flags. + */ + + +function copyRegex(regex, options) { + if (!XRegExp.isRegExp(regex)) { + throw new TypeError('Type RegExp expected'); + } + + var xData = regex[REGEX_DATA] || {}; + var flags = getNativeFlags(regex); + var flagsToAdd = ''; + var flagsToRemove = ''; + var xregexpSource = null; + var xregexpFlags = null; + options = options || {}; + + if (options.removeG) { + flagsToRemove += 'g'; + } + + if (options.removeY) { + flagsToRemove += 'y'; + } + + if (flagsToRemove) { + flags = nativ.replace.call(flags, new RegExp("[".concat(flagsToRemove, "]+"), 'g'), ''); + } + + if (options.addG) { + flagsToAdd += 'g'; + } + + if (options.addY) { + flagsToAdd += 'y'; + } + + if (flagsToAdd) { + flags = clipDuplicates(flags + flagsToAdd); + } + + if (!options.isInternalOnly) { + if (xData.source !== undefined) { + xregexpSource = xData.source; + } // null or undefined; don't want to add to `flags` if the previous value was null, since + // that indicates we're not tracking original precompilation flags + + + if (xData.flags != null) { + // Flags are only added for non-internal regexes by `XRegExp.globalize`. Flags are never + // removed for non-internal regexes, so don't need to handle it + xregexpFlags = flagsToAdd ? clipDuplicates(xData.flags + flagsToAdd) : xData.flags; + } + } // Augment with `XRegExp.prototype` properties, but use the native `RegExp` constructor to avoid + // searching for special tokens. That would be wrong for regexes constructed by `RegExp`, and + // unnecessary for regexes constructed by `XRegExp` because the regex has already undergone the + // translation to native regex syntax + + + regex = augment(new RegExp(options.source || regex.source, flags), hasNamedCapture(regex) ? xData.captureNames.slice(0) : null, xregexpSource, xregexpFlags, options.isInternalOnly); + return regex; +} +/** + * Converts hexadecimal to decimal. + * + * @private + * @param {String} hex + * @returns {Number} + */ + + +function dec(hex) { + return parseInt(hex, 16); +} +/** + * Returns a pattern that can be used in a native RegExp in place of an ignorable token such as an + * inline comment or whitespace with flag x. This is used directly as a token handler function + * passed to `XRegExp.addToken`. + * + * @private + * @param {String} match Match arg of `XRegExp.addToken` handler + * @param {String} scope Scope arg of `XRegExp.addToken` handler + * @param {String} flags Flags arg of `XRegExp.addToken` handler + * @returns {String} Either '' or '(?:)', depending on which is needed in the context of the match. + */ + + +function getContextualTokenSeparator(match, scope, flags) { + if ( // No need to separate tokens if at the beginning or end of a group + match.input[match.index - 1] === '(' || match.input[match.index + match[0].length] === ')' || // No need to separate tokens if before or after a `|` + match.input[match.index - 1] === '|' || match.input[match.index + match[0].length] === '|' || // No need to separate tokens if at the beginning or end of the pattern + match.index < 1 || match.index + match[0].length >= match.input.length || // No need to separate tokens if at the beginning of a noncapturing group or lookahead. + // The way this is written relies on: + // - The search regex matching only 3-char strings. + // - Although `substr` gives chars from the end of the string if given a negative index, + // the resulting substring will be too short to match. Ex: `'abcd'.substr(-1, 3) === 'd'` + nativ.test.call(/^\(\?[:=!]/, match.input.substr(match.index - 3, 3)) || // Avoid separating tokens when the following token is a quantifier + isQuantifierNext(match.input, match.index + match[0].length, flags)) { + return ''; + } // Keep tokens separated. This avoids e.g. inadvertedly changing `\1 1` or `\1(?#)1` to `\11`. + // This also ensures all tokens remain as discrete atoms, e.g. it avoids converting the syntax + // error `(? :` into `(?:`. + + + return '(?:)'; +} +/** + * Returns native `RegExp` flags used by a regex object. + * + * @private + * @param {RegExp} regex Regex to check. + * @returns {String} Native flags in use. + */ + + +function getNativeFlags(regex) { + return hasFlagsProp ? regex.flags : // Explicitly using `RegExp.prototype.toString` (rather than e.g. `String` or concatenation + // with an empty string) allows this to continue working predictably when + // `XRegExp.proptotype.toString` is overridden + nativ.exec.call(/\/([a-z]*)$/i, RegExp.prototype.toString.call(regex))[1]; +} +/** + * Determines whether a regex has extended instance data used to track capture names. + * + * @private + * @param {RegExp} regex Regex to check. + * @returns {Boolean} Whether the regex uses named capture. + */ + + +function hasNamedCapture(regex) { + return !!(regex[REGEX_DATA] && regex[REGEX_DATA].captureNames); +} +/** + * Converts decimal to hexadecimal. + * + * @private + * @param {Number|String} dec + * @returns {String} + */ + + +function hex(dec) { + return parseInt(dec, 10).toString(16); +} +/** + * Checks whether the next nonignorable token after the specified position is a quantifier. + * + * @private + * @param {String} pattern Pattern to search within. + * @param {Number} pos Index in `pattern` to search at. + * @param {String} flags Flags used by the pattern. + * @returns {Boolean} Whether the next nonignorable token is a quantifier. + */ + + +function isQuantifierNext(pattern, pos, flags) { + return nativ.test.call(flags.indexOf('x') !== -1 ? // Ignore any leading whitespace, line comments, and inline comments + /^(?:\s|#[^#\n]*|\(\?#[^)]*\))*(?:[?*+]|{\d+(?:,\d*)?})/ : // Ignore any leading inline comments + /^(?:\(\?#[^)]*\))*(?:[?*+]|{\d+(?:,\d*)?})/, pattern.slice(pos)); +} +/** + * Determines whether a value is of the specified type, by resolving its internal [[Class]]. + * + * @private + * @param {*} value Object to check. + * @param {String} type Type to check for, in TitleCase. + * @returns {Boolean} Whether the object matches the type. + */ + + +function isType(value, type) { + return toString.call(value) === "[object ".concat(type, "]"); +} +/** + * Adds leading zeros if shorter than four characters. Used for fixed-length hexadecimal values. + * + * @private + * @param {String} str + * @returns {String} + */ + + +function pad4(str) { + while (str.length < 4) { + str = "0".concat(str); + } + + return str; +} +/** + * Checks for flag-related errors, and strips/applies flags in a leading mode modifier. Offloads + * the flag preparation logic from the `XRegExp` constructor. + * + * @private + * @param {String} pattern Regex pattern, possibly with a leading mode modifier. + * @param {String} flags Any combination of flags. + * @returns {Object} Object with properties `pattern` and `flags`. + */ + + +function prepareFlags(pattern, flags) { + // Recent browsers throw on duplicate flags, so copy this behavior for nonnative flags + if (clipDuplicates(flags) !== flags) { + throw new SyntaxError("Invalid duplicate regex flag ".concat(flags)); + } // Strip and apply a leading mode modifier with any combination of flags except g or y + + + pattern = nativ.replace.call(pattern, /^\(\?([\w$]+)\)/, function ($0, $1) { + if (nativ.test.call(/[gy]/, $1)) { + throw new SyntaxError("Cannot use flag g or y in mode modifier ".concat($0)); + } // Allow duplicate flags within the mode modifier + + + flags = clipDuplicates(flags + $1); + return ''; + }); // Throw on unknown native or nonnative flags + + var _iteratorNormalCompletion = true; + var _didIteratorError = false; + var _iteratorError = undefined; + + try { + for (var _iterator = flags[Symbol.iterator](), _step; !(_iteratorNormalCompletion = (_step = _iterator.next()).done); _iteratorNormalCompletion = true) { + var flag = _step.value; + + if (!registeredFlags[flag]) { + throw new SyntaxError("Unknown regex flag ".concat(flag)); + } + } + } catch (err) { + _didIteratorError = true; + _iteratorError = err; + } finally { + try { + if (!_iteratorNormalCompletion && _iterator.return != null) { + _iterator.return(); + } + } finally { + if (_didIteratorError) { + throw _iteratorError; + } + } + } + + return { + pattern: pattern, + flags: flags + }; +} +/** + * Prepares an options object from the given value. + * + * @private + * @param {String|Object} value Value to convert to an options object. + * @returns {Object} Options object. + */ + + +function prepareOptions(value) { + var options = {}; + + if (isType(value, 'String')) { + XRegExp.forEach(value, /[^\s,]+/, function (match) { + options[match] = true; + }); + return options; + } + + return value; +} +/** + * Registers a flag so it doesn't throw an 'unknown flag' error. + * + * @private + * @param {String} flag Single-character flag to register. + */ + + +function registerFlag(flag) { + if (!/^[\w$]$/.test(flag)) { + throw new Error('Flag must be a single character A-Za-z0-9_$'); + } + + registeredFlags[flag] = true; +} +/** + * Runs built-in and custom regex syntax tokens in reverse insertion order at the specified + * position, until a match is found. + * + * @private + * @param {String} pattern Original pattern from which an XRegExp object is being built. + * @param {String} flags Flags being used to construct the regex. + * @param {Number} pos Position to search for tokens within `pattern`. + * @param {Number} scope Regex scope to apply: 'default' or 'class'. + * @param {Object} context Context object to use for token handler functions. + * @returns {Object} Object with properties `matchLength`, `output`, and `reparse`; or `null`. + */ + + +function runTokens(pattern, flags, pos, scope, context) { + var i = tokens.length; + var leadChar = pattern[pos]; + var result = null; + var match; + var t; // Run in reverse insertion order + + while (i--) { + t = tokens[i]; + + if (t.leadChar && t.leadChar !== leadChar || t.scope !== scope && t.scope !== 'all' || t.flag && !(flags.indexOf(t.flag) !== -1)) { + continue; + } + + match = XRegExp.exec(pattern, t.regex, pos, 'sticky'); + + if (match) { + result = { + matchLength: match[0].length, + output: t.handler.call(context, match, scope, flags), + reparse: t.reparse + }; // Finished with token tests + + break; + } + } + + return result; +} +/** + * Enables or disables implicit astral mode opt-in. When enabled, flag A is automatically added to + * all new regexes created by XRegExp. This causes an error to be thrown when creating regexes if + * the Unicode Base addon is not available, since flag A is registered by that addon. + * + * @private + * @param {Boolean} on `true` to enable; `false` to disable. + */ + + +function setAstral(on) { + features.astral = on; +} +/** + * Adds named capture groups to the `groups` property of match arrays. See here for details: + * https://github.com/tc39/proposal-regexp-named-groups + * + * @private + * @param {Boolean} on `true` to enable; `false` to disable. + */ + + +function setNamespacing(on) { + features.namespacing = on; +} +/** + * Returns the object, or throws an error if it is `null` or `undefined`. This is used to follow + * the ES5 abstract operation `ToObject`. + * + * @private + * @param {*} value Object to check and return. + * @returns {*} The provided object. + */ + + +function toObject(value) { + // null or undefined + if (value == null) { + throw new TypeError('Cannot convert null or undefined to object'); + } + + return value; +} // ==--------------------------== +// Constructor +// ==--------------------------== + +/** + * Creates an extended regular expression object for matching text with a pattern. Differs from a + * native regular expression in that additional syntax and flags are supported. The returned object + * is in fact a native `RegExp` and works with all native methods. + * + * @class XRegExp + * @constructor + * @param {String|RegExp} pattern Regex pattern string, or an existing regex object to copy. + * @param {String} [flags] Any combination of flags. + * Native flags: + * - `g` - global + * - `i` - ignore case + * - `m` - multiline anchors + * - `u` - unicode (ES6) + * - `y` - sticky (Firefox 3+, ES6) + * Additional XRegExp flags: + * - `n` - explicit capture + * - `s` - dot matches all (aka singleline) + * - `x` - free-spacing and line comments (aka extended) + * - `A` - astral (requires the Unicode Base addon) + * Flags cannot be provided when constructing one `RegExp` from another. + * @returns {RegExp} Extended regular expression object. + * @example + * + * // With named capture and flag x + * XRegExp(`(? [0-9]{4} ) -? # year + * (? [0-9]{2} ) -? # month + * (? [0-9]{2} ) # day`, 'x'); + * + * // Providing a regex object copies it. Native regexes are recompiled using native (not XRegExp) + * // syntax. Copies maintain extended data, are augmented with `XRegExp.prototype` properties, and + * // have fresh `lastIndex` properties (set to zero). + * XRegExp(/regex/); + */ + + +function XRegExp(pattern, flags) { + if (XRegExp.isRegExp(pattern)) { + if (flags !== undefined) { + throw new TypeError('Cannot supply flags when copying a RegExp'); + } + + return copyRegex(pattern); + } // Copy the argument behavior of `RegExp` + + + pattern = pattern === undefined ? '' : String(pattern); + flags = flags === undefined ? '' : String(flags); + + if (XRegExp.isInstalled('astral') && !(flags.indexOf('A') !== -1)) { + // This causes an error to be thrown if the Unicode Base addon is not available + flags += 'A'; + } + + if (!patternCache[pattern]) { + patternCache[pattern] = {}; + } + + if (!patternCache[pattern][flags]) { + var context = { + hasNamedCapture: false, + captureNames: [] + }; + var scope = defaultScope; + var output = ''; + var pos = 0; + var result; // Check for flag-related errors, and strip/apply flags in a leading mode modifier + + var applied = prepareFlags(pattern, flags); + var appliedPattern = applied.pattern; + var appliedFlags = applied.flags; // Use XRegExp's tokens to translate the pattern to a native regex pattern. + // `appliedPattern.length` may change on each iteration if tokens use `reparse` + + while (pos < appliedPattern.length) { + do { + // Check for custom tokens at the current position + result = runTokens(appliedPattern, appliedFlags, pos, scope, context); // If the matched token used the `reparse` option, splice its output into the + // pattern before running tokens again at the same position + + if (result && result.reparse) { + appliedPattern = appliedPattern.slice(0, pos) + result.output + appliedPattern.slice(pos + result.matchLength); + } + } while (result && result.reparse); + + if (result) { + output += result.output; + pos += result.matchLength || 1; + } else { + // Get the native token at the current position + var _XRegExp$exec = XRegExp.exec(appliedPattern, nativeTokens[scope], pos, 'sticky'), + _XRegExp$exec2 = _slicedToArray(_XRegExp$exec, 1), + token = _XRegExp$exec2[0]; + + output += token; + pos += token.length; + + if (token === '[' && scope === defaultScope) { + scope = classScope; + } else if (token === ']' && scope === classScope) { + scope = defaultScope; + } + } + } + + patternCache[pattern][flags] = { + // Use basic cleanup to collapse repeated empty groups like `(?:)(?:)` to `(?:)`. Empty + // groups are sometimes inserted during regex transpilation in order to keep tokens + // separated. However, more than one empty group in a row is never needed. + pattern: nativ.replace.call(output, /(?:\(\?:\))+/g, '(?:)'), + // Strip all but native flags + flags: nativ.replace.call(appliedFlags, /[^gimuy]+/g, ''), + // `context.captureNames` has an item for each capturing group, even if unnamed + captures: context.hasNamedCapture ? context.captureNames : null + }; + } + + var generated = patternCache[pattern][flags]; + return augment(new RegExp(generated.pattern, generated.flags), generated.captures, pattern, flags); +} // Add `RegExp.prototype` to the prototype chain + + +XRegExp.prototype = /(?:)/; // ==--------------------------== +// Public properties +// ==--------------------------== + +/** + * The XRegExp version number as a string containing three dot-separated parts. For example, + * '2.0.0-beta-3'. + * + * @static + * @memberOf XRegExp + * @type String + */ + +XRegExp.version = '4.2.0'; // ==--------------------------== +// Public methods +// ==--------------------------== +// Intentionally undocumented; used in tests and addons + +XRegExp._clipDuplicates = clipDuplicates; +XRegExp._hasNativeFlag = hasNativeFlag; +XRegExp._dec = dec; +XRegExp._hex = hex; +XRegExp._pad4 = pad4; +/** + * Extends XRegExp syntax and allows custom flags. This is used internally and can be used to + * create XRegExp addons. If more than one token can match the same string, the last added wins. + * + * @memberOf XRegExp + * @param {RegExp} regex Regex object that matches the new token. + * @param {Function} handler Function that returns a new pattern string (using native regex syntax) + * to replace the matched token within all future XRegExp regexes. Has access to persistent + * properties of the regex being built, through `this`. Invoked with three arguments: + * - The match array, with named backreference properties. + * - The regex scope where the match was found: 'default' or 'class'. + * - The flags used by the regex, including any flags in a leading mode modifier. + * The handler function becomes part of the XRegExp construction process, so be careful not to + * construct XRegExps within the function or you will trigger infinite recursion. + * @param {Object} [options] Options object with optional properties: + * - `scope` {String} Scope where the token applies: 'default', 'class', or 'all'. + * - `flag` {String} Single-character flag that triggers the token. This also registers the + * flag, which prevents XRegExp from throwing an 'unknown flag' error when the flag is used. + * - `optionalFlags` {String} Any custom flags checked for within the token `handler` that are + * not required to trigger the token. This registers the flags, to prevent XRegExp from + * throwing an 'unknown flag' error when any of the flags are used. + * - `reparse` {Boolean} Whether the `handler` function's output should not be treated as + * final, and instead be reparseable by other tokens (including the current token). Allows + * token chaining or deferring. + * - `leadChar` {String} Single character that occurs at the beginning of any successful match + * of the token (not always applicable). This doesn't change the behavior of the token unless + * you provide an erroneous value. However, providing it can increase the token's performance + * since the token can be skipped at any positions where this character doesn't appear. + * @example + * + * // Basic usage: Add \a for the ALERT control code + * XRegExp.addToken( + * /\\a/, + * () => '\\x07', + * {scope: 'all'} + * ); + * XRegExp('\\a[\\a-\\n]+').test('\x07\n\x07'); // -> true + * + * // Add the U (ungreedy) flag from PCRE and RE2, which reverses greedy and lazy quantifiers. + * // Since `scope` is not specified, it uses 'default' (i.e., transformations apply outside of + * // character classes only) + * XRegExp.addToken( + * /([?*+]|{\d+(?:,\d*)?})(\??)/, + * (match) => `${match[1]}${match[2] ? '' : '?'}`, + * {flag: 'U'} + * ); + * XRegExp('a+', 'U').exec('aaa')[0]; // -> 'a' + * XRegExp('a+?', 'U').exec('aaa')[0]; // -> 'aaa' + */ + +XRegExp.addToken = function (regex, handler, options) { + options = options || {}; + var _options = options, + optionalFlags = _options.optionalFlags; + + if (options.flag) { + registerFlag(options.flag); + } + + if (optionalFlags) { + optionalFlags = nativ.split.call(optionalFlags, ''); + var _iteratorNormalCompletion2 = true; + var _didIteratorError2 = false; + var _iteratorError2 = undefined; + + try { + for (var _iterator2 = optionalFlags[Symbol.iterator](), _step2; !(_iteratorNormalCompletion2 = (_step2 = _iterator2.next()).done); _iteratorNormalCompletion2 = true) { + var flag = _step2.value; + registerFlag(flag); + } + } catch (err) { + _didIteratorError2 = true; + _iteratorError2 = err; + } finally { + try { + if (!_iteratorNormalCompletion2 && _iterator2.return != null) { + _iterator2.return(); + } + } finally { + if (_didIteratorError2) { + throw _iteratorError2; + } + } + } + } // Add to the private list of syntax tokens + + + tokens.push({ + regex: copyRegex(regex, { + addG: true, + addY: hasNativeY, + isInternalOnly: true + }), + handler: handler, + scope: options.scope || defaultScope, + flag: options.flag, + reparse: options.reparse, + leadChar: options.leadChar + }); // Reset the pattern cache used by the `XRegExp` constructor, since the same pattern and flags + // might now produce different results + + XRegExp.cache.flush('patterns'); +}; +/** + * Caches and returns the result of calling `XRegExp(pattern, flags)`. On any subsequent call with + * the same pattern and flag combination, the cached copy of the regex is returned. + * + * @memberOf XRegExp + * @param {String} pattern Regex pattern string. + * @param {String} [flags] Any combination of XRegExp flags. + * @returns {RegExp} Cached XRegExp object. + * @example + * + * while (match = XRegExp.cache('.', 'gs').exec(str)) { + * // The regex is compiled once only + * } + */ + + +XRegExp.cache = function (pattern, flags) { + if (!regexCache[pattern]) { + regexCache[pattern] = {}; + } + + return regexCache[pattern][flags] || (regexCache[pattern][flags] = XRegExp(pattern, flags)); +}; // Intentionally undocumented; used in tests + + +XRegExp.cache.flush = function (cacheName) { + if (cacheName === 'patterns') { + // Flush the pattern cache used by the `XRegExp` constructor + patternCache = {}; + } else { + // Flush the regex cache populated by `XRegExp.cache` + regexCache = {}; + } +}; +/** + * Escapes any regular expression metacharacters, for use when matching literal strings. The result + * can safely be used at any point within a regex that uses any flags. + * + * @memberOf XRegExp + * @param {String} str String to escape. + * @returns {String} String with regex metacharacters escaped. + * @example + * + * XRegExp.escape('Escaped? <.>'); + * // -> 'Escaped\?\ <\.>' + */ + + +XRegExp.escape = function (str) { + return nativ.replace.call(toObject(str), /[-\[\]{}()*+?.,\\^$|#\s]/g, '\\$&'); +}; +/** + * Executes a regex search in a specified string. Returns a match array or `null`. If the provided + * regex uses named capture, named backreference properties are included on the match array. + * Optional `pos` and `sticky` arguments specify the search start position, and whether the match + * must start at the specified position only. The `lastIndex` property of the provided regex is not + * used, but is updated for compatibility. Also fixes browser bugs compared to the native + * `RegExp.prototype.exec` and can be used reliably cross-browser. + * + * @memberOf XRegExp + * @param {String} str String to search. + * @param {RegExp} regex Regex to search with. + * @param {Number} [pos=0] Zero-based index at which to start the search. + * @param {Boolean|String} [sticky=false] Whether the match must start at the specified position + * only. The string `'sticky'` is accepted as an alternative to `true`. + * @returns {Array} Match array with named backreference properties, or `null`. + * @example + * + * // Basic use, with named backreference + * let match = XRegExp.exec('U+2620', XRegExp('U\\+(?[0-9A-F]{4})')); + * match.hex; // -> '2620' + * + * // With pos and sticky, in a loop + * let pos = 2, result = [], match; + * while (match = XRegExp.exec('<1><2><3><4>5<6>', /<(\d)>/, pos, 'sticky')) { + * result.push(match[1]); + * pos = match.index + match[0].length; + * } + * // result -> ['2', '3', '4'] + */ + + +XRegExp.exec = function (str, regex, pos, sticky) { + var cacheKey = 'g'; + var addY = false; + var fakeY = false; + var match; + addY = hasNativeY && !!(sticky || regex.sticky && sticky !== false); + + if (addY) { + cacheKey += 'y'; + } else if (sticky) { + // Simulate sticky matching by appending an empty capture to the original regex. The + // resulting regex will succeed no matter what at the current index (set with `lastIndex`), + // and will not search the rest of the subject string. We'll know that the original regex + // has failed if that last capture is `''` rather than `undefined` (i.e., if that last + // capture participated in the match). + fakeY = true; + cacheKey += 'FakeY'; + } + + regex[REGEX_DATA] = regex[REGEX_DATA] || {}; // Shares cached copies with `XRegExp.match`/`replace` + + var r2 = regex[REGEX_DATA][cacheKey] || (regex[REGEX_DATA][cacheKey] = copyRegex(regex, { + addG: true, + addY: addY, + source: fakeY ? "".concat(regex.source, "|()") : undefined, + removeY: sticky === false, + isInternalOnly: true + })); + pos = pos || 0; + r2.lastIndex = pos; // Fixed `exec` required for `lastIndex` fix, named backreferences, etc. + + match = fixed.exec.call(r2, str); // Get rid of the capture added by the pseudo-sticky matcher if needed. An empty string means + // the original regexp failed (see above). + + if (fakeY && match && match.pop() === '') { + match = null; + } + + if (regex.global) { + regex.lastIndex = match ? r2.lastIndex : 0; + } + + return match; +}; +/** + * Executes a provided function once per regex match. Searches always start at the beginning of the + * string and continue until the end, regardless of the state of the regex's `global` property and + * initial `lastIndex`. + * + * @memberOf XRegExp + * @param {String} str String to search. + * @param {RegExp} regex Regex to search with. + * @param {Function} callback Function to execute for each match. Invoked with four arguments: + * - The match array, with named backreference properties. + * - The zero-based match index. + * - The string being traversed. + * - The regex object being used to traverse the string. + * @example + * + * // Extracts every other digit from a string + * const evens = []; + * XRegExp.forEach('1a2345', /\d/, (match, i) => { + * if (i % 2) evens.push(+match[0]); + * }); + * // evens -> [2, 4] + */ + + +XRegExp.forEach = function (str, regex, callback) { + var pos = 0; + var i = -1; + var match; + + while (match = XRegExp.exec(str, regex, pos)) { + // Because `regex` is provided to `callback`, the function could use the deprecated/ + // nonstandard `RegExp.prototype.compile` to mutate the regex. However, since `XRegExp.exec` + // doesn't use `lastIndex` to set the search position, this can't lead to an infinite loop, + // at least. Actually, because of the way `XRegExp.exec` caches globalized versions of + // regexes, mutating the regex will not have any effect on the iteration or matched strings, + // which is a nice side effect that brings extra safety. + callback(match, ++i, str, regex); + pos = match.index + (match[0].length || 1); + } +}; +/** + * Copies a regex object and adds flag `g`. The copy maintains extended data, is augmented with + * `XRegExp.prototype` properties, and has a fresh `lastIndex` property (set to zero). Native + * regexes are not recompiled using XRegExp syntax. + * + * @memberOf XRegExp + * @param {RegExp} regex Regex to globalize. + * @returns {RegExp} Copy of the provided regex with flag `g` added. + * @example + * + * const globalCopy = XRegExp.globalize(/regex/); + * globalCopy.global; // -> true + */ + + +XRegExp.globalize = function (regex) { + return copyRegex(regex, { + addG: true + }); +}; +/** + * Installs optional features according to the specified options. Can be undone using + * `XRegExp.uninstall`. + * + * @memberOf XRegExp + * @param {Object|String} options Options object or string. + * @example + * + * // With an options object + * XRegExp.install({ + * // Enables support for astral code points in Unicode addons (implicitly sets flag A) + * astral: true, + * + * // Adds named capture groups to the `groups` property of matches + * namespacing: true + * }); + * + * // With an options string + * XRegExp.install('astral namespacing'); + */ + + +XRegExp.install = function (options) { + options = prepareOptions(options); + + if (!features.astral && options.astral) { + setAstral(true); + } + + if (!features.namespacing && options.namespacing) { + setNamespacing(true); + } +}; +/** + * Checks whether an individual optional feature is installed. + * + * @memberOf XRegExp + * @param {String} feature Name of the feature to check. One of: + * - `astral` + * - `namespacing` + * @returns {Boolean} Whether the feature is installed. + * @example + * + * XRegExp.isInstalled('astral'); + */ + + +XRegExp.isInstalled = function (feature) { + return !!features[feature]; +}; +/** + * Returns `true` if an object is a regex; `false` if it isn't. This works correctly for regexes + * created in another frame, when `instanceof` and `constructor` checks would fail. + * + * @memberOf XRegExp + * @param {*} value Object to check. + * @returns {Boolean} Whether the object is a `RegExp` object. + * @example + * + * XRegExp.isRegExp('string'); // -> false + * XRegExp.isRegExp(/regex/i); // -> true + * XRegExp.isRegExp(RegExp('^', 'm')); // -> true + * XRegExp.isRegExp(XRegExp('(?s).')); // -> true + */ + + +XRegExp.isRegExp = function (value) { + return toString.call(value) === '[object RegExp]'; +}; // isType(value, 'RegExp'); + +/** + * Returns the first matched string, or in global mode, an array containing all matched strings. + * This is essentially a more convenient re-implementation of `String.prototype.match` that gives + * the result types you actually want (string instead of `exec`-style array in match-first mode, + * and an empty array instead of `null` when no matches are found in match-all mode). It also lets + * you override flag g and ignore `lastIndex`, and fixes browser bugs. + * + * @memberOf XRegExp + * @param {String} str String to search. + * @param {RegExp} regex Regex to search with. + * @param {String} [scope='one'] Use 'one' to return the first match as a string. Use 'all' to + * return an array of all matched strings. If not explicitly specified and `regex` uses flag g, + * `scope` is 'all'. + * @returns {String|Array} In match-first mode: First match as a string, or `null`. In match-all + * mode: Array of all matched strings, or an empty array. + * @example + * + * // Match first + * XRegExp.match('abc', /\w/); // -> 'a' + * XRegExp.match('abc', /\w/g, 'one'); // -> 'a' + * XRegExp.match('abc', /x/g, 'one'); // -> null + * + * // Match all + * XRegExp.match('abc', /\w/g); // -> ['a', 'b', 'c'] + * XRegExp.match('abc', /\w/, 'all'); // -> ['a', 'b', 'c'] + * XRegExp.match('abc', /x/, 'all'); // -> [] + */ + + +XRegExp.match = function (str, regex, scope) { + var global = regex.global && scope !== 'one' || scope === 'all'; + var cacheKey = (global ? 'g' : '') + (regex.sticky ? 'y' : '') || 'noGY'; + regex[REGEX_DATA] = regex[REGEX_DATA] || {}; // Shares cached copies with `XRegExp.exec`/`replace` + + var r2 = regex[REGEX_DATA][cacheKey] || (regex[REGEX_DATA][cacheKey] = copyRegex(regex, { + addG: !!global, + removeG: scope === 'one', + isInternalOnly: true + })); + var result = nativ.match.call(toObject(str), r2); + + if (regex.global) { + regex.lastIndex = scope === 'one' && result ? // Can't use `r2.lastIndex` since `r2` is nonglobal in this case + result.index + result[0].length : 0; + } + + return global ? result || [] : result && result[0]; +}; +/** + * Retrieves the matches from searching a string using a chain of regexes that successively search + * within previous matches. The provided `chain` array can contain regexes and or objects with + * `regex` and `backref` properties. When a backreference is specified, the named or numbered + * backreference is passed forward to the next regex or returned. + * + * @memberOf XRegExp + * @param {String} str String to search. + * @param {Array} chain Regexes that each search for matches within preceding results. + * @returns {Array} Matches by the last regex in the chain, or an empty array. + * @example + * + * // Basic usage; matches numbers within tags + * XRegExp.matchChain('1 2 3 4 a 56', [ + * XRegExp('(?is).*?'), + * /\d+/ + * ]); + * // -> ['2', '4', '56'] + * + * // Passing forward and returning specific backreferences + * html = '
XRegExp\ + * Google'; + * XRegExp.matchChain(html, [ + * {regex: //i, backref: 1}, + * {regex: XRegExp('(?i)^https?://(?[^/?#]+)'), backref: 'domain'} + * ]); + * // -> ['xregexp.com', 'www.google.com'] + */ + + +XRegExp.matchChain = function (str, chain) { + return function recurseChain(values, level) { + var item = chain[level].regex ? chain[level] : { + regex: chain[level] + }; + var matches = []; + + function addMatch(match) { + if (item.backref) { + var ERR_UNDEFINED_GROUP = "Backreference to undefined group: ".concat(item.backref); + var isNamedBackref = isNaN(item.backref); + + if (isNamedBackref && XRegExp.isInstalled('namespacing')) { + // `groups` has `null` as prototype, so using `in` instead of `hasOwnProperty` + if (!(item.backref in match.groups)) { + throw new ReferenceError(ERR_UNDEFINED_GROUP); + } + } else if (!match.hasOwnProperty(item.backref)) { + throw new ReferenceError(ERR_UNDEFINED_GROUP); + } + + var backrefValue = isNamedBackref && XRegExp.isInstalled('namespacing') ? match.groups[item.backref] : match[item.backref]; + matches.push(backrefValue || ''); + } else { + matches.push(match[0]); + } + } + + var _iteratorNormalCompletion3 = true; + var _didIteratorError3 = false; + var _iteratorError3 = undefined; + + try { + for (var _iterator3 = values[Symbol.iterator](), _step3; !(_iteratorNormalCompletion3 = (_step3 = _iterator3.next()).done); _iteratorNormalCompletion3 = true) { + var value = _step3.value; + XRegExp.forEach(value, item.regex, addMatch); + } + } catch (err) { + _didIteratorError3 = true; + _iteratorError3 = err; + } finally { + try { + if (!_iteratorNormalCompletion3 && _iterator3.return != null) { + _iterator3.return(); + } + } finally { + if (_didIteratorError3) { + throw _iteratorError3; + } + } + } + + return level === chain.length - 1 || !matches.length ? matches : recurseChain(matches, level + 1); + }([str], 0); +}; +/** + * Returns a new string with one or all matches of a pattern replaced. The pattern can be a string + * or regex, and the replacement can be a string or a function to be called for each match. To + * perform a global search and replace, use the optional `scope` argument or include flag g if using + * a regex. Replacement strings can use `${n}` or `$` for named and numbered backreferences. + * Replacement functions can use named backreferences via `arguments[0].name`. Also fixes browser + * bugs compared to the native `String.prototype.replace` and can be used reliably cross-browser. + * + * @memberOf XRegExp + * @param {String} str String to search. + * @param {RegExp|String} search Search pattern to be replaced. + * @param {String|Function} replacement Replacement string or a function invoked to create it. + * Replacement strings can include special replacement syntax: + * - $$ - Inserts a literal $ character. + * - $&, $0 - Inserts the matched substring. + * - $` - Inserts the string that precedes the matched substring (left context). + * - $' - Inserts the string that follows the matched substring (right context). + * - $n, $nn - Where n/nn are digits referencing an existent capturing group, inserts + * backreference n/nn. + * - ${n}, $ - Where n is a name or any number of digits that reference an existent capturing + * group, inserts backreference n. + * Replacement functions are invoked with three or more arguments: + * - The matched substring (corresponds to $& above). Named backreferences are accessible as + * properties of this first argument. + * - 0..n arguments, one for each backreference (corresponding to $1, $2, etc. above). + * - The zero-based index of the match within the total search string. + * - The total string being searched. + * @param {String} [scope='one'] Use 'one' to replace the first match only, or 'all'. If not + * explicitly specified and using a regex with flag g, `scope` is 'all'. + * @returns {String} New string with one or all matches replaced. + * @example + * + * // Regex search, using named backreferences in replacement string + * const name = XRegExp('(?\\w+) (?\\w+)'); + * XRegExp.replace('John Smith', name, '$, $'); + * // -> 'Smith, John' + * + * // Regex search, using named backreferences in replacement function + * XRegExp.replace('John Smith', name, (match) => `${match.last}, ${match.first}`); + * // -> 'Smith, John' + * + * // String search, with replace-all + * XRegExp.replace('RegExp builds RegExps', 'RegExp', 'XRegExp', 'all'); + * // -> 'XRegExp builds XRegExps' + */ + + +XRegExp.replace = function (str, search, replacement, scope) { + var isRegex = XRegExp.isRegExp(search); + var global = search.global && scope !== 'one' || scope === 'all'; + var cacheKey = (global ? 'g' : '') + (search.sticky ? 'y' : '') || 'noGY'; + var s2 = search; + + if (isRegex) { + search[REGEX_DATA] = search[REGEX_DATA] || {}; // Shares cached copies with `XRegExp.exec`/`match`. Since a copy is used, `search`'s + // `lastIndex` isn't updated *during* replacement iterations + + s2 = search[REGEX_DATA][cacheKey] || (search[REGEX_DATA][cacheKey] = copyRegex(search, { + addG: !!global, + removeG: scope === 'one', + isInternalOnly: true + })); + } else if (global) { + s2 = new RegExp(XRegExp.escape(String(search)), 'g'); + } // Fixed `replace` required for named backreferences, etc. + + + var result = fixed.replace.call(toObject(str), s2, replacement); + + if (isRegex && search.global) { + // Fixes IE, Safari bug (last tested IE 9, Safari 5.1) + search.lastIndex = 0; + } + + return result; +}; +/** + * Performs batch processing of string replacements. Used like `XRegExp.replace`, but accepts an + * array of replacement details. Later replacements operate on the output of earlier replacements. + * Replacement details are accepted as an array with a regex or string to search for, the + * replacement string or function, and an optional scope of 'one' or 'all'. Uses the XRegExp + * replacement text syntax, which supports named backreference properties via `${name}` or + * `$`. + * + * @memberOf XRegExp + * @param {String} str String to search. + * @param {Array} replacements Array of replacement detail arrays. + * @returns {String} New string with all replacements. + * @example + * + * str = XRegExp.replaceEach(str, [ + * [XRegExp('(?a)'), 'z${name}'], + * [/b/gi, 'y'], + * [/c/g, 'x', 'one'], // scope 'one' overrides /g + * [/d/, 'w', 'all'], // scope 'all' overrides lack of /g + * ['e', 'v', 'all'], // scope 'all' allows replace-all for strings + * [/f/g, ($0) => $0.toUpperCase()] + * ]); + */ + + +XRegExp.replaceEach = function (str, replacements) { + var _iteratorNormalCompletion4 = true; + var _didIteratorError4 = false; + var _iteratorError4 = undefined; + + try { + for (var _iterator4 = replacements[Symbol.iterator](), _step4; !(_iteratorNormalCompletion4 = (_step4 = _iterator4.next()).done); _iteratorNormalCompletion4 = true) { + var r = _step4.value; + str = XRegExp.replace(str, r[0], r[1], r[2]); + } + } catch (err) { + _didIteratorError4 = true; + _iteratorError4 = err; + } finally { + try { + if (!_iteratorNormalCompletion4 && _iterator4.return != null) { + _iterator4.return(); + } + } finally { + if (_didIteratorError4) { + throw _iteratorError4; + } + } + } + + return str; +}; +/** + * Splits a string into an array of strings using a regex or string separator. Matches of the + * separator are not included in the result array. However, if `separator` is a regex that contains + * capturing groups, backreferences are spliced into the result each time `separator` is matched. + * Fixes browser bugs compared to the native `String.prototype.split` and can be used reliably + * cross-browser. + * + * @memberOf XRegExp + * @param {String} str String to split. + * @param {RegExp|String} separator Regex or string to use for separating the string. + * @param {Number} [limit] Maximum number of items to include in the result array. + * @returns {Array} Array of substrings. + * @example + * + * // Basic use + * XRegExp.split('a b c', ' '); + * // -> ['a', 'b', 'c'] + * + * // With limit + * XRegExp.split('a b c', ' ', 2); + * // -> ['a', 'b'] + * + * // Backreferences in result array + * XRegExp.split('..word1..', /([a-z]+)(\d+)/i); + * // -> ['..', 'word', '1', '..'] + */ + + +XRegExp.split = function (str, separator, limit) { + return fixed.split.call(toObject(str), separator, limit); +}; +/** + * Executes a regex search in a specified string. Returns `true` or `false`. Optional `pos` and + * `sticky` arguments specify the search start position, and whether the match must start at the + * specified position only. The `lastIndex` property of the provided regex is not used, but is + * updated for compatibility. Also fixes browser bugs compared to the native + * `RegExp.prototype.test` and can be used reliably cross-browser. + * + * @memberOf XRegExp + * @param {String} str String to search. + * @param {RegExp} regex Regex to search with. + * @param {Number} [pos=0] Zero-based index at which to start the search. + * @param {Boolean|String} [sticky=false] Whether the match must start at the specified position + * only. The string `'sticky'` is accepted as an alternative to `true`. + * @returns {Boolean} Whether the regex matched the provided value. + * @example + * + * // Basic use + * XRegExp.test('abc', /c/); // -> true + * + * // With pos and sticky + * XRegExp.test('abc', /c/, 0, 'sticky'); // -> false + * XRegExp.test('abc', /c/, 2, 'sticky'); // -> true + */ +// Do this the easy way :-) + + +XRegExp.test = function (str, regex, pos, sticky) { + return !!XRegExp.exec(str, regex, pos, sticky); +}; +/** + * Uninstalls optional features according to the specified options. All optional features start out + * uninstalled, so this is used to undo the actions of `XRegExp.install`. + * + * @memberOf XRegExp + * @param {Object|String} options Options object or string. + * @example + * + * // With an options object + * XRegExp.uninstall({ + * // Disables support for astral code points in Unicode addons + * astral: true, + * + * // Don't add named capture groups to the `groups` property of matches + * namespacing: true + * }); + * + * // With an options string + * XRegExp.uninstall('astral namespacing'); + */ + + +XRegExp.uninstall = function (options) { + options = prepareOptions(options); + + if (features.astral && options.astral) { + setAstral(false); + } + + if (features.namespacing && options.namespacing) { + setNamespacing(false); + } +}; +/** + * Returns an XRegExp object that is the union of the given patterns. Patterns can be provided as + * regex objects or strings. Metacharacters are escaped in patterns provided as strings. + * Backreferences in provided regex objects are automatically renumbered to work correctly within + * the larger combined pattern. Native flags used by provided regexes are ignored in favor of the + * `flags` argument. + * + * @memberOf XRegExp + * @param {Array} patterns Regexes and strings to combine. + * @param {String} [flags] Any combination of XRegExp flags. + * @param {Object} [options] Options object with optional properties: + * - `conjunction` {String} Type of conjunction to use: 'or' (default) or 'none'. + * @returns {RegExp} Union of the provided regexes and strings. + * @example + * + * XRegExp.union(['a+b*c', /(dogs)\1/, /(cats)\1/], 'i'); + * // -> /a\+b\*c|(dogs)\1|(cats)\2/i + * + * XRegExp.union([/man/, /bear/, /pig/], 'i', {conjunction: 'none'}); + * // -> /manbearpig/i + */ + + +XRegExp.union = function (patterns, flags, options) { + options = options || {}; + var conjunction = options.conjunction || 'or'; + var numCaptures = 0; + var numPriorCaptures; + var captureNames; + + function rewrite(match, paren, backref) { + var name = captureNames[numCaptures - numPriorCaptures]; // Capturing group + + if (paren) { + ++numCaptures; // If the current capture has a name, preserve the name + + if (name) { + return "(?<".concat(name, ">"); + } // Backreference + + } else if (backref) { + // Rewrite the backreference + return "\\".concat(+backref + numPriorCaptures); + } + + return match; + } + + if (!(isType(patterns, 'Array') && patterns.length)) { + throw new TypeError('Must provide a nonempty array of patterns to merge'); + } + + var parts = /(\()(?!\?)|\\([1-9]\d*)|\\[\s\S]|\[(?:[^\\\]]|\\[\s\S])*\]/g; + var output = []; + var _iteratorNormalCompletion5 = true; + var _didIteratorError5 = false; + var _iteratorError5 = undefined; + + try { + for (var _iterator5 = patterns[Symbol.iterator](), _step5; !(_iteratorNormalCompletion5 = (_step5 = _iterator5.next()).done); _iteratorNormalCompletion5 = true) { + var pattern = _step5.value; + + if (XRegExp.isRegExp(pattern)) { + numPriorCaptures = numCaptures; + captureNames = pattern[REGEX_DATA] && pattern[REGEX_DATA].captureNames || []; // Rewrite backreferences. Passing to XRegExp dies on octals and ensures patterns are + // independently valid; helps keep this simple. Named captures are put back + + output.push(nativ.replace.call(XRegExp(pattern.source).source, parts, rewrite)); + } else { + output.push(XRegExp.escape(pattern)); + } + } + } catch (err) { + _didIteratorError5 = true; + _iteratorError5 = err; + } finally { + try { + if (!_iteratorNormalCompletion5 && _iterator5.return != null) { + _iterator5.return(); + } + } finally { + if (_didIteratorError5) { + throw _iteratorError5; + } + } + } + + var separator = conjunction === 'none' ? '' : '|'; + return XRegExp(output.join(separator), flags); +}; // ==--------------------------== +// Fixed/extended native methods +// ==--------------------------== + +/** + * Adds named capture support (with backreferences returned as `result.name`), and fixes browser + * bugs in the native `RegExp.prototype.exec`. Use via `XRegExp.exec`. + * + * @memberOf RegExp + * @param {String} str String to search. + * @returns {Array} Match array with named backreference properties, or `null`. + */ + + +fixed.exec = function (str) { + var origLastIndex = this.lastIndex; + var match = nativ.exec.apply(this, arguments); + + if (match) { + // Fix browsers whose `exec` methods don't return `undefined` for nonparticipating capturing + // groups. This fixes IE 5.5-8, but not IE 9's quirks mode or emulation of older IEs. IE 9 + // in standards mode follows the spec. + if (!correctExecNpcg && match.length > 1 && match.indexOf('') !== -1) { + var r2 = copyRegex(this, { + removeG: true, + isInternalOnly: true + }); // Using `str.slice(match.index)` rather than `match[0]` in case lookahead allowed + // matching due to characters outside the match + + nativ.replace.call(String(str).slice(match.index), r2, function () { + var len = arguments.length; // Skip index 0 and the last 2 + + for (var i = 1; i < len - 2; ++i) { + if ((i < 0 || arguments.length <= i ? undefined : arguments[i]) === undefined) { + match[i] = undefined; + } + } + }); + } // Attach named capture properties + + + var groupsObject = match; + + if (XRegExp.isInstalled('namespacing')) { + // https://tc39.github.io/proposal-regexp-named-groups/#sec-regexpbuiltinexec + match.groups = Object.create(null); + groupsObject = match.groups; + } + + if (this[REGEX_DATA] && this[REGEX_DATA].captureNames) { + // Skip index 0 + for (var i = 1; i < match.length; ++i) { + var name = this[REGEX_DATA].captureNames[i - 1]; + + if (name) { + groupsObject[name] = match[i]; + } + } + } // Fix browsers that increment `lastIndex` after zero-length matches + + + if (this.global && !match[0].length && this.lastIndex > match.index) { + this.lastIndex = match.index; + } + } + + if (!this.global) { + // Fixes IE, Opera bug (last tested IE 9, Opera 11.6) + this.lastIndex = origLastIndex; + } + + return match; +}; +/** + * Fixes browser bugs in the native `RegExp.prototype.test`. + * + * @memberOf RegExp + * @param {String} str String to search. + * @returns {Boolean} Whether the regex matched the provided value. + */ + + +fixed.test = function (str) { + // Do this the easy way :-) + return !!fixed.exec.call(this, str); +}; +/** + * Adds named capture support (with backreferences returned as `result.name`), and fixes browser + * bugs in the native `String.prototype.match`. + * + * @memberOf String + * @param {RegExp|*} regex Regex to search with. If not a regex object, it is passed to `RegExp`. + * @returns {Array} If `regex` uses flag g, an array of match strings or `null`. Without flag g, + * the result of calling `regex.exec(this)`. + */ + + +fixed.match = function (regex) { + if (!XRegExp.isRegExp(regex)) { + // Use the native `RegExp` rather than `XRegExp` + regex = new RegExp(regex); + } else if (regex.global) { + var result = nativ.match.apply(this, arguments); // Fixes IE bug + + regex.lastIndex = 0; + return result; + } + + return fixed.exec.call(regex, toObject(this)); +}; +/** + * Adds support for `${n}` (or `$`) tokens for named and numbered backreferences in replacement + * text, and provides named backreferences to replacement functions as `arguments[0].name`. Also + * fixes browser bugs in replacement text syntax when performing a replacement using a nonregex + * search value, and the value of a replacement regex's `lastIndex` property during replacement + * iterations and upon completion. Note that this doesn't support SpiderMonkey's proprietary third + * (`flags`) argument. Use via `XRegExp.replace`. + * + * @memberOf String + * @param {RegExp|String} search Search pattern to be replaced. + * @param {String|Function} replacement Replacement string or a function invoked to create it. + * @returns {String} New string with one or all matches replaced. + */ + + +fixed.replace = function (search, replacement) { + var isRegex = XRegExp.isRegExp(search); + var origLastIndex; + var captureNames; + var result; + + if (isRegex) { + if (search[REGEX_DATA]) { + captureNames = search[REGEX_DATA].captureNames; + } // Only needed if `search` is nonglobal + + + origLastIndex = search.lastIndex; + } else { + search += ''; // Type-convert + } // Don't use `typeof`; some older browsers return 'function' for regex objects + + + if (isType(replacement, 'Function')) { + // Stringifying `this` fixes a bug in IE < 9 where the last argument in replacement + // functions isn't type-converted to a string + result = nativ.replace.call(String(this), search, function () { + for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) { + args[_key] = arguments[_key]; + } + + if (captureNames) { + var groupsObject; + + if (XRegExp.isInstalled('namespacing')) { + // https://tc39.github.io/proposal-regexp-named-groups/#sec-regexpbuiltinexec + groupsObject = Object.create(null); + args.push(groupsObject); + } else { + // Change the `args[0]` string primitive to a `String` object that can store + // properties. This really does need to use `String` as a constructor + args[0] = new String(args[0]); + groupsObject = args[0]; + } // Store named backreferences + + + for (var i = 0; i < captureNames.length; ++i) { + if (captureNames[i]) { + groupsObject[captureNames[i]] = args[i + 1]; + } + } + } // Update `lastIndex` before calling `replacement`. Fixes IE, Chrome, Firefox, Safari + // bug (last tested IE 9, Chrome 17, Firefox 11, Safari 5.1) + + + if (isRegex && search.global) { + search.lastIndex = args[args.length - 2] + args[0].length; + } // ES6 specs the context for replacement functions as `undefined` + + + return replacement.apply(void 0, args); + }); + } else { + // Ensure that the last value of `args` will be a string when given nonstring `this`, + // while still throwing on null or undefined context + result = nativ.replace.call(this == null ? this : String(this), search, function () { + for (var _len2 = arguments.length, args = new Array(_len2), _key2 = 0; _key2 < _len2; _key2++) { + args[_key2] = arguments[_key2]; + } + + return nativ.replace.call(String(replacement), replacementToken, replacer); + + function replacer($0, bracketed, angled, dollarToken) { + bracketed = bracketed || angled; // Named or numbered backreference with curly or angled braces + + if (bracketed) { + // XRegExp behavior for `${n}` or `$`: + // 1. Backreference to numbered capture, if `n` is an integer. Use `0` for the + // entire match. Any number of leading zeros may be used. + // 2. Backreference to named capture `n`, if it exists and is not an integer + // overridden by numbered capture. In practice, this does not overlap with + // numbered capture since XRegExp does not allow named capture to use a bare + // integer as the name. + // 3. If the name or number does not refer to an existing capturing group, it's + // an error. + var n = +bracketed; // Type-convert; drop leading zeros + + if (n <= args.length - 3) { + return args[n] || ''; + } // Groups with the same name is an error, else would need `lastIndexOf` + + + n = captureNames ? captureNames.indexOf(bracketed) : -1; + + if (n < 0) { + throw new SyntaxError("Backreference to undefined group ".concat($0)); + } + + return args[n + 1] || ''; + } // Else, special variable or numbered backreference without curly braces + + + if (dollarToken === '$') { + // $$ + return '$'; + } + + if (dollarToken === '&' || +dollarToken === 0) { + // $&, $0 (not followed by 1-9), $00 + return args[0]; + } + + if (dollarToken === '`') { + // $` (left context) + return args[args.length - 1].slice(0, args[args.length - 2]); + } + + if (dollarToken === "'") { + // $' (right context) + return args[args.length - 1].slice(args[args.length - 2] + args[0].length); + } // Else, numbered backreference without braces + + + dollarToken = +dollarToken; // Type-convert; drop leading zero + // XRegExp behavior for `$n` and `$nn`: + // - Backrefs end after 1 or 2 digits. Use `${..}` or `$<..>` for more digits. + // - `$1` is an error if no capturing groups. + // - `$10` is an error if less than 10 capturing groups. Use `${1}0` or `$<1>0` + // instead. + // - `$01` is `$1` if at least one capturing group, else it's an error. + // - `$0` (not followed by 1-9) and `$00` are the entire match. + // Native behavior, for comparison: + // - Backrefs end after 1 or 2 digits. Cannot reference capturing group 100+. + // - `$1` is a literal `$1` if no capturing groups. + // - `$10` is `$1` followed by a literal `0` if less than 10 capturing groups. + // - `$01` is `$1` if at least one capturing group, else it's a literal `$01`. + // - `$0` is a literal `$0`. + + if (!isNaN(dollarToken)) { + if (dollarToken > args.length - 3) { + throw new SyntaxError("Backreference to undefined group ".concat($0)); + } + + return args[dollarToken] || ''; + } // `$` followed by an unsupported char is an error, unlike native JS + + + throw new SyntaxError("Invalid token ".concat($0)); + } + }); + } + + if (isRegex) { + if (search.global) { + // Fixes IE, Safari bug (last tested IE 9, Safari 5.1) + search.lastIndex = 0; + } else { + // Fixes IE, Opera bug (last tested IE 9, Opera 11.6) + search.lastIndex = origLastIndex; + } + } + + return result; +}; +/** + * Fixes browser bugs in the native `String.prototype.split`. Use via `XRegExp.split`. + * + * @memberOf String + * @param {RegExp|String} separator Regex or string to use for separating the string. + * @param {Number} [limit] Maximum number of items to include in the result array. + * @returns {Array} Array of substrings. + */ + + +fixed.split = function (separator, limit) { + if (!XRegExp.isRegExp(separator)) { + // Browsers handle nonregex split correctly, so use the faster native method + return nativ.split.apply(this, arguments); + } + + var str = String(this); + var output = []; + var origLastIndex = separator.lastIndex; + var lastLastIndex = 0; + var lastLength; // Values for `limit`, per the spec: + // If undefined: pow(2,32) - 1 + // If 0, Infinity, or NaN: 0 + // If positive number: limit = floor(limit); if (limit >= pow(2,32)) limit -= pow(2,32); + // If negative number: pow(2,32) - floor(abs(limit)) + // If other: Type-convert, then use the above rules + // This line fails in very strange ways for some values of `limit` in Opera 10.5-10.63, unless + // Opera Dragonfly is open (go figure). It works in at least Opera 9.5-10.1 and 11+ + + limit = (limit === undefined ? -1 : limit) >>> 0; + XRegExp.forEach(str, separator, function (match) { + // This condition is not the same as `if (match[0].length)` + if (match.index + match[0].length > lastLastIndex) { + output.push(str.slice(lastLastIndex, match.index)); + + if (match.length > 1 && match.index < str.length) { + Array.prototype.push.apply(output, match.slice(1)); + } + + lastLength = match[0].length; + lastLastIndex = match.index + lastLength; + } + }); + + if (lastLastIndex === str.length) { + if (!nativ.test.call(separator, '') || lastLength) { + output.push(''); + } + } else { + output.push(str.slice(lastLastIndex)); + } + + separator.lastIndex = origLastIndex; + return output.length > limit ? output.slice(0, limit) : output; +}; // ==--------------------------== +// Built-in syntax/flag tokens +// ==--------------------------== + +/* + * Letter escapes that natively match literal characters: `\a`, `\A`, etc. These should be + * SyntaxErrors but are allowed in web reality. XRegExp makes them errors for cross-browser + * consistency and to reserve their syntax, but lets them be superseded by addons. + */ + + +XRegExp.addToken(/\\([ABCE-RTUVXYZaeg-mopqyz]|c(?![A-Za-z])|u(?![\dA-Fa-f]{4}|{[\dA-Fa-f]+})|x(?![\dA-Fa-f]{2}))/, function (match, scope) { + // \B is allowed in default scope only + if (match[1] === 'B' && scope === defaultScope) { + return match[0]; + } + + throw new SyntaxError("Invalid escape ".concat(match[0])); +}, { + scope: 'all', + leadChar: '\\' +}); +/* + * Unicode code point escape with curly braces: `\u{N..}`. `N..` is any one or more digit + * hexadecimal number from 0-10FFFF, and can include leading zeros. Requires the native ES6 `u` flag + * to support code points greater than U+FFFF. Avoids converting code points above U+FFFF to + * surrogate pairs (which could be done without flag `u`), since that could lead to broken behavior + * if you follow a `\u{N..}` token that references a code point above U+FFFF with a quantifier, or + * if you use the same in a character class. + */ + +XRegExp.addToken(/\\u{([\dA-Fa-f]+)}/, function (match, scope, flags) { + var code = dec(match[1]); + + if (code > 0x10FFFF) { + throw new SyntaxError("Invalid Unicode code point ".concat(match[0])); + } + + if (code <= 0xFFFF) { + // Converting to \uNNNN avoids needing to escape the literal character and keep it + // separate from preceding tokens + return "\\u".concat(pad4(hex(code))); + } // If `code` is between 0xFFFF and 0x10FFFF, require and defer to native handling + + + if (hasNativeU && flags.indexOf('u') !== -1) { + return match[0]; + } + + throw new SyntaxError('Cannot use Unicode code point above \\u{FFFF} without flag u'); +}, { + scope: 'all', + leadChar: '\\' +}); +/* + * Empty character class: `[]` or `[^]`. This fixes a critical cross-browser syntax inconsistency. + * Unless this is standardized (per the ES spec), regex syntax can't be accurately parsed because + * character class endings can't be determined. + */ + +XRegExp.addToken(/\[(\^?)\]/, // For cross-browser compatibility with ES3, convert [] to \b\B and [^] to [\s\S]. +// (?!) should work like \b\B, but is unreliable in some versions of Firefox + +/* eslint-disable no-confusing-arrow */ +function (match) { + return match[1] ? '[\\s\\S]' : '\\b\\B'; +}, +/* eslint-enable no-confusing-arrow */ +{ + leadChar: '[' +}); +/* + * Comment pattern: `(?# )`. Inline comments are an alternative to the line comments allowed in + * free-spacing mode (flag x). + */ + +XRegExp.addToken(/\(\?#[^)]*\)/, getContextualTokenSeparator, { + leadChar: '(' +}); +/* + * Whitespace and line comments, in free-spacing mode (aka extended mode, flag x) only. + */ + +XRegExp.addToken(/\s+|#[^\n]*\n?/, getContextualTokenSeparator, { + flag: 'x' +}); +/* + * Dot, in dotall mode (aka singleline mode, flag s) only. + */ + +XRegExp.addToken(/\./, function () { + return '[\\s\\S]'; +}, { + flag: 's', + leadChar: '.' +}); +/* + * Named backreference: `\k`. Backreference names can use the characters A-Z, a-z, 0-9, _, + * and $ only. Also allows numbered backreferences as `\k`. + */ + +XRegExp.addToken(/\\k<([\w$]+)>/, function (match) { + // Groups with the same name is an error, else would need `lastIndexOf` + var index = isNaN(match[1]) ? this.captureNames.indexOf(match[1]) + 1 : +match[1]; + var endIndex = match.index + match[0].length; + + if (!index || index > this.captureNames.length) { + throw new SyntaxError("Backreference to undefined group ".concat(match[0])); + } // Keep backreferences separate from subsequent literal numbers. This avoids e.g. + // inadvertedly changing `(?)\k1` to `()\11`. + + + return "\\".concat(index).concat(endIndex === match.input.length || isNaN(match.input[endIndex]) ? '' : '(?:)'); +}, { + leadChar: '\\' +}); +/* + * Numbered backreference or octal, plus any following digits: `\0`, `\11`, etc. Octals except `\0` + * not followed by 0-9 and backreferences to unopened capture groups throw an error. Other matches + * are returned unaltered. IE < 9 doesn't support backreferences above `\99` in regex syntax. + */ + +XRegExp.addToken(/\\(\d+)/, function (match, scope) { + if (!(scope === defaultScope && /^[1-9]/.test(match[1]) && +match[1] <= this.captureNames.length) && match[1] !== '0') { + throw new SyntaxError("Cannot use octal escape or backreference to undefined group ".concat(match[0])); + } + + return match[0]; +}, { + scope: 'all', + leadChar: '\\' +}); +/* + * Named capturing group; match the opening delimiter only: `(?`. Capture names can use the + * characters A-Z, a-z, 0-9, _, and $ only. Names can't be integers. Supports Python-style + * `(?P` as an alternate syntax to avoid issues in some older versions of Opera which natively + * supported the Python-style syntax. Otherwise, XRegExp might treat numbered backreferences to + * Python-style named capture as octals. + */ + +XRegExp.addToken(/\(\?P?<([\w$]+)>/, function (match) { + // Disallow bare integers as names because named backreferences are added to match arrays + // and therefore numeric properties may lead to incorrect lookups + if (!isNaN(match[1])) { + throw new SyntaxError("Cannot use integer as capture name ".concat(match[0])); + } + + if (!XRegExp.isInstalled('namespacing') && (match[1] === 'length' || match[1] === '__proto__')) { + throw new SyntaxError("Cannot use reserved word as capture name ".concat(match[0])); + } + + if (this.captureNames.indexOf(match[1]) !== -1) { + throw new SyntaxError("Cannot use same name for multiple groups ".concat(match[0])); + } + + this.captureNames.push(match[1]); + this.hasNamedCapture = true; + return '('; +}, { + leadChar: '(' +}); +/* + * Capturing group; match the opening parenthesis only. Required for support of named capturing + * groups. Also adds explicit capture mode (flag n). + */ + +XRegExp.addToken(/\((?!\?)/, function (match, scope, flags) { + if (flags.indexOf('n') !== -1) { + return '(?:'; + } + + this.captureNames.push(null); + return '('; +}, { + optionalFlags: 'n', + leadChar: '(' +}); +var _default = XRegExp; +exports.default = _default; +module.exports = exports["default"]; +}); + +unwrapExports(xregexp); + +var build = createCommonjsModule(function (module, exports) { +"use strict"; + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.default = void 0; + +/*! + * XRegExp.build 4.2.0 + * + * Steven Levithan (c) 2012-present MIT License + */ +var _default = function _default(XRegExp) { + var REGEX_DATA = 'xregexp'; + var subParts = /(\()(?!\?)|\\([1-9]\d*)|\\[\s\S]|\[(?:[^\\\]]|\\[\s\S])*\]/g; + var parts = XRegExp.union([/\({{([\w$]+)}}\)|{{([\w$]+)}}/, subParts], 'g', { + conjunction: 'or' + }); + /** + * Strips a leading `^` and trailing unescaped `$`, if both are present. + * + * @private + * @param {String} pattern Pattern to process. + * @returns {String} Pattern with edge anchors removed. + */ + + function deanchor(pattern) { + // Allow any number of empty noncapturing groups before/after anchors, because regexes + // built/generated by XRegExp sometimes include them + var leadingAnchor = /^(?:\(\?:\))*\^/; + var trailingAnchor = /\$(?:\(\?:\))*$/; + + if (leadingAnchor.test(pattern) && trailingAnchor.test(pattern) && // Ensure that the trailing `$` isn't escaped + trailingAnchor.test(pattern.replace(/\\[\s\S]/g, ''))) { + return pattern.replace(leadingAnchor, '').replace(trailingAnchor, ''); + } + + return pattern; + } + /** + * Converts the provided value to an XRegExp. Native RegExp flags are not preserved. + * + * @private + * @param {String|RegExp} value Value to convert. + * @param {Boolean} [addFlagX] Whether to apply the `x` flag in cases when `value` is not + * already a regex generated by XRegExp + * @returns {RegExp} XRegExp object with XRegExp syntax applied. + */ + + + function asXRegExp(value, addFlagX) { + var flags = addFlagX ? 'x' : ''; + return XRegExp.isRegExp(value) ? value[REGEX_DATA] && value[REGEX_DATA].captureNames ? // Don't recompile, to preserve capture names + value : // Recompile as XRegExp + XRegExp(value.source, flags) : // Compile string as XRegExp + XRegExp(value, flags); + } + + function interpolate(substitution) { + return substitution instanceof RegExp ? substitution : XRegExp.escape(substitution); + } + + function reduceToSubpatternsObject(subpatterns, interpolated, subpatternIndex) { + subpatterns["subpattern".concat(subpatternIndex)] = interpolated; + return subpatterns; + } + + function embedSubpatternAfter(raw, subpatternIndex, rawLiterals) { + var hasSubpattern = subpatternIndex < rawLiterals.length - 1; + return raw + (hasSubpattern ? "{{subpattern".concat(subpatternIndex, "}}") : ''); + } + /** + * Provides tagged template literals that create regexes with XRegExp syntax and flags. The + * provided pattern is handled as a raw string, so backslashes don't need to be escaped. + * + * Interpolation of strings and regexes shares the features of `XRegExp.build`. Interpolated + * patterns are treated as atomic units when quantified, interpolated strings have their special + * characters escaped, a leading `^` and trailing unescaped `$` are stripped from interpolated + * regexes if both are present, and any backreferences within an interpolated regex are + * rewritten to work within the overall pattern. + * + * @memberOf XRegExp + * @param {String} [flags] Any combination of XRegExp flags. + * @returns {Function} Handler for template literals that construct regexes with XRegExp syntax. + * @example + * + * const h12 = /1[0-2]|0?[1-9]/; + * const h24 = /2[0-3]|[01][0-9]/; + * const hours = XRegExp.tag('x')`${h12} : | ${h24}`; + * const minutes = /^[0-5][0-9]$/; + * // Note that explicitly naming the 'minutes' group is required for named backreferences + * const time = XRegExp.tag('x')`^ ${hours} (?${minutes}) $`; + * time.test('10:59'); // -> true + * XRegExp.exec('10:59', time).minutes; // -> '59' + */ + + + XRegExp.tag = function (flags) { + return function (literals) { + for (var _len = arguments.length, substitutions = new Array(_len > 1 ? _len - 1 : 0), _key = 1; _key < _len; _key++) { + substitutions[_key - 1] = arguments[_key]; + } + + var subpatterns = substitutions.map(interpolate).reduce(reduceToSubpatternsObject, {}); + var pattern = literals.raw.map(embedSubpatternAfter).join(''); + return XRegExp.build(pattern, subpatterns, flags); + }; + }; + /** + * Builds regexes using named subpatterns, for readability and pattern reuse. Backreferences in + * the outer pattern and provided subpatterns are automatically renumbered to work correctly. + * Native flags used by provided subpatterns are ignored in favor of the `flags` argument. + * + * @memberOf XRegExp + * @param {String} pattern XRegExp pattern using `{{name}}` for embedded subpatterns. Allows + * `({{name}})` as shorthand for `(?{{name}})`. Patterns cannot be embedded within + * character classes. + * @param {Object} subs Lookup object for named subpatterns. Values can be strings or regexes. A + * leading `^` and trailing unescaped `$` are stripped from subpatterns, if both are present. + * @param {String} [flags] Any combination of XRegExp flags. + * @returns {RegExp} Regex with interpolated subpatterns. + * @example + * + * const time = XRegExp.build('(?x)^ {{hours}} ({{minutes}}) $', { + * hours: XRegExp.build('{{h12}} : | {{h24}}', { + * h12: /1[0-2]|0?[1-9]/, + * h24: /2[0-3]|[01][0-9]/ + * }, 'x'), + * minutes: /^[0-5][0-9]$/ + * }); + * time.test('10:59'); // -> true + * XRegExp.exec('10:59', time).minutes; // -> '59' + */ + + + XRegExp.build = function (pattern, subs, flags) { + flags = flags || ''; // Used with `asXRegExp` calls for `pattern` and subpatterns in `subs`, to work around how + // some browsers convert `RegExp('\n')` to a regex that contains the literal characters `\` + // and `n`. See more details at . + + var addFlagX = flags.indexOf('x') !== -1; + var inlineFlags = /^\(\?([\w$]+)\)/.exec(pattern); // Add flags within a leading mode modifier to the overall pattern's flags + + if (inlineFlags) { + flags = XRegExp._clipDuplicates(flags + inlineFlags[1]); + } + + var data = {}; + + for (var p in subs) { + if (subs.hasOwnProperty(p)) { + // Passing to XRegExp enables extended syntax and ensures independent validity, + // lest an unescaped `(`, `)`, `[`, or trailing `\` breaks the `(?:)` wrapper. For + // subpatterns provided as native regexes, it dies on octals and adds the property + // used to hold extended regex instance data, for simplicity. + var sub = asXRegExp(subs[p], addFlagX); + data[p] = { + // Deanchoring allows embedding independently useful anchored regexes. If you + // really need to keep your anchors, double them (i.e., `^^...$$`). + pattern: deanchor(sub.source), + names: sub[REGEX_DATA].captureNames || [] + }; + } + } // Passing to XRegExp dies on octals and ensures the outer pattern is independently valid; + // helps keep this simple. Named captures will be put back. + + + var patternAsRegex = asXRegExp(pattern, addFlagX); // 'Caps' is short for 'captures' + + var numCaps = 0; + var numPriorCaps; + var numOuterCaps = 0; + var outerCapsMap = [0]; + var outerCapNames = patternAsRegex[REGEX_DATA].captureNames || []; + var output = patternAsRegex.source.replace(parts, function ($0, $1, $2, $3, $4) { + var subName = $1 || $2; + var capName; + var intro; + var localCapIndex; // Named subpattern + + if (subName) { + if (!data.hasOwnProperty(subName)) { + throw new ReferenceError("Undefined property ".concat($0)); + } // Named subpattern was wrapped in a capturing group + + + if ($1) { + capName = outerCapNames[numOuterCaps]; + outerCapsMap[++numOuterCaps] = ++numCaps; // If it's a named group, preserve the name. Otherwise, use the subpattern name + // as the capture name + + intro = "(?<".concat(capName || subName, ">"); + } else { + intro = '(?:'; + } + + numPriorCaps = numCaps; + var rewrittenSubpattern = data[subName].pattern.replace(subParts, function (match, paren, backref) { + // Capturing group + if (paren) { + capName = data[subName].names[numCaps - numPriorCaps]; + ++numCaps; // If the current capture has a name, preserve the name + + if (capName) { + return "(?<".concat(capName, ">"); + } // Backreference + + } else if (backref) { + localCapIndex = +backref - 1; // Rewrite the backreference + + return data[subName].names[localCapIndex] ? // Need to preserve the backreference name in case using flag `n` + "\\k<".concat(data[subName].names[localCapIndex], ">") : "\\".concat(+backref + numPriorCaps); + } + + return match; + }); + return "".concat(intro).concat(rewrittenSubpattern, ")"); + } // Capturing group + + + if ($3) { + capName = outerCapNames[numOuterCaps]; + outerCapsMap[++numOuterCaps] = ++numCaps; // If the current capture has a name, preserve the name + + if (capName) { + return "(?<".concat(capName, ">"); + } // Backreference + + } else if ($4) { + localCapIndex = +$4 - 1; // Rewrite the backreference + + return outerCapNames[localCapIndex] ? // Need to preserve the backreference name in case using flag `n` + "\\k<".concat(outerCapNames[localCapIndex], ">") : "\\".concat(outerCapsMap[+$4]); + } + + return $0; + }); + return XRegExp(output, flags); + }; +}; + +exports.default = _default; +module.exports = exports["default"]; +}); + +unwrapExports(build); + +var matchrecursive = createCommonjsModule(function (module, exports) { +"use strict"; + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.default = void 0; + +/*! + * XRegExp.matchRecursive 4.2.0 + * + * Steven Levithan (c) 2009-present MIT License + */ +var _default = function _default(XRegExp) { + /** + * Returns a match detail object composed of the provided values. + * + * @private + */ + function row(name, value, start, end) { + return { + name: name, + value: value, + start: start, + end: end + }; + } + /** + * Returns an array of match strings between outermost left and right delimiters, or an array of + * objects with detailed match parts and position data. An error is thrown if delimiters are + * unbalanced within the data. + * + * @memberOf XRegExp + * @param {String} str String to search. + * @param {String} left Left delimiter as an XRegExp pattern. + * @param {String} right Right delimiter as an XRegExp pattern. + * @param {String} [flags] Any native or XRegExp flags, used for the left and right delimiters. + * @param {Object} [options] Lets you specify `valueNames` and `escapeChar` options. + * @returns {Array} Array of matches, or an empty array. + * @example + * + * // Basic usage + * let str = '(t((e))s)t()(ing)'; + * XRegExp.matchRecursive(str, '\\(', '\\)', 'g'); + * // -> ['t((e))s', '', 'ing'] + * + * // Extended information mode with valueNames + * str = 'Here is
an
example'; + * XRegExp.matchRecursive(str, '', '', 'gi', { + * valueNames: ['between', 'left', 'match', 'right'] + * }); + * // -> [ + * // {name: 'between', value: 'Here is ', start: 0, end: 8}, + * // {name: 'left', value: '
', start: 8, end: 13}, + * // {name: 'match', value: '
an
', start: 13, end: 27}, + * // {name: 'right', value: '
', start: 27, end: 33}, + * // {name: 'between', value: ' example', start: 33, end: 41} + * // ] + * + * // Omitting unneeded parts with null valueNames, and using escapeChar + * str = '...{1}.\\{{function(x,y){return {y:x}}}'; + * XRegExp.matchRecursive(str, '{', '}', 'g', { + * valueNames: ['literal', null, 'value', null], + * escapeChar: '\\' + * }); + * // -> [ + * // {name: 'literal', value: '...', start: 0, end: 3}, + * // {name: 'value', value: '1', start: 4, end: 5}, + * // {name: 'literal', value: '.\\{', start: 6, end: 9}, + * // {name: 'value', value: 'function(x,y){return {y:x}}', start: 10, end: 37} + * // ] + * + * // Sticky mode via flag y + * str = '<1><<<2>>><3>4<5>'; + * XRegExp.matchRecursive(str, '<', '>', 'gy'); + * // -> ['1', '<<2>>', '3'] + */ + + + XRegExp.matchRecursive = function (str, left, right, flags, options) { + flags = flags || ''; + options = options || {}; + var global = flags.indexOf('g') !== -1; + var sticky = flags.indexOf('y') !== -1; // Flag `y` is controlled internally + + var basicFlags = flags.replace(/y/g, ''); + var _options = options, + escapeChar = _options.escapeChar; + var vN = options.valueNames; + var output = []; + var openTokens = 0; + var delimStart = 0; + var delimEnd = 0; + var lastOuterEnd = 0; + var outerStart; + var innerStart; + var leftMatch; + var rightMatch; + var esc; + left = XRegExp(left, basicFlags); + right = XRegExp(right, basicFlags); + + if (escapeChar) { + if (escapeChar.length > 1) { + throw new Error('Cannot use more than one escape character'); + } + + escapeChar = XRegExp.escape(escapeChar); // Example of concatenated `esc` regex: + // `escapeChar`: '%' + // `left`: '<' + // `right`: '>' + // Regex is: /(?:%[\S\s]|(?:(?!<|>)[^%])+)+/ + + esc = new RegExp("(?:".concat(escapeChar, "[\\S\\s]|(?:(?!").concat( // Using `XRegExp.union` safely rewrites backreferences in `left` and `right`. + // Intentionally not passing `basicFlags` to `XRegExp.union` since any syntax + // transformation resulting from those flags was already applied to `left` and + // `right` when they were passed through the XRegExp constructor above. + XRegExp.union([left, right], '', { + conjunction: 'or' + }).source, ")[^").concat(escapeChar, "])+)+"), // Flags `gy` not needed here + flags.replace(/[^imu]+/g, '')); + } + + while (true) { + // If using an escape character, advance to the delimiter's next starting position, + // skipping any escaped characters in between + if (escapeChar) { + delimEnd += (XRegExp.exec(str, esc, delimEnd, 'sticky') || [''])[0].length; + } + + leftMatch = XRegExp.exec(str, left, delimEnd); + rightMatch = XRegExp.exec(str, right, delimEnd); // Keep the leftmost match only + + if (leftMatch && rightMatch) { + if (leftMatch.index <= rightMatch.index) { + rightMatch = null; + } else { + leftMatch = null; + } + } // Paths (LM: leftMatch, RM: rightMatch, OT: openTokens): + // LM | RM | OT | Result + // 1 | 0 | 1 | loop + // 1 | 0 | 0 | loop + // 0 | 1 | 1 | loop + // 0 | 1 | 0 | throw + // 0 | 0 | 1 | throw + // 0 | 0 | 0 | break + // The paths above don't include the sticky mode special case. The loop ends after the + // first completed match if not `global`. + + + if (leftMatch || rightMatch) { + delimStart = (leftMatch || rightMatch).index; + delimEnd = delimStart + (leftMatch || rightMatch)[0].length; + } else if (!openTokens) { + break; + } + + if (sticky && !openTokens && delimStart > lastOuterEnd) { + break; + } + + if (leftMatch) { + if (!openTokens) { + outerStart = delimStart; + innerStart = delimEnd; + } + + ++openTokens; + } else if (rightMatch && openTokens) { + if (! --openTokens) { + if (vN) { + if (vN[0] && outerStart > lastOuterEnd) { + output.push(row(vN[0], str.slice(lastOuterEnd, outerStart), lastOuterEnd, outerStart)); + } + + if (vN[1]) { + output.push(row(vN[1], str.slice(outerStart, innerStart), outerStart, innerStart)); + } + + if (vN[2]) { + output.push(row(vN[2], str.slice(innerStart, delimStart), innerStart, delimStart)); + } + + if (vN[3]) { + output.push(row(vN[3], str.slice(delimStart, delimEnd), delimStart, delimEnd)); + } + } else { + output.push(str.slice(innerStart, delimStart)); + } + + lastOuterEnd = delimEnd; + + if (!global) { + break; + } + } + } else { + throw new Error('Unbalanced delimiter found in string'); + } // If the delimiter matched an empty string, avoid an infinite loop + + + if (delimStart === delimEnd) { + ++delimEnd; + } + } + + if (global && !sticky && vN && vN[0] && str.length > lastOuterEnd) { + output.push(row(vN[0], str.slice(lastOuterEnd), lastOuterEnd, str.length)); + } + + return output; + }; +}; + +exports.default = _default; +module.exports = exports["default"]; +}); + +unwrapExports(matchrecursive); + +var unicodeBase = createCommonjsModule(function (module, exports) { +"use strict"; + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.default = void 0; + +/*! + * XRegExp Unicode Base 4.2.0 + * + * Steven Levithan (c) 2008-present MIT License + */ +var _default = function _default(XRegExp) { + /** + * Adds base support for Unicode matching: + * - Adds syntax `\p{..}` for matching Unicode tokens. Tokens can be inverted using `\P{..}` or + * `\p{^..}`. Token names ignore case, spaces, hyphens, and underscores. You can omit the + * braces for token names that are a single letter (e.g. `\pL` or `PL`). + * - Adds flag A (astral), which enables 21-bit Unicode support. + * - Adds the `XRegExp.addUnicodeData` method used by other addons to provide character data. + * + * Unicode Base relies on externally provided Unicode character data. Official addons are + * available to provide data for Unicode categories, scripts, blocks, and properties. + * + * @requires XRegExp + */ + // ==--------------------------== + // Private stuff + // ==--------------------------== + // Storage for Unicode data + var unicode = {}; // Reuse utils + + var dec = XRegExp._dec; + var hex = XRegExp._hex; + var pad4 = XRegExp._pad4; // Generates a token lookup name: lowercase, with hyphens, spaces, and underscores removed + + function normalize(name) { + return name.replace(/[- _]+/g, '').toLowerCase(); + } // Gets the decimal code of a literal code unit, \xHH, \uHHHH, or a backslash-escaped literal + + + function charCode(chr) { + var esc = /^\\[xu](.+)/.exec(chr); + return esc ? dec(esc[1]) : chr.charCodeAt(chr[0] === '\\' ? 1 : 0); + } // Inverts a list of ordered BMP characters and ranges + + + function invertBmp(range) { + var output = ''; + var lastEnd = -1; + XRegExp.forEach(range, /(\\x..|\\u....|\\?[\s\S])(?:-(\\x..|\\u....|\\?[\s\S]))?/, function (m) { + var start = charCode(m[1]); + + if (start > lastEnd + 1) { + output += "\\u".concat(pad4(hex(lastEnd + 1))); + + if (start > lastEnd + 2) { + output += "-\\u".concat(pad4(hex(start - 1))); + } + } + + lastEnd = charCode(m[2] || m[1]); + }); + + if (lastEnd < 0xFFFF) { + output += "\\u".concat(pad4(hex(lastEnd + 1))); + + if (lastEnd < 0xFFFE) { + output += '-\\uFFFF'; + } + } + + return output; + } // Generates an inverted BMP range on first use + + + function cacheInvertedBmp(slug) { + var prop = 'b!'; + return unicode[slug][prop] || (unicode[slug][prop] = invertBmp(unicode[slug].bmp)); + } // Combines and optionally negates BMP and astral data + + + function buildAstral(slug, isNegated) { + var item = unicode[slug]; + var combined = ''; + + if (item.bmp && !item.isBmpLast) { + combined = "[".concat(item.bmp, "]").concat(item.astral ? '|' : ''); + } + + if (item.astral) { + combined += item.astral; + } + + if (item.isBmpLast && item.bmp) { + combined += "".concat(item.astral ? '|' : '', "[").concat(item.bmp, "]"); + } // Astral Unicode tokens always match a code point, never a code unit + + + return isNegated ? "(?:(?!".concat(combined, ")(?:[\uD800-\uDBFF][\uDC00-\uDFFF]|[\0-\uFFFF]))") : "(?:".concat(combined, ")"); + } // Builds a complete astral pattern on first use + + + function cacheAstral(slug, isNegated) { + var prop = isNegated ? 'a!' : 'a='; + return unicode[slug][prop] || (unicode[slug][prop] = buildAstral(slug, isNegated)); + } // ==--------------------------== + // Core functionality + // ==--------------------------== + + /* + * Add astral mode (flag A) and Unicode token syntax: `\p{..}`, `\P{..}`, `\p{^..}`, `\pC`. + */ + + + XRegExp.addToken( // Use `*` instead of `+` to avoid capturing `^` as the token name in `\p{^}` + /\\([pP])(?:{(\^?)([^}]*)}|([A-Za-z]))/, function (match, scope, flags) { + var ERR_DOUBLE_NEG = 'Invalid double negation '; + var ERR_UNKNOWN_NAME = 'Unknown Unicode token '; + var ERR_UNKNOWN_REF = 'Unicode token missing data '; + var ERR_ASTRAL_ONLY = 'Astral mode required for Unicode token '; + var ERR_ASTRAL_IN_CLASS = 'Astral mode does not support Unicode tokens within character classes'; // Negated via \P{..} or \p{^..} + + var isNegated = match[1] === 'P' || !!match[2]; // Switch from BMP (0-FFFF) to astral (0-10FFFF) mode via flag A + + var isAstralMode = flags.indexOf('A') !== -1; // Token lookup name. Check `[4]` first to avoid passing `undefined` via `\p{}` + + var slug = normalize(match[4] || match[3]); // Token data object + + var item = unicode[slug]; + + if (match[1] === 'P' && match[2]) { + throw new SyntaxError(ERR_DOUBLE_NEG + match[0]); + } + + if (!unicode.hasOwnProperty(slug)) { + throw new SyntaxError(ERR_UNKNOWN_NAME + match[0]); + } // Switch to the negated form of the referenced Unicode token + + + if (item.inverseOf) { + slug = normalize(item.inverseOf); + + if (!unicode.hasOwnProperty(slug)) { + throw new ReferenceError("".concat(ERR_UNKNOWN_REF + match[0], " -> ").concat(item.inverseOf)); + } + + item = unicode[slug]; + isNegated = !isNegated; + } + + if (!(item.bmp || isAstralMode)) { + throw new SyntaxError(ERR_ASTRAL_ONLY + match[0]); + } + + if (isAstralMode) { + if (scope === 'class') { + throw new SyntaxError(ERR_ASTRAL_IN_CLASS); + } + + return cacheAstral(slug, isNegated); + } + + return scope === 'class' ? isNegated ? cacheInvertedBmp(slug) : item.bmp : "".concat((isNegated ? '[^' : '[') + item.bmp, "]"); + }, { + scope: 'all', + optionalFlags: 'A', + leadChar: '\\' + }); + /** + * Adds to the list of Unicode tokens that XRegExp regexes can match via `\p` or `\P`. + * + * @memberOf XRegExp + * @param {Array} data Objects with named character ranges. Each object may have properties + * `name`, `alias`, `isBmpLast`, `inverseOf`, `bmp`, and `astral`. All but `name` are + * optional, although one of `bmp` or `astral` is required (unless `inverseOf` is set). If + * `astral` is absent, the `bmp` data is used for BMP and astral modes. If `bmp` is absent, + * the name errors in BMP mode but works in astral mode. If both `bmp` and `astral` are + * provided, the `bmp` data only is used in BMP mode, and the combination of `bmp` and + * `astral` data is used in astral mode. `isBmpLast` is needed when a token matches orphan + * high surrogates *and* uses surrogate pairs to match astral code points. The `bmp` and + * `astral` data should be a combination of literal characters and `\xHH` or `\uHHHH` escape + * sequences, with hyphens to create ranges. Any regex metacharacters in the data should be + * escaped, apart from range-creating hyphens. The `astral` data can additionally use + * character classes and alternation, and should use surrogate pairs to represent astral code + * points. `inverseOf` can be used to avoid duplicating character data if a Unicode token is + * defined as the exact inverse of another token. + * @example + * + * // Basic use + * XRegExp.addUnicodeData([{ + * name: 'XDigit', + * alias: 'Hexadecimal', + * bmp: '0-9A-Fa-f' + * }]); + * XRegExp('\\p{XDigit}:\\p{Hexadecimal}+').test('0:3D'); // -> true + */ + + XRegExp.addUnicodeData = function (data) { + var ERR_NO_NAME = 'Unicode token requires name'; + var ERR_NO_DATA = 'Unicode token has no character data '; + var _iteratorNormalCompletion = true; + var _didIteratorError = false; + var _iteratorError = undefined; + + try { + for (var _iterator = data[Symbol.iterator](), _step; !(_iteratorNormalCompletion = (_step = _iterator.next()).done); _iteratorNormalCompletion = true) { + var item = _step.value; + + if (!item.name) { + throw new Error(ERR_NO_NAME); + } + + if (!(item.inverseOf || item.bmp || item.astral)) { + throw new Error(ERR_NO_DATA + item.name); + } + + unicode[normalize(item.name)] = item; + + if (item.alias) { + unicode[normalize(item.alias)] = item; + } + } // Reset the pattern cache used by the `XRegExp` constructor, since the same pattern and + // flags might now produce different results + + } catch (err) { + _didIteratorError = true; + _iteratorError = err; + } finally { + try { + if (!_iteratorNormalCompletion && _iterator.return != null) { + _iterator.return(); + } + } finally { + if (_didIteratorError) { + throw _iteratorError; + } + } + } + + XRegExp.cache.flush('patterns'); + }; + /** + * @ignore + * + * Return a reference to the internal Unicode definition structure for the given Unicode + * Property if the given name is a legal Unicode Property for use in XRegExp `\p` or `\P` regex + * constructs. + * + * @memberOf XRegExp + * @param {String} name Name by which the Unicode Property may be recognized (case-insensitive), + * e.g. `'N'` or `'Number'`. The given name is matched against all registered Unicode + * Properties and Property Aliases. + * @returns {Object} Reference to definition structure when the name matches a Unicode Property. + * + * @note + * For more info on Unicode Properties, see also http://unicode.org/reports/tr18/#Categories. + * + * @note + * This method is *not* part of the officially documented API and may change or be removed in + * the future. It is meant for userland code that wishes to reuse the (large) internal Unicode + * structures set up by XRegExp. + */ + + + XRegExp._getUnicodeProperty = function (name) { + var slug = normalize(name); + return unicode[slug]; + }; +}; + +exports.default = _default; +module.exports = exports["default"]; +}); + +unwrapExports(unicodeBase); + +var blocks = [ + { + 'name': 'InAdlam', + 'astral': '\uD83A[\uDD00-\uDD5F]' + }, + { + 'name': 'InAegean_Numbers', + 'astral': '\uD800[\uDD00-\uDD3F]' + }, + { + 'name': 'InAhom', + 'astral': '\uD805[\uDF00-\uDF3F]' + }, + { + 'name': 'InAlchemical_Symbols', + 'astral': '\uD83D[\uDF00-\uDF7F]' + }, + { + 'name': 'InAlphabetic_Presentation_Forms', + 'bmp': '\uFB00-\uFB4F' + }, + { + 'name': 'InAnatolian_Hieroglyphs', + 'astral': '\uD811[\uDC00-\uDE7F]' + }, + { + 'name': 'InAncient_Greek_Musical_Notation', + 'astral': '\uD834[\uDE00-\uDE4F]' + }, + { + 'name': 'InAncient_Greek_Numbers', + 'astral': '\uD800[\uDD40-\uDD8F]' + }, + { + 'name': 'InAncient_Symbols', + 'astral': '\uD800[\uDD90-\uDDCF]' + }, + { + 'name': 'InArabic', + 'bmp': '\u0600-\u06FF' + }, + { + 'name': 'InArabic_Extended_A', + 'bmp': '\u08A0-\u08FF' + }, + { + 'name': 'InArabic_Mathematical_Alphabetic_Symbols', + 'astral': '\uD83B[\uDE00-\uDEFF]' + }, + { + 'name': 'InArabic_Presentation_Forms_A', + 'bmp': '\uFB50-\uFDFF' + }, + { + 'name': 'InArabic_Presentation_Forms_B', + 'bmp': '\uFE70-\uFEFF' + }, + { + 'name': 'InArabic_Supplement', + 'bmp': '\u0750-\u077F' + }, + { + 'name': 'InArmenian', + 'bmp': '\u0530-\u058F' + }, + { + 'name': 'InArrows', + 'bmp': '\u2190-\u21FF' + }, + { + 'name': 'InAvestan', + 'astral': '\uD802[\uDF00-\uDF3F]' + }, + { + 'name': 'InBalinese', + 'bmp': '\u1B00-\u1B7F' + }, + { + 'name': 'InBamum', + 'bmp': '\uA6A0-\uA6FF' + }, + { + 'name': 'InBamum_Supplement', + 'astral': '\uD81A[\uDC00-\uDE3F]' + }, + { + 'name': 'InBasic_Latin', + 'bmp': '\0-\x7F' + }, + { + 'name': 'InBassa_Vah', + 'astral': '\uD81A[\uDED0-\uDEFF]' + }, + { + 'name': 'InBatak', + 'bmp': '\u1BC0-\u1BFF' + }, + { + 'name': 'InBengali', + 'bmp': '\u0980-\u09FF' + }, + { + 'name': 'InBhaiksuki', + 'astral': '\uD807[\uDC00-\uDC6F]' + }, + { + 'name': 'InBlock_Elements', + 'bmp': '\u2580-\u259F' + }, + { + 'name': 'InBopomofo', + 'bmp': '\u3100-\u312F' + }, + { + 'name': 'InBopomofo_Extended', + 'bmp': '\u31A0-\u31BF' + }, + { + 'name': 'InBox_Drawing', + 'bmp': '\u2500-\u257F' + }, + { + 'name': 'InBrahmi', + 'astral': '\uD804[\uDC00-\uDC7F]' + }, + { + 'name': 'InBraille_Patterns', + 'bmp': '\u2800-\u28FF' + }, + { + 'name': 'InBuginese', + 'bmp': '\u1A00-\u1A1F' + }, + { + 'name': 'InBuhid', + 'bmp': '\u1740-\u175F' + }, + { + 'name': 'InByzantine_Musical_Symbols', + 'astral': '\uD834[\uDC00-\uDCFF]' + }, + { + 'name': 'InCJK_Compatibility', + 'bmp': '\u3300-\u33FF' + }, + { + 'name': 'InCJK_Compatibility_Forms', + 'bmp': '\uFE30-\uFE4F' + }, + { + 'name': 'InCJK_Compatibility_Ideographs', + 'bmp': '\uF900-\uFAFF' + }, + { + 'name': 'InCJK_Compatibility_Ideographs_Supplement', + 'astral': '\uD87E[\uDC00-\uDE1F]' + }, + { + 'name': 'InCJK_Radicals_Supplement', + 'bmp': '\u2E80-\u2EFF' + }, + { + 'name': 'InCJK_Strokes', + 'bmp': '\u31C0-\u31EF' + }, + { + 'name': 'InCJK_Symbols_And_Punctuation', + 'bmp': '\u3000-\u303F' + }, + { + 'name': 'InCJK_Unified_Ideographs', + 'bmp': '\u4E00-\u9FFF' + }, + { + 'name': 'InCJK_Unified_Ideographs_Extension_A', + 'bmp': '\u3400-\u4DBF' + }, + { + 'name': 'InCJK_Unified_Ideographs_Extension_B', + 'astral': '[\uD840-\uD868][\uDC00-\uDFFF]|\uD869[\uDC00-\uDEDF]' + }, + { + 'name': 'InCJK_Unified_Ideographs_Extension_C', + 'astral': '\uD869[\uDF00-\uDFFF]|[\uD86A-\uD86C][\uDC00-\uDFFF]|\uD86D[\uDC00-\uDF3F]' + }, + { + 'name': 'InCJK_Unified_Ideographs_Extension_D', + 'astral': '\uD86D[\uDF40-\uDFFF]|\uD86E[\uDC00-\uDC1F]' + }, + { + 'name': 'InCJK_Unified_Ideographs_Extension_E', + 'astral': '\uD86E[\uDC20-\uDFFF]|[\uD86F-\uD872][\uDC00-\uDFFF]|\uD873[\uDC00-\uDEAF]' + }, + { + 'name': 'InCJK_Unified_Ideographs_Extension_F', + 'astral': '\uD873[\uDEB0-\uDFFF]|[\uD874-\uD879][\uDC00-\uDFFF]|\uD87A[\uDC00-\uDFEF]' + }, + { + 'name': 'InCarian', + 'astral': '\uD800[\uDEA0-\uDEDF]' + }, + { + 'name': 'InCaucasian_Albanian', + 'astral': '\uD801[\uDD30-\uDD6F]' + }, + { + 'name': 'InChakma', + 'astral': '\uD804[\uDD00-\uDD4F]' + }, + { + 'name': 'InCham', + 'bmp': '\uAA00-\uAA5F' + }, + { + 'name': 'InCherokee', + 'bmp': '\u13A0-\u13FF' + }, + { + 'name': 'InCherokee_Supplement', + 'bmp': '\uAB70-\uABBF' + }, + { + 'name': 'InChess_Symbols', + 'astral': '\uD83E[\uDE00-\uDE6F]' + }, + { + 'name': 'InCombining_Diacritical_Marks', + 'bmp': '\u0300-\u036F' + }, + { + 'name': 'InCombining_Diacritical_Marks_Extended', + 'bmp': '\u1AB0-\u1AFF' + }, + { + 'name': 'InCombining_Diacritical_Marks_For_Symbols', + 'bmp': '\u20D0-\u20FF' + }, + { + 'name': 'InCombining_Diacritical_Marks_Supplement', + 'bmp': '\u1DC0-\u1DFF' + }, + { + 'name': 'InCombining_Half_Marks', + 'bmp': '\uFE20-\uFE2F' + }, + { + 'name': 'InCommon_Indic_Number_Forms', + 'bmp': '\uA830-\uA83F' + }, + { + 'name': 'InControl_Pictures', + 'bmp': '\u2400-\u243F' + }, + { + 'name': 'InCoptic', + 'bmp': '\u2C80-\u2CFF' + }, + { + 'name': 'InCoptic_Epact_Numbers', + 'astral': '\uD800[\uDEE0-\uDEFF]' + }, + { + 'name': 'InCounting_Rod_Numerals', + 'astral': '\uD834[\uDF60-\uDF7F]' + }, + { + 'name': 'InCuneiform', + 'astral': '\uD808[\uDC00-\uDFFF]' + }, + { + 'name': 'InCuneiform_Numbers_And_Punctuation', + 'astral': '\uD809[\uDC00-\uDC7F]' + }, + { + 'name': 'InCurrency_Symbols', + 'bmp': '\u20A0-\u20CF' + }, + { + 'name': 'InCypriot_Syllabary', + 'astral': '\uD802[\uDC00-\uDC3F]' + }, + { + 'name': 'InCyrillic', + 'bmp': '\u0400-\u04FF' + }, + { + 'name': 'InCyrillic_Extended_A', + 'bmp': '\u2DE0-\u2DFF' + }, + { + 'name': 'InCyrillic_Extended_B', + 'bmp': '\uA640-\uA69F' + }, + { + 'name': 'InCyrillic_Extended_C', + 'bmp': '\u1C80-\u1C8F' + }, + { + 'name': 'InCyrillic_Supplement', + 'bmp': '\u0500-\u052F' + }, + { + 'name': 'InDeseret', + 'astral': '\uD801[\uDC00-\uDC4F]' + }, + { + 'name': 'InDevanagari', + 'bmp': '\u0900-\u097F' + }, + { + 'name': 'InDevanagari_Extended', + 'bmp': '\uA8E0-\uA8FF' + }, + { + 'name': 'InDingbats', + 'bmp': '\u2700-\u27BF' + }, + { + 'name': 'InDogra', + 'astral': '\uD806[\uDC00-\uDC4F]' + }, + { + 'name': 'InDomino_Tiles', + 'astral': '\uD83C[\uDC30-\uDC9F]' + }, + { + 'name': 'InDuployan', + 'astral': '\uD82F[\uDC00-\uDC9F]' + }, + { + 'name': 'InEarly_Dynastic_Cuneiform', + 'astral': '\uD809[\uDC80-\uDD4F]' + }, + { + 'name': 'InEgyptian_Hieroglyphs', + 'astral': '\uD80C[\uDC00-\uDFFF]|\uD80D[\uDC00-\uDC2F]' + }, + { + 'name': 'InElbasan', + 'astral': '\uD801[\uDD00-\uDD2F]' + }, + { + 'name': 'InEmoticons', + 'astral': '\uD83D[\uDE00-\uDE4F]' + }, + { + 'name': 'InEnclosed_Alphanumeric_Supplement', + 'astral': '\uD83C[\uDD00-\uDDFF]' + }, + { + 'name': 'InEnclosed_Alphanumerics', + 'bmp': '\u2460-\u24FF' + }, + { + 'name': 'InEnclosed_CJK_Letters_And_Months', + 'bmp': '\u3200-\u32FF' + }, + { + 'name': 'InEnclosed_Ideographic_Supplement', + 'astral': '\uD83C[\uDE00-\uDEFF]' + }, + { + 'name': 'InEthiopic', + 'bmp': '\u1200-\u137F' + }, + { + 'name': 'InEthiopic_Extended', + 'bmp': '\u2D80-\u2DDF' + }, + { + 'name': 'InEthiopic_Extended_A', + 'bmp': '\uAB00-\uAB2F' + }, + { + 'name': 'InEthiopic_Supplement', + 'bmp': '\u1380-\u139F' + }, + { + 'name': 'InGeneral_Punctuation', + 'bmp': '\u2000-\u206F' + }, + { + 'name': 'InGeometric_Shapes', + 'bmp': '\u25A0-\u25FF' + }, + { + 'name': 'InGeometric_Shapes_Extended', + 'astral': '\uD83D[\uDF80-\uDFFF]' + }, + { + 'name': 'InGeorgian', + 'bmp': '\u10A0-\u10FF' + }, + { + 'name': 'InGeorgian_Extended', + 'bmp': '\u1C90-\u1CBF' + }, + { + 'name': 'InGeorgian_Supplement', + 'bmp': '\u2D00-\u2D2F' + }, + { + 'name': 'InGlagolitic', + 'bmp': '\u2C00-\u2C5F' + }, + { + 'name': 'InGlagolitic_Supplement', + 'astral': '\uD838[\uDC00-\uDC2F]' + }, + { + 'name': 'InGothic', + 'astral': '\uD800[\uDF30-\uDF4F]' + }, + { + 'name': 'InGrantha', + 'astral': '\uD804[\uDF00-\uDF7F]' + }, + { + 'name': 'InGreek_And_Coptic', + 'bmp': '\u0370-\u03FF' + }, + { + 'name': 'InGreek_Extended', + 'bmp': '\u1F00-\u1FFF' + }, + { + 'name': 'InGujarati', + 'bmp': '\u0A80-\u0AFF' + }, + { + 'name': 'InGunjala_Gondi', + 'astral': '\uD807[\uDD60-\uDDAF]' + }, + { + 'name': 'InGurmukhi', + 'bmp': '\u0A00-\u0A7F' + }, + { + 'name': 'InHalfwidth_And_Fullwidth_Forms', + 'bmp': '\uFF00-\uFFEF' + }, + { + 'name': 'InHangul_Compatibility_Jamo', + 'bmp': '\u3130-\u318F' + }, + { + 'name': 'InHangul_Jamo', + 'bmp': '\u1100-\u11FF' + }, + { + 'name': 'InHangul_Jamo_Extended_A', + 'bmp': '\uA960-\uA97F' + }, + { + 'name': 'InHangul_Jamo_Extended_B', + 'bmp': '\uD7B0-\uD7FF' + }, + { + 'name': 'InHangul_Syllables', + 'bmp': '\uAC00-\uD7AF' + }, + { + 'name': 'InHanifi_Rohingya', + 'astral': '\uD803[\uDD00-\uDD3F]' + }, + { + 'name': 'InHanunoo', + 'bmp': '\u1720-\u173F' + }, + { + 'name': 'InHatran', + 'astral': '\uD802[\uDCE0-\uDCFF]' + }, + { + 'name': 'InHebrew', + 'bmp': '\u0590-\u05FF' + }, + { + 'name': 'InHigh_Private_Use_Surrogates', + 'bmp': '\uDB80-\uDBFF' + }, + { + 'name': 'InHigh_Surrogates', + 'bmp': '\uD800-\uDB7F' + }, + { + 'name': 'InHiragana', + 'bmp': '\u3040-\u309F' + }, + { + 'name': 'InIPA_Extensions', + 'bmp': '\u0250-\u02AF' + }, + { + 'name': 'InIdeographic_Description_Characters', + 'bmp': '\u2FF0-\u2FFF' + }, + { + 'name': 'InIdeographic_Symbols_And_Punctuation', + 'astral': '\uD81B[\uDFE0-\uDFFF]' + }, + { + 'name': 'InImperial_Aramaic', + 'astral': '\uD802[\uDC40-\uDC5F]' + }, + { + 'name': 'InIndic_Siyaq_Numbers', + 'astral': '\uD83B[\uDC70-\uDCBF]' + }, + { + 'name': 'InInscriptional_Pahlavi', + 'astral': '\uD802[\uDF60-\uDF7F]' + }, + { + 'name': 'InInscriptional_Parthian', + 'astral': '\uD802[\uDF40-\uDF5F]' + }, + { + 'name': 'InJavanese', + 'bmp': '\uA980-\uA9DF' + }, + { + 'name': 'InKaithi', + 'astral': '\uD804[\uDC80-\uDCCF]' + }, + { + 'name': 'InKana_Extended_A', + 'astral': '\uD82C[\uDD00-\uDD2F]' + }, + { + 'name': 'InKana_Supplement', + 'astral': '\uD82C[\uDC00-\uDCFF]' + }, + { + 'name': 'InKanbun', + 'bmp': '\u3190-\u319F' + }, + { + 'name': 'InKangxi_Radicals', + 'bmp': '\u2F00-\u2FDF' + }, + { + 'name': 'InKannada', + 'bmp': '\u0C80-\u0CFF' + }, + { + 'name': 'InKatakana', + 'bmp': '\u30A0-\u30FF' + }, + { + 'name': 'InKatakana_Phonetic_Extensions', + 'bmp': '\u31F0-\u31FF' + }, + { + 'name': 'InKayah_Li', + 'bmp': '\uA900-\uA92F' + }, + { + 'name': 'InKharoshthi', + 'astral': '\uD802[\uDE00-\uDE5F]' + }, + { + 'name': 'InKhmer', + 'bmp': '\u1780-\u17FF' + }, + { + 'name': 'InKhmer_Symbols', + 'bmp': '\u19E0-\u19FF' + }, + { + 'name': 'InKhojki', + 'astral': '\uD804[\uDE00-\uDE4F]' + }, + { + 'name': 'InKhudawadi', + 'astral': '\uD804[\uDEB0-\uDEFF]' + }, + { + 'name': 'InLao', + 'bmp': '\u0E80-\u0EFF' + }, + { + 'name': 'InLatin_1_Supplement', + 'bmp': '\x80-\xFF' + }, + { + 'name': 'InLatin_Extended_A', + 'bmp': '\u0100-\u017F' + }, + { + 'name': 'InLatin_Extended_Additional', + 'bmp': '\u1E00-\u1EFF' + }, + { + 'name': 'InLatin_Extended_B', + 'bmp': '\u0180-\u024F' + }, + { + 'name': 'InLatin_Extended_C', + 'bmp': '\u2C60-\u2C7F' + }, + { + 'name': 'InLatin_Extended_D', + 'bmp': '\uA720-\uA7FF' + }, + { + 'name': 'InLatin_Extended_E', + 'bmp': '\uAB30-\uAB6F' + }, + { + 'name': 'InLepcha', + 'bmp': '\u1C00-\u1C4F' + }, + { + 'name': 'InLetterlike_Symbols', + 'bmp': '\u2100-\u214F' + }, + { + 'name': 'InLimbu', + 'bmp': '\u1900-\u194F' + }, + { + 'name': 'InLinear_A', + 'astral': '\uD801[\uDE00-\uDF7F]' + }, + { + 'name': 'InLinear_B_Ideograms', + 'astral': '\uD800[\uDC80-\uDCFF]' + }, + { + 'name': 'InLinear_B_Syllabary', + 'astral': '\uD800[\uDC00-\uDC7F]' + }, + { + 'name': 'InLisu', + 'bmp': '\uA4D0-\uA4FF' + }, + { + 'name': 'InLow_Surrogates', + 'bmp': '\uDC00-\uDFFF' + }, + { + 'name': 'InLycian', + 'astral': '\uD800[\uDE80-\uDE9F]' + }, + { + 'name': 'InLydian', + 'astral': '\uD802[\uDD20-\uDD3F]' + }, + { + 'name': 'InMahajani', + 'astral': '\uD804[\uDD50-\uDD7F]' + }, + { + 'name': 'InMahjong_Tiles', + 'astral': '\uD83C[\uDC00-\uDC2F]' + }, + { + 'name': 'InMakasar', + 'astral': '\uD807[\uDEE0-\uDEFF]' + }, + { + 'name': 'InMalayalam', + 'bmp': '\u0D00-\u0D7F' + }, + { + 'name': 'InMandaic', + 'bmp': '\u0840-\u085F' + }, + { + 'name': 'InManichaean', + 'astral': '\uD802[\uDEC0-\uDEFF]' + }, + { + 'name': 'InMarchen', + 'astral': '\uD807[\uDC70-\uDCBF]' + }, + { + 'name': 'InMasaram_Gondi', + 'astral': '\uD807[\uDD00-\uDD5F]' + }, + { + 'name': 'InMathematical_Alphanumeric_Symbols', + 'astral': '\uD835[\uDC00-\uDFFF]' + }, + { + 'name': 'InMathematical_Operators', + 'bmp': '\u2200-\u22FF' + }, + { + 'name': 'InMayan_Numerals', + 'astral': '\uD834[\uDEE0-\uDEFF]' + }, + { + 'name': 'InMedefaidrin', + 'astral': '\uD81B[\uDE40-\uDE9F]' + }, + { + 'name': 'InMeetei_Mayek', + 'bmp': '\uABC0-\uABFF' + }, + { + 'name': 'InMeetei_Mayek_Extensions', + 'bmp': '\uAAE0-\uAAFF' + }, + { + 'name': 'InMende_Kikakui', + 'astral': '\uD83A[\uDC00-\uDCDF]' + }, + { + 'name': 'InMeroitic_Cursive', + 'astral': '\uD802[\uDDA0-\uDDFF]' + }, + { + 'name': 'InMeroitic_Hieroglyphs', + 'astral': '\uD802[\uDD80-\uDD9F]' + }, + { + 'name': 'InMiao', + 'astral': '\uD81B[\uDF00-\uDF9F]' + }, + { + 'name': 'InMiscellaneous_Mathematical_Symbols_A', + 'bmp': '\u27C0-\u27EF' + }, + { + 'name': 'InMiscellaneous_Mathematical_Symbols_B', + 'bmp': '\u2980-\u29FF' + }, + { + 'name': 'InMiscellaneous_Symbols', + 'bmp': '\u2600-\u26FF' + }, + { + 'name': 'InMiscellaneous_Symbols_And_Arrows', + 'bmp': '\u2B00-\u2BFF' + }, + { + 'name': 'InMiscellaneous_Symbols_And_Pictographs', + 'astral': '\uD83C[\uDF00-\uDFFF]|\uD83D[\uDC00-\uDDFF]' + }, + { + 'name': 'InMiscellaneous_Technical', + 'bmp': '\u2300-\u23FF' + }, + { + 'name': 'InModi', + 'astral': '\uD805[\uDE00-\uDE5F]' + }, + { + 'name': 'InModifier_Tone_Letters', + 'bmp': '\uA700-\uA71F' + }, + { + 'name': 'InMongolian', + 'bmp': '\u1800-\u18AF' + }, + { + 'name': 'InMongolian_Supplement', + 'astral': '\uD805[\uDE60-\uDE7F]' + }, + { + 'name': 'InMro', + 'astral': '\uD81A[\uDE40-\uDE6F]' + }, + { + 'name': 'InMultani', + 'astral': '\uD804[\uDE80-\uDEAF]' + }, + { + 'name': 'InMusical_Symbols', + 'astral': '\uD834[\uDD00-\uDDFF]' + }, + { + 'name': 'InMyanmar', + 'bmp': '\u1000-\u109F' + }, + { + 'name': 'InMyanmar_Extended_A', + 'bmp': '\uAA60-\uAA7F' + }, + { + 'name': 'InMyanmar_Extended_B', + 'bmp': '\uA9E0-\uA9FF' + }, + { + 'name': 'InNKo', + 'bmp': '\u07C0-\u07FF' + }, + { + 'name': 'InNabataean', + 'astral': '\uD802[\uDC80-\uDCAF]' + }, + { + 'name': 'InNew_Tai_Lue', + 'bmp': '\u1980-\u19DF' + }, + { + 'name': 'InNewa', + 'astral': '\uD805[\uDC00-\uDC7F]' + }, + { + 'name': 'InNumber_Forms', + 'bmp': '\u2150-\u218F' + }, + { + 'name': 'InNushu', + 'astral': '\uD82C[\uDD70-\uDEFF]' + }, + { + 'name': 'InOgham', + 'bmp': '\u1680-\u169F' + }, + { + 'name': 'InOl_Chiki', + 'bmp': '\u1C50-\u1C7F' + }, + { + 'name': 'InOld_Hungarian', + 'astral': '\uD803[\uDC80-\uDCFF]' + }, + { + 'name': 'InOld_Italic', + 'astral': '\uD800[\uDF00-\uDF2F]' + }, + { + 'name': 'InOld_North_Arabian', + 'astral': '\uD802[\uDE80-\uDE9F]' + }, + { + 'name': 'InOld_Permic', + 'astral': '\uD800[\uDF50-\uDF7F]' + }, + { + 'name': 'InOld_Persian', + 'astral': '\uD800[\uDFA0-\uDFDF]' + }, + { + 'name': 'InOld_Sogdian', + 'astral': '\uD803[\uDF00-\uDF2F]' + }, + { + 'name': 'InOld_South_Arabian', + 'astral': '\uD802[\uDE60-\uDE7F]' + }, + { + 'name': 'InOld_Turkic', + 'astral': '\uD803[\uDC00-\uDC4F]' + }, + { + 'name': 'InOptical_Character_Recognition', + 'bmp': '\u2440-\u245F' + }, + { + 'name': 'InOriya', + 'bmp': '\u0B00-\u0B7F' + }, + { + 'name': 'InOrnamental_Dingbats', + 'astral': '\uD83D[\uDE50-\uDE7F]' + }, + { + 'name': 'InOsage', + 'astral': '\uD801[\uDCB0-\uDCFF]' + }, + { + 'name': 'InOsmanya', + 'astral': '\uD801[\uDC80-\uDCAF]' + }, + { + 'name': 'InPahawh_Hmong', + 'astral': '\uD81A[\uDF00-\uDF8F]' + }, + { + 'name': 'InPalmyrene', + 'astral': '\uD802[\uDC60-\uDC7F]' + }, + { + 'name': 'InPau_Cin_Hau', + 'astral': '\uD806[\uDEC0-\uDEFF]' + }, + { + 'name': 'InPhags_Pa', + 'bmp': '\uA840-\uA87F' + }, + { + 'name': 'InPhaistos_Disc', + 'astral': '\uD800[\uDDD0-\uDDFF]' + }, + { + 'name': 'InPhoenician', + 'astral': '\uD802[\uDD00-\uDD1F]' + }, + { + 'name': 'InPhonetic_Extensions', + 'bmp': '\u1D00-\u1D7F' + }, + { + 'name': 'InPhonetic_Extensions_Supplement', + 'bmp': '\u1D80-\u1DBF' + }, + { + 'name': 'InPlaying_Cards', + 'astral': '\uD83C[\uDCA0-\uDCFF]' + }, + { + 'name': 'InPrivate_Use_Area', + 'bmp': '\uE000-\uF8FF' + }, + { + 'name': 'InPsalter_Pahlavi', + 'astral': '\uD802[\uDF80-\uDFAF]' + }, + { + 'name': 'InRejang', + 'bmp': '\uA930-\uA95F' + }, + { + 'name': 'InRumi_Numeral_Symbols', + 'astral': '\uD803[\uDE60-\uDE7F]' + }, + { + 'name': 'InRunic', + 'bmp': '\u16A0-\u16FF' + }, + { + 'name': 'InSamaritan', + 'bmp': '\u0800-\u083F' + }, + { + 'name': 'InSaurashtra', + 'bmp': '\uA880-\uA8DF' + }, + { + 'name': 'InSharada', + 'astral': '\uD804[\uDD80-\uDDDF]' + }, + { + 'name': 'InShavian', + 'astral': '\uD801[\uDC50-\uDC7F]' + }, + { + 'name': 'InShorthand_Format_Controls', + 'astral': '\uD82F[\uDCA0-\uDCAF]' + }, + { + 'name': 'InSiddham', + 'astral': '\uD805[\uDD80-\uDDFF]' + }, + { + 'name': 'InSinhala', + 'bmp': '\u0D80-\u0DFF' + }, + { + 'name': 'InSinhala_Archaic_Numbers', + 'astral': '\uD804[\uDDE0-\uDDFF]' + }, + { + 'name': 'InSmall_Form_Variants', + 'bmp': '\uFE50-\uFE6F' + }, + { + 'name': 'InSogdian', + 'astral': '\uD803[\uDF30-\uDF6F]' + }, + { + 'name': 'InSora_Sompeng', + 'astral': '\uD804[\uDCD0-\uDCFF]' + }, + { + 'name': 'InSoyombo', + 'astral': '\uD806[\uDE50-\uDEAF]' + }, + { + 'name': 'InSpacing_Modifier_Letters', + 'bmp': '\u02B0-\u02FF' + }, + { + 'name': 'InSpecials', + 'bmp': '\uFFF0-\uFFFF' + }, + { + 'name': 'InSundanese', + 'bmp': '\u1B80-\u1BBF' + }, + { + 'name': 'InSundanese_Supplement', + 'bmp': '\u1CC0-\u1CCF' + }, + { + 'name': 'InSuperscripts_And_Subscripts', + 'bmp': '\u2070-\u209F' + }, + { + 'name': 'InSupplemental_Arrows_A', + 'bmp': '\u27F0-\u27FF' + }, + { + 'name': 'InSupplemental_Arrows_B', + 'bmp': '\u2900-\u297F' + }, + { + 'name': 'InSupplemental_Arrows_C', + 'astral': '\uD83E[\uDC00-\uDCFF]' + }, + { + 'name': 'InSupplemental_Mathematical_Operators', + 'bmp': '\u2A00-\u2AFF' + }, + { + 'name': 'InSupplemental_Punctuation', + 'bmp': '\u2E00-\u2E7F' + }, + { + 'name': 'InSupplemental_Symbols_And_Pictographs', + 'astral': '\uD83E[\uDD00-\uDDFF]' + }, + { + 'name': 'InSupplementary_Private_Use_Area_A', + 'astral': '[\uDB80-\uDBBF][\uDC00-\uDFFF]' + }, + { + 'name': 'InSupplementary_Private_Use_Area_B', + 'astral': '[\uDBC0-\uDBFF][\uDC00-\uDFFF]' + }, + { + 'name': 'InSutton_SignWriting', + 'astral': '\uD836[\uDC00-\uDEAF]' + }, + { + 'name': 'InSyloti_Nagri', + 'bmp': '\uA800-\uA82F' + }, + { + 'name': 'InSyriac', + 'bmp': '\u0700-\u074F' + }, + { + 'name': 'InSyriac_Supplement', + 'bmp': '\u0860-\u086F' + }, + { + 'name': 'InTagalog', + 'bmp': '\u1700-\u171F' + }, + { + 'name': 'InTagbanwa', + 'bmp': '\u1760-\u177F' + }, + { + 'name': 'InTags', + 'astral': '\uDB40[\uDC00-\uDC7F]' + }, + { + 'name': 'InTai_Le', + 'bmp': '\u1950-\u197F' + }, + { + 'name': 'InTai_Tham', + 'bmp': '\u1A20-\u1AAF' + }, + { + 'name': 'InTai_Viet', + 'bmp': '\uAA80-\uAADF' + }, + { + 'name': 'InTai_Xuan_Jing_Symbols', + 'astral': '\uD834[\uDF00-\uDF5F]' + }, + { + 'name': 'InTakri', + 'astral': '\uD805[\uDE80-\uDECF]' + }, + { + 'name': 'InTamil', + 'bmp': '\u0B80-\u0BFF' + }, + { + 'name': 'InTangut', + 'astral': '[\uD81C-\uD821][\uDC00-\uDFFF]' + }, + { + 'name': 'InTangut_Components', + 'astral': '\uD822[\uDC00-\uDEFF]' + }, + { + 'name': 'InTelugu', + 'bmp': '\u0C00-\u0C7F' + }, + { + 'name': 'InThaana', + 'bmp': '\u0780-\u07BF' + }, + { + 'name': 'InThai', + 'bmp': '\u0E00-\u0E7F' + }, + { + 'name': 'InTibetan', + 'bmp': '\u0F00-\u0FFF' + }, + { + 'name': 'InTifinagh', + 'bmp': '\u2D30-\u2D7F' + }, + { + 'name': 'InTirhuta', + 'astral': '\uD805[\uDC80-\uDCDF]' + }, + { + 'name': 'InTransport_And_Map_Symbols', + 'astral': '\uD83D[\uDE80-\uDEFF]' + }, + { + 'name': 'InUgaritic', + 'astral': '\uD800[\uDF80-\uDF9F]' + }, + { + 'name': 'InUnified_Canadian_Aboriginal_Syllabics', + 'bmp': '\u1400-\u167F' + }, + { + 'name': 'InUnified_Canadian_Aboriginal_Syllabics_Extended', + 'bmp': '\u18B0-\u18FF' + }, + { + 'name': 'InVai', + 'bmp': '\uA500-\uA63F' + }, + { + 'name': 'InVariation_Selectors', + 'bmp': '\uFE00-\uFE0F' + }, + { + 'name': 'InVariation_Selectors_Supplement', + 'astral': '\uDB40[\uDD00-\uDDEF]' + }, + { + 'name': 'InVedic_Extensions', + 'bmp': '\u1CD0-\u1CFF' + }, + { + 'name': 'InVertical_Forms', + 'bmp': '\uFE10-\uFE1F' + }, + { + 'name': 'InWarang_Citi', + 'astral': '\uD806[\uDCA0-\uDCFF]' + }, + { + 'name': 'InYi_Radicals', + 'bmp': '\uA490-\uA4CF' + }, + { + 'name': 'InYi_Syllables', + 'bmp': '\uA000-\uA48F' + }, + { + 'name': 'InYijing_Hexagram_Symbols', + 'bmp': '\u4DC0-\u4DFF' + }, + { + 'name': 'InZanabazar_Square', + 'astral': '\uD806[\uDE00-\uDE4F]' + } +]; + +var unicodeBlocks = createCommonjsModule(function (module, exports) { +"use strict"; + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.default = void 0; + +var _blocks = _interopRequireDefault(blocks); + +function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } + +/*! + * XRegExp Unicode Blocks 4.2.0 + * + * Steven Levithan (c) 2010-present MIT License + * Unicode data by Mathias Bynens + */ +var _default = function _default(XRegExp) { + /** + * Adds support for all Unicode blocks. Block names use the prefix 'In'. E.g., + * `\p{InBasicLatin}`. Token names are case insensitive, and any spaces, hyphens, and + * underscores are ignored. + * + * Uses Unicode 11.0.0. + * + * @requires XRegExp, Unicode Base + */ + if (!XRegExp.addUnicodeData) { + throw new ReferenceError('Unicode Base must be loaded before Unicode Blocks'); + } + + XRegExp.addUnicodeData(_blocks.default); +}; + +exports.default = _default; +module.exports = exports["default"]; +}); + +unwrapExports(unicodeBlocks); + +var categories = [ + { + 'name': 'C', + 'alias': 'Other', + 'isBmpLast': true, + 'bmp': '\0-\x1F\x7F-\x9F\xAD\u0378\u0379\u0380-\u0383\u038B\u038D\u03A2\u0530\u0557\u0558\u058B\u058C\u0590\u05C8-\u05CF\u05EB-\u05EE\u05F5-\u0605\u061C\u061D\u06DD\u070E\u070F\u074B\u074C\u07B2-\u07BF\u07FB\u07FC\u082E\u082F\u083F\u085C\u085D\u085F\u086B-\u089F\u08B5\u08BE-\u08D2\u08E2\u0984\u098D\u098E\u0991\u0992\u09A9\u09B1\u09B3-\u09B5\u09BA\u09BB\u09C5\u09C6\u09C9\u09CA\u09CF-\u09D6\u09D8-\u09DB\u09DE\u09E4\u09E5\u09FF\u0A00\u0A04\u0A0B-\u0A0E\u0A11\u0A12\u0A29\u0A31\u0A34\u0A37\u0A3A\u0A3B\u0A3D\u0A43-\u0A46\u0A49\u0A4A\u0A4E-\u0A50\u0A52-\u0A58\u0A5D\u0A5F-\u0A65\u0A77-\u0A80\u0A84\u0A8E\u0A92\u0AA9\u0AB1\u0AB4\u0ABA\u0ABB\u0AC6\u0ACA\u0ACE\u0ACF\u0AD1-\u0ADF\u0AE4\u0AE5\u0AF2-\u0AF8\u0B00\u0B04\u0B0D\u0B0E\u0B11\u0B12\u0B29\u0B31\u0B34\u0B3A\u0B3B\u0B45\u0B46\u0B49\u0B4A\u0B4E-\u0B55\u0B58-\u0B5B\u0B5E\u0B64\u0B65\u0B78-\u0B81\u0B84\u0B8B-\u0B8D\u0B91\u0B96-\u0B98\u0B9B\u0B9D\u0BA0-\u0BA2\u0BA5-\u0BA7\u0BAB-\u0BAD\u0BBA-\u0BBD\u0BC3-\u0BC5\u0BC9\u0BCE\u0BCF\u0BD1-\u0BD6\u0BD8-\u0BE5\u0BFB-\u0BFF\u0C0D\u0C11\u0C29\u0C3A-\u0C3C\u0C45\u0C49\u0C4E-\u0C54\u0C57\u0C5B-\u0C5F\u0C64\u0C65\u0C70-\u0C77\u0C8D\u0C91\u0CA9\u0CB4\u0CBA\u0CBB\u0CC5\u0CC9\u0CCE-\u0CD4\u0CD7-\u0CDD\u0CDF\u0CE4\u0CE5\u0CF0\u0CF3-\u0CFF\u0D04\u0D0D\u0D11\u0D45\u0D49\u0D50-\u0D53\u0D64\u0D65\u0D80\u0D81\u0D84\u0D97-\u0D99\u0DB2\u0DBC\u0DBE\u0DBF\u0DC7-\u0DC9\u0DCB-\u0DCE\u0DD5\u0DD7\u0DE0-\u0DE5\u0DF0\u0DF1\u0DF5-\u0E00\u0E3B-\u0E3E\u0E5C-\u0E80\u0E83\u0E85\u0E86\u0E89\u0E8B\u0E8C\u0E8E-\u0E93\u0E98\u0EA0\u0EA4\u0EA6\u0EA8\u0EA9\u0EAC\u0EBA\u0EBE\u0EBF\u0EC5\u0EC7\u0ECE\u0ECF\u0EDA\u0EDB\u0EE0-\u0EFF\u0F48\u0F6D-\u0F70\u0F98\u0FBD\u0FCD\u0FDB-\u0FFF\u10C6\u10C8-\u10CC\u10CE\u10CF\u1249\u124E\u124F\u1257\u1259\u125E\u125F\u1289\u128E\u128F\u12B1\u12B6\u12B7\u12BF\u12C1\u12C6\u12C7\u12D7\u1311\u1316\u1317\u135B\u135C\u137D-\u137F\u139A-\u139F\u13F6\u13F7\u13FE\u13FF\u169D-\u169F\u16F9-\u16FF\u170D\u1715-\u171F\u1737-\u173F\u1754-\u175F\u176D\u1771\u1774-\u177F\u17DE\u17DF\u17EA-\u17EF\u17FA-\u17FF\u180E\u180F\u181A-\u181F\u1879-\u187F\u18AB-\u18AF\u18F6-\u18FF\u191F\u192C-\u192F\u193C-\u193F\u1941-\u1943\u196E\u196F\u1975-\u197F\u19AC-\u19AF\u19CA-\u19CF\u19DB-\u19DD\u1A1C\u1A1D\u1A5F\u1A7D\u1A7E\u1A8A-\u1A8F\u1A9A-\u1A9F\u1AAE\u1AAF\u1ABF-\u1AFF\u1B4C-\u1B4F\u1B7D-\u1B7F\u1BF4-\u1BFB\u1C38-\u1C3A\u1C4A-\u1C4C\u1C89-\u1C8F\u1CBB\u1CBC\u1CC8-\u1CCF\u1CFA-\u1CFF\u1DFA\u1F16\u1F17\u1F1E\u1F1F\u1F46\u1F47\u1F4E\u1F4F\u1F58\u1F5A\u1F5C\u1F5E\u1F7E\u1F7F\u1FB5\u1FC5\u1FD4\u1FD5\u1FDC\u1FF0\u1FF1\u1FF5\u1FFF\u200B-\u200F\u202A-\u202E\u2060-\u206F\u2072\u2073\u208F\u209D-\u209F\u20C0-\u20CF\u20F1-\u20FF\u218C-\u218F\u2427-\u243F\u244B-\u245F\u2B74\u2B75\u2B96\u2B97\u2BC9\u2BFF\u2C2F\u2C5F\u2CF4-\u2CF8\u2D26\u2D28-\u2D2C\u2D2E\u2D2F\u2D68-\u2D6E\u2D71-\u2D7E\u2D97-\u2D9F\u2DA7\u2DAF\u2DB7\u2DBF\u2DC7\u2DCF\u2DD7\u2DDF\u2E4F-\u2E7F\u2E9A\u2EF4-\u2EFF\u2FD6-\u2FEF\u2FFC-\u2FFF\u3040\u3097\u3098\u3100-\u3104\u3130\u318F\u31BB-\u31BF\u31E4-\u31EF\u321F\u32FF\u4DB6-\u4DBF\u9FF0-\u9FFF\uA48D-\uA48F\uA4C7-\uA4CF\uA62C-\uA63F\uA6F8-\uA6FF\uA7BA-\uA7F6\uA82C-\uA82F\uA83A-\uA83F\uA878-\uA87F\uA8C6-\uA8CD\uA8DA-\uA8DF\uA954-\uA95E\uA97D-\uA97F\uA9CE\uA9DA-\uA9DD\uA9FF\uAA37-\uAA3F\uAA4E\uAA4F\uAA5A\uAA5B\uAAC3-\uAADA\uAAF7-\uAB00\uAB07\uAB08\uAB0F\uAB10\uAB17-\uAB1F\uAB27\uAB2F\uAB66-\uAB6F\uABEE\uABEF\uABFA-\uABFF\uD7A4-\uD7AF\uD7C7-\uD7CA\uD7FC-\uF8FF\uFA6E\uFA6F\uFADA-\uFAFF\uFB07-\uFB12\uFB18-\uFB1C\uFB37\uFB3D\uFB3F\uFB42\uFB45\uFBC2-\uFBD2\uFD40-\uFD4F\uFD90\uFD91\uFDC8-\uFDEF\uFDFE\uFDFF\uFE1A-\uFE1F\uFE53\uFE67\uFE6C-\uFE6F\uFE75\uFEFD-\uFF00\uFFBF-\uFFC1\uFFC8\uFFC9\uFFD0\uFFD1\uFFD8\uFFD9\uFFDD-\uFFDF\uFFE7\uFFEF-\uFFFB\uFFFE\uFFFF', + 'astral': '\uD800[\uDC0C\uDC27\uDC3B\uDC3E\uDC4E\uDC4F\uDC5E-\uDC7F\uDCFB-\uDCFF\uDD03-\uDD06\uDD34-\uDD36\uDD8F\uDD9C-\uDD9F\uDDA1-\uDDCF\uDDFE-\uDE7F\uDE9D-\uDE9F\uDED1-\uDEDF\uDEFC-\uDEFF\uDF24-\uDF2C\uDF4B-\uDF4F\uDF7B-\uDF7F\uDF9E\uDFC4-\uDFC7\uDFD6-\uDFFF]|\uD801[\uDC9E\uDC9F\uDCAA-\uDCAF\uDCD4-\uDCD7\uDCFC-\uDCFF\uDD28-\uDD2F\uDD64-\uDD6E\uDD70-\uDDFF\uDF37-\uDF3F\uDF56-\uDF5F\uDF68-\uDFFF]|\uD802[\uDC06\uDC07\uDC09\uDC36\uDC39-\uDC3B\uDC3D\uDC3E\uDC56\uDC9F-\uDCA6\uDCB0-\uDCDF\uDCF3\uDCF6-\uDCFA\uDD1C-\uDD1E\uDD3A-\uDD3E\uDD40-\uDD7F\uDDB8-\uDDBB\uDDD0\uDDD1\uDE04\uDE07-\uDE0B\uDE14\uDE18\uDE36\uDE37\uDE3B-\uDE3E\uDE49-\uDE4F\uDE59-\uDE5F\uDEA0-\uDEBF\uDEE7-\uDEEA\uDEF7-\uDEFF\uDF36-\uDF38\uDF56\uDF57\uDF73-\uDF77\uDF92-\uDF98\uDF9D-\uDFA8\uDFB0-\uDFFF]|\uD803[\uDC49-\uDC7F\uDCB3-\uDCBF\uDCF3-\uDCF9\uDD28-\uDD2F\uDD3A-\uDE5F\uDE7F-\uDEFF\uDF28-\uDF2F\uDF5A-\uDFFF]|\uD804[\uDC4E-\uDC51\uDC70-\uDC7E\uDCBD\uDCC2-\uDCCF\uDCE9-\uDCEF\uDCFA-\uDCFF\uDD35\uDD47-\uDD4F\uDD77-\uDD7F\uDDCE\uDDCF\uDDE0\uDDF5-\uDDFF\uDE12\uDE3F-\uDE7F\uDE87\uDE89\uDE8E\uDE9E\uDEAA-\uDEAF\uDEEB-\uDEEF\uDEFA-\uDEFF\uDF04\uDF0D\uDF0E\uDF11\uDF12\uDF29\uDF31\uDF34\uDF3A\uDF45\uDF46\uDF49\uDF4A\uDF4E\uDF4F\uDF51-\uDF56\uDF58-\uDF5C\uDF64\uDF65\uDF6D-\uDF6F\uDF75-\uDFFF]|\uD805[\uDC5A\uDC5C\uDC5F-\uDC7F\uDCC8-\uDCCF\uDCDA-\uDD7F\uDDB6\uDDB7\uDDDE-\uDDFF\uDE45-\uDE4F\uDE5A-\uDE5F\uDE6D-\uDE7F\uDEB8-\uDEBF\uDECA-\uDEFF\uDF1B\uDF1C\uDF2C-\uDF2F\uDF40-\uDFFF]|\uD806[\uDC3C-\uDC9F\uDCF3-\uDCFE\uDD00-\uDDFF\uDE48-\uDE4F\uDE84\uDE85\uDEA3-\uDEBF\uDEF9-\uDFFF]|\uD807[\uDC09\uDC37\uDC46-\uDC4F\uDC6D-\uDC6F\uDC90\uDC91\uDCA8\uDCB7-\uDCFF\uDD07\uDD0A\uDD37-\uDD39\uDD3B\uDD3E\uDD48-\uDD4F\uDD5A-\uDD5F\uDD66\uDD69\uDD8F\uDD92\uDD99-\uDD9F\uDDAA-\uDEDF\uDEF9-\uDFFF]|\uD808[\uDF9A-\uDFFF]|\uD809[\uDC6F\uDC75-\uDC7F\uDD44-\uDFFF]|[\uD80A\uD80B\uD80E-\uD810\uD812-\uD819\uD823-\uD82B\uD82D\uD82E\uD830-\uD833\uD837\uD839\uD83F\uD87B-\uD87D\uD87F-\uDB3F\uDB41-\uDBFF][\uDC00-\uDFFF]|\uD80D[\uDC2F-\uDFFF]|\uD811[\uDE47-\uDFFF]|\uD81A[\uDE39-\uDE3F\uDE5F\uDE6A-\uDE6D\uDE70-\uDECF\uDEEE\uDEEF\uDEF6-\uDEFF\uDF46-\uDF4F\uDF5A\uDF62\uDF78-\uDF7C\uDF90-\uDFFF]|\uD81B[\uDC00-\uDE3F\uDE9B-\uDEFF\uDF45-\uDF4F\uDF7F-\uDF8E\uDFA0-\uDFDF\uDFE2-\uDFFF]|\uD821[\uDFF2-\uDFFF]|\uD822[\uDEF3-\uDFFF]|\uD82C[\uDD1F-\uDD6F\uDEFC-\uDFFF]|\uD82F[\uDC6B-\uDC6F\uDC7D-\uDC7F\uDC89-\uDC8F\uDC9A\uDC9B\uDCA0-\uDFFF]|\uD834[\uDCF6-\uDCFF\uDD27\uDD28\uDD73-\uDD7A\uDDE9-\uDDFF\uDE46-\uDEDF\uDEF4-\uDEFF\uDF57-\uDF5F\uDF79-\uDFFF]|\uD835[\uDC55\uDC9D\uDCA0\uDCA1\uDCA3\uDCA4\uDCA7\uDCA8\uDCAD\uDCBA\uDCBC\uDCC4\uDD06\uDD0B\uDD0C\uDD15\uDD1D\uDD3A\uDD3F\uDD45\uDD47-\uDD49\uDD51\uDEA6\uDEA7\uDFCC\uDFCD]|\uD836[\uDE8C-\uDE9A\uDEA0\uDEB0-\uDFFF]|\uD838[\uDC07\uDC19\uDC1A\uDC22\uDC25\uDC2B-\uDFFF]|\uD83A[\uDCC5\uDCC6\uDCD7-\uDCFF\uDD4B-\uDD4F\uDD5A-\uDD5D\uDD60-\uDFFF]|\uD83B[\uDC00-\uDC70\uDCB5-\uDDFF\uDE04\uDE20\uDE23\uDE25\uDE26\uDE28\uDE33\uDE38\uDE3A\uDE3C-\uDE41\uDE43-\uDE46\uDE48\uDE4A\uDE4C\uDE50\uDE53\uDE55\uDE56\uDE58\uDE5A\uDE5C\uDE5E\uDE60\uDE63\uDE65\uDE66\uDE6B\uDE73\uDE78\uDE7D\uDE7F\uDE8A\uDE9C-\uDEA0\uDEA4\uDEAA\uDEBC-\uDEEF\uDEF2-\uDFFF]|\uD83C[\uDC2C-\uDC2F\uDC94-\uDC9F\uDCAF\uDCB0\uDCC0\uDCD0\uDCF6-\uDCFF\uDD0D-\uDD0F\uDD6C-\uDD6F\uDDAD-\uDDE5\uDE03-\uDE0F\uDE3C-\uDE3F\uDE49-\uDE4F\uDE52-\uDE5F\uDE66-\uDEFF]|\uD83D[\uDED5-\uDEDF\uDEED-\uDEEF\uDEFA-\uDEFF\uDF74-\uDF7F\uDFD9-\uDFFF]|\uD83E[\uDC0C-\uDC0F\uDC48-\uDC4F\uDC5A-\uDC5F\uDC88-\uDC8F\uDCAE-\uDCFF\uDD0C-\uDD0F\uDD3F\uDD71\uDD72\uDD77-\uDD79\uDD7B\uDDA3-\uDDAF\uDDBA-\uDDBF\uDDC3-\uDDCF\uDE00-\uDE5F\uDE6E-\uDFFF]|\uD869[\uDED7-\uDEFF]|\uD86D[\uDF35-\uDF3F]|\uD86E[\uDC1E\uDC1F]|\uD873[\uDEA2-\uDEAF]|\uD87A[\uDFE1-\uDFFF]|\uD87E[\uDE1E-\uDFFF]|\uDB40[\uDC00-\uDCFF\uDDF0-\uDFFF]' + }, + { + 'name': 'Cc', + 'alias': 'Control', + 'bmp': '\0-\x1F\x7F-\x9F' + }, + { + 'name': 'Cf', + 'alias': 'Format', + 'bmp': '\xAD\u0600-\u0605\u061C\u06DD\u070F\u08E2\u180E\u200B-\u200F\u202A-\u202E\u2060-\u2064\u2066-\u206F\uFEFF\uFFF9-\uFFFB', + 'astral': '\uD804[\uDCBD\uDCCD]|\uD82F[\uDCA0-\uDCA3]|\uD834[\uDD73-\uDD7A]|\uDB40[\uDC01\uDC20-\uDC7F]' + }, + { + 'name': 'Cn', + 'alias': 'Unassigned', + 'bmp': '\u0378\u0379\u0380-\u0383\u038B\u038D\u03A2\u0530\u0557\u0558\u058B\u058C\u0590\u05C8-\u05CF\u05EB-\u05EE\u05F5-\u05FF\u061D\u070E\u074B\u074C\u07B2-\u07BF\u07FB\u07FC\u082E\u082F\u083F\u085C\u085D\u085F\u086B-\u089F\u08B5\u08BE-\u08D2\u0984\u098D\u098E\u0991\u0992\u09A9\u09B1\u09B3-\u09B5\u09BA\u09BB\u09C5\u09C6\u09C9\u09CA\u09CF-\u09D6\u09D8-\u09DB\u09DE\u09E4\u09E5\u09FF\u0A00\u0A04\u0A0B-\u0A0E\u0A11\u0A12\u0A29\u0A31\u0A34\u0A37\u0A3A\u0A3B\u0A3D\u0A43-\u0A46\u0A49\u0A4A\u0A4E-\u0A50\u0A52-\u0A58\u0A5D\u0A5F-\u0A65\u0A77-\u0A80\u0A84\u0A8E\u0A92\u0AA9\u0AB1\u0AB4\u0ABA\u0ABB\u0AC6\u0ACA\u0ACE\u0ACF\u0AD1-\u0ADF\u0AE4\u0AE5\u0AF2-\u0AF8\u0B00\u0B04\u0B0D\u0B0E\u0B11\u0B12\u0B29\u0B31\u0B34\u0B3A\u0B3B\u0B45\u0B46\u0B49\u0B4A\u0B4E-\u0B55\u0B58-\u0B5B\u0B5E\u0B64\u0B65\u0B78-\u0B81\u0B84\u0B8B-\u0B8D\u0B91\u0B96-\u0B98\u0B9B\u0B9D\u0BA0-\u0BA2\u0BA5-\u0BA7\u0BAB-\u0BAD\u0BBA-\u0BBD\u0BC3-\u0BC5\u0BC9\u0BCE\u0BCF\u0BD1-\u0BD6\u0BD8-\u0BE5\u0BFB-\u0BFF\u0C0D\u0C11\u0C29\u0C3A-\u0C3C\u0C45\u0C49\u0C4E-\u0C54\u0C57\u0C5B-\u0C5F\u0C64\u0C65\u0C70-\u0C77\u0C8D\u0C91\u0CA9\u0CB4\u0CBA\u0CBB\u0CC5\u0CC9\u0CCE-\u0CD4\u0CD7-\u0CDD\u0CDF\u0CE4\u0CE5\u0CF0\u0CF3-\u0CFF\u0D04\u0D0D\u0D11\u0D45\u0D49\u0D50-\u0D53\u0D64\u0D65\u0D80\u0D81\u0D84\u0D97-\u0D99\u0DB2\u0DBC\u0DBE\u0DBF\u0DC7-\u0DC9\u0DCB-\u0DCE\u0DD5\u0DD7\u0DE0-\u0DE5\u0DF0\u0DF1\u0DF5-\u0E00\u0E3B-\u0E3E\u0E5C-\u0E80\u0E83\u0E85\u0E86\u0E89\u0E8B\u0E8C\u0E8E-\u0E93\u0E98\u0EA0\u0EA4\u0EA6\u0EA8\u0EA9\u0EAC\u0EBA\u0EBE\u0EBF\u0EC5\u0EC7\u0ECE\u0ECF\u0EDA\u0EDB\u0EE0-\u0EFF\u0F48\u0F6D-\u0F70\u0F98\u0FBD\u0FCD\u0FDB-\u0FFF\u10C6\u10C8-\u10CC\u10CE\u10CF\u1249\u124E\u124F\u1257\u1259\u125E\u125F\u1289\u128E\u128F\u12B1\u12B6\u12B7\u12BF\u12C1\u12C6\u12C7\u12D7\u1311\u1316\u1317\u135B\u135C\u137D-\u137F\u139A-\u139F\u13F6\u13F7\u13FE\u13FF\u169D-\u169F\u16F9-\u16FF\u170D\u1715-\u171F\u1737-\u173F\u1754-\u175F\u176D\u1771\u1774-\u177F\u17DE\u17DF\u17EA-\u17EF\u17FA-\u17FF\u180F\u181A-\u181F\u1879-\u187F\u18AB-\u18AF\u18F6-\u18FF\u191F\u192C-\u192F\u193C-\u193F\u1941-\u1943\u196E\u196F\u1975-\u197F\u19AC-\u19AF\u19CA-\u19CF\u19DB-\u19DD\u1A1C\u1A1D\u1A5F\u1A7D\u1A7E\u1A8A-\u1A8F\u1A9A-\u1A9F\u1AAE\u1AAF\u1ABF-\u1AFF\u1B4C-\u1B4F\u1B7D-\u1B7F\u1BF4-\u1BFB\u1C38-\u1C3A\u1C4A-\u1C4C\u1C89-\u1C8F\u1CBB\u1CBC\u1CC8-\u1CCF\u1CFA-\u1CFF\u1DFA\u1F16\u1F17\u1F1E\u1F1F\u1F46\u1F47\u1F4E\u1F4F\u1F58\u1F5A\u1F5C\u1F5E\u1F7E\u1F7F\u1FB5\u1FC5\u1FD4\u1FD5\u1FDC\u1FF0\u1FF1\u1FF5\u1FFF\u2065\u2072\u2073\u208F\u209D-\u209F\u20C0-\u20CF\u20F1-\u20FF\u218C-\u218F\u2427-\u243F\u244B-\u245F\u2B74\u2B75\u2B96\u2B97\u2BC9\u2BFF\u2C2F\u2C5F\u2CF4-\u2CF8\u2D26\u2D28-\u2D2C\u2D2E\u2D2F\u2D68-\u2D6E\u2D71-\u2D7E\u2D97-\u2D9F\u2DA7\u2DAF\u2DB7\u2DBF\u2DC7\u2DCF\u2DD7\u2DDF\u2E4F-\u2E7F\u2E9A\u2EF4-\u2EFF\u2FD6-\u2FEF\u2FFC-\u2FFF\u3040\u3097\u3098\u3100-\u3104\u3130\u318F\u31BB-\u31BF\u31E4-\u31EF\u321F\u32FF\u4DB6-\u4DBF\u9FF0-\u9FFF\uA48D-\uA48F\uA4C7-\uA4CF\uA62C-\uA63F\uA6F8-\uA6FF\uA7BA-\uA7F6\uA82C-\uA82F\uA83A-\uA83F\uA878-\uA87F\uA8C6-\uA8CD\uA8DA-\uA8DF\uA954-\uA95E\uA97D-\uA97F\uA9CE\uA9DA-\uA9DD\uA9FF\uAA37-\uAA3F\uAA4E\uAA4F\uAA5A\uAA5B\uAAC3-\uAADA\uAAF7-\uAB00\uAB07\uAB08\uAB0F\uAB10\uAB17-\uAB1F\uAB27\uAB2F\uAB66-\uAB6F\uABEE\uABEF\uABFA-\uABFF\uD7A4-\uD7AF\uD7C7-\uD7CA\uD7FC-\uD7FF\uFA6E\uFA6F\uFADA-\uFAFF\uFB07-\uFB12\uFB18-\uFB1C\uFB37\uFB3D\uFB3F\uFB42\uFB45\uFBC2-\uFBD2\uFD40-\uFD4F\uFD90\uFD91\uFDC8-\uFDEF\uFDFE\uFDFF\uFE1A-\uFE1F\uFE53\uFE67\uFE6C-\uFE6F\uFE75\uFEFD\uFEFE\uFF00\uFFBF-\uFFC1\uFFC8\uFFC9\uFFD0\uFFD1\uFFD8\uFFD9\uFFDD-\uFFDF\uFFE7\uFFEF-\uFFF8\uFFFE\uFFFF', + 'astral': '\uD800[\uDC0C\uDC27\uDC3B\uDC3E\uDC4E\uDC4F\uDC5E-\uDC7F\uDCFB-\uDCFF\uDD03-\uDD06\uDD34-\uDD36\uDD8F\uDD9C-\uDD9F\uDDA1-\uDDCF\uDDFE-\uDE7F\uDE9D-\uDE9F\uDED1-\uDEDF\uDEFC-\uDEFF\uDF24-\uDF2C\uDF4B-\uDF4F\uDF7B-\uDF7F\uDF9E\uDFC4-\uDFC7\uDFD6-\uDFFF]|\uD801[\uDC9E\uDC9F\uDCAA-\uDCAF\uDCD4-\uDCD7\uDCFC-\uDCFF\uDD28-\uDD2F\uDD64-\uDD6E\uDD70-\uDDFF\uDF37-\uDF3F\uDF56-\uDF5F\uDF68-\uDFFF]|\uD802[\uDC06\uDC07\uDC09\uDC36\uDC39-\uDC3B\uDC3D\uDC3E\uDC56\uDC9F-\uDCA6\uDCB0-\uDCDF\uDCF3\uDCF6-\uDCFA\uDD1C-\uDD1E\uDD3A-\uDD3E\uDD40-\uDD7F\uDDB8-\uDDBB\uDDD0\uDDD1\uDE04\uDE07-\uDE0B\uDE14\uDE18\uDE36\uDE37\uDE3B-\uDE3E\uDE49-\uDE4F\uDE59-\uDE5F\uDEA0-\uDEBF\uDEE7-\uDEEA\uDEF7-\uDEFF\uDF36-\uDF38\uDF56\uDF57\uDF73-\uDF77\uDF92-\uDF98\uDF9D-\uDFA8\uDFB0-\uDFFF]|\uD803[\uDC49-\uDC7F\uDCB3-\uDCBF\uDCF3-\uDCF9\uDD28-\uDD2F\uDD3A-\uDE5F\uDE7F-\uDEFF\uDF28-\uDF2F\uDF5A-\uDFFF]|\uD804[\uDC4E-\uDC51\uDC70-\uDC7E\uDCC2-\uDCCC\uDCCE\uDCCF\uDCE9-\uDCEF\uDCFA-\uDCFF\uDD35\uDD47-\uDD4F\uDD77-\uDD7F\uDDCE\uDDCF\uDDE0\uDDF5-\uDDFF\uDE12\uDE3F-\uDE7F\uDE87\uDE89\uDE8E\uDE9E\uDEAA-\uDEAF\uDEEB-\uDEEF\uDEFA-\uDEFF\uDF04\uDF0D\uDF0E\uDF11\uDF12\uDF29\uDF31\uDF34\uDF3A\uDF45\uDF46\uDF49\uDF4A\uDF4E\uDF4F\uDF51-\uDF56\uDF58-\uDF5C\uDF64\uDF65\uDF6D-\uDF6F\uDF75-\uDFFF]|\uD805[\uDC5A\uDC5C\uDC5F-\uDC7F\uDCC8-\uDCCF\uDCDA-\uDD7F\uDDB6\uDDB7\uDDDE-\uDDFF\uDE45-\uDE4F\uDE5A-\uDE5F\uDE6D-\uDE7F\uDEB8-\uDEBF\uDECA-\uDEFF\uDF1B\uDF1C\uDF2C-\uDF2F\uDF40-\uDFFF]|\uD806[\uDC3C-\uDC9F\uDCF3-\uDCFE\uDD00-\uDDFF\uDE48-\uDE4F\uDE84\uDE85\uDEA3-\uDEBF\uDEF9-\uDFFF]|\uD807[\uDC09\uDC37\uDC46-\uDC4F\uDC6D-\uDC6F\uDC90\uDC91\uDCA8\uDCB7-\uDCFF\uDD07\uDD0A\uDD37-\uDD39\uDD3B\uDD3E\uDD48-\uDD4F\uDD5A-\uDD5F\uDD66\uDD69\uDD8F\uDD92\uDD99-\uDD9F\uDDAA-\uDEDF\uDEF9-\uDFFF]|\uD808[\uDF9A-\uDFFF]|\uD809[\uDC6F\uDC75-\uDC7F\uDD44-\uDFFF]|[\uD80A\uD80B\uD80E-\uD810\uD812-\uD819\uD823-\uD82B\uD82D\uD82E\uD830-\uD833\uD837\uD839\uD83F\uD87B-\uD87D\uD87F-\uDB3F\uDB41-\uDB7F][\uDC00-\uDFFF]|\uD80D[\uDC2F-\uDFFF]|\uD811[\uDE47-\uDFFF]|\uD81A[\uDE39-\uDE3F\uDE5F\uDE6A-\uDE6D\uDE70-\uDECF\uDEEE\uDEEF\uDEF6-\uDEFF\uDF46-\uDF4F\uDF5A\uDF62\uDF78-\uDF7C\uDF90-\uDFFF]|\uD81B[\uDC00-\uDE3F\uDE9B-\uDEFF\uDF45-\uDF4F\uDF7F-\uDF8E\uDFA0-\uDFDF\uDFE2-\uDFFF]|\uD821[\uDFF2-\uDFFF]|\uD822[\uDEF3-\uDFFF]|\uD82C[\uDD1F-\uDD6F\uDEFC-\uDFFF]|\uD82F[\uDC6B-\uDC6F\uDC7D-\uDC7F\uDC89-\uDC8F\uDC9A\uDC9B\uDCA4-\uDFFF]|\uD834[\uDCF6-\uDCFF\uDD27\uDD28\uDDE9-\uDDFF\uDE46-\uDEDF\uDEF4-\uDEFF\uDF57-\uDF5F\uDF79-\uDFFF]|\uD835[\uDC55\uDC9D\uDCA0\uDCA1\uDCA3\uDCA4\uDCA7\uDCA8\uDCAD\uDCBA\uDCBC\uDCC4\uDD06\uDD0B\uDD0C\uDD15\uDD1D\uDD3A\uDD3F\uDD45\uDD47-\uDD49\uDD51\uDEA6\uDEA7\uDFCC\uDFCD]|\uD836[\uDE8C-\uDE9A\uDEA0\uDEB0-\uDFFF]|\uD838[\uDC07\uDC19\uDC1A\uDC22\uDC25\uDC2B-\uDFFF]|\uD83A[\uDCC5\uDCC6\uDCD7-\uDCFF\uDD4B-\uDD4F\uDD5A-\uDD5D\uDD60-\uDFFF]|\uD83B[\uDC00-\uDC70\uDCB5-\uDDFF\uDE04\uDE20\uDE23\uDE25\uDE26\uDE28\uDE33\uDE38\uDE3A\uDE3C-\uDE41\uDE43-\uDE46\uDE48\uDE4A\uDE4C\uDE50\uDE53\uDE55\uDE56\uDE58\uDE5A\uDE5C\uDE5E\uDE60\uDE63\uDE65\uDE66\uDE6B\uDE73\uDE78\uDE7D\uDE7F\uDE8A\uDE9C-\uDEA0\uDEA4\uDEAA\uDEBC-\uDEEF\uDEF2-\uDFFF]|\uD83C[\uDC2C-\uDC2F\uDC94-\uDC9F\uDCAF\uDCB0\uDCC0\uDCD0\uDCF6-\uDCFF\uDD0D-\uDD0F\uDD6C-\uDD6F\uDDAD-\uDDE5\uDE03-\uDE0F\uDE3C-\uDE3F\uDE49-\uDE4F\uDE52-\uDE5F\uDE66-\uDEFF]|\uD83D[\uDED5-\uDEDF\uDEED-\uDEEF\uDEFA-\uDEFF\uDF74-\uDF7F\uDFD9-\uDFFF]|\uD83E[\uDC0C-\uDC0F\uDC48-\uDC4F\uDC5A-\uDC5F\uDC88-\uDC8F\uDCAE-\uDCFF\uDD0C-\uDD0F\uDD3F\uDD71\uDD72\uDD77-\uDD79\uDD7B\uDDA3-\uDDAF\uDDBA-\uDDBF\uDDC3-\uDDCF\uDE00-\uDE5F\uDE6E-\uDFFF]|\uD869[\uDED7-\uDEFF]|\uD86D[\uDF35-\uDF3F]|\uD86E[\uDC1E\uDC1F]|\uD873[\uDEA2-\uDEAF]|\uD87A[\uDFE1-\uDFFF]|\uD87E[\uDE1E-\uDFFF]|\uDB40[\uDC00\uDC02-\uDC1F\uDC80-\uDCFF\uDDF0-\uDFFF]|[\uDBBF\uDBFF][\uDFFE\uDFFF]' + }, + { + 'name': 'Co', + 'alias': 'Private_Use', + 'bmp': '\uE000-\uF8FF', + 'astral': '[\uDB80-\uDBBE\uDBC0-\uDBFE][\uDC00-\uDFFF]|[\uDBBF\uDBFF][\uDC00-\uDFFD]' + }, + { + 'name': 'Cs', + 'alias': 'Surrogate', + 'bmp': '\uD800-\uDFFF' + }, + { + 'name': 'L', + 'alias': 'Letter', + 'bmp': 'A-Za-z\xAA\xB5\xBA\xC0-\xD6\xD8-\xF6\xF8-\u02C1\u02C6-\u02D1\u02E0-\u02E4\u02EC\u02EE\u0370-\u0374\u0376\u0377\u037A-\u037D\u037F\u0386\u0388-\u038A\u038C\u038E-\u03A1\u03A3-\u03F5\u03F7-\u0481\u048A-\u052F\u0531-\u0556\u0559\u0560-\u0588\u05D0-\u05EA\u05EF-\u05F2\u0620-\u064A\u066E\u066F\u0671-\u06D3\u06D5\u06E5\u06E6\u06EE\u06EF\u06FA-\u06FC\u06FF\u0710\u0712-\u072F\u074D-\u07A5\u07B1\u07CA-\u07EA\u07F4\u07F5\u07FA\u0800-\u0815\u081A\u0824\u0828\u0840-\u0858\u0860-\u086A\u08A0-\u08B4\u08B6-\u08BD\u0904-\u0939\u093D\u0950\u0958-\u0961\u0971-\u0980\u0985-\u098C\u098F\u0990\u0993-\u09A8\u09AA-\u09B0\u09B2\u09B6-\u09B9\u09BD\u09CE\u09DC\u09DD\u09DF-\u09E1\u09F0\u09F1\u09FC\u0A05-\u0A0A\u0A0F\u0A10\u0A13-\u0A28\u0A2A-\u0A30\u0A32\u0A33\u0A35\u0A36\u0A38\u0A39\u0A59-\u0A5C\u0A5E\u0A72-\u0A74\u0A85-\u0A8D\u0A8F-\u0A91\u0A93-\u0AA8\u0AAA-\u0AB0\u0AB2\u0AB3\u0AB5-\u0AB9\u0ABD\u0AD0\u0AE0\u0AE1\u0AF9\u0B05-\u0B0C\u0B0F\u0B10\u0B13-\u0B28\u0B2A-\u0B30\u0B32\u0B33\u0B35-\u0B39\u0B3D\u0B5C\u0B5D\u0B5F-\u0B61\u0B71\u0B83\u0B85-\u0B8A\u0B8E-\u0B90\u0B92-\u0B95\u0B99\u0B9A\u0B9C\u0B9E\u0B9F\u0BA3\u0BA4\u0BA8-\u0BAA\u0BAE-\u0BB9\u0BD0\u0C05-\u0C0C\u0C0E-\u0C10\u0C12-\u0C28\u0C2A-\u0C39\u0C3D\u0C58-\u0C5A\u0C60\u0C61\u0C80\u0C85-\u0C8C\u0C8E-\u0C90\u0C92-\u0CA8\u0CAA-\u0CB3\u0CB5-\u0CB9\u0CBD\u0CDE\u0CE0\u0CE1\u0CF1\u0CF2\u0D05-\u0D0C\u0D0E-\u0D10\u0D12-\u0D3A\u0D3D\u0D4E\u0D54-\u0D56\u0D5F-\u0D61\u0D7A-\u0D7F\u0D85-\u0D96\u0D9A-\u0DB1\u0DB3-\u0DBB\u0DBD\u0DC0-\u0DC6\u0E01-\u0E30\u0E32\u0E33\u0E40-\u0E46\u0E81\u0E82\u0E84\u0E87\u0E88\u0E8A\u0E8D\u0E94-\u0E97\u0E99-\u0E9F\u0EA1-\u0EA3\u0EA5\u0EA7\u0EAA\u0EAB\u0EAD-\u0EB0\u0EB2\u0EB3\u0EBD\u0EC0-\u0EC4\u0EC6\u0EDC-\u0EDF\u0F00\u0F40-\u0F47\u0F49-\u0F6C\u0F88-\u0F8C\u1000-\u102A\u103F\u1050-\u1055\u105A-\u105D\u1061\u1065\u1066\u106E-\u1070\u1075-\u1081\u108E\u10A0-\u10C5\u10C7\u10CD\u10D0-\u10FA\u10FC-\u1248\u124A-\u124D\u1250-\u1256\u1258\u125A-\u125D\u1260-\u1288\u128A-\u128D\u1290-\u12B0\u12B2-\u12B5\u12B8-\u12BE\u12C0\u12C2-\u12C5\u12C8-\u12D6\u12D8-\u1310\u1312-\u1315\u1318-\u135A\u1380-\u138F\u13A0-\u13F5\u13F8-\u13FD\u1401-\u166C\u166F-\u167F\u1681-\u169A\u16A0-\u16EA\u16F1-\u16F8\u1700-\u170C\u170E-\u1711\u1720-\u1731\u1740-\u1751\u1760-\u176C\u176E-\u1770\u1780-\u17B3\u17D7\u17DC\u1820-\u1878\u1880-\u1884\u1887-\u18A8\u18AA\u18B0-\u18F5\u1900-\u191E\u1950-\u196D\u1970-\u1974\u1980-\u19AB\u19B0-\u19C9\u1A00-\u1A16\u1A20-\u1A54\u1AA7\u1B05-\u1B33\u1B45-\u1B4B\u1B83-\u1BA0\u1BAE\u1BAF\u1BBA-\u1BE5\u1C00-\u1C23\u1C4D-\u1C4F\u1C5A-\u1C7D\u1C80-\u1C88\u1C90-\u1CBA\u1CBD-\u1CBF\u1CE9-\u1CEC\u1CEE-\u1CF1\u1CF5\u1CF6\u1D00-\u1DBF\u1E00-\u1F15\u1F18-\u1F1D\u1F20-\u1F45\u1F48-\u1F4D\u1F50-\u1F57\u1F59\u1F5B\u1F5D\u1F5F-\u1F7D\u1F80-\u1FB4\u1FB6-\u1FBC\u1FBE\u1FC2-\u1FC4\u1FC6-\u1FCC\u1FD0-\u1FD3\u1FD6-\u1FDB\u1FE0-\u1FEC\u1FF2-\u1FF4\u1FF6-\u1FFC\u2071\u207F\u2090-\u209C\u2102\u2107\u210A-\u2113\u2115\u2119-\u211D\u2124\u2126\u2128\u212A-\u212D\u212F-\u2139\u213C-\u213F\u2145-\u2149\u214E\u2183\u2184\u2C00-\u2C2E\u2C30-\u2C5E\u2C60-\u2CE4\u2CEB-\u2CEE\u2CF2\u2CF3\u2D00-\u2D25\u2D27\u2D2D\u2D30-\u2D67\u2D6F\u2D80-\u2D96\u2DA0-\u2DA6\u2DA8-\u2DAE\u2DB0-\u2DB6\u2DB8-\u2DBE\u2DC0-\u2DC6\u2DC8-\u2DCE\u2DD0-\u2DD6\u2DD8-\u2DDE\u2E2F\u3005\u3006\u3031-\u3035\u303B\u303C\u3041-\u3096\u309D-\u309F\u30A1-\u30FA\u30FC-\u30FF\u3105-\u312F\u3131-\u318E\u31A0-\u31BA\u31F0-\u31FF\u3400-\u4DB5\u4E00-\u9FEF\uA000-\uA48C\uA4D0-\uA4FD\uA500-\uA60C\uA610-\uA61F\uA62A\uA62B\uA640-\uA66E\uA67F-\uA69D\uA6A0-\uA6E5\uA717-\uA71F\uA722-\uA788\uA78B-\uA7B9\uA7F7-\uA801\uA803-\uA805\uA807-\uA80A\uA80C-\uA822\uA840-\uA873\uA882-\uA8B3\uA8F2-\uA8F7\uA8FB\uA8FD\uA8FE\uA90A-\uA925\uA930-\uA946\uA960-\uA97C\uA984-\uA9B2\uA9CF\uA9E0-\uA9E4\uA9E6-\uA9EF\uA9FA-\uA9FE\uAA00-\uAA28\uAA40-\uAA42\uAA44-\uAA4B\uAA60-\uAA76\uAA7A\uAA7E-\uAAAF\uAAB1\uAAB5\uAAB6\uAAB9-\uAABD\uAAC0\uAAC2\uAADB-\uAADD\uAAE0-\uAAEA\uAAF2-\uAAF4\uAB01-\uAB06\uAB09-\uAB0E\uAB11-\uAB16\uAB20-\uAB26\uAB28-\uAB2E\uAB30-\uAB5A\uAB5C-\uAB65\uAB70-\uABE2\uAC00-\uD7A3\uD7B0-\uD7C6\uD7CB-\uD7FB\uF900-\uFA6D\uFA70-\uFAD9\uFB00-\uFB06\uFB13-\uFB17\uFB1D\uFB1F-\uFB28\uFB2A-\uFB36\uFB38-\uFB3C\uFB3E\uFB40\uFB41\uFB43\uFB44\uFB46-\uFBB1\uFBD3-\uFD3D\uFD50-\uFD8F\uFD92-\uFDC7\uFDF0-\uFDFB\uFE70-\uFE74\uFE76-\uFEFC\uFF21-\uFF3A\uFF41-\uFF5A\uFF66-\uFFBE\uFFC2-\uFFC7\uFFCA-\uFFCF\uFFD2-\uFFD7\uFFDA-\uFFDC', + 'astral': '\uD800[\uDC00-\uDC0B\uDC0D-\uDC26\uDC28-\uDC3A\uDC3C\uDC3D\uDC3F-\uDC4D\uDC50-\uDC5D\uDC80-\uDCFA\uDE80-\uDE9C\uDEA0-\uDED0\uDF00-\uDF1F\uDF2D-\uDF40\uDF42-\uDF49\uDF50-\uDF75\uDF80-\uDF9D\uDFA0-\uDFC3\uDFC8-\uDFCF]|\uD801[\uDC00-\uDC9D\uDCB0-\uDCD3\uDCD8-\uDCFB\uDD00-\uDD27\uDD30-\uDD63\uDE00-\uDF36\uDF40-\uDF55\uDF60-\uDF67]|\uD802[\uDC00-\uDC05\uDC08\uDC0A-\uDC35\uDC37\uDC38\uDC3C\uDC3F-\uDC55\uDC60-\uDC76\uDC80-\uDC9E\uDCE0-\uDCF2\uDCF4\uDCF5\uDD00-\uDD15\uDD20-\uDD39\uDD80-\uDDB7\uDDBE\uDDBF\uDE00\uDE10-\uDE13\uDE15-\uDE17\uDE19-\uDE35\uDE60-\uDE7C\uDE80-\uDE9C\uDEC0-\uDEC7\uDEC9-\uDEE4\uDF00-\uDF35\uDF40-\uDF55\uDF60-\uDF72\uDF80-\uDF91]|\uD803[\uDC00-\uDC48\uDC80-\uDCB2\uDCC0-\uDCF2\uDD00-\uDD23\uDF00-\uDF1C\uDF27\uDF30-\uDF45]|\uD804[\uDC03-\uDC37\uDC83-\uDCAF\uDCD0-\uDCE8\uDD03-\uDD26\uDD44\uDD50-\uDD72\uDD76\uDD83-\uDDB2\uDDC1-\uDDC4\uDDDA\uDDDC\uDE00-\uDE11\uDE13-\uDE2B\uDE80-\uDE86\uDE88\uDE8A-\uDE8D\uDE8F-\uDE9D\uDE9F-\uDEA8\uDEB0-\uDEDE\uDF05-\uDF0C\uDF0F\uDF10\uDF13-\uDF28\uDF2A-\uDF30\uDF32\uDF33\uDF35-\uDF39\uDF3D\uDF50\uDF5D-\uDF61]|\uD805[\uDC00-\uDC34\uDC47-\uDC4A\uDC80-\uDCAF\uDCC4\uDCC5\uDCC7\uDD80-\uDDAE\uDDD8-\uDDDB\uDE00-\uDE2F\uDE44\uDE80-\uDEAA\uDF00-\uDF1A]|\uD806[\uDC00-\uDC2B\uDCA0-\uDCDF\uDCFF\uDE00\uDE0B-\uDE32\uDE3A\uDE50\uDE5C-\uDE83\uDE86-\uDE89\uDE9D\uDEC0-\uDEF8]|\uD807[\uDC00-\uDC08\uDC0A-\uDC2E\uDC40\uDC72-\uDC8F\uDD00-\uDD06\uDD08\uDD09\uDD0B-\uDD30\uDD46\uDD60-\uDD65\uDD67\uDD68\uDD6A-\uDD89\uDD98\uDEE0-\uDEF2]|\uD808[\uDC00-\uDF99]|\uD809[\uDC80-\uDD43]|[\uD80C\uD81C-\uD820\uD840-\uD868\uD86A-\uD86C\uD86F-\uD872\uD874-\uD879][\uDC00-\uDFFF]|\uD80D[\uDC00-\uDC2E]|\uD811[\uDC00-\uDE46]|\uD81A[\uDC00-\uDE38\uDE40-\uDE5E\uDED0-\uDEED\uDF00-\uDF2F\uDF40-\uDF43\uDF63-\uDF77\uDF7D-\uDF8F]|\uD81B[\uDE40-\uDE7F\uDF00-\uDF44\uDF50\uDF93-\uDF9F\uDFE0\uDFE1]|\uD821[\uDC00-\uDFF1]|\uD822[\uDC00-\uDEF2]|\uD82C[\uDC00-\uDD1E\uDD70-\uDEFB]|\uD82F[\uDC00-\uDC6A\uDC70-\uDC7C\uDC80-\uDC88\uDC90-\uDC99]|\uD835[\uDC00-\uDC54\uDC56-\uDC9C\uDC9E\uDC9F\uDCA2\uDCA5\uDCA6\uDCA9-\uDCAC\uDCAE-\uDCB9\uDCBB\uDCBD-\uDCC3\uDCC5-\uDD05\uDD07-\uDD0A\uDD0D-\uDD14\uDD16-\uDD1C\uDD1E-\uDD39\uDD3B-\uDD3E\uDD40-\uDD44\uDD46\uDD4A-\uDD50\uDD52-\uDEA5\uDEA8-\uDEC0\uDEC2-\uDEDA\uDEDC-\uDEFA\uDEFC-\uDF14\uDF16-\uDF34\uDF36-\uDF4E\uDF50-\uDF6E\uDF70-\uDF88\uDF8A-\uDFA8\uDFAA-\uDFC2\uDFC4-\uDFCB]|\uD83A[\uDC00-\uDCC4\uDD00-\uDD43]|\uD83B[\uDE00-\uDE03\uDE05-\uDE1F\uDE21\uDE22\uDE24\uDE27\uDE29-\uDE32\uDE34-\uDE37\uDE39\uDE3B\uDE42\uDE47\uDE49\uDE4B\uDE4D-\uDE4F\uDE51\uDE52\uDE54\uDE57\uDE59\uDE5B\uDE5D\uDE5F\uDE61\uDE62\uDE64\uDE67-\uDE6A\uDE6C-\uDE72\uDE74-\uDE77\uDE79-\uDE7C\uDE7E\uDE80-\uDE89\uDE8B-\uDE9B\uDEA1-\uDEA3\uDEA5-\uDEA9\uDEAB-\uDEBB]|\uD869[\uDC00-\uDED6\uDF00-\uDFFF]|\uD86D[\uDC00-\uDF34\uDF40-\uDFFF]|\uD86E[\uDC00-\uDC1D\uDC20-\uDFFF]|\uD873[\uDC00-\uDEA1\uDEB0-\uDFFF]|\uD87A[\uDC00-\uDFE0]|\uD87E[\uDC00-\uDE1D]' + }, + { + 'name': 'LC', + 'alias': 'Cased_Letter', + 'bmp': 'A-Za-z\xB5\xC0-\xD6\xD8-\xF6\xF8-\u01BA\u01BC-\u01BF\u01C4-\u0293\u0295-\u02AF\u0370-\u0373\u0376\u0377\u037B-\u037D\u037F\u0386\u0388-\u038A\u038C\u038E-\u03A1\u03A3-\u03F5\u03F7-\u0481\u048A-\u052F\u0531-\u0556\u0560-\u0588\u10A0-\u10C5\u10C7\u10CD\u10D0-\u10FA\u10FD-\u10FF\u13A0-\u13F5\u13F8-\u13FD\u1C80-\u1C88\u1C90-\u1CBA\u1CBD-\u1CBF\u1D00-\u1D2B\u1D6B-\u1D77\u1D79-\u1D9A\u1E00-\u1F15\u1F18-\u1F1D\u1F20-\u1F45\u1F48-\u1F4D\u1F50-\u1F57\u1F59\u1F5B\u1F5D\u1F5F-\u1F7D\u1F80-\u1FB4\u1FB6-\u1FBC\u1FBE\u1FC2-\u1FC4\u1FC6-\u1FCC\u1FD0-\u1FD3\u1FD6-\u1FDB\u1FE0-\u1FEC\u1FF2-\u1FF4\u1FF6-\u1FFC\u2102\u2107\u210A-\u2113\u2115\u2119-\u211D\u2124\u2126\u2128\u212A-\u212D\u212F-\u2134\u2139\u213C-\u213F\u2145-\u2149\u214E\u2183\u2184\u2C00-\u2C2E\u2C30-\u2C5E\u2C60-\u2C7B\u2C7E-\u2CE4\u2CEB-\u2CEE\u2CF2\u2CF3\u2D00-\u2D25\u2D27\u2D2D\uA640-\uA66D\uA680-\uA69B\uA722-\uA76F\uA771-\uA787\uA78B-\uA78E\uA790-\uA7B9\uA7FA\uAB30-\uAB5A\uAB60-\uAB65\uAB70-\uABBF\uFB00-\uFB06\uFB13-\uFB17\uFF21-\uFF3A\uFF41-\uFF5A', + 'astral': '\uD801[\uDC00-\uDC4F\uDCB0-\uDCD3\uDCD8-\uDCFB]|\uD803[\uDC80-\uDCB2\uDCC0-\uDCF2]|\uD806[\uDCA0-\uDCDF]|\uD81B[\uDE40-\uDE7F]|\uD835[\uDC00-\uDC54\uDC56-\uDC9C\uDC9E\uDC9F\uDCA2\uDCA5\uDCA6\uDCA9-\uDCAC\uDCAE-\uDCB9\uDCBB\uDCBD-\uDCC3\uDCC5-\uDD05\uDD07-\uDD0A\uDD0D-\uDD14\uDD16-\uDD1C\uDD1E-\uDD39\uDD3B-\uDD3E\uDD40-\uDD44\uDD46\uDD4A-\uDD50\uDD52-\uDEA5\uDEA8-\uDEC0\uDEC2-\uDEDA\uDEDC-\uDEFA\uDEFC-\uDF14\uDF16-\uDF34\uDF36-\uDF4E\uDF50-\uDF6E\uDF70-\uDF88\uDF8A-\uDFA8\uDFAA-\uDFC2\uDFC4-\uDFCB]|\uD83A[\uDD00-\uDD43]' + }, + { + 'name': 'Ll', + 'alias': 'Lowercase_Letter', + 'bmp': 'a-z\xB5\xDF-\xF6\xF8-\xFF\u0101\u0103\u0105\u0107\u0109\u010B\u010D\u010F\u0111\u0113\u0115\u0117\u0119\u011B\u011D\u011F\u0121\u0123\u0125\u0127\u0129\u012B\u012D\u012F\u0131\u0133\u0135\u0137\u0138\u013A\u013C\u013E\u0140\u0142\u0144\u0146\u0148\u0149\u014B\u014D\u014F\u0151\u0153\u0155\u0157\u0159\u015B\u015D\u015F\u0161\u0163\u0165\u0167\u0169\u016B\u016D\u016F\u0171\u0173\u0175\u0177\u017A\u017C\u017E-\u0180\u0183\u0185\u0188\u018C\u018D\u0192\u0195\u0199-\u019B\u019E\u01A1\u01A3\u01A5\u01A8\u01AA\u01AB\u01AD\u01B0\u01B4\u01B6\u01B9\u01BA\u01BD-\u01BF\u01C6\u01C9\u01CC\u01CE\u01D0\u01D2\u01D4\u01D6\u01D8\u01DA\u01DC\u01DD\u01DF\u01E1\u01E3\u01E5\u01E7\u01E9\u01EB\u01ED\u01EF\u01F0\u01F3\u01F5\u01F9\u01FB\u01FD\u01FF\u0201\u0203\u0205\u0207\u0209\u020B\u020D\u020F\u0211\u0213\u0215\u0217\u0219\u021B\u021D\u021F\u0221\u0223\u0225\u0227\u0229\u022B\u022D\u022F\u0231\u0233-\u0239\u023C\u023F\u0240\u0242\u0247\u0249\u024B\u024D\u024F-\u0293\u0295-\u02AF\u0371\u0373\u0377\u037B-\u037D\u0390\u03AC-\u03CE\u03D0\u03D1\u03D5-\u03D7\u03D9\u03DB\u03DD\u03DF\u03E1\u03E3\u03E5\u03E7\u03E9\u03EB\u03ED\u03EF-\u03F3\u03F5\u03F8\u03FB\u03FC\u0430-\u045F\u0461\u0463\u0465\u0467\u0469\u046B\u046D\u046F\u0471\u0473\u0475\u0477\u0479\u047B\u047D\u047F\u0481\u048B\u048D\u048F\u0491\u0493\u0495\u0497\u0499\u049B\u049D\u049F\u04A1\u04A3\u04A5\u04A7\u04A9\u04AB\u04AD\u04AF\u04B1\u04B3\u04B5\u04B7\u04B9\u04BB\u04BD\u04BF\u04C2\u04C4\u04C6\u04C8\u04CA\u04CC\u04CE\u04CF\u04D1\u04D3\u04D5\u04D7\u04D9\u04DB\u04DD\u04DF\u04E1\u04E3\u04E5\u04E7\u04E9\u04EB\u04ED\u04EF\u04F1\u04F3\u04F5\u04F7\u04F9\u04FB\u04FD\u04FF\u0501\u0503\u0505\u0507\u0509\u050B\u050D\u050F\u0511\u0513\u0515\u0517\u0519\u051B\u051D\u051F\u0521\u0523\u0525\u0527\u0529\u052B\u052D\u052F\u0560-\u0588\u10D0-\u10FA\u10FD-\u10FF\u13F8-\u13FD\u1C80-\u1C88\u1D00-\u1D2B\u1D6B-\u1D77\u1D79-\u1D9A\u1E01\u1E03\u1E05\u1E07\u1E09\u1E0B\u1E0D\u1E0F\u1E11\u1E13\u1E15\u1E17\u1E19\u1E1B\u1E1D\u1E1F\u1E21\u1E23\u1E25\u1E27\u1E29\u1E2B\u1E2D\u1E2F\u1E31\u1E33\u1E35\u1E37\u1E39\u1E3B\u1E3D\u1E3F\u1E41\u1E43\u1E45\u1E47\u1E49\u1E4B\u1E4D\u1E4F\u1E51\u1E53\u1E55\u1E57\u1E59\u1E5B\u1E5D\u1E5F\u1E61\u1E63\u1E65\u1E67\u1E69\u1E6B\u1E6D\u1E6F\u1E71\u1E73\u1E75\u1E77\u1E79\u1E7B\u1E7D\u1E7F\u1E81\u1E83\u1E85\u1E87\u1E89\u1E8B\u1E8D\u1E8F\u1E91\u1E93\u1E95-\u1E9D\u1E9F\u1EA1\u1EA3\u1EA5\u1EA7\u1EA9\u1EAB\u1EAD\u1EAF\u1EB1\u1EB3\u1EB5\u1EB7\u1EB9\u1EBB\u1EBD\u1EBF\u1EC1\u1EC3\u1EC5\u1EC7\u1EC9\u1ECB\u1ECD\u1ECF\u1ED1\u1ED3\u1ED5\u1ED7\u1ED9\u1EDB\u1EDD\u1EDF\u1EE1\u1EE3\u1EE5\u1EE7\u1EE9\u1EEB\u1EED\u1EEF\u1EF1\u1EF3\u1EF5\u1EF7\u1EF9\u1EFB\u1EFD\u1EFF-\u1F07\u1F10-\u1F15\u1F20-\u1F27\u1F30-\u1F37\u1F40-\u1F45\u1F50-\u1F57\u1F60-\u1F67\u1F70-\u1F7D\u1F80-\u1F87\u1F90-\u1F97\u1FA0-\u1FA7\u1FB0-\u1FB4\u1FB6\u1FB7\u1FBE\u1FC2-\u1FC4\u1FC6\u1FC7\u1FD0-\u1FD3\u1FD6\u1FD7\u1FE0-\u1FE7\u1FF2-\u1FF4\u1FF6\u1FF7\u210A\u210E\u210F\u2113\u212F\u2134\u2139\u213C\u213D\u2146-\u2149\u214E\u2184\u2C30-\u2C5E\u2C61\u2C65\u2C66\u2C68\u2C6A\u2C6C\u2C71\u2C73\u2C74\u2C76-\u2C7B\u2C81\u2C83\u2C85\u2C87\u2C89\u2C8B\u2C8D\u2C8F\u2C91\u2C93\u2C95\u2C97\u2C99\u2C9B\u2C9D\u2C9F\u2CA1\u2CA3\u2CA5\u2CA7\u2CA9\u2CAB\u2CAD\u2CAF\u2CB1\u2CB3\u2CB5\u2CB7\u2CB9\u2CBB\u2CBD\u2CBF\u2CC1\u2CC3\u2CC5\u2CC7\u2CC9\u2CCB\u2CCD\u2CCF\u2CD1\u2CD3\u2CD5\u2CD7\u2CD9\u2CDB\u2CDD\u2CDF\u2CE1\u2CE3\u2CE4\u2CEC\u2CEE\u2CF3\u2D00-\u2D25\u2D27\u2D2D\uA641\uA643\uA645\uA647\uA649\uA64B\uA64D\uA64F\uA651\uA653\uA655\uA657\uA659\uA65B\uA65D\uA65F\uA661\uA663\uA665\uA667\uA669\uA66B\uA66D\uA681\uA683\uA685\uA687\uA689\uA68B\uA68D\uA68F\uA691\uA693\uA695\uA697\uA699\uA69B\uA723\uA725\uA727\uA729\uA72B\uA72D\uA72F-\uA731\uA733\uA735\uA737\uA739\uA73B\uA73D\uA73F\uA741\uA743\uA745\uA747\uA749\uA74B\uA74D\uA74F\uA751\uA753\uA755\uA757\uA759\uA75B\uA75D\uA75F\uA761\uA763\uA765\uA767\uA769\uA76B\uA76D\uA76F\uA771-\uA778\uA77A\uA77C\uA77F\uA781\uA783\uA785\uA787\uA78C\uA78E\uA791\uA793-\uA795\uA797\uA799\uA79B\uA79D\uA79F\uA7A1\uA7A3\uA7A5\uA7A7\uA7A9\uA7AF\uA7B5\uA7B7\uA7B9\uA7FA\uAB30-\uAB5A\uAB60-\uAB65\uAB70-\uABBF\uFB00-\uFB06\uFB13-\uFB17\uFF41-\uFF5A', + 'astral': '\uD801[\uDC28-\uDC4F\uDCD8-\uDCFB]|\uD803[\uDCC0-\uDCF2]|\uD806[\uDCC0-\uDCDF]|\uD81B[\uDE60-\uDE7F]|\uD835[\uDC1A-\uDC33\uDC4E-\uDC54\uDC56-\uDC67\uDC82-\uDC9B\uDCB6-\uDCB9\uDCBB\uDCBD-\uDCC3\uDCC5-\uDCCF\uDCEA-\uDD03\uDD1E-\uDD37\uDD52-\uDD6B\uDD86-\uDD9F\uDDBA-\uDDD3\uDDEE-\uDE07\uDE22-\uDE3B\uDE56-\uDE6F\uDE8A-\uDEA5\uDEC2-\uDEDA\uDEDC-\uDEE1\uDEFC-\uDF14\uDF16-\uDF1B\uDF36-\uDF4E\uDF50-\uDF55\uDF70-\uDF88\uDF8A-\uDF8F\uDFAA-\uDFC2\uDFC4-\uDFC9\uDFCB]|\uD83A[\uDD22-\uDD43]' + }, + { + 'name': 'Lm', + 'alias': 'Modifier_Letter', + 'bmp': '\u02B0-\u02C1\u02C6-\u02D1\u02E0-\u02E4\u02EC\u02EE\u0374\u037A\u0559\u0640\u06E5\u06E6\u07F4\u07F5\u07FA\u081A\u0824\u0828\u0971\u0E46\u0EC6\u10FC\u17D7\u1843\u1AA7\u1C78-\u1C7D\u1D2C-\u1D6A\u1D78\u1D9B-\u1DBF\u2071\u207F\u2090-\u209C\u2C7C\u2C7D\u2D6F\u2E2F\u3005\u3031-\u3035\u303B\u309D\u309E\u30FC-\u30FE\uA015\uA4F8-\uA4FD\uA60C\uA67F\uA69C\uA69D\uA717-\uA71F\uA770\uA788\uA7F8\uA7F9\uA9CF\uA9E6\uAA70\uAADD\uAAF3\uAAF4\uAB5C-\uAB5F\uFF70\uFF9E\uFF9F', + 'astral': '\uD81A[\uDF40-\uDF43]|\uD81B[\uDF93-\uDF9F\uDFE0\uDFE1]' + }, + { + 'name': 'Lo', + 'alias': 'Other_Letter', + 'bmp': '\xAA\xBA\u01BB\u01C0-\u01C3\u0294\u05D0-\u05EA\u05EF-\u05F2\u0620-\u063F\u0641-\u064A\u066E\u066F\u0671-\u06D3\u06D5\u06EE\u06EF\u06FA-\u06FC\u06FF\u0710\u0712-\u072F\u074D-\u07A5\u07B1\u07CA-\u07EA\u0800-\u0815\u0840-\u0858\u0860-\u086A\u08A0-\u08B4\u08B6-\u08BD\u0904-\u0939\u093D\u0950\u0958-\u0961\u0972-\u0980\u0985-\u098C\u098F\u0990\u0993-\u09A8\u09AA-\u09B0\u09B2\u09B6-\u09B9\u09BD\u09CE\u09DC\u09DD\u09DF-\u09E1\u09F0\u09F1\u09FC\u0A05-\u0A0A\u0A0F\u0A10\u0A13-\u0A28\u0A2A-\u0A30\u0A32\u0A33\u0A35\u0A36\u0A38\u0A39\u0A59-\u0A5C\u0A5E\u0A72-\u0A74\u0A85-\u0A8D\u0A8F-\u0A91\u0A93-\u0AA8\u0AAA-\u0AB0\u0AB2\u0AB3\u0AB5-\u0AB9\u0ABD\u0AD0\u0AE0\u0AE1\u0AF9\u0B05-\u0B0C\u0B0F\u0B10\u0B13-\u0B28\u0B2A-\u0B30\u0B32\u0B33\u0B35-\u0B39\u0B3D\u0B5C\u0B5D\u0B5F-\u0B61\u0B71\u0B83\u0B85-\u0B8A\u0B8E-\u0B90\u0B92-\u0B95\u0B99\u0B9A\u0B9C\u0B9E\u0B9F\u0BA3\u0BA4\u0BA8-\u0BAA\u0BAE-\u0BB9\u0BD0\u0C05-\u0C0C\u0C0E-\u0C10\u0C12-\u0C28\u0C2A-\u0C39\u0C3D\u0C58-\u0C5A\u0C60\u0C61\u0C80\u0C85-\u0C8C\u0C8E-\u0C90\u0C92-\u0CA8\u0CAA-\u0CB3\u0CB5-\u0CB9\u0CBD\u0CDE\u0CE0\u0CE1\u0CF1\u0CF2\u0D05-\u0D0C\u0D0E-\u0D10\u0D12-\u0D3A\u0D3D\u0D4E\u0D54-\u0D56\u0D5F-\u0D61\u0D7A-\u0D7F\u0D85-\u0D96\u0D9A-\u0DB1\u0DB3-\u0DBB\u0DBD\u0DC0-\u0DC6\u0E01-\u0E30\u0E32\u0E33\u0E40-\u0E45\u0E81\u0E82\u0E84\u0E87\u0E88\u0E8A\u0E8D\u0E94-\u0E97\u0E99-\u0E9F\u0EA1-\u0EA3\u0EA5\u0EA7\u0EAA\u0EAB\u0EAD-\u0EB0\u0EB2\u0EB3\u0EBD\u0EC0-\u0EC4\u0EDC-\u0EDF\u0F00\u0F40-\u0F47\u0F49-\u0F6C\u0F88-\u0F8C\u1000-\u102A\u103F\u1050-\u1055\u105A-\u105D\u1061\u1065\u1066\u106E-\u1070\u1075-\u1081\u108E\u1100-\u1248\u124A-\u124D\u1250-\u1256\u1258\u125A-\u125D\u1260-\u1288\u128A-\u128D\u1290-\u12B0\u12B2-\u12B5\u12B8-\u12BE\u12C0\u12C2-\u12C5\u12C8-\u12D6\u12D8-\u1310\u1312-\u1315\u1318-\u135A\u1380-\u138F\u1401-\u166C\u166F-\u167F\u1681-\u169A\u16A0-\u16EA\u16F1-\u16F8\u1700-\u170C\u170E-\u1711\u1720-\u1731\u1740-\u1751\u1760-\u176C\u176E-\u1770\u1780-\u17B3\u17DC\u1820-\u1842\u1844-\u1878\u1880-\u1884\u1887-\u18A8\u18AA\u18B0-\u18F5\u1900-\u191E\u1950-\u196D\u1970-\u1974\u1980-\u19AB\u19B0-\u19C9\u1A00-\u1A16\u1A20-\u1A54\u1B05-\u1B33\u1B45-\u1B4B\u1B83-\u1BA0\u1BAE\u1BAF\u1BBA-\u1BE5\u1C00-\u1C23\u1C4D-\u1C4F\u1C5A-\u1C77\u1CE9-\u1CEC\u1CEE-\u1CF1\u1CF5\u1CF6\u2135-\u2138\u2D30-\u2D67\u2D80-\u2D96\u2DA0-\u2DA6\u2DA8-\u2DAE\u2DB0-\u2DB6\u2DB8-\u2DBE\u2DC0-\u2DC6\u2DC8-\u2DCE\u2DD0-\u2DD6\u2DD8-\u2DDE\u3006\u303C\u3041-\u3096\u309F\u30A1-\u30FA\u30FF\u3105-\u312F\u3131-\u318E\u31A0-\u31BA\u31F0-\u31FF\u3400-\u4DB5\u4E00-\u9FEF\uA000-\uA014\uA016-\uA48C\uA4D0-\uA4F7\uA500-\uA60B\uA610-\uA61F\uA62A\uA62B\uA66E\uA6A0-\uA6E5\uA78F\uA7F7\uA7FB-\uA801\uA803-\uA805\uA807-\uA80A\uA80C-\uA822\uA840-\uA873\uA882-\uA8B3\uA8F2-\uA8F7\uA8FB\uA8FD\uA8FE\uA90A-\uA925\uA930-\uA946\uA960-\uA97C\uA984-\uA9B2\uA9E0-\uA9E4\uA9E7-\uA9EF\uA9FA-\uA9FE\uAA00-\uAA28\uAA40-\uAA42\uAA44-\uAA4B\uAA60-\uAA6F\uAA71-\uAA76\uAA7A\uAA7E-\uAAAF\uAAB1\uAAB5\uAAB6\uAAB9-\uAABD\uAAC0\uAAC2\uAADB\uAADC\uAAE0-\uAAEA\uAAF2\uAB01-\uAB06\uAB09-\uAB0E\uAB11-\uAB16\uAB20-\uAB26\uAB28-\uAB2E\uABC0-\uABE2\uAC00-\uD7A3\uD7B0-\uD7C6\uD7CB-\uD7FB\uF900-\uFA6D\uFA70-\uFAD9\uFB1D\uFB1F-\uFB28\uFB2A-\uFB36\uFB38-\uFB3C\uFB3E\uFB40\uFB41\uFB43\uFB44\uFB46-\uFBB1\uFBD3-\uFD3D\uFD50-\uFD8F\uFD92-\uFDC7\uFDF0-\uFDFB\uFE70-\uFE74\uFE76-\uFEFC\uFF66-\uFF6F\uFF71-\uFF9D\uFFA0-\uFFBE\uFFC2-\uFFC7\uFFCA-\uFFCF\uFFD2-\uFFD7\uFFDA-\uFFDC', + 'astral': '\uD800[\uDC00-\uDC0B\uDC0D-\uDC26\uDC28-\uDC3A\uDC3C\uDC3D\uDC3F-\uDC4D\uDC50-\uDC5D\uDC80-\uDCFA\uDE80-\uDE9C\uDEA0-\uDED0\uDF00-\uDF1F\uDF2D-\uDF40\uDF42-\uDF49\uDF50-\uDF75\uDF80-\uDF9D\uDFA0-\uDFC3\uDFC8-\uDFCF]|\uD801[\uDC50-\uDC9D\uDD00-\uDD27\uDD30-\uDD63\uDE00-\uDF36\uDF40-\uDF55\uDF60-\uDF67]|\uD802[\uDC00-\uDC05\uDC08\uDC0A-\uDC35\uDC37\uDC38\uDC3C\uDC3F-\uDC55\uDC60-\uDC76\uDC80-\uDC9E\uDCE0-\uDCF2\uDCF4\uDCF5\uDD00-\uDD15\uDD20-\uDD39\uDD80-\uDDB7\uDDBE\uDDBF\uDE00\uDE10-\uDE13\uDE15-\uDE17\uDE19-\uDE35\uDE60-\uDE7C\uDE80-\uDE9C\uDEC0-\uDEC7\uDEC9-\uDEE4\uDF00-\uDF35\uDF40-\uDF55\uDF60-\uDF72\uDF80-\uDF91]|\uD803[\uDC00-\uDC48\uDD00-\uDD23\uDF00-\uDF1C\uDF27\uDF30-\uDF45]|\uD804[\uDC03-\uDC37\uDC83-\uDCAF\uDCD0-\uDCE8\uDD03-\uDD26\uDD44\uDD50-\uDD72\uDD76\uDD83-\uDDB2\uDDC1-\uDDC4\uDDDA\uDDDC\uDE00-\uDE11\uDE13-\uDE2B\uDE80-\uDE86\uDE88\uDE8A-\uDE8D\uDE8F-\uDE9D\uDE9F-\uDEA8\uDEB0-\uDEDE\uDF05-\uDF0C\uDF0F\uDF10\uDF13-\uDF28\uDF2A-\uDF30\uDF32\uDF33\uDF35-\uDF39\uDF3D\uDF50\uDF5D-\uDF61]|\uD805[\uDC00-\uDC34\uDC47-\uDC4A\uDC80-\uDCAF\uDCC4\uDCC5\uDCC7\uDD80-\uDDAE\uDDD8-\uDDDB\uDE00-\uDE2F\uDE44\uDE80-\uDEAA\uDF00-\uDF1A]|\uD806[\uDC00-\uDC2B\uDCFF\uDE00\uDE0B-\uDE32\uDE3A\uDE50\uDE5C-\uDE83\uDE86-\uDE89\uDE9D\uDEC0-\uDEF8]|\uD807[\uDC00-\uDC08\uDC0A-\uDC2E\uDC40\uDC72-\uDC8F\uDD00-\uDD06\uDD08\uDD09\uDD0B-\uDD30\uDD46\uDD60-\uDD65\uDD67\uDD68\uDD6A-\uDD89\uDD98\uDEE0-\uDEF2]|\uD808[\uDC00-\uDF99]|\uD809[\uDC80-\uDD43]|[\uD80C\uD81C-\uD820\uD840-\uD868\uD86A-\uD86C\uD86F-\uD872\uD874-\uD879][\uDC00-\uDFFF]|\uD80D[\uDC00-\uDC2E]|\uD811[\uDC00-\uDE46]|\uD81A[\uDC00-\uDE38\uDE40-\uDE5E\uDED0-\uDEED\uDF00-\uDF2F\uDF63-\uDF77\uDF7D-\uDF8F]|\uD81B[\uDF00-\uDF44\uDF50]|\uD821[\uDC00-\uDFF1]|\uD822[\uDC00-\uDEF2]|\uD82C[\uDC00-\uDD1E\uDD70-\uDEFB]|\uD82F[\uDC00-\uDC6A\uDC70-\uDC7C\uDC80-\uDC88\uDC90-\uDC99]|\uD83A[\uDC00-\uDCC4]|\uD83B[\uDE00-\uDE03\uDE05-\uDE1F\uDE21\uDE22\uDE24\uDE27\uDE29-\uDE32\uDE34-\uDE37\uDE39\uDE3B\uDE42\uDE47\uDE49\uDE4B\uDE4D-\uDE4F\uDE51\uDE52\uDE54\uDE57\uDE59\uDE5B\uDE5D\uDE5F\uDE61\uDE62\uDE64\uDE67-\uDE6A\uDE6C-\uDE72\uDE74-\uDE77\uDE79-\uDE7C\uDE7E\uDE80-\uDE89\uDE8B-\uDE9B\uDEA1-\uDEA3\uDEA5-\uDEA9\uDEAB-\uDEBB]|\uD869[\uDC00-\uDED6\uDF00-\uDFFF]|\uD86D[\uDC00-\uDF34\uDF40-\uDFFF]|\uD86E[\uDC00-\uDC1D\uDC20-\uDFFF]|\uD873[\uDC00-\uDEA1\uDEB0-\uDFFF]|\uD87A[\uDC00-\uDFE0]|\uD87E[\uDC00-\uDE1D]' + }, + { + 'name': 'Lt', + 'alias': 'Titlecase_Letter', + 'bmp': '\u01C5\u01C8\u01CB\u01F2\u1F88-\u1F8F\u1F98-\u1F9F\u1FA8-\u1FAF\u1FBC\u1FCC\u1FFC' + }, + { + 'name': 'Lu', + 'alias': 'Uppercase_Letter', + 'bmp': 'A-Z\xC0-\xD6\xD8-\xDE\u0100\u0102\u0104\u0106\u0108\u010A\u010C\u010E\u0110\u0112\u0114\u0116\u0118\u011A\u011C\u011E\u0120\u0122\u0124\u0126\u0128\u012A\u012C\u012E\u0130\u0132\u0134\u0136\u0139\u013B\u013D\u013F\u0141\u0143\u0145\u0147\u014A\u014C\u014E\u0150\u0152\u0154\u0156\u0158\u015A\u015C\u015E\u0160\u0162\u0164\u0166\u0168\u016A\u016C\u016E\u0170\u0172\u0174\u0176\u0178\u0179\u017B\u017D\u0181\u0182\u0184\u0186\u0187\u0189-\u018B\u018E-\u0191\u0193\u0194\u0196-\u0198\u019C\u019D\u019F\u01A0\u01A2\u01A4\u01A6\u01A7\u01A9\u01AC\u01AE\u01AF\u01B1-\u01B3\u01B5\u01B7\u01B8\u01BC\u01C4\u01C7\u01CA\u01CD\u01CF\u01D1\u01D3\u01D5\u01D7\u01D9\u01DB\u01DE\u01E0\u01E2\u01E4\u01E6\u01E8\u01EA\u01EC\u01EE\u01F1\u01F4\u01F6-\u01F8\u01FA\u01FC\u01FE\u0200\u0202\u0204\u0206\u0208\u020A\u020C\u020E\u0210\u0212\u0214\u0216\u0218\u021A\u021C\u021E\u0220\u0222\u0224\u0226\u0228\u022A\u022C\u022E\u0230\u0232\u023A\u023B\u023D\u023E\u0241\u0243-\u0246\u0248\u024A\u024C\u024E\u0370\u0372\u0376\u037F\u0386\u0388-\u038A\u038C\u038E\u038F\u0391-\u03A1\u03A3-\u03AB\u03CF\u03D2-\u03D4\u03D8\u03DA\u03DC\u03DE\u03E0\u03E2\u03E4\u03E6\u03E8\u03EA\u03EC\u03EE\u03F4\u03F7\u03F9\u03FA\u03FD-\u042F\u0460\u0462\u0464\u0466\u0468\u046A\u046C\u046E\u0470\u0472\u0474\u0476\u0478\u047A\u047C\u047E\u0480\u048A\u048C\u048E\u0490\u0492\u0494\u0496\u0498\u049A\u049C\u049E\u04A0\u04A2\u04A4\u04A6\u04A8\u04AA\u04AC\u04AE\u04B0\u04B2\u04B4\u04B6\u04B8\u04BA\u04BC\u04BE\u04C0\u04C1\u04C3\u04C5\u04C7\u04C9\u04CB\u04CD\u04D0\u04D2\u04D4\u04D6\u04D8\u04DA\u04DC\u04DE\u04E0\u04E2\u04E4\u04E6\u04E8\u04EA\u04EC\u04EE\u04F0\u04F2\u04F4\u04F6\u04F8\u04FA\u04FC\u04FE\u0500\u0502\u0504\u0506\u0508\u050A\u050C\u050E\u0510\u0512\u0514\u0516\u0518\u051A\u051C\u051E\u0520\u0522\u0524\u0526\u0528\u052A\u052C\u052E\u0531-\u0556\u10A0-\u10C5\u10C7\u10CD\u13A0-\u13F5\u1C90-\u1CBA\u1CBD-\u1CBF\u1E00\u1E02\u1E04\u1E06\u1E08\u1E0A\u1E0C\u1E0E\u1E10\u1E12\u1E14\u1E16\u1E18\u1E1A\u1E1C\u1E1E\u1E20\u1E22\u1E24\u1E26\u1E28\u1E2A\u1E2C\u1E2E\u1E30\u1E32\u1E34\u1E36\u1E38\u1E3A\u1E3C\u1E3E\u1E40\u1E42\u1E44\u1E46\u1E48\u1E4A\u1E4C\u1E4E\u1E50\u1E52\u1E54\u1E56\u1E58\u1E5A\u1E5C\u1E5E\u1E60\u1E62\u1E64\u1E66\u1E68\u1E6A\u1E6C\u1E6E\u1E70\u1E72\u1E74\u1E76\u1E78\u1E7A\u1E7C\u1E7E\u1E80\u1E82\u1E84\u1E86\u1E88\u1E8A\u1E8C\u1E8E\u1E90\u1E92\u1E94\u1E9E\u1EA0\u1EA2\u1EA4\u1EA6\u1EA8\u1EAA\u1EAC\u1EAE\u1EB0\u1EB2\u1EB4\u1EB6\u1EB8\u1EBA\u1EBC\u1EBE\u1EC0\u1EC2\u1EC4\u1EC6\u1EC8\u1ECA\u1ECC\u1ECE\u1ED0\u1ED2\u1ED4\u1ED6\u1ED8\u1EDA\u1EDC\u1EDE\u1EE0\u1EE2\u1EE4\u1EE6\u1EE8\u1EEA\u1EEC\u1EEE\u1EF0\u1EF2\u1EF4\u1EF6\u1EF8\u1EFA\u1EFC\u1EFE\u1F08-\u1F0F\u1F18-\u1F1D\u1F28-\u1F2F\u1F38-\u1F3F\u1F48-\u1F4D\u1F59\u1F5B\u1F5D\u1F5F\u1F68-\u1F6F\u1FB8-\u1FBB\u1FC8-\u1FCB\u1FD8-\u1FDB\u1FE8-\u1FEC\u1FF8-\u1FFB\u2102\u2107\u210B-\u210D\u2110-\u2112\u2115\u2119-\u211D\u2124\u2126\u2128\u212A-\u212D\u2130-\u2133\u213E\u213F\u2145\u2183\u2C00-\u2C2E\u2C60\u2C62-\u2C64\u2C67\u2C69\u2C6B\u2C6D-\u2C70\u2C72\u2C75\u2C7E-\u2C80\u2C82\u2C84\u2C86\u2C88\u2C8A\u2C8C\u2C8E\u2C90\u2C92\u2C94\u2C96\u2C98\u2C9A\u2C9C\u2C9E\u2CA0\u2CA2\u2CA4\u2CA6\u2CA8\u2CAA\u2CAC\u2CAE\u2CB0\u2CB2\u2CB4\u2CB6\u2CB8\u2CBA\u2CBC\u2CBE\u2CC0\u2CC2\u2CC4\u2CC6\u2CC8\u2CCA\u2CCC\u2CCE\u2CD0\u2CD2\u2CD4\u2CD6\u2CD8\u2CDA\u2CDC\u2CDE\u2CE0\u2CE2\u2CEB\u2CED\u2CF2\uA640\uA642\uA644\uA646\uA648\uA64A\uA64C\uA64E\uA650\uA652\uA654\uA656\uA658\uA65A\uA65C\uA65E\uA660\uA662\uA664\uA666\uA668\uA66A\uA66C\uA680\uA682\uA684\uA686\uA688\uA68A\uA68C\uA68E\uA690\uA692\uA694\uA696\uA698\uA69A\uA722\uA724\uA726\uA728\uA72A\uA72C\uA72E\uA732\uA734\uA736\uA738\uA73A\uA73C\uA73E\uA740\uA742\uA744\uA746\uA748\uA74A\uA74C\uA74E\uA750\uA752\uA754\uA756\uA758\uA75A\uA75C\uA75E\uA760\uA762\uA764\uA766\uA768\uA76A\uA76C\uA76E\uA779\uA77B\uA77D\uA77E\uA780\uA782\uA784\uA786\uA78B\uA78D\uA790\uA792\uA796\uA798\uA79A\uA79C\uA79E\uA7A0\uA7A2\uA7A4\uA7A6\uA7A8\uA7AA-\uA7AE\uA7B0-\uA7B4\uA7B6\uA7B8\uFF21-\uFF3A', + 'astral': '\uD801[\uDC00-\uDC27\uDCB0-\uDCD3]|\uD803[\uDC80-\uDCB2]|\uD806[\uDCA0-\uDCBF]|\uD81B[\uDE40-\uDE5F]|\uD835[\uDC00-\uDC19\uDC34-\uDC4D\uDC68-\uDC81\uDC9C\uDC9E\uDC9F\uDCA2\uDCA5\uDCA6\uDCA9-\uDCAC\uDCAE-\uDCB5\uDCD0-\uDCE9\uDD04\uDD05\uDD07-\uDD0A\uDD0D-\uDD14\uDD16-\uDD1C\uDD38\uDD39\uDD3B-\uDD3E\uDD40-\uDD44\uDD46\uDD4A-\uDD50\uDD6C-\uDD85\uDDA0-\uDDB9\uDDD4-\uDDED\uDE08-\uDE21\uDE3C-\uDE55\uDE70-\uDE89\uDEA8-\uDEC0\uDEE2-\uDEFA\uDF1C-\uDF34\uDF56-\uDF6E\uDF90-\uDFA8\uDFCA]|\uD83A[\uDD00-\uDD21]' + }, + { + 'name': 'M', + 'alias': 'Mark', + 'bmp': '\u0300-\u036F\u0483-\u0489\u0591-\u05BD\u05BF\u05C1\u05C2\u05C4\u05C5\u05C7\u0610-\u061A\u064B-\u065F\u0670\u06D6-\u06DC\u06DF-\u06E4\u06E7\u06E8\u06EA-\u06ED\u0711\u0730-\u074A\u07A6-\u07B0\u07EB-\u07F3\u07FD\u0816-\u0819\u081B-\u0823\u0825-\u0827\u0829-\u082D\u0859-\u085B\u08D3-\u08E1\u08E3-\u0903\u093A-\u093C\u093E-\u094F\u0951-\u0957\u0962\u0963\u0981-\u0983\u09BC\u09BE-\u09C4\u09C7\u09C8\u09CB-\u09CD\u09D7\u09E2\u09E3\u09FE\u0A01-\u0A03\u0A3C\u0A3E-\u0A42\u0A47\u0A48\u0A4B-\u0A4D\u0A51\u0A70\u0A71\u0A75\u0A81-\u0A83\u0ABC\u0ABE-\u0AC5\u0AC7-\u0AC9\u0ACB-\u0ACD\u0AE2\u0AE3\u0AFA-\u0AFF\u0B01-\u0B03\u0B3C\u0B3E-\u0B44\u0B47\u0B48\u0B4B-\u0B4D\u0B56\u0B57\u0B62\u0B63\u0B82\u0BBE-\u0BC2\u0BC6-\u0BC8\u0BCA-\u0BCD\u0BD7\u0C00-\u0C04\u0C3E-\u0C44\u0C46-\u0C48\u0C4A-\u0C4D\u0C55\u0C56\u0C62\u0C63\u0C81-\u0C83\u0CBC\u0CBE-\u0CC4\u0CC6-\u0CC8\u0CCA-\u0CCD\u0CD5\u0CD6\u0CE2\u0CE3\u0D00-\u0D03\u0D3B\u0D3C\u0D3E-\u0D44\u0D46-\u0D48\u0D4A-\u0D4D\u0D57\u0D62\u0D63\u0D82\u0D83\u0DCA\u0DCF-\u0DD4\u0DD6\u0DD8-\u0DDF\u0DF2\u0DF3\u0E31\u0E34-\u0E3A\u0E47-\u0E4E\u0EB1\u0EB4-\u0EB9\u0EBB\u0EBC\u0EC8-\u0ECD\u0F18\u0F19\u0F35\u0F37\u0F39\u0F3E\u0F3F\u0F71-\u0F84\u0F86\u0F87\u0F8D-\u0F97\u0F99-\u0FBC\u0FC6\u102B-\u103E\u1056-\u1059\u105E-\u1060\u1062-\u1064\u1067-\u106D\u1071-\u1074\u1082-\u108D\u108F\u109A-\u109D\u135D-\u135F\u1712-\u1714\u1732-\u1734\u1752\u1753\u1772\u1773\u17B4-\u17D3\u17DD\u180B-\u180D\u1885\u1886\u18A9\u1920-\u192B\u1930-\u193B\u1A17-\u1A1B\u1A55-\u1A5E\u1A60-\u1A7C\u1A7F\u1AB0-\u1ABE\u1B00-\u1B04\u1B34-\u1B44\u1B6B-\u1B73\u1B80-\u1B82\u1BA1-\u1BAD\u1BE6-\u1BF3\u1C24-\u1C37\u1CD0-\u1CD2\u1CD4-\u1CE8\u1CED\u1CF2-\u1CF4\u1CF7-\u1CF9\u1DC0-\u1DF9\u1DFB-\u1DFF\u20D0-\u20F0\u2CEF-\u2CF1\u2D7F\u2DE0-\u2DFF\u302A-\u302F\u3099\u309A\uA66F-\uA672\uA674-\uA67D\uA69E\uA69F\uA6F0\uA6F1\uA802\uA806\uA80B\uA823-\uA827\uA880\uA881\uA8B4-\uA8C5\uA8E0-\uA8F1\uA8FF\uA926-\uA92D\uA947-\uA953\uA980-\uA983\uA9B3-\uA9C0\uA9E5\uAA29-\uAA36\uAA43\uAA4C\uAA4D\uAA7B-\uAA7D\uAAB0\uAAB2-\uAAB4\uAAB7\uAAB8\uAABE\uAABF\uAAC1\uAAEB-\uAAEF\uAAF5\uAAF6\uABE3-\uABEA\uABEC\uABED\uFB1E\uFE00-\uFE0F\uFE20-\uFE2F', + 'astral': '\uD800[\uDDFD\uDEE0\uDF76-\uDF7A]|\uD802[\uDE01-\uDE03\uDE05\uDE06\uDE0C-\uDE0F\uDE38-\uDE3A\uDE3F\uDEE5\uDEE6]|\uD803[\uDD24-\uDD27\uDF46-\uDF50]|\uD804[\uDC00-\uDC02\uDC38-\uDC46\uDC7F-\uDC82\uDCB0-\uDCBA\uDD00-\uDD02\uDD27-\uDD34\uDD45\uDD46\uDD73\uDD80-\uDD82\uDDB3-\uDDC0\uDDC9-\uDDCC\uDE2C-\uDE37\uDE3E\uDEDF-\uDEEA\uDF00-\uDF03\uDF3B\uDF3C\uDF3E-\uDF44\uDF47\uDF48\uDF4B-\uDF4D\uDF57\uDF62\uDF63\uDF66-\uDF6C\uDF70-\uDF74]|\uD805[\uDC35-\uDC46\uDC5E\uDCB0-\uDCC3\uDDAF-\uDDB5\uDDB8-\uDDC0\uDDDC\uDDDD\uDE30-\uDE40\uDEAB-\uDEB7\uDF1D-\uDF2B]|\uD806[\uDC2C-\uDC3A\uDE01-\uDE0A\uDE33-\uDE39\uDE3B-\uDE3E\uDE47\uDE51-\uDE5B\uDE8A-\uDE99]|\uD807[\uDC2F-\uDC36\uDC38-\uDC3F\uDC92-\uDCA7\uDCA9-\uDCB6\uDD31-\uDD36\uDD3A\uDD3C\uDD3D\uDD3F-\uDD45\uDD47\uDD8A-\uDD8E\uDD90\uDD91\uDD93-\uDD97\uDEF3-\uDEF6]|\uD81A[\uDEF0-\uDEF4\uDF30-\uDF36]|\uD81B[\uDF51-\uDF7E\uDF8F-\uDF92]|\uD82F[\uDC9D\uDC9E]|\uD834[\uDD65-\uDD69\uDD6D-\uDD72\uDD7B-\uDD82\uDD85-\uDD8B\uDDAA-\uDDAD\uDE42-\uDE44]|\uD836[\uDE00-\uDE36\uDE3B-\uDE6C\uDE75\uDE84\uDE9B-\uDE9F\uDEA1-\uDEAF]|\uD838[\uDC00-\uDC06\uDC08-\uDC18\uDC1B-\uDC21\uDC23\uDC24\uDC26-\uDC2A]|\uD83A[\uDCD0-\uDCD6\uDD44-\uDD4A]|\uDB40[\uDD00-\uDDEF]' + }, + { + 'name': 'Mc', + 'alias': 'Spacing_Mark', + 'bmp': '\u0903\u093B\u093E-\u0940\u0949-\u094C\u094E\u094F\u0982\u0983\u09BE-\u09C0\u09C7\u09C8\u09CB\u09CC\u09D7\u0A03\u0A3E-\u0A40\u0A83\u0ABE-\u0AC0\u0AC9\u0ACB\u0ACC\u0B02\u0B03\u0B3E\u0B40\u0B47\u0B48\u0B4B\u0B4C\u0B57\u0BBE\u0BBF\u0BC1\u0BC2\u0BC6-\u0BC8\u0BCA-\u0BCC\u0BD7\u0C01-\u0C03\u0C41-\u0C44\u0C82\u0C83\u0CBE\u0CC0-\u0CC4\u0CC7\u0CC8\u0CCA\u0CCB\u0CD5\u0CD6\u0D02\u0D03\u0D3E-\u0D40\u0D46-\u0D48\u0D4A-\u0D4C\u0D57\u0D82\u0D83\u0DCF-\u0DD1\u0DD8-\u0DDF\u0DF2\u0DF3\u0F3E\u0F3F\u0F7F\u102B\u102C\u1031\u1038\u103B\u103C\u1056\u1057\u1062-\u1064\u1067-\u106D\u1083\u1084\u1087-\u108C\u108F\u109A-\u109C\u17B6\u17BE-\u17C5\u17C7\u17C8\u1923-\u1926\u1929-\u192B\u1930\u1931\u1933-\u1938\u1A19\u1A1A\u1A55\u1A57\u1A61\u1A63\u1A64\u1A6D-\u1A72\u1B04\u1B35\u1B3B\u1B3D-\u1B41\u1B43\u1B44\u1B82\u1BA1\u1BA6\u1BA7\u1BAA\u1BE7\u1BEA-\u1BEC\u1BEE\u1BF2\u1BF3\u1C24-\u1C2B\u1C34\u1C35\u1CE1\u1CF2\u1CF3\u1CF7\u302E\u302F\uA823\uA824\uA827\uA880\uA881\uA8B4-\uA8C3\uA952\uA953\uA983\uA9B4\uA9B5\uA9BA\uA9BB\uA9BD-\uA9C0\uAA2F\uAA30\uAA33\uAA34\uAA4D\uAA7B\uAA7D\uAAEB\uAAEE\uAAEF\uAAF5\uABE3\uABE4\uABE6\uABE7\uABE9\uABEA\uABEC', + 'astral': '\uD804[\uDC00\uDC02\uDC82\uDCB0-\uDCB2\uDCB7\uDCB8\uDD2C\uDD45\uDD46\uDD82\uDDB3-\uDDB5\uDDBF\uDDC0\uDE2C-\uDE2E\uDE32\uDE33\uDE35\uDEE0-\uDEE2\uDF02\uDF03\uDF3E\uDF3F\uDF41-\uDF44\uDF47\uDF48\uDF4B-\uDF4D\uDF57\uDF62\uDF63]|\uD805[\uDC35-\uDC37\uDC40\uDC41\uDC45\uDCB0-\uDCB2\uDCB9\uDCBB-\uDCBE\uDCC1\uDDAF-\uDDB1\uDDB8-\uDDBB\uDDBE\uDE30-\uDE32\uDE3B\uDE3C\uDE3E\uDEAC\uDEAE\uDEAF\uDEB6\uDF20\uDF21\uDF26]|\uD806[\uDC2C-\uDC2E\uDC38\uDE39\uDE57\uDE58\uDE97]|\uD807[\uDC2F\uDC3E\uDCA9\uDCB1\uDCB4\uDD8A-\uDD8E\uDD93\uDD94\uDD96\uDEF5\uDEF6]|\uD81B[\uDF51-\uDF7E]|\uD834[\uDD65\uDD66\uDD6D-\uDD72]' + }, + { + 'name': 'Me', + 'alias': 'Enclosing_Mark', + 'bmp': '\u0488\u0489\u1ABE\u20DD-\u20E0\u20E2-\u20E4\uA670-\uA672' + }, + { + 'name': 'Mn', + 'alias': 'Nonspacing_Mark', + 'bmp': '\u0300-\u036F\u0483-\u0487\u0591-\u05BD\u05BF\u05C1\u05C2\u05C4\u05C5\u05C7\u0610-\u061A\u064B-\u065F\u0670\u06D6-\u06DC\u06DF-\u06E4\u06E7\u06E8\u06EA-\u06ED\u0711\u0730-\u074A\u07A6-\u07B0\u07EB-\u07F3\u07FD\u0816-\u0819\u081B-\u0823\u0825-\u0827\u0829-\u082D\u0859-\u085B\u08D3-\u08E1\u08E3-\u0902\u093A\u093C\u0941-\u0948\u094D\u0951-\u0957\u0962\u0963\u0981\u09BC\u09C1-\u09C4\u09CD\u09E2\u09E3\u09FE\u0A01\u0A02\u0A3C\u0A41\u0A42\u0A47\u0A48\u0A4B-\u0A4D\u0A51\u0A70\u0A71\u0A75\u0A81\u0A82\u0ABC\u0AC1-\u0AC5\u0AC7\u0AC8\u0ACD\u0AE2\u0AE3\u0AFA-\u0AFF\u0B01\u0B3C\u0B3F\u0B41-\u0B44\u0B4D\u0B56\u0B62\u0B63\u0B82\u0BC0\u0BCD\u0C00\u0C04\u0C3E-\u0C40\u0C46-\u0C48\u0C4A-\u0C4D\u0C55\u0C56\u0C62\u0C63\u0C81\u0CBC\u0CBF\u0CC6\u0CCC\u0CCD\u0CE2\u0CE3\u0D00\u0D01\u0D3B\u0D3C\u0D41-\u0D44\u0D4D\u0D62\u0D63\u0DCA\u0DD2-\u0DD4\u0DD6\u0E31\u0E34-\u0E3A\u0E47-\u0E4E\u0EB1\u0EB4-\u0EB9\u0EBB\u0EBC\u0EC8-\u0ECD\u0F18\u0F19\u0F35\u0F37\u0F39\u0F71-\u0F7E\u0F80-\u0F84\u0F86\u0F87\u0F8D-\u0F97\u0F99-\u0FBC\u0FC6\u102D-\u1030\u1032-\u1037\u1039\u103A\u103D\u103E\u1058\u1059\u105E-\u1060\u1071-\u1074\u1082\u1085\u1086\u108D\u109D\u135D-\u135F\u1712-\u1714\u1732-\u1734\u1752\u1753\u1772\u1773\u17B4\u17B5\u17B7-\u17BD\u17C6\u17C9-\u17D3\u17DD\u180B-\u180D\u1885\u1886\u18A9\u1920-\u1922\u1927\u1928\u1932\u1939-\u193B\u1A17\u1A18\u1A1B\u1A56\u1A58-\u1A5E\u1A60\u1A62\u1A65-\u1A6C\u1A73-\u1A7C\u1A7F\u1AB0-\u1ABD\u1B00-\u1B03\u1B34\u1B36-\u1B3A\u1B3C\u1B42\u1B6B-\u1B73\u1B80\u1B81\u1BA2-\u1BA5\u1BA8\u1BA9\u1BAB-\u1BAD\u1BE6\u1BE8\u1BE9\u1BED\u1BEF-\u1BF1\u1C2C-\u1C33\u1C36\u1C37\u1CD0-\u1CD2\u1CD4-\u1CE0\u1CE2-\u1CE8\u1CED\u1CF4\u1CF8\u1CF9\u1DC0-\u1DF9\u1DFB-\u1DFF\u20D0-\u20DC\u20E1\u20E5-\u20F0\u2CEF-\u2CF1\u2D7F\u2DE0-\u2DFF\u302A-\u302D\u3099\u309A\uA66F\uA674-\uA67D\uA69E\uA69F\uA6F0\uA6F1\uA802\uA806\uA80B\uA825\uA826\uA8C4\uA8C5\uA8E0-\uA8F1\uA8FF\uA926-\uA92D\uA947-\uA951\uA980-\uA982\uA9B3\uA9B6-\uA9B9\uA9BC\uA9E5\uAA29-\uAA2E\uAA31\uAA32\uAA35\uAA36\uAA43\uAA4C\uAA7C\uAAB0\uAAB2-\uAAB4\uAAB7\uAAB8\uAABE\uAABF\uAAC1\uAAEC\uAAED\uAAF6\uABE5\uABE8\uABED\uFB1E\uFE00-\uFE0F\uFE20-\uFE2F', + 'astral': '\uD800[\uDDFD\uDEE0\uDF76-\uDF7A]|\uD802[\uDE01-\uDE03\uDE05\uDE06\uDE0C-\uDE0F\uDE38-\uDE3A\uDE3F\uDEE5\uDEE6]|\uD803[\uDD24-\uDD27\uDF46-\uDF50]|\uD804[\uDC01\uDC38-\uDC46\uDC7F-\uDC81\uDCB3-\uDCB6\uDCB9\uDCBA\uDD00-\uDD02\uDD27-\uDD2B\uDD2D-\uDD34\uDD73\uDD80\uDD81\uDDB6-\uDDBE\uDDC9-\uDDCC\uDE2F-\uDE31\uDE34\uDE36\uDE37\uDE3E\uDEDF\uDEE3-\uDEEA\uDF00\uDF01\uDF3B\uDF3C\uDF40\uDF66-\uDF6C\uDF70-\uDF74]|\uD805[\uDC38-\uDC3F\uDC42-\uDC44\uDC46\uDC5E\uDCB3-\uDCB8\uDCBA\uDCBF\uDCC0\uDCC2\uDCC3\uDDB2-\uDDB5\uDDBC\uDDBD\uDDBF\uDDC0\uDDDC\uDDDD\uDE33-\uDE3A\uDE3D\uDE3F\uDE40\uDEAB\uDEAD\uDEB0-\uDEB5\uDEB7\uDF1D-\uDF1F\uDF22-\uDF25\uDF27-\uDF2B]|\uD806[\uDC2F-\uDC37\uDC39\uDC3A\uDE01-\uDE0A\uDE33-\uDE38\uDE3B-\uDE3E\uDE47\uDE51-\uDE56\uDE59-\uDE5B\uDE8A-\uDE96\uDE98\uDE99]|\uD807[\uDC30-\uDC36\uDC38-\uDC3D\uDC3F\uDC92-\uDCA7\uDCAA-\uDCB0\uDCB2\uDCB3\uDCB5\uDCB6\uDD31-\uDD36\uDD3A\uDD3C\uDD3D\uDD3F-\uDD45\uDD47\uDD90\uDD91\uDD95\uDD97\uDEF3\uDEF4]|\uD81A[\uDEF0-\uDEF4\uDF30-\uDF36]|\uD81B[\uDF8F-\uDF92]|\uD82F[\uDC9D\uDC9E]|\uD834[\uDD67-\uDD69\uDD7B-\uDD82\uDD85-\uDD8B\uDDAA-\uDDAD\uDE42-\uDE44]|\uD836[\uDE00-\uDE36\uDE3B-\uDE6C\uDE75\uDE84\uDE9B-\uDE9F\uDEA1-\uDEAF]|\uD838[\uDC00-\uDC06\uDC08-\uDC18\uDC1B-\uDC21\uDC23\uDC24\uDC26-\uDC2A]|\uD83A[\uDCD0-\uDCD6\uDD44-\uDD4A]|\uDB40[\uDD00-\uDDEF]' + }, + { + 'name': 'N', + 'alias': 'Number', + 'bmp': '0-9\xB2\xB3\xB9\xBC-\xBE\u0660-\u0669\u06F0-\u06F9\u07C0-\u07C9\u0966-\u096F\u09E6-\u09EF\u09F4-\u09F9\u0A66-\u0A6F\u0AE6-\u0AEF\u0B66-\u0B6F\u0B72-\u0B77\u0BE6-\u0BF2\u0C66-\u0C6F\u0C78-\u0C7E\u0CE6-\u0CEF\u0D58-\u0D5E\u0D66-\u0D78\u0DE6-\u0DEF\u0E50-\u0E59\u0ED0-\u0ED9\u0F20-\u0F33\u1040-\u1049\u1090-\u1099\u1369-\u137C\u16EE-\u16F0\u17E0-\u17E9\u17F0-\u17F9\u1810-\u1819\u1946-\u194F\u19D0-\u19DA\u1A80-\u1A89\u1A90-\u1A99\u1B50-\u1B59\u1BB0-\u1BB9\u1C40-\u1C49\u1C50-\u1C59\u2070\u2074-\u2079\u2080-\u2089\u2150-\u2182\u2185-\u2189\u2460-\u249B\u24EA-\u24FF\u2776-\u2793\u2CFD\u3007\u3021-\u3029\u3038-\u303A\u3192-\u3195\u3220-\u3229\u3248-\u324F\u3251-\u325F\u3280-\u3289\u32B1-\u32BF\uA620-\uA629\uA6E6-\uA6EF\uA830-\uA835\uA8D0-\uA8D9\uA900-\uA909\uA9D0-\uA9D9\uA9F0-\uA9F9\uAA50-\uAA59\uABF0-\uABF9\uFF10-\uFF19', + 'astral': '\uD800[\uDD07-\uDD33\uDD40-\uDD78\uDD8A\uDD8B\uDEE1-\uDEFB\uDF20-\uDF23\uDF41\uDF4A\uDFD1-\uDFD5]|\uD801[\uDCA0-\uDCA9]|\uD802[\uDC58-\uDC5F\uDC79-\uDC7F\uDCA7-\uDCAF\uDCFB-\uDCFF\uDD16-\uDD1B\uDDBC\uDDBD\uDDC0-\uDDCF\uDDD2-\uDDFF\uDE40-\uDE48\uDE7D\uDE7E\uDE9D-\uDE9F\uDEEB-\uDEEF\uDF58-\uDF5F\uDF78-\uDF7F\uDFA9-\uDFAF]|\uD803[\uDCFA-\uDCFF\uDD30-\uDD39\uDE60-\uDE7E\uDF1D-\uDF26\uDF51-\uDF54]|\uD804[\uDC52-\uDC6F\uDCF0-\uDCF9\uDD36-\uDD3F\uDDD0-\uDDD9\uDDE1-\uDDF4\uDEF0-\uDEF9]|\uD805[\uDC50-\uDC59\uDCD0-\uDCD9\uDE50-\uDE59\uDEC0-\uDEC9\uDF30-\uDF3B]|\uD806[\uDCE0-\uDCF2]|\uD807[\uDC50-\uDC6C\uDD50-\uDD59\uDDA0-\uDDA9]|\uD809[\uDC00-\uDC6E]|\uD81A[\uDE60-\uDE69\uDF50-\uDF59\uDF5B-\uDF61]|\uD81B[\uDE80-\uDE96]|\uD834[\uDEE0-\uDEF3\uDF60-\uDF78]|\uD835[\uDFCE-\uDFFF]|\uD83A[\uDCC7-\uDCCF\uDD50-\uDD59]|\uD83B[\uDC71-\uDCAB\uDCAD-\uDCAF\uDCB1-\uDCB4]|\uD83C[\uDD00-\uDD0C]' + }, + { + 'name': 'Nd', + 'alias': 'Decimal_Number', + 'bmp': '0-9\u0660-\u0669\u06F0-\u06F9\u07C0-\u07C9\u0966-\u096F\u09E6-\u09EF\u0A66-\u0A6F\u0AE6-\u0AEF\u0B66-\u0B6F\u0BE6-\u0BEF\u0C66-\u0C6F\u0CE6-\u0CEF\u0D66-\u0D6F\u0DE6-\u0DEF\u0E50-\u0E59\u0ED0-\u0ED9\u0F20-\u0F29\u1040-\u1049\u1090-\u1099\u17E0-\u17E9\u1810-\u1819\u1946-\u194F\u19D0-\u19D9\u1A80-\u1A89\u1A90-\u1A99\u1B50-\u1B59\u1BB0-\u1BB9\u1C40-\u1C49\u1C50-\u1C59\uA620-\uA629\uA8D0-\uA8D9\uA900-\uA909\uA9D0-\uA9D9\uA9F0-\uA9F9\uAA50-\uAA59\uABF0-\uABF9\uFF10-\uFF19', + 'astral': '\uD801[\uDCA0-\uDCA9]|\uD803[\uDD30-\uDD39]|\uD804[\uDC66-\uDC6F\uDCF0-\uDCF9\uDD36-\uDD3F\uDDD0-\uDDD9\uDEF0-\uDEF9]|\uD805[\uDC50-\uDC59\uDCD0-\uDCD9\uDE50-\uDE59\uDEC0-\uDEC9\uDF30-\uDF39]|\uD806[\uDCE0-\uDCE9]|\uD807[\uDC50-\uDC59\uDD50-\uDD59\uDDA0-\uDDA9]|\uD81A[\uDE60-\uDE69\uDF50-\uDF59]|\uD835[\uDFCE-\uDFFF]|\uD83A[\uDD50-\uDD59]' + }, + { + 'name': 'Nl', + 'alias': 'Letter_Number', + 'bmp': '\u16EE-\u16F0\u2160-\u2182\u2185-\u2188\u3007\u3021-\u3029\u3038-\u303A\uA6E6-\uA6EF', + 'astral': '\uD800[\uDD40-\uDD74\uDF41\uDF4A\uDFD1-\uDFD5]|\uD809[\uDC00-\uDC6E]' + }, + { + 'name': 'No', + 'alias': 'Other_Number', + 'bmp': '\xB2\xB3\xB9\xBC-\xBE\u09F4-\u09F9\u0B72-\u0B77\u0BF0-\u0BF2\u0C78-\u0C7E\u0D58-\u0D5E\u0D70-\u0D78\u0F2A-\u0F33\u1369-\u137C\u17F0-\u17F9\u19DA\u2070\u2074-\u2079\u2080-\u2089\u2150-\u215F\u2189\u2460-\u249B\u24EA-\u24FF\u2776-\u2793\u2CFD\u3192-\u3195\u3220-\u3229\u3248-\u324F\u3251-\u325F\u3280-\u3289\u32B1-\u32BF\uA830-\uA835', + 'astral': '\uD800[\uDD07-\uDD33\uDD75-\uDD78\uDD8A\uDD8B\uDEE1-\uDEFB\uDF20-\uDF23]|\uD802[\uDC58-\uDC5F\uDC79-\uDC7F\uDCA7-\uDCAF\uDCFB-\uDCFF\uDD16-\uDD1B\uDDBC\uDDBD\uDDC0-\uDDCF\uDDD2-\uDDFF\uDE40-\uDE48\uDE7D\uDE7E\uDE9D-\uDE9F\uDEEB-\uDEEF\uDF58-\uDF5F\uDF78-\uDF7F\uDFA9-\uDFAF]|\uD803[\uDCFA-\uDCFF\uDE60-\uDE7E\uDF1D-\uDF26\uDF51-\uDF54]|\uD804[\uDC52-\uDC65\uDDE1-\uDDF4]|\uD805[\uDF3A\uDF3B]|\uD806[\uDCEA-\uDCF2]|\uD807[\uDC5A-\uDC6C]|\uD81A[\uDF5B-\uDF61]|\uD81B[\uDE80-\uDE96]|\uD834[\uDEE0-\uDEF3\uDF60-\uDF78]|\uD83A[\uDCC7-\uDCCF]|\uD83B[\uDC71-\uDCAB\uDCAD-\uDCAF\uDCB1-\uDCB4]|\uD83C[\uDD00-\uDD0C]' + }, + { + 'name': 'P', + 'alias': 'Punctuation', + 'bmp': '!-#%-\\*,-\\/:;\\?@\\[-\\]_\\{\\}\xA1\xA7\xAB\xB6\xB7\xBB\xBF\u037E\u0387\u055A-\u055F\u0589\u058A\u05BE\u05C0\u05C3\u05C6\u05F3\u05F4\u0609\u060A\u060C\u060D\u061B\u061E\u061F\u066A-\u066D\u06D4\u0700-\u070D\u07F7-\u07F9\u0830-\u083E\u085E\u0964\u0965\u0970\u09FD\u0A76\u0AF0\u0C84\u0DF4\u0E4F\u0E5A\u0E5B\u0F04-\u0F12\u0F14\u0F3A-\u0F3D\u0F85\u0FD0-\u0FD4\u0FD9\u0FDA\u104A-\u104F\u10FB\u1360-\u1368\u1400\u166D\u166E\u169B\u169C\u16EB-\u16ED\u1735\u1736\u17D4-\u17D6\u17D8-\u17DA\u1800-\u180A\u1944\u1945\u1A1E\u1A1F\u1AA0-\u1AA6\u1AA8-\u1AAD\u1B5A-\u1B60\u1BFC-\u1BFF\u1C3B-\u1C3F\u1C7E\u1C7F\u1CC0-\u1CC7\u1CD3\u2010-\u2027\u2030-\u2043\u2045-\u2051\u2053-\u205E\u207D\u207E\u208D\u208E\u2308-\u230B\u2329\u232A\u2768-\u2775\u27C5\u27C6\u27E6-\u27EF\u2983-\u2998\u29D8-\u29DB\u29FC\u29FD\u2CF9-\u2CFC\u2CFE\u2CFF\u2D70\u2E00-\u2E2E\u2E30-\u2E4E\u3001-\u3003\u3008-\u3011\u3014-\u301F\u3030\u303D\u30A0\u30FB\uA4FE\uA4FF\uA60D-\uA60F\uA673\uA67E\uA6F2-\uA6F7\uA874-\uA877\uA8CE\uA8CF\uA8F8-\uA8FA\uA8FC\uA92E\uA92F\uA95F\uA9C1-\uA9CD\uA9DE\uA9DF\uAA5C-\uAA5F\uAADE\uAADF\uAAF0\uAAF1\uABEB\uFD3E\uFD3F\uFE10-\uFE19\uFE30-\uFE52\uFE54-\uFE61\uFE63\uFE68\uFE6A\uFE6B\uFF01-\uFF03\uFF05-\uFF0A\uFF0C-\uFF0F\uFF1A\uFF1B\uFF1F\uFF20\uFF3B-\uFF3D\uFF3F\uFF5B\uFF5D\uFF5F-\uFF65', + 'astral': '\uD800[\uDD00-\uDD02\uDF9F\uDFD0]|\uD801\uDD6F|\uD802[\uDC57\uDD1F\uDD3F\uDE50-\uDE58\uDE7F\uDEF0-\uDEF6\uDF39-\uDF3F\uDF99-\uDF9C]|\uD803[\uDF55-\uDF59]|\uD804[\uDC47-\uDC4D\uDCBB\uDCBC\uDCBE-\uDCC1\uDD40-\uDD43\uDD74\uDD75\uDDC5-\uDDC8\uDDCD\uDDDB\uDDDD-\uDDDF\uDE38-\uDE3D\uDEA9]|\uD805[\uDC4B-\uDC4F\uDC5B\uDC5D\uDCC6\uDDC1-\uDDD7\uDE41-\uDE43\uDE60-\uDE6C\uDF3C-\uDF3E]|\uD806[\uDC3B\uDE3F-\uDE46\uDE9A-\uDE9C\uDE9E-\uDEA2]|\uD807[\uDC41-\uDC45\uDC70\uDC71\uDEF7\uDEF8]|\uD809[\uDC70-\uDC74]|\uD81A[\uDE6E\uDE6F\uDEF5\uDF37-\uDF3B\uDF44]|\uD81B[\uDE97-\uDE9A]|\uD82F\uDC9F|\uD836[\uDE87-\uDE8B]|\uD83A[\uDD5E\uDD5F]' + }, + { + 'name': 'Pc', + 'alias': 'Connector_Punctuation', + 'bmp': '_\u203F\u2040\u2054\uFE33\uFE34\uFE4D-\uFE4F\uFF3F' + }, + { + 'name': 'Pd', + 'alias': 'Dash_Punctuation', + 'bmp': '\\-\u058A\u05BE\u1400\u1806\u2010-\u2015\u2E17\u2E1A\u2E3A\u2E3B\u2E40\u301C\u3030\u30A0\uFE31\uFE32\uFE58\uFE63\uFF0D' + }, + { + 'name': 'Pe', + 'alias': 'Close_Punctuation', + 'bmp': '\\)\\]\\}\u0F3B\u0F3D\u169C\u2046\u207E\u208E\u2309\u230B\u232A\u2769\u276B\u276D\u276F\u2771\u2773\u2775\u27C6\u27E7\u27E9\u27EB\u27ED\u27EF\u2984\u2986\u2988\u298A\u298C\u298E\u2990\u2992\u2994\u2996\u2998\u29D9\u29DB\u29FD\u2E23\u2E25\u2E27\u2E29\u3009\u300B\u300D\u300F\u3011\u3015\u3017\u3019\u301B\u301E\u301F\uFD3E\uFE18\uFE36\uFE38\uFE3A\uFE3C\uFE3E\uFE40\uFE42\uFE44\uFE48\uFE5A\uFE5C\uFE5E\uFF09\uFF3D\uFF5D\uFF60\uFF63' + }, + { + 'name': 'Pf', + 'alias': 'Final_Punctuation', + 'bmp': '\xBB\u2019\u201D\u203A\u2E03\u2E05\u2E0A\u2E0D\u2E1D\u2E21' + }, + { + 'name': 'Pi', + 'alias': 'Initial_Punctuation', + 'bmp': '\xAB\u2018\u201B\u201C\u201F\u2039\u2E02\u2E04\u2E09\u2E0C\u2E1C\u2E20' + }, + { + 'name': 'Po', + 'alias': 'Other_Punctuation', + 'bmp': '!-#%-\'\\*,\\.\\/:;\\?@\\\xA1\xA7\xB6\xB7\xBF\u037E\u0387\u055A-\u055F\u0589\u05C0\u05C3\u05C6\u05F3\u05F4\u0609\u060A\u060C\u060D\u061B\u061E\u061F\u066A-\u066D\u06D4\u0700-\u070D\u07F7-\u07F9\u0830-\u083E\u085E\u0964\u0965\u0970\u09FD\u0A76\u0AF0\u0C84\u0DF4\u0E4F\u0E5A\u0E5B\u0F04-\u0F12\u0F14\u0F85\u0FD0-\u0FD4\u0FD9\u0FDA\u104A-\u104F\u10FB\u1360-\u1368\u166D\u166E\u16EB-\u16ED\u1735\u1736\u17D4-\u17D6\u17D8-\u17DA\u1800-\u1805\u1807-\u180A\u1944\u1945\u1A1E\u1A1F\u1AA0-\u1AA6\u1AA8-\u1AAD\u1B5A-\u1B60\u1BFC-\u1BFF\u1C3B-\u1C3F\u1C7E\u1C7F\u1CC0-\u1CC7\u1CD3\u2016\u2017\u2020-\u2027\u2030-\u2038\u203B-\u203E\u2041-\u2043\u2047-\u2051\u2053\u2055-\u205E\u2CF9-\u2CFC\u2CFE\u2CFF\u2D70\u2E00\u2E01\u2E06-\u2E08\u2E0B\u2E0E-\u2E16\u2E18\u2E19\u2E1B\u2E1E\u2E1F\u2E2A-\u2E2E\u2E30-\u2E39\u2E3C-\u2E3F\u2E41\u2E43-\u2E4E\u3001-\u3003\u303D\u30FB\uA4FE\uA4FF\uA60D-\uA60F\uA673\uA67E\uA6F2-\uA6F7\uA874-\uA877\uA8CE\uA8CF\uA8F8-\uA8FA\uA8FC\uA92E\uA92F\uA95F\uA9C1-\uA9CD\uA9DE\uA9DF\uAA5C-\uAA5F\uAADE\uAADF\uAAF0\uAAF1\uABEB\uFE10-\uFE16\uFE19\uFE30\uFE45\uFE46\uFE49-\uFE4C\uFE50-\uFE52\uFE54-\uFE57\uFE5F-\uFE61\uFE68\uFE6A\uFE6B\uFF01-\uFF03\uFF05-\uFF07\uFF0A\uFF0C\uFF0E\uFF0F\uFF1A\uFF1B\uFF1F\uFF20\uFF3C\uFF61\uFF64\uFF65', + 'astral': '\uD800[\uDD00-\uDD02\uDF9F\uDFD0]|\uD801\uDD6F|\uD802[\uDC57\uDD1F\uDD3F\uDE50-\uDE58\uDE7F\uDEF0-\uDEF6\uDF39-\uDF3F\uDF99-\uDF9C]|\uD803[\uDF55-\uDF59]|\uD804[\uDC47-\uDC4D\uDCBB\uDCBC\uDCBE-\uDCC1\uDD40-\uDD43\uDD74\uDD75\uDDC5-\uDDC8\uDDCD\uDDDB\uDDDD-\uDDDF\uDE38-\uDE3D\uDEA9]|\uD805[\uDC4B-\uDC4F\uDC5B\uDC5D\uDCC6\uDDC1-\uDDD7\uDE41-\uDE43\uDE60-\uDE6C\uDF3C-\uDF3E]|\uD806[\uDC3B\uDE3F-\uDE46\uDE9A-\uDE9C\uDE9E-\uDEA2]|\uD807[\uDC41-\uDC45\uDC70\uDC71\uDEF7\uDEF8]|\uD809[\uDC70-\uDC74]|\uD81A[\uDE6E\uDE6F\uDEF5\uDF37-\uDF3B\uDF44]|\uD81B[\uDE97-\uDE9A]|\uD82F\uDC9F|\uD836[\uDE87-\uDE8B]|\uD83A[\uDD5E\uDD5F]' + }, + { + 'name': 'Ps', + 'alias': 'Open_Punctuation', + 'bmp': '\\(\\[\\{\u0F3A\u0F3C\u169B\u201A\u201E\u2045\u207D\u208D\u2308\u230A\u2329\u2768\u276A\u276C\u276E\u2770\u2772\u2774\u27C5\u27E6\u27E8\u27EA\u27EC\u27EE\u2983\u2985\u2987\u2989\u298B\u298D\u298F\u2991\u2993\u2995\u2997\u29D8\u29DA\u29FC\u2E22\u2E24\u2E26\u2E28\u2E42\u3008\u300A\u300C\u300E\u3010\u3014\u3016\u3018\u301A\u301D\uFD3F\uFE17\uFE35\uFE37\uFE39\uFE3B\uFE3D\uFE3F\uFE41\uFE43\uFE47\uFE59\uFE5B\uFE5D\uFF08\uFF3B\uFF5B\uFF5F\uFF62' + }, + { + 'name': 'S', + 'alias': 'Symbol', + 'bmp': '\\$\\+<->\\^`\\|~\xA2-\xA6\xA8\xA9\xAC\xAE-\xB1\xB4\xB8\xD7\xF7\u02C2-\u02C5\u02D2-\u02DF\u02E5-\u02EB\u02ED\u02EF-\u02FF\u0375\u0384\u0385\u03F6\u0482\u058D-\u058F\u0606-\u0608\u060B\u060E\u060F\u06DE\u06E9\u06FD\u06FE\u07F6\u07FE\u07FF\u09F2\u09F3\u09FA\u09FB\u0AF1\u0B70\u0BF3-\u0BFA\u0C7F\u0D4F\u0D79\u0E3F\u0F01-\u0F03\u0F13\u0F15-\u0F17\u0F1A-\u0F1F\u0F34\u0F36\u0F38\u0FBE-\u0FC5\u0FC7-\u0FCC\u0FCE\u0FCF\u0FD5-\u0FD8\u109E\u109F\u1390-\u1399\u17DB\u1940\u19DE-\u19FF\u1B61-\u1B6A\u1B74-\u1B7C\u1FBD\u1FBF-\u1FC1\u1FCD-\u1FCF\u1FDD-\u1FDF\u1FED-\u1FEF\u1FFD\u1FFE\u2044\u2052\u207A-\u207C\u208A-\u208C\u20A0-\u20BF\u2100\u2101\u2103-\u2106\u2108\u2109\u2114\u2116-\u2118\u211E-\u2123\u2125\u2127\u2129\u212E\u213A\u213B\u2140-\u2144\u214A-\u214D\u214F\u218A\u218B\u2190-\u2307\u230C-\u2328\u232B-\u2426\u2440-\u244A\u249C-\u24E9\u2500-\u2767\u2794-\u27C4\u27C7-\u27E5\u27F0-\u2982\u2999-\u29D7\u29DC-\u29FB\u29FE-\u2B73\u2B76-\u2B95\u2B98-\u2BC8\u2BCA-\u2BFE\u2CE5-\u2CEA\u2E80-\u2E99\u2E9B-\u2EF3\u2F00-\u2FD5\u2FF0-\u2FFB\u3004\u3012\u3013\u3020\u3036\u3037\u303E\u303F\u309B\u309C\u3190\u3191\u3196-\u319F\u31C0-\u31E3\u3200-\u321E\u322A-\u3247\u3250\u3260-\u327F\u328A-\u32B0\u32C0-\u32FE\u3300-\u33FF\u4DC0-\u4DFF\uA490-\uA4C6\uA700-\uA716\uA720\uA721\uA789\uA78A\uA828-\uA82B\uA836-\uA839\uAA77-\uAA79\uAB5B\uFB29\uFBB2-\uFBC1\uFDFC\uFDFD\uFE62\uFE64-\uFE66\uFE69\uFF04\uFF0B\uFF1C-\uFF1E\uFF3E\uFF40\uFF5C\uFF5E\uFFE0-\uFFE6\uFFE8-\uFFEE\uFFFC\uFFFD', + 'astral': '\uD800[\uDD37-\uDD3F\uDD79-\uDD89\uDD8C-\uDD8E\uDD90-\uDD9B\uDDA0\uDDD0-\uDDFC]|\uD802[\uDC77\uDC78\uDEC8]|\uD805\uDF3F|\uD81A[\uDF3C-\uDF3F\uDF45]|\uD82F\uDC9C|\uD834[\uDC00-\uDCF5\uDD00-\uDD26\uDD29-\uDD64\uDD6A-\uDD6C\uDD83\uDD84\uDD8C-\uDDA9\uDDAE-\uDDE8\uDE00-\uDE41\uDE45\uDF00-\uDF56]|\uD835[\uDEC1\uDEDB\uDEFB\uDF15\uDF35\uDF4F\uDF6F\uDF89\uDFA9\uDFC3]|\uD836[\uDC00-\uDDFF\uDE37-\uDE3A\uDE6D-\uDE74\uDE76-\uDE83\uDE85\uDE86]|\uD83B[\uDCAC\uDCB0\uDEF0\uDEF1]|\uD83C[\uDC00-\uDC2B\uDC30-\uDC93\uDCA0-\uDCAE\uDCB1-\uDCBF\uDCC1-\uDCCF\uDCD1-\uDCF5\uDD10-\uDD6B\uDD70-\uDDAC\uDDE6-\uDE02\uDE10-\uDE3B\uDE40-\uDE48\uDE50\uDE51\uDE60-\uDE65\uDF00-\uDFFF]|\uD83D[\uDC00-\uDED4\uDEE0-\uDEEC\uDEF0-\uDEF9\uDF00-\uDF73\uDF80-\uDFD8]|\uD83E[\uDC00-\uDC0B\uDC10-\uDC47\uDC50-\uDC59\uDC60-\uDC87\uDC90-\uDCAD\uDD00-\uDD0B\uDD10-\uDD3E\uDD40-\uDD70\uDD73-\uDD76\uDD7A\uDD7C-\uDDA2\uDDB0-\uDDB9\uDDC0-\uDDC2\uDDD0-\uDDFF\uDE60-\uDE6D]' + }, + { + 'name': 'Sc', + 'alias': 'Currency_Symbol', + 'bmp': '\\$\xA2-\xA5\u058F\u060B\u07FE\u07FF\u09F2\u09F3\u09FB\u0AF1\u0BF9\u0E3F\u17DB\u20A0-\u20BF\uA838\uFDFC\uFE69\uFF04\uFFE0\uFFE1\uFFE5\uFFE6', + 'astral': '\uD83B\uDCB0' + }, + { + 'name': 'Sk', + 'alias': 'Modifier_Symbol', + 'bmp': '\\^`\xA8\xAF\xB4\xB8\u02C2-\u02C5\u02D2-\u02DF\u02E5-\u02EB\u02ED\u02EF-\u02FF\u0375\u0384\u0385\u1FBD\u1FBF-\u1FC1\u1FCD-\u1FCF\u1FDD-\u1FDF\u1FED-\u1FEF\u1FFD\u1FFE\u309B\u309C\uA700-\uA716\uA720\uA721\uA789\uA78A\uAB5B\uFBB2-\uFBC1\uFF3E\uFF40\uFFE3', + 'astral': '\uD83C[\uDFFB-\uDFFF]' + }, + { + 'name': 'Sm', + 'alias': 'Math_Symbol', + 'bmp': '\\+<->\\|~\xAC\xB1\xD7\xF7\u03F6\u0606-\u0608\u2044\u2052\u207A-\u207C\u208A-\u208C\u2118\u2140-\u2144\u214B\u2190-\u2194\u219A\u219B\u21A0\u21A3\u21A6\u21AE\u21CE\u21CF\u21D2\u21D4\u21F4-\u22FF\u2320\u2321\u237C\u239B-\u23B3\u23DC-\u23E1\u25B7\u25C1\u25F8-\u25FF\u266F\u27C0-\u27C4\u27C7-\u27E5\u27F0-\u27FF\u2900-\u2982\u2999-\u29D7\u29DC-\u29FB\u29FE-\u2AFF\u2B30-\u2B44\u2B47-\u2B4C\uFB29\uFE62\uFE64-\uFE66\uFF0B\uFF1C-\uFF1E\uFF5C\uFF5E\uFFE2\uFFE9-\uFFEC', + 'astral': '\uD835[\uDEC1\uDEDB\uDEFB\uDF15\uDF35\uDF4F\uDF6F\uDF89\uDFA9\uDFC3]|\uD83B[\uDEF0\uDEF1]' + }, + { + 'name': 'So', + 'alias': 'Other_Symbol', + 'bmp': '\xA6\xA9\xAE\xB0\u0482\u058D\u058E\u060E\u060F\u06DE\u06E9\u06FD\u06FE\u07F6\u09FA\u0B70\u0BF3-\u0BF8\u0BFA\u0C7F\u0D4F\u0D79\u0F01-\u0F03\u0F13\u0F15-\u0F17\u0F1A-\u0F1F\u0F34\u0F36\u0F38\u0FBE-\u0FC5\u0FC7-\u0FCC\u0FCE\u0FCF\u0FD5-\u0FD8\u109E\u109F\u1390-\u1399\u1940\u19DE-\u19FF\u1B61-\u1B6A\u1B74-\u1B7C\u2100\u2101\u2103-\u2106\u2108\u2109\u2114\u2116\u2117\u211E-\u2123\u2125\u2127\u2129\u212E\u213A\u213B\u214A\u214C\u214D\u214F\u218A\u218B\u2195-\u2199\u219C-\u219F\u21A1\u21A2\u21A4\u21A5\u21A7-\u21AD\u21AF-\u21CD\u21D0\u21D1\u21D3\u21D5-\u21F3\u2300-\u2307\u230C-\u231F\u2322-\u2328\u232B-\u237B\u237D-\u239A\u23B4-\u23DB\u23E2-\u2426\u2440-\u244A\u249C-\u24E9\u2500-\u25B6\u25B8-\u25C0\u25C2-\u25F7\u2600-\u266E\u2670-\u2767\u2794-\u27BF\u2800-\u28FF\u2B00-\u2B2F\u2B45\u2B46\u2B4D-\u2B73\u2B76-\u2B95\u2B98-\u2BC8\u2BCA-\u2BFE\u2CE5-\u2CEA\u2E80-\u2E99\u2E9B-\u2EF3\u2F00-\u2FD5\u2FF0-\u2FFB\u3004\u3012\u3013\u3020\u3036\u3037\u303E\u303F\u3190\u3191\u3196-\u319F\u31C0-\u31E3\u3200-\u321E\u322A-\u3247\u3250\u3260-\u327F\u328A-\u32B0\u32C0-\u32FE\u3300-\u33FF\u4DC0-\u4DFF\uA490-\uA4C6\uA828-\uA82B\uA836\uA837\uA839\uAA77-\uAA79\uFDFD\uFFE4\uFFE8\uFFED\uFFEE\uFFFC\uFFFD', + 'astral': '\uD800[\uDD37-\uDD3F\uDD79-\uDD89\uDD8C-\uDD8E\uDD90-\uDD9B\uDDA0\uDDD0-\uDDFC]|\uD802[\uDC77\uDC78\uDEC8]|\uD805\uDF3F|\uD81A[\uDF3C-\uDF3F\uDF45]|\uD82F\uDC9C|\uD834[\uDC00-\uDCF5\uDD00-\uDD26\uDD29-\uDD64\uDD6A-\uDD6C\uDD83\uDD84\uDD8C-\uDDA9\uDDAE-\uDDE8\uDE00-\uDE41\uDE45\uDF00-\uDF56]|\uD836[\uDC00-\uDDFF\uDE37-\uDE3A\uDE6D-\uDE74\uDE76-\uDE83\uDE85\uDE86]|\uD83B\uDCAC|\uD83C[\uDC00-\uDC2B\uDC30-\uDC93\uDCA0-\uDCAE\uDCB1-\uDCBF\uDCC1-\uDCCF\uDCD1-\uDCF5\uDD10-\uDD6B\uDD70-\uDDAC\uDDE6-\uDE02\uDE10-\uDE3B\uDE40-\uDE48\uDE50\uDE51\uDE60-\uDE65\uDF00-\uDFFA]|\uD83D[\uDC00-\uDED4\uDEE0-\uDEEC\uDEF0-\uDEF9\uDF00-\uDF73\uDF80-\uDFD8]|\uD83E[\uDC00-\uDC0B\uDC10-\uDC47\uDC50-\uDC59\uDC60-\uDC87\uDC90-\uDCAD\uDD00-\uDD0B\uDD10-\uDD3E\uDD40-\uDD70\uDD73-\uDD76\uDD7A\uDD7C-\uDDA2\uDDB0-\uDDB9\uDDC0-\uDDC2\uDDD0-\uDDFF\uDE60-\uDE6D]' + }, + { + 'name': 'Z', + 'alias': 'Separator', + 'bmp': ' \xA0\u1680\u2000-\u200A\u2028\u2029\u202F\u205F\u3000' + }, + { + 'name': 'Zl', + 'alias': 'Line_Separator', + 'bmp': '\u2028' + }, + { + 'name': 'Zp', + 'alias': 'Paragraph_Separator', + 'bmp': '\u2029' + }, + { + 'name': 'Zs', + 'alias': 'Space_Separator', + 'bmp': ' \xA0\u1680\u2000-\u200A\u202F\u205F\u3000' + } +]; + +var unicodeCategories = createCommonjsModule(function (module, exports) { +"use strict"; + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.default = void 0; + +var _categories = _interopRequireDefault(categories); + +function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } + +/*! + * XRegExp Unicode Categories 4.2.0 + * + * Steven Levithan (c) 2010-present MIT License + * Unicode data by Mathias Bynens + */ +var _default = function _default(XRegExp) { + /** + * Adds support for Unicode's general categories. E.g., `\p{Lu}` or `\p{Uppercase Letter}`. See + * category descriptions in UAX #44 . Token + * names are case insensitive, and any spaces, hyphens, and underscores are ignored. + * + * Uses Unicode 11.0.0. + * + * @requires XRegExp, Unicode Base + */ + if (!XRegExp.addUnicodeData) { + throw new ReferenceError('Unicode Base must be loaded before Unicode Categories'); + } + + XRegExp.addUnicodeData(_categories.default); +}; + +exports.default = _default; +module.exports = exports["default"]; +}); + +unwrapExports(unicodeCategories); + +var properties = [ + { + 'name': 'ASCII', + 'bmp': '\0-\x7F' + }, + { + 'name': 'Alphabetic', + 'bmp': 'A-Za-z\xAA\xB5\xBA\xC0-\xD6\xD8-\xF6\xF8-\u02C1\u02C6-\u02D1\u02E0-\u02E4\u02EC\u02EE\u0345\u0370-\u0374\u0376\u0377\u037A-\u037D\u037F\u0386\u0388-\u038A\u038C\u038E-\u03A1\u03A3-\u03F5\u03F7-\u0481\u048A-\u052F\u0531-\u0556\u0559\u0560-\u0588\u05B0-\u05BD\u05BF\u05C1\u05C2\u05C4\u05C5\u05C7\u05D0-\u05EA\u05EF-\u05F2\u0610-\u061A\u0620-\u0657\u0659-\u065F\u066E-\u06D3\u06D5-\u06DC\u06E1-\u06E8\u06ED-\u06EF\u06FA-\u06FC\u06FF\u0710-\u073F\u074D-\u07B1\u07CA-\u07EA\u07F4\u07F5\u07FA\u0800-\u0817\u081A-\u082C\u0840-\u0858\u0860-\u086A\u08A0-\u08B4\u08B6-\u08BD\u08D4-\u08DF\u08E3-\u08E9\u08F0-\u093B\u093D-\u094C\u094E-\u0950\u0955-\u0963\u0971-\u0983\u0985-\u098C\u098F\u0990\u0993-\u09A8\u09AA-\u09B0\u09B2\u09B6-\u09B9\u09BD-\u09C4\u09C7\u09C8\u09CB\u09CC\u09CE\u09D7\u09DC\u09DD\u09DF-\u09E3\u09F0\u09F1\u09FC\u0A01-\u0A03\u0A05-\u0A0A\u0A0F\u0A10\u0A13-\u0A28\u0A2A-\u0A30\u0A32\u0A33\u0A35\u0A36\u0A38\u0A39\u0A3E-\u0A42\u0A47\u0A48\u0A4B\u0A4C\u0A51\u0A59-\u0A5C\u0A5E\u0A70-\u0A75\u0A81-\u0A83\u0A85-\u0A8D\u0A8F-\u0A91\u0A93-\u0AA8\u0AAA-\u0AB0\u0AB2\u0AB3\u0AB5-\u0AB9\u0ABD-\u0AC5\u0AC7-\u0AC9\u0ACB\u0ACC\u0AD0\u0AE0-\u0AE3\u0AF9-\u0AFC\u0B01-\u0B03\u0B05-\u0B0C\u0B0F\u0B10\u0B13-\u0B28\u0B2A-\u0B30\u0B32\u0B33\u0B35-\u0B39\u0B3D-\u0B44\u0B47\u0B48\u0B4B\u0B4C\u0B56\u0B57\u0B5C\u0B5D\u0B5F-\u0B63\u0B71\u0B82\u0B83\u0B85-\u0B8A\u0B8E-\u0B90\u0B92-\u0B95\u0B99\u0B9A\u0B9C\u0B9E\u0B9F\u0BA3\u0BA4\u0BA8-\u0BAA\u0BAE-\u0BB9\u0BBE-\u0BC2\u0BC6-\u0BC8\u0BCA-\u0BCC\u0BD0\u0BD7\u0C00-\u0C03\u0C05-\u0C0C\u0C0E-\u0C10\u0C12-\u0C28\u0C2A-\u0C39\u0C3D-\u0C44\u0C46-\u0C48\u0C4A-\u0C4C\u0C55\u0C56\u0C58-\u0C5A\u0C60-\u0C63\u0C80-\u0C83\u0C85-\u0C8C\u0C8E-\u0C90\u0C92-\u0CA8\u0CAA-\u0CB3\u0CB5-\u0CB9\u0CBD-\u0CC4\u0CC6-\u0CC8\u0CCA-\u0CCC\u0CD5\u0CD6\u0CDE\u0CE0-\u0CE3\u0CF1\u0CF2\u0D00-\u0D03\u0D05-\u0D0C\u0D0E-\u0D10\u0D12-\u0D3A\u0D3D-\u0D44\u0D46-\u0D48\u0D4A-\u0D4C\u0D4E\u0D54-\u0D57\u0D5F-\u0D63\u0D7A-\u0D7F\u0D82\u0D83\u0D85-\u0D96\u0D9A-\u0DB1\u0DB3-\u0DBB\u0DBD\u0DC0-\u0DC6\u0DCF-\u0DD4\u0DD6\u0DD8-\u0DDF\u0DF2\u0DF3\u0E01-\u0E3A\u0E40-\u0E46\u0E4D\u0E81\u0E82\u0E84\u0E87\u0E88\u0E8A\u0E8D\u0E94-\u0E97\u0E99-\u0E9F\u0EA1-\u0EA3\u0EA5\u0EA7\u0EAA\u0EAB\u0EAD-\u0EB9\u0EBB-\u0EBD\u0EC0-\u0EC4\u0EC6\u0ECD\u0EDC-\u0EDF\u0F00\u0F40-\u0F47\u0F49-\u0F6C\u0F71-\u0F81\u0F88-\u0F97\u0F99-\u0FBC\u1000-\u1036\u1038\u103B-\u103F\u1050-\u1062\u1065-\u1068\u106E-\u1086\u108E\u109C\u109D\u10A0-\u10C5\u10C7\u10CD\u10D0-\u10FA\u10FC-\u1248\u124A-\u124D\u1250-\u1256\u1258\u125A-\u125D\u1260-\u1288\u128A-\u128D\u1290-\u12B0\u12B2-\u12B5\u12B8-\u12BE\u12C0\u12C2-\u12C5\u12C8-\u12D6\u12D8-\u1310\u1312-\u1315\u1318-\u135A\u135F\u1380-\u138F\u13A0-\u13F5\u13F8-\u13FD\u1401-\u166C\u166F-\u167F\u1681-\u169A\u16A0-\u16EA\u16EE-\u16F8\u1700-\u170C\u170E-\u1713\u1720-\u1733\u1740-\u1753\u1760-\u176C\u176E-\u1770\u1772\u1773\u1780-\u17B3\u17B6-\u17C8\u17D7\u17DC\u1820-\u1878\u1880-\u18AA\u18B0-\u18F5\u1900-\u191E\u1920-\u192B\u1930-\u1938\u1950-\u196D\u1970-\u1974\u1980-\u19AB\u19B0-\u19C9\u1A00-\u1A1B\u1A20-\u1A5E\u1A61-\u1A74\u1AA7\u1B00-\u1B33\u1B35-\u1B43\u1B45-\u1B4B\u1B80-\u1BA9\u1BAC-\u1BAF\u1BBA-\u1BE5\u1BE7-\u1BF1\u1C00-\u1C35\u1C4D-\u1C4F\u1C5A-\u1C7D\u1C80-\u1C88\u1C90-\u1CBA\u1CBD-\u1CBF\u1CE9-\u1CEC\u1CEE-\u1CF3\u1CF5\u1CF6\u1D00-\u1DBF\u1DE7-\u1DF4\u1E00-\u1F15\u1F18-\u1F1D\u1F20-\u1F45\u1F48-\u1F4D\u1F50-\u1F57\u1F59\u1F5B\u1F5D\u1F5F-\u1F7D\u1F80-\u1FB4\u1FB6-\u1FBC\u1FBE\u1FC2-\u1FC4\u1FC6-\u1FCC\u1FD0-\u1FD3\u1FD6-\u1FDB\u1FE0-\u1FEC\u1FF2-\u1FF4\u1FF6-\u1FFC\u2071\u207F\u2090-\u209C\u2102\u2107\u210A-\u2113\u2115\u2119-\u211D\u2124\u2126\u2128\u212A-\u212D\u212F-\u2139\u213C-\u213F\u2145-\u2149\u214E\u2160-\u2188\u24B6-\u24E9\u2C00-\u2C2E\u2C30-\u2C5E\u2C60-\u2CE4\u2CEB-\u2CEE\u2CF2\u2CF3\u2D00-\u2D25\u2D27\u2D2D\u2D30-\u2D67\u2D6F\u2D80-\u2D96\u2DA0-\u2DA6\u2DA8-\u2DAE\u2DB0-\u2DB6\u2DB8-\u2DBE\u2DC0-\u2DC6\u2DC8-\u2DCE\u2DD0-\u2DD6\u2DD8-\u2DDE\u2DE0-\u2DFF\u2E2F\u3005-\u3007\u3021-\u3029\u3031-\u3035\u3038-\u303C\u3041-\u3096\u309D-\u309F\u30A1-\u30FA\u30FC-\u30FF\u3105-\u312F\u3131-\u318E\u31A0-\u31BA\u31F0-\u31FF\u3400-\u4DB5\u4E00-\u9FEF\uA000-\uA48C\uA4D0-\uA4FD\uA500-\uA60C\uA610-\uA61F\uA62A\uA62B\uA640-\uA66E\uA674-\uA67B\uA67F-\uA6EF\uA717-\uA71F\uA722-\uA788\uA78B-\uA7B9\uA7F7-\uA801\uA803-\uA805\uA807-\uA80A\uA80C-\uA827\uA840-\uA873\uA880-\uA8C3\uA8C5\uA8F2-\uA8F7\uA8FB\uA8FD\uA8FE\uA90A-\uA92A\uA930-\uA952\uA960-\uA97C\uA980-\uA9B2\uA9B4-\uA9BF\uA9CF\uA9E0-\uA9E4\uA9E6-\uA9EF\uA9FA-\uA9FE\uAA00-\uAA36\uAA40-\uAA4D\uAA60-\uAA76\uAA7A\uAA7E-\uAABE\uAAC0\uAAC2\uAADB-\uAADD\uAAE0-\uAAEF\uAAF2-\uAAF5\uAB01-\uAB06\uAB09-\uAB0E\uAB11-\uAB16\uAB20-\uAB26\uAB28-\uAB2E\uAB30-\uAB5A\uAB5C-\uAB65\uAB70-\uABEA\uAC00-\uD7A3\uD7B0-\uD7C6\uD7CB-\uD7FB\uF900-\uFA6D\uFA70-\uFAD9\uFB00-\uFB06\uFB13-\uFB17\uFB1D-\uFB28\uFB2A-\uFB36\uFB38-\uFB3C\uFB3E\uFB40\uFB41\uFB43\uFB44\uFB46-\uFBB1\uFBD3-\uFD3D\uFD50-\uFD8F\uFD92-\uFDC7\uFDF0-\uFDFB\uFE70-\uFE74\uFE76-\uFEFC\uFF21-\uFF3A\uFF41-\uFF5A\uFF66-\uFFBE\uFFC2-\uFFC7\uFFCA-\uFFCF\uFFD2-\uFFD7\uFFDA-\uFFDC', + 'astral': '\uD800[\uDC00-\uDC0B\uDC0D-\uDC26\uDC28-\uDC3A\uDC3C\uDC3D\uDC3F-\uDC4D\uDC50-\uDC5D\uDC80-\uDCFA\uDD40-\uDD74\uDE80-\uDE9C\uDEA0-\uDED0\uDF00-\uDF1F\uDF2D-\uDF4A\uDF50-\uDF7A\uDF80-\uDF9D\uDFA0-\uDFC3\uDFC8-\uDFCF\uDFD1-\uDFD5]|\uD801[\uDC00-\uDC9D\uDCB0-\uDCD3\uDCD8-\uDCFB\uDD00-\uDD27\uDD30-\uDD63\uDE00-\uDF36\uDF40-\uDF55\uDF60-\uDF67]|\uD802[\uDC00-\uDC05\uDC08\uDC0A-\uDC35\uDC37\uDC38\uDC3C\uDC3F-\uDC55\uDC60-\uDC76\uDC80-\uDC9E\uDCE0-\uDCF2\uDCF4\uDCF5\uDD00-\uDD15\uDD20-\uDD39\uDD80-\uDDB7\uDDBE\uDDBF\uDE00-\uDE03\uDE05\uDE06\uDE0C-\uDE13\uDE15-\uDE17\uDE19-\uDE35\uDE60-\uDE7C\uDE80-\uDE9C\uDEC0-\uDEC7\uDEC9-\uDEE4\uDF00-\uDF35\uDF40-\uDF55\uDF60-\uDF72\uDF80-\uDF91]|\uD803[\uDC00-\uDC48\uDC80-\uDCB2\uDCC0-\uDCF2\uDD00-\uDD27\uDF00-\uDF1C\uDF27\uDF30-\uDF45]|\uD804[\uDC00-\uDC45\uDC82-\uDCB8\uDCD0-\uDCE8\uDD00-\uDD32\uDD44-\uDD46\uDD50-\uDD72\uDD76\uDD80-\uDDBF\uDDC1-\uDDC4\uDDDA\uDDDC\uDE00-\uDE11\uDE13-\uDE34\uDE37\uDE3E\uDE80-\uDE86\uDE88\uDE8A-\uDE8D\uDE8F-\uDE9D\uDE9F-\uDEA8\uDEB0-\uDEE8\uDF00-\uDF03\uDF05-\uDF0C\uDF0F\uDF10\uDF13-\uDF28\uDF2A-\uDF30\uDF32\uDF33\uDF35-\uDF39\uDF3D-\uDF44\uDF47\uDF48\uDF4B\uDF4C\uDF50\uDF57\uDF5D-\uDF63]|\uD805[\uDC00-\uDC41\uDC43-\uDC45\uDC47-\uDC4A\uDC80-\uDCC1\uDCC4\uDCC5\uDCC7\uDD80-\uDDB5\uDDB8-\uDDBE\uDDD8-\uDDDD\uDE00-\uDE3E\uDE40\uDE44\uDE80-\uDEB5\uDF00-\uDF1A\uDF1D-\uDF2A]|\uD806[\uDC00-\uDC38\uDCA0-\uDCDF\uDCFF\uDE00-\uDE32\uDE35-\uDE3E\uDE50-\uDE83\uDE86-\uDE97\uDE9D\uDEC0-\uDEF8]|\uD807[\uDC00-\uDC08\uDC0A-\uDC36\uDC38-\uDC3E\uDC40\uDC72-\uDC8F\uDC92-\uDCA7\uDCA9-\uDCB6\uDD00-\uDD06\uDD08\uDD09\uDD0B-\uDD36\uDD3A\uDD3C\uDD3D\uDD3F-\uDD41\uDD43\uDD46\uDD47\uDD60-\uDD65\uDD67\uDD68\uDD6A-\uDD8E\uDD90\uDD91\uDD93-\uDD96\uDD98\uDEE0-\uDEF6]|\uD808[\uDC00-\uDF99]|\uD809[\uDC00-\uDC6E\uDC80-\uDD43]|[\uD80C\uD81C-\uD820\uD840-\uD868\uD86A-\uD86C\uD86F-\uD872\uD874-\uD879][\uDC00-\uDFFF]|\uD80D[\uDC00-\uDC2E]|\uD811[\uDC00-\uDE46]|\uD81A[\uDC00-\uDE38\uDE40-\uDE5E\uDED0-\uDEED\uDF00-\uDF36\uDF40-\uDF43\uDF63-\uDF77\uDF7D-\uDF8F]|\uD81B[\uDE40-\uDE7F\uDF00-\uDF44\uDF50-\uDF7E\uDF93-\uDF9F\uDFE0\uDFE1]|\uD821[\uDC00-\uDFF1]|\uD822[\uDC00-\uDEF2]|\uD82C[\uDC00-\uDD1E\uDD70-\uDEFB]|\uD82F[\uDC00-\uDC6A\uDC70-\uDC7C\uDC80-\uDC88\uDC90-\uDC99\uDC9E]|\uD835[\uDC00-\uDC54\uDC56-\uDC9C\uDC9E\uDC9F\uDCA2\uDCA5\uDCA6\uDCA9-\uDCAC\uDCAE-\uDCB9\uDCBB\uDCBD-\uDCC3\uDCC5-\uDD05\uDD07-\uDD0A\uDD0D-\uDD14\uDD16-\uDD1C\uDD1E-\uDD39\uDD3B-\uDD3E\uDD40-\uDD44\uDD46\uDD4A-\uDD50\uDD52-\uDEA5\uDEA8-\uDEC0\uDEC2-\uDEDA\uDEDC-\uDEFA\uDEFC-\uDF14\uDF16-\uDF34\uDF36-\uDF4E\uDF50-\uDF6E\uDF70-\uDF88\uDF8A-\uDFA8\uDFAA-\uDFC2\uDFC4-\uDFCB]|\uD838[\uDC00-\uDC06\uDC08-\uDC18\uDC1B-\uDC21\uDC23\uDC24\uDC26-\uDC2A]|\uD83A[\uDC00-\uDCC4\uDD00-\uDD43\uDD47]|\uD83B[\uDE00-\uDE03\uDE05-\uDE1F\uDE21\uDE22\uDE24\uDE27\uDE29-\uDE32\uDE34-\uDE37\uDE39\uDE3B\uDE42\uDE47\uDE49\uDE4B\uDE4D-\uDE4F\uDE51\uDE52\uDE54\uDE57\uDE59\uDE5B\uDE5D\uDE5F\uDE61\uDE62\uDE64\uDE67-\uDE6A\uDE6C-\uDE72\uDE74-\uDE77\uDE79-\uDE7C\uDE7E\uDE80-\uDE89\uDE8B-\uDE9B\uDEA1-\uDEA3\uDEA5-\uDEA9\uDEAB-\uDEBB]|\uD83C[\uDD30-\uDD49\uDD50-\uDD69\uDD70-\uDD89]|\uD869[\uDC00-\uDED6\uDF00-\uDFFF]|\uD86D[\uDC00-\uDF34\uDF40-\uDFFF]|\uD86E[\uDC00-\uDC1D\uDC20-\uDFFF]|\uD873[\uDC00-\uDEA1\uDEB0-\uDFFF]|\uD87A[\uDC00-\uDFE0]|\uD87E[\uDC00-\uDE1D]' + }, + { + 'name': 'Any', + 'isBmpLast': true, + 'bmp': '\0-\uFFFF', + 'astral': '[\uD800-\uDBFF][\uDC00-\uDFFF]' + }, + { + 'name': 'Default_Ignorable_Code_Point', + 'bmp': '\xAD\u034F\u061C\u115F\u1160\u17B4\u17B5\u180B-\u180E\u200B-\u200F\u202A-\u202E\u2060-\u206F\u3164\uFE00-\uFE0F\uFEFF\uFFA0\uFFF0-\uFFF8', + 'astral': '\uD82F[\uDCA0-\uDCA3]|\uD834[\uDD73-\uDD7A]|[\uDB40-\uDB43][\uDC00-\uDFFF]' + }, + { + 'name': 'Lowercase', + 'bmp': 'a-z\xAA\xB5\xBA\xDF-\xF6\xF8-\xFF\u0101\u0103\u0105\u0107\u0109\u010B\u010D\u010F\u0111\u0113\u0115\u0117\u0119\u011B\u011D\u011F\u0121\u0123\u0125\u0127\u0129\u012B\u012D\u012F\u0131\u0133\u0135\u0137\u0138\u013A\u013C\u013E\u0140\u0142\u0144\u0146\u0148\u0149\u014B\u014D\u014F\u0151\u0153\u0155\u0157\u0159\u015B\u015D\u015F\u0161\u0163\u0165\u0167\u0169\u016B\u016D\u016F\u0171\u0173\u0175\u0177\u017A\u017C\u017E-\u0180\u0183\u0185\u0188\u018C\u018D\u0192\u0195\u0199-\u019B\u019E\u01A1\u01A3\u01A5\u01A8\u01AA\u01AB\u01AD\u01B0\u01B4\u01B6\u01B9\u01BA\u01BD-\u01BF\u01C6\u01C9\u01CC\u01CE\u01D0\u01D2\u01D4\u01D6\u01D8\u01DA\u01DC\u01DD\u01DF\u01E1\u01E3\u01E5\u01E7\u01E9\u01EB\u01ED\u01EF\u01F0\u01F3\u01F5\u01F9\u01FB\u01FD\u01FF\u0201\u0203\u0205\u0207\u0209\u020B\u020D\u020F\u0211\u0213\u0215\u0217\u0219\u021B\u021D\u021F\u0221\u0223\u0225\u0227\u0229\u022B\u022D\u022F\u0231\u0233-\u0239\u023C\u023F\u0240\u0242\u0247\u0249\u024B\u024D\u024F-\u0293\u0295-\u02B8\u02C0\u02C1\u02E0-\u02E4\u0345\u0371\u0373\u0377\u037A-\u037D\u0390\u03AC-\u03CE\u03D0\u03D1\u03D5-\u03D7\u03D9\u03DB\u03DD\u03DF\u03E1\u03E3\u03E5\u03E7\u03E9\u03EB\u03ED\u03EF-\u03F3\u03F5\u03F8\u03FB\u03FC\u0430-\u045F\u0461\u0463\u0465\u0467\u0469\u046B\u046D\u046F\u0471\u0473\u0475\u0477\u0479\u047B\u047D\u047F\u0481\u048B\u048D\u048F\u0491\u0493\u0495\u0497\u0499\u049B\u049D\u049F\u04A1\u04A3\u04A5\u04A7\u04A9\u04AB\u04AD\u04AF\u04B1\u04B3\u04B5\u04B7\u04B9\u04BB\u04BD\u04BF\u04C2\u04C4\u04C6\u04C8\u04CA\u04CC\u04CE\u04CF\u04D1\u04D3\u04D5\u04D7\u04D9\u04DB\u04DD\u04DF\u04E1\u04E3\u04E5\u04E7\u04E9\u04EB\u04ED\u04EF\u04F1\u04F3\u04F5\u04F7\u04F9\u04FB\u04FD\u04FF\u0501\u0503\u0505\u0507\u0509\u050B\u050D\u050F\u0511\u0513\u0515\u0517\u0519\u051B\u051D\u051F\u0521\u0523\u0525\u0527\u0529\u052B\u052D\u052F\u0560-\u0588\u10D0-\u10FA\u10FD-\u10FF\u13F8-\u13FD\u1C80-\u1C88\u1D00-\u1DBF\u1E01\u1E03\u1E05\u1E07\u1E09\u1E0B\u1E0D\u1E0F\u1E11\u1E13\u1E15\u1E17\u1E19\u1E1B\u1E1D\u1E1F\u1E21\u1E23\u1E25\u1E27\u1E29\u1E2B\u1E2D\u1E2F\u1E31\u1E33\u1E35\u1E37\u1E39\u1E3B\u1E3D\u1E3F\u1E41\u1E43\u1E45\u1E47\u1E49\u1E4B\u1E4D\u1E4F\u1E51\u1E53\u1E55\u1E57\u1E59\u1E5B\u1E5D\u1E5F\u1E61\u1E63\u1E65\u1E67\u1E69\u1E6B\u1E6D\u1E6F\u1E71\u1E73\u1E75\u1E77\u1E79\u1E7B\u1E7D\u1E7F\u1E81\u1E83\u1E85\u1E87\u1E89\u1E8B\u1E8D\u1E8F\u1E91\u1E93\u1E95-\u1E9D\u1E9F\u1EA1\u1EA3\u1EA5\u1EA7\u1EA9\u1EAB\u1EAD\u1EAF\u1EB1\u1EB3\u1EB5\u1EB7\u1EB9\u1EBB\u1EBD\u1EBF\u1EC1\u1EC3\u1EC5\u1EC7\u1EC9\u1ECB\u1ECD\u1ECF\u1ED1\u1ED3\u1ED5\u1ED7\u1ED9\u1EDB\u1EDD\u1EDF\u1EE1\u1EE3\u1EE5\u1EE7\u1EE9\u1EEB\u1EED\u1EEF\u1EF1\u1EF3\u1EF5\u1EF7\u1EF9\u1EFB\u1EFD\u1EFF-\u1F07\u1F10-\u1F15\u1F20-\u1F27\u1F30-\u1F37\u1F40-\u1F45\u1F50-\u1F57\u1F60-\u1F67\u1F70-\u1F7D\u1F80-\u1F87\u1F90-\u1F97\u1FA0-\u1FA7\u1FB0-\u1FB4\u1FB6\u1FB7\u1FBE\u1FC2-\u1FC4\u1FC6\u1FC7\u1FD0-\u1FD3\u1FD6\u1FD7\u1FE0-\u1FE7\u1FF2-\u1FF4\u1FF6\u1FF7\u2071\u207F\u2090-\u209C\u210A\u210E\u210F\u2113\u212F\u2134\u2139\u213C\u213D\u2146-\u2149\u214E\u2170-\u217F\u2184\u24D0-\u24E9\u2C30-\u2C5E\u2C61\u2C65\u2C66\u2C68\u2C6A\u2C6C\u2C71\u2C73\u2C74\u2C76-\u2C7D\u2C81\u2C83\u2C85\u2C87\u2C89\u2C8B\u2C8D\u2C8F\u2C91\u2C93\u2C95\u2C97\u2C99\u2C9B\u2C9D\u2C9F\u2CA1\u2CA3\u2CA5\u2CA7\u2CA9\u2CAB\u2CAD\u2CAF\u2CB1\u2CB3\u2CB5\u2CB7\u2CB9\u2CBB\u2CBD\u2CBF\u2CC1\u2CC3\u2CC5\u2CC7\u2CC9\u2CCB\u2CCD\u2CCF\u2CD1\u2CD3\u2CD5\u2CD7\u2CD9\u2CDB\u2CDD\u2CDF\u2CE1\u2CE3\u2CE4\u2CEC\u2CEE\u2CF3\u2D00-\u2D25\u2D27\u2D2D\uA641\uA643\uA645\uA647\uA649\uA64B\uA64D\uA64F\uA651\uA653\uA655\uA657\uA659\uA65B\uA65D\uA65F\uA661\uA663\uA665\uA667\uA669\uA66B\uA66D\uA681\uA683\uA685\uA687\uA689\uA68B\uA68D\uA68F\uA691\uA693\uA695\uA697\uA699\uA69B-\uA69D\uA723\uA725\uA727\uA729\uA72B\uA72D\uA72F-\uA731\uA733\uA735\uA737\uA739\uA73B\uA73D\uA73F\uA741\uA743\uA745\uA747\uA749\uA74B\uA74D\uA74F\uA751\uA753\uA755\uA757\uA759\uA75B\uA75D\uA75F\uA761\uA763\uA765\uA767\uA769\uA76B\uA76D\uA76F-\uA778\uA77A\uA77C\uA77F\uA781\uA783\uA785\uA787\uA78C\uA78E\uA791\uA793-\uA795\uA797\uA799\uA79B\uA79D\uA79F\uA7A1\uA7A3\uA7A5\uA7A7\uA7A9\uA7AF\uA7B5\uA7B7\uA7B9\uA7F8-\uA7FA\uAB30-\uAB5A\uAB5C-\uAB65\uAB70-\uABBF\uFB00-\uFB06\uFB13-\uFB17\uFF41-\uFF5A', + 'astral': '\uD801[\uDC28-\uDC4F\uDCD8-\uDCFB]|\uD803[\uDCC0-\uDCF2]|\uD806[\uDCC0-\uDCDF]|\uD81B[\uDE60-\uDE7F]|\uD835[\uDC1A-\uDC33\uDC4E-\uDC54\uDC56-\uDC67\uDC82-\uDC9B\uDCB6-\uDCB9\uDCBB\uDCBD-\uDCC3\uDCC5-\uDCCF\uDCEA-\uDD03\uDD1E-\uDD37\uDD52-\uDD6B\uDD86-\uDD9F\uDDBA-\uDDD3\uDDEE-\uDE07\uDE22-\uDE3B\uDE56-\uDE6F\uDE8A-\uDEA5\uDEC2-\uDEDA\uDEDC-\uDEE1\uDEFC-\uDF14\uDF16-\uDF1B\uDF36-\uDF4E\uDF50-\uDF55\uDF70-\uDF88\uDF8A-\uDF8F\uDFAA-\uDFC2\uDFC4-\uDFC9\uDFCB]|\uD83A[\uDD22-\uDD43]' + }, + { + 'name': 'Noncharacter_Code_Point', + 'bmp': '\uFDD0-\uFDEF\uFFFE\uFFFF', + 'astral': '[\uD83F\uD87F\uD8BF\uD8FF\uD93F\uD97F\uD9BF\uD9FF\uDA3F\uDA7F\uDABF\uDAFF\uDB3F\uDB7F\uDBBF\uDBFF][\uDFFE\uDFFF]' + }, + { + 'name': 'Uppercase', + 'bmp': 'A-Z\xC0-\xD6\xD8-\xDE\u0100\u0102\u0104\u0106\u0108\u010A\u010C\u010E\u0110\u0112\u0114\u0116\u0118\u011A\u011C\u011E\u0120\u0122\u0124\u0126\u0128\u012A\u012C\u012E\u0130\u0132\u0134\u0136\u0139\u013B\u013D\u013F\u0141\u0143\u0145\u0147\u014A\u014C\u014E\u0150\u0152\u0154\u0156\u0158\u015A\u015C\u015E\u0160\u0162\u0164\u0166\u0168\u016A\u016C\u016E\u0170\u0172\u0174\u0176\u0178\u0179\u017B\u017D\u0181\u0182\u0184\u0186\u0187\u0189-\u018B\u018E-\u0191\u0193\u0194\u0196-\u0198\u019C\u019D\u019F\u01A0\u01A2\u01A4\u01A6\u01A7\u01A9\u01AC\u01AE\u01AF\u01B1-\u01B3\u01B5\u01B7\u01B8\u01BC\u01C4\u01C7\u01CA\u01CD\u01CF\u01D1\u01D3\u01D5\u01D7\u01D9\u01DB\u01DE\u01E0\u01E2\u01E4\u01E6\u01E8\u01EA\u01EC\u01EE\u01F1\u01F4\u01F6-\u01F8\u01FA\u01FC\u01FE\u0200\u0202\u0204\u0206\u0208\u020A\u020C\u020E\u0210\u0212\u0214\u0216\u0218\u021A\u021C\u021E\u0220\u0222\u0224\u0226\u0228\u022A\u022C\u022E\u0230\u0232\u023A\u023B\u023D\u023E\u0241\u0243-\u0246\u0248\u024A\u024C\u024E\u0370\u0372\u0376\u037F\u0386\u0388-\u038A\u038C\u038E\u038F\u0391-\u03A1\u03A3-\u03AB\u03CF\u03D2-\u03D4\u03D8\u03DA\u03DC\u03DE\u03E0\u03E2\u03E4\u03E6\u03E8\u03EA\u03EC\u03EE\u03F4\u03F7\u03F9\u03FA\u03FD-\u042F\u0460\u0462\u0464\u0466\u0468\u046A\u046C\u046E\u0470\u0472\u0474\u0476\u0478\u047A\u047C\u047E\u0480\u048A\u048C\u048E\u0490\u0492\u0494\u0496\u0498\u049A\u049C\u049E\u04A0\u04A2\u04A4\u04A6\u04A8\u04AA\u04AC\u04AE\u04B0\u04B2\u04B4\u04B6\u04B8\u04BA\u04BC\u04BE\u04C0\u04C1\u04C3\u04C5\u04C7\u04C9\u04CB\u04CD\u04D0\u04D2\u04D4\u04D6\u04D8\u04DA\u04DC\u04DE\u04E0\u04E2\u04E4\u04E6\u04E8\u04EA\u04EC\u04EE\u04F0\u04F2\u04F4\u04F6\u04F8\u04FA\u04FC\u04FE\u0500\u0502\u0504\u0506\u0508\u050A\u050C\u050E\u0510\u0512\u0514\u0516\u0518\u051A\u051C\u051E\u0520\u0522\u0524\u0526\u0528\u052A\u052C\u052E\u0531-\u0556\u10A0-\u10C5\u10C7\u10CD\u13A0-\u13F5\u1C90-\u1CBA\u1CBD-\u1CBF\u1E00\u1E02\u1E04\u1E06\u1E08\u1E0A\u1E0C\u1E0E\u1E10\u1E12\u1E14\u1E16\u1E18\u1E1A\u1E1C\u1E1E\u1E20\u1E22\u1E24\u1E26\u1E28\u1E2A\u1E2C\u1E2E\u1E30\u1E32\u1E34\u1E36\u1E38\u1E3A\u1E3C\u1E3E\u1E40\u1E42\u1E44\u1E46\u1E48\u1E4A\u1E4C\u1E4E\u1E50\u1E52\u1E54\u1E56\u1E58\u1E5A\u1E5C\u1E5E\u1E60\u1E62\u1E64\u1E66\u1E68\u1E6A\u1E6C\u1E6E\u1E70\u1E72\u1E74\u1E76\u1E78\u1E7A\u1E7C\u1E7E\u1E80\u1E82\u1E84\u1E86\u1E88\u1E8A\u1E8C\u1E8E\u1E90\u1E92\u1E94\u1E9E\u1EA0\u1EA2\u1EA4\u1EA6\u1EA8\u1EAA\u1EAC\u1EAE\u1EB0\u1EB2\u1EB4\u1EB6\u1EB8\u1EBA\u1EBC\u1EBE\u1EC0\u1EC2\u1EC4\u1EC6\u1EC8\u1ECA\u1ECC\u1ECE\u1ED0\u1ED2\u1ED4\u1ED6\u1ED8\u1EDA\u1EDC\u1EDE\u1EE0\u1EE2\u1EE4\u1EE6\u1EE8\u1EEA\u1EEC\u1EEE\u1EF0\u1EF2\u1EF4\u1EF6\u1EF8\u1EFA\u1EFC\u1EFE\u1F08-\u1F0F\u1F18-\u1F1D\u1F28-\u1F2F\u1F38-\u1F3F\u1F48-\u1F4D\u1F59\u1F5B\u1F5D\u1F5F\u1F68-\u1F6F\u1FB8-\u1FBB\u1FC8-\u1FCB\u1FD8-\u1FDB\u1FE8-\u1FEC\u1FF8-\u1FFB\u2102\u2107\u210B-\u210D\u2110-\u2112\u2115\u2119-\u211D\u2124\u2126\u2128\u212A-\u212D\u2130-\u2133\u213E\u213F\u2145\u2160-\u216F\u2183\u24B6-\u24CF\u2C00-\u2C2E\u2C60\u2C62-\u2C64\u2C67\u2C69\u2C6B\u2C6D-\u2C70\u2C72\u2C75\u2C7E-\u2C80\u2C82\u2C84\u2C86\u2C88\u2C8A\u2C8C\u2C8E\u2C90\u2C92\u2C94\u2C96\u2C98\u2C9A\u2C9C\u2C9E\u2CA0\u2CA2\u2CA4\u2CA6\u2CA8\u2CAA\u2CAC\u2CAE\u2CB0\u2CB2\u2CB4\u2CB6\u2CB8\u2CBA\u2CBC\u2CBE\u2CC0\u2CC2\u2CC4\u2CC6\u2CC8\u2CCA\u2CCC\u2CCE\u2CD0\u2CD2\u2CD4\u2CD6\u2CD8\u2CDA\u2CDC\u2CDE\u2CE0\u2CE2\u2CEB\u2CED\u2CF2\uA640\uA642\uA644\uA646\uA648\uA64A\uA64C\uA64E\uA650\uA652\uA654\uA656\uA658\uA65A\uA65C\uA65E\uA660\uA662\uA664\uA666\uA668\uA66A\uA66C\uA680\uA682\uA684\uA686\uA688\uA68A\uA68C\uA68E\uA690\uA692\uA694\uA696\uA698\uA69A\uA722\uA724\uA726\uA728\uA72A\uA72C\uA72E\uA732\uA734\uA736\uA738\uA73A\uA73C\uA73E\uA740\uA742\uA744\uA746\uA748\uA74A\uA74C\uA74E\uA750\uA752\uA754\uA756\uA758\uA75A\uA75C\uA75E\uA760\uA762\uA764\uA766\uA768\uA76A\uA76C\uA76E\uA779\uA77B\uA77D\uA77E\uA780\uA782\uA784\uA786\uA78B\uA78D\uA790\uA792\uA796\uA798\uA79A\uA79C\uA79E\uA7A0\uA7A2\uA7A4\uA7A6\uA7A8\uA7AA-\uA7AE\uA7B0-\uA7B4\uA7B6\uA7B8\uFF21-\uFF3A', + 'astral': '\uD801[\uDC00-\uDC27\uDCB0-\uDCD3]|\uD803[\uDC80-\uDCB2]|\uD806[\uDCA0-\uDCBF]|\uD81B[\uDE40-\uDE5F]|\uD835[\uDC00-\uDC19\uDC34-\uDC4D\uDC68-\uDC81\uDC9C\uDC9E\uDC9F\uDCA2\uDCA5\uDCA6\uDCA9-\uDCAC\uDCAE-\uDCB5\uDCD0-\uDCE9\uDD04\uDD05\uDD07-\uDD0A\uDD0D-\uDD14\uDD16-\uDD1C\uDD38\uDD39\uDD3B-\uDD3E\uDD40-\uDD44\uDD46\uDD4A-\uDD50\uDD6C-\uDD85\uDDA0-\uDDB9\uDDD4-\uDDED\uDE08-\uDE21\uDE3C-\uDE55\uDE70-\uDE89\uDEA8-\uDEC0\uDEE2-\uDEFA\uDF1C-\uDF34\uDF56-\uDF6E\uDF90-\uDFA8\uDFCA]|\uD83A[\uDD00-\uDD21]|\uD83C[\uDD30-\uDD49\uDD50-\uDD69\uDD70-\uDD89]' + }, + { + 'name': 'White_Space', + 'bmp': '\t-\r \x85\xA0\u1680\u2000-\u200A\u2028\u2029\u202F\u205F\u3000' + } +]; + +var unicodeProperties = createCommonjsModule(function (module, exports) { +"use strict"; + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.default = void 0; + +var _properties = _interopRequireDefault(properties); + +function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } + +/*! + * XRegExp Unicode Properties 4.2.0 + * + * Steven Levithan (c) 2012-present MIT License + * Unicode data by Mathias Bynens + */ +var _default = function _default(XRegExp) { + /** + * Adds properties to meet the UTS #18 Level 1 RL1.2 requirements for Unicode regex support. See + * . Following are definitions of these properties from + * UAX #44 : + * + * - Alphabetic + * Characters with the Alphabetic property. Generated from: Lowercase + Uppercase + Lt + Lm + + * Lo + Nl + Other_Alphabetic. + * + * - Default_Ignorable_Code_Point + * For programmatic determination of default ignorable code points. New characters that should + * be ignored in rendering (unless explicitly supported) will be assigned in these ranges, + * permitting programs to correctly handle the default rendering of such characters when not + * otherwise supported. + * + * - Lowercase + * Characters with the Lowercase property. Generated from: Ll + Other_Lowercase. + * + * - Noncharacter_Code_Point + * Code points permanently reserved for internal use. + * + * - Uppercase + * Characters with the Uppercase property. Generated from: Lu + Other_Uppercase. + * + * - White_Space + * Spaces, separator characters and other control characters which should be treated by + * programming languages as "white space" for the purpose of parsing elements. + * + * The properties ASCII, Any, and Assigned are also included but are not defined in UAX #44. UTS + * #18 RL1.2 additionally requires support for Unicode scripts and general categories. These are + * included in XRegExp's Unicode Categories and Unicode Scripts addons. + * + * Token names are case insensitive, and any spaces, hyphens, and underscores are ignored. + * + * Uses Unicode 11.0.0. + * + * @requires XRegExp, Unicode Base + */ + if (!XRegExp.addUnicodeData) { + throw new ReferenceError('Unicode Base must be loaded before Unicode Properties'); + } + + var unicodeData = _properties.default; // Add non-generated data + + unicodeData.push({ + name: 'Assigned', + // Since this is defined as the inverse of Unicode category Cn (Unassigned), the Unicode + // Categories addon is required to use this property + inverseOf: 'Cn' + }); + XRegExp.addUnicodeData(unicodeData); +}; + +exports.default = _default; +module.exports = exports["default"]; +}); + +unwrapExports(unicodeProperties); + +var scripts = [ + { + 'name': 'Adlam', + 'astral': '\uD83A[\uDD00-\uDD4A\uDD50-\uDD59\uDD5E\uDD5F]' + }, + { + 'name': 'Ahom', + 'astral': '\uD805[\uDF00-\uDF1A\uDF1D-\uDF2B\uDF30-\uDF3F]' + }, + { + 'name': 'Anatolian_Hieroglyphs', + 'astral': '\uD811[\uDC00-\uDE46]' + }, + { + 'name': 'Arabic', + 'bmp': '\u0600-\u0604\u0606-\u060B\u060D-\u061A\u061C\u061E\u0620-\u063F\u0641-\u064A\u0656-\u066F\u0671-\u06DC\u06DE-\u06FF\u0750-\u077F\u08A0-\u08B4\u08B6-\u08BD\u08D3-\u08E1\u08E3-\u08FF\uFB50-\uFBC1\uFBD3-\uFD3D\uFD50-\uFD8F\uFD92-\uFDC7\uFDF0-\uFDFD\uFE70-\uFE74\uFE76-\uFEFC', + 'astral': '\uD803[\uDE60-\uDE7E]|\uD83B[\uDE00-\uDE03\uDE05-\uDE1F\uDE21\uDE22\uDE24\uDE27\uDE29-\uDE32\uDE34-\uDE37\uDE39\uDE3B\uDE42\uDE47\uDE49\uDE4B\uDE4D-\uDE4F\uDE51\uDE52\uDE54\uDE57\uDE59\uDE5B\uDE5D\uDE5F\uDE61\uDE62\uDE64\uDE67-\uDE6A\uDE6C-\uDE72\uDE74-\uDE77\uDE79-\uDE7C\uDE7E\uDE80-\uDE89\uDE8B-\uDE9B\uDEA1-\uDEA3\uDEA5-\uDEA9\uDEAB-\uDEBB\uDEF0\uDEF1]' + }, + { + 'name': 'Armenian', + 'bmp': '\u0531-\u0556\u0559-\u0588\u058A\u058D-\u058F\uFB13-\uFB17' + }, + { + 'name': 'Avestan', + 'astral': '\uD802[\uDF00-\uDF35\uDF39-\uDF3F]' + }, + { + 'name': 'Balinese', + 'bmp': '\u1B00-\u1B4B\u1B50-\u1B7C' + }, + { + 'name': 'Bamum', + 'bmp': '\uA6A0-\uA6F7', + 'astral': '\uD81A[\uDC00-\uDE38]' + }, + { + 'name': 'Bassa_Vah', + 'astral': '\uD81A[\uDED0-\uDEED\uDEF0-\uDEF5]' + }, + { + 'name': 'Batak', + 'bmp': '\u1BC0-\u1BF3\u1BFC-\u1BFF' + }, + { + 'name': 'Bengali', + 'bmp': '\u0980-\u0983\u0985-\u098C\u098F\u0990\u0993-\u09A8\u09AA-\u09B0\u09B2\u09B6-\u09B9\u09BC-\u09C4\u09C7\u09C8\u09CB-\u09CE\u09D7\u09DC\u09DD\u09DF-\u09E3\u09E6-\u09FE' + }, + { + 'name': 'Bhaiksuki', + 'astral': '\uD807[\uDC00-\uDC08\uDC0A-\uDC36\uDC38-\uDC45\uDC50-\uDC6C]' + }, + { + 'name': 'Bopomofo', + 'bmp': '\u02EA\u02EB\u3105-\u312F\u31A0-\u31BA' + }, + { + 'name': 'Brahmi', + 'astral': '\uD804[\uDC00-\uDC4D\uDC52-\uDC6F\uDC7F]' + }, + { + 'name': 'Braille', + 'bmp': '\u2800-\u28FF' + }, + { + 'name': 'Buginese', + 'bmp': '\u1A00-\u1A1B\u1A1E\u1A1F' + }, + { + 'name': 'Buhid', + 'bmp': '\u1740-\u1753' + }, + { + 'name': 'Canadian_Aboriginal', + 'bmp': '\u1400-\u167F\u18B0-\u18F5' + }, + { + 'name': 'Carian', + 'astral': '\uD800[\uDEA0-\uDED0]' + }, + { + 'name': 'Caucasian_Albanian', + 'astral': '\uD801[\uDD30-\uDD63\uDD6F]' + }, + { + 'name': 'Chakma', + 'astral': '\uD804[\uDD00-\uDD34\uDD36-\uDD46]' + }, + { + 'name': 'Cham', + 'bmp': '\uAA00-\uAA36\uAA40-\uAA4D\uAA50-\uAA59\uAA5C-\uAA5F' + }, + { + 'name': 'Cherokee', + 'bmp': '\u13A0-\u13F5\u13F8-\u13FD\uAB70-\uABBF' + }, + { + 'name': 'Common', + 'bmp': '\0-@\\[-`\\{-\xA9\xAB-\xB9\xBB-\xBF\xD7\xF7\u02B9-\u02DF\u02E5-\u02E9\u02EC-\u02FF\u0374\u037E\u0385\u0387\u0589\u0605\u060C\u061B\u061F\u0640\u06DD\u08E2\u0964\u0965\u0E3F\u0FD5-\u0FD8\u10FB\u16EB-\u16ED\u1735\u1736\u1802\u1803\u1805\u1CD3\u1CE1\u1CE9-\u1CEC\u1CEE-\u1CF3\u1CF5-\u1CF7\u2000-\u200B\u200E-\u2064\u2066-\u2070\u2074-\u207E\u2080-\u208E\u20A0-\u20BF\u2100-\u2125\u2127-\u2129\u212C-\u2131\u2133-\u214D\u214F-\u215F\u2189-\u218B\u2190-\u2426\u2440-\u244A\u2460-\u27FF\u2900-\u2B73\u2B76-\u2B95\u2B98-\u2BC8\u2BCA-\u2BFE\u2E00-\u2E4E\u2FF0-\u2FFB\u3000-\u3004\u3006\u3008-\u3020\u3030-\u3037\u303C-\u303F\u309B\u309C\u30A0\u30FB\u30FC\u3190-\u319F\u31C0-\u31E3\u3220-\u325F\u327F-\u32CF\u3358-\u33FF\u4DC0-\u4DFF\uA700-\uA721\uA788-\uA78A\uA830-\uA839\uA92E\uA9CF\uAB5B\uFD3E\uFD3F\uFE10-\uFE19\uFE30-\uFE52\uFE54-\uFE66\uFE68-\uFE6B\uFEFF\uFF01-\uFF20\uFF3B-\uFF40\uFF5B-\uFF65\uFF70\uFF9E\uFF9F\uFFE0-\uFFE6\uFFE8-\uFFEE\uFFF9-\uFFFD', + 'astral': '\uD800[\uDD00-\uDD02\uDD07-\uDD33\uDD37-\uDD3F\uDD90-\uDD9B\uDDD0-\uDDFC\uDEE1-\uDEFB]|\uD82F[\uDCA0-\uDCA3]|\uD834[\uDC00-\uDCF5\uDD00-\uDD26\uDD29-\uDD66\uDD6A-\uDD7A\uDD83\uDD84\uDD8C-\uDDA9\uDDAE-\uDDE8\uDEE0-\uDEF3\uDF00-\uDF56\uDF60-\uDF78]|\uD835[\uDC00-\uDC54\uDC56-\uDC9C\uDC9E\uDC9F\uDCA2\uDCA5\uDCA6\uDCA9-\uDCAC\uDCAE-\uDCB9\uDCBB\uDCBD-\uDCC3\uDCC5-\uDD05\uDD07-\uDD0A\uDD0D-\uDD14\uDD16-\uDD1C\uDD1E-\uDD39\uDD3B-\uDD3E\uDD40-\uDD44\uDD46\uDD4A-\uDD50\uDD52-\uDEA5\uDEA8-\uDFCB\uDFCE-\uDFFF]|\uD83B[\uDC71-\uDCB4]|\uD83C[\uDC00-\uDC2B\uDC30-\uDC93\uDCA0-\uDCAE\uDCB1-\uDCBF\uDCC1-\uDCCF\uDCD1-\uDCF5\uDD00-\uDD0C\uDD10-\uDD6B\uDD70-\uDDAC\uDDE6-\uDDFF\uDE01\uDE02\uDE10-\uDE3B\uDE40-\uDE48\uDE50\uDE51\uDE60-\uDE65\uDF00-\uDFFF]|\uD83D[\uDC00-\uDED4\uDEE0-\uDEEC\uDEF0-\uDEF9\uDF00-\uDF73\uDF80-\uDFD8]|\uD83E[\uDC00-\uDC0B\uDC10-\uDC47\uDC50-\uDC59\uDC60-\uDC87\uDC90-\uDCAD\uDD00-\uDD0B\uDD10-\uDD3E\uDD40-\uDD70\uDD73-\uDD76\uDD7A\uDD7C-\uDDA2\uDDB0-\uDDB9\uDDC0-\uDDC2\uDDD0-\uDDFF\uDE60-\uDE6D]|\uDB40[\uDC01\uDC20-\uDC7F]' + }, + { + 'name': 'Coptic', + 'bmp': '\u03E2-\u03EF\u2C80-\u2CF3\u2CF9-\u2CFF' + }, + { + 'name': 'Cuneiform', + 'astral': '\uD808[\uDC00-\uDF99]|\uD809[\uDC00-\uDC6E\uDC70-\uDC74\uDC80-\uDD43]' + }, + { + 'name': 'Cypriot', + 'astral': '\uD802[\uDC00-\uDC05\uDC08\uDC0A-\uDC35\uDC37\uDC38\uDC3C\uDC3F]' + }, + { + 'name': 'Cyrillic', + 'bmp': '\u0400-\u0484\u0487-\u052F\u1C80-\u1C88\u1D2B\u1D78\u2DE0-\u2DFF\uA640-\uA69F\uFE2E\uFE2F' + }, + { + 'name': 'Deseret', + 'astral': '\uD801[\uDC00-\uDC4F]' + }, + { + 'name': 'Devanagari', + 'bmp': '\u0900-\u0950\u0953-\u0963\u0966-\u097F\uA8E0-\uA8FF' + }, + { + 'name': 'Dogra', + 'astral': '\uD806[\uDC00-\uDC3B]' + }, + { + 'name': 'Duployan', + 'astral': '\uD82F[\uDC00-\uDC6A\uDC70-\uDC7C\uDC80-\uDC88\uDC90-\uDC99\uDC9C-\uDC9F]' + }, + { + 'name': 'Egyptian_Hieroglyphs', + 'astral': '\uD80C[\uDC00-\uDFFF]|\uD80D[\uDC00-\uDC2E]' + }, + { + 'name': 'Elbasan', + 'astral': '\uD801[\uDD00-\uDD27]' + }, + { + 'name': 'Ethiopic', + 'bmp': '\u1200-\u1248\u124A-\u124D\u1250-\u1256\u1258\u125A-\u125D\u1260-\u1288\u128A-\u128D\u1290-\u12B0\u12B2-\u12B5\u12B8-\u12BE\u12C0\u12C2-\u12C5\u12C8-\u12D6\u12D8-\u1310\u1312-\u1315\u1318-\u135A\u135D-\u137C\u1380-\u1399\u2D80-\u2D96\u2DA0-\u2DA6\u2DA8-\u2DAE\u2DB0-\u2DB6\u2DB8-\u2DBE\u2DC0-\u2DC6\u2DC8-\u2DCE\u2DD0-\u2DD6\u2DD8-\u2DDE\uAB01-\uAB06\uAB09-\uAB0E\uAB11-\uAB16\uAB20-\uAB26\uAB28-\uAB2E' + }, + { + 'name': 'Georgian', + 'bmp': '\u10A0-\u10C5\u10C7\u10CD\u10D0-\u10FA\u10FC-\u10FF\u1C90-\u1CBA\u1CBD-\u1CBF\u2D00-\u2D25\u2D27\u2D2D' + }, + { + 'name': 'Glagolitic', + 'bmp': '\u2C00-\u2C2E\u2C30-\u2C5E', + 'astral': '\uD838[\uDC00-\uDC06\uDC08-\uDC18\uDC1B-\uDC21\uDC23\uDC24\uDC26-\uDC2A]' + }, + { + 'name': 'Gothic', + 'astral': '\uD800[\uDF30-\uDF4A]' + }, + { + 'name': 'Grantha', + 'astral': '\uD804[\uDF00-\uDF03\uDF05-\uDF0C\uDF0F\uDF10\uDF13-\uDF28\uDF2A-\uDF30\uDF32\uDF33\uDF35-\uDF39\uDF3C-\uDF44\uDF47\uDF48\uDF4B-\uDF4D\uDF50\uDF57\uDF5D-\uDF63\uDF66-\uDF6C\uDF70-\uDF74]' + }, + { + 'name': 'Greek', + 'bmp': '\u0370-\u0373\u0375-\u0377\u037A-\u037D\u037F\u0384\u0386\u0388-\u038A\u038C\u038E-\u03A1\u03A3-\u03E1\u03F0-\u03FF\u1D26-\u1D2A\u1D5D-\u1D61\u1D66-\u1D6A\u1DBF\u1F00-\u1F15\u1F18-\u1F1D\u1F20-\u1F45\u1F48-\u1F4D\u1F50-\u1F57\u1F59\u1F5B\u1F5D\u1F5F-\u1F7D\u1F80-\u1FB4\u1FB6-\u1FC4\u1FC6-\u1FD3\u1FD6-\u1FDB\u1FDD-\u1FEF\u1FF2-\u1FF4\u1FF6-\u1FFE\u2126\uAB65', + 'astral': '\uD800[\uDD40-\uDD8E\uDDA0]|\uD834[\uDE00-\uDE45]' + }, + { + 'name': 'Gujarati', + 'bmp': '\u0A81-\u0A83\u0A85-\u0A8D\u0A8F-\u0A91\u0A93-\u0AA8\u0AAA-\u0AB0\u0AB2\u0AB3\u0AB5-\u0AB9\u0ABC-\u0AC5\u0AC7-\u0AC9\u0ACB-\u0ACD\u0AD0\u0AE0-\u0AE3\u0AE6-\u0AF1\u0AF9-\u0AFF' + }, + { + 'name': 'Gunjala_Gondi', + 'astral': '\uD807[\uDD60-\uDD65\uDD67\uDD68\uDD6A-\uDD8E\uDD90\uDD91\uDD93-\uDD98\uDDA0-\uDDA9]' + }, + { + 'name': 'Gurmukhi', + 'bmp': '\u0A01-\u0A03\u0A05-\u0A0A\u0A0F\u0A10\u0A13-\u0A28\u0A2A-\u0A30\u0A32\u0A33\u0A35\u0A36\u0A38\u0A39\u0A3C\u0A3E-\u0A42\u0A47\u0A48\u0A4B-\u0A4D\u0A51\u0A59-\u0A5C\u0A5E\u0A66-\u0A76' + }, + { + 'name': 'Han', + 'bmp': '\u2E80-\u2E99\u2E9B-\u2EF3\u2F00-\u2FD5\u3005\u3007\u3021-\u3029\u3038-\u303B\u3400-\u4DB5\u4E00-\u9FEF\uF900-\uFA6D\uFA70-\uFAD9', + 'astral': '[\uD840-\uD868\uD86A-\uD86C\uD86F-\uD872\uD874-\uD879][\uDC00-\uDFFF]|\uD869[\uDC00-\uDED6\uDF00-\uDFFF]|\uD86D[\uDC00-\uDF34\uDF40-\uDFFF]|\uD86E[\uDC00-\uDC1D\uDC20-\uDFFF]|\uD873[\uDC00-\uDEA1\uDEB0-\uDFFF]|\uD87A[\uDC00-\uDFE0]|\uD87E[\uDC00-\uDE1D]' + }, + { + 'name': 'Hangul', + 'bmp': '\u1100-\u11FF\u302E\u302F\u3131-\u318E\u3200-\u321E\u3260-\u327E\uA960-\uA97C\uAC00-\uD7A3\uD7B0-\uD7C6\uD7CB-\uD7FB\uFFA0-\uFFBE\uFFC2-\uFFC7\uFFCA-\uFFCF\uFFD2-\uFFD7\uFFDA-\uFFDC' + }, + { + 'name': 'Hanifi_Rohingya', + 'astral': '\uD803[\uDD00-\uDD27\uDD30-\uDD39]' + }, + { + 'name': 'Hanunoo', + 'bmp': '\u1720-\u1734' + }, + { + 'name': 'Hatran', + 'astral': '\uD802[\uDCE0-\uDCF2\uDCF4\uDCF5\uDCFB-\uDCFF]' + }, + { + 'name': 'Hebrew', + 'bmp': '\u0591-\u05C7\u05D0-\u05EA\u05EF-\u05F4\uFB1D-\uFB36\uFB38-\uFB3C\uFB3E\uFB40\uFB41\uFB43\uFB44\uFB46-\uFB4F' + }, + { + 'name': 'Hiragana', + 'bmp': '\u3041-\u3096\u309D-\u309F', + 'astral': '\uD82C[\uDC01-\uDD1E]|\uD83C\uDE00' + }, + { + 'name': 'Imperial_Aramaic', + 'astral': '\uD802[\uDC40-\uDC55\uDC57-\uDC5F]' + }, + { + 'name': 'Inherited', + 'bmp': '\u0300-\u036F\u0485\u0486\u064B-\u0655\u0670\u0951\u0952\u1AB0-\u1ABE\u1CD0-\u1CD2\u1CD4-\u1CE0\u1CE2-\u1CE8\u1CED\u1CF4\u1CF8\u1CF9\u1DC0-\u1DF9\u1DFB-\u1DFF\u200C\u200D\u20D0-\u20F0\u302A-\u302D\u3099\u309A\uFE00-\uFE0F\uFE20-\uFE2D', + 'astral': '\uD800[\uDDFD\uDEE0]|\uD804\uDF3B|\uD834[\uDD67-\uDD69\uDD7B-\uDD82\uDD85-\uDD8B\uDDAA-\uDDAD]|\uDB40[\uDD00-\uDDEF]' + }, + { + 'name': 'Inscriptional_Pahlavi', + 'astral': '\uD802[\uDF60-\uDF72\uDF78-\uDF7F]' + }, + { + 'name': 'Inscriptional_Parthian', + 'astral': '\uD802[\uDF40-\uDF55\uDF58-\uDF5F]' + }, + { + 'name': 'Javanese', + 'bmp': '\uA980-\uA9CD\uA9D0-\uA9D9\uA9DE\uA9DF' + }, + { + 'name': 'Kaithi', + 'astral': '\uD804[\uDC80-\uDCC1\uDCCD]' + }, + { + 'name': 'Kannada', + 'bmp': '\u0C80-\u0C8C\u0C8E-\u0C90\u0C92-\u0CA8\u0CAA-\u0CB3\u0CB5-\u0CB9\u0CBC-\u0CC4\u0CC6-\u0CC8\u0CCA-\u0CCD\u0CD5\u0CD6\u0CDE\u0CE0-\u0CE3\u0CE6-\u0CEF\u0CF1\u0CF2' + }, + { + 'name': 'Katakana', + 'bmp': '\u30A1-\u30FA\u30FD-\u30FF\u31F0-\u31FF\u32D0-\u32FE\u3300-\u3357\uFF66-\uFF6F\uFF71-\uFF9D', + 'astral': '\uD82C\uDC00' + }, + { + 'name': 'Kayah_Li', + 'bmp': '\uA900-\uA92D\uA92F' + }, + { + 'name': 'Kharoshthi', + 'astral': '\uD802[\uDE00-\uDE03\uDE05\uDE06\uDE0C-\uDE13\uDE15-\uDE17\uDE19-\uDE35\uDE38-\uDE3A\uDE3F-\uDE48\uDE50-\uDE58]' + }, + { + 'name': 'Khmer', + 'bmp': '\u1780-\u17DD\u17E0-\u17E9\u17F0-\u17F9\u19E0-\u19FF' + }, + { + 'name': 'Khojki', + 'astral': '\uD804[\uDE00-\uDE11\uDE13-\uDE3E]' + }, + { + 'name': 'Khudawadi', + 'astral': '\uD804[\uDEB0-\uDEEA\uDEF0-\uDEF9]' + }, + { + 'name': 'Lao', + 'bmp': '\u0E81\u0E82\u0E84\u0E87\u0E88\u0E8A\u0E8D\u0E94-\u0E97\u0E99-\u0E9F\u0EA1-\u0EA3\u0EA5\u0EA7\u0EAA\u0EAB\u0EAD-\u0EB9\u0EBB-\u0EBD\u0EC0-\u0EC4\u0EC6\u0EC8-\u0ECD\u0ED0-\u0ED9\u0EDC-\u0EDF' + }, + { + 'name': 'Latin', + 'bmp': 'A-Za-z\xAA\xBA\xC0-\xD6\xD8-\xF6\xF8-\u02B8\u02E0-\u02E4\u1D00-\u1D25\u1D2C-\u1D5C\u1D62-\u1D65\u1D6B-\u1D77\u1D79-\u1DBE\u1E00-\u1EFF\u2071\u207F\u2090-\u209C\u212A\u212B\u2132\u214E\u2160-\u2188\u2C60-\u2C7F\uA722-\uA787\uA78B-\uA7B9\uA7F7-\uA7FF\uAB30-\uAB5A\uAB5C-\uAB64\uFB00-\uFB06\uFF21-\uFF3A\uFF41-\uFF5A' + }, + { + 'name': 'Lepcha', + 'bmp': '\u1C00-\u1C37\u1C3B-\u1C49\u1C4D-\u1C4F' + }, + { + 'name': 'Limbu', + 'bmp': '\u1900-\u191E\u1920-\u192B\u1930-\u193B\u1940\u1944-\u194F' + }, + { + 'name': 'Linear_A', + 'astral': '\uD801[\uDE00-\uDF36\uDF40-\uDF55\uDF60-\uDF67]' + }, + { + 'name': 'Linear_B', + 'astral': '\uD800[\uDC00-\uDC0B\uDC0D-\uDC26\uDC28-\uDC3A\uDC3C\uDC3D\uDC3F-\uDC4D\uDC50-\uDC5D\uDC80-\uDCFA]' + }, + { + 'name': 'Lisu', + 'bmp': '\uA4D0-\uA4FF' + }, + { + 'name': 'Lycian', + 'astral': '\uD800[\uDE80-\uDE9C]' + }, + { + 'name': 'Lydian', + 'astral': '\uD802[\uDD20-\uDD39\uDD3F]' + }, + { + 'name': 'Mahajani', + 'astral': '\uD804[\uDD50-\uDD76]' + }, + { + 'name': 'Makasar', + 'astral': '\uD807[\uDEE0-\uDEF8]' + }, + { + 'name': 'Malayalam', + 'bmp': '\u0D00-\u0D03\u0D05-\u0D0C\u0D0E-\u0D10\u0D12-\u0D44\u0D46-\u0D48\u0D4A-\u0D4F\u0D54-\u0D63\u0D66-\u0D7F' + }, + { + 'name': 'Mandaic', + 'bmp': '\u0840-\u085B\u085E' + }, + { + 'name': 'Manichaean', + 'astral': '\uD802[\uDEC0-\uDEE6\uDEEB-\uDEF6]' + }, + { + 'name': 'Marchen', + 'astral': '\uD807[\uDC70-\uDC8F\uDC92-\uDCA7\uDCA9-\uDCB6]' + }, + { + 'name': 'Masaram_Gondi', + 'astral': '\uD807[\uDD00-\uDD06\uDD08\uDD09\uDD0B-\uDD36\uDD3A\uDD3C\uDD3D\uDD3F-\uDD47\uDD50-\uDD59]' + }, + { + 'name': 'Medefaidrin', + 'astral': '\uD81B[\uDE40-\uDE9A]' + }, + { + 'name': 'Meetei_Mayek', + 'bmp': '\uAAE0-\uAAF6\uABC0-\uABED\uABF0-\uABF9' + }, + { + 'name': 'Mende_Kikakui', + 'astral': '\uD83A[\uDC00-\uDCC4\uDCC7-\uDCD6]' + }, + { + 'name': 'Meroitic_Cursive', + 'astral': '\uD802[\uDDA0-\uDDB7\uDDBC-\uDDCF\uDDD2-\uDDFF]' + }, + { + 'name': 'Meroitic_Hieroglyphs', + 'astral': '\uD802[\uDD80-\uDD9F]' + }, + { + 'name': 'Miao', + 'astral': '\uD81B[\uDF00-\uDF44\uDF50-\uDF7E\uDF8F-\uDF9F]' + }, + { + 'name': 'Modi', + 'astral': '\uD805[\uDE00-\uDE44\uDE50-\uDE59]' + }, + { + 'name': 'Mongolian', + 'bmp': '\u1800\u1801\u1804\u1806-\u180E\u1810-\u1819\u1820-\u1878\u1880-\u18AA', + 'astral': '\uD805[\uDE60-\uDE6C]' + }, + { + 'name': 'Mro', + 'astral': '\uD81A[\uDE40-\uDE5E\uDE60-\uDE69\uDE6E\uDE6F]' + }, + { + 'name': 'Multani', + 'astral': '\uD804[\uDE80-\uDE86\uDE88\uDE8A-\uDE8D\uDE8F-\uDE9D\uDE9F-\uDEA9]' + }, + { + 'name': 'Myanmar', + 'bmp': '\u1000-\u109F\uA9E0-\uA9FE\uAA60-\uAA7F' + }, + { + 'name': 'Nabataean', + 'astral': '\uD802[\uDC80-\uDC9E\uDCA7-\uDCAF]' + }, + { + 'name': 'New_Tai_Lue', + 'bmp': '\u1980-\u19AB\u19B0-\u19C9\u19D0-\u19DA\u19DE\u19DF' + }, + { + 'name': 'Newa', + 'astral': '\uD805[\uDC00-\uDC59\uDC5B\uDC5D\uDC5E]' + }, + { + 'name': 'Nko', + 'bmp': '\u07C0-\u07FA\u07FD-\u07FF' + }, + { + 'name': 'Nushu', + 'astral': '\uD81B\uDFE1|\uD82C[\uDD70-\uDEFB]' + }, + { + 'name': 'Ogham', + 'bmp': '\u1680-\u169C' + }, + { + 'name': 'Ol_Chiki', + 'bmp': '\u1C50-\u1C7F' + }, + { + 'name': 'Old_Hungarian', + 'astral': '\uD803[\uDC80-\uDCB2\uDCC0-\uDCF2\uDCFA-\uDCFF]' + }, + { + 'name': 'Old_Italic', + 'astral': '\uD800[\uDF00-\uDF23\uDF2D-\uDF2F]' + }, + { + 'name': 'Old_North_Arabian', + 'astral': '\uD802[\uDE80-\uDE9F]' + }, + { + 'name': 'Old_Permic', + 'astral': '\uD800[\uDF50-\uDF7A]' + }, + { + 'name': 'Old_Persian', + 'astral': '\uD800[\uDFA0-\uDFC3\uDFC8-\uDFD5]' + }, + { + 'name': 'Old_Sogdian', + 'astral': '\uD803[\uDF00-\uDF27]' + }, + { + 'name': 'Old_South_Arabian', + 'astral': '\uD802[\uDE60-\uDE7F]' + }, + { + 'name': 'Old_Turkic', + 'astral': '\uD803[\uDC00-\uDC48]' + }, + { + 'name': 'Oriya', + 'bmp': '\u0B01-\u0B03\u0B05-\u0B0C\u0B0F\u0B10\u0B13-\u0B28\u0B2A-\u0B30\u0B32\u0B33\u0B35-\u0B39\u0B3C-\u0B44\u0B47\u0B48\u0B4B-\u0B4D\u0B56\u0B57\u0B5C\u0B5D\u0B5F-\u0B63\u0B66-\u0B77' + }, + { + 'name': 'Osage', + 'astral': '\uD801[\uDCB0-\uDCD3\uDCD8-\uDCFB]' + }, + { + 'name': 'Osmanya', + 'astral': '\uD801[\uDC80-\uDC9D\uDCA0-\uDCA9]' + }, + { + 'name': 'Pahawh_Hmong', + 'astral': '\uD81A[\uDF00-\uDF45\uDF50-\uDF59\uDF5B-\uDF61\uDF63-\uDF77\uDF7D-\uDF8F]' + }, + { + 'name': 'Palmyrene', + 'astral': '\uD802[\uDC60-\uDC7F]' + }, + { + 'name': 'Pau_Cin_Hau', + 'astral': '\uD806[\uDEC0-\uDEF8]' + }, + { + 'name': 'Phags_Pa', + 'bmp': '\uA840-\uA877' + }, + { + 'name': 'Phoenician', + 'astral': '\uD802[\uDD00-\uDD1B\uDD1F]' + }, + { + 'name': 'Psalter_Pahlavi', + 'astral': '\uD802[\uDF80-\uDF91\uDF99-\uDF9C\uDFA9-\uDFAF]' + }, + { + 'name': 'Rejang', + 'bmp': '\uA930-\uA953\uA95F' + }, + { + 'name': 'Runic', + 'bmp': '\u16A0-\u16EA\u16EE-\u16F8' + }, + { + 'name': 'Samaritan', + 'bmp': '\u0800-\u082D\u0830-\u083E' + }, + { + 'name': 'Saurashtra', + 'bmp': '\uA880-\uA8C5\uA8CE-\uA8D9' + }, + { + 'name': 'Sharada', + 'astral': '\uD804[\uDD80-\uDDCD\uDDD0-\uDDDF]' + }, + { + 'name': 'Shavian', + 'astral': '\uD801[\uDC50-\uDC7F]' + }, + { + 'name': 'Siddham', + 'astral': '\uD805[\uDD80-\uDDB5\uDDB8-\uDDDD]' + }, + { + 'name': 'SignWriting', + 'astral': '\uD836[\uDC00-\uDE8B\uDE9B-\uDE9F\uDEA1-\uDEAF]' + }, + { + 'name': 'Sinhala', + 'bmp': '\u0D82\u0D83\u0D85-\u0D96\u0D9A-\u0DB1\u0DB3-\u0DBB\u0DBD\u0DC0-\u0DC6\u0DCA\u0DCF-\u0DD4\u0DD6\u0DD8-\u0DDF\u0DE6-\u0DEF\u0DF2-\u0DF4', + 'astral': '\uD804[\uDDE1-\uDDF4]' + }, + { + 'name': 'Sogdian', + 'astral': '\uD803[\uDF30-\uDF59]' + }, + { + 'name': 'Sora_Sompeng', + 'astral': '\uD804[\uDCD0-\uDCE8\uDCF0-\uDCF9]' + }, + { + 'name': 'Soyombo', + 'astral': '\uD806[\uDE50-\uDE83\uDE86-\uDEA2]' + }, + { + 'name': 'Sundanese', + 'bmp': '\u1B80-\u1BBF\u1CC0-\u1CC7' + }, + { + 'name': 'Syloti_Nagri', + 'bmp': '\uA800-\uA82B' + }, + { + 'name': 'Syriac', + 'bmp': '\u0700-\u070D\u070F-\u074A\u074D-\u074F\u0860-\u086A' + }, + { + 'name': 'Tagalog', + 'bmp': '\u1700-\u170C\u170E-\u1714' + }, + { + 'name': 'Tagbanwa', + 'bmp': '\u1760-\u176C\u176E-\u1770\u1772\u1773' + }, + { + 'name': 'Tai_Le', + 'bmp': '\u1950-\u196D\u1970-\u1974' + }, + { + 'name': 'Tai_Tham', + 'bmp': '\u1A20-\u1A5E\u1A60-\u1A7C\u1A7F-\u1A89\u1A90-\u1A99\u1AA0-\u1AAD' + }, + { + 'name': 'Tai_Viet', + 'bmp': '\uAA80-\uAAC2\uAADB-\uAADF' + }, + { + 'name': 'Takri', + 'astral': '\uD805[\uDE80-\uDEB7\uDEC0-\uDEC9]' + }, + { + 'name': 'Tamil', + 'bmp': '\u0B82\u0B83\u0B85-\u0B8A\u0B8E-\u0B90\u0B92-\u0B95\u0B99\u0B9A\u0B9C\u0B9E\u0B9F\u0BA3\u0BA4\u0BA8-\u0BAA\u0BAE-\u0BB9\u0BBE-\u0BC2\u0BC6-\u0BC8\u0BCA-\u0BCD\u0BD0\u0BD7\u0BE6-\u0BFA' + }, + { + 'name': 'Tangut', + 'astral': '\uD81B\uDFE0|[\uD81C-\uD820][\uDC00-\uDFFF]|\uD821[\uDC00-\uDFF1]|\uD822[\uDC00-\uDEF2]' + }, + { + 'name': 'Telugu', + 'bmp': '\u0C00-\u0C0C\u0C0E-\u0C10\u0C12-\u0C28\u0C2A-\u0C39\u0C3D-\u0C44\u0C46-\u0C48\u0C4A-\u0C4D\u0C55\u0C56\u0C58-\u0C5A\u0C60-\u0C63\u0C66-\u0C6F\u0C78-\u0C7F' + }, + { + 'name': 'Thaana', + 'bmp': '\u0780-\u07B1' + }, + { + 'name': 'Thai', + 'bmp': '\u0E01-\u0E3A\u0E40-\u0E5B' + }, + { + 'name': 'Tibetan', + 'bmp': '\u0F00-\u0F47\u0F49-\u0F6C\u0F71-\u0F97\u0F99-\u0FBC\u0FBE-\u0FCC\u0FCE-\u0FD4\u0FD9\u0FDA' + }, + { + 'name': 'Tifinagh', + 'bmp': '\u2D30-\u2D67\u2D6F\u2D70\u2D7F' + }, + { + 'name': 'Tirhuta', + 'astral': '\uD805[\uDC80-\uDCC7\uDCD0-\uDCD9]' + }, + { + 'name': 'Ugaritic', + 'astral': '\uD800[\uDF80-\uDF9D\uDF9F]' + }, + { + 'name': 'Vai', + 'bmp': '\uA500-\uA62B' + }, + { + 'name': 'Warang_Citi', + 'astral': '\uD806[\uDCA0-\uDCF2\uDCFF]' + }, + { + 'name': 'Yi', + 'bmp': '\uA000-\uA48C\uA490-\uA4C6' + }, + { + 'name': 'Zanabazar_Square', + 'astral': '\uD806[\uDE00-\uDE47]' + } +]; + +var unicodeScripts = createCommonjsModule(function (module, exports) { +"use strict"; + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.default = void 0; + +var _scripts = _interopRequireDefault(scripts); + +function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } + +/*! + * XRegExp Unicode Scripts 4.2.0 + * + * Steven Levithan (c) 2010-present MIT License + * Unicode data by Mathias Bynens + */ +var _default = function _default(XRegExp) { + /** + * Adds support for all Unicode scripts. E.g., `\p{Latin}`. Token names are case insensitive, + * and any spaces, hyphens, and underscores are ignored. + * + * Uses Unicode 11.0.0. + * + * @requires XRegExp, Unicode Base + */ + if (!XRegExp.addUnicodeData) { + throw new ReferenceError('Unicode Base must be loaded before Unicode Scripts'); + } + + XRegExp.addUnicodeData(_scripts.default); +}; + +exports.default = _default; +module.exports = exports["default"]; +}); + +unwrapExports(unicodeScripts); + +var lib = createCommonjsModule(function (module, exports) { +"use strict"; + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.default = void 0; + +var _xregexp = _interopRequireDefault(xregexp); + +var _build = _interopRequireDefault(build); + +var _matchrecursive = _interopRequireDefault(matchrecursive); + +var _unicodeBase = _interopRequireDefault(unicodeBase); + +var _unicodeBlocks = _interopRequireDefault(unicodeBlocks); + +var _unicodeCategories = _interopRequireDefault(unicodeCategories); + +var _unicodeProperties = _interopRequireDefault(unicodeProperties); + +var _unicodeScripts = _interopRequireDefault(unicodeScripts); + +function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } + +(_build.default)(_xregexp.default); +(_matchrecursive.default)(_xregexp.default); +(_unicodeBase.default)(_xregexp.default); +(_unicodeBlocks.default)(_xregexp.default); +(_unicodeCategories.default)(_xregexp.default); +(_unicodeProperties.default)(_xregexp.default); +(_unicodeScripts.default)(_xregexp.default); +var _default = _xregexp.default; +exports.default = _default; +module.exports = exports["default"]; +}); + +unwrapExports(lib); + +var utilities = createCommonjsModule(function (module, exports) { +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); + +class FormatUtility { + static preProcess(query, toLower = true) { + if (toLower) { + query = query.toLowerCase(); + } + return query + .replace(/0/g, "0") + .replace(/1/g, "1") + .replace(/2/g, "2") + .replace(/3/g, "3") + .replace(/4/g, "4") + .replace(/5/g, "5") + .replace(/6/g, "6") + .replace(/7/g, "7") + .replace(/8/g, "8") + .replace(/9/g, "9") + .replace(/:/g, ":") + .replace(/-/g, "-") + .replace(/,/g, ",") + .replace(///g, "/") + .replace(/G/g, "G") + .replace(/M/g, "M") + .replace(/T/g, "T") + .replace(/K/g, "K") + .replace(/k/g, "k") + .replace(/./g, ".") + .replace(/(/g, "(") + .replace(/)/g, ")"); + } +} +exports.FormatUtility = FormatUtility; +class Match { + constructor(index, length, value, groups) { + this.index = index; + this.length = length; + this.value = value; + this.innerGroups = groups; + } + groups(key) { + return this.innerGroups[key] ? this.innerGroups[key] : { value: '', index: 0, length: 0, captures: [] }; + } +} +exports.Match = Match; +class RegExpUtility { + static getMatches(regex, source) { + if (!regex) + return []; + let rawRegex = regex.xregexp.source; + if (!rawRegex.includes('(?= 0) { + closePos = this.getClosePos(rawRegex, startPos); + let nlbRegex = lib(rawRegex.substring(startPos, closePos + 1), flags); + let nextRegex = RegExpUtility.getNextRegex(rawRegex, startPos); + nlbRegex.nextRegex = nextRegex ? lib(nextRegex, flags) : null; + negativeLookbehindRegexes.push(nlbRegex); + rawRegex = rawRegex.substr(0, startPos) + rawRegex.substr(closePos + 1); + startPos = rawRegex.indexOf('(? { + let clean = true; + negativeLookbehindRegexes.forEach(regex => { + let negativeLookbehindMatches = RegExpUtility.getMatchesSimple(regex, source); + negativeLookbehindMatches.forEach(negativeLookbehindMatch => { + let negativeLookbehindEnd = negativeLookbehindMatch.index + negativeLookbehindMatch.length; + let nextRegex = regex.nextRegex; + if (match.index === negativeLookbehindEnd) { + if (!nextRegex) { + clean = false; + return; + } + else { + let nextMatch = RegExpUtility.getFirstMatchIndex(nextRegex, source.substring(negativeLookbehindMatch.index)); + if (nextMatch.matched && ((nextMatch.index === negativeLookbehindMatch.length) || (source.includes(nextMatch.value + match.value)))) { + clean = false; + return; + } + } + } + if (negativeLookbehindMatch.value.includes(match.value)) { + let preMatches = RegExpUtility.getMatchesSimple(regex, source.substring(0, match.index)); + preMatches.forEach(preMatch => { + if (source.includes(preMatch.value + match.value)) { + clean = false; + return; + } + }); + } + }); + if (!clean) { + return; + } + }); + if (clean) { + realMatches.push(match); + } + }); + return realMatches; + } + static getMatchesSimple(regex, source) { + // Word boundary (\b) in JS is not unicode-aware, so words starting/ending with accentuated characters will not match + // use a normalized string to match, the return matches' values using the original one + // http://blog.stevenlevithan.com/archives/javascript-regex-and-unicode + // https://stackoverflow.com/questions/2881445/utf-8-word-boundary-regex-in-javascript + let normalized = StringUtility.removeDiacriticsFromWordBoundaries(source); + let matches = new Array(); + lib.forEach(normalized, regex, match => { + let positiveLookbehinds = []; + let groups = {}; + let lastGroup = ''; + Object.keys(match).forEach(key => { + if (!key.includes('__')) + return; + if (key.startsWith('plb') && match[key]) { + if (match[0].indexOf(match[key]) !== 0 && !StringUtility.isNullOrEmpty(lastGroup)) { + let index = match.index + match[0].indexOf(match[key]); + let length = match[key].length; + let value = source.substr(index, length); + groups[lastGroup].value = groups[lastGroup].value + value; + } + positiveLookbehinds.push({ key: key, value: match[key] }); + return; + } + if (key.startsWith('nlb')) { + return; + } + let groupKey = key.substr(0, key.lastIndexOf('__')); + lastGroup = groupKey; + if (!groups[groupKey]) + groups[groupKey] = { value: '', index: 0, length: 0, captures: [] }; + if (match[key]) { + let index = match.index + match[0].indexOf(match[key]); + let length = match[key].length; + let value = source.substr(index, length); + groups[groupKey].index = index; + groups[groupKey].length = length; + groups[groupKey].value = value; + groups[groupKey].captures.push(value); + } + }); + let value = match[0]; + let index = match.index; + let length = value.length; + if (positiveLookbehinds && positiveLookbehinds.length > 0 && value.indexOf(positiveLookbehinds[0].value) === 0) { + value = source.substr(index, length).substr(positiveLookbehinds[0].value.length); + index += positiveLookbehinds[0].value.length; + length -= positiveLookbehinds[0].value.length; + } + else { + value = source.substr(index, length); + } + matches.push(new Match(index, length, value, groups)); + }); + return matches; + } + static getSafeRegExp(source, flags) { + let sanitizedSource = this.sanitizeGroups(source); + return lib(sanitizedSource, flags || 'gis'); + } + static getFirstMatchIndex(regex, source) { + let matches = RegExpUtility.getMatches(regex, source); + if (matches.length) { + return { + matched: true, + index: matches[0].index, + value: matches[0].value + }; + } + return { matched: false, index: -1, value: null }; + } + static split(regex, source) { + return lib.split(source, regex); + } + static isMatch(regex, source) { + return !StringUtility.isNullOrEmpty(source) + && this.getMatches(regex, source).length > 0; + } + static sanitizeGroups(source) { + let index = 0; + let result = lib.replace(source, this.matchGroup, (match, name) => match.replace(name, `${name}__${index++}`)); + index = 0; + result = lib.replace(result, this.matchPositiveLookbehind, () => `(?`); + index = 0; + result = lib.replace(result, this.matchNegativeLookbehind, () => `(?`); + return result; + } + static getNextRegex(source, startPos) { + startPos = RegExpUtility.getClosePos(source, startPos) + 1; + let closePos = RegExpUtility.getClosePos(source, startPos); + if (source[startPos] !== '(') { + closePos--; + } + let next = (startPos === closePos) + ? null + : source.substring(startPos, closePos + 1); + return next; + } + static getClosePos(source, startPos) { + let counter = 1; + let closePos = startPos; + while (counter > 0 && closePos < source.length) { + let c = source[++closePos]; + if (c === '(') + counter++; + else if (c === ')') + counter--; + } + return closePos; + } +} +RegExpUtility.matchGroup = lib(String.raw `\?<(?\w+)>`, 'gis'); +RegExpUtility.matchPositiveLookbehind = lib(String.raw `\(\?<=`, 'gis'); +RegExpUtility.matchNegativeLookbehind = lib(String.raw `\(\? { + let length = s.length; + if (length === 0) + return s; + let first = StringUtility.removeDiacritics(s.substring(0, 1)); + if (length === 1) + return first; + let last = length > 1 ? StringUtility.removeDiacritics(s.substring(length - 1)) : ''; + let mid = s.substring(1, length - 1); + // console.log(first + mid + last) + return first + mid + last; + }) + .join(' '); + } + static removeDiacritics(c) { + let clean = StringUtility.diacriticsRemovalMap[c]; + return !clean ? c : clean; + } +} +StringUtility.diacriticsRemovalMap = { + "Ⓐ": "A", + "A": "A", + "À": "A", + "Á": "A", + "Â": "A", + "Ầ": "A", + "Ấ": "A", + "Ẫ": "A", + "Ẩ": "A", + "Ã": "A", + "Ā": "A", + "Ă": "A", + "Ằ": "A", + "Ắ": "A", + "Ẵ": "A", + "Ẳ": "A", + "Ȧ": "A", + "Ǡ": "A", + "Ä": "A", + "Ǟ": "A", + "Ả": "A", + "Å": "A", + "Ǻ": "A", + "Ǎ": "A", + "Ȁ": "A", + "Ȃ": "A", + "Ạ": "A", + "Ậ": "A", + "Ặ": "A", + "Ḁ": "A", + "Ą": "A", + "Ⱥ": "A", + "Ɐ": "A", + "Ⓑ": "B", + "B": "B", + "Ḃ": "B", + "Ḅ": "B", + "Ḇ": "B", + "Ƀ": "B", + "Ƃ": "B", + "Ɓ": "B", + "Ⓒ": "C", + "C": "C", + "Ć": "C", + "Ĉ": "C", + "Ċ": "C", + "Č": "C", + "Ç": "C", + "Ḉ": "C", + "Ƈ": "C", + "Ȼ": "C", + "Ꜿ": "C", + "Ⓓ": "D", + "D": "D", + "Ḋ": "D", + "Ď": "D", + "Ḍ": "D", + "Ḑ": "D", + "Ḓ": "D", + "Ḏ": "D", + "Đ": "D", + "Ƌ": "D", + "Ɗ": "D", + "Ɖ": "D", + "Ꝺ": "D", + "Ⓔ": "E", + "E": "E", + "È": "E", + "É": "E", + "Ê": "E", + "Ề": "E", + "Ế": "E", + "Ễ": "E", + "Ể": "E", + "Ẽ": "E", + "Ē": "E", + "Ḕ": "E", + "Ḗ": "E", + "Ĕ": "E", + "Ė": "E", + "Ë": "E", + "Ẻ": "E", + "Ě": "E", + "Ȅ": "E", + "Ȇ": "E", + "Ẹ": "E", + "Ệ": "E", + "Ȩ": "E", + "Ḝ": "E", + "Ę": "E", + "Ḙ": "E", + "Ḛ": "E", + "Ɛ": "E", + "Ǝ": "E", + "Ⓕ": "F", + "F": "F", + "Ḟ": "F", + "Ƒ": "F", + "Ꝼ": "F", + "Ⓖ": "G", + "G": "G", + "Ǵ": "G", + "Ĝ": "G", + "Ḡ": "G", + "Ğ": "G", + "Ġ": "G", + "Ǧ": "G", + "Ģ": "G", + "Ǥ": "G", + "Ɠ": "G", + "Ꞡ": "G", + "Ᵹ": "G", + "Ꝿ": "G", + "Ⓗ": "H", + "H": "H", + "Ĥ": "H", + "Ḣ": "H", + "Ḧ": "H", + "Ȟ": "H", + "Ḥ": "H", + "Ḩ": "H", + "Ḫ": "H", + "Ħ": "H", + "Ⱨ": "H", + "Ⱶ": "H", + "Ɥ": "H", + "Ⓘ": "I", + "I": "I", + "Ì": "I", + "Í": "I", + "Î": "I", + "Ĩ": "I", + "Ī": "I", + "Ĭ": "I", + "İ": "I", + "Ï": "I", + "Ḯ": "I", + "Ỉ": "I", + "Ǐ": "I", + "Ȉ": "I", + "Ȋ": "I", + "Ị": "I", + "Į": "I", + "Ḭ": "I", + "Ɨ": "I", + "Ⓙ": "J", + "J": "J", + "Ĵ": "J", + "Ɉ": "J", + "Ⓚ": "K", + "K": "K", + "Ḱ": "K", + "Ǩ": "K", + "Ḳ": "K", + "Ķ": "K", + "Ḵ": "K", + "Ƙ": "K", + "Ⱪ": "K", + "Ꝁ": "K", + "Ꝃ": "K", + "Ꝅ": "K", + "Ꞣ": "K", + "Ⓛ": "L", + "L": "L", + "Ŀ": "L", + "Ĺ": "L", + "Ľ": "L", + "Ḷ": "L", + "Ḹ": "L", + "Ļ": "L", + "Ḽ": "L", + "Ḻ": "L", + "Ł": "L", + "Ƚ": "L", + "Ɫ": "L", + "Ⱡ": "L", + "Ꝉ": "L", + "Ꝇ": "L", + "Ꞁ": "L", + "Ⓜ": "M", + "M": "M", + "Ḿ": "M", + "Ṁ": "M", + "Ṃ": "M", + "Ɱ": "M", + "Ɯ": "M", + "Ⓝ": "N", + "N": "N", + "Ǹ": "N", + "Ń": "N", + "Ñ": "N", + "Ṅ": "N", + "Ň": "N", + "Ṇ": "N", + "Ņ": "N", + "Ṋ": "N", + "Ṉ": "N", + "Ƞ": "N", + "Ɲ": "N", + "Ꞑ": "N", + "Ꞥ": "N", + "Ⓞ": "O", + "O": "O", + "Ò": "O", + "Ó": "O", + "Ô": "O", + "Ồ": "O", + "Ố": "O", + "Ỗ": "O", + "Ổ": "O", + "Õ": "O", + "Ṍ": "O", + "Ȭ": "O", + "Ṏ": "O", + "Ō": "O", + "Ṑ": "O", + "Ṓ": "O", + "Ŏ": "O", + "Ȯ": "O", + "Ȱ": "O", + "Ö": "O", + "Ȫ": "O", + "Ỏ": "O", + "Ő": "O", + "Ǒ": "O", + "Ȍ": "O", + "Ȏ": "O", + "Ơ": "O", + "Ờ": "O", + "Ớ": "O", + "Ỡ": "O", + "Ở": "O", + "Ợ": "O", + "Ọ": "O", + "Ộ": "O", + "Ǫ": "O", + "Ǭ": "O", + "Ø": "O", + "Ǿ": "O", + "Ɔ": "O", + "Ɵ": "O", + "Ꝋ": "O", + "Ꝍ": "O", + "Ⓟ": "P", + "P": "P", + "Ṕ": "P", + "Ṗ": "P", + "Ƥ": "P", + "Ᵽ": "P", + "Ꝑ": "P", + "Ꝓ": "P", + "Ꝕ": "P", + "Ⓠ": "Q", + "Q": "Q", + "Ꝗ": "Q", + "Ꝙ": "Q", + "Ɋ": "Q", + "Ⓡ": "R", + "R": "R", + "Ŕ": "R", + "Ṙ": "R", + "Ř": "R", + "Ȑ": "R", + "Ȓ": "R", + "Ṛ": "R", + "Ṝ": "R", + "Ŗ": "R", + "Ṟ": "R", + "Ɍ": "R", + "Ɽ": "R", + "Ꝛ": "R", + "Ꞧ": "R", + "Ꞃ": "R", + "Ⓢ": "S", + "S": "S", + "ẞ": "S", + "Ś": "S", + "Ṥ": "S", + "Ŝ": "S", + "Ṡ": "S", + "Š": "S", + "Ṧ": "S", + "Ṣ": "S", + "Ṩ": "S", + "Ș": "S", + "Ş": "S", + "Ȿ": "S", + "Ꞩ": "S", + "Ꞅ": "S", + "Ⓣ": "T", + "T": "T", + "Ṫ": "T", + "Ť": "T", + "Ṭ": "T", + "Ț": "T", + "Ţ": "T", + "Ṱ": "T", + "Ṯ": "T", + "Ŧ": "T", + "Ƭ": "T", + "Ʈ": "T", + "Ⱦ": "T", + "Ꞇ": "T", + "Ⓤ": "U", + "U": "U", + "Ù": "U", + "Ú": "U", + "Û": "U", + "Ũ": "U", + "Ṹ": "U", + "Ū": "U", + "Ṻ": "U", + "Ŭ": "U", + "Ü": "U", + "Ǜ": "U", + "Ǘ": "U", + "Ǖ": "U", + "Ǚ": "U", + "Ủ": "U", + "Ů": "U", + "Ű": "U", + "Ǔ": "U", + "Ȕ": "U", + "Ȗ": "U", + "Ư": "U", + "Ừ": "U", + "Ứ": "U", + "Ữ": "U", + "Ử": "U", + "Ự": "U", + "Ụ": "U", + "Ṳ": "U", + "Ų": "U", + "Ṷ": "U", + "Ṵ": "U", + "Ʉ": "U", + "Ⓥ": "V", + "V": "V", + "Ṽ": "V", + "Ṿ": "V", + "Ʋ": "V", + "Ꝟ": "V", + "Ʌ": "V", + "Ⓦ": "W", + "W": "W", + "Ẁ": "W", + "Ẃ": "W", + "Ŵ": "W", + "Ẇ": "W", + "Ẅ": "W", + "Ẉ": "W", + "Ⱳ": "W", + "Ⓧ": "X", + "X": "X", + "Ẋ": "X", + "Ẍ": "X", + "Ⓨ": "Y", + "Y": "Y", + "Ỳ": "Y", + "Ý": "Y", + "Ŷ": "Y", + "Ỹ": "Y", + "Ȳ": "Y", + "Ẏ": "Y", + "Ÿ": "Y", + "Ỷ": "Y", + "Ỵ": "Y", + "Ƴ": "Y", + "Ɏ": "Y", + "Ỿ": "Y", + "Ⓩ": "Z", + "Z": "Z", + "Ź": "Z", + "Ẑ": "Z", + "Ż": "Z", + "Ž": "Z", + "Ẓ": "Z", + "Ẕ": "Z", + "Ƶ": "Z", + "Ȥ": "Z", + "Ɀ": "Z", + "Ⱬ": "Z", + "Ꝣ": "Z", + "ⓐ": "a", + "a": "a", + "ẚ": "a", + "à": "a", + "á": "a", + "â": "a", + "ầ": "a", + "ấ": "a", + "ẫ": "a", + "ẩ": "a", + "ã": "a", + "ā": "a", + "ă": "a", + "ằ": "a", + "ắ": "a", + "ẵ": "a", + "ẳ": "a", + "ȧ": "a", + "ǡ": "a", + "ä": "a", + "ǟ": "a", + "ả": "a", + "å": "a", + "ǻ": "a", + "ǎ": "a", + "ȁ": "a", + "ȃ": "a", + "ạ": "a", + "ậ": "a", + "ặ": "a", + "ḁ": "a", + "ą": "a", + "ⱥ": "a", + "ɐ": "a", + "ⓑ": "b", + "b": "b", + "ḃ": "b", + "ḅ": "b", + "ḇ": "b", + "ƀ": "b", + "ƃ": "b", + "ɓ": "b", + "ⓒ": "c", + "c": "c", + "ć": "c", + "ĉ": "c", + "ċ": "c", + "č": "c", + "ç": "c", + "ḉ": "c", + "ƈ": "c", + "ȼ": "c", + "ꜿ": "c", + "ↄ": "c", + "ⓓ": "d", + "d": "d", + "ḋ": "d", + "ď": "d", + "ḍ": "d", + "ḑ": "d", + "ḓ": "d", + "ḏ": "d", + "đ": "d", + "ƌ": "d", + "ɖ": "d", + "ɗ": "d", + "ꝺ": "d", + "ⓔ": "e", + "e": "e", + "è": "e", + "é": "e", + "ê": "e", + "ề": "e", + "ế": "e", + "ễ": "e", + "ể": "e", + "ẽ": "e", + "ē": "e", + "ḕ": "e", + "ḗ": "e", + "ĕ": "e", + "ė": "e", + "ë": "e", + "ẻ": "e", + "ě": "e", + "ȅ": "e", + "ȇ": "e", + "ẹ": "e", + "ệ": "e", + "ȩ": "e", + "ḝ": "e", + "ę": "e", + "ḙ": "e", + "ḛ": "e", + "ɇ": "e", + "ɛ": "e", + "ǝ": "e", + "ⓕ": "f", + "f": "f", + "ḟ": "f", + "ƒ": "f", + "ꝼ": "f", + "ⓖ": "g", + "g": "g", + "ǵ": "g", + "ĝ": "g", + "ḡ": "g", + "ğ": "g", + "ġ": "g", + "ǧ": "g", + "ģ": "g", + "ǥ": "g", + "ɠ": "g", + "ꞡ": "g", + "ᵹ": "g", + "ꝿ": "g", + "ⓗ": "h", + "h": "h", + "ĥ": "h", + "ḣ": "h", + "ḧ": "h", + "ȟ": "h", + "ḥ": "h", + "ḩ": "h", + "ḫ": "h", + "ẖ": "h", + "ħ": "h", + "ⱨ": "h", + "ⱶ": "h", + "ɥ": "h", + "ⓘ": "i", + "i": "i", + "ì": "i", + "í": "i", + "î": "i", + "ĩ": "i", + "ī": "i", + "ĭ": "i", + "ï": "i", + "ḯ": "i", + "ỉ": "i", + "ǐ": "i", + "ȉ": "i", + "ȋ": "i", + "ị": "i", + "į": "i", + "ḭ": "i", + "ɨ": "i", + "ı": "i", + "ⓙ": "j", + "j": "j", + "ĵ": "j", + "ǰ": "j", + "ɉ": "j", + "ⓚ": "k", + "k": "k", + "ḱ": "k", + "ǩ": "k", + "ḳ": "k", + "ķ": "k", + "ḵ": "k", + "ƙ": "k", + "ⱪ": "k", + "ꝁ": "k", + "ꝃ": "k", + "ꝅ": "k", + "ꞣ": "k", + "ⓛ": "l", + "l": "l", + "ŀ": "l", + "ĺ": "l", + "ľ": "l", + "ḷ": "l", + "ḹ": "l", + "ļ": "l", + "ḽ": "l", + "ḻ": "l", + "ſ": "l", + "ł": "l", + "ƚ": "l", + "ɫ": "l", + "ⱡ": "l", + "ꝉ": "l", + "ꞁ": "l", + "ꝇ": "l", + "ⓜ": "m", + "m": "m", + "ḿ": "m", + "ṁ": "m", + "ṃ": "m", + "ɱ": "m", + "ɯ": "m", + "ⓝ": "n", + "n": "n", + "ǹ": "n", + "ń": "n", + "ñ": "n", + "ṅ": "n", + "ň": "n", + "ṇ": "n", + "ņ": "n", + "ṋ": "n", + "ṉ": "n", + "ƞ": "n", + "ɲ": "n", + "ʼn": "n", + "ꞑ": "n", + "ꞥ": "n", + "ⓞ": "o", + "o": "o", + "ò": "o", + "ó": "o", + "ô": "o", + "ồ": "o", + "ố": "o", + "ỗ": "o", + "ổ": "o", + "õ": "o", + "ṍ": "o", + "ȭ": "o", + "ṏ": "o", + "ō": "o", + "ṑ": "o", + "ṓ": "o", + "ŏ": "o", + "ȯ": "o", + "ȱ": "o", + "ö": "o", + "ȫ": "o", + "ỏ": "o", + "ő": "o", + "ǒ": "o", + "ȍ": "o", + "ȏ": "o", + "ơ": "o", + "ờ": "o", + "ớ": "o", + "ỡ": "o", + "ở": "o", + "ợ": "o", + "ọ": "o", + "ộ": "o", + "ǫ": "o", + "ǭ": "o", + "ø": "o", + "ǿ": "o", + "ɔ": "o", + "ꝋ": "o", + "ꝍ": "o", + "ɵ": "o", + "ⓟ": "p", + "p": "p", + "ṕ": "p", + "ṗ": "p", + "ƥ": "p", + "ᵽ": "p", + "ꝑ": "p", + "ꝓ": "p", + "ꝕ": "p", + "ⓠ": "q", + "q": "q", + "ɋ": "q", + "ꝗ": "q", + "ꝙ": "q", + "ⓡ": "r", + "r": "r", + "ŕ": "r", + "ṙ": "r", + "ř": "r", + "ȑ": "r", + "ȓ": "r", + "ṛ": "r", + "ṝ": "r", + "ŗ": "r", + "ṟ": "r", + "ɍ": "r", + "ɽ": "r", + "ꝛ": "r", + "ꞧ": "r", + "ꞃ": "r", + "ⓢ": "s", + "s": "s", + "ß": "s", + "ś": "s", + "ṥ": "s", + "ŝ": "s", + "ṡ": "s", + "š": "s", + "ṧ": "s", + "ṣ": "s", + "ṩ": "s", + "ș": "s", + "ş": "s", + "ȿ": "s", + "ꞩ": "s", + "ꞅ": "s", + "ẛ": "s", + "ⓣ": "t", + "t": "t", + "ṫ": "t", + "ẗ": "t", + "ť": "t", + "ṭ": "t", + "ț": "t", + "ţ": "t", + "ṱ": "t", + "ṯ": "t", + "ŧ": "t", + "ƭ": "t", + "ʈ": "t", + "ⱦ": "t", + "ꞇ": "t", + "ⓤ": "u", + "u": "u", + "ù": "u", + "ú": "u", + "û": "u", + "ũ": "u", + "ṹ": "u", + "ū": "u", + "ṻ": "u", + "ŭ": "u", + "ü": "u", + "ǜ": "u", + "ǘ": "u", + "ǖ": "u", + "ǚ": "u", + "ủ": "u", + "ů": "u", + "ű": "u", + "ǔ": "u", + "ȕ": "u", + "ȗ": "u", + "ư": "u", + "ừ": "u", + "ứ": "u", + "ữ": "u", + "ử": "u", + "ự": "u", + "ụ": "u", + "ṳ": "u", + "ų": "u", + "ṷ": "u", + "ṵ": "u", + "ʉ": "u", + "ⓥ": "v", + "v": "v", + "ṽ": "v", + "ṿ": "v", + "ʋ": "v", + "ꝟ": "v", + "ʌ": "v", + "ⓦ": "w", + "w": "w", + "ẁ": "w", + "ẃ": "w", + "ŵ": "w", + "ẇ": "w", + "ẅ": "w", + "ẘ": "w", + "ẉ": "w", + "ⱳ": "w", + "ⓧ": "x", + "x": "x", + "ẋ": "x", + "ẍ": "x", + "ⓨ": "y", + "y": "y", + "ỳ": "y", + "ý": "y", + "ŷ": "y", + "ỹ": "y", + "ȳ": "y", + "ẏ": "y", + "ÿ": "y", + "ỷ": "y", + "ẙ": "y", + "ỵ": "y", + "ƴ": "y", + "ɏ": "y", + "ỿ": "y", + "ⓩ": "z", + "z": "z", + "ź": "z", + "ẑ": "z", + "ż": "z", + "ž": "z", + "ẓ": "z", + "ẕ": "z", + "ƶ": "z", + "ȥ": "z", + "ɀ": "z", + "ⱬ": "z", + "ꝣ": "z" +}; +exports.StringUtility = StringUtility; + +}); + +unwrapExports(utilities); + +var models = createCommonjsModule(function (module, exports) { +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); + + +class ModelResult { +} +exports.ModelResult = ModelResult; +class ExtendedModelResult extends ModelResult { + constructor(source = null) { + super(); + if (source) { + this.text = source.text; + this.start = source.start; + this.end = source.end; + this.typeName = source.typeName; + this.resolution = source.resolution; + } + } +} +exports.ExtendedModelResult = ExtendedModelResult; +class ModelFactoryKey { + constructor(culture$$1, modelType, options = null) { + this.culture = culture$$1 ? culture$$1.toLowerCase() : null; + this.modelType = modelType; + this.options = options; + } + toString() { + return JSON.stringify(this); + } + static fromString(key) { + return JSON.parse(key); + } +} +class ModelFactory { + constructor() { + this.modelFactories = new Map(); + } + getModel(modelTypeName, culture$$1, fallbackToDefaultCulture, options) { + let result = this.tryGetModel(modelTypeName, culture$$1, options); + if (!result.containsModel && fallbackToDefaultCulture) { + result = this.tryGetModel(modelTypeName, ModelFactory.fallbackCulture, options); + } + if (result.containsModel) { + return result.model; + } + throw new Error(`Could not find Model with the specified configuration: ${culture$$1},${modelTypeName}`); + } + tryGetModel(modelTypeName, culture$$1, options) { + culture$$1 = culture.Culture.mapToNearestLanguage(culture$$1); + let cacheResult = this.getModelFromCache(modelTypeName, culture$$1, options); + if (cacheResult) + return { containsModel: true, model: cacheResult }; + let key = this.generateKey(modelTypeName, culture$$1); + if (this.modelFactories.has(key)) { + let model = this.modelFactories.get(key)(options); + this.registerModelInCache(modelTypeName, culture$$1, options, model); + return { containsModel: true, model: model }; + } + return { containsModel: false }; + } + registerModel(modelTypeName, culture$$1, modelCreator) { + let key = this.generateKey(modelTypeName, culture$$1); + if (this.modelFactories.has(key)) { + throw new Error(`${culture$$1}-${modelTypeName} has already been registered.`); + } + this.modelFactories.set(key, modelCreator); + } + initializeModels(targetCulture, options) { + this.modelFactories.forEach((value, key) => { + let modelFactoryKey = ModelFactoryKey.fromString(key); + if (utilities.StringUtility.isNullOrEmpty(targetCulture) || modelFactoryKey.culture === targetCulture) { + this.tryGetModel(modelFactoryKey.modelType, modelFactoryKey.culture, modelFactoryKey.options); + } + }); + } + generateKey(modelTypeName, culture$$1) { + return new ModelFactoryKey(culture$$1, modelTypeName).toString(); + } + getModelFromCache(modelTypeName, culture$$1, options) { + let key = this.generateCacheKey(modelTypeName, culture$$1, options); + return ModelFactory.cache.get(key); + } + registerModelInCache(modelTypeName, culture$$1, options, model) { + let key = this.generateCacheKey(modelTypeName, culture$$1, options); + ModelFactory.cache.set(key, model); + } + generateCacheKey(modelTypeName, culture$$1, options) { + return new ModelFactoryKey(culture$$1, modelTypeName, options).toString(); + } +} +ModelFactory.fallbackCulture = culture.Culture.English; +ModelFactory.cache = new Map(); +exports.ModelFactory = ModelFactory; + +}); + +unwrapExports(models); + +var recognizer = createCommonjsModule(function (module, exports) { +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); + +class Recognizer { + constructor(targetCulture, options, lazyInitialization) { + this.modelFactory = new models.ModelFactory(); + if (!this.IsValidOptions(options)) + throw new Error(`${options} is not a valid options value.`); + this.TargetCulture = targetCulture; + this.Options = options; + this.InitializeConfiguration(); + if (!lazyInitialization) { + this.initializeModels(targetCulture, options); + } + } + getModel(modelTypeName, culture, fallbackToDefaultCulture) { + return this.modelFactory.getModel(modelTypeName, culture || this.TargetCulture, fallbackToDefaultCulture, this.Options); + } + registerModel(modelTypeName, culture, modelCreator) { + this.modelFactory.registerModel(modelTypeName, culture, modelCreator); + } + initializeModels(targetCulture, options) { + this.modelFactory.initializeModels(targetCulture, options); + } +} +exports.Recognizer = Recognizer; + +}); + +unwrapExports(recognizer); + +var extractors = createCommonjsModule(function (module, exports) { +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +class ExtractResult { + static isOverlap(erA, erB) { + return !(erA.start >= erB.start + erB.length) && !(erB.start >= erA.start + erA.length); + } + static isCover(er1, er2) { + return ((er2.start < er1.start) && ((er2.start + er2.length) >= (er1.start + er1.length))) + || ((er2.start <= er1.start) && ((er2.start + er2.length) > (er1.start + er1.length))); + } + static getFromText(source) { + return { + start: 0, + length: source.length, + text: source, + type: 'custom' + }; + } +} +exports.ExtractResult = ExtractResult; + +}); + +unwrapExports(extractors); + +var parsers = createCommonjsModule(function (module, exports) { +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); + +class ParseResult extends extractors.ExtractResult { + constructor(er) { + super(); + if (er) { + this.length = er.length; + this.start = er.start; + this.data = er.data; + this.text = er.text; + this.type = er.type; + } + this.resolutionStr = ""; + } +} +exports.ParseResult = ParseResult; + +}); + +unwrapExports(parsers); + +var recognizersText = createCommonjsModule(function (module, exports) { +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); + +exports.Culture = culture.Culture; +exports.CultureInfo = culture.CultureInfo; + +exports.ModelResult = models.ModelResult; +exports.ModelFactory = models.ModelFactory; + +exports.Recognizer = recognizer.Recognizer; + +exports.ExtractResult = extractors.ExtractResult; + +exports.ParseResult = parsers.ParseResult; + +exports.FormatUtility = utilities.FormatUtility; +exports.StringUtility = utilities.StringUtility; +exports.Match = utilities.Match; +exports.RegExpUtility = utilities.RegExpUtility; + +}); + +unwrapExports(recognizersText); + +/** + * lodash (Custom Build) + * Build: `lodash modularize exports="npm" -o ./` + * Copyright jQuery Foundation and other contributors + * Released under MIT license + * Based on Underscore.js 1.8.3 + * Copyright Jeremy Ashkenas, DocumentCloud and Investigative Reporters & Editors + */ + +/** Used as references for various `Number` constants. */ +var INFINITY = 1 / 0; + +/** `Object#toString` result references. */ +var symbolTag = '[object Symbol]'; + +/** Used to match leading and trailing whitespace. */ +var reTrimEnd = /\s+$/; + +/** Used to compose unicode character classes. */ +var rsAstralRange = '\\ud800-\\udfff'; +var rsComboMarksRange = '\\u0300-\\u036f\\ufe20-\\ufe23'; +var rsComboSymbolsRange = '\\u20d0-\\u20f0'; +var rsVarRange = '\\ufe0e\\ufe0f'; + +/** Used to compose unicode capture groups. */ +var rsAstral = '[' + rsAstralRange + ']'; +var rsCombo = '[' + rsComboMarksRange + rsComboSymbolsRange + ']'; +var rsFitz = '\\ud83c[\\udffb-\\udfff]'; +var rsModifier = '(?:' + rsCombo + '|' + rsFitz + ')'; +var rsNonAstral = '[^' + rsAstralRange + ']'; +var rsRegional = '(?:\\ud83c[\\udde6-\\uddff]){2}'; +var rsSurrPair = '[\\ud800-\\udbff][\\udc00-\\udfff]'; +var rsZWJ = '\\u200d'; + +/** Used to compose unicode regexes. */ +var reOptMod = rsModifier + '?'; +var rsOptVar = '[' + rsVarRange + ']?'; +var rsOptJoin = '(?:' + rsZWJ + '(?:' + [rsNonAstral, rsRegional, rsSurrPair].join('|') + ')' + rsOptVar + reOptMod + ')*'; +var rsSeq = rsOptVar + reOptMod + rsOptJoin; +var rsSymbol = '(?:' + [rsNonAstral + rsCombo + '?', rsCombo, rsRegional, rsSurrPair, rsAstral].join('|') + ')'; + +/** Used to match [string symbols](https://mathiasbynens.be/notes/javascript-unicode). */ +var reUnicode = RegExp(rsFitz + '(?=' + rsFitz + ')|' + rsSymbol + rsSeq, 'g'); + +/** Used to detect strings with [zero-width joiners or code points from the astral planes](http://eev.ee/blog/2015/09/12/dark-corners-of-unicode/). */ +var reHasUnicode = RegExp('[' + rsZWJ + rsAstralRange + rsComboMarksRange + rsComboSymbolsRange + rsVarRange + ']'); + +/** Detect free variable `global` from Node.js. */ +var freeGlobal = typeof commonjsGlobal == 'object' && commonjsGlobal && commonjsGlobal.Object === Object && commonjsGlobal; + +/** Detect free variable `self`. */ +var freeSelf = typeof self == 'object' && self && self.Object === Object && self; + +/** Used as a reference to the global object. */ +var root = freeGlobal || freeSelf || Function('return this')(); + +/** + * Converts an ASCII `string` to an array. + * + * @private + * @param {string} string The string to convert. + * @returns {Array} Returns the converted array. + */ +function asciiToArray(string) { + return string.split(''); +} + +/** + * The base implementation of `_.findIndex` and `_.findLastIndex` without + * support for iteratee shorthands. + * + * @private + * @param {Array} array The array to inspect. + * @param {Function} predicate The function invoked per iteration. + * @param {number} fromIndex The index to search from. + * @param {boolean} [fromRight] Specify iterating from right to left. + * @returns {number} Returns the index of the matched value, else `-1`. + */ +function baseFindIndex(array, predicate, fromIndex, fromRight) { + var length = array.length, + index = fromIndex + (fromRight ? 1 : -1); + + while ((fromRight ? index-- : ++index < length)) { + if (predicate(array[index], index, array)) { + return index; + } + } + return -1; +} + +/** + * The base implementation of `_.indexOf` without `fromIndex` bounds checks. + * + * @private + * @param {Array} array The array to inspect. + * @param {*} value The value to search for. + * @param {number} fromIndex The index to search from. + * @returns {number} Returns the index of the matched value, else `-1`. + */ +function baseIndexOf(array, value, fromIndex) { + if (value !== value) { + return baseFindIndex(array, baseIsNaN, fromIndex); + } + var index = fromIndex - 1, + length = array.length; + + while (++index < length) { + if (array[index] === value) { + return index; + } + } + return -1; +} + +/** + * The base implementation of `_.isNaN` without support for number objects. + * + * @private + * @param {*} value The value to check. + * @returns {boolean} Returns `true` if `value` is `NaN`, else `false`. + */ +function baseIsNaN(value) { + return value !== value; +} + +/** + * Used by `_.trim` and `_.trimEnd` to get the index of the last string symbol + * that is not found in the character symbols. + * + * @private + * @param {Array} strSymbols The string symbols to inspect. + * @param {Array} chrSymbols The character symbols to find. + * @returns {number} Returns the index of the last unmatched string symbol. + */ +function charsEndIndex(strSymbols, chrSymbols) { + var index = strSymbols.length; + + while (index-- && baseIndexOf(chrSymbols, strSymbols[index], 0) > -1) {} + return index; +} + +/** + * Checks if `string` contains Unicode symbols. + * + * @private + * @param {string} string The string to inspect. + * @returns {boolean} Returns `true` if a symbol is found, else `false`. + */ +function hasUnicode(string) { + return reHasUnicode.test(string); +} + +/** + * Converts `string` to an array. + * + * @private + * @param {string} string The string to convert. + * @returns {Array} Returns the converted array. + */ +function stringToArray(string) { + return hasUnicode(string) + ? unicodeToArray(string) + : asciiToArray(string); +} + +/** + * Converts a Unicode `string` to an array. + * + * @private + * @param {string} string The string to convert. + * @returns {Array} Returns the converted array. + */ +function unicodeToArray(string) { + return string.match(reUnicode) || []; +} + +/** Used for built-in method references. */ +var objectProto = Object.prototype; + +/** + * Used to resolve the + * [`toStringTag`](http://ecma-international.org/ecma-262/7.0/#sec-object.prototype.tostring) + * of values. + */ +var objectToString = objectProto.toString; + +/** Built-in value references. */ +var Symbol$1 = root.Symbol; + +/** Used to convert symbols to primitives and strings. */ +var symbolProto = Symbol$1 ? Symbol$1.prototype : undefined; +var symbolToString = symbolProto ? symbolProto.toString : undefined; + +/** + * The base implementation of `_.slice` without an iteratee call guard. + * + * @private + * @param {Array} array The array to slice. + * @param {number} [start=0] The start position. + * @param {number} [end=array.length] The end position. + * @returns {Array} Returns the slice of `array`. + */ +function baseSlice(array, start, end) { + var index = -1, + length = array.length; + + if (start < 0) { + start = -start > length ? 0 : (length + start); + } + end = end > length ? length : end; + if (end < 0) { + end += length; + } + length = start > end ? 0 : ((end - start) >>> 0); + start >>>= 0; + + var result = Array(length); + while (++index < length) { + result[index] = array[index + start]; + } + return result; +} + +/** + * The base implementation of `_.toString` which doesn't convert nullish + * values to empty strings. + * + * @private + * @param {*} value The value to process. + * @returns {string} Returns the string. + */ +function baseToString(value) { + // Exit early for strings to avoid a performance hit in some environments. + if (typeof value == 'string') { + return value; + } + if (isSymbol(value)) { + return symbolToString ? symbolToString.call(value) : ''; + } + var result = (value + ''); + return (result == '0' && (1 / value) == -INFINITY) ? '-0' : result; +} + +/** + * Casts `array` to a slice if it's needed. + * + * @private + * @param {Array} array The array to inspect. + * @param {number} start The start position. + * @param {number} [end=array.length] The end position. + * @returns {Array} Returns the cast slice. + */ +function castSlice(array, start, end) { + var length = array.length; + end = end === undefined ? length : end; + return (!start && end >= length) ? array : baseSlice(array, start, end); +} + +/** + * Checks if `value` is object-like. A value is object-like if it's not `null` + * and has a `typeof` result of "object". + * + * @static + * @memberOf _ + * @since 4.0.0 + * @category Lang + * @param {*} value The value to check. + * @returns {boolean} Returns `true` if `value` is object-like, else `false`. + * @example + * + * _.isObjectLike({}); + * // => true + * + * _.isObjectLike([1, 2, 3]); + * // => true + * + * _.isObjectLike(_.noop); + * // => false + * + * _.isObjectLike(null); + * // => false + */ +function isObjectLike(value) { + return !!value && typeof value == 'object'; +} + +/** + * Checks if `value` is classified as a `Symbol` primitive or object. + * + * @static + * @memberOf _ + * @since 4.0.0 + * @category Lang + * @param {*} value The value to check. + * @returns {boolean} Returns `true` if `value` is a symbol, else `false`. + * @example + * + * _.isSymbol(Symbol.iterator); + * // => true + * + * _.isSymbol('abc'); + * // => false + */ +function isSymbol(value) { + return typeof value == 'symbol' || + (isObjectLike(value) && objectToString.call(value) == symbolTag); +} + +/** + * Converts `value` to a string. An empty string is returned for `null` + * and `undefined` values. The sign of `-0` is preserved. + * + * @static + * @memberOf _ + * @since 4.0.0 + * @category Lang + * @param {*} value The value to process. + * @returns {string} Returns the string. + * @example + * + * _.toString(null); + * // => '' + * + * _.toString(-0); + * // => '-0' + * + * _.toString([1, 2, 3]); + * // => '1,2,3' + */ +function toString(value) { + return value == null ? '' : baseToString(value); +} + +/** + * Removes trailing whitespace or specified characters from `string`. + * + * @static + * @memberOf _ + * @since 4.0.0 + * @category String + * @param {string} [string=''] The string to trim. + * @param {string} [chars=whitespace] The characters to trim. + * @param- {Object} [guard] Enables use as an iteratee for methods like `_.map`. + * @returns {string} Returns the trimmed string. + * @example + * + * _.trimEnd(' abc '); + * // => ' abc' + * + * _.trimEnd('-_-abc-_-', '_-'); + * // => '-_-abc' + */ +function trimEnd(string, chars, guard) { + string = toString(string); + if (string && (guard || chars === undefined)) { + return string.replace(reTrimEnd, ''); + } + if (!string || !(chars = baseToString(chars))) { + return string; + } + var strSymbols = stringToArray(string), + end = charsEndIndex(strSymbols, stringToArray(chars)) + 1; + + return castSlice(strSymbols, 0, end).join(''); +} + +var lodash_trimend = trimEnd; + +var bignumber = createCommonjsModule(function (module) { +(function (globalObject) { + 'use strict'; + +/* + * bignumber.js v7.2.1 + * A JavaScript library for arbitrary-precision arithmetic. + * https://github.com/MikeMcl/bignumber.js + * Copyright (c) 2018 Michael Mclaughlin + * MIT Licensed. + * + * BigNumber.prototype methods | BigNumber methods + * | + * absoluteValue abs | clone + * comparedTo | config set + * decimalPlaces dp | DECIMAL_PLACES + * dividedBy div | ROUNDING_MODE + * dividedToIntegerBy idiv | EXPONENTIAL_AT + * exponentiatedBy pow | RANGE + * integerValue | CRYPTO + * isEqualTo eq | MODULO_MODE + * isFinite | POW_PRECISION + * isGreaterThan gt | FORMAT + * isGreaterThanOrEqualTo gte | ALPHABET + * isInteger | isBigNumber + * isLessThan lt | maximum max + * isLessThanOrEqualTo lte | minimum min + * isNaN | random + * isNegative | + * isPositive | + * isZero | + * minus | + * modulo mod | + * multipliedBy times | + * negated | + * plus | + * precision sd | + * shiftedBy | + * squareRoot sqrt | + * toExponential | + * toFixed | + * toFormat | + * toFraction | + * toJSON | + * toNumber | + * toPrecision | + * toString | + * valueOf | + * + */ + + + var BigNumber, + isNumeric = /^-?(?:\d+(?:\.\d*)?|\.\d+)(?:e[+-]?\d+)?$/i, + + mathceil = Math.ceil, + mathfloor = Math.floor, + + bignumberError = '[BigNumber Error] ', + tooManyDigits = bignumberError + 'Number primitive has more than 15 significant digits: ', + + BASE = 1e14, + LOG_BASE = 14, + MAX_SAFE_INTEGER = 0x1fffffffffffff, // 2^53 - 1 + // MAX_INT32 = 0x7fffffff, // 2^31 - 1 + POWS_TEN = [1, 10, 100, 1e3, 1e4, 1e5, 1e6, 1e7, 1e8, 1e9, 1e10, 1e11, 1e12, 1e13], + SQRT_BASE = 1e7, + + // EDITABLE + // The limit on the value of DECIMAL_PLACES, TO_EXP_NEG, TO_EXP_POS, MIN_EXP, MAX_EXP, and + // the arguments to toExponential, toFixed, toFormat, and toPrecision. + MAX = 1E9; // 0 to MAX_INT32 + + + /* + * Create and return a BigNumber constructor. + */ + function clone(configObject) { + var div, convertBase, parseNumeric, + P = BigNumber.prototype = { constructor: BigNumber, toString: null, valueOf: null }, + ONE = new BigNumber(1), + + + //----------------------------- EDITABLE CONFIG DEFAULTS ------------------------------- + + + // The default values below must be integers within the inclusive ranges stated. + // The values can also be changed at run-time using BigNumber.set. + + // The maximum number of decimal places for operations involving division. + DECIMAL_PLACES = 20, // 0 to MAX + + // The rounding mode used when rounding to the above decimal places, and when using + // toExponential, toFixed, toFormat and toPrecision, and round (default value). + // UP 0 Away from zero. + // DOWN 1 Towards zero. + // CEIL 2 Towards +Infinity. + // FLOOR 3 Towards -Infinity. + // HALF_UP 4 Towards nearest neighbour. If equidistant, up. + // HALF_DOWN 5 Towards nearest neighbour. If equidistant, down. + // HALF_EVEN 6 Towards nearest neighbour. If equidistant, towards even neighbour. + // HALF_CEIL 7 Towards nearest neighbour. If equidistant, towards +Infinity. + // HALF_FLOOR 8 Towards nearest neighbour. If equidistant, towards -Infinity. + ROUNDING_MODE = 4, // 0 to 8 + + // EXPONENTIAL_AT : [TO_EXP_NEG , TO_EXP_POS] + + // The exponent value at and beneath which toString returns exponential notation. + // Number type: -7 + TO_EXP_NEG = -7, // 0 to -MAX + + // The exponent value at and above which toString returns exponential notation. + // Number type: 21 + TO_EXP_POS = 21, // 0 to MAX + + // RANGE : [MIN_EXP, MAX_EXP] + + // The minimum exponent value, beneath which underflow to zero occurs. + // Number type: -324 (5e-324) + MIN_EXP = -1e7, // -1 to -MAX + + // The maximum exponent value, above which overflow to Infinity occurs. + // Number type: 308 (1.7976931348623157e+308) + // For MAX_EXP > 1e7, e.g. new BigNumber('1e100000000').plus(1) may be slow. + MAX_EXP = 1e7, // 1 to MAX + + // Whether to use cryptographically-secure random number generation, if available. + CRYPTO = false, // true or false + + // The modulo mode used when calculating the modulus: a mod n. + // The quotient (q = a / n) is calculated according to the corresponding rounding mode. + // The remainder (r) is calculated as: r = a - n * q. + // + // UP 0 The remainder is positive if the dividend is negative, else is negative. + // DOWN 1 The remainder has the same sign as the dividend. + // This modulo mode is commonly known as 'truncated division' and is + // equivalent to (a % n) in JavaScript. + // FLOOR 3 The remainder has the same sign as the divisor (Python %). + // HALF_EVEN 6 This modulo mode implements the IEEE 754 remainder function. + // EUCLID 9 Euclidian division. q = sign(n) * floor(a / abs(n)). + // The remainder is always positive. + // + // The truncated division, floored division, Euclidian division and IEEE 754 remainder + // modes are commonly used for the modulus operation. + // Although the other rounding modes can also be used, they may not give useful results. + MODULO_MODE = 1, // 0 to 9 + + // The maximum number of significant digits of the result of the exponentiatedBy operation. + // If POW_PRECISION is 0, there will be unlimited significant digits. + POW_PRECISION = 0, // 0 to MAX + + // The format specification used by the BigNumber.prototype.toFormat method. + FORMAT = { + decimalSeparator: '.', + groupSeparator: ',', + groupSize: 3, + secondaryGroupSize: 0, + fractionGroupSeparator: '\xA0', // non-breaking space + fractionGroupSize: 0 + }, + + // The alphabet used for base conversion. + // It must be at least 2 characters long, with no '.' or repeated character. + // '0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ$_' + ALPHABET = '0123456789abcdefghijklmnopqrstuvwxyz'; + + + //------------------------------------------------------------------------------------------ + + + // CONSTRUCTOR + + + /* + * The BigNumber constructor and exported function. + * Create and return a new instance of a BigNumber object. + * + * n {number|string|BigNumber} A numeric value. + * [b] {number} The base of n. Integer, 2 to ALPHABET.length inclusive. + */ + function BigNumber(n, b) { + var alphabet, c, caseChanged, e, i, isNum, len, str, + x = this; + + // Enable constructor usage without new. + if (!(x instanceof BigNumber)) { + + // Don't throw on constructor call without new (#81). + // '[BigNumber Error] Constructor call without new: {n}' + //throw Error(bignumberError + ' Constructor call without new: ' + n); + return new BigNumber(n, b); + } + + if (b == null) { + + // Duplicate. + if (n instanceof BigNumber) { + x.s = n.s; + x.e = n.e; + x.c = (n = n.c) ? n.slice() : n; + return; + } + + isNum = typeof n == 'number'; + + if (isNum && n * 0 == 0) { + + // Use `1 / n` to handle minus zero also. + x.s = 1 / n < 0 ? (n = -n, -1) : 1; + + // Faster path for integers. + if (n === ~~n) { + for (e = 0, i = n; i >= 10; i /= 10, e++); + x.e = e; + x.c = [n]; + return; + } + + str = n + ''; + } else { + if (!isNumeric.test(str = n + '')) return parseNumeric(x, str, isNum); + x.s = str.charCodeAt(0) == 45 ? (str = str.slice(1), -1) : 1; + } + + // Decimal point? + if ((e = str.indexOf('.')) > -1) str = str.replace('.', ''); + + // Exponential form? + if ((i = str.search(/e/i)) > 0) { + + // Determine exponent. + if (e < 0) e = i; + e += +str.slice(i + 1); + str = str.substring(0, i); + } else if (e < 0) { + + // Integer. + e = str.length; + } + + } else { + + // '[BigNumber Error] Base {not a primitive number|not an integer|out of range}: {b}' + intCheck(b, 2, ALPHABET.length, 'Base'); + str = n + ''; + + // Allow exponential notation to be used with base 10 argument, while + // also rounding to DECIMAL_PLACES as with other bases. + if (b == 10) { + x = new BigNumber(n instanceof BigNumber ? n : str); + return round(x, DECIMAL_PLACES + x.e + 1, ROUNDING_MODE); + } + + isNum = typeof n == 'number'; + + if (isNum) { + + // Avoid potential interpretation of Infinity and NaN as base 44+ values. + if (n * 0 != 0) return parseNumeric(x, str, isNum, b); + + x.s = 1 / n < 0 ? (str = str.slice(1), -1) : 1; + + // '[BigNumber Error] Number primitive has more than 15 significant digits: {n}' + if (BigNumber.DEBUG && str.replace(/^0\.0*|\./, '').length > 15) { + throw Error + (tooManyDigits + n); + } + + // Prevent later check for length on converted number. + isNum = false; + } else { + x.s = str.charCodeAt(0) === 45 ? (str = str.slice(1), -1) : 1; + } + + alphabet = ALPHABET.slice(0, b); + e = i = 0; + + // Check that str is a valid base b number. + // Don't use RegExp so alphabet can contain special characters. + for (len = str.length; i < len; i++) { + if (alphabet.indexOf(c = str.charAt(i)) < 0) { + if (c == '.') { + + // If '.' is not the first character and it has not be found before. + if (i > e) { + e = len; + continue; + } + } else if (!caseChanged) { + + // Allow e.g. hexadecimal 'FF' as well as 'ff'. + if (str == str.toUpperCase() && (str = str.toLowerCase()) || + str == str.toLowerCase() && (str = str.toUpperCase())) { + caseChanged = true; + i = -1; + e = 0; + continue; + } + } + + return parseNumeric(x, n + '', isNum, b); + } + } + + str = convertBase(str, b, 10, x.s); + + // Decimal point? + if ((e = str.indexOf('.')) > -1) str = str.replace('.', ''); + else e = str.length; + } + + // Determine leading zeros. + for (i = 0; str.charCodeAt(i) === 48; i++); + + // Determine trailing zeros. + for (len = str.length; str.charCodeAt(--len) === 48;); + + str = str.slice(i, ++len); + + if (str) { + len -= i; + + // '[BigNumber Error] Number primitive has more than 15 significant digits: {n}' + if (isNum && BigNumber.DEBUG && + len > 15 && (n > MAX_SAFE_INTEGER || n !== mathfloor(n))) { + throw Error + (tooManyDigits + (x.s * n)); + } + + e = e - i - 1; + + // Overflow? + if (e > MAX_EXP) { + + // Infinity. + x.c = x.e = null; + + // Underflow? + } else if (e < MIN_EXP) { + + // Zero. + x.c = [x.e = 0]; + } else { + x.e = e; + x.c = []; + + // Transform base + + // e is the base 10 exponent. + // i is where to slice str to get the first element of the coefficient array. + i = (e + 1) % LOG_BASE; + if (e < 0) i += LOG_BASE; + + if (i < len) { + if (i) x.c.push(+str.slice(0, i)); + + for (len -= LOG_BASE; i < len;) { + x.c.push(+str.slice(i, i += LOG_BASE)); + } + + str = str.slice(i); + i = LOG_BASE - str.length; + } else { + i -= len; + } + + for (; i--; str += '0'); + x.c.push(+str); + } + } else { + + // Zero. + x.c = [x.e = 0]; + } + } + + + // CONSTRUCTOR PROPERTIES + + + BigNumber.clone = clone; + + BigNumber.ROUND_UP = 0; + BigNumber.ROUND_DOWN = 1; + BigNumber.ROUND_CEIL = 2; + BigNumber.ROUND_FLOOR = 3; + BigNumber.ROUND_HALF_UP = 4; + BigNumber.ROUND_HALF_DOWN = 5; + BigNumber.ROUND_HALF_EVEN = 6; + BigNumber.ROUND_HALF_CEIL = 7; + BigNumber.ROUND_HALF_FLOOR = 8; + BigNumber.EUCLID = 9; + + + /* + * Configure infrequently-changing library-wide settings. + * + * Accept an object with the following optional properties (if the value of a property is + * a number, it must be an integer within the inclusive range stated): + * + * DECIMAL_PLACES {number} 0 to MAX + * ROUNDING_MODE {number} 0 to 8 + * EXPONENTIAL_AT {number|number[]} -MAX to MAX or [-MAX to 0, 0 to MAX] + * RANGE {number|number[]} -MAX to MAX (not zero) or [-MAX to -1, 1 to MAX] + * CRYPTO {boolean} true or false + * MODULO_MODE {number} 0 to 9 + * POW_PRECISION {number} 0 to MAX + * ALPHABET {string} A string of two or more unique characters which does + * not contain '.'. + * FORMAT {object} An object with some of the following properties: + * decimalSeparator {string} + * groupSeparator {string} + * groupSize {number} + * secondaryGroupSize {number} + * fractionGroupSeparator {string} + * fractionGroupSize {number} + * + * (The values assigned to the above FORMAT object properties are not checked for validity.) + * + * E.g. + * BigNumber.config({ DECIMAL_PLACES : 20, ROUNDING_MODE : 4 }) + * + * Ignore properties/parameters set to null or undefined, except for ALPHABET. + * + * Return an object with the properties current values. + */ + BigNumber.config = BigNumber.set = function (obj) { + var p, v; + + if (obj != null) { + + if (typeof obj == 'object') { + + // DECIMAL_PLACES {number} Integer, 0 to MAX inclusive. + // '[BigNumber Error] DECIMAL_PLACES {not a primitive number|not an integer|out of range}: {v}' + if (obj.hasOwnProperty(p = 'DECIMAL_PLACES')) { + v = obj[p]; + intCheck(v, 0, MAX, p); + DECIMAL_PLACES = v; + } + + // ROUNDING_MODE {number} Integer, 0 to 8 inclusive. + // '[BigNumber Error] ROUNDING_MODE {not a primitive number|not an integer|out of range}: {v}' + if (obj.hasOwnProperty(p = 'ROUNDING_MODE')) { + v = obj[p]; + intCheck(v, 0, 8, p); + ROUNDING_MODE = v; + } + + // EXPONENTIAL_AT {number|number[]} + // Integer, -MAX to MAX inclusive or + // [integer -MAX to 0 inclusive, 0 to MAX inclusive]. + // '[BigNumber Error] EXPONENTIAL_AT {not a primitive number|not an integer|out of range}: {v}' + if (obj.hasOwnProperty(p = 'EXPONENTIAL_AT')) { + v = obj[p]; + if (isArray(v)) { + intCheck(v[0], -MAX, 0, p); + intCheck(v[1], 0, MAX, p); + TO_EXP_NEG = v[0]; + TO_EXP_POS = v[1]; + } else { + intCheck(v, -MAX, MAX, p); + TO_EXP_NEG = -(TO_EXP_POS = v < 0 ? -v : v); + } + } + + // RANGE {number|number[]} Non-zero integer, -MAX to MAX inclusive or + // [integer -MAX to -1 inclusive, integer 1 to MAX inclusive]. + // '[BigNumber Error] RANGE {not a primitive number|not an integer|out of range|cannot be zero}: {v}' + if (obj.hasOwnProperty(p = 'RANGE')) { + v = obj[p]; + if (isArray(v)) { + intCheck(v[0], -MAX, -1, p); + intCheck(v[1], 1, MAX, p); + MIN_EXP = v[0]; + MAX_EXP = v[1]; + } else { + intCheck(v, -MAX, MAX, p); + if (v) { + MIN_EXP = -(MAX_EXP = v < 0 ? -v : v); + } else { + throw Error + (bignumberError + p + ' cannot be zero: ' + v); + } + } + } + + // CRYPTO {boolean} true or false. + // '[BigNumber Error] CRYPTO not true or false: {v}' + // '[BigNumber Error] crypto unavailable' + if (obj.hasOwnProperty(p = 'CRYPTO')) { + v = obj[p]; + if (v === !!v) { + if (v) { + if (typeof crypto != 'undefined' && crypto && + (crypto.getRandomValues || crypto.randomBytes)) { + CRYPTO = v; + } else { + CRYPTO = !v; + throw Error + (bignumberError + 'crypto unavailable'); + } + } else { + CRYPTO = v; + } + } else { + throw Error + (bignumberError + p + ' not true or false: ' + v); + } + } + + // MODULO_MODE {number} Integer, 0 to 9 inclusive. + // '[BigNumber Error] MODULO_MODE {not a primitive number|not an integer|out of range}: {v}' + if (obj.hasOwnProperty(p = 'MODULO_MODE')) { + v = obj[p]; + intCheck(v, 0, 9, p); + MODULO_MODE = v; + } + + // POW_PRECISION {number} Integer, 0 to MAX inclusive. + // '[BigNumber Error] POW_PRECISION {not a primitive number|not an integer|out of range}: {v}' + if (obj.hasOwnProperty(p = 'POW_PRECISION')) { + v = obj[p]; + intCheck(v, 0, MAX, p); + POW_PRECISION = v; + } + + // FORMAT {object} + // '[BigNumber Error] FORMAT not an object: {v}' + if (obj.hasOwnProperty(p = 'FORMAT')) { + v = obj[p]; + if (typeof v == 'object') FORMAT = v; + else throw Error + (bignumberError + p + ' not an object: ' + v); + } + + // ALPHABET {string} + // '[BigNumber Error] ALPHABET invalid: {v}' + if (obj.hasOwnProperty(p = 'ALPHABET')) { + v = obj[p]; + + // Disallow if only one character, or contains '.' or a repeated character. + if (typeof v == 'string' && !/^.$|\.|(.).*\1/.test(v)) { + ALPHABET = v; + } else { + throw Error + (bignumberError + p + ' invalid: ' + v); + } + } + + } else { + + // '[BigNumber Error] Object expected: {v}' + throw Error + (bignumberError + 'Object expected: ' + obj); + } + } + + return { + DECIMAL_PLACES: DECIMAL_PLACES, + ROUNDING_MODE: ROUNDING_MODE, + EXPONENTIAL_AT: [TO_EXP_NEG, TO_EXP_POS], + RANGE: [MIN_EXP, MAX_EXP], + CRYPTO: CRYPTO, + MODULO_MODE: MODULO_MODE, + POW_PRECISION: POW_PRECISION, + FORMAT: FORMAT, + ALPHABET: ALPHABET + }; + }; + + + /* + * Return true if v is a BigNumber instance, otherwise return false. + * + * v {any} + */ + BigNumber.isBigNumber = function (v) { + return v instanceof BigNumber || v && v._isBigNumber === true || false; + }; + + + /* + * Return a new BigNumber whose value is the maximum of the arguments. + * + * arguments {number|string|BigNumber} + */ + BigNumber.maximum = BigNumber.max = function () { + return maxOrMin(arguments, P.lt); + }; + + + /* + * Return a new BigNumber whose value is the minimum of the arguments. + * + * arguments {number|string|BigNumber} + */ + BigNumber.minimum = BigNumber.min = function () { + return maxOrMin(arguments, P.gt); + }; + + + /* + * Return a new BigNumber with a random value equal to or greater than 0 and less than 1, + * and with dp, or DECIMAL_PLACES if dp is omitted, decimal places (or less if trailing + * zeros are produced). + * + * [dp] {number} Decimal places. Integer, 0 to MAX inclusive. + * + * '[BigNumber Error] Argument {not a primitive number|not an integer|out of range}: {dp}' + * '[BigNumber Error] crypto unavailable' + */ + BigNumber.random = (function () { + var pow2_53 = 0x20000000000000; + + // Return a 53 bit integer n, where 0 <= n < 9007199254740992. + // Check if Math.random() produces more than 32 bits of randomness. + // If it does, assume at least 53 bits are produced, otherwise assume at least 30 bits. + // 0x40000000 is 2^30, 0x800000 is 2^23, 0x1fffff is 2^21 - 1. + var random53bitInt = (Math.random() * pow2_53) & 0x1fffff + ? function () { return mathfloor(Math.random() * pow2_53); } + : function () { return ((Math.random() * 0x40000000 | 0) * 0x800000) + + (Math.random() * 0x800000 | 0); }; + + return function (dp) { + var a, b, e, k, v, + i = 0, + c = [], + rand = new BigNumber(ONE); + + if (dp == null) dp = DECIMAL_PLACES; + else intCheck(dp, 0, MAX); + + k = mathceil(dp / LOG_BASE); + + if (CRYPTO) { + + // Browsers supporting crypto.getRandomValues. + if (crypto.getRandomValues) { + + a = crypto.getRandomValues(new Uint32Array(k *= 2)); + + for (; i < k;) { + + // 53 bits: + // ((Math.pow(2, 32) - 1) * Math.pow(2, 21)).toString(2) + // 11111 11111111 11111111 11111111 11100000 00000000 00000000 + // ((Math.pow(2, 32) - 1) >>> 11).toString(2) + // 11111 11111111 11111111 + // 0x20000 is 2^21. + v = a[i] * 0x20000 + (a[i + 1] >>> 11); + + // Rejection sampling: + // 0 <= v < 9007199254740992 + // Probability that v >= 9e15, is + // 7199254740992 / 9007199254740992 ~= 0.0008, i.e. 1 in 1251 + if (v >= 9e15) { + b = crypto.getRandomValues(new Uint32Array(2)); + a[i] = b[0]; + a[i + 1] = b[1]; + } else { + + // 0 <= v <= 8999999999999999 + // 0 <= (v % 1e14) <= 99999999999999 + c.push(v % 1e14); + i += 2; + } + } + i = k / 2; + + // Node.js supporting crypto.randomBytes. + } else if (crypto.randomBytes) { + + // buffer + a = crypto.randomBytes(k *= 7); + + for (; i < k;) { + + // 0x1000000000000 is 2^48, 0x10000000000 is 2^40 + // 0x100000000 is 2^32, 0x1000000 is 2^24 + // 11111 11111111 11111111 11111111 11111111 11111111 11111111 + // 0 <= v < 9007199254740992 + v = ((a[i] & 31) * 0x1000000000000) + (a[i + 1] * 0x10000000000) + + (a[i + 2] * 0x100000000) + (a[i + 3] * 0x1000000) + + (a[i + 4] << 16) + (a[i + 5] << 8) + a[i + 6]; + + if (v >= 9e15) { + crypto.randomBytes(7).copy(a, i); + } else { + + // 0 <= (v % 1e14) <= 99999999999999 + c.push(v % 1e14); + i += 7; + } + } + i = k / 7; + } else { + CRYPTO = false; + throw Error + (bignumberError + 'crypto unavailable'); + } + } + + // Use Math.random. + if (!CRYPTO) { + + for (; i < k;) { + v = random53bitInt(); + if (v < 9e15) c[i++] = v % 1e14; + } + } + + k = c[--i]; + dp %= LOG_BASE; + + // Convert trailing digits to zeros according to dp. + if (k && dp) { + v = POWS_TEN[LOG_BASE - dp]; + c[i] = mathfloor(k / v) * v; + } + + // Remove trailing elements which are zero. + for (; c[i] === 0; c.pop(), i--); + + // Zero? + if (i < 0) { + c = [e = 0]; + } else { + + // Remove leading elements which are zero and adjust exponent accordingly. + for (e = -1 ; c[0] === 0; c.splice(0, 1), e -= LOG_BASE); + + // Count the digits of the first element of c to determine leading zeros, and... + for (i = 1, v = c[0]; v >= 10; v /= 10, i++); + + // adjust the exponent accordingly. + if (i < LOG_BASE) e -= LOG_BASE - i; + } + + rand.e = e; + rand.c = c; + return rand; + }; + })(); + + + // PRIVATE FUNCTIONS + + + // Called by BigNumber and BigNumber.prototype.toString. + convertBase = (function () { + var decimal = '0123456789'; + + /* + * Convert string of baseIn to an array of numbers of baseOut. + * Eg. toBaseOut('255', 10, 16) returns [15, 15]. + * Eg. toBaseOut('ff', 16, 10) returns [2, 5, 5]. + */ + function toBaseOut(str, baseIn, baseOut, alphabet) { + var j, + arr = [0], + arrL, + i = 0, + len = str.length; + + for (; i < len;) { + for (arrL = arr.length; arrL--; arr[arrL] *= baseIn); + + arr[0] += alphabet.indexOf(str.charAt(i++)); + + for (j = 0; j < arr.length; j++) { + + if (arr[j] > baseOut - 1) { + if (arr[j + 1] == null) arr[j + 1] = 0; + arr[j + 1] += arr[j] / baseOut | 0; + arr[j] %= baseOut; + } + } + } + + return arr.reverse(); + } + + // Convert a numeric string of baseIn to a numeric string of baseOut. + // If the caller is toString, we are converting from base 10 to baseOut. + // If the caller is BigNumber, we are converting from baseIn to base 10. + return function (str, baseIn, baseOut, sign, callerIsToString) { + var alphabet, d, e, k, r, x, xc, y, + i = str.indexOf('.'), + dp = DECIMAL_PLACES, + rm = ROUNDING_MODE; + + // Non-integer. + if (i >= 0) { + k = POW_PRECISION; + + // Unlimited precision. + POW_PRECISION = 0; + str = str.replace('.', ''); + y = new BigNumber(baseIn); + x = y.pow(str.length - i); + POW_PRECISION = k; + + // Convert str as if an integer, then restore the fraction part by dividing the + // result by its base raised to a power. + + y.c = toBaseOut(toFixedPoint(coeffToString(x.c), x.e, '0'), + 10, baseOut, decimal); + y.e = y.c.length; + } + + // Convert the number as integer. + + xc = toBaseOut(str, baseIn, baseOut, callerIsToString + ? (alphabet = ALPHABET, decimal) + : (alphabet = decimal, ALPHABET)); + + // xc now represents str as an integer and converted to baseOut. e is the exponent. + e = k = xc.length; + + // Remove trailing zeros. + for (; xc[--k] == 0; xc.pop()); + + // Zero? + if (!xc[0]) return alphabet.charAt(0); + + // Does str represent an integer? If so, no need for the division. + if (i < 0) { + --e; + } else { + x.c = xc; + x.e = e; + + // The sign is needed for correct rounding. + x.s = sign; + x = div(x, y, dp, rm, baseOut); + xc = x.c; + r = x.r; + e = x.e; + } + + // xc now represents str converted to baseOut. + + // THe index of the rounding digit. + d = e + dp + 1; + + // The rounding digit: the digit to the right of the digit that may be rounded up. + i = xc[d]; + + // Look at the rounding digits and mode to determine whether to round up. + + k = baseOut / 2; + r = r || d < 0 || xc[d + 1] != null; + + r = rm < 4 ? (i != null || r) && (rm == 0 || rm == (x.s < 0 ? 3 : 2)) + : i > k || i == k &&(rm == 4 || r || rm == 6 && xc[d - 1] & 1 || + rm == (x.s < 0 ? 8 : 7)); + + // If the index of the rounding digit is not greater than zero, or xc represents + // zero, then the result of the base conversion is zero or, if rounding up, a value + // such as 0.00001. + if (d < 1 || !xc[0]) { + + // 1^-dp or 0 + str = r ? toFixedPoint(alphabet.charAt(1), -dp, alphabet.charAt(0)) + : alphabet.charAt(0); + } else { + + // Truncate xc to the required number of decimal places. + xc.length = d; + + // Round up? + if (r) { + + // Rounding up may mean the previous digit has to be rounded up and so on. + for (--baseOut; ++xc[--d] > baseOut;) { + xc[d] = 0; + + if (!d) { + ++e; + xc = [1].concat(xc); + } + } + } + + // Determine trailing zeros. + for (k = xc.length; !xc[--k];); + + // E.g. [4, 11, 15] becomes 4bf. + for (i = 0, str = ''; i <= k; str += alphabet.charAt(xc[i++])); + + // Add leading zeros, decimal point and trailing zeros as required. + str = toFixedPoint(str, e, alphabet.charAt(0)); + } + + // The caller will add the sign. + return str; + }; + })(); + + + // Perform division in the specified base. Called by div and convertBase. + div = (function () { + + // Assume non-zero x and k. + function multiply(x, k, base) { + var m, temp, xlo, xhi, + carry = 0, + i = x.length, + klo = k % SQRT_BASE, + khi = k / SQRT_BASE | 0; + + for (x = x.slice(); i--;) { + xlo = x[i] % SQRT_BASE; + xhi = x[i] / SQRT_BASE | 0; + m = khi * xlo + xhi * klo; + temp = klo * xlo + ((m % SQRT_BASE) * SQRT_BASE) + carry; + carry = (temp / base | 0) + (m / SQRT_BASE | 0) + khi * xhi; + x[i] = temp % base; + } + + if (carry) x = [carry].concat(x); + + return x; + } + + function compare(a, b, aL, bL) { + var i, cmp; + + if (aL != bL) { + cmp = aL > bL ? 1 : -1; + } else { + + for (i = cmp = 0; i < aL; i++) { + + if (a[i] != b[i]) { + cmp = a[i] > b[i] ? 1 : -1; + break; + } + } + } + + return cmp; + } + + function subtract(a, b, aL, base) { + var i = 0; + + // Subtract b from a. + for (; aL--;) { + a[aL] -= i; + i = a[aL] < b[aL] ? 1 : 0; + a[aL] = i * base + a[aL] - b[aL]; + } + + // Remove leading zeros. + for (; !a[0] && a.length > 1; a.splice(0, 1)); + } + + // x: dividend, y: divisor. + return function (x, y, dp, rm, base) { + var cmp, e, i, more, n, prod, prodL, q, qc, rem, remL, rem0, xi, xL, yc0, + yL, yz, + s = x.s == y.s ? 1 : -1, + xc = x.c, + yc = y.c; + + // Either NaN, Infinity or 0? + if (!xc || !xc[0] || !yc || !yc[0]) { + + return new BigNumber( + + // Return NaN if either NaN, or both Infinity or 0. + !x.s || !y.s || (xc ? yc && xc[0] == yc[0] : !yc) ? NaN : + + // Return ±0 if x is ±0 or y is ±Infinity, or return ±Infinity as y is ±0. + xc && xc[0] == 0 || !yc ? s * 0 : s / 0 + ); + } + + q = new BigNumber(s); + qc = q.c = []; + e = x.e - y.e; + s = dp + e + 1; + + if (!base) { + base = BASE; + e = bitFloor(x.e / LOG_BASE) - bitFloor(y.e / LOG_BASE); + s = s / LOG_BASE | 0; + } + + // Result exponent may be one less then the current value of e. + // The coefficients of the BigNumbers from convertBase may have trailing zeros. + for (i = 0; yc[i] == (xc[i] || 0); i++); + + if (yc[i] > (xc[i] || 0)) e--; + + if (s < 0) { + qc.push(1); + more = true; + } else { + xL = xc.length; + yL = yc.length; + i = 0; + s += 2; + + // Normalise xc and yc so highest order digit of yc is >= base / 2. + + n = mathfloor(base / (yc[0] + 1)); + + // Not necessary, but to handle odd bases where yc[0] == (base / 2) - 1. + // if (n > 1 || n++ == 1 && yc[0] < base / 2) { + if (n > 1) { + yc = multiply(yc, n, base); + xc = multiply(xc, n, base); + yL = yc.length; + xL = xc.length; + } + + xi = yL; + rem = xc.slice(0, yL); + remL = rem.length; + + // Add zeros to make remainder as long as divisor. + for (; remL < yL; rem[remL++] = 0); + yz = yc.slice(); + yz = [0].concat(yz); + yc0 = yc[0]; + if (yc[1] >= base / 2) yc0++; + // Not necessary, but to prevent trial digit n > base, when using base 3. + // else if (base == 3 && yc0 == 1) yc0 = 1 + 1e-15; + + do { + n = 0; + + // Compare divisor and remainder. + cmp = compare(yc, rem, yL, remL); + + // If divisor < remainder. + if (cmp < 0) { + + // Calculate trial digit, n. + + rem0 = rem[0]; + if (yL != remL) rem0 = rem0 * base + (rem[1] || 0); + + // n is how many times the divisor goes into the current remainder. + n = mathfloor(rem0 / yc0); + + // Algorithm: + // product = divisor multiplied by trial digit (n). + // Compare product and remainder. + // If product is greater than remainder: + // Subtract divisor from product, decrement trial digit. + // Subtract product from remainder. + // If product was less than remainder at the last compare: + // Compare new remainder and divisor. + // If remainder is greater than divisor: + // Subtract divisor from remainder, increment trial digit. + + if (n > 1) { + + // n may be > base only when base is 3. + if (n >= base) n = base - 1; + + // product = divisor * trial digit. + prod = multiply(yc, n, base); + prodL = prod.length; + remL = rem.length; + + // Compare product and remainder. + // If product > remainder then trial digit n too high. + // n is 1 too high about 5% of the time, and is not known to have + // ever been more than 1 too high. + while (compare(prod, rem, prodL, remL) == 1) { + n--; + + // Subtract divisor from product. + subtract(prod, yL < prodL ? yz : yc, prodL, base); + prodL = prod.length; + cmp = 1; + } + } else { + + // n is 0 or 1, cmp is -1. + // If n is 0, there is no need to compare yc and rem again below, + // so change cmp to 1 to avoid it. + // If n is 1, leave cmp as -1, so yc and rem are compared again. + if (n == 0) { + + // divisor < remainder, so n must be at least 1. + cmp = n = 1; + } + + // product = divisor + prod = yc.slice(); + prodL = prod.length; + } + + if (prodL < remL) prod = [0].concat(prod); + + // Subtract product from remainder. + subtract(rem, prod, remL, base); + remL = rem.length; + + // If product was < remainder. + if (cmp == -1) { + + // Compare divisor and new remainder. + // If divisor < new remainder, subtract divisor from remainder. + // Trial digit n too low. + // n is 1 too low about 5% of the time, and very rarely 2 too low. + while (compare(yc, rem, yL, remL) < 1) { + n++; + + // Subtract divisor from remainder. + subtract(rem, yL < remL ? yz : yc, remL, base); + remL = rem.length; + } + } + } else if (cmp === 0) { + n++; + rem = [0]; + } // else cmp === 1 and n will be 0 + + // Add the next digit, n, to the result array. + qc[i++] = n; + + // Update the remainder. + if (rem[0]) { + rem[remL++] = xc[xi] || 0; + } else { + rem = [xc[xi]]; + remL = 1; + } + } while ((xi++ < xL || rem[0] != null) && s--); + + more = rem[0] != null; + + // Leading zero? + if (!qc[0]) qc.splice(0, 1); + } + + if (base == BASE) { + + // To calculate q.e, first get the number of digits of qc[0]. + for (i = 1, s = qc[0]; s >= 10; s /= 10, i++); + + round(q, dp + (q.e = i + e * LOG_BASE - 1) + 1, rm, more); + + // Caller is convertBase. + } else { + q.e = e; + q.r = +more; + } + + return q; + }; + })(); + + + /* + * Return a string representing the value of BigNumber n in fixed-point or exponential + * notation rounded to the specified decimal places or significant digits. + * + * n: a BigNumber. + * i: the index of the last digit required (i.e. the digit that may be rounded up). + * rm: the rounding mode. + * id: 1 (toExponential) or 2 (toPrecision). + */ + function format(n, i, rm, id) { + var c0, e, ne, len, str; + + if (rm == null) rm = ROUNDING_MODE; + else intCheck(rm, 0, 8); + + if (!n.c) return n.toString(); + + c0 = n.c[0]; + ne = n.e; + + if (i == null) { + str = coeffToString(n.c); + str = id == 1 || id == 2 && ne <= TO_EXP_NEG + ? toExponential(str, ne) + : toFixedPoint(str, ne, '0'); + } else { + n = round(new BigNumber(n), i, rm); + + // n.e may have changed if the value was rounded up. + e = n.e; + + str = coeffToString(n.c); + len = str.length; + + // toPrecision returns exponential notation if the number of significant digits + // specified is less than the number of digits necessary to represent the integer + // part of the value in fixed-point notation. + + // Exponential notation. + if (id == 1 || id == 2 && (i <= e || e <= TO_EXP_NEG)) { + + // Append zeros? + for (; len < i; str += '0', len++); + str = toExponential(str, e); + + // Fixed-point notation. + } else { + i -= ne; + str = toFixedPoint(str, e, '0'); + + // Append zeros? + if (e + 1 > len) { + if (--i > 0) for (str += '.'; i--; str += '0'); + } else { + i += e - len; + if (i > 0) { + if (e + 1 == len) str += '.'; + for (; i--; str += '0'); + } + } + } + } + + return n.s < 0 && c0 ? '-' + str : str; + } + + + // Handle BigNumber.max and BigNumber.min. + function maxOrMin(args, method) { + var m, n, + i = 0; + + if (isArray(args[0])) args = args[0]; + m = new BigNumber(args[0]); + + for (; ++i < args.length;) { + n = new BigNumber(args[i]); + + // If any number is NaN, return NaN. + if (!n.s) { + m = n; + break; + } else if (method.call(m, n)) { + m = n; + } + } + + return m; + } + + + /* + * Strip trailing zeros, calculate base 10 exponent and check against MIN_EXP and MAX_EXP. + * Called by minus, plus and times. + */ + function normalise(n, c, e) { + var i = 1, + j = c.length; + + // Remove trailing zeros. + for (; !c[--j]; c.pop()); + + // Calculate the base 10 exponent. First get the number of digits of c[0]. + for (j = c[0]; j >= 10; j /= 10, i++); + + // Overflow? + if ((e = i + e * LOG_BASE - 1) > MAX_EXP) { + + // Infinity. + n.c = n.e = null; + + // Underflow? + } else if (e < MIN_EXP) { + + // Zero. + n.c = [n.e = 0]; + } else { + n.e = e; + n.c = c; + } + + return n; + } + + + // Handle values that fail the validity test in BigNumber. + parseNumeric = (function () { + var basePrefix = /^(-?)0([xbo])(?=\w[\w.]*$)/i, + dotAfter = /^([^.]+)\.$/, + dotBefore = /^\.([^.]+)$/, + isInfinityOrNaN = /^-?(Infinity|NaN)$/, + whitespaceOrPlus = /^\s*\+(?=[\w.])|^\s+|\s+$/g; + + return function (x, str, isNum, b) { + var base, + s = isNum ? str : str.replace(whitespaceOrPlus, ''); + + // No exception on ±Infinity or NaN. + if (isInfinityOrNaN.test(s)) { + x.s = isNaN(s) ? null : s < 0 ? -1 : 1; + x.c = x.e = null; + } else { + if (!isNum) { + + // basePrefix = /^(-?)0([xbo])(?=\w[\w.]*$)/i + s = s.replace(basePrefix, function (m, p1, p2) { + base = (p2 = p2.toLowerCase()) == 'x' ? 16 : p2 == 'b' ? 2 : 8; + return !b || b == base ? p1 : m; + }); + + if (b) { + base = b; + + // E.g. '1.' to '1', '.1' to '0.1' + s = s.replace(dotAfter, '$1').replace(dotBefore, '0.$1'); + } + + if (str != s) return new BigNumber(s, base); + } + + // '[BigNumber Error] Not a number: {n}' + // '[BigNumber Error] Not a base {b} number: {n}' + if (BigNumber.DEBUG) { + throw Error + (bignumberError + 'Not a' + (b ? ' base ' + b : '') + ' number: ' + str); + } + + // NaN + x.c = x.e = x.s = null; + } + } + })(); + + + /* + * Round x to sd significant digits using rounding mode rm. Check for over/under-flow. + * If r is truthy, it is known that there are more digits after the rounding digit. + */ + function round(x, sd, rm, r) { + var d, i, j, k, n, ni, rd, + xc = x.c, + pows10 = POWS_TEN; + + // if x is not Infinity or NaN... + if (xc) { + + // rd is the rounding digit, i.e. the digit after the digit that may be rounded up. + // n is a base 1e14 number, the value of the element of array x.c containing rd. + // ni is the index of n within x.c. + // d is the number of digits of n. + // i is the index of rd within n including leading zeros. + // j is the actual index of rd within n (if < 0, rd is a leading zero). + out: { + + // Get the number of digits of the first element of xc. + for (d = 1, k = xc[0]; k >= 10; k /= 10, d++); + i = sd - d; + + // If the rounding digit is in the first element of xc... + if (i < 0) { + i += LOG_BASE; + j = sd; + n = xc[ni = 0]; + + // Get the rounding digit at index j of n. + rd = n / pows10[d - j - 1] % 10 | 0; + } else { + ni = mathceil((i + 1) / LOG_BASE); + + if (ni >= xc.length) { + + if (r) { + + // Needed by sqrt. + for (; xc.length <= ni; xc.push(0)); + n = rd = 0; + d = 1; + i %= LOG_BASE; + j = i - LOG_BASE + 1; + } else { + break out; + } + } else { + n = k = xc[ni]; + + // Get the number of digits of n. + for (d = 1; k >= 10; k /= 10, d++); + + // Get the index of rd within n. + i %= LOG_BASE; + + // Get the index of rd within n, adjusted for leading zeros. + // The number of leading zeros of n is given by LOG_BASE - d. + j = i - LOG_BASE + d; + + // Get the rounding digit at index j of n. + rd = j < 0 ? 0 : n / pows10[d - j - 1] % 10 | 0; + } + } + + r = r || sd < 0 || + + // Are there any non-zero digits after the rounding digit? + // The expression n % pows10[d - j - 1] returns all digits of n to the right + // of the digit at j, e.g. if n is 908714 and j is 2, the expression gives 714. + xc[ni + 1] != null || (j < 0 ? n : n % pows10[d - j - 1]); + + r = rm < 4 + ? (rd || r) && (rm == 0 || rm == (x.s < 0 ? 3 : 2)) + : rd > 5 || rd == 5 && (rm == 4 || r || rm == 6 && + + // Check whether the digit to the left of the rounding digit is odd. + ((i > 0 ? j > 0 ? n / pows10[d - j] : 0 : xc[ni - 1]) % 10) & 1 || + rm == (x.s < 0 ? 8 : 7)); + + if (sd < 1 || !xc[0]) { + xc.length = 0; + + if (r) { + + // Convert sd to decimal places. + sd -= x.e + 1; + + // 1, 0.1, 0.01, 0.001, 0.0001 etc. + xc[0] = pows10[(LOG_BASE - sd % LOG_BASE) % LOG_BASE]; + x.e = -sd || 0; + } else { + + // Zero. + xc[0] = x.e = 0; + } + + return x; + } + + // Remove excess digits. + if (i == 0) { + xc.length = ni; + k = 1; + ni--; + } else { + xc.length = ni + 1; + k = pows10[LOG_BASE - i]; + + // E.g. 56700 becomes 56000 if 7 is the rounding digit. + // j > 0 means i > number of leading zeros of n. + xc[ni] = j > 0 ? mathfloor(n / pows10[d - j] % pows10[j]) * k : 0; + } + + // Round up? + if (r) { + + for (; ;) { + + // If the digit to be rounded up is in the first element of xc... + if (ni == 0) { + + // i will be the length of xc[0] before k is added. + for (i = 1, j = xc[0]; j >= 10; j /= 10, i++); + j = xc[0] += k; + for (k = 1; j >= 10; j /= 10, k++); + + // if i != k the length has increased. + if (i != k) { + x.e++; + if (xc[0] == BASE) xc[0] = 1; + } + + break; + } else { + xc[ni] += k; + if (xc[ni] != BASE) break; + xc[ni--] = 0; + k = 1; + } + } + } + + // Remove trailing zeros. + for (i = xc.length; xc[--i] === 0; xc.pop()); + } + + // Overflow? Infinity. + if (x.e > MAX_EXP) { + x.c = x.e = null; + + // Underflow? Zero. + } else if (x.e < MIN_EXP) { + x.c = [x.e = 0]; + } + } + + return x; + } + + + // PROTOTYPE/INSTANCE METHODS + + + /* + * Return a new BigNumber whose value is the absolute value of this BigNumber. + */ + P.absoluteValue = P.abs = function () { + var x = new BigNumber(this); + if (x.s < 0) x.s = 1; + return x; + }; + + + /* + * Return + * 1 if the value of this BigNumber is greater than the value of BigNumber(y, b), + * -1 if the value of this BigNumber is less than the value of BigNumber(y, b), + * 0 if they have the same value, + * or null if the value of either is NaN. + */ + P.comparedTo = function (y, b) { + return compare(this, new BigNumber(y, b)); + }; + + + /* + * If dp is undefined or null or true or false, return the number of decimal places of the + * value of this BigNumber, or null if the value of this BigNumber is ±Infinity or NaN. + * + * Otherwise, if dp is a number, return a new BigNumber whose value is the value of this + * BigNumber rounded to a maximum of dp decimal places using rounding mode rm, or + * ROUNDING_MODE if rm is omitted. + * + * [dp] {number} Decimal places: integer, 0 to MAX inclusive. + * [rm] {number} Rounding mode. Integer, 0 to 8 inclusive. + * + * '[BigNumber Error] Argument {not a primitive number|not an integer|out of range}: {dp|rm}' + */ + P.decimalPlaces = P.dp = function (dp, rm) { + var c, n, v, + x = this; + + if (dp != null) { + intCheck(dp, 0, MAX); + if (rm == null) rm = ROUNDING_MODE; + else intCheck(rm, 0, 8); + + return round(new BigNumber(x), dp + x.e + 1, rm); + } + + if (!(c = x.c)) return null; + n = ((v = c.length - 1) - bitFloor(this.e / LOG_BASE)) * LOG_BASE; + + // Subtract the number of trailing zeros of the last number. + if (v = c[v]) for (; v % 10 == 0; v /= 10, n--); + if (n < 0) n = 0; + + return n; + }; + + + /* + * n / 0 = I + * n / N = N + * n / I = 0 + * 0 / n = 0 + * 0 / 0 = N + * 0 / N = N + * 0 / I = 0 + * N / n = N + * N / 0 = N + * N / N = N + * N / I = N + * I / n = I + * I / 0 = I + * I / N = N + * I / I = N + * + * Return a new BigNumber whose value is the value of this BigNumber divided by the value of + * BigNumber(y, b), rounded according to DECIMAL_PLACES and ROUNDING_MODE. + */ + P.dividedBy = P.div = function (y, b) { + return div(this, new BigNumber(y, b), DECIMAL_PLACES, ROUNDING_MODE); + }; + + + /* + * Return a new BigNumber whose value is the integer part of dividing the value of this + * BigNumber by the value of BigNumber(y, b). + */ + P.dividedToIntegerBy = P.idiv = function (y, b) { + return div(this, new BigNumber(y, b), 0, 1); + }; + + + /* + * Return a BigNumber whose value is the value of this BigNumber exponentiated by n. + * + * If m is present, return the result modulo m. + * If n is negative round according to DECIMAL_PLACES and ROUNDING_MODE. + * If POW_PRECISION is non-zero and m is not present, round to POW_PRECISION using ROUNDING_MODE. + * + * The modular power operation works efficiently when x, n, and m are integers, otherwise it + * is equivalent to calculating x.exponentiatedBy(n).modulo(m) with a POW_PRECISION of 0. + * + * n {number|string|BigNumber} The exponent. An integer. + * [m] {number|string|BigNumber} The modulus. + * + * '[BigNumber Error] Exponent not an integer: {n}' + */ + P.exponentiatedBy = P.pow = function (n, m) { + var half, isModExp, k, more, nIsBig, nIsNeg, nIsOdd, y, + x = this; + + n = new BigNumber(n); + + // Allow NaN and ±Infinity, but not other non-integers. + if (n.c && !n.isInteger()) { + throw Error + (bignumberError + 'Exponent not an integer: ' + n); + } + + if (m != null) m = new BigNumber(m); + + // Exponent of MAX_SAFE_INTEGER is 15. + nIsBig = n.e > 14; + + // If x is NaN, ±Infinity, ±0 or ±1, or n is ±Infinity, NaN or ±0. + if (!x.c || !x.c[0] || x.c[0] == 1 && !x.e && x.c.length == 1 || !n.c || !n.c[0]) { + + // The sign of the result of pow when x is negative depends on the evenness of n. + // If +n overflows to ±Infinity, the evenness of n would be not be known. + y = new BigNumber(Math.pow(+x.valueOf(), nIsBig ? 2 - isOdd(n) : +n)); + return m ? y.mod(m) : y; + } + + nIsNeg = n.s < 0; + + if (m) { + + // x % m returns NaN if abs(m) is zero, or m is NaN. + if (m.c ? !m.c[0] : !m.s) return new BigNumber(NaN); + + isModExp = !nIsNeg && x.isInteger() && m.isInteger(); + + if (isModExp) x = x.mod(m); + + // Overflow to ±Infinity: >=2**1e10 or >=1.0000024**1e15. + // Underflow to ±0: <=0.79**1e10 or <=0.9999975**1e15. + } else if (n.e > 9 && (x.e > 0 || x.e < -1 || (x.e == 0 + // [1, 240000000] + ? x.c[0] > 1 || nIsBig && x.c[1] >= 24e7 + // [80000000000000] [99999750000000] + : x.c[0] < 8e13 || nIsBig && x.c[0] <= 9999975e7))) { + + // If x is negative and n is odd, k = -0, else k = 0. + k = x.s < 0 && isOdd(n) ? -0 : 0; + + // If x >= 1, k = ±Infinity. + if (x.e > -1) k = 1 / k; + + // If n is negative return ±0, else return ±Infinity. + return new BigNumber(nIsNeg ? 1 / k : k); + + } else if (POW_PRECISION) { + + // Truncating each coefficient array to a length of k after each multiplication + // equates to truncating significant digits to POW_PRECISION + [28, 41], + // i.e. there will be a minimum of 28 guard digits retained. + k = mathceil(POW_PRECISION / LOG_BASE + 2); + } + + if (nIsBig) { + half = new BigNumber(0.5); + nIsOdd = isOdd(n); + } else { + nIsOdd = n % 2; + } + + if (nIsNeg) n.s = 1; + + y = new BigNumber(ONE); + + // Performs 54 loop iterations for n of 9007199254740991. + for (; ;) { + + if (nIsOdd) { + y = y.times(x); + if (!y.c) break; + + if (k) { + if (y.c.length > k) y.c.length = k; + } else if (isModExp) { + y = y.mod(m); //y = y.minus(div(y, m, 0, MODULO_MODE).times(m)); + } + } + + if (nIsBig) { + n = n.times(half); + round(n, n.e + 1, 1); + if (!n.c[0]) break; + nIsBig = n.e > 14; + nIsOdd = isOdd(n); + } else { + n = mathfloor(n / 2); + if (!n) break; + nIsOdd = n % 2; + } + + x = x.times(x); + + if (k) { + if (x.c && x.c.length > k) x.c.length = k; + } else if (isModExp) { + x = x.mod(m); //x = x.minus(div(x, m, 0, MODULO_MODE).times(m)); + } + } + + if (isModExp) return y; + if (nIsNeg) y = ONE.div(y); + + return m ? y.mod(m) : k ? round(y, POW_PRECISION, ROUNDING_MODE, more) : y; + }; + + + /* + * Return a new BigNumber whose value is the value of this BigNumber rounded to an integer + * using rounding mode rm, or ROUNDING_MODE if rm is omitted. + * + * [rm] {number} Rounding mode. Integer, 0 to 8 inclusive. + * + * '[BigNumber Error] Argument {not a primitive number|not an integer|out of range}: {rm}' + */ + P.integerValue = function (rm) { + var n = new BigNumber(this); + if (rm == null) rm = ROUNDING_MODE; + else intCheck(rm, 0, 8); + return round(n, n.e + 1, rm); + }; + + + /* + * Return true if the value of this BigNumber is equal to the value of BigNumber(y, b), + * otherwise return false. + */ + P.isEqualTo = P.eq = function (y, b) { + return compare(this, new BigNumber(y, b)) === 0; + }; + + + /* + * Return true if the value of this BigNumber is a finite number, otherwise return false. + */ + P.isFinite = function () { + return !!this.c; + }; + + + /* + * Return true if the value of this BigNumber is greater than the value of BigNumber(y, b), + * otherwise return false. + */ + P.isGreaterThan = P.gt = function (y, b) { + return compare(this, new BigNumber(y, b)) > 0; + }; + + + /* + * Return true if the value of this BigNumber is greater than or equal to the value of + * BigNumber(y, b), otherwise return false. + */ + P.isGreaterThanOrEqualTo = P.gte = function (y, b) { + return (b = compare(this, new BigNumber(y, b))) === 1 || b === 0; + + }; + + + /* + * Return true if the value of this BigNumber is an integer, otherwise return false. + */ + P.isInteger = function () { + return !!this.c && bitFloor(this.e / LOG_BASE) > this.c.length - 2; + }; + + + /* + * Return true if the value of this BigNumber is less than the value of BigNumber(y, b), + * otherwise return false. + */ + P.isLessThan = P.lt = function (y, b) { + return compare(this, new BigNumber(y, b)) < 0; + }; + + + /* + * Return true if the value of this BigNumber is less than or equal to the value of + * BigNumber(y, b), otherwise return false. + */ + P.isLessThanOrEqualTo = P.lte = function (y, b) { + return (b = compare(this, new BigNumber(y, b))) === -1 || b === 0; + }; + + + /* + * Return true if the value of this BigNumber is NaN, otherwise return false. + */ + P.isNaN = function () { + return !this.s; + }; + + + /* + * Return true if the value of this BigNumber is negative, otherwise return false. + */ + P.isNegative = function () { + return this.s < 0; + }; + + + /* + * Return true if the value of this BigNumber is positive, otherwise return false. + */ + P.isPositive = function () { + return this.s > 0; + }; + + + /* + * Return true if the value of this BigNumber is 0 or -0, otherwise return false. + */ + P.isZero = function () { + return !!this.c && this.c[0] == 0; + }; + + + /* + * n - 0 = n + * n - N = N + * n - I = -I + * 0 - n = -n + * 0 - 0 = 0 + * 0 - N = N + * 0 - I = -I + * N - n = N + * N - 0 = N + * N - N = N + * N - I = N + * I - n = I + * I - 0 = I + * I - N = N + * I - I = N + * + * Return a new BigNumber whose value is the value of this BigNumber minus the value of + * BigNumber(y, b). + */ + P.minus = function (y, b) { + var i, j, t, xLTy, + x = this, + a = x.s; + + y = new BigNumber(y, b); + b = y.s; + + // Either NaN? + if (!a || !b) return new BigNumber(NaN); + + // Signs differ? + if (a != b) { + y.s = -b; + return x.plus(y); + } + + var xe = x.e / LOG_BASE, + ye = y.e / LOG_BASE, + xc = x.c, + yc = y.c; + + if (!xe || !ye) { + + // Either Infinity? + if (!xc || !yc) return xc ? (y.s = -b, y) : new BigNumber(yc ? x : NaN); + + // Either zero? + if (!xc[0] || !yc[0]) { + + // Return y if y is non-zero, x if x is non-zero, or zero if both are zero. + return yc[0] ? (y.s = -b, y) : new BigNumber(xc[0] ? x : + + // IEEE 754 (2008) 6.3: n - n = -0 when rounding to -Infinity + ROUNDING_MODE == 3 ? -0 : 0); + } + } + + xe = bitFloor(xe); + ye = bitFloor(ye); + xc = xc.slice(); + + // Determine which is the bigger number. + if (a = xe - ye) { + + if (xLTy = a < 0) { + a = -a; + t = xc; + } else { + ye = xe; + t = yc; + } + + t.reverse(); + + // Prepend zeros to equalise exponents. + for (b = a; b--; t.push(0)); + t.reverse(); + } else { + + // Exponents equal. Check digit by digit. + j = (xLTy = (a = xc.length) < (b = yc.length)) ? a : b; + + for (a = b = 0; b < j; b++) { + + if (xc[b] != yc[b]) { + xLTy = xc[b] < yc[b]; + break; + } + } + } + + // x < y? Point xc to the array of the bigger number. + if (xLTy) t = xc, xc = yc, yc = t, y.s = -y.s; + + b = (j = yc.length) - (i = xc.length); + + // Append zeros to xc if shorter. + // No need to add zeros to yc if shorter as subtract only needs to start at yc.length. + if (b > 0) for (; b--; xc[i++] = 0); + b = BASE - 1; + + // Subtract yc from xc. + for (; j > a;) { + + if (xc[--j] < yc[j]) { + for (i = j; i && !xc[--i]; xc[i] = b); + --xc[i]; + xc[j] += BASE; + } + + xc[j] -= yc[j]; + } + + // Remove leading zeros and adjust exponent accordingly. + for (; xc[0] == 0; xc.splice(0, 1), --ye); + + // Zero? + if (!xc[0]) { + + // Following IEEE 754 (2008) 6.3, + // n - n = +0 but n - n = -0 when rounding towards -Infinity. + y.s = ROUNDING_MODE == 3 ? -1 : 1; + y.c = [y.e = 0]; + return y; + } + + // No need to check for Infinity as +x - +y != Infinity && -x - -y != Infinity + // for finite x and y. + return normalise(y, xc, ye); + }; + + + /* + * n % 0 = N + * n % N = N + * n % I = n + * 0 % n = 0 + * -0 % n = -0 + * 0 % 0 = N + * 0 % N = N + * 0 % I = 0 + * N % n = N + * N % 0 = N + * N % N = N + * N % I = N + * I % n = N + * I % 0 = N + * I % N = N + * I % I = N + * + * Return a new BigNumber whose value is the value of this BigNumber modulo the value of + * BigNumber(y, b). The result depends on the value of MODULO_MODE. + */ + P.modulo = P.mod = function (y, b) { + var q, s, + x = this; + + y = new BigNumber(y, b); + + // Return NaN if x is Infinity or NaN, or y is NaN or zero. + if (!x.c || !y.s || y.c && !y.c[0]) { + return new BigNumber(NaN); + + // Return x if y is Infinity or x is zero. + } else if (!y.c || x.c && !x.c[0]) { + return new BigNumber(x); + } + + if (MODULO_MODE == 9) { + + // Euclidian division: q = sign(y) * floor(x / abs(y)) + // r = x - qy where 0 <= r < abs(y) + s = y.s; + y.s = 1; + q = div(x, y, 0, 3); + y.s = s; + q.s *= s; + } else { + q = div(x, y, 0, MODULO_MODE); + } + + y = x.minus(q.times(y)); + + // To match JavaScript %, ensure sign of zero is sign of dividend. + if (!y.c[0] && MODULO_MODE == 1) y.s = x.s; + + return y; + }; + + + /* + * n * 0 = 0 + * n * N = N + * n * I = I + * 0 * n = 0 + * 0 * 0 = 0 + * 0 * N = N + * 0 * I = N + * N * n = N + * N * 0 = N + * N * N = N + * N * I = N + * I * n = I + * I * 0 = N + * I * N = N + * I * I = I + * + * Return a new BigNumber whose value is the value of this BigNumber multiplied by the value + * of BigNumber(y, b). + */ + P.multipliedBy = P.times = function (y, b) { + var c, e, i, j, k, m, xcL, xlo, xhi, ycL, ylo, yhi, zc, + base, sqrtBase, + x = this, + xc = x.c, + yc = (y = new BigNumber(y, b)).c; + + // Either NaN, ±Infinity or ±0? + if (!xc || !yc || !xc[0] || !yc[0]) { + + // Return NaN if either is NaN, or one is 0 and the other is Infinity. + if (!x.s || !y.s || xc && !xc[0] && !yc || yc && !yc[0] && !xc) { + y.c = y.e = y.s = null; + } else { + y.s *= x.s; + + // Return ±Infinity if either is ±Infinity. + if (!xc || !yc) { + y.c = y.e = null; + + // Return ±0 if either is ±0. + } else { + y.c = [0]; + y.e = 0; + } + } + + return y; + } + + e = bitFloor(x.e / LOG_BASE) + bitFloor(y.e / LOG_BASE); + y.s *= x.s; + xcL = xc.length; + ycL = yc.length; + + // Ensure xc points to longer array and xcL to its length. + if (xcL < ycL) zc = xc, xc = yc, yc = zc, i = xcL, xcL = ycL, ycL = i; + + // Initialise the result array with zeros. + for (i = xcL + ycL, zc = []; i--; zc.push(0)); + + base = BASE; + sqrtBase = SQRT_BASE; + + for (i = ycL; --i >= 0;) { + c = 0; + ylo = yc[i] % sqrtBase; + yhi = yc[i] / sqrtBase | 0; + + for (k = xcL, j = i + k; j > i;) { + xlo = xc[--k] % sqrtBase; + xhi = xc[k] / sqrtBase | 0; + m = yhi * xlo + xhi * ylo; + xlo = ylo * xlo + ((m % sqrtBase) * sqrtBase) + zc[j] + c; + c = (xlo / base | 0) + (m / sqrtBase | 0) + yhi * xhi; + zc[j--] = xlo % base; + } + + zc[j] = c; + } + + if (c) { + ++e; + } else { + zc.splice(0, 1); + } + + return normalise(y, zc, e); + }; + + + /* + * Return a new BigNumber whose value is the value of this BigNumber negated, + * i.e. multiplied by -1. + */ + P.negated = function () { + var x = new BigNumber(this); + x.s = -x.s || null; + return x; + }; + + + /* + * n + 0 = n + * n + N = N + * n + I = I + * 0 + n = n + * 0 + 0 = 0 + * 0 + N = N + * 0 + I = I + * N + n = N + * N + 0 = N + * N + N = N + * N + I = N + * I + n = I + * I + 0 = I + * I + N = N + * I + I = I + * + * Return a new BigNumber whose value is the value of this BigNumber plus the value of + * BigNumber(y, b). + */ + P.plus = function (y, b) { + var t, + x = this, + a = x.s; + + y = new BigNumber(y, b); + b = y.s; + + // Either NaN? + if (!a || !b) return new BigNumber(NaN); + + // Signs differ? + if (a != b) { + y.s = -b; + return x.minus(y); + } + + var xe = x.e / LOG_BASE, + ye = y.e / LOG_BASE, + xc = x.c, + yc = y.c; + + if (!xe || !ye) { + + // Return ±Infinity if either ±Infinity. + if (!xc || !yc) return new BigNumber(a / 0); + + // Either zero? + // Return y if y is non-zero, x if x is non-zero, or zero if both are zero. + if (!xc[0] || !yc[0]) return yc[0] ? y : new BigNumber(xc[0] ? x : a * 0); + } + + xe = bitFloor(xe); + ye = bitFloor(ye); + xc = xc.slice(); + + // Prepend zeros to equalise exponents. Faster to use reverse then do unshifts. + if (a = xe - ye) { + if (a > 0) { + ye = xe; + t = yc; + } else { + a = -a; + t = xc; + } + + t.reverse(); + for (; a--; t.push(0)); + t.reverse(); + } + + a = xc.length; + b = yc.length; + + // Point xc to the longer array, and b to the shorter length. + if (a - b < 0) t = yc, yc = xc, xc = t, b = a; + + // Only start adding at yc.length - 1 as the further digits of xc can be ignored. + for (a = 0; b;) { + a = (xc[--b] = xc[b] + yc[b] + a) / BASE | 0; + xc[b] = BASE === xc[b] ? 0 : xc[b] % BASE; + } + + if (a) { + xc = [a].concat(xc); + ++ye; + } + + // No need to check for zero, as +x + +y != 0 && -x + -y != 0 + // ye = MAX_EXP + 1 possible + return normalise(y, xc, ye); + }; + + + /* + * If sd is undefined or null or true or false, return the number of significant digits of + * the value of this BigNumber, or null if the value of this BigNumber is ±Infinity or NaN. + * If sd is true include integer-part trailing zeros in the count. + * + * Otherwise, if sd is a number, return a new BigNumber whose value is the value of this + * BigNumber rounded to a maximum of sd significant digits using rounding mode rm, or + * ROUNDING_MODE if rm is omitted. + * + * sd {number|boolean} number: significant digits: integer, 1 to MAX inclusive. + * boolean: whether to count integer-part trailing zeros: true or false. + * [rm] {number} Rounding mode. Integer, 0 to 8 inclusive. + * + * '[BigNumber Error] Argument {not a primitive number|not an integer|out of range}: {sd|rm}' + */ + P.precision = P.sd = function (sd, rm) { + var c, n, v, + x = this; + + if (sd != null && sd !== !!sd) { + intCheck(sd, 1, MAX); + if (rm == null) rm = ROUNDING_MODE; + else intCheck(rm, 0, 8); + + return round(new BigNumber(x), sd, rm); + } + + if (!(c = x.c)) return null; + v = c.length - 1; + n = v * LOG_BASE + 1; + + if (v = c[v]) { + + // Subtract the number of trailing zeros of the last element. + for (; v % 10 == 0; v /= 10, n--); + + // Add the number of digits of the first element. + for (v = c[0]; v >= 10; v /= 10, n++); + } + + if (sd && x.e + 1 > n) n = x.e + 1; + + return n; + }; + + + /* + * Return a new BigNumber whose value is the value of this BigNumber shifted by k places + * (powers of 10). Shift to the right if n > 0, and to the left if n < 0. + * + * k {number} Integer, -MAX_SAFE_INTEGER to MAX_SAFE_INTEGER inclusive. + * + * '[BigNumber Error] Argument {not a primitive number|not an integer|out of range}: {k}' + */ + P.shiftedBy = function (k) { + intCheck(k, -MAX_SAFE_INTEGER, MAX_SAFE_INTEGER); + return this.times('1e' + k); + }; + + + /* + * sqrt(-n) = N + * sqrt(N) = N + * sqrt(-I) = N + * sqrt(I) = I + * sqrt(0) = 0 + * sqrt(-0) = -0 + * + * Return a new BigNumber whose value is the square root of the value of this BigNumber, + * rounded according to DECIMAL_PLACES and ROUNDING_MODE. + */ + P.squareRoot = P.sqrt = function () { + var m, n, r, rep, t, + x = this, + c = x.c, + s = x.s, + e = x.e, + dp = DECIMAL_PLACES + 4, + half = new BigNumber('0.5'); + + // Negative/NaN/Infinity/zero? + if (s !== 1 || !c || !c[0]) { + return new BigNumber(!s || s < 0 && (!c || c[0]) ? NaN : c ? x : 1 / 0); + } + + // Initial estimate. + s = Math.sqrt(+x); + + // Math.sqrt underflow/overflow? + // Pass x to Math.sqrt as integer, then adjust the exponent of the result. + if (s == 0 || s == 1 / 0) { + n = coeffToString(c); + if ((n.length + e) % 2 == 0) n += '0'; + s = Math.sqrt(n); + e = bitFloor((e + 1) / 2) - (e < 0 || e % 2); + + if (s == 1 / 0) { + n = '1e' + e; + } else { + n = s.toExponential(); + n = n.slice(0, n.indexOf('e') + 1) + e; + } + + r = new BigNumber(n); + } else { + r = new BigNumber(s + ''); + } + + // Check for zero. + // r could be zero if MIN_EXP is changed after the this value was created. + // This would cause a division by zero (x/t) and hence Infinity below, which would cause + // coeffToString to throw. + if (r.c[0]) { + e = r.e; + s = e + dp; + if (s < 3) s = 0; + + // Newton-Raphson iteration. + for (; ;) { + t = r; + r = half.times(t.plus(div(x, t, dp, 1))); + + if (coeffToString(t.c ).slice(0, s) === (n = + coeffToString(r.c)).slice(0, s)) { + + // The exponent of r may here be one less than the final result exponent, + // e.g 0.0009999 (e-4) --> 0.001 (e-3), so adjust s so the rounding digits + // are indexed correctly. + if (r.e < e) --s; + n = n.slice(s - 3, s + 1); + + // The 4th rounding digit may be in error by -1 so if the 4 rounding digits + // are 9999 or 4999 (i.e. approaching a rounding boundary) continue the + // iteration. + if (n == '9999' || !rep && n == '4999') { + + // On the first iteration only, check to see if rounding up gives the + // exact result as the nines may infinitely repeat. + if (!rep) { + round(t, t.e + DECIMAL_PLACES + 2, 0); + + if (t.times(t).eq(x)) { + r = t; + break; + } + } + + dp += 4; + s += 4; + rep = 1; + } else { + + // If rounding digits are null, 0{0,4} or 50{0,3}, check for exact + // result. If not, then there are further digits and m will be truthy. + if (!+n || !+n.slice(1) && n.charAt(0) == '5') { + + // Truncate to the first rounding digit. + round(r, r.e + DECIMAL_PLACES + 2, 1); + m = !r.times(r).eq(x); + } + + break; + } + } + } + } + + return round(r, r.e + DECIMAL_PLACES + 1, ROUNDING_MODE, m); + }; + + + /* + * Return a string representing the value of this BigNumber in exponential notation and + * rounded using ROUNDING_MODE to dp fixed decimal places. + * + * [dp] {number} Decimal places. Integer, 0 to MAX inclusive. + * [rm] {number} Rounding mode. Integer, 0 to 8 inclusive. + * + * '[BigNumber Error] Argument {not a primitive number|not an integer|out of range}: {dp|rm}' + */ + P.toExponential = function (dp, rm) { + if (dp != null) { + intCheck(dp, 0, MAX); + dp++; + } + return format(this, dp, rm, 1); + }; + + + /* + * Return a string representing the value of this BigNumber in fixed-point notation rounding + * to dp fixed decimal places using rounding mode rm, or ROUNDING_MODE if rm is omitted. + * + * Note: as with JavaScript's number type, (-0).toFixed(0) is '0', + * but e.g. (-0.00001).toFixed(0) is '-0'. + * + * [dp] {number} Decimal places. Integer, 0 to MAX inclusive. + * [rm] {number} Rounding mode. Integer, 0 to 8 inclusive. + * + * '[BigNumber Error] Argument {not a primitive number|not an integer|out of range}: {dp|rm}' + */ + P.toFixed = function (dp, rm) { + if (dp != null) { + intCheck(dp, 0, MAX); + dp = dp + this.e + 1; + } + return format(this, dp, rm); + }; + + + /* + * Return a string representing the value of this BigNumber in fixed-point notation rounded + * using rm or ROUNDING_MODE to dp decimal places, and formatted according to the properties + * of the FORMAT object (see BigNumber.set). + * + * FORMAT = { + * decimalSeparator : '.', + * groupSeparator : ',', + * groupSize : 3, + * secondaryGroupSize : 0, + * fractionGroupSeparator : '\xA0', // non-breaking space + * fractionGroupSize : 0 + * }; + * + * [dp] {number} Decimal places. Integer, 0 to MAX inclusive. + * [rm] {number} Rounding mode. Integer, 0 to 8 inclusive. + * + * '[BigNumber Error] Argument {not a primitive number|not an integer|out of range}: {dp|rm}' + */ + P.toFormat = function (dp, rm) { + var str = this.toFixed(dp, rm); + + if (this.c) { + var i, + arr = str.split('.'), + g1 = +FORMAT.groupSize, + g2 = +FORMAT.secondaryGroupSize, + groupSeparator = FORMAT.groupSeparator, + intPart = arr[0], + fractionPart = arr[1], + isNeg = this.s < 0, + intDigits = isNeg ? intPart.slice(1) : intPart, + len = intDigits.length; + + if (g2) i = g1, g1 = g2, g2 = i, len -= i; + + if (g1 > 0 && len > 0) { + i = len % g1 || g1; + intPart = intDigits.substr(0, i); + + for (; i < len; i += g1) { + intPart += groupSeparator + intDigits.substr(i, g1); + } + + if (g2 > 0) intPart += groupSeparator + intDigits.slice(i); + if (isNeg) intPart = '-' + intPart; + } + + str = fractionPart + ? intPart + FORMAT.decimalSeparator + ((g2 = +FORMAT.fractionGroupSize) + ? fractionPart.replace(new RegExp('\\d{' + g2 + '}\\B', 'g'), + '$&' + FORMAT.fractionGroupSeparator) + : fractionPart) + : intPart; + } + + return str; + }; + + + /* + * Return a string array representing the value of this BigNumber as a simple fraction with + * an integer numerator and an integer denominator. The denominator will be a positive + * non-zero value less than or equal to the specified maximum denominator. If a maximum + * denominator is not specified, the denominator will be the lowest value necessary to + * represent the number exactly. + * + * [md] {number|string|BigNumber} Integer >= 1, or Infinity. The maximum denominator. + * + * '[BigNumber Error] Argument {not an integer|out of range} : {md}' + */ + P.toFraction = function (md) { + var arr, d, d0, d1, d2, e, exp, n, n0, n1, q, s, + x = this, + xc = x.c; + + if (md != null) { + n = new BigNumber(md); + + // Throw if md is less than one or is not an integer, unless it is Infinity. + if (!n.isInteger() && (n.c || n.s !== 1) || n.lt(ONE)) { + throw Error + (bignumberError + 'Argument ' + + (n.isInteger() ? 'out of range: ' : 'not an integer: ') + md); + } + } + + if (!xc) return x.toString(); + + d = new BigNumber(ONE); + n1 = d0 = new BigNumber(ONE); + d1 = n0 = new BigNumber(ONE); + s = coeffToString(xc); + + // Determine initial denominator. + // d is a power of 10 and the minimum max denominator that specifies the value exactly. + e = d.e = s.length - x.e - 1; + d.c[0] = POWS_TEN[(exp = e % LOG_BASE) < 0 ? LOG_BASE + exp : exp]; + md = !md || n.comparedTo(d) > 0 ? (e > 0 ? d : n1) : n; + + exp = MAX_EXP; + MAX_EXP = 1 / 0; + n = new BigNumber(s); + + // n0 = d1 = 0 + n0.c[0] = 0; + + for (; ;) { + q = div(n, d, 0, 1); + d2 = d0.plus(q.times(d1)); + if (d2.comparedTo(md) == 1) break; + d0 = d1; + d1 = d2; + n1 = n0.plus(q.times(d2 = n1)); + n0 = d2; + d = n.minus(q.times(d2 = d)); + n = d2; + } + + d2 = div(md.minus(d0), d1, 0, 1); + n0 = n0.plus(d2.times(n1)); + d0 = d0.plus(d2.times(d1)); + n0.s = n1.s = x.s; + e *= 2; + + // Determine which fraction is closer to x, n0/d0 or n1/d1 + arr = div(n1, d1, e, ROUNDING_MODE).minus(x).abs().comparedTo( + div(n0, d0, e, ROUNDING_MODE).minus(x).abs()) < 1 + ? [n1.toString(), d1.toString()] + : [n0.toString(), d0.toString()]; + + MAX_EXP = exp; + return arr; + }; + + + /* + * Return the value of this BigNumber converted to a number primitive. + */ + P.toNumber = function () { + return +this; + }; + + + /* + * Return a string representing the value of this BigNumber rounded to sd significant digits + * using rounding mode rm or ROUNDING_MODE. If sd is less than the number of digits + * necessary to represent the integer part of the value in fixed-point notation, then use + * exponential notation. + * + * [sd] {number} Significant digits. Integer, 1 to MAX inclusive. + * [rm] {number} Rounding mode. Integer, 0 to 8 inclusive. + * + * '[BigNumber Error] Argument {not a primitive number|not an integer|out of range}: {sd|rm}' + */ + P.toPrecision = function (sd, rm) { + if (sd != null) intCheck(sd, 1, MAX); + return format(this, sd, rm, 2); + }; + + + /* + * Return a string representing the value of this BigNumber in base b, or base 10 if b is + * omitted. If a base is specified, including base 10, round according to DECIMAL_PLACES and + * ROUNDING_MODE. If a base is not specified, and this BigNumber has a positive exponent + * that is equal to or greater than TO_EXP_POS, or a negative exponent equal to or less than + * TO_EXP_NEG, return exponential notation. + * + * [b] {number} Integer, 2 to ALPHABET.length inclusive. + * + * '[BigNumber Error] Base {not a primitive number|not an integer|out of range}: {b}' + */ + P.toString = function (b) { + var str, + n = this, + s = n.s, + e = n.e; + + // Infinity or NaN? + if (e === null) { + + if (s) { + str = 'Infinity'; + if (s < 0) str = '-' + str; + } else { + str = 'NaN'; + } + } else { + str = coeffToString(n.c); + + if (b == null) { + str = e <= TO_EXP_NEG || e >= TO_EXP_POS + ? toExponential(str, e) + : toFixedPoint(str, e, '0'); + } else { + intCheck(b, 2, ALPHABET.length, 'Base'); + str = convertBase(toFixedPoint(str, e, '0'), 10, b, s, true); + } + + if (s < 0 && n.c[0]) str = '-' + str; + } + + return str; + }; + + + /* + * Return as toString, but do not accept a base argument, and include the minus sign for + * negative zero. + */ + P.valueOf = P.toJSON = function () { + var str, + n = this, + e = n.e; + + if (e === null) return n.toString(); + + str = coeffToString(n.c); + + str = e <= TO_EXP_NEG || e >= TO_EXP_POS + ? toExponential(str, e) + : toFixedPoint(str, e, '0'); + + return n.s < 0 ? '-' + str : str; + }; + + + P._isBigNumber = true; + + if (configObject != null) BigNumber.set(configObject); + + return BigNumber; + } + + + // PRIVATE HELPER FUNCTIONS + + + function bitFloor(n) { + var i = n | 0; + return n > 0 || n === i ? i : i - 1; + } + + + // Return a coefficient array as a string of base 10 digits. + function coeffToString(a) { + var s, z, + i = 1, + j = a.length, + r = a[0] + ''; + + for (; i < j;) { + s = a[i++] + ''; + z = LOG_BASE - s.length; + for (; z--; s = '0' + s); + r += s; + } + + // Determine trailing zeros. + for (j = r.length; r.charCodeAt(--j) === 48;); + return r.slice(0, j + 1 || 1); + } + + + // Compare the value of BigNumbers x and y. + function compare(x, y) { + var a, b, + xc = x.c, + yc = y.c, + i = x.s, + j = y.s, + k = x.e, + l = y.e; + + // Either NaN? + if (!i || !j) return null; + + a = xc && !xc[0]; + b = yc && !yc[0]; + + // Either zero? + if (a || b) return a ? b ? 0 : -j : i; + + // Signs differ? + if (i != j) return i; + + a = i < 0; + b = k == l; + + // Either Infinity? + if (!xc || !yc) return b ? 0 : !xc ^ a ? 1 : -1; + + // Compare exponents. + if (!b) return k > l ^ a ? 1 : -1; + + j = (k = xc.length) < (l = yc.length) ? k : l; + + // Compare digit by digit. + for (i = 0; i < j; i++) if (xc[i] != yc[i]) return xc[i] > yc[i] ^ a ? 1 : -1; + + // Compare lengths. + return k == l ? 0 : k > l ^ a ? 1 : -1; + } + + + /* + * Check that n is a primitive number, an integer, and in range, otherwise throw. + */ + function intCheck(n, min, max, name) { + if (n < min || n > max || n !== (n < 0 ? mathceil(n) : mathfloor(n))) { + throw Error + (bignumberError + (name || 'Argument') + (typeof n == 'number' + ? n < min || n > max ? ' out of range: ' : ' not an integer: ' + : ' not a primitive number: ') + n); + } + } + + + function isArray(obj) { + return Object.prototype.toString.call(obj) == '[object Array]'; + } + + + // Assumes finite n. + function isOdd(n) { + var k = n.c.length - 1; + return bitFloor(n.e / LOG_BASE) == k && n.c[k] % 2 != 0; + } + + + function toExponential(str, e) { + return (str.length > 1 ? str.charAt(0) + '.' + str.slice(1) : str) + + (e < 0 ? 'e' : 'e+') + e; + } + + + function toFixedPoint(str, e, z) { + var len, zs; + + // Negative exponent? + if (e < 0) { + + // Prepend zeros. + for (zs = z + '.'; ++e; zs += z); + str = zs + str; + + // Positive exponent + } else { + len = str.length; + + // Append zeros. + if (++e > len) { + for (zs = z, e -= len; --e; zs += z); + str += zs; + } else if (e < len) { + str = str.slice(0, e) + '.' + str.slice(e); + } + } + + return str; + } + + + // EXPORT + + + BigNumber = clone(); + BigNumber['default'] = BigNumber.BigNumber = BigNumber; + + // AMD. + if (typeof undefined == 'function' && undefined.amd) { + undefined(function () { return BigNumber; }); + + // Node.js and other environments that support module.exports. + } else if ('object' != 'undefined' && module.exports) { + module.exports = BigNumber; + + // Browser. + } else { + if (!globalObject) { + globalObject = typeof self != 'undefined' && self ? self : window; + } + + globalObject.BigNumber = BigNumber; + } +})(commonjsGlobal); +}); + +var constants = createCommonjsModule(function (module, exports) { +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +class Constants { +} +Constants.SYS_NUM_CARDINAL = "builtin.num.cardinal"; +Constants.SYS_NUM_DOUBLE = "builtin.num.double"; +Constants.SYS_NUM_FRACTION = "builtin.num.fraction"; +Constants.SYS_NUM_INTEGER = "builtin.num.integer"; +Constants.SYS_NUM = "builtin.num"; +Constants.SYS_NUM_ORDINAL = "builtin.num.ordinal"; +Constants.SYS_NUM_PERCENTAGE = "builtin.num.percentage"; +// NARROW NO-BREAK SPACE +Constants.NO_BREAK_SPACE = '\u202f'; +exports.Constants = Constants; + +}); + +unwrapExports(constants); + +var models$2 = createCommonjsModule(function (module, exports) { +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); + +var NumberMode; +(function (NumberMode) { + // Default is for unit and datetime + NumberMode[NumberMode["Default"] = 0] = "Default"; + // Add 67.5 billion & million support. + NumberMode[NumberMode["Currency"] = 1] = "Currency"; + // Don't extract number from cases like 16ml + NumberMode[NumberMode["PureNumber"] = 2] = "PureNumber"; +})(NumberMode = exports.NumberMode || (exports.NumberMode = {})); +class LongFormatType { + constructor(thousandsMark, decimalsMark) { + this.thousandsMark = thousandsMark; + this.decimalsMark = decimalsMark; + } +} +// Reference : https://www.wikiwand.com/en/Decimal_mark +// Value : 1234567.89 +// 1,234,567 +LongFormatType.integerNumComma = new LongFormatType(',', '\0'); +// 1.234.567 +LongFormatType.integerNumDot = new LongFormatType('.', '\0'); +// 1 234 567 +LongFormatType.integerNumBlank = new LongFormatType(' ', '\0'); +// 1 234 567 +LongFormatType.integerNumNoBreakSpace = new LongFormatType(constants.Constants.NO_BREAK_SPACE, '\0'); +// 1'234'567 +LongFormatType.integerNumQuote = new LongFormatType('\'', '\0'); +// 1,234,567.89 +LongFormatType.doubleNumCommaDot = new LongFormatType(',', '.'); +// 1,234,567·89 +LongFormatType.doubleNumCommaCdot = new LongFormatType(',', '·'); +// 1 234 567,89 +LongFormatType.doubleNumBlankComma = new LongFormatType(' ', ','); +// 1 234 567,89 +LongFormatType.doubleNumNoBreakSpaceComma = new LongFormatType(constants.Constants.NO_BREAK_SPACE, ','); +// 1 234 567.89 +LongFormatType.doubleNumBlankDot = new LongFormatType(' ', '.'); +// 1 234 567.89 +LongFormatType.doubleNumNoBreakSpaceDot = new LongFormatType(constants.Constants.NO_BREAK_SPACE, '.'); +// 1.234.567,89 +LongFormatType.doubleNumDotComma = new LongFormatType('.', ','); +// 1'234'567,89 +LongFormatType.doubleNumQuoteComma = new LongFormatType('\'', ','); +exports.LongFormatType = LongFormatType; +class AbstractNumberModel { + constructor(parser, extractor) { + this.extractor = extractor; + this.parser = parser; + } + parse(query) { + let extractResults = this.extractor.extract(query); + let parseNums = extractResults.map(r => this.parser.parse(r)); + return parseNums + .map(o => o) + .map(o => ({ + start: o.start, + end: o.start + o.length - 1, + resolution: { value: o.resolutionStr }, + text: o.text, + typeName: this.modelTypeName + })); + } +} +exports.AbstractNumberModel = AbstractNumberModel; +class NumberModel extends AbstractNumberModel { + constructor() { + super(...arguments); + this.modelTypeName = "number"; + } +} +exports.NumberModel = NumberModel; +class OrdinalModel extends AbstractNumberModel { + constructor() { + super(...arguments); + this.modelTypeName = "ordinal"; + } +} +exports.OrdinalModel = OrdinalModel; +class PercentModel extends AbstractNumberModel { + constructor() { + super(...arguments); + this.modelTypeName = "percentage"; + } +} +exports.PercentModel = PercentModel; + +}); + +unwrapExports(models$2); + +var culture$2 = createCommonjsModule(function (module, exports) { +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); + + + + +class Culture extends recognizersText.Culture { + constructor(cultureName, cultureCode, longFormat) { + super(cultureName, cultureCode); + this.longFormat = longFormat; + } +} +Culture.supportedCultures = [ + new Culture("English", Culture.English, new models$2.LongFormatType(',', '.')), + new Culture("Chinese", Culture.Chinese, null), + new Culture("Spanish", Culture.Spanish, new models$2.LongFormatType('.', ',')), + new Culture("Portuguese", Culture.Portuguese, new models$2.LongFormatType('.', ',')), + new Culture("French", Culture.French, new models$2.LongFormatType('.', ',')), + new Culture("Japanese", Culture.Japanese, new models$2.LongFormatType(',', '.')) +]; +exports.Culture = Culture; +class CultureInfo extends recognizersText.CultureInfo { + format(value) { + let bigNumber = new bignumber.BigNumber(value); + let s; + if (bigNumber.decimalPlaces()) { + s = bigNumber.precision(15, bignumber.BigNumber.ROUND_HALF_UP).toString(); + } + else { + s = bigNumber.toString().toUpperCase(); + } + if (s.indexOf('.') > -1) { + // trim leading 0 from decimal places + s = lodash_trimend(s, '0'); + } + if (s.indexOf('e-') > -1) { + // mimic .NET behavior by adding leading 0 to exponential. E.g.: 1E-07 + let p = s.split('e-'); + p[1] = p[1].length === 1 ? ('0' + p[1]) : p[1]; + s = p.join('E-'); + } + // TODO: Use BigNumber.toFormat instead + let culture = Culture.supportedCultures.find(c => c.cultureCode === this.code); + if (culture && culture.longFormat) { + return s + .split(',') + .map(t => t.split('.').join(culture.longFormat.decimalsMark)) + .join(culture.longFormat.thousandsMark); + } + return s; + } +} +exports.CultureInfo = CultureInfo; + +}); + +unwrapExports(culture$2); + +var lodash_sortby = createCommonjsModule(function (module, exports) { +/** + * lodash (Custom Build) + * Build: `lodash modularize exports="npm" -o ./` + * Copyright jQuery Foundation and other contributors + * Released under MIT license + * Based on Underscore.js 1.8.3 + * Copyright Jeremy Ashkenas, DocumentCloud and Investigative Reporters & Editors + */ + +/** Used as the size to enable large array optimizations. */ +var LARGE_ARRAY_SIZE = 200; + +/** Used as the `TypeError` message for "Functions" methods. */ +var FUNC_ERROR_TEXT = 'Expected a function'; + +/** Used to stand-in for `undefined` hash values. */ +var HASH_UNDEFINED = '__lodash_hash_undefined__'; + +/** Used to compose bitmasks for comparison styles. */ +var UNORDERED_COMPARE_FLAG = 1, + PARTIAL_COMPARE_FLAG = 2; + +/** Used as references for various `Number` constants. */ +var INFINITY = 1 / 0, + MAX_SAFE_INTEGER = 9007199254740991; + +/** `Object#toString` result references. */ +var argsTag = '[object Arguments]', + arrayTag = '[object Array]', + boolTag = '[object Boolean]', + dateTag = '[object Date]', + errorTag = '[object Error]', + funcTag = '[object Function]', + genTag = '[object GeneratorFunction]', + mapTag = '[object Map]', + numberTag = '[object Number]', + objectTag = '[object Object]', + promiseTag = '[object Promise]', + regexpTag = '[object RegExp]', + setTag = '[object Set]', + stringTag = '[object String]', + symbolTag = '[object Symbol]', + weakMapTag = '[object WeakMap]'; + +var arrayBufferTag = '[object ArrayBuffer]', + dataViewTag = '[object DataView]', + float32Tag = '[object Float32Array]', + float64Tag = '[object Float64Array]', + int8Tag = '[object Int8Array]', + int16Tag = '[object Int16Array]', + int32Tag = '[object Int32Array]', + uint8Tag = '[object Uint8Array]', + uint8ClampedTag = '[object Uint8ClampedArray]', + uint16Tag = '[object Uint16Array]', + uint32Tag = '[object Uint32Array]'; + +/** Used to match property names within property paths. */ +var reIsDeepProp = /\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/, + reIsPlainProp = /^\w*$/, + reLeadingDot = /^\./, + rePropName = /[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g; + +/** + * Used to match `RegExp` + * [syntax characters](http://ecma-international.org/ecma-262/7.0/#sec-patterns). + */ +var reRegExpChar = /[\\^$.*+?()[\]{}|]/g; + +/** Used to match backslashes in property paths. */ +var reEscapeChar = /\\(\\)?/g; + +/** Used to detect host constructors (Safari). */ +var reIsHostCtor = /^\[object .+?Constructor\]$/; + +/** Used to detect unsigned integer values. */ +var reIsUint = /^(?:0|[1-9]\d*)$/; + +/** Used to identify `toStringTag` values of typed arrays. */ +var typedArrayTags = {}; +typedArrayTags[float32Tag] = typedArrayTags[float64Tag] = +typedArrayTags[int8Tag] = typedArrayTags[int16Tag] = +typedArrayTags[int32Tag] = typedArrayTags[uint8Tag] = +typedArrayTags[uint8ClampedTag] = typedArrayTags[uint16Tag] = +typedArrayTags[uint32Tag] = true; +typedArrayTags[argsTag] = typedArrayTags[arrayTag] = +typedArrayTags[arrayBufferTag] = typedArrayTags[boolTag] = +typedArrayTags[dataViewTag] = typedArrayTags[dateTag] = +typedArrayTags[errorTag] = typedArrayTags[funcTag] = +typedArrayTags[mapTag] = typedArrayTags[numberTag] = +typedArrayTags[objectTag] = typedArrayTags[regexpTag] = +typedArrayTags[setTag] = typedArrayTags[stringTag] = +typedArrayTags[weakMapTag] = false; + +/** Detect free variable `global` from Node.js. */ +var freeGlobal = typeof commonjsGlobal == 'object' && commonjsGlobal && commonjsGlobal.Object === Object && commonjsGlobal; + +/** Detect free variable `self`. */ +var freeSelf = typeof self == 'object' && self && self.Object === Object && self; + +/** Used as a reference to the global object. */ +var root = freeGlobal || freeSelf || Function('return this')(); + +/** Detect free variable `exports`. */ +var freeExports = 'object' == 'object' && exports && !exports.nodeType && exports; + +/** Detect free variable `module`. */ +var freeModule = freeExports && 'object' == 'object' && module && !module.nodeType && module; + +/** Detect the popular CommonJS extension `module.exports`. */ +var moduleExports = freeModule && freeModule.exports === freeExports; + +/** Detect free variable `process` from Node.js. */ +var freeProcess = moduleExports && freeGlobal.process; + +/** Used to access faster Node.js helpers. */ +var nodeUtil = (function() { + try { + return freeProcess && freeProcess.binding('util'); + } catch (e) {} +}()); + +/* Node.js helper references. */ +var nodeIsTypedArray = nodeUtil && nodeUtil.isTypedArray; + +/** + * A faster alternative to `Function#apply`, this function invokes `func` + * with the `this` binding of `thisArg` and the arguments of `args`. + * + * @private + * @param {Function} func The function to invoke. + * @param {*} thisArg The `this` binding of `func`. + * @param {Array} args The arguments to invoke `func` with. + * @returns {*} Returns the result of `func`. + */ +function apply(func, thisArg, args) { + switch (args.length) { + case 0: return func.call(thisArg); + case 1: return func.call(thisArg, args[0]); + case 2: return func.call(thisArg, args[0], args[1]); + case 3: return func.call(thisArg, args[0], args[1], args[2]); + } + return func.apply(thisArg, args); +} + +/** + * A specialized version of `_.map` for arrays without support for iteratee + * shorthands. + * + * @private + * @param {Array} [array] The array to iterate over. + * @param {Function} iteratee The function invoked per iteration. + * @returns {Array} Returns the new mapped array. + */ +function arrayMap(array, iteratee) { + var index = -1, + length = array ? array.length : 0, + result = Array(length); + + while (++index < length) { + result[index] = iteratee(array[index], index, array); + } + return result; +} + +/** + * Appends the elements of `values` to `array`. + * + * @private + * @param {Array} array The array to modify. + * @param {Array} values The values to append. + * @returns {Array} Returns `array`. + */ +function arrayPush(array, values) { + var index = -1, + length = values.length, + offset = array.length; + + while (++index < length) { + array[offset + index] = values[index]; + } + return array; +} + +/** + * A specialized version of `_.some` for arrays without support for iteratee + * shorthands. + * + * @private + * @param {Array} [array] The array to iterate over. + * @param {Function} predicate The function invoked per iteration. + * @returns {boolean} Returns `true` if any element passes the predicate check, + * else `false`. + */ +function arraySome(array, predicate) { + var index = -1, + length = array ? array.length : 0; + + while (++index < length) { + if (predicate(array[index], index, array)) { + return true; + } + } + return false; +} + +/** + * The base implementation of `_.property` without support for deep paths. + * + * @private + * @param {string} key The key of the property to get. + * @returns {Function} Returns the new accessor function. + */ +function baseProperty(key) { + return function(object) { + return object == null ? undefined : object[key]; + }; +} + +/** + * The base implementation of `_.sortBy` which uses `comparer` to define the + * sort order of `array` and replaces criteria objects with their corresponding + * values. + * + * @private + * @param {Array} array The array to sort. + * @param {Function} comparer The function to define sort order. + * @returns {Array} Returns `array`. + */ +function baseSortBy(array, comparer) { + var length = array.length; + + array.sort(comparer); + while (length--) { + array[length] = array[length].value; + } + return array; +} + +/** + * The base implementation of `_.times` without support for iteratee shorthands + * or max array length checks. + * + * @private + * @param {number} n The number of times to invoke `iteratee`. + * @param {Function} iteratee The function invoked per iteration. + * @returns {Array} Returns the array of results. + */ +function baseTimes(n, iteratee) { + var index = -1, + result = Array(n); + + while (++index < n) { + result[index] = iteratee(index); + } + return result; +} + +/** + * The base implementation of `_.unary` without support for storing metadata. + * + * @private + * @param {Function} func The function to cap arguments for. + * @returns {Function} Returns the new capped function. + */ +function baseUnary(func) { + return function(value) { + return func(value); + }; +} + +/** + * Gets the value at `key` of `object`. + * + * @private + * @param {Object} [object] The object to query. + * @param {string} key The key of the property to get. + * @returns {*} Returns the property value. + */ +function getValue(object, key) { + return object == null ? undefined : object[key]; +} + +/** + * Checks if `value` is a host object in IE < 9. + * + * @private + * @param {*} value The value to check. + * @returns {boolean} Returns `true` if `value` is a host object, else `false`. + */ +function isHostObject(value) { + // Many host objects are `Object` objects that can coerce to strings + // despite having improperly defined `toString` methods. + var result = false; + if (value != null && typeof value.toString != 'function') { + try { + result = !!(value + ''); + } catch (e) {} + } + return result; +} + +/** + * Converts `map` to its key-value pairs. + * + * @private + * @param {Object} map The map to convert. + * @returns {Array} Returns the key-value pairs. + */ +function mapToArray(map) { + var index = -1, + result = Array(map.size); + + map.forEach(function(value, key) { + result[++index] = [key, value]; + }); + return result; +} + +/** + * Creates a unary function that invokes `func` with its argument transformed. + * + * @private + * @param {Function} func The function to wrap. + * @param {Function} transform The argument transform. + * @returns {Function} Returns the new function. + */ +function overArg(func, transform) { + return function(arg) { + return func(transform(arg)); + }; +} + +/** + * Converts `set` to an array of its values. + * + * @private + * @param {Object} set The set to convert. + * @returns {Array} Returns the values. + */ +function setToArray(set) { + var index = -1, + result = Array(set.size); + + set.forEach(function(value) { + result[++index] = value; + }); + return result; +} + +/** Used for built-in method references. */ +var arrayProto = Array.prototype, + funcProto = Function.prototype, + objectProto = Object.prototype; + +/** Used to detect overreaching core-js shims. */ +var coreJsData = root['__core-js_shared__']; + +/** Used to detect methods masquerading as native. */ +var maskSrcKey = (function() { + var uid = /[^.]+$/.exec(coreJsData && coreJsData.keys && coreJsData.keys.IE_PROTO || ''); + return uid ? ('Symbol(src)_1.' + uid) : ''; +}()); + +/** Used to resolve the decompiled source of functions. */ +var funcToString = funcProto.toString; + +/** Used to check objects for own properties. */ +var hasOwnProperty = objectProto.hasOwnProperty; + +/** + * Used to resolve the + * [`toStringTag`](http://ecma-international.org/ecma-262/7.0/#sec-object.prototype.tostring) + * of values. + */ +var objectToString = objectProto.toString; + +/** Used to detect if a method is native. */ +var reIsNative = RegExp('^' + + funcToString.call(hasOwnProperty).replace(reRegExpChar, '\\$&') + .replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g, '$1.*?') + '$' +); + +/** Built-in value references. */ +var Symbol = root.Symbol, + Uint8Array = root.Uint8Array, + propertyIsEnumerable = objectProto.propertyIsEnumerable, + splice = arrayProto.splice, + spreadableSymbol = Symbol ? Symbol.isConcatSpreadable : undefined; + +/* Built-in method references for those with the same name as other `lodash` methods. */ +var nativeKeys = overArg(Object.keys, Object), + nativeMax = Math.max; + +/* Built-in method references that are verified to be native. */ +var DataView = getNative(root, 'DataView'), + Map = getNative(root, 'Map'), + Promise = getNative(root, 'Promise'), + Set = getNative(root, 'Set'), + WeakMap = getNative(root, 'WeakMap'), + nativeCreate = getNative(Object, 'create'); + +/** Used to detect maps, sets, and weakmaps. */ +var dataViewCtorString = toSource(DataView), + mapCtorString = toSource(Map), + promiseCtorString = toSource(Promise), + setCtorString = toSource(Set), + weakMapCtorString = toSource(WeakMap); + +/** Used to convert symbols to primitives and strings. */ +var symbolProto = Symbol ? Symbol.prototype : undefined, + symbolValueOf = symbolProto ? symbolProto.valueOf : undefined, + symbolToString = symbolProto ? symbolProto.toString : undefined; + +/** + * Creates a hash object. + * + * @private + * @constructor + * @param {Array} [entries] The key-value pairs to cache. + */ +function Hash(entries) { + var index = -1, + length = entries ? entries.length : 0; + + this.clear(); + while (++index < length) { + var entry = entries[index]; + this.set(entry[0], entry[1]); + } +} + +/** + * Removes all key-value entries from the hash. + * + * @private + * @name clear + * @memberOf Hash + */ +function hashClear() { + this.__data__ = nativeCreate ? nativeCreate(null) : {}; +} + +/** + * Removes `key` and its value from the hash. + * + * @private + * @name delete + * @memberOf Hash + * @param {Object} hash The hash to modify. + * @param {string} key The key of the value to remove. + * @returns {boolean} Returns `true` if the entry was removed, else `false`. + */ +function hashDelete(key) { + return this.has(key) && delete this.__data__[key]; +} + +/** + * Gets the hash value for `key`. + * + * @private + * @name get + * @memberOf Hash + * @param {string} key The key of the value to get. + * @returns {*} Returns the entry value. + */ +function hashGet(key) { + var data = this.__data__; + if (nativeCreate) { + var result = data[key]; + return result === HASH_UNDEFINED ? undefined : result; + } + return hasOwnProperty.call(data, key) ? data[key] : undefined; +} + +/** + * Checks if a hash value for `key` exists. + * + * @private + * @name has + * @memberOf Hash + * @param {string} key The key of the entry to check. + * @returns {boolean} Returns `true` if an entry for `key` exists, else `false`. + */ +function hashHas(key) { + var data = this.__data__; + return nativeCreate ? data[key] !== undefined : hasOwnProperty.call(data, key); +} + +/** + * Sets the hash `key` to `value`. + * + * @private + * @name set + * @memberOf Hash + * @param {string} key The key of the value to set. + * @param {*} value The value to set. + * @returns {Object} Returns the hash instance. + */ +function hashSet(key, value) { + var data = this.__data__; + data[key] = (nativeCreate && value === undefined) ? HASH_UNDEFINED : value; + return this; +} + +// Add methods to `Hash`. +Hash.prototype.clear = hashClear; +Hash.prototype['delete'] = hashDelete; +Hash.prototype.get = hashGet; +Hash.prototype.has = hashHas; +Hash.prototype.set = hashSet; + +/** + * Creates an list cache object. + * + * @private + * @constructor + * @param {Array} [entries] The key-value pairs to cache. + */ +function ListCache(entries) { + var index = -1, + length = entries ? entries.length : 0; + + this.clear(); + while (++index < length) { + var entry = entries[index]; + this.set(entry[0], entry[1]); + } +} + +/** + * Removes all key-value entries from the list cache. + * + * @private + * @name clear + * @memberOf ListCache + */ +function listCacheClear() { + this.__data__ = []; +} + +/** + * Removes `key` and its value from the list cache. + * + * @private + * @name delete + * @memberOf ListCache + * @param {string} key The key of the value to remove. + * @returns {boolean} Returns `true` if the entry was removed, else `false`. + */ +function listCacheDelete(key) { + var data = this.__data__, + index = assocIndexOf(data, key); + + if (index < 0) { + return false; + } + var lastIndex = data.length - 1; + if (index == lastIndex) { + data.pop(); + } else { + splice.call(data, index, 1); + } + return true; +} + +/** + * Gets the list cache value for `key`. + * + * @private + * @name get + * @memberOf ListCache + * @param {string} key The key of the value to get. + * @returns {*} Returns the entry value. + */ +function listCacheGet(key) { + var data = this.__data__, + index = assocIndexOf(data, key); + + return index < 0 ? undefined : data[index][1]; +} + +/** + * Checks if a list cache value for `key` exists. + * + * @private + * @name has + * @memberOf ListCache + * @param {string} key The key of the entry to check. + * @returns {boolean} Returns `true` if an entry for `key` exists, else `false`. + */ +function listCacheHas(key) { + return assocIndexOf(this.__data__, key) > -1; +} + +/** + * Sets the list cache `key` to `value`. + * + * @private + * @name set + * @memberOf ListCache + * @param {string} key The key of the value to set. + * @param {*} value The value to set. + * @returns {Object} Returns the list cache instance. + */ +function listCacheSet(key, value) { + var data = this.__data__, + index = assocIndexOf(data, key); + + if (index < 0) { + data.push([key, value]); + } else { + data[index][1] = value; + } + return this; +} + +// Add methods to `ListCache`. +ListCache.prototype.clear = listCacheClear; +ListCache.prototype['delete'] = listCacheDelete; +ListCache.prototype.get = listCacheGet; +ListCache.prototype.has = listCacheHas; +ListCache.prototype.set = listCacheSet; + +/** + * Creates a map cache object to store key-value pairs. + * + * @private + * @constructor + * @param {Array} [entries] The key-value pairs to cache. + */ +function MapCache(entries) { + var index = -1, + length = entries ? entries.length : 0; + + this.clear(); + while (++index < length) { + var entry = entries[index]; + this.set(entry[0], entry[1]); + } +} + +/** + * Removes all key-value entries from the map. + * + * @private + * @name clear + * @memberOf MapCache + */ +function mapCacheClear() { + this.__data__ = { + 'hash': new Hash, + 'map': new (Map || ListCache), + 'string': new Hash + }; +} + +/** + * Removes `key` and its value from the map. + * + * @private + * @name delete + * @memberOf MapCache + * @param {string} key The key of the value to remove. + * @returns {boolean} Returns `true` if the entry was removed, else `false`. + */ +function mapCacheDelete(key) { + return getMapData(this, key)['delete'](key); +} + +/** + * Gets the map value for `key`. + * + * @private + * @name get + * @memberOf MapCache + * @param {string} key The key of the value to get. + * @returns {*} Returns the entry value. + */ +function mapCacheGet(key) { + return getMapData(this, key).get(key); +} + +/** + * Checks if a map value for `key` exists. + * + * @private + * @name has + * @memberOf MapCache + * @param {string} key The key of the entry to check. + * @returns {boolean} Returns `true` if an entry for `key` exists, else `false`. + */ +function mapCacheHas(key) { + return getMapData(this, key).has(key); +} + +/** + * Sets the map `key` to `value`. + * + * @private + * @name set + * @memberOf MapCache + * @param {string} key The key of the value to set. + * @param {*} value The value to set. + * @returns {Object} Returns the map cache instance. + */ +function mapCacheSet(key, value) { + getMapData(this, key).set(key, value); + return this; +} + +// Add methods to `MapCache`. +MapCache.prototype.clear = mapCacheClear; +MapCache.prototype['delete'] = mapCacheDelete; +MapCache.prototype.get = mapCacheGet; +MapCache.prototype.has = mapCacheHas; +MapCache.prototype.set = mapCacheSet; + +/** + * + * Creates an array cache object to store unique values. + * + * @private + * @constructor + * @param {Array} [values] The values to cache. + */ +function SetCache(values) { + var index = -1, + length = values ? values.length : 0; + + this.__data__ = new MapCache; + while (++index < length) { + this.add(values[index]); + } +} + +/** + * Adds `value` to the array cache. + * + * @private + * @name add + * @memberOf SetCache + * @alias push + * @param {*} value The value to cache. + * @returns {Object} Returns the cache instance. + */ +function setCacheAdd(value) { + this.__data__.set(value, HASH_UNDEFINED); + return this; +} + +/** + * Checks if `value` is in the array cache. + * + * @private + * @name has + * @memberOf SetCache + * @param {*} value The value to search for. + * @returns {number} Returns `true` if `value` is found, else `false`. + */ +function setCacheHas(value) { + return this.__data__.has(value); +} + +// Add methods to `SetCache`. +SetCache.prototype.add = SetCache.prototype.push = setCacheAdd; +SetCache.prototype.has = setCacheHas; + +/** + * Creates a stack cache object to store key-value pairs. + * + * @private + * @constructor + * @param {Array} [entries] The key-value pairs to cache. + */ +function Stack(entries) { + this.__data__ = new ListCache(entries); +} + +/** + * Removes all key-value entries from the stack. + * + * @private + * @name clear + * @memberOf Stack + */ +function stackClear() { + this.__data__ = new ListCache; +} + +/** + * Removes `key` and its value from the stack. + * + * @private + * @name delete + * @memberOf Stack + * @param {string} key The key of the value to remove. + * @returns {boolean} Returns `true` if the entry was removed, else `false`. + */ +function stackDelete(key) { + return this.__data__['delete'](key); +} + +/** + * Gets the stack value for `key`. + * + * @private + * @name get + * @memberOf Stack + * @param {string} key The key of the value to get. + * @returns {*} Returns the entry value. + */ +function stackGet(key) { + return this.__data__.get(key); +} + +/** + * Checks if a stack value for `key` exists. + * + * @private + * @name has + * @memberOf Stack + * @param {string} key The key of the entry to check. + * @returns {boolean} Returns `true` if an entry for `key` exists, else `false`. + */ +function stackHas(key) { + return this.__data__.has(key); +} + +/** + * Sets the stack `key` to `value`. + * + * @private + * @name set + * @memberOf Stack + * @param {string} key The key of the value to set. + * @param {*} value The value to set. + * @returns {Object} Returns the stack cache instance. + */ +function stackSet(key, value) { + var cache = this.__data__; + if (cache instanceof ListCache) { + var pairs = cache.__data__; + if (!Map || (pairs.length < LARGE_ARRAY_SIZE - 1)) { + pairs.push([key, value]); + return this; + } + cache = this.__data__ = new MapCache(pairs); + } + cache.set(key, value); + return this; +} + +// Add methods to `Stack`. +Stack.prototype.clear = stackClear; +Stack.prototype['delete'] = stackDelete; +Stack.prototype.get = stackGet; +Stack.prototype.has = stackHas; +Stack.prototype.set = stackSet; + +/** + * Creates an array of the enumerable property names of the array-like `value`. + * + * @private + * @param {*} value The value to query. + * @param {boolean} inherited Specify returning inherited property names. + * @returns {Array} Returns the array of property names. + */ +function arrayLikeKeys(value, inherited) { + // Safari 8.1 makes `arguments.callee` enumerable in strict mode. + // Safari 9 makes `arguments.length` enumerable in strict mode. + var result = (isArray(value) || isArguments(value)) + ? baseTimes(value.length, String) + : []; + + var length = result.length, + skipIndexes = !!length; + + for (var key in value) { + if ((inherited || hasOwnProperty.call(value, key)) && + !(skipIndexes && (key == 'length' || isIndex(key, length)))) { + result.push(key); + } + } + return result; +} + +/** + * Gets the index at which the `key` is found in `array` of key-value pairs. + * + * @private + * @param {Array} array The array to inspect. + * @param {*} key The key to search for. + * @returns {number} Returns the index of the matched value, else `-1`. + */ +function assocIndexOf(array, key) { + var length = array.length; + while (length--) { + if (eq(array[length][0], key)) { + return length; + } + } + return -1; +} + +/** + * The base implementation of `_.forEach` without support for iteratee shorthands. + * + * @private + * @param {Array|Object} collection The collection to iterate over. + * @param {Function} iteratee The function invoked per iteration. + * @returns {Array|Object} Returns `collection`. + */ +var baseEach = createBaseEach(baseForOwn); + +/** + * The base implementation of `_.flatten` with support for restricting flattening. + * + * @private + * @param {Array} array The array to flatten. + * @param {number} depth The maximum recursion depth. + * @param {boolean} [predicate=isFlattenable] The function invoked per iteration. + * @param {boolean} [isStrict] Restrict to values that pass `predicate` checks. + * @param {Array} [result=[]] The initial result value. + * @returns {Array} Returns the new flattened array. + */ +function baseFlatten(array, depth, predicate, isStrict, result) { + var index = -1, + length = array.length; + + predicate || (predicate = isFlattenable); + result || (result = []); + + while (++index < length) { + var value = array[index]; + if (depth > 0 && predicate(value)) { + if (depth > 1) { + // Recursively flatten arrays (susceptible to call stack limits). + baseFlatten(value, depth - 1, predicate, isStrict, result); + } else { + arrayPush(result, value); + } + } else if (!isStrict) { + result[result.length] = value; + } + } + return result; +} + +/** + * The base implementation of `baseForOwn` which iterates over `object` + * properties returned by `keysFunc` and invokes `iteratee` for each property. + * Iteratee functions may exit iteration early by explicitly returning `false`. + * + * @private + * @param {Object} object The object to iterate over. + * @param {Function} iteratee The function invoked per iteration. + * @param {Function} keysFunc The function to get the keys of `object`. + * @returns {Object} Returns `object`. + */ +var baseFor = createBaseFor(); + +/** + * The base implementation of `_.forOwn` without support for iteratee shorthands. + * + * @private + * @param {Object} object The object to iterate over. + * @param {Function} iteratee The function invoked per iteration. + * @returns {Object} Returns `object`. + */ +function baseForOwn(object, iteratee) { + return object && baseFor(object, iteratee, keys); +} + +/** + * The base implementation of `_.get` without support for default values. + * + * @private + * @param {Object} object The object to query. + * @param {Array|string} path The path of the property to get. + * @returns {*} Returns the resolved value. + */ +function baseGet(object, path) { + path = isKey(path, object) ? [path] : castPath(path); + + var index = 0, + length = path.length; + + while (object != null && index < length) { + object = object[toKey(path[index++])]; + } + return (index && index == length) ? object : undefined; +} + +/** + * The base implementation of `getTag`. + * + * @private + * @param {*} value The value to query. + * @returns {string} Returns the `toStringTag`. + */ +function baseGetTag(value) { + return objectToString.call(value); +} + +/** + * The base implementation of `_.hasIn` without support for deep paths. + * + * @private + * @param {Object} [object] The object to query. + * @param {Array|string} key The key to check. + * @returns {boolean} Returns `true` if `key` exists, else `false`. + */ +function baseHasIn(object, key) { + return object != null && key in Object(object); +} + +/** + * The base implementation of `_.isEqual` which supports partial comparisons + * and tracks traversed objects. + * + * @private + * @param {*} value The value to compare. + * @param {*} other The other value to compare. + * @param {Function} [customizer] The function to customize comparisons. + * @param {boolean} [bitmask] The bitmask of comparison flags. + * The bitmask may be composed of the following flags: + * 1 - Unordered comparison + * 2 - Partial comparison + * @param {Object} [stack] Tracks traversed `value` and `other` objects. + * @returns {boolean} Returns `true` if the values are equivalent, else `false`. + */ +function baseIsEqual(value, other, customizer, bitmask, stack) { + if (value === other) { + return true; + } + if (value == null || other == null || (!isObject(value) && !isObjectLike(other))) { + return value !== value && other !== other; + } + return baseIsEqualDeep(value, other, baseIsEqual, customizer, bitmask, stack); +} + +/** + * A specialized version of `baseIsEqual` for arrays and objects which performs + * deep comparisons and tracks traversed objects enabling objects with circular + * references to be compared. + * + * @private + * @param {Object} object The object to compare. + * @param {Object} other The other object to compare. + * @param {Function} equalFunc The function to determine equivalents of values. + * @param {Function} [customizer] The function to customize comparisons. + * @param {number} [bitmask] The bitmask of comparison flags. See `baseIsEqual` + * for more details. + * @param {Object} [stack] Tracks traversed `object` and `other` objects. + * @returns {boolean} Returns `true` if the objects are equivalent, else `false`. + */ +function baseIsEqualDeep(object, other, equalFunc, customizer, bitmask, stack) { + var objIsArr = isArray(object), + othIsArr = isArray(other), + objTag = arrayTag, + othTag = arrayTag; + + if (!objIsArr) { + objTag = getTag(object); + objTag = objTag == argsTag ? objectTag : objTag; + } + if (!othIsArr) { + othTag = getTag(other); + othTag = othTag == argsTag ? objectTag : othTag; + } + var objIsObj = objTag == objectTag && !isHostObject(object), + othIsObj = othTag == objectTag && !isHostObject(other), + isSameTag = objTag == othTag; + + if (isSameTag && !objIsObj) { + stack || (stack = new Stack); + return (objIsArr || isTypedArray(object)) + ? equalArrays(object, other, equalFunc, customizer, bitmask, stack) + : equalByTag(object, other, objTag, equalFunc, customizer, bitmask, stack); + } + if (!(bitmask & PARTIAL_COMPARE_FLAG)) { + var objIsWrapped = objIsObj && hasOwnProperty.call(object, '__wrapped__'), + othIsWrapped = othIsObj && hasOwnProperty.call(other, '__wrapped__'); + + if (objIsWrapped || othIsWrapped) { + var objUnwrapped = objIsWrapped ? object.value() : object, + othUnwrapped = othIsWrapped ? other.value() : other; + + stack || (stack = new Stack); + return equalFunc(objUnwrapped, othUnwrapped, customizer, bitmask, stack); + } + } + if (!isSameTag) { + return false; + } + stack || (stack = new Stack); + return equalObjects(object, other, equalFunc, customizer, bitmask, stack); +} + +/** + * The base implementation of `_.isMatch` without support for iteratee shorthands. + * + * @private + * @param {Object} object The object to inspect. + * @param {Object} source The object of property values to match. + * @param {Array} matchData The property names, values, and compare flags to match. + * @param {Function} [customizer] The function to customize comparisons. + * @returns {boolean} Returns `true` if `object` is a match, else `false`. + */ +function baseIsMatch(object, source, matchData, customizer) { + var index = matchData.length, + length = index, + noCustomizer = !customizer; + + if (object == null) { + return !length; + } + object = Object(object); + while (index--) { + var data = matchData[index]; + if ((noCustomizer && data[2]) + ? data[1] !== object[data[0]] + : !(data[0] in object) + ) { + return false; + } + } + while (++index < length) { + data = matchData[index]; + var key = data[0], + objValue = object[key], + srcValue = data[1]; + + if (noCustomizer && data[2]) { + if (objValue === undefined && !(key in object)) { + return false; + } + } else { + var stack = new Stack; + if (customizer) { + var result = customizer(objValue, srcValue, key, object, source, stack); + } + if (!(result === undefined + ? baseIsEqual(srcValue, objValue, customizer, UNORDERED_COMPARE_FLAG | PARTIAL_COMPARE_FLAG, stack) + : result + )) { + return false; + } + } + } + return true; +} + +/** + * The base implementation of `_.isNative` without bad shim checks. + * + * @private + * @param {*} value The value to check. + * @returns {boolean} Returns `true` if `value` is a native function, + * else `false`. + */ +function baseIsNative(value) { + if (!isObject(value) || isMasked(value)) { + return false; + } + var pattern = (isFunction(value) || isHostObject(value)) ? reIsNative : reIsHostCtor; + return pattern.test(toSource(value)); +} + +/** + * The base implementation of `_.isTypedArray` without Node.js optimizations. + * + * @private + * @param {*} value The value to check. + * @returns {boolean} Returns `true` if `value` is a typed array, else `false`. + */ +function baseIsTypedArray(value) { + return isObjectLike(value) && + isLength(value.length) && !!typedArrayTags[objectToString.call(value)]; +} + +/** + * The base implementation of `_.iteratee`. + * + * @private + * @param {*} [value=_.identity] The value to convert to an iteratee. + * @returns {Function} Returns the iteratee. + */ +function baseIteratee(value) { + // Don't store the `typeof` result in a variable to avoid a JIT bug in Safari 9. + // See https://bugs.webkit.org/show_bug.cgi?id=156034 for more details. + if (typeof value == 'function') { + return value; + } + if (value == null) { + return identity; + } + if (typeof value == 'object') { + return isArray(value) + ? baseMatchesProperty(value[0], value[1]) + : baseMatches(value); + } + return property(value); +} + +/** + * The base implementation of `_.keys` which doesn't treat sparse arrays as dense. + * + * @private + * @param {Object} object The object to query. + * @returns {Array} Returns the array of property names. + */ +function baseKeys(object) { + if (!isPrototype(object)) { + return nativeKeys(object); + } + var result = []; + for (var key in Object(object)) { + if (hasOwnProperty.call(object, key) && key != 'constructor') { + result.push(key); + } + } + return result; +} + +/** + * The base implementation of `_.map` without support for iteratee shorthands. + * + * @private + * @param {Array|Object} collection The collection to iterate over. + * @param {Function} iteratee The function invoked per iteration. + * @returns {Array} Returns the new mapped array. + */ +function baseMap(collection, iteratee) { + var index = -1, + result = isArrayLike(collection) ? Array(collection.length) : []; + + baseEach(collection, function(value, key, collection) { + result[++index] = iteratee(value, key, collection); + }); + return result; +} + +/** + * The base implementation of `_.matches` which doesn't clone `source`. + * + * @private + * @param {Object} source The object of property values to match. + * @returns {Function} Returns the new spec function. + */ +function baseMatches(source) { + var matchData = getMatchData(source); + if (matchData.length == 1 && matchData[0][2]) { + return matchesStrictComparable(matchData[0][0], matchData[0][1]); + } + return function(object) { + return object === source || baseIsMatch(object, source, matchData); + }; +} + +/** + * The base implementation of `_.matchesProperty` which doesn't clone `srcValue`. + * + * @private + * @param {string} path The path of the property to get. + * @param {*} srcValue The value to match. + * @returns {Function} Returns the new spec function. + */ +function baseMatchesProperty(path, srcValue) { + if (isKey(path) && isStrictComparable(srcValue)) { + return matchesStrictComparable(toKey(path), srcValue); + } + return function(object) { + var objValue = get(object, path); + return (objValue === undefined && objValue === srcValue) + ? hasIn(object, path) + : baseIsEqual(srcValue, objValue, undefined, UNORDERED_COMPARE_FLAG | PARTIAL_COMPARE_FLAG); + }; +} + +/** + * The base implementation of `_.orderBy` without param guards. + * + * @private + * @param {Array|Object} collection The collection to iterate over. + * @param {Function[]|Object[]|string[]} iteratees The iteratees to sort by. + * @param {string[]} orders The sort orders of `iteratees`. + * @returns {Array} Returns the new sorted array. + */ +function baseOrderBy(collection, iteratees, orders) { + var index = -1; + iteratees = arrayMap(iteratees.length ? iteratees : [identity], baseUnary(baseIteratee)); + + var result = baseMap(collection, function(value, key, collection) { + var criteria = arrayMap(iteratees, function(iteratee) { + return iteratee(value); + }); + return { 'criteria': criteria, 'index': ++index, 'value': value }; + }); + + return baseSortBy(result, function(object, other) { + return compareMultiple(object, other, orders); + }); +} + +/** + * A specialized version of `baseProperty` which supports deep paths. + * + * @private + * @param {Array|string} path The path of the property to get. + * @returns {Function} Returns the new accessor function. + */ +function basePropertyDeep(path) { + return function(object) { + return baseGet(object, path); + }; +} + +/** + * The base implementation of `_.rest` which doesn't validate or coerce arguments. + * + * @private + * @param {Function} func The function to apply a rest parameter to. + * @param {number} [start=func.length-1] The start position of the rest parameter. + * @returns {Function} Returns the new function. + */ +function baseRest(func, start) { + start = nativeMax(start === undefined ? (func.length - 1) : start, 0); + return function() { + var args = arguments, + index = -1, + length = nativeMax(args.length - start, 0), + array = Array(length); + + while (++index < length) { + array[index] = args[start + index]; + } + index = -1; + var otherArgs = Array(start + 1); + while (++index < start) { + otherArgs[index] = args[index]; + } + otherArgs[start] = array; + return apply(func, this, otherArgs); + }; +} + +/** + * The base implementation of `_.toString` which doesn't convert nullish + * values to empty strings. + * + * @private + * @param {*} value The value to process. + * @returns {string} Returns the string. + */ +function baseToString(value) { + // Exit early for strings to avoid a performance hit in some environments. + if (typeof value == 'string') { + return value; + } + if (isSymbol(value)) { + return symbolToString ? symbolToString.call(value) : ''; + } + var result = (value + ''); + return (result == '0' && (1 / value) == -INFINITY) ? '-0' : result; +} + +/** + * Casts `value` to a path array if it's not one. + * + * @private + * @param {*} value The value to inspect. + * @returns {Array} Returns the cast property path array. + */ +function castPath(value) { + return isArray(value) ? value : stringToPath(value); +} + +/** + * Compares values to sort them in ascending order. + * + * @private + * @param {*} value The value to compare. + * @param {*} other The other value to compare. + * @returns {number} Returns the sort order indicator for `value`. + */ +function compareAscending(value, other) { + if (value !== other) { + var valIsDefined = value !== undefined, + valIsNull = value === null, + valIsReflexive = value === value, + valIsSymbol = isSymbol(value); + + var othIsDefined = other !== undefined, + othIsNull = other === null, + othIsReflexive = other === other, + othIsSymbol = isSymbol(other); + + if ((!othIsNull && !othIsSymbol && !valIsSymbol && value > other) || + (valIsSymbol && othIsDefined && othIsReflexive && !othIsNull && !othIsSymbol) || + (valIsNull && othIsDefined && othIsReflexive) || + (!valIsDefined && othIsReflexive) || + !valIsReflexive) { + return 1; + } + if ((!valIsNull && !valIsSymbol && !othIsSymbol && value < other) || + (othIsSymbol && valIsDefined && valIsReflexive && !valIsNull && !valIsSymbol) || + (othIsNull && valIsDefined && valIsReflexive) || + (!othIsDefined && valIsReflexive) || + !othIsReflexive) { + return -1; + } + } + return 0; +} + +/** + * Used by `_.orderBy` to compare multiple properties of a value to another + * and stable sort them. + * + * If `orders` is unspecified, all values are sorted in ascending order. Otherwise, + * specify an order of "desc" for descending or "asc" for ascending sort order + * of corresponding values. + * + * @private + * @param {Object} object The object to compare. + * @param {Object} other The other object to compare. + * @param {boolean[]|string[]} orders The order to sort by for each property. + * @returns {number} Returns the sort order indicator for `object`. + */ +function compareMultiple(object, other, orders) { + var index = -1, + objCriteria = object.criteria, + othCriteria = other.criteria, + length = objCriteria.length, + ordersLength = orders.length; + + while (++index < length) { + var result = compareAscending(objCriteria[index], othCriteria[index]); + if (result) { + if (index >= ordersLength) { + return result; + } + var order = orders[index]; + return result * (order == 'desc' ? -1 : 1); + } + } + // Fixes an `Array#sort` bug in the JS engine embedded in Adobe applications + // that causes it, under certain circumstances, to provide the same value for + // `object` and `other`. See https://github.com/jashkenas/underscore/pull/1247 + // for more details. + // + // This also ensures a stable sort in V8 and other engines. + // See https://bugs.chromium.org/p/v8/issues/detail?id=90 for more details. + return object.index - other.index; +} + +/** + * Creates a `baseEach` or `baseEachRight` function. + * + * @private + * @param {Function} eachFunc The function to iterate over a collection. + * @param {boolean} [fromRight] Specify iterating from right to left. + * @returns {Function} Returns the new base function. + */ +function createBaseEach(eachFunc, fromRight) { + return function(collection, iteratee) { + if (collection == null) { + return collection; + } + if (!isArrayLike(collection)) { + return eachFunc(collection, iteratee); + } + var length = collection.length, + index = fromRight ? length : -1, + iterable = Object(collection); + + while ((fromRight ? index-- : ++index < length)) { + if (iteratee(iterable[index], index, iterable) === false) { + break; + } + } + return collection; + }; +} + +/** + * Creates a base function for methods like `_.forIn` and `_.forOwn`. + * + * @private + * @param {boolean} [fromRight] Specify iterating from right to left. + * @returns {Function} Returns the new base function. + */ +function createBaseFor(fromRight) { + return function(object, iteratee, keysFunc) { + var index = -1, + iterable = Object(object), + props = keysFunc(object), + length = props.length; + + while (length--) { + var key = props[fromRight ? length : ++index]; + if (iteratee(iterable[key], key, iterable) === false) { + break; + } + } + return object; + }; +} + +/** + * A specialized version of `baseIsEqualDeep` for arrays with support for + * partial deep comparisons. + * + * @private + * @param {Array} array The array to compare. + * @param {Array} other The other array to compare. + * @param {Function} equalFunc The function to determine equivalents of values. + * @param {Function} customizer The function to customize comparisons. + * @param {number} bitmask The bitmask of comparison flags. See `baseIsEqual` + * for more details. + * @param {Object} stack Tracks traversed `array` and `other` objects. + * @returns {boolean} Returns `true` if the arrays are equivalent, else `false`. + */ +function equalArrays(array, other, equalFunc, customizer, bitmask, stack) { + var isPartial = bitmask & PARTIAL_COMPARE_FLAG, + arrLength = array.length, + othLength = other.length; + + if (arrLength != othLength && !(isPartial && othLength > arrLength)) { + return false; + } + // Assume cyclic values are equal. + var stacked = stack.get(array); + if (stacked && stack.get(other)) { + return stacked == other; + } + var index = -1, + result = true, + seen = (bitmask & UNORDERED_COMPARE_FLAG) ? new SetCache : undefined; + + stack.set(array, other); + stack.set(other, array); + + // Ignore non-index properties. + while (++index < arrLength) { + var arrValue = array[index], + othValue = other[index]; + + if (customizer) { + var compared = isPartial + ? customizer(othValue, arrValue, index, other, array, stack) + : customizer(arrValue, othValue, index, array, other, stack); + } + if (compared !== undefined) { + if (compared) { + continue; + } + result = false; + break; + } + // Recursively compare arrays (susceptible to call stack limits). + if (seen) { + if (!arraySome(other, function(othValue, othIndex) { + if (!seen.has(othIndex) && + (arrValue === othValue || equalFunc(arrValue, othValue, customizer, bitmask, stack))) { + return seen.add(othIndex); + } + })) { + result = false; + break; + } + } else if (!( + arrValue === othValue || + equalFunc(arrValue, othValue, customizer, bitmask, stack) + )) { + result = false; + break; + } + } + stack['delete'](array); + stack['delete'](other); + return result; +} + +/** + * A specialized version of `baseIsEqualDeep` for comparing objects of + * the same `toStringTag`. + * + * **Note:** This function only supports comparing values with tags of + * `Boolean`, `Date`, `Error`, `Number`, `RegExp`, or `String`. + * + * @private + * @param {Object} object The object to compare. + * @param {Object} other The other object to compare. + * @param {string} tag The `toStringTag` of the objects to compare. + * @param {Function} equalFunc The function to determine equivalents of values. + * @param {Function} customizer The function to customize comparisons. + * @param {number} bitmask The bitmask of comparison flags. See `baseIsEqual` + * for more details. + * @param {Object} stack Tracks traversed `object` and `other` objects. + * @returns {boolean} Returns `true` if the objects are equivalent, else `false`. + */ +function equalByTag(object, other, tag, equalFunc, customizer, bitmask, stack) { + switch (tag) { + case dataViewTag: + if ((object.byteLength != other.byteLength) || + (object.byteOffset != other.byteOffset)) { + return false; + } + object = object.buffer; + other = other.buffer; + + case arrayBufferTag: + if ((object.byteLength != other.byteLength) || + !equalFunc(new Uint8Array(object), new Uint8Array(other))) { + return false; + } + return true; + + case boolTag: + case dateTag: + case numberTag: + // Coerce booleans to `1` or `0` and dates to milliseconds. + // Invalid dates are coerced to `NaN`. + return eq(+object, +other); + + case errorTag: + return object.name == other.name && object.message == other.message; + + case regexpTag: + case stringTag: + // Coerce regexes to strings and treat strings, primitives and objects, + // as equal. See http://www.ecma-international.org/ecma-262/7.0/#sec-regexp.prototype.tostring + // for more details. + return object == (other + ''); + + case mapTag: + var convert = mapToArray; + + case setTag: + var isPartial = bitmask & PARTIAL_COMPARE_FLAG; + convert || (convert = setToArray); + + if (object.size != other.size && !isPartial) { + return false; + } + // Assume cyclic values are equal. + var stacked = stack.get(object); + if (stacked) { + return stacked == other; + } + bitmask |= UNORDERED_COMPARE_FLAG; + + // Recursively compare objects (susceptible to call stack limits). + stack.set(object, other); + var result = equalArrays(convert(object), convert(other), equalFunc, customizer, bitmask, stack); + stack['delete'](object); + return result; + + case symbolTag: + if (symbolValueOf) { + return symbolValueOf.call(object) == symbolValueOf.call(other); + } + } + return false; +} + +/** + * A specialized version of `baseIsEqualDeep` for objects with support for + * partial deep comparisons. + * + * @private + * @param {Object} object The object to compare. + * @param {Object} other The other object to compare. + * @param {Function} equalFunc The function to determine equivalents of values. + * @param {Function} customizer The function to customize comparisons. + * @param {number} bitmask The bitmask of comparison flags. See `baseIsEqual` + * for more details. + * @param {Object} stack Tracks traversed `object` and `other` objects. + * @returns {boolean} Returns `true` if the objects are equivalent, else `false`. + */ +function equalObjects(object, other, equalFunc, customizer, bitmask, stack) { + var isPartial = bitmask & PARTIAL_COMPARE_FLAG, + objProps = keys(object), + objLength = objProps.length, + othProps = keys(other), + othLength = othProps.length; + + if (objLength != othLength && !isPartial) { + return false; + } + var index = objLength; + while (index--) { + var key = objProps[index]; + if (!(isPartial ? key in other : hasOwnProperty.call(other, key))) { + return false; + } + } + // Assume cyclic values are equal. + var stacked = stack.get(object); + if (stacked && stack.get(other)) { + return stacked == other; + } + var result = true; + stack.set(object, other); + stack.set(other, object); + + var skipCtor = isPartial; + while (++index < objLength) { + key = objProps[index]; + var objValue = object[key], + othValue = other[key]; + + if (customizer) { + var compared = isPartial + ? customizer(othValue, objValue, key, other, object, stack) + : customizer(objValue, othValue, key, object, other, stack); + } + // Recursively compare objects (susceptible to call stack limits). + if (!(compared === undefined + ? (objValue === othValue || equalFunc(objValue, othValue, customizer, bitmask, stack)) + : compared + )) { + result = false; + break; + } + skipCtor || (skipCtor = key == 'constructor'); + } + if (result && !skipCtor) { + var objCtor = object.constructor, + othCtor = other.constructor; + + // Non `Object` object instances with different constructors are not equal. + if (objCtor != othCtor && + ('constructor' in object && 'constructor' in other) && + !(typeof objCtor == 'function' && objCtor instanceof objCtor && + typeof othCtor == 'function' && othCtor instanceof othCtor)) { + result = false; + } + } + stack['delete'](object); + stack['delete'](other); + return result; +} + +/** + * Gets the data for `map`. + * + * @private + * @param {Object} map The map to query. + * @param {string} key The reference key. + * @returns {*} Returns the map data. + */ +function getMapData(map, key) { + var data = map.__data__; + return isKeyable(key) + ? data[typeof key == 'string' ? 'string' : 'hash'] + : data.map; +} + +/** + * Gets the property names, values, and compare flags of `object`. + * + * @private + * @param {Object} object The object to query. + * @returns {Array} Returns the match data of `object`. + */ +function getMatchData(object) { + var result = keys(object), + length = result.length; + + while (length--) { + var key = result[length], + value = object[key]; + + result[length] = [key, value, isStrictComparable(value)]; + } + return result; +} + +/** + * Gets the native function at `key` of `object`. + * + * @private + * @param {Object} object The object to query. + * @param {string} key The key of the method to get. + * @returns {*} Returns the function if it's native, else `undefined`. + */ +function getNative(object, key) { + var value = getValue(object, key); + return baseIsNative(value) ? value : undefined; +} + +/** + * Gets the `toStringTag` of `value`. + * + * @private + * @param {*} value The value to query. + * @returns {string} Returns the `toStringTag`. + */ +var getTag = baseGetTag; + +// Fallback for data views, maps, sets, and weak maps in IE 11, +// for data views in Edge < 14, and promises in Node.js. +if ((DataView && getTag(new DataView(new ArrayBuffer(1))) != dataViewTag) || + (Map && getTag(new Map) != mapTag) || + (Promise && getTag(Promise.resolve()) != promiseTag) || + (Set && getTag(new Set) != setTag) || + (WeakMap && getTag(new WeakMap) != weakMapTag)) { + getTag = function(value) { + var result = objectToString.call(value), + Ctor = result == objectTag ? value.constructor : undefined, + ctorString = Ctor ? toSource(Ctor) : undefined; + + if (ctorString) { + switch (ctorString) { + case dataViewCtorString: return dataViewTag; + case mapCtorString: return mapTag; + case promiseCtorString: return promiseTag; + case setCtorString: return setTag; + case weakMapCtorString: return weakMapTag; + } + } + return result; + }; +} + +/** + * Checks if `path` exists on `object`. + * + * @private + * @param {Object} object The object to query. + * @param {Array|string} path The path to check. + * @param {Function} hasFunc The function to check properties. + * @returns {boolean} Returns `true` if `path` exists, else `false`. + */ +function hasPath(object, path, hasFunc) { + path = isKey(path, object) ? [path] : castPath(path); + + var result, + index = -1, + length = path.length; + + while (++index < length) { + var key = toKey(path[index]); + if (!(result = object != null && hasFunc(object, key))) { + break; + } + object = object[key]; + } + if (result) { + return result; + } + var length = object ? object.length : 0; + return !!length && isLength(length) && isIndex(key, length) && + (isArray(object) || isArguments(object)); +} + +/** + * Checks if `value` is a flattenable `arguments` object or array. + * + * @private + * @param {*} value The value to check. + * @returns {boolean} Returns `true` if `value` is flattenable, else `false`. + */ +function isFlattenable(value) { + return isArray(value) || isArguments(value) || + !!(spreadableSymbol && value && value[spreadableSymbol]); +} + +/** + * Checks if `value` is a valid array-like index. + * + * @private + * @param {*} value The value to check. + * @param {number} [length=MAX_SAFE_INTEGER] The upper bounds of a valid index. + * @returns {boolean} Returns `true` if `value` is a valid index, else `false`. + */ +function isIndex(value, length) { + length = length == null ? MAX_SAFE_INTEGER : length; + return !!length && + (typeof value == 'number' || reIsUint.test(value)) && + (value > -1 && value % 1 == 0 && value < length); +} + +/** + * Checks if the given arguments are from an iteratee call. + * + * @private + * @param {*} value The potential iteratee value argument. + * @param {*} index The potential iteratee index or key argument. + * @param {*} object The potential iteratee object argument. + * @returns {boolean} Returns `true` if the arguments are from an iteratee call, + * else `false`. + */ +function isIterateeCall(value, index, object) { + if (!isObject(object)) { + return false; + } + var type = typeof index; + if (type == 'number' + ? (isArrayLike(object) && isIndex(index, object.length)) + : (type == 'string' && index in object) + ) { + return eq(object[index], value); + } + return false; +} + +/** + * Checks if `value` is a property name and not a property path. + * + * @private + * @param {*} value The value to check. + * @param {Object} [object] The object to query keys on. + * @returns {boolean} Returns `true` if `value` is a property name, else `false`. + */ +function isKey(value, object) { + if (isArray(value)) { + return false; + } + var type = typeof value; + if (type == 'number' || type == 'symbol' || type == 'boolean' || + value == null || isSymbol(value)) { + return true; + } + return reIsPlainProp.test(value) || !reIsDeepProp.test(value) || + (object != null && value in Object(object)); +} + +/** + * Checks if `value` is suitable for use as unique object key. + * + * @private + * @param {*} value The value to check. + * @returns {boolean} Returns `true` if `value` is suitable, else `false`. + */ +function isKeyable(value) { + var type = typeof value; + return (type == 'string' || type == 'number' || type == 'symbol' || type == 'boolean') + ? (value !== '__proto__') + : (value === null); +} + +/** + * Checks if `func` has its source masked. + * + * @private + * @param {Function} func The function to check. + * @returns {boolean} Returns `true` if `func` is masked, else `false`. + */ +function isMasked(func) { + return !!maskSrcKey && (maskSrcKey in func); +} + +/** + * Checks if `value` is likely a prototype object. + * + * @private + * @param {*} value The value to check. + * @returns {boolean} Returns `true` if `value` is a prototype, else `false`. + */ +function isPrototype(value) { + var Ctor = value && value.constructor, + proto = (typeof Ctor == 'function' && Ctor.prototype) || objectProto; + + return value === proto; +} + +/** + * Checks if `value` is suitable for strict equality comparisons, i.e. `===`. + * + * @private + * @param {*} value The value to check. + * @returns {boolean} Returns `true` if `value` if suitable for strict + * equality comparisons, else `false`. + */ +function isStrictComparable(value) { + return value === value && !isObject(value); +} + +/** + * A specialized version of `matchesProperty` for source values suitable + * for strict equality comparisons, i.e. `===`. + * + * @private + * @param {string} key The key of the property to get. + * @param {*} srcValue The value to match. + * @returns {Function} Returns the new spec function. + */ +function matchesStrictComparable(key, srcValue) { + return function(object) { + if (object == null) { + return false; + } + return object[key] === srcValue && + (srcValue !== undefined || (key in Object(object))); + }; +} + +/** + * Converts `string` to a property path array. + * + * @private + * @param {string} string The string to convert. + * @returns {Array} Returns the property path array. + */ +var stringToPath = memoize(function(string) { + string = toString(string); + + var result = []; + if (reLeadingDot.test(string)) { + result.push(''); + } + string.replace(rePropName, function(match, number, quote, string) { + result.push(quote ? string.replace(reEscapeChar, '$1') : (number || match)); + }); + return result; +}); + +/** + * Converts `value` to a string key if it's not a string or symbol. + * + * @private + * @param {*} value The value to inspect. + * @returns {string|symbol} Returns the key. + */ +function toKey(value) { + if (typeof value == 'string' || isSymbol(value)) { + return value; + } + var result = (value + ''); + return (result == '0' && (1 / value) == -INFINITY) ? '-0' : result; +} + +/** + * Converts `func` to its source code. + * + * @private + * @param {Function} func The function to process. + * @returns {string} Returns the source code. + */ +function toSource(func) { + if (func != null) { + try { + return funcToString.call(func); + } catch (e) {} + try { + return (func + ''); + } catch (e) {} + } + return ''; +} + +/** + * Creates an array of elements, sorted in ascending order by the results of + * running each element in a collection thru each iteratee. This method + * performs a stable sort, that is, it preserves the original sort order of + * equal elements. The iteratees are invoked with one argument: (value). + * + * @static + * @memberOf _ + * @since 0.1.0 + * @category Collection + * @param {Array|Object} collection The collection to iterate over. + * @param {...(Function|Function[])} [iteratees=[_.identity]] + * The iteratees to sort by. + * @returns {Array} Returns the new sorted array. + * @example + * + * var users = [ + * { 'user': 'fred', 'age': 48 }, + * { 'user': 'barney', 'age': 36 }, + * { 'user': 'fred', 'age': 40 }, + * { 'user': 'barney', 'age': 34 } + * ]; + * + * _.sortBy(users, function(o) { return o.user; }); + * // => objects for [['barney', 36], ['barney', 34], ['fred', 48], ['fred', 40]] + * + * _.sortBy(users, ['user', 'age']); + * // => objects for [['barney', 34], ['barney', 36], ['fred', 40], ['fred', 48]] + * + * _.sortBy(users, 'user', function(o) { + * return Math.floor(o.age / 10); + * }); + * // => objects for [['barney', 36], ['barney', 34], ['fred', 48], ['fred', 40]] + */ +var sortBy = baseRest(function(collection, iteratees) { + if (collection == null) { + return []; + } + var length = iteratees.length; + if (length > 1 && isIterateeCall(collection, iteratees[0], iteratees[1])) { + iteratees = []; + } else if (length > 2 && isIterateeCall(iteratees[0], iteratees[1], iteratees[2])) { + iteratees = [iteratees[0]]; + } + return baseOrderBy(collection, baseFlatten(iteratees, 1), []); +}); + +/** + * Creates a function that memoizes the result of `func`. If `resolver` is + * provided, it determines the cache key for storing the result based on the + * arguments provided to the memoized function. By default, the first argument + * provided to the memoized function is used as the map cache key. The `func` + * is invoked with the `this` binding of the memoized function. + * + * **Note:** The cache is exposed as the `cache` property on the memoized + * function. Its creation may be customized by replacing the `_.memoize.Cache` + * constructor with one whose instances implement the + * [`Map`](http://ecma-international.org/ecma-262/7.0/#sec-properties-of-the-map-prototype-object) + * method interface of `delete`, `get`, `has`, and `set`. + * + * @static + * @memberOf _ + * @since 0.1.0 + * @category Function + * @param {Function} func The function to have its output memoized. + * @param {Function} [resolver] The function to resolve the cache key. + * @returns {Function} Returns the new memoized function. + * @example + * + * var object = { 'a': 1, 'b': 2 }; + * var other = { 'c': 3, 'd': 4 }; + * + * var values = _.memoize(_.values); + * values(object); + * // => [1, 2] + * + * values(other); + * // => [3, 4] + * + * object.a = 2; + * values(object); + * // => [1, 2] + * + * // Modify the result cache. + * values.cache.set(object, ['a', 'b']); + * values(object); + * // => ['a', 'b'] + * + * // Replace `_.memoize.Cache`. + * _.memoize.Cache = WeakMap; + */ +function memoize(func, resolver) { + if (typeof func != 'function' || (resolver && typeof resolver != 'function')) { + throw new TypeError(FUNC_ERROR_TEXT); + } + var memoized = function() { + var args = arguments, + key = resolver ? resolver.apply(this, args) : args[0], + cache = memoized.cache; + + if (cache.has(key)) { + return cache.get(key); + } + var result = func.apply(this, args); + memoized.cache = cache.set(key, result); + return result; + }; + memoized.cache = new (memoize.Cache || MapCache); + return memoized; +} + +// Assign cache to `_.memoize`. +memoize.Cache = MapCache; + +/** + * Performs a + * [`SameValueZero`](http://ecma-international.org/ecma-262/7.0/#sec-samevaluezero) + * comparison between two values to determine if they are equivalent. + * + * @static + * @memberOf _ + * @since 4.0.0 + * @category Lang + * @param {*} value The value to compare. + * @param {*} other The other value to compare. + * @returns {boolean} Returns `true` if the values are equivalent, else `false`. + * @example + * + * var object = { 'a': 1 }; + * var other = { 'a': 1 }; + * + * _.eq(object, object); + * // => true + * + * _.eq(object, other); + * // => false + * + * _.eq('a', 'a'); + * // => true + * + * _.eq('a', Object('a')); + * // => false + * + * _.eq(NaN, NaN); + * // => true + */ +function eq(value, other) { + return value === other || (value !== value && other !== other); +} + +/** + * Checks if `value` is likely an `arguments` object. + * + * @static + * @memberOf _ + * @since 0.1.0 + * @category Lang + * @param {*} value The value to check. + * @returns {boolean} Returns `true` if `value` is an `arguments` object, + * else `false`. + * @example + * + * _.isArguments(function() { return arguments; }()); + * // => true + * + * _.isArguments([1, 2, 3]); + * // => false + */ +function isArguments(value) { + // Safari 8.1 makes `arguments.callee` enumerable in strict mode. + return isArrayLikeObject(value) && hasOwnProperty.call(value, 'callee') && + (!propertyIsEnumerable.call(value, 'callee') || objectToString.call(value) == argsTag); +} + +/** + * Checks if `value` is classified as an `Array` object. + * + * @static + * @memberOf _ + * @since 0.1.0 + * @category Lang + * @param {*} value The value to check. + * @returns {boolean} Returns `true` if `value` is an array, else `false`. + * @example + * + * _.isArray([1, 2, 3]); + * // => true + * + * _.isArray(document.body.children); + * // => false + * + * _.isArray('abc'); + * // => false + * + * _.isArray(_.noop); + * // => false + */ +var isArray = Array.isArray; + +/** + * Checks if `value` is array-like. A value is considered array-like if it's + * not a function and has a `value.length` that's an integer greater than or + * equal to `0` and less than or equal to `Number.MAX_SAFE_INTEGER`. + * + * @static + * @memberOf _ + * @since 4.0.0 + * @category Lang + * @param {*} value The value to check. + * @returns {boolean} Returns `true` if `value` is array-like, else `false`. + * @example + * + * _.isArrayLike([1, 2, 3]); + * // => true + * + * _.isArrayLike(document.body.children); + * // => true + * + * _.isArrayLike('abc'); + * // => true + * + * _.isArrayLike(_.noop); + * // => false + */ +function isArrayLike(value) { + return value != null && isLength(value.length) && !isFunction(value); +} + +/** + * This method is like `_.isArrayLike` except that it also checks if `value` + * is an object. + * + * @static + * @memberOf _ + * @since 4.0.0 + * @category Lang + * @param {*} value The value to check. + * @returns {boolean} Returns `true` if `value` is an array-like object, + * else `false`. + * @example + * + * _.isArrayLikeObject([1, 2, 3]); + * // => true + * + * _.isArrayLikeObject(document.body.children); + * // => true + * + * _.isArrayLikeObject('abc'); + * // => false + * + * _.isArrayLikeObject(_.noop); + * // => false + */ +function isArrayLikeObject(value) { + return isObjectLike(value) && isArrayLike(value); +} + +/** + * Checks if `value` is classified as a `Function` object. + * + * @static + * @memberOf _ + * @since 0.1.0 + * @category Lang + * @param {*} value The value to check. + * @returns {boolean} Returns `true` if `value` is a function, else `false`. + * @example + * + * _.isFunction(_); + * // => true + * + * _.isFunction(/abc/); + * // => false + */ +function isFunction(value) { + // The use of `Object#toString` avoids issues with the `typeof` operator + // in Safari 8-9 which returns 'object' for typed array and other constructors. + var tag = isObject(value) ? objectToString.call(value) : ''; + return tag == funcTag || tag == genTag; +} + +/** + * Checks if `value` is a valid array-like length. + * + * **Note:** This method is loosely based on + * [`ToLength`](http://ecma-international.org/ecma-262/7.0/#sec-tolength). + * + * @static + * @memberOf _ + * @since 4.0.0 + * @category Lang + * @param {*} value The value to check. + * @returns {boolean} Returns `true` if `value` is a valid length, else `false`. + * @example + * + * _.isLength(3); + * // => true + * + * _.isLength(Number.MIN_VALUE); + * // => false + * + * _.isLength(Infinity); + * // => false + * + * _.isLength('3'); + * // => false + */ +function isLength(value) { + return typeof value == 'number' && + value > -1 && value % 1 == 0 && value <= MAX_SAFE_INTEGER; +} + +/** + * Checks if `value` is the + * [language type](http://www.ecma-international.org/ecma-262/7.0/#sec-ecmascript-language-types) + * of `Object`. (e.g. arrays, functions, objects, regexes, `new Number(0)`, and `new String('')`) + * + * @static + * @memberOf _ + * @since 0.1.0 + * @category Lang + * @param {*} value The value to check. + * @returns {boolean} Returns `true` if `value` is an object, else `false`. + * @example + * + * _.isObject({}); + * // => true + * + * _.isObject([1, 2, 3]); + * // => true + * + * _.isObject(_.noop); + * // => true + * + * _.isObject(null); + * // => false + */ +function isObject(value) { + var type = typeof value; + return !!value && (type == 'object' || type == 'function'); +} + +/** + * Checks if `value` is object-like. A value is object-like if it's not `null` + * and has a `typeof` result of "object". + * + * @static + * @memberOf _ + * @since 4.0.0 + * @category Lang + * @param {*} value The value to check. + * @returns {boolean} Returns `true` if `value` is object-like, else `false`. + * @example + * + * _.isObjectLike({}); + * // => true + * + * _.isObjectLike([1, 2, 3]); + * // => true + * + * _.isObjectLike(_.noop); + * // => false + * + * _.isObjectLike(null); + * // => false + */ +function isObjectLike(value) { + return !!value && typeof value == 'object'; +} + +/** + * Checks if `value` is classified as a `Symbol` primitive or object. + * + * @static + * @memberOf _ + * @since 4.0.0 + * @category Lang + * @param {*} value The value to check. + * @returns {boolean} Returns `true` if `value` is a symbol, else `false`. + * @example + * + * _.isSymbol(Symbol.iterator); + * // => true + * + * _.isSymbol('abc'); + * // => false + */ +function isSymbol(value) { + return typeof value == 'symbol' || + (isObjectLike(value) && objectToString.call(value) == symbolTag); +} + +/** + * Checks if `value` is classified as a typed array. + * + * @static + * @memberOf _ + * @since 3.0.0 + * @category Lang + * @param {*} value The value to check. + * @returns {boolean} Returns `true` if `value` is a typed array, else `false`. + * @example + * + * _.isTypedArray(new Uint8Array); + * // => true + * + * _.isTypedArray([]); + * // => false + */ +var isTypedArray = nodeIsTypedArray ? baseUnary(nodeIsTypedArray) : baseIsTypedArray; + +/** + * Converts `value` to a string. An empty string is returned for `null` + * and `undefined` values. The sign of `-0` is preserved. + * + * @static + * @memberOf _ + * @since 4.0.0 + * @category Lang + * @param {*} value The value to process. + * @returns {string} Returns the string. + * @example + * + * _.toString(null); + * // => '' + * + * _.toString(-0); + * // => '-0' + * + * _.toString([1, 2, 3]); + * // => '1,2,3' + */ +function toString(value) { + return value == null ? '' : baseToString(value); +} + +/** + * Gets the value at `path` of `object`. If the resolved value is + * `undefined`, the `defaultValue` is returned in its place. + * + * @static + * @memberOf _ + * @since 3.7.0 + * @category Object + * @param {Object} object The object to query. + * @param {Array|string} path The path of the property to get. + * @param {*} [defaultValue] The value returned for `undefined` resolved values. + * @returns {*} Returns the resolved value. + * @example + * + * var object = { 'a': [{ 'b': { 'c': 3 } }] }; + * + * _.get(object, 'a[0].b.c'); + * // => 3 + * + * _.get(object, ['a', '0', 'b', 'c']); + * // => 3 + * + * _.get(object, 'a.b.c', 'default'); + * // => 'default' + */ +function get(object, path, defaultValue) { + var result = object == null ? undefined : baseGet(object, path); + return result === undefined ? defaultValue : result; +} + +/** + * Checks if `path` is a direct or inherited property of `object`. + * + * @static + * @memberOf _ + * @since 4.0.0 + * @category Object + * @param {Object} object The object to query. + * @param {Array|string} path The path to check. + * @returns {boolean} Returns `true` if `path` exists, else `false`. + * @example + * + * var object = _.create({ 'a': _.create({ 'b': 2 }) }); + * + * _.hasIn(object, 'a'); + * // => true + * + * _.hasIn(object, 'a.b'); + * // => true + * + * _.hasIn(object, ['a', 'b']); + * // => true + * + * _.hasIn(object, 'b'); + * // => false + */ +function hasIn(object, path) { + return object != null && hasPath(object, path, baseHasIn); +} + +/** + * Creates an array of the own enumerable property names of `object`. + * + * **Note:** Non-object values are coerced to objects. See the + * [ES spec](http://ecma-international.org/ecma-262/7.0/#sec-object.keys) + * for more details. + * + * @static + * @since 0.1.0 + * @memberOf _ + * @category Object + * @param {Object} object The object to query. + * @returns {Array} Returns the array of property names. + * @example + * + * function Foo() { + * this.a = 1; + * this.b = 2; + * } + * + * Foo.prototype.c = 3; + * + * _.keys(new Foo); + * // => ['a', 'b'] (iteration order is not guaranteed) + * + * _.keys('hi'); + * // => ['0', '1'] + */ +function keys(object) { + return isArrayLike(object) ? arrayLikeKeys(object) : baseKeys(object); +} + +/** + * This method returns the first argument it receives. + * + * @static + * @since 0.1.0 + * @memberOf _ + * @category Util + * @param {*} value Any value. + * @returns {*} Returns `value`. + * @example + * + * var object = { 'a': 1 }; + * + * console.log(_.identity(object) === object); + * // => true + */ +function identity(value) { + return value; +} + +/** + * Creates a function that returns the value at `path` of a given object. + * + * @static + * @memberOf _ + * @since 2.4.0 + * @category Util + * @param {Array|string} path The path of the property to get. + * @returns {Function} Returns the new accessor function. + * @example + * + * var objects = [ + * { 'a': { 'b': 2 } }, + * { 'a': { 'b': 1 } } + * ]; + * + * _.map(objects, _.property('a.b')); + * // => [2, 1] + * + * _.map(_.sortBy(objects, _.property(['a', 'b'])), 'a.b'); + * // => [1, 2] + */ +function property(path) { + return isKey(path) ? baseProperty(toKey(path)) : basePropertyDeep(path); +} + +module.exports = sortBy; +}); + +var parsers$2 = createCommonjsModule(function (module, exports) { +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); + + + + +// The exponent value(s) at which toString returns exponential notation. +bignumber.BigNumber.config({ EXPONENTIAL_AT: [-5, 15] }); +class BaseNumberParser { + constructor(config) { + this.config = config; + let singleIntFrac = `${this.config.wordSeparatorToken}| -|${this.getKeyRegex(this.config.cardinalNumberMap)}|${this.getKeyRegex(this.config.ordinalNumberMap)}`; + this.textNumberRegex = recognizersText.RegExpUtility.getSafeRegExp(String.raw `(?=\b)(${singleIntFrac})(?=\b)`, "gis"); + this.arabicNumberRegex = recognizersText.RegExpUtility.getSafeRegExp(String.raw `\d+`, "is"); + this.roundNumberSet = new Set(); + this.config.roundNumberMap.forEach((value, key) => this.roundNumberSet.add(key)); + } + parse(extResult) { + // check if the parser is configured to support specific types + if (this.supportedTypes && !this.supportedTypes.find(t => t === extResult.type)) { + return null; + } + let ret = null; + let extra = extResult.data; + if (!extra) { + if (this.arabicNumberRegex.test(extResult.text)) { + extra = "Num"; + } + else { + extra = this.config.langMarker; + } + } + // Resolve symbol prefix + let isNegative = false; + let matchNegative = extResult.text.match(this.config.negativeNumberSignRegex); + if (matchNegative) { + isNegative = true; + extResult.text = extResult.text.substr(matchNegative[1].length); + } + if (extra.includes("Num")) { + ret = this.digitNumberParse(extResult); + } + else if (extra.includes(`Frac${this.config.langMarker}`)) // Frac is a special number, parse via another method + { + ret = this.fracLikeNumberParse(extResult); + } + else if (extra.includes(this.config.langMarker)) { + ret = this.textNumberParse(extResult); + } + else if (extra.includes("Pow")) { + ret = this.powerNumberParse(extResult); + } + if (ret && ret.value !== null) { + if (isNegative) { + // Recover to the original extracted Text + ret.text = matchNegative[1] + extResult.text; + // Check if ret.value is a BigNumber + if (typeof ret.value === "number") { + ret.value = -ret.value; + } + else { + ret.value.s = -1; + } + } + ret.resolutionStr = this.config.cultureInfo + ? this.config.cultureInfo.format(ret.value) + : ret.value.toString(); + } + return ret; + } + getKeyRegex(regexMap) { + let keys = new Array(); + regexMap.forEach((value, key) => keys.push(key)); + let sortKeys = lodash_sortby(keys, key => key.length).reverse(); + return sortKeys.join('|'); + } + digitNumberParse(extResult) { + let result = { + start: extResult.start, + length: extResult.length, + text: extResult.text, + type: extResult.type + }; + // [1] 24 + // [2] 12 32/33 + // [3] 1,000,000 + // [4] 234.567 + // [5] 44/55 + // [6] 2 hundred + // dot occured. + let power = 1; + let tmpIndex = -1; + let startIndex = 0; + let handle = extResult.text.toLowerCase(); + let matches = recognizersText.RegExpUtility.getMatches(this.config.digitalNumberRegex, handle); + if (matches) { + matches.forEach(match => { + // HACK: Matching regex may be buggy, may include a digit before the unit + match.value = match.value.replace(/\d/g, ''); + match.length = match.value.length; + let rep = this.config.roundNumberMap.get(match.value); + // \\s+ for filter the spaces. + power *= rep; + // tslint:disable-next-line:no-conditional-assignment + while ((tmpIndex = handle.indexOf(match.value, startIndex)) >= 0) { + let front = lodash_trimend(handle.substring(0, tmpIndex)); + startIndex = front.length; + handle = front + handle.substring(tmpIndex + match.length); + } + }); + } + // scale used in the calculate of double + result.value = this.getDigitalValue(handle, power); + return result; + } + isDigit(c) { + return c >= '0' && c <= '9'; + } + fracLikeNumberParse(extResult) { + let result = { + start: extResult.start, + length: extResult.length, + text: extResult.text, + type: extResult.type + }; + let resultText = extResult.text.toLowerCase(); + if (resultText.includes(this.config.fractionMarkerToken)) { + let overIndex = resultText.indexOf(this.config.fractionMarkerToken); + let smallPart = resultText.substring(0, overIndex).trim(); + let bigPart = resultText.substring(overIndex + this.config.fractionMarkerToken.length, resultText.length).trim(); + let smallValue = this.isDigit(smallPart[0]) + ? this.getDigitalValue(smallPart, 1) + : this.getIntValue(this.getMatches(smallPart)); + let bigValue = this.isDigit(bigPart[0]) + ? this.getDigitalValue(bigPart, 1) + : this.getIntValue(this.getMatches(bigPart)); + result.value = smallValue / bigValue; + } + else { + let words = resultText.split(" ").filter(s => s && s.length); + let fracWords = Array.from(this.config.normalizeTokenSet(words, result)); + // Split fraction with integer + let splitIndex = fracWords.length - 1; + let currentValue = this.config.resolveCompositeNumber(fracWords[splitIndex]); + let roundValue = 1; + for (splitIndex = fracWords.length - 2; splitIndex >= 0; splitIndex--) { + if (this.config.writtenFractionSeparatorTexts.indexOf(fracWords[splitIndex]) > -1 || + this.config.writtenIntegerSeparatorTexts.indexOf(fracWords[splitIndex]) > -1) { + continue; + } + let previousValue = currentValue; + currentValue = this.config.resolveCompositeNumber(fracWords[splitIndex]); + let smHundreds = 100; + // previous : hundred + // current : one + if ((previousValue >= smHundreds && previousValue > currentValue) + || (previousValue < smHundreds && this.isComposable(currentValue, previousValue))) { + if (previousValue < smHundreds && currentValue >= roundValue) { + roundValue = currentValue; + } + else if (previousValue < smHundreds && currentValue < roundValue) { + splitIndex++; + break; + } + // current is the first word + if (splitIndex === 0) { + // scan, skip the first word + splitIndex = 1; + while (splitIndex <= fracWords.length - 2) { + // e.g. one hundred thousand + // frac[i+1] % 100 && frac[i] % 100 = 0 + if (this.config.resolveCompositeNumber(fracWords[splitIndex]) >= smHundreds + && !(this.config.writtenFractionSeparatorTexts.indexOf(fracWords[splitIndex + 1]) > -1) + && this.config.resolveCompositeNumber(fracWords[splitIndex + 1]) < smHundreds) { + splitIndex++; + break; + } + splitIndex++; + } + break; + } + continue; + } + splitIndex++; + break; + } + let fracPart = new Array(); + for (let i = splitIndex; i < fracWords.length; i++) { + if (fracWords[i].indexOf("-") > -1) { + let split = fracWords[i].split('-'); + fracPart.push(split[0]); + fracPart.push("-"); + fracPart.push(split[1]); + } + else { + fracPart.push(fracWords[i]); + } + } + fracWords.splice(splitIndex, fracWords.length - splitIndex); + // denomi = denominator + let denomiValue = this.getIntValue(fracPart); + // Split mixed number with fraction + let numerValue = 0; + let intValue = 0; + let mixedIndex = fracWords.length; + for (let i = fracWords.length - 1; i >= 0; i--) { + if (i < fracWords.length - 1 && this.config.writtenFractionSeparatorTexts.indexOf(fracWords[i]) > -1) { + let numerStr = fracWords.slice(i + 1, fracWords.length).join(" "); + numerValue = this.getIntValue(this.getMatches(numerStr)); + mixedIndex = i + 1; + break; + } + } + let intStr = fracWords.slice(0, mixedIndex).join(" "); + intValue = this.getIntValue(this.getMatches(intStr)); + // Find mixed number + if (mixedIndex !== fracWords.length && numerValue < denomiValue) { + // intValue + numerValue / denomiValue + result.value = new bignumber.BigNumber(intValue).plus(new bignumber.BigNumber(numerValue).dividedBy(denomiValue)); + } + else { + // (intValue + numerValue) / denomiValue + result.value = new bignumber.BigNumber(intValue + numerValue).dividedBy(denomiValue); + } + } + return result; + } + textNumberParse(extResult) { + let result = { + start: extResult.start, + length: extResult.length, + text: extResult.text, + type: extResult.type + }; + let handle = extResult.text.toLowerCase(); + handle = handle.replace(this.config.halfADozenRegex, this.config.halfADozenText); + let numGroup = this.splitMulti(handle, Array.from(this.config.writtenDecimalSeparatorTexts)).filter(s => s && s.length > 0); + let intPart = numGroup[0]; + let matchStrs = intPart + ? intPart.match(this.textNumberRegex).map(s => s.toLowerCase()) + : new Array(); + // Get the value recursively + let intPartRet = this.getIntValue(matchStrs); + let pointPartRet = 0; + if (numGroup.length === 2) { + let pointPart = numGroup[1]; + let matchStrs = pointPart.match(this.textNumberRegex).map(s => s.toLowerCase()); + pointPartRet += this.getPointValue(matchStrs); + } + result.value = intPartRet + pointPartRet; + return result; + } + powerNumberParse(extResult) { + let result = { + start: extResult.start, + length: extResult.length, + text: extResult.text, + type: extResult.type + }; + let handle = extResult.text.toUpperCase(); + let isE = !extResult.text.includes("^"); + // [1] 1e10 + // [2] 1.1^-23 + let calStack = new Array(); + let scale = new bignumber.BigNumber(10); + let dot = false; + let isNegative = false; + let tmp = new bignumber.BigNumber(0); + for (let i = 0; i < handle.length; i++) { + let ch = handle[i]; + if (ch === '^' || ch === 'E') { + if (isNegative) { + calStack.push(tmp.negated()); + } + else { + calStack.push(tmp); + } + tmp = new bignumber.BigNumber(0); + scale = new bignumber.BigNumber(10); + dot = false; + isNegative = false; + } + else if (ch.charCodeAt(0) - 48 >= 0 && ch.charCodeAt(0) - 48 <= 9) { + if (dot) { + // tmp = tmp + scale * (ch.charCodeAt(0) - 48); + // scale *= 0.1; + tmp = tmp.plus(scale.times(ch.charCodeAt(0) - 48)); + scale = scale.times(0.1); + } + else { + // tmp = tmp * scale + (ch.charCodeAt(0) - 48); + tmp = tmp.times(scale).plus(ch.charCodeAt(0) - 48); + } + } + else if (ch === this.config.decimalSeparatorChar) { + dot = true; + scale = new bignumber.BigNumber(0.1); + } + else if (ch === '-') { + isNegative = !isNegative; + } + else if (ch === '+') { + continue; + } + if (i === handle.length - 1) { + if (isNegative) { + calStack.push(tmp.negated()); + } + else { + calStack.push(tmp); + } + } + } + let ret = 0; + if (isE) { + // ret = calStack.shift() * Math.pow(10, calStack.shift()); + ret = calStack.shift().times(Math.pow(10, calStack.shift().toNumber())).toNumber(); + } + else { + ret = Math.pow(calStack.shift().toNumber(), calStack.shift().toNumber()); + } + result.value = ret; + result.resolutionStr = ret.toString(); // @TODO Possible Culture bug. + return result; + } + splitMulti(str, tokens) { + let tempChar = tokens[0]; // We can use the first token as a temporary join character + for (let i = 0; i < tokens.length; i++) { + str = str.split(tokens[i]).join(tempChar); + } + return str.split(tempChar); + } + getMatches(input) { + let matches = input.match(this.textNumberRegex); + return (matches || []).map(match => { + return match.toLowerCase(); + }); + } + // Test if big and combine with small. + // e.g. "hundred" can combine with "thirty" but "twenty" can't combine with "thirty". + isComposable(big, small) { + let baseNumber = small > 10 ? 100 : 10; + if (big % baseNumber === 0 && big / baseNumber >= 1) { + return true; + } + return false; + } + getIntValue(matchStrs) { + let isEnd = new Array(matchStrs.length); + for (let i = 0; i < isEnd.length; i++) { + isEnd[i] = false; + } + let tempValue = 0; + let endFlag = 1; + // Scan from end to start, find the end word + for (let i = matchStrs.length - 1; i >= 0; i--) { + if (this.roundNumberSet.has(matchStrs[i])) { + // if false,then continue + // You will meet hundred first, then thousand. + if (endFlag > this.config.roundNumberMap.get(matchStrs[i])) { + continue; + } + isEnd[i] = true; + endFlag = this.config.roundNumberMap.get(matchStrs[i]); + } + } + if (endFlag === 1) { + let tempStack = new Array(); + let oldSym = ""; + matchStrs.forEach(matchStr => { + let isCardinal = this.config.cardinalNumberMap.has(matchStr); + let isOrdinal = this.config.ordinalNumberMap.has(matchStr); + if (isCardinal || isOrdinal) { + let matchValue = isCardinal + ? this.config.cardinalNumberMap.get(matchStr) + : this.config.ordinalNumberMap.get(matchStr); + // This is just for ordinal now. Not for fraction ever. + if (isOrdinal) { + let fracPart = this.config.ordinalNumberMap.get(matchStr); + if (tempStack.length > 0) { + let intPart = tempStack.pop(); + // if intPart >= fracPart, it means it is an ordinal number + // it begins with an integer, ends with an ordinal + // e.g. ninety-ninth + if (intPart >= fracPart) { + tempStack.push(intPart + fracPart); + } + // another case of the type is ordinal + // e.g. three hundredth + else { + while (tempStack.length > 0) { + intPart = intPart + tempStack.pop(); + } + tempStack.push(intPart * fracPart); + } + } + else { + tempStack.push(fracPart); + } + } + else if (this.config.cardinalNumberMap.has(matchStr)) { + if (oldSym === "-") { + let sum = tempStack.pop() + matchValue; + tempStack.push(sum); + } + else if (oldSym === this.config.writtenIntegerSeparatorTexts[0] || tempStack.length < 2) { + tempStack.push(matchValue); + } + else if (tempStack.length >= 2) { + let sum = tempStack.pop() + matchValue; + sum = tempStack.pop() + sum; + tempStack.push(sum); + } + } + } + else { + let complexValue = this.config.resolveCompositeNumber(matchStr); + if (complexValue !== 0) { + tempStack.push(complexValue); + } + } + oldSym = matchStr; + }); + tempStack.forEach(stackValue => { + tempValue += stackValue; + }); + } + else { + let lastIndex = 0; + let mulValue = 1; + let partValue = 1; + for (let i = 0; i < isEnd.length; i++) { + if (isEnd[i]) { + mulValue = this.config.roundNumberMap.get(matchStrs[i]); + partValue = 1; + if (i !== 0) { + partValue = this.getIntValue(matchStrs.slice(lastIndex, i)); + } + tempValue += mulValue * partValue; + lastIndex = i + 1; + } + } + // Calculate the part like "thirty-one" + mulValue = 1; + if (lastIndex !== isEnd.length) { + partValue = this.getIntValue(matchStrs.slice(lastIndex, isEnd.length)); + tempValue += mulValue * partValue; + } + } + return tempValue; + } + getPointValue(matchStrs) { + let ret = 0; + let firstMatch = matchStrs[0]; + if (this.config.cardinalNumberMap.has(firstMatch) && this.config.cardinalNumberMap.get(firstMatch) >= 10) { + let prefix = "0."; + let tempInt = this.getIntValue(matchStrs); + let all = prefix + tempInt; + ret = parseFloat(all); + } + else { + let scale = new bignumber.BigNumber(0.1); + for (let i = 0; i < matchStrs.length; i++) { + ret += scale.times(this.config.cardinalNumberMap.get(matchStrs[i])).toNumber(); + // scale *= 0.1; + scale = scale.times(0.1); + } + } + return ret; + } + skipNonDecimalSeparator(ch, distance, culture) { + var decimalLength = 3; + // Special cases for multi-language countries where decimal separators can be used interchangeably. Mostly informally. + // Ex: South Africa, Namibia; Puerto Rico in ES; or in Canada for EN and FR. + // "me pidio $5.00 prestados" and "me pidio $5,00 prestados" -> currency $5 + var cultureRegex = recognizersText.RegExpUtility.getSafeRegExp(String.raw `^(en|es|fr)(-)?\b`, "is"); + return (ch == this.config.nonDecimalSeparatorChar && !(distance <= decimalLength && (cultureRegex.exec(culture.code) !== null))); + } + getDigitalValue(digitsStr, power) { + let tmp = new bignumber.BigNumber(0); + let scale = new bignumber.BigNumber(10); + let decimalSeparator = false; + var strLength = digitsStr.length; + let isNegative = false; + let isFrac = digitsStr.includes('/'); + let calStack = new Array(); + for (let i = 0; i < digitsStr.length; i++) { + let ch = digitsStr[i]; + var skippableNonDecimal = this.skipNonDecimalSeparator(ch, strLength - i, this.config.cultureInfo); + if (!isFrac && (ch === ' ' || skippableNonDecimal)) { + continue; + } + if (ch === ' ' || ch === '/') { + calStack.push(tmp); + tmp = new bignumber.BigNumber(0); + } + else if (ch >= '0' && ch <= '9') { + if (decimalSeparator) { + // tmp = tmp + scale * (ch.charCodeAt(0) - 48); + // scale *= 0.1; + tmp = tmp.plus(scale.times(ch.charCodeAt(0) - 48)); + scale = scale.times(0.1); + } + else { + // tmp = tmp * scale + (ch.charCodeAt(0) - 48); + tmp = tmp.times(scale).plus(ch.charCodeAt(0) - 48); + } + } + else if (ch === this.config.decimalSeparatorChar || (!skippableNonDecimal && ch == this.config.nonDecimalSeparatorChar)) { + decimalSeparator = true; + scale = new bignumber.BigNumber(0.1); + } + else if (ch === '-') { + isNegative = true; + } + } + calStack.push(tmp); + // if the number is a fraction. + let calResult = new bignumber.BigNumber(0); + if (isFrac) { + let deno = calStack.pop(); + let mole = calStack.pop(); + // calResult += mole / deno; + calResult = calResult.plus(mole.dividedBy(deno)); + } + while (calStack.length > 0) { + calResult = calResult.plus(calStack.pop()); + } + // calResult *= power; + calResult = calResult.times(power); + if (isNegative) { + return calResult.negated().toNumber(); + } + return calResult.toNumber(); + } +} +exports.BaseNumberParser = BaseNumberParser; +class BasePercentageParser extends BaseNumberParser { + parse(extResult) { + let originText = extResult.text; + // do replace text & data from extended info + if (extResult.data && extResult.data instanceof Array) { + extResult.text = extResult.data[0]; + extResult.data = extResult.data[1].data; + } + let ret = super.parse(extResult); + if (ret.resolutionStr && ret.resolutionStr.length > 0) { + if (!ret.resolutionStr.trim().endsWith("%")) { + ret.resolutionStr = ret.resolutionStr.trim() + "%"; + } + } + ret.data = extResult.text; + ret.text = originText; + return ret; + } +} +exports.BasePercentageParser = BasePercentageParser; + +}); + +unwrapExports(parsers$2); + +var cjkParsers = createCommonjsModule(function (module, exports) { +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); + + + +const recognizers_text_2 = recognizersText; +class BaseCJKNumberParser extends parsers$2.BaseNumberParser { + constructor(config) { + super(config); + this.config = config; + } + toString(value) { + return this.config.cultureInfo + ? this.config.cultureInfo.format(value) + : value.toString(); + } + parse(extResult) { + let extra = ''; + let result; + extra = extResult.data; + let getExtResult = { + start: extResult.start, + length: extResult.length, + data: extResult.data, + text: this.replaceTraditionalWithSimplified(extResult.text), + type: extResult.type + }; + if (!extra) { + return result; + } + if (extra.includes("Per")) { + result = this.perParseCJK(getExtResult); + } + else if (extra.includes("Num")) { + getExtResult.text = this.replaceFullWithHalf(getExtResult.text); + result = this.digitNumberParse(getExtResult); + if (this.config.negativeNumberSignRegex.test(getExtResult.text) && result.value > 0) { + result.value = -result.value; + } + result.resolutionStr = this.toString(result.value); + } + else if (extra.includes("Pow")) { + getExtResult.text = this.replaceFullWithHalf(getExtResult.text); + result = this.powerNumberParse(getExtResult); + result.resolutionStr = this.toString(result.value); + } + else if (extra.includes("Frac")) { + result = this.fracParseCJK(getExtResult); + } + else if (extra.includes("Dou")) { + result = this.douParseCJK(getExtResult); + } + else if (extra.includes("Integer")) { + result = this.intParseCJK(getExtResult); + } + else if (extra.includes("Ordinal")) { + result = this.ordParseCJK(getExtResult); + } + if (result) { + result.text = extResult.text; + } + return result; + } + replaceTraditionalWithSimplified(value) { + if (recognizers_text_2.StringUtility.isNullOrWhitespace(value)) { + return value; + } + if (this.config.tratoSimMap == null) { + return value; + } + let result = ''; + for (let index = 0; index < value.length; index++) { + result = result.concat(this.config.tratoSimMap.get(value.charAt(index)) || value.charAt(index)); + } + return result; + } + replaceFullWithHalf(value) { + if (recognizers_text_2.StringUtility.isNullOrWhitespace(value)) { + return value; + } + let result = ''; + for (let index = 0; index < value.length; index++) { + result = result.concat(this.config.fullToHalfMap.get(value.charAt(index)) || value.charAt(index)); + } + return result; + } + replaceUnit(value) { + if (recognizers_text_2.StringUtility.isNullOrEmpty(value)) + return value; + let result = value; + this.config.unitMap.forEach((value, key) => { + result = result.replace(new RegExp(key, 'g'), value); + }); + return result; + } + perParseCJK(extResult) { + let result = new recognizersText.ParseResult(extResult); + let resultText = extResult.text; + let power = 1; + if (extResult.data.includes("Spe")) { + resultText = this.replaceFullWithHalf(resultText); + resultText = this.replaceUnit(resultText); + if (resultText === "半額" || resultText === "半折" || resultText === "半折") { + result.value = 50; + } + else if (resultText === "10成" || resultText === "10割" || resultText === "十割") { + result.value = 100; + } + else { + let matches = recognizers_text_2.RegExpUtility.getMatches(this.config.speGetNumberRegex, resultText); + let intNumber; + if (matches.length === 2) { + let intNumberChar = matches[0].value.charAt(0); + if (intNumberChar === '対' || intNumberChar === "对") { + intNumber = 5; + } + else if (intNumberChar === "十" || intNumberChar === "拾") { + intNumber = 10; + } + else { + intNumber = this.config.zeroToNineMap.get(intNumberChar); + } + let pointNumberChar = matches[1].value.charAt(0); + let pointNumber; + if (pointNumberChar === "半") { + pointNumber = 0.5; + } + else { + pointNumber = this.config.zeroToNineMap.get(pointNumberChar) * 0.1; + } + result.value = (intNumber + pointNumber) * 10; + } + else if (matches.length === 5) { + // Deal the Japanese percentage case like "xxx割xxx分xxx厘", get the integer value and convert into result. + let intNumberChar = matches[0].value.charAt(0); + let pointNumberChar = matches[1].value.charAt(0); + let dotNumberChar = matches[3].value.charAt(0); + let pointNumber = this.config.zeroToNineMap.get(pointNumberChar) * 0.1; + let dotNumber = this.config.zeroToNineMap.get(dotNumberChar) * 0.01; + intNumber = this.config.zeroToNineMap.get(intNumberChar); + result.value = (intNumber + pointNumber + dotNumber) * 10; + } + else { + let intNumberChar = matches[0].value.charAt(0); + if (intNumberChar === '対' || intNumberChar === "对") { + intNumber = 5; + } + else if (intNumberChar === "十" || intNumberChar === "拾") { + intNumber = 10; + } + else { + intNumber = this.config.zeroToNineMap.get(intNumberChar); + } + result.value = intNumber * 10; + } + } + } + else if (extResult.data.includes("Num")) { + let doubleMatch = recognizers_text_2.RegExpUtility.getMatches(this.config.percentageRegex, resultText).pop(); + let doubleText = doubleMatch.value; + if (doubleText.includes("k") || doubleText.includes("K") || doubleText.includes("k") || doubleText.includes("K")) { + power = 1000; + } + if (doubleText.includes("M") || doubleText.includes("M")) { + power = 1000000; + } + if (doubleText.includes("G") || doubleText.includes("G")) { + power = 1000000000; + } + if (doubleText.includes("T") || doubleText.includes("T")) { + power = 1000000000000; + } + result.value = this.getDigitValueCJK(resultText, power); + } + else { + let doubleMatch = recognizers_text_2.RegExpUtility.getMatches(this.config.percentageRegex, resultText).pop(); + let doubleText = this.replaceUnit(doubleMatch.value); + let splitResult = recognizers_text_2.RegExpUtility.split(this.config.pointRegex, doubleText); + if (splitResult[0] === "") { + splitResult[0] = "零"; + } + let doubleValue = this.getIntValueCJK(splitResult[0]); + if (splitResult.length === 2) { + if (recognizers_text_2.RegExpUtility.isMatch(this.config.negativeNumberSignRegex, splitResult[0])) { + doubleValue -= this.getPointValueCJK(splitResult[1]); + } + else { + doubleValue += this.getPointValueCJK(splitResult[1]); + } + } + result.value = doubleValue; + } + result.resolutionStr = this.toString(result.value) + "%"; + return result; + } + fracParseCJK(extResult) { + let result = new recognizersText.ParseResult(extResult); + let resultText = extResult.text; + let splitResult = recognizers_text_2.RegExpUtility.split(this.config.fracSplitRegex, resultText); + let intPart = ""; + let demoPart = ""; + let numPart = ""; + if (splitResult.length === 3) { + intPart = splitResult[0] || ""; + demoPart = splitResult[1] || ""; + numPart = splitResult[2] || ""; + } + else { + intPart = "零"; + demoPart = splitResult[0] || ""; + numPart = splitResult[1] || ""; + } + let intValue = this.isDigitCJK(intPart) + ? this.getDigitValueCJK(intPart, 1.0) + : this.getIntValueCJK(intPart); + let numValue = this.isDigitCJK(numPart) + ? this.getDigitValueCJK(numPart, 1.0) + : this.getIntValueCJK(numPart); + let demoValue = this.isDigitCJK(demoPart) + ? this.getDigitValueCJK(demoPart, 1.0) + : this.getIntValueCJK(demoPart); + if (recognizers_text_2.RegExpUtility.isMatch(this.config.negativeNumberSignRegex, intPart)) { + result.value = intValue - numValue / demoValue; + } + else { + result.value = intValue + numValue / demoValue; + } + result.resolutionStr = this.toString(result.value); + return result; + } + douParseCJK(extResult) { + let result = new recognizersText.ParseResult(extResult); + let resultText = extResult.text; + if (recognizers_text_2.RegExpUtility.isMatch(this.config.doubleAndRoundRegex, resultText)) { + resultText = this.replaceUnit(resultText); + let power = this.config.roundNumberMapChar.get(resultText.charAt(resultText.length - 1)); + result.value = this.getDigitValueCJK(resultText.substr(0, resultText.length - 1), power); + } + else { + resultText = this.replaceUnit(resultText); + let splitResult = recognizers_text_2.RegExpUtility.split(this.config.pointRegex, resultText); + if (splitResult[0] === "") { + splitResult[0] = "零"; + } + if (recognizers_text_2.RegExpUtility.isMatch(this.config.negativeNumberSignRegex, splitResult[0])) { + result.value = this.getIntValueCJK(splitResult[0]) - this.getPointValueCJK(splitResult[1]); + } + else { + result.value = this.getIntValueCJK(splitResult[0]) + this.getPointValueCJK(splitResult[1]); + } + } + result.resolutionStr = this.toString(result.value); + return result; + } + intParseCJK(extResult) { + let result = new recognizersText.ParseResult(extResult); + result.value = this.getIntValueCJK(extResult.text); + result.resolutionStr = this.toString(result.value); + return result; + } + ordParseCJK(extResult) { + let result = new recognizersText.ParseResult(extResult); + let resultText = extResult.text.substr(1); + if (recognizers_text_2.RegExpUtility.isMatch(this.config.digitNumRegex, resultText) && !recognizers_text_2.RegExpUtility.isMatch(this.config.roundNumberIntegerRegex, resultText)) { + result.value = this.getDigitValueCJK(resultText, 1); + } + else { + result.value = this.getIntValueCJK(resultText); + } + result.resolutionStr = this.toString(result.value); + return result; + } + getDigitValueCJK(value, power) { + let isNegative = false; + let resultStr = value; + if (recognizers_text_2.RegExpUtility.isMatch(this.config.negativeNumberSignRegex, resultStr)) { + isNegative = true; + resultStr = resultStr.substr(1); + } + resultStr = this.replaceFullWithHalf(resultStr); + let result = this.getDigitalValue(resultStr, power); + if (isNegative) { + result = -result; + } + return result; + } + getIntValueCJK(value) { + let resultStr = value; + let isDozen = false; + let isPair = false; + if (recognizers_text_2.RegExpUtility.isMatch(this.config.dozenRegex, resultStr)) { + isDozen = true; + if (this.config.cultureInfo.code.toLowerCase() === culture$2.Culture.Chinese) { + resultStr = resultStr.substr(0, resultStr.length - 1); + } + else if (this.config.cultureInfo.code.toLowerCase() === culture$2.Culture.Japanese) { + resultStr = resultStr.substr(0, resultStr.length - 3); + } + } + else if (recognizers_text_2.RegExpUtility.isMatch(this.config.pairRegex, resultStr)) { + isPair = true; + resultStr = resultStr.substr(0, resultStr.length - 1); + } + resultStr = this.replaceUnit(resultStr); + let intValue = 0; + let partValue = 0; + let beforeValue = 0; + let isRoundBefore = false; + let roundBefore = -1; + let roundDefault = 1; + let isNegative = false; + let hasNumber = false; + if (recognizers_text_2.RegExpUtility.isMatch(this.config.negativeNumberSignRegex, resultStr)) { + isNegative = true; + resultStr = resultStr.substr(1); + } + for (let index = 0; index < resultStr.length; index++) { + let currentChar = resultStr.charAt(index); + if (this.config.roundNumberMapChar.has(currentChar)) { + let roundRecent = this.config.roundNumberMapChar.get(currentChar); + if (!hasNumber) { + beforeValue = 1; + } + if (roundBefore !== -1 && roundRecent > roundBefore) { + if (isRoundBefore) { + intValue += partValue * roundRecent; + isRoundBefore = false; + } + else { + partValue += beforeValue * roundDefault; + intValue += partValue * roundRecent; + } + roundBefore = -1; + partValue = 0; + } + else { + isRoundBefore = true; + partValue += beforeValue * roundRecent; + roundBefore = roundRecent; + if ((index === resultStr.length - 1) || this.config.roundDirectList.some(o => o === currentChar)) { + intValue += partValue; + partValue = 0; + } + } + hasNumber = false; + beforeValue = 0; + roundDefault = roundRecent / 10; + } + else if (this.config.zeroToNineMap.has(currentChar)) { + hasNumber = true; + if (index !== resultStr.length - 1) { + if ((currentChar === "零") && !this.config.roundNumberMapChar.has(resultStr.charAt(index + 1))) { + roundDefault = 1; + } + else { + beforeValue = beforeValue * 10 + this.config.zeroToNineMap.get(currentChar); + isRoundBefore = false; + } + } + else { + if (index === resultStr.length - 1 && this.config.cultureInfo.code.toLowerCase() === culture$2.Culture.Japanese) { + roundDefault = 1; + } + partValue += beforeValue * 10; + partValue += this.config.zeroToNineMap.get(currentChar) * roundDefault; + intValue += partValue; + partValue = 0; + } + } + } + if (isNegative) { + intValue = -intValue; + } + if (isDozen) { + intValue = intValue * 12; + } + if (isPair) { + intValue = intValue * 2; + } + return intValue; + } + getPointValueCJK(value) { + let result = 0; + let scale = 0.1; + for (let index = 0; index < value.length; index++) { + result += scale * this.config.zeroToNineMap.get(value.charAt(index)); + scale *= 0.1; + } + return result; + } + isDigitCJK(value) { + return !recognizers_text_2.StringUtility.isNullOrEmpty(value) + && recognizers_text_2.RegExpUtility.isMatch(this.config.digitNumRegex, value); + } +} +exports.BaseCJKNumberParser = BaseCJKNumberParser; + +}); + +unwrapExports(cjkParsers); + +var agnosticNumberParser = createCommonjsModule(function (module, exports) { +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); + + + + +var AgnosticNumberParserType; +(function (AgnosticNumberParserType) { + AgnosticNumberParserType[AgnosticNumberParserType["Cardinal"] = 0] = "Cardinal"; + AgnosticNumberParserType[AgnosticNumberParserType["Double"] = 1] = "Double"; + AgnosticNumberParserType[AgnosticNumberParserType["Fraction"] = 2] = "Fraction"; + AgnosticNumberParserType[AgnosticNumberParserType["Integer"] = 3] = "Integer"; + AgnosticNumberParserType[AgnosticNumberParserType["Number"] = 4] = "Number"; + AgnosticNumberParserType[AgnosticNumberParserType["Ordinal"] = 5] = "Ordinal"; + AgnosticNumberParserType[AgnosticNumberParserType["Percentage"] = 6] = "Percentage"; +})(AgnosticNumberParserType = exports.AgnosticNumberParserType || (exports.AgnosticNumberParserType = {})); +class AgnosticNumberParserFactory { + static getParser(type, languageConfiguration) { + let isChinese = languageConfiguration.cultureInfo.code.toLowerCase() === culture$2.Culture.Chinese; + let isJapanese = languageConfiguration.cultureInfo.code.toLowerCase() === culture$2.Culture.Japanese; + let parser; + if (isChinese) { + parser = new cjkParsers.BaseCJKNumberParser(languageConfiguration); + } + else if (isJapanese) { + parser = new cjkParsers.BaseCJKNumberParser(languageConfiguration); + } + else { + parser = new parsers$2.BaseNumberParser(languageConfiguration); + } + switch (type) { + case AgnosticNumberParserType.Cardinal: + parser.supportedTypes = [constants.Constants.SYS_NUM_CARDINAL, constants.Constants.SYS_NUM_INTEGER, constants.Constants.SYS_NUM_DOUBLE]; + break; + case AgnosticNumberParserType.Double: + parser.supportedTypes = [constants.Constants.SYS_NUM_DOUBLE]; + break; + case AgnosticNumberParserType.Fraction: + parser.supportedTypes = [constants.Constants.SYS_NUM_FRACTION]; + break; + case AgnosticNumberParserType.Integer: + parser.supportedTypes = [constants.Constants.SYS_NUM_INTEGER]; + break; + case AgnosticNumberParserType.Ordinal: + parser.supportedTypes = [constants.Constants.SYS_NUM_ORDINAL]; + break; + case AgnosticNumberParserType.Percentage: + if (!isChinese && !isJapanese) { + parser = new parsers$2.BasePercentageParser(languageConfiguration); + } + break; + } + return parser; + } +} +exports.AgnosticNumberParserFactory = AgnosticNumberParserFactory; + +}); + +unwrapExports(agnosticNumberParser); + +var baseNumbers = createCommonjsModule(function (module, exports) { +"use strict"; +// ------------------------------------------------------------------------------ +// +// This code was generated by a tool. +// Changes to this file may cause incorrect behavior and will be lost if +// the code is regenerated. +// +// ------------------------------------------------------------------------------ +Object.defineProperty(exports, "__esModule", { value: true }); +var BaseNumbers; +(function (BaseNumbers) { + BaseNumbers.NumberReplaceToken = '@builtin.num'; + BaseNumbers.FractionNumberReplaceToken = '@builtin.num.fraction'; + BaseNumbers.IntegerRegexDefinition = (placeholder, thousandsmark) => { return `(((? { return `(((? +// This code was generated by a tool. +// Changes to this file may cause incorrect behavior and will be lost if +// the code is regenerated. +// +// ------------------------------------------------------------------------------ +Object.defineProperty(exports, "__esModule", { value: true }); + +var EnglishNumeric; +(function (EnglishNumeric) { + EnglishNumeric.LangMarker = 'Eng'; + EnglishNumeric.RoundNumberIntegerRegex = `(hundred|thousand|million|billion|trillion)`; + EnglishNumeric.ZeroToNineIntegerRegex = `(three|seven|eight|four|five|zero|nine|one|two|six)`; + EnglishNumeric.NegativeNumberTermsRegex = `((minus|negative)\\s+)`; + EnglishNumeric.NegativeNumberSignRegex = `^${EnglishNumeric.NegativeNumberTermsRegex}.*`; + EnglishNumeric.AnIntRegex = `(an|a)(?=\\s)`; + EnglishNumeric.TenToNineteenIntegerRegex = `(seventeen|thirteen|fourteen|eighteen|nineteen|fifteen|sixteen|eleven|twelve|ten)`; + EnglishNumeric.TensNumberIntegerRegex = `(seventy|twenty|thirty|eighty|ninety|forty|fifty|sixty)`; + EnglishNumeric.SeparaIntRegex = `(((${EnglishNumeric.TenToNineteenIntegerRegex}|(${EnglishNumeric.TensNumberIntegerRegex}(\\s+(and\\s+)?|\\s*-\\s*)${EnglishNumeric.ZeroToNineIntegerRegex})|${EnglishNumeric.TensNumberIntegerRegex}|${EnglishNumeric.ZeroToNineIntegerRegex})(\\s+${EnglishNumeric.RoundNumberIntegerRegex})*))|((${EnglishNumeric.AnIntRegex}(\\s+${EnglishNumeric.RoundNumberIntegerRegex})+))`; + EnglishNumeric.AllIntRegex = `((((${EnglishNumeric.TenToNineteenIntegerRegex}|(${EnglishNumeric.TensNumberIntegerRegex}(\\s+(and\\s+)?|\\s*-\\s*)${EnglishNumeric.ZeroToNineIntegerRegex})|${EnglishNumeric.TensNumberIntegerRegex}|${EnglishNumeric.ZeroToNineIntegerRegex}|${EnglishNumeric.AnIntRegex})(\\s+${EnglishNumeric.RoundNumberIntegerRegex})+)\\s+(and\\s+)?)*${EnglishNumeric.SeparaIntRegex})`; + EnglishNumeric.PlaceHolderPureNumber = `\\b`; + EnglishNumeric.PlaceHolderDefault = `\\D|\\b`; + EnglishNumeric.NumbersWithPlaceHolder = (placeholder) => { return `(((?(${EnglishNumeric.AllIntRegex})|((?(${EnglishNumeric.AllIntRegex})|(\\d+)(?![\\.,]))(?=\\b)`; + EnglishNumeric.FractionPrepositionWithinPercentModeRegex = `(?<=\\b)(?(${EnglishNumeric.AllIntRegex})|((?(${EnglishNumeric.AllIntRegex})|(\\d+)(?![\\.,]))(?=\\b)`; + EnglishNumeric.AllPointRegex = `((\\s+${EnglishNumeric.ZeroToNineIntegerRegex})+|(\\s+${EnglishNumeric.SeparaIntRegex}))`; + EnglishNumeric.AllFloatRegex = `${EnglishNumeric.AllIntRegex}(\\s+point)${EnglishNumeric.AllPointRegex}`; + EnglishNumeric.DoubleWithMultiplierRegex = `(((? { return `(((? { return `(?<=\\s|^)(?and)`; + EnglishNumeric.NumberWithSuffixPercentage = `(?)`; + EnglishNumeric.LessRegex = `((less|lower|smaller|fewer)(\\s+than)?|below|under|(?|=)<)`; + EnglishNumeric.EqualRegex = `(equal(s|ing)?(\\s+(to|than))?|(?)=)`; + EnglishNumeric.MoreOrEqualPrefix = `((no\\s+${EnglishNumeric.LessRegex})|(at\\s+least))`; + EnglishNumeric.MoreOrEqual = `((${EnglishNumeric.MoreRegex}\\s+(or)?\\s+${EnglishNumeric.EqualRegex})|(${EnglishNumeric.EqualRegex}\\s+(or)?\\s+${EnglishNumeric.MoreRegex})|${EnglishNumeric.MoreOrEqualPrefix}(\\s+(or)?\\s+${EnglishNumeric.EqualRegex})?|(${EnglishNumeric.EqualRegex}\\s+(or)?\\s+)?${EnglishNumeric.MoreOrEqualPrefix}|>\\s*=)`; + EnglishNumeric.MoreOrEqualSuffix = `((and|or)\\s+(more|greater|higher|larger|bigger)((?!\\s+than)|(\\s+than(?!(\\s*\\d+)))))`; + EnglishNumeric.LessOrEqualPrefix = `((no\\s+${EnglishNumeric.MoreRegex})|(at\\s+most))`; + EnglishNumeric.LessOrEqual = `((${EnglishNumeric.LessRegex}\\s+(or)?\\s+${EnglishNumeric.EqualRegex})|(${EnglishNumeric.EqualRegex}\\s+(or)?\\s+${EnglishNumeric.LessRegex})|${EnglishNumeric.LessOrEqualPrefix}(\\s+(or)?\\s+${EnglishNumeric.EqualRegex})?|(${EnglishNumeric.EqualRegex}\\s+(or)?\\s+)?${EnglishNumeric.LessOrEqualPrefix}|<\\s*=)`; + EnglishNumeric.LessOrEqualSuffix = `((and|or)\\s+(less|lower|smaller|fewer)((?!\\s+than)|(\\s+than(?!(\\s*\\d+)))))`; + EnglishNumeric.NumberSplitMark = `(?![,.](?!\\d+))`; + EnglishNumeric.MoreRegexNoNumberSucceed = `((bigger|greater|more|higher|larger)((?!\\s+than)|\\s+(than(?!(\\s*\\d+))))|(above|over)(?!(\\s*\\d+)))`; + EnglishNumeric.LessRegexNoNumberSucceed = `((less|lower|smaller|fewer)((?!\\s+than)|\\s+(than(?!(\\s*\\d+))))|(below|under)(?!(\\s*\\d+)))`; + EnglishNumeric.EqualRegexNoNumberSucceed = `(equal(s|ing)?((?!\\s+(to|than))|(\\s+(to|than)(?!(\\s*\\d+)))))`; + EnglishNumeric.OneNumberRangeMoreRegex1 = `(${EnglishNumeric.MoreOrEqual}|${EnglishNumeric.MoreRegex})\\s*(the\\s+)?(?(${EnglishNumeric.NumberSplitMark}.)+)`; + EnglishNumeric.OneNumberRangeMoreRegex2 = `(?(${EnglishNumeric.NumberSplitMark}.)+)\\s*${EnglishNumeric.MoreOrEqualSuffix}`; + EnglishNumeric.OneNumberRangeMoreSeparateRegex = `(${EnglishNumeric.EqualRegex}\\s+(?(${EnglishNumeric.NumberSplitMark}.)+)(\\s+or\\s+)${EnglishNumeric.MoreRegexNoNumberSucceed})|(${EnglishNumeric.MoreRegex}\\s+(?(${EnglishNumeric.NumberSplitMark}.)+)(\\s+or\\s+)${EnglishNumeric.EqualRegexNoNumberSucceed})`; + EnglishNumeric.OneNumberRangeLessRegex1 = `(${EnglishNumeric.LessOrEqual}|${EnglishNumeric.LessRegex})\\s*(the\\s+)?(?(${EnglishNumeric.NumberSplitMark}.)+)`; + EnglishNumeric.OneNumberRangeLessRegex2 = `(?(${EnglishNumeric.NumberSplitMark}.)+)\\s*${EnglishNumeric.LessOrEqualSuffix}`; + EnglishNumeric.OneNumberRangeLessSeparateRegex = `(${EnglishNumeric.EqualRegex}\\s+(?(${EnglishNumeric.NumberSplitMark}.)+)(\\s+or\\s+)${EnglishNumeric.LessRegexNoNumberSucceed})|(${EnglishNumeric.LessRegex}\\s+(?(${EnglishNumeric.NumberSplitMark}.)+)(\\s+or\\s+)${EnglishNumeric.EqualRegexNoNumberSucceed})`; + EnglishNumeric.OneNumberRangeEqualRegex = `${EnglishNumeric.EqualRegex}\\s*(the\\s+)?(?(${EnglishNumeric.NumberSplitMark}.)+)`; + EnglishNumeric.TwoNumberRangeRegex1 = `between\\s*(the\\s+)?(?(${EnglishNumeric.NumberSplitMark}.)+)\\s*and\\s*(the\\s+)?(?(${EnglishNumeric.NumberSplitMark}.)+)`; + EnglishNumeric.TwoNumberRangeRegex2 = `(${EnglishNumeric.OneNumberRangeMoreRegex1}|${EnglishNumeric.OneNumberRangeMoreRegex2})\\s*(and|but|,)\\s*(${EnglishNumeric.OneNumberRangeLessRegex1}|${EnglishNumeric.OneNumberRangeLessRegex2})`; + EnglishNumeric.TwoNumberRangeRegex3 = `(${EnglishNumeric.OneNumberRangeLessRegex1}|${EnglishNumeric.OneNumberRangeLessRegex2})\\s*(and|but|,)\\s*(${EnglishNumeric.OneNumberRangeMoreRegex1}|${EnglishNumeric.OneNumberRangeMoreRegex2})`; + EnglishNumeric.TwoNumberRangeRegex4 = `(from\\s+)?(?(${EnglishNumeric.NumberSplitMark}(?!\\bfrom\\b).)+)\\s*${EnglishNumeric.TillRegex}\\s*(the\\s+)?(?(${EnglishNumeric.NumberSplitMark}.)+)`; + EnglishNumeric.AmbiguousFractionConnectorsRegex = `(\\bin\\b)`; + EnglishNumeric.DecimalSeparatorChar = '.'; + EnglishNumeric.FractionMarkerToken = 'over'; + EnglishNumeric.NonDecimalSeparatorChar = ','; + EnglishNumeric.HalfADozenText = 'six'; + EnglishNumeric.WordSeparatorToken = 'and'; + EnglishNumeric.WrittenDecimalSeparatorTexts = ['point']; + EnglishNumeric.WrittenGroupSeparatorTexts = ['punto']; + EnglishNumeric.WrittenIntegerSeparatorTexts = ['and']; + EnglishNumeric.WrittenFractionSeparatorTexts = ['and']; + EnglishNumeric.HalfADozenRegex = `half\\s+a\\s+dozen`; + EnglishNumeric.DigitalNumberRegex = `((?<=\\b)(hundred|thousand|million|billion|trillion|dozen(s)?)(?=\\b))|((?<=(\\d|\\b))(k|t|m|g|b)(?=\\b))`; + EnglishNumeric.CardinalNumberMap = new Map([["a", 1], ["zero", 0], ["an", 1], ["one", 1], ["two", 2], ["three", 3], ["four", 4], ["five", 5], ["six", 6], ["seven", 7], ["eight", 8], ["nine", 9], ["ten", 10], ["eleven", 11], ["twelve", 12], ["dozen", 12], ["dozens", 12], ["thirteen", 13], ["fourteen", 14], ["fifteen", 15], ["sixteen", 16], ["seventeen", 17], ["eighteen", 18], ["nineteen", 19], ["twenty", 20], ["thirty", 30], ["forty", 40], ["fifty", 50], ["sixty", 60], ["seventy", 70], ["eighty", 80], ["ninety", 90], ["hundred", 100], ["thousand", 1000], ["million", 1000000], ["billion", 1000000000], ["trillion", 1000000000000]]); + EnglishNumeric.OrdinalNumberMap = new Map([["first", 1], ["second", 2], ["secondary", 2], ["half", 2], ["third", 3], ["fourth", 4], ["quarter", 4], ["fifth", 5], ["sixth", 6], ["seventh", 7], ["eighth", 8], ["ninth", 9], ["tenth", 10], ["eleventh", 11], ["twelfth", 12], ["thirteenth", 13], ["fourteenth", 14], ["fifteenth", 15], ["sixteenth", 16], ["seventeenth", 17], ["eighteenth", 18], ["nineteenth", 19], ["twentieth", 20], ["thirtieth", 30], ["fortieth", 40], ["fiftieth", 50], ["sixtieth", 60], ["seventieth", 70], ["eightieth", 80], ["ninetieth", 90], ["hundredth", 100], ["thousandth", 1000], ["millionth", 1000000], ["billionth", 1000000000], ["trillionth", 1000000000000], ["firsts", 1], ["halves", 2], ["thirds", 3], ["fourths", 4], ["quarters", 4], ["fifths", 5], ["sixths", 6], ["sevenths", 7], ["eighths", 8], ["ninths", 9], ["tenths", 10], ["elevenths", 11], ["twelfths", 12], ["thirteenths", 13], ["fourteenths", 14], ["fifteenths", 15], ["sixteenths", 16], ["seventeenths", 17], ["eighteenths", 18], ["nineteenths", 19], ["twentieths", 20], ["thirtieths", 30], ["fortieths", 40], ["fiftieths", 50], ["sixtieths", 60], ["seventieths", 70], ["eightieths", 80], ["ninetieths", 90], ["hundredths", 100], ["thousandths", 1000], ["millionths", 1000000], ["billionths", 1000000000], ["trillionths", 1000000000000]]); + EnglishNumeric.RoundNumberMap = new Map([["hundred", 100], ["thousand", 1000], ["million", 1000000], ["billion", 1000000000], ["trillion", 1000000000000], ["hundredth", 100], ["thousandth", 1000], ["millionth", 1000000], ["billionth", 1000000000], ["trillionth", 1000000000000], ["hundredths", 100], ["thousandths", 1000], ["millionths", 1000000], ["billionths", 1000000000], ["trillionths", 1000000000000], ["dozen", 12], ["dozens", 12], ["k", 1000], ["m", 1000000], ["g", 1000000000], ["b", 1000000000], ["t", 1000000000000]]); + EnglishNumeric.AmbiguityFiltersDict = new Map([["\\bone\\b", "\\b(the|this|that|which)\\s+(one)\\b"]]); +})(EnglishNumeric = exports.EnglishNumeric || (exports.EnglishNumeric = {})); + +}); + +unwrapExports(englishNumeric); + +var parserConfiguration = createCommonjsModule(function (module, exports) { +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); + + + +class EnglishNumberParserConfiguration { + constructor(ci) { + if (!ci) { + ci = new culture$2.CultureInfo(culture$2.Culture.English); + } + this.cultureInfo = ci; + this.langMarker = englishNumeric.EnglishNumeric.LangMarker; + this.decimalSeparatorChar = englishNumeric.EnglishNumeric.DecimalSeparatorChar; + this.fractionMarkerToken = englishNumeric.EnglishNumeric.FractionMarkerToken; + this.nonDecimalSeparatorChar = englishNumeric.EnglishNumeric.NonDecimalSeparatorChar; + this.halfADozenText = englishNumeric.EnglishNumeric.HalfADozenText; + this.wordSeparatorToken = englishNumeric.EnglishNumeric.WordSeparatorToken; + this.writtenDecimalSeparatorTexts = englishNumeric.EnglishNumeric.WrittenDecimalSeparatorTexts; + this.writtenGroupSeparatorTexts = englishNumeric.EnglishNumeric.WrittenGroupSeparatorTexts; + this.writtenIntegerSeparatorTexts = englishNumeric.EnglishNumeric.WrittenIntegerSeparatorTexts; + this.writtenFractionSeparatorTexts = englishNumeric.EnglishNumeric.WrittenFractionSeparatorTexts; + this.cardinalNumberMap = englishNumeric.EnglishNumeric.CardinalNumberMap; + this.ordinalNumberMap = englishNumeric.EnglishNumeric.OrdinalNumberMap; + this.roundNumberMap = englishNumeric.EnglishNumeric.RoundNumberMap; + this.negativeNumberSignRegex = recognizersText.RegExpUtility.getSafeRegExp(englishNumeric.EnglishNumeric.NegativeNumberSignRegex, "is"); + this.halfADozenRegex = recognizersText.RegExpUtility.getSafeRegExp(englishNumeric.EnglishNumeric.HalfADozenRegex, "gis"); + this.digitalNumberRegex = recognizersText.RegExpUtility.getSafeRegExp(englishNumeric.EnglishNumeric.DigitalNumberRegex, "gis"); + } + normalizeTokenSet(tokens, context) { + let fracWords = new Array(); + let tokenList = Array.from(tokens); + let tokenLen = tokenList.length; + for (let i = 0; i < tokenLen; i++) { + if (tokenList[i].includes("-")) { + let spiltedTokens = tokenList[i].split("-"); + if (spiltedTokens.length === 2 && this.ordinalNumberMap.has(spiltedTokens[1])) { + fracWords.push(spiltedTokens[0]); + fracWords.push(spiltedTokens[1]); + } + else { + fracWords.push(tokenList[i]); + } + } + else if ((i < tokenLen - 2) && tokenList[i + 1] === "-") { + if (this.ordinalNumberMap.has(tokenList[i + 2])) { + fracWords.push(tokenList[i]); + fracWords.push(tokenList[i + 2]); + } + else { + fracWords.push(tokenList[i] + tokenList[i + 1] + tokenList[i + 2]); + } + i += 2; + } + else { + fracWords.push(tokenList[i]); + } + } + return fracWords; + } + resolveCompositeNumber(numberStr) { + if (numberStr.includes("-")) { + let numbers = numberStr.split('-'); + let ret = 0; + numbers.forEach(num => { + if (this.ordinalNumberMap.has(num)) { + ret += this.ordinalNumberMap.get(num); + } + else if (this.cardinalNumberMap.has(num)) { + ret += this.cardinalNumberMap.get(num); + } + }); + return ret; + } + if (this.ordinalNumberMap.has(numberStr)) { + return this.ordinalNumberMap.get(numberStr); + } + if (this.cardinalNumberMap.has(numberStr)) { + return this.cardinalNumberMap.get(numberStr); + } + return 0; + } +} +exports.EnglishNumberParserConfiguration = EnglishNumberParserConfiguration; + +}); + +unwrapExports(parserConfiguration); + +var spanishNumeric = createCommonjsModule(function (module, exports) { +"use strict"; +// ------------------------------------------------------------------------------ +// +// This code was generated by a tool. +// Changes to this file may cause incorrect behavior and will be lost if +// the code is regenerated. +// +// ------------------------------------------------------------------------------ +Object.defineProperty(exports, "__esModule", { value: true }); + +var SpanishNumeric; +(function (SpanishNumeric) { + SpanishNumeric.LangMarker = 'Spa'; + SpanishNumeric.HundredsNumberIntegerRegex = `(cuatrocient[ao]s|trescient[ao]s|seiscient[ao]s|setecient[ao]s|ochocient[ao]s|novecient[ao]s|doscient[ao]s|quinient[ao]s|(? { return `(((?(${SpanishNumeric.AllIntRegex})|((?(${SpanishNumeric.AllIntRegex})|((\\d+)(?!\\.)))(?=\\b)`; + SpanishNumeric.AllPointRegex = `((\\s+${SpanishNumeric.ZeroToNineIntegerRegex})+|(\\s+${SpanishNumeric.AllIntRegex}))`; + SpanishNumeric.AllFloatRegex = `${SpanishNumeric.AllIntRegex}(\\s+(coma|con))${SpanishNumeric.AllPointRegex}`; + SpanishNumeric.DoubleDecimalPointRegex = (placeholder) => { return `(((? { return `(?<=\\s|^)(? { + spanishNumeric.SpanishNumeric.SuffixOrdinalMap.forEach((suffixValue, suffixKey) => { + if (!ordinalNumberMap.has(prefixKey + suffixKey)) { + ordinalNumberMap.set(prefixKey + suffixKey, prefixValue * suffixValue); + } + }); + }); + this.cardinalNumberMap = spanishNumeric.SpanishNumeric.CardinalNumberMap; + this.ordinalNumberMap = ordinalNumberMap; + this.roundNumberMap = spanishNumeric.SpanishNumeric.RoundNumberMap; + this.negativeNumberSignRegex = recognizersText.RegExpUtility.getSafeRegExp(spanishNumeric.SpanishNumeric.NegativeNumberSignRegex, "is"); + this.halfADozenRegex = recognizersText.RegExpUtility.getSafeRegExp(spanishNumeric.SpanishNumeric.HalfADozenRegex); + this.digitalNumberRegex = recognizersText.RegExpUtility.getSafeRegExp(spanishNumeric.SpanishNumeric.DigitalNumberRegex); + } + normalizeTokenSet(tokens, context) { + let result = new Array(); + tokens.forEach((token) => { + let tempWord = token.replace(/^s+/, '').replace(/s+$/, ''); + if (this.ordinalNumberMap.has(tempWord)) { + result.push(tempWord); + return; + } + if (tempWord.endsWith("avo") || tempWord.endsWith("ava")) { + let origTempWord = tempWord; + let newLength = origTempWord.length; + tempWord = origTempWord.substring(0, newLength - 3); + if (this.cardinalNumberMap.has(tempWord)) { + result.push(tempWord); + return; + } + else { + tempWord = origTempWord.substring(0, newLength - 2); + if (this.cardinalNumberMap.has(tempWord)) { + result.push(tempWord); + return; + } + } + } + result.push(token); + }); + return result; + } + resolveCompositeNumber(numberStr) { + if (this.ordinalNumberMap.has(numberStr)) { + return this.ordinalNumberMap.get(numberStr); + } + if (this.cardinalNumberMap.has(numberStr)) { + return this.cardinalNumberMap.get(numberStr); + } + let value = 0; + let finalValue = 0; + let strBuilder = ""; + let lastGoodChar = 0; + for (let i = 0; i < numberStr.length; i++) { + strBuilder = strBuilder.concat(numberStr[i]); + if (this.cardinalNumberMap.has(strBuilder) && this.cardinalNumberMap.get(strBuilder) > value) { + lastGoodChar = i; + value = this.cardinalNumberMap.get(strBuilder); + } + if ((i + 1) === numberStr.length) { + finalValue += value; + strBuilder = ""; + i = lastGoodChar++; + value = 0; + } + } + return finalValue; + } +} +exports.SpanishNumberParserConfiguration = SpanishNumberParserConfiguration; + +}); + +unwrapExports(parserConfiguration$2); + +var portugueseNumeric = createCommonjsModule(function (module, exports) { +"use strict"; +// ------------------------------------------------------------------------------ +// +// This code was generated by a tool. +// Changes to this file may cause incorrect behavior and will be lost if +// the code is regenerated. +// +// ------------------------------------------------------------------------------ +Object.defineProperty(exports, "__esModule", { value: true }); + +var PortugueseNumeric; +(function (PortugueseNumeric) { + PortugueseNumeric.LangMarker = 'Por'; + PortugueseNumeric.HundredsNumberIntegerRegex = `(quatrocent[ao]s|trezent[ao]s|seiscent[ao]s|setecent[ao]s|oitocent[ao]s|novecent[ao]s|duzent[ao]s|quinhent[ao]s|cem|(? { return `(((?(${PortugueseNumeric.AllIntRegex})|((?(${PortugueseNumeric.AllIntRegex})|((\\d+)(?!\\.)))(?=\\b)`; + PortugueseNumeric.AllFloatRegex = `${PortugueseNumeric.AllIntRegex}(\\s+(vírgula|virgula|e|ponto))${PortugueseNumeric.AllPointRegex}`; + PortugueseNumeric.DoubleWithMultiplierRegex = `(((? { return `(((? { return `(?<=\\s|^)(? { + portugueseNumeric.PortugueseNumeric.SuffixOrdinalMap.forEach((suffixValue, suffixKey) => { + if (!ordinalNumberMap.has(prefixKey + suffixKey)) { + ordinalNumberMap.set(prefixKey + suffixKey, prefixValue * suffixValue); + } + }); + }); + this.cardinalNumberMap = portugueseNumeric.PortugueseNumeric.CardinalNumberMap; + this.ordinalNumberMap = ordinalNumberMap; + this.roundNumberMap = portugueseNumeric.PortugueseNumeric.RoundNumberMap; + this.negativeNumberSignRegex = recognizersText.RegExpUtility.getSafeRegExp(portugueseNumeric.PortugueseNumeric.NegativeNumberSignRegex, "is"); + this.halfADozenRegex = recognizersText.RegExpUtility.getSafeRegExp(portugueseNumeric.PortugueseNumeric.HalfADozenRegex); + this.digitalNumberRegex = recognizersText.RegExpUtility.getSafeRegExp(portugueseNumeric.PortugueseNumeric.DigitalNumberRegex); + } + normalizeTokenSet(tokens, context) { + let result = new Array(); + tokens.forEach((token) => { + let tempWord = token.replace(/^s+/, '').replace(/s+$/, ''); + if (this.ordinalNumberMap.has(tempWord)) { + result.push(tempWord); + return; + } + // ends with 'avo' or 'ava' + if (portugueseNumeric.PortugueseNumeric.WrittenFractionSuffix.some(suffix => tempWord.endsWith(suffix))) { + let origTempWord = tempWord; + let newLength = origTempWord.length; + tempWord = origTempWord.substring(0, newLength - 3); + if (!tempWord) { + return; + } + else if (this.cardinalNumberMap.has(tempWord)) { + result.push(tempWord); + return; + } + else { + tempWord = origTempWord.substring(0, newLength - 2); + if (this.cardinalNumberMap.has(tempWord)) { + result.push(tempWord); + return; + } + } + } + result.push(token); + }); + return result; + } + resolveCompositeNumber(numberStr) { + if (this.ordinalNumberMap.has(numberStr)) { + return this.ordinalNumberMap.get(numberStr); + } + if (this.cardinalNumberMap.has(numberStr)) { + return this.cardinalNumberMap.get(numberStr); + } + let value = 0; + let finalValue = 0; + let strBuilder = ""; + let lastGoodChar = 0; + for (let i = 0; i < numberStr.length; i++) { + strBuilder = strBuilder.concat(numberStr[i]); + if (this.cardinalNumberMap.has(strBuilder) && this.cardinalNumberMap.get(strBuilder) > value) { + lastGoodChar = i; + value = this.cardinalNumberMap.get(strBuilder); + } + if ((i + 1) === numberStr.length) { + finalValue += value; + strBuilder = ""; + i = lastGoodChar++; + value = 0; + } + } + return finalValue; + } +} +exports.PortugueseNumberParserConfiguration = PortugueseNumberParserConfiguration; + +}); + +unwrapExports(parserConfiguration$4); + +var frenchNumeric = createCommonjsModule(function (module, exports) { +"use strict"; +// ------------------------------------------------------------------------------ +// +// This code was generated by a tool. +// Changes to this file may cause incorrect behavior and will be lost if +// the code is regenerated. +// +// ------------------------------------------------------------------------------ +Object.defineProperty(exports, "__esModule", { value: true }); + +var FrenchNumeric; +(function (FrenchNumeric) { + FrenchNumeric.LangMarker = 'Fr'; + FrenchNumeric.RoundNumberIntegerRegex = `(cent|mille|millions|million|milliard|milliards|billion|billions)`; + FrenchNumeric.ZeroToNineIntegerRegex = `(et un|un|une|deux|trois|quatre|cinq|six|sept|huit|neuf)`; + FrenchNumeric.TenToNineteenIntegerRegex = `((seize|quinze|quatorze|treize|douze|onze)|dix(\\Wneuf|\\Whuit|\\Wsept)?)`; + FrenchNumeric.TensNumberIntegerRegex = `(quatre\\Wvingt(s|\\Wdix)?|soixante\\Wdix|vingt|trente|quarante|cinquante|soixante|septante|octante|huitante|nonante)`; + FrenchNumeric.DigitsNumberRegex = `\\d|\\d{1,3}(\\.\\d{3})`; + FrenchNumeric.NegativeNumberTermsRegex = `^[.]`; + FrenchNumeric.NegativeNumberSignRegex = `^(${FrenchNumeric.NegativeNumberTermsRegex}\\s+).*`; + FrenchNumeric.HundredsNumberIntegerRegex = `((${FrenchNumeric.ZeroToNineIntegerRegex}(\\s+cent))|cent|((\\s+cent\\s)+${FrenchNumeric.TensNumberIntegerRegex}))`; + FrenchNumeric.BelowHundredsRegex = `((${FrenchNumeric.TenToNineteenIntegerRegex}|(${FrenchNumeric.TensNumberIntegerRegex}([-\\s]+(${FrenchNumeric.TenToNineteenIntegerRegex}|${FrenchNumeric.ZeroToNineIntegerRegex}))?))|${FrenchNumeric.ZeroToNineIntegerRegex})`; + FrenchNumeric.BelowThousandsRegex = `((${FrenchNumeric.HundredsNumberIntegerRegex}(\\s+${FrenchNumeric.BelowHundredsRegex})?|${FrenchNumeric.BelowHundredsRegex}|${FrenchNumeric.TenToNineteenIntegerRegex})|cent\\s+${FrenchNumeric.TenToNineteenIntegerRegex})`; + FrenchNumeric.SupportThousandsRegex = `((${FrenchNumeric.BelowThousandsRegex}|${FrenchNumeric.BelowHundredsRegex})\\s+${FrenchNumeric.RoundNumberIntegerRegex}(\\s+${FrenchNumeric.RoundNumberIntegerRegex})?)`; + FrenchNumeric.SeparaIntRegex = `(${FrenchNumeric.SupportThousandsRegex}(\\s+${FrenchNumeric.SupportThousandsRegex})*(\\s+${FrenchNumeric.BelowThousandsRegex})?|${FrenchNumeric.BelowThousandsRegex})`; + FrenchNumeric.AllIntRegex = `(${FrenchNumeric.SeparaIntRegex}|mille(\\s+${FrenchNumeric.BelowThousandsRegex})?)`; + FrenchNumeric.NumbersWithPlaceHolder = (placeholder) => { return `(((?(${FrenchNumeric.AllIntRegex})|((?(${FrenchNumeric.AllIntRegex})|((\\d+)(?!\\.)))(?=\\b)`; + FrenchNumeric.AllPointRegex = `((\\s+${FrenchNumeric.ZeroToNineIntegerRegex})+|(\\s+${FrenchNumeric.SeparaIntRegex}))`; + FrenchNumeric.AllFloatRegex = `(${FrenchNumeric.AllIntRegex}(\\s+(virgule|point))${FrenchNumeric.AllPointRegex})`; + FrenchNumeric.DoubleDecimalPointRegex = (placeholder) => { return `(((? { return `(?<=\\s|^)(? value) { + lastGoodChar = i; + value = this.cardinalNumberMap.get(strBuilder); + } + if ((i + 1) === numberStr.length) { + finalValue += value; + strBuilder = ""; + i = lastGoodChar++; + value = 0; + } + } + return finalValue; + } +} +exports.FrenchNumberParserConfiguration = FrenchNumberParserConfiguration; + +}); + +unwrapExports(parserConfiguration$6); + +var chineseNumeric = createCommonjsModule(function (module, exports) { +"use strict"; +// ------------------------------------------------------------------------------ +// +// This code was generated by a tool. +// Changes to this file may cause incorrect behavior and will be lost if +// the code is regenerated. +// +// ------------------------------------------------------------------------------ +Object.defineProperty(exports, "__esModule", { value: true }); +var ChineseNumeric; +(function (ChineseNumeric) { + ChineseNumeric.LangMarker = ''; + ChineseNumeric.DecimalSeparatorChar = '.'; + ChineseNumeric.FractionMarkerToken = ''; + ChineseNumeric.NonDecimalSeparatorChar = ' '; + ChineseNumeric.HalfADozenText = ''; + ChineseNumeric.WordSeparatorToken = ''; + ChineseNumeric.RoundNumberMap = new Map([["k", 1000], ["m", 1000000], ["g", 1000000000], ["t", 1000000000000]]); + ChineseNumeric.RoundNumberMapChar = new Map([["十", 10], ["百", 100], ["千", 1000], ["万", 10000], ["亿", 100000000], ["兆", 1000000000000], ["拾", 10], ["佰", 100], ["仟", 1000], ["萬", 10000], ["億", 100000000]]); + ChineseNumeric.ZeroToNineMap = new Map([["0", 0], ["1", 1], ["2", 2], ["3", 3], ["4", 4], ["5", 5], ["6", 6], ["7", 7], ["8", 8], ["9", 9], ["零", 0], ["一", 1], ["二", 2], ["三", 3], ["四", 4], ["五", 5], ["六", 6], ["七", 7], ["八", 8], ["九", 9], ["〇", 0], ["壹", 1], ["贰", 2], ["貳", 2], ["叁", 3], ["肆", 4], ["伍", 5], ["陆", 6], ["陸", 6], ["柒", 7], ["捌", 8], ["玖", 9], ["0", 0], ["1", 1], ["2", 2], ["3", 3], ["4", 4], ["5", 5], ["6", 6], ["7", 7], ["8", 8], ["9", 9], ["半", 0.5], ["两", 2], ["兩", 2], ["俩", 2], ["倆", 2], ["仨", 3]]); + ChineseNumeric.FullToHalfMap = new Map([["0", "0"], ["1", "1"], ["2", "2"], ["3", "3"], ["4", "4"], ["5", "5"], ["6", "6"], ["7", "7"], ["8", "8"], ["9", "9"], ["/", "/"], ["-", "-"], [",", "\'"], ["G", "G"], ["M", "M"], ["T", "T"], ["K", "K"], ["k", "k"], [".", "."]]); + ChineseNumeric.TratoSimMap = new Map([["佰", "百"], ["點", "点"], ["個", "个"], ["幾", "几"], ["對", "对"], ["雙", "双"]]); + ChineseNumeric.UnitMap = new Map([["萬萬", "億"], ["億萬", "兆"], ["萬億", "兆"], ["万万", "亿"], ["万亿", "兆"], ["亿万", "兆"], [" ", ""], ["多", ""], ["余", ""], ["几", ""]]); + ChineseNumeric.RoundDirectList = ['万', '萬', '亿', '兆', '億']; + ChineseNumeric.DigitalNumberRegex = `((?<=(\\d|\\b))(k|t|m|g)(?=\\b))`; + ChineseNumeric.ZeroToNineFullHalfRegex = `[\\d1234567890]`; + ChineseNumeric.DigitNumRegex = `${ChineseNumeric.ZeroToNineFullHalfRegex}+`; + ChineseNumeric.DozenRegex = `.*打$`; + ChineseNumeric.PercentageRegex = `(?<=百\\s*分\\s*之).+|.+(?=个\\s*百\\s*分\\s*点)|.*(?=[%%])`; + ChineseNumeric.DoubleAndRoundRegex = `${ChineseNumeric.ZeroToNineFullHalfRegex}+(\\.${ChineseNumeric.ZeroToNineFullHalfRegex}+)?\\s*[多几余]?[万亿萬億]{1,2}`; + ChineseNumeric.FracSplitRegex = `又|分\\s*之`; + ChineseNumeric.ZeroToNineIntegerRegex = `[一二三四五六七八九零壹贰貳叁肆伍陆陸柒捌玖〇两兩俩倆仨]`; + ChineseNumeric.NegativeNumberTermsRegex = `[负負]`; + ChineseNumeric.NegativeNumberTermsRegexNum = `((?)`; + ChineseNumeric.LessRegex = `(小于|少于|低于|小於|少於|低於|不到|不足|<)`; + ChineseNumeric.EqualRegex = `(等于|等於|=)`; + ChineseNumeric.MoreOrEqual = `((${ChineseNumeric.MoreRegex}\\s*(或|或者)?\\s*${ChineseNumeric.EqualRegex})|至少|最少|不${ChineseNumeric.LessRegex})`; + ChineseNumeric.MoreOrEqualSuffix = `(或|或者)\\s*(以上|之上|更[大多高])`; + ChineseNumeric.LessOrEqual = `((${ChineseNumeric.LessRegex}\\s*(或|或者)?\\s*${ChineseNumeric.EqualRegex})|至多|最多|不${ChineseNumeric.MoreRegex})`; + ChineseNumeric.LessOrEqualSuffix = `(或|或者)\\s*(以下|之下|更[小少低])`; + ChineseNumeric.OneNumberRangeMoreRegex1 = `(${ChineseNumeric.MoreOrEqual}|${ChineseNumeric.MoreRegex})\\s*(?((?!([并且而並的同時时]|(,(?!\\d+))|(,(?!\\d+))|。)).)+)`; + ChineseNumeric.OneNumberRangeMoreRegex2 = `比\\s*(?((?!((,(?!\\d+))|(,(?!\\d+))|。)).)+)\\s*更?[大多高]`; + ChineseNumeric.OneNumberRangeMoreRegex3 = `(?((?!((,(?!\\d+))|(,(?!\\d+))|。|[或者])).)+)\\s*(或|或者)?\\s*([多几余幾餘]|以上|之上|更[大多高])(?![万亿萬億]{1,2})`; + ChineseNumeric.OneNumberRangeLessRegex1 = `(${ChineseNumeric.LessOrEqual}|${ChineseNumeric.LessRegex})\\s*(?((?!([并且而並的同時时]|(,(?!\\d+))|(,(?!\\d+))|。)).)+)`; + ChineseNumeric.OneNumberRangeLessRegex2 = `比\\s*(?((?!((,(?!\\d+))|(,(?!\\d+))|。)).)+)\\s*更?[小少低]`; + ChineseNumeric.OneNumberRangeLessRegex3 = `(?((?!((,(?!\\d+))|(,(?!\\d+))|。|[或者])).)+)\\s*(或|或者)?\\s*(以下|之下|更[小少低])`; + ChineseNumeric.OneNumberRangeMoreSeparateRegex = `^[.]`; + ChineseNumeric.OneNumberRangeLessSeparateRegex = `^[.]`; + ChineseNumeric.OneNumberRangeEqualRegex = `${ChineseNumeric.EqualRegex}\\s*(?((?!((,(?!\\d+))|(,(?!\\d+))|。)).)+)`; + ChineseNumeric.TwoNumberRangeRegex1 = `((位于|在|位於)|(?=(\\d|\\+|\\-)))\\s*(?((?!((,(?!\\d+))|(,(?!\\d+))|。)).)+)\\s*(和|与|與|${ChineseNumeric.TillRegex})\\s*(?((?!((,(?!\\d+))|(,(?!\\d+))|。))[^之])+)\\s*(之)?(间|間)`; + ChineseNumeric.TwoNumberRangeRegex2 = `(${ChineseNumeric.OneNumberRangeMoreRegex1}|${ChineseNumeric.OneNumberRangeMoreRegex2}|${ChineseNumeric.OneNumberRangeMoreRegex3})\\s*(且|并且|而且|並且|((的)?同時)|((的)?同时)|,)?\\s*(${ChineseNumeric.OneNumberRangeLessRegex1}|${ChineseNumeric.OneNumberRangeLessRegex2}|${ChineseNumeric.OneNumberRangeLessRegex3})`; + ChineseNumeric.TwoNumberRangeRegex3 = `(${ChineseNumeric.OneNumberRangeLessRegex1}|${ChineseNumeric.OneNumberRangeLessRegex2}|${ChineseNumeric.OneNumberRangeLessRegex3})\\s*(且|并且|而且|並且|((的)?同時)|((的)?同时)|,)?\\s*(${ChineseNumeric.OneNumberRangeMoreRegex1}|${ChineseNumeric.OneNumberRangeMoreRegex2}|${ChineseNumeric.OneNumberRangeMoreRegex3})`; + ChineseNumeric.TwoNumberRangeRegex4 = `(?((?!((,(?!\\d+))|(,(?!\\d+))|。)).)+)\\s*${ChineseNumeric.TillRegex}\\s*(?((?!((,(?!\\d+))|(,(?!\\d+))|。)).)+)`; + ChineseNumeric.AmbiguousFractionConnectorsRegex = `^[.]`; +})(ChineseNumeric = exports.ChineseNumeric || (exports.ChineseNumeric = {})); + +}); + +unwrapExports(chineseNumeric); + +var parserConfiguration$8 = createCommonjsModule(function (module, exports) { +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); + + + +class ChineseNumberParserConfiguration { + constructor(ci) { + if (!ci) { + ci = new culture$2.CultureInfo(culture$2.Culture.Chinese); + } + this.cultureInfo = ci; + this.langMarker = chineseNumeric.ChineseNumeric.LangMarker; + this.decimalSeparatorChar = chineseNumeric.ChineseNumeric.DecimalSeparatorChar; + this.fractionMarkerToken = chineseNumeric.ChineseNumeric.FractionMarkerToken; + this.nonDecimalSeparatorChar = chineseNumeric.ChineseNumeric.NonDecimalSeparatorChar; + this.halfADozenText = chineseNumeric.ChineseNumeric.HalfADozenText; + this.wordSeparatorToken = chineseNumeric.ChineseNumeric.WordSeparatorToken; + this.writtenDecimalSeparatorTexts = []; + this.writtenGroupSeparatorTexts = []; + this.writtenIntegerSeparatorTexts = []; + this.writtenFractionSeparatorTexts = []; + this.cardinalNumberMap = new Map(); + this.ordinalNumberMap = new Map(); + this.roundNumberMap = chineseNumeric.ChineseNumeric.RoundNumberMap; + this.halfADozenRegex = null; + this.digitalNumberRegex = recognizersText.RegExpUtility.getSafeRegExp(chineseNumeric.ChineseNumeric.DigitalNumberRegex, "gis"); + this.zeroToNineMap = chineseNumeric.ChineseNumeric.ZeroToNineMap; + this.roundNumberMapChar = chineseNumeric.ChineseNumeric.RoundNumberMapChar; + this.fullToHalfMap = chineseNumeric.ChineseNumeric.FullToHalfMap; + this.tratoSimMap = chineseNumeric.ChineseNumeric.TratoSimMap; + this.unitMap = chineseNumeric.ChineseNumeric.UnitMap; + this.roundDirectList = chineseNumeric.ChineseNumeric.RoundDirectList; + this.digitNumRegex = recognizersText.RegExpUtility.getSafeRegExp(chineseNumeric.ChineseNumeric.DigitNumRegex, "gis"); + this.dozenRegex = recognizersText.RegExpUtility.getSafeRegExp(chineseNumeric.ChineseNumeric.DozenRegex, "gis"); + this.percentageRegex = recognizersText.RegExpUtility.getSafeRegExp(chineseNumeric.ChineseNumeric.PercentageRegex, "gis"); + this.doubleAndRoundRegex = recognizersText.RegExpUtility.getSafeRegExp(chineseNumeric.ChineseNumeric.DoubleAndRoundRegex, "gis"); + this.fracSplitRegex = recognizersText.RegExpUtility.getSafeRegExp(chineseNumeric.ChineseNumeric.FracSplitRegex, "gis"); + this.negativeNumberSignRegex = recognizersText.RegExpUtility.getSafeRegExp(chineseNumeric.ChineseNumeric.NegativeNumberSignRegex, "gis"); + this.pointRegex = recognizersText.RegExpUtility.getSafeRegExp(chineseNumeric.ChineseNumeric.PointRegex, "gis"); + this.speGetNumberRegex = recognizersText.RegExpUtility.getSafeRegExp(chineseNumeric.ChineseNumeric.SpeGetNumberRegex, "gis"); + this.pairRegex = recognizersText.RegExpUtility.getSafeRegExp(chineseNumeric.ChineseNumeric.PairRegex, "gis"); + this.roundNumberIntegerRegex = recognizersText.RegExpUtility.getSafeRegExp(chineseNumeric.ChineseNumeric.RoundNumberIntegerRegex, "gis"); + } + normalizeTokenSet(tokens, context) { + return tokens; + } + resolveCompositeNumber(numberStr) { + return 0; + } +} +exports.ChineseNumberParserConfiguration = ChineseNumberParserConfiguration; + +}); + +unwrapExports(parserConfiguration$8); + +var japaneseNumeric = createCommonjsModule(function (module, exports) { +"use strict"; +// ------------------------------------------------------------------------------ +// +// This code was generated by a tool. +// Changes to this file may cause incorrect behavior and will be lost if +// the code is regenerated. +// +// ------------------------------------------------------------------------------ +Object.defineProperty(exports, "__esModule", { value: true }); +var JapaneseNumeric; +(function (JapaneseNumeric) { + JapaneseNumeric.LangMarker = ''; + JapaneseNumeric.DecimalSeparatorChar = '.'; + JapaneseNumeric.FractionMarkerToken = ''; + JapaneseNumeric.NonDecimalSeparatorChar = ' '; + JapaneseNumeric.HalfADozenText = ''; + JapaneseNumeric.WordSeparatorToken = ''; + JapaneseNumeric.RoundNumberMap = new Map([["k", 1000], ["m", 1000000], ["g", 1000000000], ["t", 1000000000000]]); + JapaneseNumeric.RoundNumberMapChar = new Map([["十", 10], ["百", 100], ["千", 1000], ["万", 10000], ["億", 100000000], ["兆", 1000000000000]]); + JapaneseNumeric.ZeroToNineMap = new Map([["0", 0], ["1", 1], ["2", 2], ["3", 3], ["4", 4], ["5", 5], ["6", 6], ["7", 7], ["8", 8], ["9", 9], ["零", 0], ["一", 1], ["二", 2], ["三", 3], ["四", 4], ["五", 5], ["六", 6], ["七", 7], ["八", 8], ["九", 9], ["半", 0.5]]); + JapaneseNumeric.FullToHalfMap = new Map([["0", "0"], ["1", "1"], ["2", "2"], ["3", "3"], ["4", "4"], ["5", "5"], ["6", "6"], ["7", "7"], ["8", "8"], ["9", "9"], ["/", "/"], ["-", "-"], [",", "\'"], ["、", "\'"], ["G", "G"], ["M", "M"], ["T", "T"], ["K", "K"], ["k", "k"], [".", "."]]); + JapaneseNumeric.UnitMap = new Map([["万万", "億"], ["億万", "兆"], ["万億", "兆"], [" ", ""]]); + JapaneseNumeric.RoundDirectList = ['万', '億', '兆']; + JapaneseNumeric.DigitalNumberRegex = `((?<=(\\d|\\b))(k|t|m|g)(?=\\b))`; + JapaneseNumeric.ZeroToNineFullHalfRegex = `[\\d1234567890]`; + JapaneseNumeric.DigitNumRegex = `${JapaneseNumeric.ZeroToNineFullHalfRegex}+`; + JapaneseNumeric.DozenRegex = `.*ダース$`; + JapaneseNumeric.PercentageRegex = `.+(?=パ\\s*ー\\s*セ\\s*ン\\s*ト)|.*(?=[%%])`; + JapaneseNumeric.DoubleAndRoundRegex = `${JapaneseNumeric.ZeroToNineFullHalfRegex}+(\\.${JapaneseNumeric.ZeroToNineFullHalfRegex}+)?\\s*[万億]{1,2}(\\s*(以上))?`; + JapaneseNumeric.FracSplitRegex = `[はと]|分\\s*の`; + JapaneseNumeric.ZeroToNineIntegerRegex = `[一二三四五六七八九]`; + JapaneseNumeric.NegativeNumberTermsRegex = `(マ\\s*イ\\s*ナ\\s*ス)`; + JapaneseNumeric.NegativeNumberTermsRegexNum = `(?)`; + JapaneseNumeric.LessRegex = `(小なり|小さい|低い|<)`; + JapaneseNumeric.EqualRegex = `(等しい|イコール|=)`; + JapaneseNumeric.MoreOrEqual = `((大なりかイコール)|(大きいかイコール)|(大なりか等しい)|(大きいか等しい)|小さくない|以上|最低)`; + JapaneseNumeric.MoreOrEqualSuffix = `(より(大なりイコール|小さくない))`; + JapaneseNumeric.LessOrEqual = `((${JapaneseNumeric.LessRegex}\\s*(或|或者)?\\s*${JapaneseNumeric.EqualRegex})|(小なりかイコール)|(小なりか等しい)|(小さいかイコール)|(小さいか等しい)|(小さいか等しい)|大さくない|以下|最大)`; + JapaneseNumeric.LessOrEqualSuffix = `(小なりイコール|大さくない)`; + JapaneseNumeric.OneNumberRangeMoreRegex1 = `(?((?!(((,|、)(?!\\d+))|((,|、)(?!\\d+))|。)).)+)\\s*((より)\\s*((${JapaneseNumeric.MoreOrEqual}|${JapaneseNumeric.MoreRegex}))|超える|を超える)`; + JapaneseNumeric.OneNumberRangeMoreRegex2 = `(?((?!((,|、(?!\\d+))|(,|、(?!\\d+))|。)).)+)\\s*(より)?(大なり)`; + JapaneseNumeric.OneNumberRangeMoreRegex3 = `(?((?!((,(?!\\d+))|(,(?!\\d+))|。)).)+)\\s*(以上|最低)(?![万億]{1,2})`; + JapaneseNumeric.OneNumberRangeMoreRegex4 = `(${JapaneseNumeric.MoreOrEqual}|${JapaneseNumeric.MoreRegex})\\s*(?((?!(と|は|((と)?同時に)|((と)?そして)|が|,|、|,|(,(?!\\d+))|(,(?!\\d+))|。)).)+)`; + JapaneseNumeric.OneNumberRangeMoreSeparateRegex = `^[.]`; + JapaneseNumeric.OneNumberRangeLessSeparateRegex = `^[.]`; + JapaneseNumeric.OneNumberRangeLessRegex1 = `(?((?!(((,|、)(?!\\d+))|((,|、)(?!\\d+))|。)).)+)\\s*(より)\\s*(${JapaneseNumeric.LessOrEqual}|${JapaneseNumeric.LessRegex})`; + JapaneseNumeric.OneNumberRangeLessRegex2 = `(?((?!((,(?!\\d+))|(,(?!\\d+))|。)).)+)\\s*(より)?(小な)`; + JapaneseNumeric.OneNumberRangeLessRegex3 = `(?((?!((,(?!\\d+))|(,(?!\\d+))|。)).)+)\\s*(以下|未満)(?![万億]{1,2})`; + JapaneseNumeric.OneNumberRangeLessRegex4 = `(${JapaneseNumeric.LessOrEqual}|${JapaneseNumeric.LessRegex})\\s*(?((?!(と|は|((と)?同時に)|((と)?そして)|が|,|、|,|(,(?!\\d+))|(,(?!\\d+))|。)).)+)`; + JapaneseNumeric.OneNumberRangeEqualRegex = `(((?((?!((,(?!\\d+))|(,(?!\\d+))|。)).)+)\\s*(に)\\s*${JapaneseNumeric.EqualRegex})|(${JapaneseNumeric.EqualRegex}\\s*(?((?!((,(?!\\d+))|(,(?!\\d+))|。)).)+)))`; + JapaneseNumeric.TwoNumberRangeRegex1 = `(?((?!((,(?!\\d+))|(,(?!\\d+))|。)).)+)\\s*(と|${JapaneseNumeric.TillRegex})\\s*(?((?!((,(?!\\d+))|(,(?!\\d+))|。)).)+)\\s*(の間)`; + JapaneseNumeric.TwoNumberRangeRegex2 = `(${JapaneseNumeric.OneNumberRangeMoreRegex1}|${JapaneseNumeric.OneNumberRangeMoreRegex2}|${JapaneseNumeric.OneNumberRangeMoreRegex3}|${JapaneseNumeric.OneNumberRangeMoreRegex4})\\s*(と|は|((と)?同時に)|((と)?そして)|が|,|、|,)?\\s*(${JapaneseNumeric.OneNumberRangeLessRegex1}|${JapaneseNumeric.OneNumberRangeLessRegex2}|${JapaneseNumeric.OneNumberRangeLessRegex3}|${JapaneseNumeric.OneNumberRangeLessRegex4})`; + JapaneseNumeric.TwoNumberRangeRegex3 = `(${JapaneseNumeric.OneNumberRangeLessRegex1}|${JapaneseNumeric.OneNumberRangeLessRegex2}|${JapaneseNumeric.OneNumberRangeLessRegex3}|${JapaneseNumeric.OneNumberRangeLessRegex4})\\s*(と|は|((と)?同時に)|((と)?そして)|が|,|、|,)?\\s*(${JapaneseNumeric.OneNumberRangeMoreRegex1}|${JapaneseNumeric.OneNumberRangeMoreRegex2}|${JapaneseNumeric.OneNumberRangeMoreRegex3}|${JapaneseNumeric.OneNumberRangeMoreRegex4})`; + JapaneseNumeric.TwoNumberRangeRegex4 = `(?((?!((,(?!\\d+))|(,(?!\\d+))|。)).)+)\\s*${JapaneseNumeric.TillRegex}\\s*(?((?!((,(?!\\d+))|(,(?!\\d+))|。)).)+)`; + JapaneseNumeric.AmbiguousFractionConnectorsRegex = `^[.]`; +})(JapaneseNumeric = exports.JapaneseNumeric || (exports.JapaneseNumeric = {})); + +}); + +unwrapExports(japaneseNumeric); + +var parserConfiguration$10 = createCommonjsModule(function (module, exports) { +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); + + + +class JapaneseNumberParserConfiguration { + // readonly NumberOptions Options { get; } + // readonly Regex FractionPrepositionRegex { get; } + // readonly string NonDecimalSeparatorText + constructor(ci) { + if (!ci) { + ci = new culture$2.CultureInfo(culture$2.Culture.Japanese); + } + this.cultureInfo = ci; + this.langMarker = japaneseNumeric.JapaneseNumeric.LangMarker; + this.decimalSeparatorChar = japaneseNumeric.JapaneseNumeric.DecimalSeparatorChar; + this.fractionMarkerToken = japaneseNumeric.JapaneseNumeric.FractionMarkerToken; + this.nonDecimalSeparatorChar = japaneseNumeric.JapaneseNumeric.NonDecimalSeparatorChar; + this.halfADozenText = japaneseNumeric.JapaneseNumeric.HalfADozenText; + this.wordSeparatorToken = japaneseNumeric.JapaneseNumeric.WordSeparatorToken; + this.writtenDecimalSeparatorTexts = []; + this.writtenGroupSeparatorTexts = []; + this.writtenIntegerSeparatorTexts = []; + this.writtenFractionSeparatorTexts = []; + this.cardinalNumberMap = new Map(); + this.ordinalNumberMap = new Map(); + this.roundNumberMap = japaneseNumeric.JapaneseNumeric.RoundNumberMap; + this.halfADozenRegex = null; + this.digitalNumberRegex = recognizersText.RegExpUtility.getSafeRegExp(japaneseNumeric.JapaneseNumeric.DigitalNumberRegex, "gis"); + this.zeroToNineMap = japaneseNumeric.JapaneseNumeric.ZeroToNineMap; + this.roundNumberMapChar = japaneseNumeric.JapaneseNumeric.RoundNumberMapChar; + this.fullToHalfMap = japaneseNumeric.JapaneseNumeric.FullToHalfMap; + this.tratoSimMap = null; + this.unitMap = japaneseNumeric.JapaneseNumeric.UnitMap; + this.roundDirectList = japaneseNumeric.JapaneseNumeric.RoundDirectList; + this.digitNumRegex = recognizersText.RegExpUtility.getSafeRegExp(japaneseNumeric.JapaneseNumeric.DigitNumRegex, "gis"); + this.dozenRegex = recognizersText.RegExpUtility.getSafeRegExp(japaneseNumeric.JapaneseNumeric.DozenRegex, "gis"); + this.percentageRegex = recognizersText.RegExpUtility.getSafeRegExp(japaneseNumeric.JapaneseNumeric.PercentageRegex, "gis"); + this.doubleAndRoundRegex = recognizersText.RegExpUtility.getSafeRegExp(japaneseNumeric.JapaneseNumeric.DoubleAndRoundRegex, "gis"); + this.fracSplitRegex = recognizersText.RegExpUtility.getSafeRegExp(japaneseNumeric.JapaneseNumeric.FracSplitRegex, "gis"); + this.negativeNumberSignRegex = recognizersText.RegExpUtility.getSafeRegExp(japaneseNumeric.JapaneseNumeric.NegativeNumberSignRegex, "is"); + this.pointRegex = recognizersText.RegExpUtility.getSafeRegExp(japaneseNumeric.JapaneseNumeric.PointRegex, "gis"); + this.speGetNumberRegex = recognizersText.RegExpUtility.getSafeRegExp(japaneseNumeric.JapaneseNumeric.SpeGetNumberRegex, "gis"); + this.pairRegex = recognizersText.RegExpUtility.getSafeRegExp(japaneseNumeric.JapaneseNumeric.PairRegex, "gis"); + this.roundNumberIntegerRegex = recognizersText.RegExpUtility.getSafeRegExp(japaneseNumeric.JapaneseNumeric.RoundNumberIntegerRegex, "gis"); + } + normalizeTokenSet(tokens, context) { + return tokens; + } + resolveCompositeNumber(numberStr) { + return 0; + } +} +exports.JapaneseNumberParserConfiguration = JapaneseNumberParserConfiguration; + +}); + +unwrapExports(parserConfiguration$10); + +/** + * lodash (Custom Build) + * Build: `lodash modularize exports="npm" -o ./` + * Copyright jQuery Foundation and other contributors + * Released under MIT license + * Based on Underscore.js 1.8.3 + * Copyright Jeremy Ashkenas, DocumentCloud and Investigative Reporters & Editors + */ + +/** Used as references for various `Number` constants. */ +var INFINITY$1 = 1 / 0; + +/** `Object#toString` result references. */ +var symbolTag$1 = '[object Symbol]'; + +/** + * Used to match `RegExp` + * [syntax characters](http://ecma-international.org/ecma-262/6.0/#sec-patterns). + */ +var reRegExpChar = /[\\^$.*+?()[\]{}|]/g; +var reHasRegExpChar = RegExp(reRegExpChar.source); + +/** Detect free variable `global` from Node.js. */ +var freeGlobal$1 = typeof commonjsGlobal == 'object' && commonjsGlobal && commonjsGlobal.Object === Object && commonjsGlobal; + +/** Detect free variable `self`. */ +var freeSelf$1 = typeof self == 'object' && self && self.Object === Object && self; + +/** Used as a reference to the global object. */ +var root$1 = freeGlobal$1 || freeSelf$1 || Function('return this')(); + +/** Used for built-in method references. */ +var objectProto$1 = Object.prototype; + +/** + * Used to resolve the + * [`toStringTag`](http://ecma-international.org/ecma-262/6.0/#sec-object.prototype.tostring) + * of values. + */ +var objectToString$1 = objectProto$1.toString; + +/** Built-in value references. */ +var Symbol$2 = root$1.Symbol; + +/** Used to convert symbols to primitives and strings. */ +var symbolProto$1 = Symbol$2 ? Symbol$2.prototype : undefined; +var symbolToString$1 = symbolProto$1 ? symbolProto$1.toString : undefined; + +/** + * The base implementation of `_.toString` which doesn't convert nullish + * values to empty strings. + * + * @private + * @param {*} value The value to process. + * @returns {string} Returns the string. + */ +function baseToString$1(value) { + // Exit early for strings to avoid a performance hit in some environments. + if (typeof value == 'string') { + return value; + } + if (isSymbol$1(value)) { + return symbolToString$1 ? symbolToString$1.call(value) : ''; + } + var result = (value + ''); + return (result == '0' && (1 / value) == -INFINITY$1) ? '-0' : result; +} + +/** + * Checks if `value` is object-like. A value is object-like if it's not `null` + * and has a `typeof` result of "object". + * + * @static + * @memberOf _ + * @since 4.0.0 + * @category Lang + * @param {*} value The value to check. + * @returns {boolean} Returns `true` if `value` is object-like, else `false`. + * @example + * + * _.isObjectLike({}); + * // => true + * + * _.isObjectLike([1, 2, 3]); + * // => true + * + * _.isObjectLike(_.noop); + * // => false + * + * _.isObjectLike(null); + * // => false + */ +function isObjectLike$1(value) { + return !!value && typeof value == 'object'; +} + +/** + * Checks if `value` is classified as a `Symbol` primitive or object. + * + * @static + * @memberOf _ + * @since 4.0.0 + * @category Lang + * @param {*} value The value to check. + * @returns {boolean} Returns `true` if `value` is a symbol, else `false`. + * @example + * + * _.isSymbol(Symbol.iterator); + * // => true + * + * _.isSymbol('abc'); + * // => false + */ +function isSymbol$1(value) { + return typeof value == 'symbol' || + (isObjectLike$1(value) && objectToString$1.call(value) == symbolTag$1); +} + +/** + * Converts `value` to a string. An empty string is returned for `null` + * and `undefined` values. The sign of `-0` is preserved. + * + * @static + * @memberOf _ + * @since 4.0.0 + * @category Lang + * @param {*} value The value to process. + * @returns {string} Returns the string. + * @example + * + * _.toString(null); + * // => '' + * + * _.toString(-0); + * // => '-0' + * + * _.toString([1, 2, 3]); + * // => '1,2,3' + */ +function toString$1(value) { + return value == null ? '' : baseToString$1(value); +} + +/** + * Escapes the `RegExp` special characters "^", "$", "\", ".", "*", "+", + * "?", "(", ")", "[", "]", "{", "}", and "|" in `string`. + * + * @static + * @memberOf _ + * @since 3.0.0 + * @category String + * @param {string} [string=''] The string to escape. + * @returns {string} Returns the escaped string. + * @example + * + * _.escapeRegExp('[lodash](https://lodash.com/)'); + * // => '\[lodash\]\(https://lodash\.com/\)' + */ +function escapeRegExp(string) { + string = toString$1(string); + return (string && reHasRegExpChar.test(string)) + ? string.replace(reRegExpChar, '\\$&') + : string; +} + +var lodash_escaperegexp = escapeRegExp; + +var extractors$4 = createCommonjsModule(function (module, exports) { +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); + + + + +class BaseNumberExtractor { + constructor() { + this.extractType = ""; + this.negativeNumberTermsRegex = null; + } + extract(source) { + if (!source || source.trim().length === 0) { + return []; + } + let result = new Array(); + let matchSource = new Map(); + let matched = new Array(source.length); + for (let i = 0; i < source.length; i++) { + matched[i] = false; + } + let collections = this.regexes + .map(o => ({ matches: recognizersText.RegExpUtility.getMatches(o.regExp, source), value: o.value })) + .filter(o => o.matches && o.matches.length); + collections.forEach(collection => { + collection.matches.forEach(m => { + for (let j = 0; j < m.length; j++) { + matched[m.index + j] = true; + } + // Keep Source Data for extra information + matchSource.set(m, collection.value); + }); + }); + let last = -1; + for (let i = 0; i < source.length; i++) { + if (matched[i]) { + if (i + 1 === source.length || !matched[i + 1]) { + let start = last + 1; + let length = i - last; + let substr = source.substring(start, start + length); + let srcMatch = Array.from(matchSource.keys()).find(m => m.index === start && m.length === length); + // Extract negative numbers + if (this.negativeNumberTermsRegex !== null) { + let match = source.substr(0, start).match(this.negativeNumberTermsRegex); + if (match) { + start = match.index; + length = length + match[0].length; + substr = match[0] + substr; + } + } + if (srcMatch) { + result.push({ + start: start, + length: length, + text: substr, + type: this.extractType, + data: matchSource.has(srcMatch) ? matchSource.get(srcMatch) : null + }); + } + } + } + else { + last = i; + } + } + return result; + } + generateLongFormatNumberRegexes(type, placeholder = baseNumbers.BaseNumbers.PlaceHolderDefault) { + let thousandsMark = lodash_escaperegexp(type.thousandsMark); + let decimalsMark = lodash_escaperegexp(type.decimalsMark); + let regexDefinition = type.decimalsMark === '\0' + ? baseNumbers.BaseNumbers.IntegerRegexDefinition(placeholder, thousandsMark) + : baseNumbers.BaseNumbers.DoubleRegexDefinition(placeholder, thousandsMark, decimalsMark); + return recognizersText.RegExpUtility.getSafeRegExp(regexDefinition, "gis"); + } +} +exports.BaseNumberExtractor = BaseNumberExtractor; +class BasePercentageExtractor { + constructor(numberExtractor) { + this.extractType = constants.Constants.SYS_NUM_PERCENTAGE; + this.numberExtractor = numberExtractor; + this.regexes = this.initRegexes(); + } + extract(source) { + let originSource = source; + let positionMap; + let numExtResults; + // preprocess the source sentence via extracting and replacing the numbers in it + let preprocess = this.preprocessStrWithNumberExtracted(originSource); + source = preprocess.source; + positionMap = preprocess.positionMap; + numExtResults = preprocess.numExtResults; + let allMatches = this.regexes.map(rx => recognizersText.RegExpUtility.getMatches(rx, source)); + let matched = new Array(source.length); + for (let i = 0; i < source.length; i++) { + matched[i] = false; + } + for (let i = 0; i < allMatches.length; i++) { + allMatches[i].forEach(match => { + for (let j = 0; j < match.length; j++) { + matched[j + match.index] = true; + } + }); + } + let result = new Array(); + let last = -1; + // get index of each matched results + for (let i = 0; i < source.length; i++) { + if (matched[i]) { + if (i + 1 === source.length || matched[i + 1] === false) { + let start = last + 1; + let length = i - last; + let substr = source.substring(start, start + length); + let er = { + start: start, + length: length, + text: substr, + type: this.extractType + }; + result.push(er); + } + } + else { + last = i; + } + } + // post-processing, restoring the extracted numbers + this.postProcessing(result, originSource, positionMap, numExtResults); + return result; + } + // get the number extractor results and convert the extracted numbers to @sys.num, so that the regexes can work + preprocessStrWithNumberExtracted(str) { + let positionMap = new Map(); + let numExtResults = this.numberExtractor.extract(str); + let replaceText = baseNumbers.BaseNumbers.NumberReplaceToken; + let match = new Array(str.length); + let strParts = new Array(); + let start; + let end; + for (let i = 0; i < str.length; i++) { + match[i] = -1; + } + for (let i = 0; i < numExtResults.length; i++) { + let extraction = numExtResults[i]; + start = extraction.start; + end = extraction.length + start; + for (let j = start; j < end; j++) { + if (match[j] === -1) { + match[j] = i; + } + } + } + start = 0; + for (let i = 1; i < str.length; i++) { + if (match[i] !== match[i - 1]) { + strParts.push([start, i - 1]); + start = i; + } + } + strParts.push([start, str.length - 1]); + let ret = ""; + let index = 0; + strParts.forEach(strPart => { + start = strPart[0]; + end = strPart[1]; + let type = match[start]; + if (type === -1) { + ret += str.substring(start, end + 1); + for (let i = start; i <= end; i++) { + positionMap.set(index++, i); + } + } + else { + let originalText = str.substring(start, end + 1); + ret += replaceText; + for (let i = 0; i < replaceText.length; i++) { + positionMap.set(index++, start); + } + } + }); + positionMap.set(index++, str.length); + return { + numExtResults: numExtResults, + source: ret, + positionMap: positionMap + }; + } + // replace the @sys.num to the real patterns, directly modifies the ExtractResult + postProcessing(results, originSource, positionMap, numExtResults) { + let replaceText = baseNumbers.BaseNumbers.NumberReplaceToken; + for (let i = 0; i < results.length; i++) { + let start = results[i].start; + let end = start + results[i].length; + let str = results[i].text; + if (positionMap.has(start) && positionMap.has(end)) { + let originStart = positionMap.get(start); + let originLenth = positionMap.get(end) - originStart; + results[i].start = originStart; + results[i].length = originLenth; + results[i].text = originSource.substring(originStart, originStart + originLenth).trim(); + let numStart = str.indexOf(replaceText); + if (numStart !== -1) { + let numOriginStart = start + numStart; + if (positionMap.has(numStart)) { + let dataKey = originSource.substring(positionMap.get(numOriginStart), positionMap.get(numOriginStart + replaceText.length)); + for (let j = i; j < numExtResults.length; j++) { + if (results[i].start === numExtResults[j].start && results[i].text.includes(numExtResults[j].text)) { + results[i].data = [dataKey, numExtResults[j]]; + break; + } + } + } + } + } + } + } + // read the rules + buildRegexes(regexStrs, ignoreCase = true) { + return regexStrs.map(regexStr => { + let options = "gs"; + if (ignoreCase) { + options += "i"; + } + return recognizersText.RegExpUtility.getSafeRegExp(regexStr, options); + }); + } +} +BasePercentageExtractor.numExtType = constants.Constants.SYS_NUM; +exports.BasePercentageExtractor = BasePercentageExtractor; + +}); + +unwrapExports(extractors$4); + +var extractors$2 = createCommonjsModule(function (module, exports) { +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); + + + + + +class EnglishNumberExtractor extends extractors$4.BaseNumberExtractor { + constructor(mode = models$2.NumberMode.Default) { + super(); + this.extractType = constants.Constants.SYS_NUM; + this.negativeNumberTermsRegex = recognizersText.RegExpUtility.getSafeRegExp(englishNumeric.EnglishNumeric.NegativeNumberTermsRegex + "$", "is"); + let regexes = new Array(); + // Add Cardinal + let cardExtract = null; + switch (mode) { + case models$2.NumberMode.PureNumber: + cardExtract = new EnglishCardinalExtractor(englishNumeric.EnglishNumeric.PlaceHolderPureNumber); + break; + case models$2.NumberMode.Currency: + regexes.push({ regExp: recognizersText.RegExpUtility.getSafeRegExp(englishNumeric.EnglishNumeric.CurrencyRegex, "gs"), value: "IntegerNum" }); + break; + case models$2.NumberMode.Default: + break; + } + if (cardExtract === null) { + cardExtract = new EnglishCardinalExtractor(); + } + cardExtract.regexes.forEach(r => regexes.push(r)); + // Add Fraction + let fracExtract = new EnglishFractionExtractor(); + fracExtract.regexes.forEach(r => regexes.push(r)); + this.regexes = regexes; + } +} +exports.EnglishNumberExtractor = EnglishNumberExtractor; +class EnglishCardinalExtractor extends extractors$4.BaseNumberExtractor { + constructor(placeholder = englishNumeric.EnglishNumeric.PlaceHolderDefault) { + super(); + this.extractType = constants.Constants.SYS_NUM_CARDINAL; + let regexes = new Array(); + // Add Integer Regexes + let intExtract = new EnglishIntegerExtractor(placeholder); + intExtract.regexes.forEach(r => regexes.push(r)); + // Add Double Regexes + let doubleExtract = new EnglishDoubleExtractor(placeholder); + doubleExtract.regexes.forEach(r => regexes.push(r)); + this.regexes = regexes; + } +} +exports.EnglishCardinalExtractor = EnglishCardinalExtractor; +class EnglishIntegerExtractor extends extractors$4.BaseNumberExtractor { + constructor(placeholder = englishNumeric.EnglishNumeric.PlaceHolderDefault) { + super(); + this.extractType = constants.Constants.SYS_NUM_INTEGER; + let regexes = new Array({ + regExp: recognizersText.RegExpUtility.getSafeRegExp(englishNumeric.EnglishNumeric.NumbersWithPlaceHolder(placeholder), "gi"), + value: "IntegerNum" + }, { + regExp: recognizersText.RegExpUtility.getSafeRegExp(englishNumeric.EnglishNumeric.NumbersWithSuffix, "gs"), + value: "IntegerNum" + }, { + regExp: this.generateLongFormatNumberRegexes(models$2.LongFormatType.integerNumComma, placeholder), + value: "IntegerNum" + }, { + regExp: this.generateLongFormatNumberRegexes(models$2.LongFormatType.integerNumBlank, placeholder), + value: "IntegerNum" + }, { + regExp: this.generateLongFormatNumberRegexes(models$2.LongFormatType.integerNumNoBreakSpace, placeholder), + value: "IntegerNum" + }, { + regExp: recognizersText.RegExpUtility.getSafeRegExp(englishNumeric.EnglishNumeric.RoundNumberIntegerRegexWithLocks, "gis"), + value: "IntegerNum" + }, { + regExp: recognizersText.RegExpUtility.getSafeRegExp(englishNumeric.EnglishNumeric.NumbersWithDozenSuffix, "gis"), + value: "IntegerNum" + }, { + regExp: recognizersText.RegExpUtility.getSafeRegExp(englishNumeric.EnglishNumeric.AllIntRegexWithLocks, "gis"), + value: "IntegerEng" + }, { + regExp: recognizersText.RegExpUtility.getSafeRegExp(englishNumeric.EnglishNumeric.AllIntRegexWithDozenSuffixLocks, "gis"), + value: "IntegerEng" + }); + this.regexes = regexes; + } +} +exports.EnglishIntegerExtractor = EnglishIntegerExtractor; +class EnglishDoubleExtractor extends extractors$4.BaseNumberExtractor { + constructor(placeholder = englishNumeric.EnglishNumeric.PlaceHolderDefault) { + super(); + this.extractType = constants.Constants.SYS_NUM_DOUBLE; + let regexes = new Array({ + regExp: recognizersText.RegExpUtility.getSafeRegExp(englishNumeric.EnglishNumeric.DoubleDecimalPointRegex(placeholder), "gis"), + value: "DoubleNum" + }, { + regExp: recognizersText.RegExpUtility.getSafeRegExp(englishNumeric.EnglishNumeric.DoubleWithoutIntegralRegex(placeholder), "gis"), + value: "DoubleNum" + }, { + regExp: this.generateLongFormatNumberRegexes(models$2.LongFormatType.doubleNumCommaDot, placeholder), + value: "DoubleNum" + }, { + regExp: this.generateLongFormatNumberRegexes(models$2.LongFormatType.doubleNumNoBreakSpaceDot, placeholder), + value: "DoubleNum" + }, { + regExp: recognizersText.RegExpUtility.getSafeRegExp(englishNumeric.EnglishNumeric.DoubleWithMultiplierRegex, "gs"), + value: "DoubleNum" + }, { + regExp: recognizersText.RegExpUtility.getSafeRegExp(englishNumeric.EnglishNumeric.DoubleWithRoundNumber, "gis"), + value: "DoubleNum" + }, { + regExp: recognizersText.RegExpUtility.getSafeRegExp(englishNumeric.EnglishNumeric.DoubleAllFloatRegex, "gis"), + value: "DoubleEng" + }, { + regExp: recognizersText.RegExpUtility.getSafeRegExp(englishNumeric.EnglishNumeric.DoubleExponentialNotationRegex, "gis"), + value: "DoublePow" + }, { + regExp: recognizersText.RegExpUtility.getSafeRegExp(englishNumeric.EnglishNumeric.DoubleCaretExponentialNotationRegex, "gis"), + value: "DoublePow" + }); + this.regexes = regexes; + } +} +exports.EnglishDoubleExtractor = EnglishDoubleExtractor; +class EnglishFractionExtractor extends extractors$4.BaseNumberExtractor { + constructor() { + super(); + this.extractType = constants.Constants.SYS_NUM_FRACTION; + let regexes = new Array({ + regExp: recognizersText.RegExpUtility.getSafeRegExp(englishNumeric.EnglishNumeric.FractionNotationWithSpacesRegex, "gis"), + value: "FracNum" + }, { + regExp: recognizersText.RegExpUtility.getSafeRegExp(englishNumeric.EnglishNumeric.FractionNotationRegex, "gis"), + value: "FracNum" + }, { + regExp: recognizersText.RegExpUtility.getSafeRegExp(englishNumeric.EnglishNumeric.FractionNounRegex, "gis"), + value: "FracEng" + }, { + regExp: recognizersText.RegExpUtility.getSafeRegExp(englishNumeric.EnglishNumeric.FractionNounWithArticleRegex, "gis"), + value: "FracEng" + }, { + regExp: recognizersText.RegExpUtility.getSafeRegExp(englishNumeric.EnglishNumeric.FractionPrepositionRegex, "gis"), + value: "FracEng" + }); + this.regexes = regexes; + } +} +exports.EnglishFractionExtractor = EnglishFractionExtractor; +class EnglishOrdinalExtractor extends extractors$4.BaseNumberExtractor { + constructor() { + super(); + this.extractType = constants.Constants.SYS_NUM_ORDINAL; + let regexes = new Array({ + regExp: recognizersText.RegExpUtility.getSafeRegExp(englishNumeric.EnglishNumeric.OrdinalSuffixRegex, "gis"), + value: "OrdinalNum" + }, { + regExp: recognizersText.RegExpUtility.getSafeRegExp(englishNumeric.EnglishNumeric.OrdinalNumericRegex, "gis"), + value: "OrdinalNum" + }, { + regExp: recognizersText.RegExpUtility.getSafeRegExp(englishNumeric.EnglishNumeric.OrdinalEnglishRegex, "gis"), + value: "OrdEng" + }, { + regExp: recognizersText.RegExpUtility.getSafeRegExp(englishNumeric.EnglishNumeric.OrdinalRoundNumberRegex, "gis"), + value: "OrdEng" + }); + this.regexes = regexes; + } +} +exports.EnglishOrdinalExtractor = EnglishOrdinalExtractor; +class EnglishPercentageExtractor extends extractors$4.BasePercentageExtractor { + constructor() { + super(new EnglishNumberExtractor()); + } + initRegexes() { + let regexStrs = [ + englishNumeric.EnglishNumeric.NumberWithSuffixPercentage, + englishNumeric.EnglishNumeric.NumberWithPrefixPercentage + ]; + return this.buildRegexes(regexStrs); + } +} +exports.EnglishPercentageExtractor = EnglishPercentageExtractor; + +}); + +unwrapExports(extractors$2); + +var extractors$6 = createCommonjsModule(function (module, exports) { +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); + + + + + +class SpanishNumberExtractor extends extractors$4.BaseNumberExtractor { + constructor(mode = models$2.NumberMode.Default) { + super(); + this.extractType = constants.Constants.SYS_NUM; + let regexes = new Array(); + // Add Cardinal + let cardExtract = null; + switch (mode) { + case models$2.NumberMode.PureNumber: + cardExtract = new SpanishCardinalExtractor(spanishNumeric.SpanishNumeric.PlaceHolderPureNumber); + break; + case models$2.NumberMode.Currency: + regexes.push({ regExp: recognizersText.RegExpUtility.getSafeRegExp(spanishNumeric.SpanishNumeric.CurrencyRegex, "gs"), value: "IntegerNum" }); + break; + case models$2.NumberMode.Default: + break; + } + if (cardExtract === null) { + cardExtract = new SpanishCardinalExtractor(); + } + cardExtract.regexes.forEach(r => regexes.push(r)); + // Add Fraction + let fracExtract = new SpanishFractionExtractor(); + fracExtract.regexes.forEach(r => regexes.push(r)); + this.regexes = regexes; + } +} +exports.SpanishNumberExtractor = SpanishNumberExtractor; +class SpanishCardinalExtractor extends extractors$4.BaseNumberExtractor { + constructor(placeholder = spanishNumeric.SpanishNumeric.PlaceHolderDefault) { + super(); + this.extractType = constants.Constants.SYS_NUM_CARDINAL; + let regexes = new Array(); + // Add Integer Regexes + let intExtract = new SpanishIntegerExtractor(placeholder); + intExtract.regexes.forEach(r => regexes.push(r)); + // Add Double Regexes + let doubleExtract = new SpanishDoubleExtractor(placeholder); + doubleExtract.regexes.forEach(r => regexes.push(r)); + this.regexes = regexes; + } +} +exports.SpanishCardinalExtractor = SpanishCardinalExtractor; +class SpanishIntegerExtractor extends extractors$4.BaseNumberExtractor { + constructor(placeholder = spanishNumeric.SpanishNumeric.PlaceHolderDefault) { + super(); + this.extractType = constants.Constants.SYS_NUM_INTEGER; + let regexes = new Array({ + regExp: recognizersText.RegExpUtility.getSafeRegExp(spanishNumeric.SpanishNumeric.NumbersWithPlaceHolder(placeholder), "gi"), + value: "IntegerNum" + }, { + regExp: recognizersText.RegExpUtility.getSafeRegExp(spanishNumeric.SpanishNumeric.NumbersWithSuffix, "gs"), + value: "IntegerNum" + }, { + regExp: this.generateLongFormatNumberRegexes(models$2.LongFormatType.integerNumDot, placeholder), + value: "IntegerNum" + }, { + regExp: this.generateLongFormatNumberRegexes(models$2.LongFormatType.integerNumBlank, placeholder), + value: "IntegerNum" + }, { + regExp: this.generateLongFormatNumberRegexes(models$2.LongFormatType.integerNumNoBreakSpace, placeholder), + value: "IntegerNum" + }, { + regExp: recognizersText.RegExpUtility.getSafeRegExp(spanishNumeric.SpanishNumeric.RoundNumberIntegerRegexWithLocks), + value: "IntegerNum" + }, { + regExp: recognizersText.RegExpUtility.getSafeRegExp(spanishNumeric.SpanishNumeric.NumbersWithDozenSuffix), + value: "IntegerNum" + }, { + regExp: recognizersText.RegExpUtility.getSafeRegExp(spanishNumeric.SpanishNumeric.AllIntRegexWithLocks), + value: "IntegerSpa" + }, { + regExp: recognizersText.RegExpUtility.getSafeRegExp(spanishNumeric.SpanishNumeric.AllIntRegexWithDozenSuffixLocks), + value: "IntegerSpa" + }); + this.regexes = regexes; + } +} +exports.SpanishIntegerExtractor = SpanishIntegerExtractor; +class SpanishDoubleExtractor extends extractors$4.BaseNumberExtractor { + constructor(placeholder = spanishNumeric.SpanishNumeric.PlaceHolderDefault) { + super(); + this.extractType = constants.Constants.SYS_NUM_DOUBLE; + let regexes = new Array({ + regExp: recognizersText.RegExpUtility.getSafeRegExp(spanishNumeric.SpanishNumeric.DoubleDecimalPointRegex(placeholder)), + value: "DoubleNum" + }, { + regExp: recognizersText.RegExpUtility.getSafeRegExp(spanishNumeric.SpanishNumeric.DoubleWithoutIntegralRegex(placeholder)), + value: "DoubleNum" + }, { + regExp: recognizersText.RegExpUtility.getSafeRegExp(spanishNumeric.SpanishNumeric.DoubleWithMultiplierRegex, "gs"), + value: "DoubleNum" + }, { + regExp: recognizersText.RegExpUtility.getSafeRegExp(spanishNumeric.SpanishNumeric.DoubleWithRoundNumber), + value: "DoubleNum" + }, { + regExp: recognizersText.RegExpUtility.getSafeRegExp(spanishNumeric.SpanishNumeric.DoubleAllFloatRegex), + value: "DoubleSpa" + }, { + regExp: recognizersText.RegExpUtility.getSafeRegExp(spanishNumeric.SpanishNumeric.DoubleExponentialNotationRegex), + value: "DoublePow" + }, { + regExp: recognizersText.RegExpUtility.getSafeRegExp(spanishNumeric.SpanishNumeric.DoubleCaretExponentialNotationRegex), + value: "DoublePow" + }, { + regExp: this.generateLongFormatNumberRegexes(models$2.LongFormatType.doubleNumDotComma, placeholder), + value: "DoubleNum" + }, { + regExp: this.generateLongFormatNumberRegexes(models$2.LongFormatType.doubleNumNoBreakSpaceComma, placeholder), + value: "DoubleNum" + }); + this.regexes = regexes; + } +} +exports.SpanishDoubleExtractor = SpanishDoubleExtractor; +class SpanishFractionExtractor extends extractors$4.BaseNumberExtractor { + constructor() { + super(); + this.extractType = constants.Constants.SYS_NUM_FRACTION; + let regexes = new Array({ + regExp: recognizersText.RegExpUtility.getSafeRegExp(spanishNumeric.SpanishNumeric.FractionNotationRegex), + value: "FracNum" + }, { + regExp: recognizersText.RegExpUtility.getSafeRegExp(spanishNumeric.SpanishNumeric.FractionNotationWithSpacesRegex), + value: "FracNum" + }, { + regExp: recognizersText.RegExpUtility.getSafeRegExp(spanishNumeric.SpanishNumeric.FractionNounRegex), + value: "FracSpa" + }, { + regExp: recognizersText.RegExpUtility.getSafeRegExp(spanishNumeric.SpanishNumeric.FractionNounWithArticleRegex), + value: "FracSpa" + }, { + regExp: recognizersText.RegExpUtility.getSafeRegExp(spanishNumeric.SpanishNumeric.FractionPrepositionRegex), + value: "FracSpa" + }); + this.regexes = regexes; + } +} +exports.SpanishFractionExtractor = SpanishFractionExtractor; +class SpanishOrdinalExtractor extends extractors$4.BaseNumberExtractor { + constructor() { + super(); + this.extractType = constants.Constants.SYS_NUM_ORDINAL; + let regexes = new Array({ + regExp: recognizersText.RegExpUtility.getSafeRegExp(spanishNumeric.SpanishNumeric.OrdinalSuffixRegex), + value: "OrdinalNum" + }, { + regExp: recognizersText.RegExpUtility.getSafeRegExp(spanishNumeric.SpanishNumeric.OrdinalNounRegex), + value: "OrdSpa" + }); + this.regexes = regexes; + } +} +exports.SpanishOrdinalExtractor = SpanishOrdinalExtractor; +class SpanishPercentageExtractor extends extractors$4.BasePercentageExtractor { + constructor() { + super(new SpanishNumberExtractor()); + } + initRegexes() { + let regexStrs = [ + spanishNumeric.SpanishNumeric.NumberWithPrefixPercentage + ]; + return this.buildRegexes(regexStrs); + } +} +exports.SpanishPercentageExtractor = SpanishPercentageExtractor; + +}); + +unwrapExports(extractors$6); + +var extractors$8 = createCommonjsModule(function (module, exports) { +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); + + + + + +class PortugueseNumberExtractor extends extractors$4.BaseNumberExtractor { + constructor(mode = models$2.NumberMode.Default) { + super(); + this.extractType = constants.Constants.SYS_NUM; + let regexes = new Array(); + // Add Cardinal + let cardExtract = null; + switch (mode) { + case models$2.NumberMode.PureNumber: + cardExtract = new PortugueseCardinalExtractor(portugueseNumeric.PortugueseNumeric.PlaceHolderPureNumber); + break; + case models$2.NumberMode.Currency: + regexes.push({ regExp: recognizersText.RegExpUtility.getSafeRegExp(portugueseNumeric.PortugueseNumeric.CurrencyRegex, "gs"), value: "IntegerNum" }); + break; + case models$2.NumberMode.Default: + break; + } + if (cardExtract === null) { + cardExtract = new PortugueseCardinalExtractor(); + } + cardExtract.regexes.forEach(r => regexes.push(r)); + // Add Fraction + let fracExtract = new PortugueseFractionExtractor(); + fracExtract.regexes.forEach(r => regexes.push(r)); + this.regexes = regexes; + } +} +exports.PortugueseNumberExtractor = PortugueseNumberExtractor; +class PortugueseCardinalExtractor extends extractors$4.BaseNumberExtractor { + constructor(placeholder = portugueseNumeric.PortugueseNumeric.PlaceHolderDefault) { + super(); + this.extractType = constants.Constants.SYS_NUM_CARDINAL; + let regexes = new Array(); + // Add Integer Regexes + let intExtract = new PortugueseIntegerExtractor(placeholder); + intExtract.regexes.forEach(r => regexes.push(r)); + // Add Double Regexes + let doubleExtract = new PortugueseDoubleExtractor(placeholder); + doubleExtract.regexes.forEach(r => regexes.push(r)); + this.regexes = regexes; + } +} +exports.PortugueseCardinalExtractor = PortugueseCardinalExtractor; +class PortugueseIntegerExtractor extends extractors$4.BaseNumberExtractor { + constructor(placeholder = portugueseNumeric.PortugueseNumeric.PlaceHolderDefault) { + super(); + this.extractType = constants.Constants.SYS_NUM_INTEGER; + let regexes = new Array({ + regExp: recognizersText.RegExpUtility.getSafeRegExp(portugueseNumeric.PortugueseNumeric.NumbersWithPlaceHolder(placeholder), "gi"), + value: "IntegerNum" + }, { + regExp: recognizersText.RegExpUtility.getSafeRegExp(portugueseNumeric.PortugueseNumeric.NumbersWithSuffix, "gs"), + value: "IntegerNum" + }, { + regExp: this.generateLongFormatNumberRegexes(models$2.LongFormatType.integerNumDot, placeholder), + value: "IntegerNum" + }, { + regExp: this.generateLongFormatNumberRegexes(models$2.LongFormatType.integerNumBlank, placeholder), + value: "IntegerNum" + }, { + regExp: this.generateLongFormatNumberRegexes(models$2.LongFormatType.integerNumNoBreakSpace, placeholder), + value: "IntegerNum" + }, { + regExp: recognizersText.RegExpUtility.getSafeRegExp(portugueseNumeric.PortugueseNumeric.RoundNumberIntegerRegexWithLocks), + value: "IntegerNum" + }, { + regExp: recognizersText.RegExpUtility.getSafeRegExp(portugueseNumeric.PortugueseNumeric.NumbersWithDozen2Suffix), + value: "IntegerNum" + }, { + regExp: recognizersText.RegExpUtility.getSafeRegExp(portugueseNumeric.PortugueseNumeric.NumbersWithDozenSuffix), + value: "IntegerNum" + }, { + regExp: recognizersText.RegExpUtility.getSafeRegExp(portugueseNumeric.PortugueseNumeric.AllIntRegexWithLocks), + value: "IntegerPor" + }, { + regExp: recognizersText.RegExpUtility.getSafeRegExp(portugueseNumeric.PortugueseNumeric.AllIntRegexWithDozenSuffixLocks), + value: "IntegerPor" + }); + this.regexes = regexes; + } +} +exports.PortugueseIntegerExtractor = PortugueseIntegerExtractor; +class PortugueseDoubleExtractor extends extractors$4.BaseNumberExtractor { + constructor(placeholder = portugueseNumeric.PortugueseNumeric.PlaceHolderDefault) { + super(); + this.extractType = constants.Constants.SYS_NUM_DOUBLE; + let regexes = new Array({ + regExp: recognizersText.RegExpUtility.getSafeRegExp(portugueseNumeric.PortugueseNumeric.DoubleDecimalPointRegex(placeholder)), + value: "DoubleNum" + }, { + regExp: recognizersText.RegExpUtility.getSafeRegExp(portugueseNumeric.PortugueseNumeric.DoubleWithoutIntegralRegex(placeholder)), + value: "DoubleNum" + }, { + regExp: recognizersText.RegExpUtility.getSafeRegExp(portugueseNumeric.PortugueseNumeric.DoubleWithMultiplierRegex, "gs"), + value: "DoubleNum" + }, { + regExp: recognizersText.RegExpUtility.getSafeRegExp(portugueseNumeric.PortugueseNumeric.DoubleWithRoundNumber), + value: "DoubleNum" + }, { + regExp: recognizersText.RegExpUtility.getSafeRegExp(portugueseNumeric.PortugueseNumeric.DoubleAllFloatRegex), + value: "DoublePor" + }, { + regExp: recognizersText.RegExpUtility.getSafeRegExp(portugueseNumeric.PortugueseNumeric.DoubleExponentialNotationRegex), + value: "DoublePow" + }, { + regExp: recognizersText.RegExpUtility.getSafeRegExp(portugueseNumeric.PortugueseNumeric.DoubleCaretExponentialNotationRegex), + value: "DoublePow" + }, { + regExp: this.generateLongFormatNumberRegexes(models$2.LongFormatType.doubleNumDotComma, placeholder), + value: "DoubleNum" + }, { + regExp: this.generateLongFormatNumberRegexes(models$2.LongFormatType.doubleNumNoBreakSpaceComma, placeholder), + value: "DoubleNum" + }); + this.regexes = regexes; + } +} +exports.PortugueseDoubleExtractor = PortugueseDoubleExtractor; +class PortugueseFractionExtractor extends extractors$4.BaseNumberExtractor { + constructor() { + super(); + this.extractType = constants.Constants.SYS_NUM_FRACTION; + let regexes = new Array({ + regExp: recognizersText.RegExpUtility.getSafeRegExp(portugueseNumeric.PortugueseNumeric.FractionNotationRegex), + value: "FracNum" + }, { + regExp: recognizersText.RegExpUtility.getSafeRegExp(portugueseNumeric.PortugueseNumeric.FractionNotationWithSpacesRegex), + value: "FracNum" + }, { + regExp: recognizersText.RegExpUtility.getSafeRegExp(portugueseNumeric.PortugueseNumeric.FractionNounRegex), + value: "FracPor" + }, { + regExp: recognizersText.RegExpUtility.getSafeRegExp(portugueseNumeric.PortugueseNumeric.FractionNounWithArticleRegex), + value: "FracPor" + }, { + regExp: recognizersText.RegExpUtility.getSafeRegExp(portugueseNumeric.PortugueseNumeric.FractionPrepositionRegex), + value: "FracPor" + }); + this.regexes = regexes; + } +} +exports.PortugueseFractionExtractor = PortugueseFractionExtractor; +class PortugueseOrdinalExtractor extends extractors$4.BaseNumberExtractor { + constructor() { + super(); + this.extractType = constants.Constants.SYS_NUM_ORDINAL; + let regexes = new Array({ + regExp: recognizersText.RegExpUtility.getSafeRegExp(portugueseNumeric.PortugueseNumeric.OrdinalSuffixRegex), + value: "OrdinalNum" + }, { + regExp: recognizersText.RegExpUtility.getSafeRegExp(portugueseNumeric.PortugueseNumeric.OrdinalEnglishRegex), + value: "OrdinalPor" + }); + this.regexes = regexes; + } +} +exports.PortugueseOrdinalExtractor = PortugueseOrdinalExtractor; +class PortuguesePercentageExtractor extends extractors$4.BasePercentageExtractor { + constructor() { + super(new PortugueseNumberExtractor()); + } + initRegexes() { + let regexStrs = [ + portugueseNumeric.PortugueseNumeric.NumberWithSuffixPercentage + ]; + return this.buildRegexes(regexStrs); + } +} +exports.PortuguesePercentageExtractor = PortuguesePercentageExtractor; + +}); + +unwrapExports(extractors$8); + +var extractors$10 = createCommonjsModule(function (module, exports) { +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); + + + + + +class FrenchNumberExtractor extends extractors$4.BaseNumberExtractor { + constructor(mode = models$2.NumberMode.Default) { + super(); + this.extractType = constants.Constants.SYS_NUM; + let regexes = new Array(); + // Add Cardinal + let cardExtract = null; + switch (mode) { + case models$2.NumberMode.PureNumber: + cardExtract = new FrenchCardinalExtractor(frenchNumeric.FrenchNumeric.PlaceHolderPureNumber); + break; + case models$2.NumberMode.Currency: + regexes.push({ regExp: recognizersText.RegExpUtility.getSafeRegExp(frenchNumeric.FrenchNumeric.CurrencyRegex, "gs"), value: "IntegerNum" }); + break; + case models$2.NumberMode.Default: + break; + } + if (cardExtract === null) { + cardExtract = new FrenchCardinalExtractor(); + } + cardExtract.regexes.forEach(r => regexes.push(r)); + // Add Fraction + let fracExtract = new FrenchFractionExtractor(); + fracExtract.regexes.forEach(r => regexes.push(r)); + this.regexes = regexes; + } +} +exports.FrenchNumberExtractor = FrenchNumberExtractor; +class FrenchCardinalExtractor extends extractors$4.BaseNumberExtractor { + constructor(placeholder = frenchNumeric.FrenchNumeric.PlaceHolderDefault) { + super(); + this.extractType = constants.Constants.SYS_NUM_CARDINAL; + let regexes = new Array(); + // Add Integer Regexes + let intExtract = new FrenchIntegerExtractor(placeholder); + intExtract.regexes.forEach(r => regexes.push(r)); + // Add Double Regexes + let doubleExtract = new FrenchDoubleExtractor(placeholder); + doubleExtract.regexes.forEach(r => regexes.push(r)); + this.regexes = regexes; + } +} +exports.FrenchCardinalExtractor = FrenchCardinalExtractor; +class FrenchIntegerExtractor extends extractors$4.BaseNumberExtractor { + constructor(placeholder = frenchNumeric.FrenchNumeric.PlaceHolderDefault) { + super(); + this.extractType = constants.Constants.SYS_NUM_INTEGER; + let regexes = new Array({ + regExp: recognizersText.RegExpUtility.getSafeRegExp(frenchNumeric.FrenchNumeric.NumbersWithPlaceHolder(placeholder), "gi"), + value: "IntegerNum" + }, { + regExp: recognizersText.RegExpUtility.getSafeRegExp(frenchNumeric.FrenchNumeric.NumbersWithSuffix, "gs"), + value: "IntegerNum" + }, { + regExp: this.generateLongFormatNumberRegexes(models$2.LongFormatType.integerNumDot, placeholder), + value: "IntegerNum" + }, { + regExp: this.generateLongFormatNumberRegexes(models$2.LongFormatType.integerNumBlank, placeholder), + value: "IntegerNum" + }, { + regExp: this.generateLongFormatNumberRegexes(models$2.LongFormatType.integerNumNoBreakSpace, placeholder), + value: "IntegerNum" + }, { + regExp: recognizersText.RegExpUtility.getSafeRegExp(frenchNumeric.FrenchNumeric.RoundNumberIntegerRegexWithLocks), + value: "IntegerNum" + }, { + regExp: recognizersText.RegExpUtility.getSafeRegExp(frenchNumeric.FrenchNumeric.NumbersWithDozenSuffix), + value: "IntegerNum" + }, { + regExp: recognizersText.RegExpUtility.getSafeRegExp(frenchNumeric.FrenchNumeric.AllIntRegexWithLocks), + value: "IntegerFr" + }, { + regExp: recognizersText.RegExpUtility.getSafeRegExp(frenchNumeric.FrenchNumeric.AllIntRegexWithDozenSuffixLocks), + value: "IntegerFr" + }); + this.regexes = regexes; + } +} +exports.FrenchIntegerExtractor = FrenchIntegerExtractor; +class FrenchDoubleExtractor extends extractors$4.BaseNumberExtractor { + constructor(placeholder = frenchNumeric.FrenchNumeric.PlaceHolderDefault) { + super(); + this.extractType = constants.Constants.SYS_NUM_DOUBLE; + let regexes = new Array({ + regExp: recognizersText.RegExpUtility.getSafeRegExp(frenchNumeric.FrenchNumeric.DoubleDecimalPointRegex(placeholder)), + value: "DoubleNum" + }, { + regExp: recognizersText.RegExpUtility.getSafeRegExp(frenchNumeric.FrenchNumeric.DoubleWithoutIntegralRegex(placeholder)), + value: "DoubleNum" + }, { + regExp: recognizersText.RegExpUtility.getSafeRegExp(frenchNumeric.FrenchNumeric.DoubleWithMultiplierRegex, "gs"), + value: "DoubleNum" + }, { + regExp: recognizersText.RegExpUtility.getSafeRegExp(frenchNumeric.FrenchNumeric.DoubleWithRoundNumber), + value: "DoubleNum" + }, { + regExp: recognizersText.RegExpUtility.getSafeRegExp(frenchNumeric.FrenchNumeric.DoubleAllFloatRegex), + value: "DoubleFr" + }, { + regExp: recognizersText.RegExpUtility.getSafeRegExp(frenchNumeric.FrenchNumeric.DoubleExponentialNotationRegex), + value: "DoublePow" + }, { + regExp: recognizersText.RegExpUtility.getSafeRegExp(frenchNumeric.FrenchNumeric.DoubleCaretExponentialNotationRegex), + value: "DoublePow" + }, { + regExp: this.generateLongFormatNumberRegexes(models$2.LongFormatType.doubleNumDotComma, placeholder), + value: "DoubleNum" + }, { + regExp: this.generateLongFormatNumberRegexes(models$2.LongFormatType.doubleNumNoBreakSpaceComma, placeholder), + value: "DoubleNum" + }); + this.regexes = regexes; + } +} +exports.FrenchDoubleExtractor = FrenchDoubleExtractor; +class FrenchFractionExtractor extends extractors$4.BaseNumberExtractor { + constructor() { + super(); + this.extractType = constants.Constants.SYS_NUM_FRACTION; + let regexes = new Array({ + regExp: recognizersText.RegExpUtility.getSafeRegExp(frenchNumeric.FrenchNumeric.FractionNotationRegex), + value: "FracNum" + }, { + regExp: recognizersText.RegExpUtility.getSafeRegExp(frenchNumeric.FrenchNumeric.FractionNotationWithSpacesRegex), + value: "FracNum" + }, { + regExp: recognizersText.RegExpUtility.getSafeRegExp(frenchNumeric.FrenchNumeric.FractionNounRegex), + value: "FracFr" + }, { + regExp: recognizersText.RegExpUtility.getSafeRegExp(frenchNumeric.FrenchNumeric.FractionNounWithArticleRegex), + value: "FracFr" + }, { + regExp: recognizersText.RegExpUtility.getSafeRegExp(frenchNumeric.FrenchNumeric.FractionPrepositionRegex), + value: "FracFr" + }); + this.regexes = regexes; + } +} +exports.FrenchFractionExtractor = FrenchFractionExtractor; +class FrenchOrdinalExtractor extends extractors$4.BaseNumberExtractor { + constructor() { + super(); + this.extractType = constants.Constants.SYS_NUM_ORDINAL; + let regexes = new Array({ + regExp: recognizersText.RegExpUtility.getSafeRegExp(frenchNumeric.FrenchNumeric.OrdinalSuffixRegex), + value: "OrdinalNum" + }, { + regExp: recognizersText.RegExpUtility.getSafeRegExp(frenchNumeric.FrenchNumeric.OrdinalFrenchRegex), + value: "OrdFr" + }); + this.regexes = regexes; + } +} +exports.FrenchOrdinalExtractor = FrenchOrdinalExtractor; +class FrenchPercentageExtractor extends extractors$4.BasePercentageExtractor { + constructor() { + super(new FrenchNumberExtractor()); + } + initRegexes() { + let regexStrs = [ + frenchNumeric.FrenchNumeric.NumberWithSuffixPercentage, + frenchNumeric.FrenchNumeric.NumberWithPrefixPercentage + ]; + return this.buildRegexes(regexStrs); + } +} +exports.FrenchPercentageExtractor = FrenchPercentageExtractor; + +}); + +unwrapExports(extractors$10); + +var extractors$12 = createCommonjsModule(function (module, exports) { +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); + + + + +var ChineseNumberExtractorMode; +(function (ChineseNumberExtractorMode) { + // Number extraction with an allow list that filters what numbers to extract. + ChineseNumberExtractorMode[ChineseNumberExtractorMode["Default"] = 0] = "Default"; + // Extract all number-related terms aggressively. + ChineseNumberExtractorMode[ChineseNumberExtractorMode["ExtractAll"] = 1] = "ExtractAll"; +})(ChineseNumberExtractorMode = exports.ChineseNumberExtractorMode || (exports.ChineseNumberExtractorMode = {})); +class ChineseNumberExtractor extends extractors$4.BaseNumberExtractor { + constructor(mode = ChineseNumberExtractorMode.Default) { + super(); + this.extractType = constants.Constants.SYS_NUM; + let regexes = new Array(); + // Add Cardinal + let cardExtract = new ChineseCardinalExtractor(mode); + cardExtract.regexes.forEach(r => regexes.push(r)); + // Add Fraction + let fracExtract = new ChineseFractionExtractor(); + fracExtract.regexes.forEach(r => regexes.push(r)); + this.regexes = regexes; + } +} +exports.ChineseNumberExtractor = ChineseNumberExtractor; +class ChineseCardinalExtractor extends extractors$4.BaseNumberExtractor { + constructor(mode = ChineseNumberExtractorMode.Default) { + super(); + this.extractType = constants.Constants.SYS_NUM_CARDINAL; + let regexes = new Array(); + // Add Integer Regexes + let intExtract = new ChineseIntegerExtractor(mode); + intExtract.regexes.forEach(r => regexes.push(r)); + // Add Double Regexes + let doubleExtract = new ChineseDoubleExtractor(); + doubleExtract.regexes.forEach(r => regexes.push(r)); + this.regexes = regexes; + } +} +exports.ChineseCardinalExtractor = ChineseCardinalExtractor; +class ChineseIntegerExtractor extends extractors$4.BaseNumberExtractor { + constructor(mode = ChineseNumberExtractorMode.Default) { + super(); + this.extractType = constants.Constants.SYS_NUM_INTEGER; + let regexes = new Array({ + regExp: recognizersText.RegExpUtility.getSafeRegExp(chineseNumeric.ChineseNumeric.NumbersSpecialsChars, "gi"), + value: "IntegerNum" + }, { + regExp: recognizersText.RegExpUtility.getSafeRegExp(chineseNumeric.ChineseNumeric.NumbersSpecialsCharsWithSuffix, "gs"), + value: "IntegerNum" + }, { + regExp: recognizersText.RegExpUtility.getSafeRegExp(chineseNumeric.ChineseNumeric.DottedNumbersSpecialsChar, "gis"), + value: "IntegerNum" + }, { + regExp: recognizersText.RegExpUtility.getSafeRegExp(chineseNumeric.ChineseNumeric.NumbersWithHalfDozen, "gis"), + value: "IntegerChs" + }, { + regExp: recognizersText.RegExpUtility.getSafeRegExp(chineseNumeric.ChineseNumeric.NumbersWithDozen, "gis"), + value: "IntegerChs" + }); + switch (mode) { + case ChineseNumberExtractorMode.Default: + regexes.push({ + regExp: recognizersText.RegExpUtility.getSafeRegExp(chineseNumeric.ChineseNumeric.NumbersWithAllowListRegex, "gi"), + value: "IntegerChs" + }); + break; + case ChineseNumberExtractorMode.ExtractAll: + regexes.push({ + regExp: recognizersText.RegExpUtility.getSafeRegExp(chineseNumeric.ChineseNumeric.NumbersAggressiveRegex, "gi"), + value: "IntegerChs" + }); + break; + } + this.regexes = regexes; + } +} +exports.ChineseIntegerExtractor = ChineseIntegerExtractor; +class ChineseDoubleExtractor extends extractors$4.BaseNumberExtractor { + constructor() { + super(); + this.extractType = constants.Constants.SYS_NUM_DOUBLE; + let regexes = new Array({ + regExp: recognizersText.RegExpUtility.getSafeRegExp(chineseNumeric.ChineseNumeric.DoubleSpecialsChars, "gis"), + value: "DoubleNum" + }, { + regExp: recognizersText.RegExpUtility.getSafeRegExp(chineseNumeric.ChineseNumeric.DoubleSpecialsCharsWithNegatives, "gis"), + value: "DoubleNum" + }, { + regExp: recognizersText.RegExpUtility.getSafeRegExp(chineseNumeric.ChineseNumeric.SimpleDoubleSpecialsChars, "gis"), + value: "DoubleNum" + }, { + regExp: recognizersText.RegExpUtility.getSafeRegExp(chineseNumeric.ChineseNumeric.DoubleWithMultiplierRegex, "gi"), + value: "DoubleNum" + }, { + regExp: recognizersText.RegExpUtility.getSafeRegExp(chineseNumeric.ChineseNumeric.DoubleWithThousandsRegex, "gi"), + value: "DoubleChs" + }, { + regExp: recognizersText.RegExpUtility.getSafeRegExp(chineseNumeric.ChineseNumeric.DoubleAllFloatRegex, "gi"), + value: "DoubleChs" + }, { + regExp: recognizersText.RegExpUtility.getSafeRegExp(chineseNumeric.ChineseNumeric.DoubleExponentialNotationRegex, "gis"), + value: "DoublePow" + }, { + regExp: recognizersText.RegExpUtility.getSafeRegExp(chineseNumeric.ChineseNumeric.DoubleScientificNotationRegex, "gis"), + value: "DoublePow" + }); + this.regexes = regexes; + } +} +exports.ChineseDoubleExtractor = ChineseDoubleExtractor; +class ChineseFractionExtractor extends extractors$4.BaseNumberExtractor { + constructor() { + super(); + this.extractType = constants.Constants.SYS_NUM_FRACTION; + let regexes = new Array({ + regExp: recognizersText.RegExpUtility.getSafeRegExp(chineseNumeric.ChineseNumeric.FractionNotationSpecialsCharsRegex, "gis"), + value: "FracNum" + }, { + regExp: recognizersText.RegExpUtility.getSafeRegExp(chineseNumeric.ChineseNumeric.FractionNotationRegex, "gis"), + value: "FracNum" + }, { + regExp: recognizersText.RegExpUtility.getSafeRegExp(chineseNumeric.ChineseNumeric.AllFractionNumber, "gi"), + value: "FracChs" + }); + this.regexes = regexes; + } +} +exports.ChineseFractionExtractor = ChineseFractionExtractor; +class ChineseOrdinalExtractor extends extractors$4.BaseNumberExtractor { + constructor() { + super(); + this.extractType = constants.Constants.SYS_NUM_ORDINAL; + let regexes = new Array({ + regExp: recognizersText.RegExpUtility.getSafeRegExp(chineseNumeric.ChineseNumeric.OrdinalRegex, "gi"), + value: "OrdinalChs" + }, { + regExp: recognizersText.RegExpUtility.getSafeRegExp(chineseNumeric.ChineseNumeric.OrdinalNumbersRegex, "gi"), + value: "OrdinalChs" + }); + this.regexes = regexes; + } +} +exports.ChineseOrdinalExtractor = ChineseOrdinalExtractor; +class ChinesePercentageExtractor extends extractors$4.BaseNumberExtractor { + constructor() { + super(); + this.extractType = constants.Constants.SYS_NUM_PERCENTAGE; + let regexes = new Array({ + regExp: recognizersText.RegExpUtility.getSafeRegExp(chineseNumeric.ChineseNumeric.PercentagePointRegex, "gi"), + value: "PerChs" + }, { + regExp: recognizersText.RegExpUtility.getSafeRegExp(chineseNumeric.ChineseNumeric.SimplePercentageRegex, "gi"), + value: "PerChs" + }, { + regExp: recognizersText.RegExpUtility.getSafeRegExp(chineseNumeric.ChineseNumeric.NumbersPercentagePointRegex, "gis"), + value: "PerNum" + }, { + regExp: recognizersText.RegExpUtility.getSafeRegExp(chineseNumeric.ChineseNumeric.NumbersPercentageWithSeparatorRegex, "gis"), + value: "PerNum" + }, { + regExp: recognizersText.RegExpUtility.getSafeRegExp(chineseNumeric.ChineseNumeric.NumbersPercentageWithMultiplierRegex, "gi"), + value: "PerNum" + }, { + regExp: recognizersText.RegExpUtility.getSafeRegExp(chineseNumeric.ChineseNumeric.FractionPercentagePointRegex, "gis"), + value: "PerNum" + }, { + regExp: recognizersText.RegExpUtility.getSafeRegExp(chineseNumeric.ChineseNumeric.FractionPercentageWithSeparatorRegex, "gis"), + value: "PerNum" + }, { + regExp: recognizersText.RegExpUtility.getSafeRegExp(chineseNumeric.ChineseNumeric.FractionPercentageWithMultiplierRegex, "gi"), + value: "PerNum" + }, { + regExp: recognizersText.RegExpUtility.getSafeRegExp(chineseNumeric.ChineseNumeric.SimpleNumbersPercentageRegex, "gis"), + value: "PerNum" + }, { + regExp: recognizersText.RegExpUtility.getSafeRegExp(chineseNumeric.ChineseNumeric.SimpleNumbersPercentageWithMultiplierRegex, "gi"), + value: "PerNum" + }, { + regExp: recognizersText.RegExpUtility.getSafeRegExp(chineseNumeric.ChineseNumeric.SimpleNumbersPercentagePointRegex, "gis"), + value: "PerNum" + }, { + regExp: recognizersText.RegExpUtility.getSafeRegExp(chineseNumeric.ChineseNumeric.IntegerPercentageRegex, "gis"), + value: "PerNum" + }, { + regExp: recognizersText.RegExpUtility.getSafeRegExp(chineseNumeric.ChineseNumeric.IntegerPercentageWithMultiplierRegex, "gi"), + value: "PerNum" + }, { + regExp: recognizersText.RegExpUtility.getSafeRegExp(chineseNumeric.ChineseNumeric.NumbersFractionPercentageRegex, "gis"), + value: "PerNum" + }, { + regExp: recognizersText.RegExpUtility.getSafeRegExp(chineseNumeric.ChineseNumeric.SimpleIntegerPercentageRegex, "gis"), + value: "PerNum" + }, { + regExp: recognizersText.RegExpUtility.getSafeRegExp(chineseNumeric.ChineseNumeric.NumbersFoldsPercentageRegex, "gis"), + value: "PerSpe" + }, { + regExp: recognizersText.RegExpUtility.getSafeRegExp(chineseNumeric.ChineseNumeric.FoldsPercentageRegex, "gis"), + value: "PerSpe" + }, { + regExp: recognizersText.RegExpUtility.getSafeRegExp(chineseNumeric.ChineseNumeric.SimpleFoldsPercentageRegex, "gis"), + value: "PerSpe" + }, { + regExp: recognizersText.RegExpUtility.getSafeRegExp(chineseNumeric.ChineseNumeric.SpecialsPercentageRegex, "gis"), + value: "PerSpe" + }, { + regExp: recognizersText.RegExpUtility.getSafeRegExp(chineseNumeric.ChineseNumeric.NumbersSpecialsPercentageRegex, "gis"), + value: "PerSpe" + }, { + regExp: recognizersText.RegExpUtility.getSafeRegExp(chineseNumeric.ChineseNumeric.SimpleSpecialsPercentageRegex, "gis"), + value: "PerSpe" + }, { + regExp: recognizersText.RegExpUtility.getSafeRegExp(chineseNumeric.ChineseNumeric.SpecialsFoldsPercentageRegex, "gis"), + value: "PerSpe" + }); + this.regexes = regexes; + } +} +exports.ChinesePercentageExtractor = ChinesePercentageExtractor; + +}); + +unwrapExports(extractors$12); + +var extractors$14 = createCommonjsModule(function (module, exports) { +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); + + + + +var JapaneseNumberExtractorMode; +(function (JapaneseNumberExtractorMode) { + // Number extraction with an allow list that filters what numbers to extract. + JapaneseNumberExtractorMode[JapaneseNumberExtractorMode["Default"] = 0] = "Default"; + // Extract all number-related terms aggressively. + JapaneseNumberExtractorMode[JapaneseNumberExtractorMode["ExtractAll"] = 1] = "ExtractAll"; +})(JapaneseNumberExtractorMode = exports.JapaneseNumberExtractorMode || (exports.JapaneseNumberExtractorMode = {})); +class JapaneseNumberExtractor extends extractors$4.BaseNumberExtractor { + constructor(mode = JapaneseNumberExtractorMode.Default) { + super(); + this.extractType = constants.Constants.SYS_NUM; + let regexes = new Array(); + // Add Cardinal + let cardExtract = new JapaneseCardinalExtractor(mode); + cardExtract.regexes.forEach(r => regexes.push(r)); + // Add Fraction + let fracExtract = new JapaneseFractionExtractor(); + fracExtract.regexes.forEach(r => regexes.push(r)); + this.regexes = regexes; + } +} +exports.JapaneseNumberExtractor = JapaneseNumberExtractor; +class JapaneseCardinalExtractor extends extractors$4.BaseNumberExtractor { + constructor(mode = JapaneseNumberExtractorMode.Default) { + super(); + this.extractType = constants.Constants.SYS_NUM_CARDINAL; + let regexes = new Array(); + // Add Integer Regexes + let intExtract = new JapaneseIntegerExtractor(mode); + intExtract.regexes.forEach(r => regexes.push(r)); + // Add Double Regexes + let doubleExtract = new JapaneseDoubleExtractor(); + doubleExtract.regexes.forEach(r => regexes.push(r)); + this.regexes = regexes; + } +} +exports.JapaneseCardinalExtractor = JapaneseCardinalExtractor; +class JapaneseIntegerExtractor extends extractors$4.BaseNumberExtractor { + constructor(mode = JapaneseNumberExtractorMode.Default) { + super(); + this.extractType = constants.Constants.SYS_NUM_INTEGER; + let regexes = new Array({ + regExp: recognizersText.RegExpUtility.getSafeRegExp(japaneseNumeric.JapaneseNumeric.NumbersSpecialsChars, "gi"), + value: "IntegerNum" + }, { + regExp: recognizersText.RegExpUtility.getSafeRegExp(japaneseNumeric.JapaneseNumeric.NumbersSpecialsCharsWithSuffix, "gi"), + value: "IntegerNum" + }, { + regExp: recognizersText.RegExpUtility.getSafeRegExp(japaneseNumeric.JapaneseNumeric.DottedNumbersSpecialsChar, "gi"), + value: "IntegerNum" + }, { + regExp: recognizersText.RegExpUtility.getSafeRegExp(japaneseNumeric.JapaneseNumeric.NumbersWithHalfDozen, "gi"), + value: "IntegerJpn" + }, { + regExp: recognizersText.RegExpUtility.getSafeRegExp(japaneseNumeric.JapaneseNumeric.NumbersWithDozen, "gi"), + value: "IntegerJpn" + }); + switch (mode) { + case JapaneseNumberExtractorMode.Default: + regexes.push({ + regExp: recognizersText.RegExpUtility.getSafeRegExp(japaneseNumeric.JapaneseNumeric.NumbersWithAllowListRegex, "gi"), + value: "IntegerJpn" + }); + break; + case JapaneseNumberExtractorMode.ExtractAll: + regexes.push({ + regExp: recognizersText.RegExpUtility.getSafeRegExp(japaneseNumeric.JapaneseNumeric.NumbersAggressiveRegex, "gi"), + value: "IntegerJpn" + }); + break; + } + this.regexes = regexes; + } +} +exports.JapaneseIntegerExtractor = JapaneseIntegerExtractor; +class JapaneseDoubleExtractor extends extractors$4.BaseNumberExtractor { + constructor() { + super(); + this.extractType = constants.Constants.SYS_NUM_DOUBLE; + let regexes = new Array({ + regExp: recognizersText.RegExpUtility.getSafeRegExp(japaneseNumeric.JapaneseNumeric.DoubleSpecialsChars, "gis"), + value: "DoubleNum" + }, { + regExp: recognizersText.RegExpUtility.getSafeRegExp(japaneseNumeric.JapaneseNumeric.DoubleSpecialsCharsWithNegatives, "gis"), + value: "DoubleNum" + }, { + regExp: recognizersText.RegExpUtility.getSafeRegExp(japaneseNumeric.JapaneseNumeric.SimpleDoubleSpecialsChars, "gis"), + value: "DoubleNum" + }, { + regExp: recognizersText.RegExpUtility.getSafeRegExp(japaneseNumeric.JapaneseNumeric.DoubleWithMultiplierRegex, "gis"), + value: "DoubleNum" + }, { + regExp: recognizersText.RegExpUtility.getSafeRegExp(japaneseNumeric.JapaneseNumeric.DoubleWithThousandsRegex, "gis"), + value: "DoubleJpn" + }, { + regExp: recognizersText.RegExpUtility.getSafeRegExp(japaneseNumeric.JapaneseNumeric.DoubleExponentialNotationRegex, "gis"), + value: "DoublePow" + }, { + regExp: recognizersText.RegExpUtility.getSafeRegExp(japaneseNumeric.JapaneseNumeric.DoubleScientificNotationRegex, "gis"), + value: "DoublePow" + }); + this.regexes = regexes; + } +} +exports.JapaneseDoubleExtractor = JapaneseDoubleExtractor; +class JapaneseFractionExtractor extends extractors$4.BaseNumberExtractor { + constructor() { + super(); + this.extractType = constants.Constants.SYS_NUM_FRACTION; + let regexes = new Array({ + regExp: recognizersText.RegExpUtility.getSafeRegExp(japaneseNumeric.JapaneseNumeric.FractionNotationSpecialsCharsRegex, "gis"), + value: "FracNum" + }, { + regExp: recognizersText.RegExpUtility.getSafeRegExp(japaneseNumeric.JapaneseNumeric.FractionNotationRegex, "gis"), + value: "FracNum" + }, { + regExp: recognizersText.RegExpUtility.getSafeRegExp(japaneseNumeric.JapaneseNumeric.AllFractionNumber, "gis"), + value: "FracJpn" + }); + this.regexes = regexes; + } +} +exports.JapaneseFractionExtractor = JapaneseFractionExtractor; +class JapaneseOrdinalExtractor extends extractors$4.BaseNumberExtractor { + constructor() { + super(); + this.extractType = constants.Constants.SYS_NUM_ORDINAL; + let regexes = new Array({ + regExp: recognizersText.RegExpUtility.getSafeRegExp(japaneseNumeric.JapaneseNumeric.OrdinalRegex, "gi"), + value: "OrdinalJpn" + }, { + regExp: recognizersText.RegExpUtility.getSafeRegExp(japaneseNumeric.JapaneseNumeric.OrdinalNumbersRegex, "gi"), + value: "OrdinalJpn" + }, { + regExp: recognizersText.RegExpUtility.getSafeRegExp(japaneseNumeric.JapaneseNumeric.NumbersFoldsPercentageRegex, "gi"), + value: "OrdinalJpn" + }); + this.regexes = regexes; + } +} +exports.JapaneseOrdinalExtractor = JapaneseOrdinalExtractor; +class JapanesePercentageExtractor extends extractors$4.BaseNumberExtractor { + constructor() { + super(); + this.extractType = constants.Constants.SYS_NUM_PERCENTAGE; + let regexes = new Array({ + regExp: recognizersText.RegExpUtility.getSafeRegExp(japaneseNumeric.JapaneseNumeric.SimplePercentageRegex, "gi"), + value: "PerJpn" + }, { + regExp: recognizersText.RegExpUtility.getSafeRegExp(japaneseNumeric.JapaneseNumeric.NumbersPercentagePointRegex, "gis"), + value: "PerNum" + }, { + regExp: recognizersText.RegExpUtility.getSafeRegExp(japaneseNumeric.JapaneseNumeric.NumbersPercentageWithSeparatorRegex, "gis"), + value: "PerNum" + }, { + regExp: recognizersText.RegExpUtility.getSafeRegExp(japaneseNumeric.JapaneseNumeric.NumbersPercentageWithMultiplierRegex, "gi"), + value: "PerNum" + }, { + regExp: recognizersText.RegExpUtility.getSafeRegExp(japaneseNumeric.JapaneseNumeric.SimpleNumbersPercentageWithMultiplierRegex, "gi"), + value: "PerNum" + }, { + regExp: recognizersText.RegExpUtility.getSafeRegExp(japaneseNumeric.JapaneseNumeric.SimpleIntegerPercentageRegex, "gis"), + value: "PerNum" + }, { + regExp: recognizersText.RegExpUtility.getSafeRegExp(japaneseNumeric.JapaneseNumeric.NumbersFoldsPercentageRegex, "gis"), + value: "PerSpe" + }, { + regExp: recognizersText.RegExpUtility.getSafeRegExp(japaneseNumeric.JapaneseNumeric.FoldsPercentageRegex, "gis"), + value: "PerSpe" + }, { + regExp: recognizersText.RegExpUtility.getSafeRegExp(japaneseNumeric.JapaneseNumeric.SimpleFoldsPercentageRegex, "gis"), + value: "PerSpe" + }, { + regExp: recognizersText.RegExpUtility.getSafeRegExp(japaneseNumeric.JapaneseNumeric.SpecialsPercentageRegex, "gis"), + value: "PerSpe" + }, { + regExp: recognizersText.RegExpUtility.getSafeRegExp(japaneseNumeric.JapaneseNumeric.NumbersSpecialsPercentageRegex, "gis"), + value: "PerSpe" + }, { + regExp: recognizersText.RegExpUtility.getSafeRegExp(japaneseNumeric.JapaneseNumeric.SimpleSpecialsPercentageRegex, "gis"), + value: "PerSpe" + }, { + regExp: recognizersText.RegExpUtility.getSafeRegExp(japaneseNumeric.JapaneseNumeric.SpecialsFoldsPercentageRegex, "gis"), + value: "PerSpe" + }); + this.regexes = regexes; + } +} +exports.JapanesePercentageExtractor = JapanesePercentageExtractor; + +}); + +unwrapExports(extractors$14); + +var numberRecognizer = createCommonjsModule(function (module, exports) { +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); + + + + + + + + + + + + + + + + +var NumberOptions; +(function (NumberOptions) { + NumberOptions[NumberOptions["None"] = 0] = "None"; +})(NumberOptions = exports.NumberOptions || (exports.NumberOptions = {})); +function recognizeNumber(query, culture, options = NumberOptions.None, fallbackToDefaultCulture = true) { + return recognizeByModel(recognizer => recognizer.getNumberModel(culture, fallbackToDefaultCulture), query, culture, options); +} +exports.recognizeNumber = recognizeNumber; +function recognizeOrdinal(query, culture, options = NumberOptions.None, fallbackToDefaultCulture = true) { + return recognizeByModel(recognizer => recognizer.getOrdinalModel(culture, fallbackToDefaultCulture), query, culture, options); +} +exports.recognizeOrdinal = recognizeOrdinal; +function recognizePercentage(query, culture, options = NumberOptions.None, fallbackToDefaultCulture = true) { + return recognizeByModel(recognizer => recognizer.getPercentageModel(culture, fallbackToDefaultCulture), query, culture, options); +} +exports.recognizePercentage = recognizePercentage; +function recognizeByModel(getModelFunc, query, culture, options) { + let recognizer = new NumberRecognizer(culture, options); + let model = getModelFunc(recognizer); + return model.parse(query); +} +class NumberRecognizer extends recognizersText.Recognizer { + constructor(culture, options = NumberOptions.None, lazyInitialization = false) { + super(culture, options, lazyInitialization); + } + InitializeConfiguration() { + //#region English + this.registerModel("NumberModel", culture$2.Culture.English, (options) => new models$2.NumberModel(agnosticNumberParser.AgnosticNumberParserFactory.getParser(agnosticNumberParser.AgnosticNumberParserType.Number, new parserConfiguration.EnglishNumberParserConfiguration()), new extractors$2.EnglishNumberExtractor(models$2.NumberMode.PureNumber))); + this.registerModel("OrdinalModel", culture$2.Culture.English, (options) => new models$2.OrdinalModel(agnosticNumberParser.AgnosticNumberParserFactory.getParser(agnosticNumberParser.AgnosticNumberParserType.Ordinal, new parserConfiguration.EnglishNumberParserConfiguration()), new extractors$2.EnglishOrdinalExtractor())); + this.registerModel("PercentModel", culture$2.Culture.English, (options) => new models$2.PercentModel(agnosticNumberParser.AgnosticNumberParserFactory.getParser(agnosticNumberParser.AgnosticNumberParserType.Percentage, new parserConfiguration.EnglishNumberParserConfiguration()), new extractors$2.EnglishPercentageExtractor())); + //#endregion + //#region Spanish + this.registerModel("NumberModel", culture$2.Culture.Spanish, (options) => new models$2.NumberModel(agnosticNumberParser.AgnosticNumberParserFactory.getParser(agnosticNumberParser.AgnosticNumberParserType.Number, new parserConfiguration$2.SpanishNumberParserConfiguration()), new extractors$6.SpanishNumberExtractor(models$2.NumberMode.PureNumber))); + this.registerModel("OrdinalModel", culture$2.Culture.Spanish, (options) => new models$2.OrdinalModel(agnosticNumberParser.AgnosticNumberParserFactory.getParser(agnosticNumberParser.AgnosticNumberParserType.Ordinal, new parserConfiguration$2.SpanishNumberParserConfiguration()), new extractors$6.SpanishOrdinalExtractor())); + this.registerModel("PercentModel", culture$2.Culture.Spanish, (options) => new models$2.PercentModel(agnosticNumberParser.AgnosticNumberParserFactory.getParser(agnosticNumberParser.AgnosticNumberParserType.Percentage, new parserConfiguration$2.SpanishNumberParserConfiguration()), new extractors$6.SpanishPercentageExtractor())); + //#endregion + //#region Portuguese + this.registerModel("NumberModel", culture$2.Culture.Portuguese, (options) => new models$2.NumberModel(agnosticNumberParser.AgnosticNumberParserFactory.getParser(agnosticNumberParser.AgnosticNumberParserType.Number, new parserConfiguration$4.PortugueseNumberParserConfiguration()), new extractors$8.PortugueseNumberExtractor(models$2.NumberMode.PureNumber))); + this.registerModel("OrdinalModel", culture$2.Culture.Portuguese, (options) => new models$2.OrdinalModel(agnosticNumberParser.AgnosticNumberParserFactory.getParser(agnosticNumberParser.AgnosticNumberParserType.Ordinal, new parserConfiguration$4.PortugueseNumberParserConfiguration()), new extractors$8.PortugueseOrdinalExtractor())); + this.registerModel("PercentModel", culture$2.Culture.Portuguese, (options) => new models$2.PercentModel(agnosticNumberParser.AgnosticNumberParserFactory.getParser(agnosticNumberParser.AgnosticNumberParserType.Percentage, new parserConfiguration$4.PortugueseNumberParserConfiguration()), new extractors$8.PortuguesePercentageExtractor())); + //#endregion + //#region Chinese + this.registerModel("NumberModel", culture$2.Culture.Chinese, (options) => new models$2.NumberModel(agnosticNumberParser.AgnosticNumberParserFactory.getParser(agnosticNumberParser.AgnosticNumberParserType.Number, new parserConfiguration$8.ChineseNumberParserConfiguration()), new extractors$12.ChineseNumberExtractor())); + this.registerModel("OrdinalModel", culture$2.Culture.Chinese, (options) => new models$2.OrdinalModel(agnosticNumberParser.AgnosticNumberParserFactory.getParser(agnosticNumberParser.AgnosticNumberParserType.Ordinal, new parserConfiguration$8.ChineseNumberParserConfiguration()), new extractors$12.ChineseOrdinalExtractor())); + this.registerModel("PercentModel", culture$2.Culture.Chinese, (options) => new models$2.PercentModel(agnosticNumberParser.AgnosticNumberParserFactory.getParser(agnosticNumberParser.AgnosticNumberParserType.Percentage, new parserConfiguration$8.ChineseNumberParserConfiguration()), new extractors$12.ChinesePercentageExtractor())); + //#endregion + //#region Japanese + this.registerModel("NumberModel", culture$2.Culture.Japanese, (options) => new models$2.NumberModel(agnosticNumberParser.AgnosticNumberParserFactory.getParser(agnosticNumberParser.AgnosticNumberParserType.Number, new parserConfiguration$10.JapaneseNumberParserConfiguration()), new extractors$14.JapaneseNumberExtractor())); + this.registerModel("OrdinalModel", culture$2.Culture.Japanese, (options) => new models$2.OrdinalModel(agnosticNumberParser.AgnosticNumberParserFactory.getParser(agnosticNumberParser.AgnosticNumberParserType.Ordinal, new parserConfiguration$10.JapaneseNumberParserConfiguration()), new extractors$14.JapaneseOrdinalExtractor())); + this.registerModel("PercentModel", culture$2.Culture.Japanese, (options) => new models$2.PercentModel(agnosticNumberParser.AgnosticNumberParserFactory.getParser(agnosticNumberParser.AgnosticNumberParserType.Percentage, new parserConfiguration$10.JapaneseNumberParserConfiguration()), new extractors$14.JapanesePercentageExtractor())); + //#endregion + //#region French + this.registerModel("NumberModel", culture$2.Culture.French, (options) => new models$2.NumberModel(agnosticNumberParser.AgnosticNumberParserFactory.getParser(agnosticNumberParser.AgnosticNumberParserType.Number, new parserConfiguration$6.FrenchNumberParserConfiguration()), new extractors$10.FrenchNumberExtractor(models$2.NumberMode.PureNumber))); + this.registerModel("OrdinalModel", culture$2.Culture.French, (options) => new models$2.OrdinalModel(agnosticNumberParser.AgnosticNumberParserFactory.getParser(agnosticNumberParser.AgnosticNumberParserType.Ordinal, new parserConfiguration$6.FrenchNumberParserConfiguration()), new extractors$10.FrenchOrdinalExtractor())); + this.registerModel("PercentModel", culture$2.Culture.French, (options) => new models$2.PercentModel(agnosticNumberParser.AgnosticNumberParserFactory.getParser(agnosticNumberParser.AgnosticNumberParserType.Percentage, new parserConfiguration$6.FrenchNumberParserConfiguration()), new extractors$10.FrenchPercentageExtractor())); + //#endregion + } + IsValidOptions(options) { + return options >= 0 && options <= NumberOptions.None; + } + getNumberModel(culture = null, fallbackToDefaultCulture = true) { + return this.getModel("NumberModel", culture, fallbackToDefaultCulture); + } + getOrdinalModel(culture = null, fallbackToDefaultCulture = true) { + return this.getModel("OrdinalModel", culture, fallbackToDefaultCulture); + } + getPercentageModel(culture = null, fallbackToDefaultCulture = true) { + return this.getModel("PercentModel", culture, fallbackToDefaultCulture); + } +} +exports.default = NumberRecognizer; + +}); + +unwrapExports(numberRecognizer); + +var recognizersTextNumber = createCommonjsModule(function (module, exports) { +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); + +exports.NumberRecognizer = numberRecognizer.default; +exports.NumberOptions = numberRecognizer.NumberOptions; +exports.recognizeNumber = numberRecognizer.recognizeNumber; +exports.recognizeOrdinal = numberRecognizer.recognizeOrdinal; +exports.recognizePercentage = numberRecognizer.recognizePercentage; + +exports.Culture = culture$2.Culture; +exports.CultureInfo = culture$2.CultureInfo; + +exports.FormatUtility = recognizersText.FormatUtility; +exports.StringUtility = recognizersText.StringUtility; +exports.Match = recognizersText.Match; +exports.RegExpUtility = recognizersText.RegExpUtility; + +exports.BaseNumbers = baseNumbers.BaseNumbers; + +exports.EnglishNumeric = englishNumeric.EnglishNumeric; + +exports.SpanishNumeric = spanishNumeric.SpanishNumeric; + +exports.FrenchNumeric = frenchNumeric.FrenchNumeric; + +exports.ChineseNumeric = chineseNumeric.ChineseNumeric; + +exports.JapaneseNumeric = japaneseNumeric.JapaneseNumeric; + +exports.Constants = constants.Constants; + +exports.BaseNumberExtractor = extractors$4.BaseNumberExtractor; +exports.BasePercentageExtractor = extractors$4.BasePercentageExtractor; + +exports.NumberMode = models$2.NumberMode; +exports.LongFormatType = models$2.LongFormatType; +exports.AbstractNumberModel = models$2.AbstractNumberModel; +exports.NumberModel = models$2.NumberModel; +exports.OrdinalModel = models$2.OrdinalModel; +exports.PercentModel = models$2.PercentModel; + +exports.AgnosticNumberParserType = agnosticNumberParser.AgnosticNumberParserType; +exports.AgnosticNumberParserFactory = agnosticNumberParser.AgnosticNumberParserFactory; + +exports.BaseNumberParser = parsers$2.BaseNumberParser; +exports.BasePercentageParser = parsers$2.BasePercentageParser; + +exports.EnglishCardinalExtractor = extractors$2.EnglishCardinalExtractor; +exports.EnglishDoubleExtractor = extractors$2.EnglishDoubleExtractor; +exports.EnglishFractionExtractor = extractors$2.EnglishFractionExtractor; +exports.EnglishIntegerExtractor = extractors$2.EnglishIntegerExtractor; +exports.EnglishNumberExtractor = extractors$2.EnglishNumberExtractor; +exports.EnglishOrdinalExtractor = extractors$2.EnglishOrdinalExtractor; +exports.EnglishPercentageExtractor = extractors$2.EnglishPercentageExtractor; + +exports.EnglishNumberParserConfiguration = parserConfiguration.EnglishNumberParserConfiguration; + +exports.SpanishCardinalExtractor = extractors$6.SpanishCardinalExtractor; +exports.SpanishDoubleExtractor = extractors$6.SpanishDoubleExtractor; +exports.SpanishFractionExtractor = extractors$6.SpanishFractionExtractor; +exports.SpanishIntegerExtractor = extractors$6.SpanishIntegerExtractor; +exports.SpanishNumberExtractor = extractors$6.SpanishNumberExtractor; +exports.SpanishOrdinalExtractor = extractors$6.SpanishOrdinalExtractor; +exports.SpanishPercentageExtractor = extractors$6.SpanishPercentageExtractor; + +exports.SpanishNumberParserConfiguration = parserConfiguration$2.SpanishNumberParserConfiguration; + +exports.PortugueseCardinalExtractor = extractors$8.PortugueseCardinalExtractor; +exports.PortugueseDoubleExtractor = extractors$8.PortugueseDoubleExtractor; +exports.PortugueseFractionExtractor = extractors$8.PortugueseFractionExtractor; +exports.PortugueseIntegerExtractor = extractors$8.PortugueseIntegerExtractor; +exports.PortugueseNumberExtractor = extractors$8.PortugueseNumberExtractor; +exports.PortugueseOrdinalExtractor = extractors$8.PortugueseOrdinalExtractor; +exports.PortuguesePercentageExtractor = extractors$8.PortuguesePercentageExtractor; + +exports.PortugueseNumberParserConfiguration = parserConfiguration$4.PortugueseNumberParserConfiguration; + +exports.FrenchCardinalExtractor = extractors$10.FrenchCardinalExtractor; +exports.FrenchDoubleExtractor = extractors$10.FrenchDoubleExtractor; +exports.FrenchFractionExtractor = extractors$10.FrenchFractionExtractor; +exports.FrenchIntegerExtractor = extractors$10.FrenchIntegerExtractor; +exports.FrenchNumberExtractor = extractors$10.FrenchNumberExtractor; +exports.FrenchOrdinalExtractor = extractors$10.FrenchOrdinalExtractor; +exports.FrenchPercentageExtractor = extractors$10.FrenchPercentageExtractor; + +exports.FrenchNumberParserConfiguration = parserConfiguration$6.FrenchNumberParserConfiguration; + +exports.ChineseCardinalExtractor = extractors$12.ChineseCardinalExtractor; +exports.ChineseDoubleExtractor = extractors$12.ChineseDoubleExtractor; +exports.ChineseFractionExtractor = extractors$12.ChineseFractionExtractor; +exports.ChineseIntegerExtractor = extractors$12.ChineseIntegerExtractor; +exports.ChineseNumberExtractor = extractors$12.ChineseNumberExtractor; +exports.ChineseOrdinalExtractor = extractors$12.ChineseOrdinalExtractor; +exports.ChinesePercentageExtractor = extractors$12.ChinesePercentageExtractor; +exports.ChineseNumberExtractorMode = extractors$12.ChineseNumberExtractorMode; + +exports.ChineseNumberParserConfiguration = parserConfiguration$8.ChineseNumberParserConfiguration; + +exports.JapaneseCardinalExtractor = extractors$14.JapaneseCardinalExtractor; +exports.JapaneseDoubleExtractor = extractors$14.JapaneseDoubleExtractor; +exports.JapaneseFractionExtractor = extractors$14.JapaneseFractionExtractor; +exports.JapaneseIntegerExtractor = extractors$14.JapaneseIntegerExtractor; +exports.JapaneseNumberExtractor = extractors$14.JapaneseNumberExtractor; +exports.JapaneseOrdinalExtractor = extractors$14.JapaneseOrdinalExtractor; +exports.JapanesePercentageExtractor = extractors$14.JapanesePercentageExtractor; +exports.JapaneseNumberExtractorMode = extractors$14.JapaneseNumberExtractorMode; + +exports.JapaneseNumberParserConfiguration = parserConfiguration$10.JapaneseNumberParserConfiguration; + +}); + +unwrapExports(recognizersTextNumber); + +var models$4 = createCommonjsModule(function (module, exports) { +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); + +class DateTimeModelResult extends recognizersText.ModelResult { +} +exports.DateTimeModelResult = DateTimeModelResult; +class DateTimeModel { + constructor(parser, extractor) { + this.modelTypeName = "datetime"; + this.extractor = extractor; + this.parser = parser; + } + parse(query, referenceDate = new Date()) { + query = recognizersText.FormatUtility.preProcess(query); + let extractResults = this.extractor.extract(query, referenceDate); + let parseDates = new Array(); + for (let result of extractResults) { + let parseResult = this.parser.parse(result, referenceDate); + if (Array.isArray(parseResult.value)) { + parseDates.push(...parseResult.value); + } + else { + parseDates.push(parseResult); + } + } + return parseDates + .map(o => ({ + start: o.start, + end: o.start + o.length - 1, + resolution: o.value, + text: o.text, + typeName: o.type + })); + } +} +exports.DateTimeModel = DateTimeModel; + +}); + +unwrapExports(models$4); + +var baseDateTime = createCommonjsModule(function (module, exports) { +"use strict"; +// ------------------------------------------------------------------------------ +// +// This code was generated by a tool. +// Changes to this file may cause incorrect behavior and will be lost if +// the code is regenerated. +// +// ------------------------------------------------------------------------------ +Object.defineProperty(exports, "__esModule", { value: true }); +var BaseDateTime; +(function (BaseDateTime) { + BaseDateTime.HourRegex = `(?00|01|02|03|04|05|06|07|08|09|0|10|11|12|13|14|15|16|17|18|19|20|21|22|23|24|1|2|3|4|5|6|7|8|9)(h)?`; + BaseDateTime.MinuteRegex = `(?00|01|02|03|04|05|06|07|08|09|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|0|1|2|3|4|5|6|7|8|9)(?!\\d)`; + BaseDateTime.DeltaMinuteRegex = `(?00|01|02|03|04|05|06|07|08|09|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|0|1|2|3|4|5|6|7|8|9)`; + BaseDateTime.SecondRegex = `(?00|01|02|03|04|05|06|07|08|09|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|0|1|2|3|4|5|6|7|8|9)`; + BaseDateTime.FourDigitYearRegex = `\\b(?((1\\d|20)\\d{2})|2100)(?!\\.0\\b)\\b`; + BaseDateTime.IllegalYearRegex = `([-])(${BaseDateTime.FourDigitYearRegex})([-])`; + BaseDateTime.MinYearNum = '1500'; + BaseDateTime.MaxYearNum = '2100'; + BaseDateTime.MaxTwoDigitYearFutureNum = '30'; + BaseDateTime.MinTwoDigitYearPastNum = '70'; + BaseDateTime.DayOfMonthDictionary = new Map([["1", 1], ["2", 2], ["3", 3], ["4", 4], ["5", 5], ["6", 6], ["7", 7], ["8", 8], ["9", 9], ["10", 10], ["11", 11], ["12", 12], ["13", 13], ["14", 14], ["15", 15], ["16", 16], ["17", 17], ["18", 18], ["19", 19], ["20", 20], ["21", 21], ["22", 22], ["23", 23], ["24", 24], ["25", 25], ["26", 26], ["27", 27], ["28", 28], ["29", 29], ["30", 30], ["31", 31], ["01", 1], ["02", 2], ["03", 3], ["04", 4], ["05", 5], ["06", 6], ["07", 7], ["08", 8], ["09", 9]]); + BaseDateTime.VariableHolidaysTimexDictionary = new Map([["fathers", "-06-WXX-7-3"], ["mothers", "-05-WXX-7-2"], ["thanksgiving", "-11-WXX-4-4"], ["martinlutherking", "-01-WXX-1-3"], ["washingtonsbirthday", "-02-WXX-1-3"], ["canberra", "-03-WXX-1-1"], ["labour", "-09-WXX-1-1"], ["columbus", "-10-WXX-1-2"], ["memorial", "-05-WXX-1-4"]]); +})(BaseDateTime = exports.BaseDateTime || (exports.BaseDateTime = {})); + +}); + +unwrapExports(baseDateTime); + +var constants$2 = createCommonjsModule(function (module, exports) { +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); + +class Constants { +} +Constants.SYS_DATETIME_DATE = "date"; +Constants.SYS_DATETIME_TIME = "time"; +Constants.SYS_DATETIME_DATEPERIOD = "daterange"; +Constants.SYS_DATETIME_DATETIME = "datetime"; +Constants.SYS_DATETIME_TIMEPERIOD = "timerange"; +Constants.SYS_DATETIME_DATETIMEPERIOD = "datetimerange"; +Constants.SYS_DATETIME_DURATION = "duration"; +Constants.SYS_DATETIME_SET = "set"; +// key +Constants.TimexKey = "timex"; +Constants.ModKey = "Mod"; +Constants.TypeKey = "type"; +Constants.IsLunarKey = "isLunar"; +Constants.ResolveKey = "resolve"; +Constants.ResolveToPastKey = "resolveToPast"; +Constants.ResolveToFutureKey = "resolveToFuture"; +Constants.CommentKey = "Comment"; +Constants.CommentAmPm = "ampm"; +Constants.SemesterMonthCount = 6; +Constants.TrimesterMonthCount = 3; +Constants.FourDigitsYearLength = 4; +Constants.DefaultLanguageFallback_MDY = 'MDY'; +Constants.DefaultLanguageFallback_DMY = 'DMY'; +Constants.MinYearNum = parseInt(baseDateTime.BaseDateTime.MinYearNum); +Constants.MaxYearNum = parseInt(baseDateTime.BaseDateTime.MaxYearNum); +Constants.MaxTwoDigitYearFutureNum = parseInt(baseDateTime.BaseDateTime.MaxTwoDigitYearFutureNum); +Constants.MinTwoDigitYearPastNum = parseInt(baseDateTime.BaseDateTime.MinTwoDigitYearPastNum); +// Mod Value +// "before" -> To mean "preceding in time". I.e. Does not include the extracted datetime entity in the resolution's ending point. Equivalent to "<" +Constants.BEFORE_MOD = 'before'; +// "after" -> To mean "following in time". I.e. Does not include the extracted datetime entity in the resolution's starting point. Equivalent to ">" +Constants.AFTER_MOD = 'after'; +// "since" -> Same as "after", but including the extracted datetime entity. Equivalent to ">=" +Constants.SINCE_MOD = 'since'; +// "until" -> Same as "before", but including the extracted datetime entity. Equivalent to "<=" +Constants.UNTIL_MOD = 'until'; +Constants.EARLY_MOD = 'start'; +Constants.MID_MOD = 'mid'; +Constants.LATE_MOD = 'end'; +Constants.MORE_THAN_MOD = 'more'; +Constants.LESS_THAN_MOD = 'less'; +Constants.REF_UNDEF_MOD = 'ref_undef'; +exports.Constants = Constants; +class TimeTypeConstants { +} +TimeTypeConstants.DATE = "date"; +TimeTypeConstants.START_DATE = "startDate"; +TimeTypeConstants.END_DATE = "endDate"; +TimeTypeConstants.DATETIME = "dateTime"; +TimeTypeConstants.START_DATETIME = "startDateTime"; +TimeTypeConstants.END_DATETIME = "endDateTime"; +TimeTypeConstants.DURATION = "duration"; +TimeTypeConstants.SET = "set"; +TimeTypeConstants.TIME = "time"; +TimeTypeConstants.VALUE = "value"; +TimeTypeConstants.START_TIME = "startTime"; +TimeTypeConstants.END_TIME = "endTime"; +TimeTypeConstants.START = "start"; +TimeTypeConstants.END = "end"; +TimeTypeConstants.beforeMod = "before"; +TimeTypeConstants.afterMod = "after"; +TimeTypeConstants.sinceMod = "since"; +TimeTypeConstants.moreThanMod = "more"; +TimeTypeConstants.lessThanMod = "less"; +exports.TimeTypeConstants = TimeTypeConstants; + +}); + +unwrapExports(constants$2); + +var utilities$2 = createCommonjsModule(function (module, exports) { +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); + + +class Token { + constructor(start, end) { + this.start = start; + this.end = end; + } + get length() { + return this.end - this.start; + } + static mergeAllTokens(tokens, source, extractorName) { + let ret = []; + let mergedTokens = []; + tokens = tokens.sort((a, b) => { return a.start < b.start ? -1 : 1; }); + tokens.forEach(token => { + if (token) { + let bAdd = true; + for (let index = 0; index < mergedTokens.length && bAdd; index++) { + let mergedToken = mergedTokens[index]; + if (token.start >= mergedToken.start && token.end <= mergedToken.end) { + bAdd = false; + } + if (token.start > mergedToken.start && token.start < mergedToken.end) { + bAdd = false; + } + if (token.start <= mergedToken.start && token.end >= mergedToken.end) { + bAdd = false; + mergedTokens[index] = token; + } + } + if (bAdd) { + mergedTokens.push(token); + } + } + }); + mergedTokens.forEach(token => { + ret.push({ + start: token.start, + length: token.length, + text: source.substr(token.start, token.length), + type: extractorName + }); + }); + return ret; + } +} +exports.Token = Token; +var AgoLaterMode; +(function (AgoLaterMode) { + AgoLaterMode[AgoLaterMode["Date"] = 0] = "Date"; + AgoLaterMode[AgoLaterMode["DateTime"] = 1] = "DateTime"; +})(AgoLaterMode = exports.AgoLaterMode || (exports.AgoLaterMode = {})); +class AgoLaterUtil { + static extractorDurationWithBeforeAndAfter(source, er, ret, config) { + let pos = er.start + er.length; + if (pos <= source.length) { + let afterString = source.substring(pos); + let beforeString = source.substring(0, er.start); + let value = MatchingUtil.getAgoLaterIndex(afterString, config.agoRegex); + if (value.matched) { + ret.push(new Token(er.start, er.start + er.length + value.index)); + } + else { + value = MatchingUtil.getAgoLaterIndex(afterString, config.laterRegex); + if (value.matched) { + ret.push(new Token(er.start, er.start + er.length + value.index)); + } + else { + value = MatchingUtil.getInIndex(beforeString, config.inConnectorRegex); + // for range unit like "week, month, year", it should output dateRange or datetimeRange + if (recognizersText.RegExpUtility.getMatches(config.rangeUnitRegex, er.text).length > 0) + return ret; + if (value.matched && er.start && er.length && er.start >= value.index) { + ret.push(new Token(er.start - value.index, er.start + er.length)); + } + } + } + } + return ret; + } + static parseDurationWithAgoAndLater(source, referenceDate, durationExtractor, durationParser, unitMap, unitRegex, utilityConfiguration, mode) { + let result = new DateTimeResolutionResult(); + let duration = durationExtractor.extract(source, referenceDate).pop(); + if (!duration) + return result; + let pr = durationParser.parse(duration, referenceDate); + if (!pr) + return result; + let match = recognizersText.RegExpUtility.getMatches(unitRegex, source).pop(); + if (!match) + return result; + let afterStr = source.substr(duration.start + duration.length); + let beforeStr = source.substr(0, duration.start); + let srcUnit = match.groups('unit').value; + let durationResult = pr.value; + let numStr = durationResult.timex.substr(0, durationResult.timex.length - 1) + .replace('P', '') + .replace('T', ''); + let num = Number.parseInt(numStr, 10); + if (!num) + return result; + return AgoLaterUtil.getAgoLaterResult(pr, num, unitMap, srcUnit, afterStr, beforeStr, referenceDate, utilityConfiguration, mode); + } + static getAgoLaterResult(durationParseResult, num, unitMap, srcUnit, afterStr, beforeStr, referenceDate, utilityConfiguration, mode) { + let result = new DateTimeResolutionResult(); + let unitStr = unitMap.get(srcUnit); + if (!unitStr) + return result; + let numStr = num.toString(); + let containsAgo = MatchingUtil.containsAgoLaterIndex(afterStr, utilityConfiguration.agoRegex); + let containsLaterOrIn = MatchingUtil.containsAgoLaterIndex(afterStr, utilityConfiguration.laterRegex) || MatchingUtil.containsInIndex(beforeStr, utilityConfiguration.inConnectorRegex); + if (containsAgo) { + result = AgoLaterUtil.getDateResult(unitStr, num, referenceDate, false, mode); + durationParseResult.value.mod = constants$2.TimeTypeConstants.beforeMod; + result.subDateTimeEntities = [durationParseResult]; + return result; + } + if (containsLaterOrIn) { + result = AgoLaterUtil.getDateResult(unitStr, num, referenceDate, true, mode); + durationParseResult.value.mod = constants$2.TimeTypeConstants.afterMod; + result.subDateTimeEntities = [durationParseResult]; + return result; + } + return result; + } + static getDateResult(unitStr, num, referenceDate, isFuture, mode) { + let value = new Date(referenceDate); + let result = new DateTimeResolutionResult(); + let swift = isFuture ? 1 : -1; + switch (unitStr) { + case 'D': + value.setDate(referenceDate.getDate() + (num * swift)); + break; + case 'W': + value.setDate(referenceDate.getDate() + (num * swift * 7)); + break; + case 'MON': + value.setMonth(referenceDate.getMonth() + (num * swift)); + break; + case 'Y': + value.setFullYear(referenceDate.getFullYear() + (num * swift)); + break; + case 'H': + value.setHours(referenceDate.getHours() + (num * swift)); + break; + case 'M': + value.setMinutes(referenceDate.getMinutes() + (num * swift)); + break; + case 'S': + value.setSeconds(referenceDate.getSeconds() + (num * swift)); + break; + default: return result; + } + result.timex = mode === AgoLaterMode.Date ? FormatUtil.luisDateFromDate(value) : FormatUtil.luisDateTime(value); + result.futureValue = value; + result.pastValue = value; + result.success = true; + return result; + } +} +exports.AgoLaterUtil = AgoLaterUtil; +class MatchingUtil { + static getAgoLaterIndex(source, regex) { + let result = { matched: false, index: -1 }; + let referencedMatches = recognizersText.RegExpUtility.getMatches(regex, source.trim().toLowerCase()); + if (referencedMatches && referencedMatches.length > 0 && referencedMatches[0].index === 0) { + result.index = source.toLowerCase().indexOf(referencedMatches[0].value) + referencedMatches[0].length; + result.matched = true; + } + return result; + } + static getInIndex(source, regex) { + let result = { matched: false, index: -1 }; + let referencedMatch = recognizersText.RegExpUtility.getMatches(regex, source.trim().toLowerCase().split(' ').pop()); + if (referencedMatch && referencedMatch.length > 0) { + result.index = source.length - source.toLowerCase().lastIndexOf(referencedMatch[0].value); + result.matched = true; + } + return result; + } + static containsAgoLaterIndex(source, regex) { + return this.getAgoLaterIndex(source, regex).matched; + } + static containsInIndex(source, regex) { + return this.getInIndex(source, regex).matched; + } +} +exports.MatchingUtil = MatchingUtil; +class FormatUtil { + // Emulates .NET ToString("D{size}") + static toString(num, size) { + let s = "000000" + (num || ""); + return s.substr(s.length - size); + } + static luisDate(year, month, day) { + if (year === -1) { + if (month === -1) { + return new Array("XXXX", "XX", FormatUtil.toString(day, 2)).join("-"); + } + return new Array("XXXX", FormatUtil.toString(month + 1, 2), FormatUtil.toString(day, 2)).join("-"); + } + return new Array(FormatUtil.toString(year, 4), FormatUtil.toString(month + 1, 2), FormatUtil.toString(day, 2)).join("-"); + } + static luisDateFromDate(date) { + return FormatUtil.luisDate(date.getFullYear(), date.getMonth(), date.getDate()); + } + static luisTime(hour, min, second) { + return new Array(FormatUtil.toString(hour, 2), FormatUtil.toString(min, 2), FormatUtil.toString(second, 2)).join(":"); + } + static luisTimeFromDate(time) { + return FormatUtil.luisTime(time.getHours(), time.getMinutes(), time.getSeconds()); + } + static luisDateTime(time) { + return `${FormatUtil.luisDateFromDate(time)}T${FormatUtil.luisTimeFromDate(time)}`; + } + static formatDate(date) { + return new Array(FormatUtil.toString(date.getFullYear(), 4), FormatUtil.toString(date.getMonth() + 1, 2), FormatUtil.toString(date.getDate(), 2)).join("-"); + } + static formatTime(time) { + return new Array(FormatUtil.toString(time.getHours(), 2), FormatUtil.toString(time.getMinutes(), 2), FormatUtil.toString(time.getSeconds(), 2)).join(":"); + } + static formatDateTime(datetime) { + return `${FormatUtil.formatDate(datetime)} ${FormatUtil.formatTime(datetime)}`; + } + static shortTime(hour, minute, second) { + if (minute < 0 && second < 0) { + return `T${FormatUtil.toString(hour, 2)}`; + } + else if (second < 0) { + return `T${FormatUtil.toString(hour, 2)}:${FormatUtil.toString(minute, 2)}`; + } + return `T${FormatUtil.toString(hour, 2)}:${FormatUtil.toString(minute, 2)}:${FormatUtil.toString(second, 2)}`; + } + static luisTimeSpan(from, to) { + let result = 'PT'; + let span = DateUtils.totalHoursFloor(from, to); + if (span > 0) { + result = `${result}${span}H`; + } + span = DateUtils.totalMinutesFloor(from, to) - (span * 60); + if (span > 0 && span < 60) { + result = `${result}${span}M`; + } + span = DateUtils.totalSeconds(from, to) - (span * 60); + if (span > 0 && span < 60) { + result = `${result}${span}S`; + } + return result; + } + static allStringToPm(timeStr) { + let matches = recognizersText.RegExpUtility.getMatches(FormatUtil.HourTimexRegex, timeStr); + let split = Array(); + let lastPos = 0; + matches.forEach(match => { + if (lastPos !== match.index) + split.push(timeStr.substring(lastPos, match.index)); + split.push(timeStr.substring(match.index, match.index + match.length)); + lastPos = match.index + match.length; + }); + if (timeStr.substring(lastPos)) { + split.push(timeStr.substring(lastPos)); + } + for (let i = 0; i < split.length; i += 1) { + if (recognizersText.RegExpUtility.getMatches(FormatUtil.HourTimexRegex, split[i]).length > 0) { + split[i] = FormatUtil.toPm(split[i]); + } + } + return split.join(''); + } + static toPm(timeStr) { + let hasT = false; + if (timeStr.startsWith("T")) { + hasT = true; + timeStr = timeStr.substring(1); + } + let split = timeStr.split(':'); + let hour = parseInt(split[0], 10); + hour = (hour === 12) ? 0 : hour + 12; + split[0] = FormatUtil.toString(hour, 2); + return (hasT ? "T" : "") + split.join(":"); + } +} +FormatUtil.HourTimexRegex = recognizersText.RegExpUtility.getSafeRegExp(String.raw `(?= 12) { + year += (month + 1) / 12; + month %= 12; + } + return this.safeCreateFromMinValue(year, month, day); + } + static safeCreateFromMinValueWithDateAndTime(date, time) { + return this.safeCreateFromMinValue(date.getFullYear(), date.getMonth(), date.getDate(), time ? time.getHours() : 0, time ? time.getMinutes() : 0, time ? time.getSeconds() : 0); + } + static isLeapYear(year) { + return ((year % 4 === 0) && (year % 100 !== 0)) || (year % 400 === 0); + } + static dayOfYear(date) { + let start = new Date(date.getFullYear(), 0, 1); + let diffDays = date.valueOf() - start.valueOf(); + return Math.floor(diffDays / DateUtils.oneDay); + } + static validDays(year) { return [31, this.isLeapYear(year) ? 29 : 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31]; } + static isValidDate(year, month, day) { + return year > 0 && year <= 9999 + && month >= 0 && month < 12 + && day > 0 && day <= this.validDays(year)[month]; + } + static isValidTime(hour, minute, second) { + return hour >= 0 && hour < 24 + && minute >= 0 && minute < 60 + && second >= 0 && minute < 60; + } +} +DateUtils.oneDay = 24 * 60 * 60 * 1000; +DateUtils.oneHour = 60 * 60 * 1000; +DateUtils.oneMinute = 60 * 1000; +DateUtils.oneSecond = 1000; +exports.DateUtils = DateUtils; + +}); + +unwrapExports(utilities$2); + +var lodash_isequal = createCommonjsModule(function (module, exports) { +/** + * Lodash (Custom Build) + * Build: `lodash modularize exports="npm" -o ./` + * Copyright JS Foundation and other contributors + * Released under MIT license + * Based on Underscore.js 1.8.3 + * Copyright Jeremy Ashkenas, DocumentCloud and Investigative Reporters & Editors + */ + +/** Used as the size to enable large array optimizations. */ +var LARGE_ARRAY_SIZE = 200; + +/** Used to stand-in for `undefined` hash values. */ +var HASH_UNDEFINED = '__lodash_hash_undefined__'; + +/** Used to compose bitmasks for value comparisons. */ +var COMPARE_PARTIAL_FLAG = 1, + COMPARE_UNORDERED_FLAG = 2; + +/** Used as references for various `Number` constants. */ +var MAX_SAFE_INTEGER = 9007199254740991; + +/** `Object#toString` result references. */ +var argsTag = '[object Arguments]', + arrayTag = '[object Array]', + asyncTag = '[object AsyncFunction]', + boolTag = '[object Boolean]', + dateTag = '[object Date]', + errorTag = '[object Error]', + funcTag = '[object Function]', + genTag = '[object GeneratorFunction]', + mapTag = '[object Map]', + numberTag = '[object Number]', + nullTag = '[object Null]', + objectTag = '[object Object]', + promiseTag = '[object Promise]', + proxyTag = '[object Proxy]', + regexpTag = '[object RegExp]', + setTag = '[object Set]', + stringTag = '[object String]', + symbolTag = '[object Symbol]', + undefinedTag = '[object Undefined]', + weakMapTag = '[object WeakMap]'; + +var arrayBufferTag = '[object ArrayBuffer]', + dataViewTag = '[object DataView]', + float32Tag = '[object Float32Array]', + float64Tag = '[object Float64Array]', + int8Tag = '[object Int8Array]', + int16Tag = '[object Int16Array]', + int32Tag = '[object Int32Array]', + uint8Tag = '[object Uint8Array]', + uint8ClampedTag = '[object Uint8ClampedArray]', + uint16Tag = '[object Uint16Array]', + uint32Tag = '[object Uint32Array]'; + +/** + * Used to match `RegExp` + * [syntax characters](http://ecma-international.org/ecma-262/7.0/#sec-patterns). + */ +var reRegExpChar = /[\\^$.*+?()[\]{}|]/g; + +/** Used to detect host constructors (Safari). */ +var reIsHostCtor = /^\[object .+?Constructor\]$/; + +/** Used to detect unsigned integer values. */ +var reIsUint = /^(?:0|[1-9]\d*)$/; + +/** Used to identify `toStringTag` values of typed arrays. */ +var typedArrayTags = {}; +typedArrayTags[float32Tag] = typedArrayTags[float64Tag] = +typedArrayTags[int8Tag] = typedArrayTags[int16Tag] = +typedArrayTags[int32Tag] = typedArrayTags[uint8Tag] = +typedArrayTags[uint8ClampedTag] = typedArrayTags[uint16Tag] = +typedArrayTags[uint32Tag] = true; +typedArrayTags[argsTag] = typedArrayTags[arrayTag] = +typedArrayTags[arrayBufferTag] = typedArrayTags[boolTag] = +typedArrayTags[dataViewTag] = typedArrayTags[dateTag] = +typedArrayTags[errorTag] = typedArrayTags[funcTag] = +typedArrayTags[mapTag] = typedArrayTags[numberTag] = +typedArrayTags[objectTag] = typedArrayTags[regexpTag] = +typedArrayTags[setTag] = typedArrayTags[stringTag] = +typedArrayTags[weakMapTag] = false; + +/** Detect free variable `global` from Node.js. */ +var freeGlobal = typeof commonjsGlobal == 'object' && commonjsGlobal && commonjsGlobal.Object === Object && commonjsGlobal; + +/** Detect free variable `self`. */ +var freeSelf = typeof self == 'object' && self && self.Object === Object && self; + +/** Used as a reference to the global object. */ +var root = freeGlobal || freeSelf || Function('return this')(); + +/** Detect free variable `exports`. */ +var freeExports = 'object' == 'object' && exports && !exports.nodeType && exports; + +/** Detect free variable `module`. */ +var freeModule = freeExports && 'object' == 'object' && module && !module.nodeType && module; + +/** Detect the popular CommonJS extension `module.exports`. */ +var moduleExports = freeModule && freeModule.exports === freeExports; + +/** Detect free variable `process` from Node.js. */ +var freeProcess = moduleExports && freeGlobal.process; + +/** Used to access faster Node.js helpers. */ +var nodeUtil = (function() { + try { + return freeProcess && freeProcess.binding && freeProcess.binding('util'); + } catch (e) {} +}()); + +/* Node.js helper references. */ +var nodeIsTypedArray = nodeUtil && nodeUtil.isTypedArray; + +/** + * A specialized version of `_.filter` for arrays without support for + * iteratee shorthands. + * + * @private + * @param {Array} [array] The array to iterate over. + * @param {Function} predicate The function invoked per iteration. + * @returns {Array} Returns the new filtered array. + */ +function arrayFilter(array, predicate) { + var index = -1, + length = array == null ? 0 : array.length, + resIndex = 0, + result = []; + + while (++index < length) { + var value = array[index]; + if (predicate(value, index, array)) { + result[resIndex++] = value; + } + } + return result; +} + +/** + * Appends the elements of `values` to `array`. + * + * @private + * @param {Array} array The array to modify. + * @param {Array} values The values to append. + * @returns {Array} Returns `array`. + */ +function arrayPush(array, values) { + var index = -1, + length = values.length, + offset = array.length; + + while (++index < length) { + array[offset + index] = values[index]; + } + return array; +} + +/** + * A specialized version of `_.some` for arrays without support for iteratee + * shorthands. + * + * @private + * @param {Array} [array] The array to iterate over. + * @param {Function} predicate The function invoked per iteration. + * @returns {boolean} Returns `true` if any element passes the predicate check, + * else `false`. + */ +function arraySome(array, predicate) { + var index = -1, + length = array == null ? 0 : array.length; + + while (++index < length) { + if (predicate(array[index], index, array)) { + return true; + } + } + return false; +} + +/** + * The base implementation of `_.times` without support for iteratee shorthands + * or max array length checks. + * + * @private + * @param {number} n The number of times to invoke `iteratee`. + * @param {Function} iteratee The function invoked per iteration. + * @returns {Array} Returns the array of results. + */ +function baseTimes(n, iteratee) { + var index = -1, + result = Array(n); + + while (++index < n) { + result[index] = iteratee(index); + } + return result; +} + +/** + * The base implementation of `_.unary` without support for storing metadata. + * + * @private + * @param {Function} func The function to cap arguments for. + * @returns {Function} Returns the new capped function. + */ +function baseUnary(func) { + return function(value) { + return func(value); + }; +} + +/** + * Checks if a `cache` value for `key` exists. + * + * @private + * @param {Object} cache The cache to query. + * @param {string} key The key of the entry to check. + * @returns {boolean} Returns `true` if an entry for `key` exists, else `false`. + */ +function cacheHas(cache, key) { + return cache.has(key); +} + +/** + * Gets the value at `key` of `object`. + * + * @private + * @param {Object} [object] The object to query. + * @param {string} key The key of the property to get. + * @returns {*} Returns the property value. + */ +function getValue(object, key) { + return object == null ? undefined : object[key]; +} + +/** + * Converts `map` to its key-value pairs. + * + * @private + * @param {Object} map The map to convert. + * @returns {Array} Returns the key-value pairs. + */ +function mapToArray(map) { + var index = -1, + result = Array(map.size); + + map.forEach(function(value, key) { + result[++index] = [key, value]; + }); + return result; +} + +/** + * Creates a unary function that invokes `func` with its argument transformed. + * + * @private + * @param {Function} func The function to wrap. + * @param {Function} transform The argument transform. + * @returns {Function} Returns the new function. + */ +function overArg(func, transform) { + return function(arg) { + return func(transform(arg)); + }; +} + +/** + * Converts `set` to an array of its values. + * + * @private + * @param {Object} set The set to convert. + * @returns {Array} Returns the values. + */ +function setToArray(set) { + var index = -1, + result = Array(set.size); + + set.forEach(function(value) { + result[++index] = value; + }); + return result; +} + +/** Used for built-in method references. */ +var arrayProto = Array.prototype, + funcProto = Function.prototype, + objectProto = Object.prototype; + +/** Used to detect overreaching core-js shims. */ +var coreJsData = root['__core-js_shared__']; + +/** Used to resolve the decompiled source of functions. */ +var funcToString = funcProto.toString; + +/** Used to check objects for own properties. */ +var hasOwnProperty = objectProto.hasOwnProperty; + +/** Used to detect methods masquerading as native. */ +var maskSrcKey = (function() { + var uid = /[^.]+$/.exec(coreJsData && coreJsData.keys && coreJsData.keys.IE_PROTO || ''); + return uid ? ('Symbol(src)_1.' + uid) : ''; +}()); + +/** + * Used to resolve the + * [`toStringTag`](http://ecma-international.org/ecma-262/7.0/#sec-object.prototype.tostring) + * of values. + */ +var nativeObjectToString = objectProto.toString; + +/** Used to detect if a method is native. */ +var reIsNative = RegExp('^' + + funcToString.call(hasOwnProperty).replace(reRegExpChar, '\\$&') + .replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g, '$1.*?') + '$' +); + +/** Built-in value references. */ +var Buffer = moduleExports ? root.Buffer : undefined, + Symbol = root.Symbol, + Uint8Array = root.Uint8Array, + propertyIsEnumerable = objectProto.propertyIsEnumerable, + splice = arrayProto.splice, + symToStringTag = Symbol ? Symbol.toStringTag : undefined; + +/* Built-in method references for those with the same name as other `lodash` methods. */ +var nativeGetSymbols = Object.getOwnPropertySymbols, + nativeIsBuffer = Buffer ? Buffer.isBuffer : undefined, + nativeKeys = overArg(Object.keys, Object); + +/* Built-in method references that are verified to be native. */ +var DataView = getNative(root, 'DataView'), + Map = getNative(root, 'Map'), + Promise = getNative(root, 'Promise'), + Set = getNative(root, 'Set'), + WeakMap = getNative(root, 'WeakMap'), + nativeCreate = getNative(Object, 'create'); + +/** Used to detect maps, sets, and weakmaps. */ +var dataViewCtorString = toSource(DataView), + mapCtorString = toSource(Map), + promiseCtorString = toSource(Promise), + setCtorString = toSource(Set), + weakMapCtorString = toSource(WeakMap); + +/** Used to convert symbols to primitives and strings. */ +var symbolProto = Symbol ? Symbol.prototype : undefined, + symbolValueOf = symbolProto ? symbolProto.valueOf : undefined; + +/** + * Creates a hash object. + * + * @private + * @constructor + * @param {Array} [entries] The key-value pairs to cache. + */ +function Hash(entries) { + var index = -1, + length = entries == null ? 0 : entries.length; + + this.clear(); + while (++index < length) { + var entry = entries[index]; + this.set(entry[0], entry[1]); + } +} + +/** + * Removes all key-value entries from the hash. + * + * @private + * @name clear + * @memberOf Hash + */ +function hashClear() { + this.__data__ = nativeCreate ? nativeCreate(null) : {}; + this.size = 0; +} + +/** + * Removes `key` and its value from the hash. + * + * @private + * @name delete + * @memberOf Hash + * @param {Object} hash The hash to modify. + * @param {string} key The key of the value to remove. + * @returns {boolean} Returns `true` if the entry was removed, else `false`. + */ +function hashDelete(key) { + var result = this.has(key) && delete this.__data__[key]; + this.size -= result ? 1 : 0; + return result; +} + +/** + * Gets the hash value for `key`. + * + * @private + * @name get + * @memberOf Hash + * @param {string} key The key of the value to get. + * @returns {*} Returns the entry value. + */ +function hashGet(key) { + var data = this.__data__; + if (nativeCreate) { + var result = data[key]; + return result === HASH_UNDEFINED ? undefined : result; + } + return hasOwnProperty.call(data, key) ? data[key] : undefined; +} + +/** + * Checks if a hash value for `key` exists. + * + * @private + * @name has + * @memberOf Hash + * @param {string} key The key of the entry to check. + * @returns {boolean} Returns `true` if an entry for `key` exists, else `false`. + */ +function hashHas(key) { + var data = this.__data__; + return nativeCreate ? (data[key] !== undefined) : hasOwnProperty.call(data, key); +} + +/** + * Sets the hash `key` to `value`. + * + * @private + * @name set + * @memberOf Hash + * @param {string} key The key of the value to set. + * @param {*} value The value to set. + * @returns {Object} Returns the hash instance. + */ +function hashSet(key, value) { + var data = this.__data__; + this.size += this.has(key) ? 0 : 1; + data[key] = (nativeCreate && value === undefined) ? HASH_UNDEFINED : value; + return this; +} + +// Add methods to `Hash`. +Hash.prototype.clear = hashClear; +Hash.prototype['delete'] = hashDelete; +Hash.prototype.get = hashGet; +Hash.prototype.has = hashHas; +Hash.prototype.set = hashSet; + +/** + * Creates an list cache object. + * + * @private + * @constructor + * @param {Array} [entries] The key-value pairs to cache. + */ +function ListCache(entries) { + var index = -1, + length = entries == null ? 0 : entries.length; + + this.clear(); + while (++index < length) { + var entry = entries[index]; + this.set(entry[0], entry[1]); + } +} + +/** + * Removes all key-value entries from the list cache. + * + * @private + * @name clear + * @memberOf ListCache + */ +function listCacheClear() { + this.__data__ = []; + this.size = 0; +} + +/** + * Removes `key` and its value from the list cache. + * + * @private + * @name delete + * @memberOf ListCache + * @param {string} key The key of the value to remove. + * @returns {boolean} Returns `true` if the entry was removed, else `false`. + */ +function listCacheDelete(key) { + var data = this.__data__, + index = assocIndexOf(data, key); + + if (index < 0) { + return false; + } + var lastIndex = data.length - 1; + if (index == lastIndex) { + data.pop(); + } else { + splice.call(data, index, 1); + } + --this.size; + return true; +} + +/** + * Gets the list cache value for `key`. + * + * @private + * @name get + * @memberOf ListCache + * @param {string} key The key of the value to get. + * @returns {*} Returns the entry value. + */ +function listCacheGet(key) { + var data = this.__data__, + index = assocIndexOf(data, key); + + return index < 0 ? undefined : data[index][1]; +} + +/** + * Checks if a list cache value for `key` exists. + * + * @private + * @name has + * @memberOf ListCache + * @param {string} key The key of the entry to check. + * @returns {boolean} Returns `true` if an entry for `key` exists, else `false`. + */ +function listCacheHas(key) { + return assocIndexOf(this.__data__, key) > -1; +} + +/** + * Sets the list cache `key` to `value`. + * + * @private + * @name set + * @memberOf ListCache + * @param {string} key The key of the value to set. + * @param {*} value The value to set. + * @returns {Object} Returns the list cache instance. + */ +function listCacheSet(key, value) { + var data = this.__data__, + index = assocIndexOf(data, key); + + if (index < 0) { + ++this.size; + data.push([key, value]); + } else { + data[index][1] = value; + } + return this; +} + +// Add methods to `ListCache`. +ListCache.prototype.clear = listCacheClear; +ListCache.prototype['delete'] = listCacheDelete; +ListCache.prototype.get = listCacheGet; +ListCache.prototype.has = listCacheHas; +ListCache.prototype.set = listCacheSet; + +/** + * Creates a map cache object to store key-value pairs. + * + * @private + * @constructor + * @param {Array} [entries] The key-value pairs to cache. + */ +function MapCache(entries) { + var index = -1, + length = entries == null ? 0 : entries.length; + + this.clear(); + while (++index < length) { + var entry = entries[index]; + this.set(entry[0], entry[1]); + } +} + +/** + * Removes all key-value entries from the map. + * + * @private + * @name clear + * @memberOf MapCache + */ +function mapCacheClear() { + this.size = 0; + this.__data__ = { + 'hash': new Hash, + 'map': new (Map || ListCache), + 'string': new Hash + }; +} + +/** + * Removes `key` and its value from the map. + * + * @private + * @name delete + * @memberOf MapCache + * @param {string} key The key of the value to remove. + * @returns {boolean} Returns `true` if the entry was removed, else `false`. + */ +function mapCacheDelete(key) { + var result = getMapData(this, key)['delete'](key); + this.size -= result ? 1 : 0; + return result; +} + +/** + * Gets the map value for `key`. + * + * @private + * @name get + * @memberOf MapCache + * @param {string} key The key of the value to get. + * @returns {*} Returns the entry value. + */ +function mapCacheGet(key) { + return getMapData(this, key).get(key); +} + +/** + * Checks if a map value for `key` exists. + * + * @private + * @name has + * @memberOf MapCache + * @param {string} key The key of the entry to check. + * @returns {boolean} Returns `true` if an entry for `key` exists, else `false`. + */ +function mapCacheHas(key) { + return getMapData(this, key).has(key); +} + +/** + * Sets the map `key` to `value`. + * + * @private + * @name set + * @memberOf MapCache + * @param {string} key The key of the value to set. + * @param {*} value The value to set. + * @returns {Object} Returns the map cache instance. + */ +function mapCacheSet(key, value) { + var data = getMapData(this, key), + size = data.size; + + data.set(key, value); + this.size += data.size == size ? 0 : 1; + return this; +} + +// Add methods to `MapCache`. +MapCache.prototype.clear = mapCacheClear; +MapCache.prototype['delete'] = mapCacheDelete; +MapCache.prototype.get = mapCacheGet; +MapCache.prototype.has = mapCacheHas; +MapCache.prototype.set = mapCacheSet; + +/** + * + * Creates an array cache object to store unique values. + * + * @private + * @constructor + * @param {Array} [values] The values to cache. + */ +function SetCache(values) { + var index = -1, + length = values == null ? 0 : values.length; + + this.__data__ = new MapCache; + while (++index < length) { + this.add(values[index]); + } +} + +/** + * Adds `value` to the array cache. + * + * @private + * @name add + * @memberOf SetCache + * @alias push + * @param {*} value The value to cache. + * @returns {Object} Returns the cache instance. + */ +function setCacheAdd(value) { + this.__data__.set(value, HASH_UNDEFINED); + return this; +} + +/** + * Checks if `value` is in the array cache. + * + * @private + * @name has + * @memberOf SetCache + * @param {*} value The value to search for. + * @returns {number} Returns `true` if `value` is found, else `false`. + */ +function setCacheHas(value) { + return this.__data__.has(value); +} + +// Add methods to `SetCache`. +SetCache.prototype.add = SetCache.prototype.push = setCacheAdd; +SetCache.prototype.has = setCacheHas; + +/** + * Creates a stack cache object to store key-value pairs. + * + * @private + * @constructor + * @param {Array} [entries] The key-value pairs to cache. + */ +function Stack(entries) { + var data = this.__data__ = new ListCache(entries); + this.size = data.size; +} + +/** + * Removes all key-value entries from the stack. + * + * @private + * @name clear + * @memberOf Stack + */ +function stackClear() { + this.__data__ = new ListCache; + this.size = 0; +} + +/** + * Removes `key` and its value from the stack. + * + * @private + * @name delete + * @memberOf Stack + * @param {string} key The key of the value to remove. + * @returns {boolean} Returns `true` if the entry was removed, else `false`. + */ +function stackDelete(key) { + var data = this.__data__, + result = data['delete'](key); + + this.size = data.size; + return result; +} + +/** + * Gets the stack value for `key`. + * + * @private + * @name get + * @memberOf Stack + * @param {string} key The key of the value to get. + * @returns {*} Returns the entry value. + */ +function stackGet(key) { + return this.__data__.get(key); +} + +/** + * Checks if a stack value for `key` exists. + * + * @private + * @name has + * @memberOf Stack + * @param {string} key The key of the entry to check. + * @returns {boolean} Returns `true` if an entry for `key` exists, else `false`. + */ +function stackHas(key) { + return this.__data__.has(key); +} + +/** + * Sets the stack `key` to `value`. + * + * @private + * @name set + * @memberOf Stack + * @param {string} key The key of the value to set. + * @param {*} value The value to set. + * @returns {Object} Returns the stack cache instance. + */ +function stackSet(key, value) { + var data = this.__data__; + if (data instanceof ListCache) { + var pairs = data.__data__; + if (!Map || (pairs.length < LARGE_ARRAY_SIZE - 1)) { + pairs.push([key, value]); + this.size = ++data.size; + return this; + } + data = this.__data__ = new MapCache(pairs); + } + data.set(key, value); + this.size = data.size; + return this; +} + +// Add methods to `Stack`. +Stack.prototype.clear = stackClear; +Stack.prototype['delete'] = stackDelete; +Stack.prototype.get = stackGet; +Stack.prototype.has = stackHas; +Stack.prototype.set = stackSet; + +/** + * Creates an array of the enumerable property names of the array-like `value`. + * + * @private + * @param {*} value The value to query. + * @param {boolean} inherited Specify returning inherited property names. + * @returns {Array} Returns the array of property names. + */ +function arrayLikeKeys(value, inherited) { + var isArr = isArray(value), + isArg = !isArr && isArguments(value), + isBuff = !isArr && !isArg && isBuffer(value), + isType = !isArr && !isArg && !isBuff && isTypedArray(value), + skipIndexes = isArr || isArg || isBuff || isType, + result = skipIndexes ? baseTimes(value.length, String) : [], + length = result.length; + + for (var key in value) { + if ((inherited || hasOwnProperty.call(value, key)) && + !(skipIndexes && ( + // Safari 9 has enumerable `arguments.length` in strict mode. + key == 'length' || + // Node.js 0.10 has enumerable non-index properties on buffers. + (isBuff && (key == 'offset' || key == 'parent')) || + // PhantomJS 2 has enumerable non-index properties on typed arrays. + (isType && (key == 'buffer' || key == 'byteLength' || key == 'byteOffset')) || + // Skip index properties. + isIndex(key, length) + ))) { + result.push(key); + } + } + return result; +} + +/** + * Gets the index at which the `key` is found in `array` of key-value pairs. + * + * @private + * @param {Array} array The array to inspect. + * @param {*} key The key to search for. + * @returns {number} Returns the index of the matched value, else `-1`. + */ +function assocIndexOf(array, key) { + var length = array.length; + while (length--) { + if (eq(array[length][0], key)) { + return length; + } + } + return -1; +} + +/** + * The base implementation of `getAllKeys` and `getAllKeysIn` which uses + * `keysFunc` and `symbolsFunc` to get the enumerable property names and + * symbols of `object`. + * + * @private + * @param {Object} object The object to query. + * @param {Function} keysFunc The function to get the keys of `object`. + * @param {Function} symbolsFunc The function to get the symbols of `object`. + * @returns {Array} Returns the array of property names and symbols. + */ +function baseGetAllKeys(object, keysFunc, symbolsFunc) { + var result = keysFunc(object); + return isArray(object) ? result : arrayPush(result, symbolsFunc(object)); +} + +/** + * The base implementation of `getTag` without fallbacks for buggy environments. + * + * @private + * @param {*} value The value to query. + * @returns {string} Returns the `toStringTag`. + */ +function baseGetTag(value) { + if (value == null) { + return value === undefined ? undefinedTag : nullTag; + } + return (symToStringTag && symToStringTag in Object(value)) + ? getRawTag(value) + : objectToString(value); +} + +/** + * The base implementation of `_.isArguments`. + * + * @private + * @param {*} value The value to check. + * @returns {boolean} Returns `true` if `value` is an `arguments` object, + */ +function baseIsArguments(value) { + return isObjectLike(value) && baseGetTag(value) == argsTag; +} + +/** + * The base implementation of `_.isEqual` which supports partial comparisons + * and tracks traversed objects. + * + * @private + * @param {*} value The value to compare. + * @param {*} other The other value to compare. + * @param {boolean} bitmask The bitmask flags. + * 1 - Unordered comparison + * 2 - Partial comparison + * @param {Function} [customizer] The function to customize comparisons. + * @param {Object} [stack] Tracks traversed `value` and `other` objects. + * @returns {boolean} Returns `true` if the values are equivalent, else `false`. + */ +function baseIsEqual(value, other, bitmask, customizer, stack) { + if (value === other) { + return true; + } + if (value == null || other == null || (!isObjectLike(value) && !isObjectLike(other))) { + return value !== value && other !== other; + } + return baseIsEqualDeep(value, other, bitmask, customizer, baseIsEqual, stack); +} + +/** + * A specialized version of `baseIsEqual` for arrays and objects which performs + * deep comparisons and tracks traversed objects enabling objects with circular + * references to be compared. + * + * @private + * @param {Object} object The object to compare. + * @param {Object} other The other object to compare. + * @param {number} bitmask The bitmask flags. See `baseIsEqual` for more details. + * @param {Function} customizer The function to customize comparisons. + * @param {Function} equalFunc The function to determine equivalents of values. + * @param {Object} [stack] Tracks traversed `object` and `other` objects. + * @returns {boolean} Returns `true` if the objects are equivalent, else `false`. + */ +function baseIsEqualDeep(object, other, bitmask, customizer, equalFunc, stack) { + var objIsArr = isArray(object), + othIsArr = isArray(other), + objTag = objIsArr ? arrayTag : getTag(object), + othTag = othIsArr ? arrayTag : getTag(other); + + objTag = objTag == argsTag ? objectTag : objTag; + othTag = othTag == argsTag ? objectTag : othTag; + + var objIsObj = objTag == objectTag, + othIsObj = othTag == objectTag, + isSameTag = objTag == othTag; + + if (isSameTag && isBuffer(object)) { + if (!isBuffer(other)) { + return false; + } + objIsArr = true; + objIsObj = false; + } + if (isSameTag && !objIsObj) { + stack || (stack = new Stack); + return (objIsArr || isTypedArray(object)) + ? equalArrays(object, other, bitmask, customizer, equalFunc, stack) + : equalByTag(object, other, objTag, bitmask, customizer, equalFunc, stack); + } + if (!(bitmask & COMPARE_PARTIAL_FLAG)) { + var objIsWrapped = objIsObj && hasOwnProperty.call(object, '__wrapped__'), + othIsWrapped = othIsObj && hasOwnProperty.call(other, '__wrapped__'); + + if (objIsWrapped || othIsWrapped) { + var objUnwrapped = objIsWrapped ? object.value() : object, + othUnwrapped = othIsWrapped ? other.value() : other; + + stack || (stack = new Stack); + return equalFunc(objUnwrapped, othUnwrapped, bitmask, customizer, stack); + } + } + if (!isSameTag) { + return false; + } + stack || (stack = new Stack); + return equalObjects(object, other, bitmask, customizer, equalFunc, stack); +} + +/** + * The base implementation of `_.isNative` without bad shim checks. + * + * @private + * @param {*} value The value to check. + * @returns {boolean} Returns `true` if `value` is a native function, + * else `false`. + */ +function baseIsNative(value) { + if (!isObject(value) || isMasked(value)) { + return false; + } + var pattern = isFunction(value) ? reIsNative : reIsHostCtor; + return pattern.test(toSource(value)); +} + +/** + * The base implementation of `_.isTypedArray` without Node.js optimizations. + * + * @private + * @param {*} value The value to check. + * @returns {boolean} Returns `true` if `value` is a typed array, else `false`. + */ +function baseIsTypedArray(value) { + return isObjectLike(value) && + isLength(value.length) && !!typedArrayTags[baseGetTag(value)]; +} + +/** + * The base implementation of `_.keys` which doesn't treat sparse arrays as dense. + * + * @private + * @param {Object} object The object to query. + * @returns {Array} Returns the array of property names. + */ +function baseKeys(object) { + if (!isPrototype(object)) { + return nativeKeys(object); + } + var result = []; + for (var key in Object(object)) { + if (hasOwnProperty.call(object, key) && key != 'constructor') { + result.push(key); + } + } + return result; +} + +/** + * A specialized version of `baseIsEqualDeep` for arrays with support for + * partial deep comparisons. + * + * @private + * @param {Array} array The array to compare. + * @param {Array} other The other array to compare. + * @param {number} bitmask The bitmask flags. See `baseIsEqual` for more details. + * @param {Function} customizer The function to customize comparisons. + * @param {Function} equalFunc The function to determine equivalents of values. + * @param {Object} stack Tracks traversed `array` and `other` objects. + * @returns {boolean} Returns `true` if the arrays are equivalent, else `false`. + */ +function equalArrays(array, other, bitmask, customizer, equalFunc, stack) { + var isPartial = bitmask & COMPARE_PARTIAL_FLAG, + arrLength = array.length, + othLength = other.length; + + if (arrLength != othLength && !(isPartial && othLength > arrLength)) { + return false; + } + // Assume cyclic values are equal. + var stacked = stack.get(array); + if (stacked && stack.get(other)) { + return stacked == other; + } + var index = -1, + result = true, + seen = (bitmask & COMPARE_UNORDERED_FLAG) ? new SetCache : undefined; + + stack.set(array, other); + stack.set(other, array); + + // Ignore non-index properties. + while (++index < arrLength) { + var arrValue = array[index], + othValue = other[index]; + + if (customizer) { + var compared = isPartial + ? customizer(othValue, arrValue, index, other, array, stack) + : customizer(arrValue, othValue, index, array, other, stack); + } + if (compared !== undefined) { + if (compared) { + continue; + } + result = false; + break; + } + // Recursively compare arrays (susceptible to call stack limits). + if (seen) { + if (!arraySome(other, function(othValue, othIndex) { + if (!cacheHas(seen, othIndex) && + (arrValue === othValue || equalFunc(arrValue, othValue, bitmask, customizer, stack))) { + return seen.push(othIndex); + } + })) { + result = false; + break; + } + } else if (!( + arrValue === othValue || + equalFunc(arrValue, othValue, bitmask, customizer, stack) + )) { + result = false; + break; + } + } + stack['delete'](array); + stack['delete'](other); + return result; +} + +/** + * A specialized version of `baseIsEqualDeep` for comparing objects of + * the same `toStringTag`. + * + * **Note:** This function only supports comparing values with tags of + * `Boolean`, `Date`, `Error`, `Number`, `RegExp`, or `String`. + * + * @private + * @param {Object} object The object to compare. + * @param {Object} other The other object to compare. + * @param {string} tag The `toStringTag` of the objects to compare. + * @param {number} bitmask The bitmask flags. See `baseIsEqual` for more details. + * @param {Function} customizer The function to customize comparisons. + * @param {Function} equalFunc The function to determine equivalents of values. + * @param {Object} stack Tracks traversed `object` and `other` objects. + * @returns {boolean} Returns `true` if the objects are equivalent, else `false`. + */ +function equalByTag(object, other, tag, bitmask, customizer, equalFunc, stack) { + switch (tag) { + case dataViewTag: + if ((object.byteLength != other.byteLength) || + (object.byteOffset != other.byteOffset)) { + return false; + } + object = object.buffer; + other = other.buffer; + + case arrayBufferTag: + if ((object.byteLength != other.byteLength) || + !equalFunc(new Uint8Array(object), new Uint8Array(other))) { + return false; + } + return true; + + case boolTag: + case dateTag: + case numberTag: + // Coerce booleans to `1` or `0` and dates to milliseconds. + // Invalid dates are coerced to `NaN`. + return eq(+object, +other); + + case errorTag: + return object.name == other.name && object.message == other.message; + + case regexpTag: + case stringTag: + // Coerce regexes to strings and treat strings, primitives and objects, + // as equal. See http://www.ecma-international.org/ecma-262/7.0/#sec-regexp.prototype.tostring + // for more details. + return object == (other + ''); + + case mapTag: + var convert = mapToArray; + + case setTag: + var isPartial = bitmask & COMPARE_PARTIAL_FLAG; + convert || (convert = setToArray); + + if (object.size != other.size && !isPartial) { + return false; + } + // Assume cyclic values are equal. + var stacked = stack.get(object); + if (stacked) { + return stacked == other; + } + bitmask |= COMPARE_UNORDERED_FLAG; + + // Recursively compare objects (susceptible to call stack limits). + stack.set(object, other); + var result = equalArrays(convert(object), convert(other), bitmask, customizer, equalFunc, stack); + stack['delete'](object); + return result; + + case symbolTag: + if (symbolValueOf) { + return symbolValueOf.call(object) == symbolValueOf.call(other); + } + } + return false; +} + +/** + * A specialized version of `baseIsEqualDeep` for objects with support for + * partial deep comparisons. + * + * @private + * @param {Object} object The object to compare. + * @param {Object} other The other object to compare. + * @param {number} bitmask The bitmask flags. See `baseIsEqual` for more details. + * @param {Function} customizer The function to customize comparisons. + * @param {Function} equalFunc The function to determine equivalents of values. + * @param {Object} stack Tracks traversed `object` and `other` objects. + * @returns {boolean} Returns `true` if the objects are equivalent, else `false`. + */ +function equalObjects(object, other, bitmask, customizer, equalFunc, stack) { + var isPartial = bitmask & COMPARE_PARTIAL_FLAG, + objProps = getAllKeys(object), + objLength = objProps.length, + othProps = getAllKeys(other), + othLength = othProps.length; + + if (objLength != othLength && !isPartial) { + return false; + } + var index = objLength; + while (index--) { + var key = objProps[index]; + if (!(isPartial ? key in other : hasOwnProperty.call(other, key))) { + return false; + } + } + // Assume cyclic values are equal. + var stacked = stack.get(object); + if (stacked && stack.get(other)) { + return stacked == other; + } + var result = true; + stack.set(object, other); + stack.set(other, object); + + var skipCtor = isPartial; + while (++index < objLength) { + key = objProps[index]; + var objValue = object[key], + othValue = other[key]; + + if (customizer) { + var compared = isPartial + ? customizer(othValue, objValue, key, other, object, stack) + : customizer(objValue, othValue, key, object, other, stack); + } + // Recursively compare objects (susceptible to call stack limits). + if (!(compared === undefined + ? (objValue === othValue || equalFunc(objValue, othValue, bitmask, customizer, stack)) + : compared + )) { + result = false; + break; + } + skipCtor || (skipCtor = key == 'constructor'); + } + if (result && !skipCtor) { + var objCtor = object.constructor, + othCtor = other.constructor; + + // Non `Object` object instances with different constructors are not equal. + if (objCtor != othCtor && + ('constructor' in object && 'constructor' in other) && + !(typeof objCtor == 'function' && objCtor instanceof objCtor && + typeof othCtor == 'function' && othCtor instanceof othCtor)) { + result = false; + } + } + stack['delete'](object); + stack['delete'](other); + return result; +} + +/** + * Creates an array of own enumerable property names and symbols of `object`. + * + * @private + * @param {Object} object The object to query. + * @returns {Array} Returns the array of property names and symbols. + */ +function getAllKeys(object) { + return baseGetAllKeys(object, keys, getSymbols); +} + +/** + * Gets the data for `map`. + * + * @private + * @param {Object} map The map to query. + * @param {string} key The reference key. + * @returns {*} Returns the map data. + */ +function getMapData(map, key) { + var data = map.__data__; + return isKeyable(key) + ? data[typeof key == 'string' ? 'string' : 'hash'] + : data.map; +} + +/** + * Gets the native function at `key` of `object`. + * + * @private + * @param {Object} object The object to query. + * @param {string} key The key of the method to get. + * @returns {*} Returns the function if it's native, else `undefined`. + */ +function getNative(object, key) { + var value = getValue(object, key); + return baseIsNative(value) ? value : undefined; +} + +/** + * A specialized version of `baseGetTag` which ignores `Symbol.toStringTag` values. + * + * @private + * @param {*} value The value to query. + * @returns {string} Returns the raw `toStringTag`. + */ +function getRawTag(value) { + var isOwn = hasOwnProperty.call(value, symToStringTag), + tag = value[symToStringTag]; + + try { + value[symToStringTag] = undefined; + var unmasked = true; + } catch (e) {} + + var result = nativeObjectToString.call(value); + if (unmasked) { + if (isOwn) { + value[symToStringTag] = tag; + } else { + delete value[symToStringTag]; + } + } + return result; +} + +/** + * Creates an array of the own enumerable symbols of `object`. + * + * @private + * @param {Object} object The object to query. + * @returns {Array} Returns the array of symbols. + */ +var getSymbols = !nativeGetSymbols ? stubArray : function(object) { + if (object == null) { + return []; + } + object = Object(object); + return arrayFilter(nativeGetSymbols(object), function(symbol) { + return propertyIsEnumerable.call(object, symbol); + }); +}; + +/** + * Gets the `toStringTag` of `value`. + * + * @private + * @param {*} value The value to query. + * @returns {string} Returns the `toStringTag`. + */ +var getTag = baseGetTag; + +// Fallback for data views, maps, sets, and weak maps in IE 11 and promises in Node.js < 6. +if ((DataView && getTag(new DataView(new ArrayBuffer(1))) != dataViewTag) || + (Map && getTag(new Map) != mapTag) || + (Promise && getTag(Promise.resolve()) != promiseTag) || + (Set && getTag(new Set) != setTag) || + (WeakMap && getTag(new WeakMap) != weakMapTag)) { + getTag = function(value) { + var result = baseGetTag(value), + Ctor = result == objectTag ? value.constructor : undefined, + ctorString = Ctor ? toSource(Ctor) : ''; + + if (ctorString) { + switch (ctorString) { + case dataViewCtorString: return dataViewTag; + case mapCtorString: return mapTag; + case promiseCtorString: return promiseTag; + case setCtorString: return setTag; + case weakMapCtorString: return weakMapTag; + } + } + return result; + }; +} + +/** + * Checks if `value` is a valid array-like index. + * + * @private + * @param {*} value The value to check. + * @param {number} [length=MAX_SAFE_INTEGER] The upper bounds of a valid index. + * @returns {boolean} Returns `true` if `value` is a valid index, else `false`. + */ +function isIndex(value, length) { + length = length == null ? MAX_SAFE_INTEGER : length; + return !!length && + (typeof value == 'number' || reIsUint.test(value)) && + (value > -1 && value % 1 == 0 && value < length); +} + +/** + * Checks if `value` is suitable for use as unique object key. + * + * @private + * @param {*} value The value to check. + * @returns {boolean} Returns `true` if `value` is suitable, else `false`. + */ +function isKeyable(value) { + var type = typeof value; + return (type == 'string' || type == 'number' || type == 'symbol' || type == 'boolean') + ? (value !== '__proto__') + : (value === null); +} + +/** + * Checks if `func` has its source masked. + * + * @private + * @param {Function} func The function to check. + * @returns {boolean} Returns `true` if `func` is masked, else `false`. + */ +function isMasked(func) { + return !!maskSrcKey && (maskSrcKey in func); +} + +/** + * Checks if `value` is likely a prototype object. + * + * @private + * @param {*} value The value to check. + * @returns {boolean} Returns `true` if `value` is a prototype, else `false`. + */ +function isPrototype(value) { + var Ctor = value && value.constructor, + proto = (typeof Ctor == 'function' && Ctor.prototype) || objectProto; + + return value === proto; +} + +/** + * Converts `value` to a string using `Object.prototype.toString`. + * + * @private + * @param {*} value The value to convert. + * @returns {string} Returns the converted string. + */ +function objectToString(value) { + return nativeObjectToString.call(value); +} + +/** + * Converts `func` to its source code. + * + * @private + * @param {Function} func The function to convert. + * @returns {string} Returns the source code. + */ +function toSource(func) { + if (func != null) { + try { + return funcToString.call(func); + } catch (e) {} + try { + return (func + ''); + } catch (e) {} + } + return ''; +} + +/** + * Performs a + * [`SameValueZero`](http://ecma-international.org/ecma-262/7.0/#sec-samevaluezero) + * comparison between two values to determine if they are equivalent. + * + * @static + * @memberOf _ + * @since 4.0.0 + * @category Lang + * @param {*} value The value to compare. + * @param {*} other The other value to compare. + * @returns {boolean} Returns `true` if the values are equivalent, else `false`. + * @example + * + * var object = { 'a': 1 }; + * var other = { 'a': 1 }; + * + * _.eq(object, object); + * // => true + * + * _.eq(object, other); + * // => false + * + * _.eq('a', 'a'); + * // => true + * + * _.eq('a', Object('a')); + * // => false + * + * _.eq(NaN, NaN); + * // => true + */ +function eq(value, other) { + return value === other || (value !== value && other !== other); +} + +/** + * Checks if `value` is likely an `arguments` object. + * + * @static + * @memberOf _ + * @since 0.1.0 + * @category Lang + * @param {*} value The value to check. + * @returns {boolean} Returns `true` if `value` is an `arguments` object, + * else `false`. + * @example + * + * _.isArguments(function() { return arguments; }()); + * // => true + * + * _.isArguments([1, 2, 3]); + * // => false + */ +var isArguments = baseIsArguments(function() { return arguments; }()) ? baseIsArguments : function(value) { + return isObjectLike(value) && hasOwnProperty.call(value, 'callee') && + !propertyIsEnumerable.call(value, 'callee'); +}; + +/** + * Checks if `value` is classified as an `Array` object. + * + * @static + * @memberOf _ + * @since 0.1.0 + * @category Lang + * @param {*} value The value to check. + * @returns {boolean} Returns `true` if `value` is an array, else `false`. + * @example + * + * _.isArray([1, 2, 3]); + * // => true + * + * _.isArray(document.body.children); + * // => false + * + * _.isArray('abc'); + * // => false + * + * _.isArray(_.noop); + * // => false + */ +var isArray = Array.isArray; + +/** + * Checks if `value` is array-like. A value is considered array-like if it's + * not a function and has a `value.length` that's an integer greater than or + * equal to `0` and less than or equal to `Number.MAX_SAFE_INTEGER`. + * + * @static + * @memberOf _ + * @since 4.0.0 + * @category Lang + * @param {*} value The value to check. + * @returns {boolean} Returns `true` if `value` is array-like, else `false`. + * @example + * + * _.isArrayLike([1, 2, 3]); + * // => true + * + * _.isArrayLike(document.body.children); + * // => true + * + * _.isArrayLike('abc'); + * // => true + * + * _.isArrayLike(_.noop); + * // => false + */ +function isArrayLike(value) { + return value != null && isLength(value.length) && !isFunction(value); +} + +/** + * Checks if `value` is a buffer. + * + * @static + * @memberOf _ + * @since 4.3.0 + * @category Lang + * @param {*} value The value to check. + * @returns {boolean} Returns `true` if `value` is a buffer, else `false`. + * @example + * + * _.isBuffer(new Buffer(2)); + * // => true + * + * _.isBuffer(new Uint8Array(2)); + * // => false + */ +var isBuffer = nativeIsBuffer || stubFalse; + +/** + * Performs a deep comparison between two values to determine if they are + * equivalent. + * + * **Note:** This method supports comparing arrays, array buffers, booleans, + * date objects, error objects, maps, numbers, `Object` objects, regexes, + * sets, strings, symbols, and typed arrays. `Object` objects are compared + * by their own, not inherited, enumerable properties. Functions and DOM + * nodes are compared by strict equality, i.e. `===`. + * + * @static + * @memberOf _ + * @since 0.1.0 + * @category Lang + * @param {*} value The value to compare. + * @param {*} other The other value to compare. + * @returns {boolean} Returns `true` if the values are equivalent, else `false`. + * @example + * + * var object = { 'a': 1 }; + * var other = { 'a': 1 }; + * + * _.isEqual(object, other); + * // => true + * + * object === other; + * // => false + */ +function isEqual(value, other) { + return baseIsEqual(value, other); +} + +/** + * Checks if `value` is classified as a `Function` object. + * + * @static + * @memberOf _ + * @since 0.1.0 + * @category Lang + * @param {*} value The value to check. + * @returns {boolean} Returns `true` if `value` is a function, else `false`. + * @example + * + * _.isFunction(_); + * // => true + * + * _.isFunction(/abc/); + * // => false + */ +function isFunction(value) { + if (!isObject(value)) { + return false; + } + // The use of `Object#toString` avoids issues with the `typeof` operator + // in Safari 9 which returns 'object' for typed arrays and other constructors. + var tag = baseGetTag(value); + return tag == funcTag || tag == genTag || tag == asyncTag || tag == proxyTag; +} + +/** + * Checks if `value` is a valid array-like length. + * + * **Note:** This method is loosely based on + * [`ToLength`](http://ecma-international.org/ecma-262/7.0/#sec-tolength). + * + * @static + * @memberOf _ + * @since 4.0.0 + * @category Lang + * @param {*} value The value to check. + * @returns {boolean} Returns `true` if `value` is a valid length, else `false`. + * @example + * + * _.isLength(3); + * // => true + * + * _.isLength(Number.MIN_VALUE); + * // => false + * + * _.isLength(Infinity); + * // => false + * + * _.isLength('3'); + * // => false + */ +function isLength(value) { + return typeof value == 'number' && + value > -1 && value % 1 == 0 && value <= MAX_SAFE_INTEGER; +} + +/** + * Checks if `value` is the + * [language type](http://www.ecma-international.org/ecma-262/7.0/#sec-ecmascript-language-types) + * of `Object`. (e.g. arrays, functions, objects, regexes, `new Number(0)`, and `new String('')`) + * + * @static + * @memberOf _ + * @since 0.1.0 + * @category Lang + * @param {*} value The value to check. + * @returns {boolean} Returns `true` if `value` is an object, else `false`. + * @example + * + * _.isObject({}); + * // => true + * + * _.isObject([1, 2, 3]); + * // => true + * + * _.isObject(_.noop); + * // => true + * + * _.isObject(null); + * // => false + */ +function isObject(value) { + var type = typeof value; + return value != null && (type == 'object' || type == 'function'); +} + +/** + * Checks if `value` is object-like. A value is object-like if it's not `null` + * and has a `typeof` result of "object". + * + * @static + * @memberOf _ + * @since 4.0.0 + * @category Lang + * @param {*} value The value to check. + * @returns {boolean} Returns `true` if `value` is object-like, else `false`. + * @example + * + * _.isObjectLike({}); + * // => true + * + * _.isObjectLike([1, 2, 3]); + * // => true + * + * _.isObjectLike(_.noop); + * // => false + * + * _.isObjectLike(null); + * // => false + */ +function isObjectLike(value) { + return value != null && typeof value == 'object'; +} + +/** + * Checks if `value` is classified as a typed array. + * + * @static + * @memberOf _ + * @since 3.0.0 + * @category Lang + * @param {*} value The value to check. + * @returns {boolean} Returns `true` if `value` is a typed array, else `false`. + * @example + * + * _.isTypedArray(new Uint8Array); + * // => true + * + * _.isTypedArray([]); + * // => false + */ +var isTypedArray = nodeIsTypedArray ? baseUnary(nodeIsTypedArray) : baseIsTypedArray; + +/** + * Creates an array of the own enumerable property names of `object`. + * + * **Note:** Non-object values are coerced to objects. See the + * [ES spec](http://ecma-international.org/ecma-262/7.0/#sec-object.keys) + * for more details. + * + * @static + * @since 0.1.0 + * @memberOf _ + * @category Object + * @param {Object} object The object to query. + * @returns {Array} Returns the array of property names. + * @example + * + * function Foo() { + * this.a = 1; + * this.b = 2; + * } + * + * Foo.prototype.c = 3; + * + * _.keys(new Foo); + * // => ['a', 'b'] (iteration order is not guaranteed) + * + * _.keys('hi'); + * // => ['0', '1'] + */ +function keys(object) { + return isArrayLike(object) ? arrayLikeKeys(object) : baseKeys(object); +} + +/** + * This method returns a new empty array. + * + * @static + * @memberOf _ + * @since 4.13.0 + * @category Util + * @returns {Array} Returns the new empty array. + * @example + * + * var arrays = _.times(2, _.stubArray); + * + * console.log(arrays); + * // => [[], []] + * + * console.log(arrays[0] === arrays[1]); + * // => false + */ +function stubArray() { + return []; +} + +/** + * This method returns `false`. + * + * @static + * @memberOf _ + * @since 4.13.0 + * @category Util + * @returns {boolean} Returns `false`. + * @example + * + * _.times(2, _.stubFalse); + * // => [false, false] + */ +function stubFalse() { + return false; +} + +module.exports = isEqual; +}); + +var baseMerged = createCommonjsModule(function (module, exports) { +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); + + + + + + +class BaseMergedExtractor { + constructor(config, options) { + this.config = config; + this.options = options; + } + extract(source, refDate) { + if (!refDate) + refDate = new Date(); + let referenceDate = refDate; + let result = new Array(); + this.addTo(result, this.config.dateExtractor.extract(source, referenceDate), source); + this.addTo(result, this.config.timeExtractor.extract(source, referenceDate), source); + this.addTo(result, this.config.durationExtractor.extract(source, referenceDate), source); + this.addTo(result, this.config.datePeriodExtractor.extract(source, referenceDate), source); + this.addTo(result, this.config.dateTimeExtractor.extract(source, referenceDate), source); + this.addTo(result, this.config.timePeriodExtractor.extract(source, referenceDate), source); + this.addTo(result, this.config.dateTimePeriodExtractor.extract(source, referenceDate), source); + this.addTo(result, this.config.setExtractor.extract(source, referenceDate), source); + this.addTo(result, this.config.holidayExtractor.extract(source, referenceDate), source); + // this should be at the end since if need the extractor to determine the previous text contains time or not + this.addTo(result, this.numberEndingRegexMatch(source, result), source); + this.addMod(result, source); + // filtering + if ((this.options & dateTimeRecognizer.DateTimeOptions.Calendar) !== 0) { + this.checkCalendarFilterList(result, source); + } + result = result.sort((a, b) => a.start - b.start); + return result; + } + checkCalendarFilterList(ers, text) { + for (let er of ers.reverse()) { + for (let negRegex of this.config.filterWordRegexList) { + let match = recognizersTextNumber.RegExpUtility.getMatches(negRegex, er.text).pop(); + if (match) { + ers.splice(ers.indexOf(er)); + } + } + } + } + // handle cases like "move 3pm appointment to 4" + numberEndingRegexMatch(text, extractResults) { + let tokens = new Array(); + extractResults.forEach(extractResult => { + if (extractResult.type === constants$2.Constants.SYS_DATETIME_TIME + || extractResult.type === constants$2.Constants.SYS_DATETIME_DATETIME) { + let stringAfter = text.substring(extractResult.start + extractResult.length); + let match = recognizersTextNumber.RegExpUtility.getMatches(this.config.numberEndingPattern, stringAfter); + if (match != null && match.length) { + let newTime = match[0].groups("newTime"); + let numRes = this.config.integerExtractor.extract(newTime.value); + if (numRes.length === 0) { + return; + } + let startPosition = extractResult.start + extractResult.length + newTime.index; + tokens.push(new utilities$2.Token(startPosition, startPosition + newTime.length)); + } + } + }); + return utilities$2.Token.mergeAllTokens(tokens, text, constants$2.Constants.SYS_DATETIME_TIME); + } + addTo(destination, source, text) { + source.forEach(value => { + if (this.options === dateTimeRecognizer.DateTimeOptions.SkipFromToMerge && this.shouldSkipFromMerge(value)) + return; + let isFound = false; + let overlapIndexes = new Array(); + let firstIndex = -1; + destination.forEach((dest, index) => { + if (recognizersText.ExtractResult.isOverlap(dest, value)) { + isFound = true; + if (recognizersText.ExtractResult.isCover(dest, value)) { + if (firstIndex === -1) { + firstIndex = index; + } + overlapIndexes.push(index); + } + else { + return; + } + } + }); + if (!isFound) { + destination.push(value); + } + else if (overlapIndexes.length) { + let tempDst = new Array(); + for (let i = 0; i < destination.length; i++) { + if (overlapIndexes.indexOf(i) === -1) { + tempDst.push(destination[i]); + } + } + // insert at the first overlap occurrence to keep the order + tempDst.splice(firstIndex, 0, value); + destination.length = 0; + destination.push.apply(destination, tempDst); + } + }); + } + shouldSkipFromMerge(er) { + return recognizersTextNumber.RegExpUtility.getMatches(this.config.fromToRegex, er.text).length > 0; + } + filterAmbiguousSingleWord(er, text) { + let matches = recognizersTextNumber.RegExpUtility.getMatches(this.config.singleAmbiguousMonthRegex, er.text.toLowerCase()); + if (matches.length) { + let stringBefore = text.substring(0, er.start).replace(/\s+$/, ''); + matches = recognizersTextNumber.RegExpUtility.getMatches(this.config.prepositionSuffixRegex, stringBefore); + if (!matches.length) { + return true; + } + } + return false; + } + addMod(ers, source) { + let lastEnd = 0; + ers.forEach(er => { + let beforeStr = source.substr(lastEnd, er.start).toLowerCase(); + let before = this.hasTokenIndex(beforeStr.trim(), this.config.beforeRegex); + if (before.matched) { + let modLength = beforeStr.length - before.index; + er.length += modLength; + er.start -= modLength; + er.text = source.substr(er.start, er.length); + } + let after = this.hasTokenIndex(beforeStr.trim(), this.config.afterRegex); + if (after.matched) { + let modLength = beforeStr.length - after.index; + er.length += modLength; + er.start -= modLength; + er.text = source.substr(er.start, er.length); + } + let since = this.hasTokenIndex(beforeStr.trim(), this.config.sinceRegex); + if (since.matched) { + let modLength = beforeStr.length - since.index; + er.length += modLength; + er.start -= modLength; + er.text = source.substr(er.start, er.length); + } + }); + } + hasTokenIndex(source, regex) { + let result = { matched: false, index: -1 }; + let match = recognizersTextNumber.RegExpUtility.getMatches(regex, source).pop(); + if (match) { + result.matched = true; + result.index = match.index; + } + return result; + } +} +exports.BaseMergedExtractor = BaseMergedExtractor; +class BaseMergedParser { + constructor(config, options) { + this.parserTypeName = 'datetimeV2'; + this.dateMinValue = utilities$2.FormatUtil.formatDate(utilities$2.DateUtils.minValue()); + this.dateTimeMinValue = utilities$2.FormatUtil.formatDateTime(utilities$2.DateUtils.minValue()); + this.config = config; + this.options = options; + } + parse(er, refTime) { + let referenceTime = refTime || new Date(); + let pr = null; + // push, save teh MOD string + let hasBefore = false; + let hasAfter = false; + let hasSince = false; + let modStr = ""; + let beforeMatch = recognizersTextNumber.RegExpUtility.getMatches(this.config.beforeRegex, er.text).shift(); + let afterMatch = recognizersTextNumber.RegExpUtility.getMatches(this.config.afterRegex, er.text).shift(); + let sinceMatch = recognizersTextNumber.RegExpUtility.getMatches(this.config.sinceRegex, er.text).shift(); + if (beforeMatch && beforeMatch.index === 0) { + hasBefore = true; + er.start += beforeMatch.length; + er.length -= beforeMatch.length; + er.text = er.text.substring(beforeMatch.length); + modStr = beforeMatch.value; + } + else if (afterMatch && afterMatch.index === 0) { + hasAfter = true; + er.start += afterMatch.length; + er.length -= afterMatch.length; + er.text = er.text.substring(afterMatch.length); + modStr = afterMatch.value; + } + else if (sinceMatch && sinceMatch.index === 0) { + hasSince = true; + er.start += sinceMatch.length; + er.length -= sinceMatch.length; + er.text = er.text.substring(sinceMatch.length); + modStr = sinceMatch.value; + } + if (er.type === constants$2.Constants.SYS_DATETIME_DATE) { + pr = this.config.dateParser.parse(er, referenceTime); + if (pr.value === null || pr.value === undefined) { + pr = this.config.holidayParser.parse(er, referenceTime); + } + } + else if (er.type === constants$2.Constants.SYS_DATETIME_TIME) { + pr = this.config.timeParser.parse(er, referenceTime); + } + else if (er.type === constants$2.Constants.SYS_DATETIME_DATETIME) { + pr = this.config.dateTimeParser.parse(er, referenceTime); + } + else if (er.type === constants$2.Constants.SYS_DATETIME_DATEPERIOD) { + pr = this.config.datePeriodParser.parse(er, referenceTime); + } + else if (er.type === constants$2.Constants.SYS_DATETIME_TIMEPERIOD) { + pr = this.config.timePeriodParser.parse(er, referenceTime); + } + else if (er.type === constants$2.Constants.SYS_DATETIME_DATETIMEPERIOD) { + pr = this.config.dateTimePeriodParser.parse(er, referenceTime); + } + else if (er.type === constants$2.Constants.SYS_DATETIME_DURATION) { + pr = this.config.durationParser.parse(er, referenceTime); + } + else if (er.type === constants$2.Constants.SYS_DATETIME_SET) { + pr = this.config.setParser.parse(er, referenceTime); + } + else { + return null; + } + // pop, restore the MOD string + if (hasBefore && pr.value !== null) { + pr.length += modStr.length; + pr.start -= modStr.length; + pr.text = modStr + pr.text; + let val = pr.value; + val.mod = constants$2.TimeTypeConstants.beforeMod; + pr.value = val; + } + if (hasAfter && pr.value !== null) { + pr.length += modStr.length; + pr.start -= modStr.length; + pr.text = modStr + pr.text; + let val = pr.value; + val.mod = constants$2.TimeTypeConstants.afterMod; + pr.value = val; + } + if (hasSince && pr.value !== null) { + pr.length += modStr.length; + pr.start -= modStr.length; + pr.text = modStr + pr.text; + let val = pr.value; + val.mod = constants$2.TimeTypeConstants.sinceMod; + pr.value = val; + } + if ((this.options & dateTimeRecognizer.DateTimeOptions.SplitDateAndTime) === dateTimeRecognizer.DateTimeOptions.SplitDateAndTime + && pr.value && pr.value.subDateTimeEntities != null) { + pr.value = this.dateTimeResolutionForSplit(pr); + } + else { + pr = this.setParseResult(pr, hasBefore, hasAfter, hasSince); + } + return pr; + } + setParseResult(slot, hasBefore, hasAfter, hasSince) { + slot.value = this.dateTimeResolution(slot, hasBefore, hasAfter, hasSince); + // change the type at last for the after or before mode + slot.type = `${this.parserTypeName}.${this.determineDateTimeType(slot.type, hasBefore, hasAfter, hasSince)}`; + return slot; + } + getParseResult(extractorResult, referenceDate) { + let extractorType = extractorResult.type; + if (extractorType === constants$2.Constants.SYS_DATETIME_DATE) { + let pr = this.config.dateParser.parse(extractorResult, referenceDate); + if (!pr || !pr.value) + return this.config.holidayParser.parse(extractorResult, referenceDate); + return pr; + } + if (extractorType === constants$2.Constants.SYS_DATETIME_TIME) { + return this.config.timeParser.parse(extractorResult, referenceDate); + } + if (extractorType === constants$2.Constants.SYS_DATETIME_DATETIME) { + return this.config.dateTimeParser.parse(extractorResult, referenceDate); + } + if (extractorType === constants$2.Constants.SYS_DATETIME_DATEPERIOD) { + return this.config.datePeriodParser.parse(extractorResult, referenceDate); + } + if (extractorType === constants$2.Constants.SYS_DATETIME_TIMEPERIOD) { + return this.config.timePeriodParser.parse(extractorResult, referenceDate); + } + if (extractorType === constants$2.Constants.SYS_DATETIME_DATETIMEPERIOD) { + return this.config.dateTimePeriodParser.parse(extractorResult, referenceDate); + } + if (extractorType === constants$2.Constants.SYS_DATETIME_DURATION) { + return this.config.durationParser.parse(extractorResult, referenceDate); + } + if (extractorType === constants$2.Constants.SYS_DATETIME_SET) { + return this.config.setParser.parse(extractorResult, referenceDate); + } + return null; + } + determineDateTimeType(type, hasBefore, hasAfter, hasSince) { + if ((this.options & dateTimeRecognizer.DateTimeOptions.SplitDateAndTime) === dateTimeRecognizer.DateTimeOptions.SplitDateAndTime) { + if (type === constants$2.Constants.SYS_DATETIME_DATETIME) { + return constants$2.Constants.SYS_DATETIME_TIME; + } + } + else { + if (hasBefore || hasAfter || hasSince) { + if (type === constants$2.Constants.SYS_DATETIME_DATE) + return constants$2.Constants.SYS_DATETIME_DATEPERIOD; + if (type === constants$2.Constants.SYS_DATETIME_TIME) + return constants$2.Constants.SYS_DATETIME_TIMEPERIOD; + if (type === constants$2.Constants.SYS_DATETIME_DATETIME) + return constants$2.Constants.SYS_DATETIME_DATETIMEPERIOD; + } + } + return type; + } + dateTimeResolutionForSplit(slot) { + let results = new Array(); + if (slot.value.subDateTimeEntities != null) { + let subEntities = slot.value.subDateTimeEntities; + for (let subEntity of subEntities) { + let result = subEntity; + results.push(...this.dateTimeResolutionForSplit(result)); + } + } + else { + slot.value = this.dateTimeResolution(slot, false, false, false); + slot.type = `${this.parserTypeName}.${this.determineDateTimeType(slot.type, false, false, false)}`; + results.push(slot); + } + return results; + } + dateTimeResolution(slot, hasBefore, hasAfter, hasSince) { + if (!slot) + return null; + let result = new Map(); + let resolutions = new Array(); + let type = slot.type; + let outputType = this.determineDateTimeType(type, hasBefore, hasAfter, hasSince); + let timex = slot.timexStr; + let value = slot.value; + if (!value) + return null; + let isLunar = value.isLunar; + let mod = value.mod; + let comment = value.comment; + // the following should added to res first since the ResolveAmPm is using these fields + this.addResolutionFieldsAny(result, constants$2.Constants.TimexKey, timex); + this.addResolutionFieldsAny(result, constants$2.Constants.CommentKey, comment); + this.addResolutionFieldsAny(result, constants$2.Constants.ModKey, mod); + this.addResolutionFieldsAny(result, constants$2.Constants.TypeKey, outputType); + this.addResolutionFieldsAny(result, constants$2.Constants.IsLunarKey, isLunar ? String(isLunar) : ""); + let futureResolution = value.futureResolution; + let pastResolution = value.pastResolution; + let future = this.generateFromResolution(type, futureResolution, mod); + let past = this.generateFromResolution(type, pastResolution, mod); + let futureValues = Array.from(this.getValues(future)).sort(); + let pastValues = Array.from(this.getValues(past)).sort(); + if (lodash_isequal(futureValues, pastValues)) { + if (pastValues.length > 0) + this.addResolutionFieldsAny(result, constants$2.Constants.ResolveKey, past); + } + else { + if (pastValues.length > 0) + this.addResolutionFieldsAny(result, constants$2.Constants.ResolveToPastKey, past); + if (futureValues.length > 0) + this.addResolutionFieldsAny(result, constants$2.Constants.ResolveToFutureKey, future); + } + if (comment && comment === 'ampm') { + if (result.has('resolve')) { + this.resolveAMPM(result, 'resolve'); + } + else { + this.resolveAMPM(result, 'resolveToPast'); + this.resolveAMPM(result, 'resolveToFuture'); + } + } + result.forEach((value, key) => { + if (this.isObject(value)) { + // is "StringMap" + let newValues = {}; + this.addResolutionFields(newValues, constants$2.Constants.TimexKey, timex); + this.addResolutionFields(newValues, constants$2.Constants.ModKey, mod); + this.addResolutionFields(newValues, constants$2.Constants.TypeKey, outputType); + this.addResolutionFields(newValues, constants$2.Constants.IsLunarKey, isLunar ? String(isLunar) : ""); + Object.keys(value).forEach((innerKey) => { + newValues[innerKey] = value[innerKey]; + }); + resolutions.push(newValues); + } + }); + if (Object.keys(past).length === 0 && Object.keys(future).length === 0) { + let o = {}; + o['timex'] = timex; + o['type'] = outputType; + o['value'] = 'not resolved'; + resolutions.push(o); + } + return { + values: resolutions + }; + } + isObject(o) { + return (!!o) && (o.constructor === Object); + } + addResolutionFieldsAny(dic, key, value) { + if (value instanceof String) { + if (!recognizersTextNumber.StringUtility.isNullOrEmpty(value)) { + dic.set(key, value); + } + } + else { + dic.set(key, value); + } + } + addResolutionFields(dic, key, value) { + if (!recognizersTextNumber.StringUtility.isNullOrEmpty(value)) { + dic[key] = value; + } + } + generateFromResolution(type, resolutions, mod) { + let result = {}; + switch (type) { + case constants$2.Constants.SYS_DATETIME_DATETIME: + this.addSingleDateTimeToResolution(resolutions, constants$2.TimeTypeConstants.DATETIME, mod, result); + break; + case constants$2.Constants.SYS_DATETIME_TIME: + this.addSingleDateTimeToResolution(resolutions, constants$2.TimeTypeConstants.TIME, mod, result); + break; + case constants$2.Constants.SYS_DATETIME_DATE: + this.addSingleDateTimeToResolution(resolutions, constants$2.TimeTypeConstants.DATE, mod, result); + break; + case constants$2.Constants.SYS_DATETIME_DURATION: + if (resolutions.hasOwnProperty(constants$2.TimeTypeConstants.DURATION)) { + result[constants$2.TimeTypeConstants.VALUE] = resolutions[constants$2.TimeTypeConstants.DURATION]; + } + break; + case constants$2.Constants.SYS_DATETIME_TIMEPERIOD: + this.addPeriodToResolution(resolutions, constants$2.TimeTypeConstants.START_TIME, constants$2.TimeTypeConstants.END_TIME, mod, result); + break; + case constants$2.Constants.SYS_DATETIME_DATEPERIOD: + this.addPeriodToResolution(resolutions, constants$2.TimeTypeConstants.START_DATE, constants$2.TimeTypeConstants.END_DATE, mod, result); + break; + case constants$2.Constants.SYS_DATETIME_DATETIMEPERIOD: + this.addPeriodToResolution(resolutions, constants$2.TimeTypeConstants.START_DATETIME, constants$2.TimeTypeConstants.END_DATETIME, mod, result); + break; + } + return result; + } + addSingleDateTimeToResolution(resolutions, type, mod, result) { + let key = constants$2.TimeTypeConstants.VALUE; + let value = resolutions[type]; + if (!value || this.dateMinValue === value || this.dateTimeMinValue === value) + return; + if (!recognizersTextNumber.StringUtility.isNullOrEmpty(mod)) { + if (mod === constants$2.TimeTypeConstants.beforeMod) { + key = constants$2.TimeTypeConstants.END; + } + else if (mod === constants$2.TimeTypeConstants.afterMod) { + key = constants$2.TimeTypeConstants.START; + } + else if (mod === constants$2.TimeTypeConstants.sinceMod) { + key = constants$2.TimeTypeConstants.START; + } + } + result[key] = value; + } + addPeriodToResolution(resolutions, startType, endType, mod, result) { + let start = resolutions[startType]; + let end = resolutions[endType]; + if (!recognizersTextNumber.StringUtility.isNullOrEmpty(mod)) { + // For the 'before' mod + // 1. Cases like "Before December", the start of the period should be the end of the new period, not the start + // 2. Cases like "More than 3 days before today", the date point should be the end of the new period + if (mod === constants$2.TimeTypeConstants.beforeMod) { + if (!recognizersTextNumber.StringUtility.isNullOrEmpty(start) && !recognizersTextNumber.StringUtility.isNullOrEmpty(end)) { + result[constants$2.TimeTypeConstants.END] = start; + } + else { + result[constants$2.TimeTypeConstants.END] = end; + } + return; + } + // For the 'after' mod + // 1. Cases like "After January". the end of the period should be the start of the new period, not the end + // 2. Cases like "More than 3 days after today", the date point should be the start of the new period + if (mod === constants$2.TimeTypeConstants.afterMod) { + // For cases like "After January" or "After 2018" + // The "end" of the period is not inclusive by default ("January", the end should be "XXXX-02-01" / "2018", the end should be "2019-01-01") + // Mod "after" is also not inclusive the "start" ("After January", the start should be "XXXX-01-31" / "After 2018", the start should be "2017-12-31") + // So here the START day should be the inclusive end of the period, which is one day previous to the default end (exclusive end) + if (!recognizersTextNumber.StringUtility.isNullOrEmpty(start) && !recognizersTextNumber.StringUtility.isNullOrEmpty(end)) { + var dateObj = new Date(end); + dateObj.setDate(dateObj.getDate() - 1); + result[constants$2.TimeTypeConstants.START] = utilities$2.FormatUtil.formatDate(dateObj); + } + else { + result[constants$2.TimeTypeConstants.START] = start; + } + return; + } + if (mod === constants$2.TimeTypeConstants.sinceMod) { + result[constants$2.TimeTypeConstants.START] = start; + return; + } + } + if (recognizersTextNumber.StringUtility.isNullOrEmpty(start) || recognizersTextNumber.StringUtility.isNullOrEmpty(end)) + return; + result[constants$2.TimeTypeConstants.START] = start; + result[constants$2.TimeTypeConstants.END] = end; + } + getValues(obj) { + return Object.keys(obj).map(key => obj[key]); + } + resolveAMPM(valuesMap, keyName) { + if (!valuesMap.has(keyName)) + return; + let resolution = valuesMap.get(keyName); + if (!valuesMap.has('timex')) + return; + let timex = valuesMap.get('timex'); + valuesMap.delete(keyName); + valuesMap.set(keyName + 'Am', resolution); + let resolutionPm = {}; + switch (valuesMap.get('type')) { + case constants$2.Constants.SYS_DATETIME_TIME: + resolutionPm[constants$2.TimeTypeConstants.VALUE] = utilities$2.FormatUtil.toPm(resolution[constants$2.TimeTypeConstants.VALUE]); + resolutionPm['timex'] = utilities$2.FormatUtil.toPm(timex); + break; + case constants$2.Constants.SYS_DATETIME_DATETIME: + let splitValue = resolution[constants$2.TimeTypeConstants.VALUE].split(' '); + resolutionPm[constants$2.TimeTypeConstants.VALUE] = `${splitValue[0]} ${utilities$2.FormatUtil.toPm(splitValue[1])}`; + resolutionPm['timex'] = utilities$2.FormatUtil.allStringToPm(timex); + break; + case constants$2.Constants.SYS_DATETIME_TIMEPERIOD: + if (resolution.hasOwnProperty(constants$2.TimeTypeConstants.START)) + resolutionPm[constants$2.TimeTypeConstants.START] = utilities$2.FormatUtil.toPm(resolution[constants$2.TimeTypeConstants.START]); + if (resolution.hasOwnProperty(constants$2.TimeTypeConstants.END)) + resolutionPm[constants$2.TimeTypeConstants.END] = utilities$2.FormatUtil.toPm(resolution[constants$2.TimeTypeConstants.END]); + resolutionPm['timex'] = utilities$2.FormatUtil.allStringToPm(timex); + break; + case constants$2.Constants.SYS_DATETIME_DATETIMEPERIOD: + if (resolution.hasOwnProperty(constants$2.TimeTypeConstants.START)) { + let splitValue = resolution[constants$2.TimeTypeConstants.START].split(' '); + resolutionPm[constants$2.TimeTypeConstants.START] = `${splitValue[0]} ${utilities$2.FormatUtil.toPm(splitValue[1])}`; + } + if (resolution.hasOwnProperty(constants$2.TimeTypeConstants.END)) { + let splitValue = resolution[constants$2.TimeTypeConstants.END].split(' '); + resolutionPm[constants$2.TimeTypeConstants.END] = `${splitValue[0]} ${utilities$2.FormatUtil.toPm(splitValue[1])}`; + } + resolutionPm['timex'] = utilities$2.FormatUtil.allStringToPm(timex); + break; + } + valuesMap.set(keyName + 'Pm', resolutionPm); + } +} +exports.BaseMergedParser = BaseMergedParser; + +}); + +unwrapExports(baseMerged); + +var englishDateTime = createCommonjsModule(function (module, exports) { +"use strict"; +// ------------------------------------------------------------------------------ +// +// This code was generated by a tool. +// Changes to this file may cause incorrect behavior and will be lost if +// the code is regenerated. +// +// ------------------------------------------------------------------------------ +Object.defineProperty(exports, "__esModule", { value: true }); + +var EnglishDateTime; +(function (EnglishDateTime) { + EnglishDateTime.TillRegex = `(?\\b(to|till|til|until|thru|through)\\b|(--|-|—|——|~|–))`; + EnglishDateTime.RangeConnectorRegex = `(?\\b(and|through|to)\\b|(--|-|—|——|~|–))`; + EnglishDateTime.RelativeRegex = `\\b(?following|next|coming|upcoming|this|last|past|previous|current|the)\\b`; + EnglishDateTime.StrictRelativeRegex = `\\b(?following|next|coming|upcoming|this|last|past|previous|current)\\b`; + EnglishDateTime.NextPrefixRegex = `\\b(following|next|upcoming|coming)\\b`; + EnglishDateTime.AfterNextSuffixRegex = `\\b(after\\s+(the\\s+)?next)\\b`; + EnglishDateTime.PastPrefixRegex = `(last|past|previous)\\b`; + EnglishDateTime.ThisPrefixRegex = `(this|current)\\b`; + EnglishDateTime.CenturySuffixRegex = `(^century)\\b`; + EnglishDateTime.ReferencePrefixRegex = `(that|same)\\b`; + EnglishDateTime.FutureSuffixRegex = `\\b(in\\s+the\\s+)?(future|hence)\\b`; + EnglishDateTime.DayRegex = `(the\\s*)?(?01|02|03|04|05|06|07|08|09|10th|10|11th|11st|11|12nd|12th|12|13rd|13th|13|14th|14|15th|15|16th|16|17th|17|18th|18|19th|19|1st|1|20th|20|21st|21th|21|22nd|22th|22|23rd|23th|23|24th|24|25th|25|26th|26|27th|27|28th|28|29th|29|2nd|2|30th|30|31st|31|3rd|3|4th|4|5th|5|6th|6|7th|7|8th|8|9th|9)(?=\\b|t)`; + EnglishDateTime.ImplicitDayRegex = `(the\\s*)?(?10th|11th|11st|12nd|12th|13rd|13th|14th|15th|16th|17th|18th|19th|1st|20th|21st|21th|22nd|22th|23rd|23th|24th|25th|26th|27th|28th|29th|2nd|30th|31st|3rd|4th|5th|6th|7th|8th|9th)\\b`; + EnglishDateTime.MonthNumRegex = `(?01|02|03|04|05|06|07|08|09|10|11|12|1|2|3|4|5|6|7|8|9)\\b`; + EnglishDateTime.CenturyRegex = `\\b(?((one|two)\\s+thousand(\\s+and)?(\\s+(one|two|three|four|five|six|seven|eight|nine)\\s+hundred(\\s+and)?)?)|((twenty one|twenty two|one|two|three|four|five|six|seven|eight|nine|ten|eleven|twelve|thirteen|fourteen|fifteen|sixteen|seventeen|eighteen|nineteen|twenty)(\\s+hundred)?(\\s+and)?))\\b`; + EnglishDateTime.WrittenNumRegex = `(one|two|three|four|five|six|seven|eight|nine|ten|eleven|twelve|thirteen|fourteen|fifteen|sixteen|seventeen|eighteen|nineteen|twenty|thirty|forty|fourty|fifty|sixty|seventy|eighty|ninety)`; + EnglishDateTime.FullTextYearRegex = `\\b((?${EnglishDateTime.CenturyRegex})\\s+(?((zero|twenty|thirty|forty|fourty|fifty|sixty|seventy|eighty|ninety)\\s+${EnglishDateTime.WrittenNumRegex})|${EnglishDateTime.WrittenNumRegex}))\\b|\\b(?${EnglishDateTime.CenturyRegex})\\b`; + EnglishDateTime.AmDescRegex = `(am\\b|a\\.m\\.|a m\\b|a\\. m\\.|a\\.m\\b|a\\. m\\b|a m\\b)`; + EnglishDateTime.PmDescRegex = `(pm\\b|p\\.m\\.|p\\b|p m\\b|p\\. m\\.|p\\.m\\b|p\\. m\\b|p m\\b)`; + EnglishDateTime.TwoDigitYearRegex = `\\b(?([0-27-9]\\d))(?!(\\s*((\\:)|${EnglishDateTime.AmDescRegex}|${EnglishDateTime.PmDescRegex}|\\.\\d)))\\b`; + EnglishDateTime.YearRegex = `(${baseDateTime.BaseDateTime.FourDigitYearRegex}|${EnglishDateTime.FullTextYearRegex})`; + EnglishDateTime.WeekDayRegex = `\\b(?Sunday|Monday|Tuesday|Wednesday|Thursday|Friday|Saturday|Mon|Tues|Tue|Wedn|Weds|Wed|Thurs|Thur|Thu|Fri|Sat|Sun)s?\\b`; + EnglishDateTime.SingleWeekDayRegex = `\\b(?Sunday|Monday|Tuesday|Wednesday|Thursday|Friday|Saturday|Mon|Tue|Tues|Wedn|Weds|Wed|Thurs|Thur|Thu|Fri|((?<=on\\s+)(Sat|Sun)))\\b`; + EnglishDateTime.RelativeMonthRegex = `(?(of\\s+)?${EnglishDateTime.RelativeRegex}\\s+month)\\b`; + EnglishDateTime.WrittenMonthRegex = `(((the\\s+)?month of\\s+)?(?April|Apr|August|Aug|December|Dec|February|Feb|January|Jan|July|Jul|June|Jun|March|Mar|May|November|Nov|October|Oct|September|Sept|Sep))`; + EnglishDateTime.MonthSuffixRegex = `(?(in\\s+|of\\s+|on\\s+)?(${EnglishDateTime.RelativeMonthRegex}|${EnglishDateTime.WrittenMonthRegex}))`; + EnglishDateTime.DateUnitRegex = `(?decades?|years?|months?|weeks?|(?business\\s+)?days?)\\b`; + EnglishDateTime.DateTokenPrefix = 'on '; + EnglishDateTime.TimeTokenPrefix = 'at '; + EnglishDateTime.TokenBeforeDate = 'on '; + EnglishDateTime.TokenBeforeTime = 'at '; + EnglishDateTime.SimpleCasesRegex = `\\b((from|between)\\s+)?(${EnglishDateTime.DayRegex})\\s*${EnglishDateTime.TillRegex}\\s*(${EnglishDateTime.DayRegex}\\s+${EnglishDateTime.MonthSuffixRegex}|${EnglishDateTime.MonthSuffixRegex}\\s+${EnglishDateTime.DayRegex})((\\s+|\\s*,\\s*)${EnglishDateTime.YearRegex})?\\b`; + EnglishDateTime.MonthFrontSimpleCasesRegex = `\\b((from|between)\\s+)?${EnglishDateTime.MonthSuffixRegex}\\s+((from)\\s+)?(${EnglishDateTime.DayRegex})\\s*${EnglishDateTime.TillRegex}\\s*(${EnglishDateTime.DayRegex})((\\s+|\\s*,\\s*)${EnglishDateTime.YearRegex})?\\b`; + EnglishDateTime.MonthFrontBetweenRegex = `\\b${EnglishDateTime.MonthSuffixRegex}\\s+(between\\s+)(${EnglishDateTime.DayRegex})\\s*${EnglishDateTime.RangeConnectorRegex}\\s*(${EnglishDateTime.DayRegex})((\\s+|\\s*,\\s*)${EnglishDateTime.YearRegex})?\\b`; + EnglishDateTime.BetweenRegex = `\\b(between\\s+)(${EnglishDateTime.DayRegex})\\s*${EnglishDateTime.RangeConnectorRegex}\\s*(${EnglishDateTime.DayRegex})\\s+${EnglishDateTime.MonthSuffixRegex}((\\s+|\\s*,\\s*)${EnglishDateTime.YearRegex})?\\b`; + EnglishDateTime.MonthWithYear = `\\b((${EnglishDateTime.WrittenMonthRegex}(\\.)?(\\s*),?(\\s+of)?(\\s*)(${EnglishDateTime.YearRegex}|(?following|next|last|this)\\s+year))|((${EnglishDateTime.YearRegex}|(?following|next|last|this)\\s+year)(\\s*),?(\\s*)${EnglishDateTime.WrittenMonthRegex}))\\b`; + EnglishDateTime.OneWordPeriodRegex = `\\b((((the\\s+)?month of\\s+)?(${EnglishDateTime.StrictRelativeRegex}\\s+)?(?April|Apr|August|Aug|December|Dec|February|Feb|January|Jan|July|Jul|June|Jun|March|Mar|May|November|Nov|October|Oct|September|Sep|Sept))|(month|year) to date|(${EnglishDateTime.RelativeRegex}\\s+)?(my\\s+)?(weekend|week|month|year)(?!((\\s+of)?\\s+\\d+|\\s+to\\s+date))(\\s+${EnglishDateTime.AfterNextSuffixRegex})?)\\b`; + EnglishDateTime.MonthNumWithYear = `\\b((${baseDateTime.BaseDateTime.FourDigitYearRegex}(\\s*)[/\\-\\.](\\s*)${EnglishDateTime.MonthNumRegex})|(${EnglishDateTime.MonthNumRegex}(\\s*)[/\\-](\\s*)${baseDateTime.BaseDateTime.FourDigitYearRegex}))\\b`; + EnglishDateTime.WeekOfMonthRegex = `\\b(?(the\\s+)?(?first|1st|second|2nd|third|3rd|fourth|4th|fifth|5th|last)\\s+week\\s+${EnglishDateTime.MonthSuffixRegex})\\b`; + EnglishDateTime.WeekOfYearRegex = `\\b(?(the\\s+)?(?first|1st|second|2nd|third|3rd|fourth|4th|fifth|5th|last)\\s+week(\\s+of)?\\s+(${EnglishDateTime.YearRegex}|${EnglishDateTime.RelativeRegex}\\s+year))\\b`; + EnglishDateTime.FollowedDateUnit = `^\\s*${EnglishDateTime.DateUnitRegex}`; + EnglishDateTime.NumberCombinedWithDateUnit = `\\b(?\\d+(\\.\\d*)?)${EnglishDateTime.DateUnitRegex}`; + EnglishDateTime.QuarterTermRegex = `\\b(((?first|1st|second|2nd|third|3rd|fourth|4th)[ -]+quarter)|(Q(?[1-4])))\\b`; + EnglishDateTime.QuarterRegex = `(the\\s+)?${EnglishDateTime.QuarterTermRegex}((\\s+of|\\s*,\\s*)?\\s+(${EnglishDateTime.YearRegex}|${EnglishDateTime.RelativeRegex}\\s+year))?`; + EnglishDateTime.QuarterRegexYearFront = `(${EnglishDateTime.YearRegex}|${EnglishDateTime.RelativeRegex}\\s+year)('s)?\\s+(the\\s+)?${EnglishDateTime.QuarterTermRegex}`; + EnglishDateTime.HalfYearTermRegex = `(?first|1st|second|2nd)\\s+half`; + EnglishDateTime.HalfYearFrontRegex = `(?((1[5-9]|20)\\d{2})|2100)\\s*(the\\s+)?H(?[1-2])`; + EnglishDateTime.HalfYearBackRegex = `(the\\s+)?(H(?[1-2])|(${EnglishDateTime.HalfYearTermRegex}))(\\s+of|\\s*,\\s*)?\\s+(${EnglishDateTime.YearRegex})`; + EnglishDateTime.HalfYearRelativeRegex = `(the\\s+)?${EnglishDateTime.HalfYearTermRegex}(\\s+of|\\s*,\\s*)?\\s+(${EnglishDateTime.RelativeRegex}\\s+year)`; + EnglishDateTime.AllHalfYearRegex = `(${EnglishDateTime.HalfYearFrontRegex})|(${EnglishDateTime.HalfYearBackRegex})|(${EnglishDateTime.HalfYearRelativeRegex})`; + EnglishDateTime.EarlyPrefixRegex = `\\b(?early|beginning of|start of|(?earlier(\\s+in)?))\\b`; + EnglishDateTime.MidPrefixRegex = `\\b(?mid-?|middle of)\\b`; + EnglishDateTime.LaterPrefixRegex = `\\b(?late|end of|(?later(\\s+in)?))\\b`; + EnglishDateTime.PrefixPeriodRegex = `(${EnglishDateTime.EarlyPrefixRegex}|${EnglishDateTime.MidPrefixRegex}|${EnglishDateTime.LaterPrefixRegex})`; + EnglishDateTime.PrefixDayRegex = `\\b((?early)|(?mid|middle)|(?late|later))(\\s+in)?(\\s+the\\s+day)?$`; + EnglishDateTime.SeasonDescRegex = `(?spring|summer|fall|autumn|winter)`; + EnglishDateTime.SeasonRegex = `\\b(?(${EnglishDateTime.PrefixPeriodRegex}\\s+)?(${EnglishDateTime.RelativeRegex}\\s+)?${EnglishDateTime.SeasonDescRegex}((\\s+of|\\s*,\\s*)?\\s+(${EnglishDateTime.YearRegex}|${EnglishDateTime.RelativeRegex}\\s+year))?)\\b`; + EnglishDateTime.WhichWeekRegex = `(week)(\\s*)(?\\d\\d|\\d|0\\d)`; + EnglishDateTime.WeekOfRegex = `(the\\s+)?(week)(\\s+of)(\\s+the)?`; + EnglishDateTime.MonthOfRegex = `(month)(\\s*)(of)`; + EnglishDateTime.MonthRegex = `(?April|Apr|August|Aug|December|Dec|February|Feb|January|Jan|July|Jul|June|Jun|March|Mar|May|November|Nov|October|Oct|September|Sept|Sep)`; + EnglishDateTime.AmbiguousMonthP0Regex = `\\b((^may i)|(i|you|he|she|we|they)\\s+may|(may\\s+((((also|not|(also not)|well)\\s+)?(be|contain|constitute|email|e-mail|take|have|result|involve|get|work|reply))|(or may not))))\\b`; + EnglishDateTime.DateYearRegex = `(?${baseDateTime.BaseDateTime.FourDigitYearRegex}|${EnglishDateTime.TwoDigitYearRegex})`; + EnglishDateTime.YearSuffix = `(,?\\s*(${EnglishDateTime.DateYearRegex}|${EnglishDateTime.FullTextYearRegex}))`; + EnglishDateTime.OnRegex = `(?<=\\bon\\s+)(${EnglishDateTime.DayRegex}s?)\\b`; + EnglishDateTime.RelaxedOnRegex = `(?<=\\b(on|at|in)\\s+)((?10th|11th|11st|12nd|12th|13rd|13th|14th|15th|16th|17th|18th|19th|1st|20th|21st|21th|22nd|22th|23rd|23th|24th|25th|26th|27th|28th|29th|2nd|30th|31st|3rd|4th|5th|6th|7th|8th|9th)s?)\\b`; + EnglishDateTime.ThisRegex = `\\b((this(\\s*week)?(\\s*on)?\\s+)${EnglishDateTime.WeekDayRegex})|(${EnglishDateTime.WeekDayRegex}((\\s+of)?\\s+this\\s*week))\\b`; + EnglishDateTime.LastDateRegex = `\\b(${EnglishDateTime.PastPrefixRegex}(\\s*week)?\\s+${EnglishDateTime.WeekDayRegex})|(${EnglishDateTime.WeekDayRegex}(\\s+last\\s*week))\\b`; + EnglishDateTime.NextDateRegex = `\\b(${EnglishDateTime.NextPrefixRegex}(\\s*week(\\s*,?\\s*on)?)?\\s+${EnglishDateTime.WeekDayRegex})|((on\\s+)?${EnglishDateTime.WeekDayRegex}((\\s+of)?\\s+(the\\s+following|(the\\s+)?next)\\s*week))\\b`; + EnglishDateTime.SpecialDayRegex = `\\b((the\\s+)?day before yesterday|(the\\s+)?day after (tomorrow|tmr)|((the\\s+)?(${EnglishDateTime.RelativeRegex}|my)\\s+day)|yesterday|tomorrow|tmr|today)\\b`; + EnglishDateTime.SpecialDayWithNumRegex = `\\b((?${EnglishDateTime.WrittenNumRegex})\\s+days?\\s+from\\s+(?yesterday|tomorrow|tmr|today))\\b`; + EnglishDateTime.RelativeDayRegex = `\\b(((the\\s+)?${EnglishDateTime.RelativeRegex}\\s+day))\\b`; + EnglishDateTime.SetWeekDayRegex = `\\b(?on\\s+)?(?morning|afternoon|evening|night|Sunday|Monday|Tuesday|Wednesday|Thursday|Friday|Saturday)s\\b`; + EnglishDateTime.WeekDayOfMonthRegex = `(?(the\\s+)?(?first|1st|second|2nd|third|3rd|fourth|4th|fifth|5th|last)\\s+${EnglishDateTime.WeekDayRegex}\\s+${EnglishDateTime.MonthSuffixRegex})`; + EnglishDateTime.RelativeWeekDayRegex = `\\b(${EnglishDateTime.WrittenNumRegex}\\s+${EnglishDateTime.WeekDayRegex}\\s+(from\\s+now|later))\\b`; + EnglishDateTime.SpecialDate = `(?=\\b(on|at)\\s+the\\s+)${EnglishDateTime.DayRegex}\\b`; + EnglishDateTime.DatePreposition = `\\b(on|in)`; + EnglishDateTime.DateExtractor1 = `\\b((this\\s+)?${EnglishDateTime.WeekDayRegex}\\s*[,-]?\\s*)?((${EnglishDateTime.MonthRegex}(\\.)?\\s*[/\\\\.,-]?\\s*${EnglishDateTime.DayRegex})|(\\(${EnglishDateTime.MonthRegex}\\s*[-.]\\s*${EnglishDateTime.DayRegex}\\)))(\\s*\\(\\s*${EnglishDateTime.WeekDayRegex}\\s*\\))?`; + EnglishDateTime.DateExtractor2 = `\\b${EnglishDateTime.DateExtractor1}(\\s+|\\s*,\\s*|\\s+of\\s+)${EnglishDateTime.DateYearRegex}\\b`; + EnglishDateTime.DateExtractor3 = `\\b(${EnglishDateTime.WeekDayRegex}(\\s+|\\s*,\\s*))?${EnglishDateTime.DayRegex}(\\.)?(\\s+|\\s*,\\s*|\\s+of\\s+|\\s*-\\s*)${EnglishDateTime.MonthRegex}(\\.)?((\\s+|\\s*,\\s*)${EnglishDateTime.DateYearRegex})?\\b`; + EnglishDateTime.DateExtractor4 = `\\b${EnglishDateTime.MonthNumRegex}\\s*[/\\\\\\-]\\s*${EnglishDateTime.DayRegex}(\\.)?\\s*[/\\\\\\-]\\s*${EnglishDateTime.DateYearRegex}`; + EnglishDateTime.DateExtractor5 = `\\b${EnglishDateTime.DayRegex}\\s*[/\\\\\\-\\.]\\s*${EnglishDateTime.MonthNumRegex}\\s*[/\\\\\\-\\.]\\s*${EnglishDateTime.DateYearRegex}`; + EnglishDateTime.DateExtractor6 = `(?<=${EnglishDateTime.DatePreposition}\\s+)(${EnglishDateTime.WeekDayRegex}\\s+)?${EnglishDateTime.MonthNumRegex}[\\-\\.]${EnglishDateTime.DayRegex}(?![%])\\b`; + EnglishDateTime.DateExtractor7 = `\\b(${EnglishDateTime.WeekDayRegex}\\s+)?${EnglishDateTime.MonthNumRegex}\\s*/\\s*${EnglishDateTime.DayRegex}((\\s+|\\s*,\\s*|\\s+of\\s+)${EnglishDateTime.DateYearRegex})?(?![%])\\b`; + EnglishDateTime.DateExtractor8 = `(?<=${EnglishDateTime.DatePreposition}\\s+)(${EnglishDateTime.WeekDayRegex}\\s+)?${EnglishDateTime.DayRegex}[\\\\\\-]${EnglishDateTime.MonthNumRegex}(?![%])\\b`; + EnglishDateTime.DateExtractor9 = `\\b(${EnglishDateTime.WeekDayRegex}\\s+)?${EnglishDateTime.DayRegex}\\s*/\\s*${EnglishDateTime.MonthNumRegex}((\\s+|\\s*,\\s*|\\s+of\\s+)${EnglishDateTime.DateYearRegex})?(?![%])\\b`; + EnglishDateTime.DateExtractorA = `\\b(${EnglishDateTime.WeekDayRegex}\\s+)?${EnglishDateTime.DateYearRegex}\\s*[/\\\\\\-\\.]\\s*${EnglishDateTime.MonthNumRegex}\\s*[/\\\\\\-\\.]\\s*${EnglishDateTime.DayRegex}`; + EnglishDateTime.OfMonth = `^\\s*of\\s*${EnglishDateTime.MonthRegex}`; + EnglishDateTime.MonthEnd = `${EnglishDateTime.MonthRegex}\\s*(the)?\\s*$`; + EnglishDateTime.WeekDayEnd = `(this\\s+)?${EnglishDateTime.WeekDayRegex}\\s*,?\\s*$`; + EnglishDateTime.RangeUnitRegex = `\\b(?years|year|months|month|weeks|week)\\b`; + EnglishDateTime.OclockRegex = `(?o\\s*’\\s*clock|o\\s*‘\\s*clock|o\\s*'\\s*clock|o\\s*clock)`; + EnglishDateTime.DescRegex = `(((${EnglishDateTime.OclockRegex}\\s+)?(?ampm|am\\b|a\\.m\\.|a m\\b|a\\. m\\.|a\\.m\\b|a\\. m\\b|a m\\b|pm\\b|p\\.m\\.|p m\\b|p\\. m\\.|p\\.m\\b|p\\. m\\b|p\\b|p m\\b))|${EnglishDateTime.OclockRegex})`; + EnglishDateTime.HourNumRegex = `\\b(?zero|one|two|three|four|five|six|seven|eight|nine|ten|eleven|twelve)\\b`; + EnglishDateTime.MinuteNumRegex = `(?one|two|three|four|five|six|seven|eight|nine|ten|eleven|twelve|thirteen|fourteen|fifteen|sixteen|seventeen|eighteen|nineteen|twenty|thirty|forty|fifty)`; + EnglishDateTime.DeltaMinuteNumRegex = `(?one|two|three|four|five|six|seven|eight|nine|ten|eleven|twelve|thirteen|fourteen|fifteen|sixteen|seventeen|eighteen|nineteen|twenty|thirty|forty|fifty)`; + EnglishDateTime.PmRegex = `(?(((at|in|around|on|for)\\s+(the\\s+)?)?(afternoon|evening|midnight|lunchtime))|((at|in|around|on|for)\\s+(the\\s+)?night))`; + EnglishDateTime.PmRegexFull = `(?((at|in|around|on|for)\\s+(the\\s+)?)?(afternoon|evening|midnight|night|lunchtime))`; + EnglishDateTime.AmRegex = `(?((at|in|around|on|for)\\s+(the\\s+)?)?(morning))`; + EnglishDateTime.LunchRegex = `\\b(lunchtime)\\b`; + EnglishDateTime.NightRegex = `\\b(midnight|night)\\b`; + EnglishDateTime.CommonDatePrefixRegex = `^[\\.]`; + EnglishDateTime.LessThanOneHour = `(?(a\\s+)?quarter|three quarter(s)?|half( an hour)?|${baseDateTime.BaseDateTime.DeltaMinuteRegex}(\\s+(minute|minutes|min|mins))|${EnglishDateTime.DeltaMinuteNumRegex}(\\s+(minute|minutes|min|mins)))`; + EnglishDateTime.WrittenTimeRegex = `(?${EnglishDateTime.HourNumRegex}\\s+(${EnglishDateTime.MinuteNumRegex}|(?twenty|thirty|forty|fourty|fifty)\\s+${EnglishDateTime.MinuteNumRegex}))`; + EnglishDateTime.TimePrefix = `(?(${EnglishDateTime.LessThanOneHour} past|${EnglishDateTime.LessThanOneHour} to))`; + EnglishDateTime.TimeSuffix = `(?${EnglishDateTime.AmRegex}|${EnglishDateTime.PmRegex}|${EnglishDateTime.OclockRegex})`; + EnglishDateTime.TimeSuffixFull = `(?${EnglishDateTime.AmRegex}|${EnglishDateTime.PmRegexFull}|${EnglishDateTime.OclockRegex})`; + EnglishDateTime.BasicTime = `\\b(?${EnglishDateTime.WrittenTimeRegex}|${EnglishDateTime.HourNumRegex}|${baseDateTime.BaseDateTime.HourRegex}:${baseDateTime.BaseDateTime.MinuteRegex}(:${baseDateTime.BaseDateTime.SecondRegex})?|${baseDateTime.BaseDateTime.HourRegex})`; + EnglishDateTime.MidnightRegex = `(?midnight|mid-night|mid night)`; + EnglishDateTime.MidmorningRegex = `(?midmorning|mid-morning|mid morning)`; + EnglishDateTime.MidafternoonRegex = `(?midafternoon|mid-afternoon|mid afternoon)`; + EnglishDateTime.MiddayRegex = `(?midday|mid-day|mid day|((12\\s)?noon))`; + EnglishDateTime.MidTimeRegex = `(?(${EnglishDateTime.MidnightRegex}|${EnglishDateTime.MidmorningRegex}|${EnglishDateTime.MidafternoonRegex}|${EnglishDateTime.MiddayRegex}))`; + EnglishDateTime.AtRegex = `\\b(((?<=\\bat\\s+)(${EnglishDateTime.WrittenTimeRegex}|${EnglishDateTime.HourNumRegex}|${baseDateTime.BaseDateTime.HourRegex}(?!\\.\\d)(\\s*((?a)|(?p)))?|${EnglishDateTime.MidTimeRegex}))|${EnglishDateTime.MidTimeRegex})\\b`; + EnglishDateTime.IshRegex = `\\b(${baseDateTime.BaseDateTime.HourRegex}(-|——)?ish|noonish|noon)\\b`; + EnglishDateTime.TimeUnitRegex = `([^A-Za-z]{1,}|\\b)(?hours|hour|hrs|hr|h|minutes|minute|mins|min|seconds|second|secs|sec)\\b`; + EnglishDateTime.RestrictedTimeUnitRegex = `(?hour|minute)\\b`; + EnglishDateTime.FivesRegex = `(?(fifteen|twenty(\\s*five)?|thirty(\\s*five)?|forty(\\s*five)?|fourty(\\s*five)?|fifty(\\s*five)?|ten|five))\\b`; + EnglishDateTime.HourRegex = `\\b${baseDateTime.BaseDateTime.HourRegex}`; + EnglishDateTime.PeriodHourNumRegex = `\\b(?twenty one|twenty two|twenty three|twenty four|zero|one|two|three|four|five|six|seven|eight|nine|ten|eleven|twelve|thirteen|fourteen|fifteen|sixteen|seventeen|eighteen|nineteen|twenty)\\b`; + EnglishDateTime.ConnectNumRegex = `\\b${baseDateTime.BaseDateTime.HourRegex}(?00|01|02|03|04|05|06|07|08|09|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)\\s*${EnglishDateTime.DescRegex}`; + EnglishDateTime.TimeRegexWithDotConnector = `(${baseDateTime.BaseDateTime.HourRegex}(\\s*\\.\\s*)${baseDateTime.BaseDateTime.MinuteRegex})`; + EnglishDateTime.TimeRegex1 = `\\b(${EnglishDateTime.TimePrefix}\\s+)?(${EnglishDateTime.WrittenTimeRegex}|${EnglishDateTime.HourNumRegex}|${baseDateTime.BaseDateTime.HourRegex})\\s*${EnglishDateTime.DescRegex}`; + EnglishDateTime.TimeRegex2 = `(\\b${EnglishDateTime.TimePrefix}\\s+)?(T)?${baseDateTime.BaseDateTime.HourRegex}(\\s*)?:(\\s*)?${baseDateTime.BaseDateTime.MinuteRegex}((\\s*)?:(\\s*)?${baseDateTime.BaseDateTime.SecondRegex})?((\\s*${EnglishDateTime.DescRegex})|\\b)`; + EnglishDateTime.TimeRegex3 = `(\\b${EnglishDateTime.TimePrefix}\\s+)?${baseDateTime.BaseDateTime.HourRegex}\\.${baseDateTime.BaseDateTime.MinuteRegex}(\\s*${EnglishDateTime.DescRegex})`; + EnglishDateTime.TimeRegex4 = `\\b${EnglishDateTime.TimePrefix}\\s+${EnglishDateTime.BasicTime}(\\s*${EnglishDateTime.DescRegex})?\\s+${EnglishDateTime.TimeSuffix}\\b`; + EnglishDateTime.TimeRegex5 = `\\b${EnglishDateTime.TimePrefix}\\s+${EnglishDateTime.BasicTime}((\\s*${EnglishDateTime.DescRegex})|\\b)`; + EnglishDateTime.TimeRegex6 = `${EnglishDateTime.BasicTime}(\\s*${EnglishDateTime.DescRegex})?\\s+${EnglishDateTime.TimeSuffix}\\b`; + EnglishDateTime.TimeRegex7 = `\\b${EnglishDateTime.TimeSuffixFull}\\s+at\\s+${EnglishDateTime.BasicTime}((\\s*${EnglishDateTime.DescRegex})|\\b)`; + EnglishDateTime.TimeRegex8 = `\\b${EnglishDateTime.TimeSuffixFull}\\s+${EnglishDateTime.BasicTime}((\\s*${EnglishDateTime.DescRegex})|\\b)`; + EnglishDateTime.TimeRegex9 = `\\b${EnglishDateTime.PeriodHourNumRegex}\\s+${EnglishDateTime.FivesRegex}((\\s*${EnglishDateTime.DescRegex})|\\b)`; + EnglishDateTime.TimeRegex10 = `\\b(${EnglishDateTime.TimePrefix}\\s+)?${baseDateTime.BaseDateTime.HourRegex}(\\s*h\\s*)${baseDateTime.BaseDateTime.MinuteRegex}(\\s*${EnglishDateTime.DescRegex})?`; + EnglishDateTime.TimeRegex11 = `\\b((${EnglishDateTime.TimeTokenPrefix}${EnglishDateTime.TimeRegexWithDotConnector})(?!\\s*per\\s*cent|%)|(${EnglishDateTime.TimeRegexWithDotConnector}(\\s*${EnglishDateTime.DescRegex})))`; + EnglishDateTime.FirstTimeRegexInTimeRange = `\\b${EnglishDateTime.TimeRegexWithDotConnector}(\\s*${EnglishDateTime.DescRegex})?`; + EnglishDateTime.PureNumFromTo = `((from|between)\\s+)?(${EnglishDateTime.HourRegex}|${EnglishDateTime.PeriodHourNumRegex})(\\s*(?${EnglishDateTime.DescRegex}))?\\s*${EnglishDateTime.TillRegex}\\s*(${EnglishDateTime.HourRegex}|${EnglishDateTime.PeriodHourNumRegex})(?\\s*(${EnglishDateTime.PmRegex}|${EnglishDateTime.AmRegex}|${EnglishDateTime.DescRegex}))?`; + EnglishDateTime.PureNumBetweenAnd = `(between\\s+)(${EnglishDateTime.HourRegex}|${EnglishDateTime.PeriodHourNumRegex})(\\s*(?${EnglishDateTime.DescRegex}))?\\s*${EnglishDateTime.RangeConnectorRegex}\\s*(${EnglishDateTime.HourRegex}|${EnglishDateTime.PeriodHourNumRegex})(?\\s*(${EnglishDateTime.PmRegex}|${EnglishDateTime.AmRegex}|${EnglishDateTime.DescRegex}))?`; + EnglishDateTime.SpecificTimeFromTo = `((from|between)\\s+)?(?((${EnglishDateTime.TimeRegex2}|${EnglishDateTime.FirstTimeRegexInTimeRange})|(${EnglishDateTime.HourRegex}|${EnglishDateTime.PeriodHourNumRegex})(\\s*(?${EnglishDateTime.DescRegex}))?))\\s*${EnglishDateTime.TillRegex}\\s*(?((${EnglishDateTime.TimeRegex2}|${EnglishDateTime.TimeRegexWithDotConnector}(?\\s*${EnglishDateTime.DescRegex}))|(${EnglishDateTime.HourRegex}|${EnglishDateTime.PeriodHourNumRegex})(\\s*(?${EnglishDateTime.DescRegex}))?))`; + EnglishDateTime.SpecificTimeBetweenAnd = `(between\\s+)(?((${EnglishDateTime.TimeRegex2}|${EnglishDateTime.FirstTimeRegexInTimeRange})|(${EnglishDateTime.HourRegex}|${EnglishDateTime.PeriodHourNumRegex})(\\s*(?${EnglishDateTime.DescRegex}))?))\\s*${EnglishDateTime.RangeConnectorRegex}\\s*(?((${EnglishDateTime.TimeRegex2}|${EnglishDateTime.TimeRegexWithDotConnector}(?\\s*${EnglishDateTime.DescRegex}))|(${EnglishDateTime.HourRegex}|${EnglishDateTime.PeriodHourNumRegex})(\\s*(?${EnglishDateTime.DescRegex}))?))`; + EnglishDateTime.PrepositionRegex = `(?^(at|on|of)(\\s+the)?$)`; + EnglishDateTime.TimeOfDayRegex = `\\b(?((((in\\s+(the)?\\s+)?((?early(\\s+|-))|(?late(\\s+|-)))?(morning|afternoon|night|evening)))|(((in\\s+(the)?\\s+)?)(daytime|business\\s+hour)))s?)\\b`; + EnglishDateTime.SpecificTimeOfDayRegex = `\\b((${EnglishDateTime.StrictRelativeRegex}\\s+${EnglishDateTime.TimeOfDayRegex})\\b|\\btonight)s?\\b`; + EnglishDateTime.TimeFollowedUnit = `^\\s*${EnglishDateTime.TimeUnitRegex}`; + EnglishDateTime.TimeNumberCombinedWithUnit = `\\b(?\\d+(\\.\\d*)?)${EnglishDateTime.TimeUnitRegex}`; + EnglishDateTime.BusinessHourSplitStrings = ['business', 'hour']; + EnglishDateTime.NowRegex = `\\b(?(right\\s+)?now|as soon as possible|asap|recently|previously)\\b`; + EnglishDateTime.SuffixRegex = `^\\s*(in the\\s+)?(morning|afternoon|evening|night)\\b`; + EnglishDateTime.DateTimeTimeOfDayRegex = `\\b(?morning|afternoon|night|evening)\\b`; + EnglishDateTime.DateTimeSpecificTimeOfDayRegex = `\\b((${EnglishDateTime.RelativeRegex}\\s+${EnglishDateTime.DateTimeTimeOfDayRegex})\\b|\\btonight)\\b`; + EnglishDateTime.TimeOfTodayAfterRegex = `^\\s*(,\\s*)?(in\\s+)?${EnglishDateTime.DateTimeSpecificTimeOfDayRegex}`; + EnglishDateTime.TimeOfTodayBeforeRegex = `${EnglishDateTime.DateTimeSpecificTimeOfDayRegex}(\\s*,)?(\\s+(at|around|in|on))?\\s*$`; + EnglishDateTime.SimpleTimeOfTodayAfterRegex = `(${EnglishDateTime.HourNumRegex}|${baseDateTime.BaseDateTime.HourRegex})\\s*(,\\s*)?(in\\s+)?${EnglishDateTime.DateTimeSpecificTimeOfDayRegex}`; + EnglishDateTime.SimpleTimeOfTodayBeforeRegex = `\\b${EnglishDateTime.DateTimeSpecificTimeOfDayRegex}(\\s*,)?(\\s+(at|around))?\\s*(${EnglishDateTime.HourNumRegex}|${baseDateTime.BaseDateTime.HourRegex})\\b`; + EnglishDateTime.TheEndOfRegex = `(the\\s+)?end of(\\s+the)?\\s*$`; + EnglishDateTime.PeriodTimeOfDayRegex = `\\b((in\\s+(the)?\\s+)?((?early(\\s+|-))|(?late(\\s+|-)))?(?morning|afternoon|night|evening))\\b`; + EnglishDateTime.PeriodSpecificTimeOfDayRegex = `\\b((${EnglishDateTime.StrictRelativeRegex}\\s+${EnglishDateTime.PeriodTimeOfDayRegex})\\b|\\btonight)\\b`; + EnglishDateTime.PeriodTimeOfDayWithDateRegex = `\\b((${EnglishDateTime.TimeOfDayRegex}(\\s+(on|of))?))\\b`; + EnglishDateTime.LessThanRegex = `\\b(less\\s+than)\\b`; + EnglishDateTime.MoreThanRegex = `\\b(more\\s+than)\\b`; + EnglishDateTime.DurationUnitRegex = `(?${EnglishDateTime.DateUnitRegex}|hours?|hrs?|h|minutes?|mins?|seconds?|secs?)\\b`; + EnglishDateTime.SuffixAndRegex = `(?\\s*(and)\\s+((an|a)\\s+)?(?half|quarter))`; + EnglishDateTime.PeriodicRegex = `\\b(?daily|monthly|weekly|biweekly|yearly|annually|annual)\\b`; + EnglishDateTime.EachUnitRegex = `(?(each|every)(?\\s+other)?\\s*${EnglishDateTime.DurationUnitRegex})`; + EnglishDateTime.EachPrefixRegex = `\\b(?(each|(every))\\s*$)`; + EnglishDateTime.SetEachRegex = `\\b(?(each|(every))\\s*)`; + EnglishDateTime.SetLastRegex = `(?following|next|upcoming|this|last|past|previous|current)`; + EnglishDateTime.EachDayRegex = `^\\s*(each|every)\\s*day\\b`; + EnglishDateTime.DurationFollowedUnit = `^\\s*${EnglishDateTime.SuffixAndRegex}?(\\s+|-)?${EnglishDateTime.DurationUnitRegex}`; + EnglishDateTime.NumberCombinedWithDurationUnit = `\\b(?\\d+(\\.\\d*)?)(-)?${EnglishDateTime.DurationUnitRegex}`; + EnglishDateTime.AnUnitRegex = `\\b((?half\\s+)?(an|a)|another)\\s+${EnglishDateTime.DurationUnitRegex}`; + EnglishDateTime.DuringRegex = `\\b(for|during)\\s+the\\s+(?year|month|week|day)\\b`; + EnglishDateTime.AllRegex = `\\b(?(all|full|whole)(\\s+|-)(?year|month|week|day))\\b`; + EnglishDateTime.HalfRegex = `(((a|an)\\s*)|\\b)(?half\\s+(?year|month|week|day|hour))\\b`; + EnglishDateTime.ConjunctionRegex = `\\b((and(\\s+for)?)|with)\\b`; + EnglishDateTime.HolidayRegex1 = `\\b(?clean monday|good friday|ash wednesday|mardi gras|washington's birthday|mao's birthday|chinese new Year|new years' eve|new year's eve|new year 's eve|new years eve|new year eve|new years'|new year's|new year 's|new years|new year|may\\s*day|yuan dan|april fools|christmas eve|christmas|xmas|thanksgiving|halloween|yuandan|easter)(\\s+(of\\s+)?(${EnglishDateTime.YearRegex}|${EnglishDateTime.RelativeRegex}\\s+year))?\\b`; + EnglishDateTime.HolidayRegex2 = `\\b(?all saint's|tree planting day|white lover|st patrick|st george|cinco de mayo|us independence|all hallow|all souls|guy fawkes)(\\s+(of\\s+)?(${EnglishDateTime.YearRegex}|${EnglishDateTime.RelativeRegex}\\s+year))?\\b`; + EnglishDateTime.HolidayRegex3 = `(?(independence|mlk|martin luther king|martin luther king jr|canberra|easter|columbus|thanks\\s*giving|christmas|xmas|labour|(international|int'l)\\s+workers'?|mother's|mother|mothers|father's|father|fathers|female|single|teacher's|youth|children|arbor|girls|chsmilbuild|lover|labor|inauguration|groundhog|valentine's|baptiste|bastille|halloween|veterans|memorial|mid(-| )autumn|moon|spring|lantern|qingming|dragon boat|new years'|new year's|new year 's|new years|new year)\\s+(day))(\\s+(of\\s+)?(${EnglishDateTime.YearRegex}|${EnglishDateTime.RelativeRegex}\\s+year))?`; + EnglishDateTime.AMTimeRegex = `(?morning)`; + EnglishDateTime.PMTimeRegex = `\\b(?afternoon|evening|night)\\b`; + EnglishDateTime.InclusiveModPrepositions = `(?((on|in|at)\\s+or\\s+)|(\\s+or\\s+(on|in|at)))`; + EnglishDateTime.BeforeRegex = `(\\b${EnglishDateTime.InclusiveModPrepositions}?(before|in\\s+advance\\s+of|prior\\s+to|(no\\s+later|earlier|sooner)\\s+than|ending\\s+(with|on)|by|till|til|until|(?as\\s+late\\s+as))${EnglishDateTime.InclusiveModPrepositions}?\\b\\s*)|(?)((?<=)|<)`; + EnglishDateTime.AfterRegex = `(\\b${EnglishDateTime.InclusiveModPrepositions}?((after|(?>=)|>)`; + EnglishDateTime.SinceRegex = `(\\b(since|after\\s+or\\s+equal\\s+to|starting\\s+(from|on|with)|as\\s+early\\s+as|any\\s+time\\s+from)\\b\\s*)|(?=)`; + EnglishDateTime.AroundRegex = `(\\b(around|circa)\\s*\\b)`; + EnglishDateTime.AgoRegex = `\\b(ago|before\\s+(?yesterday|today))\\b`; + EnglishDateTime.LaterRegex = `\\b(later|from now|(from|after) (?tomorrow|tmr|today))\\b`; + EnglishDateTime.InConnectorRegex = `\\b(in)\\b`; + EnglishDateTime.WithinNextPrefixRegex = `\\b(within(\\s+the)?(\\s+(?${EnglishDateTime.NextPrefixRegex}))?)\\b`; + EnglishDateTime.AmPmDescRegex = `(ampm)`; + EnglishDateTime.MorningStartEndRegex = `(^(morning|${EnglishDateTime.AmDescRegex}))|((morning|${EnglishDateTime.AmDescRegex})$)`; + EnglishDateTime.AfternoonStartEndRegex = `(^(afternoon|${EnglishDateTime.PmDescRegex}))|((afternoon|${EnglishDateTime.PmDescRegex})$)`; + EnglishDateTime.EveningStartEndRegex = `(^(evening))|((evening)$)`; + EnglishDateTime.NightStartEndRegex = `(^(overnight|tonight|night))|((overnight|tonight|night)$)`; + EnglishDateTime.InexactNumberRegex = `\\b(a few|few|some|several|(?(a\\s+)?couple(\\s+of)?))\\b`; + EnglishDateTime.InexactNumberUnitRegex = `(${EnglishDateTime.InexactNumberRegex})\\s+(${EnglishDateTime.DurationUnitRegex})`; + EnglishDateTime.RelativeTimeUnitRegex = `(((${EnglishDateTime.NextPrefixRegex}|${EnglishDateTime.PastPrefixRegex}|${EnglishDateTime.ThisPrefixRegex})\\s+(${EnglishDateTime.TimeUnitRegex}))|((the|my))\\s+(${EnglishDateTime.RestrictedTimeUnitRegex}))`; + EnglishDateTime.RelativeDurationUnitRegex = `(((?<=(${EnglishDateTime.NextPrefixRegex}|${EnglishDateTime.PastPrefixRegex}|${EnglishDateTime.ThisPrefixRegex})\\s+)(${EnglishDateTime.DurationUnitRegex}))|((the|my))\\s+(${EnglishDateTime.RestrictedTimeUnitRegex}))`; + EnglishDateTime.ReferenceDatePeriodRegex = `\\b${EnglishDateTime.ReferencePrefixRegex}\\s+(?week|month|year|decade|weekend)\\b`; + EnglishDateTime.ConnectorRegex = `^(-|,|for|t|around|@)$`; + EnglishDateTime.FromToRegex = `\\b(from).+(to)\\b.+`; + EnglishDateTime.SingleAmbiguousMonthRegex = `^(the\\s+)?(may|march)$`; + EnglishDateTime.SingleAmbiguousTermsRegex = `^(the\\s+)?(day|week|month|year)$`; + EnglishDateTime.UnspecificDatePeriodRegex = `^(week|weekend|month|year)$`; + EnglishDateTime.PrepositionSuffixRegex = `\\b(on|in|at|around|from|to)$`; + EnglishDateTime.FlexibleDayRegex = `(?([A-Za-z]+\\s)?[A-Za-z\\d]+)`; + EnglishDateTime.ForTheRegex = `\\b((((?<=for\\s+)the\\s+${EnglishDateTime.FlexibleDayRegex})|((?<=on\\s+)(the\\s+)?${EnglishDateTime.FlexibleDayRegex}(?<=(st|nd|rd|th))))(?\\s*(,|\\.|!|\\?|$)))`; + EnglishDateTime.WeekDayAndDayOfMonthRegex = `\\b${EnglishDateTime.WeekDayRegex}\\s+(the\\s+${EnglishDateTime.FlexibleDayRegex})\\b`; + EnglishDateTime.RestOfDateRegex = `\\bRest\\s+(of\\s+)?((the|my|this|current)\\s+)?(?week|month|year|decade)\\b`; + EnglishDateTime.RestOfDateTimeRegex = `\\bRest\\s+(of\\s+)?((the|my|this|current)\\s+)?(?day)\\b`; + EnglishDateTime.MealTimeRegex = `\\b(at\\s+)?(?lunchtime)\\b`; + EnglishDateTime.NumberEndingPattern = `^(\\s+(?meeting|appointment|conference|call|skype call)\\s+to\\s+(?${EnglishDateTime.PeriodHourNumRegex}|${EnglishDateTime.HourRegex})((\\.)?$|(\\.,|,|!|\\?)))`; + EnglishDateTime.OneOnOneRegex = `\\b(1\\s*:\\s*1)|(one (on )?one|one\\s*-\\s*one|one\\s*:\\s*one)\\b`; + EnglishDateTime.LaterEarlyPeriodRegex = `\\b(${EnglishDateTime.PrefixPeriodRegex})\\s*\\b\\s*(?${EnglishDateTime.OneWordPeriodRegex})\\b`; + EnglishDateTime.WeekWithWeekDayRangeRegex = `\\b((?(${EnglishDateTime.NextPrefixRegex}|${EnglishDateTime.PastPrefixRegex}|this)\\s+week)((\\s+between\\s+${EnglishDateTime.WeekDayRegex}\\s+and\\s+${EnglishDateTime.WeekDayRegex})|(\\s+from\\s+${EnglishDateTime.WeekDayRegex}\\s+to\\s+${EnglishDateTime.WeekDayRegex})))\\b`; + EnglishDateTime.GeneralEndingRegex = `^\\s*((\\.,)|\\.|,|!|\\?)?\\s*$`; + EnglishDateTime.MiddlePauseRegex = `\\s*(,)\\s*`; + EnglishDateTime.DurationConnectorRegex = `^\\s*(?\\s+|and|,)\\s*$`; + EnglishDateTime.PrefixArticleRegex = `\\bthe\\s+`; + EnglishDateTime.OrRegex = `\\s*((\\b|,\\s*)(or|and)\\b|,)\\s*`; + EnglishDateTime.YearPlusNumberRegex = `\\b(Year\\s+((?(\\d{3,4}))|${EnglishDateTime.FullTextYearRegex}))\\b`; + EnglishDateTime.NumberAsTimeRegex = `\\b(${EnglishDateTime.WrittenTimeRegex}|${EnglishDateTime.PeriodHourNumRegex}|${baseDateTime.BaseDateTime.HourRegex})\\b`; + EnglishDateTime.TimeBeforeAfterRegex = `\\b(((?<=\\b(before|no later than|by|after)\\s+)(${EnglishDateTime.WrittenTimeRegex}|${EnglishDateTime.HourNumRegex}|${baseDateTime.BaseDateTime.HourRegex}|${EnglishDateTime.MidTimeRegex}))|${EnglishDateTime.MidTimeRegex})\\b`; + EnglishDateTime.DateNumberConnectorRegex = `^\\s*(?\\s+at)\\s*$`; + EnglishDateTime.DecadeRegex = `(?noughties|twenties|thirties|forties|fifties|sixties|seventies|eighties|nineties|two thousands)`; + EnglishDateTime.DecadeWithCenturyRegex = `(the\\s+)?(((?\\d|1\\d|2\\d)?(')?(?\\d0)(')?s)|((${EnglishDateTime.CenturyRegex}(\\s+|-)(and\\s+)?)?${EnglishDateTime.DecadeRegex})|(${EnglishDateTime.CenturyRegex}(\\s+|-)(and\\s+)?(?tens|hundreds)))`; + EnglishDateTime.RelativeDecadeRegex = `\\b((the\\s+)?${EnglishDateTime.RelativeRegex}\\s+((?[\\w,]+)\\s+)?decades?)\\b`; + EnglishDateTime.DateAfterRegex = `\\b((or|and)\\s+(above|after|later|greater)(?!\\s+than))\\b`; + EnglishDateTime.YearPeriodRegex = `((((from|during|in)\\s+)?${EnglishDateTime.YearRegex}\\s*(${EnglishDateTime.TillRegex})\\s*${EnglishDateTime.YearRegex})|(((between)\\s+)${EnglishDateTime.YearRegex}\\s*(${EnglishDateTime.RangeConnectorRegex})\\s*${EnglishDateTime.YearRegex}))`; + EnglishDateTime.ComplexDatePeriodRegex = `(((from|during|in)\\s+)?(?.+)\\s*(${EnglishDateTime.TillRegex})\\s*(?.+)|((between)\\s+)(?.+)\\s*(${EnglishDateTime.RangeConnectorRegex})\\s*(?.+))`; + EnglishDateTime.UnitMap = new Map([["decades", "10Y"], ["decade", "10Y"], ["years", "Y"], ["year", "Y"], ["months", "MON"], ["month", "MON"], ["weeks", "W"], ["week", "W"], ["days", "D"], ["day", "D"], ["hours", "H"], ["hour", "H"], ["hrs", "H"], ["hr", "H"], ["h", "H"], ["minutes", "M"], ["minute", "M"], ["mins", "M"], ["min", "M"], ["seconds", "S"], ["second", "S"], ["secs", "S"], ["sec", "S"]]); + EnglishDateTime.UnitValueMap = new Map([["decades", 315360000], ["decade", 315360000], ["years", 31536000], ["year", 31536000], ["months", 2592000], ["month", 2592000], ["weeks", 604800], ["week", 604800], ["days", 86400], ["day", 86400], ["hours", 3600], ["hour", 3600], ["hrs", 3600], ["hr", 3600], ["h", 3600], ["minutes", 60], ["minute", 60], ["mins", 60], ["min", 60], ["seconds", 1], ["second", 1], ["secs", 1], ["sec", 1]]); + EnglishDateTime.SeasonMap = new Map([["spring", "SP"], ["summer", "SU"], ["fall", "FA"], ["autumn", "FA"], ["winter", "WI"]]); + EnglishDateTime.SeasonValueMap = new Map([["SP", 3], ["SU", 6], ["FA", 9], ["WI", 12]]); + EnglishDateTime.CardinalMap = new Map([["first", 1], ["1st", 1], ["second", 2], ["2nd", 2], ["third", 3], ["3rd", 3], ["fourth", 4], ["4th", 4], ["fifth", 5], ["5th", 5]]); + EnglishDateTime.DayOfWeek = new Map([["monday", 1], ["tuesday", 2], ["wednesday", 3], ["thursday", 4], ["friday", 5], ["saturday", 6], ["sunday", 0], ["mon", 1], ["tue", 2], ["tues", 2], ["wed", 3], ["wedn", 3], ["weds", 3], ["thu", 4], ["thur", 4], ["thurs", 4], ["fri", 5], ["sat", 6], ["sun", 0]]); + EnglishDateTime.MonthOfYear = new Map([["1", 1], ["2", 2], ["3", 3], ["4", 4], ["5", 5], ["6", 6], ["7", 7], ["8", 8], ["9", 9], ["10", 10], ["11", 11], ["12", 12], ["january", 1], ["february", 2], ["march", 3], ["april", 4], ["may", 5], ["june", 6], ["july", 7], ["august", 8], ["september", 9], ["october", 10], ["november", 11], ["december", 12], ["jan", 1], ["feb", 2], ["mar", 3], ["apr", 4], ["jun", 6], ["jul", 7], ["aug", 8], ["sep", 9], ["sept", 9], ["oct", 10], ["nov", 11], ["dec", 12], ["01", 1], ["02", 2], ["03", 3], ["04", 4], ["05", 5], ["06", 6], ["07", 7], ["08", 8], ["09", 9]]); + EnglishDateTime.Numbers = new Map([["zero", 0], ["one", 1], ["a", 1], ["an", 1], ["two", 2], ["three", 3], ["four", 4], ["five", 5], ["six", 6], ["seven", 7], ["eight", 8], ["nine", 9], ["ten", 10], ["eleven", 11], ["twelve", 12], ["thirteen", 13], ["fourteen", 14], ["fifteen", 15], ["sixteen", 16], ["seventeen", 17], ["eighteen", 18], ["nineteen", 19], ["twenty", 20], ["twenty one", 21], ["twenty two", 22], ["twenty three", 23], ["twenty four", 24], ["twenty five", 25], ["twenty six", 26], ["twenty seven", 27], ["twenty eight", 28], ["twenty nine", 29], ["thirty", 30], ["thirty one", 31], ["thirty two", 32], ["thirty three", 33], ["thirty four", 34], ["thirty five", 35], ["thirty six", 36], ["thirty seven", 37], ["thirty eight", 38], ["thirty nine", 39], ["forty", 40], ["forty one", 41], ["forty two", 42], ["forty three", 43], ["forty four", 44], ["forty five", 45], ["forty six", 46], ["forty seven", 47], ["forty eight", 48], ["forty nine", 49], ["fifty", 50], ["fifty one", 51], ["fifty two", 52], ["fifty three", 53], ["fifty four", 54], ["fifty five", 55], ["fifty six", 56], ["fifty seven", 57], ["fifty eight", 58], ["fifty nine", 59], ["sixty", 60], ["sixty one", 61], ["sixty two", 62], ["sixty three", 63], ["sixty four", 64], ["sixty five", 65], ["sixty six", 66], ["sixty seven", 67], ["sixty eight", 68], ["sixty nine", 69], ["seventy", 70], ["seventy one", 71], ["seventy two", 72], ["seventy three", 73], ["seventy four", 74], ["seventy five", 75], ["seventy six", 76], ["seventy seven", 77], ["seventy eight", 78], ["seventy nine", 79], ["eighty", 80], ["eighty one", 81], ["eighty two", 82], ["eighty three", 83], ["eighty four", 84], ["eighty five", 85], ["eighty six", 86], ["eighty seven", 87], ["eighty eight", 88], ["eighty nine", 89], ["ninety", 90], ["ninety one", 91], ["ninety two", 92], ["ninety three", 93], ["ninety four", 94], ["ninety five", 95], ["ninety six", 96], ["ninety seven", 97], ["ninety eight", 98], ["ninety nine", 99], ["one hundred", 100]]); + EnglishDateTime.DayOfMonth = new Map([["1st", 1], ["2nd", 2], ["3rd", 3], ["4th", 4], ["5th", 5], ["6th", 6], ["7th", 7], ["8th", 8], ["9th", 9], ["10th", 10], ["11th", 11], ["11st", 11], ["12th", 12], ["12nd", 12], ["13th", 13], ["13rd", 13], ["14th", 14], ["15th", 15], ["16th", 16], ["17th", 17], ["18th", 18], ["19th", 19], ["20th", 20], ["21st", 21], ["21th", 21], ["22nd", 22], ["22th", 22], ["23rd", 23], ["23th", 23], ["24th", 24], ["25th", 25], ["26th", 26], ["27th", 27], ["28th", 28], ["29th", 29], ["30th", 30], ["31st", 31]]); + EnglishDateTime.DoubleNumbers = new Map([["half", 0.5], ["quarter", 0.25]]); + EnglishDateTime.HolidayNames = new Map([["easterday", ["easterday", "easter"]], ["fathers", ["fatherday", "fathersday"]], ["mothers", ["motherday", "mothersday"]], ["thanksgiving", ["thanksgivingday", "thanksgiving"]], ["martinlutherking", ["mlkday", "martinlutherkingday", "martinlutherkingjrday"]], ["washingtonsbirthday", ["washingtonsbirthday", "washingtonbirthday"]], ["canberra", ["canberraday"]], ["labour", ["labourday", "laborday"]], ["columbus", ["columbusday"]], ["memorial", ["memorialday"]], ["yuandan", ["yuandan"]], ["maosbirthday", ["maosbirthday"]], ["teachersday", ["teachersday", "teacherday"]], ["singleday", ["singleday"]], ["allsaintsday", ["allsaintsday"]], ["youthday", ["youthday"]], ["childrenday", ["childrenday", "childday"]], ["femaleday", ["femaleday"]], ["treeplantingday", ["treeplantingday"]], ["arborday", ["arborday"]], ["girlsday", ["girlsday"]], ["whiteloverday", ["whiteloverday"]], ["loverday", ["loverday"]], ["christmas", ["christmasday", "christmas"]], ["xmas", ["xmasday", "xmas"]], ["newyear", ["newyear"]], ["newyearday", ["newyearday"]], ["newyearsday", ["newyearsday"]], ["inaugurationday", ["inaugurationday"]], ["groundhougday", ["groundhougday"]], ["valentinesday", ["valentinesday"]], ["stpatrickday", ["stpatrickday"]], ["aprilfools", ["aprilfools"]], ["stgeorgeday", ["stgeorgeday"]], ["mayday", ["mayday", "intlworkersday", "internationalworkersday"]], ["cincodemayoday", ["cincodemayoday"]], ["baptisteday", ["baptisteday"]], ["usindependenceday", ["usindependenceday"]], ["independenceday", ["independenceday"]], ["bastilleday", ["bastilleday"]], ["halloweenday", ["halloweenday"]], ["allhallowday", ["allhallowday"]], ["allsoulsday", ["allsoulsday"]], ["guyfawkesday", ["guyfawkesday"]], ["veteransday", ["veteransday"]], ["christmaseve", ["christmaseve"]], ["newyeareve", ["newyearseve", "newyeareve"]]]); + EnglishDateTime.WrittenDecades = new Map([["hundreds", 0], ["tens", 10], ["twenties", 20], ["thirties", 30], ["forties", 40], ["fifties", 50], ["sixties", 60], ["seventies", 70], ["eighties", 80], ["nineties", 90]]); + EnglishDateTime.SpecialDecadeCases = new Map([["noughties", 2000], ["two thousands", 2000]]); + EnglishDateTime.DefaultLanguageFallback = 'MDY'; + EnglishDateTime.SuperfluousWordList = ['preferably', 'how about', 'maybe', 'say', 'like']; + EnglishDateTime.DurationDateRestrictions = ['today', 'now']; + EnglishDateTime.AmbiguityFiltersDict = new Map([["\\bmorning|afternoon|evening|night|day\\b", "\\bgood\\s+(morning|afternoon|evening|night|day)\\b"], ["\\bmay\\b", "\\b((^may i)|(i|you|he|she|we|they)\\s+may|(may\\s+((((also|not|(also not)|well)\\s+)?(be|contain|constitute|email|e-mail|take|have|result|involve|get|work|reply))|(or may not))))\\b"]]); +})(EnglishDateTime = exports.EnglishDateTime || (exports.EnglishDateTime = {})); + +}); + +unwrapExports(englishDateTime); + +var parsers$4 = createCommonjsModule(function (module, exports) { +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); + + +class DateTimeParseResult extends recognizersText.ParseResult { +} +exports.DateTimeParseResult = DateTimeParseResult; +class BaseDateParserConfiguration { + constructor() { + this.dayOfMonth = baseDateTime.BaseDateTime.DayOfMonthDictionary; + } +} +exports.BaseDateParserConfiguration = BaseDateParserConfiguration; + +}); + +unwrapExports(parsers$4); + +/** + * lodash (Custom Build) + * Build: `lodash modularize exports="npm" -o ./` + * Copyright jQuery Foundation and other contributors + * Released under MIT license + * Based on Underscore.js 1.8.3 + * Copyright Jeremy Ashkenas, DocumentCloud and Investigative Reporters & Editors + */ + +/** Used as references for various `Number` constants. */ +var NAN = 0 / 0; + +/** `Object#toString` result references. */ +var symbolTag$2 = '[object Symbol]'; + +/** Used to match leading and trailing whitespace. */ +var reTrim = /^\s+|\s+$/g; + +/** Used to detect bad signed hexadecimal string values. */ +var reIsBadHex = /^[-+]0x[0-9a-f]+$/i; + +/** Used to detect binary string values. */ +var reIsBinary = /^0b[01]+$/i; + +/** Used to detect octal string values. */ +var reIsOctal = /^0o[0-7]+$/i; + +/** Built-in method references without a dependency on `root`. */ +var freeParseInt = parseInt; + +/** Used for built-in method references. */ +var objectProto$2 = Object.prototype; + +/** + * Used to resolve the + * [`toStringTag`](http://ecma-international.org/ecma-262/7.0/#sec-object.prototype.tostring) + * of values. + */ +var objectToString$2 = objectProto$2.toString; + +/** + * Checks if `value` is the + * [language type](http://www.ecma-international.org/ecma-262/7.0/#sec-ecmascript-language-types) + * of `Object`. (e.g. arrays, functions, objects, regexes, `new Number(0)`, and `new String('')`) + * + * @static + * @memberOf _ + * @since 0.1.0 + * @category Lang + * @param {*} value The value to check. + * @returns {boolean} Returns `true` if `value` is an object, else `false`. + * @example + * + * _.isObject({}); + * // => true + * + * _.isObject([1, 2, 3]); + * // => true + * + * _.isObject(_.noop); + * // => true + * + * _.isObject(null); + * // => false + */ +function isObject(value) { + var type = typeof value; + return !!value && (type == 'object' || type == 'function'); +} + +/** + * Checks if `value` is object-like. A value is object-like if it's not `null` + * and has a `typeof` result of "object". + * + * @static + * @memberOf _ + * @since 4.0.0 + * @category Lang + * @param {*} value The value to check. + * @returns {boolean} Returns `true` if `value` is object-like, else `false`. + * @example + * + * _.isObjectLike({}); + * // => true + * + * _.isObjectLike([1, 2, 3]); + * // => true + * + * _.isObjectLike(_.noop); + * // => false + * + * _.isObjectLike(null); + * // => false + */ +function isObjectLike$2(value) { + return !!value && typeof value == 'object'; +} + +/** + * Checks if `value` is classified as a `Symbol` primitive or object. + * + * @static + * @memberOf _ + * @since 4.0.0 + * @category Lang + * @param {*} value The value to check. + * @returns {boolean} Returns `true` if `value` is a symbol, else `false`. + * @example + * + * _.isSymbol(Symbol.iterator); + * // => true + * + * _.isSymbol('abc'); + * // => false + */ +function isSymbol$2(value) { + return typeof value == 'symbol' || + (isObjectLike$2(value) && objectToString$2.call(value) == symbolTag$2); +} + +/** + * Converts `value` to a number. + * + * @static + * @memberOf _ + * @since 4.0.0 + * @category Lang + * @param {*} value The value to process. + * @returns {number} Returns the number. + * @example + * + * _.toNumber(3.2); + * // => 3.2 + * + * _.toNumber(Number.MIN_VALUE); + * // => 5e-324 + * + * _.toNumber(Infinity); + * // => Infinity + * + * _.toNumber('3.2'); + * // => 3.2 + */ +function toNumber(value) { + if (typeof value == 'number') { + return value; + } + if (isSymbol$2(value)) { + return NAN; + } + if (isObject(value)) { + var other = typeof value.valueOf == 'function' ? value.valueOf() : value; + value = isObject(other) ? (other + '') : other; + } + if (typeof value != 'string') { + return value === 0 ? value : +value; + } + value = value.replace(reTrim, ''); + var isBinary = reIsBinary.test(value); + return (isBinary || reIsOctal.test(value)) + ? freeParseInt(value.slice(2), isBinary ? 2 : 8) + : (reIsBadHex.test(value) ? NAN : +value); +} + +var lodash_tonumber = toNumber; + +var baseDate = createCommonjsModule(function (module, exports) { +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); + + + + + + +class BaseDateExtractor { + constructor(config) { + this.extractorName = constants$2.Constants.SYS_DATETIME_DATE; + this.config = config; + } + extract(source, refDate) { + if (!refDate) + refDate = new Date(); + let referenceDate = refDate; + let tokens = new Array(); + tokens = tokens.concat(this.basicRegexMatch(source)); + tokens = tokens.concat(this.implicitDate(source)); + tokens = tokens.concat(this.numberWithMonth(source, referenceDate)); + tokens = tokens.concat(this.durationWithBeforeAndAfter(source, referenceDate)); + let result = utilities$2.Token.mergeAllTokens(tokens, source, this.extractorName); + return result; + } + basicRegexMatch(source) { + let ret = []; + this.config.dateRegexList.forEach(regexp => { + let matches = recognizersText.RegExpUtility.getMatches(regexp, source); + matches.forEach(match => { + ret.push(new utilities$2.Token(match.index, match.index + match.length)); + }); + }); + return ret; + } + implicitDate(source) { + let ret = []; + this.config.implicitDateList.forEach(regexp => { + let matches = recognizersText.RegExpUtility.getMatches(regexp, source); + matches.forEach(match => { + ret.push(new utilities$2.Token(match.index, match.index + match.length)); + }); + }); + return ret; + } + numberWithMonth(source, refDate) { + let ret = []; + let er = this.config.ordinalExtractor.extract(source).concat(this.config.integerExtractor.extract(source)); + er.forEach(result => { + let num = lodash_tonumber(this.config.numberParser.parse(result).value); + if (num < 1 || num > 31) { + return; + } + if (result.start >= 0) { + let frontString = source.substring(0, result.start | 0); + let match = recognizersText.RegExpUtility.getMatches(this.config.monthEnd, frontString)[0]; + if (match && match.length) { + ret.push(new utilities$2.Token(match.index, match.index + match.length + result.length)); + return; + } + // handling cases like 'for the 25th' + let matches = recognizersText.RegExpUtility.getMatches(this.config.forTheRegex, source); + let isFound = false; + matches.forEach(matchCase => { + if (matchCase) { + let ordinalNum = matchCase.groups('DayOfMonth').value; + if (ordinalNum === result.text) { + let length = matchCase.groups('end').value.length; + ret.push(new utilities$2.Token(matchCase.index, matchCase.index + matchCase.length - length)); + isFound = true; + } + } + }); + if (isFound) { + return; + } + // handling cases like 'Thursday the 21st', which both 'Thursday' and '21st' refer to a same date + matches = recognizersText.RegExpUtility.getMatches(this.config.weekDayAndDayOfMonthRegex, source); + matches.forEach(matchCase => { + if (matchCase) { + let ordinalNum = matchCase.groups('DayOfMonth').value; + if (ordinalNum === result.text) { + let month = refDate.getMonth(); + let year = refDate.getFullYear(); + // get week of day for the ordinal number which is regarded as a date of reference month + let date = utilities$2.DateUtils.safeCreateFromMinValue(year, month, num); + let numWeekDayStr = utilities$2.DayOfWeek[date.getDay()].toString().toLowerCase(); + // get week day from text directly, compare it with the weekday generated above + // to see whether they refer to a same week day + let extractedWeekDayStr = matchCase.groups("weekday").value.toString().toLowerCase(); + if (date !== utilities$2.DateUtils.minValue() && + this.config.dayOfWeek.get(numWeekDayStr) === this.config.dayOfWeek.get(extractedWeekDayStr)) { + ret.push(new utilities$2.Token(matchCase.index, result.start + result.length)); + isFound = true; + } + } + } + }); + if (isFound) { + return; + } + // handling cases like '20th of next month' + let suffixStr = source.substr(result.start + result.length).toLowerCase(); + match = recognizersText.RegExpUtility.getMatches(this.config.relativeMonthRegex, suffixStr.trim()).pop(); + if (match && match.index === 0) { + let spaceLen = suffixStr.length - suffixStr.trim().length; + ret.push(new utilities$2.Token(result.start, result.start + result.length + spaceLen + match.length)); + } + // handling cases like 'second Sunday' + match = recognizersText.RegExpUtility.getMatches(this.config.weekDayRegex, suffixStr.trim()).pop(); + if (match && match.index === 0 && num >= 1 && num <= 5 + && result.type === recognizersTextNumber.Constants.SYS_NUM_ORDINAL) { + let weekDayStr = match.groups('weekday').value; + if (this.config.dayOfWeek.has(weekDayStr)) { + let spaceLen = suffixStr.length - suffixStr.trim().length; + ret.push(new utilities$2.Token(result.start, result.start + result.length + spaceLen + match.length)); + } + } + } + if (result.start + result.length < source.length) { + let afterString = source.substring(result.start + result.length); + let match = recognizersText.RegExpUtility.getMatches(this.config.ofMonth, afterString)[0]; + if (match && match.length) { + ret.push(new utilities$2.Token(result.start, result.start + result.length + match.length)); + return; + } + } + }); + return ret; + } + durationWithBeforeAndAfter(source, refDate) { + let ret = []; + let durEx = this.config.durationExtractor.extract(source, refDate); + durEx.forEach(er => { + let match = recognizersText.RegExpUtility.getMatches(this.config.dateUnitRegex, er.text).pop(); + if (!match) + return; + ret = utilities$2.AgoLaterUtil.extractorDurationWithBeforeAndAfter(source, er, ret, this.config.utilityConfiguration); + }); + return ret; + } +} +exports.BaseDateExtractor = BaseDateExtractor; +class BaseDateParser { + constructor(config) { + this.parserName = constants$2.Constants.SYS_DATETIME_DATE; + this.config = config; + } + parse(extractorResult, referenceDate) { + if (!referenceDate) + referenceDate = new Date(); + let resultValue; + if (extractorResult.type === this.parserName) { + let source = extractorResult.text.toLowerCase(); + let innerResult = this.parseBasicRegexMatch(source, referenceDate); + if (!innerResult.success) { + innerResult = this.parseImplicitDate(source, referenceDate); + } + if (!innerResult.success) { + innerResult = this.parseWeekdayOfMonth(source, referenceDate); + } + if (!innerResult.success) { + innerResult = this.parserDurationWithAgoAndLater(source, referenceDate); + } + if (!innerResult.success) { + innerResult = this.parseNumberWithMonth(source, referenceDate); + } + if (!innerResult.success) { + innerResult = this.parseSingleNumber(source, referenceDate); + } + if (innerResult.success) { + innerResult.futureResolution = {}; + innerResult.futureResolution[constants$2.TimeTypeConstants.DATE] = utilities$2.FormatUtil.formatDate(innerResult.futureValue); + innerResult.pastResolution = {}; + innerResult.pastResolution[constants$2.TimeTypeConstants.DATE] = utilities$2.FormatUtil.formatDate(innerResult.pastValue); + resultValue = innerResult; + } + } + let result = new parsers$4.DateTimeParseResult(extractorResult); + result.value = resultValue; + result.timexStr = resultValue ? resultValue.timex : ''; + result.resolutionStr = ''; + return result; + } + parseBasicRegexMatch(source, referenceDate) { + let trimmedSource = source.trim(); + let result = new utilities$2.DateTimeResolutionResult(); + this.config.dateRegex.some(regex => { + let offset = 0; + let match = recognizersText.RegExpUtility.getMatches(regex, trimmedSource).pop(); + if (!match) { + match = recognizersText.RegExpUtility.getMatches(regex, this.config.dateTokenPrefix + trimmedSource).pop(); + offset = this.config.dateTokenPrefix.length; + } + if (match && match.index === offset && match.length === trimmedSource.length) { + result = this.matchToDate(match, referenceDate); + return true; + } + }); + return result; + } + parseImplicitDate(source, referenceDate) { + let trimmedSource = source.trim(); + let result = new utilities$2.DateTimeResolutionResult(); + // handle "on 12" + let match = recognizersText.RegExpUtility.getMatches(this.config.onRegex, this.config.dateTokenPrefix + trimmedSource).pop(); + if (match && match.index === this.config.dateTokenPrefix.length && match.length === trimmedSource.length) { + let day = 0; + let month = referenceDate.getMonth(); + let year = referenceDate.getFullYear(); + let dayStr = match.groups('day').value; + day = this.config.dayOfMonth.get(dayStr); + result.timex = utilities$2.FormatUtil.luisDate(-1, -1, day); + let tryStr = utilities$2.FormatUtil.luisDate(year, month, day); + let tryDate = Date.parse(tryStr); + let futureDate; + let pastDate; + if (tryDate && !isNaN(tryDate)) { + futureDate = utilities$2.DateUtils.safeCreateFromMinValue(year, month, day); + pastDate = utilities$2.DateUtils.safeCreateFromMinValue(year, month, day); + if (futureDate < referenceDate) { + futureDate.setMonth(futureDate.getMonth() + 1); + } + if (pastDate >= referenceDate) { + pastDate.setMonth(pastDate.getMonth() - 1); + } + } + else { + futureDate = utilities$2.DateUtils.safeCreateFromMinValue(year, month + 1, day); + pastDate = utilities$2.DateUtils.safeCreateFromMinValue(year, month - 1, day); + } + result.futureValue = futureDate; + result.pastValue = pastDate; + result.success = true; + return result; + } + // handle "today", "the day before yesterday" + match = recognizersText.RegExpUtility.getMatches(this.config.specialDayRegex, trimmedSource).pop(); + if (match && match.index === 0 && match.length === trimmedSource.length) { + let swift = this.config.getSwiftDay(match.value); + let value = utilities$2.DateUtils.addDays(referenceDate, swift); + result.timex = utilities$2.FormatUtil.luisDateFromDate(value); + result.futureValue = value; + result.pastValue = value; + result.success = true; + return result; + } + // handle "two days from tomorrow" + match = recognizersText.RegExpUtility.getMatches(this.config.specialDayWithNumRegex, trimmedSource).pop(); + if (match && match.index === 0 && match.length === trimmedSource.length) { + let swift = this.config.getSwiftDay(match.groups('day').value); + let numErs = this.config.integerExtractor.extract(trimmedSource); + let numOfDays = Number.parseInt(this.config.numberParser.parse(numErs[0]).value); + let value = utilities$2.DateUtils.addDays(referenceDate, swift + numOfDays); + result.timex = utilities$2.FormatUtil.luisDateFromDate(value); + result.futureValue = value; + result.pastValue = value; + result.success = true; + return result; + } + // handle "two sundays from now" + match = recognizersText.RegExpUtility.getMatches(this.config.relativeWeekDayRegex, trimmedSource).pop(); + if (match && match.index === 0 && match.length === trimmedSource.length) { + let numErs = this.config.integerExtractor.extract(trimmedSource); + let num = Number.parseInt(this.config.numberParser.parse(numErs[0]).value); + let weekdayStr = match.groups('weekday').value.toLowerCase(); + let value = referenceDate; + // Check whether the determined day of this week has passed. + if (value.getDay() > this.config.dayOfWeek.get(weekdayStr)) { + num--; + } + while (num-- > 0) { + value = utilities$2.DateUtils.next(value, this.config.dayOfWeek.get(weekdayStr)); + } + result.timex = utilities$2.FormatUtil.luisDateFromDate(value); + result.futureValue = value; + result.pastValue = value; + result.success = true; + return result; + } + // handle "next Sunday" + match = recognizersText.RegExpUtility.getMatches(this.config.nextRegex, trimmedSource).pop(); + if (match && match.index === 0 && match.length === trimmedSource.length) { + let weekdayStr = match.groups('weekday').value; + let value = utilities$2.DateUtils.next(referenceDate, this.config.dayOfWeek.get(weekdayStr)); + result.timex = utilities$2.FormatUtil.luisDateFromDate(value); + result.futureValue = value; + result.pastValue = value; + result.success = true; + return result; + } + // handle "this Friday" + match = recognizersText.RegExpUtility.getMatches(this.config.thisRegex, trimmedSource).pop(); + if (match && match.index === 0 && match.length === trimmedSource.length) { + let weekdayStr = match.groups('weekday').value; + let value = utilities$2.DateUtils.this(referenceDate, this.config.dayOfWeek.get(weekdayStr)); + result.timex = utilities$2.FormatUtil.luisDateFromDate(value); + result.futureValue = value; + result.pastValue = value; + result.success = true; + return result; + } + // handle "last Friday", "last mon" + match = recognizersText.RegExpUtility.getMatches(this.config.lastRegex, trimmedSource).pop(); + if (match && match.index === 0 && match.length === trimmedSource.length) { + let weekdayStr = match.groups('weekday').value; + let value = utilities$2.DateUtils.last(referenceDate, this.config.dayOfWeek.get(weekdayStr)); + result.timex = utilities$2.FormatUtil.luisDateFromDate(value); + result.futureValue = value; + result.pastValue = value; + result.success = true; + return result; + } + // handle "Friday" + match = recognizersText.RegExpUtility.getMatches(this.config.weekDayRegex, trimmedSource).pop(); + if (match && match.index === 0 && match.length === trimmedSource.length) { + let weekdayStr = match.groups('weekday').value; + let weekday = this.config.dayOfWeek.get(weekdayStr); + let value = utilities$2.DateUtils.this(referenceDate, this.config.dayOfWeek.get(weekdayStr)); + if (weekday === 0) + weekday = 7; + if (weekday < referenceDate.getDay()) + value = utilities$2.DateUtils.next(referenceDate, weekday); + result.timex = 'XXXX-WXX-' + weekday; + let futureDate = new Date(value); + let pastDate = new Date(value); + if (futureDate < referenceDate) + futureDate.setDate(value.getDate() + 7); + if (pastDate >= referenceDate) + pastDate.setDate(value.getDate() - 7); + result.futureValue = futureDate; + result.pastValue = pastDate; + result.success = true; + return result; + } + // handle "for the 27th." + match = recognizersText.RegExpUtility.getMatches(this.config.forTheRegex, trimmedSource).pop(); + if (match) { + let dayStr = match.groups('DayOfMonth').value; + let er = recognizersText.ExtractResult.getFromText(dayStr); + let day = Number.parseInt(this.config.numberParser.parse(er).value); + let month = referenceDate.getMonth(); + let year = referenceDate.getFullYear(); + result.timex = utilities$2.FormatUtil.luisDate(-1, -1, day); + let date = new Date(year, month, day); + result.futureValue = date; + result.pastValue = date; + result.success = true; + return result; + } + // handling cases like 'Thursday the 21st', which both 'Thursday' and '21st' refer to a same date + match = recognizersText.RegExpUtility.getMatches(this.config.weekDayAndDayOfMonthRegex, trimmedSource).pop(); + if (match) { + let dayStr = match.groups('DayOfMonth').value; + let er = recognizersText.ExtractResult.getFromText(dayStr); + let day = Number.parseInt(this.config.numberParser.parse(er).value); + let month = referenceDate.getMonth(); + let year = referenceDate.getFullYear(); + // the validity of the phrase is guaranteed in the Date Extractor + result.timex = utilities$2.FormatUtil.luisDate(year, month, day); + result.futureValue = new Date(year, month, day); + result.pastValue = new Date(year, month, day); + result.success = true; + return result; + } + return result; + } + parseNumberWithMonth(source, referenceDate) { + let trimmedSource = source.trim(); + let ambiguous = true; + let result = new utilities$2.DateTimeResolutionResult(); + let ers = this.config.ordinalExtractor.extract(trimmedSource); + if (!ers || ers.length === 0) { + ers = this.config.integerExtractor.extract(trimmedSource); + } + if (!ers || ers.length === 0) + return result; + let num = Number.parseInt(this.config.numberParser.parse(ers[0]).value); + let day = 1; + let month = 0; + let match = recognizersText.RegExpUtility.getMatches(this.config.monthRegex, trimmedSource).pop(); + if (match) { + month = this.config.monthOfYear.get(match.value) - 1; + day = num; + } + else { + // handling relative month + match = recognizersText.RegExpUtility.getMatches(this.config.relativeMonthRegex, trimmedSource).pop(); + if (match) { + let monthStr = match.groups('order').value; + let swift = this.config.getSwiftMonth(monthStr); + let date = new Date(referenceDate); + date.setMonth(referenceDate.getMonth() + swift); + month = date.getMonth(); + day = num; + ambiguous = false; + } + } + // handling casesd like 'second Sunday' + if (!match) { + match = recognizersText.RegExpUtility.getMatches(this.config.weekDayRegex, trimmedSource).pop(); + if (match) { + month = referenceDate.getMonth(); + // resolve the date of wanted week day + let wantedWeekDay = this.config.dayOfWeek.get(match.groups('weekday').value); + let firstDate = utilities$2.DateUtils.safeCreateFromMinValue(referenceDate.getFullYear(), referenceDate.getMonth(), 1); + let firstWeekday = firstDate.getDay(); + let firstWantedWeekDay = new Date(firstDate); + firstWantedWeekDay.setDate(firstDate.getDate() + ((wantedWeekDay > firstWeekday) ? wantedWeekDay - firstWeekday : wantedWeekDay - firstWeekday + 7)); + day = firstWantedWeekDay.getDate() + ((num - 1) * 7); + ambiguous = false; + } + } + if (!match) + return result; + let year = referenceDate.getFullYear(); + // for LUIS format value string + let futureDate = utilities$2.DateUtils.safeCreateFromMinValue(year, month, day); + let pastDate = utilities$2.DateUtils.safeCreateFromMinValue(year, month, day); + if (ambiguous) { + result.timex = utilities$2.FormatUtil.luisDate(-1, month, day); + if (futureDate < referenceDate) + futureDate.setFullYear(year + 1); + if (pastDate >= referenceDate) + pastDate.setFullYear(year - 1); + } + else { + result.timex = utilities$2.FormatUtil.luisDate(year, month, day); + } + result.futureValue = futureDate; + result.pastValue = pastDate; + result.success = true; + return result; + } + // handle cases like "the 27th". In the extractor, only the unmatched weekday and date will output this date. + parseSingleNumber(source, referenceDate) { + let trimmedSource = source.trim(); + let result = new utilities$2.DateTimeResolutionResult(); + let er = this.config.ordinalExtractor.extract(trimmedSource).pop(); + if (!er || recognizersText.StringUtility.isNullOrEmpty(er.text)) { + er = this.config.integerExtractor.extract(trimmedSource).pop(); + } + if (!er || recognizersText.StringUtility.isNullOrEmpty(er.text)) + return result; + let day = Number.parseInt(this.config.numberParser.parse(er).value); + let month = referenceDate.getMonth(); + let year = referenceDate.getFullYear(); + result.timex = utilities$2.FormatUtil.luisDate(-1, -1, day); + let pastDate = utilities$2.DateUtils.safeCreateFromMinValue(year, month, day); + let futureDate = utilities$2.DateUtils.safeCreateFromMinValue(year, month, day); + if (futureDate !== utilities$2.DateUtils.minValue() && futureDate < referenceDate) + futureDate.setMonth(month + 1); + if (pastDate !== utilities$2.DateUtils.minValue() && pastDate >= referenceDate) + pastDate.setMonth(month - 1); + result.futureValue = futureDate; + result.pastValue = pastDate; + result.success = true; + return result; + } + parserDurationWithAgoAndLater(source, referenceDate) { + return utilities$2.AgoLaterUtil.parseDurationWithAgoAndLater(source, referenceDate, this.config.durationExtractor, this.config.durationParser, this.config.unitMap, this.config.unitRegex, this.config.utilityConfiguration, utilities$2.AgoLaterMode.Date); + } + parseWeekdayOfMonth(source, referenceDate) { + let trimmedSource = source.trim(); + let result = new utilities$2.DateTimeResolutionResult(); + let match = recognizersText.RegExpUtility.getMatches(this.config.weekDayOfMonthRegex, trimmedSource).pop(); + if (!match) + return result; + let cardinalStr = match.groups('cardinal').value; + let weekdayStr = match.groups('weekday').value; + let monthStr = match.groups('month').value; + let noYear = false; + let cardinal = this.config.isCardinalLast(cardinalStr) ? 5 : this.config.cardinalMap.get(cardinalStr); + let weekday = this.config.dayOfWeek.get(weekdayStr); + let month = referenceDate.getMonth(); + let year = referenceDate.getFullYear(); + if (recognizersText.StringUtility.isNullOrEmpty(monthStr)) { + let swift = this.config.getSwiftMonth(trimmedSource); + let temp = new Date(referenceDate); + temp.setMonth(referenceDate.getMonth() + swift); + month = temp.getMonth(); + year = temp.getFullYear(); + } + else { + month = this.config.monthOfYear.get(monthStr) - 1; + noYear = true; + } + let value = this.computeDate(cardinal, weekday, month, year); + if (value.getMonth() !== month) { + cardinal -= 1; + value.setDate(value.getDate() - 7); + } + let futureDate = value; + let pastDate = value; + if (noYear && futureDate < referenceDate) { + futureDate = this.computeDate(cardinal, weekday, month, year + 1); + if (futureDate.getMonth() !== month) + futureDate.setDate(futureDate.getDate() - 7); + } + if (noYear && pastDate >= referenceDate) { + pastDate = this.computeDate(cardinal, weekday, month, year - 1); + if (pastDate.getMonth() !== month) + pastDate.setDate(pastDate.getDate() - 7); + } + result.timex = ['XXXX', utilities$2.FormatUtil.toString(month + 1, 2), 'WXX', weekday, '#' + cardinal].join('-'); + result.futureValue = futureDate; + result.pastValue = pastDate; + result.success = true; + return result; + } + matchToDate(match, referenceDate) { + let result = new utilities$2.DateTimeResolutionResult(); + let yearStr = match.groups('year').value; + let monthStr = match.groups('month').value; + let dayStr = match.groups('day').value; + let month = 0; + let day = 0; + let year = 0; + if (this.config.monthOfYear.has(monthStr) && this.config.dayOfMonth.has(dayStr)) { + month = this.config.monthOfYear.get(monthStr) - 1; + day = this.config.dayOfMonth.get(dayStr); + if (!recognizersText.StringUtility.isNullOrEmpty(yearStr)) { + year = Number.parseInt(yearStr, 10); + if (year < 100 && year >= constants$2.Constants.MinTwoDigitYearPastNum) + year += 1900; + else if (year >= 0 && year < constants$2.Constants.MaxTwoDigitYearFutureNum) + year += 2000; + } + } + let noYear = false; + if (year === 0) { + year = referenceDate.getFullYear(); + result.timex = utilities$2.FormatUtil.luisDate(-1, month, day); + noYear = true; + } + else { + result.timex = utilities$2.FormatUtil.luisDate(year, month, day); + } + let futureDate = utilities$2.DateUtils.safeCreateFromMinValue(year, month, day); + let pastDate = utilities$2.DateUtils.safeCreateFromMinValue(year, month, day); + if (noYear && futureDate < referenceDate) { + futureDate = utilities$2.DateUtils.safeCreateFromMinValue(year + 1, month, day); + } + if (noYear && pastDate >= referenceDate) { + pastDate = utilities$2.DateUtils.safeCreateFromMinValue(year - 1, month, day); + } + result.futureValue = futureDate; + result.pastValue = pastDate; + result.success = true; + return result; + } + computeDate(cardinal, weekday, month, year) { + let firstDay = new Date(year, month, 1); + let firstWeekday = utilities$2.DateUtils.this(firstDay, weekday); + let dayOfWeekOfFirstDay = firstDay.getDay(); + if (weekday === 0) + weekday = 7; + if (dayOfWeekOfFirstDay === 0) + dayOfWeekOfFirstDay = 7; + if (weekday < dayOfWeekOfFirstDay) + firstWeekday = utilities$2.DateUtils.next(firstDay, weekday); + firstWeekday.setDate(firstWeekday.getDate() + (7 * (cardinal - 1))); + return firstWeekday; + } +} +exports.BaseDateParser = BaseDateParser; + +}); + +unwrapExports(baseDate); + +var baseTime = createCommonjsModule(function (module, exports) { +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); + + + + +class BaseTimeExtractor { + constructor(config) { + this.extractorName = constants$2.Constants.SYS_DATETIME_TIME; // "Time"; + this.config = config; + } + extract(text, refDate) { + if (!refDate) + refDate = new Date(); + let referenceDate = refDate; + let tokens = new Array() + .concat(this.basicRegexMatch(text)) + .concat(this.atRegexMatch(text)) + .concat(this.specialsRegexMatch(text, referenceDate)); + let result = utilities$2.Token.mergeAllTokens(tokens, text, this.extractorName); + return result; + } + basicRegexMatch(text) { + let ret = []; + this.config.timeRegexList.forEach(regexp => { + let matches = recognizersTextNumber.RegExpUtility.getMatches(regexp, text); + matches.forEach(match => { + ret.push(new utilities$2.Token(match.index, match.index + match.length)); + }); + }); + return ret; + } + atRegexMatch(text) { + let ret = []; + // handle "at 5", "at seven" + let matches = recognizersTextNumber.RegExpUtility.getMatches(this.config.atRegex, text); + matches.forEach(match => { + if (match.index + match.length < text.length && + text.charAt(match.index + match.length) === '%') { + return; + } + ret.push(new utilities$2.Token(match.index, match.index + match.length)); + }); + return ret; + } + specialsRegexMatch(text, refDate) { + let ret = []; + // handle "ish" + if (this.config.ishRegex !== null) { + let matches = recognizersTextNumber.RegExpUtility.getMatches(this.config.ishRegex, text); + matches.forEach(match => { + ret.push(new utilities$2.Token(match.index, match.index + match.length)); + }); + } + return ret; + } +} +exports.BaseTimeExtractor = BaseTimeExtractor; +class BaseTimeParser { + constructor(configuration) { + this.ParserName = constants$2.Constants.SYS_DATETIME_TIME; // "Time"; + this.config = configuration; + } + parse(er, referenceTime) { + if (!referenceTime) + referenceTime = new Date(); + let value = null; + if (er.type === this.ParserName) { + let innerResult = this.internalParse(er.text, referenceTime); + if (innerResult.success) { + innerResult.futureResolution = {}; + innerResult.futureResolution[constants$2.TimeTypeConstants.TIME] = utilities$2.FormatUtil.formatTime(innerResult.futureValue); + innerResult.pastResolution = {}; + innerResult.pastResolution[constants$2.TimeTypeConstants.TIME] = utilities$2.FormatUtil.formatTime(innerResult.pastValue); + value = innerResult; + } + } + let ret = new parsers$4.DateTimeParseResult(er); + ret.value = value, ret.timexStr = value === null ? "" : value.timex, ret.resolutionStr = ""; + return ret; + } + internalParse(text, referenceTime) { + let innerResult = this.parseBasicRegexMatch(text, referenceTime); + return innerResult; + } + // parse basic patterns in TimeRegexList + parseBasicRegexMatch(text, referenceTime) { + let trimmedText = text.trim().toLowerCase(); + let offset = 0; + let matches = recognizersTextNumber.RegExpUtility.getMatches(this.config.atRegex, trimmedText); + if (matches.length === 0) { + matches = recognizersTextNumber.RegExpUtility.getMatches(this.config.atRegex, this.config.timeTokenPrefix + trimmedText); + offset = this.config.timeTokenPrefix.length; + } + if (matches.length > 0 && matches[0].index === offset && matches[0].length === trimmedText.length) { + return this.match2Time(matches[0], referenceTime); + } + // parse hour pattern, like "twenty one", "16" + // create a extract result which content the pass-in text + let hour = this.config.numbers.get(text) || Number(text); + if (hour) { + if (hour >= 0 && hour <= 24) { + let ret = new utilities$2.DateTimeResolutionResult(); + if (hour === 24) { + hour = 0; + } + if (hour <= 12 && hour !== 0) { + ret.comment = "ampm"; + } + ret.timex = "T" + utilities$2.FormatUtil.toString(hour, 2); + ret.futureValue = ret.pastValue = + utilities$2.DateUtils.safeCreateFromMinValue(referenceTime.getFullYear(), referenceTime.getMonth(), referenceTime.getDate(), hour, 0, 0); + ret.success = true; + return ret; + } + } + for (let regex of this.config.timeRegexes) { + offset = 0; + matches = recognizersTextNumber.RegExpUtility.getMatches(regex, trimmedText); + if (matches.length && matches[0].index === offset && matches[0].length === trimmedText.length) { + return this.match2Time(matches[0], referenceTime); + } + } + return new utilities$2.DateTimeResolutionResult(); + } + match2Time(match, referenceTime) { + let ret = new utilities$2.DateTimeResolutionResult(); + let hour = 0; + let min = 0; + let second = 0; + let day = referenceTime.getDate(); + let month = referenceTime.getMonth(); + let year = referenceTime.getFullYear(); + let hasMin = false; + let hasSec = false; + let hasAm = false; + let hasPm = false; + let hasMid = false; + let engTimeStr = match.groups('engtime').value; + if (!recognizersTextNumber.StringUtility.isNullOrWhitespace(engTimeStr)) { + // get hour + let hourStr = match.groups('hournum').value.toLowerCase(); + hour = this.config.numbers.get(hourStr); + // get minute + let minStr = match.groups('minnum').value; + let tensStr = match.groups('tens').value; + if (!recognizersTextNumber.StringUtility.isNullOrWhitespace(minStr)) { + min = this.config.numbers.get(minStr); + if (tensStr) { + min += this.config.numbers.get(tensStr); + } + hasMin = true; + } + } + else if (!recognizersTextNumber.StringUtility.isNullOrWhitespace(match.groups('mid').value)) { + hasMid = true; + if (!recognizersTextNumber.StringUtility.isNullOrWhitespace(match.groups('midnight').value)) { + hour = 0; + min = 0; + second = 0; + } + else if (!recognizersTextNumber.StringUtility.isNullOrWhitespace(match.groups('midmorning').value)) { + hour = 10; + min = 0; + second = 0; + } + else if (!recognizersTextNumber.StringUtility.isNullOrWhitespace(match.groups('midafternoon').value)) { + hour = 14; + min = 0; + second = 0; + } + else if (!recognizersTextNumber.StringUtility.isNullOrWhitespace(match.groups('midday').value)) { + hour = 12; + min = 0; + second = 0; + } + } + else { + // get hour + let hourStr = match.groups('hour').value; + if (recognizersTextNumber.StringUtility.isNullOrWhitespace(hourStr)) { + hourStr = match.groups('hournum').value.toLowerCase(); + hour = this.config.numbers.get(hourStr); + if (!hour) { + return ret; + } + } + else { + hour = Number.parseInt(hourStr, 10); + if (!hour) { + hour = this.config.numbers.get(hourStr); + if (!hour) { + return ret; + } + } + } + // get minute + let minStr = match.groups('min').value.toLowerCase(); + if (recognizersTextNumber.StringUtility.isNullOrWhitespace(minStr)) { + minStr = match.groups('minnum').value; + if (!recognizersTextNumber.StringUtility.isNullOrWhitespace(minStr)) { + min = this.config.numbers.get(minStr); + hasMin = true; + } + let tensStr = match.groups('tens').value; + if (!recognizersTextNumber.StringUtility.isNullOrWhitespace(tensStr)) { + min += this.config.numbers.get(tensStr); + hasMin = true; + } + } + else { + min = Number.parseInt(minStr, 10); + hasMin = true; + } + // get second + let secStr = match.groups('sec').value.toLowerCase(); + if (!recognizersTextNumber.StringUtility.isNullOrWhitespace(secStr)) { + second = Number.parseInt(secStr, 10); + hasSec = true; + } + } + // adjust by desc string + let descStr = match.groups('desc').value.toLowerCase(); + if (recognizersTextNumber.RegExpUtility.getMatches(this.config.utilityConfiguration.amDescRegex, descStr).length > 0 + || recognizersTextNumber.RegExpUtility.getMatches(this.config.utilityConfiguration.amPmDescRegex, descStr).length > 0 + || !recognizersTextNumber.StringUtility.isNullOrEmpty(match.groups('iam').value)) { + if (hour >= 12) { + hour -= 12; + } + if (recognizersTextNumber.RegExpUtility.getMatches(this.config.utilityConfiguration.amPmDescRegex, descStr).length === 0) { + hasAm = true; + } + } + else if (recognizersTextNumber.RegExpUtility.getMatches(this.config.utilityConfiguration.pmDescRegex, descStr).length > 0 + || !recognizersTextNumber.StringUtility.isNullOrEmpty(match.groups('ipm').value)) { + if (hour < 12) { + hour += 12; + } + hasPm = true; + } + // adjust min by prefix + let timePrefix = match.groups('prefix').value.toLowerCase(); + if (!recognizersTextNumber.StringUtility.isNullOrWhitespace(timePrefix)) { + let adjust = { hour: hour, min: min, hasMin: hasMin }; + this.config.adjustByPrefix(timePrefix, adjust); + hour = adjust.hour; + min = adjust.min; + hasMin = adjust.hasMin; + } + // adjust hour by suffix + let timeSuffix = match.groups('suffix').value.toLowerCase(); + if (!recognizersTextNumber.StringUtility.isNullOrWhitespace(timeSuffix)) { + let adjust = { hour: hour, min: min, hasMin: hasMin, hasAm: hasAm, hasPm: hasPm }; + this.config.adjustBySuffix(timeSuffix, adjust); + hour = adjust.hour; + min = adjust.min; + hasMin = adjust.hasMin; + hasAm = adjust.hasAm; + hasPm = adjust.hasPm; + } + if (hour === 24) { + hour = 0; + } + ret.timex = "T" + utilities$2.FormatUtil.toString(hour, 2); + if (hasMin) { + ret.timex += ":" + utilities$2.FormatUtil.toString(min, 2); + } + if (hasSec) { + ret.timex += ":" + utilities$2.FormatUtil.toString(second, 2); + } + if (hour <= 12 && !hasPm && !hasAm && !hasMid) { + ret.comment = "ampm"; + } + ret.futureValue = ret.pastValue = new Date(year, month, day, hour, min, second); + ret.success = true; + return ret; + } +} +exports.BaseTimeParser = BaseTimeParser; + +}); + +unwrapExports(baseTime); + +var baseDatePeriod = createCommonjsModule(function (module, exports) { +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); + + + + +class BaseDatePeriodExtractor { + constructor(config) { + this.extractorName = constants$2.Constants.SYS_DATETIME_DATEPERIOD; + this.config = config; + } + extract(source, refDate) { + if (!refDate) + refDate = new Date(); + let referenceDate = refDate; + let tokens = new Array(); + tokens = tokens.concat(this.matchSimpleCases(source)); + tokens = tokens.concat(this.mergeTwoTimePoints(source, referenceDate)); + tokens = tokens.concat(this.matchDuration(source, referenceDate)); + tokens = tokens.concat(this.singleTimePointWithPatterns(source, referenceDate)); + let result = utilities$2.Token.mergeAllTokens(tokens, source, this.extractorName); + return result; + } + matchSimpleCases(source) { + let tokens = new Array(); + this.config.simpleCasesRegexes.forEach(regexp => { + recognizersText.RegExpUtility.getMatches(regexp, source).forEach(match => { + let addToken = true; + let matchYear = recognizersText.RegExpUtility.getMatches(this.config.YearRegex, match.value).pop(); + if (matchYear && matchYear.length === match.value.length) { + let yearStr = matchYear.groups('year').value; + if (recognizersText.StringUtility.isNullOrEmpty(yearStr)) { + let year = this.getYearFromText(matchYear); + if (!(year >= constants$2.Constants.MinYearNum && year <= constants$2.Constants.MaxYearNum)) { + addToken = false; + } + } + } + if (match.length === constants$2.Constants.FourDigitsYearLength && recognizersText.RegExpUtility.isMatch(this.config.YearRegex, match.value) && this.infixBoundaryCheck(match, source)) { + let substr = source.substr(match.index - 1, 6); + if (recognizersText.RegExpUtility.isMatch(this.config.illegalYearRegex, substr)) { + addToken = false; + } + } + if (addToken) { + tokens.push(new utilities$2.Token(match.index, match.index + match.length)); + } + }); + }); + return tokens; + } + getYearFromText(match) { + let firstTwoYearNumStr = match.groups('firsttwoyearnum').value; + if (!recognizersText.StringUtility.isNullOrEmpty(firstTwoYearNumStr)) { + let er = new recognizersText.ExtractResult(); + er.text = firstTwoYearNumStr; + er.start = match.groups('firsttwoyearnum').index; + er.length = match.groups('firsttwoyearnum').length; + let firstTwoYearNum = Number.parseInt(this.config.numberParser.parse(er).value); + let lastTwoYearNum = 0; + let lastTwoYearNumStr = match.groups('lasttwoyearnum').value; + if (!recognizersText.StringUtility.isNullOrEmpty(lastTwoYearNumStr)) { + er.text = lastTwoYearNumStr; + er.start = match.groups('lasttwoyearnum').index; + er.length = match.groups('lasttwoyearnum').length; + lastTwoYearNum = Number.parseInt(this.config.numberParser.parse(er).value); + } + if (firstTwoYearNum < 100 && lastTwoYearNum === 0 || firstTwoYearNum < 100 && firstTwoYearNum % 10 === 0 && lastTwoYearNumStr.trim().split(' ').length === 1) { + return -1; + } + if (firstTwoYearNum >= 100) { + return (firstTwoYearNum + lastTwoYearNum); + } + else { + return (firstTwoYearNum * 100 + lastTwoYearNum); + } + } + else { + return -1; + } + } + mergeTwoTimePoints(source, refDate) { + let tokens = new Array(); + let er = this.config.datePointExtractor.extract(source, refDate); + if (er.length <= 1) { + return tokens; + } + let idx = 0; + while (idx < er.length - 1) { + let middleBegin = er[idx].start + (er[idx].length || 0); + let middleEnd = er[idx + 1].start || 0; + if (middleBegin >= middleEnd) { + idx++; + continue; + } + let middleStr = source.substr(middleBegin, middleEnd - middleBegin).trim().toLowerCase(); + let match = recognizersText.RegExpUtility.getMatches(this.config.tillRegex, middleStr); + if (match && match.length > 0 && match[0].index === 0 && match[0].length === middleStr.length) { + let periodBegin = er[idx].start || 0; + let periodEnd = (er[idx + 1].start || 0) + (er[idx + 1].length || 0); + let beforeStr = source.substring(0, periodBegin).trim().toLowerCase(); + let fromTokenIndex = this.config.getFromTokenIndex(beforeStr); + let betweenTokenIndex = this.config.getBetweenTokenIndex(beforeStr); + if (fromTokenIndex.matched || betweenTokenIndex.matched) { + periodBegin = fromTokenIndex.matched ? fromTokenIndex.index : betweenTokenIndex.index; + } + tokens.push(new utilities$2.Token(periodBegin, periodEnd)); + idx += 2; + continue; + } + if (this.config.hasConnectorToken(middleStr)) { + let periodBegin = er[idx].start || 0; + let periodEnd = (er[idx + 1].start || 0) + (er[idx + 1].length || 0); + let beforeStr = source.substring(0, periodBegin).trim().toLowerCase(); + let betweenTokenIndex = this.config.getBetweenTokenIndex(beforeStr); + if (betweenTokenIndex.matched) { + periodBegin = betweenTokenIndex.index; + tokens.push(new utilities$2.Token(periodBegin, periodEnd)); + idx += 2; + continue; + } + } + idx++; + } + return tokens; + } + matchDuration(source, refDate) { + let tokens = new Array(); + let durations = new Array(); + this.config.durationExtractor.extract(source, refDate).forEach(durationEx => { + let match = recognizersText.RegExpUtility.getMatches(this.config.dateUnitRegex, durationEx.text).pop(); + if (match) { + durations.push(new utilities$2.Token(durationEx.start, durationEx.start + durationEx.length)); + } + }); + durations.forEach(duration => { + let beforeStr = source.substring(0, duration.start).toLowerCase(); + if (recognizersText.StringUtility.isNullOrWhitespace(beforeStr)) + return; + let match = recognizersText.RegExpUtility.getMatches(this.config.pastRegex, beforeStr).pop(); + if (this.matchRegexInPrefix(beforeStr, match)) { + tokens.push(new utilities$2.Token(match.index, duration.end)); + return; + } + match = recognizersText.RegExpUtility.getMatches(this.config.futureRegex, beforeStr).pop(); + if (this.matchRegexInPrefix(beforeStr, match)) { + tokens.push(new utilities$2.Token(match.index, duration.end)); + return; + } + match = recognizersText.RegExpUtility.getMatches(this.config.inConnectorRegex, beforeStr).pop(); + if (this.matchRegexInPrefix(beforeStr, match)) { + let rangeStr = source.substr(duration.start, duration.length); + let rangeMatch = recognizersText.RegExpUtility.getMatches(this.config.rangeUnitRegex, rangeStr).pop(); + if (rangeMatch) { + tokens.push(new utilities$2.Token(match.index, duration.end)); + } + return; + } + }); + return tokens; + } + singleTimePointWithPatterns(source, refDate) { + let tokens = new Array(); + let ers = this.config.datePointExtractor.extract(source, refDate); + if (ers.length < 1) + return tokens; + ers.forEach(er => { + if (er.start && er.length) { + let beforeStr = source.substring(0, er.start); + tokens = tokens + .concat(this.getTokenForRegexMatching(beforeStr, this.config.weekOfRegex, er)) + .concat(this.getTokenForRegexMatching(beforeStr, this.config.monthOfRegex, er)); + } + }); + return tokens; + } + getTokenForRegexMatching(source, regexp, er) { + let tokens = new Array(); + let match = recognizersText.RegExpUtility.getMatches(regexp, source).shift(); + if (match && source.trim().endsWith(match.value.trim())) { + let startIndex = source.lastIndexOf(match.value); + tokens.push(new utilities$2.Token(startIndex, er.start + er.length)); + } + return tokens; + } + matchRegexInPrefix(source, match) { + return (match && recognizersText.StringUtility.isNullOrWhitespace(source.substring(match.index + match.length))); + } + infixBoundaryCheck(match, source) { + let isMatchInfixOfSource = false; + if (match.index > 0 && match.index + match.length < source.length) { + if (source.substr(match.index, match.length) === match.value) { + isMatchInfixOfSource = true; + } + } + return isMatchInfixOfSource; + } +} +exports.BaseDatePeriodExtractor = BaseDatePeriodExtractor; +class BaseDatePeriodParser { + constructor(config, inclusiveEndPeriod = false) { + this.parserName = constants$2.Constants.SYS_DATETIME_DATEPERIOD; + this.weekOfComment = 'WeekOf'; + this.monthOfComment = 'MonthOf'; + this.config = config; + this.inclusiveEndPeriod = inclusiveEndPeriod; + } + parse(extractorResult, referenceDate) { + if (!referenceDate) + referenceDate = new Date(); + let resultValue; + if (extractorResult.type === this.parserName) { + let source = extractorResult.text.trim().toLowerCase(); + let innerResult = this.parseMonthWithYear(source, referenceDate); + if (!innerResult.success) { + innerResult = this.parseSimpleCases(source, referenceDate); + } + if (!innerResult.success) { + innerResult = this.parseOneWordPeriod(source, referenceDate); + } + if (!innerResult.success) { + innerResult = this.mergeTwoTimePoints(source, referenceDate); + } + if (!innerResult.success) { + innerResult = this.parseYear(source, referenceDate); + } + if (!innerResult.success) { + innerResult = this.parseWeekOfMonth(source, referenceDate); + } + if (!innerResult.success) { + innerResult = this.parseWeekOfYear(source, referenceDate); + } + if (!innerResult.success) { + innerResult = this.parseHalfYear(source, referenceDate); + } + if (!innerResult.success) { + innerResult = this.parseQuarter(source, referenceDate); + } + if (!innerResult.success) { + innerResult = this.parseSeason(source, referenceDate); + } + if (!innerResult.success) { + innerResult = this.parseWhichWeek(source, referenceDate); + } + if (!innerResult.success) { + innerResult = this.parseWeekOfDate(source, referenceDate); + } + if (!innerResult.success) { + innerResult = this.parseMonthOfDate(source, referenceDate); + } + // parse duration should be at the end since it will extract "the last week" from "the last week of July" + if (!innerResult.success) { + innerResult = this.parseDuration(source, referenceDate); + } + if (innerResult.success) { + if (innerResult.futureValue && innerResult.pastValue) { + innerResult.futureResolution = {}; + innerResult.futureResolution[constants$2.TimeTypeConstants.START_DATE] = utilities$2.FormatUtil.formatDate(innerResult.futureValue[0]); + innerResult.futureResolution[constants$2.TimeTypeConstants.END_DATE] = utilities$2.FormatUtil.formatDate(innerResult.futureValue[1]); + innerResult.pastResolution = {}; + innerResult.pastResolution[constants$2.TimeTypeConstants.START_DATE] = utilities$2.FormatUtil.formatDate(innerResult.pastValue[0]); + innerResult.pastResolution[constants$2.TimeTypeConstants.END_DATE] = utilities$2.FormatUtil.formatDate(innerResult.pastValue[1]); + } + else { + innerResult.futureResolution = {}; + innerResult.pastResolution = {}; + } + resultValue = innerResult; + } + } + let result = new parsers$4.DateTimeParseResult(extractorResult); + result.value = resultValue; + result.timexStr = resultValue ? resultValue.timex : ''; + result.resolutionStr = ''; + return result; + } + parseMonthWithYear(source, referenceDate) { + let trimmedSource = source.trim().toLowerCase(); + let result = new utilities$2.DateTimeResolutionResult(); + let match = recognizersText.RegExpUtility.getMatches(this.config.monthWithYear, trimmedSource).pop(); + if (!match) { + match = recognizersText.RegExpUtility.getMatches(this.config.monthNumWithYear, trimmedSource).pop(); + } + if (!match || match.length !== trimmedSource.length) + return result; + let monthStr = match.groups('month').value; + let yearStr = match.groups('year').value; + let orderStr = match.groups('order').value; + let month = this.config.monthOfYear.get(monthStr) - 1; + let year = Number.parseInt(yearStr, 10); + if (!year || isNaN(year)) { + let swift = this.config.getSwiftYear(orderStr); + if (swift < -1) + return result; + year = referenceDate.getFullYear() + swift; + } + let beginDate = utilities$2.DateUtils.safeCreateFromValue(utilities$2.DateUtils.minValue(), year, month, 1); + let endDate = utilities$2.DateUtils.addDays(utilities$2.DateUtils.addMonths(beginDate, 1), this.inclusiveEndPeriod ? -1 : 0); + result.futureValue = [beginDate, endDate]; + result.pastValue = [beginDate, endDate]; + result.timex = `${utilities$2.FormatUtil.toString(year, 4)}-${utilities$2.FormatUtil.toString(month + 1, 2)}`; + result.success = true; + return result; + } + getMatchSimpleCase(source) { + let match = recognizersText.RegExpUtility.getMatches(this.config.monthFrontBetweenRegex, source).pop(); + if (!match) { + match = recognizersText.RegExpUtility.getMatches(this.config.betweenRegex, source).pop(); + } + if (!match) { + match = recognizersText.RegExpUtility.getMatches(this.config.monthFrontSimpleCasesRegex, source).pop(); + } + if (!match) { + match = recognizersText.RegExpUtility.getMatches(this.config.simpleCasesRegex, source).pop(); + } + return match; + } + parseSimpleCases(source, referenceDate) { + let result = new utilities$2.DateTimeResolutionResult(); + let year = referenceDate.getFullYear(); + let month = referenceDate.getMonth(); + let noYear = true; + let match = this.getMatchSimpleCase(source); + if (!match || match.index !== 0 || match.length !== source.length) + return result; + let days = match.groups('day'); + let beginDay = this.config.dayOfMonth.get(days.captures[0]); + let endDay = this.config.dayOfMonth.get(days.captures[1]); + let yearStr = match.groups('year').value; + if (!recognizersText.StringUtility.isNullOrEmpty(yearStr)) { + year = Number.parseInt(yearStr, 10); + noYear = false; + } + let monthStr = match.groups('month').value; + if (!recognizersText.StringUtility.isNullOrEmpty(monthStr)) { + month = this.config.monthOfYear.get(monthStr) - 1; + } + else { + monthStr = match.groups('relmonth').value; + month += this.config.getSwiftDayOrMonth(monthStr); + if (month < 0) { + month = 0; + year--; + } + else if (month > 11) { + month = 11; + year++; + } + if (this.config.isFuture(monthStr)) { + noYear = false; + } + } + let beginDateLuis = utilities$2.FormatUtil.luisDate(noYear ? -1 : year, month, beginDay); + let endDateLuis = utilities$2.FormatUtil.luisDate(noYear ? -1 : year, month, endDay); + let futureYear = year; + let pastYear = year; + let startDate = utilities$2.DateUtils.safeCreateFromValue(utilities$2.DateUtils.minValue(), year, month, beginDay); + if (noYear && startDate < referenceDate) + futureYear++; + if (noYear && startDate >= referenceDate) + pastYear--; + result.timex = `(${beginDateLuis},${endDateLuis},P${endDay - beginDay}D)`; + result.futureValue = [ + utilities$2.DateUtils.safeCreateFromValue(utilities$2.DateUtils.minValue(), futureYear, month, beginDay), + utilities$2.DateUtils.safeCreateFromValue(utilities$2.DateUtils.minValue(), futureYear, month, endDay), + ]; + result.pastValue = [ + utilities$2.DateUtils.safeCreateFromValue(utilities$2.DateUtils.minValue(), pastYear, month, beginDay), + utilities$2.DateUtils.safeCreateFromValue(utilities$2.DateUtils.minValue(), pastYear, month, endDay), + ]; + result.success = true; + return result; + } + parseOneWordPeriod(source, referenceDate) { + let result = new utilities$2.DateTimeResolutionResult(); + let year = referenceDate.getFullYear(); + let month = referenceDate.getMonth(); + let earlyPrefix = false; + let latePrefix = false; + let earlierPrefix = false; + let laterPrefix = false; + if (this.config.isYearToDate(source)) { + result.timex = utilities$2.FormatUtil.toString(year, 4); + result.futureValue = [utilities$2.DateUtils.safeCreateFromValue(utilities$2.DateUtils.minValue(), year, 0, 1), referenceDate]; + result.pastValue = [utilities$2.DateUtils.safeCreateFromValue(utilities$2.DateUtils.minValue(), year, 0, 1), referenceDate]; + result.success = true; + return result; + } + if (this.config.isMonthToDate(source)) { + result.timex = `${utilities$2.FormatUtil.toString(year, 4)}-${utilities$2.FormatUtil.toString(month + 1, 2)}`; + result.futureValue = [utilities$2.DateUtils.safeCreateFromValue(utilities$2.DateUtils.minValue(), year, month, 1), referenceDate]; + result.pastValue = [utilities$2.DateUtils.safeCreateFromValue(utilities$2.DateUtils.minValue(), year, month, 1), referenceDate]; + result.success = true; + return result; + } + let futureYear = year; + let pastYear = year; + let trimedText = source.trim().toLowerCase(); + let match = recognizersText.RegExpUtility.getMatches(this.config.oneWordPeriodRegex, trimedText).pop(); + if (!(match && match.index === 0 && match.length === trimedText.length)) { + match = recognizersText.RegExpUtility.getMatches(this.config.laterEarlyPeriodRegex, trimedText).pop(); + } + if (!match || match.index !== 0 || match.length !== trimedText.length) + return result; + if (match.groups("EarlyPrefix").value) { + earlyPrefix = true; + trimedText = match.groups("suffix").value; + result.mod = constants$2.Constants.EARLY_MOD; + } + if (match.groups("LatePrefix").value) { + latePrefix = true; + trimedText = match.groups("suffix").value; + result.mod = constants$2.Constants.LATE_MOD; + } + if (match.groups("MidPrefix").value) { + latePrefix = true; + trimedText = match.groups("suffix").value; + result.mod = constants$2.Constants.MID_MOD; + } + if (match.groups("RelEarly").value) { + earlierPrefix = true; + result.mod = null; + } + if (match.groups("RelLate").value) { + laterPrefix = true; + result.mod = null; + } + let monthStr = match.groups('month').value; + if (!recognizersText.StringUtility.isNullOrEmpty(monthStr)) { + let swift = this.config.getSwiftYear(trimedText); + month = this.config.monthOfYear.get(monthStr) - 1; + if (swift >= -1) { + result.timex = `${utilities$2.FormatUtil.toString(year + swift, 4)}-${utilities$2.FormatUtil.toString(month + 1, 2)}`; + year += swift; + futureYear = year; + pastYear = year; + } + else { + result.timex = `XXXX-${utilities$2.FormatUtil.toString(month + 1, 2)}`; + if (month < referenceDate.getMonth()) + futureYear++; + if (month >= referenceDate.getMonth()) + pastYear--; + } + } + else { + let swift = this.config.getSwiftDayOrMonth(trimedText); + if (this.config.isWeekOnly(trimedText)) { + let monday = utilities$2.DateUtils.addDays(utilities$2.DateUtils.this(referenceDate, utilities$2.DayOfWeek.Monday), 7 * swift); + result.timex = `${utilities$2.FormatUtil.toString(monday.getFullYear(), 4)}-W${utilities$2.FormatUtil.toString(utilities$2.DateUtils.getWeekNumber(monday).weekNo, 2)}`; + let beginDate = utilities$2.DateUtils.addDays(utilities$2.DateUtils.this(referenceDate, utilities$2.DayOfWeek.Monday), 7 * swift); + let endDate = this.inclusiveEndPeriod + ? utilities$2.DateUtils.addDays(utilities$2.DateUtils.this(referenceDate, utilities$2.DayOfWeek.Sunday), 7 * swift) + : utilities$2.DateUtils.addDays(utilities$2.DateUtils.addDays(utilities$2.DateUtils.this(referenceDate, utilities$2.DayOfWeek.Sunday), 7 * swift), 1); + if (earlyPrefix) { + endDate = this.inclusiveEndPeriod + ? utilities$2.DateUtils.addDays(utilities$2.DateUtils.this(referenceDate, utilities$2.DayOfWeek.Wednesday), 7 * swift) + : utilities$2.DateUtils.addDays(utilities$2.DateUtils.addDays(utilities$2.DateUtils.this(referenceDate, utilities$2.DayOfWeek.Wednesday), 7 * swift), 1); + } + if (latePrefix) { + beginDate = utilities$2.DateUtils.addDays(utilities$2.DateUtils.this(referenceDate, utilities$2.DayOfWeek.Thursday), 7 * swift); + } + if (earlierPrefix && swift === 0) { + if (endDate > referenceDate) { + endDate = referenceDate; + } + } + else if (laterPrefix && swift === 0) { + if (beginDate < referenceDate) { + beginDate = referenceDate; + } + } + result.futureValue = [beginDate, endDate]; + result.pastValue = [beginDate, endDate]; + result.success = true; + return result; + } + if (this.config.isWeekend(trimedText)) { + let beginDate = utilities$2.DateUtils.addDays(utilities$2.DateUtils.this(referenceDate, utilities$2.DayOfWeek.Saturday), 7 * swift); + let endDate = utilities$2.DateUtils.addDays(utilities$2.DateUtils.this(referenceDate, utilities$2.DayOfWeek.Sunday), (7 * swift) + (this.inclusiveEndPeriod ? 0 : 1)); + result.timex = `${utilities$2.FormatUtil.toString(beginDate.getFullYear(), 4)}-W${utilities$2.FormatUtil.toString(utilities$2.DateUtils.getWeekNumber(beginDate).weekNo, 2)}-WE`; + result.futureValue = [beginDate, endDate]; + result.pastValue = [beginDate, endDate]; + result.success = true; + return result; + } + if (this.config.isMonthOnly(trimedText)) { + let tempDate = new Date(referenceDate); + tempDate.setMonth(referenceDate.getMonth() + swift); + month = tempDate.getMonth(); + year = tempDate.getFullYear(); + result.timex = `${utilities$2.FormatUtil.toString(year, 4)}-${utilities$2.FormatUtil.toString(month + 1, 2)}`; + futureYear = year; + pastYear = year; + } + else if (this.config.isYearOnly(trimedText)) { + let tempDate = new Date(referenceDate); + tempDate.setFullYear(referenceDate.getFullYear() + swift); + year = tempDate.getFullYear(); + let beginDate = utilities$2.DateUtils.safeCreateFromMinValue(year, 0, 1); + let endDate = this.inclusiveEndPeriod + ? utilities$2.DateUtils.safeCreateFromMinValue(year, 11, 31) + : utilities$2.DateUtils.addDays(utilities$2.DateUtils.safeCreateFromMinValue(year, 11, 31), 1); + if (earlyPrefix) { + endDate = this.inclusiveEndPeriod + ? utilities$2.DateUtils.safeCreateFromMinValue(year, 5, 30) + : utilities$2.DateUtils.addDays(utilities$2.DateUtils.safeCreateFromMinValue(year, 5, 30), 1); + } + if (latePrefix) { + beginDate = utilities$2.DateUtils.safeCreateFromMinValue(year, 6, 1); + } + if (earlierPrefix && swift === 0) { + if (endDate > referenceDate) { + endDate = referenceDate; + } + } + else if (laterPrefix && swift === 0) { + if (beginDate < referenceDate) { + beginDate = referenceDate; + } + } + result.timex = utilities$2.FormatUtil.toString(year, 4); + result.futureValue = [beginDate, endDate]; + result.pastValue = [beginDate, endDate]; + result.success = true; + return result; + } + } + // only "month" will come to here + let futureStart = utilities$2.DateUtils.safeCreateFromMinValue(futureYear, month, 1); + let futureEnd = this.inclusiveEndPeriod + ? utilities$2.DateUtils.addDays(utilities$2.DateUtils.addMonths(utilities$2.DateUtils.safeCreateFromMinValue(futureYear, month, 1), 1), -1) + : utilities$2.DateUtils.addMonths(utilities$2.DateUtils.safeCreateFromMinValue(futureYear, month, 1), 1); + let pastStart = utilities$2.DateUtils.safeCreateFromMinValue(pastYear, month, 1); + let pastEnd = this.inclusiveEndPeriod + ? utilities$2.DateUtils.addDays(utilities$2.DateUtils.addMonths(utilities$2.DateUtils.safeCreateFromMinValue(pastYear, month, 1), 1), -1) + : utilities$2.DateUtils.addMonths(utilities$2.DateUtils.safeCreateFromMinValue(pastYear, month, 1), 1); + if (earlyPrefix) { + futureEnd = this.inclusiveEndPeriod + ? utilities$2.DateUtils.safeCreateFromMinValue(futureYear, month, 15) + : utilities$2.DateUtils.addDays(utilities$2.DateUtils.safeCreateFromMinValue(futureYear, month, 15), 1); + pastEnd = this.inclusiveEndPeriod + ? utilities$2.DateUtils.safeCreateFromMinValue(pastYear, month, 15) + : utilities$2.DateUtils.addDays(utilities$2.DateUtils.safeCreateFromMinValue(pastYear, month, 15), 1); + } + else if (latePrefix) { + futureStart = utilities$2.DateUtils.safeCreateFromMinValue(futureYear, month, 16); + pastStart = utilities$2.DateUtils.safeCreateFromMinValue(pastYear, month, 16); + } + if (earlierPrefix && futureYear === pastYear) { + if (futureEnd > referenceDate) { + futureEnd = pastEnd = referenceDate; + } + } + else if (laterPrefix && futureYear === pastYear) { + if (futureStart < referenceDate) { + futureStart = pastStart = referenceDate; + } + } + result.futureValue = [futureStart, futureEnd]; + result.pastValue = [pastStart, pastEnd]; + result.success = true; + return result; + } + mergeTwoTimePoints(source, referenceDate) { + let trimmedSource = source.trim(); + let result = new utilities$2.DateTimeResolutionResult(); + let ers = this.config.dateExtractor.extract(trimmedSource, referenceDate); + if (!ers || ers.length < 2) { + ers = this.config.dateExtractor.extract(this.config.tokenBeforeDate + trimmedSource, referenceDate) + .map(er => { + er.start -= this.config.tokenBeforeDate.length; + return er; + }); + if (!ers || ers.length < 2) + return result; + } + let match = recognizersText.RegExpUtility.getMatches(this.config.weekWithWeekDayRangeRegex, source).pop(); + let weekPrefix = null; + if (match) { + weekPrefix = match.groups("week").value; + } + if (!recognizersText.StringUtility.isNullOrWhitespace(weekPrefix)) { + ers[0].text = weekPrefix + " " + ers[0].text; + ers[1].text = weekPrefix + " " + ers[1].text; + } + let prs = ers.map(er => this.config.dateParser.parse(er, referenceDate)).filter(pr => pr); + if (prs.length < 2) + return result; + let prBegin = prs[0]; + let prEnd = prs[1]; + let futureBegin = prBegin.value.futureValue; + let futureEnd = prEnd.value.futureValue; + let pastBegin = prBegin.value.pastValue; + let pastEnd = prEnd.value.pastValue; + result.subDateTimeEntities = prs; + result.timex = `(${prBegin.timexStr},${prEnd.timexStr},P${utilities$2.DateUtils.diffDays(futureEnd, futureBegin)}D)`; + result.futureValue = [futureBegin, futureEnd]; + result.pastValue = [pastBegin, pastEnd]; + result.success = true; + return result; + } + parseYear(source, referenceDate) { + let trimmedSource = source.trim(); + let result = new utilities$2.DateTimeResolutionResult(); + let match = recognizersText.RegExpUtility.getMatches(this.config.yearRegex, trimmedSource).pop(); + if (!match || match.length !== trimmedSource.length) + return result; + let year = Number.parseInt(match.value, 10); + let beginDate = utilities$2.DateUtils.safeCreateFromValue(utilities$2.DateUtils.minValue(), year, 0, 1); + let endDate = utilities$2.DateUtils.addDays(utilities$2.DateUtils.safeCreateFromValue(utilities$2.DateUtils.minValue(), year + 1, 0, 1), this.inclusiveEndPeriod ? -1 : 0); + result.timex = utilities$2.FormatUtil.toString(year, 4); + result.futureValue = [beginDate, endDate]; + result.pastValue = [beginDate, endDate]; + result.success = true; + return result; + } + parseDuration(source, referenceDate) { + let result = new utilities$2.DateTimeResolutionResult(); + let ers = this.config.durationExtractor.extract(source, referenceDate); + let beginDate = new Date(referenceDate); + let endDate = new Date(referenceDate); + let restNowSunday = false; + let durationTimex = ''; + if (ers.length === 1) { + let pr = this.config.durationParser.parse(ers[0]); + if (pr === null) + return result; + let beforeStr = source.substr(0, pr.start).trim(); + let mod; + let durationResult = pr.value; + if (recognizersText.StringUtility.isNullOrEmpty(durationResult.timex)) + return result; + let prefixMatch = recognizersText.RegExpUtility.getMatches(this.config.pastRegex, beforeStr).pop(); + if (prefixMatch) { + mod = constants$2.TimeTypeConstants.beforeMod; + beginDate = this.getSwiftDate(endDate, durationResult.timex, false); + } + prefixMatch = recognizersText.RegExpUtility.getMatches(this.config.futureRegex, beforeStr).pop(); + if (prefixMatch && prefixMatch.length === beforeStr.length) { + mod = constants$2.TimeTypeConstants.afterMod; + // for future the beginDate should add 1 first + beginDate = new Date(referenceDate.getFullYear(), referenceDate.getMonth(), referenceDate.getDate() + 1); + endDate = this.getSwiftDate(beginDate, durationResult.timex, true); + } + prefixMatch = recognizersText.RegExpUtility.getMatches(this.config.inConnectorRegex, beforeStr).pop(); + if (prefixMatch && prefixMatch.length === beforeStr.length) { + mod = constants$2.TimeTypeConstants.afterMod; + beginDate = new Date(referenceDate.getFullYear(), referenceDate.getMonth(), referenceDate.getDate() + 1); + endDate = this.getSwiftDate(beginDate, durationResult.timex, true); + let unit = durationResult.timex.substr(durationResult.timex.length - 1); + durationResult.timex = `P1${unit}`; + beginDate = this.getSwiftDate(endDate, durationResult.timex, false); + } + if (mod) { + pr.value.mod = mod; + } + durationTimex = durationResult.timex; + result.subDateTimeEntities = [pr]; + } + // parse rest of + let match = recognizersText.RegExpUtility.getMatches(this.config.restOfDateRegex, source).pop(); + if (match) { + let diffDays = 0; + let durationStr = match.groups('duration').value; + let durationUnit = this.config.unitMap.get(durationStr); + switch (durationUnit) { + case 'W': + diffDays = 7 - ((beginDate.getDay() === 0) ? 7 : beginDate.getDay()); + endDate = utilities$2.DateUtils.addDays(referenceDate, diffDays); + restNowSunday = (diffDays === 0); + break; + case 'MON': + endDate = utilities$2.DateUtils.safeCreateFromMinValue(beginDate.getFullYear(), beginDate.getMonth(), 1); + endDate.setMonth(beginDate.getMonth() + 1); + endDate.setDate(endDate.getDate() - 1); + diffDays = endDate.getDate() - beginDate.getDate() + 1; + break; + case 'Y': + endDate = utilities$2.DateUtils.safeCreateFromMinValue(beginDate.getFullYear(), 11, 1); + endDate.setMonth(endDate.getMonth() + 1); + endDate.setDate(endDate.getDate() - 1); + diffDays = utilities$2.DateUtils.dayOfYear(endDate) - utilities$2.DateUtils.dayOfYear(beginDate) + 1; + break; + } + durationTimex = `P${diffDays}D`; + } + if (beginDate.getTime() !== endDate.getTime() || restNowSunday) { + endDate = utilities$2.DateUtils.addDays(endDate, this.inclusiveEndPeriod ? -1 : 0); + result.timex = `(${utilities$2.FormatUtil.luisDateFromDate(beginDate)},${utilities$2.FormatUtil.luisDateFromDate(endDate)},${durationTimex})`; + result.futureValue = [beginDate, endDate]; + result.pastValue = [beginDate, endDate]; + result.success = true; + } + return result; + } + getSwiftDate(date, timex, isPositiveSwift) { + let result = new Date(date); + let numStr = timex.replace('P', '').substr(0, timex.length - 2); + let unitStr = timex.substr(timex.length - 1); + let swift = Number.parseInt(numStr, 10) || 0; + if (swift === 0) + return result; + if (!isPositiveSwift) + swift *= -1; + switch (unitStr) { + case 'D': + result.setDate(date.getDate() + swift); + break; + case 'W': + result.setDate(date.getDate() + (7 * swift)); + break; + case 'M': + result.setMonth(date.getMonth() + swift); + break; + case 'Y': + result.setFullYear(date.getFullYear() + swift); + break; + } + return result; + } + parseWeekOfMonth(source, referenceDate) { + let result = new utilities$2.DateTimeResolutionResult(); + let match = recognizersText.RegExpUtility.getMatches(this.config.weekOfMonthRegex, source).pop(); + if (!match || match.length !== source.length) + return result; + let cardinalStr = match.groups('cardinal').value; + let monthStr = match.groups('month').value; + let month = referenceDate.getMonth(); + let year = referenceDate.getFullYear(); + let noYear = false; + let cardinal = this.config.isLastCardinal(cardinalStr) ? 5 + : this.config.cardinalMap.get(cardinalStr); + if (recognizersText.StringUtility.isNullOrEmpty(monthStr)) { + let swift = this.config.getSwiftDayOrMonth(source); + let tempDate = new Date(referenceDate); + tempDate.setMonth(referenceDate.getMonth() + swift); + month = tempDate.getMonth(); + year = tempDate.getFullYear(); + } + else { + month = this.config.monthOfYear.get(monthStr) - 1; + noYear = true; + } + return this.getWeekOfMonth(cardinal, month, year, referenceDate, noYear); + } + getWeekOfMonth(cardinal, month, year, referenceDate, noYear) { + let result = new utilities$2.DateTimeResolutionResult(); + let seedDate = this.computeDate(cardinal, 1, month, year); + if (seedDate.getMonth() !== month) { + cardinal--; + seedDate.setDate(seedDate.getDate() - 7); + } + let futureDate = new Date(seedDate); + let pastDate = new Date(seedDate); + if (noYear && futureDate < referenceDate) { + futureDate = this.computeDate(cardinal, 1, month, year + 1); + if (futureDate.getMonth() !== month) { + futureDate.setDate(futureDate.getDate() - 7); + } + } + if (noYear && pastDate >= referenceDate) { + pastDate = this.computeDate(cardinal, 1, month, year - 1); + if (pastDate.getMonth() !== month) { + pastDate.setDate(pastDate.getDate() - 7); + } + } + result.timex = noYear ? + `XXXX-${utilities$2.FormatUtil.toString(month + 1, 2)}-W${utilities$2.FormatUtil.toString(cardinal, 2)}` : + `${utilities$2.FormatUtil.toString(year, 4)}-${utilities$2.FormatUtil.toString(month + 1, 2)}-W${utilities$2.FormatUtil.toString(cardinal, 2)}`; + result.futureValue = [futureDate, utilities$2.DateUtils.addDays(futureDate, this.inclusiveEndPeriod ? 6 : 7)]; + result.pastValue = [pastDate, utilities$2.DateUtils.addDays(pastDate, this.inclusiveEndPeriod ? 6 : 7)]; + result.success = true; + return result; + } + parseWeekOfYear(source, referenceDate) { + let result = new utilities$2.DateTimeResolutionResult(); + let match = recognizersText.RegExpUtility.getMatches(this.config.weekOfYearRegex, source).pop(); + if (!match || match.length !== source.length) + return result; + let cardinalStr = match.groups('cardinal').value; + let yearStr = match.groups('year').value; + let orderStr = match.groups('order').value; + let year = Number.parseInt(yearStr, 10); + if (isNaN(year)) { + let swift = this.config.getSwiftYear(orderStr); + if (swift < -1) + return result; + year = referenceDate.getFullYear() + swift; + } + let targetWeekMonday; + if (this.config.isLastCardinal(cardinalStr)) { + let lastDay = utilities$2.DateUtils.safeCreateFromMinValue(year, 11, 31); + let lastDayWeekMonday = utilities$2.DateUtils.this(lastDay, utilities$2.DayOfWeek.Monday); + let weekNum = utilities$2.DateUtils.getWeekNumber(lastDay).weekNo; + if (weekNum === 1) { + lastDayWeekMonday = utilities$2.DateUtils.this(utilities$2.DateUtils.addDays(lastDay, -7), utilities$2.DayOfWeek.Monday); + } + targetWeekMonday = lastDayWeekMonday; + weekNum = utilities$2.DateUtils.getWeekNumber(targetWeekMonday).weekNo; + result.timex = `${utilities$2.FormatUtil.toString(year, 4)}-${utilities$2.FormatUtil.toString(targetWeekMonday.getMonth() + 1, 2)}-W${utilities$2.FormatUtil.toString(weekNum, 2)}`; + } + else { + let cardinal = this.config.cardinalMap.get(cardinalStr); + let firstDay = utilities$2.DateUtils.safeCreateFromMinValue(year, 0, 1); + let firstDayWeekMonday = utilities$2.DateUtils.this(firstDay, utilities$2.DayOfWeek.Monday); + let weekNum = utilities$2.DateUtils.getWeekNumber(firstDay).weekNo; + if (weekNum !== 1) { + firstDayWeekMonday = utilities$2.DateUtils.this(utilities$2.DateUtils.addDays(firstDay, 7), utilities$2.DayOfWeek.Monday); + } + targetWeekMonday = utilities$2.DateUtils.addDays(firstDayWeekMonday, 7 * (cardinal - 1)); + let targetWeekSunday = utilities$2.DateUtils.this(targetWeekMonday, utilities$2.DayOfWeek.Sunday); + result.timex = `${utilities$2.FormatUtil.toString(year, 4)}-${utilities$2.FormatUtil.toString(targetWeekSunday.getMonth() + 1, 2)}-W${utilities$2.FormatUtil.toString(cardinal, 2)}`; + } + result.futureValue = [targetWeekMonday, utilities$2.DateUtils.addDays(targetWeekMonday, this.inclusiveEndPeriod ? 6 : 7)]; + result.pastValue = [targetWeekMonday, utilities$2.DateUtils.addDays(targetWeekMonday, this.inclusiveEndPeriod ? 6 : 7)]; + result.success = true; + return result; + } + parseHalfYear(source, referenceDate) { + let result = new utilities$2.DateTimeResolutionResult(); + let match = recognizersText.RegExpUtility.getMatches(this.config.allHalfYearRegex, source).pop(); + if (!match || match.length !== source.length) + return result; + let cardinalStr = match.groups('cardinal').value; + let yearStr = match.groups('year').value; + let orderStr = match.groups('order').value; + let numberStr = match.groups('number').value; + let year = Number.parseInt(yearStr, 10); + if (isNaN(year)) { + let swift = this.config.getSwiftYear(orderStr); + if (swift < -1) { + return result; + } + year = referenceDate.getFullYear() + swift; + } + let quarterNum; + if (!numberStr) { + quarterNum = this.config.cardinalMap.get(cardinalStr); + } + else { + quarterNum = parseInt(numberStr); + } + let beginDate = utilities$2.DateUtils.safeCreateDateResolveOverflow(year, (quarterNum - 1) * constants$2.Constants.SemesterMonthCount, 1); + let endDate = utilities$2.DateUtils.safeCreateDateResolveOverflow(year, quarterNum * constants$2.Constants.SemesterMonthCount, 1); + result.futureValue = [beginDate, endDate]; + result.pastValue = [beginDate, endDate]; + result.timex = `(${utilities$2.FormatUtil.luisDateFromDate(beginDate)},${utilities$2.FormatUtil.luisDateFromDate(endDate)},P6M)`; + result.success = true; + return result; + } + parseQuarter(source, referenceDate) { + let result = new utilities$2.DateTimeResolutionResult(); + let match = recognizersText.RegExpUtility.getMatches(this.config.quarterRegex, source).pop(); + if (!match || match.length !== source.length) { + match = recognizersText.RegExpUtility.getMatches(this.config.quarterRegexYearFront, source).pop(); + } + if (!match || match.length !== source.length) + return result; + let cardinalStr = match.groups('cardinal').value; + let yearStr = match.groups('year').value; + let orderStr = match.groups('order').value; + let numberStr = match.groups('number').value; + let noSpecificYear = false; + let year = Number.parseInt(yearStr, 10); + if (isNaN(year)) { + let swift = this.config.getSwiftYear(orderStr); + if (swift < -1) { + swift = 0; + noSpecificYear = true; + } + year = referenceDate.getFullYear() + swift; + } + let quarterNum; + if (!numberStr) { + quarterNum = this.config.cardinalMap.get(cardinalStr); + } + else { + quarterNum = parseInt(numberStr); + } + let beginDate = utilities$2.DateUtils.safeCreateDateResolveOverflow(year, (quarterNum - 1) * constants$2.Constants.TrimesterMonthCount, 1); + let endDate = utilities$2.DateUtils.safeCreateDateResolveOverflow(year, quarterNum * constants$2.Constants.TrimesterMonthCount, 1); + if (noSpecificYear) { + if (endDate < referenceDate) { + result.pastValue = [beginDate, endDate]; + let futureBeginDate = utilities$2.DateUtils.safeCreateDateResolveOverflow(year + 1, (quarterNum - 1) * constants$2.Constants.TrimesterMonthCount, 1); + let futureEndDate = utilities$2.DateUtils.safeCreateDateResolveOverflow(year + 1, quarterNum * constants$2.Constants.TrimesterMonthCount, 1); + result.futureValue = [futureBeginDate, futureEndDate]; + } + else if (endDate > referenceDate) { + result.futureValue = [beginDate, endDate]; + let pastBeginDate = utilities$2.DateUtils.safeCreateDateResolveOverflow(year - 1, (quarterNum - 1) * constants$2.Constants.TrimesterMonthCount, 1); + let pastEndDate = utilities$2.DateUtils.safeCreateDateResolveOverflow(year - 1, quarterNum * constants$2.Constants.TrimesterMonthCount, 1); + result.pastValue = [pastBeginDate, pastEndDate]; + } + else { + result.futureValue = [beginDate, endDate]; + result.pastValue = [beginDate, endDate]; + } + } + else { + result.futureValue = [beginDate, endDate]; + result.pastValue = [beginDate, endDate]; + } + result.timex = `(${utilities$2.FormatUtil.luisDateFromDate(beginDate)},${utilities$2.FormatUtil.luisDateFromDate(endDate)},P3M)`; + result.success = true; + return result; + } + parseSeason(source, referenceDate) { + let result = new utilities$2.DateTimeResolutionResult(); + let match = recognizersText.RegExpUtility.getMatches(this.config.seasonRegex, source).pop(); + if (!match || match.length !== source.length) + return result; + let swift = this.config.getSwiftYear(source); + let yearStr = match.groups('year').value; + let year = referenceDate.getFullYear(); + let seasonStr = match.groups('seas').value; + let season = this.config.seasonMap.get(seasonStr); + if (swift >= -1 || !recognizersText.StringUtility.isNullOrEmpty(yearStr)) { + if (recognizersText.StringUtility.isNullOrEmpty(yearStr)) + yearStr = utilities$2.FormatUtil.toString(year + swift, 4); + result.timex = `${yearStr}-${season}`; + } + else { + result.timex = season; + } + result.success = true; + return result; + } + parseWhichWeek(source, referenceDate) { + let result = new utilities$2.DateTimeResolutionResult(); + let match = recognizersText.RegExpUtility.getMatches(this.config.whichWeekRegex, source).pop(); + if (!match) + return result; + let num = Number.parseInt(match.groups('number').value, 10); + let year = referenceDate.getFullYear(); + let firstDay = utilities$2.DateUtils.safeCreateFromValue(utilities$2.DateUtils.minValue(), year, 0, 1); + let firstWeekday = utilities$2.DateUtils.this(firstDay, utilities$2.DayOfWeek.Monday); + let resultDate = utilities$2.DateUtils.addDays(firstWeekday, 7 * num); + result.timex = `${utilities$2.FormatUtil.toString(year, 4)}-W${utilities$2.FormatUtil.toString(num, 2)}`; + result.futureValue = [resultDate, utilities$2.DateUtils.addDays(resultDate, 7)]; + result.pastValue = [resultDate, utilities$2.DateUtils.addDays(resultDate, 7)]; + result.success = true; + return result; + } + parseWeekOfDate(source, referenceDate) { + let result = new utilities$2.DateTimeResolutionResult(); + let match = recognizersText.RegExpUtility.getMatches(this.config.weekOfRegex, source).pop(); + let ers = this.config.dateExtractor.extract(source, referenceDate); + if (!match || ers.length !== 1) + return result; + let dateResolution = this.config.dateParser.parse(ers[0], referenceDate).value; + result.timex = dateResolution.timex; + result.comment = this.weekOfComment; + result.futureValue = this.getWeekRangeFromDate(dateResolution.futureValue); + result.pastValue = this.getWeekRangeFromDate(dateResolution.pastValue); + result.success = true; + return result; + } + parseMonthOfDate(source, referenceDate) { + let result = new utilities$2.DateTimeResolutionResult(); + let match = recognizersText.RegExpUtility.getMatches(this.config.monthOfRegex, source).pop(); + let ers = this.config.dateExtractor.extract(source, referenceDate); + if (!match || ers.length !== 1) + return result; + let dateResolution = this.config.dateParser.parse(ers[0], referenceDate).value; + result.timex = dateResolution.timex; + result.comment = this.monthOfComment; + result.futureValue = this.getMonthRangeFromDate(dateResolution.futureValue); + result.pastValue = this.getMonthRangeFromDate(dateResolution.pastValue); + result.success = true; + return result; + } + computeDate(cardinal, weekday, month, year) { + let firstDay = new Date(year, month, 1); + let firstWeekday = utilities$2.DateUtils.this(firstDay, weekday); + if (weekday === 0) + weekday = 7; + let firstDayOfWeek = firstDay.getDay() !== 0 ? firstDay.getDay() : 7; + if (weekday < firstDayOfWeek) + firstWeekday = utilities$2.DateUtils.next(firstDay, weekday); + firstWeekday.setDate(firstWeekday.getDate() + (7 * (cardinal - 1))); + return firstWeekday; + } + getWeekRangeFromDate(seedDate) { + let beginDate = utilities$2.DateUtils.this(seedDate, utilities$2.DayOfWeek.Monday); + let endDate = utilities$2.DateUtils.addDays(beginDate, this.inclusiveEndPeriod ? 6 : 7); + return [beginDate, endDate]; + } + getMonthRangeFromDate(seedDate) { + let beginDate = utilities$2.DateUtils.safeCreateFromValue(utilities$2.DateUtils.minValue(), seedDate.getFullYear(), seedDate.getMonth(), 1); + let endDate = utilities$2.DateUtils.safeCreateFromValue(utilities$2.DateUtils.minValue(), seedDate.getFullYear(), seedDate.getMonth() + 1, 1); + endDate.setDate(endDate.getDate() + (this.inclusiveEndPeriod ? -1 : 0)); + return [beginDate, endDate]; + } +} +exports.BaseDatePeriodParser = BaseDatePeriodParser; + +}); + +unwrapExports(baseDatePeriod); + +var baseTimePeriod = createCommonjsModule(function (module, exports) { +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); + + + + +class BaseTimePeriodExtractor { + constructor(config) { + this.extractorName = constants$2.Constants.SYS_DATETIME_TIMEPERIOD; // "TimePeriod"; + this.config = config; + } + extract(source, refDate) { + if (!refDate) + refDate = new Date(); + let referenceDate = refDate; + let tokens = new Array() + .concat(this.matchSimpleCases(source)) + .concat(this.mergeTwoTimePoints(source, referenceDate)) + .concat(this.matchNight(source)); + let result = utilities$2.Token.mergeAllTokens(tokens, source, this.extractorName); + return result; + } + matchSimpleCases(text) { + let ret = []; + this.config.simpleCasesRegex.forEach(regex => { + let matches = recognizersText.RegExpUtility.getMatches(regex, text); + matches.forEach(match => { + // is there "pm" or "am" ? + let pmStr = match.groups("pm").value; + let amStr = match.groups("am").value; + let descStr = match.groups("desc").value; + // check "pm", "am" + if (pmStr || amStr || descStr) { + ret.push(new utilities$2.Token(match.index, match.index + match.length)); + } + }); + }); + return ret; + } + mergeTwoTimePoints(text, refDate) { + let ret = []; + let ers = this.config.singleTimeExtractor.extract(text, refDate); + let numErs = this.config.integerExtractor.extract(text); + // Check if it is an ending number + if (numErs.length > 0) { + let timeNumbers = []; + // check if it is a ending number + let endingNumber = false; + let num = numErs[numErs.length - 1]; + if (num.start + num.length === text.length) { + endingNumber = true; + } + else { + let afterStr = text.substr(num.start + num.length); + let endingMatch = afterStr.match(this.config.generalEndingRegex); + if (endingMatch) { + endingNumber = true; + } + } + if (endingNumber) { + timeNumbers.push(num); + } + let i = 0; + let j = 0; + while (i < numErs.length) { + // find subsequent time point + let numEndPoint = numErs[i].start + numErs[i].length; + while (j < ers.length && ers[j].start <= numEndPoint) { + j++; + } + if (j >= ers.length) { + break; + } + // check connector string + let midStr = text.substr(numEndPoint, ers[j].start - numEndPoint); + let match = midStr.match(this.config.tillRegex); + if (match && match[0].length === midStr.trim().length) { + timeNumbers.push(numErs[i]); + } + i++; + } + // check overlap + for (let timeNum of timeNumbers) { + let overlap = false; + for (let er of ers) { + if (er.start <= timeNum.start && er.start + er.length >= timeNum.start) { + overlap = true; + } + } + if (!overlap) { + ers.push(timeNum); + } + } + ers = ers.sort((x, y) => (x.start - y.start)); + } + // merge "{TimePoint} to {TimePoint}", "between {TimePoint} and {TimePoint}" + let idx = 0; + while (idx < ers.length - 1) { + let middleBegin = ers[idx].start + ers[idx].length || 0; + let middleEnd = ers[idx + 1].start || 0; + let middleStr = text.substring(middleBegin, middleEnd).trim().toLowerCase(); + let matches = recognizersText.RegExpUtility.getMatches(this.config.tillRegex, middleStr); + // handle "{TimePoint} to {TimePoint}" + if (matches.length > 0 && matches[0].index === 0 && matches[0].length === middleStr.length) { + let periodBegin = ers[idx].start || 0; + let periodEnd = (ers[idx + 1].start || 0) + (ers[idx + 1].length || 0); + // handle "from" + let beforeStr = text.substring(0, periodBegin).trim().toLowerCase(); + let fromIndex = this.config.getFromTokenIndex(beforeStr); + if (fromIndex.matched) { + periodBegin = fromIndex.index; + } + // handle "between" + let betweenIndex = this.config.getBetweenTokenIndex(beforeStr); + if (betweenIndex.matched) { + periodBegin = betweenIndex.index; + } + ret.push(new utilities$2.Token(periodBegin, periodEnd)); + idx += 2; + continue; + } + // handle "between {TimePoint} and {TimePoint}" + if (this.config.hasConnectorToken(middleStr)) { + let periodBegin = ers[idx].start || 0; + let periodEnd = (ers[idx + 1].start || 0) + (ers[idx + 1].length || 0); + // handle "between" + let beforeStr = text.substring(0, periodBegin).trim().toLowerCase(); + let betweenIndex = this.config.getBetweenTokenIndex(beforeStr); + if (betweenIndex.matched) { + periodBegin = betweenIndex.index; + ret.push(new utilities$2.Token(periodBegin, periodEnd)); + idx += 2; + continue; + } + } + idx++; + } + return ret; + } + matchNight(source) { + let ret = []; + let matches = recognizersText.RegExpUtility.getMatches(this.config.timeOfDayRegex, source); + matches.forEach(match => { + ret.push(new utilities$2.Token(match.index, match.index + match.length)); + }); + return ret; + } +} +exports.BaseTimePeriodExtractor = BaseTimePeriodExtractor; +class BaseTimePeriodParser { + constructor(configuration) { + this.config = configuration; + } + parse(er, refTime) { + let referenceTime = refTime || new Date(); + let value = null; + if (er.type === BaseTimePeriodParser.ParserName) { + let innerResult = this.parseSimpleCases(er.text, referenceTime); + if (!innerResult.success) { + innerResult = this.mergeTwoTimePoints(er.text, referenceTime); + } + if (!innerResult.success) { + innerResult = this.parseTimeOfDay(er.text, referenceTime); + } + if (innerResult.success) { + innerResult.futureResolution = {}; + innerResult.futureResolution[constants$2.TimeTypeConstants.START_TIME] = utilities$2.FormatUtil.formatTime(innerResult.futureValue.item1); + innerResult.futureResolution[constants$2.TimeTypeConstants.END_TIME] = utilities$2.FormatUtil.formatTime(innerResult.futureValue.item2); + innerResult.pastResolution = {}; + innerResult.pastResolution[constants$2.TimeTypeConstants.START_TIME] = utilities$2.FormatUtil.formatTime(innerResult.pastValue.item1); + innerResult.pastResolution[constants$2.TimeTypeConstants.END_TIME] = utilities$2.FormatUtil.formatTime(innerResult.pastValue.item2); + value = innerResult; + } + } + let ret = new parsers$4.DateTimeParseResult(er); + ret.value = value; + ret.timexStr = value === null ? "" : value.timex; + ret.resolutionStr = ""; + return ret; + } + parseSimpleCases(source, reference) { + // Cases like "from 3 to 5pm" or "between 4 and 6am", time point is pure number without colon + let result = this.parsePureNumCases(source, reference); + if (!result.success) { + // Cases like "from 3:30 to 5" or "between 3:30am to 6pm", at least one of the time point contains colon + result = this.parseSpecificTimeCases(source, reference); + } + return result; + } + parsePureNumCases(text, referenceTime) { + let ret = new utilities$2.DateTimeResolutionResult(); + let year = referenceTime.getFullYear(); + let month = referenceTime.getMonth(); + let day = referenceTime.getDate(); + let trimmedText = text.trim().toLowerCase(); + let matches = recognizersText.RegExpUtility.getMatches(this.config.pureNumberFromToRegex, trimmedText); + if (!matches.length) { + matches = recognizersText.RegExpUtility.getMatches(this.config.pureNumberBetweenAndRegex, trimmedText); + } + if (matches.length && matches[0].index === 0) { + // this "from .. to .." pattern is valid if followed by a Date OR "pm" + let isValid = false; + // get hours + let hourGroup = matches[0].groups('hour'); + let hourStr = hourGroup.captures[0]; + let afterHourIndex = hourGroup.index + hourGroup.length; + // hard to integrate this part into the regex + if (afterHourIndex === trimmedText.length || !trimmedText.substr(afterHourIndex).trim().startsWith(':')) { + let beginHour = this.config.numbers.get(hourStr); + if (!beginHour) { + beginHour = Number.parseInt(hourStr, 10); + } + hourStr = hourGroup.captures[1]; + afterHourIndex = trimmedText.indexOf(hourStr, hourGroup.index + 1) + hourStr.length; + if (afterHourIndex === trimmedText.length || !trimmedText.substr(afterHourIndex).trim().startsWith(':')) { + let endHour = this.config.numbers.get(hourStr); + if (!endHour) { + endHour = Number.parseInt(hourStr, 10); + } + // parse "pm" + let leftDesc = matches[0].groups("leftDesc").value; + let rightDesc = matches[0].groups("rightDesc").value; + let pmStr = matches[0].groups("pm").value; + let amStr = matches[0].groups("am").value; + // The "ampm" only occurs in time, don't have to consider it here + if (recognizersText.StringUtility.isNullOrWhitespace(leftDesc)) { + let rightAmValid = !recognizersText.StringUtility.isNullOrEmpty(rightDesc) && + recognizersText.RegExpUtility.getMatches(this.config.utilityConfiguration.amDescRegex, rightDesc.toLowerCase()).length; + let rightPmValid = !recognizersText.StringUtility.isNullOrEmpty(rightDesc) && + recognizersText.RegExpUtility.getMatches(this.config.utilityConfiguration.pmDescRegex, rightDesc.toLowerCase()).length; + if (!recognizersText.StringUtility.isNullOrEmpty(amStr) || rightAmValid) { + if (endHour >= 12) { + endHour -= 12; + } + if (beginHour >= 12 && beginHour - 12 < endHour) { + beginHour -= 12; + } + // Resolve case like "11 to 3am" + if (beginHour < 12 && beginHour > endHour) { + beginHour += 12; + } + isValid = true; + } + else if (!recognizersText.StringUtility.isNullOrEmpty(pmStr) || rightPmValid) { + if (endHour < 12) { + endHour += 12; + } + // Resolve case like "11 to 3pm" + if (beginHour + 12 < endHour) { + beginHour += 12; + } + isValid = true; + } + } + if (isValid) { + let beginStr = "T" + utilities$2.FormatUtil.toString(beginHour, 2); + let endStr = "T" + utilities$2.FormatUtil.toString(endHour, 2); + if (beginHour >= endHour) { + endHour += 24; + } + ret.timex = `(${beginStr},${endStr},PT${endHour - beginHour}H)`; + ret.futureValue = ret.pastValue = { + item1: new Date(year, month, day, beginHour, 0, 0), + item2: new Date(year, month, day, endHour, 0, 0) + }; + ret.success = true; + return ret; + } + } + } + } + return ret; + } + parseSpecificTimeCases(source, reference) { + let result = new utilities$2.DateTimeResolutionResult(); + let year = reference.getFullYear(); + let month = reference.getMonth(); + let day = reference.getDate(); + let trimmedText = source.trim().toLowerCase(); + // Handle cases like "from 4:30 to 5" + let match = recognizersText.RegExpUtility.getMatches(this.config.specificTimeFromToRegex, source).pop(); + if (!match) { + // Handle cases like "between 5:10 and 7" + match = recognizersText.RegExpUtility.getMatches(this.config.specificTimeBetweenAndRegex, source).pop(); + } + if (match && match.index === 0 && match.index + match.length === trimmedText.length) { + // Cases like "half past seven" are not handled here + if (match.groups('prefix').value !== '') { + return result; + } + // Cases like "4" is different with "4:00" as the Timex is different "T04H" vs "T04H00M" + // Uses this invalidFlag to differentiate + let beginHour; + let invalidFlag = -1; + let beginMinute = invalidFlag; + let beginSecond = invalidFlag; + let endHour; + let endMinute = invalidFlag; + let endSecond = invalidFlag; + // Get time1 and time2 + let hourGroup = match.groups('hour'); + let hourStr = hourGroup.captures[0]; + if (this.config.numbers.has(hourStr)) { + beginHour = this.config.numbers[hourStr]; + } + else { + beginHour = parseInt(hourStr, 10); + } + hourStr = hourGroup.captures[1]; + if (this.config.numbers.has(hourStr)) { + endHour = this.config.numbers[hourStr]; + } + else { + endHour = parseInt(hourStr, 10); + } + let time1StartIndex = match.groups('time1').index; + let time1EndIndex = time1StartIndex + match.groups('time1').length; + let time2StartIndex = match.groups('time2').index; + let time2EndIndex = time2StartIndex + match.groups('time2').length; + // Get beginMinute (if exists) and endMinute (if exists) + let lastGroupIndex = 0; + for (let i = 0; i < match.groups('min').captures.length; i++) { + let minuteCapture = match.groups('min').captures[i]; + let minuteCaptureIndex = source.indexOf(minuteCapture, lastGroupIndex); + if (minuteCaptureIndex >= time1StartIndex && minuteCaptureIndex + minuteCapture.length <= time1EndIndex) { + beginMinute = parseInt(minuteCapture, 10); + } + else if (minuteCaptureIndex >= time2StartIndex && minuteCaptureIndex + minuteCapture.length <= time2EndIndex) { + endMinute = parseInt(minuteCapture, 10); + } + lastGroupIndex = minuteCaptureIndex + 1; + } + lastGroupIndex = 0; + // Get beginSecond (if exists) and endSecond (if exists) + for (let i = 0; i < match.groups('sec').captures.length; i++) { + let secondCapture = match.groups('sec').captures[i]; + let secondCaptureIndex = source.indexOf(secondCapture, lastGroupIndex); + if (secondCaptureIndex >= time1StartIndex && secondCaptureIndex + secondCapture.length <= time1EndIndex) { + beginSecond = parseInt(secondCapture, 10); + } + else if (secondCaptureIndex >= time2StartIndex && secondCaptureIndex + secondCapture.length <= time2EndIndex) { + endSecond = parseInt(secondCapture, 10); + } + lastGroupIndex = secondCaptureIndex + 1; + } + lastGroupIndex = 0; + // Desc here means descriptions like "am / pm / o'clock" + // Get leftDesc (if exists) and rightDesc (if exists) + let leftDesc = match.groups('leftDesc').value; + let rightDesc = match.groups('rightDesc').value; + for (let i = 0; i < match.groups('desc').captures.length; i++) { + let descCapture = match.groups('desc').captures[i]; + let descCaptureIndex = source.indexOf(descCapture, lastGroupIndex); + if (descCaptureIndex >= time1StartIndex && descCaptureIndex + descCapture.length <= time1EndIndex && recognizersText.StringUtility.isNullOrEmpty(leftDesc)) { + leftDesc = descCapture; + } + else if (descCaptureIndex >= time2StartIndex && descCaptureIndex + descCapture.length <= time2EndIndex && recognizersText.StringUtility.isNullOrEmpty(rightDesc)) { + rightDesc = descCapture; + } + lastGroupIndex = descCaptureIndex + 1; + } + let beginDateTime = utilities$2.DateUtils.safeCreateFromMinValue(year, month, day, beginHour, beginMinute >= 0 ? beginMinute : 0, beginSecond >= 0 ? beginSecond : 0); + let endDateTime = utilities$2.DateUtils.safeCreateFromMinValue(year, month, day, endHour, endMinute >= 0 ? endMinute : 0, endSecond >= 0 ? endSecond : 0); + let hasLeftAm = !recognizersText.StringUtility.isNullOrEmpty(leftDesc) && leftDesc.toLowerCase().startsWith('a'); + let hasLeftPm = !recognizersText.StringUtility.isNullOrEmpty(leftDesc) && leftDesc.toLowerCase().startsWith('p'); + let hasRightAm = !recognizersText.StringUtility.isNullOrEmpty(rightDesc) && rightDesc.toLowerCase().startsWith('a'); + let hasRightPm = !recognizersText.StringUtility.isNullOrEmpty(rightDesc) && rightDesc.toLowerCase().startsWith('p'); + let hasLeft = hasLeftAm || hasLeftPm; + let hasRight = hasRightAm || hasRightPm; + // Both timepoint has description like 'am' or 'pm' + if (hasLeft && hasRight) { + if (hasLeftAm) { + if (beginHour >= 12) { + beginDateTime = utilities$2.DateUtils.addHours(beginDateTime, -12); + } + } + else if (hasLeftPm) { + if (beginHour < 12) { + beginDateTime = utilities$2.DateUtils.addHours(beginDateTime, 12); + } + } + if (hasRightAm) { + if (endHour >= 12) { + endDateTime = utilities$2.DateUtils.addHours(endDateTime, -12); + } + } + else if (hasRightPm) { + if (endHour < 12) { + endDateTime = utilities$2.DateUtils.addHours(endDateTime, 12); + } + } + } + else if (hasLeft || hasRight) { + if (hasLeftAm) { + if (beginHour >= 12) { + beginDateTime = utilities$2.DateUtils.addHours(beginDateTime, -12); + } + if (endHour < 12) { + if (endDateTime < beginDateTime) { + endDateTime = utilities$2.DateUtils.addHours(endDateTime, 12); + } + } + } + else if (hasLeftPm) { + if (beginHour < 12) { + beginDateTime = utilities$2.DateUtils.addHours(beginDateTime, 12); + } + if (endHour < 12) { + if (endDateTime.getTime() < beginDateTime.getTime()) { + let span = utilities$2.DateUtils.totalHoursFloor(beginDateTime, endDateTime); + if (span >= 12) { + endDateTime = utilities$2.DateUtils.addHours(endDateTime, 24); + } + else { + endDateTime = utilities$2.DateUtils.addHours(endDateTime, 12); + } + } + } + } + if (hasRightAm) { + if (endHour >= 12) { + endDateTime = utilities$2.DateUtils.addHours(endDateTime, -12); + } + if (beginHour < 12) { + if (endDateTime.getTime() < beginDateTime.getTime()) { + beginDateTime = utilities$2.DateUtils.addHours(beginDateTime, -12); + } + } + } + else if (hasRightPm) { + if (endHour < 12) { + endDateTime = utilities$2.DateUtils.addHours(endDateTime, 12); + } + if (beginHour < 12) { + if (endDateTime.getTime() < beginDateTime.getTime()) { + beginDateTime = utilities$2.DateUtils.addHours(beginDateTime, -12); + } + else { + let span = utilities$2.DateUtils.totalHoursFloor(endDateTime, beginDateTime); + if (span > 12) { + beginDateTime = utilities$2.DateUtils.addHours(beginDateTime, 12); + } + } + } + } + } + else if (!hasLeft && !hasRight && beginHour <= 12 && endHour <= 12) { + if (beginHour > endHour) { + if (beginHour === 12) { + beginDateTime = utilities$2.DateUtils.addHours(beginDateTime, -12); + } + else { + endDateTime = utilities$2.DateUtils.addHours(endDateTime, 12); + } + } + result.comment = constants$2.Constants.CommentAmPm; + } + if (endDateTime.getTime() < beginDateTime.getTime()) { + endDateTime = utilities$2.DateUtils.addHours(endDateTime, 24); + } + let beginStr = utilities$2.FormatUtil.shortTime(beginDateTime.getHours(), beginMinute, beginSecond); + let endStr = utilities$2.FormatUtil.shortTime(endDateTime.getHours(), endMinute, endSecond); + result.success = true; + result.timex = `(${beginStr},${endStr},${utilities$2.FormatUtil.luisTimeSpan(endDateTime, beginDateTime)})`; + result.futureValue = result.pastValue = { item1: beginDateTime, item2: endDateTime }; + result.subDateTimeEntities = []; + // In SplitDateAndTime mode, time points will be get from these SubDateTimeEntities + // Cases like "from 4 to 5pm", "4" should not be treated as SubDateTimeEntity + if (hasLeft || beginMinute !== invalidFlag || beginSecond !== invalidFlag) { + let er = { + start: time1StartIndex, + length: time1EndIndex - time1StartIndex, + text: source.substring(time1StartIndex, time1EndIndex), + type: constants$2.Constants.SYS_DATETIME_TIME + }; + let pr = this.config.timeParser.parse(er, reference); + result.subDateTimeEntities.push(pr); + } + // Cases like "from 4am to 5", "5" should not be treated as SubDateTimeEntity + if (hasRight || endMinute !== invalidFlag || endSecond !== invalidFlag) { + let er = { + start: time2StartIndex, + length: time2EndIndex - time2StartIndex, + text: source.substring(time2StartIndex, time2EndIndex), + type: constants$2.Constants.SYS_DATETIME_TIME + }; + let pr = this.config.timeParser.parse(er, reference); + result.subDateTimeEntities.push(pr); + } + } + return result; + } + mergeTwoTimePoints(text, referenceTime) { + let ret = new utilities$2.DateTimeResolutionResult(); + let ers = this.config.timeExtractor.extract(text, referenceTime); + let pr1 = null; + let pr2 = null; + let validTimeNumber = false; + if (ers.length !== 2) { + if (ers.length === 1) { + let numErs = this.config.integerExtractor.extract(text); + for (let num of numErs) { + let midStrBegin = 0; + let midStrEnd = 0; + // ending number + if (num.start > ers[0].start + ers[0].length) { + midStrBegin = ers[0].start + ers[0].length; + midStrEnd = num.start - midStrBegin; + } + else if (num.start + num.length < ers[0].start) { + midStrBegin = num.start + num.length; + midStrEnd = ers[0].start - midStrBegin; + } + // check if the middle string between the time point and the valid number is a connect string. + let middleStr = text.substr(midStrBegin, midStrEnd); + let tillMatch = middleStr.match(this.config.tillRegex); + if (tillMatch) { + num.type = constants$2.Constants.SYS_DATETIME_TIME; + ers.push(num); + validTimeNumber = true; + break; + } + } + ers = ers.sort((x, y) => (x.start - y.start)); + } + if (!validTimeNumber) { + return ret; + } + } + if (ers.length !== 2) { + return ret; + } + pr1 = this.config.timeParser.parse(ers[0], referenceTime); + pr2 = this.config.timeParser.parse(ers[1], referenceTime); + if (pr1.value === null || pr2.value === null) { + return ret; + } + let ampmStr1 = pr1.value.comment; + let ampmStr2 = pr2.value.comment; + let beginTime = pr1.value.futureValue; + let endTime = pr2.value.futureValue; + if (!recognizersText.StringUtility.isNullOrEmpty(ampmStr2) && ampmStr2.endsWith("ampm") + && endTime <= beginTime && utilities$2.DateUtils.addHours(endTime, 12) > beginTime) { + endTime = utilities$2.DateUtils.addHours(endTime, 12); + pr2.value.futureValue = endTime; + pr2.timexStr = `T${endTime.getHours()}`; + if (endTime.getMinutes() > 0) { + pr2.timexStr = `${pr2.timexStr}:${endTime.getMinutes()}`; + } + } + if (!recognizersText.StringUtility.isNullOrEmpty(ampmStr1) && ampmStr1.endsWith("ampm") + && endTime > utilities$2.DateUtils.addHours(beginTime, 12)) { + beginTime = utilities$2.DateUtils.addHours(beginTime, 12); + pr1.value.futureValue = beginTime; + pr1.timexStr = `T${beginTime.getHours()}`; + if (beginTime.getMinutes() > 0) { + pr1.timexStr = `${pr1.timexStr}:${beginTime.getMinutes()}`; + } + } + if (endTime < beginTime) { + endTime = utilities$2.DateUtils.addDays(endTime, 1); + } + let hours = utilities$2.DateUtils.totalHoursFloor(endTime, beginTime); + let minutes = utilities$2.DateUtils.totalMinutesFloor(endTime, beginTime) % 60; + ret.timex = `(${pr1.timexStr},${pr2.timexStr},PT` + + (hours > 0 ? `${hours}H` : '') + + (minutes > 0 ? `${minutes}M` : '') + + ')'; + ret.futureValue = ret.pastValue = { item1: beginTime, item2: endTime }; + ret.success = true; + if (ampmStr1 && ampmStr1.endsWith("ampm") && ampmStr2 && ampmStr2.endsWith("ampm")) { + ret.comment = "ampm"; + } + ret.subDateTimeEntities = [pr1, pr2]; + return ret; + } + // parse "morning", "afternoon", "night" + parseTimeOfDay(text, referenceTime) { + let day = referenceTime.getDate(); + let month = referenceTime.getMonth(); + let year = referenceTime.getFullYear(); + let ret = new utilities$2.DateTimeResolutionResult(); + // extract early/late prefix from text + let matches = recognizersText.RegExpUtility.getMatches(this.config.timeOfDayRegex, text); + let hasEarly = false; + let hasLate = false; + if (matches.length) { + if (!recognizersText.StringUtility.isNullOrEmpty(matches[0].groups("early").value)) { + let early = matches[0].groups("early").value; + text = text.replace(early, ""); + hasEarly = true; + ret.comment = "early"; + } + if (!hasEarly && !recognizersText.StringUtility.isNullOrEmpty(matches[0].groups("late").value)) { + let late = matches[0].groups("late").value; + text = text.replace(late, ""); + hasLate = true; + ret.comment = "late"; + } + } + let timexRange = this.config.getMatchedTimexRange(text); + if (!timexRange.matched) { + return new utilities$2.DateTimeResolutionResult(); + } + // modify time period if "early" or "late" is existed + if (hasEarly) { + timexRange.endHour = timexRange.beginHour + 2; + // handling case: night end with 23:59 + if (timexRange.endMin === 59) { + timexRange.endMin = 0; + } + } + else if (hasLate) { + timexRange.beginHour = timexRange.beginHour + 2; + } + ret.timex = timexRange.timex; + ret.futureValue = ret.pastValue = { + item1: new Date(year, month, day, timexRange.beginHour, 0, 0), + item2: new Date(year, month, day, timexRange.endHour, timexRange.endMin, timexRange.endMin) + }; + ret.success = true; + return ret; + } +} +BaseTimePeriodParser.ParserName = constants$2.Constants.SYS_DATETIME_TIMEPERIOD; // "TimePeriod"; +exports.BaseTimePeriodParser = BaseTimePeriodParser; + +}); + +unwrapExports(baseTimePeriod); + +var baseDateTime$2 = createCommonjsModule(function (module, exports) { +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); + + + + +class BaseDateTimeExtractor { + constructor(config) { + this.extractorName = constants$2.Constants.SYS_DATETIME_DATETIME; + this.config = config; + } + extract(source, refDate) { + if (!refDate) + refDate = new Date(); + let referenceDate = refDate; + let tokens = new Array(); + tokens = tokens.concat(this.mergeDateAndTime(source, referenceDate)); + tokens = tokens.concat(this.basicRegexMatch(source)); + tokens = tokens.concat(this.timeOfTodayBefore(source, referenceDate)); + tokens = tokens.concat(this.timeOfTodayAfter(source, referenceDate)); + tokens = tokens.concat(this.specialTimeOfDate(source, referenceDate)); + tokens = tokens.concat(this.durationWithBeforeAndAfter(source, referenceDate)); + let result = utilities$2.Token.mergeAllTokens(tokens, source, this.extractorName); + return result; + } + mergeDateAndTime(source, refDate) { + let tokens = new Array(); + let ers = this.config.datePointExtractor.extract(source, refDate); + if (ers.length < 1) + return tokens; + ers = ers.concat(this.config.timePointExtractor.extract(source, refDate)); + if (ers.length < 2) + return tokens; + ers = ers.sort((erA, erB) => erA.start < erB.start ? -1 : erA.start === erB.start ? 0 : 1); + let i = 0; + while (i < ers.length - 1) { + let j = i + 1; + while (j < ers.length && recognizersText.ExtractResult.isOverlap(ers[i], ers[j])) { + j++; + } + if (j >= ers.length) + break; + if ((ers[i].type === constants$2.Constants.SYS_DATETIME_DATE && ers[j].type === constants$2.Constants.SYS_DATETIME_TIME) || + (ers[i].type === constants$2.Constants.SYS_DATETIME_TIME && ers[j].type === constants$2.Constants.SYS_DATETIME_DATE)) { + let middleBegin = ers[i].start + ers[i].length; + let middleEnd = ers[j].start; + if (middleBegin > middleEnd) { + i = j + 1; + continue; + } + let middleStr = source.substr(middleBegin, middleEnd - middleBegin).trim().toLowerCase(); + if (this.config.isConnectorToken(middleStr)) { + let begin = ers[i].start; + let end = ers[j].start + ers[j].length; + tokens.push(new utilities$2.Token(begin, end)); + } + i = j + 1; + continue; + } + i = j; + } + tokens.forEach((token, index) => { + let afterStr = source.substr(token.end); + let match = recognizersText.RegExpUtility.getMatches(this.config.suffixRegex, afterStr); + if (match && match.length > 0) { + // TODO: verify element + token.end += match[0].length; + } + }); + return tokens; + } + basicRegexMatch(source) { + let tokens = new Array(); + recognizersText.RegExpUtility.getMatches(this.config.nowRegex, source) + .forEach(match => { + tokens.push(new utilities$2.Token(match.index, match.index + match.length)); + }); + return tokens; + } + timeOfTodayBefore(source, refDate) { + let tokens = new Array(); + let ers = this.config.timePointExtractor.extract(source, refDate); + ers.forEach(er => { + let beforeStr = source.substr(0, er.start); + let innerMatches = recognizersText.RegExpUtility.getMatches(this.config.nightRegex, er.text); + if (innerMatches && innerMatches.length > 0 && innerMatches[0].index === 0) { + beforeStr = source.substr(0, er.start + innerMatches[0].length); + } + if (recognizersText.StringUtility.isNullOrWhitespace(beforeStr)) + return; + let matches = recognizersText.RegExpUtility.getMatches(this.config.timeOfTodayBeforeRegex, beforeStr); + if (matches && matches.length > 0) { + let begin = matches[0].index; + let end = er.start + er.length; + tokens.push(new utilities$2.Token(begin, end)); + } + }); + recognizersText.RegExpUtility.getMatches(this.config.simpleTimeOfTodayBeforeRegex, source) + .forEach(match => { + tokens.push(new utilities$2.Token(match.index, match.index + match.length)); + }); + return tokens; + } + timeOfTodayAfter(source, refDate) { + let tokens = new Array(); + let ers = this.config.timePointExtractor.extract(source, refDate); + ers.forEach(er => { + let afterStr = source.substr(er.start + er.length); + if (recognizersText.StringUtility.isNullOrWhitespace(afterStr)) + return; + let matches = recognizersText.RegExpUtility.getMatches(this.config.timeOfTodayAfterRegex, afterStr); + if (matches && matches.length > 0) { + let begin = er.start; + let end = er.start + er.length + matches[0].length; + tokens.push(new utilities$2.Token(begin, end)); + } + }); + recognizersText.RegExpUtility.getMatches(this.config.simpleTimeOfTodayAfterRegex, source) + .forEach(match => { + tokens.push(new utilities$2.Token(match.index, match.index + match.length)); + }); + return tokens; + } + specialTimeOfDate(source, refDate) { + let tokens = new Array(); + let ers = this.config.datePointExtractor.extract(source, refDate); + ers.forEach(er => { + let beforeStr = source.substr(0, er.start); + let beforeMatches = recognizersText.RegExpUtility.getMatches(this.config.theEndOfRegex, beforeStr); + if (beforeMatches && beforeMatches.length > 0) { + tokens.push(new utilities$2.Token(beforeMatches[0].index, er.start + er.length)); + } + else { + let afterStr = source.substr(er.start + er.length); + let afterMatches = recognizersText.RegExpUtility.getMatches(this.config.theEndOfRegex, afterStr); + if (afterMatches && afterMatches.length > 0) { + tokens.push(new utilities$2.Token(er.start, er.start + er.length + afterMatches[0].index + afterMatches[0].length)); + } + } + }); + return tokens; + } + durationWithBeforeAndAfter(source, refDate) { + let tokens = new Array(); + this.config.durationExtractor.extract(source, refDate).forEach(er => { + let matches = recognizersText.RegExpUtility.getMatches(this.config.unitRegex, er.text); + if (matches && matches.length > 0) { + tokens = utilities$2.AgoLaterUtil.extractorDurationWithBeforeAndAfter(source, er, tokens, this.config.utilityConfiguration); + } + }); + return tokens; + } +} +exports.BaseDateTimeExtractor = BaseDateTimeExtractor; +class BaseDateTimeParser { + constructor(configuration) { + this.config = configuration; + } + parse(er, refTime) { + if (!refTime) + refTime = new Date(); + let referenceTime = refTime; + let value = null; + if (er.type === BaseDateTimeParser.ParserName) { + let innerResult = this.mergeDateAndTime(er.text, referenceTime); + if (!innerResult.success) { + innerResult = this.parseBasicRegex(er.text, referenceTime); + } + if (!innerResult.success) { + innerResult = this.parseTimeOfToday(er.text, referenceTime); + } + if (!innerResult.success) { + innerResult = this.parseSpecialTimeOfDate(er.text, referenceTime); + } + if (!innerResult.success) { + innerResult = this.parserDurationWithAgoAndLater(er.text, referenceTime); + } + if (innerResult.success) { + innerResult.futureResolution = {}; + innerResult.futureResolution[constants$2.TimeTypeConstants.DATETIME] = utilities$2.FormatUtil.formatDateTime(innerResult.futureValue); + innerResult.pastResolution = {}; + innerResult.pastResolution[constants$2.TimeTypeConstants.DATETIME] = utilities$2.FormatUtil.formatDateTime(innerResult.pastValue); + value = innerResult; + } + } + let ret = new parsers$4.DateTimeParseResult(er); + { + ret.value = value, ret.timexStr = value === null ? "" : value.timex, ret.resolutionStr = ""; + } + + return ret; + } + parseBasicRegex(text, referenceTime) { + let ret = new utilities$2.DateTimeResolutionResult(); + let trimmedText = text.trim().toLowerCase(); + // handle "now" + let matches = recognizersText.RegExpUtility.getMatches(this.config.nowRegex, trimmedText); + if (matches.length && matches[0].index === 0 && matches[0].length === trimmedText.length) { + let getMatchedNowTimex = this.config.getMatchedNowTimex(trimmedText); + ret.timex = getMatchedNowTimex.timex; + ret.futureValue = ret.pastValue = referenceTime; + ret.success = true; + return ret; + } + return ret; + } + // merge a Date entity and a Time entity + mergeDateAndTime(text, referenceTime) { + let ret = new utilities$2.DateTimeResolutionResult(); + let er1 = this.config.dateExtractor.extract(text, referenceTime); + if (er1.length === 0) { + er1 = this.config.dateExtractor.extract(this.config.tokenBeforeDate + text, referenceTime); + if (er1.length === 1) { + er1[0].start -= this.config.tokenBeforeDate.length; + } + else { + return ret; + } + } + else { + // this is to understand if there is an ambiguous token in the text. For some languages (e.g. spanish) + // the same word could mean different things (e.g a time in the day or an specific day). + if (this.config.haveAmbiguousToken(text, er1[0].text)) { + return ret; + } + } + let er2 = this.config.timeExtractor.extract(text, referenceTime); + if (er2.length === 0) { + // here we filter out "morning, afternoon, night..." time entities + er2 = this.config.timeExtractor.extract(this.config.tokenBeforeTime + text, referenceTime); + if (er2.length === 1) { + er2[0].start -= this.config.tokenBeforeTime.length; + } + else { + return ret; + } + } + // handle case "Oct. 5 in the afternoon at 7:00" + // in this case "5 in the afternoon" will be extract as a Time entity + let correctTimeIdx = 0; + while (correctTimeIdx < er2.length && recognizersText.ExtractResult.isOverlap(er2[correctTimeIdx], er1[0])) { + correctTimeIdx++; + } + if (correctTimeIdx >= er2.length) { + return ret; + } + let pr1 = this.config.dateParser.parse(er1[0], new Date(referenceTime.toDateString())); + let pr2 = this.config.timeParser.parse(er2[correctTimeIdx], referenceTime); + if (pr1.value === null || pr2.value === null) { + return ret; + } + let futureDate = pr1.value.futureValue; + let pastDate = pr1.value.pastValue; + let time = pr2.value.futureValue; + let hour = time.getHours(); + let min = time.getMinutes(); + let sec = time.getSeconds(); + // handle morning, afternoon + if (recognizersText.RegExpUtility.getMatches(this.config.pmTimeRegex, text).length && hour < 12) { + hour += 12; + } + else if (recognizersText.RegExpUtility.getMatches(this.config.amTimeRegex, text).length && hour >= 12) { + hour -= 12; + } + let timeStr = pr2.timexStr; + if (timeStr.endsWith("ampm")) { + timeStr = timeStr.substring(0, timeStr.length - 4); + } + timeStr = "T" + utilities$2.FormatUtil.toString(hour, 2) + timeStr.substring(3); + ret.timex = pr1.timexStr + timeStr; + let val = pr2.value; + if (hour <= 12 && !recognizersText.RegExpUtility.getMatches(this.config.pmTimeRegex, text).length + && !recognizersText.RegExpUtility.getMatches(this.config.amTimeRegex, text).length && val.comment) { + ret.comment = "ampm"; + } + ret.futureValue = new Date(futureDate.getFullYear(), futureDate.getMonth(), futureDate.getDate(), hour, min, sec); + ret.pastValue = new Date(pastDate.getFullYear(), pastDate.getMonth(), pastDate.getDate(), hour, min, sec); + ret.success = true; + // change the value of time object + pr2.timexStr = timeStr; + if (!recognizersText.StringUtility.isNullOrEmpty(ret.comment)) { + pr2.value.comment = ret.comment === "ampm" ? "ampm" : ""; + } + // add the date and time object in case we want to split them + ret.subDateTimeEntities = [pr1, pr2]; + return ret; + } + parseTimeOfToday(text, referenceTime) { + let ret = new utilities$2.DateTimeResolutionResult(); + let trimmedText = text.toLowerCase().trim(); + let hour = 0; + let min = 0; + let sec = 0; + let timeStr; + let wholeMatches = recognizersText.RegExpUtility.getMatches(this.config.simpleTimeOfTodayAfterRegex, trimmedText); + if (!(wholeMatches.length && wholeMatches[0].length === trimmedText.length)) { + wholeMatches = recognizersText.RegExpUtility.getMatches(this.config.simpleTimeOfTodayBeforeRegex, trimmedText); + } + if (wholeMatches.length && wholeMatches[0].length === trimmedText.length) { + let hourStr = wholeMatches[0].groups("hour").value; + if (!hourStr) { + hourStr = wholeMatches[0].groups("hournum").value.toLowerCase(); + hour = this.config.numbers.get(hourStr); + } + else { + hour = parseInt(hourStr, 10); + } + timeStr = "T" + utilities$2.FormatUtil.toString(hour, 2); + } + else { + let ers = this.config.timeExtractor.extract(trimmedText, referenceTime); + if (ers.length !== 1) { + ers = this.config.timeExtractor.extract(this.config.tokenBeforeTime + trimmedText, referenceTime); + if (ers.length === 1) { + ers[0].start -= this.config.tokenBeforeTime.length; + } + else { + return ret; + } + } + let pr = this.config.timeParser.parse(ers[0], referenceTime); + if (pr.value === null) { + return ret; + } + let time = pr.value.futureValue; + hour = time.getHours(); + min = time.getMinutes(); + sec = time.getSeconds(); + timeStr = pr.timexStr; + } + let matches = recognizersText.RegExpUtility.getMatches(this.config.specificTimeOfDayRegex, trimmedText); + if (matches.length) { + let matchStr = matches[0].value.toLowerCase(); + // handle "last", "next" + let swift = this.config.getSwiftDay(matchStr); + let date = new Date(referenceTime); + date.setDate(date.getDate() + swift); + // handle "morning", "afternoon" + hour = this.config.getHour(matchStr, hour); + // in this situation, luisStr cannot end up with "ampm", because we always have a "morning" or "night" + if (timeStr.endsWith("ampm")) { + timeStr = timeStr.substring(0, timeStr.length - 4); + } + timeStr = "T" + utilities$2.FormatUtil.toString(hour, 2) + timeStr.substring(3); + ret.timex = utilities$2.FormatUtil.formatDate(date) + timeStr; + ret.futureValue = ret.pastValue = new Date(date.getFullYear(), date.getMonth(), date.getDate(), hour, min, sec); + ret.success = true; + return ret; + } + return ret; + } + parseSpecialTimeOfDate(text, refDateTime) { + let ret = new utilities$2.DateTimeResolutionResult(); + let ers = this.config.dateExtractor.extract(text, refDateTime); + if (ers.length !== 1) { + return ret; + } + let beforeStr = text.substring(0, ers[0].start || 0); + if (recognizersText.RegExpUtility.getMatches(this.config.theEndOfRegex, beforeStr).length) { + let pr = this.config.dateParser.parse(ers[0], refDateTime); + let futureDate = new Date(pr.value.futureValue); + let pastDate = new Date(pr.value.pastValue); + ret.timex = pr.timexStr + "T23:59"; + futureDate.setDate(futureDate.getDate() + 1); + futureDate.setMinutes(futureDate.getMinutes() - 1); + ret.futureValue = futureDate; + pastDate.setDate(pastDate.getDate() + 1); + pastDate.setMinutes(pastDate.getMinutes() - 1); + ret.pastValue = pastDate; + ret.success = true; + return ret; + } + return ret; + } + // handle like "two hours ago" + parserDurationWithAgoAndLater(text, referenceTime) { + return utilities$2.AgoLaterUtil.parseDurationWithAgoAndLater(text, referenceTime, this.config.durationExtractor, this.config.durationParser, this.config.unitMap, this.config.unitRegex, this.config.utilityConfiguration, utilities$2.AgoLaterMode.DateTime); + } +} +BaseDateTimeParser.ParserName = constants$2.Constants.SYS_DATETIME_DATETIME; // "DateTime"; +exports.BaseDateTimeParser = BaseDateTimeParser; + +}); + +unwrapExports(baseDateTime$2); + +var baseDateTimePeriod = createCommonjsModule(function (module, exports) { +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); + + + + +class BaseDateTimePeriodExtractor { + constructor(config) { + this.extractorName = constants$2.Constants.SYS_DATETIME_DATETIMEPERIOD; + this.config = config; + } + extract(source, refDate) { + if (!refDate) + refDate = new Date(); + let referenceDate = refDate; + let tokens = new Array() + .concat(this.matchSimpleCases(source, referenceDate)) + .concat(this.mergeTwoTimePoints(source, referenceDate)) + .concat(this.matchDuration(source, referenceDate)) + .concat(this.matchNight(source, referenceDate)) + .concat(this.matchRelativeUnit(source)); + let result = utilities$2.Token.mergeAllTokens(tokens, source, this.extractorName); + return result; + } + matchSimpleCases(source, refDate) { + let tokens = new Array(); + this.config.simpleCasesRegexes.forEach(regexp => { + recognizersText.RegExpUtility.getMatches(regexp, source).forEach(match => { + // has a date before? + let hasBeforeDate = false; + let beforeStr = source.substr(0, match.index); + if (!recognizersText.StringUtility.isNullOrWhitespace(beforeStr)) { + let ers = this.config.singleDateExtractor.extract(beforeStr, refDate); + if (ers && ers.length > 0) { + let er = ers[ers.length - 1]; + let begin = er.start; + let middleStr = beforeStr.substr(begin + er.length).trim().toLowerCase(); + if (recognizersText.StringUtility.isNullOrWhitespace(middleStr) || recognizersText.RegExpUtility.getMatches(this.config.prepositionRegex, middleStr).length > 0) { + tokens.push(new utilities$2.Token(begin, match.index + match.length)); + hasBeforeDate = true; + } + } + } + let followedStr = source.substr(match.index + match.length); + if (!recognizersText.StringUtility.isNullOrWhitespace(followedStr) && !hasBeforeDate) { + let ers = this.config.singleDateExtractor.extract(followedStr, refDate); + if (ers && ers.length > 0) { + let er = ers[0]; + let begin = er.start; + let end = er.start + er.length; + let middleStr = followedStr.substr(0, begin).trim().toLowerCase(); + if (recognizersText.StringUtility.isNullOrWhitespace(middleStr) || recognizersText.RegExpUtility.getMatches(this.config.prepositionRegex, middleStr).length > 0) { + tokens.push(new utilities$2.Token(match.index, match.index + match.length + end)); + } + } + } + }); + }); + return tokens; + } + mergeTwoTimePoints(source, refDate) { + let tokens = new Array(); + let ersDateTime = this.config.singleDateTimeExtractor.extract(source, refDate); + let ersTime = this.config.singleTimeExtractor.extract(source, refDate); + let innerMarks = []; + let j = 0; + ersDateTime.forEach((erDateTime, index) => { + innerMarks.push(erDateTime); + while (j < ersTime.length && ersTime[j].start + ersTime[j].length < erDateTime.start) { + innerMarks.push(ersTime[j++]); + } + while (j < ersTime.length && recognizersText.ExtractResult.isOverlap(ersTime[j], erDateTime)) { + j++; + } + }); + while (j < ersTime.length) { + innerMarks.push(ersTime[j++]); + } + innerMarks = innerMarks.sort((erA, erB) => erA.start < erB.start ? -1 : erA.start === erB.start ? 0 : 1); + let idx = 0; + while (idx < innerMarks.length - 1) { + let currentMark = innerMarks[idx]; + let nextMark = innerMarks[idx + 1]; + if (currentMark.type === constants$2.Constants.SYS_DATETIME_TIME && nextMark.type === constants$2.Constants.SYS_DATETIME_TIME) { + idx++; + continue; + } + let middleBegin = currentMark.start + currentMark.length; + let middleEnd = nextMark.start; + let middleStr = source.substr(middleBegin, middleEnd - middleBegin).trim().toLowerCase(); + let matches = recognizersText.RegExpUtility.getMatches(this.config.tillRegex, middleStr); + if (matches && matches.length > 0 && matches[0].index === 0 && matches[0].length === middleStr.length) { + let periodBegin = currentMark.start; + let periodEnd = nextMark.start + nextMark.length; + let beforeStr = source.substr(0, periodBegin).trim().toLowerCase(); + let matchFrom = this.config.getFromTokenIndex(beforeStr); + let fromTokenIndex = matchFrom.matched ? matchFrom : this.config.getBetweenTokenIndex(beforeStr); + if (fromTokenIndex.matched) { + periodBegin = fromTokenIndex.index; + } + tokens.push(new utilities$2.Token(periodBegin, periodEnd)); + idx += 2; + continue; + } + if (this.config.hasConnectorToken(middleStr)) { + let periodBegin = currentMark.start; + let periodEnd = nextMark.start + nextMark.length; + let beforeStr = source.substr(0, periodBegin).trim().toLowerCase(); + let betweenTokenIndex = this.config.getBetweenTokenIndex(beforeStr); + if (betweenTokenIndex.matched) { + periodBegin = betweenTokenIndex.index; + tokens.push(new utilities$2.Token(periodBegin, periodEnd)); + idx += 2; + continue; + } + } + idx++; + } + + return tokens; + } + matchDuration(source, refDate) { + let tokens = new Array(); + let durations = new Array(); + this.config.durationExtractor.extract(source, refDate).forEach(duration => { + let match = recognizersText.RegExpUtility.getMatches(this.config.timeUnitRegex, duration.text).pop(); + if (match) { + durations.push(new utilities$2.Token(duration.start, duration.start + duration.length)); + } + }); + durations.forEach(duration => { + let beforeStr = source.substr(0, duration.start).toLowerCase(); + if (recognizersText.StringUtility.isNullOrWhitespace(beforeStr)) + return; + let match = recognizersText.RegExpUtility.getMatches(this.config.pastPrefixRegex, beforeStr).pop(); + if (match && recognizersText.StringUtility.isNullOrWhitespace(beforeStr.substr(match.index + match.length))) { + tokens.push(new utilities$2.Token(match.index, duration.end)); + return; + } + match = recognizersText.RegExpUtility.getMatches(this.config.nextPrefixRegex, beforeStr).pop(); + if (match && recognizersText.StringUtility.isNullOrWhitespace(beforeStr.substr(match.index + match.length))) { + tokens.push(new utilities$2.Token(match.index, duration.end)); + } + }); + return tokens; + } + matchNight(source, refDate) { + let tokens = new Array(); + recognizersText.RegExpUtility.getMatches(this.config.specificTimeOfDayRegex, source).forEach(match => { + tokens.push(new utilities$2.Token(match.index, match.index + match.length)); + }); + this.config.singleDateExtractor.extract(source, refDate).forEach(er => { + let afterStr = source.substr(er.start + er.length); + let match = recognizersText.RegExpUtility.getMatches(this.config.periodTimeOfDayWithDateRegex, afterStr).pop(); + if (match) { + if (recognizersText.StringUtility.isNullOrWhitespace(afterStr.substr(0, match.index))) { + tokens.push(new utilities$2.Token(er.start, er.start + er.length + match.index + match.length)); + } + else { + let pauseMatch = recognizersText.RegExpUtility.getMatches(this.config.middlePauseRegex, afterStr.substr(0, match.index)).pop(); + if (pauseMatch) { + // TODO: should use trimStart() instead? + let suffix = afterStr.substr(match.index + match.length).trim(); + let endingMatch = recognizersText.RegExpUtility.getMatches(this.config.generalEndingRegex, suffix).pop(); + if (endingMatch) { + tokens.push(new utilities$2.Token(er.start || 0, er.start + er.length + match.index + match.length || 0)); + } + } + } + } + let beforeStr = source.substr(0, er.start); + match = recognizersText.RegExpUtility.getMatches(this.config.periodTimeOfDayWithDateRegex, beforeStr).pop(); + if (match) { + if (recognizersText.StringUtility.isNullOrWhitespace(beforeStr.substr(match.index + match.length))) { + let middleStr = source.substr(match.index + match.length, er.start - match.index - match.length); + if (recognizersText.StringUtility.isWhitespace(middleStr)) { + tokens.push(new utilities$2.Token(match.index, er.start + er.length)); + } + } + else { + let pauseMatch = recognizersText.RegExpUtility.getMatches(this.config.middlePauseRegex, beforeStr.substr(match.index + match.length)).pop(); + if (pauseMatch) { + // TODO: should use trimStart() instead? + let suffix = source.substr(er.start + er.length || 0).trim(); + let endingMatch = recognizersText.RegExpUtility.getMatches(this.config.generalEndingRegex, suffix).pop(); + if (endingMatch) { + tokens.push(new utilities$2.Token(match.index, er.start + er.length || 0)); + } + } + } + } + // check whether there are adjacent time period strings, before or after + for (let e of tokens) { + // try to extract a time period in before-string + if (e.start > 0) { + let beforeStr = source.substr(0, e.start); + if (!recognizersText.StringUtility.isNullOrWhitespace(beforeStr)) { + let timeErs = this.config.timePeriodExtractor.extract(beforeStr); + if (timeErs.length > 0) { + for (let tp of timeErs) { + let midStr = beforeStr.substr(tp.start + tp.length || 0); + if (recognizersText.StringUtility.isNullOrWhitespace(midStr)) { + tokens.push(new utilities$2.Token(tp.start || 0, tp.start + tp.length + midStr.length + e.length || 0)); + } + } + } + } + } + // try to extract a time period in after-string + if (e.start + e.length <= source.length) { + let afterStr = source.substr(e.start + e.length); + if (!recognizersText.StringUtility.isNullOrWhitespace(afterStr)) { + let timeErs = this.config.timePeriodExtractor.extract(afterStr); + if (timeErs.length > 0) { + for (let tp of timeErs) { + let midStr = afterStr.substr(0, tp.start || 0); + if (recognizersText.StringUtility.isNullOrWhitespace(midStr)) { + tokens.push(new utilities$2.Token(e.start, e.start + e.length + midStr.length + tp.length || 0)); + } + } + } + } + } + } + }); + return tokens; + } + matchRelativeUnit(source) { + let tokens = new Array(); + let matches = recognizersText.RegExpUtility.getMatches(this.config.relativeTimeUnitRegex, source); + if (matches.length === 0) { + matches = recognizersText.RegExpUtility.getMatches(this.config.restOfDateTimeRegex, source); + } + matches.forEach(match => { + tokens.push(new utilities$2.Token(match.index, match.index + match.length)); + }); + return tokens; + } +} +exports.BaseDateTimePeriodExtractor = BaseDateTimePeriodExtractor; +class BaseDateTimePeriodParser { + constructor(config) { + this.parserName = constants$2.Constants.SYS_DATETIME_DATETIMEPERIOD; + this.config = config; + } + parse(extractorResult, referenceDate) { + if (!referenceDate) + referenceDate = new Date(); + let resultValue; + if (extractorResult.type === this.parserName) { + let source = extractorResult.text.trim().toLowerCase(); + let innerResult = this.mergeDateAndTimePeriods(source, referenceDate); + if (!innerResult.success) { + innerResult = this.mergeTwoTimePoints(source, referenceDate); + } + if (!innerResult.success) { + innerResult = this.parseSpecificTimeOfDay(source, referenceDate); + } + if (!innerResult.success) { + innerResult = this.parseDuration(source, referenceDate); + } + if (!innerResult.success) { + innerResult = this.parseRelativeUnit(source, referenceDate); + } + if (innerResult.success) { + innerResult.futureResolution = {}; + innerResult.futureResolution[constants$2.TimeTypeConstants.START_DATETIME] = utilities$2.FormatUtil.formatDateTime(innerResult.futureValue[0]); + innerResult.futureResolution[constants$2.TimeTypeConstants.END_DATETIME] = utilities$2.FormatUtil.formatDateTime(innerResult.futureValue[1]); + innerResult.pastResolution = {}; + innerResult.pastResolution[constants$2.TimeTypeConstants.START_DATETIME] = utilities$2.FormatUtil.formatDateTime(innerResult.pastValue[0]); + innerResult.pastResolution[constants$2.TimeTypeConstants.END_DATETIME] = utilities$2.FormatUtil.formatDateTime(innerResult.pastValue[1]); + resultValue = innerResult; + } + } + let result = new parsers$4.DateTimeParseResult(extractorResult); + result.value = resultValue; + result.timexStr = resultValue ? resultValue.timex : ''; + result.resolutionStr = ''; + return result; + } + mergeDateAndTimePeriods(text, referenceTime) { + let ret = new utilities$2.DateTimeResolutionResult(); + let trimedText = text.trim().toLowerCase(); + let er = this.config.timePeriodExtractor.extract(trimedText, referenceTime); + if (er.length !== 1) { + return this.parseSimpleCases(text, referenceTime); + } + let timePeriodParseResult = this.config.timePeriodParser.parse(er[0]); + let timePeriodResolutionResult = timePeriodParseResult.value; + if (!timePeriodResolutionResult) { + return this.parseSimpleCases(text, referenceTime); + } + let timePeriodTimex = timePeriodResolutionResult.timex; + // if it is a range type timex + if (!recognizersText.StringUtility.isNullOrEmpty(timePeriodTimex) + && timePeriodTimex.startsWith("(")) { + let dateResult = this.config.dateExtractor.extract(trimedText.replace(er[0].text, ""), referenceTime); + let dateStr = ""; + let futureTime; + let pastTime; + if (dateResult.length === 1 && trimedText.replace(er[0].text, "").trim() === dateResult[0].text) { + let pr = this.config.dateParser.parse(dateResult[0], referenceTime); + if (pr.value) { + futureTime = pr.value.futureValue; + pastTime = pr.value.pastValue; + dateStr = pr.timexStr; + } + else { + return this.parseSimpleCases(text, referenceTime); + } + timePeriodTimex = timePeriodTimex.replace("(", "").replace(")", ""); + let timePeriodTimexArray = timePeriodTimex.split(','); + let timePeriodFutureValue = timePeriodResolutionResult.futureValue; + let beginTime = timePeriodFutureValue.item1; + let endTime = timePeriodFutureValue.item2; + if (timePeriodTimexArray.length === 3) { + let beginStr = dateStr + timePeriodTimexArray[0]; + let endStr = dateStr + timePeriodTimexArray[1]; + ret.timex = `(${beginStr},${endStr},${timePeriodTimexArray[2]})`; + ret.futureValue = [ + utilities$2.DateUtils.safeCreateFromMinValue(futureTime.getFullYear(), futureTime.getMonth(), futureTime.getDate(), beginTime.getHours(), beginTime.getMinutes(), beginTime.getSeconds()), + utilities$2.DateUtils.safeCreateFromMinValue(futureTime.getFullYear(), futureTime.getMonth(), futureTime.getDate(), endTime.getHours(), endTime.getMinutes(), endTime.getSeconds()) + ]; + ret.pastValue = [ + utilities$2.DateUtils.safeCreateFromMinValue(pastTime.getFullYear(), pastTime.getMonth(), pastTime.getDate(), beginTime.getHours(), beginTime.getMinutes(), beginTime.getSeconds()), + utilities$2.DateUtils.safeCreateFromMinValue(pastTime.getFullYear(), pastTime.getMonth(), pastTime.getDate(), endTime.getHours(), endTime.getMinutes(), endTime.getSeconds()) + ]; + if (!recognizersText.StringUtility.isNullOrEmpty(timePeriodResolutionResult.comment) + && timePeriodResolutionResult.comment === "ampm") { + ret.comment = "ampm"; + } + ret.success = true; + ret.subDateTimeEntities = [pr, timePeriodParseResult]; + return ret; + } + } + else { + return this.parseSimpleCases(text, referenceTime); + } + } + return this.parseSimpleCases(text, referenceTime); + } + parseSimpleCases(source, referenceDate) { + let result = new utilities$2.DateTimeResolutionResult(); + let match = recognizersText.RegExpUtility.getMatches(this.config.pureNumberFromToRegex, source).pop(); + if (!match) { + match = recognizersText.RegExpUtility.getMatches(this.config.pureNumberBetweenAndRegex, source).pop(); + } + if (!match || (match.index !== 0 && match.index + match.length !== source.length)) + return result; + let hourGroup = match.groups('hour'); + let beginHour = this.config.numbers.get(hourGroup.captures[0]) || Number.parseInt(hourGroup.captures[0], 10) || 0; + let endHour = this.config.numbers.get(hourGroup.captures[1]) || Number.parseInt(hourGroup.captures[1], 10) || 0; + let er = this.config.dateExtractor.extract(source.replace(match.value, ""), referenceDate).pop(); + if (!er) + return result; + let pr = this.config.dateParser.parse(er, referenceDate); + if (!pr) + return result; + let dateResult = pr.value; + let futureDate = dateResult.futureValue; + let pastDate = dateResult.pastValue; + let dateStr = pr.timexStr; + let hasAm = false; + let hasPm = false; + let pmStr = match.groups('pm').value; + let amStr = match.groups('am').value; + let descStr = match.groups('desc').value; + if (!recognizersText.StringUtility.isNullOrEmpty(amStr) || descStr.startsWith('a')) { + if (beginHour >= 12) + beginHour -= 12; + if (endHour >= 12) + endHour -= 12; + hasAm = true; + } + if (!recognizersText.StringUtility.isNullOrEmpty(pmStr) || descStr.startsWith('p')) { + if (beginHour < 12) + beginHour += 12; + if (endHour < 12) + endHour += 12; + hasPm = true; + } + if (!hasAm && !hasPm && beginHour <= 12 && endHour <= 12) { + result.comment = "ampm"; + } + let beginStr = `${dateStr}T${utilities$2.FormatUtil.toString(beginHour, 2)}`; + let endStr = `${dateStr}T${utilities$2.FormatUtil.toString(endHour, 2)}`; + result.timex = `(${beginStr},${endStr},PT${endHour - beginHour}H)`; + result.futureValue = [ + utilities$2.DateUtils.safeCreateFromMinValue(futureDate.getFullYear(), futureDate.getMonth(), futureDate.getDate(), beginHour, 0, 0), + utilities$2.DateUtils.safeCreateFromMinValue(futureDate.getFullYear(), futureDate.getMonth(), futureDate.getDate(), endHour, 0, 0) + ]; + result.pastValue = [ + utilities$2.DateUtils.safeCreateFromMinValue(pastDate.getFullYear(), pastDate.getMonth(), pastDate.getDate(), beginHour, 0, 0), + utilities$2.DateUtils.safeCreateFromMinValue(pastDate.getFullYear(), pastDate.getMonth(), pastDate.getDate(), endHour, 0, 0) + ]; + result.success = true; + return result; + } + mergeTwoTimePoints(source, referenceDate) { + let result = new utilities$2.DateTimeResolutionResult(); + let prs; + let timeErs = this.config.timeExtractor.extract(source, referenceDate); + let datetimeErs = this.config.dateTimeExtractor.extract(source, referenceDate); + let bothHasDate = false; + let beginHasDate = false; + let endHasDate = false; + if (datetimeErs.length === 2) { + prs = this.getTwoPoints(datetimeErs[0], datetimeErs[1], this.config.dateTimeParser, this.config.dateTimeParser, referenceDate); + bothHasDate = true; + } + else if (datetimeErs.length === 1 && timeErs.length === 2) { + if (recognizersText.ExtractResult.isOverlap(datetimeErs[0], timeErs[0])) { + prs = this.getTwoPoints(datetimeErs[0], timeErs[1], this.config.dateTimeParser, this.config.timeParser, referenceDate); + beginHasDate = true; + } + else { + prs = this.getTwoPoints(timeErs[0], datetimeErs[0], this.config.timeParser, this.config.dateTimeParser, referenceDate); + endHasDate = true; + } + } + else if (datetimeErs.length === 1 && timeErs.length === 1) { + if (timeErs[0].start < datetimeErs[0].start) { + prs = this.getTwoPoints(timeErs[0], datetimeErs[0], this.config.timeParser, this.config.dateTimeParser, referenceDate); + endHasDate = true; + } + else { + prs = this.getTwoPoints(datetimeErs[0], timeErs[0], this.config.dateTimeParser, this.config.timeParser, referenceDate); + beginHasDate = true; + } + } + if (!prs || !prs.begin.value || !prs.end.value) + return result; + let begin = prs.begin.value; + let end = prs.end.value; + let futureBegin = begin.futureValue; + let futureEnd = end.futureValue; + let pastBegin = begin.pastValue; + let pastEnd = end.pastValue; + if (bothHasDate) { + if (futureBegin > futureEnd) + futureBegin = pastBegin; + if (pastEnd < pastBegin) + pastEnd = futureEnd; + result.timex = `(${prs.begin.timexStr},${prs.end.timexStr},PT${utilities$2.DateUtils.totalHours(futureEnd, futureBegin)}H)`; + } + else if (beginHasDate) { + futureEnd = utilities$2.DateUtils.safeCreateFromMinValue(futureBegin.getFullYear(), futureBegin.getMonth(), futureBegin.getDate(), futureEnd.getHours(), futureEnd.getMinutes(), futureEnd.getSeconds()); + pastEnd = utilities$2.DateUtils.safeCreateFromMinValue(pastBegin.getFullYear(), pastBegin.getMonth(), pastBegin.getDate(), pastEnd.getHours(), pastEnd.getMinutes(), pastEnd.getSeconds()); + let dateStr = prs.begin.timexStr.split('T').pop(); + result.timex = `(${prs.begin.timexStr},${dateStr}${prs.end.timexStr},PT${utilities$2.DateUtils.totalHours(futureEnd, futureBegin)}H)`; + } + else if (endHasDate) { + futureBegin = utilities$2.DateUtils.safeCreateFromMinValue(futureEnd.getFullYear(), futureEnd.getMonth(), futureEnd.getDate(), futureBegin.getHours(), futureBegin.getMinutes(), futureBegin.getSeconds()); + pastBegin = utilities$2.DateUtils.safeCreateFromMinValue(pastEnd.getFullYear(), pastEnd.getMonth(), pastEnd.getDate(), pastBegin.getHours(), pastBegin.getMinutes(), pastBegin.getSeconds()); + let dateStr = prs.end.timexStr.split('T')[0]; + result.timex = `(${dateStr}${prs.begin.timexStr},${prs.end.timexStr},PT${utilities$2.DateUtils.totalHours(futureEnd, futureBegin)}H)`; + } + if (!recognizersText.StringUtility.isNullOrEmpty(begin.comment) && begin.comment.endsWith('ampm') && !recognizersText.StringUtility.isNullOrEmpty(end.comment) && end.comment.endsWith('ampm')) { + result.comment = 'ampm'; + } + result.futureValue = [futureBegin, futureEnd]; + result.pastValue = [pastBegin, pastEnd]; + result.success = true; + result.subDateTimeEntities = [prs.begin, prs.end]; + return result; + } + getTwoPoints(beginEr, endEr, beginParser, endParser, referenceDate) { + let beginPr = beginParser.parse(beginEr, referenceDate); + let endPr = endParser.parse(endEr, referenceDate); + return { begin: beginPr, end: endPr }; + } + parseSpecificTimeOfDay(source, referenceDate) { + let result = new utilities$2.DateTimeResolutionResult(); + let timeText = source; + let hasEarly = false; + let hasLate = false; + let match = recognizersText.RegExpUtility.getMatches(this.config.periodTimeOfDayWithDateRegex, source).pop(); + if (match) { + timeText = match.groups('timeOfDay').value; + if (!recognizersText.StringUtility.isNullOrEmpty(match.groups('early').value)) { + hasEarly = true; + result.comment = 'early'; + } + else if (!recognizersText.StringUtility.isNullOrEmpty(match.groups('late').value)) { + hasLate = true; + result.comment = 'late'; + } + } + let matched = this.config.getMatchedTimeRange(timeText); + if (!matched || !matched.success) + return result; + if (hasEarly) { + matched.endHour = matched.beginHour + 2; + if (matched.endMin === 59) + matched.endMin = 0; + } + else if (hasLate) { + matched.beginHour += 2; + } + match = recognizersText.RegExpUtility.getMatches(this.config.specificTimeOfDayRegex, source).pop(); + if (match && match.index === 0 && match.length === source.length) { + let swift = this.config.getSwiftPrefix(source); + let date = utilities$2.DateUtils.addDays(referenceDate, swift); + result.timex = utilities$2.FormatUtil.formatDate(date) + matched.timeStr; + result.futureValue = [ + utilities$2.DateUtils.safeCreateFromMinValue(date.getFullYear(), date.getMonth(), date.getDate(), matched.beginHour, 0, 0), + utilities$2.DateUtils.safeCreateFromMinValue(date.getFullYear(), date.getMonth(), date.getDate(), matched.endHour, matched.endMin, matched.endMin), + ]; + result.pastValue = [ + utilities$2.DateUtils.safeCreateFromMinValue(date.getFullYear(), date.getMonth(), date.getDate(), matched.beginHour, 0, 0), + utilities$2.DateUtils.safeCreateFromMinValue(date.getFullYear(), date.getMonth(), date.getDate(), matched.endHour, matched.endMin, matched.endMin), + ]; + result.success = true; + return result; + } + match = recognizersText.RegExpUtility.getMatches(this.config.periodTimeOfDayWithDateRegex, source).pop(); + if (!match) + return result; + let beforeStr = source.substr(0, match.index).trim(); + let afterStr = source.substr(match.index + match.length).trim(); + let ers = this.config.dateExtractor.extract(beforeStr, referenceDate); + // eliminate time period, if any + let timePeriodErs = this.config.timePeriodExtractor.extract(beforeStr); + if (timePeriodErs.length > 0) { + beforeStr = beforeStr.slice(timePeriodErs[0].start || 0, timePeriodErs[0].start + timePeriodErs[0].length || 0).trim(); + } + else { + timePeriodErs = this.config.timePeriodExtractor.extract(afterStr); + if (timePeriodErs.length > 0) { + afterStr = afterStr.slice(timePeriodErs[0].start || 0, timePeriodErs[0].start + timePeriodErs[0].length || 0).trim(); + } + } + if (ers.length === 0 || ers[0].length !== beforeStr.length) { + let valid = false; + if (ers.length > 0 && ers[0].start === 0) { + let midStr = beforeStr.substr(ers[0].start + ers[0].length || 0); + if (recognizersText.StringUtility.isNullOrWhitespace(midStr.replace(',', ' '))) { + valid = true; + } + } + if (!valid) { + ers = this.config.dateExtractor.extract(afterStr); + if (ers.length === 0 || ers[0].length !== afterStr.length) { + if (ers.length > 0 && ers[0].start + ers[0].length === afterStr.length) { + let midStr = afterStr.substr(0, ers[0].start || 0); + if (recognizersText.StringUtility.isNullOrWhitespace(midStr.replace(',', ' '))) { + valid = true; + } + } + } + else { + valid = true; + } + if (!valid) { + return result; + } + } + } + let hasSpecificTimePeriod = false; + if (timePeriodErs.length > 0) { + let TimePr = this.config.timePeriodParser.parse(timePeriodErs[0], referenceDate); + if (TimePr != null) { + let periodFuture = TimePr.value.futureValue; + let periodPast = TimePr.value.pastValue; + if (periodFuture === periodPast) { + matched.beginHour = periodFuture.item1.getHours(); + matched.endHour = periodFuture.item2.getHours(); + } + else { + if (periodFuture.item1.Hour >= matched.beginHour || periodFuture.item2.Hour <= matched.endHour) { + matched.beginHour = periodFuture.item1.getHours(); + matched.endHour = periodFuture.item2.getHours(); + } + else { + matched.beginHour = periodPast.item1.getHours(); + matched.endHour = periodPast.item2.getHours(); + } + } + hasSpecificTimePeriod = true; + } + } + let pr = this.config.dateParser.parse(ers[0], referenceDate); + if (!pr) + return result; + let futureDate = pr.value.futureValue; + let pastDate = pr.value.pastValue; + if (!hasSpecificTimePeriod) { + result.timex = pr.timexStr + matched.timeStr; + } + else { + result.timex = `(${pr.timexStr}T${matched.beginHour},${pr.timexStr}T${matched.endHour},PT${matched.endHour - matched.beginHour}H)`; + } + result.futureValue = [ + utilities$2.DateUtils.safeCreateFromMinValue(futureDate.getFullYear(), futureDate.getMonth(), futureDate.getDate(), matched.beginHour, 0, 0), + utilities$2.DateUtils.safeCreateFromMinValue(futureDate.getFullYear(), futureDate.getMonth(), futureDate.getDate(), matched.endHour, matched.endMin, matched.endMin), + ]; + result.pastValue = [ + utilities$2.DateUtils.safeCreateFromMinValue(pastDate.getFullYear(), pastDate.getMonth(), pastDate.getDate(), matched.beginHour, 0, 0), + utilities$2.DateUtils.safeCreateFromMinValue(pastDate.getFullYear(), pastDate.getMonth(), pastDate.getDate(), matched.endHour, matched.endMin, matched.endMin), + ]; + result.success = true; + return result; + } + parseDuration(source, referenceDate) { + let result = new utilities$2.DateTimeResolutionResult(); + // for rest of datetime, it will be handled in next function + let restOfDateTimeMatch = recognizersText.RegExpUtility.getMatches(this.config.restOfDateTimeRegex, source); + if (restOfDateTimeMatch.length) { + return result; + } + let ers = this.config.durationExtractor.extract(source, referenceDate); + if (!ers || ers.length !== 1) + return result; + let pr = this.config.durationParser.parse(ers[0], referenceDate); + if (!pr) + return result; + let beforeStr = source.substr(0, pr.start).trim(); + let durationResult = pr.value; + let swiftSecond = 0; + let mod; + if (Number.isFinite(durationResult.pastValue) && Number.isFinite(durationResult.futureValue)) { + swiftSecond = Math.round(durationResult.futureValue); + } + let beginTime = new Date(referenceDate); + let endTime = new Date(referenceDate); + let prefixMatch = recognizersText.RegExpUtility.getMatches(this.config.pastRegex, beforeStr).pop(); + if (prefixMatch && prefixMatch.length === beforeStr.length) { + mod = constants$2.TimeTypeConstants.beforeMod; + beginTime.setSeconds(referenceDate.getSeconds() - swiftSecond); + } + prefixMatch = recognizersText.RegExpUtility.getMatches(this.config.futureRegex, beforeStr).pop(); + if (prefixMatch && prefixMatch.length === beforeStr.length) { + mod = constants$2.TimeTypeConstants.afterMod; + endTime = new Date(beginTime); + endTime.setSeconds(beginTime.getSeconds() + swiftSecond); + } + let luisDateBegin = utilities$2.FormatUtil.luisDateFromDate(beginTime); + let luisTimeBegin = utilities$2.FormatUtil.luisTimeFromDate(beginTime); + let luisDateEnd = utilities$2.FormatUtil.luisDateFromDate(endTime); + let luisTimeEnd = utilities$2.FormatUtil.luisTimeFromDate(endTime); + result.timex = `(${luisDateBegin}T${luisTimeBegin},${luisDateEnd}T${luisTimeEnd},${durationResult.timex})`; + result.futureValue = [beginTime, endTime]; + result.pastValue = [beginTime, endTime]; + result.success = true; + if (mod) { + pr.value.mod = mod; + } + result.subDateTimeEntities = [pr]; + return result; + } + isFloat(value) { + return Number.isFinite(value) && !Number.isInteger(value); + } + parseRelativeUnit(source, referenceDate) { + let result = new utilities$2.DateTimeResolutionResult(); + let match = recognizersText.RegExpUtility.getMatches(this.config.relativeTimeUnitRegex, source).pop(); + if (!match) { + match = recognizersText.RegExpUtility.getMatches(this.config.restOfDateTimeRegex, source).pop(); + } + if (!match) + return result; + let srcUnit = match.groups('unit').value; + let unitStr = this.config.unitMap.get(srcUnit); + if (!unitStr) + return result; + let swift = 1; + let prefixMatch = recognizersText.RegExpUtility.getMatches(this.config.pastRegex, source).pop(); + if (prefixMatch) + swift = -1; + let beginTime = new Date(referenceDate); + let endTime = new Date(referenceDate); + let ptTimex = ''; + switch (unitStr) { + case 'D': + endTime = utilities$2.DateUtils.safeCreateFromMinValue(beginTime.getFullYear(), beginTime.getMonth(), beginTime.getDate()); + endTime.setDate(endTime.getDate() + 1); + endTime.setSeconds(endTime.getSeconds() - 1); + ptTimex = `PT${utilities$2.DateUtils.totalSeconds(endTime, beginTime)}S`; + break; + case 'H': + beginTime.setHours(beginTime.getHours() + (swift > 0 ? 0 : swift)); + endTime.setHours(endTime.getHours() + (swift > 0 ? swift : 0)); + ptTimex = `PT1H`; + break; + case 'M': + beginTime.setMinutes(beginTime.getMinutes() + (swift > 0 ? 0 : swift)); + endTime.setMinutes(endTime.getMinutes() + (swift > 0 ? swift : 0)); + ptTimex = `PT1M`; + break; + case 'S': + beginTime.setSeconds(beginTime.getSeconds() + (swift > 0 ? 0 : swift)); + endTime.setSeconds(endTime.getSeconds() + (swift > 0 ? swift : 0)); + ptTimex = `PT1S`; + break; + default: return result; + } + let luisDateBegin = utilities$2.FormatUtil.luisDateFromDate(beginTime); + let luisTimeBegin = utilities$2.FormatUtil.luisTimeFromDate(beginTime); + let luisDateEnd = utilities$2.FormatUtil.luisDateFromDate(endTime); + let luisTimeEnd = utilities$2.FormatUtil.luisTimeFromDate(endTime); + result.timex = `(${luisDateBegin}T${luisTimeBegin},${luisDateEnd}T${luisTimeEnd},${ptTimex})`; + result.futureValue = [beginTime, endTime]; + result.pastValue = [beginTime, endTime]; + result.success = true; + return result; + } +} +exports.BaseDateTimePeriodParser = BaseDateTimePeriodParser; + +}); + +unwrapExports(baseDateTimePeriod); + +var baseDuration = createCommonjsModule(function (module, exports) { +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); + + + + +class BaseDurationExtractor { + constructor(config) { + this.extractorName = constants$2.Constants.SYS_DATETIME_DURATION; + this.config = config; + } + extract(source, refDate) { + if (!refDate) + refDate = new Date(); + let baseTokens = this.numberWithUnit(source); + let tokens = new Array() + .concat(baseTokens) + .concat(this.numberWithUnitAndSuffix(source, baseTokens)) + .concat(this.implicitDuration(source)); + let result = utilities$2.Token.mergeAllTokens(tokens, source, this.extractorName); + this.resolveMoreThanOrLessThanPrefix(source, result); + return result; + } + // handle cases look like: {more than | less than} {duration}? + resolveMoreThanOrLessThanPrefix(text, ers) { + for (let er of ers) { + var beforeString = text.substr(0, er.start); + let match = recognizersText.RegExpUtility.getMatches(this.config.moreThanRegex, beforeString); + if (match && match.length) { + er.data = constants$2.TimeTypeConstants.moreThanMod; + } + if (!match || match.length === 0) { + match = recognizersText.RegExpUtility.getMatches(this.config.lessThanRegex, beforeString); + if (match && match.length) { + er.data = constants$2.TimeTypeConstants.lessThanMod; + } + } + if (match && match.length) { + er.length += er.start - match[0].index; + er.start = match[0].index; + er.text = text.substr(er.start, er.length); + } + } + } + numberWithUnit(source) { + return this.config.cardinalExtractor.extract(source) + .map(o => { + let afterString = source.substring(o.start + o.length); + let match = recognizersText.RegExpUtility.getMatches(this.config.followedUnit, afterString)[0]; + if (match && match.index === 0) { + return new utilities$2.Token(o.start | 0, o.start + o.length + match.length); + } + }).filter(o => o !== undefined) + .concat(this.getTokensFromRegex(this.config.numberCombinedWithUnit, source)) + .concat(this.getTokensFromRegex(this.config.anUnitRegex, source)) + .concat(this.getTokensFromRegex(this.config.inexactNumberUnitRegex, source)); + } + numberWithUnitAndSuffix(source, ers) { + return ers.map(o => { + let afterString = source.substring(o.start + o.length); + let match = recognizersText.RegExpUtility.getMatches(this.config.suffixAndRegex, afterString)[0]; + if (match && match.index === 0) { + return new utilities$2.Token(o.start | 0, o.start + o.length + match.length); + } + }); + } + implicitDuration(source) { + // handle "all day", "all year" + return this.getTokensFromRegex(this.config.allRegex, source) + // handle "half day", "half year" + .concat(this.getTokensFromRegex(this.config.halfRegex, source)) + // handle "next day", "last year" + .concat(this.getTokensFromRegex(this.config.relativeDurationUnitRegex, source)); + } + getTokensFromRegex(regexp, source) { + return recognizersText.RegExpUtility.getMatches(regexp, source) + .map(o => new utilities$2.Token(o.index, o.index + o.length)); + } +} +exports.BaseDurationExtractor = BaseDurationExtractor; +class BaseDurationParser { + constructor(config) { + this.parserName = constants$2.Constants.SYS_DATETIME_DURATION; + this.config = config; + } + parse(extractorResult, referenceDate) { + if (!referenceDate) + referenceDate = new Date(); + let resultValue; + if (extractorResult.type === this.parserName) { + let source = extractorResult.text.toLowerCase(); + let innerResult = this.parseNumberWithUnit(source, referenceDate); + if (!innerResult.success) { + innerResult = this.parseImplicitDuration(source, referenceDate); + } + if (innerResult.success) { + innerResult.futureResolution = {}; + innerResult.futureResolution[constants$2.TimeTypeConstants.DURATION] = innerResult.futureValue.toString(); + innerResult.pastResolution = {}; + innerResult.pastResolution[constants$2.TimeTypeConstants.DURATION] = innerResult.pastValue.toString(); + resultValue = innerResult; + } + } + var value = resultValue; + if (value && extractorResult.data) { + if (extractorResult.data === constants$2.TimeTypeConstants.moreThanMod || + extractorResult.data === constants$2.TimeTypeConstants.lessThanMod) { + value.mod = extractorResult.data; + } + } + let result = new parsers$4.DateTimeParseResult(extractorResult); + result.value = resultValue; + result.timexStr = resultValue ? resultValue.timex : ''; + result.resolutionStr = ''; + return result; + } + parseNumberWithUnit(source, referenceDate) { + let trimmedSource = source.trim(); + let result = this.parseNumberSpaceUnit(trimmedSource); + if (!result.success) { + result = this.parseNumberCombinedUnit(trimmedSource); + } + if (!result.success) { + result = this.parseAnUnit(trimmedSource); + } + if (!result.success) { + result = this.parseInexactNumberUnit(trimmedSource); + } + return result; + } + parseImplicitDuration(source, referenceDate) { + let trimmedSource = source.trim(); + // handle "all day" "all year" + let result = this.getResultFromRegex(this.config.allDateUnitRegex, trimmedSource, 1); + // handle "half day", "half year" + if (!result.success) { + result = this.getResultFromRegex(this.config.halfDateUnitRegex, trimmedSource, 0.5); + } + // handle single duration unit, it is filtered in the extraction that there is a relative word in advance + if (!result.success) { + result = this.getResultFromRegex(this.config.followedUnit, trimmedSource, 1); + } + return result; + } + getResultFromRegex(regex, source, num) { + let result = new utilities$2.DateTimeResolutionResult(); + let match = recognizersText.RegExpUtility.getMatches(regex, source).pop(); + if (!match) + return result; + let sourceUnit = match.groups('unit').value; + if (!this.config.unitMap.has(sourceUnit)) + return result; + let unitStr = this.config.unitMap.get(sourceUnit); + result.timex = `P${this.isLessThanDay(unitStr) ? 'T' : ''}${num}${unitStr[0]}`; + result.futureValue = num * this.config.unitValueMap.get(sourceUnit); + result.pastValue = result.futureValue; + result.success = true; + return result; + } + parseNumberSpaceUnit(source) { + let result = new utilities$2.DateTimeResolutionResult(); + let suffixStr = source; + let ers = this.config.cardinalExtractor.extract(source); + if (ers && ers.length === 1) { + let er = ers[0]; + let sourceUnit = ''; + let pr = this.config.numberParser.parse(er); + let noNumStr = source.substr(er.start + er.length).trim().toLowerCase(); + let match = recognizersText.RegExpUtility.getMatches(this.config.followedUnit, noNumStr).pop(); + if (match) { + sourceUnit = match.groups('unit').value; + suffixStr = match.groups('suffix').value; + } + if (this.config.unitMap.has(sourceUnit)) { + let num = Number.parseFloat(pr.value) + this.parseNumberWithUnitAndSuffix(suffixStr); + let unitStr = this.config.unitMap.get(sourceUnit); + result.timex = `P${this.isLessThanDay(unitStr) ? 'T' : ''}${num}${unitStr[0]}`; + result.futureValue = num * this.config.unitValueMap.get(sourceUnit); + result.pastValue = result.futureValue; + result.success = true; + return result; + } + } + return result; + } + parseNumberWithUnitAndSuffix(source) { + let match = recognizersText.RegExpUtility.getMatches(this.config.suffixAndRegex, source).pop(); + if (match) { + let numStr = match.groups('suffix_num').value; + if (this.config.doubleNumbers.has(numStr)) { + return this.config.doubleNumbers.get(numStr); + } + } + return 0; + } + parseNumberCombinedUnit(source) { + let result = new utilities$2.DateTimeResolutionResult(); + let match = recognizersText.RegExpUtility.getMatches(this.config.numberCombinedWithUnit, source).pop(); + if (!match) + return result; + let num = Number.parseFloat(match.groups('num').value) + this.parseNumberWithUnitAndSuffix(source); + let sourceUnit = match.groups('unit').value; + if (this.config.unitMap.has(sourceUnit)) { + let unitStr = this.config.unitMap.get(sourceUnit); + if (num > 1000 && (unitStr === 'Y' || unitStr === 'MON' || unitStr === 'W')) { + return result; + } + result.timex = `P${this.isLessThanDay(unitStr) ? 'T' : ''}${num}${unitStr[0]}`; + result.futureValue = num * this.config.unitValueMap.get(sourceUnit); + result.pastValue = result.futureValue; + result.success = true; + return result; + } + return result; + } + parseAnUnit(source) { + let result = new utilities$2.DateTimeResolutionResult(); + let match = recognizersText.RegExpUtility.getMatches(this.config.anUnitRegex, source).pop(); + if (!match) { + match = recognizersText.RegExpUtility.getMatches(this.config.halfDateUnitRegex, source).pop(); + } + if (!match) + return result; + let num = recognizersText.StringUtility.isNullOrEmpty(match.groups('half').value) ? 1 : 0.5; + num += this.parseNumberWithUnitAndSuffix(source); + let sourceUnit = match.groups('unit').value; + if (this.config.unitMap.has(sourceUnit)) { + let unitStr = this.config.unitMap.get(sourceUnit); + result.timex = `P${this.isLessThanDay(unitStr) ? 'T' : ''}${num}${unitStr[0]}`; + result.futureValue = num * this.config.unitValueMap.get(sourceUnit); + result.pastValue = result.futureValue; + result.success = true; + return result; + } + return result; + } + parseInexactNumberUnit(source) { + let result = new utilities$2.DateTimeResolutionResult(); + let match = recognizersText.RegExpUtility.getMatches(this.config.inexactNumberUnitRegex, source).pop(); + if (!match) + return result; + let num; + if (match.groups('NumTwoTerm').value) { + num = 2; + } + else { + // set the inexact number "few", "some" to 3 for now + num = 3; + } + let sourceUnit = match.groups('unit').value; + if (this.config.unitMap.has(sourceUnit)) { + let unitStr = this.config.unitMap.get(sourceUnit); + if (num > 1000 && (unitStr === 'Y' || unitStr === 'MON' || unitStr === 'W')) { + return result; + } + result.timex = `P${this.isLessThanDay(unitStr) ? 'T' : ''}${num}${unitStr[0]}`; + result.futureValue = num * this.config.unitValueMap.get(sourceUnit); + result.pastValue = result.futureValue; + result.success = true; + return result; + } + return result; + } + isLessThanDay(source) { + return (source === 'S') || (source === 'M') || (source === 'H'); + } +} +exports.BaseDurationParser = BaseDurationParser; + +}); + +unwrapExports(baseDuration); + +var durationConfiguration = createCommonjsModule(function (module, exports) { +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); + + + +class EnglishDurationExtractorConfiguration { + constructor() { + this.allRegex = recognizersText.RegExpUtility.getSafeRegExp(englishDateTime.EnglishDateTime.AllRegex); + this.halfRegex = recognizersText.RegExpUtility.getSafeRegExp(englishDateTime.EnglishDateTime.HalfRegex); + this.followedUnit = recognizersText.RegExpUtility.getSafeRegExp(englishDateTime.EnglishDateTime.DurationFollowedUnit); + this.numberCombinedWithUnit = recognizersText.RegExpUtility.getSafeRegExp(englishDateTime.EnglishDateTime.NumberCombinedWithDurationUnit); + this.anUnitRegex = recognizersText.RegExpUtility.getSafeRegExp(englishDateTime.EnglishDateTime.AnUnitRegex); + this.inexactNumberUnitRegex = recognizersText.RegExpUtility.getSafeRegExp(englishDateTime.EnglishDateTime.InexactNumberUnitRegex); + this.suffixAndRegex = recognizersText.RegExpUtility.getSafeRegExp(englishDateTime.EnglishDateTime.SuffixAndRegex); + this.relativeDurationUnitRegex = recognizersText.RegExpUtility.getSafeRegExp(englishDateTime.EnglishDateTime.RelativeDurationUnitRegex); + this.moreThanRegex = recognizersText.RegExpUtility.getSafeRegExp(englishDateTime.EnglishDateTime.MoreThanRegex); + this.lessThanRegex = recognizersText.RegExpUtility.getSafeRegExp(englishDateTime.EnglishDateTime.LessThanRegex); + this.cardinalExtractor = new recognizersTextNumber.EnglishCardinalExtractor(); + } +} +exports.EnglishDurationExtractorConfiguration = EnglishDurationExtractorConfiguration; +class EnglishDurationParserConfiguration { + constructor(config) { + this.cardinalExtractor = config.cardinalExtractor; + this.numberParser = config.numberParser; + this.followedUnit = recognizersText.RegExpUtility.getSafeRegExp(englishDateTime.EnglishDateTime.DurationFollowedUnit); + this.suffixAndRegex = recognizersText.RegExpUtility.getSafeRegExp(englishDateTime.EnglishDateTime.SuffixAndRegex); + this.numberCombinedWithUnit = recognizersText.RegExpUtility.getSafeRegExp(englishDateTime.EnglishDateTime.NumberCombinedWithDurationUnit); + this.anUnitRegex = recognizersText.RegExpUtility.getSafeRegExp(englishDateTime.EnglishDateTime.AnUnitRegex); + this.allDateUnitRegex = recognizersText.RegExpUtility.getSafeRegExp(englishDateTime.EnglishDateTime.AllRegex); + this.halfDateUnitRegex = recognizersText.RegExpUtility.getSafeRegExp(englishDateTime.EnglishDateTime.HalfRegex); + this.inexactNumberUnitRegex = recognizersText.RegExpUtility.getSafeRegExp(englishDateTime.EnglishDateTime.InexactNumberUnitRegex); + this.unitMap = config.unitMap; + this.unitValueMap = config.unitValueMap; + this.doubleNumbers = config.doubleNumbers; + } +} +exports.EnglishDurationParserConfiguration = EnglishDurationParserConfiguration; + +}); + +unwrapExports(durationConfiguration); + +var timeConfiguration = createCommonjsModule(function (module, exports) { +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); + + +class EnglishTimeExtractorConfiguration { + constructor() { + this.timeRegexList = EnglishTimeExtractorConfiguration.timeRegexList; + this.atRegex = EnglishTimeExtractorConfiguration.atRegex; + this.ishRegex = EnglishTimeExtractorConfiguration.ishRegex; + } +} +EnglishTimeExtractorConfiguration.timeRegexList = [ + // (three min past)? seven|7|(seven thirty) pm + recognizersText.RegExpUtility.getSafeRegExp(englishDateTime.EnglishDateTime.TimeRegex1, "gis"), + // (three min past)? 3:00(:00)? (pm)? + recognizersText.RegExpUtility.getSafeRegExp(englishDateTime.EnglishDateTime.TimeRegex2, "gis"), + // (three min past)? 3.00 (pm) + recognizersText.RegExpUtility.getSafeRegExp(englishDateTime.EnglishDateTime.TimeRegex3, "gis"), + // (three min past) (five thirty|seven|7|7:00(:00)?) (pm)? (in the night) + recognizersText.RegExpUtility.getSafeRegExp(englishDateTime.EnglishDateTime.TimeRegex4, "gis"), + // (three min past) (five thirty|seven|7|7:00(:00)?) (pm)? + recognizersText.RegExpUtility.getSafeRegExp(englishDateTime.EnglishDateTime.TimeRegex5, "gis"), + // (five thirty|seven|7|7:00(:00)?) (pm)? (in the night) + recognizersText.RegExpUtility.getSafeRegExp(englishDateTime.EnglishDateTime.TimeRegex6, "gis"), + // (in the night) at (five thirty|seven|7|7:00(:00)?) (pm)? + recognizersText.RegExpUtility.getSafeRegExp(englishDateTime.EnglishDateTime.TimeRegex7, "gis"), + // (in the night) (five thirty|seven|7|7:00(:00)?) (pm)? + recognizersText.RegExpUtility.getSafeRegExp(englishDateTime.EnglishDateTime.TimeRegex8, "gis"), + recognizersText.RegExpUtility.getSafeRegExp(englishDateTime.EnglishDateTime.TimeRegex9, "gis"), + // (three min past)? 3h00 (pm)? + recognizersText.RegExpUtility.getSafeRegExp(englishDateTime.EnglishDateTime.TimeRegex10, "gis"), + // at 2.30, before 6.30pm. 'at' prefix or 'am/pm' suffix is required here + recognizersText.RegExpUtility.getSafeRegExp(englishDateTime.EnglishDateTime.TimeRegex11, "gis"), + // 340pm + recognizersText.RegExpUtility.getSafeRegExp(englishDateTime.EnglishDateTime.ConnectNumRegex, "gis") +]; +EnglishTimeExtractorConfiguration.atRegex = recognizersText.RegExpUtility.getSafeRegExp(englishDateTime.EnglishDateTime.AtRegex, "gis"); +EnglishTimeExtractorConfiguration.lessThanOneHour = recognizersText.RegExpUtility.getSafeRegExp(englishDateTime.EnglishDateTime.LessThanOneHour, "gis"); +EnglishTimeExtractorConfiguration.timeSuffix = recognizersText.RegExpUtility.getSafeRegExp(englishDateTime.EnglishDateTime.TimeSuffix, "gis"); +EnglishTimeExtractorConfiguration.timeSuffixFull = recognizersText.RegExpUtility.getSafeRegExp(englishDateTime.EnglishDateTime.TimeSuffixFull, "gis"); +EnglishTimeExtractorConfiguration.ishRegex = recognizersText.RegExpUtility.getSafeRegExp(englishDateTime.EnglishDateTime.IshRegex, "gis"); +exports.EnglishTimeExtractorConfiguration = EnglishTimeExtractorConfiguration; +class EnglishTimeParserConfiguration { + constructor(config) { + this.timeTokenPrefix = englishDateTime.EnglishDateTime.TimeTokenPrefix; + this.atRegex = EnglishTimeExtractorConfiguration.atRegex; + this.timeRegexes = EnglishTimeExtractorConfiguration.timeRegexList; + this.numbers = config.numbers; + this.lunchRegex = recognizersText.RegExpUtility.getSafeRegExp(englishDateTime.EnglishDateTime.LunchRegex); + this.timeSuffixFull = recognizersText.RegExpUtility.getSafeRegExp(englishDateTime.EnglishDateTime.TimeSuffixFull); + this.nightRegex = recognizersText.RegExpUtility.getSafeRegExp(englishDateTime.EnglishDateTime.NightRegex); + this.utilityConfiguration = config.utilityConfiguration; + } + adjustByPrefix(prefix, adjust) { + let deltaMin = 0; + let trimmedPrefix = prefix.trim().toLowerCase(); + if (trimmedPrefix.startsWith("half")) { + deltaMin = 30; + } + else if (trimmedPrefix.startsWith("a quarter") || trimmedPrefix.startsWith("quarter")) { + deltaMin = 15; + } + else if (trimmedPrefix.startsWith("three quarter")) { + deltaMin = 45; + } + else { + let match = recognizersText.RegExpUtility.getMatches(EnglishTimeExtractorConfiguration.lessThanOneHour, trimmedPrefix); + let minStr = match[0].groups("deltamin").value; + if (minStr) { + deltaMin = Number.parseInt(minStr, 10); + } + else { + minStr = match[0].groups("deltaminnum").value.toLowerCase(); + deltaMin = this.numbers.get(minStr); + } + } + if (trimmedPrefix.endsWith("to")) { + deltaMin = -deltaMin; + } + adjust.min += deltaMin; + if (adjust.min < 0) { + adjust.min += 60; + adjust.hour -= 1; + } + adjust.hasMin = true; + } + adjustBySuffix(suffix, adjust) { + let trimmedSuffix = suffix.trim().toLowerCase(); + let deltaHour = 0; + let matches = recognizersText.RegExpUtility.getMatches(EnglishTimeExtractorConfiguration.timeSuffixFull, trimmedSuffix); + if (matches.length > 0 && matches[0].index === 0 && matches[0].length === trimmedSuffix.length) { + let oclockStr = matches[0].groups("oclock").value; + if (!oclockStr) { + let amStr = matches[0].groups("am").value; + if (amStr) { + if (adjust.hour >= 12) { + deltaHour = -12; + } + else { + adjust.hasAm = true; + } + } + let pmStr = matches[0].groups("pm").value; + if (pmStr) { + if (adjust.hour < 12) { + deltaHour = 12; + } + if (recognizersText.RegExpUtility.getMatches(this.lunchRegex, pmStr).length > 0) { + // for hour>=10, <12 + if (adjust.hour >= 10 && adjust.hour <= 12) { + deltaHour = 0; + if (adjust.hour === 12) { + adjust.hasPm = true; + } + else { + adjust.hasAm = true; + } + } + else { + adjust.hasPm = true; + } + } + else if (recognizersText.RegExpUtility.getMatches(this.nightRegex, pmStr).length > 0) { + // for hour <=3 or === 12, we treat it as am, for example 1 in the night (midnight) === 1am + if (adjust.hour <= 3 || adjust.hour === 12) { + if (adjust.hour === 12) { + adjust.hour = 0; + } + deltaHour = 0; + adjust.hasAm = true; + } + else { + adjust.hasPm = true; + } + } + else { + adjust.hasPm = true; + } + } + } + } + adjust.hour = (adjust.hour + deltaHour) % 24; + } +} +exports.EnglishTimeParserConfiguration = EnglishTimeParserConfiguration; + +}); + +unwrapExports(timeConfiguration); + +var dateConfiguration = createCommonjsModule(function (module, exports) { +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); + + + + + + + +class EnglishDateExtractorConfiguration { + constructor() { + this.dateRegexList = [ + recognizersText.RegExpUtility.getSafeRegExp(englishDateTime.EnglishDateTime.DateExtractor1), + recognizersText.RegExpUtility.getSafeRegExp(englishDateTime.EnglishDateTime.DateExtractor2), + recognizersText.RegExpUtility.getSafeRegExp(englishDateTime.EnglishDateTime.DateExtractor3), + englishDateTime.EnglishDateTime.DefaultLanguageFallback === constants$2.Constants.DefaultLanguageFallback_MDY ? + recognizersText.RegExpUtility.getSafeRegExp(englishDateTime.EnglishDateTime.DateExtractor4) : + recognizersText.RegExpUtility.getSafeRegExp(englishDateTime.EnglishDateTime.DateExtractor5), + englishDateTime.EnglishDateTime.DefaultLanguageFallback === constants$2.Constants.DefaultLanguageFallback_MDY ? + recognizersText.RegExpUtility.getSafeRegExp(englishDateTime.EnglishDateTime.DateExtractor5) : + recognizersText.RegExpUtility.getSafeRegExp(englishDateTime.EnglishDateTime.DateExtractor4), + recognizersText.RegExpUtility.getSafeRegExp(englishDateTime.EnglishDateTime.DateExtractor6), + recognizersText.RegExpUtility.getSafeRegExp(englishDateTime.EnglishDateTime.DateExtractor7), + recognizersText.RegExpUtility.getSafeRegExp(englishDateTime.EnglishDateTime.DateExtractor8), + recognizersText.RegExpUtility.getSafeRegExp(englishDateTime.EnglishDateTime.DateExtractor9), + recognizersText.RegExpUtility.getSafeRegExp(englishDateTime.EnglishDateTime.DateExtractorA), + ]; + this.implicitDateList = [ + recognizersText.RegExpUtility.getSafeRegExp(englishDateTime.EnglishDateTime.OnRegex), + recognizersText.RegExpUtility.getSafeRegExp(englishDateTime.EnglishDateTime.RelaxedOnRegex), + recognizersText.RegExpUtility.getSafeRegExp(englishDateTime.EnglishDateTime.SpecialDayRegex), + recognizersText.RegExpUtility.getSafeRegExp(englishDateTime.EnglishDateTime.SpecialDayWithNumRegex), + recognizersText.RegExpUtility.getSafeRegExp(englishDateTime.EnglishDateTime.ThisRegex), + recognizersText.RegExpUtility.getSafeRegExp(englishDateTime.EnglishDateTime.LastDateRegex), + recognizersText.RegExpUtility.getSafeRegExp(englishDateTime.EnglishDateTime.NextDateRegex), + recognizersText.RegExpUtility.getSafeRegExp(englishDateTime.EnglishDateTime.SingleWeekDayRegex), + recognizersText.RegExpUtility.getSafeRegExp(englishDateTime.EnglishDateTime.WeekDayOfMonthRegex), + recognizersText.RegExpUtility.getSafeRegExp(englishDateTime.EnglishDateTime.SpecialDate), + recognizersText.RegExpUtility.getSafeRegExp(englishDateTime.EnglishDateTime.RelativeWeekDayRegex), + ]; + this.monthEnd = recognizersText.RegExpUtility.getSafeRegExp(englishDateTime.EnglishDateTime.MonthEnd); + this.ofMonth = recognizersText.RegExpUtility.getSafeRegExp(englishDateTime.EnglishDateTime.OfMonth); + this.dateUnitRegex = recognizersText.RegExpUtility.getSafeRegExp(englishDateTime.EnglishDateTime.DateUnitRegex); + this.forTheRegex = recognizersText.RegExpUtility.getSafeRegExp(englishDateTime.EnglishDateTime.ForTheRegex); + this.weekDayAndDayOfMonthRegex = recognizersText.RegExpUtility.getSafeRegExp(englishDateTime.EnglishDateTime.WeekDayAndDayOfMonthRegex); + this.relativeMonthRegex = recognizersText.RegExpUtility.getSafeRegExp(englishDateTime.EnglishDateTime.RelativeMonthRegex); + this.weekDayRegex = recognizersText.RegExpUtility.getSafeRegExp(englishDateTime.EnglishDateTime.WeekDayRegex); + this.dayOfWeek = englishDateTime.EnglishDateTime.DayOfWeek; + this.ordinalExtractor = new recognizersTextNumber.EnglishOrdinalExtractor(); + this.integerExtractor = new recognizersTextNumber.EnglishIntegerExtractor(); + this.numberParser = new recognizersTextNumber.BaseNumberParser(new recognizersTextNumber.EnglishNumberParserConfiguration()); + this.durationExtractor = new baseDuration.BaseDurationExtractor(new durationConfiguration.EnglishDurationExtractorConfiguration()); + this.utilityConfiguration = new baseConfiguration.EnglishDateTimeUtilityConfiguration(); + } +} +exports.EnglishDateExtractorConfiguration = EnglishDateExtractorConfiguration; +class EnglishDateParserConfiguration { + constructor(config) { + this.ordinalExtractor = config.ordinalExtractor; + this.integerExtractor = config.integerExtractor; + this.cardinalExtractor = config.cardinalExtractor; + this.durationExtractor = config.durationExtractor; + this.numberParser = config.numberParser; + this.durationParser = config.durationParser; + this.monthOfYear = config.monthOfYear; + this.dayOfMonth = config.dayOfMonth; + this.dayOfWeek = config.dayOfWeek; + this.unitMap = config.unitMap; + this.cardinalMap = config.cardinalMap; + this.dateRegex = new EnglishDateExtractorConfiguration().dateRegexList; + this.onRegex = recognizersText.RegExpUtility.getSafeRegExp(englishDateTime.EnglishDateTime.OnRegex); + this.specialDayRegex = recognizersText.RegExpUtility.getSafeRegExp(englishDateTime.EnglishDateTime.SpecialDayRegex); + this.specialDayWithNumRegex = recognizersText.RegExpUtility.getSafeRegExp(englishDateTime.EnglishDateTime.SpecialDayWithNumRegex); + this.nextRegex = recognizersText.RegExpUtility.getSafeRegExp(englishDateTime.EnglishDateTime.NextDateRegex); + this.unitRegex = recognizersText.RegExpUtility.getSafeRegExp(englishDateTime.EnglishDateTime.DateUnitRegex); + this.monthRegex = recognizersText.RegExpUtility.getSafeRegExp(englishDateTime.EnglishDateTime.MonthRegex); + this.weekDayRegex = recognizersText.RegExpUtility.getSafeRegExp(englishDateTime.EnglishDateTime.WeekDayRegex); + this.lastRegex = recognizersText.RegExpUtility.getSafeRegExp(englishDateTime.EnglishDateTime.LastDateRegex); + this.thisRegex = recognizersText.RegExpUtility.getSafeRegExp(englishDateTime.EnglishDateTime.ThisRegex); + this.weekDayOfMonthRegex = recognizersText.RegExpUtility.getSafeRegExp(englishDateTime.EnglishDateTime.WeekDayOfMonthRegex); + this.forTheRegex = recognizersText.RegExpUtility.getSafeRegExp(englishDateTime.EnglishDateTime.ForTheRegex); + this.weekDayAndDayOfMonthRegex = recognizersText.RegExpUtility.getSafeRegExp(englishDateTime.EnglishDateTime.WeekDayAndDayOfMonthRegex); + this.relativeMonthRegex = recognizersText.RegExpUtility.getSafeRegExp(englishDateTime.EnglishDateTime.RelativeMonthRegex); + this.relativeWeekDayRegex = recognizersText.RegExpUtility.getSafeRegExp(englishDateTime.EnglishDateTime.RelativeWeekDayRegex); + this.utilityConfiguration = config.utilityConfiguration; + this.dateTokenPrefix = englishDateTime.EnglishDateTime.DateTokenPrefix; + } + getSwiftDay(source) { + let trimmedText = source.trim().toLowerCase(); + let swift = 0; + let matches = recognizersText.RegExpUtility.getMatches(EnglishDateParserConfiguration.relativeDayRegex, source); + if (trimmedText === "today") { + swift = 0; + } + else if (trimmedText === "tomorrow" || trimmedText === "tmr") { + swift = 1; + } + else if (trimmedText === "yesterday") { + swift = -1; + } + else if (trimmedText.endsWith("day after tomorrow") || + trimmedText.endsWith("day after tmr")) { + swift = 2; + } + else if (trimmedText.endsWith("day before yesterday")) { + swift = -2; + } + else if (matches.length) { + swift = this.getSwift(source); + } + return swift; + } + getSwiftMonth(source) { + return this.getSwift(source); + } + getSwift(source) { + let trimmedText = source.trim().toLowerCase(); + let swift = 0; + let nextPrefixMatches = recognizersText.RegExpUtility.getMatches(EnglishDateParserConfiguration.nextPrefixRegex, trimmedText); + let pastPrefixMatches = recognizersText.RegExpUtility.getMatches(EnglishDateParserConfiguration.pastPrefixRegex, trimmedText); + if (nextPrefixMatches.length) { + swift = 1; + } + else if (pastPrefixMatches.length) { + swift = -1; + } + return swift; + } + isCardinalLast(source) { + let trimmedText = source.trim().toLowerCase(); + return trimmedText === "last"; + } +} +// The following three regexes only used in this configuration +// They are not used in the base parser, therefore they are not extracted +// If the spanish date parser need the same regexes, they should be extracted +EnglishDateParserConfiguration.relativeDayRegex = recognizersText.RegExpUtility.getSafeRegExp(englishDateTime.EnglishDateTime.RelativeDayRegex); +EnglishDateParserConfiguration.nextPrefixRegex = recognizersText.RegExpUtility.getSafeRegExp(englishDateTime.EnglishDateTime.NextPrefixRegex); +EnglishDateParserConfiguration.pastPrefixRegex = recognizersText.RegExpUtility.getSafeRegExp(englishDateTime.EnglishDateTime.PastPrefixRegex); +exports.EnglishDateParserConfiguration = EnglishDateParserConfiguration; + +}); + +unwrapExports(dateConfiguration); + +var dateTimeConfiguration = createCommonjsModule(function (module, exports) { +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); + + + + + + + + + +class EnglishDateTimeExtractorConfiguration { + constructor() { + this.datePointExtractor = new baseDate.BaseDateExtractor(new dateConfiguration.EnglishDateExtractorConfiguration()); + this.timePointExtractor = new baseTime.BaseTimeExtractor(new timeConfiguration.EnglishTimeExtractorConfiguration()); + this.durationExtractor = new baseDuration.BaseDurationExtractor(new durationConfiguration.EnglishDurationExtractorConfiguration()); + this.suffixRegex = recognizersText.RegExpUtility.getSafeRegExp(englishDateTime.EnglishDateTime.SuffixRegex); + this.nowRegex = recognizersText.RegExpUtility.getSafeRegExp(englishDateTime.EnglishDateTime.NowRegex); + this.timeOfTodayAfterRegex = recognizersText.RegExpUtility.getSafeRegExp(englishDateTime.EnglishDateTime.TimeOfTodayAfterRegex); + this.simpleTimeOfTodayAfterRegex = recognizersText.RegExpUtility.getSafeRegExp(englishDateTime.EnglishDateTime.SimpleTimeOfTodayAfterRegex); + this.nightRegex = recognizersText.RegExpUtility.getSafeRegExp(englishDateTime.EnglishDateTime.TimeOfDayRegex); + this.timeOfTodayBeforeRegex = recognizersText.RegExpUtility.getSafeRegExp(englishDateTime.EnglishDateTime.TimeOfTodayBeforeRegex); + this.simpleTimeOfTodayBeforeRegex = recognizersText.RegExpUtility.getSafeRegExp(englishDateTime.EnglishDateTime.SimpleTimeOfTodayBeforeRegex); + this.theEndOfRegex = recognizersText.RegExpUtility.getSafeRegExp(englishDateTime.EnglishDateTime.TheEndOfRegex); + this.unitRegex = recognizersText.RegExpUtility.getSafeRegExp(englishDateTime.EnglishDateTime.TimeUnitRegex); + this.prepositionRegex = recognizersText.RegExpUtility.getSafeRegExp(englishDateTime.EnglishDateTime.PrepositionRegex); + this.connectorRegex = recognizersText.RegExpUtility.getSafeRegExp(englishDateTime.EnglishDateTime.ConnectorRegex); + this.utilityConfiguration = new baseConfiguration.EnglishDateTimeUtilityConfiguration(); + } + isConnectorToken(source) { + return (recognizersText.StringUtility.isNullOrWhitespace(source) + || recognizersText.RegExpUtility.getMatches(this.connectorRegex, source).length > 0 + || recognizersText.RegExpUtility.getMatches(this.prepositionRegex, source).length > 0); + } +} +exports.EnglishDateTimeExtractorConfiguration = EnglishDateTimeExtractorConfiguration; +class EnglishDateTimeParserConfiguration { + constructor(config) { + this.tokenBeforeDate = englishDateTime.EnglishDateTime.TokenBeforeDate; + this.tokenBeforeTime = englishDateTime.EnglishDateTime.TokenBeforeTime; + this.dateExtractor = config.dateExtractor; + this.timeExtractor = config.timeExtractor; + this.dateParser = config.dateParser; + this.timeParser = config.timeParser; + this.nowRegex = recognizersText.RegExpUtility.getSafeRegExp(englishDateTime.EnglishDateTime.NowRegex); + this.amTimeRegex = recognizersText.RegExpUtility.getSafeRegExp(englishDateTime.EnglishDateTime.AMTimeRegex); + this.pmTimeRegex = recognizersText.RegExpUtility.getSafeRegExp(englishDateTime.EnglishDateTime.PMTimeRegex); + this.simpleTimeOfTodayAfterRegex = recognizersText.RegExpUtility.getSafeRegExp(englishDateTime.EnglishDateTime.SimpleTimeOfTodayAfterRegex); + this.simpleTimeOfTodayBeforeRegex = recognizersText.RegExpUtility.getSafeRegExp(englishDateTime.EnglishDateTime.SimpleTimeOfTodayBeforeRegex); + this.specificTimeOfDayRegex = recognizersText.RegExpUtility.getSafeRegExp(englishDateTime.EnglishDateTime.SpecificTimeOfDayRegex); + this.theEndOfRegex = recognizersText.RegExpUtility.getSafeRegExp(englishDateTime.EnglishDateTime.TheEndOfRegex); + this.unitRegex = recognizersText.RegExpUtility.getSafeRegExp(englishDateTime.EnglishDateTime.TimeUnitRegex); + this.numbers = config.numbers; + this.cardinalExtractor = config.cardinalExtractor; + this.numberParser = config.numberParser; + this.durationExtractor = config.durationExtractor; + this.durationParser = config.durationParser; + this.unitMap = config.unitMap; + this.utilityConfiguration = config.utilityConfiguration; + } + getHour(text, hour) { + let trimmedText = text.trim().toLowerCase(); + let result = hour; + if (trimmedText.endsWith("morning") && hour >= 12) { + result -= 12; + } + else if (!trimmedText.endsWith("morning") && hour < 12) { + result += 12; + } + return result; + } + getMatchedNowTimex(text) { + let trimmedText = text.trim().toLowerCase(); + let timex; + if (trimmedText.endsWith("now")) { + timex = "PRESENT_REF"; + } + else if (trimmedText === "recently" || trimmedText === "previously") { + timex = "PAST_REF"; + } + else if (trimmedText === "as soon as possible" || trimmedText === "asap") { + timex = "FUTURE_REF"; + } + else { + timex = null; + return { matched: false, timex: timex }; + } + return { matched: true, timex: timex }; + } + getSwiftDay(text) { + let trimmedText = text.trim().toLowerCase(); + let swift = 0; + if (trimmedText.startsWith("next")) { + swift = 1; + } + else if (trimmedText.startsWith("last")) { + swift = -1; + } + return swift; + } + haveAmbiguousToken(text, matchedText) { return false; } +} +exports.EnglishDateTimeParserConfiguration = EnglishDateTimeParserConfiguration; + +}); + +unwrapExports(dateTimeConfiguration); + +var timePeriodConfiguration = createCommonjsModule(function (module, exports) { +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); + + + + + +class EnglishTimePeriodExtractorConfiguration { + constructor() { + this.simpleCasesRegex = [ + recognizersText.RegExpUtility.getSafeRegExp(englishDateTime.EnglishDateTime.PureNumFromTo, "gis"), + recognizersText.RegExpUtility.getSafeRegExp(englishDateTime.EnglishDateTime.PureNumBetweenAnd, "gis") + ]; + this.tillRegex = recognizersText.RegExpUtility.getSafeRegExp(englishDateTime.EnglishDateTime.TillRegex, "gis"); + this.timeOfDayRegex = recognizersText.RegExpUtility.getSafeRegExp(englishDateTime.EnglishDateTime.TimeOfDayRegex, "gis"); + this.generalEndingRegex = recognizersText.RegExpUtility.getSafeRegExp(englishDateTime.EnglishDateTime.GeneralEndingRegex, "gis"); + this.singleTimeExtractor = new baseTime.BaseTimeExtractor(new timeConfiguration.EnglishTimeExtractorConfiguration()); + this.integerExtractor = new recognizersTextNumber.EnglishIntegerExtractor(); + } + getFromTokenIndex(source) { + let index = -1; + if (source.endsWith("from")) { + index = source.lastIndexOf("from"); + return { matched: true, index: index }; + } + return { matched: false, index: index }; + } + getBetweenTokenIndex(source) { + let index = -1; + if (source.endsWith("between")) { + index = source.lastIndexOf("between"); + return { matched: true, index: index }; + } + return { matched: false, index: index }; + } + hasConnectorToken(source) { + return source === "and"; + } +} +exports.EnglishTimePeriodExtractorConfiguration = EnglishTimePeriodExtractorConfiguration; +class EnglishTimePeriodParserConfiguration { + constructor(config) { + this.timeExtractor = config.timeExtractor; + this.timeParser = config.timeParser; + this.integerExtractor = config.integerExtractor; + this.pureNumberFromToRegex = recognizersText.RegExpUtility.getSafeRegExp(englishDateTime.EnglishDateTime.PureNumFromTo); + this.pureNumberBetweenAndRegex = recognizersText.RegExpUtility.getSafeRegExp(englishDateTime.EnglishDateTime.PureNumBetweenAnd); + this.timeOfDayRegex = recognizersText.RegExpUtility.getSafeRegExp(englishDateTime.EnglishDateTime.TimeOfDayRegex); + this.tillRegex = recognizersText.RegExpUtility.getSafeRegExp(englishDateTime.EnglishDateTime.TillRegex, "gis"); + this.numbers = config.numbers; + this.utilityConfiguration = config.utilityConfiguration; + this.specificTimeFromToRegex = recognizersText.RegExpUtility.getSafeRegExp(englishDateTime.EnglishDateTime.SpecificTimeFromTo); + this.specificTimeBetweenAndRegex = recognizersText.RegExpUtility.getSafeRegExp(englishDateTime.EnglishDateTime.SpecificTimeBetweenAnd); + } + getMatchedTimexRange(text) { + let trimmedText = text.trim().toLowerCase(); + if (trimmedText.endsWith("s")) { + trimmedText = trimmedText.substring(0, trimmedText.length - 1); + } + let result = { + matched: false, + timex: '', + beginHour: 0, + endHour: 0, + endMin: 0 + }; + if (trimmedText.endsWith("morning")) { + result.timex = "TMO"; + result.beginHour = 8; + result.endHour = 12; + } + else if (trimmedText.endsWith("afternoon")) { + result.timex = "TAF"; + result.beginHour = 12; + result.endHour = 16; + } + else if (trimmedText.endsWith("evening")) { + result.timex = "TEV"; + result.beginHour = 16; + result.endHour = 20; + } + else if (trimmedText === "daytime") { + result.timex = "TDT"; + result.beginHour = 8; + result.endHour = 18; + } + else if (trimmedText.endsWith("night")) { + result.timex = "TNI"; + result.beginHour = 20; + result.endHour = 23; + result.endMin = 59; + } + else { + result.timex = null; + result.matched = false; + return result; + } + result.matched = true; + return result; + } +} +exports.EnglishTimePeriodParserConfiguration = EnglishTimePeriodParserConfiguration; + +}); + +unwrapExports(timePeriodConfiguration); + +var datePeriodConfiguration = createCommonjsModule(function (module, exports) { +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); + + + + + + + + +class EnglishDatePeriodExtractorConfiguration { + constructor() { + this.simpleCasesRegexes = [ + recognizersText.RegExpUtility.getSafeRegExp(englishDateTime.EnglishDateTime.SimpleCasesRegex), + recognizersText.RegExpUtility.getSafeRegExp(englishDateTime.EnglishDateTime.BetweenRegex), + recognizersText.RegExpUtility.getSafeRegExp(englishDateTime.EnglishDateTime.OneWordPeriodRegex), + recognizersText.RegExpUtility.getSafeRegExp(englishDateTime.EnglishDateTime.MonthWithYear), + recognizersText.RegExpUtility.getSafeRegExp(englishDateTime.EnglishDateTime.MonthNumWithYear), + recognizersText.RegExpUtility.getSafeRegExp(englishDateTime.EnglishDateTime.YearRegex), + recognizersText.RegExpUtility.getSafeRegExp(englishDateTime.EnglishDateTime.WeekOfMonthRegex), + recognizersText.RegExpUtility.getSafeRegExp(englishDateTime.EnglishDateTime.WeekOfYearRegex), + recognizersText.RegExpUtility.getSafeRegExp(englishDateTime.EnglishDateTime.MonthFrontBetweenRegex), + recognizersText.RegExpUtility.getSafeRegExp(englishDateTime.EnglishDateTime.MonthFrontSimpleCasesRegex), + recognizersText.RegExpUtility.getSafeRegExp(englishDateTime.EnglishDateTime.QuarterRegex), + recognizersText.RegExpUtility.getSafeRegExp(englishDateTime.EnglishDateTime.QuarterRegexYearFront), + recognizersText.RegExpUtility.getSafeRegExp(englishDateTime.EnglishDateTime.AllHalfYearRegex), + recognizersText.RegExpUtility.getSafeRegExp(englishDateTime.EnglishDateTime.SeasonRegex), + recognizersText.RegExpUtility.getSafeRegExp(englishDateTime.EnglishDateTime.WhichWeekRegex), + recognizersText.RegExpUtility.getSafeRegExp(englishDateTime.EnglishDateTime.RestOfDateRegex), + recognizersText.RegExpUtility.getSafeRegExp(englishDateTime.EnglishDateTime.LaterEarlyPeriodRegex), + recognizersText.RegExpUtility.getSafeRegExp(englishDateTime.EnglishDateTime.WeekWithWeekDayRangeRegex) + ]; + this.illegalYearRegex = recognizersText.RegExpUtility.getSafeRegExp(baseDateTime.BaseDateTime.IllegalYearRegex); + this.YearRegex = recognizersText.RegExpUtility.getSafeRegExp(englishDateTime.EnglishDateTime.YearRegex); + this.tillRegex = recognizersText.RegExpUtility.getSafeRegExp(englishDateTime.EnglishDateTime.TillRegex); + this.followedUnit = recognizersText.RegExpUtility.getSafeRegExp(englishDateTime.EnglishDateTime.FollowedDateUnit); + this.numberCombinedWithUnit = recognizersText.RegExpUtility.getSafeRegExp(englishDateTime.EnglishDateTime.NumberCombinedWithDateUnit); + this.pastRegex = recognizersText.RegExpUtility.getSafeRegExp(englishDateTime.EnglishDateTime.PastPrefixRegex); + this.futureRegex = recognizersText.RegExpUtility.getSafeRegExp(englishDateTime.EnglishDateTime.NextPrefixRegex); + this.weekOfRegex = recognizersText.RegExpUtility.getSafeRegExp(englishDateTime.EnglishDateTime.WeekOfRegex); + this.monthOfRegex = recognizersText.RegExpUtility.getSafeRegExp(englishDateTime.EnglishDateTime.MonthOfRegex); + this.dateUnitRegex = recognizersText.RegExpUtility.getSafeRegExp(englishDateTime.EnglishDateTime.DateUnitRegex); + this.inConnectorRegex = recognizersText.RegExpUtility.getSafeRegExp(englishDateTime.EnglishDateTime.InConnectorRegex); + this.rangeUnitRegex = recognizersText.RegExpUtility.getSafeRegExp(englishDateTime.EnglishDateTime.RangeUnitRegex); + this.datePointExtractor = new baseDate.BaseDateExtractor(new dateConfiguration.EnglishDateExtractorConfiguration()); + this.integerExtractor = new recognizersTextNumber.EnglishIntegerExtractor(); + this.numberParser = new recognizersTextNumber.BaseNumberParser(new recognizersTextNumber.EnglishNumberParserConfiguration()); + this.durationExtractor = new baseDuration.BaseDurationExtractor(new durationConfiguration.EnglishDurationExtractorConfiguration()); + this.rangeConnectorRegex = recognizersText.RegExpUtility.getSafeRegExp(englishDateTime.EnglishDateTime.RangeConnectorRegex); + } + getFromTokenIndex(source) { + let result = { matched: false, index: -1 }; + if (source.endsWith("from")) { + result.index = source.lastIndexOf("from"); + result.matched = true; + } + return result; + } + ; + getBetweenTokenIndex(source) { + let result = { matched: false, index: -1 }; + if (source.endsWith("between")) { + result.index = source.lastIndexOf("between"); + result.matched = true; + } + return result; + } + ; + hasConnectorToken(source) { + let match = recognizersText.RegExpUtility.getMatches(this.rangeConnectorRegex, source).pop(); + return match && match.length === source.length; + } + ; +} +exports.EnglishDatePeriodExtractorConfiguration = EnglishDatePeriodExtractorConfiguration; +class EnglishDatePeriodParserConfiguration { + constructor(config) { + this.dateExtractor = config.dateExtractor; + this.dateParser = config.dateParser; + this.durationExtractor = config.durationExtractor; + this.durationParser = config.durationParser; + this.monthFrontBetweenRegex = recognizersText.RegExpUtility.getSafeRegExp(englishDateTime.EnglishDateTime.MonthFrontBetweenRegex); + this.betweenRegex = recognizersText.RegExpUtility.getSafeRegExp(englishDateTime.EnglishDateTime.BetweenRegex); + this.monthFrontSimpleCasesRegex = recognizersText.RegExpUtility.getSafeRegExp(englishDateTime.EnglishDateTime.MonthFrontSimpleCasesRegex); + this.simpleCasesRegex = recognizersText.RegExpUtility.getSafeRegExp(englishDateTime.EnglishDateTime.SimpleCasesRegex); + this.oneWordPeriodRegex = recognizersText.RegExpUtility.getSafeRegExp(englishDateTime.EnglishDateTime.OneWordPeriodRegex); + this.monthWithYear = recognizersText.RegExpUtility.getSafeRegExp(englishDateTime.EnglishDateTime.MonthWithYear); + this.monthNumWithYear = recognizersText.RegExpUtility.getSafeRegExp(englishDateTime.EnglishDateTime.MonthNumWithYear); + this.yearRegex = recognizersText.RegExpUtility.getSafeRegExp(englishDateTime.EnglishDateTime.YearRegex); + this.pastRegex = recognizersText.RegExpUtility.getSafeRegExp(englishDateTime.EnglishDateTime.PastPrefixRegex); + this.futureRegex = recognizersText.RegExpUtility.getSafeRegExp(englishDateTime.EnglishDateTime.NextPrefixRegex); + this.inConnectorRegex = config.utilityConfiguration.inConnectorRegex; + this.weekOfMonthRegex = recognizersText.RegExpUtility.getSafeRegExp(englishDateTime.EnglishDateTime.WeekOfMonthRegex); + this.weekOfYearRegex = recognizersText.RegExpUtility.getSafeRegExp(englishDateTime.EnglishDateTime.WeekOfYearRegex); + this.quarterRegex = recognizersText.RegExpUtility.getSafeRegExp(englishDateTime.EnglishDateTime.QuarterRegex); + this.quarterRegexYearFront = recognizersText.RegExpUtility.getSafeRegExp(englishDateTime.EnglishDateTime.QuarterRegexYearFront); + this.allHalfYearRegex = recognizersText.RegExpUtility.getSafeRegExp(englishDateTime.EnglishDateTime.AllHalfYearRegex); + this.seasonRegex = recognizersText.RegExpUtility.getSafeRegExp(englishDateTime.EnglishDateTime.SeasonRegex); + this.weekOfRegex = recognizersText.RegExpUtility.getSafeRegExp(englishDateTime.EnglishDateTime.WeekOfRegex); + this.monthOfRegex = recognizersText.RegExpUtility.getSafeRegExp(englishDateTime.EnglishDateTime.MonthOfRegex); + this.whichWeekRegex = recognizersText.RegExpUtility.getSafeRegExp(englishDateTime.EnglishDateTime.WhichWeekRegex); + this.nextPrefixRegex = recognizersText.RegExpUtility.getSafeRegExp(englishDateTime.EnglishDateTime.NextPrefixRegex); + this.pastPrefixRegex = recognizersText.RegExpUtility.getSafeRegExp(englishDateTime.EnglishDateTime.PastPrefixRegex); + this.thisPrefixRegex = recognizersText.RegExpUtility.getSafeRegExp(englishDateTime.EnglishDateTime.ThisPrefixRegex); + this.restOfDateRegex = recognizersText.RegExpUtility.getSafeRegExp(englishDateTime.EnglishDateTime.RestOfDateRegex); + this.laterEarlyPeriodRegex = recognizersText.RegExpUtility.getSafeRegExp(englishDateTime.EnglishDateTime.LaterEarlyPeriodRegex); + this.weekWithWeekDayRangeRegex = recognizersText.RegExpUtility.getSafeRegExp(englishDateTime.EnglishDateTime.WeekWithWeekDayRangeRegex); + this.tokenBeforeDate = englishDateTime.EnglishDateTime.TokenBeforeDate; + this.dayOfMonth = config.dayOfMonth; + this.monthOfYear = config.monthOfYear; + this.cardinalMap = config.cardinalMap; + this.seasonMap = config.seasonMap; + this.unitMap = config.unitMap; + } + getSwiftDayOrMonth(source) { + let trimmedSource = source.trim().toLowerCase(); + let swift = 0; + if (recognizersText.RegExpUtility.getMatches(this.nextPrefixRegex, trimmedSource).length > 0) { + swift = 1; + } + else if (recognizersText.RegExpUtility.getMatches(this.pastPrefixRegex, trimmedSource).length > 0) { + swift = -1; + } + return swift; + } + getSwiftYear(source) { + let trimmedSource = source.trim().toLowerCase(); + let swift = -10; + if (recognizersText.RegExpUtility.getMatches(this.nextPrefixRegex, trimmedSource).length > 0) { + swift = 1; + } + else if (recognizersText.RegExpUtility.getMatches(this.pastPrefixRegex, trimmedSource).length > 0) { + swift = -1; + } + else if (recognizersText.RegExpUtility.getMatches(this.thisPrefixRegex, trimmedSource).length > 0) { + swift = 0; + } + return swift; + } + isFuture(source) { + let trimmedSource = source.trim().toLowerCase(); + return (trimmedSource.startsWith('this') || trimmedSource.startsWith('next')); + } + isYearToDate(source) { + let trimmedSource = source.trim().toLowerCase(); + return trimmedSource === 'year to date'; + } + isMonthToDate(source) { + let trimmedSource = source.trim().toLowerCase(); + return trimmedSource === 'month to date'; + } + isWeekOnly(source) { + let trimmedSource = source.trim().toLowerCase(); + return trimmedSource.endsWith('week'); + } + isWeekend(source) { + let trimmedSource = source.trim().toLowerCase(); + return trimmedSource.endsWith('weekend'); + } + isMonthOnly(source) { + let trimmedSource = source.trim().toLowerCase(); + return trimmedSource.endsWith('month'); + } + isYearOnly(source) { + let trimmedSource = source.trim().toLowerCase(); + return trimmedSource.endsWith('year'); + } + isLastCardinal(source) { + let trimmedSource = source.trim().toLowerCase(); + return trimmedSource === 'last'; + } +} +exports.EnglishDatePeriodParserConfiguration = EnglishDatePeriodParserConfiguration; + +}); + +unwrapExports(datePeriodConfiguration); + +var dateTimePeriodConfiguration = createCommonjsModule(function (module, exports) { +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); + + + + + + + + + + + + + +class EnglishDateTimePeriodExtractorConfiguration { + constructor() { + this.cardinalExtractor = new recognizersTextNumber.EnglishCardinalExtractor(); + this.singleDateExtractor = new baseDate.BaseDateExtractor(new dateConfiguration.EnglishDateExtractorConfiguration()); + this.singleTimeExtractor = new baseTime.BaseTimeExtractor(new timeConfiguration.EnglishTimeExtractorConfiguration()); + this.singleDateTimeExtractor = new baseDateTime$2.BaseDateTimeExtractor(new dateTimeConfiguration.EnglishDateTimeExtractorConfiguration()); + this.durationExtractor = new baseDuration.BaseDurationExtractor(new durationConfiguration.EnglishDurationExtractorConfiguration()); + this.timePeriodExtractor = new baseTimePeriod.BaseTimePeriodExtractor(new timePeriodConfiguration.EnglishTimePeriodExtractorConfiguration()); + this.simpleCasesRegexes = [ + recognizersText.RegExpUtility.getSafeRegExp(englishDateTime.EnglishDateTime.PureNumFromTo), + recognizersText.RegExpUtility.getSafeRegExp(englishDateTime.EnglishDateTime.PureNumBetweenAnd), + ]; + this.prepositionRegex = recognizersText.RegExpUtility.getSafeRegExp(englishDateTime.EnglishDateTime.PrepositionRegex); + this.tillRegex = recognizersText.RegExpUtility.getSafeRegExp(englishDateTime.EnglishDateTime.TillRegex); + this.specificTimeOfDayRegex = recognizersText.RegExpUtility.getSafeRegExp(englishDateTime.EnglishDateTime.PeriodSpecificTimeOfDayRegex); + this.timeOfDayRegex = recognizersText.RegExpUtility.getSafeRegExp(englishDateTime.EnglishDateTime.PeriodTimeOfDayRegex); + this.periodTimeOfDayWithDateRegex = recognizersText.RegExpUtility.getSafeRegExp(englishDateTime.EnglishDateTime.PeriodTimeOfDayWithDateRegex); + this.followedUnit = recognizersText.RegExpUtility.getSafeRegExp(englishDateTime.EnglishDateTime.TimeFollowedUnit); + this.numberCombinedWithUnit = recognizersText.RegExpUtility.getSafeRegExp(englishDateTime.EnglishDateTime.TimeNumberCombinedWithUnit); + this.timeUnitRegex = recognizersText.RegExpUtility.getSafeRegExp(englishDateTime.EnglishDateTime.TimeUnitRegex); + this.pastPrefixRegex = recognizersText.RegExpUtility.getSafeRegExp(englishDateTime.EnglishDateTime.PastPrefixRegex); + this.nextPrefixRegex = recognizersText.RegExpUtility.getSafeRegExp(englishDateTime.EnglishDateTime.NextPrefixRegex); + this.rangeConnectorRegex = recognizersText.RegExpUtility.getSafeRegExp(englishDateTime.EnglishDateTime.RangeConnectorRegex); + this.relativeTimeUnitRegex = recognizersText.RegExpUtility.getSafeRegExp(englishDateTime.EnglishDateTime.RelativeTimeUnitRegex); + this.restOfDateTimeRegex = recognizersText.RegExpUtility.getSafeRegExp(englishDateTime.EnglishDateTime.RestOfDateTimeRegex); + this.generalEndingRegex = recognizersText.RegExpUtility.getSafeRegExp(englishDateTime.EnglishDateTime.GeneralEndingRegex); + this.middlePauseRegex = recognizersText.RegExpUtility.getSafeRegExp(englishDateTime.EnglishDateTime.MiddlePauseRegex); + } + getFromTokenIndex(source) { + let result = { matched: false, index: -1 }; + if (source.endsWith("from")) { + result.index = source.lastIndexOf("from"); + result.matched = true; + } + return result; + } + ; + getBetweenTokenIndex(source) { + let result = { matched: false, index: -1 }; + if (source.endsWith("between")) { + result.index = source.lastIndexOf("between"); + result.matched = true; + } + return result; + } + ; + hasConnectorToken(source) { + return recognizersText.RegExpUtility.getMatches(this.rangeConnectorRegex, source).length > 0; + } + ; +} +exports.EnglishDateTimePeriodExtractorConfiguration = EnglishDateTimePeriodExtractorConfiguration; +class EnglishDateTimePeriodParserConfiguration { + constructor(config) { + this.pureNumberFromToRegex = recognizersText.RegExpUtility.getSafeRegExp(englishDateTime.EnglishDateTime.PureNumFromTo); + this.pureNumberBetweenAndRegex = recognizersText.RegExpUtility.getSafeRegExp(englishDateTime.EnglishDateTime.PureNumBetweenAnd); + this.periodTimeOfDayWithDateRegex = recognizersText.RegExpUtility.getSafeRegExp(englishDateTime.EnglishDateTime.PeriodTimeOfDayWithDateRegex); + this.specificTimeOfDayRegex = recognizersText.RegExpUtility.getSafeRegExp(englishDateTime.EnglishDateTime.SpecificTimeOfDayRegex); + this.pastRegex = recognizersText.RegExpUtility.getSafeRegExp(englishDateTime.EnglishDateTime.PastPrefixRegex); + this.futureRegex = recognizersText.RegExpUtility.getSafeRegExp(englishDateTime.EnglishDateTime.NextPrefixRegex); + this.relativeTimeUnitRegex = recognizersText.RegExpUtility.getSafeRegExp(englishDateTime.EnglishDateTime.RelativeTimeUnitRegex); + this.numbers = config.numbers; + this.unitMap = config.unitMap; + this.dateExtractor = config.dateExtractor; + this.timePeriodExtractor = config.timePeriodExtractor; + this.timeExtractor = config.timeExtractor; + this.dateTimeExtractor = config.dateTimeExtractor; + this.durationExtractor = config.durationExtractor; + this.dateParser = config.dateParser; + this.timeParser = config.timeParser; + this.dateTimeParser = config.dateTimeParser; + this.timePeriodParser = config.timePeriodParser; + this.durationParser = config.durationParser; + this.morningStartEndRegex = recognizersText.RegExpUtility.getSafeRegExp(englishDateTime.EnglishDateTime.MorningStartEndRegex); + this.afternoonStartEndRegex = recognizersText.RegExpUtility.getSafeRegExp(englishDateTime.EnglishDateTime.AfternoonStartEndRegex); + this.eveningStartEndRegex = recognizersText.RegExpUtility.getSafeRegExp(englishDateTime.EnglishDateTime.EveningStartEndRegex); + this.nightStartEndRegex = recognizersText.RegExpUtility.getSafeRegExp(englishDateTime.EnglishDateTime.NightStartEndRegex); + this.restOfDateTimeRegex = recognizersText.RegExpUtility.getSafeRegExp(englishDateTime.EnglishDateTime.RestOfDateTimeRegex); + } + getMatchedTimeRange(source) { + let timeStr; + let beginHour = 0; + let endHour = 0; + let endMin = 0; + let success = false; + if (recognizersText.RegExpUtility.getMatches(this.morningStartEndRegex, source).length > 0) { + timeStr = 'TMO'; + beginHour = 8; + endHour = 12; + success = true; + } + else if (recognizersText.RegExpUtility.getMatches(this.afternoonStartEndRegex, source).length > 0) { + timeStr = 'TAF'; + beginHour = 12; + endHour = 16; + success = true; + } + else if (recognizersText.RegExpUtility.getMatches(this.eveningStartEndRegex, source).length > 0) { + timeStr = 'TEV'; + beginHour = 16; + endHour = 20; + success = true; + } + else if (recognizersText.RegExpUtility.getMatches(this.nightStartEndRegex, source).length > 0) { + timeStr = 'TNI'; + beginHour = 20; + endHour = 23; + endMin = 59; + success = true; + } + return { timeStr: timeStr, beginHour: beginHour, endHour: endHour, endMin: endMin, success: success }; + } + getSwiftPrefix(source) { + let swift = 0; + if (source.startsWith('next')) + swift = 1; + else if (source.startsWith('last')) + swift = -1; + return swift; + } +} +exports.EnglishDateTimePeriodParserConfiguration = EnglishDateTimePeriodParserConfiguration; + +}); + +unwrapExports(dateTimePeriodConfiguration); + +var parsers$6 = createCommonjsModule(function (module, exports) { +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); + + + + +class EnglishTimeParser extends baseTime.BaseTimeParser { + constructor(configuration) { + super(configuration); + } + internalParse(text, referenceTime) { + let innerResult = super.internalParse(text, referenceTime); + if (!innerResult.success) { + innerResult = this.parseIsh(text, referenceTime); + } + return innerResult; + } + // parse "noonish", "11-ish" + parseIsh(text, referenceTime) { + let ret = new utilities$2.DateTimeResolutionResult(); + let trimmedText = text.toLowerCase().trim(); + let matches = recognizersText.RegExpUtility.getMatches(timeConfiguration.EnglishTimeExtractorConfiguration.ishRegex, trimmedText); + if (matches.length > 0 && matches[0].length === trimmedText.length) { + let hourStr = matches[0].groups("hour").value; + let hour = 12; + if (hourStr) { + hour = Number.parseInt(hourStr, 10); + } + ret.timex = "T" + utilities$2.FormatUtil.toString(hour, 2); + ret.futureValue = + ret.pastValue = + new Date(referenceTime.getFullYear(), referenceTime.getMonth(), referenceTime.getDate(), hour, 0, 0); + ret.success = true; + return ret; + } + return ret; + } +} +exports.EnglishTimeParser = EnglishTimeParser; + +}); + +unwrapExports(parsers$6); + +var baseConfiguration = createCommonjsModule(function (module, exports) { +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); + + + + + + + + + + + + + + + + + + + + +class EnglishDateTimeUtilityConfiguration { + constructor() { + this.laterRegex = recognizersText.RegExpUtility.getSafeRegExp(englishDateTime.EnglishDateTime.LaterRegex); + this.agoRegex = recognizersText.RegExpUtility.getSafeRegExp(englishDateTime.EnglishDateTime.AgoRegex); + this.inConnectorRegex = recognizersText.RegExpUtility.getSafeRegExp(englishDateTime.EnglishDateTime.InConnectorRegex); + this.rangeUnitRegex = recognizersText.RegExpUtility.getSafeRegExp(englishDateTime.EnglishDateTime.RangeUnitRegex); + this.amDescRegex = recognizersText.RegExpUtility.getSafeRegExp(englishDateTime.EnglishDateTime.AmDescRegex); + this.pmDescRegex = recognizersText.RegExpUtility.getSafeRegExp(englishDateTime.EnglishDateTime.PmDescRegex); + this.amPmDescRegex = recognizersText.RegExpUtility.getSafeRegExp(englishDateTime.EnglishDateTime.AmPmDescRegex); + } +} +exports.EnglishDateTimeUtilityConfiguration = EnglishDateTimeUtilityConfiguration; +class EnglishCommonDateTimeParserConfiguration extends parsers$4.BaseDateParserConfiguration { + constructor() { + super(); + this.utilityConfiguration = new EnglishDateTimeUtilityConfiguration(); + this.unitMap = englishDateTime.EnglishDateTime.UnitMap; + this.unitValueMap = englishDateTime.EnglishDateTime.UnitValueMap; + this.seasonMap = englishDateTime.EnglishDateTime.SeasonMap; + this.cardinalMap = englishDateTime.EnglishDateTime.CardinalMap; + this.dayOfWeek = englishDateTime.EnglishDateTime.DayOfWeek; + this.monthOfYear = englishDateTime.EnglishDateTime.MonthOfYear; + this.numbers = englishDateTime.EnglishDateTime.Numbers; + this.doubleNumbers = englishDateTime.EnglishDateTime.DoubleNumbers; + this.cardinalExtractor = new recognizersTextNumber.EnglishCardinalExtractor(); + this.integerExtractor = new recognizersTextNumber.EnglishIntegerExtractor(); + this.ordinalExtractor = new recognizersTextNumber.EnglishOrdinalExtractor(); + this.dayOfMonth = new Map([...baseDateTime.BaseDateTime.DayOfMonthDictionary, ...englishDateTime.EnglishDateTime.DayOfMonth]); + this.numberParser = new recognizersTextNumber.BaseNumberParser(new recognizersTextNumber.EnglishNumberParserConfiguration()); + this.dateExtractor = new baseDate.BaseDateExtractor(new dateConfiguration.EnglishDateExtractorConfiguration()); + this.timeExtractor = new baseTime.BaseTimeExtractor(new timeConfiguration.EnglishTimeExtractorConfiguration()); + this.dateTimeExtractor = new baseDateTime$2.BaseDateTimeExtractor(new dateTimeConfiguration.EnglishDateTimeExtractorConfiguration()); + this.durationExtractor = new baseDuration.BaseDurationExtractor(new durationConfiguration.EnglishDurationExtractorConfiguration()); + this.datePeriodExtractor = new baseDatePeriod.BaseDatePeriodExtractor(new datePeriodConfiguration.EnglishDatePeriodExtractorConfiguration()); + this.timePeriodExtractor = new baseTimePeriod.BaseTimePeriodExtractor(new timePeriodConfiguration.EnglishTimePeriodExtractorConfiguration()); + this.dateTimePeriodExtractor = new baseDateTimePeriod.BaseDateTimePeriodExtractor(new dateTimePeriodConfiguration.EnglishDateTimePeriodExtractorConfiguration()); + this.durationParser = new baseDuration.BaseDurationParser(new durationConfiguration.EnglishDurationParserConfiguration(this)); + this.dateParser = new baseDate.BaseDateParser(new dateConfiguration.EnglishDateParserConfiguration(this)); + this.timeParser = new parsers$6.EnglishTimeParser(new timeConfiguration.EnglishTimeParserConfiguration(this)); + this.dateTimeParser = new baseDateTime$2.BaseDateTimeParser(new dateTimeConfiguration.EnglishDateTimeParserConfiguration(this)); + this.datePeriodParser = new baseDatePeriod.BaseDatePeriodParser(new datePeriodConfiguration.EnglishDatePeriodParserConfiguration(this)); + this.timePeriodParser = new baseTimePeriod.BaseTimePeriodParser(new timePeriodConfiguration.EnglishTimePeriodParserConfiguration(this)); + this.dateTimePeriodParser = new baseDateTimePeriod.BaseDateTimePeriodParser(new dateTimePeriodConfiguration.EnglishDateTimePeriodParserConfiguration(this)); + } +} +exports.EnglishCommonDateTimeParserConfiguration = EnglishCommonDateTimeParserConfiguration; + +}); + +unwrapExports(baseConfiguration); + +var baseSet = createCommonjsModule(function (module, exports) { +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); + + + + +class BaseSetExtractor { + constructor(config) { + this.extractorName = constants$2.Constants.SYS_DATETIME_SET; + this.config = config; + } + extract(source, refDate) { + if (!refDate) + refDate = new Date(); + let referenceDate = refDate; + let tokens = new Array() + .concat(this.matchEachUnit(source)) + .concat(this.matchPeriodic(source)) + .concat(this.matchEachDuration(source, referenceDate)) + .concat(this.timeEveryday(source, referenceDate)) + .concat(this.matchEach(this.config.dateExtractor, source, referenceDate)) + .concat(this.matchEach(this.config.timeExtractor, source, referenceDate)) + .concat(this.matchEach(this.config.dateTimeExtractor, source, referenceDate)) + .concat(this.matchEach(this.config.datePeriodExtractor, source, referenceDate)) + .concat(this.matchEach(this.config.timePeriodExtractor, source, referenceDate)) + .concat(this.matchEach(this.config.dateTimePeriodExtractor, source, referenceDate)); + let result = utilities$2.Token.mergeAllTokens(tokens, source, this.extractorName); + return result; + } + matchEachUnit(source) { + let ret = []; + recognizersText.RegExpUtility.getMatches(this.config.eachUnitRegex, source).forEach(match => { + ret.push(new utilities$2.Token(match.index, match.index + match.length)); + }); + return ret; + } + matchPeriodic(source) { + let ret = []; + recognizersText.RegExpUtility.getMatches(this.config.periodicRegex, source).forEach(match => { + ret.push(new utilities$2.Token(match.index, match.index + match.length)); + }); + return ret; + } + matchEachDuration(source, refDate) { + let ret = []; + this.config.durationExtractor.extract(source, refDate).forEach(er => { + if (recognizersText.RegExpUtility.getMatches(this.config.lastRegex, er.text).length > 0) + return; + let beforeStr = source.substr(0, er.start); + let matches = recognizersText.RegExpUtility.getMatches(this.config.eachPrefixRegex, beforeStr); + if (matches && matches.length > 0) { + ret.push(new utilities$2.Token(matches[0].index, er.start + er.length)); + } + }); + return ret; + } + timeEveryday(source, refDate) { + let ret = []; + this.config.timeExtractor.extract(source, refDate).forEach(er => { + let afterStr = source.substr(er.start + er.length); + if (recognizersText.StringUtility.isNullOrWhitespace(afterStr) && this.config.beforeEachDayRegex) { + let beforeStr = source.substr(0, er.start); + let beforeMatches = recognizersText.RegExpUtility.getMatches(this.config.beforeEachDayRegex, beforeStr); + if (beforeMatches && beforeMatches.length > 0) { + ret.push(new utilities$2.Token(beforeMatches[0].index, er.start + er.length)); + } + } + else { + let afterMatches = recognizersText.RegExpUtility.getMatches(this.config.eachDayRegex, afterStr); + if (afterMatches && afterMatches.length > 0) { + ret.push(new utilities$2.Token(er.start, er.start + er.length + afterMatches[0].length)); + } + } + }); + return ret; + } + matchEach(extractor, source, refDate) { + let ret = []; + recognizersText.RegExpUtility.getMatches(this.config.setEachRegex, source).forEach(match => { + let trimmedSource = source.substr(0, match.index) + source.substr(match.index + match.length); + extractor.extract(trimmedSource, refDate).forEach(er => { + if (er.start <= match.index && (er.start + er.length) > match.index) { + ret.push(new utilities$2.Token(er.start, er.start + match.length + er.length)); + } + }); + }); + recognizersText.RegExpUtility.getMatches(this.config.setWeekDayRegex, source).forEach(match => { + let trimmedSource = source.substr(0, match.index) + match.groups('weekday').value + source.substr(match.index + match.length); + extractor.extract(trimmedSource, refDate).forEach(er => { + if (er.start <= match.index && er.text.includes(match.groups('weekday').value)) { + let length = er.length + 1; + if (!recognizersText.StringUtility.isNullOrEmpty(match.groups('prefix').value)) { + length += match.groups('prefix').value.length; + } + ret.push(new utilities$2.Token(er.start, er.start + length)); + } + }); + }); + return ret; + } +} +exports.BaseSetExtractor = BaseSetExtractor; +class BaseSetParser { + constructor(configuration) { + this.config = configuration; + } + parse(er, referenceDate) { + if (!referenceDate) + referenceDate = new Date(); + let value = null; + if (er.type === BaseSetParser.ParserName) { + let innerResult = this.parseEachUnit(er.text); + if (!innerResult.success) { + innerResult = this.parseEachDuration(er.text, referenceDate); + } + if (!innerResult.success) { + innerResult = this.parserTimeEveryday(er.text, referenceDate); + } + // NOTE: Please do not change the order of following function + // datetimeperiod>dateperiod>timeperiod>datetime>date>time + if (!innerResult.success) { + innerResult = this.parseEach(this.config.dateTimePeriodExtractor, this.config.dateTimePeriodParser, er.text, referenceDate); + } + if (!innerResult.success) { + innerResult = this.parseEach(this.config.datePeriodExtractor, this.config.datePeriodParser, er.text, referenceDate); + } + if (!innerResult.success) { + innerResult = this.parseEach(this.config.timePeriodExtractor, this.config.timePeriodParser, er.text, referenceDate); + } + if (!innerResult.success) { + innerResult = this.parseEach(this.config.dateTimeExtractor, this.config.dateTimeParser, er.text, referenceDate); + } + if (!innerResult.success) { + innerResult = this.parseEach(this.config.dateExtractor, this.config.dateParser, er.text, referenceDate); + } + if (!innerResult.success) { + innerResult = this.parseEach(this.config.timeExtractor, this.config.timeParser, er.text, referenceDate); + } + if (innerResult.success) { + innerResult.futureResolution = {}; + innerResult.futureResolution[constants$2.TimeTypeConstants.SET] = innerResult.futureValue; + innerResult.pastResolution = {}; + innerResult.pastResolution[constants$2.TimeTypeConstants.SET] = innerResult.pastValue; + value = innerResult; + } + } + let ret = new parsers$4.DateTimeParseResult(er); + ret.value = value, ret.timexStr = value === null ? "" : value.timex, ret.resolutionStr = ""; + return ret; + } + parseEachDuration(text, refDate) { + let ret = new utilities$2.DateTimeResolutionResult(); + let ers = this.config.durationExtractor.extract(text, refDate); + if (ers.length !== 1 || text.substring(ers[0].start + ers[0].length || 0)) { + return ret; + } + let beforeStr = text.substring(0, ers[0].start || 0); + let matches = recognizersText.RegExpUtility.getMatches(this.config.eachPrefixRegex, beforeStr); + if (matches.length) { + let pr = this.config.durationParser.parse(ers[0], new Date()); + ret.timex = pr.timexStr; + ret.futureValue = ret.pastValue = "Set: " + pr.timexStr; + ret.success = true; + return ret; + } + return ret; + } + parseEachUnit(text) { + let ret = new utilities$2.DateTimeResolutionResult(); + // handle "daily", "weekly" + let matches = recognizersText.RegExpUtility.getMatches(this.config.periodicRegex, text); + if (matches.length) { + let getMatchedDailyTimex = this.config.getMatchedDailyTimex(text); + if (!getMatchedDailyTimex.matched) { + return ret; + } + ret.timex = getMatchedDailyTimex.timex; + ret.futureValue = ret.pastValue = "Set: " + ret.timex; + ret.success = true; + return ret; + } + // handle "each month" + matches = recognizersText.RegExpUtility.getMatches(this.config.eachUnitRegex, text); + if (matches.length && matches[0].length === text.length) { + let sourceUnit = matches[0].groups("unit").value; + if (sourceUnit && this.config.unitMap.has(sourceUnit)) { + let getMatchedUnitTimex = this.config.getMatchedUnitTimex(sourceUnit); + if (!getMatchedUnitTimex.matched) { + return ret; + } + if (!recognizersText.StringUtility.isNullOrEmpty(matches[0].groups('other').value)) { + getMatchedUnitTimex.timex = getMatchedUnitTimex.timex.replace('1', '2'); + } + ret.timex = getMatchedUnitTimex.timex; + ret.futureValue = ret.pastValue = "Set: " + ret.timex; + ret.success = true; + return ret; + } + } + return ret; + } + parserTimeEveryday(text, refDate) { + let ret = new utilities$2.DateTimeResolutionResult(); + let ers = this.config.timeExtractor.extract(text, refDate); + if (ers.length !== 1) { + return ret; + } + let afterStr = text.replace(ers[0].text, ""); + let matches = recognizersText.RegExpUtility.getMatches(this.config.eachDayRegex, afterStr); + if (matches.length) { + let pr = this.config.timeParser.parse(ers[0], new Date()); + ret.timex = pr.timexStr; + ret.futureValue = ret.pastValue = "Set: " + ret.timex; + ret.success = true; + return ret; + } + return ret; + } + parseEach(extractor, parser, text, refDate) { + let ret = new utilities$2.DateTimeResolutionResult(); + let success = false; + let er; + let match = recognizersText.RegExpUtility.getMatches(this.config.setEachRegex, text).pop(); + if (match) { + let trimmedText = text.substr(0, match.index) + text.substr(match.index + match.length); + er = extractor.extract(trimmedText, refDate); + if (er.length === 1 && er[0].length === trimmedText.length) { + success = true; + } + } + match = recognizersText.RegExpUtility.getMatches(this.config.setWeekDayRegex, text).pop(); + if (match) { + let trimmedText = text.substr(0, match.index) + match.groups('weekday').value + text.substr(match.index + match.length); + er = extractor.extract(trimmedText, refDate); + if (er.length === 1 && er[0].length === trimmedText.length) { + success = true; + } + } + if (success) { + let pr = parser.parse(er[0]); + ret.timex = pr.timexStr; + ret.futureValue = `Set: ${pr.timexStr}`; + ret.pastValue = `Set: ${pr.timexStr}`; + ret.success = true; + return ret; + } + return ret; + } +} +BaseSetParser.ParserName = constants$2.Constants.SYS_DATETIME_SET; +exports.BaseSetParser = BaseSetParser; + +}); + +unwrapExports(baseSet); + +var baseHoliday = createCommonjsModule(function (module, exports) { +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); + + + + + +class BaseHolidayExtractor { + constructor(config) { + this.extractorName = constants$2.Constants.SYS_DATETIME_DATE; + this.config = config; + } + extract(source, refDate) { + if (!refDate) + refDate = new Date(); + let tokens = new Array() + .concat(this.holidayMatch(source)); + let result = utilities$2.Token.mergeAllTokens(tokens, source, this.extractorName); + return result; + } + holidayMatch(source) { + let ret = []; + this.config.holidayRegexes.forEach(regex => { + recognizersText.RegExpUtility.getMatches(regex, source).forEach(match => { + ret.push(new utilities$2.Token(match.index, match.index + match.length)); + }); + }); + return ret; + } +} +exports.BaseHolidayExtractor = BaseHolidayExtractor; +class BaseHolidayParser { + constructor(config) { + this.config = config; + } + parse(er, referenceDate) { + if (!referenceDate) + referenceDate = new Date(); + let value = null; + if (er.type === BaseHolidayParser.ParserName) { + let innerResult = this.parseHolidayRegexMatch(er.text, referenceDate); + if (innerResult.success) { + innerResult.futureResolution = {}; + innerResult.futureResolution[constants$2.TimeTypeConstants.DATE] = utilities$2.FormatUtil.formatDate(innerResult.futureValue); + innerResult.pastResolution = {}; + innerResult.pastResolution[constants$2.TimeTypeConstants.DATE] = utilities$2.FormatUtil.formatDate(innerResult.pastValue); + value = innerResult; + } + } + let ret = new parsers$4.DateTimeParseResult(er); + ret.value = value; + ret.timexStr = value === null ? "" : value.timex; + ret.resolutionStr = ""; + return ret; + } + parseHolidayRegexMatch(text, referenceDate) { + let trimmedText = text.trim(); + for (let regex of this.config.holidayRegexList) { + let offset = 0; + let matches = recognizersText.RegExpUtility.getMatches(regex, trimmedText); + if (matches.length && matches[0].index === offset && matches[0].length === trimmedText.length) { + // LUIS value string will be set in Match2Date method + let ret = this.match2Date(matches[0], referenceDate); + return ret; + } + } + return new utilities$2.DateTimeResolutionResult(); + } + match2Date(match, referenceDate) { + let ret = new utilities$2.DateTimeResolutionResult(); + let holidayStr = this.config.sanitizeHolidayToken(match.groups("holiday").value.toLowerCase()); + // get year (if exist) + let yearStr = match.groups("year").value.toLowerCase(); + let orderStr = match.groups("order").value.toLowerCase(); + let year; + let hasYear = false; + if (yearStr) { + year = parseInt(yearStr, 10); + hasYear = true; + } + else if (orderStr) { + let swift = this.config.getSwiftYear(orderStr); + if (swift < -1) { + return ret; + } + year = referenceDate.getFullYear() + swift; + hasYear = true; + } + else { + year = referenceDate.getFullYear(); + } + let holidayKey; + for (holidayKey of this.config.holidayNames.keys()) { + if (this.config.holidayNames.get(holidayKey).indexOf(holidayStr) > -1) { + break; + } + } + if (holidayKey) { + let timexStr; + let value = referenceDate; + let func = this.config.holidayFuncDictionary.get(holidayKey); + if (func) { + value = func(year); + timexStr = this.config.variableHolidaysTimexDictionary.get(holidayKey); + if (!timexStr) { + timexStr = `-${utilities$2.FormatUtil.toString(value.getMonth() + 1, 2)}-${utilities$2.FormatUtil.toString(value.getDate(), 2)}`; + } + } + else { + return ret; + } + if (value.getTime() === utilities$2.DateUtils.minValue().getTime()) { + ret.timex = ''; + ret.futureValue = utilities$2.DateUtils.minValue(); + ret.pastValue = utilities$2.DateUtils.minValue(); + ret.success = true; + return ret; + } + if (hasYear) { + ret.timex = utilities$2.FormatUtil.toString(year, 4) + timexStr; + ret.futureValue = ret.pastValue = new Date(year, value.getMonth(), value.getDate()); + ret.success = true; + return ret; + } + ret.timex = "XXXX" + timexStr; + ret.futureValue = this.getFutureValue(value, referenceDate, holidayKey); + ret.pastValue = this.getPastValue(value, referenceDate, holidayKey); + ret.success = true; + return ret; + } + return ret; + } + getFutureValue(value, referenceDate, holiday) { + if (value < referenceDate) { + let func = this.config.holidayFuncDictionary.get(holiday); + if (func) { + return func(value.getFullYear() + 1); + } + } + return value; + } + getPastValue(value, referenceDate, holiday) { + if (value >= referenceDate) { + let func = this.config.holidayFuncDictionary.get(holiday); + if (func) { + return func(value.getFullYear() - 1); + } + } + return value; + } +} +BaseHolidayParser.ParserName = constants$2.Constants.SYS_DATETIME_DATE; // "Date"; +exports.BaseHolidayParser = BaseHolidayParser; +class BaseHolidayParserConfiguration { + constructor() { + this.variableHolidaysTimexDictionary = baseDateTime.BaseDateTime.VariableHolidaysTimexDictionary; + this.holidayFuncDictionary = this.initHolidayFuncs(); + } + // TODO auto-generate from YAML + initHolidayFuncs() { + return new Map([ + ["fathers", BaseHolidayParserConfiguration.FathersDay], + ["mothers", BaseHolidayParserConfiguration.MothersDay], + ["thanksgivingday", BaseHolidayParserConfiguration.ThanksgivingDay], + ["thanksgiving", BaseHolidayParserConfiguration.ThanksgivingDay], + ["martinlutherking", BaseHolidayParserConfiguration.MartinLutherKingDay], + ["washingtonsbirthday", BaseHolidayParserConfiguration.WashingtonsBirthday], + ["canberra", BaseHolidayParserConfiguration.CanberraDay], + ["labour", BaseHolidayParserConfiguration.LabourDay], + ["columbus", BaseHolidayParserConfiguration.ColumbusDay], + ["memorial", BaseHolidayParserConfiguration.MemorialDay] + ]); + } + // All months are zero-based (-1) + // TODO auto-generate from YAML + static MothersDay(year) { return new Date(year, 5 - 1, BaseHolidayParserConfiguration.getDay(year, 5 - 1, 1, utilities$2.DayOfWeek.Sunday)); } + static FathersDay(year) { return new Date(year, 6 - 1, BaseHolidayParserConfiguration.getDay(year, 6 - 1, 2, utilities$2.DayOfWeek.Sunday)); } + static MartinLutherKingDay(year) { return new Date(year, 1 - 1, BaseHolidayParserConfiguration.getDay(year, 1 - 1, 2, utilities$2.DayOfWeek.Monday)); } + static WashingtonsBirthday(year) { return new Date(year, 2 - 1, BaseHolidayParserConfiguration.getDay(year, 2 - 1, 2, utilities$2.DayOfWeek.Monday)); } + static CanberraDay(year) { return new Date(year, 3 - 1, BaseHolidayParserConfiguration.getDay(year, 3 - 1, 0, utilities$2.DayOfWeek.Monday)); } + static MemorialDay(year) { return new Date(year, 5 - 1, BaseHolidayParserConfiguration.getLastDay(year, 5 - 1, utilities$2.DayOfWeek.Monday)); } + static LabourDay(year) { return new Date(year, 9 - 1, BaseHolidayParserConfiguration.getDay(year, 9 - 1, 0, utilities$2.DayOfWeek.Monday)); } + static ColumbusDay(year) { return new Date(year, 10 - 1, BaseHolidayParserConfiguration.getDay(year, 10 - 1, 1, utilities$2.DayOfWeek.Monday)); } + static ThanksgivingDay(year) { return new Date(year, 11 - 1, BaseHolidayParserConfiguration.getDay(year, 11 - 1, 3, utilities$2.DayOfWeek.Thursday)); } + static getDay(year, month, week, dayOfWeek) { + let days = Array.apply(null, new Array(new Date(year, month, 0).getDate())).map(function (x, i) { return i + 1; }); + days = days.filter(function (day) { + return new Date(year, month, day).getDay() === dayOfWeek; + }); + return days[week]; + } + static getLastDay(year, month, dayOfWeek) { + let days = Array.apply(null, new Array(new Date(year, month, 0).getDate())).map(function (x, i) { return i + 1; }); + days = days.filter(function (day) { + return new Date(year, month, day).getDay() === dayOfWeek; + }); + return days[days.length - 1]; + } +} +exports.BaseHolidayParserConfiguration = BaseHolidayParserConfiguration; + +}); + +unwrapExports(baseHoliday); + +var setConfiguration = createCommonjsModule(function (module, exports) { +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); + + + + + + + + + + + + + + + + +class EnglishSetExtractorConfiguration { + constructor() { + this.durationExtractor = new baseDuration.BaseDurationExtractor(new durationConfiguration.EnglishDurationExtractorConfiguration()); + this.timeExtractor = new baseTime.BaseTimeExtractor(new timeConfiguration.EnglishTimeExtractorConfiguration()); + this.dateExtractor = new baseDate.BaseDateExtractor(new dateConfiguration.EnglishDateExtractorConfiguration()); + this.dateTimeExtractor = new baseDateTime$2.BaseDateTimeExtractor(new dateTimeConfiguration.EnglishDateTimeExtractorConfiguration()); + this.datePeriodExtractor = new baseDatePeriod.BaseDatePeriodExtractor(new datePeriodConfiguration.EnglishDatePeriodExtractorConfiguration()); + this.timePeriodExtractor = new baseTimePeriod.BaseTimePeriodExtractor(new timePeriodConfiguration.EnglishTimePeriodExtractorConfiguration()); + this.dateTimePeriodExtractor = new baseDateTimePeriod.BaseDateTimePeriodExtractor(new dateTimePeriodConfiguration.EnglishDateTimePeriodExtractorConfiguration()); + this.lastRegex = recognizersText.RegExpUtility.getSafeRegExp(englishDateTime.EnglishDateTime.SetLastRegex); + this.eachPrefixRegex = recognizersText.RegExpUtility.getSafeRegExp(englishDateTime.EnglishDateTime.EachPrefixRegex); + this.periodicRegex = recognizersText.RegExpUtility.getSafeRegExp(englishDateTime.EnglishDateTime.PeriodicRegex); + this.eachUnitRegex = recognizersText.RegExpUtility.getSafeRegExp(englishDateTime.EnglishDateTime.EachUnitRegex); + this.eachDayRegex = recognizersText.RegExpUtility.getSafeRegExp(englishDateTime.EnglishDateTime.EachDayRegex); + this.setWeekDayRegex = recognizersText.RegExpUtility.getSafeRegExp(englishDateTime.EnglishDateTime.SetWeekDayRegex); + this.setEachRegex = recognizersText.RegExpUtility.getSafeRegExp(englishDateTime.EnglishDateTime.SetEachRegex); + this.beforeEachDayRegex = null; + } +} +exports.EnglishSetExtractorConfiguration = EnglishSetExtractorConfiguration; +class EnglishSetParserConfiguration { + constructor(config) { + this.durationExtractor = config.durationExtractor; + this.timeExtractor = config.timeExtractor; + this.dateExtractor = config.dateExtractor; + this.dateTimeExtractor = config.dateTimeExtractor; + this.datePeriodExtractor = config.datePeriodExtractor; + this.timePeriodExtractor = config.timePeriodExtractor; + this.dateTimePeriodExtractor = config.dateTimePeriodExtractor; + this.durationParser = config.durationParser; + this.timeParser = config.timeParser; + this.dateParser = config.dateParser; + this.dateTimeParser = config.dateTimeParser; + this.datePeriodParser = config.datePeriodParser; + this.timePeriodParser = config.timePeriodParser; + this.dateTimePeriodParser = config.dateTimePeriodParser; + this.unitMap = config.unitMap; + this.eachPrefixRegex = recognizersText.RegExpUtility.getSafeRegExp(englishDateTime.EnglishDateTime.EachPrefixRegex); + this.periodicRegex = recognizersText.RegExpUtility.getSafeRegExp(englishDateTime.EnglishDateTime.PeriodicRegex); + this.eachUnitRegex = recognizersText.RegExpUtility.getSafeRegExp(englishDateTime.EnglishDateTime.EachUnitRegex); + this.eachDayRegex = recognizersText.RegExpUtility.getSafeRegExp(englishDateTime.EnglishDateTime.EachDayRegex); + this.setWeekDayRegex = recognizersText.RegExpUtility.getSafeRegExp(englishDateTime.EnglishDateTime.SetWeekDayRegex); + this.setEachRegex = recognizersText.RegExpUtility.getSafeRegExp(englishDateTime.EnglishDateTime.SetEachRegex); + } + getMatchedDailyTimex(text) { + let timex = ""; + let trimmedText = text.trim().toLowerCase(); + if (trimmedText === "daily") { + timex = "P1D"; + } + else if (trimmedText === "weekly") { + timex = "P1W"; + } + else if (trimmedText === "biweekly") { + timex = "P2W"; + } + else if (trimmedText === "monthly") { + timex = "P1M"; + } + else if (trimmedText === "yearly" || trimmedText === "annually" || trimmedText === "annual") { + timex = "P1Y"; + } + else { + timex = null; + return { matched: false, timex: timex }; + } + return { matched: true, timex: timex }; + } + getMatchedUnitTimex(text) { + let timex = ""; + let trimmedText = text.trim().toLowerCase(); + if (trimmedText === "day") { + timex = "P1D"; + } + else if (trimmedText === "week") { + timex = "P1W"; + } + else if (trimmedText === "month") { + timex = "P1M"; + } + else if (trimmedText === "year") { + timex = "P1Y"; + } + else { + timex = null; + return { matched: false, timex: timex }; + } + return { matched: true, timex: timex }; + } +} +exports.EnglishSetParserConfiguration = EnglishSetParserConfiguration; + +}); + +unwrapExports(setConfiguration); + +var holidayConfiguration = createCommonjsModule(function (module, exports) { +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); + + + + +class EnglishHolidayExtractorConfiguration { + constructor() { + this.holidayRegexes = [ + recognizersText.RegExpUtility.getSafeRegExp(englishDateTime.EnglishDateTime.HolidayRegex1, "gis"), + recognizersText.RegExpUtility.getSafeRegExp(englishDateTime.EnglishDateTime.HolidayRegex2, "gis"), + recognizersText.RegExpUtility.getSafeRegExp(englishDateTime.EnglishDateTime.HolidayRegex3, "gis") + ]; + } +} +exports.EnglishHolidayExtractorConfiguration = EnglishHolidayExtractorConfiguration; +class EnglishHolidayParserConfiguration extends baseHoliday.BaseHolidayParserConfiguration { + constructor() { + super(); + this.holidayRegexList = [ + recognizersText.RegExpUtility.getSafeRegExp(englishDateTime.EnglishDateTime.HolidayRegex1, "gis"), + recognizersText.RegExpUtility.getSafeRegExp(englishDateTime.EnglishDateTime.HolidayRegex2, "gis"), + recognizersText.RegExpUtility.getSafeRegExp(englishDateTime.EnglishDateTime.HolidayRegex3, "gis") + ]; + this.holidayNames = englishDateTime.EnglishDateTime.HolidayNames; + this.holidayFuncDictionary = this.initHolidayFuncs(); + } + initHolidayFuncs() { + return new Map([ + ...super.initHolidayFuncs(), + ["maosbirthday", EnglishHolidayParserConfiguration.MaoBirthday], + ["yuandan", EnglishHolidayParserConfiguration.NewYear], + ["teachersday", EnglishHolidayParserConfiguration.TeacherDay], + ["singleday", EnglishHolidayParserConfiguration.SinglesDay], + ["allsaintsday", EnglishHolidayParserConfiguration.HalloweenDay], + ["youthday", EnglishHolidayParserConfiguration.YouthDay], + ["childrenday", EnglishHolidayParserConfiguration.ChildrenDay], + ["femaleday", EnglishHolidayParserConfiguration.FemaleDay], + ["treeplantingday", EnglishHolidayParserConfiguration.TreePlantDay], + ["arborday", EnglishHolidayParserConfiguration.TreePlantDay], + ["girlsday", EnglishHolidayParserConfiguration.GirlsDay], + ["whiteloverday", EnglishHolidayParserConfiguration.WhiteLoverDay], + ["loverday", EnglishHolidayParserConfiguration.ValentinesDay], + ["christmas", EnglishHolidayParserConfiguration.ChristmasDay], + ["xmas", EnglishHolidayParserConfiguration.ChristmasDay], + ["newyear", EnglishHolidayParserConfiguration.NewYear], + ["newyearday", EnglishHolidayParserConfiguration.NewYear], + ["newyearsday", EnglishHolidayParserConfiguration.NewYear], + ["inaugurationday", EnglishHolidayParserConfiguration.InaugurationDay], + ["groundhougday", EnglishHolidayParserConfiguration.GroundhogDay], + ["valentinesday", EnglishHolidayParserConfiguration.ValentinesDay], + ["stpatrickday", EnglishHolidayParserConfiguration.StPatrickDay], + ["aprilfools", EnglishHolidayParserConfiguration.FoolDay], + ["stgeorgeday", EnglishHolidayParserConfiguration.StGeorgeDay], + ["mayday", EnglishHolidayParserConfiguration.Mayday], + ["cincodemayoday", EnglishHolidayParserConfiguration.CincoDeMayoday], + ["baptisteday", EnglishHolidayParserConfiguration.BaptisteDay], + ["usindependenceday", EnglishHolidayParserConfiguration.UsaIndependenceDay], + ["independenceday", EnglishHolidayParserConfiguration.UsaIndependenceDay], + ["bastilleday", EnglishHolidayParserConfiguration.BastilleDay], + ["halloweenday", EnglishHolidayParserConfiguration.HalloweenDay], + ["allhallowday", EnglishHolidayParserConfiguration.AllHallowDay], + ["allsoulsday", EnglishHolidayParserConfiguration.AllSoulsday], + ["guyfawkesday", EnglishHolidayParserConfiguration.GuyFawkesDay], + ["veteransday", EnglishHolidayParserConfiguration.Veteransday], + ["christmaseve", EnglishHolidayParserConfiguration.ChristmasEve], + ["newyeareve", EnglishHolidayParserConfiguration.NewYearEve], + ["easterday", EnglishHolidayParserConfiguration.EasterDay] + ]); + } + // All JavaScript dates are zero-based (-1) + static NewYear(year) { return new Date(year, 1 - 1, 1); } + static NewYearEve(year) { return new Date(year, 12 - 1, 31); } + static ChristmasDay(year) { return new Date(year, 12 - 1, 25); } + static ChristmasEve(year) { return new Date(year, 12 - 1, 24); } + static ValentinesDay(year) { return new Date(year, 2 - 1, 14); } + static WhiteLoverDay(year) { return new Date(year, 3 - 1, 14); } + static FoolDay(year) { return new Date(year, 4 - 1, 1); } + static GirlsDay(year) { return new Date(year, 3 - 1, 7); } + static TreePlantDay(year) { return new Date(year, 3 - 1, 12); } + static FemaleDay(year) { return new Date(year, 3 - 1, 8); } + static ChildrenDay(year) { return new Date(year, 6 - 1, 1); } + static YouthDay(year) { return new Date(year, 5 - 1, 4); } + static TeacherDay(year) { return new Date(year, 9 - 1, 10); } + static SinglesDay(year) { return new Date(year, 11 - 1, 11); } + static MaoBirthday(year) { return new Date(year, 12 - 1, 26); } + static InaugurationDay(year) { return new Date(year, 1 - 1, 20); } + static GroundhogDay(year) { return new Date(year, 2 - 1, 2); } + static StPatrickDay(year) { return new Date(year, 3 - 1, 17); } + static StGeorgeDay(year) { return new Date(year, 4 - 1, 23); } + static Mayday(year) { return new Date(year, 5 - 1, 1); } + static CincoDeMayoday(year) { return new Date(year, 5 - 1, 5); } + static BaptisteDay(year) { return new Date(year, 6 - 1, 24); } + static UsaIndependenceDay(year) { return new Date(year, 7 - 1, 4); } + static BastilleDay(year) { return new Date(year, 7 - 1, 14); } + static HalloweenDay(year) { return new Date(year, 10 - 1, 31); } + static AllHallowDay(year) { return new Date(year, 11 - 1, 1); } + static AllSoulsday(year) { return new Date(year, 11 - 1, 2); } + static GuyFawkesDay(year) { return new Date(year, 11 - 1, 5); } + static Veteransday(year) { return new Date(year, 11 - 1, 11); } + static EasterDay(year) { return utilities$2.DateUtils.minValue(); } + getSwiftYear(text) { + let trimmedText = text.trim().toLowerCase(); + let swift = -10; + if (trimmedText.startsWith("next")) { + swift = 1; + } + else if (trimmedText.startsWith("last")) { + swift = -1; + } + else if (trimmedText.startsWith("this")) { + swift = 0; + } + return swift; + } + sanitizeHolidayToken(holiday) { + return holiday.replace(/[ ']/g, ""); + } +} +exports.EnglishHolidayParserConfiguration = EnglishHolidayParserConfiguration; + +}); + +unwrapExports(holidayConfiguration); + +var mergedConfiguration = createCommonjsModule(function (module, exports) { +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); + + + + + + + + + + + + + + + + + + + + + +class EnglishMergedExtractorConfiguration { + constructor() { + this.dateExtractor = new baseDate.BaseDateExtractor(new dateConfiguration.EnglishDateExtractorConfiguration()); + this.timeExtractor = new baseTime.BaseTimeExtractor(new timeConfiguration.EnglishTimeExtractorConfiguration()); + this.dateTimeExtractor = new baseDateTime$2.BaseDateTimeExtractor(new dateTimeConfiguration.EnglishDateTimeExtractorConfiguration()); + this.datePeriodExtractor = new baseDatePeriod.BaseDatePeriodExtractor(new datePeriodConfiguration.EnglishDatePeriodExtractorConfiguration()); + this.timePeriodExtractor = new baseTimePeriod.BaseTimePeriodExtractor(new timePeriodConfiguration.EnglishTimePeriodExtractorConfiguration()); + this.dateTimePeriodExtractor = new baseDateTimePeriod.BaseDateTimePeriodExtractor(new dateTimePeriodConfiguration.EnglishDateTimePeriodExtractorConfiguration()); + this.holidayExtractor = new baseHoliday.BaseHolidayExtractor(new holidayConfiguration.EnglishHolidayExtractorConfiguration()); + this.durationExtractor = new baseDuration.BaseDurationExtractor(new durationConfiguration.EnglishDurationExtractorConfiguration()); + this.setExtractor = new baseSet.BaseSetExtractor(new setConfiguration.EnglishSetExtractorConfiguration()); + this.integerExtractor = new recognizersTextNumber.EnglishIntegerExtractor(); + this.afterRegex = recognizersText.RegExpUtility.getSafeRegExp(englishDateTime.EnglishDateTime.AfterRegex); + this.sinceRegex = recognizersText.RegExpUtility.getSafeRegExp(englishDateTime.EnglishDateTime.SinceRegex); + this.beforeRegex = recognizersText.RegExpUtility.getSafeRegExp(englishDateTime.EnglishDateTime.BeforeRegex); + this.fromToRegex = recognizersText.RegExpUtility.getSafeRegExp(englishDateTime.EnglishDateTime.FromToRegex); + this.singleAmbiguousMonthRegex = recognizersText.RegExpUtility.getSafeRegExp(englishDateTime.EnglishDateTime.SingleAmbiguousMonthRegex); + this.prepositionSuffixRegex = recognizersText.RegExpUtility.getSafeRegExp(englishDateTime.EnglishDateTime.PrepositionSuffixRegex); + this.numberEndingPattern = recognizersText.RegExpUtility.getSafeRegExp(englishDateTime.EnglishDateTime.NumberEndingPattern); + this.filterWordRegexList = [ + recognizersText.RegExpUtility.getSafeRegExp(englishDateTime.EnglishDateTime.OneOnOneRegex) + ]; + } +} +exports.EnglishMergedExtractorConfiguration = EnglishMergedExtractorConfiguration; +class EnglishMergedParserConfiguration { + constructor(config) { + this.beforeRegex = recognizersText.RegExpUtility.getSafeRegExp(englishDateTime.EnglishDateTime.BeforeRegex); + this.afterRegex = recognizersText.RegExpUtility.getSafeRegExp(englishDateTime.EnglishDateTime.AfterRegex); + this.sinceRegex = recognizersText.RegExpUtility.getSafeRegExp(englishDateTime.EnglishDateTime.SinceRegex); + this.holidayParser = new baseHoliday.BaseHolidayParser(new holidayConfiguration.EnglishHolidayParserConfiguration()); + this.dateParser = config.dateParser; + this.timeParser = config.timeParser; + this.dateTimeParser = config.dateTimeParser; + this.datePeriodParser = config.datePeriodParser; + this.timePeriodParser = config.timePeriodParser; + this.dateTimePeriodParser = config.dateTimePeriodParser; + this.durationParser = config.durationParser; + this.setParser = new baseSet.BaseSetParser(new setConfiguration.EnglishSetParserConfiguration(config)); + } +} +exports.EnglishMergedParserConfiguration = EnglishMergedParserConfiguration; + +}); + +unwrapExports(mergedConfiguration); + +var spanishDateTime = createCommonjsModule(function (module, exports) { +"use strict"; +// ------------------------------------------------------------------------------ +// +// This code was generated by a tool. +// Changes to this file may cause incorrect behavior and will be lost if +// the code is regenerated. +// +// ------------------------------------------------------------------------------ +Object.defineProperty(exports, "__esModule", { value: true }); + +var SpanishDateTime; +(function (SpanishDateTime) { + SpanishDateTime.TillRegex = `(?hasta|al|a|--|-|—|——)(\\s+(el|la(s)?))?`; + SpanishDateTime.AndRegex = `(?y|y\\s*el|--|-|—|——)`; + SpanishDateTime.DayRegex = `(?01|02|03|04|05|06|07|08|09|10|11|12|13|14|15|16|17|18|19|1|20|21|22|23|24|25|26|27|28|29|2|30|31|3|4|5|6|7|8|9)(?=\\b|t)`; + SpanishDateTime.MonthNumRegex = `(?01|02|03|04|05|06|07|08|09|10|11|12|1|2|3|4|5|6|7|8|9)\\b`; + SpanishDateTime.DescRegex = `(?pm\\b|am\\b|p\\.m\\.|a\\.m\\.)`; + SpanishDateTime.AmDescRegex = `(am\\b|a\\.m\\.|a m\\b|a\\. m\\.\\b|a\\.m\\b|a\\. m\\b)`; + SpanishDateTime.PmDescRegex = `(pm\\b|p\\.m\\.|p\\b|p m\\b|p\\. m\\.\\b|p\\.m\\b|p\\. m\\b)`; + SpanishDateTime.AmPmDescRegex = `(ampm)`; + SpanishDateTime.TwoDigitYearRegex = `\\b(?([0-27-9]\\d))(?!(\\s*((\\:)|${SpanishDateTime.AmDescRegex}|${SpanishDateTime.PmDescRegex}|\\.\\d)))\\b`; + SpanishDateTime.FullTextYearRegex = `^[\\*]`; + SpanishDateTime.YearRegex = `(${baseDateTime.BaseDateTime.FourDigitYearRegex}|${SpanishDateTime.FullTextYearRegex})`; + SpanishDateTime.RelativeMonthRegex = `(?(este|pr[oó]ximo|[uú]ltimo)\\s+mes)\\b`; + SpanishDateTime.MonthRegex = `(?Abril|Abr|Agosto|Ago|Diciembre|Dic|Febrero|Feb|Enero|Ene|Julio|Jul|Junio|Jun|Marzo|Mar|Mayo|May|Noviembre|Nov|Octubre|Oct|Septiembre|Setiembre|Sept|Set)`; + SpanishDateTime.MonthSuffixRegex = `(?(en\\s+|del\\s+|de\\s+)?(${SpanishDateTime.RelativeMonthRegex}|${SpanishDateTime.MonthRegex}))`; + SpanishDateTime.DateUnitRegex = `(?años|año|meses|mes|semanas|semana|d[ií]a(s)?)\\b`; + SpanishDateTime.PastRegex = `(?\\b(pasad(a|o)(s)?|[uú]ltim[oa](s)?|anterior(es)?|previo(s)?)\\b)`; + SpanishDateTime.FutureRegex = `(?\\b(siguiente(s)?|pr[oó]xim[oa](s)?|dentro\\s+de|en)\\b)`; + SpanishDateTime.SimpleCasesRegex = `\\b((desde\\s+el|desde|del)\\s+)?(${SpanishDateTime.DayRegex})\\s*${SpanishDateTime.TillRegex}\\s*(${SpanishDateTime.DayRegex})\\s+${SpanishDateTime.MonthSuffixRegex}((\\s+|\\s*,\\s*)${SpanishDateTime.YearRegex})?\\b`; + SpanishDateTime.MonthFrontSimpleCasesRegex = `\\b${SpanishDateTime.MonthSuffixRegex}\\s+((desde\\s+el|desde|del)\\s+)?(${SpanishDateTime.DayRegex})\\s*${SpanishDateTime.TillRegex}\\s*(${SpanishDateTime.DayRegex})((\\s+|\\s*,\\s*)${SpanishDateTime.YearRegex})?\\b`; + SpanishDateTime.MonthFrontBetweenRegex = `\\b${SpanishDateTime.MonthSuffixRegex}\\s+((entre|entre\\s+el)\\s+)(${SpanishDateTime.DayRegex})\\s*${SpanishDateTime.AndRegex}\\s*(${SpanishDateTime.DayRegex})((\\s+|\\s*,\\s*)${SpanishDateTime.YearRegex})?\\b`; + SpanishDateTime.DayBetweenRegex = `\\b((entre|entre\\s+el)\\s+)(${SpanishDateTime.DayRegex})\\s*${SpanishDateTime.AndRegex}\\s*(${SpanishDateTime.DayRegex})\\s+${SpanishDateTime.MonthSuffixRegex}((\\s+|\\s*,\\s*)${SpanishDateTime.YearRegex})?\\b`; + SpanishDateTime.OneWordPeriodRegex = `\\b(((pr[oó]xim[oa]?|est[ea]|[uú]ltim[oa]?|en)\\s+)?(?Abril|Abr|Agosto|Ago|Diciembre|Dic|Enero|Ene|Febrero|Feb|Julio|Jul|Junio|Jun|Marzo|Mar|Mayo|May|Noviembre|Nov|Octubre|Oct|Septiembre|Setiembre|Sept|Set)|(?<=\\b(del|de la|el|la)\\s+)?(pr[oó]xim[oa](s)?|[uú]ltim[oa]?|est(e|a))\\s+(fin de semana|semana|mes|año)|fin de semana|(mes|años)? a la fecha)\\b`; + SpanishDateTime.MonthWithYearRegex = `\\b(((pr[oó]xim[oa](s)?|este|esta|[uú]ltim[oa]?|en)\\s+)?(?Abril|Abr|Agosto|Ago|Diciembre|Dic|Enero|Ene|Febrero|Feb|Julio|Jul|Junio|Jun|Marzo|Mar|Mayo|May|Noviembre|Nov|Octubre|Oct|Septiembre|Setiembre|Sept|Set)\\s+((de|del|de la)\\s+)?(${SpanishDateTime.YearRegex}|(?pr[oó]ximo(s)?|[uú]ltimo?|este)\\s+año))\\b`; + SpanishDateTime.MonthNumWithYearRegex = `(${SpanishDateTime.YearRegex}(\\s*?)[/\\-\\.](\\s*?)${SpanishDateTime.MonthNumRegex})|(${SpanishDateTime.MonthNumRegex}(\\s*?)[/\\-](\\s*?)${SpanishDateTime.YearRegex})`; + SpanishDateTime.WeekOfMonthRegex = `(?(la\\s+)?(?primera?|1ra|segunda|2da|tercera?|3ra|cuarta|4ta|quinta|5ta|[uú]ltima)\\s+semana\\s+${SpanishDateTime.MonthSuffixRegex})`; + SpanishDateTime.WeekOfYearRegex = `(?(la\\s+)?(?primera?|1ra|segunda|2da|tercera?|3ra|cuarta|4ta|quinta|5ta|[uú]ltima?)\\s+semana(\\s+del?)?\\s+(${SpanishDateTime.YearRegex}|(?pr[oó]ximo|[uú]ltimo|este)\\s+año))`; + SpanishDateTime.FollowedDateUnit = `^\\s*${SpanishDateTime.DateUnitRegex}`; + SpanishDateTime.NumberCombinedWithDateUnit = `\\b(?\\d+(\\.\\d*)?)${SpanishDateTime.DateUnitRegex}`; + SpanishDateTime.QuarterRegex = `(el\\s+)?(?primer|1er|segundo|2do|tercer|3ro|cuarto|4to)\\s+cuatrimestre(\\s+de|\\s*,\\s*)?\\s+(${SpanishDateTime.YearRegex}|(?pr[oó]ximo(s)?|[uú]ltimo?|este)\\s+año)`; + SpanishDateTime.QuarterRegexYearFront = `(${SpanishDateTime.YearRegex}|(?pr[oó]ximo(s)?|[uú]ltimo?|este)\\s+año)\\s+(el\\s+)?(?(primer|primero)|1er|segundo|2do|(tercer|terceo)|3ro|cuarto|4to)\\s+cuatrimestre`; + SpanishDateTime.AllHalfYearRegex = `^[.]`; + SpanishDateTime.PrefixDayRegex = `^[.]`; + SpanishDateTime.CenturySuffixRegex = `^[.]`; + SpanishDateTime.SeasonRegex = `\\b(?(([uú]ltim[oa]|est[ea]|el|la|(pr[oó]xim[oa]s?|siguiente))\\s+)?(?primavera|verano|otoño|invierno)((\\s+del?|\\s*,\\s*)?\\s+(${SpanishDateTime.YearRegex}|(?pr[oó]ximo|[uú]ltimo|este)\\s+año))?)\\b`; + SpanishDateTime.WhichWeekRegex = `(semana)(\\s*)(?\\d\\d|\\d|0\\d)`; + SpanishDateTime.WeekOfRegex = `(semana)(\\s*)((do|da|de))`; + SpanishDateTime.MonthOfRegex = `(mes)(\\s*)((do|da|de))`; + SpanishDateTime.RangeUnitRegex = `\\b(?años|año|meses|mes|semanas|semana)\\b`; + SpanishDateTime.InConnectorRegex = `\\b(in)\\b`; + SpanishDateTime.WithinNextPrefixRegex = `^[.]`; + SpanishDateTime.FromRegex = `((desde|de)(\\s*la(s)?)?)$`; + SpanishDateTime.ConnectorAndRegex = `(y\\s*(la(s)?)?)$`; + SpanishDateTime.BetweenRegex = `(entre\\s*(la(s)?)?)`; + SpanishDateTime.WeekDayRegex = `\\b(?Domingos?|Lunes|Martes|Mi[eé]rcoles|Jueves|Viernes|S[aá]bados?|Lu|Ma|Mi|Ju|Vi|Sa|Do)\\b`; + SpanishDateTime.OnRegex = `(?<=\\ben\\s+)(${SpanishDateTime.DayRegex}s?)\\b`; + SpanishDateTime.RelaxedOnRegex = `(?<=\\b(en|el|del)\\s+)((?10|11|12|13|14|15|16|17|18|19|1st|20|21|22|23|24|25|26|27|28|29|2|30|31|3|4|5|6|7|8|9)s?)\\b`; + SpanishDateTime.ThisRegex = `\\b((este\\s*)${SpanishDateTime.WeekDayRegex})|(${SpanishDateTime.WeekDayRegex}\\s*((de\\s+)?esta\\s+semana))\\b`; + SpanishDateTime.LastDateRegex = `\\b(([uú]ltimo)\\s*${SpanishDateTime.WeekDayRegex})|(${SpanishDateTime.WeekDayRegex}(\\s+((de\\s+)?(esta|la)\\s+([uú]ltima\\s+)?semana)))\\b`; + SpanishDateTime.NextDateRegex = `\\b(((pr[oó]ximo|siguiente)\\s*)${SpanishDateTime.WeekDayRegex})|(${SpanishDateTime.WeekDayRegex}(\\s+(de\\s+)?(la\\s+)?(pr[oó]xima|siguiente)(\\s*semana)))\\b`; + SpanishDateTime.SpecialDayRegex = `\\b((el\\s+)?(d[ií]a\\s+antes\\s+de\\s+ayer|anteayer)|((el\\s+)?d[ií]a\\s+(despu[eé]s\\s+)?de\\s+mañana|pasado\\s+mañana)|(el\\s)?d[ií]a siguiente|(el\\s)?pr[oó]ximo\\s+d[ií]a|(el\\s+)?[uú]ltimo d[ií]a|(d)?el d[ií]a|ayer|mañana|hoy)\\b`; + SpanishDateTime.SpecialDayWithNumRegex = `^[.]`; + SpanishDateTime.ForTheRegex = `^[.]`; + SpanishDateTime.WeekDayAndDayOfMonthRegex = `^[.]`; + SpanishDateTime.WeekDayOfMonthRegex = `(?(el\\s+)?(?primer|1er|segundo|2do|tercer|3er|cuarto|4to|quinto|5to|[uú]ltimo)\\s+${SpanishDateTime.WeekDayRegex}\\s+${SpanishDateTime.MonthSuffixRegex})`; + SpanishDateTime.RelativeWeekDayRegex = `^[.]`; + SpanishDateTime.NumberEndingPattern = `^[.]`; + SpanishDateTime.SpecialDateRegex = `(?<=\\b(en)\\s+el\\s+)${SpanishDateTime.DayRegex}\\b`; + SpanishDateTime.OfMonthRegex = `^\\s*de\\s*${SpanishDateTime.MonthSuffixRegex}`; + SpanishDateTime.MonthEndRegex = `(${SpanishDateTime.MonthRegex}\\s*(el)?\\s*$)`; + SpanishDateTime.WeekDayEnd = `${SpanishDateTime.WeekDayRegex}\\s*,?\\s*$`; + SpanishDateTime.DateYearRegex = `(?${SpanishDateTime.YearRegex}|${SpanishDateTime.TwoDigitYearRegex})`; + SpanishDateTime.DateExtractor1 = `\\b(${SpanishDateTime.WeekDayRegex}(\\s+|\\s*,\\s*))?${SpanishDateTime.DayRegex}?((\\s*(de)|[/\\\\\\.\\-])\\s*)?${SpanishDateTime.MonthRegex}\\b`; + SpanishDateTime.DateExtractor2 = `\\b(${SpanishDateTime.WeekDayRegex}(\\s+|\\s*,\\s*))?${SpanishDateTime.DayRegex}\\s*([\\.\\-]|de)\\s*${SpanishDateTime.MonthRegex}(\\s*,\\s*|\\s*(del?)\\s*)${SpanishDateTime.DateYearRegex}\\b`; + SpanishDateTime.DateExtractor3 = `\\b(${SpanishDateTime.WeekDayRegex}(\\s+|\\s*,\\s*))?${SpanishDateTime.DayRegex}(\\s+|\\s*,\\s*|\\s+de\\s+|\\s*-\\s*)${SpanishDateTime.MonthRegex}((\\s+|\\s*,\\s*)${SpanishDateTime.DateYearRegex})?\\b`; + SpanishDateTime.DateExtractor4 = `\\b${SpanishDateTime.MonthNumRegex}\\s*[/\\\\\\-]\\s*${SpanishDateTime.DayRegex}\\s*[/\\\\\\-]\\s*${SpanishDateTime.DateYearRegex}`; + SpanishDateTime.DateExtractor5 = `\\b${SpanishDateTime.DayRegex}\\s*[/\\\\\\-\\.]\\s*${SpanishDateTime.MonthNumRegex}\\s*[/\\\\\\-\\.]\\s*${SpanishDateTime.DateYearRegex}`; + SpanishDateTime.DateExtractor6 = `(?<=\\b(en|el)\\s+)${SpanishDateTime.MonthNumRegex}[\\-\\.]${SpanishDateTime.DayRegex}\\b`; + SpanishDateTime.DateExtractor7 = `\\b${SpanishDateTime.MonthNumRegex}\\s*/\\s*${SpanishDateTime.DayRegex}((\\s+|\\s*,\\s*|\\s+de\\s+)${SpanishDateTime.DateYearRegex})?\\b`; + SpanishDateTime.DateExtractor8 = `(?<=\\b(en|el)\\s+)${SpanishDateTime.DayRegex}[\\\\\\-]${SpanishDateTime.MonthNumRegex}\\b`; + SpanishDateTime.DateExtractor9 = `\\b${SpanishDateTime.DayRegex}\\s*/\\s*${SpanishDateTime.MonthNumRegex}((\\s+|\\s*,\\s*|\\s+de\\s+)${SpanishDateTime.DateYearRegex})?\\b`; + SpanishDateTime.DateExtractor10 = `\\b${SpanishDateTime.YearRegex}\\s*[/\\\\\\-\\.]\\s*${SpanishDateTime.MonthNumRegex}\\s*[/\\\\\\-\\.]\\s*${SpanishDateTime.DayRegex}`; + SpanishDateTime.HourNumRegex = `\\b(?cero|una|dos|tres|cuatro|cinco|seis|siete|ocho|nueve|diez|once|doce)\\b`; + SpanishDateTime.MinuteNumRegex = `(?un|dos|tres|cuatro|cinco|seis|siete|ocho|nueve|diez|once|doce|trece|catorce|quince|dieciseis|diecisiete|dieciocho|diecinueve|veinte|treinta|cuarenta|cincuenta)`; + SpanishDateTime.DeltaMinuteNumRegex = `(?un|dos|tres|cuatro|cinco|seis|siete|ocho|nueve|diez|once|doce|trece|catorce|quince|dieciseis|diecisiete|dieciocho|diecinueve|veinte|treinta|cuarenta|cincuenta)`; + SpanishDateTime.OclockRegex = `(?en\\s+punto)`; + SpanishDateTime.PmRegex = `(?((por|de|a|en)\\s+la)\\s+(tarde|noche))`; + SpanishDateTime.AmRegex = `(?((por|de|a|en)\\s+la)\\s+(mañana|madrugada))`; + SpanishDateTime.AmTimeRegex = `(?(esta|(por|de|a|en)\\s+la)\\s+(mañana|madrugada))`; + SpanishDateTime.PmTimeRegex = `(?(esta|(por|de|a|en)\\s+la)\\s+(tarde|noche))`; + SpanishDateTime.LessThanOneHour = `(?((\\s+y\\s+)?cuarto|(\\s*)menos cuarto|(\\s+y\\s+)media|${baseDateTime.BaseDateTime.DeltaMinuteRegex}(\\s+(minuto|minutos|min|mins))|${SpanishDateTime.DeltaMinuteNumRegex}(\\s+(minuto|minutos|min|mins))))`; + SpanishDateTime.TensTimeRegex = `(?diez|veint(i|e)|treinta|cuarenta|cincuenta)`; + SpanishDateTime.WrittenTimeRegex = `(?${SpanishDateTime.HourNumRegex}\\s*((y|menos)\\s+)?(${SpanishDateTime.MinuteNumRegex}|(${SpanishDateTime.TensTimeRegex}((\\s*y\\s+)?${SpanishDateTime.MinuteNumRegex})?)))`; + SpanishDateTime.TimePrefix = `(?${SpanishDateTime.LessThanOneHour}(\\s+(pasad[ao]s)\\s+(de\\s+las|las)?|\\s+(para|antes\\s+de)?\\s+(las?))?)`; + SpanishDateTime.TimeSuffix = `(?(${SpanishDateTime.LessThanOneHour}\\s+)?(${SpanishDateTime.AmRegex}|${SpanishDateTime.PmRegex}|${SpanishDateTime.OclockRegex}))`; + SpanishDateTime.BasicTime = `(?${SpanishDateTime.WrittenTimeRegex}|${SpanishDateTime.HourNumRegex}|${baseDateTime.BaseDateTime.HourRegex}:${baseDateTime.BaseDateTime.MinuteRegex}(:${baseDateTime.BaseDateTime.SecondRegex})?|${baseDateTime.BaseDateTime.HourRegex})`; + SpanishDateTime.AtRegex = `\\b(?<=\\b(a las?)\\s+)(${SpanishDateTime.WrittenTimeRegex}|${SpanishDateTime.HourNumRegex}|${baseDateTime.BaseDateTime.HourRegex})\\b`; + SpanishDateTime.ConnectNumRegex = `(${baseDateTime.BaseDateTime.HourRegex}(?00|01|02|03|04|05|06|07|08|09|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)\\s*${SpanishDateTime.DescRegex})`; + SpanishDateTime.TimeRegex1 = `(\\b${SpanishDateTime.TimePrefix}\\s+)?(${SpanishDateTime.WrittenTimeRegex}|${SpanishDateTime.HourNumRegex}|${baseDateTime.BaseDateTime.HourRegex})\\s*(${SpanishDateTime.DescRegex})`; + SpanishDateTime.TimeRegex2 = `(\\b${SpanishDateTime.TimePrefix}\\s+)?(T)?${baseDateTime.BaseDateTime.HourRegex}(\\s*)?:(\\s*)?${baseDateTime.BaseDateTime.MinuteRegex}((\\s*)?:(\\s*)?${baseDateTime.BaseDateTime.SecondRegex})?((\\s*${SpanishDateTime.DescRegex})|\\b)`; + SpanishDateTime.TimeRegex3 = `(\\b${SpanishDateTime.TimePrefix}\\s+)?${baseDateTime.BaseDateTime.HourRegex}\\.${baseDateTime.BaseDateTime.MinuteRegex}(\\s*${SpanishDateTime.DescRegex})`; + SpanishDateTime.TimeRegex4 = `\\b((${SpanishDateTime.DescRegex}?)|(${SpanishDateTime.BasicTime}?)(${SpanishDateTime.DescRegex}?))(${SpanishDateTime.TimePrefix}\\s*)(${SpanishDateTime.HourNumRegex}|${baseDateTime.BaseDateTime.HourRegex})?(\\s+${SpanishDateTime.TensTimeRegex}(\\s+y\\s+)?${SpanishDateTime.MinuteNumRegex}?)?(${SpanishDateTime.OclockRegex})?\\b`; + SpanishDateTime.TimeRegex5 = `\\b(${SpanishDateTime.TimePrefix}|${SpanishDateTime.BasicTime}${SpanishDateTime.TimePrefix})\\s+(\\s*${SpanishDateTime.DescRegex})?${SpanishDateTime.BasicTime}?\\s*${SpanishDateTime.TimeSuffix}\\b`; + SpanishDateTime.TimeRegex6 = `(${SpanishDateTime.BasicTime}(\\s*${SpanishDateTime.DescRegex})?\\s+${SpanishDateTime.TimeSuffix}\\b)`; + SpanishDateTime.TimeRegex7 = `\\b${SpanishDateTime.TimeSuffix}\\s+a\\s+las\\s+${SpanishDateTime.BasicTime}((\\s*${SpanishDateTime.DescRegex})|\\b)`; + SpanishDateTime.TimeRegex8 = `\\b${SpanishDateTime.TimeSuffix}\\s+${SpanishDateTime.BasicTime}((\\s*${SpanishDateTime.DescRegex})|\\b)`; + SpanishDateTime.TimeRegex9 = `\\b(?${SpanishDateTime.HourNumRegex}\\s+(${SpanishDateTime.TensTimeRegex}\\s*)?(y\\s+)?${SpanishDateTime.MinuteNumRegex}?)\\b`; + SpanishDateTime.TimeRegex10 = `(a\\s+la|al)\\s+(madrugada|mañana|medio\\s*d[ií]a|tarde|noche)`; + SpanishDateTime.TimeRegex11 = `\\b(${SpanishDateTime.WrittenTimeRegex})(${SpanishDateTime.DescRegex}?)\\b`; + SpanishDateTime.TimeRegex12 = `(\\b${SpanishDateTime.TimePrefix}\\s+)?${baseDateTime.BaseDateTime.HourRegex}(\\s*h\\s*)${baseDateTime.BaseDateTime.MinuteRegex}(\\s*${SpanishDateTime.DescRegex})?`; + SpanishDateTime.PrepositionRegex = `(?(a(l)?|en|de(l)?)?(\\s*(la(s)?|el|los))?$)`; + SpanishDateTime.NowRegex = `\\b(?(justo\\s+)?ahora(\\s+mismo)?|en\\s+este\\s+momento|tan\\s+pronto\\s+como\\s+sea\\s+posible|tan\\s+pronto\\s+como\\s+(pueda|puedas|podamos|puedan)|lo\\s+m[aá]s\\s+pronto\\s+posible|recientemente|previamente)\\b`; + SpanishDateTime.SuffixRegex = `^\\s*(((y|a|en|por)\\s+la|al)\\s+)?(mañana|madrugada|medio\\s*d[ií]a|tarde|noche)\\b`; + SpanishDateTime.TimeOfDayRegex = `\\b(?mañana|madrugada|(pasado\\s+(el\\s+)?)?medio\\s?d[ií]a|tarde|noche|anoche)\\b`; + SpanishDateTime.SpecificTimeOfDayRegex = `\\b(((((a)?\\s+la|esta|siguiente|pr[oó]xim[oa]|[uú]ltim[oa])\\s+)?${SpanishDateTime.TimeOfDayRegex}))\\b`; + SpanishDateTime.TimeOfTodayAfterRegex = `^\\s*(,\\s*)?(en|de(l)?\\s+)?${SpanishDateTime.SpecificTimeOfDayRegex}`; + SpanishDateTime.TimeOfTodayBeforeRegex = `(${SpanishDateTime.SpecificTimeOfDayRegex}(\\s*,)?(\\s+(a\\s+la(s)?|para))?\\s*)`; + SpanishDateTime.SimpleTimeOfTodayAfterRegex = `(${SpanishDateTime.HourNumRegex}|${baseDateTime.BaseDateTime.HourRegex})\\s*(,\\s*)?((en|de(l)?)?\\s+)?${SpanishDateTime.SpecificTimeOfDayRegex}`; + SpanishDateTime.SimpleTimeOfTodayBeforeRegex = `(${SpanishDateTime.SpecificTimeOfDayRegex}(\\s*,)?(\\s+(a\\s+la|para))?\\s*(${SpanishDateTime.HourNumRegex}|${baseDateTime.BaseDateTime.HourRegex}))`; + SpanishDateTime.TheEndOfRegex = `((a|e)l\\s+)?fin(alizar|al)?(\\s+(el|de(l)?)(\\s+d[ií]a)?(\\s+de)?)?\\s*$`; + SpanishDateTime.UnitRegex = `(?años|año|meses|mes|semanas|semana|d[ií]as|d[ií]a|horas|hora|h|hr|hrs|hs|minutos|minuto|mins|min|segundos|segundo|segs|seg)\\b`; + SpanishDateTime.ConnectorRegex = `^(,|t|para la|para las|cerca de la|cerca de las)$`; + SpanishDateTime.TimeHourNumRegex = `(?veintiuno|veintidos|veintitres|veinticuatro|cero|uno|dos|tres|cuatro|cinco|seis|siete|ocho|nueve|diez|once|doce|trece|catorce|quince|diecis([eé])is|diecisiete|dieciocho|diecinueve|veinte)`; + SpanishDateTime.PureNumFromTo = `((desde|de)\\s+(la(s)?\\s+)?)?(${baseDateTime.BaseDateTime.HourRegex}|${SpanishDateTime.TimeHourNumRegex})(\\s*(?${SpanishDateTime.DescRegex}))?\\s*${SpanishDateTime.TillRegex}\\s*(${baseDateTime.BaseDateTime.HourRegex}|${SpanishDateTime.TimeHourNumRegex})\\s*(?${SpanishDateTime.PmRegex}|${SpanishDateTime.AmRegex}|${SpanishDateTime.DescRegex})?`; + SpanishDateTime.PureNumBetweenAnd = `(entre\\s+(la(s)?\\s+)?)(${baseDateTime.BaseDateTime.HourRegex}|${SpanishDateTime.TimeHourNumRegex})(\\s*(?${SpanishDateTime.DescRegex}))?\\s*y\\s*(la(s)?\\s+)?(${baseDateTime.BaseDateTime.HourRegex}|${SpanishDateTime.TimeHourNumRegex})\\s*(?${SpanishDateTime.PmRegex}|${SpanishDateTime.AmRegex}|${SpanishDateTime.DescRegex})?`; + SpanishDateTime.SpecificTimeFromTo = `^[.]`; + SpanishDateTime.SpecificTimeBetweenAnd = `^[.]`; + SpanishDateTime.TimeUnitRegex = `(?horas|hora|h|minutos|minuto|mins|min|segundos|segundo|secs|sec)\\b`; + SpanishDateTime.TimeFollowedUnit = `^\\s*${SpanishDateTime.TimeUnitRegex}`; + SpanishDateTime.TimeNumberCombinedWithUnit = `\\b(?\\d+(\\,\\d*)?)\\s*${SpanishDateTime.TimeUnitRegex}`; + SpanishDateTime.DateTimePeriodNumberCombinedWithUnit = `\\b(?\\d+(\\.\\d*)?)\\s*${SpanishDateTime.TimeUnitRegex}`; + SpanishDateTime.PeriodTimeOfDayWithDateRegex = `\\b(((y|a|en|por)\\s+la|al)\\s+)?(?mañana|madrugada|(pasado\\s+(el\\s+)?)?medio\\s?d[ií]a|tarde|noche|anoche)\\b`; + SpanishDateTime.RelativeTimeUnitRegex = `(${SpanishDateTime.PastRegex}|${SpanishDateTime.FutureRegex})\\s+${SpanishDateTime.UnitRegex}`; + SpanishDateTime.LessThanRegex = `^[.]`; + SpanishDateTime.MoreThanRegex = `^[.]`; + SpanishDateTime.SuffixAndRegex = `(?\\s*(y)\\s+((un|uno|una)\\s+)?(?media|cuarto))`; + SpanishDateTime.FollowedUnit = `^\\s*${SpanishDateTime.UnitRegex}`; + SpanishDateTime.DurationNumberCombinedWithUnit = `\\b(?\\d+(\\,\\d*)?)${SpanishDateTime.UnitRegex}`; + SpanishDateTime.AnUnitRegex = `\\b(un(a)?)\\s+${SpanishDateTime.UnitRegex}`; + SpanishDateTime.DuringRegex = `^[.]`; + SpanishDateTime.AllRegex = `\\b(?tod[oa]?\\s+(el|la)\\s+(?año|mes|semana|d[ií]a))\\b`; + SpanishDateTime.HalfRegex = `\\b(?medi[oa]\\s+(?ano|mes|semana|d[íi]a|hora))\\b`; + SpanishDateTime.ConjunctionRegex = `^[.]`; + SpanishDateTime.InexactNumberRegex = `\\b(pocos|poco|algo|varios)\\b`; + SpanishDateTime.InexactNumberUnitRegex = `\\b(pocos|poco|algo|varios)\\s+${SpanishDateTime.UnitRegex}`; + SpanishDateTime.HolidayRegex1 = `\\b(?viernes santo|mi[eé]rcoles de ceniza|martes de carnaval|d[ií]a (de|de los) presidentes?|clebraci[oó]n de mao|año nuevo chino|año nuevo|noche vieja|(festividad de )?los mayos|d[ií]a de los inocentes|navidad|noche buena|d[ií]a de acci[oó]n de gracias|acci[oó]n de gracias|yuandan|halloween|noches de brujas|pascuas)(\\s+(del?\\s+)?(${SpanishDateTime.YearRegex}|(?(pr[oó]xim[oa]?|est[ea]|[uú]ltim[oa]?|en))\\s+año))?\\b`; + SpanishDateTime.HolidayRegex2 = `\\b(?(d[ií]a( del?( la)?)? )?(martin luther king|todos los santos|blanco|san patricio|san valent[ií]n|san jorge|cinco de mayo|independencia|raza|trabajador))(\\s+(del?\\s+)?(${SpanishDateTime.YearRegex}|(?(pr[oó]xim[oa]?|est[ea]|[uú]ltim[oa]?|en))\\s+año))?\\b`; + SpanishDateTime.HolidayRegex3 = `\\b(?(d[ií]a( del?( las?)?)? )(trabajador|madres?|padres?|[aá]rbol|mujer(es)?|solteros?|niños?|marmota|san valent[ií]n|maestro))(\\s+(del?\\s+)?(${SpanishDateTime.YearRegex}|(?(pr[oó]xim[oa]?|est[ea]|[uú]ltim[oa]?|en))\\s+año))?\\b`; + SpanishDateTime.BeforeRegex = `(antes(\\s+del?(\\s+las?)?)?)`; + SpanishDateTime.AfterRegex = `(despues(\\s*del?(\\s+las?)?)?)`; + SpanishDateTime.SinceRegex = `(desde(\\s+(las?|el))?)`; + SpanishDateTime.AroundRegex = `^[.]`; + SpanishDateTime.PeriodicRegex = `\\b(?a\\s*diario|diariamente|mensualmente|semanalmente|quincenalmente|anualmente)\\b`; + SpanishDateTime.EachExpression = `cada|tod[oa]s\\s*(l[oa]s)?`; + SpanishDateTime.EachUnitRegex = `(?(${SpanishDateTime.EachExpression})\\s*${SpanishDateTime.UnitRegex})`; + SpanishDateTime.EachPrefixRegex = `(?(${SpanishDateTime.EachExpression})\\s*$)`; + SpanishDateTime.EachDayRegex = `\\s*(${SpanishDateTime.EachExpression})\\s*d[ií]as\\s*\\b`; + SpanishDateTime.BeforeEachDayRegex = `(${SpanishDateTime.EachExpression})\\s*d[ií]as(\\s+a\\s+las?)?\\s*\\b`; + SpanishDateTime.SetEachRegex = `(?(${SpanishDateTime.EachExpression})\\s*)`; + SpanishDateTime.LaterEarlyPeriodRegex = `^[.]`; + SpanishDateTime.WeekWithWeekDayRangeRegex = `^[.]`; + SpanishDateTime.GeneralEndingRegex = `^[.]`; + SpanishDateTime.MiddlePauseRegex = `^[.]`; + SpanishDateTime.PrefixArticleRegex = `^[\\.]`; + SpanishDateTime.OrRegex = `^[.]`; + SpanishDateTime.YearPlusNumberRegex = `^[.]`; + SpanishDateTime.NumberAsTimeRegex = `^[.]`; + SpanishDateTime.TimeBeforeAfterRegex = `^[.]`; + SpanishDateTime.DateNumberConnectorRegex = `^[.]`; + SpanishDateTime.CenturyRegex = `^[.]`; + SpanishDateTime.DecadeRegex = `^[.]`; + SpanishDateTime.DecadeWithCenturyRegex = `^[.]`; + SpanishDateTime.RelativeDecadeRegex = `^[.]`; + SpanishDateTime.ComplexDatePeriodRegex = `^[.]`; + SpanishDateTime.YearSuffix = `(,?\\s*(${SpanishDateTime.YearRegex}|${SpanishDateTime.FullTextYearRegex}))`; + SpanishDateTime.AgoRegex = `\\b(antes)\\b`; + SpanishDateTime.LaterRegex = `\\b(despu[eé]s|desde ahora)\\b`; + SpanishDateTime.Tomorrow = 'mañana'; + SpanishDateTime.UnitMap = new Map([["años", "Y"], ["año", "Y"], ["meses", "MON"], ["mes", "MON"], ["semanas", "W"], ["semana", "W"], ["dias", "D"], ["dia", "D"], ["días", "D"], ["día", "D"], ["horas", "H"], ["hora", "H"], ["hrs", "H"], ["hr", "H"], ["h", "H"], ["minutos", "M"], ["minuto", "M"], ["mins", "M"], ["min", "M"], ["segundos", "S"], ["segundo", "S"], ["segs", "S"], ["seg", "S"]]); + SpanishDateTime.UnitValueMap = new Map([["años", 31536000], ["año", 31536000], ["meses", 2592000], ["mes", 2592000], ["semanas", 604800], ["semana", 604800], ["dias", 86400], ["dia", 86400], ["días", 86400], ["día", 86400], ["horas", 3600], ["hora", 3600], ["hrs", 3600], ["hr", 3600], ["h", 3600], ["minutos", 60], ["minuto", 60], ["mins", 60], ["min", 60], ["segundos", 1], ["segundo", 1], ["segs", 1], ["seg", 1]]); + SpanishDateTime.SeasonMap = new Map([["primavera", "SP"], ["verano", "SU"], ["otoño", "FA"], ["invierno", "WI"]]); + SpanishDateTime.SeasonValueMap = new Map([["SP", 3], ["SU", 6], ["FA", 9], ["WI", 12]]); + SpanishDateTime.CardinalMap = new Map([["primer", 1], ["primero", 1], ["primera", 1], ["1er", 1], ["1ro", 1], ["1ra", 1], ["segundo", 2], ["segunda", 2], ["2do", 2], ["2da", 2], ["tercer", 3], ["tercero", 3], ["tercera", 3], ["3er", 3], ["3ro", 3], ["3ra", 3], ["cuarto", 4], ["cuarta", 4], ["4to", 4], ["4ta", 4], ["quinto", 5], ["quinta", 5], ["5to", 5], ["5ta", 5]]); + SpanishDateTime.DayOfWeek = new Map([["lunes", 1], ["martes", 2], ["miercoles", 3], ["miércoles", 3], ["jueves", 4], ["viernes", 5], ["sabado", 6], ["domingo", 0], ["lu", 1], ["ma", 2], ["mi", 3], ["ju", 4], ["vi", 5], ["sa", 6], ["do", 0]]); + SpanishDateTime.MonthOfYear = new Map([["1", 1], ["2", 2], ["3", 3], ["4", 4], ["5", 5], ["6", 6], ["7", 7], ["8", 8], ["9", 9], ["10", 10], ["11", 11], ["12", 12], ["enero", 1], ["febrero", 2], ["marzo", 3], ["abril", 4], ["mayo", 5], ["junio", 6], ["julio", 7], ["agosto", 8], ["septiembre", 9], ["setiembre", 9], ["octubre", 10], ["noviembre", 11], ["diciembre", 12], ["ene", 1], ["feb", 2], ["mar", 3], ["abr", 4], ["may", 5], ["jun", 6], ["jul", 7], ["ago", 8], ["sept", 9], ["set", 9], ["oct", 10], ["nov", 11], ["dic", 12], ["01", 1], ["02", 2], ["03", 3], ["04", 4], ["05", 5], ["06", 6], ["07", 7], ["08", 8], ["09", 9]]); + SpanishDateTime.Numbers = new Map([["cero", 0], ["un", 1], ["una", 1], ["uno", 1], ["dos", 2], ["tres", 3], ["cuatro", 4], ["cinco", 5], ["seis", 6], ["siete", 7], ["ocho", 8], ["nueve", 9], ["diez", 10], ["once", 11], ["doce", 12], ["docena", 12], ["docenas", 12], ["trece", 13], ["catorce", 14], ["quince", 15], ["dieciseis", 16], ["dieciséis", 16], ["diecisiete", 17], ["dieciocho", 18], ["diecinueve", 19], ["veinte", 20], ["ventiuna", 21], ["ventiuno", 21], ["veintiun", 21], ["veintiún", 21], ["veintiuno", 21], ["veintiuna", 21], ["veintidos", 22], ["veintidós", 22], ["veintitres", 23], ["veintitrés", 23], ["veinticuatro", 24], ["veinticinco", 25], ["veintiseis", 26], ["veintiséis", 26], ["veintisiete", 27], ["veintiocho", 28], ["veintinueve", 29], ["treinta", 30]]); + SpanishDateTime.HolidayNames = new Map([["padres", ["diadelpadre"]], ["madres", ["diadelamadre"]], ["acciondegracias", ["diadegracias", "diadeacciondegracias", "acciondegracias"]], ["trabajador", ["diadeltrabajador"]], ["delaraza", ["diadelaraza", "diadeladiversidadcultural"]], ["memoria", ["diadelamemoria"]], ["pascuas", ["diadepascuas", "pascuas"]], ["navidad", ["navidad", "diadenavidad"]], ["nochebuena", ["diadenochebuena", "nochebuena"]], ["añonuevo", ["añonuevo", "diadeañonuevo"]], ["nochevieja", ["nochevieja", "diadenochevieja"]], ["yuandan", ["yuandan"]], ["maestro", ["diadelmaestro"]], ["todoslossantos", ["todoslossantos"]], ["niño", ["diadelniño"]], ["mujer", ["diadelamujer"]]]); + SpanishDateTime.VariableHolidaysTimexDictionary = new Map([["padres", "-06-WXX-7-3"], ["madres", "-05-WXX-7-2"], ["acciondegracias", "-11-WXX-4-4"], ["trabajador", "-05-WXX-1-1"], ["delaraza", "-10-WXX-1-2"], ["memoria", "-03-WXX-2-4"]]); + SpanishDateTime.DoubleNumbers = new Map([["mitad", 0.5], ["cuarto", 0.25]]); + SpanishDateTime.DateTokenPrefix = 'en '; + SpanishDateTime.TimeTokenPrefix = 'a las '; + SpanishDateTime.TokenBeforeDate = 'el '; + SpanishDateTime.TokenBeforeTime = 'la '; + SpanishDateTime.NextPrefixRegex = `(pr[oó]xim[oa]|siguiente)\\b`; + SpanishDateTime.PastPrefixRegex = `([uú]ltim[oa])\\b`; + SpanishDateTime.ThisPrefixRegex = `(est[ea])\\b`; + SpanishDateTime.RelativeDayRegex = `^[\\.]`; + SpanishDateTime.RestOfDateRegex = `^[\\.]`; + SpanishDateTime.RelativeDurationUnitRegex = `^[\\.]`; + SpanishDateTime.ReferenceDatePeriodRegex = `^[.]`; + SpanishDateTime.FromToRegex = `\\b(from).+(to)\\b.+`; + SpanishDateTime.SingleAmbiguousMonthRegex = `^(the\\s+)?(may|march)$`; + SpanishDateTime.UnspecificDatePeriodRegex = `^[.]`; + SpanishDateTime.PrepositionSuffixRegex = `\\b(on|in|at|around|for|during|since|from|to)$`; + SpanishDateTime.RestOfDateTimeRegex = `^[\\.]`; + SpanishDateTime.SetWeekDayRegex = `^[\\.]`; + SpanishDateTime.NightRegex = `\\b(medionoche|noche)\\b`; + SpanishDateTime.CommonDatePrefixRegex = `^[\\.]`; + SpanishDateTime.DurationUnitRegex = `^[\\.]`; + SpanishDateTime.DurationConnectorRegex = `^[.]`; + SpanishDateTime.YearAfterRegex = `^[.]`; + SpanishDateTime.YearPeriodRegex = `^[.]`; + SpanishDateTime.FutureSuffixRegex = `^[.]`; + SpanishDateTime.WrittenDecades = new Map([["", 0]]); + SpanishDateTime.SpecialDecadeCases = new Map([["", 0]]); + SpanishDateTime.DefaultLanguageFallback = 'DMY'; + SpanishDateTime.DurationDateRestrictions = []; +})(SpanishDateTime = exports.SpanishDateTime || (exports.SpanishDateTime = {})); + +}); + +unwrapExports(spanishDateTime); + +var durationConfiguration$2 = createCommonjsModule(function (module, exports) { +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); + + + +class SpanishDurationExtractorConfiguration { + constructor() { + this.allRegex = recognizersText.RegExpUtility.getSafeRegExp(spanishDateTime.SpanishDateTime.AllRegex, "gis"); + this.halfRegex = recognizersText.RegExpUtility.getSafeRegExp(spanishDateTime.SpanishDateTime.HalfRegex, "gis"); + this.followedUnit = recognizersText.RegExpUtility.getSafeRegExp(spanishDateTime.SpanishDateTime.FollowedUnit, "gis"); + this.numberCombinedWithUnit = recognizersText.RegExpUtility.getSafeRegExp(spanishDateTime.SpanishDateTime.DurationNumberCombinedWithUnit, "gis"); + this.anUnitRegex = recognizersText.RegExpUtility.getSafeRegExp(spanishDateTime.SpanishDateTime.AnUnitRegex, "gis"); + this.inexactNumberUnitRegex = recognizersText.RegExpUtility.getSafeRegExp(spanishDateTime.SpanishDateTime.InexactNumberUnitRegex, "gis"); + this.suffixAndRegex = recognizersText.RegExpUtility.getSafeRegExp(spanishDateTime.SpanishDateTime.SuffixAndRegex, "gis"); + this.relativeDurationUnitRegex = recognizersText.RegExpUtility.getSafeRegExp(spanishDateTime.SpanishDateTime.RelativeDurationUnitRegex, "gis"); + this.moreThanRegex = recognizersText.RegExpUtility.getSafeRegExp(spanishDateTime.SpanishDateTime.MoreThanRegex, "gis"); + this.lessThanRegex = recognizersText.RegExpUtility.getSafeRegExp(spanishDateTime.SpanishDateTime.LessThanOneHour, "gis"); + this.cardinalExtractor = new recognizersTextNumber.SpanishCardinalExtractor(); + } +} +exports.SpanishDurationExtractorConfiguration = SpanishDurationExtractorConfiguration; +class SpanishDurationParserConfiguration { + constructor(config) { + this.cardinalExtractor = config.cardinalExtractor; + this.numberParser = config.numberParser; + this.followedUnit = recognizersText.RegExpUtility.getSafeRegExp(spanishDateTime.SpanishDateTime.FollowedUnit); + this.suffixAndRegex = recognizersText.RegExpUtility.getSafeRegExp(spanishDateTime.SpanishDateTime.SuffixAndRegex); + this.numberCombinedWithUnit = recognizersText.RegExpUtility.getSafeRegExp(spanishDateTime.SpanishDateTime.DurationNumberCombinedWithUnit); + this.anUnitRegex = recognizersText.RegExpUtility.getSafeRegExp(spanishDateTime.SpanishDateTime.AnUnitRegex); + this.allDateUnitRegex = recognizersText.RegExpUtility.getSafeRegExp(spanishDateTime.SpanishDateTime.AllRegex); + this.halfDateUnitRegex = recognizersText.RegExpUtility.getSafeRegExp(spanishDateTime.SpanishDateTime.HalfRegex); + this.inexactNumberUnitRegex = recognizersText.RegExpUtility.getSafeRegExp(spanishDateTime.SpanishDateTime.InexactNumberUnitRegex); + this.unitMap = config.unitMap; + this.unitValueMap = config.unitValueMap; + this.doubleNumbers = config.doubleNumbers; + } +} +exports.SpanishDurationParserConfiguration = SpanishDurationParserConfiguration; + +}); + +unwrapExports(durationConfiguration$2); + +var timeConfiguration$2 = createCommonjsModule(function (module, exports) { +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); + + + + +class SpanishTimeExtractorConfiguration { + constructor() { + this.atRegex = recognizersText.RegExpUtility.getSafeRegExp(spanishDateTime.SpanishDateTime.AtRegex, "gis"); + this.ishRegex = null; + this.timeRegexList = SpanishTimeExtractorConfiguration.getTimeRegexList(); + this.durationExtractor = new baseDuration.BaseDurationExtractor(new durationConfiguration$2.SpanishDurationExtractorConfiguration()); + } + static getTimeRegexList() { + return [ + recognizersText.RegExpUtility.getSafeRegExp(spanishDateTime.SpanishDateTime.TimeRegex1, "gis"), + recognizersText.RegExpUtility.getSafeRegExp(spanishDateTime.SpanishDateTime.TimeRegex2, "gis"), + recognizersText.RegExpUtility.getSafeRegExp(spanishDateTime.SpanishDateTime.TimeRegex3, "gis"), + recognizersText.RegExpUtility.getSafeRegExp(spanishDateTime.SpanishDateTime.TimeRegex4, "gis"), + recognizersText.RegExpUtility.getSafeRegExp(spanishDateTime.SpanishDateTime.TimeRegex5, "gis"), + recognizersText.RegExpUtility.getSafeRegExp(spanishDateTime.SpanishDateTime.TimeRegex6, "gis"), + recognizersText.RegExpUtility.getSafeRegExp(spanishDateTime.SpanishDateTime.TimeRegex7, "gis"), + recognizersText.RegExpUtility.getSafeRegExp(spanishDateTime.SpanishDateTime.TimeRegex8, "gis"), + recognizersText.RegExpUtility.getSafeRegExp(spanishDateTime.SpanishDateTime.TimeRegex9, "gis"), + recognizersText.RegExpUtility.getSafeRegExp(spanishDateTime.SpanishDateTime.TimeRegex10, "gis"), + recognizersText.RegExpUtility.getSafeRegExp(spanishDateTime.SpanishDateTime.TimeRegex11, "gis"), + recognizersText.RegExpUtility.getSafeRegExp(spanishDateTime.SpanishDateTime.TimeRegex12, "gis"), + recognizersText.RegExpUtility.getSafeRegExp(spanishDateTime.SpanishDateTime.ConnectNumRegex, "gis") + ]; + } +} +exports.SpanishTimeExtractorConfiguration = SpanishTimeExtractorConfiguration; +class SpanishTimeParserConfiguration { + constructor(config) { + this.timeTokenPrefix = spanishDateTime.SpanishDateTime.TimeTokenPrefix; + this.atRegex = recognizersText.RegExpUtility.getSafeRegExp(spanishDateTime.SpanishDateTime.AtRegex, "gis"); + this.timeRegexes = SpanishTimeExtractorConfiguration.getTimeRegexList(); + this.lessThanOneHour = recognizersText.RegExpUtility.getSafeRegExp(spanishDateTime.SpanishDateTime.LessThanOneHour, "gis"); + this.timeSuffix = recognizersText.RegExpUtility.getSafeRegExp(spanishDateTime.SpanishDateTime.TimeSuffix, "gis"); + this.utilityConfiguration = config.utilityConfiguration; + this.numbers = config.numbers; + } + adjustByPrefix(prefix, adjust) { + let deltaMin = 0; + let trimedPrefix = prefix.trim().toLowerCase(); + if (trimedPrefix.startsWith("cuarto") || trimedPrefix.startsWith("y cuarto")) { + deltaMin = 15; + } + else if (trimedPrefix.startsWith("menos cuarto")) { + deltaMin = -15; + } + else if (trimedPrefix.startsWith("media") || trimedPrefix.startsWith("y media")) { + deltaMin = 30; + } + else { + let matches = recognizersText.RegExpUtility.getMatches(this.lessThanOneHour, trimedPrefix); + if (matches.length) { + let match = matches[0]; + let minStr = match.groups("deltamin").value; + if (minStr) { + deltaMin = parseInt(minStr, 10); + } + else { + minStr = match.groups("deltaminnum").value.toLowerCase(); + if (this.numbers.has(minStr)) { + deltaMin = this.numbers.get(minStr); + } + } + } + } + if (trimedPrefix.endsWith("pasadas") || trimedPrefix.endsWith("pasados") || + trimedPrefix.endsWith("pasadas las") || trimedPrefix.endsWith("pasados las") || + trimedPrefix.endsWith("pasadas de las") || trimedPrefix.endsWith("pasados de las")) { + // deltaMin it's positive + } + else if (trimedPrefix.endsWith("para la") || trimedPrefix.endsWith("para las") || + trimedPrefix.endsWith("antes de la") || trimedPrefix.endsWith("antes de las")) { + deltaMin = -deltaMin; + } + adjust.min += deltaMin; + if (adjust.min < 0) { + adjust.min += 60; + adjust.hour -= 1; + } + adjust.hasMin = adjust.hasMin || adjust.min !== 0; + } + adjustBySuffix(suffix, adjust) { + let trimedSuffix = suffix.trim().toLowerCase(); + this.adjustByPrefix(trimedSuffix, adjust); + let deltaHour = 0; + let matches = recognizersText.RegExpUtility.getMatches(this.timeSuffix, trimedSuffix); + if (matches.length) { + let match = matches[0]; + if (match.index === 0 && match.length === trimedSuffix.length) { + let oclockStr = match.groups("oclock").value; + if (!oclockStr) { + let amStr = match.groups("am").value; + if (amStr) { + if (adjust.hour >= 12) { + deltaHour = -12; + } + adjust.hasAm = true; + } + let pmStr = match.groups("pm").value; + if (pmStr) { + if (adjust.hour < 12) { + deltaHour = 12; + } + adjust.hasPm = true; + } + } + } + } + adjust.hour = (adjust.hour + deltaHour) % 24; + } +} +exports.SpanishTimeParserConfiguration = SpanishTimeParserConfiguration; + +}); + +unwrapExports(timeConfiguration$2); + +var dateTimeConfiguration$2 = createCommonjsModule(function (module, exports) { +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); + + + + + + + + + +class SpanishDateTimeExtractorConfiguration { + constructor() { + this.prepositionRegex = recognizersText.RegExpUtility.getSafeRegExp(spanishDateTime.SpanishDateTime.PrepositionRegex, "gis"); + this.nowRegex = recognizersText.RegExpUtility.getSafeRegExp(spanishDateTime.SpanishDateTime.NowRegex, "gis"); + this.suffixRegex = recognizersText.RegExpUtility.getSafeRegExp(spanishDateTime.SpanishDateTime.SuffixRegex, "gis"); + this.timeOfDayRegex = recognizersText.RegExpUtility.getSafeRegExp(spanishDateTime.SpanishDateTime.TimeOfDayRegex, "gis"); + this.specificTimeOfDayRegex = recognizersText.RegExpUtility.getSafeRegExp(spanishDateTime.SpanishDateTime.SpecificTimeOfDayRegex, "gis"); + this.timeOfTodayAfterRegex = recognizersText.RegExpUtility.getSafeRegExp(spanishDateTime.SpanishDateTime.TimeOfTodayAfterRegex, "gis"); + this.timeOfTodayBeforeRegex = recognizersText.RegExpUtility.getSafeRegExp(spanishDateTime.SpanishDateTime.TimeOfTodayBeforeRegex, "gis"); + this.simpleTimeOfTodayAfterRegex = recognizersText.RegExpUtility.getSafeRegExp(spanishDateTime.SpanishDateTime.SimpleTimeOfTodayAfterRegex, "gis"); + this.simpleTimeOfTodayBeforeRegex = recognizersText.RegExpUtility.getSafeRegExp(spanishDateTime.SpanishDateTime.SimpleTimeOfTodayBeforeRegex, "gis"); + this.theEndOfRegex = recognizersText.RegExpUtility.getSafeRegExp(spanishDateTime.SpanishDateTime.TheEndOfRegex, "gis"); + this.unitRegex = recognizersText.RegExpUtility.getSafeRegExp(spanishDateTime.SpanishDateTime.UnitRegex, "gis"); + this.connectorRegex = recognizersText.RegExpUtility.getSafeRegExp(spanishDateTime.SpanishDateTime.ConnectorRegex, "gis"); + this.nightRegex = recognizersText.RegExpUtility.getSafeRegExp(spanishDateTime.SpanishDateTime.NightRegex, "gis"); + this.datePointExtractor = new baseDate.BaseDateExtractor(new dateConfiguration$2.SpanishDateExtractorConfiguration()); + this.timePointExtractor = new baseTime.BaseTimeExtractor(new timeConfiguration$2.SpanishTimeExtractorConfiguration()); + this.durationExtractor = new baseDuration.BaseDurationExtractor(new durationConfiguration$2.SpanishDurationExtractorConfiguration()); + this.utilityConfiguration = new baseConfiguration$2.SpanishDateTimeUtilityConfiguration(); + } + isConnectorToken(source) { + let trimmed = source.trim(); + return trimmed === "" + || recognizersText.RegExpUtility.getFirstMatchIndex(this.prepositionRegex, source).matched + || recognizersText.RegExpUtility.getFirstMatchIndex(this.connectorRegex, source).matched; + } +} +exports.SpanishDateTimeExtractorConfiguration = SpanishDateTimeExtractorConfiguration; +class SpanishDateTimeParserConfiguration { + constructor(config) { + this.tokenBeforeDate = spanishDateTime.SpanishDateTime.TokenBeforeDate; + this.tokenBeforeTime = spanishDateTime.SpanishDateTime.TokenBeforeTime; + this.nowRegex = recognizersText.RegExpUtility.getSafeRegExp(spanishDateTime.SpanishDateTime.NowRegex, "gis"); + this.amTimeRegex = recognizersText.RegExpUtility.getSafeRegExp(spanishDateTime.SpanishDateTime.AmTimeRegex, "gis"); + this.pmTimeRegex = recognizersText.RegExpUtility.getSafeRegExp(spanishDateTime.SpanishDateTime.PmTimeRegex, "gis"); + this.simpleTimeOfTodayAfterRegex = recognizersText.RegExpUtility.getSafeRegExp(spanishDateTime.SpanishDateTime.SimpleTimeOfTodayAfterRegex, "gis"); + this.simpleTimeOfTodayBeforeRegex = recognizersText.RegExpUtility.getSafeRegExp(spanishDateTime.SpanishDateTime.SimpleTimeOfTodayBeforeRegex, "gis"); + this.specificTimeOfDayRegex = recognizersText.RegExpUtility.getSafeRegExp(spanishDateTime.SpanishDateTime.SpecificTimeOfDayRegex, "gis"); + this.theEndOfRegex = recognizersText.RegExpUtility.getSafeRegExp(spanishDateTime.SpanishDateTime.TheEndOfRegex, "gis"); + this.unitRegex = recognizersText.RegExpUtility.getSafeRegExp(spanishDateTime.SpanishDateTime.UnitRegex, "gis"); + this.nextPrefixRegex = recognizersText.RegExpUtility.getSafeRegExp(spanishDateTime.SpanishDateTime.NextPrefixRegex, "gis"); + this.pastPrefixRegex = recognizersText.RegExpUtility.getSafeRegExp(spanishDateTime.SpanishDateTime.PastPrefixRegex, "gis"); + this.dateExtractor = config.dateExtractor; + this.timeExtractor = config.timeExtractor; + this.dateParser = config.dateParser; + this.timeParser = config.timeParser; + this.numbers = config.numbers; + this.cardinalExtractor = config.cardinalExtractor; + this.numberParser = config.numberParser; + this.durationExtractor = config.durationExtractor; + this.durationParser = config.durationParser; + this.unitMap = config.unitMap; + this.utilityConfiguration = config.utilityConfiguration; + } + haveAmbiguousToken(text, matchedText) { + return text.toLowerCase().includes("esta mañana") + && matchedText.toLocaleLowerCase().includes("mañana"); + } + getMatchedNowTimex(text) { + let trimedText = text.trim().toLowerCase(); + let timex = ""; + if (trimedText.endsWith("ahora") || trimedText.endsWith("mismo") || trimedText.endsWith("momento")) { + timex = "PRESENT_REF"; + } + else if (trimedText.endsWith("posible") || trimedText.endsWith("pueda") || + trimedText.endsWith("puedas") || trimedText.endsWith("podamos") || trimedText.endsWith("puedan")) { + timex = "FUTURE_REF"; + } + else if (trimedText.endsWith("mente")) { + timex = "PAST_REF"; + } + else { + return { + matched: false, + timex: null + }; + } + return { + matched: true, + timex: timex + }; + } + getSwiftDay(text) { + let trimedText = text.trim().toLowerCase(); + let swift = 0; + if (recognizersText.RegExpUtility.getFirstMatchIndex(this.pastPrefixRegex, trimedText).matched) { + swift = -1; + } + else if (recognizersText.RegExpUtility.getFirstMatchIndex(this.nextPrefixRegex, trimedText).matched) { + swift = 1; + } + return swift; + } + getHour(text, hour) { + let trimedText = text.trim().toLowerCase(); + let result = hour; + // TODO: Replace with a regex + if ((trimedText.endsWith("mañana") || trimedText.endsWith("madrugada")) && hour >= 12) { + result -= 12; + } + else if (!(trimedText.endsWith("mañana") || trimedText.endsWith("madrugada")) && hour < 12) { + result += 12; + } + return result; + } +} +exports.SpanishDateTimeParserConfiguration = SpanishDateTimeParserConfiguration; + +}); + +unwrapExports(dateTimeConfiguration$2); + +var datePeriodConfiguration$2 = createCommonjsModule(function (module, exports) { +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); + + + + + + + + +class SpanishDatePeriodExtractorConfiguration { + constructor() { + this.simpleCasesRegexes = [ + recognizersText.RegExpUtility.getSafeRegExp(spanishDateTime.SpanishDateTime.SimpleCasesRegex), + recognizersText.RegExpUtility.getSafeRegExp(spanishDateTime.SpanishDateTime.DayBetweenRegex), + recognizersText.RegExpUtility.getSafeRegExp(spanishDateTime.SpanishDateTime.SimpleCasesRegex), + recognizersText.RegExpUtility.getSafeRegExp(spanishDateTime.SpanishDateTime.DayBetweenRegex), + recognizersText.RegExpUtility.getSafeRegExp(spanishDateTime.SpanishDateTime.OneWordPeriodRegex), + recognizersText.RegExpUtility.getSafeRegExp(spanishDateTime.SpanishDateTime.MonthWithYearRegex), + recognizersText.RegExpUtility.getSafeRegExp(spanishDateTime.SpanishDateTime.MonthNumWithYearRegex), + recognizersText.RegExpUtility.getSafeRegExp(spanishDateTime.SpanishDateTime.YearRegex), + recognizersText.RegExpUtility.getSafeRegExp(spanishDateTime.SpanishDateTime.WeekOfMonthRegex), + recognizersText.RegExpUtility.getSafeRegExp(spanishDateTime.SpanishDateTime.WeekOfYearRegex), + recognizersText.RegExpUtility.getSafeRegExp(spanishDateTime.SpanishDateTime.MonthFrontBetweenRegex), + recognizersText.RegExpUtility.getSafeRegExp(spanishDateTime.SpanishDateTime.MonthFrontSimpleCasesRegex), + recognizersText.RegExpUtility.getSafeRegExp(spanishDateTime.SpanishDateTime.QuarterRegex), + recognizersText.RegExpUtility.getSafeRegExp(spanishDateTime.SpanishDateTime.QuarterRegexYearFront), + recognizersText.RegExpUtility.getSafeRegExp(spanishDateTime.SpanishDateTime.AllHalfYearRegex), + recognizersText.RegExpUtility.getSafeRegExp(spanishDateTime.SpanishDateTime.SeasonRegex), + recognizersText.RegExpUtility.getSafeRegExp(spanishDateTime.SpanishDateTime.RestOfDateRegex), + recognizersText.RegExpUtility.getSafeRegExp(spanishDateTime.SpanishDateTime.LaterEarlyPeriodRegex), + recognizersText.RegExpUtility.getSafeRegExp(spanishDateTime.SpanishDateTime.WeekWithWeekDayRangeRegex) + ]; + this.illegalYearRegex = recognizersText.RegExpUtility.getSafeRegExp(baseDateTime.BaseDateTime.IllegalYearRegex); + this.YearRegex = recognizersText.RegExpUtility.getSafeRegExp(spanishDateTime.SpanishDateTime.YearRegex); + this.tillRegex = recognizersText.RegExpUtility.getSafeRegExp(spanishDateTime.SpanishDateTime.TillRegex); + this.followedUnit = recognizersText.RegExpUtility.getSafeRegExp(spanishDateTime.SpanishDateTime.FollowedDateUnit); + this.numberCombinedWithUnit = recognizersText.RegExpUtility.getSafeRegExp(spanishDateTime.SpanishDateTime.NumberCombinedWithDateUnit); + this.pastRegex = recognizersText.RegExpUtility.getSafeRegExp(spanishDateTime.SpanishDateTime.PastRegex); + this.futureRegex = recognizersText.RegExpUtility.getSafeRegExp(spanishDateTime.SpanishDateTime.FutureRegex); + this.weekOfRegex = recognizersText.RegExpUtility.getSafeRegExp(spanishDateTime.SpanishDateTime.WeekOfRegex); + this.monthOfRegex = recognizersText.RegExpUtility.getSafeRegExp(spanishDateTime.SpanishDateTime.MonthOfRegex); + this.dateUnitRegex = recognizersText.RegExpUtility.getSafeRegExp(spanishDateTime.SpanishDateTime.DateUnitRegex); + this.inConnectorRegex = recognizersText.RegExpUtility.getSafeRegExp(spanishDateTime.SpanishDateTime.InConnectorRegex); + this.rangeUnitRegex = recognizersText.RegExpUtility.getSafeRegExp(spanishDateTime.SpanishDateTime.RangeUnitRegex); + this.fromRegex = recognizersText.RegExpUtility.getSafeRegExp(spanishDateTime.SpanishDateTime.FromRegex); + this.connectorAndRegex = recognizersText.RegExpUtility.getSafeRegExp(spanishDateTime.SpanishDateTime.ConnectorAndRegex); + this.betweenRegex = recognizersText.RegExpUtility.getSafeRegExp(spanishDateTime.SpanishDateTime.BetweenRegex); + this.datePointExtractor = new baseDate.BaseDateExtractor(new dateConfiguration$2.SpanishDateExtractorConfiguration()); + this.integerExtractor = new recognizersTextNumber.SpanishIntegerExtractor(); + this.numberParser = new recognizersTextNumber.BaseNumberParser(new recognizersTextNumber.SpanishNumberParserConfiguration()); + this.durationExtractor = new baseDuration.BaseDurationExtractor(new durationConfiguration$2.SpanishDurationExtractorConfiguration()); + } + getFromTokenIndex(source) { + return recognizersText.RegExpUtility.getFirstMatchIndex(this.fromRegex, source); + } + getBetweenTokenIndex(source) { + return recognizersText.RegExpUtility.getFirstMatchIndex(this.betweenRegex, source); + } + hasConnectorToken(source) { + return recognizersText.RegExpUtility.getFirstMatchIndex(this.connectorAndRegex, source).matched; + } +} +exports.SpanishDatePeriodExtractorConfiguration = SpanishDatePeriodExtractorConfiguration; +class SpanishDatePeriodParserConfiguration { + constructor(config) { + this.tokenBeforeDate = spanishDateTime.SpanishDateTime.TokenBeforeDate; + this.cardinalExtractor = config.cardinalExtractor; + this.numberParser = config.numberParser; + this.durationExtractor = config.durationExtractor; + this.dateExtractor = config.dateExtractor; + this.durationParser = config.durationParser; + this.dateParser = config.dateParser; + this.monthFrontBetweenRegex = recognizersText.RegExpUtility.getSafeRegExp(spanishDateTime.SpanishDateTime.MonthFrontBetweenRegex); + this.betweenRegex = recognizersText.RegExpUtility.getSafeRegExp(spanishDateTime.SpanishDateTime.DayBetweenRegex); + this.monthFrontSimpleCasesRegex = recognizersText.RegExpUtility.getSafeRegExp(spanishDateTime.SpanishDateTime.MonthFrontSimpleCasesRegex); + this.simpleCasesRegex = recognizersText.RegExpUtility.getSafeRegExp(spanishDateTime.SpanishDateTime.SimpleCasesRegex); + this.oneWordPeriodRegex = recognizersText.RegExpUtility.getSafeRegExp(spanishDateTime.SpanishDateTime.OneWordPeriodRegex); + this.monthWithYear = recognizersText.RegExpUtility.getSafeRegExp(spanishDateTime.SpanishDateTime.MonthWithYearRegex); + this.monthNumWithYear = recognizersText.RegExpUtility.getSafeRegExp(spanishDateTime.SpanishDateTime.MonthNumWithYearRegex); + this.yearRegex = recognizersText.RegExpUtility.getSafeRegExp(spanishDateTime.SpanishDateTime.YearRegex); + this.pastRegex = recognizersText.RegExpUtility.getSafeRegExp(spanishDateTime.SpanishDateTime.PastRegex); + this.futureRegex = recognizersText.RegExpUtility.getSafeRegExp(spanishDateTime.SpanishDateTime.FutureRegex); + this.numberCombinedWithUnit = recognizersText.RegExpUtility.getSafeRegExp(spanishDateTime.SpanishDateTime.DurationNumberCombinedWithUnit); + this.weekOfMonthRegex = recognizersText.RegExpUtility.getSafeRegExp(spanishDateTime.SpanishDateTime.WeekOfMonthRegex); + this.weekOfYearRegex = recognizersText.RegExpUtility.getSafeRegExp(spanishDateTime.SpanishDateTime.WeekOfYearRegex); + this.quarterRegex = recognizersText.RegExpUtility.getSafeRegExp(spanishDateTime.SpanishDateTime.QuarterRegex); + this.quarterRegexYearFront = recognizersText.RegExpUtility.getSafeRegExp(spanishDateTime.SpanishDateTime.QuarterRegexYearFront); + this.allHalfYearRegex = recognizersText.RegExpUtility.getSafeRegExp(spanishDateTime.SpanishDateTime.AllHalfYearRegex); + this.seasonRegex = recognizersText.RegExpUtility.getSafeRegExp(spanishDateTime.SpanishDateTime.SeasonRegex); + this.whichWeekRegex = recognizersText.RegExpUtility.getSafeRegExp(spanishDateTime.SpanishDateTime.WhichWeekRegex); + this.weekOfRegex = recognizersText.RegExpUtility.getSafeRegExp(spanishDateTime.SpanishDateTime.WeekOfRegex); + this.monthOfRegex = recognizersText.RegExpUtility.getSafeRegExp(spanishDateTime.SpanishDateTime.MonthOfRegex); + this.restOfDateRegex = recognizersText.RegExpUtility.getSafeRegExp(spanishDateTime.SpanishDateTime.RestOfDateRegex); + this.laterEarlyPeriodRegex = recognizersText.RegExpUtility.getSafeRegExp(spanishDateTime.SpanishDateTime.LaterEarlyPeriodRegex); + this.weekWithWeekDayRangeRegex = recognizersText.RegExpUtility.getSafeRegExp(spanishDateTime.SpanishDateTime.WeekWithWeekDayRangeRegex); + this.nextPrefixRegex = recognizersText.RegExpUtility.getSafeRegExp(spanishDateTime.SpanishDateTime.NextPrefixRegex); + this.pastPrefixRegex = recognizersText.RegExpUtility.getSafeRegExp(spanishDateTime.SpanishDateTime.PastPrefixRegex); + this.thisPrefixRegex = recognizersText.RegExpUtility.getSafeRegExp(spanishDateTime.SpanishDateTime.ThisPrefixRegex); + this.inConnectorRegex = config.utilityConfiguration.inConnectorRegex; + this.unitMap = config.unitMap; + this.cardinalMap = config.cardinalMap; + this.dayOfMonth = config.dayOfMonth; + this.monthOfYear = config.monthOfYear; + this.seasonMap = config.seasonMap; + } + getSwiftDayOrMonth(source) { + let trimedText = source.trim().toLowerCase(); + let swift = 0; + if (recognizersText.RegExpUtility.getFirstMatchIndex(this.nextPrefixRegex, trimedText).matched) { + swift = 1; + } + if (recognizersText.RegExpUtility.getFirstMatchIndex(this.pastPrefixRegex, trimedText).matched) { + swift = -1; + } + return swift; + } + getSwiftYear(source) { + let trimedText = source.trim().toLowerCase(); + let swift = -10; + if (recognizersText.RegExpUtility.getFirstMatchIndex(this.nextPrefixRegex, trimedText).matched) { + swift = 1; + } + if (recognizersText.RegExpUtility.getFirstMatchIndex(this.pastPrefixRegex, trimedText).matched) { + swift = -1; + } + else if (recognizersText.RegExpUtility.getFirstMatchIndex(this.thisPrefixRegex, trimedText).matched) { + swift = 0; + } + return swift; + } + isFuture(source) { + let trimedText = source.trim().toLowerCase(); + return recognizersText.RegExpUtility.getFirstMatchIndex(this.thisPrefixRegex, trimedText).matched + || recognizersText.RegExpUtility.getFirstMatchIndex(this.nextPrefixRegex, trimedText).matched; + } + isYearToDate(source) { + let trimedText = source.trim().toLowerCase(); + return trimedText === "año a la fecha" + || trimedText === "años a la fecha"; + } + isMonthToDate(source) { + let trimedText = source.trim().toLowerCase(); + return trimedText === "mes a la fecha" + || trimedText === "meses a la fecha"; + } + isWeekOnly(source) { + let trimedText = source.trim().toLowerCase(); + return trimedText.endsWith("semana") + && !trimedText.endsWith("fin de semana"); + } + isWeekend(source) { + let trimedText = source.trim().toLowerCase(); + return trimedText.endsWith("fin de semana"); + } + isMonthOnly(source) { + let trimedText = source.trim().toLowerCase(); + return trimedText.endsWith("mes") + || trimedText.endsWith("meses"); + } + isYearOnly(source) { + let trimedText = source.trim().toLowerCase(); + return trimedText.endsWith("año") + || trimedText.endsWith("años"); + } + isLastCardinal(source) { + let trimedText = source.trim().toLowerCase(); + return recognizersText.RegExpUtility.getFirstMatchIndex(this.pastPrefixRegex, trimedText).matched; + } +} +exports.SpanishDatePeriodParserConfiguration = SpanishDatePeriodParserConfiguration; + +}); + +unwrapExports(datePeriodConfiguration$2); + +var timePeriodConfiguration$2 = createCommonjsModule(function (module, exports) { +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); + + + + + + +class SpanishTimePeriodExtractorConfiguration { + constructor() { + this.singleTimeExtractor = new baseTime.BaseTimeExtractor(new timeConfiguration$2.SpanishTimeExtractorConfiguration()); + this.integerExtractor = new recognizersTextNumber.EnglishIntegerExtractor(); + this.utilityConfiguration = new baseConfiguration$2.SpanishDateTimeUtilityConfiguration(); + this.simpleCasesRegex = [ + recognizersText.RegExpUtility.getSafeRegExp(spanishDateTime.SpanishDateTime.PureNumFromTo, "gis"), + recognizersText.RegExpUtility.getSafeRegExp(spanishDateTime.SpanishDateTime.PureNumBetweenAnd, "gis") + ]; + this.tillRegex = recognizersText.RegExpUtility.getSafeRegExp(spanishDateTime.SpanishDateTime.TillRegex, "gis"); + this.timeOfDayRegex = recognizersText.RegExpUtility.getSafeRegExp(spanishDateTime.SpanishDateTime.TimeOfDayRegex, "gis"); + this.generalEndingRegex = recognizersText.RegExpUtility.getSafeRegExp(spanishDateTime.SpanishDateTime.GeneralEndingRegex, "gis"); + this.fromRegex = recognizersText.RegExpUtility.getSafeRegExp(spanishDateTime.SpanishDateTime.FromRegex, "gis"); + this.connectorAndRegex = recognizersText.RegExpUtility.getSafeRegExp(spanishDateTime.SpanishDateTime.ConnectorAndRegex, "gis"); + this.betweenRegex = recognizersText.RegExpUtility.getSafeRegExp(spanishDateTime.SpanishDateTime.BetweenRegex, "gis"); + } + getFromTokenIndex(text) { + return recognizersText.RegExpUtility.getFirstMatchIndex(this.fromRegex, text); + } + hasConnectorToken(text) { + return recognizersText.RegExpUtility.getFirstMatchIndex(this.connectorAndRegex, text).matched; + } + getBetweenTokenIndex(text) { + return recognizersText.RegExpUtility.getFirstMatchIndex(this.betweenRegex, text); + } +} +exports.SpanishTimePeriodExtractorConfiguration = SpanishTimePeriodExtractorConfiguration; +class SpanishTimePeriodParserConfiguration { + constructor(config) { + this.timeExtractor = config.timeExtractor; + this.timeParser = config.timeParser; + this.integerExtractor = config.integerExtractor; + this.numbers = config.numbers; + this.utilityConfiguration = config.utilityConfiguration; + this.pureNumberFromToRegex = recognizersText.RegExpUtility.getSafeRegExp(spanishDateTime.SpanishDateTime.PureNumFromTo, "gis"); + this.pureNumberBetweenAndRegex = recognizersText.RegExpUtility.getSafeRegExp(spanishDateTime.SpanishDateTime.PureNumBetweenAnd, "gis"); + this.timeOfDayRegex = recognizersText.RegExpUtility.getSafeRegExp(spanishDateTime.SpanishDateTime.TimeOfDayRegex, "gis"); + this.tillRegex = recognizersText.RegExpUtility.getSafeRegExp(spanishDateTime.SpanishDateTime.TillRegex, "gis"); + this.specificTimeFromToRegex = recognizersText.RegExpUtility.getSafeRegExp(spanishDateTime.SpanishDateTime.SpecificTimeFromTo); + this.specificTimeBetweenAndRegex = recognizersText.RegExpUtility.getSafeRegExp(spanishDateTime.SpanishDateTime.SpecificTimeBetweenAnd); + } + getMatchedTimexRange(text) { + let trimedText = text.trim().toLowerCase(); + let beginHour = 0; + let endHour = 0; + let endMin = 0; + let timex = ""; + if (trimedText.endsWith("madrugada")) { + timex = "TDA"; + beginHour = 4; + endHour = 8; + } + else if (trimedText.endsWith("mañana")) { + timex = "TMO"; + beginHour = 8; + endHour = 12; + } + else if (trimedText.includes("pasado mediodia") || trimedText.includes("pasado el mediodia")) { + timex = "TAF"; + beginHour = 12; + endHour = 16; + } + else if (trimedText.endsWith("tarde")) { + timex = "TEV"; + beginHour = 16; + endHour = 20; + } + else if (trimedText.endsWith("noche")) { + timex = "TNI"; + beginHour = 20; + endHour = 23; + endMin = 59; + } + else { + timex = null; + return { + matched: false, + timex, + beginHour, + endHour, + endMin + }; + } + return { + matched: true, + timex, + beginHour, + endHour, + endMin + }; + } +} +exports.SpanishTimePeriodParserConfiguration = SpanishTimePeriodParserConfiguration; + +}); + +unwrapExports(timePeriodConfiguration$2); + +var dateTimePeriodConfiguration$2 = createCommonjsModule(function (module, exports) { +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); + + + + + + + + + + + + + +class SpanishDateTimePeriodExtractorConfiguration { + constructor() { + this.simpleCasesRegexes = [ + recognizersText.RegExpUtility.getSafeRegExp(spanishDateTime.SpanishDateTime.PureNumFromTo), + recognizersText.RegExpUtility.getSafeRegExp(spanishDateTime.SpanishDateTime.PureNumBetweenAnd) + ]; + this.prepositionRegex = recognizersText.RegExpUtility.getSafeRegExp(spanishDateTime.SpanishDateTime.PrepositionRegex); + this.tillRegex = recognizersText.RegExpUtility.getSafeRegExp(spanishDateTime.SpanishDateTime.TillRegex); + this.specificTimeOfDayRegex = recognizersText.RegExpUtility.getSafeRegExp(spanishDateTime.SpanishDateTime.SpecificTimeOfDayRegex); + this.timeOfDayRegex = recognizersText.RegExpUtility.getSafeRegExp(spanishDateTime.SpanishDateTime.TimeOfDayRegex); + this.followedUnit = recognizersText.RegExpUtility.getSafeRegExp(spanishDateTime.SpanishDateTime.FollowedUnit); + this.timeUnitRegex = recognizersText.RegExpUtility.getSafeRegExp(spanishDateTime.SpanishDateTime.UnitRegex); + this.pastPrefixRegex = recognizersText.RegExpUtility.getSafeRegExp(spanishDateTime.SpanishDateTime.PastRegex); + this.nextPrefixRegex = recognizersText.RegExpUtility.getSafeRegExp(spanishDateTime.SpanishDateTime.FutureRegex); + this.numberCombinedWithUnit = recognizersText.RegExpUtility.getSafeRegExp(spanishDateTime.SpanishDateTime.DateTimePeriodNumberCombinedWithUnit); + this.weekDayRegex = recognizersText.RegExpUtility.getSafeRegExp(spanishDateTime.SpanishDateTime.WeekDayRegex); + this.periodTimeOfDayWithDateRegex = recognizersText.RegExpUtility.getSafeRegExp(spanishDateTime.SpanishDateTime.PeriodTimeOfDayWithDateRegex); + this.relativeTimeUnitRegex = recognizersText.RegExpUtility.getSafeRegExp(spanishDateTime.SpanishDateTime.RelativeTimeUnitRegex); + this.restOfDateTimeRegex = recognizersText.RegExpUtility.getSafeRegExp(spanishDateTime.SpanishDateTime.RestOfDateTimeRegex); + this.generalEndingRegex = recognizersText.RegExpUtility.getSafeRegExp(spanishDateTime.SpanishDateTime.GeneralEndingRegex); + this.middlePauseRegex = recognizersText.RegExpUtility.getSafeRegExp(spanishDateTime.SpanishDateTime.MiddlePauseRegex); + this.fromRegex = recognizersText.RegExpUtility.getSafeRegExp(spanishDateTime.SpanishDateTime.FromRegex); + this.connectorAndRegex = recognizersText.RegExpUtility.getSafeRegExp(spanishDateTime.SpanishDateTime.ConnectorAndRegex); + this.betweenRegex = recognizersText.RegExpUtility.getSafeRegExp(spanishDateTime.SpanishDateTime.BetweenRegex); + this.cardinalExtractor = new recognizersTextNumber.SpanishCardinalExtractor(); + this.singleDateExtractor = new baseDate.BaseDateExtractor(new dateConfiguration$2.SpanishDateExtractorConfiguration()); + this.singleTimeExtractor = new baseTime.BaseTimeExtractor(new timeConfiguration$2.SpanishTimeExtractorConfiguration()); + this.singleDateTimeExtractor = new baseDateTime$2.BaseDateTimeExtractor(new dateTimeConfiguration$2.SpanishDateTimeExtractorConfiguration()); + this.durationExtractor = new baseDuration.BaseDurationExtractor(new durationConfiguration$2.SpanishDurationExtractorConfiguration()); + this.timePeriodExtractor = new baseTimePeriod.BaseTimePeriodExtractor(new timePeriodConfiguration$2.SpanishTimePeriodExtractorConfiguration()); + } + getFromTokenIndex(source) { + return recognizersText.RegExpUtility.getFirstMatchIndex(this.fromRegex, source); + } + getBetweenTokenIndex(source) { + return recognizersText.RegExpUtility.getFirstMatchIndex(this.betweenRegex, source); + } + hasConnectorToken(source) { + return recognizersText.RegExpUtility.getFirstMatchIndex(this.connectorAndRegex, source).matched; + } +} +exports.SpanishDateTimePeriodExtractorConfiguration = SpanishDateTimePeriodExtractorConfiguration; +class SpanishDateTimePeriodParserConfiguration { + constructor(config) { + this.dateExtractor = config.dateExtractor; + this.timeExtractor = config.timeExtractor; + this.dateTimeExtractor = config.dateTimeExtractor; + this.timePeriodExtractor = config.timePeriodExtractor; + this.cardinalExtractor = config.cardinalExtractor; + this.durationExtractor = config.durationExtractor; + this.numberParser = config.numberParser; + this.dateParser = config.dateParser; + this.timeParser = config.timeParser; + this.dateTimeParser = config.dateTimeParser; + this.timePeriodParser = config.timePeriodParser; + this.durationParser = config.durationParser; + this.unitMap = config.unitMap; + this.numbers = config.numbers; + this.nextPrefixRegex = recognizersText.RegExpUtility.getSafeRegExp(spanishDateTime.SpanishDateTime.NextPrefixRegex); + this.pastPrefixRegex = recognizersText.RegExpUtility.getSafeRegExp(spanishDateTime.SpanishDateTime.PastPrefixRegex); + this.thisPrefixRegex = recognizersText.RegExpUtility.getSafeRegExp(spanishDateTime.SpanishDateTime.ThisPrefixRegex); + this.pureNumberFromToRegex = recognizersText.RegExpUtility.getSafeRegExp(spanishDateTime.SpanishDateTime.PureNumFromTo); + this.pureNumberBetweenAndRegex = recognizersText.RegExpUtility.getSafeRegExp(spanishDateTime.SpanishDateTime.PureNumBetweenAnd); + this.specificTimeOfDayRegex = recognizersText.RegExpUtility.getSafeRegExp(spanishDateTime.SpanishDateTime.SpecificTimeOfDayRegex); + this.timeOfDayRegex = recognizersText.RegExpUtility.getSafeRegExp(spanishDateTime.SpanishDateTime.TimeOfDayRegex); + this.pastRegex = recognizersText.RegExpUtility.getSafeRegExp(spanishDateTime.SpanishDateTime.PastRegex); + this.futureRegex = recognizersText.RegExpUtility.getSafeRegExp(spanishDateTime.SpanishDateTime.FutureRegex); + this.numberCombinedWithUnitRegex = recognizersText.RegExpUtility.getSafeRegExp(spanishDateTime.SpanishDateTime.DateTimePeriodNumberCombinedWithUnit); + this.unitRegex = recognizersText.RegExpUtility.getSafeRegExp(spanishDateTime.SpanishDateTime.UnitRegex); + this.periodTimeOfDayWithDateRegex = recognizersText.RegExpUtility.getSafeRegExp(spanishDateTime.SpanishDateTime.PeriodTimeOfDayWithDateRegex); + this.relativeTimeUnitRegex = recognizersText.RegExpUtility.getSafeRegExp(spanishDateTime.SpanishDateTime.RelativeTimeUnitRegex); + this.restOfDateTimeRegex = recognizersText.RegExpUtility.getSafeRegExp(spanishDateTime.SpanishDateTime.RestOfDateTimeRegex); + } + getMatchedTimeRange(source) { + let trimedText = source.trim().toLowerCase(); + let timeStr = ""; + let beginHour = 0; + let endHour = 0; + let endMin = 0; + if (trimedText.endsWith("madrugada")) { + timeStr = "TDA"; + beginHour = 4; + endHour = 8; + } + else if (trimedText.endsWith("mañana")) { + timeStr = "TMO"; + beginHour = 8; + endHour = 12; + } + else if (trimedText.includes("pasado mediodia") || trimedText.includes("pasado el mediodia")) { + timeStr = "TAF"; + beginHour = 12; + endHour = 16; + } + else if (trimedText.endsWith("tarde")) { + timeStr = "TEV"; + beginHour = 16; + endHour = 20; + } + else if (trimedText.endsWith("noche")) { + timeStr = "TNI"; + beginHour = 20; + endHour = 23; + endMin = 59; + } + else { + timeStr = null; + return { + success: false, + timeStr, + beginHour, + endHour, + endMin + }; + } + return { + success: true, + timeStr, + beginHour, + endHour, + endMin + }; + } + getSwiftPrefix(source) { + let trimedText = source.trim().toLowerCase(); + let swift = 0; + // TODO: Replace with a regex + if (recognizersText.RegExpUtility.getFirstMatchIndex(this.pastPrefixRegex, trimedText).matched || + trimedText === "anoche") { + swift = -1; + } + else if (recognizersText.RegExpUtility.getFirstMatchIndex(this.nextPrefixRegex, trimedText).matched) { + swift = 1; + } + return swift; + } +} +exports.SpanishDateTimePeriodParserConfiguration = SpanishDateTimePeriodParserConfiguration; + +}); + +unwrapExports(dateTimePeriodConfiguration$2); + +var baseConfiguration$2 = createCommonjsModule(function (module, exports) { +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); + + + + + + + + + + + + + + + + + + +class SpanishDateTimeUtilityConfiguration { + constructor() { + this.laterRegex = recognizersText.RegExpUtility.getSafeRegExp(spanishDateTime.SpanishDateTime.LaterRegex); + this.agoRegex = recognizersText.RegExpUtility.getSafeRegExp(spanishDateTime.SpanishDateTime.AgoRegex); + this.inConnectorRegex = recognizersText.RegExpUtility.getSafeRegExp(spanishDateTime.SpanishDateTime.InConnectorRegex); + this.rangeUnitRegex = recognizersText.RegExpUtility.getSafeRegExp(spanishDateTime.SpanishDateTime.RangeUnitRegex); + this.amDescRegex = recognizersText.RegExpUtility.getSafeRegExp(spanishDateTime.SpanishDateTime.AmDescRegex); + this.pmDescRegex = recognizersText.RegExpUtility.getSafeRegExp(spanishDateTime.SpanishDateTime.PmDescRegex); + this.amPmDescRegex = recognizersText.RegExpUtility.getSafeRegExp(spanishDateTime.SpanishDateTime.AmPmDescRegex); + } +} +exports.SpanishDateTimeUtilityConfiguration = SpanishDateTimeUtilityConfiguration; +class SpanishCommonDateTimeParserConfiguration extends parsers$4.BaseDateParserConfiguration { + constructor() { + super(); + this.utilityConfiguration = new SpanishDateTimeUtilityConfiguration(); + this.unitMap = spanishDateTime.SpanishDateTime.UnitMap; + this.unitValueMap = spanishDateTime.SpanishDateTime.UnitValueMap; + this.seasonMap = spanishDateTime.SpanishDateTime.SeasonMap; + this.cardinalMap = spanishDateTime.SpanishDateTime.CardinalMap; + this.dayOfWeek = spanishDateTime.SpanishDateTime.DayOfWeek; + this.monthOfYear = spanishDateTime.SpanishDateTime.MonthOfYear; + this.numbers = spanishDateTime.SpanishDateTime.Numbers; + this.doubleNumbers = spanishDateTime.SpanishDateTime.DoubleNumbers; + this.cardinalExtractor = new recognizersTextNumber.SpanishCardinalExtractor(); + this.integerExtractor = new recognizersTextNumber.SpanishIntegerExtractor(); + this.ordinalExtractor = new recognizersTextNumber.SpanishOrdinalExtractor(); + this.numberParser = new recognizersTextNumber.BaseNumberParser(new recognizersTextNumber.SpanishNumberParserConfiguration()); + this.dateExtractor = new baseDate.BaseDateExtractor(new dateConfiguration$2.SpanishDateExtractorConfiguration()); + this.timeExtractor = new baseTime.BaseTimeExtractor(new timeConfiguration$2.SpanishTimeExtractorConfiguration()); + this.dateTimeExtractor = new baseDateTime$2.BaseDateTimeExtractor(new dateTimeConfiguration$2.SpanishDateTimeExtractorConfiguration()); + this.durationExtractor = new baseDuration.BaseDurationExtractor(new durationConfiguration$2.SpanishDurationExtractorConfiguration()); + this.datePeriodExtractor = new baseDatePeriod.BaseDatePeriodExtractor(new datePeriodConfiguration$2.SpanishDatePeriodExtractorConfiguration()); + this.timePeriodExtractor = new baseTimePeriod.BaseTimePeriodExtractor(new timePeriodConfiguration$2.SpanishTimePeriodExtractorConfiguration()); + this.dateTimePeriodExtractor = new baseDateTimePeriod.BaseDateTimePeriodExtractor(new dateTimePeriodConfiguration$2.SpanishDateTimePeriodExtractorConfiguration()); + this.durationParser = new baseDuration.BaseDurationParser(new durationConfiguration$2.SpanishDurationParserConfiguration(this)); + this.dateParser = new baseDate.BaseDateParser(new dateConfiguration$2.SpanishDateParserConfiguration(this)); + this.timeParser = new baseTime.BaseTimeParser(new timeConfiguration$2.SpanishTimeParserConfiguration(this)); + this.dateTimeParser = new baseDateTime$2.BaseDateTimeParser(new dateTimeConfiguration$2.SpanishDateTimeParserConfiguration(this)); + this.datePeriodParser = new baseDatePeriod.BaseDatePeriodParser(new datePeriodConfiguration$2.SpanishDatePeriodParserConfiguration(this)); + this.timePeriodParser = new baseTimePeriod.BaseTimePeriodParser(new timePeriodConfiguration$2.SpanishTimePeriodParserConfiguration(this)); + this.dateTimePeriodParser = new baseDateTimePeriod.BaseDateTimePeriodParser(new dateTimePeriodConfiguration$2.SpanishDateTimePeriodParserConfiguration(this)); + } +} +exports.SpanishCommonDateTimeParserConfiguration = SpanishCommonDateTimeParserConfiguration; + +}); + +unwrapExports(baseConfiguration$2); + +var dateConfiguration$2 = createCommonjsModule(function (module, exports) { +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); + + + + + + + +class SpanishDateExtractorConfiguration { + constructor() { + this.dateRegexList = [ + recognizersText.RegExpUtility.getSafeRegExp(spanishDateTime.SpanishDateTime.DateExtractor1, "gis"), + recognizersText.RegExpUtility.getSafeRegExp(spanishDateTime.SpanishDateTime.DateExtractor2, "gis"), + recognizersText.RegExpUtility.getSafeRegExp(spanishDateTime.SpanishDateTime.DateExtractor3, "gis"), + spanishDateTime.SpanishDateTime.DefaultLanguageFallback === constants$2.Constants.DefaultLanguageFallback_DMY ? + recognizersText.RegExpUtility.getSafeRegExp(spanishDateTime.SpanishDateTime.DateExtractor5, "gis") : + recognizersText.RegExpUtility.getSafeRegExp(spanishDateTime.SpanishDateTime.DateExtractor4, "gis"), + spanishDateTime.SpanishDateTime.DefaultLanguageFallback === constants$2.Constants.DefaultLanguageFallback_DMY ? + recognizersText.RegExpUtility.getSafeRegExp(spanishDateTime.SpanishDateTime.DateExtractor4, "gis") : + recognizersText.RegExpUtility.getSafeRegExp(spanishDateTime.SpanishDateTime.DateExtractor5, "gis"), + spanishDateTime.SpanishDateTime.DefaultLanguageFallback === constants$2.Constants.DefaultLanguageFallback_DMY ? + recognizersText.RegExpUtility.getSafeRegExp(spanishDateTime.SpanishDateTime.DateExtractor8, "gis") : + recognizersText.RegExpUtility.getSafeRegExp(spanishDateTime.SpanishDateTime.DateExtractor6, "gis"), + spanishDateTime.SpanishDateTime.DefaultLanguageFallback === constants$2.Constants.DefaultLanguageFallback_DMY ? + recognizersText.RegExpUtility.getSafeRegExp(spanishDateTime.SpanishDateTime.DateExtractor6, "gis") : + recognizersText.RegExpUtility.getSafeRegExp(spanishDateTime.SpanishDateTime.DateExtractor8, "gis"), + spanishDateTime.SpanishDateTime.DefaultLanguageFallback === constants$2.Constants.DefaultLanguageFallback_DMY ? + recognizersText.RegExpUtility.getSafeRegExp(spanishDateTime.SpanishDateTime.DateExtractor9, "gis") : + recognizersText.RegExpUtility.getSafeRegExp(spanishDateTime.SpanishDateTime.DateExtractor7, "gis"), + spanishDateTime.SpanishDateTime.DefaultLanguageFallback === constants$2.Constants.DefaultLanguageFallback_DMY ? + recognizersText.RegExpUtility.getSafeRegExp(spanishDateTime.SpanishDateTime.DateExtractor7, "gis") : + recognizersText.RegExpUtility.getSafeRegExp(spanishDateTime.SpanishDateTime.DateExtractor9, "gis"), + recognizersText.RegExpUtility.getSafeRegExp(spanishDateTime.SpanishDateTime.DateExtractor10, "gis"), + ]; + this.implicitDateList = [ + recognizersText.RegExpUtility.getSafeRegExp(spanishDateTime.SpanishDateTime.OnRegex, "gis"), + recognizersText.RegExpUtility.getSafeRegExp(spanishDateTime.SpanishDateTime.RelaxedOnRegex, "gis"), + recognizersText.RegExpUtility.getSafeRegExp(spanishDateTime.SpanishDateTime.SpecialDayRegex, "gis"), + recognizersText.RegExpUtility.getSafeRegExp(spanishDateTime.SpanishDateTime.ThisRegex, "gis"), + recognizersText.RegExpUtility.getSafeRegExp(spanishDateTime.SpanishDateTime.LastDateRegex, "gis"), + recognizersText.RegExpUtility.getSafeRegExp(spanishDateTime.SpanishDateTime.NextDateRegex, "gis"), + recognizersText.RegExpUtility.getSafeRegExp(spanishDateTime.SpanishDateTime.WeekDayRegex, "gis"), + recognizersText.RegExpUtility.getSafeRegExp(spanishDateTime.SpanishDateTime.WeekDayOfMonthRegex, "gis"), + recognizersText.RegExpUtility.getSafeRegExp(spanishDateTime.SpanishDateTime.SpecialDateRegex, "gis") + ]; + this.monthEnd = recognizersText.RegExpUtility.getSafeRegExp(spanishDateTime.SpanishDateTime.MonthEndRegex, "gis"); + this.ofMonth = recognizersText.RegExpUtility.getSafeRegExp(spanishDateTime.SpanishDateTime.OfMonthRegex, "gis"); + this.dateUnitRegex = recognizersText.RegExpUtility.getSafeRegExp(spanishDateTime.SpanishDateTime.DateUnitRegex, "gis"); + this.forTheRegex = recognizersText.RegExpUtility.getSafeRegExp(spanishDateTime.SpanishDateTime.ForTheRegex, "gis"); + this.weekDayAndDayOfMonthRegex = recognizersText.RegExpUtility.getSafeRegExp(spanishDateTime.SpanishDateTime.WeekDayAndDayOfMonthRegex, "gis"); + this.relativeMonthRegex = recognizersText.RegExpUtility.getSafeRegExp(spanishDateTime.SpanishDateTime.RelativeMonthRegex, "gis"); + this.weekDayRegex = recognizersText.RegExpUtility.getSafeRegExp(spanishDateTime.SpanishDateTime.WeekDayRegex, "gis"); + this.dayOfWeek = spanishDateTime.SpanishDateTime.DayOfWeek; + this.ordinalExtractor = new recognizersTextNumber.SpanishOrdinalExtractor(); + this.integerExtractor = new recognizersTextNumber.SpanishIntegerExtractor(); + this.numberParser = new recognizersTextNumber.BaseNumberParser(new recognizersTextNumber.SpanishNumberParserConfiguration()); + this.durationExtractor = new baseDuration.BaseDurationExtractor(new durationConfiguration$2.SpanishDurationExtractorConfiguration()); + this.utilityConfiguration = new baseConfiguration$2.SpanishDateTimeUtilityConfiguration(); + } +} +exports.SpanishDateExtractorConfiguration = SpanishDateExtractorConfiguration; +class SpanishDateParserConfiguration { + constructor(config) { + this.ordinalExtractor = config.ordinalExtractor; + this.integerExtractor = config.integerExtractor; + this.cardinalExtractor = config.cardinalExtractor; + this.durationExtractor = config.durationExtractor; + this.numberParser = config.numberParser; + this.durationParser = config.durationParser; + this.monthOfYear = config.monthOfYear; + this.dayOfMonth = config.dayOfMonth; + this.dayOfWeek = config.dayOfWeek; + this.unitMap = config.unitMap; + this.cardinalMap = config.cardinalMap; + this.dateRegex = new SpanishDateExtractorConfiguration().dateRegexList; + this.onRegex = recognizersText.RegExpUtility.getSafeRegExp(spanishDateTime.SpanishDateTime.OnRegex, "gis"); + this.specialDayRegex = recognizersText.RegExpUtility.getSafeRegExp(spanishDateTime.SpanishDateTime.SpecialDayRegex, "gis"); + this.specialDayWithNumRegex = recognizersText.RegExpUtility.getSafeRegExp(spanishDateTime.SpanishDateTime.SpecialDayWithNumRegex, "gis"); + this.nextRegex = recognizersText.RegExpUtility.getSafeRegExp(spanishDateTime.SpanishDateTime.NextDateRegex, "gis"); + this.unitRegex = recognizersText.RegExpUtility.getSafeRegExp(spanishDateTime.SpanishDateTime.DateUnitRegex, "gis"); + this.monthRegex = recognizersText.RegExpUtility.getSafeRegExp(spanishDateTime.SpanishDateTime.MonthRegex, "gis"); + this.weekDayRegex = recognizersText.RegExpUtility.getSafeRegExp(spanishDateTime.SpanishDateTime.WeekDayRegex, "gis"); + this.lastRegex = recognizersText.RegExpUtility.getSafeRegExp(spanishDateTime.SpanishDateTime.LastDateRegex, "gis"); + this.thisRegex = recognizersText.RegExpUtility.getSafeRegExp(spanishDateTime.SpanishDateTime.ThisRegex, "gis"); + this.weekDayOfMonthRegex = recognizersText.RegExpUtility.getSafeRegExp(spanishDateTime.SpanishDateTime.WeekDayOfMonthRegex, "gis"); + this.forTheRegex = recognizersText.RegExpUtility.getSafeRegExp(spanishDateTime.SpanishDateTime.ForTheRegex, "gis"); + this.weekDayAndDayOfMonthRegex = recognizersText.RegExpUtility.getSafeRegExp(spanishDateTime.SpanishDateTime.WeekDayAndDayOfMonthRegex, "gis"); + this.relativeMonthRegex = recognizersText.RegExpUtility.getSafeRegExp(spanishDateTime.SpanishDateTime.RelativeMonthRegex, "gis"); + this.relativeWeekDayRegex = recognizersText.RegExpUtility.getSafeRegExp(spanishDateTime.SpanishDateTime.RelativeWeekDayRegex, "gis"); + this.utilityConfiguration = config.utilityConfiguration; + this.dateTokenPrefix = spanishDateTime.SpanishDateTime.DateTokenPrefix; + } + getSwiftDay(source) { + let trimedText = SpanishDateParserConfiguration.normalize(source.trim().toLowerCase()); + let swift = 0; + // TODO: add the relative day logic if needed. If yes, the whole method should be abstracted. + if (trimedText === "hoy" || trimedText === "el dia") { + swift = 0; + } + else if (trimedText === "mañana" || + trimedText.endsWith("dia siguiente") || + trimedText.endsWith("el dia de mañana") || + trimedText.endsWith("proximo dia")) { + swift = 1; + } + else if (trimedText === "ayer") { + swift = -1; + } + else if (trimedText.endsWith("pasado mañana") || + trimedText.endsWith("dia despues de mañana")) { + swift = 2; + } + else if (trimedText.endsWith("anteayer") || + trimedText.endsWith("dia antes de ayer")) { + swift = -2; + } + else if (trimedText.endsWith("ultimo dia")) { + swift = -1; + } + return swift; + } + getSwiftMonth(source) { + let trimedText = source.trim().toLowerCase(); + let swift = 0; + if (recognizersText.RegExpUtility.getMatches(SpanishDateParserConfiguration.nextPrefixRegex, trimedText).length) { + swift = 1; + } + if (recognizersText.RegExpUtility.getMatches(SpanishDateParserConfiguration.pastPrefixRegex, trimedText).length) { + swift = -1; + } + return swift; + } + isCardinalLast(source) { + let trimedText = source.trim().toLowerCase(); + return recognizersText.RegExpUtility.getMatches(SpanishDateParserConfiguration.pastPrefixRegex, trimedText).length > 0; + } + static normalize(source) { + return source + .replace(/á/g, "a") + .replace(/é/g, "e") + .replace(/í/g, "i") + .replace(/ó/g, "o") + .replace(/ú/g, "u"); + } +} +// TODO: implement the relative day regex if needed. If yes, they should be abstracted +SpanishDateParserConfiguration.relativeDayRegex = recognizersText.RegExpUtility.getSafeRegExp(spanishDateTime.SpanishDateTime.RelativeDayRegex); +SpanishDateParserConfiguration.nextPrefixRegex = recognizersText.RegExpUtility.getSafeRegExp(spanishDateTime.SpanishDateTime.NextPrefixRegex); +SpanishDateParserConfiguration.pastPrefixRegex = recognizersText.RegExpUtility.getSafeRegExp(spanishDateTime.SpanishDateTime.PastPrefixRegex); +exports.SpanishDateParserConfiguration = SpanishDateParserConfiguration; + +}); + +unwrapExports(dateConfiguration$2); + +var holidayConfiguration$2 = createCommonjsModule(function (module, exports) { +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); + + + + +class SpanishHolidayExtractorConfiguration { + constructor() { + this.holidayRegexes = [ + recognizersText.RegExpUtility.getSafeRegExp(spanishDateTime.SpanishDateTime.HolidayRegex1, "gis"), + recognizersText.RegExpUtility.getSafeRegExp(spanishDateTime.SpanishDateTime.HolidayRegex2, "gis"), + recognizersText.RegExpUtility.getSafeRegExp(spanishDateTime.SpanishDateTime.HolidayRegex3, "gis") + ]; + } +} +exports.SpanishHolidayExtractorConfiguration = SpanishHolidayExtractorConfiguration; +class SpanishHolidayParserConfiguration extends baseHoliday.BaseHolidayParserConfiguration { + constructor() { + super(); + this.holidayRegexList = [ + recognizersText.RegExpUtility.getSafeRegExp(spanishDateTime.SpanishDateTime.HolidayRegex1, "gis"), + recognizersText.RegExpUtility.getSafeRegExp(spanishDateTime.SpanishDateTime.HolidayRegex2, "gis"), + recognizersText.RegExpUtility.getSafeRegExp(spanishDateTime.SpanishDateTime.HolidayRegex3, "gis") + ]; + this.holidayNames = spanishDateTime.SpanishDateTime.HolidayNames; + this.holidayFuncDictionary = this.initHolidayFuncs(); + this.variableHolidaysTimexDictionary = spanishDateTime.SpanishDateTime.VariableHolidaysTimexDictionary; + this.nextPrefixRegex = recognizersText.RegExpUtility.getSafeRegExp(spanishDateTime.SpanishDateTime.NextPrefixRegex); + this.pastPrefixRegex = recognizersText.RegExpUtility.getSafeRegExp(spanishDateTime.SpanishDateTime.PastPrefixRegex); + this.thisPrefixRegex = recognizersText.RegExpUtility.getSafeRegExp(spanishDateTime.SpanishDateTime.ThisPrefixRegex); + } + initHolidayFuncs() { + return new Map([ + ...super.initHolidayFuncs(), + ["padres", SpanishHolidayParserConfiguration.FathersDay], + ["madres", SpanishHolidayParserConfiguration.MothersDay], + ["acciondegracias", SpanishHolidayParserConfiguration.ThanksgivingDay], + ["trabajador", SpanishHolidayParserConfiguration.LabourDay], + ["delaraza", SpanishHolidayParserConfiguration.ColumbusDay], + ["memoria", SpanishHolidayParserConfiguration.MemorialDay], + ["pascuas", SpanishHolidayParserConfiguration.EasterDay], + ["navidad", SpanishHolidayParserConfiguration.ChristmasDay], + ["nochebuena", SpanishHolidayParserConfiguration.ChristmasEve], + ["añonuevo", SpanishHolidayParserConfiguration.NewYear], + ["nochevieja", SpanishHolidayParserConfiguration.NewYearEve], + ["yuandan", SpanishHolidayParserConfiguration.NewYear], + ["maestro", SpanishHolidayParserConfiguration.TeacherDay], + ["todoslossantos", SpanishHolidayParserConfiguration.HalloweenDay], + ["niño", SpanishHolidayParserConfiguration.ChildrenDay], + ["mujer", SpanishHolidayParserConfiguration.FemaleDay] + ]); + } + // All JavaScript dates are zero-based (-1) + static NewYear(year) { return new Date(year, 1 - 1, 1); } + static NewYearEve(year) { return new Date(year, 12 - 1, 31); } + static ChristmasDay(year) { return new Date(year, 12 - 1, 25); } + static ChristmasEve(year) { return new Date(year, 12 - 1, 24); } + static FemaleDay(year) { return new Date(year, 3 - 1, 8); } + static ChildrenDay(year) { return new Date(year, 6 - 1, 1); } + static HalloweenDay(year) { return new Date(year, 10 - 1, 31); } + static TeacherDay(year) { return new Date(year, 9 - 1, 11); } + static EasterDay(year) { return utilities$2.DateUtils.minValue(); } + getSwiftYear(text) { + let trimedText = text.trim().toLowerCase(); + let swift = -10; + if (recognizersText.RegExpUtility.getFirstMatchIndex(this.nextPrefixRegex, trimedText).matched) { + swift = 1; + } + if (recognizersText.RegExpUtility.getFirstMatchIndex(this.pastPrefixRegex, trimedText).matched) { + swift = -1; + } + else if (recognizersText.RegExpUtility.getFirstMatchIndex(this.thisPrefixRegex, trimedText).matched) { + swift = 0; + } + return swift; + } + sanitizeHolidayToken(holiday) { + return holiday.replace(/ /g, "") + .replace(/á/g, "a") + .replace(/é/g, "e") + .replace(/í/g, "i") + .replace(/ó/g, "o") + .replace(/ú/g, "u"); + } +} +exports.SpanishHolidayParserConfiguration = SpanishHolidayParserConfiguration; + +}); + +unwrapExports(holidayConfiguration$2); + +var setConfiguration$2 = createCommonjsModule(function (module, exports) { +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); + + + + + + + + + + + + + + + + +class SpanishSetExtractorConfiguration { + constructor() { + this.lastRegex = recognizersText.RegExpUtility.getSafeRegExp(spanishDateTime.SpanishDateTime.LastDateRegex, "gis"); + this.periodicRegex = recognizersText.RegExpUtility.getSafeRegExp(spanishDateTime.SpanishDateTime.PeriodicRegex, "gis"); + this.eachUnitRegex = recognizersText.RegExpUtility.getSafeRegExp(spanishDateTime.SpanishDateTime.EachUnitRegex, "gis"); + this.eachPrefixRegex = recognizersText.RegExpUtility.getSafeRegExp(spanishDateTime.SpanishDateTime.EachPrefixRegex, "gis"); + this.eachDayRegex = recognizersText.RegExpUtility.getSafeRegExp(spanishDateTime.SpanishDateTime.EachDayRegex, "gis"); + this.beforeEachDayRegex = recognizersText.RegExpUtility.getSafeRegExp(spanishDateTime.SpanishDateTime.BeforeEachDayRegex, "gis"); + this.setEachRegex = recognizersText.RegExpUtility.getSafeRegExp(spanishDateTime.SpanishDateTime.SetEachRegex, "gis"); + this.setWeekDayRegex = recognizersText.RegExpUtility.getSafeRegExp(spanishDateTime.SpanishDateTime.SetWeekDayRegex, "gis"); + this.durationExtractor = new baseDuration.BaseDurationExtractor(new durationConfiguration$2.SpanishDurationExtractorConfiguration()); + this.timeExtractor = new baseTime.BaseTimeExtractor(new timeConfiguration$2.SpanishTimeExtractorConfiguration()); + this.dateExtractor = new baseDate.BaseDateExtractor(new dateConfiguration$2.SpanishDateExtractorConfiguration()); + this.dateTimeExtractor = new baseDateTime$2.BaseDateTimeExtractor(new dateTimeConfiguration$2.SpanishDateTimeExtractorConfiguration()); + this.datePeriodExtractor = new baseDatePeriod.BaseDatePeriodExtractor(new datePeriodConfiguration$2.SpanishDatePeriodExtractorConfiguration()); + this.timePeriodExtractor = new baseTimePeriod.BaseTimePeriodExtractor(new timePeriodConfiguration$2.SpanishTimePeriodExtractorConfiguration()); + this.dateTimePeriodExtractor = new baseDateTimePeriod.BaseDateTimePeriodExtractor(new dateTimePeriodConfiguration$2.SpanishDateTimePeriodExtractorConfiguration()); + } +} +exports.SpanishSetExtractorConfiguration = SpanishSetExtractorConfiguration; +class SpanishSetParserConfiguration { + constructor(config) { + this.durationExtractor = config.durationExtractor; + this.timeExtractor = config.timeExtractor; + this.dateExtractor = config.dateExtractor; + this.dateTimeExtractor = config.dateTimeExtractor; + this.datePeriodExtractor = config.datePeriodExtractor; + this.timePeriodExtractor = config.timePeriodExtractor; + this.dateTimePeriodExtractor = config.dateTimePeriodExtractor; + this.durationParser = config.durationParser; + this.timeParser = config.timeParser; + this.dateParser = config.dateParser; + this.dateTimeParser = config.dateTimeParser; + this.datePeriodParser = config.datePeriodParser; + this.timePeriodParser = config.timePeriodParser; + this.dateTimePeriodParser = config.dateTimePeriodParser; + this.unitMap = config.unitMap; + this.eachPrefixRegex = recognizersText.RegExpUtility.getSafeRegExp(spanishDateTime.SpanishDateTime.EachPrefixRegex, "gis"); + this.periodicRegex = recognizersText.RegExpUtility.getSafeRegExp(spanishDateTime.SpanishDateTime.PeriodicRegex, "gis"); + this.eachUnitRegex = recognizersText.RegExpUtility.getSafeRegExp(spanishDateTime.SpanishDateTime.EachUnitRegex, "gis"); + this.eachDayRegex = recognizersText.RegExpUtility.getSafeRegExp(spanishDateTime.SpanishDateTime.EachDayRegex, "gis"); + this.setWeekDayRegex = recognizersText.RegExpUtility.getSafeRegExp(spanishDateTime.SpanishDateTime.SetWeekDayRegex, "gis"); + this.setEachRegex = recognizersText.RegExpUtility.getSafeRegExp(spanishDateTime.SpanishDateTime.SetEachRegex, "gis"); + } + getMatchedDailyTimex(text) { + let trimedText = text.trim().toLowerCase(); + let timex = ""; + if (trimedText.endsWith("diario") || trimedText.endsWith("diariamente")) { + timex = "P1D"; + } + else if (trimedText === "semanalmente") { + timex = "P1W"; + } + else if (trimedText === "quincenalmente") { + timex = "P2W"; + } + else if (trimedText === "mensualmente") { + timex = "P1M"; + } + else if (trimedText === "anualmente") { + timex = "P1Y"; + } + else { + timex = null; + return { + timex, + matched: false + }; + } + return { + timex, + matched: true + }; + } + getMatchedUnitTimex(text) { + let trimedText = text.trim().toLowerCase(); + let timex = ""; + if (trimedText === "día" || trimedText === "dia" || + trimedText === "días" || trimedText === "dias") { + timex = "P1D"; + } + else if (trimedText === "semana" || trimedText === "semanas") { + timex = "P1W"; + } + else if (trimedText === "mes" || trimedText === "meses") { + timex = "P1M"; + } + else if (trimedText === "año" || trimedText === "años") { + timex = "P1Y"; + } + else { + timex = null; + return { + matched: false, + timex + }; + } + return { + matched: true, + timex + }; + } +} +exports.SpanishSetParserConfiguration = SpanishSetParserConfiguration; + +}); + +unwrapExports(setConfiguration$2); + +var dateTimePeriodParser = createCommonjsModule(function (module, exports) { +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); + + + + +class SpanishDateTimePeriodParser extends baseDateTimePeriod.BaseDateTimePeriodParser { + constructor(config) { + super(config); + } + parseSpecificTimeOfDay(source, referenceDate) { + let ret = new utilities$2.DateTimeResolutionResult(); + let trimedText = source.trim().toLowerCase(); + // handle morning, afternoon.. + let match = this.config.getMatchedTimeRange(trimedText); + let beginHour = match.beginHour; + let endHour = match.endHour; + let endMin = match.endMin; + let timeStr = match.timeStr; + if (!match.success) { + return ret; + } + let matches = recognizersText.RegExpUtility.getMatches(this.config.specificTimeOfDayRegex, trimedText); + if (matches.length && matches[0].index === 0 && matches[0].length === trimedText.length) { + let swift = this.config.getSwiftPrefix(trimedText); + let date = utilities$2.DateUtils.addDays(referenceDate, swift); + date.setHours(0, 0, 0, 0); + let day = date.getDate(); + let month = date.getMonth(); + let year = date.getFullYear(); + + ret.timex = utilities$2.FormatUtil.formatDate(date) + timeStr; + ret.pastValue = ret.futureValue = [ + utilities$2.DateUtils.safeCreateFromValue(utilities$2.DateUtils.minValue(), year, month, day, beginHour, 0, 0), + utilities$2.DateUtils.safeCreateFromValue(utilities$2.DateUtils.minValue(), year, month, day, endHour, endMin, endMin), + ]; + ret.success = true; + return ret; + } + let startIndex = trimedText.indexOf(spanishDateTime.SpanishDateTime.Tomorrow) === 0 ? spanishDateTime.SpanishDateTime.Tomorrow.length : 0; + // handle Date followed by morning, afternoon + // Add handling code to handle morning, afternoon followed by Date + // Add handling code to handle early/late morning, afternoon + // TODO: use regex from config: match = this.config.TimeOfDayRegex.Match(trimedText.Substring(startIndex)); + matches = recognizersText.RegExpUtility.getMatches(recognizersText.RegExpUtility.getSafeRegExp(spanishDateTime.SpanishDateTime.TimeOfDayRegex), trimedText.substring(startIndex)); + if (matches.length) { + let match = matches[0]; + let beforeStr = trimedText.substring(0, match.index + startIndex).trim(); + let ers = this.config.dateExtractor.extract(beforeStr, referenceDate); + if (ers.length === 0) { + return ret; + } + let pr = this.config.dateParser.parse(ers[0], referenceDate); + let futureDate = pr.value.futureValue; + let pastDate = pr.value.pastValue; + ret.timex = pr.timexStr + timeStr; + ret.futureValue = [ + utilities$2.DateUtils.safeCreateFromValue(utilities$2.DateUtils.minValue(), futureDate.getFullYear(), futureDate.getMonth(), futureDate.getDate(), beginHour, 0, 0), + utilities$2.DateUtils.safeCreateFromValue(utilities$2.DateUtils.minValue(), futureDate.getFullYear(), futureDate.getMonth(), futureDate.getDate(), endHour, endMin, endMin) + ]; + ret.pastValue = [ + utilities$2.DateUtils.safeCreateFromValue(utilities$2.DateUtils.minValue(), pastDate.getFullYear(), pastDate.getMonth(), pastDate.getDate(), beginHour, 0, 0), + utilities$2.DateUtils.safeCreateFromValue(utilities$2.DateUtils.minValue(), pastDate.getFullYear(), pastDate.getMonth(), pastDate.getDate(), endHour, endMin, endMin) + ]; + ret.success = true; + return ret; + } + return ret; + } +} +exports.SpanishDateTimePeriodParser = SpanishDateTimePeriodParser; + +}); + +unwrapExports(dateTimePeriodParser); + +var mergedConfiguration$2 = createCommonjsModule(function (module, exports) { +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); + + + + + + + + + + + + + + + + + + + + + + + +class SpanishMergedExtractorConfiguration { + constructor() { + this.beforeRegex = recognizersText.RegExpUtility.getSafeRegExp(spanishDateTime.SpanishDateTime.BeforeRegex); + this.afterRegex = recognizersText.RegExpUtility.getSafeRegExp(spanishDateTime.SpanishDateTime.AfterRegex); + this.sinceRegex = recognizersText.RegExpUtility.getSafeRegExp(spanishDateTime.SpanishDateTime.SinceRegex); + this.fromToRegex = recognizersText.RegExpUtility.getSafeRegExp(spanishDateTime.SpanishDateTime.FromToRegex); + this.singleAmbiguousMonthRegex = recognizersText.RegExpUtility.getSafeRegExp(spanishDateTime.SpanishDateTime.SingleAmbiguousMonthRegex); + this.prepositionSuffixRegex = recognizersText.RegExpUtility.getSafeRegExp(spanishDateTime.SpanishDateTime.PrepositionSuffixRegex); + this.numberEndingPattern = recognizersText.RegExpUtility.getSafeRegExp(spanishDateTime.SpanishDateTime.NumberEndingPattern); + this.dateExtractor = new baseDate.BaseDateExtractor(new dateConfiguration$2.SpanishDateExtractorConfiguration()); + this.timeExtractor = new baseTime.BaseTimeExtractor(new timeConfiguration$2.SpanishTimeExtractorConfiguration()); + this.dateTimeExtractor = new baseDateTime$2.BaseDateTimeExtractor(new dateTimeConfiguration$2.SpanishDateTimeExtractorConfiguration()); + this.datePeriodExtractor = new baseDatePeriod.BaseDatePeriodExtractor(new datePeriodConfiguration$2.SpanishDatePeriodExtractorConfiguration()); + this.timePeriodExtractor = new baseTimePeriod.BaseTimePeriodExtractor(new timePeriodConfiguration$2.SpanishTimePeriodExtractorConfiguration()); + this.dateTimePeriodExtractor = new baseDateTimePeriod.BaseDateTimePeriodExtractor(new dateTimePeriodConfiguration$2.SpanishDateTimePeriodExtractorConfiguration()); + this.durationExtractor = new baseDuration.BaseDurationExtractor(new durationConfiguration$2.SpanishDurationExtractorConfiguration()); + this.setExtractor = new baseSet.BaseSetExtractor(new setConfiguration$2.SpanishSetExtractorConfiguration()); + this.holidayExtractor = new baseHoliday.BaseHolidayExtractor(new holidayConfiguration$2.SpanishHolidayExtractorConfiguration()); + this.integerExtractor = new recognizersTextNumber.SpanishIntegerExtractor(); + this.filterWordRegexList = []; + } +} +exports.SpanishMergedExtractorConfiguration = SpanishMergedExtractorConfiguration; +class SpanishMergedParserConfiguration extends baseConfiguration$2.SpanishCommonDateTimeParserConfiguration { + constructor() { + super(); + this.beforeRegex = recognizersText.RegExpUtility.getSafeRegExp(spanishDateTime.SpanishDateTime.BeforeRegex); + this.afterRegex = recognizersText.RegExpUtility.getSafeRegExp(spanishDateTime.SpanishDateTime.AfterRegex); + this.sinceRegex = recognizersText.RegExpUtility.getSafeRegExp(spanishDateTime.SpanishDateTime.SinceRegex); + this.datePeriodParser = new baseDatePeriod.BaseDatePeriodParser(new datePeriodConfiguration$2.SpanishDatePeriodParserConfiguration(this)); + this.timePeriodParser = new baseTimePeriod.BaseTimePeriodParser(new timePeriodConfiguration$2.SpanishTimePeriodParserConfiguration(this)); + this.dateTimePeriodParser = new dateTimePeriodParser.SpanishDateTimePeriodParser(new dateTimePeriodConfiguration$2.SpanishDateTimePeriodParserConfiguration(this)); + this.setParser = new baseSet.BaseSetParser(new setConfiguration$2.SpanishSetParserConfiguration(this)); + this.holidayParser = new baseHoliday.BaseHolidayParser(new holidayConfiguration$2.SpanishHolidayParserConfiguration()); + } +} +exports.SpanishMergedParserConfiguration = SpanishMergedParserConfiguration; + +}); + +unwrapExports(mergedConfiguration$2); + +var frenchDateTime = createCommonjsModule(function (module, exports) { +"use strict"; +// ------------------------------------------------------------------------------ +// +// This code was generated by a tool. +// Changes to this file may cause incorrect behavior and will be lost if +// the code is regenerated. +// +// ------------------------------------------------------------------------------ +Object.defineProperty(exports, "__esModule", { value: true }); + +var FrenchDateTime; +(function (FrenchDateTime) { + FrenchDateTime.TillRegex = `(?au|[aà]|et|jusqu'[aà]|avant|--|-|—|——)`; + FrenchDateTime.RangeConnectorRegex = `(?et|de la|au|[aà]|et\\s*la|--|-|—|——)`; + FrenchDateTime.RelativeRegex = `(?prochain|prochaine|de|du|ce|cette|l[ae]|derni[eè]re|pr[eé]c[eé]dente|au\\s+cours+(de|du\\s*))`; + FrenchDateTime.NextSuffixRegex = `(?prochain|prochaine|prochaines|suivante)\\b`; + FrenchDateTime.PastSuffixRegex = `(?dernier|derni[eè]re|pr[eé]c[eé]dente)\\b`; + FrenchDateTime.ThisPrefixRegex = `(?ce|cette|au\\s+cours+(du|de))\\b`; + FrenchDateTime.DayRegex = `(?01|02|03|04|05|06|07|08|09|10|11|11e|12|12e|13|13e|14|14e|15|15e|16|16e|17|17e|18|18e|19|19e|1er|1|21|21e|20|20e|22|22e|23|23e|24|24e|25|25e|26|26e|27|27e|28|28e|29|29e|2|2e|30|30e|31|31e|3|3e|4|4e|5|5e|6|6e|7|7e|8|8e|9|9e)(?=\\b|t)`; + FrenchDateTime.MonthNumRegex = `(?01|02|03|04|05|06|07|08|09|10|11|12|1|2|3|4|5|6|7|8|9)\\b`; + FrenchDateTime.DescRegex = `(?h|ampm|am\\b|a\\.m\\.|a m\\b|a\\. m\\.|a\\.m\\b|a\\. m\\b|pm\\b|p\\.m\\.|p m\\b|p\\. m\\.|p\\.m\\b|p\\. m\\b|p\\b\\b)`; + FrenchDateTime.AmDescRegex = `(h|am\\b|a\\.m\\.|a m\\b|a\\. m\\.|a\\.m\\b|a\\. m\\b)`; + FrenchDateTime.PmDescRegex = `(h|pm\\b|p\\.m\\.|p\\b|p m\\b|p\\. m\\.|p\\.m\\b|p\\. m\\b)`; + FrenchDateTime.AmPmDescRegex = `(h|ampm)`; + FrenchDateTime.TwoDigitYearRegex = `\\b(?([0-27-9]\\d))(?!(\\s*((\\:)|${FrenchDateTime.AmDescRegex}|${FrenchDateTime.PmDescRegex}|\\.\\d)))\\b`; + FrenchDateTime.FullTextYearRegex = `^[\\*]`; + FrenchDateTime.YearRegex = `(${baseDateTime.BaseDateTime.FourDigitYearRegex}|${FrenchDateTime.FullTextYearRegex})`; + FrenchDateTime.WeekDayRegex = `(?Dimanche|Lundi|Mardi|Mercredi|Jeudi|Vendredi|Samedi|Lun|Mar|Mer|Jeu|Ven|Sam|Dim)\\b`; + FrenchDateTime.RelativeMonthRegex = `(?(${FrenchDateTime.ThisPrefixRegex}\\s+mois)|(mois\\s+${FrenchDateTime.PastSuffixRegex})|(mois\\s+${FrenchDateTime.NextSuffixRegex}))\\b`; + FrenchDateTime.WrittenMonthRegex = `(?Avril|Avr\\.|Avr|Août|D[eé]cembre|D[eé]c|D[eé]c\\.|F[eé]vrier|F[eé]v|F[eé]vr\\.|F[eé]vr|Javier|Jan|Janv\\.|Janv|Juillet|Jul|Juil|Juil\\.|Juin|Jun|Mars|Mar|Mai|Novembre|Nov|Nov\\.|Octobre|Oct|Oct\\.|Septembre|Sep|Sept|Sept\\.)`; + FrenchDateTime.MonthSuffixRegex = `(?(en\\s*|le\\s*|de\\s*|dans\\s*)?(${FrenchDateTime.RelativeMonthRegex}|${FrenchDateTime.WrittenMonthRegex}))`; + FrenchDateTime.DateUnitRegex = `(?l'ann[eé]e|ann[eé]es|an|mois|semaines|semaine|jours|jour|journ[eé]e|journ[eé]es)\\b`; + FrenchDateTime.SimpleCasesRegex = `\\b((d[ue])|entre\\s+)?(${FrenchDateTime.DayRegex})\\s*${FrenchDateTime.TillRegex}\\s*(${FrenchDateTime.DayRegex})\\s+${FrenchDateTime.MonthSuffixRegex}((\\s+|\\s*,\\s*)${FrenchDateTime.YearRegex})?\\b`; + FrenchDateTime.MonthFrontSimpleCasesRegex = `\\b((d[ue]|entre)\\s+)?${FrenchDateTime.MonthSuffixRegex}\\s+((d[ue]|entre)\\s+)?(${FrenchDateTime.DayRegex})\\s*${FrenchDateTime.TillRegex}\\s*(${FrenchDateTime.DayRegex})((\\s+|\\s*,\\s*)${FrenchDateTime.YearRegex})?\\b`; + FrenchDateTime.MonthFrontBetweenRegex = `\\b${FrenchDateTime.MonthSuffixRegex}\\s+(entre|d[ue]\\s+)(${FrenchDateTime.DayRegex})\\s*${FrenchDateTime.RangeConnectorRegex}\\s*(${FrenchDateTime.DayRegex})((\\s+|\\s*,\\s*)${FrenchDateTime.YearRegex})?\\b`; + FrenchDateTime.BetweenRegex = `\\b(entre\\s+)(${FrenchDateTime.DayRegex})\\s*${FrenchDateTime.RangeConnectorRegex}\\s*(${FrenchDateTime.DayRegex})\\s+${FrenchDateTime.MonthSuffixRegex}((\\s+|\\s*,\\s*)${FrenchDateTime.YearRegex})?\\b`; + FrenchDateTime.YearWordRegex = `\\b(?l'ann[ée]e)\\b`; + FrenchDateTime.MonthWithYear = `\\b((?Avril|Avr\\.|Avr|Août|Aout|D[ée]cembre|D[eé]c|Dec\\.|F[eé]v|F[eé]vr|Fev|F[eé]vrier|F[eé]v\\.|Janvier|Jan|Janv|Janv\\.|Jan\\.|Jul|Juillet|Juil\\.|Jun|Juin|Mar|Mars|Mai|Novembre|Nov|Nov\\.|Octobre|Oct|Oct\\.|Septembre|Sep|Sept|Sept\\.)(\\s*),?(\\s+de)?(\\s*)(${FrenchDateTime.YearRegex}|(?cette)\\s*${FrenchDateTime.YearWordRegex})|${FrenchDateTime.YearWordRegex}\\s*(${FrenchDateTime.PastSuffixRegex}|${FrenchDateTime.NextSuffixRegex}))`; + FrenchDateTime.OneWordPeriodRegex = `\\b((${FrenchDateTime.RelativeRegex}\\s+)?(?Avril|Avr\\.|Avr|Août|Aout|D[eé]cembre|D[ée]c|D[eé]c\\.|F[eé]vrier|Fev|F[eé]v\\.|F[eé]vr|Janvier|Janv\\.|Janv|Jan|Jan\\.|Jul|Juillet|Juil\\.|Jun|Juin|Mar|Mars|Mai|Nov|Novembre|Nov\\.|Oct|Octobre|Oct\\.|Sep|Septembre|Sept\\.)|${FrenchDateTime.RelativeRegex}\\s+(weekend|fin de semaine|week-end|semaine|mois|ans|l'année)|weekend|week-end|(mois|l'année))\\b`; + FrenchDateTime.MonthNumWithYear = `(${FrenchDateTime.YearRegex}(\\s*)[/\\-\\.](\\s*)${FrenchDateTime.MonthNumRegex})|(${FrenchDateTime.MonthNumRegex}(\\s*)[/\\-](\\s*)${FrenchDateTime.YearRegex})`; + FrenchDateTime.WeekOfMonthRegex = `(?(le\\s+)?(?premier|1er|duexi[èe]me|2|troisi[èe]me|3|quatri[èe]me|4|cinqi[èe]me|5)\\s+semaine\\s+${FrenchDateTime.MonthSuffixRegex})`; + FrenchDateTime.WeekOfYearRegex = `(?(le\\s+)?(?premier|1er|duexi[èe]me|2|troisi[èe]me|3|quatri[èe]me|4|cinqi[èe]me|5)\\s+semaine(\\s+de)?\\s+(${FrenchDateTime.YearRegex}|${FrenchDateTime.RelativeRegex}\\s+ann[ée]e))`; + FrenchDateTime.FollowedDateUnit = `^\\s*${FrenchDateTime.DateUnitRegex}`; + FrenchDateTime.NumberCombinedWithDateUnit = `\\b(?\\d+(\\.\\d*)?)${FrenchDateTime.DateUnitRegex}`; + FrenchDateTime.QuarterRegex = `(le\\s+)?(?premier|1er|duexi[èe]me|2|troisi[èe]me|3|quatri[èe]me|4)\\s+quart(\\s+de|\\s*,\\s*)?\\s+(${FrenchDateTime.YearRegex}|${FrenchDateTime.RelativeRegex}\\s+l'ann[eé]e)`; + FrenchDateTime.QuarterRegexYearFront = `(${FrenchDateTime.YearRegex}|l'année\\s+(${FrenchDateTime.PastSuffixRegex}|${FrenchDateTime.NextSuffixRegex})|${FrenchDateTime.RelativeRegex}\\s+ann[eé]e)\\s+(le\\s+)?(?premier|1er|duexi[èe]me|2|troisi[èe]me|3|quatri[èe]me|4)\\s+quarts`; + FrenchDateTime.AllHalfYearRegex = `^[.]`; + FrenchDateTime.PrefixDayRegex = `^[.]`; + FrenchDateTime.CenturySuffixRegex = `^[.]`; + FrenchDateTime.SeasonRegex = `\\b((printemps|été|automne|hiver)+\\s*(${FrenchDateTime.NextSuffixRegex}|${FrenchDateTime.PastSuffixRegex}))|(?(${FrenchDateTime.RelativeRegex}\\s+)?(?printemps|[ée]t[ée]|automne|hiver)((\\s+de|\\s*,\\s*)?\\s+(${FrenchDateTime.YearRegex}|${FrenchDateTime.RelativeRegex}\\s+l'ann[eé]e))?)\\b`; + FrenchDateTime.WhichWeekRegex = `(semaine)(\\s*)(?\\d\\d|\\d|0\\d)`; + FrenchDateTime.WeekOfRegex = `(semaine)(\\s*)(de)`; + FrenchDateTime.MonthOfRegex = `(mois)(\\s*)(de)`; + FrenchDateTime.MonthRegex = `(?Avril|Avr|Avr\\.|Août|Aout|D[ée]cembre|D[eé]c|Dec\\.|F[eé]vrier|F[eé]vr|Fev|F[eé]v|F[eé]v\\.|Janvier|Janv\\.|Janv|Jan|Jan\\.|Juillet|Juil|Juil\\.|Juin|Mars|Mai|Novembre|Nov|Nov\\.|Octobre|Oct|Oct\\.|Septembre|Sep|Sept|Sept\\.)`; + FrenchDateTime.OnRegex = `(?<=\\b(en|sur\\s*l[ea]|sur)\\s+)(${FrenchDateTime.DayRegex}s?)\\b`; + FrenchDateTime.RelaxedOnRegex = `(?<=\\b(en|le|dans|sur\\s*l[ea]|du|sur)\\s+)((?10e|11e|12e|13e|14e|15e|16e|17e|18e|19e|1er|20e|21e|22e|23e|24e|25e|26e|27e|28e|29e|2e|30e|31e|3e|4e|5e|6e|7e|8e|9e)s?)\\b`; + FrenchDateTime.ThisRegex = `\\b((cette(\\s*semaine)?\\s+)${FrenchDateTime.WeekDayRegex})|(${FrenchDateTime.WeekDayRegex}(\\s+cette\\s*semaine))\\b`; + FrenchDateTime.LastDateRegex = `\\b((${FrenchDateTime.WeekDayRegex}(\\s*(de)?\\s*la\\s*semaine\\s+${FrenchDateTime.PastSuffixRegex}))|(${FrenchDateTime.WeekDayRegex}(\\s+${FrenchDateTime.PastSuffixRegex})))\\b`; + FrenchDateTime.NextDateRegex = `\\b((${FrenchDateTime.WeekDayRegex}(\\s+${FrenchDateTime.NextSuffixRegex}))|(${FrenchDateTime.WeekDayRegex}(\\s*(de)?\\s*la\\s*semaine\\s+${FrenchDateTime.NextSuffixRegex})))\\b`; + FrenchDateTime.SpecialDayRegex = `\\b(avant[\\s|-]hier|apr[eè]s(-demain|\\s*demain)|(le\\s)?jour suivant|(le\\s+)?dernier jour|hier|lendemain|demain|de la journ[ée]e|aujourd'hui)\\b`; + FrenchDateTime.SpecialDayWithNumRegex = `^[.]`; + FrenchDateTime.StrictWeekDay = `\\b(?Dimanche|Lundi|Mardi|Mercredi|Jeudi|Vendredi|Samedi|Lun|Mar|Mer|Jeu|Ven|Sam|Dim)s?\\b`; + FrenchDateTime.SetWeekDayRegex = `\\b(?le\\s+)?(?matin|matin[ée]e|apres-midi|soir[ée]e|soir|Dimanche|Lundi|Mardi|Mercredi|Jeudi|Vendredi|Samedi)s\\b`; + FrenchDateTime.WeekDayOfMonthRegex = `(?(le\\s+)?(?premier|1er|duexi[èe]me|2|troisi[èe]me|3|quatri[èe]me|4|cinqi[èe]me|5)\\s+${FrenchDateTime.WeekDayRegex}\\s+${FrenchDateTime.MonthSuffixRegex})`; + FrenchDateTime.RelativeWeekDayRegex = `^[.]`; + FrenchDateTime.NumberEndingPattern = `^[.]`; + FrenchDateTime.SpecialDate = `(?<=\\b([àa]|au|le)\\s+)${FrenchDateTime.DayRegex}\\b`; + FrenchDateTime.DateYearRegex = `(?${FrenchDateTime.YearRegex}|${FrenchDateTime.TwoDigitYearRegex})`; + FrenchDateTime.DateExtractor1 = `\\b(${FrenchDateTime.WeekDayRegex}(\\s+|\\s*,\\s*))?${FrenchDateTime.MonthRegex}\\s*[/\\\\\\.\\-]?\\s*${FrenchDateTime.DayRegex}\\b`; + FrenchDateTime.DateExtractor2 = `\\b(${FrenchDateTime.WeekDayRegex}(\\s+|\\s*,\\s*))?${FrenchDateTime.DayRegex}(\\s+|\\s*,\\s*|\\s+)${FrenchDateTime.MonthRegex}\\s*[\\.\\-]?\\s*${FrenchDateTime.DateYearRegex}\\b`; + FrenchDateTime.DateExtractor3 = `\\b(${FrenchDateTime.WeekDayRegex}(\\s+|\\s*,\\s*))?${FrenchDateTime.DayRegex}(\\s+|\\s*,\\s*|\\s*-\\s*)${FrenchDateTime.MonthRegex}((\\s+|\\s*,\\s*)${FrenchDateTime.DateYearRegex})?\\b`; + FrenchDateTime.DateExtractor4 = `\\b${FrenchDateTime.MonthNumRegex}\\s*[/\\\\\\-]\\s*${FrenchDateTime.DayRegex}\\s*[/\\\\\\-]\\s*${FrenchDateTime.DateYearRegex}`; + FrenchDateTime.DateExtractor5 = `\\b${FrenchDateTime.DayRegex}\\s*[/\\\\\\-\\.]\\s*${FrenchDateTime.MonthNumRegex}\\s*[/\\\\\\-\\.]\\s*${FrenchDateTime.DateYearRegex}`; + FrenchDateTime.DateExtractor6 = `(?<=\\b(le|sur|sur l[ae])\\s+)${FrenchDateTime.MonthNumRegex}[\\-\\.\\/]${FrenchDateTime.DayRegex}\\b`; + FrenchDateTime.DateExtractor7 = `\\b${FrenchDateTime.DayRegex}\\s*/\\s*${FrenchDateTime.MonthNumRegex}((\\s+|\\s*,\\s*)${FrenchDateTime.DateYearRegex})?\\b`; + FrenchDateTime.DateExtractor8 = `(?<=\\b(le)\\s+)${FrenchDateTime.DayRegex}[\\\\\\-]${FrenchDateTime.MonthNumRegex}\\b`; + FrenchDateTime.DateExtractor9 = `\\b${FrenchDateTime.DayRegex}\\s*/\\s*${FrenchDateTime.MonthNumRegex}((\\s+|\\s*,\\s*)${FrenchDateTime.DateYearRegex})?\\b`; + FrenchDateTime.DateExtractorA = `\\b${FrenchDateTime.DateYearRegex}\\s*[/\\\\\\-\\.]\\s*${FrenchDateTime.MonthNumRegex}\\s*[/\\\\\\-\\.]\\s*${FrenchDateTime.DayRegex}`; + FrenchDateTime.OfMonth = `^\\s*de\\s*${FrenchDateTime.MonthRegex}`; + FrenchDateTime.MonthEnd = `${FrenchDateTime.MonthRegex}\\s*(le)?\\s*$`; + FrenchDateTime.WeekDayEnd = `${FrenchDateTime.WeekDayRegex}\\s*,?\\s*$`; + FrenchDateTime.RangeUnitRegex = `\\b(?l'année|ann[eé]e(s)?|mois|semaines|semaine)\\b`; + FrenchDateTime.HourNumRegex = `\\b(?zero|un|deux|trois|quatre|cinq|six|sept|huit|neuf|dix|onze|douze|treize|quatorze|quinze|dix-six|dix-sept|dix-huit|dix-neuf|vingt|vingt-et-un|vingt-deux|vingt-trois)\\b`; + FrenchDateTime.MinuteNumRegex = `(?un|deux|trois|quatre|cinq|six|sept|huit|neuf|dix|onze|douze|treize|quatorze|quinze|seize|dix-sept|dix-huit|dix-neuf|vingt|trente|quarante|cinquante)`; + FrenchDateTime.DeltaMinuteNumRegex = `(?un|deux|trois|quatre|cinq|six|sept|huit|neuf|dix|onze|douze|treize|quatorze|quinze|seize|dix-sept|dix-huit|dix-neuf|vingt|trente|quarante|cinquante)`; + FrenchDateTime.OclockRegex = `(?heure|heures|h)`; + FrenchDateTime.PmRegex = `(?(dans l'\\s*)?apr[eè]s(\\s*|-)midi|(du|ce|de|le)\\s*(soir[ée]e|soir)|(dans l[ea]\\s+)?(nuit|soir[eé]e))`; + FrenchDateTime.AmRegex = `(?(du|de|ce|(du|de|dans)\\s*l[ea]|le)?\\s*matin[ée]e|(du|de|ce|dans l[ea]|le)?\\s*matin)`; + FrenchDateTime.LessThanOneHour = `(?(une\\s+)?quart|trois quart(s)?|demie( heure)?|${baseDateTime.BaseDateTime.DeltaMinuteRegex}(\\s+(minute|minutes|min|mins))|${FrenchDateTime.DeltaMinuteNumRegex}(\\s+(minute|minutes|min|mins)))`; + FrenchDateTime.WrittenTimeRegex = `(?${FrenchDateTime.HourNumRegex}\\s+(${FrenchDateTime.MinuteNumRegex}|(?vingt|trente|quarante|cinquante)\\s+${FrenchDateTime.MinuteNumRegex}))`; + FrenchDateTime.TimePrefix = `(?(heures\\s*et\\s+${FrenchDateTime.LessThanOneHour}|et ${FrenchDateTime.LessThanOneHour}|${FrenchDateTime.LessThanOneHour} [àa]))`; + FrenchDateTime.TimeSuffix = `(?${FrenchDateTime.AmRegex}|${FrenchDateTime.PmRegex}|${FrenchDateTime.OclockRegex})`; + FrenchDateTime.BasicTime = `(?${FrenchDateTime.WrittenTimeRegex}|${FrenchDateTime.HourNumRegex}|${baseDateTime.BaseDateTime.HourRegex}:${baseDateTime.BaseDateTime.MinuteRegex}(:${baseDateTime.BaseDateTime.SecondRegex})?|${baseDateTime.BaseDateTime.HourRegex})`; + FrenchDateTime.MidnightRegex = `(?minuit)`; + FrenchDateTime.CommonDatePrefixRegex = `^[\\.]`; + FrenchDateTime.MorningRegex = `(?matin[ée]e|matin)`; + FrenchDateTime.AfternoonRegex = `(?(d'|l')?apr[eè]s(-|\\s*)midi)`; + FrenchDateTime.MidmorningRegex = `(?milieu\\s*d[ue]\\s*${FrenchDateTime.MorningRegex})`; + FrenchDateTime.MiddayRegex = `(?milieu(\\s*|-)d[eu]\\s*(jour|midi)|apr[eè]s(-|\\s*)midi)`; + FrenchDateTime.MidafternoonRegex = `(?milieu\\s*d'+${FrenchDateTime.AfternoonRegex})`; + FrenchDateTime.MidTimeRegex = `(?(${FrenchDateTime.MidnightRegex}|${FrenchDateTime.MidmorningRegex}|${FrenchDateTime.MidafternoonRegex}|${FrenchDateTime.MiddayRegex}))`; + FrenchDateTime.AtRegex = `\\b(((?<=\\b[àa]\\s+)(${FrenchDateTime.WrittenTimeRegex}|${FrenchDateTime.HourNumRegex}|${baseDateTime.BaseDateTime.HourRegex}|${FrenchDateTime.MidTimeRegex}))|${FrenchDateTime.MidTimeRegex})\\b`; + FrenchDateTime.IshRegex = `\\b(peu\\s*pr[èe]s\\s*${baseDateTime.BaseDateTime.HourRegex}|peu\\s*pr[èe]s\\s*${FrenchDateTime.WrittenTimeRegex}|peu\\s*pr[èe]s\\s*[àa]\\s*${baseDateTime.BaseDateTime.HourRegex}|peu pr[èe]s midi)\\b`; + FrenchDateTime.TimeUnitRegex = `(?heures|heure|hrs|hr|h|minutes|minute|mins|min|secondes|seconde|secs|sec)\\b`; + FrenchDateTime.RestrictedTimeUnitRegex = `(?huere|minute)\\b`; + FrenchDateTime.ConnectNumRegex = `${baseDateTime.BaseDateTime.HourRegex}(?00|01|02|03|04|05|06|07|08|09|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)\\s*${FrenchDateTime.DescRegex}`; + FrenchDateTime.FivesRegex = `(?(quinze|vingt(\\s*|-*(cinq))?|trente(\\s*|-*(cinq))?|quarante(\\s*|-*(cinq))??|cinquante(\\s*|-*(cinq))?|dix|cinq))\\b`; + FrenchDateTime.PeriodHourNumRegex = `(?vingt-et-un|vingt-deux|vingt-trois|vingt-quatre|zero|une|deux|trois|quatre|cinq|six|sept|huit|neuf|dix|onze|douze|treize|quatorze|quinze|seize|dix-sept|dix-huit|dix-neuf|vingt)`; + FrenchDateTime.TimeRegex1 = `\\b(${FrenchDateTime.WrittenTimeRegex}|${FrenchDateTime.HourNumRegex}|${baseDateTime.BaseDateTime.HourRegex})\\s*${FrenchDateTime.DescRegex}(\\s+${FrenchDateTime.TimePrefix})?`; + FrenchDateTime.TimeRegex2 = `(\\b${FrenchDateTime.TimePrefix}\\s+)?(T)?${baseDateTime.BaseDateTime.HourRegex}(\\s*)?:(\\s*)?${baseDateTime.BaseDateTime.MinuteRegex}((\\s*)?:(\\s*)?${baseDateTime.BaseDateTime.SecondRegex})?((\\s*${FrenchDateTime.DescRegex})|\\b)`; + FrenchDateTime.TimeRegex3 = `\\b${baseDateTime.BaseDateTime.HourRegex}\\.${baseDateTime.BaseDateTime.MinuteRegex}(\\s*${FrenchDateTime.DescRegex})(\\s+${FrenchDateTime.TimePrefix})?`; + FrenchDateTime.TimeRegex4 = `\\b${FrenchDateTime.BasicTime}(\\s*${FrenchDateTime.DescRegex})?(\\s+${FrenchDateTime.TimePrefix})?\\s+${FrenchDateTime.TimeSuffix}\\b`; + FrenchDateTime.TimeRegex5 = `\\b${FrenchDateTime.BasicTime}((\\s*${FrenchDateTime.DescRegex})|\\b)(\\s+${FrenchDateTime.TimePrefix})?`; + FrenchDateTime.TimeRegex6 = `${FrenchDateTime.BasicTime}(\\s*${FrenchDateTime.DescRegex})?\\s+${FrenchDateTime.TimeSuffix}\\b`; + FrenchDateTime.TimeRegex7 = `\\b${FrenchDateTime.TimeSuffix}\\s+[àa]\\s+${FrenchDateTime.BasicTime}((\\s*${FrenchDateTime.DescRegex})|\\b)`; + FrenchDateTime.TimeRegex8 = `\\b${FrenchDateTime.TimeSuffix}\\s+${FrenchDateTime.BasicTime}((\\s*${FrenchDateTime.DescRegex})|\\b)`; + FrenchDateTime.TimeRegex9 = `\\b${FrenchDateTime.PeriodHourNumRegex}\\s+${FrenchDateTime.FivesRegex}((\\s*${FrenchDateTime.DescRegex})|\\b)`; + FrenchDateTime.TimeRegex10 = `\\b${baseDateTime.BaseDateTime.HourRegex}(\\s*h\\s*)${baseDateTime.BaseDateTime.MinuteRegex}(\\s*${FrenchDateTime.DescRegex})?(\\s+${FrenchDateTime.TimePrefix})?`; + FrenchDateTime.HourRegex = `\\b${baseDateTime.BaseDateTime.HourRegex}`; + FrenchDateTime.PeriodDescRegex = `(?pm|am|p\\.m\\.|a\\.m\\.|p)`; + FrenchDateTime.PeriodPmRegex = `(?dans l'apr[eè]s-midi|ce soir|d[eu] soir|dans l[ea] soir[eé]e|dans la nuit|d[eu] soir[ée]e)s?`; + FrenchDateTime.PeriodAmRegex = `(?matin|d[eu] matin|matin[ée]e)s?`; + FrenchDateTime.PureNumFromTo = `((du|de|des|depuis)\\s+)?(${FrenchDateTime.HourRegex}|${FrenchDateTime.PeriodHourNumRegex})(\\s*(?${FrenchDateTime.PeriodDescRegex}))?\\s*${FrenchDateTime.TillRegex}\\s*(${FrenchDateTime.HourRegex}|${FrenchDateTime.PeriodHourNumRegex})\\s*(?${FrenchDateTime.PmRegex}|${FrenchDateTime.AmRegex}|${FrenchDateTime.PeriodDescRegex})?`; + FrenchDateTime.PureNumBetweenAnd = `(entre\\s+)(${FrenchDateTime.HourRegex}|${FrenchDateTime.PeriodHourNumRegex})(\\s*(?${FrenchDateTime.PeriodDescRegex}))?\\s*${FrenchDateTime.RangeConnectorRegex}\\s*(${FrenchDateTime.HourRegex}|${FrenchDateTime.PeriodHourNumRegex})\\s*(?${FrenchDateTime.PmRegex}|${FrenchDateTime.AmRegex}|${FrenchDateTime.PeriodDescRegex})?`; + FrenchDateTime.SpecificTimeFromTo = `^[.]`; + FrenchDateTime.SpecificTimeBetweenAnd = `^[.]`; + FrenchDateTime.PrepositionRegex = `(?^([aà] la|en|sur\\s*l[ea]|sur|de)$)`; + FrenchDateTime.TimeOfDayRegex = `\\b(?((((dans\\s+(l[ea])?\\s+)?((?d[eé]but(\\s+|-)|t[oô]t(\\s+|-)(l[ea]\\s*)?)|(?fin\\s*|fin de(\\s+(la)?)|tard\\s*))?(matin[ée]e|matin|((d|l)?'?)apr[eè]s[-|\\s*]midi|nuit|soir[eé]e|soir)))|(((\\s+(l[ea])?\\s+)?)(jour|journ[eé]e)))s?)\\b`; + FrenchDateTime.SpecificTimeOfDayRegex = `\\b((${FrenchDateTime.RelativeRegex}\\s+${FrenchDateTime.TimeOfDayRegex})|(${FrenchDateTime.TimeOfDayRegex}\\s*(${FrenchDateTime.NextSuffixRegex}))\\b|\\bsoir|\\bdu soir)s?\\b`; + FrenchDateTime.TimeFollowedUnit = `^\\s*${FrenchDateTime.TimeUnitRegex}`; + FrenchDateTime.TimeNumberCombinedWithUnit = `\\b(?\\d+(\\.\\d*)?)${FrenchDateTime.TimeUnitRegex}`; + FrenchDateTime.NowRegex = `\\b(?(ce\\s+)?moment|maintenant|d[eè]s que possible|dqp|r[eé]cemment|auparavant)\\b`; + FrenchDateTime.SuffixRegex = `^\\s*(dans\\s+l[ea]\\s+)|(en\\s+)|(du)?(matin|matin([eé]e)?|apr[eè]s-midi|soir[eé]e|nuit)\\b`; + FrenchDateTime.DateTimeTimeOfDayRegex = `\\b(?matin[ée]e|matin|apr[eè]s-midi|nuit|soir)\\b`; + FrenchDateTime.DateTimeSpecificTimeOfDayRegex = `\\b((${FrenchDateTime.RelativeRegex}\\s+${FrenchDateTime.DateTimeTimeOfDayRegex})\\b|\\b(ce|cette\\s+)(soir|nuit))\\b`; + FrenchDateTime.TimeOfTodayAfterRegex = `^\\s*(,\\s*)?(en|dans|du\\s+)?${FrenchDateTime.DateTimeSpecificTimeOfDayRegex}`; + FrenchDateTime.TimeOfTodayBeforeRegex = `${FrenchDateTime.DateTimeSpecificTimeOfDayRegex}(\\s*,)?(\\s+([àa]|pour))?\\s*$`; + FrenchDateTime.SimpleTimeOfTodayAfterRegex = `(${FrenchDateTime.HourNumRegex}|${baseDateTime.BaseDateTime.HourRegex})\\s*(,\\s*)?(en|[àa]\\s+)?${FrenchDateTime.DateTimeSpecificTimeOfDayRegex}`; + FrenchDateTime.SimpleTimeOfTodayBeforeRegex = `${FrenchDateTime.DateTimeSpecificTimeOfDayRegex}(\\s*,)?(\\s+([àa]|vers))?\\s*(${FrenchDateTime.HourNumRegex}|${baseDateTime.BaseDateTime.HourRegex})`; + FrenchDateTime.TheEndOfRegex = `(la\\s+)?fin(\\s+de\\s*|\\s*de*l[ea])?\\s*$`; + FrenchDateTime.PeriodTimeOfDayRegex = `\\b((dans\\s+(le)?\\s+)?((?d[eé]but(\\s+|-|d[ue]|de la)|t[oô]t)|(?tard\\s*|fin(\\s+|-|d[eu])?))?(?matin|((d|l)?'?)apr[eè]s-midi|nuit|soir[eé]e|soir))\\b`; + FrenchDateTime.PeriodSpecificTimeOfDayRegex = `\\b((${FrenchDateTime.RelativeRegex}\\s+${FrenchDateTime.PeriodTimeOfDayRegex})\\b|\\b(ce|cette\\s+)(soir|nuit))\\b`; + FrenchDateTime.PeriodTimeOfDayWithDateRegex = `\\b((${FrenchDateTime.TimeOfDayRegex}))\\b`; + FrenchDateTime.LessThanRegex = `^[.]`; + FrenchDateTime.MoreThanRegex = `^[.]`; + FrenchDateTime.DurationUnitRegex = `(?ans|ann[eé]e|mois|semaines|semaine|jour|jours|heures|heure|hrs|hr|h|minutes|minute|mins|min|secondes|seconde|secs|sec|ann[eé]es|journ[eé]e)\\b`; + FrenchDateTime.SuffixAndRegex = `(?\\s*(et)\\s+((un|une)\\s+)?(?demi|quart))`; + FrenchDateTime.PeriodicRegex = `\\b(?quotidienne|quotidien|journellement|mensuel|mensuelle|jour|jours|hebdomadaire|bihebdomadaire|annuellement|annuel)\\b`; + FrenchDateTime.EachUnitRegex = `(?(chaque|toutes les|tous les)(?\\s+autres)?\\s*${FrenchDateTime.DurationUnitRegex})`; + FrenchDateTime.EachPrefixRegex = `\\b(?(chaque|tous les|(toutes les))\\s*$)`; + FrenchDateTime.SetEachRegex = `\\b(?(chaque|tous les|(toutes les))\\s*)`; + FrenchDateTime.SetLastRegex = `(?prochain|dernier|derni[eè]re|pass[ée]s|pr[eé]c[eé]dent|courant|en\\s*cours)`; + FrenchDateTime.EachDayRegex = `^\\s*(chaque|tous les)\\s*(jour|jours)\\b`; + FrenchDateTime.DurationFollowedUnit = `^\\s*${FrenchDateTime.SuffixAndRegex}?(\\s+|-)?${FrenchDateTime.DurationUnitRegex}`; + FrenchDateTime.NumberCombinedWithDurationUnit = `\\b(?\\d+(\\.\\d*)?)(-)?${FrenchDateTime.DurationUnitRegex}`; + FrenchDateTime.AnUnitRegex = `\\b(((?demi\\s+)?(-)\\s+${FrenchDateTime.DurationUnitRegex}))`; + FrenchDateTime.DuringRegex = `^[.]`; + FrenchDateTime.AllRegex = `\\b(?toute\\s(l['ea])\\s?(?ann[eé]e|mois|semaine|semaines|jour|jours|journ[eé]e))\\b`; + FrenchDateTime.HalfRegex = `(((un|une)\\s*)|\\b)(?demi?(\\s*|-)+(?ann[eé]e|ans|mois|semaine|jour|heure))\\b`; + FrenchDateTime.ConjunctionRegex = `\\b((et(\\s+de|pour)?)|avec)\\b`; + FrenchDateTime.HolidayRegex1 = `\\b(?vendredi saint|mercredi des cendres|p[aâ]ques|l'action de gr[âa]ce|mardi gras|la saint-sylvestre|la saint sylvestre|la Saint-Valentin|la saint valentin|nouvel an chinois|nouvel an|r[eé]veillon de Nouvel an|jour de l'an|premier-mai|ler-mai|1-mai|poisson d'avril|r[eé]veillon de No[eë]l|veille de no[eë]l|noël|noel|thanksgiving|halloween|yuandan)(\\s+((d[ue]\\s+|d'))?(${FrenchDateTime.YearRegex}|(${FrenchDateTime.ThisPrefixRegex}\\s+)ann[eé]e|ann[eé]e\\s+(${FrenchDateTime.PastSuffixRegex}|${FrenchDateTime.NextSuffixRegex})))?\\b`; + FrenchDateTime.HolidayRegex2 = `\\b(?martin luther king|martin luther king jr|toussaint|st patrick|st george|cinco de mayo|l'ind[eé]pendance|guy fawkes)(\\s+(de\\s+)?(${FrenchDateTime.YearRegex}|${FrenchDateTime.ThisPrefixRegex}\\s+ann[eé]e|ann[eé]e\\s+(${FrenchDateTime.PastSuffixRegex}|${FrenchDateTime.NextSuffixRegex})))?\\b`; + FrenchDateTime.HolidayRegex3 = `(?(jour\\s*(d[eu]|des)\\s*(canberra|p[aâ]ques|colomb|bastille|la prise de la bastille|l'ind[eé]pendance|l'ind[eé]pendance am[eé]ricaine|thanks\\s*giving|bapt[êe]me|nationale|d'armistice|inaugueration|marmotte|assomption|femme|comm[ée]moratif)))(\\s+(de\\s+)?(${FrenchDateTime.YearRegex}|${FrenchDateTime.ThisPrefixRegex}\\s+ann[eé]e|ann[eé]e\\s+(${FrenchDateTime.PastSuffixRegex}|${FrenchDateTime.NextSuffixRegex})))?`; + FrenchDateTime.HolidayRegex4 = `(?(F[eê]te\\s*(d[eu]|des)\\s*)(travail|m[eè]re|m[eè]res|p[eè]re|p[eè]res))(\\s+(de\\s+)?(${FrenchDateTime.YearRegex}|${FrenchDateTime.ThisPrefixRegex}\\s+ann[eé]e|ann[eé]e\\s+(${FrenchDateTime.PastSuffixRegex}|${FrenchDateTime.NextSuffixRegex})))?\\b`; + FrenchDateTime.DateTokenPrefix = 'le '; + FrenchDateTime.TimeTokenPrefix = 'à '; + FrenchDateTime.TokenBeforeDate = 'le '; + FrenchDateTime.TokenBeforeTime = 'à '; + FrenchDateTime.AMTimeRegex = `(?matin[ée]e|matin)`; + FrenchDateTime.PMTimeRegex = `\\b(?(d'|l')?apr[eè]s-midi|soir|nuit|\\s*ce soir|du soir)\\b`; + FrenchDateTime.BeforeRegex = `\\b(avant)\\b`; + FrenchDateTime.BeforeRegex2 = `\\b(entre\\s*(le|la(s)?)?)\\b`; + FrenchDateTime.AfterRegex = `\\b(apres)\\b`; + FrenchDateTime.SinceRegex = `\\b(depuis)\\b`; + FrenchDateTime.AroundRegex = `^[.]`; + FrenchDateTime.AgoPrefixRegex = `\\b(y a)\\b`; + FrenchDateTime.LaterRegex = `\\b(plus tard)\\b`; + FrenchDateTime.AgoRegex = `^[.]`; + FrenchDateTime.InConnectorRegex = `\\b(dans|en|sur)\\b`; + FrenchDateTime.WithinNextPrefixRegex = `^[.]`; + FrenchDateTime.MorningStartEndRegex = `(^(matin))|((matin)$)`; + FrenchDateTime.AfternoonStartEndRegex = `(^((d'|l')?apr[eè]s-midi))|(((d'|l')?apr[eè]s-midi)$)`; + FrenchDateTime.EveningStartEndRegex = `(^(soir[ée]e|soir))|((soir[ée]e|soir)$)`; + FrenchDateTime.NightStartEndRegex = `(^(nuit))|((nuit)$)`; + FrenchDateTime.InexactNumberRegex = `\\b(quelque|quel qu[ée]s|quelqu[ée]s|plusieur|plusieurs|divers)\\b`; + FrenchDateTime.InexactNumberUnitRegex = `(${FrenchDateTime.InexactNumberRegex})\\s+(${FrenchDateTime.DurationUnitRegex})`; + FrenchDateTime.RelativeTimeUnitRegex = `((((${FrenchDateTime.ThisPrefixRegex})?)\\s+(${FrenchDateTime.TimeUnitRegex}(\\s*${FrenchDateTime.NextSuffixRegex}|${FrenchDateTime.PastSuffixRegex})?))|((le))\\s+(${FrenchDateTime.RestrictedTimeUnitRegex}))`; + FrenchDateTime.RelativeDurationUnitRegex = `(((?<=(${FrenchDateTime.ThisPrefixRegex})\\s+)?\\b(${FrenchDateTime.DurationUnitRegex})(\\s+${FrenchDateTime.NextSuffixRegex}|${FrenchDateTime.PastSuffixRegex})?)|((le|my))\\s+(${FrenchDateTime.RestrictedTimeUnitRegex}))`; + FrenchDateTime.ReferenceDatePeriodRegex = `^[.]`; + FrenchDateTime.ConnectorRegex = `^(,|pour|t|vers)$`; + FrenchDateTime.ConnectorAndRegex = `\\b(et\\s*(le|la(s)?)?)\\b.+`; + FrenchDateTime.FromRegex = `((de|du)?)$`; + FrenchDateTime.FromRegex2 = `((depuis|de)(\\s*la(s)?)?)$`; + FrenchDateTime.FromToRegex = `\\b(du|de|des|depuis).+(à|a|au)\\b.+`; + FrenchDateTime.SingleAmbiguousMonthRegex = `^(le\\s+)?(may|march)$`; + FrenchDateTime.UnspecificDatePeriodRegex = `^[.]`; + FrenchDateTime.PrepositionSuffixRegex = `\\b(du|de|[àa]|vers|dans)$`; + FrenchDateTime.FlexibleDayRegex = `(?([A-Za-z]+\\s)?[A-Za-z\\d]+)`; + FrenchDateTime.ForTheRegex = `\\b(((pour le ${FrenchDateTime.FlexibleDayRegex})|(dans (le\\s+)?${FrenchDateTime.FlexibleDayRegex}(?<=(st|nd|rd|th))))(?\\s*(,|\\.|!|\\?|$)))`; + FrenchDateTime.WeekDayAndDayOfMonthRegex = `\\b${FrenchDateTime.WeekDayRegex}\\s+(le\\s+${FrenchDateTime.FlexibleDayRegex})\\b`; + FrenchDateTime.RestOfDateRegex = `\\b(Reste|fin)\\s+(d[eu]\\s+)?((le|cette|ce)\\s+)?(?semaine|mois|l'ann[ée]e)\\b`; + FrenchDateTime.RestOfDateTimeRegex = `\\b(Reste|fin)\\s+(d[eu]\\s+)?((le|cette|ce)\\s+)?(?jour)\\b`; + FrenchDateTime.LaterEarlyPeriodRegex = `^[.]`; + FrenchDateTime.WeekWithWeekDayRangeRegex = `^[.]`; + FrenchDateTime.GeneralEndingRegex = `^[.]`; + FrenchDateTime.MiddlePauseRegex = `^[.]`; + FrenchDateTime.DurationConnectorRegex = `^[.]`; + FrenchDateTime.PrefixArticleRegex = `^[\\.]`; + FrenchDateTime.OrRegex = `^[.]`; + FrenchDateTime.YearPlusNumberRegex = `^[.]`; + FrenchDateTime.NumberAsTimeRegex = `^[.]`; + FrenchDateTime.TimeBeforeAfterRegex = `^[.]`; + FrenchDateTime.DateNumberConnectorRegex = `^[.]`; + FrenchDateTime.CenturyRegex = `^[.]`; + FrenchDateTime.DecadeRegex = `^[.]`; + FrenchDateTime.DecadeWithCenturyRegex = `^[.]`; + FrenchDateTime.RelativeDecadeRegex = `^[.]`; + FrenchDateTime.YearSuffix = `(,?\\s*(${FrenchDateTime.DateYearRegex}|${FrenchDateTime.FullTextYearRegex}))`; + FrenchDateTime.YearAfterRegex = `^[.]`; + FrenchDateTime.YearPeriodRegex = `^[.]`; + FrenchDateTime.FutureSuffixRegex = `^[.]`; + FrenchDateTime.ComplexDatePeriodRegex = `^[.]`; + FrenchDateTime.UnitMap = new Map([["annees", "Y"], ["annee", "Y"], ["ans", "Y"], ["mois", "MON"], ["semaines", "W"], ["semaine", "W"], ["journees", "D"], ["journee", "D"], ["jour", "D"], ["jours", "D"], ["heures", "H"], ["heure", "H"], ["hrs", "H"], ["hr", "H"], ["h", "H"], ["minutes", "M"], ["minute", "M"], ["mins", "M"], ["min", "M"], ["secondes", "S"], ["seconde", "S"], ["secs", "S"], ["sec", "S"]]); + FrenchDateTime.UnitValueMap = new Map([["annees", 31536000], ["annee", 31536000], ["l'annees", 31536000], ["l'annee", 31536000], ["ans", 31536000], ["mois", 2592000], ["semaines", 604800], ["semaine", 604800], ["journees", 86400], ["journee", 86400], ["jour", 86400], ["jours", 86400], ["heures", 3600], ["heure", 3600], ["hrs", 3600], ["hr", 3600], ["h", 3600], ["minutes", 60], ["minute", 60], ["mins", 60], ["min", 60], ["secondes", 1], ["seconde", 1], ["secs", 1], ["sec", 1]]); + FrenchDateTime.SeasonMap = new Map([["printemps", "SP"], ["été", "SU"], ["automne", "FA"], ["hiver", "WI"]]); + FrenchDateTime.SeasonValueMap = new Map([["SP", 3], ["SU", 6], ["FA", 9], ["WI", 12]]); + FrenchDateTime.CardinalMap = new Map([["premier", 1], ["1er", 1], ["deuxième", 2], ["2e", 2], ["troisième", 3], ["troisieme", 3], ["3e", 3], ["quatrième", 4], ["4e", 4], ["cinqième", 5], ["5e", 5]]); + FrenchDateTime.DayOfWeek = new Map([["lundi", 1], ["mardi", 2], ["mercredi", 3], ["jeudi", 4], ["vendredi", 5], ["samedi", 6], ["dimanche", 0], ["lun", 1], ["mar", 2], ["mer", 3], ["jeu", 4], ["ven", 5], ["sam", 6], ["dim", 0]]); + FrenchDateTime.MonthOfYear = new Map([["1", 1], ["2", 2], ["3", 3], ["4", 4], ["5", 5], ["6", 6], ["7", 7], ["8", 8], ["9", 9], ["10", 10], ["11", 11], ["12", 12], ["janvier", 1], ["fevrier", 2], ["février", 2], ["mars", 3], ["mar", 3], ["avril", 4], ["avr", 4], ["mai", 5], ["juin", 6], ["jun", 6], ["juillet", 7], ["aout", 8], ["août", 8], ["septembre", 9], ["octobre", 10], ["novembre", 11], ["decembre", 12], ["décembre", 12], ["janv", 1], ["janv.", 1], ["jan", 1], ["fevr", 2], ["fevr.", 2], ["févr.", 2], ["févr", 2], ["fev", 2], ["juil", 7], ["jul", 7], ["sep", 9], ["sept.", 9], ["sept", 9], ["oct", 10], ["oct.", 10], ["nov", 11], ["nov.", 11], ["dec", 12], ["déc.", 12], ["déc", 12], ["01", 1], ["02", 2], ["03", 3], ["04", 4], ["05", 5], ["06", 6], ["07", 7], ["08", 8], ["09", 9]]); + FrenchDateTime.Numbers = new Map([["zero", 0], ["un", 1], ["une", 1], ["a", 1], ["deux", 2], ["trois", 3], ["quatre", 4], ["cinq", 5], ["six", 6], ["sept", 7], ["huit", 8], ["neuf", 9], ["dix", 10], ["onze", 11], ["douze", 12], ["treize", 13], ["quatorze", 14], ["quinze", 15], ["seize", 16], ["dix-sept", 17], ["dix-huit", 18], ["dix-neuf", 19], ["vingt-et-un", 21], ["vingt et un", 21], ["vingt", 20], ["vingt deux", 22], ["vingt-deux", 22], ["vingt trois", 23], ["vingt-trois", 23], ["vingt quatre", 24], ["vingt-quatre", 24], ["vingt cinq", 25], ["vingt-cinq", 25], ["vingt six", 26], ["vingt-six", 26], ["vingt sept", 27], ["vingt-sept", 27], ["vingt huit", 28], ["vingt-huit", 28], ["vingt neuf", 29], ["vingt-neuf", 29], ["trente", 30], ["trente et un", 31], ["trente-et-un", 31], ["trente deux", 32], ["trente-deux", 32], ["trente trois", 33], ["trente-trois", 33], ["trente quatre", 34], ["trente-quatre", 34], ["trente cinq", 35], ["trente-cinq", 35], ["trente six", 36], ["trente-six", 36], ["trente sept", 37], ["trente-sept", 37], ["trente huit", 38], ["trente-huit", 38], ["trente neuf", 39], ["trente-neuf", 39], ["quarante", 40], ["quarante et un", 41], ["quarante-et-un", 41], ["quarante deux", 42], ["quarante-duex", 42], ["quarante trois", 43], ["quarante-trois", 43], ["quarante quatre", 44], ["quarante-quatre", 44], ["quarante cinq", 45], ["quarante-cinq", 45], ["quarante six", 46], ["quarante-six", 46], ["quarante sept", 47], ["quarante-sept", 47], ["quarante huit", 48], ["quarante-huit", 48], ["quarante neuf", 49], ["quarante-neuf", 49], ["cinquante", 50], ["cinquante et un", 51], ["cinquante-et-un", 51], ["cinquante deux", 52], ["cinquante-deux", 52], ["cinquante trois", 53], ["cinquante-trois", 53], ["cinquante quatre", 54], ["cinquante-quatre", 54], ["cinquante cinq", 55], ["cinquante-cinq", 55], ["cinquante six", 56], ["cinquante-six", 56], ["cinquante sept", 57], ["cinquante-sept", 57], ["cinquante huit", 58], ["cinquante-huit", 58], ["cinquante neuf", 59], ["cinquante-neuf", 59], ["soixante", 60], ["soixante et un", 61], ["soixante-et-un", 61], ["soixante deux", 62], ["soixante-deux", 62], ["soixante trois", 63], ["soixante-trois", 63], ["soixante quatre", 64], ["soixante-quatre", 64], ["soixante cinq", 65], ["soixante-cinq", 65], ["soixante six", 66], ["soixante-six", 66], ["soixante sept", 67], ["soixante-sept", 67], ["soixante huit", 68], ["soixante-huit", 68], ["soixante neuf", 69], ["soixante-neuf", 69], ["soixante dix", 70], ["soixante-dix", 70], ["soixante et onze", 71], ["soixante-et-onze", 71], ["soixante douze", 72], ["soixante-douze", 72], ["soixante treize", 73], ["soixante-treize", 73], ["soixante quatorze", 74], ["soixante-quatorze", 74], ["soixante quinze", 75], ["soixante-quinze", 75], ["soixante seize", 76], ["soixante-seize", 76], ["soixante dix sept", 77], ["soixante-dix-sept", 77], ["soixante dix huit", 78], ["soixante-dix-huit", 78], ["soixante dix neuf", 79], ["soixante-dix-neuf", 79], ["quatre vingt", 80], ["quatre-vingt", 80], ["quatre vingt un", 81], ["quatre-vingt-un", 81], ["quatre vingt deux", 82], ["quatre-vingt-duex", 82], ["quatre vingt trois", 83], ["quatre-vingt-trois", 83], ["quatre vingt quatre", 84], ["quatre-vingt-quatre", 84], ["quatre vingt cinq", 85], ["quatre-vingt-cinq", 85], ["quatre vingt six", 86], ["quatre-vingt-six", 86], ["quatre vingt sept", 87], ["quatre-vingt-sept", 87], ["quatre vingt huit", 88], ["quatre-vingt-huit", 88], ["quatre vingt neuf", 89], ["quatre-vingt-neuf", 89], ["quatre vingt dix", 90], ["quatre-vingt-dix", 90], ["quatre vingt onze", 91], ["quatre-vingt-onze", 91], ["quatre vingt douze", 92], ["quatre-vingt-douze", 92], ["quatre vingt treize", 93], ["quatre-vingt-treize", 93], ["quatre vingt quatorze", 94], ["quatre-vingt-quatorze", 94], ["quatre vingt quinze", 95], ["quatre-vingt-quinze", 95], ["quatre vingt seize", 96], ["quatre-vingt-seize", 96], ["quatre vingt dix sept", 97], ["quatre-vingt-dix-sept", 97], ["quatre vingt dix huit", 98], ["quatre-vingt-dix-huit", 98], ["quatre vingt dix neuf", 99], ["quatre-vingt-dix-neuf", 99], ["cent", 100]]); + FrenchDateTime.DayOfMonth = new Map([["1er", 1], ["2e", 2], ["3e", 3], ["4e", 4], ["5e", 5], ["6e", 6], ["7e", 7], ["8e", 8], ["9e", 9], ["10e", 10], ["11e", 11], ["12e", 12], ["13e", 13], ["14e", 14], ["15e", 15], ["16e", 16], ["17e", 17], ["18e", 18], ["19e", 19], ["20e", 20], ["21e", 21], ["22e", 22], ["23e", 23], ["24e", 24], ["25e", 25], ["26e", 26], ["27e", 27], ["28e", 28], ["29e", 29], ["30e", 30], ["31e", 31]]); + FrenchDateTime.DoubleNumbers = new Map([["demi", 0.5], ["quart", 0.25]]); + FrenchDateTime.HolidayNames = new Map([["fathers", ["peres", "pères", "fêtedespères", "fetedesperes"]], ["mothers", ["fêtedesmères", "fetedesmeres"]], ["thanksgiving", ["lactiondegrace", "lactiondegrâce", "jourdethanksgiving", "thanksgiving"]], ["martinlutherking", ["journeemartinlutherking", "martinlutherkingjr"]], ["washingtonsbirthday", ["washingtonsbirthday", "washingtonbirthday"]], ["canberra", ["canberraday"]], ["labour", ["fetedetravail", "travail", "fetedutravail"]], ["columbus", ["columbusday"]], ["memorial", ["jourcommémoratif", "jourcommemoratif"]], ["yuandan", ["yuandan", "nouvelanchinois"]], ["maosbirthday", ["maosbirthday"]], ["teachersday", ["teachersday", "teacherday"]], ["singleday", ["singleday"]], ["allsaintsday", ["allsaintsday"]], ["youthday", ["youthday"]], ["childrenday", ["childrenday", "childday"]], ["femaleday", ["femaleday"]], ["treeplantingday", ["treeplantingday"]], ["arborday", ["arborday"]], ["girlsday", ["girlsday"]], ["whiteloverday", ["whiteloverday"]], ["loverday", ["loverday"]], ["christmas", ["noel", "noël"]], ["xmas", ["xmas"]], ["newyear", ["nouvellesannees", "nouvelan"]], ["newyearday", ["jourdunouvelan"]], ["newyearsday", ["jourdel'an", "jourpremierdelannee", "jourpremierdelannée"]], ["inaugurationday", ["jourd'inaugueration", "inaugueration"]], ["groundhougday", ["marmotte"]], ["valentinesday", ["lasaint-valentin", "lasaintvalentin"]], ["stpatrickday", ["stpatrickday"]], ["aprilfools", ["poissond'avril"]], ["stgeorgeday", ["stgeorgeday"]], ["mayday", ["premier-mai", "ler-mai", "1-mai"]], ["cincodemayoday", ["cincodemayo"]], ["baptisteday", ["bapteme", "baptême"]], ["usindependenceday", ["l'independanceamericaine", "lindépendanceaméricaine"]], ["independenceday", ["l'indépendance", "lindependance"]], ["bastilleday", ["laprisedelabastille", "bastille"]], ["halloweenday", ["halloween"]], ["allhallowday", ["allhallowday"]], ["allsoulsday", ["allsoulsday"]], ["guyfawkesday", ["guyfawkesday"]], ["veteransday", ["veteransday"]], ["christmaseve", ["reveillondenoel", "réveillondenoël", "veilledenoel", "veilledenoël"]], ["newyeareve", ["réveillondenouvelan", "reveillondenouvelan", "lasaint-sylvestre", "lasaintsylvestre"]]]); + FrenchDateTime.NightRegex = `\\b(minuit|nuit)\\b`; + FrenchDateTime.WrittenDecades = new Map([["", 0]]); + FrenchDateTime.SpecialDecadeCases = new Map([["", 0]]); + FrenchDateTime.DefaultLanguageFallback = 'DMY'; + FrenchDateTime.DurationDateRestrictions = []; +})(FrenchDateTime = exports.FrenchDateTime || (exports.FrenchDateTime = {})); + +}); + +unwrapExports(frenchDateTime); + +var durationConfiguration$4 = createCommonjsModule(function (module, exports) { +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); + + + +class FrenchDurationExtractorConfiguration { + constructor() { + this.allRegex = recognizersText.RegExpUtility.getSafeRegExp(frenchDateTime.FrenchDateTime.AllRegex, "gis"); + this.halfRegex = recognizersText.RegExpUtility.getSafeRegExp(frenchDateTime.FrenchDateTime.HalfRegex, "gis"); + this.followedUnit = recognizersText.RegExpUtility.getSafeRegExp(frenchDateTime.FrenchDateTime.DurationFollowedUnit, "gis"); + this.numberCombinedWithUnit = recognizersText.RegExpUtility.getSafeRegExp(frenchDateTime.FrenchDateTime.NumberCombinedWithDurationUnit, "gis"); + this.anUnitRegex = recognizersText.RegExpUtility.getSafeRegExp(frenchDateTime.FrenchDateTime.AnUnitRegex, "gis"); + this.inexactNumberUnitRegex = recognizersText.RegExpUtility.getSafeRegExp(frenchDateTime.FrenchDateTime.InexactNumberUnitRegex, "gis"); + this.suffixAndRegex = recognizersText.RegExpUtility.getSafeRegExp(frenchDateTime.FrenchDateTime.SuffixAndRegex, "gis"); + this.relativeDurationUnitRegex = recognizersText.RegExpUtility.getSafeRegExp(frenchDateTime.FrenchDateTime.RelativeDurationUnitRegex, "gis"); + this.moreThanRegex = recognizersText.RegExpUtility.getSafeRegExp(frenchDateTime.FrenchDateTime.MoreThanRegex, "gis"); + this.lessThanRegex = recognizersText.RegExpUtility.getSafeRegExp(frenchDateTime.FrenchDateTime.LessThanOneHour, "gis"); + this.cardinalExtractor = new recognizersTextNumber.FrenchCardinalExtractor(); + } +} +exports.FrenchDurationExtractorConfiguration = FrenchDurationExtractorConfiguration; +class FrenchDurationParserConfiguration { + constructor(config) { + this.cardinalExtractor = config.cardinalExtractor; + this.numberParser = config.numberParser; + this.followedUnit = recognizersText.RegExpUtility.getSafeRegExp(frenchDateTime.FrenchDateTime.DurationFollowedUnit); + this.suffixAndRegex = recognizersText.RegExpUtility.getSafeRegExp(frenchDateTime.FrenchDateTime.SuffixAndRegex); + this.numberCombinedWithUnit = recognizersText.RegExpUtility.getSafeRegExp(frenchDateTime.FrenchDateTime.NumberCombinedWithDurationUnit); + this.anUnitRegex = recognizersText.RegExpUtility.getSafeRegExp(frenchDateTime.FrenchDateTime.AnUnitRegex); + this.allDateUnitRegex = recognizersText.RegExpUtility.getSafeRegExp(frenchDateTime.FrenchDateTime.AllRegex); + this.halfDateUnitRegex = recognizersText.RegExpUtility.getSafeRegExp(frenchDateTime.FrenchDateTime.HalfRegex); + this.inexactNumberUnitRegex = recognizersText.RegExpUtility.getSafeRegExp(frenchDateTime.FrenchDateTime.InexactNumberUnitRegex); + this.unitMap = config.unitMap; + this.unitValueMap = config.unitValueMap; + this.doubleNumbers = config.doubleNumbers; + } +} +exports.FrenchDurationParserConfiguration = FrenchDurationParserConfiguration; + +}); + +unwrapExports(durationConfiguration$4); + +var timeConfiguration$4 = createCommonjsModule(function (module, exports) { +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); + + + + +class FrenchTimeExtractorConfiguration { + constructor() { + this.atRegex = recognizersText.RegExpUtility.getSafeRegExp(frenchDateTime.FrenchDateTime.AtRegex, "gis"); + this.ishRegex = recognizersText.RegExpUtility.getSafeRegExp(frenchDateTime.FrenchDateTime.IshRegex, "gis"); + + this.timeRegexList = FrenchTimeExtractorConfiguration.getTimeRegexList(); + this.durationExtractor = new baseDuration.BaseDurationExtractor(new durationConfiguration$4.FrenchDurationExtractorConfiguration()); + } + static getTimeRegexList() { + return [ + recognizersText.RegExpUtility.getSafeRegExp(frenchDateTime.FrenchDateTime.TimeRegex1, "gis"), + recognizersText.RegExpUtility.getSafeRegExp(frenchDateTime.FrenchDateTime.TimeRegex2, "gis"), + recognizersText.RegExpUtility.getSafeRegExp(frenchDateTime.FrenchDateTime.TimeRegex3, "gis"), + recognizersText.RegExpUtility.getSafeRegExp(frenchDateTime.FrenchDateTime.TimeRegex4, "gis"), + recognizersText.RegExpUtility.getSafeRegExp(frenchDateTime.FrenchDateTime.TimeRegex5, "gis"), + recognizersText.RegExpUtility.getSafeRegExp(frenchDateTime.FrenchDateTime.TimeRegex6, "gis"), + recognizersText.RegExpUtility.getSafeRegExp(frenchDateTime.FrenchDateTime.TimeRegex7, "gis"), + recognizersText.RegExpUtility.getSafeRegExp(frenchDateTime.FrenchDateTime.TimeRegex8, "gis"), + recognizersText.RegExpUtility.getSafeRegExp(frenchDateTime.FrenchDateTime.TimeRegex9, "gis"), + recognizersText.RegExpUtility.getSafeRegExp(frenchDateTime.FrenchDateTime.TimeRegex10, "gis"), + recognizersText.RegExpUtility.getSafeRegExp(frenchDateTime.FrenchDateTime.ConnectNumRegex, "gis") + ]; + } +} +exports.FrenchTimeExtractorConfiguration = FrenchTimeExtractorConfiguration; +class FrenchTimeParserConfiguration { + constructor(config) { + this.timeTokenPrefix = frenchDateTime.FrenchDateTime.TimeTokenPrefix; + this.atRegex = recognizersText.RegExpUtility.getSafeRegExp(frenchDateTime.FrenchDateTime.AtRegex, "gis"); + this.timeRegexes = FrenchTimeExtractorConfiguration.getTimeRegexList(); + this.lessThanOneHour = recognizersText.RegExpUtility.getSafeRegExp(frenchDateTime.FrenchDateTime.LessThanOneHour, "gis"); + this.timeSuffix = recognizersText.RegExpUtility.getSafeRegExp(frenchDateTime.FrenchDateTime.TimeSuffix, "gis"); + this.utilityConfiguration = config.utilityConfiguration; + this.numbers = config.numbers; + } + adjustByPrefix(prefix, adjust) { + let deltaMin = 0; + let trimedPrefix = prefix.trim().toLowerCase(); + if (trimedPrefix.endsWith("demie")) { + deltaMin = 30; + } + else if (trimedPrefix.endsWith("un quart") || trimedPrefix.endsWith("quart")) { + deltaMin = 15; + } + else if (trimedPrefix.endsWith("trois quarts")) { + deltaMin = 45; + } + else { + let matches = recognizersText.RegExpUtility.getMatches(this.lessThanOneHour, trimedPrefix); + if (matches.length) { + let match = matches[0]; + let minStr = match.groups("deltamin").value; + if (minStr) { + deltaMin = parseInt(minStr, 10); + } + else { + minStr = match.groups("deltaminnum").value.toLowerCase(); + if (this.numbers.has(minStr)) { + deltaMin = this.numbers.get(minStr); + } + } + } + } + if (trimedPrefix.endsWith("à")) { + deltaMin = -deltaMin; + } + adjust.min += deltaMin; + if (adjust.min < 0) { + adjust.min += 60; + adjust.hour -= 1; + } + adjust.hasMin = true; + } + adjustBySuffix(suffix, adjust) { + let trimedSuffix = suffix.trim().toLowerCase(); + let deltaHour = 0; + let matches = recognizersText.RegExpUtility.getMatches(this.timeSuffix, trimedSuffix); + if (matches.length) { + let match = matches[0]; + if (match.index === 0 && match.length === trimedSuffix.length) { + let oclockStr = match.groups("heures").value; + if (!oclockStr) { + let amStr = match.groups("am").value; + if (amStr) { + if (adjust.hour >= 12) { + deltaHour = -12; + } + adjust.hasAm = true; + } + let pmStr = match.groups("pm").value; + if (pmStr) { + if (adjust.hour < 12) { + deltaHour = 12; + } + adjust.hasPm = true; + } + } + } + } + adjust.hour = (adjust.hour + deltaHour) % 24; + } +} +exports.FrenchTimeParserConfiguration = FrenchTimeParserConfiguration; + +}); + +unwrapExports(timeConfiguration$4); + +var dateTimeConfiguration$4 = createCommonjsModule(function (module, exports) { +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); + + + + + + + + + +class FrenchDateTimeExtractorConfiguration { + constructor() { + this.prepositionRegex = recognizersText.RegExpUtility.getSafeRegExp(frenchDateTime.FrenchDateTime.PrepositionRegex, "gis"); + this.nowRegex = recognizersText.RegExpUtility.getSafeRegExp(frenchDateTime.FrenchDateTime.NowRegex, "gis"); + this.suffixRegex = recognizersText.RegExpUtility.getSafeRegExp(frenchDateTime.FrenchDateTime.SuffixRegex, "gis"); + this.timeOfDayRegex = recognizersText.RegExpUtility.getSafeRegExp(frenchDateTime.FrenchDateTime.TimeOfDayRegex, "gis"); + this.specificTimeOfDayRegex = recognizersText.RegExpUtility.getSafeRegExp(frenchDateTime.FrenchDateTime.SpecificTimeOfDayRegex, "gis"); + this.timeOfTodayAfterRegex = recognizersText.RegExpUtility.getSafeRegExp(frenchDateTime.FrenchDateTime.TimeOfTodayAfterRegex, "gis"); + this.timeOfTodayBeforeRegex = recognizersText.RegExpUtility.getSafeRegExp(frenchDateTime.FrenchDateTime.TimeOfTodayBeforeRegex, "gis"); + this.simpleTimeOfTodayAfterRegex = recognizersText.RegExpUtility.getSafeRegExp(frenchDateTime.FrenchDateTime.SimpleTimeOfTodayAfterRegex, "gis"); + this.simpleTimeOfTodayBeforeRegex = recognizersText.RegExpUtility.getSafeRegExp(frenchDateTime.FrenchDateTime.SimpleTimeOfTodayBeforeRegex, "gis"); + this.theEndOfRegex = recognizersText.RegExpUtility.getSafeRegExp(frenchDateTime.FrenchDateTime.TheEndOfRegex, "gis"); + this.unitRegex = recognizersText.RegExpUtility.getSafeRegExp(frenchDateTime.FrenchDateTime.TimeUnitRegex, "gis"); + this.connectorRegex = recognizersText.RegExpUtility.getSafeRegExp(frenchDateTime.FrenchDateTime.ConnectorRegex, "gis"); + this.nightRegex = recognizersText.RegExpUtility.getSafeRegExp(frenchDateTime.FrenchDateTime.NightRegex, "gis"); + this.datePointExtractor = new baseDate.BaseDateExtractor(new dateConfiguration$4.FrenchDateExtractorConfiguration()); + this.timePointExtractor = new baseTime.BaseTimeExtractor(new timeConfiguration$4.FrenchTimeExtractorConfiguration()); + this.durationExtractor = new baseDuration.BaseDurationExtractor(new durationConfiguration$4.FrenchDurationExtractorConfiguration()); + this.utilityConfiguration = new baseConfiguration$4.FrenchDateTimeUtilityConfiguration(); + } + isConnectorToken(source) { + return (source === "" || source === "," || + recognizersText.RegExpUtility.getFirstMatchIndex(this.prepositionRegex, source).matched || + source === "t" || + source === "pour" || + source === "vers"); + } +} +exports.FrenchDateTimeExtractorConfiguration = FrenchDateTimeExtractorConfiguration; +class FrenchDateTimeParserConfiguration { + constructor(config) { + this.tokenBeforeDate = frenchDateTime.FrenchDateTime.TokenBeforeDate; + this.tokenBeforeTime = frenchDateTime.FrenchDateTime.TokenBeforeTime; + this.nowRegex = recognizersText.RegExpUtility.getSafeRegExp(frenchDateTime.FrenchDateTime.NowRegex, "gis"); + this.amTimeRegex = recognizersText.RegExpUtility.getSafeRegExp(frenchDateTime.FrenchDateTime.AMTimeRegex, "gis"); + this.pmTimeRegex = recognizersText.RegExpUtility.getSafeRegExp(frenchDateTime.FrenchDateTime.PMTimeRegex, "gis"); + this.simpleTimeOfTodayAfterRegex = recognizersText.RegExpUtility.getSafeRegExp(frenchDateTime.FrenchDateTime.SimpleTimeOfTodayAfterRegex, "gis"); + this.simpleTimeOfTodayBeforeRegex = recognizersText.RegExpUtility.getSafeRegExp(frenchDateTime.FrenchDateTime.SimpleTimeOfTodayBeforeRegex, "gis"); + this.specificTimeOfDayRegex = recognizersText.RegExpUtility.getSafeRegExp(frenchDateTime.FrenchDateTime.SpecificTimeOfDayRegex, "gis"); + this.theEndOfRegex = recognizersText.RegExpUtility.getSafeRegExp(frenchDateTime.FrenchDateTime.TheEndOfRegex, "gis"); + this.unitRegex = recognizersText.RegExpUtility.getSafeRegExp(frenchDateTime.FrenchDateTime.TimeUnitRegex, "gis"); + this.dateExtractor = config.dateExtractor; + this.timeExtractor = config.timeExtractor; + this.dateParser = config.dateParser; + this.timeParser = config.timeParser; + this.numbers = config.numbers; + this.cardinalExtractor = config.cardinalExtractor; + this.numberParser = config.numberParser; + this.durationExtractor = config.durationExtractor; + this.durationParser = config.durationParser; + this.unitMap = config.unitMap; + this.utilityConfiguration = config.utilityConfiguration; + } + haveAmbiguousToken(text, matchedText) { + return false; + } + getMatchedNowTimex(text) { + let trimedText = text.trim().toLowerCase(); + let timex = ""; + if (trimedText.endsWith("maintenant")) { + timex = "PRESENT_REF"; + } + else if (trimedText === "récemment" || + trimedText === "précédemment" || + trimedText === "auparavant") { + timex = "PAST_REF"; + } + else if (trimedText === "dès que possible" || + trimedText === "dqp") { + timex = "FUTURE_REF"; + } + else { + return { + matched: false, + timex: null + }; + } + return { + matched: true, + timex: timex + }; + } + getSwiftDay(text) { + let trimedText = text.trim().toLowerCase(); + let swift = 0; + if (trimedText.startsWith("prochain") || + trimedText.endsWith("prochain") || + trimedText.startsWith("prochaine") || + trimedText.endsWith("prochaine")) { + swift = 1; + } + else if (trimedText.startsWith("dernier") || + trimedText.startsWith("dernière") || + trimedText.endsWith("dernier") || + trimedText.endsWith("dernière")) { + swift = -1; + } + return swift; + } + getHour(text, hour) { + let trimedText = text.trim().toLowerCase(); + let result = hour; + // TODO: Replace with a regex + if (trimedText.endsWith("matin") && hour >= 12) { + result -= 12; + } + else if (!trimedText.endsWith("matin") && hour < 12) { + result += 12; + } + return result; + } +} +exports.FrenchDateTimeParserConfiguration = FrenchDateTimeParserConfiguration; + +}); + +unwrapExports(dateTimeConfiguration$4); + +var datePeriodConfiguration$4 = createCommonjsModule(function (module, exports) { +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); + + + + + + + + +class FrenchDatePeriodExtractorConfiguration { + constructor() { + this.simpleCasesRegexes = [ + recognizersText.RegExpUtility.getSafeRegExp(frenchDateTime.FrenchDateTime.SimpleCasesRegex), + recognizersText.RegExpUtility.getSafeRegExp(frenchDateTime.FrenchDateTime.BetweenRegex), + recognizersText.RegExpUtility.getSafeRegExp(frenchDateTime.FrenchDateTime.OneWordPeriodRegex), + recognizersText.RegExpUtility.getSafeRegExp(frenchDateTime.FrenchDateTime.MonthWithYear), + recognizersText.RegExpUtility.getSafeRegExp(frenchDateTime.FrenchDateTime.MonthNumWithYear), + recognizersText.RegExpUtility.getSafeRegExp(frenchDateTime.FrenchDateTime.YearRegex), + recognizersText.RegExpUtility.getSafeRegExp(frenchDateTime.FrenchDateTime.WeekDayOfMonthRegex), + recognizersText.RegExpUtility.getSafeRegExp(frenchDateTime.FrenchDateTime.WeekOfYearRegex), + recognizersText.RegExpUtility.getSafeRegExp(frenchDateTime.FrenchDateTime.MonthFrontBetweenRegex), + recognizersText.RegExpUtility.getSafeRegExp(frenchDateTime.FrenchDateTime.MonthFrontSimpleCasesRegex), + recognizersText.RegExpUtility.getSafeRegExp(frenchDateTime.FrenchDateTime.QuarterRegex), + recognizersText.RegExpUtility.getSafeRegExp(frenchDateTime.FrenchDateTime.QuarterRegexYearFront), + recognizersText.RegExpUtility.getSafeRegExp(frenchDateTime.FrenchDateTime.AllHalfYearRegex), + recognizersText.RegExpUtility.getSafeRegExp(frenchDateTime.FrenchDateTime.SeasonRegex), + recognizersText.RegExpUtility.getSafeRegExp(frenchDateTime.FrenchDateTime.PastSuffixRegex), + recognizersText.RegExpUtility.getSafeRegExp(frenchDateTime.FrenchDateTime.NextSuffixRegex), + recognizersText.RegExpUtility.getSafeRegExp(frenchDateTime.FrenchDateTime.ThisPrefixRegex), + recognizersText.RegExpUtility.getSafeRegExp(frenchDateTime.FrenchDateTime.LaterEarlyPeriodRegex), + recognizersText.RegExpUtility.getSafeRegExp(frenchDateTime.FrenchDateTime.WeekWithWeekDayRangeRegex) + ]; + this.illegalYearRegex = recognizersText.RegExpUtility.getSafeRegExp(baseDateTime.BaseDateTime.IllegalYearRegex); + this.YearRegex = recognizersText.RegExpUtility.getSafeRegExp(frenchDateTime.FrenchDateTime.YearRegex); + this.tillRegex = recognizersText.RegExpUtility.getSafeRegExp(frenchDateTime.FrenchDateTime.TillRegex); + this.followedUnit = recognizersText.RegExpUtility.getSafeRegExp(frenchDateTime.FrenchDateTime.FollowedDateUnit); + this.numberCombinedWithUnit = recognizersText.RegExpUtility.getSafeRegExp(frenchDateTime.FrenchDateTime.NumberCombinedWithDateUnit); + this.pastRegex = recognizersText.RegExpUtility.getSafeRegExp(frenchDateTime.FrenchDateTime.PastSuffixRegex); + this.futureRegex = recognizersText.RegExpUtility.getSafeRegExp(frenchDateTime.FrenchDateTime.NextSuffixRegex); + this.weekOfRegex = recognizersText.RegExpUtility.getSafeRegExp(frenchDateTime.FrenchDateTime.WeekOfRegex); + this.monthOfRegex = recognizersText.RegExpUtility.getSafeRegExp(frenchDateTime.FrenchDateTime.MonthOfRegex); + this.dateUnitRegex = recognizersText.RegExpUtility.getSafeRegExp(frenchDateTime.FrenchDateTime.DateUnitRegex); + this.inConnectorRegex = recognizersText.RegExpUtility.getSafeRegExp(frenchDateTime.FrenchDateTime.InConnectorRegex); + this.rangeUnitRegex = recognizersText.RegExpUtility.getSafeRegExp(frenchDateTime.FrenchDateTime.RangeUnitRegex); + this.weekDayOfMonthRegex = recognizersText.RegExpUtility.getSafeRegExp(frenchDateTime.FrenchDateTime.WeekDayOfMonthRegex); + this.fromRegex = recognizersText.RegExpUtility.getSafeRegExp(frenchDateTime.FrenchDateTime.FromRegex); + this.connectorAndRegex = recognizersText.RegExpUtility.getSafeRegExp(frenchDateTime.FrenchDateTime.ConnectorAndRegex); + this.beforeRegex = recognizersText.RegExpUtility.getSafeRegExp(frenchDateTime.FrenchDateTime.BeforeRegex2); + this.datePointExtractor = new baseDate.BaseDateExtractor(new dateConfiguration$4.FrenchDateExtractorConfiguration()); + this.integerExtractor = new recognizersTextNumber.FrenchIntegerExtractor(); + this.numberParser = new recognizersTextNumber.BaseNumberParser(new recognizersTextNumber.FrenchNumberParserConfiguration()); + this.durationExtractor = new baseDuration.BaseDurationExtractor(new durationConfiguration$4.FrenchDurationExtractorConfiguration()); + } + getFromTokenIndex(source) { + return recognizersText.RegExpUtility.getFirstMatchIndex(this.fromRegex, source); + } + getBetweenTokenIndex(source) { + return recognizersText.RegExpUtility.getFirstMatchIndex(this.beforeRegex, source); + } + hasConnectorToken(source) { + return recognizersText.RegExpUtility.getFirstMatchIndex(this.connectorAndRegex, source).matched; + } +} +exports.FrenchDatePeriodExtractorConfiguration = FrenchDatePeriodExtractorConfiguration; +class FrenchDatePeriodParserConfiguration { + constructor(config) { + this.tokenBeforeDate = frenchDateTime.FrenchDateTime.TokenBeforeDate; + this.cardinalExtractor = config.cardinalExtractor; + this.numberParser = config.numberParser; + this.durationExtractor = config.durationExtractor; + this.dateExtractor = config.dateExtractor; + this.durationParser = config.durationParser; + this.dateParser = config.dateParser; + this.monthFrontBetweenRegex = recognizersText.RegExpUtility.getSafeRegExp(frenchDateTime.FrenchDateTime.MonthFrontBetweenRegex); + this.betweenRegex = recognizersText.RegExpUtility.getSafeRegExp(frenchDateTime.FrenchDateTime.BetweenRegex); + this.monthFrontSimpleCasesRegex = recognizersText.RegExpUtility.getSafeRegExp(frenchDateTime.FrenchDateTime.MonthFrontSimpleCasesRegex); + this.simpleCasesRegex = recognizersText.RegExpUtility.getSafeRegExp(frenchDateTime.FrenchDateTime.SimpleCasesRegex); + this.oneWordPeriodRegex = recognizersText.RegExpUtility.getSafeRegExp(frenchDateTime.FrenchDateTime.OneWordPeriodRegex); + this.monthWithYear = recognizersText.RegExpUtility.getSafeRegExp(frenchDateTime.FrenchDateTime.MonthWithYear); + this.monthNumWithYear = recognizersText.RegExpUtility.getSafeRegExp(frenchDateTime.FrenchDateTime.MonthNumWithYear); + this.yearRegex = recognizersText.RegExpUtility.getSafeRegExp(frenchDateTime.FrenchDateTime.YearRegex); + this.pastRegex = recognizersText.RegExpUtility.getSafeRegExp(frenchDateTime.FrenchDateTime.PastSuffixRegex); + this.futureRegex = recognizersText.RegExpUtility.getSafeRegExp(frenchDateTime.FrenchDateTime.NextSuffixRegex); + this.numberCombinedWithUnit = recognizersText.RegExpUtility.getSafeRegExp(frenchDateTime.FrenchDateTime.NumberCombinedWithDurationUnit); + this.weekOfMonthRegex = recognizersText.RegExpUtility.getSafeRegExp(frenchDateTime.FrenchDateTime.WeekOfMonthRegex); + this.weekOfYearRegex = recognizersText.RegExpUtility.getSafeRegExp(frenchDateTime.FrenchDateTime.WeekOfYearRegex); + this.quarterRegex = recognizersText.RegExpUtility.getSafeRegExp(frenchDateTime.FrenchDateTime.QuarterRegex); + this.quarterRegexYearFront = recognizersText.RegExpUtility.getSafeRegExp(frenchDateTime.FrenchDateTime.QuarterRegexYearFront); + this.allHalfYearRegex = recognizersText.RegExpUtility.getSafeRegExp(frenchDateTime.FrenchDateTime.AllHalfYearRegex); + this.seasonRegex = recognizersText.RegExpUtility.getSafeRegExp(frenchDateTime.FrenchDateTime.SeasonRegex); + this.whichWeekRegex = recognizersText.RegExpUtility.getSafeRegExp(frenchDateTime.FrenchDateTime.WhichWeekRegex); + this.weekOfRegex = recognizersText.RegExpUtility.getSafeRegExp(frenchDateTime.FrenchDateTime.WeekOfRegex); + this.monthOfRegex = recognizersText.RegExpUtility.getSafeRegExp(frenchDateTime.FrenchDateTime.MonthOfRegex); + this.restOfDateRegex = recognizersText.RegExpUtility.getSafeRegExp(frenchDateTime.FrenchDateTime.RestOfDateRegex); + this.nextPrefixRegex = recognizersText.RegExpUtility.getSafeRegExp("(prochain|prochaine)\b"); + this.pastPrefixRegex = recognizersText.RegExpUtility.getSafeRegExp("(dernier)\b"); + this.thisPrefixRegex = recognizersText.RegExpUtility.getSafeRegExp("(ce|cette)\b"); + this.inConnectorRegex = config.utilityConfiguration.inConnectorRegex; + this.unitMap = config.unitMap; + this.cardinalMap = config.cardinalMap; + this.dayOfMonth = config.dayOfMonth; + this.monthOfYear = config.monthOfYear; + this.seasonMap = config.seasonMap; + } + getSwiftDayOrMonth(source) { + let trimedText = source.trim().toLowerCase(); + let swift = 0; + if (trimedText.endsWith("prochain") || trimedText.endsWith("prochaine")) { + swift = 1; + } + if (trimedText.endsWith("dernière") || + trimedText.endsWith("dernières") || + trimedText.endsWith("derniere") || + trimedText.endsWith("dernieres")) { + swift = -1; + } + return swift; + } + getSwiftYear(source) { + let trimedText = source.trim().toLowerCase(); + let swift = -10; + if (trimedText.endsWith("prochain") || trimedText.endsWith("prochaine")) { + swift = 1; + } + if (trimedText.endsWith("dernières") || + trimedText.endsWith("dernière") || + trimedText.endsWith("dernieres") || + trimedText.endsWith("derniere") || + trimedText.endsWith("dernier")) { + swift = -1; + } + else if (trimedText.startsWith("cette")) { + swift = 0; + } + return swift; + } + isFuture(source) { + let trimedText = source.trim().toLowerCase(); + return (trimedText.startsWith("cette") || + trimedText.endsWith("prochaine") || + trimedText.endsWith("prochain")); + } + isYearToDate(source) { + let trimedText = source.trim().toLowerCase(); + return (trimedText === "année à ce jour" || + trimedText === "an à ce jour"); + } + isMonthToDate(source) { + let trimedText = source.trim().toLowerCase(); + return trimedText === "mois à ce jour"; + } + isWeekOnly(source) { + let trimedText = source.trim().toLowerCase(); + return (trimedText.endsWith("semaine") && + !trimedText.endsWith("fin de semaine")); + } + isWeekend(source) { + let trimedText = source.trim().toLowerCase(); + return (trimedText.endsWith("fin de semaine") || + trimedText.endsWith("le weekend")); + } + isMonthOnly(source) { + let trimedText = source.trim().toLowerCase(); + return trimedText.endsWith("mois"); + } + isYearOnly(source) { + let trimedText = source.trim().toLowerCase(); + return (trimedText.endsWith("années") || + trimedText.endsWith("ans") || + (trimedText.endsWith("l'annees") || + trimedText.endsWith("l'annee"))); + } + isLastCardinal(source) { + let trimedText = source.trim().toLowerCase(); + return (trimedText === "dernières" || + trimedText === "dernière" || + trimedText === "dernieres" || + trimedText === "derniere" || + trimedText === "dernier"); + } +} +exports.FrenchDatePeriodParserConfiguration = FrenchDatePeriodParserConfiguration; + +}); + +unwrapExports(datePeriodConfiguration$4); + +var timePeriodConfiguration$4 = createCommonjsModule(function (module, exports) { +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); + + + + + + +class FrenchTimePeriodExtractorConfiguration { + constructor() { + this.singleTimeExtractor = new baseTime.BaseTimeExtractor(new timeConfiguration$4.FrenchTimeExtractorConfiguration()); + this.integerExtractor = new recognizersTextNumber.EnglishIntegerExtractor(); + this.utilityConfiguration = new baseConfiguration$4.FrenchDateTimeUtilityConfiguration(); + this.simpleCasesRegex = [ + recognizersText.RegExpUtility.getSafeRegExp(frenchDateTime.FrenchDateTime.PureNumFromTo, "gis"), + recognizersText.RegExpUtility.getSafeRegExp(frenchDateTime.FrenchDateTime.PureNumBetweenAnd, "gis"), + recognizersText.RegExpUtility.getSafeRegExp(frenchDateTime.FrenchDateTime.PmRegex, "gis"), + recognizersText.RegExpUtility.getSafeRegExp(frenchDateTime.FrenchDateTime.AmRegex, "gis") + ]; + this.tillRegex = recognizersText.RegExpUtility.getSafeRegExp(frenchDateTime.FrenchDateTime.TillRegex, "gis"); + this.timeOfDayRegex = recognizersText.RegExpUtility.getSafeRegExp(frenchDateTime.FrenchDateTime.TimeOfDayRegex, "gis"); + this.generalEndingRegex = recognizersText.RegExpUtility.getSafeRegExp(frenchDateTime.FrenchDateTime.GeneralEndingRegex, "gis"); + this.fromRegex = recognizersText.RegExpUtility.getSafeRegExp(frenchDateTime.FrenchDateTime.FromRegex2, "gis"); + this.connectorAndRegex = recognizersText.RegExpUtility.getSafeRegExp(frenchDateTime.FrenchDateTime.ConnectorAndRegex, "gis"); + this.beforeRegex = recognizersText.RegExpUtility.getSafeRegExp(frenchDateTime.FrenchDateTime.BeforeRegex2, "gis"); + } + getFromTokenIndex(text) { + return recognizersText.RegExpUtility.getFirstMatchIndex(this.fromRegex, text); + } + hasConnectorToken(text) { + return recognizersText.RegExpUtility.getFirstMatchIndex(this.connectorAndRegex, text).matched; + } + getBetweenTokenIndex(text) { + return recognizersText.RegExpUtility.getFirstMatchIndex(this.beforeRegex, text); + } +} +exports.FrenchTimePeriodExtractorConfiguration = FrenchTimePeriodExtractorConfiguration; +class FrenchTimePeriodParserConfiguration { + constructor(config) { + this.timeExtractor = config.timeExtractor; + this.timeParser = config.timeParser; + this.integerExtractor = config.integerExtractor; + this.numbers = config.numbers; + this.utilityConfiguration = config.utilityConfiguration; + this.pureNumberFromToRegex = recognizersText.RegExpUtility.getSafeRegExp(frenchDateTime.FrenchDateTime.PureNumFromTo, "gis"); + this.pureNumberBetweenAndRegex = recognizersText.RegExpUtility.getSafeRegExp(frenchDateTime.FrenchDateTime.PureNumBetweenAnd, "gis"); + this.timeOfDayRegex = recognizersText.RegExpUtility.getSafeRegExp(frenchDateTime.FrenchDateTime.TimeOfDayRegex, "gis"); + this.tillRegex = recognizersText.RegExpUtility.getSafeRegExp(frenchDateTime.FrenchDateTime.TillRegex, "gis"); + this.specificTimeFromToRegex = recognizersText.RegExpUtility.getSafeRegExp(frenchDateTime.FrenchDateTime.SpecificTimeFromTo); + this.specificTimeBetweenAndRegex = recognizersText.RegExpUtility.getSafeRegExp(frenchDateTime.FrenchDateTime.SpecificTimeBetweenAnd); + } + getMatchedTimexRange(text) { + let trimedText = text.trim().toLowerCase(); + if (trimedText.endsWith("s")) { + trimedText = trimedText.substring(0, trimedText.length - 1); + } + let beginHour = 0; + let endHour = 0; + let endMin = 0; + let timex = ""; + if (trimedText.endsWith("matinee") || + trimedText.endsWith("matin") || + trimedText.endsWith("matinée")) { + timex = "TMO"; + beginHour = 8; + endHour = 12; + } + else if (trimedText.endsWith("apres-midi") || + trimedText.endsWith("apres midi") || + trimedText.endsWith("après midi") || + trimedText.endsWith("après-midi")) { + timex = "TAF"; + beginHour = 12; + endHour = 16; + } + else if (trimedText.endsWith("soir") || + trimedText.endsWith("soiree") || + trimedText.endsWith("soirée")) { + timex = "TEV"; + beginHour = 16; + endHour = 20; + } + else if (trimedText === "jour" || + trimedText.endsWith("journee") || + trimedText.endsWith("journée")) { + timex = "TDT"; + beginHour = 8; + endHour = 18; + } + else if (trimedText.endsWith("nuit")) { + timex = "TNI"; + beginHour = 20; + endHour = 23; + endMin = 59; + } + else { + timex = null; + return { + matched: false, + timex, + beginHour, + endHour, + endMin + }; + } + return { + matched: true, + timex, + beginHour, + endHour, + endMin + }; + } +} +exports.FrenchTimePeriodParserConfiguration = FrenchTimePeriodParserConfiguration; + +}); + +unwrapExports(timePeriodConfiguration$4); + +var dateTimePeriodConfiguration$4 = createCommonjsModule(function (module, exports) { +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); + + + + + + + + + + + + + +class FrenchDateTimePeriodExtractorConfiguration { + constructor() { + this.simpleCasesRegexes = [ + recognizersText.RegExpUtility.getSafeRegExp(frenchDateTime.FrenchDateTime.PureNumFromTo), + recognizersText.RegExpUtility.getSafeRegExp(frenchDateTime.FrenchDateTime.PureNumBetweenAnd), + recognizersText.RegExpUtility.getSafeRegExp(frenchDateTime.FrenchDateTime.SpecificTimeOfDayRegex) + ]; + this.prepositionRegex = recognizersText.RegExpUtility.getSafeRegExp(frenchDateTime.FrenchDateTime.PrepositionRegex); + this.tillRegex = recognizersText.RegExpUtility.getSafeRegExp(frenchDateTime.FrenchDateTime.TillRegex); + this.specificTimeOfDayRegex = recognizersText.RegExpUtility.getSafeRegExp(frenchDateTime.FrenchDateTime.PeriodSpecificTimeOfDayRegex); + this.timeOfDayRegex = recognizersText.RegExpUtility.getSafeRegExp(frenchDateTime.FrenchDateTime.PeriodTimeOfDayRegex); + this.followedUnit = recognizersText.RegExpUtility.getSafeRegExp(frenchDateTime.FrenchDateTime.TimeFollowedUnit); + this.timeUnitRegex = recognizersText.RegExpUtility.getSafeRegExp(frenchDateTime.FrenchDateTime.TimeUnitRegex); + this.pastPrefixRegex = recognizersText.RegExpUtility.getSafeRegExp(frenchDateTime.FrenchDateTime.PastSuffixRegex); + this.nextPrefixRegex = recognizersText.RegExpUtility.getSafeRegExp(frenchDateTime.FrenchDateTime.NextSuffixRegex); + this.numberCombinedWithUnit = recognizersText.RegExpUtility.getSafeRegExp(frenchDateTime.FrenchDateTime.TimeNumberCombinedWithUnit); + this.weekDayRegex = recognizersText.RegExpUtility.getSafeRegExp(frenchDateTime.FrenchDateTime.WeekDayRegex); + this.periodTimeOfDayWithDateRegex = recognizersText.RegExpUtility.getSafeRegExp(frenchDateTime.FrenchDateTime.PeriodTimeOfDayWithDateRegex); + this.relativeTimeUnitRegex = recognizersText.RegExpUtility.getSafeRegExp(frenchDateTime.FrenchDateTime.RelativeTimeUnitRegex); + this.restOfDateTimeRegex = recognizersText.RegExpUtility.getSafeRegExp(frenchDateTime.FrenchDateTime.RestOfDateTimeRegex); + this.generalEndingRegex = recognizersText.RegExpUtility.getSafeRegExp(frenchDateTime.FrenchDateTime.GeneralEndingRegex); + this.middlePauseRegex = recognizersText.RegExpUtility.getSafeRegExp(frenchDateTime.FrenchDateTime.MiddlePauseRegex); + this.fromRegex = recognizersText.RegExpUtility.getSafeRegExp(frenchDateTime.FrenchDateTime.FromRegex2); + this.connectorAndRegex = recognizersText.RegExpUtility.getSafeRegExp(frenchDateTime.FrenchDateTime.ConnectorAndRegex); + this.beforeRegex = recognizersText.RegExpUtility.getSafeRegExp(frenchDateTime.FrenchDateTime.BeforeRegex); + this.cardinalExtractor = new recognizersTextNumber.FrenchCardinalExtractor(); + this.singleDateExtractor = new baseDate.BaseDateExtractor(new dateConfiguration$4.FrenchDateExtractorConfiguration()); + this.singleTimeExtractor = new baseTime.BaseTimeExtractor(new timeConfiguration$4.FrenchTimeExtractorConfiguration()); + this.singleDateTimeExtractor = new baseDateTime$2.BaseDateTimeExtractor(new dateTimeConfiguration$4.FrenchDateTimeExtractorConfiguration()); + this.durationExtractor = new baseDuration.BaseDurationExtractor(new durationConfiguration$4.FrenchDurationExtractorConfiguration()); + this.timePeriodExtractor = new baseTimePeriod.BaseTimePeriodExtractor(new timePeriodConfiguration$4.FrenchTimePeriodExtractorConfiguration()); + } + getFromTokenIndex(source) { + return recognizersText.RegExpUtility.getFirstMatchIndex(this.fromRegex, source); + } + getBetweenTokenIndex(source) { + return recognizersText.RegExpUtility.getFirstMatchIndex(this.beforeRegex, source); + } + hasConnectorToken(source) { + return recognizersText.RegExpUtility.getFirstMatchIndex(this.connectorAndRegex, source).matched; + } +} +exports.FrenchDateTimePeriodExtractorConfiguration = FrenchDateTimePeriodExtractorConfiguration; +class FrenchDateTimePeriodParserConfiguration { + constructor(config) { + this.dateExtractor = config.dateExtractor; + this.timeExtractor = config.timeExtractor; + this.dateTimeExtractor = config.dateTimeExtractor; + this.timePeriodExtractor = config.timePeriodExtractor; + this.cardinalExtractor = config.cardinalExtractor; + this.durationExtractor = config.durationExtractor; + this.numberParser = config.numberParser; + this.dateParser = config.dateParser; + this.timeParser = config.timeParser; + this.dateTimeParser = config.dateTimeParser; + this.timePeriodParser = config.timePeriodParser; + this.durationParser = config.durationParser; + this.unitMap = config.unitMap; + this.numbers = config.numbers; + this.nextPrefixRegex = recognizersText.RegExpUtility.getSafeRegExp(frenchDateTime.FrenchDateTime.NextSuffixRegex); + this.pastPrefixRegex = recognizersText.RegExpUtility.getSafeRegExp(frenchDateTime.FrenchDateTime.PastSuffixRegex); + this.thisPrefixRegex = recognizersText.RegExpUtility.getSafeRegExp(frenchDateTime.FrenchDateTime.ThisPrefixRegex); + this.morningStartEndRegex = recognizersText.RegExpUtility.getSafeRegExp(frenchDateTime.FrenchDateTime.MorningStartEndRegex); + this.afternoonStartEndRegex = recognizersText.RegExpUtility.getSafeRegExp(frenchDateTime.FrenchDateTime.AfternoonStartEndRegex); + this.eveningStartEndRegex = recognizersText.RegExpUtility.getSafeRegExp(frenchDateTime.FrenchDateTime.EveningStartEndRegex); + this.nightStartEndRegex = recognizersText.RegExpUtility.getSafeRegExp(frenchDateTime.FrenchDateTime.NightStartEndRegex); + this.pureNumberFromToRegex = recognizersText.RegExpUtility.getSafeRegExp(frenchDateTime.FrenchDateTime.PureNumFromTo); + this.pureNumberBetweenAndRegex = recognizersText.RegExpUtility.getSafeRegExp(frenchDateTime.FrenchDateTime.PureNumBetweenAnd); + this.specificTimeOfDayRegex = recognizersText.RegExpUtility.getSafeRegExp(frenchDateTime.FrenchDateTime.SpecificTimeOfDayRegex); + this.timeOfDayRegex = recognizersText.RegExpUtility.getSafeRegExp(frenchDateTime.FrenchDateTime.TimeOfDayRegex); + this.pastRegex = recognizersText.RegExpUtility.getSafeRegExp(frenchDateTime.FrenchDateTime.PastSuffixRegex); + this.futureRegex = recognizersText.RegExpUtility.getSafeRegExp(frenchDateTime.FrenchDateTime.NextSuffixRegex); + this.numberCombinedWithUnitRegex = recognizersText.RegExpUtility.getSafeRegExp(frenchDateTime.FrenchDateTime.TimeNumberCombinedWithUnit); + this.unitRegex = recognizersText.RegExpUtility.getSafeRegExp(frenchDateTime.FrenchDateTime.TimeUnitRegex); + this.periodTimeOfDayWithDateRegex = recognizersText.RegExpUtility.getSafeRegExp(frenchDateTime.FrenchDateTime.PeriodTimeOfDayWithDateRegex); + this.relativeTimeUnitRegex = recognizersText.RegExpUtility.getSafeRegExp(frenchDateTime.FrenchDateTime.RelativeTimeUnitRegex); + this.restOfDateTimeRegex = recognizersText.RegExpUtility.getSafeRegExp(frenchDateTime.FrenchDateTime.RestOfDateTimeRegex); + } + getMatchedTimeRange(source) { + let trimedText = source.trim().toLowerCase(); + let timeStr = ""; + let beginHour = 0; + let endHour = 0; + let endMin = 0; + if (recognizersText.RegExpUtility.getFirstMatchIndex(this.morningStartEndRegex, trimedText).matched) { + timeStr = "TMO"; + beginHour = 8; + endHour = 12; + } + else if (recognizersText.RegExpUtility.getFirstMatchIndex(this.afternoonStartEndRegex, trimedText).matched) { + timeStr = "TAF"; + beginHour = 12; + endHour = 16; + } + else if (recognizersText.RegExpUtility.getFirstMatchIndex(this.eveningStartEndRegex, trimedText).matched) { + timeStr = "TEV"; + beginHour = 16; + endHour = 20; + } + else if (recognizersText.RegExpUtility.getFirstMatchIndex(this.nightStartEndRegex, trimedText).matched) { + timeStr = "TNI"; + beginHour = 20; + endHour = 23; + endMin = 59; + } + else { + timeStr = null; + return { + success: false, + timeStr, + beginHour, + endHour, + endMin + }; + } + return { + success: true, + timeStr, + beginHour, + endHour, + endMin + }; + } + getSwiftPrefix(source) { + let trimedText = source.trim().toLowerCase(); + let swift = 0; + // TODO: Replace with a regex + if (trimedText.startsWith("prochain") || + trimedText.endsWith("prochain") || + trimedText.startsWith("prochaine") || + trimedText.endsWith("prochaine")) { + swift = 1; + } + else if (trimedText.startsWith("derniere") || + trimedText.startsWith("dernier") || + trimedText.endsWith("derniere") || + trimedText.endsWith("dernier")) { + swift = -1; + } + return swift; + } +} +exports.FrenchDateTimePeriodParserConfiguration = FrenchDateTimePeriodParserConfiguration; + +}); + +unwrapExports(dateTimePeriodConfiguration$4); + +var baseConfiguration$4 = createCommonjsModule(function (module, exports) { +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); + + + + + + + + + + + + + + + + + + + +class FrenchDateTimeUtilityConfiguration { + constructor() { + this.laterRegex = recognizersText.RegExpUtility.getSafeRegExp(frenchDateTime.FrenchDateTime.LaterRegex); + this.agoRegex = recognizersText.RegExpUtility.getSafeRegExp(frenchDateTime.FrenchDateTime.AgoPrefixRegex); + this.inConnectorRegex = recognizersText.RegExpUtility.getSafeRegExp(frenchDateTime.FrenchDateTime.InConnectorRegex); + this.rangeUnitRegex = recognizersText.RegExpUtility.getSafeRegExp(frenchDateTime.FrenchDateTime.RangeUnitRegex); + this.amDescRegex = recognizersText.RegExpUtility.getSafeRegExp(frenchDateTime.FrenchDateTime.AmDescRegex); + this.pmDescRegex = recognizersText.RegExpUtility.getSafeRegExp(frenchDateTime.FrenchDateTime.PmDescRegex); + this.amPmDescRegex = recognizersText.RegExpUtility.getSafeRegExp(frenchDateTime.FrenchDateTime.AmPmDescRegex); + } +} +exports.FrenchDateTimeUtilityConfiguration = FrenchDateTimeUtilityConfiguration; +class FrenchCommonDateTimeParserConfiguration extends parsers$4.BaseDateParserConfiguration { + constructor() { + super(); + this.utilityConfiguration = new FrenchDateTimeUtilityConfiguration(); + this.unitMap = frenchDateTime.FrenchDateTime.UnitMap; + this.unitValueMap = frenchDateTime.FrenchDateTime.UnitValueMap; + this.seasonMap = frenchDateTime.FrenchDateTime.SeasonMap; + this.cardinalMap = frenchDateTime.FrenchDateTime.CardinalMap; + this.dayOfWeek = frenchDateTime.FrenchDateTime.DayOfWeek; + this.monthOfYear = frenchDateTime.FrenchDateTime.MonthOfYear; + this.numbers = frenchDateTime.FrenchDateTime.Numbers; + this.doubleNumbers = frenchDateTime.FrenchDateTime.DoubleNumbers; + this.cardinalExtractor = new recognizersTextNumber.FrenchCardinalExtractor(); + this.integerExtractor = new recognizersTextNumber.FrenchIntegerExtractor(); + this.ordinalExtractor = new recognizersTextNumber.FrenchOrdinalExtractor(); + this.numberParser = new recognizersTextNumber.BaseNumberParser(new recognizersTextNumber.FrenchNumberParserConfiguration()); + this.dateExtractor = new baseDate.BaseDateExtractor(new dateConfiguration$4.FrenchDateExtractorConfiguration()); + this.timeExtractor = new baseTime.BaseTimeExtractor(new timeConfiguration$4.FrenchTimeExtractorConfiguration()); + this.dateTimeExtractor = new baseDateTime$2.BaseDateTimeExtractor(new dateTimeConfiguration$4.FrenchDateTimeExtractorConfiguration()); + this.durationExtractor = new baseDuration.BaseDurationExtractor(new durationConfiguration$4.FrenchDurationExtractorConfiguration()); + this.datePeriodExtractor = new baseDatePeriod.BaseDatePeriodExtractor(new datePeriodConfiguration$4.FrenchDatePeriodExtractorConfiguration()); + this.timePeriodExtractor = new baseTimePeriod.BaseTimePeriodExtractor(new timePeriodConfiguration$4.FrenchTimePeriodExtractorConfiguration()); + this.dateTimePeriodExtractor = new baseDateTimePeriod.BaseDateTimePeriodExtractor(new dateTimePeriodConfiguration$4.FrenchDateTimePeriodExtractorConfiguration()); + this.durationParser = new baseDuration.BaseDurationParser(new durationConfiguration$4.FrenchDurationParserConfiguration(this)); + this.dateParser = new baseDate.BaseDateParser(new dateConfiguration$4.FrenchDateParserConfiguration(this)); + this.timeParser = new baseTime.BaseTimeParser(new timeConfiguration$4.FrenchTimeParserConfiguration(this)); + this.dateTimeParser = new baseDateTime$2.BaseDateTimeParser(new dateTimeConfiguration$4.FrenchDateTimeParserConfiguration(this)); + this.datePeriodParser = new baseDatePeriod.BaseDatePeriodParser(new datePeriodConfiguration$4.FrenchDatePeriodParserConfiguration(this)); + this.timePeriodParser = new baseTimePeriod.BaseTimePeriodParser(new timePeriodConfiguration$4.FrenchTimePeriodParserConfiguration(this)); + this.dateTimePeriodParser = new baseDateTimePeriod.BaseDateTimePeriodParser(new dateTimePeriodConfiguration$4.FrenchDateTimePeriodParserConfiguration(this)); + this.dayOfMonth = new Map([...baseDateTime.BaseDateTime.DayOfMonthDictionary, ...frenchDateTime.FrenchDateTime.DayOfMonth]); + } +} +exports.FrenchCommonDateTimeParserConfiguration = FrenchCommonDateTimeParserConfiguration; + +}); + +unwrapExports(baseConfiguration$4); + +var dateConfiguration$4 = createCommonjsModule(function (module, exports) { +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); + + + + + + + +class FrenchDateExtractorConfiguration { + constructor() { + this.dateRegexList = [ + recognizersText.RegExpUtility.getSafeRegExp(frenchDateTime.FrenchDateTime.DateExtractor1, "gis"), + recognizersText.RegExpUtility.getSafeRegExp(frenchDateTime.FrenchDateTime.DateExtractor2, "gis"), + recognizersText.RegExpUtility.getSafeRegExp(frenchDateTime.FrenchDateTime.DateExtractor3, "gis"), + frenchDateTime.FrenchDateTime.DefaultLanguageFallback === constants$2.Constants.DefaultLanguageFallback_DMY ? + recognizersText.RegExpUtility.getSafeRegExp(frenchDateTime.FrenchDateTime.DateExtractor5, "gis") : + recognizersText.RegExpUtility.getSafeRegExp(frenchDateTime.FrenchDateTime.DateExtractor4, "gis"), + frenchDateTime.FrenchDateTime.DefaultLanguageFallback === constants$2.Constants.DefaultLanguageFallback_DMY ? + recognizersText.RegExpUtility.getSafeRegExp(frenchDateTime.FrenchDateTime.DateExtractor4, "gis") : + recognizersText.RegExpUtility.getSafeRegExp(frenchDateTime.FrenchDateTime.DateExtractor5, "gis"), + recognizersText.RegExpUtility.getSafeRegExp(frenchDateTime.FrenchDateTime.DateExtractor6, "gis"), + recognizersText.RegExpUtility.getSafeRegExp(frenchDateTime.FrenchDateTime.DateExtractor7, "gis"), + recognizersText.RegExpUtility.getSafeRegExp(frenchDateTime.FrenchDateTime.DateExtractor8, "gis"), + recognizersText.RegExpUtility.getSafeRegExp(frenchDateTime.FrenchDateTime.DateExtractor9, "gis"), + recognizersText.RegExpUtility.getSafeRegExp(frenchDateTime.FrenchDateTime.DateExtractorA, "gis"), + ]; + this.implicitDateList = [ + recognizersText.RegExpUtility.getSafeRegExp(frenchDateTime.FrenchDateTime.OnRegex, "gis"), + recognizersText.RegExpUtility.getSafeRegExp(frenchDateTime.FrenchDateTime.RelaxedOnRegex, "gis"), + recognizersText.RegExpUtility.getSafeRegExp(frenchDateTime.FrenchDateTime.SpecialDayRegex, "gis"), + recognizersText.RegExpUtility.getSafeRegExp(frenchDateTime.FrenchDateTime.ThisRegex, "gis"), + recognizersText.RegExpUtility.getSafeRegExp(frenchDateTime.FrenchDateTime.LastDateRegex, "gis"), + recognizersText.RegExpUtility.getSafeRegExp(frenchDateTime.FrenchDateTime.NextDateRegex, "gis"), + recognizersText.RegExpUtility.getSafeRegExp(frenchDateTime.FrenchDateTime.StrictWeekDay, "gis"), + recognizersText.RegExpUtility.getSafeRegExp(frenchDateTime.FrenchDateTime.WeekDayOfMonthRegex, "gis"), + recognizersText.RegExpUtility.getSafeRegExp(frenchDateTime.FrenchDateTime.SpecialDate, "gis") + ]; + this.monthEnd = recognizersText.RegExpUtility.getSafeRegExp(frenchDateTime.FrenchDateTime.MonthEnd, "gis"); + this.ofMonth = recognizersText.RegExpUtility.getSafeRegExp(frenchDateTime.FrenchDateTime.OfMonth, "gis"); + this.dateUnitRegex = recognizersText.RegExpUtility.getSafeRegExp(frenchDateTime.FrenchDateTime.DateUnitRegex, "gis"); + this.forTheRegex = recognizersText.RegExpUtility.getSafeRegExp(frenchDateTime.FrenchDateTime.ForTheRegex, "gis"); + this.weekDayAndDayOfMonthRegex = recognizersText.RegExpUtility.getSafeRegExp(frenchDateTime.FrenchDateTime.WeekDayAndDayOfMonthRegex, "gis"); + this.relativeMonthRegex = recognizersText.RegExpUtility.getSafeRegExp(frenchDateTime.FrenchDateTime.RelativeMonthRegex, "gis"); + this.weekDayRegex = recognizersText.RegExpUtility.getSafeRegExp(frenchDateTime.FrenchDateTime.WeekDayRegex, "gis"); + this.dayOfWeek = frenchDateTime.FrenchDateTime.DayOfWeek; + this.ordinalExtractor = new recognizersTextNumber.FrenchOrdinalExtractor(); + this.integerExtractor = new recognizersTextNumber.FrenchIntegerExtractor(); + this.numberParser = new recognizersTextNumber.BaseNumberParser(new recognizersTextNumber.FrenchNumberParserConfiguration()); + this.durationExtractor = new baseDuration.BaseDurationExtractor(new durationConfiguration$4.FrenchDurationExtractorConfiguration()); + this.utilityConfiguration = new baseConfiguration$4.FrenchDateTimeUtilityConfiguration(); + this.nonDateUnitRegex = recognizersText.RegExpUtility.getSafeRegExp("(?heure|heures|hrs|secondes|seconde|secs|sec|minutes|minute|mins)\b", "gis"); + } +} +exports.FrenchDateExtractorConfiguration = FrenchDateExtractorConfiguration; +class FrenchDateParserConfiguration { + constructor(config) { + this.ordinalExtractor = config.ordinalExtractor; + this.integerExtractor = config.integerExtractor; + this.cardinalExtractor = config.cardinalExtractor; + this.durationExtractor = config.durationExtractor; + this.numberParser = config.numberParser; + this.durationParser = config.durationParser; + this.monthOfYear = config.monthOfYear; + this.dayOfMonth = config.dayOfMonth; + this.dayOfWeek = config.dayOfWeek; + this.unitMap = config.unitMap; + this.cardinalMap = config.cardinalMap; + this.dateRegex = new FrenchDateExtractorConfiguration().dateRegexList; + this.onRegex = recognizersText.RegExpUtility.getSafeRegExp(frenchDateTime.FrenchDateTime.OnRegex, "gis"); + this.specialDayRegex = recognizersText.RegExpUtility.getSafeRegExp(frenchDateTime.FrenchDateTime.SpecialDayRegex, "gis"); + this.specialDayWithNumRegex = recognizersText.RegExpUtility.getSafeRegExp(frenchDateTime.FrenchDateTime.SpecialDayWithNumRegex, "gis"); + this.nextRegex = recognizersText.RegExpUtility.getSafeRegExp(frenchDateTime.FrenchDateTime.NextDateRegex, "gis"); + this.unitRegex = recognizersText.RegExpUtility.getSafeRegExp(frenchDateTime.FrenchDateTime.DateUnitRegex, "gis"); + this.monthRegex = recognizersText.RegExpUtility.getSafeRegExp(frenchDateTime.FrenchDateTime.MonthRegex, "gis"); + this.weekDayRegex = recognizersText.RegExpUtility.getSafeRegExp(frenchDateTime.FrenchDateTime.WeekDayRegex, "gis"); + this.strictWeekDay = recognizersText.RegExpUtility.getSafeRegExp(frenchDateTime.FrenchDateTime.StrictWeekDay, "gis"); + this.lastRegex = recognizersText.RegExpUtility.getSafeRegExp(frenchDateTime.FrenchDateTime.LastDateRegex, "gis"); + this.thisRegex = recognizersText.RegExpUtility.getSafeRegExp(frenchDateTime.FrenchDateTime.ThisRegex, "gis"); + this.weekDayOfMonthRegex = recognizersText.RegExpUtility.getSafeRegExp(frenchDateTime.FrenchDateTime.WeekDayOfMonthRegex, "gis"); + this.forTheRegex = recognizersText.RegExpUtility.getSafeRegExp(frenchDateTime.FrenchDateTime.ForTheRegex, "gis"); + this.weekDayAndDayOfMonthRegex = recognizersText.RegExpUtility.getSafeRegExp(frenchDateTime.FrenchDateTime.WeekDayAndDayOfMonthRegex, "gis"); + this.relativeMonthRegex = recognizersText.RegExpUtility.getSafeRegExp(frenchDateTime.FrenchDateTime.RelativeMonthRegex, "gis"); + this.relativeWeekDayRegex = recognizersText.RegExpUtility.getSafeRegExp(frenchDateTime.FrenchDateTime.RelativeWeekDayRegex, "gis"); + this.utilityConfiguration = config.utilityConfiguration; + this.dateTokenPrefix = frenchDateTime.FrenchDateTime.DateTokenPrefix; + } + getSwiftDay(source) { + let trimedText = source.trim().toLowerCase(); + let swift = 0; + if (trimedText === "aujourd'hui" || trimedText === "auj") { + swift = 0; + } + else if (trimedText === "demain" || + trimedText.endsWith("a2m1") || + trimedText.endsWith("lendemain") || + trimedText.endsWith("jour suivant")) { + swift = 1; + } + else if (trimedText === "hier") { + swift = -1; + } + else if (trimedText.endsWith("après demain") || + trimedText.endsWith("après-demain")) { + swift = 2; + } + else if (trimedText.endsWith("avant-hier") || + trimedText.endsWith("avant hier")) { + swift = -2; + } + else if (trimedText.endsWith("dernier")) { + swift = -1; + } + return swift; + } + getSwiftMonth(source) { + let trimedText = source.trim().toLowerCase(); + let swift = 0; + if (trimedText.endsWith("prochaine") || trimedText.endsWith("prochain")) { + swift = 1; + } + else if (trimedText === "dernière" || + trimedText.endsWith("dernières") || + trimedText.endsWith("derniere") || + trimedText.endsWith("dernieres")) { + swift = -1; + } + return swift; + } + isCardinalLast(source) { + let trimedText = source.trim().toLowerCase(); + return (trimedText.endsWith("dernière") || + trimedText.endsWith("dernières") || + trimedText.endsWith("derniere") || + trimedText.endsWith("dernieres")); + } +} +exports.FrenchDateParserConfiguration = FrenchDateParserConfiguration; + +}); + +unwrapExports(dateConfiguration$4); + +var holidayConfiguration$4 = createCommonjsModule(function (module, exports) { +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); + + + + +class FrenchHolidayExtractorConfiguration { + constructor() { + this.holidayRegexes = [ + recognizersText.RegExpUtility.getSafeRegExp(frenchDateTime.FrenchDateTime.HolidayRegex1, "gis"), + recognizersText.RegExpUtility.getSafeRegExp(frenchDateTime.FrenchDateTime.HolidayRegex2, "gis"), + recognizersText.RegExpUtility.getSafeRegExp(frenchDateTime.FrenchDateTime.HolidayRegex3, "gis"), + recognizersText.RegExpUtility.getSafeRegExp(frenchDateTime.FrenchDateTime.HolidayRegex4, "gis") + ]; + } +} +exports.FrenchHolidayExtractorConfiguration = FrenchHolidayExtractorConfiguration; +class FrenchHolidayParserConfiguration extends baseHoliday.BaseHolidayParserConfiguration { + constructor() { + super(); + this.holidayRegexList = [ + recognizersText.RegExpUtility.getSafeRegExp(frenchDateTime.FrenchDateTime.HolidayRegex1, "gis"), + recognizersText.RegExpUtility.getSafeRegExp(frenchDateTime.FrenchDateTime.HolidayRegex2, "gis"), + recognizersText.RegExpUtility.getSafeRegExp(frenchDateTime.FrenchDateTime.HolidayRegex3, "gis"), + recognizersText.RegExpUtility.getSafeRegExp(frenchDateTime.FrenchDateTime.HolidayRegex4, "gis") + ]; + this.holidayNames = frenchDateTime.FrenchDateTime.HolidayNames; + this.holidayFuncDictionary = this.initHolidayFuncs(); + } + initHolidayFuncs() { + return new Map([ + ...super.initHolidayFuncs(), + ["maosbirthday", FrenchHolidayParserConfiguration.MaoBirthday], + ["yuandan", FrenchHolidayParserConfiguration.NewYear], + ["teachersday", FrenchHolidayParserConfiguration.TeacherDay], + ["singleday", FrenchHolidayParserConfiguration.SinglesDay], + ["allsaintsday", FrenchHolidayParserConfiguration.HalloweenDay], + ["youthday", FrenchHolidayParserConfiguration.YouthDay], + ["childrenday", FrenchHolidayParserConfiguration.ChildrenDay], + ["femaleday", FrenchHolidayParserConfiguration.FemaleDay], + ["treeplantingday", FrenchHolidayParserConfiguration.TreePlantDay], + ["arborday", FrenchHolidayParserConfiguration.TreePlantDay], + ["girlsday", FrenchHolidayParserConfiguration.GirlsDay], + ["whiteloverday", FrenchHolidayParserConfiguration.WhiteLoverDay], + ["loverday", FrenchHolidayParserConfiguration.ValentinesDay], + ["christmas", FrenchHolidayParserConfiguration.ChristmasDay], + ["xmas", FrenchHolidayParserConfiguration.ChristmasDay], + ["newyear", FrenchHolidayParserConfiguration.NewYear], + ["newyearday", FrenchHolidayParserConfiguration.NewYear], + ["newyearsday", FrenchHolidayParserConfiguration.NewYear], + ["inaugurationday", FrenchHolidayParserConfiguration.InaugurationDay], + ["groundhougday", FrenchHolidayParserConfiguration.GroundhogDay], + ["valentinesday", FrenchHolidayParserConfiguration.ValentinesDay], + ["stpatrickday", FrenchHolidayParserConfiguration.StPatrickDay], + ["aprilfools", FrenchHolidayParserConfiguration.FoolDay], + ["stgeorgeday", FrenchHolidayParserConfiguration.StGeorgeDay], + ["mayday", FrenchHolidayParserConfiguration.Mayday], + ["cincodemayoday", FrenchHolidayParserConfiguration.CincoDeMayoday], + ["baptisteday", FrenchHolidayParserConfiguration.BaptisteDay], + ["usindependenceday", FrenchHolidayParserConfiguration.UsaIndependenceDay], + ["independenceday", FrenchHolidayParserConfiguration.UsaIndependenceDay], + ["bastilleday", FrenchHolidayParserConfiguration.BastilleDay], + ["halloweenday", FrenchHolidayParserConfiguration.HalloweenDay], + ["allhallowday", FrenchHolidayParserConfiguration.AllHallowDay], + ["allsoulsday", FrenchHolidayParserConfiguration.AllSoulsday], + ["guyfawkesday", FrenchHolidayParserConfiguration.GuyFawkesDay], + ["veteransday", FrenchHolidayParserConfiguration.Veteransday], + ["christmaseve", FrenchHolidayParserConfiguration.ChristmasEve], + ["newyeareve", FrenchHolidayParserConfiguration.NewYearEve], + ["fathersday", FrenchHolidayParserConfiguration.FathersDay], + ["mothersday", FrenchHolidayParserConfiguration.MothersDay], + ["labourday", FrenchHolidayParserConfiguration.LabourDay] + ]); + } + // All JavaScript dates are zero-based (-1) + static NewYear(year) { return new Date(year, 1 - 1, 1); } + static NewYearEve(year) { return new Date(year, 12 - 1, 31); } + static ChristmasDay(year) { return new Date(year, 12 - 1, 25); } + static ChristmasEve(year) { return new Date(year, 12 - 1, 24); } + static FemaleDay(year) { return new Date(year, 3 - 1, 8); } + static ChildrenDay(year) { return new Date(year, 6 - 1, 1); } + static HalloweenDay(year) { return new Date(year, 10 - 1, 31); } + static EasterDay(year) { return utilities$2.DateUtils.minValue(); } + static ValentinesDay(year) { return new Date(year, 2, 14); } + static WhiteLoverDay(year) { return new Date(year, 3, 14); } + static FoolDay(year) { return new Date(year, 4, 1); } + static GirlsDay(year) { return new Date(year, 3, 7); } + static TreePlantDay(year) { return new Date(year, 3, 12); } + static YouthDay(year) { return new Date(year, 5, 4); } + static TeacherDay(year) { return new Date(year, 9, 10); } + static SinglesDay(year) { return new Date(year, 11, 11); } + static MaoBirthday(year) { return new Date(year, 12, 26); } + static InaugurationDay(year) { return new Date(year, 1, 20); } + static GroundhogDay(year) { return new Date(year, 2, 2); } + static StPatrickDay(year) { return new Date(year, 3, 17); } + static StGeorgeDay(year) { return new Date(year, 4, 23); } + static Mayday(year) { return new Date(year, 5, 1); } + static CincoDeMayoday(year) { return new Date(year, 5, 5); } + static BaptisteDay(year) { return new Date(year, 6, 24); } + static UsaIndependenceDay(year) { return new Date(year, 7, 4); } + static BastilleDay(year) { return new Date(year, 7, 14); } + static AllHallowDay(year) { return new Date(year, 11, 1); } + static AllSoulsday(year) { return new Date(year, 11, 2); } + static GuyFawkesDay(year) { return new Date(year, 11, 5); } + static Veteransday(year) { return new Date(year, 11, 11); } + static FathersDay(year) { return new Date(year, 6, 17); } + static MothersDay(year) { return new Date(year, 5, 27); } + static LabourDay(year) { return new Date(year, 5, 1); } + getSwiftYear(text) { + let trimedText = text.trim().toLowerCase(); + let swift = -10; + if (trimedText.endsWith("prochain")) { // next - 'l'annee prochain') + swift = 1; + } + else if (trimedText.endsWith("dernier")) { // last - 'l'annee dernier' + swift = -1; + } + else if (trimedText.startsWith("cette")) { // this - 'cette annees' + swift = 0; + } + return swift; + } + sanitizeHolidayToken(holiday) { + return holiday.replace(/ /g, "") + .replace(/'/g, ""); + } +} +exports.FrenchHolidayParserConfiguration = FrenchHolidayParserConfiguration; + +}); + +unwrapExports(holidayConfiguration$4); + +var setConfiguration$4 = createCommonjsModule(function (module, exports) { +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); + + + + + + + + + + + + + + + + +class FrenchSetExtractorConfiguration { + constructor() { + this.lastRegex = recognizersText.RegExpUtility.getSafeRegExp(frenchDateTime.FrenchDateTime.SetLastRegex, "gis"); + this.periodicRegex = recognizersText.RegExpUtility.getSafeRegExp(frenchDateTime.FrenchDateTime.PeriodicRegex, "gis"); + this.eachUnitRegex = recognizersText.RegExpUtility.getSafeRegExp(frenchDateTime.FrenchDateTime.EachUnitRegex, "gis"); + this.eachPrefixRegex = recognizersText.RegExpUtility.getSafeRegExp(frenchDateTime.FrenchDateTime.EachPrefixRegex, "gis"); + this.eachDayRegex = recognizersText.RegExpUtility.getSafeRegExp(frenchDateTime.FrenchDateTime.EachDayRegex, "gis"); + this.beforeEachDayRegex = null; + this.setEachRegex = recognizersText.RegExpUtility.getSafeRegExp(frenchDateTime.FrenchDateTime.SetEachRegex, "gis"); + this.setWeekDayRegex = recognizersText.RegExpUtility.getSafeRegExp(frenchDateTime.FrenchDateTime.SetWeekDayRegex, "gis"); + this.durationExtractor = new baseDuration.BaseDurationExtractor(new durationConfiguration$4.FrenchDurationExtractorConfiguration()); + this.timeExtractor = new baseTime.BaseTimeExtractor(new timeConfiguration$4.FrenchTimeExtractorConfiguration()); + this.dateExtractor = new baseDate.BaseDateExtractor(new dateConfiguration$4.FrenchDateExtractorConfiguration()); + this.dateTimeExtractor = new baseDateTime$2.BaseDateTimeExtractor(new dateTimeConfiguration$4.FrenchDateTimeExtractorConfiguration()); + this.datePeriodExtractor = new baseDatePeriod.BaseDatePeriodExtractor(new datePeriodConfiguration$4.FrenchDatePeriodExtractorConfiguration()); + this.timePeriodExtractor = new baseTimePeriod.BaseTimePeriodExtractor(new timePeriodConfiguration$4.FrenchTimePeriodExtractorConfiguration()); + this.dateTimePeriodExtractor = new baseDateTimePeriod.BaseDateTimePeriodExtractor(new dateTimePeriodConfiguration$4.FrenchDateTimePeriodExtractorConfiguration()); + } +} +exports.FrenchSetExtractorConfiguration = FrenchSetExtractorConfiguration; +class FrenchSetParserConfiguration { + constructor(config) { + this.durationExtractor = config.durationExtractor; + this.timeExtractor = config.timeExtractor; + this.dateExtractor = config.dateExtractor; + this.dateTimeExtractor = config.dateTimeExtractor; + this.datePeriodExtractor = config.datePeriodExtractor; + this.timePeriodExtractor = config.timePeriodExtractor; + this.dateTimePeriodExtractor = config.dateTimePeriodExtractor; + this.durationParser = config.durationParser; + this.timeParser = config.timeParser; + this.dateParser = config.dateParser; + this.dateTimeParser = config.dateTimeParser; + this.datePeriodParser = config.datePeriodParser; + this.timePeriodParser = config.timePeriodParser; + this.dateTimePeriodParser = config.dateTimePeriodParser; + this.unitMap = config.unitMap; + this.eachPrefixRegex = recognizersText.RegExpUtility.getSafeRegExp(frenchDateTime.FrenchDateTime.EachPrefixRegex, "gis"); + this.periodicRegex = recognizersText.RegExpUtility.getSafeRegExp(frenchDateTime.FrenchDateTime.PeriodicRegex, "gis"); + this.eachUnitRegex = recognizersText.RegExpUtility.getSafeRegExp(frenchDateTime.FrenchDateTime.EachUnitRegex, "gis"); + this.eachDayRegex = recognizersText.RegExpUtility.getSafeRegExp(frenchDateTime.FrenchDateTime.EachDayRegex, "gis"); + this.setWeekDayRegex = recognizersText.RegExpUtility.getSafeRegExp(frenchDateTime.FrenchDateTime.SetWeekDayRegex, "gis"); + this.setEachRegex = recognizersText.RegExpUtility.getSafeRegExp(frenchDateTime.FrenchDateTime.SetEachRegex, "gis"); + } + getMatchedDailyTimex(text) { + let trimedText = text.trim().toLowerCase(); + let timex = ""; + if (trimedText === "quotidien" || trimedText === "quotidienne" || + trimedText === "jours" || trimedText === "journellement") { + timex = "P1D"; + } + else if (trimedText === "hebdomadaire") { + timex = "P1W"; + } + else if (trimedText === "bihebdomadaire") { + timex = "P2W"; + } + else if (trimedText === "mensuel" || trimedText === "mensuelle") { + timex = "P1M"; + } + else if (trimedText === "annuel" || trimedText === "annuellement") { + timex = "P1Y"; + } + else { + timex = null; + return { + timex, + matched: false + }; + } + return { + timex, + matched: true + }; + } + getMatchedUnitTimex(text) { + let trimedText = text.trim().toLowerCase(); + let timex = ""; + if (trimedText === "jour" || trimedText === "journee") { + timex = "P1D"; + } + else if (trimedText === "semaine") { + timex = "P1W"; + } + else if (trimedText === "mois") { + timex = "P1M"; + } + else if (trimedText === "an" || trimedText === "annee") { + timex = "P1Y"; + } + else { + timex = null; + return { + matched: false, + timex + }; + } + return { + matched: true, + timex + }; + } +} +exports.FrenchSetParserConfiguration = FrenchSetParserConfiguration; + +}); + +unwrapExports(setConfiguration$4); + +var mergedConfiguration$4 = createCommonjsModule(function (module, exports) { +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); + + + + + + + + + + + + + + + + + + + + + + +class FrenchMergedExtractorConfiguration { + constructor() { + this.beforeRegex = recognizersText.RegExpUtility.getSafeRegExp(frenchDateTime.FrenchDateTime.BeforeRegex); + this.afterRegex = recognizersText.RegExpUtility.getSafeRegExp(frenchDateTime.FrenchDateTime.AfterRegex); + this.sinceRegex = recognizersText.RegExpUtility.getSafeRegExp(frenchDateTime.FrenchDateTime.SinceRegex); + this.fromToRegex = recognizersText.RegExpUtility.getSafeRegExp(frenchDateTime.FrenchDateTime.FromToRegex); + this.singleAmbiguousMonthRegex = recognizersText.RegExpUtility.getSafeRegExp(frenchDateTime.FrenchDateTime.SingleAmbiguousMonthRegex); + this.prepositionSuffixRegex = recognizersText.RegExpUtility.getSafeRegExp(frenchDateTime.FrenchDateTime.PrepositionSuffixRegex); + this.numberEndingPattern = recognizersText.RegExpUtility.getSafeRegExp(frenchDateTime.FrenchDateTime.NumberEndingPattern); + this.dateExtractor = new baseDate.BaseDateExtractor(new dateConfiguration$4.FrenchDateExtractorConfiguration()); + this.timeExtractor = new baseTime.BaseTimeExtractor(new timeConfiguration$4.FrenchTimeExtractorConfiguration()); + this.dateTimeExtractor = new baseDateTime$2.BaseDateTimeExtractor(new dateTimeConfiguration$4.FrenchDateTimeExtractorConfiguration()); + this.datePeriodExtractor = new baseDatePeriod.BaseDatePeriodExtractor(new datePeriodConfiguration$4.FrenchDatePeriodExtractorConfiguration()); + this.timePeriodExtractor = new baseTimePeriod.BaseTimePeriodExtractor(new timePeriodConfiguration$4.FrenchTimePeriodExtractorConfiguration()); + this.dateTimePeriodExtractor = new baseDateTimePeriod.BaseDateTimePeriodExtractor(new dateTimePeriodConfiguration$4.FrenchDateTimePeriodExtractorConfiguration()); + this.durationExtractor = new baseDuration.BaseDurationExtractor(new durationConfiguration$4.FrenchDurationExtractorConfiguration()); + this.setExtractor = new baseSet.BaseSetExtractor(new setConfiguration$4.FrenchSetExtractorConfiguration()); + this.holidayExtractor = new baseHoliday.BaseHolidayExtractor(new holidayConfiguration$4.FrenchHolidayExtractorConfiguration()); + this.integerExtractor = new recognizersTextNumber.FrenchIntegerExtractor(); + this.filterWordRegexList = []; + } +} +exports.FrenchMergedExtractorConfiguration = FrenchMergedExtractorConfiguration; +class FrenchMergedParserConfiguration extends baseConfiguration$4.FrenchCommonDateTimeParserConfiguration { + constructor() { + super(); + this.beforeRegex = recognizersText.RegExpUtility.getSafeRegExp(frenchDateTime.FrenchDateTime.BeforeRegex); + this.afterRegex = recognizersText.RegExpUtility.getSafeRegExp(frenchDateTime.FrenchDateTime.AfterRegex); + this.sinceRegex = recognizersText.RegExpUtility.getSafeRegExp(frenchDateTime.FrenchDateTime.SinceRegex); + this.datePeriodParser = new baseDatePeriod.BaseDatePeriodParser(new datePeriodConfiguration$4.FrenchDatePeriodParserConfiguration(this)); + this.timePeriodParser = new baseTimePeriod.BaseTimePeriodParser(new timePeriodConfiguration$4.FrenchTimePeriodParserConfiguration(this)); + this.setParser = new baseSet.BaseSetParser(new setConfiguration$4.FrenchSetParserConfiguration(this)); + this.holidayParser = new baseHoliday.BaseHolidayParser(new holidayConfiguration$4.FrenchHolidayParserConfiguration()); + } +} +exports.FrenchMergedParserConfiguration = FrenchMergedParserConfiguration; + +}); + +unwrapExports(mergedConfiguration$4); + +var chineseDateTime = createCommonjsModule(function (module, exports) { +"use strict"; +// ------------------------------------------------------------------------------ +// +// This code was generated by a tool. +// Changes to this file may cause incorrect behavior and will be lost if +// the code is regenerated. +// +// ------------------------------------------------------------------------------ +Object.defineProperty(exports, "__esModule", { value: true }); + +var ChineseDateTime; +(function (ChineseDateTime) { + ChineseDateTime.MonthRegex = `(?正月|一月|二月|三月|四月|五月|六月|七月|八月|九月|十月|十一月|十二月|01月|02月|03月|04月|05月|06月|07月|08月|09月|10月|11月|12月|1月|2月|3月|4月|5月|6月|7月|8月|9月|大年)`; + ChineseDateTime.DayRegex = `(?01|02|03|04|05|06|07|08|09|10|11|12|13|14|15|16|17|18|19|20|21|22|23|24|25|26|27|28|29|30|31|1|2|3|4|5|6|7|8|9)`; + ChineseDateTime.DateDayRegexInChinese = `(?初一|三十|一日|十一日|二十一日|三十一日|二日|三日|四日|五日|六日|七日|八日|九日|十二日|十三日|十四日|十五日|十六日|十七日|十八日|十九日|二十二日|二十三日|二十四日|二十五日|二十六日|二十七日|二十八日|二十九日|一日|十一日|十日|二十一日|二十日|三十一日|三十日|二日|三日|四日|五日|六日|七日|八日|九日|十二日|十三日|十四日|十五日|十六日|十七日|十八日|十九日|二十二日|二十三日|二十四日|二十五日|二十六日|二十七日|二十八日|二十九日|十日|二十日|三十日|10日|11日|12日|13日|14日|15日|16日|17日|18日|19日|1日|20日|21日|22日|23日|24日|25日|26日|27日|28日|29日|2日|30日|31日|3日|4日|5日|6日|7日|8日|9日|一号|十一号|二十一号|三十一号|二号|三号|四号|五号|六号|七号|八号|九号|十二号|十三号|十四号|十五号|十六号|十七号|十八号|十九号|二十二号|二十三号|二十四号|二十五号|二十六号|二十七号|二十八号|二十九号|一号|十一号|十号|二十一号|二十号|三十一号|三十号|二号|三号|四号|五号|六号|七号|八号|九号|十二号|十三号|十四号|十五号|十六号|十七号|十八号|十九号|二十二号|二十三号|二十四号|二十五号|二十六号|二十七号|二十八号|二十九号|十号|二十号|三十号|10号|11号|12号|13号|14号|15号|16号|17号|18号|19号|1号|20号|21号|22号|23号|24号|25号|26号|27号|28号|29号|2号|30号|31号|3号|4号|5号|6号|7号|8号|9号)`; + ChineseDateTime.DayRegexNumInChinese = `(?一|十一|二十一|三十一|二|三|四|五|六|七|八|九|十二|十三|十四|十五|十六|十七|十八|十九|二十二|二十三|二十四|二十五|二十六|二十七|二十八|二十九|一|十一|十|二十一|二十|三十一|三十|二|三|四|五|六|七|八|九|十二|十三|十四|十五|十六|十七|十八|十九|二十二|二十三|二十四|二十五|二十六|二十七|二十八|二十九|十|二十|廿|卅)`; + ChineseDateTime.MonthNumRegex = `(?01|02|03|04|05|06|07|08|09|10|11|12|1|2|3|4|5|6|7|8|9)`; + ChineseDateTime.TwoNumYear = '50'; + ChineseDateTime.YearNumRegex = `(?((1[5-9]|20)\\d{2})|2100)`; + ChineseDateTime.YearRegex = `(?(\\d{2,4}))`; + ChineseDateTime.ZeroToNineIntegerRegexChs = `[一二三四五六七八九零壹贰叁肆伍陆柒捌玖〇两千俩倆仨]`; + ChineseDateTime.DateYearInChineseRegex = `(?(${ChineseDateTime.ZeroToNineIntegerRegexChs}${ChineseDateTime.ZeroToNineIntegerRegexChs}${ChineseDateTime.ZeroToNineIntegerRegexChs}${ChineseDateTime.ZeroToNineIntegerRegexChs}|${ChineseDateTime.ZeroToNineIntegerRegexChs}${ChineseDateTime.ZeroToNineIntegerRegexChs}|${ChineseDateTime.ZeroToNineIntegerRegexChs}${ChineseDateTime.ZeroToNineIntegerRegexChs}${ChineseDateTime.ZeroToNineIntegerRegexChs}))`; + ChineseDateTime.WeekDayRegex = `(?周日|周天|周一|周二|周三|周四|周五|周六|星期一|星期二|星期三|星期四|星期五|星期六|星期日|星期天|礼拜一|礼拜二|礼拜三|礼拜四|礼拜五|礼拜六|礼拜日|礼拜天|禮拜一|禮拜二|禮拜三|禮拜四|禮拜五|禮拜六|禮拜日|禮拜天|週日|週天|週一|週二|週三|週四|週五|週六)`; + ChineseDateTime.LunarRegex = `(农历|初一|正月|大年)`; + ChineseDateTime.DateThisRegex = `(这个|这一个|这|这一|本)${ChineseDateTime.WeekDayRegex}`; + ChineseDateTime.DateLastRegex = `(上一个|上个|上一|上|最后一个|最后)(的)?${ChineseDateTime.WeekDayRegex}`; + ChineseDateTime.DateNextRegex = `(下一个|下个|下一|下)(的)?${ChineseDateTime.WeekDayRegex}`; + ChineseDateTime.SpecialDayRegex = `(最近|前天|后天|昨天|明天|今天|今日|明日|昨日|大后天|大前天|後天|大後天)`; + ChineseDateTime.SpecialDayWithNumRegex = `^[.]`; + ChineseDateTime.WeekDayOfMonthRegex = `(((${ChineseDateTime.MonthRegex}|${ChineseDateTime.MonthNumRegex})的\\s*)(?第一个|第二个|第三个|第四个|第五个|最后一个)\\s*${ChineseDateTime.WeekDayRegex})`; + ChineseDateTime.DateThisRe = `这个|这一个|这|这一|本|今`; + ChineseDateTime.DateLastRe = `上个|上一个|上|上一|去`; + ChineseDateTime.DateNextRe = `下个|下一个|下|下一|明`; + ChineseDateTime.SpecialDate = `(?(${ChineseDateTime.DateThisRe}|${ChineseDateTime.DateLastRe}|${ChineseDateTime.DateNextRe})年)?(?(${ChineseDateTime.DateThisRe}|${ChineseDateTime.DateLastRe}|${ChineseDateTime.DateNextRe})月)?${ChineseDateTime.DateDayRegexInChinese}`; + ChineseDateTime.DateUnitRegex = `(?年|个月|周|日|天)`; + ChineseDateTime.BeforeRegex = `以前|之前|前`; + ChineseDateTime.AfterRegex = `以后|以後|之后|之後|后|後`; + ChineseDateTime.DateRegexList1 = `(${ChineseDateTime.LunarRegex}(\\s*))?(((${ChineseDateTime.YearRegex}|${ChineseDateTime.DateYearInChineseRegex})年)(\\s*))?${ChineseDateTime.MonthRegex}(\\s*)${ChineseDateTime.DateDayRegexInChinese}((\\s*|,|,)${ChineseDateTime.WeekDayRegex})?(${ChineseDateTime.BeforeRegex}|${ChineseDateTime.AfterRegex})?`; + ChineseDateTime.DateRegexList2 = `(((${ChineseDateTime.YearRegex}|${ChineseDateTime.DateYearInChineseRegex})年)(\\s*))?(${ChineseDateTime.LunarRegex}(\\s*))?${ChineseDateTime.MonthRegex}(\\s*)${ChineseDateTime.DateDayRegexInChinese}((\\s*|,|,)${ChineseDateTime.WeekDayRegex})?(${ChineseDateTime.BeforeRegex}|${ChineseDateTime.AfterRegex})?`; + ChineseDateTime.DateRegexList3 = `(((${ChineseDateTime.YearRegex}|${ChineseDateTime.DateYearInChineseRegex})年)(\\s*))?(${ChineseDateTime.LunarRegex}(\\s*))?${ChineseDateTime.MonthRegex}(\\s*)(${ChineseDateTime.DayRegexNumInChinese}|${ChineseDateTime.DayRegex})((\\s*|,|,)${ChineseDateTime.WeekDayRegex})?(${ChineseDateTime.BeforeRegex}|${ChineseDateTime.AfterRegex})?`; + ChineseDateTime.DateRegexList4 = `${ChineseDateTime.MonthNumRegex}\\s*/\\s*${ChineseDateTime.DayRegex}((\\s+|\\s*,\\s*)${ChineseDateTime.YearRegex})?`; + ChineseDateTime.DateRegexList5 = `${ChineseDateTime.DayRegex}\\s*/\\s*${ChineseDateTime.MonthNumRegex}((\\s+|\\s*,\\s*)${ChineseDateTime.YearRegex})?`; + ChineseDateTime.DateRegexList6 = `${ChineseDateTime.MonthNumRegex}\\s*[/\\\\\\-]\\s*${ChineseDateTime.DayRegex}\\s*[/\\\\\\-]\\s*${ChineseDateTime.YearRegex}`; + ChineseDateTime.DateRegexList7 = `${ChineseDateTime.DayRegex}\\s*[/\\\\\\-\\.]\\s*${ChineseDateTime.MonthNumRegex}\\s*[/\\\\\\-\\.]\\s*${ChineseDateTime.YearNumRegex}`; + ChineseDateTime.DateRegexList8 = `${ChineseDateTime.YearNumRegex}\\s*[/\\\\\\-\\. ]\\s*${ChineseDateTime.MonthNumRegex}\\s*[/\\\\\\-\\. ]\\s*${ChineseDateTime.DayRegex}`; + ChineseDateTime.DatePeriodTillRegex = `(?到|至|--|-|—|——|~|–)`; + ChineseDateTime.DatePeriodTillSuffixRequiredRegex = `(?与|和)`; + ChineseDateTime.DatePeriodDayRegexInChinese = `(?初一|三十|一日|十一日|二十一日|三十一日|二日|三日|四日|五日|六日|七日|八日|九日|十二日|十三日|十四日|十五日|十六日|十七日|十八日|十九日|二十二日|二十三日|二十四日|二十五日|二十六日|二十七日|二十八日|二十九日|一日|十一日|十日|二十一日|二十日|三十一日|三十日|二日|三日|四日|五日|六日|七日|八日|九日|十二日|十三日|十四日|十五日|十六日|十七日|十八日|十九日|二十二日|二十三日|二十四日|二十五日|二十六日|二十七日|二十八日|二十九日|十日|二十日|三十日|10日|11日|12日|13日|14日|15日|16日|17日|18日|19日|1日|20日|21日|22日|23日|24日|25日|26日|27日|28日|29日|2日|30日|31日|3日|4日|5日|6日|7日|8日|9日|一号|十一号|二十一号|三十一号|二号|三号|四号|五号|六号|七号|八号|九号|十二号|十三号|十四号|十五号|十六号|十七号|十八号|十九号|二十二号|二十三号|二十四号|二十五号|二十六号|二十七号|二十八号|二十九号|一号|十一号|十号|二十一号|二十号|三十一号|三十号|二号|三号|四号|五号|六号|七号|八号|九号|十二号|十三号|十四号|十五号|十六号|十七号|十八号|十九号|二十二号|二十三号|二十四号|二十五号|二十六号|二十七号|二十八号|二十九号|十号|二十号|三十号|10号|11号|12号|13号|14号|15号|16号|17号|18号|19号|1号|20号|21号|22号|23号|24号|25号|26号|27号|28号|29号|2号|30号|31号|3号|4号|5号|6号|7号|8号|9号|一|十一|二十一|三十一|二|三|四|五|六|七|八|九|十二|十三|十四|十五|十六|十七|十八|十九|二十二|二十三|二十四|二十五|二十六|二十七|二十八|二十九|一|十一|十|二十一|二十|三十一|三十|二|三|四|五|六|七|八|九|十二|十三|十四|十五|十六|十七|十八|十九|二十二|二十三|二十四|二十五|二十六|二十七|二十八|二十九|十|二十|三十||廿|卅)`; + ChineseDateTime.DatePeriodThisRegex = `这个|这一个|这|这一|本`; + ChineseDateTime.DatePeriodLastRegex = `上个|上一个|上|上一`; + ChineseDateTime.DatePeriodNextRegex = `下个|下一个|下|下一`; + ChineseDateTime.RelativeMonthRegex = `(?(${ChineseDateTime.DatePeriodThisRegex}|${ChineseDateTime.DatePeriodLastRegex}|${ChineseDateTime.DatePeriodNextRegex})\\s*月)`; + ChineseDateTime.DatePeriodYearRegex = `((${ChineseDateTime.YearNumRegex})(\\s*年)?|(${ChineseDateTime.YearRegex})\\s*年)(?=[\\u4E00-\\u9FFF]|\\s|$|\\W)`; + ChineseDateTime.StrictYearRegex = `${ChineseDateTime.DatePeriodYearRegex}`; + ChineseDateTime.YearRegexInNumber = `(?(\\d{3,4}))`; + ChineseDateTime.DatePeriodYearInChineseRegex = `(?(${ChineseDateTime.ZeroToNineIntegerRegexChs}${ChineseDateTime.ZeroToNineIntegerRegexChs}${ChineseDateTime.ZeroToNineIntegerRegexChs}${ChineseDateTime.ZeroToNineIntegerRegexChs}|${ChineseDateTime.ZeroToNineIntegerRegexChs}${ChineseDateTime.ZeroToNineIntegerRegexChs}|${ChineseDateTime.ZeroToNineIntegerRegexChs}${ChineseDateTime.ZeroToNineIntegerRegexChs}${ChineseDateTime.ZeroToNineIntegerRegexChs}))年`; + ChineseDateTime.MonthSuffixRegex = `(?(${ChineseDateTime.RelativeMonthRegex}|${ChineseDateTime.MonthRegex}))`; + ChineseDateTime.SimpleCasesRegex = `((从)\\s*)?((${ChineseDateTime.DatePeriodYearRegex}|${ChineseDateTime.DatePeriodYearInChineseRegex})\\s*)?${ChineseDateTime.MonthSuffixRegex}(${ChineseDateTime.DatePeriodDayRegexInChinese}|${ChineseDateTime.DayRegex})\\s*${ChineseDateTime.DatePeriodTillRegex}\\s*(${ChineseDateTime.DatePeriodDayRegexInChinese}|${ChineseDateTime.DayRegex})((\\s+|\\s*,\\s*)${ChineseDateTime.DatePeriodYearRegex})?`; + ChineseDateTime.YearAndMonth = `(${ChineseDateTime.DatePeriodYearInChineseRegex}|${ChineseDateTime.DatePeriodYearRegex})${ChineseDateTime.MonthRegex}`; + ChineseDateTime.PureNumYearAndMonth = `(${ChineseDateTime.YearRegexInNumber}\\s*[-\\.\\/]\\s*${ChineseDateTime.MonthNumRegex})|(${ChineseDateTime.MonthNumRegex}\\s*\\/\\s*${ChineseDateTime.YearRegexInNumber})`; + ChineseDateTime.OneWordPeriodRegex = `(((明年|今年|去年)\\s*)?${ChineseDateTime.MonthRegex}|(${ChineseDateTime.DatePeriodThisRegex}|${ChineseDateTime.DatePeriodLastRegex}|${ChineseDateTime.DatePeriodNextRegex})\\s*(周末|周|月|年)|周末|今年|明年|去年|前年|后年)`; + ChineseDateTime.WeekOfMonthRegex = `(?${ChineseDateTime.MonthSuffixRegex}的(?第一|第二|第三|第四|第五|最后一)\\s*周\\s*)`; + ChineseDateTime.UnitRegex = `(?年|(个)?月|周|日|天)`; + ChineseDateTime.FollowedUnit = `^\\s*${ChineseDateTime.UnitRegex}`; + ChineseDateTime.NumberCombinedWithUnit = `(?\\d+(\\.\\d*)?)${ChineseDateTime.UnitRegex}`; + ChineseDateTime.DateRangePrepositions = `((从|在|自)\\s*)?`; + ChineseDateTime.YearToYear = `(${ChineseDateTime.DateRangePrepositions})(${ChineseDateTime.DatePeriodYearInChineseRegex}|${ChineseDateTime.DatePeriodYearRegex})\\s*(${ChineseDateTime.DatePeriodTillRegex}|后|後|之后|之後)\\s*(${ChineseDateTime.DatePeriodYearInChineseRegex}|${ChineseDateTime.DatePeriodYearRegex})(\\s*((之间|之内|期间|中间|间)|前|之前))?`; + ChineseDateTime.YearToYearSuffixRequired = `(${ChineseDateTime.DateRangePrepositions})(${ChineseDateTime.DatePeriodYearInChineseRegex}|${ChineseDateTime.DatePeriodYearRegex})\\s*(${ChineseDateTime.DatePeriodTillSuffixRequiredRegex})\\s*(${ChineseDateTime.DatePeriodYearInChineseRegex}|${ChineseDateTime.DatePeriodYearRegex})\\s*(之间|之内|期间|中间|间)`; + ChineseDateTime.MonthToMonth = `(${ChineseDateTime.DateRangePrepositions})(${ChineseDateTime.MonthRegex})${ChineseDateTime.DatePeriodTillRegex}(${ChineseDateTime.MonthRegex})`; + ChineseDateTime.MonthToMonthSuffixRequired = `(${ChineseDateTime.DateRangePrepositions})(${ChineseDateTime.MonthRegex})${ChineseDateTime.DatePeriodTillSuffixRequiredRegex}(${ChineseDateTime.MonthRegex})\\s*(之间|之内|期间|中间|间)`; + ChineseDateTime.PastRegex = `(?(前|上|之前|近|过去))`; + ChineseDateTime.FutureRegex = `(?(后|後|(?春|夏|秋|冬)(天|季)?`; + ChineseDateTime.SeasonWithYear = `((${ChineseDateTime.DatePeriodYearRegex}|${ChineseDateTime.DatePeriodYearInChineseRegex}|(?明年|今年|去年))(的)?)?${ChineseDateTime.SeasonRegex}`; + ChineseDateTime.QuarterRegex = `((${ChineseDateTime.DatePeriodYearRegex}|${ChineseDateTime.DatePeriodYearInChineseRegex}|(?明年|今年|去年))(的)?)?(第(?1|2|3|4|一|二|三|四)季度)`; + ChineseDateTime.CenturyRegex = `(?\\d|1\\d|2\\d)世纪`; + ChineseDateTime.CenturyRegexInChinese = `(?一|二|三|四|五|六|七|八|九|十|十一|十二|十三|十四|十五|十六|十七|十八|十九|二十|二十一|二十二)世纪`; + ChineseDateTime.RelativeCenturyRegex = `(?(${ChineseDateTime.DatePeriodLastRegex}|${ChineseDateTime.DatePeriodThisRegex}|${ChineseDateTime.DatePeriodNextRegex}))世纪`; + ChineseDateTime.DecadeRegexInChinese = `(?十|一十|二十|三十|四十|五十|六十|七十|八十|九十)`; + ChineseDateTime.DecadeRegex = `(?(${ChineseDateTime.CenturyRegex}|${ChineseDateTime.CenturyRegexInChinese}|${ChineseDateTime.RelativeCenturyRegex}))?(?(\\d0|${ChineseDateTime.DecadeRegexInChinese}))年代`; + ChineseDateTime.PrepositionRegex = `(?^的|在$)`; + ChineseDateTime.NowRegex = `(?现在|马上|立刻|刚刚才|刚刚|刚才)`; + ChineseDateTime.NightRegex = `(?早|晚)`; + ChineseDateTime.TimeOfTodayRegex = `(今晚|今早|今晨|明晚|明早|明晨|昨晚)(的|在)?`; + ChineseDateTime.DateTimePeriodTillRegex = `(?到|直到|--|-|—|——)`; + ChineseDateTime.DateTimePeriodPrepositionRegex = `(?^\\s*的|在\\s*$)`; + ChineseDateTime.HourRegex = `\\b${baseDateTime.BaseDateTime.HourRegex}`; + ChineseDateTime.HourNumRegex = `(?[零〇一二两三四五六七八九]|二十[一二三四]?|十[一二三四五六七八九]?)`; + ChineseDateTime.ZhijianRegex = `^\\s*(之间|之内|期间|中间|间)`; + ChineseDateTime.DateTimePeriodThisRegex = `这个|这一个|这|这一`; + ChineseDateTime.DateTimePeriodLastRegex = `上个|上一个|上|上一`; + ChineseDateTime.DateTimePeriodNextRegex = `下个|下一个|下|下一`; + ChineseDateTime.AmPmDescRegex = `(?(am|a\\.m\\.|a m|a\\. m\\.|a\\.m|a\\. m|a m|pm|p\\.m\\.|p m|p\\. m\\.|p\\.m|p\\. m|p m))`; + ChineseDateTime.TimeOfDayRegex = `(?凌晨|清晨|早上|早|上午|中午|下午|午后|晚上|夜里|夜晚|半夜|夜间|深夜|傍晚|晚)`; + ChineseDateTime.SpecificTimeOfDayRegex = `(((${ChineseDateTime.DateTimePeriodThisRegex}|${ChineseDateTime.DateTimePeriodNextRegex}|${ChineseDateTime.DateTimePeriodLastRegex})\\s+${ChineseDateTime.TimeOfDayRegex})|(今晚|今早|今晨|明晚|明早|明晨|昨晚))`; + ChineseDateTime.DateTimePeriodUnitRegex = `(个)?(?(小时|分钟|秒钟|时|分|秒))`; + ChineseDateTime.DateTimePeriodFollowedUnit = `^\\s*${ChineseDateTime.DateTimePeriodUnitRegex}`; + ChineseDateTime.DateTimePeriodNumberCombinedWithUnit = `\\b(?\\d+(\\.\\d*)?)${ChineseDateTime.DateTimePeriodUnitRegex}`; + ChineseDateTime.DurationYearRegex = `((\\d{3,4})|0\\d|两千)\\s*年`; + ChineseDateTime.DurationHalfSuffixRegex = `半`; + ChineseDateTime.DurationSuffixList = new Map([["M", "分钟"], ["S", "秒钟|秒"], ["H", "个小时|小时"], ["D", "天"], ["W", "星期|个星期|周"], ["Mon", "个月"], ["Y", "年"]]); + ChineseDateTime.DurationAmbiguousUnits = ['分钟', '秒钟', '秒', '个小时', '小时', '天', '星期', '个星期', '周', '个月', '年']; + ChineseDateTime.LunarHolidayRegex = `((${ChineseDateTime.DatePeriodYearRegex}|${ChineseDateTime.DatePeriodYearInChineseRegex}|(?明年|今年|去年))(的)?)?(?除夕|春节|中秋节|中秋|元宵节|端午节|端午|重阳节)`; + ChineseDateTime.HolidayRegexList1 = `((${ChineseDateTime.DatePeriodYearRegex}|${ChineseDateTime.DatePeriodYearInChineseRegex}|(?明年|今年|去年))(的)?)?(?新年|五一|劳动节|元旦节|元旦|愚人节|圣诞节|植树节|国庆节|情人节|教师节|儿童节|妇女节|青年节|建军节|女生节|光棍节|双十一|清明节|清明)`; + ChineseDateTime.HolidayRegexList2 = `((${ChineseDateTime.DatePeriodYearRegex}|${ChineseDateTime.DatePeriodYearInChineseRegex}|(?明年|今年|去年))(的)?)?(?母亲节|父亲节|感恩节|万圣节)`; + ChineseDateTime.SetUnitRegex = `(?年|月|周|星期|日|天|小时|时|分钟|分|秒钟|秒)`; + ChineseDateTime.SetEachUnitRegex = `(?(每个|每一|每)\\s*${ChineseDateTime.SetUnitRegex})`; + ChineseDateTime.SetEachPrefixRegex = `(?(每)\\s*$)`; + ChineseDateTime.SetLastRegex = `(?last|this|next)`; + ChineseDateTime.SetEachDayRegex = `(每|每一)(天|日)\\s*$`; + ChineseDateTime.TimeHourNumRegex = `(00|01|02|03|04|05|06|07|08|09|0|10|11|12|13|14|15|16|17|18|19|20|21|22|23|24|1|2|3|4|5|6|7|8|9)`; + ChineseDateTime.TimeMinuteNumRegex = `(00|01|02|03|04|05|06|07|08|09|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|0|1|2|3|4|5|6|7|8|9)`; + ChineseDateTime.TimeSecondNumRegex = `(00|01|02|03|04|05|06|07|08|09|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|0|1|2|3|4|5|6|7|8|9)`; + ChineseDateTime.TimeHourChsRegex = `([零〇一二两三四五六七八九]|二十[一二三四]?|十[一二三四五六七八九]?)`; + ChineseDateTime.TimeMinuteChsRegex = `([二三四五]?十[一二三四五六七八九]?|六十|[零〇一二三四五六七八九])`; + ChineseDateTime.TimeSecondChsRegex = `${ChineseDateTime.TimeMinuteChsRegex}`; + ChineseDateTime.TimeClockDescRegex = `(点\\s*整|点\\s*钟|点|时)`; + ChineseDateTime.TimeMinuteDescRegex = `(分钟|分|)`; + ChineseDateTime.TimeSecondDescRegex = `(秒钟|秒)`; + ChineseDateTime.TimeBanHourPrefixRegex = `(第)`; + ChineseDateTime.TimeHourRegex = `(?${ChineseDateTime.TimeHourChsRegex}|${ChineseDateTime.TimeHourNumRegex})${ChineseDateTime.TimeClockDescRegex}`; + ChineseDateTime.TimeMinuteRegex = `(?${ChineseDateTime.TimeMinuteChsRegex}|${ChineseDateTime.TimeMinuteNumRegex})${ChineseDateTime.TimeMinuteDescRegex}`; + ChineseDateTime.TimeSecondRegex = `(?${ChineseDateTime.TimeSecondChsRegex}|${ChineseDateTime.TimeSecondNumRegex})${ChineseDateTime.TimeSecondDescRegex}`; + ChineseDateTime.TimeHalfRegex = `(?过半|半)`; + ChineseDateTime.TimeQuarterRegex = `(?[一两二三四1-4])\\s*(刻钟|刻)`; + ChineseDateTime.TimeChineseTimeRegex = `${ChineseDateTime.TimeHourRegex}(${ChineseDateTime.TimeQuarterRegex}|${ChineseDateTime.TimeHalfRegex}|((过|又)?${ChineseDateTime.TimeMinuteRegex})(${ChineseDateTime.TimeSecondRegex})?)?`; + ChineseDateTime.TimeDigitTimeRegex = `(?${ChineseDateTime.TimeHourNumRegex}):(?${ChineseDateTime.TimeMinuteNumRegex})(:(?${ChineseDateTime.TimeSecondNumRegex}))?`; + ChineseDateTime.TimeDayDescRegex = `(?凌晨|清晨|早上|早|上午|中午|下午|午后|晚上|夜里|夜晚|半夜|午夜|夜间|深夜|傍晚|晚)`; + ChineseDateTime.TimeApproximateDescPreffixRegex = `(大[约概]|差不多|可能|也许|约|不超过|不多[于过]|最[多长少]|少于|[超短长多]过|几乎要|将近|差点|快要|接近|至少|起码|超出|不到)`; + ChineseDateTime.TimeApproximateDescSuffixRegex = `(之前|以前|以后|以後|之后|之後|前|后|後|左右)`; + ChineseDateTime.TimeRegexes1 = `${ChineseDateTime.TimeApproximateDescPreffixRegex}?${ChineseDateTime.TimeDayDescRegex}?${ChineseDateTime.TimeChineseTimeRegex}${ChineseDateTime.TimeApproximateDescSuffixRegex}?`; + ChineseDateTime.TimeRegexes2 = `${ChineseDateTime.TimeApproximateDescPreffixRegex}?${ChineseDateTime.TimeDayDescRegex}?${ChineseDateTime.TimeDigitTimeRegex}${ChineseDateTime.TimeApproximateDescSuffixRegex}?(\\s*${ChineseDateTime.AmPmDescRegex}?)`; + ChineseDateTime.TimeRegexes3 = `差${ChineseDateTime.TimeMinuteRegex}${ChineseDateTime.TimeChineseTimeRegex}`; + ChineseDateTime.TimePeriodTimePeriodConnectWords = `(起|至|到|–|-|—|~|~)`; + ChineseDateTime.TimePeriodLeftChsTimeRegex = `(从)?(?${ChineseDateTime.TimeDayDescRegex}?(${ChineseDateTime.TimeChineseTimeRegex}))`; + ChineseDateTime.TimePeriodRightChsTimeRegex = `${ChineseDateTime.TimePeriodTimePeriodConnectWords}(?${ChineseDateTime.TimeDayDescRegex}?${ChineseDateTime.TimeChineseTimeRegex})(之间)?`; + ChineseDateTime.TimePeriodLeftDigitTimeRegex = `(从)?(?${ChineseDateTime.TimeDayDescRegex}?(${ChineseDateTime.TimeDigitTimeRegex}))`; + ChineseDateTime.TimePeriodRightDigitTimeRegex = `${ChineseDateTime.TimePeriodTimePeriodConnectWords}(?${ChineseDateTime.TimeDayDescRegex}?${ChineseDateTime.TimeDigitTimeRegex})(之间)?`; + ChineseDateTime.TimePeriodShortLeftChsTimeRegex = `(从)?(?${ChineseDateTime.TimeDayDescRegex}?(${ChineseDateTime.TimeHourChsRegex}))`; + ChineseDateTime.TimePeriodShortLeftDigitTimeRegex = `(从)?(?${ChineseDateTime.TimeDayDescRegex}?(${ChineseDateTime.TimeHourNumRegex}))`; + ChineseDateTime.TimePeriodRegexes1 = `(${ChineseDateTime.TimePeriodLeftDigitTimeRegex}${ChineseDateTime.TimePeriodRightDigitTimeRegex}|${ChineseDateTime.TimePeriodLeftChsTimeRegex}${ChineseDateTime.TimePeriodRightChsTimeRegex})`; + ChineseDateTime.TimePeriodRegexes2 = `(${ChineseDateTime.TimePeriodShortLeftDigitTimeRegex}${ChineseDateTime.TimePeriodRightDigitTimeRegex}|${ChineseDateTime.TimePeriodShortLeftChsTimeRegex}${ChineseDateTime.TimePeriodRightChsTimeRegex})`; + ChineseDateTime.ParserConfigurationBefore = `(之前|以前|前)`; + ChineseDateTime.ParserConfigurationAfter = `(之后|之後|以后|以後|后|後)`; + ChineseDateTime.ParserConfigurationUntil = `(直到|直至|截至|截止(到)?)`; + ChineseDateTime.ParserConfigurationSincePrefix = `(自从|自|自打|打)`; + ChineseDateTime.ParserConfigurationSinceSuffix = `(以来|开始)`; + ChineseDateTime.ParserConfigurationLastWeekDayToken = '最后一个'; + ChineseDateTime.ParserConfigurationNextMonthToken = '下一个'; + ChineseDateTime.ParserConfigurationLastMonthToken = '上一个'; + ChineseDateTime.ParserConfigurationDatePrefix = ' '; + ChineseDateTime.ParserConfigurationUnitMap = new Map([["年", "Y"], ["月", "MON"], ["个月", "MON"], ["日", "D"], ["周", "W"], ["天", "D"], ["小时", "H"], ["时", "H"], ["分钟", "M"], ["分", "M"], ["秒钟", "S"], ["秒", "S"], ["星期", "W"]]); + ChineseDateTime.ParserConfigurationUnitValueMap = new Map([["years", 31536000], ["year", 31536000], ["months", 2592000], ["month", 2592000], ["weeks", 604800], ["week", 604800], ["days", 86400], ["day", 86400], ["hours", 3600], ["hour", 3600], ["hrs", 3600], ["hr", 3600], ["h", 3600], ["minutes", 60], ["minute", 60], ["mins", 60], ["min", 60], ["seconds", 1], ["second", 1], ["secs", 1], ["sec", 1]]); + ChineseDateTime.ParserConfigurationSeasonMap = new Map([["春", "SP"], ["夏", "SU"], ["秋", "FA"], ["冬", "WI"]]); + ChineseDateTime.ParserConfigurationSeasonValueMap = new Map([["SP", 3], ["SU", 6], ["FA", 9], ["WI", 12]]); + ChineseDateTime.ParserConfigurationCardinalMap = new Map([["1", 1], ["2", 2], ["3", 3], ["4", 4], ["5", 5], ["一", 1], ["二", 2], ["三", 3], ["四", 4], ["五", 5], ["第一个", 1], ["第二个", 2], ["第三个", 3], ["第四个", 4], ["第五个", 5], ["第一", 1], ["第二", 2], ["第三", 3], ["第四", 4], ["第五", 5]]); + ChineseDateTime.ParserConfigurationDayOfMonth = new Map([["1", 1], ["2", 2], ["3", 3], ["4", 4], ["5", 5], ["6", 6], ["7", 7], ["8", 8], ["9", 9], ["10", 10], ["11", 11], ["12", 12], ["13", 13], ["14", 14], ["15", 15], ["16", 16], ["17", 17], ["18", 18], ["19", 19], ["20", 20], ["21", 21], ["22", 22], ["23", 23], ["24", 24], ["25", 25], ["26", 26], ["27", 27], ["28", 28], ["29", 29], ["30", 30], ["31", 31], ["01", 1], ["02", 2], ["03", 3], ["04", 4], ["05", 5], ["06", 6], ["07", 7], ["08", 8], ["09", 9], ["1日", 1], ["2日", 2], ["3日", 3], ["4日", 4], ["5日", 5], ["6日", 6], ["7日", 7], ["8日", 8], ["9日", 9], ["10日", 10], ["11日", 11], ["12日", 12], ["13日", 13], ["14日", 14], ["15日", 15], ["16日", 16], ["17日", 17], ["18日", 18], ["19日", 19], ["20日", 20], ["21日", 21], ["22日", 22], ["23日", 23], ["24日", 24], ["25日", 25], ["26日", 26], ["27日", 27], ["28日", 28], ["29日", 29], ["30日", 30], ["31日", 31], ["一日", 1], ["十一日", 11], ["二十日", 20], ["十日", 10], ["二十一日", 21], ["三十一日", 31], ["二日", 2], ["三日", 3], ["四日", 4], ["五日", 5], ["六日", 6], ["七日", 7], ["八日", 8], ["九日", 9], ["十二日", 12], ["十三日", 13], ["十四日", 14], ["十五日", 15], ["十六日", 16], ["十七日", 17], ["十八日", 18], ["十九日", 19], ["二十二日", 22], ["二十三日", 23], ["二十四日", 24], ["二十五日", 25], ["二十六日", 26], ["二十七日", 27], ["二十八日", 28], ["二十九日", 29], ["三十日", 30], ["1号", 1], ["2号", 2], ["3号", 3], ["4号", 4], ["5号", 5], ["6号", 6], ["7号", 7], ["8号", 8], ["9号", 9], ["10号", 10], ["11号", 11], ["12号", 12], ["13号", 13], ["14号", 14], ["15号", 15], ["16号", 16], ["17号", 17], ["18号", 18], ["19号", 19], ["20号", 20], ["21号", 21], ["22号", 22], ["23号", 23], ["24号", 24], ["25号", 25], ["26号", 26], ["27号", 27], ["28号", 28], ["29号", 29], ["30号", 30], ["31号", 31], ["一号", 1], ["十一号", 11], ["二十号", 20], ["十号", 10], ["二十一号", 21], ["三十一号", 31], ["二号", 2], ["三号", 3], ["四号", 4], ["五号", 5], ["六号", 6], ["七号", 7], ["八号", 8], ["九号", 9], ["十二号", 12], ["十三号", 13], ["十四号", 14], ["十五号", 15], ["十六号", 16], ["十七号", 17], ["十八号", 18], ["十九号", 19], ["二十二号", 22], ["二十三号", 23], ["二十四号", 24], ["二十五号", 25], ["二十六号", 26], ["二十七号", 27], ["二十八号", 28], ["二十九号", 29], ["三十号", 30], ["初一", 32], ["三十", 30], ["一", 1], ["十一", 11], ["二十", 20], ["十", 10], ["二十一", 21], ["三十一", 31], ["二", 2], ["三", 3], ["四", 4], ["五", 5], ["六", 6], ["七", 7], ["八", 8], ["九", 9], ["十二", 12], ["十三", 13], ["十四", 14], ["十五", 15], ["十六", 16], ["十七", 17], ["十八", 18], ["十九", 19], ["二十二", 22], ["二十三", 23], ["二十四", 24], ["二十五", 25], ["二十六", 26], ["二十七", 27], ["二十八", 28], ["二十九", 29]]); + ChineseDateTime.ParserConfigurationDayOfWeek = new Map([["星期一", 1], ["星期二", 2], ["星期三", 3], ["星期四", 4], ["星期五", 5], ["星期六", 6], ["星期天", 0], ["星期日", 0], ["礼拜一", 1], ["礼拜二", 2], ["礼拜三", 3], ["礼拜四", 4], ["礼拜五", 5], ["礼拜六", 6], ["礼拜天", 0], ["礼拜日", 0], ["周一", 1], ["周二", 2], ["周三", 3], ["周四", 4], ["周五", 5], ["周六", 6], ["周日", 0], ["周天", 0], ["禮拜一", 1], ["禮拜二", 2], ["禮拜三", 3], ["禮拜四", 4], ["禮拜五", 5], ["禮拜六", 6], ["禮拜天", 0], ["禮拜日", 0], ["週一", 1], ["週二", 2], ["週三", 3], ["週四", 4], ["週五", 5], ["週六", 6], ["週日", 0], ["週天", 0]]); + ChineseDateTime.ParserConfigurationMonthOfYear = new Map([["1", 1], ["2", 2], ["3", 3], ["4", 4], ["5", 5], ["6", 6], ["7", 7], ["8", 8], ["9", 9], ["10", 10], ["11", 11], ["12", 12], ["01", 1], ["02", 2], ["03", 3], ["04", 4], ["05", 5], ["06", 6], ["07", 7], ["08", 8], ["09", 9], ["一月", 1], ["二月", 2], ["三月", 3], ["四月", 4], ["五月", 5], ["六月", 6], ["七月", 7], ["八月", 8], ["九月", 9], ["十月", 10], ["十一月", 11], ["十二月", 12], ["1月", 1], ["2月", 2], ["3月", 3], ["4月", 4], ["5月", 5], ["6月", 6], ["7月", 7], ["8月", 8], ["9月", 9], ["10月", 10], ["11月", 11], ["12月", 12], ["01月", 1], ["02月", 2], ["03月", 3], ["04月", 4], ["05月", 5], ["06月", 6], ["07月", 7], ["08月", 8], ["09月", 9], ["正月", 13], ["大年", 13]]); + ChineseDateTime.DateTimeSimpleAmRegex = `(?早|晨)`; + ChineseDateTime.DateTimeSimplePmRegex = `(?晚)`; + ChineseDateTime.DateTimePeriodMORegex = `(凌晨|清晨|早上|早|上午)`; + ChineseDateTime.DateTimePeriodAFRegex = `(中午|下午|午后|傍晚)`; + ChineseDateTime.DateTimePeriodEVRegex = `(晚上|夜里|夜晚|晚)`; + ChineseDateTime.DateTimePeriodNIRegex = `(半夜|夜间|深夜)`; + ChineseDateTime.DurationUnitValueMap = new Map([["Y", 31536000], ["Mon", 2592000], ["W", 604800], ["D", 86400], ["H", 3600], ["M", 60], ["S", 1]]); + ChineseDateTime.HolidayNoFixedTimex = new Map([["父亲节", "-06-WXX-6-3"], ["母亲节", "-05-WXX-7-2"], ["感恩节", "-11-WXX-4-4"]]); + ChineseDateTime.MergedBeforeRegex = `(前|之前)$`; + ChineseDateTime.MergedAfterRegex = `(后|後|之后|之後)$`; + ChineseDateTime.TimeNumberDictionary = new Map([["零", 0], ["一", 1], ["二", 2], ["三", 3], ["四", 4], ["五", 5], ["六", 6], ["七", 7], ["八", 8], ["九", 9], ["〇", 0], ["两", 2], ["十", 10]]); + ChineseDateTime.TimeLowBoundDesc = new Map([["中午", 11], ["下午", 12], ["午后", 12], ["晚上", 18], ["夜里", 18], ["夜晚", 18], ["夜间", 18], ["深夜", 18], ["傍晚", 18], ["晚", 18], ["pm", 12]]); + ChineseDateTime.DefaultLanguageFallback = 'DMY'; +})(ChineseDateTime = exports.ChineseDateTime || (exports.ChineseDateTime = {})); + +}); + +unwrapExports(chineseDateTime); + +var models$6 = createCommonjsModule(function (module, exports) { +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); + +var CompositeEntityType; +(function (CompositeEntityType) { + CompositeEntityType[CompositeEntityType["Age"] = 0] = "Age"; + CompositeEntityType[CompositeEntityType["Currency"] = 1] = "Currency"; + CompositeEntityType[CompositeEntityType["Dimension"] = 2] = "Dimension"; + CompositeEntityType[CompositeEntityType["Temperature"] = 3] = "Temperature"; +})(CompositeEntityType = exports.CompositeEntityType || (exports.CompositeEntityType = {})); +class AbstractNumberWithUnitModel { + constructor(extractorParsersMap) { + this.extractorParsersMap = extractorParsersMap; + } + parse(query) { + query = recognizersText.FormatUtility.preProcess(query, false); + let extractionResults = new Array(); + for (let kv of this.extractorParsersMap.entries()) { + let extractor = kv[0]; + let parser = kv[1]; + let extractResults = extractor.extract(query); + let parseResults = []; + for (let i = 0; i < extractResults.length; i++) { + let r = parser.parse(extractResults[i]); + if (r.value !== null) { + if (r.value instanceof Array) { + for (let j = 0; j < r.value.length; j++) { + parseResults.push(r.value[j]); + } + } + else { + parseResults.push(r); + } + } + } + let modelResults = parseResults.map(o => ({ + start: o.start, + end: o.start + o.length - 1, + resolution: this.getResolution(o.value), + text: o.text, + typeName: this.modelTypeName + })); + modelResults.forEach(result => { + let bAdd = true; + extractionResults.forEach(extractionResult => { + if (extractionResult.start === result.start && extractionResult.end === result.end) { + bAdd = false; + } + }); + if (bAdd) { + extractionResults.push(result); + } + }); + } + return extractionResults; + } + getResolution(data) { + if (typeof data === 'undefined') + return null; + let result = typeof data === "string" + ? { value: data.toString() } + : { value: data.number, unit: data.unit }; + if (data.isoCurrency) { + result['isoCurrency'] = data.isoCurrency; + } + return result; + } +} +exports.AbstractNumberWithUnitModel = AbstractNumberWithUnitModel; +class AgeModel extends AbstractNumberWithUnitModel { + constructor() { + super(...arguments); + this.modelTypeName = "age"; + } +} +exports.AgeModel = AgeModel; +class CurrencyModel extends AbstractNumberWithUnitModel { + constructor() { + super(...arguments); + this.modelTypeName = "currency"; + } +} +exports.CurrencyModel = CurrencyModel; +class DimensionModel extends AbstractNumberWithUnitModel { + constructor() { + super(...arguments); + this.modelTypeName = "dimension"; + } +} +exports.DimensionModel = DimensionModel; +class TemperatureModel extends AbstractNumberWithUnitModel { + constructor() { + super(...arguments); + this.modelTypeName = "temperature"; + } +} +exports.TemperatureModel = TemperatureModel; + +}); + +unwrapExports(models$6); + +var baseUnits = createCommonjsModule(function (module, exports) { +"use strict"; +// ------------------------------------------------------------------------------ +// +// This code was generated by a tool. +// Changes to this file may cause incorrect behavior and will be lost if +// the code is regenerated. +// +// ------------------------------------------------------------------------------ +Object.defineProperty(exports, "__esModule", { value: true }); +var BaseUnits; +(function (BaseUnits) { + BaseUnits.HourRegex = `(?00|01|02|03|04|05|06|07|08|09|0|10|11|12|13|14|15|16|17|18|19|20|21|22|23|24|1|2|3|4|5|6|7|8|9)(h)?`; + BaseUnits.MinuteRegex = `(?00|01|02|03|04|05|06|07|08|09|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|0|1|2|3|4|5|6|7|8|9)(?!\\d)`; + BaseUnits.SecondRegex = `(?00|01|02|03|04|05|06|07|08|09|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|0|1|2|3|4|5|6|7|8|9)`; + BaseUnits.PmNonUnitRegex = `(${BaseUnits.HourRegex}\\s*:\\s*${BaseUnits.MinuteRegex}(\\s*:\\s*${BaseUnits.SecondRegex})?\\s*pm)`; + BaseUnits.AmbiguousTimeTerm = 'pm'; +})(BaseUnits = exports.BaseUnits || (exports.BaseUnits = {})); + +}); + +unwrapExports(baseUnits); + +var constants$4 = createCommonjsModule(function (module, exports) { +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); + +class Constants { +} +Constants.SYS_UNIT = "builtin.unit"; +Constants.SYS_UNIT_DIMENSION = "builtin.unit.dimension"; +Constants.SYS_UNIT_AGE = "builtin.unit.age"; +Constants.SYS_UNIT_AREA = "builtin.unit.area"; +Constants.SYS_UNIT_CURRENCY = "builtin.unit.currency"; +Constants.SYS_UNIT_LENGTH = "builtin.unit.length"; +Constants.SYS_UNIT_SPEED = "builtin.unit.speed"; +Constants.SYS_UNIT_TEMPERATURE = "builtin.unit.temperature"; +Constants.SYS_UNIT_VOLUME = "builtin.unit.volume"; +Constants.SYS_UNIT_WEIGHT = "builtin.unit.weight"; +Constants.SYS_NUM = "builtin.num"; +// For cases like '2:00 pm', both 'pm' and '00 pm' are not dimension +Constants.AMBIGUOUS_TIME_TERM = baseUnits.BaseUnits.AmbiguousTimeTerm; +// For currencies without ISO codes, we use internal values prefixed by '_'. +// These values should never be present in parse output. +Constants.FAKE_ISO_CODE_PREFIX = "_"; +exports.Constants = Constants; + +}); + +unwrapExports(constants$4); + +/** + * lodash (Custom Build) + * Build: `lodash modularize exports="npm" -o ./` + * Copyright jQuery Foundation and other contributors + * Released under MIT license + * Based on Underscore.js 1.8.3 + * Copyright Jeremy Ashkenas, DocumentCloud and Investigative Reporters & Editors + */ + +/** `Object#toString` result references. */ +var symbolTag$3 = '[object Symbol]'; + +/** Used for built-in method references. */ +var objectProto$3 = Object.prototype; + +/** + * Used to resolve the + * [`toStringTag`](http://ecma-international.org/ecma-262/6.0/#sec-object.prototype.tostring) + * of values. + */ +var objectToString$3 = objectProto$3.toString; + +/** + * The base implementation of methods like `_.max` and `_.min` which accepts a + * `comparator` to determine the extremum value. + * + * @private + * @param {Array} array The array to iterate over. + * @param {Function} iteratee The iteratee invoked per iteration. + * @param {Function} comparator The comparator used to compare values. + * @returns {*} Returns the extremum value. + */ +function baseExtremum(array, iteratee, comparator) { + var index = -1, + length = array.length; + + while (++index < length) { + var value = array[index], + current = iteratee(value); + + if (current != null && (computed === undefined + ? (current === current && !isSymbol$3(current)) + : comparator(current, computed) + )) { + var computed = current, + result = value; + } + } + return result; +} + +/** + * The base implementation of `_.gt` which doesn't coerce arguments to numbers. + * + * @private + * @param {*} value The value to compare. + * @param {*} other The other value to compare. + * @returns {boolean} Returns `true` if `value` is greater than `other`, + * else `false`. + */ +function baseGt(value, other) { + return value > other; +} + +/** + * Checks if `value` is object-like. A value is object-like if it's not `null` + * and has a `typeof` result of "object". + * + * @static + * @memberOf _ + * @since 4.0.0 + * @category Lang + * @param {*} value The value to check. + * @returns {boolean} Returns `true` if `value` is object-like, else `false`. + * @example + * + * _.isObjectLike({}); + * // => true + * + * _.isObjectLike([1, 2, 3]); + * // => true + * + * _.isObjectLike(_.noop); + * // => false + * + * _.isObjectLike(null); + * // => false + */ +function isObjectLike$3(value) { + return !!value && typeof value == 'object'; +} + +/** + * Checks if `value` is classified as a `Symbol` primitive or object. + * + * @static + * @memberOf _ + * @since 4.0.0 + * @category Lang + * @param {*} value The value to check. + * @returns {boolean} Returns `true` if `value` is correctly classified, + * else `false`. + * @example + * + * _.isSymbol(Symbol.iterator); + * // => true + * + * _.isSymbol('abc'); + * // => false + */ +function isSymbol$3(value) { + return typeof value == 'symbol' || + (isObjectLike$3(value) && objectToString$3.call(value) == symbolTag$3); +} + +/** + * This method returns the first argument given to it. + * + * @static + * @since 0.1.0 + * @memberOf _ + * @category Util + * @param {*} value Any value. + * @returns {*} Returns `value`. + * @example + * + * var object = { 'user': 'fred' }; + * + * _.identity(object) === object; + * // => true + */ +function identity(value) { + return value; +} + +/** + * Computes the maximum value of `array`. If `array` is empty or falsey, + * `undefined` is returned. + * + * @static + * @since 0.1.0 + * @memberOf _ + * @category Math + * @param {Array} array The array to iterate over. + * @returns {*} Returns the maximum value. + * @example + * + * _.max([4, 2, 8, 6]); + * // => 8 + * + * _.max([]); + * // => undefined + */ +function max(array) { + return (array && array.length) + ? baseExtremum(array, identity, baseGt) + : undefined; +} + +var lodash_max = max; + +var extractors$16 = createCommonjsModule(function (module, exports) { +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); + + + + + +class NumberWithUnitExtractor { + constructor(config) { + this.config = config; + if (this.config.suffixList && this.config.suffixList.size > 0) { + this.suffixRegexes = this.buildRegexFromSet(Array.from(this.config.suffixList.values())); + } + else { + this.suffixRegexes = new Set(); // empty + } + if (this.config.prefixList && this.config.prefixList.size > 0) { + let maxLength = 0; + this.config.prefixList.forEach(preMatch => { + let len = lodash_max(preMatch.split('|').filter(s => s && s.length).map(s => s.length)); + maxLength = maxLength >= len ? maxLength : len; + }); + // 2 is the maxium length of spaces. + this.maxPrefixMatchLen = maxLength + 2; + this.prefixRegexes = this.buildRegexFromSet(Array.from(this.config.prefixList.values())); + } + else { + this.prefixRegexes = new Set(); // empty + } + this.separateRegex = this.buildSeparateRegexFromSet(); + } + extract(source) { + if (!this.preCheckStr(source)) { + return new Array(); + } + let mappingPrefix = new Map(); + let matched = new Array(source.length); + let numbers = this.config.unitNumExtractor.extract(source); + let result = new Array(); + let sourceLen = source.length; + /* Mix prefix and numbers, make up a prefix-number combination */ + if (this.maxPrefixMatchLen !== 0) { + numbers.forEach(num => { + if (num.start === undefined || num.length === undefined) { + return; + } + let maxFindPref = Math.min(this.maxPrefixMatchLen, num.start); + if (maxFindPref === 0) { + return; + } + /* Scan from left to right , find the longest match */ + let leftStr = source.substring(num.start - maxFindPref, num.start - maxFindPref + maxFindPref); + + let lastIndex = leftStr.length; + let bestMatch = null; + this.prefixRegexes.forEach(regex => { + let collection = recognizersText.RegExpUtility.getMatches(regex, leftStr).filter(m => m.length); + if (collection.length === 0) { + return; + } + collection.forEach(match => { + if (leftStr.substring(match.index, lastIndex).trim() === match.value) { + if (bestMatch === null || bestMatch.index >= match.index) { + bestMatch = match; + } + } + }); + }); + if (bestMatch !== null) { + let unitStr = leftStr.substring(bestMatch.index, lastIndex); + mappingPrefix.set(num.start, { + offset: lastIndex - bestMatch.index, + unitString: unitStr + }); + } + }); + } + for (let num of numbers) { + if (num.start === undefined || num.length === undefined) { + continue; + } + let start = num.start; + let length = num.length; + let maxFindLen = sourceLen - start - length; + let prefixUnit = mappingPrefix.has(start) ? mappingPrefix.get(start) : null; + if (maxFindLen > 0) { + let rightSub = source.substring(start + length, start + length + maxFindLen); + let unitMatch = Array.from(this.suffixRegexes.values()).map(r => recognizersText.RegExpUtility.getMatches(r, rightSub)) + .filter(m => m.length > 0); + let maxlen = 0; + for (let i = 0; i < unitMatch.length; i++) { + for (let m of unitMatch[i]) { + if (m.length > 0) { + let endpos = m.index + m.length; + if (m.index >= 0) { + let midStr = rightSub.substring(0, Math.min(m.index, rightSub.length)); + if (maxlen < endpos && (recognizersText.StringUtility.isNullOrWhitespace(midStr) || midStr.trim() === this.config.connectorToken)) { + maxlen = endpos; + } + } + } + } + } + if (maxlen !== 0) { + for (let i = 0; i < length + maxlen; i++) { + matched[i + start] = true; + } + let substr = source.substring(start, start + length + maxlen); + let er = { + start: start, + length: length + maxlen, + text: substr, + type: this.config.extractType + }; + if (prefixUnit !== null) { + er.start -= prefixUnit.offset; + er.length += prefixUnit.offset; + er.text = prefixUnit.unitString + er.text; + } + /* Relative position will be used in Parser */ + num.start = start - er.start; + er.data = num; + let isDimensionFallsInPmTime = false; + if (er.type === constants$4.Constants.SYS_UNIT_DIMENSION) { + let nonUnitMatch = recognizersText.RegExpUtility.getMatches(this.config.pmNonUnitRegex, source); + nonUnitMatch.forEach(match => { + if (er.start >= match.index && er.start + er.length <= match.index + match.length) { + isDimensionFallsInPmTime = true; + } + }); + } + if (isDimensionFallsInPmTime) { + continue; + } + result.push(er); + continue; + } + } + if (prefixUnit !== null) { + let er = { + start: num.start - prefixUnit.offset, + length: num.length + prefixUnit.offset, + text: prefixUnit.unitString + num.text, + type: this.config.extractType + }; + /* Relative position will be used in Parser */ + num.start = start - er.start; + er.data = num; + result.push(er); + } + } + // extract Separate unit + if (this.separateRegex !== null) { + this.extractSeparateUnits(source, result); + } + return result; + } + validateUnit(source) { + return source.substring(0, 1) !== '-'; + } + preCheckStr(str) { + return str && str.length; + } + extractSeparateUnits(source, numDependResults) { + // Default is false + let matchResult = new Array(source.length); + numDependResults.forEach(numDependResult => { + let start = numDependResult.start; + let i = 0; + do { + matchResult[start + i++] = true; + } while (i < numDependResult.length); + }); + // Extract all SeparateUnits, then merge it with numDependResults + let matchCollection = recognizersText.RegExpUtility.getMatches(this.separateRegex, source); + if (matchCollection.length > 0) { + matchCollection.forEach(match => { + let i = 0; + while (i < match.length && !matchResult[match.index + i]) { + i++; + } + if (i === match.length) { + // Mark as extracted + for (let j = 0; j < i; j++) { + matchResult[j] = true; + } + let isDimensionFallsInPmTime = false; + if (match.value === constants$4.Constants.AMBIGUOUS_TIME_TERM) { + let nonUnitMatch = recognizersText.RegExpUtility.getMatches(this.config.pmNonUnitRegex, source); + nonUnitMatch.forEach(time => { + if (this.isDimensionFallsInTime(match, time)) { + isDimensionFallsInPmTime = true; + } + }); + } + if (isDimensionFallsInPmTime === false) { + numDependResults.push({ + start: match.index, + length: match.length, + text: match.value, + type: this.config.extractType, + data: null + }); + } + } + }); + } + } + buildRegexFromSet(collection, ignoreCase = true) { + return new Set(collection.map(regexString => { + let regexTokens = regexString.split('|').map(lodash_escaperegexp); + let pattern = `${this.config.buildPrefix}(${regexTokens.join('|')})${this.config.buildSuffix}`; + let options = "gs"; + if (ignoreCase) + options += "i"; + return recognizersText.RegExpUtility.getSafeRegExp(pattern, options); + })); + } + buildSeparateRegexFromSet(ignoreCase = true) { + let separateWords = new Set(); + if (this.config.prefixList && this.config.prefixList.size) { + for (let addWord of this.config.prefixList.values()) { + addWord.split('|').filter(s => s && s.length) + .filter(this.validateUnit) + .forEach(word => separateWords.add(word)); + } + } + if (this.config.suffixList && this.config.suffixList.size) { + for (let addWord of this.config.suffixList.values()) { + addWord.split('|').filter(s => s && s.length) + .filter(this.validateUnit) + .forEach(word => separateWords.add(word)); + } + } + if (this.config.ambiguousUnitList && this.config.ambiguousUnitList.length) { + for (let abandonWord of this.config.ambiguousUnitList) { + if (separateWords.has(abandonWord)) { + separateWords.delete(abandonWord); + } + } + } + let regexTokens = Array.from(separateWords.values()).map(lodash_escaperegexp); + if (regexTokens.length === 0) { + return null; + } + // Sort SeparateWords using descending length. + regexTokens = regexTokens.sort(this.dinoComparer); + let pattern = `${this.config.buildPrefix}(${regexTokens.join('|')})${this.config.buildSuffix}`; + let options = "gs"; + if (ignoreCase) + options += "i"; + return recognizersText.RegExpUtility.getSafeRegExp(pattern, options); + } + dinoComparer(x, y) { + if (x === null) { + if (y === null) { + // If x is null and y is null, they're + // equal. + return 0; + } + else { + // If x is null and y is not null, y + // is greater. + return 1; + } + } + else { + // If x is not null... + // + if (y === null) + // ...and y is null, x is greater. + { + return -1; + } + else { + // ...and y is not null, compare the + // lengths of the two strings. + // + let retval = y.length - x.length; + if (retval !== 0) { + // If the strings are not of equal length, + // the longer string is greater. + // + return retval; + } + else { + // If the strings are of equal length, + // sort them with ordinary string comparison. + // + let xl = x.toLowerCase(); + let yl = y.toLowerCase(); + if (xl < yl) { + return -1; + } + if (xl > yl) { + return 1; + } + return 0; + } + } + } + } + isDimensionFallsInTime(dimension, time) { + let isSubMatch = false; + if (dimension.index >= time.index && dimension.index + dimension.length <= time.index + time.length) { + isSubMatch = true; + } + return isSubMatch; + } +} +exports.NumberWithUnitExtractor = NumberWithUnitExtractor; +class BaseMergedUnitExtractor { + constructor(config) { + this.config = config; + this.innerExtractor = new NumberWithUnitExtractor(config); + } + extract(source) { + let result = new Array(); + if (this.config.extractType === constants$4.Constants.SYS_UNIT_CURRENCY) { + result = this.mergeCompoundUnits(source); + } + else { + result = this.innerExtractor.extract(source); + } + return result; + } + mergeCompoundUnits(source) { + let result = new Array(); + let ers = this.innerExtractor.extract(source); + this.MergePureNumber(source, ers); + let groups = []; + groups[0] = 0; + for (let i = 0; i < ers.length - 1; i++) { + if (ers[i].type !== ers[i + 1].type && ers[i].type !== recognizersTextNumber.Constants.SYS_NUM && ers[i + 1].type !== recognizersTextNumber.Constants.SYS_NUM) { + continue; + } + if (ers[i].data != null && ers[i].data.data != null && !ers[i].data.data.startsWith('Integer')) { + groups[i + 1] = groups[i] + 1; + continue; + } + let middleBegin = ers[i].start + ers[i].length; + let middleEnd = ers[i + 1].start; + let middleStr = source.substring(middleBegin, middleEnd).trim().toLowerCase(); + // Separated by whitespace + if (recognizersText.StringUtility.isNullOrEmpty(middleStr)) { + groups[i + 1] = groups[i]; + continue; + } + // Separated by connectors + let match = recognizersText.RegExpUtility.getMatches(this.config.compoundUnitConnectorRegex, middleStr).pop(); + if (match && match.index === 0 && match.length === middleStr.length) { + groups[i + 1] = groups[i]; + } + else { + groups[i + 1] = groups[i] + 1; + } + } + for (let i = 0; i < ers.length; i++) { + if (i === 0 || groups[i] !== groups[i - 1]) { + let tmpInner = new recognizersText.ExtractResult(); + tmpInner.data = ers[i].data; + tmpInner.length = ers[i].length; + tmpInner.start = ers[i].start; + tmpInner.text = ers[i].text; + tmpInner.type = ers[i].type; + let tmpExtractResult = ers[i]; + tmpExtractResult.data = new Array(); + tmpExtractResult.data.push(tmpInner); + result.push(tmpExtractResult); + } + // Reduce extract results in same group + if (i + 1 < ers.length && groups[i + 1] === groups[i]) { + let group = groups[i]; + let periodBegin = result[group].start; + let periodEnd = ers[i + 1].start + ers[i + 1].length; + result[group].length = periodEnd - periodBegin; + result[group].text = source.substring(periodBegin, periodEnd); + result[group].type = constants$4.Constants.SYS_UNIT_CURRENCY; + result[group].data.push(ers[i + 1]); + } + } + for (let i = 0; i < result.length; i++) { + let innerData = result[i].data; + if (innerData && innerData.length === 1) { + result[i] = innerData[0]; + } + } + result = result.filter(er => er.type !== recognizersTextNumber.Constants.SYS_NUM); + return result; + } + MergePureNumber(source, result) { + let numErs = this.config.unitNumExtractor.extract(source); + let unitNumbers = new Array(); + let i; + let j; + for (i = 0, j = 0; i < numErs.length; i++) { + let hasBehindExtraction = false; + while (j < result.length && result[j].start + result[j].length < numErs[i].start) { + hasBehindExtraction = true; + j++; + } + if (!hasBehindExtraction) { + continue; + } + let middleBegin = result[j - 1].start + result[j - 1].length; + let middleEnd = numErs[i].start; + let middleStr = source.substring(middleBegin, middleEnd).trim().toLowerCase(); + // Separated by whitespace + if (recognizersText.StringUtility.isNullOrEmpty(middleStr)) { + unitNumbers.push(numErs[i]); + continue; + } + // Separated by connectors + let match = recognizersText.RegExpUtility.getMatches(this.config.compoundUnitConnectorRegex, middleStr).pop(); + if (match && match.index === 0 && match.length === middleStr.length) { + unitNumbers.push(numErs[i]); + } + } + unitNumbers.forEach(extractResult => { + let overlap = false; + result.forEach(er => { + if (er.start <= extractResult.start && er.start + er.length >= extractResult.start) { + overlap = true; + } + }); + if (!overlap) { + result.push(extractResult); + } + }); + result.sort((x, y) => x.start - y.start); + } +} +exports.BaseMergedUnitExtractor = BaseMergedUnitExtractor; +class PrefixUnitResult { +} +exports.PrefixUnitResult = PrefixUnitResult; + +}); + +unwrapExports(extractors$16); + +/** + * lodash 3.0.0 (Custom Build) + * Build: `lodash modern modularize exports="npm" -o ./` + * Copyright 2012-2015 The Dojo Foundation + * Based on Underscore.js 1.7.0 + * Copyright 2009-2015 Jeremy Ashkenas, DocumentCloud and Investigative Reporters & Editors + * Available under MIT license + */ + +/** + * Gets the last element of `array`. + * + * @static + * @memberOf _ + * @category Array + * @param {Array} array The array to query. + * @returns {*} Returns the last element of `array`. + * @example + * + * _.last([1, 2, 3]); + * // => 3 + */ +function last(array) { + var length = array ? array.length : 0; + return length ? array[length - 1] : undefined; +} + +var lodash_last = last; + +var utilities$4 = createCommonjsModule(function (module, exports) { +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); + +class DictionaryUtils { + static bindDictionary(dictionary, source) { + if (dictionary === null) { + return; + } + dictionary.forEach((value, key) => { + if (recognizersText.StringUtility.isNullOrEmpty(key)) { + return; + } + this.bindUnitsString(source, key, value); + }); + } + static bindUnitsString(dictionary, key, source) { + let values = source.trim().split('|'); + values.forEach(token => { + if (recognizersText.StringUtility.isNullOrWhitespace(token) || dictionary.has(token)) { + return; + } + dictionary.set(token, key); + }); + } +} +exports.DictionaryUtils = DictionaryUtils; + +}); + +unwrapExports(utilities$4); + +var baseCurrency = createCommonjsModule(function (module, exports) { +"use strict"; +// ------------------------------------------------------------------------------ +// +// This code was generated by a tool. +// Changes to this file may cause incorrect behavior and will be lost if +// the code is regenerated. +// +// ------------------------------------------------------------------------------ +Object.defineProperty(exports, "__esModule", { value: true }); +var BaseCurrency; +(function (BaseCurrency) { + BaseCurrency.CurrencyFractionMapping = new Map([["CNY", "FEN|JIAO"], ["__D", "CENT"], ["RUB", "KOPEK"], ["AFN", "PUL"], ["EUR", "CENT"], ["ALL", "QINDARKE"], ["_ALP", "PENNY"], ["GBP", "PENNY"], ["_GGP", "PENNY"], ["DZD", "SANTEEM"], ["AOA", "CENTIMO"], ["ARS", "CENTAVO"], ["AMD", "LUMA"], ["AWG", "CENT"], ["_AP", "PENNY"], ["SHP", "PENNY"], ["AUD", "CENT"], ["AZN", "QƏPIK"], ["BSD", "CENT"], ["BHD", "FILS"], ["BDT", "POISHA"], ["BBD", "CENT"], ["BYN", "KAPYEYKA"], ["BZD", "CENT"], ["XOF", "CENTIME"], ["BMD", "CENT"], ["BTN", "CHETRUM"], ["INR", "PAISA"], ["BOB", "CENTAVO"], ["USD", "CENT"], ["BAM", "FENING"], ["BWP", "THEBE"], ["BRL", "CENTAVO"], ["_BD", "CENT"], ["BND", "SEN"], ["SGD", "CENT"], ["BGN", "STOTINKA"], ["BIF", "CENTIME"], ["KHR", "SEN"], ["XAF", "CENTIME"], ["CAD", "CENT"], ["CVE", "CENTAVO"], ["KYD", "CENT"], ["CLP", "CENTAVO"], ["COP", "CENTAVO"], ["KMF", "CENTIME"], ["CDF", "CENTIME"], ["NZD", "CENT"], ["_CKD", "CENT"], ["CRC", "CENTIMO"], ["HRK", "LIPA"], ["CUC", "CENTAVO"], ["CUP", "CENTAVO"], ["CZK", "HALER"], ["DKK", "ØRE"], ["DJF", "CENTIME"], ["DOP", "CENTAVO"], ["EGP", "PIASTRE"], ["ERN", "CENT"], ["ETB", "SANTIM"], ["FKP", "PENNY"], ["_FOK", "OYRA"], ["FJD", "CENT"], ["XPF", "CENTIME"], ["GMD", "BUTUT"], ["GEL", "TETRI"], ["GHS", "PESEWA"], ["GIP", "PENNY"], ["GTQ", "CENTAVO"], ["GNF", "CENTIME"], ["GYD", "CENT"], ["HTG", "CENTIME"], ["HNL", "CENTAVO"], ["HKD", "CENT"], ["HUF", "FILLER"], ["ISK", "EYRIR"], ["IDR", "SEN"], ["IRR", "DINAR"], ["IQD", "FILS"], ["IMP", "PENNY"], ["ILS", "AGORA"], ["JMD", "CENT"], ["JPY", "SEN"], ["JEP", "PENNY"], ["JOD", "PIASTRE"], ["KZT", "TIIN"], ["KES", "CENT"], ["_KID", "CENT"], ["KPW", "CHON"], ["KRW", "JEON"], ["KWD", "FILS"], ["KGS", "TYIYN"], ["LAK", "ATT"], ["LBP", "PIASTRE"], ["LSL", "SENTE"], ["ZAR", "CENT"], ["LRD", "CENT"], ["LYD", "DIRHAM"], ["CHF", "RAPPEN"], ["MOP", "AVO"], ["MKD", "DENI"], ["MGA", "IRAIMBILANJA"], ["MWK", "TAMBALA"], ["MYR", "SEN"], ["MVR", "LAARI"], ["MRO", "KHOUMS"], ["MUR", "CENT"], ["MXN", "CENTAVO"], ["_MD", "CENT"], ["MDL", "BAN"], ["MNT", "MONGO"], ["MAD", "CENTIME"], ["MZN", "CENTAVO"], ["MMK", "PYA"], ["NAD", "CENT"], ["_ND", "CENT"], ["NPR", "PAISA"], ["NIO", "CENTAVO"], ["NGN", "KOBO"], ["_NID", "CENT"], ["TRY", "KURUS"], ["NOK", "ØRE"], ["OMR", "BAISA"], ["PKR", "PAISA"], ["_PD", "CENT"], ["PAB", "CENTESIMO"], ["PGK", "TOEA"], ["PYG", "CENTIMO"], ["PEN", "CENTIMO"], ["_PND", "CENT"], ["PLN", "GROSZ"], ["QAR", "DIRHAM"], ["RON", "BAN"], ["RWF", "CENTIME"], ["WST", "SENE"], ["STD", "CENTIMO"], ["SAR", "HALALA"], ["RSD", "PARA"], ["SCR", "CENT"], ["SLL", "CENT"], ["SBD", "CENT"], ["SOS", "CENT"], ["_SS", "CENT"], ["_SP", "PENNY"], ["SSP", "PIASTRE"], ["LKR", "CENT"], ["SDG", "PIASTRE"], ["SRD", "CENT"], ["SZL", "CENT"], ["SEK", "ORE"], ["SYP", "PIASTRE"], ["TWD", "CENT"], ["TJS", "DIRAM"], ["TZS", "CENT"], ["THB", "SATANG"], ["PRB", "KOPEK"], ["TTD", "CENT"], ["_TP", "PENNY"], ["TND", "MILLIME"], ["TMT", "TENNESI"], ["TVD", "CENT"], ["UGX", "CENT"], ["UAH", "KOPIYKA"], ["AED", "FILS"], ["UYU", "CENTESIMO"], ["VEF", "CENTIMO"], ["YER", "FILS"], ["ZMW", "NGWEE"]]); + BaseCurrency.CurrencyFractionalRatios = new Map([["Kopek", 100], ["Pul", 100], ["Cent", 100], ["Qindarkë", 100], ["Penny", 100], ["Santeem", 100], ["Cêntimo", 100], ["Centavo", 100], ["Luma", 100], ["Qəpik", 100], ["Fils", 1000], ["Poisha", 100], ["Kapyeyka", 100], ["Centime", 100], ["Chetrum", 100], ["Paisa", 100], ["Fening", 100], ["Thebe", 100], ["Sen", 100], ["Stotinka", 100], ["Jiao", 10], ["Fen", 100], ["Céntimo", 100], ["Lipa", 100], ["Haléř", 100], ["Øre", 100], ["Piastre", 100], ["Santim", 100], ["Oyra", 100], ["Butut", 100], ["Tetri", 100], ["Pesewa", 100], ["Fillér", 100], ["Eyrir", 100], ["Dinar", 100], ["Agora", 100], ["Tïın", 100], ["Chon", 100], ["Jeon", 100], ["Tyiyn", 100], ["Att", 100], ["Sente", 100], ["Dirham", 1000], ["Rappen", 100], ["Avo", 100], ["Deni", 100], ["Iraimbilanja", 5], ["Tambala", 100], ["Laari", 100], ["Khoums", 5], ["Ban", 100], ["Möngö", 100], ["Pya", 100], ["Kobo", 100], ["Kuruş", 100], ["Baisa", 1000], ["Centésimo", 100], ["Toea", 100], ["Sentimo", 100], ["Grosz", 100], ["Sene", 100], ["Halala", 100], ["Para", 100], ["Öre", 100], ["Diram", 100], ["Satang", 100], ["Seniti", 100], ["Millime", 1000], ["Tennesi", 100], ["Kopiyka", 100], ["Tiyin", 100], ["Hào", 10], ["Ngwee", 100]]); +})(BaseCurrency = exports.BaseCurrency || (exports.BaseCurrency = {})); + +}); + +unwrapExports(baseCurrency); + +var parsers$8 = createCommonjsModule(function (module, exports) { +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); + + + + + + +class UnitValue { + constructor() { + this.number = ""; + this.unit = ""; + } +} +exports.UnitValue = UnitValue; +class UnitValueIso extends UnitValue { + constructor() { + super(...arguments); + this.isoCurrency = ""; + } +} +exports.UnitValueIso = UnitValueIso; +class BaseNumberWithUnitParserConfiguration { + constructor(cultureInfo) { + this.cultureInfo = cultureInfo; + this.unitMap = new Map(); + this.currencyFractionNumMap = baseCurrency.BaseCurrency.CurrencyFractionalRatios; + this.currencyFractionMapping = baseCurrency.BaseCurrency.CurrencyFractionMapping; + } + BindDictionary(dictionary) { + utilities$4.DictionaryUtils.bindDictionary(dictionary, this.unitMap); + } +} +exports.BaseNumberWithUnitParserConfiguration = BaseNumberWithUnitParserConfiguration; +class NumberWithUnitParser { + constructor(config) { + this.config = config; + } + parse(extResult) { + let ret = new recognizersText.ParseResult(extResult); + let numberResult; + if (extResult.data && typeof extResult.data === "object") { + numberResult = extResult.data; + } + else if (extResult.type === constants$4.Constants.SYS_NUM) { + ret.value = this.config.internalNumberParser.parse(extResult).value; + return ret; + } + else { + // if there is no unitResult, means there is just unit + numberResult = { start: -1, length: 0, text: null, type: null }; + } + // key contains units + let key = extResult.text; + let unitKeyBuild = ''; + let unitKeys = new Array(); + for (let i = 0; i <= key.length; i++) { + if (i === key.length) { + if (unitKeyBuild.length !== 0) { + this.addIfNotContained(unitKeys, unitKeyBuild.trim()); + } + } + // numberResult.start is a relative position + else if (i === numberResult.start) { + if (unitKeyBuild.length !== 0) { + this.addIfNotContained(unitKeys, unitKeyBuild.trim()); + unitKeyBuild = ''; + } + let o = numberResult.start + numberResult.length - 1; + if (o !== null && !isNaN(o)) { + i = o; + } + } + else { + unitKeyBuild += key[i]; + } + } + /* Unit type depends on last unit in suffix.*/ + let lastUnit = lodash_last(unitKeys); + let normalizedLastUnit = lastUnit.toLowerCase(); + if (this.config.connectorToken && this.config.connectorToken.length && normalizedLastUnit.indexOf(this.config.connectorToken) === 0) { + normalizedLastUnit = normalizedLastUnit.substring(this.config.connectorToken.length).trim(); + lastUnit = lastUnit.substring(this.config.connectorToken.length).trim(); + } + if (key && key.length && (this.config.unitMap !== null)) { + let unitValue = null; + if (this.config.unitMap.has(lastUnit)) { + unitValue = this.config.unitMap.get(lastUnit); + } + else if (this.config.unitMap.has(normalizedLastUnit)) { + unitValue = this.config.unitMap.get(normalizedLastUnit); + } + if (unitValue) { + let numValue = numberResult.text && numberResult.text.length ? this.config.internalNumberParser.parse(numberResult) : null; + let resolutionStr = numValue ? numValue.resolutionStr : null; + ret.value = { number: resolutionStr, unit: unitValue }; + ret.resolutionStr = (`${resolutionStr} ${unitValue}`).trim(); + } + } + return ret; + } + addIfNotContained(keys, newKey) { + if (!keys.some(key => key.includes(newKey))) { + keys.push(newKey); + } + } +} +exports.NumberWithUnitParser = NumberWithUnitParser; +class BaseCurrencyParser { + constructor(config) { + this.config = config; + this.numberWithUnitParser = new NumberWithUnitParser(config); + } + parse(extResult) { + let result = null; + if (extResult.data instanceof Array) { + result = this.mergeCompoundUnit(extResult); + } + else { + result = this.numberWithUnitParser.parse(extResult); + let value = result.value; + if (!this.config.currencyNameToIsoCodeMap.has(value.unit) || this.config.currencyNameToIsoCodeMap.get(value.unit).startsWith(constants$4.Constants.FAKE_ISO_CODE_PREFIX)) { + result.value = { + unit: value.unit, + number: value.number + }; + } + else { + result.value = { + unit: value.unit, + number: value.number, + isoCurrency: this.config.currencyNameToIsoCodeMap.get(value.unit) + }; + } + } + return result; + } + mergeCompoundUnit(compoundResult) { + let results = []; + let compoundUnit = compoundResult.data; + let count = 0; + let result = null; + let numberValue = 0.0; + let mainUnitValue = ''; + let mainUnitIsoCode = ''; + let fractionUnitsString = ''; + for (let i = 0; i < compoundUnit.length; i++) { + let extractResult = compoundUnit[i]; + let parseResult = this.numberWithUnitParser.parse(extractResult); + let parseResultValue = parseResult.value; + let unitValue = parseResultValue != null ? parseResultValue.unit : null; + // Process a new group + if (count === 0) { + if (extractResult.type !== constants$4.Constants.SYS_UNIT_CURRENCY) { + continue; + } + // Initialize a new result + result = new recognizersText.ParseResult(extractResult); + mainUnitValue = unitValue; + numberValue = parseFloat(parseResultValue.number); + result.resolutionStr = parseResult.resolutionStr; + if (this.config.currencyNameToIsoCodeMap.has(unitValue)) { + mainUnitIsoCode = this.config.currencyNameToIsoCodeMap.get(unitValue); + } + // If the main unit can't be recognized, finish process this group. + if (recognizersText.StringUtility.isNullOrEmpty(mainUnitIsoCode)) { + result.value = { + number: numberValue.toString(), + unit: mainUnitValue + }; + results.push(result); + result = null; + continue; + } + if (this.config.currencyFractionMapping.has(mainUnitIsoCode)) { + fractionUnitsString = this.config.currencyFractionMapping.get(mainUnitIsoCode); + } + } + else { + // Match pure number as fraction unit. + if (extractResult.type === recognizersTextNumber.Constants.SYS_NUM) { + numberValue += parseResult.value * (1.0 / 100); + result.resolutionStr += ' ' + parseResult.resolutionStr; + result.length = parseResult.start + parseResult.length - result.start; + count++; + continue; + } + let fractionUnitCode; + let fractionNumValue; + if (this.config.currencyFractionCodeList.has(unitValue)) { + fractionUnitCode = this.config.currencyFractionCodeList.get(unitValue); + } + if (this.config.currencyFractionNumMap.has(unitValue)) { + fractionNumValue = this.config.currencyFractionNumMap.get(unitValue); + } + if (fractionUnitCode && fractionNumValue !== 0 && this.checkUnitsStringContains(fractionUnitCode, fractionUnitsString)) { + numberValue += parseFloat(parseResultValue.number) * (1.0 / fractionNumValue); + result.resolutionStr += ' ' + parseResult.resolutionStr; + result.length = parseResult.start + parseResult.length - result.start; + } + else { + // If the fraction unit doesn't match the main unit, finish process this group. + if (result !== null) { + if (recognizersText.StringUtility.isNullOrEmpty(mainUnitIsoCode) || mainUnitIsoCode.startsWith(constants$4.Constants.FAKE_ISO_CODE_PREFIX)) { + result.value = { + number: numberValue.toString(), + unit: mainUnitValue + }; + } + else { + result.value = { + number: numberValue.toString(), + unit: mainUnitValue, + isoCurrency: mainUnitIsoCode + }; + } + results.push(result); + result = null; + } + count = 0; + i -= 1; + continue; + } + } + count++; + } + if (result !== null) { + if (recognizersText.StringUtility.isNullOrEmpty(mainUnitIsoCode) || mainUnitIsoCode.startsWith(constants$4.Constants.FAKE_ISO_CODE_PREFIX)) { + result.value = { + number: numberValue.toString(), + unit: mainUnitValue + }; + } + else { + result.value = { + number: numberValue.toString(), + unit: mainUnitValue, + isoCurrency: mainUnitIsoCode + }; + } + results.push(result); + } + this.resolveText(results, compoundResult.text, compoundResult.start); + return { value: results }; + } + checkUnitsStringContains(fractionUnitCode, fractionUnitsString) { + let unitsMap = new Map(); + utilities$4.DictionaryUtils.bindUnitsString(unitsMap, '', fractionUnitsString); + return unitsMap.has(fractionUnitCode); + } + resolveText(prs, source, bias) { + prs.forEach(parseResult => { + if (parseResult.start !== null && parseResult.length !== null) { + parseResult.text = source.substr(parseResult.start - bias, parseResult.length); + } + }); + } +} +exports.BaseCurrencyParser = BaseCurrencyParser; +class BaseMergedUnitParser { + constructor(config) { + this.config = config; + this.numberWithUnitParser = new NumberWithUnitParser(config); + this.currencyParser = new BaseCurrencyParser(config); + } + parse(extResult) { + let result; + if (extResult.type === constants$4.Constants.SYS_UNIT_CURRENCY) { + result = this.currencyParser.parse(extResult); + } + else { + result = this.numberWithUnitParser.parse(extResult); + } + return result; + } +} +exports.BaseMergedUnitParser = BaseMergedUnitParser; + +}); + +unwrapExports(parsers$8); + +var englishNumericWithUnit = createCommonjsModule(function (module, exports) { +"use strict"; +// ------------------------------------------------------------------------------ +// +// This code was generated by a tool. +// Changes to this file may cause incorrect behavior and will be lost if +// the code is regenerated. +// +// ------------------------------------------------------------------------------ +Object.defineProperty(exports, "__esModule", { value: true }); +var EnglishNumericWithUnit; +(function (EnglishNumericWithUnit) { + EnglishNumericWithUnit.AgeSuffixList = new Map([["Year", "years old|year old|year-old|years-old|-year-old|-years-old|years of age|year of age"], ["Month", "months old|month old|month-old|months-old|-month-old|-months-old|month of age|months of age"], ["Week", "weeks old|week old|week-old|weeks-old|-week-old|-weeks-old|week of age|weeks of age"], ["Day", "days old|day old|day-old|days-old|-day-old|-days-old|day of age|days of age"]]); + EnglishNumericWithUnit.AreaSuffixList = new Map([["Square kilometer", "sq km|sq kilometer|sq kilometre|sq kilometers|sq kilometres|square kilometer|square kilometre|square kilometers|square kilometres|km2|km^2|km²"], ["Square hectometer", "sq hm|sq hectometer|sq hectometre|sq hectometers|sq hectometres|square hectometer|square hectometre|square hectometers|square hectometres|hm2|hm^2|hm²|hectare|hectares"], ["Square decameter", "sq dam|sq decameter|sq decametre|sq decameters|sq decametres|square decameter|square decametre|square decameters|square decametres|sq dekameter|sq dekametre|sq dekameters|sq dekametres|square dekameter|square dekametre|square dekameters|square dekametres|dam2|dam^2|dam²"], ["Square meter", "sq m|sq meter|sq metre|sq meters|sq metres|sq metre|square meter|square meters|square metre|square metres|m2|m^2|m²"], ["Square decimeter", "sq dm|sq decimeter|sq decimetre|sq decimeters|sq decimetres|square decimeter|square decimetre|square decimeters|square decimetres|dm2|dm^2|dm²"], ["Square centimeter", "sq cm|sq centimeter|sq centimetre|sq centimeters|sq centimetres|square centimeter|square centimetre|square centimeters|square centimetres|cm2|cm^2|cm²"], ["Square millimeter", "sq mm|sq millimeter|sq millimetre|sq millimeters|sq millimetres|square millimeter|square millimetre|square millimeters|square millimetres|mm2|mm^2|mm²"], ["Square inch", "sq in|sq inch|square inch|square inches|in2|in^2|in²"], ["Square foot", "sqft|sq ft|sq foot|sq feet|square foot|square feet|feet2|feet^2|feet²|ft2|ft^2|ft²"], ["Square mile", "sq mi|sq mile|sqmiles|square mile|square miles|mi2|mi^2|mi²"], ["Square yard", "sq yd|sq yard|sq yards|square yard|square yards|yd2|yd^2|yd²"], ["Acre", "-acre|acre|acres"]]); + EnglishNumericWithUnit.CurrencySuffixList = new Map([["Abkhazian apsar", "abkhazian apsar|apsars"], ["Afghan afghani", "afghan afghani|؋|afn|afghanis|afghani"], ["Pul", "pul"], ["Euro", "euros|euro|€|eur"], ["Cent", "cents|cent|-cents|-cent|sen"], ["Albanian lek", "albanian lek|leks|lek"], ["Qindarkë", "qindarkë|qindarkës|qindarke|qindarkes"], ["Angolan kwanza", "angolan kwanza|kz|aoa|kwanza|kwanzas|angolan kwanzas"], ["Armenian dram", "armenian drams|armenian dram"], ["Aruban florin", "aruban florin|ƒ|awg|aruban florins"], ["Bangladeshi taka", "bangladeshi taka|৳|bdt|taka|takas|bangladeshi takas"], ["Paisa", "poisha|paisa"], ["Bhutanese ngultrum", "Bhutanese ngultrum|nu.|btn"], ["Chetrum", "chetrums|chetrum"], ["Bolivian boliviano", "bolivian boliviano|bob|bs.|bolivia boliviano|bolivia bolivianos|bolivian bolivianos"], ["Bosnia and Herzegovina convertible mark", "bosnia and herzegovina convertible mark|bam"], ["Fening", "fenings|fenings"], ["Botswana pula", "botswana pula|bwp|pula|pulas|botswana pulas"], ["Thebe", "thebe"], ["Brazilian real", "brazilian real|r$|brl|brazil real|brazil reals|brazilian reals"], ["Bulgarian lev", "bulgarian lev|bgn|лв|bulgaria lev|bulgaria levs|bulgarian levs"], ["Stotinka", "stotinki|stotinka"], ["Cambodian riel", "cambodian riel|khr|៛|cambodia riel|cambodia riels|cambodian riels"], ["Cape Verdean escudo", "cape verdean escudo|cve"], ["Costa Rican colón", "costa rican colón|costa rican colóns|crc|₡|costa rica colón|costa rica colóns|costa rican colon|costa rican colons|costa rica colon|costa rica colons"], ["Salvadoran colón", "svc|salvadoran colón|salvadoran colóns|salvador colón|salvador colóns|salvadoran colon|salvadoran colons|salvador colon|salvador colons"], ["Céntimo", "céntimo"], ["Croatian kuna", "croatian kuna|kn|hrk|croatia kuna|croatian kunas|croatian kuna kunas"], ["Lipa", "lipa"], ["Czech koruna", "czech koruna|czk|Kč|czech korunas"], ["Haléř", "haléř"], ["Eritrean nakfa", "eritrean nakfa|nfk|ern|eritrean nakfas"], ["Ethiopian birr", "ethiopian birr|etb"], ["Gambian dalasi", "gmd"], ["Butut", "bututs|butut"], ["Georgian lari", "Georgian lari|lari|gel|₾"], ["Tetri", "tetri"], ["Ghanaian cedi", "Ghanaian cedi|ghs|₵|gh₵"], ["Pesewa", "pesewas|pesewa"], ["Guatemalan quetzal", "guatemalan quetzal|gtq|guatemala quetzal"], ["Haitian gourde", "haitian gourde|htg"], ["Honduran lempira", "honduran lempira|hnl"], ["Hungarian forint", "hungarian forint|huf|ft|hungary forint|hungary forints|hungarian forints"], ["Fillér", "fillér"], ["Iranian rial", "iranian rial|irr|iran rial|iran rials|iranian rials"], ["Yemeni rial", "yemeni rial|yer|yemeni rials"], ["Israeli new shekel", "₪|ils|agora"], ["Lithuanian litas", "ltl|lithuanian litas|lithuan litas|lithuanian lit|lithuan lit"], ["Japanese yen", "japanese yen|jpy|yen|-yen|¥|yens|japanese yens|japan yen|japan yens"], ["Kazakhstani tenge", "Kazakhstani tenge|kzt"], ["Kenyan shilling", "kenyan shilling|sh|kes"], ["North Korean won", "north korean won|kpw|north korean wons"], ["South Korean won", "south korean won|krw|south korean wons"], ["Korean won", "korean won|₩|korean wons"], ["Kyrgyzstani som", "kyrgyzstani som|kgs"], ["Uzbekitan som", "uzbekitan som|uzs"], ["Lao kip", "lao kip|lak|₭n|₭"], ["Att", "att"], ["Lesotho loti", "lesotho loti|lsl|loti"], ["Sente", "sente|lisente"], ["South African rand", "south african rand|zar|south africa rand|south africa rands|south african rands"], ["Macanese pataca", "macanese pataca|mop$|mop"], ["Avo", "avos|avo"], ["Macedonian denar", "macedonian denar|mkd|ден"], ["Deni", "deni"], ["Malagasy ariary", "malagasy ariary|mga"], ["Iraimbilanja", "iraimbilanja"], ["Malawian kwacha", "malawian kwacha|mk|mwk"], ["Tambala", "tambala"], ["Malaysian ringgit", "malaysian ringgit|rm|myr|malaysia ringgit|malaysia ringgits|malaysian ringgits"], ["Mauritanian ouguiya", "mauritanian ouguiya|um|mro|mauritania ouguiya|mauritania ouguiyas|mauritanian ouguiyas"], ["Khoums", "khoums"], ["Mongolian tögrög", "mongolian tögrög|mnt|₮|mongolia tögrög|mongolia tögrögs|mongolian tögrögs|mongolian togrog|mongolian togrogs|mongolia togrog|mongolia togrogs"], ["Mozambican metical", "mozambican metical|mt|mzn|mozambica metical|mozambica meticals|mozambican meticals"], ["Burmese kyat", "Burmese kyat|ks|mmk"], ["Pya", "pya"], ["Nicaraguan córdoba", "nicaraguan córdoba|nio"], ["Nigerian naira", "nigerian naira|naira|ngn|₦|nigeria naira|nigeria nairas|nigerian nairas"], ["Kobo", "kobo"], ["Turkish lira", "turkish lira|try|tl|turkey lira|turkey liras|turkish liras"], ["Kuruş", "kuruş"], ["Omani rial", "omani rial|omr|ر.ع."], ["Panamanian balboa", "panamanian balboa|b/.|pab"], ["Centesimo", "centesimo|céntimo"], ["Papua New Guinean kina", "papua new guinean kina|kina|pgk"], ["Toea", "toea"], ["Paraguayan guaraní", "paraguayan guaraní|₲|pyg"], ["Peruvian sol", "peruvian sol|soles|sol|peruvian nuevo sol"], ["Polish złoty", "złoty|polish złoty|zł|pln|zloty|polish zloty|poland zloty|poland złoty"], ["Grosz", "groszy|grosz|grosze"], ["Qatari riyal", "qatari riyal|qar|qatari riyals|qatar riyal|qatar riyals"], ["Saudi riyal", "saudi riyal|sar|saudi riyals"], ["Riyal", "riyal|riyals|rial|﷼"], ["Dirham", "dirham|dirhem|dirhm"], ["Halala", "halalas|halala"], ["Samoan tālā", "samoan tālā|tālā|tala|ws$|samoa|wst|samoan tala"], ["Sene", "sene"], ["São Tomé and Príncipe dobra", "são tomé and príncipe dobra|dobras|dobra|std"], ["Sierra Leonean leone", "sierra Leonean leone|sll|leone|le"], ["Peseta", "pesetas|peseta"], ["Netherlands guilder", "florin|netherlands antillean guilder|ang|ƒ|nederlandse gulden|guilders|guilder|gulden|-guilders|-guilder|dutch guilders|dutch guilder|fl"], ["Swazi lilangeni", "swazi lilangeni|lilangeni|szl|emalangeni"], ["Tajikistani somoni", "tajikistani somoni|tjs|somoni"], ["Diram", "dirams|diram"], ["Thai baht", "thai baht|฿|thb|baht"], ["Satang", "satang|satangs"], ["Tongan paʻanga", "tongan paʻanga|paʻanga|tongan pa'anga|pa'anga"], ["Seniti", "seniti"], ["Ukrainian hryvnia", "ukrainian hryvnia|hyrvnia|uah|₴|ukrain hryvnia|ukrain hryvnias|ukrainian hryvnias"], ["Vanuatu vatu", "vanuatu vatu|vatu|vuv"], ["Venezuelan bolívar", "venezuelan bolívar|venezuelan bolívars|bs.f.|vef|bolívar fuerte|venezuelan bolivar|venezuelan bolivars|venezuela bolivar|venezuela bolivarsvenezuelan bolivar|venezuelan bolivars"], ["Vietnamese dong", "vietnamese dong|vnd|đồng|vietnam dong|vietnamese dongs|vietnam dongs"], ["Zambian kwacha", "zambian kwacha|zk|zmw|zambia kwacha|kwachas|zambian kwachas"], ["Moroccan dirham", "moroccan dirham|mad|د.م."], ["United Arab Emirates dirham", "united arab emirates dirham|د.إ|aed"], ["Azerbaijani manat", "azerbaijani manat|azn"], ["Turkmenistan manat", "turkmenistan manat|turkmenistan new manat|tmt"], ["Manat", "manats|manat"], ["Qəpik", "qəpik"], ["Somali shilling", "somali shillings|somali shilling|shilin soomaali|-shilin soomaali|scellino|shilin|sh.so.|sos"], ["Somaliland shilling", "somaliland shillings|somaliland shilling|soomaaliland shilin"], ["Tanzanian shilling", "tanzanian shilling|tanzanian shillings|tsh|tzs|tanzania shilling|tanzania shillings"], ["Ugandan shilling", "ugandan shilling|ugandan shillings|sh|ugx|uganda shilling|uganda shillings"], ["Romanian leu", "romanian leu|lei|ron|romania leu"], ["Moldovan leu", "moldovan leu|mdl|moldova leu"], ["Leu", "leu"], ["Ban", "bani|-ban|ban"], ["Nepalese rupee", "nepalese rupee|npr"], ["Pakistani rupee", "pakistani rupee|pkr"], ["Indian rupee", "indian rupee|inr|₹|india rupee"], ["Seychellois rupee", "seychellois rupee|scr|sr|sre"], ["Mauritian rupee", "mauritian rupee|mur"], ["Maldivian rufiyaa", "maldivian rufiyaa|rf|mvr|.ރ|maldive rufiyaa"], ["Sri Lankan rupee", "sri Lankan rupee|lkr|රු|ரூ"], ["Indonesian rupiah", "Indonesian rupiah|rupiah|perak|rp|idr"], ["Rupee", "rupee|rs"], ["Danish krone", "danish krone|dkk|denmark krone|denmark krones|danish krones"], ["Norwegian krone", "norwegian krone|nok|norway krone|norway krones|norwegian krones"], ["Faroese króna", "faroese króna|faroese krona"], ["Icelandic króna", "icelandic króna|isk|icelandic krona|iceland króna|iceland krona"], ["Swedish krona", "swedish krona|sek|swedan krona"], ["Krone", "kronor|krona|króna|krone|krones|kr|-kr"], ["Øre", "Øre|oyra|eyrir"], ["West African CFA franc", "west african cfa franc|xof|west africa cfa franc|west africa franc|west african franc"], ["Central African CFA franc", "central african cfa franc|xaf|central africa cfa franc|central african franc|central africa franc"], ["Comorian franc", "comorian franc|kmf"], ["Congolese franc", "congolese franc|cdf"], ["Burundian franc", "burundian franc|bif"], ["Djiboutian franc", "djiboutian franc|djf"], ["CFP franc", "cfp franc|xpf"], ["Guinean franc", "guinean franc|gnf"], ["Swiss franc", "swiss francs|swiss franc|chf|sfr."], ["Rwandan franc", "Rwandan franc|rwf|rf|r₣|frw"], ["Belgian franc", "belgian franc|bi.|b.fr.|bef|belgium franc"], ["Rappen", "rappen|-rappen"], ["Franc", "francs|franc|fr.|fs"], ["Centime", "centimes|centime|santim"], ["Russian ruble", "russian ruble|₽|rub|russia ruble|russia ₽|russian ₽|russian rubles|russia rubles"], ["New Belarusian ruble", "new belarusian ruble|byn|new belarus ruble|new belarus rubles|new belarusian rubles"], ["Old Belarusian ruble", "old belarusian ruble|byr|old belarus ruble|old belarus rubles|old belarusian rubles"], ["Transnistrian ruble", "transnistrian ruble|prb|р."], ["Belarusian ruble", "belarusian ruble|belarus ruble|belarus rubles|belarusian rubles"], ["Kopek", "kopek|kopeks"], ["Kapyeyka", "kapyeyka"], ["Ruble", "rubles|ruble|br"], ["Algerian dinar", "algerian dinar|د.ج|dzd|algerian dinars|algeria dinar|algeria dinars"], ["Bahraini dinar", "bahraini dinars|bahraini dinar|bhd|.د.ب"], ["Santeem", "santeem|santeems"], ["Iraqi dinar", "iraqi dinars|iraqi dinar|iraq dinars|iraq dinar|iqd|ع.د"], ["Jordanian dinar", "jordanian dinars|jordanian dinar|د.ا|jod|jordan dinar|jordan dinars"], ["Kuwaiti dinar", "kuwaiti dinars|kuwaiti dinar|kwd|د.ك"], ["Libyan dinar", "libyan dinars|libyan dinar|libya dinars|libya dinar|lyd"], ["Serbian dinar", "serbian dinars|serbian dinar|din.|rsd|дин.|serbia dinars|serbia dinar"], ["Tunisian dinar", "tunisian dinars|tunisian dinar|tnd|tunisia dinars|tunisia dinar"], ["Yugoslav dinar", "yugoslav dinars|yugoslav dinar|yun"], ["Dinar", "dinars|dinar|denar|-dinars|-dinar"], ["Fils", "fils|fulūs|-fils|-fil"], ["Para", "para|napa"], ["Millime", "millimes|millime"], ["Argentine peso", "argentine peso|ars|argetina peso|argetina pesos|argentine pesos"], ["Chilean peso", "chilean pesos|chilean peso|clp|chile peso|chile peso"], ["Colombian peso", "colombian pesos|colombian peso|cop|colombia peso|colombia pesos"], ["Cuban convertible peso", "cuban convertible pesos|cuban convertible peso|cuc|cuba convertible pesos|cuba convertible peso"], ["Cuban peso", "cuban pesos|cuban peso|cup|cuba pesos|cuba peso"], ["Dominican peso", "dominican pesos|dominican peso|dop|dominica pesos|dominica peso"], ["Mexican peso", "mexican pesos|mexican peso|mxn|mexico pesos|mexico peso"], ["Philippine peso", "piso|philippine pesos|philippine peso|₱|php"], ["Uruguayan peso", "uruguayan pesos|uruguayan peso|uyu"], ["Peso", "pesos|peso"], ["Centavo", "centavos|centavo"], ["Alderney pound", "alderney pounds|alderney pound|alderney £"], ["British pound", "british pounds|british pound|british £|gbp|pound sterling|pound sterlings|sterling|pound scot|pound scots"], ["Guernsey pound", "guernsey pounds|guernsey £|ggp"], ["Ascension pound", "ascension pounds|ascension pound|ascension £"], ["Saint Helena pound", "saint helena pounds|saint helena pound|saint helena £|shp"], ["Egyptian pound", "egyptian pounds|egyptian pound|egyptian £|egp|ج.م|egypt pounds|egypt pound"], ["Falkland Islands pound", "falkland islands pounds|falkland islands pound|falkland islands £|fkp|falkland island pounds|falkland island pound|falkland island £"], ["Gibraltar pound", "gibraltar pounds|gibraltar pound|gibraltar £|gip"], ["Manx pound", "manx pounds|manx pound|manx £|imp"], ["Jersey pound", "jersey pounds|jersey pound|jersey £|jep"], ["Lebanese pound", "lebanese pounds|lebanese pound|lebanese £|lebanan pounds|lebanan pound|lebanan £|lbp|ل.ل"], ["South Georgia and the South Sandwich Islands pound", "south georgia and the south sandwich islands pounds|south georgia and the south sandwich islands pound|south georgia and the south sandwich islands £"], ["South Sudanese pound", "south sudanese pounds|south sudanese pound|south sudanese £|ssp|south sudan pounds|south sudan pound|south sudan £"], ["Sudanese pound", "sudanese pounds|sudanese pound|sudanese £|ج.س.|sdg|sudan pounds|sudan pound|sudan £"], ["Syrian pound", "syrian pounds|syrian pound|syrian £|ل.س|syp|syria pounds|syria pound|syria £"], ["Tristan da Cunha pound", "tristan da cunha pounds|tristan da cunha pound|tristan da cunha £"], ["Pound", "pounds|pound|-pounds|-pound|£"], ["Pence", "pence"], ["Shilling", "shillings|shilling|shilingi"], ["Penny", "pennies|penny"], ["United States dollar", "united states dollars|united states dollar|united states $|u.s. dollars|u.s. dollar|u s dollar|u s dollars|usd|american dollars|american dollar|us$|us dollar|us dollars|u.s dollar|u.s dollars"], ["East Caribbean dollar", "east caribbean dollars|east caribbean dollar|east Caribbean $|xcd"], ["Australian dollar", "australian dollars|australian dollar|australian $|australian$|aud|australia dollars|australia dollar|australia $|australia$"], ["Bahamian dollar", "bahamian dollars|bahamian dollar|bahamian $|bahamian$|bsd|bahamia dollars|bahamia dollar|bahamia $|bahamia$"], ["Barbadian dollar", "barbadian dollars|barbadian dollar|barbadian $|bbd"], ["Belize dollar", "belize dollars|belize dollar|belize $|bzd"], ["Bermudian dollar", "bermudian dollars|bermudian dollar|bermudian $|bmd|bermudia dollars|bermudia dollar|bermudia $"], ["British Virgin Islands dollar", "british virgin islands dollars|british virgin islands dollar|british virgin islands $|bvi$|virgin islands dollars|virgin islands dolalr|virgin islands $|virgin island dollars|virgin island dollar|virgin island $"], ["Brunei dollar", "brunei dollar|brunei $|bnd"], ["Sen", "sen"], ["Singapore dollar", "singapore dollars|singapore dollar|singapore $|s$|sgd"], ["Canadian dollar", "canadian dollars|canadian dollar|canadian $|cad|can$|c$|canada dollars|canada dolllar|canada $"], ["Cayman Islands dollar", "cayman islands dollars|cayman islands dollar|cayman islands $|kyd|ci$|cayman island dollar|cayman island doolars|cayman island $"], ["New Zealand dollar", "new zealand dollars|new zealand dollar|new zealand $|nz$|nzd|kiwi"], ["Cook Islands dollar", "cook islands dollars|cook islands dollar|cook islands $|cook island dollars|cook island dollar|cook island $"], ["Fijian dollar", "fijian dollars|fijian dollar|fijian $|fjd|fiji dollars|fiji dollar|fiji $"], ["Guyanese dollar", "guyanese dollars|guyanese dollar|gyd|gy$"], ["Hong Kong dollar", "hong kong dollars|hong kong dollar|hong kong $|hk$|hkd|hk dollars|hk dollar|hk $|hongkong$"], ["Jamaican dollar", "jamaican dollars|jamaican dollar|jamaican $|j$|jamaica dollars|jamaica dollar|jamaica $|jmd"], ["Kiribati dollar", "kiribati dollars|kiribati dollar|kiribati $"], ["Liberian dollar", "liberian dollars|liberian dollar|liberian $|liberia dollars|liberia dollar|liberia $|lrd"], ["Micronesian dollar", "micronesian dollars|micronesian dollar|micronesian $"], ["Namibian dollar", "namibian dollars|namibian dollar|namibian $|nad|n$|namibia dollars|namibia dollar|namibia $"], ["Nauruan dollar", "nauruan dollars|nauruan dollar|nauruan $"], ["Niue dollar", "niue dollars|niue dollar|niue $"], ["Palauan dollar", "palauan dollars|palauan dollar|palauan $"], ["Pitcairn Islands dollar", "pitcairn islands dollars|pitcairn islands dollar|pitcairn islands $|pitcairn island dollars|pitcairn island dollar|pitcairn island $"], ["Solomon Islands dollar", "solomon islands dollars|solomon islands dollar|solomon islands $|si$|sbd|solomon island dollars|solomon island dollar|solomon island $"], ["Surinamese dollar", "surinamese dollars|surinamese dollar|surinamese $|srd"], ["New Taiwan dollar", "new taiwan dollars|new taiwan dollar|nt$|twd|ntd"], ["Trinidad and Tobago dollar", "trinidad and tobago dollars|trinidad and tobago dollar|trinidad and tobago $|trinidad $|trinidad dollar|trinidad dollars|trinidadian dollar|trinidadian dollars|trinidadian $|ttd"], ["Tuvaluan dollar", "tuvaluan dollars|tuvaluan dollar|tuvaluan $"], ["Dollar", "dollars|dollar|$"], ["Chinese yuan", "yuan|kuai|chinese yuan|renminbi|cny|rmb|¥|元"], ["Fen", "fen"], ["Jiao", "jiao|mao"], ["Finnish markka", "suomen markka|finnish markka|finsk mark|fim|markkaa|markka"], ["Penni", "penniä|penni"]]); + EnglishNumericWithUnit.CurrencyNameToIsoCodeMap = new Map([["Afghan afghani", "AFN"], ["Euro", "EUR"], ["Albanian lek", "ALL"], ["Angolan kwanza", "AOA"], ["Armenian dram", "AMD"], ["Aruban florin", "AWG"], ["Bangladeshi taka", "BDT"], ["Bhutanese ngultrum", "BTN"], ["Bolivian boliviano", "BOB"], ["Bosnia and Herzegovina convertible mark", "BAM"], ["Botswana pula", "BWP"], ["Brazilian real", "BRL"], ["Bulgarian lev", "BGN"], ["Cambodian riel", "KHR"], ["Cape Verdean escudo", "CVE"], ["Costa Rican colón", "CRC"], ["Croatian kuna", "HRK"], ["Czech koruna", "CZK"], ["Eritrean nakfa", "ERN"], ["Ethiopian birr", "ETB"], ["Gambian dalasi", "GMD"], ["Georgian lari", "GEL"], ["Ghanaian cedi", "GHS"], ["Guatemalan quetzal", "GTQ"], ["Haitian gourde", "HTG"], ["Honduran lempira", "HNL"], ["Hungarian forint", "HUF"], ["Iranian rial", "IRR"], ["Yemeni rial", "YER"], ["Israeli new shekel", "ILS"], ["Japanese yen", "JPY"], ["Kazakhstani tenge", "KZT"], ["Kenyan shilling", "KES"], ["North Korean won", "KPW"], ["South Korean won", "KRW"], ["Kyrgyzstani som", "KGS"], ["Lao kip", "LAK"], ["Lesotho loti", "LSL"], ["South African rand", "ZAR"], ["Macanese pataca", "MOP"], ["Macedonian denar", "MKD"], ["Malagasy ariary", "MGA"], ["Malawian kwacha", "MWK"], ["Malaysian ringgit", "MYR"], ["Mauritanian ouguiya", "MRO"], ["Mongolian tögrög", "MNT"], ["Mozambican metical", "MZN"], ["Burmese kyat", "MMK"], ["Nicaraguan córdoba", "NIO"], ["Nigerian naira", "NGN"], ["Turkish lira", "TRY"], ["Omani rial", "OMR"], ["Panamanian balboa", "PAB"], ["Papua New Guinean kina", "PGK"], ["Paraguayan guaraní", "PYG"], ["Peruvian sol", "PEN"], ["Polish złoty", "PLN"], ["Qatari riyal", "QAR"], ["Saudi riyal", "SAR"], ["Samoan tālā", "WST"], ["São Tomé and Príncipe dobra", "STD"], ["Sierra Leonean leone", "SLL"], ["Swazi lilangeni", "SZL"], ["Tajikistani somoni", "TJS"], ["Thai baht", "THB"], ["Ukrainian hryvnia", "UAH"], ["Vanuatu vatu", "VUV"], ["Venezuelan bolívar", "VEF"], ["Zambian kwacha", "ZMW"], ["Moroccan dirham", "MAD"], ["United Arab Emirates dirham", "AED"], ["Azerbaijani manat", "AZN"], ["Turkmenistan manat", "TMT"], ["Somali shilling", "SOS"], ["Tanzanian shilling", "TZS"], ["Ugandan shilling", "UGX"], ["Romanian leu", "RON"], ["Moldovan leu", "MDL"], ["Nepalese rupee", "NPR"], ["Pakistani rupee", "PKR"], ["Indian rupee", "INR"], ["Seychellois rupee", "SCR"], ["Mauritian rupee", "MUR"], ["Maldivian rufiyaa", "MVR"], ["Sri Lankan rupee", "LKR"], ["Indonesian rupiah", "IDR"], ["Danish krone", "DKK"], ["Norwegian krone", "NOK"], ["Icelandic króna", "ISK"], ["Swedish krona", "SEK"], ["West African CFA franc", "XOF"], ["Central African CFA franc", "XAF"], ["Comorian franc", "KMF"], ["Congolese franc", "CDF"], ["Burundian franc", "BIF"], ["Djiboutian franc", "DJF"], ["CFP franc", "XPF"], ["Guinean franc", "GNF"], ["Swiss franc", "CHF"], ["Rwandan franc", "RWF"], ["Russian ruble", "RUB"], ["Transnistrian ruble", "PRB"], ["Belarusian ruble", "BYN"], ["Algerian dinar", "DZD"], ["Bahraini dinar", "BHD"], ["Iraqi dinar", "IQD"], ["Jordanian dinar", "JOD"], ["Kuwaiti dinar", "KWD"], ["Libyan dinar", "LYD"], ["Serbian dinar", "RSD"], ["Tunisian dinar", "TND"], ["Argentine peso", "ARS"], ["Chilean peso", "CLP"], ["Colombian peso", "COP"], ["Cuban convertible peso", "CUC"], ["Cuban peso", "CUP"], ["Dominican peso", "DOP"], ["Mexican peso", "MXN"], ["Uruguayan peso", "UYU"], ["British pound", "GBP"], ["Saint Helena pound", "SHP"], ["Egyptian pound", "EGP"], ["Falkland Islands pound", "FKP"], ["Gibraltar pound", "GIP"], ["Manx pound", "IMP"], ["Jersey pound", "JEP"], ["Lebanese pound", "LBP"], ["South Sudanese pound", "SSP"], ["Sudanese pound", "SDG"], ["Syrian pound", "SYP"], ["United States dollar", "USD"], ["Australian dollar", "AUD"], ["Bahamian dollar", "BSD"], ["Barbadian dollar", "BBD"], ["Belize dollar", "BZD"], ["Bermudian dollar", "BMD"], ["Brunei dollar", "BND"], ["Singapore dollar", "SGD"], ["Canadian dollar", "CAD"], ["Cayman Islands dollar", "KYD"], ["New Zealand dollar", "NZD"], ["Fijian dollar", "FJD"], ["Guyanese dollar", "GYD"], ["Hong Kong dollar", "HKD"], ["Jamaican dollar", "JMD"], ["Liberian dollar", "LRD"], ["Namibian dollar", "NAD"], ["Solomon Islands dollar", "SBD"], ["Surinamese dollar", "SRD"], ["New Taiwan dollar", "TWD"], ["Trinidad and Tobago dollar", "TTD"], ["Tuvaluan dollar", "TVD"], ["Chinese yuan", "CNY"], ["Rial", "__RI"], ["Shiling", "__S"], ["Som", "__SO"], ["Dirham", "__DR"], ["Dinar", "_DN"], ["Dollar", "__D"], ["Manat", "__MA"], ["Rupee", "__R"], ["Krone", "__K"], ["Krona", "__K"], ["Crown", "__K"], ["Frank", "__F"], ["Mark", "__M"], ["Ruble", "__RB"], ["Peso", "__PE"], ["Pound", "__P"], ["Tristan da Cunha pound", "_TP"], ["South Georgia and the South Sandwich Islands pound", "_SP"], ["Somaliland shilling", "_SS"], ["Pitcairn Islands dollar", "_PND"], ["Palauan dollar", "_PD"], ["Niue dollar", "_NID"], ["Nauruan dollar", "_ND"], ["Micronesian dollar", "_MD"], ["Kiribati dollar", "_KID"], ["Guernsey pound", "_GGP"], ["Faroese króna", "_FOK"], ["Cook Islands dollar", "_CKD"], ["British Virgin Islands dollar", "_BD"], ["Ascension pound", "_AP"], ["Alderney pound", "_ALP"], ["Abkhazian apsar", "_AA"]]); + EnglishNumericWithUnit.FractionalUnitNameToCodeMap = new Map([["Jiao", "JIAO"], ["Kopek", "KOPEK"], ["Pul", "PUL"], ["Cent", "CENT"], ["Qindarkë", "QINDARKE"], ["Penny", "PENNY"], ["Santeem", "SANTEEM"], ["Cêntimo", "CENTIMO"], ["Centavo", "CENTAVO"], ["Luma", "LUMA"], ["Qəpik", "QƏPIK"], ["Fils", "FILS"], ["Poisha", "POISHA"], ["Kapyeyka", "KAPYEYKA"], ["Centime", "CENTIME"], ["Chetrum", "CHETRUM"], ["Paisa", "PAISA"], ["Fening", "FENING"], ["Thebe", "THEBE"], ["Sen", "SEN"], ["Stotinka", "STOTINKA"], ["Fen", "FEN"], ["Céntimo", "CENTIMO"], ["Lipa", "LIPA"], ["Haléř", "HALER"], ["Øre", "ØRE"], ["Piastre", "PIASTRE"], ["Santim", "SANTIM"], ["Oyra", "OYRA"], ["Butut", "BUTUT"], ["Tetri", "TETRI"], ["Pesewa", "PESEWA"], ["Fillér", "FILLER"], ["Eyrir", "EYRIR"], ["Dinar", "DINAR"], ["Agora", "AGORA"], ["Tïın", "TIIN"], ["Chon", "CHON"], ["Jeon", "JEON"], ["Tyiyn", "TYIYN"], ["Att", "ATT"], ["Sente", "SENTE"], ["Dirham", "DIRHAM"], ["Rappen", "RAPPEN"], ["Avo", "AVO"], ["Deni", "DENI"], ["Iraimbilanja", "IRAIMBILANJA"], ["Tambala", "TAMBALA"], ["Laari", "LAARI"], ["Khoums", "KHOUMS"], ["Ban", "BAN"], ["Möngö", "MONGO"], ["Pya", "PYA"], ["Kobo", "KOBO"], ["Kuruş", "KURUS"], ["Baisa", "BAISA"], ["Centésimo", "CENTESIMO"], ["Toea", "TOEA"], ["Sentimo", "SENTIMO"], ["Grosz", "GROSZ"], ["Sene", "SENE"], ["Halala", "HALALA"], ["Para", "PARA"], ["Öre", "ORE"], ["Diram", "DIRAM"], ["Satang", "SATANG"], ["Seniti", "SENITI"], ["Millime", "MILLIME"], ["Tennesi", "TENNESI"], ["Kopiyka", "KOPIYKA"], ["Tiyin", "TIYIN"], ["Hào", "HAO"], ["Ngwee", "NGWEE"]]); + EnglishNumericWithUnit.CompoundUnitConnectorRegex = `(?and)`; + EnglishNumericWithUnit.CurrencyPrefixList = new Map([["Dollar", "$"], ["United States dollar", "united states $|us$|us $|u.s. $|u.s $"], ["East Caribbean dollar", "east caribbean $"], ["Australian dollar", "australian $|australia $"], ["Bahamian dollar", "bahamian $|bahamia $"], ["Barbadian dollar", "barbadian $|barbadin $"], ["Belize dollar", "belize $"], ["Bermudian dollar", "bermudian $"], ["British Virgin Islands dollar", "british virgin islands $|bvi$|virgin islands $|virgin island $|british virgin island $"], ["Brunei dollar", "brunei $|b$"], ["Sen", "sen"], ["Singapore dollar", "singapore $|s$"], ["Canadian dollar", "canadian $|can$|c$|c $|canada $"], ["Cayman Islands dollar", "cayman islands $|ci$|cayman island $"], ["New Zealand dollar", "new zealand $|nz$|nz $"], ["Cook Islands dollar", "cook islands $|cook island $"], ["Fijian dollar", "fijian $|fiji $"], ["Guyanese dollar", "gy$|gy $|g$|g $"], ["Hong Kong dollar", "hong kong $|hk$|hkd|hk $"], ["Jamaican dollar", "jamaican $|j$|jamaica $"], ["Kiribati dollar", "kiribati $"], ["Liberian dollar", "liberian $|liberia $"], ["Micronesian dollar", "micronesian $"], ["Namibian dollar", "namibian $|nad|n$|namibia $"], ["Nauruan dollar", "nauruan $"], ["Niue dollar", "niue $"], ["Palauan dollar", "palauan $"], ["Pitcairn Islands dollar", "pitcairn islands $|pitcairn island $"], ["Solomon Islands dollar", "solomon islands $|si$|si $|solomon island $"], ["Surinamese dollar", "surinamese $|surinam $"], ["New Taiwan dollar", "nt$|nt $"], ["Trinidad and Tobago dollar", "trinidad and tobago $|trinidad $|trinidadian $"], ["Tuvaluan dollar", "tuvaluan $"], ["Samoan tālā", "ws$"], ["Chinese yuan", "¥"], ["Japanese yen", "¥"], ["Euro", "€"], ["Pound", "£"], ["Costa Rican colón", "₡"], ["Turkish lira", "₺"]]); + EnglishNumericWithUnit.AmbiguousCurrencyUnitList = ['din.', 'kiwi', 'kina', 'kobo', 'lari', 'lipa', 'napa', 'para', 'sfr.', 'taka', 'tala', 'toea', 'vatu', 'yuan', 'ang', 'ban', 'bob', 'btn', 'byr', 'cad', 'cop', 'cup', 'dop', 'gip', 'jod', 'kgs', 'lak', 'lei', 'mga', 'mop', 'nad', 'omr', 'pul', 'sar', 'sbd', 'scr', 'sdg', 'sek', 'sen', 'sol', 'sos', 'std', 'try', 'yer', 'yen']; + EnglishNumericWithUnit.InformationSuffixList = new Map([["Bit", "-bit|bit|bits"], ["Kilobit", "kilobit|kilobits|kb|Kb|kbit"], ["Megabit", "megabit|megabits|mb|Mb|mbit"], ["Gigabit", "gigabit|gigabits|gb|Gb|gbit"], ["Terabit", "terabit|terabits|tb|Tb|tbit"], ["Petabit", "petabit|petabits|pb|Pb|pbit"], ["Byte", "-byte|byte|bytes"], ["Kilobyte", "-kilobyte|-kilobytes|kilobyte|kB|KB|kilobytes|kilo byte|kilo bytes|kbyte"], ["Megabyte", "-megabyte|-megabytes|megabyte|mB|MB|megabytes|mega byte|mega bytes|mbyte"], ["Gigabyte", "-gigabyte|-gigabytes|gigabyte|gB|GB|gigabytes|giga byte|giga bytes|gbyte"], ["Terabyte", "-terabyte|-terabytes|terabyte|tB|TB|terabytes|tera byte|tera bytes|tbyte"], ["Petabyte", "-petabyte|-petabytes|petabyte|pB|PB|petabytes|peta byte|peta bytes|pbyte"]]); + EnglishNumericWithUnit.AmbiguousDimensionUnitList = ['barrel', 'barrels', 'grain', 'pound', 'stone', 'yards', 'yard', 'cord', 'dram', 'feet', 'foot', 'gill', 'knot', 'peck', 'cup', 'fps', 'pts', 'in', 'dm', '\"']; + EnglishNumericWithUnit.BuildPrefix = `(?<=(\\s|^))`; + EnglishNumericWithUnit.BuildSuffix = `(?=(\\s|\\W|$))`; + EnglishNumericWithUnit.LengthSuffixList = new Map([["Kilometer", "km|kilometer|kilometre|kilometers|kilometres|kilo meter|kilo meters|kilo metres|kilo metre"], ["Hectometer", "hm|hectometer|hectometre|hectometers|hectometres|hecto meter|hecto meters|hecto metres|hecto metre"], ["Decameter", "dam|decameter|decametre|decameters|decametres|deca meter|deca meters|deca metres|deca metre"], ["Meter", "m|meter|metre|meters|metres"], ["Decimeter", "dm|decimeter|decimeters|decimetre|decimetres|deci meter|deci meters|deci metres|deci metre"], ["Centimeter", "cm|centimeter|centimeters|centimetre|centimetres|centi meter|centi meters|centi metres|centi metre"], ["Millimeter", "mm|millimeter|millimeters|millimetre|millimetres|milli meter|milli meters|milli metres|milli metre"], ["Micrometer", "μm|micrometer|micrometre|micrometers|micrometres|micro meter|micro meters|micro metres|micro metre"], ["Nanometer", "nm|nanometer|nanometre|nanometers|nanometres|nano meter|nano meters|nano metres|nano metre"], ["Picometer", "pm|picometer|picometre|picometers|picometres|pico meter|pico meters|pico metres|pico metre"], ["Mile", "-mile|mile|miles"], ["Yard", "yard|yards"], ["Inch", "-inch|inch|inches|in|\""], ["Foot", "-foot|foot|feet|ft"], ["Light year", "light year|light-year|light years|light-years"], ["Pt", "pt|pts"]]); + EnglishNumericWithUnit.AmbiguousLengthUnitList = ['m', 'yard', 'yards', 'pm', 'pt', 'pts']; + EnglishNumericWithUnit.SpeedSuffixList = new Map([["Meter per second", "meters / second|m/s|meters per second|metres per second|meter per second|metre per second"], ["Kilometer per hour", "km/h|kilometres per hour|kilometers per hour|kilometer per hour|kilometre per hour"], ["Kilometer per minute", "km/min|kilometers per minute|kilometres per minute|kilometer per minute|kilometre per minute"], ["Kilometer per second", "km/s|kilometers per second|kilometres per second|kilometer per second|kilometre per second"], ["Mile per hour", "mph|mile per hour|miles per hour|mi/h|mile / hour|miles / hour|miles an hour"], ["Knot", "kt|knot|kn"], ["Foot per second", "ft/s|foot/s|foot per second|feet per second|fps"], ["Foot per minute", "ft/min|foot/min|foot per minute|feet per minute"], ["Yard per minute", "yards per minute|yard per minute|yards / minute|yards/min|yard/min"], ["Yard per second", "yards per second|yard per second|yards / second|yards/s|yard/s"]]); + EnglishNumericWithUnit.TemperatureSuffixList = new Map([["F", "degrees fahrenheit|degree fahrenheit|deg fahrenheit|degs fahrenheit|fahrenheit|°f|degrees farenheit|degree farenheit|deg farenheit|degs farenheit|degrees f|degree f|deg f|degs f|farenheit|f"], ["K", "k|kelvin"], ["R", "rankine|°r"], ["D", "delisle|°de"], ["C", "degrees celsius|degree celsius|deg celsius|degs celsius|celsius|degrees celcius|degree celcius|celcius|deg celcius|degs celcius|degrees centigrade|degree centigrade|centigrade|degrees centigrate|degree centigrate|degs centigrate|deg centigrate|centigrate|degrees c|degree c|deg c|degs c|°c|c"], ["Degree", "degree|degrees|deg.|deg|°"]]); + EnglishNumericWithUnit.AmbiguousTemperatureUnitList = ['c', 'f', 'k']; + EnglishNumericWithUnit.VolumeSuffixList = new Map([["Cubic meter", "m3|cubic meter|cubic meters|cubic metre|cubic metres"], ["Cubic centimeter", "cubic centimeter|cubic centimetre|cubic centimeters|cubic centimetres"], ["Cubic millimiter", "cubic millimiter|cubic millimitre|cubic millimiters|cubic millimitres"], ["Hectoliter", "hectoliter|hectolitre|hectoliters|hectolitres"], ["Decaliter", "decaliter|decalitre|dekaliter|dekalitre|decaliters|decalitres|dekaliters|dekalitres"], ["Liter", "l|litre|liter|liters|litres"], ["Deciliter", "dl|deciliter|decilitre|deciliters|decilitres"], ["Centiliter", "cl|centiliter|centilitre|centiliters|centilitres"], ["Milliliter", "ml|mls|millilitre|milliliter|millilitres|milliliters"], ["Cubic yard", "cubic yard|cubic yards"], ["Cubic inch", "cubic inch|cubic inches"], ["Cubic foot", "cubic foot|cubic feet"], ["Cubic mile", "cubic mile|cubic miles"], ["Fluid ounce", "fl oz|fluid ounce|fluid ounces"], ["Teaspoon", "teaspoon|teaspoons"], ["Tablespoon", "tablespoon|tablespoons"], ["Pint", "pint|pints"], ["Volume unit", "fluid dram|gill|quart|minim|barrel|cord|peck|bushel|hogshead"]]); + EnglishNumericWithUnit.AmbiguousVolumeUnitList = ['l', 'ounce', 'oz', 'cup', 'peck', 'cord', 'gill']; + EnglishNumericWithUnit.WeightSuffixList = new Map([["Kilogram", "kg|kilogram|kilograms|kilo|kilos"], ["Gram", "g|gram|grams"], ["Milligram", "mg|milligram|milligrams"], ["Barrel", "barrels|barrel"], ["Gallon", "-gallon|gallons|gallon"], ["Metric ton", "metric tons|metric ton"], ["Ton", "-ton|ton|tons|tonne|tonnes"], ["Pound", "pound|pounds|lb"], ["Ounce", "-ounce|ounce|oz|ounces"], ["Weight unit", "pennyweight|grain|british long ton|US short hundredweight|stone|dram"]]); + EnglishNumericWithUnit.AmbiguousWeightUnitList = ['g', 'oz', 'stone', 'dram']; +})(EnglishNumericWithUnit = exports.EnglishNumericWithUnit || (exports.EnglishNumericWithUnit = {})); + +}); + +unwrapExports(englishNumericWithUnit); + +var base = createCommonjsModule(function (module, exports) { +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); + + + + + +class EnglishNumberWithUnitExtractorConfiguration { + constructor(ci) { + this.cultureInfo = ci; + this.unitNumExtractor = new recognizersTextNumber.EnglishNumberExtractor(); + this.buildPrefix = englishNumericWithUnit.EnglishNumericWithUnit.BuildPrefix; + this.buildSuffix = englishNumericWithUnit.EnglishNumericWithUnit.BuildSuffix; + this.connectorToken = ''; + this.compoundUnitConnectorRegex = recognizersText.RegExpUtility.getSafeRegExp(englishNumericWithUnit.EnglishNumericWithUnit.CompoundUnitConnectorRegex); + this.pmNonUnitRegex = recognizersText.RegExpUtility.getSafeRegExp(baseUnits.BaseUnits.PmNonUnitRegex); + } +} +exports.EnglishNumberWithUnitExtractorConfiguration = EnglishNumberWithUnitExtractorConfiguration; +class EnglishNumberWithUnitParserConfiguration extends parsers$8.BaseNumberWithUnitParserConfiguration { + constructor(ci) { + super(ci); + this.internalNumberExtractor = new recognizersTextNumber.EnglishNumberExtractor(recognizersTextNumber.NumberMode.Default); + this.internalNumberParser = recognizersTextNumber.AgnosticNumberParserFactory.getParser(recognizersTextNumber.AgnosticNumberParserType.Number, new recognizersTextNumber.EnglishNumberParserConfiguration()); + this.connectorToken = ''; + this.currencyNameToIsoCodeMap = englishNumericWithUnit.EnglishNumericWithUnit.CurrencyNameToIsoCodeMap; + this.currencyFractionCodeList = englishNumericWithUnit.EnglishNumericWithUnit.FractionalUnitNameToCodeMap; + } +} +exports.EnglishNumberWithUnitParserConfiguration = EnglishNumberWithUnitParserConfiguration; + +}); + +unwrapExports(base); + +var currency = createCommonjsModule(function (module, exports) { +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); + + + + +class EnglishCurrencyExtractorConfiguration extends base.EnglishNumberWithUnitExtractorConfiguration { + constructor(ci) { + if (!ci) { + ci = new recognizersTextNumber.CultureInfo(recognizersTextNumber.Culture.English); + } + super(ci); + this.extractType = constants$4.Constants.SYS_UNIT_CURRENCY; + // Reference Source: https:// en.wikipedia.org/wiki/List_of_circulating_currencies + this.suffixList = englishNumericWithUnit.EnglishNumericWithUnit.CurrencySuffixList; + this.prefixList = englishNumericWithUnit.EnglishNumericWithUnit.CurrencyPrefixList; + this.ambiguousUnitList = englishNumericWithUnit.EnglishNumericWithUnit.AmbiguousCurrencyUnitList; + } +} +exports.EnglishCurrencyExtractorConfiguration = EnglishCurrencyExtractorConfiguration; +class EnglishCurrencyParserConfiguration extends base.EnglishNumberWithUnitParserConfiguration { + constructor(ci) { + if (!ci) { + ci = new recognizersTextNumber.CultureInfo(recognizersTextNumber.Culture.English); + } + super(ci); + this.BindDictionary(englishNumericWithUnit.EnglishNumericWithUnit.CurrencySuffixList); + this.BindDictionary(englishNumericWithUnit.EnglishNumericWithUnit.CurrencyPrefixList); + } +} +exports.EnglishCurrencyParserConfiguration = EnglishCurrencyParserConfiguration; + +}); + +unwrapExports(currency); + +var temperature = createCommonjsModule(function (module, exports) { +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); + + + + +class EnglishTemperatureExtractorConfiguration extends base.EnglishNumberWithUnitExtractorConfiguration { + constructor(ci) { + if (!ci) { + ci = new recognizersTextNumber.CultureInfo(recognizersTextNumber.Culture.English); + } + super(ci); + this.extractType = constants$4.Constants.SYS_UNIT_TEMPERATURE; + this.suffixList = englishNumericWithUnit.EnglishNumericWithUnit.TemperatureSuffixList; + this.prefixList = new Map(); + this.ambiguousUnitList = englishNumericWithUnit.EnglishNumericWithUnit.AmbiguousTemperatureUnitList; + } +} +exports.EnglishTemperatureExtractorConfiguration = EnglishTemperatureExtractorConfiguration; +class EnglishTemperatureParserConfiguration extends base.EnglishNumberWithUnitParserConfiguration { + constructor(ci) { + if (!ci) { + ci = new recognizersTextNumber.CultureInfo(recognizersTextNumber.Culture.English); + } + super(ci); + this.BindDictionary(englishNumericWithUnit.EnglishNumericWithUnit.TemperatureSuffixList); + } +} +exports.EnglishTemperatureParserConfiguration = EnglishTemperatureParserConfiguration; + +}); + +unwrapExports(temperature); + +var dimension = createCommonjsModule(function (module, exports) { +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); + + + + +const dimensionSuffixList = new Map([ + ...englishNumericWithUnit.EnglishNumericWithUnit.InformationSuffixList, + ...englishNumericWithUnit.EnglishNumericWithUnit.AreaSuffixList, + ...englishNumericWithUnit.EnglishNumericWithUnit.LengthSuffixList, + ...englishNumericWithUnit.EnglishNumericWithUnit.SpeedSuffixList, + ...englishNumericWithUnit.EnglishNumericWithUnit.VolumeSuffixList, + ...englishNumericWithUnit.EnglishNumericWithUnit.WeightSuffixList +]); +class EnglishDimensionExtractorConfiguration extends base.EnglishNumberWithUnitExtractorConfiguration { + constructor(ci) { + if (!ci) { + ci = new recognizersTextNumber.CultureInfo(recognizersTextNumber.Culture.English); + } + super(ci); + this.extractType = constants$4.Constants.SYS_UNIT_DIMENSION; + this.suffixList = dimensionSuffixList; + this.prefixList = new Map(); + this.ambiguousUnitList = englishNumericWithUnit.EnglishNumericWithUnit.AmbiguousDimensionUnitList; + } +} +exports.EnglishDimensionExtractorConfiguration = EnglishDimensionExtractorConfiguration; +class EnglishDimensionParserConfiguration extends base.EnglishNumberWithUnitParserConfiguration { + constructor(ci) { + if (!ci) { + ci = new recognizersTextNumber.CultureInfo(recognizersTextNumber.Culture.English); + } + super(ci); + this.BindDictionary(dimensionSuffixList); + } +} +exports.EnglishDimensionParserConfiguration = EnglishDimensionParserConfiguration; + +}); + +unwrapExports(dimension); + +var age = createCommonjsModule(function (module, exports) { +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); + + + + +class EnglishAgeExtractorConfiguration extends base.EnglishNumberWithUnitExtractorConfiguration { + constructor(ci) { + if (!ci) { + ci = new recognizersTextNumber.CultureInfo(recognizersTextNumber.Culture.English); + } + super(ci); + this.extractType = constants$4.Constants.SYS_UNIT_AGE; + this.suffixList = englishNumericWithUnit.EnglishNumericWithUnit.AgeSuffixList; + this.prefixList = new Map(); + this.ambiguousUnitList = new Array(); + } +} +exports.EnglishAgeExtractorConfiguration = EnglishAgeExtractorConfiguration; +class EnglishAgeParserConfiguration extends base.EnglishNumberWithUnitParserConfiguration { + constructor(ci) { + if (!ci) { + ci = new recognizersTextNumber.CultureInfo(recognizersTextNumber.Culture.English); + } + super(ci); + this.BindDictionary(englishNumericWithUnit.EnglishNumericWithUnit.AgeSuffixList); + } +} +exports.EnglishAgeParserConfiguration = EnglishAgeParserConfiguration; + +}); + +unwrapExports(age); + +var spanishNumericWithUnit = createCommonjsModule(function (module, exports) { +"use strict"; +// ------------------------------------------------------------------------------ +// +// This code was generated by a tool. +// Changes to this file may cause incorrect behavior and will be lost if +// the code is regenerated. +// +// ------------------------------------------------------------------------------ +Object.defineProperty(exports, "__esModule", { value: true }); +var SpanishNumericWithUnit; +(function (SpanishNumericWithUnit) { + SpanishNumericWithUnit.AgeSuffixList = new Map([["Año", "años|año"], ["Mes", "meses|mes"], ["Semana", "semanas|semana"], ["Día", "dias|días|día|dia"]]); + SpanishNumericWithUnit.AreaSuffixList = new Map([["Kilómetro cuadrado", "kilómetro cuadrado|kilómetros cuadrados|km2|km^2|km²"], ["Hectómetro cuadrado", "hectómetro cuadrado|hectómetros cuadrados|hm2|hm^2|hm²|hectárea|hectáreas"], ["Decámetro cuadrado", "decámetro cuadrado|decámetros cuadrados|dam2|dam^2|dam²|área|áreas"], ["Metro cuadrado", "metro cuadrado|metros cuadrados|m2|m^2|m²"], ["Decímetro cuadrado", "decímetro cuadrado|decímetros cuadrados|dm2|dm^2|dm²"], ["Centímetro cuadrado", "centímetro cuadrado|centímetros cuadrados|cm2|cm^2|cm²"], ["Milímetro cuadrado", "milímetro cuadrado|milímetros cuadrados|mm2|mm^2|mm²"], ["Pulgada cuadrado", "pulgada cuadrada|pulgadas cuadradas"], ["Pie cuadrado", "pie cuadrado|pies cuadrados|pie2|pie^2|pie²|ft2|ft^2|ft²"], ["Yarda cuadrado", "yarda cuadrada|yardas cuadradas|yd2|yd^2|yd²"], ["Acre", "acre|acres"]]); + SpanishNumericWithUnit.AreaAmbiguousValues = ['área', 'áreas']; + SpanishNumericWithUnit.CurrencySuffixList = new Map([["Dólar", "dólar|dólares"], ["Peso", "peso|pesos"], ["Rublo", "rublo|rublos"], ["Libra", "libra|libras"], ["Florín", "florín|florines"], ["Dinar", "dinar|dinares"], ["Franco", "franco|francos"], ["Rupia", "rupia|rupias"], ["Escudo", "escudo|escudos"], ["Chelín", "chelín|chelines"], ["Lira", "lira|liras"], ["Centavo", "centavo|centavos"], ["Céntimo", "céntimo|céntimos"], ["Centésimo", "centésimo|centésimos"], ["Penique", "penique|peniques"], ["Euro", "euro|euros|€|eur"], ["Céntimo de Euro", "céntimo de euro|céntimos de euros"], ["Dólar del Caribe Oriental", "dólar del Caribe Oriental|dólares del Caribe Oriental|ec$|xcd"], ["Centavo del Caribe Oriental", "centavo del Caribe Oriental|centavos del Caribe Oriental"], ["Franco CFA de África Occidental", "franco CFA de África Occidental|francos CFA de África Occidental|fcfa|xof"], ["Céntimo de CFA de África Occidental", "céntimo de CFA de África Occidental|céntimos de CFA de África Occidental"], ["Franco CFA de África Central", "franco CFA de África Central|francos CFA de África Central|xaf"], ["Céntimo de CFA de África Central", "céntimo de CFA de África Central|céntimos de CFA de África Central"], ["Apsar", "apsar|apsares"], ["Afgani afgano", "afgani afgano|؋|afn|afganis|afgani"], ["Pul", "pul|puls"], ["Lek albanés", "lek|lekë|lekes|lek albanés"], ["Qindarka", "qindarka|qindarkë|qindarkas"], ["Kwanza angoleño", "kwanza angoleño|kwanzas angoleños|kwanza angoleños|kwanzas angoleño|kwanzas|aoa|kz"], ["Cêntimo angoleño", "cêntimo angoleño|cêntimo|cêntimos"], ["Florín antillano neerlandés", "florín antillano neerlandés|florínes antillano neerlandés|ƒ antillano neerlandés|ang|naƒ"], ["Cent antillano neerlandés", "cent|centen"], ["Riyal saudí", "riyal saudí|riyales saudí|sar"], ["Halalá saudí", "halalá saudí|hallalah"], ["Dinar argelino", "dinar argelino|dinares argelinos|dzd"], ["Céntimo argelino", "centimo argelino|centimos argelinos|"], ["Peso argentino", "peso argentino|pesos argentinos|peso|pesos|ar$|ars"], ["Centavo argentino", "centavo argentino|centavos argentinos|centavo|ctvo.|ctvos."], ["Dram armenio", "dram armenio|dram armenios|dram|դր."], ["Luma armenio", "luma armenio|luma armenios"], ["Florín arubeño", "florín arubeño|florines arubeños|ƒ arubeños|aƒ|awg"], ["Yotin arubeño", "yotin arubeño|yotines arubeños"], ["Dólar australiano", "dólar australiano|dólares australianos|a$|aud"], ["Centavo australiano", "centavo australiano|centavos australianos"], ["Manat azerí", "manat azerí|man|azn"], ["Qəpik azerí", "qəpik azerí|qəpik"], ["Dólar bahameño", "dólar bahameño|dólares bahameños|b$|bsd"], ["Centavo bahameño", "centavo bahameño|centavos bahameños"], ["Dinar bahreiní", "dinar bahreiní|dinares bahreinies|bhd"], ["Fil bahreiní", "fil bahreiní|fils bahreinies"], ["Taka bangladeshí", "taka bangladeshí|takas bangladeshí|bdt"], ["Poisha bangladeshí", "poisha bangladeshí|poishas bangladeshí"], ["Dólar de Barbados", "dólar de barbados|dólares de barbados|bbd"], ["Centavo de Barbados", "centavo de barbados|centavos de barbados"], ["Dólar beliceño", "dólar beliceño|dólares beliceños|bz$|bzd"], ["Centavo beliceño", "centavo beliceño|centavos beliceños"], ["Dólar bermudeño", "dólar bermudeño|dólares bermudeños|bd$|bmd"], ["Centavo bermudeño", "centavo bermudeño|centavos bermudeños"], ["Rublo bielorruso", "rublo bielorruso|rublos bielorrusos|br|byr"], ["Kópek bielorruso", "kópek bielorruso|kópeks bielorrusos|kap"], ["Kyat birmano", "kyat birmano|kyats birmanos|mmk"], ["Pya birmano", "pya birmano|pyas birmanos"], ["Boliviano", "boliviano|bolivianos|bob|bs"], ["Centésimo Boliviano", "centésimo boliviano|centésimos bolivianos"], ["Marco bosnioherzegovino", "marco convertible|marco bosnioherzegovino|marcos convertibles|marcos bosnioherzegovinos|bam"], ["Feningas bosnioherzegovino", "feninga convertible|feninga bosnioherzegovina|feningas convertibles"], ["Pula", "pula|bwp"], ["Thebe", "thebe"], ["Real brasileño", "real brasileño|reales brasileños|r$|brl"], ["Centavo brasileño", "centavo brasileño|centavos brasileños"], ["Dólar de Brunéi", "dólar de brunei|dólares de brunéi|bnd"], ["Sen de Brunéi", "sen|sen de brunéi"], ["Lev búlgaro", "lev búlgaro|leva búlgaros|lv|bgn"], ["Stotinki búlgaro", "stotinka búlgaro|stotinki búlgaros"], ["Franco de Burundi", "franco de burundi|francos de burundi|fbu|fib"], ["Céntimo Burundi", "céntimo burundi|céntimos burundies"], ["Ngultrum butanés", "ngultrum butanés|ngultrum butaneses|btn"], ["Chetrum butanés", "chetrum butanés|chetrum butaneses"], ["Escudo caboverdiano", "escudo caboverdiano|escudos caboverdianos|cve"], ["Riel camboyano", "riel camboyano|rieles camboyanos|khr"], ["Dólar canadiense", "dólar canadiense|dólares canadienses|c$|cad"], ["Centavo canadiense", "centavo canadiense|centavos canadienses"], ["Peso chileno", "peso chileno|pesos chilenos|cpl"], ["Yuan chino", "yuan chino|yuanes chinos|yuan|yuanes|renminbi|rmb|cny|¥"], ["Peso colombiano", "peso colombiano|pesos colombianos|cop|col$"], ["Centavo colombiano", "centavo colombiano|centavos colombianos"], ["Franco comorano", "franco comorano|francos comoranos|kmf|₣"], ["Franco congoleño", "franco congoleño|francos congoleños|cdf"], ["Céntimo congoleño", "céntimo congoleño|céntimos congoleños"], ["Won norcoreano", "won norcoreano|wŏn norcoreano|wŏn norcoreanos|kpw"], ["Chon norcoreano", "chon norcoreano|chŏn norcoreano|chŏn norcoreanos|chon norcoreanos"], ["Won surcoreano", "wŏn surcoreano|won surcoreano|wŏnes surcoreanos|wones surcoreanos|krw"], ["Chon surcoreano", "chon surcoreano|chŏn surcoreano|chŏn surcoreanos|chon surcoreanos"], ["Colón costarricense", "colón costarricense|colones costarricenses|crc"], ["Kuna croata", "kuna croata|kuna croatas|hrk"], ["Lipa croata", "lipa croata|lipa croatas"], ["Peso cubano", "peso cubano|pesos cubanos|cup"], ["Peso cubano convertible", "peso cubano convertible|pesos cubanos convertible|cuc"], ["Corona danesa", "corona danesa|coronas danesas|dkk"], ["Libra egipcia", "libra egipcia|libras egipcias|egp|le"], ["Piastra egipcia", "piastra egipcia|piastras egipcias"], ["Colón salvadoreño", "colón salvadoreño|colones salvadoreños|svc"], ["Dirham de los Emiratos Árabes Unidos", "dirham|dirhams|dirham de los Emiratos Árabes Unidos|aed|dhs"], ["Nakfa", "nakfa|nfk|ern"], ["Céntimo de Nakfa", "céntimo de nakfa|céntimos de nakfa"], ["Peseta", "peseta|pesetas|pts.|ptas.|esp"], ["Dólar estadounidense", "dólar estadounidense|dólares estadounidenses|usd|u$d|us$"], ["Corona estonia", "corona estonia|coronas estonias|eek"], ["Senti estonia", "senti estonia|senti estonias"], ["Birr etíope", "birr etíope|birr etíopes|br|etb"], ["Santim etíope", "santim etíope|santim etíopes"], ["Peso filipino", "peso filipino|pesos filipinos|php"], ["Marco finlandés", "marco finlandés|marcos finlandeses"], ["Dólar fiyiano", "dólar fiyiano|dólares fiyianos|fj$|fjd"], ["Centavo fiyiano", "centavo fiyiano|centavos fiyianos"], ["Dalasi", "dalasi|gmd"], ["Bututs", "butut|bututs"], ["Lari georgiano", "lari georgiano|lari georgianos|gel"], ["Tetri georgiano", "tetri georgiano|tetri georgianos"], ["Cedi", "cedi|ghs|gh₵"], ["Pesewa", "pesewa"], ["Libra gibraltareña", "libra gibraltareña|libras gibraltareñas|gip"], ["Penique gibraltareña", "penique gibraltareña|peniques gibraltareñas"], ["Quetzal guatemalteco", "quetzal guatemalteco|quetzales guatemaltecos|quetzal|quetzales|gtq"], ["Centavo guatemalteco", "centavo guatemalteco|centavos guatemaltecos"], ["Libra de Guernsey", "libra de Guernsey|libras de Guernsey|ggp"], ["Penique de Guernsey", "penique de Guernsey|peniques de Guernsey"], ["Franco guineano", "franco guineano|francos guineanos|gnf|fg"], ["Céntimo guineano", "céntimo guineano|céntimos guineanos"], ["Dólar guyanés", "dólar guyanés|dólares guyaneses|gyd|gy"], ["Gourde haitiano", "gourde haitiano|gourde haitianos|htg"], ["Céntimo haitiano", "céntimo haitiano|céntimos haitianos"], ["Lempira hondureño", "lempira hondureño|lempira hondureños|hnl"], ["Centavo hondureño", "centavo hondureño|centavos hondureño"], ["Dólar de Hong Kong", "dólar de hong kong|dólares de hong kong|hk$|hkd"], ["Forinto húngaro", "forinto húngaro|forinto húngaros|huf"], ["Rupia india", "rupia india|rupias indias|inr"], ["Paisa india", "paisa india|paise indias"], ["Rupia indonesia", "rupia indonesia|rupias indonesias|idr"], ["Sen indonesia", "sen indonesia|sen indonesias"], ["Rial iraní", "rial iraní|rial iranies|irr"], ["Dinar iraquí", "dinar iraquí|dinares iraquies|iqd"], ["Fil iraquí", "fil iraquí|fils iraquies"], ["Libra manesa", "libra manesa|libras manesas|imp"], ["Penique manes", "penique manes|peniques maneses"], ["Corona islandesa", "corona islandesa|coronas islandesas|isk|íkr"], ["Aurar islandes", "aurar islandes|aurar islandeses"], ["Dólar de las Islas Caimán", "dólar de las Islas Caimán|dólares de las Islas Caimán|ci$|kyd"], ["Dólar de las Islas Cook", "dólar de las Islas Cook|dólares de las Islas Cook"], ["Corona feroesa", "corona feroesa|coronas feroesas|fkr"], ["Libra malvinense", "libra malvinense|libras malvinenses|fk£|fkp"], ["Dólar de las Islas Salomón", "dólar de las Islas Salomón|dólares de las Islas Salomón|sbd"], ["Nuevo shéquel", "nuevo shéquel|nuevos shéquel|ils"], ["Agorot", "agorot"], ["Dólar jamaiquino", "dólar jamaiquino|dólares jamaiquinos|j$|ja$|jmd"], ["Yen", "yen|yenes|jpy"], ["Libra de Jersey", "libra de Jersey|libras de Jersey|jep"], ["Dinar jordano", "dinar jordano|dinares jordanos|jd|jod"], ["Piastra jordano", "piastra jordano|piastras jordanos"], ["Tenge kazajo", "tenge|tenge kazajo|kzt"], ["Chelín keniano", "chelín keniano|chelines kenianos|ksh|kes"], ["Som kirguís", "som kirguís|kgs"], ["Tyiyn", "tyiyn"], ["Dólar de Kiribati", "dólar de Kiribati|dólares de Kiribati"], ["Dinar kuwaití", "dinar kuwaití|dinares kuwaití"], ["Kip laosiano", "kip|kip laosiano|kip laosianos|lak"], ["Att laosiano", "att|att laosiano|att laosianos"], ["Loti", "loti|maloti|lsl"], ["Sente", "sente|lisente"], ["Libra libanesa", "libra libanesa|libras libanesas|lbp"], ["Dólar liberiano", "dólar liberiano|dólares liberianos|l$|lrd"], ["Dinar libio", "dinar libio|dinares libios|ld|lyd"], ["Dirham libio", "dirham libio|dirhams libios"], ["Litas lituana", "litas lituana|litai lituanas|ltl"], ["Pataca macaense", "pataca macaense|patacas macaenses|mop$|mop"], ["Avo macaense", "avo macaense|avos macaenses"], ["Ho macaense", "ho macaense|ho macaenses"], ["Denar macedonio", "denar macedonio|denare macedonios|den|mkd"], ["Deni macedonio", "deni macedonio|deni macedonios"], ["Ariary malgache", "ariary malgache|ariary malgaches|mga"], ["Iraimbilanja malgache", "iraimbilanja malgache|iraimbilanja malgaches"], ["Ringgit malayo", "ringgit malayo|ringgit malayos|rm|myr"], ["Sen malayo", "sen malayo|sen malayos"], ["Kwacha malauí", "kwacha malauí|mk|mwk"], ["Támbala malauí", "támbala malauí"], ["Rupia de Maldivas", "rupia de Maldivas|rupias de Maldivas|mvr"], ["Dirham marroquí", "dirham marroquí|dirhams marroquies|mad"], ["Rupia de Mauricio", "rupia de Mauricio|rupias de Mauricio|mur"], ["Uguiya", "uguiya|uguiyas|mro"], ["Jum", "jum|jums"], ["Peso mexicano", "peso mexicano|pesos mexicanos|mxn"], ["Centavo mexicano", "centavo mexicano|centavos mexicanos"], ["Leu moldavo", "leu moldavo|lei moldavos|mdl"], ["Ban moldavo", "ban moldavo|bani moldavos"], ["Tugrik mongol", "tugrik mongol|tugrik|tugrik mongoles|tug|mnt"], ["Metical mozambiqueño", "metical|metical mozambiqueño|meticales|meticales mozambiqueños|mtn|mzn"], ["Dram de Nagorno Karabaj", "dram de Nagorno Karabaj|drams de Nagorno Karabaj|"], ["Luma de Nagorno Karabaj", "luma de Nagorno Karabaj"], ["Dólar namibio", "dólar namibio|dólares namibios|n$|nad"], ["Centavo namibio", "centavo namibio|centavos namibios"], ["Rupia nepalí", "rupia nepalí|rupias nepalies|npr"], ["Paisa nepalí", "paisa nepalí|paisas nepalies"], ["Córdoba nicaragüense", "córdoba nicaragüense|córdobas nicaragüenses|c$|nio"], ["Centavo nicaragüense", "centavo nicaragüense|centavos nicaragüenses"], ["Naira", "naira|ngn"], ["Kobo", "kobo"], ["Corona noruega", "corona noruega|coronas noruegas|nok"], ["Franco CFP", "franco cfp|francos cfp|xpf"], ["Dólar neozelandés", "dólar neozelandés|dólares neozelandeses|dólar de Nueva Zelanda|dólares de Nueva Zelanda|nz$|nzd"], ["Centavo neozelandés", "centavo neozelandés|centavo de Nueva Zelanda|centavos de Nueva Zelanda|centavos neozelandeses"], ["Rial omaní", "rial omaní|riales omanies|omr"], ["Baisa omaní", "baisa omaní|baisa omanies"], ["Florín neerlandés", "florín neerlandés|florines neerlandeses|nlg"], ["Rupia pakistaní", "rupia pakistaní|rupias pakistanies|pkr"], ["Paisa pakistaní", "paisa pakistaní|paisas pakistanies"], ["Balboa panameño", "balboa panameño|balboa panameños|pab"], ["Centésimo panameño", "centésimo panameño|centésimos panameños"], ["Kina", "kina|pkg|pgk"], ["Toea", "toea"], ["Guaraní", "guaraní|guaranies|gs|pyg"], ["Sol", "sol|soles|nuevo sol|pen|s#."], ["Céntimo de sol", "céntimo de sol|céntimos de sol"], ["Złoty", "złoty|esloti|eslotis|zł|pln"], ["Groszy", "groszy"], ["Riyal qatarí", "riyal qatarí|riyal qataries|qr|qar"], ["Dirham qatarí", "dirham qatarí|dirhams qataries"], ["Libra esterlina", "libra esterlina|libras esterlinas|gbp"], ["Corona checa", "corona checa|coronas checas|kc|czk"], ["Peso dominicano", "peso dominicano|pesos dominicanos|rd$|dop"], ["Centavo dominicano", "centavo dominicano|centavos dominicanos"], ["Franco ruandés", "franco ruandés|francos ruandeses|rf|rwf"], ["Céntimo ruandés", "céntimo ruandés|céntimos ruandeses"], ["Leu rumano", "leu rumano|lei rumanos|ron"], ["Ban rumano", "ban rumano|bani rumanos"], ["Rublo ruso", "rublo ruso|rublos rusos|rub"], ["Kopek ruso", "kopek ruso|kopeks rusos"], ["Tala", "tala|tālā|ws$|sat|wst"], ["Sene", "sene"], ["Libra de Santa Helena", "libra de Santa Helena|libras de Santa Helena|shp"], ["Penique de Santa Helena", "penique de Santa Helena|peniques de Santa Helena"], ["Dobra", "dobra|db|std"], ["Dinar serbio", "dinar serbio|dinares serbios|rsd"], ["Para serbio", "para serbio|para serbios"], ["Rupia de Seychelles", "rupia de Seychelles|rupias de Seychelles|scr"], ["Centavo de Seychelles", "centavo de Seychelles|centavos de Seychelles"], ["Leone", "leone|le|sll"], ["Dólar de Singapur", "dólar de singapur|dólares de singapur|sgb"], ["Centavo de Singapur", "centavo de Singapur|centavos de Singapur"], ["Libra siria", "libra siria|libras sirias|s£|syp"], ["Piastra siria", "piastra siria|piastras sirias"], ["Chelín somalí", "chelín somalí|chelines somalies|sos"], ["Centavo somalí", "centavo somalí|centavos somalies"], ["Chelín somalilandés", "chelín somalilandés|chelines somalilandeses"], ["Centavo somalilandés", "centavo somalilandés|centavos somalilandeses"], ["Rupia de Sri Lanka", "rupia de Sri Lanka|rupias de Sri Lanka|lkr"], ["Céntimo de Sri Lanka", "céntimo de Sri Lanka|céntimos de Sri Lanka"], ["Lilangeni", "lilangeni|emalangeni|szl"], ["Rand sudafricano", "rand|rand sudafricano|zar"], ["Libra sudanesa", "libra sudanesa|libras sudanesas|sdg"], ["Piastra sudanesa", "piastra sudanesa|piastras sudanesas"], ["Libra sursudanesa", "libra sursudanesa|libras sursudanesa|ssp"], ["Piastra sursudanesa", "piastra sursudanesa|piastras sursudanesas"], ["Corona sueca", "corona sueca|coronas suecas|sek"], ["Franco suizo", "franco suizo|francos suizos|sfr|chf"], ["Rappen suizo", "rappen suizo|rappens suizos"], ["Dólar surinamés", "óolar surinamés|dólares surinameses|srd"], ["Centavo surinamés", "centavo surinamés|centavos surinamés"], ["Baht tailandés", "baht tailandés|baht tailandeses|thb"], ["Satang tailandés", "satang tailandés|satang tailandeses"], ["Nuevo dólar taiwanés", "nuevo dólar taiwanés|dólar taiwanés|dólares taiwaneses|twd"], ["Centavo taiwanés", "centavo taiwanés|centavos taiwaneses"], ["Chelín tanzano", "chelín tanzano|chelines tanzanos|tzs"], ["Centavo tanzano", "centavo tanzano|centavos tanzanos"], ["Somoni tayiko", "somoni tayiko|somoni|tjs"], ["Diram", "diram|dirams"], ["Paʻanga", "dólar tongano|dólares tonganos|paʻanga|pa'anga|top"], ["Seniti", "seniti"], ["Rublo de Transnistria", "rublo de Transnistria|rublos de Transnistria"], ["Kopek de Transnistria", "kopek de Transnistria|kopeks de Transnistria"], ["Dólar trinitense", "dólar trinitense|dólares trinitenses|ttd"], ["Centavo trinitense", "centavo trinitense|centavos trinitenses"], ["Dinar tunecino", "dinar tunecino|dinares tunecinos|tnd"], ["Millime tunecino", "millime tunecino|millimes tunecinos"], ["Lira turca", "lira turca|liras turcas|try"], ["Kuruş turca", "kuruş turca|kuruş turcas"], ["Manat turkmeno", "manat turkmeno|manat turkmenos|tmt"], ["Tennesi turkmeno", "tennesi turkmeno|tenge turkmeno"], ["Dólar tuvaluano", "dólar tuvaluano|dólares tuvaluanos"], ["Centavo tuvaluano", "centavo tuvaluano|centavos tuvaluanos"], ["Grivna", "grivna|grivnas|uah"], ["Kopiyka", "kopiyka|kópeks"], ["Chelín ugandés", "chelín ugandés|chelines ugandeses|ugx"], ["Centavo ugandés", "centavo ugandés|centavos ugandeses"], ["Peso uruguayo", "peso uruguayo|pesos uruguayos|uyu"], ["Centésimo uruguayo", "centésimo uruguayo|centésimos uruguayos"], ["Som uzbeko", "som uzbeko|som uzbekos|uzs"], ["Tiyin uzbeko", "tiyin uzbeko|tiyin uzbekos"], ["Vatu", "vatu|vuv"], ["Bolívar fuerte", "bolívar fuerte|bolívar|bolívares|vef"], ["Céntimo de bolívar", "céntimo de bolívar|céntimos de bolívar"], ["Đồng vietnamita", "Đồng vietnamita|dong vietnamita|dong vietnamitas|vnd"], ["Hào vietnamita", "Hào vietnamita|hao vietnamita|hao vietnamitas"], ["Rial yemení", "rial yemení|riales yemenies|yer"], ["Fils yemení", "fils yemení|fils yemenies"], ["Franco yibutiano", "franco yibutiano|francos yibutianos|djf"], ["Dinar yugoslavo", "dinar yugoslavo|dinares yugoslavos|yud"], ["Kwacha zambiano", "kwacha zambiano|kwacha zambianos|zmw"], ["Ngwee zambiano", "ngwee zambiano|ngwee zambianos"]]); + SpanishNumericWithUnit.CompoundUnitConnectorRegex = `(?[^.])`; + SpanishNumericWithUnit.CurrencyPrefixList = new Map([["Dólar", "$"], ["Dólar estadounidense", "us$|u$d|usd"], ["Dólar del Caribe Oriental", "ec$|xcd"], ["Dólar australiano", "a$|aud"], ["Dólar bahameño", "b$|bsd"], ["Dólar de Barbados", "bds$|bbd"], ["Dólar beliceño", "bz$|bzd"], ["Dólar bermudeño", "bd$|bmd"], ["Dólar de Brunéi", "brunéi $|bnd"], ["Dólar de Singapur", "s$|sgd"], ["Dólar canadiense", "c$|can$|cad"], ["Dólar de las Islas Caimán", "ci$|kyd"], ["Dólar neozelandés", "nz$|nzd"], ["Dólar fiyiano", "fj$|fjd"], ["Dólar guyanés", "gy$|gyd"], ["Dólar de Hong Kong", "hk$|hkd"], ["Dólar jamaiquino", "j$|ja$|jmd"], ["Dólar liberiano", "l$|lrd"], ["Dólar namibio", "n$|nad"], ["Dólar de las Islas Salomón", "si$|sbd"], ["Nuevo dólar taiwanés", "nt$|twd"], ["Real brasileño", "r$|brl"], ["Guaraní", "₲|gs.|pyg"], ["Dólar trinitense", "tt$|ttd"], ["Yuan chino", "¥|cny|rmb"], ["Yen", "¥|jpy"], ["Euro", "€|eur"], ["Florín", "ƒ"], ["Libra", "£|gbp"], ["Colón costarricense", "₡"], ["Lira turca", "₺"]]); + SpanishNumericWithUnit.AmbiguousCurrencyUnitList = ['le']; + SpanishNumericWithUnit.DimensionSuffixList = new Map([["Kilómetro", "km|kilometro|kilómetro|kilometros|kilómetros"], ["Hectómetro", "hm|hectometro|hectómetro|hectometros|hectómetros"], ["Decámetro", "decametro|decámetro|decametros|decámetros|dam"], ["Metro", "m|m.|metro|metros"], ["Decímetro", "dm|decimetro|decímetro|decimetros|decímetros"], ["Centímetro", "cm|centimetro|centímetro|centimetros|centimetros"], ["Milímetro", "mm|milimetro|milímetro|milimetros|milímetros"], ["Micrómetro", "µm|um|micrometro|micrómetro|micrometros|micrómetros|micrón|micrónes"], ["Nanómetro", "nm|nanometro|nanómetro|nanometros|nanómetros"], ["Picómetro", "pm|picometro|picómetro|picometros|picometros"], ["Milla", "mi|milla|millas"], ["Yarda", "yd|yarda|yardas"], ["Pulgada", "pulgada|pulgadas|\""], ["Pie", "pie|pies|ft"], ["Año luz", "año luz|años luz|al"], ["Metro por segundo", "metro/segundo|m/s|metro por segundo|metros por segundo|metros por segundos"], ["Kilómetro por hora", "km/h|kilómetro por hora|kilometro por hora|kilómetros por hora|kilometros por hora|kilómetro/hora|kilometro/hora|kilómetros/hora|kilometros/hora"], ["Kilómetro por minuto", "km/min|kilómetro por minuto|kilometro por minuto|kilómetros por minuto|kilometros por minuto|kilómetro/minuto|kilometro/minuto|kilómetros/minuto|kilometros/minuto"], ["Kilómetro por segundo", "km/seg|kilómetro por segundo|kilometro por segundo|kilómetros por segundo|kilometros por segundo|kilómetro/segundo|kilometro/segundo|kilómetros/segundo|kilometros/segundo"], ["Milla por hora", "mph|milla por hora|mi/h|milla/hora|millas/hora|millas por hora"], ["Nudo", "kt|nudo|nudos|kn"], ["Pie por segundo", "ft/s|pie/s|ft/seg|pie/seg|pie por segundo|pies por segundo"], ["Pie por minuto", "ft/min|pie/min|pie por minuto|pies por minuto"], ["Yarda por minuto", "yardas por minuto|yardas/minuto|yardas/min"], ["Yarda por segundo", "yardas por segundo|yardas/segundo|yardas/seg"], ["Kilómetro cuadrado", "kilómetro cuadrado|kilómetros cuadrados|km2|km^2|km²"], ["Hectómetro cuadrado", "hectómetro cuadrado|hectómetros cuadrados|hm2|hm^2|hm²|hectárea|hectáreas"], ["Decámetro cuadrado", "decámetro cuadrado|decámetros cuadrados|dam2|dam^2|dam²|área|áreas"], ["Metro cuadrado", "metro cuadrado|metros cuadrados|m2|m^2|m²"], ["Decímetro cuadrado", "decímetro cuadrado|decímetros cuadrados|dm2|dm^2|dm²"], ["Centímetro cuadrado", "centímetro cuadrado|centímetros cuadrados|cm2|cm^2|cm²"], ["Milímetro cuadrado", "milímetro cuadrado|milímetros cuadrados|mm2|mm^2|mm²"], ["Pulgada cuadrado", "pulgada cuadrada|pulgadas cuadradas"], ["Pie cuadrado", "pie cuadrado|pies cuadrados|pie2|pie^2|pie²|ft2|ft^2|ft²"], ["Yarda cuadrado", "yarda cuadrada|yardas cuadradas|yd2|yd^2|yd²"], ["Acre", "acre|acres"], ["Kilómetro cúbico", "kilómetro cúbico|kilómetros cúbico|km3|km^3|km³"], ["Hectómetro cúbico", "hectómetro cúbico|hectómetros cúbico|hm3|hm^3|hm³"], ["Decámetro cúbico", "decámetro cúbico|decámetros cúbico|dam3|dam^3|dam³"], ["Metro cúbico", "metro cúbico|metros cúbico|m3|m^3|m³"], ["Decímetro cúbico", "decímetro cúbico|decímetros cúbico|dm3|dm^3|dm³"], ["Centímetro cúbico", "centímetro cúbico|centímetros cúbico|cc|cm3|cm^3|cm³"], ["Milímetro cúbico", "milímetro cúbico|milímetros cúbico|mm3|mm^3|mm³"], ["Pulgada cúbica", "pulgada cúbics|pulgadas cúbicas"], ["Pie cúbico", "pie cúbico|pies cúbicos|pie3|pie^3|pie³|ft3|ft^3|ft³"], ["Yarda cúbica", "yarda cúbica|yardas cúbicas|yd3|yd^3|yd³"], ["Hectolitro", "hectolitro|hectolitros|hl"], ["Litro", "litro|litros|lts|l"], ["Mililitro", "mililitro|mililitros|ml"], ["Galón", "galón|galones"], ["Pinta", "pinta|pintas"], ["Barril", "barril|barriles"], ["Onza líquida", "onza líquida|onzas líquidas"], ["Tonelada métrica", "tonelada métrica|toneladas métricas"], ["Tonelada", "ton|tonelada|toneladas"], ["Kilogramo", "kg|kilogramo|kilogramos"], ["Hectogramo", "hg|hectogramo|hectogramos"], ["Decagramo", "dag|decagramo|decagramos"], ["Gramo", "g|gr|gramo|gramos"], ["Decigramo", "dg|decigramo|decigramos"], ["Centigramo", "cg|centigramo|centigramos"], ["Miligramo", "mg|miligramo|miligramos"], ["Microgramo", "µg|ug|microgramo|microgramos"], ["Nanogramo", "ng|nanogramo|nanogramos"], ["Picogramo", "pg|picogramo|picogramos"], ["Libra", "lb|libra|libras"], ["Onza", "oz|onza|onzas"], ["Grano", "grano|granos"], ["Quilate", "ct|kt|quilate|quilates"], ["bit", "bit|bits"], ["kilobit", "kilobit|kilobits|kb|kbit"], ["megabit", "megabit|megabits|Mb|Mbit"], ["gigabit", "gigabit|gigabits|Gb|Gbit"], ["terabit", "terabit|terabits|Tb|Tbit"], ["petabit", "petabit|petabits|Pb|Pbit"], ["kibibit", "kibibit|kibibits|kib|kibit"], ["mebibit", "mebibit|mebibits|Mib|Mibit"], ["gibibit", "gibibit|gibibits|Gib|Gibit"], ["tebibit", "tebibit|tebibits|Tib|Tibit"], ["pebibit", "pebibit|pebibits|Pib|Pibit"], ["byte", "byte|bytes"], ["kilobyte", "kilobyte|kilobytes|kB|kByte"], ["megabyte", "megabyte|megabytes|MB|MByte"], ["gigabyte", "gigabyte|gigabytes|GB|GByte"], ["terabyte", "terabyte|terabytes|TB|TByte"], ["petabyte", "petabyte|petabytes|PB|PByte"], ["kibibyte", "kibibyte|kibibytes|kiB|kiByte"], ["mebibyte", "mebibyte|mebibytes|MiB|MiByte"], ["gibibyte", "gibibyte|gibibytes|GiB|GiByte"], ["tebibyte", "tebibyte|tebibytes|TiB|TiByte"], ["pebibyte", "pebibyte|pebibytes|PiB|PiByte"]]); + SpanishNumericWithUnit.AmbiguousDimensionUnitList = ['al', 'mi', 'área', 'áreas', 'pie', 'pies']; + SpanishNumericWithUnit.LengthSuffixList = new Map([["Kilómetro", "km|kilometro|kilómetro|kilometros|kilómetros"], ["Hectómetro", "hm|hectometro|hectómetro|hectometros|hectómetros"], ["Decámetro", "decametro|decámetro|decametros|decámetros|dam"], ["Metro", "m|m.|metro|metros"], ["Decímetro", "dm|decimetro|decímetro|decimetros|decímetros"], ["Centímetro", "cm|centimetro|centímetro|centimetros|centimetros"], ["Milímetro", "mm|milimetro|milímetro|milimetros|milímetros"], ["Micrómetro", "µm|um|micrometro|micrómetro|micrometros|micrómetros|micrón|micrónes"], ["Nanómetro", "nm|nanometro|nanómetro|nanometros|nanómetros"], ["Picómetro", "pm|picometro|picómetro|picometros|picómetros"], ["Milla", "mi|milla|millas"], ["Yarda", "yd|yarda|yardas"], ["Pulgada", "pulgada|pulgadas|\""], ["Pie", "pie|pies|ft"], ["Año luz", "año luz|años luz|al"]]); + SpanishNumericWithUnit.AmbiguousLengthUnitList = ['mi', 'área', 'áreas']; + SpanishNumericWithUnit.BuildPrefix = `(?<=(\\s|^|\\P{L}))`; + SpanishNumericWithUnit.BuildSuffix = `(?=(\\s|\\P{L}|$))`; + SpanishNumericWithUnit.ConnectorToken = 'de'; + SpanishNumericWithUnit.SpeedSuffixList = new Map([["Metro por segundo", "metro/segundo|m/s|metro por segundo|metros por segundo|metros por segundos"], ["Kilómetro por hora", "km/h|kilómetro por hora|kilometro por hora|kilómetros por hora|kilometros por hora|kilómetro/hora|kilometro/hora|kilómetros/hora|kilometros/hora"], ["Kilómetro por minuto", "km/min|kilómetro por minuto|kilometro por minuto|kilómetros por minuto|kilometros por minuto|kilómetro/minuto|kilometro/minuto|kilómetros/minuto|kilometros/minuto"], ["Kilómetro por segundo", "km/seg|kilómetro por segundo|kilometro por segundo|kilómetros por segundo|kilometros por segundo|kilómetro/segundo|kilometro/segundo|kilómetros/segundo|kilometros/segundo"], ["Milla por hora", "mph|milla por hora|mi/h|milla/hora|millas/hora|millas por hora"], ["Nudo", "kt|nudo|nudos|kn"], ["Pie por segundo", "ft/s|pie/s|ft/seg|pie/seg|pie por segundo|pies por segundo"], ["Pie por minuto", "ft/min|pie/min|pie por minuto|pies por minuto"], ["Yarda por minuto", "yardas por minuto|yardas/minuto|yardas/min"], ["Yarda por segundo", "yardas por segundo|yardas/segundo|yardas/seg"]]); + SpanishNumericWithUnit.AmbiguousSpeedUnitList = ['nudo', 'nudos']; + SpanishNumericWithUnit.TemperatureSuffixList = new Map([["Kelvin", "k|kelvin"], ["Rankine", "r|rankine"], ["Grado Celsius", "°c|grados c|grado celsius|grados celsius|celsius|grado centígrado|grados centígrados|centígrado|centígrados"], ["Grado Fahrenheit", "°f|grados f|grado fahrenheit|grados fahrenheit|fahrenheit"], ["Grado Réaumur", "°r|°re|grados r|grado réaumur|grados réaumur|réaumur"], ["Grado Delisle", "°d|grados d|grado delisle|grados delisle|delisle"], ["Grado", "°|grados|grado"]]); + SpanishNumericWithUnit.VolumeSuffixList = new Map([["Kilómetro cúbico", "kilómetro cúbico|kilómetros cúbico|km3|km^3|km³"], ["Hectómetro cúbico", "hectómetro cúbico|hectómetros cúbico|hm3|hm^3|hm³"], ["Decámetro cúbico", "decámetro cúbico|decámetros cúbico|dam3|dam^3|dam³"], ["Metro cúbico", "metro cúbico|metros cúbico|m3|m^3|m³"], ["Decímetro cúbico", "decímetro cúbico|decímetros cúbico|dm3|dm^3|dm³"], ["Centímetro cúbico", "centímetro cúbico|centímetros cúbico|cc|cm3|cm^3|cm³"], ["Milímetro cúbico", "milímetro cúbico|milímetros cúbico|mm3|mm^3|mm³"], ["Pulgada cúbica", "pulgada cúbica|pulgadas cúbicas"], ["Pie cúbico", "pie cúbico|pies cúbicos|pie3|pie^3|pie³|ft3|ft^3|ft³"], ["Yarda cúbica", "yarda cúbica|yardas cúbicas|yd3|yd^3|yd³"], ["Hectolitro", "hectolitro|hectolitros|hl"], ["Litro", "litro|litros|lts|l"], ["Mililitro", "mililitro|mililitros|ml"], ["Galón", "galón|galones"], ["Pinta", "pinta|pintas"], ["Barril", "barril|barriles|bbl"], ["Onza líquida", "onza líquida|onzas líquidas"]]); + SpanishNumericWithUnit.WeightSuffixList = new Map([["Tonelada métrica", "tonelada métrica|toneladas métricas"], ["Tonelada", "ton|tonelada|toneladas"], ["Kilogramo", "kg|kilogramo|kilogramos"], ["Hectogramo", "hg|hectogramo|hectogramos"], ["Decagramo", "dag|decagramo|decagramos"], ["Gramo", "g|gr|gramo|gramos"], ["Decigramo", "dg|decigramo|decigramos"], ["Centigramo", "cg|centigramo|centigramos"], ["Miligramo", "mg|miligramo|miligramos"], ["Microgramo", "µg|ug|microgramo|microgramos"], ["Nanogramo", "ng|nanogramo|nanogramos"], ["Picogramo", "pg|picogramo|picogramos"], ["Libra", "lb|libra|libras"], ["Onza", "oz|onza|onzas"], ["Grano", "grano|granos|gr"], ["Quilate", "ct|kt|quilate|quilates"]]); +})(SpanishNumericWithUnit = exports.SpanishNumericWithUnit || (exports.SpanishNumericWithUnit = {})); + +}); + +unwrapExports(spanishNumericWithUnit); + +var base$2 = createCommonjsModule(function (module, exports) { +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); + + + + + +class SpanishNumberWithUnitExtractorConfiguration { + constructor(ci) { + this.cultureInfo = ci; + this.unitNumExtractor = new recognizersTextNumber.SpanishNumberExtractor(); + this.buildPrefix = spanishNumericWithUnit.SpanishNumericWithUnit.BuildPrefix; + this.buildSuffix = spanishNumericWithUnit.SpanishNumericWithUnit.BuildSuffix; + this.connectorToken = spanishNumericWithUnit.SpanishNumericWithUnit.ConnectorToken; + this.compoundUnitConnectorRegex = recognizersText.RegExpUtility.getSafeRegExp(spanishNumericWithUnit.SpanishNumericWithUnit.CompoundUnitConnectorRegex); + this.pmNonUnitRegex = recognizersText.RegExpUtility.getSafeRegExp(baseUnits.BaseUnits.PmNonUnitRegex); + } +} +exports.SpanishNumberWithUnitExtractorConfiguration = SpanishNumberWithUnitExtractorConfiguration; +class SpanishNumberWithUnitParserConfiguration extends parsers$8.BaseNumberWithUnitParserConfiguration { + constructor(ci) { + super(ci); + this.internalNumberExtractor = new recognizersTextNumber.SpanishNumberExtractor(recognizersTextNumber.NumberMode.Default); + this.internalNumberParser = recognizersTextNumber.AgnosticNumberParserFactory.getParser(recognizersTextNumber.AgnosticNumberParserType.Number, new recognizersTextNumber.SpanishNumberParserConfiguration()); + this.connectorToken = spanishNumericWithUnit.SpanishNumericWithUnit.ConnectorToken; + } +} +exports.SpanishNumberWithUnitParserConfiguration = SpanishNumberWithUnitParserConfiguration; + +}); + +unwrapExports(base$2); + +var currency$2 = createCommonjsModule(function (module, exports) { +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); + + + + +class SpanishCurrencyExtractorConfiguration extends base$2.SpanishNumberWithUnitExtractorConfiguration { + constructor(ci) { + if (!ci) { + ci = new recognizersTextNumber.CultureInfo(recognizersTextNumber.Culture.Spanish); + } + super(ci); + this.extractType = constants$4.Constants.SYS_UNIT_CURRENCY; + // Reference Source: https:// en.wikipedia.org/wiki/List_of_circulating_currencies + this.suffixList = spanishNumericWithUnit.SpanishNumericWithUnit.CurrencySuffixList; + this.prefixList = spanishNumericWithUnit.SpanishNumericWithUnit.CurrencyPrefixList; + this.ambiguousUnitList = spanishNumericWithUnit.SpanishNumericWithUnit.AmbiguousCurrencyUnitList; + } +} +exports.SpanishCurrencyExtractorConfiguration = SpanishCurrencyExtractorConfiguration; +class SpanishCurrencyParserConfiguration extends base$2.SpanishNumberWithUnitParserConfiguration { + constructor(ci) { + if (!ci) { + ci = new recognizersTextNumber.CultureInfo(recognizersTextNumber.Culture.Spanish); + } + super(ci); + this.BindDictionary(spanishNumericWithUnit.SpanishNumericWithUnit.CurrencySuffixList); + this.BindDictionary(spanishNumericWithUnit.SpanishNumericWithUnit.CurrencyPrefixList); + } +} +exports.SpanishCurrencyParserConfiguration = SpanishCurrencyParserConfiguration; + +}); + +unwrapExports(currency$2); + +var temperature$2 = createCommonjsModule(function (module, exports) { +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); + + + + +class SpanishTemperatureExtractorConfiguration extends base$2.SpanishNumberWithUnitExtractorConfiguration { + constructor(ci) { + if (!ci) { + ci = new recognizersTextNumber.CultureInfo(recognizersTextNumber.Culture.Spanish); + } + super(ci); + this.extractType = constants$4.Constants.SYS_UNIT_TEMPERATURE; + this.suffixList = spanishNumericWithUnit.SpanishNumericWithUnit.TemperatureSuffixList; + this.prefixList = new Map(); + this.ambiguousUnitList = new Array(); + } +} +exports.SpanishTemperatureExtractorConfiguration = SpanishTemperatureExtractorConfiguration; +class SpanishTemperatureParserConfiguration extends base$2.SpanishNumberWithUnitParserConfiguration { + constructor(ci) { + if (!ci) { + ci = new recognizersTextNumber.CultureInfo(recognizersTextNumber.Culture.Spanish); + } + super(ci); + this.BindDictionary(spanishNumericWithUnit.SpanishNumericWithUnit.TemperatureSuffixList); + } +} +exports.SpanishTemperatureParserConfiguration = SpanishTemperatureParserConfiguration; + +}); + +unwrapExports(temperature$2); + +var dimension$2 = createCommonjsModule(function (module, exports) { +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); + + + + +class SpanishDimensionExtractorConfiguration extends base$2.SpanishNumberWithUnitExtractorConfiguration { + constructor(ci) { + if (!ci) { + ci = new recognizersTextNumber.CultureInfo(recognizersTextNumber.Culture.Spanish); + } + super(ci); + this.extractType = constants$4.Constants.SYS_UNIT_DIMENSION; + this.suffixList = spanishNumericWithUnit.SpanishNumericWithUnit.DimensionSuffixList; + this.prefixList = new Map(); + this.ambiguousUnitList = spanishNumericWithUnit.SpanishNumericWithUnit.AmbiguousDimensionUnitList; + } +} +exports.SpanishDimensionExtractorConfiguration = SpanishDimensionExtractorConfiguration; +class SpanishDimensionParserConfiguration extends base$2.SpanishNumberWithUnitParserConfiguration { + constructor(ci) { + if (!ci) { + ci = new recognizersTextNumber.CultureInfo(recognizersTextNumber.Culture.Spanish); + } + super(ci); + this.BindDictionary(spanishNumericWithUnit.SpanishNumericWithUnit.DimensionSuffixList); + } +} +exports.SpanishDimensionParserConfiguration = SpanishDimensionParserConfiguration; + +}); + +unwrapExports(dimension$2); + +var age$2 = createCommonjsModule(function (module, exports) { +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); + + + + +class SpanishAgeExtractorConfiguration extends base$2.SpanishNumberWithUnitExtractorConfiguration { + constructor(ci) { + if (!ci) { + ci = new recognizersTextNumber.CultureInfo(recognizersTextNumber.Culture.Spanish); + } + super(ci); + this.extractType = constants$4.Constants.SYS_UNIT_AGE; + this.suffixList = spanishNumericWithUnit.SpanishNumericWithUnit.AgeSuffixList; + this.prefixList = new Map(); + this.ambiguousUnitList = new Array(); + } +} +exports.SpanishAgeExtractorConfiguration = SpanishAgeExtractorConfiguration; +class SpanishAgeParserConfiguration extends base$2.SpanishNumberWithUnitParserConfiguration { + constructor(ci) { + if (!ci) { + ci = new recognizersTextNumber.CultureInfo(recognizersTextNumber.Culture.Spanish); + } + super(ci); + this.BindDictionary(spanishNumericWithUnit.SpanishNumericWithUnit.AgeSuffixList); + } +} +exports.SpanishAgeParserConfiguration = SpanishAgeParserConfiguration; + +}); + +unwrapExports(age$2); + +var portugueseNumericWithUnit = createCommonjsModule(function (module, exports) { +"use strict"; +// ------------------------------------------------------------------------------ +// +// This code was generated by a tool. +// Changes to this file may cause incorrect behavior and will be lost if +// the code is regenerated. +// +// ------------------------------------------------------------------------------ +Object.defineProperty(exports, "__esModule", { value: true }); +var PortugueseNumericWithUnit; +(function (PortugueseNumericWithUnit) { + PortugueseNumericWithUnit.AgeSuffixList = new Map([["Ano", "anos|ano"], ["Mês", "meses|mes|mês"], ["Semana", "semanas|semana"], ["Dia", "dias|dia"]]); + PortugueseNumericWithUnit.AreaSuffixList = new Map([["Quilômetro quadrado", "quilômetro quadrado|quilómetro quadrado|quilometro quadrado|quilômetros quadrados|quilómetros quadrados|quilomeros quadrados|km2|km^2|km²"], ["Hectare", "hectômetro quadrado|hectómetro quadrado|hectômetros quadrados|hectómetros cuadrados|hm2|hm^2|hm²|hectare|hectares"], ["Decâmetro quadrado", "decâmetro quadrado|decametro quadrado|decâmetros quadrados|decametro quadrado|dam2|dam^2|dam²|are|ares"], ["Metro quadrado", "metro quadrado|metros quadrados|m2|m^2|m²"], ["Decímetro quadrado", "decímetro quadrado|decimentro quadrado|decímetros quadrados|decimentros quadrados|dm2|dm^2|dm²"], ["Centímetro quadrado", "centímetro quadrado|centimetro quadrado|centímetros quadrados|centrimetros quadrados|cm2|cm^2|cm²"], ["Milímetro quadrado", "milímetro quadrado|milimetro quadrado|milímetros quadrados|militmetros quadrados|mm2|mm^2|mm²"], ["Polegada quadrada", "polegada quadrada|polegadas quadradas|in2|in^2|in²"], ["Pé quadrado", "pé quadrado|pe quadrado|pés quadrados|pes quadrados|pé2|pé^2|pé²|sqft|sq ft|ft2|ft^2|ft²"], ["Jarda quadrada", "jarda quadrada|jardas quadradas|yd2|yd^2|yd²"], ["Milha quadrada", "milha quadrada|milhas quadradas|mi2|mi^2|mi²"], ["Acre", "acre|acres"]]); + PortugueseNumericWithUnit.CurrencySuffixList = new Map([["Dólar", "dólar|dolar|dólares|dolares"], ["Peso", "peso|pesos"], ["Coroa", "coroa|coroas"], ["Rublo", "rublo|rublos"], ["Libra", "libra|libras"], ["Florim", "florim|florins|ƒ"], ["Dinar", "dinar|dinares"], ["Franco", "franco|francos"], ["Rupia", "rúpia|rupia|rúpias|rupias"], ["Escudo", "escudo|escudos"], ["Xelim", "xelim|xelins|xelims"], ["Lira", "lira|liras"], ["Centavo", "centavo|cêntimo|centimo|centavos|cêntimos|centimo"], ["Centésimo", "centésimo|centésimos"], ["Pêni", "pêni|péni|peni|penies|pennies"], ["Manat", "manat|manate|mánate|man|manats|manates|mánates"], ["Euro", "euro|euros|€|eur"], ["Centavo de Euro", "centavo de euro|cêntimo de euro|centimo de euro|centavos de euro|cêntimos de euro|centimos de euro"], ["Dólar do Caribe Oriental", "dólar do Caribe Oriental|dolar do Caribe Oriental|dólares do Caribe Oriental|dolares do Caribe Oriental|dólar das Caraíbas Orientais|dolar das Caraibas Orientais|dólares das Caraíbas Orientais|dolares das Caraibas Orientais|ec$|xcd"], ["Centavo do Caribe Oriental", "centavo do Caribe Oriental|centavo das Caraíbas Orientais|cêntimo do Caribe Oriental|cêntimo das Caraíbas Orientais|centavos do Caribe Oriental|centavos das Caraíbas Orientais|cêntimos do Caribe Oriental|cêntimos das Caraíbas Orientais"], ["Franco CFA da África Ocidental", "franco CFA da África Ocidental|franco CFA da Africa Ocidental|francos CFA da África Occidental|francos CFA da Africa Occidental|franco CFA Ocidental|xof"], ["Centavo de CFA da África Ocidental", "centavo de CFA da Africa Occidental|centavos de CFA da África Ocidental|cêntimo de CFA da Africa Occidental|cêntimos de CFA da África Ocidental"], ["Franco CFA da África Central", "franco CFA da África Central|franco CFA da Africa Central|francos CFA da África Central|francos CFA da Africa Central|franco CFA central|xaf"], ["Centavo de CFA da África Central", "centavo de CFA de África Central|centavos de CFA da África Central|cêntimo de CFA de África Central|cêntimos de CFA da África Central"], ["Apsar abcásio", "apsar abcásio|apsar abecásio|apsar abcasio|apsar|apsares"], ["Afegani afegão", "afegani afegão|afegane afegão|؋|afn|afegane|afgane|afegâni|afeganis|afeganes|afganes|afegânis"], ["Pul", "pul|pules|puls"], ["Lek albanês", "lek|lekë|lekes|lek albanês|leque|leques|all"], ["Qindarke", "qindarka|qindarkë|qindarke|qindarkas"], ["Kwanza angolano", "kwanza angolano|kwanzas angolanos|kwanza|kwanzas|aoa|kz"], ["Cêntimo angolano", "cêntimo angolano|cêntimo|cêntimos"], ["Florim das Antilhas Holandesas", "florim das antilhas holandesas|florim das antilhas neerlandesas|ang"], ["Rial saudita", "rial saudita|riais sauditas|riyal saudita|riyals sauditas|riyal|riyals|sar"], ["Halala saudita", "halala saudita|halala|hallalah"], ["Dinar argelino", "dinar argelino|dinares argelinos|dzd"], ["Cêntimo argelino", "centimo argelino|centimos argelinos|cêntimo argelino|cêntimos argelinos|centavo argelino|centavos argelinos"], ["Peso argentino", "peso argentino|pesos argentinos|peso|pesos|ar$|ars"], ["Centavo argentino", "centavo argentino|centavos argentinos|centavo|ctvo.|ctvos."], ["Dram armênio", "dram armênio|dram armênios|dram arménio|dram arménios|dram armenio|dram armenios|dram|drame|drames|դր."], ["Luma armênio", "luma armênio|lumas armênios|luma arménio|lumas arménios|luma armenio|lumas armenios|luma|lumas"], ["Florim arubano", "florín arubeño|florines arubeños|ƒ arubeños|aƒ|awg"], ["Dólar australiano", "dólar australiano|dólares australianos|dolar australiano|dolares australianos|a$|aud"], ["Centavo australiano", "centavo australiano|centavos australianos"], ["Manat azeri", "manat azeri|manats azeris|azn|manat azerbaijanês|manat azerbaijano|manats azerbaijaneses|manats azerbaijanos"], ["Qəpik azeri", "qəpik azeri|qəpik|qəpiks"], ["Dólar bahamense", "dólar bahamense|dólares bahamense|dolar bahamense|dolares bahamense|dólar baamiano|dólares baamiano|dolar baamiano|dolares baamiano|b$|bsd"], ["Centavo bahamense", "centavo bahamense|centavos bahamense"], ["Dinar bareinita", "dinar bareinita|dinar baremita|dinares bareinitas|dinares baremitas|bhd"], ["Fil bareinita", "fil bareinita|fil baremita|fils bareinitas|fils baremitas"], ["Taka bengali", "taka bengali|takas bengalis|taca|tacas|taka|takas|bdt"], ["Poisha bengali", "poisha bengali|poishas bengalis"], ["Dólar de Barbados", "dólar de barbados|dólares de barbados|dolar de barbados|dolares de barbados|dólar dos barbados|dólares dos barbados|bbd"], ["Centavo de Barbados", "centavo de barbados|centavos de barbados|centavo dos barbados|centavos dos barbados"], ["Dólar de Belize", "dólar de belize|dólares de belize|dolar de belize|dolares de belize|dólar do belize|dólares do belize|dolar do belize|dolares do belize|bz$|bzd"], ["Centavo de Belize", "centavo de belize|centavos de belize|cêntimo do belize|cêntimos do belize"], ["Dólar bermudense", "dólar bermudense|dólares bermudenses|bd$|bmd"], ["Centavo bermudense", "centavo bermudense|centavos bermudenses|cêntimo bermudense| cêntimos bermudenses"], ["Rublo bielorrusso", "rublo bielorrusso|rublos bielorrussos|br|byr"], ["Copeque bielorusso", "copeque bielorrusso|copeques bielorrussos|kopek bielorrusso|kopeks bielorrussos|kap"], ["Quiate mianmarense", "quiate mianmarense|quiates mianmarenses|kyat mianmarense|kyates mianmarenses|quiate myanmarense|quiates myanmarenses|kyat myanmarense|kyates myanmarenses|quiate birmanês|quite birmanes|quiates birmaneses|kyat birmanês|kyat birmanes|kyates birmaneses|mmk"], ["Pya mianmarense", "pya mianmarense|pyas mianmarenses|pya myanmarense|pyas myanmarenses|pya birmanês|pya birmanes|pyas birmaneses"], ["Boliviano", "boliviano|bolivianos|bob|bs"], ["Centavo Boliviano", "centavo boliviano|centavos bolivianos"], ["Marco da Bósnia e Herzegovina", "marco conversível|marco conversivel|marco convertível|marco convertivel|marcos conversíveis|marcos conversiveis|marcos convertíveis|marcos convertivies|bam"], ["Fening da Bósnia e Herzegovina", "fening conversível|fening conversivel|fening convertível|fening convertivel|fenings conversíveis|fenings conversiveis|fenings convertíveis|fenings convertiveis"], ["Pula", "pula|pulas|bwp"], ["Thebe", "thebe|thebes"], ["Real brasileiro", "real brasileiro|real do brasil|real|reais brasileiros|reais do brasil|reais|r$|brl"], ["Centavo brasileiro", "centavo de real|centavo brasileiro|centavos de real|centavos brasileiros"], ["Dólar de Brunei", "dólar de brunei|dolar de brunei|dólar do brunei|dolar do brunei|dólares de brunéi|dolares de brunei|dólares do brunei|dolares do brunei|bnd"], ["Sen de Brunei", "sen de brunei|sen do brunei|sens de brunei|sens do brunei"], ["Lev búlgaro", "lev búlgaro|leve búlgaro|leves búlgaros|lev bulgaro|leve bulgaro|leves bulgaros|lv|bgn"], ["Stotinka búlgaro", "stotinka búlgaro|stotinki búlgaros|stotinka bulgaro|stotinki bulgaros"], ["Franco do Burundi", "franco do burundi|francos do burundi|fbu|fib"], ["Centavo Burundi", "centavo burundi|cêntimo burundi|centimo burundi|centavos burundi|cêntimo burundi|centimo burundi"], ["Ngultrum butanês", "ngultrum butanês|ngultrum butanes|ngúltrume butanês|ngultrume butanes|ngultrum butaneses|ngúltrumes butaneses|ngultrumes butaneses|btn"], ["Chetrum butanês", "chetrum butanês|chetrum butanes|chetrum butaneses"], ["Escudo cabo-verdiano", "escudo cabo-verdiano|escudos cabo-verdianos|cve"], ["Riel cambojano", "riel cambojano|riéis cambojanos|rieis cambojanos|khr"], ["Dólar canadense", "dólar canadense|dolar canadense|dólares canadenses|dolares canadenses|c$|cad"], ["Centavo canadense", "centavo canadense|centavos canadenses"], ["Peso chileno", "peso chileno|pesos chilenos|cpl"], ["Yuan chinês", "yuan chinês|yuan chines|yuans chineses|yuan|yuans|renminbi|rmb|cny|¥"], ["Peso colombiano", "peso colombiano|pesos colombianos|cop|col$"], ["Centavo colombiano", "centavo colombiano|centavos colombianos"], ["Franco comorense", "franco comorense|francos comorenses|kmf|₣"], ["Franco congolês", "franco congolês|franco congoles|francos congoleses|cdf"], ["Centavo congolês", "centavo congolês|centavo congoles|centavos congoleses|cêntimo congolês|centimo congoles|cêntimos congoleses|cêntimos congoleses"], ["Won norte-coreano", "won norte-coreano|wŏn norte-coreano|won norte-coreanos|wŏn norte-coreanos|kpw"], ["Chon norte-coreano", "chon norte-coreano|chŏn norte-coreano|chŏn norte-coreanos|chon norte-coreanos"], ["Won sul-coreano", "wŏn sul-coreano|won sul-coreano|wŏnes sul-coreanos|wones sul-coreanos|krw"], ["Jeon sul-coreano", "jeons sul-coreano|jeons sul-coreanos"], ["Colón costarriquenho", "colón costarriquenho|colon costarriquenho|colons costarriquenho|colones costarriquenhos|crc"], ["Kuna croata", "kuna croata|kunas croatas|hrk"], ["Lipa croata", "lipa croata|lipas croatas"], ["Peso cubano", "peso cubano|pesos cubanos|cup"], ["Peso cubano convertível", "peso cubano conversível|pesos cubanos conversíveis|peso cubano conversivel|pesos cubanos conversiveis|peso cubano convertível|pesos cubanos convertíveis|peso cubano convertivel|pesos cubanos convertiveis|cuc"], ["Coroa dinamarquesa", "coroa dinamarquesa|coroas dinamarquesas|dkk"], ["Libra egípcia", "libra egípcia|libra egipcia|libras egípcias|libras egipcias|egp|le"], ["Piastra egípcia", "piastra egípcia|piastra egipcia|pisastras egípcias|piastras egipcias"], ["Dirham dos Emirados Árabes Unidos", "dirham|dirhams|dirham dos emirados arabes unidos|aed|dhs"], ["Nakfa", "nakfa|nfk|ern"], ["Centavo de Nakfa", "cêntimo de nakfa|cêntimos de nakfa|centavo de nafka|centavos de nafka"], ["Peseta", "peseta|pesetas|pts.|ptas.|esp"], ["Dólar estadunidense", "dólar dos estados unidos|dolar dos estados unidos|dólar estadunidense|dólar americano|dólares dos estados unidos|dolares dos estados unidos|dólares estadunidenses|dólares americanos|dolar estadunidense|dolar americano|dolares estadunidenses|dolares americanos|usd|u$d|us$"], ["Coroa estoniana", "coroa estoniana|coroas estonianas|eek"], ["Senti estoniano", "senti estoniano|senti estonianos"], ["Birr etíope", "birr etíope|birr etiope|birr etíopes|birr etiopes|br|etb"], ["Santim etíope", "santim etíope|santim etiope|santim etíopes|santim etiopes"], ["Peso filipino", "peso filipino|pesos filipinos|php"], ["Marco finlandês", "marco finlandês|marco finlandes|marcos finlandeses"], ["Dólar fijiano", "dólar fijiano|dolar fijiano|dólares fijianos|dolares fijianos|fj$|fjd"], ["Centavo fijiano", "centavo fijiano|centavos fijianos"], ["Dalasi gambiano", "dalasi|gmd"], ["Bututs", "butut|bututs"], ["Lari georgiano", "lari georgiano|lari georgianos|gel"], ["Tetri georgiano", "tetri georgiano|tetri georgianos"], ["Cedi", "cedi|ghs|gh₵"], ["Pesewa", "pesewa"], ["Libra de Gibraltar", "libra de gibraltar|libras de gibraltar|gip"], ["Peni de Gibraltar", "peni de gibraltar|penies de gibraltar"], ["Quetzal guatemalteco", "quetzal guatemalteco|quetzales guatemaltecos|quetzal|quetzales|gtq"], ["Centavo guatemalteco", "centavo guatemalteco|centavos guatemaltecos"], ["Libra de Guernsey", "libra de Guernsey|libras de Guernsey|ggp"], ["Peni de Guernsey", "peni de Guernsey|penies de Guernsey"], ["Franco da Guiné", "franco da guiné|franco da guine| franco guineense|francos da guiné|francos da guine|francos guineense|gnf|fg"], ["Centavo da Guiné", "cêntimo guineense|centimo guineense|centavo guineense|cêntimos guineenses|centimos guineenses|centavos guineenses"], ["Dólar guianense", "dólar guianense|dólares guianense|dolar guianense|dolares guianense|gyd|gy"], ["Gurde haitiano", "gurde haitiano|gourde|gurdes haitianos|htg"], ["Centavo haitiano", "cêntimo haitiano|cêntimos haitianos|centavo haitiano|centavos haitianos"], ["Lempira hondurenha", "lempira hondurenha|lempiras hondurenhas|lempira|lempiras|hnl"], ["Centavo hondurenho", "centavo hondurenho|centavos hondurehos|cêntimo hondurenho|cêntimos hondurenhos"], ["Dólar de Hong Kong", "dólar de hong kong|dolar de hong kong|dólares de hong kong|dolares de hong kong|hk$|hkd"], ["Florim húngaro", "florim húngaro|florim hungaro|florins húngaros|florins hungaros|forinte|forintes|huf"], ["Filér húngaro", "fillér|filér|filler|filer"], ["Rupia indiana", "rúpia indiana|rupia indiana|rupias indianas|inr"], ["Paisa indiana", "paisa indiana|paisas indianas"], ["Rupia indonésia", "rupia indonesia|rupia indonésia|rupias indonesias|rupias indonésias|idr"], ["Sen indonésio", "send indonésio|sen indonesio|sen indonésios|sen indonesios"], ["Rial iraniano", "rial iraniano|riais iranianos|irr"], ["Dinar iraquiano", "dinar iraquiano|dinares iraquianos|iqd"], ["Fil iraquiano", "fil iraquiano|fils iraquianos|files iraquianos"], ["Libra manesa", "libra manesa|libras manesas|imp"], ["Peni manês", "peni manes|peni manês|penies maneses"], ["Coroa islandesa", "coroa islandesa|coroas islandesas|isk|íkr"], ["Aurar islandês", "aurar islandês|aurar islandes|aurar islandeses|eyrir"], ["Dólar das Ilhas Cayman", "dólar das ilhas cayman|dolar das ilhas cayman|dólar das ilhas caimão|dólares das ilhas cayman|dolares das ilhas cayman|dólares das ilhas caimão|ci$|kyd"], ["Dólar das Ilhas Cook", "dólar das ilhas cook|dolar das ilhas cook|dólares das ilhas cook|dolares das ilhas cook"], ["Coroa feroesa", "coroa feroesa|coroas feroesas|fkr"], ["Libra das Malvinas", "libra das malvinas|libras das malvinas|fk£|fkp"], ["Dólar das Ilhas Salomão", "dólar das ilhas salomão|dolar das ilhas salomao|dólares das ilhas salomão|dolares das ilhas salomao|sbd"], ["Novo shekel israelense", "novo shekel|novos shekeles|novo shequel|novo siclo|novo xéquel|shekeles novos|novos sheqalim|sheqalim novos|ils"], ["Agora", "agora|agorot"], ["Dólar jamaicano", "dólar jamaicano|dolar jamaicano|dólares jamaicanos|dolares jamaicanos|j$|ja$|jmd"], ["Yen", "yen|iene|yenes|ienes|jpy"], ["Libra de Jersey", "libra de Jersey|libras de Jersey|jep"], ["Dinar jordaniano", "dinar jordaniano|dinar jordano|dinares jordanianos|dinares jordanos|jd|jod"], ["Piastra jordaniana", "piastra jordaniana|piastra jordano|piastras jordanianas|piastra jordaniano|piastras jordanianos|piastras jordanos"], ["Tengue cazaque", "tenge|tengue|tengué|tengue cazaque|kzt"], ["Tiyin", "tiyin|tiyins"], ["Xelim queniano", "xelim queniano|xelins quenianos|ksh|kes"], ["Som quirguiz", "som quirguiz|som quirguizes|soms quirguizes|kgs"], ["Tyiyn", "tyiyn|tyiyns"], ["Dólar de Kiribati", "dólar de kiribati|dolar de kiribati|dólares de kiribati|dolares de kiribati"], ["Dinar kuwaitiano", "dinar kuwaitiano|dinar cuaitiano|dinares kuwaitiano|dinares cuaitianos|kwd"], ["Quipe laosiano", "quipe|quipes|kipe|kipes|kip|kip laosiano|kip laociano|kips laosianos|kips laocianos|lak"], ["Att laosiano", "at|att|att laosiano|att laosianos"], ["Loti do Lesoto", "loti|lóti|maloti|lotis|lótis|lsl"], ["Sente", "sente|lisente"], ["Libra libanesa", "libra libanesa|libras libanesas|lbp"], ["Dólar liberiano", "dólar liberiano|dolar liberiano|dólares liberianos|dolares liberianos|l$|lrd"], ["Dinar libio", "dinar libio|dinar líbio|dinares libios|dinares líbios|ld|lyd"], ["Dirham libio", "dirham libio|dirhams libios|dirham líbio|dirhams líbios"], ["Litas lituana", "litas lituana|litai lituanas|ltl"], ["Pataca macaense", "pataca macaense|patacas macaenses|mop$|mop"], ["Avo macaense", "avo macaense|avos macaenses"], ["Ho macaense", "ho macaense|ho macaenses"], ["Dinar macedônio", "denar macedonio|denare macedonios|denar macedônio|denar macedónio|denare macedônio|denare macedónio|dinar macedonio|dinar macedônio|dinar macedónio|dinares macedonios|dinares macedônios|dinares macedónios|den|mkd"], ["Deni macedônio", "deni macedonio|deni macedônio|deni macedónio|denis macedonios|denis macedônios|denis macedónios"], ["Ariary malgaxe", "ariai malgaxe|ariary malgaxe|ariary malgaxes|ariaris|mga"], ["Iraimbilanja", "iraimbilanja|iraimbilanjas"], ["Ringuite malaio", "ringgit malaio|ringgit malaios|ringgits malaios|ringuite malaio|ringuites malaios|rm|myr"], ["Sen malaio", "sen malaio|sen malaios|centavo malaio|centavos malaios|cêntimo malaio|cêntimos malaios"], ["Kwacha do Malawi", "kwacha|cuacha|quacha|mk|mwk"], ["Tambala", "tambala|tambalas|tambala malawi"], ["Rupia maldiva", "rupia maldiva|rupias maldivas|rupia das maldivas| rupias das maldivas|mvr"], ["Dirame marroquino", "dirame marroquino|dirham marroquinho|dirhams marroquinos|dirames marroquinos|mad"], ["Rupia maurícia", "rupia maurícia|rupia de Maurício|rupia mauricia|rupia de mauricio|rupias de mauricio|rupias de maurício|rupias mauricias|rupias maurícias|mur"], ["Uguia", "uguia|uguias|oguia|ouguiya|oguias|mro"], ["Kume", "kumes|kume|khoums"], ["Peso mexicano", "peso mexicano|pesos mexicanos|mxn"], ["Centavo mexicano", "centavo mexicano|centavos mexicanos"], ["Leu moldávio", "leu moldavo|lei moldavos|leu moldávio|leu moldavio|lei moldávios|lei moldavios|leus moldavos|leus moldavios|leus moldávios|mdl"], ["Ban moldávio", "ban moldavo|bani moldavos"], ["Tugrik mongol", "tugrik mongol|tugrik|tugriks mongóis|tugriks mongois|tug|mnt"], ["Metical moçambicao", "metical|metical moçambicano|metical mocambicano|meticais|meticais moçambicanos|meticais mocambicanos|mtn|mzn"], ["Dólar namibiano", "dólar namibiano|dólares namibianos|dolar namibio|dolares namibios|n$|nad"], ["Centavo namibiano", "centavo namibiano|centavos namibianos|centavo namibio|centavos namibianos"], ["Rupia nepalesa", "rupia nepalesa|rupias nepalesas|npr"], ["Paisa nepalesa", "paisa nepalesa|paisas nepalesas"], ["Córdova nicaraguense", "córdova nicaraguense|cordova nicaraguense|cordova nicaraguana|córdoba nicaragüense|córdobas nicaragüenses|cordobas nicaraguenses|córdovas nicaraguenses|cordovas nicaraguenses|córdovas nicaraguanasc$|nio"], ["Centavo nicaraguense", "centavo nicaragüense|centavos nicaraguenses|centavo nicaraguano|centavos nicaraguenses|centavo nicaraguano|centavos nicaraguanos"], ["Naira", "naira|ngn"], ["Kobo", "kobo"], ["Coroa norueguesa", "coroa norueguesa|coroas norueguesas|nok"], ["Franco CFP", "franco cfp|francos cfp|xpf"], ["Dólar neozelandês", "dólar neozelandês|dolar neozelandes|dólares neozelandeses|dolares neozelandeses|dólar da nova zelândia|dolar da nova zelandia|dólares da nova zelândia|dolares da nova zelandia|nz$|nzd"], ["Centavo neozelandês", "centavo neozelandês|centavo neozelandes|centavo da nova zelandia|centavo da nova zelândia|centavos da nova zelandia|centavos neozelandeses|centavos da nova zelândia"], ["Rial omanense", "rial omani|riais omanis|rial omanense|riais omanenses|omr"], ["Baisa omanense", "baisa omani|baisas omanis|baisa omanense|baisas omanenses"], ["Florim holandês", "florim holandês|florim holandes|florins holandeses|nlg"], ["Rupia paquistanesa", "rupia paquistanesa|rupias paquistanesas|pkr"], ["Paisa paquistanesa", "paisa paquistanesa|paisas paquistanesasas"], ["Balboa panamenho", "balboa panamenho|balboas panamenhos|balboa|pab|balboa panamense|balboas panamenses"], ["Centavo panamenho", "centavo panamenho|cêntimo panamenho|centavos panamenhos|cêntimos panamenhos|cêntimo panamense|cêntimos panamenses"], ["Kina", "kina|kina papuásia|kinas|kinas papuásias|pkg|pgk"], ["Toea", "toea"], ["Guarani", "guarani|guaranis|gs|pyg"], ["Novo Sol", "novo sol peruano|novos sóis peruanos|sol|soles|sóis|nuevo sol|pen|s#."], ["Centavo de sol", "cêntimo de sol|cêntimos de sol|centavo de sol|centavos de sol"], ["Złoty", "złoty|złotys|zloty|zlotys|zloti|zlotis|zlóti|zlótis|zlote|zł|pln"], ["Groszy", "groszy|grosz"], ["Rial catariano", "rial qatari|riais qataris|rial catarense|riais catarenses|rial catariano|riais catarianos|qr|qar"], ["Dirame catariano", "dirame catariano|dirames catarianos|dirame qatari|dirames qataris|dirame catarense|dirames catarenses|dirham qatari|dirhams qataris|dirham catarense|dirhams catarenses|dirham catariano|dirhams catariano"], ["Libra esterlina", "libra esterlina|libras esterlinas|gbp"], ["Coroa checa", "coroa checa|coroas checas|kc|czk"], ["Peso dominicano", "peso dominicano|pesos dominicanos|rd$|dop"], ["Centavo dominicano", "centavo dominicano|centavos dominicanos"], ["Franco ruandês", "franco ruandês|franco ruandes|francos ruandeses|rf|rwf"], ["Céntimo ruandês", "cêntimo ruandês|centimo ruandes|centavo ruandês|centavo ruandes|cêntimos ruandeses|centimos ruandeses|centavos ruandeses"], ["Leu romeno", "leu romeno|lei romenos|leus romenos|ron"], ["Ban romeno", "ban romeno|bani romeno|bans romenos"], ["Rublo russo", "rublo russo|rublos russos|rub|р."], ["Copeque ruso", "copeque russo|copeques russos|kopek ruso|kopeks rusos|copeque|copeques|kopek|kopeks"], ["Tala samoano", "tala|tālā|talas|tala samonano|talas samoanos|ws$|sat|wst"], ["Sene samoano", "sene"], ["Libra de Santa Helena", "libra de santa helena|libras de santa helena|shp"], ["Pêni de Santa Helena", "peni de santa helena|penies de santa helena"], ["Dobra", "dobra|dobras|db|std"], ["Dinar sérvio", "dinar sérvio|dinar servio|dinar serbio|dinares sérvios|dinares servios|dinares serbios|rsd"], ["Para sérvio", "para sérvio|para servio|para serbio|paras sérvios|paras servios|paras serbios"], ["Rupia seichelense", "rupia de seicheles|rupias de seicheles|rupia seichelense|rupias seichelenses|scr"], ["Centavo seichelense", "centavo de seicheles|centavos de seicheles|centavo seichelense|centavos seichelenses"], ["Leone serra-leonino", "leone|leones|leone serra-leonino|leones serra-leoninos|le|sll"], ["Dólar de Cingapura", "dólar de singapura|dolar de singapura|dórar de cingapura|dolar de cingapura|dólares de singapura|dolares de singapura|dólares de cingapura|dolares de cingapura|sgb"], ["Centavo de Cingapura", "centavo de singapura|centavos de singapura|centavo de cingapura|centavos de cingapura"], ["Libra síria", "libra síria|libra siria|libras sírias|libras sirias|s£|syp"], ["Piastra síria", "piastra siria|piastras sirias|piastra síria|piastras sírias"], ["Xelim somali", "xelim somali|xelins somalis|xelim somaliano|xelins somalianos|sos"], ["Centavo somali", "centavo somapli|centavos somalis|centavo somaliano|centavos somalianos"], ["Xelim da Somalilândia", "xelim da somalilândia|xelins da somalilândia|xelim da somalilandia|xelins da somalilandia"], ["Centavo da Somalilândia", "centavo da somalilândia|centavos da somalilândia|centavo da somalilandia|centavos da somalilandia"], ["Rupia do Sri Lanka", "rupia do sri lanka|rupia do sri lanca|rupias do sri lanka|rupias do sri lanca|rupia cingalesa|rupias cingalesas|lkr"], ["Lilangeni", "lilangeni|lilangenis|emalangeni|szl"], ["Rand sul-africano", "rand|rand sul-africano|rands|rands sul-africanos|zar"], ["Libra sudanesa", "libra sudanesa|libras sudanesas|sdg"], ["Piastra sudanesa", "piastra sudanesa|piastras sudanesas"], ["Libra sul-sudanesa", "libra sul-sudanesa|libras sul-sudanesas|ssp"], ["Piastra sul-sudanesa", "piastra sul-sudanesa|piastras sul-sudanesas"], ["Coroa sueca", "coroa sueca|coroas suecas|sek"], ["Franco suíço", "franco suíço|franco suico|francos suíços|francos suicos|sfr|chf"], ["Rappen suíço", "rappen suíço|rappen suico|rappens suíços|rappens suicos"], ["Dólar surinamês", "dólar surinamês|dolar surinames|dólar do Suriname|dolar do Suriname|dólares surinameses|dolares surinameses|dólares do Suriname|dolares do Suriname|srd"], ["Centavo surinamês", "centavo surinamês|centavo surinames|centavos surinameses"], ["Baht tailandês", "baht tailandês|bath tailandes|baht tailandeses|thb"], ["Satang tailandês", "satang tailandês|satang tailandes|satang tailandeses"], ["Novo dólar taiwanês", "novo dólar taiwanês|novo dolar taiwanes|dólar taiwanês|dolar taiwanes|dólares taiwaneses|dolares taiwaneses|twd"], ["Centavo taiwanês", "centavo taiwanês|centavo taiwanes|centavos taiwaneses"], ["Xelim tanzaniano", "xelim tanzaniano|xelins tanzanianos|tzs"], ["Centavo tanzaniano", "centavo tanzaniano|centavos tanzanianos"], ["Somoni tajique", "somoni tajique|somoni|somonis tajiques|somonis|tjs"], ["Diram tajique", "diram tajique|dirams tajiques|dirames tajiques"], ["Paʻanga", "paanga|paangas|paʻanga|pa'anga|top"], ["Seniti", "seniti"], ["Rublo transdniestriano", "rublo transdniestriano|rublos transdniestriano"], ["Copeque transdniestriano", "copeque transdniestriano|copeques transdniestriano"], ["Dólar de Trinidade e Tobago", "dólar de trinidade e tobago|dólares trinidade e tobago|dolar de trinidade e tobago|dolares trinidade e tobago|dólar de trinidad e tobago|dólares trinidad e tobago|ttd"], ["Centavo de Trinidade e Tobago", "centavo de trinidade e tobago|centavos de trinidade e tobago|centavo de trinidad e tobago|centavos de trinidad e tobago"], ["Dinar tunisiano", "dinar tunisiano|dinares tunisianos|dinar tunisino|dinares tunisinos|tnd"], ["Milim tunisiano", "milim tunisiano|milim tunesianos|millime tunisianos|millimes tunisianos|milim tunisino|milim tunisinos|millime tunisinos|millimes tunisinos"], ["Lira turca", "lira turca|liras turcas|try"], ["Kuruş turco", "kuruş turco|kuruş turcos"], ["Manat turcomeno", "manat turcomeno|manats turcomenos|tmt"], ["Tennesi turcomeno", "tennesi turcomeno|tennesis turcomenos|tenge turcomenos|tenges turcomenos"], ["Dólar tuvaluano", "dólar tuvaluano|dolar tuvaluano|dólares tuvaluanos|dolares tuvaluanos"], ["Centavo tuvaluano", "centavo tuvaluano|centavos tuvaluanos"], ["Grívnia", "grívnia|grivnia|grívnias|grivnias|grivna|grivnas|uah"], ["Copeque ucraniano", "kopiyka|copeque ucraniano|copeques ucranianos"], ["Xelim ugandês", "xelim ugandês|xelim ugandes|xelins ugandeses|ugx"], ["Centavo ugandês", "centavo ugandês|centavo ugandes|centavos ugandeses"], ["Peso uruguaio", "peso uruguaio|pesos uruguayis|uyu"], ["Centésimo uruguayo", "centésimo uruguaio|centesimo uruguaio|centésimos uruguaios|centesimos uruguaios"], ["Som uzbeque", "som uzbeque|som uzbeques|soms uzbeques|somes uzbeques|som usbeque|som usbeques|soms usbeques|somes usbeques|uzs"], ["Tiyin uzbeque", "tiyin uzbeque|tiyin uzbeques|tiyins uzbeques|tiyin usbeque|tiyin usbeques|tiyins usbeques"], ["Vatu", "vatu|vatus|vuv"], ["Bolívar forte venezuelano", "bolívar forte|bolivar forte|bolívar|bolivar|bolívares|bolivares|vef"], ["Centavo de bolívar", "cêntimo de bolívar|cêntimos de bolívar|centavo de bolívar|centavo de bolivar|centavos de bolívar|centavos de bolivar"], ["Dongue vietnamita", "dongue vietnamita|Đồng vietnamita|dong vietnamita|dongues vietnamitas|dongs vietnamitas|vnd"], ["Hào vietnamita", "hào vietnamita|hao vietnamita|hào vietnamitas|hàos vietnamitas|haos vietnamitas"], ["Rial iemenita", "rial iemenita|riais iemenitas|yer"], ["Fils iemenita", "fils iemenita|fils iemenitas"], ["Franco djibutiano", "franco djibutiano|francos djibutianos|franco jibutiano|francos jibutianos|djf"], ["Dinar iugoslavo", "dinar iugoslavo|dinares iugoslavos|dinar jugoslavo|dinares jugoslavos|yud"], ["Kwacha zambiano", "kwacha zambiano|kwacha zambianos|kwachas zambianos|zmw"], ["Ngwee zambiano", "ngwee zambiano|ngwee zambianos|ngwees zambianos"]]); + PortugueseNumericWithUnit.CompoundUnitConnectorRegex = `(?[^.])`; + PortugueseNumericWithUnit.CurrencyPrefixList = new Map([["Dólar", "$"], ["Dólar estadunidense", "us$|u$d|usd"], ["Dólar do Caribe Oriental", "ec$|xcd"], ["Dólar australiano", "a$|aud"], ["Dólar bahamense", "b$|bsd"], ["Dólar de Barbados", "bds$|bbd"], ["Dólar de Belizebe", "bz$|bzd"], ["Dólar bermudense", "bd$|bmd"], ["Dólar de Brunebi", "brunéi $|bnd"], ["Dólar de Cingapura", "s$|sgd"], ["Dólar canadense", "c$|can$|cad"], ["Dólar das Ilhas Cayman", "ci$|kyd"], ["Dólar neozelandês", "nz$|nzd"], ["Dólar fijgiano", "fj$|fjd"], ["Dólar guianense", "gy$|gyd"], ["Dólar de Hong Kong", "hk$|hkd"], ["Dólar jamaicano", "j$|ja$|jmd"], ["Dólar liberiano", "l$|lrd"], ["Dólar namibiano", "n$|nad"], ["Dólar das Ilhas Salomão", "si$|sbd"], ["Novo dólar taiwanês", "nt$|twd"], ["Real brasileiro", "r$|brl"], ["Guarani", "₲|gs.|pyg"], ["Dólar de Trinidade e Tobago", "tt$|ttd"], ["Yuan chinês", "¥|cny|rmb"], ["Yen", "¥|jpy"], ["Euro", "€|eur"], ["Florim", "ƒ"], ["Libra", "£|gbp"], ["Colón costarriquenho", "₡"], ["Lira turca", "₺"]]); + PortugueseNumericWithUnit.AmbiguousCurrencyUnitList = ['le']; + PortugueseNumericWithUnit.InformationSuffixList = new Map([["bit", "bit|bits"], ["kilobit", "kilobit|kilobits|kb|kbit"], ["megabit", "megabit|megabits|Mb|Mbit"], ["gigabit", "gigabit|gigabits|Gb|Gbit"], ["terabit", "terabit|terabits|Tb|Tbit"], ["petabit", "petabit|petabits|Pb|Pbit"], ["kibibit", "kibibit|kibibits|kib|kibit"], ["mebibit", "mebibit|mebibits|Mib|Mibit"], ["gibibit", "gibibit|gibibits|Gib|Gibit"], ["tebibit", "tebibit|tebibits|Tib|Tibit"], ["pebibit", "pebibit|pebibits|Pib|Pibit"], ["byte", "byte|bytes"], ["kilobyte", "kilobyte|kilobytes|kB|kByte"], ["megabyte", "megabyte|megabytes|MB|MByte"], ["gigabyte", "gigabyte|gigabytes|GB|GByte"], ["terabyte", "terabyte|terabytes|TB|TByte"], ["petabyte", "petabyte|petabytes|PB|PByte"], ["kibibyte", "kibibyte|kibibytes|kiB|kiByte"], ["mebibyte", "mebibyte|mebibytes|MiB|MiByte"], ["gibibyte", "gibibyte|gibibytes|GiB|GiByte"], ["tebibyte", "tebibyte|tebibytes|TiB|TiByte"], ["pebibyte", "pebibyte|pebibytes|PiB|PiByte"]]); + PortugueseNumericWithUnit.AmbiguousDimensionUnitList = ['ton', 'tonelada', 'área', 'area', 'áreas', 'areas', 'milha', 'milhas']; + PortugueseNumericWithUnit.BuildPrefix = `(?<=(\\s|^|\\P{L}))`; + PortugueseNumericWithUnit.BuildSuffix = `(?=(\\s|\\P{L}|$))`; + PortugueseNumericWithUnit.ConnectorToken = 'de'; + PortugueseNumericWithUnit.LengthSuffixList = new Map([["Quilômetro", "km|quilometro|quilômetro|quilómetro|quilometros|quilômetros|quilómetros"], ["Hectômetro", "hm|hectometro|hectômetro|hectómetro|hectometros|hectômetros|hectómetros"], ["Decâmetro", "decametro|decâmetro|decámetro|decametros|decâmetro|decámetros|dam"], ["Metro", "m|m.|metro|metros"], ["Decímetro", "dm|decimetro|decímetro|decimetros|decímetros"], ["Centímetro", "cm|centimetro|centímetro|centimetros|centimetros"], ["Milímetro", "mm|milimetro|milímetro|milimetros|milímetros"], ["Micrômetro", "µm|um|micrometro|micrômetro|micrómetro|micrometros|micrômetros|micrómetros|micron|mícron|microns|mícrons|micra"], ["Nanômetro", "nm|nanometro|nanômetro|nanómetro|nanometros|nanômetros|nanómetros|milimicron|milimícron|milimicrons|milimícrons"], ["Picômetro", "pm|picometro|picômetro|picómetro|picometros|picômetros|picómetros"], ["Milha", "mi|milha|milhas"], ["Jarda", "yd|jarda|jardas"], ["Polegada", "polegada|polegadas|\""], ["Pé", "pé|pe|pés|pes|ft"], ["Ano luz", "ano luz|anos luz|al"]]); + PortugueseNumericWithUnit.AmbiguousLengthUnitList = ['mi', 'milha', 'milhas']; + PortugueseNumericWithUnit.SpeedSuffixList = new Map([["Metro por segundo", "metro/segundo|m/s|metro por segundo|metros por segundo|metros por segundos"], ["Quilômetro por hora", "km/h|quilômetro por hora|quilómetro por hora|quilometro por hora|quilômetros por hora|quilómetros por hora|quilometros por hora|quilômetro/hora|quilómetro/hora|quilometro/hora|quilômetros/hora|quilómetros/hora|quilometros/hora"], ["Quilômetro por minuto", "km/min|quilômetro por minuto|quilómetro por minuto|quilometro por minuto|quilômetros por minuto|quilómetros por minuto|quilometros por minuto|quilômetro/minuto|quilómetro/minuto|quilometro/minuto|quilômetros/minuto|quilómetros/minuto|quilometros/minuto"], ["Quilômetro por segundo", "km/seg|quilômetro por segundo|quilómetro por segundo|quilometro por segundo|quilômetros por segundo|quilómetros por segundo|quilometros por segundo|quilômetro/segundo|quilómetro/segundo|quilometro/segundo|quilômetros/segundo|quilómetros/segundo|quilometros/segundo"], ["Milha por hora", "mph|milha por hora|mi/h|milha/hora|milhas/hora|milhas por hora"], ["Nó", "kt|nó|nós|kn"], ["Pé por segundo", "ft/s|pé/s|pe/s|ft/seg|pé/seg|pe/seg|pé por segundo|pe por segundo|pés por segundo|pes por segundo"], ["Pé por minuto", "ft/min|pé/mind|pe/min|pé por minuto|pe por minuto|pés por minuto|pes por minuto"], ["Jarda por minuto", "jardas por minuto|jardas/minuto|jardas/min"], ["Jarda por segundo", "jardas por segundo|jardas/segundo|jardas/seg"]]); + PortugueseNumericWithUnit.AmbiguousSpeedUnitList = ['nó', 'no', 'nós', 'nos']; + PortugueseNumericWithUnit.TemperatureSuffixList = new Map([["Kelvin", "k|kelvin"], ["Grau Rankine", "r|°r|°ra|grau rankine|graus rankine| rankine"], ["Grau Celsius", "°c|grau c|grau celsius|graus c|graus celsius|celsius|grau centígrado|grau centrigrado|graus centígrados|graus centigrados|centígrado|centígrados|centigrado|centigrados"], ["Grau Fahrenheit", "°f|grau f|graus f|grau fahrenheit|graus fahrenheit|fahrenheit"], ["Grau", "°|graus|grau"]]); + PortugueseNumericWithUnit.VolumeSuffixList = new Map([["Quilômetro cúbico", "quilômetro cúbico|quilómetro cúbico|quilometro cubico|quilômetros cúbicos|quilómetros cúbicos|quilometros cubicos|km3|km^3|km³"], ["Hectômetro cúbico", "hectômetro cúbico|hectómetro cúbico|hectometro cubico|hectômetros cúbicos|hectómetros cúbicos|hectometros cubicos|hm3|hm^3|hm³"], ["Decâmetro cúbico", "decâmetro cúbico|decámetro cúbico|decametro cubico|decâmetros cúbicos|decámetros cúbicos|decametros cubicosdam3|dam^3|dam³"], ["Metro cúbico", "metro cúbico|metro cubico|metros cúbicos|metros cubicos|m3|m^3|m³"], ["Decímetro cúbico", "decímetro cúbico|decimetro cubico|decímetros cúbicos|decimetros cubicos|dm3|dm^3|dm³"], ["Centímetro cúbico", "centímetro cúbico|centimetro cubico|centímetros cúbicos|centrimetros cubicos|cc|cm3|cm^3|cm³"], ["Milímetro cúbico", "milímetro cúbico|milimetro cubico|milímetros cúbicos|milimetros cubicos|mm3|mm^3|mm³"], ["Polegada cúbica", "polegada cúbica|polegada cubica|polegadas cúbicas|polegadas cubicas"], ["Pé cúbico", "pé cúbico|pe cubico|pés cúbicos|pes cubicos|pé3|pe3|pé^3|pe^3|pé³|pe³|ft3|ft^3|ft³"], ["Jarda cúbica", "jarda cúbica|jarda cubica|jardas cúbicas|jardas cubicas|yd3|yd^3|yd³"], ["Hectolitro", "hectolitro|hectolitros|hl"], ["Litro", "litro|litros|lts|l"], ["Mililitro", "mililitro|mililitros|ml"], ["Galão", "galão|galões|galao|galoes"], ["Pint", "pinta|pintas|pinto|pintos|quartilho|quartilhos|pint|pints"], ["Barril", "barril|barris|bbl"], ["Onça líquida", "onça líquida|onca liquida|onças líquidas|oncas liquidas"]]); + PortugueseNumericWithUnit.WeightSuffixList = new Map([["Tonelada métrica", "tonelada métrica|tonelada metrica|toneladas métricas|toneladas metricas"], ["Tonelada", "ton|tonelada|toneladas"], ["Quilograma", "kg|quilograma|quilogramas|quilo|quilos|kilo|kilos"], ["Hectograma", "hg|hectograma|hectogramas"], ["Decagrama", "dag|decagrama|decagramas"], ["Grama", "g|gr|grama|gramas"], ["Decigrama", "dg|decigrama|decigramas"], ["Centigrama", "cg|centigrama|centigramas"], ["Miligrama", "mg|miligrama|miligramas"], ["Micrograma", "µg|ug|micrograma|microgramas"], ["Nanograma", "ng|nanograma|nanogramas"], ["Picograma", "pg|picograma|picogramas"], ["Libra", "lb|libra|libras"], ["Onça", "oz|onça|onca|onças|oncas"], ["Grão", "grão|grao|grãos|graos|gr"], ["Quilate", "ct|kt|quilate|quilates"]]); +})(PortugueseNumericWithUnit = exports.PortugueseNumericWithUnit || (exports.PortugueseNumericWithUnit = {})); + +}); + +unwrapExports(portugueseNumericWithUnit); + +var base$4 = createCommonjsModule(function (module, exports) { +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); + + + + + +class PortugueseNumberWithUnitExtractorConfiguration { + constructor(ci) { + this.cultureInfo = ci; + this.unitNumExtractor = new recognizersTextNumber.PortugueseNumberExtractor(); + this.buildPrefix = portugueseNumericWithUnit.PortugueseNumericWithUnit.BuildPrefix; + this.buildSuffix = portugueseNumericWithUnit.PortugueseNumericWithUnit.BuildSuffix; + this.connectorToken = portugueseNumericWithUnit.PortugueseNumericWithUnit.ConnectorToken; + this.compoundUnitConnectorRegex = recognizersText.RegExpUtility.getSafeRegExp(portugueseNumericWithUnit.PortugueseNumericWithUnit.CompoundUnitConnectorRegex); + this.pmNonUnitRegex = recognizersText.RegExpUtility.getSafeRegExp(baseUnits.BaseUnits.PmNonUnitRegex); + } +} +exports.PortugueseNumberWithUnitExtractorConfiguration = PortugueseNumberWithUnitExtractorConfiguration; +class PortugueseNumberWithUnitParserConfiguration extends parsers$8.BaseNumberWithUnitParserConfiguration { + constructor(ci) { + super(ci); + this.internalNumberExtractor = new recognizersTextNumber.PortugueseNumberExtractor(recognizersTextNumber.NumberMode.Default); + this.internalNumberParser = recognizersTextNumber.AgnosticNumberParserFactory.getParser(recognizersTextNumber.AgnosticNumberParserType.Number, new recognizersTextNumber.PortugueseNumberParserConfiguration()); + this.connectorToken = portugueseNumericWithUnit.PortugueseNumericWithUnit.ConnectorToken; + } +} +exports.PortugueseNumberWithUnitParserConfiguration = PortugueseNumberWithUnitParserConfiguration; + +}); + +unwrapExports(base$4); + +var currency$4 = createCommonjsModule(function (module, exports) { +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); + + + + +class PortugueseCurrencyExtractorConfiguration extends base$4.PortugueseNumberWithUnitExtractorConfiguration { + constructor(ci) { + if (!ci) { + ci = new recognizersTextNumber.CultureInfo(recognizersTextNumber.Culture.Portuguese); + } + super(ci); + this.extractType = constants$4.Constants.SYS_UNIT_CURRENCY; + // Reference Source: https:// en.wikipedia.org/wiki/List_of_circulating_currencies + this.suffixList = portugueseNumericWithUnit.PortugueseNumericWithUnit.CurrencySuffixList; + this.prefixList = portugueseNumericWithUnit.PortugueseNumericWithUnit.CurrencyPrefixList; + this.ambiguousUnitList = portugueseNumericWithUnit.PortugueseNumericWithUnit.AmbiguousCurrencyUnitList; + } +} +exports.PortugueseCurrencyExtractorConfiguration = PortugueseCurrencyExtractorConfiguration; +class PortugueseCurrencyParserConfiguration extends base$4.PortugueseNumberWithUnitParserConfiguration { + constructor(ci) { + if (!ci) { + ci = new recognizersTextNumber.CultureInfo(recognizersTextNumber.Culture.Portuguese); + } + super(ci); + this.BindDictionary(portugueseNumericWithUnit.PortugueseNumericWithUnit.CurrencySuffixList); + this.BindDictionary(portugueseNumericWithUnit.PortugueseNumericWithUnit.CurrencyPrefixList); + } +} +exports.PortugueseCurrencyParserConfiguration = PortugueseCurrencyParserConfiguration; + +}); + +unwrapExports(currency$4); + +var temperature$4 = createCommonjsModule(function (module, exports) { +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); + + + + +class PortugueseTemperatureExtractorConfiguration extends base$4.PortugueseNumberWithUnitExtractorConfiguration { + constructor(ci) { + if (!ci) { + ci = new recognizersTextNumber.CultureInfo(recognizersTextNumber.Culture.Portuguese); + } + super(ci); + this.extractType = constants$4.Constants.SYS_UNIT_TEMPERATURE; + this.suffixList = portugueseNumericWithUnit.PortugueseNumericWithUnit.TemperatureSuffixList; + this.prefixList = new Map(); + this.ambiguousUnitList = new Array(); + } +} +exports.PortugueseTemperatureExtractorConfiguration = PortugueseTemperatureExtractorConfiguration; +class PortugueseTemperatureParserConfiguration extends base$4.PortugueseNumberWithUnitParserConfiguration { + constructor(ci) { + if (!ci) { + ci = new recognizersTextNumber.CultureInfo(recognizersTextNumber.Culture.Portuguese); + } + super(ci); + this.BindDictionary(portugueseNumericWithUnit.PortugueseNumericWithUnit.TemperatureSuffixList); + } +} +exports.PortugueseTemperatureParserConfiguration = PortugueseTemperatureParserConfiguration; + +}); + +unwrapExports(temperature$4); + +var dimension$4 = createCommonjsModule(function (module, exports) { +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); + + + + +const dimensionSuffixList = new Map([ + ...portugueseNumericWithUnit.PortugueseNumericWithUnit.InformationSuffixList, + ...portugueseNumericWithUnit.PortugueseNumericWithUnit.AreaSuffixList, + ...portugueseNumericWithUnit.PortugueseNumericWithUnit.LengthSuffixList, + ...portugueseNumericWithUnit.PortugueseNumericWithUnit.SpeedSuffixList, + ...portugueseNumericWithUnit.PortugueseNumericWithUnit.VolumeSuffixList, + ...portugueseNumericWithUnit.PortugueseNumericWithUnit.WeightSuffixList +]); +class PortugueseDimensionExtractorConfiguration extends base$4.PortugueseNumberWithUnitExtractorConfiguration { + constructor(ci) { + if (!ci) { + ci = new recognizersTextNumber.CultureInfo(recognizersTextNumber.Culture.Portuguese); + } + super(ci); + this.extractType = constants$4.Constants.SYS_UNIT_DIMENSION; + this.suffixList = dimensionSuffixList; + this.prefixList = new Map(); + this.ambiguousUnitList = portugueseNumericWithUnit.PortugueseNumericWithUnit.AmbiguousDimensionUnitList; + } +} +exports.PortugueseDimensionExtractorConfiguration = PortugueseDimensionExtractorConfiguration; +class PortugueseDimensionParserConfiguration extends base$4.PortugueseNumberWithUnitParserConfiguration { + constructor(ci) { + if (!ci) { + ci = new recognizersTextNumber.CultureInfo(recognizersTextNumber.Culture.Portuguese); + } + super(ci); + this.BindDictionary(dimensionSuffixList); + } +} +exports.PortugueseDimensionParserConfiguration = PortugueseDimensionParserConfiguration; + +}); + +unwrapExports(dimension$4); + +var age$4 = createCommonjsModule(function (module, exports) { +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); + + + + +class PortugueseAgeExtractorConfiguration extends base$4.PortugueseNumberWithUnitExtractorConfiguration { + constructor(ci) { + if (!ci) { + ci = new recognizersTextNumber.CultureInfo(recognizersTextNumber.Culture.Portuguese); + } + super(ci); + this.extractType = constants$4.Constants.SYS_UNIT_AGE; + this.suffixList = portugueseNumericWithUnit.PortugueseNumericWithUnit.AgeSuffixList; + this.prefixList = new Map(); + this.ambiguousUnitList = new Array(); + } +} +exports.PortugueseAgeExtractorConfiguration = PortugueseAgeExtractorConfiguration; +class PortugueseAgeParserConfiguration extends base$4.PortugueseNumberWithUnitParserConfiguration { + constructor(ci) { + if (!ci) { + ci = new recognizersTextNumber.CultureInfo(recognizersTextNumber.Culture.Portuguese); + } + super(ci); + this.BindDictionary(portugueseNumericWithUnit.PortugueseNumericWithUnit.AgeSuffixList); + } +} +exports.PortugueseAgeParserConfiguration = PortugueseAgeParserConfiguration; + +}); + +unwrapExports(age$4); + +var chineseNumericWithUnit = createCommonjsModule(function (module, exports) { +"use strict"; +// ------------------------------------------------------------------------------ +// +// This code was generated by a tool. +// Changes to this file may cause incorrect behavior and will be lost if +// the code is regenerated. +// +// ------------------------------------------------------------------------------ +Object.defineProperty(exports, "__esModule", { value: true }); +var ChineseNumericWithUnit; +(function (ChineseNumericWithUnit) { + ChineseNumericWithUnit.AgeAmbiguousValues = ['岁']; + ChineseNumericWithUnit.AgeSuffixList = new Map([["Year", "岁|周岁"], ["Month", "个月大|月大"], ["Week", "周大"], ["Day", "天大"]]); + ChineseNumericWithUnit.BuildPrefix = ''; + ChineseNumericWithUnit.BuildSuffix = ''; + ChineseNumericWithUnit.ConnectorToken = ''; + ChineseNumericWithUnit.CurrencySuffixList = new Map([["Afghan afghani", "阿富汗尼"], ["Pul", "普尔"], ["Euro", "欧元"], ["Cent", "美分"], ["Albanian lek", "阿尔巴尼亚列克|列克"], ["Angolan kwanza", "安哥拉宽扎|宽扎"], ["Armenian dram", "亚美尼亚德拉姆"], ["Aruban florin", "阿鲁巴弗罗林|阿鲁巴币"], ["Bangladeshi taka", "塔卡|孟加拉塔卡"], ["Paisa", "派萨|帕萨"], ["Bhutanese ngultrum", "不丹努尔特鲁姆|不丹努扎姆|努扎姆"], ["Chetrum", "切特鲁姆"], ["Bolivian boliviano", "玻利维亚诺|玻利维亚币"], ["Bosnia and Herzegovina convertible mark", "波斯尼亚和黑塞哥维那可兑换马克|波赫可兑换马克"], ["Botswana pula", "博茨瓦纳普拉|普拉"], ["Thebe", "thebe"], ["Brazilian real", "巴西雷亚尔"], ["Bulgarian lev", "保加利亚列弗|保加利亚列瓦"], ["Stotinka", "斯托丁卡"], ["Cambodian riel", "瑞尔"], ["Cape Verdean escudo", "佛得角埃斯库多|维德角埃斯库多"], ["Croatian kuna", "克罗地亚库纳|克罗地亚库那|克罗埃西亚库纳"], ["Lipa", "利巴"], ["Eritrean nakfa", "厄立特里亚纳克法"], ["Ethiopian birr", "埃塞俄比亚比尔|埃塞俄比亚元"], ["Gambian dalasi", "冈比亚达拉西|甘比亚达拉西"], ["Butut", "布达|布图"], ["Georgian lari", "格鲁吉亚拉里"], ["Tetri", "特特里|泰特里"], ["Ghanaian cedi", "塞地|加纳塞地"], ["Pesewa", "比塞瓦"], ["Guatemalan quetzal", "瓜地马拉格查尔"], ["Haitian gourde", "海地古德"], ["Honduran lempira", "洪都拉斯伦皮拉"], ["Hungarian forint", "匈牙利福林|匈牙利货币|匈牙利福林币"], ["Iranian rial", "伊朗里亚尔|伊朗莱尔"], ["Yemeni rial", "叶门莱尔|叶门里亚尔"], ["Israeli new shekel", "₪|ils|以色列币|以色列新克尔|谢克尔"], ["Japanese yen", "日元|日本元|日币|日圆"], ["Sen", "日本銭"], ["Kazakhstani tenge", "哈萨克斯坦坚戈"], ["Kenyan shilling", "肯尼亚先令"], ["North Korean won", "朝鲜圆|朝鲜元"], ["South Korean won", "韩元|韩圆"], ["Korean won", "₩"], ["Kyrgyzstani som", "吉尔吉斯斯坦索姆"], ["Lao kip", "基普|老挝基普|老挝币"], ["Att", "att"], ["Lesotho loti", "莱索托洛提|莱索托马洛蒂"], ["South African rand", "南非兰特"], ["Macedonian denar", "马其顿代纳尔|马其顿币|第纳尔|代纳尔"], ["Deni", "第尼"], ["Malagasy ariary", "马达加斯加阿里亚里"], ["Iraimbilanja", "伊莱姆比拉贾"], ["Malawian kwacha", "马拉威克瓦查"], ["Tambala", "坦巴拉"], ["Malaysian ringgit", "马来西亚币|马币|马来西亚林吉特"], ["Mauritanian ouguiya", "毛里塔尼亚乌吉亚"], ["Khoums", "库姆斯"], ["Mozambican metical", "莫桑比克梅蒂卡尔|梅蒂卡尔"], ["Burmese kyat", "缅甸元|缅元"], ["Pya", "缅分"], ["Nigerian naira", "尼日利亚奈拉|尼日利亚币|奈拉"], ["Kobo", "考包"], ["Turkish lira", "土耳其里拉"], ["Kuruş", "库鲁"], ["Omani rial", "阿曼里亚尔|阿曼莱尔"], ["Panamanian balboa", "巴拿马巴波亚"], ["Centesimo", "意大利分|乌拉圭分|巴拿马分"], ["Papua New Guinean kina", "基那"], ["Toea", "托亚|托伊"], ["Peruvian sol", "秘鲁索尔"], ["Polish złoty", "波兰币|波兰兹罗提|兹罗提"], ["Grosz", "格罗希"], ["Qatari riyal", "卡达里亚尔"], ["Saudi riyal", "沙特里亚尔"], ["Riyal", "里亚尔|"], ["Dirham", "迪拉姆"], ["Halala", "哈拉"], ["Samoan tālā", "萨摩亚塔拉"], ["Sierra Leonean leone", "塞拉利昂利昂|利昂"], ["Peseta", "比塞塔|西班牙比塞塔|西班牙币"], ["Swazi lilangeni", "斯威士兰里兰吉尼|兰吉尼"], ["Tajikistani somoni", "塔吉克斯坦索莫尼"], ["Thai baht", "泰铢|泰元"], ["Satang", "萨当"], ["Tongan paʻanga", "汤加潘加|潘加"], ["Ukrainian hryvnia", "乌克兰格里夫纳|格里夫纳"], ["Vanuatu vatu", "瓦努阿图瓦图"], ["Vietnamese dong", "越南盾"], ["Indonesian rupiah", "印度尼西亚盾"], ["Netherlands guilder", "荷兰盾|荷属安的列斯盾|列斯盾"], ["Surinam florin", "苏里南盾"], ["Guilder", "盾"], ["Zambian kwacha", "赞比亚克瓦查"], ["Moroccan dirham", "摩洛哥迪拉姆"], ["United Arab Emirates dirham", "阿联酋迪拉姆"], ["Azerbaijani manat", "阿塞拜疆马纳特"], ["Turkmenistan manat", "土库曼马纳特"], ["Manat", "马纳特"], ["Somali shilling", "索马里先令|索马利先令"], ["Somaliland shilling", "索马里兰先令"], ["Tanzanian shilling", "坦桑尼亚先令"], ["Ugandan shilling", "乌干达先令"], ["Romanian leu", "罗马尼亚列伊"], ["Moldovan leu", "摩尔多瓦列伊"], ["Leu", "列伊"], ["Ban", "巴尼"], ["Nepalese rupee", "尼泊尔卢比"], ["Pakistani rupee", "巴基斯坦卢比"], ["Indian rupee", "印度卢比"], ["Seychellois rupee", "塞舌尔卢比"], ["Mauritian rupee", "毛里求斯卢比"], ["Maldivian rufiyaa", "马尔代夫卢比"], ["Sri Lankan rupee", "斯里兰卡卢比"], ["Rupee", "卢比"], ["Czech koruna", "捷克克朗"], ["Danish krone", "丹麦克朗|丹麦克郎"], ["Norwegian krone", "挪威克朗"], ["Faroese króna", "法罗克朗"], ["Icelandic króna", "冰岛克朗"], ["Swedish krona", "瑞典克朗"], ["Krone", "克朗"], ["Øre", "奥依拉|奥拉|埃利"], ["West African CFA franc", "非共体法郎"], ["Central African CFA franc", "中非法郎|中非金融合作法郎"], ["Comorian franc", "科摩罗法郎"], ["Congolese franc", "刚果法郎"], ["Burundian franc", "布隆迪法郎"], ["Djiboutian franc", "吉布提法郎"], ["CFP franc", "太平洋法郎"], ["Guinean franc", "几内亚法郎"], ["Swiss franc", "瑞士法郎"], ["Rwandan franc", "卢旺达法郎"], ["Belgian franc", "比利时法郎"], ["Rappen", "瑞士分|瑞士生丁"], ["Franc", "法郎"], ["Centime", "生丁|仙士"], ["Russian ruble", "俄国卢布|俄罗斯卢布"], ["Transnistrian ruble", "德涅斯特卢布"], ["Belarusian ruble", "白俄罗斯卢布"], ["Kopek", "戈比"], ["Ruble", "卢布"], ["Algerian dinar", "阿尔及利亚第纳尔"], ["Bahraini dinar", "巴林第纳尔"], ["Iraqi dinar", "伊拉克第纳尔|"], ["Jordanian dinar", "约旦第纳尔"], ["Kuwaiti dinar", "科威特第纳尔|科威特币"], ["Libyan dinar", "利比亚第纳尔"], ["Serbian dinar", "塞尔维亚第纳尔|塞尔维亚币"], ["Tunisian dinar", "突尼斯第纳尔"], ["Dinar", "第纳尔"], ["Fils", "费尔"], ["Para", "帕拉"], ["Millime", "米利姆"], ["Argentine peso", "阿根廷比索"], ["Chilean peso", "智利比索"], ["Colombian peso", "哥伦比亚比索"], ["Cuban peso", "古巴比索"], ["Dominican peso", "多米尼加比索"], ["Mexican peso", "墨西哥比索"], ["Philippine peso", "菲律宾比索"], ["Uruguayan peso", "乌拉圭比索"], ["Peso", "比索"], ["Centavo", "仙|菲辅币"], ["Alderney pound", "奥尔德尼镑"], ["British pound", "英镑"], ["Guernsey pound", "根西镑"], ["Saint Helena pound", "圣赫勒拿镑"], ["Egyptian pound", "埃及镑"], ["Falkland Islands pound", "福克兰镑"], ["Gibraltar pound", "直布罗陀镑"], ["Manx pound", "马恩岛镑"], ["Jersey pound", "泽西岛镑"], ["Lebanese pound", "黎巴嫩镑"], ["South Sudanese pound", "南苏丹镑"], ["Sudanese pound", "苏丹镑"], ["Syrian pound", "叙利亚镑"], ["Pound", "英镑"], ["Pence", "便士"], ["Shilling", "先令"], ["United States dollar", "美元|美金|美圆"], ["East Caribbean dollar", "东加勒比元"], ["Australian dollar", "澳大利亚元|澳元"], ["Bahamian dollar", "巴哈马元"], ["Barbadian dollar", "巴巴多斯元"], ["Belize dollar", "伯利兹元"], ["Bermudian dollar", "百慕大元"], ["Brunei dollar", "文莱元"], ["Singapore dollar", "新加坡元|新元"], ["Canadian dollar", "加元|加拿大元"], ["Cayman Islands dollar", "开曼岛元|"], ["New Zealand dollar", "新西兰元|纽元"], ["Cook Islands dollar", "库克群岛元"], ["Fijian dollar", "斐济元|斐币"], ["Guyanese dollar", "圭亚那元"], ["Hong Kong dollar", "蚊|港元|港圆|港币"], ["Macau Pataca", "澳元|澳门币|澳门元"], ["New Taiwan dollar", "箍|新台币|台币"], ["Jamaican dollar", "牙买加元"], ["Kiribati dollar", "吉里巴斯元"], ["Liberian dollar", "利比里亚元"], ["Namibian dollar", "纳米比亚元"], ["Surinamese dollar", "苏里南元"], ["Trinidad and Tobago dollar", "特立尼达多巴哥元"], ["Tuvaluan dollar", "吐瓦鲁元"], ["Chinese yuan", "人民币|人民币元|块钱|块|元|圆"], ["Fen", "分钱|分"], ["Jiao", "毛钱|毛|角钱|角"], ["Finnish markka", "芬兰马克"], ["Penni", "盆尼"]]); + ChineseNumericWithUnit.CurrencyNameToIsoCodeMap = new Map([["Afghan afghani", "AFN"], ["Euro", "EUR"], ["Albanian lek", "ALL"], ["Angolan kwanza", "AOA"], ["Armenian dram", "AMD"], ["Aruban florin", "AWG"], ["Bangladeshi taka", "BDT"], ["Bhutanese ngultrum", "BTN"], ["Bolivian boliviano", "BOB"], ["Bosnia and Herzegovina convertible mark", "BAM"], ["Botswana pula", "BWP"], ["Brazilian real", "BRL"], ["Bulgarian lev", "BGN"], ["Cambodian riel", "KHR"], ["Cape Verdean escudo", "CVE"], ["Costa Rican colón", "CRC"], ["Croatian kuna", "HRK"], ["Czech koruna", "CZK"], ["Eritrean nakfa", "ERN"], ["Ethiopian birr", "ETB"], ["Gambian dalasi", "GMD"], ["Georgian lari", "GEL"], ["Ghanaian cedi", "GHS"], ["Guatemalan quetzal", "GTQ"], ["Haitian gourde", "HTG"], ["Honduran lempira", "HNL"], ["Hungarian forint", "HUF"], ["Iranian rial", "IRR"], ["Yemeni rial", "YER"], ["Israeli new shekel", "ILS"], ["Japanese yen", "JPY"], ["Kazakhstani tenge", "KZT"], ["Kenyan shilling", "KES"], ["North Korean won", "KPW"], ["South Korean won", "KRW"], ["Kyrgyzstani som", "KGS"], ["Lao kip", "LAK"], ["Lesotho loti", "LSL"], ["South African rand", "ZAR"], ["Macanese pataca", "MOP"], ["Macedonian denar", "MKD"], ["Malagasy ariary", "MGA"], ["Malawian kwacha", "MWK"], ["Malaysian ringgit", "MYR"], ["Mauritanian ouguiya", "MRO"], ["Mongolian tögrög", "MNT"], ["Mozambican metical", "MZN"], ["Burmese kyat", "MMK"], ["Nicaraguan córdoba", "NIO"], ["Nigerian naira", "NGN"], ["Turkish lira", "TRY"], ["Omani rial", "OMR"], ["Panamanian balboa", "PAB"], ["Papua New Guinean kina", "PGK"], ["Paraguayan guaraní", "PYG"], ["Peruvian sol", "PEN"], ["Polish złoty", "PLN"], ["Qatari riyal", "QAR"], ["Saudi riyal", "SAR"], ["Samoan tālā", "WST"], ["São Tomé and Príncipe dobra", "STD"], ["Sierra Leonean leone", "SLL"], ["Swazi lilangeni", "SZL"], ["Tajikistani somoni", "TJS"], ["Thai baht", "THB"], ["Ukrainian hryvnia", "UAH"], ["Vanuatu vatu", "VUV"], ["Venezuelan bolívar", "VEF"], ["Zambian kwacha", "ZMW"], ["Moroccan dirham", "MAD"], ["United Arab Emirates dirham", "AED"], ["Azerbaijani manat", "AZN"], ["Turkmenistan manat", "TMT"], ["Somali shilling", "SOS"], ["Tanzanian shilling", "TZS"], ["Ugandan shilling", "UGX"], ["Romanian leu", "RON"], ["Moldovan leu", "MDL"], ["Nepalese rupee", "NPR"], ["Pakistani rupee", "PKR"], ["Indian rupee", "INR"], ["Seychellois rupee", "SCR"], ["Mauritian rupee", "MUR"], ["Maldivian rufiyaa", "MVR"], ["Sri Lankan rupee", "LKR"], ["Indonesian rupiah", "IDR"], ["Danish krone", "DKK"], ["Norwegian krone", "NOK"], ["Icelandic króna", "ISK"], ["Swedish krona", "SEK"], ["West African CFA franc", "XOF"], ["Central African CFA franc", "XAF"], ["Comorian franc", "KMF"], ["Congolese franc", "CDF"], ["Burundian franc", "BIF"], ["Djiboutian franc", "DJF"], ["CFP franc", "XPF"], ["Guinean franc", "GNF"], ["Swiss franc", "CHF"], ["Rwandan franc", "RWF"], ["Russian ruble", "RUB"], ["Transnistrian ruble", "PRB"], ["Belarusian ruble", "BYN"], ["Algerian dinar", "DZD"], ["Bahraini dinar", "BHD"], ["Iraqi dinar", "IQD"], ["Jordanian dinar", "JOD"], ["Kuwaiti dinar", "KWD"], ["Libyan dinar", "LYD"], ["Serbian dinar", "RSD"], ["Tunisian dinar", "TND"], ["Argentine peso", "ARS"], ["Chilean peso", "CLP"], ["Colombian peso", "COP"], ["Cuban convertible peso", "CUC"], ["Cuban peso", "CUP"], ["Dominican peso", "DOP"], ["Mexican peso", "MXN"], ["Uruguayan peso", "UYU"], ["British pound", "GBP"], ["Saint Helena pound", "SHP"], ["Egyptian pound", "EGP"], ["Falkland Islands pound", "FKP"], ["Gibraltar pound", "GIP"], ["Manx pound", "IMP"], ["Jersey pound", "JEP"], ["Lebanese pound", "LBP"], ["South Sudanese pound", "SSP"], ["Sudanese pound", "SDG"], ["Syrian pound", "SYP"], ["United States dollar", "USD"], ["Australian dollar", "AUD"], ["Bahamian dollar", "BSD"], ["Barbadian dollar", "BBD"], ["Belize dollar", "BZD"], ["Bermudian dollar", "BMD"], ["Brunei dollar", "BND"], ["Singapore dollar", "SGD"], ["Canadian dollar", "CAD"], ["Cayman Islands dollar", "KYD"], ["New Zealand dollar", "NZD"], ["Fijian dollar", "FJD"], ["Guyanese dollar", "GYD"], ["Hong Kong dollar", "HKD"], ["Jamaican dollar", "JMD"], ["Liberian dollar", "LRD"], ["Namibian dollar", "NAD"], ["Solomon Islands dollar", "SBD"], ["Surinamese dollar", "SRD"], ["New Taiwan dollar", "TWD"], ["Trinidad and Tobago dollar", "TTD"], ["Tuvaluan dollar", "TVD"], ["Chinese yuan", "CNY"], ["Rial", "__RI"], ["Shiling", "__S"], ["Som", "__SO"], ["Dirham", "__DR"], ["Dinar", "_DN"], ["Dollar", "__D"], ["Manat", "__MA"], ["Rupee", "__R"], ["Krone", "__K"], ["Krona", "__K"], ["Crown", "__K"], ["Frank", "__F"], ["Mark", "__M"], ["Ruble", "__RB"], ["Peso", "__PE"], ["Pound", "__P"], ["Tristan da Cunha pound", "_TP"], ["South Georgia and the South Sandwich Islands pound", "_SP"], ["Somaliland shilling", "_SS"], ["Pitcairn Islands dollar", "_PND"], ["Palauan dollar", "_PD"], ["Niue dollar", "_NID"], ["Nauruan dollar", "_ND"], ["Micronesian dollar", "_MD"], ["Kiribati dollar", "_KID"], ["Guernsey pound", "_GGP"], ["Faroese króna", "_FOK"], ["Cook Islands dollar", "_CKD"], ["British Virgin Islands dollar", "_BD"], ["Ascension pound", "_AP"], ["Alderney pound", "_ALP"], ["Abkhazian apsar", "_AA"]]); + ChineseNumericWithUnit.FractionalUnitNameToCodeMap = new Map([["Jiao", "JIAO"], ["Kopek", "KOPEK"], ["Pul", "PUL"], ["Cent", "CENT"], ["Qindarkë", "QINDARKE"], ["Penny", "PENNY"], ["Santeem", "SANTEEM"], ["Cêntimo", "CENTIMO"], ["Centavo", "CENTAVO"], ["Luma", "LUMA"], ["Qəpik", "QƏPIK"], ["Fils", "FILS"], ["Poisha", "POISHA"], ["Kapyeyka", "KAPYEYKA"], ["Centime", "CENTIME"], ["Chetrum", "CHETRUM"], ["Paisa", "PAISA"], ["Fening", "FENING"], ["Thebe", "THEBE"], ["Sen", "SEN"], ["Stotinka", "STOTINKA"], ["Fen", "FEN"], ["Céntimo", "CENTIMO"], ["Lipa", "LIPA"], ["Haléř", "HALER"], ["Øre", "ØRE"], ["Piastre", "PIASTRE"], ["Santim", "SANTIM"], ["Oyra", "OYRA"], ["Butut", "BUTUT"], ["Tetri", "TETRI"], ["Pesewa", "PESEWA"], ["Fillér", "FILLER"], ["Eyrir", "EYRIR"], ["Dinar", "DINAR"], ["Agora", "AGORA"], ["Tïın", "TIIN"], ["Chon", "CHON"], ["Jeon", "JEON"], ["Tyiyn", "TYIYN"], ["Att", "ATT"], ["Sente", "SENTE"], ["Dirham", "DIRHAM"], ["Rappen", "RAPPEN"], ["Avo", "AVO"], ["Deni", "DENI"], ["Iraimbilanja", "IRAIMBILANJA"], ["Tambala", "TAMBALA"], ["Laari", "LAARI"], ["Khoums", "KHOUMS"], ["Ban", "BAN"], ["Möngö", "MONGO"], ["Pya", "PYA"], ["Kobo", "KOBO"], ["Kuruş", "KURUS"], ["Baisa", "BAISA"], ["Centésimo", "CENTESIMO"], ["Toea", "TOEA"], ["Sentimo", "SENTIMO"], ["Grosz", "GROSZ"], ["Sene", "SENE"], ["Halala", "HALALA"], ["Para", "PARA"], ["Öre", "ORE"], ["Diram", "DIRAM"], ["Satang", "SATANG"], ["Seniti", "SENITI"], ["Millime", "MILLIME"], ["Tennesi", "TENNESI"], ["Kopiyka", "KOPIYKA"], ["Tiyin", "TIYIN"], ["Hào", "HAO"], ["Ngwee", "NGWEE"]]); + ChineseNumericWithUnit.CompoundUnitConnectorRegex = `(?又|再)`; + ChineseNumericWithUnit.CurrencyPrefixList = new Map([["Dollar", "$"], ["United States dollar", "us$"], ["British Virgin Islands dollar", "bvi$"], ["Brunei dollar", "b$"], ["Sen", "sen"], ["Singapore dollar", "s$"], ["Canadian dollar", "can$|c$|c $"], ["Cayman Islands dollar", "ci$"], ["New Zealand dollar", "nz$|nz $"], ["Guyanese dollar", "gy$|gy $|g$|g $"], ["Hong Kong dollar", "hk$|hkd|hk $"], ["Jamaican dollar", "j$"], ["Namibian dollar", "nad|n$|n $"], ["Solomon Islands dollar", "si$|si $"], ["New Taiwan dollar", "nt$|nt $"], ["Samoan tālā", "ws$"], ["Chinese yuan", "¥"], ["Japanese yen", "¥"], ["Turkish lira", "₺"], ["Euro", "€"], ["Pound", "£"], ["Costa Rican colón", "₡"]]); + ChineseNumericWithUnit.CurrencyAmbiguousValues = ['元', '仙', '分', '圆', '块', '毛', '盾', '箍', '蚊', '角']; + ChineseNumericWithUnit.DimensionSuffixList = new Map([["Meter", "米|公尺|m"], ["Kilometer", "千米|公里|km"], ["Decimeter", "分米|公寸|dm"], ["Centimeter", "釐米|厘米|公分|cm"], ["Micrometer", "毫米|公釐|mm"], ["Microns", "微米"], ["Picometer", "皮米"], ["Nanometer", "纳米"], ["Li", "里|市里"], ["Zhang", "丈"], ["Chi", "市尺|尺"], ["Cun", "市寸|寸"], ["Fen", "市分|分"], ["Hao", "毫"], ["Mile", "英里"], ["Inch", "英寸"], ["Foot", "呎|英尺"], ["Yard", "码"], ["Knot", "海里"], ["Light year", "光年"], ["Meter per second", "米每秒|米/秒|m/s"], ["Kilometer per hour", "公里每小时|千米每小时|公里/小时|千米/小时|km/h"], ["Kilometer per minute", "公里每分钟|千米每分钟|公里/分钟|千米/分钟|km/min"], ["Kilometer per second", "公里每秒|千米每秒|公里/秒|千米/秒|km/s"], ["Mile per hour", "英里每小时|英里/小时"], ["Foot per second", "英尺每小时|英尺/小时"], ["Foot per minute", "英尺每分钟|英尺/分钟"], ["Yard per minute", "码每分|码/分"], ["Yard per second", "码每秒|码/秒"], ["Square centimetre", "平方厘米"], ["Square decimeter", "平方分米"], ["Square meter", "平方米"], ["Square kilometer", "平方公里"], ["Acre", "英亩|公亩"], ["Hectare", "公顷"], ["Mu", "亩|市亩"], ["Liter", "公升|升|l"], ["Milliliter", "毫升|ml"], ["Cubic meter", "立方米"], ["Cubic decimeter", "立方分米"], ["Cubic millimeter", "立方毫米"], ["Cubic feet", "立方英尺"], ["Gallon", "加仑"], ["Pint", "品脱"], ["Dou", "市斗|斗"], ["Dan", "市石|石"], ["Kilogram", "千克|公斤|kg"], ["Jin", "市斤|斤"], ["Milligram", "毫克|mg"], ["Barrel", "桶"], ["Pot", "罐"], ["Gram", "克|g"], ["Ton", "公吨|吨|t"], ["Pound", "磅"], ["Ounce", "盎司"], ["Bit", "比特|位|b"], ["Byte", "字节|byte"], ["Kilobyte", "千字节|kb"], ["Megabyte", "兆字节|mb"], ["Gigabyte", "十亿字节|千兆字节|gb"], ["Terabyte", "万亿字节|兆兆字节|tb"], ["Petabyte", "千兆兆|千万亿字节|pb"]]); + ChineseNumericWithUnit.DimensionAmbiguousValues = ['丈', '位', '克', '分', '升', '寸', '尺', '斗', '斤', '桶', '毫', '石', '码', '磅', '米', '罐', '里', 'm', 'km', 'dm', 'cm', 'mm', 'l', 'ml', 'kg', 'mg', 'g', 't', 'b', 'byte', 'kb', 'mb', 'gb', 'tb', 'pb']; + ChineseNumericWithUnit.TemperatureSuffixList = new Map([["F", "华氏温度|华氏度|°f"], ["K", "k|开尔文温度|开氏度|凯氏度"], ["R", "兰氏温度|°r"], ["C", "摄氏温度|摄氏度|°c"], ["Degree", "度"]]); + ChineseNumericWithUnit.TemperaturePrefixList = new Map([["F", "华氏温度|华氏"], ["K", "开氏温度|开氏"], ["R", "兰氏温度|兰氏"], ["C", "摄氏温度|摄氏"]]); + ChineseNumericWithUnit.TemperatureAmbiguousValues = ['度', 'k']; +})(ChineseNumericWithUnit = exports.ChineseNumericWithUnit || (exports.ChineseNumericWithUnit = {})); + +}); + +unwrapExports(chineseNumericWithUnit); + +var base$6 = createCommonjsModule(function (module, exports) { +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); + + + + + +class ChineseNumberWithUnitExtractorConfiguration { + constructor(ci) { + this.cultureInfo = ci; + this.unitNumExtractor = new recognizersTextNumber.ChineseNumberExtractor(recognizersTextNumber.ChineseNumberExtractorMode.ExtractAll); + this.buildPrefix = chineseNumericWithUnit.ChineseNumericWithUnit.BuildPrefix; + this.buildSuffix = chineseNumericWithUnit.ChineseNumericWithUnit.BuildSuffix; + this.connectorToken = chineseNumericWithUnit.ChineseNumericWithUnit.ConnectorToken; + this.compoundUnitConnectorRegex = recognizersText.RegExpUtility.getSafeRegExp(chineseNumericWithUnit.ChineseNumericWithUnit.CompoundUnitConnectorRegex); + this.pmNonUnitRegex = recognizersText.RegExpUtility.getSafeRegExp(baseUnits.BaseUnits.PmNonUnitRegex); + } +} +exports.ChineseNumberWithUnitExtractorConfiguration = ChineseNumberWithUnitExtractorConfiguration; +class ChineseNumberWithUnitParserConfiguration extends parsers$8.BaseNumberWithUnitParserConfiguration { + constructor(ci) { + super(ci); + this.internalNumberExtractor = new recognizersTextNumber.ChineseNumberExtractor(recognizersTextNumber.ChineseNumberExtractorMode.Default); + this.internalNumberParser = recognizersTextNumber.AgnosticNumberParserFactory.getParser(recognizersTextNumber.AgnosticNumberParserType.Number, new recognizersTextNumber.ChineseNumberParserConfiguration()); + this.connectorToken = ''; + this.currencyNameToIsoCodeMap = chineseNumericWithUnit.ChineseNumericWithUnit.CurrencyNameToIsoCodeMap; + this.currencyFractionCodeList = chineseNumericWithUnit.ChineseNumericWithUnit.FractionalUnitNameToCodeMap; + } +} +exports.ChineseNumberWithUnitParserConfiguration = ChineseNumberWithUnitParserConfiguration; + +}); + +unwrapExports(base$6); + +var currency$6 = createCommonjsModule(function (module, exports) { +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); + + + + +class ChineseCurrencyExtractorConfiguration extends base$6.ChineseNumberWithUnitExtractorConfiguration { + constructor(ci) { + if (!ci) { + ci = new recognizersTextNumber.CultureInfo(recognizersTextNumber.Culture.Chinese); + } + super(ci); + this.extractType = constants$4.Constants.SYS_UNIT_CURRENCY; + // Reference Source: https:// en.wikipedia.org/wiki/List_of_circulating_currencies + this.suffixList = chineseNumericWithUnit.ChineseNumericWithUnit.CurrencySuffixList; + this.prefixList = chineseNumericWithUnit.ChineseNumericWithUnit.CurrencyPrefixList; + this.ambiguousUnitList = chineseNumericWithUnit.ChineseNumericWithUnit.CurrencyAmbiguousValues; + + } +} +exports.ChineseCurrencyExtractorConfiguration = ChineseCurrencyExtractorConfiguration; +class ChineseCurrencyParserConfiguration extends base$6.ChineseNumberWithUnitParserConfiguration { + constructor(ci) { + if (!ci) { + ci = new recognizersTextNumber.CultureInfo(recognizersTextNumber.Culture.Chinese); + } + super(ci); + this.BindDictionary(chineseNumericWithUnit.ChineseNumericWithUnit.CurrencySuffixList); + this.BindDictionary(chineseNumericWithUnit.ChineseNumericWithUnit.CurrencyPrefixList); + } +} +exports.ChineseCurrencyParserConfiguration = ChineseCurrencyParserConfiguration; + +}); + +unwrapExports(currency$6); + +var temperature$6 = createCommonjsModule(function (module, exports) { +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); + + + + +class ChineseTemperatureExtractorConfiguration extends base$6.ChineseNumberWithUnitExtractorConfiguration { + constructor(ci) { + if (!ci) { + ci = new recognizersTextNumber.CultureInfo(recognizersTextNumber.Culture.Chinese); + } + super(ci); + this.extractType = constants$4.Constants.SYS_UNIT_TEMPERATURE; + this.suffixList = chineseNumericWithUnit.ChineseNumericWithUnit.TemperatureSuffixList; + this.prefixList = chineseNumericWithUnit.ChineseNumericWithUnit.TemperaturePrefixList; + this.ambiguousUnitList = chineseNumericWithUnit.ChineseNumericWithUnit.TemperatureAmbiguousValues; + } +} +exports.ChineseTemperatureExtractorConfiguration = ChineseTemperatureExtractorConfiguration; +class ChineseTemperatureParserConfiguration extends base$6.ChineseNumberWithUnitParserConfiguration { + constructor(ci) { + if (!ci) { + ci = new recognizersTextNumber.CultureInfo(recognizersTextNumber.Culture.Chinese); + } + super(ci); + this.BindDictionary(chineseNumericWithUnit.ChineseNumericWithUnit.TemperaturePrefixList); + this.BindDictionary(chineseNumericWithUnit.ChineseNumericWithUnit.TemperatureSuffixList); + } +} +exports.ChineseTemperatureParserConfiguration = ChineseTemperatureParserConfiguration; + +}); + +unwrapExports(temperature$6); + +var dimension$6 = createCommonjsModule(function (module, exports) { +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); + + + + +class ChineseDimensionExtractorConfiguration extends base$6.ChineseNumberWithUnitExtractorConfiguration { + constructor(ci) { + if (!ci) { + ci = new recognizersTextNumber.CultureInfo(recognizersTextNumber.Culture.Chinese); + } + super(ci); + this.extractType = constants$4.Constants.SYS_UNIT_DIMENSION; + this.suffixList = chineseNumericWithUnit.ChineseNumericWithUnit.DimensionSuffixList; + this.prefixList = new Map(); + this.ambiguousUnitList = chineseNumericWithUnit.ChineseNumericWithUnit.DimensionAmbiguousValues; + } +} +exports.ChineseDimensionExtractorConfiguration = ChineseDimensionExtractorConfiguration; +class ChineseDimensionParserConfiguration extends base$6.ChineseNumberWithUnitParserConfiguration { + constructor(ci) { + if (!ci) { + ci = new recognizersTextNumber.CultureInfo(recognizersTextNumber.Culture.Chinese); + } + super(ci); + this.BindDictionary(chineseNumericWithUnit.ChineseNumericWithUnit.DimensionSuffixList); + } +} +exports.ChineseDimensionParserConfiguration = ChineseDimensionParserConfiguration; + +}); + +unwrapExports(dimension$6); + +var age$6 = createCommonjsModule(function (module, exports) { +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); + + + + +class ChineseAgeExtractorConfiguration extends base$6.ChineseNumberWithUnitExtractorConfiguration { + constructor(ci) { + if (!ci) { + ci = new recognizersTextNumber.CultureInfo(recognizersTextNumber.Culture.Chinese); + } + super(ci); + this.extractType = constants$4.Constants.SYS_UNIT_AGE; + this.suffixList = chineseNumericWithUnit.ChineseNumericWithUnit.AgeSuffixList; + this.prefixList = new Map(); + this.ambiguousUnitList = chineseNumericWithUnit.ChineseNumericWithUnit.AgeAmbiguousValues; + } +} +exports.ChineseAgeExtractorConfiguration = ChineseAgeExtractorConfiguration; +class ChineseAgeParserConfiguration extends base$6.ChineseNumberWithUnitParserConfiguration { + constructor(ci) { + if (!ci) { + ci = new recognizersTextNumber.CultureInfo(recognizersTextNumber.Culture.Chinese); + } + super(ci); + this.BindDictionary(chineseNumericWithUnit.ChineseNumericWithUnit.AgeSuffixList); + } +} +exports.ChineseAgeParserConfiguration = ChineseAgeParserConfiguration; + +}); + +unwrapExports(age$6); + +var japaneseNumericWithUnit = createCommonjsModule(function (module, exports) { +"use strict"; +// ------------------------------------------------------------------------------ +// +// This code was generated by a tool. +// Changes to this file may cause incorrect behavior and will be lost if +// the code is regenerated. +// +// ------------------------------------------------------------------------------ +Object.defineProperty(exports, "__esModule", { value: true }); +var JapaneseNumericWithUnit; +(function (JapaneseNumericWithUnit) { + JapaneseNumericWithUnit.AgeAmbiguousValues = ['歳']; + JapaneseNumericWithUnit.AgeSuffixList = new Map([["Year", "歳"], ["Month", "ヶ月"], ["Week", "週間|週"], ["Day", "日間|日齢|日大"]]); + JapaneseNumericWithUnit.BuildPrefix = ''; + JapaneseNumericWithUnit.BuildSuffix = ''; + JapaneseNumericWithUnit.ConnectorToken = ''; + JapaneseNumericWithUnit.CurrencySuffixList = new Map([["Afghan afghani", "アフガニ"], ["Pul", "プル"], ["Euro", "ユーロ"], ["Cent", "セント"], ["Albanian lek", "アルバニアレク|アルバニア・レク|レク"], ["Angolan kwanza", "アンゴラクワンザ|アンゴラ・クワンザ|クワンザ"], ["Armenian dram", "アルメニアドラム|アルメニア・ドラム|ドラム"], ["Aruban florin", "アルバ・フロリン|フロリン"], ["Bangladeshi taka", "タカ|バングラデシュ・タカ"], ["Paisa", "パイサ"], ["Bhutanese ngultrum", "ニュルタム|ブータン・ニュルタム|ブータンニュルタム"], ["Chetrum", "チェルタム"], ["Bolivian boliviano", "ボリビアーノ"], ["Bosnia and Herzegovina convertible mark", "兌換マルク"], ["Botswana pula", "ボツワナ・プラ|ボツワナプラ|プラ"], ["Thebe", "テベ"], ["Brazilian real", "ブラジル・レアル|ブラジルレアル|レアル"], ["Bulgarian lev", "ブルガリア・レフ|ブルガリアレフ|レフ"], ["Stotinka", "ストティンカ"], ["Cambodian riel", "カンボジア・リエル|カンボジアリエル|リエル"], ["Cape Verdean escudo", "カーボベルデ・エスクード"], ["Croatian kuna", "クロアチアクーナ|クロアチア・クーナ|クーナ"], ["Lipa", "リパ"], ["Eritrean nakfa", "エリトリア・ナクファ|エリトリアナクファ|ナクファ"], ["Ethiopian birr", "エチオピア・ブル|エチオピアブル|ブル"], ["Gambian dalasi", "ガンビア・ダラシ|ガンビアダラシ|ダラシ"], ["Butut", "ブトゥツ"], ["Georgian lari", "ジョージア・ラリ|ジョージアラリ|ラリ"], ["Tetri", "テトリ"], ["Ghanaian cedi", "ガーナ・セディ|ガーナセディ|セディ"], ["Pesewa", "ペセワ"], ["Guatemalan quetzal", "グアテマラ・ケツァル|グアテマラケツァル|ケツァル"], ["Haitian gourde", "ハイチ・グールド|ハイチグールド|グールド"], ["Honduran lempira", "ホンジュラス・レンピラ|ホンジュラスレンピラ|レンピラ"], ["Hungarian forint", "ハンガリー・フォリント|ハンガリーフォリント|フォリント"], ["Iranian rial", "イラン・リアル"], ["Yemeni rial", "イエメン・リアル"], ["Israeli new shekel", "₪|ils|イスラエル・新シェケル|イスラエル新シェケル"], ["Japanese yen", "円"], ["Sen", "銭"], ["Kazakhstani tenge", "テンゲ|カザフスタン・テンゲ|カザフスタンテンゲ"], ["Kenyan shilling", "ケニア・シリング"], ["North Korean won", "北朝鮮ウォン"], ["South Korean won", "韓国ウォン"], ["Korean won", "₩"], ["Kyrgyzstani som", "キルギス・ソム|ソム"], ["Lao kip", "キップ|ラオス・キップ|ラオスキップ"], ["Att", "att"], ["Lesotho loti", "ロチ|レソト・ロチ|レソトロチ"], ["South African rand", "ランド|南アフリカ・ランド|南アフリカランド"], ["Macedonian denar", "マケドニア・デナール"], ["Deni", "デニ"], ["Malagasy ariary", "アリアリ|マダガスカル・アリアリ|マダガスカルアリアリ"], ["Iraimbilanja", "イライムビランジャ"], ["Malawian kwacha", "マラウイ・クワチャ"], ["Tambala", "タンバラ"], ["Malaysian ringgit", "リンギット|マレーシア・リンギット"], ["Mauritanian ouguiya", "ウギア|モーリタニア・ウギア|モーリタニアウギア"], ["Khoums", "コウム"], ["Mozambican metical", "メティカル|モザンビーク・メティカル|モザンビークメティカル"], ["Burmese kyat", "チャット|ミャンマー・チャット|ミャンマーチャット"], ["Pya", "ピャー"], ["Nigerian naira", "ナイラ|ナイジェリア・ナイラ|ナイジェリアナイラ"], ["Kobo", "コボ"], ["Turkish lira", "トルコリラ"], ["Kuruş", "クルシュ"], ["Omani rial", "オマーン・リアル"], ["Panamanian balboa", "バルボア|パナマ・バルボア|パナマバルボア"], ["Centesimo", "センテシモ"], ["Papua New Guinean kina", "キナ|パプア・ニューギニア・キナ"], ["Toea", "トエア"], ["Peruvian sol", "ヌエボ・ソル"], ["Polish złoty", "ズウォティ|ポーランド・ズウォティ|ポーランドズウォティ"], ["Grosz", "グロシュ"], ["Qatari riyal", "カタール・リヤル"], ["Saudi riyal", "サウジアラビア・リヤル"], ["Riyal", "リヤル"], ["Dirham", "ディルハム"], ["Halala", "ハララ"], ["Samoan tālā", "タラ|サモア・タラ|サモアタラ"], ["Sierra Leonean leone", "レオン|シエラレオネ・レオン|シエラレオネレオン"], ["Peseta", "ユーロ"], ["Swazi lilangeni", "リランゲニ|スワジランド・リランゲニ|スワジランドリランゲニ"], ["Tajikistani somoni", "ソモニ|タジキスタン・ソモニ|タジキスタンソモニ"], ["Thai baht", "バーツ|タイ・バーツ|タイバーツ"], ["Satang", "サタン"], ["Tongan paʻanga", "パアンガ|トンガ・パアンガ|トンガパアンガ"], ["Ukrainian hryvnia", "フリヴニャ|ウクライナ・フリヴニャ|ウクライナフリヴニャ"], ["Vanuatu vatu", "バツ|バヌアツ・バツ|バヌアツバツ"], ["Vietnamese dong", "ドン|ベトナム・ドン|ベトナムドン"], ["Indonesian rupiah", "ルピア|インドネシア・ルピア|インドネシアルピア"], ["Netherlands guilder", "ユーロ|オランダ・ユーロ"], ["Surinam florin", "スリナム・ドル"], ["Zambian kwacha", "ザンビア・クワチャ"], ["Moroccan dirham", "モロッコ・ディルハム"], ["United Arab Emirates dirham", "UAEディルハム"], ["Azerbaijani manat", "アゼルバイジャン・マナト"], ["Turkmenistan manat", "トルクメニスタン・マナト"], ["Manat", "マナト"], ["Somali shilling", "ソマリア・シリング"], ["Somaliland shilling", "ソマリランド・シリング"], ["Tanzanian shilling", "タンザニア・シリング"], ["Ugandan shilling", "ウガンダ・シリング"], ["Romanian leu", "ルーマニア・レウ"], ["Moldovan leu", "モルドバ・レウ"], ["Leu", "レウ"], ["Ban", "バン"], ["Nepalese rupee", "ネパール・ルピー"], ["Pakistani rupee", "パキスタン・ルピー"], ["Indian rupee", "インド・ルピー"], ["Seychellois rupee", "セーシェル・ルピー"], ["Mauritian rupee", "モーリシャス・ルピー"], ["Maldivian rufiyaa", "ルフィヤ|モルディブ・ルフィヤ|モルディブルフィヤ"], ["Sri Lankan rupee", "スリランカ・ルピー"], ["Rupee", "ルピー"], ["Czech koruna", "チェコ・コルナ"], ["Danish krone", "デンマーク・クローネ"], ["Norwegian krone", "ノルウェー・クローネ"], ["Faroese króna", "フェロー・クローネ"], ["Icelandic króna", "アイスランド・クローナ"], ["Swedish krona", "スウェーデン・クローナ"], ["Krone", "クローナ"], ["Øre", "オーレ"], ["West African CFA franc", "CFAフラン"], ["Central African CFA franc", "CFAフラン"], ["Comorian franc", "コモロ・フラン"], ["Congolese franc", "コンゴ・フラン"], ["Burundian franc", "ブルンジ・フラン"], ["Djiboutian franc", "ジブチ・フラン"], ["CFP franc", "CFPフラン"], ["Guinean franc", "ギニア・フラン"], ["Swiss franc", "スイス・フラン"], ["Rwandan franc", "ルワンダ・フラン"], ["Belgian franc", "ベルギー・フラン"], ["Rappen", "Rappen"], ["Franc", "フラン"], ["Centime", "サンチーム"], ["Russian ruble", "ロシア・ルーブル"], ["Transnistrian ruble", "沿ドニエストル・ルーブル"], ["Belarusian ruble", "ベラルーシ・ルーブル"], ["Kopek", "カペイカ"], ["Ruble", "ルーブル"], ["Algerian dinar", "アルジェリア・ディナール"], ["Bahraini dinar", "バーレーン・ディナール"], ["Iraqi dinar", "イラク・ディナール"], ["Jordanian dinar", "ヨルダン・ディナール"], ["Kuwaiti dinar", "クウェート・ディナール"], ["Libyan dinar", "リビア・ディナール"], ["Serbian dinar", "セルビア・ディナール"], ["Tunisian dinar", "チュニジア・ディナール"], ["Dinar", "ディナール"], ["Fils", "フィルス"], ["Para", "パラ"], ["Millime", "ミリム"], ["Argentine peso", "ペソ|アルゼンチン・ペソ"], ["Chilean peso", "チリ・ペソ"], ["Colombian peso", "コロンビア・ペソ"], ["Cuban peso", "兌換ペソ"], ["Dominican peso", "ドミニカ・ペソ"], ["Mexican peso", "メキシコ・ペソ"], ["Philippine peso", "フィリピン・ペソ"], ["Uruguayan peso", "ウルグアイ・ペソ"], ["Peso", "ペソ"], ["Centavo", "センターボ"], ["Alderney pound", "ガーンジー・ポンド"], ["British pound", "UKポンド"], ["Guernsey pound", "ガーンジー・ポンド"], ["Saint Helena pound", "セントヘレナ・ポンド"], ["Egyptian pound", "エジプト・ポンド"], ["Falkland Islands pound", "フォークランド諸島ポンド"], ["Gibraltar pound", "ジブラルタル・ポンド"], ["Manx pound", "マン島ポンド"], ["Jersey pound", "ジャージー・ポンド"], ["Lebanese pound", "レバノン・ポンド"], ["South Sudanese pound", "南スーダン・ポンド"], ["Sudanese pound", "スーダン・ポンド"], ["Syrian pound", "シリア・ポンド"], ["Pound", "ポンド"], ["Pence", "ペニー"], ["Shilling", "シリング"], ["United States dollar", "ドル|USドル"], ["East Caribbean dollar", "東カリブ・ドル"], ["Australian dollar", "オーストラリア・ドル"], ["Bahamian dollar", "バハマ・ドル"], ["Barbadian dollar", "バルバドス・ドル"], ["Belize dollar", "ベリーズ・ドル"], ["Bermudian dollar", "バミューダ・ドル"], ["Brunei dollar", "ブルネイ・ドル"], ["Singapore dollar", "シンガポール・ドル"], ["Canadian dollar", "カナダ・ドル"], ["Cayman Islands dollar", "ケイマン諸島・ドル"], ["New Zealand dollar", "ニュージーランド・ドル"], ["Cook Islands dollar", "ニュージーランド・ドル|ニュージーランド・ドル"], ["Fijian dollar", "フィジー・ドル|フィジー・ドル"], ["Guyanese dollar", "ガイアナ・ドル|ガイアナ・ドル"], ["Hong Kong dollar", "香港ドル"], ["Macau Pataca", "マカオ・パタカ|マカオ・パタカ"], ["New Taiwan dollar", "ニュー台湾ドル|ニュー台湾ドル"], ["Jamaican dollar", "ジャマイカ・ドル|ジャマイカドル"], ["Kiribati dollar", "オーストラリア・ドル|オーストラリアドル"], ["Liberian dollar", "リベリア・ドル|リベリアドル"], ["Namibian dollar", "ナミビア・ドル|ナミビアドル"], ["Surinamese dollar", "スリナム・ドル|スリナムドル"], ["Trinidad and Tobago dollar", "トリニダード・トバゴ・ドル|トリニダードトバゴ・ドル"], ["Tuvaluan dollar", "ツバル・ドル|ツバルドル"], ["Chinese yuan", "人民元"], ["Fen", "分"], ["Jiao", "角"], ["Finnish markka", "フィンランド・マルカ"], ["Penni", "ペニー"]]); + JapaneseNumericWithUnit.CurrencyNameToIsoCodeMap = new Map([["Afghan afghani", "AFN"], ["Euro", "EUR"], ["Albanian lek", "ALL"], ["Angolan kwanza", "AOA"], ["Armenian dram", "AMD"], ["Aruban florin", "AWG"], ["Bangladeshi taka", "BDT"], ["Bhutanese ngultrum", "BTN"], ["Bolivian boliviano", "BOB"], ["Bosnia and Herzegovina convertible mark", "BAM"], ["Botswana pula", "BWP"], ["Brazilian real", "BRL"], ["Bulgarian lev", "BGN"], ["Cambodian riel", "KHR"], ["Cape Verdean escudo", "CVE"], ["Costa Rican colón", "CRC"], ["Croatian kuna", "HRK"], ["Czech koruna", "CZK"], ["Eritrean nakfa", "ERN"], ["Ethiopian birr", "ETB"], ["Gambian dalasi", "GMD"], ["Georgian lari", "GEL"], ["Ghanaian cedi", "GHS"], ["Guatemalan quetzal", "GTQ"], ["Haitian gourde", "HTG"], ["Honduran lempira", "HNL"], ["Hungarian forint", "HUF"], ["Iranian rial", "IRR"], ["Yemeni rial", "YER"], ["Israeli new shekel", "ILS"], ["Japanese yen", "JPY"], ["Kazakhstani tenge", "KZT"], ["Kenyan shilling", "KES"], ["North Korean won", "KPW"], ["South Korean won", "KRW"], ["Kyrgyzstani som", "KGS"], ["Lao kip", "LAK"], ["Lesotho loti", "LSL"], ["South African rand", "ZAR"], ["Macanese pataca", "MOP"], ["Macedonian denar", "MKD"], ["Malagasy ariary", "MGA"], ["Malawian kwacha", "MWK"], ["Malaysian ringgit", "MYR"], ["Mauritanian ouguiya", "MRO"], ["Mongolian tögrög", "MNT"], ["Mozambican metical", "MZN"], ["Burmese kyat", "MMK"], ["Nicaraguan córdoba", "NIO"], ["Nigerian naira", "NGN"], ["Turkish lira", "TRY"], ["Omani rial", "OMR"], ["Panamanian balboa", "PAB"], ["Papua New Guinean kina", "PGK"], ["Paraguayan guaraní", "PYG"], ["Peruvian sol", "PEN"], ["Polish złoty", "PLN"], ["Qatari riyal", "QAR"], ["Saudi riyal", "SAR"], ["Samoan tālā", "WST"], ["São Tomé and Príncipe dobra", "STD"], ["Sierra Leonean leone", "SLL"], ["Swazi lilangeni", "SZL"], ["Tajikistani somoni", "TJS"], ["Thai baht", "THB"], ["Ukrainian hryvnia", "UAH"], ["Vanuatu vatu", "VUV"], ["Venezuelan bolívar", "VEF"], ["Zambian kwacha", "ZMW"], ["Moroccan dirham", "MAD"], ["United Arab Emirates dirham", "AED"], ["Azerbaijani manat", "AZN"], ["Turkmenistan manat", "TMT"], ["Somali shilling", "SOS"], ["Tanzanian shilling", "TZS"], ["Ugandan shilling", "UGX"], ["Romanian leu", "RON"], ["Moldovan leu", "MDL"], ["Nepalese rupee", "NPR"], ["Pakistani rupee", "PKR"], ["Indian rupee", "INR"], ["Seychellois rupee", "SCR"], ["Mauritian rupee", "MUR"], ["Maldivian rufiyaa", "MVR"], ["Sri Lankan rupee", "LKR"], ["Indonesian rupiah", "IDR"], ["Danish krone", "DKK"], ["Norwegian krone", "NOK"], ["Icelandic króna", "ISK"], ["Swedish krona", "SEK"], ["West African CFA franc", "XOF"], ["Central African CFA franc", "XAF"], ["Comorian franc", "KMF"], ["Congolese franc", "CDF"], ["Burundian franc", "BIF"], ["Djiboutian franc", "DJF"], ["CFP franc", "XPF"], ["Guinean franc", "GNF"], ["Swiss franc", "CHF"], ["Rwandan franc", "RWF"], ["Russian ruble", "RUB"], ["Transnistrian ruble", "PRB"], ["Belarusian ruble", "BYN"], ["Algerian dinar", "DZD"], ["Bahraini dinar", "BHD"], ["Iraqi dinar", "IQD"], ["Jordanian dinar", "JOD"], ["Kuwaiti dinar", "KWD"], ["Libyan dinar", "LYD"], ["Serbian dinar", "RSD"], ["Tunisian dinar", "TND"], ["Argentine peso", "ARS"], ["Chilean peso", "CLP"], ["Colombian peso", "COP"], ["Cuban convertible peso", "CUC"], ["Cuban peso", "CUP"], ["Dominican peso", "DOP"], ["Mexican peso", "MXN"], ["Uruguayan peso", "UYU"], ["British pound", "GBP"], ["Saint Helena pound", "SHP"], ["Egyptian pound", "EGP"], ["Falkland Islands pound", "FKP"], ["Gibraltar pound", "GIP"], ["Manx pound", "IMP"], ["Jersey pound", "JEP"], ["Lebanese pound", "LBP"], ["South Sudanese pound", "SSP"], ["Sudanese pound", "SDG"], ["Syrian pound", "SYP"], ["United States dollar", "USD"], ["Australian dollar", "AUD"], ["Bahamian dollar", "BSD"], ["Barbadian dollar", "BBD"], ["Belize dollar", "BZD"], ["Bermudian dollar", "BMD"], ["Brunei dollar", "BND"], ["Singapore dollar", "SGD"], ["Canadian dollar", "CAD"], ["Cayman Islands dollar", "KYD"], ["New Zealand dollar", "NZD"], ["Fijian dollar", "FJD"], ["Guyanese dollar", "GYD"], ["Hong Kong dollar", "HKD"], ["Jamaican dollar", "JMD"], ["Liberian dollar", "LRD"], ["Namibian dollar", "NAD"], ["Solomon Islands dollar", "SBD"], ["Surinamese dollar", "SRD"], ["New Taiwan dollar", "TWD"], ["Trinidad and Tobago dollar", "TTD"], ["Tuvaluan dollar", "TVD"], ["Chinese yuan", "CNY"], ["Rial", "__RI"], ["Shiling", "__S"], ["Som", "__SO"], ["Dirham", "__DR"], ["Dinar", "_DN"], ["Dollar", "__D"], ["Manat", "__MA"], ["Rupee", "__R"], ["Krone", "__K"], ["Krona", "__K"], ["Crown", "__K"], ["Frank", "__F"], ["Mark", "__M"], ["Ruble", "__RB"], ["Peso", "__PE"], ["Pound", "__P"], ["Tristan da Cunha pound", "_TP"], ["South Georgia and the South Sandwich Islands pound", "_SP"], ["Somaliland shilling", "_SS"], ["Pitcairn Islands dollar", "_PND"], ["Palauan dollar", "_PD"], ["Niue dollar", "_NID"], ["Nauruan dollar", "_ND"], ["Micronesian dollar", "_MD"], ["Kiribati dollar", "_KID"], ["Guernsey pound", "_GGP"], ["Faroese króna", "_FOK"], ["Cook Islands dollar", "_CKD"], ["British Virgin Islands dollar", "_BD"], ["Ascension pound", "_AP"], ["Alderney pound", "_ALP"], ["Abkhazian apsar", "_AA"]]); + JapaneseNumericWithUnit.FractionalUnitNameToCodeMap = new Map([["Jiao", "JIAO"], ["Kopek", "KOPEK"], ["Pul", "PUL"], ["Cent", "CENT"], ["Qindarkë", "QINDARKE"], ["Penny", "PENNY"], ["Santeem", "SANTEEM"], ["Cêntimo", "CENTIMO"], ["Centavo", "CENTAVO"], ["Luma", "LUMA"], ["Qəpik", "QƏPIK"], ["Fils", "FILS"], ["Poisha", "POISHA"], ["Kapyeyka", "KAPYEYKA"], ["Centime", "CENTIME"], ["Chetrum", "CHETRUM"], ["Paisa", "PAISA"], ["Fening", "FENING"], ["Thebe", "THEBE"], ["Sen", "SEN"], ["Stotinka", "STOTINKA"], ["Fen", "FEN"], ["Céntimo", "CENTIMO"], ["Lipa", "LIPA"], ["Haléř", "HALER"], ["Øre", "ØRE"], ["Piastre", "PIASTRE"], ["Santim", "SANTIM"], ["Oyra", "OYRA"], ["Butut", "BUTUT"], ["Tetri", "TETRI"], ["Pesewa", "PESEWA"], ["Fillér", "FILLER"], ["Eyrir", "EYRIR"], ["Dinar", "DINAR"], ["Agora", "AGORA"], ["Tïın", "TIIN"], ["Chon", "CHON"], ["Jeon", "JEON"], ["Tyiyn", "TYIYN"], ["Att", "ATT"], ["Sente", "SENTE"], ["Dirham", "DIRHAM"], ["Rappen", "RAPPEN"], ["Avo", "AVO"], ["Deni", "DENI"], ["Iraimbilanja", "IRAIMBILANJA"], ["Tambala", "TAMBALA"], ["Laari", "LAARI"], ["Khoums", "KHOUMS"], ["Ban", "BAN"], ["Möngö", "MONGO"], ["Pya", "PYA"], ["Kobo", "KOBO"], ["Kuruş", "KURUS"], ["Baisa", "BAISA"], ["Centésimo", "CENTESIMO"], ["Toea", "TOEA"], ["Sentimo", "SENTIMO"], ["Grosz", "GROSZ"], ["Sene", "SENE"], ["Halala", "HALALA"], ["Para", "PARA"], ["Öre", "ORE"], ["Diram", "DIRAM"], ["Satang", "SATANG"], ["Seniti", "SENITI"], ["Millime", "MILLIME"], ["Tennesi", "TENNESI"], ["Kopiyka", "KOPIYKA"], ["Tiyin", "TIYIN"], ["Hào", "HAO"], ["Ngwee", "NGWEE"]]); + JapaneseNumericWithUnit.CompoundUnitConnectorRegex = `(?と)`; + JapaneseNumericWithUnit.CurrencyPrefixList = new Map([["Dollar", "$"], ["United States dollar", "us$"], ["British Virgin Islands dollar", "bvi$"], ["Brunei dollar", "b$"], ["Sen", "sen"], ["Singapore dollar", "s$"], ["Canadian dollar", "can$|c$|c $"], ["Cayman Islands dollar", "ci$"], ["New Zealand dollar", "nz$|nz $"], ["Guyanese dollar", "gy$|gy $|g$|g $"], ["Hong Kong dollar", "hk$|hkd|hk $"], ["Jamaican dollar", "j$"], ["Namibian dollar", "nad|n$|n $"], ["Solomon Islands dollar", "si$|si $"], ["New Taiwan dollar", "nt$|nt $"], ["Samoan tālā", "ws$"], ["Chinese yuan", "¥"], ["Japanese yen", "¥|\\"], ["Turkish lira", "₺"], ["Euro", "€"], ["Pound", "£"], ["Costa Rican colón", "₡"]]); + JapaneseNumericWithUnit.CurrencyAmbiguousValues = ['円', '銭', '\\']; +})(JapaneseNumericWithUnit = exports.JapaneseNumericWithUnit || (exports.JapaneseNumericWithUnit = {})); + +}); + +unwrapExports(japaneseNumericWithUnit); + +var base$8 = createCommonjsModule(function (module, exports) { +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); + + + + + +class JapaneseNumberWithUnitExtractorConfiguration { + constructor(ci) { + this.cultureInfo = ci; + this.unitNumExtractor = new recognizersTextNumber.JapaneseNumberExtractor(recognizersTextNumber.JapaneseNumberExtractorMode.ExtractAll); + this.buildPrefix = japaneseNumericWithUnit.JapaneseNumericWithUnit.BuildPrefix; + this.buildSuffix = japaneseNumericWithUnit.JapaneseNumericWithUnit.BuildSuffix; + this.connectorToken = japaneseNumericWithUnit.JapaneseNumericWithUnit.ConnectorToken; + this.compoundUnitConnectorRegex = recognizersText.RegExpUtility.getSafeRegExp(japaneseNumericWithUnit.JapaneseNumericWithUnit.CompoundUnitConnectorRegex); + this.pmNonUnitRegex = recognizersText.RegExpUtility.getSafeRegExp(baseUnits.BaseUnits.PmNonUnitRegex); + } +} +exports.JapaneseNumberWithUnitExtractorConfiguration = JapaneseNumberWithUnitExtractorConfiguration; +class JapaneseNumberWithUnitParserConfiguration extends parsers$8.BaseNumberWithUnitParserConfiguration { + constructor(ci) { + super(ci); + this.internalNumberExtractor = new recognizersTextNumber.JapaneseNumberExtractor(recognizersTextNumber.JapaneseNumberExtractorMode.Default); + this.internalNumberParser = recognizersTextNumber.AgnosticNumberParserFactory.getParser(recognizersTextNumber.AgnosticNumberParserType.Number, new recognizersTextNumber.JapaneseNumberParserConfiguration()); + this.connectorToken = ''; + this.currencyNameToIsoCodeMap = japaneseNumericWithUnit.JapaneseNumericWithUnit.CurrencyNameToIsoCodeMap; + this.currencyFractionCodeList = japaneseNumericWithUnit.JapaneseNumericWithUnit.FractionalUnitNameToCodeMap; + } +} +exports.JapaneseNumberWithUnitParserConfiguration = JapaneseNumberWithUnitParserConfiguration; + +}); + +unwrapExports(base$8); + +var currency$8 = createCommonjsModule(function (module, exports) { +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); + + + + +class JapaneseCurrencyExtractorConfiguration extends base$8.JapaneseNumberWithUnitExtractorConfiguration { + constructor(ci) { + if (!ci) { + ci = new recognizersTextNumber.CultureInfo(recognizersTextNumber.Culture.Japanese); + } + super(ci); + this.extractType = constants$4.Constants.SYS_UNIT_CURRENCY; + // Reference Source: https:// en.wikipedia.org/wiki/List_of_circulating_currencies + this.suffixList = japaneseNumericWithUnit.JapaneseNumericWithUnit.CurrencySuffixList; + this.prefixList = japaneseNumericWithUnit.JapaneseNumericWithUnit.CurrencyPrefixList; + this.ambiguousUnitList = japaneseNumericWithUnit.JapaneseNumericWithUnit.CurrencyAmbiguousValues; + + } +} +exports.JapaneseCurrencyExtractorConfiguration = JapaneseCurrencyExtractorConfiguration; +class JapaneseCurrencyParserConfiguration extends base$8.JapaneseNumberWithUnitParserConfiguration { + constructor(ci) { + if (!ci) { + ci = new recognizersTextNumber.CultureInfo(recognizersTextNumber.Culture.Japanese); + } + super(ci); + this.BindDictionary(japaneseNumericWithUnit.JapaneseNumericWithUnit.CurrencySuffixList); + this.BindDictionary(japaneseNumericWithUnit.JapaneseNumericWithUnit.CurrencyPrefixList); + } +} +exports.JapaneseCurrencyParserConfiguration = JapaneseCurrencyParserConfiguration; + +}); + +unwrapExports(currency$8); + +var age$8 = createCommonjsModule(function (module, exports) { +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); + + + + +class JapaneseAgeExtractorConfiguration extends base$8.JapaneseNumberWithUnitExtractorConfiguration { + constructor(ci) { + if (!ci) { + ci = new recognizersTextNumber.CultureInfo(recognizersTextNumber.Culture.Japanese); + } + super(ci); + this.extractType = constants$4.Constants.SYS_UNIT_AGE; + this.suffixList = japaneseNumericWithUnit.JapaneseNumericWithUnit.AgeSuffixList; + this.prefixList = new Map(); + this.ambiguousUnitList = japaneseNumericWithUnit.JapaneseNumericWithUnit.AgeAmbiguousValues; + } +} +exports.JapaneseAgeExtractorConfiguration = JapaneseAgeExtractorConfiguration; +class JapaneseAgeParserConfiguration extends base$8.JapaneseNumberWithUnitParserConfiguration { + constructor(ci) { + if (!ci) { + ci = new recognizersTextNumber.CultureInfo(recognizersTextNumber.Culture.Japanese); + } + super(ci); + this.BindDictionary(japaneseNumericWithUnit.JapaneseNumericWithUnit.AgeSuffixList); + } +} +exports.JapaneseAgeParserConfiguration = JapaneseAgeParserConfiguration; + +}); + +unwrapExports(age$8); + +var frenchNumericWithUnit = createCommonjsModule(function (module, exports) { +"use strict"; +// ------------------------------------------------------------------------------ +// +// This code was generated by a tool. +// Changes to this file may cause incorrect behavior and will be lost if +// the code is regenerated. +// +// ------------------------------------------------------------------------------ +Object.defineProperty(exports, "__esModule", { value: true }); +var FrenchNumericWithUnit; +(function (FrenchNumericWithUnit) { + FrenchNumericWithUnit.AgeSuffixList = new Map([["Ans", "ans"], ["Mois", "mois d'âge|mois d'age|mois"], ["Semaines", "semaine|semaines|semaines d'âge|semaines d'age"], ["Jour", "jours|jour"]]); + FrenchNumericWithUnit.AreaSuffixList = new Map([["Kilomètre carré", "km2|km^2|km²|kilomètres carrés|kilomètre carré"], ["Hectomètre carré", "hm2|hm^2|hm²|hectomètre carré|hectomètres carrés"], ["Décamètre carré", "dam2|dam^2|dam²|décamètre carré|décamètres carrés"], ["Mètre carré", "m2|m^2|m²|mètre carré|mètres carrés"], ["Décimètre carré", "dm2|dm^2|dm²|décimètre carré|décimètres carrés"], ["Centimètre carré", "cm2|cm^2|cm²|centimètre carré|centimètres carrés"], ["Millimètre carré", "mm2|mm^2|mm²|millimètre carré|millimètres carrés"], ["Pouce carré", "pouces2|po2|pouce carré|pouces carrés|in^2|in²|in2"], ["Pied carré", "pied carré|pieds carrés|pi2|pi^2|pi²"], ["Mile carré", "mile carré|miles carrés|mi2|mi^2|mi²"], ["Acre", "acre|acres"]]); + FrenchNumericWithUnit.CurrencySuffixList = new Map([["Abkhazie apsar", "abkhazie apsar|apsars"], ["Afghan afghani", "afghan afghani|؋|afn|afghanis|afghani"], ["Pul", "pul"], ["Euro", "euros|euro|€|eur|d'euros"], ["Cent", "cents|cent|-cents|-cent|sen"], ["lek Albanais", "lek albanais|leks|lek"], ["Qindarkë", "qindarkë|qindarkës|qindarke|qindarkes"], ["Kwanza angolais", "kwanza angolais|kz|aoa|kwanza|kwanzas"], ["Dram arménien", "dram arménien|drams arméniens"], ["Florins d'Aruba", "florins aruba|ƒ|awg"], ["Bangladeshi taka", "bangladeshi taka|৳|bdt|taka|takas|bangladeshi takas"], ["Paisa", "poisha|paisa"], ["Ngultrum bhoutanais", "ngultrum bhoutanais|nu.|btn"], ["Chetrum", "chetrums|chetrum"], ["Boliviano bolivien", "boliviano bolivien|bolivianos bolivien|bolivianos bolivie|boliviano bolivie|bob|bs."], ["Bosnie-Herzégovine mark convertible", "bosnie-herzégovine mark convertible|bosnie-et-herzégovine mark convertible|bam"], ["Fening", "fening|fenings"], ["Pula", "pula|bwp"], ["Thebe", "thebe"], ["Réal brésilien", "réal brésilien|réals brésilien|r$|brl|real bresil|reals bresilien"], ["Lev bulgare", "lev bulgare|levs bulgare|lv|bgn"], ["Stotinki búlgaro", "stotinki bulgare"], ["Riel cambodgien", "riel cambodgien|khr|៛"], ["Escudo du cap-vert", "escudo cap-verdien|cve"], ["Colon du costa rica", "colon du costa rica|colons du costa rica|crc|₡"], ["Colon du salvador", "colon du salvador|colons du salvador|svc"], ["Kuna croate", "kuna croate|kunas croate|kn|hrk"], ["Lipa", "lipa"], ["Couronne tchèque", "couronne tchèque|couronnes tchèque|czk|Kč"], ["Haléř", "haléř"], ["Nakfas érythréens", "nakfas érythréens|nfk|ern|nakfa érythréens"], ["Birr éthiopien", "birr éthiopien|birrs éthiopien|etb"], ["Dalasi gambienne", "gmd"], ["Butut", "bututs|butut"], ["Lari géorgien", "lari géorgie|lari géorgiens|gel|₾"], ["Tetri géorgien", "tetri géorgie|tetris géorgiens"], ["Cedi", "cedi|ghs|cedi ghanéen|gh₵"], ["Pesewa", "pesewa|pesewas"], ["Quetzal guatémaltèque", "quetzal guatémaltèque|gtq|quetzal|quetzales"], ["Gourdes haïtiennes", "gourdes haïtiennes|gourdes|htg|gourde haïtienne"], ["Lempira hondurien", "lempira hondurien|hnl"], ["Forint hongrois", "forint hongrois|huf|fg|forints hongrois"], ["Fillér", "fillér"], ["Rial iranien", "rial iranien|irr|rials iranien|rials iraniens"], ["Litas lituanien", "litas lituanien|ltl|lit lithuanien|litas lithuanie"], ["Yen Japonais", "yen japonais|yen japon|yens|jpy|yen|¥|-yen"], ["Tenge kazakh", "tenge kazakh|kzt"], ["Shilling kényan", "shilling kényan|sh|kes|shillings kényans"], ["Won coréen", "won coréen|won coréens|₩"], ["Won sud-coréen", "won sud-coréen|won sud coréen|won sud-coréens|krw"], ["Corée du nord won", "corée du nord won|corée nord won|kpw"], ["Som Kirghizie", "som kirghizie|kgs"], ["Sum Ouzbékistan", "sum ouzbékistan|sum ouzbeks|sum ouzbéks|uzs"], ["Kip laotien", "kip laotien|lak|₭n|₭"], ["Att", "att"], ["Loti", "loti|maloti|lsl"], ["Sente", "sente|lisente"], ["Rand sud-africain", "rand sud-africain|zar"], ["Pataca macanais", "pataca macanais|mop$|mop"], ["Avo", "avos|avo"], ["Dinar macédonien", "dinar macédonien|mkd|ден"], ["Deni", "deni"], ["Ariary malagache", "ariary malagache|mga"], ["Iraimbilanja", "Iraimbilanja"], ["Kwacha malawien", "kwacha malawien|mk|mwk"], ["Tambala", "Tambala"], ["Ringitt malaisien", "ringitt malaisien|rm|myr|ringitts malaisien"], ["Ouguiya mauritanienne", "ouguiya|um|mro|ouguiya mauritanien|ouguiya mauritanienne"], ["Khoums", "khoums"], ["Togrogs mongoles", "togrogs mongoles|togrogs|tugriks|tögrög|mnt|₮|tögrög mongoles|tögrög mongolie|togrogs mongolie"], ["Metical mozambique", "metical du mozambique|metical mozambique|mt|mzn|meticals mozambique"], ["Kyat birmanie", "kyat birmanie|ks|mmk"], ["Pya", "pya"], ["Cordoba nicaraguayen", "cordoba nicaraguayen|córdoba nicaraguayen|nio|córdoba oro|cordoba oro nicaraguayen"], ["Naira nigérians", "naira nigérians|naira|ngm|₦|nairas nigérians"], ["Livre turque", "livre turque|try|tl|livre turques"], ["Kuruş", "kuruş"], ["Rials omanais", "rials omanais|omr|ر.ع.|rial omanais"], ["Balboa panaméennes", "balboa panaméennes|balboa|pab"], ["Kina", "kina|pkg|pgk"], ["Toea", "toea"], ["Guaraní paraguayen", "guaraní paraguayen|₲|pyg"], ["Sol péruvien", "nuevo sol péruvien|soles|sol|sol péruvien"], ["Złoty polonais", "złoty polonais|złoty|zł|pln|zloty|zloty polonais"], ["Groxz", "groszy|grosz|grosze"], ["Riyal qatari", "riyal qatari|qar|riyals qatari"], ["Riyal saudi", "riyal saudi|sar|riyals saudi"], ["Riyal", "riyal|riyals|rial|﷼"], ["Dirham", "dirham|dirhem|dirhm"], ["Halala", "halalas|halala"], ["Tala", "tala|tālā|ws$|sat|wst"], ["Sene", "sene"], ["Dobra", "dobra|db|std"], ["Leone", "leone|sll"], ["Florins Néerlandais", "florins hollandais|florins néerlandais|florins|ang|ƒ|florin|fl |"], ["Lilangeni", "lilangeni|szl"], ["Somoni tadjikistan", "somoni tadjikistan|tjs|somoni"], ["Diram", "dirams|diram"], ["Baht thaïlandais", "baht thaïlandais|baht thailandais|baht thaï|baht thai|baht|฿|thb"], ["Satang", "satang|satangs"], ["Paʻanga", "paʻanga|pa'anga|top"], ["Hryvnia ukrainien", "hryvnia ukrainien|hyrvnia|uah|₴|hryvnias ukrainien|hryvnia ukrainienne"], ["Vanuatu vatu", "vanuatu vatu|vatu|vuv"], ["Bolívar vénézuélien", "bolívar vénézuélien|bolivar venezuelien|bs.f.|vef|bolívars vénézuélien|bolivars venezuelien"], ["Dong vietnamien", "dong vietnamien|dongs vietnamiens|dong|đồng|vnd|dông|dông vietnamiens"], ["Kwacha de Zambie", "kwacha de zambie|zk|zmw|kwachas"], ["Dirham marocain", "dirham marocain|mad|د.م."], ["Dirham des Émirats arabes unis", "dirham des Émirats arabes unis|د.إ|aed"], ["Manat azerbaïdjanais", "manat azerbaïdjanais|manat azerbaidjanais|azn"], ["Manat turkmène", "manat turkmène|tmt|manat turkmene"], ["Manat", "manats|manat"], ["Qəpik", "qəpik"], ["Shilling somalien", "shilling somalien|shillings somalien|sos"], ["Shilling tanzanien", "shilling tanzanien|shillings tanzanien|tzs|tsh|shilling tanzanienne|shillings tanzanienne"], ["Shilling ougandais", "shilling ougandais|shillings ougandais|sh|ugx"], ["Leu roumain", "leu roumain|lei|leu roumaine|ron"], ["Leu moldave", "leu meoldave|mdl"], ["Leu", "leu"], ["Ban", "bani|-ban|ban"], ["Roupie népalaise", "roupie népalaise|roupie nepalaise|npr"], ["Roupie pakistanaise", "roupie pakistanaise|pkr"], ["Roupie indienne", "roupie indienne|inr|roupie indien|inr|₹"], ["Roupie seychelloise", "roupie seychelloise|scr|sr|sre"], ["Roupie mauricienne", "roupie mauricienne|mur"], ["Rufiyaa maldives", "rufiyaa maldives|mvr|.ރ|rf"], ["Roupie srilankaise", "roupie srilankaise|lrk|රු|ரூ"], ["Rupiah Indonésie", "rupia indonésie|rupia indonesie|rupiah|rp|idr"], ["Roupie", "roupie"], ["Couronne danoise", "couronne danoise|dkk|couronnes danoise|couronne danemark|couronnes danemark"], ["Couronne norvégienne", "couronne norvégienne|couronne norvegienne|couronnes norvégienne|couronnes norvegienne|nok"], ["Couronne féroïenne", "couronne féroïenne|couronne feroienne"], ["Couronne suédoise", "couronne suédoise|couronne suéde|sek|couronnes suédoise|couronne suedoise"], ["Couronne", "couronne|couronnes"], ["Øre", "Øre|oyra|eyrir"], ["Franc CFA de l'Afrique de l'Ouest", "franc cfa de l''afrique de l''ouest|franc cfa ouest africain|franc cfa|francs cfa|fcfa|frs cfa|cfa francs|xof"], ["Franc CFA d'Afrique centrale", "franc cfa d''afrique centrale|franc cfa centrale|frs cfa centrale|xaf"], ["Franc comorien", "franc comorien|kmf"], ["Franc congolais", "franc congolais|cdf"], ["Franc burundais", "franc burundais|bif"], ["Franc djiboutienne", "franc djiboutienne|djf"], ["Franc CFP", "franc cfp|xpf"], ["Franc guinéen", "franc guinéen|gnf"], ["Franc Suisse", "franc suisse|chf|sfr.|francs suisses"], ["Franc rwandais", "franc rwandais|rwf|rw|r₣|frw"], ["Franc belge", "franc belge|bi.|b.fr.|bef"], ["Rappen", "rappen|-rappen"], ["Franc", "francs|franc|fr.|fs"], ["Centimes", "centimes|centime|santim"], ["Rouble russe", "rouble russe|rub|₽|₽ russe|roubles russe|roubles russes|₽ russes"], ["Nouveau rouble biélorusse", "nouveau rouble biélorusse|byn|nouveau roubles biélorusse|nouveau rouble bielorusse|nouveau roubles biélorusse"], ["Rouble transnistriens", "rouble transnistriens|prb"], ["Rouble biélorusses", "rouble biélorusses|roubles biélorusses|rouble bielorusses|roubles bielorusses"], ["Kopek", "kopek|kopeks"], ["Kapyeyka", "kapyeyka"], ["Rouble", "roubles|rouble|br"], ["Dinar algérien", "dinar algérien|د.ج|dzd|dinars algérien|dinar algerien|dinars algerien"], ["Dinar de bahreïn", "dinar de bahreïn|bhd|.د.ب|dinar de bahrein"], ["Santeem", "santeem|santeems"], ["Dinar iraquien", "dinar iraquien|dinars iraquien|iqd|ع.د|dinar iraquienne|dinars iraquienne"], ["Dinar jordanien", "dinar jordanien|dinars jordanien|د.ا|jod"], ["Dinar koweïtien", "dinar koweïtien|dinar koweitien|dinars koweïtien|kwd|د.ك"], ["Dinar libyen", "dinar libyen|dinars libyen|lyd"], ["Dinar serbe", "dinar serbe|dinars serbe|rsd|дин."], ["Dinar tunisien", "dinar tunisien|dinars tunisien|tnd"], ["Dinar yougoslave", "dinar yougoslave|dinars yougoslave|yun"], ["Dinar", "dinars|dinar|denar|-dinars|-dinar"], ["Fils", "fils|fulūs|-fils|-fil"], ["Para", "para|napa"], ["Millime", "millimes|millime"], ["Peso argentin", "peso argentin|ars|pesos argentin|peso argentine|pesos argentine"], ["Peso chilien", "peso chilien|pesos chilien|clp"], ["Peso colombien", "peso colombien|pesos colombien|cop|peso colombie|pesos colombien"], ["Peso cubains convertibles", "peso cubains convertibles|pesos cubains convertibles|cuc"], ["Peso cubains", "peso cubaines|pesos cubaines|peso cubaine|pesos cubaines|cup"], ["Peso dominicain", "peso dominicain|pesos dominicain|dop|peso dominicaine|pesos dominicaine"], ["Peso philippin", "peso philippin|pesos philippin|piso|₱|php"], ["Peso uruguayen", "peso uruguayen|pesos uruguayen|uyu"], ["Peso", "pesos|Peso"], ["Centavo", "centavos|Centavo"], ["Livre britannique", "livre britannique|livres britannique|gbp|£ britannique"], ["Livre guernesey", "livre guernesey|£ guernesey|ggp"], ["Livre ascension", "livre ascension|livres ascension|£ ascension"], ["Livre sainte-hélène", "livre de sainte-hélène|livre sainte-hélène|livre sainte-helene|livre de sainte hélène|shp"], ["Livre égyptienne", "livre égyptienne|livre egyptienne|egp|ج.م"], ["Livre des îles falkland", "livre des îles falkland|livre des iles falkland|fkp|£ iles falkland"], ["Livre gibraltar", "livre gibraltar|livre de gibraltar|£ gibraltar|gip"], ["Livre manx", "imp|livre manx|£ manx"], ["Livre jersey", "livre de jersey|livre jersey|jep|£ jersey"], ["Livre libanaise", "livre libanaise|£ libanaise|livres libanaise|lbp|ل.ل"], ["Livre des îles malouines", "livre des îles malouines|livre des iles malouines|£ iles malouines"], ["Livre sud-soudanaise", "livre sud-soudanaise|livre sud soudanaise|livre du soudan du sud|livres sud-soudanaises|livre sud soudan|livre soudan sud"], ["Livre soudanaise", "livre soudanaise|livres soudanaise|sdg|£ soudan|ج.س.|livre soudan|livres soudan"], ["Livre syrienne", "livre syrienne|ل.س|syp|livre syrie|livres syrie|£ syrie"], ["Livre", "livre|livres|-livre|-livres|£"], ["Pence", "pence"], ["Shilling", "shilling|shillings"], ["Penny", "penny|sou|centime"], ["Dollar Américain", "dollar américain|$ américain|$ americain|usd|$usd|$ usd|dollar americain|dollar États-Unis|dollar des États-Unis|dollar États Unis|dollar etats unis|dollar etats-unis|$ etats-unis|$ États-Unis"], ["Dollar des Caraïbes orientales", "dollar des caraïbes orientales|dollar des caraibes orientales|xcd|$ caraibes orientales|$ caraïbes orientales"], ["Dollar Australien", "dollar australien|dollars australiens|$ australien|aud|$australien|australien $|$ australie|dollar australie"], ["Dollar des bahamas", "dollar des bahamas|dollar bahamas|$ bahamas|bsd|bahama $|dollar bahama|$ bahamas"], ["Dollar bermudes", "dollar des bermudes|dollar bermude|dollar bermudes|$ bermudes|bmd"], ["Dollar belize", "dollar de Belize|dollar belizien|bzd|$ belize"], ["Dollar îles Vierges britanniques", "dollar îles vierges britanniques|dollar iles vierges britanniques|$ iles vierges britanniques"], ["Dollar brunei", "dollar de brunei|$ brunei|bnd|dollar brunei"], ["Sen", "sen"], ["Dollar singapour", "dollar de singapour|dollar singapour|$ sinapour|sgd|$s"], ["Dollar Canadien", "dollar canadien|dollars canadien|$ canadien|cad|$can|$c|$ c|dollar canada|dollar canadienne|$ canada|$cad|cad$"], ["Dollar iles caimanes", "dollars des îles caïmanes|dollar des îles caïmanes|dollars des iles caimanes|dollar iles caimanes|kyd|$ci"], ["Dollar néo-zélandais", "dollar néo-zélandais|dollar néo zélandais|dollar neo-zelandais|dollar neo zelandais|$nz|$ néo-zélandais|$ neo zelandais"], ["Dollar îles cook", "dollar îles cook|dollar iles cook|$ iles cook"], ["Dollar des fidji", "dollar des fidji|$ fidji|dollar fidji|dollar de fidji|dollars des fidji|dollars de fidji"], ["Dollar guyanien", "dollar guyanien|dollar du guyana|dollar dre guyana|$ guayana|gyd|$gy"], ["Dollar de Hong Kong", "dollar hong kong|dollar hongkong|dollar de hong kong|dollar de hongkong|$hk|$ hk|hkd|hk $|hk$|dollar hk|$hongkong|dollars hongkong|dollars hong kong"], ["Dollar jamaïcain", "dollar jamaïcain|dollars jamaïcain|dollar jamaicain|dollars jamaicain|$j|$ jamaïque|dollar jamaïque|jmd"], ["Dollar libérien", "dollar libérien|dollars libérien|dollar liberien|dollars liberien|lrd|$ libérien|$ liberia|$ liberien"], ["Dollar namibien", "dollar namibien|dollars namibien|$ namibien|nad|$n|dollar namibie|dollars namibie|$ namibie"], ["Dollar des îles salomon", "dollar des îles Salomon|dollar des iles salomon|$si|sbd|$ iles salomon|$ îles salomon"], ["Dollar du suriname", "dollar du suriname|srd|$ du suriname|$ suriname|dollar suriname|dollars suriname|dollars du suriname"], ["Nouveau dollar de Taïwan", "nouveau dollar de taïwan|nouveau dollar de taiwan|twd|ntd|$nt"], ["Dollar trinidadien", "dollar trinidadien|dollars trinidadien|ttd|$ trinidadien"], ["Dollar", "dollar|$|dollars"], ["Yuan Chinois", "yuan|yuans|yuan chinois|renminbi|cny|rmb|¥"], ["Fen", "fen"], ["Jiao", "jiao"], ["Mark Finlandais", "marks finlandais|mark finlandais|fim|mark"]]); + FrenchNumericWithUnit.CompoundUnitConnectorRegex = `(?[^.])`; + FrenchNumericWithUnit.CurrencyPrefixList = new Map([["Dollar", "$"], ["Dollar États-Unis", "$us|usd|us$"], ["Dollar Caraïbes orientales", "xcd|$ec"], ["Dollar australien", "a$|$a|aud"], ["Dollar bahamas", "bsd|b$"], ["Dollar barbadien", "bbd|bds$"], ["Dollar de belize", "bz$|bzd"], ["Dollar des bermudes", "bd$|bmd"], ["Dollar de brunei", "brunei $|bnd"], ["Dollar de Singapour", "s$|sgd"], ["Dollar Canadien", "cad|$ ca|$ca|$ c"], ["Dollar des îles Caïmans", "ci$|kyd"], ["Dollar néo-zélandais", "nz$|nzd"], ["Dollar de Fidji", "$fj|fjd"], ["Dolar guyanien", "g$|gyd"], ["Dollar de Hong Kong", "hkd|hk$"], ["Dollar jamaïcain", "j$|jmd"], ["Dollar libérien", "lrd|l$"], ["Dollar namibien", "nad|n$"], ["Dollar des îles Salomon", "$ si|$si|sbd"], ["Nouveau dollar de Taïwan", "nt$|twd"], ["Réal brésilien", "r$|brl|reais"], ["Guaraní paraguayen", "₲|gs.|pyg"], ["Dollar trinidadien", "ttd|titis"], ["Yuan renminbi", "cny|rmb|¥|元"], ["Yen", "¥|jpy"], ["Euro", "€|eur"], ["Pound", "£"], ["Florín", "ƒ"], ["Livre", "£|gbp"]]); + FrenchNumericWithUnit.AmbiguousCurrencyUnitList = ['din.', 'kina', 'lari', 'taka', 'tala', 'vatu', 'yuan', 'bob', 'btn', 'cop', 'cup', 'dop', 'gip', 'jod', 'kgs', 'lak', 'mga', 'mop', 'nad', 'omr', 'sar', 'sbd', 'scr', 'sdg', 'sek', 'sos', 'std', 'try', 'yer']; + FrenchNumericWithUnit.InformationSuffixList = new Map([["Bit", "-bit|bit|bits"], ["Kilobit", "kilobit|kilobits|kb|kbit|kbits"], ["Megabit", "megabit|megabits|Mb|Mbit|mégabit|mégabits"], ["Gigabit", "gigabit|gigabits|Gb|Gbit"], ["Terabit", "terabit|terabits|Tb|Tbit|térabit|térabits"], ["Petabit", "petabit|petabits|Pb|Pbit|pétabit|pétabits"], ["octet", "octet|octets|-octet"], ["Kilooctet", "kilo-octet|kilo-octets|kilooctet|kilooctets|ko|kio|kB|KiB|kilobyte|kilobytes"], ["Mégaoctet", "mégaoctet|mégaoctets|méga-octet|méga-octets|Mo|Mio|MB|mégabyte|mégabytes"], ["Gigaoctet", "gigaoctet|gigaoctets|Go|Gio|GB|GiB|gigabyte|gigabytes"], ["Téraoctet", "téraoctet|téraoctets|To|Tio|TB|TiB|térabyte|térabytes"], ["Pétaoctet", "pétaoctet|pétaoctets|Po|Pio|PB|PiB|pétabyte|pétabytes"]]); + FrenchNumericWithUnit.AmbiguousDimensionUnitList = ['mi', 'barils', 'grain', 'l', 'pierre', 'fps', 'pts']; + FrenchNumericWithUnit.BuildPrefix = `(?<=(\\s|^|\\P{L}))`; + FrenchNumericWithUnit.BuildSuffix = `(?=(\\s|\\P{L}|$))`; + FrenchNumericWithUnit.ConnectorToken = 'de'; + FrenchNumericWithUnit.LengthSuffixList = new Map([["Kilomètres", "km|kilomètres|kilomètre|kilometres|kilometre|-km"], ["Hectomètre", "hm|hectomètre|hectomètres|hectometre|hectometres|-hm"], ["Décamètre", "dam|décamètre|décamètres|decametre|decametres|-dm"], ["Mètres", "m|mètres|mètre|metres|metre|m.|-m"], ["Décimètres", "dm|décimètres|décimètre|decimetres|decimetre"], ["Centimètres", "cm|centimètres|centimètre|centimetres|centimetre"], ["Millimètres", "mm|millimètres|millimètre|millimetre|millimetres"], ["Micromètres", "µm|um|micromètres|micromètre|micrometres|micrometre"], ["Nanomètres", "nm|nanometre|nanometres|nanomètres|nanomètre"], ["Picomètres", "pm|picomètre|picomètres|picometres|picometre"], ["Mile", "mi|mile|miles"], ["Pied", "pied|pieds"], ["Yard", "yards|yard|yd"], ["Pouce", "pouce|pouces"]]); + FrenchNumericWithUnit.AmbiguousLengthUnitList = ['m', 'yard', 'yards', 'pm', 'pt', 'pts']; + FrenchNumericWithUnit.AmbuguousLengthUnitList = ['m', 'pouce', 'pm']; + FrenchNumericWithUnit.SpeedSuffixList = new Map([["Mètre par seconde", "m/s|metres/seconde|metres par seconde|metre par seconde|metres par secondes|mètre par seconde|mètres par seconde|mètres par secondes"], ["Kilomètre par heure", "km/h|kilomètre par heure|kilomètres par heure|kilomètres par heures|kilometres par heure|kilometre par heure"], ["Kilomètre par minute", "km/m|kilomètre par minute|kilomètres par minute|kilomètres par minutes|kilometre par minute|kilometre par minutes"], ["Kilomètre par seconde", "km/s|km à la seconde|km a la seconde|kilomètre par seconde|kilomètres par seconde|kilometre par seconde|kilometres par seconde"], ["Miles par heure", "mph|miles par heure|miles à l'heure|miles a l'heure|miles un heure"], ["Noeuds", "noeud|noeuds|nuds"], ["Pied par seconde", "ft/s|pied par seconde|pieds par seconde|pied/s|pieds/s"], ["Pied par minute", "pieds/minute|pied/minute|ft/minute|ft/min|pied/min"]]); + FrenchNumericWithUnit.TemperatureSuffixList = new Map([["Kelvin", "k|K|kelvin"], ["F", "°f|degres f|degrés f|deg f|° f|degrés fahrenheit|degres fahrenheit|fahrenheit"], ["R", "rankine|°r|° r"], ["C", "°c|deg c|degrés celsius|degrés c|degres celsius|celsius|deg celsius|degs celsius|centigrade|deg centigrade|degs centigrade|degrés centigrade|degres centigrade|degré centigrade|degre centigrade"], ["Degré", "degrés|degres|deg.|°| °|degré|degre|deg"]]); + FrenchNumericWithUnit.VolumeSuffixList = new Map([["Mètre cube", "m3|m^3|m³|mètre cube|mètres cube|metre cube|metres cube"], ["Centimètre cube", "cm3|cm^3|cm³|centimètre cube|centimètres cube|centimetre cube|centimetres cube"], ["Millimètre cube", "mm3|mm^3|mm³|millimètre cube|millimètres cube|millimetre cube|millimetres cube"], ["Kilomètre cube", "km3|km^3|km³|kilomètre cube|kilomètres cube|kilometre cube|kilometres cube"], ["Pieds cube", "pieds cubes|pieds cube|pied cube|pied cubes"], ["Litre", "litre|litres|lts|l"], ["Millilitre", "ml|millilitre|millilitres"], ["Gallon", "gallon|gallons"], ["Pintes", "pintes"], ["Onces", "onces|once|oz"], ["Décilitre", "dl|décilitre|decilitre|décilitres|decilitres"], ["Centilitre", "cl|centilitres|centilitre"], ["Onces liquides", "onces liquides|once liquide|once liquides"], ["Baril", "baril|barils|bbl"]]); + FrenchNumericWithUnit.AmbiguousVolumeUnitList = ['ounce', 'oz', 'l', 'cup', 'peck', 'cord', 'gill']; + FrenchNumericWithUnit.WeightSuffixList = new Map([["Kilogramme", "kg|kilogramme|kilogrammes|kilo|kilos"], ["Gram", "g|gramme|grammes"], ["Milligramme", "mg|milligramme|milligrammes"], ["Tonne métrique", "tonne métrique|tonnes métrique|tonnes métriques|tonne metrique|tonnes metrique"], ["Tonne", "tonne|tonnes|-tonnes|-tonne"], ["Livre", "livre|livres"]]); + FrenchNumericWithUnit.AmbiguousWeightUnitList = ['g', 'oz', 'stone', 'dram']; +})(FrenchNumericWithUnit = exports.FrenchNumericWithUnit || (exports.FrenchNumericWithUnit = {})); + +}); + +unwrapExports(frenchNumericWithUnit); + +var base$10 = createCommonjsModule(function (module, exports) { +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); + + + + + +class FrenchNumberWithUnitExtractorConfiguration { + constructor(ci) { + this.cultureInfo = ci; + this.unitNumExtractor = new recognizersTextNumber.FrenchNumberExtractor(); + this.buildPrefix = frenchNumericWithUnit.FrenchNumericWithUnit.BuildPrefix; + this.buildSuffix = frenchNumericWithUnit.FrenchNumericWithUnit.BuildSuffix; + this.connectorToken = frenchNumericWithUnit.FrenchNumericWithUnit.ConnectorToken; + this.compoundUnitConnectorRegex = recognizersText.RegExpUtility.getSafeRegExp(frenchNumericWithUnit.FrenchNumericWithUnit.CompoundUnitConnectorRegex); + this.pmNonUnitRegex = recognizersText.RegExpUtility.getSafeRegExp(baseUnits.BaseUnits.PmNonUnitRegex); + } +} +exports.FrenchNumberWithUnitExtractorConfiguration = FrenchNumberWithUnitExtractorConfiguration; +class FrenchNumberWithUnitParserConfiguration extends parsers$8.BaseNumberWithUnitParserConfiguration { + constructor(ci) { + super(ci); + this.internalNumberExtractor = new recognizersTextNumber.FrenchNumberExtractor(recognizersTextNumber.NumberMode.Default); + this.internalNumberParser = recognizersTextNumber.AgnosticNumberParserFactory.getParser(recognizersTextNumber.AgnosticNumberParserType.Number, new recognizersTextNumber.FrenchNumberParserConfiguration()); + this.connectorToken = frenchNumericWithUnit.FrenchNumericWithUnit.ConnectorToken; + } +} +exports.FrenchNumberWithUnitParserConfiguration = FrenchNumberWithUnitParserConfiguration; + +}); + +unwrapExports(base$10); + +var currency$10 = createCommonjsModule(function (module, exports) { +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); + + + + +class FrenchCurrencyExtractorConfiguration extends base$10.FrenchNumberWithUnitExtractorConfiguration { + constructor(ci) { + if (!ci) { + ci = new recognizersTextNumber.CultureInfo(recognizersTextNumber.Culture.French); + } + super(ci); + this.extractType = constants$4.Constants.SYS_UNIT_CURRENCY; + // Reference Source: https:// en.wikipedia.org/wiki/List_of_circulating_currencies + this.suffixList = frenchNumericWithUnit.FrenchNumericWithUnit.CurrencySuffixList; + this.prefixList = frenchNumericWithUnit.FrenchNumericWithUnit.CurrencyPrefixList; + this.ambiguousUnitList = frenchNumericWithUnit.FrenchNumericWithUnit.AmbiguousCurrencyUnitList; + } +} +exports.FrenchCurrencyExtractorConfiguration = FrenchCurrencyExtractorConfiguration; +class FrenchCurrencyParserConfiguration extends base$10.FrenchNumberWithUnitParserConfiguration { + constructor(ci) { + if (!ci) { + ci = new recognizersTextNumber.CultureInfo(recognizersTextNumber.Culture.French); + } + super(ci); + this.BindDictionary(frenchNumericWithUnit.FrenchNumericWithUnit.CurrencySuffixList); + this.BindDictionary(frenchNumericWithUnit.FrenchNumericWithUnit.CurrencyPrefixList); + } +} +exports.FrenchCurrencyParserConfiguration = FrenchCurrencyParserConfiguration; + +}); + +unwrapExports(currency$10); + +var temperature$8 = createCommonjsModule(function (module, exports) { +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); + + + + +class FrenchTemperatureExtractorConfiguration extends base$10.FrenchNumberWithUnitExtractorConfiguration { + constructor(ci) { + if (!ci) { + ci = new recognizersTextNumber.CultureInfo(recognizersTextNumber.Culture.French); + } + super(ci); + this.extractType = constants$4.Constants.SYS_UNIT_TEMPERATURE; + this.suffixList = frenchNumericWithUnit.FrenchNumericWithUnit.TemperatureSuffixList; + this.prefixList = new Map(); + this.ambiguousUnitList = new Array(); + } +} +exports.FrenchTemperatureExtractorConfiguration = FrenchTemperatureExtractorConfiguration; +class FrenchTemperatureParserConfiguration extends base$10.FrenchNumberWithUnitParserConfiguration { + constructor(ci) { + if (!ci) { + ci = new recognizersTextNumber.CultureInfo(recognizersTextNumber.Culture.French); + } + super(ci); + this.connectorToken = null; + this.BindDictionary(frenchNumericWithUnit.FrenchNumericWithUnit.TemperatureSuffixList); + } +} +exports.FrenchTemperatureParserConfiguration = FrenchTemperatureParserConfiguration; + +}); + +unwrapExports(temperature$8); + +var dimension$8 = createCommonjsModule(function (module, exports) { +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); + + + + +const dimensionSuffixList = new Map([ + ...frenchNumericWithUnit.FrenchNumericWithUnit.InformationSuffixList, + ...frenchNumericWithUnit.FrenchNumericWithUnit.AreaSuffixList, + ...frenchNumericWithUnit.FrenchNumericWithUnit.LengthSuffixList, + ...frenchNumericWithUnit.FrenchNumericWithUnit.SpeedSuffixList, + ...frenchNumericWithUnit.FrenchNumericWithUnit.VolumeSuffixList, + ...frenchNumericWithUnit.FrenchNumericWithUnit.WeightSuffixList +]); +class FrenchDimensionExtractorConfiguration extends base$10.FrenchNumberWithUnitExtractorConfiguration { + constructor(ci) { + if (!ci) { + ci = new recognizersTextNumber.CultureInfo(recognizersTextNumber.Culture.French); + } + super(ci); + this.extractType = constants$4.Constants.SYS_UNIT_DIMENSION; + this.suffixList = dimensionSuffixList; + this.prefixList = new Map(); + this.ambiguousUnitList = frenchNumericWithUnit.FrenchNumericWithUnit.AmbiguousDimensionUnitList; + } +} +exports.FrenchDimensionExtractorConfiguration = FrenchDimensionExtractorConfiguration; +class FrenchDimensionParserConfiguration extends base$10.FrenchNumberWithUnitParserConfiguration { + constructor(ci) { + if (!ci) { + ci = new recognizersTextNumber.CultureInfo(recognizersTextNumber.Culture.French); + } + super(ci); + this.BindDictionary(dimensionSuffixList); + } +} +exports.FrenchDimensionParserConfiguration = FrenchDimensionParserConfiguration; + +}); + +unwrapExports(dimension$8); + +var age$10 = createCommonjsModule(function (module, exports) { +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); + + + + +class FrenchAgeExtractorConfiguration extends base$10.FrenchNumberWithUnitExtractorConfiguration { + constructor(ci) { + if (!ci) { + ci = new recognizersTextNumber.CultureInfo(recognizersTextNumber.Culture.French); + } + super(ci); + this.extractType = constants$4.Constants.SYS_UNIT_AGE; + this.suffixList = frenchNumericWithUnit.FrenchNumericWithUnit.AgeSuffixList; + this.prefixList = new Map(); + this.ambiguousUnitList = new Array(); + } +} +exports.FrenchAgeExtractorConfiguration = FrenchAgeExtractorConfiguration; +class FrenchAgeParserConfiguration extends base$10.FrenchNumberWithUnitParserConfiguration { + constructor(ci) { + if (!ci) { + ci = new recognizersTextNumber.CultureInfo(recognizersTextNumber.Culture.French); + } + super(ci); + this.BindDictionary(frenchNumericWithUnit.FrenchNumericWithUnit.AgeSuffixList); + } +} +exports.FrenchAgeParserConfiguration = FrenchAgeParserConfiguration; + +}); + +unwrapExports(age$10); + +var numberWithUnitRecognizer = createCommonjsModule(function (module, exports) { +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); + + + + + + + + + + + + + + + + + + + + + + + + + + + +var NumberWithUnitOptions; +(function (NumberWithUnitOptions) { + NumberWithUnitOptions[NumberWithUnitOptions["None"] = 0] = "None"; +})(NumberWithUnitOptions = exports.NumberWithUnitOptions || (exports.NumberWithUnitOptions = {})); +function recognizeCurrency(query, culture, options = NumberWithUnitOptions.None, fallbackToDefaultCulture = true) { + return recognizeByModel(recognizer => recognizer.getCurrencyModel(culture, fallbackToDefaultCulture), query, culture, options); +} +exports.recognizeCurrency = recognizeCurrency; +function recognizeTemperature(query, culture, options = NumberWithUnitOptions.None, fallbackToDefaultCulture = true) { + return recognizeByModel(recognizer => recognizer.getTemperatureModel(culture, fallbackToDefaultCulture), query, culture, options); +} +exports.recognizeTemperature = recognizeTemperature; +function recognizeDimension(query, culture, options = NumberWithUnitOptions.None, fallbackToDefaultCulture = true) { + return recognizeByModel(recognizer => recognizer.getDimensionModel(culture, fallbackToDefaultCulture), query, culture, options); +} +exports.recognizeDimension = recognizeDimension; +function recognizeAge(query, culture, options = NumberWithUnitOptions.None, fallbackToDefaultCulture = true) { + return recognizeByModel(recognizer => recognizer.getAgeModel(culture, fallbackToDefaultCulture), query, culture, options); +} +exports.recognizeAge = recognizeAge; +function recognizeByModel(getModelFunc, query, culture, options) { + let recognizer = new NumberWithUnitRecognizer(culture, options); + let model = getModelFunc(recognizer); + return model.parse(query); +} +class NumberWithUnitRecognizer extends recognizersText.Recognizer { + constructor(culture, options = NumberWithUnitOptions.None, lazyInitialization = false) { + super(culture, options, lazyInitialization); + } + InitializeConfiguration() { + //#region English + this.registerModel("CurrencyModel", recognizersTextNumber.Culture.English, (options) => new models$6.CurrencyModel(new Map([ + [new extractors$16.BaseMergedUnitExtractor(new currency.EnglishCurrencyExtractorConfiguration()), new parsers$8.BaseMergedUnitParser(new currency.EnglishCurrencyParserConfiguration())] + ]))); + this.registerModel("TemperatureModel", recognizersTextNumber.Culture.English, (options) => new models$6.TemperatureModel(new Map([ + [new extractors$16.NumberWithUnitExtractor(new temperature.EnglishTemperatureExtractorConfiguration()), new parsers$8.NumberWithUnitParser(new temperature.EnglishTemperatureParserConfiguration())] + ]))); + this.registerModel("DimensionModel", recognizersTextNumber.Culture.English, (options) => new models$6.DimensionModel(new Map([ + [new extractors$16.NumberWithUnitExtractor(new dimension.EnglishDimensionExtractorConfiguration()), new parsers$8.NumberWithUnitParser(new dimension.EnglishDimensionParserConfiguration())] + ]))); + this.registerModel("AgeModel", recognizersTextNumber.Culture.English, (options) => new models$6.AgeModel(new Map([ + [new extractors$16.NumberWithUnitExtractor(new age.EnglishAgeExtractorConfiguration()), new parsers$8.NumberWithUnitParser(new age.EnglishAgeParserConfiguration())] + ]))); + //#endregion + //#region Spanish + this.registerModel("CurrencyModel", recognizersTextNumber.Culture.Spanish, (options) => new models$6.CurrencyModel(new Map([ + [new extractors$16.NumberWithUnitExtractor(new currency$2.SpanishCurrencyExtractorConfiguration()), new parsers$8.NumberWithUnitParser(new currency$2.SpanishCurrencyParserConfiguration())] + ]))); + this.registerModel("TemperatureModel", recognizersTextNumber.Culture.Spanish, (options) => new models$6.TemperatureModel(new Map([ + [new extractors$16.NumberWithUnitExtractor(new temperature$2.SpanishTemperatureExtractorConfiguration()), new parsers$8.NumberWithUnitParser(new temperature$2.SpanishTemperatureParserConfiguration())] + ]))); + this.registerModel("DimensionModel", recognizersTextNumber.Culture.Spanish, (options) => new models$6.DimensionModel(new Map([ + [new extractors$16.NumberWithUnitExtractor(new dimension$2.SpanishDimensionExtractorConfiguration()), new parsers$8.NumberWithUnitParser(new dimension$2.SpanishDimensionParserConfiguration())] + ]))); + this.registerModel("AgeModel", recognizersTextNumber.Culture.Spanish, (options) => new models$6.AgeModel(new Map([ + [new extractors$16.NumberWithUnitExtractor(new age$2.SpanishAgeExtractorConfiguration()), new parsers$8.NumberWithUnitParser(new age$2.SpanishAgeParserConfiguration())] + ]))); + //#endregion + //#region Portuguese + this.registerModel("CurrencyModel", recognizersTextNumber.Culture.Portuguese, (options) => new models$6.CurrencyModel(new Map([ + [new extractors$16.NumberWithUnitExtractor(new currency$4.PortugueseCurrencyExtractorConfiguration()), new parsers$8.NumberWithUnitParser(new currency$4.PortugueseCurrencyParserConfiguration())] + ]))); + this.registerModel("TemperatureModel", recognizersTextNumber.Culture.Portuguese, (options) => new models$6.TemperatureModel(new Map([ + [new extractors$16.NumberWithUnitExtractor(new temperature$4.PortugueseTemperatureExtractorConfiguration()), new parsers$8.NumberWithUnitParser(new temperature$4.PortugueseTemperatureParserConfiguration())] + ]))); + this.registerModel("DimensionModel", recognizersTextNumber.Culture.Portuguese, (options) => new models$6.DimensionModel(new Map([ + [new extractors$16.NumberWithUnitExtractor(new dimension$4.PortugueseDimensionExtractorConfiguration()), new parsers$8.NumberWithUnitParser(new dimension$4.PortugueseDimensionParserConfiguration())] + ]))); + this.registerModel("AgeModel", recognizersTextNumber.Culture.Portuguese, (options) => new models$6.AgeModel(new Map([ + [new extractors$16.NumberWithUnitExtractor(new age$4.PortugueseAgeExtractorConfiguration()), new parsers$8.NumberWithUnitParser(new age$4.PortugueseAgeParserConfiguration())] + ]))); + //#endregion + //#region Chinese + this.registerModel("CurrencyModel", recognizersTextNumber.Culture.Chinese, (options) => new models$6.CurrencyModel(new Map([ + [new extractors$16.BaseMergedUnitExtractor(new currency$6.ChineseCurrencyExtractorConfiguration()), new parsers$8.BaseMergedUnitParser(new currency$6.ChineseCurrencyParserConfiguration())], + [new extractors$16.NumberWithUnitExtractor(new currency.EnglishCurrencyExtractorConfiguration()), new parsers$8.NumberWithUnitParser(new currency.EnglishCurrencyParserConfiguration())] + ]))); + this.registerModel("TemperatureModel", recognizersTextNumber.Culture.Chinese, (options) => new models$6.TemperatureModel(new Map([ + [new extractors$16.NumberWithUnitExtractor(new temperature$6.ChineseTemperatureExtractorConfiguration()), new parsers$8.NumberWithUnitParser(new temperature$6.ChineseTemperatureParserConfiguration())], + [new extractors$16.NumberWithUnitExtractor(new temperature.EnglishTemperatureExtractorConfiguration()), new parsers$8.NumberWithUnitParser(new temperature.EnglishTemperatureParserConfiguration())] + ]))); + this.registerModel("DimensionModel", recognizersTextNumber.Culture.Chinese, (options) => new models$6.DimensionModel(new Map([ + [new extractors$16.NumberWithUnitExtractor(new dimension$6.ChineseDimensionExtractorConfiguration()), new parsers$8.NumberWithUnitParser(new dimension$6.ChineseDimensionParserConfiguration())], + [new extractors$16.NumberWithUnitExtractor(new dimension.EnglishDimensionExtractorConfiguration()), new parsers$8.NumberWithUnitParser(new dimension.EnglishDimensionParserConfiguration())] + ]))); + this.registerModel("AgeModel", recognizersTextNumber.Culture.Chinese, (options) => new models$6.AgeModel(new Map([ + [new extractors$16.NumberWithUnitExtractor(new age$6.ChineseAgeExtractorConfiguration()), new parsers$8.NumberWithUnitParser(new age$6.ChineseAgeParserConfiguration())], + [new extractors$16.NumberWithUnitExtractor(new age.EnglishAgeExtractorConfiguration()), new parsers$8.NumberWithUnitParser(new age.EnglishAgeParserConfiguration())] + ]))); + //#endregion + //#region Japanese + this.registerModel("CurrencyModel", recognizersTextNumber.Culture.Japanese, (options) => new models$6.CurrencyModel(new Map([ + [new extractors$16.BaseMergedUnitExtractor(new currency$8.JapaneseCurrencyExtractorConfiguration()), new parsers$8.BaseMergedUnitParser(new currency$8.JapaneseCurrencyParserConfiguration())], + [new extractors$16.NumberWithUnitExtractor(new currency.EnglishCurrencyExtractorConfiguration()), new parsers$8.NumberWithUnitParser(new currency.EnglishCurrencyParserConfiguration())] + ]))); + this.registerModel("AgeModel", recognizersTextNumber.Culture.Japanese, (options) => new models$6.AgeModel(new Map([ + [new extractors$16.NumberWithUnitExtractor(new age$8.JapaneseAgeExtractorConfiguration()), new parsers$8.NumberWithUnitParser(new age$8.JapaneseAgeParserConfiguration())], + [new extractors$16.NumberWithUnitExtractor(new age.EnglishAgeExtractorConfiguration()), new parsers$8.NumberWithUnitParser(new age.EnglishAgeParserConfiguration())] + ]))); + //#endregion + //#region French + this.registerModel("CurrencyModel", recognizersTextNumber.Culture.French, (options) => new models$6.CurrencyModel(new Map([ + [new extractors$16.NumberWithUnitExtractor(new currency$10.FrenchCurrencyExtractorConfiguration()), new parsers$8.NumberWithUnitParser(new currency$10.FrenchCurrencyParserConfiguration())] + ]))); + this.registerModel("TemperatureModel", recognizersTextNumber.Culture.French, (options) => new models$6.TemperatureModel(new Map([ + [new extractors$16.NumberWithUnitExtractor(new temperature$8.FrenchTemperatureExtractorConfiguration()), new parsers$8.NumberWithUnitParser(new temperature$8.FrenchTemperatureParserConfiguration())] + ]))); + this.registerModel("DimensionModel", recognizersTextNumber.Culture.French, (options) => new models$6.DimensionModel(new Map([ + [new extractors$16.NumberWithUnitExtractor(new dimension$8.FrenchDimensionExtractorConfiguration()), new parsers$8.NumberWithUnitParser(new dimension$8.FrenchDimensionParserConfiguration())] + ]))); + this.registerModel("AgeModel", recognizersTextNumber.Culture.French, (options) => new models$6.AgeModel(new Map([ + [new extractors$16.NumberWithUnitExtractor(new age$10.FrenchAgeExtractorConfiguration()), new parsers$8.NumberWithUnitParser(new age$10.FrenchAgeParserConfiguration())] + ]))); + //#endregion + } + IsValidOptions(options) { + return options >= 0 && options <= NumberWithUnitOptions.None; + } + getCurrencyModel(culture = null, fallbackToDefaultCulture = true) { + return this.getModel("CurrencyModel", culture, fallbackToDefaultCulture); + } + getTemperatureModel(culture = null, fallbackToDefaultCulture = true) { + return this.getModel("TemperatureModel", culture, fallbackToDefaultCulture); + } + getDimensionModel(culture = null, fallbackToDefaultCulture = true) { + return this.getModel("DimensionModel", culture, fallbackToDefaultCulture); + } + getAgeModel(culture = null, fallbackToDefaultCulture = true) { + return this.getModel("AgeModel", culture, fallbackToDefaultCulture); + } +} +exports.default = NumberWithUnitRecognizer; + +}); + +unwrapExports(numberWithUnitRecognizer); + +var recognizersTextNumberWithUnit = createCommonjsModule(function (module, exports) { +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); + +exports.NumberWithUnitRecognizer = numberWithUnitRecognizer.default; +exports.NumberWithUnitOptions = numberWithUnitRecognizer.NumberWithUnitOptions; +exports.recognizeTemperature = numberWithUnitRecognizer.recognizeTemperature; +exports.recognizeDimension = numberWithUnitRecognizer.recognizeDimension; +exports.recognizeCurrency = numberWithUnitRecognizer.recognizeCurrency; +exports.recognizeAge = numberWithUnitRecognizer.recognizeAge; + +exports.Culture = recognizersTextNumber.Culture; +exports.CultureInfo = recognizersTextNumber.CultureInfo; + +exports.Constants = constants$4.Constants; + +exports.NumberWithUnitExtractor = extractors$16.NumberWithUnitExtractor; +exports.PrefixUnitResult = extractors$16.PrefixUnitResult; +exports.BaseMergedUnitExtractor = extractors$16.BaseMergedUnitExtractor; + +exports.CompositeEntityType = models$6.CompositeEntityType; +exports.AbstractNumberWithUnitModel = models$6.AbstractNumberWithUnitModel; +exports.AgeModel = models$6.AgeModel; +exports.CurrencyModel = models$6.CurrencyModel; +exports.DimensionModel = models$6.DimensionModel; +exports.TemperatureModel = models$6.TemperatureModel; + +exports.UnitValue = parsers$8.UnitValue; +exports.UnitValueIso = parsers$8.UnitValueIso; +exports.NumberWithUnitParser = parsers$8.NumberWithUnitParser; +exports.BaseNumberWithUnitParserConfiguration = parsers$8.BaseNumberWithUnitParserConfiguration; +exports.BaseCurrencyParser = parsers$8.BaseCurrencyParser; +exports.BaseMergedUnitParser = parsers$8.BaseMergedUnitParser; + +exports.EnglishAgeExtractorConfiguration = age.EnglishAgeExtractorConfiguration; +exports.EnglishAgeParserConfiguration = age.EnglishAgeParserConfiguration; + +exports.EnglishNumberWithUnitExtractorConfiguration = base.EnglishNumberWithUnitExtractorConfiguration; +exports.EnglishNumberWithUnitParserConfiguration = base.EnglishNumberWithUnitParserConfiguration; + +exports.EnglishCurrencyExtractorConfiguration = currency.EnglishCurrencyExtractorConfiguration; +exports.EnglishCurrencyParserConfiguration = currency.EnglishCurrencyParserConfiguration; + +exports.EnglishDimensionExtractorConfiguration = dimension.EnglishDimensionExtractorConfiguration; +exports.EnglishDimensionParserConfiguration = dimension.EnglishDimensionParserConfiguration; + +exports.EnglishTemperatureExtractorConfiguration = temperature.EnglishTemperatureExtractorConfiguration; +exports.EnglishTemperatureParserConfiguration = temperature.EnglishTemperatureParserConfiguration; + +exports.SpanishAgeExtractorConfiguration = age$2.SpanishAgeExtractorConfiguration; +exports.SpanishAgeParserConfiguration = age$2.SpanishAgeParserConfiguration; + +exports.SpanishNumberWithUnitExtractorConfiguration = base$2.SpanishNumberWithUnitExtractorConfiguration; +exports.SpanishNumberWithUnitParserConfiguration = base$2.SpanishNumberWithUnitParserConfiguration; + +exports.SpanishCurrencyExtractorConfiguration = currency$2.SpanishCurrencyExtractorConfiguration; +exports.SpanishCurrencyParserConfiguration = currency$2.SpanishCurrencyParserConfiguration; + +exports.SpanishDimensionExtractorConfiguration = dimension$2.SpanishDimensionExtractorConfiguration; +exports.SpanishDimensionParserConfiguration = dimension$2.SpanishDimensionParserConfiguration; + +exports.SpanishTemperatureExtractorConfiguration = temperature$2.SpanishTemperatureExtractorConfiguration; +exports.SpanishTemperatureParserConfiguration = temperature$2.SpanishTemperatureParserConfiguration; + +exports.PortugueseAgeExtractorConfiguration = age$4.PortugueseAgeExtractorConfiguration; +exports.PortugueseAgeParserConfiguration = age$4.PortugueseAgeParserConfiguration; + +exports.PortugueseNumberWithUnitExtractorConfiguration = base$4.PortugueseNumberWithUnitExtractorConfiguration; +exports.PortugueseNumberWithUnitParserConfiguration = base$4.PortugueseNumberWithUnitParserConfiguration; + +exports.PortugueseCurrencyExtractorConfiguration = currency$4.PortugueseCurrencyExtractorConfiguration; +exports.PortugueseCurrencyParserConfiguration = currency$4.PortugueseCurrencyParserConfiguration; + +exports.PortugueseDimensionExtractorConfiguration = dimension$4.PortugueseDimensionExtractorConfiguration; +exports.PortugueseDimensionParserConfiguration = dimension$4.PortugueseDimensionParserConfiguration; + +exports.PortugueseTemperatureExtractorConfiguration = temperature$4.PortugueseTemperatureExtractorConfiguration; +exports.PortugueseTemperatureParserConfiguration = temperature$4.PortugueseTemperatureParserConfiguration; + +exports.ChineseAgeExtractorConfiguration = age$6.ChineseAgeExtractorConfiguration; +exports.ChineseAgeParserConfiguration = age$6.ChineseAgeParserConfiguration; + +exports.ChineseNumberWithUnitExtractorConfiguration = base$6.ChineseNumberWithUnitExtractorConfiguration; +exports.ChineseNumberWithUnitParserConfiguration = base$6.ChineseNumberWithUnitParserConfiguration; + +exports.ChineseCurrencyExtractorConfiguration = currency$6.ChineseCurrencyExtractorConfiguration; +exports.ChineseCurrencyParserConfiguration = currency$6.ChineseCurrencyParserConfiguration; + +exports.ChineseDimensionExtractorConfiguration = dimension$6.ChineseDimensionExtractorConfiguration; +exports.ChineseDimensionParserConfiguration = dimension$6.ChineseDimensionParserConfiguration; + +exports.ChineseTemperatureExtractorConfiguration = temperature$6.ChineseTemperatureExtractorConfiguration; +exports.ChineseTemperatureParserConfiguration = temperature$6.ChineseTemperatureParserConfiguration; + +exports.JapaneseAgeExtractorConfiguration = age$8.JapaneseAgeExtractorConfiguration; +exports.JapaneseAgeParserConfiguration = age$8.JapaneseAgeParserConfiguration; + +exports.JapaneseNumberWithUnitExtractorConfiguration = base$8.JapaneseNumberWithUnitExtractorConfiguration; +exports.JapaneseNumberWithUnitParserConfiguration = base$8.JapaneseNumberWithUnitParserConfiguration; + +exports.JapaneseCurrencyExtractorConfiguration = currency$8.JapaneseCurrencyExtractorConfiguration; +exports.JapaneseCurrencyParserConfiguration = currency$8.JapaneseCurrencyParserConfiguration; + +exports.EnglishNumericWithUnit = englishNumericWithUnit.EnglishNumericWithUnit; + +exports.SpanishNumericWithUnit = spanishNumericWithUnit.SpanishNumericWithUnit; + +exports.PortugueseNumericWithUnit = portugueseNumericWithUnit.PortugueseNumericWithUnit; + +exports.ChineseNumericWithUnit = chineseNumericWithUnit.ChineseNumericWithUnit; + +exports.JapaneseNumericWithUnit = japaneseNumericWithUnit.JapaneseNumericWithUnit; + +}); + +unwrapExports(recognizersTextNumberWithUnit); + +var baseDateTime$4 = createCommonjsModule(function (module, exports) { +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); + +class TimeResult { + constructor(hour, minute, second, lowBound) { + this.hour = hour; + this.minute = minute; + this.second = second; + this.lowBound = lowBound ? lowBound : -1; + } +} +exports.TimeResult = TimeResult; +class BaseDateTimeExtractor { + constructor(regexesDictionary) { + this.regexesDictionary = regexesDictionary; + } + extract(source, refDate) { + if (!refDate) + refDate = new Date(); + let results = new Array(); + if (recognizersTextNumber.StringUtility.isNullOrEmpty(source)) { + return results; + } + let matchSource = new Map(); + let matched = new Array(source.length); + for (let i = 0; i < source.length; i++) { + matched[i] = false; + } + let collections = []; + this.regexesDictionary.forEach((value, regex) => { + let matches = recognizersTextNumber.RegExpUtility.getMatches(regex, source); + if (matches.length > 0) { + collections.push({ matches: matches, value: value }); + } + }); + collections.forEach(collection => { + collection.matches.forEach(m => { + for (let j = 0; j < m.length; j++) { + matched[m.index + j] = true; + } + // Keep Source Data for extra information + matchSource.set(m, collection.value); + }); + }); + let last = -1; + for (let i = 0; i < source.length; i++) { + if (matched[i]) { + if (i + 1 === source.length || !matched[i + 1]) { + let start = last + 1; + let length = i - last; + let substr = source.substring(start, start + length).trim(); + let srcMatch = Array.from(matchSource.keys()).find(m => m.index === start && m.length === length); + if (srcMatch) { + results.push({ + start: start, + length: length, + text: substr, + type: this.extractorName, + data: matchSource.has(srcMatch) + ? { dataType: matchSource.get(srcMatch), namedEntity: (key) => srcMatch.groups(key) } + : null + }); + } + } + } + else { + last = i; + } + } + return results; + } +} +exports.BaseDateTimeExtractor = BaseDateTimeExtractor; +class TimeResolutionUtils { + static addDescription(lowBoundMap, timeResult, description) { + description = TimeResolutionUtils.normalizeDesc(description); + if (lowBoundMap.has(description) && timeResult.hour < lowBoundMap.get(description)) { + timeResult.hour += 12; + timeResult.lowBound = lowBoundMap.get(description); + } + else { + timeResult.lowBound = 0; + } + } + static normalizeDesc(description) { + description = description.replace(/\s/g, ''); + description = description.replace(/\./g, ''); + return description; + } + static matchToValue(onlyDigitMatch, numbersMap, source) { + if (recognizersTextNumber.StringUtility.isNullOrEmpty(source)) { + return -1; + } + if (recognizersTextNumber.RegExpUtility.isMatch(onlyDigitMatch, source)) { + return Number.parseInt(source); + } + if (source.length === 1) { + return numbersMap.get(source); + } + let value = 1; + for (let index = 0; index < source.length; index++) { + let char = source.charAt(index); + if (char === '十') { + value *= 10; + } + else if (index === 0) { + value *= numbersMap.get(char); + } + else { + value += numbersMap.get(char); + } + } + return value; + } +} +exports.TimeResolutionUtils = TimeResolutionUtils; + +}); + +unwrapExports(baseDateTime$4); + +var durationConfiguration$6 = createCommonjsModule(function (module, exports) { +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); + + + + + + + + + +var DurationType; +(function (DurationType) { + DurationType[DurationType["WithNumber"] = 0] = "WithNumber"; +})(DurationType = exports.DurationType || (exports.DurationType = {})); +class DurationExtractorConfiguration extends recognizersTextNumberWithUnit.ChineseNumberWithUnitExtractorConfiguration { + constructor() { + super(new recognizersTextNumber.CultureInfo(recognizersTextNumber.Culture.Chinese)); + this.extractType = constants$2.Constants.SYS_DATETIME_DURATION; + this.suffixList = chineseDateTime.ChineseDateTime.DurationSuffixList; + this.prefixList = new Map(); + this.ambiguousUnitList = chineseDateTime.ChineseDateTime.DurationAmbiguousUnits; + } +} +class ChineseDurationExtractor extends baseDateTime$4.BaseDateTimeExtractor { + constructor() { + super(null); + this.extractorName = constants$2.Constants.SYS_DATETIME_DURATION; // "Duration"; + this.extractor = new recognizersTextNumberWithUnit.NumberWithUnitExtractor(new DurationExtractorConfiguration()); + this.yearRegex = recognizersText.RegExpUtility.getSafeRegExp(chineseDateTime.ChineseDateTime.DurationYearRegex); + this.halfSuffixRegex = recognizersText.RegExpUtility.getSafeRegExp(chineseDateTime.ChineseDateTime.DurationHalfSuffixRegex); + } + extract(source, refDate) { + if (!refDate) + refDate = new Date(); + let results = new Array(); + this.extractor.extract(source).forEach(result => { + // filter + if (recognizersText.RegExpUtility.isMatch(this.yearRegex, result.text)) { + return; + } + // match suffix + let suffix = source.substr(result.start + result.length); + let suffixMatch = recognizersText.RegExpUtility.getMatches(this.halfSuffixRegex, suffix).pop(); + if (suffixMatch && suffixMatch.index === 0) { + result.text = result.text + suffixMatch.value; + result.length += suffixMatch.length; + } + results.push(result); + }); + return results; + } +} +exports.ChineseDurationExtractor = ChineseDurationExtractor; +class ChineseDurationParserConfiguration { + constructor() { + this.unitValueMap = chineseDateTime.ChineseDateTime.DurationUnitValueMap; + } +} +class DurationParserConfiguration extends recognizersTextNumberWithUnit.ChineseNumberWithUnitParserConfiguration { + constructor() { + super(new recognizersTextNumber.CultureInfo(recognizersTextNumber.Culture.Chinese)); + this.BindDictionary(chineseDateTime.ChineseDateTime.DurationSuffixList); + } +} +class ChineseDurationParser extends baseDuration.BaseDurationParser { + constructor() { + let config = new ChineseDurationParserConfiguration(); + super(config); + this.internalParser = new recognizersTextNumberWithUnit.NumberWithUnitParser(new DurationParserConfiguration()); + } + parse(extractorResult, referenceDate) { + if (!referenceDate) + referenceDate = new Date(); + let resultValue; + if (extractorResult.type === this.parserName) { + let innerResult = new utilities$2.DateTimeResolutionResult(); + let hasHalfSuffix = extractorResult.text.endsWith('半'); + if (hasHalfSuffix) { + extractorResult.length--; + extractorResult.text = extractorResult.text.substr(0, extractorResult.length); + } + let parserResult = this.internalParser.parse(extractorResult); + let unitResult = parserResult.value; + if (!unitResult) { + return new parsers$4.DateTimeParseResult(); + } + let unitStr = unitResult.unit; + let numberStr = unitResult.number; + if (hasHalfSuffix) { + numberStr = (Number.parseFloat(numberStr) + 0.5).toString(); + } + innerResult.timex = `P${this.isLessThanDay(unitStr) ? 'T' : ''}${numberStr}${unitStr.charAt(0)}`; + innerResult.futureValue = Number.parseFloat(numberStr) * this.config.unitValueMap.get(unitStr); + innerResult.pastValue = Number.parseFloat(numberStr) * this.config.unitValueMap.get(unitStr); + innerResult.futureResolution = {}; + innerResult.futureResolution[constants$2.TimeTypeConstants.DURATION] = innerResult.futureValue.toString(); + innerResult.pastResolution = {}; + innerResult.pastResolution[constants$2.TimeTypeConstants.DURATION] = innerResult.pastValue.toString(); + innerResult.success = true; + resultValue = innerResult; + } + let result = new parsers$4.DateTimeParseResult(extractorResult); + result.value = resultValue; + result.timexStr = resultValue ? resultValue.timex : ''; + result.resolutionStr = ''; + return result; + } +} +exports.ChineseDurationParser = ChineseDurationParser; + +}); + +unwrapExports(durationConfiguration$6); + +var timeConfiguration$6 = createCommonjsModule(function (module, exports) { +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); + + + + + + + +var TimeType; +(function (TimeType) { + TimeType[TimeType["ChineseTime"] = 0] = "ChineseTime"; + TimeType[TimeType["LessTime"] = 1] = "LessTime"; + TimeType[TimeType["DigitTime"] = 2] = "DigitTime"; +})(TimeType = exports.TimeType || (exports.TimeType = {})); +class ChineseTimeExtractor extends baseDateTime$4.BaseDateTimeExtractor { + constructor() { + super(new Map([ + [recognizersText.RegExpUtility.getSafeRegExp(chineseDateTime.ChineseDateTime.TimeRegexes1), TimeType.ChineseTime], + [recognizersText.RegExpUtility.getSafeRegExp(chineseDateTime.ChineseDateTime.TimeRegexes2), TimeType.DigitTime], + [recognizersText.RegExpUtility.getSafeRegExp(chineseDateTime.ChineseDateTime.TimeRegexes3), TimeType.LessTime] + ])); + this.extractorName = constants$2.Constants.SYS_DATETIME_TIME; // "Time"; + } +} +exports.ChineseTimeExtractor = ChineseTimeExtractor; +class ChineseTimeParser extends baseTime.BaseTimeParser { + constructor() { + super(null); + this.functionMap = new Map([ + [TimeType.DigitTime, x => this.handleDigit(x)], + [TimeType.ChineseTime, x => this.handleChinese(x)], + [TimeType.LessTime, x => this.handleLess(x)] + ]); + this.onlyDigitMatch = recognizersText.RegExpUtility.getSafeRegExp('\\d+'); + this.numbersMap = chineseDateTime.ChineseDateTime.TimeNumberDictionary; + this.lowBoundMap = chineseDateTime.ChineseDateTime.TimeLowBoundDesc; + this.innerExtractor = new ChineseTimeExtractor(); + } + parse(er, referenceTime) { + if (!referenceTime) + referenceTime = new Date(); + let extra = er.data; + if (!extra) { + let innerResult = this.innerExtractor.extract(er.text, referenceTime).pop(); + extra = innerResult.data; + } + let timeResult = this.functionMap.get(extra.dataType)(extra); + let parseResult = this.packTimeResult(extra, timeResult, referenceTime); + if (parseResult.success) { + parseResult.futureResolution = {}; + parseResult.futureResolution[constants$2.TimeTypeConstants.TIME] = utilities$2.FormatUtil.formatTime(parseResult.futureValue); + parseResult.pastResolution = {}; + parseResult.pastResolution[constants$2.TimeTypeConstants.TIME] = utilities$2.FormatUtil.formatTime(parseResult.pastValue); + } + let result = new parsers$4.DateTimeParseResult(er); + result.value = parseResult; + result.data = timeResult; + result.resolutionStr = ''; + result.timexStr = parseResult.timex; + return result; + } + handleLess(extra) { + let hour = this.matchToValue(extra.namedEntity('hour').value); + let quarter = this.matchToValue(extra.namedEntity('quarter').value); + let minute = !recognizersText.StringUtility.isNullOrEmpty(extra.namedEntity('half').value) + ? 30 + : quarter !== -1 ? quarter * 15 : 0; + let second = this.matchToValue(extra.namedEntity('sec').value); + let less = this.matchToValue(extra.namedEntity('min').value); + let all = hour * 60 + minute - less; + if (all < 0) { + all += 1440; + } + return new baseDateTime$4.TimeResult(all / 60, all % 60, second); + } + handleChinese(extra) { + let hour = this.matchToValue(extra.namedEntity('hour').value); + let quarter = this.matchToValue(extra.namedEntity('quarter').value); + let minute = !recognizersText.StringUtility.isNullOrEmpty(extra.namedEntity('half').value) + ? 30 + : quarter !== -1 ? quarter * 15 + : this.matchToValue(extra.namedEntity('min').value); + let second = this.matchToValue(extra.namedEntity('sec').value); + return new baseDateTime$4.TimeResult(hour, minute, second); + } + handleDigit(extra) { + return new baseDateTime$4.TimeResult(this.matchToValue(extra.namedEntity('hour').value), this.matchToValue(extra.namedEntity('min').value), this.matchToValue(extra.namedEntity('sec').value)); + } + packTimeResult(extra, timeResult, referenceTime) { + let result = new utilities$2.DateTimeResolutionResult(); + let dayDescription = extra.namedEntity('daydesc').value; + let noDescription = recognizersText.StringUtility.isNullOrEmpty(dayDescription); + if (noDescription) { + result.comment = 'ampm'; + } + else { + this.addDescription(timeResult, dayDescription); + } + let hour = timeResult.hour > 0 ? timeResult.hour : 0; + let min = timeResult.minute > 0 ? timeResult.minute : 0; + let sec = timeResult.second > 0 ? timeResult.second : 0; + let day = referenceTime.getDate(); + let month = referenceTime.getMonth(); + let year = referenceTime.getFullYear(); + let timex = 'T'; + if (timeResult.hour >= 0) { + timex = timex + utilities$2.FormatUtil.toString(timeResult.hour, 2); + if (timeResult.minute >= 0) { + timex = timex + ':' + utilities$2.FormatUtil.toString(timeResult.minute, 2); + if (timeResult.second >= 0) { + timex = timex + ':' + utilities$2.FormatUtil.toString(timeResult.second, 2); + } + } + } + if (hour === 24) { + hour = 0; + } + result.futureValue = utilities$2.DateUtils.safeCreateFromMinValue(year, month, day, hour, min, sec); + result.pastValue = utilities$2.DateUtils.safeCreateFromMinValue(year, month, day, hour, min, sec); + result.timex = timex; + result.success = true; + return result; + } + matchToValue(source) { + return baseDateTime$4.TimeResolutionUtils.matchToValue(this.onlyDigitMatch, this.numbersMap, source); + } + addDescription(timeResult, description) { + baseDateTime$4.TimeResolutionUtils.addDescription(this.lowBoundMap, timeResult, description); + } +} +exports.ChineseTimeParser = ChineseTimeParser; + +}); + +unwrapExports(timeConfiguration$6); + +var dateConfiguration$6 = createCommonjsModule(function (module, exports) { +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); + + +const recognizers_text_number_2 = recognizersTextNumber; + + + + + + +class ChineseDateExtractorConfiguration { + constructor() { + this.dateRegexList = [ + recognizersText.RegExpUtility.getSafeRegExp(chineseDateTime.ChineseDateTime.DateRegexList1), + recognizersText.RegExpUtility.getSafeRegExp(chineseDateTime.ChineseDateTime.DateRegexList2), + recognizersText.RegExpUtility.getSafeRegExp(chineseDateTime.ChineseDateTime.DateRegexList3), + recognizersText.RegExpUtility.getSafeRegExp(chineseDateTime.ChineseDateTime.DateRegexList4), + recognizersText.RegExpUtility.getSafeRegExp(chineseDateTime.ChineseDateTime.DateRegexList5), + chineseDateTime.ChineseDateTime.DefaultLanguageFallback === constants$2.Constants.DefaultLanguageFallback_DMY ? + recognizersText.RegExpUtility.getSafeRegExp(chineseDateTime.ChineseDateTime.DateRegexList7) : + recognizersText.RegExpUtility.getSafeRegExp(chineseDateTime.ChineseDateTime.DateRegexList6), + chineseDateTime.ChineseDateTime.DefaultLanguageFallback === constants$2.Constants.DefaultLanguageFallback_DMY ? + recognizersText.RegExpUtility.getSafeRegExp(chineseDateTime.ChineseDateTime.DateRegexList6) : + recognizersText.RegExpUtility.getSafeRegExp(chineseDateTime.ChineseDateTime.DateRegexList7), + recognizersText.RegExpUtility.getSafeRegExp(chineseDateTime.ChineseDateTime.DateRegexList8) + ]; + this.implicitDateList = [ + recognizersText.RegExpUtility.getSafeRegExp(chineseDateTime.ChineseDateTime.LunarRegex), + recognizersText.RegExpUtility.getSafeRegExp(chineseDateTime.ChineseDateTime.SpecialDayRegex), + recognizersText.RegExpUtility.getSafeRegExp(chineseDateTime.ChineseDateTime.DateThisRegex), + recognizersText.RegExpUtility.getSafeRegExp(chineseDateTime.ChineseDateTime.DateLastRegex), + recognizersText.RegExpUtility.getSafeRegExp(chineseDateTime.ChineseDateTime.DateNextRegex), + recognizersText.RegExpUtility.getSafeRegExp(chineseDateTime.ChineseDateTime.WeekDayRegex), + recognizersText.RegExpUtility.getSafeRegExp(chineseDateTime.ChineseDateTime.WeekDayOfMonthRegex), + recognizersText.RegExpUtility.getSafeRegExp(chineseDateTime.ChineseDateTime.SpecialDate) + ]; + } +} +class ChineseDateExtractor extends baseDate.BaseDateExtractor { + constructor() { + super(new ChineseDateExtractorConfiguration()); + this.durationExtractor = new durationConfiguration$6.ChineseDurationExtractor(); + } + extract(source, refDate) { + if (!refDate) + refDate = new Date(); + let referenceDate = refDate; + let tokens = new Array() + .concat(super.basicRegexMatch(source)) + .concat(super.implicitDate(source)) + .concat(this.durationWithBeforeAndAfter(source, referenceDate)); + let result = utilities$2.Token.mergeAllTokens(tokens, source, this.extractorName); + return result; + } + durationWithBeforeAndAfter(source, refDate) { + let ret = []; + let durEx = this.durationExtractor.extract(source, refDate); + durEx.forEach(er => { + let pos = er.start + er.length; + if (pos < source.length) { + let nextChar = source.substr(pos, 1); + if (nextChar === '前' || nextChar === '后') { + ret.push(new utilities$2.Token(er.start, pos + 1)); + } + } + }); + return ret; + } +} +exports.ChineseDateExtractor = ChineseDateExtractor; +class ChineseDateParserConfiguration { + getSwiftDay(source) { + let trimmedSource = source.trim().toLowerCase(); + let swift = 0; + if (trimmedSource === '今天' || trimmedSource === '今日' || trimmedSource === '最近') { + swift = 0; + } + else if (trimmedSource.startsWith('明')) { + swift = 1; + } + else if (trimmedSource.startsWith('昨')) { + swift = -1; + } + else if (trimmedSource === '大后天' || trimmedSource === '大後天') { + swift = 3; + } + else if (trimmedSource === '大前天') { + swift = -3; + } + else if (trimmedSource === '后天' || trimmedSource === '後天') { + swift = 2; + } + else if (trimmedSource === '前天') { + swift = -2; + } + return swift; + } + getSwiftMonth(source) { + let trimmedSource = source.trim().toLowerCase(); + let swift = 0; + if (trimmedSource.startsWith(chineseDateTime.ChineseDateTime.ParserConfigurationNextMonthToken)) { + swift = 1; + } + else if (trimmedSource.startsWith(chineseDateTime.ChineseDateTime.ParserConfigurationLastMonthToken)) { + swift = -1; + } + return swift; + } + getSwift(source) { + return null; + } + isCardinalLast(source) { + return source === chineseDateTime.ChineseDateTime.ParserConfigurationLastWeekDayToken; + } + constructor() { + this.dateRegex = new ChineseDateExtractorConfiguration().dateRegexList; + this.monthOfYear = chineseDateTime.ChineseDateTime.ParserConfigurationMonthOfYear; + this.dayOfMonth = chineseDateTime.ChineseDateTime.ParserConfigurationDayOfMonth; + this.dayOfWeek = chineseDateTime.ChineseDateTime.ParserConfigurationDayOfWeek; + this.specialDayRegex = recognizersText.RegExpUtility.getSafeRegExp(chineseDateTime.ChineseDateTime.SpecialDayRegex); + this.specialDayWithNumRegex = recognizersText.RegExpUtility.getSafeRegExp(chineseDateTime.ChineseDateTime.SpecialDayWithNumRegex); + this.thisRegex = recognizersText.RegExpUtility.getSafeRegExp(chineseDateTime.ChineseDateTime.DateThisRegex); + this.nextRegex = recognizersText.RegExpUtility.getSafeRegExp(chineseDateTime.ChineseDateTime.DateNextRegex); + this.lastRegex = recognizersText.RegExpUtility.getSafeRegExp(chineseDateTime.ChineseDateTime.DateLastRegex); + this.weekDayRegex = recognizersText.RegExpUtility.getSafeRegExp(chineseDateTime.ChineseDateTime.WeekDayRegex); + this.integerExtractor = new recognizersTextNumber.ChineseIntegerExtractor(); + this.numberParser = recognizersTextNumber.AgnosticNumberParserFactory.getParser(recognizersTextNumber.AgnosticNumberParserType.Number, new recognizersTextNumber.ChineseNumberParserConfiguration()); + } +} +class ChineseDateParser extends baseDate.BaseDateParser { + constructor() { + let config = new ChineseDateParserConfiguration(); + super(config); + this.lunarRegex = recognizersText.RegExpUtility.getSafeRegExp(chineseDateTime.ChineseDateTime.LunarRegex); + this.specialDateRegex = recognizersText.RegExpUtility.getSafeRegExp(chineseDateTime.ChineseDateTime.SpecialDate); + this.tokenNextRegex = recognizersText.RegExpUtility.getSafeRegExp(chineseDateTime.ChineseDateTime.DateNextRe); + this.tokenLastRegex = recognizersText.RegExpUtility.getSafeRegExp(chineseDateTime.ChineseDateTime.DateLastRe); + this.monthMaxDays = [31, 29, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31]; + } + parse(extractorResult, referenceDate) { + if (!referenceDate) + referenceDate = new Date(); + let resultValue; + if (extractorResult.type === this.parserName) { + let source = extractorResult.text.toLowerCase(); + let innerResult = this.parseBasicRegexMatch(source, referenceDate); + if (!innerResult.success) { + innerResult = this.parseImplicitDate(source, referenceDate); + } + if (!innerResult.success) { + innerResult = this.parseWeekdayOfMonth(source, referenceDate); + } + if (!innerResult.success) { + // TODO create test + innerResult = this.parserDurationWithAgoAndLater(source, referenceDate); + } + if (innerResult.success) { + innerResult.futureResolution = {}; + innerResult.futureResolution[constants$2.TimeTypeConstants.DATE] = utilities$2.FormatUtil.formatDate(innerResult.futureValue); + innerResult.pastResolution = {}; + innerResult.pastResolution[constants$2.TimeTypeConstants.DATE] = utilities$2.FormatUtil.formatDate(innerResult.pastValue); + innerResult.isLunar = this.parseLunarCalendar(source); + resultValue = innerResult; + } + } + let result = new parsers$4.DateTimeParseResult(extractorResult); + result.value = resultValue; + result.timexStr = resultValue ? resultValue.timex : ''; + result.resolutionStr = ''; + return result; + } + parseLunarCalendar(source) { + return recognizersText.RegExpUtility.isMatch(this.lunarRegex, source.trim()); + } + parseBasicRegexMatch(source, referenceDate) { + let trimmedSource = source.trim(); + let result = new utilities$2.DateTimeResolutionResult(); + this.config.dateRegex.some(regex => { + let match = recognizersText.RegExpUtility.getMatches(regex, trimmedSource).pop(); + if (match && match.index === 0 && match.length === trimmedSource.length) { + result = this.matchToDate(match, referenceDate); + return true; + } + }); + return result; + } + parseImplicitDate(source, referenceDate) { + let trimmedSource = source.trim(); + let result = new utilities$2.DateTimeResolutionResult(); + // handle "on 12" + let match = recognizersText.RegExpUtility.getMatches(this.specialDateRegex, trimmedSource).pop(); + if (match && match.length === trimmedSource.length) { + let day = 0; + let month = referenceDate.getMonth(); + let year = referenceDate.getFullYear(); + let yearStr = match.groups('thisyear').value; + let monthStr = match.groups('thismonth').value; + let dayStr = match.groups('day').value; + day = this.config.dayOfMonth.get(dayStr); + let hasYear = !recognizersText.StringUtility.isNullOrEmpty(yearStr); + let hasMonth = !recognizersText.StringUtility.isNullOrEmpty(monthStr); + if (hasMonth) { + if (recognizersText.RegExpUtility.isMatch(this.tokenNextRegex, monthStr)) { + month++; + if (month === 12) { + month = 0; + year++; + } + } + else if (recognizersText.RegExpUtility.isMatch(this.tokenLastRegex, monthStr)) { + month--; + if (month === -1) { + month = 12; + year--; + } + } + if (hasYear) { + if (recognizersText.RegExpUtility.isMatch(this.tokenNextRegex, yearStr)) { + year++; + } + else if (recognizersText.RegExpUtility.isMatch(this.tokenLastRegex, yearStr)) { + year--; + } + } + } + result.timex = utilities$2.FormatUtil.luisDate(hasYear ? year : -1, hasMonth ? month : -1, day); + let futureDate; + let pastDate; + if (day > this.monthMaxDays[month]) { + futureDate = utilities$2.DateUtils.safeCreateFromMinValue(year, month + 1, day); + pastDate = utilities$2.DateUtils.safeCreateFromMinValue(year, month - 1, day); + } + else { + futureDate = utilities$2.DateUtils.safeCreateFromMinValue(year, month, day); + pastDate = utilities$2.DateUtils.safeCreateFromMinValue(year, month, day); + if (!hasMonth) { + if (futureDate < referenceDate) + futureDate = utilities$2.DateUtils.addMonths(futureDate, 1); + if (pastDate >= referenceDate) + pastDate = utilities$2.DateUtils.addMonths(pastDate, -1); + } + else if (hasMonth && !hasYear) { + if (futureDate < referenceDate) + futureDate = utilities$2.DateUtils.addYears(futureDate, 1); + if (pastDate >= referenceDate) + pastDate = utilities$2.DateUtils.addYears(pastDate, -1); + } + } + result.futureValue = futureDate; + result.pastValue = pastDate; + result.success = true; + return result; + } + // handle cases like "昨日", "明日", "大后天" + match = recognizersText.RegExpUtility.getMatches(this.config.specialDayRegex, trimmedSource).pop(); + if (match && match.index === 0 && match.length === trimmedSource.length) { + let swift = this.config.getSwiftDay(match.value); + let value = utilities$2.DateUtils.addDays(referenceDate, swift); + result.timex = utilities$2.FormatUtil.luisDateFromDate(value); + result.futureValue = value; + result.pastValue = value; + result.success = true; + return result; + } + // handle "this Friday" + match = recognizersText.RegExpUtility.getMatches(this.config.thisRegex, trimmedSource).pop(); + if (match && match.index === 0 && match.length === trimmedSource.length) { + let weekdayStr = match.groups('weekday').value; + let value = utilities$2.DateUtils.this(referenceDate, this.config.dayOfWeek.get(weekdayStr)); + result.timex = utilities$2.FormatUtil.luisDateFromDate(value); + result.futureValue = value; + result.pastValue = value; + result.success = true; + return result; + } + // handle "next Sunday" + match = recognizersText.RegExpUtility.getMatches(this.config.nextRegex, trimmedSource).pop(); + if (match && match.index === 0 && match.length === trimmedSource.length) { + let weekdayStr = match.groups('weekday').value; + let value = utilities$2.DateUtils.next(referenceDate, this.config.dayOfWeek.get(weekdayStr)); + result.timex = utilities$2.FormatUtil.luisDateFromDate(value); + result.futureValue = value; + result.pastValue = value; + result.success = true; + return result; + } + // handle "last Friday", "last mon" + match = recognizersText.RegExpUtility.getMatches(this.config.lastRegex, trimmedSource).pop(); + if (match && match.index === 0 && match.length === trimmedSource.length) { + let weekdayStr = match.groups('weekday').value; + let value = utilities$2.DateUtils.last(referenceDate, this.config.dayOfWeek.get(weekdayStr)); + result.timex = utilities$2.FormatUtil.luisDateFromDate(value); + result.futureValue = value; + result.pastValue = value; + result.success = true; + return result; + } + // handle "Friday" + match = recognizersText.RegExpUtility.getMatches(this.config.weekDayRegex, trimmedSource).pop(); + if (match && match.index === 0 && match.length === trimmedSource.length) { + let weekdayStr = match.groups('weekday').value; + let weekday = this.config.dayOfWeek.get(weekdayStr); + let value = utilities$2.DateUtils.this(referenceDate, weekday); + if (weekday === 0) + weekday = 7; + if (weekday < referenceDate.getDay()) + value = utilities$2.DateUtils.next(referenceDate, weekday); + result.timex = 'XXXX-WXX-' + weekday; + let futureDate = new Date(value); + let pastDate = new Date(value); + if (futureDate < referenceDate) + futureDate = utilities$2.DateUtils.addDays(futureDate, 7); + if (pastDate >= referenceDate) + pastDate = utilities$2.DateUtils.addDays(pastDate, -7); + result.futureValue = futureDate; + result.pastValue = pastDate; + result.success = true; + return result; + } + return result; + } + matchToDate(match, referenceDate) { + let result = new utilities$2.DateTimeResolutionResult(); + let yearStr = match.groups('year').value; + let yearChs = match.groups('yearchs').value; + let monthStr = match.groups('month').value; + let dayStr = match.groups('day').value; + let month = 0; + let day = 0; + let year = 0; + let yearTemp = this.convertChineseYearToNumber(yearChs); + year = yearTemp === -1 ? 0 : yearTemp; + if (this.config.monthOfYear.has(monthStr) && this.config.dayOfMonth.has(dayStr)) { + month = this.getMonthOfYear(monthStr); + day = this.getDayOfMonth(dayStr); + if (!recognizersText.StringUtility.isNullOrEmpty(yearStr)) { + year = Number.parseInt(yearStr, 10); + if (year < 100 && year >= constants$2.Constants.MinTwoDigitYearPastNum) + year += 1900; + else if (year >= 0 && year < constants$2.Constants.MaxTwoDigitYearFutureNum) + year += 2000; + } + } + let noYear = false; + if (year === 0) { + year = referenceDate.getFullYear(); + result.timex = utilities$2.FormatUtil.luisDate(-1, month, day); + noYear = true; + } + else { + result.timex = utilities$2.FormatUtil.luisDate(year, month, day); + } + let futureDate = utilities$2.DateUtils.safeCreateFromMinValue(year, month, day); + let pastDate = utilities$2.DateUtils.safeCreateFromMinValue(year, month, day); + if (noYear && futureDate < referenceDate) { + futureDate = utilities$2.DateUtils.safeCreateFromMinValue(year + 1, month, day); + } + if (noYear && pastDate >= referenceDate) { + pastDate = utilities$2.DateUtils.safeCreateFromMinValue(year - 1, month, day); + } + result.futureValue = futureDate; + result.pastValue = pastDate; + result.success = true; + return result; + } + convertChineseYearToNumber(source) { + let year = 0; + let er = this.config.integerExtractor.extract(source).pop(); + if (er && er.type === recognizers_text_number_2.Constants.SYS_NUM_INTEGER) { + year = Number.parseInt(this.config.numberParser.parse(er).value); + } + if (year < 10) { + year = 0; + for (let i = 0; i < source.length; i++) { + let char = source.charAt(i); + year *= 10; + let er = this.config.integerExtractor.extract(char).pop(); + if (er && er.type === recognizers_text_number_2.Constants.SYS_NUM_INTEGER) { + year += Number.parseInt(this.config.numberParser.parse(er).value); + } + } + } + return year < 10 ? -1 : year; + } + getMonthOfYear(source) { + let month = this.config.monthOfYear.get(source) > 12 + ? this.config.monthOfYear.get(source) % 12 + : this.config.monthOfYear.get(source); + return month - 1; + } + getDayOfMonth(source) { + return this.config.dayOfMonth.get(source) > 31 + ? this.config.dayOfMonth.get(source) % 31 + : this.config.dayOfMonth.get(source); + } +} +exports.ChineseDateParser = ChineseDateParser; + +}); + +unwrapExports(dateConfiguration$6); + +var dateTimeConfiguration$6 = createCommonjsModule(function (module, exports) { +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); + + + + + + + + +class ChineseDateTimeExtractorConfiguration { + constructor() { + this.datePointExtractor = new dateConfiguration$6.ChineseDateExtractor(); + this.timePointExtractor = new timeConfiguration$6.ChineseTimeExtractor(); + this.prepositionRegex = recognizersText.RegExpUtility.getSafeRegExp(chineseDateTime.ChineseDateTime.PrepositionRegex); + this.nowRegex = recognizersText.RegExpUtility.getSafeRegExp(chineseDateTime.ChineseDateTime.NowRegex); + this.nightRegex = recognizersText.RegExpUtility.getSafeRegExp(chineseDateTime.ChineseDateTime.NightRegex); + this.timeOfTodayBeforeRegex = recognizersText.RegExpUtility.getSafeRegExp(chineseDateTime.ChineseDateTime.TimeOfTodayRegex); + } + isConnectorToken(source) { + return recognizersText.StringUtility.isNullOrEmpty(source) + || source === ',' + || recognizersText.RegExpUtility.isMatch(this.prepositionRegex, source); + } +} +class ChineseDateTimeExtractor extends baseDateTime$2.BaseDateTimeExtractor { + constructor() { + super(new ChineseDateTimeExtractorConfiguration()); + } + extract(source, refDate) { + if (!refDate) + refDate = new Date(); + let referenceDate = refDate; + let tokens = new Array() + .concat(this.mergeDateAndTime(source, referenceDate)) + .concat(this.basicRegexMatch(source)) + .concat(this.timeOfToday(source, referenceDate)); + let result = utilities$2.Token.mergeAllTokens(tokens, source, this.extractorName); + return result; + } + mergeDateAndTime(source, refDate) { + let tokens = new Array(); + let ers = this.config.datePointExtractor.extract(source, refDate); + if (ers.length < 1) + return tokens; + ers = ers.concat(this.config.timePointExtractor.extract(source, refDate)); + if (ers.length < 2) + return tokens; + ers = ers.sort((erA, erB) => erA.start < erB.start ? -1 : erA.start === erB.start ? 0 : 1); + let i = 0; + while (i < ers.length - 1) { + let j = i + 1; + while (j < ers.length && recognizersText.ExtractResult.isOverlap(ers[i], ers[j])) { + j++; + } + if (j >= ers.length) + break; + if (ers[i].type === constants$2.Constants.SYS_DATETIME_DATE && ers[j].type === constants$2.Constants.SYS_DATETIME_TIME) { + let middleBegin = ers[i].start + ers[i].length; + let middleEnd = ers[j].start; + if (middleBegin > middleEnd) { + continue; + } + let middleStr = source.substr(middleBegin, middleEnd - middleBegin).trim().toLowerCase(); + if (this.config.isConnectorToken(middleStr)) { + let begin = ers[i].start; + let end = ers[j].start + ers[j].length; + tokens.push(new utilities$2.Token(begin, end)); + } + i = j + 1; + continue; + } + i = j; + } + return tokens; + } + timeOfToday(source, refDate) { + let tokens = new Array(); + this.config.timePointExtractor.extract(source, refDate).forEach(er => { + let beforeStr = source.substr(0, er.start); + let innerMatch = recognizersText.RegExpUtility.getMatches(this.config.nightRegex, er.text).pop(); + if (innerMatch && innerMatch.index === 0) { + beforeStr = source.substr(0, er.start + innerMatch.length); + } + if (recognizersText.StringUtility.isNullOrWhitespace(beforeStr)) + return; + let match = recognizersText.RegExpUtility.getMatches(this.config.timeOfTodayBeforeRegex, beforeStr).pop(); + if (match && recognizersText.StringUtility.isNullOrWhitespace(beforeStr.substr(match.index + match.length))) { + let begin = match.index; + let end = er.start + er.length; + tokens.push(new utilities$2.Token(begin, end)); + } + }); + return tokens; + } +} +exports.ChineseDateTimeExtractor = ChineseDateTimeExtractor; +class ChineseDateTimeParserConfiguration { + constructor() { + this.dateExtractor = new dateConfiguration$6.ChineseDateExtractor(); + this.timeExtractor = new timeConfiguration$6.ChineseTimeExtractor(); + this.dateParser = new dateConfiguration$6.ChineseDateParser(); + this.timeParser = new timeConfiguration$6.ChineseTimeParser(); + this.pmTimeRegex = recognizersText.RegExpUtility.getSafeRegExp(chineseDateTime.ChineseDateTime.DateTimeSimplePmRegex); + this.amTimeRegex = recognizersText.RegExpUtility.getSafeRegExp(chineseDateTime.ChineseDateTime.DateTimeSimpleAmRegex); + this.specificTimeOfDayRegex = recognizersText.RegExpUtility.getSafeRegExp(chineseDateTime.ChineseDateTime.TimeOfTodayRegex); + this.nowRegex = recognizersText.RegExpUtility.getSafeRegExp(chineseDateTime.ChineseDateTime.NowRegex); + } + haveAmbiguousToken(text, matchedText) { + return null; + } + getMatchedNowTimex(text) { + let trimmedText = text.trim().toLowerCase(); + if (trimmedText.endsWith('现在')) { + return { matched: true, timex: 'PRESENT_REF' }; + } + else if (trimmedText === '刚刚才' || trimmedText === '刚刚' || trimmedText === '刚才') { + return { matched: true, timex: 'PAST_REF' }; + } + else if (trimmedText === '立刻' || trimmedText === '马上') { + return { matched: true, timex: 'FUTURE_REF' }; + } + return { matched: false, timex: null }; + } + getSwiftDay(text) { + let swift = 0; + if (text === '明晚' || text === '明早' || text === '明晨') { + swift = 1; + } + else if (text === '昨晚') { + swift = -1; + } + return swift; + } + getHour(text, hour) { + let result = hour; + if (hour < 12 && ['今晚', '明晚', '昨晚'].some(o => o === text)) { + result += 12; + } + else if (hour >= 12 && ['今早', '今晨', '明早', '明晨'].some(o => o === text)) { + result -= 12; + } + return result; + } +} +class ChineseDateTimeParser extends baseDateTime$2.BaseDateTimeParser { + constructor() { + let config = new ChineseDateTimeParserConfiguration(); + super(config); + } + parse(er, refTime) { + if (!refTime) + refTime = new Date(); + let referenceTime = refTime; + let value = null; + if (er.type === baseDateTime$2.BaseDateTimeParser.ParserName) { + let innerResult = this.mergeDateAndTime(er.text, referenceTime); + if (!innerResult.success) { + innerResult = this.parseBasicRegex(er.text, referenceTime); + } + if (!innerResult.success) { + innerResult = this.parseTimeOfToday(er.text, referenceTime); + } + if (innerResult.success) { + innerResult.futureResolution = {}; + innerResult.futureResolution[constants$2.TimeTypeConstants.DATETIME] = utilities$2.FormatUtil.formatDateTime(innerResult.futureValue); + innerResult.pastResolution = {}; + innerResult.pastResolution[constants$2.TimeTypeConstants.DATETIME] = utilities$2.FormatUtil.formatDateTime(innerResult.pastValue); + value = innerResult; + } + } + let ret = new parsers$4.DateTimeParseResult(er); + { + ret.value = value, ret.timexStr = value === null ? "" : value.timex, ret.resolutionStr = ""; + } + + return ret; + } + // merge a Date entity and a Time entity + mergeDateAndTime(text, referenceTime) { + let ret = new utilities$2.DateTimeResolutionResult(); + let er1 = this.config.dateExtractor.extract(text, referenceTime); + if (er1.length === 0) { + return ret; + } + let er2 = this.config.timeExtractor.extract(text, referenceTime); + if (er2.length === 0) { + return ret; + } + let pr1 = this.config.dateParser.parse(er1[0], new Date(referenceTime.toDateString())); + let pr2 = this.config.timeParser.parse(er2[0], referenceTime); + if (pr1.value === null || pr2.value === null) { + return ret; + } + let futureDate = pr1.value.futureValue; + let pastDate = pr1.value.pastValue; + let time = pr2.value.futureValue; + let hour = time.getHours(); + let min = time.getMinutes(); + let sec = time.getSeconds(); + // handle morning, afternoon + if (recognizersText.RegExpUtility.getMatches(this.config.pmTimeRegex, text).length && hour < 12) { + hour += 12; + } + else if (recognizersText.RegExpUtility.getMatches(this.config.amTimeRegex, text).length && hour >= 12) { + hour -= 12; + } + let timeStr = pr2.timexStr; + if (timeStr.endsWith("ampm")) { + timeStr = timeStr.substring(0, timeStr.length - 4); + } + timeStr = "T" + utilities$2.FormatUtil.toString(hour, 2) + timeStr.substring(3); + ret.timex = pr1.timexStr + timeStr; + let val = pr2.value; + if (hour <= 12 && !recognizersText.RegExpUtility.getMatches(this.config.pmTimeRegex, text).length + && !recognizersText.RegExpUtility.getMatches(this.config.amTimeRegex, text).length && val.comment) { + ret.comment = "ampm"; + } + ret.futureValue = new Date(futureDate.getFullYear(), futureDate.getMonth(), futureDate.getDate(), hour, min, sec); + ret.pastValue = new Date(pastDate.getFullYear(), pastDate.getMonth(), pastDate.getDate(), hour, min, sec); + ret.success = true; + return ret; + } + parseTimeOfToday(text, referenceTime) { + let ret = new utilities$2.DateTimeResolutionResult(); + let ers = this.config.timeExtractor.extract(text, referenceTime); + if (ers.length !== 1) { + return ret; + } + let pr = this.config.timeParser.parse(ers[0], referenceTime); + if (pr.value === null) { + return ret; + } + let time = pr.value.futureValue; + let hour = time.getHours(); + let min = time.getMinutes(); + let sec = time.getSeconds(); + let timeStr = pr.timexStr; + let match = recognizersText.RegExpUtility.getMatches(this.config.specificTimeOfDayRegex, text).pop(); + if (match) { + let matchStr = match.value.toLowerCase(); + // handle "last", "next" + let swift = this.config.getSwiftDay(matchStr); + let date = utilities$2.DateUtils.addDays(referenceTime, swift); + hour = this.config.getHour(matchStr, hour); + // in this situation, luisStr cannot end up with "ampm", because we always have a "morning" or "night" + if (timeStr.endsWith("ampm")) { + timeStr = timeStr.substring(0, timeStr.length - 4); + } + timeStr = "T" + utilities$2.FormatUtil.toString(hour, 2) + timeStr.substring(3); + ret.timex = utilities$2.FormatUtil.formatDate(date) + timeStr; + ret.futureValue = ret.pastValue = new Date(date.getFullYear(), date.getMonth(), date.getDate(), hour, min, sec); + ret.success = true; + return ret; + } + return ret; + } +} +exports.ChineseDateTimeParser = ChineseDateTimeParser; + +}); + +unwrapExports(dateTimeConfiguration$6); + +var timePeriodConfiguration$6 = createCommonjsModule(function (module, exports) { +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); + + + + + + + + + +var TimePeriodType; +(function (TimePeriodType) { + TimePeriodType[TimePeriodType["ShortTime"] = 0] = "ShortTime"; + TimePeriodType[TimePeriodType["FullTime"] = 1] = "FullTime"; +})(TimePeriodType = exports.TimePeriodType || (exports.TimePeriodType = {})); +class ChineseTimePeriodExtractor extends baseDateTime$4.BaseDateTimeExtractor { + constructor() { + super(new Map([ + [recognizersText.RegExpUtility.getSafeRegExp(chineseDateTime.ChineseDateTime.TimePeriodRegexes1), TimePeriodType.FullTime], + [recognizersText.RegExpUtility.getSafeRegExp(chineseDateTime.ChineseDateTime.TimePeriodRegexes2), TimePeriodType.ShortTime], + [recognizersText.RegExpUtility.getSafeRegExp(chineseDateTime.ChineseDateTime.TimeOfDayRegex), TimePeriodType.ShortTime] + ])); + this.extractorName = constants$2.Constants.SYS_DATETIME_TIMEPERIOD; // "time range"; + } +} +exports.ChineseTimePeriodExtractor = ChineseTimePeriodExtractor; +class ChineseTimePeriodParserConfiguration { + constructor() { + this.timeParser = new timeConfiguration$6.ChineseTimeParser(); + this.integerExtractor = new recognizersTextNumber.EnglishIntegerExtractor(); + } + getMatchedTimexRange(text) { return null; } +} +class ChineseTimePeriodParser extends baseTimePeriod.BaseTimePeriodParser { + constructor() { + let config = new ChineseTimePeriodParserConfiguration(); + super(config); + this.dayDescriptionRegex = recognizersText.RegExpUtility.getSafeRegExp(chineseDateTime.ChineseDateTime.TimeDayDescRegex); + this.onlyDigitMatch = recognizersText.RegExpUtility.getSafeRegExp('\\d+'); + this.numbersMap = chineseDateTime.ChineseDateTime.TimeNumberDictionary; + this.lowBoundMap = chineseDateTime.ChineseDateTime.TimeLowBoundDesc; + } + parse(er, referenceTime) { + if (!referenceTime) + referenceTime = new Date(); + let result = new parsers$4.DateTimeParseResult(er); + let extra = er.data; + if (!extra) { + return result; + } + let parseResult = this.parseChineseTimeOfDay(er.text, referenceTime); + if (!parseResult.success) { + parseResult = this.parseTimePeriod(extra, referenceTime); + } + if (parseResult.success) { + parseResult.futureResolution = {}; + parseResult.futureResolution[constants$2.TimeTypeConstants.START_TIME] = utilities$2.FormatUtil.formatTime(parseResult.futureValue.item1); + parseResult.futureResolution[constants$2.TimeTypeConstants.END_TIME] = utilities$2.FormatUtil.formatTime(parseResult.futureValue.item2); + parseResult.pastResolution = {}; + parseResult.pastResolution[constants$2.TimeTypeConstants.START_TIME] = utilities$2.FormatUtil.formatTime(parseResult.pastValue.item1); + parseResult.pastResolution[constants$2.TimeTypeConstants.END_TIME] = utilities$2.FormatUtil.formatTime(parseResult.pastValue.item2); + } + result.value = parseResult; + result.resolutionStr = ''; + result.timexStr = parseResult.timex; + return result; + } + parseChineseTimeOfDay(text, referenceTime) { + let day = referenceTime.getDay(), month = referenceTime.getMonth(), year = referenceTime.getFullYear(); + let ret = new utilities$2.DateTimeResolutionResult(); + let parameters = this.GetMatchedTimexRange(text); + if (!parameters.matched) { + return new utilities$2.DateTimeResolutionResult(); + } + ret.timex = parameters.timex; + ret.futureValue = ret.pastValue = { + item1: utilities$2.DateUtils.safeCreateFromMinValue(year, month, day, parameters.beginHour, 0, 0), + item2: utilities$2.DateUtils.safeCreateFromMinValue(year, month, day, parameters.endHour, parameters.endMin, 0) + }; + ret.success = true; + return ret; + } + GetMatchedTimexRange(text) { + let trimmedText = text.trim(), matched = false, timex = null, beginHour = 0, endHour = 0, endMin = 0; + if (trimmedText.endsWith("上午")) { + timex = "TMO"; + beginHour = 8; + endHour = 12; + } + else if (trimmedText.endsWith("下午")) { + timex = "TAF"; + beginHour = 12; + endHour = 16; + } + else if (trimmedText.endsWith("晚上")) { + timex = "TEV"; + beginHour = 16; + endHour = 20; + } + else if (trimmedText.localeCompare("白天") == 0) { + timex = "TDT"; + beginHour = 8; + endHour = 18; + } + else if (trimmedText.endsWith("深夜")) { + timex = "TNI"; + beginHour = 20; + endHour = 23; + endMin = 59; + } + else { + timex = null; + matched = false; + return { matched, timex, beginHour, endHour, endMin }; + } + matched = true; + return { matched, timex, beginHour, endHour, endMin }; + } + parseTimePeriod(extra, referenceTime) { + let result = new utilities$2.DateTimeResolutionResult(); + let leftEntity = extra.namedEntity('left'); + let leftResult = extra.dataType === TimePeriodType.FullTime + ? this.getParseTimeResult(leftEntity, referenceTime) + : this.getShortLeft(leftEntity.value); + let rightEntity = extra.namedEntity('right'); + let rightResult = this.getParseTimeResult(rightEntity, referenceTime); + // the right side doesn't contain desc while the left side does + if (rightResult.lowBound === -1 && leftResult.lowBound !== -1 && rightResult.hour <= leftResult.lowBound) { + rightResult.hour += 12; + } + let leftDate = this.buildDate(leftResult, referenceTime); + let rightDate = this.buildDate(rightResult, referenceTime); + if (rightDate.getHours() < leftDate.getHours()) { + rightDate = utilities$2.DateUtils.addDays(rightDate, 1); + } + result.futureValue = result.pastValue = { + item1: leftDate, + item2: rightDate + }; + let leftTimex = this.buildTimex(leftResult); + let rightTimex = this.buildTimex(rightResult); + let spanTimex = this.buildSpan(leftResult, rightResult); + result.timex = `(${leftTimex},${rightTimex},${spanTimex})`; + result.success = true; + return result; + } + getParseTimeResult(entity, referenceTime) { + let extractResult = { + start: entity.index, + length: entity.length, + text: entity.value, + type: constants$2.Constants.SYS_DATETIME_TIME + }; + let result = this.config.timeParser.parse(extractResult, referenceTime); + return result.data; + } + getShortLeft(source) { + let description = ''; + if (recognizersText.RegExpUtility.isMatch(this.dayDescriptionRegex, source)) { + description = source.substr(0, source.length - 1); + } + let hour = baseDateTime$4.TimeResolutionUtils.matchToValue(this.onlyDigitMatch, this.numbersMap, source.substr(source.length - 1)); + let timeResult = new baseDateTime$4.TimeResult(hour, -1, -1); + baseDateTime$4.TimeResolutionUtils.addDescription(this.lowBoundMap, timeResult, description); + return timeResult; + } + buildDate(time, referenceTime) { + let day = referenceTime.getDate(); + let month = referenceTime.getMonth(); + let year = referenceTime.getFullYear(); + let hour = time.hour > 0 ? time.hour : 0; + let min = time.minute > 0 ? time.minute : 0; + let sec = time.second > 0 ? time.second : 0; + return utilities$2.DateUtils.safeCreateFromMinValue(year, month, day, hour, min, sec); + } + buildTimex(timeResult) { + let timex = 'T'; + if (timeResult.hour >= 0) { + timex = timex + utilities$2.FormatUtil.toString(timeResult.hour, 2); + if (timeResult.minute >= 0) { + timex = timex + ':' + utilities$2.FormatUtil.toString(timeResult.minute, 2); + if (timeResult.second >= 0) { + timex = timex + ':' + utilities$2.FormatUtil.toString(timeResult.second, 2); + } + } + } + return timex; + } + buildSpan(left, right) { + left = this.sanitizeTimeResult(left); + right = this.sanitizeTimeResult(right); + let spanHour = right.hour - left.hour; + let spanMin = right.minute - left.minute; + let spanSec = right.second - left.second; + if (spanSec < 0) { + spanSec += 60; + spanMin -= 1; + } + if (spanMin < 0) { + spanMin += 60; + spanHour -= 1; + } + if (spanHour < 0) { + spanHour += 24; + } + let spanTimex = `PT${spanHour}H`; + if (spanMin !== 0 && spanSec === 0) { + spanTimex = spanTimex + `${spanMin}M`; + } + else if (spanSec !== 0) { + spanTimex = spanTimex + `${spanMin}M${spanSec}S`; + } + return spanTimex; + } + sanitizeTimeResult(timeResult) { + return new baseDateTime$4.TimeResult(timeResult.hour, timeResult.minute === -1 ? 0 : timeResult.minute, timeResult.second === -1 ? 0 : timeResult.second); + } +} +exports.ChineseTimePeriodParser = ChineseTimePeriodParser; + +}); + +unwrapExports(timePeriodConfiguration$6); + +var datePeriodConfiguration$6 = createCommonjsModule(function (module, exports) { +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); + + +const recognizers_text_number_2 = recognizersTextNumber; + + + + + + + + +class ChineseDatePeriodExtractorConfiguration { + constructor() { + this.simpleCasesRegexes = [ + recognizersText.RegExpUtility.getSafeRegExp(chineseDateTime.ChineseDateTime.SimpleCasesRegex), + recognizersText.RegExpUtility.getSafeRegExp(chineseDateTime.ChineseDateTime.OneWordPeriodRegex), + recognizersText.RegExpUtility.getSafeRegExp(chineseDateTime.ChineseDateTime.StrictYearRegex), + recognizersText.RegExpUtility.getSafeRegExp(chineseDateTime.ChineseDateTime.YearToYear), + recognizersText.RegExpUtility.getSafeRegExp(chineseDateTime.ChineseDateTime.YearToYearSuffixRequired), + recognizersText.RegExpUtility.getSafeRegExp(chineseDateTime.ChineseDateTime.YearAndMonth), + recognizersText.RegExpUtility.getSafeRegExp(chineseDateTime.ChineseDateTime.PureNumYearAndMonth), + recognizersText.RegExpUtility.getSafeRegExp(chineseDateTime.ChineseDateTime.DatePeriodYearInChineseRegex), + recognizersText.RegExpUtility.getSafeRegExp(chineseDateTime.ChineseDateTime.WeekOfMonthRegex), + recognizersText.RegExpUtility.getSafeRegExp(chineseDateTime.ChineseDateTime.SeasonWithYear), + recognizersText.RegExpUtility.getSafeRegExp(chineseDateTime.ChineseDateTime.QuarterRegex), + ]; + this.datePointExtractor = new dateConfiguration$6.ChineseDateExtractor(); + this.integerExtractor = new recognizersTextNumber.ChineseIntegerExtractor(); + this.numberParser = new recognizersTextNumber.BaseNumberParser(new recognizersTextNumber.ChineseNumberParserConfiguration()); + this.illegalYearRegex = recognizersText.RegExpUtility.getSafeRegExp(baseDateTime.BaseDateTime.IllegalYearRegex); + this.tillRegex = recognizersText.RegExpUtility.getSafeRegExp(chineseDateTime.ChineseDateTime.DatePeriodTillRegex); + this.followedUnit = recognizersText.RegExpUtility.getSafeRegExp(chineseDateTime.ChineseDateTime.FollowedUnit); + this.numberCombinedWithUnit = recognizersText.RegExpUtility.getSafeRegExp(chineseDateTime.ChineseDateTime.NumberCombinedWithUnit); + this.pastRegex = recognizersText.RegExpUtility.getSafeRegExp(chineseDateTime.ChineseDateTime.PastRegex); + this.futureRegex = recognizersText.RegExpUtility.getSafeRegExp(chineseDateTime.ChineseDateTime.FutureRegex); + } + getFromTokenIndex(source) { + let result = { matched: false, index: -1 }; + if (source.endsWith("从")) { + result.index = source.lastIndexOf("从"); + result.matched = true; + } + return result; + } + ; + getBetweenTokenIndex(source) { + return { matched: false, index: -1 }; + } + ; + hasConnectorToken(source) { + return false; + } +} +class ChineseDatePeriodExtractor extends baseDatePeriod.BaseDatePeriodExtractor { + constructor() { + super(new ChineseDatePeriodExtractorConfiguration()); + } + extract(source, refDate) { + if (!refDate) + refDate = new Date(); + let tokens = new Array() + .concat(super.matchSimpleCases(source)) + .concat(super.mergeTwoTimePoints(source, refDate)) + .concat(this.matchNumberWithUnit(source)); + let result = utilities$2.Token.mergeAllTokens(tokens, source, this.extractorName); + return result; + } + matchNumberWithUnit(source) { + let tokens = new Array(); + let durations = new Array(); + this.config.integerExtractor.extract(source).forEach(er => { + let afterStr = source.substr(er.start + er.length); + let followedUnitMatch = recognizersText.RegExpUtility.getMatches(this.config.followedUnit, afterStr).pop(); + if (followedUnitMatch && followedUnitMatch.index === 0) { + durations.push(new utilities$2.Token(er.start, er.start + er.length + followedUnitMatch.length)); + } + }); + recognizersText.RegExpUtility.getMatches(this.config.numberCombinedWithUnit, source).forEach(match => { + durations.push(new utilities$2.Token(match.index, match.index + match.length)); + }); + durations.forEach(duration => { + let beforeStr = source.substr(0, duration.start).toLowerCase(); + if (recognizersText.StringUtility.isNullOrWhitespace(beforeStr)) { + return; + } + let match = recognizersText.RegExpUtility.getMatches(this.config.pastRegex, beforeStr).pop(); + if (match && recognizersText.StringUtility.isNullOrWhitespace(beforeStr.substr(match.index + match.length))) { + tokens.push(new utilities$2.Token(match.index, duration.end)); + return; + } + match = recognizersText.RegExpUtility.getMatches(this.config.futureRegex, beforeStr).pop(); + if (match && recognizersText.StringUtility.isNullOrWhitespace(beforeStr.substr(match.index + match.length))) { + tokens.push(new utilities$2.Token(match.index, duration.end)); + return; + } + }); + return tokens; + } +} +exports.ChineseDatePeriodExtractor = ChineseDatePeriodExtractor; +class ChineseDatePeriodParserConfiguration { + constructor() { + this.simpleCasesRegex = recognizersText.RegExpUtility.getSafeRegExp(chineseDateTime.ChineseDateTime.SimpleCasesRegex); + this.yearRegex = recognizersText.RegExpUtility.getSafeRegExp(chineseDateTime.ChineseDateTime.DatePeriodYearRegex); + this.seasonRegex = recognizersText.RegExpUtility.getSafeRegExp(chineseDateTime.ChineseDateTime.SeasonRegex); + this.seasonMap = chineseDateTime.ChineseDateTime.ParserConfigurationSeasonMap; + this.quarterRegex = recognizersText.RegExpUtility.getSafeRegExp(chineseDateTime.ChineseDateTime.QuarterRegex); + this.cardinalMap = chineseDateTime.ChineseDateTime.ParserConfigurationCardinalMap; + this.unitMap = chineseDateTime.ChineseDateTime.ParserConfigurationUnitMap; + this.durationExtractor = new durationConfiguration$6.ChineseDurationExtractor(); + this.pastRegex = recognizersText.RegExpUtility.getSafeRegExp(chineseDateTime.ChineseDateTime.PastRegex); + this.futureRegex = recognizersText.RegExpUtility.getSafeRegExp(chineseDateTime.ChineseDateTime.FutureRegex); + this.monthOfYear = chineseDateTime.ChineseDateTime.ParserConfigurationMonthOfYear; + this.dayOfMonth = chineseDateTime.ChineseDateTime.ParserConfigurationDayOfMonth; + this.monthOfYear = chineseDateTime.ChineseDateTime.ParserConfigurationMonthOfYear; + this.oneWordPeriodRegex = recognizersText.RegExpUtility.getSafeRegExp(chineseDateTime.ChineseDateTime.OneWordPeriodRegex); + this.dateExtractor = new dateConfiguration$6.ChineseDateExtractor(); + this.dateParser = new dateConfiguration$6.ChineseDateParser(); + this.tokenBeforeDate = 'on '; + this.weekOfMonthRegex = recognizersText.RegExpUtility.getSafeRegExp(chineseDateTime.ChineseDateTime.WeekOfMonthRegex); + this.thisPrefixRegex = recognizersText.RegExpUtility.getSafeRegExp(chineseDateTime.ChineseDateTime.DatePeriodThisRegex); + this.nextPrefixRegex = recognizersText.RegExpUtility.getSafeRegExp(chineseDateTime.ChineseDateTime.DatePeriodNextRegex); + this.pastPrefixRegex = recognizersText.RegExpUtility.getSafeRegExp(chineseDateTime.ChineseDateTime.DatePeriodLastRegex); + } + getSwiftDayOrMonth(source) { + let trimmedSource = source.trim().toLowerCase(); + if (trimmedSource.endsWith('去年')) { + return -1; + } + if (trimmedSource.endsWith('明年')) { + return 1; + } + if (trimmedSource.endsWith('前年')) { + return -2; + } + if (trimmedSource.endsWith('后年')) { + return 2; + } + if (trimmedSource.startsWith('下个')) { + return 1; + } + if (trimmedSource.startsWith('上个')) { + return -1; + } + if (recognizersText.RegExpUtility.isMatch(this.thisPrefixRegex, trimmedSource)) { + return 0; + } + if (recognizersText.RegExpUtility.isMatch(this.nextPrefixRegex, trimmedSource)) { + return 1; + } + if (recognizersText.RegExpUtility.isMatch(this.pastPrefixRegex, trimmedSource)) { + return -1; + } + return 0; + } + getSwiftYear(source) { + let trimmedSource = source.trim().toLowerCase(); + let swift = -10; + if (trimmedSource.startsWith('明年')) { + swift = 1; + } + else if (trimmedSource.startsWith('去年')) { + swift = -1; + } + else if (trimmedSource.startsWith('今年')) { + swift = 0; + } + return swift; + } + isFuture(source) { + return (recognizersText.RegExpUtility.isMatch(this.thisPrefixRegex, source) + || recognizersText.RegExpUtility.isMatch(this.nextPrefixRegex, source)); + } + isYearToDate(source) { + let trimmedSource = source.trim().toLowerCase(); + return trimmedSource === '今年'; + } + isMonthToDate(source) { + return false; + } + isWeekOnly(source) { + let trimmedSource = source.trim().toLowerCase(); + return trimmedSource.endsWith('周') || trimmedSource.endsWith('星期'); + } + isWeekend(source) { + let trimmedSource = source.trim().toLowerCase(); + return trimmedSource.endsWith('周末'); + } + isMonthOnly(source) { + let trimmedSource = source.trim().toLowerCase(); + return trimmedSource.endsWith('月'); + } + isYearOnly(source) { + let trimmedSource = source.trim().toLowerCase(); + return trimmedSource.endsWith('年'); + } + isLastCardinal(source) { + return source === '最后一'; + } +} +class ChineseDatePeriodParser extends baseDatePeriod.BaseDatePeriodParser { + constructor() { + let config = new ChineseDatePeriodParserConfiguration(); + super(config, false); + this.integerExtractor = new recognizersTextNumber.ChineseIntegerExtractor(); + this.numberParser = recognizersTextNumber.AgnosticNumberParserFactory.getParser(recognizersTextNumber.AgnosticNumberParserType.Integer, new recognizersTextNumber.ChineseNumberParserConfiguration()); + this.yearInChineseRegex = recognizersText.RegExpUtility.getSafeRegExp(chineseDateTime.ChineseDateTime.DatePeriodYearInChineseRegex); + this.numberCombinedWithUnitRegex = recognizersText.RegExpUtility.getSafeRegExp(chineseDateTime.ChineseDateTime.NumberCombinedWithUnit); + this.unitRegex = recognizersText.RegExpUtility.getSafeRegExp(chineseDateTime.ChineseDateTime.UnitRegex); + this.yearAndMonthRegex = recognizersText.RegExpUtility.getSafeRegExp(chineseDateTime.ChineseDateTime.YearAndMonth); + this.pureNumberYearAndMonthRegex = recognizersText.RegExpUtility.getSafeRegExp(chineseDateTime.ChineseDateTime.PureNumYearAndMonth); + this.yearToYearRegex = recognizersText.RegExpUtility.getSafeRegExp(chineseDateTime.ChineseDateTime.YearToYear); + this.YearToYearSuffixRequired = recognizersText.RegExpUtility.getSafeRegExp(chineseDateTime.ChineseDateTime.YearToYearSuffixRequired); + this.chineseYearRegex = recognizersText.RegExpUtility.getSafeRegExp(chineseDateTime.ChineseDateTime.DatePeriodYearInChineseRegex); + this.seasonWithYearRegex = recognizersText.RegExpUtility.getSafeRegExp(chineseDateTime.ChineseDateTime.SeasonWithYear); + } + parse(extractorResult, referenceDate) { + if (!referenceDate) + referenceDate = new Date(); + let resultValue; + if (extractorResult.type === this.parserName) { + let source = extractorResult.text.trim().toLowerCase(); + let innerResult = this.parseSimpleCases(source, referenceDate); + if (!innerResult.success) { + innerResult = this.parseOneWordPeriod(source, referenceDate); + } + if (!innerResult.success) { + innerResult = this.mergeTwoTimePoints(source, referenceDate); + } + if (!innerResult.success) { + innerResult = this.parseNumberWithUnit(source, referenceDate); + } + if (!innerResult.success) { + innerResult = this.parseDuration(source, referenceDate); + } + if (!innerResult.success) { + innerResult = this.parseYearAndMonth(source, referenceDate); + } + if (!innerResult.success) { + innerResult = this.parseYearToYear(source, referenceDate); + } + if (!innerResult.success) { + innerResult = this.parseYear(source, referenceDate); + } + if (!innerResult.success) { + innerResult = this.parseWeekOfMonth(source, referenceDate); + } + if (!innerResult.success) { + innerResult = this.parseSeason(source, referenceDate); + } + if (!innerResult.success) { + innerResult = this.parseQuarter(source, referenceDate); + } + if (innerResult.success) { + if (innerResult.futureValue && innerResult.pastValue) { + innerResult.futureResolution = {}; + innerResult.futureResolution[constants$2.TimeTypeConstants.START_DATE] = utilities$2.FormatUtil.formatDate(innerResult.futureValue[0]); + innerResult.futureResolution[constants$2.TimeTypeConstants.END_DATE] = utilities$2.FormatUtil.formatDate(innerResult.futureValue[1]); + innerResult.pastResolution = {}; + innerResult.pastResolution[constants$2.TimeTypeConstants.START_DATE] = utilities$2.FormatUtil.formatDate(innerResult.pastValue[0]); + innerResult.pastResolution[constants$2.TimeTypeConstants.END_DATE] = utilities$2.FormatUtil.formatDate(innerResult.pastValue[1]); + } + else { + innerResult.futureResolution = {}; + innerResult.pastResolution = {}; + } + resultValue = innerResult; + } + } + let result = new parsers$4.DateTimeParseResult(extractorResult); + result.value = resultValue; + result.timexStr = resultValue ? resultValue.timex : ''; + result.resolutionStr = ''; + return result; + } + getMatchSimpleCase(source) { + return recognizersText.RegExpUtility.getMatches(this.config.simpleCasesRegex, source).pop(); + } + parseSimpleCases(source, referenceDate) { + let result = new utilities$2.DateTimeResolutionResult(); + let year = referenceDate.getFullYear(); + let month = referenceDate.getMonth(); + let noYear = false; + let inputYear = false; + let match = this.getMatchSimpleCase(source); + if (!match || match.index !== 0 || match.length !== source.length) + return result; + let days = match.groups('day'); + let beginDay = this.config.dayOfMonth.get(days.captures[0]); + let endDay = this.config.dayOfMonth.get(days.captures[1]); + let monthStr = match.groups('month').value; + if (!recognizersText.StringUtility.isNullOrEmpty(monthStr)) { + month = this.config.monthOfYear.get(monthStr) - 1; + } + else { + monthStr = match.groups('relmonth').value; + month += this.config.getSwiftDayOrMonth(monthStr); + if (month < 0) { + month = 0; + year--; + } + else if (month > 11) { + month = 11; + year++; + } + } + let yearStr = match.groups('year').value; + if (!recognizersText.StringUtility.isNullOrEmpty(yearStr)) { + year = Number.parseInt(yearStr, 10); + inputYear = true; + } + else { + noYear = true; + } + let beginDateLuis = utilities$2.FormatUtil.luisDate(inputYear || this.config.isFuture(monthStr) ? year : -1, month, beginDay); + let endDateLuis = utilities$2.FormatUtil.luisDate(inputYear || this.config.isFuture(monthStr) ? year : -1, month, endDay); + let futureYear = year; + let pastYear = year; + let startDate = utilities$2.DateUtils.safeCreateFromValue(utilities$2.DateUtils.minValue(), year, month, beginDay); + if (noYear && startDate < referenceDate) + futureYear++; + if (noYear && startDate >= referenceDate) + pastYear--; + result.timex = `(${beginDateLuis},${endDateLuis},P${endDay - beginDay}D)`; + result.futureValue = [ + utilities$2.DateUtils.safeCreateFromValue(utilities$2.DateUtils.minValue(), futureYear, month, beginDay), + utilities$2.DateUtils.safeCreateFromValue(utilities$2.DateUtils.minValue(), futureYear, month, endDay), + ]; + result.pastValue = [ + utilities$2.DateUtils.safeCreateFromValue(utilities$2.DateUtils.minValue(), pastYear, month, beginDay), + utilities$2.DateUtils.safeCreateFromValue(utilities$2.DateUtils.minValue(), pastYear, month, endDay), + ]; + result.success = true; + return result; + } + parseYear(source, referenceDate) { + let trimmedSource = source.trim(); + let result = new utilities$2.DateTimeResolutionResult(); + let isChinese = false; + let match = recognizersText.RegExpUtility.getMatches(this.config.yearRegex, trimmedSource).pop(); + if (!match || match.length !== trimmedSource.length) { + match = recognizersText.RegExpUtility.getMatches(this.yearInChineseRegex, trimmedSource).pop(); + isChinese = (match && match.length === trimmedSource.length); + } + if (!match || match.length !== trimmedSource.length) { + return result; + } + let yearStr = match.value; + if (this.config.isYearOnly(yearStr)) { + yearStr = yearStr.substr(0, yearStr.length - 1).trim(); + } + let year = this.convertYear(yearStr, isChinese); + if (yearStr.length === 2) { + if (year < 100 && year >= 30) { + year += 1900; + } + else if (year < 30) { + year += 2000; + } + } + let beginDay = utilities$2.DateUtils.safeCreateFromMinValue(year, 0, 1); + let endDay = utilities$2.DateUtils.safeCreateFromMinValue(year + 1, 0, 1); + result.timex = utilities$2.FormatUtil.toString(year, 4); + result.futureValue = [beginDay, endDay]; + result.pastValue = [beginDay, endDay]; + result.success = true; + return result; + } + convertYear(yearStr, isChinese) { + let year = -1; + let er; + if (isChinese) { + let yearNum = 0; + er = this.integerExtractor.extract(yearStr).pop(); + if (er && er.type === recognizers_text_number_2.Constants.SYS_NUM_INTEGER) { + yearNum = Number.parseInt(this.numberParser.parse(er).value); + } + if (yearNum < 10) { + yearNum = 0; + for (let index = 0; index < yearStr.length; index++) { + let char = yearStr.charAt(index); + yearNum *= 10; + er = this.integerExtractor.extract(char).pop(); + if (er && er.type === recognizers_text_number_2.Constants.SYS_NUM_INTEGER) { + yearNum += Number.parseInt(this.numberParser.parse(er).value); + } + } + year = yearNum; + } + else { + year = yearNum; + } + } + else { + year = Number.parseInt(yearStr, 10); + } + return year === 0 ? -1 : year; + } + getWeekOfMonth(cardinal, month, year, referenceDate, noYear) { + let result = new utilities$2.DateTimeResolutionResult(); + let seedDate = this.computeDate(cardinal, 1, month, year); + let futureDate = new Date(seedDate); + let pastDate = new Date(seedDate); + if (noYear && futureDate < referenceDate) { + futureDate = this.computeDate(cardinal, 1, month, year + 1); + if (futureDate.getMonth() !== month) { + futureDate.setDate(futureDate.getDate() - 7); + } + } + if (noYear && pastDate >= referenceDate) { + pastDate = this.computeDate(cardinal, 1, month, year - 1); + if (pastDate.getMonth() !== month) { + pastDate.setDate(pastDate.getDate() - 7); + } + } + result.timex = noYear ? + `XXXX-${utilities$2.FormatUtil.toString(month + 1, 2)}-W${utilities$2.FormatUtil.toString(cardinal, 2)}` : + `${utilities$2.FormatUtil.toString(year, 4)}-${utilities$2.FormatUtil.toString(month + 1, 2)}-W${utilities$2.FormatUtil.toString(cardinal, 2)}`; + result.futureValue = [futureDate, utilities$2.DateUtils.addDays(futureDate, this.inclusiveEndPeriod ? 6 : 7)]; + result.pastValue = [pastDate, utilities$2.DateUtils.addDays(pastDate, this.inclusiveEndPeriod ? 6 : 7)]; + result.success = true; + return result; + } + computeDate(cardinal, weekday, month, year) { + let firstDay = new Date(year, month, 1); + let firstWeekday = utilities$2.DateUtils.this(firstDay, weekday); + if (weekday === 0) + weekday = 7; + if (weekday < firstDay.getDay()) + firstWeekday = utilities$2.DateUtils.next(firstDay, weekday); + firstWeekday.setDate(firstWeekday.getDate() + (7 * (cardinal - 1))); + return firstWeekday; + } + parseSeason(source, referenceDate) { + let result = new utilities$2.DateTimeResolutionResult(); + let match = recognizersText.RegExpUtility.getMatches(this.seasonWithYearRegex, source).pop(); + if (!match || match.length !== source.length) + return result; + let year = referenceDate.getFullYear(); + let yearNum = match.groups('year').value; + let yearChinese = match.groups('yearchs').value; + let yearRelative = match.groups('yearrel').value; + let hasYear = false; + if (!recognizersText.StringUtility.isNullOrEmpty(yearNum)) { + hasYear = true; + if (this.config.isYearOnly(yearNum)) { + yearNum = yearNum.substr(0, yearNum.length - 1); + } + year = this.convertYear(yearNum, false); + } + else if (!recognizersText.StringUtility.isNullOrEmpty(yearChinese)) { + hasYear = true; + if (this.config.isYearOnly(yearChinese)) { + yearChinese = yearChinese.substr(0, yearChinese.length - 1); + } + year = this.convertYear(yearChinese, true); + } + else if (!recognizersText.StringUtility.isNullOrEmpty(yearRelative)) { + hasYear = true; + year += this.config.getSwiftDayOrMonth(yearRelative); + } + if (year < 100 && year >= 90) { + year += 1900; + } + else if (year < 100 && year < 20) { + year += 2000; + } + let seasonStr = match.groups('season').value; + let season = this.config.seasonMap.get(seasonStr); + if (hasYear) { + result.timex = `${utilities$2.FormatUtil.toString(year, 4)}-${season}`; + } + result.success = true; + return result; + } + parseQuarter(source, referenceDate) { + let result = new utilities$2.DateTimeResolutionResult(); + let match = recognizersText.RegExpUtility.getMatches(this.config.quarterRegex, source).pop(); + if (!match || match.length !== source.length) + return result; + let year = referenceDate.getFullYear(); + let yearNum = match.groups('year').value; + let yearChinese = match.groups('yearchs').value; + let yearRelative = match.groups('yearrel').value; + if (!recognizersText.StringUtility.isNullOrEmpty(yearNum)) { + if (this.config.isYearOnly(yearNum)) { + yearNum = yearNum.substr(0, yearNum.length - 1); + } + year = this.convertYear(yearNum, false); + } + else if (!recognizersText.StringUtility.isNullOrEmpty(yearChinese)) { + if (this.config.isYearOnly(yearChinese)) { + yearChinese = yearChinese.substr(0, yearChinese.length - 1); + } + year = this.convertYear(yearChinese, true); + } + else if (!recognizersText.StringUtility.isNullOrEmpty(yearRelative)) { + year += this.config.getSwiftDayOrMonth(yearRelative); + } + if (year < 100 && year >= 90) { + year += 1900; + } + else if (year < 100 && year < 20) { + year += 2000; + } + let cardinalStr = match.groups('cardinal').value; + let quarterNum = this.config.cardinalMap.get(cardinalStr); + let beginDate = utilities$2.DateUtils.safeCreateFromValue(utilities$2.DateUtils.minValue(), year, quarterNum * 3 - 3, 1); + let endDate = utilities$2.DateUtils.safeCreateFromValue(utilities$2.DateUtils.minValue(), year, quarterNum * 3, 1); + result.futureValue = [beginDate, endDate]; + result.pastValue = [beginDate, endDate]; + result.timex = `(${utilities$2.FormatUtil.luisDateFromDate(beginDate)},${utilities$2.FormatUtil.luisDateFromDate(endDate)},P3M)`; + result.success = true; + return result; + } + parseNumberWithUnit(source, referenceDate) { + let result = new utilities$2.DateTimeResolutionResult(); + // if there are NO spaces between number and unit + let match = recognizersText.RegExpUtility.getMatches(this.numberCombinedWithUnitRegex, source).pop(); + if (!match) + return result; + let sourceUnit = match.groups('unit').value.trim().toLowerCase(); + if (!this.config.unitMap.has(sourceUnit)) + return result; + let numStr = match.groups('num').value; + let beforeStr = source.substr(0, match.index).trim().toLowerCase(); + return this.parseCommonDurationWithUnit(beforeStr, sourceUnit, numStr, referenceDate); + } + parseDuration(source, referenceDate) { + let result = new utilities$2.DateTimeResolutionResult(); + // for case "前两年" "后三年" + let durationResult = this.config.durationExtractor.extract(source, referenceDate).pop(); + if (!durationResult) + return result; + let match = recognizersText.RegExpUtility.getMatches(this.unitRegex, durationResult.text).pop(); + if (!match) + return result; + let sourceUnit = match.groups('unit').value.trim().toLowerCase(); + if (!this.config.unitMap.has(sourceUnit)) + return result; + let beforeStr = source.substr(0, durationResult.start).trim().toLowerCase(); + let numberStr = durationResult.text.substr(0, match.index).trim().toLowerCase(); + let numberValue = this.convertChineseToNumber(numberStr); + let numStr = numberValue.toString(); + return this.parseCommonDurationWithUnit(beforeStr, sourceUnit, numStr, referenceDate); + } + parseCommonDurationWithUnit(beforeStr, sourceUnit, numStr, referenceDate) { + let result = new utilities$2.DateTimeResolutionResult(); + let unitStr = this.config.unitMap.get(sourceUnit); + let pastMatch = recognizersText.RegExpUtility.getMatches(this.config.pastRegex, beforeStr).pop(); + let hasPast = pastMatch && pastMatch.length === beforeStr.length; + let futureMatch = recognizersText.RegExpUtility.getMatches(this.config.futureRegex, beforeStr).pop(); + let hasFuture = futureMatch && futureMatch.length === beforeStr.length; + if (!hasFuture && !hasPast) { + return result; + } + let beginDate = new Date(referenceDate); + let endDate = new Date(referenceDate); + let difference = Number.parseFloat(numStr); + switch (unitStr) { + case 'D': + beginDate = hasPast ? utilities$2.DateUtils.addDays(referenceDate, -difference) : beginDate; + endDate = hasFuture ? utilities$2.DateUtils.addDays(referenceDate, difference) : endDate; + break; + case 'W': + beginDate = hasPast ? utilities$2.DateUtils.addDays(referenceDate, -7 * difference) : beginDate; + endDate = hasFuture ? utilities$2.DateUtils.addDays(referenceDate, 7 * difference) : endDate; + break; + case 'MON': + beginDate = hasPast ? utilities$2.DateUtils.addMonths(referenceDate, -Math.round(difference)) : beginDate; + endDate = hasFuture ? utilities$2.DateUtils.addMonths(referenceDate, Math.round(difference)) : endDate; + break; + case 'Y': + beginDate = hasPast ? utilities$2.DateUtils.addYears(referenceDate, -Math.round(difference)) : beginDate; + endDate = hasFuture ? utilities$2.DateUtils.addYears(referenceDate, Math.round(difference)) : endDate; + break; + default: return result; + } + if (hasFuture) { + beginDate = utilities$2.DateUtils.addDays(beginDate, 1); + endDate = utilities$2.DateUtils.addDays(endDate, 1); + } + let beginTimex = utilities$2.FormatUtil.luisDateFromDate(beginDate); + let endTimex = utilities$2.FormatUtil.luisDateFromDate(endDate); + result.timex = `(${beginTimex},${endTimex},P${numStr}${unitStr.charAt(0)})`; + result.futureValue = [beginDate, endDate]; + result.pastValue = [beginDate, endDate]; + result.success = true; + return result; + } + convertChineseToNumber(source) { + let num = -1; + let er = this.integerExtractor.extract(source).pop(); + if (er && er.type === recognizers_text_number_2.Constants.SYS_NUM_INTEGER) { + num = Number.parseInt(this.numberParser.parse(er).value); + } + return num; + } + parseYearAndMonth(source, referenceDate) { + let result = new utilities$2.DateTimeResolutionResult(); + let match = recognizersText.RegExpUtility.getMatches(this.yearAndMonthRegex, source).pop(); + if (!match || match.length !== source.length) { + match = recognizersText.RegExpUtility.getMatches(this.pureNumberYearAndMonthRegex, source).pop(); + } + if (!match || match.length !== source.length) { + return result; + } + // parse year + let year = referenceDate.getFullYear(); + let yearNum = match.groups('year').value; + let yearChinese = match.groups('yearchs').value; + let yearRelative = match.groups('yearrel').value; + if (!recognizersText.StringUtility.isNullOrEmpty(yearNum)) { + if (this.config.isYearOnly(yearNum)) { + yearNum = yearNum.substr(0, yearNum.length - 1); + } + year = this.convertYear(yearNum, false); + } + else if (!recognizersText.StringUtility.isNullOrEmpty(yearChinese)) { + if (this.config.isYearOnly(yearChinese)) { + yearChinese = yearChinese.substr(0, yearChinese.length - 1); + } + year = this.convertYear(yearChinese, true); + } + else if (!recognizersText.StringUtility.isNullOrEmpty(yearRelative)) { + year += this.config.getSwiftDayOrMonth(yearRelative); + } + if (year < 100 && year >= 90) { + year += 1900; + } + else if (year < 100 && year < 20) { + year += 2000; + } + let monthStr = match.groups('month').value.toLowerCase(); + let month = (this.config.monthOfYear.get(monthStr) % 12) - 1; + let beginDate = utilities$2.DateUtils.safeCreateFromMinValue(year, month, 1); + let endDate = month === 11 + ? utilities$2.DateUtils.safeCreateFromMinValue(year + 1, 0, 1) + : utilities$2.DateUtils.safeCreateFromMinValue(year, month + 1, 1); + result.timex = utilities$2.FormatUtil.toString(year, 4) + '-' + utilities$2.FormatUtil.toString(month, 2); + result.futureValue = [beginDate, endDate]; + result.pastValue = [beginDate, endDate]; + result.success = true; + return result; + } + parseYearToYear(source, referenceDate) { + let result = new utilities$2.DateTimeResolutionResult(); + let match = recognizersText.RegExpUtility.getMatches(this.yearToYearRegex, source).pop(); + if (!match) { + let match = recognizersText.RegExpUtility.getMatches(this.YearToYearSuffixRequired, source).pop(); + if (!match) { + return result; + } + } + let yearMatches = recognizersText.RegExpUtility.getMatches(this.config.yearRegex, source); + let chineseYearMatches = recognizersText.RegExpUtility.getMatches(this.chineseYearRegex, source); + let beginYear = 0; + let endYear = 0; + if (yearMatches.length === 2) { + beginYear = this.convertChineseToNumber(yearMatches[0].groups('year').value); + endYear = this.convertChineseToNumber(yearMatches[1].groups('year').value); + } + else if (chineseYearMatches.length === 2) { + beginYear = this.convertYear(chineseYearMatches[0].groups('yearchs').value, true); + endYear = this.convertYear(chineseYearMatches[1].groups('yearchs').value, true); + } + else if (yearMatches.length === 1 && chineseYearMatches.length === 1) { + if (yearMatches[0].index < chineseYearMatches[0].index) { + beginYear = this.convertChineseToNumber(yearMatches[0].groups('year').value); + endYear = this.convertChineseToNumber(chineseYearMatches[0].groups('yearchs').value); + } + else { + beginYear = this.convertChineseToNumber(chineseYearMatches[0].groups('yearchs').value); + endYear = this.convertChineseToNumber(yearMatches[0].groups('year').value); + } + } + beginYear = this.sanitizeYear(beginYear); + endYear = this.sanitizeYear(endYear); + let beginDate = utilities$2.DateUtils.safeCreateFromMinValue(beginYear, 0, 1); + let endDate = utilities$2.DateUtils.safeCreateFromMinValue(endYear, 0, 1); + let beginTimex = utilities$2.FormatUtil.luisDateFromDate(beginDate); + let endTimex = utilities$2.FormatUtil.luisDateFromDate(endDate); + result.timex = `(${beginTimex},${endTimex},P${endYear - beginYear}Y)`; + result.futureValue = [beginDate, endDate]; + result.pastValue = [beginDate, endDate]; + result.success = true; + return result; + } + sanitizeYear(year) { + let result = year; + if (year < 100 && year >= 90) { + result += 1900; + } + else if (year < 100 && year < 20) { + result += 2000; + } + return result; + } +} +exports.ChineseDatePeriodParser = ChineseDatePeriodParser; + +}); + +unwrapExports(datePeriodConfiguration$6); + +var dateTimePeriodConfiguration$6 = createCommonjsModule(function (module, exports) { +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); + + + + + + + + + + + +class ChineseDateTimePeriodExtractorConfiguration { + getFromTokenIndex(source) { + let result = { matched: false, index: -1 }; + if (source.endsWith("从")) { + result.index = source.lastIndexOf("从"); + result.matched = true; + } + return result; + } + ; + getBetweenTokenIndex(source) { + return { matched: false, index: -1 }; + } + ; + hasConnectorToken(source) { + return (source === '和' || source === ' 与' || source === '到'); + } + ; + constructor() { + this.singleDateExtractor = new dateConfiguration$6.ChineseDateExtractor(); + this.singleTimeExtractor = new timeConfiguration$6.ChineseTimeExtractor(); + this.singleDateTimeExtractor = new dateTimeConfiguration$6.ChineseDateTimeExtractor(); + this.prepositionRegex = recognizersText.RegExpUtility.getSafeRegExp(chineseDateTime.ChineseDateTime.DateTimePeriodPrepositionRegex); + this.tillRegex = recognizersText.RegExpUtility.getSafeRegExp(chineseDateTime.ChineseDateTime.DateTimePeriodTillRegex); + this.cardinalExtractor = new recognizersTextNumber.ChineseCardinalExtractor(); + this.followedUnit = recognizersText.RegExpUtility.getSafeRegExp(chineseDateTime.ChineseDateTime.DateTimePeriodFollowedUnit); + this.timeUnitRegex = recognizersText.RegExpUtility.getSafeRegExp(chineseDateTime.ChineseDateTime.DateTimePeriodUnitRegex); + this.specificTimeOfDayRegex = recognizersText.RegExpUtility.getSafeRegExp(chineseDateTime.ChineseDateTime.SpecificTimeOfDayRegex); + this.timeOfDayRegex = recognizersText.RegExpUtility.getSafeRegExp(chineseDateTime.ChineseDateTime.TimeOfDayRegex); + } +} +class ChineseDateTimePeriodExtractor extends baseDateTimePeriod.BaseDateTimePeriodExtractor { + constructor() { + super(new ChineseDateTimePeriodExtractorConfiguration()); + this.zhijianRegex = recognizersText.RegExpUtility.getSafeRegExp(chineseDateTime.ChineseDateTime.ZhijianRegex); + this.pastRegex = recognizersText.RegExpUtility.getSafeRegExp(chineseDateTime.ChineseDateTime.PastRegex); + this.futureRegex = recognizersText.RegExpUtility.getSafeRegExp(chineseDateTime.ChineseDateTime.FutureRegex); + } + extract(source, refDate) { + if (!refDate) + refDate = new Date(); + let referenceDate = refDate; + let tokens = new Array() + .concat(this.mergeDateAndTimePeriod(source, referenceDate)) + .concat(this.mergeTwoTimePoints(source, referenceDate)) + .concat(this.matchNubmerWithUnit(source)) + .concat(this.matchNight(source, referenceDate)); + let result = utilities$2.Token.mergeAllTokens(tokens, source, this.extractorName); + return result; + } + mergeDateAndTimePeriod(source, refDate) { + let tokens = new Array(); + let ersDate = this.config.singleDateExtractor.extract(source, refDate); + let ersTime = this.config.singleTimeExtractor.extract(source, refDate); + let timeResults = new Array(); + let j = 0; + for (let i = 0; i < ersDate.length; i++) { + timeResults.push(ersDate[i]); + while (j < ersTime.length && ersTime[j].start + ersTime[j].length <= ersDate[i].start) { + timeResults.push(ersTime[j]); + j++; + } + while (j < ersTime.length && recognizersText.ExtractResult.isOverlap(ersTime[j], ersDate[i])) { + j++; + } + } + for (j; j < ersTime.length; j++) { + timeResults.push(ersTime[j]); + } + timeResults = timeResults.sort((a, b) => a.start > b.start ? 1 : a.start < b.start ? -1 : 0); + let idx = 0; + while (idx < timeResults.length - 1) { + let current = timeResults[idx]; + let next = timeResults[idx + 1]; + if (current.type === constants$2.Constants.SYS_DATETIME_DATE && next.type === constants$2.Constants.SYS_DATETIME_TIMEPERIOD) { + let middleBegin = current.start + current.length; + let middleEnd = next.start; + let middleStr = source.substring(middleBegin, middleEnd).trim(); + if (recognizersText.StringUtility.isNullOrWhitespace(middleStr) || recognizersText.RegExpUtility.isMatch(this.config.prepositionRegex, middleStr)) { + let periodBegin = current.start; + let periodEnd = next.start + next.length; + tokens.push(new utilities$2.Token(periodBegin, periodEnd)); + } + idx++; + } + idx++; + } + return tokens; + } + mergeTwoTimePoints(source, refDate) { + let tokens = new Array(); + let ersDateTime = this.config.singleDateTimeExtractor.extract(source, refDate); + let ersTime = this.config.singleTimeExtractor.extract(source, refDate); + let innerMarks = []; + let j = 0; + ersDateTime.forEach((erDateTime, index) => { + innerMarks.push(erDateTime); + while (j < ersTime.length && ersTime[j].start + ersTime[j].length < erDateTime.start) { + innerMarks.push(ersTime[j++]); + } + while (j < ersTime.length && recognizersText.ExtractResult.isOverlap(ersTime[j], erDateTime)) { + j++; + } + }); + while (j < ersTime.length) { + innerMarks.push(ersTime[j++]); + } + innerMarks = innerMarks.sort((erA, erB) => erA.start < erB.start ? -1 : erA.start === erB.start ? 0 : 1); + let idx = 0; + while (idx < innerMarks.length - 1) { + let currentMark = innerMarks[idx]; + let nextMark = innerMarks[idx + 1]; + if (currentMark.type === constants$2.Constants.SYS_DATETIME_TIME && nextMark.type === constants$2.Constants.SYS_DATETIME_TIME) { + idx++; + continue; + } + let middleBegin = currentMark.start + currentMark.length; + let middleEnd = nextMark.start; + let middleStr = source.substr(middleBegin, middleEnd - middleBegin).trim().toLowerCase(); + let matches = recognizersText.RegExpUtility.getMatches(this.config.tillRegex, middleStr); + if (matches && matches.length > 0 && matches[0].index === 0 && matches[0].length === middleStr.length) { + let periodBegin = currentMark.start; + let periodEnd = nextMark.start + nextMark.length; + let beforeStr = source.substr(0, periodBegin).trim().toLowerCase(); + let fromTokenIndex = this.config.getFromTokenIndex(beforeStr); + if (fromTokenIndex.matched) { + periodBegin = fromTokenIndex.index; + } + tokens.push(new utilities$2.Token(periodBegin, periodEnd)); + idx += 2; + continue; + } + if (this.config.hasConnectorToken(middleStr)) { + let periodBegin = currentMark.start; + let periodEnd = nextMark.start + nextMark.length; + let afterStr = source.substr(periodEnd).trim().toLowerCase(); + let match = recognizersText.RegExpUtility.getMatches(this.zhijianRegex, afterStr).pop(); + if (match) { + tokens.push(new utilities$2.Token(periodBegin, periodEnd + match.length)); + idx += 2; + continue; + } + } + idx++; + } + + return tokens; + } + matchNubmerWithUnit(source) { + let tokens = new Array(); + let durations = new Array(); + this.config.cardinalExtractor.extract(source).forEach(er => { + let afterStr = source.substr(er.start + er.length); + let followedUnitMatch = recognizersText.RegExpUtility.getMatches(this.config.followedUnit, afterStr).pop(); + if (followedUnitMatch && followedUnitMatch.index === 0) { + durations.push(new utilities$2.Token(er.start, er.start + er.length + followedUnitMatch.length)); + } + }); + recognizersText.RegExpUtility.getMatches(this.config.timeUnitRegex, source).forEach(match => { + durations.push(new utilities$2.Token(match.index, match.index + match.length)); + }); + durations.forEach(duration => { + let beforeStr = source.substr(0, duration.start).toLowerCase(); + if (recognizersText.StringUtility.isNullOrWhitespace(beforeStr)) { + return; + } + let match = recognizersText.RegExpUtility.getMatches(this.pastRegex, beforeStr).pop(); + if (match && recognizersText.StringUtility.isNullOrWhitespace(beforeStr.substr(match.index + match.length))) { + tokens.push(new utilities$2.Token(match.index, duration.end)); + return; + } + match = recognizersText.RegExpUtility.getMatches(this.futureRegex, beforeStr).pop(); + if (match && recognizersText.StringUtility.isNullOrWhitespace(beforeStr.substr(match.index + match.length))) { + tokens.push(new utilities$2.Token(match.index, duration.end)); + return; + } + }); + return tokens; + } + matchNight(source, refDate) { + let tokens = new Array(); + recognizersText.RegExpUtility.getMatches(this.config.specificTimeOfDayRegex, source).forEach(match => { + tokens.push(new utilities$2.Token(match.index, match.index + match.length)); + }); + this.config.singleDateExtractor.extract(source, refDate).forEach(er => { + let afterStr = source.substr(er.start + er.length); + let match = recognizersText.RegExpUtility.getMatches(this.config.timeOfDayRegex, afterStr).pop(); + if (match) { + let middleStr = source.substr(0, match.index); + if (recognizersText.StringUtility.isNullOrWhitespace(middleStr) || recognizersText.RegExpUtility.isMatch(this.config.prepositionRegex, middleStr)) { + tokens.push(new utilities$2.Token(er.start, er.start + er.length + match.index + match.length)); + } + } + }); + return tokens; + } +} +exports.ChineseDateTimePeriodExtractor = ChineseDateTimePeriodExtractor; +class ChineseDateTimePeriodParserConfiguration { + constructor() { + this.dateExtractor = new dateConfiguration$6.ChineseDateExtractor(); + this.timeExtractor = new timeConfiguration$6.ChineseTimeExtractor(); + this.dateTimeExtractor = new dateTimeConfiguration$6.ChineseDateTimeExtractor(); + this.timePeriodExtractor = new timePeriodConfiguration$6.ChineseTimePeriodExtractor(); + this.dateParser = new dateConfiguration$6.ChineseDateParser(); + this.timeParser = new timeConfiguration$6.ChineseTimeParser(); + this.dateTimeParser = new dateTimeConfiguration$6.ChineseDateTimeParser(); + this.timePeriodParser = new timePeriodConfiguration$6.ChineseTimePeriodParser(); + this.specificTimeOfDayRegex = recognizersText.RegExpUtility.getSafeRegExp(chineseDateTime.ChineseDateTime.SpecificTimeOfDayRegex); + this.relativeTimeUnitRegex = recognizersText.RegExpUtility.getSafeRegExp(chineseDateTime.ChineseDateTime.TimeOfDayRegex); + this.pastRegex = recognizersText.RegExpUtility.getSafeRegExp(chineseDateTime.ChineseDateTime.PastRegex); + this.futureRegex = recognizersText.RegExpUtility.getSafeRegExp(chineseDateTime.ChineseDateTime.FutureRegex); + this.unitMap = chineseDateTime.ChineseDateTime.ParserConfigurationUnitMap; + } + getMatchedTimeRange(source) { + let swift = 0; + let beginHour = 0; + let endHour = 0; + let endMin = 0; + let timeStr = ''; + switch (source) { + case '今晚': + swift = 0; + timeStr = 'TEV'; + beginHour = 16; + endHour = 20; + break; + case '今早': + case '今晨': + swift = 0; + timeStr = 'TMO'; + beginHour = 8; + endHour = 12; + break; + case '明晚': + swift = 1; + timeStr = 'TEV'; + beginHour = 16; + endHour = 20; + break; + case '明早': + case '明晨': + swift = 1; + timeStr = 'TMO'; + beginHour = 8; + endHour = 12; + break; + case '昨晚': + swift = -1; + timeStr = 'TEV'; + beginHour = 16; + endHour = 20; + break; + default: + return { + timeStr: '', + beginHour: 0, + endHour: 0, + endMin: 0, + swift: 0, + success: false + }; + } + return { + timeStr: timeStr, + beginHour: beginHour, + endHour: endHour, + endMin: endMin, + swift: swift, + success: true + }; + } + getSwiftPrefix(source) { + return null; + } +} +class ChineseDateTimePeriodParser extends baseDateTimePeriod.BaseDateTimePeriodParser { + constructor() { + let config = new ChineseDateTimePeriodParserConfiguration(); + super(config); + this.TMORegex = recognizersText.RegExpUtility.getSafeRegExp(chineseDateTime.ChineseDateTime.DateTimePeriodMORegex); + this.TAFRegex = recognizersText.RegExpUtility.getSafeRegExp(chineseDateTime.ChineseDateTime.DateTimePeriodAFRegex); + this.TEVRegex = recognizersText.RegExpUtility.getSafeRegExp(chineseDateTime.ChineseDateTime.DateTimePeriodEVRegex); + this.TNIRegex = recognizersText.RegExpUtility.getSafeRegExp(chineseDateTime.ChineseDateTime.DateTimePeriodNIRegex); + this.unitRegex = recognizersText.RegExpUtility.getSafeRegExp(chineseDateTime.ChineseDateTime.DateTimePeriodUnitRegex); + this.timeOfDayRegex = recognizersText.RegExpUtility.getSafeRegExp(chineseDateTime.ChineseDateTime.TimeOfDayRegex); + this.cardinalExtractor = new recognizersTextNumber.ChineseCardinalExtractor(); + this.cardinalParser = recognizersTextNumber.AgnosticNumberParserFactory.getParser(recognizersTextNumber.AgnosticNumberParserType.Cardinal, new recognizersTextNumber.ChineseNumberParserConfiguration()); + } + parse(extractorResult, referenceDate) { + if (!referenceDate) + referenceDate = new Date(); + let resultValue; + if (extractorResult.type === this.parserName) { + let source = extractorResult.text.trim().toLowerCase(); + let innerResult = this.mergeDateAndTimePeriods(source, referenceDate); + if (!innerResult.success) { + innerResult = this.mergeTwoTimePoints(source, referenceDate); + } + if (!innerResult.success) { + innerResult = this.parseSpecificTimeOfDay(source, referenceDate); + } + if (!innerResult.success) { + innerResult = this.parseNumberWithUnit(source, referenceDate); + } + if (innerResult.success) { + innerResult.futureResolution = {}; + innerResult.futureResolution[constants$2.TimeTypeConstants.START_DATETIME] = utilities$2.FormatUtil.formatDateTime(innerResult.futureValue[0]); + innerResult.futureResolution[constants$2.TimeTypeConstants.END_DATETIME] = utilities$2.FormatUtil.formatDateTime(innerResult.futureValue[1]); + innerResult.pastResolution = {}; + innerResult.pastResolution[constants$2.TimeTypeConstants.START_DATETIME] = utilities$2.FormatUtil.formatDateTime(innerResult.pastValue[0]); + innerResult.pastResolution[constants$2.TimeTypeConstants.END_DATETIME] = utilities$2.FormatUtil.formatDateTime(innerResult.pastValue[1]); + resultValue = innerResult; + } + } + let result = new parsers$4.DateTimeParseResult(extractorResult); + result.value = resultValue; + result.timexStr = resultValue ? resultValue.timex : ''; + result.resolutionStr = ''; + return result; + } + mergeDateAndTimePeriods(text, referenceTime) { + let result = new utilities$2.DateTimeResolutionResult(); + let erDate = this.config.dateExtractor.extract(text, referenceTime).pop(); + let erTimePeriod = this.config.timePeriodExtractor.extract(text, referenceTime).pop(); + if (!erDate || !erTimePeriod) + return result; + let prDate = this.config.dateParser.parse(erDate, referenceTime); + let prTimePeriod = this.config.timePeriodParser.parse(erTimePeriod, referenceTime); + let split = prTimePeriod.timexStr.split('T'); + if (split.length !== 4) { + return result; + } + let beginTime = prTimePeriod.value.futureValue.item1; + let endTime = prTimePeriod.value.futureValue.item2; + let futureDate = prDate.value.futureValue; + let pastDate = prDate.value.pastValue; + result.futureValue = [ + utilities$2.DateUtils.safeCreateFromMinValueWithDateAndTime(futureDate, beginTime), + utilities$2.DateUtils.safeCreateFromMinValueWithDateAndTime(futureDate, endTime) + ]; + result.pastValue = [ + utilities$2.DateUtils.safeCreateFromMinValueWithDateAndTime(pastDate, beginTime), + utilities$2.DateUtils.safeCreateFromMinValueWithDateAndTime(pastDate, endTime) + ]; + let dateTimex = prDate.timexStr; + result.timex = `${split[0]}${dateTimex}T${split[1]}${dateTimex}T${split[2]}T${split[3]}`; + result.success = true; + return result; + } + mergeTwoTimePoints(text, referenceTime) { + let result = new utilities$2.DateTimeResolutionResult(); + let prs; + let timeErs = this.config.timeExtractor.extract(text, referenceTime); + let datetimeErs = this.config.dateTimeExtractor.extract(text, referenceTime); + let bothHasDate = false; + let beginHasDate = false; + let endHasDate = false; + if (datetimeErs.length === 2) { + prs = this.getTwoPoints(datetimeErs[0], datetimeErs[1], this.config.dateTimeParser, this.config.dateTimeParser, referenceTime); + bothHasDate = true; + } + else if (datetimeErs.length === 1 && timeErs.length === 2) { + if (recognizersText.ExtractResult.isOverlap(datetimeErs[0], timeErs[0])) { + prs = this.getTwoPoints(datetimeErs[0], timeErs[1], this.config.dateTimeParser, this.config.timeParser, referenceTime); + beginHasDate = true; + } + else { + prs = this.getTwoPoints(timeErs[0], datetimeErs[0], this.config.timeParser, this.config.dateTimeParser, referenceTime); + endHasDate = true; + } + } + else if (datetimeErs.length === 1 && timeErs.length === 1) { + if (timeErs[0].start < datetimeErs[0].start) { + prs = this.getTwoPoints(timeErs[0], datetimeErs[0], this.config.timeParser, this.config.dateTimeParser, referenceTime); + endHasDate = true; + } + else { + prs = this.getTwoPoints(datetimeErs[0], timeErs[0], this.config.dateTimeParser, this.config.timeParser, referenceTime); + beginHasDate = true; + } + } + if (!prs || !prs.begin.value || !prs.end.value) + return result; + let futureBegin = prs.begin.value.futureValue; + let futureEnd = prs.end.value.futureValue; + let pastBegin = prs.begin.value.pastValue; + let pastEnd = prs.end.value.pastValue; + if (futureBegin.getTime() > futureEnd.getTime()) + futureBegin = pastBegin; + if (pastEnd.getTime() < pastBegin.getTime()) + pastEnd = futureEnd; + let rightTime = utilities$2.DateUtils.safeCreateFromMinValueWithDateAndTime(referenceTime); + let leftTime = utilities$2.DateUtils.safeCreateFromMinValueWithDateAndTime(referenceTime); + if (bothHasDate) { + rightTime = utilities$2.DateUtils.safeCreateFromMinValueWithDateAndTime(futureEnd); + leftTime = utilities$2.DateUtils.safeCreateFromMinValueWithDateAndTime(futureBegin); + } + else if (beginHasDate) { + // TODO: Handle "明天下午两点到五点" + futureEnd = utilities$2.DateUtils.safeCreateFromMinValueWithDateAndTime(futureBegin, futureEnd); + pastEnd = utilities$2.DateUtils.safeCreateFromMinValueWithDateAndTime(pastBegin, pastEnd); + leftTime = utilities$2.DateUtils.safeCreateFromMinValueWithDateAndTime(futureBegin); + } + else if (endHasDate) { + // TODO: Handle "明天下午两点到五点" + futureBegin = utilities$2.DateUtils.safeCreateFromMinValueWithDateAndTime(futureEnd, futureBegin); + pastBegin = utilities$2.DateUtils.safeCreateFromMinValueWithDateAndTime(pastEnd, pastBegin); + rightTime = utilities$2.DateUtils.safeCreateFromMinValueWithDateAndTime(futureEnd); + } + let leftResult = prs.begin.value; + let rightResult = prs.end.value; + let leftResultTime = leftResult.futureValue; + let rightResultTime = rightResult.futureValue; + leftTime = utilities$2.DateUtils.addTime(leftTime, leftResultTime); + rightTime = utilities$2.DateUtils.addTime(rightTime, rightResultTime); + // the right side time contains "ampm", while the left side doesn't + if (rightResult.comment === 'ampm' && !leftResult.comment && rightTime.getTime() < leftTime.getTime()) { + rightTime = utilities$2.DateUtils.addHours(rightTime, 12); + } + if (rightTime.getTime() < leftTime.getTime()) { + rightTime = utilities$2.DateUtils.addDays(rightTime, 1); + } + result.futureValue = [leftTime, rightTime]; + result.pastValue = [leftTime, rightTime]; + let hasFuzzyTimex = prs.begin.timexStr.includes('X') || prs.end.timexStr.includes('X'); + let leftTimex = hasFuzzyTimex ? prs.begin.timexStr : utilities$2.FormatUtil.luisDateTime(leftTime); + let rightTimex = hasFuzzyTimex ? prs.end.timexStr : utilities$2.FormatUtil.luisDateTime(rightTime); + let hoursBetween = utilities$2.DateUtils.totalHours(rightTime, leftTime); + result.timex = `(${leftTimex},${rightTimex},PT${hoursBetween}H)`; + result.success = true; + return result; + } + parseSpecificTimeOfDay(text, referenceTime) { + let result = new utilities$2.DateTimeResolutionResult(); + let source = text.trim().toLowerCase(); + let match = recognizersText.RegExpUtility.getMatches(this.config.specificTimeOfDayRegex, source).pop(); + if (match && match.index === 0 && match.length === source.length) { + let values = this.config.getMatchedTimeRange(source); + if (!values.success) { + return result; + } + let swift = values.swift; + let date = utilities$2.DateUtils.addDays(referenceTime, swift); + date.setHours(0); + date.setMinutes(0); + date.setSeconds(0); + result.timex = utilities$2.FormatUtil.formatDate(date) + values.timeStr; + result.futureValue = [ + utilities$2.DateUtils.safeCreateFromMinValue(date.getFullYear(), date.getMonth(), date.getDate(), values.beginHour, 0, 0), + utilities$2.DateUtils.safeCreateFromMinValue(date.getFullYear(), date.getMonth(), date.getDate(), values.endHour, values.endMin, values.endMin) + ]; + result.pastValue = [ + utilities$2.DateUtils.safeCreateFromMinValue(date.getFullYear(), date.getMonth(), date.getDate(), values.beginHour, 0, 0), + utilities$2.DateUtils.safeCreateFromMinValue(date.getFullYear(), date.getMonth(), date.getDate(), values.endHour, values.endMin, values.endMin) + ]; + result.success = true; + return result; + } + let beginHour = 0; + let endHour = 0; + let endMin = 0; + let timeStr = ''; + // handle morning, afternoon.. + if (recognizersText.RegExpUtility.isMatch(this.TMORegex, source)) { + timeStr = 'TMO'; + beginHour = 8; + endHour = 12; + } + else if (recognizersText.RegExpUtility.isMatch(this.TAFRegex, source)) { + timeStr = 'TAF'; + beginHour = 12; + endHour = 16; + } + else if (recognizersText.RegExpUtility.isMatch(this.TEVRegex, source)) { + timeStr = 'TEV'; + beginHour = 16; + endHour = 20; + } + else if (recognizersText.RegExpUtility.isMatch(this.TNIRegex, source)) { + timeStr = 'TNI'; + beginHour = 20; + endHour = 23; + endMin = 59; + } + else { + return result; + } + // handle Date followed by morning, afternoon + let timeMatch = recognizersText.RegExpUtility.getMatches(this.timeOfDayRegex, source).pop(); + if (!timeMatch) + return result; + let beforeStr = source.substr(0, timeMatch.index).trim(); + let erDate = this.config.dateExtractor.extract(beforeStr, referenceTime).pop(); + if (!erDate || erDate.length !== beforeStr.length) + return result; + let prDate = this.config.dateParser.parse(erDate, referenceTime); + let futureDate = prDate.value.futureValue; + let pastDate = prDate.value.pastValue; + result.timex = prDate.timexStr + timeStr; + result.futureValue = [ + utilities$2.DateUtils.safeCreateFromMinValue(futureDate.getFullYear(), futureDate.getMonth(), futureDate.getDate(), beginHour, 0, 0), + utilities$2.DateUtils.safeCreateFromMinValue(futureDate.getFullYear(), futureDate.getMonth(), futureDate.getDate(), endHour, endMin, endMin) + ]; + result.pastValue = [ + utilities$2.DateUtils.safeCreateFromMinValue(pastDate.getFullYear(), pastDate.getMonth(), pastDate.getDate(), beginHour, 0, 0), + utilities$2.DateUtils.safeCreateFromMinValue(pastDate.getFullYear(), pastDate.getMonth(), pastDate.getDate(), endHour, endMin, endMin) + ]; + result.success = true; + return result; + } + parseNumberWithUnit(text, referenceTime) { + let result = new utilities$2.DateTimeResolutionResult(); + let ers = this.cardinalExtractor.extract(text); + if (ers.length === 1) { + let er = ers[0]; + let pr = this.cardinalParser.parse(er); + let sourceUnit = text.substr(er.start + er.length).trim().toLowerCase(); + if (sourceUnit.startsWith('个')) { + sourceUnit = sourceUnit.substr(1); + } + let beforeStr = text.substr(0, er.start).trim().toLowerCase(); + return this.parseCommonDurationWithUnit(beforeStr, sourceUnit, pr.resolutionStr, pr.value, referenceTime); + } + // handle "last hour" + let match = recognizersText.RegExpUtility.getMatches(this.unitRegex, text).pop(); + if (match) { + let srcUnit = match.groups('unit').value; + let beforeStr = text.substr(0, match.index).trim().toLowerCase(); + return this.parseCommonDurationWithUnit(beforeStr, srcUnit, '1', 1, referenceTime); + } + return result; + } + parseDuration(text, referenceTime) { + let result = new utilities$2.DateTimeResolutionResult(); + let match = recognizersText.RegExpUtility.getMatches(this.config.relativeTimeUnitRegex, text).pop(); + if (!match) + return result; + let sourceUnit = match.groups('unit').value.toLowerCase(); + let beforeStr = text.substr(0, match.index).trim().toLowerCase(); + return this.parseCommonDurationWithUnit(beforeStr, sourceUnit, '1', 1, referenceTime); + } + parseCommonDurationWithUnit(beforeStr, sourceUnit, numStr, swift, referenceDate) { + let result = new utilities$2.DateTimeResolutionResult(); + if (!this.config.unitMap.has(sourceUnit)) + return result; + let unitStr = this.config.unitMap.get(sourceUnit); + let pastMatch = recognizersText.RegExpUtility.getMatches(this.config.pastRegex, beforeStr).pop(); + let hasPast = pastMatch && pastMatch.length === beforeStr.length; + let futureMatch = recognizersText.RegExpUtility.getMatches(this.config.futureRegex, beforeStr).pop(); + let hasFuture = futureMatch && futureMatch.length === beforeStr.length; + if (!hasPast && !hasFuture) + return result; + let beginDate = new Date(referenceDate); + let endDate = new Date(referenceDate); + switch (unitStr) { + case 'H': + beginDate = hasPast ? utilities$2.DateUtils.addHours(beginDate, -swift) : beginDate; + endDate = hasFuture ? utilities$2.DateUtils.addHours(endDate, swift) : endDate; + break; + case 'M': + beginDate = hasPast ? utilities$2.DateUtils.addMinutes(beginDate, -swift) : beginDate; + endDate = hasFuture ? utilities$2.DateUtils.addMinutes(endDate, swift) : endDate; + break; + case 'S': + beginDate = hasPast ? utilities$2.DateUtils.addSeconds(beginDate, -swift) : beginDate; + endDate = hasFuture ? utilities$2.DateUtils.addSeconds(endDate, swift) : endDate; + break; + default: return result; + } + let beginTimex = `${utilities$2.FormatUtil.luisDateFromDate(beginDate)}T${utilities$2.FormatUtil.luisTimeFromDate(beginDate)}`; + let endTimex = `${utilities$2.FormatUtil.luisDateFromDate(endDate)}T${utilities$2.FormatUtil.luisTimeFromDate(endDate)}`; + result.timex = `(${beginTimex},${endTimex},PT${numStr}${unitStr.charAt(0)})`; + result.futureValue = [beginDate, endDate]; + result.pastValue = [beginDate, endDate]; + result.success = true; + return result; + } +} +exports.ChineseDateTimePeriodParser = ChineseDateTimePeriodParser; + +}); + +unwrapExports(dateTimePeriodConfiguration$6); + +var setConfiguration$6 = createCommonjsModule(function (module, exports) { +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); + + + + + + + + + + +class ChineseSetExtractorConfiguration { + constructor() { + this.eachUnitRegex = recognizersText.RegExpUtility.getSafeRegExp(chineseDateTime.ChineseDateTime.SetEachUnitRegex); + this.durationExtractor = new durationConfiguration$6.ChineseDurationExtractor(); + this.lastRegex = recognizersText.RegExpUtility.getSafeRegExp(chineseDateTime.ChineseDateTime.SetLastRegex); + this.eachPrefixRegex = recognizersText.RegExpUtility.getSafeRegExp(chineseDateTime.ChineseDateTime.SetEachPrefixRegex); + this.timeExtractor = new timeConfiguration$6.ChineseTimeExtractor(); + this.beforeEachDayRegex = recognizersText.RegExpUtility.getSafeRegExp(chineseDateTime.ChineseDateTime.SetEachDayRegex); + this.eachDayRegex = recognizersText.RegExpUtility.getSafeRegExp(chineseDateTime.ChineseDateTime.SetEachDayRegex); + this.dateExtractor = new dateConfiguration$6.ChineseDateExtractor(); + this.dateTimeExtractor = new dateTimeConfiguration$6.ChineseDateTimeExtractor(); + } +} +class ChineseSetExtractor extends baseSet.BaseSetExtractor { + constructor() { + super(new ChineseSetExtractorConfiguration()); + } + extract(source, refDate) { + if (!refDate) + refDate = new Date(); + let referenceDate = refDate; + let tokens = new Array() + .concat(super.matchEachUnit(source)) + .concat(super.matchEachDuration(source, referenceDate)) + .concat(this.matchEachSpecific(this.config.timeExtractor, this.config.eachDayRegex, source, referenceDate)) + .concat(this.matchEachSpecific(this.config.dateExtractor, this.config.eachPrefixRegex, source, referenceDate)) + .concat(this.matchEachSpecific(this.config.dateTimeExtractor, this.config.eachPrefixRegex, source, referenceDate)); + let result = utilities$2.Token.mergeAllTokens(tokens, source, this.extractorName); + return result; + } + matchEachSpecific(extractor, eachRegex, source, refDate) { + let ret = []; + extractor.extract(source, refDate).forEach(er => { + let beforeStr = source.substr(0, er.start); + let beforeMatch = recognizersText.RegExpUtility.getMatches(eachRegex, beforeStr).pop(); + if (beforeMatch) { + ret.push(new utilities$2.Token(beforeMatch.index, er.start + er.length)); + } + }); + return ret; + } +} +exports.ChineseSetExtractor = ChineseSetExtractor; +class ChineseSetParserConfiguration { + constructor() { + this.dateExtractor = new dateConfiguration$6.ChineseDateExtractor(); + this.timeExtractor = new timeConfiguration$6.ChineseTimeExtractor(); + this.durationExtractor = new durationConfiguration$6.ChineseDurationExtractor(); + this.dateTimeExtractor = new dateTimeConfiguration$6.ChineseDateTimeExtractor(); + this.dateParser = new dateConfiguration$6.ChineseDateParser(); + this.timeParser = new timeConfiguration$6.ChineseTimeParser(); + this.durationParser = new durationConfiguration$6.ChineseDurationParser(); + this.dateTimeParser = new dateTimeConfiguration$6.ChineseDateTimeParser(); + this.unitMap = chineseDateTime.ChineseDateTime.ParserConfigurationUnitMap; + this.eachUnitRegex = recognizersText.RegExpUtility.getSafeRegExp(chineseDateTime.ChineseDateTime.SetEachUnitRegex); + this.eachDayRegex = recognizersText.RegExpUtility.getSafeRegExp(chineseDateTime.ChineseDateTime.SetEachDayRegex); + this.eachPrefixRegex = recognizersText.RegExpUtility.getSafeRegExp(chineseDateTime.ChineseDateTime.SetEachPrefixRegex); + } + getMatchedDailyTimex(text) { + return null; + } + getMatchedUnitTimex(source) { + let timex = ''; + if (source === '天' || source === '日') + timex = 'P1D'; + else if (source === '周' || source === '星期') + timex = 'P1W'; + else if (source === '月') + timex = 'P1M'; + else if (source === '年') + timex = 'P1Y'; + return { matched: timex !== '', timex: timex }; + } +} +class ChineseSetParser extends baseSet.BaseSetParser { + constructor() { + let config = new ChineseSetParserConfiguration(); + super(config); + } + parse(er, referenceDate) { + if (!referenceDate) + referenceDate = new Date(); + let value = null; + if (er.type === baseSet.BaseSetParser.ParserName) { + let innerResult = this.parseEachUnit(er.text); + if (!innerResult.success) { + innerResult = this.parseEachDuration(er.text, referenceDate); + } + if (!innerResult.success) { + innerResult = this.parserTimeEveryday(er.text, referenceDate); + } + if (!innerResult.success) { + innerResult = this.parseEach(this.config.dateTimeExtractor, this.config.dateTimeParser, er.text, referenceDate); + } + if (!innerResult.success) { + innerResult = this.parseEach(this.config.dateExtractor, this.config.dateParser, er.text, referenceDate); + } + if (innerResult.success) { + innerResult.futureResolution = {}; + innerResult.futureResolution[constants$2.TimeTypeConstants.SET] = innerResult.futureValue; + innerResult.pastResolution = {}; + innerResult.pastResolution[constants$2.TimeTypeConstants.SET] = innerResult.pastValue; + value = innerResult; + } + } + let ret = new parsers$4.DateTimeParseResult(er); + ret.value = value, ret.timexStr = value === null ? "" : value.timex, ret.resolutionStr = ""; + return ret; + } + parseEachUnit(text) { + let ret = new utilities$2.DateTimeResolutionResult(); + // handle "each month" + let match = recognizersText.RegExpUtility.getMatches(this.config.eachUnitRegex, text).pop(); + if (!match || match.length !== text.length) + return ret; + let sourceUnit = match.groups("unit").value; + if (recognizersText.StringUtility.isNullOrEmpty(sourceUnit) || !this.config.unitMap.has(sourceUnit)) + return ret; + let getMatchedUnitTimex = this.config.getMatchedUnitTimex(sourceUnit); + if (!getMatchedUnitTimex.matched) + return ret; + ret.timex = getMatchedUnitTimex.timex; + ret.futureValue = "Set: " + ret.timex; + ret.pastValue = "Set: " + ret.timex; + ret.success = true; + return ret; + } + parserTimeEveryday(text, refDate) { + let result = new utilities$2.DateTimeResolutionResult(); + let ers = this.config.timeExtractor.extract(text, refDate); + if (ers.length !== 1) + return result; + let er = ers[0]; + let beforeStr = text.substr(0, er.start); + let match = recognizersText.RegExpUtility.getMatches(this.config.eachDayRegex, beforeStr).pop(); + if (!match) + return result; + let pr = this.config.timeParser.parse(er); + result.timex = pr.timexStr; + result.futureValue = "Set: " + result.timex; + result.pastValue = "Set: " + result.timex; + result.success = true; + return result; + } + parseEach(extractor, parser, text, refDate) { + let result = new utilities$2.DateTimeResolutionResult(); + let ers = extractor.extract(text, refDate); + if (ers.length !== 1) + return result; + let er = ers[0]; + let beforeStr = text.substr(0, er.start); + let match = recognizersText.RegExpUtility.getMatches(this.config.eachPrefixRegex, beforeStr).pop(); + if (!match) + return result; + let timex = parser.parse(er).timexStr; + result.timex = timex; + result.futureValue = `Set: ${timex}`; + result.pastValue = `Set: ${timex}`; + result.success = true; + return result; + } +} +exports.ChineseSetParser = ChineseSetParser; + +}); + +unwrapExports(setConfiguration$6); + +var holidayConfiguration$6 = createCommonjsModule(function (module, exports) { +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); + + + +const recognizers_text_number_2 = recognizersTextNumber; + + + + +class ChineseHolidayExtractorConfiguration { + constructor() { + this.holidayRegexes = [ + recognizersText.RegExpUtility.getSafeRegExp(chineseDateTime.ChineseDateTime.HolidayRegexList1), + recognizersText.RegExpUtility.getSafeRegExp(chineseDateTime.ChineseDateTime.HolidayRegexList2), + recognizersText.RegExpUtility.getSafeRegExp(chineseDateTime.ChineseDateTime.LunarHolidayRegex) + ]; + } +} +exports.ChineseHolidayExtractorConfiguration = ChineseHolidayExtractorConfiguration; +class ChineseHolidayParserConfiguration extends baseHoliday.BaseHolidayParserConfiguration { + constructor() { + super(); + this.holidayRegexList = [ + recognizersText.RegExpUtility.getSafeRegExp(chineseDateTime.ChineseDateTime.HolidayRegexList1), + recognizersText.RegExpUtility.getSafeRegExp(chineseDateTime.ChineseDateTime.HolidayRegexList2), + recognizersText.RegExpUtility.getSafeRegExp(chineseDateTime.ChineseDateTime.LunarHolidayRegex) + ]; + this.holidayFuncDictionary = this.initHolidayFuncs(); + this.variableHolidaysTimexDictionary = chineseDateTime.ChineseDateTime.HolidayNoFixedTimex; + } + getSwiftYear(source) { + if (source.endsWith('年')) + return 0; + if (source.endsWith('去年')) + return -1; + if (source.endsWith('明年')) + return 1; + return null; + } + sanitizeHolidayToken(holiday) { + return holiday; + } + initHolidayFuncs() { + return new Map([ + ...super.initHolidayFuncs(), + ['父亲节', baseHoliday.BaseHolidayParserConfiguration.FathersDay], + ['母亲节', baseHoliday.BaseHolidayParserConfiguration.MothersDay], + ['感恩节', baseHoliday.BaseHolidayParserConfiguration.ThanksgivingDay] + ]); + } +} +class ChineseHolidayParser extends baseHoliday.BaseHolidayParser { + constructor() { + let config = new ChineseHolidayParserConfiguration(); + super(config); + this.lunarHolidayRegex = recognizersText.RegExpUtility.getSafeRegExp(chineseDateTime.ChineseDateTime.LunarHolidayRegex); + this.integerExtractor = new recognizersTextNumber.ChineseIntegerExtractor(); + this.numberParser = recognizersTextNumber.AgnosticNumberParserFactory.getParser(recognizersTextNumber.AgnosticNumberParserType.Integer, new recognizersTextNumber.ChineseNumberParserConfiguration()); + this.fixedHolidayDictionary = new Map([ + ['元旦', ChineseHolidayParser.NewYear], + ['元旦节', ChineseHolidayParser.NewYear], + ['教师节', ChineseHolidayParser.TeacherDay], + ['青年节', ChineseHolidayParser.YouthDay], + ['儿童节', ChineseHolidayParser.ChildrenDay], + ['妇女节', ChineseHolidayParser.FemaleDay], + ['植树节', ChineseHolidayParser.TreePlantDay], + ['情人节', ChineseHolidayParser.LoverDay], + ['圣诞节', ChineseHolidayParser.ChristmasDay], + ['新年', ChineseHolidayParser.NewYear], + ['愚人节', ChineseHolidayParser.FoolDay], + ['五一', ChineseHolidayParser.LaborDay], + ['劳动节', ChineseHolidayParser.LaborDay], + ['万圣节', ChineseHolidayParser.HalloweenDay], + ['中秋节', ChineseHolidayParser.MidautumnDay], + ['中秋', ChineseHolidayParser.MidautumnDay], + ['春节', ChineseHolidayParser.SpringDay], + ['除夕', ChineseHolidayParser.NewYearEve], + ['元宵节', ChineseHolidayParser.LanternDay], + ['清明节', ChineseHolidayParser.QingMingDay], + ['清明', ChineseHolidayParser.QingMingDay], + ['端午节', ChineseHolidayParser.DragonBoatDay], + ['端午', ChineseHolidayParser.DragonBoatDay], + ['国庆节', ChineseHolidayParser.ChsNationalDay], + ['建军节', ChineseHolidayParser.ChsMilBuildDay], + ['女生节', ChineseHolidayParser.GirlsDay], + ['光棍节', ChineseHolidayParser.SinglesDay], + ['双十一', ChineseHolidayParser.SinglesDay], + ['重阳节', ChineseHolidayParser.ChongYangDay] + ]); + } + static NewYear(year) { return new Date(year, 1 - 1, 1); } + static ChsNationalDay(year) { return new Date(year, 10 - 1, 1); } + static LaborDay(year) { return new Date(year, 5 - 1, 1); } + static ChristmasDay(year) { return new Date(year, 12 - 1, 25); } + static LoverDay(year) { return new Date(year, 2 - 1, 14); } + static ChsMilBuildDay(year) { return new Date(year, 8 - 1, 1); } + static FoolDay(year) { return new Date(year, 4 - 1, 1); } + static GirlsDay(year) { return new Date(year, 3 - 1, 7); } + static TreePlantDay(year) { return new Date(year, 3 - 1, 12); } + static FemaleDay(year) { return new Date(year, 3 - 1, 8); } + static ChildrenDay(year) { return new Date(year, 6 - 1, 1); } + static YouthDay(year) { return new Date(year, 5 - 1, 4); } + static TeacherDay(year) { return new Date(year, 9 - 1, 10); } + static SinglesDay(year) { return new Date(year, 11 - 1, 11); } + static HalloweenDay(year) { return new Date(year, 10 - 1, 31); } + static MidautumnDay(year) { return new Date(year, 8 - 1, 15); } + static SpringDay(year) { return new Date(year, 1 - 1, 1); } + static NewYearEve(year) { return utilities$2.DateUtils.addDays(new Date(year, 1 - 1, 1), -1); } + static LanternDay(year) { return new Date(year, 1 - 1, 15); } + static QingMingDay(year) { return new Date(year, 4 - 1, 4); } + static DragonBoatDay(year) { return new Date(year, 5 - 1, 5); } + static ChongYangDay(year) { return new Date(year, 9 - 1, 9); } + parse(er, referenceDate) { + if (!referenceDate) + referenceDate = new Date(); + let value = null; + if (er.type === baseHoliday.BaseHolidayParser.ParserName) { + let innerResult = this.parseHolidayRegexMatch(er.text, referenceDate); + if (innerResult.success) { + innerResult.futureResolution = {}; + innerResult.futureResolution[constants$2.TimeTypeConstants.DATE] = utilities$2.FormatUtil.formatDate(innerResult.futureValue); + innerResult.pastResolution = {}; + innerResult.pastResolution[constants$2.TimeTypeConstants.DATE] = utilities$2.FormatUtil.formatDate(innerResult.pastValue); + innerResult.isLunar = this.isLunar(er.text); + value = innerResult; + } + } + let ret = new parsers$4.DateTimeParseResult(er); + ret.value = value; + ret.timexStr = value === null ? "" : value.timex; + ret.resolutionStr = ""; + return ret; + } + isLunar(source) { + return recognizersText.RegExpUtility.isMatch(this.lunarHolidayRegex, source); + } + match2Date(match, referenceDate) { + let ret = new utilities$2.DateTimeResolutionResult(); + let holidayStr = this.config.sanitizeHolidayToken(match.groups("holiday").value.toLowerCase()); + if (recognizersText.StringUtility.isNullOrEmpty(holidayStr)) + return ret; + // get year (if exist) + let year = referenceDate.getFullYear(); + let yearNum = match.groups('year').value; + let yearChinese = match.groups('yearchs').value; + let yearRelative = match.groups('yearrel').value; + let hasYear = false; + if (!recognizersText.StringUtility.isNullOrEmpty(yearNum)) { + hasYear = true; + if (this.config.getSwiftYear(yearNum) === 0) { + yearNum = yearNum.substr(0, yearNum.length - 1); + } + year = this.convertYear(yearNum, false); + } + else if (!recognizersText.StringUtility.isNullOrEmpty(yearChinese)) { + hasYear = true; + if (this.config.getSwiftYear(yearChinese) === 0) { + yearChinese = yearChinese.substr(0, yearChinese.length - 1); + } + year = this.convertYear(yearChinese, true); + } + else if (!recognizersText.StringUtility.isNullOrEmpty(yearRelative)) { + hasYear = true; + year += this.config.getSwiftYear(yearRelative); + } + if (year < 100 && year >= 90) { + year += 1900; + } + else if (year < 100 && year < 20) { + year += 2000; + } + let timex = ''; + let date = new Date(referenceDate); + if (this.fixedHolidayDictionary.has(holidayStr)) { + date = this.fixedHolidayDictionary.get(holidayStr)(year); + timex = `-${utilities$2.FormatUtil.toString(date.getMonth() + 1, 2)}-${utilities$2.FormatUtil.toString(date.getDate(), 2)}`; + } + else if (this.config.holidayFuncDictionary.has(holidayStr)) { + date = this.config.holidayFuncDictionary.get(holidayStr)(year); + timex = this.config.variableHolidaysTimexDictionary.get(holidayStr); + } + else { + return ret; + } + if (hasYear) { + ret.timex = utilities$2.FormatUtil.toString(year, 4) + timex; + ret.futureValue = new Date(year, date.getMonth(), date.getDate()); + ret.pastValue = new Date(year, date.getMonth(), date.getDate()); + } + else { + ret.timex = "XXXX" + timex; + ret.futureValue = this.getDateValue(date, referenceDate, holidayStr, 1, (d, r) => d.getTime() < r.getTime()); + ret.pastValue = this.getDateValue(date, referenceDate, holidayStr, -1, (d, r) => d.getTime() >= r.getTime()); + } + ret.success = true; + return ret; + } + convertYear(yearStr, isChinese) { + let year = -1; + let er; + if (isChinese) { + let yearNum = 0; + er = this.integerExtractor.extract(yearStr).pop(); + if (er && er.type === recognizers_text_number_2.Constants.SYS_NUM_INTEGER) { + yearNum = Number.parseInt(this.numberParser.parse(er).value); + } + if (yearNum < 10) { + yearNum = 0; + for (let index = 0; index < yearStr.length; index++) { + let char = yearStr.charAt[index]; + yearNum *= 10; + er = this.integerExtractor.extract(char).pop(); + if (er && er.type === recognizers_text_number_2.Constants.SYS_NUM_INTEGER) { + yearNum += Number.parseInt(this.numberParser.parse(er).value); + } + } + } + else { + year = yearNum; + } + } + else { + year = Number.parseInt(yearStr, 10); + } + return year === 0 ? -1 : year; + } + getDateValue(date, referenceDate, holiday, swift, comparer) { + let result = new Date(date); + if (comparer(date, referenceDate)) { + if (this.fixedHolidayDictionary.has(holiday)) { + return utilities$2.DateUtils.addYears(date, swift); + } + if (this.config.holidayFuncDictionary.has(holiday)) { + result = this.config.holidayFuncDictionary.get(holiday)(referenceDate.getFullYear() + swift); + } + } + return result; + } +} +exports.ChineseHolidayParser = ChineseHolidayParser; + +}); + +unwrapExports(holidayConfiguration$6); + +var mergedConfiguration$6 = createCommonjsModule(function (module, exports) { +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); + + + + + + + + + + + + + + + +class ChineseMergedExtractorConfiguration { + constructor() { + this.dateExtractor = new dateConfiguration$6.ChineseDateExtractor(); + this.timeExtractor = new timeConfiguration$6.ChineseTimeExtractor(); + this.dateTimeExtractor = new dateTimeConfiguration$6.ChineseDateTimeExtractor(); + this.datePeriodExtractor = new datePeriodConfiguration$6.ChineseDatePeriodExtractor(); + this.timePeriodExtractor = new timePeriodConfiguration$6.ChineseTimePeriodExtractor(); + this.dateTimePeriodExtractor = new dateTimePeriodConfiguration$6.ChineseDateTimePeriodExtractor(); + this.setExtractor = new setConfiguration$6.ChineseSetExtractor(); + this.holidayExtractor = new baseHoliday.BaseHolidayExtractor(new holidayConfiguration$6.ChineseHolidayExtractorConfiguration()); + this.durationExtractor = new durationConfiguration$6.ChineseDurationExtractor(); + } +} +class ChineseMergedExtractor extends baseMerged.BaseMergedExtractor { + constructor(options) { + let config = new ChineseMergedExtractorConfiguration(); + super(config, options); + this.dayOfMonthRegex = recognizersText.RegExpUtility.getSafeRegExp(`^\\d{1,2}号`, 'gi'); + } + extract(source, refDate) { + if (!refDate) + refDate = new Date(); + let referenceDate = refDate; + let result = new Array(); + this.addTo(result, this.config.dateExtractor.extract(source, referenceDate), source); + this.addTo(result, this.config.timeExtractor.extract(source, referenceDate), source); + this.addTo(result, this.config.durationExtractor.extract(source, referenceDate), source); + this.addTo(result, this.config.datePeriodExtractor.extract(source, referenceDate), source); + this.addTo(result, this.config.dateTimeExtractor.extract(source, referenceDate), source); + this.addTo(result, this.config.timePeriodExtractor.extract(source, referenceDate), source); + this.addTo(result, this.config.dateTimePeriodExtractor.extract(source, referenceDate), source); + this.addTo(result, this.config.setExtractor.extract(source, referenceDate), source); + this.addTo(result, this.config.holidayExtractor.extract(source, referenceDate), source); + result = this.checkBlackList(result, source); + result = result.sort((a, b) => a.start - b.start); + return result; + } + addTo(destination, source, sourceStr) { + source.forEach(er => { + let isFound = false; + let rmIndex = -1; + let rmLength = 1; + for (let index = 0; index < destination.length; index++) { + if (recognizersText.ExtractResult.isOverlap(destination[index], er)) { + isFound = true; + if (er.length > destination[index].length) { + rmIndex = index; + let j = index + 1; + while (j < destination.length && recognizersText.ExtractResult.isOverlap(destination[j], er)) { + rmLength++; + j++; + } + } + break; + } + } + if (!isFound) { + destination.push(er); + } + else if (rmIndex >= 0) { + destination.splice(rmIndex, rmLength); + destination.splice(0, destination.length, ...this.moveOverlap(destination, er)); + destination.splice(rmIndex, 0, er); + } + }); + } + moveOverlap(destination, result) { + let duplicated = new Array(); + for (let i = 0; i < destination.length; i++) { + if (result.text.includes(destination[i].text) + && (result.start === destination[i].start || result.start + result.length === destination[i].start + destination[i].length)) { + duplicated.push(i); + } + } + return destination.filter((_, i) => duplicated.indexOf(i) < 0); + } + // ported from CheckBlackList + checkBlackList(destination, source) { + return destination.filter(value => { + let valueEnd = value.start + value.length; + if (valueEnd !== source.length) { + let lastChar = source.substr(valueEnd, 1); + if (value.text.endsWith('周') && lastChar === '岁') { + return false; + } + } + if (recognizersText.RegExpUtility.isMatch(this.dayOfMonthRegex, value.text)) { + return false; + } + return true; + }); + } +} +exports.ChineseMergedExtractor = ChineseMergedExtractor; +class ChineseMergedParserConfiguration { + constructor() { + this.beforeRegex = recognizersText.RegExpUtility.getSafeRegExp(chineseDateTime.ChineseDateTime.MergedBeforeRegex); + this.afterRegex = recognizersText.RegExpUtility.getSafeRegExp(chineseDateTime.ChineseDateTime.MergedAfterRegex); + this.sinceRegex = recognizersText.RegExpUtility.getSafeRegExp(chineseDateTime.ChineseDateTime.MergedAfterRegex); + this.dateParser = new dateConfiguration$6.ChineseDateParser(); + this.holidayParser = new holidayConfiguration$6.ChineseHolidayParser(); + this.timeParser = new timeConfiguration$6.ChineseTimeParser(); + this.dateTimeParser = new dateTimeConfiguration$6.ChineseDateTimeParser(); + this.datePeriodParser = new datePeriodConfiguration$6.ChineseDatePeriodParser(); + this.timePeriodParser = new timePeriodConfiguration$6.ChineseTimePeriodParser(); + this.dateTimePeriodParser = new dateTimePeriodConfiguration$6.ChineseDateTimePeriodParser(); + this.durationParser = new durationConfiguration$6.ChineseDurationParser(); + this.setParser = new setConfiguration$6.ChineseSetParser(); + } +} +class ChineseMergedParser extends baseMerged.BaseMergedParser { + constructor() { + let config = new ChineseMergedParserConfiguration(); + super(config, 0); + } + parse(er, refTime) { + let referenceTime = refTime || new Date(); + let pr = null; + // push, save teh MOD string + let hasBefore = recognizersText.RegExpUtility.isMatch(this.config.beforeRegex, er.text); + let hasAfter = recognizersText.RegExpUtility.isMatch(this.config.afterRegex, er.text); + let hasSince = recognizersText.RegExpUtility.isMatch(this.config.sinceRegex, er.text); + if (er.type === constants$2.Constants.SYS_DATETIME_DATE) { + pr = this.config.dateParser.parse(er, referenceTime); + if (pr.value === null || pr.value === undefined) { + pr = this.config.holidayParser.parse(er, referenceTime); + } + } + else if (er.type === constants$2.Constants.SYS_DATETIME_TIME) { + pr = this.config.timeParser.parse(er, referenceTime); + } + else if (er.type === constants$2.Constants.SYS_DATETIME_DATETIME) { + pr = this.config.dateTimeParser.parse(er, referenceTime); + } + else if (er.type === constants$2.Constants.SYS_DATETIME_DATEPERIOD) { + pr = this.config.datePeriodParser.parse(er, referenceTime); + } + else if (er.type === constants$2.Constants.SYS_DATETIME_TIMEPERIOD) { + pr = this.config.timePeriodParser.parse(er, referenceTime); + } + else if (er.type === constants$2.Constants.SYS_DATETIME_DATETIMEPERIOD) { + pr = this.config.dateTimePeriodParser.parse(er, referenceTime); + } + else if (er.type === constants$2.Constants.SYS_DATETIME_DURATION) { + pr = this.config.durationParser.parse(er, referenceTime); + } + else if (er.type === constants$2.Constants.SYS_DATETIME_SET) { + pr = this.config.setParser.parse(er, referenceTime); + } + else { + return null; + } + // pop, restore the MOD string + if (hasBefore && pr.value !== null) { + let val = pr.value; + val.mod = constants$2.TimeTypeConstants.beforeMod; + pr.value = val; + } + if (hasAfter && pr.value !== null) { + let val = pr.value; + val.mod = constants$2.TimeTypeConstants.afterMod; + pr.value = val; + } + if (hasSince && pr.value !== null) { + let val = pr.value; + val.mod = constants$2.TimeTypeConstants.sinceMod; + pr.value = val; + } + pr.value = this.dateTimeResolution(pr, hasBefore, hasAfter, hasSince); + pr.type = `${this.parserTypeName}.${this.determineDateTimeType(er.type, hasBefore, hasAfter, hasSince)}`; + return pr; + } +} +exports.ChineseMergedParser = ChineseMergedParser; +class ChineseFullMergedParser extends baseMerged.BaseMergedParser { + constructor() { + let config = new ChineseMergedParserConfiguration(); + super(config, 0); + } + parse(er, refTime) { + let referenceTime = refTime || new Date(); + let pr = null; + // push, save teh MOD string + let hasBefore = false; + let hasAfter = false; + let modStr = ""; + let beforeMatch = recognizersText.RegExpUtility.getMatches(this.config.beforeRegex, er.text).pop(); + let afterMatch = recognizersText.RegExpUtility.getMatches(this.config.afterRegex, er.text).pop(); + if (beforeMatch) { + hasBefore = true; + er.start += beforeMatch.length; + er.length -= beforeMatch.length; + er.text = er.text.substring(beforeMatch.length); + modStr = beforeMatch.value; + } + else if (afterMatch) { + hasAfter = true; + er.start += afterMatch.length; + er.length -= afterMatch.length; + er.text = er.text.substring(afterMatch.length); + modStr = afterMatch.value; + } + if (er.type === constants$2.Constants.SYS_DATETIME_DATE) { + pr = this.config.dateParser.parse(er, referenceTime); + if (pr.value === null || pr.value === undefined) { + pr = this.config.holidayParser.parse(er, referenceTime); + } + } + else if (er.type === constants$2.Constants.SYS_DATETIME_TIME) { + pr = this.config.timeParser.parse(er, referenceTime); + } + else if (er.type === constants$2.Constants.SYS_DATETIME_DATETIME) { + pr = this.config.dateTimeParser.parse(er, referenceTime); + } + else if (er.type === constants$2.Constants.SYS_DATETIME_DATEPERIOD) { + pr = this.config.datePeriodParser.parse(er, referenceTime); + } + else if (er.type === constants$2.Constants.SYS_DATETIME_TIMEPERIOD) { + pr = this.config.timePeriodParser.parse(er, referenceTime); + } + else if (er.type === constants$2.Constants.SYS_DATETIME_DATETIMEPERIOD) { + pr = this.config.dateTimePeriodParser.parse(er, referenceTime); + } + else if (er.type === constants$2.Constants.SYS_DATETIME_DURATION) { + pr = this.config.durationParser.parse(er, referenceTime); + } + else if (er.type === constants$2.Constants.SYS_DATETIME_SET) { + pr = this.config.setParser.parse(er, referenceTime); + } + else { + return null; + } + // pop, restore the MOD string + if (hasBefore && pr.value !== null) { + pr.length += modStr.length; + pr.start -= modStr.length; + pr.text = modStr + pr.text; + let val = pr.value; + val.mod = constants$2.TimeTypeConstants.beforeMod; + pr.value = val; + } + if (hasAfter && pr.value !== null) { + pr.length += modStr.length; + pr.start -= modStr.length; + pr.text = modStr + pr.text; + let val = pr.value; + val.mod = constants$2.TimeTypeConstants.afterMod; + pr.value = val; + } + pr.value = this.dateTimeResolution(pr, hasBefore, hasAfter); + pr.type = `${this.parserTypeName}.${this.determineDateTimeType(er.type, hasBefore, hasAfter)}`; + return pr; + } + dateTimeResolution(slot, hasBefore, hasAfter, hasSince = false) { + if (!slot) + return null; + let result = new Map(); + let resolutions = new Array(); + let type = slot.type; + let outputType = this.determineDateTimeType(type, hasBefore, hasAfter); + let timex = slot.timexStr; + let value = slot.value; + if (!value) + return null; + let isLunar = value.isLunar; + let mod = value.mod; + let comment = value.comment; + // the following should added to res first since the ResolveAmPm is using these fields + this.addResolutionFieldsAny(result, constants$2.Constants.TimexKey, timex); + this.addResolutionFieldsAny(result, constants$2.Constants.CommentKey, comment); + this.addResolutionFieldsAny(result, constants$2.Constants.ModKey, mod); + this.addResolutionFieldsAny(result, constants$2.Constants.TypeKey, outputType); + let futureResolution = value.futureResolution; + let pastResolution = value.pastResolution; + let future = this.generateFromResolution(type, futureResolution, mod); + let past = this.generateFromResolution(type, pastResolution, mod); + let futureValues = Array.from(this.getValues(future)).sort(); + let pastValues = Array.from(this.getValues(past)).sort(); + if (lodash_isequal(futureValues, pastValues)) { + if (pastValues.length > 0) + this.addResolutionFieldsAny(result, constants$2.Constants.ResolveKey, past); + } + else { + if (pastValues.length > 0) + this.addResolutionFieldsAny(result, constants$2.Constants.ResolveToPastKey, past); + if (futureValues.length > 0) + this.addResolutionFieldsAny(result, constants$2.Constants.ResolveToFutureKey, future); + } + if (comment && comment === 'ampm') { + if (result.has('resolve')) { + this.resolveAMPM(result, 'resolve'); + } + else { + this.resolveAMPM(result, 'resolveToPast'); + this.resolveAMPM(result, 'resolveToFuture'); + } + } + if (isLunar) { + this.addResolutionFieldsAny(result, constants$2.Constants.IsLunarKey, isLunar); + } + result.forEach((value, key) => { + if (this.isObject(value)) { + // is "StringMap" + let newValues = {}; + this.addResolutionFields(newValues, constants$2.Constants.TimexKey, timex); + this.addResolutionFields(newValues, constants$2.Constants.ModKey, mod); + this.addResolutionFields(newValues, constants$2.Constants.TypeKey, outputType); + Object.keys(value).forEach((innerKey) => { + newValues[innerKey] = value[innerKey]; + }); + resolutions.push(newValues); + } + }); + if (Object.keys(past).length === 0 && Object.keys(future).length === 0) { + let o = {}; + o['timex'] = timex; + o['type'] = outputType; + o['value'] = 'not resolved'; + resolutions.push(o); + } + return { + values: resolutions + }; + } + determineDateTimeType(type, hasBefore, hasAfter, hasSince = false) { + if (hasBefore || hasAfter || hasSince) { + if (type === constants$2.Constants.SYS_DATETIME_DATE) + return constants$2.Constants.SYS_DATETIME_DATEPERIOD; + if (type === constants$2.Constants.SYS_DATETIME_TIME) + return constants$2.Constants.SYS_DATETIME_TIMEPERIOD; + if (type === constants$2.Constants.SYS_DATETIME_DATETIME) + return constants$2.Constants.SYS_DATETIME_DATETIMEPERIOD; + } + return type; + } +} +exports.ChineseFullMergedParser = ChineseFullMergedParser; + +}); + +unwrapExports(mergedConfiguration$6); + +var dateTimeRecognizer = createCommonjsModule(function (module, exports) { +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); + + + + + + + + + +var DateTimeOptions; +(function (DateTimeOptions) { + DateTimeOptions[DateTimeOptions["None"] = 0] = "None"; + DateTimeOptions[DateTimeOptions["SkipFromToMerge"] = 1] = "SkipFromToMerge"; + DateTimeOptions[DateTimeOptions["SplitDateAndTime"] = 2] = "SplitDateAndTime"; + DateTimeOptions[DateTimeOptions["Calendar"] = 4] = "Calendar"; +})(DateTimeOptions = exports.DateTimeOptions || (exports.DateTimeOptions = {})); +function recognizeDateTime(query, culture, options = DateTimeOptions.None, referenceDate = new Date(), fallbackToDefaultCulture = true) { + let recognizer = new DateTimeRecognizer(culture, options); + let model = recognizer.getDateTimeModel(culture, fallbackToDefaultCulture); + return model.parse(query, referenceDate); +} +exports.recognizeDateTime = recognizeDateTime; +class DateTimeRecognizer extends recognizersText.Recognizer { + constructor(culture, options = DateTimeOptions.None, lazyInitialization = false) { + super(culture, options, lazyInitialization); + } + InitializeConfiguration() { + //#region English + this.registerModel("DateTimeModel", recognizersTextNumber.Culture.English, (options) => new models$4.DateTimeModel(new baseMerged.BaseMergedParser(new mergedConfiguration.EnglishMergedParserConfiguration(new baseConfiguration.EnglishCommonDateTimeParserConfiguration()), this.Options), new baseMerged.BaseMergedExtractor(new mergedConfiguration.EnglishMergedExtractorConfiguration(), this.Options))); + //#endregion + //#region Spanish + this.registerModel("DateTimeModel", recognizersTextNumber.Culture.Spanish, (options) => new models$4.DateTimeModel(new baseMerged.BaseMergedParser(new mergedConfiguration$2.SpanishMergedParserConfiguration(), this.Options), new baseMerged.BaseMergedExtractor(new mergedConfiguration$2.SpanishMergedExtractorConfiguration(), this.Options))); + //#endregion + //#region Chinese + this.registerModel("DateTimeModel", recognizersTextNumber.Culture.Chinese, (options) => new models$4.DateTimeModel(new mergedConfiguration$6.ChineseFullMergedParser(), new mergedConfiguration$6.ChineseMergedExtractor(this.Options))); + //#endregion + //#region French + this.registerModel("DateTimeModel", recognizersTextNumber.Culture.French, (options) => new models$4.DateTimeModel(new baseMerged.BaseMergedParser(new mergedConfiguration$4.FrenchMergedParserConfiguration(), this.Options), new baseMerged.BaseMergedExtractor(new mergedConfiguration$4.FrenchMergedExtractorConfiguration(), this.Options))); + //#endregion + } + IsValidOptions(options) { + return options >= 0 && options <= DateTimeOptions.None + DateTimeOptions.SkipFromToMerge + DateTimeOptions.SplitDateAndTime + DateTimeOptions.Calendar; + } + getDateTimeModel(culture = null, fallbackToDefaultCulture = true) { + return this.getModel("DateTimeModel", culture, fallbackToDefaultCulture); + } +} +exports.default = DateTimeRecognizer; + +}); + +unwrapExports(dateTimeRecognizer); + +var timeParser = createCommonjsModule(function (module, exports) { +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); + + + + +class FrenchTimeParser extends baseTime.BaseTimeParser { + constructor(config) { + super(config); + } + internalParse(text, referenceTime) { + let ret = super.internalParse(text, referenceTime); + if (!ret.success) { + ret = this.parseIsh(text, referenceTime); + } + return ret; + } + parseIsh(text, referenceTime) { + let ret = new utilities$2.DateTimeResolutionResult(); + let trimedText = text.trim().toLowerCase(); + let matches = recognizersText.RegExpUtility.getMatches(recognizersText.RegExpUtility.getSafeRegExp(frenchDateTime.FrenchDateTime.IshRegex), text); + if (matches.length && matches[0].index === 0 && matches[0].length === trimedText.length) { + let hourStr = matches[0].groups("hour").value; + let hour = 12; + if (hourStr) { + hour = parseInt(hourStr, 10); + } + ret.timex = "T" + utilities$2.FormatUtil.toString(hour, 2); + ret.futureValue = + ret.pastValue = + utilities$2.DateUtils.safeCreateFromMinValue(referenceTime.getFullYear(), referenceTime.getMonth(), referenceTime.getDate(), hour, 0, 0); + ret.success = true; + } + return ret; + } +} +exports.FrenchTimeParser = FrenchTimeParser; + +}); + +unwrapExports(timeParser); + +var recognizersTextDateTime = createCommonjsModule(function (module, exports) { +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); + +exports.DateTimeRecognizer = dateTimeRecognizer.default; +exports.DateTimeOptions = dateTimeRecognizer.DateTimeOptions; +exports.recognizeDateTime = dateTimeRecognizer.recognizeDateTime; + +exports.Culture = recognizersTextNumber.Culture; +exports.CultureInfo = recognizersTextNumber.CultureInfo; + +exports.BaseDateExtractor = baseDate.BaseDateExtractor; +exports.BaseDateParser = baseDate.BaseDateParser; + +exports.BaseTimeExtractor = baseTime.BaseTimeExtractor; +exports.BaseTimeParser = baseTime.BaseTimeParser; + +exports.BaseDatePeriodExtractor = baseDatePeriod.BaseDatePeriodExtractor; +exports.BaseDatePeriodParser = baseDatePeriod.BaseDatePeriodParser; + +exports.BaseTimePeriodExtractor = baseTimePeriod.BaseTimePeriodExtractor; +exports.BaseTimePeriodParser = baseTimePeriod.BaseTimePeriodParser; + +exports.BaseDateTimeExtractor = baseDateTime$2.BaseDateTimeExtractor; +exports.BaseDateTimeParser = baseDateTime$2.BaseDateTimeParser; + +exports.BaseDateTimePeriodExtractor = baseDateTimePeriod.BaseDateTimePeriodExtractor; +exports.BaseDateTimePeriodParser = baseDateTimePeriod.BaseDateTimePeriodParser; + +exports.BaseDurationExtractor = baseDuration.BaseDurationExtractor; +exports.BaseDurationParser = baseDuration.BaseDurationParser; + +exports.BaseSetExtractor = baseSet.BaseSetExtractor; +exports.BaseSetParser = baseSet.BaseSetParser; + +exports.BaseHolidayExtractor = baseHoliday.BaseHolidayExtractor; +exports.BaseHolidayParser = baseHoliday.BaseHolidayParser; +exports.BaseHolidayParserConfiguration = baseHoliday.BaseHolidayParserConfiguration; + +exports.BaseMergedExtractor = baseMerged.BaseMergedExtractor; +exports.BaseMergedParser = baseMerged.BaseMergedParser; + +exports.Constants = constants$2.Constants; +exports.TimeTypeConstants = constants$2.TimeTypeConstants; + +exports.DateTimeModelResult = models$4.DateTimeModelResult; +exports.DateTimeModel = models$4.DateTimeModel; + +exports.DateTimeParseResult = parsers$4.DateTimeParseResult; +exports.BaseDateParserConfiguration = parsers$4.BaseDateParserConfiguration; + +exports.Token = utilities$2.Token; +exports.AgoLaterMode = utilities$2.AgoLaterMode; +exports.AgoLaterUtil = utilities$2.AgoLaterUtil; +exports.MatchingUtil = utilities$2.MatchingUtil; +exports.FormatUtil = utilities$2.FormatUtil; +exports.DateTimeResolutionResult = utilities$2.DateTimeResolutionResult; +exports.DateUtils = utilities$2.DateUtils; +exports.DayOfWeek = utilities$2.DayOfWeek; + +exports.EnglishCommonDateTimeParserConfiguration = baseConfiguration.EnglishCommonDateTimeParserConfiguration; +exports.EnglishDateTimeUtilityConfiguration = baseConfiguration.EnglishDateTimeUtilityConfiguration; + +exports.EnglishDateExtractorConfiguration = dateConfiguration.EnglishDateExtractorConfiguration; +exports.EnglishDateParserConfiguration = dateConfiguration.EnglishDateParserConfiguration; + +exports.EnglishTimeExtractorConfiguration = timeConfiguration.EnglishTimeExtractorConfiguration; +exports.EnglishTimeParserConfiguration = timeConfiguration.EnglishTimeParserConfiguration; + +exports.EnglishDatePeriodExtractorConfiguration = datePeriodConfiguration.EnglishDatePeriodExtractorConfiguration; +exports.EnglishDatePeriodParserConfiguration = datePeriodConfiguration.EnglishDatePeriodParserConfiguration; + +exports.EnglishTimePeriodExtractorConfiguration = timePeriodConfiguration.EnglishTimePeriodExtractorConfiguration; +exports.EnglishTimePeriodParserConfiguration = timePeriodConfiguration.EnglishTimePeriodParserConfiguration; + +exports.EnglishDateTimeExtractorConfiguration = dateTimeConfiguration.EnglishDateTimeExtractorConfiguration; +exports.EnglishDateTimeParserConfiguration = dateTimeConfiguration.EnglishDateTimeParserConfiguration; + +exports.EnglishDateTimePeriodExtractorConfiguration = dateTimePeriodConfiguration.EnglishDateTimePeriodExtractorConfiguration; +exports.EnglishDateTimePeriodParserConfiguration = dateTimePeriodConfiguration.EnglishDateTimePeriodParserConfiguration; + +exports.EnglishSetExtractorConfiguration = setConfiguration.EnglishSetExtractorConfiguration; +exports.EnglishSetParserConfiguration = setConfiguration.EnglishSetParserConfiguration; + +exports.EnglishDurationExtractorConfiguration = durationConfiguration.EnglishDurationExtractorConfiguration; +exports.EnglishDurationParserConfiguration = durationConfiguration.EnglishDurationParserConfiguration; + +exports.EnglishHolidayExtractorConfiguration = holidayConfiguration.EnglishHolidayExtractorConfiguration; +exports.EnglishHolidayParserConfiguration = holidayConfiguration.EnglishHolidayParserConfiguration; + +exports.EnglishMergedExtractorConfiguration = mergedConfiguration.EnglishMergedExtractorConfiguration; +exports.EnglishMergedParserConfiguration = mergedConfiguration.EnglishMergedParserConfiguration; + +exports.EnglishTimeParser = parsers$6.EnglishTimeParser; + +exports.SpanishCommonDateTimeParserConfiguration = baseConfiguration$2.SpanishCommonDateTimeParserConfiguration; +exports.SpanishDateTimeUtilityConfiguration = baseConfiguration$2.SpanishDateTimeUtilityConfiguration; + +exports.SpanishDateExtractorConfiguration = dateConfiguration$2.SpanishDateExtractorConfiguration; +exports.SpanishDateParserConfiguration = dateConfiguration$2.SpanishDateParserConfiguration; + +exports.SpanishTimeExtractorConfiguration = timeConfiguration$2.SpanishTimeExtractorConfiguration; +exports.SpanishTimeParserConfiguration = timeConfiguration$2.SpanishTimeParserConfiguration; + +exports.SpanishDatePeriodExtractorConfiguration = datePeriodConfiguration$2.SpanishDatePeriodExtractorConfiguration; +exports.SpanishDatePeriodParserConfiguration = datePeriodConfiguration$2.SpanishDatePeriodParserConfiguration; + +exports.SpanishTimePeriodExtractorConfiguration = timePeriodConfiguration$2.SpanishTimePeriodExtractorConfiguration; +exports.SpanishTimePeriodParserConfiguration = timePeriodConfiguration$2.SpanishTimePeriodParserConfiguration; + +exports.SpanishDateTimeExtractorConfiguration = dateTimeConfiguration$2.SpanishDateTimeExtractorConfiguration; +exports.SpanishDateTimeParserConfiguration = dateTimeConfiguration$2.SpanishDateTimeParserConfiguration; + +exports.SpanishDateTimePeriodExtractorConfiguration = dateTimePeriodConfiguration$2.SpanishDateTimePeriodExtractorConfiguration; +exports.SpanishDateTimePeriodParserConfiguration = dateTimePeriodConfiguration$2.SpanishDateTimePeriodParserConfiguration; + +exports.SpanishSetExtractorConfiguration = setConfiguration$2.SpanishSetExtractorConfiguration; +exports.SpanishSetParserConfiguration = setConfiguration$2.SpanishSetParserConfiguration; + +exports.SpanishDurationExtractorConfiguration = durationConfiguration$2.SpanishDurationExtractorConfiguration; +exports.SpanishDurationParserConfiguration = durationConfiguration$2.SpanishDurationParserConfiguration; + +exports.SpanishHolidayExtractorConfiguration = holidayConfiguration$2.SpanishHolidayExtractorConfiguration; +exports.SpanishHolidayParserConfiguration = holidayConfiguration$2.SpanishHolidayParserConfiguration; + +exports.SpanishMergedExtractorConfiguration = mergedConfiguration$2.SpanishMergedExtractorConfiguration; +exports.SpanishMergedParserConfiguration = mergedConfiguration$2.SpanishMergedParserConfiguration; + +exports.SpanishDateTimePeriodParser = dateTimePeriodParser.SpanishDateTimePeriodParser; + +exports.FrenchCommonDateTimeParserConfiguration = baseConfiguration$4.FrenchCommonDateTimeParserConfiguration; +exports.FrenchDateTimeUtilityConfiguration = baseConfiguration$4.FrenchDateTimeUtilityConfiguration; + +exports.FrenchDateExtractorConfiguration = dateConfiguration$4.FrenchDateExtractorConfiguration; +exports.FrenchDateParserConfiguration = dateConfiguration$4.FrenchDateParserConfiguration; + +exports.FrenchTimeExtractorConfiguration = timeConfiguration$4.FrenchTimeExtractorConfiguration; +exports.FrenchTimeParserConfiguration = timeConfiguration$4.FrenchTimeParserConfiguration; + +exports.FrenchDatePeriodExtractorConfiguration = datePeriodConfiguration$4.FrenchDatePeriodExtractorConfiguration; +exports.FrenchDatePeriodParserConfiguration = datePeriodConfiguration$4.FrenchDatePeriodParserConfiguration; + +exports.FrenchTimePeriodExtractorConfiguration = timePeriodConfiguration$4.FrenchTimePeriodExtractorConfiguration; +exports.FrenchTimePeriodParserConfiguration = timePeriodConfiguration$4.FrenchTimePeriodParserConfiguration; + +exports.FrenchDateTimeExtractorConfiguration = dateTimeConfiguration$4.FrenchDateTimeExtractorConfiguration; +exports.FrenchDateTimeParserConfiguration = dateTimeConfiguration$4.FrenchDateTimeParserConfiguration; + +exports.FrenchDateTimePeriodExtractorConfiguration = dateTimePeriodConfiguration$4.FrenchDateTimePeriodExtractorConfiguration; +exports.FrenchDateTimePeriodParserConfiguration = dateTimePeriodConfiguration$4.FrenchDateTimePeriodParserConfiguration; + +exports.FrenchSetExtractorConfiguration = setConfiguration$4.FrenchSetExtractorConfiguration; +exports.FrenchSetParserConfiguration = setConfiguration$4.FrenchSetParserConfiguration; + +exports.FrenchDurationExtractorConfiguration = durationConfiguration$4.FrenchDurationExtractorConfiguration; +exports.FrenchDurationParserConfiguration = durationConfiguration$4.FrenchDurationParserConfiguration; + +exports.FrenchHolidayExtractorConfiguration = holidayConfiguration$4.FrenchHolidayExtractorConfiguration; +exports.FrenchHolidayParserConfiguration = holidayConfiguration$4.FrenchHolidayParserConfiguration; + +exports.FrenchMergedExtractorConfiguration = mergedConfiguration$4.FrenchMergedExtractorConfiguration; +exports.FrenchMergedParserConfiguration = mergedConfiguration$4.FrenchMergedParserConfiguration; + +exports.FrenchTimeParser = timeParser.FrenchTimeParser; + +exports.ChineseDurationExtractor = durationConfiguration$6.ChineseDurationExtractor; +exports.ChineseDurationParser = durationConfiguration$6.ChineseDurationParser; + +exports.ChineseTimeExtractor = timeConfiguration$6.ChineseTimeExtractor; +exports.ChineseTimeParser = timeConfiguration$6.ChineseTimeParser; + +exports.ChineseTimePeriodExtractor = timePeriodConfiguration$6.ChineseTimePeriodExtractor; +exports.ChineseTimePeriodParser = timePeriodConfiguration$6.ChineseTimePeriodParser; + +exports.ChineseDateExtractor = dateConfiguration$6.ChineseDateExtractor; +exports.ChineseDateParser = dateConfiguration$6.ChineseDateParser; + +exports.ChineseDatePeriodExtractor = datePeriodConfiguration$6.ChineseDatePeriodExtractor; +exports.ChineseDatePeriodParser = datePeriodConfiguration$6.ChineseDatePeriodParser; + +exports.ChineseDateTimeExtractor = dateTimeConfiguration$6.ChineseDateTimeExtractor; +exports.ChineseDateTimeParser = dateTimeConfiguration$6.ChineseDateTimeParser; + +exports.ChineseDateTimePeriodExtractor = dateTimePeriodConfiguration$6.ChineseDateTimePeriodExtractor; +exports.ChineseDateTimePeriodParser = dateTimePeriodConfiguration$6.ChineseDateTimePeriodParser; + +exports.ChineseSetExtractor = setConfiguration$6.ChineseSetExtractor; +exports.ChineseSetParser = setConfiguration$6.ChineseSetParser; + +exports.ChineseHolidayExtractorConfiguration = holidayConfiguration$6.ChineseHolidayExtractorConfiguration; +exports.ChineseHolidayParser = holidayConfiguration$6.ChineseHolidayParser; + +exports.ChineseMergedExtractor = mergedConfiguration$6.ChineseMergedExtractor; +exports.ChineseMergedParser = mergedConfiguration$6.ChineseMergedParser; +exports.ChineseFullMergedParser = mergedConfiguration$6.ChineseFullMergedParser; + +exports.BaseDateTime = baseDateTime.BaseDateTime; + +exports.EnglishDateTime = englishDateTime.EnglishDateTime; + +exports.SpanishDateTime = spanishDateTime.SpanishDateTime; + +exports.FrenchDateTime = frenchDateTime.FrenchDateTime; + +exports.ChineseDateTime = chineseDateTime.ChineseDateTime; + +}); + +var recognizersTextDateTime$1 = unwrapExports(recognizersTextDateTime); +var recognizersTextDateTime_1 = recognizersTextDateTime.DateTimeRecognizer; +var recognizersTextDateTime_2 = recognizersTextDateTime.DateTimeOptions; +var recognizersTextDateTime_3 = recognizersTextDateTime.recognizeDateTime; +var recognizersTextDateTime_4 = recognizersTextDateTime.Culture; +var recognizersTextDateTime_5 = recognizersTextDateTime.CultureInfo; +var recognizersTextDateTime_6 = recognizersTextDateTime.BaseDateExtractor; +var recognizersTextDateTime_7 = recognizersTextDateTime.BaseDateParser; +var recognizersTextDateTime_8 = recognizersTextDateTime.BaseTimeExtractor; +var recognizersTextDateTime_9 = recognizersTextDateTime.BaseTimeParser; +var recognizersTextDateTime_10 = recognizersTextDateTime.BaseDatePeriodExtractor; +var recognizersTextDateTime_11 = recognizersTextDateTime.BaseDatePeriodParser; +var recognizersTextDateTime_12 = recognizersTextDateTime.BaseTimePeriodExtractor; +var recognizersTextDateTime_13 = recognizersTextDateTime.BaseTimePeriodParser; +var recognizersTextDateTime_14 = recognizersTextDateTime.BaseDateTimeExtractor; +var recognizersTextDateTime_15 = recognizersTextDateTime.BaseDateTimeParser; +var recognizersTextDateTime_16 = recognizersTextDateTime.BaseDateTimePeriodExtractor; +var recognizersTextDateTime_17 = recognizersTextDateTime.BaseDateTimePeriodParser; +var recognizersTextDateTime_18 = recognizersTextDateTime.BaseDurationExtractor; +var recognizersTextDateTime_19 = recognizersTextDateTime.BaseDurationParser; +var recognizersTextDateTime_20 = recognizersTextDateTime.BaseSetExtractor; +var recognizersTextDateTime_21 = recognizersTextDateTime.BaseSetParser; +var recognizersTextDateTime_22 = recognizersTextDateTime.BaseHolidayExtractor; +var recognizersTextDateTime_23 = recognizersTextDateTime.BaseHolidayParser; +var recognizersTextDateTime_24 = recognizersTextDateTime.BaseHolidayParserConfiguration; +var recognizersTextDateTime_25 = recognizersTextDateTime.BaseMergedExtractor; +var recognizersTextDateTime_26 = recognizersTextDateTime.BaseMergedParser; +var recognizersTextDateTime_27 = recognizersTextDateTime.Constants; +var recognizersTextDateTime_28 = recognizersTextDateTime.TimeTypeConstants; +var recognizersTextDateTime_29 = recognizersTextDateTime.DateTimeModelResult; +var recognizersTextDateTime_30 = recognizersTextDateTime.DateTimeModel; +var recognizersTextDateTime_31 = recognizersTextDateTime.DateTimeParseResult; +var recognizersTextDateTime_32 = recognizersTextDateTime.BaseDateParserConfiguration; +var recognizersTextDateTime_33 = recognizersTextDateTime.Token; +var recognizersTextDateTime_34 = recognizersTextDateTime.AgoLaterMode; +var recognizersTextDateTime_35 = recognizersTextDateTime.AgoLaterUtil; +var recognizersTextDateTime_36 = recognizersTextDateTime.MatchingUtil; +var recognizersTextDateTime_37 = recognizersTextDateTime.FormatUtil; +var recognizersTextDateTime_38 = recognizersTextDateTime.DateTimeResolutionResult; +var recognizersTextDateTime_39 = recognizersTextDateTime.DateUtils; +var recognizersTextDateTime_40 = recognizersTextDateTime.DayOfWeek; +var recognizersTextDateTime_41 = recognizersTextDateTime.EnglishCommonDateTimeParserConfiguration; +var recognizersTextDateTime_42 = recognizersTextDateTime.EnglishDateTimeUtilityConfiguration; +var recognizersTextDateTime_43 = recognizersTextDateTime.EnglishDateExtractorConfiguration; +var recognizersTextDateTime_44 = recognizersTextDateTime.EnglishDateParserConfiguration; +var recognizersTextDateTime_45 = recognizersTextDateTime.EnglishTimeExtractorConfiguration; +var recognizersTextDateTime_46 = recognizersTextDateTime.EnglishTimeParserConfiguration; +var recognizersTextDateTime_47 = recognizersTextDateTime.EnglishDatePeriodExtractorConfiguration; +var recognizersTextDateTime_48 = recognizersTextDateTime.EnglishDatePeriodParserConfiguration; +var recognizersTextDateTime_49 = recognizersTextDateTime.EnglishTimePeriodExtractorConfiguration; +var recognizersTextDateTime_50 = recognizersTextDateTime.EnglishTimePeriodParserConfiguration; +var recognizersTextDateTime_51 = recognizersTextDateTime.EnglishDateTimeExtractorConfiguration; +var recognizersTextDateTime_52 = recognizersTextDateTime.EnglishDateTimeParserConfiguration; +var recognizersTextDateTime_53 = recognizersTextDateTime.EnglishDateTimePeriodExtractorConfiguration; +var recognizersTextDateTime_54 = recognizersTextDateTime.EnglishDateTimePeriodParserConfiguration; +var recognizersTextDateTime_55 = recognizersTextDateTime.EnglishSetExtractorConfiguration; +var recognizersTextDateTime_56 = recognizersTextDateTime.EnglishSetParserConfiguration; +var recognizersTextDateTime_57 = recognizersTextDateTime.EnglishDurationExtractorConfiguration; +var recognizersTextDateTime_58 = recognizersTextDateTime.EnglishDurationParserConfiguration; +var recognizersTextDateTime_59 = recognizersTextDateTime.EnglishHolidayExtractorConfiguration; +var recognizersTextDateTime_60 = recognizersTextDateTime.EnglishHolidayParserConfiguration; +var recognizersTextDateTime_61 = recognizersTextDateTime.EnglishMergedExtractorConfiguration; +var recognizersTextDateTime_62 = recognizersTextDateTime.EnglishMergedParserConfiguration; +var recognizersTextDateTime_63 = recognizersTextDateTime.EnglishTimeParser; +var recognizersTextDateTime_64 = recognizersTextDateTime.SpanishCommonDateTimeParserConfiguration; +var recognizersTextDateTime_65 = recognizersTextDateTime.SpanishDateTimeUtilityConfiguration; +var recognizersTextDateTime_66 = recognizersTextDateTime.SpanishDateExtractorConfiguration; +var recognizersTextDateTime_67 = recognizersTextDateTime.SpanishDateParserConfiguration; +var recognizersTextDateTime_68 = recognizersTextDateTime.SpanishTimeExtractorConfiguration; +var recognizersTextDateTime_69 = recognizersTextDateTime.SpanishTimeParserConfiguration; +var recognizersTextDateTime_70 = recognizersTextDateTime.SpanishDatePeriodExtractorConfiguration; +var recognizersTextDateTime_71 = recognizersTextDateTime.SpanishDatePeriodParserConfiguration; +var recognizersTextDateTime_72 = recognizersTextDateTime.SpanishTimePeriodExtractorConfiguration; +var recognizersTextDateTime_73 = recognizersTextDateTime.SpanishTimePeriodParserConfiguration; +var recognizersTextDateTime_74 = recognizersTextDateTime.SpanishDateTimeExtractorConfiguration; +var recognizersTextDateTime_75 = recognizersTextDateTime.SpanishDateTimeParserConfiguration; +var recognizersTextDateTime_76 = recognizersTextDateTime.SpanishDateTimePeriodExtractorConfiguration; +var recognizersTextDateTime_77 = recognizersTextDateTime.SpanishDateTimePeriodParserConfiguration; +var recognizersTextDateTime_78 = recognizersTextDateTime.SpanishSetExtractorConfiguration; +var recognizersTextDateTime_79 = recognizersTextDateTime.SpanishSetParserConfiguration; +var recognizersTextDateTime_80 = recognizersTextDateTime.SpanishDurationExtractorConfiguration; +var recognizersTextDateTime_81 = recognizersTextDateTime.SpanishDurationParserConfiguration; +var recognizersTextDateTime_82 = recognizersTextDateTime.SpanishHolidayExtractorConfiguration; +var recognizersTextDateTime_83 = recognizersTextDateTime.SpanishHolidayParserConfiguration; +var recognizersTextDateTime_84 = recognizersTextDateTime.SpanishMergedExtractorConfiguration; +var recognizersTextDateTime_85 = recognizersTextDateTime.SpanishMergedParserConfiguration; +var recognizersTextDateTime_86 = recognizersTextDateTime.SpanishDateTimePeriodParser; +var recognizersTextDateTime_87 = recognizersTextDateTime.FrenchCommonDateTimeParserConfiguration; +var recognizersTextDateTime_88 = recognizersTextDateTime.FrenchDateTimeUtilityConfiguration; +var recognizersTextDateTime_89 = recognizersTextDateTime.FrenchDateExtractorConfiguration; +var recognizersTextDateTime_90 = recognizersTextDateTime.FrenchDateParserConfiguration; +var recognizersTextDateTime_91 = recognizersTextDateTime.FrenchTimeExtractorConfiguration; +var recognizersTextDateTime_92 = recognizersTextDateTime.FrenchTimeParserConfiguration; +var recognizersTextDateTime_93 = recognizersTextDateTime.FrenchDatePeriodExtractorConfiguration; +var recognizersTextDateTime_94 = recognizersTextDateTime.FrenchDatePeriodParserConfiguration; +var recognizersTextDateTime_95 = recognizersTextDateTime.FrenchTimePeriodExtractorConfiguration; +var recognizersTextDateTime_96 = recognizersTextDateTime.FrenchTimePeriodParserConfiguration; +var recognizersTextDateTime_97 = recognizersTextDateTime.FrenchDateTimeExtractorConfiguration; +var recognizersTextDateTime_98 = recognizersTextDateTime.FrenchDateTimeParserConfiguration; +var recognizersTextDateTime_99 = recognizersTextDateTime.FrenchDateTimePeriodExtractorConfiguration; +var recognizersTextDateTime_100 = recognizersTextDateTime.FrenchDateTimePeriodParserConfiguration; +var recognizersTextDateTime_101 = recognizersTextDateTime.FrenchSetExtractorConfiguration; +var recognizersTextDateTime_102 = recognizersTextDateTime.FrenchSetParserConfiguration; +var recognizersTextDateTime_103 = recognizersTextDateTime.FrenchDurationExtractorConfiguration; +var recognizersTextDateTime_104 = recognizersTextDateTime.FrenchDurationParserConfiguration; +var recognizersTextDateTime_105 = recognizersTextDateTime.FrenchHolidayExtractorConfiguration; +var recognizersTextDateTime_106 = recognizersTextDateTime.FrenchHolidayParserConfiguration; +var recognizersTextDateTime_107 = recognizersTextDateTime.FrenchMergedExtractorConfiguration; +var recognizersTextDateTime_108 = recognizersTextDateTime.FrenchMergedParserConfiguration; +var recognizersTextDateTime_109 = recognizersTextDateTime.FrenchTimeParser; +var recognizersTextDateTime_110 = recognizersTextDateTime.ChineseDurationExtractor; +var recognizersTextDateTime_111 = recognizersTextDateTime.ChineseDurationParser; +var recognizersTextDateTime_112 = recognizersTextDateTime.ChineseTimeExtractor; +var recognizersTextDateTime_113 = recognizersTextDateTime.ChineseTimeParser; +var recognizersTextDateTime_114 = recognizersTextDateTime.ChineseTimePeriodExtractor; +var recognizersTextDateTime_115 = recognizersTextDateTime.ChineseTimePeriodParser; +var recognizersTextDateTime_116 = recognizersTextDateTime.ChineseDateExtractor; +var recognizersTextDateTime_117 = recognizersTextDateTime.ChineseDateParser; +var recognizersTextDateTime_118 = recognizersTextDateTime.ChineseDatePeriodExtractor; +var recognizersTextDateTime_119 = recognizersTextDateTime.ChineseDatePeriodParser; +var recognizersTextDateTime_120 = recognizersTextDateTime.ChineseDateTimeExtractor; +var recognizersTextDateTime_121 = recognizersTextDateTime.ChineseDateTimeParser; +var recognizersTextDateTime_122 = recognizersTextDateTime.ChineseDateTimePeriodExtractor; +var recognizersTextDateTime_123 = recognizersTextDateTime.ChineseDateTimePeriodParser; +var recognizersTextDateTime_124 = recognizersTextDateTime.ChineseSetExtractor; +var recognizersTextDateTime_125 = recognizersTextDateTime.ChineseSetParser; +var recognizersTextDateTime_126 = recognizersTextDateTime.ChineseHolidayExtractorConfiguration; +var recognizersTextDateTime_127 = recognizersTextDateTime.ChineseHolidayParser; +var recognizersTextDateTime_128 = recognizersTextDateTime.ChineseMergedExtractor; +var recognizersTextDateTime_129 = recognizersTextDateTime.ChineseMergedParser; +var recognizersTextDateTime_130 = recognizersTextDateTime.ChineseFullMergedParser; +var recognizersTextDateTime_131 = recognizersTextDateTime.BaseDateTime; +var recognizersTextDateTime_132 = recognizersTextDateTime.EnglishDateTime; +var recognizersTextDateTime_133 = recognizersTextDateTime.SpanishDateTime; +var recognizersTextDateTime_134 = recognizersTextDateTime.FrenchDateTime; +var recognizersTextDateTime_135 = recognizersTextDateTime.ChineseDateTime; + +exports['default'] = recognizersTextDateTime$1; +exports.DateTimeRecognizer = recognizersTextDateTime_1; +exports.DateTimeOptions = recognizersTextDateTime_2; +exports.recognizeDateTime = recognizersTextDateTime_3; +exports.Culture = recognizersTextDateTime_4; +exports.CultureInfo = recognizersTextDateTime_5; +exports.BaseDateExtractor = recognizersTextDateTime_6; +exports.BaseDateParser = recognizersTextDateTime_7; +exports.BaseTimeExtractor = recognizersTextDateTime_8; +exports.BaseTimeParser = recognizersTextDateTime_9; +exports.BaseDatePeriodExtractor = recognizersTextDateTime_10; +exports.BaseDatePeriodParser = recognizersTextDateTime_11; +exports.BaseTimePeriodExtractor = recognizersTextDateTime_12; +exports.BaseTimePeriodParser = recognizersTextDateTime_13; +exports.BaseDateTimeExtractor = recognizersTextDateTime_14; +exports.BaseDateTimeParser = recognizersTextDateTime_15; +exports.BaseDateTimePeriodExtractor = recognizersTextDateTime_16; +exports.BaseDateTimePeriodParser = recognizersTextDateTime_17; +exports.BaseDurationExtractor = recognizersTextDateTime_18; +exports.BaseDurationParser = recognizersTextDateTime_19; +exports.BaseSetExtractor = recognizersTextDateTime_20; +exports.BaseSetParser = recognizersTextDateTime_21; +exports.BaseHolidayExtractor = recognizersTextDateTime_22; +exports.BaseHolidayParser = recognizersTextDateTime_23; +exports.BaseHolidayParserConfiguration = recognizersTextDateTime_24; +exports.BaseMergedExtractor = recognizersTextDateTime_25; +exports.BaseMergedParser = recognizersTextDateTime_26; +exports.Constants = recognizersTextDateTime_27; +exports.TimeTypeConstants = recognizersTextDateTime_28; +exports.DateTimeModelResult = recognizersTextDateTime_29; +exports.DateTimeModel = recognizersTextDateTime_30; +exports.DateTimeParseResult = recognizersTextDateTime_31; +exports.BaseDateParserConfiguration = recognizersTextDateTime_32; +exports.Token = recognizersTextDateTime_33; +exports.AgoLaterMode = recognizersTextDateTime_34; +exports.AgoLaterUtil = recognizersTextDateTime_35; +exports.MatchingUtil = recognizersTextDateTime_36; +exports.FormatUtil = recognizersTextDateTime_37; +exports.DateTimeResolutionResult = recognizersTextDateTime_38; +exports.DateUtils = recognizersTextDateTime_39; +exports.DayOfWeek = recognizersTextDateTime_40; +exports.EnglishCommonDateTimeParserConfiguration = recognizersTextDateTime_41; +exports.EnglishDateTimeUtilityConfiguration = recognizersTextDateTime_42; +exports.EnglishDateExtractorConfiguration = recognizersTextDateTime_43; +exports.EnglishDateParserConfiguration = recognizersTextDateTime_44; +exports.EnglishTimeExtractorConfiguration = recognizersTextDateTime_45; +exports.EnglishTimeParserConfiguration = recognizersTextDateTime_46; +exports.EnglishDatePeriodExtractorConfiguration = recognizersTextDateTime_47; +exports.EnglishDatePeriodParserConfiguration = recognizersTextDateTime_48; +exports.EnglishTimePeriodExtractorConfiguration = recognizersTextDateTime_49; +exports.EnglishTimePeriodParserConfiguration = recognizersTextDateTime_50; +exports.EnglishDateTimeExtractorConfiguration = recognizersTextDateTime_51; +exports.EnglishDateTimeParserConfiguration = recognizersTextDateTime_52; +exports.EnglishDateTimePeriodExtractorConfiguration = recognizersTextDateTime_53; +exports.EnglishDateTimePeriodParserConfiguration = recognizersTextDateTime_54; +exports.EnglishSetExtractorConfiguration = recognizersTextDateTime_55; +exports.EnglishSetParserConfiguration = recognizersTextDateTime_56; +exports.EnglishDurationExtractorConfiguration = recognizersTextDateTime_57; +exports.EnglishDurationParserConfiguration = recognizersTextDateTime_58; +exports.EnglishHolidayExtractorConfiguration = recognizersTextDateTime_59; +exports.EnglishHolidayParserConfiguration = recognizersTextDateTime_60; +exports.EnglishMergedExtractorConfiguration = recognizersTextDateTime_61; +exports.EnglishMergedParserConfiguration = recognizersTextDateTime_62; +exports.EnglishTimeParser = recognizersTextDateTime_63; +exports.SpanishCommonDateTimeParserConfiguration = recognizersTextDateTime_64; +exports.SpanishDateTimeUtilityConfiguration = recognizersTextDateTime_65; +exports.SpanishDateExtractorConfiguration = recognizersTextDateTime_66; +exports.SpanishDateParserConfiguration = recognizersTextDateTime_67; +exports.SpanishTimeExtractorConfiguration = recognizersTextDateTime_68; +exports.SpanishTimeParserConfiguration = recognizersTextDateTime_69; +exports.SpanishDatePeriodExtractorConfiguration = recognizersTextDateTime_70; +exports.SpanishDatePeriodParserConfiguration = recognizersTextDateTime_71; +exports.SpanishTimePeriodExtractorConfiguration = recognizersTextDateTime_72; +exports.SpanishTimePeriodParserConfiguration = recognizersTextDateTime_73; +exports.SpanishDateTimeExtractorConfiguration = recognizersTextDateTime_74; +exports.SpanishDateTimeParserConfiguration = recognizersTextDateTime_75; +exports.SpanishDateTimePeriodExtractorConfiguration = recognizersTextDateTime_76; +exports.SpanishDateTimePeriodParserConfiguration = recognizersTextDateTime_77; +exports.SpanishSetExtractorConfiguration = recognizersTextDateTime_78; +exports.SpanishSetParserConfiguration = recognizersTextDateTime_79; +exports.SpanishDurationExtractorConfiguration = recognizersTextDateTime_80; +exports.SpanishDurationParserConfiguration = recognizersTextDateTime_81; +exports.SpanishHolidayExtractorConfiguration = recognizersTextDateTime_82; +exports.SpanishHolidayParserConfiguration = recognizersTextDateTime_83; +exports.SpanishMergedExtractorConfiguration = recognizersTextDateTime_84; +exports.SpanishMergedParserConfiguration = recognizersTextDateTime_85; +exports.SpanishDateTimePeriodParser = recognizersTextDateTime_86; +exports.FrenchCommonDateTimeParserConfiguration = recognizersTextDateTime_87; +exports.FrenchDateTimeUtilityConfiguration = recognizersTextDateTime_88; +exports.FrenchDateExtractorConfiguration = recognizersTextDateTime_89; +exports.FrenchDateParserConfiguration = recognizersTextDateTime_90; +exports.FrenchTimeExtractorConfiguration = recognizersTextDateTime_91; +exports.FrenchTimeParserConfiguration = recognizersTextDateTime_92; +exports.FrenchDatePeriodExtractorConfiguration = recognizersTextDateTime_93; +exports.FrenchDatePeriodParserConfiguration = recognizersTextDateTime_94; +exports.FrenchTimePeriodExtractorConfiguration = recognizersTextDateTime_95; +exports.FrenchTimePeriodParserConfiguration = recognizersTextDateTime_96; +exports.FrenchDateTimeExtractorConfiguration = recognizersTextDateTime_97; +exports.FrenchDateTimeParserConfiguration = recognizersTextDateTime_98; +exports.FrenchDateTimePeriodExtractorConfiguration = recognizersTextDateTime_99; +exports.FrenchDateTimePeriodParserConfiguration = recognizersTextDateTime_100; +exports.FrenchSetExtractorConfiguration = recognizersTextDateTime_101; +exports.FrenchSetParserConfiguration = recognizersTextDateTime_102; +exports.FrenchDurationExtractorConfiguration = recognizersTextDateTime_103; +exports.FrenchDurationParserConfiguration = recognizersTextDateTime_104; +exports.FrenchHolidayExtractorConfiguration = recognizersTextDateTime_105; +exports.FrenchHolidayParserConfiguration = recognizersTextDateTime_106; +exports.FrenchMergedExtractorConfiguration = recognizersTextDateTime_107; +exports.FrenchMergedParserConfiguration = recognizersTextDateTime_108; +exports.FrenchTimeParser = recognizersTextDateTime_109; +exports.ChineseDurationExtractor = recognizersTextDateTime_110; +exports.ChineseDurationParser = recognizersTextDateTime_111; +exports.ChineseTimeExtractor = recognizersTextDateTime_112; +exports.ChineseTimeParser = recognizersTextDateTime_113; +exports.ChineseTimePeriodExtractor = recognizersTextDateTime_114; +exports.ChineseTimePeriodParser = recognizersTextDateTime_115; +exports.ChineseDateExtractor = recognizersTextDateTime_116; +exports.ChineseDateParser = recognizersTextDateTime_117; +exports.ChineseDatePeriodExtractor = recognizersTextDateTime_118; +exports.ChineseDatePeriodParser = recognizersTextDateTime_119; +exports.ChineseDateTimeExtractor = recognizersTextDateTime_120; +exports.ChineseDateTimeParser = recognizersTextDateTime_121; +exports.ChineseDateTimePeriodExtractor = recognizersTextDateTime_122; +exports.ChineseDateTimePeriodParser = recognizersTextDateTime_123; +exports.ChineseSetExtractor = recognizersTextDateTime_124; +exports.ChineseSetParser = recognizersTextDateTime_125; +exports.ChineseHolidayExtractorConfiguration = recognizersTextDateTime_126; +exports.ChineseHolidayParser = recognizersTextDateTime_127; +exports.ChineseMergedExtractor = recognizersTextDateTime_128; +exports.ChineseMergedParser = recognizersTextDateTime_129; +exports.ChineseFullMergedParser = recognizersTextDateTime_130; +exports.BaseDateTime = recognizersTextDateTime_131; +exports.EnglishDateTime = recognizersTextDateTime_132; +exports.SpanishDateTime = recognizersTextDateTime_133; +exports.FrenchDateTime = recognizersTextDateTime_134; +exports.ChineseDateTime = recognizersTextDateTime_135; + +Object.defineProperty(exports, '__esModule', { value: true }); + +}))); +//# sourceMappingURL=recognizers-text-date-time.umd.js.map diff --git a/libraries/botbuilder-stdlib/vendors/@microsoft/recognizers-text-date-time/dist/types/dateTime/baseDate.d.ts b/libraries/botbuilder-stdlib/vendors/@microsoft/recognizers-text-date-time/dist/types/dateTime/baseDate.d.ts new file mode 100644 index 0000000000..8d5566e01d --- /dev/null +++ b/libraries/botbuilder-stdlib/vendors/@microsoft/recognizers-text-date-time/dist/types/dateTime/baseDate.d.ts @@ -0,0 +1,79 @@ +import { ExtractResult, Match } from "botbuilder-stdlib/vendors/@microsoft/recognizers-text"; +import { BaseNumberExtractor, BaseNumberParser } from "botbuilder-stdlib/vendors/@microsoft/recognizers-text-number"; +import { Token, DateTimeResolutionResult, IDateTimeUtilityConfiguration } from "./utilities"; +import { IDateTimeExtractor } from "./baseDateTime"; +import { IDateTimeParser, DateTimeParseResult } from "./parsers"; +export interface IDateExtractorConfiguration { + dateRegexList: RegExp[]; + implicitDateList: RegExp[]; + monthEnd: RegExp; + ofMonth: RegExp; + dateUnitRegex: RegExp; + forTheRegex: RegExp; + weekDayAndDayOfMonthRegex: RegExp; + relativeMonthRegex: RegExp; + weekDayRegex: RegExp; + dayOfWeek: ReadonlyMap; + ordinalExtractor: BaseNumberExtractor; + integerExtractor: BaseNumberExtractor; + numberParser: BaseNumberParser; + durationExtractor: IDateTimeExtractor; + utilityConfiguration: IDateTimeUtilityConfiguration; +} +export declare class BaseDateExtractor implements IDateTimeExtractor { + protected readonly extractorName: string; + protected readonly config: IDateExtractorConfiguration; + constructor(config: IDateExtractorConfiguration); + extract(source: string, refDate: Date): Array; + protected basicRegexMatch(source: string): Array; + protected implicitDate(source: string): Array; + private numberWithMonth(source, refDate); + protected durationWithBeforeAndAfter(source: string, refDate: Date): Array; +} +export interface IDateParserConfiguration { + ordinalExtractor: BaseNumberExtractor; + integerExtractor: BaseNumberExtractor; + cardinalExtractor: BaseNumberExtractor; + durationExtractor: IDateTimeExtractor; + durationParser: IDateTimeParser; + numberParser: BaseNumberParser; + monthOfYear: ReadonlyMap; + dayOfMonth: ReadonlyMap; + dayOfWeek: ReadonlyMap; + unitMap: ReadonlyMap; + cardinalMap: ReadonlyMap; + dateRegex: RegExp[]; + onRegex: RegExp; + specialDayRegex: RegExp; + specialDayWithNumRegex: RegExp; + nextRegex: RegExp; + unitRegex: RegExp; + monthRegex: RegExp; + weekDayRegex: RegExp; + lastRegex: RegExp; + thisRegex: RegExp; + weekDayOfMonthRegex: RegExp; + forTheRegex: RegExp; + weekDayAndDayOfMonthRegex: RegExp; + relativeMonthRegex: RegExp; + relativeWeekDayRegex: RegExp; + utilityConfiguration: IDateTimeUtilityConfiguration; + dateTokenPrefix: string; + getSwiftDay(source: string): number; + getSwiftMonth(source: string): number; + isCardinalLast(source: string): boolean; +} +export declare class BaseDateParser implements IDateTimeParser { + protected readonly parserName: string; + protected readonly config: IDateParserConfiguration; + constructor(config: IDateParserConfiguration); + parse(extractorResult: ExtractResult, referenceDate?: Date): DateTimeParseResult | null; + protected parseBasicRegexMatch(source: string, referenceDate: Date): DateTimeResolutionResult; + protected parseImplicitDate(source: string, referenceDate: Date): DateTimeResolutionResult; + private parseNumberWithMonth(source, referenceDate); + private parseSingleNumber(source, referenceDate); + protected parserDurationWithAgoAndLater(source: string, referenceDate: Date): DateTimeResolutionResult; + protected parseWeekdayOfMonth(source: string, referenceDate: Date): DateTimeResolutionResult; + protected matchToDate(match: Match, referenceDate: Date): DateTimeResolutionResult; + private computeDate(cardinal, weekday, month, year); +} diff --git a/libraries/botbuilder-stdlib/vendors/@microsoft/recognizers-text-date-time/dist/types/dateTime/baseDatePeriod.d.ts b/libraries/botbuilder-stdlib/vendors/@microsoft/recognizers-text-date-time/dist/types/dateTime/baseDatePeriod.d.ts new file mode 100644 index 0000000000..4652c4c00d --- /dev/null +++ b/libraries/botbuilder-stdlib/vendors/@microsoft/recognizers-text-date-time/dist/types/dateTime/baseDatePeriod.d.ts @@ -0,0 +1,123 @@ +import { ExtractResult, Match } from "botbuilder-stdlib/vendors/@microsoft/recognizers-text"; +import { BaseNumberExtractor, BaseNumberParser } from "botbuilder-stdlib/vendors/@microsoft/recognizers-text-number"; +import { Token, DateTimeResolutionResult } from "./utilities"; +import { BaseDurationParser } from "./baseDuration"; +import { IDateTimeParser, DateTimeParseResult } from "./parsers"; +import { BaseDateParser } from "./baseDate"; +import { IDateTimeExtractor } from "./baseDateTime"; +export interface IDatePeriodExtractorConfiguration { + simpleCasesRegexes: RegExp[]; + illegalYearRegex: RegExp; + YearRegex: RegExp; + tillRegex: RegExp; + followedUnit: RegExp; + numberCombinedWithUnit: RegExp; + pastRegex: RegExp; + futureRegex: RegExp; + weekOfRegex: RegExp; + monthOfRegex: RegExp; + dateUnitRegex: RegExp; + inConnectorRegex: RegExp; + rangeUnitRegex: RegExp; + datePointExtractor: IDateTimeExtractor; + integerExtractor: BaseNumberExtractor; + numberParser: BaseNumberParser; + durationExtractor: IDateTimeExtractor; + getFromTokenIndex(source: string): { + matched: boolean; + index: number; + }; + getBetweenTokenIndex(source: string): { + matched: boolean; + index: number; + }; + hasConnectorToken(source: string): boolean; +} +export declare class BaseDatePeriodExtractor implements IDateTimeExtractor { + protected readonly extractorName: string; + protected readonly config: IDatePeriodExtractorConfiguration; + constructor(config: IDatePeriodExtractorConfiguration); + extract(source: string, refDate: Date): Array; + protected matchSimpleCases(source: string): Array; + private getYearFromText(match); + protected mergeTwoTimePoints(source: string, refDate: Date): Array; + private matchDuration(source, refDate); + private singleTimePointWithPatterns(source, refDate); + private getTokenForRegexMatching(source, regexp, er); + private matchRegexInPrefix(source, match); + private infixBoundaryCheck(match, source); +} +export interface IDatePeriodParserConfiguration { + dateExtractor: IDateTimeExtractor; + dateParser: BaseDateParser; + durationExtractor: IDateTimeExtractor; + durationParser: BaseDurationParser; + monthFrontBetweenRegex: RegExp; + betweenRegex: RegExp; + monthFrontSimpleCasesRegex: RegExp; + simpleCasesRegex: RegExp; + oneWordPeriodRegex: RegExp; + monthWithYear: RegExp; + monthNumWithYear: RegExp; + yearRegex: RegExp; + pastRegex: RegExp; + futureRegex: RegExp; + inConnectorRegex: RegExp; + weekOfMonthRegex: RegExp; + weekOfYearRegex: RegExp; + quarterRegex: RegExp; + quarterRegexYearFront: RegExp; + allHalfYearRegex: RegExp; + seasonRegex: RegExp; + weekOfRegex: RegExp; + monthOfRegex: RegExp; + whichWeekRegex: RegExp; + restOfDateRegex: RegExp; + laterEarlyPeriodRegex: RegExp; + weekWithWeekDayRangeRegex: RegExp; + tokenBeforeDate: string; + dayOfMonth: ReadonlyMap; + monthOfYear: ReadonlyMap; + cardinalMap: ReadonlyMap; + seasonMap: ReadonlyMap; + unitMap: ReadonlyMap; + getSwiftDayOrMonth(source: string): number; + getSwiftYear(source: string): number; + isFuture(source: string): boolean; + isYearToDate(source: string): boolean; + isMonthToDate(source: string): boolean; + isWeekOnly(source: string): boolean; + isWeekend(source: string): boolean; + isMonthOnly(source: string): boolean; + isYearOnly(source: string): boolean; + isLastCardinal(source: string): boolean; +} +export declare class BaseDatePeriodParser implements IDateTimeParser { + protected readonly parserName: string; + protected readonly config: IDatePeriodParserConfiguration; + protected readonly inclusiveEndPeriod: any; + private readonly weekOfComment; + private readonly monthOfComment; + constructor(config: IDatePeriodParserConfiguration, inclusiveEndPeriod?: boolean); + parse(extractorResult: ExtractResult, referenceDate?: Date): DateTimeParseResult | null; + private parseMonthWithYear(source, referenceDate); + protected getMatchSimpleCase(source: string): Match; + protected parseSimpleCases(source: string, referenceDate: Date): DateTimeResolutionResult; + protected parseOneWordPeriod(source: string, referenceDate: Date): DateTimeResolutionResult; + protected mergeTwoTimePoints(source: string, referenceDate: Date): DateTimeResolutionResult; + protected parseYear(source: string, referenceDate: Date): DateTimeResolutionResult; + protected parseDuration(source: string, referenceDate: Date): DateTimeResolutionResult; + private getSwiftDate(date, timex, isPositiveSwift); + protected parseWeekOfMonth(source: string, referenceDate: Date): DateTimeResolutionResult; + protected getWeekOfMonth(cardinal: number, month: number, year: number, referenceDate: Date, noYear: boolean): DateTimeResolutionResult; + private parseWeekOfYear(source, referenceDate); + protected parseHalfYear(source: string, referenceDate: Date): DateTimeResolutionResult; + protected parseQuarter(source: string, referenceDate: Date): DateTimeResolutionResult; + protected parseSeason(source: string, referenceDate: Date): DateTimeResolutionResult; + private parseWhichWeek(source, referenceDate); + private parseWeekOfDate(source, referenceDate); + private parseMonthOfDate(source, referenceDate); + protected computeDate(cardinal: number, weekday: number, month: number, year: number): Date; + private getWeekRangeFromDate(seedDate); + private getMonthRangeFromDate(seedDate); +} diff --git a/libraries/botbuilder-stdlib/vendors/@microsoft/recognizers-text-date-time/dist/types/dateTime/baseDateTime.d.ts b/libraries/botbuilder-stdlib/vendors/@microsoft/recognizers-text-date-time/dist/types/dateTime/baseDateTime.d.ts new file mode 100644 index 0000000000..07b37d1f45 --- /dev/null +++ b/libraries/botbuilder-stdlib/vendors/@microsoft/recognizers-text-date-time/dist/types/dateTime/baseDateTime.d.ts @@ -0,0 +1,76 @@ +import { ExtractResult } from "botbuilder-stdlib/vendors/@microsoft/recognizers-text"; +import { BaseNumberExtractor, BaseNumberParser } from "botbuilder-stdlib/vendors/@microsoft/recognizers-text-number"; +import { IDateTimeParser, DateTimeParseResult } from "./parsers"; +import { Token, IDateTimeUtilityConfiguration, DateTimeResolutionResult } from "./utilities"; +export interface IDateTimeExtractor { + extract(input: string, refDate?: Date): Array; +} +export interface IDateTimeExtractorConfiguration { + datePointExtractor: IDateTimeExtractor; + timePointExtractor: IDateTimeExtractor; + durationExtractor: IDateTimeExtractor; + suffixRegex: RegExp; + nowRegex: RegExp; + timeOfTodayAfterRegex: RegExp; + simpleTimeOfTodayAfterRegex: RegExp; + nightRegex: RegExp; + timeOfTodayBeforeRegex: RegExp; + simpleTimeOfTodayBeforeRegex: RegExp; + theEndOfRegex: RegExp; + unitRegex: RegExp; + utilityConfiguration: IDateTimeUtilityConfiguration; + isConnectorToken(source: string): boolean; +} +export declare class BaseDateTimeExtractor implements IDateTimeExtractor { + protected readonly extractorName: string; + protected readonly config: IDateTimeExtractorConfiguration; + constructor(config: IDateTimeExtractorConfiguration); + extract(source: string, refDate: Date): Array; + protected mergeDateAndTime(source: string, refDate: Date): Array; + protected basicRegexMatch(source: string): Array; + private timeOfTodayBefore(source, refDate); + private timeOfTodayAfter(source, refDate); + private specialTimeOfDate(source, refDate); + private durationWithBeforeAndAfter(source, refDate); +} +export interface IDateTimeParserConfiguration { + tokenBeforeDate: string; + tokenBeforeTime: string; + dateExtractor: IDateTimeExtractor; + timeExtractor: IDateTimeExtractor; + dateParser: IDateTimeParser; + timeParser: IDateTimeParser; + cardinalExtractor: BaseNumberExtractor; + numberParser: BaseNumberParser; + durationExtractor: IDateTimeExtractor; + durationParser: IDateTimeParser; + nowRegex: RegExp; + amTimeRegex: RegExp; + pmTimeRegex: RegExp; + simpleTimeOfTodayAfterRegex: RegExp; + simpleTimeOfTodayBeforeRegex: RegExp; + specificTimeOfDayRegex: RegExp; + theEndOfRegex: RegExp; + unitRegex: RegExp; + unitMap: ReadonlyMap; + numbers: ReadonlyMap; + haveAmbiguousToken(text: string, matchedText: string): boolean; + getMatchedNowTimex(text: string): { + matched: boolean; + timex: string; + }; + getSwiftDay(text: string): number; + getHour(text: string, hour: number): number; + utilityConfiguration: IDateTimeUtilityConfiguration; +} +export declare class BaseDateTimeParser implements IDateTimeParser { + static readonly ParserName: string; + protected readonly config: IDateTimeParserConfiguration; + constructor(configuration: IDateTimeParserConfiguration); + parse(er: ExtractResult, refTime: Date): DateTimeParseResult; + protected parseBasicRegex(text: string, referenceTime: Date): DateTimeResolutionResult; + protected mergeDateAndTime(text: string, referenceTime: Date): DateTimeResolutionResult; + protected parseTimeOfToday(text: string, referenceTime: Date): DateTimeResolutionResult; + private parseSpecialTimeOfDate(text, refDateTime); + private parserDurationWithAgoAndLater(text, referenceTime); +} diff --git a/libraries/botbuilder-stdlib/vendors/@microsoft/recognizers-text-date-time/dist/types/dateTime/baseDateTimePeriod.d.ts b/libraries/botbuilder-stdlib/vendors/@microsoft/recognizers-text-date-time/dist/types/dateTime/baseDateTimePeriod.d.ts new file mode 100644 index 0000000000..9814dc6429 --- /dev/null +++ b/libraries/botbuilder-stdlib/vendors/@microsoft/recognizers-text-date-time/dist/types/dateTime/baseDateTimePeriod.d.ts @@ -0,0 +1,98 @@ +import { ExtractResult } from "botbuilder-stdlib/vendors/@microsoft/recognizers-text"; +import { BaseNumberExtractor } from "botbuilder-stdlib/vendors/@microsoft/recognizers-text-number"; +import { BaseDateParser } from "./baseDate"; +import { BaseTimeParser } from "./baseTime"; +import { BaseDateTimeParser, IDateTimeExtractor } from "./baseDateTime"; +import { BaseDurationParser } from "./baseDuration"; +import { IDateTimeParser, DateTimeParseResult } from "./parsers"; +import { Token, DateTimeResolutionResult } from "./utilities"; +export interface IDateTimePeriodExtractorConfiguration { + cardinalExtractor: BaseNumberExtractor; + singleDateExtractor: IDateTimeExtractor; + singleTimeExtractor: IDateTimeExtractor; + singleDateTimeExtractor: IDateTimeExtractor; + durationExtractor: IDateTimeExtractor; + timePeriodExtractor: IDateTimeExtractor; + simpleCasesRegexes: RegExp[]; + prepositionRegex: RegExp; + tillRegex: RegExp; + specificTimeOfDayRegex: RegExp; + timeOfDayRegex: RegExp; + periodTimeOfDayWithDateRegex: RegExp; + followedUnit: RegExp; + numberCombinedWithUnit: RegExp; + timeUnitRegex: RegExp; + pastPrefixRegex: RegExp; + nextPrefixRegex: RegExp; + relativeTimeUnitRegex: RegExp; + restOfDateTimeRegex: RegExp; + generalEndingRegex: RegExp; + middlePauseRegex: RegExp; + getFromTokenIndex(source: string): { + matched: boolean; + index: number; + }; + getBetweenTokenIndex(source: string): { + matched: boolean; + index: number; + }; + hasConnectorToken(source: string): boolean; +} +export declare class BaseDateTimePeriodExtractor implements IDateTimeExtractor { + protected readonly extractorName: string; + protected readonly config: IDateTimePeriodExtractorConfiguration; + constructor(config: IDateTimePeriodExtractorConfiguration); + extract(source: string, refDate: Date): Array; + private matchSimpleCases(source, refDate); + protected mergeTwoTimePoints(source: string, refDate: Date): Array; + private matchDuration(source, refDate); + protected matchNight(source: string, refDate: Date): Array; + private matchRelativeUnit(source); +} +export interface IDateTimePeriodParserConfiguration { + pureNumberFromToRegex: RegExp; + pureNumberBetweenAndRegex: RegExp; + periodTimeOfDayWithDateRegex: RegExp; + specificTimeOfDayRegex: RegExp; + pastRegex: RegExp; + futureRegex: RegExp; + relativeTimeUnitRegex: RegExp; + restOfDateTimeRegex: RegExp; + numbers: ReadonlyMap; + unitMap: ReadonlyMap; + dateExtractor: IDateTimeExtractor; + timeExtractor: IDateTimeExtractor; + dateTimeExtractor: IDateTimeExtractor; + timePeriodExtractor: IDateTimeExtractor; + durationExtractor: IDateTimeExtractor; + dateParser: BaseDateParser; + timeParser: BaseTimeParser; + dateTimeParser: BaseDateTimeParser; + timePeriodParser: IDateTimeParser; + durationParser: BaseDurationParser; + getMatchedTimeRange(source: string): { + timeStr: string; + beginHour: number; + endHour: number; + endMin: number; + success: boolean; + }; + getSwiftPrefix(source: string): number; +} +export declare class BaseDateTimePeriodParser implements IDateTimeParser { + protected readonly parserName: string; + protected readonly config: IDateTimePeriodParserConfiguration; + constructor(config: IDateTimePeriodParserConfiguration); + parse(extractorResult: ExtractResult, referenceDate?: Date): DateTimeParseResult | null; + protected mergeDateAndTimePeriods(text: string, referenceTime: Date): DateTimeResolutionResult; + private parseSimpleCases(source, referenceDate); + protected mergeTwoTimePoints(source: string, referenceDate: Date): DateTimeResolutionResult; + protected getTwoPoints(beginEr: ExtractResult, endEr: ExtractResult, beginParser: IDateTimeParser, endParser: IDateTimeParser, referenceDate: Date): { + begin: DateTimeParseResult; + end: DateTimeParseResult; + }; + protected parseSpecificTimeOfDay(source: string, referenceDate: Date): DateTimeResolutionResult; + protected parseDuration(source: string, referenceDate: Date): DateTimeResolutionResult; + private isFloat(value); + private parseRelativeUnit(source, referenceDate); +} diff --git a/libraries/botbuilder-stdlib/vendors/@microsoft/recognizers-text-date-time/dist/types/dateTime/baseDuration.d.ts b/libraries/botbuilder-stdlib/vendors/@microsoft/recognizers-text-date-time/dist/types/dateTime/baseDuration.d.ts new file mode 100644 index 0000000000..083335a6f7 --- /dev/null +++ b/libraries/botbuilder-stdlib/vendors/@microsoft/recognizers-text-date-time/dist/types/dateTime/baseDuration.d.ts @@ -0,0 +1,57 @@ +import { ExtractResult } from "botbuilder-stdlib/vendors/@microsoft/recognizers-text"; +import { BaseNumberExtractor, BaseNumberParser } from "botbuilder-stdlib/vendors/@microsoft/recognizers-text-number"; +import { IDateTimeParser, DateTimeParseResult } from "./parsers"; +import { IDateTimeExtractor } from "./baseDateTime"; +export interface IDurationExtractorConfiguration { + allRegex: RegExp; + halfRegex: RegExp; + followedUnit: RegExp; + numberCombinedWithUnit: RegExp; + anUnitRegex: RegExp; + inexactNumberUnitRegex: RegExp; + suffixAndRegex: RegExp; + relativeDurationUnitRegex: RegExp; + moreThanRegex: RegExp; + lessThanRegex: RegExp; + cardinalExtractor: BaseNumberExtractor; +} +export declare class BaseDurationExtractor implements IDateTimeExtractor { + private readonly extractorName; + private readonly config; + constructor(config: IDurationExtractorConfiguration); + extract(source: string, refDate: Date): Array; + private resolveMoreThanOrLessThanPrefix(text, ers); + private numberWithUnit(source); + private numberWithUnitAndSuffix(source, ers); + private implicitDuration(source); + private getTokensFromRegex(regexp, source); +} +export interface IDurationParserConfiguration { + cardinalExtractor: BaseNumberExtractor; + numberParser: BaseNumberParser; + followedUnit: RegExp; + suffixAndRegex: RegExp; + numberCombinedWithUnit: RegExp; + anUnitRegex: RegExp; + allDateUnitRegex: RegExp; + halfDateUnitRegex: RegExp; + inexactNumberUnitRegex: RegExp; + unitMap: ReadonlyMap; + unitValueMap: ReadonlyMap; + doubleNumbers: ReadonlyMap; +} +export declare class BaseDurationParser implements IDateTimeParser { + protected readonly parserName: string; + protected readonly config: IDurationParserConfiguration; + constructor(config: IDurationParserConfiguration); + parse(extractorResult: ExtractResult, referenceDate?: Date): DateTimeParseResult | null; + private parseNumberWithUnit(source, referenceDate); + private parseImplicitDuration(source, referenceDate); + private getResultFromRegex(regex, source, num); + private parseNumberSpaceUnit(source); + private parseNumberWithUnitAndSuffix(source); + private parseNumberCombinedUnit(source); + private parseAnUnit(source); + private parseInexactNumberUnit(source); + protected isLessThanDay(source: string): boolean; +} diff --git a/libraries/botbuilder-stdlib/vendors/@microsoft/recognizers-text-date-time/dist/types/dateTime/baseHoliday.d.ts b/libraries/botbuilder-stdlib/vendors/@microsoft/recognizers-text-date-time/dist/types/dateTime/baseHoliday.d.ts new file mode 100644 index 0000000000..4fcafb013e --- /dev/null +++ b/libraries/botbuilder-stdlib/vendors/@microsoft/recognizers-text-date-time/dist/types/dateTime/baseHoliday.d.ts @@ -0,0 +1,53 @@ +import { ExtractResult, Match } from "botbuilder-stdlib/vendors/@microsoft/recognizers-text"; +import { DateTimeResolutionResult, DayOfWeek } from "./utilities"; +import { IDateTimeParser, DateTimeParseResult } from "./parsers"; +import { IDateTimeExtractor } from "./baseDateTime"; +export interface IHolidayExtractorConfiguration { + holidayRegexes: RegExp[]; +} +export declare class BaseHolidayExtractor implements IDateTimeExtractor { + private readonly extractorName; + private readonly config; + constructor(config: IHolidayExtractorConfiguration); + extract(source: string, refDate: Date): Array; + private holidayMatch(source); +} +export interface IHolidayParserConfiguration { + variableHolidaysTimexDictionary: ReadonlyMap; + holidayFuncDictionary: ReadonlyMap Date>; + holidayNames: ReadonlyMap; + holidayRegexList: RegExp[]; + getSwiftYear(text: string): number; + sanitizeHolidayToken(holiday: string): string; +} +export declare class BaseHolidayParser implements IDateTimeParser { + static readonly ParserName: string; + protected readonly config: IHolidayParserConfiguration; + constructor(config: IHolidayParserConfiguration); + parse(er: ExtractResult, referenceDate: Date): DateTimeParseResult; + protected parseHolidayRegexMatch(text: string, referenceDate: Date): DateTimeResolutionResult; + protected match2Date(match: Match, referenceDate: Date): DateTimeResolutionResult; + private getFutureValue(value, referenceDate, holiday); + private getPastValue(value, referenceDate, holiday); +} +export declare abstract class BaseHolidayParserConfiguration implements IHolidayParserConfiguration { + variableHolidaysTimexDictionary: ReadonlyMap; + holidayFuncDictionary: ReadonlyMap Date>; + holidayNames: ReadonlyMap; + holidayRegexList: RegExp[]; + abstract getSwiftYear(text: string): number; + abstract sanitizeHolidayToken(holiday: string): string; + constructor(); + protected initHolidayFuncs(): ReadonlyMap Date>; + protected static MothersDay(year: number): Date; + protected static FathersDay(year: number): Date; + private static MartinLutherKingDay(year); + private static WashingtonsBirthday(year); + private static CanberraDay(year); + protected static MemorialDay(year: number): Date; + protected static LabourDay(year: number): Date; + protected static ColumbusDay(year: number): Date; + protected static ThanksgivingDay(year: number): Date; + protected static getDay(year: number, month: number, week: number, dayOfWeek: DayOfWeek): number; + protected static getLastDay(year: number, month: number, dayOfWeek: DayOfWeek): number; +} diff --git a/libraries/botbuilder-stdlib/vendors/@microsoft/recognizers-text-date-time/dist/types/dateTime/baseMerged.d.ts b/libraries/botbuilder-stdlib/vendors/@microsoft/recognizers-text-date-time/dist/types/dateTime/baseMerged.d.ts new file mode 100644 index 0000000000..4e7d033559 --- /dev/null +++ b/libraries/botbuilder-stdlib/vendors/@microsoft/recognizers-text-date-time/dist/types/dateTime/baseMerged.d.ts @@ -0,0 +1,85 @@ +import { ExtractResult } from "botbuilder-stdlib/vendors/@microsoft/recognizers-text"; +import { BaseNumberExtractor } from "botbuilder-stdlib/vendors/@microsoft/recognizers-text-number"; +import { IDateTimeParser, DateTimeParseResult } from "./parsers"; +import { StringMap } from "./utilities"; +import { BaseDateParser } from "./baseDate"; +import { BaseTimeParser } from "./baseTime"; +import { BaseDatePeriodParser } from "./baseDatePeriod"; +import { BaseTimePeriodParser } from "./baseTimePeriod"; +import { IDateTimeExtractor, BaseDateTimeParser } from "./baseDateTime"; +import { BaseDateTimePeriodParser } from "./baseDateTimePeriod"; +import { BaseSetParser } from "./baseSet"; +import { BaseDurationParser } from "./baseDuration"; +import { BaseHolidayParser } from "./baseHoliday"; +import { DateTimeOptions } from "./dateTimeRecognizer"; +export interface IMergedExtractorConfiguration { + dateExtractor: IDateTimeExtractor; + timeExtractor: IDateTimeExtractor; + dateTimeExtractor: IDateTimeExtractor; + datePeriodExtractor: IDateTimeExtractor; + timePeriodExtractor: IDateTimeExtractor; + dateTimePeriodExtractor: IDateTimeExtractor; + holidayExtractor: IDateTimeExtractor; + durationExtractor: IDateTimeExtractor; + setExtractor: IDateTimeExtractor; + integerExtractor: BaseNumberExtractor; + afterRegex: RegExp; + beforeRegex: RegExp; + sinceRegex: RegExp; + fromToRegex: RegExp; + singleAmbiguousMonthRegex: RegExp; + prepositionSuffixRegex: RegExp; + numberEndingPattern: RegExp; + filterWordRegexList: RegExp[]; +} +export declare class BaseMergedExtractor implements IDateTimeExtractor { + protected readonly config: IMergedExtractorConfiguration; + protected readonly options: DateTimeOptions; + constructor(config: IMergedExtractorConfiguration, options: DateTimeOptions); + extract(source: string, refDate: Date): Array; + private checkCalendarFilterList(ers, text); + private numberEndingRegexMatch(text, extractResults); + protected addTo(destination: ExtractResult[], source: ExtractResult[], text: string): void; + private shouldSkipFromMerge(er); + private filterAmbiguousSingleWord(er, text); + protected addMod(ers: ExtractResult[], source: string): void; + private hasTokenIndex(source, regex); +} +export interface IMergedParserConfiguration { + beforeRegex: RegExp; + afterRegex: RegExp; + sinceRegex: RegExp; + dateParser: BaseDateParser; + holidayParser: BaseHolidayParser; + timeParser: BaseTimeParser; + dateTimeParser: BaseDateTimeParser; + datePeriodParser: BaseDatePeriodParser; + timePeriodParser: BaseTimePeriodParser; + dateTimePeriodParser: BaseDateTimePeriodParser; + durationParser: BaseDurationParser; + setParser: BaseSetParser; +} +export declare class BaseMergedParser implements IDateTimeParser { + readonly parserTypeName: string; + protected readonly config: IMergedParserConfiguration; + private readonly options; + private readonly dateMinValue; + private readonly dateTimeMinValue; + constructor(config: IMergedParserConfiguration, options: DateTimeOptions); + parse(er: ExtractResult, refTime?: Date): DateTimeParseResult | null; + setParseResult(slot: DateTimeParseResult, hasBefore: boolean, hasAfter: boolean, hasSince: boolean): DateTimeParseResult; + protected getParseResult(extractorResult: ExtractResult, referenceDate: Date): DateTimeParseResult | null; + protected determineDateTimeType(type: string, hasBefore: boolean, hasAfter: boolean, hasSince: boolean): string; + dateTimeResolutionForSplit(slot: DateTimeParseResult): Array; + protected dateTimeResolution(slot: DateTimeParseResult, hasBefore: boolean, hasAfter: boolean, hasSince: boolean): { + [s: string]: Array; + }; + protected isObject(o: any): boolean; + protected addResolutionFieldsAny(dic: Map, key: string, value: any): void; + protected addResolutionFields(dic: StringMap, key: string, value: string): void; + protected generateFromResolution(type: string, resolutions: StringMap, mod: string): StringMap; + private addSingleDateTimeToResolution(resolutions, type, mod, result); + private addPeriodToResolution(resolutions, startType, endType, mod, result); + protected getValues(obj: any): Array; + protected resolveAMPM(valuesMap: Map, keyName: string): void; +} diff --git a/libraries/botbuilder-stdlib/vendors/@microsoft/recognizers-text-date-time/dist/types/dateTime/baseSet.d.ts b/libraries/botbuilder-stdlib/vendors/@microsoft/recognizers-text-date-time/dist/types/dateTime/baseSet.d.ts new file mode 100644 index 0000000000..0750c0c239 --- /dev/null +++ b/libraries/botbuilder-stdlib/vendors/@microsoft/recognizers-text-date-time/dist/types/dateTime/baseSet.d.ts @@ -0,0 +1,79 @@ +import { ExtractResult } from "botbuilder-stdlib/vendors/@microsoft/recognizers-text"; +import { IDateTimeParser, DateTimeParseResult } from "./parsers"; +import { BaseDurationParser } from "./baseDuration"; +import { BaseTimeParser } from "./baseTime"; +import { BaseDateParser } from "./baseDate"; +import { BaseDatePeriodParser } from "./baseDatePeriod"; +import { BaseTimePeriodParser } from "./baseTimePeriod"; +import { IDateTimeExtractor, BaseDateTimeParser } from "./baseDateTime"; +import { BaseDateTimePeriodParser } from "./baseDateTimePeriod"; +import { Token, DateTimeResolutionResult } from "./utilities"; +export interface ISetExtractorConfiguration { + lastRegex: RegExp; + eachPrefixRegex: RegExp; + periodicRegex: RegExp; + eachUnitRegex: RegExp; + eachDayRegex: RegExp; + beforeEachDayRegex: RegExp; + setWeekDayRegex: RegExp; + setEachRegex: RegExp; + durationExtractor: IDateTimeExtractor; + timeExtractor: IDateTimeExtractor; + dateExtractor: IDateTimeExtractor; + dateTimeExtractor: IDateTimeExtractor; + datePeriodExtractor: IDateTimeExtractor; + timePeriodExtractor: IDateTimeExtractor; + dateTimePeriodExtractor: IDateTimeExtractor; +} +export declare class BaseSetExtractor implements IDateTimeExtractor { + protected readonly extractorName: string; + protected readonly config: ISetExtractorConfiguration; + constructor(config: ISetExtractorConfiguration); + extract(source: string, refDate: Date): Array; + protected matchEachUnit(source: string): Array; + protected matchPeriodic(source: string): Array; + protected matchEachDuration(source: string, refDate: Date): Array; + protected timeEveryday(source: string, refDate: Date): Array; + private matchEach(extractor, source, refDate); +} +export interface ISetParserConfiguration { + durationExtractor: IDateTimeExtractor; + durationParser: BaseDurationParser; + timeExtractor: IDateTimeExtractor; + timeParser: BaseTimeParser; + dateExtractor: IDateTimeExtractor; + dateParser: BaseDateParser; + dateTimeExtractor: IDateTimeExtractor; + dateTimeParser: BaseDateTimeParser; + datePeriodExtractor: IDateTimeExtractor; + datePeriodParser: BaseDatePeriodParser; + timePeriodExtractor: IDateTimeExtractor; + timePeriodParser: BaseTimePeriodParser; + dateTimePeriodExtractor: IDateTimeExtractor; + dateTimePeriodParser: BaseDateTimePeriodParser; + unitMap: ReadonlyMap; + eachPrefixRegex: RegExp; + periodicRegex: RegExp; + eachUnitRegex: RegExp; + eachDayRegex: RegExp; + setWeekDayRegex: RegExp; + setEachRegex: RegExp; + getMatchedDailyTimex(text: string): { + matched: boolean; + timex: string; + }; + getMatchedUnitTimex(text: string): { + matched: boolean; + timex: string; + }; +} +export declare class BaseSetParser implements IDateTimeParser { + static readonly ParserName: string; + protected readonly config: ISetParserConfiguration; + constructor(configuration: ISetParserConfiguration); + parse(er: ExtractResult, referenceDate?: Date): DateTimeParseResult | null; + protected parseEachDuration(text: string, refDate: Date): DateTimeResolutionResult; + protected parseEachUnit(text: string): DateTimeResolutionResult; + protected parserTimeEveryday(text: string, refDate: Date): DateTimeResolutionResult; + protected parseEach(extractor: IDateTimeExtractor, parser: IDateTimeParser, text: string, refDate: Date): DateTimeResolutionResult; +} diff --git a/libraries/botbuilder-stdlib/vendors/@microsoft/recognizers-text-date-time/dist/types/dateTime/baseTime.d.ts b/libraries/botbuilder-stdlib/vendors/@microsoft/recognizers-text-date-time/dist/types/dateTime/baseTime.d.ts new file mode 100644 index 0000000000..227b1dceed --- /dev/null +++ b/libraries/botbuilder-stdlib/vendors/@microsoft/recognizers-text-date-time/dist/types/dateTime/baseTime.d.ts @@ -0,0 +1,46 @@ +import { ExtractResult } from "botbuilder-stdlib/vendors/@microsoft/recognizers-text"; +import { Token, DateTimeResolutionResult, IDateTimeUtilityConfiguration } from "./utilities"; +import { IDateTimeParser, DateTimeParseResult } from "./parsers"; +import { IDateTimeExtractor } from "./baseDateTime"; +export interface ITimeExtractorConfiguration { + timeRegexList: RegExp[]; + atRegex: RegExp; + ishRegex: RegExp; +} +export declare class BaseTimeExtractor implements IDateTimeExtractor { + private readonly extractorName; + private readonly config; + constructor(config: ITimeExtractorConfiguration); + extract(text: string, refDate: Date): Array; + basicRegexMatch(text: string): Array; + atRegexMatch(text: string): Array; + specialsRegexMatch(text: string, refDate: Date): Array; +} +export interface ITimeParserConfiguration { + timeTokenPrefix: string; + atRegex: RegExp; + timeRegexes: RegExp[]; + numbers: ReadonlyMap; + utilityConfiguration: IDateTimeUtilityConfiguration; + adjustByPrefix(prefix: string, adjust: { + hour: number; + min: number; + hasMin: boolean; + }): any; + adjustBySuffix(suffix: string, adjust: { + hour: number; + min: number; + hasMin: boolean; + hasAm: boolean; + hasPm: boolean; + }): any; +} +export declare class BaseTimeParser implements IDateTimeParser { + readonly ParserName: string; + readonly config: ITimeParserConfiguration; + constructor(configuration: ITimeParserConfiguration); + parse(er: ExtractResult, referenceTime?: Date): DateTimeParseResult | null; + internalParse(text: string, referenceTime: Date): DateTimeResolutionResult; + private parseBasicRegexMatch(text, referenceTime); + private match2Time(match, referenceTime); +} diff --git a/libraries/botbuilder-stdlib/vendors/@microsoft/recognizers-text-date-time/dist/types/dateTime/baseTimePeriod.d.ts b/libraries/botbuilder-stdlib/vendors/@microsoft/recognizers-text-date-time/dist/types/dateTime/baseTimePeriod.d.ts new file mode 100644 index 0000000000..cde1c57b94 --- /dev/null +++ b/libraries/botbuilder-stdlib/vendors/@microsoft/recognizers-text-date-time/dist/types/dateTime/baseTimePeriod.d.ts @@ -0,0 +1,62 @@ +import { IExtractor, ExtractResult } from "botbuilder-stdlib/vendors/@microsoft/recognizers-text"; +import { IDateTimeUtilityConfiguration } from "./utilities"; +import { IDateTimeParser, DateTimeParseResult } from "./parsers"; +import { BaseTimeParser } from "./baseTime"; +import { IDateTimeExtractor } from "./baseDateTime"; +export interface ITimePeriodExtractorConfiguration { + simpleCasesRegex: RegExp[]; + tillRegex: RegExp; + timeOfDayRegex: RegExp; + generalEndingRegex: RegExp; + singleTimeExtractor: IDateTimeExtractor; + integerExtractor: IExtractor; + getFromTokenIndex(text: string): { + matched: boolean; + index: number; + }; + hasConnectorToken(text: string): boolean; + getBetweenTokenIndex(text: string): { + matched: boolean; + index: number; + }; +} +export declare class BaseTimePeriodExtractor implements IDateTimeExtractor { + readonly extractorName: string; + readonly config: ITimePeriodExtractorConfiguration; + constructor(config: ITimePeriodExtractorConfiguration); + extract(source: string, refDate: Date): Array; + private matchSimpleCases(text); + private mergeTwoTimePoints(text, refDate); + private matchNight(source); +} +export interface ITimePeriodParserConfiguration { + timeExtractor: IDateTimeExtractor; + timeParser: BaseTimeParser; + integerExtractor: IExtractor; + pureNumberFromToRegex: RegExp; + pureNumberBetweenAndRegex: RegExp; + timeOfDayRegex: RegExp; + tillRegex: RegExp; + numbers: ReadonlyMap; + utilityConfiguration: IDateTimeUtilityConfiguration; + specificTimeFromToRegex: RegExp; + specificTimeBetweenAndRegex: RegExp; + getMatchedTimexRange(text: string): { + matched: boolean; + timex: string; + beginHour: number; + endHour: number; + endMin: number; + }; +} +export declare class BaseTimePeriodParser implements IDateTimeParser { + static readonly ParserName: string; + protected readonly config: ITimePeriodParserConfiguration; + constructor(configuration: ITimePeriodParserConfiguration); + parse(er: ExtractResult, refTime?: Date): DateTimeParseResult; + private parseSimpleCases(source, reference); + private parsePureNumCases(text, referenceTime); + private parseSpecificTimeCases(source, reference); + private mergeTwoTimePoints(text, referenceTime); + private parseTimeOfDay(text, referenceTime); +} diff --git a/libraries/botbuilder-stdlib/vendors/@microsoft/recognizers-text-date-time/dist/types/dateTime/chinese/baseDateTime.d.ts b/libraries/botbuilder-stdlib/vendors/@microsoft/recognizers-text-date-time/dist/types/dateTime/chinese/baseDateTime.d.ts new file mode 100644 index 0000000000..5de3ecbcbf --- /dev/null +++ b/libraries/botbuilder-stdlib/vendors/@microsoft/recognizers-text-date-time/dist/types/dateTime/chinese/baseDateTime.d.ts @@ -0,0 +1,29 @@ +import { ExtractResult } from "botbuilder-stdlib/vendors/@microsoft/recognizers-text"; +import { IDateTimeExtractor } from "../baseDateTime"; +export interface DateTimeExtra { + dataType: T; + namedEntity(key: string): { + value: string; + index: number; + length: number; + captures: string[]; + }; +} +export declare class TimeResult { + hour: number; + minute: number; + second: number; + lowBound: number; + constructor(hour: number, minute: number, second: number, lowBound?: number); +} +export declare abstract class BaseDateTimeExtractor implements IDateTimeExtractor { + protected readonly abstract extractorName: string; + private readonly regexesDictionary; + constructor(regexesDictionary: Map); + extract(source: string, refDate: Date): Array; +} +export declare class TimeResolutionUtils { + static addDescription(lowBoundMap: ReadonlyMap, timeResult: TimeResult, description: string): void; + static normalizeDesc(description: string): string; + static matchToValue(onlyDigitMatch: RegExp, numbersMap: ReadonlyMap, source: string): number; +} diff --git a/libraries/botbuilder-stdlib/vendors/@microsoft/recognizers-text-date-time/dist/types/dateTime/chinese/dateConfiguration.d.ts b/libraries/botbuilder-stdlib/vendors/@microsoft/recognizers-text-date-time/dist/types/dateTime/chinese/dateConfiguration.d.ts new file mode 100644 index 0000000000..7d6d04650b --- /dev/null +++ b/libraries/botbuilder-stdlib/vendors/@microsoft/recognizers-text-date-time/dist/types/dateTime/chinese/dateConfiguration.d.ts @@ -0,0 +1,26 @@ +import { ExtractResult, Match } from "botbuilder-stdlib/vendors/@microsoft/recognizers-text"; +import { BaseDateExtractor, BaseDateParser } from "../baseDate"; +import { Token, DateTimeResolutionResult } from "../utilities"; +import { DateTimeParseResult } from "../parsers"; +export declare class ChineseDateExtractor extends BaseDateExtractor { + private readonly durationExtractor; + constructor(); + extract(source: string, refDate: Date): Array; + protected durationWithBeforeAndAfter(source: string, refDate: Date): Array; +} +export declare class ChineseDateParser extends BaseDateParser { + private readonly lunarRegex; + private readonly specialDateRegex; + private readonly tokenNextRegex; + private readonly tokenLastRegex; + private readonly monthMaxDays; + constructor(); + parse(extractorResult: ExtractResult, referenceDate?: Date): DateTimeParseResult | null; + private parseLunarCalendar(source); + protected parseBasicRegexMatch(source: string, referenceDate: Date): DateTimeResolutionResult; + protected parseImplicitDate(source: string, referenceDate: Date): DateTimeResolutionResult; + protected matchToDate(match: Match, referenceDate: Date): DateTimeResolutionResult; + private convertChineseYearToNumber(source); + private getMonthOfYear(source); + private getDayOfMonth(source); +} diff --git a/libraries/botbuilder-stdlib/vendors/@microsoft/recognizers-text-date-time/dist/types/dateTime/chinese/datePeriodConfiguration.d.ts b/libraries/botbuilder-stdlib/vendors/@microsoft/recognizers-text-date-time/dist/types/dateTime/chinese/datePeriodConfiguration.d.ts new file mode 100644 index 0000000000..bb3f8b0318 --- /dev/null +++ b/libraries/botbuilder-stdlib/vendors/@microsoft/recognizers-text-date-time/dist/types/dateTime/chinese/datePeriodConfiguration.d.ts @@ -0,0 +1,39 @@ +import { ExtractResult, Match } from "botbuilder-stdlib/vendors/@microsoft/recognizers-text"; +import { BaseDatePeriodExtractor, BaseDatePeriodParser } from "../baseDatePeriod"; +import { DateTimeResolutionResult } from "../utilities"; +import { DateTimeParseResult } from "../parsers"; +export declare class ChineseDatePeriodExtractor extends BaseDatePeriodExtractor { + constructor(); + extract(source: string, refDate: Date): Array; + private matchNumberWithUnit(source); +} +export declare class ChineseDatePeriodParser extends BaseDatePeriodParser { + private readonly integerExtractor; + private readonly numberParser; + private readonly yearInChineseRegex; + private readonly numberCombinedWithUnitRegex; + private readonly unitRegex; + private readonly yearAndMonthRegex; + private readonly pureNumberYearAndMonthRegex; + private readonly yearToYearRegex; + private readonly YearToYearSuffixRequired; + private readonly chineseYearRegex; + private readonly seasonWithYearRegex; + constructor(); + parse(extractorResult: ExtractResult, referenceDate?: Date): DateTimeParseResult | null; + protected getMatchSimpleCase(source: string): Match; + protected parseSimpleCases(source: string, referenceDate: Date): DateTimeResolutionResult; + protected parseYear(source: string, referenceDate: Date): DateTimeResolutionResult; + private convertYear(yearStr, isChinese); + protected getWeekOfMonth(cardinal: number, month: number, year: number, referenceDate: Date, noYear: boolean): DateTimeResolutionResult; + protected computeDate(cardinal: number, weekday: number, month: number, year: number): Date; + protected parseSeason(source: string, referenceDate: Date): DateTimeResolutionResult; + protected parseQuarter(source: string, referenceDate: Date): DateTimeResolutionResult; + protected parseNumberWithUnit(source: string, referenceDate: Date): DateTimeResolutionResult; + protected parseDuration(source: string, referenceDate: Date): DateTimeResolutionResult; + private parseCommonDurationWithUnit(beforeStr, sourceUnit, numStr, referenceDate); + private convertChineseToNumber(source); + private parseYearAndMonth(source, referenceDate); + private parseYearToYear(source, referenceDate); + private sanitizeYear(year); +} diff --git a/libraries/botbuilder-stdlib/vendors/@microsoft/recognizers-text-date-time/dist/types/dateTime/chinese/dateTimeConfiguration.d.ts b/libraries/botbuilder-stdlib/vendors/@microsoft/recognizers-text-date-time/dist/types/dateTime/chinese/dateTimeConfiguration.d.ts new file mode 100644 index 0000000000..8f260ec7f6 --- /dev/null +++ b/libraries/botbuilder-stdlib/vendors/@microsoft/recognizers-text-date-time/dist/types/dateTime/chinese/dateTimeConfiguration.d.ts @@ -0,0 +1,16 @@ +import { ExtractResult } from "botbuilder-stdlib/vendors/@microsoft/recognizers-text"; +import { BaseDateTimeExtractor, BaseDateTimeParser } from "../baseDateTime"; +import { Token, DateTimeResolutionResult } from "../utilities"; +import { DateTimeParseResult } from "../parsers"; +export declare class ChineseDateTimeExtractor extends BaseDateTimeExtractor { + constructor(); + extract(source: string, refDate: Date): Array; + protected mergeDateAndTime(source: string, refDate: Date): Array; + private timeOfToday(source, refDate); +} +export declare class ChineseDateTimeParser extends BaseDateTimeParser { + constructor(); + parse(er: ExtractResult, refTime?: Date): DateTimeParseResult; + protected mergeDateAndTime(text: string, referenceTime: Date): DateTimeResolutionResult; + protected parseTimeOfToday(text: string, referenceTime: Date): DateTimeResolutionResult; +} diff --git a/libraries/botbuilder-stdlib/vendors/@microsoft/recognizers-text-date-time/dist/types/dateTime/chinese/dateTimePeriodConfiguration.d.ts b/libraries/botbuilder-stdlib/vendors/@microsoft/recognizers-text-date-time/dist/types/dateTime/chinese/dateTimePeriodConfiguration.d.ts new file mode 100644 index 0000000000..22cb8219ff --- /dev/null +++ b/libraries/botbuilder-stdlib/vendors/@microsoft/recognizers-text-date-time/dist/types/dateTime/chinese/dateTimePeriodConfiguration.d.ts @@ -0,0 +1,34 @@ +import { ExtractResult } from "botbuilder-stdlib/vendors/@microsoft/recognizers-text"; +import { BaseDateTimePeriodExtractor, BaseDateTimePeriodParser } from "../baseDateTimePeriod"; +import { Token, DateTimeResolutionResult } from "../utilities"; +import { DateTimeParseResult } from "../parsers"; +export declare class ChineseDateTimePeriodExtractor extends BaseDateTimePeriodExtractor { + private readonly zhijianRegex; + private readonly pastRegex; + private readonly futureRegex; + constructor(); + extract(source: string, refDate: Date): Array; + private mergeDateAndTimePeriod(source, refDate); + protected mergeTwoTimePoints(source: string, refDate: Date): Array; + private matchNubmerWithUnit(source); + protected matchNight(source: string, refDate: Date): Array; +} +export declare class ChineseDateTimePeriodParser extends BaseDateTimePeriodParser { + private readonly TMORegex; + private readonly TAFRegex; + private readonly TEVRegex; + private readonly TNIRegex; + RegExp: any; + private readonly unitRegex; + private readonly timeOfDayRegex; + private readonly cardinalExtractor; + private readonly cardinalParser; + constructor(); + parse(extractorResult: ExtractResult, referenceDate?: Date): DateTimeParseResult | null; + protected mergeDateAndTimePeriods(text: string, referenceTime: Date): DateTimeResolutionResult; + protected mergeTwoTimePoints(text: string, referenceTime: Date): DateTimeResolutionResult; + protected parseSpecificTimeOfDay(text: string, referenceTime: Date): DateTimeResolutionResult; + protected parseNumberWithUnit(text: string, referenceTime: Date): DateTimeResolutionResult; + protected parseDuration(text: string, referenceTime: Date): DateTimeResolutionResult; + private parseCommonDurationWithUnit(beforeStr, sourceUnit, numStr, swift, referenceDate); +} diff --git a/libraries/botbuilder-stdlib/vendors/@microsoft/recognizers-text-date-time/dist/types/dateTime/chinese/durationConfiguration.d.ts b/libraries/botbuilder-stdlib/vendors/@microsoft/recognizers-text-date-time/dist/types/dateTime/chinese/durationConfiguration.d.ts new file mode 100644 index 0000000000..c1f5545364 --- /dev/null +++ b/libraries/botbuilder-stdlib/vendors/@microsoft/recognizers-text-date-time/dist/types/dateTime/chinese/durationConfiguration.d.ts @@ -0,0 +1,20 @@ +import { ExtractResult } from "botbuilder-stdlib/vendors/@microsoft/recognizers-text"; +import { BaseDateTimeExtractor } from "./baseDateTime"; +import { BaseDurationParser } from "../baseDuration"; +import { DateTimeParseResult } from "../parsers"; +export declare enum DurationType { + WithNumber = 0, +} +export declare class ChineseDurationExtractor extends BaseDateTimeExtractor { + protected extractorName: string; + private readonly extractor; + private readonly yearRegex; + private readonly halfSuffixRegex; + constructor(); + extract(source: string, refDate: Date): Array; +} +export declare class ChineseDurationParser extends BaseDurationParser { + private readonly internalParser; + constructor(); + parse(extractorResult: ExtractResult, referenceDate?: Date): DateTimeParseResult | null; +} diff --git a/libraries/botbuilder-stdlib/vendors/@microsoft/recognizers-text-date-time/dist/types/dateTime/chinese/holidayConfiguration.d.ts b/libraries/botbuilder-stdlib/vendors/@microsoft/recognizers-text-date-time/dist/types/dateTime/chinese/holidayConfiguration.d.ts new file mode 100644 index 0000000000..5917bdb5f8 --- /dev/null +++ b/libraries/botbuilder-stdlib/vendors/@microsoft/recognizers-text-date-time/dist/types/dateTime/chinese/holidayConfiguration.d.ts @@ -0,0 +1,43 @@ +import { Match, ExtractResult } from "botbuilder-stdlib/vendors/@microsoft/recognizers-text"; +import { IHolidayExtractorConfiguration, BaseHolidayParser } from "../baseHoliday"; +import { DateTimeResolutionResult } from "../utilities"; +import { DateTimeParseResult } from "../parsers"; +export declare class ChineseHolidayExtractorConfiguration implements IHolidayExtractorConfiguration { + readonly holidayRegexes: RegExp[]; + constructor(); +} +export declare class ChineseHolidayParser extends BaseHolidayParser { + private readonly lunarHolidayRegex; + RegExp: any; + private readonly integerExtractor; + private readonly numberParser; + private readonly fixedHolidayDictionary; + constructor(); + private static NewYear(year); + private static ChsNationalDay(year); + private static LaborDay(year); + private static ChristmasDay(year); + private static LoverDay(year); + private static ChsMilBuildDay(year); + private static FoolDay(year); + private static GirlsDay(year); + private static TreePlantDay(year); + private static FemaleDay(year); + private static ChildrenDay(year); + private static YouthDay(year); + private static TeacherDay(year); + private static SinglesDay(year); + private static HalloweenDay(year); + private static MidautumnDay(year); + private static SpringDay(year); + private static NewYearEve(year); + private static LanternDay(year); + private static QingMingDay(year); + private static DragonBoatDay(year); + private static ChongYangDay(year); + parse(er: ExtractResult, referenceDate?: Date): DateTimeParseResult; + private isLunar(source); + protected match2Date(match: Match, referenceDate: Date): DateTimeResolutionResult; + private convertYear(yearStr, isChinese); + private getDateValue(date, referenceDate, holiday, swift, comparer); +} diff --git a/libraries/botbuilder-stdlib/vendors/@microsoft/recognizers-text-date-time/dist/types/dateTime/chinese/mergedConfiguration.d.ts b/libraries/botbuilder-stdlib/vendors/@microsoft/recognizers-text-date-time/dist/types/dateTime/chinese/mergedConfiguration.d.ts new file mode 100644 index 0000000000..506885e966 --- /dev/null +++ b/libraries/botbuilder-stdlib/vendors/@microsoft/recognizers-text-date-time/dist/types/dateTime/chinese/mergedConfiguration.d.ts @@ -0,0 +1,25 @@ +import { BaseMergedExtractor, BaseMergedParser } from "../baseMerged"; +import { ExtractResult } from "botbuilder-stdlib/vendors/@microsoft/recognizers-text"; +import { DateTimeOptions } from "../dateTimeRecognizer"; +import { DateTimeParseResult } from "../parsers"; +import { StringMap } from "../utilities"; +export declare class ChineseMergedExtractor extends BaseMergedExtractor { + private readonly dayOfMonthRegex; + constructor(options: DateTimeOptions); + extract(source: string, refDate: Date): Array; + protected addTo(destination: ExtractResult[], source: ExtractResult[], sourceStr: string): void; + protected moveOverlap(destination: ExtractResult[], result: ExtractResult): ExtractResult[]; + protected checkBlackList(destination: ExtractResult[], source: string): ExtractResult[]; +} +export declare class ChineseMergedParser extends BaseMergedParser { + constructor(); + parse(er: ExtractResult, refTime?: Date): DateTimeParseResult | null; +} +export declare class ChineseFullMergedParser extends BaseMergedParser { + constructor(); + parse(er: ExtractResult, refTime?: Date): DateTimeParseResult | null; + protected dateTimeResolution(slot: DateTimeParseResult, hasBefore: boolean, hasAfter: boolean, hasSince?: boolean): { + [s: string]: Array; + }; + protected determineDateTimeType(type: string, hasBefore: boolean, hasAfter: boolean, hasSince?: boolean): string; +} diff --git a/libraries/botbuilder-stdlib/vendors/@microsoft/recognizers-text-date-time/dist/types/dateTime/chinese/setConfiguration.d.ts b/libraries/botbuilder-stdlib/vendors/@microsoft/recognizers-text-date-time/dist/types/dateTime/chinese/setConfiguration.d.ts new file mode 100644 index 0000000000..266459cd32 --- /dev/null +++ b/libraries/botbuilder-stdlib/vendors/@microsoft/recognizers-text-date-time/dist/types/dateTime/chinese/setConfiguration.d.ts @@ -0,0 +1,17 @@ +import { ExtractResult } from "botbuilder-stdlib/vendors/@microsoft/recognizers-text"; +import { BaseSetExtractor, BaseSetParser } from "../baseSet"; +import { IDateTimeParser, DateTimeParseResult } from "../parsers"; +import { IDateTimeExtractor } from "../baseDateTime"; +import { DateTimeResolutionResult } from "../utilities"; +export declare class ChineseSetExtractor extends BaseSetExtractor { + constructor(); + extract(source: string, refDate: Date): Array; + private matchEachSpecific(extractor, eachRegex, source, refDate); +} +export declare class ChineseSetParser extends BaseSetParser { + constructor(); + parse(er: ExtractResult, referenceDate?: Date): DateTimeParseResult | null; + protected parseEachUnit(text: string): DateTimeResolutionResult; + protected parserTimeEveryday(text: string, refDate: Date): DateTimeResolutionResult; + protected parseEach(extractor: IDateTimeExtractor, parser: IDateTimeParser, text: string, refDate: Date): DateTimeResolutionResult; +} diff --git a/libraries/botbuilder-stdlib/vendors/@microsoft/recognizers-text-date-time/dist/types/dateTime/chinese/timeConfiguration.d.ts b/libraries/botbuilder-stdlib/vendors/@microsoft/recognizers-text-date-time/dist/types/dateTime/chinese/timeConfiguration.d.ts new file mode 100644 index 0000000000..422bce3661 --- /dev/null +++ b/libraries/botbuilder-stdlib/vendors/@microsoft/recognizers-text-date-time/dist/types/dateTime/chinese/timeConfiguration.d.ts @@ -0,0 +1,28 @@ +import { ExtractResult } from "botbuilder-stdlib/vendors/@microsoft/recognizers-text"; +import { BaseDateTimeExtractor } from "./baseDateTime"; +import { BaseTimeParser } from "../baseTime"; +import { DateTimeParseResult } from "../parsers"; +export declare enum TimeType { + ChineseTime = 0, + LessTime = 1, + DigitTime = 2, +} +export declare class ChineseTimeExtractor extends BaseDateTimeExtractor { + protected extractorName: string; + constructor(); +} +export declare class ChineseTimeParser extends BaseTimeParser { + private readonly onlyDigitMatch; + private readonly numbersMap; + private readonly lowBoundMap; + private readonly functionMap; + private readonly innerExtractor; + constructor(); + parse(er: ExtractResult, referenceTime?: Date): DateTimeParseResult | null; + private handleLess(extra); + private handleChinese(extra); + private handleDigit(extra); + private packTimeResult(extra, timeResult, referenceTime); + private matchToValue(source); + private addDescription(timeResult, description); +} diff --git a/libraries/botbuilder-stdlib/vendors/@microsoft/recognizers-text-date-time/dist/types/dateTime/chinese/timePeriodConfiguration.d.ts b/libraries/botbuilder-stdlib/vendors/@microsoft/recognizers-text-date-time/dist/types/dateTime/chinese/timePeriodConfiguration.d.ts new file mode 100644 index 0000000000..33b350ab0b --- /dev/null +++ b/libraries/botbuilder-stdlib/vendors/@microsoft/recognizers-text-date-time/dist/types/dateTime/chinese/timePeriodConfiguration.d.ts @@ -0,0 +1,29 @@ +import { ExtractResult } from "botbuilder-stdlib/vendors/@microsoft/recognizers-text"; +import { BaseDateTimeExtractor } from "./baseDateTime"; +import { BaseTimePeriodParser } from "../baseTimePeriod"; +import { DateTimeParseResult } from "../parsers"; +export declare enum TimePeriodType { + ShortTime = 0, + FullTime = 1, +} +export declare class ChineseTimePeriodExtractor extends BaseDateTimeExtractor { + protected extractorName: string; + constructor(); +} +export declare class ChineseTimePeriodParser extends BaseTimePeriodParser { + private readonly dayDescriptionRegex; + private readonly onlyDigitMatch; + private readonly lowBoundMap; + private readonly numbersMap; + constructor(); + parse(er: ExtractResult, referenceTime?: Date): DateTimeParseResult; + private parseChineseTimeOfDay(text, referenceTime); + private GetMatchedTimexRange(text); + private parseTimePeriod(extra, referenceTime); + private getParseTimeResult(entity, referenceTime); + private getShortLeft(source); + private buildDate(time, referenceTime); + private buildTimex(timeResult); + private buildSpan(left, right); + private sanitizeTimeResult(timeResult); +} diff --git a/libraries/botbuilder-stdlib/vendors/@microsoft/recognizers-text-date-time/dist/types/dateTime/constants.d.ts b/libraries/botbuilder-stdlib/vendors/@microsoft/recognizers-text-date-time/dist/types/dateTime/constants.d.ts new file mode 100644 index 0000000000..54cc427eb2 --- /dev/null +++ b/libraries/botbuilder-stdlib/vendors/@microsoft/recognizers-text-date-time/dist/types/dateTime/constants.d.ts @@ -0,0 +1,59 @@ +export declare class Constants { + static readonly SYS_DATETIME_DATE: string; + static readonly SYS_DATETIME_TIME: string; + static readonly SYS_DATETIME_DATEPERIOD: string; + static readonly SYS_DATETIME_DATETIME: string; + static readonly SYS_DATETIME_TIMEPERIOD: string; + static readonly SYS_DATETIME_DATETIMEPERIOD: string; + static readonly SYS_DATETIME_DURATION: string; + static readonly SYS_DATETIME_SET: string; + static readonly TimexKey: string; + static readonly ModKey: string; + static readonly TypeKey: string; + static readonly IsLunarKey: string; + static readonly ResolveKey: string; + static readonly ResolveToPastKey: string; + static readonly ResolveToFutureKey: string; + static readonly CommentKey: string; + static readonly CommentAmPm: string; + static readonly SemesterMonthCount: number; + static readonly TrimesterMonthCount: number; + static readonly FourDigitsYearLength: number; + static readonly DefaultLanguageFallback_MDY: string; + static readonly DefaultLanguageFallback_DMY: string; + static readonly MinYearNum: number; + static readonly MaxYearNum: number; + static readonly MaxTwoDigitYearFutureNum: number; + static readonly MinTwoDigitYearPastNum: number; + static readonly BEFORE_MOD: string; + static readonly AFTER_MOD: string; + static readonly SINCE_MOD: string; + static readonly UNTIL_MOD: string; + static readonly EARLY_MOD: string; + static readonly MID_MOD: string; + static readonly LATE_MOD: string; + static readonly MORE_THAN_MOD: string; + static readonly LESS_THAN_MOD: string; + static readonly REF_UNDEF_MOD: string; +} +export declare class TimeTypeConstants { + static readonly DATE: string; + static readonly START_DATE: string; + static readonly END_DATE: string; + static readonly DATETIME: string; + static readonly START_DATETIME: string; + static readonly END_DATETIME: string; + static readonly DURATION: string; + static readonly SET: string; + static readonly TIME: string; + static readonly VALUE: string; + static readonly START_TIME: string; + static readonly END_TIME: string; + static readonly START: string; + static readonly END: string; + static readonly beforeMod: string; + static readonly afterMod: string; + static readonly sinceMod: string; + static readonly moreThanMod: string; + static readonly lessThanMod: string; +} diff --git a/libraries/botbuilder-stdlib/vendors/@microsoft/recognizers-text-date-time/dist/types/dateTime/dateTimeRecognizer.d.ts b/libraries/botbuilder-stdlib/vendors/@microsoft/recognizers-text-date-time/dist/types/dateTime/dateTimeRecognizer.d.ts new file mode 100644 index 0000000000..6c22ff1bac --- /dev/null +++ b/libraries/botbuilder-stdlib/vendors/@microsoft/recognizers-text-date-time/dist/types/dateTime/dateTimeRecognizer.d.ts @@ -0,0 +1,15 @@ +import { ModelResult, Recognizer } from "botbuilder-stdlib/vendors/@microsoft/recognizers-text"; +import { IDateTimeModel } from "./models"; +export declare enum DateTimeOptions { + None = 0, + SkipFromToMerge = 1, + SplitDateAndTime = 2, + Calendar = 4, +} +export declare function recognizeDateTime(query: string, culture: string, options?: DateTimeOptions, referenceDate?: Date, fallbackToDefaultCulture?: boolean): Array; +export default class DateTimeRecognizer extends Recognizer { + constructor(culture: string, options?: DateTimeOptions, lazyInitialization?: boolean); + protected InitializeConfiguration(): void; + protected IsValidOptions(options: number): boolean; + getDateTimeModel(culture?: string, fallbackToDefaultCulture?: boolean): IDateTimeModel; +} diff --git a/libraries/botbuilder-stdlib/vendors/@microsoft/recognizers-text-date-time/dist/types/dateTime/english/baseConfiguration.d.ts b/libraries/botbuilder-stdlib/vendors/@microsoft/recognizers-text-date-time/dist/types/dateTime/english/baseConfiguration.d.ts new file mode 100644 index 0000000000..ab1c5e5ce8 --- /dev/null +++ b/libraries/botbuilder-stdlib/vendors/@microsoft/recognizers-text-date-time/dist/types/dateTime/english/baseConfiguration.d.ts @@ -0,0 +1,15 @@ +import { IDateTimeUtilityConfiguration } from "../utilities"; +import { BaseDateParserConfiguration } from "../parsers"; +export declare class EnglishDateTimeUtilityConfiguration implements IDateTimeUtilityConfiguration { + readonly agoRegex: RegExp; + readonly laterRegex: RegExp; + readonly inConnectorRegex: RegExp; + readonly rangeUnitRegex: RegExp; + readonly amDescRegex: RegExp; + readonly pmDescRegex: RegExp; + readonly amPmDescRegex: RegExp; + constructor(); +} +export declare class EnglishCommonDateTimeParserConfiguration extends BaseDateParserConfiguration { + constructor(); +} diff --git a/libraries/botbuilder-stdlib/vendors/@microsoft/recognizers-text-date-time/dist/types/dateTime/english/dateConfiguration.d.ts b/libraries/botbuilder-stdlib/vendors/@microsoft/recognizers-text-date-time/dist/types/dateTime/english/dateConfiguration.d.ts new file mode 100644 index 0000000000..f41bdeedd4 --- /dev/null +++ b/libraries/botbuilder-stdlib/vendors/@microsoft/recognizers-text-date-time/dist/types/dateTime/english/dateConfiguration.d.ts @@ -0,0 +1,62 @@ +import { IDateExtractorConfiguration, IDateParserConfiguration } from "../baseDate"; +import { IDateTimeUtilityConfiguration } from "../utilities"; +import { BaseNumberParser, BaseNumberExtractor } from "botbuilder-stdlib/vendors/@microsoft/recognizers-text-number"; +import { EnglishCommonDateTimeParserConfiguration } from "./baseConfiguration"; +import { IDateTimeParser } from "../parsers"; +import { IDateTimeExtractor } from "../baseDateTime"; +export declare class EnglishDateExtractorConfiguration implements IDateExtractorConfiguration { + readonly dateRegexList: RegExp[]; + readonly implicitDateList: RegExp[]; + readonly monthEnd: RegExp; + readonly ofMonth: RegExp; + readonly dateUnitRegex: RegExp; + readonly forTheRegex: RegExp; + readonly weekDayAndDayOfMonthRegex: RegExp; + readonly relativeMonthRegex: RegExp; + readonly weekDayRegex: RegExp; + readonly dayOfWeek: ReadonlyMap; + readonly ordinalExtractor: BaseNumberExtractor; + readonly integerExtractor: BaseNumberExtractor; + readonly numberParser: BaseNumberParser; + readonly durationExtractor: IDateTimeExtractor; + readonly utilityConfiguration: IDateTimeUtilityConfiguration; + constructor(); +} +export declare class EnglishDateParserConfiguration implements IDateParserConfiguration { + readonly ordinalExtractor: BaseNumberExtractor; + readonly integerExtractor: BaseNumberExtractor; + readonly cardinalExtractor: BaseNumberExtractor; + readonly durationExtractor: IDateTimeExtractor; + readonly numberParser: BaseNumberParser; + readonly durationParser: IDateTimeParser; + readonly monthOfYear: ReadonlyMap; + readonly dayOfMonth: ReadonlyMap; + readonly dayOfWeek: ReadonlyMap; + readonly unitMap: ReadonlyMap; + readonly cardinalMap: ReadonlyMap; + readonly dateRegex: RegExp[]; + readonly onRegex: RegExp; + readonly specialDayRegex: RegExp; + readonly specialDayWithNumRegex: RegExp; + readonly nextRegex: RegExp; + readonly unitRegex: RegExp; + readonly monthRegex: RegExp; + readonly weekDayRegex: RegExp; + readonly lastRegex: RegExp; + readonly thisRegex: RegExp; + readonly weekDayOfMonthRegex: RegExp; + readonly forTheRegex: RegExp; + readonly weekDayAndDayOfMonthRegex: RegExp; + readonly relativeMonthRegex: RegExp; + readonly relativeWeekDayRegex: RegExp; + readonly utilityConfiguration: IDateTimeUtilityConfiguration; + readonly dateTokenPrefix: string; + static readonly relativeDayRegex: RegExp; + static readonly nextPrefixRegex: RegExp; + static readonly pastPrefixRegex: RegExp; + constructor(config: EnglishCommonDateTimeParserConfiguration); + getSwiftDay(source: string): number; + getSwiftMonth(source: string): number; + getSwift(source: string): number; + isCardinalLast(source: string): boolean; +} diff --git a/libraries/botbuilder-stdlib/vendors/@microsoft/recognizers-text-date-time/dist/types/dateTime/english/datePeriodConfiguration.d.ts b/libraries/botbuilder-stdlib/vendors/@microsoft/recognizers-text-date-time/dist/types/dateTime/english/datePeriodConfiguration.d.ts new file mode 100644 index 0000000000..49005cf9a0 --- /dev/null +++ b/libraries/botbuilder-stdlib/vendors/@microsoft/recognizers-text-date-time/dist/types/dateTime/english/datePeriodConfiguration.d.ts @@ -0,0 +1,85 @@ +import { IDatePeriodExtractorConfiguration, IDatePeriodParserConfiguration } from "../baseDatePeriod"; +import { BaseDateParser } from "../baseDate"; +import { BaseNumberParser, BaseNumberExtractor } from "botbuilder-stdlib/vendors/@microsoft/recognizers-text-number"; +import { BaseDurationParser } from "../baseDuration"; +import { EnglishCommonDateTimeParserConfiguration } from "./baseConfiguration"; +import { IDateTimeExtractor } from "../baseDateTime"; +export declare class EnglishDatePeriodExtractorConfiguration implements IDatePeriodExtractorConfiguration { + readonly simpleCasesRegexes: RegExp[]; + readonly illegalYearRegex: RegExp; + readonly YearRegex: RegExp; + readonly tillRegex: RegExp; + readonly followedUnit: RegExp; + readonly numberCombinedWithUnit: RegExp; + readonly pastRegex: RegExp; + readonly futureRegex: RegExp; + readonly weekOfRegex: RegExp; + readonly monthOfRegex: RegExp; + readonly dateUnitRegex: RegExp; + readonly inConnectorRegex: RegExp; + readonly rangeUnitRegex: RegExp; + readonly datePointExtractor: IDateTimeExtractor; + readonly integerExtractor: BaseNumberExtractor; + readonly numberParser: BaseNumberParser; + readonly durationExtractor: IDateTimeExtractor; + readonly rangeConnectorRegex: RegExp; + constructor(); + getFromTokenIndex(source: string): { + matched: boolean; + index: number; + }; + getBetweenTokenIndex(source: string): { + matched: boolean; + index: number; + }; + hasConnectorToken(source: string): boolean; +} +export declare class EnglishDatePeriodParserConfiguration implements IDatePeriodParserConfiguration { + readonly dateExtractor: IDateTimeExtractor; + readonly dateParser: BaseDateParser; + readonly durationExtractor: IDateTimeExtractor; + readonly durationParser: BaseDurationParser; + readonly monthFrontBetweenRegex: RegExp; + readonly betweenRegex: RegExp; + readonly monthFrontSimpleCasesRegex: RegExp; + readonly simpleCasesRegex: RegExp; + readonly oneWordPeriodRegex: RegExp; + readonly monthWithYear: RegExp; + readonly monthNumWithYear: RegExp; + readonly yearRegex: RegExp; + readonly pastRegex: RegExp; + readonly futureRegex: RegExp; + readonly inConnectorRegex: RegExp; + readonly weekOfMonthRegex: RegExp; + readonly weekOfYearRegex: RegExp; + readonly quarterRegex: RegExp; + readonly quarterRegexYearFront: RegExp; + readonly allHalfYearRegex: RegExp; + readonly seasonRegex: RegExp; + readonly weekOfRegex: RegExp; + readonly monthOfRegex: RegExp; + readonly whichWeekRegex: RegExp; + readonly nextPrefixRegex: RegExp; + readonly pastPrefixRegex: RegExp; + readonly thisPrefixRegex: RegExp; + readonly restOfDateRegex: RegExp; + readonly laterEarlyPeriodRegex: RegExp; + readonly weekWithWeekDayRangeRegex: RegExp; + readonly tokenBeforeDate: string; + readonly dayOfMonth: ReadonlyMap; + readonly monthOfYear: ReadonlyMap; + readonly cardinalMap: ReadonlyMap; + readonly seasonMap: ReadonlyMap; + readonly unitMap: ReadonlyMap; + constructor(config: EnglishCommonDateTimeParserConfiguration); + getSwiftDayOrMonth(source: string): number; + getSwiftYear(source: string): number; + isFuture(source: string): boolean; + isYearToDate(source: string): boolean; + isMonthToDate(source: string): boolean; + isWeekOnly(source: string): boolean; + isWeekend(source: string): boolean; + isMonthOnly(source: string): boolean; + isYearOnly(source: string): boolean; + isLastCardinal(source: string): boolean; +} diff --git a/libraries/botbuilder-stdlib/vendors/@microsoft/recognizers-text-date-time/dist/types/dateTime/english/dateTimeConfiguration.d.ts b/libraries/botbuilder-stdlib/vendors/@microsoft/recognizers-text-date-time/dist/types/dateTime/english/dateTimeConfiguration.d.ts new file mode 100644 index 0000000000..92aae68068 --- /dev/null +++ b/libraries/botbuilder-stdlib/vendors/@microsoft/recognizers-text-date-time/dist/types/dateTime/english/dateTimeConfiguration.d.ts @@ -0,0 +1,56 @@ +import { IDateTimeExtractor, IDateTimeExtractorConfiguration, IDateTimeParserConfiguration } from "../baseDateTime"; +import { BaseDateParser } from "../baseDate"; +import { BaseTimeParser } from "../baseTime"; +import { BaseNumberExtractor, BaseNumberParser } from "botbuilder-stdlib/vendors/@microsoft/recognizers-text-number"; +import { ICommonDateTimeParserConfiguration, IDateTimeParser } from "../parsers"; +import { IDateTimeUtilityConfiguration } from "../utilities"; +export declare class EnglishDateTimeExtractorConfiguration implements IDateTimeExtractorConfiguration { + readonly datePointExtractor: IDateTimeExtractor; + readonly timePointExtractor: IDateTimeExtractor; + readonly durationExtractor: IDateTimeExtractor; + readonly suffixRegex: RegExp; + readonly nowRegex: RegExp; + readonly timeOfTodayAfterRegex: RegExp; + readonly simpleTimeOfTodayAfterRegex: RegExp; + readonly nightRegex: RegExp; + readonly timeOfTodayBeforeRegex: RegExp; + readonly simpleTimeOfTodayBeforeRegex: RegExp; + readonly theEndOfRegex: RegExp; + readonly unitRegex: RegExp; + readonly prepositionRegex: RegExp; + readonly connectorRegex: RegExp; + readonly utilityConfiguration: IDateTimeUtilityConfiguration; + constructor(); + isConnectorToken(source: string): boolean; +} +export declare class EnglishDateTimeParserConfiguration implements IDateTimeParserConfiguration { + tokenBeforeDate: string; + tokenBeforeTime: string; + dateExtractor: IDateTimeExtractor; + timeExtractor: IDateTimeExtractor; + dateParser: BaseDateParser; + timeParser: BaseTimeParser; + cardinalExtractor: BaseNumberExtractor; + numberParser: BaseNumberParser; + durationExtractor: IDateTimeExtractor; + durationParser: IDateTimeParser; + nowRegex: RegExp; + amTimeRegex: RegExp; + pmTimeRegex: RegExp; + simpleTimeOfTodayAfterRegex: RegExp; + simpleTimeOfTodayBeforeRegex: RegExp; + specificTimeOfDayRegex: RegExp; + theEndOfRegex: RegExp; + unitRegex: RegExp; + unitMap: ReadonlyMap; + numbers: ReadonlyMap; + utilityConfiguration: IDateTimeUtilityConfiguration; + constructor(config: ICommonDateTimeParserConfiguration); + getHour(text: string, hour: number): number; + getMatchedNowTimex(text: string): { + matched: boolean; + timex: string; + }; + getSwiftDay(text: string): number; + haveAmbiguousToken(text: string, matchedText: string): boolean; +} diff --git a/libraries/botbuilder-stdlib/vendors/@microsoft/recognizers-text-date-time/dist/types/dateTime/english/dateTimePeriodConfiguration.d.ts b/libraries/botbuilder-stdlib/vendors/@microsoft/recognizers-text-date-time/dist/types/dateTime/english/dateTimePeriodConfiguration.d.ts new file mode 100644 index 0000000000..1ef9f4a080 --- /dev/null +++ b/libraries/botbuilder-stdlib/vendors/@microsoft/recognizers-text-date-time/dist/types/dateTime/english/dateTimePeriodConfiguration.d.ts @@ -0,0 +1,77 @@ +import { IDateTimePeriodExtractorConfiguration, IDateTimePeriodParserConfiguration } from "../baseDateTimePeriod"; +import { BaseDateParser } from "../baseDate"; +import { BaseTimeParser } from "../baseTime"; +import { IDateTimeExtractor, BaseDateTimeParser } from "../baseDateTime"; +import { BaseDurationParser } from "../baseDuration"; +import { EnglishCardinalExtractor } from "botbuilder-stdlib/vendors/@microsoft/recognizers-text-number"; +import { EnglishCommonDateTimeParserConfiguration } from "./baseConfiguration"; +import { IDateTimeParser } from "../parsers"; +export declare class EnglishDateTimePeriodExtractorConfiguration implements IDateTimePeriodExtractorConfiguration { + readonly cardinalExtractor: EnglishCardinalExtractor; + readonly singleDateExtractor: IDateTimeExtractor; + readonly singleTimeExtractor: IDateTimeExtractor; + readonly singleDateTimeExtractor: IDateTimeExtractor; + readonly durationExtractor: IDateTimeExtractor; + readonly timePeriodExtractor: IDateTimeExtractor; + readonly simpleCasesRegexes: RegExp[]; + readonly prepositionRegex: RegExp; + readonly tillRegex: RegExp; + readonly specificTimeOfDayRegex: RegExp; + readonly timeOfDayRegex: RegExp; + readonly periodTimeOfDayWithDateRegex: RegExp; + readonly followedUnit: RegExp; + readonly numberCombinedWithUnit: RegExp; + readonly timeUnitRegex: RegExp; + readonly pastPrefixRegex: RegExp; + readonly nextPrefixRegex: RegExp; + readonly rangeConnectorRegex: RegExp; + readonly relativeTimeUnitRegex: RegExp; + readonly restOfDateTimeRegex: RegExp; + readonly generalEndingRegex: RegExp; + readonly middlePauseRegex: RegExp; + constructor(); + getFromTokenIndex(source: string): { + matched: boolean; + index: number; + }; + getBetweenTokenIndex(source: string): { + matched: boolean; + index: number; + }; + hasConnectorToken(source: string): boolean; +} +export declare class EnglishDateTimePeriodParserConfiguration implements IDateTimePeriodParserConfiguration { + readonly pureNumberFromToRegex: RegExp; + readonly pureNumberBetweenAndRegex: RegExp; + readonly periodTimeOfDayWithDateRegex: RegExp; + readonly specificTimeOfDayRegex: RegExp; + readonly pastRegex: RegExp; + readonly futureRegex: RegExp; + readonly relativeTimeUnitRegex: RegExp; + readonly numbers: ReadonlyMap; + readonly unitMap: ReadonlyMap; + readonly dateExtractor: IDateTimeExtractor; + readonly timePeriodExtractor: IDateTimeExtractor; + readonly timeExtractor: IDateTimeExtractor; + readonly dateTimeExtractor: IDateTimeExtractor; + readonly durationExtractor: IDateTimeExtractor; + readonly dateParser: BaseDateParser; + readonly timeParser: BaseTimeParser; + readonly dateTimeParser: BaseDateTimeParser; + readonly timePeriodParser: IDateTimeParser; + readonly durationParser: BaseDurationParser; + readonly morningStartEndRegex: RegExp; + readonly afternoonStartEndRegex: RegExp; + readonly eveningStartEndRegex: RegExp; + readonly nightStartEndRegex: RegExp; + readonly restOfDateTimeRegex: RegExp; + constructor(config: EnglishCommonDateTimeParserConfiguration); + getMatchedTimeRange(source: string): { + timeStr: string; + beginHour: number; + endHour: number; + endMin: number; + success: boolean; + }; + getSwiftPrefix(source: string): number; +} diff --git a/libraries/botbuilder-stdlib/vendors/@microsoft/recognizers-text-date-time/dist/types/dateTime/english/durationConfiguration.d.ts b/libraries/botbuilder-stdlib/vendors/@microsoft/recognizers-text-date-time/dist/types/dateTime/english/durationConfiguration.d.ts new file mode 100644 index 0000000000..67cf49aacc --- /dev/null +++ b/libraries/botbuilder-stdlib/vendors/@microsoft/recognizers-text-date-time/dist/types/dateTime/english/durationConfiguration.d.ts @@ -0,0 +1,32 @@ +import { IDurationExtractorConfiguration, IDurationParserConfiguration } from "../baseDuration"; +import { BaseNumberExtractor, BaseNumberParser, EnglishCardinalExtractor } from "botbuilder-stdlib/vendors/@microsoft/recognizers-text-number"; +import { ICommonDateTimeParserConfiguration } from "../parsers"; +export declare class EnglishDurationExtractorConfiguration implements IDurationExtractorConfiguration { + readonly allRegex: RegExp; + readonly halfRegex: RegExp; + readonly followedUnit: RegExp; + readonly numberCombinedWithUnit: RegExp; + readonly anUnitRegex: RegExp; + readonly inexactNumberUnitRegex: RegExp; + readonly suffixAndRegex: RegExp; + readonly relativeDurationUnitRegex: RegExp; + readonly moreThanRegex: RegExp; + readonly lessThanRegex: RegExp; + readonly cardinalExtractor: EnglishCardinalExtractor; + constructor(); +} +export declare class EnglishDurationParserConfiguration implements IDurationParserConfiguration { + readonly cardinalExtractor: BaseNumberExtractor; + readonly numberParser: BaseNumberParser; + readonly followedUnit: RegExp; + readonly suffixAndRegex: RegExp; + readonly numberCombinedWithUnit: RegExp; + readonly anUnitRegex: RegExp; + readonly allDateUnitRegex: RegExp; + readonly halfDateUnitRegex: RegExp; + readonly inexactNumberUnitRegex: RegExp; + readonly unitMap: ReadonlyMap; + readonly unitValueMap: ReadonlyMap; + readonly doubleNumbers: ReadonlyMap; + constructor(config: ICommonDateTimeParserConfiguration); +} diff --git a/libraries/botbuilder-stdlib/vendors/@microsoft/recognizers-text-date-time/dist/types/dateTime/english/holidayConfiguration.d.ts b/libraries/botbuilder-stdlib/vendors/@microsoft/recognizers-text-date-time/dist/types/dateTime/english/holidayConfiguration.d.ts new file mode 100644 index 0000000000..c5b73cb15e --- /dev/null +++ b/libraries/botbuilder-stdlib/vendors/@microsoft/recognizers-text-date-time/dist/types/dateTime/english/holidayConfiguration.d.ts @@ -0,0 +1,41 @@ +import { IHolidayExtractorConfiguration, BaseHolidayParserConfiguration } from "../baseHoliday"; +export declare class EnglishHolidayExtractorConfiguration implements IHolidayExtractorConfiguration { + readonly holidayRegexes: RegExp[]; + constructor(); +} +export declare class EnglishHolidayParserConfiguration extends BaseHolidayParserConfiguration { + constructor(); + protected initHolidayFuncs(): ReadonlyMap Date>; + private static NewYear(year); + private static NewYearEve(year); + private static ChristmasDay(year); + private static ChristmasEve(year); + private static ValentinesDay(year); + private static WhiteLoverDay(year); + private static FoolDay(year); + private static GirlsDay(year); + private static TreePlantDay(year); + private static FemaleDay(year); + private static ChildrenDay(year); + private static YouthDay(year); + private static TeacherDay(year); + private static SinglesDay(year); + private static MaoBirthday(year); + private static InaugurationDay(year); + private static GroundhogDay(year); + private static StPatrickDay(year); + private static StGeorgeDay(year); + private static Mayday(year); + private static CincoDeMayoday(year); + private static BaptisteDay(year); + private static UsaIndependenceDay(year); + private static BastilleDay(year); + private static HalloweenDay(year); + private static AllHallowDay(year); + private static AllSoulsday(year); + private static GuyFawkesDay(year); + private static Veteransday(year); + private static EasterDay(year); + getSwiftYear(text: string): number; + sanitizeHolidayToken(holiday: string): string; +} diff --git a/libraries/botbuilder-stdlib/vendors/@microsoft/recognizers-text-date-time/dist/types/dateTime/english/mergedConfiguration.d.ts b/libraries/botbuilder-stdlib/vendors/@microsoft/recognizers-text-date-time/dist/types/dateTime/english/mergedConfiguration.d.ts new file mode 100644 index 0000000000..cab3820468 --- /dev/null +++ b/libraries/botbuilder-stdlib/vendors/@microsoft/recognizers-text-date-time/dist/types/dateTime/english/mergedConfiguration.d.ts @@ -0,0 +1,48 @@ +import { IMergedExtractorConfiguration, IMergedParserConfiguration } from "../baseMerged"; +import { BaseDateParser } from "../baseDate"; +import { BaseTimeParser } from "../baseTime"; +import { BaseSetParser } from "../baseSet"; +import { BaseHolidayParser } from "../baseHoliday"; +import { BaseDatePeriodParser } from "../baseDatePeriod"; +import { BaseTimePeriodParser } from "../baseTimePeriod"; +import { IDateTimeExtractor, BaseDateTimeParser } from "../baseDateTime"; +import { BaseDateTimePeriodParser } from "../baseDateTimePeriod"; +import { BaseDurationParser } from "../baseDuration"; +import { BaseNumberExtractor } from "botbuilder-stdlib/vendors/@microsoft/recognizers-text-number"; +import { EnglishCommonDateTimeParserConfiguration } from "./baseConfiguration"; +export declare class EnglishMergedExtractorConfiguration implements IMergedExtractorConfiguration { + readonly dateExtractor: IDateTimeExtractor; + readonly timeExtractor: IDateTimeExtractor; + readonly dateTimeExtractor: IDateTimeExtractor; + readonly datePeriodExtractor: IDateTimeExtractor; + readonly timePeriodExtractor: IDateTimeExtractor; + readonly dateTimePeriodExtractor: IDateTimeExtractor; + readonly holidayExtractor: IDateTimeExtractor; + readonly durationExtractor: IDateTimeExtractor; + readonly setExtractor: IDateTimeExtractor; + readonly integerExtractor: BaseNumberExtractor; + readonly afterRegex: RegExp; + readonly sinceRegex: RegExp; + readonly beforeRegex: RegExp; + readonly fromToRegex: RegExp; + readonly singleAmbiguousMonthRegex: RegExp; + readonly prepositionSuffixRegex: RegExp; + readonly numberEndingPattern: RegExp; + readonly filterWordRegexList: RegExp[]; + constructor(); +} +export declare class EnglishMergedParserConfiguration implements IMergedParserConfiguration { + readonly beforeRegex: RegExp; + readonly afterRegex: RegExp; + readonly sinceRegex: RegExp; + readonly dateParser: BaseDateParser; + readonly holidayParser: BaseHolidayParser; + readonly timeParser: BaseTimeParser; + readonly dateTimeParser: BaseDateTimeParser; + readonly datePeriodParser: BaseDatePeriodParser; + readonly timePeriodParser: BaseTimePeriodParser; + readonly dateTimePeriodParser: BaseDateTimePeriodParser; + readonly durationParser: BaseDurationParser; + readonly setParser: BaseSetParser; + constructor(config: EnglishCommonDateTimeParserConfiguration); +} diff --git a/libraries/botbuilder-stdlib/vendors/@microsoft/recognizers-text-date-time/dist/types/dateTime/english/parsers.d.ts b/libraries/botbuilder-stdlib/vendors/@microsoft/recognizers-text-date-time/dist/types/dateTime/english/parsers.d.ts new file mode 100644 index 0000000000..c68ca29110 --- /dev/null +++ b/libraries/botbuilder-stdlib/vendors/@microsoft/recognizers-text-date-time/dist/types/dateTime/english/parsers.d.ts @@ -0,0 +1,7 @@ +import { BaseTimeParser, ITimeParserConfiguration } from "../baseTime"; +import { DateTimeResolutionResult } from "../utilities"; +export declare class EnglishTimeParser extends BaseTimeParser { + constructor(configuration: ITimeParserConfiguration); + internalParse(text: string, referenceTime: Date): DateTimeResolutionResult; + private parseIsh(text, referenceTime); +} diff --git a/libraries/botbuilder-stdlib/vendors/@microsoft/recognizers-text-date-time/dist/types/dateTime/english/setConfiguration.d.ts b/libraries/botbuilder-stdlib/vendors/@microsoft/recognizers-text-date-time/dist/types/dateTime/english/setConfiguration.d.ts new file mode 100644 index 0000000000..7a970de0e8 --- /dev/null +++ b/libraries/botbuilder-stdlib/vendors/@microsoft/recognizers-text-date-time/dist/types/dateTime/english/setConfiguration.d.ts @@ -0,0 +1,59 @@ +import { ISetExtractorConfiguration, ISetParserConfiguration } from "../baseSet"; +import { BaseDateParser } from "../baseDate"; +import { BaseTimeParser } from "../baseTime"; +import { BaseDatePeriodParser } from "../baseDatePeriod"; +import { BaseTimePeriodParser } from "../baseTimePeriod"; +import { IDateTimeExtractor, BaseDateTimeParser } from "../baseDateTime"; +import { BaseDateTimePeriodParser } from "../baseDateTimePeriod"; +import { BaseDurationParser } from "../baseDuration"; +import { ICommonDateTimeParserConfiguration } from "../parsers"; +export declare class EnglishSetExtractorConfiguration implements ISetExtractorConfiguration { + readonly lastRegex: RegExp; + readonly eachPrefixRegex: RegExp; + readonly periodicRegex: RegExp; + readonly eachUnitRegex: RegExp; + readonly eachDayRegex: RegExp; + readonly beforeEachDayRegex: RegExp; + readonly setWeekDayRegex: RegExp; + readonly setEachRegex: RegExp; + readonly durationExtractor: IDateTimeExtractor; + readonly timeExtractor: IDateTimeExtractor; + readonly dateExtractor: IDateTimeExtractor; + readonly dateTimeExtractor: IDateTimeExtractor; + readonly datePeriodExtractor: IDateTimeExtractor; + readonly timePeriodExtractor: IDateTimeExtractor; + readonly dateTimePeriodExtractor: IDateTimeExtractor; + constructor(); +} +export declare class EnglishSetParserConfiguration implements ISetParserConfiguration { + readonly durationExtractor: IDateTimeExtractor; + readonly durationParser: BaseDurationParser; + readonly timeExtractor: IDateTimeExtractor; + readonly timeParser: BaseTimeParser; + readonly dateExtractor: IDateTimeExtractor; + readonly dateParser: BaseDateParser; + readonly dateTimeExtractor: IDateTimeExtractor; + readonly dateTimeParser: BaseDateTimeParser; + readonly datePeriodExtractor: IDateTimeExtractor; + readonly datePeriodParser: BaseDatePeriodParser; + readonly timePeriodExtractor: IDateTimeExtractor; + readonly timePeriodParser: BaseTimePeriodParser; + readonly dateTimePeriodExtractor: IDateTimeExtractor; + readonly dateTimePeriodParser: BaseDateTimePeriodParser; + readonly unitMap: ReadonlyMap; + readonly eachPrefixRegex: RegExp; + readonly periodicRegex: RegExp; + readonly eachUnitRegex: RegExp; + readonly eachDayRegex: RegExp; + readonly setWeekDayRegex: RegExp; + readonly setEachRegex: RegExp; + constructor(config: ICommonDateTimeParserConfiguration); + getMatchedDailyTimex(text: string): { + matched: boolean; + timex: string; + }; + getMatchedUnitTimex(text: string): { + matched: boolean; + timex: string; + }; +} diff --git a/libraries/botbuilder-stdlib/vendors/@microsoft/recognizers-text-date-time/dist/types/dateTime/english/timeConfiguration.d.ts b/libraries/botbuilder-stdlib/vendors/@microsoft/recognizers-text-date-time/dist/types/dateTime/english/timeConfiguration.d.ts new file mode 100644 index 0000000000..003e1960e4 --- /dev/null +++ b/libraries/botbuilder-stdlib/vendors/@microsoft/recognizers-text-date-time/dist/types/dateTime/english/timeConfiguration.d.ts @@ -0,0 +1,38 @@ +import { ITimeExtractorConfiguration, ITimeParserConfiguration } from "../baseTime"; +import { ICommonDateTimeParserConfiguration } from "../parsers"; +import { IDateTimeUtilityConfiguration } from "../utilities"; +export declare class EnglishTimeExtractorConfiguration implements ITimeExtractorConfiguration { + static timeRegexList: RegExp[]; + static atRegex: RegExp; + static lessThanOneHour: RegExp; + static timeSuffix: RegExp; + static timeSuffixFull: RegExp; + static ishRegex: RegExp; + readonly timeRegexList: RegExp[]; + readonly atRegex: RegExp; + readonly ishRegex: RegExp; + constructor(); +} +export declare class EnglishTimeParserConfiguration implements ITimeParserConfiguration { + readonly timeTokenPrefix: string; + readonly atRegex: RegExp; + readonly timeRegexes: RegExp[]; + readonly numbers: ReadonlyMap; + readonly lunchRegex: RegExp; + readonly timeSuffixFull: RegExp; + readonly nightRegex: RegExp; + readonly utilityConfiguration: IDateTimeUtilityConfiguration; + constructor(config: ICommonDateTimeParserConfiguration); + adjustByPrefix(prefix: string, adjust: { + hour: number; + min: number; + hasMin: boolean; + }): void; + adjustBySuffix(suffix: string, adjust: { + hour: number; + min: number; + hasMin: boolean; + hasAm: boolean; + hasPm: boolean; + }): void; +} diff --git a/libraries/botbuilder-stdlib/vendors/@microsoft/recognizers-text-date-time/dist/types/dateTime/english/timePeriodConfiguration.d.ts b/libraries/botbuilder-stdlib/vendors/@microsoft/recognizers-text-date-time/dist/types/dateTime/english/timePeriodConfiguration.d.ts new file mode 100644 index 0000000000..4bddae4660 --- /dev/null +++ b/libraries/botbuilder-stdlib/vendors/@microsoft/recognizers-text-date-time/dist/types/dateTime/english/timePeriodConfiguration.d.ts @@ -0,0 +1,45 @@ +import { ITimePeriodExtractorConfiguration, ITimePeriodParserConfiguration } from "../baseTimePeriod"; +import { BaseTimeParser } from "../baseTime"; +import { IExtractor } from "botbuilder-stdlib/vendors/@microsoft/recognizers-text"; +import { ICommonDateTimeParserConfiguration } from "../parsers"; +import { IDateTimeUtilityConfiguration } from "../utilities"; +import { IDateTimeExtractor } from "../baseDateTime"; +export declare class EnglishTimePeriodExtractorConfiguration implements ITimePeriodExtractorConfiguration { + readonly simpleCasesRegex: RegExp[]; + readonly tillRegex: RegExp; + readonly timeOfDayRegex: RegExp; + readonly generalEndingRegex: RegExp; + readonly singleTimeExtractor: IDateTimeExtractor; + readonly integerExtractor: IExtractor; + constructor(); + getFromTokenIndex(source: string): { + matched: boolean; + index: number; + }; + getBetweenTokenIndex(source: string): { + matched: boolean; + index: number; + }; + hasConnectorToken(source: string): boolean; +} +export declare class EnglishTimePeriodParserConfiguration implements ITimePeriodParserConfiguration { + timeExtractor: IDateTimeExtractor; + timeParser: BaseTimeParser; + integerExtractor: IDateTimeExtractor; + pureNumberFromToRegex: RegExp; + pureNumberBetweenAndRegex: RegExp; + timeOfDayRegex: RegExp; + tillRegex: RegExp; + numbers: ReadonlyMap; + utilityConfiguration: IDateTimeUtilityConfiguration; + specificTimeFromToRegex: RegExp; + specificTimeBetweenAndRegex: RegExp; + constructor(config: ICommonDateTimeParserConfiguration); + getMatchedTimexRange(text: string): { + matched: boolean; + timex: string; + beginHour: number; + endHour: number; + endMin: number; + }; +} diff --git a/libraries/botbuilder-stdlib/vendors/@microsoft/recognizers-text-date-time/dist/types/dateTime/french/baseConfiguration.d.ts b/libraries/botbuilder-stdlib/vendors/@microsoft/recognizers-text-date-time/dist/types/dateTime/french/baseConfiguration.d.ts new file mode 100644 index 0000000000..eb8777f7b2 --- /dev/null +++ b/libraries/botbuilder-stdlib/vendors/@microsoft/recognizers-text-date-time/dist/types/dateTime/french/baseConfiguration.d.ts @@ -0,0 +1,15 @@ +import { IDateTimeUtilityConfiguration } from "../utilities"; +import { BaseDateParserConfiguration } from "../parsers"; +export declare class FrenchDateTimeUtilityConfiguration implements IDateTimeUtilityConfiguration { + readonly agoRegex: RegExp; + readonly laterRegex: RegExp; + readonly inConnectorRegex: RegExp; + readonly rangeUnitRegex: RegExp; + readonly amDescRegex: RegExp; + readonly pmDescRegex: RegExp; + readonly amPmDescRegex: RegExp; + constructor(); +} +export declare class FrenchCommonDateTimeParserConfiguration extends BaseDateParserConfiguration { + constructor(); +} diff --git a/libraries/botbuilder-stdlib/vendors/@microsoft/recognizers-text-date-time/dist/types/dateTime/french/dateConfiguration.d.ts b/libraries/botbuilder-stdlib/vendors/@microsoft/recognizers-text-date-time/dist/types/dateTime/french/dateConfiguration.d.ts new file mode 100644 index 0000000000..258a304963 --- /dev/null +++ b/libraries/botbuilder-stdlib/vendors/@microsoft/recognizers-text-date-time/dist/types/dateTime/french/dateConfiguration.d.ts @@ -0,0 +1,60 @@ +import { BaseNumberExtractor, BaseNumberParser } from "botbuilder-stdlib/vendors/@microsoft/recognizers-text-number"; +import { IDateExtractorConfiguration, IDateParserConfiguration } from "../baseDate"; +import { BaseDurationParser } from "../baseDuration"; +import { IDateTimeUtilityConfiguration } from "../utilities"; +import { FrenchCommonDateTimeParserConfiguration } from "./baseConfiguration"; +import { IDateTimeExtractor } from "../baseDateTime"; +export declare class FrenchDateExtractorConfiguration implements IDateExtractorConfiguration { + readonly dateRegexList: RegExp[]; + readonly implicitDateList: RegExp[]; + readonly monthEnd: RegExp; + readonly ofMonth: RegExp; + readonly dateUnitRegex: RegExp; + readonly forTheRegex: RegExp; + readonly weekDayAndDayOfMonthRegex: RegExp; + readonly relativeMonthRegex: RegExp; + readonly weekDayRegex: RegExp; + readonly dayOfWeek: ReadonlyMap; + readonly nonDateUnitRegex: RegExp; + readonly ordinalExtractor: BaseNumberExtractor; + readonly integerExtractor: BaseNumberExtractor; + readonly numberParser: BaseNumberParser; + readonly durationExtractor: IDateTimeExtractor; + readonly utilityConfiguration: IDateTimeUtilityConfiguration; + constructor(); +} +export declare class FrenchDateParserConfiguration implements IDateParserConfiguration { + readonly ordinalExtractor: BaseNumberExtractor; + readonly integerExtractor: BaseNumberExtractor; + readonly cardinalExtractor: BaseNumberExtractor; + readonly durationExtractor: IDateTimeExtractor; + readonly durationParser: BaseDurationParser; + readonly numberParser: BaseNumberParser; + readonly monthOfYear: ReadonlyMap; + readonly dayOfMonth: ReadonlyMap; + readonly dayOfWeek: ReadonlyMap; + readonly unitMap: ReadonlyMap; + readonly cardinalMap: ReadonlyMap; + readonly dateRegex: RegExp[]; + readonly onRegex: RegExp; + readonly specialDayRegex: RegExp; + readonly specialDayWithNumRegex: RegExp; + readonly nextRegex: RegExp; + readonly unitRegex: RegExp; + readonly strictWeekDay: RegExp; + readonly monthRegex: RegExp; + readonly weekDayRegex: RegExp; + readonly lastRegex: RegExp; + readonly thisRegex: RegExp; + readonly weekDayOfMonthRegex: RegExp; + readonly forTheRegex: RegExp; + readonly weekDayAndDayOfMonthRegex: RegExp; + readonly relativeMonthRegex: RegExp; + readonly relativeWeekDayRegex: RegExp; + readonly utilityConfiguration: IDateTimeUtilityConfiguration; + readonly dateTokenPrefix: string; + constructor(config: FrenchCommonDateTimeParserConfiguration); + getSwiftDay(source: string): number; + getSwiftMonth(source: string): number; + isCardinalLast(source: string): boolean; +} diff --git a/libraries/botbuilder-stdlib/vendors/@microsoft/recognizers-text-date-time/dist/types/dateTime/french/datePeriodConfiguration.d.ts b/libraries/botbuilder-stdlib/vendors/@microsoft/recognizers-text-date-time/dist/types/dateTime/french/datePeriodConfiguration.d.ts new file mode 100644 index 0000000000..641518b28d --- /dev/null +++ b/libraries/botbuilder-stdlib/vendors/@microsoft/recognizers-text-date-time/dist/types/dateTime/french/datePeriodConfiguration.d.ts @@ -0,0 +1,92 @@ +import { IExtractor, IParser } from "botbuilder-stdlib/vendors/@microsoft/recognizers-text"; +import { BaseNumberParser, BaseNumberExtractor } from "botbuilder-stdlib/vendors/@microsoft/recognizers-text-number"; +import { IDatePeriodExtractorConfiguration, IDatePeriodParserConfiguration } from "../baseDatePeriod"; +import { BaseDateParser } from "../baseDate"; +import { BaseDurationParser } from "../baseDuration"; +import { ICommonDateTimeParserConfiguration } from "../parsers"; +import { IDateTimeExtractor } from "../baseDateTime"; +export declare class FrenchDatePeriodExtractorConfiguration implements IDatePeriodExtractorConfiguration { + readonly simpleCasesRegexes: RegExp[]; + readonly illegalYearRegex: RegExp; + readonly YearRegex: RegExp; + readonly tillRegex: RegExp; + readonly followedUnit: RegExp; + readonly numberCombinedWithUnit: RegExp; + readonly pastRegex: RegExp; + readonly futureRegex: RegExp; + readonly weekOfRegex: RegExp; + readonly monthOfRegex: RegExp; + readonly dateUnitRegex: RegExp; + readonly inConnectorRegex: RegExp; + readonly rangeUnitRegex: RegExp; + readonly datePointExtractor: IDateTimeExtractor; + readonly integerExtractor: BaseNumberExtractor; + readonly numberParser: BaseNumberParser; + readonly durationExtractor: IDateTimeExtractor; + readonly fromRegex: RegExp; + readonly connectorAndRegex: RegExp; + readonly beforeRegex: RegExp; + readonly weekDayOfMonthRegex: RegExp; + constructor(); + getFromTokenIndex(source: string): { + matched: boolean; + index: number; + }; + getBetweenTokenIndex(source: string): { + matched: boolean; + index: number; + }; + hasConnectorToken(source: string): boolean; +} +export declare class FrenchDatePeriodParserConfiguration implements IDatePeriodParserConfiguration { + readonly dateExtractor: IDateTimeExtractor; + readonly dateParser: BaseDateParser; + readonly durationExtractor: IDateTimeExtractor; + readonly durationParser: BaseDurationParser; + readonly monthFrontBetweenRegex: RegExp; + readonly betweenRegex: RegExp; + readonly monthFrontSimpleCasesRegex: RegExp; + readonly simpleCasesRegex: RegExp; + readonly oneWordPeriodRegex: RegExp; + readonly monthWithYear: RegExp; + readonly monthNumWithYear: RegExp; + readonly yearRegex: RegExp; + readonly pastRegex: RegExp; + readonly futureRegex: RegExp; + readonly inConnectorRegex: RegExp; + readonly weekOfMonthRegex: RegExp; + readonly weekOfYearRegex: RegExp; + readonly quarterRegex: RegExp; + readonly quarterRegexYearFront: RegExp; + readonly allHalfYearRegex: RegExp; + readonly seasonRegex: RegExp; + readonly weekOfRegex: RegExp; + readonly monthOfRegex: RegExp; + readonly whichWeekRegex: RegExp; + readonly restOfDateRegex: RegExp; + readonly tokenBeforeDate: string; + readonly dayOfMonth: ReadonlyMap; + readonly monthOfYear: ReadonlyMap; + readonly cardinalMap: ReadonlyMap; + readonly seasonMap: ReadonlyMap; + readonly unitMap: ReadonlyMap; + readonly nextPrefixRegex: RegExp; + readonly pastPrefixRegex: RegExp; + readonly thisPrefixRegex: RegExp; + readonly numberCombinedWithUnit: RegExp; + readonly laterEarlyPeriodRegex: RegExp; + readonly weekWithWeekDayRangeRegex: RegExp; + readonly cardinalExtractor: IExtractor; + readonly numberParser: IParser; + constructor(config: ICommonDateTimeParserConfiguration); + getSwiftDayOrMonth(source: string): number; + getSwiftYear(source: string): number; + isFuture(source: string): boolean; + isYearToDate(source: string): boolean; + isMonthToDate(source: string): boolean; + isWeekOnly(source: string): boolean; + isWeekend(source: string): boolean; + isMonthOnly(source: string): boolean; + isYearOnly(source: string): boolean; + isLastCardinal(source: string): boolean; +} diff --git a/libraries/botbuilder-stdlib/vendors/@microsoft/recognizers-text-date-time/dist/types/dateTime/french/dateTimeConfiguration.d.ts b/libraries/botbuilder-stdlib/vendors/@microsoft/recognizers-text-date-time/dist/types/dateTime/french/dateTimeConfiguration.d.ts new file mode 100644 index 0000000000..3a1561bb03 --- /dev/null +++ b/libraries/botbuilder-stdlib/vendors/@microsoft/recognizers-text-date-time/dist/types/dateTime/french/dateTimeConfiguration.d.ts @@ -0,0 +1,61 @@ +import { IDateTimeExtractorConfiguration, IDateTimeParserConfiguration, IDateTimeExtractor } from "../baseDateTime"; +import { BaseNumberExtractor, BaseNumberParser } from "botbuilder-stdlib/vendors/@microsoft/recognizers-text-number"; +import { BaseDateExtractor, BaseDateParser } from "../baseDate"; +import { BaseTimeExtractor, BaseTimeParser } from "../baseTime"; +import { BaseDurationExtractor, BaseDurationParser } from "../baseDuration"; +import { IDateTimeUtilityConfiguration } from "../utilities"; +import { ICommonDateTimeParserConfiguration } from "../parsers"; +export declare class FrenchDateTimeExtractorConfiguration implements IDateTimeExtractorConfiguration { + readonly datePointExtractor: BaseDateExtractor; + readonly timePointExtractor: BaseTimeExtractor; + readonly durationExtractor: BaseDurationExtractor; + readonly suffixRegex: RegExp; + readonly nowRegex: RegExp; + readonly timeOfTodayAfterRegex: RegExp; + readonly timeOfDayRegex: RegExp; + readonly specificTimeOfDayRegex: RegExp; + readonly simpleTimeOfTodayAfterRegex: RegExp; + readonly nightRegex: RegExp; + readonly timeOfTodayBeforeRegex: RegExp; + readonly simpleTimeOfTodayBeforeRegex: RegExp; + readonly theEndOfRegex: RegExp; + readonly unitRegex: RegExp; + readonly utilityConfiguration: IDateTimeUtilityConfiguration; + readonly prepositionRegex: RegExp; + readonly connectorRegex: RegExp; + constructor(); + isConnectorToken(source: string): boolean; +} +export declare class FrenchDateTimeParserConfiguration implements IDateTimeParserConfiguration { + readonly tokenBeforeDate: string; + readonly tokenBeforeTime: string; + readonly dateExtractor: IDateTimeExtractor; + readonly timeExtractor: IDateTimeExtractor; + readonly dateParser: BaseDateParser; + readonly timeParser: BaseTimeParser; + readonly cardinalExtractor: BaseNumberExtractor; + readonly numberParser: BaseNumberParser; + readonly durationExtractor: IDateTimeExtractor; + readonly durationParser: BaseDurationParser; + readonly nowRegex: RegExp; + readonly amTimeRegex: RegExp; + readonly pmTimeRegex: RegExp; + readonly simpleTimeOfTodayAfterRegex: RegExp; + readonly simpleTimeOfTodayBeforeRegex: RegExp; + readonly specificTimeOfDayRegex: RegExp; + readonly theEndOfRegex: RegExp; + readonly unitRegex: RegExp; + readonly unitMap: ReadonlyMap; + readonly numbers: ReadonlyMap; + readonly utilityConfiguration: IDateTimeUtilityConfiguration; + readonly nextPrefixRegex: RegExp; + readonly pastPrefixRegex: RegExp; + constructor(config: ICommonDateTimeParserConfiguration); + haveAmbiguousToken(text: string, matchedText: string): boolean; + getMatchedNowTimex(text: string): { + matched: boolean; + timex: string; + }; + getSwiftDay(text: string): number; + getHour(text: string, hour: number): number; +} diff --git a/libraries/botbuilder-stdlib/vendors/@microsoft/recognizers-text-date-time/dist/types/dateTime/french/dateTimePeriodConfiguration.d.ts b/libraries/botbuilder-stdlib/vendors/@microsoft/recognizers-text-date-time/dist/types/dateTime/french/dateTimePeriodConfiguration.d.ts new file mode 100644 index 0000000000..a2202835af --- /dev/null +++ b/libraries/botbuilder-stdlib/vendors/@microsoft/recognizers-text-date-time/dist/types/dateTime/french/dateTimePeriodConfiguration.d.ts @@ -0,0 +1,88 @@ +import { IExtractor, IParser } from "botbuilder-stdlib/vendors/@microsoft/recognizers-text"; +import { BaseNumberExtractor } from "botbuilder-stdlib/vendors/@microsoft/recognizers-text-number"; +import { IDateTimePeriodExtractorConfiguration, IDateTimePeriodParserConfiguration } from "../baseDateTimePeriod"; +import { BaseDateParser } from "../baseDate"; +import { BaseTimeParser } from "../baseTime"; +import { BaseDateTimeParser, IDateTimeExtractor } from "../baseDateTime"; +import { BaseDurationParser } from "../baseDuration"; +import { IDateTimeParser, ICommonDateTimeParserConfiguration } from "../parsers"; +export declare class FrenchDateTimePeriodExtractorConfiguration implements IDateTimePeriodExtractorConfiguration { + readonly cardinalExtractor: BaseNumberExtractor; + readonly singleDateExtractor: IDateTimeExtractor; + readonly singleTimeExtractor: IDateTimeExtractor; + readonly singleDateTimeExtractor: IDateTimeExtractor; + readonly durationExtractor: IDateTimeExtractor; + readonly timePeriodExtractor: IDateTimeExtractor; + readonly simpleCasesRegexes: RegExp[]; + readonly prepositionRegex: RegExp; + readonly tillRegex: RegExp; + readonly specificTimeOfDayRegex: RegExp; + readonly timeOfDayRegex: RegExp; + readonly periodTimeOfDayWithDateRegex: RegExp; + readonly followedUnit: RegExp; + readonly numberCombinedWithUnit: RegExp; + readonly timeUnitRegex: RegExp; + readonly pastPrefixRegex: RegExp; + readonly nextPrefixRegex: RegExp; + readonly relativeTimeUnitRegex: RegExp; + readonly restOfDateTimeRegex: RegExp; + readonly weekDayRegex: RegExp; + readonly generalEndingRegex: RegExp; + readonly middlePauseRegex: RegExp; + readonly fromRegex: RegExp; + readonly connectorAndRegex: RegExp; + readonly beforeRegex: RegExp; + constructor(); + getFromTokenIndex(source: string): { + matched: boolean; + index: number; + }; + getBetweenTokenIndex(source: string): { + matched: boolean; + index: number; + }; + hasConnectorToken(source: string): boolean; +} +export declare class FrenchDateTimePeriodParserConfiguration implements IDateTimePeriodParserConfiguration { + readonly pureNumberFromToRegex: RegExp; + readonly pureNumberBetweenAndRegex: RegExp; + readonly periodTimeOfDayWithDateRegex: RegExp; + readonly specificTimeOfDayRegex: RegExp; + readonly pastRegex: RegExp; + readonly futureRegex: RegExp; + readonly relativeTimeUnitRegex: RegExp; + readonly restOfDateTimeRegex: RegExp; + readonly timeOfDayRegex: RegExp; + readonly numberCombinedWithUnitRegex: RegExp; + readonly unitRegex: RegExp; + readonly nextPrefixRegex: RegExp; + readonly pastPrefixRegex: RegExp; + readonly thisPrefixRegex: RegExp; + readonly morningStartEndRegex: RegExp; + readonly afternoonStartEndRegex: RegExp; + readonly eveningStartEndRegex: RegExp; + readonly nightStartEndRegex: RegExp; + readonly numbers: ReadonlyMap; + readonly unitMap: ReadonlyMap; + readonly dateExtractor: IDateTimeExtractor; + readonly timeExtractor: IDateTimeExtractor; + readonly dateTimeExtractor: IDateTimeExtractor; + readonly timePeriodExtractor: IDateTimeExtractor; + readonly durationExtractor: IDateTimeExtractor; + readonly dateParser: BaseDateParser; + readonly timeParser: BaseTimeParser; + readonly dateTimeParser: BaseDateTimeParser; + readonly timePeriodParser: IDateTimeParser; + readonly durationParser: BaseDurationParser; + readonly cardinalExtractor: IExtractor; + readonly numberParser: IParser; + constructor(config: ICommonDateTimeParserConfiguration); + getMatchedTimeRange(source: string): { + timeStr: string; + beginHour: number; + endHour: number; + endMin: number; + success: boolean; + }; + getSwiftPrefix(source: string): number; +} diff --git a/libraries/botbuilder-stdlib/vendors/@microsoft/recognizers-text-date-time/dist/types/dateTime/french/durationConfiguration.d.ts b/libraries/botbuilder-stdlib/vendors/@microsoft/recognizers-text-date-time/dist/types/dateTime/french/durationConfiguration.d.ts new file mode 100644 index 0000000000..3895d0a2b7 --- /dev/null +++ b/libraries/botbuilder-stdlib/vendors/@microsoft/recognizers-text-date-time/dist/types/dateTime/french/durationConfiguration.d.ts @@ -0,0 +1,32 @@ +import { BaseNumberExtractor, BaseNumberParser } from "botbuilder-stdlib/vendors/@microsoft/recognizers-text-number"; +import { IDurationExtractorConfiguration, IDurationParserConfiguration } from "../baseDuration"; +import { ICommonDateTimeParserConfiguration } from "../parsers"; +export declare class FrenchDurationExtractorConfiguration implements IDurationExtractorConfiguration { + readonly allRegex: RegExp; + readonly halfRegex: RegExp; + readonly followedUnit: RegExp; + readonly numberCombinedWithUnit: RegExp; + readonly anUnitRegex: RegExp; + readonly inexactNumberUnitRegex: RegExp; + readonly suffixAndRegex: RegExp; + readonly relativeDurationUnitRegex: RegExp; + readonly moreThanRegex: RegExp; + readonly lessThanRegex: RegExp; + readonly cardinalExtractor: BaseNumberExtractor; + constructor(); +} +export declare class FrenchDurationParserConfiguration implements IDurationParserConfiguration { + readonly cardinalExtractor: BaseNumberExtractor; + readonly numberParser: BaseNumberParser; + readonly followedUnit: RegExp; + readonly suffixAndRegex: RegExp; + readonly numberCombinedWithUnit: RegExp; + readonly anUnitRegex: RegExp; + readonly allDateUnitRegex: RegExp; + readonly halfDateUnitRegex: RegExp; + readonly inexactNumberUnitRegex: RegExp; + readonly unitMap: ReadonlyMap; + readonly unitValueMap: ReadonlyMap; + readonly doubleNumbers: ReadonlyMap; + constructor(config: ICommonDateTimeParserConfiguration); +} diff --git a/libraries/botbuilder-stdlib/vendors/@microsoft/recognizers-text-date-time/dist/types/dateTime/french/holidayConfiguration.d.ts b/libraries/botbuilder-stdlib/vendors/@microsoft/recognizers-text-date-time/dist/types/dateTime/french/holidayConfiguration.d.ts new file mode 100644 index 0000000000..0767ecd052 --- /dev/null +++ b/libraries/botbuilder-stdlib/vendors/@microsoft/recognizers-text-date-time/dist/types/dateTime/french/holidayConfiguration.d.ts @@ -0,0 +1,44 @@ +import { IHolidayExtractorConfiguration, BaseHolidayParserConfiguration } from "../baseHoliday"; +export declare class FrenchHolidayExtractorConfiguration implements IHolidayExtractorConfiguration { + readonly holidayRegexes: RegExp[]; + constructor(); +} +export declare class FrenchHolidayParserConfiguration extends BaseHolidayParserConfiguration { + constructor(); + protected initHolidayFuncs(): ReadonlyMap Date>; + private static NewYear(year); + private static NewYearEve(year); + private static ChristmasDay(year); + private static ChristmasEve(year); + private static FemaleDay(year); + private static ChildrenDay(year); + private static HalloweenDay(year); + private static EasterDay(year); + private static ValentinesDay(year); + private static WhiteLoverDay(year); + private static FoolDay(year); + private static GirlsDay(year); + private static TreePlantDay(year); + private static YouthDay(year); + private static TeacherDay(year); + private static SinglesDay(year); + private static MaoBirthday(year); + private static InaugurationDay(year); + private static GroundhogDay(year); + private static StPatrickDay(year); + private static StGeorgeDay(year); + private static Mayday(year); + private static CincoDeMayoday(year); + private static BaptisteDay(year); + private static UsaIndependenceDay(year); + private static BastilleDay(year); + private static AllHallowDay(year); + private static AllSoulsday(year); + private static GuyFawkesDay(year); + private static Veteransday(year); + protected static FathersDay(year: number): Date; + protected static MothersDay(year: number): Date; + protected static LabourDay(year: number): Date; + getSwiftYear(text: string): number; + sanitizeHolidayToken(holiday: string): string; +} diff --git a/libraries/botbuilder-stdlib/vendors/@microsoft/recognizers-text-date-time/dist/types/dateTime/french/mergedConfiguration.d.ts b/libraries/botbuilder-stdlib/vendors/@microsoft/recognizers-text-date-time/dist/types/dateTime/french/mergedConfiguration.d.ts new file mode 100644 index 0000000000..b7af514736 --- /dev/null +++ b/libraries/botbuilder-stdlib/vendors/@microsoft/recognizers-text-date-time/dist/types/dateTime/french/mergedConfiguration.d.ts @@ -0,0 +1,48 @@ +import { BaseNumberExtractor } from "botbuilder-stdlib/vendors/@microsoft/recognizers-text-number"; +import { IMergedExtractorConfiguration, IMergedParserConfiguration } from "../baseMerged"; +import { BaseDateParser } from "../baseDate"; +import { BaseTimeParser } from "../baseTime"; +import { IDateTimeExtractor, BaseDateTimeParser } from "../baseDateTime"; +import { BaseDatePeriodParser } from "../baseDatePeriod"; +import { BaseTimePeriodParser } from "../baseTimePeriod"; +import { BaseDateTimePeriodParser } from "../baseDateTimePeriod"; +import { BaseHolidayParser } from "../baseHoliday"; +import { BaseDurationParser } from "../baseDuration"; +import { BaseSetParser } from "../baseSet"; +import { FrenchCommonDateTimeParserConfiguration } from "./baseConfiguration"; +export declare class FrenchMergedExtractorConfiguration implements IMergedExtractorConfiguration { + readonly dateExtractor: IDateTimeExtractor; + readonly timeExtractor: IDateTimeExtractor; + readonly dateTimeExtractor: IDateTimeExtractor; + readonly datePeriodExtractor: IDateTimeExtractor; + readonly timePeriodExtractor: IDateTimeExtractor; + readonly dateTimePeriodExtractor: IDateTimeExtractor; + readonly holidayExtractor: IDateTimeExtractor; + readonly durationExtractor: IDateTimeExtractor; + readonly setExtractor: IDateTimeExtractor; + readonly integerExtractor: BaseNumberExtractor; + readonly afterRegex: RegExp; + readonly beforeRegex: RegExp; + readonly sinceRegex: RegExp; + readonly fromToRegex: RegExp; + readonly singleAmbiguousMonthRegex: RegExp; + readonly prepositionSuffixRegex: RegExp; + readonly numberEndingPattern: RegExp; + readonly filterWordRegexList: RegExp[]; + constructor(); +} +export declare class FrenchMergedParserConfiguration extends FrenchCommonDateTimeParserConfiguration implements IMergedParserConfiguration { + readonly beforeRegex: RegExp; + readonly afterRegex: RegExp; + readonly sinceRegex: RegExp; + readonly dateParser: BaseDateParser; + readonly holidayParser: BaseHolidayParser; + readonly timeParser: BaseTimeParser; + readonly dateTimeParser: BaseDateTimeParser; + readonly datePeriodParser: BaseDatePeriodParser; + readonly timePeriodParser: BaseTimePeriodParser; + readonly dateTimePeriodParser: BaseDateTimePeriodParser; + readonly durationParser: BaseDurationParser; + readonly setParser: BaseSetParser; + constructor(); +} diff --git a/libraries/botbuilder-stdlib/vendors/@microsoft/recognizers-text-date-time/dist/types/dateTime/french/setConfiguration.d.ts b/libraries/botbuilder-stdlib/vendors/@microsoft/recognizers-text-date-time/dist/types/dateTime/french/setConfiguration.d.ts new file mode 100644 index 0000000000..a697883c23 --- /dev/null +++ b/libraries/botbuilder-stdlib/vendors/@microsoft/recognizers-text-date-time/dist/types/dateTime/french/setConfiguration.d.ts @@ -0,0 +1,59 @@ +import { ISetExtractorConfiguration, ISetParserConfiguration } from "../baseSet"; +import { BaseDurationParser } from "../baseDuration"; +import { BaseTimeParser } from "../baseTime"; +import { BaseDateParser } from "../baseDate"; +import { IDateTimeExtractor, BaseDateTimeParser } from "../baseDateTime"; +import { BaseDatePeriodParser } from "../baseDatePeriod"; +import { BaseTimePeriodParser } from "../baseTimePeriod"; +import { BaseDateTimePeriodParser } from "../baseDateTimePeriod"; +import { ICommonDateTimeParserConfiguration } from "../parsers"; +export declare class FrenchSetExtractorConfiguration implements ISetExtractorConfiguration { + readonly lastRegex: RegExp; + readonly eachPrefixRegex: RegExp; + readonly periodicRegex: RegExp; + readonly eachUnitRegex: RegExp; + readonly eachDayRegex: RegExp; + readonly beforeEachDayRegex: RegExp; + readonly setWeekDayRegex: RegExp; + readonly setEachRegex: RegExp; + readonly durationExtractor: IDateTimeExtractor; + readonly timeExtractor: IDateTimeExtractor; + readonly dateExtractor: IDateTimeExtractor; + readonly dateTimeExtractor: IDateTimeExtractor; + readonly datePeriodExtractor: IDateTimeExtractor; + readonly timePeriodExtractor: IDateTimeExtractor; + readonly dateTimePeriodExtractor: IDateTimeExtractor; + constructor(); +} +export declare class FrenchSetParserConfiguration implements ISetParserConfiguration { + readonly durationExtractor: IDateTimeExtractor; + readonly durationParser: BaseDurationParser; + readonly timeExtractor: IDateTimeExtractor; + readonly timeParser: BaseTimeParser; + readonly dateExtractor: IDateTimeExtractor; + readonly dateParser: BaseDateParser; + readonly dateTimeExtractor: IDateTimeExtractor; + readonly dateTimeParser: BaseDateTimeParser; + readonly datePeriodExtractor: IDateTimeExtractor; + readonly datePeriodParser: BaseDatePeriodParser; + readonly timePeriodExtractor: IDateTimeExtractor; + readonly timePeriodParser: BaseTimePeriodParser; + readonly dateTimePeriodExtractor: IDateTimeExtractor; + readonly dateTimePeriodParser: BaseDateTimePeriodParser; + readonly unitMap: ReadonlyMap; + readonly eachPrefixRegex: RegExp; + readonly periodicRegex: RegExp; + readonly eachUnitRegex: RegExp; + readonly eachDayRegex: RegExp; + readonly setWeekDayRegex: RegExp; + readonly setEachRegex: RegExp; + constructor(config: ICommonDateTimeParserConfiguration); + getMatchedDailyTimex(text: string): { + matched: boolean; + timex: string; + }; + getMatchedUnitTimex(text: string): { + matched: boolean; + timex: string; + }; +} diff --git a/libraries/botbuilder-stdlib/vendors/@microsoft/recognizers-text-date-time/dist/types/dateTime/french/timeConfiguration.d.ts b/libraries/botbuilder-stdlib/vendors/@microsoft/recognizers-text-date-time/dist/types/dateTime/french/timeConfiguration.d.ts new file mode 100644 index 0000000000..40249481db --- /dev/null +++ b/libraries/botbuilder-stdlib/vendors/@microsoft/recognizers-text-date-time/dist/types/dateTime/french/timeConfiguration.d.ts @@ -0,0 +1,34 @@ +import { ITimeExtractorConfiguration, ITimeParserConfiguration } from "../baseTime"; +import { ICommonDateTimeParserConfiguration } from "../parsers"; +import { IDateTimeUtilityConfiguration } from "../utilities"; +import { IDateTimeExtractor } from "../baseDateTime"; +export declare class FrenchTimeExtractorConfiguration implements ITimeExtractorConfiguration { + readonly timeRegexList: RegExp[]; + readonly atRegex: RegExp; + readonly ishRegex: RegExp; + readonly durationExtractor: IDateTimeExtractor; + constructor(); + static getTimeRegexList(): RegExp[]; +} +export declare class FrenchTimeParserConfiguration implements ITimeParserConfiguration { + readonly timeTokenPrefix: string; + readonly atRegex: RegExp; + readonly timeRegexes: RegExp[]; + readonly lessThanOneHour: RegExp; + readonly timeSuffix: RegExp; + readonly numbers: ReadonlyMap; + readonly utilityConfiguration: IDateTimeUtilityConfiguration; + constructor(config: ICommonDateTimeParserConfiguration); + adjustByPrefix(prefix: string, adjust: { + hour: number; + min: number; + hasMin: boolean; + }): void; + adjustBySuffix(suffix: string, adjust: { + hour: number; + min: number; + hasMin: boolean; + hasAm: boolean; + hasPm: boolean; + }): void; +} diff --git a/libraries/botbuilder-stdlib/vendors/@microsoft/recognizers-text-date-time/dist/types/dateTime/french/timeParser.d.ts b/libraries/botbuilder-stdlib/vendors/@microsoft/recognizers-text-date-time/dist/types/dateTime/french/timeParser.d.ts new file mode 100644 index 0000000000..369f858fc1 --- /dev/null +++ b/libraries/botbuilder-stdlib/vendors/@microsoft/recognizers-text-date-time/dist/types/dateTime/french/timeParser.d.ts @@ -0,0 +1,7 @@ +import { BaseTimeParser, ITimeParserConfiguration } from "../baseTime"; +import { DateTimeResolutionResult } from "../utilities"; +export declare class FrenchTimeParser extends BaseTimeParser { + constructor(config: ITimeParserConfiguration); + internalParse(text: string, referenceTime: Date): DateTimeResolutionResult; + parseIsh(text: string, referenceTime: Date): DateTimeResolutionResult; +} diff --git a/libraries/botbuilder-stdlib/vendors/@microsoft/recognizers-text-date-time/dist/types/dateTime/french/timePeriodConfiguration.d.ts b/libraries/botbuilder-stdlib/vendors/@microsoft/recognizers-text-date-time/dist/types/dateTime/french/timePeriodConfiguration.d.ts new file mode 100644 index 0000000000..0151ee90b8 --- /dev/null +++ b/libraries/botbuilder-stdlib/vendors/@microsoft/recognizers-text-date-time/dist/types/dateTime/french/timePeriodConfiguration.d.ts @@ -0,0 +1,50 @@ +import { IExtractor } from "botbuilder-stdlib/vendors/@microsoft/recognizers-text"; +import { ITimePeriodExtractorConfiguration, ITimePeriodParserConfiguration } from "../baseTimePeriod"; +import { BaseTimeParser } from "../baseTime"; +import { IDateTimeUtilityConfiguration } from "../utilities"; +import { FrenchDateTimeUtilityConfiguration } from "./baseConfiguration"; +import { ICommonDateTimeParserConfiguration } from "../parsers"; +import { IDateTimeExtractor } from "../baseDateTime"; +export declare class FrenchTimePeriodExtractorConfiguration implements ITimePeriodExtractorConfiguration { + readonly simpleCasesRegex: RegExp[]; + readonly tillRegex: RegExp; + readonly timeOfDayRegex: RegExp; + readonly generalEndingRegex: RegExp; + readonly singleTimeExtractor: IDateTimeExtractor; + readonly integerExtractor: IExtractor; + readonly utilityConfiguration: FrenchDateTimeUtilityConfiguration; + readonly fromRegex: RegExp; + readonly connectorAndRegex: RegExp; + readonly beforeRegex: RegExp; + constructor(); + getFromTokenIndex(text: string): { + matched: boolean; + index: number; + }; + hasConnectorToken(text: string): boolean; + getBetweenTokenIndex(text: string): { + matched: boolean; + index: number; + }; +} +export declare class FrenchTimePeriodParserConfiguration implements ITimePeriodParserConfiguration { + readonly timeExtractor: IDateTimeExtractor; + readonly timeParser: BaseTimeParser; + readonly integerExtractor: IExtractor; + readonly pureNumberFromToRegex: RegExp; + readonly pureNumberBetweenAndRegex: RegExp; + readonly timeOfDayRegex: RegExp; + readonly tillRegex: RegExp; + readonly numbers: ReadonlyMap; + readonly utilityConfiguration: IDateTimeUtilityConfiguration; + readonly specificTimeFromToRegex: RegExp; + readonly specificTimeBetweenAndRegex: RegExp; + constructor(config: ICommonDateTimeParserConfiguration); + getMatchedTimexRange(text: string): { + matched: boolean; + timex: string; + beginHour: number; + endHour: number; + endMin: number; + }; +} diff --git a/libraries/botbuilder-stdlib/vendors/@microsoft/recognizers-text-date-time/dist/types/dateTime/models.d.ts b/libraries/botbuilder-stdlib/vendors/@microsoft/recognizers-text-date-time/dist/types/dateTime/models.d.ts new file mode 100644 index 0000000000..8e2e5bb912 --- /dev/null +++ b/libraries/botbuilder-stdlib/vendors/@microsoft/recognizers-text-date-time/dist/types/dateTime/models.d.ts @@ -0,0 +1,16 @@ +import { IModel, ModelResult } from "botbuilder-stdlib/vendors/@microsoft/recognizers-text"; +import { IDateTimeParser } from "./parsers"; +import { IDateTimeExtractor } from "./baseDateTime"; +export declare class DateTimeModelResult extends ModelResult { + timexStr: string; +} +export interface IDateTimeModel extends IModel { + parse(query: string, referenceDate?: Date): ModelResult[]; +} +export declare class DateTimeModel implements IDateTimeModel { + modelTypeName: string; + protected readonly extractor: IDateTimeExtractor; + protected readonly parser: IDateTimeParser; + constructor(parser: IDateTimeParser, extractor: IDateTimeExtractor); + parse(query: string, referenceDate?: Date): ModelResult[]; +} diff --git a/libraries/botbuilder-stdlib/vendors/@microsoft/recognizers-text-date-time/dist/types/dateTime/parsers.d.ts b/libraries/botbuilder-stdlib/vendors/@microsoft/recognizers-text-date-time/dist/types/dateTime/parsers.d.ts new file mode 100644 index 0000000000..9fe9d8b0ad --- /dev/null +++ b/libraries/botbuilder-stdlib/vendors/@microsoft/recognizers-text-date-time/dist/types/dateTime/parsers.d.ts @@ -0,0 +1,77 @@ +import { IParser, ParseResult, ExtractResult } from "botbuilder-stdlib/vendors/@microsoft/recognizers-text"; +import { BaseNumberParser, BaseNumberExtractor } from "botbuilder-stdlib/vendors/@microsoft/recognizers-text-number"; +import { IDateTimeUtilityConfiguration } from "./utilities"; +import { BaseDateParser } from "./baseDate"; +import { BaseTimeParser } from "./baseTime"; +import { BaseDatePeriodParser } from "./baseDatePeriod"; +import { BaseTimePeriodParser } from "./baseTimePeriod"; +import { IDateTimeExtractor, BaseDateTimeParser } from "./baseDateTime"; +import { BaseDateTimePeriodParser } from "./baseDateTimePeriod"; +import { BaseDurationParser } from "./baseDuration"; +export declare class DateTimeParseResult extends ParseResult { + timexStr: string; +} +export interface IDateTimeParser extends IParser { + parse(extResult: ExtractResult, referenceDate?: Date): DateTimeParseResult | null; +} +export interface ICommonDateTimeParserConfiguration { + cardinalExtractor: BaseNumberExtractor; + integerExtractor: BaseNumberExtractor; + ordinalExtractor: BaseNumberExtractor; + numberParser: BaseNumberParser; + dateExtractor: IDateTimeExtractor; + timeExtractor: IDateTimeExtractor; + dateTimeExtractor: IDateTimeExtractor; + durationExtractor: IDateTimeExtractor; + datePeriodExtractor: IDateTimeExtractor; + timePeriodExtractor: IDateTimeExtractor; + dateTimePeriodExtractor: IDateTimeExtractor; + dateParser: BaseDateParser; + timeParser: BaseTimeParser; + dateTimeParser: BaseDateTimeParser; + durationParser: BaseDurationParser; + datePeriodParser: BaseDatePeriodParser; + timePeriodParser: BaseTimePeriodParser; + dateTimePeriodParser: BaseDateTimePeriodParser; + monthOfYear: ReadonlyMap; + numbers: ReadonlyMap; + unitValueMap: ReadonlyMap; + seasonMap: ReadonlyMap; + unitMap: ReadonlyMap; + cardinalMap: ReadonlyMap; + dayOfMonth: ReadonlyMap; + dayOfWeek: ReadonlyMap; + doubleNumbers: ReadonlyMap; + utilityConfiguration: IDateTimeUtilityConfiguration; +} +export declare abstract class BaseDateParserConfiguration implements ICommonDateTimeParserConfiguration { + cardinalExtractor: BaseNumberExtractor; + integerExtractor: BaseNumberExtractor; + ordinalExtractor: BaseNumberExtractor; + numberParser: BaseNumberParser; + dateExtractor: IDateTimeExtractor; + timeExtractor: IDateTimeExtractor; + dateTimeExtractor: IDateTimeExtractor; + durationExtractor: IDateTimeExtractor; + datePeriodExtractor: IDateTimeExtractor; + timePeriodExtractor: IDateTimeExtractor; + dateTimePeriodExtractor: IDateTimeExtractor; + dateParser: BaseDateParser; + timeParser: BaseTimeParser; + dateTimeParser: BaseDateTimeParser; + durationParser: BaseDurationParser; + datePeriodParser: BaseDatePeriodParser; + timePeriodParser: BaseTimePeriodParser; + dateTimePeriodParser: BaseDateTimePeriodParser; + monthOfYear: ReadonlyMap; + numbers: ReadonlyMap; + unitValueMap: ReadonlyMap; + seasonMap: ReadonlyMap; + unitMap: ReadonlyMap; + cardinalMap: ReadonlyMap; + dayOfMonth: ReadonlyMap; + dayOfWeek: ReadonlyMap; + doubleNumbers: ReadonlyMap; + utilityConfiguration: IDateTimeUtilityConfiguration; + constructor(); +} diff --git a/libraries/botbuilder-stdlib/vendors/@microsoft/recognizers-text-date-time/dist/types/dateTime/spanish/baseConfiguration.d.ts b/libraries/botbuilder-stdlib/vendors/@microsoft/recognizers-text-date-time/dist/types/dateTime/spanish/baseConfiguration.d.ts new file mode 100644 index 0000000000..56574669a2 --- /dev/null +++ b/libraries/botbuilder-stdlib/vendors/@microsoft/recognizers-text-date-time/dist/types/dateTime/spanish/baseConfiguration.d.ts @@ -0,0 +1,15 @@ +import { IDateTimeUtilityConfiguration } from "../utilities"; +import { BaseDateParserConfiguration } from "../parsers"; +export declare class SpanishDateTimeUtilityConfiguration implements IDateTimeUtilityConfiguration { + readonly agoRegex: RegExp; + readonly laterRegex: RegExp; + readonly inConnectorRegex: RegExp; + readonly rangeUnitRegex: RegExp; + readonly amDescRegex: RegExp; + readonly pmDescRegex: RegExp; + readonly amPmDescRegex: RegExp; + constructor(); +} +export declare class SpanishCommonDateTimeParserConfiguration extends BaseDateParserConfiguration { + constructor(); +} diff --git a/libraries/botbuilder-stdlib/vendors/@microsoft/recognizers-text-date-time/dist/types/dateTime/spanish/dateConfiguration.d.ts b/libraries/botbuilder-stdlib/vendors/@microsoft/recognizers-text-date-time/dist/types/dateTime/spanish/dateConfiguration.d.ts new file mode 100644 index 0000000000..2e97f04a87 --- /dev/null +++ b/libraries/botbuilder-stdlib/vendors/@microsoft/recognizers-text-date-time/dist/types/dateTime/spanish/dateConfiguration.d.ts @@ -0,0 +1,62 @@ +import { BaseNumberExtractor, BaseNumberParser } from "botbuilder-stdlib/vendors/@microsoft/recognizers-text-number"; +import { IDateExtractorConfiguration, IDateParserConfiguration } from "../baseDate"; +import { BaseDurationParser } from "../baseDuration"; +import { IDateTimeUtilityConfiguration } from "../utilities"; +import { SpanishCommonDateTimeParserConfiguration } from "./baseConfiguration"; +import { IDateTimeExtractor } from "../baseDateTime"; +export declare class SpanishDateExtractorConfiguration implements IDateExtractorConfiguration { + readonly dateRegexList: RegExp[]; + readonly implicitDateList: RegExp[]; + readonly monthEnd: RegExp; + readonly ofMonth: RegExp; + readonly dateUnitRegex: RegExp; + readonly forTheRegex: RegExp; + readonly weekDayAndDayOfMonthRegex: RegExp; + readonly relativeMonthRegex: RegExp; + readonly weekDayRegex: RegExp; + readonly dayOfWeek: ReadonlyMap; + readonly ordinalExtractor: BaseNumberExtractor; + readonly integerExtractor: BaseNumberExtractor; + readonly numberParser: BaseNumberParser; + readonly durationExtractor: IDateTimeExtractor; + readonly utilityConfiguration: IDateTimeUtilityConfiguration; + constructor(); +} +export declare class SpanishDateParserConfiguration implements IDateParserConfiguration { + readonly ordinalExtractor: BaseNumberExtractor; + readonly integerExtractor: BaseNumberExtractor; + readonly cardinalExtractor: BaseNumberExtractor; + readonly durationExtractor: IDateTimeExtractor; + readonly durationParser: BaseDurationParser; + readonly numberParser: BaseNumberParser; + readonly monthOfYear: ReadonlyMap; + readonly dayOfMonth: ReadonlyMap; + readonly dayOfWeek: ReadonlyMap; + readonly unitMap: ReadonlyMap; + readonly cardinalMap: ReadonlyMap; + readonly dateRegex: RegExp[]; + readonly onRegex: RegExp; + readonly specialDayRegex: RegExp; + readonly specialDayWithNumRegex: RegExp; + readonly nextRegex: RegExp; + readonly unitRegex: RegExp; + readonly monthRegex: RegExp; + readonly weekDayRegex: RegExp; + readonly lastRegex: RegExp; + readonly thisRegex: RegExp; + readonly weekDayOfMonthRegex: RegExp; + readonly forTheRegex: RegExp; + readonly weekDayAndDayOfMonthRegex: RegExp; + readonly relativeMonthRegex: RegExp; + readonly relativeWeekDayRegex: RegExp; + readonly utilityConfiguration: IDateTimeUtilityConfiguration; + readonly dateTokenPrefix: string; + static readonly relativeDayRegex: RegExp; + static readonly nextPrefixRegex: RegExp; + static readonly pastPrefixRegex: RegExp; + constructor(config: SpanishCommonDateTimeParserConfiguration); + getSwiftDay(source: string): number; + getSwiftMonth(source: string): number; + isCardinalLast(source: string): boolean; + private static normalize(source); +} diff --git a/libraries/botbuilder-stdlib/vendors/@microsoft/recognizers-text-date-time/dist/types/dateTime/spanish/datePeriodConfiguration.d.ts b/libraries/botbuilder-stdlib/vendors/@microsoft/recognizers-text-date-time/dist/types/dateTime/spanish/datePeriodConfiguration.d.ts new file mode 100644 index 0000000000..23407c47a7 --- /dev/null +++ b/libraries/botbuilder-stdlib/vendors/@microsoft/recognizers-text-date-time/dist/types/dateTime/spanish/datePeriodConfiguration.d.ts @@ -0,0 +1,91 @@ +import { IExtractor, IParser } from "botbuilder-stdlib/vendors/@microsoft/recognizers-text"; +import { BaseNumberParser, BaseNumberExtractor } from "botbuilder-stdlib/vendors/@microsoft/recognizers-text-number"; +import { IDatePeriodExtractorConfiguration, IDatePeriodParserConfiguration } from "../baseDatePeriod"; +import { BaseDateParser } from "../baseDate"; +import { BaseDurationParser } from "../baseDuration"; +import { ICommonDateTimeParserConfiguration } from "../parsers"; +import { IDateTimeExtractor } from "../baseDateTime"; +export declare class SpanishDatePeriodExtractorConfiguration implements IDatePeriodExtractorConfiguration { + readonly simpleCasesRegexes: RegExp[]; + readonly illegalYearRegex: RegExp; + readonly YearRegex: RegExp; + readonly tillRegex: RegExp; + readonly followedUnit: RegExp; + readonly numberCombinedWithUnit: RegExp; + readonly pastRegex: RegExp; + readonly futureRegex: RegExp; + readonly weekOfRegex: RegExp; + readonly monthOfRegex: RegExp; + readonly dateUnitRegex: RegExp; + readonly inConnectorRegex: RegExp; + readonly rangeUnitRegex: RegExp; + readonly datePointExtractor: IDateTimeExtractor; + readonly integerExtractor: BaseNumberExtractor; + readonly numberParser: BaseNumberParser; + readonly durationExtractor: IDateTimeExtractor; + readonly fromRegex: RegExp; + readonly connectorAndRegex: RegExp; + readonly betweenRegex: RegExp; + constructor(); + getFromTokenIndex(source: string): { + matched: boolean; + index: number; + }; + getBetweenTokenIndex(source: string): { + matched: boolean; + index: number; + }; + hasConnectorToken(source: string): boolean; +} +export declare class SpanishDatePeriodParserConfiguration implements IDatePeriodParserConfiguration { + readonly dateExtractor: IDateTimeExtractor; + readonly dateParser: BaseDateParser; + readonly durationExtractor: IDateTimeExtractor; + readonly durationParser: BaseDurationParser; + readonly monthFrontBetweenRegex: RegExp; + readonly betweenRegex: RegExp; + readonly monthFrontSimpleCasesRegex: RegExp; + readonly simpleCasesRegex: RegExp; + readonly oneWordPeriodRegex: RegExp; + readonly monthWithYear: RegExp; + readonly monthNumWithYear: RegExp; + readonly yearRegex: RegExp; + readonly pastRegex: RegExp; + readonly futureRegex: RegExp; + readonly inConnectorRegex: RegExp; + readonly weekOfMonthRegex: RegExp; + readonly weekOfYearRegex: RegExp; + readonly quarterRegex: RegExp; + readonly quarterRegexYearFront: RegExp; + readonly allHalfYearRegex: RegExp; + readonly seasonRegex: RegExp; + readonly weekOfRegex: RegExp; + readonly monthOfRegex: RegExp; + readonly whichWeekRegex: RegExp; + readonly restOfDateRegex: RegExp; + readonly laterEarlyPeriodRegex: RegExp; + readonly weekWithWeekDayRangeRegex: RegExp; + readonly tokenBeforeDate: string; + readonly dayOfMonth: ReadonlyMap; + readonly monthOfYear: ReadonlyMap; + readonly cardinalMap: ReadonlyMap; + readonly seasonMap: ReadonlyMap; + readonly unitMap: ReadonlyMap; + readonly nextPrefixRegex: RegExp; + readonly pastPrefixRegex: RegExp; + readonly thisPrefixRegex: RegExp; + readonly numberCombinedWithUnit: RegExp; + readonly cardinalExtractor: IExtractor; + readonly numberParser: IParser; + constructor(config: ICommonDateTimeParserConfiguration); + getSwiftDayOrMonth(source: string): number; + getSwiftYear(source: string): number; + isFuture(source: string): boolean; + isYearToDate(source: string): boolean; + isMonthToDate(source: string): boolean; + isWeekOnly(source: string): boolean; + isWeekend(source: string): boolean; + isMonthOnly(source: string): boolean; + isYearOnly(source: string): boolean; + isLastCardinal(source: string): boolean; +} diff --git a/libraries/botbuilder-stdlib/vendors/@microsoft/recognizers-text-date-time/dist/types/dateTime/spanish/dateTimeConfiguration.d.ts b/libraries/botbuilder-stdlib/vendors/@microsoft/recognizers-text-date-time/dist/types/dateTime/spanish/dateTimeConfiguration.d.ts new file mode 100644 index 0000000000..32b583a2f5 --- /dev/null +++ b/libraries/botbuilder-stdlib/vendors/@microsoft/recognizers-text-date-time/dist/types/dateTime/spanish/dateTimeConfiguration.d.ts @@ -0,0 +1,61 @@ +import { IDateTimeExtractorConfiguration, IDateTimeParserConfiguration, IDateTimeExtractor } from "../baseDateTime"; +import { BaseNumberExtractor, BaseNumberParser } from "botbuilder-stdlib/vendors/@microsoft/recognizers-text-number"; +import { BaseDateParser } from "../baseDate"; +import { BaseTimeParser } from "../baseTime"; +import { BaseDurationParser } from "../baseDuration"; +import { IDateTimeUtilityConfiguration } from "../utilities"; +import { ICommonDateTimeParserConfiguration } from "../parsers"; +export declare class SpanishDateTimeExtractorConfiguration implements IDateTimeExtractorConfiguration { + readonly datePointExtractor: IDateTimeExtractor; + readonly timePointExtractor: IDateTimeExtractor; + readonly durationExtractor: IDateTimeExtractor; + readonly suffixRegex: RegExp; + readonly nowRegex: RegExp; + readonly timeOfTodayAfterRegex: RegExp; + readonly timeOfDayRegex: RegExp; + readonly specificTimeOfDayRegex: RegExp; + readonly simpleTimeOfTodayAfterRegex: RegExp; + readonly nightRegex: RegExp; + readonly timeOfTodayBeforeRegex: RegExp; + readonly simpleTimeOfTodayBeforeRegex: RegExp; + readonly theEndOfRegex: RegExp; + readonly unitRegex: RegExp; + readonly utilityConfiguration: IDateTimeUtilityConfiguration; + readonly prepositionRegex: RegExp; + readonly connectorRegex: RegExp; + constructor(); + isConnectorToken(source: string): boolean; +} +export declare class SpanishDateTimeParserConfiguration implements IDateTimeParserConfiguration { + readonly tokenBeforeDate: string; + readonly tokenBeforeTime: string; + readonly dateExtractor: IDateTimeExtractor; + readonly timeExtractor: IDateTimeExtractor; + readonly dateParser: BaseDateParser; + readonly timeParser: BaseTimeParser; + readonly cardinalExtractor: BaseNumberExtractor; + readonly numberParser: BaseNumberParser; + readonly durationExtractor: IDateTimeExtractor; + readonly durationParser: BaseDurationParser; + readonly nowRegex: RegExp; + readonly amTimeRegex: RegExp; + readonly pmTimeRegex: RegExp; + readonly simpleTimeOfTodayAfterRegex: RegExp; + readonly simpleTimeOfTodayBeforeRegex: RegExp; + readonly specificTimeOfDayRegex: RegExp; + readonly theEndOfRegex: RegExp; + readonly unitRegex: RegExp; + readonly unitMap: ReadonlyMap; + readonly numbers: ReadonlyMap; + readonly utilityConfiguration: IDateTimeUtilityConfiguration; + readonly nextPrefixRegex: RegExp; + readonly pastPrefixRegex: RegExp; + constructor(config: ICommonDateTimeParserConfiguration); + haveAmbiguousToken(text: string, matchedText: string): boolean; + getMatchedNowTimex(text: string): { + matched: boolean; + timex: string; + }; + getSwiftDay(text: string): number; + getHour(text: string, hour: number): number; +} diff --git a/libraries/botbuilder-stdlib/vendors/@microsoft/recognizers-text-date-time/dist/types/dateTime/spanish/dateTimePeriodConfiguration.d.ts b/libraries/botbuilder-stdlib/vendors/@microsoft/recognizers-text-date-time/dist/types/dateTime/spanish/dateTimePeriodConfiguration.d.ts new file mode 100644 index 0000000000..82c2c5695d --- /dev/null +++ b/libraries/botbuilder-stdlib/vendors/@microsoft/recognizers-text-date-time/dist/types/dateTime/spanish/dateTimePeriodConfiguration.d.ts @@ -0,0 +1,84 @@ +import { IExtractor, IParser } from "botbuilder-stdlib/vendors/@microsoft/recognizers-text"; +import { BaseNumberExtractor } from "botbuilder-stdlib/vendors/@microsoft/recognizers-text-number"; +import { IDateTimePeriodExtractorConfiguration, IDateTimePeriodParserConfiguration } from "../baseDateTimePeriod"; +import { BaseDateParser } from "../baseDate"; +import { BaseTimeParser } from "../baseTime"; +import { BaseDateTimeParser, IDateTimeExtractor } from "../baseDateTime"; +import { BaseDurationParser } from "../baseDuration"; +import { IDateTimeParser, ICommonDateTimeParserConfiguration } from "../parsers"; +export declare class SpanishDateTimePeriodExtractorConfiguration implements IDateTimePeriodExtractorConfiguration { + readonly cardinalExtractor: BaseNumberExtractor; + readonly singleDateExtractor: IDateTimeExtractor; + readonly singleTimeExtractor: IDateTimeExtractor; + readonly singleDateTimeExtractor: IDateTimeExtractor; + readonly durationExtractor: IDateTimeExtractor; + readonly timePeriodExtractor: IDateTimeExtractor; + readonly simpleCasesRegexes: RegExp[]; + readonly prepositionRegex: RegExp; + readonly tillRegex: RegExp; + readonly specificTimeOfDayRegex: RegExp; + readonly timeOfDayRegex: RegExp; + readonly periodTimeOfDayWithDateRegex: RegExp; + readonly followedUnit: RegExp; + readonly numberCombinedWithUnit: RegExp; + readonly timeUnitRegex: RegExp; + readonly pastPrefixRegex: RegExp; + readonly nextPrefixRegex: RegExp; + readonly relativeTimeUnitRegex: RegExp; + readonly restOfDateTimeRegex: RegExp; + readonly weekDayRegex: RegExp; + readonly generalEndingRegex: RegExp; + readonly middlePauseRegex: RegExp; + readonly fromRegex: RegExp; + readonly connectorAndRegex: RegExp; + readonly betweenRegex: RegExp; + constructor(); + getFromTokenIndex(source: string): { + matched: boolean; + index: number; + }; + getBetweenTokenIndex(source: string): { + matched: boolean; + index: number; + }; + hasConnectorToken(source: string): boolean; +} +export declare class SpanishDateTimePeriodParserConfiguration implements IDateTimePeriodParserConfiguration { + readonly pureNumberFromToRegex: RegExp; + readonly pureNumberBetweenAndRegex: RegExp; + readonly periodTimeOfDayWithDateRegex: RegExp; + readonly specificTimeOfDayRegex: RegExp; + readonly pastRegex: RegExp; + readonly futureRegex: RegExp; + readonly relativeTimeUnitRegex: RegExp; + readonly restOfDateTimeRegex: RegExp; + readonly timeOfDayRegex: RegExp; + readonly numberCombinedWithUnitRegex: RegExp; + readonly unitRegex: RegExp; + readonly nextPrefixRegex: RegExp; + readonly pastPrefixRegex: RegExp; + readonly thisPrefixRegex: RegExp; + readonly numbers: ReadonlyMap; + readonly unitMap: ReadonlyMap; + readonly dateExtractor: IDateTimeExtractor; + readonly timeExtractor: IDateTimeExtractor; + readonly dateTimeExtractor: IDateTimeExtractor; + readonly timePeriodExtractor: IDateTimeExtractor; + readonly durationExtractor: IDateTimeExtractor; + readonly dateParser: BaseDateParser; + readonly timeParser: BaseTimeParser; + readonly dateTimeParser: BaseDateTimeParser; + readonly timePeriodParser: IDateTimeParser; + readonly durationParser: BaseDurationParser; + readonly cardinalExtractor: IExtractor; + readonly numberParser: IParser; + constructor(config: ICommonDateTimeParserConfiguration); + getMatchedTimeRange(source: string): { + timeStr: string; + beginHour: number; + endHour: number; + endMin: number; + success: boolean; + }; + getSwiftPrefix(source: string): number; +} diff --git a/libraries/botbuilder-stdlib/vendors/@microsoft/recognizers-text-date-time/dist/types/dateTime/spanish/dateTimePeriodParser.d.ts b/libraries/botbuilder-stdlib/vendors/@microsoft/recognizers-text-date-time/dist/types/dateTime/spanish/dateTimePeriodParser.d.ts new file mode 100644 index 0000000000..5921c661cb --- /dev/null +++ b/libraries/botbuilder-stdlib/vendors/@microsoft/recognizers-text-date-time/dist/types/dateTime/spanish/dateTimePeriodParser.d.ts @@ -0,0 +1,6 @@ +import { BaseDateTimePeriodParser, IDateTimePeriodParserConfiguration } from "../baseDateTimePeriod"; +import { DateTimeResolutionResult } from "../utilities"; +export declare class SpanishDateTimePeriodParser extends BaseDateTimePeriodParser { + constructor(config: IDateTimePeriodParserConfiguration); + protected parseSpecificTimeOfDay(source: string, referenceDate: Date): DateTimeResolutionResult; +} diff --git a/libraries/botbuilder-stdlib/vendors/@microsoft/recognizers-text-date-time/dist/types/dateTime/spanish/durationConfiguration.d.ts b/libraries/botbuilder-stdlib/vendors/@microsoft/recognizers-text-date-time/dist/types/dateTime/spanish/durationConfiguration.d.ts new file mode 100644 index 0000000000..6401e7af50 --- /dev/null +++ b/libraries/botbuilder-stdlib/vendors/@microsoft/recognizers-text-date-time/dist/types/dateTime/spanish/durationConfiguration.d.ts @@ -0,0 +1,32 @@ +import { BaseNumberExtractor, BaseNumberParser } from "botbuilder-stdlib/vendors/@microsoft/recognizers-text-number"; +import { IDurationExtractorConfiguration, IDurationParserConfiguration } from "../baseDuration"; +import { ICommonDateTimeParserConfiguration } from "../parsers"; +export declare class SpanishDurationExtractorConfiguration implements IDurationExtractorConfiguration { + readonly allRegex: RegExp; + readonly halfRegex: RegExp; + readonly followedUnit: RegExp; + readonly numberCombinedWithUnit: RegExp; + readonly anUnitRegex: RegExp; + readonly inexactNumberUnitRegex: RegExp; + readonly suffixAndRegex: RegExp; + readonly relativeDurationUnitRegex: RegExp; + readonly moreThanRegex: RegExp; + readonly lessThanRegex: RegExp; + readonly cardinalExtractor: BaseNumberExtractor; + constructor(); +} +export declare class SpanishDurationParserConfiguration implements IDurationParserConfiguration { + readonly cardinalExtractor: BaseNumberExtractor; + readonly numberParser: BaseNumberParser; + readonly followedUnit: RegExp; + readonly suffixAndRegex: RegExp; + readonly numberCombinedWithUnit: RegExp; + readonly anUnitRegex: RegExp; + readonly allDateUnitRegex: RegExp; + readonly halfDateUnitRegex: RegExp; + readonly inexactNumberUnitRegex: RegExp; + readonly unitMap: ReadonlyMap; + readonly unitValueMap: ReadonlyMap; + readonly doubleNumbers: ReadonlyMap; + constructor(config: ICommonDateTimeParserConfiguration); +} diff --git a/libraries/botbuilder-stdlib/vendors/@microsoft/recognizers-text-date-time/dist/types/dateTime/spanish/holidayConfiguration.d.ts b/libraries/botbuilder-stdlib/vendors/@microsoft/recognizers-text-date-time/dist/types/dateTime/spanish/holidayConfiguration.d.ts new file mode 100644 index 0000000000..b838cf7690 --- /dev/null +++ b/libraries/botbuilder-stdlib/vendors/@microsoft/recognizers-text-date-time/dist/types/dateTime/spanish/holidayConfiguration.d.ts @@ -0,0 +1,23 @@ +import { IHolidayExtractorConfiguration, BaseHolidayParserConfiguration } from "../baseHoliday"; +export declare class SpanishHolidayExtractorConfiguration implements IHolidayExtractorConfiguration { + readonly holidayRegexes: RegExp[]; + constructor(); +} +export declare class SpanishHolidayParserConfiguration extends BaseHolidayParserConfiguration { + readonly nextPrefixRegex: RegExp; + readonly pastPrefixRegex: RegExp; + readonly thisPrefixRegex: RegExp; + constructor(); + protected initHolidayFuncs(): ReadonlyMap Date>; + private static NewYear(year); + private static NewYearEve(year); + private static ChristmasDay(year); + private static ChristmasEve(year); + private static FemaleDay(year); + private static ChildrenDay(year); + private static HalloweenDay(year); + private static TeacherDay(year); + private static EasterDay(year); + getSwiftYear(text: string): number; + sanitizeHolidayToken(holiday: string): string; +} diff --git a/libraries/botbuilder-stdlib/vendors/@microsoft/recognizers-text-date-time/dist/types/dateTime/spanish/mergedConfiguration.d.ts b/libraries/botbuilder-stdlib/vendors/@microsoft/recognizers-text-date-time/dist/types/dateTime/spanish/mergedConfiguration.d.ts new file mode 100644 index 0000000000..bfe8df9d68 --- /dev/null +++ b/libraries/botbuilder-stdlib/vendors/@microsoft/recognizers-text-date-time/dist/types/dateTime/spanish/mergedConfiguration.d.ts @@ -0,0 +1,48 @@ +import { BaseNumberExtractor } from "botbuilder-stdlib/vendors/@microsoft/recognizers-text-number"; +import { IMergedExtractorConfiguration, IMergedParserConfiguration } from "../baseMerged"; +import { BaseDateParser } from "../baseDate"; +import { BaseTimeParser } from "../baseTime"; +import { BaseDateTimeParser, IDateTimeExtractor } from "../baseDateTime"; +import { BaseDatePeriodParser } from "../baseDatePeriod"; +import { BaseTimePeriodParser } from "../baseTimePeriod"; +import { BaseDateTimePeriodParser } from "../baseDateTimePeriod"; +import { BaseHolidayParser } from "../baseHoliday"; +import { BaseDurationParser } from "../baseDuration"; +import { BaseSetParser } from "../baseSet"; +import { SpanishCommonDateTimeParserConfiguration } from "./baseConfiguration"; +export declare class SpanishMergedExtractorConfiguration implements IMergedExtractorConfiguration { + readonly dateExtractor: IDateTimeExtractor; + readonly timeExtractor: IDateTimeExtractor; + readonly dateTimeExtractor: IDateTimeExtractor; + readonly datePeriodExtractor: IDateTimeExtractor; + readonly timePeriodExtractor: IDateTimeExtractor; + readonly dateTimePeriodExtractor: IDateTimeExtractor; + readonly holidayExtractor: IDateTimeExtractor; + readonly durationExtractor: IDateTimeExtractor; + readonly setExtractor: IDateTimeExtractor; + readonly integerExtractor: BaseNumberExtractor; + readonly afterRegex: RegExp; + readonly beforeRegex: RegExp; + readonly sinceRegex: RegExp; + readonly fromToRegex: RegExp; + readonly singleAmbiguousMonthRegex: RegExp; + readonly prepositionSuffixRegex: RegExp; + readonly numberEndingPattern: RegExp; + readonly filterWordRegexList: RegExp[]; + constructor(); +} +export declare class SpanishMergedParserConfiguration extends SpanishCommonDateTimeParserConfiguration implements IMergedParserConfiguration { + readonly beforeRegex: RegExp; + readonly afterRegex: RegExp; + readonly sinceRegex: RegExp; + readonly dateParser: BaseDateParser; + readonly holidayParser: BaseHolidayParser; + readonly timeParser: BaseTimeParser; + readonly dateTimeParser: BaseDateTimeParser; + readonly datePeriodParser: BaseDatePeriodParser; + readonly timePeriodParser: BaseTimePeriodParser; + readonly dateTimePeriodParser: BaseDateTimePeriodParser; + readonly durationParser: BaseDurationParser; + readonly setParser: BaseSetParser; + constructor(); +} diff --git a/libraries/botbuilder-stdlib/vendors/@microsoft/recognizers-text-date-time/dist/types/dateTime/spanish/setConfiguration.d.ts b/libraries/botbuilder-stdlib/vendors/@microsoft/recognizers-text-date-time/dist/types/dateTime/spanish/setConfiguration.d.ts new file mode 100644 index 0000000000..4dcea7c256 --- /dev/null +++ b/libraries/botbuilder-stdlib/vendors/@microsoft/recognizers-text-date-time/dist/types/dateTime/spanish/setConfiguration.d.ts @@ -0,0 +1,59 @@ +import { ISetExtractorConfiguration, ISetParserConfiguration } from "../baseSet"; +import { BaseDurationParser } from "../baseDuration"; +import { BaseTimeParser } from "../baseTime"; +import { BaseDateParser } from "../baseDate"; +import { BaseDateTimeParser, IDateTimeExtractor } from "../baseDateTime"; +import { BaseDatePeriodParser } from "../baseDatePeriod"; +import { BaseTimePeriodParser } from "../baseTimePeriod"; +import { BaseDateTimePeriodParser } from "../baseDateTimePeriod"; +import { ICommonDateTimeParserConfiguration } from "../parsers"; +export declare class SpanishSetExtractorConfiguration implements ISetExtractorConfiguration { + readonly lastRegex: RegExp; + readonly eachPrefixRegex: RegExp; + readonly periodicRegex: RegExp; + readonly eachUnitRegex: RegExp; + readonly eachDayRegex: RegExp; + readonly beforeEachDayRegex: RegExp; + readonly setWeekDayRegex: RegExp; + readonly setEachRegex: RegExp; + readonly durationExtractor: IDateTimeExtractor; + readonly timeExtractor: IDateTimeExtractor; + readonly dateExtractor: IDateTimeExtractor; + readonly dateTimeExtractor: IDateTimeExtractor; + readonly datePeriodExtractor: IDateTimeExtractor; + readonly timePeriodExtractor: IDateTimeExtractor; + readonly dateTimePeriodExtractor: IDateTimeExtractor; + constructor(); +} +export declare class SpanishSetParserConfiguration implements ISetParserConfiguration { + readonly durationExtractor: IDateTimeExtractor; + readonly durationParser: BaseDurationParser; + readonly timeExtractor: IDateTimeExtractor; + readonly timeParser: BaseTimeParser; + readonly dateExtractor: IDateTimeExtractor; + readonly dateParser: BaseDateParser; + readonly dateTimeExtractor: IDateTimeExtractor; + readonly dateTimeParser: BaseDateTimeParser; + readonly datePeriodExtractor: IDateTimeExtractor; + readonly datePeriodParser: BaseDatePeriodParser; + readonly timePeriodExtractor: IDateTimeExtractor; + readonly timePeriodParser: BaseTimePeriodParser; + readonly dateTimePeriodExtractor: IDateTimeExtractor; + readonly dateTimePeriodParser: BaseDateTimePeriodParser; + readonly unitMap: ReadonlyMap; + readonly eachPrefixRegex: RegExp; + readonly periodicRegex: RegExp; + readonly eachUnitRegex: RegExp; + readonly eachDayRegex: RegExp; + readonly setWeekDayRegex: RegExp; + readonly setEachRegex: RegExp; + constructor(config: ICommonDateTimeParserConfiguration); + getMatchedDailyTimex(text: string): { + matched: boolean; + timex: string; + }; + getMatchedUnitTimex(text: string): { + matched: boolean; + timex: string; + }; +} diff --git a/libraries/botbuilder-stdlib/vendors/@microsoft/recognizers-text-date-time/dist/types/dateTime/spanish/timeConfiguration.d.ts b/libraries/botbuilder-stdlib/vendors/@microsoft/recognizers-text-date-time/dist/types/dateTime/spanish/timeConfiguration.d.ts new file mode 100644 index 0000000000..de3de36e3e --- /dev/null +++ b/libraries/botbuilder-stdlib/vendors/@microsoft/recognizers-text-date-time/dist/types/dateTime/spanish/timeConfiguration.d.ts @@ -0,0 +1,34 @@ +import { ITimeExtractorConfiguration, ITimeParserConfiguration } from "../baseTime"; +import { ICommonDateTimeParserConfiguration } from "../parsers"; +import { IDateTimeUtilityConfiguration } from "../utilities"; +import { IDateTimeExtractor } from "../baseDateTime"; +export declare class SpanishTimeExtractorConfiguration implements ITimeExtractorConfiguration { + readonly timeRegexList: RegExp[]; + readonly atRegex: RegExp; + readonly ishRegex: RegExp; + readonly durationExtractor: IDateTimeExtractor; + constructor(); + static getTimeRegexList(): RegExp[]; +} +export declare class SpanishTimeParserConfiguration implements ITimeParserConfiguration { + readonly timeTokenPrefix: string; + readonly atRegex: RegExp; + readonly timeRegexes: RegExp[]; + readonly lessThanOneHour: RegExp; + readonly timeSuffix: RegExp; + readonly numbers: ReadonlyMap; + readonly utilityConfiguration: IDateTimeUtilityConfiguration; + constructor(config: ICommonDateTimeParserConfiguration); + adjustByPrefix(prefix: string, adjust: { + hour: number; + min: number; + hasMin: boolean; + }): void; + adjustBySuffix(suffix: string, adjust: { + hour: number; + min: number; + hasMin: boolean; + hasAm: boolean; + hasPm: boolean; + }): void; +} diff --git a/libraries/botbuilder-stdlib/vendors/@microsoft/recognizers-text-date-time/dist/types/dateTime/spanish/timePeriodConfiguration.d.ts b/libraries/botbuilder-stdlib/vendors/@microsoft/recognizers-text-date-time/dist/types/dateTime/spanish/timePeriodConfiguration.d.ts new file mode 100644 index 0000000000..55fe3bf6d1 --- /dev/null +++ b/libraries/botbuilder-stdlib/vendors/@microsoft/recognizers-text-date-time/dist/types/dateTime/spanish/timePeriodConfiguration.d.ts @@ -0,0 +1,50 @@ +import { IExtractor } from "botbuilder-stdlib/vendors/@microsoft/recognizers-text"; +import { ITimePeriodExtractorConfiguration, ITimePeriodParserConfiguration } from "../baseTimePeriod"; +import { BaseTimeParser } from "../baseTime"; +import { IDateTimeUtilityConfiguration } from "../utilities"; +import { SpanishDateTimeUtilityConfiguration } from "./baseConfiguration"; +import { ICommonDateTimeParserConfiguration } from "../parsers"; +import { IDateTimeExtractor } from "../baseDateTime"; +export declare class SpanishTimePeriodExtractorConfiguration implements ITimePeriodExtractorConfiguration { + readonly simpleCasesRegex: RegExp[]; + readonly tillRegex: RegExp; + readonly timeOfDayRegex: RegExp; + readonly generalEndingRegex: RegExp; + readonly singleTimeExtractor: IDateTimeExtractor; + readonly integerExtractor: IExtractor; + readonly utilityConfiguration: SpanishDateTimeUtilityConfiguration; + readonly fromRegex: RegExp; + readonly connectorAndRegex: RegExp; + readonly betweenRegex: RegExp; + constructor(); + getFromTokenIndex(text: string): { + matched: boolean; + index: number; + }; + hasConnectorToken(text: string): boolean; + getBetweenTokenIndex(text: string): { + matched: boolean; + index: number; + }; +} +export declare class SpanishTimePeriodParserConfiguration implements ITimePeriodParserConfiguration { + readonly timeExtractor: IDateTimeExtractor; + readonly timeParser: BaseTimeParser; + readonly integerExtractor: IExtractor; + readonly pureNumberFromToRegex: RegExp; + readonly pureNumberBetweenAndRegex: RegExp; + readonly timeOfDayRegex: RegExp; + readonly tillRegex: RegExp; + readonly numbers: ReadonlyMap; + readonly utilityConfiguration: IDateTimeUtilityConfiguration; + readonly specificTimeFromToRegex: RegExp; + readonly specificTimeBetweenAndRegex: RegExp; + constructor(config: ICommonDateTimeParserConfiguration); + getMatchedTimexRange(text: string): { + matched: boolean; + timex: string; + beginHour: number; + endHour: number; + endMin: number; + }; +} diff --git a/libraries/botbuilder-stdlib/vendors/@microsoft/recognizers-text-date-time/dist/types/dateTime/utilities.d.ts b/libraries/botbuilder-stdlib/vendors/@microsoft/recognizers-text-date-time/dist/types/dateTime/utilities.d.ts new file mode 100644 index 0000000000..3e8c60ade9 --- /dev/null +++ b/libraries/botbuilder-stdlib/vendors/@microsoft/recognizers-text-date-time/dist/types/dateTime/utilities.d.ts @@ -0,0 +1,115 @@ +import { ExtractResult } from "botbuilder-stdlib/vendors/@microsoft/recognizers-text"; +import { IDateTimeParser, DateTimeParseResult } from "../dateTime/parsers"; +import { IDateTimeExtractor } from "./baseDateTime"; +export declare class Token { + constructor(start: number, end: number); + start: number; + end: number; + readonly length: number; + static mergeAllTokens(tokens: Token[], source: string, extractorName: string): Array; +} +export interface IDateTimeUtilityConfiguration { + agoRegex: RegExp; + laterRegex: RegExp; + inConnectorRegex: RegExp; + rangeUnitRegex: RegExp; + amDescRegex: RegExp; + pmDescRegex: RegExp; + amPmDescRegex: RegExp; +} +export declare enum AgoLaterMode { + Date = 0, + DateTime = 1, +} +export declare class AgoLaterUtil { + static extractorDurationWithBeforeAndAfter(source: string, er: ExtractResult, ret: Token[], config: IDateTimeUtilityConfiguration): Array; + static parseDurationWithAgoAndLater(source: string, referenceDate: Date, durationExtractor: IDateTimeExtractor, durationParser: IDateTimeParser, unitMap: ReadonlyMap, unitRegex: RegExp, utilityConfiguration: IDateTimeUtilityConfiguration, mode: AgoLaterMode): DateTimeResolutionResult; + static getAgoLaterResult(durationParseResult: DateTimeParseResult, num: number, unitMap: ReadonlyMap, srcUnit: string, afterStr: string, beforeStr: string, referenceDate: Date, utilityConfiguration: IDateTimeUtilityConfiguration, mode: AgoLaterMode): DateTimeResolutionResult; + static getDateResult(unitStr: string, num: number, referenceDate: Date, isFuture: boolean, mode: AgoLaterMode): DateTimeResolutionResult; +} +export interface MatchedIndex { + matched: boolean; + index: number; +} +export declare class MatchingUtil { + static getAgoLaterIndex(source: string, regex: RegExp): MatchedIndex; + static getInIndex(source: string, regex: RegExp): MatchedIndex; + static containsAgoLaterIndex(source: string, regex: RegExp): boolean; + static containsInIndex(source: string, regex: RegExp): boolean; +} +export declare class FormatUtil { + static readonly HourTimexRegex: RegExp; + static toString(num: number, size: number): string; + static luisDate(year: number, month: number, day: number): string; + static luisDateFromDate(date: Date): string; + static luisTime(hour: number, min: number, second: number): string; + static luisTimeFromDate(time: Date): string; + static luisDateTime(time: Date): string; + static formatDate(date: Date): string; + static formatTime(time: Date): string; + static formatDateTime(datetime: Date): string; + static shortTime(hour: number, minute: number, second: number): string; + static luisTimeSpan(from: Date, to: Date): string; + static allStringToPm(timeStr: string): string; + static toPm(timeStr: string): string; +} +export declare class StringMap { + [key: string]: string; +} +export declare class DateTimeResolutionResult { + success: boolean; + timex: string; + isLunar: boolean; + mod: string; + comment: string; + futureResolution: StringMap; + pastResolution: StringMap; + futureValue: any; + pastValue: any; + subDateTimeEntities: Array; + constructor(); +} +export declare enum DayOfWeek { + Sunday = 0, + Monday = 1, + Tuesday = 2, + Wednesday = 3, + Thursday = 4, + Friday = 5, + Saturday = 6, +} +export declare class DateUtils { + private static readonly oneDay; + private static readonly oneHour; + private static readonly oneMinute; + private static readonly oneSecond; + static next(from: Date, dayOfWeek: DayOfWeek): Date; + static this(from: Date, dayOfWeek: DayOfWeek): Date; + static last(from: Date, dayOfWeek: DayOfWeek): Date; + static diffDays(from: Date, to: Date): number; + static totalHours(from: Date, to: Date): number; + static totalHoursFloor(from: Date, to: Date): number; + static totalMinutesFloor(from: Date, to: Date): number; + static totalSeconds(from: Date, to: Date): number; + static addTime(seedDate: Date, timeToAdd: Date): Date; + static addSeconds(seedDate: Date, secondsToAdd: number): Date; + static addMinutes(seedDate: Date, minutesToAdd: number): Date; + static addHours(seedDate: Date, hoursToAdd: number): Date; + static addDays(seedDate: Date, daysToAdd: number): Date; + static addMonths(seedDate: Date, monthsToAdd: number): Date; + static addYears(seedDate: Date, yearsToAdd: number): Date; + static getWeekNumber(referenceDate: Date): { + weekNo: number; + year: number; + }; + static minValue(): Date; + static safeCreateFromValue(seedDate: Date, year: number, month: number, day: number, hour?: number, minute?: number, second?: number): Date; + static safeCreateFromMinValue(year: number, month: number, day: number, hour?: number, minute?: number, second?: number): Date; + static safeCreateDateResolveOverflow(year: number, month: number, day: number): Date; + static safeCreateFromMinValueWithDateAndTime(date: Date, time?: Date): Date; + static isLeapYear(year: number): boolean; + static dayOfYear(date: Date): number; + private static validDays(year); + private static isValidDate(year, month, day); + private static isValidTime(hour, minute, second); +} diff --git a/libraries/botbuilder-stdlib/vendors/@microsoft/recognizers-text-date-time/dist/types/recognizers-text-date-time.d.ts b/libraries/botbuilder-stdlib/vendors/@microsoft/recognizers-text-date-time/dist/types/recognizers-text-date-time.d.ts new file mode 100644 index 0000000000..8f094bead0 --- /dev/null +++ b/libraries/botbuilder-stdlib/vendors/@microsoft/recognizers-text-date-time/dist/types/recognizers-text-date-time.d.ts @@ -0,0 +1,67 @@ +export { default as DateTimeRecognizer, DateTimeOptions, recognizeDateTime } from "./dateTime/dateTimeRecognizer"; +export { Culture, CultureInfo } from "botbuilder-stdlib/vendors/@microsoft/recognizers-text-number"; +export { IDateExtractorConfiguration, IDateParserConfiguration, BaseDateExtractor, BaseDateParser } from "./dateTime/baseDate"; +export { ITimeExtractorConfiguration, ITimeParserConfiguration, BaseTimeExtractor, BaseTimeParser } from "./dateTime/baseTime"; +export { IDatePeriodExtractorConfiguration, IDatePeriodParserConfiguration, BaseDatePeriodExtractor, BaseDatePeriodParser } from "./dateTime/baseDatePeriod"; +export { ITimePeriodExtractorConfiguration, ITimePeriodParserConfiguration, BaseTimePeriodExtractor, BaseTimePeriodParser } from "./dateTime/baseTimePeriod"; +export { IDateTimeExtractor, IDateTimeExtractorConfiguration, IDateTimeParserConfiguration, BaseDateTimeExtractor, BaseDateTimeParser } from "./dateTime/baseDateTime"; +export { IDateTimePeriodExtractorConfiguration, IDateTimePeriodParserConfiguration, BaseDateTimePeriodExtractor, BaseDateTimePeriodParser } from "./dateTime/baseDateTimePeriod"; +export { IDurationExtractorConfiguration, IDurationParserConfiguration, BaseDurationExtractor, BaseDurationParser } from "./dateTime/baseDuration"; +export { ISetExtractorConfiguration, ISetParserConfiguration, BaseSetExtractor, BaseSetParser } from "./dateTime/baseSet"; +export { IHolidayExtractorConfiguration, IHolidayParserConfiguration, BaseHolidayExtractor, BaseHolidayParser, BaseHolidayParserConfiguration } from "./dateTime/baseHoliday"; +export { IMergedExtractorConfiguration, IMergedParserConfiguration, BaseMergedExtractor, BaseMergedParser } from "./dateTime/baseMerged"; +export { Constants, TimeTypeConstants } from "./dateTime/constants"; +export { IDateTimeModel, DateTimeModelResult, DateTimeModel } from "./dateTime/models"; +export { DateTimeParseResult, ICommonDateTimeParserConfiguration, IDateTimeParser, BaseDateParserConfiguration } from "./dateTime/parsers"; +export { Token, IDateTimeUtilityConfiguration, AgoLaterMode, AgoLaterUtil, MatchedIndex, MatchingUtil, FormatUtil, DateTimeResolutionResult, DateUtils, DayOfWeek } from "./dateTime/utilities"; +export { EnglishCommonDateTimeParserConfiguration, EnglishDateTimeUtilityConfiguration } from "./dateTime/english/baseConfiguration"; +export { EnglishDateExtractorConfiguration, EnglishDateParserConfiguration } from "./dateTime/english/dateConfiguration"; +export { EnglishTimeExtractorConfiguration, EnglishTimeParserConfiguration } from "./dateTime/english/timeConfiguration"; +export { EnglishDatePeriodExtractorConfiguration, EnglishDatePeriodParserConfiguration } from "./dateTime/english/datePeriodConfiguration"; +export { EnglishTimePeriodExtractorConfiguration, EnglishTimePeriodParserConfiguration } from "./dateTime/english/timePeriodConfiguration"; +export { EnglishDateTimeExtractorConfiguration, EnglishDateTimeParserConfiguration } from "./dateTime/english/dateTimeConfiguration"; +export { EnglishDateTimePeriodExtractorConfiguration, EnglishDateTimePeriodParserConfiguration } from "./dateTime/english/dateTimePeriodConfiguration"; +export { EnglishSetExtractorConfiguration, EnglishSetParserConfiguration } from "./dateTime/english/setConfiguration"; +export { EnglishDurationExtractorConfiguration, EnglishDurationParserConfiguration } from "./dateTime/english/durationConfiguration"; +export { EnglishHolidayExtractorConfiguration, EnglishHolidayParserConfiguration } from "./dateTime/english/holidayConfiguration"; +export { EnglishMergedExtractorConfiguration, EnglishMergedParserConfiguration } from "./dateTime/english/mergedConfiguration"; +export { EnglishTimeParser } from "./dateTime/english/parsers"; +export { SpanishCommonDateTimeParserConfiguration, SpanishDateTimeUtilityConfiguration } from "./dateTime/spanish/baseConfiguration"; +export { SpanishDateExtractorConfiguration, SpanishDateParserConfiguration } from "./dateTime/spanish/dateConfiguration"; +export { SpanishTimeExtractorConfiguration, SpanishTimeParserConfiguration } from "./dateTime/spanish/timeConfiguration"; +export { SpanishDatePeriodExtractorConfiguration, SpanishDatePeriodParserConfiguration } from "./dateTime/spanish/datePeriodConfiguration"; +export { SpanishTimePeriodExtractorConfiguration, SpanishTimePeriodParserConfiguration } from "./dateTime/spanish/timePeriodConfiguration"; +export { SpanishDateTimeExtractorConfiguration, SpanishDateTimeParserConfiguration } from "./dateTime/spanish/dateTimeConfiguration"; +export { SpanishDateTimePeriodExtractorConfiguration, SpanishDateTimePeriodParserConfiguration } from "./dateTime/spanish/dateTimePeriodConfiguration"; +export { SpanishSetExtractorConfiguration, SpanishSetParserConfiguration } from "./dateTime/spanish/setConfiguration"; +export { SpanishDurationExtractorConfiguration, SpanishDurationParserConfiguration } from "./dateTime/spanish/durationConfiguration"; +export { SpanishHolidayExtractorConfiguration, SpanishHolidayParserConfiguration } from "./dateTime/spanish/holidayConfiguration"; +export { SpanishMergedExtractorConfiguration, SpanishMergedParserConfiguration } from "./dateTime/spanish/mergedConfiguration"; +export { SpanishDateTimePeriodParser } from "./dateTime/spanish/dateTimePeriodParser"; +export { FrenchCommonDateTimeParserConfiguration, FrenchDateTimeUtilityConfiguration } from "./dateTime/french/baseConfiguration"; +export { FrenchDateExtractorConfiguration, FrenchDateParserConfiguration } from "./dateTime/french/dateConfiguration"; +export { FrenchTimeExtractorConfiguration, FrenchTimeParserConfiguration } from "./dateTime/french/timeConfiguration"; +export { FrenchDatePeriodExtractorConfiguration, FrenchDatePeriodParserConfiguration } from "./dateTime/french/datePeriodConfiguration"; +export { FrenchTimePeriodExtractorConfiguration, FrenchTimePeriodParserConfiguration } from "./dateTime/french/timePeriodConfiguration"; +export { FrenchDateTimeExtractorConfiguration, FrenchDateTimeParserConfiguration } from "./dateTime/french/dateTimeConfiguration"; +export { FrenchDateTimePeriodExtractorConfiguration, FrenchDateTimePeriodParserConfiguration } from "./dateTime/french/dateTimePeriodConfiguration"; +export { FrenchSetExtractorConfiguration, FrenchSetParserConfiguration } from "./dateTime/french/setConfiguration"; +export { FrenchDurationExtractorConfiguration, FrenchDurationParserConfiguration } from "./dateTime/french/durationConfiguration"; +export { FrenchHolidayExtractorConfiguration, FrenchHolidayParserConfiguration } from "./dateTime/french/holidayConfiguration"; +export { FrenchMergedExtractorConfiguration, FrenchMergedParserConfiguration } from "./dateTime/french/mergedConfiguration"; +export { FrenchTimeParser } from './dateTime/french/timeParser'; +export { ChineseDurationExtractor, ChineseDurationParser } from "./dateTime/chinese/durationConfiguration"; +export { ChineseTimeExtractor, ChineseTimeParser } from "./dateTime/chinese/timeConfiguration"; +export { ChineseTimePeriodExtractor, ChineseTimePeriodParser } from "./dateTime/chinese/timePeriodConfiguration"; +export { ChineseDateExtractor, ChineseDateParser } from "./dateTime/chinese/dateConfiguration"; +export { ChineseDatePeriodExtractor, ChineseDatePeriodParser } from "./dateTime/chinese/datePeriodConfiguration"; +export { ChineseDateTimeExtractor, ChineseDateTimeParser } from "./dateTime/chinese/dateTimeConfiguration"; +export { ChineseDateTimePeriodExtractor, ChineseDateTimePeriodParser } from "./dateTime/chinese/dateTimePeriodConfiguration"; +export { ChineseSetExtractor, ChineseSetParser } from "./dateTime/chinese/setConfiguration"; +export { ChineseHolidayExtractorConfiguration, ChineseHolidayParser } from "./dateTime/chinese/holidayConfiguration"; +export { ChineseMergedExtractor, ChineseMergedParser, ChineseFullMergedParser } from "./dateTime/chinese/mergedConfiguration"; +export { BaseDateTime } from "./resources/baseDateTime"; +export { EnglishDateTime } from "./resources/englishDateTime"; +export { SpanishDateTime } from "./resources/spanishDateTime"; +export { FrenchDateTime } from "./resources/frenchDateTime"; +export { ChineseDateTime } from "./resources/chineseDateTime"; diff --git a/libraries/botbuilder-stdlib/vendors/@microsoft/recognizers-text-date-time/dist/types/resources/baseDateTime.d.ts b/libraries/botbuilder-stdlib/vendors/@microsoft/recognizers-text-date-time/dist/types/resources/baseDateTime.d.ts new file mode 100644 index 0000000000..767b9cc00b --- /dev/null +++ b/libraries/botbuilder-stdlib/vendors/@microsoft/recognizers-text-date-time/dist/types/resources/baseDateTime.d.ts @@ -0,0 +1,14 @@ +export declare namespace BaseDateTime { + const HourRegex = "(?00|01|02|03|04|05|06|07|08|09|0|10|11|12|13|14|15|16|17|18|19|20|21|22|23|24|1|2|3|4|5|6|7|8|9)(h)?"; + const MinuteRegex = "(?00|01|02|03|04|05|06|07|08|09|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|0|1|2|3|4|5|6|7|8|9)(?!\\d)"; + const DeltaMinuteRegex = "(?00|01|02|03|04|05|06|07|08|09|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|0|1|2|3|4|5|6|7|8|9)"; + const SecondRegex = "(?00|01|02|03|04|05|06|07|08|09|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|0|1|2|3|4|5|6|7|8|9)"; + const FourDigitYearRegex = "\\b(?((1\\d|20)\\d{2})|2100)(?!\\.0\\b)\\b"; + const IllegalYearRegex: string; + const MinYearNum = "1500"; + const MaxYearNum = "2100"; + const MaxTwoDigitYearFutureNum = "30"; + const MinTwoDigitYearPastNum = "70"; + const DayOfMonthDictionary: ReadonlyMap; + const VariableHolidaysTimexDictionary: ReadonlyMap; +} diff --git a/libraries/botbuilder-stdlib/vendors/@microsoft/recognizers-text-date-time/dist/types/resources/chineseDateTime.d.ts b/libraries/botbuilder-stdlib/vendors/@microsoft/recognizers-text-date-time/dist/types/resources/chineseDateTime.d.ts new file mode 100644 index 0000000000..d088408c56 --- /dev/null +++ b/libraries/botbuilder-stdlib/vendors/@microsoft/recognizers-text-date-time/dist/types/resources/chineseDateTime.d.ts @@ -0,0 +1,162 @@ +export declare namespace ChineseDateTime { + const MonthRegex = "(?正月|一月|二月|三月|四月|五月|六月|七月|八月|九月|十月|十一月|十二月|01月|02月|03月|04月|05月|06月|07月|08月|09月|10月|11月|12月|1月|2月|3月|4月|5月|6月|7月|8月|9月|大年)"; + const DayRegex = "(?01|02|03|04|05|06|07|08|09|10|11|12|13|14|15|16|17|18|19|20|21|22|23|24|25|26|27|28|29|30|31|1|2|3|4|5|6|7|8|9)"; + const DateDayRegexInChinese = "(?初一|三十|一日|十一日|二十一日|三十一日|二日|三日|四日|五日|六日|七日|八日|九日|十二日|十三日|十四日|十五日|十六日|十七日|十八日|十九日|二十二日|二十三日|二十四日|二十五日|二十六日|二十七日|二十八日|二十九日|一日|十一日|十日|二十一日|二十日|三十一日|三十日|二日|三日|四日|五日|六日|七日|八日|九日|十二日|十三日|十四日|十五日|十六日|十七日|十八日|十九日|二十二日|二十三日|二十四日|二十五日|二十六日|二十七日|二十八日|二十九日|十日|二十日|三十日|10日|11日|12日|13日|14日|15日|16日|17日|18日|19日|1日|20日|21日|22日|23日|24日|25日|26日|27日|28日|29日|2日|30日|31日|3日|4日|5日|6日|7日|8日|9日|一号|十一号|二十一号|三十一号|二号|三号|四号|五号|六号|七号|八号|九号|十二号|十三号|十四号|十五号|十六号|十七号|十八号|十九号|二十二号|二十三号|二十四号|二十五号|二十六号|二十七号|二十八号|二十九号|一号|十一号|十号|二十一号|二十号|三十一号|三十号|二号|三号|四号|五号|六号|七号|八号|九号|十二号|十三号|十四号|十五号|十六号|十七号|十八号|十九号|二十二号|二十三号|二十四号|二十五号|二十六号|二十七号|二十八号|二十九号|十号|二十号|三十号|10号|11号|12号|13号|14号|15号|16号|17号|18号|19号|1号|20号|21号|22号|23号|24号|25号|26号|27号|28号|29号|2号|30号|31号|3号|4号|5号|6号|7号|8号|9号)"; + const DayRegexNumInChinese = "(?一|十一|二十一|三十一|二|三|四|五|六|七|八|九|十二|十三|十四|十五|十六|十七|十八|十九|二十二|二十三|二十四|二十五|二十六|二十七|二十八|二十九|一|十一|十|二十一|二十|三十一|三十|二|三|四|五|六|七|八|九|十二|十三|十四|十五|十六|十七|十八|十九|二十二|二十三|二十四|二十五|二十六|二十七|二十八|二十九|十|二十|廿|卅)"; + const MonthNumRegex = "(?01|02|03|04|05|06|07|08|09|10|11|12|1|2|3|4|5|6|7|8|9)"; + const TwoNumYear = "50"; + const YearNumRegex = "(?((1[5-9]|20)\\d{2})|2100)"; + const YearRegex = "(?(\\d{2,4}))"; + const ZeroToNineIntegerRegexChs = "[一二三四五六七八九零壹贰叁肆伍陆柒捌玖〇两千俩倆仨]"; + const DateYearInChineseRegex: string; + const WeekDayRegex = "(?周日|周天|周一|周二|周三|周四|周五|周六|星期一|星期二|星期三|星期四|星期五|星期六|星期日|星期天|礼拜一|礼拜二|礼拜三|礼拜四|礼拜五|礼拜六|礼拜日|礼拜天|禮拜一|禮拜二|禮拜三|禮拜四|禮拜五|禮拜六|禮拜日|禮拜天|週日|週天|週一|週二|週三|週四|週五|週六)"; + const LunarRegex = "(农历|初一|正月|大年)"; + const DateThisRegex: string; + const DateLastRegex: string; + const DateNextRegex: string; + const SpecialDayRegex = "(最近|前天|后天|昨天|明天|今天|今日|明日|昨日|大后天|大前天|後天|大後天)"; + const SpecialDayWithNumRegex = "^[.]"; + const WeekDayOfMonthRegex: string; + const DateThisRe = "这个|这一个|这|这一|本|今"; + const DateLastRe = "上个|上一个|上|上一|去"; + const DateNextRe = "下个|下一个|下|下一|明"; + const SpecialDate: string; + const DateUnitRegex = "(?年|个月|周|日|天)"; + const BeforeRegex = "以前|之前|前"; + const AfterRegex = "以后|以後|之后|之後|后|後"; + const DateRegexList1: string; + const DateRegexList2: string; + const DateRegexList3: string; + const DateRegexList4: string; + const DateRegexList5: string; + const DateRegexList6: string; + const DateRegexList7: string; + const DateRegexList8: string; + const DatePeriodTillRegex = "(?到|至|--|-|—|——|~|–)"; + const DatePeriodTillSuffixRequiredRegex = "(?与|和)"; + const DatePeriodDayRegexInChinese = "(?初一|三十|一日|十一日|二十一日|三十一日|二日|三日|四日|五日|六日|七日|八日|九日|十二日|十三日|十四日|十五日|十六日|十七日|十八日|十九日|二十二日|二十三日|二十四日|二十五日|二十六日|二十七日|二十八日|二十九日|一日|十一日|十日|二十一日|二十日|三十一日|三十日|二日|三日|四日|五日|六日|七日|八日|九日|十二日|十三日|十四日|十五日|十六日|十七日|十八日|十九日|二十二日|二十三日|二十四日|二十五日|二十六日|二十七日|二十八日|二十九日|十日|二十日|三十日|10日|11日|12日|13日|14日|15日|16日|17日|18日|19日|1日|20日|21日|22日|23日|24日|25日|26日|27日|28日|29日|2日|30日|31日|3日|4日|5日|6日|7日|8日|9日|一号|十一号|二十一号|三十一号|二号|三号|四号|五号|六号|七号|八号|九号|十二号|十三号|十四号|十五号|十六号|十七号|十八号|十九号|二十二号|二十三号|二十四号|二十五号|二十六号|二十七号|二十八号|二十九号|一号|十一号|十号|二十一号|二十号|三十一号|三十号|二号|三号|四号|五号|六号|七号|八号|九号|十二号|十三号|十四号|十五号|十六号|十七号|十八号|十九号|二十二号|二十三号|二十四号|二十五号|二十六号|二十七号|二十八号|二十九号|十号|二十号|三十号|10号|11号|12号|13号|14号|15号|16号|17号|18号|19号|1号|20号|21号|22号|23号|24号|25号|26号|27号|28号|29号|2号|30号|31号|3号|4号|5号|6号|7号|8号|9号|一|十一|二十一|三十一|二|三|四|五|六|七|八|九|十二|十三|十四|十五|十六|十七|十八|十九|二十二|二十三|二十四|二十五|二十六|二十七|二十八|二十九|一|十一|十|二十一|二十|三十一|三十|二|三|四|五|六|七|八|九|十二|十三|十四|十五|十六|十七|十八|十九|二十二|二十三|二十四|二十五|二十六|二十七|二十八|二十九|十|二十|三十||廿|卅)"; + const DatePeriodThisRegex = "这个|这一个|这|这一|本"; + const DatePeriodLastRegex = "上个|上一个|上|上一"; + const DatePeriodNextRegex = "下个|下一个|下|下一"; + const RelativeMonthRegex: string; + const DatePeriodYearRegex: string; + const StrictYearRegex: string; + const YearRegexInNumber = "(?(\\d{3,4}))"; + const DatePeriodYearInChineseRegex: string; + const MonthSuffixRegex: string; + const SimpleCasesRegex: string; + const YearAndMonth: string; + const PureNumYearAndMonth: string; + const OneWordPeriodRegex: string; + const WeekOfMonthRegex: string; + const UnitRegex = "(?年|(个)?月|周|日|天)"; + const FollowedUnit: string; + const NumberCombinedWithUnit: string; + const DateRangePrepositions = "((从|在|自)\\s*)?"; + const YearToYear: string; + const YearToYearSuffixRequired: string; + const MonthToMonth: string; + const MonthToMonthSuffixRequired: string; + const PastRegex = "(?(前|上|之前|近|过去))"; + const FutureRegex = "(?(后|後|(?春|夏|秋|冬)(天|季)?"; + const SeasonWithYear: string; + const QuarterRegex: string; + const CenturyRegex = "(?\\d|1\\d|2\\d)世纪"; + const CenturyRegexInChinese = "(?一|二|三|四|五|六|七|八|九|十|十一|十二|十三|十四|十五|十六|十七|十八|十九|二十|二十一|二十二)世纪"; + const RelativeCenturyRegex: string; + const DecadeRegexInChinese = "(?十|一十|二十|三十|四十|五十|六十|七十|八十|九十)"; + const DecadeRegex: string; + const PrepositionRegex = "(?^的|在$)"; + const NowRegex = "(?现在|马上|立刻|刚刚才|刚刚|刚才)"; + const NightRegex = "(?早|晚)"; + const TimeOfTodayRegex = "(今晚|今早|今晨|明晚|明早|明晨|昨晚)(的|在)?"; + const DateTimePeriodTillRegex = "(?到|直到|--|-|—|——)"; + const DateTimePeriodPrepositionRegex = "(?^\\s*的|在\\s*$)"; + const HourRegex: string; + const HourNumRegex = "(?[零〇一二两三四五六七八九]|二十[一二三四]?|十[一二三四五六七八九]?)"; + const ZhijianRegex = "^\\s*(之间|之内|期间|中间|间)"; + const DateTimePeriodThisRegex = "这个|这一个|这|这一"; + const DateTimePeriodLastRegex = "上个|上一个|上|上一"; + const DateTimePeriodNextRegex = "下个|下一个|下|下一"; + const AmPmDescRegex = "(?(am|a\\.m\\.|a m|a\\. m\\.|a\\.m|a\\. m|a m|pm|p\\.m\\.|p m|p\\. m\\.|p\\.m|p\\. m|p m))"; + const TimeOfDayRegex = "(?凌晨|清晨|早上|早|上午|中午|下午|午后|晚上|夜里|夜晚|半夜|夜间|深夜|傍晚|晚)"; + const SpecificTimeOfDayRegex: string; + const DateTimePeriodUnitRegex = "(个)?(?(小时|分钟|秒钟|时|分|秒))"; + const DateTimePeriodFollowedUnit: string; + const DateTimePeriodNumberCombinedWithUnit: string; + const DurationYearRegex = "((\\d{3,4})|0\\d|两千)\\s*年"; + const DurationHalfSuffixRegex = "半"; + const DurationSuffixList: ReadonlyMap; + const DurationAmbiguousUnits: string[]; + const LunarHolidayRegex: string; + const HolidayRegexList1: string; + const HolidayRegexList2: string; + const SetUnitRegex = "(?年|月|周|星期|日|天|小时|时|分钟|分|秒钟|秒)"; + const SetEachUnitRegex: string; + const SetEachPrefixRegex = "(?(每)\\s*$)"; + const SetLastRegex = "(?last|this|next)"; + const SetEachDayRegex = "(每|每一)(天|日)\\s*$"; + const TimeHourNumRegex = "(00|01|02|03|04|05|06|07|08|09|0|10|11|12|13|14|15|16|17|18|19|20|21|22|23|24|1|2|3|4|5|6|7|8|9)"; + const TimeMinuteNumRegex = "(00|01|02|03|04|05|06|07|08|09|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|0|1|2|3|4|5|6|7|8|9)"; + const TimeSecondNumRegex = "(00|01|02|03|04|05|06|07|08|09|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|0|1|2|3|4|5|6|7|8|9)"; + const TimeHourChsRegex = "([零〇一二两三四五六七八九]|二十[一二三四]?|十[一二三四五六七八九]?)"; + const TimeMinuteChsRegex = "([二三四五]?十[一二三四五六七八九]?|六十|[零〇一二三四五六七八九])"; + const TimeSecondChsRegex: string; + const TimeClockDescRegex = "(点\\s*整|点\\s*钟|点|时)"; + const TimeMinuteDescRegex = "(分钟|分|)"; + const TimeSecondDescRegex = "(秒钟|秒)"; + const TimeBanHourPrefixRegex = "(第)"; + const TimeHourRegex: string; + const TimeMinuteRegex: string; + const TimeSecondRegex: string; + const TimeHalfRegex = "(?过半|半)"; + const TimeQuarterRegex = "(?[一两二三四1-4])\\s*(刻钟|刻)"; + const TimeChineseTimeRegex: string; + const TimeDigitTimeRegex: string; + const TimeDayDescRegex = "(?凌晨|清晨|早上|早|上午|中午|下午|午后|晚上|夜里|夜晚|半夜|午夜|夜间|深夜|傍晚|晚)"; + const TimeApproximateDescPreffixRegex = "(大[约概]|差不多|可能|也许|约|不超过|不多[于过]|最[多长少]|少于|[超短长多]过|几乎要|将近|差点|快要|接近|至少|起码|超出|不到)"; + const TimeApproximateDescSuffixRegex = "(之前|以前|以后|以後|之后|之後|前|后|後|左右)"; + const TimeRegexes1: string; + const TimeRegexes2: string; + const TimeRegexes3: string; + const TimePeriodTimePeriodConnectWords = "(起|至|到|–|-|—|~|~)"; + const TimePeriodLeftChsTimeRegex: string; + const TimePeriodRightChsTimeRegex: string; + const TimePeriodLeftDigitTimeRegex: string; + const TimePeriodRightDigitTimeRegex: string; + const TimePeriodShortLeftChsTimeRegex: string; + const TimePeriodShortLeftDigitTimeRegex: string; + const TimePeriodRegexes1: string; + const TimePeriodRegexes2: string; + const ParserConfigurationBefore = "(之前|以前|前)"; + const ParserConfigurationAfter = "(之后|之後|以后|以後|后|後)"; + const ParserConfigurationUntil = "(直到|直至|截至|截止(到)?)"; + const ParserConfigurationSincePrefix = "(自从|自|自打|打)"; + const ParserConfigurationSinceSuffix = "(以来|开始)"; + const ParserConfigurationLastWeekDayToken = "最后一个"; + const ParserConfigurationNextMonthToken = "下一个"; + const ParserConfigurationLastMonthToken = "上一个"; + const ParserConfigurationDatePrefix = " "; + const ParserConfigurationUnitMap: ReadonlyMap; + const ParserConfigurationUnitValueMap: ReadonlyMap; + const ParserConfigurationSeasonMap: ReadonlyMap; + const ParserConfigurationSeasonValueMap: ReadonlyMap; + const ParserConfigurationCardinalMap: ReadonlyMap; + const ParserConfigurationDayOfMonth: ReadonlyMap; + const ParserConfigurationDayOfWeek: ReadonlyMap; + const ParserConfigurationMonthOfYear: ReadonlyMap; + const DateTimeSimpleAmRegex = "(?早|晨)"; + const DateTimeSimplePmRegex = "(?晚)"; + const DateTimePeriodMORegex = "(凌晨|清晨|早上|早|上午)"; + const DateTimePeriodAFRegex = "(中午|下午|午后|傍晚)"; + const DateTimePeriodEVRegex = "(晚上|夜里|夜晚|晚)"; + const DateTimePeriodNIRegex = "(半夜|夜间|深夜)"; + const DurationUnitValueMap: ReadonlyMap; + const HolidayNoFixedTimex: ReadonlyMap; + const MergedBeforeRegex = "(前|之前)$"; + const MergedAfterRegex = "(后|後|之后|之後)$"; + const TimeNumberDictionary: ReadonlyMap; + const TimeLowBoundDesc: ReadonlyMap; + const DefaultLanguageFallback = "DMY"; +} diff --git a/libraries/botbuilder-stdlib/vendors/@microsoft/recognizers-text-date-time/dist/types/resources/englishDateTime.d.ts b/libraries/botbuilder-stdlib/vendors/@microsoft/recognizers-text-date-time/dist/types/resources/englishDateTime.d.ts new file mode 100644 index 0000000000..6859de8f0c --- /dev/null +++ b/libraries/botbuilder-stdlib/vendors/@microsoft/recognizers-text-date-time/dist/types/resources/englishDateTime.d.ts @@ -0,0 +1,247 @@ +export declare namespace EnglishDateTime { + const TillRegex = "(?\\b(to|till|til|until|thru|through)\\b|(--|-|—|——|~|–))"; + const RangeConnectorRegex = "(?\\b(and|through|to)\\b|(--|-|—|——|~|–))"; + const RelativeRegex = "\\b(?following|next|coming|upcoming|this|last|past|previous|current|the)\\b"; + const StrictRelativeRegex = "\\b(?following|next|coming|upcoming|this|last|past|previous|current)\\b"; + const NextPrefixRegex = "\\b(following|next|upcoming|coming)\\b"; + const AfterNextSuffixRegex = "\\b(after\\s+(the\\s+)?next)\\b"; + const PastPrefixRegex = "(last|past|previous)\\b"; + const ThisPrefixRegex = "(this|current)\\b"; + const CenturySuffixRegex = "(^century)\\b"; + const ReferencePrefixRegex = "(that|same)\\b"; + const FutureSuffixRegex = "\\b(in\\s+the\\s+)?(future|hence)\\b"; + const DayRegex = "(the\\s*)?(?01|02|03|04|05|06|07|08|09|10th|10|11th|11st|11|12nd|12th|12|13rd|13th|13|14th|14|15th|15|16th|16|17th|17|18th|18|19th|19|1st|1|20th|20|21st|21th|21|22nd|22th|22|23rd|23th|23|24th|24|25th|25|26th|26|27th|27|28th|28|29th|29|2nd|2|30th|30|31st|31|3rd|3|4th|4|5th|5|6th|6|7th|7|8th|8|9th|9)(?=\\b|t)"; + const ImplicitDayRegex = "(the\\s*)?(?10th|11th|11st|12nd|12th|13rd|13th|14th|15th|16th|17th|18th|19th|1st|20th|21st|21th|22nd|22th|23rd|23th|24th|25th|26th|27th|28th|29th|2nd|30th|31st|3rd|4th|5th|6th|7th|8th|9th)\\b"; + const MonthNumRegex = "(?01|02|03|04|05|06|07|08|09|10|11|12|1|2|3|4|5|6|7|8|9)\\b"; + const CenturyRegex = "\\b(?((one|two)\\s+thousand(\\s+and)?(\\s+(one|two|three|four|five|six|seven|eight|nine)\\s+hundred(\\s+and)?)?)|((twenty one|twenty two|one|two|three|four|five|six|seven|eight|nine|ten|eleven|twelve|thirteen|fourteen|fifteen|sixteen|seventeen|eighteen|nineteen|twenty)(\\s+hundred)?(\\s+and)?))\\b"; + const WrittenNumRegex = "(one|two|three|four|five|six|seven|eight|nine|ten|eleven|twelve|thirteen|fourteen|fifteen|sixteen|seventeen|eighteen|nineteen|twenty|thirty|forty|fourty|fifty|sixty|seventy|eighty|ninety)"; + const FullTextYearRegex: string; + const AmDescRegex = "(am\\b|a\\.m\\.|a m\\b|a\\. m\\.|a\\.m\\b|a\\. m\\b|a m\\b)"; + const PmDescRegex = "(pm\\b|p\\.m\\.|p\\b|p m\\b|p\\. m\\.|p\\.m\\b|p\\. m\\b|p m\\b)"; + const TwoDigitYearRegex: string; + const YearRegex: string; + const WeekDayRegex = "\\b(?Sunday|Monday|Tuesday|Wednesday|Thursday|Friday|Saturday|Mon|Tues|Tue|Wedn|Weds|Wed|Thurs|Thur|Thu|Fri|Sat|Sun)s?\\b"; + const SingleWeekDayRegex = "\\b(?Sunday|Monday|Tuesday|Wednesday|Thursday|Friday|Saturday|Mon|Tue|Tues|Wedn|Weds|Wed|Thurs|Thur|Thu|Fri|((?<=on\\s+)(Sat|Sun)))\\b"; + const RelativeMonthRegex: string; + const WrittenMonthRegex = "(((the\\s+)?month of\\s+)?(?April|Apr|August|Aug|December|Dec|February|Feb|January|Jan|July|Jul|June|Jun|March|Mar|May|November|Nov|October|Oct|September|Sept|Sep))"; + const MonthSuffixRegex: string; + const DateUnitRegex = "(?decades?|years?|months?|weeks?|(?business\\s+)?days?)\\b"; + const DateTokenPrefix = "on "; + const TimeTokenPrefix = "at "; + const TokenBeforeDate = "on "; + const TokenBeforeTime = "at "; + const SimpleCasesRegex: string; + const MonthFrontSimpleCasesRegex: string; + const MonthFrontBetweenRegex: string; + const BetweenRegex: string; + const MonthWithYear: string; + const OneWordPeriodRegex: string; + const MonthNumWithYear: string; + const WeekOfMonthRegex: string; + const WeekOfYearRegex: string; + const FollowedDateUnit: string; + const NumberCombinedWithDateUnit: string; + const QuarterTermRegex = "\\b(((?first|1st|second|2nd|third|3rd|fourth|4th)[ -]+quarter)|(Q(?[1-4])))\\b"; + const QuarterRegex: string; + const QuarterRegexYearFront: string; + const HalfYearTermRegex = "(?first|1st|second|2nd)\\s+half"; + const HalfYearFrontRegex = "(?((1[5-9]|20)\\d{2})|2100)\\s*(the\\s+)?H(?[1-2])"; + const HalfYearBackRegex: string; + const HalfYearRelativeRegex: string; + const AllHalfYearRegex: string; + const EarlyPrefixRegex = "\\b(?early|beginning of|start of|(?earlier(\\s+in)?))\\b"; + const MidPrefixRegex = "\\b(?mid-?|middle of)\\b"; + const LaterPrefixRegex = "\\b(?late|end of|(?later(\\s+in)?))\\b"; + const PrefixPeriodRegex: string; + const PrefixDayRegex = "\\b((?early)|(?mid|middle)|(?late|later))(\\s+in)?(\\s+the\\s+day)?$"; + const SeasonDescRegex = "(?spring|summer|fall|autumn|winter)"; + const SeasonRegex: string; + const WhichWeekRegex = "(week)(\\s*)(?\\d\\d|\\d|0\\d)"; + const WeekOfRegex = "(the\\s+)?(week)(\\s+of)(\\s+the)?"; + const MonthOfRegex = "(month)(\\s*)(of)"; + const MonthRegex = "(?April|Apr|August|Aug|December|Dec|February|Feb|January|Jan|July|Jul|June|Jun|March|Mar|May|November|Nov|October|Oct|September|Sept|Sep)"; + const AmbiguousMonthP0Regex = "\\b((^may i)|(i|you|he|she|we|they)\\s+may|(may\\s+((((also|not|(also not)|well)\\s+)?(be|contain|constitute|email|e-mail|take|have|result|involve|get|work|reply))|(or may not))))\\b"; + const DateYearRegex: string; + const YearSuffix: string; + const OnRegex: string; + const RelaxedOnRegex = "(?<=\\b(on|at|in)\\s+)((?10th|11th|11st|12nd|12th|13rd|13th|14th|15th|16th|17th|18th|19th|1st|20th|21st|21th|22nd|22th|23rd|23th|24th|25th|26th|27th|28th|29th|2nd|30th|31st|3rd|4th|5th|6th|7th|8th|9th)s?)\\b"; + const ThisRegex: string; + const LastDateRegex: string; + const NextDateRegex: string; + const SpecialDayRegex: string; + const SpecialDayWithNumRegex: string; + const RelativeDayRegex: string; + const SetWeekDayRegex = "\\b(?on\\s+)?(?morning|afternoon|evening|night|Sunday|Monday|Tuesday|Wednesday|Thursday|Friday|Saturday)s\\b"; + const WeekDayOfMonthRegex: string; + const RelativeWeekDayRegex: string; + const SpecialDate: string; + const DatePreposition = "\\b(on|in)"; + const DateExtractor1: string; + const DateExtractor2: string; + const DateExtractor3: string; + const DateExtractor4: string; + const DateExtractor5: string; + const DateExtractor6: string; + const DateExtractor7: string; + const DateExtractor8: string; + const DateExtractor9: string; + const DateExtractorA: string; + const OfMonth: string; + const MonthEnd: string; + const WeekDayEnd: string; + const RangeUnitRegex = "\\b(?years|year|months|month|weeks|week)\\b"; + const OclockRegex = "(?o\\s*’\\s*clock|o\\s*‘\\s*clock|o\\s*'\\s*clock|o\\s*clock)"; + const DescRegex: string; + const HourNumRegex = "\\b(?zero|one|two|three|four|five|six|seven|eight|nine|ten|eleven|twelve)\\b"; + const MinuteNumRegex = "(?one|two|three|four|five|six|seven|eight|nine|ten|eleven|twelve|thirteen|fourteen|fifteen|sixteen|seventeen|eighteen|nineteen|twenty|thirty|forty|fifty)"; + const DeltaMinuteNumRegex = "(?one|two|three|four|five|six|seven|eight|nine|ten|eleven|twelve|thirteen|fourteen|fifteen|sixteen|seventeen|eighteen|nineteen|twenty|thirty|forty|fifty)"; + const PmRegex = "(?(((at|in|around|on|for)\\s+(the\\s+)?)?(afternoon|evening|midnight|lunchtime))|((at|in|around|on|for)\\s+(the\\s+)?night))"; + const PmRegexFull = "(?((at|in|around|on|for)\\s+(the\\s+)?)?(afternoon|evening|midnight|night|lunchtime))"; + const AmRegex = "(?((at|in|around|on|for)\\s+(the\\s+)?)?(morning))"; + const LunchRegex = "\\b(lunchtime)\\b"; + const NightRegex = "\\b(midnight|night)\\b"; + const CommonDatePrefixRegex = "^[\\.]"; + const LessThanOneHour: string; + const WrittenTimeRegex: string; + const TimePrefix: string; + const TimeSuffix: string; + const TimeSuffixFull: string; + const BasicTime: string; + const MidnightRegex = "(?midnight|mid-night|mid night)"; + const MidmorningRegex = "(?midmorning|mid-morning|mid morning)"; + const MidafternoonRegex = "(?midafternoon|mid-afternoon|mid afternoon)"; + const MiddayRegex = "(?midday|mid-day|mid day|((12\\s)?noon))"; + const MidTimeRegex: string; + const AtRegex: string; + const IshRegex: string; + const TimeUnitRegex = "([^A-Za-z]{1,}|\\b)(?hours|hour|hrs|hr|h|minutes|minute|mins|min|seconds|second|secs|sec)\\b"; + const RestrictedTimeUnitRegex = "(?hour|minute)\\b"; + const FivesRegex = "(?(fifteen|twenty(\\s*five)?|thirty(\\s*five)?|forty(\\s*five)?|fourty(\\s*five)?|fifty(\\s*five)?|ten|five))\\b"; + const HourRegex: string; + const PeriodHourNumRegex = "\\b(?twenty one|twenty two|twenty three|twenty four|zero|one|two|three|four|five|six|seven|eight|nine|ten|eleven|twelve|thirteen|fourteen|fifteen|sixteen|seventeen|eighteen|nineteen|twenty)\\b"; + const ConnectNumRegex: string; + const TimeRegexWithDotConnector: string; + const TimeRegex1: string; + const TimeRegex2: string; + const TimeRegex3: string; + const TimeRegex4: string; + const TimeRegex5: string; + const TimeRegex6: string; + const TimeRegex7: string; + const TimeRegex8: string; + const TimeRegex9: string; + const TimeRegex10: string; + const TimeRegex11: string; + const FirstTimeRegexInTimeRange: string; + const PureNumFromTo: string; + const PureNumBetweenAnd: string; + const SpecificTimeFromTo: string; + const SpecificTimeBetweenAnd: string; + const PrepositionRegex = "(?^(at|on|of)(\\s+the)?$)"; + const TimeOfDayRegex = "\\b(?((((in\\s+(the)?\\s+)?((?early(\\s+|-))|(?late(\\s+|-)))?(morning|afternoon|night|evening)))|(((in\\s+(the)?\\s+)?)(daytime|business\\s+hour)))s?)\\b"; + const SpecificTimeOfDayRegex: string; + const TimeFollowedUnit: string; + const TimeNumberCombinedWithUnit: string; + const BusinessHourSplitStrings: string[]; + const NowRegex = "\\b(?(right\\s+)?now|as soon as possible|asap|recently|previously)\\b"; + const SuffixRegex = "^\\s*(in the\\s+)?(morning|afternoon|evening|night)\\b"; + const DateTimeTimeOfDayRegex = "\\b(?morning|afternoon|night|evening)\\b"; + const DateTimeSpecificTimeOfDayRegex: string; + const TimeOfTodayAfterRegex: string; + const TimeOfTodayBeforeRegex: string; + const SimpleTimeOfTodayAfterRegex: string; + const SimpleTimeOfTodayBeforeRegex: string; + const TheEndOfRegex = "(the\\s+)?end of(\\s+the)?\\s*$"; + const PeriodTimeOfDayRegex = "\\b((in\\s+(the)?\\s+)?((?early(\\s+|-))|(?late(\\s+|-)))?(?morning|afternoon|night|evening))\\b"; + const PeriodSpecificTimeOfDayRegex: string; + const PeriodTimeOfDayWithDateRegex: string; + const LessThanRegex = "\\b(less\\s+than)\\b"; + const MoreThanRegex = "\\b(more\\s+than)\\b"; + const DurationUnitRegex: string; + const SuffixAndRegex = "(?\\s*(and)\\s+((an|a)\\s+)?(?half|quarter))"; + const PeriodicRegex = "\\b(?daily|monthly|weekly|biweekly|yearly|annually|annual)\\b"; + const EachUnitRegex: string; + const EachPrefixRegex = "\\b(?(each|(every))\\s*$)"; + const SetEachRegex = "\\b(?(each|(every))\\s*)"; + const SetLastRegex = "(?following|next|upcoming|this|last|past|previous|current)"; + const EachDayRegex = "^\\s*(each|every)\\s*day\\b"; + const DurationFollowedUnit: string; + const NumberCombinedWithDurationUnit: string; + const AnUnitRegex: string; + const DuringRegex = "\\b(for|during)\\s+the\\s+(?year|month|week|day)\\b"; + const AllRegex = "\\b(?(all|full|whole)(\\s+|-)(?year|month|week|day))\\b"; + const HalfRegex = "(((a|an)\\s*)|\\b)(?half\\s+(?year|month|week|day|hour))\\b"; + const ConjunctionRegex = "\\b((and(\\s+for)?)|with)\\b"; + const HolidayRegex1: string; + const HolidayRegex2: string; + const HolidayRegex3: string; + const AMTimeRegex = "(?morning)"; + const PMTimeRegex = "\\b(?afternoon|evening|night)\\b"; + const InclusiveModPrepositions = "(?((on|in|at)\\s+or\\s+)|(\\s+or\\s+(on|in|at)))"; + const BeforeRegex: string; + const AfterRegex: string; + const SinceRegex = "(\\b(since|after\\s+or\\s+equal\\s+to|starting\\s+(from|on|with)|as\\s+early\\s+as|any\\s+time\\s+from)\\b\\s*)|(?=)"; + const AroundRegex = "(\\b(around|circa)\\s*\\b)"; + const AgoRegex = "\\b(ago|before\\s+(?yesterday|today))\\b"; + const LaterRegex = "\\b(later|from now|(from|after) (?tomorrow|tmr|today))\\b"; + const InConnectorRegex = "\\b(in)\\b"; + const WithinNextPrefixRegex: string; + const AmPmDescRegex = "(ampm)"; + const MorningStartEndRegex: string; + const AfternoonStartEndRegex: string; + const EveningStartEndRegex = "(^(evening))|((evening)$)"; + const NightStartEndRegex = "(^(overnight|tonight|night))|((overnight|tonight|night)$)"; + const InexactNumberRegex = "\\b(a few|few|some|several|(?(a\\s+)?couple(\\s+of)?))\\b"; + const InexactNumberUnitRegex: string; + const RelativeTimeUnitRegex: string; + const RelativeDurationUnitRegex: string; + const ReferenceDatePeriodRegex: string; + const ConnectorRegex = "^(-|,|for|t|around|@)$"; + const FromToRegex = "\\b(from).+(to)\\b.+"; + const SingleAmbiguousMonthRegex = "^(the\\s+)?(may|march)$"; + const SingleAmbiguousTermsRegex = "^(the\\s+)?(day|week|month|year)$"; + const UnspecificDatePeriodRegex = "^(week|weekend|month|year)$"; + const PrepositionSuffixRegex = "\\b(on|in|at|around|from|to)$"; + const FlexibleDayRegex = "(?([A-Za-z]+\\s)?[A-Za-z\\d]+)"; + const ForTheRegex: string; + const WeekDayAndDayOfMonthRegex: string; + const RestOfDateRegex = "\\bRest\\s+(of\\s+)?((the|my|this|current)\\s+)?(?week|month|year|decade)\\b"; + const RestOfDateTimeRegex = "\\bRest\\s+(of\\s+)?((the|my|this|current)\\s+)?(?day)\\b"; + const MealTimeRegex = "\\b(at\\s+)?(?lunchtime)\\b"; + const NumberEndingPattern: string; + const OneOnOneRegex = "\\b(1\\s*:\\s*1)|(one (on )?one|one\\s*-\\s*one|one\\s*:\\s*one)\\b"; + const LaterEarlyPeriodRegex: string; + const WeekWithWeekDayRangeRegex: string; + const GeneralEndingRegex = "^\\s*((\\.,)|\\.|,|!|\\?)?\\s*$"; + const MiddlePauseRegex = "\\s*(,)\\s*"; + const DurationConnectorRegex = "^\\s*(?\\s+|and|,)\\s*$"; + const PrefixArticleRegex = "\\bthe\\s+"; + const OrRegex = "\\s*((\\b|,\\s*)(or|and)\\b|,)\\s*"; + const YearPlusNumberRegex: string; + const NumberAsTimeRegex: string; + const TimeBeforeAfterRegex: string; + const DateNumberConnectorRegex = "^\\s*(?\\s+at)\\s*$"; + const DecadeRegex = "(?noughties|twenties|thirties|forties|fifties|sixties|seventies|eighties|nineties|two thousands)"; + const DecadeWithCenturyRegex: string; + const RelativeDecadeRegex: string; + const DateAfterRegex = "\\b((or|and)\\s+(above|after|later|greater)(?!\\s+than))\\b"; + const YearPeriodRegex: string; + const ComplexDatePeriodRegex: string; + const UnitMap: ReadonlyMap; + const UnitValueMap: ReadonlyMap; + const SeasonMap: ReadonlyMap; + const SeasonValueMap: ReadonlyMap; + const CardinalMap: ReadonlyMap; + const DayOfWeek: ReadonlyMap; + const MonthOfYear: ReadonlyMap; + const Numbers: ReadonlyMap; + const DayOfMonth: ReadonlyMap; + const DoubleNumbers: ReadonlyMap; + const HolidayNames: ReadonlyMap; + const WrittenDecades: ReadonlyMap; + const SpecialDecadeCases: ReadonlyMap; + const DefaultLanguageFallback = "MDY"; + const SuperfluousWordList: string[]; + const DurationDateRestrictions: string[]; + const AmbiguityFiltersDict: ReadonlyMap; +} diff --git a/libraries/botbuilder-stdlib/vendors/@microsoft/recognizers-text-date-time/dist/types/resources/frenchDateTime.d.ts b/libraries/botbuilder-stdlib/vendors/@microsoft/recognizers-text-date-time/dist/types/resources/frenchDateTime.d.ts new file mode 100644 index 0000000000..bcc7057dfe --- /dev/null +++ b/libraries/botbuilder-stdlib/vendors/@microsoft/recognizers-text-date-time/dist/types/resources/frenchDateTime.d.ts @@ -0,0 +1,228 @@ +export declare namespace FrenchDateTime { + const TillRegex = "(?au|[aà]|et|jusqu'[aà]|avant|--|-|—|——)"; + const RangeConnectorRegex = "(?et|de la|au|[aà]|et\\s*la|--|-|—|——)"; + const RelativeRegex = "(?prochain|prochaine|de|du|ce|cette|l[ae]|derni[eè]re|pr[eé]c[eé]dente|au\\s+cours+(de|du\\s*))"; + const NextSuffixRegex = "(?prochain|prochaine|prochaines|suivante)\\b"; + const PastSuffixRegex = "(?dernier|derni[eè]re|pr[eé]c[eé]dente)\\b"; + const ThisPrefixRegex = "(?ce|cette|au\\s+cours+(du|de))\\b"; + const DayRegex = "(?01|02|03|04|05|06|07|08|09|10|11|11e|12|12e|13|13e|14|14e|15|15e|16|16e|17|17e|18|18e|19|19e|1er|1|21|21e|20|20e|22|22e|23|23e|24|24e|25|25e|26|26e|27|27e|28|28e|29|29e|2|2e|30|30e|31|31e|3|3e|4|4e|5|5e|6|6e|7|7e|8|8e|9|9e)(?=\\b|t)"; + const MonthNumRegex = "(?01|02|03|04|05|06|07|08|09|10|11|12|1|2|3|4|5|6|7|8|9)\\b"; + const DescRegex = "(?h|ampm|am\\b|a\\.m\\.|a m\\b|a\\. m\\.|a\\.m\\b|a\\. m\\b|pm\\b|p\\.m\\.|p m\\b|p\\. m\\.|p\\.m\\b|p\\. m\\b|p\\b\\b)"; + const AmDescRegex = "(h|am\\b|a\\.m\\.|a m\\b|a\\. m\\.|a\\.m\\b|a\\. m\\b)"; + const PmDescRegex = "(h|pm\\b|p\\.m\\.|p\\b|p m\\b|p\\. m\\.|p\\.m\\b|p\\. m\\b)"; + const AmPmDescRegex = "(h|ampm)"; + const TwoDigitYearRegex: string; + const FullTextYearRegex = "^[\\*]"; + const YearRegex: string; + const WeekDayRegex = "(?Dimanche|Lundi|Mardi|Mercredi|Jeudi|Vendredi|Samedi|Lun|Mar|Mer|Jeu|Ven|Sam|Dim)\\b"; + const RelativeMonthRegex: string; + const WrittenMonthRegex = "(?Avril|Avr\\.|Avr|Août|D[eé]cembre|D[eé]c|D[eé]c\\.|F[eé]vrier|F[eé]v|F[eé]vr\\.|F[eé]vr|Javier|Jan|Janv\\.|Janv|Juillet|Jul|Juil|Juil\\.|Juin|Jun|Mars|Mar|Mai|Novembre|Nov|Nov\\.|Octobre|Oct|Oct\\.|Septembre|Sep|Sept|Sept\\.)"; + const MonthSuffixRegex: string; + const DateUnitRegex = "(?l'ann[eé]e|ann[eé]es|an|mois|semaines|semaine|jours|jour|journ[eé]e|journ[eé]es)\\b"; + const SimpleCasesRegex: string; + const MonthFrontSimpleCasesRegex: string; + const MonthFrontBetweenRegex: string; + const BetweenRegex: string; + const YearWordRegex = "\\b(?l'ann[ée]e)\\b"; + const MonthWithYear: string; + const OneWordPeriodRegex: string; + const MonthNumWithYear: string; + const WeekOfMonthRegex: string; + const WeekOfYearRegex: string; + const FollowedDateUnit: string; + const NumberCombinedWithDateUnit: string; + const QuarterRegex: string; + const QuarterRegexYearFront: string; + const AllHalfYearRegex = "^[.]"; + const PrefixDayRegex = "^[.]"; + const CenturySuffixRegex = "^[.]"; + const SeasonRegex: string; + const WhichWeekRegex = "(semaine)(\\s*)(?\\d\\d|\\d|0\\d)"; + const WeekOfRegex = "(semaine)(\\s*)(de)"; + const MonthOfRegex = "(mois)(\\s*)(de)"; + const MonthRegex = "(?Avril|Avr|Avr\\.|Août|Aout|D[ée]cembre|D[eé]c|Dec\\.|F[eé]vrier|F[eé]vr|Fev|F[eé]v|F[eé]v\\.|Janvier|Janv\\.|Janv|Jan|Jan\\.|Juillet|Juil|Juil\\.|Juin|Mars|Mai|Novembre|Nov|Nov\\.|Octobre|Oct|Oct\\.|Septembre|Sep|Sept|Sept\\.)"; + const OnRegex: string; + const RelaxedOnRegex = "(?<=\\b(en|le|dans|sur\\s*l[ea]|du|sur)\\s+)((?10e|11e|12e|13e|14e|15e|16e|17e|18e|19e|1er|20e|21e|22e|23e|24e|25e|26e|27e|28e|29e|2e|30e|31e|3e|4e|5e|6e|7e|8e|9e)s?)\\b"; + const ThisRegex: string; + const LastDateRegex: string; + const NextDateRegex: string; + const SpecialDayRegex = "\\b(avant[\\s|-]hier|apr[eè]s(-demain|\\s*demain)|(le\\s)?jour suivant|(le\\s+)?dernier jour|hier|lendemain|demain|de la journ[ée]e|aujourd'hui)\\b"; + const SpecialDayWithNumRegex = "^[.]"; + const StrictWeekDay = "\\b(?Dimanche|Lundi|Mardi|Mercredi|Jeudi|Vendredi|Samedi|Lun|Mar|Mer|Jeu|Ven|Sam|Dim)s?\\b"; + const SetWeekDayRegex = "\\b(?le\\s+)?(?matin|matin[ée]e|apres-midi|soir[ée]e|soir|Dimanche|Lundi|Mardi|Mercredi|Jeudi|Vendredi|Samedi)s\\b"; + const WeekDayOfMonthRegex: string; + const RelativeWeekDayRegex = "^[.]"; + const NumberEndingPattern = "^[.]"; + const SpecialDate: string; + const DateYearRegex: string; + const DateExtractor1: string; + const DateExtractor2: string; + const DateExtractor3: string; + const DateExtractor4: string; + const DateExtractor5: string; + const DateExtractor6: string; + const DateExtractor7: string; + const DateExtractor8: string; + const DateExtractor9: string; + const DateExtractorA: string; + const OfMonth: string; + const MonthEnd: string; + const WeekDayEnd: string; + const RangeUnitRegex = "\\b(?l'année|ann[eé]e(s)?|mois|semaines|semaine)\\b"; + const HourNumRegex = "\\b(?zero|un|deux|trois|quatre|cinq|six|sept|huit|neuf|dix|onze|douze|treize|quatorze|quinze|dix-six|dix-sept|dix-huit|dix-neuf|vingt|vingt-et-un|vingt-deux|vingt-trois)\\b"; + const MinuteNumRegex = "(?un|deux|trois|quatre|cinq|six|sept|huit|neuf|dix|onze|douze|treize|quatorze|quinze|seize|dix-sept|dix-huit|dix-neuf|vingt|trente|quarante|cinquante)"; + const DeltaMinuteNumRegex = "(?un|deux|trois|quatre|cinq|six|sept|huit|neuf|dix|onze|douze|treize|quatorze|quinze|seize|dix-sept|dix-huit|dix-neuf|vingt|trente|quarante|cinquante)"; + const OclockRegex = "(?heure|heures|h)"; + const PmRegex = "(?(dans l'\\s*)?apr[eè]s(\\s*|-)midi|(du|ce|de|le)\\s*(soir[ée]e|soir)|(dans l[ea]\\s+)?(nuit|soir[eé]e))"; + const AmRegex = "(?(du|de|ce|(du|de|dans)\\s*l[ea]|le)?\\s*matin[ée]e|(du|de|ce|dans l[ea]|le)?\\s*matin)"; + const LessThanOneHour: string; + const WrittenTimeRegex: string; + const TimePrefix: string; + const TimeSuffix: string; + const BasicTime: string; + const MidnightRegex = "(?minuit)"; + const CommonDatePrefixRegex = "^[\\.]"; + const MorningRegex = "(?matin[ée]e|matin)"; + const AfternoonRegex = "(?(d'|l')?apr[eè]s(-|\\s*)midi)"; + const MidmorningRegex: string; + const MiddayRegex = "(?milieu(\\s*|-)d[eu]\\s*(jour|midi)|apr[eè]s(-|\\s*)midi)"; + const MidafternoonRegex: string; + const MidTimeRegex: string; + const AtRegex: string; + const IshRegex: string; + const TimeUnitRegex = "(?heures|heure|hrs|hr|h|minutes|minute|mins|min|secondes|seconde|secs|sec)\\b"; + const RestrictedTimeUnitRegex = "(?huere|minute)\\b"; + const ConnectNumRegex: string; + const FivesRegex = "(?(quinze|vingt(\\s*|-*(cinq))?|trente(\\s*|-*(cinq))?|quarante(\\s*|-*(cinq))??|cinquante(\\s*|-*(cinq))?|dix|cinq))\\b"; + const PeriodHourNumRegex = "(?vingt-et-un|vingt-deux|vingt-trois|vingt-quatre|zero|une|deux|trois|quatre|cinq|six|sept|huit|neuf|dix|onze|douze|treize|quatorze|quinze|seize|dix-sept|dix-huit|dix-neuf|vingt)"; + const TimeRegex1: string; + const TimeRegex2: string; + const TimeRegex3: string; + const TimeRegex4: string; + const TimeRegex5: string; + const TimeRegex6: string; + const TimeRegex7: string; + const TimeRegex8: string; + const TimeRegex9: string; + const TimeRegex10: string; + const HourRegex: string; + const PeriodDescRegex = "(?pm|am|p\\.m\\.|a\\.m\\.|p)"; + const PeriodPmRegex = "(?dans l'apr[eè]s-midi|ce soir|d[eu] soir|dans l[ea] soir[eé]e|dans la nuit|d[eu] soir[ée]e)s?"; + const PeriodAmRegex = "(?matin|d[eu] matin|matin[ée]e)s?"; + const PureNumFromTo: string; + const PureNumBetweenAnd: string; + const SpecificTimeFromTo = "^[.]"; + const SpecificTimeBetweenAnd = "^[.]"; + const PrepositionRegex = "(?^([aà] la|en|sur\\s*l[ea]|sur|de)$)"; + const TimeOfDayRegex = "\\b(?((((dans\\s+(l[ea])?\\s+)?((?d[eé]but(\\s+|-)|t[oô]t(\\s+|-)(l[ea]\\s*)?)|(?fin\\s*|fin de(\\s+(la)?)|tard\\s*))?(matin[ée]e|matin|((d|l)?'?)apr[eè]s[-|\\s*]midi|nuit|soir[eé]e|soir)))|(((\\s+(l[ea])?\\s+)?)(jour|journ[eé]e)))s?)\\b"; + const SpecificTimeOfDayRegex: string; + const TimeFollowedUnit: string; + const TimeNumberCombinedWithUnit: string; + const NowRegex = "\\b(?(ce\\s+)?moment|maintenant|d[eè]s que possible|dqp|r[eé]cemment|auparavant)\\b"; + const SuffixRegex = "^\\s*(dans\\s+l[ea]\\s+)|(en\\s+)|(du)?(matin|matin([eé]e)?|apr[eè]s-midi|soir[eé]e|nuit)\\b"; + const DateTimeTimeOfDayRegex = "\\b(?matin[ée]e|matin|apr[eè]s-midi|nuit|soir)\\b"; + const DateTimeSpecificTimeOfDayRegex: string; + const TimeOfTodayAfterRegex: string; + const TimeOfTodayBeforeRegex: string; + const SimpleTimeOfTodayAfterRegex: string; + const SimpleTimeOfTodayBeforeRegex: string; + const TheEndOfRegex = "(la\\s+)?fin(\\s+de\\s*|\\s*de*l[ea])?\\s*$"; + const PeriodTimeOfDayRegex = "\\b((dans\\s+(le)?\\s+)?((?d[eé]but(\\s+|-|d[ue]|de la)|t[oô]t)|(?tard\\s*|fin(\\s+|-|d[eu])?))?(?matin|((d|l)?'?)apr[eè]s-midi|nuit|soir[eé]e|soir))\\b"; + const PeriodSpecificTimeOfDayRegex: string; + const PeriodTimeOfDayWithDateRegex: string; + const LessThanRegex = "^[.]"; + const MoreThanRegex = "^[.]"; + const DurationUnitRegex = "(?ans|ann[eé]e|mois|semaines|semaine|jour|jours|heures|heure|hrs|hr|h|minutes|minute|mins|min|secondes|seconde|secs|sec|ann[eé]es|journ[eé]e)\\b"; + const SuffixAndRegex = "(?\\s*(et)\\s+((un|une)\\s+)?(?demi|quart))"; + const PeriodicRegex = "\\b(?quotidienne|quotidien|journellement|mensuel|mensuelle|jour|jours|hebdomadaire|bihebdomadaire|annuellement|annuel)\\b"; + const EachUnitRegex: string; + const EachPrefixRegex = "\\b(?(chaque|tous les|(toutes les))\\s*$)"; + const SetEachRegex = "\\b(?(chaque|tous les|(toutes les))\\s*)"; + const SetLastRegex = "(?prochain|dernier|derni[eè]re|pass[ée]s|pr[eé]c[eé]dent|courant|en\\s*cours)"; + const EachDayRegex = "^\\s*(chaque|tous les)\\s*(jour|jours)\\b"; + const DurationFollowedUnit: string; + const NumberCombinedWithDurationUnit: string; + const AnUnitRegex: string; + const DuringRegex = "^[.]"; + const AllRegex = "\\b(?toute\\s(l['ea])\\s?(?ann[eé]e|mois|semaine|semaines|jour|jours|journ[eé]e))\\b"; + const HalfRegex = "(((un|une)\\s*)|\\b)(?demi?(\\s*|-)+(?ann[eé]e|ans|mois|semaine|jour|heure))\\b"; + const ConjunctionRegex = "\\b((et(\\s+de|pour)?)|avec)\\b"; + const HolidayRegex1: string; + const HolidayRegex2: string; + const HolidayRegex3: string; + const HolidayRegex4: string; + const DateTokenPrefix = "le "; + const TimeTokenPrefix = "à "; + const TokenBeforeDate = "le "; + const TokenBeforeTime = "à "; + const AMTimeRegex = "(?matin[ée]e|matin)"; + const PMTimeRegex = "\\b(?(d'|l')?apr[eè]s-midi|soir|nuit|\\s*ce soir|du soir)\\b"; + const BeforeRegex = "\\b(avant)\\b"; + const BeforeRegex2 = "\\b(entre\\s*(le|la(s)?)?)\\b"; + const AfterRegex = "\\b(apres)\\b"; + const SinceRegex = "\\b(depuis)\\b"; + const AroundRegex = "^[.]"; + const AgoPrefixRegex = "\\b(y a)\\b"; + const LaterRegex = "\\b(plus tard)\\b"; + const AgoRegex = "^[.]"; + const InConnectorRegex = "\\b(dans|en|sur)\\b"; + const WithinNextPrefixRegex = "^[.]"; + const MorningStartEndRegex = "(^(matin))|((matin)$)"; + const AfternoonStartEndRegex = "(^((d'|l')?apr[eè]s-midi))|(((d'|l')?apr[eè]s-midi)$)"; + const EveningStartEndRegex = "(^(soir[ée]e|soir))|((soir[ée]e|soir)$)"; + const NightStartEndRegex = "(^(nuit))|((nuit)$)"; + const InexactNumberRegex = "\\b(quelque|quel qu[ée]s|quelqu[ée]s|plusieur|plusieurs|divers)\\b"; + const InexactNumberUnitRegex: string; + const RelativeTimeUnitRegex: string; + const RelativeDurationUnitRegex: string; + const ReferenceDatePeriodRegex = "^[.]"; + const ConnectorRegex = "^(,|pour|t|vers)$"; + const ConnectorAndRegex = "\\b(et\\s*(le|la(s)?)?)\\b.+"; + const FromRegex = "((de|du)?)$"; + const FromRegex2 = "((depuis|de)(\\s*la(s)?)?)$"; + const FromToRegex = "\\b(du|de|des|depuis).+(à|a|au)\\b.+"; + const SingleAmbiguousMonthRegex = "^(le\\s+)?(may|march)$"; + const UnspecificDatePeriodRegex = "^[.]"; + const PrepositionSuffixRegex = "\\b(du|de|[àa]|vers|dans)$"; + const FlexibleDayRegex = "(?([A-Za-z]+\\s)?[A-Za-z\\d]+)"; + const ForTheRegex: string; + const WeekDayAndDayOfMonthRegex: string; + const RestOfDateRegex = "\\b(Reste|fin)\\s+(d[eu]\\s+)?((le|cette|ce)\\s+)?(?semaine|mois|l'ann[ée]e)\\b"; + const RestOfDateTimeRegex = "\\b(Reste|fin)\\s+(d[eu]\\s+)?((le|cette|ce)\\s+)?(?jour)\\b"; + const LaterEarlyPeriodRegex = "^[.]"; + const WeekWithWeekDayRangeRegex = "^[.]"; + const GeneralEndingRegex = "^[.]"; + const MiddlePauseRegex = "^[.]"; + const DurationConnectorRegex = "^[.]"; + const PrefixArticleRegex = "^[\\.]"; + const OrRegex = "^[.]"; + const YearPlusNumberRegex = "^[.]"; + const NumberAsTimeRegex = "^[.]"; + const TimeBeforeAfterRegex = "^[.]"; + const DateNumberConnectorRegex = "^[.]"; + const CenturyRegex = "^[.]"; + const DecadeRegex = "^[.]"; + const DecadeWithCenturyRegex = "^[.]"; + const RelativeDecadeRegex = "^[.]"; + const YearSuffix: string; + const YearAfterRegex = "^[.]"; + const YearPeriodRegex = "^[.]"; + const FutureSuffixRegex = "^[.]"; + const ComplexDatePeriodRegex = "^[.]"; + const UnitMap: ReadonlyMap; + const UnitValueMap: ReadonlyMap; + const SeasonMap: ReadonlyMap; + const SeasonValueMap: ReadonlyMap; + const CardinalMap: ReadonlyMap; + const DayOfWeek: ReadonlyMap; + const MonthOfYear: ReadonlyMap; + const Numbers: ReadonlyMap; + const DayOfMonth: ReadonlyMap; + const DoubleNumbers: ReadonlyMap; + const HolidayNames: ReadonlyMap; + const NightRegex = "\\b(minuit|nuit)\\b"; + const WrittenDecades: ReadonlyMap; + const SpecialDecadeCases: ReadonlyMap; + const DefaultLanguageFallback = "DMY"; + const DurationDateRestrictions: any[]; +} diff --git a/libraries/botbuilder-stdlib/vendors/@microsoft/recognizers-text-date-time/dist/types/resources/portugueseDateTime.d.ts b/libraries/botbuilder-stdlib/vendors/@microsoft/recognizers-text-date-time/dist/types/resources/portugueseDateTime.d.ts new file mode 100644 index 0000000000..0431a66eee --- /dev/null +++ b/libraries/botbuilder-stdlib/vendors/@microsoft/recognizers-text-date-time/dist/types/resources/portugueseDateTime.d.ts @@ -0,0 +1,209 @@ +export declare namespace PortugueseDateTime { + const TillRegex = "(?ate|as|às|até|ateh|a|ao|--|-|—|——)(\\s+(o|[aà](s)?))?"; + const AndRegex = "(?e|e\\s*o|--|-|—|——)"; + const DayRegex = "(?01|02|03|04|05|06|07|08|09|1|10|11|12|13|14|15|16|17|18|19|2|20|21|22|23|24|25|26|27|28|29|3|30|31|4|5|6|7|8|9)(?=\\b|t)"; + const MonthNumRegex = "(?01|02|03|04|05|06|07|08|09|10|11|12|1|2|3|4|5|6|7|8|9)\\b"; + const DescRegex = "(?pm\\b|am\\b|p\\.m\\.|a\\.m\\.)"; + const AmDescRegex = "(am\\b|a\\.m\\.|a m\\b|a\\. m\\.\\b|a\\.m\\b|a\\. m\\b)"; + const PmDescRegex = "(pm\\b|p\\.m\\.|p\\b|p m\\b|p\\. m\\.\\b|p\\.m\\b|p\\. m\\b)"; + const AmPmDescRegex = "(ampm)"; + const TwoDigitYearRegex: string; + const FullTextYearRegex = "^[\\*]"; + const YearRegex: string; + const RelativeMonthRegex = "(?([nd]?es[st]e|pr[óo]ximo|passsado|[uú]ltimo)\\s+m[eê]s)\\b"; + const MonthRegex = "(?Abril|Abr|Agosto|Ago|Dezembro|Dez|Fevereiro|Fev|Janeiro|Jan|Julho|Jul|Junho|Jun|Mar[çc]o|Mar|Maio|Mai|Novembro|Nov|Outubro|Out|Septembro|Setembro|Sept|Set)"; + const MonthSuffixRegex: string; + const DateUnitRegex = "(?anos|ano|meses|m[êe]s|semanas|semana|dia(s)?)\\b"; + const PastRegex = "(?\\b(passad(a|o)(s)?|[uú]ltim[oa](s)?|anterior(es)?|h[aá]|pr[ée]vi[oa](s)?)\\b)"; + const FutureRegex = "(?\\b(seguinte(s)?|pr[oó]xim[oa](s)?|dentro\\s+de|em|daqui\\s+a)\\b)"; + const SimpleCasesRegex: string; + const MonthFrontSimpleCasesRegex: string; + const MonthFrontBetweenRegex: string; + const DayBetweenRegex: string; + const OneWordPeriodRegex = "\\b(((pr[oó]xim[oa]?|[nd]?es[st]e|aquel[ea]|[uú]ltim[oa]?|em)\\s+)?(?Abril|Abr|Agosto|Ago|Dezembro|Dez|Fevereiro|Fev|Janeiro|Jan|Julho|Jul|Junho|Jun|Mar[çc]o|Mar|Maio|Mai|Novembro|Nov|Outubro|Out|Septembro|Setembro|Sept|Set)|(?<=\\b(de|do|da|o|a)\\s+)?(pr[oó]xim[oa](s)?|[uú]ltim[oa]s?|est(e|a))\\s+(fim de semana|fins de semana|semana|m[êe]s|ano)|fim de semana|fins de semana|(m[êe]s|anos)? [àa] data)\\b"; + const MonthWithYearRegex: string; + const MonthNumWithYearRegex: string; + const WeekOfMonthRegex: string; + const WeekOfYearRegex: string; + const FollowedDateUnit: string; + const NumberCombinedWithDateUnit: string; + const QuarterRegex: string; + const QuarterRegexYearFront: string; + const AllHalfYearRegex = "^[.]"; + const PrefixDayRegex = "^[.]"; + const SeasonRegex: string; + const WhichWeekRegex = "(semana)(\\s*)(?\\d\\d|\\d|0\\d)"; + const WeekOfRegex = "(semana)(\\s*)((do|da|de))"; + const MonthOfRegex = "(mes)(\\s*)((do|da|de))"; + const RangeUnitRegex = "\\b(?anos|ano|meses|m[êe]s|semanas|semana)\\b"; + const InConnectorRegex = "\\b(em)\\b"; + const WithinNextPrefixRegex = "^[.]"; + const CenturySuffixRegex = "^[.]"; + const FromRegex = "((desde|de)(\\s*a(s)?)?)$"; + const ConnectorAndRegex = "(e\\s*([àa](s)?)?)$"; + const BetweenRegex = "(entre\\s*([oa](s)?)?)"; + const WeekDayRegex = "\\b(?Domingos?|Segundas?-feiras?|Segundas?\\s+feiras?|Segundas?|2a|Ter[çca]s?-feiras?|Ter[çc]as?\\s+feiras?|Ter[cça]s?|3a|Quartas?-feiras?|Quartas?\\s+feiras?|Quartas?|4a|Quintas?-feiras?|Quintas?\\s+feiras?|Quintas?|5a|Sextas?-feiras?|Sextas?\\s+feiras?|Sextas?|6a|S[aá]bados?|2ª|3ª|4ª|5ª|6ª|Dom|Seg|Ter|Qua|Qui|Sex|Sab|Seg\\.|Ter[cç]\\.|Qua\\.|Qui\\.|Sex\\.|S[aá]b\\.|Dom\\.)\\b"; + const OnRegex: string; + const RelaxedOnRegex = "(?<=\\b(em|n[oa]|d[oa])\\s+)(dia\\s+)?((?10|11|12|13|14|15|16|17|18|19|1|20|21|22|23|24|25|26|27|28|29|2|30|31|3|4|5|6|7|8|9)s?)\\b"; + const ThisRegex: string; + const LastDateRegex: string; + const NextDateRegex: string; + const SpecialDayRegex = "\\b((d?o\\s+)?(dia\\s+antes\\s+de\\s+ontem|antes\\s+de\\s+ontem|anteontem)|((d?o\\s+)?(dia\\s+|depois\\s+|dia\\s+depois\\s+)?de\\s+amanh[aã])|(o\\s)?dia\\s+seguinte|(o\\s)?pr[oó]ximo\\s+dia|(o\\s+)?[uú]ltimo\\s+dia|ontem|amanh[ãa]|hoje)|(do\\s+dia$)\\b"; + const SpecialDayWithNumRegex = "^[.]"; + const ForTheRegex = ".^"; + const WeekDayAndDayOfMonthRegex = ".^"; + const WeekDayOfMonthRegex: string; + const RelativeWeekDayRegex = "^[.]"; + const NumberEndingPattern = "^[.]"; + const SpecialDateRegex: string; + const OfMonthRegex: string; + const MonthEndRegex: string; + const WeekDayEnd: string; + const DateYearRegex: string; + const DateExtractor1: string; + const DateExtractor2: string; + const DateExtractor3: string; + const DateExtractor4: string; + const DateExtractor5: string; + const DateExtractor6: string; + const DateExtractor7: string; + const DateExtractor8: string; + const DateExtractor9: string; + const DateExtractor10: string; + const DateExtractor11: string; + const HourNumRegex = "\\b(?zero|uma|duas|tr[êe]s|[qc]uatro|cinco|seis|sete|oito|nove|dez|onze|doze)\\b"; + const MinuteNumRegex = "(?um|dois|tr[êe]s|[qc]uatro|cinco|seis|sete|oito|nove|dez|onze|doze|treze|catorze|quatorze|quinze|dez[ea]sseis|dez[ea]sete|dezoito|dez[ea]nove|vinte|trinta|[qc]uarenta|cin[qc]uenta)"; + const DeltaMinuteNumRegex = "(?um|dois|tr[êe]s|[qc]uatro|cinco|seis|sete|oito|nove|dez|onze|doze|treze|catorze|quatorze|quinze|dez[ea]sseis|dez[ea]sete|dezoito|dez[ea]nove|vinte|trinta|[qc]uarenta|cin[qc]uenta)"; + const OclockRegex = "(?em\\s+ponto)"; + const PmRegex = "(?((pela|de|da|\\b[àa]\\b|na)\\s+(tarde|noite)))|((depois\\s+do|ap[óo]s\\s+o)\\s+(almo[çc]o|meio dia|meio-dia))"; + const AmRegex = "(?(pela|de|da|na)\\s+(manh[ãa]|madrugada))"; + const AmTimeRegex = "(?([dn]?es[st]a|(pela|de|da|na))\\s+(manh[ãa]|madrugada))"; + const PmTimeRegex = "(?(([dn]?es[st]a|\\b[àa]\\b|(pela|de|da|na))\\s+(tarde|noite)))|((depois\\s+do|ap[óo]s\\s+o)\\s+(almo[çc]o|meio dia|meio-dia))"; + const LessThanOneHour: string; + const TensTimeRegex = "(?dez|vinte|trinta|[qc]uarenta|cin[qc]uenta)"; + const WrittenTimeRegex: string; + const TimePrefix: string; + const TimeSuffix: string; + const BasicTime: string; + const AtRegex: string; + const ConnectNumRegex: string; + const TimeRegex1: string; + const TimeRegex2: string; + const TimeRegex3: string; + const TimeRegex4: string; + const TimeRegex5: string; + const TimeRegex6: string; + const TimeRegex7: string; + const TimeRegex8: string; + const TimeRegex9: string; + const TimeRegex10 = "(\\b([àa]|ao?)|na|de|da|pela)\\s+(madrugada|manh[ãa]|meio\\s*dia|meia\\s*noite|tarde|noite)"; + const TimeRegex11: string; + const TimeRegex12: string; + const PrepositionRegex = "(?([àa]s?|em|por|pelo|pela|no|na|de|d[oa]?)?$)"; + const NowRegex = "\\b(?((logo|exatamente)\\s+)?agora(\\s+mesmo)?|neste\\s+momento|(assim\\s+que|t[ãa]o\\s+cedo\\s+quanto)\\s+(poss[ií]vel|possas?|possamos)|o\\s+mais\\s+(cedo|r[aá]pido)\\s+poss[íi]vel|recentemente|previamente)\\b"; + const SuffixRegex = "^\\s*((e|a|em|por|pelo|pela|no|na|de)\\s+)?(manh[ãa]|madrugada|meio\\s*dia|tarde|noite)\\b"; + const TimeOfDayRegex = "\\b(?manh[ãa]|madrugada|tarde|noite|((depois\\s+do|ap[óo]s\\s+o)\\s+(almo[çc]o|meio dia|meio-dia)))\\b"; + const SpecificTimeOfDayRegex: string; + const TimeOfTodayAfterRegex: string; + const TimeOfTodayBeforeRegex: string; + const SimpleTimeOfTodayAfterRegex: string; + const SimpleTimeOfTodayBeforeRegex: string; + const TheEndOfRegex = "((no|ao)\\s+)?(fi(m|nal)|t[ée]rmin(o|ar))(\\s+d?o(\\s+dia)?(\\s+de)?)?\\s*$"; + const UnitRegex = "(?anos|ano|meses|m[êe]s|semanas|semana|dias|dia|horas|hora|h|hr|hrs|hs|minutos|minuto|mins|min|segundos|segundo|segs|seg)\\b"; + const ConnectorRegex = "^(,|t|para [ao]|para as|pras|cerca de|cerca das|perto de|perto das|quase)$"; + const TimeHourNumRegex = "(?vinte e um|vinte e dois|vinte e tr[êe]s|vinte e quatro|zero|um|uma|dois|duas|tr[êe]s|quatro|cinco|seis|sete|oito|nove|dez|onze|doze|treze|quatorze|catorze|quinze|dez[ea]sseis|dez[ea]ssete|dezoito|dez[ea]nove|vinte)"; + const PureNumFromTo: string; + const PureNumBetweenAnd: string; + const SpecificTimeFromTo = "^[.]"; + const SpecificTimeBetweenAnd = "^[.]"; + const TimeUnitRegex = "(?horas|hora|h|minutos|minuto|mins|min|segundos|segundo|secs|sec)\\b"; + const TimeFollowedUnit: string; + const TimeNumberCombinedWithUnit: string; + const DateTimePeriodNumberCombinedWithUnit: string; + const PeriodTimeOfDayWithDateRegex = "\\b((e|[àa]|em|na|no|ao|pel[ao]|de)\\s+)?(?manh[ãa]|madrugada|(passado\\s+(o\\s+)?)?meio\\s+dia|tarde|noite)\\b"; + const RelativeTimeUnitRegex: string; + const SuffixAndRegex = "(?\\s*(e)\\s+(?meia|(um\\s+)?quarto))"; + const FollowedUnit: string; + const LessThanRegex = "^[.]"; + const MoreThanRegex = "^[.]"; + const DurationNumberCombinedWithUnit: string; + const AnUnitRegex: string; + const DuringRegex = "^[.]"; + const AllRegex = "\\b(?tod[oa]?\\s+(o|a)\\s+(?ano|m[êe]s|semana|dia))\\b"; + const HalfRegex = "\\b(?mei[oa]\\s+(?ano|m[êe]s|semana|dia|hora))\\b"; + const ConjunctionRegex = "^[.]"; + const InexactNumberRegex = "\\b(poucos|pouco|algum|alguns|v[áa]rios)\\b"; + const InexactNumberUnitRegex: string; + const HolidayRegex1: string; + const HolidayRegex2: string; + const HolidayRegex3: string; + const BeforeRegex = "(antes(\\s+(de|dos?|das?)?)?)"; + const AfterRegex = "((depois|ap[óo]s)(\\s*(de|d?os?|d?as?)?)?)"; + const SinceRegex = "(desde(\\s+(as?|o))?)"; + const AroundRegex = "^[.]"; + const PeriodicRegex = "\\b(?di[áa]ri[ao]|diariamente|mensalmente|semanalmente|quinzenalmente|anualmente)\\b"; + const EachExpression = "cada|tod[oa]s?\\s*([oa]s)?"; + const EachUnitRegex: string; + const EachPrefixRegex: string; + const EachDayRegex: string; + const BeforeEachDayRegex: string; + const SetEachRegex: string; + const LaterEarlyPeriodRegex = "^[.]"; + const WeekWithWeekDayRangeRegex = "^[.]"; + const GeneralEndingRegex = "^[.]"; + const MiddlePauseRegex = "^[.]"; + const PrefixArticleRegex = "^[\\.]"; + const OrRegex = "^[.]"; + const YearPlusNumberRegex = "^[.]"; + const NumberAsTimeRegex = "^[.]"; + const TimeBeforeAfterRegex = "^[.]"; + const DateNumberConnectorRegex = "^[.]"; + const ComplexDatePeriodRegex = "^[.]"; + const AgoRegex = "\\b(antes|atr[áa]s|no passado)\\b"; + const LaterRegex = "\\b(depois d[eoa]s?|ap[óo]s (as)?|desde (as|o)|desde|no futuro|mais tarde)\\b"; + const Tomorrow = "amanh[ãa]"; + const UnitMap: ReadonlyMap; + const UnitValueMap: ReadonlyMap; + const SeasonMap: ReadonlyMap; + const SeasonValueMap: ReadonlyMap; + const CardinalMap: ReadonlyMap; + const DayOfWeek: ReadonlyMap; + const MonthOfYear: ReadonlyMap; + const Numbers: ReadonlyMap; + const HolidayNames: ReadonlyMap; + const VariableHolidaysTimexDictionary: ReadonlyMap; + const DoubleNumbers: ReadonlyMap; + const DateTokenPrefix = "em "; + const TimeTokenPrefix = "as "; + const TokenBeforeDate = "o "; + const TokenBeforeTime = "as "; + const NextPrefixRegex = "(pr[oó]xim[oa]|seguinte)\\b"; + const PastPrefixRegex = "([uú]ltim[oa])\\b"; + const ThisPrefixRegex = "([nd]?es[st][ea])\\b"; + const RelativeDayRegex = "^[\\.]"; + const RestOfDateRegex = "^[\\.]"; + const RelativeDurationUnitRegex = "^[\\.]"; + const ReferenceDatePeriodRegex = "^[.]"; + const FromToRegex = "\\b(from).+(to)\\b.+"; + const SingleAmbiguousMonthRegex = "^(the\\s+)?(may|march)$"; + const UnspecificDatePeriodRegex = "^[.]"; + const PrepositionSuffixRegex = "\\b(on|in|at|around|from|to)$"; + const RestOfDateTimeRegex = "^[\\.]"; + const SetWeekDayRegex = "^[\\.]"; + const NightRegex = "\\b(meia noite|noite|de noite)\\b"; + const CommonDatePrefixRegex = "\\b(dia)\\s+$"; + const DurationUnitRegex = "^[\\.]"; + const DurationConnectorRegex = "^[.]"; + const CenturyRegex = "^[.]"; + const DecadeRegex = "^[.]"; + const DecadeWithCenturyRegex = "^[.]"; + const RelativeDecadeRegex = "^[.]"; + const YearSuffix: string; + const YearAfterRegex = "^[.]"; + const YearPeriodRegex = "^[.]"; + const FutureSuffixRegex = "^[.]"; + const WrittenDecades: ReadonlyMap; + const SpecialDecadeCases: ReadonlyMap; + const DefaultLanguageFallback = "DMY"; + const DurationDateRestrictions: any[]; +} diff --git a/libraries/botbuilder-stdlib/vendors/@microsoft/recognizers-text-date-time/dist/types/resources/spanishDateTime.d.ts b/libraries/botbuilder-stdlib/vendors/@microsoft/recognizers-text-date-time/dist/types/resources/spanishDateTime.d.ts new file mode 100644 index 0000000000..a652610492 --- /dev/null +++ b/libraries/botbuilder-stdlib/vendors/@microsoft/recognizers-text-date-time/dist/types/resources/spanishDateTime.d.ts @@ -0,0 +1,208 @@ +export declare namespace SpanishDateTime { + const TillRegex = "(?hasta|al|a|--|-|—|——)(\\s+(el|la(s)?))?"; + const AndRegex = "(?y|y\\s*el|--|-|—|——)"; + const DayRegex = "(?01|02|03|04|05|06|07|08|09|10|11|12|13|14|15|16|17|18|19|1|20|21|22|23|24|25|26|27|28|29|2|30|31|3|4|5|6|7|8|9)(?=\\b|t)"; + const MonthNumRegex = "(?01|02|03|04|05|06|07|08|09|10|11|12|1|2|3|4|5|6|7|8|9)\\b"; + const DescRegex = "(?pm\\b|am\\b|p\\.m\\.|a\\.m\\.)"; + const AmDescRegex = "(am\\b|a\\.m\\.|a m\\b|a\\. m\\.\\b|a\\.m\\b|a\\. m\\b)"; + const PmDescRegex = "(pm\\b|p\\.m\\.|p\\b|p m\\b|p\\. m\\.\\b|p\\.m\\b|p\\. m\\b)"; + const AmPmDescRegex = "(ampm)"; + const TwoDigitYearRegex: string; + const FullTextYearRegex = "^[\\*]"; + const YearRegex: string; + const RelativeMonthRegex = "(?(este|pr[oó]ximo|[uú]ltimo)\\s+mes)\\b"; + const MonthRegex = "(?Abril|Abr|Agosto|Ago|Diciembre|Dic|Febrero|Feb|Enero|Ene|Julio|Jul|Junio|Jun|Marzo|Mar|Mayo|May|Noviembre|Nov|Octubre|Oct|Septiembre|Setiembre|Sept|Set)"; + const MonthSuffixRegex: string; + const DateUnitRegex = "(?años|año|meses|mes|semanas|semana|d[ií]a(s)?)\\b"; + const PastRegex = "(?\\b(pasad(a|o)(s)?|[uú]ltim[oa](s)?|anterior(es)?|previo(s)?)\\b)"; + const FutureRegex = "(?\\b(siguiente(s)?|pr[oó]xim[oa](s)?|dentro\\s+de|en)\\b)"; + const SimpleCasesRegex: string; + const MonthFrontSimpleCasesRegex: string; + const MonthFrontBetweenRegex: string; + const DayBetweenRegex: string; + const OneWordPeriodRegex = "\\b(((pr[oó]xim[oa]?|est[ea]|[uú]ltim[oa]?|en)\\s+)?(?Abril|Abr|Agosto|Ago|Diciembre|Dic|Enero|Ene|Febrero|Feb|Julio|Jul|Junio|Jun|Marzo|Mar|Mayo|May|Noviembre|Nov|Octubre|Oct|Septiembre|Setiembre|Sept|Set)|(?<=\\b(del|de la|el|la)\\s+)?(pr[oó]xim[oa](s)?|[uú]ltim[oa]?|est(e|a))\\s+(fin de semana|semana|mes|año)|fin de semana|(mes|años)? a la fecha)\\b"; + const MonthWithYearRegex: string; + const MonthNumWithYearRegex: string; + const WeekOfMonthRegex: string; + const WeekOfYearRegex: string; + const FollowedDateUnit: string; + const NumberCombinedWithDateUnit: string; + const QuarterRegex: string; + const QuarterRegexYearFront: string; + const AllHalfYearRegex = "^[.]"; + const PrefixDayRegex = "^[.]"; + const CenturySuffixRegex = "^[.]"; + const SeasonRegex: string; + const WhichWeekRegex = "(semana)(\\s*)(?\\d\\d|\\d|0\\d)"; + const WeekOfRegex = "(semana)(\\s*)((do|da|de))"; + const MonthOfRegex = "(mes)(\\s*)((do|da|de))"; + const RangeUnitRegex = "\\b(?años|año|meses|mes|semanas|semana)\\b"; + const InConnectorRegex = "\\b(in)\\b"; + const WithinNextPrefixRegex = "^[.]"; + const FromRegex = "((desde|de)(\\s*la(s)?)?)$"; + const ConnectorAndRegex = "(y\\s*(la(s)?)?)$"; + const BetweenRegex = "(entre\\s*(la(s)?)?)"; + const WeekDayRegex = "\\b(?Domingos?|Lunes|Martes|Mi[eé]rcoles|Jueves|Viernes|S[aá]bados?|Lu|Ma|Mi|Ju|Vi|Sa|Do)\\b"; + const OnRegex: string; + const RelaxedOnRegex = "(?<=\\b(en|el|del)\\s+)((?10|11|12|13|14|15|16|17|18|19|1st|20|21|22|23|24|25|26|27|28|29|2|30|31|3|4|5|6|7|8|9)s?)\\b"; + const ThisRegex: string; + const LastDateRegex: string; + const NextDateRegex: string; + const SpecialDayRegex = "\\b((el\\s+)?(d[ií]a\\s+antes\\s+de\\s+ayer|anteayer)|((el\\s+)?d[ií]a\\s+(despu[eé]s\\s+)?de\\s+mañana|pasado\\s+mañana)|(el\\s)?d[ií]a siguiente|(el\\s)?pr[oó]ximo\\s+d[ií]a|(el\\s+)?[uú]ltimo d[ií]a|(d)?el d[ií]a|ayer|mañana|hoy)\\b"; + const SpecialDayWithNumRegex = "^[.]"; + const ForTheRegex = "^[.]"; + const WeekDayAndDayOfMonthRegex = "^[.]"; + const WeekDayOfMonthRegex: string; + const RelativeWeekDayRegex = "^[.]"; + const NumberEndingPattern = "^[.]"; + const SpecialDateRegex: string; + const OfMonthRegex: string; + const MonthEndRegex: string; + const WeekDayEnd: string; + const DateYearRegex: string; + const DateExtractor1: string; + const DateExtractor2: string; + const DateExtractor3: string; + const DateExtractor4: string; + const DateExtractor5: string; + const DateExtractor6: string; + const DateExtractor7: string; + const DateExtractor8: string; + const DateExtractor9: string; + const DateExtractor10: string; + const HourNumRegex = "\\b(?cero|una|dos|tres|cuatro|cinco|seis|siete|ocho|nueve|diez|once|doce)\\b"; + const MinuteNumRegex = "(?un|dos|tres|cuatro|cinco|seis|siete|ocho|nueve|diez|once|doce|trece|catorce|quince|dieciseis|diecisiete|dieciocho|diecinueve|veinte|treinta|cuarenta|cincuenta)"; + const DeltaMinuteNumRegex = "(?un|dos|tres|cuatro|cinco|seis|siete|ocho|nueve|diez|once|doce|trece|catorce|quince|dieciseis|diecisiete|dieciocho|diecinueve|veinte|treinta|cuarenta|cincuenta)"; + const OclockRegex = "(?en\\s+punto)"; + const PmRegex = "(?((por|de|a|en)\\s+la)\\s+(tarde|noche))"; + const AmRegex = "(?((por|de|a|en)\\s+la)\\s+(mañana|madrugada))"; + const AmTimeRegex = "(?(esta|(por|de|a|en)\\s+la)\\s+(mañana|madrugada))"; + const PmTimeRegex = "(?(esta|(por|de|a|en)\\s+la)\\s+(tarde|noche))"; + const LessThanOneHour: string; + const TensTimeRegex = "(?diez|veint(i|e)|treinta|cuarenta|cincuenta)"; + const WrittenTimeRegex: string; + const TimePrefix: string; + const TimeSuffix: string; + const BasicTime: string; + const AtRegex: string; + const ConnectNumRegex: string; + const TimeRegex1: string; + const TimeRegex2: string; + const TimeRegex3: string; + const TimeRegex4: string; + const TimeRegex5: string; + const TimeRegex6: string; + const TimeRegex7: string; + const TimeRegex8: string; + const TimeRegex9: string; + const TimeRegex10 = "(a\\s+la|al)\\s+(madrugada|mañana|medio\\s*d[ií]a|tarde|noche)"; + const TimeRegex11: string; + const TimeRegex12: string; + const PrepositionRegex = "(?(a(l)?|en|de(l)?)?(\\s*(la(s)?|el|los))?$)"; + const NowRegex = "\\b(?(justo\\s+)?ahora(\\s+mismo)?|en\\s+este\\s+momento|tan\\s+pronto\\s+como\\s+sea\\s+posible|tan\\s+pronto\\s+como\\s+(pueda|puedas|podamos|puedan)|lo\\s+m[aá]s\\s+pronto\\s+posible|recientemente|previamente)\\b"; + const SuffixRegex = "^\\s*(((y|a|en|por)\\s+la|al)\\s+)?(mañana|madrugada|medio\\s*d[ií]a|tarde|noche)\\b"; + const TimeOfDayRegex = "\\b(?mañana|madrugada|(pasado\\s+(el\\s+)?)?medio\\s?d[ií]a|tarde|noche|anoche)\\b"; + const SpecificTimeOfDayRegex: string; + const TimeOfTodayAfterRegex: string; + const TimeOfTodayBeforeRegex: string; + const SimpleTimeOfTodayAfterRegex: string; + const SimpleTimeOfTodayBeforeRegex: string; + const TheEndOfRegex = "((a|e)l\\s+)?fin(alizar|al)?(\\s+(el|de(l)?)(\\s+d[ií]a)?(\\s+de)?)?\\s*$"; + const UnitRegex = "(?años|año|meses|mes|semanas|semana|d[ií]as|d[ií]a|horas|hora|h|hr|hrs|hs|minutos|minuto|mins|min|segundos|segundo|segs|seg)\\b"; + const ConnectorRegex = "^(,|t|para la|para las|cerca de la|cerca de las)$"; + const TimeHourNumRegex = "(?veintiuno|veintidos|veintitres|veinticuatro|cero|uno|dos|tres|cuatro|cinco|seis|siete|ocho|nueve|diez|once|doce|trece|catorce|quince|diecis([eé])is|diecisiete|dieciocho|diecinueve|veinte)"; + const PureNumFromTo: string; + const PureNumBetweenAnd: string; + const SpecificTimeFromTo = "^[.]"; + const SpecificTimeBetweenAnd = "^[.]"; + const TimeUnitRegex = "(?horas|hora|h|minutos|minuto|mins|min|segundos|segundo|secs|sec)\\b"; + const TimeFollowedUnit: string; + const TimeNumberCombinedWithUnit: string; + const DateTimePeriodNumberCombinedWithUnit: string; + const PeriodTimeOfDayWithDateRegex = "\\b(((y|a|en|por)\\s+la|al)\\s+)?(?mañana|madrugada|(pasado\\s+(el\\s+)?)?medio\\s?d[ií]a|tarde|noche|anoche)\\b"; + const RelativeTimeUnitRegex: string; + const LessThanRegex = "^[.]"; + const MoreThanRegex = "^[.]"; + const SuffixAndRegex = "(?\\s*(y)\\s+((un|uno|una)\\s+)?(?media|cuarto))"; + const FollowedUnit: string; + const DurationNumberCombinedWithUnit: string; + const AnUnitRegex: string; + const DuringRegex = "^[.]"; + const AllRegex = "\\b(?tod[oa]?\\s+(el|la)\\s+(?año|mes|semana|d[ií]a))\\b"; + const HalfRegex = "\\b(?medi[oa]\\s+(?ano|mes|semana|d[íi]a|hora))\\b"; + const ConjunctionRegex = "^[.]"; + const InexactNumberRegex = "\\b(pocos|poco|algo|varios)\\b"; + const InexactNumberUnitRegex: string; + const HolidayRegex1: string; + const HolidayRegex2: string; + const HolidayRegex3: string; + const BeforeRegex = "(antes(\\s+del?(\\s+las?)?)?)"; + const AfterRegex = "(despues(\\s*del?(\\s+las?)?)?)"; + const SinceRegex = "(desde(\\s+(las?|el))?)"; + const AroundRegex = "^[.]"; + const PeriodicRegex = "\\b(?a\\s*diario|diariamente|mensualmente|semanalmente|quincenalmente|anualmente)\\b"; + const EachExpression = "cada|tod[oa]s\\s*(l[oa]s)?"; + const EachUnitRegex: string; + const EachPrefixRegex: string; + const EachDayRegex: string; + const BeforeEachDayRegex: string; + const SetEachRegex: string; + const LaterEarlyPeriodRegex = "^[.]"; + const WeekWithWeekDayRangeRegex = "^[.]"; + const GeneralEndingRegex = "^[.]"; + const MiddlePauseRegex = "^[.]"; + const PrefixArticleRegex = "^[\\.]"; + const OrRegex = "^[.]"; + const YearPlusNumberRegex = "^[.]"; + const NumberAsTimeRegex = "^[.]"; + const TimeBeforeAfterRegex = "^[.]"; + const DateNumberConnectorRegex = "^[.]"; + const CenturyRegex = "^[.]"; + const DecadeRegex = "^[.]"; + const DecadeWithCenturyRegex = "^[.]"; + const RelativeDecadeRegex = "^[.]"; + const ComplexDatePeriodRegex = "^[.]"; + const YearSuffix: string; + const AgoRegex = "\\b(antes)\\b"; + const LaterRegex = "\\b(despu[eé]s|desde ahora)\\b"; + const Tomorrow = "mañana"; + const UnitMap: ReadonlyMap; + const UnitValueMap: ReadonlyMap; + const SeasonMap: ReadonlyMap; + const SeasonValueMap: ReadonlyMap; + const CardinalMap: ReadonlyMap; + const DayOfWeek: ReadonlyMap; + const MonthOfYear: ReadonlyMap; + const Numbers: ReadonlyMap; + const HolidayNames: ReadonlyMap; + const VariableHolidaysTimexDictionary: ReadonlyMap; + const DoubleNumbers: ReadonlyMap; + const DateTokenPrefix = "en "; + const TimeTokenPrefix = "a las "; + const TokenBeforeDate = "el "; + const TokenBeforeTime = "la "; + const NextPrefixRegex = "(pr[oó]xim[oa]|siguiente)\\b"; + const PastPrefixRegex = "([uú]ltim[oa])\\b"; + const ThisPrefixRegex = "(est[ea])\\b"; + const RelativeDayRegex = "^[\\.]"; + const RestOfDateRegex = "^[\\.]"; + const RelativeDurationUnitRegex = "^[\\.]"; + const ReferenceDatePeriodRegex = "^[.]"; + const FromToRegex = "\\b(from).+(to)\\b.+"; + const SingleAmbiguousMonthRegex = "^(the\\s+)?(may|march)$"; + const UnspecificDatePeriodRegex = "^[.]"; + const PrepositionSuffixRegex = "\\b(on|in|at|around|for|during|since|from|to)$"; + const RestOfDateTimeRegex = "^[\\.]"; + const SetWeekDayRegex = "^[\\.]"; + const NightRegex = "\\b(medionoche|noche)\\b"; + const CommonDatePrefixRegex = "^[\\.]"; + const DurationUnitRegex = "^[\\.]"; + const DurationConnectorRegex = "^[.]"; + const YearAfterRegex = "^[.]"; + const YearPeriodRegex = "^[.]"; + const FutureSuffixRegex = "^[.]"; + const WrittenDecades: ReadonlyMap; + const SpecialDecadeCases: ReadonlyMap; + const DefaultLanguageFallback = "DMY"; + const DurationDateRestrictions: any[]; +} diff --git a/libraries/botbuilder-stdlib/vendors/@microsoft/recognizers-text-date-time/package.json b/libraries/botbuilder-stdlib/vendors/@microsoft/recognizers-text-date-time/package.json new file mode 100644 index 0000000000..9da58e1502 --- /dev/null +++ b/libraries/botbuilder-stdlib/vendors/@microsoft/recognizers-text-date-time/package.json @@ -0,0 +1,31 @@ +{ + "internal": true, + "name": "@microsoft/recognizers-text-date-time", + "version": "1.1.4", + "description": "recognizers-text provides robust recognition and resolution of date/time expressed in multiple languages.", + "author": "Microsoft Corp.", + "license": "MIT", + "keywords": [ + "nlp", + "nlp-entity-extraction", + "datetime", + "entity-extraction", + "timex", + "numex", + "parser-library" + ], + "main": "dist/recognizers-text-date-time.umd.js", + "module": "dist/recognizers-text-date-time.es5.js", + "typings": "dist/types/recognizers-text-date-time.d.ts", + "browser": "dist/recognizers-text-date-time.browser.js", + "bugs": { + "url": "https://github.com/Microsoft/botbuilder-js/issues" + }, + "repository": { + "type": "git", + "url": "https://github.com/Microsoft/botbuilder-js.git" + }, + "engines": { + "node": ">=6.0.0" + } +} \ No newline at end of file diff --git a/libraries/botbuilder-stdlib/vendors/@microsoft/recognizers-text-number-with-unit/README.md b/libraries/botbuilder-stdlib/vendors/@microsoft/recognizers-text-number-with-unit/README.md new file mode 100644 index 0000000000..65e270f5ad --- /dev/null +++ b/libraries/botbuilder-stdlib/vendors/@microsoft/recognizers-text-number-with-unit/README.md @@ -0,0 +1,5 @@ +# Microsoft.Recognizers.Text for JavaScript + +This module (`recognizers-text-number-with-unit`) is a sub-module of `recognizers-text-suite`. + +Please check the [main README](https://github.com/Microsoft/Recognizers-Text/tree/master/JavaScript/packages/recognizers-text-suite) for more details. \ No newline at end of file diff --git a/libraries/botbuilder-stdlib/vendors/@microsoft/recognizers-text-number-with-unit/dist/recognizers-text-number-with-unit.browser.js b/libraries/botbuilder-stdlib/vendors/@microsoft/recognizers-text-number-with-unit/dist/recognizers-text-number-with-unit.browser.js new file mode 100644 index 0000000000..c5c0a6a0ff --- /dev/null +++ b/libraries/botbuilder-stdlib/vendors/@microsoft/recognizers-text-number-with-unit/dist/recognizers-text-number-with-unit.browser.js @@ -0,0 +1,19049 @@ +var microsoftRecognizersTextNumberWithUnit = (function (exports) { +'use strict'; + +var commonjsGlobal = typeof window !== 'undefined' ? window : typeof global !== 'undefined' ? global : typeof self !== 'undefined' ? self : {}; + + + +function unwrapExports (x) { + return x && x.__esModule && Object.prototype.hasOwnProperty.call(x, 'default') ? x['default'] : x; +} + +function createCommonjsModule(fn, module) { + return module = { exports: {} }, fn(module, module.exports), module.exports; +} + +var culture = createCommonjsModule(function (module, exports) { +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +class Culture { + constructor(cultureName, cultureCode) { + this.cultureName = cultureName; + this.cultureCode = cultureCode; + } + static getSupportedCultureCodes() { + return Culture.supportedCultures.map(c => c.cultureCode); + } + static mapToNearestLanguage(cultureCode) { + if (cultureCode !== undefined) { + cultureCode = cultureCode.toLowerCase(); + var supportedCultureCodes = Culture.getSupportedCultureCodes(); + if (supportedCultureCodes.indexOf(cultureCode) < 0) { + var culturePrefix = cultureCode.split('-')[0].trim(); + supportedCultureCodes.forEach(function (supportedCultureCode) { + if (supportedCultureCode.startsWith(culturePrefix)) { + cultureCode = supportedCultureCode; + } + }); + } + } + return cultureCode; + } +} +Culture.English = "en-us"; +Culture.Chinese = "zh-cn"; +Culture.Spanish = "es-es"; +Culture.Portuguese = "pt-br"; +Culture.French = "fr-fr"; +Culture.German = "de-de"; +Culture.Japanese = "ja-jp"; +Culture.Dutch = "nl-nl"; +Culture.Italian = "it-it"; +Culture.supportedCultures = [ + new Culture("English", Culture.English), + new Culture("Chinese", Culture.Chinese), + new Culture("Spanish", Culture.Spanish), + new Culture("Portuguese", Culture.Portuguese), + new Culture("French", Culture.French), + new Culture("German", Culture.German), + new Culture("Japanese", Culture.Japanese), + new Culture("Dutch", Culture.Dutch), + new Culture("Italian", Culture.Italian) +]; +exports.Culture = Culture; +class CultureInfo { + static getCultureInfo(cultureCode) { + return new CultureInfo(cultureCode); + } + constructor(cultureName) { + this.code = cultureName; + } +} +exports.CultureInfo = CultureInfo; + +}); + +unwrapExports(culture); + +var xregexp = createCommonjsModule(function (module, exports) { +"use strict"; + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.default = void 0; + +function _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _nonIterableRest(); } + +function _nonIterableRest() { throw new TypeError("Invalid attempt to destructure non-iterable instance"); } + +function _iterableToArrayLimit(arr, i) { var _arr = []; var _n = true; var _d = false; var _e = undefined; try { for (var _i = arr[Symbol.iterator](), _s; !(_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; } + +function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; } + +/*! + * XRegExp 4.2.0 + * + * Steven Levithan (c) 2007-present MIT License + */ + +/** + * XRegExp provides augmented, extensible regular expressions. You get additional regex syntax and + * flags, beyond what browsers support natively. XRegExp is also a regex utility belt with tools to + * make your client-side grepping simpler and more powerful, while freeing you from related + * cross-browser inconsistencies. + */ +// ==--------------------------== +// Private stuff +// ==--------------------------== +// Property name used for extended regex instance data +var REGEX_DATA = 'xregexp'; // Optional features that can be installed and uninstalled + +var features = { + astral: false, + namespacing: false +}; // Native methods to use and restore ('native' is an ES3 reserved keyword) + +var nativ = { + exec: RegExp.prototype.exec, + test: RegExp.prototype.test, + match: String.prototype.match, + replace: String.prototype.replace, + split: String.prototype.split +}; // Storage for fixed/extended native methods + +var fixed = {}; // Storage for regexes cached by `XRegExp.cache` + +var regexCache = {}; // Storage for pattern details cached by the `XRegExp` constructor + +var patternCache = {}; // Storage for regex syntax tokens added internally or by `XRegExp.addToken` + +var tokens = []; // Token scopes + +var defaultScope = 'default'; +var classScope = 'class'; // Regexes that match native regex syntax, including octals + +var nativeTokens = { + // Any native multicharacter token in default scope, or any single character + 'default': /\\(?:0(?:[0-3][0-7]{0,2}|[4-7][0-7]?)?|[1-9]\d*|x[\dA-Fa-f]{2}|u(?:[\dA-Fa-f]{4}|{[\dA-Fa-f]+})|c[A-Za-z]|[\s\S])|\(\?(?:[:=!]|<[=!])|[?*+]\?|{\d+(?:,\d*)?}\??|[\s\S]/, + // Any native multicharacter token in character class scope, or any single character + 'class': /\\(?:[0-3][0-7]{0,2}|[4-7][0-7]?|x[\dA-Fa-f]{2}|u(?:[\dA-Fa-f]{4}|{[\dA-Fa-f]+})|c[A-Za-z]|[\s\S])|[\s\S]/ +}; // Any backreference or dollar-prefixed character in replacement strings + +var replacementToken = /\$(?:{([\w$]+)}|<([\w$]+)>|(\d\d?|[\s\S]))/g; // Check for correct `exec` handling of nonparticipating capturing groups + +var correctExecNpcg = nativ.exec.call(/()??/, '')[1] === undefined; // Check for ES6 `flags` prop support + +var hasFlagsProp = /x/.flags !== undefined; // Shortcut to `Object.prototype.toString` + +var _ref = {}, + toString = _ref.toString; + +function hasNativeFlag(flag) { + // Can't check based on the presence of properties/getters since browsers might support such + // properties even when they don't support the corresponding flag in regex construction (tested + // in Chrome 48, where `'unicode' in /x/` is true but trying to construct a regex with flag `u` + // throws an error) + var isSupported = true; + + try { + // Can't use regex literals for testing even in a `try` because regex literals with + // unsupported flags cause a compilation error in IE + new RegExp('', flag); + } catch (exception) { + isSupported = false; + } + + return isSupported; +} // Check for ES6 `u` flag support + + +var hasNativeU = hasNativeFlag('u'); // Check for ES6 `y` flag support + +var hasNativeY = hasNativeFlag('y'); // Tracker for known flags, including addon flags + +var registeredFlags = { + g: true, + i: true, + m: true, + u: hasNativeU, + y: hasNativeY +}; +/** + * Attaches extended data and `XRegExp.prototype` properties to a regex object. + * + * @private + * @param {RegExp} regex Regex to augment. + * @param {Array} captureNames Array with capture names, or `null`. + * @param {String} xSource XRegExp pattern used to generate `regex`, or `null` if N/A. + * @param {String} xFlags XRegExp flags used to generate `regex`, or `null` if N/A. + * @param {Boolean} [isInternalOnly=false] Whether the regex will be used only for internal + * operations, and never exposed to users. For internal-only regexes, we can improve perf by + * skipping some operations like attaching `XRegExp.prototype` properties. + * @returns {RegExp} Augmented regex. + */ + +function augment(regex, captureNames, xSource, xFlags, isInternalOnly) { + regex[REGEX_DATA] = { + captureNames: captureNames + }; + + if (isInternalOnly) { + return regex; + } // Can't auto-inherit these since the XRegExp constructor returns a nonprimitive value + + + if (regex.__proto__) { + regex.__proto__ = XRegExp.prototype; + } else { + for (var p in XRegExp.prototype) { + // An `XRegExp.prototype.hasOwnProperty(p)` check wouldn't be worth it here, since this + // is performance sensitive, and enumerable `Object.prototype` or `RegExp.prototype` + // extensions exist on `regex.prototype` anyway + regex[p] = XRegExp.prototype[p]; + } + } + + regex[REGEX_DATA].source = xSource; // Emulate the ES6 `flags` prop by ensuring flags are in alphabetical order + + regex[REGEX_DATA].flags = xFlags ? xFlags.split('').sort().join('') : xFlags; + return regex; +} +/** + * Removes any duplicate characters from the provided string. + * + * @private + * @param {String} str String to remove duplicate characters from. + * @returns {String} String with any duplicate characters removed. + */ + + +function clipDuplicates(str) { + return nativ.replace.call(str, /([\s\S])(?=[\s\S]*\1)/g, ''); +} +/** + * Copies a regex object while preserving extended data and augmenting with `XRegExp.prototype` + * properties. The copy has a fresh `lastIndex` property (set to zero). Allows adding and removing + * flags g and y while copying the regex. + * + * @private + * @param {RegExp} regex Regex to copy. + * @param {Object} [options] Options object with optional properties: + * - `addG` {Boolean} Add flag g while copying the regex. + * - `addY` {Boolean} Add flag y while copying the regex. + * - `removeG` {Boolean} Remove flag g while copying the regex. + * - `removeY` {Boolean} Remove flag y while copying the regex. + * - `isInternalOnly` {Boolean} Whether the copied regex will be used only for internal + * operations, and never exposed to users. For internal-only regexes, we can improve perf by + * skipping some operations like attaching `XRegExp.prototype` properties. + * - `source` {String} Overrides `.source`, for special cases. + * @returns {RegExp} Copy of the provided regex, possibly with modified flags. + */ + + +function copyRegex(regex, options) { + if (!XRegExp.isRegExp(regex)) { + throw new TypeError('Type RegExp expected'); + } + + var xData = regex[REGEX_DATA] || {}; + var flags = getNativeFlags(regex); + var flagsToAdd = ''; + var flagsToRemove = ''; + var xregexpSource = null; + var xregexpFlags = null; + options = options || {}; + + if (options.removeG) { + flagsToRemove += 'g'; + } + + if (options.removeY) { + flagsToRemove += 'y'; + } + + if (flagsToRemove) { + flags = nativ.replace.call(flags, new RegExp("[".concat(flagsToRemove, "]+"), 'g'), ''); + } + + if (options.addG) { + flagsToAdd += 'g'; + } + + if (options.addY) { + flagsToAdd += 'y'; + } + + if (flagsToAdd) { + flags = clipDuplicates(flags + flagsToAdd); + } + + if (!options.isInternalOnly) { + if (xData.source !== undefined) { + xregexpSource = xData.source; + } // null or undefined; don't want to add to `flags` if the previous value was null, since + // that indicates we're not tracking original precompilation flags + + + if (xData.flags != null) { + // Flags are only added for non-internal regexes by `XRegExp.globalize`. Flags are never + // removed for non-internal regexes, so don't need to handle it + xregexpFlags = flagsToAdd ? clipDuplicates(xData.flags + flagsToAdd) : xData.flags; + } + } // Augment with `XRegExp.prototype` properties, but use the native `RegExp` constructor to avoid + // searching for special tokens. That would be wrong for regexes constructed by `RegExp`, and + // unnecessary for regexes constructed by `XRegExp` because the regex has already undergone the + // translation to native regex syntax + + + regex = augment(new RegExp(options.source || regex.source, flags), hasNamedCapture(regex) ? xData.captureNames.slice(0) : null, xregexpSource, xregexpFlags, options.isInternalOnly); + return regex; +} +/** + * Converts hexadecimal to decimal. + * + * @private + * @param {String} hex + * @returns {Number} + */ + + +function dec(hex) { + return parseInt(hex, 16); +} +/** + * Returns a pattern that can be used in a native RegExp in place of an ignorable token such as an + * inline comment or whitespace with flag x. This is used directly as a token handler function + * passed to `XRegExp.addToken`. + * + * @private + * @param {String} match Match arg of `XRegExp.addToken` handler + * @param {String} scope Scope arg of `XRegExp.addToken` handler + * @param {String} flags Flags arg of `XRegExp.addToken` handler + * @returns {String} Either '' or '(?:)', depending on which is needed in the context of the match. + */ + + +function getContextualTokenSeparator(match, scope, flags) { + if ( // No need to separate tokens if at the beginning or end of a group + match.input[match.index - 1] === '(' || match.input[match.index + match[0].length] === ')' || // No need to separate tokens if before or after a `|` + match.input[match.index - 1] === '|' || match.input[match.index + match[0].length] === '|' || // No need to separate tokens if at the beginning or end of the pattern + match.index < 1 || match.index + match[0].length >= match.input.length || // No need to separate tokens if at the beginning of a noncapturing group or lookahead. + // The way this is written relies on: + // - The search regex matching only 3-char strings. + // - Although `substr` gives chars from the end of the string if given a negative index, + // the resulting substring will be too short to match. Ex: `'abcd'.substr(-1, 3) === 'd'` + nativ.test.call(/^\(\?[:=!]/, match.input.substr(match.index - 3, 3)) || // Avoid separating tokens when the following token is a quantifier + isQuantifierNext(match.input, match.index + match[0].length, flags)) { + return ''; + } // Keep tokens separated. This avoids e.g. inadvertedly changing `\1 1` or `\1(?#)1` to `\11`. + // This also ensures all tokens remain as discrete atoms, e.g. it avoids converting the syntax + // error `(? :` into `(?:`. + + + return '(?:)'; +} +/** + * Returns native `RegExp` flags used by a regex object. + * + * @private + * @param {RegExp} regex Regex to check. + * @returns {String} Native flags in use. + */ + + +function getNativeFlags(regex) { + return hasFlagsProp ? regex.flags : // Explicitly using `RegExp.prototype.toString` (rather than e.g. `String` or concatenation + // with an empty string) allows this to continue working predictably when + // `XRegExp.proptotype.toString` is overridden + nativ.exec.call(/\/([a-z]*)$/i, RegExp.prototype.toString.call(regex))[1]; +} +/** + * Determines whether a regex has extended instance data used to track capture names. + * + * @private + * @param {RegExp} regex Regex to check. + * @returns {Boolean} Whether the regex uses named capture. + */ + + +function hasNamedCapture(regex) { + return !!(regex[REGEX_DATA] && regex[REGEX_DATA].captureNames); +} +/** + * Converts decimal to hexadecimal. + * + * @private + * @param {Number|String} dec + * @returns {String} + */ + + +function hex(dec) { + return parseInt(dec, 10).toString(16); +} +/** + * Checks whether the next nonignorable token after the specified position is a quantifier. + * + * @private + * @param {String} pattern Pattern to search within. + * @param {Number} pos Index in `pattern` to search at. + * @param {String} flags Flags used by the pattern. + * @returns {Boolean} Whether the next nonignorable token is a quantifier. + */ + + +function isQuantifierNext(pattern, pos, flags) { + return nativ.test.call(flags.indexOf('x') !== -1 ? // Ignore any leading whitespace, line comments, and inline comments + /^(?:\s|#[^#\n]*|\(\?#[^)]*\))*(?:[?*+]|{\d+(?:,\d*)?})/ : // Ignore any leading inline comments + /^(?:\(\?#[^)]*\))*(?:[?*+]|{\d+(?:,\d*)?})/, pattern.slice(pos)); +} +/** + * Determines whether a value is of the specified type, by resolving its internal [[Class]]. + * + * @private + * @param {*} value Object to check. + * @param {String} type Type to check for, in TitleCase. + * @returns {Boolean} Whether the object matches the type. + */ + + +function isType(value, type) { + return toString.call(value) === "[object ".concat(type, "]"); +} +/** + * Adds leading zeros if shorter than four characters. Used for fixed-length hexadecimal values. + * + * @private + * @param {String} str + * @returns {String} + */ + + +function pad4(str) { + while (str.length < 4) { + str = "0".concat(str); + } + + return str; +} +/** + * Checks for flag-related errors, and strips/applies flags in a leading mode modifier. Offloads + * the flag preparation logic from the `XRegExp` constructor. + * + * @private + * @param {String} pattern Regex pattern, possibly with a leading mode modifier. + * @param {String} flags Any combination of flags. + * @returns {Object} Object with properties `pattern` and `flags`. + */ + + +function prepareFlags(pattern, flags) { + // Recent browsers throw on duplicate flags, so copy this behavior for nonnative flags + if (clipDuplicates(flags) !== flags) { + throw new SyntaxError("Invalid duplicate regex flag ".concat(flags)); + } // Strip and apply a leading mode modifier with any combination of flags except g or y + + + pattern = nativ.replace.call(pattern, /^\(\?([\w$]+)\)/, function ($0, $1) { + if (nativ.test.call(/[gy]/, $1)) { + throw new SyntaxError("Cannot use flag g or y in mode modifier ".concat($0)); + } // Allow duplicate flags within the mode modifier + + + flags = clipDuplicates(flags + $1); + return ''; + }); // Throw on unknown native or nonnative flags + + var _iteratorNormalCompletion = true; + var _didIteratorError = false; + var _iteratorError = undefined; + + try { + for (var _iterator = flags[Symbol.iterator](), _step; !(_iteratorNormalCompletion = (_step = _iterator.next()).done); _iteratorNormalCompletion = true) { + var flag = _step.value; + + if (!registeredFlags[flag]) { + throw new SyntaxError("Unknown regex flag ".concat(flag)); + } + } + } catch (err) { + _didIteratorError = true; + _iteratorError = err; + } finally { + try { + if (!_iteratorNormalCompletion && _iterator.return != null) { + _iterator.return(); + } + } finally { + if (_didIteratorError) { + throw _iteratorError; + } + } + } + + return { + pattern: pattern, + flags: flags + }; +} +/** + * Prepares an options object from the given value. + * + * @private + * @param {String|Object} value Value to convert to an options object. + * @returns {Object} Options object. + */ + + +function prepareOptions(value) { + var options = {}; + + if (isType(value, 'String')) { + XRegExp.forEach(value, /[^\s,]+/, function (match) { + options[match] = true; + }); + return options; + } + + return value; +} +/** + * Registers a flag so it doesn't throw an 'unknown flag' error. + * + * @private + * @param {String} flag Single-character flag to register. + */ + + +function registerFlag(flag) { + if (!/^[\w$]$/.test(flag)) { + throw new Error('Flag must be a single character A-Za-z0-9_$'); + } + + registeredFlags[flag] = true; +} +/** + * Runs built-in and custom regex syntax tokens in reverse insertion order at the specified + * position, until a match is found. + * + * @private + * @param {String} pattern Original pattern from which an XRegExp object is being built. + * @param {String} flags Flags being used to construct the regex. + * @param {Number} pos Position to search for tokens within `pattern`. + * @param {Number} scope Regex scope to apply: 'default' or 'class'. + * @param {Object} context Context object to use for token handler functions. + * @returns {Object} Object with properties `matchLength`, `output`, and `reparse`; or `null`. + */ + + +function runTokens(pattern, flags, pos, scope, context) { + var i = tokens.length; + var leadChar = pattern[pos]; + var result = null; + var match; + var t; // Run in reverse insertion order + + while (i--) { + t = tokens[i]; + + if (t.leadChar && t.leadChar !== leadChar || t.scope !== scope && t.scope !== 'all' || t.flag && !(flags.indexOf(t.flag) !== -1)) { + continue; + } + + match = XRegExp.exec(pattern, t.regex, pos, 'sticky'); + + if (match) { + result = { + matchLength: match[0].length, + output: t.handler.call(context, match, scope, flags), + reparse: t.reparse + }; // Finished with token tests + + break; + } + } + + return result; +} +/** + * Enables or disables implicit astral mode opt-in. When enabled, flag A is automatically added to + * all new regexes created by XRegExp. This causes an error to be thrown when creating regexes if + * the Unicode Base addon is not available, since flag A is registered by that addon. + * + * @private + * @param {Boolean} on `true` to enable; `false` to disable. + */ + + +function setAstral(on) { + features.astral = on; +} +/** + * Adds named capture groups to the `groups` property of match arrays. See here for details: + * https://github.com/tc39/proposal-regexp-named-groups + * + * @private + * @param {Boolean} on `true` to enable; `false` to disable. + */ + + +function setNamespacing(on) { + features.namespacing = on; +} +/** + * Returns the object, or throws an error if it is `null` or `undefined`. This is used to follow + * the ES5 abstract operation `ToObject`. + * + * @private + * @param {*} value Object to check and return. + * @returns {*} The provided object. + */ + + +function toObject(value) { + // null or undefined + if (value == null) { + throw new TypeError('Cannot convert null or undefined to object'); + } + + return value; +} // ==--------------------------== +// Constructor +// ==--------------------------== + +/** + * Creates an extended regular expression object for matching text with a pattern. Differs from a + * native regular expression in that additional syntax and flags are supported. The returned object + * is in fact a native `RegExp` and works with all native methods. + * + * @class XRegExp + * @constructor + * @param {String|RegExp} pattern Regex pattern string, or an existing regex object to copy. + * @param {String} [flags] Any combination of flags. + * Native flags: + * - `g` - global + * - `i` - ignore case + * - `m` - multiline anchors + * - `u` - unicode (ES6) + * - `y` - sticky (Firefox 3+, ES6) + * Additional XRegExp flags: + * - `n` - explicit capture + * - `s` - dot matches all (aka singleline) + * - `x` - free-spacing and line comments (aka extended) + * - `A` - astral (requires the Unicode Base addon) + * Flags cannot be provided when constructing one `RegExp` from another. + * @returns {RegExp} Extended regular expression object. + * @example + * + * // With named capture and flag x + * XRegExp(`(? [0-9]{4} ) -? # year + * (? [0-9]{2} ) -? # month + * (? [0-9]{2} ) # day`, 'x'); + * + * // Providing a regex object copies it. Native regexes are recompiled using native (not XRegExp) + * // syntax. Copies maintain extended data, are augmented with `XRegExp.prototype` properties, and + * // have fresh `lastIndex` properties (set to zero). + * XRegExp(/regex/); + */ + + +function XRegExp(pattern, flags) { + if (XRegExp.isRegExp(pattern)) { + if (flags !== undefined) { + throw new TypeError('Cannot supply flags when copying a RegExp'); + } + + return copyRegex(pattern); + } // Copy the argument behavior of `RegExp` + + + pattern = pattern === undefined ? '' : String(pattern); + flags = flags === undefined ? '' : String(flags); + + if (XRegExp.isInstalled('astral') && !(flags.indexOf('A') !== -1)) { + // This causes an error to be thrown if the Unicode Base addon is not available + flags += 'A'; + } + + if (!patternCache[pattern]) { + patternCache[pattern] = {}; + } + + if (!patternCache[pattern][flags]) { + var context = { + hasNamedCapture: false, + captureNames: [] + }; + var scope = defaultScope; + var output = ''; + var pos = 0; + var result; // Check for flag-related errors, and strip/apply flags in a leading mode modifier + + var applied = prepareFlags(pattern, flags); + var appliedPattern = applied.pattern; + var appliedFlags = applied.flags; // Use XRegExp's tokens to translate the pattern to a native regex pattern. + // `appliedPattern.length` may change on each iteration if tokens use `reparse` + + while (pos < appliedPattern.length) { + do { + // Check for custom tokens at the current position + result = runTokens(appliedPattern, appliedFlags, pos, scope, context); // If the matched token used the `reparse` option, splice its output into the + // pattern before running tokens again at the same position + + if (result && result.reparse) { + appliedPattern = appliedPattern.slice(0, pos) + result.output + appliedPattern.slice(pos + result.matchLength); + } + } while (result && result.reparse); + + if (result) { + output += result.output; + pos += result.matchLength || 1; + } else { + // Get the native token at the current position + var _XRegExp$exec = XRegExp.exec(appliedPattern, nativeTokens[scope], pos, 'sticky'), + _XRegExp$exec2 = _slicedToArray(_XRegExp$exec, 1), + token = _XRegExp$exec2[0]; + + output += token; + pos += token.length; + + if (token === '[' && scope === defaultScope) { + scope = classScope; + } else if (token === ']' && scope === classScope) { + scope = defaultScope; + } + } + } + + patternCache[pattern][flags] = { + // Use basic cleanup to collapse repeated empty groups like `(?:)(?:)` to `(?:)`. Empty + // groups are sometimes inserted during regex transpilation in order to keep tokens + // separated. However, more than one empty group in a row is never needed. + pattern: nativ.replace.call(output, /(?:\(\?:\))+/g, '(?:)'), + // Strip all but native flags + flags: nativ.replace.call(appliedFlags, /[^gimuy]+/g, ''), + // `context.captureNames` has an item for each capturing group, even if unnamed + captures: context.hasNamedCapture ? context.captureNames : null + }; + } + + var generated = patternCache[pattern][flags]; + return augment(new RegExp(generated.pattern, generated.flags), generated.captures, pattern, flags); +} // Add `RegExp.prototype` to the prototype chain + + +XRegExp.prototype = /(?:)/; // ==--------------------------== +// Public properties +// ==--------------------------== + +/** + * The XRegExp version number as a string containing three dot-separated parts. For example, + * '2.0.0-beta-3'. + * + * @static + * @memberOf XRegExp + * @type String + */ + +XRegExp.version = '4.2.0'; // ==--------------------------== +// Public methods +// ==--------------------------== +// Intentionally undocumented; used in tests and addons + +XRegExp._clipDuplicates = clipDuplicates; +XRegExp._hasNativeFlag = hasNativeFlag; +XRegExp._dec = dec; +XRegExp._hex = hex; +XRegExp._pad4 = pad4; +/** + * Extends XRegExp syntax and allows custom flags. This is used internally and can be used to + * create XRegExp addons. If more than one token can match the same string, the last added wins. + * + * @memberOf XRegExp + * @param {RegExp} regex Regex object that matches the new token. + * @param {Function} handler Function that returns a new pattern string (using native regex syntax) + * to replace the matched token within all future XRegExp regexes. Has access to persistent + * properties of the regex being built, through `this`. Invoked with three arguments: + * - The match array, with named backreference properties. + * - The regex scope where the match was found: 'default' or 'class'. + * - The flags used by the regex, including any flags in a leading mode modifier. + * The handler function becomes part of the XRegExp construction process, so be careful not to + * construct XRegExps within the function or you will trigger infinite recursion. + * @param {Object} [options] Options object with optional properties: + * - `scope` {String} Scope where the token applies: 'default', 'class', or 'all'. + * - `flag` {String} Single-character flag that triggers the token. This also registers the + * flag, which prevents XRegExp from throwing an 'unknown flag' error when the flag is used. + * - `optionalFlags` {String} Any custom flags checked for within the token `handler` that are + * not required to trigger the token. This registers the flags, to prevent XRegExp from + * throwing an 'unknown flag' error when any of the flags are used. + * - `reparse` {Boolean} Whether the `handler` function's output should not be treated as + * final, and instead be reparseable by other tokens (including the current token). Allows + * token chaining or deferring. + * - `leadChar` {String} Single character that occurs at the beginning of any successful match + * of the token (not always applicable). This doesn't change the behavior of the token unless + * you provide an erroneous value. However, providing it can increase the token's performance + * since the token can be skipped at any positions where this character doesn't appear. + * @example + * + * // Basic usage: Add \a for the ALERT control code + * XRegExp.addToken( + * /\\a/, + * () => '\\x07', + * {scope: 'all'} + * ); + * XRegExp('\\a[\\a-\\n]+').test('\x07\n\x07'); // -> true + * + * // Add the U (ungreedy) flag from PCRE and RE2, which reverses greedy and lazy quantifiers. + * // Since `scope` is not specified, it uses 'default' (i.e., transformations apply outside of + * // character classes only) + * XRegExp.addToken( + * /([?*+]|{\d+(?:,\d*)?})(\??)/, + * (match) => `${match[1]}${match[2] ? '' : '?'}`, + * {flag: 'U'} + * ); + * XRegExp('a+', 'U').exec('aaa')[0]; // -> 'a' + * XRegExp('a+?', 'U').exec('aaa')[0]; // -> 'aaa' + */ + +XRegExp.addToken = function (regex, handler, options) { + options = options || {}; + var _options = options, + optionalFlags = _options.optionalFlags; + + if (options.flag) { + registerFlag(options.flag); + } + + if (optionalFlags) { + optionalFlags = nativ.split.call(optionalFlags, ''); + var _iteratorNormalCompletion2 = true; + var _didIteratorError2 = false; + var _iteratorError2 = undefined; + + try { + for (var _iterator2 = optionalFlags[Symbol.iterator](), _step2; !(_iteratorNormalCompletion2 = (_step2 = _iterator2.next()).done); _iteratorNormalCompletion2 = true) { + var flag = _step2.value; + registerFlag(flag); + } + } catch (err) { + _didIteratorError2 = true; + _iteratorError2 = err; + } finally { + try { + if (!_iteratorNormalCompletion2 && _iterator2.return != null) { + _iterator2.return(); + } + } finally { + if (_didIteratorError2) { + throw _iteratorError2; + } + } + } + } // Add to the private list of syntax tokens + + + tokens.push({ + regex: copyRegex(regex, { + addG: true, + addY: hasNativeY, + isInternalOnly: true + }), + handler: handler, + scope: options.scope || defaultScope, + flag: options.flag, + reparse: options.reparse, + leadChar: options.leadChar + }); // Reset the pattern cache used by the `XRegExp` constructor, since the same pattern and flags + // might now produce different results + + XRegExp.cache.flush('patterns'); +}; +/** + * Caches and returns the result of calling `XRegExp(pattern, flags)`. On any subsequent call with + * the same pattern and flag combination, the cached copy of the regex is returned. + * + * @memberOf XRegExp + * @param {String} pattern Regex pattern string. + * @param {String} [flags] Any combination of XRegExp flags. + * @returns {RegExp} Cached XRegExp object. + * @example + * + * while (match = XRegExp.cache('.', 'gs').exec(str)) { + * // The regex is compiled once only + * } + */ + + +XRegExp.cache = function (pattern, flags) { + if (!regexCache[pattern]) { + regexCache[pattern] = {}; + } + + return regexCache[pattern][flags] || (regexCache[pattern][flags] = XRegExp(pattern, flags)); +}; // Intentionally undocumented; used in tests + + +XRegExp.cache.flush = function (cacheName) { + if (cacheName === 'patterns') { + // Flush the pattern cache used by the `XRegExp` constructor + patternCache = {}; + } else { + // Flush the regex cache populated by `XRegExp.cache` + regexCache = {}; + } +}; +/** + * Escapes any regular expression metacharacters, for use when matching literal strings. The result + * can safely be used at any point within a regex that uses any flags. + * + * @memberOf XRegExp + * @param {String} str String to escape. + * @returns {String} String with regex metacharacters escaped. + * @example + * + * XRegExp.escape('Escaped? <.>'); + * // -> 'Escaped\?\ <\.>' + */ + + +XRegExp.escape = function (str) { + return nativ.replace.call(toObject(str), /[-\[\]{}()*+?.,\\^$|#\s]/g, '\\$&'); +}; +/** + * Executes a regex search in a specified string. Returns a match array or `null`. If the provided + * regex uses named capture, named backreference properties are included on the match array. + * Optional `pos` and `sticky` arguments specify the search start position, and whether the match + * must start at the specified position only. The `lastIndex` property of the provided regex is not + * used, but is updated for compatibility. Also fixes browser bugs compared to the native + * `RegExp.prototype.exec` and can be used reliably cross-browser. + * + * @memberOf XRegExp + * @param {String} str String to search. + * @param {RegExp} regex Regex to search with. + * @param {Number} [pos=0] Zero-based index at which to start the search. + * @param {Boolean|String} [sticky=false] Whether the match must start at the specified position + * only. The string `'sticky'` is accepted as an alternative to `true`. + * @returns {Array} Match array with named backreference properties, or `null`. + * @example + * + * // Basic use, with named backreference + * let match = XRegExp.exec('U+2620', XRegExp('U\\+(?[0-9A-F]{4})')); + * match.hex; // -> '2620' + * + * // With pos and sticky, in a loop + * let pos = 2, result = [], match; + * while (match = XRegExp.exec('<1><2><3><4>5<6>', /<(\d)>/, pos, 'sticky')) { + * result.push(match[1]); + * pos = match.index + match[0].length; + * } + * // result -> ['2', '3', '4'] + */ + + +XRegExp.exec = function (str, regex, pos, sticky) { + var cacheKey = 'g'; + var addY = false; + var fakeY = false; + var match; + addY = hasNativeY && !!(sticky || regex.sticky && sticky !== false); + + if (addY) { + cacheKey += 'y'; + } else if (sticky) { + // Simulate sticky matching by appending an empty capture to the original regex. The + // resulting regex will succeed no matter what at the current index (set with `lastIndex`), + // and will not search the rest of the subject string. We'll know that the original regex + // has failed if that last capture is `''` rather than `undefined` (i.e., if that last + // capture participated in the match). + fakeY = true; + cacheKey += 'FakeY'; + } + + regex[REGEX_DATA] = regex[REGEX_DATA] || {}; // Shares cached copies with `XRegExp.match`/`replace` + + var r2 = regex[REGEX_DATA][cacheKey] || (regex[REGEX_DATA][cacheKey] = copyRegex(regex, { + addG: true, + addY: addY, + source: fakeY ? "".concat(regex.source, "|()") : undefined, + removeY: sticky === false, + isInternalOnly: true + })); + pos = pos || 0; + r2.lastIndex = pos; // Fixed `exec` required for `lastIndex` fix, named backreferences, etc. + + match = fixed.exec.call(r2, str); // Get rid of the capture added by the pseudo-sticky matcher if needed. An empty string means + // the original regexp failed (see above). + + if (fakeY && match && match.pop() === '') { + match = null; + } + + if (regex.global) { + regex.lastIndex = match ? r2.lastIndex : 0; + } + + return match; +}; +/** + * Executes a provided function once per regex match. Searches always start at the beginning of the + * string and continue until the end, regardless of the state of the regex's `global` property and + * initial `lastIndex`. + * + * @memberOf XRegExp + * @param {String} str String to search. + * @param {RegExp} regex Regex to search with. + * @param {Function} callback Function to execute for each match. Invoked with four arguments: + * - The match array, with named backreference properties. + * - The zero-based match index. + * - The string being traversed. + * - The regex object being used to traverse the string. + * @example + * + * // Extracts every other digit from a string + * const evens = []; + * XRegExp.forEach('1a2345', /\d/, (match, i) => { + * if (i % 2) evens.push(+match[0]); + * }); + * // evens -> [2, 4] + */ + + +XRegExp.forEach = function (str, regex, callback) { + var pos = 0; + var i = -1; + var match; + + while (match = XRegExp.exec(str, regex, pos)) { + // Because `regex` is provided to `callback`, the function could use the deprecated/ + // nonstandard `RegExp.prototype.compile` to mutate the regex. However, since `XRegExp.exec` + // doesn't use `lastIndex` to set the search position, this can't lead to an infinite loop, + // at least. Actually, because of the way `XRegExp.exec` caches globalized versions of + // regexes, mutating the regex will not have any effect on the iteration or matched strings, + // which is a nice side effect that brings extra safety. + callback(match, ++i, str, regex); + pos = match.index + (match[0].length || 1); + } +}; +/** + * Copies a regex object and adds flag `g`. The copy maintains extended data, is augmented with + * `XRegExp.prototype` properties, and has a fresh `lastIndex` property (set to zero). Native + * regexes are not recompiled using XRegExp syntax. + * + * @memberOf XRegExp + * @param {RegExp} regex Regex to globalize. + * @returns {RegExp} Copy of the provided regex with flag `g` added. + * @example + * + * const globalCopy = XRegExp.globalize(/regex/); + * globalCopy.global; // -> true + */ + + +XRegExp.globalize = function (regex) { + return copyRegex(regex, { + addG: true + }); +}; +/** + * Installs optional features according to the specified options. Can be undone using + * `XRegExp.uninstall`. + * + * @memberOf XRegExp + * @param {Object|String} options Options object or string. + * @example + * + * // With an options object + * XRegExp.install({ + * // Enables support for astral code points in Unicode addons (implicitly sets flag A) + * astral: true, + * + * // Adds named capture groups to the `groups` property of matches + * namespacing: true + * }); + * + * // With an options string + * XRegExp.install('astral namespacing'); + */ + + +XRegExp.install = function (options) { + options = prepareOptions(options); + + if (!features.astral && options.astral) { + setAstral(true); + } + + if (!features.namespacing && options.namespacing) { + setNamespacing(true); + } +}; +/** + * Checks whether an individual optional feature is installed. + * + * @memberOf XRegExp + * @param {String} feature Name of the feature to check. One of: + * - `astral` + * - `namespacing` + * @returns {Boolean} Whether the feature is installed. + * @example + * + * XRegExp.isInstalled('astral'); + */ + + +XRegExp.isInstalled = function (feature) { + return !!features[feature]; +}; +/** + * Returns `true` if an object is a regex; `false` if it isn't. This works correctly for regexes + * created in another frame, when `instanceof` and `constructor` checks would fail. + * + * @memberOf XRegExp + * @param {*} value Object to check. + * @returns {Boolean} Whether the object is a `RegExp` object. + * @example + * + * XRegExp.isRegExp('string'); // -> false + * XRegExp.isRegExp(/regex/i); // -> true + * XRegExp.isRegExp(RegExp('^', 'm')); // -> true + * XRegExp.isRegExp(XRegExp('(?s).')); // -> true + */ + + +XRegExp.isRegExp = function (value) { + return toString.call(value) === '[object RegExp]'; +}; // isType(value, 'RegExp'); + +/** + * Returns the first matched string, or in global mode, an array containing all matched strings. + * This is essentially a more convenient re-implementation of `String.prototype.match` that gives + * the result types you actually want (string instead of `exec`-style array in match-first mode, + * and an empty array instead of `null` when no matches are found in match-all mode). It also lets + * you override flag g and ignore `lastIndex`, and fixes browser bugs. + * + * @memberOf XRegExp + * @param {String} str String to search. + * @param {RegExp} regex Regex to search with. + * @param {String} [scope='one'] Use 'one' to return the first match as a string. Use 'all' to + * return an array of all matched strings. If not explicitly specified and `regex` uses flag g, + * `scope` is 'all'. + * @returns {String|Array} In match-first mode: First match as a string, or `null`. In match-all + * mode: Array of all matched strings, or an empty array. + * @example + * + * // Match first + * XRegExp.match('abc', /\w/); // -> 'a' + * XRegExp.match('abc', /\w/g, 'one'); // -> 'a' + * XRegExp.match('abc', /x/g, 'one'); // -> null + * + * // Match all + * XRegExp.match('abc', /\w/g); // -> ['a', 'b', 'c'] + * XRegExp.match('abc', /\w/, 'all'); // -> ['a', 'b', 'c'] + * XRegExp.match('abc', /x/, 'all'); // -> [] + */ + + +XRegExp.match = function (str, regex, scope) { + var global = regex.global && scope !== 'one' || scope === 'all'; + var cacheKey = (global ? 'g' : '') + (regex.sticky ? 'y' : '') || 'noGY'; + regex[REGEX_DATA] = regex[REGEX_DATA] || {}; // Shares cached copies with `XRegExp.exec`/`replace` + + var r2 = regex[REGEX_DATA][cacheKey] || (regex[REGEX_DATA][cacheKey] = copyRegex(regex, { + addG: !!global, + removeG: scope === 'one', + isInternalOnly: true + })); + var result = nativ.match.call(toObject(str), r2); + + if (regex.global) { + regex.lastIndex = scope === 'one' && result ? // Can't use `r2.lastIndex` since `r2` is nonglobal in this case + result.index + result[0].length : 0; + } + + return global ? result || [] : result && result[0]; +}; +/** + * Retrieves the matches from searching a string using a chain of regexes that successively search + * within previous matches. The provided `chain` array can contain regexes and or objects with + * `regex` and `backref` properties. When a backreference is specified, the named or numbered + * backreference is passed forward to the next regex or returned. + * + * @memberOf XRegExp + * @param {String} str String to search. + * @param {Array} chain Regexes that each search for matches within preceding results. + * @returns {Array} Matches by the last regex in the chain, or an empty array. + * @example + * + * // Basic usage; matches numbers within tags + * XRegExp.matchChain('1 2 3 4 a 56', [ + * XRegExp('(?is).*?'), + * /\d+/ + * ]); + * // -> ['2', '4', '56'] + * + * // Passing forward and returning specific backreferences + * html = '
XRegExp\ + * Google'; + * XRegExp.matchChain(html, [ + * {regex: //i, backref: 1}, + * {regex: XRegExp('(?i)^https?://(?[^/?#]+)'), backref: 'domain'} + * ]); + * // -> ['xregexp.com', 'www.google.com'] + */ + + +XRegExp.matchChain = function (str, chain) { + return function recurseChain(values, level) { + var item = chain[level].regex ? chain[level] : { + regex: chain[level] + }; + var matches = []; + + function addMatch(match) { + if (item.backref) { + var ERR_UNDEFINED_GROUP = "Backreference to undefined group: ".concat(item.backref); + var isNamedBackref = isNaN(item.backref); + + if (isNamedBackref && XRegExp.isInstalled('namespacing')) { + // `groups` has `null` as prototype, so using `in` instead of `hasOwnProperty` + if (!(item.backref in match.groups)) { + throw new ReferenceError(ERR_UNDEFINED_GROUP); + } + } else if (!match.hasOwnProperty(item.backref)) { + throw new ReferenceError(ERR_UNDEFINED_GROUP); + } + + var backrefValue = isNamedBackref && XRegExp.isInstalled('namespacing') ? match.groups[item.backref] : match[item.backref]; + matches.push(backrefValue || ''); + } else { + matches.push(match[0]); + } + } + + var _iteratorNormalCompletion3 = true; + var _didIteratorError3 = false; + var _iteratorError3 = undefined; + + try { + for (var _iterator3 = values[Symbol.iterator](), _step3; !(_iteratorNormalCompletion3 = (_step3 = _iterator3.next()).done); _iteratorNormalCompletion3 = true) { + var value = _step3.value; + XRegExp.forEach(value, item.regex, addMatch); + } + } catch (err) { + _didIteratorError3 = true; + _iteratorError3 = err; + } finally { + try { + if (!_iteratorNormalCompletion3 && _iterator3.return != null) { + _iterator3.return(); + } + } finally { + if (_didIteratorError3) { + throw _iteratorError3; + } + } + } + + return level === chain.length - 1 || !matches.length ? matches : recurseChain(matches, level + 1); + }([str], 0); +}; +/** + * Returns a new string with one or all matches of a pattern replaced. The pattern can be a string + * or regex, and the replacement can be a string or a function to be called for each match. To + * perform a global search and replace, use the optional `scope` argument or include flag g if using + * a regex. Replacement strings can use `${n}` or `$` for named and numbered backreferences. + * Replacement functions can use named backreferences via `arguments[0].name`. Also fixes browser + * bugs compared to the native `String.prototype.replace` and can be used reliably cross-browser. + * + * @memberOf XRegExp + * @param {String} str String to search. + * @param {RegExp|String} search Search pattern to be replaced. + * @param {String|Function} replacement Replacement string or a function invoked to create it. + * Replacement strings can include special replacement syntax: + * - $$ - Inserts a literal $ character. + * - $&, $0 - Inserts the matched substring. + * - $` - Inserts the string that precedes the matched substring (left context). + * - $' - Inserts the string that follows the matched substring (right context). + * - $n, $nn - Where n/nn are digits referencing an existent capturing group, inserts + * backreference n/nn. + * - ${n}, $ - Where n is a name or any number of digits that reference an existent capturing + * group, inserts backreference n. + * Replacement functions are invoked with three or more arguments: + * - The matched substring (corresponds to $& above). Named backreferences are accessible as + * properties of this first argument. + * - 0..n arguments, one for each backreference (corresponding to $1, $2, etc. above). + * - The zero-based index of the match within the total search string. + * - The total string being searched. + * @param {String} [scope='one'] Use 'one' to replace the first match only, or 'all'. If not + * explicitly specified and using a regex with flag g, `scope` is 'all'. + * @returns {String} New string with one or all matches replaced. + * @example + * + * // Regex search, using named backreferences in replacement string + * const name = XRegExp('(?\\w+) (?\\w+)'); + * XRegExp.replace('John Smith', name, '$, $'); + * // -> 'Smith, John' + * + * // Regex search, using named backreferences in replacement function + * XRegExp.replace('John Smith', name, (match) => `${match.last}, ${match.first}`); + * // -> 'Smith, John' + * + * // String search, with replace-all + * XRegExp.replace('RegExp builds RegExps', 'RegExp', 'XRegExp', 'all'); + * // -> 'XRegExp builds XRegExps' + */ + + +XRegExp.replace = function (str, search, replacement, scope) { + var isRegex = XRegExp.isRegExp(search); + var global = search.global && scope !== 'one' || scope === 'all'; + var cacheKey = (global ? 'g' : '') + (search.sticky ? 'y' : '') || 'noGY'; + var s2 = search; + + if (isRegex) { + search[REGEX_DATA] = search[REGEX_DATA] || {}; // Shares cached copies with `XRegExp.exec`/`match`. Since a copy is used, `search`'s + // `lastIndex` isn't updated *during* replacement iterations + + s2 = search[REGEX_DATA][cacheKey] || (search[REGEX_DATA][cacheKey] = copyRegex(search, { + addG: !!global, + removeG: scope === 'one', + isInternalOnly: true + })); + } else if (global) { + s2 = new RegExp(XRegExp.escape(String(search)), 'g'); + } // Fixed `replace` required for named backreferences, etc. + + + var result = fixed.replace.call(toObject(str), s2, replacement); + + if (isRegex && search.global) { + // Fixes IE, Safari bug (last tested IE 9, Safari 5.1) + search.lastIndex = 0; + } + + return result; +}; +/** + * Performs batch processing of string replacements. Used like `XRegExp.replace`, but accepts an + * array of replacement details. Later replacements operate on the output of earlier replacements. + * Replacement details are accepted as an array with a regex or string to search for, the + * replacement string or function, and an optional scope of 'one' or 'all'. Uses the XRegExp + * replacement text syntax, which supports named backreference properties via `${name}` or + * `$`. + * + * @memberOf XRegExp + * @param {String} str String to search. + * @param {Array} replacements Array of replacement detail arrays. + * @returns {String} New string with all replacements. + * @example + * + * str = XRegExp.replaceEach(str, [ + * [XRegExp('(?a)'), 'z${name}'], + * [/b/gi, 'y'], + * [/c/g, 'x', 'one'], // scope 'one' overrides /g + * [/d/, 'w', 'all'], // scope 'all' overrides lack of /g + * ['e', 'v', 'all'], // scope 'all' allows replace-all for strings + * [/f/g, ($0) => $0.toUpperCase()] + * ]); + */ + + +XRegExp.replaceEach = function (str, replacements) { + var _iteratorNormalCompletion4 = true; + var _didIteratorError4 = false; + var _iteratorError4 = undefined; + + try { + for (var _iterator4 = replacements[Symbol.iterator](), _step4; !(_iteratorNormalCompletion4 = (_step4 = _iterator4.next()).done); _iteratorNormalCompletion4 = true) { + var r = _step4.value; + str = XRegExp.replace(str, r[0], r[1], r[2]); + } + } catch (err) { + _didIteratorError4 = true; + _iteratorError4 = err; + } finally { + try { + if (!_iteratorNormalCompletion4 && _iterator4.return != null) { + _iterator4.return(); + } + } finally { + if (_didIteratorError4) { + throw _iteratorError4; + } + } + } + + return str; +}; +/** + * Splits a string into an array of strings using a regex or string separator. Matches of the + * separator are not included in the result array. However, if `separator` is a regex that contains + * capturing groups, backreferences are spliced into the result each time `separator` is matched. + * Fixes browser bugs compared to the native `String.prototype.split` and can be used reliably + * cross-browser. + * + * @memberOf XRegExp + * @param {String} str String to split. + * @param {RegExp|String} separator Regex or string to use for separating the string. + * @param {Number} [limit] Maximum number of items to include in the result array. + * @returns {Array} Array of substrings. + * @example + * + * // Basic use + * XRegExp.split('a b c', ' '); + * // -> ['a', 'b', 'c'] + * + * // With limit + * XRegExp.split('a b c', ' ', 2); + * // -> ['a', 'b'] + * + * // Backreferences in result array + * XRegExp.split('..word1..', /([a-z]+)(\d+)/i); + * // -> ['..', 'word', '1', '..'] + */ + + +XRegExp.split = function (str, separator, limit) { + return fixed.split.call(toObject(str), separator, limit); +}; +/** + * Executes a regex search in a specified string. Returns `true` or `false`. Optional `pos` and + * `sticky` arguments specify the search start position, and whether the match must start at the + * specified position only. The `lastIndex` property of the provided regex is not used, but is + * updated for compatibility. Also fixes browser bugs compared to the native + * `RegExp.prototype.test` and can be used reliably cross-browser. + * + * @memberOf XRegExp + * @param {String} str String to search. + * @param {RegExp} regex Regex to search with. + * @param {Number} [pos=0] Zero-based index at which to start the search. + * @param {Boolean|String} [sticky=false] Whether the match must start at the specified position + * only. The string `'sticky'` is accepted as an alternative to `true`. + * @returns {Boolean} Whether the regex matched the provided value. + * @example + * + * // Basic use + * XRegExp.test('abc', /c/); // -> true + * + * // With pos and sticky + * XRegExp.test('abc', /c/, 0, 'sticky'); // -> false + * XRegExp.test('abc', /c/, 2, 'sticky'); // -> true + */ +// Do this the easy way :-) + + +XRegExp.test = function (str, regex, pos, sticky) { + return !!XRegExp.exec(str, regex, pos, sticky); +}; +/** + * Uninstalls optional features according to the specified options. All optional features start out + * uninstalled, so this is used to undo the actions of `XRegExp.install`. + * + * @memberOf XRegExp + * @param {Object|String} options Options object or string. + * @example + * + * // With an options object + * XRegExp.uninstall({ + * // Disables support for astral code points in Unicode addons + * astral: true, + * + * // Don't add named capture groups to the `groups` property of matches + * namespacing: true + * }); + * + * // With an options string + * XRegExp.uninstall('astral namespacing'); + */ + + +XRegExp.uninstall = function (options) { + options = prepareOptions(options); + + if (features.astral && options.astral) { + setAstral(false); + } + + if (features.namespacing && options.namespacing) { + setNamespacing(false); + } +}; +/** + * Returns an XRegExp object that is the union of the given patterns. Patterns can be provided as + * regex objects or strings. Metacharacters are escaped in patterns provided as strings. + * Backreferences in provided regex objects are automatically renumbered to work correctly within + * the larger combined pattern. Native flags used by provided regexes are ignored in favor of the + * `flags` argument. + * + * @memberOf XRegExp + * @param {Array} patterns Regexes and strings to combine. + * @param {String} [flags] Any combination of XRegExp flags. + * @param {Object} [options] Options object with optional properties: + * - `conjunction` {String} Type of conjunction to use: 'or' (default) or 'none'. + * @returns {RegExp} Union of the provided regexes and strings. + * @example + * + * XRegExp.union(['a+b*c', /(dogs)\1/, /(cats)\1/], 'i'); + * // -> /a\+b\*c|(dogs)\1|(cats)\2/i + * + * XRegExp.union([/man/, /bear/, /pig/], 'i', {conjunction: 'none'}); + * // -> /manbearpig/i + */ + + +XRegExp.union = function (patterns, flags, options) { + options = options || {}; + var conjunction = options.conjunction || 'or'; + var numCaptures = 0; + var numPriorCaptures; + var captureNames; + + function rewrite(match, paren, backref) { + var name = captureNames[numCaptures - numPriorCaptures]; // Capturing group + + if (paren) { + ++numCaptures; // If the current capture has a name, preserve the name + + if (name) { + return "(?<".concat(name, ">"); + } // Backreference + + } else if (backref) { + // Rewrite the backreference + return "\\".concat(+backref + numPriorCaptures); + } + + return match; + } + + if (!(isType(patterns, 'Array') && patterns.length)) { + throw new TypeError('Must provide a nonempty array of patterns to merge'); + } + + var parts = /(\()(?!\?)|\\([1-9]\d*)|\\[\s\S]|\[(?:[^\\\]]|\\[\s\S])*\]/g; + var output = []; + var _iteratorNormalCompletion5 = true; + var _didIteratorError5 = false; + var _iteratorError5 = undefined; + + try { + for (var _iterator5 = patterns[Symbol.iterator](), _step5; !(_iteratorNormalCompletion5 = (_step5 = _iterator5.next()).done); _iteratorNormalCompletion5 = true) { + var pattern = _step5.value; + + if (XRegExp.isRegExp(pattern)) { + numPriorCaptures = numCaptures; + captureNames = pattern[REGEX_DATA] && pattern[REGEX_DATA].captureNames || []; // Rewrite backreferences. Passing to XRegExp dies on octals and ensures patterns are + // independently valid; helps keep this simple. Named captures are put back + + output.push(nativ.replace.call(XRegExp(pattern.source).source, parts, rewrite)); + } else { + output.push(XRegExp.escape(pattern)); + } + } + } catch (err) { + _didIteratorError5 = true; + _iteratorError5 = err; + } finally { + try { + if (!_iteratorNormalCompletion5 && _iterator5.return != null) { + _iterator5.return(); + } + } finally { + if (_didIteratorError5) { + throw _iteratorError5; + } + } + } + + var separator = conjunction === 'none' ? '' : '|'; + return XRegExp(output.join(separator), flags); +}; // ==--------------------------== +// Fixed/extended native methods +// ==--------------------------== + +/** + * Adds named capture support (with backreferences returned as `result.name`), and fixes browser + * bugs in the native `RegExp.prototype.exec`. Use via `XRegExp.exec`. + * + * @memberOf RegExp + * @param {String} str String to search. + * @returns {Array} Match array with named backreference properties, or `null`. + */ + + +fixed.exec = function (str) { + var origLastIndex = this.lastIndex; + var match = nativ.exec.apply(this, arguments); + + if (match) { + // Fix browsers whose `exec` methods don't return `undefined` for nonparticipating capturing + // groups. This fixes IE 5.5-8, but not IE 9's quirks mode or emulation of older IEs. IE 9 + // in standards mode follows the spec. + if (!correctExecNpcg && match.length > 1 && match.indexOf('') !== -1) { + var r2 = copyRegex(this, { + removeG: true, + isInternalOnly: true + }); // Using `str.slice(match.index)` rather than `match[0]` in case lookahead allowed + // matching due to characters outside the match + + nativ.replace.call(String(str).slice(match.index), r2, function () { + var len = arguments.length; // Skip index 0 and the last 2 + + for (var i = 1; i < len - 2; ++i) { + if ((i < 0 || arguments.length <= i ? undefined : arguments[i]) === undefined) { + match[i] = undefined; + } + } + }); + } // Attach named capture properties + + + var groupsObject = match; + + if (XRegExp.isInstalled('namespacing')) { + // https://tc39.github.io/proposal-regexp-named-groups/#sec-regexpbuiltinexec + match.groups = Object.create(null); + groupsObject = match.groups; + } + + if (this[REGEX_DATA] && this[REGEX_DATA].captureNames) { + // Skip index 0 + for (var i = 1; i < match.length; ++i) { + var name = this[REGEX_DATA].captureNames[i - 1]; + + if (name) { + groupsObject[name] = match[i]; + } + } + } // Fix browsers that increment `lastIndex` after zero-length matches + + + if (this.global && !match[0].length && this.lastIndex > match.index) { + this.lastIndex = match.index; + } + } + + if (!this.global) { + // Fixes IE, Opera bug (last tested IE 9, Opera 11.6) + this.lastIndex = origLastIndex; + } + + return match; +}; +/** + * Fixes browser bugs in the native `RegExp.prototype.test`. + * + * @memberOf RegExp + * @param {String} str String to search. + * @returns {Boolean} Whether the regex matched the provided value. + */ + + +fixed.test = function (str) { + // Do this the easy way :-) + return !!fixed.exec.call(this, str); +}; +/** + * Adds named capture support (with backreferences returned as `result.name`), and fixes browser + * bugs in the native `String.prototype.match`. + * + * @memberOf String + * @param {RegExp|*} regex Regex to search with. If not a regex object, it is passed to `RegExp`. + * @returns {Array} If `regex` uses flag g, an array of match strings or `null`. Without flag g, + * the result of calling `regex.exec(this)`. + */ + + +fixed.match = function (regex) { + if (!XRegExp.isRegExp(regex)) { + // Use the native `RegExp` rather than `XRegExp` + regex = new RegExp(regex); + } else if (regex.global) { + var result = nativ.match.apply(this, arguments); // Fixes IE bug + + regex.lastIndex = 0; + return result; + } + + return fixed.exec.call(regex, toObject(this)); +}; +/** + * Adds support for `${n}` (or `$`) tokens for named and numbered backreferences in replacement + * text, and provides named backreferences to replacement functions as `arguments[0].name`. Also + * fixes browser bugs in replacement text syntax when performing a replacement using a nonregex + * search value, and the value of a replacement regex's `lastIndex` property during replacement + * iterations and upon completion. Note that this doesn't support SpiderMonkey's proprietary third + * (`flags`) argument. Use via `XRegExp.replace`. + * + * @memberOf String + * @param {RegExp|String} search Search pattern to be replaced. + * @param {String|Function} replacement Replacement string or a function invoked to create it. + * @returns {String} New string with one or all matches replaced. + */ + + +fixed.replace = function (search, replacement) { + var isRegex = XRegExp.isRegExp(search); + var origLastIndex; + var captureNames; + var result; + + if (isRegex) { + if (search[REGEX_DATA]) { + captureNames = search[REGEX_DATA].captureNames; + } // Only needed if `search` is nonglobal + + + origLastIndex = search.lastIndex; + } else { + search += ''; // Type-convert + } // Don't use `typeof`; some older browsers return 'function' for regex objects + + + if (isType(replacement, 'Function')) { + // Stringifying `this` fixes a bug in IE < 9 where the last argument in replacement + // functions isn't type-converted to a string + result = nativ.replace.call(String(this), search, function () { + for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) { + args[_key] = arguments[_key]; + } + + if (captureNames) { + var groupsObject; + + if (XRegExp.isInstalled('namespacing')) { + // https://tc39.github.io/proposal-regexp-named-groups/#sec-regexpbuiltinexec + groupsObject = Object.create(null); + args.push(groupsObject); + } else { + // Change the `args[0]` string primitive to a `String` object that can store + // properties. This really does need to use `String` as a constructor + args[0] = new String(args[0]); + groupsObject = args[0]; + } // Store named backreferences + + + for (var i = 0; i < captureNames.length; ++i) { + if (captureNames[i]) { + groupsObject[captureNames[i]] = args[i + 1]; + } + } + } // Update `lastIndex` before calling `replacement`. Fixes IE, Chrome, Firefox, Safari + // bug (last tested IE 9, Chrome 17, Firefox 11, Safari 5.1) + + + if (isRegex && search.global) { + search.lastIndex = args[args.length - 2] + args[0].length; + } // ES6 specs the context for replacement functions as `undefined` + + + return replacement.apply(void 0, args); + }); + } else { + // Ensure that the last value of `args` will be a string when given nonstring `this`, + // while still throwing on null or undefined context + result = nativ.replace.call(this == null ? this : String(this), search, function () { + for (var _len2 = arguments.length, args = new Array(_len2), _key2 = 0; _key2 < _len2; _key2++) { + args[_key2] = arguments[_key2]; + } + + return nativ.replace.call(String(replacement), replacementToken, replacer); + + function replacer($0, bracketed, angled, dollarToken) { + bracketed = bracketed || angled; // Named or numbered backreference with curly or angled braces + + if (bracketed) { + // XRegExp behavior for `${n}` or `$`: + // 1. Backreference to numbered capture, if `n` is an integer. Use `0` for the + // entire match. Any number of leading zeros may be used. + // 2. Backreference to named capture `n`, if it exists and is not an integer + // overridden by numbered capture. In practice, this does not overlap with + // numbered capture since XRegExp does not allow named capture to use a bare + // integer as the name. + // 3. If the name or number does not refer to an existing capturing group, it's + // an error. + var n = +bracketed; // Type-convert; drop leading zeros + + if (n <= args.length - 3) { + return args[n] || ''; + } // Groups with the same name is an error, else would need `lastIndexOf` + + + n = captureNames ? captureNames.indexOf(bracketed) : -1; + + if (n < 0) { + throw new SyntaxError("Backreference to undefined group ".concat($0)); + } + + return args[n + 1] || ''; + } // Else, special variable or numbered backreference without curly braces + + + if (dollarToken === '$') { + // $$ + return '$'; + } + + if (dollarToken === '&' || +dollarToken === 0) { + // $&, $0 (not followed by 1-9), $00 + return args[0]; + } + + if (dollarToken === '`') { + // $` (left context) + return args[args.length - 1].slice(0, args[args.length - 2]); + } + + if (dollarToken === "'") { + // $' (right context) + return args[args.length - 1].slice(args[args.length - 2] + args[0].length); + } // Else, numbered backreference without braces + + + dollarToken = +dollarToken; // Type-convert; drop leading zero + // XRegExp behavior for `$n` and `$nn`: + // - Backrefs end after 1 or 2 digits. Use `${..}` or `$<..>` for more digits. + // - `$1` is an error if no capturing groups. + // - `$10` is an error if less than 10 capturing groups. Use `${1}0` or `$<1>0` + // instead. + // - `$01` is `$1` if at least one capturing group, else it's an error. + // - `$0` (not followed by 1-9) and `$00` are the entire match. + // Native behavior, for comparison: + // - Backrefs end after 1 or 2 digits. Cannot reference capturing group 100+. + // - `$1` is a literal `$1` if no capturing groups. + // - `$10` is `$1` followed by a literal `0` if less than 10 capturing groups. + // - `$01` is `$1` if at least one capturing group, else it's a literal `$01`. + // - `$0` is a literal `$0`. + + if (!isNaN(dollarToken)) { + if (dollarToken > args.length - 3) { + throw new SyntaxError("Backreference to undefined group ".concat($0)); + } + + return args[dollarToken] || ''; + } // `$` followed by an unsupported char is an error, unlike native JS + + + throw new SyntaxError("Invalid token ".concat($0)); + } + }); + } + + if (isRegex) { + if (search.global) { + // Fixes IE, Safari bug (last tested IE 9, Safari 5.1) + search.lastIndex = 0; + } else { + // Fixes IE, Opera bug (last tested IE 9, Opera 11.6) + search.lastIndex = origLastIndex; + } + } + + return result; +}; +/** + * Fixes browser bugs in the native `String.prototype.split`. Use via `XRegExp.split`. + * + * @memberOf String + * @param {RegExp|String} separator Regex or string to use for separating the string. + * @param {Number} [limit] Maximum number of items to include in the result array. + * @returns {Array} Array of substrings. + */ + + +fixed.split = function (separator, limit) { + if (!XRegExp.isRegExp(separator)) { + // Browsers handle nonregex split correctly, so use the faster native method + return nativ.split.apply(this, arguments); + } + + var str = String(this); + var output = []; + var origLastIndex = separator.lastIndex; + var lastLastIndex = 0; + var lastLength; // Values for `limit`, per the spec: + // If undefined: pow(2,32) - 1 + // If 0, Infinity, or NaN: 0 + // If positive number: limit = floor(limit); if (limit >= pow(2,32)) limit -= pow(2,32); + // If negative number: pow(2,32) - floor(abs(limit)) + // If other: Type-convert, then use the above rules + // This line fails in very strange ways for some values of `limit` in Opera 10.5-10.63, unless + // Opera Dragonfly is open (go figure). It works in at least Opera 9.5-10.1 and 11+ + + limit = (limit === undefined ? -1 : limit) >>> 0; + XRegExp.forEach(str, separator, function (match) { + // This condition is not the same as `if (match[0].length)` + if (match.index + match[0].length > lastLastIndex) { + output.push(str.slice(lastLastIndex, match.index)); + + if (match.length > 1 && match.index < str.length) { + Array.prototype.push.apply(output, match.slice(1)); + } + + lastLength = match[0].length; + lastLastIndex = match.index + lastLength; + } + }); + + if (lastLastIndex === str.length) { + if (!nativ.test.call(separator, '') || lastLength) { + output.push(''); + } + } else { + output.push(str.slice(lastLastIndex)); + } + + separator.lastIndex = origLastIndex; + return output.length > limit ? output.slice(0, limit) : output; +}; // ==--------------------------== +// Built-in syntax/flag tokens +// ==--------------------------== + +/* + * Letter escapes that natively match literal characters: `\a`, `\A`, etc. These should be + * SyntaxErrors but are allowed in web reality. XRegExp makes them errors for cross-browser + * consistency and to reserve their syntax, but lets them be superseded by addons. + */ + + +XRegExp.addToken(/\\([ABCE-RTUVXYZaeg-mopqyz]|c(?![A-Za-z])|u(?![\dA-Fa-f]{4}|{[\dA-Fa-f]+})|x(?![\dA-Fa-f]{2}))/, function (match, scope) { + // \B is allowed in default scope only + if (match[1] === 'B' && scope === defaultScope) { + return match[0]; + } + + throw new SyntaxError("Invalid escape ".concat(match[0])); +}, { + scope: 'all', + leadChar: '\\' +}); +/* + * Unicode code point escape with curly braces: `\u{N..}`. `N..` is any one or more digit + * hexadecimal number from 0-10FFFF, and can include leading zeros. Requires the native ES6 `u` flag + * to support code points greater than U+FFFF. Avoids converting code points above U+FFFF to + * surrogate pairs (which could be done without flag `u`), since that could lead to broken behavior + * if you follow a `\u{N..}` token that references a code point above U+FFFF with a quantifier, or + * if you use the same in a character class. + */ + +XRegExp.addToken(/\\u{([\dA-Fa-f]+)}/, function (match, scope, flags) { + var code = dec(match[1]); + + if (code > 0x10FFFF) { + throw new SyntaxError("Invalid Unicode code point ".concat(match[0])); + } + + if (code <= 0xFFFF) { + // Converting to \uNNNN avoids needing to escape the literal character and keep it + // separate from preceding tokens + return "\\u".concat(pad4(hex(code))); + } // If `code` is between 0xFFFF and 0x10FFFF, require and defer to native handling + + + if (hasNativeU && flags.indexOf('u') !== -1) { + return match[0]; + } + + throw new SyntaxError('Cannot use Unicode code point above \\u{FFFF} without flag u'); +}, { + scope: 'all', + leadChar: '\\' +}); +/* + * Empty character class: `[]` or `[^]`. This fixes a critical cross-browser syntax inconsistency. + * Unless this is standardized (per the ES spec), regex syntax can't be accurately parsed because + * character class endings can't be determined. + */ + +XRegExp.addToken(/\[(\^?)\]/, // For cross-browser compatibility with ES3, convert [] to \b\B and [^] to [\s\S]. +// (?!) should work like \b\B, but is unreliable in some versions of Firefox + +/* eslint-disable no-confusing-arrow */ +function (match) { + return match[1] ? '[\\s\\S]' : '\\b\\B'; +}, +/* eslint-enable no-confusing-arrow */ +{ + leadChar: '[' +}); +/* + * Comment pattern: `(?# )`. Inline comments are an alternative to the line comments allowed in + * free-spacing mode (flag x). + */ + +XRegExp.addToken(/\(\?#[^)]*\)/, getContextualTokenSeparator, { + leadChar: '(' +}); +/* + * Whitespace and line comments, in free-spacing mode (aka extended mode, flag x) only. + */ + +XRegExp.addToken(/\s+|#[^\n]*\n?/, getContextualTokenSeparator, { + flag: 'x' +}); +/* + * Dot, in dotall mode (aka singleline mode, flag s) only. + */ + +XRegExp.addToken(/\./, function () { + return '[\\s\\S]'; +}, { + flag: 's', + leadChar: '.' +}); +/* + * Named backreference: `\k`. Backreference names can use the characters A-Z, a-z, 0-9, _, + * and $ only. Also allows numbered backreferences as `\k`. + */ + +XRegExp.addToken(/\\k<([\w$]+)>/, function (match) { + // Groups with the same name is an error, else would need `lastIndexOf` + var index = isNaN(match[1]) ? this.captureNames.indexOf(match[1]) + 1 : +match[1]; + var endIndex = match.index + match[0].length; + + if (!index || index > this.captureNames.length) { + throw new SyntaxError("Backreference to undefined group ".concat(match[0])); + } // Keep backreferences separate from subsequent literal numbers. This avoids e.g. + // inadvertedly changing `(?)\k1` to `()\11`. + + + return "\\".concat(index).concat(endIndex === match.input.length || isNaN(match.input[endIndex]) ? '' : '(?:)'); +}, { + leadChar: '\\' +}); +/* + * Numbered backreference or octal, plus any following digits: `\0`, `\11`, etc. Octals except `\0` + * not followed by 0-9 and backreferences to unopened capture groups throw an error. Other matches + * are returned unaltered. IE < 9 doesn't support backreferences above `\99` in regex syntax. + */ + +XRegExp.addToken(/\\(\d+)/, function (match, scope) { + if (!(scope === defaultScope && /^[1-9]/.test(match[1]) && +match[1] <= this.captureNames.length) && match[1] !== '0') { + throw new SyntaxError("Cannot use octal escape or backreference to undefined group ".concat(match[0])); + } + + return match[0]; +}, { + scope: 'all', + leadChar: '\\' +}); +/* + * Named capturing group; match the opening delimiter only: `(?`. Capture names can use the + * characters A-Z, a-z, 0-9, _, and $ only. Names can't be integers. Supports Python-style + * `(?P` as an alternate syntax to avoid issues in some older versions of Opera which natively + * supported the Python-style syntax. Otherwise, XRegExp might treat numbered backreferences to + * Python-style named capture as octals. + */ + +XRegExp.addToken(/\(\?P?<([\w$]+)>/, function (match) { + // Disallow bare integers as names because named backreferences are added to match arrays + // and therefore numeric properties may lead to incorrect lookups + if (!isNaN(match[1])) { + throw new SyntaxError("Cannot use integer as capture name ".concat(match[0])); + } + + if (!XRegExp.isInstalled('namespacing') && (match[1] === 'length' || match[1] === '__proto__')) { + throw new SyntaxError("Cannot use reserved word as capture name ".concat(match[0])); + } + + if (this.captureNames.indexOf(match[1]) !== -1) { + throw new SyntaxError("Cannot use same name for multiple groups ".concat(match[0])); + } + + this.captureNames.push(match[1]); + this.hasNamedCapture = true; + return '('; +}, { + leadChar: '(' +}); +/* + * Capturing group; match the opening parenthesis only. Required for support of named capturing + * groups. Also adds explicit capture mode (flag n). + */ + +XRegExp.addToken(/\((?!\?)/, function (match, scope, flags) { + if (flags.indexOf('n') !== -1) { + return '(?:'; + } + + this.captureNames.push(null); + return '('; +}, { + optionalFlags: 'n', + leadChar: '(' +}); +var _default = XRegExp; +exports.default = _default; +module.exports = exports["default"]; +}); + +unwrapExports(xregexp); + +var build = createCommonjsModule(function (module, exports) { +"use strict"; + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.default = void 0; + +/*! + * XRegExp.build 4.2.0 + * + * Steven Levithan (c) 2012-present MIT License + */ +var _default = function _default(XRegExp) { + var REGEX_DATA = 'xregexp'; + var subParts = /(\()(?!\?)|\\([1-9]\d*)|\\[\s\S]|\[(?:[^\\\]]|\\[\s\S])*\]/g; + var parts = XRegExp.union([/\({{([\w$]+)}}\)|{{([\w$]+)}}/, subParts], 'g', { + conjunction: 'or' + }); + /** + * Strips a leading `^` and trailing unescaped `$`, if both are present. + * + * @private + * @param {String} pattern Pattern to process. + * @returns {String} Pattern with edge anchors removed. + */ + + function deanchor(pattern) { + // Allow any number of empty noncapturing groups before/after anchors, because regexes + // built/generated by XRegExp sometimes include them + var leadingAnchor = /^(?:\(\?:\))*\^/; + var trailingAnchor = /\$(?:\(\?:\))*$/; + + if (leadingAnchor.test(pattern) && trailingAnchor.test(pattern) && // Ensure that the trailing `$` isn't escaped + trailingAnchor.test(pattern.replace(/\\[\s\S]/g, ''))) { + return pattern.replace(leadingAnchor, '').replace(trailingAnchor, ''); + } + + return pattern; + } + /** + * Converts the provided value to an XRegExp. Native RegExp flags are not preserved. + * + * @private + * @param {String|RegExp} value Value to convert. + * @param {Boolean} [addFlagX] Whether to apply the `x` flag in cases when `value` is not + * already a regex generated by XRegExp + * @returns {RegExp} XRegExp object with XRegExp syntax applied. + */ + + + function asXRegExp(value, addFlagX) { + var flags = addFlagX ? 'x' : ''; + return XRegExp.isRegExp(value) ? value[REGEX_DATA] && value[REGEX_DATA].captureNames ? // Don't recompile, to preserve capture names + value : // Recompile as XRegExp + XRegExp(value.source, flags) : // Compile string as XRegExp + XRegExp(value, flags); + } + + function interpolate(substitution) { + return substitution instanceof RegExp ? substitution : XRegExp.escape(substitution); + } + + function reduceToSubpatternsObject(subpatterns, interpolated, subpatternIndex) { + subpatterns["subpattern".concat(subpatternIndex)] = interpolated; + return subpatterns; + } + + function embedSubpatternAfter(raw, subpatternIndex, rawLiterals) { + var hasSubpattern = subpatternIndex < rawLiterals.length - 1; + return raw + (hasSubpattern ? "{{subpattern".concat(subpatternIndex, "}}") : ''); + } + /** + * Provides tagged template literals that create regexes with XRegExp syntax and flags. The + * provided pattern is handled as a raw string, so backslashes don't need to be escaped. + * + * Interpolation of strings and regexes shares the features of `XRegExp.build`. Interpolated + * patterns are treated as atomic units when quantified, interpolated strings have their special + * characters escaped, a leading `^` and trailing unescaped `$` are stripped from interpolated + * regexes if both are present, and any backreferences within an interpolated regex are + * rewritten to work within the overall pattern. + * + * @memberOf XRegExp + * @param {String} [flags] Any combination of XRegExp flags. + * @returns {Function} Handler for template literals that construct regexes with XRegExp syntax. + * @example + * + * const h12 = /1[0-2]|0?[1-9]/; + * const h24 = /2[0-3]|[01][0-9]/; + * const hours = XRegExp.tag('x')`${h12} : | ${h24}`; + * const minutes = /^[0-5][0-9]$/; + * // Note that explicitly naming the 'minutes' group is required for named backreferences + * const time = XRegExp.tag('x')`^ ${hours} (?${minutes}) $`; + * time.test('10:59'); // -> true + * XRegExp.exec('10:59', time).minutes; // -> '59' + */ + + + XRegExp.tag = function (flags) { + return function (literals) { + for (var _len = arguments.length, substitutions = new Array(_len > 1 ? _len - 1 : 0), _key = 1; _key < _len; _key++) { + substitutions[_key - 1] = arguments[_key]; + } + + var subpatterns = substitutions.map(interpolate).reduce(reduceToSubpatternsObject, {}); + var pattern = literals.raw.map(embedSubpatternAfter).join(''); + return XRegExp.build(pattern, subpatterns, flags); + }; + }; + /** + * Builds regexes using named subpatterns, for readability and pattern reuse. Backreferences in + * the outer pattern and provided subpatterns are automatically renumbered to work correctly. + * Native flags used by provided subpatterns are ignored in favor of the `flags` argument. + * + * @memberOf XRegExp + * @param {String} pattern XRegExp pattern using `{{name}}` for embedded subpatterns. Allows + * `({{name}})` as shorthand for `(?{{name}})`. Patterns cannot be embedded within + * character classes. + * @param {Object} subs Lookup object for named subpatterns. Values can be strings or regexes. A + * leading `^` and trailing unescaped `$` are stripped from subpatterns, if both are present. + * @param {String} [flags] Any combination of XRegExp flags. + * @returns {RegExp} Regex with interpolated subpatterns. + * @example + * + * const time = XRegExp.build('(?x)^ {{hours}} ({{minutes}}) $', { + * hours: XRegExp.build('{{h12}} : | {{h24}}', { + * h12: /1[0-2]|0?[1-9]/, + * h24: /2[0-3]|[01][0-9]/ + * }, 'x'), + * minutes: /^[0-5][0-9]$/ + * }); + * time.test('10:59'); // -> true + * XRegExp.exec('10:59', time).minutes; // -> '59' + */ + + + XRegExp.build = function (pattern, subs, flags) { + flags = flags || ''; // Used with `asXRegExp` calls for `pattern` and subpatterns in `subs`, to work around how + // some browsers convert `RegExp('\n')` to a regex that contains the literal characters `\` + // and `n`. See more details at . + + var addFlagX = flags.indexOf('x') !== -1; + var inlineFlags = /^\(\?([\w$]+)\)/.exec(pattern); // Add flags within a leading mode modifier to the overall pattern's flags + + if (inlineFlags) { + flags = XRegExp._clipDuplicates(flags + inlineFlags[1]); + } + + var data = {}; + + for (var p in subs) { + if (subs.hasOwnProperty(p)) { + // Passing to XRegExp enables extended syntax and ensures independent validity, + // lest an unescaped `(`, `)`, `[`, or trailing `\` breaks the `(?:)` wrapper. For + // subpatterns provided as native regexes, it dies on octals and adds the property + // used to hold extended regex instance data, for simplicity. + var sub = asXRegExp(subs[p], addFlagX); + data[p] = { + // Deanchoring allows embedding independently useful anchored regexes. If you + // really need to keep your anchors, double them (i.e., `^^...$$`). + pattern: deanchor(sub.source), + names: sub[REGEX_DATA].captureNames || [] + }; + } + } // Passing to XRegExp dies on octals and ensures the outer pattern is independently valid; + // helps keep this simple. Named captures will be put back. + + + var patternAsRegex = asXRegExp(pattern, addFlagX); // 'Caps' is short for 'captures' + + var numCaps = 0; + var numPriorCaps; + var numOuterCaps = 0; + var outerCapsMap = [0]; + var outerCapNames = patternAsRegex[REGEX_DATA].captureNames || []; + var output = patternAsRegex.source.replace(parts, function ($0, $1, $2, $3, $4) { + var subName = $1 || $2; + var capName; + var intro; + var localCapIndex; // Named subpattern + + if (subName) { + if (!data.hasOwnProperty(subName)) { + throw new ReferenceError("Undefined property ".concat($0)); + } // Named subpattern was wrapped in a capturing group + + + if ($1) { + capName = outerCapNames[numOuterCaps]; + outerCapsMap[++numOuterCaps] = ++numCaps; // If it's a named group, preserve the name. Otherwise, use the subpattern name + // as the capture name + + intro = "(?<".concat(capName || subName, ">"); + } else { + intro = '(?:'; + } + + numPriorCaps = numCaps; + var rewrittenSubpattern = data[subName].pattern.replace(subParts, function (match, paren, backref) { + // Capturing group + if (paren) { + capName = data[subName].names[numCaps - numPriorCaps]; + ++numCaps; // If the current capture has a name, preserve the name + + if (capName) { + return "(?<".concat(capName, ">"); + } // Backreference + + } else if (backref) { + localCapIndex = +backref - 1; // Rewrite the backreference + + return data[subName].names[localCapIndex] ? // Need to preserve the backreference name in case using flag `n` + "\\k<".concat(data[subName].names[localCapIndex], ">") : "\\".concat(+backref + numPriorCaps); + } + + return match; + }); + return "".concat(intro).concat(rewrittenSubpattern, ")"); + } // Capturing group + + + if ($3) { + capName = outerCapNames[numOuterCaps]; + outerCapsMap[++numOuterCaps] = ++numCaps; // If the current capture has a name, preserve the name + + if (capName) { + return "(?<".concat(capName, ">"); + } // Backreference + + } else if ($4) { + localCapIndex = +$4 - 1; // Rewrite the backreference + + return outerCapNames[localCapIndex] ? // Need to preserve the backreference name in case using flag `n` + "\\k<".concat(outerCapNames[localCapIndex], ">") : "\\".concat(outerCapsMap[+$4]); + } + + return $0; + }); + return XRegExp(output, flags); + }; +}; + +exports.default = _default; +module.exports = exports["default"]; +}); + +unwrapExports(build); + +var matchrecursive = createCommonjsModule(function (module, exports) { +"use strict"; + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.default = void 0; + +/*! + * XRegExp.matchRecursive 4.2.0 + * + * Steven Levithan (c) 2009-present MIT License + */ +var _default = function _default(XRegExp) { + /** + * Returns a match detail object composed of the provided values. + * + * @private + */ + function row(name, value, start, end) { + return { + name: name, + value: value, + start: start, + end: end + }; + } + /** + * Returns an array of match strings between outermost left and right delimiters, or an array of + * objects with detailed match parts and position data. An error is thrown if delimiters are + * unbalanced within the data. + * + * @memberOf XRegExp + * @param {String} str String to search. + * @param {String} left Left delimiter as an XRegExp pattern. + * @param {String} right Right delimiter as an XRegExp pattern. + * @param {String} [flags] Any native or XRegExp flags, used for the left and right delimiters. + * @param {Object} [options] Lets you specify `valueNames` and `escapeChar` options. + * @returns {Array} Array of matches, or an empty array. + * @example + * + * // Basic usage + * let str = '(t((e))s)t()(ing)'; + * XRegExp.matchRecursive(str, '\\(', '\\)', 'g'); + * // -> ['t((e))s', '', 'ing'] + * + * // Extended information mode with valueNames + * str = 'Here is
an
example'; + * XRegExp.matchRecursive(str, '', '', 'gi', { + * valueNames: ['between', 'left', 'match', 'right'] + * }); + * // -> [ + * // {name: 'between', value: 'Here is ', start: 0, end: 8}, + * // {name: 'left', value: '
', start: 8, end: 13}, + * // {name: 'match', value: '
an
', start: 13, end: 27}, + * // {name: 'right', value: '
', start: 27, end: 33}, + * // {name: 'between', value: ' example', start: 33, end: 41} + * // ] + * + * // Omitting unneeded parts with null valueNames, and using escapeChar + * str = '...{1}.\\{{function(x,y){return {y:x}}}'; + * XRegExp.matchRecursive(str, '{', '}', 'g', { + * valueNames: ['literal', null, 'value', null], + * escapeChar: '\\' + * }); + * // -> [ + * // {name: 'literal', value: '...', start: 0, end: 3}, + * // {name: 'value', value: '1', start: 4, end: 5}, + * // {name: 'literal', value: '.\\{', start: 6, end: 9}, + * // {name: 'value', value: 'function(x,y){return {y:x}}', start: 10, end: 37} + * // ] + * + * // Sticky mode via flag y + * str = '<1><<<2>>><3>4<5>'; + * XRegExp.matchRecursive(str, '<', '>', 'gy'); + * // -> ['1', '<<2>>', '3'] + */ + + + XRegExp.matchRecursive = function (str, left, right, flags, options) { + flags = flags || ''; + options = options || {}; + var global = flags.indexOf('g') !== -1; + var sticky = flags.indexOf('y') !== -1; // Flag `y` is controlled internally + + var basicFlags = flags.replace(/y/g, ''); + var _options = options, + escapeChar = _options.escapeChar; + var vN = options.valueNames; + var output = []; + var openTokens = 0; + var delimStart = 0; + var delimEnd = 0; + var lastOuterEnd = 0; + var outerStart; + var innerStart; + var leftMatch; + var rightMatch; + var esc; + left = XRegExp(left, basicFlags); + right = XRegExp(right, basicFlags); + + if (escapeChar) { + if (escapeChar.length > 1) { + throw new Error('Cannot use more than one escape character'); + } + + escapeChar = XRegExp.escape(escapeChar); // Example of concatenated `esc` regex: + // `escapeChar`: '%' + // `left`: '<' + // `right`: '>' + // Regex is: /(?:%[\S\s]|(?:(?!<|>)[^%])+)+/ + + esc = new RegExp("(?:".concat(escapeChar, "[\\S\\s]|(?:(?!").concat( // Using `XRegExp.union` safely rewrites backreferences in `left` and `right`. + // Intentionally not passing `basicFlags` to `XRegExp.union` since any syntax + // transformation resulting from those flags was already applied to `left` and + // `right` when they were passed through the XRegExp constructor above. + XRegExp.union([left, right], '', { + conjunction: 'or' + }).source, ")[^").concat(escapeChar, "])+)+"), // Flags `gy` not needed here + flags.replace(/[^imu]+/g, '')); + } + + while (true) { + // If using an escape character, advance to the delimiter's next starting position, + // skipping any escaped characters in between + if (escapeChar) { + delimEnd += (XRegExp.exec(str, esc, delimEnd, 'sticky') || [''])[0].length; + } + + leftMatch = XRegExp.exec(str, left, delimEnd); + rightMatch = XRegExp.exec(str, right, delimEnd); // Keep the leftmost match only + + if (leftMatch && rightMatch) { + if (leftMatch.index <= rightMatch.index) { + rightMatch = null; + } else { + leftMatch = null; + } + } // Paths (LM: leftMatch, RM: rightMatch, OT: openTokens): + // LM | RM | OT | Result + // 1 | 0 | 1 | loop + // 1 | 0 | 0 | loop + // 0 | 1 | 1 | loop + // 0 | 1 | 0 | throw + // 0 | 0 | 1 | throw + // 0 | 0 | 0 | break + // The paths above don't include the sticky mode special case. The loop ends after the + // first completed match if not `global`. + + + if (leftMatch || rightMatch) { + delimStart = (leftMatch || rightMatch).index; + delimEnd = delimStart + (leftMatch || rightMatch)[0].length; + } else if (!openTokens) { + break; + } + + if (sticky && !openTokens && delimStart > lastOuterEnd) { + break; + } + + if (leftMatch) { + if (!openTokens) { + outerStart = delimStart; + innerStart = delimEnd; + } + + ++openTokens; + } else if (rightMatch && openTokens) { + if (! --openTokens) { + if (vN) { + if (vN[0] && outerStart > lastOuterEnd) { + output.push(row(vN[0], str.slice(lastOuterEnd, outerStart), lastOuterEnd, outerStart)); + } + + if (vN[1]) { + output.push(row(vN[1], str.slice(outerStart, innerStart), outerStart, innerStart)); + } + + if (vN[2]) { + output.push(row(vN[2], str.slice(innerStart, delimStart), innerStart, delimStart)); + } + + if (vN[3]) { + output.push(row(vN[3], str.slice(delimStart, delimEnd), delimStart, delimEnd)); + } + } else { + output.push(str.slice(innerStart, delimStart)); + } + + lastOuterEnd = delimEnd; + + if (!global) { + break; + } + } + } else { + throw new Error('Unbalanced delimiter found in string'); + } // If the delimiter matched an empty string, avoid an infinite loop + + + if (delimStart === delimEnd) { + ++delimEnd; + } + } + + if (global && !sticky && vN && vN[0] && str.length > lastOuterEnd) { + output.push(row(vN[0], str.slice(lastOuterEnd), lastOuterEnd, str.length)); + } + + return output; + }; +}; + +exports.default = _default; +module.exports = exports["default"]; +}); + +unwrapExports(matchrecursive); + +var unicodeBase = createCommonjsModule(function (module, exports) { +"use strict"; + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.default = void 0; + +/*! + * XRegExp Unicode Base 4.2.0 + * + * Steven Levithan (c) 2008-present MIT License + */ +var _default = function _default(XRegExp) { + /** + * Adds base support for Unicode matching: + * - Adds syntax `\p{..}` for matching Unicode tokens. Tokens can be inverted using `\P{..}` or + * `\p{^..}`. Token names ignore case, spaces, hyphens, and underscores. You can omit the + * braces for token names that are a single letter (e.g. `\pL` or `PL`). + * - Adds flag A (astral), which enables 21-bit Unicode support. + * - Adds the `XRegExp.addUnicodeData` method used by other addons to provide character data. + * + * Unicode Base relies on externally provided Unicode character data. Official addons are + * available to provide data for Unicode categories, scripts, blocks, and properties. + * + * @requires XRegExp + */ + // ==--------------------------== + // Private stuff + // ==--------------------------== + // Storage for Unicode data + var unicode = {}; // Reuse utils + + var dec = XRegExp._dec; + var hex = XRegExp._hex; + var pad4 = XRegExp._pad4; // Generates a token lookup name: lowercase, with hyphens, spaces, and underscores removed + + function normalize(name) { + return name.replace(/[- _]+/g, '').toLowerCase(); + } // Gets the decimal code of a literal code unit, \xHH, \uHHHH, or a backslash-escaped literal + + + function charCode(chr) { + var esc = /^\\[xu](.+)/.exec(chr); + return esc ? dec(esc[1]) : chr.charCodeAt(chr[0] === '\\' ? 1 : 0); + } // Inverts a list of ordered BMP characters and ranges + + + function invertBmp(range) { + var output = ''; + var lastEnd = -1; + XRegExp.forEach(range, /(\\x..|\\u....|\\?[\s\S])(?:-(\\x..|\\u....|\\?[\s\S]))?/, function (m) { + var start = charCode(m[1]); + + if (start > lastEnd + 1) { + output += "\\u".concat(pad4(hex(lastEnd + 1))); + + if (start > lastEnd + 2) { + output += "-\\u".concat(pad4(hex(start - 1))); + } + } + + lastEnd = charCode(m[2] || m[1]); + }); + + if (lastEnd < 0xFFFF) { + output += "\\u".concat(pad4(hex(lastEnd + 1))); + + if (lastEnd < 0xFFFE) { + output += '-\\uFFFF'; + } + } + + return output; + } // Generates an inverted BMP range on first use + + + function cacheInvertedBmp(slug) { + var prop = 'b!'; + return unicode[slug][prop] || (unicode[slug][prop] = invertBmp(unicode[slug].bmp)); + } // Combines and optionally negates BMP and astral data + + + function buildAstral(slug, isNegated) { + var item = unicode[slug]; + var combined = ''; + + if (item.bmp && !item.isBmpLast) { + combined = "[".concat(item.bmp, "]").concat(item.astral ? '|' : ''); + } + + if (item.astral) { + combined += item.astral; + } + + if (item.isBmpLast && item.bmp) { + combined += "".concat(item.astral ? '|' : '', "[").concat(item.bmp, "]"); + } // Astral Unicode tokens always match a code point, never a code unit + + + return isNegated ? "(?:(?!".concat(combined, ")(?:[\uD800-\uDBFF][\uDC00-\uDFFF]|[\0-\uFFFF]))") : "(?:".concat(combined, ")"); + } // Builds a complete astral pattern on first use + + + function cacheAstral(slug, isNegated) { + var prop = isNegated ? 'a!' : 'a='; + return unicode[slug][prop] || (unicode[slug][prop] = buildAstral(slug, isNegated)); + } // ==--------------------------== + // Core functionality + // ==--------------------------== + + /* + * Add astral mode (flag A) and Unicode token syntax: `\p{..}`, `\P{..}`, `\p{^..}`, `\pC`. + */ + + + XRegExp.addToken( // Use `*` instead of `+` to avoid capturing `^` as the token name in `\p{^}` + /\\([pP])(?:{(\^?)([^}]*)}|([A-Za-z]))/, function (match, scope, flags) { + var ERR_DOUBLE_NEG = 'Invalid double negation '; + var ERR_UNKNOWN_NAME = 'Unknown Unicode token '; + var ERR_UNKNOWN_REF = 'Unicode token missing data '; + var ERR_ASTRAL_ONLY = 'Astral mode required for Unicode token '; + var ERR_ASTRAL_IN_CLASS = 'Astral mode does not support Unicode tokens within character classes'; // Negated via \P{..} or \p{^..} + + var isNegated = match[1] === 'P' || !!match[2]; // Switch from BMP (0-FFFF) to astral (0-10FFFF) mode via flag A + + var isAstralMode = flags.indexOf('A') !== -1; // Token lookup name. Check `[4]` first to avoid passing `undefined` via `\p{}` + + var slug = normalize(match[4] || match[3]); // Token data object + + var item = unicode[slug]; + + if (match[1] === 'P' && match[2]) { + throw new SyntaxError(ERR_DOUBLE_NEG + match[0]); + } + + if (!unicode.hasOwnProperty(slug)) { + throw new SyntaxError(ERR_UNKNOWN_NAME + match[0]); + } // Switch to the negated form of the referenced Unicode token + + + if (item.inverseOf) { + slug = normalize(item.inverseOf); + + if (!unicode.hasOwnProperty(slug)) { + throw new ReferenceError("".concat(ERR_UNKNOWN_REF + match[0], " -> ").concat(item.inverseOf)); + } + + item = unicode[slug]; + isNegated = !isNegated; + } + + if (!(item.bmp || isAstralMode)) { + throw new SyntaxError(ERR_ASTRAL_ONLY + match[0]); + } + + if (isAstralMode) { + if (scope === 'class') { + throw new SyntaxError(ERR_ASTRAL_IN_CLASS); + } + + return cacheAstral(slug, isNegated); + } + + return scope === 'class' ? isNegated ? cacheInvertedBmp(slug) : item.bmp : "".concat((isNegated ? '[^' : '[') + item.bmp, "]"); + }, { + scope: 'all', + optionalFlags: 'A', + leadChar: '\\' + }); + /** + * Adds to the list of Unicode tokens that XRegExp regexes can match via `\p` or `\P`. + * + * @memberOf XRegExp + * @param {Array} data Objects with named character ranges. Each object may have properties + * `name`, `alias`, `isBmpLast`, `inverseOf`, `bmp`, and `astral`. All but `name` are + * optional, although one of `bmp` or `astral` is required (unless `inverseOf` is set). If + * `astral` is absent, the `bmp` data is used for BMP and astral modes. If `bmp` is absent, + * the name errors in BMP mode but works in astral mode. If both `bmp` and `astral` are + * provided, the `bmp` data only is used in BMP mode, and the combination of `bmp` and + * `astral` data is used in astral mode. `isBmpLast` is needed when a token matches orphan + * high surrogates *and* uses surrogate pairs to match astral code points. The `bmp` and + * `astral` data should be a combination of literal characters and `\xHH` or `\uHHHH` escape + * sequences, with hyphens to create ranges. Any regex metacharacters in the data should be + * escaped, apart from range-creating hyphens. The `astral` data can additionally use + * character classes and alternation, and should use surrogate pairs to represent astral code + * points. `inverseOf` can be used to avoid duplicating character data if a Unicode token is + * defined as the exact inverse of another token. + * @example + * + * // Basic use + * XRegExp.addUnicodeData([{ + * name: 'XDigit', + * alias: 'Hexadecimal', + * bmp: '0-9A-Fa-f' + * }]); + * XRegExp('\\p{XDigit}:\\p{Hexadecimal}+').test('0:3D'); // -> true + */ + + XRegExp.addUnicodeData = function (data) { + var ERR_NO_NAME = 'Unicode token requires name'; + var ERR_NO_DATA = 'Unicode token has no character data '; + var _iteratorNormalCompletion = true; + var _didIteratorError = false; + var _iteratorError = undefined; + + try { + for (var _iterator = data[Symbol.iterator](), _step; !(_iteratorNormalCompletion = (_step = _iterator.next()).done); _iteratorNormalCompletion = true) { + var item = _step.value; + + if (!item.name) { + throw new Error(ERR_NO_NAME); + } + + if (!(item.inverseOf || item.bmp || item.astral)) { + throw new Error(ERR_NO_DATA + item.name); + } + + unicode[normalize(item.name)] = item; + + if (item.alias) { + unicode[normalize(item.alias)] = item; + } + } // Reset the pattern cache used by the `XRegExp` constructor, since the same pattern and + // flags might now produce different results + + } catch (err) { + _didIteratorError = true; + _iteratorError = err; + } finally { + try { + if (!_iteratorNormalCompletion && _iterator.return != null) { + _iterator.return(); + } + } finally { + if (_didIteratorError) { + throw _iteratorError; + } + } + } + + XRegExp.cache.flush('patterns'); + }; + /** + * @ignore + * + * Return a reference to the internal Unicode definition structure for the given Unicode + * Property if the given name is a legal Unicode Property for use in XRegExp `\p` or `\P` regex + * constructs. + * + * @memberOf XRegExp + * @param {String} name Name by which the Unicode Property may be recognized (case-insensitive), + * e.g. `'N'` or `'Number'`. The given name is matched against all registered Unicode + * Properties and Property Aliases. + * @returns {Object} Reference to definition structure when the name matches a Unicode Property. + * + * @note + * For more info on Unicode Properties, see also http://unicode.org/reports/tr18/#Categories. + * + * @note + * This method is *not* part of the officially documented API and may change or be removed in + * the future. It is meant for userland code that wishes to reuse the (large) internal Unicode + * structures set up by XRegExp. + */ + + + XRegExp._getUnicodeProperty = function (name) { + var slug = normalize(name); + return unicode[slug]; + }; +}; + +exports.default = _default; +module.exports = exports["default"]; +}); + +unwrapExports(unicodeBase); + +var blocks = [ + { + 'name': 'InAdlam', + 'astral': '\uD83A[\uDD00-\uDD5F]' + }, + { + 'name': 'InAegean_Numbers', + 'astral': '\uD800[\uDD00-\uDD3F]' + }, + { + 'name': 'InAhom', + 'astral': '\uD805[\uDF00-\uDF3F]' + }, + { + 'name': 'InAlchemical_Symbols', + 'astral': '\uD83D[\uDF00-\uDF7F]' + }, + { + 'name': 'InAlphabetic_Presentation_Forms', + 'bmp': '\uFB00-\uFB4F' + }, + { + 'name': 'InAnatolian_Hieroglyphs', + 'astral': '\uD811[\uDC00-\uDE7F]' + }, + { + 'name': 'InAncient_Greek_Musical_Notation', + 'astral': '\uD834[\uDE00-\uDE4F]' + }, + { + 'name': 'InAncient_Greek_Numbers', + 'astral': '\uD800[\uDD40-\uDD8F]' + }, + { + 'name': 'InAncient_Symbols', + 'astral': '\uD800[\uDD90-\uDDCF]' + }, + { + 'name': 'InArabic', + 'bmp': '\u0600-\u06FF' + }, + { + 'name': 'InArabic_Extended_A', + 'bmp': '\u08A0-\u08FF' + }, + { + 'name': 'InArabic_Mathematical_Alphabetic_Symbols', + 'astral': '\uD83B[\uDE00-\uDEFF]' + }, + { + 'name': 'InArabic_Presentation_Forms_A', + 'bmp': '\uFB50-\uFDFF' + }, + { + 'name': 'InArabic_Presentation_Forms_B', + 'bmp': '\uFE70-\uFEFF' + }, + { + 'name': 'InArabic_Supplement', + 'bmp': '\u0750-\u077F' + }, + { + 'name': 'InArmenian', + 'bmp': '\u0530-\u058F' + }, + { + 'name': 'InArrows', + 'bmp': '\u2190-\u21FF' + }, + { + 'name': 'InAvestan', + 'astral': '\uD802[\uDF00-\uDF3F]' + }, + { + 'name': 'InBalinese', + 'bmp': '\u1B00-\u1B7F' + }, + { + 'name': 'InBamum', + 'bmp': '\uA6A0-\uA6FF' + }, + { + 'name': 'InBamum_Supplement', + 'astral': '\uD81A[\uDC00-\uDE3F]' + }, + { + 'name': 'InBasic_Latin', + 'bmp': '\0-\x7F' + }, + { + 'name': 'InBassa_Vah', + 'astral': '\uD81A[\uDED0-\uDEFF]' + }, + { + 'name': 'InBatak', + 'bmp': '\u1BC0-\u1BFF' + }, + { + 'name': 'InBengali', + 'bmp': '\u0980-\u09FF' + }, + { + 'name': 'InBhaiksuki', + 'astral': '\uD807[\uDC00-\uDC6F]' + }, + { + 'name': 'InBlock_Elements', + 'bmp': '\u2580-\u259F' + }, + { + 'name': 'InBopomofo', + 'bmp': '\u3100-\u312F' + }, + { + 'name': 'InBopomofo_Extended', + 'bmp': '\u31A0-\u31BF' + }, + { + 'name': 'InBox_Drawing', + 'bmp': '\u2500-\u257F' + }, + { + 'name': 'InBrahmi', + 'astral': '\uD804[\uDC00-\uDC7F]' + }, + { + 'name': 'InBraille_Patterns', + 'bmp': '\u2800-\u28FF' + }, + { + 'name': 'InBuginese', + 'bmp': '\u1A00-\u1A1F' + }, + { + 'name': 'InBuhid', + 'bmp': '\u1740-\u175F' + }, + { + 'name': 'InByzantine_Musical_Symbols', + 'astral': '\uD834[\uDC00-\uDCFF]' + }, + { + 'name': 'InCJK_Compatibility', + 'bmp': '\u3300-\u33FF' + }, + { + 'name': 'InCJK_Compatibility_Forms', + 'bmp': '\uFE30-\uFE4F' + }, + { + 'name': 'InCJK_Compatibility_Ideographs', + 'bmp': '\uF900-\uFAFF' + }, + { + 'name': 'InCJK_Compatibility_Ideographs_Supplement', + 'astral': '\uD87E[\uDC00-\uDE1F]' + }, + { + 'name': 'InCJK_Radicals_Supplement', + 'bmp': '\u2E80-\u2EFF' + }, + { + 'name': 'InCJK_Strokes', + 'bmp': '\u31C0-\u31EF' + }, + { + 'name': 'InCJK_Symbols_And_Punctuation', + 'bmp': '\u3000-\u303F' + }, + { + 'name': 'InCJK_Unified_Ideographs', + 'bmp': '\u4E00-\u9FFF' + }, + { + 'name': 'InCJK_Unified_Ideographs_Extension_A', + 'bmp': '\u3400-\u4DBF' + }, + { + 'name': 'InCJK_Unified_Ideographs_Extension_B', + 'astral': '[\uD840-\uD868][\uDC00-\uDFFF]|\uD869[\uDC00-\uDEDF]' + }, + { + 'name': 'InCJK_Unified_Ideographs_Extension_C', + 'astral': '\uD869[\uDF00-\uDFFF]|[\uD86A-\uD86C][\uDC00-\uDFFF]|\uD86D[\uDC00-\uDF3F]' + }, + { + 'name': 'InCJK_Unified_Ideographs_Extension_D', + 'astral': '\uD86D[\uDF40-\uDFFF]|\uD86E[\uDC00-\uDC1F]' + }, + { + 'name': 'InCJK_Unified_Ideographs_Extension_E', + 'astral': '\uD86E[\uDC20-\uDFFF]|[\uD86F-\uD872][\uDC00-\uDFFF]|\uD873[\uDC00-\uDEAF]' + }, + { + 'name': 'InCJK_Unified_Ideographs_Extension_F', + 'astral': '\uD873[\uDEB0-\uDFFF]|[\uD874-\uD879][\uDC00-\uDFFF]|\uD87A[\uDC00-\uDFEF]' + }, + { + 'name': 'InCarian', + 'astral': '\uD800[\uDEA0-\uDEDF]' + }, + { + 'name': 'InCaucasian_Albanian', + 'astral': '\uD801[\uDD30-\uDD6F]' + }, + { + 'name': 'InChakma', + 'astral': '\uD804[\uDD00-\uDD4F]' + }, + { + 'name': 'InCham', + 'bmp': '\uAA00-\uAA5F' + }, + { + 'name': 'InCherokee', + 'bmp': '\u13A0-\u13FF' + }, + { + 'name': 'InCherokee_Supplement', + 'bmp': '\uAB70-\uABBF' + }, + { + 'name': 'InChess_Symbols', + 'astral': '\uD83E[\uDE00-\uDE6F]' + }, + { + 'name': 'InCombining_Diacritical_Marks', + 'bmp': '\u0300-\u036F' + }, + { + 'name': 'InCombining_Diacritical_Marks_Extended', + 'bmp': '\u1AB0-\u1AFF' + }, + { + 'name': 'InCombining_Diacritical_Marks_For_Symbols', + 'bmp': '\u20D0-\u20FF' + }, + { + 'name': 'InCombining_Diacritical_Marks_Supplement', + 'bmp': '\u1DC0-\u1DFF' + }, + { + 'name': 'InCombining_Half_Marks', + 'bmp': '\uFE20-\uFE2F' + }, + { + 'name': 'InCommon_Indic_Number_Forms', + 'bmp': '\uA830-\uA83F' + }, + { + 'name': 'InControl_Pictures', + 'bmp': '\u2400-\u243F' + }, + { + 'name': 'InCoptic', + 'bmp': '\u2C80-\u2CFF' + }, + { + 'name': 'InCoptic_Epact_Numbers', + 'astral': '\uD800[\uDEE0-\uDEFF]' + }, + { + 'name': 'InCounting_Rod_Numerals', + 'astral': '\uD834[\uDF60-\uDF7F]' + }, + { + 'name': 'InCuneiform', + 'astral': '\uD808[\uDC00-\uDFFF]' + }, + { + 'name': 'InCuneiform_Numbers_And_Punctuation', + 'astral': '\uD809[\uDC00-\uDC7F]' + }, + { + 'name': 'InCurrency_Symbols', + 'bmp': '\u20A0-\u20CF' + }, + { + 'name': 'InCypriot_Syllabary', + 'astral': '\uD802[\uDC00-\uDC3F]' + }, + { + 'name': 'InCyrillic', + 'bmp': '\u0400-\u04FF' + }, + { + 'name': 'InCyrillic_Extended_A', + 'bmp': '\u2DE0-\u2DFF' + }, + { + 'name': 'InCyrillic_Extended_B', + 'bmp': '\uA640-\uA69F' + }, + { + 'name': 'InCyrillic_Extended_C', + 'bmp': '\u1C80-\u1C8F' + }, + { + 'name': 'InCyrillic_Supplement', + 'bmp': '\u0500-\u052F' + }, + { + 'name': 'InDeseret', + 'astral': '\uD801[\uDC00-\uDC4F]' + }, + { + 'name': 'InDevanagari', + 'bmp': '\u0900-\u097F' + }, + { + 'name': 'InDevanagari_Extended', + 'bmp': '\uA8E0-\uA8FF' + }, + { + 'name': 'InDingbats', + 'bmp': '\u2700-\u27BF' + }, + { + 'name': 'InDogra', + 'astral': '\uD806[\uDC00-\uDC4F]' + }, + { + 'name': 'InDomino_Tiles', + 'astral': '\uD83C[\uDC30-\uDC9F]' + }, + { + 'name': 'InDuployan', + 'astral': '\uD82F[\uDC00-\uDC9F]' + }, + { + 'name': 'InEarly_Dynastic_Cuneiform', + 'astral': '\uD809[\uDC80-\uDD4F]' + }, + { + 'name': 'InEgyptian_Hieroglyphs', + 'astral': '\uD80C[\uDC00-\uDFFF]|\uD80D[\uDC00-\uDC2F]' + }, + { + 'name': 'InElbasan', + 'astral': '\uD801[\uDD00-\uDD2F]' + }, + { + 'name': 'InEmoticons', + 'astral': '\uD83D[\uDE00-\uDE4F]' + }, + { + 'name': 'InEnclosed_Alphanumeric_Supplement', + 'astral': '\uD83C[\uDD00-\uDDFF]' + }, + { + 'name': 'InEnclosed_Alphanumerics', + 'bmp': '\u2460-\u24FF' + }, + { + 'name': 'InEnclosed_CJK_Letters_And_Months', + 'bmp': '\u3200-\u32FF' + }, + { + 'name': 'InEnclosed_Ideographic_Supplement', + 'astral': '\uD83C[\uDE00-\uDEFF]' + }, + { + 'name': 'InEthiopic', + 'bmp': '\u1200-\u137F' + }, + { + 'name': 'InEthiopic_Extended', + 'bmp': '\u2D80-\u2DDF' + }, + { + 'name': 'InEthiopic_Extended_A', + 'bmp': '\uAB00-\uAB2F' + }, + { + 'name': 'InEthiopic_Supplement', + 'bmp': '\u1380-\u139F' + }, + { + 'name': 'InGeneral_Punctuation', + 'bmp': '\u2000-\u206F' + }, + { + 'name': 'InGeometric_Shapes', + 'bmp': '\u25A0-\u25FF' + }, + { + 'name': 'InGeometric_Shapes_Extended', + 'astral': '\uD83D[\uDF80-\uDFFF]' + }, + { + 'name': 'InGeorgian', + 'bmp': '\u10A0-\u10FF' + }, + { + 'name': 'InGeorgian_Extended', + 'bmp': '\u1C90-\u1CBF' + }, + { + 'name': 'InGeorgian_Supplement', + 'bmp': '\u2D00-\u2D2F' + }, + { + 'name': 'InGlagolitic', + 'bmp': '\u2C00-\u2C5F' + }, + { + 'name': 'InGlagolitic_Supplement', + 'astral': '\uD838[\uDC00-\uDC2F]' + }, + { + 'name': 'InGothic', + 'astral': '\uD800[\uDF30-\uDF4F]' + }, + { + 'name': 'InGrantha', + 'astral': '\uD804[\uDF00-\uDF7F]' + }, + { + 'name': 'InGreek_And_Coptic', + 'bmp': '\u0370-\u03FF' + }, + { + 'name': 'InGreek_Extended', + 'bmp': '\u1F00-\u1FFF' + }, + { + 'name': 'InGujarati', + 'bmp': '\u0A80-\u0AFF' + }, + { + 'name': 'InGunjala_Gondi', + 'astral': '\uD807[\uDD60-\uDDAF]' + }, + { + 'name': 'InGurmukhi', + 'bmp': '\u0A00-\u0A7F' + }, + { + 'name': 'InHalfwidth_And_Fullwidth_Forms', + 'bmp': '\uFF00-\uFFEF' + }, + { + 'name': 'InHangul_Compatibility_Jamo', + 'bmp': '\u3130-\u318F' + }, + { + 'name': 'InHangul_Jamo', + 'bmp': '\u1100-\u11FF' + }, + { + 'name': 'InHangul_Jamo_Extended_A', + 'bmp': '\uA960-\uA97F' + }, + { + 'name': 'InHangul_Jamo_Extended_B', + 'bmp': '\uD7B0-\uD7FF' + }, + { + 'name': 'InHangul_Syllables', + 'bmp': '\uAC00-\uD7AF' + }, + { + 'name': 'InHanifi_Rohingya', + 'astral': '\uD803[\uDD00-\uDD3F]' + }, + { + 'name': 'InHanunoo', + 'bmp': '\u1720-\u173F' + }, + { + 'name': 'InHatran', + 'astral': '\uD802[\uDCE0-\uDCFF]' + }, + { + 'name': 'InHebrew', + 'bmp': '\u0590-\u05FF' + }, + { + 'name': 'InHigh_Private_Use_Surrogates', + 'bmp': '\uDB80-\uDBFF' + }, + { + 'name': 'InHigh_Surrogates', + 'bmp': '\uD800-\uDB7F' + }, + { + 'name': 'InHiragana', + 'bmp': '\u3040-\u309F' + }, + { + 'name': 'InIPA_Extensions', + 'bmp': '\u0250-\u02AF' + }, + { + 'name': 'InIdeographic_Description_Characters', + 'bmp': '\u2FF0-\u2FFF' + }, + { + 'name': 'InIdeographic_Symbols_And_Punctuation', + 'astral': '\uD81B[\uDFE0-\uDFFF]' + }, + { + 'name': 'InImperial_Aramaic', + 'astral': '\uD802[\uDC40-\uDC5F]' + }, + { + 'name': 'InIndic_Siyaq_Numbers', + 'astral': '\uD83B[\uDC70-\uDCBF]' + }, + { + 'name': 'InInscriptional_Pahlavi', + 'astral': '\uD802[\uDF60-\uDF7F]' + }, + { + 'name': 'InInscriptional_Parthian', + 'astral': '\uD802[\uDF40-\uDF5F]' + }, + { + 'name': 'InJavanese', + 'bmp': '\uA980-\uA9DF' + }, + { + 'name': 'InKaithi', + 'astral': '\uD804[\uDC80-\uDCCF]' + }, + { + 'name': 'InKana_Extended_A', + 'astral': '\uD82C[\uDD00-\uDD2F]' + }, + { + 'name': 'InKana_Supplement', + 'astral': '\uD82C[\uDC00-\uDCFF]' + }, + { + 'name': 'InKanbun', + 'bmp': '\u3190-\u319F' + }, + { + 'name': 'InKangxi_Radicals', + 'bmp': '\u2F00-\u2FDF' + }, + { + 'name': 'InKannada', + 'bmp': '\u0C80-\u0CFF' + }, + { + 'name': 'InKatakana', + 'bmp': '\u30A0-\u30FF' + }, + { + 'name': 'InKatakana_Phonetic_Extensions', + 'bmp': '\u31F0-\u31FF' + }, + { + 'name': 'InKayah_Li', + 'bmp': '\uA900-\uA92F' + }, + { + 'name': 'InKharoshthi', + 'astral': '\uD802[\uDE00-\uDE5F]' + }, + { + 'name': 'InKhmer', + 'bmp': '\u1780-\u17FF' + }, + { + 'name': 'InKhmer_Symbols', + 'bmp': '\u19E0-\u19FF' + }, + { + 'name': 'InKhojki', + 'astral': '\uD804[\uDE00-\uDE4F]' + }, + { + 'name': 'InKhudawadi', + 'astral': '\uD804[\uDEB0-\uDEFF]' + }, + { + 'name': 'InLao', + 'bmp': '\u0E80-\u0EFF' + }, + { + 'name': 'InLatin_1_Supplement', + 'bmp': '\x80-\xFF' + }, + { + 'name': 'InLatin_Extended_A', + 'bmp': '\u0100-\u017F' + }, + { + 'name': 'InLatin_Extended_Additional', + 'bmp': '\u1E00-\u1EFF' + }, + { + 'name': 'InLatin_Extended_B', + 'bmp': '\u0180-\u024F' + }, + { + 'name': 'InLatin_Extended_C', + 'bmp': '\u2C60-\u2C7F' + }, + { + 'name': 'InLatin_Extended_D', + 'bmp': '\uA720-\uA7FF' + }, + { + 'name': 'InLatin_Extended_E', + 'bmp': '\uAB30-\uAB6F' + }, + { + 'name': 'InLepcha', + 'bmp': '\u1C00-\u1C4F' + }, + { + 'name': 'InLetterlike_Symbols', + 'bmp': '\u2100-\u214F' + }, + { + 'name': 'InLimbu', + 'bmp': '\u1900-\u194F' + }, + { + 'name': 'InLinear_A', + 'astral': '\uD801[\uDE00-\uDF7F]' + }, + { + 'name': 'InLinear_B_Ideograms', + 'astral': '\uD800[\uDC80-\uDCFF]' + }, + { + 'name': 'InLinear_B_Syllabary', + 'astral': '\uD800[\uDC00-\uDC7F]' + }, + { + 'name': 'InLisu', + 'bmp': '\uA4D0-\uA4FF' + }, + { + 'name': 'InLow_Surrogates', + 'bmp': '\uDC00-\uDFFF' + }, + { + 'name': 'InLycian', + 'astral': '\uD800[\uDE80-\uDE9F]' + }, + { + 'name': 'InLydian', + 'astral': '\uD802[\uDD20-\uDD3F]' + }, + { + 'name': 'InMahajani', + 'astral': '\uD804[\uDD50-\uDD7F]' + }, + { + 'name': 'InMahjong_Tiles', + 'astral': '\uD83C[\uDC00-\uDC2F]' + }, + { + 'name': 'InMakasar', + 'astral': '\uD807[\uDEE0-\uDEFF]' + }, + { + 'name': 'InMalayalam', + 'bmp': '\u0D00-\u0D7F' + }, + { + 'name': 'InMandaic', + 'bmp': '\u0840-\u085F' + }, + { + 'name': 'InManichaean', + 'astral': '\uD802[\uDEC0-\uDEFF]' + }, + { + 'name': 'InMarchen', + 'astral': '\uD807[\uDC70-\uDCBF]' + }, + { + 'name': 'InMasaram_Gondi', + 'astral': '\uD807[\uDD00-\uDD5F]' + }, + { + 'name': 'InMathematical_Alphanumeric_Symbols', + 'astral': '\uD835[\uDC00-\uDFFF]' + }, + { + 'name': 'InMathematical_Operators', + 'bmp': '\u2200-\u22FF' + }, + { + 'name': 'InMayan_Numerals', + 'astral': '\uD834[\uDEE0-\uDEFF]' + }, + { + 'name': 'InMedefaidrin', + 'astral': '\uD81B[\uDE40-\uDE9F]' + }, + { + 'name': 'InMeetei_Mayek', + 'bmp': '\uABC0-\uABFF' + }, + { + 'name': 'InMeetei_Mayek_Extensions', + 'bmp': '\uAAE0-\uAAFF' + }, + { + 'name': 'InMende_Kikakui', + 'astral': '\uD83A[\uDC00-\uDCDF]' + }, + { + 'name': 'InMeroitic_Cursive', + 'astral': '\uD802[\uDDA0-\uDDFF]' + }, + { + 'name': 'InMeroitic_Hieroglyphs', + 'astral': '\uD802[\uDD80-\uDD9F]' + }, + { + 'name': 'InMiao', + 'astral': '\uD81B[\uDF00-\uDF9F]' + }, + { + 'name': 'InMiscellaneous_Mathematical_Symbols_A', + 'bmp': '\u27C0-\u27EF' + }, + { + 'name': 'InMiscellaneous_Mathematical_Symbols_B', + 'bmp': '\u2980-\u29FF' + }, + { + 'name': 'InMiscellaneous_Symbols', + 'bmp': '\u2600-\u26FF' + }, + { + 'name': 'InMiscellaneous_Symbols_And_Arrows', + 'bmp': '\u2B00-\u2BFF' + }, + { + 'name': 'InMiscellaneous_Symbols_And_Pictographs', + 'astral': '\uD83C[\uDF00-\uDFFF]|\uD83D[\uDC00-\uDDFF]' + }, + { + 'name': 'InMiscellaneous_Technical', + 'bmp': '\u2300-\u23FF' + }, + { + 'name': 'InModi', + 'astral': '\uD805[\uDE00-\uDE5F]' + }, + { + 'name': 'InModifier_Tone_Letters', + 'bmp': '\uA700-\uA71F' + }, + { + 'name': 'InMongolian', + 'bmp': '\u1800-\u18AF' + }, + { + 'name': 'InMongolian_Supplement', + 'astral': '\uD805[\uDE60-\uDE7F]' + }, + { + 'name': 'InMro', + 'astral': '\uD81A[\uDE40-\uDE6F]' + }, + { + 'name': 'InMultani', + 'astral': '\uD804[\uDE80-\uDEAF]' + }, + { + 'name': 'InMusical_Symbols', + 'astral': '\uD834[\uDD00-\uDDFF]' + }, + { + 'name': 'InMyanmar', + 'bmp': '\u1000-\u109F' + }, + { + 'name': 'InMyanmar_Extended_A', + 'bmp': '\uAA60-\uAA7F' + }, + { + 'name': 'InMyanmar_Extended_B', + 'bmp': '\uA9E0-\uA9FF' + }, + { + 'name': 'InNKo', + 'bmp': '\u07C0-\u07FF' + }, + { + 'name': 'InNabataean', + 'astral': '\uD802[\uDC80-\uDCAF]' + }, + { + 'name': 'InNew_Tai_Lue', + 'bmp': '\u1980-\u19DF' + }, + { + 'name': 'InNewa', + 'astral': '\uD805[\uDC00-\uDC7F]' + }, + { + 'name': 'InNumber_Forms', + 'bmp': '\u2150-\u218F' + }, + { + 'name': 'InNushu', + 'astral': '\uD82C[\uDD70-\uDEFF]' + }, + { + 'name': 'InOgham', + 'bmp': '\u1680-\u169F' + }, + { + 'name': 'InOl_Chiki', + 'bmp': '\u1C50-\u1C7F' + }, + { + 'name': 'InOld_Hungarian', + 'astral': '\uD803[\uDC80-\uDCFF]' + }, + { + 'name': 'InOld_Italic', + 'astral': '\uD800[\uDF00-\uDF2F]' + }, + { + 'name': 'InOld_North_Arabian', + 'astral': '\uD802[\uDE80-\uDE9F]' + }, + { + 'name': 'InOld_Permic', + 'astral': '\uD800[\uDF50-\uDF7F]' + }, + { + 'name': 'InOld_Persian', + 'astral': '\uD800[\uDFA0-\uDFDF]' + }, + { + 'name': 'InOld_Sogdian', + 'astral': '\uD803[\uDF00-\uDF2F]' + }, + { + 'name': 'InOld_South_Arabian', + 'astral': '\uD802[\uDE60-\uDE7F]' + }, + { + 'name': 'InOld_Turkic', + 'astral': '\uD803[\uDC00-\uDC4F]' + }, + { + 'name': 'InOptical_Character_Recognition', + 'bmp': '\u2440-\u245F' + }, + { + 'name': 'InOriya', + 'bmp': '\u0B00-\u0B7F' + }, + { + 'name': 'InOrnamental_Dingbats', + 'astral': '\uD83D[\uDE50-\uDE7F]' + }, + { + 'name': 'InOsage', + 'astral': '\uD801[\uDCB0-\uDCFF]' + }, + { + 'name': 'InOsmanya', + 'astral': '\uD801[\uDC80-\uDCAF]' + }, + { + 'name': 'InPahawh_Hmong', + 'astral': '\uD81A[\uDF00-\uDF8F]' + }, + { + 'name': 'InPalmyrene', + 'astral': '\uD802[\uDC60-\uDC7F]' + }, + { + 'name': 'InPau_Cin_Hau', + 'astral': '\uD806[\uDEC0-\uDEFF]' + }, + { + 'name': 'InPhags_Pa', + 'bmp': '\uA840-\uA87F' + }, + { + 'name': 'InPhaistos_Disc', + 'astral': '\uD800[\uDDD0-\uDDFF]' + }, + { + 'name': 'InPhoenician', + 'astral': '\uD802[\uDD00-\uDD1F]' + }, + { + 'name': 'InPhonetic_Extensions', + 'bmp': '\u1D00-\u1D7F' + }, + { + 'name': 'InPhonetic_Extensions_Supplement', + 'bmp': '\u1D80-\u1DBF' + }, + { + 'name': 'InPlaying_Cards', + 'astral': '\uD83C[\uDCA0-\uDCFF]' + }, + { + 'name': 'InPrivate_Use_Area', + 'bmp': '\uE000-\uF8FF' + }, + { + 'name': 'InPsalter_Pahlavi', + 'astral': '\uD802[\uDF80-\uDFAF]' + }, + { + 'name': 'InRejang', + 'bmp': '\uA930-\uA95F' + }, + { + 'name': 'InRumi_Numeral_Symbols', + 'astral': '\uD803[\uDE60-\uDE7F]' + }, + { + 'name': 'InRunic', + 'bmp': '\u16A0-\u16FF' + }, + { + 'name': 'InSamaritan', + 'bmp': '\u0800-\u083F' + }, + { + 'name': 'InSaurashtra', + 'bmp': '\uA880-\uA8DF' + }, + { + 'name': 'InSharada', + 'astral': '\uD804[\uDD80-\uDDDF]' + }, + { + 'name': 'InShavian', + 'astral': '\uD801[\uDC50-\uDC7F]' + }, + { + 'name': 'InShorthand_Format_Controls', + 'astral': '\uD82F[\uDCA0-\uDCAF]' + }, + { + 'name': 'InSiddham', + 'astral': '\uD805[\uDD80-\uDDFF]' + }, + { + 'name': 'InSinhala', + 'bmp': '\u0D80-\u0DFF' + }, + { + 'name': 'InSinhala_Archaic_Numbers', + 'astral': '\uD804[\uDDE0-\uDDFF]' + }, + { + 'name': 'InSmall_Form_Variants', + 'bmp': '\uFE50-\uFE6F' + }, + { + 'name': 'InSogdian', + 'astral': '\uD803[\uDF30-\uDF6F]' + }, + { + 'name': 'InSora_Sompeng', + 'astral': '\uD804[\uDCD0-\uDCFF]' + }, + { + 'name': 'InSoyombo', + 'astral': '\uD806[\uDE50-\uDEAF]' + }, + { + 'name': 'InSpacing_Modifier_Letters', + 'bmp': '\u02B0-\u02FF' + }, + { + 'name': 'InSpecials', + 'bmp': '\uFFF0-\uFFFF' + }, + { + 'name': 'InSundanese', + 'bmp': '\u1B80-\u1BBF' + }, + { + 'name': 'InSundanese_Supplement', + 'bmp': '\u1CC0-\u1CCF' + }, + { + 'name': 'InSuperscripts_And_Subscripts', + 'bmp': '\u2070-\u209F' + }, + { + 'name': 'InSupplemental_Arrows_A', + 'bmp': '\u27F0-\u27FF' + }, + { + 'name': 'InSupplemental_Arrows_B', + 'bmp': '\u2900-\u297F' + }, + { + 'name': 'InSupplemental_Arrows_C', + 'astral': '\uD83E[\uDC00-\uDCFF]' + }, + { + 'name': 'InSupplemental_Mathematical_Operators', + 'bmp': '\u2A00-\u2AFF' + }, + { + 'name': 'InSupplemental_Punctuation', + 'bmp': '\u2E00-\u2E7F' + }, + { + 'name': 'InSupplemental_Symbols_And_Pictographs', + 'astral': '\uD83E[\uDD00-\uDDFF]' + }, + { + 'name': 'InSupplementary_Private_Use_Area_A', + 'astral': '[\uDB80-\uDBBF][\uDC00-\uDFFF]' + }, + { + 'name': 'InSupplementary_Private_Use_Area_B', + 'astral': '[\uDBC0-\uDBFF][\uDC00-\uDFFF]' + }, + { + 'name': 'InSutton_SignWriting', + 'astral': '\uD836[\uDC00-\uDEAF]' + }, + { + 'name': 'InSyloti_Nagri', + 'bmp': '\uA800-\uA82F' + }, + { + 'name': 'InSyriac', + 'bmp': '\u0700-\u074F' + }, + { + 'name': 'InSyriac_Supplement', + 'bmp': '\u0860-\u086F' + }, + { + 'name': 'InTagalog', + 'bmp': '\u1700-\u171F' + }, + { + 'name': 'InTagbanwa', + 'bmp': '\u1760-\u177F' + }, + { + 'name': 'InTags', + 'astral': '\uDB40[\uDC00-\uDC7F]' + }, + { + 'name': 'InTai_Le', + 'bmp': '\u1950-\u197F' + }, + { + 'name': 'InTai_Tham', + 'bmp': '\u1A20-\u1AAF' + }, + { + 'name': 'InTai_Viet', + 'bmp': '\uAA80-\uAADF' + }, + { + 'name': 'InTai_Xuan_Jing_Symbols', + 'astral': '\uD834[\uDF00-\uDF5F]' + }, + { + 'name': 'InTakri', + 'astral': '\uD805[\uDE80-\uDECF]' + }, + { + 'name': 'InTamil', + 'bmp': '\u0B80-\u0BFF' + }, + { + 'name': 'InTangut', + 'astral': '[\uD81C-\uD821][\uDC00-\uDFFF]' + }, + { + 'name': 'InTangut_Components', + 'astral': '\uD822[\uDC00-\uDEFF]' + }, + { + 'name': 'InTelugu', + 'bmp': '\u0C00-\u0C7F' + }, + { + 'name': 'InThaana', + 'bmp': '\u0780-\u07BF' + }, + { + 'name': 'InThai', + 'bmp': '\u0E00-\u0E7F' + }, + { + 'name': 'InTibetan', + 'bmp': '\u0F00-\u0FFF' + }, + { + 'name': 'InTifinagh', + 'bmp': '\u2D30-\u2D7F' + }, + { + 'name': 'InTirhuta', + 'astral': '\uD805[\uDC80-\uDCDF]' + }, + { + 'name': 'InTransport_And_Map_Symbols', + 'astral': '\uD83D[\uDE80-\uDEFF]' + }, + { + 'name': 'InUgaritic', + 'astral': '\uD800[\uDF80-\uDF9F]' + }, + { + 'name': 'InUnified_Canadian_Aboriginal_Syllabics', + 'bmp': '\u1400-\u167F' + }, + { + 'name': 'InUnified_Canadian_Aboriginal_Syllabics_Extended', + 'bmp': '\u18B0-\u18FF' + }, + { + 'name': 'InVai', + 'bmp': '\uA500-\uA63F' + }, + { + 'name': 'InVariation_Selectors', + 'bmp': '\uFE00-\uFE0F' + }, + { + 'name': 'InVariation_Selectors_Supplement', + 'astral': '\uDB40[\uDD00-\uDDEF]' + }, + { + 'name': 'InVedic_Extensions', + 'bmp': '\u1CD0-\u1CFF' + }, + { + 'name': 'InVertical_Forms', + 'bmp': '\uFE10-\uFE1F' + }, + { + 'name': 'InWarang_Citi', + 'astral': '\uD806[\uDCA0-\uDCFF]' + }, + { + 'name': 'InYi_Radicals', + 'bmp': '\uA490-\uA4CF' + }, + { + 'name': 'InYi_Syllables', + 'bmp': '\uA000-\uA48F' + }, + { + 'name': 'InYijing_Hexagram_Symbols', + 'bmp': '\u4DC0-\u4DFF' + }, + { + 'name': 'InZanabazar_Square', + 'astral': '\uD806[\uDE00-\uDE4F]' + } +]; + +var unicodeBlocks = createCommonjsModule(function (module, exports) { +"use strict"; + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.default = void 0; + +var _blocks = _interopRequireDefault(blocks); + +function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } + +/*! + * XRegExp Unicode Blocks 4.2.0 + * + * Steven Levithan (c) 2010-present MIT License + * Unicode data by Mathias Bynens + */ +var _default = function _default(XRegExp) { + /** + * Adds support for all Unicode blocks. Block names use the prefix 'In'. E.g., + * `\p{InBasicLatin}`. Token names are case insensitive, and any spaces, hyphens, and + * underscores are ignored. + * + * Uses Unicode 11.0.0. + * + * @requires XRegExp, Unicode Base + */ + if (!XRegExp.addUnicodeData) { + throw new ReferenceError('Unicode Base must be loaded before Unicode Blocks'); + } + + XRegExp.addUnicodeData(_blocks.default); +}; + +exports.default = _default; +module.exports = exports["default"]; +}); + +unwrapExports(unicodeBlocks); + +var categories = [ + { + 'name': 'C', + 'alias': 'Other', + 'isBmpLast': true, + 'bmp': '\0-\x1F\x7F-\x9F\xAD\u0378\u0379\u0380-\u0383\u038B\u038D\u03A2\u0530\u0557\u0558\u058B\u058C\u0590\u05C8-\u05CF\u05EB-\u05EE\u05F5-\u0605\u061C\u061D\u06DD\u070E\u070F\u074B\u074C\u07B2-\u07BF\u07FB\u07FC\u082E\u082F\u083F\u085C\u085D\u085F\u086B-\u089F\u08B5\u08BE-\u08D2\u08E2\u0984\u098D\u098E\u0991\u0992\u09A9\u09B1\u09B3-\u09B5\u09BA\u09BB\u09C5\u09C6\u09C9\u09CA\u09CF-\u09D6\u09D8-\u09DB\u09DE\u09E4\u09E5\u09FF\u0A00\u0A04\u0A0B-\u0A0E\u0A11\u0A12\u0A29\u0A31\u0A34\u0A37\u0A3A\u0A3B\u0A3D\u0A43-\u0A46\u0A49\u0A4A\u0A4E-\u0A50\u0A52-\u0A58\u0A5D\u0A5F-\u0A65\u0A77-\u0A80\u0A84\u0A8E\u0A92\u0AA9\u0AB1\u0AB4\u0ABA\u0ABB\u0AC6\u0ACA\u0ACE\u0ACF\u0AD1-\u0ADF\u0AE4\u0AE5\u0AF2-\u0AF8\u0B00\u0B04\u0B0D\u0B0E\u0B11\u0B12\u0B29\u0B31\u0B34\u0B3A\u0B3B\u0B45\u0B46\u0B49\u0B4A\u0B4E-\u0B55\u0B58-\u0B5B\u0B5E\u0B64\u0B65\u0B78-\u0B81\u0B84\u0B8B-\u0B8D\u0B91\u0B96-\u0B98\u0B9B\u0B9D\u0BA0-\u0BA2\u0BA5-\u0BA7\u0BAB-\u0BAD\u0BBA-\u0BBD\u0BC3-\u0BC5\u0BC9\u0BCE\u0BCF\u0BD1-\u0BD6\u0BD8-\u0BE5\u0BFB-\u0BFF\u0C0D\u0C11\u0C29\u0C3A-\u0C3C\u0C45\u0C49\u0C4E-\u0C54\u0C57\u0C5B-\u0C5F\u0C64\u0C65\u0C70-\u0C77\u0C8D\u0C91\u0CA9\u0CB4\u0CBA\u0CBB\u0CC5\u0CC9\u0CCE-\u0CD4\u0CD7-\u0CDD\u0CDF\u0CE4\u0CE5\u0CF0\u0CF3-\u0CFF\u0D04\u0D0D\u0D11\u0D45\u0D49\u0D50-\u0D53\u0D64\u0D65\u0D80\u0D81\u0D84\u0D97-\u0D99\u0DB2\u0DBC\u0DBE\u0DBF\u0DC7-\u0DC9\u0DCB-\u0DCE\u0DD5\u0DD7\u0DE0-\u0DE5\u0DF0\u0DF1\u0DF5-\u0E00\u0E3B-\u0E3E\u0E5C-\u0E80\u0E83\u0E85\u0E86\u0E89\u0E8B\u0E8C\u0E8E-\u0E93\u0E98\u0EA0\u0EA4\u0EA6\u0EA8\u0EA9\u0EAC\u0EBA\u0EBE\u0EBF\u0EC5\u0EC7\u0ECE\u0ECF\u0EDA\u0EDB\u0EE0-\u0EFF\u0F48\u0F6D-\u0F70\u0F98\u0FBD\u0FCD\u0FDB-\u0FFF\u10C6\u10C8-\u10CC\u10CE\u10CF\u1249\u124E\u124F\u1257\u1259\u125E\u125F\u1289\u128E\u128F\u12B1\u12B6\u12B7\u12BF\u12C1\u12C6\u12C7\u12D7\u1311\u1316\u1317\u135B\u135C\u137D-\u137F\u139A-\u139F\u13F6\u13F7\u13FE\u13FF\u169D-\u169F\u16F9-\u16FF\u170D\u1715-\u171F\u1737-\u173F\u1754-\u175F\u176D\u1771\u1774-\u177F\u17DE\u17DF\u17EA-\u17EF\u17FA-\u17FF\u180E\u180F\u181A-\u181F\u1879-\u187F\u18AB-\u18AF\u18F6-\u18FF\u191F\u192C-\u192F\u193C-\u193F\u1941-\u1943\u196E\u196F\u1975-\u197F\u19AC-\u19AF\u19CA-\u19CF\u19DB-\u19DD\u1A1C\u1A1D\u1A5F\u1A7D\u1A7E\u1A8A-\u1A8F\u1A9A-\u1A9F\u1AAE\u1AAF\u1ABF-\u1AFF\u1B4C-\u1B4F\u1B7D-\u1B7F\u1BF4-\u1BFB\u1C38-\u1C3A\u1C4A-\u1C4C\u1C89-\u1C8F\u1CBB\u1CBC\u1CC8-\u1CCF\u1CFA-\u1CFF\u1DFA\u1F16\u1F17\u1F1E\u1F1F\u1F46\u1F47\u1F4E\u1F4F\u1F58\u1F5A\u1F5C\u1F5E\u1F7E\u1F7F\u1FB5\u1FC5\u1FD4\u1FD5\u1FDC\u1FF0\u1FF1\u1FF5\u1FFF\u200B-\u200F\u202A-\u202E\u2060-\u206F\u2072\u2073\u208F\u209D-\u209F\u20C0-\u20CF\u20F1-\u20FF\u218C-\u218F\u2427-\u243F\u244B-\u245F\u2B74\u2B75\u2B96\u2B97\u2BC9\u2BFF\u2C2F\u2C5F\u2CF4-\u2CF8\u2D26\u2D28-\u2D2C\u2D2E\u2D2F\u2D68-\u2D6E\u2D71-\u2D7E\u2D97-\u2D9F\u2DA7\u2DAF\u2DB7\u2DBF\u2DC7\u2DCF\u2DD7\u2DDF\u2E4F-\u2E7F\u2E9A\u2EF4-\u2EFF\u2FD6-\u2FEF\u2FFC-\u2FFF\u3040\u3097\u3098\u3100-\u3104\u3130\u318F\u31BB-\u31BF\u31E4-\u31EF\u321F\u32FF\u4DB6-\u4DBF\u9FF0-\u9FFF\uA48D-\uA48F\uA4C7-\uA4CF\uA62C-\uA63F\uA6F8-\uA6FF\uA7BA-\uA7F6\uA82C-\uA82F\uA83A-\uA83F\uA878-\uA87F\uA8C6-\uA8CD\uA8DA-\uA8DF\uA954-\uA95E\uA97D-\uA97F\uA9CE\uA9DA-\uA9DD\uA9FF\uAA37-\uAA3F\uAA4E\uAA4F\uAA5A\uAA5B\uAAC3-\uAADA\uAAF7-\uAB00\uAB07\uAB08\uAB0F\uAB10\uAB17-\uAB1F\uAB27\uAB2F\uAB66-\uAB6F\uABEE\uABEF\uABFA-\uABFF\uD7A4-\uD7AF\uD7C7-\uD7CA\uD7FC-\uF8FF\uFA6E\uFA6F\uFADA-\uFAFF\uFB07-\uFB12\uFB18-\uFB1C\uFB37\uFB3D\uFB3F\uFB42\uFB45\uFBC2-\uFBD2\uFD40-\uFD4F\uFD90\uFD91\uFDC8-\uFDEF\uFDFE\uFDFF\uFE1A-\uFE1F\uFE53\uFE67\uFE6C-\uFE6F\uFE75\uFEFD-\uFF00\uFFBF-\uFFC1\uFFC8\uFFC9\uFFD0\uFFD1\uFFD8\uFFD9\uFFDD-\uFFDF\uFFE7\uFFEF-\uFFFB\uFFFE\uFFFF', + 'astral': '\uD800[\uDC0C\uDC27\uDC3B\uDC3E\uDC4E\uDC4F\uDC5E-\uDC7F\uDCFB-\uDCFF\uDD03-\uDD06\uDD34-\uDD36\uDD8F\uDD9C-\uDD9F\uDDA1-\uDDCF\uDDFE-\uDE7F\uDE9D-\uDE9F\uDED1-\uDEDF\uDEFC-\uDEFF\uDF24-\uDF2C\uDF4B-\uDF4F\uDF7B-\uDF7F\uDF9E\uDFC4-\uDFC7\uDFD6-\uDFFF]|\uD801[\uDC9E\uDC9F\uDCAA-\uDCAF\uDCD4-\uDCD7\uDCFC-\uDCFF\uDD28-\uDD2F\uDD64-\uDD6E\uDD70-\uDDFF\uDF37-\uDF3F\uDF56-\uDF5F\uDF68-\uDFFF]|\uD802[\uDC06\uDC07\uDC09\uDC36\uDC39-\uDC3B\uDC3D\uDC3E\uDC56\uDC9F-\uDCA6\uDCB0-\uDCDF\uDCF3\uDCF6-\uDCFA\uDD1C-\uDD1E\uDD3A-\uDD3E\uDD40-\uDD7F\uDDB8-\uDDBB\uDDD0\uDDD1\uDE04\uDE07-\uDE0B\uDE14\uDE18\uDE36\uDE37\uDE3B-\uDE3E\uDE49-\uDE4F\uDE59-\uDE5F\uDEA0-\uDEBF\uDEE7-\uDEEA\uDEF7-\uDEFF\uDF36-\uDF38\uDF56\uDF57\uDF73-\uDF77\uDF92-\uDF98\uDF9D-\uDFA8\uDFB0-\uDFFF]|\uD803[\uDC49-\uDC7F\uDCB3-\uDCBF\uDCF3-\uDCF9\uDD28-\uDD2F\uDD3A-\uDE5F\uDE7F-\uDEFF\uDF28-\uDF2F\uDF5A-\uDFFF]|\uD804[\uDC4E-\uDC51\uDC70-\uDC7E\uDCBD\uDCC2-\uDCCF\uDCE9-\uDCEF\uDCFA-\uDCFF\uDD35\uDD47-\uDD4F\uDD77-\uDD7F\uDDCE\uDDCF\uDDE0\uDDF5-\uDDFF\uDE12\uDE3F-\uDE7F\uDE87\uDE89\uDE8E\uDE9E\uDEAA-\uDEAF\uDEEB-\uDEEF\uDEFA-\uDEFF\uDF04\uDF0D\uDF0E\uDF11\uDF12\uDF29\uDF31\uDF34\uDF3A\uDF45\uDF46\uDF49\uDF4A\uDF4E\uDF4F\uDF51-\uDF56\uDF58-\uDF5C\uDF64\uDF65\uDF6D-\uDF6F\uDF75-\uDFFF]|\uD805[\uDC5A\uDC5C\uDC5F-\uDC7F\uDCC8-\uDCCF\uDCDA-\uDD7F\uDDB6\uDDB7\uDDDE-\uDDFF\uDE45-\uDE4F\uDE5A-\uDE5F\uDE6D-\uDE7F\uDEB8-\uDEBF\uDECA-\uDEFF\uDF1B\uDF1C\uDF2C-\uDF2F\uDF40-\uDFFF]|\uD806[\uDC3C-\uDC9F\uDCF3-\uDCFE\uDD00-\uDDFF\uDE48-\uDE4F\uDE84\uDE85\uDEA3-\uDEBF\uDEF9-\uDFFF]|\uD807[\uDC09\uDC37\uDC46-\uDC4F\uDC6D-\uDC6F\uDC90\uDC91\uDCA8\uDCB7-\uDCFF\uDD07\uDD0A\uDD37-\uDD39\uDD3B\uDD3E\uDD48-\uDD4F\uDD5A-\uDD5F\uDD66\uDD69\uDD8F\uDD92\uDD99-\uDD9F\uDDAA-\uDEDF\uDEF9-\uDFFF]|\uD808[\uDF9A-\uDFFF]|\uD809[\uDC6F\uDC75-\uDC7F\uDD44-\uDFFF]|[\uD80A\uD80B\uD80E-\uD810\uD812-\uD819\uD823-\uD82B\uD82D\uD82E\uD830-\uD833\uD837\uD839\uD83F\uD87B-\uD87D\uD87F-\uDB3F\uDB41-\uDBFF][\uDC00-\uDFFF]|\uD80D[\uDC2F-\uDFFF]|\uD811[\uDE47-\uDFFF]|\uD81A[\uDE39-\uDE3F\uDE5F\uDE6A-\uDE6D\uDE70-\uDECF\uDEEE\uDEEF\uDEF6-\uDEFF\uDF46-\uDF4F\uDF5A\uDF62\uDF78-\uDF7C\uDF90-\uDFFF]|\uD81B[\uDC00-\uDE3F\uDE9B-\uDEFF\uDF45-\uDF4F\uDF7F-\uDF8E\uDFA0-\uDFDF\uDFE2-\uDFFF]|\uD821[\uDFF2-\uDFFF]|\uD822[\uDEF3-\uDFFF]|\uD82C[\uDD1F-\uDD6F\uDEFC-\uDFFF]|\uD82F[\uDC6B-\uDC6F\uDC7D-\uDC7F\uDC89-\uDC8F\uDC9A\uDC9B\uDCA0-\uDFFF]|\uD834[\uDCF6-\uDCFF\uDD27\uDD28\uDD73-\uDD7A\uDDE9-\uDDFF\uDE46-\uDEDF\uDEF4-\uDEFF\uDF57-\uDF5F\uDF79-\uDFFF]|\uD835[\uDC55\uDC9D\uDCA0\uDCA1\uDCA3\uDCA4\uDCA7\uDCA8\uDCAD\uDCBA\uDCBC\uDCC4\uDD06\uDD0B\uDD0C\uDD15\uDD1D\uDD3A\uDD3F\uDD45\uDD47-\uDD49\uDD51\uDEA6\uDEA7\uDFCC\uDFCD]|\uD836[\uDE8C-\uDE9A\uDEA0\uDEB0-\uDFFF]|\uD838[\uDC07\uDC19\uDC1A\uDC22\uDC25\uDC2B-\uDFFF]|\uD83A[\uDCC5\uDCC6\uDCD7-\uDCFF\uDD4B-\uDD4F\uDD5A-\uDD5D\uDD60-\uDFFF]|\uD83B[\uDC00-\uDC70\uDCB5-\uDDFF\uDE04\uDE20\uDE23\uDE25\uDE26\uDE28\uDE33\uDE38\uDE3A\uDE3C-\uDE41\uDE43-\uDE46\uDE48\uDE4A\uDE4C\uDE50\uDE53\uDE55\uDE56\uDE58\uDE5A\uDE5C\uDE5E\uDE60\uDE63\uDE65\uDE66\uDE6B\uDE73\uDE78\uDE7D\uDE7F\uDE8A\uDE9C-\uDEA0\uDEA4\uDEAA\uDEBC-\uDEEF\uDEF2-\uDFFF]|\uD83C[\uDC2C-\uDC2F\uDC94-\uDC9F\uDCAF\uDCB0\uDCC0\uDCD0\uDCF6-\uDCFF\uDD0D-\uDD0F\uDD6C-\uDD6F\uDDAD-\uDDE5\uDE03-\uDE0F\uDE3C-\uDE3F\uDE49-\uDE4F\uDE52-\uDE5F\uDE66-\uDEFF]|\uD83D[\uDED5-\uDEDF\uDEED-\uDEEF\uDEFA-\uDEFF\uDF74-\uDF7F\uDFD9-\uDFFF]|\uD83E[\uDC0C-\uDC0F\uDC48-\uDC4F\uDC5A-\uDC5F\uDC88-\uDC8F\uDCAE-\uDCFF\uDD0C-\uDD0F\uDD3F\uDD71\uDD72\uDD77-\uDD79\uDD7B\uDDA3-\uDDAF\uDDBA-\uDDBF\uDDC3-\uDDCF\uDE00-\uDE5F\uDE6E-\uDFFF]|\uD869[\uDED7-\uDEFF]|\uD86D[\uDF35-\uDF3F]|\uD86E[\uDC1E\uDC1F]|\uD873[\uDEA2-\uDEAF]|\uD87A[\uDFE1-\uDFFF]|\uD87E[\uDE1E-\uDFFF]|\uDB40[\uDC00-\uDCFF\uDDF0-\uDFFF]' + }, + { + 'name': 'Cc', + 'alias': 'Control', + 'bmp': '\0-\x1F\x7F-\x9F' + }, + { + 'name': 'Cf', + 'alias': 'Format', + 'bmp': '\xAD\u0600-\u0605\u061C\u06DD\u070F\u08E2\u180E\u200B-\u200F\u202A-\u202E\u2060-\u2064\u2066-\u206F\uFEFF\uFFF9-\uFFFB', + 'astral': '\uD804[\uDCBD\uDCCD]|\uD82F[\uDCA0-\uDCA3]|\uD834[\uDD73-\uDD7A]|\uDB40[\uDC01\uDC20-\uDC7F]' + }, + { + 'name': 'Cn', + 'alias': 'Unassigned', + 'bmp': '\u0378\u0379\u0380-\u0383\u038B\u038D\u03A2\u0530\u0557\u0558\u058B\u058C\u0590\u05C8-\u05CF\u05EB-\u05EE\u05F5-\u05FF\u061D\u070E\u074B\u074C\u07B2-\u07BF\u07FB\u07FC\u082E\u082F\u083F\u085C\u085D\u085F\u086B-\u089F\u08B5\u08BE-\u08D2\u0984\u098D\u098E\u0991\u0992\u09A9\u09B1\u09B3-\u09B5\u09BA\u09BB\u09C5\u09C6\u09C9\u09CA\u09CF-\u09D6\u09D8-\u09DB\u09DE\u09E4\u09E5\u09FF\u0A00\u0A04\u0A0B-\u0A0E\u0A11\u0A12\u0A29\u0A31\u0A34\u0A37\u0A3A\u0A3B\u0A3D\u0A43-\u0A46\u0A49\u0A4A\u0A4E-\u0A50\u0A52-\u0A58\u0A5D\u0A5F-\u0A65\u0A77-\u0A80\u0A84\u0A8E\u0A92\u0AA9\u0AB1\u0AB4\u0ABA\u0ABB\u0AC6\u0ACA\u0ACE\u0ACF\u0AD1-\u0ADF\u0AE4\u0AE5\u0AF2-\u0AF8\u0B00\u0B04\u0B0D\u0B0E\u0B11\u0B12\u0B29\u0B31\u0B34\u0B3A\u0B3B\u0B45\u0B46\u0B49\u0B4A\u0B4E-\u0B55\u0B58-\u0B5B\u0B5E\u0B64\u0B65\u0B78-\u0B81\u0B84\u0B8B-\u0B8D\u0B91\u0B96-\u0B98\u0B9B\u0B9D\u0BA0-\u0BA2\u0BA5-\u0BA7\u0BAB-\u0BAD\u0BBA-\u0BBD\u0BC3-\u0BC5\u0BC9\u0BCE\u0BCF\u0BD1-\u0BD6\u0BD8-\u0BE5\u0BFB-\u0BFF\u0C0D\u0C11\u0C29\u0C3A-\u0C3C\u0C45\u0C49\u0C4E-\u0C54\u0C57\u0C5B-\u0C5F\u0C64\u0C65\u0C70-\u0C77\u0C8D\u0C91\u0CA9\u0CB4\u0CBA\u0CBB\u0CC5\u0CC9\u0CCE-\u0CD4\u0CD7-\u0CDD\u0CDF\u0CE4\u0CE5\u0CF0\u0CF3-\u0CFF\u0D04\u0D0D\u0D11\u0D45\u0D49\u0D50-\u0D53\u0D64\u0D65\u0D80\u0D81\u0D84\u0D97-\u0D99\u0DB2\u0DBC\u0DBE\u0DBF\u0DC7-\u0DC9\u0DCB-\u0DCE\u0DD5\u0DD7\u0DE0-\u0DE5\u0DF0\u0DF1\u0DF5-\u0E00\u0E3B-\u0E3E\u0E5C-\u0E80\u0E83\u0E85\u0E86\u0E89\u0E8B\u0E8C\u0E8E-\u0E93\u0E98\u0EA0\u0EA4\u0EA6\u0EA8\u0EA9\u0EAC\u0EBA\u0EBE\u0EBF\u0EC5\u0EC7\u0ECE\u0ECF\u0EDA\u0EDB\u0EE0-\u0EFF\u0F48\u0F6D-\u0F70\u0F98\u0FBD\u0FCD\u0FDB-\u0FFF\u10C6\u10C8-\u10CC\u10CE\u10CF\u1249\u124E\u124F\u1257\u1259\u125E\u125F\u1289\u128E\u128F\u12B1\u12B6\u12B7\u12BF\u12C1\u12C6\u12C7\u12D7\u1311\u1316\u1317\u135B\u135C\u137D-\u137F\u139A-\u139F\u13F6\u13F7\u13FE\u13FF\u169D-\u169F\u16F9-\u16FF\u170D\u1715-\u171F\u1737-\u173F\u1754-\u175F\u176D\u1771\u1774-\u177F\u17DE\u17DF\u17EA-\u17EF\u17FA-\u17FF\u180F\u181A-\u181F\u1879-\u187F\u18AB-\u18AF\u18F6-\u18FF\u191F\u192C-\u192F\u193C-\u193F\u1941-\u1943\u196E\u196F\u1975-\u197F\u19AC-\u19AF\u19CA-\u19CF\u19DB-\u19DD\u1A1C\u1A1D\u1A5F\u1A7D\u1A7E\u1A8A-\u1A8F\u1A9A-\u1A9F\u1AAE\u1AAF\u1ABF-\u1AFF\u1B4C-\u1B4F\u1B7D-\u1B7F\u1BF4-\u1BFB\u1C38-\u1C3A\u1C4A-\u1C4C\u1C89-\u1C8F\u1CBB\u1CBC\u1CC8-\u1CCF\u1CFA-\u1CFF\u1DFA\u1F16\u1F17\u1F1E\u1F1F\u1F46\u1F47\u1F4E\u1F4F\u1F58\u1F5A\u1F5C\u1F5E\u1F7E\u1F7F\u1FB5\u1FC5\u1FD4\u1FD5\u1FDC\u1FF0\u1FF1\u1FF5\u1FFF\u2065\u2072\u2073\u208F\u209D-\u209F\u20C0-\u20CF\u20F1-\u20FF\u218C-\u218F\u2427-\u243F\u244B-\u245F\u2B74\u2B75\u2B96\u2B97\u2BC9\u2BFF\u2C2F\u2C5F\u2CF4-\u2CF8\u2D26\u2D28-\u2D2C\u2D2E\u2D2F\u2D68-\u2D6E\u2D71-\u2D7E\u2D97-\u2D9F\u2DA7\u2DAF\u2DB7\u2DBF\u2DC7\u2DCF\u2DD7\u2DDF\u2E4F-\u2E7F\u2E9A\u2EF4-\u2EFF\u2FD6-\u2FEF\u2FFC-\u2FFF\u3040\u3097\u3098\u3100-\u3104\u3130\u318F\u31BB-\u31BF\u31E4-\u31EF\u321F\u32FF\u4DB6-\u4DBF\u9FF0-\u9FFF\uA48D-\uA48F\uA4C7-\uA4CF\uA62C-\uA63F\uA6F8-\uA6FF\uA7BA-\uA7F6\uA82C-\uA82F\uA83A-\uA83F\uA878-\uA87F\uA8C6-\uA8CD\uA8DA-\uA8DF\uA954-\uA95E\uA97D-\uA97F\uA9CE\uA9DA-\uA9DD\uA9FF\uAA37-\uAA3F\uAA4E\uAA4F\uAA5A\uAA5B\uAAC3-\uAADA\uAAF7-\uAB00\uAB07\uAB08\uAB0F\uAB10\uAB17-\uAB1F\uAB27\uAB2F\uAB66-\uAB6F\uABEE\uABEF\uABFA-\uABFF\uD7A4-\uD7AF\uD7C7-\uD7CA\uD7FC-\uD7FF\uFA6E\uFA6F\uFADA-\uFAFF\uFB07-\uFB12\uFB18-\uFB1C\uFB37\uFB3D\uFB3F\uFB42\uFB45\uFBC2-\uFBD2\uFD40-\uFD4F\uFD90\uFD91\uFDC8-\uFDEF\uFDFE\uFDFF\uFE1A-\uFE1F\uFE53\uFE67\uFE6C-\uFE6F\uFE75\uFEFD\uFEFE\uFF00\uFFBF-\uFFC1\uFFC8\uFFC9\uFFD0\uFFD1\uFFD8\uFFD9\uFFDD-\uFFDF\uFFE7\uFFEF-\uFFF8\uFFFE\uFFFF', + 'astral': '\uD800[\uDC0C\uDC27\uDC3B\uDC3E\uDC4E\uDC4F\uDC5E-\uDC7F\uDCFB-\uDCFF\uDD03-\uDD06\uDD34-\uDD36\uDD8F\uDD9C-\uDD9F\uDDA1-\uDDCF\uDDFE-\uDE7F\uDE9D-\uDE9F\uDED1-\uDEDF\uDEFC-\uDEFF\uDF24-\uDF2C\uDF4B-\uDF4F\uDF7B-\uDF7F\uDF9E\uDFC4-\uDFC7\uDFD6-\uDFFF]|\uD801[\uDC9E\uDC9F\uDCAA-\uDCAF\uDCD4-\uDCD7\uDCFC-\uDCFF\uDD28-\uDD2F\uDD64-\uDD6E\uDD70-\uDDFF\uDF37-\uDF3F\uDF56-\uDF5F\uDF68-\uDFFF]|\uD802[\uDC06\uDC07\uDC09\uDC36\uDC39-\uDC3B\uDC3D\uDC3E\uDC56\uDC9F-\uDCA6\uDCB0-\uDCDF\uDCF3\uDCF6-\uDCFA\uDD1C-\uDD1E\uDD3A-\uDD3E\uDD40-\uDD7F\uDDB8-\uDDBB\uDDD0\uDDD1\uDE04\uDE07-\uDE0B\uDE14\uDE18\uDE36\uDE37\uDE3B-\uDE3E\uDE49-\uDE4F\uDE59-\uDE5F\uDEA0-\uDEBF\uDEE7-\uDEEA\uDEF7-\uDEFF\uDF36-\uDF38\uDF56\uDF57\uDF73-\uDF77\uDF92-\uDF98\uDF9D-\uDFA8\uDFB0-\uDFFF]|\uD803[\uDC49-\uDC7F\uDCB3-\uDCBF\uDCF3-\uDCF9\uDD28-\uDD2F\uDD3A-\uDE5F\uDE7F-\uDEFF\uDF28-\uDF2F\uDF5A-\uDFFF]|\uD804[\uDC4E-\uDC51\uDC70-\uDC7E\uDCC2-\uDCCC\uDCCE\uDCCF\uDCE9-\uDCEF\uDCFA-\uDCFF\uDD35\uDD47-\uDD4F\uDD77-\uDD7F\uDDCE\uDDCF\uDDE0\uDDF5-\uDDFF\uDE12\uDE3F-\uDE7F\uDE87\uDE89\uDE8E\uDE9E\uDEAA-\uDEAF\uDEEB-\uDEEF\uDEFA-\uDEFF\uDF04\uDF0D\uDF0E\uDF11\uDF12\uDF29\uDF31\uDF34\uDF3A\uDF45\uDF46\uDF49\uDF4A\uDF4E\uDF4F\uDF51-\uDF56\uDF58-\uDF5C\uDF64\uDF65\uDF6D-\uDF6F\uDF75-\uDFFF]|\uD805[\uDC5A\uDC5C\uDC5F-\uDC7F\uDCC8-\uDCCF\uDCDA-\uDD7F\uDDB6\uDDB7\uDDDE-\uDDFF\uDE45-\uDE4F\uDE5A-\uDE5F\uDE6D-\uDE7F\uDEB8-\uDEBF\uDECA-\uDEFF\uDF1B\uDF1C\uDF2C-\uDF2F\uDF40-\uDFFF]|\uD806[\uDC3C-\uDC9F\uDCF3-\uDCFE\uDD00-\uDDFF\uDE48-\uDE4F\uDE84\uDE85\uDEA3-\uDEBF\uDEF9-\uDFFF]|\uD807[\uDC09\uDC37\uDC46-\uDC4F\uDC6D-\uDC6F\uDC90\uDC91\uDCA8\uDCB7-\uDCFF\uDD07\uDD0A\uDD37-\uDD39\uDD3B\uDD3E\uDD48-\uDD4F\uDD5A-\uDD5F\uDD66\uDD69\uDD8F\uDD92\uDD99-\uDD9F\uDDAA-\uDEDF\uDEF9-\uDFFF]|\uD808[\uDF9A-\uDFFF]|\uD809[\uDC6F\uDC75-\uDC7F\uDD44-\uDFFF]|[\uD80A\uD80B\uD80E-\uD810\uD812-\uD819\uD823-\uD82B\uD82D\uD82E\uD830-\uD833\uD837\uD839\uD83F\uD87B-\uD87D\uD87F-\uDB3F\uDB41-\uDB7F][\uDC00-\uDFFF]|\uD80D[\uDC2F-\uDFFF]|\uD811[\uDE47-\uDFFF]|\uD81A[\uDE39-\uDE3F\uDE5F\uDE6A-\uDE6D\uDE70-\uDECF\uDEEE\uDEEF\uDEF6-\uDEFF\uDF46-\uDF4F\uDF5A\uDF62\uDF78-\uDF7C\uDF90-\uDFFF]|\uD81B[\uDC00-\uDE3F\uDE9B-\uDEFF\uDF45-\uDF4F\uDF7F-\uDF8E\uDFA0-\uDFDF\uDFE2-\uDFFF]|\uD821[\uDFF2-\uDFFF]|\uD822[\uDEF3-\uDFFF]|\uD82C[\uDD1F-\uDD6F\uDEFC-\uDFFF]|\uD82F[\uDC6B-\uDC6F\uDC7D-\uDC7F\uDC89-\uDC8F\uDC9A\uDC9B\uDCA4-\uDFFF]|\uD834[\uDCF6-\uDCFF\uDD27\uDD28\uDDE9-\uDDFF\uDE46-\uDEDF\uDEF4-\uDEFF\uDF57-\uDF5F\uDF79-\uDFFF]|\uD835[\uDC55\uDC9D\uDCA0\uDCA1\uDCA3\uDCA4\uDCA7\uDCA8\uDCAD\uDCBA\uDCBC\uDCC4\uDD06\uDD0B\uDD0C\uDD15\uDD1D\uDD3A\uDD3F\uDD45\uDD47-\uDD49\uDD51\uDEA6\uDEA7\uDFCC\uDFCD]|\uD836[\uDE8C-\uDE9A\uDEA0\uDEB0-\uDFFF]|\uD838[\uDC07\uDC19\uDC1A\uDC22\uDC25\uDC2B-\uDFFF]|\uD83A[\uDCC5\uDCC6\uDCD7-\uDCFF\uDD4B-\uDD4F\uDD5A-\uDD5D\uDD60-\uDFFF]|\uD83B[\uDC00-\uDC70\uDCB5-\uDDFF\uDE04\uDE20\uDE23\uDE25\uDE26\uDE28\uDE33\uDE38\uDE3A\uDE3C-\uDE41\uDE43-\uDE46\uDE48\uDE4A\uDE4C\uDE50\uDE53\uDE55\uDE56\uDE58\uDE5A\uDE5C\uDE5E\uDE60\uDE63\uDE65\uDE66\uDE6B\uDE73\uDE78\uDE7D\uDE7F\uDE8A\uDE9C-\uDEA0\uDEA4\uDEAA\uDEBC-\uDEEF\uDEF2-\uDFFF]|\uD83C[\uDC2C-\uDC2F\uDC94-\uDC9F\uDCAF\uDCB0\uDCC0\uDCD0\uDCF6-\uDCFF\uDD0D-\uDD0F\uDD6C-\uDD6F\uDDAD-\uDDE5\uDE03-\uDE0F\uDE3C-\uDE3F\uDE49-\uDE4F\uDE52-\uDE5F\uDE66-\uDEFF]|\uD83D[\uDED5-\uDEDF\uDEED-\uDEEF\uDEFA-\uDEFF\uDF74-\uDF7F\uDFD9-\uDFFF]|\uD83E[\uDC0C-\uDC0F\uDC48-\uDC4F\uDC5A-\uDC5F\uDC88-\uDC8F\uDCAE-\uDCFF\uDD0C-\uDD0F\uDD3F\uDD71\uDD72\uDD77-\uDD79\uDD7B\uDDA3-\uDDAF\uDDBA-\uDDBF\uDDC3-\uDDCF\uDE00-\uDE5F\uDE6E-\uDFFF]|\uD869[\uDED7-\uDEFF]|\uD86D[\uDF35-\uDF3F]|\uD86E[\uDC1E\uDC1F]|\uD873[\uDEA2-\uDEAF]|\uD87A[\uDFE1-\uDFFF]|\uD87E[\uDE1E-\uDFFF]|\uDB40[\uDC00\uDC02-\uDC1F\uDC80-\uDCFF\uDDF0-\uDFFF]|[\uDBBF\uDBFF][\uDFFE\uDFFF]' + }, + { + 'name': 'Co', + 'alias': 'Private_Use', + 'bmp': '\uE000-\uF8FF', + 'astral': '[\uDB80-\uDBBE\uDBC0-\uDBFE][\uDC00-\uDFFF]|[\uDBBF\uDBFF][\uDC00-\uDFFD]' + }, + { + 'name': 'Cs', + 'alias': 'Surrogate', + 'bmp': '\uD800-\uDFFF' + }, + { + 'name': 'L', + 'alias': 'Letter', + 'bmp': 'A-Za-z\xAA\xB5\xBA\xC0-\xD6\xD8-\xF6\xF8-\u02C1\u02C6-\u02D1\u02E0-\u02E4\u02EC\u02EE\u0370-\u0374\u0376\u0377\u037A-\u037D\u037F\u0386\u0388-\u038A\u038C\u038E-\u03A1\u03A3-\u03F5\u03F7-\u0481\u048A-\u052F\u0531-\u0556\u0559\u0560-\u0588\u05D0-\u05EA\u05EF-\u05F2\u0620-\u064A\u066E\u066F\u0671-\u06D3\u06D5\u06E5\u06E6\u06EE\u06EF\u06FA-\u06FC\u06FF\u0710\u0712-\u072F\u074D-\u07A5\u07B1\u07CA-\u07EA\u07F4\u07F5\u07FA\u0800-\u0815\u081A\u0824\u0828\u0840-\u0858\u0860-\u086A\u08A0-\u08B4\u08B6-\u08BD\u0904-\u0939\u093D\u0950\u0958-\u0961\u0971-\u0980\u0985-\u098C\u098F\u0990\u0993-\u09A8\u09AA-\u09B0\u09B2\u09B6-\u09B9\u09BD\u09CE\u09DC\u09DD\u09DF-\u09E1\u09F0\u09F1\u09FC\u0A05-\u0A0A\u0A0F\u0A10\u0A13-\u0A28\u0A2A-\u0A30\u0A32\u0A33\u0A35\u0A36\u0A38\u0A39\u0A59-\u0A5C\u0A5E\u0A72-\u0A74\u0A85-\u0A8D\u0A8F-\u0A91\u0A93-\u0AA8\u0AAA-\u0AB0\u0AB2\u0AB3\u0AB5-\u0AB9\u0ABD\u0AD0\u0AE0\u0AE1\u0AF9\u0B05-\u0B0C\u0B0F\u0B10\u0B13-\u0B28\u0B2A-\u0B30\u0B32\u0B33\u0B35-\u0B39\u0B3D\u0B5C\u0B5D\u0B5F-\u0B61\u0B71\u0B83\u0B85-\u0B8A\u0B8E-\u0B90\u0B92-\u0B95\u0B99\u0B9A\u0B9C\u0B9E\u0B9F\u0BA3\u0BA4\u0BA8-\u0BAA\u0BAE-\u0BB9\u0BD0\u0C05-\u0C0C\u0C0E-\u0C10\u0C12-\u0C28\u0C2A-\u0C39\u0C3D\u0C58-\u0C5A\u0C60\u0C61\u0C80\u0C85-\u0C8C\u0C8E-\u0C90\u0C92-\u0CA8\u0CAA-\u0CB3\u0CB5-\u0CB9\u0CBD\u0CDE\u0CE0\u0CE1\u0CF1\u0CF2\u0D05-\u0D0C\u0D0E-\u0D10\u0D12-\u0D3A\u0D3D\u0D4E\u0D54-\u0D56\u0D5F-\u0D61\u0D7A-\u0D7F\u0D85-\u0D96\u0D9A-\u0DB1\u0DB3-\u0DBB\u0DBD\u0DC0-\u0DC6\u0E01-\u0E30\u0E32\u0E33\u0E40-\u0E46\u0E81\u0E82\u0E84\u0E87\u0E88\u0E8A\u0E8D\u0E94-\u0E97\u0E99-\u0E9F\u0EA1-\u0EA3\u0EA5\u0EA7\u0EAA\u0EAB\u0EAD-\u0EB0\u0EB2\u0EB3\u0EBD\u0EC0-\u0EC4\u0EC6\u0EDC-\u0EDF\u0F00\u0F40-\u0F47\u0F49-\u0F6C\u0F88-\u0F8C\u1000-\u102A\u103F\u1050-\u1055\u105A-\u105D\u1061\u1065\u1066\u106E-\u1070\u1075-\u1081\u108E\u10A0-\u10C5\u10C7\u10CD\u10D0-\u10FA\u10FC-\u1248\u124A-\u124D\u1250-\u1256\u1258\u125A-\u125D\u1260-\u1288\u128A-\u128D\u1290-\u12B0\u12B2-\u12B5\u12B8-\u12BE\u12C0\u12C2-\u12C5\u12C8-\u12D6\u12D8-\u1310\u1312-\u1315\u1318-\u135A\u1380-\u138F\u13A0-\u13F5\u13F8-\u13FD\u1401-\u166C\u166F-\u167F\u1681-\u169A\u16A0-\u16EA\u16F1-\u16F8\u1700-\u170C\u170E-\u1711\u1720-\u1731\u1740-\u1751\u1760-\u176C\u176E-\u1770\u1780-\u17B3\u17D7\u17DC\u1820-\u1878\u1880-\u1884\u1887-\u18A8\u18AA\u18B0-\u18F5\u1900-\u191E\u1950-\u196D\u1970-\u1974\u1980-\u19AB\u19B0-\u19C9\u1A00-\u1A16\u1A20-\u1A54\u1AA7\u1B05-\u1B33\u1B45-\u1B4B\u1B83-\u1BA0\u1BAE\u1BAF\u1BBA-\u1BE5\u1C00-\u1C23\u1C4D-\u1C4F\u1C5A-\u1C7D\u1C80-\u1C88\u1C90-\u1CBA\u1CBD-\u1CBF\u1CE9-\u1CEC\u1CEE-\u1CF1\u1CF5\u1CF6\u1D00-\u1DBF\u1E00-\u1F15\u1F18-\u1F1D\u1F20-\u1F45\u1F48-\u1F4D\u1F50-\u1F57\u1F59\u1F5B\u1F5D\u1F5F-\u1F7D\u1F80-\u1FB4\u1FB6-\u1FBC\u1FBE\u1FC2-\u1FC4\u1FC6-\u1FCC\u1FD0-\u1FD3\u1FD6-\u1FDB\u1FE0-\u1FEC\u1FF2-\u1FF4\u1FF6-\u1FFC\u2071\u207F\u2090-\u209C\u2102\u2107\u210A-\u2113\u2115\u2119-\u211D\u2124\u2126\u2128\u212A-\u212D\u212F-\u2139\u213C-\u213F\u2145-\u2149\u214E\u2183\u2184\u2C00-\u2C2E\u2C30-\u2C5E\u2C60-\u2CE4\u2CEB-\u2CEE\u2CF2\u2CF3\u2D00-\u2D25\u2D27\u2D2D\u2D30-\u2D67\u2D6F\u2D80-\u2D96\u2DA0-\u2DA6\u2DA8-\u2DAE\u2DB0-\u2DB6\u2DB8-\u2DBE\u2DC0-\u2DC6\u2DC8-\u2DCE\u2DD0-\u2DD6\u2DD8-\u2DDE\u2E2F\u3005\u3006\u3031-\u3035\u303B\u303C\u3041-\u3096\u309D-\u309F\u30A1-\u30FA\u30FC-\u30FF\u3105-\u312F\u3131-\u318E\u31A0-\u31BA\u31F0-\u31FF\u3400-\u4DB5\u4E00-\u9FEF\uA000-\uA48C\uA4D0-\uA4FD\uA500-\uA60C\uA610-\uA61F\uA62A\uA62B\uA640-\uA66E\uA67F-\uA69D\uA6A0-\uA6E5\uA717-\uA71F\uA722-\uA788\uA78B-\uA7B9\uA7F7-\uA801\uA803-\uA805\uA807-\uA80A\uA80C-\uA822\uA840-\uA873\uA882-\uA8B3\uA8F2-\uA8F7\uA8FB\uA8FD\uA8FE\uA90A-\uA925\uA930-\uA946\uA960-\uA97C\uA984-\uA9B2\uA9CF\uA9E0-\uA9E4\uA9E6-\uA9EF\uA9FA-\uA9FE\uAA00-\uAA28\uAA40-\uAA42\uAA44-\uAA4B\uAA60-\uAA76\uAA7A\uAA7E-\uAAAF\uAAB1\uAAB5\uAAB6\uAAB9-\uAABD\uAAC0\uAAC2\uAADB-\uAADD\uAAE0-\uAAEA\uAAF2-\uAAF4\uAB01-\uAB06\uAB09-\uAB0E\uAB11-\uAB16\uAB20-\uAB26\uAB28-\uAB2E\uAB30-\uAB5A\uAB5C-\uAB65\uAB70-\uABE2\uAC00-\uD7A3\uD7B0-\uD7C6\uD7CB-\uD7FB\uF900-\uFA6D\uFA70-\uFAD9\uFB00-\uFB06\uFB13-\uFB17\uFB1D\uFB1F-\uFB28\uFB2A-\uFB36\uFB38-\uFB3C\uFB3E\uFB40\uFB41\uFB43\uFB44\uFB46-\uFBB1\uFBD3-\uFD3D\uFD50-\uFD8F\uFD92-\uFDC7\uFDF0-\uFDFB\uFE70-\uFE74\uFE76-\uFEFC\uFF21-\uFF3A\uFF41-\uFF5A\uFF66-\uFFBE\uFFC2-\uFFC7\uFFCA-\uFFCF\uFFD2-\uFFD7\uFFDA-\uFFDC', + 'astral': '\uD800[\uDC00-\uDC0B\uDC0D-\uDC26\uDC28-\uDC3A\uDC3C\uDC3D\uDC3F-\uDC4D\uDC50-\uDC5D\uDC80-\uDCFA\uDE80-\uDE9C\uDEA0-\uDED0\uDF00-\uDF1F\uDF2D-\uDF40\uDF42-\uDF49\uDF50-\uDF75\uDF80-\uDF9D\uDFA0-\uDFC3\uDFC8-\uDFCF]|\uD801[\uDC00-\uDC9D\uDCB0-\uDCD3\uDCD8-\uDCFB\uDD00-\uDD27\uDD30-\uDD63\uDE00-\uDF36\uDF40-\uDF55\uDF60-\uDF67]|\uD802[\uDC00-\uDC05\uDC08\uDC0A-\uDC35\uDC37\uDC38\uDC3C\uDC3F-\uDC55\uDC60-\uDC76\uDC80-\uDC9E\uDCE0-\uDCF2\uDCF4\uDCF5\uDD00-\uDD15\uDD20-\uDD39\uDD80-\uDDB7\uDDBE\uDDBF\uDE00\uDE10-\uDE13\uDE15-\uDE17\uDE19-\uDE35\uDE60-\uDE7C\uDE80-\uDE9C\uDEC0-\uDEC7\uDEC9-\uDEE4\uDF00-\uDF35\uDF40-\uDF55\uDF60-\uDF72\uDF80-\uDF91]|\uD803[\uDC00-\uDC48\uDC80-\uDCB2\uDCC0-\uDCF2\uDD00-\uDD23\uDF00-\uDF1C\uDF27\uDF30-\uDF45]|\uD804[\uDC03-\uDC37\uDC83-\uDCAF\uDCD0-\uDCE8\uDD03-\uDD26\uDD44\uDD50-\uDD72\uDD76\uDD83-\uDDB2\uDDC1-\uDDC4\uDDDA\uDDDC\uDE00-\uDE11\uDE13-\uDE2B\uDE80-\uDE86\uDE88\uDE8A-\uDE8D\uDE8F-\uDE9D\uDE9F-\uDEA8\uDEB0-\uDEDE\uDF05-\uDF0C\uDF0F\uDF10\uDF13-\uDF28\uDF2A-\uDF30\uDF32\uDF33\uDF35-\uDF39\uDF3D\uDF50\uDF5D-\uDF61]|\uD805[\uDC00-\uDC34\uDC47-\uDC4A\uDC80-\uDCAF\uDCC4\uDCC5\uDCC7\uDD80-\uDDAE\uDDD8-\uDDDB\uDE00-\uDE2F\uDE44\uDE80-\uDEAA\uDF00-\uDF1A]|\uD806[\uDC00-\uDC2B\uDCA0-\uDCDF\uDCFF\uDE00\uDE0B-\uDE32\uDE3A\uDE50\uDE5C-\uDE83\uDE86-\uDE89\uDE9D\uDEC0-\uDEF8]|\uD807[\uDC00-\uDC08\uDC0A-\uDC2E\uDC40\uDC72-\uDC8F\uDD00-\uDD06\uDD08\uDD09\uDD0B-\uDD30\uDD46\uDD60-\uDD65\uDD67\uDD68\uDD6A-\uDD89\uDD98\uDEE0-\uDEF2]|\uD808[\uDC00-\uDF99]|\uD809[\uDC80-\uDD43]|[\uD80C\uD81C-\uD820\uD840-\uD868\uD86A-\uD86C\uD86F-\uD872\uD874-\uD879][\uDC00-\uDFFF]|\uD80D[\uDC00-\uDC2E]|\uD811[\uDC00-\uDE46]|\uD81A[\uDC00-\uDE38\uDE40-\uDE5E\uDED0-\uDEED\uDF00-\uDF2F\uDF40-\uDF43\uDF63-\uDF77\uDF7D-\uDF8F]|\uD81B[\uDE40-\uDE7F\uDF00-\uDF44\uDF50\uDF93-\uDF9F\uDFE0\uDFE1]|\uD821[\uDC00-\uDFF1]|\uD822[\uDC00-\uDEF2]|\uD82C[\uDC00-\uDD1E\uDD70-\uDEFB]|\uD82F[\uDC00-\uDC6A\uDC70-\uDC7C\uDC80-\uDC88\uDC90-\uDC99]|\uD835[\uDC00-\uDC54\uDC56-\uDC9C\uDC9E\uDC9F\uDCA2\uDCA5\uDCA6\uDCA9-\uDCAC\uDCAE-\uDCB9\uDCBB\uDCBD-\uDCC3\uDCC5-\uDD05\uDD07-\uDD0A\uDD0D-\uDD14\uDD16-\uDD1C\uDD1E-\uDD39\uDD3B-\uDD3E\uDD40-\uDD44\uDD46\uDD4A-\uDD50\uDD52-\uDEA5\uDEA8-\uDEC0\uDEC2-\uDEDA\uDEDC-\uDEFA\uDEFC-\uDF14\uDF16-\uDF34\uDF36-\uDF4E\uDF50-\uDF6E\uDF70-\uDF88\uDF8A-\uDFA8\uDFAA-\uDFC2\uDFC4-\uDFCB]|\uD83A[\uDC00-\uDCC4\uDD00-\uDD43]|\uD83B[\uDE00-\uDE03\uDE05-\uDE1F\uDE21\uDE22\uDE24\uDE27\uDE29-\uDE32\uDE34-\uDE37\uDE39\uDE3B\uDE42\uDE47\uDE49\uDE4B\uDE4D-\uDE4F\uDE51\uDE52\uDE54\uDE57\uDE59\uDE5B\uDE5D\uDE5F\uDE61\uDE62\uDE64\uDE67-\uDE6A\uDE6C-\uDE72\uDE74-\uDE77\uDE79-\uDE7C\uDE7E\uDE80-\uDE89\uDE8B-\uDE9B\uDEA1-\uDEA3\uDEA5-\uDEA9\uDEAB-\uDEBB]|\uD869[\uDC00-\uDED6\uDF00-\uDFFF]|\uD86D[\uDC00-\uDF34\uDF40-\uDFFF]|\uD86E[\uDC00-\uDC1D\uDC20-\uDFFF]|\uD873[\uDC00-\uDEA1\uDEB0-\uDFFF]|\uD87A[\uDC00-\uDFE0]|\uD87E[\uDC00-\uDE1D]' + }, + { + 'name': 'LC', + 'alias': 'Cased_Letter', + 'bmp': 'A-Za-z\xB5\xC0-\xD6\xD8-\xF6\xF8-\u01BA\u01BC-\u01BF\u01C4-\u0293\u0295-\u02AF\u0370-\u0373\u0376\u0377\u037B-\u037D\u037F\u0386\u0388-\u038A\u038C\u038E-\u03A1\u03A3-\u03F5\u03F7-\u0481\u048A-\u052F\u0531-\u0556\u0560-\u0588\u10A0-\u10C5\u10C7\u10CD\u10D0-\u10FA\u10FD-\u10FF\u13A0-\u13F5\u13F8-\u13FD\u1C80-\u1C88\u1C90-\u1CBA\u1CBD-\u1CBF\u1D00-\u1D2B\u1D6B-\u1D77\u1D79-\u1D9A\u1E00-\u1F15\u1F18-\u1F1D\u1F20-\u1F45\u1F48-\u1F4D\u1F50-\u1F57\u1F59\u1F5B\u1F5D\u1F5F-\u1F7D\u1F80-\u1FB4\u1FB6-\u1FBC\u1FBE\u1FC2-\u1FC4\u1FC6-\u1FCC\u1FD0-\u1FD3\u1FD6-\u1FDB\u1FE0-\u1FEC\u1FF2-\u1FF4\u1FF6-\u1FFC\u2102\u2107\u210A-\u2113\u2115\u2119-\u211D\u2124\u2126\u2128\u212A-\u212D\u212F-\u2134\u2139\u213C-\u213F\u2145-\u2149\u214E\u2183\u2184\u2C00-\u2C2E\u2C30-\u2C5E\u2C60-\u2C7B\u2C7E-\u2CE4\u2CEB-\u2CEE\u2CF2\u2CF3\u2D00-\u2D25\u2D27\u2D2D\uA640-\uA66D\uA680-\uA69B\uA722-\uA76F\uA771-\uA787\uA78B-\uA78E\uA790-\uA7B9\uA7FA\uAB30-\uAB5A\uAB60-\uAB65\uAB70-\uABBF\uFB00-\uFB06\uFB13-\uFB17\uFF21-\uFF3A\uFF41-\uFF5A', + 'astral': '\uD801[\uDC00-\uDC4F\uDCB0-\uDCD3\uDCD8-\uDCFB]|\uD803[\uDC80-\uDCB2\uDCC0-\uDCF2]|\uD806[\uDCA0-\uDCDF]|\uD81B[\uDE40-\uDE7F]|\uD835[\uDC00-\uDC54\uDC56-\uDC9C\uDC9E\uDC9F\uDCA2\uDCA5\uDCA6\uDCA9-\uDCAC\uDCAE-\uDCB9\uDCBB\uDCBD-\uDCC3\uDCC5-\uDD05\uDD07-\uDD0A\uDD0D-\uDD14\uDD16-\uDD1C\uDD1E-\uDD39\uDD3B-\uDD3E\uDD40-\uDD44\uDD46\uDD4A-\uDD50\uDD52-\uDEA5\uDEA8-\uDEC0\uDEC2-\uDEDA\uDEDC-\uDEFA\uDEFC-\uDF14\uDF16-\uDF34\uDF36-\uDF4E\uDF50-\uDF6E\uDF70-\uDF88\uDF8A-\uDFA8\uDFAA-\uDFC2\uDFC4-\uDFCB]|\uD83A[\uDD00-\uDD43]' + }, + { + 'name': 'Ll', + 'alias': 'Lowercase_Letter', + 'bmp': 'a-z\xB5\xDF-\xF6\xF8-\xFF\u0101\u0103\u0105\u0107\u0109\u010B\u010D\u010F\u0111\u0113\u0115\u0117\u0119\u011B\u011D\u011F\u0121\u0123\u0125\u0127\u0129\u012B\u012D\u012F\u0131\u0133\u0135\u0137\u0138\u013A\u013C\u013E\u0140\u0142\u0144\u0146\u0148\u0149\u014B\u014D\u014F\u0151\u0153\u0155\u0157\u0159\u015B\u015D\u015F\u0161\u0163\u0165\u0167\u0169\u016B\u016D\u016F\u0171\u0173\u0175\u0177\u017A\u017C\u017E-\u0180\u0183\u0185\u0188\u018C\u018D\u0192\u0195\u0199-\u019B\u019E\u01A1\u01A3\u01A5\u01A8\u01AA\u01AB\u01AD\u01B0\u01B4\u01B6\u01B9\u01BA\u01BD-\u01BF\u01C6\u01C9\u01CC\u01CE\u01D0\u01D2\u01D4\u01D6\u01D8\u01DA\u01DC\u01DD\u01DF\u01E1\u01E3\u01E5\u01E7\u01E9\u01EB\u01ED\u01EF\u01F0\u01F3\u01F5\u01F9\u01FB\u01FD\u01FF\u0201\u0203\u0205\u0207\u0209\u020B\u020D\u020F\u0211\u0213\u0215\u0217\u0219\u021B\u021D\u021F\u0221\u0223\u0225\u0227\u0229\u022B\u022D\u022F\u0231\u0233-\u0239\u023C\u023F\u0240\u0242\u0247\u0249\u024B\u024D\u024F-\u0293\u0295-\u02AF\u0371\u0373\u0377\u037B-\u037D\u0390\u03AC-\u03CE\u03D0\u03D1\u03D5-\u03D7\u03D9\u03DB\u03DD\u03DF\u03E1\u03E3\u03E5\u03E7\u03E9\u03EB\u03ED\u03EF-\u03F3\u03F5\u03F8\u03FB\u03FC\u0430-\u045F\u0461\u0463\u0465\u0467\u0469\u046B\u046D\u046F\u0471\u0473\u0475\u0477\u0479\u047B\u047D\u047F\u0481\u048B\u048D\u048F\u0491\u0493\u0495\u0497\u0499\u049B\u049D\u049F\u04A1\u04A3\u04A5\u04A7\u04A9\u04AB\u04AD\u04AF\u04B1\u04B3\u04B5\u04B7\u04B9\u04BB\u04BD\u04BF\u04C2\u04C4\u04C6\u04C8\u04CA\u04CC\u04CE\u04CF\u04D1\u04D3\u04D5\u04D7\u04D9\u04DB\u04DD\u04DF\u04E1\u04E3\u04E5\u04E7\u04E9\u04EB\u04ED\u04EF\u04F1\u04F3\u04F5\u04F7\u04F9\u04FB\u04FD\u04FF\u0501\u0503\u0505\u0507\u0509\u050B\u050D\u050F\u0511\u0513\u0515\u0517\u0519\u051B\u051D\u051F\u0521\u0523\u0525\u0527\u0529\u052B\u052D\u052F\u0560-\u0588\u10D0-\u10FA\u10FD-\u10FF\u13F8-\u13FD\u1C80-\u1C88\u1D00-\u1D2B\u1D6B-\u1D77\u1D79-\u1D9A\u1E01\u1E03\u1E05\u1E07\u1E09\u1E0B\u1E0D\u1E0F\u1E11\u1E13\u1E15\u1E17\u1E19\u1E1B\u1E1D\u1E1F\u1E21\u1E23\u1E25\u1E27\u1E29\u1E2B\u1E2D\u1E2F\u1E31\u1E33\u1E35\u1E37\u1E39\u1E3B\u1E3D\u1E3F\u1E41\u1E43\u1E45\u1E47\u1E49\u1E4B\u1E4D\u1E4F\u1E51\u1E53\u1E55\u1E57\u1E59\u1E5B\u1E5D\u1E5F\u1E61\u1E63\u1E65\u1E67\u1E69\u1E6B\u1E6D\u1E6F\u1E71\u1E73\u1E75\u1E77\u1E79\u1E7B\u1E7D\u1E7F\u1E81\u1E83\u1E85\u1E87\u1E89\u1E8B\u1E8D\u1E8F\u1E91\u1E93\u1E95-\u1E9D\u1E9F\u1EA1\u1EA3\u1EA5\u1EA7\u1EA9\u1EAB\u1EAD\u1EAF\u1EB1\u1EB3\u1EB5\u1EB7\u1EB9\u1EBB\u1EBD\u1EBF\u1EC1\u1EC3\u1EC5\u1EC7\u1EC9\u1ECB\u1ECD\u1ECF\u1ED1\u1ED3\u1ED5\u1ED7\u1ED9\u1EDB\u1EDD\u1EDF\u1EE1\u1EE3\u1EE5\u1EE7\u1EE9\u1EEB\u1EED\u1EEF\u1EF1\u1EF3\u1EF5\u1EF7\u1EF9\u1EFB\u1EFD\u1EFF-\u1F07\u1F10-\u1F15\u1F20-\u1F27\u1F30-\u1F37\u1F40-\u1F45\u1F50-\u1F57\u1F60-\u1F67\u1F70-\u1F7D\u1F80-\u1F87\u1F90-\u1F97\u1FA0-\u1FA7\u1FB0-\u1FB4\u1FB6\u1FB7\u1FBE\u1FC2-\u1FC4\u1FC6\u1FC7\u1FD0-\u1FD3\u1FD6\u1FD7\u1FE0-\u1FE7\u1FF2-\u1FF4\u1FF6\u1FF7\u210A\u210E\u210F\u2113\u212F\u2134\u2139\u213C\u213D\u2146-\u2149\u214E\u2184\u2C30-\u2C5E\u2C61\u2C65\u2C66\u2C68\u2C6A\u2C6C\u2C71\u2C73\u2C74\u2C76-\u2C7B\u2C81\u2C83\u2C85\u2C87\u2C89\u2C8B\u2C8D\u2C8F\u2C91\u2C93\u2C95\u2C97\u2C99\u2C9B\u2C9D\u2C9F\u2CA1\u2CA3\u2CA5\u2CA7\u2CA9\u2CAB\u2CAD\u2CAF\u2CB1\u2CB3\u2CB5\u2CB7\u2CB9\u2CBB\u2CBD\u2CBF\u2CC1\u2CC3\u2CC5\u2CC7\u2CC9\u2CCB\u2CCD\u2CCF\u2CD1\u2CD3\u2CD5\u2CD7\u2CD9\u2CDB\u2CDD\u2CDF\u2CE1\u2CE3\u2CE4\u2CEC\u2CEE\u2CF3\u2D00-\u2D25\u2D27\u2D2D\uA641\uA643\uA645\uA647\uA649\uA64B\uA64D\uA64F\uA651\uA653\uA655\uA657\uA659\uA65B\uA65D\uA65F\uA661\uA663\uA665\uA667\uA669\uA66B\uA66D\uA681\uA683\uA685\uA687\uA689\uA68B\uA68D\uA68F\uA691\uA693\uA695\uA697\uA699\uA69B\uA723\uA725\uA727\uA729\uA72B\uA72D\uA72F-\uA731\uA733\uA735\uA737\uA739\uA73B\uA73D\uA73F\uA741\uA743\uA745\uA747\uA749\uA74B\uA74D\uA74F\uA751\uA753\uA755\uA757\uA759\uA75B\uA75D\uA75F\uA761\uA763\uA765\uA767\uA769\uA76B\uA76D\uA76F\uA771-\uA778\uA77A\uA77C\uA77F\uA781\uA783\uA785\uA787\uA78C\uA78E\uA791\uA793-\uA795\uA797\uA799\uA79B\uA79D\uA79F\uA7A1\uA7A3\uA7A5\uA7A7\uA7A9\uA7AF\uA7B5\uA7B7\uA7B9\uA7FA\uAB30-\uAB5A\uAB60-\uAB65\uAB70-\uABBF\uFB00-\uFB06\uFB13-\uFB17\uFF41-\uFF5A', + 'astral': '\uD801[\uDC28-\uDC4F\uDCD8-\uDCFB]|\uD803[\uDCC0-\uDCF2]|\uD806[\uDCC0-\uDCDF]|\uD81B[\uDE60-\uDE7F]|\uD835[\uDC1A-\uDC33\uDC4E-\uDC54\uDC56-\uDC67\uDC82-\uDC9B\uDCB6-\uDCB9\uDCBB\uDCBD-\uDCC3\uDCC5-\uDCCF\uDCEA-\uDD03\uDD1E-\uDD37\uDD52-\uDD6B\uDD86-\uDD9F\uDDBA-\uDDD3\uDDEE-\uDE07\uDE22-\uDE3B\uDE56-\uDE6F\uDE8A-\uDEA5\uDEC2-\uDEDA\uDEDC-\uDEE1\uDEFC-\uDF14\uDF16-\uDF1B\uDF36-\uDF4E\uDF50-\uDF55\uDF70-\uDF88\uDF8A-\uDF8F\uDFAA-\uDFC2\uDFC4-\uDFC9\uDFCB]|\uD83A[\uDD22-\uDD43]' + }, + { + 'name': 'Lm', + 'alias': 'Modifier_Letter', + 'bmp': '\u02B0-\u02C1\u02C6-\u02D1\u02E0-\u02E4\u02EC\u02EE\u0374\u037A\u0559\u0640\u06E5\u06E6\u07F4\u07F5\u07FA\u081A\u0824\u0828\u0971\u0E46\u0EC6\u10FC\u17D7\u1843\u1AA7\u1C78-\u1C7D\u1D2C-\u1D6A\u1D78\u1D9B-\u1DBF\u2071\u207F\u2090-\u209C\u2C7C\u2C7D\u2D6F\u2E2F\u3005\u3031-\u3035\u303B\u309D\u309E\u30FC-\u30FE\uA015\uA4F8-\uA4FD\uA60C\uA67F\uA69C\uA69D\uA717-\uA71F\uA770\uA788\uA7F8\uA7F9\uA9CF\uA9E6\uAA70\uAADD\uAAF3\uAAF4\uAB5C-\uAB5F\uFF70\uFF9E\uFF9F', + 'astral': '\uD81A[\uDF40-\uDF43]|\uD81B[\uDF93-\uDF9F\uDFE0\uDFE1]' + }, + { + 'name': 'Lo', + 'alias': 'Other_Letter', + 'bmp': '\xAA\xBA\u01BB\u01C0-\u01C3\u0294\u05D0-\u05EA\u05EF-\u05F2\u0620-\u063F\u0641-\u064A\u066E\u066F\u0671-\u06D3\u06D5\u06EE\u06EF\u06FA-\u06FC\u06FF\u0710\u0712-\u072F\u074D-\u07A5\u07B1\u07CA-\u07EA\u0800-\u0815\u0840-\u0858\u0860-\u086A\u08A0-\u08B4\u08B6-\u08BD\u0904-\u0939\u093D\u0950\u0958-\u0961\u0972-\u0980\u0985-\u098C\u098F\u0990\u0993-\u09A8\u09AA-\u09B0\u09B2\u09B6-\u09B9\u09BD\u09CE\u09DC\u09DD\u09DF-\u09E1\u09F0\u09F1\u09FC\u0A05-\u0A0A\u0A0F\u0A10\u0A13-\u0A28\u0A2A-\u0A30\u0A32\u0A33\u0A35\u0A36\u0A38\u0A39\u0A59-\u0A5C\u0A5E\u0A72-\u0A74\u0A85-\u0A8D\u0A8F-\u0A91\u0A93-\u0AA8\u0AAA-\u0AB0\u0AB2\u0AB3\u0AB5-\u0AB9\u0ABD\u0AD0\u0AE0\u0AE1\u0AF9\u0B05-\u0B0C\u0B0F\u0B10\u0B13-\u0B28\u0B2A-\u0B30\u0B32\u0B33\u0B35-\u0B39\u0B3D\u0B5C\u0B5D\u0B5F-\u0B61\u0B71\u0B83\u0B85-\u0B8A\u0B8E-\u0B90\u0B92-\u0B95\u0B99\u0B9A\u0B9C\u0B9E\u0B9F\u0BA3\u0BA4\u0BA8-\u0BAA\u0BAE-\u0BB9\u0BD0\u0C05-\u0C0C\u0C0E-\u0C10\u0C12-\u0C28\u0C2A-\u0C39\u0C3D\u0C58-\u0C5A\u0C60\u0C61\u0C80\u0C85-\u0C8C\u0C8E-\u0C90\u0C92-\u0CA8\u0CAA-\u0CB3\u0CB5-\u0CB9\u0CBD\u0CDE\u0CE0\u0CE1\u0CF1\u0CF2\u0D05-\u0D0C\u0D0E-\u0D10\u0D12-\u0D3A\u0D3D\u0D4E\u0D54-\u0D56\u0D5F-\u0D61\u0D7A-\u0D7F\u0D85-\u0D96\u0D9A-\u0DB1\u0DB3-\u0DBB\u0DBD\u0DC0-\u0DC6\u0E01-\u0E30\u0E32\u0E33\u0E40-\u0E45\u0E81\u0E82\u0E84\u0E87\u0E88\u0E8A\u0E8D\u0E94-\u0E97\u0E99-\u0E9F\u0EA1-\u0EA3\u0EA5\u0EA7\u0EAA\u0EAB\u0EAD-\u0EB0\u0EB2\u0EB3\u0EBD\u0EC0-\u0EC4\u0EDC-\u0EDF\u0F00\u0F40-\u0F47\u0F49-\u0F6C\u0F88-\u0F8C\u1000-\u102A\u103F\u1050-\u1055\u105A-\u105D\u1061\u1065\u1066\u106E-\u1070\u1075-\u1081\u108E\u1100-\u1248\u124A-\u124D\u1250-\u1256\u1258\u125A-\u125D\u1260-\u1288\u128A-\u128D\u1290-\u12B0\u12B2-\u12B5\u12B8-\u12BE\u12C0\u12C2-\u12C5\u12C8-\u12D6\u12D8-\u1310\u1312-\u1315\u1318-\u135A\u1380-\u138F\u1401-\u166C\u166F-\u167F\u1681-\u169A\u16A0-\u16EA\u16F1-\u16F8\u1700-\u170C\u170E-\u1711\u1720-\u1731\u1740-\u1751\u1760-\u176C\u176E-\u1770\u1780-\u17B3\u17DC\u1820-\u1842\u1844-\u1878\u1880-\u1884\u1887-\u18A8\u18AA\u18B0-\u18F5\u1900-\u191E\u1950-\u196D\u1970-\u1974\u1980-\u19AB\u19B0-\u19C9\u1A00-\u1A16\u1A20-\u1A54\u1B05-\u1B33\u1B45-\u1B4B\u1B83-\u1BA0\u1BAE\u1BAF\u1BBA-\u1BE5\u1C00-\u1C23\u1C4D-\u1C4F\u1C5A-\u1C77\u1CE9-\u1CEC\u1CEE-\u1CF1\u1CF5\u1CF6\u2135-\u2138\u2D30-\u2D67\u2D80-\u2D96\u2DA0-\u2DA6\u2DA8-\u2DAE\u2DB0-\u2DB6\u2DB8-\u2DBE\u2DC0-\u2DC6\u2DC8-\u2DCE\u2DD0-\u2DD6\u2DD8-\u2DDE\u3006\u303C\u3041-\u3096\u309F\u30A1-\u30FA\u30FF\u3105-\u312F\u3131-\u318E\u31A0-\u31BA\u31F0-\u31FF\u3400-\u4DB5\u4E00-\u9FEF\uA000-\uA014\uA016-\uA48C\uA4D0-\uA4F7\uA500-\uA60B\uA610-\uA61F\uA62A\uA62B\uA66E\uA6A0-\uA6E5\uA78F\uA7F7\uA7FB-\uA801\uA803-\uA805\uA807-\uA80A\uA80C-\uA822\uA840-\uA873\uA882-\uA8B3\uA8F2-\uA8F7\uA8FB\uA8FD\uA8FE\uA90A-\uA925\uA930-\uA946\uA960-\uA97C\uA984-\uA9B2\uA9E0-\uA9E4\uA9E7-\uA9EF\uA9FA-\uA9FE\uAA00-\uAA28\uAA40-\uAA42\uAA44-\uAA4B\uAA60-\uAA6F\uAA71-\uAA76\uAA7A\uAA7E-\uAAAF\uAAB1\uAAB5\uAAB6\uAAB9-\uAABD\uAAC0\uAAC2\uAADB\uAADC\uAAE0-\uAAEA\uAAF2\uAB01-\uAB06\uAB09-\uAB0E\uAB11-\uAB16\uAB20-\uAB26\uAB28-\uAB2E\uABC0-\uABE2\uAC00-\uD7A3\uD7B0-\uD7C6\uD7CB-\uD7FB\uF900-\uFA6D\uFA70-\uFAD9\uFB1D\uFB1F-\uFB28\uFB2A-\uFB36\uFB38-\uFB3C\uFB3E\uFB40\uFB41\uFB43\uFB44\uFB46-\uFBB1\uFBD3-\uFD3D\uFD50-\uFD8F\uFD92-\uFDC7\uFDF0-\uFDFB\uFE70-\uFE74\uFE76-\uFEFC\uFF66-\uFF6F\uFF71-\uFF9D\uFFA0-\uFFBE\uFFC2-\uFFC7\uFFCA-\uFFCF\uFFD2-\uFFD7\uFFDA-\uFFDC', + 'astral': '\uD800[\uDC00-\uDC0B\uDC0D-\uDC26\uDC28-\uDC3A\uDC3C\uDC3D\uDC3F-\uDC4D\uDC50-\uDC5D\uDC80-\uDCFA\uDE80-\uDE9C\uDEA0-\uDED0\uDF00-\uDF1F\uDF2D-\uDF40\uDF42-\uDF49\uDF50-\uDF75\uDF80-\uDF9D\uDFA0-\uDFC3\uDFC8-\uDFCF]|\uD801[\uDC50-\uDC9D\uDD00-\uDD27\uDD30-\uDD63\uDE00-\uDF36\uDF40-\uDF55\uDF60-\uDF67]|\uD802[\uDC00-\uDC05\uDC08\uDC0A-\uDC35\uDC37\uDC38\uDC3C\uDC3F-\uDC55\uDC60-\uDC76\uDC80-\uDC9E\uDCE0-\uDCF2\uDCF4\uDCF5\uDD00-\uDD15\uDD20-\uDD39\uDD80-\uDDB7\uDDBE\uDDBF\uDE00\uDE10-\uDE13\uDE15-\uDE17\uDE19-\uDE35\uDE60-\uDE7C\uDE80-\uDE9C\uDEC0-\uDEC7\uDEC9-\uDEE4\uDF00-\uDF35\uDF40-\uDF55\uDF60-\uDF72\uDF80-\uDF91]|\uD803[\uDC00-\uDC48\uDD00-\uDD23\uDF00-\uDF1C\uDF27\uDF30-\uDF45]|\uD804[\uDC03-\uDC37\uDC83-\uDCAF\uDCD0-\uDCE8\uDD03-\uDD26\uDD44\uDD50-\uDD72\uDD76\uDD83-\uDDB2\uDDC1-\uDDC4\uDDDA\uDDDC\uDE00-\uDE11\uDE13-\uDE2B\uDE80-\uDE86\uDE88\uDE8A-\uDE8D\uDE8F-\uDE9D\uDE9F-\uDEA8\uDEB0-\uDEDE\uDF05-\uDF0C\uDF0F\uDF10\uDF13-\uDF28\uDF2A-\uDF30\uDF32\uDF33\uDF35-\uDF39\uDF3D\uDF50\uDF5D-\uDF61]|\uD805[\uDC00-\uDC34\uDC47-\uDC4A\uDC80-\uDCAF\uDCC4\uDCC5\uDCC7\uDD80-\uDDAE\uDDD8-\uDDDB\uDE00-\uDE2F\uDE44\uDE80-\uDEAA\uDF00-\uDF1A]|\uD806[\uDC00-\uDC2B\uDCFF\uDE00\uDE0B-\uDE32\uDE3A\uDE50\uDE5C-\uDE83\uDE86-\uDE89\uDE9D\uDEC0-\uDEF8]|\uD807[\uDC00-\uDC08\uDC0A-\uDC2E\uDC40\uDC72-\uDC8F\uDD00-\uDD06\uDD08\uDD09\uDD0B-\uDD30\uDD46\uDD60-\uDD65\uDD67\uDD68\uDD6A-\uDD89\uDD98\uDEE0-\uDEF2]|\uD808[\uDC00-\uDF99]|\uD809[\uDC80-\uDD43]|[\uD80C\uD81C-\uD820\uD840-\uD868\uD86A-\uD86C\uD86F-\uD872\uD874-\uD879][\uDC00-\uDFFF]|\uD80D[\uDC00-\uDC2E]|\uD811[\uDC00-\uDE46]|\uD81A[\uDC00-\uDE38\uDE40-\uDE5E\uDED0-\uDEED\uDF00-\uDF2F\uDF63-\uDF77\uDF7D-\uDF8F]|\uD81B[\uDF00-\uDF44\uDF50]|\uD821[\uDC00-\uDFF1]|\uD822[\uDC00-\uDEF2]|\uD82C[\uDC00-\uDD1E\uDD70-\uDEFB]|\uD82F[\uDC00-\uDC6A\uDC70-\uDC7C\uDC80-\uDC88\uDC90-\uDC99]|\uD83A[\uDC00-\uDCC4]|\uD83B[\uDE00-\uDE03\uDE05-\uDE1F\uDE21\uDE22\uDE24\uDE27\uDE29-\uDE32\uDE34-\uDE37\uDE39\uDE3B\uDE42\uDE47\uDE49\uDE4B\uDE4D-\uDE4F\uDE51\uDE52\uDE54\uDE57\uDE59\uDE5B\uDE5D\uDE5F\uDE61\uDE62\uDE64\uDE67-\uDE6A\uDE6C-\uDE72\uDE74-\uDE77\uDE79-\uDE7C\uDE7E\uDE80-\uDE89\uDE8B-\uDE9B\uDEA1-\uDEA3\uDEA5-\uDEA9\uDEAB-\uDEBB]|\uD869[\uDC00-\uDED6\uDF00-\uDFFF]|\uD86D[\uDC00-\uDF34\uDF40-\uDFFF]|\uD86E[\uDC00-\uDC1D\uDC20-\uDFFF]|\uD873[\uDC00-\uDEA1\uDEB0-\uDFFF]|\uD87A[\uDC00-\uDFE0]|\uD87E[\uDC00-\uDE1D]' + }, + { + 'name': 'Lt', + 'alias': 'Titlecase_Letter', + 'bmp': '\u01C5\u01C8\u01CB\u01F2\u1F88-\u1F8F\u1F98-\u1F9F\u1FA8-\u1FAF\u1FBC\u1FCC\u1FFC' + }, + { + 'name': 'Lu', + 'alias': 'Uppercase_Letter', + 'bmp': 'A-Z\xC0-\xD6\xD8-\xDE\u0100\u0102\u0104\u0106\u0108\u010A\u010C\u010E\u0110\u0112\u0114\u0116\u0118\u011A\u011C\u011E\u0120\u0122\u0124\u0126\u0128\u012A\u012C\u012E\u0130\u0132\u0134\u0136\u0139\u013B\u013D\u013F\u0141\u0143\u0145\u0147\u014A\u014C\u014E\u0150\u0152\u0154\u0156\u0158\u015A\u015C\u015E\u0160\u0162\u0164\u0166\u0168\u016A\u016C\u016E\u0170\u0172\u0174\u0176\u0178\u0179\u017B\u017D\u0181\u0182\u0184\u0186\u0187\u0189-\u018B\u018E-\u0191\u0193\u0194\u0196-\u0198\u019C\u019D\u019F\u01A0\u01A2\u01A4\u01A6\u01A7\u01A9\u01AC\u01AE\u01AF\u01B1-\u01B3\u01B5\u01B7\u01B8\u01BC\u01C4\u01C7\u01CA\u01CD\u01CF\u01D1\u01D3\u01D5\u01D7\u01D9\u01DB\u01DE\u01E0\u01E2\u01E4\u01E6\u01E8\u01EA\u01EC\u01EE\u01F1\u01F4\u01F6-\u01F8\u01FA\u01FC\u01FE\u0200\u0202\u0204\u0206\u0208\u020A\u020C\u020E\u0210\u0212\u0214\u0216\u0218\u021A\u021C\u021E\u0220\u0222\u0224\u0226\u0228\u022A\u022C\u022E\u0230\u0232\u023A\u023B\u023D\u023E\u0241\u0243-\u0246\u0248\u024A\u024C\u024E\u0370\u0372\u0376\u037F\u0386\u0388-\u038A\u038C\u038E\u038F\u0391-\u03A1\u03A3-\u03AB\u03CF\u03D2-\u03D4\u03D8\u03DA\u03DC\u03DE\u03E0\u03E2\u03E4\u03E6\u03E8\u03EA\u03EC\u03EE\u03F4\u03F7\u03F9\u03FA\u03FD-\u042F\u0460\u0462\u0464\u0466\u0468\u046A\u046C\u046E\u0470\u0472\u0474\u0476\u0478\u047A\u047C\u047E\u0480\u048A\u048C\u048E\u0490\u0492\u0494\u0496\u0498\u049A\u049C\u049E\u04A0\u04A2\u04A4\u04A6\u04A8\u04AA\u04AC\u04AE\u04B0\u04B2\u04B4\u04B6\u04B8\u04BA\u04BC\u04BE\u04C0\u04C1\u04C3\u04C5\u04C7\u04C9\u04CB\u04CD\u04D0\u04D2\u04D4\u04D6\u04D8\u04DA\u04DC\u04DE\u04E0\u04E2\u04E4\u04E6\u04E8\u04EA\u04EC\u04EE\u04F0\u04F2\u04F4\u04F6\u04F8\u04FA\u04FC\u04FE\u0500\u0502\u0504\u0506\u0508\u050A\u050C\u050E\u0510\u0512\u0514\u0516\u0518\u051A\u051C\u051E\u0520\u0522\u0524\u0526\u0528\u052A\u052C\u052E\u0531-\u0556\u10A0-\u10C5\u10C7\u10CD\u13A0-\u13F5\u1C90-\u1CBA\u1CBD-\u1CBF\u1E00\u1E02\u1E04\u1E06\u1E08\u1E0A\u1E0C\u1E0E\u1E10\u1E12\u1E14\u1E16\u1E18\u1E1A\u1E1C\u1E1E\u1E20\u1E22\u1E24\u1E26\u1E28\u1E2A\u1E2C\u1E2E\u1E30\u1E32\u1E34\u1E36\u1E38\u1E3A\u1E3C\u1E3E\u1E40\u1E42\u1E44\u1E46\u1E48\u1E4A\u1E4C\u1E4E\u1E50\u1E52\u1E54\u1E56\u1E58\u1E5A\u1E5C\u1E5E\u1E60\u1E62\u1E64\u1E66\u1E68\u1E6A\u1E6C\u1E6E\u1E70\u1E72\u1E74\u1E76\u1E78\u1E7A\u1E7C\u1E7E\u1E80\u1E82\u1E84\u1E86\u1E88\u1E8A\u1E8C\u1E8E\u1E90\u1E92\u1E94\u1E9E\u1EA0\u1EA2\u1EA4\u1EA6\u1EA8\u1EAA\u1EAC\u1EAE\u1EB0\u1EB2\u1EB4\u1EB6\u1EB8\u1EBA\u1EBC\u1EBE\u1EC0\u1EC2\u1EC4\u1EC6\u1EC8\u1ECA\u1ECC\u1ECE\u1ED0\u1ED2\u1ED4\u1ED6\u1ED8\u1EDA\u1EDC\u1EDE\u1EE0\u1EE2\u1EE4\u1EE6\u1EE8\u1EEA\u1EEC\u1EEE\u1EF0\u1EF2\u1EF4\u1EF6\u1EF8\u1EFA\u1EFC\u1EFE\u1F08-\u1F0F\u1F18-\u1F1D\u1F28-\u1F2F\u1F38-\u1F3F\u1F48-\u1F4D\u1F59\u1F5B\u1F5D\u1F5F\u1F68-\u1F6F\u1FB8-\u1FBB\u1FC8-\u1FCB\u1FD8-\u1FDB\u1FE8-\u1FEC\u1FF8-\u1FFB\u2102\u2107\u210B-\u210D\u2110-\u2112\u2115\u2119-\u211D\u2124\u2126\u2128\u212A-\u212D\u2130-\u2133\u213E\u213F\u2145\u2183\u2C00-\u2C2E\u2C60\u2C62-\u2C64\u2C67\u2C69\u2C6B\u2C6D-\u2C70\u2C72\u2C75\u2C7E-\u2C80\u2C82\u2C84\u2C86\u2C88\u2C8A\u2C8C\u2C8E\u2C90\u2C92\u2C94\u2C96\u2C98\u2C9A\u2C9C\u2C9E\u2CA0\u2CA2\u2CA4\u2CA6\u2CA8\u2CAA\u2CAC\u2CAE\u2CB0\u2CB2\u2CB4\u2CB6\u2CB8\u2CBA\u2CBC\u2CBE\u2CC0\u2CC2\u2CC4\u2CC6\u2CC8\u2CCA\u2CCC\u2CCE\u2CD0\u2CD2\u2CD4\u2CD6\u2CD8\u2CDA\u2CDC\u2CDE\u2CE0\u2CE2\u2CEB\u2CED\u2CF2\uA640\uA642\uA644\uA646\uA648\uA64A\uA64C\uA64E\uA650\uA652\uA654\uA656\uA658\uA65A\uA65C\uA65E\uA660\uA662\uA664\uA666\uA668\uA66A\uA66C\uA680\uA682\uA684\uA686\uA688\uA68A\uA68C\uA68E\uA690\uA692\uA694\uA696\uA698\uA69A\uA722\uA724\uA726\uA728\uA72A\uA72C\uA72E\uA732\uA734\uA736\uA738\uA73A\uA73C\uA73E\uA740\uA742\uA744\uA746\uA748\uA74A\uA74C\uA74E\uA750\uA752\uA754\uA756\uA758\uA75A\uA75C\uA75E\uA760\uA762\uA764\uA766\uA768\uA76A\uA76C\uA76E\uA779\uA77B\uA77D\uA77E\uA780\uA782\uA784\uA786\uA78B\uA78D\uA790\uA792\uA796\uA798\uA79A\uA79C\uA79E\uA7A0\uA7A2\uA7A4\uA7A6\uA7A8\uA7AA-\uA7AE\uA7B0-\uA7B4\uA7B6\uA7B8\uFF21-\uFF3A', + 'astral': '\uD801[\uDC00-\uDC27\uDCB0-\uDCD3]|\uD803[\uDC80-\uDCB2]|\uD806[\uDCA0-\uDCBF]|\uD81B[\uDE40-\uDE5F]|\uD835[\uDC00-\uDC19\uDC34-\uDC4D\uDC68-\uDC81\uDC9C\uDC9E\uDC9F\uDCA2\uDCA5\uDCA6\uDCA9-\uDCAC\uDCAE-\uDCB5\uDCD0-\uDCE9\uDD04\uDD05\uDD07-\uDD0A\uDD0D-\uDD14\uDD16-\uDD1C\uDD38\uDD39\uDD3B-\uDD3E\uDD40-\uDD44\uDD46\uDD4A-\uDD50\uDD6C-\uDD85\uDDA0-\uDDB9\uDDD4-\uDDED\uDE08-\uDE21\uDE3C-\uDE55\uDE70-\uDE89\uDEA8-\uDEC0\uDEE2-\uDEFA\uDF1C-\uDF34\uDF56-\uDF6E\uDF90-\uDFA8\uDFCA]|\uD83A[\uDD00-\uDD21]' + }, + { + 'name': 'M', + 'alias': 'Mark', + 'bmp': '\u0300-\u036F\u0483-\u0489\u0591-\u05BD\u05BF\u05C1\u05C2\u05C4\u05C5\u05C7\u0610-\u061A\u064B-\u065F\u0670\u06D6-\u06DC\u06DF-\u06E4\u06E7\u06E8\u06EA-\u06ED\u0711\u0730-\u074A\u07A6-\u07B0\u07EB-\u07F3\u07FD\u0816-\u0819\u081B-\u0823\u0825-\u0827\u0829-\u082D\u0859-\u085B\u08D3-\u08E1\u08E3-\u0903\u093A-\u093C\u093E-\u094F\u0951-\u0957\u0962\u0963\u0981-\u0983\u09BC\u09BE-\u09C4\u09C7\u09C8\u09CB-\u09CD\u09D7\u09E2\u09E3\u09FE\u0A01-\u0A03\u0A3C\u0A3E-\u0A42\u0A47\u0A48\u0A4B-\u0A4D\u0A51\u0A70\u0A71\u0A75\u0A81-\u0A83\u0ABC\u0ABE-\u0AC5\u0AC7-\u0AC9\u0ACB-\u0ACD\u0AE2\u0AE3\u0AFA-\u0AFF\u0B01-\u0B03\u0B3C\u0B3E-\u0B44\u0B47\u0B48\u0B4B-\u0B4D\u0B56\u0B57\u0B62\u0B63\u0B82\u0BBE-\u0BC2\u0BC6-\u0BC8\u0BCA-\u0BCD\u0BD7\u0C00-\u0C04\u0C3E-\u0C44\u0C46-\u0C48\u0C4A-\u0C4D\u0C55\u0C56\u0C62\u0C63\u0C81-\u0C83\u0CBC\u0CBE-\u0CC4\u0CC6-\u0CC8\u0CCA-\u0CCD\u0CD5\u0CD6\u0CE2\u0CE3\u0D00-\u0D03\u0D3B\u0D3C\u0D3E-\u0D44\u0D46-\u0D48\u0D4A-\u0D4D\u0D57\u0D62\u0D63\u0D82\u0D83\u0DCA\u0DCF-\u0DD4\u0DD6\u0DD8-\u0DDF\u0DF2\u0DF3\u0E31\u0E34-\u0E3A\u0E47-\u0E4E\u0EB1\u0EB4-\u0EB9\u0EBB\u0EBC\u0EC8-\u0ECD\u0F18\u0F19\u0F35\u0F37\u0F39\u0F3E\u0F3F\u0F71-\u0F84\u0F86\u0F87\u0F8D-\u0F97\u0F99-\u0FBC\u0FC6\u102B-\u103E\u1056-\u1059\u105E-\u1060\u1062-\u1064\u1067-\u106D\u1071-\u1074\u1082-\u108D\u108F\u109A-\u109D\u135D-\u135F\u1712-\u1714\u1732-\u1734\u1752\u1753\u1772\u1773\u17B4-\u17D3\u17DD\u180B-\u180D\u1885\u1886\u18A9\u1920-\u192B\u1930-\u193B\u1A17-\u1A1B\u1A55-\u1A5E\u1A60-\u1A7C\u1A7F\u1AB0-\u1ABE\u1B00-\u1B04\u1B34-\u1B44\u1B6B-\u1B73\u1B80-\u1B82\u1BA1-\u1BAD\u1BE6-\u1BF3\u1C24-\u1C37\u1CD0-\u1CD2\u1CD4-\u1CE8\u1CED\u1CF2-\u1CF4\u1CF7-\u1CF9\u1DC0-\u1DF9\u1DFB-\u1DFF\u20D0-\u20F0\u2CEF-\u2CF1\u2D7F\u2DE0-\u2DFF\u302A-\u302F\u3099\u309A\uA66F-\uA672\uA674-\uA67D\uA69E\uA69F\uA6F0\uA6F1\uA802\uA806\uA80B\uA823-\uA827\uA880\uA881\uA8B4-\uA8C5\uA8E0-\uA8F1\uA8FF\uA926-\uA92D\uA947-\uA953\uA980-\uA983\uA9B3-\uA9C0\uA9E5\uAA29-\uAA36\uAA43\uAA4C\uAA4D\uAA7B-\uAA7D\uAAB0\uAAB2-\uAAB4\uAAB7\uAAB8\uAABE\uAABF\uAAC1\uAAEB-\uAAEF\uAAF5\uAAF6\uABE3-\uABEA\uABEC\uABED\uFB1E\uFE00-\uFE0F\uFE20-\uFE2F', + 'astral': '\uD800[\uDDFD\uDEE0\uDF76-\uDF7A]|\uD802[\uDE01-\uDE03\uDE05\uDE06\uDE0C-\uDE0F\uDE38-\uDE3A\uDE3F\uDEE5\uDEE6]|\uD803[\uDD24-\uDD27\uDF46-\uDF50]|\uD804[\uDC00-\uDC02\uDC38-\uDC46\uDC7F-\uDC82\uDCB0-\uDCBA\uDD00-\uDD02\uDD27-\uDD34\uDD45\uDD46\uDD73\uDD80-\uDD82\uDDB3-\uDDC0\uDDC9-\uDDCC\uDE2C-\uDE37\uDE3E\uDEDF-\uDEEA\uDF00-\uDF03\uDF3B\uDF3C\uDF3E-\uDF44\uDF47\uDF48\uDF4B-\uDF4D\uDF57\uDF62\uDF63\uDF66-\uDF6C\uDF70-\uDF74]|\uD805[\uDC35-\uDC46\uDC5E\uDCB0-\uDCC3\uDDAF-\uDDB5\uDDB8-\uDDC0\uDDDC\uDDDD\uDE30-\uDE40\uDEAB-\uDEB7\uDF1D-\uDF2B]|\uD806[\uDC2C-\uDC3A\uDE01-\uDE0A\uDE33-\uDE39\uDE3B-\uDE3E\uDE47\uDE51-\uDE5B\uDE8A-\uDE99]|\uD807[\uDC2F-\uDC36\uDC38-\uDC3F\uDC92-\uDCA7\uDCA9-\uDCB6\uDD31-\uDD36\uDD3A\uDD3C\uDD3D\uDD3F-\uDD45\uDD47\uDD8A-\uDD8E\uDD90\uDD91\uDD93-\uDD97\uDEF3-\uDEF6]|\uD81A[\uDEF0-\uDEF4\uDF30-\uDF36]|\uD81B[\uDF51-\uDF7E\uDF8F-\uDF92]|\uD82F[\uDC9D\uDC9E]|\uD834[\uDD65-\uDD69\uDD6D-\uDD72\uDD7B-\uDD82\uDD85-\uDD8B\uDDAA-\uDDAD\uDE42-\uDE44]|\uD836[\uDE00-\uDE36\uDE3B-\uDE6C\uDE75\uDE84\uDE9B-\uDE9F\uDEA1-\uDEAF]|\uD838[\uDC00-\uDC06\uDC08-\uDC18\uDC1B-\uDC21\uDC23\uDC24\uDC26-\uDC2A]|\uD83A[\uDCD0-\uDCD6\uDD44-\uDD4A]|\uDB40[\uDD00-\uDDEF]' + }, + { + 'name': 'Mc', + 'alias': 'Spacing_Mark', + 'bmp': '\u0903\u093B\u093E-\u0940\u0949-\u094C\u094E\u094F\u0982\u0983\u09BE-\u09C0\u09C7\u09C8\u09CB\u09CC\u09D7\u0A03\u0A3E-\u0A40\u0A83\u0ABE-\u0AC0\u0AC9\u0ACB\u0ACC\u0B02\u0B03\u0B3E\u0B40\u0B47\u0B48\u0B4B\u0B4C\u0B57\u0BBE\u0BBF\u0BC1\u0BC2\u0BC6-\u0BC8\u0BCA-\u0BCC\u0BD7\u0C01-\u0C03\u0C41-\u0C44\u0C82\u0C83\u0CBE\u0CC0-\u0CC4\u0CC7\u0CC8\u0CCA\u0CCB\u0CD5\u0CD6\u0D02\u0D03\u0D3E-\u0D40\u0D46-\u0D48\u0D4A-\u0D4C\u0D57\u0D82\u0D83\u0DCF-\u0DD1\u0DD8-\u0DDF\u0DF2\u0DF3\u0F3E\u0F3F\u0F7F\u102B\u102C\u1031\u1038\u103B\u103C\u1056\u1057\u1062-\u1064\u1067-\u106D\u1083\u1084\u1087-\u108C\u108F\u109A-\u109C\u17B6\u17BE-\u17C5\u17C7\u17C8\u1923-\u1926\u1929-\u192B\u1930\u1931\u1933-\u1938\u1A19\u1A1A\u1A55\u1A57\u1A61\u1A63\u1A64\u1A6D-\u1A72\u1B04\u1B35\u1B3B\u1B3D-\u1B41\u1B43\u1B44\u1B82\u1BA1\u1BA6\u1BA7\u1BAA\u1BE7\u1BEA-\u1BEC\u1BEE\u1BF2\u1BF3\u1C24-\u1C2B\u1C34\u1C35\u1CE1\u1CF2\u1CF3\u1CF7\u302E\u302F\uA823\uA824\uA827\uA880\uA881\uA8B4-\uA8C3\uA952\uA953\uA983\uA9B4\uA9B5\uA9BA\uA9BB\uA9BD-\uA9C0\uAA2F\uAA30\uAA33\uAA34\uAA4D\uAA7B\uAA7D\uAAEB\uAAEE\uAAEF\uAAF5\uABE3\uABE4\uABE6\uABE7\uABE9\uABEA\uABEC', + 'astral': '\uD804[\uDC00\uDC02\uDC82\uDCB0-\uDCB2\uDCB7\uDCB8\uDD2C\uDD45\uDD46\uDD82\uDDB3-\uDDB5\uDDBF\uDDC0\uDE2C-\uDE2E\uDE32\uDE33\uDE35\uDEE0-\uDEE2\uDF02\uDF03\uDF3E\uDF3F\uDF41-\uDF44\uDF47\uDF48\uDF4B-\uDF4D\uDF57\uDF62\uDF63]|\uD805[\uDC35-\uDC37\uDC40\uDC41\uDC45\uDCB0-\uDCB2\uDCB9\uDCBB-\uDCBE\uDCC1\uDDAF-\uDDB1\uDDB8-\uDDBB\uDDBE\uDE30-\uDE32\uDE3B\uDE3C\uDE3E\uDEAC\uDEAE\uDEAF\uDEB6\uDF20\uDF21\uDF26]|\uD806[\uDC2C-\uDC2E\uDC38\uDE39\uDE57\uDE58\uDE97]|\uD807[\uDC2F\uDC3E\uDCA9\uDCB1\uDCB4\uDD8A-\uDD8E\uDD93\uDD94\uDD96\uDEF5\uDEF6]|\uD81B[\uDF51-\uDF7E]|\uD834[\uDD65\uDD66\uDD6D-\uDD72]' + }, + { + 'name': 'Me', + 'alias': 'Enclosing_Mark', + 'bmp': '\u0488\u0489\u1ABE\u20DD-\u20E0\u20E2-\u20E4\uA670-\uA672' + }, + { + 'name': 'Mn', + 'alias': 'Nonspacing_Mark', + 'bmp': '\u0300-\u036F\u0483-\u0487\u0591-\u05BD\u05BF\u05C1\u05C2\u05C4\u05C5\u05C7\u0610-\u061A\u064B-\u065F\u0670\u06D6-\u06DC\u06DF-\u06E4\u06E7\u06E8\u06EA-\u06ED\u0711\u0730-\u074A\u07A6-\u07B0\u07EB-\u07F3\u07FD\u0816-\u0819\u081B-\u0823\u0825-\u0827\u0829-\u082D\u0859-\u085B\u08D3-\u08E1\u08E3-\u0902\u093A\u093C\u0941-\u0948\u094D\u0951-\u0957\u0962\u0963\u0981\u09BC\u09C1-\u09C4\u09CD\u09E2\u09E3\u09FE\u0A01\u0A02\u0A3C\u0A41\u0A42\u0A47\u0A48\u0A4B-\u0A4D\u0A51\u0A70\u0A71\u0A75\u0A81\u0A82\u0ABC\u0AC1-\u0AC5\u0AC7\u0AC8\u0ACD\u0AE2\u0AE3\u0AFA-\u0AFF\u0B01\u0B3C\u0B3F\u0B41-\u0B44\u0B4D\u0B56\u0B62\u0B63\u0B82\u0BC0\u0BCD\u0C00\u0C04\u0C3E-\u0C40\u0C46-\u0C48\u0C4A-\u0C4D\u0C55\u0C56\u0C62\u0C63\u0C81\u0CBC\u0CBF\u0CC6\u0CCC\u0CCD\u0CE2\u0CE3\u0D00\u0D01\u0D3B\u0D3C\u0D41-\u0D44\u0D4D\u0D62\u0D63\u0DCA\u0DD2-\u0DD4\u0DD6\u0E31\u0E34-\u0E3A\u0E47-\u0E4E\u0EB1\u0EB4-\u0EB9\u0EBB\u0EBC\u0EC8-\u0ECD\u0F18\u0F19\u0F35\u0F37\u0F39\u0F71-\u0F7E\u0F80-\u0F84\u0F86\u0F87\u0F8D-\u0F97\u0F99-\u0FBC\u0FC6\u102D-\u1030\u1032-\u1037\u1039\u103A\u103D\u103E\u1058\u1059\u105E-\u1060\u1071-\u1074\u1082\u1085\u1086\u108D\u109D\u135D-\u135F\u1712-\u1714\u1732-\u1734\u1752\u1753\u1772\u1773\u17B4\u17B5\u17B7-\u17BD\u17C6\u17C9-\u17D3\u17DD\u180B-\u180D\u1885\u1886\u18A9\u1920-\u1922\u1927\u1928\u1932\u1939-\u193B\u1A17\u1A18\u1A1B\u1A56\u1A58-\u1A5E\u1A60\u1A62\u1A65-\u1A6C\u1A73-\u1A7C\u1A7F\u1AB0-\u1ABD\u1B00-\u1B03\u1B34\u1B36-\u1B3A\u1B3C\u1B42\u1B6B-\u1B73\u1B80\u1B81\u1BA2-\u1BA5\u1BA8\u1BA9\u1BAB-\u1BAD\u1BE6\u1BE8\u1BE9\u1BED\u1BEF-\u1BF1\u1C2C-\u1C33\u1C36\u1C37\u1CD0-\u1CD2\u1CD4-\u1CE0\u1CE2-\u1CE8\u1CED\u1CF4\u1CF8\u1CF9\u1DC0-\u1DF9\u1DFB-\u1DFF\u20D0-\u20DC\u20E1\u20E5-\u20F0\u2CEF-\u2CF1\u2D7F\u2DE0-\u2DFF\u302A-\u302D\u3099\u309A\uA66F\uA674-\uA67D\uA69E\uA69F\uA6F0\uA6F1\uA802\uA806\uA80B\uA825\uA826\uA8C4\uA8C5\uA8E0-\uA8F1\uA8FF\uA926-\uA92D\uA947-\uA951\uA980-\uA982\uA9B3\uA9B6-\uA9B9\uA9BC\uA9E5\uAA29-\uAA2E\uAA31\uAA32\uAA35\uAA36\uAA43\uAA4C\uAA7C\uAAB0\uAAB2-\uAAB4\uAAB7\uAAB8\uAABE\uAABF\uAAC1\uAAEC\uAAED\uAAF6\uABE5\uABE8\uABED\uFB1E\uFE00-\uFE0F\uFE20-\uFE2F', + 'astral': '\uD800[\uDDFD\uDEE0\uDF76-\uDF7A]|\uD802[\uDE01-\uDE03\uDE05\uDE06\uDE0C-\uDE0F\uDE38-\uDE3A\uDE3F\uDEE5\uDEE6]|\uD803[\uDD24-\uDD27\uDF46-\uDF50]|\uD804[\uDC01\uDC38-\uDC46\uDC7F-\uDC81\uDCB3-\uDCB6\uDCB9\uDCBA\uDD00-\uDD02\uDD27-\uDD2B\uDD2D-\uDD34\uDD73\uDD80\uDD81\uDDB6-\uDDBE\uDDC9-\uDDCC\uDE2F-\uDE31\uDE34\uDE36\uDE37\uDE3E\uDEDF\uDEE3-\uDEEA\uDF00\uDF01\uDF3B\uDF3C\uDF40\uDF66-\uDF6C\uDF70-\uDF74]|\uD805[\uDC38-\uDC3F\uDC42-\uDC44\uDC46\uDC5E\uDCB3-\uDCB8\uDCBA\uDCBF\uDCC0\uDCC2\uDCC3\uDDB2-\uDDB5\uDDBC\uDDBD\uDDBF\uDDC0\uDDDC\uDDDD\uDE33-\uDE3A\uDE3D\uDE3F\uDE40\uDEAB\uDEAD\uDEB0-\uDEB5\uDEB7\uDF1D-\uDF1F\uDF22-\uDF25\uDF27-\uDF2B]|\uD806[\uDC2F-\uDC37\uDC39\uDC3A\uDE01-\uDE0A\uDE33-\uDE38\uDE3B-\uDE3E\uDE47\uDE51-\uDE56\uDE59-\uDE5B\uDE8A-\uDE96\uDE98\uDE99]|\uD807[\uDC30-\uDC36\uDC38-\uDC3D\uDC3F\uDC92-\uDCA7\uDCAA-\uDCB0\uDCB2\uDCB3\uDCB5\uDCB6\uDD31-\uDD36\uDD3A\uDD3C\uDD3D\uDD3F-\uDD45\uDD47\uDD90\uDD91\uDD95\uDD97\uDEF3\uDEF4]|\uD81A[\uDEF0-\uDEF4\uDF30-\uDF36]|\uD81B[\uDF8F-\uDF92]|\uD82F[\uDC9D\uDC9E]|\uD834[\uDD67-\uDD69\uDD7B-\uDD82\uDD85-\uDD8B\uDDAA-\uDDAD\uDE42-\uDE44]|\uD836[\uDE00-\uDE36\uDE3B-\uDE6C\uDE75\uDE84\uDE9B-\uDE9F\uDEA1-\uDEAF]|\uD838[\uDC00-\uDC06\uDC08-\uDC18\uDC1B-\uDC21\uDC23\uDC24\uDC26-\uDC2A]|\uD83A[\uDCD0-\uDCD6\uDD44-\uDD4A]|\uDB40[\uDD00-\uDDEF]' + }, + { + 'name': 'N', + 'alias': 'Number', + 'bmp': '0-9\xB2\xB3\xB9\xBC-\xBE\u0660-\u0669\u06F0-\u06F9\u07C0-\u07C9\u0966-\u096F\u09E6-\u09EF\u09F4-\u09F9\u0A66-\u0A6F\u0AE6-\u0AEF\u0B66-\u0B6F\u0B72-\u0B77\u0BE6-\u0BF2\u0C66-\u0C6F\u0C78-\u0C7E\u0CE6-\u0CEF\u0D58-\u0D5E\u0D66-\u0D78\u0DE6-\u0DEF\u0E50-\u0E59\u0ED0-\u0ED9\u0F20-\u0F33\u1040-\u1049\u1090-\u1099\u1369-\u137C\u16EE-\u16F0\u17E0-\u17E9\u17F0-\u17F9\u1810-\u1819\u1946-\u194F\u19D0-\u19DA\u1A80-\u1A89\u1A90-\u1A99\u1B50-\u1B59\u1BB0-\u1BB9\u1C40-\u1C49\u1C50-\u1C59\u2070\u2074-\u2079\u2080-\u2089\u2150-\u2182\u2185-\u2189\u2460-\u249B\u24EA-\u24FF\u2776-\u2793\u2CFD\u3007\u3021-\u3029\u3038-\u303A\u3192-\u3195\u3220-\u3229\u3248-\u324F\u3251-\u325F\u3280-\u3289\u32B1-\u32BF\uA620-\uA629\uA6E6-\uA6EF\uA830-\uA835\uA8D0-\uA8D9\uA900-\uA909\uA9D0-\uA9D9\uA9F0-\uA9F9\uAA50-\uAA59\uABF0-\uABF9\uFF10-\uFF19', + 'astral': '\uD800[\uDD07-\uDD33\uDD40-\uDD78\uDD8A\uDD8B\uDEE1-\uDEFB\uDF20-\uDF23\uDF41\uDF4A\uDFD1-\uDFD5]|\uD801[\uDCA0-\uDCA9]|\uD802[\uDC58-\uDC5F\uDC79-\uDC7F\uDCA7-\uDCAF\uDCFB-\uDCFF\uDD16-\uDD1B\uDDBC\uDDBD\uDDC0-\uDDCF\uDDD2-\uDDFF\uDE40-\uDE48\uDE7D\uDE7E\uDE9D-\uDE9F\uDEEB-\uDEEF\uDF58-\uDF5F\uDF78-\uDF7F\uDFA9-\uDFAF]|\uD803[\uDCFA-\uDCFF\uDD30-\uDD39\uDE60-\uDE7E\uDF1D-\uDF26\uDF51-\uDF54]|\uD804[\uDC52-\uDC6F\uDCF0-\uDCF9\uDD36-\uDD3F\uDDD0-\uDDD9\uDDE1-\uDDF4\uDEF0-\uDEF9]|\uD805[\uDC50-\uDC59\uDCD0-\uDCD9\uDE50-\uDE59\uDEC0-\uDEC9\uDF30-\uDF3B]|\uD806[\uDCE0-\uDCF2]|\uD807[\uDC50-\uDC6C\uDD50-\uDD59\uDDA0-\uDDA9]|\uD809[\uDC00-\uDC6E]|\uD81A[\uDE60-\uDE69\uDF50-\uDF59\uDF5B-\uDF61]|\uD81B[\uDE80-\uDE96]|\uD834[\uDEE0-\uDEF3\uDF60-\uDF78]|\uD835[\uDFCE-\uDFFF]|\uD83A[\uDCC7-\uDCCF\uDD50-\uDD59]|\uD83B[\uDC71-\uDCAB\uDCAD-\uDCAF\uDCB1-\uDCB4]|\uD83C[\uDD00-\uDD0C]' + }, + { + 'name': 'Nd', + 'alias': 'Decimal_Number', + 'bmp': '0-9\u0660-\u0669\u06F0-\u06F9\u07C0-\u07C9\u0966-\u096F\u09E6-\u09EF\u0A66-\u0A6F\u0AE6-\u0AEF\u0B66-\u0B6F\u0BE6-\u0BEF\u0C66-\u0C6F\u0CE6-\u0CEF\u0D66-\u0D6F\u0DE6-\u0DEF\u0E50-\u0E59\u0ED0-\u0ED9\u0F20-\u0F29\u1040-\u1049\u1090-\u1099\u17E0-\u17E9\u1810-\u1819\u1946-\u194F\u19D0-\u19D9\u1A80-\u1A89\u1A90-\u1A99\u1B50-\u1B59\u1BB0-\u1BB9\u1C40-\u1C49\u1C50-\u1C59\uA620-\uA629\uA8D0-\uA8D9\uA900-\uA909\uA9D0-\uA9D9\uA9F0-\uA9F9\uAA50-\uAA59\uABF0-\uABF9\uFF10-\uFF19', + 'astral': '\uD801[\uDCA0-\uDCA9]|\uD803[\uDD30-\uDD39]|\uD804[\uDC66-\uDC6F\uDCF0-\uDCF9\uDD36-\uDD3F\uDDD0-\uDDD9\uDEF0-\uDEF9]|\uD805[\uDC50-\uDC59\uDCD0-\uDCD9\uDE50-\uDE59\uDEC0-\uDEC9\uDF30-\uDF39]|\uD806[\uDCE0-\uDCE9]|\uD807[\uDC50-\uDC59\uDD50-\uDD59\uDDA0-\uDDA9]|\uD81A[\uDE60-\uDE69\uDF50-\uDF59]|\uD835[\uDFCE-\uDFFF]|\uD83A[\uDD50-\uDD59]' + }, + { + 'name': 'Nl', + 'alias': 'Letter_Number', + 'bmp': '\u16EE-\u16F0\u2160-\u2182\u2185-\u2188\u3007\u3021-\u3029\u3038-\u303A\uA6E6-\uA6EF', + 'astral': '\uD800[\uDD40-\uDD74\uDF41\uDF4A\uDFD1-\uDFD5]|\uD809[\uDC00-\uDC6E]' + }, + { + 'name': 'No', + 'alias': 'Other_Number', + 'bmp': '\xB2\xB3\xB9\xBC-\xBE\u09F4-\u09F9\u0B72-\u0B77\u0BF0-\u0BF2\u0C78-\u0C7E\u0D58-\u0D5E\u0D70-\u0D78\u0F2A-\u0F33\u1369-\u137C\u17F0-\u17F9\u19DA\u2070\u2074-\u2079\u2080-\u2089\u2150-\u215F\u2189\u2460-\u249B\u24EA-\u24FF\u2776-\u2793\u2CFD\u3192-\u3195\u3220-\u3229\u3248-\u324F\u3251-\u325F\u3280-\u3289\u32B1-\u32BF\uA830-\uA835', + 'astral': '\uD800[\uDD07-\uDD33\uDD75-\uDD78\uDD8A\uDD8B\uDEE1-\uDEFB\uDF20-\uDF23]|\uD802[\uDC58-\uDC5F\uDC79-\uDC7F\uDCA7-\uDCAF\uDCFB-\uDCFF\uDD16-\uDD1B\uDDBC\uDDBD\uDDC0-\uDDCF\uDDD2-\uDDFF\uDE40-\uDE48\uDE7D\uDE7E\uDE9D-\uDE9F\uDEEB-\uDEEF\uDF58-\uDF5F\uDF78-\uDF7F\uDFA9-\uDFAF]|\uD803[\uDCFA-\uDCFF\uDE60-\uDE7E\uDF1D-\uDF26\uDF51-\uDF54]|\uD804[\uDC52-\uDC65\uDDE1-\uDDF4]|\uD805[\uDF3A\uDF3B]|\uD806[\uDCEA-\uDCF2]|\uD807[\uDC5A-\uDC6C]|\uD81A[\uDF5B-\uDF61]|\uD81B[\uDE80-\uDE96]|\uD834[\uDEE0-\uDEF3\uDF60-\uDF78]|\uD83A[\uDCC7-\uDCCF]|\uD83B[\uDC71-\uDCAB\uDCAD-\uDCAF\uDCB1-\uDCB4]|\uD83C[\uDD00-\uDD0C]' + }, + { + 'name': 'P', + 'alias': 'Punctuation', + 'bmp': '!-#%-\\*,-\\/:;\\?@\\[-\\]_\\{\\}\xA1\xA7\xAB\xB6\xB7\xBB\xBF\u037E\u0387\u055A-\u055F\u0589\u058A\u05BE\u05C0\u05C3\u05C6\u05F3\u05F4\u0609\u060A\u060C\u060D\u061B\u061E\u061F\u066A-\u066D\u06D4\u0700-\u070D\u07F7-\u07F9\u0830-\u083E\u085E\u0964\u0965\u0970\u09FD\u0A76\u0AF0\u0C84\u0DF4\u0E4F\u0E5A\u0E5B\u0F04-\u0F12\u0F14\u0F3A-\u0F3D\u0F85\u0FD0-\u0FD4\u0FD9\u0FDA\u104A-\u104F\u10FB\u1360-\u1368\u1400\u166D\u166E\u169B\u169C\u16EB-\u16ED\u1735\u1736\u17D4-\u17D6\u17D8-\u17DA\u1800-\u180A\u1944\u1945\u1A1E\u1A1F\u1AA0-\u1AA6\u1AA8-\u1AAD\u1B5A-\u1B60\u1BFC-\u1BFF\u1C3B-\u1C3F\u1C7E\u1C7F\u1CC0-\u1CC7\u1CD3\u2010-\u2027\u2030-\u2043\u2045-\u2051\u2053-\u205E\u207D\u207E\u208D\u208E\u2308-\u230B\u2329\u232A\u2768-\u2775\u27C5\u27C6\u27E6-\u27EF\u2983-\u2998\u29D8-\u29DB\u29FC\u29FD\u2CF9-\u2CFC\u2CFE\u2CFF\u2D70\u2E00-\u2E2E\u2E30-\u2E4E\u3001-\u3003\u3008-\u3011\u3014-\u301F\u3030\u303D\u30A0\u30FB\uA4FE\uA4FF\uA60D-\uA60F\uA673\uA67E\uA6F2-\uA6F7\uA874-\uA877\uA8CE\uA8CF\uA8F8-\uA8FA\uA8FC\uA92E\uA92F\uA95F\uA9C1-\uA9CD\uA9DE\uA9DF\uAA5C-\uAA5F\uAADE\uAADF\uAAF0\uAAF1\uABEB\uFD3E\uFD3F\uFE10-\uFE19\uFE30-\uFE52\uFE54-\uFE61\uFE63\uFE68\uFE6A\uFE6B\uFF01-\uFF03\uFF05-\uFF0A\uFF0C-\uFF0F\uFF1A\uFF1B\uFF1F\uFF20\uFF3B-\uFF3D\uFF3F\uFF5B\uFF5D\uFF5F-\uFF65', + 'astral': '\uD800[\uDD00-\uDD02\uDF9F\uDFD0]|\uD801\uDD6F|\uD802[\uDC57\uDD1F\uDD3F\uDE50-\uDE58\uDE7F\uDEF0-\uDEF6\uDF39-\uDF3F\uDF99-\uDF9C]|\uD803[\uDF55-\uDF59]|\uD804[\uDC47-\uDC4D\uDCBB\uDCBC\uDCBE-\uDCC1\uDD40-\uDD43\uDD74\uDD75\uDDC5-\uDDC8\uDDCD\uDDDB\uDDDD-\uDDDF\uDE38-\uDE3D\uDEA9]|\uD805[\uDC4B-\uDC4F\uDC5B\uDC5D\uDCC6\uDDC1-\uDDD7\uDE41-\uDE43\uDE60-\uDE6C\uDF3C-\uDF3E]|\uD806[\uDC3B\uDE3F-\uDE46\uDE9A-\uDE9C\uDE9E-\uDEA2]|\uD807[\uDC41-\uDC45\uDC70\uDC71\uDEF7\uDEF8]|\uD809[\uDC70-\uDC74]|\uD81A[\uDE6E\uDE6F\uDEF5\uDF37-\uDF3B\uDF44]|\uD81B[\uDE97-\uDE9A]|\uD82F\uDC9F|\uD836[\uDE87-\uDE8B]|\uD83A[\uDD5E\uDD5F]' + }, + { + 'name': 'Pc', + 'alias': 'Connector_Punctuation', + 'bmp': '_\u203F\u2040\u2054\uFE33\uFE34\uFE4D-\uFE4F\uFF3F' + }, + { + 'name': 'Pd', + 'alias': 'Dash_Punctuation', + 'bmp': '\\-\u058A\u05BE\u1400\u1806\u2010-\u2015\u2E17\u2E1A\u2E3A\u2E3B\u2E40\u301C\u3030\u30A0\uFE31\uFE32\uFE58\uFE63\uFF0D' + }, + { + 'name': 'Pe', + 'alias': 'Close_Punctuation', + 'bmp': '\\)\\]\\}\u0F3B\u0F3D\u169C\u2046\u207E\u208E\u2309\u230B\u232A\u2769\u276B\u276D\u276F\u2771\u2773\u2775\u27C6\u27E7\u27E9\u27EB\u27ED\u27EF\u2984\u2986\u2988\u298A\u298C\u298E\u2990\u2992\u2994\u2996\u2998\u29D9\u29DB\u29FD\u2E23\u2E25\u2E27\u2E29\u3009\u300B\u300D\u300F\u3011\u3015\u3017\u3019\u301B\u301E\u301F\uFD3E\uFE18\uFE36\uFE38\uFE3A\uFE3C\uFE3E\uFE40\uFE42\uFE44\uFE48\uFE5A\uFE5C\uFE5E\uFF09\uFF3D\uFF5D\uFF60\uFF63' + }, + { + 'name': 'Pf', + 'alias': 'Final_Punctuation', + 'bmp': '\xBB\u2019\u201D\u203A\u2E03\u2E05\u2E0A\u2E0D\u2E1D\u2E21' + }, + { + 'name': 'Pi', + 'alias': 'Initial_Punctuation', + 'bmp': '\xAB\u2018\u201B\u201C\u201F\u2039\u2E02\u2E04\u2E09\u2E0C\u2E1C\u2E20' + }, + { + 'name': 'Po', + 'alias': 'Other_Punctuation', + 'bmp': '!-#%-\'\\*,\\.\\/:;\\?@\\\xA1\xA7\xB6\xB7\xBF\u037E\u0387\u055A-\u055F\u0589\u05C0\u05C3\u05C6\u05F3\u05F4\u0609\u060A\u060C\u060D\u061B\u061E\u061F\u066A-\u066D\u06D4\u0700-\u070D\u07F7-\u07F9\u0830-\u083E\u085E\u0964\u0965\u0970\u09FD\u0A76\u0AF0\u0C84\u0DF4\u0E4F\u0E5A\u0E5B\u0F04-\u0F12\u0F14\u0F85\u0FD0-\u0FD4\u0FD9\u0FDA\u104A-\u104F\u10FB\u1360-\u1368\u166D\u166E\u16EB-\u16ED\u1735\u1736\u17D4-\u17D6\u17D8-\u17DA\u1800-\u1805\u1807-\u180A\u1944\u1945\u1A1E\u1A1F\u1AA0-\u1AA6\u1AA8-\u1AAD\u1B5A-\u1B60\u1BFC-\u1BFF\u1C3B-\u1C3F\u1C7E\u1C7F\u1CC0-\u1CC7\u1CD3\u2016\u2017\u2020-\u2027\u2030-\u2038\u203B-\u203E\u2041-\u2043\u2047-\u2051\u2053\u2055-\u205E\u2CF9-\u2CFC\u2CFE\u2CFF\u2D70\u2E00\u2E01\u2E06-\u2E08\u2E0B\u2E0E-\u2E16\u2E18\u2E19\u2E1B\u2E1E\u2E1F\u2E2A-\u2E2E\u2E30-\u2E39\u2E3C-\u2E3F\u2E41\u2E43-\u2E4E\u3001-\u3003\u303D\u30FB\uA4FE\uA4FF\uA60D-\uA60F\uA673\uA67E\uA6F2-\uA6F7\uA874-\uA877\uA8CE\uA8CF\uA8F8-\uA8FA\uA8FC\uA92E\uA92F\uA95F\uA9C1-\uA9CD\uA9DE\uA9DF\uAA5C-\uAA5F\uAADE\uAADF\uAAF0\uAAF1\uABEB\uFE10-\uFE16\uFE19\uFE30\uFE45\uFE46\uFE49-\uFE4C\uFE50-\uFE52\uFE54-\uFE57\uFE5F-\uFE61\uFE68\uFE6A\uFE6B\uFF01-\uFF03\uFF05-\uFF07\uFF0A\uFF0C\uFF0E\uFF0F\uFF1A\uFF1B\uFF1F\uFF20\uFF3C\uFF61\uFF64\uFF65', + 'astral': '\uD800[\uDD00-\uDD02\uDF9F\uDFD0]|\uD801\uDD6F|\uD802[\uDC57\uDD1F\uDD3F\uDE50-\uDE58\uDE7F\uDEF0-\uDEF6\uDF39-\uDF3F\uDF99-\uDF9C]|\uD803[\uDF55-\uDF59]|\uD804[\uDC47-\uDC4D\uDCBB\uDCBC\uDCBE-\uDCC1\uDD40-\uDD43\uDD74\uDD75\uDDC5-\uDDC8\uDDCD\uDDDB\uDDDD-\uDDDF\uDE38-\uDE3D\uDEA9]|\uD805[\uDC4B-\uDC4F\uDC5B\uDC5D\uDCC6\uDDC1-\uDDD7\uDE41-\uDE43\uDE60-\uDE6C\uDF3C-\uDF3E]|\uD806[\uDC3B\uDE3F-\uDE46\uDE9A-\uDE9C\uDE9E-\uDEA2]|\uD807[\uDC41-\uDC45\uDC70\uDC71\uDEF7\uDEF8]|\uD809[\uDC70-\uDC74]|\uD81A[\uDE6E\uDE6F\uDEF5\uDF37-\uDF3B\uDF44]|\uD81B[\uDE97-\uDE9A]|\uD82F\uDC9F|\uD836[\uDE87-\uDE8B]|\uD83A[\uDD5E\uDD5F]' + }, + { + 'name': 'Ps', + 'alias': 'Open_Punctuation', + 'bmp': '\\(\\[\\{\u0F3A\u0F3C\u169B\u201A\u201E\u2045\u207D\u208D\u2308\u230A\u2329\u2768\u276A\u276C\u276E\u2770\u2772\u2774\u27C5\u27E6\u27E8\u27EA\u27EC\u27EE\u2983\u2985\u2987\u2989\u298B\u298D\u298F\u2991\u2993\u2995\u2997\u29D8\u29DA\u29FC\u2E22\u2E24\u2E26\u2E28\u2E42\u3008\u300A\u300C\u300E\u3010\u3014\u3016\u3018\u301A\u301D\uFD3F\uFE17\uFE35\uFE37\uFE39\uFE3B\uFE3D\uFE3F\uFE41\uFE43\uFE47\uFE59\uFE5B\uFE5D\uFF08\uFF3B\uFF5B\uFF5F\uFF62' + }, + { + 'name': 'S', + 'alias': 'Symbol', + 'bmp': '\\$\\+<->\\^`\\|~\xA2-\xA6\xA8\xA9\xAC\xAE-\xB1\xB4\xB8\xD7\xF7\u02C2-\u02C5\u02D2-\u02DF\u02E5-\u02EB\u02ED\u02EF-\u02FF\u0375\u0384\u0385\u03F6\u0482\u058D-\u058F\u0606-\u0608\u060B\u060E\u060F\u06DE\u06E9\u06FD\u06FE\u07F6\u07FE\u07FF\u09F2\u09F3\u09FA\u09FB\u0AF1\u0B70\u0BF3-\u0BFA\u0C7F\u0D4F\u0D79\u0E3F\u0F01-\u0F03\u0F13\u0F15-\u0F17\u0F1A-\u0F1F\u0F34\u0F36\u0F38\u0FBE-\u0FC5\u0FC7-\u0FCC\u0FCE\u0FCF\u0FD5-\u0FD8\u109E\u109F\u1390-\u1399\u17DB\u1940\u19DE-\u19FF\u1B61-\u1B6A\u1B74-\u1B7C\u1FBD\u1FBF-\u1FC1\u1FCD-\u1FCF\u1FDD-\u1FDF\u1FED-\u1FEF\u1FFD\u1FFE\u2044\u2052\u207A-\u207C\u208A-\u208C\u20A0-\u20BF\u2100\u2101\u2103-\u2106\u2108\u2109\u2114\u2116-\u2118\u211E-\u2123\u2125\u2127\u2129\u212E\u213A\u213B\u2140-\u2144\u214A-\u214D\u214F\u218A\u218B\u2190-\u2307\u230C-\u2328\u232B-\u2426\u2440-\u244A\u249C-\u24E9\u2500-\u2767\u2794-\u27C4\u27C7-\u27E5\u27F0-\u2982\u2999-\u29D7\u29DC-\u29FB\u29FE-\u2B73\u2B76-\u2B95\u2B98-\u2BC8\u2BCA-\u2BFE\u2CE5-\u2CEA\u2E80-\u2E99\u2E9B-\u2EF3\u2F00-\u2FD5\u2FF0-\u2FFB\u3004\u3012\u3013\u3020\u3036\u3037\u303E\u303F\u309B\u309C\u3190\u3191\u3196-\u319F\u31C0-\u31E3\u3200-\u321E\u322A-\u3247\u3250\u3260-\u327F\u328A-\u32B0\u32C0-\u32FE\u3300-\u33FF\u4DC0-\u4DFF\uA490-\uA4C6\uA700-\uA716\uA720\uA721\uA789\uA78A\uA828-\uA82B\uA836-\uA839\uAA77-\uAA79\uAB5B\uFB29\uFBB2-\uFBC1\uFDFC\uFDFD\uFE62\uFE64-\uFE66\uFE69\uFF04\uFF0B\uFF1C-\uFF1E\uFF3E\uFF40\uFF5C\uFF5E\uFFE0-\uFFE6\uFFE8-\uFFEE\uFFFC\uFFFD', + 'astral': '\uD800[\uDD37-\uDD3F\uDD79-\uDD89\uDD8C-\uDD8E\uDD90-\uDD9B\uDDA0\uDDD0-\uDDFC]|\uD802[\uDC77\uDC78\uDEC8]|\uD805\uDF3F|\uD81A[\uDF3C-\uDF3F\uDF45]|\uD82F\uDC9C|\uD834[\uDC00-\uDCF5\uDD00-\uDD26\uDD29-\uDD64\uDD6A-\uDD6C\uDD83\uDD84\uDD8C-\uDDA9\uDDAE-\uDDE8\uDE00-\uDE41\uDE45\uDF00-\uDF56]|\uD835[\uDEC1\uDEDB\uDEFB\uDF15\uDF35\uDF4F\uDF6F\uDF89\uDFA9\uDFC3]|\uD836[\uDC00-\uDDFF\uDE37-\uDE3A\uDE6D-\uDE74\uDE76-\uDE83\uDE85\uDE86]|\uD83B[\uDCAC\uDCB0\uDEF0\uDEF1]|\uD83C[\uDC00-\uDC2B\uDC30-\uDC93\uDCA0-\uDCAE\uDCB1-\uDCBF\uDCC1-\uDCCF\uDCD1-\uDCF5\uDD10-\uDD6B\uDD70-\uDDAC\uDDE6-\uDE02\uDE10-\uDE3B\uDE40-\uDE48\uDE50\uDE51\uDE60-\uDE65\uDF00-\uDFFF]|\uD83D[\uDC00-\uDED4\uDEE0-\uDEEC\uDEF0-\uDEF9\uDF00-\uDF73\uDF80-\uDFD8]|\uD83E[\uDC00-\uDC0B\uDC10-\uDC47\uDC50-\uDC59\uDC60-\uDC87\uDC90-\uDCAD\uDD00-\uDD0B\uDD10-\uDD3E\uDD40-\uDD70\uDD73-\uDD76\uDD7A\uDD7C-\uDDA2\uDDB0-\uDDB9\uDDC0-\uDDC2\uDDD0-\uDDFF\uDE60-\uDE6D]' + }, + { + 'name': 'Sc', + 'alias': 'Currency_Symbol', + 'bmp': '\\$\xA2-\xA5\u058F\u060B\u07FE\u07FF\u09F2\u09F3\u09FB\u0AF1\u0BF9\u0E3F\u17DB\u20A0-\u20BF\uA838\uFDFC\uFE69\uFF04\uFFE0\uFFE1\uFFE5\uFFE6', + 'astral': '\uD83B\uDCB0' + }, + { + 'name': 'Sk', + 'alias': 'Modifier_Symbol', + 'bmp': '\\^`\xA8\xAF\xB4\xB8\u02C2-\u02C5\u02D2-\u02DF\u02E5-\u02EB\u02ED\u02EF-\u02FF\u0375\u0384\u0385\u1FBD\u1FBF-\u1FC1\u1FCD-\u1FCF\u1FDD-\u1FDF\u1FED-\u1FEF\u1FFD\u1FFE\u309B\u309C\uA700-\uA716\uA720\uA721\uA789\uA78A\uAB5B\uFBB2-\uFBC1\uFF3E\uFF40\uFFE3', + 'astral': '\uD83C[\uDFFB-\uDFFF]' + }, + { + 'name': 'Sm', + 'alias': 'Math_Symbol', + 'bmp': '\\+<->\\|~\xAC\xB1\xD7\xF7\u03F6\u0606-\u0608\u2044\u2052\u207A-\u207C\u208A-\u208C\u2118\u2140-\u2144\u214B\u2190-\u2194\u219A\u219B\u21A0\u21A3\u21A6\u21AE\u21CE\u21CF\u21D2\u21D4\u21F4-\u22FF\u2320\u2321\u237C\u239B-\u23B3\u23DC-\u23E1\u25B7\u25C1\u25F8-\u25FF\u266F\u27C0-\u27C4\u27C7-\u27E5\u27F0-\u27FF\u2900-\u2982\u2999-\u29D7\u29DC-\u29FB\u29FE-\u2AFF\u2B30-\u2B44\u2B47-\u2B4C\uFB29\uFE62\uFE64-\uFE66\uFF0B\uFF1C-\uFF1E\uFF5C\uFF5E\uFFE2\uFFE9-\uFFEC', + 'astral': '\uD835[\uDEC1\uDEDB\uDEFB\uDF15\uDF35\uDF4F\uDF6F\uDF89\uDFA9\uDFC3]|\uD83B[\uDEF0\uDEF1]' + }, + { + 'name': 'So', + 'alias': 'Other_Symbol', + 'bmp': '\xA6\xA9\xAE\xB0\u0482\u058D\u058E\u060E\u060F\u06DE\u06E9\u06FD\u06FE\u07F6\u09FA\u0B70\u0BF3-\u0BF8\u0BFA\u0C7F\u0D4F\u0D79\u0F01-\u0F03\u0F13\u0F15-\u0F17\u0F1A-\u0F1F\u0F34\u0F36\u0F38\u0FBE-\u0FC5\u0FC7-\u0FCC\u0FCE\u0FCF\u0FD5-\u0FD8\u109E\u109F\u1390-\u1399\u1940\u19DE-\u19FF\u1B61-\u1B6A\u1B74-\u1B7C\u2100\u2101\u2103-\u2106\u2108\u2109\u2114\u2116\u2117\u211E-\u2123\u2125\u2127\u2129\u212E\u213A\u213B\u214A\u214C\u214D\u214F\u218A\u218B\u2195-\u2199\u219C-\u219F\u21A1\u21A2\u21A4\u21A5\u21A7-\u21AD\u21AF-\u21CD\u21D0\u21D1\u21D3\u21D5-\u21F3\u2300-\u2307\u230C-\u231F\u2322-\u2328\u232B-\u237B\u237D-\u239A\u23B4-\u23DB\u23E2-\u2426\u2440-\u244A\u249C-\u24E9\u2500-\u25B6\u25B8-\u25C0\u25C2-\u25F7\u2600-\u266E\u2670-\u2767\u2794-\u27BF\u2800-\u28FF\u2B00-\u2B2F\u2B45\u2B46\u2B4D-\u2B73\u2B76-\u2B95\u2B98-\u2BC8\u2BCA-\u2BFE\u2CE5-\u2CEA\u2E80-\u2E99\u2E9B-\u2EF3\u2F00-\u2FD5\u2FF0-\u2FFB\u3004\u3012\u3013\u3020\u3036\u3037\u303E\u303F\u3190\u3191\u3196-\u319F\u31C0-\u31E3\u3200-\u321E\u322A-\u3247\u3250\u3260-\u327F\u328A-\u32B0\u32C0-\u32FE\u3300-\u33FF\u4DC0-\u4DFF\uA490-\uA4C6\uA828-\uA82B\uA836\uA837\uA839\uAA77-\uAA79\uFDFD\uFFE4\uFFE8\uFFED\uFFEE\uFFFC\uFFFD', + 'astral': '\uD800[\uDD37-\uDD3F\uDD79-\uDD89\uDD8C-\uDD8E\uDD90-\uDD9B\uDDA0\uDDD0-\uDDFC]|\uD802[\uDC77\uDC78\uDEC8]|\uD805\uDF3F|\uD81A[\uDF3C-\uDF3F\uDF45]|\uD82F\uDC9C|\uD834[\uDC00-\uDCF5\uDD00-\uDD26\uDD29-\uDD64\uDD6A-\uDD6C\uDD83\uDD84\uDD8C-\uDDA9\uDDAE-\uDDE8\uDE00-\uDE41\uDE45\uDF00-\uDF56]|\uD836[\uDC00-\uDDFF\uDE37-\uDE3A\uDE6D-\uDE74\uDE76-\uDE83\uDE85\uDE86]|\uD83B\uDCAC|\uD83C[\uDC00-\uDC2B\uDC30-\uDC93\uDCA0-\uDCAE\uDCB1-\uDCBF\uDCC1-\uDCCF\uDCD1-\uDCF5\uDD10-\uDD6B\uDD70-\uDDAC\uDDE6-\uDE02\uDE10-\uDE3B\uDE40-\uDE48\uDE50\uDE51\uDE60-\uDE65\uDF00-\uDFFA]|\uD83D[\uDC00-\uDED4\uDEE0-\uDEEC\uDEF0-\uDEF9\uDF00-\uDF73\uDF80-\uDFD8]|\uD83E[\uDC00-\uDC0B\uDC10-\uDC47\uDC50-\uDC59\uDC60-\uDC87\uDC90-\uDCAD\uDD00-\uDD0B\uDD10-\uDD3E\uDD40-\uDD70\uDD73-\uDD76\uDD7A\uDD7C-\uDDA2\uDDB0-\uDDB9\uDDC0-\uDDC2\uDDD0-\uDDFF\uDE60-\uDE6D]' + }, + { + 'name': 'Z', + 'alias': 'Separator', + 'bmp': ' \xA0\u1680\u2000-\u200A\u2028\u2029\u202F\u205F\u3000' + }, + { + 'name': 'Zl', + 'alias': 'Line_Separator', + 'bmp': '\u2028' + }, + { + 'name': 'Zp', + 'alias': 'Paragraph_Separator', + 'bmp': '\u2029' + }, + { + 'name': 'Zs', + 'alias': 'Space_Separator', + 'bmp': ' \xA0\u1680\u2000-\u200A\u202F\u205F\u3000' + } +]; + +var unicodeCategories = createCommonjsModule(function (module, exports) { +"use strict"; + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.default = void 0; + +var _categories = _interopRequireDefault(categories); + +function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } + +/*! + * XRegExp Unicode Categories 4.2.0 + * + * Steven Levithan (c) 2010-present MIT License + * Unicode data by Mathias Bynens + */ +var _default = function _default(XRegExp) { + /** + * Adds support for Unicode's general categories. E.g., `\p{Lu}` or `\p{Uppercase Letter}`. See + * category descriptions in UAX #44 . Token + * names are case insensitive, and any spaces, hyphens, and underscores are ignored. + * + * Uses Unicode 11.0.0. + * + * @requires XRegExp, Unicode Base + */ + if (!XRegExp.addUnicodeData) { + throw new ReferenceError('Unicode Base must be loaded before Unicode Categories'); + } + + XRegExp.addUnicodeData(_categories.default); +}; + +exports.default = _default; +module.exports = exports["default"]; +}); + +unwrapExports(unicodeCategories); + +var properties = [ + { + 'name': 'ASCII', + 'bmp': '\0-\x7F' + }, + { + 'name': 'Alphabetic', + 'bmp': 'A-Za-z\xAA\xB5\xBA\xC0-\xD6\xD8-\xF6\xF8-\u02C1\u02C6-\u02D1\u02E0-\u02E4\u02EC\u02EE\u0345\u0370-\u0374\u0376\u0377\u037A-\u037D\u037F\u0386\u0388-\u038A\u038C\u038E-\u03A1\u03A3-\u03F5\u03F7-\u0481\u048A-\u052F\u0531-\u0556\u0559\u0560-\u0588\u05B0-\u05BD\u05BF\u05C1\u05C2\u05C4\u05C5\u05C7\u05D0-\u05EA\u05EF-\u05F2\u0610-\u061A\u0620-\u0657\u0659-\u065F\u066E-\u06D3\u06D5-\u06DC\u06E1-\u06E8\u06ED-\u06EF\u06FA-\u06FC\u06FF\u0710-\u073F\u074D-\u07B1\u07CA-\u07EA\u07F4\u07F5\u07FA\u0800-\u0817\u081A-\u082C\u0840-\u0858\u0860-\u086A\u08A0-\u08B4\u08B6-\u08BD\u08D4-\u08DF\u08E3-\u08E9\u08F0-\u093B\u093D-\u094C\u094E-\u0950\u0955-\u0963\u0971-\u0983\u0985-\u098C\u098F\u0990\u0993-\u09A8\u09AA-\u09B0\u09B2\u09B6-\u09B9\u09BD-\u09C4\u09C7\u09C8\u09CB\u09CC\u09CE\u09D7\u09DC\u09DD\u09DF-\u09E3\u09F0\u09F1\u09FC\u0A01-\u0A03\u0A05-\u0A0A\u0A0F\u0A10\u0A13-\u0A28\u0A2A-\u0A30\u0A32\u0A33\u0A35\u0A36\u0A38\u0A39\u0A3E-\u0A42\u0A47\u0A48\u0A4B\u0A4C\u0A51\u0A59-\u0A5C\u0A5E\u0A70-\u0A75\u0A81-\u0A83\u0A85-\u0A8D\u0A8F-\u0A91\u0A93-\u0AA8\u0AAA-\u0AB0\u0AB2\u0AB3\u0AB5-\u0AB9\u0ABD-\u0AC5\u0AC7-\u0AC9\u0ACB\u0ACC\u0AD0\u0AE0-\u0AE3\u0AF9-\u0AFC\u0B01-\u0B03\u0B05-\u0B0C\u0B0F\u0B10\u0B13-\u0B28\u0B2A-\u0B30\u0B32\u0B33\u0B35-\u0B39\u0B3D-\u0B44\u0B47\u0B48\u0B4B\u0B4C\u0B56\u0B57\u0B5C\u0B5D\u0B5F-\u0B63\u0B71\u0B82\u0B83\u0B85-\u0B8A\u0B8E-\u0B90\u0B92-\u0B95\u0B99\u0B9A\u0B9C\u0B9E\u0B9F\u0BA3\u0BA4\u0BA8-\u0BAA\u0BAE-\u0BB9\u0BBE-\u0BC2\u0BC6-\u0BC8\u0BCA-\u0BCC\u0BD0\u0BD7\u0C00-\u0C03\u0C05-\u0C0C\u0C0E-\u0C10\u0C12-\u0C28\u0C2A-\u0C39\u0C3D-\u0C44\u0C46-\u0C48\u0C4A-\u0C4C\u0C55\u0C56\u0C58-\u0C5A\u0C60-\u0C63\u0C80-\u0C83\u0C85-\u0C8C\u0C8E-\u0C90\u0C92-\u0CA8\u0CAA-\u0CB3\u0CB5-\u0CB9\u0CBD-\u0CC4\u0CC6-\u0CC8\u0CCA-\u0CCC\u0CD5\u0CD6\u0CDE\u0CE0-\u0CE3\u0CF1\u0CF2\u0D00-\u0D03\u0D05-\u0D0C\u0D0E-\u0D10\u0D12-\u0D3A\u0D3D-\u0D44\u0D46-\u0D48\u0D4A-\u0D4C\u0D4E\u0D54-\u0D57\u0D5F-\u0D63\u0D7A-\u0D7F\u0D82\u0D83\u0D85-\u0D96\u0D9A-\u0DB1\u0DB3-\u0DBB\u0DBD\u0DC0-\u0DC6\u0DCF-\u0DD4\u0DD6\u0DD8-\u0DDF\u0DF2\u0DF3\u0E01-\u0E3A\u0E40-\u0E46\u0E4D\u0E81\u0E82\u0E84\u0E87\u0E88\u0E8A\u0E8D\u0E94-\u0E97\u0E99-\u0E9F\u0EA1-\u0EA3\u0EA5\u0EA7\u0EAA\u0EAB\u0EAD-\u0EB9\u0EBB-\u0EBD\u0EC0-\u0EC4\u0EC6\u0ECD\u0EDC-\u0EDF\u0F00\u0F40-\u0F47\u0F49-\u0F6C\u0F71-\u0F81\u0F88-\u0F97\u0F99-\u0FBC\u1000-\u1036\u1038\u103B-\u103F\u1050-\u1062\u1065-\u1068\u106E-\u1086\u108E\u109C\u109D\u10A0-\u10C5\u10C7\u10CD\u10D0-\u10FA\u10FC-\u1248\u124A-\u124D\u1250-\u1256\u1258\u125A-\u125D\u1260-\u1288\u128A-\u128D\u1290-\u12B0\u12B2-\u12B5\u12B8-\u12BE\u12C0\u12C2-\u12C5\u12C8-\u12D6\u12D8-\u1310\u1312-\u1315\u1318-\u135A\u135F\u1380-\u138F\u13A0-\u13F5\u13F8-\u13FD\u1401-\u166C\u166F-\u167F\u1681-\u169A\u16A0-\u16EA\u16EE-\u16F8\u1700-\u170C\u170E-\u1713\u1720-\u1733\u1740-\u1753\u1760-\u176C\u176E-\u1770\u1772\u1773\u1780-\u17B3\u17B6-\u17C8\u17D7\u17DC\u1820-\u1878\u1880-\u18AA\u18B0-\u18F5\u1900-\u191E\u1920-\u192B\u1930-\u1938\u1950-\u196D\u1970-\u1974\u1980-\u19AB\u19B0-\u19C9\u1A00-\u1A1B\u1A20-\u1A5E\u1A61-\u1A74\u1AA7\u1B00-\u1B33\u1B35-\u1B43\u1B45-\u1B4B\u1B80-\u1BA9\u1BAC-\u1BAF\u1BBA-\u1BE5\u1BE7-\u1BF1\u1C00-\u1C35\u1C4D-\u1C4F\u1C5A-\u1C7D\u1C80-\u1C88\u1C90-\u1CBA\u1CBD-\u1CBF\u1CE9-\u1CEC\u1CEE-\u1CF3\u1CF5\u1CF6\u1D00-\u1DBF\u1DE7-\u1DF4\u1E00-\u1F15\u1F18-\u1F1D\u1F20-\u1F45\u1F48-\u1F4D\u1F50-\u1F57\u1F59\u1F5B\u1F5D\u1F5F-\u1F7D\u1F80-\u1FB4\u1FB6-\u1FBC\u1FBE\u1FC2-\u1FC4\u1FC6-\u1FCC\u1FD0-\u1FD3\u1FD6-\u1FDB\u1FE0-\u1FEC\u1FF2-\u1FF4\u1FF6-\u1FFC\u2071\u207F\u2090-\u209C\u2102\u2107\u210A-\u2113\u2115\u2119-\u211D\u2124\u2126\u2128\u212A-\u212D\u212F-\u2139\u213C-\u213F\u2145-\u2149\u214E\u2160-\u2188\u24B6-\u24E9\u2C00-\u2C2E\u2C30-\u2C5E\u2C60-\u2CE4\u2CEB-\u2CEE\u2CF2\u2CF3\u2D00-\u2D25\u2D27\u2D2D\u2D30-\u2D67\u2D6F\u2D80-\u2D96\u2DA0-\u2DA6\u2DA8-\u2DAE\u2DB0-\u2DB6\u2DB8-\u2DBE\u2DC0-\u2DC6\u2DC8-\u2DCE\u2DD0-\u2DD6\u2DD8-\u2DDE\u2DE0-\u2DFF\u2E2F\u3005-\u3007\u3021-\u3029\u3031-\u3035\u3038-\u303C\u3041-\u3096\u309D-\u309F\u30A1-\u30FA\u30FC-\u30FF\u3105-\u312F\u3131-\u318E\u31A0-\u31BA\u31F0-\u31FF\u3400-\u4DB5\u4E00-\u9FEF\uA000-\uA48C\uA4D0-\uA4FD\uA500-\uA60C\uA610-\uA61F\uA62A\uA62B\uA640-\uA66E\uA674-\uA67B\uA67F-\uA6EF\uA717-\uA71F\uA722-\uA788\uA78B-\uA7B9\uA7F7-\uA801\uA803-\uA805\uA807-\uA80A\uA80C-\uA827\uA840-\uA873\uA880-\uA8C3\uA8C5\uA8F2-\uA8F7\uA8FB\uA8FD\uA8FE\uA90A-\uA92A\uA930-\uA952\uA960-\uA97C\uA980-\uA9B2\uA9B4-\uA9BF\uA9CF\uA9E0-\uA9E4\uA9E6-\uA9EF\uA9FA-\uA9FE\uAA00-\uAA36\uAA40-\uAA4D\uAA60-\uAA76\uAA7A\uAA7E-\uAABE\uAAC0\uAAC2\uAADB-\uAADD\uAAE0-\uAAEF\uAAF2-\uAAF5\uAB01-\uAB06\uAB09-\uAB0E\uAB11-\uAB16\uAB20-\uAB26\uAB28-\uAB2E\uAB30-\uAB5A\uAB5C-\uAB65\uAB70-\uABEA\uAC00-\uD7A3\uD7B0-\uD7C6\uD7CB-\uD7FB\uF900-\uFA6D\uFA70-\uFAD9\uFB00-\uFB06\uFB13-\uFB17\uFB1D-\uFB28\uFB2A-\uFB36\uFB38-\uFB3C\uFB3E\uFB40\uFB41\uFB43\uFB44\uFB46-\uFBB1\uFBD3-\uFD3D\uFD50-\uFD8F\uFD92-\uFDC7\uFDF0-\uFDFB\uFE70-\uFE74\uFE76-\uFEFC\uFF21-\uFF3A\uFF41-\uFF5A\uFF66-\uFFBE\uFFC2-\uFFC7\uFFCA-\uFFCF\uFFD2-\uFFD7\uFFDA-\uFFDC', + 'astral': '\uD800[\uDC00-\uDC0B\uDC0D-\uDC26\uDC28-\uDC3A\uDC3C\uDC3D\uDC3F-\uDC4D\uDC50-\uDC5D\uDC80-\uDCFA\uDD40-\uDD74\uDE80-\uDE9C\uDEA0-\uDED0\uDF00-\uDF1F\uDF2D-\uDF4A\uDF50-\uDF7A\uDF80-\uDF9D\uDFA0-\uDFC3\uDFC8-\uDFCF\uDFD1-\uDFD5]|\uD801[\uDC00-\uDC9D\uDCB0-\uDCD3\uDCD8-\uDCFB\uDD00-\uDD27\uDD30-\uDD63\uDE00-\uDF36\uDF40-\uDF55\uDF60-\uDF67]|\uD802[\uDC00-\uDC05\uDC08\uDC0A-\uDC35\uDC37\uDC38\uDC3C\uDC3F-\uDC55\uDC60-\uDC76\uDC80-\uDC9E\uDCE0-\uDCF2\uDCF4\uDCF5\uDD00-\uDD15\uDD20-\uDD39\uDD80-\uDDB7\uDDBE\uDDBF\uDE00-\uDE03\uDE05\uDE06\uDE0C-\uDE13\uDE15-\uDE17\uDE19-\uDE35\uDE60-\uDE7C\uDE80-\uDE9C\uDEC0-\uDEC7\uDEC9-\uDEE4\uDF00-\uDF35\uDF40-\uDF55\uDF60-\uDF72\uDF80-\uDF91]|\uD803[\uDC00-\uDC48\uDC80-\uDCB2\uDCC0-\uDCF2\uDD00-\uDD27\uDF00-\uDF1C\uDF27\uDF30-\uDF45]|\uD804[\uDC00-\uDC45\uDC82-\uDCB8\uDCD0-\uDCE8\uDD00-\uDD32\uDD44-\uDD46\uDD50-\uDD72\uDD76\uDD80-\uDDBF\uDDC1-\uDDC4\uDDDA\uDDDC\uDE00-\uDE11\uDE13-\uDE34\uDE37\uDE3E\uDE80-\uDE86\uDE88\uDE8A-\uDE8D\uDE8F-\uDE9D\uDE9F-\uDEA8\uDEB0-\uDEE8\uDF00-\uDF03\uDF05-\uDF0C\uDF0F\uDF10\uDF13-\uDF28\uDF2A-\uDF30\uDF32\uDF33\uDF35-\uDF39\uDF3D-\uDF44\uDF47\uDF48\uDF4B\uDF4C\uDF50\uDF57\uDF5D-\uDF63]|\uD805[\uDC00-\uDC41\uDC43-\uDC45\uDC47-\uDC4A\uDC80-\uDCC1\uDCC4\uDCC5\uDCC7\uDD80-\uDDB5\uDDB8-\uDDBE\uDDD8-\uDDDD\uDE00-\uDE3E\uDE40\uDE44\uDE80-\uDEB5\uDF00-\uDF1A\uDF1D-\uDF2A]|\uD806[\uDC00-\uDC38\uDCA0-\uDCDF\uDCFF\uDE00-\uDE32\uDE35-\uDE3E\uDE50-\uDE83\uDE86-\uDE97\uDE9D\uDEC0-\uDEF8]|\uD807[\uDC00-\uDC08\uDC0A-\uDC36\uDC38-\uDC3E\uDC40\uDC72-\uDC8F\uDC92-\uDCA7\uDCA9-\uDCB6\uDD00-\uDD06\uDD08\uDD09\uDD0B-\uDD36\uDD3A\uDD3C\uDD3D\uDD3F-\uDD41\uDD43\uDD46\uDD47\uDD60-\uDD65\uDD67\uDD68\uDD6A-\uDD8E\uDD90\uDD91\uDD93-\uDD96\uDD98\uDEE0-\uDEF6]|\uD808[\uDC00-\uDF99]|\uD809[\uDC00-\uDC6E\uDC80-\uDD43]|[\uD80C\uD81C-\uD820\uD840-\uD868\uD86A-\uD86C\uD86F-\uD872\uD874-\uD879][\uDC00-\uDFFF]|\uD80D[\uDC00-\uDC2E]|\uD811[\uDC00-\uDE46]|\uD81A[\uDC00-\uDE38\uDE40-\uDE5E\uDED0-\uDEED\uDF00-\uDF36\uDF40-\uDF43\uDF63-\uDF77\uDF7D-\uDF8F]|\uD81B[\uDE40-\uDE7F\uDF00-\uDF44\uDF50-\uDF7E\uDF93-\uDF9F\uDFE0\uDFE1]|\uD821[\uDC00-\uDFF1]|\uD822[\uDC00-\uDEF2]|\uD82C[\uDC00-\uDD1E\uDD70-\uDEFB]|\uD82F[\uDC00-\uDC6A\uDC70-\uDC7C\uDC80-\uDC88\uDC90-\uDC99\uDC9E]|\uD835[\uDC00-\uDC54\uDC56-\uDC9C\uDC9E\uDC9F\uDCA2\uDCA5\uDCA6\uDCA9-\uDCAC\uDCAE-\uDCB9\uDCBB\uDCBD-\uDCC3\uDCC5-\uDD05\uDD07-\uDD0A\uDD0D-\uDD14\uDD16-\uDD1C\uDD1E-\uDD39\uDD3B-\uDD3E\uDD40-\uDD44\uDD46\uDD4A-\uDD50\uDD52-\uDEA5\uDEA8-\uDEC0\uDEC2-\uDEDA\uDEDC-\uDEFA\uDEFC-\uDF14\uDF16-\uDF34\uDF36-\uDF4E\uDF50-\uDF6E\uDF70-\uDF88\uDF8A-\uDFA8\uDFAA-\uDFC2\uDFC4-\uDFCB]|\uD838[\uDC00-\uDC06\uDC08-\uDC18\uDC1B-\uDC21\uDC23\uDC24\uDC26-\uDC2A]|\uD83A[\uDC00-\uDCC4\uDD00-\uDD43\uDD47]|\uD83B[\uDE00-\uDE03\uDE05-\uDE1F\uDE21\uDE22\uDE24\uDE27\uDE29-\uDE32\uDE34-\uDE37\uDE39\uDE3B\uDE42\uDE47\uDE49\uDE4B\uDE4D-\uDE4F\uDE51\uDE52\uDE54\uDE57\uDE59\uDE5B\uDE5D\uDE5F\uDE61\uDE62\uDE64\uDE67-\uDE6A\uDE6C-\uDE72\uDE74-\uDE77\uDE79-\uDE7C\uDE7E\uDE80-\uDE89\uDE8B-\uDE9B\uDEA1-\uDEA3\uDEA5-\uDEA9\uDEAB-\uDEBB]|\uD83C[\uDD30-\uDD49\uDD50-\uDD69\uDD70-\uDD89]|\uD869[\uDC00-\uDED6\uDF00-\uDFFF]|\uD86D[\uDC00-\uDF34\uDF40-\uDFFF]|\uD86E[\uDC00-\uDC1D\uDC20-\uDFFF]|\uD873[\uDC00-\uDEA1\uDEB0-\uDFFF]|\uD87A[\uDC00-\uDFE0]|\uD87E[\uDC00-\uDE1D]' + }, + { + 'name': 'Any', + 'isBmpLast': true, + 'bmp': '\0-\uFFFF', + 'astral': '[\uD800-\uDBFF][\uDC00-\uDFFF]' + }, + { + 'name': 'Default_Ignorable_Code_Point', + 'bmp': '\xAD\u034F\u061C\u115F\u1160\u17B4\u17B5\u180B-\u180E\u200B-\u200F\u202A-\u202E\u2060-\u206F\u3164\uFE00-\uFE0F\uFEFF\uFFA0\uFFF0-\uFFF8', + 'astral': '\uD82F[\uDCA0-\uDCA3]|\uD834[\uDD73-\uDD7A]|[\uDB40-\uDB43][\uDC00-\uDFFF]' + }, + { + 'name': 'Lowercase', + 'bmp': 'a-z\xAA\xB5\xBA\xDF-\xF6\xF8-\xFF\u0101\u0103\u0105\u0107\u0109\u010B\u010D\u010F\u0111\u0113\u0115\u0117\u0119\u011B\u011D\u011F\u0121\u0123\u0125\u0127\u0129\u012B\u012D\u012F\u0131\u0133\u0135\u0137\u0138\u013A\u013C\u013E\u0140\u0142\u0144\u0146\u0148\u0149\u014B\u014D\u014F\u0151\u0153\u0155\u0157\u0159\u015B\u015D\u015F\u0161\u0163\u0165\u0167\u0169\u016B\u016D\u016F\u0171\u0173\u0175\u0177\u017A\u017C\u017E-\u0180\u0183\u0185\u0188\u018C\u018D\u0192\u0195\u0199-\u019B\u019E\u01A1\u01A3\u01A5\u01A8\u01AA\u01AB\u01AD\u01B0\u01B4\u01B6\u01B9\u01BA\u01BD-\u01BF\u01C6\u01C9\u01CC\u01CE\u01D0\u01D2\u01D4\u01D6\u01D8\u01DA\u01DC\u01DD\u01DF\u01E1\u01E3\u01E5\u01E7\u01E9\u01EB\u01ED\u01EF\u01F0\u01F3\u01F5\u01F9\u01FB\u01FD\u01FF\u0201\u0203\u0205\u0207\u0209\u020B\u020D\u020F\u0211\u0213\u0215\u0217\u0219\u021B\u021D\u021F\u0221\u0223\u0225\u0227\u0229\u022B\u022D\u022F\u0231\u0233-\u0239\u023C\u023F\u0240\u0242\u0247\u0249\u024B\u024D\u024F-\u0293\u0295-\u02B8\u02C0\u02C1\u02E0-\u02E4\u0345\u0371\u0373\u0377\u037A-\u037D\u0390\u03AC-\u03CE\u03D0\u03D1\u03D5-\u03D7\u03D9\u03DB\u03DD\u03DF\u03E1\u03E3\u03E5\u03E7\u03E9\u03EB\u03ED\u03EF-\u03F3\u03F5\u03F8\u03FB\u03FC\u0430-\u045F\u0461\u0463\u0465\u0467\u0469\u046B\u046D\u046F\u0471\u0473\u0475\u0477\u0479\u047B\u047D\u047F\u0481\u048B\u048D\u048F\u0491\u0493\u0495\u0497\u0499\u049B\u049D\u049F\u04A1\u04A3\u04A5\u04A7\u04A9\u04AB\u04AD\u04AF\u04B1\u04B3\u04B5\u04B7\u04B9\u04BB\u04BD\u04BF\u04C2\u04C4\u04C6\u04C8\u04CA\u04CC\u04CE\u04CF\u04D1\u04D3\u04D5\u04D7\u04D9\u04DB\u04DD\u04DF\u04E1\u04E3\u04E5\u04E7\u04E9\u04EB\u04ED\u04EF\u04F1\u04F3\u04F5\u04F7\u04F9\u04FB\u04FD\u04FF\u0501\u0503\u0505\u0507\u0509\u050B\u050D\u050F\u0511\u0513\u0515\u0517\u0519\u051B\u051D\u051F\u0521\u0523\u0525\u0527\u0529\u052B\u052D\u052F\u0560-\u0588\u10D0-\u10FA\u10FD-\u10FF\u13F8-\u13FD\u1C80-\u1C88\u1D00-\u1DBF\u1E01\u1E03\u1E05\u1E07\u1E09\u1E0B\u1E0D\u1E0F\u1E11\u1E13\u1E15\u1E17\u1E19\u1E1B\u1E1D\u1E1F\u1E21\u1E23\u1E25\u1E27\u1E29\u1E2B\u1E2D\u1E2F\u1E31\u1E33\u1E35\u1E37\u1E39\u1E3B\u1E3D\u1E3F\u1E41\u1E43\u1E45\u1E47\u1E49\u1E4B\u1E4D\u1E4F\u1E51\u1E53\u1E55\u1E57\u1E59\u1E5B\u1E5D\u1E5F\u1E61\u1E63\u1E65\u1E67\u1E69\u1E6B\u1E6D\u1E6F\u1E71\u1E73\u1E75\u1E77\u1E79\u1E7B\u1E7D\u1E7F\u1E81\u1E83\u1E85\u1E87\u1E89\u1E8B\u1E8D\u1E8F\u1E91\u1E93\u1E95-\u1E9D\u1E9F\u1EA1\u1EA3\u1EA5\u1EA7\u1EA9\u1EAB\u1EAD\u1EAF\u1EB1\u1EB3\u1EB5\u1EB7\u1EB9\u1EBB\u1EBD\u1EBF\u1EC1\u1EC3\u1EC5\u1EC7\u1EC9\u1ECB\u1ECD\u1ECF\u1ED1\u1ED3\u1ED5\u1ED7\u1ED9\u1EDB\u1EDD\u1EDF\u1EE1\u1EE3\u1EE5\u1EE7\u1EE9\u1EEB\u1EED\u1EEF\u1EF1\u1EF3\u1EF5\u1EF7\u1EF9\u1EFB\u1EFD\u1EFF-\u1F07\u1F10-\u1F15\u1F20-\u1F27\u1F30-\u1F37\u1F40-\u1F45\u1F50-\u1F57\u1F60-\u1F67\u1F70-\u1F7D\u1F80-\u1F87\u1F90-\u1F97\u1FA0-\u1FA7\u1FB0-\u1FB4\u1FB6\u1FB7\u1FBE\u1FC2-\u1FC4\u1FC6\u1FC7\u1FD0-\u1FD3\u1FD6\u1FD7\u1FE0-\u1FE7\u1FF2-\u1FF4\u1FF6\u1FF7\u2071\u207F\u2090-\u209C\u210A\u210E\u210F\u2113\u212F\u2134\u2139\u213C\u213D\u2146-\u2149\u214E\u2170-\u217F\u2184\u24D0-\u24E9\u2C30-\u2C5E\u2C61\u2C65\u2C66\u2C68\u2C6A\u2C6C\u2C71\u2C73\u2C74\u2C76-\u2C7D\u2C81\u2C83\u2C85\u2C87\u2C89\u2C8B\u2C8D\u2C8F\u2C91\u2C93\u2C95\u2C97\u2C99\u2C9B\u2C9D\u2C9F\u2CA1\u2CA3\u2CA5\u2CA7\u2CA9\u2CAB\u2CAD\u2CAF\u2CB1\u2CB3\u2CB5\u2CB7\u2CB9\u2CBB\u2CBD\u2CBF\u2CC1\u2CC3\u2CC5\u2CC7\u2CC9\u2CCB\u2CCD\u2CCF\u2CD1\u2CD3\u2CD5\u2CD7\u2CD9\u2CDB\u2CDD\u2CDF\u2CE1\u2CE3\u2CE4\u2CEC\u2CEE\u2CF3\u2D00-\u2D25\u2D27\u2D2D\uA641\uA643\uA645\uA647\uA649\uA64B\uA64D\uA64F\uA651\uA653\uA655\uA657\uA659\uA65B\uA65D\uA65F\uA661\uA663\uA665\uA667\uA669\uA66B\uA66D\uA681\uA683\uA685\uA687\uA689\uA68B\uA68D\uA68F\uA691\uA693\uA695\uA697\uA699\uA69B-\uA69D\uA723\uA725\uA727\uA729\uA72B\uA72D\uA72F-\uA731\uA733\uA735\uA737\uA739\uA73B\uA73D\uA73F\uA741\uA743\uA745\uA747\uA749\uA74B\uA74D\uA74F\uA751\uA753\uA755\uA757\uA759\uA75B\uA75D\uA75F\uA761\uA763\uA765\uA767\uA769\uA76B\uA76D\uA76F-\uA778\uA77A\uA77C\uA77F\uA781\uA783\uA785\uA787\uA78C\uA78E\uA791\uA793-\uA795\uA797\uA799\uA79B\uA79D\uA79F\uA7A1\uA7A3\uA7A5\uA7A7\uA7A9\uA7AF\uA7B5\uA7B7\uA7B9\uA7F8-\uA7FA\uAB30-\uAB5A\uAB5C-\uAB65\uAB70-\uABBF\uFB00-\uFB06\uFB13-\uFB17\uFF41-\uFF5A', + 'astral': '\uD801[\uDC28-\uDC4F\uDCD8-\uDCFB]|\uD803[\uDCC0-\uDCF2]|\uD806[\uDCC0-\uDCDF]|\uD81B[\uDE60-\uDE7F]|\uD835[\uDC1A-\uDC33\uDC4E-\uDC54\uDC56-\uDC67\uDC82-\uDC9B\uDCB6-\uDCB9\uDCBB\uDCBD-\uDCC3\uDCC5-\uDCCF\uDCEA-\uDD03\uDD1E-\uDD37\uDD52-\uDD6B\uDD86-\uDD9F\uDDBA-\uDDD3\uDDEE-\uDE07\uDE22-\uDE3B\uDE56-\uDE6F\uDE8A-\uDEA5\uDEC2-\uDEDA\uDEDC-\uDEE1\uDEFC-\uDF14\uDF16-\uDF1B\uDF36-\uDF4E\uDF50-\uDF55\uDF70-\uDF88\uDF8A-\uDF8F\uDFAA-\uDFC2\uDFC4-\uDFC9\uDFCB]|\uD83A[\uDD22-\uDD43]' + }, + { + 'name': 'Noncharacter_Code_Point', + 'bmp': '\uFDD0-\uFDEF\uFFFE\uFFFF', + 'astral': '[\uD83F\uD87F\uD8BF\uD8FF\uD93F\uD97F\uD9BF\uD9FF\uDA3F\uDA7F\uDABF\uDAFF\uDB3F\uDB7F\uDBBF\uDBFF][\uDFFE\uDFFF]' + }, + { + 'name': 'Uppercase', + 'bmp': 'A-Z\xC0-\xD6\xD8-\xDE\u0100\u0102\u0104\u0106\u0108\u010A\u010C\u010E\u0110\u0112\u0114\u0116\u0118\u011A\u011C\u011E\u0120\u0122\u0124\u0126\u0128\u012A\u012C\u012E\u0130\u0132\u0134\u0136\u0139\u013B\u013D\u013F\u0141\u0143\u0145\u0147\u014A\u014C\u014E\u0150\u0152\u0154\u0156\u0158\u015A\u015C\u015E\u0160\u0162\u0164\u0166\u0168\u016A\u016C\u016E\u0170\u0172\u0174\u0176\u0178\u0179\u017B\u017D\u0181\u0182\u0184\u0186\u0187\u0189-\u018B\u018E-\u0191\u0193\u0194\u0196-\u0198\u019C\u019D\u019F\u01A0\u01A2\u01A4\u01A6\u01A7\u01A9\u01AC\u01AE\u01AF\u01B1-\u01B3\u01B5\u01B7\u01B8\u01BC\u01C4\u01C7\u01CA\u01CD\u01CF\u01D1\u01D3\u01D5\u01D7\u01D9\u01DB\u01DE\u01E0\u01E2\u01E4\u01E6\u01E8\u01EA\u01EC\u01EE\u01F1\u01F4\u01F6-\u01F8\u01FA\u01FC\u01FE\u0200\u0202\u0204\u0206\u0208\u020A\u020C\u020E\u0210\u0212\u0214\u0216\u0218\u021A\u021C\u021E\u0220\u0222\u0224\u0226\u0228\u022A\u022C\u022E\u0230\u0232\u023A\u023B\u023D\u023E\u0241\u0243-\u0246\u0248\u024A\u024C\u024E\u0370\u0372\u0376\u037F\u0386\u0388-\u038A\u038C\u038E\u038F\u0391-\u03A1\u03A3-\u03AB\u03CF\u03D2-\u03D4\u03D8\u03DA\u03DC\u03DE\u03E0\u03E2\u03E4\u03E6\u03E8\u03EA\u03EC\u03EE\u03F4\u03F7\u03F9\u03FA\u03FD-\u042F\u0460\u0462\u0464\u0466\u0468\u046A\u046C\u046E\u0470\u0472\u0474\u0476\u0478\u047A\u047C\u047E\u0480\u048A\u048C\u048E\u0490\u0492\u0494\u0496\u0498\u049A\u049C\u049E\u04A0\u04A2\u04A4\u04A6\u04A8\u04AA\u04AC\u04AE\u04B0\u04B2\u04B4\u04B6\u04B8\u04BA\u04BC\u04BE\u04C0\u04C1\u04C3\u04C5\u04C7\u04C9\u04CB\u04CD\u04D0\u04D2\u04D4\u04D6\u04D8\u04DA\u04DC\u04DE\u04E0\u04E2\u04E4\u04E6\u04E8\u04EA\u04EC\u04EE\u04F0\u04F2\u04F4\u04F6\u04F8\u04FA\u04FC\u04FE\u0500\u0502\u0504\u0506\u0508\u050A\u050C\u050E\u0510\u0512\u0514\u0516\u0518\u051A\u051C\u051E\u0520\u0522\u0524\u0526\u0528\u052A\u052C\u052E\u0531-\u0556\u10A0-\u10C5\u10C7\u10CD\u13A0-\u13F5\u1C90-\u1CBA\u1CBD-\u1CBF\u1E00\u1E02\u1E04\u1E06\u1E08\u1E0A\u1E0C\u1E0E\u1E10\u1E12\u1E14\u1E16\u1E18\u1E1A\u1E1C\u1E1E\u1E20\u1E22\u1E24\u1E26\u1E28\u1E2A\u1E2C\u1E2E\u1E30\u1E32\u1E34\u1E36\u1E38\u1E3A\u1E3C\u1E3E\u1E40\u1E42\u1E44\u1E46\u1E48\u1E4A\u1E4C\u1E4E\u1E50\u1E52\u1E54\u1E56\u1E58\u1E5A\u1E5C\u1E5E\u1E60\u1E62\u1E64\u1E66\u1E68\u1E6A\u1E6C\u1E6E\u1E70\u1E72\u1E74\u1E76\u1E78\u1E7A\u1E7C\u1E7E\u1E80\u1E82\u1E84\u1E86\u1E88\u1E8A\u1E8C\u1E8E\u1E90\u1E92\u1E94\u1E9E\u1EA0\u1EA2\u1EA4\u1EA6\u1EA8\u1EAA\u1EAC\u1EAE\u1EB0\u1EB2\u1EB4\u1EB6\u1EB8\u1EBA\u1EBC\u1EBE\u1EC0\u1EC2\u1EC4\u1EC6\u1EC8\u1ECA\u1ECC\u1ECE\u1ED0\u1ED2\u1ED4\u1ED6\u1ED8\u1EDA\u1EDC\u1EDE\u1EE0\u1EE2\u1EE4\u1EE6\u1EE8\u1EEA\u1EEC\u1EEE\u1EF0\u1EF2\u1EF4\u1EF6\u1EF8\u1EFA\u1EFC\u1EFE\u1F08-\u1F0F\u1F18-\u1F1D\u1F28-\u1F2F\u1F38-\u1F3F\u1F48-\u1F4D\u1F59\u1F5B\u1F5D\u1F5F\u1F68-\u1F6F\u1FB8-\u1FBB\u1FC8-\u1FCB\u1FD8-\u1FDB\u1FE8-\u1FEC\u1FF8-\u1FFB\u2102\u2107\u210B-\u210D\u2110-\u2112\u2115\u2119-\u211D\u2124\u2126\u2128\u212A-\u212D\u2130-\u2133\u213E\u213F\u2145\u2160-\u216F\u2183\u24B6-\u24CF\u2C00-\u2C2E\u2C60\u2C62-\u2C64\u2C67\u2C69\u2C6B\u2C6D-\u2C70\u2C72\u2C75\u2C7E-\u2C80\u2C82\u2C84\u2C86\u2C88\u2C8A\u2C8C\u2C8E\u2C90\u2C92\u2C94\u2C96\u2C98\u2C9A\u2C9C\u2C9E\u2CA0\u2CA2\u2CA4\u2CA6\u2CA8\u2CAA\u2CAC\u2CAE\u2CB0\u2CB2\u2CB4\u2CB6\u2CB8\u2CBA\u2CBC\u2CBE\u2CC0\u2CC2\u2CC4\u2CC6\u2CC8\u2CCA\u2CCC\u2CCE\u2CD0\u2CD2\u2CD4\u2CD6\u2CD8\u2CDA\u2CDC\u2CDE\u2CE0\u2CE2\u2CEB\u2CED\u2CF2\uA640\uA642\uA644\uA646\uA648\uA64A\uA64C\uA64E\uA650\uA652\uA654\uA656\uA658\uA65A\uA65C\uA65E\uA660\uA662\uA664\uA666\uA668\uA66A\uA66C\uA680\uA682\uA684\uA686\uA688\uA68A\uA68C\uA68E\uA690\uA692\uA694\uA696\uA698\uA69A\uA722\uA724\uA726\uA728\uA72A\uA72C\uA72E\uA732\uA734\uA736\uA738\uA73A\uA73C\uA73E\uA740\uA742\uA744\uA746\uA748\uA74A\uA74C\uA74E\uA750\uA752\uA754\uA756\uA758\uA75A\uA75C\uA75E\uA760\uA762\uA764\uA766\uA768\uA76A\uA76C\uA76E\uA779\uA77B\uA77D\uA77E\uA780\uA782\uA784\uA786\uA78B\uA78D\uA790\uA792\uA796\uA798\uA79A\uA79C\uA79E\uA7A0\uA7A2\uA7A4\uA7A6\uA7A8\uA7AA-\uA7AE\uA7B0-\uA7B4\uA7B6\uA7B8\uFF21-\uFF3A', + 'astral': '\uD801[\uDC00-\uDC27\uDCB0-\uDCD3]|\uD803[\uDC80-\uDCB2]|\uD806[\uDCA0-\uDCBF]|\uD81B[\uDE40-\uDE5F]|\uD835[\uDC00-\uDC19\uDC34-\uDC4D\uDC68-\uDC81\uDC9C\uDC9E\uDC9F\uDCA2\uDCA5\uDCA6\uDCA9-\uDCAC\uDCAE-\uDCB5\uDCD0-\uDCE9\uDD04\uDD05\uDD07-\uDD0A\uDD0D-\uDD14\uDD16-\uDD1C\uDD38\uDD39\uDD3B-\uDD3E\uDD40-\uDD44\uDD46\uDD4A-\uDD50\uDD6C-\uDD85\uDDA0-\uDDB9\uDDD4-\uDDED\uDE08-\uDE21\uDE3C-\uDE55\uDE70-\uDE89\uDEA8-\uDEC0\uDEE2-\uDEFA\uDF1C-\uDF34\uDF56-\uDF6E\uDF90-\uDFA8\uDFCA]|\uD83A[\uDD00-\uDD21]|\uD83C[\uDD30-\uDD49\uDD50-\uDD69\uDD70-\uDD89]' + }, + { + 'name': 'White_Space', + 'bmp': '\t-\r \x85\xA0\u1680\u2000-\u200A\u2028\u2029\u202F\u205F\u3000' + } +]; + +var unicodeProperties = createCommonjsModule(function (module, exports) { +"use strict"; + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.default = void 0; + +var _properties = _interopRequireDefault(properties); + +function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } + +/*! + * XRegExp Unicode Properties 4.2.0 + * + * Steven Levithan (c) 2012-present MIT License + * Unicode data by Mathias Bynens + */ +var _default = function _default(XRegExp) { + /** + * Adds properties to meet the UTS #18 Level 1 RL1.2 requirements for Unicode regex support. See + * . Following are definitions of these properties from + * UAX #44 : + * + * - Alphabetic + * Characters with the Alphabetic property. Generated from: Lowercase + Uppercase + Lt + Lm + + * Lo + Nl + Other_Alphabetic. + * + * - Default_Ignorable_Code_Point + * For programmatic determination of default ignorable code points. New characters that should + * be ignored in rendering (unless explicitly supported) will be assigned in these ranges, + * permitting programs to correctly handle the default rendering of such characters when not + * otherwise supported. + * + * - Lowercase + * Characters with the Lowercase property. Generated from: Ll + Other_Lowercase. + * + * - Noncharacter_Code_Point + * Code points permanently reserved for internal use. + * + * - Uppercase + * Characters with the Uppercase property. Generated from: Lu + Other_Uppercase. + * + * - White_Space + * Spaces, separator characters and other control characters which should be treated by + * programming languages as "white space" for the purpose of parsing elements. + * + * The properties ASCII, Any, and Assigned are also included but are not defined in UAX #44. UTS + * #18 RL1.2 additionally requires support for Unicode scripts and general categories. These are + * included in XRegExp's Unicode Categories and Unicode Scripts addons. + * + * Token names are case insensitive, and any spaces, hyphens, and underscores are ignored. + * + * Uses Unicode 11.0.0. + * + * @requires XRegExp, Unicode Base + */ + if (!XRegExp.addUnicodeData) { + throw new ReferenceError('Unicode Base must be loaded before Unicode Properties'); + } + + var unicodeData = _properties.default; // Add non-generated data + + unicodeData.push({ + name: 'Assigned', + // Since this is defined as the inverse of Unicode category Cn (Unassigned), the Unicode + // Categories addon is required to use this property + inverseOf: 'Cn' + }); + XRegExp.addUnicodeData(unicodeData); +}; + +exports.default = _default; +module.exports = exports["default"]; +}); + +unwrapExports(unicodeProperties); + +var scripts = [ + { + 'name': 'Adlam', + 'astral': '\uD83A[\uDD00-\uDD4A\uDD50-\uDD59\uDD5E\uDD5F]' + }, + { + 'name': 'Ahom', + 'astral': '\uD805[\uDF00-\uDF1A\uDF1D-\uDF2B\uDF30-\uDF3F]' + }, + { + 'name': 'Anatolian_Hieroglyphs', + 'astral': '\uD811[\uDC00-\uDE46]' + }, + { + 'name': 'Arabic', + 'bmp': '\u0600-\u0604\u0606-\u060B\u060D-\u061A\u061C\u061E\u0620-\u063F\u0641-\u064A\u0656-\u066F\u0671-\u06DC\u06DE-\u06FF\u0750-\u077F\u08A0-\u08B4\u08B6-\u08BD\u08D3-\u08E1\u08E3-\u08FF\uFB50-\uFBC1\uFBD3-\uFD3D\uFD50-\uFD8F\uFD92-\uFDC7\uFDF0-\uFDFD\uFE70-\uFE74\uFE76-\uFEFC', + 'astral': '\uD803[\uDE60-\uDE7E]|\uD83B[\uDE00-\uDE03\uDE05-\uDE1F\uDE21\uDE22\uDE24\uDE27\uDE29-\uDE32\uDE34-\uDE37\uDE39\uDE3B\uDE42\uDE47\uDE49\uDE4B\uDE4D-\uDE4F\uDE51\uDE52\uDE54\uDE57\uDE59\uDE5B\uDE5D\uDE5F\uDE61\uDE62\uDE64\uDE67-\uDE6A\uDE6C-\uDE72\uDE74-\uDE77\uDE79-\uDE7C\uDE7E\uDE80-\uDE89\uDE8B-\uDE9B\uDEA1-\uDEA3\uDEA5-\uDEA9\uDEAB-\uDEBB\uDEF0\uDEF1]' + }, + { + 'name': 'Armenian', + 'bmp': '\u0531-\u0556\u0559-\u0588\u058A\u058D-\u058F\uFB13-\uFB17' + }, + { + 'name': 'Avestan', + 'astral': '\uD802[\uDF00-\uDF35\uDF39-\uDF3F]' + }, + { + 'name': 'Balinese', + 'bmp': '\u1B00-\u1B4B\u1B50-\u1B7C' + }, + { + 'name': 'Bamum', + 'bmp': '\uA6A0-\uA6F7', + 'astral': '\uD81A[\uDC00-\uDE38]' + }, + { + 'name': 'Bassa_Vah', + 'astral': '\uD81A[\uDED0-\uDEED\uDEF0-\uDEF5]' + }, + { + 'name': 'Batak', + 'bmp': '\u1BC0-\u1BF3\u1BFC-\u1BFF' + }, + { + 'name': 'Bengali', + 'bmp': '\u0980-\u0983\u0985-\u098C\u098F\u0990\u0993-\u09A8\u09AA-\u09B0\u09B2\u09B6-\u09B9\u09BC-\u09C4\u09C7\u09C8\u09CB-\u09CE\u09D7\u09DC\u09DD\u09DF-\u09E3\u09E6-\u09FE' + }, + { + 'name': 'Bhaiksuki', + 'astral': '\uD807[\uDC00-\uDC08\uDC0A-\uDC36\uDC38-\uDC45\uDC50-\uDC6C]' + }, + { + 'name': 'Bopomofo', + 'bmp': '\u02EA\u02EB\u3105-\u312F\u31A0-\u31BA' + }, + { + 'name': 'Brahmi', + 'astral': '\uD804[\uDC00-\uDC4D\uDC52-\uDC6F\uDC7F]' + }, + { + 'name': 'Braille', + 'bmp': '\u2800-\u28FF' + }, + { + 'name': 'Buginese', + 'bmp': '\u1A00-\u1A1B\u1A1E\u1A1F' + }, + { + 'name': 'Buhid', + 'bmp': '\u1740-\u1753' + }, + { + 'name': 'Canadian_Aboriginal', + 'bmp': '\u1400-\u167F\u18B0-\u18F5' + }, + { + 'name': 'Carian', + 'astral': '\uD800[\uDEA0-\uDED0]' + }, + { + 'name': 'Caucasian_Albanian', + 'astral': '\uD801[\uDD30-\uDD63\uDD6F]' + }, + { + 'name': 'Chakma', + 'astral': '\uD804[\uDD00-\uDD34\uDD36-\uDD46]' + }, + { + 'name': 'Cham', + 'bmp': '\uAA00-\uAA36\uAA40-\uAA4D\uAA50-\uAA59\uAA5C-\uAA5F' + }, + { + 'name': 'Cherokee', + 'bmp': '\u13A0-\u13F5\u13F8-\u13FD\uAB70-\uABBF' + }, + { + 'name': 'Common', + 'bmp': '\0-@\\[-`\\{-\xA9\xAB-\xB9\xBB-\xBF\xD7\xF7\u02B9-\u02DF\u02E5-\u02E9\u02EC-\u02FF\u0374\u037E\u0385\u0387\u0589\u0605\u060C\u061B\u061F\u0640\u06DD\u08E2\u0964\u0965\u0E3F\u0FD5-\u0FD8\u10FB\u16EB-\u16ED\u1735\u1736\u1802\u1803\u1805\u1CD3\u1CE1\u1CE9-\u1CEC\u1CEE-\u1CF3\u1CF5-\u1CF7\u2000-\u200B\u200E-\u2064\u2066-\u2070\u2074-\u207E\u2080-\u208E\u20A0-\u20BF\u2100-\u2125\u2127-\u2129\u212C-\u2131\u2133-\u214D\u214F-\u215F\u2189-\u218B\u2190-\u2426\u2440-\u244A\u2460-\u27FF\u2900-\u2B73\u2B76-\u2B95\u2B98-\u2BC8\u2BCA-\u2BFE\u2E00-\u2E4E\u2FF0-\u2FFB\u3000-\u3004\u3006\u3008-\u3020\u3030-\u3037\u303C-\u303F\u309B\u309C\u30A0\u30FB\u30FC\u3190-\u319F\u31C0-\u31E3\u3220-\u325F\u327F-\u32CF\u3358-\u33FF\u4DC0-\u4DFF\uA700-\uA721\uA788-\uA78A\uA830-\uA839\uA92E\uA9CF\uAB5B\uFD3E\uFD3F\uFE10-\uFE19\uFE30-\uFE52\uFE54-\uFE66\uFE68-\uFE6B\uFEFF\uFF01-\uFF20\uFF3B-\uFF40\uFF5B-\uFF65\uFF70\uFF9E\uFF9F\uFFE0-\uFFE6\uFFE8-\uFFEE\uFFF9-\uFFFD', + 'astral': '\uD800[\uDD00-\uDD02\uDD07-\uDD33\uDD37-\uDD3F\uDD90-\uDD9B\uDDD0-\uDDFC\uDEE1-\uDEFB]|\uD82F[\uDCA0-\uDCA3]|\uD834[\uDC00-\uDCF5\uDD00-\uDD26\uDD29-\uDD66\uDD6A-\uDD7A\uDD83\uDD84\uDD8C-\uDDA9\uDDAE-\uDDE8\uDEE0-\uDEF3\uDF00-\uDF56\uDF60-\uDF78]|\uD835[\uDC00-\uDC54\uDC56-\uDC9C\uDC9E\uDC9F\uDCA2\uDCA5\uDCA6\uDCA9-\uDCAC\uDCAE-\uDCB9\uDCBB\uDCBD-\uDCC3\uDCC5-\uDD05\uDD07-\uDD0A\uDD0D-\uDD14\uDD16-\uDD1C\uDD1E-\uDD39\uDD3B-\uDD3E\uDD40-\uDD44\uDD46\uDD4A-\uDD50\uDD52-\uDEA5\uDEA8-\uDFCB\uDFCE-\uDFFF]|\uD83B[\uDC71-\uDCB4]|\uD83C[\uDC00-\uDC2B\uDC30-\uDC93\uDCA0-\uDCAE\uDCB1-\uDCBF\uDCC1-\uDCCF\uDCD1-\uDCF5\uDD00-\uDD0C\uDD10-\uDD6B\uDD70-\uDDAC\uDDE6-\uDDFF\uDE01\uDE02\uDE10-\uDE3B\uDE40-\uDE48\uDE50\uDE51\uDE60-\uDE65\uDF00-\uDFFF]|\uD83D[\uDC00-\uDED4\uDEE0-\uDEEC\uDEF0-\uDEF9\uDF00-\uDF73\uDF80-\uDFD8]|\uD83E[\uDC00-\uDC0B\uDC10-\uDC47\uDC50-\uDC59\uDC60-\uDC87\uDC90-\uDCAD\uDD00-\uDD0B\uDD10-\uDD3E\uDD40-\uDD70\uDD73-\uDD76\uDD7A\uDD7C-\uDDA2\uDDB0-\uDDB9\uDDC0-\uDDC2\uDDD0-\uDDFF\uDE60-\uDE6D]|\uDB40[\uDC01\uDC20-\uDC7F]' + }, + { + 'name': 'Coptic', + 'bmp': '\u03E2-\u03EF\u2C80-\u2CF3\u2CF9-\u2CFF' + }, + { + 'name': 'Cuneiform', + 'astral': '\uD808[\uDC00-\uDF99]|\uD809[\uDC00-\uDC6E\uDC70-\uDC74\uDC80-\uDD43]' + }, + { + 'name': 'Cypriot', + 'astral': '\uD802[\uDC00-\uDC05\uDC08\uDC0A-\uDC35\uDC37\uDC38\uDC3C\uDC3F]' + }, + { + 'name': 'Cyrillic', + 'bmp': '\u0400-\u0484\u0487-\u052F\u1C80-\u1C88\u1D2B\u1D78\u2DE0-\u2DFF\uA640-\uA69F\uFE2E\uFE2F' + }, + { + 'name': 'Deseret', + 'astral': '\uD801[\uDC00-\uDC4F]' + }, + { + 'name': 'Devanagari', + 'bmp': '\u0900-\u0950\u0953-\u0963\u0966-\u097F\uA8E0-\uA8FF' + }, + { + 'name': 'Dogra', + 'astral': '\uD806[\uDC00-\uDC3B]' + }, + { + 'name': 'Duployan', + 'astral': '\uD82F[\uDC00-\uDC6A\uDC70-\uDC7C\uDC80-\uDC88\uDC90-\uDC99\uDC9C-\uDC9F]' + }, + { + 'name': 'Egyptian_Hieroglyphs', + 'astral': '\uD80C[\uDC00-\uDFFF]|\uD80D[\uDC00-\uDC2E]' + }, + { + 'name': 'Elbasan', + 'astral': '\uD801[\uDD00-\uDD27]' + }, + { + 'name': 'Ethiopic', + 'bmp': '\u1200-\u1248\u124A-\u124D\u1250-\u1256\u1258\u125A-\u125D\u1260-\u1288\u128A-\u128D\u1290-\u12B0\u12B2-\u12B5\u12B8-\u12BE\u12C0\u12C2-\u12C5\u12C8-\u12D6\u12D8-\u1310\u1312-\u1315\u1318-\u135A\u135D-\u137C\u1380-\u1399\u2D80-\u2D96\u2DA0-\u2DA6\u2DA8-\u2DAE\u2DB0-\u2DB6\u2DB8-\u2DBE\u2DC0-\u2DC6\u2DC8-\u2DCE\u2DD0-\u2DD6\u2DD8-\u2DDE\uAB01-\uAB06\uAB09-\uAB0E\uAB11-\uAB16\uAB20-\uAB26\uAB28-\uAB2E' + }, + { + 'name': 'Georgian', + 'bmp': '\u10A0-\u10C5\u10C7\u10CD\u10D0-\u10FA\u10FC-\u10FF\u1C90-\u1CBA\u1CBD-\u1CBF\u2D00-\u2D25\u2D27\u2D2D' + }, + { + 'name': 'Glagolitic', + 'bmp': '\u2C00-\u2C2E\u2C30-\u2C5E', + 'astral': '\uD838[\uDC00-\uDC06\uDC08-\uDC18\uDC1B-\uDC21\uDC23\uDC24\uDC26-\uDC2A]' + }, + { + 'name': 'Gothic', + 'astral': '\uD800[\uDF30-\uDF4A]' + }, + { + 'name': 'Grantha', + 'astral': '\uD804[\uDF00-\uDF03\uDF05-\uDF0C\uDF0F\uDF10\uDF13-\uDF28\uDF2A-\uDF30\uDF32\uDF33\uDF35-\uDF39\uDF3C-\uDF44\uDF47\uDF48\uDF4B-\uDF4D\uDF50\uDF57\uDF5D-\uDF63\uDF66-\uDF6C\uDF70-\uDF74]' + }, + { + 'name': 'Greek', + 'bmp': '\u0370-\u0373\u0375-\u0377\u037A-\u037D\u037F\u0384\u0386\u0388-\u038A\u038C\u038E-\u03A1\u03A3-\u03E1\u03F0-\u03FF\u1D26-\u1D2A\u1D5D-\u1D61\u1D66-\u1D6A\u1DBF\u1F00-\u1F15\u1F18-\u1F1D\u1F20-\u1F45\u1F48-\u1F4D\u1F50-\u1F57\u1F59\u1F5B\u1F5D\u1F5F-\u1F7D\u1F80-\u1FB4\u1FB6-\u1FC4\u1FC6-\u1FD3\u1FD6-\u1FDB\u1FDD-\u1FEF\u1FF2-\u1FF4\u1FF6-\u1FFE\u2126\uAB65', + 'astral': '\uD800[\uDD40-\uDD8E\uDDA0]|\uD834[\uDE00-\uDE45]' + }, + { + 'name': 'Gujarati', + 'bmp': '\u0A81-\u0A83\u0A85-\u0A8D\u0A8F-\u0A91\u0A93-\u0AA8\u0AAA-\u0AB0\u0AB2\u0AB3\u0AB5-\u0AB9\u0ABC-\u0AC5\u0AC7-\u0AC9\u0ACB-\u0ACD\u0AD0\u0AE0-\u0AE3\u0AE6-\u0AF1\u0AF9-\u0AFF' + }, + { + 'name': 'Gunjala_Gondi', + 'astral': '\uD807[\uDD60-\uDD65\uDD67\uDD68\uDD6A-\uDD8E\uDD90\uDD91\uDD93-\uDD98\uDDA0-\uDDA9]' + }, + { + 'name': 'Gurmukhi', + 'bmp': '\u0A01-\u0A03\u0A05-\u0A0A\u0A0F\u0A10\u0A13-\u0A28\u0A2A-\u0A30\u0A32\u0A33\u0A35\u0A36\u0A38\u0A39\u0A3C\u0A3E-\u0A42\u0A47\u0A48\u0A4B-\u0A4D\u0A51\u0A59-\u0A5C\u0A5E\u0A66-\u0A76' + }, + { + 'name': 'Han', + 'bmp': '\u2E80-\u2E99\u2E9B-\u2EF3\u2F00-\u2FD5\u3005\u3007\u3021-\u3029\u3038-\u303B\u3400-\u4DB5\u4E00-\u9FEF\uF900-\uFA6D\uFA70-\uFAD9', + 'astral': '[\uD840-\uD868\uD86A-\uD86C\uD86F-\uD872\uD874-\uD879][\uDC00-\uDFFF]|\uD869[\uDC00-\uDED6\uDF00-\uDFFF]|\uD86D[\uDC00-\uDF34\uDF40-\uDFFF]|\uD86E[\uDC00-\uDC1D\uDC20-\uDFFF]|\uD873[\uDC00-\uDEA1\uDEB0-\uDFFF]|\uD87A[\uDC00-\uDFE0]|\uD87E[\uDC00-\uDE1D]' + }, + { + 'name': 'Hangul', + 'bmp': '\u1100-\u11FF\u302E\u302F\u3131-\u318E\u3200-\u321E\u3260-\u327E\uA960-\uA97C\uAC00-\uD7A3\uD7B0-\uD7C6\uD7CB-\uD7FB\uFFA0-\uFFBE\uFFC2-\uFFC7\uFFCA-\uFFCF\uFFD2-\uFFD7\uFFDA-\uFFDC' + }, + { + 'name': 'Hanifi_Rohingya', + 'astral': '\uD803[\uDD00-\uDD27\uDD30-\uDD39]' + }, + { + 'name': 'Hanunoo', + 'bmp': '\u1720-\u1734' + }, + { + 'name': 'Hatran', + 'astral': '\uD802[\uDCE0-\uDCF2\uDCF4\uDCF5\uDCFB-\uDCFF]' + }, + { + 'name': 'Hebrew', + 'bmp': '\u0591-\u05C7\u05D0-\u05EA\u05EF-\u05F4\uFB1D-\uFB36\uFB38-\uFB3C\uFB3E\uFB40\uFB41\uFB43\uFB44\uFB46-\uFB4F' + }, + { + 'name': 'Hiragana', + 'bmp': '\u3041-\u3096\u309D-\u309F', + 'astral': '\uD82C[\uDC01-\uDD1E]|\uD83C\uDE00' + }, + { + 'name': 'Imperial_Aramaic', + 'astral': '\uD802[\uDC40-\uDC55\uDC57-\uDC5F]' + }, + { + 'name': 'Inherited', + 'bmp': '\u0300-\u036F\u0485\u0486\u064B-\u0655\u0670\u0951\u0952\u1AB0-\u1ABE\u1CD0-\u1CD2\u1CD4-\u1CE0\u1CE2-\u1CE8\u1CED\u1CF4\u1CF8\u1CF9\u1DC0-\u1DF9\u1DFB-\u1DFF\u200C\u200D\u20D0-\u20F0\u302A-\u302D\u3099\u309A\uFE00-\uFE0F\uFE20-\uFE2D', + 'astral': '\uD800[\uDDFD\uDEE0]|\uD804\uDF3B|\uD834[\uDD67-\uDD69\uDD7B-\uDD82\uDD85-\uDD8B\uDDAA-\uDDAD]|\uDB40[\uDD00-\uDDEF]' + }, + { + 'name': 'Inscriptional_Pahlavi', + 'astral': '\uD802[\uDF60-\uDF72\uDF78-\uDF7F]' + }, + { + 'name': 'Inscriptional_Parthian', + 'astral': '\uD802[\uDF40-\uDF55\uDF58-\uDF5F]' + }, + { + 'name': 'Javanese', + 'bmp': '\uA980-\uA9CD\uA9D0-\uA9D9\uA9DE\uA9DF' + }, + { + 'name': 'Kaithi', + 'astral': '\uD804[\uDC80-\uDCC1\uDCCD]' + }, + { + 'name': 'Kannada', + 'bmp': '\u0C80-\u0C8C\u0C8E-\u0C90\u0C92-\u0CA8\u0CAA-\u0CB3\u0CB5-\u0CB9\u0CBC-\u0CC4\u0CC6-\u0CC8\u0CCA-\u0CCD\u0CD5\u0CD6\u0CDE\u0CE0-\u0CE3\u0CE6-\u0CEF\u0CF1\u0CF2' + }, + { + 'name': 'Katakana', + 'bmp': '\u30A1-\u30FA\u30FD-\u30FF\u31F0-\u31FF\u32D0-\u32FE\u3300-\u3357\uFF66-\uFF6F\uFF71-\uFF9D', + 'astral': '\uD82C\uDC00' + }, + { + 'name': 'Kayah_Li', + 'bmp': '\uA900-\uA92D\uA92F' + }, + { + 'name': 'Kharoshthi', + 'astral': '\uD802[\uDE00-\uDE03\uDE05\uDE06\uDE0C-\uDE13\uDE15-\uDE17\uDE19-\uDE35\uDE38-\uDE3A\uDE3F-\uDE48\uDE50-\uDE58]' + }, + { + 'name': 'Khmer', + 'bmp': '\u1780-\u17DD\u17E0-\u17E9\u17F0-\u17F9\u19E0-\u19FF' + }, + { + 'name': 'Khojki', + 'astral': '\uD804[\uDE00-\uDE11\uDE13-\uDE3E]' + }, + { + 'name': 'Khudawadi', + 'astral': '\uD804[\uDEB0-\uDEEA\uDEF0-\uDEF9]' + }, + { + 'name': 'Lao', + 'bmp': '\u0E81\u0E82\u0E84\u0E87\u0E88\u0E8A\u0E8D\u0E94-\u0E97\u0E99-\u0E9F\u0EA1-\u0EA3\u0EA5\u0EA7\u0EAA\u0EAB\u0EAD-\u0EB9\u0EBB-\u0EBD\u0EC0-\u0EC4\u0EC6\u0EC8-\u0ECD\u0ED0-\u0ED9\u0EDC-\u0EDF' + }, + { + 'name': 'Latin', + 'bmp': 'A-Za-z\xAA\xBA\xC0-\xD6\xD8-\xF6\xF8-\u02B8\u02E0-\u02E4\u1D00-\u1D25\u1D2C-\u1D5C\u1D62-\u1D65\u1D6B-\u1D77\u1D79-\u1DBE\u1E00-\u1EFF\u2071\u207F\u2090-\u209C\u212A\u212B\u2132\u214E\u2160-\u2188\u2C60-\u2C7F\uA722-\uA787\uA78B-\uA7B9\uA7F7-\uA7FF\uAB30-\uAB5A\uAB5C-\uAB64\uFB00-\uFB06\uFF21-\uFF3A\uFF41-\uFF5A' + }, + { + 'name': 'Lepcha', + 'bmp': '\u1C00-\u1C37\u1C3B-\u1C49\u1C4D-\u1C4F' + }, + { + 'name': 'Limbu', + 'bmp': '\u1900-\u191E\u1920-\u192B\u1930-\u193B\u1940\u1944-\u194F' + }, + { + 'name': 'Linear_A', + 'astral': '\uD801[\uDE00-\uDF36\uDF40-\uDF55\uDF60-\uDF67]' + }, + { + 'name': 'Linear_B', + 'astral': '\uD800[\uDC00-\uDC0B\uDC0D-\uDC26\uDC28-\uDC3A\uDC3C\uDC3D\uDC3F-\uDC4D\uDC50-\uDC5D\uDC80-\uDCFA]' + }, + { + 'name': 'Lisu', + 'bmp': '\uA4D0-\uA4FF' + }, + { + 'name': 'Lycian', + 'astral': '\uD800[\uDE80-\uDE9C]' + }, + { + 'name': 'Lydian', + 'astral': '\uD802[\uDD20-\uDD39\uDD3F]' + }, + { + 'name': 'Mahajani', + 'astral': '\uD804[\uDD50-\uDD76]' + }, + { + 'name': 'Makasar', + 'astral': '\uD807[\uDEE0-\uDEF8]' + }, + { + 'name': 'Malayalam', + 'bmp': '\u0D00-\u0D03\u0D05-\u0D0C\u0D0E-\u0D10\u0D12-\u0D44\u0D46-\u0D48\u0D4A-\u0D4F\u0D54-\u0D63\u0D66-\u0D7F' + }, + { + 'name': 'Mandaic', + 'bmp': '\u0840-\u085B\u085E' + }, + { + 'name': 'Manichaean', + 'astral': '\uD802[\uDEC0-\uDEE6\uDEEB-\uDEF6]' + }, + { + 'name': 'Marchen', + 'astral': '\uD807[\uDC70-\uDC8F\uDC92-\uDCA7\uDCA9-\uDCB6]' + }, + { + 'name': 'Masaram_Gondi', + 'astral': '\uD807[\uDD00-\uDD06\uDD08\uDD09\uDD0B-\uDD36\uDD3A\uDD3C\uDD3D\uDD3F-\uDD47\uDD50-\uDD59]' + }, + { + 'name': 'Medefaidrin', + 'astral': '\uD81B[\uDE40-\uDE9A]' + }, + { + 'name': 'Meetei_Mayek', + 'bmp': '\uAAE0-\uAAF6\uABC0-\uABED\uABF0-\uABF9' + }, + { + 'name': 'Mende_Kikakui', + 'astral': '\uD83A[\uDC00-\uDCC4\uDCC7-\uDCD6]' + }, + { + 'name': 'Meroitic_Cursive', + 'astral': '\uD802[\uDDA0-\uDDB7\uDDBC-\uDDCF\uDDD2-\uDDFF]' + }, + { + 'name': 'Meroitic_Hieroglyphs', + 'astral': '\uD802[\uDD80-\uDD9F]' + }, + { + 'name': 'Miao', + 'astral': '\uD81B[\uDF00-\uDF44\uDF50-\uDF7E\uDF8F-\uDF9F]' + }, + { + 'name': 'Modi', + 'astral': '\uD805[\uDE00-\uDE44\uDE50-\uDE59]' + }, + { + 'name': 'Mongolian', + 'bmp': '\u1800\u1801\u1804\u1806-\u180E\u1810-\u1819\u1820-\u1878\u1880-\u18AA', + 'astral': '\uD805[\uDE60-\uDE6C]' + }, + { + 'name': 'Mro', + 'astral': '\uD81A[\uDE40-\uDE5E\uDE60-\uDE69\uDE6E\uDE6F]' + }, + { + 'name': 'Multani', + 'astral': '\uD804[\uDE80-\uDE86\uDE88\uDE8A-\uDE8D\uDE8F-\uDE9D\uDE9F-\uDEA9]' + }, + { + 'name': 'Myanmar', + 'bmp': '\u1000-\u109F\uA9E0-\uA9FE\uAA60-\uAA7F' + }, + { + 'name': 'Nabataean', + 'astral': '\uD802[\uDC80-\uDC9E\uDCA7-\uDCAF]' + }, + { + 'name': 'New_Tai_Lue', + 'bmp': '\u1980-\u19AB\u19B0-\u19C9\u19D0-\u19DA\u19DE\u19DF' + }, + { + 'name': 'Newa', + 'astral': '\uD805[\uDC00-\uDC59\uDC5B\uDC5D\uDC5E]' + }, + { + 'name': 'Nko', + 'bmp': '\u07C0-\u07FA\u07FD-\u07FF' + }, + { + 'name': 'Nushu', + 'astral': '\uD81B\uDFE1|\uD82C[\uDD70-\uDEFB]' + }, + { + 'name': 'Ogham', + 'bmp': '\u1680-\u169C' + }, + { + 'name': 'Ol_Chiki', + 'bmp': '\u1C50-\u1C7F' + }, + { + 'name': 'Old_Hungarian', + 'astral': '\uD803[\uDC80-\uDCB2\uDCC0-\uDCF2\uDCFA-\uDCFF]' + }, + { + 'name': 'Old_Italic', + 'astral': '\uD800[\uDF00-\uDF23\uDF2D-\uDF2F]' + }, + { + 'name': 'Old_North_Arabian', + 'astral': '\uD802[\uDE80-\uDE9F]' + }, + { + 'name': 'Old_Permic', + 'astral': '\uD800[\uDF50-\uDF7A]' + }, + { + 'name': 'Old_Persian', + 'astral': '\uD800[\uDFA0-\uDFC3\uDFC8-\uDFD5]' + }, + { + 'name': 'Old_Sogdian', + 'astral': '\uD803[\uDF00-\uDF27]' + }, + { + 'name': 'Old_South_Arabian', + 'astral': '\uD802[\uDE60-\uDE7F]' + }, + { + 'name': 'Old_Turkic', + 'astral': '\uD803[\uDC00-\uDC48]' + }, + { + 'name': 'Oriya', + 'bmp': '\u0B01-\u0B03\u0B05-\u0B0C\u0B0F\u0B10\u0B13-\u0B28\u0B2A-\u0B30\u0B32\u0B33\u0B35-\u0B39\u0B3C-\u0B44\u0B47\u0B48\u0B4B-\u0B4D\u0B56\u0B57\u0B5C\u0B5D\u0B5F-\u0B63\u0B66-\u0B77' + }, + { + 'name': 'Osage', + 'astral': '\uD801[\uDCB0-\uDCD3\uDCD8-\uDCFB]' + }, + { + 'name': 'Osmanya', + 'astral': '\uD801[\uDC80-\uDC9D\uDCA0-\uDCA9]' + }, + { + 'name': 'Pahawh_Hmong', + 'astral': '\uD81A[\uDF00-\uDF45\uDF50-\uDF59\uDF5B-\uDF61\uDF63-\uDF77\uDF7D-\uDF8F]' + }, + { + 'name': 'Palmyrene', + 'astral': '\uD802[\uDC60-\uDC7F]' + }, + { + 'name': 'Pau_Cin_Hau', + 'astral': '\uD806[\uDEC0-\uDEF8]' + }, + { + 'name': 'Phags_Pa', + 'bmp': '\uA840-\uA877' + }, + { + 'name': 'Phoenician', + 'astral': '\uD802[\uDD00-\uDD1B\uDD1F]' + }, + { + 'name': 'Psalter_Pahlavi', + 'astral': '\uD802[\uDF80-\uDF91\uDF99-\uDF9C\uDFA9-\uDFAF]' + }, + { + 'name': 'Rejang', + 'bmp': '\uA930-\uA953\uA95F' + }, + { + 'name': 'Runic', + 'bmp': '\u16A0-\u16EA\u16EE-\u16F8' + }, + { + 'name': 'Samaritan', + 'bmp': '\u0800-\u082D\u0830-\u083E' + }, + { + 'name': 'Saurashtra', + 'bmp': '\uA880-\uA8C5\uA8CE-\uA8D9' + }, + { + 'name': 'Sharada', + 'astral': '\uD804[\uDD80-\uDDCD\uDDD0-\uDDDF]' + }, + { + 'name': 'Shavian', + 'astral': '\uD801[\uDC50-\uDC7F]' + }, + { + 'name': 'Siddham', + 'astral': '\uD805[\uDD80-\uDDB5\uDDB8-\uDDDD]' + }, + { + 'name': 'SignWriting', + 'astral': '\uD836[\uDC00-\uDE8B\uDE9B-\uDE9F\uDEA1-\uDEAF]' + }, + { + 'name': 'Sinhala', + 'bmp': '\u0D82\u0D83\u0D85-\u0D96\u0D9A-\u0DB1\u0DB3-\u0DBB\u0DBD\u0DC0-\u0DC6\u0DCA\u0DCF-\u0DD4\u0DD6\u0DD8-\u0DDF\u0DE6-\u0DEF\u0DF2-\u0DF4', + 'astral': '\uD804[\uDDE1-\uDDF4]' + }, + { + 'name': 'Sogdian', + 'astral': '\uD803[\uDF30-\uDF59]' + }, + { + 'name': 'Sora_Sompeng', + 'astral': '\uD804[\uDCD0-\uDCE8\uDCF0-\uDCF9]' + }, + { + 'name': 'Soyombo', + 'astral': '\uD806[\uDE50-\uDE83\uDE86-\uDEA2]' + }, + { + 'name': 'Sundanese', + 'bmp': '\u1B80-\u1BBF\u1CC0-\u1CC7' + }, + { + 'name': 'Syloti_Nagri', + 'bmp': '\uA800-\uA82B' + }, + { + 'name': 'Syriac', + 'bmp': '\u0700-\u070D\u070F-\u074A\u074D-\u074F\u0860-\u086A' + }, + { + 'name': 'Tagalog', + 'bmp': '\u1700-\u170C\u170E-\u1714' + }, + { + 'name': 'Tagbanwa', + 'bmp': '\u1760-\u176C\u176E-\u1770\u1772\u1773' + }, + { + 'name': 'Tai_Le', + 'bmp': '\u1950-\u196D\u1970-\u1974' + }, + { + 'name': 'Tai_Tham', + 'bmp': '\u1A20-\u1A5E\u1A60-\u1A7C\u1A7F-\u1A89\u1A90-\u1A99\u1AA0-\u1AAD' + }, + { + 'name': 'Tai_Viet', + 'bmp': '\uAA80-\uAAC2\uAADB-\uAADF' + }, + { + 'name': 'Takri', + 'astral': '\uD805[\uDE80-\uDEB7\uDEC0-\uDEC9]' + }, + { + 'name': 'Tamil', + 'bmp': '\u0B82\u0B83\u0B85-\u0B8A\u0B8E-\u0B90\u0B92-\u0B95\u0B99\u0B9A\u0B9C\u0B9E\u0B9F\u0BA3\u0BA4\u0BA8-\u0BAA\u0BAE-\u0BB9\u0BBE-\u0BC2\u0BC6-\u0BC8\u0BCA-\u0BCD\u0BD0\u0BD7\u0BE6-\u0BFA' + }, + { + 'name': 'Tangut', + 'astral': '\uD81B\uDFE0|[\uD81C-\uD820][\uDC00-\uDFFF]|\uD821[\uDC00-\uDFF1]|\uD822[\uDC00-\uDEF2]' + }, + { + 'name': 'Telugu', + 'bmp': '\u0C00-\u0C0C\u0C0E-\u0C10\u0C12-\u0C28\u0C2A-\u0C39\u0C3D-\u0C44\u0C46-\u0C48\u0C4A-\u0C4D\u0C55\u0C56\u0C58-\u0C5A\u0C60-\u0C63\u0C66-\u0C6F\u0C78-\u0C7F' + }, + { + 'name': 'Thaana', + 'bmp': '\u0780-\u07B1' + }, + { + 'name': 'Thai', + 'bmp': '\u0E01-\u0E3A\u0E40-\u0E5B' + }, + { + 'name': 'Tibetan', + 'bmp': '\u0F00-\u0F47\u0F49-\u0F6C\u0F71-\u0F97\u0F99-\u0FBC\u0FBE-\u0FCC\u0FCE-\u0FD4\u0FD9\u0FDA' + }, + { + 'name': 'Tifinagh', + 'bmp': '\u2D30-\u2D67\u2D6F\u2D70\u2D7F' + }, + { + 'name': 'Tirhuta', + 'astral': '\uD805[\uDC80-\uDCC7\uDCD0-\uDCD9]' + }, + { + 'name': 'Ugaritic', + 'astral': '\uD800[\uDF80-\uDF9D\uDF9F]' + }, + { + 'name': 'Vai', + 'bmp': '\uA500-\uA62B' + }, + { + 'name': 'Warang_Citi', + 'astral': '\uD806[\uDCA0-\uDCF2\uDCFF]' + }, + { + 'name': 'Yi', + 'bmp': '\uA000-\uA48C\uA490-\uA4C6' + }, + { + 'name': 'Zanabazar_Square', + 'astral': '\uD806[\uDE00-\uDE47]' + } +]; + +var unicodeScripts = createCommonjsModule(function (module, exports) { +"use strict"; + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.default = void 0; + +var _scripts = _interopRequireDefault(scripts); + +function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } + +/*! + * XRegExp Unicode Scripts 4.2.0 + * + * Steven Levithan (c) 2010-present MIT License + * Unicode data by Mathias Bynens + */ +var _default = function _default(XRegExp) { + /** + * Adds support for all Unicode scripts. E.g., `\p{Latin}`. Token names are case insensitive, + * and any spaces, hyphens, and underscores are ignored. + * + * Uses Unicode 11.0.0. + * + * @requires XRegExp, Unicode Base + */ + if (!XRegExp.addUnicodeData) { + throw new ReferenceError('Unicode Base must be loaded before Unicode Scripts'); + } + + XRegExp.addUnicodeData(_scripts.default); +}; + +exports.default = _default; +module.exports = exports["default"]; +}); + +unwrapExports(unicodeScripts); + +var lib = createCommonjsModule(function (module, exports) { +"use strict"; + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.default = void 0; + +var _xregexp = _interopRequireDefault(xregexp); + +var _build = _interopRequireDefault(build); + +var _matchrecursive = _interopRequireDefault(matchrecursive); + +var _unicodeBase = _interopRequireDefault(unicodeBase); + +var _unicodeBlocks = _interopRequireDefault(unicodeBlocks); + +var _unicodeCategories = _interopRequireDefault(unicodeCategories); + +var _unicodeProperties = _interopRequireDefault(unicodeProperties); + +var _unicodeScripts = _interopRequireDefault(unicodeScripts); + +function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } + +(_build.default)(_xregexp.default); +(_matchrecursive.default)(_xregexp.default); +(_unicodeBase.default)(_xregexp.default); +(_unicodeBlocks.default)(_xregexp.default); +(_unicodeCategories.default)(_xregexp.default); +(_unicodeProperties.default)(_xregexp.default); +(_unicodeScripts.default)(_xregexp.default); +var _default = _xregexp.default; +exports.default = _default; +module.exports = exports["default"]; +}); + +unwrapExports(lib); + +var utilities = createCommonjsModule(function (module, exports) { +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); + +class FormatUtility { + static preProcess(query, toLower = true) { + if (toLower) { + query = query.toLowerCase(); + } + return query + .replace(/0/g, "0") + .replace(/1/g, "1") + .replace(/2/g, "2") + .replace(/3/g, "3") + .replace(/4/g, "4") + .replace(/5/g, "5") + .replace(/6/g, "6") + .replace(/7/g, "7") + .replace(/8/g, "8") + .replace(/9/g, "9") + .replace(/:/g, ":") + .replace(/-/g, "-") + .replace(/,/g, ",") + .replace(///g, "/") + .replace(/G/g, "G") + .replace(/M/g, "M") + .replace(/T/g, "T") + .replace(/K/g, "K") + .replace(/k/g, "k") + .replace(/./g, ".") + .replace(/(/g, "(") + .replace(/)/g, ")"); + } +} +exports.FormatUtility = FormatUtility; +class Match { + constructor(index, length, value, groups) { + this.index = index; + this.length = length; + this.value = value; + this.innerGroups = groups; + } + groups(key) { + return this.innerGroups[key] ? this.innerGroups[key] : { value: '', index: 0, length: 0, captures: [] }; + } +} +exports.Match = Match; +class RegExpUtility { + static getMatches(regex, source) { + if (!regex) + return []; + let rawRegex = regex.xregexp.source; + if (!rawRegex.includes('(?= 0) { + closePos = this.getClosePos(rawRegex, startPos); + let nlbRegex = lib(rawRegex.substring(startPos, closePos + 1), flags); + let nextRegex = RegExpUtility.getNextRegex(rawRegex, startPos); + nlbRegex.nextRegex = nextRegex ? lib(nextRegex, flags) : null; + negativeLookbehindRegexes.push(nlbRegex); + rawRegex = rawRegex.substr(0, startPos) + rawRegex.substr(closePos + 1); + startPos = rawRegex.indexOf('(? { + let clean = true; + negativeLookbehindRegexes.forEach(regex => { + let negativeLookbehindMatches = RegExpUtility.getMatchesSimple(regex, source); + negativeLookbehindMatches.forEach(negativeLookbehindMatch => { + let negativeLookbehindEnd = negativeLookbehindMatch.index + negativeLookbehindMatch.length; + let nextRegex = regex.nextRegex; + if (match.index === negativeLookbehindEnd) { + if (!nextRegex) { + clean = false; + return; + } + else { + let nextMatch = RegExpUtility.getFirstMatchIndex(nextRegex, source.substring(negativeLookbehindMatch.index)); + if (nextMatch.matched && ((nextMatch.index === negativeLookbehindMatch.length) || (source.includes(nextMatch.value + match.value)))) { + clean = false; + return; + } + } + } + if (negativeLookbehindMatch.value.includes(match.value)) { + let preMatches = RegExpUtility.getMatchesSimple(regex, source.substring(0, match.index)); + preMatches.forEach(preMatch => { + if (source.includes(preMatch.value + match.value)) { + clean = false; + return; + } + }); + } + }); + if (!clean) { + return; + } + }); + if (clean) { + realMatches.push(match); + } + }); + return realMatches; + } + static getMatchesSimple(regex, source) { + // Word boundary (\b) in JS is not unicode-aware, so words starting/ending with accentuated characters will not match + // use a normalized string to match, the return matches' values using the original one + // http://blog.stevenlevithan.com/archives/javascript-regex-and-unicode + // https://stackoverflow.com/questions/2881445/utf-8-word-boundary-regex-in-javascript + let normalized = StringUtility.removeDiacriticsFromWordBoundaries(source); + let matches = new Array(); + lib.forEach(normalized, regex, match => { + let positiveLookbehinds = []; + let groups = {}; + let lastGroup = ''; + Object.keys(match).forEach(key => { + if (!key.includes('__')) + return; + if (key.startsWith('plb') && match[key]) { + if (match[0].indexOf(match[key]) !== 0 && !StringUtility.isNullOrEmpty(lastGroup)) { + let index = match.index + match[0].indexOf(match[key]); + let length = match[key].length; + let value = source.substr(index, length); + groups[lastGroup].value = groups[lastGroup].value + value; + } + positiveLookbehinds.push({ key: key, value: match[key] }); + return; + } + if (key.startsWith('nlb')) { + return; + } + let groupKey = key.substr(0, key.lastIndexOf('__')); + lastGroup = groupKey; + if (!groups[groupKey]) + groups[groupKey] = { value: '', index: 0, length: 0, captures: [] }; + if (match[key]) { + let index = match.index + match[0].indexOf(match[key]); + let length = match[key].length; + let value = source.substr(index, length); + groups[groupKey].index = index; + groups[groupKey].length = length; + groups[groupKey].value = value; + groups[groupKey].captures.push(value); + } + }); + let value = match[0]; + let index = match.index; + let length = value.length; + if (positiveLookbehinds && positiveLookbehinds.length > 0 && value.indexOf(positiveLookbehinds[0].value) === 0) { + value = source.substr(index, length).substr(positiveLookbehinds[0].value.length); + index += positiveLookbehinds[0].value.length; + length -= positiveLookbehinds[0].value.length; + } + else { + value = source.substr(index, length); + } + matches.push(new Match(index, length, value, groups)); + }); + return matches; + } + static getSafeRegExp(source, flags) { + let sanitizedSource = this.sanitizeGroups(source); + return lib(sanitizedSource, flags || 'gis'); + } + static getFirstMatchIndex(regex, source) { + let matches = RegExpUtility.getMatches(regex, source); + if (matches.length) { + return { + matched: true, + index: matches[0].index, + value: matches[0].value + }; + } + return { matched: false, index: -1, value: null }; + } + static split(regex, source) { + return lib.split(source, regex); + } + static isMatch(regex, source) { + return !StringUtility.isNullOrEmpty(source) + && this.getMatches(regex, source).length > 0; + } + static sanitizeGroups(source) { + let index = 0; + let result = lib.replace(source, this.matchGroup, (match, name) => match.replace(name, `${name}__${index++}`)); + index = 0; + result = lib.replace(result, this.matchPositiveLookbehind, () => `(?`); + index = 0; + result = lib.replace(result, this.matchNegativeLookbehind, () => `(?`); + return result; + } + static getNextRegex(source, startPos) { + startPos = RegExpUtility.getClosePos(source, startPos) + 1; + let closePos = RegExpUtility.getClosePos(source, startPos); + if (source[startPos] !== '(') { + closePos--; + } + let next = (startPos === closePos) + ? null + : source.substring(startPos, closePos + 1); + return next; + } + static getClosePos(source, startPos) { + let counter = 1; + let closePos = startPos; + while (counter > 0 && closePos < source.length) { + let c = source[++closePos]; + if (c === '(') + counter++; + else if (c === ')') + counter--; + } + return closePos; + } +} +RegExpUtility.matchGroup = lib(String.raw `\?<(?\w+)>`, 'gis'); +RegExpUtility.matchPositiveLookbehind = lib(String.raw `\(\?<=`, 'gis'); +RegExpUtility.matchNegativeLookbehind = lib(String.raw `\(\? { + let length = s.length; + if (length === 0) + return s; + let first = StringUtility.removeDiacritics(s.substring(0, 1)); + if (length === 1) + return first; + let last = length > 1 ? StringUtility.removeDiacritics(s.substring(length - 1)) : ''; + let mid = s.substring(1, length - 1); + // console.log(first + mid + last) + return first + mid + last; + }) + .join(' '); + } + static removeDiacritics(c) { + let clean = StringUtility.diacriticsRemovalMap[c]; + return !clean ? c : clean; + } +} +StringUtility.diacriticsRemovalMap = { + "Ⓐ": "A", + "A": "A", + "À": "A", + "Á": "A", + "Â": "A", + "Ầ": "A", + "Ấ": "A", + "Ẫ": "A", + "Ẩ": "A", + "Ã": "A", + "Ā": "A", + "Ă": "A", + "Ằ": "A", + "Ắ": "A", + "Ẵ": "A", + "Ẳ": "A", + "Ȧ": "A", + "Ǡ": "A", + "Ä": "A", + "Ǟ": "A", + "Ả": "A", + "Å": "A", + "Ǻ": "A", + "Ǎ": "A", + "Ȁ": "A", + "Ȃ": "A", + "Ạ": "A", + "Ậ": "A", + "Ặ": "A", + "Ḁ": "A", + "Ą": "A", + "Ⱥ": "A", + "Ɐ": "A", + "Ⓑ": "B", + "B": "B", + "Ḃ": "B", + "Ḅ": "B", + "Ḇ": "B", + "Ƀ": "B", + "Ƃ": "B", + "Ɓ": "B", + "Ⓒ": "C", + "C": "C", + "Ć": "C", + "Ĉ": "C", + "Ċ": "C", + "Č": "C", + "Ç": "C", + "Ḉ": "C", + "Ƈ": "C", + "Ȼ": "C", + "Ꜿ": "C", + "Ⓓ": "D", + "D": "D", + "Ḋ": "D", + "Ď": "D", + "Ḍ": "D", + "Ḑ": "D", + "Ḓ": "D", + "Ḏ": "D", + "Đ": "D", + "Ƌ": "D", + "Ɗ": "D", + "Ɖ": "D", + "Ꝺ": "D", + "Ⓔ": "E", + "E": "E", + "È": "E", + "É": "E", + "Ê": "E", + "Ề": "E", + "Ế": "E", + "Ễ": "E", + "Ể": "E", + "Ẽ": "E", + "Ē": "E", + "Ḕ": "E", + "Ḗ": "E", + "Ĕ": "E", + "Ė": "E", + "Ë": "E", + "Ẻ": "E", + "Ě": "E", + "Ȅ": "E", + "Ȇ": "E", + "Ẹ": "E", + "Ệ": "E", + "Ȩ": "E", + "Ḝ": "E", + "Ę": "E", + "Ḙ": "E", + "Ḛ": "E", + "Ɛ": "E", + "Ǝ": "E", + "Ⓕ": "F", + "F": "F", + "Ḟ": "F", + "Ƒ": "F", + "Ꝼ": "F", + "Ⓖ": "G", + "G": "G", + "Ǵ": "G", + "Ĝ": "G", + "Ḡ": "G", + "Ğ": "G", + "Ġ": "G", + "Ǧ": "G", + "Ģ": "G", + "Ǥ": "G", + "Ɠ": "G", + "Ꞡ": "G", + "Ᵹ": "G", + "Ꝿ": "G", + "Ⓗ": "H", + "H": "H", + "Ĥ": "H", + "Ḣ": "H", + "Ḧ": "H", + "Ȟ": "H", + "Ḥ": "H", + "Ḩ": "H", + "Ḫ": "H", + "Ħ": "H", + "Ⱨ": "H", + "Ⱶ": "H", + "Ɥ": "H", + "Ⓘ": "I", + "I": "I", + "Ì": "I", + "Í": "I", + "Î": "I", + "Ĩ": "I", + "Ī": "I", + "Ĭ": "I", + "İ": "I", + "Ï": "I", + "Ḯ": "I", + "Ỉ": "I", + "Ǐ": "I", + "Ȉ": "I", + "Ȋ": "I", + "Ị": "I", + "Į": "I", + "Ḭ": "I", + "Ɨ": "I", + "Ⓙ": "J", + "J": "J", + "Ĵ": "J", + "Ɉ": "J", + "Ⓚ": "K", + "K": "K", + "Ḱ": "K", + "Ǩ": "K", + "Ḳ": "K", + "Ķ": "K", + "Ḵ": "K", + "Ƙ": "K", + "Ⱪ": "K", + "Ꝁ": "K", + "Ꝃ": "K", + "Ꝅ": "K", + "Ꞣ": "K", + "Ⓛ": "L", + "L": "L", + "Ŀ": "L", + "Ĺ": "L", + "Ľ": "L", + "Ḷ": "L", + "Ḹ": "L", + "Ļ": "L", + "Ḽ": "L", + "Ḻ": "L", + "Ł": "L", + "Ƚ": "L", + "Ɫ": "L", + "Ⱡ": "L", + "Ꝉ": "L", + "Ꝇ": "L", + "Ꞁ": "L", + "Ⓜ": "M", + "M": "M", + "Ḿ": "M", + "Ṁ": "M", + "Ṃ": "M", + "Ɱ": "M", + "Ɯ": "M", + "Ⓝ": "N", + "N": "N", + "Ǹ": "N", + "Ń": "N", + "Ñ": "N", + "Ṅ": "N", + "Ň": "N", + "Ṇ": "N", + "Ņ": "N", + "Ṋ": "N", + "Ṉ": "N", + "Ƞ": "N", + "Ɲ": "N", + "Ꞑ": "N", + "Ꞥ": "N", + "Ⓞ": "O", + "O": "O", + "Ò": "O", + "Ó": "O", + "Ô": "O", + "Ồ": "O", + "Ố": "O", + "Ỗ": "O", + "Ổ": "O", + "Õ": "O", + "Ṍ": "O", + "Ȭ": "O", + "Ṏ": "O", + "Ō": "O", + "Ṑ": "O", + "Ṓ": "O", + "Ŏ": "O", + "Ȯ": "O", + "Ȱ": "O", + "Ö": "O", + "Ȫ": "O", + "Ỏ": "O", + "Ő": "O", + "Ǒ": "O", + "Ȍ": "O", + "Ȏ": "O", + "Ơ": "O", + "Ờ": "O", + "Ớ": "O", + "Ỡ": "O", + "Ở": "O", + "Ợ": "O", + "Ọ": "O", + "Ộ": "O", + "Ǫ": "O", + "Ǭ": "O", + "Ø": "O", + "Ǿ": "O", + "Ɔ": "O", + "Ɵ": "O", + "Ꝋ": "O", + "Ꝍ": "O", + "Ⓟ": "P", + "P": "P", + "Ṕ": "P", + "Ṗ": "P", + "Ƥ": "P", + "Ᵽ": "P", + "Ꝑ": "P", + "Ꝓ": "P", + "Ꝕ": "P", + "Ⓠ": "Q", + "Q": "Q", + "Ꝗ": "Q", + "Ꝙ": "Q", + "Ɋ": "Q", + "Ⓡ": "R", + "R": "R", + "Ŕ": "R", + "Ṙ": "R", + "Ř": "R", + "Ȑ": "R", + "Ȓ": "R", + "Ṛ": "R", + "Ṝ": "R", + "Ŗ": "R", + "Ṟ": "R", + "Ɍ": "R", + "Ɽ": "R", + "Ꝛ": "R", + "Ꞧ": "R", + "Ꞃ": "R", + "Ⓢ": "S", + "S": "S", + "ẞ": "S", + "Ś": "S", + "Ṥ": "S", + "Ŝ": "S", + "Ṡ": "S", + "Š": "S", + "Ṧ": "S", + "Ṣ": "S", + "Ṩ": "S", + "Ș": "S", + "Ş": "S", + "Ȿ": "S", + "Ꞩ": "S", + "Ꞅ": "S", + "Ⓣ": "T", + "T": "T", + "Ṫ": "T", + "Ť": "T", + "Ṭ": "T", + "Ț": "T", + "Ţ": "T", + "Ṱ": "T", + "Ṯ": "T", + "Ŧ": "T", + "Ƭ": "T", + "Ʈ": "T", + "Ⱦ": "T", + "Ꞇ": "T", + "Ⓤ": "U", + "U": "U", + "Ù": "U", + "Ú": "U", + "Û": "U", + "Ũ": "U", + "Ṹ": "U", + "Ū": "U", + "Ṻ": "U", + "Ŭ": "U", + "Ü": "U", + "Ǜ": "U", + "Ǘ": "U", + "Ǖ": "U", + "Ǚ": "U", + "Ủ": "U", + "Ů": "U", + "Ű": "U", + "Ǔ": "U", + "Ȕ": "U", + "Ȗ": "U", + "Ư": "U", + "Ừ": "U", + "Ứ": "U", + "Ữ": "U", + "Ử": "U", + "Ự": "U", + "Ụ": "U", + "Ṳ": "U", + "Ų": "U", + "Ṷ": "U", + "Ṵ": "U", + "Ʉ": "U", + "Ⓥ": "V", + "V": "V", + "Ṽ": "V", + "Ṿ": "V", + "Ʋ": "V", + "Ꝟ": "V", + "Ʌ": "V", + "Ⓦ": "W", + "W": "W", + "Ẁ": "W", + "Ẃ": "W", + "Ŵ": "W", + "Ẇ": "W", + "Ẅ": "W", + "Ẉ": "W", + "Ⱳ": "W", + "Ⓧ": "X", + "X": "X", + "Ẋ": "X", + "Ẍ": "X", + "Ⓨ": "Y", + "Y": "Y", + "Ỳ": "Y", + "Ý": "Y", + "Ŷ": "Y", + "Ỹ": "Y", + "Ȳ": "Y", + "Ẏ": "Y", + "Ÿ": "Y", + "Ỷ": "Y", + "Ỵ": "Y", + "Ƴ": "Y", + "Ɏ": "Y", + "Ỿ": "Y", + "Ⓩ": "Z", + "Z": "Z", + "Ź": "Z", + "Ẑ": "Z", + "Ż": "Z", + "Ž": "Z", + "Ẓ": "Z", + "Ẕ": "Z", + "Ƶ": "Z", + "Ȥ": "Z", + "Ɀ": "Z", + "Ⱬ": "Z", + "Ꝣ": "Z", + "ⓐ": "a", + "a": "a", + "ẚ": "a", + "à": "a", + "á": "a", + "â": "a", + "ầ": "a", + "ấ": "a", + "ẫ": "a", + "ẩ": "a", + "ã": "a", + "ā": "a", + "ă": "a", + "ằ": "a", + "ắ": "a", + "ẵ": "a", + "ẳ": "a", + "ȧ": "a", + "ǡ": "a", + "ä": "a", + "ǟ": "a", + "ả": "a", + "å": "a", + "ǻ": "a", + "ǎ": "a", + "ȁ": "a", + "ȃ": "a", + "ạ": "a", + "ậ": "a", + "ặ": "a", + "ḁ": "a", + "ą": "a", + "ⱥ": "a", + "ɐ": "a", + "ⓑ": "b", + "b": "b", + "ḃ": "b", + "ḅ": "b", + "ḇ": "b", + "ƀ": "b", + "ƃ": "b", + "ɓ": "b", + "ⓒ": "c", + "c": "c", + "ć": "c", + "ĉ": "c", + "ċ": "c", + "č": "c", + "ç": "c", + "ḉ": "c", + "ƈ": "c", + "ȼ": "c", + "ꜿ": "c", + "ↄ": "c", + "ⓓ": "d", + "d": "d", + "ḋ": "d", + "ď": "d", + "ḍ": "d", + "ḑ": "d", + "ḓ": "d", + "ḏ": "d", + "đ": "d", + "ƌ": "d", + "ɖ": "d", + "ɗ": "d", + "ꝺ": "d", + "ⓔ": "e", + "e": "e", + "è": "e", + "é": "e", + "ê": "e", + "ề": "e", + "ế": "e", + "ễ": "e", + "ể": "e", + "ẽ": "e", + "ē": "e", + "ḕ": "e", + "ḗ": "e", + "ĕ": "e", + "ė": "e", + "ë": "e", + "ẻ": "e", + "ě": "e", + "ȅ": "e", + "ȇ": "e", + "ẹ": "e", + "ệ": "e", + "ȩ": "e", + "ḝ": "e", + "ę": "e", + "ḙ": "e", + "ḛ": "e", + "ɇ": "e", + "ɛ": "e", + "ǝ": "e", + "ⓕ": "f", + "f": "f", + "ḟ": "f", + "ƒ": "f", + "ꝼ": "f", + "ⓖ": "g", + "g": "g", + "ǵ": "g", + "ĝ": "g", + "ḡ": "g", + "ğ": "g", + "ġ": "g", + "ǧ": "g", + "ģ": "g", + "ǥ": "g", + "ɠ": "g", + "ꞡ": "g", + "ᵹ": "g", + "ꝿ": "g", + "ⓗ": "h", + "h": "h", + "ĥ": "h", + "ḣ": "h", + "ḧ": "h", + "ȟ": "h", + "ḥ": "h", + "ḩ": "h", + "ḫ": "h", + "ẖ": "h", + "ħ": "h", + "ⱨ": "h", + "ⱶ": "h", + "ɥ": "h", + "ⓘ": "i", + "i": "i", + "ì": "i", + "í": "i", + "î": "i", + "ĩ": "i", + "ī": "i", + "ĭ": "i", + "ï": "i", + "ḯ": "i", + "ỉ": "i", + "ǐ": "i", + "ȉ": "i", + "ȋ": "i", + "ị": "i", + "į": "i", + "ḭ": "i", + "ɨ": "i", + "ı": "i", + "ⓙ": "j", + "j": "j", + "ĵ": "j", + "ǰ": "j", + "ɉ": "j", + "ⓚ": "k", + "k": "k", + "ḱ": "k", + "ǩ": "k", + "ḳ": "k", + "ķ": "k", + "ḵ": "k", + "ƙ": "k", + "ⱪ": "k", + "ꝁ": "k", + "ꝃ": "k", + "ꝅ": "k", + "ꞣ": "k", + "ⓛ": "l", + "l": "l", + "ŀ": "l", + "ĺ": "l", + "ľ": "l", + "ḷ": "l", + "ḹ": "l", + "ļ": "l", + "ḽ": "l", + "ḻ": "l", + "ſ": "l", + "ł": "l", + "ƚ": "l", + "ɫ": "l", + "ⱡ": "l", + "ꝉ": "l", + "ꞁ": "l", + "ꝇ": "l", + "ⓜ": "m", + "m": "m", + "ḿ": "m", + "ṁ": "m", + "ṃ": "m", + "ɱ": "m", + "ɯ": "m", + "ⓝ": "n", + "n": "n", + "ǹ": "n", + "ń": "n", + "ñ": "n", + "ṅ": "n", + "ň": "n", + "ṇ": "n", + "ņ": "n", + "ṋ": "n", + "ṉ": "n", + "ƞ": "n", + "ɲ": "n", + "ʼn": "n", + "ꞑ": "n", + "ꞥ": "n", + "ⓞ": "o", + "o": "o", + "ò": "o", + "ó": "o", + "ô": "o", + "ồ": "o", + "ố": "o", + "ỗ": "o", + "ổ": "o", + "õ": "o", + "ṍ": "o", + "ȭ": "o", + "ṏ": "o", + "ō": "o", + "ṑ": "o", + "ṓ": "o", + "ŏ": "o", + "ȯ": "o", + "ȱ": "o", + "ö": "o", + "ȫ": "o", + "ỏ": "o", + "ő": "o", + "ǒ": "o", + "ȍ": "o", + "ȏ": "o", + "ơ": "o", + "ờ": "o", + "ớ": "o", + "ỡ": "o", + "ở": "o", + "ợ": "o", + "ọ": "o", + "ộ": "o", + "ǫ": "o", + "ǭ": "o", + "ø": "o", + "ǿ": "o", + "ɔ": "o", + "ꝋ": "o", + "ꝍ": "o", + "ɵ": "o", + "ⓟ": "p", + "p": "p", + "ṕ": "p", + "ṗ": "p", + "ƥ": "p", + "ᵽ": "p", + "ꝑ": "p", + "ꝓ": "p", + "ꝕ": "p", + "ⓠ": "q", + "q": "q", + "ɋ": "q", + "ꝗ": "q", + "ꝙ": "q", + "ⓡ": "r", + "r": "r", + "ŕ": "r", + "ṙ": "r", + "ř": "r", + "ȑ": "r", + "ȓ": "r", + "ṛ": "r", + "ṝ": "r", + "ŗ": "r", + "ṟ": "r", + "ɍ": "r", + "ɽ": "r", + "ꝛ": "r", + "ꞧ": "r", + "ꞃ": "r", + "ⓢ": "s", + "s": "s", + "ß": "s", + "ś": "s", + "ṥ": "s", + "ŝ": "s", + "ṡ": "s", + "š": "s", + "ṧ": "s", + "ṣ": "s", + "ṩ": "s", + "ș": "s", + "ş": "s", + "ȿ": "s", + "ꞩ": "s", + "ꞅ": "s", + "ẛ": "s", + "ⓣ": "t", + "t": "t", + "ṫ": "t", + "ẗ": "t", + "ť": "t", + "ṭ": "t", + "ț": "t", + "ţ": "t", + "ṱ": "t", + "ṯ": "t", + "ŧ": "t", + "ƭ": "t", + "ʈ": "t", + "ⱦ": "t", + "ꞇ": "t", + "ⓤ": "u", + "u": "u", + "ù": "u", + "ú": "u", + "û": "u", + "ũ": "u", + "ṹ": "u", + "ū": "u", + "ṻ": "u", + "ŭ": "u", + "ü": "u", + "ǜ": "u", + "ǘ": "u", + "ǖ": "u", + "ǚ": "u", + "ủ": "u", + "ů": "u", + "ű": "u", + "ǔ": "u", + "ȕ": "u", + "ȗ": "u", + "ư": "u", + "ừ": "u", + "ứ": "u", + "ữ": "u", + "ử": "u", + "ự": "u", + "ụ": "u", + "ṳ": "u", + "ų": "u", + "ṷ": "u", + "ṵ": "u", + "ʉ": "u", + "ⓥ": "v", + "v": "v", + "ṽ": "v", + "ṿ": "v", + "ʋ": "v", + "ꝟ": "v", + "ʌ": "v", + "ⓦ": "w", + "w": "w", + "ẁ": "w", + "ẃ": "w", + "ŵ": "w", + "ẇ": "w", + "ẅ": "w", + "ẘ": "w", + "ẉ": "w", + "ⱳ": "w", + "ⓧ": "x", + "x": "x", + "ẋ": "x", + "ẍ": "x", + "ⓨ": "y", + "y": "y", + "ỳ": "y", + "ý": "y", + "ŷ": "y", + "ỹ": "y", + "ȳ": "y", + "ẏ": "y", + "ÿ": "y", + "ỷ": "y", + "ẙ": "y", + "ỵ": "y", + "ƴ": "y", + "ɏ": "y", + "ỿ": "y", + "ⓩ": "z", + "z": "z", + "ź": "z", + "ẑ": "z", + "ż": "z", + "ž": "z", + "ẓ": "z", + "ẕ": "z", + "ƶ": "z", + "ȥ": "z", + "ɀ": "z", + "ⱬ": "z", + "ꝣ": "z" +}; +exports.StringUtility = StringUtility; + +}); + +unwrapExports(utilities); + +var models = createCommonjsModule(function (module, exports) { +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); + + +class ModelResult { +} +exports.ModelResult = ModelResult; +class ExtendedModelResult extends ModelResult { + constructor(source = null) { + super(); + if (source) { + this.text = source.text; + this.start = source.start; + this.end = source.end; + this.typeName = source.typeName; + this.resolution = source.resolution; + } + } +} +exports.ExtendedModelResult = ExtendedModelResult; +class ModelFactoryKey { + constructor(culture$$1, modelType, options = null) { + this.culture = culture$$1 ? culture$$1.toLowerCase() : null; + this.modelType = modelType; + this.options = options; + } + toString() { + return JSON.stringify(this); + } + static fromString(key) { + return JSON.parse(key); + } +} +class ModelFactory { + constructor() { + this.modelFactories = new Map(); + } + getModel(modelTypeName, culture$$1, fallbackToDefaultCulture, options) { + let result = this.tryGetModel(modelTypeName, culture$$1, options); + if (!result.containsModel && fallbackToDefaultCulture) { + result = this.tryGetModel(modelTypeName, ModelFactory.fallbackCulture, options); + } + if (result.containsModel) { + return result.model; + } + throw new Error(`Could not find Model with the specified configuration: ${culture$$1},${modelTypeName}`); + } + tryGetModel(modelTypeName, culture$$1, options) { + culture$$1 = culture.Culture.mapToNearestLanguage(culture$$1); + let cacheResult = this.getModelFromCache(modelTypeName, culture$$1, options); + if (cacheResult) + return { containsModel: true, model: cacheResult }; + let key = this.generateKey(modelTypeName, culture$$1); + if (this.modelFactories.has(key)) { + let model = this.modelFactories.get(key)(options); + this.registerModelInCache(modelTypeName, culture$$1, options, model); + return { containsModel: true, model: model }; + } + return { containsModel: false }; + } + registerModel(modelTypeName, culture$$1, modelCreator) { + let key = this.generateKey(modelTypeName, culture$$1); + if (this.modelFactories.has(key)) { + throw new Error(`${culture$$1}-${modelTypeName} has already been registered.`); + } + this.modelFactories.set(key, modelCreator); + } + initializeModels(targetCulture, options) { + this.modelFactories.forEach((value, key) => { + let modelFactoryKey = ModelFactoryKey.fromString(key); + if (utilities.StringUtility.isNullOrEmpty(targetCulture) || modelFactoryKey.culture === targetCulture) { + this.tryGetModel(modelFactoryKey.modelType, modelFactoryKey.culture, modelFactoryKey.options); + } + }); + } + generateKey(modelTypeName, culture$$1) { + return new ModelFactoryKey(culture$$1, modelTypeName).toString(); + } + getModelFromCache(modelTypeName, culture$$1, options) { + let key = this.generateCacheKey(modelTypeName, culture$$1, options); + return ModelFactory.cache.get(key); + } + registerModelInCache(modelTypeName, culture$$1, options, model) { + let key = this.generateCacheKey(modelTypeName, culture$$1, options); + ModelFactory.cache.set(key, model); + } + generateCacheKey(modelTypeName, culture$$1, options) { + return new ModelFactoryKey(culture$$1, modelTypeName, options).toString(); + } +} +ModelFactory.fallbackCulture = culture.Culture.English; +ModelFactory.cache = new Map(); +exports.ModelFactory = ModelFactory; + +}); + +unwrapExports(models); + +var recognizer = createCommonjsModule(function (module, exports) { +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); + +class Recognizer { + constructor(targetCulture, options, lazyInitialization) { + this.modelFactory = new models.ModelFactory(); + if (!this.IsValidOptions(options)) + throw new Error(`${options} is not a valid options value.`); + this.TargetCulture = targetCulture; + this.Options = options; + this.InitializeConfiguration(); + if (!lazyInitialization) { + this.initializeModels(targetCulture, options); + } + } + getModel(modelTypeName, culture, fallbackToDefaultCulture) { + return this.modelFactory.getModel(modelTypeName, culture || this.TargetCulture, fallbackToDefaultCulture, this.Options); + } + registerModel(modelTypeName, culture, modelCreator) { + this.modelFactory.registerModel(modelTypeName, culture, modelCreator); + } + initializeModels(targetCulture, options) { + this.modelFactory.initializeModels(targetCulture, options); + } +} +exports.Recognizer = Recognizer; + +}); + +unwrapExports(recognizer); + +var extractors = createCommonjsModule(function (module, exports) { +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +class ExtractResult { + static isOverlap(erA, erB) { + return !(erA.start >= erB.start + erB.length) && !(erB.start >= erA.start + erA.length); + } + static isCover(er1, er2) { + return ((er2.start < er1.start) && ((er2.start + er2.length) >= (er1.start + er1.length))) + || ((er2.start <= er1.start) && ((er2.start + er2.length) > (er1.start + er1.length))); + } + static getFromText(source) { + return { + start: 0, + length: source.length, + text: source, + type: 'custom' + }; + } +} +exports.ExtractResult = ExtractResult; + +}); + +unwrapExports(extractors); + +var parsers = createCommonjsModule(function (module, exports) { +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); + +class ParseResult extends extractors.ExtractResult { + constructor(er) { + super(); + if (er) { + this.length = er.length; + this.start = er.start; + this.data = er.data; + this.text = er.text; + this.type = er.type; + } + this.resolutionStr = ""; + } +} +exports.ParseResult = ParseResult; + +}); + +unwrapExports(parsers); + +var recognizersText = createCommonjsModule(function (module, exports) { +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); + +exports.Culture = culture.Culture; +exports.CultureInfo = culture.CultureInfo; + +exports.ModelResult = models.ModelResult; +exports.ModelFactory = models.ModelFactory; + +exports.Recognizer = recognizer.Recognizer; + +exports.ExtractResult = extractors.ExtractResult; + +exports.ParseResult = parsers.ParseResult; + +exports.FormatUtility = utilities.FormatUtility; +exports.StringUtility = utilities.StringUtility; +exports.Match = utilities.Match; +exports.RegExpUtility = utilities.RegExpUtility; + +}); + +unwrapExports(recognizersText); + +/** + * lodash (Custom Build) + * Build: `lodash modularize exports="npm" -o ./` + * Copyright jQuery Foundation and other contributors + * Released under MIT license + * Based on Underscore.js 1.8.3 + * Copyright Jeremy Ashkenas, DocumentCloud and Investigative Reporters & Editors + */ + +/** Used as references for various `Number` constants. */ +var INFINITY = 1 / 0; + +/** `Object#toString` result references. */ +var symbolTag = '[object Symbol]'; + +/** Used to match leading and trailing whitespace. */ +var reTrimEnd = /\s+$/; + +/** Used to compose unicode character classes. */ +var rsAstralRange = '\\ud800-\\udfff'; +var rsComboMarksRange = '\\u0300-\\u036f\\ufe20-\\ufe23'; +var rsComboSymbolsRange = '\\u20d0-\\u20f0'; +var rsVarRange = '\\ufe0e\\ufe0f'; + +/** Used to compose unicode capture groups. */ +var rsAstral = '[' + rsAstralRange + ']'; +var rsCombo = '[' + rsComboMarksRange + rsComboSymbolsRange + ']'; +var rsFitz = '\\ud83c[\\udffb-\\udfff]'; +var rsModifier = '(?:' + rsCombo + '|' + rsFitz + ')'; +var rsNonAstral = '[^' + rsAstralRange + ']'; +var rsRegional = '(?:\\ud83c[\\udde6-\\uddff]){2}'; +var rsSurrPair = '[\\ud800-\\udbff][\\udc00-\\udfff]'; +var rsZWJ = '\\u200d'; + +/** Used to compose unicode regexes. */ +var reOptMod = rsModifier + '?'; +var rsOptVar = '[' + rsVarRange + ']?'; +var rsOptJoin = '(?:' + rsZWJ + '(?:' + [rsNonAstral, rsRegional, rsSurrPair].join('|') + ')' + rsOptVar + reOptMod + ')*'; +var rsSeq = rsOptVar + reOptMod + rsOptJoin; +var rsSymbol = '(?:' + [rsNonAstral + rsCombo + '?', rsCombo, rsRegional, rsSurrPair, rsAstral].join('|') + ')'; + +/** Used to match [string symbols](https://mathiasbynens.be/notes/javascript-unicode). */ +var reUnicode = RegExp(rsFitz + '(?=' + rsFitz + ')|' + rsSymbol + rsSeq, 'g'); + +/** Used to detect strings with [zero-width joiners or code points from the astral planes](http://eev.ee/blog/2015/09/12/dark-corners-of-unicode/). */ +var reHasUnicode = RegExp('[' + rsZWJ + rsAstralRange + rsComboMarksRange + rsComboSymbolsRange + rsVarRange + ']'); + +/** Detect free variable `global` from Node.js. */ +var freeGlobal = typeof commonjsGlobal == 'object' && commonjsGlobal && commonjsGlobal.Object === Object && commonjsGlobal; + +/** Detect free variable `self`. */ +var freeSelf = typeof self == 'object' && self && self.Object === Object && self; + +/** Used as a reference to the global object. */ +var root = freeGlobal || freeSelf || Function('return this')(); + +/** + * Converts an ASCII `string` to an array. + * + * @private + * @param {string} string The string to convert. + * @returns {Array} Returns the converted array. + */ +function asciiToArray(string) { + return string.split(''); +} + +/** + * The base implementation of `_.findIndex` and `_.findLastIndex` without + * support for iteratee shorthands. + * + * @private + * @param {Array} array The array to inspect. + * @param {Function} predicate The function invoked per iteration. + * @param {number} fromIndex The index to search from. + * @param {boolean} [fromRight] Specify iterating from right to left. + * @returns {number} Returns the index of the matched value, else `-1`. + */ +function baseFindIndex(array, predicate, fromIndex, fromRight) { + var length = array.length, + index = fromIndex + (fromRight ? 1 : -1); + + while ((fromRight ? index-- : ++index < length)) { + if (predicate(array[index], index, array)) { + return index; + } + } + return -1; +} + +/** + * The base implementation of `_.indexOf` without `fromIndex` bounds checks. + * + * @private + * @param {Array} array The array to inspect. + * @param {*} value The value to search for. + * @param {number} fromIndex The index to search from. + * @returns {number} Returns the index of the matched value, else `-1`. + */ +function baseIndexOf(array, value, fromIndex) { + if (value !== value) { + return baseFindIndex(array, baseIsNaN, fromIndex); + } + var index = fromIndex - 1, + length = array.length; + + while (++index < length) { + if (array[index] === value) { + return index; + } + } + return -1; +} + +/** + * The base implementation of `_.isNaN` without support for number objects. + * + * @private + * @param {*} value The value to check. + * @returns {boolean} Returns `true` if `value` is `NaN`, else `false`. + */ +function baseIsNaN(value) { + return value !== value; +} + +/** + * Used by `_.trim` and `_.trimEnd` to get the index of the last string symbol + * that is not found in the character symbols. + * + * @private + * @param {Array} strSymbols The string symbols to inspect. + * @param {Array} chrSymbols The character symbols to find. + * @returns {number} Returns the index of the last unmatched string symbol. + */ +function charsEndIndex(strSymbols, chrSymbols) { + var index = strSymbols.length; + + while (index-- && baseIndexOf(chrSymbols, strSymbols[index], 0) > -1) {} + return index; +} + +/** + * Checks if `string` contains Unicode symbols. + * + * @private + * @param {string} string The string to inspect. + * @returns {boolean} Returns `true` if a symbol is found, else `false`. + */ +function hasUnicode(string) { + return reHasUnicode.test(string); +} + +/** + * Converts `string` to an array. + * + * @private + * @param {string} string The string to convert. + * @returns {Array} Returns the converted array. + */ +function stringToArray(string) { + return hasUnicode(string) + ? unicodeToArray(string) + : asciiToArray(string); +} + +/** + * Converts a Unicode `string` to an array. + * + * @private + * @param {string} string The string to convert. + * @returns {Array} Returns the converted array. + */ +function unicodeToArray(string) { + return string.match(reUnicode) || []; +} + +/** Used for built-in method references. */ +var objectProto = Object.prototype; + +/** + * Used to resolve the + * [`toStringTag`](http://ecma-international.org/ecma-262/7.0/#sec-object.prototype.tostring) + * of values. + */ +var objectToString = objectProto.toString; + +/** Built-in value references. */ +var Symbol$1 = root.Symbol; + +/** Used to convert symbols to primitives and strings. */ +var symbolProto = Symbol$1 ? Symbol$1.prototype : undefined; +var symbolToString = symbolProto ? symbolProto.toString : undefined; + +/** + * The base implementation of `_.slice` without an iteratee call guard. + * + * @private + * @param {Array} array The array to slice. + * @param {number} [start=0] The start position. + * @param {number} [end=array.length] The end position. + * @returns {Array} Returns the slice of `array`. + */ +function baseSlice(array, start, end) { + var index = -1, + length = array.length; + + if (start < 0) { + start = -start > length ? 0 : (length + start); + } + end = end > length ? length : end; + if (end < 0) { + end += length; + } + length = start > end ? 0 : ((end - start) >>> 0); + start >>>= 0; + + var result = Array(length); + while (++index < length) { + result[index] = array[index + start]; + } + return result; +} + +/** + * The base implementation of `_.toString` which doesn't convert nullish + * values to empty strings. + * + * @private + * @param {*} value The value to process. + * @returns {string} Returns the string. + */ +function baseToString(value) { + // Exit early for strings to avoid a performance hit in some environments. + if (typeof value == 'string') { + return value; + } + if (isSymbol(value)) { + return symbolToString ? symbolToString.call(value) : ''; + } + var result = (value + ''); + return (result == '0' && (1 / value) == -INFINITY) ? '-0' : result; +} + +/** + * Casts `array` to a slice if it's needed. + * + * @private + * @param {Array} array The array to inspect. + * @param {number} start The start position. + * @param {number} [end=array.length] The end position. + * @returns {Array} Returns the cast slice. + */ +function castSlice(array, start, end) { + var length = array.length; + end = end === undefined ? length : end; + return (!start && end >= length) ? array : baseSlice(array, start, end); +} + +/** + * Checks if `value` is object-like. A value is object-like if it's not `null` + * and has a `typeof` result of "object". + * + * @static + * @memberOf _ + * @since 4.0.0 + * @category Lang + * @param {*} value The value to check. + * @returns {boolean} Returns `true` if `value` is object-like, else `false`. + * @example + * + * _.isObjectLike({}); + * // => true + * + * _.isObjectLike([1, 2, 3]); + * // => true + * + * _.isObjectLike(_.noop); + * // => false + * + * _.isObjectLike(null); + * // => false + */ +function isObjectLike(value) { + return !!value && typeof value == 'object'; +} + +/** + * Checks if `value` is classified as a `Symbol` primitive or object. + * + * @static + * @memberOf _ + * @since 4.0.0 + * @category Lang + * @param {*} value The value to check. + * @returns {boolean} Returns `true` if `value` is a symbol, else `false`. + * @example + * + * _.isSymbol(Symbol.iterator); + * // => true + * + * _.isSymbol('abc'); + * // => false + */ +function isSymbol(value) { + return typeof value == 'symbol' || + (isObjectLike(value) && objectToString.call(value) == symbolTag); +} + +/** + * Converts `value` to a string. An empty string is returned for `null` + * and `undefined` values. The sign of `-0` is preserved. + * + * @static + * @memberOf _ + * @since 4.0.0 + * @category Lang + * @param {*} value The value to process. + * @returns {string} Returns the string. + * @example + * + * _.toString(null); + * // => '' + * + * _.toString(-0); + * // => '-0' + * + * _.toString([1, 2, 3]); + * // => '1,2,3' + */ +function toString(value) { + return value == null ? '' : baseToString(value); +} + +/** + * Removes trailing whitespace or specified characters from `string`. + * + * @static + * @memberOf _ + * @since 4.0.0 + * @category String + * @param {string} [string=''] The string to trim. + * @param {string} [chars=whitespace] The characters to trim. + * @param- {Object} [guard] Enables use as an iteratee for methods like `_.map`. + * @returns {string} Returns the trimmed string. + * @example + * + * _.trimEnd(' abc '); + * // => ' abc' + * + * _.trimEnd('-_-abc-_-', '_-'); + * // => '-_-abc' + */ +function trimEnd(string, chars, guard) { + string = toString(string); + if (string && (guard || chars === undefined)) { + return string.replace(reTrimEnd, ''); + } + if (!string || !(chars = baseToString(chars))) { + return string; + } + var strSymbols = stringToArray(string), + end = charsEndIndex(strSymbols, stringToArray(chars)) + 1; + + return castSlice(strSymbols, 0, end).join(''); +} + +var lodash_trimend = trimEnd; + +var bignumber = createCommonjsModule(function (module) { +(function (globalObject) { + 'use strict'; + +/* + * bignumber.js v7.2.1 + * A JavaScript library for arbitrary-precision arithmetic. + * https://github.com/MikeMcl/bignumber.js + * Copyright (c) 2018 Michael Mclaughlin + * MIT Licensed. + * + * BigNumber.prototype methods | BigNumber methods + * | + * absoluteValue abs | clone + * comparedTo | config set + * decimalPlaces dp | DECIMAL_PLACES + * dividedBy div | ROUNDING_MODE + * dividedToIntegerBy idiv | EXPONENTIAL_AT + * exponentiatedBy pow | RANGE + * integerValue | CRYPTO + * isEqualTo eq | MODULO_MODE + * isFinite | POW_PRECISION + * isGreaterThan gt | FORMAT + * isGreaterThanOrEqualTo gte | ALPHABET + * isInteger | isBigNumber + * isLessThan lt | maximum max + * isLessThanOrEqualTo lte | minimum min + * isNaN | random + * isNegative | + * isPositive | + * isZero | + * minus | + * modulo mod | + * multipliedBy times | + * negated | + * plus | + * precision sd | + * shiftedBy | + * squareRoot sqrt | + * toExponential | + * toFixed | + * toFormat | + * toFraction | + * toJSON | + * toNumber | + * toPrecision | + * toString | + * valueOf | + * + */ + + + var BigNumber, + isNumeric = /^-?(?:\d+(?:\.\d*)?|\.\d+)(?:e[+-]?\d+)?$/i, + + mathceil = Math.ceil, + mathfloor = Math.floor, + + bignumberError = '[BigNumber Error] ', + tooManyDigits = bignumberError + 'Number primitive has more than 15 significant digits: ', + + BASE = 1e14, + LOG_BASE = 14, + MAX_SAFE_INTEGER = 0x1fffffffffffff, // 2^53 - 1 + // MAX_INT32 = 0x7fffffff, // 2^31 - 1 + POWS_TEN = [1, 10, 100, 1e3, 1e4, 1e5, 1e6, 1e7, 1e8, 1e9, 1e10, 1e11, 1e12, 1e13], + SQRT_BASE = 1e7, + + // EDITABLE + // The limit on the value of DECIMAL_PLACES, TO_EXP_NEG, TO_EXP_POS, MIN_EXP, MAX_EXP, and + // the arguments to toExponential, toFixed, toFormat, and toPrecision. + MAX = 1E9; // 0 to MAX_INT32 + + + /* + * Create and return a BigNumber constructor. + */ + function clone(configObject) { + var div, convertBase, parseNumeric, + P = BigNumber.prototype = { constructor: BigNumber, toString: null, valueOf: null }, + ONE = new BigNumber(1), + + + //----------------------------- EDITABLE CONFIG DEFAULTS ------------------------------- + + + // The default values below must be integers within the inclusive ranges stated. + // The values can also be changed at run-time using BigNumber.set. + + // The maximum number of decimal places for operations involving division. + DECIMAL_PLACES = 20, // 0 to MAX + + // The rounding mode used when rounding to the above decimal places, and when using + // toExponential, toFixed, toFormat and toPrecision, and round (default value). + // UP 0 Away from zero. + // DOWN 1 Towards zero. + // CEIL 2 Towards +Infinity. + // FLOOR 3 Towards -Infinity. + // HALF_UP 4 Towards nearest neighbour. If equidistant, up. + // HALF_DOWN 5 Towards nearest neighbour. If equidistant, down. + // HALF_EVEN 6 Towards nearest neighbour. If equidistant, towards even neighbour. + // HALF_CEIL 7 Towards nearest neighbour. If equidistant, towards +Infinity. + // HALF_FLOOR 8 Towards nearest neighbour. If equidistant, towards -Infinity. + ROUNDING_MODE = 4, // 0 to 8 + + // EXPONENTIAL_AT : [TO_EXP_NEG , TO_EXP_POS] + + // The exponent value at and beneath which toString returns exponential notation. + // Number type: -7 + TO_EXP_NEG = -7, // 0 to -MAX + + // The exponent value at and above which toString returns exponential notation. + // Number type: 21 + TO_EXP_POS = 21, // 0 to MAX + + // RANGE : [MIN_EXP, MAX_EXP] + + // The minimum exponent value, beneath which underflow to zero occurs. + // Number type: -324 (5e-324) + MIN_EXP = -1e7, // -1 to -MAX + + // The maximum exponent value, above which overflow to Infinity occurs. + // Number type: 308 (1.7976931348623157e+308) + // For MAX_EXP > 1e7, e.g. new BigNumber('1e100000000').plus(1) may be slow. + MAX_EXP = 1e7, // 1 to MAX + + // Whether to use cryptographically-secure random number generation, if available. + CRYPTO = false, // true or false + + // The modulo mode used when calculating the modulus: a mod n. + // The quotient (q = a / n) is calculated according to the corresponding rounding mode. + // The remainder (r) is calculated as: r = a - n * q. + // + // UP 0 The remainder is positive if the dividend is negative, else is negative. + // DOWN 1 The remainder has the same sign as the dividend. + // This modulo mode is commonly known as 'truncated division' and is + // equivalent to (a % n) in JavaScript. + // FLOOR 3 The remainder has the same sign as the divisor (Python %). + // HALF_EVEN 6 This modulo mode implements the IEEE 754 remainder function. + // EUCLID 9 Euclidian division. q = sign(n) * floor(a / abs(n)). + // The remainder is always positive. + // + // The truncated division, floored division, Euclidian division and IEEE 754 remainder + // modes are commonly used for the modulus operation. + // Although the other rounding modes can also be used, they may not give useful results. + MODULO_MODE = 1, // 0 to 9 + + // The maximum number of significant digits of the result of the exponentiatedBy operation. + // If POW_PRECISION is 0, there will be unlimited significant digits. + POW_PRECISION = 0, // 0 to MAX + + // The format specification used by the BigNumber.prototype.toFormat method. + FORMAT = { + decimalSeparator: '.', + groupSeparator: ',', + groupSize: 3, + secondaryGroupSize: 0, + fractionGroupSeparator: '\xA0', // non-breaking space + fractionGroupSize: 0 + }, + + // The alphabet used for base conversion. + // It must be at least 2 characters long, with no '.' or repeated character. + // '0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ$_' + ALPHABET = '0123456789abcdefghijklmnopqrstuvwxyz'; + + + //------------------------------------------------------------------------------------------ + + + // CONSTRUCTOR + + + /* + * The BigNumber constructor and exported function. + * Create and return a new instance of a BigNumber object. + * + * n {number|string|BigNumber} A numeric value. + * [b] {number} The base of n. Integer, 2 to ALPHABET.length inclusive. + */ + function BigNumber(n, b) { + var alphabet, c, caseChanged, e, i, isNum, len, str, + x = this; + + // Enable constructor usage without new. + if (!(x instanceof BigNumber)) { + + // Don't throw on constructor call without new (#81). + // '[BigNumber Error] Constructor call without new: {n}' + //throw Error(bignumberError + ' Constructor call without new: ' + n); + return new BigNumber(n, b); + } + + if (b == null) { + + // Duplicate. + if (n instanceof BigNumber) { + x.s = n.s; + x.e = n.e; + x.c = (n = n.c) ? n.slice() : n; + return; + } + + isNum = typeof n == 'number'; + + if (isNum && n * 0 == 0) { + + // Use `1 / n` to handle minus zero also. + x.s = 1 / n < 0 ? (n = -n, -1) : 1; + + // Faster path for integers. + if (n === ~~n) { + for (e = 0, i = n; i >= 10; i /= 10, e++); + x.e = e; + x.c = [n]; + return; + } + + str = n + ''; + } else { + if (!isNumeric.test(str = n + '')) return parseNumeric(x, str, isNum); + x.s = str.charCodeAt(0) == 45 ? (str = str.slice(1), -1) : 1; + } + + // Decimal point? + if ((e = str.indexOf('.')) > -1) str = str.replace('.', ''); + + // Exponential form? + if ((i = str.search(/e/i)) > 0) { + + // Determine exponent. + if (e < 0) e = i; + e += +str.slice(i + 1); + str = str.substring(0, i); + } else if (e < 0) { + + // Integer. + e = str.length; + } + + } else { + + // '[BigNumber Error] Base {not a primitive number|not an integer|out of range}: {b}' + intCheck(b, 2, ALPHABET.length, 'Base'); + str = n + ''; + + // Allow exponential notation to be used with base 10 argument, while + // also rounding to DECIMAL_PLACES as with other bases. + if (b == 10) { + x = new BigNumber(n instanceof BigNumber ? n : str); + return round(x, DECIMAL_PLACES + x.e + 1, ROUNDING_MODE); + } + + isNum = typeof n == 'number'; + + if (isNum) { + + // Avoid potential interpretation of Infinity and NaN as base 44+ values. + if (n * 0 != 0) return parseNumeric(x, str, isNum, b); + + x.s = 1 / n < 0 ? (str = str.slice(1), -1) : 1; + + // '[BigNumber Error] Number primitive has more than 15 significant digits: {n}' + if (BigNumber.DEBUG && str.replace(/^0\.0*|\./, '').length > 15) { + throw Error + (tooManyDigits + n); + } + + // Prevent later check for length on converted number. + isNum = false; + } else { + x.s = str.charCodeAt(0) === 45 ? (str = str.slice(1), -1) : 1; + } + + alphabet = ALPHABET.slice(0, b); + e = i = 0; + + // Check that str is a valid base b number. + // Don't use RegExp so alphabet can contain special characters. + for (len = str.length; i < len; i++) { + if (alphabet.indexOf(c = str.charAt(i)) < 0) { + if (c == '.') { + + // If '.' is not the first character and it has not be found before. + if (i > e) { + e = len; + continue; + } + } else if (!caseChanged) { + + // Allow e.g. hexadecimal 'FF' as well as 'ff'. + if (str == str.toUpperCase() && (str = str.toLowerCase()) || + str == str.toLowerCase() && (str = str.toUpperCase())) { + caseChanged = true; + i = -1; + e = 0; + continue; + } + } + + return parseNumeric(x, n + '', isNum, b); + } + } + + str = convertBase(str, b, 10, x.s); + + // Decimal point? + if ((e = str.indexOf('.')) > -1) str = str.replace('.', ''); + else e = str.length; + } + + // Determine leading zeros. + for (i = 0; str.charCodeAt(i) === 48; i++); + + // Determine trailing zeros. + for (len = str.length; str.charCodeAt(--len) === 48;); + + str = str.slice(i, ++len); + + if (str) { + len -= i; + + // '[BigNumber Error] Number primitive has more than 15 significant digits: {n}' + if (isNum && BigNumber.DEBUG && + len > 15 && (n > MAX_SAFE_INTEGER || n !== mathfloor(n))) { + throw Error + (tooManyDigits + (x.s * n)); + } + + e = e - i - 1; + + // Overflow? + if (e > MAX_EXP) { + + // Infinity. + x.c = x.e = null; + + // Underflow? + } else if (e < MIN_EXP) { + + // Zero. + x.c = [x.e = 0]; + } else { + x.e = e; + x.c = []; + + // Transform base + + // e is the base 10 exponent. + // i is where to slice str to get the first element of the coefficient array. + i = (e + 1) % LOG_BASE; + if (e < 0) i += LOG_BASE; + + if (i < len) { + if (i) x.c.push(+str.slice(0, i)); + + for (len -= LOG_BASE; i < len;) { + x.c.push(+str.slice(i, i += LOG_BASE)); + } + + str = str.slice(i); + i = LOG_BASE - str.length; + } else { + i -= len; + } + + for (; i--; str += '0'); + x.c.push(+str); + } + } else { + + // Zero. + x.c = [x.e = 0]; + } + } + + + // CONSTRUCTOR PROPERTIES + + + BigNumber.clone = clone; + + BigNumber.ROUND_UP = 0; + BigNumber.ROUND_DOWN = 1; + BigNumber.ROUND_CEIL = 2; + BigNumber.ROUND_FLOOR = 3; + BigNumber.ROUND_HALF_UP = 4; + BigNumber.ROUND_HALF_DOWN = 5; + BigNumber.ROUND_HALF_EVEN = 6; + BigNumber.ROUND_HALF_CEIL = 7; + BigNumber.ROUND_HALF_FLOOR = 8; + BigNumber.EUCLID = 9; + + + /* + * Configure infrequently-changing library-wide settings. + * + * Accept an object with the following optional properties (if the value of a property is + * a number, it must be an integer within the inclusive range stated): + * + * DECIMAL_PLACES {number} 0 to MAX + * ROUNDING_MODE {number} 0 to 8 + * EXPONENTIAL_AT {number|number[]} -MAX to MAX or [-MAX to 0, 0 to MAX] + * RANGE {number|number[]} -MAX to MAX (not zero) or [-MAX to -1, 1 to MAX] + * CRYPTO {boolean} true or false + * MODULO_MODE {number} 0 to 9 + * POW_PRECISION {number} 0 to MAX + * ALPHABET {string} A string of two or more unique characters which does + * not contain '.'. + * FORMAT {object} An object with some of the following properties: + * decimalSeparator {string} + * groupSeparator {string} + * groupSize {number} + * secondaryGroupSize {number} + * fractionGroupSeparator {string} + * fractionGroupSize {number} + * + * (The values assigned to the above FORMAT object properties are not checked for validity.) + * + * E.g. + * BigNumber.config({ DECIMAL_PLACES : 20, ROUNDING_MODE : 4 }) + * + * Ignore properties/parameters set to null or undefined, except for ALPHABET. + * + * Return an object with the properties current values. + */ + BigNumber.config = BigNumber.set = function (obj) { + var p, v; + + if (obj != null) { + + if (typeof obj == 'object') { + + // DECIMAL_PLACES {number} Integer, 0 to MAX inclusive. + // '[BigNumber Error] DECIMAL_PLACES {not a primitive number|not an integer|out of range}: {v}' + if (obj.hasOwnProperty(p = 'DECIMAL_PLACES')) { + v = obj[p]; + intCheck(v, 0, MAX, p); + DECIMAL_PLACES = v; + } + + // ROUNDING_MODE {number} Integer, 0 to 8 inclusive. + // '[BigNumber Error] ROUNDING_MODE {not a primitive number|not an integer|out of range}: {v}' + if (obj.hasOwnProperty(p = 'ROUNDING_MODE')) { + v = obj[p]; + intCheck(v, 0, 8, p); + ROUNDING_MODE = v; + } + + // EXPONENTIAL_AT {number|number[]} + // Integer, -MAX to MAX inclusive or + // [integer -MAX to 0 inclusive, 0 to MAX inclusive]. + // '[BigNumber Error] EXPONENTIAL_AT {not a primitive number|not an integer|out of range}: {v}' + if (obj.hasOwnProperty(p = 'EXPONENTIAL_AT')) { + v = obj[p]; + if (isArray(v)) { + intCheck(v[0], -MAX, 0, p); + intCheck(v[1], 0, MAX, p); + TO_EXP_NEG = v[0]; + TO_EXP_POS = v[1]; + } else { + intCheck(v, -MAX, MAX, p); + TO_EXP_NEG = -(TO_EXP_POS = v < 0 ? -v : v); + } + } + + // RANGE {number|number[]} Non-zero integer, -MAX to MAX inclusive or + // [integer -MAX to -1 inclusive, integer 1 to MAX inclusive]. + // '[BigNumber Error] RANGE {not a primitive number|not an integer|out of range|cannot be zero}: {v}' + if (obj.hasOwnProperty(p = 'RANGE')) { + v = obj[p]; + if (isArray(v)) { + intCheck(v[0], -MAX, -1, p); + intCheck(v[1], 1, MAX, p); + MIN_EXP = v[0]; + MAX_EXP = v[1]; + } else { + intCheck(v, -MAX, MAX, p); + if (v) { + MIN_EXP = -(MAX_EXP = v < 0 ? -v : v); + } else { + throw Error + (bignumberError + p + ' cannot be zero: ' + v); + } + } + } + + // CRYPTO {boolean} true or false. + // '[BigNumber Error] CRYPTO not true or false: {v}' + // '[BigNumber Error] crypto unavailable' + if (obj.hasOwnProperty(p = 'CRYPTO')) { + v = obj[p]; + if (v === !!v) { + if (v) { + if (typeof crypto != 'undefined' && crypto && + (crypto.getRandomValues || crypto.randomBytes)) { + CRYPTO = v; + } else { + CRYPTO = !v; + throw Error + (bignumberError + 'crypto unavailable'); + } + } else { + CRYPTO = v; + } + } else { + throw Error + (bignumberError + p + ' not true or false: ' + v); + } + } + + // MODULO_MODE {number} Integer, 0 to 9 inclusive. + // '[BigNumber Error] MODULO_MODE {not a primitive number|not an integer|out of range}: {v}' + if (obj.hasOwnProperty(p = 'MODULO_MODE')) { + v = obj[p]; + intCheck(v, 0, 9, p); + MODULO_MODE = v; + } + + // POW_PRECISION {number} Integer, 0 to MAX inclusive. + // '[BigNumber Error] POW_PRECISION {not a primitive number|not an integer|out of range}: {v}' + if (obj.hasOwnProperty(p = 'POW_PRECISION')) { + v = obj[p]; + intCheck(v, 0, MAX, p); + POW_PRECISION = v; + } + + // FORMAT {object} + // '[BigNumber Error] FORMAT not an object: {v}' + if (obj.hasOwnProperty(p = 'FORMAT')) { + v = obj[p]; + if (typeof v == 'object') FORMAT = v; + else throw Error + (bignumberError + p + ' not an object: ' + v); + } + + // ALPHABET {string} + // '[BigNumber Error] ALPHABET invalid: {v}' + if (obj.hasOwnProperty(p = 'ALPHABET')) { + v = obj[p]; + + // Disallow if only one character, or contains '.' or a repeated character. + if (typeof v == 'string' && !/^.$|\.|(.).*\1/.test(v)) { + ALPHABET = v; + } else { + throw Error + (bignumberError + p + ' invalid: ' + v); + } + } + + } else { + + // '[BigNumber Error] Object expected: {v}' + throw Error + (bignumberError + 'Object expected: ' + obj); + } + } + + return { + DECIMAL_PLACES: DECIMAL_PLACES, + ROUNDING_MODE: ROUNDING_MODE, + EXPONENTIAL_AT: [TO_EXP_NEG, TO_EXP_POS], + RANGE: [MIN_EXP, MAX_EXP], + CRYPTO: CRYPTO, + MODULO_MODE: MODULO_MODE, + POW_PRECISION: POW_PRECISION, + FORMAT: FORMAT, + ALPHABET: ALPHABET + }; + }; + + + /* + * Return true if v is a BigNumber instance, otherwise return false. + * + * v {any} + */ + BigNumber.isBigNumber = function (v) { + return v instanceof BigNumber || v && v._isBigNumber === true || false; + }; + + + /* + * Return a new BigNumber whose value is the maximum of the arguments. + * + * arguments {number|string|BigNumber} + */ + BigNumber.maximum = BigNumber.max = function () { + return maxOrMin(arguments, P.lt); + }; + + + /* + * Return a new BigNumber whose value is the minimum of the arguments. + * + * arguments {number|string|BigNumber} + */ + BigNumber.minimum = BigNumber.min = function () { + return maxOrMin(arguments, P.gt); + }; + + + /* + * Return a new BigNumber with a random value equal to or greater than 0 and less than 1, + * and with dp, or DECIMAL_PLACES if dp is omitted, decimal places (or less if trailing + * zeros are produced). + * + * [dp] {number} Decimal places. Integer, 0 to MAX inclusive. + * + * '[BigNumber Error] Argument {not a primitive number|not an integer|out of range}: {dp}' + * '[BigNumber Error] crypto unavailable' + */ + BigNumber.random = (function () { + var pow2_53 = 0x20000000000000; + + // Return a 53 bit integer n, where 0 <= n < 9007199254740992. + // Check if Math.random() produces more than 32 bits of randomness. + // If it does, assume at least 53 bits are produced, otherwise assume at least 30 bits. + // 0x40000000 is 2^30, 0x800000 is 2^23, 0x1fffff is 2^21 - 1. + var random53bitInt = (Math.random() * pow2_53) & 0x1fffff + ? function () { return mathfloor(Math.random() * pow2_53); } + : function () { return ((Math.random() * 0x40000000 | 0) * 0x800000) + + (Math.random() * 0x800000 | 0); }; + + return function (dp) { + var a, b, e, k, v, + i = 0, + c = [], + rand = new BigNumber(ONE); + + if (dp == null) dp = DECIMAL_PLACES; + else intCheck(dp, 0, MAX); + + k = mathceil(dp / LOG_BASE); + + if (CRYPTO) { + + // Browsers supporting crypto.getRandomValues. + if (crypto.getRandomValues) { + + a = crypto.getRandomValues(new Uint32Array(k *= 2)); + + for (; i < k;) { + + // 53 bits: + // ((Math.pow(2, 32) - 1) * Math.pow(2, 21)).toString(2) + // 11111 11111111 11111111 11111111 11100000 00000000 00000000 + // ((Math.pow(2, 32) - 1) >>> 11).toString(2) + // 11111 11111111 11111111 + // 0x20000 is 2^21. + v = a[i] * 0x20000 + (a[i + 1] >>> 11); + + // Rejection sampling: + // 0 <= v < 9007199254740992 + // Probability that v >= 9e15, is + // 7199254740992 / 9007199254740992 ~= 0.0008, i.e. 1 in 1251 + if (v >= 9e15) { + b = crypto.getRandomValues(new Uint32Array(2)); + a[i] = b[0]; + a[i + 1] = b[1]; + } else { + + // 0 <= v <= 8999999999999999 + // 0 <= (v % 1e14) <= 99999999999999 + c.push(v % 1e14); + i += 2; + } + } + i = k / 2; + + // Node.js supporting crypto.randomBytes. + } else if (crypto.randomBytes) { + + // buffer + a = crypto.randomBytes(k *= 7); + + for (; i < k;) { + + // 0x1000000000000 is 2^48, 0x10000000000 is 2^40 + // 0x100000000 is 2^32, 0x1000000 is 2^24 + // 11111 11111111 11111111 11111111 11111111 11111111 11111111 + // 0 <= v < 9007199254740992 + v = ((a[i] & 31) * 0x1000000000000) + (a[i + 1] * 0x10000000000) + + (a[i + 2] * 0x100000000) + (a[i + 3] * 0x1000000) + + (a[i + 4] << 16) + (a[i + 5] << 8) + a[i + 6]; + + if (v >= 9e15) { + crypto.randomBytes(7).copy(a, i); + } else { + + // 0 <= (v % 1e14) <= 99999999999999 + c.push(v % 1e14); + i += 7; + } + } + i = k / 7; + } else { + CRYPTO = false; + throw Error + (bignumberError + 'crypto unavailable'); + } + } + + // Use Math.random. + if (!CRYPTO) { + + for (; i < k;) { + v = random53bitInt(); + if (v < 9e15) c[i++] = v % 1e14; + } + } + + k = c[--i]; + dp %= LOG_BASE; + + // Convert trailing digits to zeros according to dp. + if (k && dp) { + v = POWS_TEN[LOG_BASE - dp]; + c[i] = mathfloor(k / v) * v; + } + + // Remove trailing elements which are zero. + for (; c[i] === 0; c.pop(), i--); + + // Zero? + if (i < 0) { + c = [e = 0]; + } else { + + // Remove leading elements which are zero and adjust exponent accordingly. + for (e = -1 ; c[0] === 0; c.splice(0, 1), e -= LOG_BASE); + + // Count the digits of the first element of c to determine leading zeros, and... + for (i = 1, v = c[0]; v >= 10; v /= 10, i++); + + // adjust the exponent accordingly. + if (i < LOG_BASE) e -= LOG_BASE - i; + } + + rand.e = e; + rand.c = c; + return rand; + }; + })(); + + + // PRIVATE FUNCTIONS + + + // Called by BigNumber and BigNumber.prototype.toString. + convertBase = (function () { + var decimal = '0123456789'; + + /* + * Convert string of baseIn to an array of numbers of baseOut. + * Eg. toBaseOut('255', 10, 16) returns [15, 15]. + * Eg. toBaseOut('ff', 16, 10) returns [2, 5, 5]. + */ + function toBaseOut(str, baseIn, baseOut, alphabet) { + var j, + arr = [0], + arrL, + i = 0, + len = str.length; + + for (; i < len;) { + for (arrL = arr.length; arrL--; arr[arrL] *= baseIn); + + arr[0] += alphabet.indexOf(str.charAt(i++)); + + for (j = 0; j < arr.length; j++) { + + if (arr[j] > baseOut - 1) { + if (arr[j + 1] == null) arr[j + 1] = 0; + arr[j + 1] += arr[j] / baseOut | 0; + arr[j] %= baseOut; + } + } + } + + return arr.reverse(); + } + + // Convert a numeric string of baseIn to a numeric string of baseOut. + // If the caller is toString, we are converting from base 10 to baseOut. + // If the caller is BigNumber, we are converting from baseIn to base 10. + return function (str, baseIn, baseOut, sign, callerIsToString) { + var alphabet, d, e, k, r, x, xc, y, + i = str.indexOf('.'), + dp = DECIMAL_PLACES, + rm = ROUNDING_MODE; + + // Non-integer. + if (i >= 0) { + k = POW_PRECISION; + + // Unlimited precision. + POW_PRECISION = 0; + str = str.replace('.', ''); + y = new BigNumber(baseIn); + x = y.pow(str.length - i); + POW_PRECISION = k; + + // Convert str as if an integer, then restore the fraction part by dividing the + // result by its base raised to a power. + + y.c = toBaseOut(toFixedPoint(coeffToString(x.c), x.e, '0'), + 10, baseOut, decimal); + y.e = y.c.length; + } + + // Convert the number as integer. + + xc = toBaseOut(str, baseIn, baseOut, callerIsToString + ? (alphabet = ALPHABET, decimal) + : (alphabet = decimal, ALPHABET)); + + // xc now represents str as an integer and converted to baseOut. e is the exponent. + e = k = xc.length; + + // Remove trailing zeros. + for (; xc[--k] == 0; xc.pop()); + + // Zero? + if (!xc[0]) return alphabet.charAt(0); + + // Does str represent an integer? If so, no need for the division. + if (i < 0) { + --e; + } else { + x.c = xc; + x.e = e; + + // The sign is needed for correct rounding. + x.s = sign; + x = div(x, y, dp, rm, baseOut); + xc = x.c; + r = x.r; + e = x.e; + } + + // xc now represents str converted to baseOut. + + // THe index of the rounding digit. + d = e + dp + 1; + + // The rounding digit: the digit to the right of the digit that may be rounded up. + i = xc[d]; + + // Look at the rounding digits and mode to determine whether to round up. + + k = baseOut / 2; + r = r || d < 0 || xc[d + 1] != null; + + r = rm < 4 ? (i != null || r) && (rm == 0 || rm == (x.s < 0 ? 3 : 2)) + : i > k || i == k &&(rm == 4 || r || rm == 6 && xc[d - 1] & 1 || + rm == (x.s < 0 ? 8 : 7)); + + // If the index of the rounding digit is not greater than zero, or xc represents + // zero, then the result of the base conversion is zero or, if rounding up, a value + // such as 0.00001. + if (d < 1 || !xc[0]) { + + // 1^-dp or 0 + str = r ? toFixedPoint(alphabet.charAt(1), -dp, alphabet.charAt(0)) + : alphabet.charAt(0); + } else { + + // Truncate xc to the required number of decimal places. + xc.length = d; + + // Round up? + if (r) { + + // Rounding up may mean the previous digit has to be rounded up and so on. + for (--baseOut; ++xc[--d] > baseOut;) { + xc[d] = 0; + + if (!d) { + ++e; + xc = [1].concat(xc); + } + } + } + + // Determine trailing zeros. + for (k = xc.length; !xc[--k];); + + // E.g. [4, 11, 15] becomes 4bf. + for (i = 0, str = ''; i <= k; str += alphabet.charAt(xc[i++])); + + // Add leading zeros, decimal point and trailing zeros as required. + str = toFixedPoint(str, e, alphabet.charAt(0)); + } + + // The caller will add the sign. + return str; + }; + })(); + + + // Perform division in the specified base. Called by div and convertBase. + div = (function () { + + // Assume non-zero x and k. + function multiply(x, k, base) { + var m, temp, xlo, xhi, + carry = 0, + i = x.length, + klo = k % SQRT_BASE, + khi = k / SQRT_BASE | 0; + + for (x = x.slice(); i--;) { + xlo = x[i] % SQRT_BASE; + xhi = x[i] / SQRT_BASE | 0; + m = khi * xlo + xhi * klo; + temp = klo * xlo + ((m % SQRT_BASE) * SQRT_BASE) + carry; + carry = (temp / base | 0) + (m / SQRT_BASE | 0) + khi * xhi; + x[i] = temp % base; + } + + if (carry) x = [carry].concat(x); + + return x; + } + + function compare(a, b, aL, bL) { + var i, cmp; + + if (aL != bL) { + cmp = aL > bL ? 1 : -1; + } else { + + for (i = cmp = 0; i < aL; i++) { + + if (a[i] != b[i]) { + cmp = a[i] > b[i] ? 1 : -1; + break; + } + } + } + + return cmp; + } + + function subtract(a, b, aL, base) { + var i = 0; + + // Subtract b from a. + for (; aL--;) { + a[aL] -= i; + i = a[aL] < b[aL] ? 1 : 0; + a[aL] = i * base + a[aL] - b[aL]; + } + + // Remove leading zeros. + for (; !a[0] && a.length > 1; a.splice(0, 1)); + } + + // x: dividend, y: divisor. + return function (x, y, dp, rm, base) { + var cmp, e, i, more, n, prod, prodL, q, qc, rem, remL, rem0, xi, xL, yc0, + yL, yz, + s = x.s == y.s ? 1 : -1, + xc = x.c, + yc = y.c; + + // Either NaN, Infinity or 0? + if (!xc || !xc[0] || !yc || !yc[0]) { + + return new BigNumber( + + // Return NaN if either NaN, or both Infinity or 0. + !x.s || !y.s || (xc ? yc && xc[0] == yc[0] : !yc) ? NaN : + + // Return ±0 if x is ±0 or y is ±Infinity, or return ±Infinity as y is ±0. + xc && xc[0] == 0 || !yc ? s * 0 : s / 0 + ); + } + + q = new BigNumber(s); + qc = q.c = []; + e = x.e - y.e; + s = dp + e + 1; + + if (!base) { + base = BASE; + e = bitFloor(x.e / LOG_BASE) - bitFloor(y.e / LOG_BASE); + s = s / LOG_BASE | 0; + } + + // Result exponent may be one less then the current value of e. + // The coefficients of the BigNumbers from convertBase may have trailing zeros. + for (i = 0; yc[i] == (xc[i] || 0); i++); + + if (yc[i] > (xc[i] || 0)) e--; + + if (s < 0) { + qc.push(1); + more = true; + } else { + xL = xc.length; + yL = yc.length; + i = 0; + s += 2; + + // Normalise xc and yc so highest order digit of yc is >= base / 2. + + n = mathfloor(base / (yc[0] + 1)); + + // Not necessary, but to handle odd bases where yc[0] == (base / 2) - 1. + // if (n > 1 || n++ == 1 && yc[0] < base / 2) { + if (n > 1) { + yc = multiply(yc, n, base); + xc = multiply(xc, n, base); + yL = yc.length; + xL = xc.length; + } + + xi = yL; + rem = xc.slice(0, yL); + remL = rem.length; + + // Add zeros to make remainder as long as divisor. + for (; remL < yL; rem[remL++] = 0); + yz = yc.slice(); + yz = [0].concat(yz); + yc0 = yc[0]; + if (yc[1] >= base / 2) yc0++; + // Not necessary, but to prevent trial digit n > base, when using base 3. + // else if (base == 3 && yc0 == 1) yc0 = 1 + 1e-15; + + do { + n = 0; + + // Compare divisor and remainder. + cmp = compare(yc, rem, yL, remL); + + // If divisor < remainder. + if (cmp < 0) { + + // Calculate trial digit, n. + + rem0 = rem[0]; + if (yL != remL) rem0 = rem0 * base + (rem[1] || 0); + + // n is how many times the divisor goes into the current remainder. + n = mathfloor(rem0 / yc0); + + // Algorithm: + // product = divisor multiplied by trial digit (n). + // Compare product and remainder. + // If product is greater than remainder: + // Subtract divisor from product, decrement trial digit. + // Subtract product from remainder. + // If product was less than remainder at the last compare: + // Compare new remainder and divisor. + // If remainder is greater than divisor: + // Subtract divisor from remainder, increment trial digit. + + if (n > 1) { + + // n may be > base only when base is 3. + if (n >= base) n = base - 1; + + // product = divisor * trial digit. + prod = multiply(yc, n, base); + prodL = prod.length; + remL = rem.length; + + // Compare product and remainder. + // If product > remainder then trial digit n too high. + // n is 1 too high about 5% of the time, and is not known to have + // ever been more than 1 too high. + while (compare(prod, rem, prodL, remL) == 1) { + n--; + + // Subtract divisor from product. + subtract(prod, yL < prodL ? yz : yc, prodL, base); + prodL = prod.length; + cmp = 1; + } + } else { + + // n is 0 or 1, cmp is -1. + // If n is 0, there is no need to compare yc and rem again below, + // so change cmp to 1 to avoid it. + // If n is 1, leave cmp as -1, so yc and rem are compared again. + if (n == 0) { + + // divisor < remainder, so n must be at least 1. + cmp = n = 1; + } + + // product = divisor + prod = yc.slice(); + prodL = prod.length; + } + + if (prodL < remL) prod = [0].concat(prod); + + // Subtract product from remainder. + subtract(rem, prod, remL, base); + remL = rem.length; + + // If product was < remainder. + if (cmp == -1) { + + // Compare divisor and new remainder. + // If divisor < new remainder, subtract divisor from remainder. + // Trial digit n too low. + // n is 1 too low about 5% of the time, and very rarely 2 too low. + while (compare(yc, rem, yL, remL) < 1) { + n++; + + // Subtract divisor from remainder. + subtract(rem, yL < remL ? yz : yc, remL, base); + remL = rem.length; + } + } + } else if (cmp === 0) { + n++; + rem = [0]; + } // else cmp === 1 and n will be 0 + + // Add the next digit, n, to the result array. + qc[i++] = n; + + // Update the remainder. + if (rem[0]) { + rem[remL++] = xc[xi] || 0; + } else { + rem = [xc[xi]]; + remL = 1; + } + } while ((xi++ < xL || rem[0] != null) && s--); + + more = rem[0] != null; + + // Leading zero? + if (!qc[0]) qc.splice(0, 1); + } + + if (base == BASE) { + + // To calculate q.e, first get the number of digits of qc[0]. + for (i = 1, s = qc[0]; s >= 10; s /= 10, i++); + + round(q, dp + (q.e = i + e * LOG_BASE - 1) + 1, rm, more); + + // Caller is convertBase. + } else { + q.e = e; + q.r = +more; + } + + return q; + }; + })(); + + + /* + * Return a string representing the value of BigNumber n in fixed-point or exponential + * notation rounded to the specified decimal places or significant digits. + * + * n: a BigNumber. + * i: the index of the last digit required (i.e. the digit that may be rounded up). + * rm: the rounding mode. + * id: 1 (toExponential) or 2 (toPrecision). + */ + function format(n, i, rm, id) { + var c0, e, ne, len, str; + + if (rm == null) rm = ROUNDING_MODE; + else intCheck(rm, 0, 8); + + if (!n.c) return n.toString(); + + c0 = n.c[0]; + ne = n.e; + + if (i == null) { + str = coeffToString(n.c); + str = id == 1 || id == 2 && ne <= TO_EXP_NEG + ? toExponential(str, ne) + : toFixedPoint(str, ne, '0'); + } else { + n = round(new BigNumber(n), i, rm); + + // n.e may have changed if the value was rounded up. + e = n.e; + + str = coeffToString(n.c); + len = str.length; + + // toPrecision returns exponential notation if the number of significant digits + // specified is less than the number of digits necessary to represent the integer + // part of the value in fixed-point notation. + + // Exponential notation. + if (id == 1 || id == 2 && (i <= e || e <= TO_EXP_NEG)) { + + // Append zeros? + for (; len < i; str += '0', len++); + str = toExponential(str, e); + + // Fixed-point notation. + } else { + i -= ne; + str = toFixedPoint(str, e, '0'); + + // Append zeros? + if (e + 1 > len) { + if (--i > 0) for (str += '.'; i--; str += '0'); + } else { + i += e - len; + if (i > 0) { + if (e + 1 == len) str += '.'; + for (; i--; str += '0'); + } + } + } + } + + return n.s < 0 && c0 ? '-' + str : str; + } + + + // Handle BigNumber.max and BigNumber.min. + function maxOrMin(args, method) { + var m, n, + i = 0; + + if (isArray(args[0])) args = args[0]; + m = new BigNumber(args[0]); + + for (; ++i < args.length;) { + n = new BigNumber(args[i]); + + // If any number is NaN, return NaN. + if (!n.s) { + m = n; + break; + } else if (method.call(m, n)) { + m = n; + } + } + + return m; + } + + + /* + * Strip trailing zeros, calculate base 10 exponent and check against MIN_EXP and MAX_EXP. + * Called by minus, plus and times. + */ + function normalise(n, c, e) { + var i = 1, + j = c.length; + + // Remove trailing zeros. + for (; !c[--j]; c.pop()); + + // Calculate the base 10 exponent. First get the number of digits of c[0]. + for (j = c[0]; j >= 10; j /= 10, i++); + + // Overflow? + if ((e = i + e * LOG_BASE - 1) > MAX_EXP) { + + // Infinity. + n.c = n.e = null; + + // Underflow? + } else if (e < MIN_EXP) { + + // Zero. + n.c = [n.e = 0]; + } else { + n.e = e; + n.c = c; + } + + return n; + } + + + // Handle values that fail the validity test in BigNumber. + parseNumeric = (function () { + var basePrefix = /^(-?)0([xbo])(?=\w[\w.]*$)/i, + dotAfter = /^([^.]+)\.$/, + dotBefore = /^\.([^.]+)$/, + isInfinityOrNaN = /^-?(Infinity|NaN)$/, + whitespaceOrPlus = /^\s*\+(?=[\w.])|^\s+|\s+$/g; + + return function (x, str, isNum, b) { + var base, + s = isNum ? str : str.replace(whitespaceOrPlus, ''); + + // No exception on ±Infinity or NaN. + if (isInfinityOrNaN.test(s)) { + x.s = isNaN(s) ? null : s < 0 ? -1 : 1; + x.c = x.e = null; + } else { + if (!isNum) { + + // basePrefix = /^(-?)0([xbo])(?=\w[\w.]*$)/i + s = s.replace(basePrefix, function (m, p1, p2) { + base = (p2 = p2.toLowerCase()) == 'x' ? 16 : p2 == 'b' ? 2 : 8; + return !b || b == base ? p1 : m; + }); + + if (b) { + base = b; + + // E.g. '1.' to '1', '.1' to '0.1' + s = s.replace(dotAfter, '$1').replace(dotBefore, '0.$1'); + } + + if (str != s) return new BigNumber(s, base); + } + + // '[BigNumber Error] Not a number: {n}' + // '[BigNumber Error] Not a base {b} number: {n}' + if (BigNumber.DEBUG) { + throw Error + (bignumberError + 'Not a' + (b ? ' base ' + b : '') + ' number: ' + str); + } + + // NaN + x.c = x.e = x.s = null; + } + } + })(); + + + /* + * Round x to sd significant digits using rounding mode rm. Check for over/under-flow. + * If r is truthy, it is known that there are more digits after the rounding digit. + */ + function round(x, sd, rm, r) { + var d, i, j, k, n, ni, rd, + xc = x.c, + pows10 = POWS_TEN; + + // if x is not Infinity or NaN... + if (xc) { + + // rd is the rounding digit, i.e. the digit after the digit that may be rounded up. + // n is a base 1e14 number, the value of the element of array x.c containing rd. + // ni is the index of n within x.c. + // d is the number of digits of n. + // i is the index of rd within n including leading zeros. + // j is the actual index of rd within n (if < 0, rd is a leading zero). + out: { + + // Get the number of digits of the first element of xc. + for (d = 1, k = xc[0]; k >= 10; k /= 10, d++); + i = sd - d; + + // If the rounding digit is in the first element of xc... + if (i < 0) { + i += LOG_BASE; + j = sd; + n = xc[ni = 0]; + + // Get the rounding digit at index j of n. + rd = n / pows10[d - j - 1] % 10 | 0; + } else { + ni = mathceil((i + 1) / LOG_BASE); + + if (ni >= xc.length) { + + if (r) { + + // Needed by sqrt. + for (; xc.length <= ni; xc.push(0)); + n = rd = 0; + d = 1; + i %= LOG_BASE; + j = i - LOG_BASE + 1; + } else { + break out; + } + } else { + n = k = xc[ni]; + + // Get the number of digits of n. + for (d = 1; k >= 10; k /= 10, d++); + + // Get the index of rd within n. + i %= LOG_BASE; + + // Get the index of rd within n, adjusted for leading zeros. + // The number of leading zeros of n is given by LOG_BASE - d. + j = i - LOG_BASE + d; + + // Get the rounding digit at index j of n. + rd = j < 0 ? 0 : n / pows10[d - j - 1] % 10 | 0; + } + } + + r = r || sd < 0 || + + // Are there any non-zero digits after the rounding digit? + // The expression n % pows10[d - j - 1] returns all digits of n to the right + // of the digit at j, e.g. if n is 908714 and j is 2, the expression gives 714. + xc[ni + 1] != null || (j < 0 ? n : n % pows10[d - j - 1]); + + r = rm < 4 + ? (rd || r) && (rm == 0 || rm == (x.s < 0 ? 3 : 2)) + : rd > 5 || rd == 5 && (rm == 4 || r || rm == 6 && + + // Check whether the digit to the left of the rounding digit is odd. + ((i > 0 ? j > 0 ? n / pows10[d - j] : 0 : xc[ni - 1]) % 10) & 1 || + rm == (x.s < 0 ? 8 : 7)); + + if (sd < 1 || !xc[0]) { + xc.length = 0; + + if (r) { + + // Convert sd to decimal places. + sd -= x.e + 1; + + // 1, 0.1, 0.01, 0.001, 0.0001 etc. + xc[0] = pows10[(LOG_BASE - sd % LOG_BASE) % LOG_BASE]; + x.e = -sd || 0; + } else { + + // Zero. + xc[0] = x.e = 0; + } + + return x; + } + + // Remove excess digits. + if (i == 0) { + xc.length = ni; + k = 1; + ni--; + } else { + xc.length = ni + 1; + k = pows10[LOG_BASE - i]; + + // E.g. 56700 becomes 56000 if 7 is the rounding digit. + // j > 0 means i > number of leading zeros of n. + xc[ni] = j > 0 ? mathfloor(n / pows10[d - j] % pows10[j]) * k : 0; + } + + // Round up? + if (r) { + + for (; ;) { + + // If the digit to be rounded up is in the first element of xc... + if (ni == 0) { + + // i will be the length of xc[0] before k is added. + for (i = 1, j = xc[0]; j >= 10; j /= 10, i++); + j = xc[0] += k; + for (k = 1; j >= 10; j /= 10, k++); + + // if i != k the length has increased. + if (i != k) { + x.e++; + if (xc[0] == BASE) xc[0] = 1; + } + + break; + } else { + xc[ni] += k; + if (xc[ni] != BASE) break; + xc[ni--] = 0; + k = 1; + } + } + } + + // Remove trailing zeros. + for (i = xc.length; xc[--i] === 0; xc.pop()); + } + + // Overflow? Infinity. + if (x.e > MAX_EXP) { + x.c = x.e = null; + + // Underflow? Zero. + } else if (x.e < MIN_EXP) { + x.c = [x.e = 0]; + } + } + + return x; + } + + + // PROTOTYPE/INSTANCE METHODS + + + /* + * Return a new BigNumber whose value is the absolute value of this BigNumber. + */ + P.absoluteValue = P.abs = function () { + var x = new BigNumber(this); + if (x.s < 0) x.s = 1; + return x; + }; + + + /* + * Return + * 1 if the value of this BigNumber is greater than the value of BigNumber(y, b), + * -1 if the value of this BigNumber is less than the value of BigNumber(y, b), + * 0 if they have the same value, + * or null if the value of either is NaN. + */ + P.comparedTo = function (y, b) { + return compare(this, new BigNumber(y, b)); + }; + + + /* + * If dp is undefined or null or true or false, return the number of decimal places of the + * value of this BigNumber, or null if the value of this BigNumber is ±Infinity or NaN. + * + * Otherwise, if dp is a number, return a new BigNumber whose value is the value of this + * BigNumber rounded to a maximum of dp decimal places using rounding mode rm, or + * ROUNDING_MODE if rm is omitted. + * + * [dp] {number} Decimal places: integer, 0 to MAX inclusive. + * [rm] {number} Rounding mode. Integer, 0 to 8 inclusive. + * + * '[BigNumber Error] Argument {not a primitive number|not an integer|out of range}: {dp|rm}' + */ + P.decimalPlaces = P.dp = function (dp, rm) { + var c, n, v, + x = this; + + if (dp != null) { + intCheck(dp, 0, MAX); + if (rm == null) rm = ROUNDING_MODE; + else intCheck(rm, 0, 8); + + return round(new BigNumber(x), dp + x.e + 1, rm); + } + + if (!(c = x.c)) return null; + n = ((v = c.length - 1) - bitFloor(this.e / LOG_BASE)) * LOG_BASE; + + // Subtract the number of trailing zeros of the last number. + if (v = c[v]) for (; v % 10 == 0; v /= 10, n--); + if (n < 0) n = 0; + + return n; + }; + + + /* + * n / 0 = I + * n / N = N + * n / I = 0 + * 0 / n = 0 + * 0 / 0 = N + * 0 / N = N + * 0 / I = 0 + * N / n = N + * N / 0 = N + * N / N = N + * N / I = N + * I / n = I + * I / 0 = I + * I / N = N + * I / I = N + * + * Return a new BigNumber whose value is the value of this BigNumber divided by the value of + * BigNumber(y, b), rounded according to DECIMAL_PLACES and ROUNDING_MODE. + */ + P.dividedBy = P.div = function (y, b) { + return div(this, new BigNumber(y, b), DECIMAL_PLACES, ROUNDING_MODE); + }; + + + /* + * Return a new BigNumber whose value is the integer part of dividing the value of this + * BigNumber by the value of BigNumber(y, b). + */ + P.dividedToIntegerBy = P.idiv = function (y, b) { + return div(this, new BigNumber(y, b), 0, 1); + }; + + + /* + * Return a BigNumber whose value is the value of this BigNumber exponentiated by n. + * + * If m is present, return the result modulo m. + * If n is negative round according to DECIMAL_PLACES and ROUNDING_MODE. + * If POW_PRECISION is non-zero and m is not present, round to POW_PRECISION using ROUNDING_MODE. + * + * The modular power operation works efficiently when x, n, and m are integers, otherwise it + * is equivalent to calculating x.exponentiatedBy(n).modulo(m) with a POW_PRECISION of 0. + * + * n {number|string|BigNumber} The exponent. An integer. + * [m] {number|string|BigNumber} The modulus. + * + * '[BigNumber Error] Exponent not an integer: {n}' + */ + P.exponentiatedBy = P.pow = function (n, m) { + var half, isModExp, k, more, nIsBig, nIsNeg, nIsOdd, y, + x = this; + + n = new BigNumber(n); + + // Allow NaN and ±Infinity, but not other non-integers. + if (n.c && !n.isInteger()) { + throw Error + (bignumberError + 'Exponent not an integer: ' + n); + } + + if (m != null) m = new BigNumber(m); + + // Exponent of MAX_SAFE_INTEGER is 15. + nIsBig = n.e > 14; + + // If x is NaN, ±Infinity, ±0 or ±1, or n is ±Infinity, NaN or ±0. + if (!x.c || !x.c[0] || x.c[0] == 1 && !x.e && x.c.length == 1 || !n.c || !n.c[0]) { + + // The sign of the result of pow when x is negative depends on the evenness of n. + // If +n overflows to ±Infinity, the evenness of n would be not be known. + y = new BigNumber(Math.pow(+x.valueOf(), nIsBig ? 2 - isOdd(n) : +n)); + return m ? y.mod(m) : y; + } + + nIsNeg = n.s < 0; + + if (m) { + + // x % m returns NaN if abs(m) is zero, or m is NaN. + if (m.c ? !m.c[0] : !m.s) return new BigNumber(NaN); + + isModExp = !nIsNeg && x.isInteger() && m.isInteger(); + + if (isModExp) x = x.mod(m); + + // Overflow to ±Infinity: >=2**1e10 or >=1.0000024**1e15. + // Underflow to ±0: <=0.79**1e10 or <=0.9999975**1e15. + } else if (n.e > 9 && (x.e > 0 || x.e < -1 || (x.e == 0 + // [1, 240000000] + ? x.c[0] > 1 || nIsBig && x.c[1] >= 24e7 + // [80000000000000] [99999750000000] + : x.c[0] < 8e13 || nIsBig && x.c[0] <= 9999975e7))) { + + // If x is negative and n is odd, k = -0, else k = 0. + k = x.s < 0 && isOdd(n) ? -0 : 0; + + // If x >= 1, k = ±Infinity. + if (x.e > -1) k = 1 / k; + + // If n is negative return ±0, else return ±Infinity. + return new BigNumber(nIsNeg ? 1 / k : k); + + } else if (POW_PRECISION) { + + // Truncating each coefficient array to a length of k after each multiplication + // equates to truncating significant digits to POW_PRECISION + [28, 41], + // i.e. there will be a minimum of 28 guard digits retained. + k = mathceil(POW_PRECISION / LOG_BASE + 2); + } + + if (nIsBig) { + half = new BigNumber(0.5); + nIsOdd = isOdd(n); + } else { + nIsOdd = n % 2; + } + + if (nIsNeg) n.s = 1; + + y = new BigNumber(ONE); + + // Performs 54 loop iterations for n of 9007199254740991. + for (; ;) { + + if (nIsOdd) { + y = y.times(x); + if (!y.c) break; + + if (k) { + if (y.c.length > k) y.c.length = k; + } else if (isModExp) { + y = y.mod(m); //y = y.minus(div(y, m, 0, MODULO_MODE).times(m)); + } + } + + if (nIsBig) { + n = n.times(half); + round(n, n.e + 1, 1); + if (!n.c[0]) break; + nIsBig = n.e > 14; + nIsOdd = isOdd(n); + } else { + n = mathfloor(n / 2); + if (!n) break; + nIsOdd = n % 2; + } + + x = x.times(x); + + if (k) { + if (x.c && x.c.length > k) x.c.length = k; + } else if (isModExp) { + x = x.mod(m); //x = x.minus(div(x, m, 0, MODULO_MODE).times(m)); + } + } + + if (isModExp) return y; + if (nIsNeg) y = ONE.div(y); + + return m ? y.mod(m) : k ? round(y, POW_PRECISION, ROUNDING_MODE, more) : y; + }; + + + /* + * Return a new BigNumber whose value is the value of this BigNumber rounded to an integer + * using rounding mode rm, or ROUNDING_MODE if rm is omitted. + * + * [rm] {number} Rounding mode. Integer, 0 to 8 inclusive. + * + * '[BigNumber Error] Argument {not a primitive number|not an integer|out of range}: {rm}' + */ + P.integerValue = function (rm) { + var n = new BigNumber(this); + if (rm == null) rm = ROUNDING_MODE; + else intCheck(rm, 0, 8); + return round(n, n.e + 1, rm); + }; + + + /* + * Return true if the value of this BigNumber is equal to the value of BigNumber(y, b), + * otherwise return false. + */ + P.isEqualTo = P.eq = function (y, b) { + return compare(this, new BigNumber(y, b)) === 0; + }; + + + /* + * Return true if the value of this BigNumber is a finite number, otherwise return false. + */ + P.isFinite = function () { + return !!this.c; + }; + + + /* + * Return true if the value of this BigNumber is greater than the value of BigNumber(y, b), + * otherwise return false. + */ + P.isGreaterThan = P.gt = function (y, b) { + return compare(this, new BigNumber(y, b)) > 0; + }; + + + /* + * Return true if the value of this BigNumber is greater than or equal to the value of + * BigNumber(y, b), otherwise return false. + */ + P.isGreaterThanOrEqualTo = P.gte = function (y, b) { + return (b = compare(this, new BigNumber(y, b))) === 1 || b === 0; + + }; + + + /* + * Return true if the value of this BigNumber is an integer, otherwise return false. + */ + P.isInteger = function () { + return !!this.c && bitFloor(this.e / LOG_BASE) > this.c.length - 2; + }; + + + /* + * Return true if the value of this BigNumber is less than the value of BigNumber(y, b), + * otherwise return false. + */ + P.isLessThan = P.lt = function (y, b) { + return compare(this, new BigNumber(y, b)) < 0; + }; + + + /* + * Return true if the value of this BigNumber is less than or equal to the value of + * BigNumber(y, b), otherwise return false. + */ + P.isLessThanOrEqualTo = P.lte = function (y, b) { + return (b = compare(this, new BigNumber(y, b))) === -1 || b === 0; + }; + + + /* + * Return true if the value of this BigNumber is NaN, otherwise return false. + */ + P.isNaN = function () { + return !this.s; + }; + + + /* + * Return true if the value of this BigNumber is negative, otherwise return false. + */ + P.isNegative = function () { + return this.s < 0; + }; + + + /* + * Return true if the value of this BigNumber is positive, otherwise return false. + */ + P.isPositive = function () { + return this.s > 0; + }; + + + /* + * Return true if the value of this BigNumber is 0 or -0, otherwise return false. + */ + P.isZero = function () { + return !!this.c && this.c[0] == 0; + }; + + + /* + * n - 0 = n + * n - N = N + * n - I = -I + * 0 - n = -n + * 0 - 0 = 0 + * 0 - N = N + * 0 - I = -I + * N - n = N + * N - 0 = N + * N - N = N + * N - I = N + * I - n = I + * I - 0 = I + * I - N = N + * I - I = N + * + * Return a new BigNumber whose value is the value of this BigNumber minus the value of + * BigNumber(y, b). + */ + P.minus = function (y, b) { + var i, j, t, xLTy, + x = this, + a = x.s; + + y = new BigNumber(y, b); + b = y.s; + + // Either NaN? + if (!a || !b) return new BigNumber(NaN); + + // Signs differ? + if (a != b) { + y.s = -b; + return x.plus(y); + } + + var xe = x.e / LOG_BASE, + ye = y.e / LOG_BASE, + xc = x.c, + yc = y.c; + + if (!xe || !ye) { + + // Either Infinity? + if (!xc || !yc) return xc ? (y.s = -b, y) : new BigNumber(yc ? x : NaN); + + // Either zero? + if (!xc[0] || !yc[0]) { + + // Return y if y is non-zero, x if x is non-zero, or zero if both are zero. + return yc[0] ? (y.s = -b, y) : new BigNumber(xc[0] ? x : + + // IEEE 754 (2008) 6.3: n - n = -0 when rounding to -Infinity + ROUNDING_MODE == 3 ? -0 : 0); + } + } + + xe = bitFloor(xe); + ye = bitFloor(ye); + xc = xc.slice(); + + // Determine which is the bigger number. + if (a = xe - ye) { + + if (xLTy = a < 0) { + a = -a; + t = xc; + } else { + ye = xe; + t = yc; + } + + t.reverse(); + + // Prepend zeros to equalise exponents. + for (b = a; b--; t.push(0)); + t.reverse(); + } else { + + // Exponents equal. Check digit by digit. + j = (xLTy = (a = xc.length) < (b = yc.length)) ? a : b; + + for (a = b = 0; b < j; b++) { + + if (xc[b] != yc[b]) { + xLTy = xc[b] < yc[b]; + break; + } + } + } + + // x < y? Point xc to the array of the bigger number. + if (xLTy) t = xc, xc = yc, yc = t, y.s = -y.s; + + b = (j = yc.length) - (i = xc.length); + + // Append zeros to xc if shorter. + // No need to add zeros to yc if shorter as subtract only needs to start at yc.length. + if (b > 0) for (; b--; xc[i++] = 0); + b = BASE - 1; + + // Subtract yc from xc. + for (; j > a;) { + + if (xc[--j] < yc[j]) { + for (i = j; i && !xc[--i]; xc[i] = b); + --xc[i]; + xc[j] += BASE; + } + + xc[j] -= yc[j]; + } + + // Remove leading zeros and adjust exponent accordingly. + for (; xc[0] == 0; xc.splice(0, 1), --ye); + + // Zero? + if (!xc[0]) { + + // Following IEEE 754 (2008) 6.3, + // n - n = +0 but n - n = -0 when rounding towards -Infinity. + y.s = ROUNDING_MODE == 3 ? -1 : 1; + y.c = [y.e = 0]; + return y; + } + + // No need to check for Infinity as +x - +y != Infinity && -x - -y != Infinity + // for finite x and y. + return normalise(y, xc, ye); + }; + + + /* + * n % 0 = N + * n % N = N + * n % I = n + * 0 % n = 0 + * -0 % n = -0 + * 0 % 0 = N + * 0 % N = N + * 0 % I = 0 + * N % n = N + * N % 0 = N + * N % N = N + * N % I = N + * I % n = N + * I % 0 = N + * I % N = N + * I % I = N + * + * Return a new BigNumber whose value is the value of this BigNumber modulo the value of + * BigNumber(y, b). The result depends on the value of MODULO_MODE. + */ + P.modulo = P.mod = function (y, b) { + var q, s, + x = this; + + y = new BigNumber(y, b); + + // Return NaN if x is Infinity or NaN, or y is NaN or zero. + if (!x.c || !y.s || y.c && !y.c[0]) { + return new BigNumber(NaN); + + // Return x if y is Infinity or x is zero. + } else if (!y.c || x.c && !x.c[0]) { + return new BigNumber(x); + } + + if (MODULO_MODE == 9) { + + // Euclidian division: q = sign(y) * floor(x / abs(y)) + // r = x - qy where 0 <= r < abs(y) + s = y.s; + y.s = 1; + q = div(x, y, 0, 3); + y.s = s; + q.s *= s; + } else { + q = div(x, y, 0, MODULO_MODE); + } + + y = x.minus(q.times(y)); + + // To match JavaScript %, ensure sign of zero is sign of dividend. + if (!y.c[0] && MODULO_MODE == 1) y.s = x.s; + + return y; + }; + + + /* + * n * 0 = 0 + * n * N = N + * n * I = I + * 0 * n = 0 + * 0 * 0 = 0 + * 0 * N = N + * 0 * I = N + * N * n = N + * N * 0 = N + * N * N = N + * N * I = N + * I * n = I + * I * 0 = N + * I * N = N + * I * I = I + * + * Return a new BigNumber whose value is the value of this BigNumber multiplied by the value + * of BigNumber(y, b). + */ + P.multipliedBy = P.times = function (y, b) { + var c, e, i, j, k, m, xcL, xlo, xhi, ycL, ylo, yhi, zc, + base, sqrtBase, + x = this, + xc = x.c, + yc = (y = new BigNumber(y, b)).c; + + // Either NaN, ±Infinity or ±0? + if (!xc || !yc || !xc[0] || !yc[0]) { + + // Return NaN if either is NaN, or one is 0 and the other is Infinity. + if (!x.s || !y.s || xc && !xc[0] && !yc || yc && !yc[0] && !xc) { + y.c = y.e = y.s = null; + } else { + y.s *= x.s; + + // Return ±Infinity if either is ±Infinity. + if (!xc || !yc) { + y.c = y.e = null; + + // Return ±0 if either is ±0. + } else { + y.c = [0]; + y.e = 0; + } + } + + return y; + } + + e = bitFloor(x.e / LOG_BASE) + bitFloor(y.e / LOG_BASE); + y.s *= x.s; + xcL = xc.length; + ycL = yc.length; + + // Ensure xc points to longer array and xcL to its length. + if (xcL < ycL) zc = xc, xc = yc, yc = zc, i = xcL, xcL = ycL, ycL = i; + + // Initialise the result array with zeros. + for (i = xcL + ycL, zc = []; i--; zc.push(0)); + + base = BASE; + sqrtBase = SQRT_BASE; + + for (i = ycL; --i >= 0;) { + c = 0; + ylo = yc[i] % sqrtBase; + yhi = yc[i] / sqrtBase | 0; + + for (k = xcL, j = i + k; j > i;) { + xlo = xc[--k] % sqrtBase; + xhi = xc[k] / sqrtBase | 0; + m = yhi * xlo + xhi * ylo; + xlo = ylo * xlo + ((m % sqrtBase) * sqrtBase) + zc[j] + c; + c = (xlo / base | 0) + (m / sqrtBase | 0) + yhi * xhi; + zc[j--] = xlo % base; + } + + zc[j] = c; + } + + if (c) { + ++e; + } else { + zc.splice(0, 1); + } + + return normalise(y, zc, e); + }; + + + /* + * Return a new BigNumber whose value is the value of this BigNumber negated, + * i.e. multiplied by -1. + */ + P.negated = function () { + var x = new BigNumber(this); + x.s = -x.s || null; + return x; + }; + + + /* + * n + 0 = n + * n + N = N + * n + I = I + * 0 + n = n + * 0 + 0 = 0 + * 0 + N = N + * 0 + I = I + * N + n = N + * N + 0 = N + * N + N = N + * N + I = N + * I + n = I + * I + 0 = I + * I + N = N + * I + I = I + * + * Return a new BigNumber whose value is the value of this BigNumber plus the value of + * BigNumber(y, b). + */ + P.plus = function (y, b) { + var t, + x = this, + a = x.s; + + y = new BigNumber(y, b); + b = y.s; + + // Either NaN? + if (!a || !b) return new BigNumber(NaN); + + // Signs differ? + if (a != b) { + y.s = -b; + return x.minus(y); + } + + var xe = x.e / LOG_BASE, + ye = y.e / LOG_BASE, + xc = x.c, + yc = y.c; + + if (!xe || !ye) { + + // Return ±Infinity if either ±Infinity. + if (!xc || !yc) return new BigNumber(a / 0); + + // Either zero? + // Return y if y is non-zero, x if x is non-zero, or zero if both are zero. + if (!xc[0] || !yc[0]) return yc[0] ? y : new BigNumber(xc[0] ? x : a * 0); + } + + xe = bitFloor(xe); + ye = bitFloor(ye); + xc = xc.slice(); + + // Prepend zeros to equalise exponents. Faster to use reverse then do unshifts. + if (a = xe - ye) { + if (a > 0) { + ye = xe; + t = yc; + } else { + a = -a; + t = xc; + } + + t.reverse(); + for (; a--; t.push(0)); + t.reverse(); + } + + a = xc.length; + b = yc.length; + + // Point xc to the longer array, and b to the shorter length. + if (a - b < 0) t = yc, yc = xc, xc = t, b = a; + + // Only start adding at yc.length - 1 as the further digits of xc can be ignored. + for (a = 0; b;) { + a = (xc[--b] = xc[b] + yc[b] + a) / BASE | 0; + xc[b] = BASE === xc[b] ? 0 : xc[b] % BASE; + } + + if (a) { + xc = [a].concat(xc); + ++ye; + } + + // No need to check for zero, as +x + +y != 0 && -x + -y != 0 + // ye = MAX_EXP + 1 possible + return normalise(y, xc, ye); + }; + + + /* + * If sd is undefined or null or true or false, return the number of significant digits of + * the value of this BigNumber, or null if the value of this BigNumber is ±Infinity or NaN. + * If sd is true include integer-part trailing zeros in the count. + * + * Otherwise, if sd is a number, return a new BigNumber whose value is the value of this + * BigNumber rounded to a maximum of sd significant digits using rounding mode rm, or + * ROUNDING_MODE if rm is omitted. + * + * sd {number|boolean} number: significant digits: integer, 1 to MAX inclusive. + * boolean: whether to count integer-part trailing zeros: true or false. + * [rm] {number} Rounding mode. Integer, 0 to 8 inclusive. + * + * '[BigNumber Error] Argument {not a primitive number|not an integer|out of range}: {sd|rm}' + */ + P.precision = P.sd = function (sd, rm) { + var c, n, v, + x = this; + + if (sd != null && sd !== !!sd) { + intCheck(sd, 1, MAX); + if (rm == null) rm = ROUNDING_MODE; + else intCheck(rm, 0, 8); + + return round(new BigNumber(x), sd, rm); + } + + if (!(c = x.c)) return null; + v = c.length - 1; + n = v * LOG_BASE + 1; + + if (v = c[v]) { + + // Subtract the number of trailing zeros of the last element. + for (; v % 10 == 0; v /= 10, n--); + + // Add the number of digits of the first element. + for (v = c[0]; v >= 10; v /= 10, n++); + } + + if (sd && x.e + 1 > n) n = x.e + 1; + + return n; + }; + + + /* + * Return a new BigNumber whose value is the value of this BigNumber shifted by k places + * (powers of 10). Shift to the right if n > 0, and to the left if n < 0. + * + * k {number} Integer, -MAX_SAFE_INTEGER to MAX_SAFE_INTEGER inclusive. + * + * '[BigNumber Error] Argument {not a primitive number|not an integer|out of range}: {k}' + */ + P.shiftedBy = function (k) { + intCheck(k, -MAX_SAFE_INTEGER, MAX_SAFE_INTEGER); + return this.times('1e' + k); + }; + + + /* + * sqrt(-n) = N + * sqrt(N) = N + * sqrt(-I) = N + * sqrt(I) = I + * sqrt(0) = 0 + * sqrt(-0) = -0 + * + * Return a new BigNumber whose value is the square root of the value of this BigNumber, + * rounded according to DECIMAL_PLACES and ROUNDING_MODE. + */ + P.squareRoot = P.sqrt = function () { + var m, n, r, rep, t, + x = this, + c = x.c, + s = x.s, + e = x.e, + dp = DECIMAL_PLACES + 4, + half = new BigNumber('0.5'); + + // Negative/NaN/Infinity/zero? + if (s !== 1 || !c || !c[0]) { + return new BigNumber(!s || s < 0 && (!c || c[0]) ? NaN : c ? x : 1 / 0); + } + + // Initial estimate. + s = Math.sqrt(+x); + + // Math.sqrt underflow/overflow? + // Pass x to Math.sqrt as integer, then adjust the exponent of the result. + if (s == 0 || s == 1 / 0) { + n = coeffToString(c); + if ((n.length + e) % 2 == 0) n += '0'; + s = Math.sqrt(n); + e = bitFloor((e + 1) / 2) - (e < 0 || e % 2); + + if (s == 1 / 0) { + n = '1e' + e; + } else { + n = s.toExponential(); + n = n.slice(0, n.indexOf('e') + 1) + e; + } + + r = new BigNumber(n); + } else { + r = new BigNumber(s + ''); + } + + // Check for zero. + // r could be zero if MIN_EXP is changed after the this value was created. + // This would cause a division by zero (x/t) and hence Infinity below, which would cause + // coeffToString to throw. + if (r.c[0]) { + e = r.e; + s = e + dp; + if (s < 3) s = 0; + + // Newton-Raphson iteration. + for (; ;) { + t = r; + r = half.times(t.plus(div(x, t, dp, 1))); + + if (coeffToString(t.c ).slice(0, s) === (n = + coeffToString(r.c)).slice(0, s)) { + + // The exponent of r may here be one less than the final result exponent, + // e.g 0.0009999 (e-4) --> 0.001 (e-3), so adjust s so the rounding digits + // are indexed correctly. + if (r.e < e) --s; + n = n.slice(s - 3, s + 1); + + // The 4th rounding digit may be in error by -1 so if the 4 rounding digits + // are 9999 or 4999 (i.e. approaching a rounding boundary) continue the + // iteration. + if (n == '9999' || !rep && n == '4999') { + + // On the first iteration only, check to see if rounding up gives the + // exact result as the nines may infinitely repeat. + if (!rep) { + round(t, t.e + DECIMAL_PLACES + 2, 0); + + if (t.times(t).eq(x)) { + r = t; + break; + } + } + + dp += 4; + s += 4; + rep = 1; + } else { + + // If rounding digits are null, 0{0,4} or 50{0,3}, check for exact + // result. If not, then there are further digits and m will be truthy. + if (!+n || !+n.slice(1) && n.charAt(0) == '5') { + + // Truncate to the first rounding digit. + round(r, r.e + DECIMAL_PLACES + 2, 1); + m = !r.times(r).eq(x); + } + + break; + } + } + } + } + + return round(r, r.e + DECIMAL_PLACES + 1, ROUNDING_MODE, m); + }; + + + /* + * Return a string representing the value of this BigNumber in exponential notation and + * rounded using ROUNDING_MODE to dp fixed decimal places. + * + * [dp] {number} Decimal places. Integer, 0 to MAX inclusive. + * [rm] {number} Rounding mode. Integer, 0 to 8 inclusive. + * + * '[BigNumber Error] Argument {not a primitive number|not an integer|out of range}: {dp|rm}' + */ + P.toExponential = function (dp, rm) { + if (dp != null) { + intCheck(dp, 0, MAX); + dp++; + } + return format(this, dp, rm, 1); + }; + + + /* + * Return a string representing the value of this BigNumber in fixed-point notation rounding + * to dp fixed decimal places using rounding mode rm, or ROUNDING_MODE if rm is omitted. + * + * Note: as with JavaScript's number type, (-0).toFixed(0) is '0', + * but e.g. (-0.00001).toFixed(0) is '-0'. + * + * [dp] {number} Decimal places. Integer, 0 to MAX inclusive. + * [rm] {number} Rounding mode. Integer, 0 to 8 inclusive. + * + * '[BigNumber Error] Argument {not a primitive number|not an integer|out of range}: {dp|rm}' + */ + P.toFixed = function (dp, rm) { + if (dp != null) { + intCheck(dp, 0, MAX); + dp = dp + this.e + 1; + } + return format(this, dp, rm); + }; + + + /* + * Return a string representing the value of this BigNumber in fixed-point notation rounded + * using rm or ROUNDING_MODE to dp decimal places, and formatted according to the properties + * of the FORMAT object (see BigNumber.set). + * + * FORMAT = { + * decimalSeparator : '.', + * groupSeparator : ',', + * groupSize : 3, + * secondaryGroupSize : 0, + * fractionGroupSeparator : '\xA0', // non-breaking space + * fractionGroupSize : 0 + * }; + * + * [dp] {number} Decimal places. Integer, 0 to MAX inclusive. + * [rm] {number} Rounding mode. Integer, 0 to 8 inclusive. + * + * '[BigNumber Error] Argument {not a primitive number|not an integer|out of range}: {dp|rm}' + */ + P.toFormat = function (dp, rm) { + var str = this.toFixed(dp, rm); + + if (this.c) { + var i, + arr = str.split('.'), + g1 = +FORMAT.groupSize, + g2 = +FORMAT.secondaryGroupSize, + groupSeparator = FORMAT.groupSeparator, + intPart = arr[0], + fractionPart = arr[1], + isNeg = this.s < 0, + intDigits = isNeg ? intPart.slice(1) : intPart, + len = intDigits.length; + + if (g2) i = g1, g1 = g2, g2 = i, len -= i; + + if (g1 > 0 && len > 0) { + i = len % g1 || g1; + intPart = intDigits.substr(0, i); + + for (; i < len; i += g1) { + intPart += groupSeparator + intDigits.substr(i, g1); + } + + if (g2 > 0) intPart += groupSeparator + intDigits.slice(i); + if (isNeg) intPart = '-' + intPart; + } + + str = fractionPart + ? intPart + FORMAT.decimalSeparator + ((g2 = +FORMAT.fractionGroupSize) + ? fractionPart.replace(new RegExp('\\d{' + g2 + '}\\B', 'g'), + '$&' + FORMAT.fractionGroupSeparator) + : fractionPart) + : intPart; + } + + return str; + }; + + + /* + * Return a string array representing the value of this BigNumber as a simple fraction with + * an integer numerator and an integer denominator. The denominator will be a positive + * non-zero value less than or equal to the specified maximum denominator. If a maximum + * denominator is not specified, the denominator will be the lowest value necessary to + * represent the number exactly. + * + * [md] {number|string|BigNumber} Integer >= 1, or Infinity. The maximum denominator. + * + * '[BigNumber Error] Argument {not an integer|out of range} : {md}' + */ + P.toFraction = function (md) { + var arr, d, d0, d1, d2, e, exp, n, n0, n1, q, s, + x = this, + xc = x.c; + + if (md != null) { + n = new BigNumber(md); + + // Throw if md is less than one or is not an integer, unless it is Infinity. + if (!n.isInteger() && (n.c || n.s !== 1) || n.lt(ONE)) { + throw Error + (bignumberError + 'Argument ' + + (n.isInteger() ? 'out of range: ' : 'not an integer: ') + md); + } + } + + if (!xc) return x.toString(); + + d = new BigNumber(ONE); + n1 = d0 = new BigNumber(ONE); + d1 = n0 = new BigNumber(ONE); + s = coeffToString(xc); + + // Determine initial denominator. + // d is a power of 10 and the minimum max denominator that specifies the value exactly. + e = d.e = s.length - x.e - 1; + d.c[0] = POWS_TEN[(exp = e % LOG_BASE) < 0 ? LOG_BASE + exp : exp]; + md = !md || n.comparedTo(d) > 0 ? (e > 0 ? d : n1) : n; + + exp = MAX_EXP; + MAX_EXP = 1 / 0; + n = new BigNumber(s); + + // n0 = d1 = 0 + n0.c[0] = 0; + + for (; ;) { + q = div(n, d, 0, 1); + d2 = d0.plus(q.times(d1)); + if (d2.comparedTo(md) == 1) break; + d0 = d1; + d1 = d2; + n1 = n0.plus(q.times(d2 = n1)); + n0 = d2; + d = n.minus(q.times(d2 = d)); + n = d2; + } + + d2 = div(md.minus(d0), d1, 0, 1); + n0 = n0.plus(d2.times(n1)); + d0 = d0.plus(d2.times(d1)); + n0.s = n1.s = x.s; + e *= 2; + + // Determine which fraction is closer to x, n0/d0 or n1/d1 + arr = div(n1, d1, e, ROUNDING_MODE).minus(x).abs().comparedTo( + div(n0, d0, e, ROUNDING_MODE).minus(x).abs()) < 1 + ? [n1.toString(), d1.toString()] + : [n0.toString(), d0.toString()]; + + MAX_EXP = exp; + return arr; + }; + + + /* + * Return the value of this BigNumber converted to a number primitive. + */ + P.toNumber = function () { + return +this; + }; + + + /* + * Return a string representing the value of this BigNumber rounded to sd significant digits + * using rounding mode rm or ROUNDING_MODE. If sd is less than the number of digits + * necessary to represent the integer part of the value in fixed-point notation, then use + * exponential notation. + * + * [sd] {number} Significant digits. Integer, 1 to MAX inclusive. + * [rm] {number} Rounding mode. Integer, 0 to 8 inclusive. + * + * '[BigNumber Error] Argument {not a primitive number|not an integer|out of range}: {sd|rm}' + */ + P.toPrecision = function (sd, rm) { + if (sd != null) intCheck(sd, 1, MAX); + return format(this, sd, rm, 2); + }; + + + /* + * Return a string representing the value of this BigNumber in base b, or base 10 if b is + * omitted. If a base is specified, including base 10, round according to DECIMAL_PLACES and + * ROUNDING_MODE. If a base is not specified, and this BigNumber has a positive exponent + * that is equal to or greater than TO_EXP_POS, or a negative exponent equal to or less than + * TO_EXP_NEG, return exponential notation. + * + * [b] {number} Integer, 2 to ALPHABET.length inclusive. + * + * '[BigNumber Error] Base {not a primitive number|not an integer|out of range}: {b}' + */ + P.toString = function (b) { + var str, + n = this, + s = n.s, + e = n.e; + + // Infinity or NaN? + if (e === null) { + + if (s) { + str = 'Infinity'; + if (s < 0) str = '-' + str; + } else { + str = 'NaN'; + } + } else { + str = coeffToString(n.c); + + if (b == null) { + str = e <= TO_EXP_NEG || e >= TO_EXP_POS + ? toExponential(str, e) + : toFixedPoint(str, e, '0'); + } else { + intCheck(b, 2, ALPHABET.length, 'Base'); + str = convertBase(toFixedPoint(str, e, '0'), 10, b, s, true); + } + + if (s < 0 && n.c[0]) str = '-' + str; + } + + return str; + }; + + + /* + * Return as toString, but do not accept a base argument, and include the minus sign for + * negative zero. + */ + P.valueOf = P.toJSON = function () { + var str, + n = this, + e = n.e; + + if (e === null) return n.toString(); + + str = coeffToString(n.c); + + str = e <= TO_EXP_NEG || e >= TO_EXP_POS + ? toExponential(str, e) + : toFixedPoint(str, e, '0'); + + return n.s < 0 ? '-' + str : str; + }; + + + P._isBigNumber = true; + + if (configObject != null) BigNumber.set(configObject); + + return BigNumber; + } + + + // PRIVATE HELPER FUNCTIONS + + + function bitFloor(n) { + var i = n | 0; + return n > 0 || n === i ? i : i - 1; + } + + + // Return a coefficient array as a string of base 10 digits. + function coeffToString(a) { + var s, z, + i = 1, + j = a.length, + r = a[0] + ''; + + for (; i < j;) { + s = a[i++] + ''; + z = LOG_BASE - s.length; + for (; z--; s = '0' + s); + r += s; + } + + // Determine trailing zeros. + for (j = r.length; r.charCodeAt(--j) === 48;); + return r.slice(0, j + 1 || 1); + } + + + // Compare the value of BigNumbers x and y. + function compare(x, y) { + var a, b, + xc = x.c, + yc = y.c, + i = x.s, + j = y.s, + k = x.e, + l = y.e; + + // Either NaN? + if (!i || !j) return null; + + a = xc && !xc[0]; + b = yc && !yc[0]; + + // Either zero? + if (a || b) return a ? b ? 0 : -j : i; + + // Signs differ? + if (i != j) return i; + + a = i < 0; + b = k == l; + + // Either Infinity? + if (!xc || !yc) return b ? 0 : !xc ^ a ? 1 : -1; + + // Compare exponents. + if (!b) return k > l ^ a ? 1 : -1; + + j = (k = xc.length) < (l = yc.length) ? k : l; + + // Compare digit by digit. + for (i = 0; i < j; i++) if (xc[i] != yc[i]) return xc[i] > yc[i] ^ a ? 1 : -1; + + // Compare lengths. + return k == l ? 0 : k > l ^ a ? 1 : -1; + } + + + /* + * Check that n is a primitive number, an integer, and in range, otherwise throw. + */ + function intCheck(n, min, max, name) { + if (n < min || n > max || n !== (n < 0 ? mathceil(n) : mathfloor(n))) { + throw Error + (bignumberError + (name || 'Argument') + (typeof n == 'number' + ? n < min || n > max ? ' out of range: ' : ' not an integer: ' + : ' not a primitive number: ') + n); + } + } + + + function isArray(obj) { + return Object.prototype.toString.call(obj) == '[object Array]'; + } + + + // Assumes finite n. + function isOdd(n) { + var k = n.c.length - 1; + return bitFloor(n.e / LOG_BASE) == k && n.c[k] % 2 != 0; + } + + + function toExponential(str, e) { + return (str.length > 1 ? str.charAt(0) + '.' + str.slice(1) : str) + + (e < 0 ? 'e' : 'e+') + e; + } + + + function toFixedPoint(str, e, z) { + var len, zs; + + // Negative exponent? + if (e < 0) { + + // Prepend zeros. + for (zs = z + '.'; ++e; zs += z); + str = zs + str; + + // Positive exponent + } else { + len = str.length; + + // Append zeros. + if (++e > len) { + for (zs = z, e -= len; --e; zs += z); + str += zs; + } else if (e < len) { + str = str.slice(0, e) + '.' + str.slice(e); + } + } + + return str; + } + + + // EXPORT + + + BigNumber = clone(); + BigNumber['default'] = BigNumber.BigNumber = BigNumber; + + // AMD. + if (typeof undefined == 'function' && undefined.amd) { + undefined(function () { return BigNumber; }); + + // Node.js and other environments that support module.exports. + } else if ('object' != 'undefined' && module.exports) { + module.exports = BigNumber; + + // Browser. + } else { + if (!globalObject) { + globalObject = typeof self != 'undefined' && self ? self : window; + } + + globalObject.BigNumber = BigNumber; + } +})(commonjsGlobal); +}); + +var constants = createCommonjsModule(function (module, exports) { +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +class Constants { +} +Constants.SYS_NUM_CARDINAL = "builtin.num.cardinal"; +Constants.SYS_NUM_DOUBLE = "builtin.num.double"; +Constants.SYS_NUM_FRACTION = "builtin.num.fraction"; +Constants.SYS_NUM_INTEGER = "builtin.num.integer"; +Constants.SYS_NUM = "builtin.num"; +Constants.SYS_NUM_ORDINAL = "builtin.num.ordinal"; +Constants.SYS_NUM_PERCENTAGE = "builtin.num.percentage"; +// NARROW NO-BREAK SPACE +Constants.NO_BREAK_SPACE = '\u202f'; +exports.Constants = Constants; + +}); + +unwrapExports(constants); + +var models$2 = createCommonjsModule(function (module, exports) { +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); + +var NumberMode; +(function (NumberMode) { + // Default is for unit and datetime + NumberMode[NumberMode["Default"] = 0] = "Default"; + // Add 67.5 billion & million support. + NumberMode[NumberMode["Currency"] = 1] = "Currency"; + // Don't extract number from cases like 16ml + NumberMode[NumberMode["PureNumber"] = 2] = "PureNumber"; +})(NumberMode = exports.NumberMode || (exports.NumberMode = {})); +class LongFormatType { + constructor(thousandsMark, decimalsMark) { + this.thousandsMark = thousandsMark; + this.decimalsMark = decimalsMark; + } +} +// Reference : https://www.wikiwand.com/en/Decimal_mark +// Value : 1234567.89 +// 1,234,567 +LongFormatType.integerNumComma = new LongFormatType(',', '\0'); +// 1.234.567 +LongFormatType.integerNumDot = new LongFormatType('.', '\0'); +// 1 234 567 +LongFormatType.integerNumBlank = new LongFormatType(' ', '\0'); +// 1 234 567 +LongFormatType.integerNumNoBreakSpace = new LongFormatType(constants.Constants.NO_BREAK_SPACE, '\0'); +// 1'234'567 +LongFormatType.integerNumQuote = new LongFormatType('\'', '\0'); +// 1,234,567.89 +LongFormatType.doubleNumCommaDot = new LongFormatType(',', '.'); +// 1,234,567·89 +LongFormatType.doubleNumCommaCdot = new LongFormatType(',', '·'); +// 1 234 567,89 +LongFormatType.doubleNumBlankComma = new LongFormatType(' ', ','); +// 1 234 567,89 +LongFormatType.doubleNumNoBreakSpaceComma = new LongFormatType(constants.Constants.NO_BREAK_SPACE, ','); +// 1 234 567.89 +LongFormatType.doubleNumBlankDot = new LongFormatType(' ', '.'); +// 1 234 567.89 +LongFormatType.doubleNumNoBreakSpaceDot = new LongFormatType(constants.Constants.NO_BREAK_SPACE, '.'); +// 1.234.567,89 +LongFormatType.doubleNumDotComma = new LongFormatType('.', ','); +// 1'234'567,89 +LongFormatType.doubleNumQuoteComma = new LongFormatType('\'', ','); +exports.LongFormatType = LongFormatType; +class AbstractNumberModel { + constructor(parser, extractor) { + this.extractor = extractor; + this.parser = parser; + } + parse(query) { + let extractResults = this.extractor.extract(query); + let parseNums = extractResults.map(r => this.parser.parse(r)); + return parseNums + .map(o => o) + .map(o => ({ + start: o.start, + end: o.start + o.length - 1, + resolution: { value: o.resolutionStr }, + text: o.text, + typeName: this.modelTypeName + })); + } +} +exports.AbstractNumberModel = AbstractNumberModel; +class NumberModel extends AbstractNumberModel { + constructor() { + super(...arguments); + this.modelTypeName = "number"; + } +} +exports.NumberModel = NumberModel; +class OrdinalModel extends AbstractNumberModel { + constructor() { + super(...arguments); + this.modelTypeName = "ordinal"; + } +} +exports.OrdinalModel = OrdinalModel; +class PercentModel extends AbstractNumberModel { + constructor() { + super(...arguments); + this.modelTypeName = "percentage"; + } +} +exports.PercentModel = PercentModel; + +}); + +unwrapExports(models$2); + +var culture$2 = createCommonjsModule(function (module, exports) { +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); + + + + +class Culture extends recognizersText.Culture { + constructor(cultureName, cultureCode, longFormat) { + super(cultureName, cultureCode); + this.longFormat = longFormat; + } +} +Culture.supportedCultures = [ + new Culture("English", Culture.English, new models$2.LongFormatType(',', '.')), + new Culture("Chinese", Culture.Chinese, null), + new Culture("Spanish", Culture.Spanish, new models$2.LongFormatType('.', ',')), + new Culture("Portuguese", Culture.Portuguese, new models$2.LongFormatType('.', ',')), + new Culture("French", Culture.French, new models$2.LongFormatType('.', ',')), + new Culture("Japanese", Culture.Japanese, new models$2.LongFormatType(',', '.')) +]; +exports.Culture = Culture; +class CultureInfo extends recognizersText.CultureInfo { + format(value) { + let bigNumber = new bignumber.BigNumber(value); + let s; + if (bigNumber.decimalPlaces()) { + s = bigNumber.precision(15, bignumber.BigNumber.ROUND_HALF_UP).toString(); + } + else { + s = bigNumber.toString().toUpperCase(); + } + if (s.indexOf('.') > -1) { + // trim leading 0 from decimal places + s = lodash_trimend(s, '0'); + } + if (s.indexOf('e-') > -1) { + // mimic .NET behavior by adding leading 0 to exponential. E.g.: 1E-07 + let p = s.split('e-'); + p[1] = p[1].length === 1 ? ('0' + p[1]) : p[1]; + s = p.join('E-'); + } + // TODO: Use BigNumber.toFormat instead + let culture = Culture.supportedCultures.find(c => c.cultureCode === this.code); + if (culture && culture.longFormat) { + return s + .split(',') + .map(t => t.split('.').join(culture.longFormat.decimalsMark)) + .join(culture.longFormat.thousandsMark); + } + return s; + } +} +exports.CultureInfo = CultureInfo; + +}); + +unwrapExports(culture$2); + +var lodash_sortby = createCommonjsModule(function (module, exports) { +/** + * lodash (Custom Build) + * Build: `lodash modularize exports="npm" -o ./` + * Copyright jQuery Foundation and other contributors + * Released under MIT license + * Based on Underscore.js 1.8.3 + * Copyright Jeremy Ashkenas, DocumentCloud and Investigative Reporters & Editors + */ + +/** Used as the size to enable large array optimizations. */ +var LARGE_ARRAY_SIZE = 200; + +/** Used as the `TypeError` message for "Functions" methods. */ +var FUNC_ERROR_TEXT = 'Expected a function'; + +/** Used to stand-in for `undefined` hash values. */ +var HASH_UNDEFINED = '__lodash_hash_undefined__'; + +/** Used to compose bitmasks for comparison styles. */ +var UNORDERED_COMPARE_FLAG = 1, + PARTIAL_COMPARE_FLAG = 2; + +/** Used as references for various `Number` constants. */ +var INFINITY = 1 / 0, + MAX_SAFE_INTEGER = 9007199254740991; + +/** `Object#toString` result references. */ +var argsTag = '[object Arguments]', + arrayTag = '[object Array]', + boolTag = '[object Boolean]', + dateTag = '[object Date]', + errorTag = '[object Error]', + funcTag = '[object Function]', + genTag = '[object GeneratorFunction]', + mapTag = '[object Map]', + numberTag = '[object Number]', + objectTag = '[object Object]', + promiseTag = '[object Promise]', + regexpTag = '[object RegExp]', + setTag = '[object Set]', + stringTag = '[object String]', + symbolTag = '[object Symbol]', + weakMapTag = '[object WeakMap]'; + +var arrayBufferTag = '[object ArrayBuffer]', + dataViewTag = '[object DataView]', + float32Tag = '[object Float32Array]', + float64Tag = '[object Float64Array]', + int8Tag = '[object Int8Array]', + int16Tag = '[object Int16Array]', + int32Tag = '[object Int32Array]', + uint8Tag = '[object Uint8Array]', + uint8ClampedTag = '[object Uint8ClampedArray]', + uint16Tag = '[object Uint16Array]', + uint32Tag = '[object Uint32Array]'; + +/** Used to match property names within property paths. */ +var reIsDeepProp = /\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/, + reIsPlainProp = /^\w*$/, + reLeadingDot = /^\./, + rePropName = /[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g; + +/** + * Used to match `RegExp` + * [syntax characters](http://ecma-international.org/ecma-262/7.0/#sec-patterns). + */ +var reRegExpChar = /[\\^$.*+?()[\]{}|]/g; + +/** Used to match backslashes in property paths. */ +var reEscapeChar = /\\(\\)?/g; + +/** Used to detect host constructors (Safari). */ +var reIsHostCtor = /^\[object .+?Constructor\]$/; + +/** Used to detect unsigned integer values. */ +var reIsUint = /^(?:0|[1-9]\d*)$/; + +/** Used to identify `toStringTag` values of typed arrays. */ +var typedArrayTags = {}; +typedArrayTags[float32Tag] = typedArrayTags[float64Tag] = +typedArrayTags[int8Tag] = typedArrayTags[int16Tag] = +typedArrayTags[int32Tag] = typedArrayTags[uint8Tag] = +typedArrayTags[uint8ClampedTag] = typedArrayTags[uint16Tag] = +typedArrayTags[uint32Tag] = true; +typedArrayTags[argsTag] = typedArrayTags[arrayTag] = +typedArrayTags[arrayBufferTag] = typedArrayTags[boolTag] = +typedArrayTags[dataViewTag] = typedArrayTags[dateTag] = +typedArrayTags[errorTag] = typedArrayTags[funcTag] = +typedArrayTags[mapTag] = typedArrayTags[numberTag] = +typedArrayTags[objectTag] = typedArrayTags[regexpTag] = +typedArrayTags[setTag] = typedArrayTags[stringTag] = +typedArrayTags[weakMapTag] = false; + +/** Detect free variable `global` from Node.js. */ +var freeGlobal = typeof commonjsGlobal == 'object' && commonjsGlobal && commonjsGlobal.Object === Object && commonjsGlobal; + +/** Detect free variable `self`. */ +var freeSelf = typeof self == 'object' && self && self.Object === Object && self; + +/** Used as a reference to the global object. */ +var root = freeGlobal || freeSelf || Function('return this')(); + +/** Detect free variable `exports`. */ +var freeExports = 'object' == 'object' && exports && !exports.nodeType && exports; + +/** Detect free variable `module`. */ +var freeModule = freeExports && 'object' == 'object' && module && !module.nodeType && module; + +/** Detect the popular CommonJS extension `module.exports`. */ +var moduleExports = freeModule && freeModule.exports === freeExports; + +/** Detect free variable `process` from Node.js. */ +var freeProcess = moduleExports && freeGlobal.process; + +/** Used to access faster Node.js helpers. */ +var nodeUtil = (function() { + try { + return freeProcess && freeProcess.binding('util'); + } catch (e) {} +}()); + +/* Node.js helper references. */ +var nodeIsTypedArray = nodeUtil && nodeUtil.isTypedArray; + +/** + * A faster alternative to `Function#apply`, this function invokes `func` + * with the `this` binding of `thisArg` and the arguments of `args`. + * + * @private + * @param {Function} func The function to invoke. + * @param {*} thisArg The `this` binding of `func`. + * @param {Array} args The arguments to invoke `func` with. + * @returns {*} Returns the result of `func`. + */ +function apply(func, thisArg, args) { + switch (args.length) { + case 0: return func.call(thisArg); + case 1: return func.call(thisArg, args[0]); + case 2: return func.call(thisArg, args[0], args[1]); + case 3: return func.call(thisArg, args[0], args[1], args[2]); + } + return func.apply(thisArg, args); +} + +/** + * A specialized version of `_.map` for arrays without support for iteratee + * shorthands. + * + * @private + * @param {Array} [array] The array to iterate over. + * @param {Function} iteratee The function invoked per iteration. + * @returns {Array} Returns the new mapped array. + */ +function arrayMap(array, iteratee) { + var index = -1, + length = array ? array.length : 0, + result = Array(length); + + while (++index < length) { + result[index] = iteratee(array[index], index, array); + } + return result; +} + +/** + * Appends the elements of `values` to `array`. + * + * @private + * @param {Array} array The array to modify. + * @param {Array} values The values to append. + * @returns {Array} Returns `array`. + */ +function arrayPush(array, values) { + var index = -1, + length = values.length, + offset = array.length; + + while (++index < length) { + array[offset + index] = values[index]; + } + return array; +} + +/** + * A specialized version of `_.some` for arrays without support for iteratee + * shorthands. + * + * @private + * @param {Array} [array] The array to iterate over. + * @param {Function} predicate The function invoked per iteration. + * @returns {boolean} Returns `true` if any element passes the predicate check, + * else `false`. + */ +function arraySome(array, predicate) { + var index = -1, + length = array ? array.length : 0; + + while (++index < length) { + if (predicate(array[index], index, array)) { + return true; + } + } + return false; +} + +/** + * The base implementation of `_.property` without support for deep paths. + * + * @private + * @param {string} key The key of the property to get. + * @returns {Function} Returns the new accessor function. + */ +function baseProperty(key) { + return function(object) { + return object == null ? undefined : object[key]; + }; +} + +/** + * The base implementation of `_.sortBy` which uses `comparer` to define the + * sort order of `array` and replaces criteria objects with their corresponding + * values. + * + * @private + * @param {Array} array The array to sort. + * @param {Function} comparer The function to define sort order. + * @returns {Array} Returns `array`. + */ +function baseSortBy(array, comparer) { + var length = array.length; + + array.sort(comparer); + while (length--) { + array[length] = array[length].value; + } + return array; +} + +/** + * The base implementation of `_.times` without support for iteratee shorthands + * or max array length checks. + * + * @private + * @param {number} n The number of times to invoke `iteratee`. + * @param {Function} iteratee The function invoked per iteration. + * @returns {Array} Returns the array of results. + */ +function baseTimes(n, iteratee) { + var index = -1, + result = Array(n); + + while (++index < n) { + result[index] = iteratee(index); + } + return result; +} + +/** + * The base implementation of `_.unary` without support for storing metadata. + * + * @private + * @param {Function} func The function to cap arguments for. + * @returns {Function} Returns the new capped function. + */ +function baseUnary(func) { + return function(value) { + return func(value); + }; +} + +/** + * Gets the value at `key` of `object`. + * + * @private + * @param {Object} [object] The object to query. + * @param {string} key The key of the property to get. + * @returns {*} Returns the property value. + */ +function getValue(object, key) { + return object == null ? undefined : object[key]; +} + +/** + * Checks if `value` is a host object in IE < 9. + * + * @private + * @param {*} value The value to check. + * @returns {boolean} Returns `true` if `value` is a host object, else `false`. + */ +function isHostObject(value) { + // Many host objects are `Object` objects that can coerce to strings + // despite having improperly defined `toString` methods. + var result = false; + if (value != null && typeof value.toString != 'function') { + try { + result = !!(value + ''); + } catch (e) {} + } + return result; +} + +/** + * Converts `map` to its key-value pairs. + * + * @private + * @param {Object} map The map to convert. + * @returns {Array} Returns the key-value pairs. + */ +function mapToArray(map) { + var index = -1, + result = Array(map.size); + + map.forEach(function(value, key) { + result[++index] = [key, value]; + }); + return result; +} + +/** + * Creates a unary function that invokes `func` with its argument transformed. + * + * @private + * @param {Function} func The function to wrap. + * @param {Function} transform The argument transform. + * @returns {Function} Returns the new function. + */ +function overArg(func, transform) { + return function(arg) { + return func(transform(arg)); + }; +} + +/** + * Converts `set` to an array of its values. + * + * @private + * @param {Object} set The set to convert. + * @returns {Array} Returns the values. + */ +function setToArray(set) { + var index = -1, + result = Array(set.size); + + set.forEach(function(value) { + result[++index] = value; + }); + return result; +} + +/** Used for built-in method references. */ +var arrayProto = Array.prototype, + funcProto = Function.prototype, + objectProto = Object.prototype; + +/** Used to detect overreaching core-js shims. */ +var coreJsData = root['__core-js_shared__']; + +/** Used to detect methods masquerading as native. */ +var maskSrcKey = (function() { + var uid = /[^.]+$/.exec(coreJsData && coreJsData.keys && coreJsData.keys.IE_PROTO || ''); + return uid ? ('Symbol(src)_1.' + uid) : ''; +}()); + +/** Used to resolve the decompiled source of functions. */ +var funcToString = funcProto.toString; + +/** Used to check objects for own properties. */ +var hasOwnProperty = objectProto.hasOwnProperty; + +/** + * Used to resolve the + * [`toStringTag`](http://ecma-international.org/ecma-262/7.0/#sec-object.prototype.tostring) + * of values. + */ +var objectToString = objectProto.toString; + +/** Used to detect if a method is native. */ +var reIsNative = RegExp('^' + + funcToString.call(hasOwnProperty).replace(reRegExpChar, '\\$&') + .replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g, '$1.*?') + '$' +); + +/** Built-in value references. */ +var Symbol = root.Symbol, + Uint8Array = root.Uint8Array, + propertyIsEnumerable = objectProto.propertyIsEnumerable, + splice = arrayProto.splice, + spreadableSymbol = Symbol ? Symbol.isConcatSpreadable : undefined; + +/* Built-in method references for those with the same name as other `lodash` methods. */ +var nativeKeys = overArg(Object.keys, Object), + nativeMax = Math.max; + +/* Built-in method references that are verified to be native. */ +var DataView = getNative(root, 'DataView'), + Map = getNative(root, 'Map'), + Promise = getNative(root, 'Promise'), + Set = getNative(root, 'Set'), + WeakMap = getNative(root, 'WeakMap'), + nativeCreate = getNative(Object, 'create'); + +/** Used to detect maps, sets, and weakmaps. */ +var dataViewCtorString = toSource(DataView), + mapCtorString = toSource(Map), + promiseCtorString = toSource(Promise), + setCtorString = toSource(Set), + weakMapCtorString = toSource(WeakMap); + +/** Used to convert symbols to primitives and strings. */ +var symbolProto = Symbol ? Symbol.prototype : undefined, + symbolValueOf = symbolProto ? symbolProto.valueOf : undefined, + symbolToString = symbolProto ? symbolProto.toString : undefined; + +/** + * Creates a hash object. + * + * @private + * @constructor + * @param {Array} [entries] The key-value pairs to cache. + */ +function Hash(entries) { + var index = -1, + length = entries ? entries.length : 0; + + this.clear(); + while (++index < length) { + var entry = entries[index]; + this.set(entry[0], entry[1]); + } +} + +/** + * Removes all key-value entries from the hash. + * + * @private + * @name clear + * @memberOf Hash + */ +function hashClear() { + this.__data__ = nativeCreate ? nativeCreate(null) : {}; +} + +/** + * Removes `key` and its value from the hash. + * + * @private + * @name delete + * @memberOf Hash + * @param {Object} hash The hash to modify. + * @param {string} key The key of the value to remove. + * @returns {boolean} Returns `true` if the entry was removed, else `false`. + */ +function hashDelete(key) { + return this.has(key) && delete this.__data__[key]; +} + +/** + * Gets the hash value for `key`. + * + * @private + * @name get + * @memberOf Hash + * @param {string} key The key of the value to get. + * @returns {*} Returns the entry value. + */ +function hashGet(key) { + var data = this.__data__; + if (nativeCreate) { + var result = data[key]; + return result === HASH_UNDEFINED ? undefined : result; + } + return hasOwnProperty.call(data, key) ? data[key] : undefined; +} + +/** + * Checks if a hash value for `key` exists. + * + * @private + * @name has + * @memberOf Hash + * @param {string} key The key of the entry to check. + * @returns {boolean} Returns `true` if an entry for `key` exists, else `false`. + */ +function hashHas(key) { + var data = this.__data__; + return nativeCreate ? data[key] !== undefined : hasOwnProperty.call(data, key); +} + +/** + * Sets the hash `key` to `value`. + * + * @private + * @name set + * @memberOf Hash + * @param {string} key The key of the value to set. + * @param {*} value The value to set. + * @returns {Object} Returns the hash instance. + */ +function hashSet(key, value) { + var data = this.__data__; + data[key] = (nativeCreate && value === undefined) ? HASH_UNDEFINED : value; + return this; +} + +// Add methods to `Hash`. +Hash.prototype.clear = hashClear; +Hash.prototype['delete'] = hashDelete; +Hash.prototype.get = hashGet; +Hash.prototype.has = hashHas; +Hash.prototype.set = hashSet; + +/** + * Creates an list cache object. + * + * @private + * @constructor + * @param {Array} [entries] The key-value pairs to cache. + */ +function ListCache(entries) { + var index = -1, + length = entries ? entries.length : 0; + + this.clear(); + while (++index < length) { + var entry = entries[index]; + this.set(entry[0], entry[1]); + } +} + +/** + * Removes all key-value entries from the list cache. + * + * @private + * @name clear + * @memberOf ListCache + */ +function listCacheClear() { + this.__data__ = []; +} + +/** + * Removes `key` and its value from the list cache. + * + * @private + * @name delete + * @memberOf ListCache + * @param {string} key The key of the value to remove. + * @returns {boolean} Returns `true` if the entry was removed, else `false`. + */ +function listCacheDelete(key) { + var data = this.__data__, + index = assocIndexOf(data, key); + + if (index < 0) { + return false; + } + var lastIndex = data.length - 1; + if (index == lastIndex) { + data.pop(); + } else { + splice.call(data, index, 1); + } + return true; +} + +/** + * Gets the list cache value for `key`. + * + * @private + * @name get + * @memberOf ListCache + * @param {string} key The key of the value to get. + * @returns {*} Returns the entry value. + */ +function listCacheGet(key) { + var data = this.__data__, + index = assocIndexOf(data, key); + + return index < 0 ? undefined : data[index][1]; +} + +/** + * Checks if a list cache value for `key` exists. + * + * @private + * @name has + * @memberOf ListCache + * @param {string} key The key of the entry to check. + * @returns {boolean} Returns `true` if an entry for `key` exists, else `false`. + */ +function listCacheHas(key) { + return assocIndexOf(this.__data__, key) > -1; +} + +/** + * Sets the list cache `key` to `value`. + * + * @private + * @name set + * @memberOf ListCache + * @param {string} key The key of the value to set. + * @param {*} value The value to set. + * @returns {Object} Returns the list cache instance. + */ +function listCacheSet(key, value) { + var data = this.__data__, + index = assocIndexOf(data, key); + + if (index < 0) { + data.push([key, value]); + } else { + data[index][1] = value; + } + return this; +} + +// Add methods to `ListCache`. +ListCache.prototype.clear = listCacheClear; +ListCache.prototype['delete'] = listCacheDelete; +ListCache.prototype.get = listCacheGet; +ListCache.prototype.has = listCacheHas; +ListCache.prototype.set = listCacheSet; + +/** + * Creates a map cache object to store key-value pairs. + * + * @private + * @constructor + * @param {Array} [entries] The key-value pairs to cache. + */ +function MapCache(entries) { + var index = -1, + length = entries ? entries.length : 0; + + this.clear(); + while (++index < length) { + var entry = entries[index]; + this.set(entry[0], entry[1]); + } +} + +/** + * Removes all key-value entries from the map. + * + * @private + * @name clear + * @memberOf MapCache + */ +function mapCacheClear() { + this.__data__ = { + 'hash': new Hash, + 'map': new (Map || ListCache), + 'string': new Hash + }; +} + +/** + * Removes `key` and its value from the map. + * + * @private + * @name delete + * @memberOf MapCache + * @param {string} key The key of the value to remove. + * @returns {boolean} Returns `true` if the entry was removed, else `false`. + */ +function mapCacheDelete(key) { + return getMapData(this, key)['delete'](key); +} + +/** + * Gets the map value for `key`. + * + * @private + * @name get + * @memberOf MapCache + * @param {string} key The key of the value to get. + * @returns {*} Returns the entry value. + */ +function mapCacheGet(key) { + return getMapData(this, key).get(key); +} + +/** + * Checks if a map value for `key` exists. + * + * @private + * @name has + * @memberOf MapCache + * @param {string} key The key of the entry to check. + * @returns {boolean} Returns `true` if an entry for `key` exists, else `false`. + */ +function mapCacheHas(key) { + return getMapData(this, key).has(key); +} + +/** + * Sets the map `key` to `value`. + * + * @private + * @name set + * @memberOf MapCache + * @param {string} key The key of the value to set. + * @param {*} value The value to set. + * @returns {Object} Returns the map cache instance. + */ +function mapCacheSet(key, value) { + getMapData(this, key).set(key, value); + return this; +} + +// Add methods to `MapCache`. +MapCache.prototype.clear = mapCacheClear; +MapCache.prototype['delete'] = mapCacheDelete; +MapCache.prototype.get = mapCacheGet; +MapCache.prototype.has = mapCacheHas; +MapCache.prototype.set = mapCacheSet; + +/** + * + * Creates an array cache object to store unique values. + * + * @private + * @constructor + * @param {Array} [values] The values to cache. + */ +function SetCache(values) { + var index = -1, + length = values ? values.length : 0; + + this.__data__ = new MapCache; + while (++index < length) { + this.add(values[index]); + } +} + +/** + * Adds `value` to the array cache. + * + * @private + * @name add + * @memberOf SetCache + * @alias push + * @param {*} value The value to cache. + * @returns {Object} Returns the cache instance. + */ +function setCacheAdd(value) { + this.__data__.set(value, HASH_UNDEFINED); + return this; +} + +/** + * Checks if `value` is in the array cache. + * + * @private + * @name has + * @memberOf SetCache + * @param {*} value The value to search for. + * @returns {number} Returns `true` if `value` is found, else `false`. + */ +function setCacheHas(value) { + return this.__data__.has(value); +} + +// Add methods to `SetCache`. +SetCache.prototype.add = SetCache.prototype.push = setCacheAdd; +SetCache.prototype.has = setCacheHas; + +/** + * Creates a stack cache object to store key-value pairs. + * + * @private + * @constructor + * @param {Array} [entries] The key-value pairs to cache. + */ +function Stack(entries) { + this.__data__ = new ListCache(entries); +} + +/** + * Removes all key-value entries from the stack. + * + * @private + * @name clear + * @memberOf Stack + */ +function stackClear() { + this.__data__ = new ListCache; +} + +/** + * Removes `key` and its value from the stack. + * + * @private + * @name delete + * @memberOf Stack + * @param {string} key The key of the value to remove. + * @returns {boolean} Returns `true` if the entry was removed, else `false`. + */ +function stackDelete(key) { + return this.__data__['delete'](key); +} + +/** + * Gets the stack value for `key`. + * + * @private + * @name get + * @memberOf Stack + * @param {string} key The key of the value to get. + * @returns {*} Returns the entry value. + */ +function stackGet(key) { + return this.__data__.get(key); +} + +/** + * Checks if a stack value for `key` exists. + * + * @private + * @name has + * @memberOf Stack + * @param {string} key The key of the entry to check. + * @returns {boolean} Returns `true` if an entry for `key` exists, else `false`. + */ +function stackHas(key) { + return this.__data__.has(key); +} + +/** + * Sets the stack `key` to `value`. + * + * @private + * @name set + * @memberOf Stack + * @param {string} key The key of the value to set. + * @param {*} value The value to set. + * @returns {Object} Returns the stack cache instance. + */ +function stackSet(key, value) { + var cache = this.__data__; + if (cache instanceof ListCache) { + var pairs = cache.__data__; + if (!Map || (pairs.length < LARGE_ARRAY_SIZE - 1)) { + pairs.push([key, value]); + return this; + } + cache = this.__data__ = new MapCache(pairs); + } + cache.set(key, value); + return this; +} + +// Add methods to `Stack`. +Stack.prototype.clear = stackClear; +Stack.prototype['delete'] = stackDelete; +Stack.prototype.get = stackGet; +Stack.prototype.has = stackHas; +Stack.prototype.set = stackSet; + +/** + * Creates an array of the enumerable property names of the array-like `value`. + * + * @private + * @param {*} value The value to query. + * @param {boolean} inherited Specify returning inherited property names. + * @returns {Array} Returns the array of property names. + */ +function arrayLikeKeys(value, inherited) { + // Safari 8.1 makes `arguments.callee` enumerable in strict mode. + // Safari 9 makes `arguments.length` enumerable in strict mode. + var result = (isArray(value) || isArguments(value)) + ? baseTimes(value.length, String) + : []; + + var length = result.length, + skipIndexes = !!length; + + for (var key in value) { + if ((inherited || hasOwnProperty.call(value, key)) && + !(skipIndexes && (key == 'length' || isIndex(key, length)))) { + result.push(key); + } + } + return result; +} + +/** + * Gets the index at which the `key` is found in `array` of key-value pairs. + * + * @private + * @param {Array} array The array to inspect. + * @param {*} key The key to search for. + * @returns {number} Returns the index of the matched value, else `-1`. + */ +function assocIndexOf(array, key) { + var length = array.length; + while (length--) { + if (eq(array[length][0], key)) { + return length; + } + } + return -1; +} + +/** + * The base implementation of `_.forEach` without support for iteratee shorthands. + * + * @private + * @param {Array|Object} collection The collection to iterate over. + * @param {Function} iteratee The function invoked per iteration. + * @returns {Array|Object} Returns `collection`. + */ +var baseEach = createBaseEach(baseForOwn); + +/** + * The base implementation of `_.flatten` with support for restricting flattening. + * + * @private + * @param {Array} array The array to flatten. + * @param {number} depth The maximum recursion depth. + * @param {boolean} [predicate=isFlattenable] The function invoked per iteration. + * @param {boolean} [isStrict] Restrict to values that pass `predicate` checks. + * @param {Array} [result=[]] The initial result value. + * @returns {Array} Returns the new flattened array. + */ +function baseFlatten(array, depth, predicate, isStrict, result) { + var index = -1, + length = array.length; + + predicate || (predicate = isFlattenable); + result || (result = []); + + while (++index < length) { + var value = array[index]; + if (depth > 0 && predicate(value)) { + if (depth > 1) { + // Recursively flatten arrays (susceptible to call stack limits). + baseFlatten(value, depth - 1, predicate, isStrict, result); + } else { + arrayPush(result, value); + } + } else if (!isStrict) { + result[result.length] = value; + } + } + return result; +} + +/** + * The base implementation of `baseForOwn` which iterates over `object` + * properties returned by `keysFunc` and invokes `iteratee` for each property. + * Iteratee functions may exit iteration early by explicitly returning `false`. + * + * @private + * @param {Object} object The object to iterate over. + * @param {Function} iteratee The function invoked per iteration. + * @param {Function} keysFunc The function to get the keys of `object`. + * @returns {Object} Returns `object`. + */ +var baseFor = createBaseFor(); + +/** + * The base implementation of `_.forOwn` without support for iteratee shorthands. + * + * @private + * @param {Object} object The object to iterate over. + * @param {Function} iteratee The function invoked per iteration. + * @returns {Object} Returns `object`. + */ +function baseForOwn(object, iteratee) { + return object && baseFor(object, iteratee, keys); +} + +/** + * The base implementation of `_.get` without support for default values. + * + * @private + * @param {Object} object The object to query. + * @param {Array|string} path The path of the property to get. + * @returns {*} Returns the resolved value. + */ +function baseGet(object, path) { + path = isKey(path, object) ? [path] : castPath(path); + + var index = 0, + length = path.length; + + while (object != null && index < length) { + object = object[toKey(path[index++])]; + } + return (index && index == length) ? object : undefined; +} + +/** + * The base implementation of `getTag`. + * + * @private + * @param {*} value The value to query. + * @returns {string} Returns the `toStringTag`. + */ +function baseGetTag(value) { + return objectToString.call(value); +} + +/** + * The base implementation of `_.hasIn` without support for deep paths. + * + * @private + * @param {Object} [object] The object to query. + * @param {Array|string} key The key to check. + * @returns {boolean} Returns `true` if `key` exists, else `false`. + */ +function baseHasIn(object, key) { + return object != null && key in Object(object); +} + +/** + * The base implementation of `_.isEqual` which supports partial comparisons + * and tracks traversed objects. + * + * @private + * @param {*} value The value to compare. + * @param {*} other The other value to compare. + * @param {Function} [customizer] The function to customize comparisons. + * @param {boolean} [bitmask] The bitmask of comparison flags. + * The bitmask may be composed of the following flags: + * 1 - Unordered comparison + * 2 - Partial comparison + * @param {Object} [stack] Tracks traversed `value` and `other` objects. + * @returns {boolean} Returns `true` if the values are equivalent, else `false`. + */ +function baseIsEqual(value, other, customizer, bitmask, stack) { + if (value === other) { + return true; + } + if (value == null || other == null || (!isObject(value) && !isObjectLike(other))) { + return value !== value && other !== other; + } + return baseIsEqualDeep(value, other, baseIsEqual, customizer, bitmask, stack); +} + +/** + * A specialized version of `baseIsEqual` for arrays and objects which performs + * deep comparisons and tracks traversed objects enabling objects with circular + * references to be compared. + * + * @private + * @param {Object} object The object to compare. + * @param {Object} other The other object to compare. + * @param {Function} equalFunc The function to determine equivalents of values. + * @param {Function} [customizer] The function to customize comparisons. + * @param {number} [bitmask] The bitmask of comparison flags. See `baseIsEqual` + * for more details. + * @param {Object} [stack] Tracks traversed `object` and `other` objects. + * @returns {boolean} Returns `true` if the objects are equivalent, else `false`. + */ +function baseIsEqualDeep(object, other, equalFunc, customizer, bitmask, stack) { + var objIsArr = isArray(object), + othIsArr = isArray(other), + objTag = arrayTag, + othTag = arrayTag; + + if (!objIsArr) { + objTag = getTag(object); + objTag = objTag == argsTag ? objectTag : objTag; + } + if (!othIsArr) { + othTag = getTag(other); + othTag = othTag == argsTag ? objectTag : othTag; + } + var objIsObj = objTag == objectTag && !isHostObject(object), + othIsObj = othTag == objectTag && !isHostObject(other), + isSameTag = objTag == othTag; + + if (isSameTag && !objIsObj) { + stack || (stack = new Stack); + return (objIsArr || isTypedArray(object)) + ? equalArrays(object, other, equalFunc, customizer, bitmask, stack) + : equalByTag(object, other, objTag, equalFunc, customizer, bitmask, stack); + } + if (!(bitmask & PARTIAL_COMPARE_FLAG)) { + var objIsWrapped = objIsObj && hasOwnProperty.call(object, '__wrapped__'), + othIsWrapped = othIsObj && hasOwnProperty.call(other, '__wrapped__'); + + if (objIsWrapped || othIsWrapped) { + var objUnwrapped = objIsWrapped ? object.value() : object, + othUnwrapped = othIsWrapped ? other.value() : other; + + stack || (stack = new Stack); + return equalFunc(objUnwrapped, othUnwrapped, customizer, bitmask, stack); + } + } + if (!isSameTag) { + return false; + } + stack || (stack = new Stack); + return equalObjects(object, other, equalFunc, customizer, bitmask, stack); +} + +/** + * The base implementation of `_.isMatch` without support for iteratee shorthands. + * + * @private + * @param {Object} object The object to inspect. + * @param {Object} source The object of property values to match. + * @param {Array} matchData The property names, values, and compare flags to match. + * @param {Function} [customizer] The function to customize comparisons. + * @returns {boolean} Returns `true` if `object` is a match, else `false`. + */ +function baseIsMatch(object, source, matchData, customizer) { + var index = matchData.length, + length = index, + noCustomizer = !customizer; + + if (object == null) { + return !length; + } + object = Object(object); + while (index--) { + var data = matchData[index]; + if ((noCustomizer && data[2]) + ? data[1] !== object[data[0]] + : !(data[0] in object) + ) { + return false; + } + } + while (++index < length) { + data = matchData[index]; + var key = data[0], + objValue = object[key], + srcValue = data[1]; + + if (noCustomizer && data[2]) { + if (objValue === undefined && !(key in object)) { + return false; + } + } else { + var stack = new Stack; + if (customizer) { + var result = customizer(objValue, srcValue, key, object, source, stack); + } + if (!(result === undefined + ? baseIsEqual(srcValue, objValue, customizer, UNORDERED_COMPARE_FLAG | PARTIAL_COMPARE_FLAG, stack) + : result + )) { + return false; + } + } + } + return true; +} + +/** + * The base implementation of `_.isNative` without bad shim checks. + * + * @private + * @param {*} value The value to check. + * @returns {boolean} Returns `true` if `value` is a native function, + * else `false`. + */ +function baseIsNative(value) { + if (!isObject(value) || isMasked(value)) { + return false; + } + var pattern = (isFunction(value) || isHostObject(value)) ? reIsNative : reIsHostCtor; + return pattern.test(toSource(value)); +} + +/** + * The base implementation of `_.isTypedArray` without Node.js optimizations. + * + * @private + * @param {*} value The value to check. + * @returns {boolean} Returns `true` if `value` is a typed array, else `false`. + */ +function baseIsTypedArray(value) { + return isObjectLike(value) && + isLength(value.length) && !!typedArrayTags[objectToString.call(value)]; +} + +/** + * The base implementation of `_.iteratee`. + * + * @private + * @param {*} [value=_.identity] The value to convert to an iteratee. + * @returns {Function} Returns the iteratee. + */ +function baseIteratee(value) { + // Don't store the `typeof` result in a variable to avoid a JIT bug in Safari 9. + // See https://bugs.webkit.org/show_bug.cgi?id=156034 for more details. + if (typeof value == 'function') { + return value; + } + if (value == null) { + return identity; + } + if (typeof value == 'object') { + return isArray(value) + ? baseMatchesProperty(value[0], value[1]) + : baseMatches(value); + } + return property(value); +} + +/** + * The base implementation of `_.keys` which doesn't treat sparse arrays as dense. + * + * @private + * @param {Object} object The object to query. + * @returns {Array} Returns the array of property names. + */ +function baseKeys(object) { + if (!isPrototype(object)) { + return nativeKeys(object); + } + var result = []; + for (var key in Object(object)) { + if (hasOwnProperty.call(object, key) && key != 'constructor') { + result.push(key); + } + } + return result; +} + +/** + * The base implementation of `_.map` without support for iteratee shorthands. + * + * @private + * @param {Array|Object} collection The collection to iterate over. + * @param {Function} iteratee The function invoked per iteration. + * @returns {Array} Returns the new mapped array. + */ +function baseMap(collection, iteratee) { + var index = -1, + result = isArrayLike(collection) ? Array(collection.length) : []; + + baseEach(collection, function(value, key, collection) { + result[++index] = iteratee(value, key, collection); + }); + return result; +} + +/** + * The base implementation of `_.matches` which doesn't clone `source`. + * + * @private + * @param {Object} source The object of property values to match. + * @returns {Function} Returns the new spec function. + */ +function baseMatches(source) { + var matchData = getMatchData(source); + if (matchData.length == 1 && matchData[0][2]) { + return matchesStrictComparable(matchData[0][0], matchData[0][1]); + } + return function(object) { + return object === source || baseIsMatch(object, source, matchData); + }; +} + +/** + * The base implementation of `_.matchesProperty` which doesn't clone `srcValue`. + * + * @private + * @param {string} path The path of the property to get. + * @param {*} srcValue The value to match. + * @returns {Function} Returns the new spec function. + */ +function baseMatchesProperty(path, srcValue) { + if (isKey(path) && isStrictComparable(srcValue)) { + return matchesStrictComparable(toKey(path), srcValue); + } + return function(object) { + var objValue = get(object, path); + return (objValue === undefined && objValue === srcValue) + ? hasIn(object, path) + : baseIsEqual(srcValue, objValue, undefined, UNORDERED_COMPARE_FLAG | PARTIAL_COMPARE_FLAG); + }; +} + +/** + * The base implementation of `_.orderBy` without param guards. + * + * @private + * @param {Array|Object} collection The collection to iterate over. + * @param {Function[]|Object[]|string[]} iteratees The iteratees to sort by. + * @param {string[]} orders The sort orders of `iteratees`. + * @returns {Array} Returns the new sorted array. + */ +function baseOrderBy(collection, iteratees, orders) { + var index = -1; + iteratees = arrayMap(iteratees.length ? iteratees : [identity], baseUnary(baseIteratee)); + + var result = baseMap(collection, function(value, key, collection) { + var criteria = arrayMap(iteratees, function(iteratee) { + return iteratee(value); + }); + return { 'criteria': criteria, 'index': ++index, 'value': value }; + }); + + return baseSortBy(result, function(object, other) { + return compareMultiple(object, other, orders); + }); +} + +/** + * A specialized version of `baseProperty` which supports deep paths. + * + * @private + * @param {Array|string} path The path of the property to get. + * @returns {Function} Returns the new accessor function. + */ +function basePropertyDeep(path) { + return function(object) { + return baseGet(object, path); + }; +} + +/** + * The base implementation of `_.rest` which doesn't validate or coerce arguments. + * + * @private + * @param {Function} func The function to apply a rest parameter to. + * @param {number} [start=func.length-1] The start position of the rest parameter. + * @returns {Function} Returns the new function. + */ +function baseRest(func, start) { + start = nativeMax(start === undefined ? (func.length - 1) : start, 0); + return function() { + var args = arguments, + index = -1, + length = nativeMax(args.length - start, 0), + array = Array(length); + + while (++index < length) { + array[index] = args[start + index]; + } + index = -1; + var otherArgs = Array(start + 1); + while (++index < start) { + otherArgs[index] = args[index]; + } + otherArgs[start] = array; + return apply(func, this, otherArgs); + }; +} + +/** + * The base implementation of `_.toString` which doesn't convert nullish + * values to empty strings. + * + * @private + * @param {*} value The value to process. + * @returns {string} Returns the string. + */ +function baseToString(value) { + // Exit early for strings to avoid a performance hit in some environments. + if (typeof value == 'string') { + return value; + } + if (isSymbol(value)) { + return symbolToString ? symbolToString.call(value) : ''; + } + var result = (value + ''); + return (result == '0' && (1 / value) == -INFINITY) ? '-0' : result; +} + +/** + * Casts `value` to a path array if it's not one. + * + * @private + * @param {*} value The value to inspect. + * @returns {Array} Returns the cast property path array. + */ +function castPath(value) { + return isArray(value) ? value : stringToPath(value); +} + +/** + * Compares values to sort them in ascending order. + * + * @private + * @param {*} value The value to compare. + * @param {*} other The other value to compare. + * @returns {number} Returns the sort order indicator for `value`. + */ +function compareAscending(value, other) { + if (value !== other) { + var valIsDefined = value !== undefined, + valIsNull = value === null, + valIsReflexive = value === value, + valIsSymbol = isSymbol(value); + + var othIsDefined = other !== undefined, + othIsNull = other === null, + othIsReflexive = other === other, + othIsSymbol = isSymbol(other); + + if ((!othIsNull && !othIsSymbol && !valIsSymbol && value > other) || + (valIsSymbol && othIsDefined && othIsReflexive && !othIsNull && !othIsSymbol) || + (valIsNull && othIsDefined && othIsReflexive) || + (!valIsDefined && othIsReflexive) || + !valIsReflexive) { + return 1; + } + if ((!valIsNull && !valIsSymbol && !othIsSymbol && value < other) || + (othIsSymbol && valIsDefined && valIsReflexive && !valIsNull && !valIsSymbol) || + (othIsNull && valIsDefined && valIsReflexive) || + (!othIsDefined && valIsReflexive) || + !othIsReflexive) { + return -1; + } + } + return 0; +} + +/** + * Used by `_.orderBy` to compare multiple properties of a value to another + * and stable sort them. + * + * If `orders` is unspecified, all values are sorted in ascending order. Otherwise, + * specify an order of "desc" for descending or "asc" for ascending sort order + * of corresponding values. + * + * @private + * @param {Object} object The object to compare. + * @param {Object} other The other object to compare. + * @param {boolean[]|string[]} orders The order to sort by for each property. + * @returns {number} Returns the sort order indicator for `object`. + */ +function compareMultiple(object, other, orders) { + var index = -1, + objCriteria = object.criteria, + othCriteria = other.criteria, + length = objCriteria.length, + ordersLength = orders.length; + + while (++index < length) { + var result = compareAscending(objCriteria[index], othCriteria[index]); + if (result) { + if (index >= ordersLength) { + return result; + } + var order = orders[index]; + return result * (order == 'desc' ? -1 : 1); + } + } + // Fixes an `Array#sort` bug in the JS engine embedded in Adobe applications + // that causes it, under certain circumstances, to provide the same value for + // `object` and `other`. See https://github.com/jashkenas/underscore/pull/1247 + // for more details. + // + // This also ensures a stable sort in V8 and other engines. + // See https://bugs.chromium.org/p/v8/issues/detail?id=90 for more details. + return object.index - other.index; +} + +/** + * Creates a `baseEach` or `baseEachRight` function. + * + * @private + * @param {Function} eachFunc The function to iterate over a collection. + * @param {boolean} [fromRight] Specify iterating from right to left. + * @returns {Function} Returns the new base function. + */ +function createBaseEach(eachFunc, fromRight) { + return function(collection, iteratee) { + if (collection == null) { + return collection; + } + if (!isArrayLike(collection)) { + return eachFunc(collection, iteratee); + } + var length = collection.length, + index = fromRight ? length : -1, + iterable = Object(collection); + + while ((fromRight ? index-- : ++index < length)) { + if (iteratee(iterable[index], index, iterable) === false) { + break; + } + } + return collection; + }; +} + +/** + * Creates a base function for methods like `_.forIn` and `_.forOwn`. + * + * @private + * @param {boolean} [fromRight] Specify iterating from right to left. + * @returns {Function} Returns the new base function. + */ +function createBaseFor(fromRight) { + return function(object, iteratee, keysFunc) { + var index = -1, + iterable = Object(object), + props = keysFunc(object), + length = props.length; + + while (length--) { + var key = props[fromRight ? length : ++index]; + if (iteratee(iterable[key], key, iterable) === false) { + break; + } + } + return object; + }; +} + +/** + * A specialized version of `baseIsEqualDeep` for arrays with support for + * partial deep comparisons. + * + * @private + * @param {Array} array The array to compare. + * @param {Array} other The other array to compare. + * @param {Function} equalFunc The function to determine equivalents of values. + * @param {Function} customizer The function to customize comparisons. + * @param {number} bitmask The bitmask of comparison flags. See `baseIsEqual` + * for more details. + * @param {Object} stack Tracks traversed `array` and `other` objects. + * @returns {boolean} Returns `true` if the arrays are equivalent, else `false`. + */ +function equalArrays(array, other, equalFunc, customizer, bitmask, stack) { + var isPartial = bitmask & PARTIAL_COMPARE_FLAG, + arrLength = array.length, + othLength = other.length; + + if (arrLength != othLength && !(isPartial && othLength > arrLength)) { + return false; + } + // Assume cyclic values are equal. + var stacked = stack.get(array); + if (stacked && stack.get(other)) { + return stacked == other; + } + var index = -1, + result = true, + seen = (bitmask & UNORDERED_COMPARE_FLAG) ? new SetCache : undefined; + + stack.set(array, other); + stack.set(other, array); + + // Ignore non-index properties. + while (++index < arrLength) { + var arrValue = array[index], + othValue = other[index]; + + if (customizer) { + var compared = isPartial + ? customizer(othValue, arrValue, index, other, array, stack) + : customizer(arrValue, othValue, index, array, other, stack); + } + if (compared !== undefined) { + if (compared) { + continue; + } + result = false; + break; + } + // Recursively compare arrays (susceptible to call stack limits). + if (seen) { + if (!arraySome(other, function(othValue, othIndex) { + if (!seen.has(othIndex) && + (arrValue === othValue || equalFunc(arrValue, othValue, customizer, bitmask, stack))) { + return seen.add(othIndex); + } + })) { + result = false; + break; + } + } else if (!( + arrValue === othValue || + equalFunc(arrValue, othValue, customizer, bitmask, stack) + )) { + result = false; + break; + } + } + stack['delete'](array); + stack['delete'](other); + return result; +} + +/** + * A specialized version of `baseIsEqualDeep` for comparing objects of + * the same `toStringTag`. + * + * **Note:** This function only supports comparing values with tags of + * `Boolean`, `Date`, `Error`, `Number`, `RegExp`, or `String`. + * + * @private + * @param {Object} object The object to compare. + * @param {Object} other The other object to compare. + * @param {string} tag The `toStringTag` of the objects to compare. + * @param {Function} equalFunc The function to determine equivalents of values. + * @param {Function} customizer The function to customize comparisons. + * @param {number} bitmask The bitmask of comparison flags. See `baseIsEqual` + * for more details. + * @param {Object} stack Tracks traversed `object` and `other` objects. + * @returns {boolean} Returns `true` if the objects are equivalent, else `false`. + */ +function equalByTag(object, other, tag, equalFunc, customizer, bitmask, stack) { + switch (tag) { + case dataViewTag: + if ((object.byteLength != other.byteLength) || + (object.byteOffset != other.byteOffset)) { + return false; + } + object = object.buffer; + other = other.buffer; + + case arrayBufferTag: + if ((object.byteLength != other.byteLength) || + !equalFunc(new Uint8Array(object), new Uint8Array(other))) { + return false; + } + return true; + + case boolTag: + case dateTag: + case numberTag: + // Coerce booleans to `1` or `0` and dates to milliseconds. + // Invalid dates are coerced to `NaN`. + return eq(+object, +other); + + case errorTag: + return object.name == other.name && object.message == other.message; + + case regexpTag: + case stringTag: + // Coerce regexes to strings and treat strings, primitives and objects, + // as equal. See http://www.ecma-international.org/ecma-262/7.0/#sec-regexp.prototype.tostring + // for more details. + return object == (other + ''); + + case mapTag: + var convert = mapToArray; + + case setTag: + var isPartial = bitmask & PARTIAL_COMPARE_FLAG; + convert || (convert = setToArray); + + if (object.size != other.size && !isPartial) { + return false; + } + // Assume cyclic values are equal. + var stacked = stack.get(object); + if (stacked) { + return stacked == other; + } + bitmask |= UNORDERED_COMPARE_FLAG; + + // Recursively compare objects (susceptible to call stack limits). + stack.set(object, other); + var result = equalArrays(convert(object), convert(other), equalFunc, customizer, bitmask, stack); + stack['delete'](object); + return result; + + case symbolTag: + if (symbolValueOf) { + return symbolValueOf.call(object) == symbolValueOf.call(other); + } + } + return false; +} + +/** + * A specialized version of `baseIsEqualDeep` for objects with support for + * partial deep comparisons. + * + * @private + * @param {Object} object The object to compare. + * @param {Object} other The other object to compare. + * @param {Function} equalFunc The function to determine equivalents of values. + * @param {Function} customizer The function to customize comparisons. + * @param {number} bitmask The bitmask of comparison flags. See `baseIsEqual` + * for more details. + * @param {Object} stack Tracks traversed `object` and `other` objects. + * @returns {boolean} Returns `true` if the objects are equivalent, else `false`. + */ +function equalObjects(object, other, equalFunc, customizer, bitmask, stack) { + var isPartial = bitmask & PARTIAL_COMPARE_FLAG, + objProps = keys(object), + objLength = objProps.length, + othProps = keys(other), + othLength = othProps.length; + + if (objLength != othLength && !isPartial) { + return false; + } + var index = objLength; + while (index--) { + var key = objProps[index]; + if (!(isPartial ? key in other : hasOwnProperty.call(other, key))) { + return false; + } + } + // Assume cyclic values are equal. + var stacked = stack.get(object); + if (stacked && stack.get(other)) { + return stacked == other; + } + var result = true; + stack.set(object, other); + stack.set(other, object); + + var skipCtor = isPartial; + while (++index < objLength) { + key = objProps[index]; + var objValue = object[key], + othValue = other[key]; + + if (customizer) { + var compared = isPartial + ? customizer(othValue, objValue, key, other, object, stack) + : customizer(objValue, othValue, key, object, other, stack); + } + // Recursively compare objects (susceptible to call stack limits). + if (!(compared === undefined + ? (objValue === othValue || equalFunc(objValue, othValue, customizer, bitmask, stack)) + : compared + )) { + result = false; + break; + } + skipCtor || (skipCtor = key == 'constructor'); + } + if (result && !skipCtor) { + var objCtor = object.constructor, + othCtor = other.constructor; + + // Non `Object` object instances with different constructors are not equal. + if (objCtor != othCtor && + ('constructor' in object && 'constructor' in other) && + !(typeof objCtor == 'function' && objCtor instanceof objCtor && + typeof othCtor == 'function' && othCtor instanceof othCtor)) { + result = false; + } + } + stack['delete'](object); + stack['delete'](other); + return result; +} + +/** + * Gets the data for `map`. + * + * @private + * @param {Object} map The map to query. + * @param {string} key The reference key. + * @returns {*} Returns the map data. + */ +function getMapData(map, key) { + var data = map.__data__; + return isKeyable(key) + ? data[typeof key == 'string' ? 'string' : 'hash'] + : data.map; +} + +/** + * Gets the property names, values, and compare flags of `object`. + * + * @private + * @param {Object} object The object to query. + * @returns {Array} Returns the match data of `object`. + */ +function getMatchData(object) { + var result = keys(object), + length = result.length; + + while (length--) { + var key = result[length], + value = object[key]; + + result[length] = [key, value, isStrictComparable(value)]; + } + return result; +} + +/** + * Gets the native function at `key` of `object`. + * + * @private + * @param {Object} object The object to query. + * @param {string} key The key of the method to get. + * @returns {*} Returns the function if it's native, else `undefined`. + */ +function getNative(object, key) { + var value = getValue(object, key); + return baseIsNative(value) ? value : undefined; +} + +/** + * Gets the `toStringTag` of `value`. + * + * @private + * @param {*} value The value to query. + * @returns {string} Returns the `toStringTag`. + */ +var getTag = baseGetTag; + +// Fallback for data views, maps, sets, and weak maps in IE 11, +// for data views in Edge < 14, and promises in Node.js. +if ((DataView && getTag(new DataView(new ArrayBuffer(1))) != dataViewTag) || + (Map && getTag(new Map) != mapTag) || + (Promise && getTag(Promise.resolve()) != promiseTag) || + (Set && getTag(new Set) != setTag) || + (WeakMap && getTag(new WeakMap) != weakMapTag)) { + getTag = function(value) { + var result = objectToString.call(value), + Ctor = result == objectTag ? value.constructor : undefined, + ctorString = Ctor ? toSource(Ctor) : undefined; + + if (ctorString) { + switch (ctorString) { + case dataViewCtorString: return dataViewTag; + case mapCtorString: return mapTag; + case promiseCtorString: return promiseTag; + case setCtorString: return setTag; + case weakMapCtorString: return weakMapTag; + } + } + return result; + }; +} + +/** + * Checks if `path` exists on `object`. + * + * @private + * @param {Object} object The object to query. + * @param {Array|string} path The path to check. + * @param {Function} hasFunc The function to check properties. + * @returns {boolean} Returns `true` if `path` exists, else `false`. + */ +function hasPath(object, path, hasFunc) { + path = isKey(path, object) ? [path] : castPath(path); + + var result, + index = -1, + length = path.length; + + while (++index < length) { + var key = toKey(path[index]); + if (!(result = object != null && hasFunc(object, key))) { + break; + } + object = object[key]; + } + if (result) { + return result; + } + var length = object ? object.length : 0; + return !!length && isLength(length) && isIndex(key, length) && + (isArray(object) || isArguments(object)); +} + +/** + * Checks if `value` is a flattenable `arguments` object or array. + * + * @private + * @param {*} value The value to check. + * @returns {boolean} Returns `true` if `value` is flattenable, else `false`. + */ +function isFlattenable(value) { + return isArray(value) || isArguments(value) || + !!(spreadableSymbol && value && value[spreadableSymbol]); +} + +/** + * Checks if `value` is a valid array-like index. + * + * @private + * @param {*} value The value to check. + * @param {number} [length=MAX_SAFE_INTEGER] The upper bounds of a valid index. + * @returns {boolean} Returns `true` if `value` is a valid index, else `false`. + */ +function isIndex(value, length) { + length = length == null ? MAX_SAFE_INTEGER : length; + return !!length && + (typeof value == 'number' || reIsUint.test(value)) && + (value > -1 && value % 1 == 0 && value < length); +} + +/** + * Checks if the given arguments are from an iteratee call. + * + * @private + * @param {*} value The potential iteratee value argument. + * @param {*} index The potential iteratee index or key argument. + * @param {*} object The potential iteratee object argument. + * @returns {boolean} Returns `true` if the arguments are from an iteratee call, + * else `false`. + */ +function isIterateeCall(value, index, object) { + if (!isObject(object)) { + return false; + } + var type = typeof index; + if (type == 'number' + ? (isArrayLike(object) && isIndex(index, object.length)) + : (type == 'string' && index in object) + ) { + return eq(object[index], value); + } + return false; +} + +/** + * Checks if `value` is a property name and not a property path. + * + * @private + * @param {*} value The value to check. + * @param {Object} [object] The object to query keys on. + * @returns {boolean} Returns `true` if `value` is a property name, else `false`. + */ +function isKey(value, object) { + if (isArray(value)) { + return false; + } + var type = typeof value; + if (type == 'number' || type == 'symbol' || type == 'boolean' || + value == null || isSymbol(value)) { + return true; + } + return reIsPlainProp.test(value) || !reIsDeepProp.test(value) || + (object != null && value in Object(object)); +} + +/** + * Checks if `value` is suitable for use as unique object key. + * + * @private + * @param {*} value The value to check. + * @returns {boolean} Returns `true` if `value` is suitable, else `false`. + */ +function isKeyable(value) { + var type = typeof value; + return (type == 'string' || type == 'number' || type == 'symbol' || type == 'boolean') + ? (value !== '__proto__') + : (value === null); +} + +/** + * Checks if `func` has its source masked. + * + * @private + * @param {Function} func The function to check. + * @returns {boolean} Returns `true` if `func` is masked, else `false`. + */ +function isMasked(func) { + return !!maskSrcKey && (maskSrcKey in func); +} + +/** + * Checks if `value` is likely a prototype object. + * + * @private + * @param {*} value The value to check. + * @returns {boolean} Returns `true` if `value` is a prototype, else `false`. + */ +function isPrototype(value) { + var Ctor = value && value.constructor, + proto = (typeof Ctor == 'function' && Ctor.prototype) || objectProto; + + return value === proto; +} + +/** + * Checks if `value` is suitable for strict equality comparisons, i.e. `===`. + * + * @private + * @param {*} value The value to check. + * @returns {boolean} Returns `true` if `value` if suitable for strict + * equality comparisons, else `false`. + */ +function isStrictComparable(value) { + return value === value && !isObject(value); +} + +/** + * A specialized version of `matchesProperty` for source values suitable + * for strict equality comparisons, i.e. `===`. + * + * @private + * @param {string} key The key of the property to get. + * @param {*} srcValue The value to match. + * @returns {Function} Returns the new spec function. + */ +function matchesStrictComparable(key, srcValue) { + return function(object) { + if (object == null) { + return false; + } + return object[key] === srcValue && + (srcValue !== undefined || (key in Object(object))); + }; +} + +/** + * Converts `string` to a property path array. + * + * @private + * @param {string} string The string to convert. + * @returns {Array} Returns the property path array. + */ +var stringToPath = memoize(function(string) { + string = toString(string); + + var result = []; + if (reLeadingDot.test(string)) { + result.push(''); + } + string.replace(rePropName, function(match, number, quote, string) { + result.push(quote ? string.replace(reEscapeChar, '$1') : (number || match)); + }); + return result; +}); + +/** + * Converts `value` to a string key if it's not a string or symbol. + * + * @private + * @param {*} value The value to inspect. + * @returns {string|symbol} Returns the key. + */ +function toKey(value) { + if (typeof value == 'string' || isSymbol(value)) { + return value; + } + var result = (value + ''); + return (result == '0' && (1 / value) == -INFINITY) ? '-0' : result; +} + +/** + * Converts `func` to its source code. + * + * @private + * @param {Function} func The function to process. + * @returns {string} Returns the source code. + */ +function toSource(func) { + if (func != null) { + try { + return funcToString.call(func); + } catch (e) {} + try { + return (func + ''); + } catch (e) {} + } + return ''; +} + +/** + * Creates an array of elements, sorted in ascending order by the results of + * running each element in a collection thru each iteratee. This method + * performs a stable sort, that is, it preserves the original sort order of + * equal elements. The iteratees are invoked with one argument: (value). + * + * @static + * @memberOf _ + * @since 0.1.0 + * @category Collection + * @param {Array|Object} collection The collection to iterate over. + * @param {...(Function|Function[])} [iteratees=[_.identity]] + * The iteratees to sort by. + * @returns {Array} Returns the new sorted array. + * @example + * + * var users = [ + * { 'user': 'fred', 'age': 48 }, + * { 'user': 'barney', 'age': 36 }, + * { 'user': 'fred', 'age': 40 }, + * { 'user': 'barney', 'age': 34 } + * ]; + * + * _.sortBy(users, function(o) { return o.user; }); + * // => objects for [['barney', 36], ['barney', 34], ['fred', 48], ['fred', 40]] + * + * _.sortBy(users, ['user', 'age']); + * // => objects for [['barney', 34], ['barney', 36], ['fred', 40], ['fred', 48]] + * + * _.sortBy(users, 'user', function(o) { + * return Math.floor(o.age / 10); + * }); + * // => objects for [['barney', 36], ['barney', 34], ['fred', 48], ['fred', 40]] + */ +var sortBy = baseRest(function(collection, iteratees) { + if (collection == null) { + return []; + } + var length = iteratees.length; + if (length > 1 && isIterateeCall(collection, iteratees[0], iteratees[1])) { + iteratees = []; + } else if (length > 2 && isIterateeCall(iteratees[0], iteratees[1], iteratees[2])) { + iteratees = [iteratees[0]]; + } + return baseOrderBy(collection, baseFlatten(iteratees, 1), []); +}); + +/** + * Creates a function that memoizes the result of `func`. If `resolver` is + * provided, it determines the cache key for storing the result based on the + * arguments provided to the memoized function. By default, the first argument + * provided to the memoized function is used as the map cache key. The `func` + * is invoked with the `this` binding of the memoized function. + * + * **Note:** The cache is exposed as the `cache` property on the memoized + * function. Its creation may be customized by replacing the `_.memoize.Cache` + * constructor with one whose instances implement the + * [`Map`](http://ecma-international.org/ecma-262/7.0/#sec-properties-of-the-map-prototype-object) + * method interface of `delete`, `get`, `has`, and `set`. + * + * @static + * @memberOf _ + * @since 0.1.0 + * @category Function + * @param {Function} func The function to have its output memoized. + * @param {Function} [resolver] The function to resolve the cache key. + * @returns {Function} Returns the new memoized function. + * @example + * + * var object = { 'a': 1, 'b': 2 }; + * var other = { 'c': 3, 'd': 4 }; + * + * var values = _.memoize(_.values); + * values(object); + * // => [1, 2] + * + * values(other); + * // => [3, 4] + * + * object.a = 2; + * values(object); + * // => [1, 2] + * + * // Modify the result cache. + * values.cache.set(object, ['a', 'b']); + * values(object); + * // => ['a', 'b'] + * + * // Replace `_.memoize.Cache`. + * _.memoize.Cache = WeakMap; + */ +function memoize(func, resolver) { + if (typeof func != 'function' || (resolver && typeof resolver != 'function')) { + throw new TypeError(FUNC_ERROR_TEXT); + } + var memoized = function() { + var args = arguments, + key = resolver ? resolver.apply(this, args) : args[0], + cache = memoized.cache; + + if (cache.has(key)) { + return cache.get(key); + } + var result = func.apply(this, args); + memoized.cache = cache.set(key, result); + return result; + }; + memoized.cache = new (memoize.Cache || MapCache); + return memoized; +} + +// Assign cache to `_.memoize`. +memoize.Cache = MapCache; + +/** + * Performs a + * [`SameValueZero`](http://ecma-international.org/ecma-262/7.0/#sec-samevaluezero) + * comparison between two values to determine if they are equivalent. + * + * @static + * @memberOf _ + * @since 4.0.0 + * @category Lang + * @param {*} value The value to compare. + * @param {*} other The other value to compare. + * @returns {boolean} Returns `true` if the values are equivalent, else `false`. + * @example + * + * var object = { 'a': 1 }; + * var other = { 'a': 1 }; + * + * _.eq(object, object); + * // => true + * + * _.eq(object, other); + * // => false + * + * _.eq('a', 'a'); + * // => true + * + * _.eq('a', Object('a')); + * // => false + * + * _.eq(NaN, NaN); + * // => true + */ +function eq(value, other) { + return value === other || (value !== value && other !== other); +} + +/** + * Checks if `value` is likely an `arguments` object. + * + * @static + * @memberOf _ + * @since 0.1.0 + * @category Lang + * @param {*} value The value to check. + * @returns {boolean} Returns `true` if `value` is an `arguments` object, + * else `false`. + * @example + * + * _.isArguments(function() { return arguments; }()); + * // => true + * + * _.isArguments([1, 2, 3]); + * // => false + */ +function isArguments(value) { + // Safari 8.1 makes `arguments.callee` enumerable in strict mode. + return isArrayLikeObject(value) && hasOwnProperty.call(value, 'callee') && + (!propertyIsEnumerable.call(value, 'callee') || objectToString.call(value) == argsTag); +} + +/** + * Checks if `value` is classified as an `Array` object. + * + * @static + * @memberOf _ + * @since 0.1.0 + * @category Lang + * @param {*} value The value to check. + * @returns {boolean} Returns `true` if `value` is an array, else `false`. + * @example + * + * _.isArray([1, 2, 3]); + * // => true + * + * _.isArray(document.body.children); + * // => false + * + * _.isArray('abc'); + * // => false + * + * _.isArray(_.noop); + * // => false + */ +var isArray = Array.isArray; + +/** + * Checks if `value` is array-like. A value is considered array-like if it's + * not a function and has a `value.length` that's an integer greater than or + * equal to `0` and less than or equal to `Number.MAX_SAFE_INTEGER`. + * + * @static + * @memberOf _ + * @since 4.0.0 + * @category Lang + * @param {*} value The value to check. + * @returns {boolean} Returns `true` if `value` is array-like, else `false`. + * @example + * + * _.isArrayLike([1, 2, 3]); + * // => true + * + * _.isArrayLike(document.body.children); + * // => true + * + * _.isArrayLike('abc'); + * // => true + * + * _.isArrayLike(_.noop); + * // => false + */ +function isArrayLike(value) { + return value != null && isLength(value.length) && !isFunction(value); +} + +/** + * This method is like `_.isArrayLike` except that it also checks if `value` + * is an object. + * + * @static + * @memberOf _ + * @since 4.0.0 + * @category Lang + * @param {*} value The value to check. + * @returns {boolean} Returns `true` if `value` is an array-like object, + * else `false`. + * @example + * + * _.isArrayLikeObject([1, 2, 3]); + * // => true + * + * _.isArrayLikeObject(document.body.children); + * // => true + * + * _.isArrayLikeObject('abc'); + * // => false + * + * _.isArrayLikeObject(_.noop); + * // => false + */ +function isArrayLikeObject(value) { + return isObjectLike(value) && isArrayLike(value); +} + +/** + * Checks if `value` is classified as a `Function` object. + * + * @static + * @memberOf _ + * @since 0.1.0 + * @category Lang + * @param {*} value The value to check. + * @returns {boolean} Returns `true` if `value` is a function, else `false`. + * @example + * + * _.isFunction(_); + * // => true + * + * _.isFunction(/abc/); + * // => false + */ +function isFunction(value) { + // The use of `Object#toString` avoids issues with the `typeof` operator + // in Safari 8-9 which returns 'object' for typed array and other constructors. + var tag = isObject(value) ? objectToString.call(value) : ''; + return tag == funcTag || tag == genTag; +} + +/** + * Checks if `value` is a valid array-like length. + * + * **Note:** This method is loosely based on + * [`ToLength`](http://ecma-international.org/ecma-262/7.0/#sec-tolength). + * + * @static + * @memberOf _ + * @since 4.0.0 + * @category Lang + * @param {*} value The value to check. + * @returns {boolean} Returns `true` if `value` is a valid length, else `false`. + * @example + * + * _.isLength(3); + * // => true + * + * _.isLength(Number.MIN_VALUE); + * // => false + * + * _.isLength(Infinity); + * // => false + * + * _.isLength('3'); + * // => false + */ +function isLength(value) { + return typeof value == 'number' && + value > -1 && value % 1 == 0 && value <= MAX_SAFE_INTEGER; +} + +/** + * Checks if `value` is the + * [language type](http://www.ecma-international.org/ecma-262/7.0/#sec-ecmascript-language-types) + * of `Object`. (e.g. arrays, functions, objects, regexes, `new Number(0)`, and `new String('')`) + * + * @static + * @memberOf _ + * @since 0.1.0 + * @category Lang + * @param {*} value The value to check. + * @returns {boolean} Returns `true` if `value` is an object, else `false`. + * @example + * + * _.isObject({}); + * // => true + * + * _.isObject([1, 2, 3]); + * // => true + * + * _.isObject(_.noop); + * // => true + * + * _.isObject(null); + * // => false + */ +function isObject(value) { + var type = typeof value; + return !!value && (type == 'object' || type == 'function'); +} + +/** + * Checks if `value` is object-like. A value is object-like if it's not `null` + * and has a `typeof` result of "object". + * + * @static + * @memberOf _ + * @since 4.0.0 + * @category Lang + * @param {*} value The value to check. + * @returns {boolean} Returns `true` if `value` is object-like, else `false`. + * @example + * + * _.isObjectLike({}); + * // => true + * + * _.isObjectLike([1, 2, 3]); + * // => true + * + * _.isObjectLike(_.noop); + * // => false + * + * _.isObjectLike(null); + * // => false + */ +function isObjectLike(value) { + return !!value && typeof value == 'object'; +} + +/** + * Checks if `value` is classified as a `Symbol` primitive or object. + * + * @static + * @memberOf _ + * @since 4.0.0 + * @category Lang + * @param {*} value The value to check. + * @returns {boolean} Returns `true` if `value` is a symbol, else `false`. + * @example + * + * _.isSymbol(Symbol.iterator); + * // => true + * + * _.isSymbol('abc'); + * // => false + */ +function isSymbol(value) { + return typeof value == 'symbol' || + (isObjectLike(value) && objectToString.call(value) == symbolTag); +} + +/** + * Checks if `value` is classified as a typed array. + * + * @static + * @memberOf _ + * @since 3.0.0 + * @category Lang + * @param {*} value The value to check. + * @returns {boolean} Returns `true` if `value` is a typed array, else `false`. + * @example + * + * _.isTypedArray(new Uint8Array); + * // => true + * + * _.isTypedArray([]); + * // => false + */ +var isTypedArray = nodeIsTypedArray ? baseUnary(nodeIsTypedArray) : baseIsTypedArray; + +/** + * Converts `value` to a string. An empty string is returned for `null` + * and `undefined` values. The sign of `-0` is preserved. + * + * @static + * @memberOf _ + * @since 4.0.0 + * @category Lang + * @param {*} value The value to process. + * @returns {string} Returns the string. + * @example + * + * _.toString(null); + * // => '' + * + * _.toString(-0); + * // => '-0' + * + * _.toString([1, 2, 3]); + * // => '1,2,3' + */ +function toString(value) { + return value == null ? '' : baseToString(value); +} + +/** + * Gets the value at `path` of `object`. If the resolved value is + * `undefined`, the `defaultValue` is returned in its place. + * + * @static + * @memberOf _ + * @since 3.7.0 + * @category Object + * @param {Object} object The object to query. + * @param {Array|string} path The path of the property to get. + * @param {*} [defaultValue] The value returned for `undefined` resolved values. + * @returns {*} Returns the resolved value. + * @example + * + * var object = { 'a': [{ 'b': { 'c': 3 } }] }; + * + * _.get(object, 'a[0].b.c'); + * // => 3 + * + * _.get(object, ['a', '0', 'b', 'c']); + * // => 3 + * + * _.get(object, 'a.b.c', 'default'); + * // => 'default' + */ +function get(object, path, defaultValue) { + var result = object == null ? undefined : baseGet(object, path); + return result === undefined ? defaultValue : result; +} + +/** + * Checks if `path` is a direct or inherited property of `object`. + * + * @static + * @memberOf _ + * @since 4.0.0 + * @category Object + * @param {Object} object The object to query. + * @param {Array|string} path The path to check. + * @returns {boolean} Returns `true` if `path` exists, else `false`. + * @example + * + * var object = _.create({ 'a': _.create({ 'b': 2 }) }); + * + * _.hasIn(object, 'a'); + * // => true + * + * _.hasIn(object, 'a.b'); + * // => true + * + * _.hasIn(object, ['a', 'b']); + * // => true + * + * _.hasIn(object, 'b'); + * // => false + */ +function hasIn(object, path) { + return object != null && hasPath(object, path, baseHasIn); +} + +/** + * Creates an array of the own enumerable property names of `object`. + * + * **Note:** Non-object values are coerced to objects. See the + * [ES spec](http://ecma-international.org/ecma-262/7.0/#sec-object.keys) + * for more details. + * + * @static + * @since 0.1.0 + * @memberOf _ + * @category Object + * @param {Object} object The object to query. + * @returns {Array} Returns the array of property names. + * @example + * + * function Foo() { + * this.a = 1; + * this.b = 2; + * } + * + * Foo.prototype.c = 3; + * + * _.keys(new Foo); + * // => ['a', 'b'] (iteration order is not guaranteed) + * + * _.keys('hi'); + * // => ['0', '1'] + */ +function keys(object) { + return isArrayLike(object) ? arrayLikeKeys(object) : baseKeys(object); +} + +/** + * This method returns the first argument it receives. + * + * @static + * @since 0.1.0 + * @memberOf _ + * @category Util + * @param {*} value Any value. + * @returns {*} Returns `value`. + * @example + * + * var object = { 'a': 1 }; + * + * console.log(_.identity(object) === object); + * // => true + */ +function identity(value) { + return value; +} + +/** + * Creates a function that returns the value at `path` of a given object. + * + * @static + * @memberOf _ + * @since 2.4.0 + * @category Util + * @param {Array|string} path The path of the property to get. + * @returns {Function} Returns the new accessor function. + * @example + * + * var objects = [ + * { 'a': { 'b': 2 } }, + * { 'a': { 'b': 1 } } + * ]; + * + * _.map(objects, _.property('a.b')); + * // => [2, 1] + * + * _.map(_.sortBy(objects, _.property(['a', 'b'])), 'a.b'); + * // => [1, 2] + */ +function property(path) { + return isKey(path) ? baseProperty(toKey(path)) : basePropertyDeep(path); +} + +module.exports = sortBy; +}); + +var parsers$2 = createCommonjsModule(function (module, exports) { +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); + + + + +// The exponent value(s) at which toString returns exponential notation. +bignumber.BigNumber.config({ EXPONENTIAL_AT: [-5, 15] }); +class BaseNumberParser { + constructor(config) { + this.config = config; + let singleIntFrac = `${this.config.wordSeparatorToken}| -|${this.getKeyRegex(this.config.cardinalNumberMap)}|${this.getKeyRegex(this.config.ordinalNumberMap)}`; + this.textNumberRegex = recognizersText.RegExpUtility.getSafeRegExp(String.raw `(?=\b)(${singleIntFrac})(?=\b)`, "gis"); + this.arabicNumberRegex = recognizersText.RegExpUtility.getSafeRegExp(String.raw `\d+`, "is"); + this.roundNumberSet = new Set(); + this.config.roundNumberMap.forEach((value, key) => this.roundNumberSet.add(key)); + } + parse(extResult) { + // check if the parser is configured to support specific types + if (this.supportedTypes && !this.supportedTypes.find(t => t === extResult.type)) { + return null; + } + let ret = null; + let extra = extResult.data; + if (!extra) { + if (this.arabicNumberRegex.test(extResult.text)) { + extra = "Num"; + } + else { + extra = this.config.langMarker; + } + } + // Resolve symbol prefix + let isNegative = false; + let matchNegative = extResult.text.match(this.config.negativeNumberSignRegex); + if (matchNegative) { + isNegative = true; + extResult.text = extResult.text.substr(matchNegative[1].length); + } + if (extra.includes("Num")) { + ret = this.digitNumberParse(extResult); + } + else if (extra.includes(`Frac${this.config.langMarker}`)) // Frac is a special number, parse via another method + { + ret = this.fracLikeNumberParse(extResult); + } + else if (extra.includes(this.config.langMarker)) { + ret = this.textNumberParse(extResult); + } + else if (extra.includes("Pow")) { + ret = this.powerNumberParse(extResult); + } + if (ret && ret.value !== null) { + if (isNegative) { + // Recover to the original extracted Text + ret.text = matchNegative[1] + extResult.text; + // Check if ret.value is a BigNumber + if (typeof ret.value === "number") { + ret.value = -ret.value; + } + else { + ret.value.s = -1; + } + } + ret.resolutionStr = this.config.cultureInfo + ? this.config.cultureInfo.format(ret.value) + : ret.value.toString(); + } + return ret; + } + getKeyRegex(regexMap) { + let keys = new Array(); + regexMap.forEach((value, key) => keys.push(key)); + let sortKeys = lodash_sortby(keys, key => key.length).reverse(); + return sortKeys.join('|'); + } + digitNumberParse(extResult) { + let result = { + start: extResult.start, + length: extResult.length, + text: extResult.text, + type: extResult.type + }; + // [1] 24 + // [2] 12 32/33 + // [3] 1,000,000 + // [4] 234.567 + // [5] 44/55 + // [6] 2 hundred + // dot occured. + let power = 1; + let tmpIndex = -1; + let startIndex = 0; + let handle = extResult.text.toLowerCase(); + let matches = recognizersText.RegExpUtility.getMatches(this.config.digitalNumberRegex, handle); + if (matches) { + matches.forEach(match => { + // HACK: Matching regex may be buggy, may include a digit before the unit + match.value = match.value.replace(/\d/g, ''); + match.length = match.value.length; + let rep = this.config.roundNumberMap.get(match.value); + // \\s+ for filter the spaces. + power *= rep; + // tslint:disable-next-line:no-conditional-assignment + while ((tmpIndex = handle.indexOf(match.value, startIndex)) >= 0) { + let front = lodash_trimend(handle.substring(0, tmpIndex)); + startIndex = front.length; + handle = front + handle.substring(tmpIndex + match.length); + } + }); + } + // scale used in the calculate of double + result.value = this.getDigitalValue(handle, power); + return result; + } + isDigit(c) { + return c >= '0' && c <= '9'; + } + fracLikeNumberParse(extResult) { + let result = { + start: extResult.start, + length: extResult.length, + text: extResult.text, + type: extResult.type + }; + let resultText = extResult.text.toLowerCase(); + if (resultText.includes(this.config.fractionMarkerToken)) { + let overIndex = resultText.indexOf(this.config.fractionMarkerToken); + let smallPart = resultText.substring(0, overIndex).trim(); + let bigPart = resultText.substring(overIndex + this.config.fractionMarkerToken.length, resultText.length).trim(); + let smallValue = this.isDigit(smallPart[0]) + ? this.getDigitalValue(smallPart, 1) + : this.getIntValue(this.getMatches(smallPart)); + let bigValue = this.isDigit(bigPart[0]) + ? this.getDigitalValue(bigPart, 1) + : this.getIntValue(this.getMatches(bigPart)); + result.value = smallValue / bigValue; + } + else { + let words = resultText.split(" ").filter(s => s && s.length); + let fracWords = Array.from(this.config.normalizeTokenSet(words, result)); + // Split fraction with integer + let splitIndex = fracWords.length - 1; + let currentValue = this.config.resolveCompositeNumber(fracWords[splitIndex]); + let roundValue = 1; + for (splitIndex = fracWords.length - 2; splitIndex >= 0; splitIndex--) { + if (this.config.writtenFractionSeparatorTexts.indexOf(fracWords[splitIndex]) > -1 || + this.config.writtenIntegerSeparatorTexts.indexOf(fracWords[splitIndex]) > -1) { + continue; + } + let previousValue = currentValue; + currentValue = this.config.resolveCompositeNumber(fracWords[splitIndex]); + let smHundreds = 100; + // previous : hundred + // current : one + if ((previousValue >= smHundreds && previousValue > currentValue) + || (previousValue < smHundreds && this.isComposable(currentValue, previousValue))) { + if (previousValue < smHundreds && currentValue >= roundValue) { + roundValue = currentValue; + } + else if (previousValue < smHundreds && currentValue < roundValue) { + splitIndex++; + break; + } + // current is the first word + if (splitIndex === 0) { + // scan, skip the first word + splitIndex = 1; + while (splitIndex <= fracWords.length - 2) { + // e.g. one hundred thousand + // frac[i+1] % 100 && frac[i] % 100 = 0 + if (this.config.resolveCompositeNumber(fracWords[splitIndex]) >= smHundreds + && !(this.config.writtenFractionSeparatorTexts.indexOf(fracWords[splitIndex + 1]) > -1) + && this.config.resolveCompositeNumber(fracWords[splitIndex + 1]) < smHundreds) { + splitIndex++; + break; + } + splitIndex++; + } + break; + } + continue; + } + splitIndex++; + break; + } + let fracPart = new Array(); + for (let i = splitIndex; i < fracWords.length; i++) { + if (fracWords[i].indexOf("-") > -1) { + let split = fracWords[i].split('-'); + fracPart.push(split[0]); + fracPart.push("-"); + fracPart.push(split[1]); + } + else { + fracPart.push(fracWords[i]); + } + } + fracWords.splice(splitIndex, fracWords.length - splitIndex); + // denomi = denominator + let denomiValue = this.getIntValue(fracPart); + // Split mixed number with fraction + let numerValue = 0; + let intValue = 0; + let mixedIndex = fracWords.length; + for (let i = fracWords.length - 1; i >= 0; i--) { + if (i < fracWords.length - 1 && this.config.writtenFractionSeparatorTexts.indexOf(fracWords[i]) > -1) { + let numerStr = fracWords.slice(i + 1, fracWords.length).join(" "); + numerValue = this.getIntValue(this.getMatches(numerStr)); + mixedIndex = i + 1; + break; + } + } + let intStr = fracWords.slice(0, mixedIndex).join(" "); + intValue = this.getIntValue(this.getMatches(intStr)); + // Find mixed number + if (mixedIndex !== fracWords.length && numerValue < denomiValue) { + // intValue + numerValue / denomiValue + result.value = new bignumber.BigNumber(intValue).plus(new bignumber.BigNumber(numerValue).dividedBy(denomiValue)); + } + else { + // (intValue + numerValue) / denomiValue + result.value = new bignumber.BigNumber(intValue + numerValue).dividedBy(denomiValue); + } + } + return result; + } + textNumberParse(extResult) { + let result = { + start: extResult.start, + length: extResult.length, + text: extResult.text, + type: extResult.type + }; + let handle = extResult.text.toLowerCase(); + handle = handle.replace(this.config.halfADozenRegex, this.config.halfADozenText); + let numGroup = this.splitMulti(handle, Array.from(this.config.writtenDecimalSeparatorTexts)).filter(s => s && s.length > 0); + let intPart = numGroup[0]; + let matchStrs = intPart + ? intPart.match(this.textNumberRegex).map(s => s.toLowerCase()) + : new Array(); + // Get the value recursively + let intPartRet = this.getIntValue(matchStrs); + let pointPartRet = 0; + if (numGroup.length === 2) { + let pointPart = numGroup[1]; + let matchStrs = pointPart.match(this.textNumberRegex).map(s => s.toLowerCase()); + pointPartRet += this.getPointValue(matchStrs); + } + result.value = intPartRet + pointPartRet; + return result; + } + powerNumberParse(extResult) { + let result = { + start: extResult.start, + length: extResult.length, + text: extResult.text, + type: extResult.type + }; + let handle = extResult.text.toUpperCase(); + let isE = !extResult.text.includes("^"); + // [1] 1e10 + // [2] 1.1^-23 + let calStack = new Array(); + let scale = new bignumber.BigNumber(10); + let dot = false; + let isNegative = false; + let tmp = new bignumber.BigNumber(0); + for (let i = 0; i < handle.length; i++) { + let ch = handle[i]; + if (ch === '^' || ch === 'E') { + if (isNegative) { + calStack.push(tmp.negated()); + } + else { + calStack.push(tmp); + } + tmp = new bignumber.BigNumber(0); + scale = new bignumber.BigNumber(10); + dot = false; + isNegative = false; + } + else if (ch.charCodeAt(0) - 48 >= 0 && ch.charCodeAt(0) - 48 <= 9) { + if (dot) { + // tmp = tmp + scale * (ch.charCodeAt(0) - 48); + // scale *= 0.1; + tmp = tmp.plus(scale.times(ch.charCodeAt(0) - 48)); + scale = scale.times(0.1); + } + else { + // tmp = tmp * scale + (ch.charCodeAt(0) - 48); + tmp = tmp.times(scale).plus(ch.charCodeAt(0) - 48); + } + } + else if (ch === this.config.decimalSeparatorChar) { + dot = true; + scale = new bignumber.BigNumber(0.1); + } + else if (ch === '-') { + isNegative = !isNegative; + } + else if (ch === '+') { + continue; + } + if (i === handle.length - 1) { + if (isNegative) { + calStack.push(tmp.negated()); + } + else { + calStack.push(tmp); + } + } + } + let ret = 0; + if (isE) { + // ret = calStack.shift() * Math.pow(10, calStack.shift()); + ret = calStack.shift().times(Math.pow(10, calStack.shift().toNumber())).toNumber(); + } + else { + ret = Math.pow(calStack.shift().toNumber(), calStack.shift().toNumber()); + } + result.value = ret; + result.resolutionStr = ret.toString(); // @TODO Possible Culture bug. + return result; + } + splitMulti(str, tokens) { + let tempChar = tokens[0]; // We can use the first token as a temporary join character + for (let i = 0; i < tokens.length; i++) { + str = str.split(tokens[i]).join(tempChar); + } + return str.split(tempChar); + } + getMatches(input) { + let matches = input.match(this.textNumberRegex); + return (matches || []).map(match => { + return match.toLowerCase(); + }); + } + // Test if big and combine with small. + // e.g. "hundred" can combine with "thirty" but "twenty" can't combine with "thirty". + isComposable(big, small) { + let baseNumber = small > 10 ? 100 : 10; + if (big % baseNumber === 0 && big / baseNumber >= 1) { + return true; + } + return false; + } + getIntValue(matchStrs) { + let isEnd = new Array(matchStrs.length); + for (let i = 0; i < isEnd.length; i++) { + isEnd[i] = false; + } + let tempValue = 0; + let endFlag = 1; + // Scan from end to start, find the end word + for (let i = matchStrs.length - 1; i >= 0; i--) { + if (this.roundNumberSet.has(matchStrs[i])) { + // if false,then continue + // You will meet hundred first, then thousand. + if (endFlag > this.config.roundNumberMap.get(matchStrs[i])) { + continue; + } + isEnd[i] = true; + endFlag = this.config.roundNumberMap.get(matchStrs[i]); + } + } + if (endFlag === 1) { + let tempStack = new Array(); + let oldSym = ""; + matchStrs.forEach(matchStr => { + let isCardinal = this.config.cardinalNumberMap.has(matchStr); + let isOrdinal = this.config.ordinalNumberMap.has(matchStr); + if (isCardinal || isOrdinal) { + let matchValue = isCardinal + ? this.config.cardinalNumberMap.get(matchStr) + : this.config.ordinalNumberMap.get(matchStr); + // This is just for ordinal now. Not for fraction ever. + if (isOrdinal) { + let fracPart = this.config.ordinalNumberMap.get(matchStr); + if (tempStack.length > 0) { + let intPart = tempStack.pop(); + // if intPart >= fracPart, it means it is an ordinal number + // it begins with an integer, ends with an ordinal + // e.g. ninety-ninth + if (intPart >= fracPart) { + tempStack.push(intPart + fracPart); + } + // another case of the type is ordinal + // e.g. three hundredth + else { + while (tempStack.length > 0) { + intPart = intPart + tempStack.pop(); + } + tempStack.push(intPart * fracPart); + } + } + else { + tempStack.push(fracPart); + } + } + else if (this.config.cardinalNumberMap.has(matchStr)) { + if (oldSym === "-") { + let sum = tempStack.pop() + matchValue; + tempStack.push(sum); + } + else if (oldSym === this.config.writtenIntegerSeparatorTexts[0] || tempStack.length < 2) { + tempStack.push(matchValue); + } + else if (tempStack.length >= 2) { + let sum = tempStack.pop() + matchValue; + sum = tempStack.pop() + sum; + tempStack.push(sum); + } + } + } + else { + let complexValue = this.config.resolveCompositeNumber(matchStr); + if (complexValue !== 0) { + tempStack.push(complexValue); + } + } + oldSym = matchStr; + }); + tempStack.forEach(stackValue => { + tempValue += stackValue; + }); + } + else { + let lastIndex = 0; + let mulValue = 1; + let partValue = 1; + for (let i = 0; i < isEnd.length; i++) { + if (isEnd[i]) { + mulValue = this.config.roundNumberMap.get(matchStrs[i]); + partValue = 1; + if (i !== 0) { + partValue = this.getIntValue(matchStrs.slice(lastIndex, i)); + } + tempValue += mulValue * partValue; + lastIndex = i + 1; + } + } + // Calculate the part like "thirty-one" + mulValue = 1; + if (lastIndex !== isEnd.length) { + partValue = this.getIntValue(matchStrs.slice(lastIndex, isEnd.length)); + tempValue += mulValue * partValue; + } + } + return tempValue; + } + getPointValue(matchStrs) { + let ret = 0; + let firstMatch = matchStrs[0]; + if (this.config.cardinalNumberMap.has(firstMatch) && this.config.cardinalNumberMap.get(firstMatch) >= 10) { + let prefix = "0."; + let tempInt = this.getIntValue(matchStrs); + let all = prefix + tempInt; + ret = parseFloat(all); + } + else { + let scale = new bignumber.BigNumber(0.1); + for (let i = 0; i < matchStrs.length; i++) { + ret += scale.times(this.config.cardinalNumberMap.get(matchStrs[i])).toNumber(); + // scale *= 0.1; + scale = scale.times(0.1); + } + } + return ret; + } + skipNonDecimalSeparator(ch, distance, culture) { + var decimalLength = 3; + // Special cases for multi-language countries where decimal separators can be used interchangeably. Mostly informally. + // Ex: South Africa, Namibia; Puerto Rico in ES; or in Canada for EN and FR. + // "me pidio $5.00 prestados" and "me pidio $5,00 prestados" -> currency $5 + var cultureRegex = recognizersText.RegExpUtility.getSafeRegExp(String.raw `^(en|es|fr)(-)?\b`, "is"); + return (ch == this.config.nonDecimalSeparatorChar && !(distance <= decimalLength && (cultureRegex.exec(culture.code) !== null))); + } + getDigitalValue(digitsStr, power) { + let tmp = new bignumber.BigNumber(0); + let scale = new bignumber.BigNumber(10); + let decimalSeparator = false; + var strLength = digitsStr.length; + let isNegative = false; + let isFrac = digitsStr.includes('/'); + let calStack = new Array(); + for (let i = 0; i < digitsStr.length; i++) { + let ch = digitsStr[i]; + var skippableNonDecimal = this.skipNonDecimalSeparator(ch, strLength - i, this.config.cultureInfo); + if (!isFrac && (ch === ' ' || skippableNonDecimal)) { + continue; + } + if (ch === ' ' || ch === '/') { + calStack.push(tmp); + tmp = new bignumber.BigNumber(0); + } + else if (ch >= '0' && ch <= '9') { + if (decimalSeparator) { + // tmp = tmp + scale * (ch.charCodeAt(0) - 48); + // scale *= 0.1; + tmp = tmp.plus(scale.times(ch.charCodeAt(0) - 48)); + scale = scale.times(0.1); + } + else { + // tmp = tmp * scale + (ch.charCodeAt(0) - 48); + tmp = tmp.times(scale).plus(ch.charCodeAt(0) - 48); + } + } + else if (ch === this.config.decimalSeparatorChar || (!skippableNonDecimal && ch == this.config.nonDecimalSeparatorChar)) { + decimalSeparator = true; + scale = new bignumber.BigNumber(0.1); + } + else if (ch === '-') { + isNegative = true; + } + } + calStack.push(tmp); + // if the number is a fraction. + let calResult = new bignumber.BigNumber(0); + if (isFrac) { + let deno = calStack.pop(); + let mole = calStack.pop(); + // calResult += mole / deno; + calResult = calResult.plus(mole.dividedBy(deno)); + } + while (calStack.length > 0) { + calResult = calResult.plus(calStack.pop()); + } + // calResult *= power; + calResult = calResult.times(power); + if (isNegative) { + return calResult.negated().toNumber(); + } + return calResult.toNumber(); + } +} +exports.BaseNumberParser = BaseNumberParser; +class BasePercentageParser extends BaseNumberParser { + parse(extResult) { + let originText = extResult.text; + // do replace text & data from extended info + if (extResult.data && extResult.data instanceof Array) { + extResult.text = extResult.data[0]; + extResult.data = extResult.data[1].data; + } + let ret = super.parse(extResult); + if (ret.resolutionStr && ret.resolutionStr.length > 0) { + if (!ret.resolutionStr.trim().endsWith("%")) { + ret.resolutionStr = ret.resolutionStr.trim() + "%"; + } + } + ret.data = extResult.text; + ret.text = originText; + return ret; + } +} +exports.BasePercentageParser = BasePercentageParser; + +}); + +unwrapExports(parsers$2); + +var cjkParsers = createCommonjsModule(function (module, exports) { +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); + + + +const recognizers_text_2 = recognizersText; +class BaseCJKNumberParser extends parsers$2.BaseNumberParser { + constructor(config) { + super(config); + this.config = config; + } + toString(value) { + return this.config.cultureInfo + ? this.config.cultureInfo.format(value) + : value.toString(); + } + parse(extResult) { + let extra = ''; + let result; + extra = extResult.data; + let getExtResult = { + start: extResult.start, + length: extResult.length, + data: extResult.data, + text: this.replaceTraditionalWithSimplified(extResult.text), + type: extResult.type + }; + if (!extra) { + return result; + } + if (extra.includes("Per")) { + result = this.perParseCJK(getExtResult); + } + else if (extra.includes("Num")) { + getExtResult.text = this.replaceFullWithHalf(getExtResult.text); + result = this.digitNumberParse(getExtResult); + if (this.config.negativeNumberSignRegex.test(getExtResult.text) && result.value > 0) { + result.value = -result.value; + } + result.resolutionStr = this.toString(result.value); + } + else if (extra.includes("Pow")) { + getExtResult.text = this.replaceFullWithHalf(getExtResult.text); + result = this.powerNumberParse(getExtResult); + result.resolutionStr = this.toString(result.value); + } + else if (extra.includes("Frac")) { + result = this.fracParseCJK(getExtResult); + } + else if (extra.includes("Dou")) { + result = this.douParseCJK(getExtResult); + } + else if (extra.includes("Integer")) { + result = this.intParseCJK(getExtResult); + } + else if (extra.includes("Ordinal")) { + result = this.ordParseCJK(getExtResult); + } + if (result) { + result.text = extResult.text; + } + return result; + } + replaceTraditionalWithSimplified(value) { + if (recognizers_text_2.StringUtility.isNullOrWhitespace(value)) { + return value; + } + if (this.config.tratoSimMap == null) { + return value; + } + let result = ''; + for (let index = 0; index < value.length; index++) { + result = result.concat(this.config.tratoSimMap.get(value.charAt(index)) || value.charAt(index)); + } + return result; + } + replaceFullWithHalf(value) { + if (recognizers_text_2.StringUtility.isNullOrWhitespace(value)) { + return value; + } + let result = ''; + for (let index = 0; index < value.length; index++) { + result = result.concat(this.config.fullToHalfMap.get(value.charAt(index)) || value.charAt(index)); + } + return result; + } + replaceUnit(value) { + if (recognizers_text_2.StringUtility.isNullOrEmpty(value)) + return value; + let result = value; + this.config.unitMap.forEach((value, key) => { + result = result.replace(new RegExp(key, 'g'), value); + }); + return result; + } + perParseCJK(extResult) { + let result = new recognizersText.ParseResult(extResult); + let resultText = extResult.text; + let power = 1; + if (extResult.data.includes("Spe")) { + resultText = this.replaceFullWithHalf(resultText); + resultText = this.replaceUnit(resultText); + if (resultText === "半額" || resultText === "半折" || resultText === "半折") { + result.value = 50; + } + else if (resultText === "10成" || resultText === "10割" || resultText === "十割") { + result.value = 100; + } + else { + let matches = recognizers_text_2.RegExpUtility.getMatches(this.config.speGetNumberRegex, resultText); + let intNumber; + if (matches.length === 2) { + let intNumberChar = matches[0].value.charAt(0); + if (intNumberChar === '対' || intNumberChar === "对") { + intNumber = 5; + } + else if (intNumberChar === "十" || intNumberChar === "拾") { + intNumber = 10; + } + else { + intNumber = this.config.zeroToNineMap.get(intNumberChar); + } + let pointNumberChar = matches[1].value.charAt(0); + let pointNumber; + if (pointNumberChar === "半") { + pointNumber = 0.5; + } + else { + pointNumber = this.config.zeroToNineMap.get(pointNumberChar) * 0.1; + } + result.value = (intNumber + pointNumber) * 10; + } + else if (matches.length === 5) { + // Deal the Japanese percentage case like "xxx割xxx分xxx厘", get the integer value and convert into result. + let intNumberChar = matches[0].value.charAt(0); + let pointNumberChar = matches[1].value.charAt(0); + let dotNumberChar = matches[3].value.charAt(0); + let pointNumber = this.config.zeroToNineMap.get(pointNumberChar) * 0.1; + let dotNumber = this.config.zeroToNineMap.get(dotNumberChar) * 0.01; + intNumber = this.config.zeroToNineMap.get(intNumberChar); + result.value = (intNumber + pointNumber + dotNumber) * 10; + } + else { + let intNumberChar = matches[0].value.charAt(0); + if (intNumberChar === '対' || intNumberChar === "对") { + intNumber = 5; + } + else if (intNumberChar === "十" || intNumberChar === "拾") { + intNumber = 10; + } + else { + intNumber = this.config.zeroToNineMap.get(intNumberChar); + } + result.value = intNumber * 10; + } + } + } + else if (extResult.data.includes("Num")) { + let doubleMatch = recognizers_text_2.RegExpUtility.getMatches(this.config.percentageRegex, resultText).pop(); + let doubleText = doubleMatch.value; + if (doubleText.includes("k") || doubleText.includes("K") || doubleText.includes("k") || doubleText.includes("K")) { + power = 1000; + } + if (doubleText.includes("M") || doubleText.includes("M")) { + power = 1000000; + } + if (doubleText.includes("G") || doubleText.includes("G")) { + power = 1000000000; + } + if (doubleText.includes("T") || doubleText.includes("T")) { + power = 1000000000000; + } + result.value = this.getDigitValueCJK(resultText, power); + } + else { + let doubleMatch = recognizers_text_2.RegExpUtility.getMatches(this.config.percentageRegex, resultText).pop(); + let doubleText = this.replaceUnit(doubleMatch.value); + let splitResult = recognizers_text_2.RegExpUtility.split(this.config.pointRegex, doubleText); + if (splitResult[0] === "") { + splitResult[0] = "零"; + } + let doubleValue = this.getIntValueCJK(splitResult[0]); + if (splitResult.length === 2) { + if (recognizers_text_2.RegExpUtility.isMatch(this.config.negativeNumberSignRegex, splitResult[0])) { + doubleValue -= this.getPointValueCJK(splitResult[1]); + } + else { + doubleValue += this.getPointValueCJK(splitResult[1]); + } + } + result.value = doubleValue; + } + result.resolutionStr = this.toString(result.value) + "%"; + return result; + } + fracParseCJK(extResult) { + let result = new recognizersText.ParseResult(extResult); + let resultText = extResult.text; + let splitResult = recognizers_text_2.RegExpUtility.split(this.config.fracSplitRegex, resultText); + let intPart = ""; + let demoPart = ""; + let numPart = ""; + if (splitResult.length === 3) { + intPart = splitResult[0] || ""; + demoPart = splitResult[1] || ""; + numPart = splitResult[2] || ""; + } + else { + intPart = "零"; + demoPart = splitResult[0] || ""; + numPart = splitResult[1] || ""; + } + let intValue = this.isDigitCJK(intPart) + ? this.getDigitValueCJK(intPart, 1.0) + : this.getIntValueCJK(intPart); + let numValue = this.isDigitCJK(numPart) + ? this.getDigitValueCJK(numPart, 1.0) + : this.getIntValueCJK(numPart); + let demoValue = this.isDigitCJK(demoPart) + ? this.getDigitValueCJK(demoPart, 1.0) + : this.getIntValueCJK(demoPart); + if (recognizers_text_2.RegExpUtility.isMatch(this.config.negativeNumberSignRegex, intPart)) { + result.value = intValue - numValue / demoValue; + } + else { + result.value = intValue + numValue / demoValue; + } + result.resolutionStr = this.toString(result.value); + return result; + } + douParseCJK(extResult) { + let result = new recognizersText.ParseResult(extResult); + let resultText = extResult.text; + if (recognizers_text_2.RegExpUtility.isMatch(this.config.doubleAndRoundRegex, resultText)) { + resultText = this.replaceUnit(resultText); + let power = this.config.roundNumberMapChar.get(resultText.charAt(resultText.length - 1)); + result.value = this.getDigitValueCJK(resultText.substr(0, resultText.length - 1), power); + } + else { + resultText = this.replaceUnit(resultText); + let splitResult = recognizers_text_2.RegExpUtility.split(this.config.pointRegex, resultText); + if (splitResult[0] === "") { + splitResult[0] = "零"; + } + if (recognizers_text_2.RegExpUtility.isMatch(this.config.negativeNumberSignRegex, splitResult[0])) { + result.value = this.getIntValueCJK(splitResult[0]) - this.getPointValueCJK(splitResult[1]); + } + else { + result.value = this.getIntValueCJK(splitResult[0]) + this.getPointValueCJK(splitResult[1]); + } + } + result.resolutionStr = this.toString(result.value); + return result; + } + intParseCJK(extResult) { + let result = new recognizersText.ParseResult(extResult); + result.value = this.getIntValueCJK(extResult.text); + result.resolutionStr = this.toString(result.value); + return result; + } + ordParseCJK(extResult) { + let result = new recognizersText.ParseResult(extResult); + let resultText = extResult.text.substr(1); + if (recognizers_text_2.RegExpUtility.isMatch(this.config.digitNumRegex, resultText) && !recognizers_text_2.RegExpUtility.isMatch(this.config.roundNumberIntegerRegex, resultText)) { + result.value = this.getDigitValueCJK(resultText, 1); + } + else { + result.value = this.getIntValueCJK(resultText); + } + result.resolutionStr = this.toString(result.value); + return result; + } + getDigitValueCJK(value, power) { + let isNegative = false; + let resultStr = value; + if (recognizers_text_2.RegExpUtility.isMatch(this.config.negativeNumberSignRegex, resultStr)) { + isNegative = true; + resultStr = resultStr.substr(1); + } + resultStr = this.replaceFullWithHalf(resultStr); + let result = this.getDigitalValue(resultStr, power); + if (isNegative) { + result = -result; + } + return result; + } + getIntValueCJK(value) { + let resultStr = value; + let isDozen = false; + let isPair = false; + if (recognizers_text_2.RegExpUtility.isMatch(this.config.dozenRegex, resultStr)) { + isDozen = true; + if (this.config.cultureInfo.code.toLowerCase() === culture$2.Culture.Chinese) { + resultStr = resultStr.substr(0, resultStr.length - 1); + } + else if (this.config.cultureInfo.code.toLowerCase() === culture$2.Culture.Japanese) { + resultStr = resultStr.substr(0, resultStr.length - 3); + } + } + else if (recognizers_text_2.RegExpUtility.isMatch(this.config.pairRegex, resultStr)) { + isPair = true; + resultStr = resultStr.substr(0, resultStr.length - 1); + } + resultStr = this.replaceUnit(resultStr); + let intValue = 0; + let partValue = 0; + let beforeValue = 0; + let isRoundBefore = false; + let roundBefore = -1; + let roundDefault = 1; + let isNegative = false; + let hasNumber = false; + if (recognizers_text_2.RegExpUtility.isMatch(this.config.negativeNumberSignRegex, resultStr)) { + isNegative = true; + resultStr = resultStr.substr(1); + } + for (let index = 0; index < resultStr.length; index++) { + let currentChar = resultStr.charAt(index); + if (this.config.roundNumberMapChar.has(currentChar)) { + let roundRecent = this.config.roundNumberMapChar.get(currentChar); + if (!hasNumber) { + beforeValue = 1; + } + if (roundBefore !== -1 && roundRecent > roundBefore) { + if (isRoundBefore) { + intValue += partValue * roundRecent; + isRoundBefore = false; + } + else { + partValue += beforeValue * roundDefault; + intValue += partValue * roundRecent; + } + roundBefore = -1; + partValue = 0; + } + else { + isRoundBefore = true; + partValue += beforeValue * roundRecent; + roundBefore = roundRecent; + if ((index === resultStr.length - 1) || this.config.roundDirectList.some(o => o === currentChar)) { + intValue += partValue; + partValue = 0; + } + } + hasNumber = false; + beforeValue = 0; + roundDefault = roundRecent / 10; + } + else if (this.config.zeroToNineMap.has(currentChar)) { + hasNumber = true; + if (index !== resultStr.length - 1) { + if ((currentChar === "零") && !this.config.roundNumberMapChar.has(resultStr.charAt(index + 1))) { + roundDefault = 1; + } + else { + beforeValue = beforeValue * 10 + this.config.zeroToNineMap.get(currentChar); + isRoundBefore = false; + } + } + else { + if (index === resultStr.length - 1 && this.config.cultureInfo.code.toLowerCase() === culture$2.Culture.Japanese) { + roundDefault = 1; + } + partValue += beforeValue * 10; + partValue += this.config.zeroToNineMap.get(currentChar) * roundDefault; + intValue += partValue; + partValue = 0; + } + } + } + if (isNegative) { + intValue = -intValue; + } + if (isDozen) { + intValue = intValue * 12; + } + if (isPair) { + intValue = intValue * 2; + } + return intValue; + } + getPointValueCJK(value) { + let result = 0; + let scale = 0.1; + for (let index = 0; index < value.length; index++) { + result += scale * this.config.zeroToNineMap.get(value.charAt(index)); + scale *= 0.1; + } + return result; + } + isDigitCJK(value) { + return !recognizers_text_2.StringUtility.isNullOrEmpty(value) + && recognizers_text_2.RegExpUtility.isMatch(this.config.digitNumRegex, value); + } +} +exports.BaseCJKNumberParser = BaseCJKNumberParser; + +}); + +unwrapExports(cjkParsers); + +var agnosticNumberParser = createCommonjsModule(function (module, exports) { +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); + + + + +var AgnosticNumberParserType; +(function (AgnosticNumberParserType) { + AgnosticNumberParserType[AgnosticNumberParserType["Cardinal"] = 0] = "Cardinal"; + AgnosticNumberParserType[AgnosticNumberParserType["Double"] = 1] = "Double"; + AgnosticNumberParserType[AgnosticNumberParserType["Fraction"] = 2] = "Fraction"; + AgnosticNumberParserType[AgnosticNumberParserType["Integer"] = 3] = "Integer"; + AgnosticNumberParserType[AgnosticNumberParserType["Number"] = 4] = "Number"; + AgnosticNumberParserType[AgnosticNumberParserType["Ordinal"] = 5] = "Ordinal"; + AgnosticNumberParserType[AgnosticNumberParserType["Percentage"] = 6] = "Percentage"; +})(AgnosticNumberParserType = exports.AgnosticNumberParserType || (exports.AgnosticNumberParserType = {})); +class AgnosticNumberParserFactory { + static getParser(type, languageConfiguration) { + let isChinese = languageConfiguration.cultureInfo.code.toLowerCase() === culture$2.Culture.Chinese; + let isJapanese = languageConfiguration.cultureInfo.code.toLowerCase() === culture$2.Culture.Japanese; + let parser; + if (isChinese) { + parser = new cjkParsers.BaseCJKNumberParser(languageConfiguration); + } + else if (isJapanese) { + parser = new cjkParsers.BaseCJKNumberParser(languageConfiguration); + } + else { + parser = new parsers$2.BaseNumberParser(languageConfiguration); + } + switch (type) { + case AgnosticNumberParserType.Cardinal: + parser.supportedTypes = [constants.Constants.SYS_NUM_CARDINAL, constants.Constants.SYS_NUM_INTEGER, constants.Constants.SYS_NUM_DOUBLE]; + break; + case AgnosticNumberParserType.Double: + parser.supportedTypes = [constants.Constants.SYS_NUM_DOUBLE]; + break; + case AgnosticNumberParserType.Fraction: + parser.supportedTypes = [constants.Constants.SYS_NUM_FRACTION]; + break; + case AgnosticNumberParserType.Integer: + parser.supportedTypes = [constants.Constants.SYS_NUM_INTEGER]; + break; + case AgnosticNumberParserType.Ordinal: + parser.supportedTypes = [constants.Constants.SYS_NUM_ORDINAL]; + break; + case AgnosticNumberParserType.Percentage: + if (!isChinese && !isJapanese) { + parser = new parsers$2.BasePercentageParser(languageConfiguration); + } + break; + } + return parser; + } +} +exports.AgnosticNumberParserFactory = AgnosticNumberParserFactory; + +}); + +unwrapExports(agnosticNumberParser); + +var baseNumbers = createCommonjsModule(function (module, exports) { +"use strict"; +// ------------------------------------------------------------------------------ +// +// This code was generated by a tool. +// Changes to this file may cause incorrect behavior and will be lost if +// the code is regenerated. +// +// ------------------------------------------------------------------------------ +Object.defineProperty(exports, "__esModule", { value: true }); +var BaseNumbers; +(function (BaseNumbers) { + BaseNumbers.NumberReplaceToken = '@builtin.num'; + BaseNumbers.FractionNumberReplaceToken = '@builtin.num.fraction'; + BaseNumbers.IntegerRegexDefinition = (placeholder, thousandsmark) => { return `(((? { return `(((? +// This code was generated by a tool. +// Changes to this file may cause incorrect behavior and will be lost if +// the code is regenerated. +// +// ------------------------------------------------------------------------------ +Object.defineProperty(exports, "__esModule", { value: true }); + +var EnglishNumeric; +(function (EnglishNumeric) { + EnglishNumeric.LangMarker = 'Eng'; + EnglishNumeric.RoundNumberIntegerRegex = `(hundred|thousand|million|billion|trillion)`; + EnglishNumeric.ZeroToNineIntegerRegex = `(three|seven|eight|four|five|zero|nine|one|two|six)`; + EnglishNumeric.NegativeNumberTermsRegex = `((minus|negative)\\s+)`; + EnglishNumeric.NegativeNumberSignRegex = `^${EnglishNumeric.NegativeNumberTermsRegex}.*`; + EnglishNumeric.AnIntRegex = `(an|a)(?=\\s)`; + EnglishNumeric.TenToNineteenIntegerRegex = `(seventeen|thirteen|fourteen|eighteen|nineteen|fifteen|sixteen|eleven|twelve|ten)`; + EnglishNumeric.TensNumberIntegerRegex = `(seventy|twenty|thirty|eighty|ninety|forty|fifty|sixty)`; + EnglishNumeric.SeparaIntRegex = `(((${EnglishNumeric.TenToNineteenIntegerRegex}|(${EnglishNumeric.TensNumberIntegerRegex}(\\s+(and\\s+)?|\\s*-\\s*)${EnglishNumeric.ZeroToNineIntegerRegex})|${EnglishNumeric.TensNumberIntegerRegex}|${EnglishNumeric.ZeroToNineIntegerRegex})(\\s+${EnglishNumeric.RoundNumberIntegerRegex})*))|((${EnglishNumeric.AnIntRegex}(\\s+${EnglishNumeric.RoundNumberIntegerRegex})+))`; + EnglishNumeric.AllIntRegex = `((((${EnglishNumeric.TenToNineteenIntegerRegex}|(${EnglishNumeric.TensNumberIntegerRegex}(\\s+(and\\s+)?|\\s*-\\s*)${EnglishNumeric.ZeroToNineIntegerRegex})|${EnglishNumeric.TensNumberIntegerRegex}|${EnglishNumeric.ZeroToNineIntegerRegex}|${EnglishNumeric.AnIntRegex})(\\s+${EnglishNumeric.RoundNumberIntegerRegex})+)\\s+(and\\s+)?)*${EnglishNumeric.SeparaIntRegex})`; + EnglishNumeric.PlaceHolderPureNumber = `\\b`; + EnglishNumeric.PlaceHolderDefault = `\\D|\\b`; + EnglishNumeric.NumbersWithPlaceHolder = (placeholder) => { return `(((?(${EnglishNumeric.AllIntRegex})|((?(${EnglishNumeric.AllIntRegex})|(\\d+)(?![\\.,]))(?=\\b)`; + EnglishNumeric.FractionPrepositionWithinPercentModeRegex = `(?<=\\b)(?(${EnglishNumeric.AllIntRegex})|((?(${EnglishNumeric.AllIntRegex})|(\\d+)(?![\\.,]))(?=\\b)`; + EnglishNumeric.AllPointRegex = `((\\s+${EnglishNumeric.ZeroToNineIntegerRegex})+|(\\s+${EnglishNumeric.SeparaIntRegex}))`; + EnglishNumeric.AllFloatRegex = `${EnglishNumeric.AllIntRegex}(\\s+point)${EnglishNumeric.AllPointRegex}`; + EnglishNumeric.DoubleWithMultiplierRegex = `(((? { return `(((? { return `(?<=\\s|^)(?and)`; + EnglishNumeric.NumberWithSuffixPercentage = `(?)`; + EnglishNumeric.LessRegex = `((less|lower|smaller|fewer)(\\s+than)?|below|under|(?|=)<)`; + EnglishNumeric.EqualRegex = `(equal(s|ing)?(\\s+(to|than))?|(?)=)`; + EnglishNumeric.MoreOrEqualPrefix = `((no\\s+${EnglishNumeric.LessRegex})|(at\\s+least))`; + EnglishNumeric.MoreOrEqual = `((${EnglishNumeric.MoreRegex}\\s+(or)?\\s+${EnglishNumeric.EqualRegex})|(${EnglishNumeric.EqualRegex}\\s+(or)?\\s+${EnglishNumeric.MoreRegex})|${EnglishNumeric.MoreOrEqualPrefix}(\\s+(or)?\\s+${EnglishNumeric.EqualRegex})?|(${EnglishNumeric.EqualRegex}\\s+(or)?\\s+)?${EnglishNumeric.MoreOrEqualPrefix}|>\\s*=)`; + EnglishNumeric.MoreOrEqualSuffix = `((and|or)\\s+(more|greater|higher|larger|bigger)((?!\\s+than)|(\\s+than(?!(\\s*\\d+)))))`; + EnglishNumeric.LessOrEqualPrefix = `((no\\s+${EnglishNumeric.MoreRegex})|(at\\s+most))`; + EnglishNumeric.LessOrEqual = `((${EnglishNumeric.LessRegex}\\s+(or)?\\s+${EnglishNumeric.EqualRegex})|(${EnglishNumeric.EqualRegex}\\s+(or)?\\s+${EnglishNumeric.LessRegex})|${EnglishNumeric.LessOrEqualPrefix}(\\s+(or)?\\s+${EnglishNumeric.EqualRegex})?|(${EnglishNumeric.EqualRegex}\\s+(or)?\\s+)?${EnglishNumeric.LessOrEqualPrefix}|<\\s*=)`; + EnglishNumeric.LessOrEqualSuffix = `((and|or)\\s+(less|lower|smaller|fewer)((?!\\s+than)|(\\s+than(?!(\\s*\\d+)))))`; + EnglishNumeric.NumberSplitMark = `(?![,.](?!\\d+))`; + EnglishNumeric.MoreRegexNoNumberSucceed = `((bigger|greater|more|higher|larger)((?!\\s+than)|\\s+(than(?!(\\s*\\d+))))|(above|over)(?!(\\s*\\d+)))`; + EnglishNumeric.LessRegexNoNumberSucceed = `((less|lower|smaller|fewer)((?!\\s+than)|\\s+(than(?!(\\s*\\d+))))|(below|under)(?!(\\s*\\d+)))`; + EnglishNumeric.EqualRegexNoNumberSucceed = `(equal(s|ing)?((?!\\s+(to|than))|(\\s+(to|than)(?!(\\s*\\d+)))))`; + EnglishNumeric.OneNumberRangeMoreRegex1 = `(${EnglishNumeric.MoreOrEqual}|${EnglishNumeric.MoreRegex})\\s*(the\\s+)?(?(${EnglishNumeric.NumberSplitMark}.)+)`; + EnglishNumeric.OneNumberRangeMoreRegex2 = `(?(${EnglishNumeric.NumberSplitMark}.)+)\\s*${EnglishNumeric.MoreOrEqualSuffix}`; + EnglishNumeric.OneNumberRangeMoreSeparateRegex = `(${EnglishNumeric.EqualRegex}\\s+(?(${EnglishNumeric.NumberSplitMark}.)+)(\\s+or\\s+)${EnglishNumeric.MoreRegexNoNumberSucceed})|(${EnglishNumeric.MoreRegex}\\s+(?(${EnglishNumeric.NumberSplitMark}.)+)(\\s+or\\s+)${EnglishNumeric.EqualRegexNoNumberSucceed})`; + EnglishNumeric.OneNumberRangeLessRegex1 = `(${EnglishNumeric.LessOrEqual}|${EnglishNumeric.LessRegex})\\s*(the\\s+)?(?(${EnglishNumeric.NumberSplitMark}.)+)`; + EnglishNumeric.OneNumberRangeLessRegex2 = `(?(${EnglishNumeric.NumberSplitMark}.)+)\\s*${EnglishNumeric.LessOrEqualSuffix}`; + EnglishNumeric.OneNumberRangeLessSeparateRegex = `(${EnglishNumeric.EqualRegex}\\s+(?(${EnglishNumeric.NumberSplitMark}.)+)(\\s+or\\s+)${EnglishNumeric.LessRegexNoNumberSucceed})|(${EnglishNumeric.LessRegex}\\s+(?(${EnglishNumeric.NumberSplitMark}.)+)(\\s+or\\s+)${EnglishNumeric.EqualRegexNoNumberSucceed})`; + EnglishNumeric.OneNumberRangeEqualRegex = `${EnglishNumeric.EqualRegex}\\s*(the\\s+)?(?(${EnglishNumeric.NumberSplitMark}.)+)`; + EnglishNumeric.TwoNumberRangeRegex1 = `between\\s*(the\\s+)?(?(${EnglishNumeric.NumberSplitMark}.)+)\\s*and\\s*(the\\s+)?(?(${EnglishNumeric.NumberSplitMark}.)+)`; + EnglishNumeric.TwoNumberRangeRegex2 = `(${EnglishNumeric.OneNumberRangeMoreRegex1}|${EnglishNumeric.OneNumberRangeMoreRegex2})\\s*(and|but|,)\\s*(${EnglishNumeric.OneNumberRangeLessRegex1}|${EnglishNumeric.OneNumberRangeLessRegex2})`; + EnglishNumeric.TwoNumberRangeRegex3 = `(${EnglishNumeric.OneNumberRangeLessRegex1}|${EnglishNumeric.OneNumberRangeLessRegex2})\\s*(and|but|,)\\s*(${EnglishNumeric.OneNumberRangeMoreRegex1}|${EnglishNumeric.OneNumberRangeMoreRegex2})`; + EnglishNumeric.TwoNumberRangeRegex4 = `(from\\s+)?(?(${EnglishNumeric.NumberSplitMark}(?!\\bfrom\\b).)+)\\s*${EnglishNumeric.TillRegex}\\s*(the\\s+)?(?(${EnglishNumeric.NumberSplitMark}.)+)`; + EnglishNumeric.AmbiguousFractionConnectorsRegex = `(\\bin\\b)`; + EnglishNumeric.DecimalSeparatorChar = '.'; + EnglishNumeric.FractionMarkerToken = 'over'; + EnglishNumeric.NonDecimalSeparatorChar = ','; + EnglishNumeric.HalfADozenText = 'six'; + EnglishNumeric.WordSeparatorToken = 'and'; + EnglishNumeric.WrittenDecimalSeparatorTexts = ['point']; + EnglishNumeric.WrittenGroupSeparatorTexts = ['punto']; + EnglishNumeric.WrittenIntegerSeparatorTexts = ['and']; + EnglishNumeric.WrittenFractionSeparatorTexts = ['and']; + EnglishNumeric.HalfADozenRegex = `half\\s+a\\s+dozen`; + EnglishNumeric.DigitalNumberRegex = `((?<=\\b)(hundred|thousand|million|billion|trillion|dozen(s)?)(?=\\b))|((?<=(\\d|\\b))(k|t|m|g|b)(?=\\b))`; + EnglishNumeric.CardinalNumberMap = new Map([["a", 1], ["zero", 0], ["an", 1], ["one", 1], ["two", 2], ["three", 3], ["four", 4], ["five", 5], ["six", 6], ["seven", 7], ["eight", 8], ["nine", 9], ["ten", 10], ["eleven", 11], ["twelve", 12], ["dozen", 12], ["dozens", 12], ["thirteen", 13], ["fourteen", 14], ["fifteen", 15], ["sixteen", 16], ["seventeen", 17], ["eighteen", 18], ["nineteen", 19], ["twenty", 20], ["thirty", 30], ["forty", 40], ["fifty", 50], ["sixty", 60], ["seventy", 70], ["eighty", 80], ["ninety", 90], ["hundred", 100], ["thousand", 1000], ["million", 1000000], ["billion", 1000000000], ["trillion", 1000000000000]]); + EnglishNumeric.OrdinalNumberMap = new Map([["first", 1], ["second", 2], ["secondary", 2], ["half", 2], ["third", 3], ["fourth", 4], ["quarter", 4], ["fifth", 5], ["sixth", 6], ["seventh", 7], ["eighth", 8], ["ninth", 9], ["tenth", 10], ["eleventh", 11], ["twelfth", 12], ["thirteenth", 13], ["fourteenth", 14], ["fifteenth", 15], ["sixteenth", 16], ["seventeenth", 17], ["eighteenth", 18], ["nineteenth", 19], ["twentieth", 20], ["thirtieth", 30], ["fortieth", 40], ["fiftieth", 50], ["sixtieth", 60], ["seventieth", 70], ["eightieth", 80], ["ninetieth", 90], ["hundredth", 100], ["thousandth", 1000], ["millionth", 1000000], ["billionth", 1000000000], ["trillionth", 1000000000000], ["firsts", 1], ["halves", 2], ["thirds", 3], ["fourths", 4], ["quarters", 4], ["fifths", 5], ["sixths", 6], ["sevenths", 7], ["eighths", 8], ["ninths", 9], ["tenths", 10], ["elevenths", 11], ["twelfths", 12], ["thirteenths", 13], ["fourteenths", 14], ["fifteenths", 15], ["sixteenths", 16], ["seventeenths", 17], ["eighteenths", 18], ["nineteenths", 19], ["twentieths", 20], ["thirtieths", 30], ["fortieths", 40], ["fiftieths", 50], ["sixtieths", 60], ["seventieths", 70], ["eightieths", 80], ["ninetieths", 90], ["hundredths", 100], ["thousandths", 1000], ["millionths", 1000000], ["billionths", 1000000000], ["trillionths", 1000000000000]]); + EnglishNumeric.RoundNumberMap = new Map([["hundred", 100], ["thousand", 1000], ["million", 1000000], ["billion", 1000000000], ["trillion", 1000000000000], ["hundredth", 100], ["thousandth", 1000], ["millionth", 1000000], ["billionth", 1000000000], ["trillionth", 1000000000000], ["hundredths", 100], ["thousandths", 1000], ["millionths", 1000000], ["billionths", 1000000000], ["trillionths", 1000000000000], ["dozen", 12], ["dozens", 12], ["k", 1000], ["m", 1000000], ["g", 1000000000], ["b", 1000000000], ["t", 1000000000000]]); + EnglishNumeric.AmbiguityFiltersDict = new Map([["\\bone\\b", "\\b(the|this|that|which)\\s+(one)\\b"]]); +})(EnglishNumeric = exports.EnglishNumeric || (exports.EnglishNumeric = {})); + +}); + +unwrapExports(englishNumeric); + +var parserConfiguration = createCommonjsModule(function (module, exports) { +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); + + + +class EnglishNumberParserConfiguration { + constructor(ci) { + if (!ci) { + ci = new culture$2.CultureInfo(culture$2.Culture.English); + } + this.cultureInfo = ci; + this.langMarker = englishNumeric.EnglishNumeric.LangMarker; + this.decimalSeparatorChar = englishNumeric.EnglishNumeric.DecimalSeparatorChar; + this.fractionMarkerToken = englishNumeric.EnglishNumeric.FractionMarkerToken; + this.nonDecimalSeparatorChar = englishNumeric.EnglishNumeric.NonDecimalSeparatorChar; + this.halfADozenText = englishNumeric.EnglishNumeric.HalfADozenText; + this.wordSeparatorToken = englishNumeric.EnglishNumeric.WordSeparatorToken; + this.writtenDecimalSeparatorTexts = englishNumeric.EnglishNumeric.WrittenDecimalSeparatorTexts; + this.writtenGroupSeparatorTexts = englishNumeric.EnglishNumeric.WrittenGroupSeparatorTexts; + this.writtenIntegerSeparatorTexts = englishNumeric.EnglishNumeric.WrittenIntegerSeparatorTexts; + this.writtenFractionSeparatorTexts = englishNumeric.EnglishNumeric.WrittenFractionSeparatorTexts; + this.cardinalNumberMap = englishNumeric.EnglishNumeric.CardinalNumberMap; + this.ordinalNumberMap = englishNumeric.EnglishNumeric.OrdinalNumberMap; + this.roundNumberMap = englishNumeric.EnglishNumeric.RoundNumberMap; + this.negativeNumberSignRegex = recognizersText.RegExpUtility.getSafeRegExp(englishNumeric.EnglishNumeric.NegativeNumberSignRegex, "is"); + this.halfADozenRegex = recognizersText.RegExpUtility.getSafeRegExp(englishNumeric.EnglishNumeric.HalfADozenRegex, "gis"); + this.digitalNumberRegex = recognizersText.RegExpUtility.getSafeRegExp(englishNumeric.EnglishNumeric.DigitalNumberRegex, "gis"); + } + normalizeTokenSet(tokens, context) { + let fracWords = new Array(); + let tokenList = Array.from(tokens); + let tokenLen = tokenList.length; + for (let i = 0; i < tokenLen; i++) { + if (tokenList[i].includes("-")) { + let spiltedTokens = tokenList[i].split("-"); + if (spiltedTokens.length === 2 && this.ordinalNumberMap.has(spiltedTokens[1])) { + fracWords.push(spiltedTokens[0]); + fracWords.push(spiltedTokens[1]); + } + else { + fracWords.push(tokenList[i]); + } + } + else if ((i < tokenLen - 2) && tokenList[i + 1] === "-") { + if (this.ordinalNumberMap.has(tokenList[i + 2])) { + fracWords.push(tokenList[i]); + fracWords.push(tokenList[i + 2]); + } + else { + fracWords.push(tokenList[i] + tokenList[i + 1] + tokenList[i + 2]); + } + i += 2; + } + else { + fracWords.push(tokenList[i]); + } + } + return fracWords; + } + resolveCompositeNumber(numberStr) { + if (numberStr.includes("-")) { + let numbers = numberStr.split('-'); + let ret = 0; + numbers.forEach(num => { + if (this.ordinalNumberMap.has(num)) { + ret += this.ordinalNumberMap.get(num); + } + else if (this.cardinalNumberMap.has(num)) { + ret += this.cardinalNumberMap.get(num); + } + }); + return ret; + } + if (this.ordinalNumberMap.has(numberStr)) { + return this.ordinalNumberMap.get(numberStr); + } + if (this.cardinalNumberMap.has(numberStr)) { + return this.cardinalNumberMap.get(numberStr); + } + return 0; + } +} +exports.EnglishNumberParserConfiguration = EnglishNumberParserConfiguration; + +}); + +unwrapExports(parserConfiguration); + +var spanishNumeric = createCommonjsModule(function (module, exports) { +"use strict"; +// ------------------------------------------------------------------------------ +// +// This code was generated by a tool. +// Changes to this file may cause incorrect behavior and will be lost if +// the code is regenerated. +// +// ------------------------------------------------------------------------------ +Object.defineProperty(exports, "__esModule", { value: true }); + +var SpanishNumeric; +(function (SpanishNumeric) { + SpanishNumeric.LangMarker = 'Spa'; + SpanishNumeric.HundredsNumberIntegerRegex = `(cuatrocient[ao]s|trescient[ao]s|seiscient[ao]s|setecient[ao]s|ochocient[ao]s|novecient[ao]s|doscient[ao]s|quinient[ao]s|(? { return `(((?(${SpanishNumeric.AllIntRegex})|((?(${SpanishNumeric.AllIntRegex})|((\\d+)(?!\\.)))(?=\\b)`; + SpanishNumeric.AllPointRegex = `((\\s+${SpanishNumeric.ZeroToNineIntegerRegex})+|(\\s+${SpanishNumeric.AllIntRegex}))`; + SpanishNumeric.AllFloatRegex = `${SpanishNumeric.AllIntRegex}(\\s+(coma|con))${SpanishNumeric.AllPointRegex}`; + SpanishNumeric.DoubleDecimalPointRegex = (placeholder) => { return `(((? { return `(?<=\\s|^)(? { + spanishNumeric.SpanishNumeric.SuffixOrdinalMap.forEach((suffixValue, suffixKey) => { + if (!ordinalNumberMap.has(prefixKey + suffixKey)) { + ordinalNumberMap.set(prefixKey + suffixKey, prefixValue * suffixValue); + } + }); + }); + this.cardinalNumberMap = spanishNumeric.SpanishNumeric.CardinalNumberMap; + this.ordinalNumberMap = ordinalNumberMap; + this.roundNumberMap = spanishNumeric.SpanishNumeric.RoundNumberMap; + this.negativeNumberSignRegex = recognizersText.RegExpUtility.getSafeRegExp(spanishNumeric.SpanishNumeric.NegativeNumberSignRegex, "is"); + this.halfADozenRegex = recognizersText.RegExpUtility.getSafeRegExp(spanishNumeric.SpanishNumeric.HalfADozenRegex); + this.digitalNumberRegex = recognizersText.RegExpUtility.getSafeRegExp(spanishNumeric.SpanishNumeric.DigitalNumberRegex); + } + normalizeTokenSet(tokens, context) { + let result = new Array(); + tokens.forEach((token) => { + let tempWord = token.replace(/^s+/, '').replace(/s+$/, ''); + if (this.ordinalNumberMap.has(tempWord)) { + result.push(tempWord); + return; + } + if (tempWord.endsWith("avo") || tempWord.endsWith("ava")) { + let origTempWord = tempWord; + let newLength = origTempWord.length; + tempWord = origTempWord.substring(0, newLength - 3); + if (this.cardinalNumberMap.has(tempWord)) { + result.push(tempWord); + return; + } + else { + tempWord = origTempWord.substring(0, newLength - 2); + if (this.cardinalNumberMap.has(tempWord)) { + result.push(tempWord); + return; + } + } + } + result.push(token); + }); + return result; + } + resolveCompositeNumber(numberStr) { + if (this.ordinalNumberMap.has(numberStr)) { + return this.ordinalNumberMap.get(numberStr); + } + if (this.cardinalNumberMap.has(numberStr)) { + return this.cardinalNumberMap.get(numberStr); + } + let value = 0; + let finalValue = 0; + let strBuilder = ""; + let lastGoodChar = 0; + for (let i = 0; i < numberStr.length; i++) { + strBuilder = strBuilder.concat(numberStr[i]); + if (this.cardinalNumberMap.has(strBuilder) && this.cardinalNumberMap.get(strBuilder) > value) { + lastGoodChar = i; + value = this.cardinalNumberMap.get(strBuilder); + } + if ((i + 1) === numberStr.length) { + finalValue += value; + strBuilder = ""; + i = lastGoodChar++; + value = 0; + } + } + return finalValue; + } +} +exports.SpanishNumberParserConfiguration = SpanishNumberParserConfiguration; + +}); + +unwrapExports(parserConfiguration$2); + +var portugueseNumeric = createCommonjsModule(function (module, exports) { +"use strict"; +// ------------------------------------------------------------------------------ +// +// This code was generated by a tool. +// Changes to this file may cause incorrect behavior and will be lost if +// the code is regenerated. +// +// ------------------------------------------------------------------------------ +Object.defineProperty(exports, "__esModule", { value: true }); + +var PortugueseNumeric; +(function (PortugueseNumeric) { + PortugueseNumeric.LangMarker = 'Por'; + PortugueseNumeric.HundredsNumberIntegerRegex = `(quatrocent[ao]s|trezent[ao]s|seiscent[ao]s|setecent[ao]s|oitocent[ao]s|novecent[ao]s|duzent[ao]s|quinhent[ao]s|cem|(? { return `(((?(${PortugueseNumeric.AllIntRegex})|((?(${PortugueseNumeric.AllIntRegex})|((\\d+)(?!\\.)))(?=\\b)`; + PortugueseNumeric.AllFloatRegex = `${PortugueseNumeric.AllIntRegex}(\\s+(vírgula|virgula|e|ponto))${PortugueseNumeric.AllPointRegex}`; + PortugueseNumeric.DoubleWithMultiplierRegex = `(((? { return `(((? { return `(?<=\\s|^)(? { + portugueseNumeric.PortugueseNumeric.SuffixOrdinalMap.forEach((suffixValue, suffixKey) => { + if (!ordinalNumberMap.has(prefixKey + suffixKey)) { + ordinalNumberMap.set(prefixKey + suffixKey, prefixValue * suffixValue); + } + }); + }); + this.cardinalNumberMap = portugueseNumeric.PortugueseNumeric.CardinalNumberMap; + this.ordinalNumberMap = ordinalNumberMap; + this.roundNumberMap = portugueseNumeric.PortugueseNumeric.RoundNumberMap; + this.negativeNumberSignRegex = recognizersText.RegExpUtility.getSafeRegExp(portugueseNumeric.PortugueseNumeric.NegativeNumberSignRegex, "is"); + this.halfADozenRegex = recognizersText.RegExpUtility.getSafeRegExp(portugueseNumeric.PortugueseNumeric.HalfADozenRegex); + this.digitalNumberRegex = recognizersText.RegExpUtility.getSafeRegExp(portugueseNumeric.PortugueseNumeric.DigitalNumberRegex); + } + normalizeTokenSet(tokens, context) { + let result = new Array(); + tokens.forEach((token) => { + let tempWord = token.replace(/^s+/, '').replace(/s+$/, ''); + if (this.ordinalNumberMap.has(tempWord)) { + result.push(tempWord); + return; + } + // ends with 'avo' or 'ava' + if (portugueseNumeric.PortugueseNumeric.WrittenFractionSuffix.some(suffix => tempWord.endsWith(suffix))) { + let origTempWord = tempWord; + let newLength = origTempWord.length; + tempWord = origTempWord.substring(0, newLength - 3); + if (!tempWord) { + return; + } + else if (this.cardinalNumberMap.has(tempWord)) { + result.push(tempWord); + return; + } + else { + tempWord = origTempWord.substring(0, newLength - 2); + if (this.cardinalNumberMap.has(tempWord)) { + result.push(tempWord); + return; + } + } + } + result.push(token); + }); + return result; + } + resolveCompositeNumber(numberStr) { + if (this.ordinalNumberMap.has(numberStr)) { + return this.ordinalNumberMap.get(numberStr); + } + if (this.cardinalNumberMap.has(numberStr)) { + return this.cardinalNumberMap.get(numberStr); + } + let value = 0; + let finalValue = 0; + let strBuilder = ""; + let lastGoodChar = 0; + for (let i = 0; i < numberStr.length; i++) { + strBuilder = strBuilder.concat(numberStr[i]); + if (this.cardinalNumberMap.has(strBuilder) && this.cardinalNumberMap.get(strBuilder) > value) { + lastGoodChar = i; + value = this.cardinalNumberMap.get(strBuilder); + } + if ((i + 1) === numberStr.length) { + finalValue += value; + strBuilder = ""; + i = lastGoodChar++; + value = 0; + } + } + return finalValue; + } +} +exports.PortugueseNumberParserConfiguration = PortugueseNumberParserConfiguration; + +}); + +unwrapExports(parserConfiguration$4); + +var frenchNumeric = createCommonjsModule(function (module, exports) { +"use strict"; +// ------------------------------------------------------------------------------ +// +// This code was generated by a tool. +// Changes to this file may cause incorrect behavior and will be lost if +// the code is regenerated. +// +// ------------------------------------------------------------------------------ +Object.defineProperty(exports, "__esModule", { value: true }); + +var FrenchNumeric; +(function (FrenchNumeric) { + FrenchNumeric.LangMarker = 'Fr'; + FrenchNumeric.RoundNumberIntegerRegex = `(cent|mille|millions|million|milliard|milliards|billion|billions)`; + FrenchNumeric.ZeroToNineIntegerRegex = `(et un|un|une|deux|trois|quatre|cinq|six|sept|huit|neuf)`; + FrenchNumeric.TenToNineteenIntegerRegex = `((seize|quinze|quatorze|treize|douze|onze)|dix(\\Wneuf|\\Whuit|\\Wsept)?)`; + FrenchNumeric.TensNumberIntegerRegex = `(quatre\\Wvingt(s|\\Wdix)?|soixante\\Wdix|vingt|trente|quarante|cinquante|soixante|septante|octante|huitante|nonante)`; + FrenchNumeric.DigitsNumberRegex = `\\d|\\d{1,3}(\\.\\d{3})`; + FrenchNumeric.NegativeNumberTermsRegex = `^[.]`; + FrenchNumeric.NegativeNumberSignRegex = `^(${FrenchNumeric.NegativeNumberTermsRegex}\\s+).*`; + FrenchNumeric.HundredsNumberIntegerRegex = `((${FrenchNumeric.ZeroToNineIntegerRegex}(\\s+cent))|cent|((\\s+cent\\s)+${FrenchNumeric.TensNumberIntegerRegex}))`; + FrenchNumeric.BelowHundredsRegex = `((${FrenchNumeric.TenToNineteenIntegerRegex}|(${FrenchNumeric.TensNumberIntegerRegex}([-\\s]+(${FrenchNumeric.TenToNineteenIntegerRegex}|${FrenchNumeric.ZeroToNineIntegerRegex}))?))|${FrenchNumeric.ZeroToNineIntegerRegex})`; + FrenchNumeric.BelowThousandsRegex = `((${FrenchNumeric.HundredsNumberIntegerRegex}(\\s+${FrenchNumeric.BelowHundredsRegex})?|${FrenchNumeric.BelowHundredsRegex}|${FrenchNumeric.TenToNineteenIntegerRegex})|cent\\s+${FrenchNumeric.TenToNineteenIntegerRegex})`; + FrenchNumeric.SupportThousandsRegex = `((${FrenchNumeric.BelowThousandsRegex}|${FrenchNumeric.BelowHundredsRegex})\\s+${FrenchNumeric.RoundNumberIntegerRegex}(\\s+${FrenchNumeric.RoundNumberIntegerRegex})?)`; + FrenchNumeric.SeparaIntRegex = `(${FrenchNumeric.SupportThousandsRegex}(\\s+${FrenchNumeric.SupportThousandsRegex})*(\\s+${FrenchNumeric.BelowThousandsRegex})?|${FrenchNumeric.BelowThousandsRegex})`; + FrenchNumeric.AllIntRegex = `(${FrenchNumeric.SeparaIntRegex}|mille(\\s+${FrenchNumeric.BelowThousandsRegex})?)`; + FrenchNumeric.NumbersWithPlaceHolder = (placeholder) => { return `(((?(${FrenchNumeric.AllIntRegex})|((?(${FrenchNumeric.AllIntRegex})|((\\d+)(?!\\.)))(?=\\b)`; + FrenchNumeric.AllPointRegex = `((\\s+${FrenchNumeric.ZeroToNineIntegerRegex})+|(\\s+${FrenchNumeric.SeparaIntRegex}))`; + FrenchNumeric.AllFloatRegex = `(${FrenchNumeric.AllIntRegex}(\\s+(virgule|point))${FrenchNumeric.AllPointRegex})`; + FrenchNumeric.DoubleDecimalPointRegex = (placeholder) => { return `(((? { return `(?<=\\s|^)(? value) { + lastGoodChar = i; + value = this.cardinalNumberMap.get(strBuilder); + } + if ((i + 1) === numberStr.length) { + finalValue += value; + strBuilder = ""; + i = lastGoodChar++; + value = 0; + } + } + return finalValue; + } +} +exports.FrenchNumberParserConfiguration = FrenchNumberParserConfiguration; + +}); + +unwrapExports(parserConfiguration$6); + +var chineseNumeric = createCommonjsModule(function (module, exports) { +"use strict"; +// ------------------------------------------------------------------------------ +// +// This code was generated by a tool. +// Changes to this file may cause incorrect behavior and will be lost if +// the code is regenerated. +// +// ------------------------------------------------------------------------------ +Object.defineProperty(exports, "__esModule", { value: true }); +var ChineseNumeric; +(function (ChineseNumeric) { + ChineseNumeric.LangMarker = ''; + ChineseNumeric.DecimalSeparatorChar = '.'; + ChineseNumeric.FractionMarkerToken = ''; + ChineseNumeric.NonDecimalSeparatorChar = ' '; + ChineseNumeric.HalfADozenText = ''; + ChineseNumeric.WordSeparatorToken = ''; + ChineseNumeric.RoundNumberMap = new Map([["k", 1000], ["m", 1000000], ["g", 1000000000], ["t", 1000000000000]]); + ChineseNumeric.RoundNumberMapChar = new Map([["十", 10], ["百", 100], ["千", 1000], ["万", 10000], ["亿", 100000000], ["兆", 1000000000000], ["拾", 10], ["佰", 100], ["仟", 1000], ["萬", 10000], ["億", 100000000]]); + ChineseNumeric.ZeroToNineMap = new Map([["0", 0], ["1", 1], ["2", 2], ["3", 3], ["4", 4], ["5", 5], ["6", 6], ["7", 7], ["8", 8], ["9", 9], ["零", 0], ["一", 1], ["二", 2], ["三", 3], ["四", 4], ["五", 5], ["六", 6], ["七", 7], ["八", 8], ["九", 9], ["〇", 0], ["壹", 1], ["贰", 2], ["貳", 2], ["叁", 3], ["肆", 4], ["伍", 5], ["陆", 6], ["陸", 6], ["柒", 7], ["捌", 8], ["玖", 9], ["0", 0], ["1", 1], ["2", 2], ["3", 3], ["4", 4], ["5", 5], ["6", 6], ["7", 7], ["8", 8], ["9", 9], ["半", 0.5], ["两", 2], ["兩", 2], ["俩", 2], ["倆", 2], ["仨", 3]]); + ChineseNumeric.FullToHalfMap = new Map([["0", "0"], ["1", "1"], ["2", "2"], ["3", "3"], ["4", "4"], ["5", "5"], ["6", "6"], ["7", "7"], ["8", "8"], ["9", "9"], ["/", "/"], ["-", "-"], [",", "\'"], ["G", "G"], ["M", "M"], ["T", "T"], ["K", "K"], ["k", "k"], [".", "."]]); + ChineseNumeric.TratoSimMap = new Map([["佰", "百"], ["點", "点"], ["個", "个"], ["幾", "几"], ["對", "对"], ["雙", "双"]]); + ChineseNumeric.UnitMap = new Map([["萬萬", "億"], ["億萬", "兆"], ["萬億", "兆"], ["万万", "亿"], ["万亿", "兆"], ["亿万", "兆"], [" ", ""], ["多", ""], ["余", ""], ["几", ""]]); + ChineseNumeric.RoundDirectList = ['万', '萬', '亿', '兆', '億']; + ChineseNumeric.DigitalNumberRegex = `((?<=(\\d|\\b))(k|t|m|g)(?=\\b))`; + ChineseNumeric.ZeroToNineFullHalfRegex = `[\\d1234567890]`; + ChineseNumeric.DigitNumRegex = `${ChineseNumeric.ZeroToNineFullHalfRegex}+`; + ChineseNumeric.DozenRegex = `.*打$`; + ChineseNumeric.PercentageRegex = `(?<=百\\s*分\\s*之).+|.+(?=个\\s*百\\s*分\\s*点)|.*(?=[%%])`; + ChineseNumeric.DoubleAndRoundRegex = `${ChineseNumeric.ZeroToNineFullHalfRegex}+(\\.${ChineseNumeric.ZeroToNineFullHalfRegex}+)?\\s*[多几余]?[万亿萬億]{1,2}`; + ChineseNumeric.FracSplitRegex = `又|分\\s*之`; + ChineseNumeric.ZeroToNineIntegerRegex = `[一二三四五六七八九零壹贰貳叁肆伍陆陸柒捌玖〇两兩俩倆仨]`; + ChineseNumeric.NegativeNumberTermsRegex = `[负負]`; + ChineseNumeric.NegativeNumberTermsRegexNum = `((?)`; + ChineseNumeric.LessRegex = `(小于|少于|低于|小於|少於|低於|不到|不足|<)`; + ChineseNumeric.EqualRegex = `(等于|等於|=)`; + ChineseNumeric.MoreOrEqual = `((${ChineseNumeric.MoreRegex}\\s*(或|或者)?\\s*${ChineseNumeric.EqualRegex})|至少|最少|不${ChineseNumeric.LessRegex})`; + ChineseNumeric.MoreOrEqualSuffix = `(或|或者)\\s*(以上|之上|更[大多高])`; + ChineseNumeric.LessOrEqual = `((${ChineseNumeric.LessRegex}\\s*(或|或者)?\\s*${ChineseNumeric.EqualRegex})|至多|最多|不${ChineseNumeric.MoreRegex})`; + ChineseNumeric.LessOrEqualSuffix = `(或|或者)\\s*(以下|之下|更[小少低])`; + ChineseNumeric.OneNumberRangeMoreRegex1 = `(${ChineseNumeric.MoreOrEqual}|${ChineseNumeric.MoreRegex})\\s*(?((?!([并且而並的同時时]|(,(?!\\d+))|(,(?!\\d+))|。)).)+)`; + ChineseNumeric.OneNumberRangeMoreRegex2 = `比\\s*(?((?!((,(?!\\d+))|(,(?!\\d+))|。)).)+)\\s*更?[大多高]`; + ChineseNumeric.OneNumberRangeMoreRegex3 = `(?((?!((,(?!\\d+))|(,(?!\\d+))|。|[或者])).)+)\\s*(或|或者)?\\s*([多几余幾餘]|以上|之上|更[大多高])(?![万亿萬億]{1,2})`; + ChineseNumeric.OneNumberRangeLessRegex1 = `(${ChineseNumeric.LessOrEqual}|${ChineseNumeric.LessRegex})\\s*(?((?!([并且而並的同時时]|(,(?!\\d+))|(,(?!\\d+))|。)).)+)`; + ChineseNumeric.OneNumberRangeLessRegex2 = `比\\s*(?((?!((,(?!\\d+))|(,(?!\\d+))|。)).)+)\\s*更?[小少低]`; + ChineseNumeric.OneNumberRangeLessRegex3 = `(?((?!((,(?!\\d+))|(,(?!\\d+))|。|[或者])).)+)\\s*(或|或者)?\\s*(以下|之下|更[小少低])`; + ChineseNumeric.OneNumberRangeMoreSeparateRegex = `^[.]`; + ChineseNumeric.OneNumberRangeLessSeparateRegex = `^[.]`; + ChineseNumeric.OneNumberRangeEqualRegex = `${ChineseNumeric.EqualRegex}\\s*(?((?!((,(?!\\d+))|(,(?!\\d+))|。)).)+)`; + ChineseNumeric.TwoNumberRangeRegex1 = `((位于|在|位於)|(?=(\\d|\\+|\\-)))\\s*(?((?!((,(?!\\d+))|(,(?!\\d+))|。)).)+)\\s*(和|与|與|${ChineseNumeric.TillRegex})\\s*(?((?!((,(?!\\d+))|(,(?!\\d+))|。))[^之])+)\\s*(之)?(间|間)`; + ChineseNumeric.TwoNumberRangeRegex2 = `(${ChineseNumeric.OneNumberRangeMoreRegex1}|${ChineseNumeric.OneNumberRangeMoreRegex2}|${ChineseNumeric.OneNumberRangeMoreRegex3})\\s*(且|并且|而且|並且|((的)?同時)|((的)?同时)|,)?\\s*(${ChineseNumeric.OneNumberRangeLessRegex1}|${ChineseNumeric.OneNumberRangeLessRegex2}|${ChineseNumeric.OneNumberRangeLessRegex3})`; + ChineseNumeric.TwoNumberRangeRegex3 = `(${ChineseNumeric.OneNumberRangeLessRegex1}|${ChineseNumeric.OneNumberRangeLessRegex2}|${ChineseNumeric.OneNumberRangeLessRegex3})\\s*(且|并且|而且|並且|((的)?同時)|((的)?同时)|,)?\\s*(${ChineseNumeric.OneNumberRangeMoreRegex1}|${ChineseNumeric.OneNumberRangeMoreRegex2}|${ChineseNumeric.OneNumberRangeMoreRegex3})`; + ChineseNumeric.TwoNumberRangeRegex4 = `(?((?!((,(?!\\d+))|(,(?!\\d+))|。)).)+)\\s*${ChineseNumeric.TillRegex}\\s*(?((?!((,(?!\\d+))|(,(?!\\d+))|。)).)+)`; + ChineseNumeric.AmbiguousFractionConnectorsRegex = `^[.]`; +})(ChineseNumeric = exports.ChineseNumeric || (exports.ChineseNumeric = {})); + +}); + +unwrapExports(chineseNumeric); + +var parserConfiguration$8 = createCommonjsModule(function (module, exports) { +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); + + + +class ChineseNumberParserConfiguration { + constructor(ci) { + if (!ci) { + ci = new culture$2.CultureInfo(culture$2.Culture.Chinese); + } + this.cultureInfo = ci; + this.langMarker = chineseNumeric.ChineseNumeric.LangMarker; + this.decimalSeparatorChar = chineseNumeric.ChineseNumeric.DecimalSeparatorChar; + this.fractionMarkerToken = chineseNumeric.ChineseNumeric.FractionMarkerToken; + this.nonDecimalSeparatorChar = chineseNumeric.ChineseNumeric.NonDecimalSeparatorChar; + this.halfADozenText = chineseNumeric.ChineseNumeric.HalfADozenText; + this.wordSeparatorToken = chineseNumeric.ChineseNumeric.WordSeparatorToken; + this.writtenDecimalSeparatorTexts = []; + this.writtenGroupSeparatorTexts = []; + this.writtenIntegerSeparatorTexts = []; + this.writtenFractionSeparatorTexts = []; + this.cardinalNumberMap = new Map(); + this.ordinalNumberMap = new Map(); + this.roundNumberMap = chineseNumeric.ChineseNumeric.RoundNumberMap; + this.halfADozenRegex = null; + this.digitalNumberRegex = recognizersText.RegExpUtility.getSafeRegExp(chineseNumeric.ChineseNumeric.DigitalNumberRegex, "gis"); + this.zeroToNineMap = chineseNumeric.ChineseNumeric.ZeroToNineMap; + this.roundNumberMapChar = chineseNumeric.ChineseNumeric.RoundNumberMapChar; + this.fullToHalfMap = chineseNumeric.ChineseNumeric.FullToHalfMap; + this.tratoSimMap = chineseNumeric.ChineseNumeric.TratoSimMap; + this.unitMap = chineseNumeric.ChineseNumeric.UnitMap; + this.roundDirectList = chineseNumeric.ChineseNumeric.RoundDirectList; + this.digitNumRegex = recognizersText.RegExpUtility.getSafeRegExp(chineseNumeric.ChineseNumeric.DigitNumRegex, "gis"); + this.dozenRegex = recognizersText.RegExpUtility.getSafeRegExp(chineseNumeric.ChineseNumeric.DozenRegex, "gis"); + this.percentageRegex = recognizersText.RegExpUtility.getSafeRegExp(chineseNumeric.ChineseNumeric.PercentageRegex, "gis"); + this.doubleAndRoundRegex = recognizersText.RegExpUtility.getSafeRegExp(chineseNumeric.ChineseNumeric.DoubleAndRoundRegex, "gis"); + this.fracSplitRegex = recognizersText.RegExpUtility.getSafeRegExp(chineseNumeric.ChineseNumeric.FracSplitRegex, "gis"); + this.negativeNumberSignRegex = recognizersText.RegExpUtility.getSafeRegExp(chineseNumeric.ChineseNumeric.NegativeNumberSignRegex, "gis"); + this.pointRegex = recognizersText.RegExpUtility.getSafeRegExp(chineseNumeric.ChineseNumeric.PointRegex, "gis"); + this.speGetNumberRegex = recognizersText.RegExpUtility.getSafeRegExp(chineseNumeric.ChineseNumeric.SpeGetNumberRegex, "gis"); + this.pairRegex = recognizersText.RegExpUtility.getSafeRegExp(chineseNumeric.ChineseNumeric.PairRegex, "gis"); + this.roundNumberIntegerRegex = recognizersText.RegExpUtility.getSafeRegExp(chineseNumeric.ChineseNumeric.RoundNumberIntegerRegex, "gis"); + } + normalizeTokenSet(tokens, context) { + return tokens; + } + resolveCompositeNumber(numberStr) { + return 0; + } +} +exports.ChineseNumberParserConfiguration = ChineseNumberParserConfiguration; + +}); + +unwrapExports(parserConfiguration$8); + +var japaneseNumeric = createCommonjsModule(function (module, exports) { +"use strict"; +// ------------------------------------------------------------------------------ +// +// This code was generated by a tool. +// Changes to this file may cause incorrect behavior and will be lost if +// the code is regenerated. +// +// ------------------------------------------------------------------------------ +Object.defineProperty(exports, "__esModule", { value: true }); +var JapaneseNumeric; +(function (JapaneseNumeric) { + JapaneseNumeric.LangMarker = ''; + JapaneseNumeric.DecimalSeparatorChar = '.'; + JapaneseNumeric.FractionMarkerToken = ''; + JapaneseNumeric.NonDecimalSeparatorChar = ' '; + JapaneseNumeric.HalfADozenText = ''; + JapaneseNumeric.WordSeparatorToken = ''; + JapaneseNumeric.RoundNumberMap = new Map([["k", 1000], ["m", 1000000], ["g", 1000000000], ["t", 1000000000000]]); + JapaneseNumeric.RoundNumberMapChar = new Map([["十", 10], ["百", 100], ["千", 1000], ["万", 10000], ["億", 100000000], ["兆", 1000000000000]]); + JapaneseNumeric.ZeroToNineMap = new Map([["0", 0], ["1", 1], ["2", 2], ["3", 3], ["4", 4], ["5", 5], ["6", 6], ["7", 7], ["8", 8], ["9", 9], ["零", 0], ["一", 1], ["二", 2], ["三", 3], ["四", 4], ["五", 5], ["六", 6], ["七", 7], ["八", 8], ["九", 9], ["半", 0.5]]); + JapaneseNumeric.FullToHalfMap = new Map([["0", "0"], ["1", "1"], ["2", "2"], ["3", "3"], ["4", "4"], ["5", "5"], ["6", "6"], ["7", "7"], ["8", "8"], ["9", "9"], ["/", "/"], ["-", "-"], [",", "\'"], ["、", "\'"], ["G", "G"], ["M", "M"], ["T", "T"], ["K", "K"], ["k", "k"], [".", "."]]); + JapaneseNumeric.UnitMap = new Map([["万万", "億"], ["億万", "兆"], ["万億", "兆"], [" ", ""]]); + JapaneseNumeric.RoundDirectList = ['万', '億', '兆']; + JapaneseNumeric.DigitalNumberRegex = `((?<=(\\d|\\b))(k|t|m|g)(?=\\b))`; + JapaneseNumeric.ZeroToNineFullHalfRegex = `[\\d1234567890]`; + JapaneseNumeric.DigitNumRegex = `${JapaneseNumeric.ZeroToNineFullHalfRegex}+`; + JapaneseNumeric.DozenRegex = `.*ダース$`; + JapaneseNumeric.PercentageRegex = `.+(?=パ\\s*ー\\s*セ\\s*ン\\s*ト)|.*(?=[%%])`; + JapaneseNumeric.DoubleAndRoundRegex = `${JapaneseNumeric.ZeroToNineFullHalfRegex}+(\\.${JapaneseNumeric.ZeroToNineFullHalfRegex}+)?\\s*[万億]{1,2}(\\s*(以上))?`; + JapaneseNumeric.FracSplitRegex = `[はと]|分\\s*の`; + JapaneseNumeric.ZeroToNineIntegerRegex = `[一二三四五六七八九]`; + JapaneseNumeric.NegativeNumberTermsRegex = `(マ\\s*イ\\s*ナ\\s*ス)`; + JapaneseNumeric.NegativeNumberTermsRegexNum = `(?)`; + JapaneseNumeric.LessRegex = `(小なり|小さい|低い|<)`; + JapaneseNumeric.EqualRegex = `(等しい|イコール|=)`; + JapaneseNumeric.MoreOrEqual = `((大なりかイコール)|(大きいかイコール)|(大なりか等しい)|(大きいか等しい)|小さくない|以上|最低)`; + JapaneseNumeric.MoreOrEqualSuffix = `(より(大なりイコール|小さくない))`; + JapaneseNumeric.LessOrEqual = `((${JapaneseNumeric.LessRegex}\\s*(或|或者)?\\s*${JapaneseNumeric.EqualRegex})|(小なりかイコール)|(小なりか等しい)|(小さいかイコール)|(小さいか等しい)|(小さいか等しい)|大さくない|以下|最大)`; + JapaneseNumeric.LessOrEqualSuffix = `(小なりイコール|大さくない)`; + JapaneseNumeric.OneNumberRangeMoreRegex1 = `(?((?!(((,|、)(?!\\d+))|((,|、)(?!\\d+))|。)).)+)\\s*((より)\\s*((${JapaneseNumeric.MoreOrEqual}|${JapaneseNumeric.MoreRegex}))|超える|を超える)`; + JapaneseNumeric.OneNumberRangeMoreRegex2 = `(?((?!((,|、(?!\\d+))|(,|、(?!\\d+))|。)).)+)\\s*(より)?(大なり)`; + JapaneseNumeric.OneNumberRangeMoreRegex3 = `(?((?!((,(?!\\d+))|(,(?!\\d+))|。)).)+)\\s*(以上|最低)(?![万億]{1,2})`; + JapaneseNumeric.OneNumberRangeMoreRegex4 = `(${JapaneseNumeric.MoreOrEqual}|${JapaneseNumeric.MoreRegex})\\s*(?((?!(と|は|((と)?同時に)|((と)?そして)|が|,|、|,|(,(?!\\d+))|(,(?!\\d+))|。)).)+)`; + JapaneseNumeric.OneNumberRangeMoreSeparateRegex = `^[.]`; + JapaneseNumeric.OneNumberRangeLessSeparateRegex = `^[.]`; + JapaneseNumeric.OneNumberRangeLessRegex1 = `(?((?!(((,|、)(?!\\d+))|((,|、)(?!\\d+))|。)).)+)\\s*(より)\\s*(${JapaneseNumeric.LessOrEqual}|${JapaneseNumeric.LessRegex})`; + JapaneseNumeric.OneNumberRangeLessRegex2 = `(?((?!((,(?!\\d+))|(,(?!\\d+))|。)).)+)\\s*(より)?(小な)`; + JapaneseNumeric.OneNumberRangeLessRegex3 = `(?((?!((,(?!\\d+))|(,(?!\\d+))|。)).)+)\\s*(以下|未満)(?![万億]{1,2})`; + JapaneseNumeric.OneNumberRangeLessRegex4 = `(${JapaneseNumeric.LessOrEqual}|${JapaneseNumeric.LessRegex})\\s*(?((?!(と|は|((と)?同時に)|((と)?そして)|が|,|、|,|(,(?!\\d+))|(,(?!\\d+))|。)).)+)`; + JapaneseNumeric.OneNumberRangeEqualRegex = `(((?((?!((,(?!\\d+))|(,(?!\\d+))|。)).)+)\\s*(に)\\s*${JapaneseNumeric.EqualRegex})|(${JapaneseNumeric.EqualRegex}\\s*(?((?!((,(?!\\d+))|(,(?!\\d+))|。)).)+)))`; + JapaneseNumeric.TwoNumberRangeRegex1 = `(?((?!((,(?!\\d+))|(,(?!\\d+))|。)).)+)\\s*(と|${JapaneseNumeric.TillRegex})\\s*(?((?!((,(?!\\d+))|(,(?!\\d+))|。)).)+)\\s*(の間)`; + JapaneseNumeric.TwoNumberRangeRegex2 = `(${JapaneseNumeric.OneNumberRangeMoreRegex1}|${JapaneseNumeric.OneNumberRangeMoreRegex2}|${JapaneseNumeric.OneNumberRangeMoreRegex3}|${JapaneseNumeric.OneNumberRangeMoreRegex4})\\s*(と|は|((と)?同時に)|((と)?そして)|が|,|、|,)?\\s*(${JapaneseNumeric.OneNumberRangeLessRegex1}|${JapaneseNumeric.OneNumberRangeLessRegex2}|${JapaneseNumeric.OneNumberRangeLessRegex3}|${JapaneseNumeric.OneNumberRangeLessRegex4})`; + JapaneseNumeric.TwoNumberRangeRegex3 = `(${JapaneseNumeric.OneNumberRangeLessRegex1}|${JapaneseNumeric.OneNumberRangeLessRegex2}|${JapaneseNumeric.OneNumberRangeLessRegex3}|${JapaneseNumeric.OneNumberRangeLessRegex4})\\s*(と|は|((と)?同時に)|((と)?そして)|が|,|、|,)?\\s*(${JapaneseNumeric.OneNumberRangeMoreRegex1}|${JapaneseNumeric.OneNumberRangeMoreRegex2}|${JapaneseNumeric.OneNumberRangeMoreRegex3}|${JapaneseNumeric.OneNumberRangeMoreRegex4})`; + JapaneseNumeric.TwoNumberRangeRegex4 = `(?((?!((,(?!\\d+))|(,(?!\\d+))|。)).)+)\\s*${JapaneseNumeric.TillRegex}\\s*(?((?!((,(?!\\d+))|(,(?!\\d+))|。)).)+)`; + JapaneseNumeric.AmbiguousFractionConnectorsRegex = `^[.]`; +})(JapaneseNumeric = exports.JapaneseNumeric || (exports.JapaneseNumeric = {})); + +}); + +unwrapExports(japaneseNumeric); + +var parserConfiguration$10 = createCommonjsModule(function (module, exports) { +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); + + + +class JapaneseNumberParserConfiguration { + // readonly NumberOptions Options { get; } + // readonly Regex FractionPrepositionRegex { get; } + // readonly string NonDecimalSeparatorText + constructor(ci) { + if (!ci) { + ci = new culture$2.CultureInfo(culture$2.Culture.Japanese); + } + this.cultureInfo = ci; + this.langMarker = japaneseNumeric.JapaneseNumeric.LangMarker; + this.decimalSeparatorChar = japaneseNumeric.JapaneseNumeric.DecimalSeparatorChar; + this.fractionMarkerToken = japaneseNumeric.JapaneseNumeric.FractionMarkerToken; + this.nonDecimalSeparatorChar = japaneseNumeric.JapaneseNumeric.NonDecimalSeparatorChar; + this.halfADozenText = japaneseNumeric.JapaneseNumeric.HalfADozenText; + this.wordSeparatorToken = japaneseNumeric.JapaneseNumeric.WordSeparatorToken; + this.writtenDecimalSeparatorTexts = []; + this.writtenGroupSeparatorTexts = []; + this.writtenIntegerSeparatorTexts = []; + this.writtenFractionSeparatorTexts = []; + this.cardinalNumberMap = new Map(); + this.ordinalNumberMap = new Map(); + this.roundNumberMap = japaneseNumeric.JapaneseNumeric.RoundNumberMap; + this.halfADozenRegex = null; + this.digitalNumberRegex = recognizersText.RegExpUtility.getSafeRegExp(japaneseNumeric.JapaneseNumeric.DigitalNumberRegex, "gis"); + this.zeroToNineMap = japaneseNumeric.JapaneseNumeric.ZeroToNineMap; + this.roundNumberMapChar = japaneseNumeric.JapaneseNumeric.RoundNumberMapChar; + this.fullToHalfMap = japaneseNumeric.JapaneseNumeric.FullToHalfMap; + this.tratoSimMap = null; + this.unitMap = japaneseNumeric.JapaneseNumeric.UnitMap; + this.roundDirectList = japaneseNumeric.JapaneseNumeric.RoundDirectList; + this.digitNumRegex = recognizersText.RegExpUtility.getSafeRegExp(japaneseNumeric.JapaneseNumeric.DigitNumRegex, "gis"); + this.dozenRegex = recognizersText.RegExpUtility.getSafeRegExp(japaneseNumeric.JapaneseNumeric.DozenRegex, "gis"); + this.percentageRegex = recognizersText.RegExpUtility.getSafeRegExp(japaneseNumeric.JapaneseNumeric.PercentageRegex, "gis"); + this.doubleAndRoundRegex = recognizersText.RegExpUtility.getSafeRegExp(japaneseNumeric.JapaneseNumeric.DoubleAndRoundRegex, "gis"); + this.fracSplitRegex = recognizersText.RegExpUtility.getSafeRegExp(japaneseNumeric.JapaneseNumeric.FracSplitRegex, "gis"); + this.negativeNumberSignRegex = recognizersText.RegExpUtility.getSafeRegExp(japaneseNumeric.JapaneseNumeric.NegativeNumberSignRegex, "is"); + this.pointRegex = recognizersText.RegExpUtility.getSafeRegExp(japaneseNumeric.JapaneseNumeric.PointRegex, "gis"); + this.speGetNumberRegex = recognizersText.RegExpUtility.getSafeRegExp(japaneseNumeric.JapaneseNumeric.SpeGetNumberRegex, "gis"); + this.pairRegex = recognizersText.RegExpUtility.getSafeRegExp(japaneseNumeric.JapaneseNumeric.PairRegex, "gis"); + this.roundNumberIntegerRegex = recognizersText.RegExpUtility.getSafeRegExp(japaneseNumeric.JapaneseNumeric.RoundNumberIntegerRegex, "gis"); + } + normalizeTokenSet(tokens, context) { + return tokens; + } + resolveCompositeNumber(numberStr) { + return 0; + } +} +exports.JapaneseNumberParserConfiguration = JapaneseNumberParserConfiguration; + +}); + +unwrapExports(parserConfiguration$10); + +/** + * lodash (Custom Build) + * Build: `lodash modularize exports="npm" -o ./` + * Copyright jQuery Foundation and other contributors + * Released under MIT license + * Based on Underscore.js 1.8.3 + * Copyright Jeremy Ashkenas, DocumentCloud and Investigative Reporters & Editors + */ + +/** Used as references for various `Number` constants. */ +var INFINITY$1 = 1 / 0; + +/** `Object#toString` result references. */ +var symbolTag$1 = '[object Symbol]'; + +/** + * Used to match `RegExp` + * [syntax characters](http://ecma-international.org/ecma-262/6.0/#sec-patterns). + */ +var reRegExpChar = /[\\^$.*+?()[\]{}|]/g; +var reHasRegExpChar = RegExp(reRegExpChar.source); + +/** Detect free variable `global` from Node.js. */ +var freeGlobal$1 = typeof commonjsGlobal == 'object' && commonjsGlobal && commonjsGlobal.Object === Object && commonjsGlobal; + +/** Detect free variable `self`. */ +var freeSelf$1 = typeof self == 'object' && self && self.Object === Object && self; + +/** Used as a reference to the global object. */ +var root$1 = freeGlobal$1 || freeSelf$1 || Function('return this')(); + +/** Used for built-in method references. */ +var objectProto$1 = Object.prototype; + +/** + * Used to resolve the + * [`toStringTag`](http://ecma-international.org/ecma-262/6.0/#sec-object.prototype.tostring) + * of values. + */ +var objectToString$1 = objectProto$1.toString; + +/** Built-in value references. */ +var Symbol$2 = root$1.Symbol; + +/** Used to convert symbols to primitives and strings. */ +var symbolProto$1 = Symbol$2 ? Symbol$2.prototype : undefined; +var symbolToString$1 = symbolProto$1 ? symbolProto$1.toString : undefined; + +/** + * The base implementation of `_.toString` which doesn't convert nullish + * values to empty strings. + * + * @private + * @param {*} value The value to process. + * @returns {string} Returns the string. + */ +function baseToString$1(value) { + // Exit early for strings to avoid a performance hit in some environments. + if (typeof value == 'string') { + return value; + } + if (isSymbol$1(value)) { + return symbolToString$1 ? symbolToString$1.call(value) : ''; + } + var result = (value + ''); + return (result == '0' && (1 / value) == -INFINITY$1) ? '-0' : result; +} + +/** + * Checks if `value` is object-like. A value is object-like if it's not `null` + * and has a `typeof` result of "object". + * + * @static + * @memberOf _ + * @since 4.0.0 + * @category Lang + * @param {*} value The value to check. + * @returns {boolean} Returns `true` if `value` is object-like, else `false`. + * @example + * + * _.isObjectLike({}); + * // => true + * + * _.isObjectLike([1, 2, 3]); + * // => true + * + * _.isObjectLike(_.noop); + * // => false + * + * _.isObjectLike(null); + * // => false + */ +function isObjectLike$1(value) { + return !!value && typeof value == 'object'; +} + +/** + * Checks if `value` is classified as a `Symbol` primitive or object. + * + * @static + * @memberOf _ + * @since 4.0.0 + * @category Lang + * @param {*} value The value to check. + * @returns {boolean} Returns `true` if `value` is a symbol, else `false`. + * @example + * + * _.isSymbol(Symbol.iterator); + * // => true + * + * _.isSymbol('abc'); + * // => false + */ +function isSymbol$1(value) { + return typeof value == 'symbol' || + (isObjectLike$1(value) && objectToString$1.call(value) == symbolTag$1); +} + +/** + * Converts `value` to a string. An empty string is returned for `null` + * and `undefined` values. The sign of `-0` is preserved. + * + * @static + * @memberOf _ + * @since 4.0.0 + * @category Lang + * @param {*} value The value to process. + * @returns {string} Returns the string. + * @example + * + * _.toString(null); + * // => '' + * + * _.toString(-0); + * // => '-0' + * + * _.toString([1, 2, 3]); + * // => '1,2,3' + */ +function toString$1(value) { + return value == null ? '' : baseToString$1(value); +} + +/** + * Escapes the `RegExp` special characters "^", "$", "\", ".", "*", "+", + * "?", "(", ")", "[", "]", "{", "}", and "|" in `string`. + * + * @static + * @memberOf _ + * @since 3.0.0 + * @category String + * @param {string} [string=''] The string to escape. + * @returns {string} Returns the escaped string. + * @example + * + * _.escapeRegExp('[lodash](https://lodash.com/)'); + * // => '\[lodash\]\(https://lodash\.com/\)' + */ +function escapeRegExp(string) { + string = toString$1(string); + return (string && reHasRegExpChar.test(string)) + ? string.replace(reRegExpChar, '\\$&') + : string; +} + +var lodash_escaperegexp = escapeRegExp; + +var extractors$4 = createCommonjsModule(function (module, exports) { +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); + + + + +class BaseNumberExtractor { + constructor() { + this.extractType = ""; + this.negativeNumberTermsRegex = null; + } + extract(source) { + if (!source || source.trim().length === 0) { + return []; + } + let result = new Array(); + let matchSource = new Map(); + let matched = new Array(source.length); + for (let i = 0; i < source.length; i++) { + matched[i] = false; + } + let collections = this.regexes + .map(o => ({ matches: recognizersText.RegExpUtility.getMatches(o.regExp, source), value: o.value })) + .filter(o => o.matches && o.matches.length); + collections.forEach(collection => { + collection.matches.forEach(m => { + for (let j = 0; j < m.length; j++) { + matched[m.index + j] = true; + } + // Keep Source Data for extra information + matchSource.set(m, collection.value); + }); + }); + let last = -1; + for (let i = 0; i < source.length; i++) { + if (matched[i]) { + if (i + 1 === source.length || !matched[i + 1]) { + let start = last + 1; + let length = i - last; + let substr = source.substring(start, start + length); + let srcMatch = Array.from(matchSource.keys()).find(m => m.index === start && m.length === length); + // Extract negative numbers + if (this.negativeNumberTermsRegex !== null) { + let match = source.substr(0, start).match(this.negativeNumberTermsRegex); + if (match) { + start = match.index; + length = length + match[0].length; + substr = match[0] + substr; + } + } + if (srcMatch) { + result.push({ + start: start, + length: length, + text: substr, + type: this.extractType, + data: matchSource.has(srcMatch) ? matchSource.get(srcMatch) : null + }); + } + } + } + else { + last = i; + } + } + return result; + } + generateLongFormatNumberRegexes(type, placeholder = baseNumbers.BaseNumbers.PlaceHolderDefault) { + let thousandsMark = lodash_escaperegexp(type.thousandsMark); + let decimalsMark = lodash_escaperegexp(type.decimalsMark); + let regexDefinition = type.decimalsMark === '\0' + ? baseNumbers.BaseNumbers.IntegerRegexDefinition(placeholder, thousandsMark) + : baseNumbers.BaseNumbers.DoubleRegexDefinition(placeholder, thousandsMark, decimalsMark); + return recognizersText.RegExpUtility.getSafeRegExp(regexDefinition, "gis"); + } +} +exports.BaseNumberExtractor = BaseNumberExtractor; +class BasePercentageExtractor { + constructor(numberExtractor) { + this.extractType = constants.Constants.SYS_NUM_PERCENTAGE; + this.numberExtractor = numberExtractor; + this.regexes = this.initRegexes(); + } + extract(source) { + let originSource = source; + let positionMap; + let numExtResults; + // preprocess the source sentence via extracting and replacing the numbers in it + let preprocess = this.preprocessStrWithNumberExtracted(originSource); + source = preprocess.source; + positionMap = preprocess.positionMap; + numExtResults = preprocess.numExtResults; + let allMatches = this.regexes.map(rx => recognizersText.RegExpUtility.getMatches(rx, source)); + let matched = new Array(source.length); + for (let i = 0; i < source.length; i++) { + matched[i] = false; + } + for (let i = 0; i < allMatches.length; i++) { + allMatches[i].forEach(match => { + for (let j = 0; j < match.length; j++) { + matched[j + match.index] = true; + } + }); + } + let result = new Array(); + let last = -1; + // get index of each matched results + for (let i = 0; i < source.length; i++) { + if (matched[i]) { + if (i + 1 === source.length || matched[i + 1] === false) { + let start = last + 1; + let length = i - last; + let substr = source.substring(start, start + length); + let er = { + start: start, + length: length, + text: substr, + type: this.extractType + }; + result.push(er); + } + } + else { + last = i; + } + } + // post-processing, restoring the extracted numbers + this.postProcessing(result, originSource, positionMap, numExtResults); + return result; + } + // get the number extractor results and convert the extracted numbers to @sys.num, so that the regexes can work + preprocessStrWithNumberExtracted(str) { + let positionMap = new Map(); + let numExtResults = this.numberExtractor.extract(str); + let replaceText = baseNumbers.BaseNumbers.NumberReplaceToken; + let match = new Array(str.length); + let strParts = new Array(); + let start; + let end; + for (let i = 0; i < str.length; i++) { + match[i] = -1; + } + for (let i = 0; i < numExtResults.length; i++) { + let extraction = numExtResults[i]; + start = extraction.start; + end = extraction.length + start; + for (let j = start; j < end; j++) { + if (match[j] === -1) { + match[j] = i; + } + } + } + start = 0; + for (let i = 1; i < str.length; i++) { + if (match[i] !== match[i - 1]) { + strParts.push([start, i - 1]); + start = i; + } + } + strParts.push([start, str.length - 1]); + let ret = ""; + let index = 0; + strParts.forEach(strPart => { + start = strPart[0]; + end = strPart[1]; + let type = match[start]; + if (type === -1) { + ret += str.substring(start, end + 1); + for (let i = start; i <= end; i++) { + positionMap.set(index++, i); + } + } + else { + let originalText = str.substring(start, end + 1); + ret += replaceText; + for (let i = 0; i < replaceText.length; i++) { + positionMap.set(index++, start); + } + } + }); + positionMap.set(index++, str.length); + return { + numExtResults: numExtResults, + source: ret, + positionMap: positionMap + }; + } + // replace the @sys.num to the real patterns, directly modifies the ExtractResult + postProcessing(results, originSource, positionMap, numExtResults) { + let replaceText = baseNumbers.BaseNumbers.NumberReplaceToken; + for (let i = 0; i < results.length; i++) { + let start = results[i].start; + let end = start + results[i].length; + let str = results[i].text; + if (positionMap.has(start) && positionMap.has(end)) { + let originStart = positionMap.get(start); + let originLenth = positionMap.get(end) - originStart; + results[i].start = originStart; + results[i].length = originLenth; + results[i].text = originSource.substring(originStart, originStart + originLenth).trim(); + let numStart = str.indexOf(replaceText); + if (numStart !== -1) { + let numOriginStart = start + numStart; + if (positionMap.has(numStart)) { + let dataKey = originSource.substring(positionMap.get(numOriginStart), positionMap.get(numOriginStart + replaceText.length)); + for (let j = i; j < numExtResults.length; j++) { + if (results[i].start === numExtResults[j].start && results[i].text.includes(numExtResults[j].text)) { + results[i].data = [dataKey, numExtResults[j]]; + break; + } + } + } + } + } + } + } + // read the rules + buildRegexes(regexStrs, ignoreCase = true) { + return regexStrs.map(regexStr => { + let options = "gs"; + if (ignoreCase) { + options += "i"; + } + return recognizersText.RegExpUtility.getSafeRegExp(regexStr, options); + }); + } +} +BasePercentageExtractor.numExtType = constants.Constants.SYS_NUM; +exports.BasePercentageExtractor = BasePercentageExtractor; + +}); + +unwrapExports(extractors$4); + +var extractors$2 = createCommonjsModule(function (module, exports) { +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); + + + + + +class EnglishNumberExtractor extends extractors$4.BaseNumberExtractor { + constructor(mode = models$2.NumberMode.Default) { + super(); + this.extractType = constants.Constants.SYS_NUM; + this.negativeNumberTermsRegex = recognizersText.RegExpUtility.getSafeRegExp(englishNumeric.EnglishNumeric.NegativeNumberTermsRegex + "$", "is"); + let regexes = new Array(); + // Add Cardinal + let cardExtract = null; + switch (mode) { + case models$2.NumberMode.PureNumber: + cardExtract = new EnglishCardinalExtractor(englishNumeric.EnglishNumeric.PlaceHolderPureNumber); + break; + case models$2.NumberMode.Currency: + regexes.push({ regExp: recognizersText.RegExpUtility.getSafeRegExp(englishNumeric.EnglishNumeric.CurrencyRegex, "gs"), value: "IntegerNum" }); + break; + case models$2.NumberMode.Default: + break; + } + if (cardExtract === null) { + cardExtract = new EnglishCardinalExtractor(); + } + cardExtract.regexes.forEach(r => regexes.push(r)); + // Add Fraction + let fracExtract = new EnglishFractionExtractor(); + fracExtract.regexes.forEach(r => regexes.push(r)); + this.regexes = regexes; + } +} +exports.EnglishNumberExtractor = EnglishNumberExtractor; +class EnglishCardinalExtractor extends extractors$4.BaseNumberExtractor { + constructor(placeholder = englishNumeric.EnglishNumeric.PlaceHolderDefault) { + super(); + this.extractType = constants.Constants.SYS_NUM_CARDINAL; + let regexes = new Array(); + // Add Integer Regexes + let intExtract = new EnglishIntegerExtractor(placeholder); + intExtract.regexes.forEach(r => regexes.push(r)); + // Add Double Regexes + let doubleExtract = new EnglishDoubleExtractor(placeholder); + doubleExtract.regexes.forEach(r => regexes.push(r)); + this.regexes = regexes; + } +} +exports.EnglishCardinalExtractor = EnglishCardinalExtractor; +class EnglishIntegerExtractor extends extractors$4.BaseNumberExtractor { + constructor(placeholder = englishNumeric.EnglishNumeric.PlaceHolderDefault) { + super(); + this.extractType = constants.Constants.SYS_NUM_INTEGER; + let regexes = new Array({ + regExp: recognizersText.RegExpUtility.getSafeRegExp(englishNumeric.EnglishNumeric.NumbersWithPlaceHolder(placeholder), "gi"), + value: "IntegerNum" + }, { + regExp: recognizersText.RegExpUtility.getSafeRegExp(englishNumeric.EnglishNumeric.NumbersWithSuffix, "gs"), + value: "IntegerNum" + }, { + regExp: this.generateLongFormatNumberRegexes(models$2.LongFormatType.integerNumComma, placeholder), + value: "IntegerNum" + }, { + regExp: this.generateLongFormatNumberRegexes(models$2.LongFormatType.integerNumBlank, placeholder), + value: "IntegerNum" + }, { + regExp: this.generateLongFormatNumberRegexes(models$2.LongFormatType.integerNumNoBreakSpace, placeholder), + value: "IntegerNum" + }, { + regExp: recognizersText.RegExpUtility.getSafeRegExp(englishNumeric.EnglishNumeric.RoundNumberIntegerRegexWithLocks, "gis"), + value: "IntegerNum" + }, { + regExp: recognizersText.RegExpUtility.getSafeRegExp(englishNumeric.EnglishNumeric.NumbersWithDozenSuffix, "gis"), + value: "IntegerNum" + }, { + regExp: recognizersText.RegExpUtility.getSafeRegExp(englishNumeric.EnglishNumeric.AllIntRegexWithLocks, "gis"), + value: "IntegerEng" + }, { + regExp: recognizersText.RegExpUtility.getSafeRegExp(englishNumeric.EnglishNumeric.AllIntRegexWithDozenSuffixLocks, "gis"), + value: "IntegerEng" + }); + this.regexes = regexes; + } +} +exports.EnglishIntegerExtractor = EnglishIntegerExtractor; +class EnglishDoubleExtractor extends extractors$4.BaseNumberExtractor { + constructor(placeholder = englishNumeric.EnglishNumeric.PlaceHolderDefault) { + super(); + this.extractType = constants.Constants.SYS_NUM_DOUBLE; + let regexes = new Array({ + regExp: recognizersText.RegExpUtility.getSafeRegExp(englishNumeric.EnglishNumeric.DoubleDecimalPointRegex(placeholder), "gis"), + value: "DoubleNum" + }, { + regExp: recognizersText.RegExpUtility.getSafeRegExp(englishNumeric.EnglishNumeric.DoubleWithoutIntegralRegex(placeholder), "gis"), + value: "DoubleNum" + }, { + regExp: this.generateLongFormatNumberRegexes(models$2.LongFormatType.doubleNumCommaDot, placeholder), + value: "DoubleNum" + }, { + regExp: this.generateLongFormatNumberRegexes(models$2.LongFormatType.doubleNumNoBreakSpaceDot, placeholder), + value: "DoubleNum" + }, { + regExp: recognizersText.RegExpUtility.getSafeRegExp(englishNumeric.EnglishNumeric.DoubleWithMultiplierRegex, "gs"), + value: "DoubleNum" + }, { + regExp: recognizersText.RegExpUtility.getSafeRegExp(englishNumeric.EnglishNumeric.DoubleWithRoundNumber, "gis"), + value: "DoubleNum" + }, { + regExp: recognizersText.RegExpUtility.getSafeRegExp(englishNumeric.EnglishNumeric.DoubleAllFloatRegex, "gis"), + value: "DoubleEng" + }, { + regExp: recognizersText.RegExpUtility.getSafeRegExp(englishNumeric.EnglishNumeric.DoubleExponentialNotationRegex, "gis"), + value: "DoublePow" + }, { + regExp: recognizersText.RegExpUtility.getSafeRegExp(englishNumeric.EnglishNumeric.DoubleCaretExponentialNotationRegex, "gis"), + value: "DoublePow" + }); + this.regexes = regexes; + } +} +exports.EnglishDoubleExtractor = EnglishDoubleExtractor; +class EnglishFractionExtractor extends extractors$4.BaseNumberExtractor { + constructor() { + super(); + this.extractType = constants.Constants.SYS_NUM_FRACTION; + let regexes = new Array({ + regExp: recognizersText.RegExpUtility.getSafeRegExp(englishNumeric.EnglishNumeric.FractionNotationWithSpacesRegex, "gis"), + value: "FracNum" + }, { + regExp: recognizersText.RegExpUtility.getSafeRegExp(englishNumeric.EnglishNumeric.FractionNotationRegex, "gis"), + value: "FracNum" + }, { + regExp: recognizersText.RegExpUtility.getSafeRegExp(englishNumeric.EnglishNumeric.FractionNounRegex, "gis"), + value: "FracEng" + }, { + regExp: recognizersText.RegExpUtility.getSafeRegExp(englishNumeric.EnglishNumeric.FractionNounWithArticleRegex, "gis"), + value: "FracEng" + }, { + regExp: recognizersText.RegExpUtility.getSafeRegExp(englishNumeric.EnglishNumeric.FractionPrepositionRegex, "gis"), + value: "FracEng" + }); + this.regexes = regexes; + } +} +exports.EnglishFractionExtractor = EnglishFractionExtractor; +class EnglishOrdinalExtractor extends extractors$4.BaseNumberExtractor { + constructor() { + super(); + this.extractType = constants.Constants.SYS_NUM_ORDINAL; + let regexes = new Array({ + regExp: recognizersText.RegExpUtility.getSafeRegExp(englishNumeric.EnglishNumeric.OrdinalSuffixRegex, "gis"), + value: "OrdinalNum" + }, { + regExp: recognizersText.RegExpUtility.getSafeRegExp(englishNumeric.EnglishNumeric.OrdinalNumericRegex, "gis"), + value: "OrdinalNum" + }, { + regExp: recognizersText.RegExpUtility.getSafeRegExp(englishNumeric.EnglishNumeric.OrdinalEnglishRegex, "gis"), + value: "OrdEng" + }, { + regExp: recognizersText.RegExpUtility.getSafeRegExp(englishNumeric.EnglishNumeric.OrdinalRoundNumberRegex, "gis"), + value: "OrdEng" + }); + this.regexes = regexes; + } +} +exports.EnglishOrdinalExtractor = EnglishOrdinalExtractor; +class EnglishPercentageExtractor extends extractors$4.BasePercentageExtractor { + constructor() { + super(new EnglishNumberExtractor()); + } + initRegexes() { + let regexStrs = [ + englishNumeric.EnglishNumeric.NumberWithSuffixPercentage, + englishNumeric.EnglishNumeric.NumberWithPrefixPercentage + ]; + return this.buildRegexes(regexStrs); + } +} +exports.EnglishPercentageExtractor = EnglishPercentageExtractor; + +}); + +unwrapExports(extractors$2); + +var extractors$6 = createCommonjsModule(function (module, exports) { +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); + + + + + +class SpanishNumberExtractor extends extractors$4.BaseNumberExtractor { + constructor(mode = models$2.NumberMode.Default) { + super(); + this.extractType = constants.Constants.SYS_NUM; + let regexes = new Array(); + // Add Cardinal + let cardExtract = null; + switch (mode) { + case models$2.NumberMode.PureNumber: + cardExtract = new SpanishCardinalExtractor(spanishNumeric.SpanishNumeric.PlaceHolderPureNumber); + break; + case models$2.NumberMode.Currency: + regexes.push({ regExp: recognizersText.RegExpUtility.getSafeRegExp(spanishNumeric.SpanishNumeric.CurrencyRegex, "gs"), value: "IntegerNum" }); + break; + case models$2.NumberMode.Default: + break; + } + if (cardExtract === null) { + cardExtract = new SpanishCardinalExtractor(); + } + cardExtract.regexes.forEach(r => regexes.push(r)); + // Add Fraction + let fracExtract = new SpanishFractionExtractor(); + fracExtract.regexes.forEach(r => regexes.push(r)); + this.regexes = regexes; + } +} +exports.SpanishNumberExtractor = SpanishNumberExtractor; +class SpanishCardinalExtractor extends extractors$4.BaseNumberExtractor { + constructor(placeholder = spanishNumeric.SpanishNumeric.PlaceHolderDefault) { + super(); + this.extractType = constants.Constants.SYS_NUM_CARDINAL; + let regexes = new Array(); + // Add Integer Regexes + let intExtract = new SpanishIntegerExtractor(placeholder); + intExtract.regexes.forEach(r => regexes.push(r)); + // Add Double Regexes + let doubleExtract = new SpanishDoubleExtractor(placeholder); + doubleExtract.regexes.forEach(r => regexes.push(r)); + this.regexes = regexes; + } +} +exports.SpanishCardinalExtractor = SpanishCardinalExtractor; +class SpanishIntegerExtractor extends extractors$4.BaseNumberExtractor { + constructor(placeholder = spanishNumeric.SpanishNumeric.PlaceHolderDefault) { + super(); + this.extractType = constants.Constants.SYS_NUM_INTEGER; + let regexes = new Array({ + regExp: recognizersText.RegExpUtility.getSafeRegExp(spanishNumeric.SpanishNumeric.NumbersWithPlaceHolder(placeholder), "gi"), + value: "IntegerNum" + }, { + regExp: recognizersText.RegExpUtility.getSafeRegExp(spanishNumeric.SpanishNumeric.NumbersWithSuffix, "gs"), + value: "IntegerNum" + }, { + regExp: this.generateLongFormatNumberRegexes(models$2.LongFormatType.integerNumDot, placeholder), + value: "IntegerNum" + }, { + regExp: this.generateLongFormatNumberRegexes(models$2.LongFormatType.integerNumBlank, placeholder), + value: "IntegerNum" + }, { + regExp: this.generateLongFormatNumberRegexes(models$2.LongFormatType.integerNumNoBreakSpace, placeholder), + value: "IntegerNum" + }, { + regExp: recognizersText.RegExpUtility.getSafeRegExp(spanishNumeric.SpanishNumeric.RoundNumberIntegerRegexWithLocks), + value: "IntegerNum" + }, { + regExp: recognizersText.RegExpUtility.getSafeRegExp(spanishNumeric.SpanishNumeric.NumbersWithDozenSuffix), + value: "IntegerNum" + }, { + regExp: recognizersText.RegExpUtility.getSafeRegExp(spanishNumeric.SpanishNumeric.AllIntRegexWithLocks), + value: "IntegerSpa" + }, { + regExp: recognizersText.RegExpUtility.getSafeRegExp(spanishNumeric.SpanishNumeric.AllIntRegexWithDozenSuffixLocks), + value: "IntegerSpa" + }); + this.regexes = regexes; + } +} +exports.SpanishIntegerExtractor = SpanishIntegerExtractor; +class SpanishDoubleExtractor extends extractors$4.BaseNumberExtractor { + constructor(placeholder = spanishNumeric.SpanishNumeric.PlaceHolderDefault) { + super(); + this.extractType = constants.Constants.SYS_NUM_DOUBLE; + let regexes = new Array({ + regExp: recognizersText.RegExpUtility.getSafeRegExp(spanishNumeric.SpanishNumeric.DoubleDecimalPointRegex(placeholder)), + value: "DoubleNum" + }, { + regExp: recognizersText.RegExpUtility.getSafeRegExp(spanishNumeric.SpanishNumeric.DoubleWithoutIntegralRegex(placeholder)), + value: "DoubleNum" + }, { + regExp: recognizersText.RegExpUtility.getSafeRegExp(spanishNumeric.SpanishNumeric.DoubleWithMultiplierRegex, "gs"), + value: "DoubleNum" + }, { + regExp: recognizersText.RegExpUtility.getSafeRegExp(spanishNumeric.SpanishNumeric.DoubleWithRoundNumber), + value: "DoubleNum" + }, { + regExp: recognizersText.RegExpUtility.getSafeRegExp(spanishNumeric.SpanishNumeric.DoubleAllFloatRegex), + value: "DoubleSpa" + }, { + regExp: recognizersText.RegExpUtility.getSafeRegExp(spanishNumeric.SpanishNumeric.DoubleExponentialNotationRegex), + value: "DoublePow" + }, { + regExp: recognizersText.RegExpUtility.getSafeRegExp(spanishNumeric.SpanishNumeric.DoubleCaretExponentialNotationRegex), + value: "DoublePow" + }, { + regExp: this.generateLongFormatNumberRegexes(models$2.LongFormatType.doubleNumDotComma, placeholder), + value: "DoubleNum" + }, { + regExp: this.generateLongFormatNumberRegexes(models$2.LongFormatType.doubleNumNoBreakSpaceComma, placeholder), + value: "DoubleNum" + }); + this.regexes = regexes; + } +} +exports.SpanishDoubleExtractor = SpanishDoubleExtractor; +class SpanishFractionExtractor extends extractors$4.BaseNumberExtractor { + constructor() { + super(); + this.extractType = constants.Constants.SYS_NUM_FRACTION; + let regexes = new Array({ + regExp: recognizersText.RegExpUtility.getSafeRegExp(spanishNumeric.SpanishNumeric.FractionNotationRegex), + value: "FracNum" + }, { + regExp: recognizersText.RegExpUtility.getSafeRegExp(spanishNumeric.SpanishNumeric.FractionNotationWithSpacesRegex), + value: "FracNum" + }, { + regExp: recognizersText.RegExpUtility.getSafeRegExp(spanishNumeric.SpanishNumeric.FractionNounRegex), + value: "FracSpa" + }, { + regExp: recognizersText.RegExpUtility.getSafeRegExp(spanishNumeric.SpanishNumeric.FractionNounWithArticleRegex), + value: "FracSpa" + }, { + regExp: recognizersText.RegExpUtility.getSafeRegExp(spanishNumeric.SpanishNumeric.FractionPrepositionRegex), + value: "FracSpa" + }); + this.regexes = regexes; + } +} +exports.SpanishFractionExtractor = SpanishFractionExtractor; +class SpanishOrdinalExtractor extends extractors$4.BaseNumberExtractor { + constructor() { + super(); + this.extractType = constants.Constants.SYS_NUM_ORDINAL; + let regexes = new Array({ + regExp: recognizersText.RegExpUtility.getSafeRegExp(spanishNumeric.SpanishNumeric.OrdinalSuffixRegex), + value: "OrdinalNum" + }, { + regExp: recognizersText.RegExpUtility.getSafeRegExp(spanishNumeric.SpanishNumeric.OrdinalNounRegex), + value: "OrdSpa" + }); + this.regexes = regexes; + } +} +exports.SpanishOrdinalExtractor = SpanishOrdinalExtractor; +class SpanishPercentageExtractor extends extractors$4.BasePercentageExtractor { + constructor() { + super(new SpanishNumberExtractor()); + } + initRegexes() { + let regexStrs = [ + spanishNumeric.SpanishNumeric.NumberWithPrefixPercentage + ]; + return this.buildRegexes(regexStrs); + } +} +exports.SpanishPercentageExtractor = SpanishPercentageExtractor; + +}); + +unwrapExports(extractors$6); + +var extractors$8 = createCommonjsModule(function (module, exports) { +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); + + + + + +class PortugueseNumberExtractor extends extractors$4.BaseNumberExtractor { + constructor(mode = models$2.NumberMode.Default) { + super(); + this.extractType = constants.Constants.SYS_NUM; + let regexes = new Array(); + // Add Cardinal + let cardExtract = null; + switch (mode) { + case models$2.NumberMode.PureNumber: + cardExtract = new PortugueseCardinalExtractor(portugueseNumeric.PortugueseNumeric.PlaceHolderPureNumber); + break; + case models$2.NumberMode.Currency: + regexes.push({ regExp: recognizersText.RegExpUtility.getSafeRegExp(portugueseNumeric.PortugueseNumeric.CurrencyRegex, "gs"), value: "IntegerNum" }); + break; + case models$2.NumberMode.Default: + break; + } + if (cardExtract === null) { + cardExtract = new PortugueseCardinalExtractor(); + } + cardExtract.regexes.forEach(r => regexes.push(r)); + // Add Fraction + let fracExtract = new PortugueseFractionExtractor(); + fracExtract.regexes.forEach(r => regexes.push(r)); + this.regexes = regexes; + } +} +exports.PortugueseNumberExtractor = PortugueseNumberExtractor; +class PortugueseCardinalExtractor extends extractors$4.BaseNumberExtractor { + constructor(placeholder = portugueseNumeric.PortugueseNumeric.PlaceHolderDefault) { + super(); + this.extractType = constants.Constants.SYS_NUM_CARDINAL; + let regexes = new Array(); + // Add Integer Regexes + let intExtract = new PortugueseIntegerExtractor(placeholder); + intExtract.regexes.forEach(r => regexes.push(r)); + // Add Double Regexes + let doubleExtract = new PortugueseDoubleExtractor(placeholder); + doubleExtract.regexes.forEach(r => regexes.push(r)); + this.regexes = regexes; + } +} +exports.PortugueseCardinalExtractor = PortugueseCardinalExtractor; +class PortugueseIntegerExtractor extends extractors$4.BaseNumberExtractor { + constructor(placeholder = portugueseNumeric.PortugueseNumeric.PlaceHolderDefault) { + super(); + this.extractType = constants.Constants.SYS_NUM_INTEGER; + let regexes = new Array({ + regExp: recognizersText.RegExpUtility.getSafeRegExp(portugueseNumeric.PortugueseNumeric.NumbersWithPlaceHolder(placeholder), "gi"), + value: "IntegerNum" + }, { + regExp: recognizersText.RegExpUtility.getSafeRegExp(portugueseNumeric.PortugueseNumeric.NumbersWithSuffix, "gs"), + value: "IntegerNum" + }, { + regExp: this.generateLongFormatNumberRegexes(models$2.LongFormatType.integerNumDot, placeholder), + value: "IntegerNum" + }, { + regExp: this.generateLongFormatNumberRegexes(models$2.LongFormatType.integerNumBlank, placeholder), + value: "IntegerNum" + }, { + regExp: this.generateLongFormatNumberRegexes(models$2.LongFormatType.integerNumNoBreakSpace, placeholder), + value: "IntegerNum" + }, { + regExp: recognizersText.RegExpUtility.getSafeRegExp(portugueseNumeric.PortugueseNumeric.RoundNumberIntegerRegexWithLocks), + value: "IntegerNum" + }, { + regExp: recognizersText.RegExpUtility.getSafeRegExp(portugueseNumeric.PortugueseNumeric.NumbersWithDozen2Suffix), + value: "IntegerNum" + }, { + regExp: recognizersText.RegExpUtility.getSafeRegExp(portugueseNumeric.PortugueseNumeric.NumbersWithDozenSuffix), + value: "IntegerNum" + }, { + regExp: recognizersText.RegExpUtility.getSafeRegExp(portugueseNumeric.PortugueseNumeric.AllIntRegexWithLocks), + value: "IntegerPor" + }, { + regExp: recognizersText.RegExpUtility.getSafeRegExp(portugueseNumeric.PortugueseNumeric.AllIntRegexWithDozenSuffixLocks), + value: "IntegerPor" + }); + this.regexes = regexes; + } +} +exports.PortugueseIntegerExtractor = PortugueseIntegerExtractor; +class PortugueseDoubleExtractor extends extractors$4.BaseNumberExtractor { + constructor(placeholder = portugueseNumeric.PortugueseNumeric.PlaceHolderDefault) { + super(); + this.extractType = constants.Constants.SYS_NUM_DOUBLE; + let regexes = new Array({ + regExp: recognizersText.RegExpUtility.getSafeRegExp(portugueseNumeric.PortugueseNumeric.DoubleDecimalPointRegex(placeholder)), + value: "DoubleNum" + }, { + regExp: recognizersText.RegExpUtility.getSafeRegExp(portugueseNumeric.PortugueseNumeric.DoubleWithoutIntegralRegex(placeholder)), + value: "DoubleNum" + }, { + regExp: recognizersText.RegExpUtility.getSafeRegExp(portugueseNumeric.PortugueseNumeric.DoubleWithMultiplierRegex, "gs"), + value: "DoubleNum" + }, { + regExp: recognizersText.RegExpUtility.getSafeRegExp(portugueseNumeric.PortugueseNumeric.DoubleWithRoundNumber), + value: "DoubleNum" + }, { + regExp: recognizersText.RegExpUtility.getSafeRegExp(portugueseNumeric.PortugueseNumeric.DoubleAllFloatRegex), + value: "DoublePor" + }, { + regExp: recognizersText.RegExpUtility.getSafeRegExp(portugueseNumeric.PortugueseNumeric.DoubleExponentialNotationRegex), + value: "DoublePow" + }, { + regExp: recognizersText.RegExpUtility.getSafeRegExp(portugueseNumeric.PortugueseNumeric.DoubleCaretExponentialNotationRegex), + value: "DoublePow" + }, { + regExp: this.generateLongFormatNumberRegexes(models$2.LongFormatType.doubleNumDotComma, placeholder), + value: "DoubleNum" + }, { + regExp: this.generateLongFormatNumberRegexes(models$2.LongFormatType.doubleNumNoBreakSpaceComma, placeholder), + value: "DoubleNum" + }); + this.regexes = regexes; + } +} +exports.PortugueseDoubleExtractor = PortugueseDoubleExtractor; +class PortugueseFractionExtractor extends extractors$4.BaseNumberExtractor { + constructor() { + super(); + this.extractType = constants.Constants.SYS_NUM_FRACTION; + let regexes = new Array({ + regExp: recognizersText.RegExpUtility.getSafeRegExp(portugueseNumeric.PortugueseNumeric.FractionNotationRegex), + value: "FracNum" + }, { + regExp: recognizersText.RegExpUtility.getSafeRegExp(portugueseNumeric.PortugueseNumeric.FractionNotationWithSpacesRegex), + value: "FracNum" + }, { + regExp: recognizersText.RegExpUtility.getSafeRegExp(portugueseNumeric.PortugueseNumeric.FractionNounRegex), + value: "FracPor" + }, { + regExp: recognizersText.RegExpUtility.getSafeRegExp(portugueseNumeric.PortugueseNumeric.FractionNounWithArticleRegex), + value: "FracPor" + }, { + regExp: recognizersText.RegExpUtility.getSafeRegExp(portugueseNumeric.PortugueseNumeric.FractionPrepositionRegex), + value: "FracPor" + }); + this.regexes = regexes; + } +} +exports.PortugueseFractionExtractor = PortugueseFractionExtractor; +class PortugueseOrdinalExtractor extends extractors$4.BaseNumberExtractor { + constructor() { + super(); + this.extractType = constants.Constants.SYS_NUM_ORDINAL; + let regexes = new Array({ + regExp: recognizersText.RegExpUtility.getSafeRegExp(portugueseNumeric.PortugueseNumeric.OrdinalSuffixRegex), + value: "OrdinalNum" + }, { + regExp: recognizersText.RegExpUtility.getSafeRegExp(portugueseNumeric.PortugueseNumeric.OrdinalEnglishRegex), + value: "OrdinalPor" + }); + this.regexes = regexes; + } +} +exports.PortugueseOrdinalExtractor = PortugueseOrdinalExtractor; +class PortuguesePercentageExtractor extends extractors$4.BasePercentageExtractor { + constructor() { + super(new PortugueseNumberExtractor()); + } + initRegexes() { + let regexStrs = [ + portugueseNumeric.PortugueseNumeric.NumberWithSuffixPercentage + ]; + return this.buildRegexes(regexStrs); + } +} +exports.PortuguesePercentageExtractor = PortuguesePercentageExtractor; + +}); + +unwrapExports(extractors$8); + +var extractors$10 = createCommonjsModule(function (module, exports) { +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); + + + + + +class FrenchNumberExtractor extends extractors$4.BaseNumberExtractor { + constructor(mode = models$2.NumberMode.Default) { + super(); + this.extractType = constants.Constants.SYS_NUM; + let regexes = new Array(); + // Add Cardinal + let cardExtract = null; + switch (mode) { + case models$2.NumberMode.PureNumber: + cardExtract = new FrenchCardinalExtractor(frenchNumeric.FrenchNumeric.PlaceHolderPureNumber); + break; + case models$2.NumberMode.Currency: + regexes.push({ regExp: recognizersText.RegExpUtility.getSafeRegExp(frenchNumeric.FrenchNumeric.CurrencyRegex, "gs"), value: "IntegerNum" }); + break; + case models$2.NumberMode.Default: + break; + } + if (cardExtract === null) { + cardExtract = new FrenchCardinalExtractor(); + } + cardExtract.regexes.forEach(r => regexes.push(r)); + // Add Fraction + let fracExtract = new FrenchFractionExtractor(); + fracExtract.regexes.forEach(r => regexes.push(r)); + this.regexes = regexes; + } +} +exports.FrenchNumberExtractor = FrenchNumberExtractor; +class FrenchCardinalExtractor extends extractors$4.BaseNumberExtractor { + constructor(placeholder = frenchNumeric.FrenchNumeric.PlaceHolderDefault) { + super(); + this.extractType = constants.Constants.SYS_NUM_CARDINAL; + let regexes = new Array(); + // Add Integer Regexes + let intExtract = new FrenchIntegerExtractor(placeholder); + intExtract.regexes.forEach(r => regexes.push(r)); + // Add Double Regexes + let doubleExtract = new FrenchDoubleExtractor(placeholder); + doubleExtract.regexes.forEach(r => regexes.push(r)); + this.regexes = regexes; + } +} +exports.FrenchCardinalExtractor = FrenchCardinalExtractor; +class FrenchIntegerExtractor extends extractors$4.BaseNumberExtractor { + constructor(placeholder = frenchNumeric.FrenchNumeric.PlaceHolderDefault) { + super(); + this.extractType = constants.Constants.SYS_NUM_INTEGER; + let regexes = new Array({ + regExp: recognizersText.RegExpUtility.getSafeRegExp(frenchNumeric.FrenchNumeric.NumbersWithPlaceHolder(placeholder), "gi"), + value: "IntegerNum" + }, { + regExp: recognizersText.RegExpUtility.getSafeRegExp(frenchNumeric.FrenchNumeric.NumbersWithSuffix, "gs"), + value: "IntegerNum" + }, { + regExp: this.generateLongFormatNumberRegexes(models$2.LongFormatType.integerNumDot, placeholder), + value: "IntegerNum" + }, { + regExp: this.generateLongFormatNumberRegexes(models$2.LongFormatType.integerNumBlank, placeholder), + value: "IntegerNum" + }, { + regExp: this.generateLongFormatNumberRegexes(models$2.LongFormatType.integerNumNoBreakSpace, placeholder), + value: "IntegerNum" + }, { + regExp: recognizersText.RegExpUtility.getSafeRegExp(frenchNumeric.FrenchNumeric.RoundNumberIntegerRegexWithLocks), + value: "IntegerNum" + }, { + regExp: recognizersText.RegExpUtility.getSafeRegExp(frenchNumeric.FrenchNumeric.NumbersWithDozenSuffix), + value: "IntegerNum" + }, { + regExp: recognizersText.RegExpUtility.getSafeRegExp(frenchNumeric.FrenchNumeric.AllIntRegexWithLocks), + value: "IntegerFr" + }, { + regExp: recognizersText.RegExpUtility.getSafeRegExp(frenchNumeric.FrenchNumeric.AllIntRegexWithDozenSuffixLocks), + value: "IntegerFr" + }); + this.regexes = regexes; + } +} +exports.FrenchIntegerExtractor = FrenchIntegerExtractor; +class FrenchDoubleExtractor extends extractors$4.BaseNumberExtractor { + constructor(placeholder = frenchNumeric.FrenchNumeric.PlaceHolderDefault) { + super(); + this.extractType = constants.Constants.SYS_NUM_DOUBLE; + let regexes = new Array({ + regExp: recognizersText.RegExpUtility.getSafeRegExp(frenchNumeric.FrenchNumeric.DoubleDecimalPointRegex(placeholder)), + value: "DoubleNum" + }, { + regExp: recognizersText.RegExpUtility.getSafeRegExp(frenchNumeric.FrenchNumeric.DoubleWithoutIntegralRegex(placeholder)), + value: "DoubleNum" + }, { + regExp: recognizersText.RegExpUtility.getSafeRegExp(frenchNumeric.FrenchNumeric.DoubleWithMultiplierRegex, "gs"), + value: "DoubleNum" + }, { + regExp: recognizersText.RegExpUtility.getSafeRegExp(frenchNumeric.FrenchNumeric.DoubleWithRoundNumber), + value: "DoubleNum" + }, { + regExp: recognizersText.RegExpUtility.getSafeRegExp(frenchNumeric.FrenchNumeric.DoubleAllFloatRegex), + value: "DoubleFr" + }, { + regExp: recognizersText.RegExpUtility.getSafeRegExp(frenchNumeric.FrenchNumeric.DoubleExponentialNotationRegex), + value: "DoublePow" + }, { + regExp: recognizersText.RegExpUtility.getSafeRegExp(frenchNumeric.FrenchNumeric.DoubleCaretExponentialNotationRegex), + value: "DoublePow" + }, { + regExp: this.generateLongFormatNumberRegexes(models$2.LongFormatType.doubleNumDotComma, placeholder), + value: "DoubleNum" + }, { + regExp: this.generateLongFormatNumberRegexes(models$2.LongFormatType.doubleNumNoBreakSpaceComma, placeholder), + value: "DoubleNum" + }); + this.regexes = regexes; + } +} +exports.FrenchDoubleExtractor = FrenchDoubleExtractor; +class FrenchFractionExtractor extends extractors$4.BaseNumberExtractor { + constructor() { + super(); + this.extractType = constants.Constants.SYS_NUM_FRACTION; + let regexes = new Array({ + regExp: recognizersText.RegExpUtility.getSafeRegExp(frenchNumeric.FrenchNumeric.FractionNotationRegex), + value: "FracNum" + }, { + regExp: recognizersText.RegExpUtility.getSafeRegExp(frenchNumeric.FrenchNumeric.FractionNotationWithSpacesRegex), + value: "FracNum" + }, { + regExp: recognizersText.RegExpUtility.getSafeRegExp(frenchNumeric.FrenchNumeric.FractionNounRegex), + value: "FracFr" + }, { + regExp: recognizersText.RegExpUtility.getSafeRegExp(frenchNumeric.FrenchNumeric.FractionNounWithArticleRegex), + value: "FracFr" + }, { + regExp: recognizersText.RegExpUtility.getSafeRegExp(frenchNumeric.FrenchNumeric.FractionPrepositionRegex), + value: "FracFr" + }); + this.regexes = regexes; + } +} +exports.FrenchFractionExtractor = FrenchFractionExtractor; +class FrenchOrdinalExtractor extends extractors$4.BaseNumberExtractor { + constructor() { + super(); + this.extractType = constants.Constants.SYS_NUM_ORDINAL; + let regexes = new Array({ + regExp: recognizersText.RegExpUtility.getSafeRegExp(frenchNumeric.FrenchNumeric.OrdinalSuffixRegex), + value: "OrdinalNum" + }, { + regExp: recognizersText.RegExpUtility.getSafeRegExp(frenchNumeric.FrenchNumeric.OrdinalFrenchRegex), + value: "OrdFr" + }); + this.regexes = regexes; + } +} +exports.FrenchOrdinalExtractor = FrenchOrdinalExtractor; +class FrenchPercentageExtractor extends extractors$4.BasePercentageExtractor { + constructor() { + super(new FrenchNumberExtractor()); + } + initRegexes() { + let regexStrs = [ + frenchNumeric.FrenchNumeric.NumberWithSuffixPercentage, + frenchNumeric.FrenchNumeric.NumberWithPrefixPercentage + ]; + return this.buildRegexes(regexStrs); + } +} +exports.FrenchPercentageExtractor = FrenchPercentageExtractor; + +}); + +unwrapExports(extractors$10); + +var extractors$12 = createCommonjsModule(function (module, exports) { +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); + + + + +var ChineseNumberExtractorMode; +(function (ChineseNumberExtractorMode) { + // Number extraction with an allow list that filters what numbers to extract. + ChineseNumberExtractorMode[ChineseNumberExtractorMode["Default"] = 0] = "Default"; + // Extract all number-related terms aggressively. + ChineseNumberExtractorMode[ChineseNumberExtractorMode["ExtractAll"] = 1] = "ExtractAll"; +})(ChineseNumberExtractorMode = exports.ChineseNumberExtractorMode || (exports.ChineseNumberExtractorMode = {})); +class ChineseNumberExtractor extends extractors$4.BaseNumberExtractor { + constructor(mode = ChineseNumberExtractorMode.Default) { + super(); + this.extractType = constants.Constants.SYS_NUM; + let regexes = new Array(); + // Add Cardinal + let cardExtract = new ChineseCardinalExtractor(mode); + cardExtract.regexes.forEach(r => regexes.push(r)); + // Add Fraction + let fracExtract = new ChineseFractionExtractor(); + fracExtract.regexes.forEach(r => regexes.push(r)); + this.regexes = regexes; + } +} +exports.ChineseNumberExtractor = ChineseNumberExtractor; +class ChineseCardinalExtractor extends extractors$4.BaseNumberExtractor { + constructor(mode = ChineseNumberExtractorMode.Default) { + super(); + this.extractType = constants.Constants.SYS_NUM_CARDINAL; + let regexes = new Array(); + // Add Integer Regexes + let intExtract = new ChineseIntegerExtractor(mode); + intExtract.regexes.forEach(r => regexes.push(r)); + // Add Double Regexes + let doubleExtract = new ChineseDoubleExtractor(); + doubleExtract.regexes.forEach(r => regexes.push(r)); + this.regexes = regexes; + } +} +exports.ChineseCardinalExtractor = ChineseCardinalExtractor; +class ChineseIntegerExtractor extends extractors$4.BaseNumberExtractor { + constructor(mode = ChineseNumberExtractorMode.Default) { + super(); + this.extractType = constants.Constants.SYS_NUM_INTEGER; + let regexes = new Array({ + regExp: recognizersText.RegExpUtility.getSafeRegExp(chineseNumeric.ChineseNumeric.NumbersSpecialsChars, "gi"), + value: "IntegerNum" + }, { + regExp: recognizersText.RegExpUtility.getSafeRegExp(chineseNumeric.ChineseNumeric.NumbersSpecialsCharsWithSuffix, "gs"), + value: "IntegerNum" + }, { + regExp: recognizersText.RegExpUtility.getSafeRegExp(chineseNumeric.ChineseNumeric.DottedNumbersSpecialsChar, "gis"), + value: "IntegerNum" + }, { + regExp: recognizersText.RegExpUtility.getSafeRegExp(chineseNumeric.ChineseNumeric.NumbersWithHalfDozen, "gis"), + value: "IntegerChs" + }, { + regExp: recognizersText.RegExpUtility.getSafeRegExp(chineseNumeric.ChineseNumeric.NumbersWithDozen, "gis"), + value: "IntegerChs" + }); + switch (mode) { + case ChineseNumberExtractorMode.Default: + regexes.push({ + regExp: recognizersText.RegExpUtility.getSafeRegExp(chineseNumeric.ChineseNumeric.NumbersWithAllowListRegex, "gi"), + value: "IntegerChs" + }); + break; + case ChineseNumberExtractorMode.ExtractAll: + regexes.push({ + regExp: recognizersText.RegExpUtility.getSafeRegExp(chineseNumeric.ChineseNumeric.NumbersAggressiveRegex, "gi"), + value: "IntegerChs" + }); + break; + } + this.regexes = regexes; + } +} +exports.ChineseIntegerExtractor = ChineseIntegerExtractor; +class ChineseDoubleExtractor extends extractors$4.BaseNumberExtractor { + constructor() { + super(); + this.extractType = constants.Constants.SYS_NUM_DOUBLE; + let regexes = new Array({ + regExp: recognizersText.RegExpUtility.getSafeRegExp(chineseNumeric.ChineseNumeric.DoubleSpecialsChars, "gis"), + value: "DoubleNum" + }, { + regExp: recognizersText.RegExpUtility.getSafeRegExp(chineseNumeric.ChineseNumeric.DoubleSpecialsCharsWithNegatives, "gis"), + value: "DoubleNum" + }, { + regExp: recognizersText.RegExpUtility.getSafeRegExp(chineseNumeric.ChineseNumeric.SimpleDoubleSpecialsChars, "gis"), + value: "DoubleNum" + }, { + regExp: recognizersText.RegExpUtility.getSafeRegExp(chineseNumeric.ChineseNumeric.DoubleWithMultiplierRegex, "gi"), + value: "DoubleNum" + }, { + regExp: recognizersText.RegExpUtility.getSafeRegExp(chineseNumeric.ChineseNumeric.DoubleWithThousandsRegex, "gi"), + value: "DoubleChs" + }, { + regExp: recognizersText.RegExpUtility.getSafeRegExp(chineseNumeric.ChineseNumeric.DoubleAllFloatRegex, "gi"), + value: "DoubleChs" + }, { + regExp: recognizersText.RegExpUtility.getSafeRegExp(chineseNumeric.ChineseNumeric.DoubleExponentialNotationRegex, "gis"), + value: "DoublePow" + }, { + regExp: recognizersText.RegExpUtility.getSafeRegExp(chineseNumeric.ChineseNumeric.DoubleScientificNotationRegex, "gis"), + value: "DoublePow" + }); + this.regexes = regexes; + } +} +exports.ChineseDoubleExtractor = ChineseDoubleExtractor; +class ChineseFractionExtractor extends extractors$4.BaseNumberExtractor { + constructor() { + super(); + this.extractType = constants.Constants.SYS_NUM_FRACTION; + let regexes = new Array({ + regExp: recognizersText.RegExpUtility.getSafeRegExp(chineseNumeric.ChineseNumeric.FractionNotationSpecialsCharsRegex, "gis"), + value: "FracNum" + }, { + regExp: recognizersText.RegExpUtility.getSafeRegExp(chineseNumeric.ChineseNumeric.FractionNotationRegex, "gis"), + value: "FracNum" + }, { + regExp: recognizersText.RegExpUtility.getSafeRegExp(chineseNumeric.ChineseNumeric.AllFractionNumber, "gi"), + value: "FracChs" + }); + this.regexes = regexes; + } +} +exports.ChineseFractionExtractor = ChineseFractionExtractor; +class ChineseOrdinalExtractor extends extractors$4.BaseNumberExtractor { + constructor() { + super(); + this.extractType = constants.Constants.SYS_NUM_ORDINAL; + let regexes = new Array({ + regExp: recognizersText.RegExpUtility.getSafeRegExp(chineseNumeric.ChineseNumeric.OrdinalRegex, "gi"), + value: "OrdinalChs" + }, { + regExp: recognizersText.RegExpUtility.getSafeRegExp(chineseNumeric.ChineseNumeric.OrdinalNumbersRegex, "gi"), + value: "OrdinalChs" + }); + this.regexes = regexes; + } +} +exports.ChineseOrdinalExtractor = ChineseOrdinalExtractor; +class ChinesePercentageExtractor extends extractors$4.BaseNumberExtractor { + constructor() { + super(); + this.extractType = constants.Constants.SYS_NUM_PERCENTAGE; + let regexes = new Array({ + regExp: recognizersText.RegExpUtility.getSafeRegExp(chineseNumeric.ChineseNumeric.PercentagePointRegex, "gi"), + value: "PerChs" + }, { + regExp: recognizersText.RegExpUtility.getSafeRegExp(chineseNumeric.ChineseNumeric.SimplePercentageRegex, "gi"), + value: "PerChs" + }, { + regExp: recognizersText.RegExpUtility.getSafeRegExp(chineseNumeric.ChineseNumeric.NumbersPercentagePointRegex, "gis"), + value: "PerNum" + }, { + regExp: recognizersText.RegExpUtility.getSafeRegExp(chineseNumeric.ChineseNumeric.NumbersPercentageWithSeparatorRegex, "gis"), + value: "PerNum" + }, { + regExp: recognizersText.RegExpUtility.getSafeRegExp(chineseNumeric.ChineseNumeric.NumbersPercentageWithMultiplierRegex, "gi"), + value: "PerNum" + }, { + regExp: recognizersText.RegExpUtility.getSafeRegExp(chineseNumeric.ChineseNumeric.FractionPercentagePointRegex, "gis"), + value: "PerNum" + }, { + regExp: recognizersText.RegExpUtility.getSafeRegExp(chineseNumeric.ChineseNumeric.FractionPercentageWithSeparatorRegex, "gis"), + value: "PerNum" + }, { + regExp: recognizersText.RegExpUtility.getSafeRegExp(chineseNumeric.ChineseNumeric.FractionPercentageWithMultiplierRegex, "gi"), + value: "PerNum" + }, { + regExp: recognizersText.RegExpUtility.getSafeRegExp(chineseNumeric.ChineseNumeric.SimpleNumbersPercentageRegex, "gis"), + value: "PerNum" + }, { + regExp: recognizersText.RegExpUtility.getSafeRegExp(chineseNumeric.ChineseNumeric.SimpleNumbersPercentageWithMultiplierRegex, "gi"), + value: "PerNum" + }, { + regExp: recognizersText.RegExpUtility.getSafeRegExp(chineseNumeric.ChineseNumeric.SimpleNumbersPercentagePointRegex, "gis"), + value: "PerNum" + }, { + regExp: recognizersText.RegExpUtility.getSafeRegExp(chineseNumeric.ChineseNumeric.IntegerPercentageRegex, "gis"), + value: "PerNum" + }, { + regExp: recognizersText.RegExpUtility.getSafeRegExp(chineseNumeric.ChineseNumeric.IntegerPercentageWithMultiplierRegex, "gi"), + value: "PerNum" + }, { + regExp: recognizersText.RegExpUtility.getSafeRegExp(chineseNumeric.ChineseNumeric.NumbersFractionPercentageRegex, "gis"), + value: "PerNum" + }, { + regExp: recognizersText.RegExpUtility.getSafeRegExp(chineseNumeric.ChineseNumeric.SimpleIntegerPercentageRegex, "gis"), + value: "PerNum" + }, { + regExp: recognizersText.RegExpUtility.getSafeRegExp(chineseNumeric.ChineseNumeric.NumbersFoldsPercentageRegex, "gis"), + value: "PerSpe" + }, { + regExp: recognizersText.RegExpUtility.getSafeRegExp(chineseNumeric.ChineseNumeric.FoldsPercentageRegex, "gis"), + value: "PerSpe" + }, { + regExp: recognizersText.RegExpUtility.getSafeRegExp(chineseNumeric.ChineseNumeric.SimpleFoldsPercentageRegex, "gis"), + value: "PerSpe" + }, { + regExp: recognizersText.RegExpUtility.getSafeRegExp(chineseNumeric.ChineseNumeric.SpecialsPercentageRegex, "gis"), + value: "PerSpe" + }, { + regExp: recognizersText.RegExpUtility.getSafeRegExp(chineseNumeric.ChineseNumeric.NumbersSpecialsPercentageRegex, "gis"), + value: "PerSpe" + }, { + regExp: recognizersText.RegExpUtility.getSafeRegExp(chineseNumeric.ChineseNumeric.SimpleSpecialsPercentageRegex, "gis"), + value: "PerSpe" + }, { + regExp: recognizersText.RegExpUtility.getSafeRegExp(chineseNumeric.ChineseNumeric.SpecialsFoldsPercentageRegex, "gis"), + value: "PerSpe" + }); + this.regexes = regexes; + } +} +exports.ChinesePercentageExtractor = ChinesePercentageExtractor; + +}); + +unwrapExports(extractors$12); + +var extractors$14 = createCommonjsModule(function (module, exports) { +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); + + + + +var JapaneseNumberExtractorMode; +(function (JapaneseNumberExtractorMode) { + // Number extraction with an allow list that filters what numbers to extract. + JapaneseNumberExtractorMode[JapaneseNumberExtractorMode["Default"] = 0] = "Default"; + // Extract all number-related terms aggressively. + JapaneseNumberExtractorMode[JapaneseNumberExtractorMode["ExtractAll"] = 1] = "ExtractAll"; +})(JapaneseNumberExtractorMode = exports.JapaneseNumberExtractorMode || (exports.JapaneseNumberExtractorMode = {})); +class JapaneseNumberExtractor extends extractors$4.BaseNumberExtractor { + constructor(mode = JapaneseNumberExtractorMode.Default) { + super(); + this.extractType = constants.Constants.SYS_NUM; + let regexes = new Array(); + // Add Cardinal + let cardExtract = new JapaneseCardinalExtractor(mode); + cardExtract.regexes.forEach(r => regexes.push(r)); + // Add Fraction + let fracExtract = new JapaneseFractionExtractor(); + fracExtract.regexes.forEach(r => regexes.push(r)); + this.regexes = regexes; + } +} +exports.JapaneseNumberExtractor = JapaneseNumberExtractor; +class JapaneseCardinalExtractor extends extractors$4.BaseNumberExtractor { + constructor(mode = JapaneseNumberExtractorMode.Default) { + super(); + this.extractType = constants.Constants.SYS_NUM_CARDINAL; + let regexes = new Array(); + // Add Integer Regexes + let intExtract = new JapaneseIntegerExtractor(mode); + intExtract.regexes.forEach(r => regexes.push(r)); + // Add Double Regexes + let doubleExtract = new JapaneseDoubleExtractor(); + doubleExtract.regexes.forEach(r => regexes.push(r)); + this.regexes = regexes; + } +} +exports.JapaneseCardinalExtractor = JapaneseCardinalExtractor; +class JapaneseIntegerExtractor extends extractors$4.BaseNumberExtractor { + constructor(mode = JapaneseNumberExtractorMode.Default) { + super(); + this.extractType = constants.Constants.SYS_NUM_INTEGER; + let regexes = new Array({ + regExp: recognizersText.RegExpUtility.getSafeRegExp(japaneseNumeric.JapaneseNumeric.NumbersSpecialsChars, "gi"), + value: "IntegerNum" + }, { + regExp: recognizersText.RegExpUtility.getSafeRegExp(japaneseNumeric.JapaneseNumeric.NumbersSpecialsCharsWithSuffix, "gi"), + value: "IntegerNum" + }, { + regExp: recognizersText.RegExpUtility.getSafeRegExp(japaneseNumeric.JapaneseNumeric.DottedNumbersSpecialsChar, "gi"), + value: "IntegerNum" + }, { + regExp: recognizersText.RegExpUtility.getSafeRegExp(japaneseNumeric.JapaneseNumeric.NumbersWithHalfDozen, "gi"), + value: "IntegerJpn" + }, { + regExp: recognizersText.RegExpUtility.getSafeRegExp(japaneseNumeric.JapaneseNumeric.NumbersWithDozen, "gi"), + value: "IntegerJpn" + }); + switch (mode) { + case JapaneseNumberExtractorMode.Default: + regexes.push({ + regExp: recognizersText.RegExpUtility.getSafeRegExp(japaneseNumeric.JapaneseNumeric.NumbersWithAllowListRegex, "gi"), + value: "IntegerJpn" + }); + break; + case JapaneseNumberExtractorMode.ExtractAll: + regexes.push({ + regExp: recognizersText.RegExpUtility.getSafeRegExp(japaneseNumeric.JapaneseNumeric.NumbersAggressiveRegex, "gi"), + value: "IntegerJpn" + }); + break; + } + this.regexes = regexes; + } +} +exports.JapaneseIntegerExtractor = JapaneseIntegerExtractor; +class JapaneseDoubleExtractor extends extractors$4.BaseNumberExtractor { + constructor() { + super(); + this.extractType = constants.Constants.SYS_NUM_DOUBLE; + let regexes = new Array({ + regExp: recognizersText.RegExpUtility.getSafeRegExp(japaneseNumeric.JapaneseNumeric.DoubleSpecialsChars, "gis"), + value: "DoubleNum" + }, { + regExp: recognizersText.RegExpUtility.getSafeRegExp(japaneseNumeric.JapaneseNumeric.DoubleSpecialsCharsWithNegatives, "gis"), + value: "DoubleNum" + }, { + regExp: recognizersText.RegExpUtility.getSafeRegExp(japaneseNumeric.JapaneseNumeric.SimpleDoubleSpecialsChars, "gis"), + value: "DoubleNum" + }, { + regExp: recognizersText.RegExpUtility.getSafeRegExp(japaneseNumeric.JapaneseNumeric.DoubleWithMultiplierRegex, "gis"), + value: "DoubleNum" + }, { + regExp: recognizersText.RegExpUtility.getSafeRegExp(japaneseNumeric.JapaneseNumeric.DoubleWithThousandsRegex, "gis"), + value: "DoubleJpn" + }, { + regExp: recognizersText.RegExpUtility.getSafeRegExp(japaneseNumeric.JapaneseNumeric.DoubleExponentialNotationRegex, "gis"), + value: "DoublePow" + }, { + regExp: recognizersText.RegExpUtility.getSafeRegExp(japaneseNumeric.JapaneseNumeric.DoubleScientificNotationRegex, "gis"), + value: "DoublePow" + }); + this.regexes = regexes; + } +} +exports.JapaneseDoubleExtractor = JapaneseDoubleExtractor; +class JapaneseFractionExtractor extends extractors$4.BaseNumberExtractor { + constructor() { + super(); + this.extractType = constants.Constants.SYS_NUM_FRACTION; + let regexes = new Array({ + regExp: recognizersText.RegExpUtility.getSafeRegExp(japaneseNumeric.JapaneseNumeric.FractionNotationSpecialsCharsRegex, "gis"), + value: "FracNum" + }, { + regExp: recognizersText.RegExpUtility.getSafeRegExp(japaneseNumeric.JapaneseNumeric.FractionNotationRegex, "gis"), + value: "FracNum" + }, { + regExp: recognizersText.RegExpUtility.getSafeRegExp(japaneseNumeric.JapaneseNumeric.AllFractionNumber, "gis"), + value: "FracJpn" + }); + this.regexes = regexes; + } +} +exports.JapaneseFractionExtractor = JapaneseFractionExtractor; +class JapaneseOrdinalExtractor extends extractors$4.BaseNumberExtractor { + constructor() { + super(); + this.extractType = constants.Constants.SYS_NUM_ORDINAL; + let regexes = new Array({ + regExp: recognizersText.RegExpUtility.getSafeRegExp(japaneseNumeric.JapaneseNumeric.OrdinalRegex, "gi"), + value: "OrdinalJpn" + }, { + regExp: recognizersText.RegExpUtility.getSafeRegExp(japaneseNumeric.JapaneseNumeric.OrdinalNumbersRegex, "gi"), + value: "OrdinalJpn" + }, { + regExp: recognizersText.RegExpUtility.getSafeRegExp(japaneseNumeric.JapaneseNumeric.NumbersFoldsPercentageRegex, "gi"), + value: "OrdinalJpn" + }); + this.regexes = regexes; + } +} +exports.JapaneseOrdinalExtractor = JapaneseOrdinalExtractor; +class JapanesePercentageExtractor extends extractors$4.BaseNumberExtractor { + constructor() { + super(); + this.extractType = constants.Constants.SYS_NUM_PERCENTAGE; + let regexes = new Array({ + regExp: recognizersText.RegExpUtility.getSafeRegExp(japaneseNumeric.JapaneseNumeric.SimplePercentageRegex, "gi"), + value: "PerJpn" + }, { + regExp: recognizersText.RegExpUtility.getSafeRegExp(japaneseNumeric.JapaneseNumeric.NumbersPercentagePointRegex, "gis"), + value: "PerNum" + }, { + regExp: recognizersText.RegExpUtility.getSafeRegExp(japaneseNumeric.JapaneseNumeric.NumbersPercentageWithSeparatorRegex, "gis"), + value: "PerNum" + }, { + regExp: recognizersText.RegExpUtility.getSafeRegExp(japaneseNumeric.JapaneseNumeric.NumbersPercentageWithMultiplierRegex, "gi"), + value: "PerNum" + }, { + regExp: recognizersText.RegExpUtility.getSafeRegExp(japaneseNumeric.JapaneseNumeric.SimpleNumbersPercentageWithMultiplierRegex, "gi"), + value: "PerNum" + }, { + regExp: recognizersText.RegExpUtility.getSafeRegExp(japaneseNumeric.JapaneseNumeric.SimpleIntegerPercentageRegex, "gis"), + value: "PerNum" + }, { + regExp: recognizersText.RegExpUtility.getSafeRegExp(japaneseNumeric.JapaneseNumeric.NumbersFoldsPercentageRegex, "gis"), + value: "PerSpe" + }, { + regExp: recognizersText.RegExpUtility.getSafeRegExp(japaneseNumeric.JapaneseNumeric.FoldsPercentageRegex, "gis"), + value: "PerSpe" + }, { + regExp: recognizersText.RegExpUtility.getSafeRegExp(japaneseNumeric.JapaneseNumeric.SimpleFoldsPercentageRegex, "gis"), + value: "PerSpe" + }, { + regExp: recognizersText.RegExpUtility.getSafeRegExp(japaneseNumeric.JapaneseNumeric.SpecialsPercentageRegex, "gis"), + value: "PerSpe" + }, { + regExp: recognizersText.RegExpUtility.getSafeRegExp(japaneseNumeric.JapaneseNumeric.NumbersSpecialsPercentageRegex, "gis"), + value: "PerSpe" + }, { + regExp: recognizersText.RegExpUtility.getSafeRegExp(japaneseNumeric.JapaneseNumeric.SimpleSpecialsPercentageRegex, "gis"), + value: "PerSpe" + }, { + regExp: recognizersText.RegExpUtility.getSafeRegExp(japaneseNumeric.JapaneseNumeric.SpecialsFoldsPercentageRegex, "gis"), + value: "PerSpe" + }); + this.regexes = regexes; + } +} +exports.JapanesePercentageExtractor = JapanesePercentageExtractor; + +}); + +unwrapExports(extractors$14); + +var numberRecognizer = createCommonjsModule(function (module, exports) { +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); + + + + + + + + + + + + + + + + +var NumberOptions; +(function (NumberOptions) { + NumberOptions[NumberOptions["None"] = 0] = "None"; +})(NumberOptions = exports.NumberOptions || (exports.NumberOptions = {})); +function recognizeNumber(query, culture, options = NumberOptions.None, fallbackToDefaultCulture = true) { + return recognizeByModel(recognizer => recognizer.getNumberModel(culture, fallbackToDefaultCulture), query, culture, options); +} +exports.recognizeNumber = recognizeNumber; +function recognizeOrdinal(query, culture, options = NumberOptions.None, fallbackToDefaultCulture = true) { + return recognizeByModel(recognizer => recognizer.getOrdinalModel(culture, fallbackToDefaultCulture), query, culture, options); +} +exports.recognizeOrdinal = recognizeOrdinal; +function recognizePercentage(query, culture, options = NumberOptions.None, fallbackToDefaultCulture = true) { + return recognizeByModel(recognizer => recognizer.getPercentageModel(culture, fallbackToDefaultCulture), query, culture, options); +} +exports.recognizePercentage = recognizePercentage; +function recognizeByModel(getModelFunc, query, culture, options) { + let recognizer = new NumberRecognizer(culture, options); + let model = getModelFunc(recognizer); + return model.parse(query); +} +class NumberRecognizer extends recognizersText.Recognizer { + constructor(culture, options = NumberOptions.None, lazyInitialization = false) { + super(culture, options, lazyInitialization); + } + InitializeConfiguration() { + //#region English + this.registerModel("NumberModel", culture$2.Culture.English, (options) => new models$2.NumberModel(agnosticNumberParser.AgnosticNumberParserFactory.getParser(agnosticNumberParser.AgnosticNumberParserType.Number, new parserConfiguration.EnglishNumberParserConfiguration()), new extractors$2.EnglishNumberExtractor(models$2.NumberMode.PureNumber))); + this.registerModel("OrdinalModel", culture$2.Culture.English, (options) => new models$2.OrdinalModel(agnosticNumberParser.AgnosticNumberParserFactory.getParser(agnosticNumberParser.AgnosticNumberParserType.Ordinal, new parserConfiguration.EnglishNumberParserConfiguration()), new extractors$2.EnglishOrdinalExtractor())); + this.registerModel("PercentModel", culture$2.Culture.English, (options) => new models$2.PercentModel(agnosticNumberParser.AgnosticNumberParserFactory.getParser(agnosticNumberParser.AgnosticNumberParserType.Percentage, new parserConfiguration.EnglishNumberParserConfiguration()), new extractors$2.EnglishPercentageExtractor())); + //#endregion + //#region Spanish + this.registerModel("NumberModel", culture$2.Culture.Spanish, (options) => new models$2.NumberModel(agnosticNumberParser.AgnosticNumberParserFactory.getParser(agnosticNumberParser.AgnosticNumberParserType.Number, new parserConfiguration$2.SpanishNumberParserConfiguration()), new extractors$6.SpanishNumberExtractor(models$2.NumberMode.PureNumber))); + this.registerModel("OrdinalModel", culture$2.Culture.Spanish, (options) => new models$2.OrdinalModel(agnosticNumberParser.AgnosticNumberParserFactory.getParser(agnosticNumberParser.AgnosticNumberParserType.Ordinal, new parserConfiguration$2.SpanishNumberParserConfiguration()), new extractors$6.SpanishOrdinalExtractor())); + this.registerModel("PercentModel", culture$2.Culture.Spanish, (options) => new models$2.PercentModel(agnosticNumberParser.AgnosticNumberParserFactory.getParser(agnosticNumberParser.AgnosticNumberParserType.Percentage, new parserConfiguration$2.SpanishNumberParserConfiguration()), new extractors$6.SpanishPercentageExtractor())); + //#endregion + //#region Portuguese + this.registerModel("NumberModel", culture$2.Culture.Portuguese, (options) => new models$2.NumberModel(agnosticNumberParser.AgnosticNumberParserFactory.getParser(agnosticNumberParser.AgnosticNumberParserType.Number, new parserConfiguration$4.PortugueseNumberParserConfiguration()), new extractors$8.PortugueseNumberExtractor(models$2.NumberMode.PureNumber))); + this.registerModel("OrdinalModel", culture$2.Culture.Portuguese, (options) => new models$2.OrdinalModel(agnosticNumberParser.AgnosticNumberParserFactory.getParser(agnosticNumberParser.AgnosticNumberParserType.Ordinal, new parserConfiguration$4.PortugueseNumberParserConfiguration()), new extractors$8.PortugueseOrdinalExtractor())); + this.registerModel("PercentModel", culture$2.Culture.Portuguese, (options) => new models$2.PercentModel(agnosticNumberParser.AgnosticNumberParserFactory.getParser(agnosticNumberParser.AgnosticNumberParserType.Percentage, new parserConfiguration$4.PortugueseNumberParserConfiguration()), new extractors$8.PortuguesePercentageExtractor())); + //#endregion + //#region Chinese + this.registerModel("NumberModel", culture$2.Culture.Chinese, (options) => new models$2.NumberModel(agnosticNumberParser.AgnosticNumberParserFactory.getParser(agnosticNumberParser.AgnosticNumberParserType.Number, new parserConfiguration$8.ChineseNumberParserConfiguration()), new extractors$12.ChineseNumberExtractor())); + this.registerModel("OrdinalModel", culture$2.Culture.Chinese, (options) => new models$2.OrdinalModel(agnosticNumberParser.AgnosticNumberParserFactory.getParser(agnosticNumberParser.AgnosticNumberParserType.Ordinal, new parserConfiguration$8.ChineseNumberParserConfiguration()), new extractors$12.ChineseOrdinalExtractor())); + this.registerModel("PercentModel", culture$2.Culture.Chinese, (options) => new models$2.PercentModel(agnosticNumberParser.AgnosticNumberParserFactory.getParser(agnosticNumberParser.AgnosticNumberParserType.Percentage, new parserConfiguration$8.ChineseNumberParserConfiguration()), new extractors$12.ChinesePercentageExtractor())); + //#endregion + //#region Japanese + this.registerModel("NumberModel", culture$2.Culture.Japanese, (options) => new models$2.NumberModel(agnosticNumberParser.AgnosticNumberParserFactory.getParser(agnosticNumberParser.AgnosticNumberParserType.Number, new parserConfiguration$10.JapaneseNumberParserConfiguration()), new extractors$14.JapaneseNumberExtractor())); + this.registerModel("OrdinalModel", culture$2.Culture.Japanese, (options) => new models$2.OrdinalModel(agnosticNumberParser.AgnosticNumberParserFactory.getParser(agnosticNumberParser.AgnosticNumberParserType.Ordinal, new parserConfiguration$10.JapaneseNumberParserConfiguration()), new extractors$14.JapaneseOrdinalExtractor())); + this.registerModel("PercentModel", culture$2.Culture.Japanese, (options) => new models$2.PercentModel(agnosticNumberParser.AgnosticNumberParserFactory.getParser(agnosticNumberParser.AgnosticNumberParserType.Percentage, new parserConfiguration$10.JapaneseNumberParserConfiguration()), new extractors$14.JapanesePercentageExtractor())); + //#endregion + //#region French + this.registerModel("NumberModel", culture$2.Culture.French, (options) => new models$2.NumberModel(agnosticNumberParser.AgnosticNumberParserFactory.getParser(agnosticNumberParser.AgnosticNumberParserType.Number, new parserConfiguration$6.FrenchNumberParserConfiguration()), new extractors$10.FrenchNumberExtractor(models$2.NumberMode.PureNumber))); + this.registerModel("OrdinalModel", culture$2.Culture.French, (options) => new models$2.OrdinalModel(agnosticNumberParser.AgnosticNumberParserFactory.getParser(agnosticNumberParser.AgnosticNumberParserType.Ordinal, new parserConfiguration$6.FrenchNumberParserConfiguration()), new extractors$10.FrenchOrdinalExtractor())); + this.registerModel("PercentModel", culture$2.Culture.French, (options) => new models$2.PercentModel(agnosticNumberParser.AgnosticNumberParserFactory.getParser(agnosticNumberParser.AgnosticNumberParserType.Percentage, new parserConfiguration$6.FrenchNumberParserConfiguration()), new extractors$10.FrenchPercentageExtractor())); + //#endregion + } + IsValidOptions(options) { + return options >= 0 && options <= NumberOptions.None; + } + getNumberModel(culture = null, fallbackToDefaultCulture = true) { + return this.getModel("NumberModel", culture, fallbackToDefaultCulture); + } + getOrdinalModel(culture = null, fallbackToDefaultCulture = true) { + return this.getModel("OrdinalModel", culture, fallbackToDefaultCulture); + } + getPercentageModel(culture = null, fallbackToDefaultCulture = true) { + return this.getModel("PercentModel", culture, fallbackToDefaultCulture); + } +} +exports.default = NumberRecognizer; + +}); + +unwrapExports(numberRecognizer); + +var recognizersTextNumber = createCommonjsModule(function (module, exports) { +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); + +exports.NumberRecognizer = numberRecognizer.default; +exports.NumberOptions = numberRecognizer.NumberOptions; +exports.recognizeNumber = numberRecognizer.recognizeNumber; +exports.recognizeOrdinal = numberRecognizer.recognizeOrdinal; +exports.recognizePercentage = numberRecognizer.recognizePercentage; + +exports.Culture = culture$2.Culture; +exports.CultureInfo = culture$2.CultureInfo; + +exports.FormatUtility = recognizersText.FormatUtility; +exports.StringUtility = recognizersText.StringUtility; +exports.Match = recognizersText.Match; +exports.RegExpUtility = recognizersText.RegExpUtility; + +exports.BaseNumbers = baseNumbers.BaseNumbers; + +exports.EnglishNumeric = englishNumeric.EnglishNumeric; + +exports.SpanishNumeric = spanishNumeric.SpanishNumeric; + +exports.FrenchNumeric = frenchNumeric.FrenchNumeric; + +exports.ChineseNumeric = chineseNumeric.ChineseNumeric; + +exports.JapaneseNumeric = japaneseNumeric.JapaneseNumeric; + +exports.Constants = constants.Constants; + +exports.BaseNumberExtractor = extractors$4.BaseNumberExtractor; +exports.BasePercentageExtractor = extractors$4.BasePercentageExtractor; + +exports.NumberMode = models$2.NumberMode; +exports.LongFormatType = models$2.LongFormatType; +exports.AbstractNumberModel = models$2.AbstractNumberModel; +exports.NumberModel = models$2.NumberModel; +exports.OrdinalModel = models$2.OrdinalModel; +exports.PercentModel = models$2.PercentModel; + +exports.AgnosticNumberParserType = agnosticNumberParser.AgnosticNumberParserType; +exports.AgnosticNumberParserFactory = agnosticNumberParser.AgnosticNumberParserFactory; + +exports.BaseNumberParser = parsers$2.BaseNumberParser; +exports.BasePercentageParser = parsers$2.BasePercentageParser; + +exports.EnglishCardinalExtractor = extractors$2.EnglishCardinalExtractor; +exports.EnglishDoubleExtractor = extractors$2.EnglishDoubleExtractor; +exports.EnglishFractionExtractor = extractors$2.EnglishFractionExtractor; +exports.EnglishIntegerExtractor = extractors$2.EnglishIntegerExtractor; +exports.EnglishNumberExtractor = extractors$2.EnglishNumberExtractor; +exports.EnglishOrdinalExtractor = extractors$2.EnglishOrdinalExtractor; +exports.EnglishPercentageExtractor = extractors$2.EnglishPercentageExtractor; + +exports.EnglishNumberParserConfiguration = parserConfiguration.EnglishNumberParserConfiguration; + +exports.SpanishCardinalExtractor = extractors$6.SpanishCardinalExtractor; +exports.SpanishDoubleExtractor = extractors$6.SpanishDoubleExtractor; +exports.SpanishFractionExtractor = extractors$6.SpanishFractionExtractor; +exports.SpanishIntegerExtractor = extractors$6.SpanishIntegerExtractor; +exports.SpanishNumberExtractor = extractors$6.SpanishNumberExtractor; +exports.SpanishOrdinalExtractor = extractors$6.SpanishOrdinalExtractor; +exports.SpanishPercentageExtractor = extractors$6.SpanishPercentageExtractor; + +exports.SpanishNumberParserConfiguration = parserConfiguration$2.SpanishNumberParserConfiguration; + +exports.PortugueseCardinalExtractor = extractors$8.PortugueseCardinalExtractor; +exports.PortugueseDoubleExtractor = extractors$8.PortugueseDoubleExtractor; +exports.PortugueseFractionExtractor = extractors$8.PortugueseFractionExtractor; +exports.PortugueseIntegerExtractor = extractors$8.PortugueseIntegerExtractor; +exports.PortugueseNumberExtractor = extractors$8.PortugueseNumberExtractor; +exports.PortugueseOrdinalExtractor = extractors$8.PortugueseOrdinalExtractor; +exports.PortuguesePercentageExtractor = extractors$8.PortuguesePercentageExtractor; + +exports.PortugueseNumberParserConfiguration = parserConfiguration$4.PortugueseNumberParserConfiguration; + +exports.FrenchCardinalExtractor = extractors$10.FrenchCardinalExtractor; +exports.FrenchDoubleExtractor = extractors$10.FrenchDoubleExtractor; +exports.FrenchFractionExtractor = extractors$10.FrenchFractionExtractor; +exports.FrenchIntegerExtractor = extractors$10.FrenchIntegerExtractor; +exports.FrenchNumberExtractor = extractors$10.FrenchNumberExtractor; +exports.FrenchOrdinalExtractor = extractors$10.FrenchOrdinalExtractor; +exports.FrenchPercentageExtractor = extractors$10.FrenchPercentageExtractor; + +exports.FrenchNumberParserConfiguration = parserConfiguration$6.FrenchNumberParserConfiguration; + +exports.ChineseCardinalExtractor = extractors$12.ChineseCardinalExtractor; +exports.ChineseDoubleExtractor = extractors$12.ChineseDoubleExtractor; +exports.ChineseFractionExtractor = extractors$12.ChineseFractionExtractor; +exports.ChineseIntegerExtractor = extractors$12.ChineseIntegerExtractor; +exports.ChineseNumberExtractor = extractors$12.ChineseNumberExtractor; +exports.ChineseOrdinalExtractor = extractors$12.ChineseOrdinalExtractor; +exports.ChinesePercentageExtractor = extractors$12.ChinesePercentageExtractor; +exports.ChineseNumberExtractorMode = extractors$12.ChineseNumberExtractorMode; + +exports.ChineseNumberParserConfiguration = parserConfiguration$8.ChineseNumberParserConfiguration; + +exports.JapaneseCardinalExtractor = extractors$14.JapaneseCardinalExtractor; +exports.JapaneseDoubleExtractor = extractors$14.JapaneseDoubleExtractor; +exports.JapaneseFractionExtractor = extractors$14.JapaneseFractionExtractor; +exports.JapaneseIntegerExtractor = extractors$14.JapaneseIntegerExtractor; +exports.JapaneseNumberExtractor = extractors$14.JapaneseNumberExtractor; +exports.JapaneseOrdinalExtractor = extractors$14.JapaneseOrdinalExtractor; +exports.JapanesePercentageExtractor = extractors$14.JapanesePercentageExtractor; +exports.JapaneseNumberExtractorMode = extractors$14.JapaneseNumberExtractorMode; + +exports.JapaneseNumberParserConfiguration = parserConfiguration$10.JapaneseNumberParserConfiguration; + +}); + +unwrapExports(recognizersTextNumber); + +var models$4 = createCommonjsModule(function (module, exports) { +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); + +var CompositeEntityType; +(function (CompositeEntityType) { + CompositeEntityType[CompositeEntityType["Age"] = 0] = "Age"; + CompositeEntityType[CompositeEntityType["Currency"] = 1] = "Currency"; + CompositeEntityType[CompositeEntityType["Dimension"] = 2] = "Dimension"; + CompositeEntityType[CompositeEntityType["Temperature"] = 3] = "Temperature"; +})(CompositeEntityType = exports.CompositeEntityType || (exports.CompositeEntityType = {})); +class AbstractNumberWithUnitModel { + constructor(extractorParsersMap) { + this.extractorParsersMap = extractorParsersMap; + } + parse(query) { + query = recognizersText.FormatUtility.preProcess(query, false); + let extractionResults = new Array(); + for (let kv of this.extractorParsersMap.entries()) { + let extractor = kv[0]; + let parser = kv[1]; + let extractResults = extractor.extract(query); + let parseResults = []; + for (let i = 0; i < extractResults.length; i++) { + let r = parser.parse(extractResults[i]); + if (r.value !== null) { + if (r.value instanceof Array) { + for (let j = 0; j < r.value.length; j++) { + parseResults.push(r.value[j]); + } + } + else { + parseResults.push(r); + } + } + } + let modelResults = parseResults.map(o => ({ + start: o.start, + end: o.start + o.length - 1, + resolution: this.getResolution(o.value), + text: o.text, + typeName: this.modelTypeName + })); + modelResults.forEach(result => { + let bAdd = true; + extractionResults.forEach(extractionResult => { + if (extractionResult.start === result.start && extractionResult.end === result.end) { + bAdd = false; + } + }); + if (bAdd) { + extractionResults.push(result); + } + }); + } + return extractionResults; + } + getResolution(data) { + if (typeof data === 'undefined') + return null; + let result = typeof data === "string" + ? { value: data.toString() } + : { value: data.number, unit: data.unit }; + if (data.isoCurrency) { + result['isoCurrency'] = data.isoCurrency; + } + return result; + } +} +exports.AbstractNumberWithUnitModel = AbstractNumberWithUnitModel; +class AgeModel extends AbstractNumberWithUnitModel { + constructor() { + super(...arguments); + this.modelTypeName = "age"; + } +} +exports.AgeModel = AgeModel; +class CurrencyModel extends AbstractNumberWithUnitModel { + constructor() { + super(...arguments); + this.modelTypeName = "currency"; + } +} +exports.CurrencyModel = CurrencyModel; +class DimensionModel extends AbstractNumberWithUnitModel { + constructor() { + super(...arguments); + this.modelTypeName = "dimension"; + } +} +exports.DimensionModel = DimensionModel; +class TemperatureModel extends AbstractNumberWithUnitModel { + constructor() { + super(...arguments); + this.modelTypeName = "temperature"; + } +} +exports.TemperatureModel = TemperatureModel; + +}); + +unwrapExports(models$4); + +var baseUnits = createCommonjsModule(function (module, exports) { +"use strict"; +// ------------------------------------------------------------------------------ +// +// This code was generated by a tool. +// Changes to this file may cause incorrect behavior and will be lost if +// the code is regenerated. +// +// ------------------------------------------------------------------------------ +Object.defineProperty(exports, "__esModule", { value: true }); +var BaseUnits; +(function (BaseUnits) { + BaseUnits.HourRegex = `(?00|01|02|03|04|05|06|07|08|09|0|10|11|12|13|14|15|16|17|18|19|20|21|22|23|24|1|2|3|4|5|6|7|8|9)(h)?`; + BaseUnits.MinuteRegex = `(?00|01|02|03|04|05|06|07|08|09|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|0|1|2|3|4|5|6|7|8|9)(?!\\d)`; + BaseUnits.SecondRegex = `(?00|01|02|03|04|05|06|07|08|09|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|0|1|2|3|4|5|6|7|8|9)`; + BaseUnits.PmNonUnitRegex = `(${BaseUnits.HourRegex}\\s*:\\s*${BaseUnits.MinuteRegex}(\\s*:\\s*${BaseUnits.SecondRegex})?\\s*pm)`; + BaseUnits.AmbiguousTimeTerm = 'pm'; +})(BaseUnits = exports.BaseUnits || (exports.BaseUnits = {})); + +}); + +unwrapExports(baseUnits); + +var constants$2 = createCommonjsModule(function (module, exports) { +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); + +class Constants { +} +Constants.SYS_UNIT = "builtin.unit"; +Constants.SYS_UNIT_DIMENSION = "builtin.unit.dimension"; +Constants.SYS_UNIT_AGE = "builtin.unit.age"; +Constants.SYS_UNIT_AREA = "builtin.unit.area"; +Constants.SYS_UNIT_CURRENCY = "builtin.unit.currency"; +Constants.SYS_UNIT_LENGTH = "builtin.unit.length"; +Constants.SYS_UNIT_SPEED = "builtin.unit.speed"; +Constants.SYS_UNIT_TEMPERATURE = "builtin.unit.temperature"; +Constants.SYS_UNIT_VOLUME = "builtin.unit.volume"; +Constants.SYS_UNIT_WEIGHT = "builtin.unit.weight"; +Constants.SYS_NUM = "builtin.num"; +// For cases like '2:00 pm', both 'pm' and '00 pm' are not dimension +Constants.AMBIGUOUS_TIME_TERM = baseUnits.BaseUnits.AmbiguousTimeTerm; +// For currencies without ISO codes, we use internal values prefixed by '_'. +// These values should never be present in parse output. +Constants.FAKE_ISO_CODE_PREFIX = "_"; +exports.Constants = Constants; + +}); + +unwrapExports(constants$2); + +/** + * lodash (Custom Build) + * Build: `lodash modularize exports="npm" -o ./` + * Copyright jQuery Foundation and other contributors + * Released under MIT license + * Based on Underscore.js 1.8.3 + * Copyright Jeremy Ashkenas, DocumentCloud and Investigative Reporters & Editors + */ + +/** `Object#toString` result references. */ +var symbolTag$2 = '[object Symbol]'; + +/** Used for built-in method references. */ +var objectProto$2 = Object.prototype; + +/** + * Used to resolve the + * [`toStringTag`](http://ecma-international.org/ecma-262/6.0/#sec-object.prototype.tostring) + * of values. + */ +var objectToString$2 = objectProto$2.toString; + +/** + * The base implementation of methods like `_.max` and `_.min` which accepts a + * `comparator` to determine the extremum value. + * + * @private + * @param {Array} array The array to iterate over. + * @param {Function} iteratee The iteratee invoked per iteration. + * @param {Function} comparator The comparator used to compare values. + * @returns {*} Returns the extremum value. + */ +function baseExtremum(array, iteratee, comparator) { + var index = -1, + length = array.length; + + while (++index < length) { + var value = array[index], + current = iteratee(value); + + if (current != null && (computed === undefined + ? (current === current && !isSymbol$2(current)) + : comparator(current, computed) + )) { + var computed = current, + result = value; + } + } + return result; +} + +/** + * The base implementation of `_.gt` which doesn't coerce arguments to numbers. + * + * @private + * @param {*} value The value to compare. + * @param {*} other The other value to compare. + * @returns {boolean} Returns `true` if `value` is greater than `other`, + * else `false`. + */ +function baseGt(value, other) { + return value > other; +} + +/** + * Checks if `value` is object-like. A value is object-like if it's not `null` + * and has a `typeof` result of "object". + * + * @static + * @memberOf _ + * @since 4.0.0 + * @category Lang + * @param {*} value The value to check. + * @returns {boolean} Returns `true` if `value` is object-like, else `false`. + * @example + * + * _.isObjectLike({}); + * // => true + * + * _.isObjectLike([1, 2, 3]); + * // => true + * + * _.isObjectLike(_.noop); + * // => false + * + * _.isObjectLike(null); + * // => false + */ +function isObjectLike$2(value) { + return !!value && typeof value == 'object'; +} + +/** + * Checks if `value` is classified as a `Symbol` primitive or object. + * + * @static + * @memberOf _ + * @since 4.0.0 + * @category Lang + * @param {*} value The value to check. + * @returns {boolean} Returns `true` if `value` is correctly classified, + * else `false`. + * @example + * + * _.isSymbol(Symbol.iterator); + * // => true + * + * _.isSymbol('abc'); + * // => false + */ +function isSymbol$2(value) { + return typeof value == 'symbol' || + (isObjectLike$2(value) && objectToString$2.call(value) == symbolTag$2); +} + +/** + * This method returns the first argument given to it. + * + * @static + * @since 0.1.0 + * @memberOf _ + * @category Util + * @param {*} value Any value. + * @returns {*} Returns `value`. + * @example + * + * var object = { 'user': 'fred' }; + * + * _.identity(object) === object; + * // => true + */ +function identity(value) { + return value; +} + +/** + * Computes the maximum value of `array`. If `array` is empty or falsey, + * `undefined` is returned. + * + * @static + * @since 0.1.0 + * @memberOf _ + * @category Math + * @param {Array} array The array to iterate over. + * @returns {*} Returns the maximum value. + * @example + * + * _.max([4, 2, 8, 6]); + * // => 8 + * + * _.max([]); + * // => undefined + */ +function max(array) { + return (array && array.length) + ? baseExtremum(array, identity, baseGt) + : undefined; +} + +var lodash_max = max; + +var extractors$16 = createCommonjsModule(function (module, exports) { +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); + + + + + +class NumberWithUnitExtractor { + constructor(config) { + this.config = config; + if (this.config.suffixList && this.config.suffixList.size > 0) { + this.suffixRegexes = this.buildRegexFromSet(Array.from(this.config.suffixList.values())); + } + else { + this.suffixRegexes = new Set(); // empty + } + if (this.config.prefixList && this.config.prefixList.size > 0) { + let maxLength = 0; + this.config.prefixList.forEach(preMatch => { + let len = lodash_max(preMatch.split('|').filter(s => s && s.length).map(s => s.length)); + maxLength = maxLength >= len ? maxLength : len; + }); + // 2 is the maxium length of spaces. + this.maxPrefixMatchLen = maxLength + 2; + this.prefixRegexes = this.buildRegexFromSet(Array.from(this.config.prefixList.values())); + } + else { + this.prefixRegexes = new Set(); // empty + } + this.separateRegex = this.buildSeparateRegexFromSet(); + } + extract(source) { + if (!this.preCheckStr(source)) { + return new Array(); + } + let mappingPrefix = new Map(); + let matched = new Array(source.length); + let numbers = this.config.unitNumExtractor.extract(source); + let result = new Array(); + let sourceLen = source.length; + /* Mix prefix and numbers, make up a prefix-number combination */ + if (this.maxPrefixMatchLen !== 0) { + numbers.forEach(num => { + if (num.start === undefined || num.length === undefined) { + return; + } + let maxFindPref = Math.min(this.maxPrefixMatchLen, num.start); + if (maxFindPref === 0) { + return; + } + /* Scan from left to right , find the longest match */ + let leftStr = source.substring(num.start - maxFindPref, num.start - maxFindPref + maxFindPref); + + let lastIndex = leftStr.length; + let bestMatch = null; + this.prefixRegexes.forEach(regex => { + let collection = recognizersText.RegExpUtility.getMatches(regex, leftStr).filter(m => m.length); + if (collection.length === 0) { + return; + } + collection.forEach(match => { + if (leftStr.substring(match.index, lastIndex).trim() === match.value) { + if (bestMatch === null || bestMatch.index >= match.index) { + bestMatch = match; + } + } + }); + }); + if (bestMatch !== null) { + let unitStr = leftStr.substring(bestMatch.index, lastIndex); + mappingPrefix.set(num.start, { + offset: lastIndex - bestMatch.index, + unitString: unitStr + }); + } + }); + } + for (let num of numbers) { + if (num.start === undefined || num.length === undefined) { + continue; + } + let start = num.start; + let length = num.length; + let maxFindLen = sourceLen - start - length; + let prefixUnit = mappingPrefix.has(start) ? mappingPrefix.get(start) : null; + if (maxFindLen > 0) { + let rightSub = source.substring(start + length, start + length + maxFindLen); + let unitMatch = Array.from(this.suffixRegexes.values()).map(r => recognizersText.RegExpUtility.getMatches(r, rightSub)) + .filter(m => m.length > 0); + let maxlen = 0; + for (let i = 0; i < unitMatch.length; i++) { + for (let m of unitMatch[i]) { + if (m.length > 0) { + let endpos = m.index + m.length; + if (m.index >= 0) { + let midStr = rightSub.substring(0, Math.min(m.index, rightSub.length)); + if (maxlen < endpos && (recognizersText.StringUtility.isNullOrWhitespace(midStr) || midStr.trim() === this.config.connectorToken)) { + maxlen = endpos; + } + } + } + } + } + if (maxlen !== 0) { + for (let i = 0; i < length + maxlen; i++) { + matched[i + start] = true; + } + let substr = source.substring(start, start + length + maxlen); + let er = { + start: start, + length: length + maxlen, + text: substr, + type: this.config.extractType + }; + if (prefixUnit !== null) { + er.start -= prefixUnit.offset; + er.length += prefixUnit.offset; + er.text = prefixUnit.unitString + er.text; + } + /* Relative position will be used in Parser */ + num.start = start - er.start; + er.data = num; + let isDimensionFallsInPmTime = false; + if (er.type === constants$2.Constants.SYS_UNIT_DIMENSION) { + let nonUnitMatch = recognizersText.RegExpUtility.getMatches(this.config.pmNonUnitRegex, source); + nonUnitMatch.forEach(match => { + if (er.start >= match.index && er.start + er.length <= match.index + match.length) { + isDimensionFallsInPmTime = true; + } + }); + } + if (isDimensionFallsInPmTime) { + continue; + } + result.push(er); + continue; + } + } + if (prefixUnit !== null) { + let er = { + start: num.start - prefixUnit.offset, + length: num.length + prefixUnit.offset, + text: prefixUnit.unitString + num.text, + type: this.config.extractType + }; + /* Relative position will be used in Parser */ + num.start = start - er.start; + er.data = num; + result.push(er); + } + } + // extract Separate unit + if (this.separateRegex !== null) { + this.extractSeparateUnits(source, result); + } + return result; + } + validateUnit(source) { + return source.substring(0, 1) !== '-'; + } + preCheckStr(str) { + return str && str.length; + } + extractSeparateUnits(source, numDependResults) { + // Default is false + let matchResult = new Array(source.length); + numDependResults.forEach(numDependResult => { + let start = numDependResult.start; + let i = 0; + do { + matchResult[start + i++] = true; + } while (i < numDependResult.length); + }); + // Extract all SeparateUnits, then merge it with numDependResults + let matchCollection = recognizersText.RegExpUtility.getMatches(this.separateRegex, source); + if (matchCollection.length > 0) { + matchCollection.forEach(match => { + let i = 0; + while (i < match.length && !matchResult[match.index + i]) { + i++; + } + if (i === match.length) { + // Mark as extracted + for (let j = 0; j < i; j++) { + matchResult[j] = true; + } + let isDimensionFallsInPmTime = false; + if (match.value === constants$2.Constants.AMBIGUOUS_TIME_TERM) { + let nonUnitMatch = recognizersText.RegExpUtility.getMatches(this.config.pmNonUnitRegex, source); + nonUnitMatch.forEach(time => { + if (this.isDimensionFallsInTime(match, time)) { + isDimensionFallsInPmTime = true; + } + }); + } + if (isDimensionFallsInPmTime === false) { + numDependResults.push({ + start: match.index, + length: match.length, + text: match.value, + type: this.config.extractType, + data: null + }); + } + } + }); + } + } + buildRegexFromSet(collection, ignoreCase = true) { + return new Set(collection.map(regexString => { + let regexTokens = regexString.split('|').map(lodash_escaperegexp); + let pattern = `${this.config.buildPrefix}(${regexTokens.join('|')})${this.config.buildSuffix}`; + let options = "gs"; + if (ignoreCase) + options += "i"; + return recognizersText.RegExpUtility.getSafeRegExp(pattern, options); + })); + } + buildSeparateRegexFromSet(ignoreCase = true) { + let separateWords = new Set(); + if (this.config.prefixList && this.config.prefixList.size) { + for (let addWord of this.config.prefixList.values()) { + addWord.split('|').filter(s => s && s.length) + .filter(this.validateUnit) + .forEach(word => separateWords.add(word)); + } + } + if (this.config.suffixList && this.config.suffixList.size) { + for (let addWord of this.config.suffixList.values()) { + addWord.split('|').filter(s => s && s.length) + .filter(this.validateUnit) + .forEach(word => separateWords.add(word)); + } + } + if (this.config.ambiguousUnitList && this.config.ambiguousUnitList.length) { + for (let abandonWord of this.config.ambiguousUnitList) { + if (separateWords.has(abandonWord)) { + separateWords.delete(abandonWord); + } + } + } + let regexTokens = Array.from(separateWords.values()).map(lodash_escaperegexp); + if (regexTokens.length === 0) { + return null; + } + // Sort SeparateWords using descending length. + regexTokens = regexTokens.sort(this.dinoComparer); + let pattern = `${this.config.buildPrefix}(${regexTokens.join('|')})${this.config.buildSuffix}`; + let options = "gs"; + if (ignoreCase) + options += "i"; + return recognizersText.RegExpUtility.getSafeRegExp(pattern, options); + } + dinoComparer(x, y) { + if (x === null) { + if (y === null) { + // If x is null and y is null, they're + // equal. + return 0; + } + else { + // If x is null and y is not null, y + // is greater. + return 1; + } + } + else { + // If x is not null... + // + if (y === null) + // ...and y is null, x is greater. + { + return -1; + } + else { + // ...and y is not null, compare the + // lengths of the two strings. + // + let retval = y.length - x.length; + if (retval !== 0) { + // If the strings are not of equal length, + // the longer string is greater. + // + return retval; + } + else { + // If the strings are of equal length, + // sort them with ordinary string comparison. + // + let xl = x.toLowerCase(); + let yl = y.toLowerCase(); + if (xl < yl) { + return -1; + } + if (xl > yl) { + return 1; + } + return 0; + } + } + } + } + isDimensionFallsInTime(dimension, time) { + let isSubMatch = false; + if (dimension.index >= time.index && dimension.index + dimension.length <= time.index + time.length) { + isSubMatch = true; + } + return isSubMatch; + } +} +exports.NumberWithUnitExtractor = NumberWithUnitExtractor; +class BaseMergedUnitExtractor { + constructor(config) { + this.config = config; + this.innerExtractor = new NumberWithUnitExtractor(config); + } + extract(source) { + let result = new Array(); + if (this.config.extractType === constants$2.Constants.SYS_UNIT_CURRENCY) { + result = this.mergeCompoundUnits(source); + } + else { + result = this.innerExtractor.extract(source); + } + return result; + } + mergeCompoundUnits(source) { + let result = new Array(); + let ers = this.innerExtractor.extract(source); + this.MergePureNumber(source, ers); + let groups = []; + groups[0] = 0; + for (let i = 0; i < ers.length - 1; i++) { + if (ers[i].type !== ers[i + 1].type && ers[i].type !== recognizersTextNumber.Constants.SYS_NUM && ers[i + 1].type !== recognizersTextNumber.Constants.SYS_NUM) { + continue; + } + if (ers[i].data != null && ers[i].data.data != null && !ers[i].data.data.startsWith('Integer')) { + groups[i + 1] = groups[i] + 1; + continue; + } + let middleBegin = ers[i].start + ers[i].length; + let middleEnd = ers[i + 1].start; + let middleStr = source.substring(middleBegin, middleEnd).trim().toLowerCase(); + // Separated by whitespace + if (recognizersText.StringUtility.isNullOrEmpty(middleStr)) { + groups[i + 1] = groups[i]; + continue; + } + // Separated by connectors + let match = recognizersText.RegExpUtility.getMatches(this.config.compoundUnitConnectorRegex, middleStr).pop(); + if (match && match.index === 0 && match.length === middleStr.length) { + groups[i + 1] = groups[i]; + } + else { + groups[i + 1] = groups[i] + 1; + } + } + for (let i = 0; i < ers.length; i++) { + if (i === 0 || groups[i] !== groups[i - 1]) { + let tmpInner = new recognizersText.ExtractResult(); + tmpInner.data = ers[i].data; + tmpInner.length = ers[i].length; + tmpInner.start = ers[i].start; + tmpInner.text = ers[i].text; + tmpInner.type = ers[i].type; + let tmpExtractResult = ers[i]; + tmpExtractResult.data = new Array(); + tmpExtractResult.data.push(tmpInner); + result.push(tmpExtractResult); + } + // Reduce extract results in same group + if (i + 1 < ers.length && groups[i + 1] === groups[i]) { + let group = groups[i]; + let periodBegin = result[group].start; + let periodEnd = ers[i + 1].start + ers[i + 1].length; + result[group].length = periodEnd - periodBegin; + result[group].text = source.substring(periodBegin, periodEnd); + result[group].type = constants$2.Constants.SYS_UNIT_CURRENCY; + result[group].data.push(ers[i + 1]); + } + } + for (let i = 0; i < result.length; i++) { + let innerData = result[i].data; + if (innerData && innerData.length === 1) { + result[i] = innerData[0]; + } + } + result = result.filter(er => er.type !== recognizersTextNumber.Constants.SYS_NUM); + return result; + } + MergePureNumber(source, result) { + let numErs = this.config.unitNumExtractor.extract(source); + let unitNumbers = new Array(); + let i; + let j; + for (i = 0, j = 0; i < numErs.length; i++) { + let hasBehindExtraction = false; + while (j < result.length && result[j].start + result[j].length < numErs[i].start) { + hasBehindExtraction = true; + j++; + } + if (!hasBehindExtraction) { + continue; + } + let middleBegin = result[j - 1].start + result[j - 1].length; + let middleEnd = numErs[i].start; + let middleStr = source.substring(middleBegin, middleEnd).trim().toLowerCase(); + // Separated by whitespace + if (recognizersText.StringUtility.isNullOrEmpty(middleStr)) { + unitNumbers.push(numErs[i]); + continue; + } + // Separated by connectors + let match = recognizersText.RegExpUtility.getMatches(this.config.compoundUnitConnectorRegex, middleStr).pop(); + if (match && match.index === 0 && match.length === middleStr.length) { + unitNumbers.push(numErs[i]); + } + } + unitNumbers.forEach(extractResult => { + let overlap = false; + result.forEach(er => { + if (er.start <= extractResult.start && er.start + er.length >= extractResult.start) { + overlap = true; + } + }); + if (!overlap) { + result.push(extractResult); + } + }); + result.sort((x, y) => x.start - y.start); + } +} +exports.BaseMergedUnitExtractor = BaseMergedUnitExtractor; +class PrefixUnitResult { +} +exports.PrefixUnitResult = PrefixUnitResult; + +}); + +unwrapExports(extractors$16); + +/** + * lodash 3.0.0 (Custom Build) + * Build: `lodash modern modularize exports="npm" -o ./` + * Copyright 2012-2015 The Dojo Foundation + * Based on Underscore.js 1.7.0 + * Copyright 2009-2015 Jeremy Ashkenas, DocumentCloud and Investigative Reporters & Editors + * Available under MIT license + */ + +/** + * Gets the last element of `array`. + * + * @static + * @memberOf _ + * @category Array + * @param {Array} array The array to query. + * @returns {*} Returns the last element of `array`. + * @example + * + * _.last([1, 2, 3]); + * // => 3 + */ +function last(array) { + var length = array ? array.length : 0; + return length ? array[length - 1] : undefined; +} + +var lodash_last = last; + +var utilities$2 = createCommonjsModule(function (module, exports) { +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); + +class DictionaryUtils { + static bindDictionary(dictionary, source) { + if (dictionary === null) { + return; + } + dictionary.forEach((value, key) => { + if (recognizersText.StringUtility.isNullOrEmpty(key)) { + return; + } + this.bindUnitsString(source, key, value); + }); + } + static bindUnitsString(dictionary, key, source) { + let values = source.trim().split('|'); + values.forEach(token => { + if (recognizersText.StringUtility.isNullOrWhitespace(token) || dictionary.has(token)) { + return; + } + dictionary.set(token, key); + }); + } +} +exports.DictionaryUtils = DictionaryUtils; + +}); + +unwrapExports(utilities$2); + +var baseCurrency = createCommonjsModule(function (module, exports) { +"use strict"; +// ------------------------------------------------------------------------------ +// +// This code was generated by a tool. +// Changes to this file may cause incorrect behavior and will be lost if +// the code is regenerated. +// +// ------------------------------------------------------------------------------ +Object.defineProperty(exports, "__esModule", { value: true }); +var BaseCurrency; +(function (BaseCurrency) { + BaseCurrency.CurrencyFractionMapping = new Map([["CNY", "FEN|JIAO"], ["__D", "CENT"], ["RUB", "KOPEK"], ["AFN", "PUL"], ["EUR", "CENT"], ["ALL", "QINDARKE"], ["_ALP", "PENNY"], ["GBP", "PENNY"], ["_GGP", "PENNY"], ["DZD", "SANTEEM"], ["AOA", "CENTIMO"], ["ARS", "CENTAVO"], ["AMD", "LUMA"], ["AWG", "CENT"], ["_AP", "PENNY"], ["SHP", "PENNY"], ["AUD", "CENT"], ["AZN", "QƏPIK"], ["BSD", "CENT"], ["BHD", "FILS"], ["BDT", "POISHA"], ["BBD", "CENT"], ["BYN", "KAPYEYKA"], ["BZD", "CENT"], ["XOF", "CENTIME"], ["BMD", "CENT"], ["BTN", "CHETRUM"], ["INR", "PAISA"], ["BOB", "CENTAVO"], ["USD", "CENT"], ["BAM", "FENING"], ["BWP", "THEBE"], ["BRL", "CENTAVO"], ["_BD", "CENT"], ["BND", "SEN"], ["SGD", "CENT"], ["BGN", "STOTINKA"], ["BIF", "CENTIME"], ["KHR", "SEN"], ["XAF", "CENTIME"], ["CAD", "CENT"], ["CVE", "CENTAVO"], ["KYD", "CENT"], ["CLP", "CENTAVO"], ["COP", "CENTAVO"], ["KMF", "CENTIME"], ["CDF", "CENTIME"], ["NZD", "CENT"], ["_CKD", "CENT"], ["CRC", "CENTIMO"], ["HRK", "LIPA"], ["CUC", "CENTAVO"], ["CUP", "CENTAVO"], ["CZK", "HALER"], ["DKK", "ØRE"], ["DJF", "CENTIME"], ["DOP", "CENTAVO"], ["EGP", "PIASTRE"], ["ERN", "CENT"], ["ETB", "SANTIM"], ["FKP", "PENNY"], ["_FOK", "OYRA"], ["FJD", "CENT"], ["XPF", "CENTIME"], ["GMD", "BUTUT"], ["GEL", "TETRI"], ["GHS", "PESEWA"], ["GIP", "PENNY"], ["GTQ", "CENTAVO"], ["GNF", "CENTIME"], ["GYD", "CENT"], ["HTG", "CENTIME"], ["HNL", "CENTAVO"], ["HKD", "CENT"], ["HUF", "FILLER"], ["ISK", "EYRIR"], ["IDR", "SEN"], ["IRR", "DINAR"], ["IQD", "FILS"], ["IMP", "PENNY"], ["ILS", "AGORA"], ["JMD", "CENT"], ["JPY", "SEN"], ["JEP", "PENNY"], ["JOD", "PIASTRE"], ["KZT", "TIIN"], ["KES", "CENT"], ["_KID", "CENT"], ["KPW", "CHON"], ["KRW", "JEON"], ["KWD", "FILS"], ["KGS", "TYIYN"], ["LAK", "ATT"], ["LBP", "PIASTRE"], ["LSL", "SENTE"], ["ZAR", "CENT"], ["LRD", "CENT"], ["LYD", "DIRHAM"], ["CHF", "RAPPEN"], ["MOP", "AVO"], ["MKD", "DENI"], ["MGA", "IRAIMBILANJA"], ["MWK", "TAMBALA"], ["MYR", "SEN"], ["MVR", "LAARI"], ["MRO", "KHOUMS"], ["MUR", "CENT"], ["MXN", "CENTAVO"], ["_MD", "CENT"], ["MDL", "BAN"], ["MNT", "MONGO"], ["MAD", "CENTIME"], ["MZN", "CENTAVO"], ["MMK", "PYA"], ["NAD", "CENT"], ["_ND", "CENT"], ["NPR", "PAISA"], ["NIO", "CENTAVO"], ["NGN", "KOBO"], ["_NID", "CENT"], ["TRY", "KURUS"], ["NOK", "ØRE"], ["OMR", "BAISA"], ["PKR", "PAISA"], ["_PD", "CENT"], ["PAB", "CENTESIMO"], ["PGK", "TOEA"], ["PYG", "CENTIMO"], ["PEN", "CENTIMO"], ["_PND", "CENT"], ["PLN", "GROSZ"], ["QAR", "DIRHAM"], ["RON", "BAN"], ["RWF", "CENTIME"], ["WST", "SENE"], ["STD", "CENTIMO"], ["SAR", "HALALA"], ["RSD", "PARA"], ["SCR", "CENT"], ["SLL", "CENT"], ["SBD", "CENT"], ["SOS", "CENT"], ["_SS", "CENT"], ["_SP", "PENNY"], ["SSP", "PIASTRE"], ["LKR", "CENT"], ["SDG", "PIASTRE"], ["SRD", "CENT"], ["SZL", "CENT"], ["SEK", "ORE"], ["SYP", "PIASTRE"], ["TWD", "CENT"], ["TJS", "DIRAM"], ["TZS", "CENT"], ["THB", "SATANG"], ["PRB", "KOPEK"], ["TTD", "CENT"], ["_TP", "PENNY"], ["TND", "MILLIME"], ["TMT", "TENNESI"], ["TVD", "CENT"], ["UGX", "CENT"], ["UAH", "KOPIYKA"], ["AED", "FILS"], ["UYU", "CENTESIMO"], ["VEF", "CENTIMO"], ["YER", "FILS"], ["ZMW", "NGWEE"]]); + BaseCurrency.CurrencyFractionalRatios = new Map([["Kopek", 100], ["Pul", 100], ["Cent", 100], ["Qindarkë", 100], ["Penny", 100], ["Santeem", 100], ["Cêntimo", 100], ["Centavo", 100], ["Luma", 100], ["Qəpik", 100], ["Fils", 1000], ["Poisha", 100], ["Kapyeyka", 100], ["Centime", 100], ["Chetrum", 100], ["Paisa", 100], ["Fening", 100], ["Thebe", 100], ["Sen", 100], ["Stotinka", 100], ["Jiao", 10], ["Fen", 100], ["Céntimo", 100], ["Lipa", 100], ["Haléř", 100], ["Øre", 100], ["Piastre", 100], ["Santim", 100], ["Oyra", 100], ["Butut", 100], ["Tetri", 100], ["Pesewa", 100], ["Fillér", 100], ["Eyrir", 100], ["Dinar", 100], ["Agora", 100], ["Tïın", 100], ["Chon", 100], ["Jeon", 100], ["Tyiyn", 100], ["Att", 100], ["Sente", 100], ["Dirham", 1000], ["Rappen", 100], ["Avo", 100], ["Deni", 100], ["Iraimbilanja", 5], ["Tambala", 100], ["Laari", 100], ["Khoums", 5], ["Ban", 100], ["Möngö", 100], ["Pya", 100], ["Kobo", 100], ["Kuruş", 100], ["Baisa", 1000], ["Centésimo", 100], ["Toea", 100], ["Sentimo", 100], ["Grosz", 100], ["Sene", 100], ["Halala", 100], ["Para", 100], ["Öre", 100], ["Diram", 100], ["Satang", 100], ["Seniti", 100], ["Millime", 1000], ["Tennesi", 100], ["Kopiyka", 100], ["Tiyin", 100], ["Hào", 10], ["Ngwee", 100]]); +})(BaseCurrency = exports.BaseCurrency || (exports.BaseCurrency = {})); + +}); + +unwrapExports(baseCurrency); + +var parsers$4 = createCommonjsModule(function (module, exports) { +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); + + + + + + +class UnitValue { + constructor() { + this.number = ""; + this.unit = ""; + } +} +exports.UnitValue = UnitValue; +class UnitValueIso extends UnitValue { + constructor() { + super(...arguments); + this.isoCurrency = ""; + } +} +exports.UnitValueIso = UnitValueIso; +class BaseNumberWithUnitParserConfiguration { + constructor(cultureInfo) { + this.cultureInfo = cultureInfo; + this.unitMap = new Map(); + this.currencyFractionNumMap = baseCurrency.BaseCurrency.CurrencyFractionalRatios; + this.currencyFractionMapping = baseCurrency.BaseCurrency.CurrencyFractionMapping; + } + BindDictionary(dictionary) { + utilities$2.DictionaryUtils.bindDictionary(dictionary, this.unitMap); + } +} +exports.BaseNumberWithUnitParserConfiguration = BaseNumberWithUnitParserConfiguration; +class NumberWithUnitParser { + constructor(config) { + this.config = config; + } + parse(extResult) { + let ret = new recognizersText.ParseResult(extResult); + let numberResult; + if (extResult.data && typeof extResult.data === "object") { + numberResult = extResult.data; + } + else if (extResult.type === constants$2.Constants.SYS_NUM) { + ret.value = this.config.internalNumberParser.parse(extResult).value; + return ret; + } + else { + // if there is no unitResult, means there is just unit + numberResult = { start: -1, length: 0, text: null, type: null }; + } + // key contains units + let key = extResult.text; + let unitKeyBuild = ''; + let unitKeys = new Array(); + for (let i = 0; i <= key.length; i++) { + if (i === key.length) { + if (unitKeyBuild.length !== 0) { + this.addIfNotContained(unitKeys, unitKeyBuild.trim()); + } + } + // numberResult.start is a relative position + else if (i === numberResult.start) { + if (unitKeyBuild.length !== 0) { + this.addIfNotContained(unitKeys, unitKeyBuild.trim()); + unitKeyBuild = ''; + } + let o = numberResult.start + numberResult.length - 1; + if (o !== null && !isNaN(o)) { + i = o; + } + } + else { + unitKeyBuild += key[i]; + } + } + /* Unit type depends on last unit in suffix.*/ + let lastUnit = lodash_last(unitKeys); + let normalizedLastUnit = lastUnit.toLowerCase(); + if (this.config.connectorToken && this.config.connectorToken.length && normalizedLastUnit.indexOf(this.config.connectorToken) === 0) { + normalizedLastUnit = normalizedLastUnit.substring(this.config.connectorToken.length).trim(); + lastUnit = lastUnit.substring(this.config.connectorToken.length).trim(); + } + if (key && key.length && (this.config.unitMap !== null)) { + let unitValue = null; + if (this.config.unitMap.has(lastUnit)) { + unitValue = this.config.unitMap.get(lastUnit); + } + else if (this.config.unitMap.has(normalizedLastUnit)) { + unitValue = this.config.unitMap.get(normalizedLastUnit); + } + if (unitValue) { + let numValue = numberResult.text && numberResult.text.length ? this.config.internalNumberParser.parse(numberResult) : null; + let resolutionStr = numValue ? numValue.resolutionStr : null; + ret.value = { number: resolutionStr, unit: unitValue }; + ret.resolutionStr = (`${resolutionStr} ${unitValue}`).trim(); + } + } + return ret; + } + addIfNotContained(keys, newKey) { + if (!keys.some(key => key.includes(newKey))) { + keys.push(newKey); + } + } +} +exports.NumberWithUnitParser = NumberWithUnitParser; +class BaseCurrencyParser { + constructor(config) { + this.config = config; + this.numberWithUnitParser = new NumberWithUnitParser(config); + } + parse(extResult) { + let result = null; + if (extResult.data instanceof Array) { + result = this.mergeCompoundUnit(extResult); + } + else { + result = this.numberWithUnitParser.parse(extResult); + let value = result.value; + if (!this.config.currencyNameToIsoCodeMap.has(value.unit) || this.config.currencyNameToIsoCodeMap.get(value.unit).startsWith(constants$2.Constants.FAKE_ISO_CODE_PREFIX)) { + result.value = { + unit: value.unit, + number: value.number + }; + } + else { + result.value = { + unit: value.unit, + number: value.number, + isoCurrency: this.config.currencyNameToIsoCodeMap.get(value.unit) + }; + } + } + return result; + } + mergeCompoundUnit(compoundResult) { + let results = []; + let compoundUnit = compoundResult.data; + let count = 0; + let result = null; + let numberValue = 0.0; + let mainUnitValue = ''; + let mainUnitIsoCode = ''; + let fractionUnitsString = ''; + for (let i = 0; i < compoundUnit.length; i++) { + let extractResult = compoundUnit[i]; + let parseResult = this.numberWithUnitParser.parse(extractResult); + let parseResultValue = parseResult.value; + let unitValue = parseResultValue != null ? parseResultValue.unit : null; + // Process a new group + if (count === 0) { + if (extractResult.type !== constants$2.Constants.SYS_UNIT_CURRENCY) { + continue; + } + // Initialize a new result + result = new recognizersText.ParseResult(extractResult); + mainUnitValue = unitValue; + numberValue = parseFloat(parseResultValue.number); + result.resolutionStr = parseResult.resolutionStr; + if (this.config.currencyNameToIsoCodeMap.has(unitValue)) { + mainUnitIsoCode = this.config.currencyNameToIsoCodeMap.get(unitValue); + } + // If the main unit can't be recognized, finish process this group. + if (recognizersText.StringUtility.isNullOrEmpty(mainUnitIsoCode)) { + result.value = { + number: numberValue.toString(), + unit: mainUnitValue + }; + results.push(result); + result = null; + continue; + } + if (this.config.currencyFractionMapping.has(mainUnitIsoCode)) { + fractionUnitsString = this.config.currencyFractionMapping.get(mainUnitIsoCode); + } + } + else { + // Match pure number as fraction unit. + if (extractResult.type === recognizersTextNumber.Constants.SYS_NUM) { + numberValue += parseResult.value * (1.0 / 100); + result.resolutionStr += ' ' + parseResult.resolutionStr; + result.length = parseResult.start + parseResult.length - result.start; + count++; + continue; + } + let fractionUnitCode; + let fractionNumValue; + if (this.config.currencyFractionCodeList.has(unitValue)) { + fractionUnitCode = this.config.currencyFractionCodeList.get(unitValue); + } + if (this.config.currencyFractionNumMap.has(unitValue)) { + fractionNumValue = this.config.currencyFractionNumMap.get(unitValue); + } + if (fractionUnitCode && fractionNumValue !== 0 && this.checkUnitsStringContains(fractionUnitCode, fractionUnitsString)) { + numberValue += parseFloat(parseResultValue.number) * (1.0 / fractionNumValue); + result.resolutionStr += ' ' + parseResult.resolutionStr; + result.length = parseResult.start + parseResult.length - result.start; + } + else { + // If the fraction unit doesn't match the main unit, finish process this group. + if (result !== null) { + if (recognizersText.StringUtility.isNullOrEmpty(mainUnitIsoCode) || mainUnitIsoCode.startsWith(constants$2.Constants.FAKE_ISO_CODE_PREFIX)) { + result.value = { + number: numberValue.toString(), + unit: mainUnitValue + }; + } + else { + result.value = { + number: numberValue.toString(), + unit: mainUnitValue, + isoCurrency: mainUnitIsoCode + }; + } + results.push(result); + result = null; + } + count = 0; + i -= 1; + continue; + } + } + count++; + } + if (result !== null) { + if (recognizersText.StringUtility.isNullOrEmpty(mainUnitIsoCode) || mainUnitIsoCode.startsWith(constants$2.Constants.FAKE_ISO_CODE_PREFIX)) { + result.value = { + number: numberValue.toString(), + unit: mainUnitValue + }; + } + else { + result.value = { + number: numberValue.toString(), + unit: mainUnitValue, + isoCurrency: mainUnitIsoCode + }; + } + results.push(result); + } + this.resolveText(results, compoundResult.text, compoundResult.start); + return { value: results }; + } + checkUnitsStringContains(fractionUnitCode, fractionUnitsString) { + let unitsMap = new Map(); + utilities$2.DictionaryUtils.bindUnitsString(unitsMap, '', fractionUnitsString); + return unitsMap.has(fractionUnitCode); + } + resolveText(prs, source, bias) { + prs.forEach(parseResult => { + if (parseResult.start !== null && parseResult.length !== null) { + parseResult.text = source.substr(parseResult.start - bias, parseResult.length); + } + }); + } +} +exports.BaseCurrencyParser = BaseCurrencyParser; +class BaseMergedUnitParser { + constructor(config) { + this.config = config; + this.numberWithUnitParser = new NumberWithUnitParser(config); + this.currencyParser = new BaseCurrencyParser(config); + } + parse(extResult) { + let result; + if (extResult.type === constants$2.Constants.SYS_UNIT_CURRENCY) { + result = this.currencyParser.parse(extResult); + } + else { + result = this.numberWithUnitParser.parse(extResult); + } + return result; + } +} +exports.BaseMergedUnitParser = BaseMergedUnitParser; + +}); + +unwrapExports(parsers$4); + +var englishNumericWithUnit = createCommonjsModule(function (module, exports) { +"use strict"; +// ------------------------------------------------------------------------------ +// +// This code was generated by a tool. +// Changes to this file may cause incorrect behavior and will be lost if +// the code is regenerated. +// +// ------------------------------------------------------------------------------ +Object.defineProperty(exports, "__esModule", { value: true }); +var EnglishNumericWithUnit; +(function (EnglishNumericWithUnit) { + EnglishNumericWithUnit.AgeSuffixList = new Map([["Year", "years old|year old|year-old|years-old|-year-old|-years-old|years of age|year of age"], ["Month", "months old|month old|month-old|months-old|-month-old|-months-old|month of age|months of age"], ["Week", "weeks old|week old|week-old|weeks-old|-week-old|-weeks-old|week of age|weeks of age"], ["Day", "days old|day old|day-old|days-old|-day-old|-days-old|day of age|days of age"]]); + EnglishNumericWithUnit.AreaSuffixList = new Map([["Square kilometer", "sq km|sq kilometer|sq kilometre|sq kilometers|sq kilometres|square kilometer|square kilometre|square kilometers|square kilometres|km2|km^2|km²"], ["Square hectometer", "sq hm|sq hectometer|sq hectometre|sq hectometers|sq hectometres|square hectometer|square hectometre|square hectometers|square hectometres|hm2|hm^2|hm²|hectare|hectares"], ["Square decameter", "sq dam|sq decameter|sq decametre|sq decameters|sq decametres|square decameter|square decametre|square decameters|square decametres|sq dekameter|sq dekametre|sq dekameters|sq dekametres|square dekameter|square dekametre|square dekameters|square dekametres|dam2|dam^2|dam²"], ["Square meter", "sq m|sq meter|sq metre|sq meters|sq metres|sq metre|square meter|square meters|square metre|square metres|m2|m^2|m²"], ["Square decimeter", "sq dm|sq decimeter|sq decimetre|sq decimeters|sq decimetres|square decimeter|square decimetre|square decimeters|square decimetres|dm2|dm^2|dm²"], ["Square centimeter", "sq cm|sq centimeter|sq centimetre|sq centimeters|sq centimetres|square centimeter|square centimetre|square centimeters|square centimetres|cm2|cm^2|cm²"], ["Square millimeter", "sq mm|sq millimeter|sq millimetre|sq millimeters|sq millimetres|square millimeter|square millimetre|square millimeters|square millimetres|mm2|mm^2|mm²"], ["Square inch", "sq in|sq inch|square inch|square inches|in2|in^2|in²"], ["Square foot", "sqft|sq ft|sq foot|sq feet|square foot|square feet|feet2|feet^2|feet²|ft2|ft^2|ft²"], ["Square mile", "sq mi|sq mile|sqmiles|square mile|square miles|mi2|mi^2|mi²"], ["Square yard", "sq yd|sq yard|sq yards|square yard|square yards|yd2|yd^2|yd²"], ["Acre", "-acre|acre|acres"]]); + EnglishNumericWithUnit.CurrencySuffixList = new Map([["Abkhazian apsar", "abkhazian apsar|apsars"], ["Afghan afghani", "afghan afghani|؋|afn|afghanis|afghani"], ["Pul", "pul"], ["Euro", "euros|euro|€|eur"], ["Cent", "cents|cent|-cents|-cent|sen"], ["Albanian lek", "albanian lek|leks|lek"], ["Qindarkë", "qindarkë|qindarkës|qindarke|qindarkes"], ["Angolan kwanza", "angolan kwanza|kz|aoa|kwanza|kwanzas|angolan kwanzas"], ["Armenian dram", "armenian drams|armenian dram"], ["Aruban florin", "aruban florin|ƒ|awg|aruban florins"], ["Bangladeshi taka", "bangladeshi taka|৳|bdt|taka|takas|bangladeshi takas"], ["Paisa", "poisha|paisa"], ["Bhutanese ngultrum", "Bhutanese ngultrum|nu.|btn"], ["Chetrum", "chetrums|chetrum"], ["Bolivian boliviano", "bolivian boliviano|bob|bs.|bolivia boliviano|bolivia bolivianos|bolivian bolivianos"], ["Bosnia and Herzegovina convertible mark", "bosnia and herzegovina convertible mark|bam"], ["Fening", "fenings|fenings"], ["Botswana pula", "botswana pula|bwp|pula|pulas|botswana pulas"], ["Thebe", "thebe"], ["Brazilian real", "brazilian real|r$|brl|brazil real|brazil reals|brazilian reals"], ["Bulgarian lev", "bulgarian lev|bgn|лв|bulgaria lev|bulgaria levs|bulgarian levs"], ["Stotinka", "stotinki|stotinka"], ["Cambodian riel", "cambodian riel|khr|៛|cambodia riel|cambodia riels|cambodian riels"], ["Cape Verdean escudo", "cape verdean escudo|cve"], ["Costa Rican colón", "costa rican colón|costa rican colóns|crc|₡|costa rica colón|costa rica colóns|costa rican colon|costa rican colons|costa rica colon|costa rica colons"], ["Salvadoran colón", "svc|salvadoran colón|salvadoran colóns|salvador colón|salvador colóns|salvadoran colon|salvadoran colons|salvador colon|salvador colons"], ["Céntimo", "céntimo"], ["Croatian kuna", "croatian kuna|kn|hrk|croatia kuna|croatian kunas|croatian kuna kunas"], ["Lipa", "lipa"], ["Czech koruna", "czech koruna|czk|Kč|czech korunas"], ["Haléř", "haléř"], ["Eritrean nakfa", "eritrean nakfa|nfk|ern|eritrean nakfas"], ["Ethiopian birr", "ethiopian birr|etb"], ["Gambian dalasi", "gmd"], ["Butut", "bututs|butut"], ["Georgian lari", "Georgian lari|lari|gel|₾"], ["Tetri", "tetri"], ["Ghanaian cedi", "Ghanaian cedi|ghs|₵|gh₵"], ["Pesewa", "pesewas|pesewa"], ["Guatemalan quetzal", "guatemalan quetzal|gtq|guatemala quetzal"], ["Haitian gourde", "haitian gourde|htg"], ["Honduran lempira", "honduran lempira|hnl"], ["Hungarian forint", "hungarian forint|huf|ft|hungary forint|hungary forints|hungarian forints"], ["Fillér", "fillér"], ["Iranian rial", "iranian rial|irr|iran rial|iran rials|iranian rials"], ["Yemeni rial", "yemeni rial|yer|yemeni rials"], ["Israeli new shekel", "₪|ils|agora"], ["Lithuanian litas", "ltl|lithuanian litas|lithuan litas|lithuanian lit|lithuan lit"], ["Japanese yen", "japanese yen|jpy|yen|-yen|¥|yens|japanese yens|japan yen|japan yens"], ["Kazakhstani tenge", "Kazakhstani tenge|kzt"], ["Kenyan shilling", "kenyan shilling|sh|kes"], ["North Korean won", "north korean won|kpw|north korean wons"], ["South Korean won", "south korean won|krw|south korean wons"], ["Korean won", "korean won|₩|korean wons"], ["Kyrgyzstani som", "kyrgyzstani som|kgs"], ["Uzbekitan som", "uzbekitan som|uzs"], ["Lao kip", "lao kip|lak|₭n|₭"], ["Att", "att"], ["Lesotho loti", "lesotho loti|lsl|loti"], ["Sente", "sente|lisente"], ["South African rand", "south african rand|zar|south africa rand|south africa rands|south african rands"], ["Macanese pataca", "macanese pataca|mop$|mop"], ["Avo", "avos|avo"], ["Macedonian denar", "macedonian denar|mkd|ден"], ["Deni", "deni"], ["Malagasy ariary", "malagasy ariary|mga"], ["Iraimbilanja", "iraimbilanja"], ["Malawian kwacha", "malawian kwacha|mk|mwk"], ["Tambala", "tambala"], ["Malaysian ringgit", "malaysian ringgit|rm|myr|malaysia ringgit|malaysia ringgits|malaysian ringgits"], ["Mauritanian ouguiya", "mauritanian ouguiya|um|mro|mauritania ouguiya|mauritania ouguiyas|mauritanian ouguiyas"], ["Khoums", "khoums"], ["Mongolian tögrög", "mongolian tögrög|mnt|₮|mongolia tögrög|mongolia tögrögs|mongolian tögrögs|mongolian togrog|mongolian togrogs|mongolia togrog|mongolia togrogs"], ["Mozambican metical", "mozambican metical|mt|mzn|mozambica metical|mozambica meticals|mozambican meticals"], ["Burmese kyat", "Burmese kyat|ks|mmk"], ["Pya", "pya"], ["Nicaraguan córdoba", "nicaraguan córdoba|nio"], ["Nigerian naira", "nigerian naira|naira|ngn|₦|nigeria naira|nigeria nairas|nigerian nairas"], ["Kobo", "kobo"], ["Turkish lira", "turkish lira|try|tl|turkey lira|turkey liras|turkish liras"], ["Kuruş", "kuruş"], ["Omani rial", "omani rial|omr|ر.ع."], ["Panamanian balboa", "panamanian balboa|b/.|pab"], ["Centesimo", "centesimo|céntimo"], ["Papua New Guinean kina", "papua new guinean kina|kina|pgk"], ["Toea", "toea"], ["Paraguayan guaraní", "paraguayan guaraní|₲|pyg"], ["Peruvian sol", "peruvian sol|soles|sol|peruvian nuevo sol"], ["Polish złoty", "złoty|polish złoty|zł|pln|zloty|polish zloty|poland zloty|poland złoty"], ["Grosz", "groszy|grosz|grosze"], ["Qatari riyal", "qatari riyal|qar|qatari riyals|qatar riyal|qatar riyals"], ["Saudi riyal", "saudi riyal|sar|saudi riyals"], ["Riyal", "riyal|riyals|rial|﷼"], ["Dirham", "dirham|dirhem|dirhm"], ["Halala", "halalas|halala"], ["Samoan tālā", "samoan tālā|tālā|tala|ws$|samoa|wst|samoan tala"], ["Sene", "sene"], ["São Tomé and Príncipe dobra", "são tomé and príncipe dobra|dobras|dobra|std"], ["Sierra Leonean leone", "sierra Leonean leone|sll|leone|le"], ["Peseta", "pesetas|peseta"], ["Netherlands guilder", "florin|netherlands antillean guilder|ang|ƒ|nederlandse gulden|guilders|guilder|gulden|-guilders|-guilder|dutch guilders|dutch guilder|fl"], ["Swazi lilangeni", "swazi lilangeni|lilangeni|szl|emalangeni"], ["Tajikistani somoni", "tajikistani somoni|tjs|somoni"], ["Diram", "dirams|diram"], ["Thai baht", "thai baht|฿|thb|baht"], ["Satang", "satang|satangs"], ["Tongan paʻanga", "tongan paʻanga|paʻanga|tongan pa'anga|pa'anga"], ["Seniti", "seniti"], ["Ukrainian hryvnia", "ukrainian hryvnia|hyrvnia|uah|₴|ukrain hryvnia|ukrain hryvnias|ukrainian hryvnias"], ["Vanuatu vatu", "vanuatu vatu|vatu|vuv"], ["Venezuelan bolívar", "venezuelan bolívar|venezuelan bolívars|bs.f.|vef|bolívar fuerte|venezuelan bolivar|venezuelan bolivars|venezuela bolivar|venezuela bolivarsvenezuelan bolivar|venezuelan bolivars"], ["Vietnamese dong", "vietnamese dong|vnd|đồng|vietnam dong|vietnamese dongs|vietnam dongs"], ["Zambian kwacha", "zambian kwacha|zk|zmw|zambia kwacha|kwachas|zambian kwachas"], ["Moroccan dirham", "moroccan dirham|mad|د.م."], ["United Arab Emirates dirham", "united arab emirates dirham|د.إ|aed"], ["Azerbaijani manat", "azerbaijani manat|azn"], ["Turkmenistan manat", "turkmenistan manat|turkmenistan new manat|tmt"], ["Manat", "manats|manat"], ["Qəpik", "qəpik"], ["Somali shilling", "somali shillings|somali shilling|shilin soomaali|-shilin soomaali|scellino|shilin|sh.so.|sos"], ["Somaliland shilling", "somaliland shillings|somaliland shilling|soomaaliland shilin"], ["Tanzanian shilling", "tanzanian shilling|tanzanian shillings|tsh|tzs|tanzania shilling|tanzania shillings"], ["Ugandan shilling", "ugandan shilling|ugandan shillings|sh|ugx|uganda shilling|uganda shillings"], ["Romanian leu", "romanian leu|lei|ron|romania leu"], ["Moldovan leu", "moldovan leu|mdl|moldova leu"], ["Leu", "leu"], ["Ban", "bani|-ban|ban"], ["Nepalese rupee", "nepalese rupee|npr"], ["Pakistani rupee", "pakistani rupee|pkr"], ["Indian rupee", "indian rupee|inr|₹|india rupee"], ["Seychellois rupee", "seychellois rupee|scr|sr|sre"], ["Mauritian rupee", "mauritian rupee|mur"], ["Maldivian rufiyaa", "maldivian rufiyaa|rf|mvr|.ރ|maldive rufiyaa"], ["Sri Lankan rupee", "sri Lankan rupee|lkr|රු|ரூ"], ["Indonesian rupiah", "Indonesian rupiah|rupiah|perak|rp|idr"], ["Rupee", "rupee|rs"], ["Danish krone", "danish krone|dkk|denmark krone|denmark krones|danish krones"], ["Norwegian krone", "norwegian krone|nok|norway krone|norway krones|norwegian krones"], ["Faroese króna", "faroese króna|faroese krona"], ["Icelandic króna", "icelandic króna|isk|icelandic krona|iceland króna|iceland krona"], ["Swedish krona", "swedish krona|sek|swedan krona"], ["Krone", "kronor|krona|króna|krone|krones|kr|-kr"], ["Øre", "Øre|oyra|eyrir"], ["West African CFA franc", "west african cfa franc|xof|west africa cfa franc|west africa franc|west african franc"], ["Central African CFA franc", "central african cfa franc|xaf|central africa cfa franc|central african franc|central africa franc"], ["Comorian franc", "comorian franc|kmf"], ["Congolese franc", "congolese franc|cdf"], ["Burundian franc", "burundian franc|bif"], ["Djiboutian franc", "djiboutian franc|djf"], ["CFP franc", "cfp franc|xpf"], ["Guinean franc", "guinean franc|gnf"], ["Swiss franc", "swiss francs|swiss franc|chf|sfr."], ["Rwandan franc", "Rwandan franc|rwf|rf|r₣|frw"], ["Belgian franc", "belgian franc|bi.|b.fr.|bef|belgium franc"], ["Rappen", "rappen|-rappen"], ["Franc", "francs|franc|fr.|fs"], ["Centime", "centimes|centime|santim"], ["Russian ruble", "russian ruble|₽|rub|russia ruble|russia ₽|russian ₽|russian rubles|russia rubles"], ["New Belarusian ruble", "new belarusian ruble|byn|new belarus ruble|new belarus rubles|new belarusian rubles"], ["Old Belarusian ruble", "old belarusian ruble|byr|old belarus ruble|old belarus rubles|old belarusian rubles"], ["Transnistrian ruble", "transnistrian ruble|prb|р."], ["Belarusian ruble", "belarusian ruble|belarus ruble|belarus rubles|belarusian rubles"], ["Kopek", "kopek|kopeks"], ["Kapyeyka", "kapyeyka"], ["Ruble", "rubles|ruble|br"], ["Algerian dinar", "algerian dinar|د.ج|dzd|algerian dinars|algeria dinar|algeria dinars"], ["Bahraini dinar", "bahraini dinars|bahraini dinar|bhd|.د.ب"], ["Santeem", "santeem|santeems"], ["Iraqi dinar", "iraqi dinars|iraqi dinar|iraq dinars|iraq dinar|iqd|ع.د"], ["Jordanian dinar", "jordanian dinars|jordanian dinar|د.ا|jod|jordan dinar|jordan dinars"], ["Kuwaiti dinar", "kuwaiti dinars|kuwaiti dinar|kwd|د.ك"], ["Libyan dinar", "libyan dinars|libyan dinar|libya dinars|libya dinar|lyd"], ["Serbian dinar", "serbian dinars|serbian dinar|din.|rsd|дин.|serbia dinars|serbia dinar"], ["Tunisian dinar", "tunisian dinars|tunisian dinar|tnd|tunisia dinars|tunisia dinar"], ["Yugoslav dinar", "yugoslav dinars|yugoslav dinar|yun"], ["Dinar", "dinars|dinar|denar|-dinars|-dinar"], ["Fils", "fils|fulūs|-fils|-fil"], ["Para", "para|napa"], ["Millime", "millimes|millime"], ["Argentine peso", "argentine peso|ars|argetina peso|argetina pesos|argentine pesos"], ["Chilean peso", "chilean pesos|chilean peso|clp|chile peso|chile peso"], ["Colombian peso", "colombian pesos|colombian peso|cop|colombia peso|colombia pesos"], ["Cuban convertible peso", "cuban convertible pesos|cuban convertible peso|cuc|cuba convertible pesos|cuba convertible peso"], ["Cuban peso", "cuban pesos|cuban peso|cup|cuba pesos|cuba peso"], ["Dominican peso", "dominican pesos|dominican peso|dop|dominica pesos|dominica peso"], ["Mexican peso", "mexican pesos|mexican peso|mxn|mexico pesos|mexico peso"], ["Philippine peso", "piso|philippine pesos|philippine peso|₱|php"], ["Uruguayan peso", "uruguayan pesos|uruguayan peso|uyu"], ["Peso", "pesos|peso"], ["Centavo", "centavos|centavo"], ["Alderney pound", "alderney pounds|alderney pound|alderney £"], ["British pound", "british pounds|british pound|british £|gbp|pound sterling|pound sterlings|sterling|pound scot|pound scots"], ["Guernsey pound", "guernsey pounds|guernsey £|ggp"], ["Ascension pound", "ascension pounds|ascension pound|ascension £"], ["Saint Helena pound", "saint helena pounds|saint helena pound|saint helena £|shp"], ["Egyptian pound", "egyptian pounds|egyptian pound|egyptian £|egp|ج.م|egypt pounds|egypt pound"], ["Falkland Islands pound", "falkland islands pounds|falkland islands pound|falkland islands £|fkp|falkland island pounds|falkland island pound|falkland island £"], ["Gibraltar pound", "gibraltar pounds|gibraltar pound|gibraltar £|gip"], ["Manx pound", "manx pounds|manx pound|manx £|imp"], ["Jersey pound", "jersey pounds|jersey pound|jersey £|jep"], ["Lebanese pound", "lebanese pounds|lebanese pound|lebanese £|lebanan pounds|lebanan pound|lebanan £|lbp|ل.ل"], ["South Georgia and the South Sandwich Islands pound", "south georgia and the south sandwich islands pounds|south georgia and the south sandwich islands pound|south georgia and the south sandwich islands £"], ["South Sudanese pound", "south sudanese pounds|south sudanese pound|south sudanese £|ssp|south sudan pounds|south sudan pound|south sudan £"], ["Sudanese pound", "sudanese pounds|sudanese pound|sudanese £|ج.س.|sdg|sudan pounds|sudan pound|sudan £"], ["Syrian pound", "syrian pounds|syrian pound|syrian £|ل.س|syp|syria pounds|syria pound|syria £"], ["Tristan da Cunha pound", "tristan da cunha pounds|tristan da cunha pound|tristan da cunha £"], ["Pound", "pounds|pound|-pounds|-pound|£"], ["Pence", "pence"], ["Shilling", "shillings|shilling|shilingi"], ["Penny", "pennies|penny"], ["United States dollar", "united states dollars|united states dollar|united states $|u.s. dollars|u.s. dollar|u s dollar|u s dollars|usd|american dollars|american dollar|us$|us dollar|us dollars|u.s dollar|u.s dollars"], ["East Caribbean dollar", "east caribbean dollars|east caribbean dollar|east Caribbean $|xcd"], ["Australian dollar", "australian dollars|australian dollar|australian $|australian$|aud|australia dollars|australia dollar|australia $|australia$"], ["Bahamian dollar", "bahamian dollars|bahamian dollar|bahamian $|bahamian$|bsd|bahamia dollars|bahamia dollar|bahamia $|bahamia$"], ["Barbadian dollar", "barbadian dollars|barbadian dollar|barbadian $|bbd"], ["Belize dollar", "belize dollars|belize dollar|belize $|bzd"], ["Bermudian dollar", "bermudian dollars|bermudian dollar|bermudian $|bmd|bermudia dollars|bermudia dollar|bermudia $"], ["British Virgin Islands dollar", "british virgin islands dollars|british virgin islands dollar|british virgin islands $|bvi$|virgin islands dollars|virgin islands dolalr|virgin islands $|virgin island dollars|virgin island dollar|virgin island $"], ["Brunei dollar", "brunei dollar|brunei $|bnd"], ["Sen", "sen"], ["Singapore dollar", "singapore dollars|singapore dollar|singapore $|s$|sgd"], ["Canadian dollar", "canadian dollars|canadian dollar|canadian $|cad|can$|c$|canada dollars|canada dolllar|canada $"], ["Cayman Islands dollar", "cayman islands dollars|cayman islands dollar|cayman islands $|kyd|ci$|cayman island dollar|cayman island doolars|cayman island $"], ["New Zealand dollar", "new zealand dollars|new zealand dollar|new zealand $|nz$|nzd|kiwi"], ["Cook Islands dollar", "cook islands dollars|cook islands dollar|cook islands $|cook island dollars|cook island dollar|cook island $"], ["Fijian dollar", "fijian dollars|fijian dollar|fijian $|fjd|fiji dollars|fiji dollar|fiji $"], ["Guyanese dollar", "guyanese dollars|guyanese dollar|gyd|gy$"], ["Hong Kong dollar", "hong kong dollars|hong kong dollar|hong kong $|hk$|hkd|hk dollars|hk dollar|hk $|hongkong$"], ["Jamaican dollar", "jamaican dollars|jamaican dollar|jamaican $|j$|jamaica dollars|jamaica dollar|jamaica $|jmd"], ["Kiribati dollar", "kiribati dollars|kiribati dollar|kiribati $"], ["Liberian dollar", "liberian dollars|liberian dollar|liberian $|liberia dollars|liberia dollar|liberia $|lrd"], ["Micronesian dollar", "micronesian dollars|micronesian dollar|micronesian $"], ["Namibian dollar", "namibian dollars|namibian dollar|namibian $|nad|n$|namibia dollars|namibia dollar|namibia $"], ["Nauruan dollar", "nauruan dollars|nauruan dollar|nauruan $"], ["Niue dollar", "niue dollars|niue dollar|niue $"], ["Palauan dollar", "palauan dollars|palauan dollar|palauan $"], ["Pitcairn Islands dollar", "pitcairn islands dollars|pitcairn islands dollar|pitcairn islands $|pitcairn island dollars|pitcairn island dollar|pitcairn island $"], ["Solomon Islands dollar", "solomon islands dollars|solomon islands dollar|solomon islands $|si$|sbd|solomon island dollars|solomon island dollar|solomon island $"], ["Surinamese dollar", "surinamese dollars|surinamese dollar|surinamese $|srd"], ["New Taiwan dollar", "new taiwan dollars|new taiwan dollar|nt$|twd|ntd"], ["Trinidad and Tobago dollar", "trinidad and tobago dollars|trinidad and tobago dollar|trinidad and tobago $|trinidad $|trinidad dollar|trinidad dollars|trinidadian dollar|trinidadian dollars|trinidadian $|ttd"], ["Tuvaluan dollar", "tuvaluan dollars|tuvaluan dollar|tuvaluan $"], ["Dollar", "dollars|dollar|$"], ["Chinese yuan", "yuan|kuai|chinese yuan|renminbi|cny|rmb|¥|元"], ["Fen", "fen"], ["Jiao", "jiao|mao"], ["Finnish markka", "suomen markka|finnish markka|finsk mark|fim|markkaa|markka"], ["Penni", "penniä|penni"]]); + EnglishNumericWithUnit.CurrencyNameToIsoCodeMap = new Map([["Afghan afghani", "AFN"], ["Euro", "EUR"], ["Albanian lek", "ALL"], ["Angolan kwanza", "AOA"], ["Armenian dram", "AMD"], ["Aruban florin", "AWG"], ["Bangladeshi taka", "BDT"], ["Bhutanese ngultrum", "BTN"], ["Bolivian boliviano", "BOB"], ["Bosnia and Herzegovina convertible mark", "BAM"], ["Botswana pula", "BWP"], ["Brazilian real", "BRL"], ["Bulgarian lev", "BGN"], ["Cambodian riel", "KHR"], ["Cape Verdean escudo", "CVE"], ["Costa Rican colón", "CRC"], ["Croatian kuna", "HRK"], ["Czech koruna", "CZK"], ["Eritrean nakfa", "ERN"], ["Ethiopian birr", "ETB"], ["Gambian dalasi", "GMD"], ["Georgian lari", "GEL"], ["Ghanaian cedi", "GHS"], ["Guatemalan quetzal", "GTQ"], ["Haitian gourde", "HTG"], ["Honduran lempira", "HNL"], ["Hungarian forint", "HUF"], ["Iranian rial", "IRR"], ["Yemeni rial", "YER"], ["Israeli new shekel", "ILS"], ["Japanese yen", "JPY"], ["Kazakhstani tenge", "KZT"], ["Kenyan shilling", "KES"], ["North Korean won", "KPW"], ["South Korean won", "KRW"], ["Kyrgyzstani som", "KGS"], ["Lao kip", "LAK"], ["Lesotho loti", "LSL"], ["South African rand", "ZAR"], ["Macanese pataca", "MOP"], ["Macedonian denar", "MKD"], ["Malagasy ariary", "MGA"], ["Malawian kwacha", "MWK"], ["Malaysian ringgit", "MYR"], ["Mauritanian ouguiya", "MRO"], ["Mongolian tögrög", "MNT"], ["Mozambican metical", "MZN"], ["Burmese kyat", "MMK"], ["Nicaraguan córdoba", "NIO"], ["Nigerian naira", "NGN"], ["Turkish lira", "TRY"], ["Omani rial", "OMR"], ["Panamanian balboa", "PAB"], ["Papua New Guinean kina", "PGK"], ["Paraguayan guaraní", "PYG"], ["Peruvian sol", "PEN"], ["Polish złoty", "PLN"], ["Qatari riyal", "QAR"], ["Saudi riyal", "SAR"], ["Samoan tālā", "WST"], ["São Tomé and Príncipe dobra", "STD"], ["Sierra Leonean leone", "SLL"], ["Swazi lilangeni", "SZL"], ["Tajikistani somoni", "TJS"], ["Thai baht", "THB"], ["Ukrainian hryvnia", "UAH"], ["Vanuatu vatu", "VUV"], ["Venezuelan bolívar", "VEF"], ["Zambian kwacha", "ZMW"], ["Moroccan dirham", "MAD"], ["United Arab Emirates dirham", "AED"], ["Azerbaijani manat", "AZN"], ["Turkmenistan manat", "TMT"], ["Somali shilling", "SOS"], ["Tanzanian shilling", "TZS"], ["Ugandan shilling", "UGX"], ["Romanian leu", "RON"], ["Moldovan leu", "MDL"], ["Nepalese rupee", "NPR"], ["Pakistani rupee", "PKR"], ["Indian rupee", "INR"], ["Seychellois rupee", "SCR"], ["Mauritian rupee", "MUR"], ["Maldivian rufiyaa", "MVR"], ["Sri Lankan rupee", "LKR"], ["Indonesian rupiah", "IDR"], ["Danish krone", "DKK"], ["Norwegian krone", "NOK"], ["Icelandic króna", "ISK"], ["Swedish krona", "SEK"], ["West African CFA franc", "XOF"], ["Central African CFA franc", "XAF"], ["Comorian franc", "KMF"], ["Congolese franc", "CDF"], ["Burundian franc", "BIF"], ["Djiboutian franc", "DJF"], ["CFP franc", "XPF"], ["Guinean franc", "GNF"], ["Swiss franc", "CHF"], ["Rwandan franc", "RWF"], ["Russian ruble", "RUB"], ["Transnistrian ruble", "PRB"], ["Belarusian ruble", "BYN"], ["Algerian dinar", "DZD"], ["Bahraini dinar", "BHD"], ["Iraqi dinar", "IQD"], ["Jordanian dinar", "JOD"], ["Kuwaiti dinar", "KWD"], ["Libyan dinar", "LYD"], ["Serbian dinar", "RSD"], ["Tunisian dinar", "TND"], ["Argentine peso", "ARS"], ["Chilean peso", "CLP"], ["Colombian peso", "COP"], ["Cuban convertible peso", "CUC"], ["Cuban peso", "CUP"], ["Dominican peso", "DOP"], ["Mexican peso", "MXN"], ["Uruguayan peso", "UYU"], ["British pound", "GBP"], ["Saint Helena pound", "SHP"], ["Egyptian pound", "EGP"], ["Falkland Islands pound", "FKP"], ["Gibraltar pound", "GIP"], ["Manx pound", "IMP"], ["Jersey pound", "JEP"], ["Lebanese pound", "LBP"], ["South Sudanese pound", "SSP"], ["Sudanese pound", "SDG"], ["Syrian pound", "SYP"], ["United States dollar", "USD"], ["Australian dollar", "AUD"], ["Bahamian dollar", "BSD"], ["Barbadian dollar", "BBD"], ["Belize dollar", "BZD"], ["Bermudian dollar", "BMD"], ["Brunei dollar", "BND"], ["Singapore dollar", "SGD"], ["Canadian dollar", "CAD"], ["Cayman Islands dollar", "KYD"], ["New Zealand dollar", "NZD"], ["Fijian dollar", "FJD"], ["Guyanese dollar", "GYD"], ["Hong Kong dollar", "HKD"], ["Jamaican dollar", "JMD"], ["Liberian dollar", "LRD"], ["Namibian dollar", "NAD"], ["Solomon Islands dollar", "SBD"], ["Surinamese dollar", "SRD"], ["New Taiwan dollar", "TWD"], ["Trinidad and Tobago dollar", "TTD"], ["Tuvaluan dollar", "TVD"], ["Chinese yuan", "CNY"], ["Rial", "__RI"], ["Shiling", "__S"], ["Som", "__SO"], ["Dirham", "__DR"], ["Dinar", "_DN"], ["Dollar", "__D"], ["Manat", "__MA"], ["Rupee", "__R"], ["Krone", "__K"], ["Krona", "__K"], ["Crown", "__K"], ["Frank", "__F"], ["Mark", "__M"], ["Ruble", "__RB"], ["Peso", "__PE"], ["Pound", "__P"], ["Tristan da Cunha pound", "_TP"], ["South Georgia and the South Sandwich Islands pound", "_SP"], ["Somaliland shilling", "_SS"], ["Pitcairn Islands dollar", "_PND"], ["Palauan dollar", "_PD"], ["Niue dollar", "_NID"], ["Nauruan dollar", "_ND"], ["Micronesian dollar", "_MD"], ["Kiribati dollar", "_KID"], ["Guernsey pound", "_GGP"], ["Faroese króna", "_FOK"], ["Cook Islands dollar", "_CKD"], ["British Virgin Islands dollar", "_BD"], ["Ascension pound", "_AP"], ["Alderney pound", "_ALP"], ["Abkhazian apsar", "_AA"]]); + EnglishNumericWithUnit.FractionalUnitNameToCodeMap = new Map([["Jiao", "JIAO"], ["Kopek", "KOPEK"], ["Pul", "PUL"], ["Cent", "CENT"], ["Qindarkë", "QINDARKE"], ["Penny", "PENNY"], ["Santeem", "SANTEEM"], ["Cêntimo", "CENTIMO"], ["Centavo", "CENTAVO"], ["Luma", "LUMA"], ["Qəpik", "QƏPIK"], ["Fils", "FILS"], ["Poisha", "POISHA"], ["Kapyeyka", "KAPYEYKA"], ["Centime", "CENTIME"], ["Chetrum", "CHETRUM"], ["Paisa", "PAISA"], ["Fening", "FENING"], ["Thebe", "THEBE"], ["Sen", "SEN"], ["Stotinka", "STOTINKA"], ["Fen", "FEN"], ["Céntimo", "CENTIMO"], ["Lipa", "LIPA"], ["Haléř", "HALER"], ["Øre", "ØRE"], ["Piastre", "PIASTRE"], ["Santim", "SANTIM"], ["Oyra", "OYRA"], ["Butut", "BUTUT"], ["Tetri", "TETRI"], ["Pesewa", "PESEWA"], ["Fillér", "FILLER"], ["Eyrir", "EYRIR"], ["Dinar", "DINAR"], ["Agora", "AGORA"], ["Tïın", "TIIN"], ["Chon", "CHON"], ["Jeon", "JEON"], ["Tyiyn", "TYIYN"], ["Att", "ATT"], ["Sente", "SENTE"], ["Dirham", "DIRHAM"], ["Rappen", "RAPPEN"], ["Avo", "AVO"], ["Deni", "DENI"], ["Iraimbilanja", "IRAIMBILANJA"], ["Tambala", "TAMBALA"], ["Laari", "LAARI"], ["Khoums", "KHOUMS"], ["Ban", "BAN"], ["Möngö", "MONGO"], ["Pya", "PYA"], ["Kobo", "KOBO"], ["Kuruş", "KURUS"], ["Baisa", "BAISA"], ["Centésimo", "CENTESIMO"], ["Toea", "TOEA"], ["Sentimo", "SENTIMO"], ["Grosz", "GROSZ"], ["Sene", "SENE"], ["Halala", "HALALA"], ["Para", "PARA"], ["Öre", "ORE"], ["Diram", "DIRAM"], ["Satang", "SATANG"], ["Seniti", "SENITI"], ["Millime", "MILLIME"], ["Tennesi", "TENNESI"], ["Kopiyka", "KOPIYKA"], ["Tiyin", "TIYIN"], ["Hào", "HAO"], ["Ngwee", "NGWEE"]]); + EnglishNumericWithUnit.CompoundUnitConnectorRegex = `(?and)`; + EnglishNumericWithUnit.CurrencyPrefixList = new Map([["Dollar", "$"], ["United States dollar", "united states $|us$|us $|u.s. $|u.s $"], ["East Caribbean dollar", "east caribbean $"], ["Australian dollar", "australian $|australia $"], ["Bahamian dollar", "bahamian $|bahamia $"], ["Barbadian dollar", "barbadian $|barbadin $"], ["Belize dollar", "belize $"], ["Bermudian dollar", "bermudian $"], ["British Virgin Islands dollar", "british virgin islands $|bvi$|virgin islands $|virgin island $|british virgin island $"], ["Brunei dollar", "brunei $|b$"], ["Sen", "sen"], ["Singapore dollar", "singapore $|s$"], ["Canadian dollar", "canadian $|can$|c$|c $|canada $"], ["Cayman Islands dollar", "cayman islands $|ci$|cayman island $"], ["New Zealand dollar", "new zealand $|nz$|nz $"], ["Cook Islands dollar", "cook islands $|cook island $"], ["Fijian dollar", "fijian $|fiji $"], ["Guyanese dollar", "gy$|gy $|g$|g $"], ["Hong Kong dollar", "hong kong $|hk$|hkd|hk $"], ["Jamaican dollar", "jamaican $|j$|jamaica $"], ["Kiribati dollar", "kiribati $"], ["Liberian dollar", "liberian $|liberia $"], ["Micronesian dollar", "micronesian $"], ["Namibian dollar", "namibian $|nad|n$|namibia $"], ["Nauruan dollar", "nauruan $"], ["Niue dollar", "niue $"], ["Palauan dollar", "palauan $"], ["Pitcairn Islands dollar", "pitcairn islands $|pitcairn island $"], ["Solomon Islands dollar", "solomon islands $|si$|si $|solomon island $"], ["Surinamese dollar", "surinamese $|surinam $"], ["New Taiwan dollar", "nt$|nt $"], ["Trinidad and Tobago dollar", "trinidad and tobago $|trinidad $|trinidadian $"], ["Tuvaluan dollar", "tuvaluan $"], ["Samoan tālā", "ws$"], ["Chinese yuan", "¥"], ["Japanese yen", "¥"], ["Euro", "€"], ["Pound", "£"], ["Costa Rican colón", "₡"], ["Turkish lira", "₺"]]); + EnglishNumericWithUnit.AmbiguousCurrencyUnitList = ['din.', 'kiwi', 'kina', 'kobo', 'lari', 'lipa', 'napa', 'para', 'sfr.', 'taka', 'tala', 'toea', 'vatu', 'yuan', 'ang', 'ban', 'bob', 'btn', 'byr', 'cad', 'cop', 'cup', 'dop', 'gip', 'jod', 'kgs', 'lak', 'lei', 'mga', 'mop', 'nad', 'omr', 'pul', 'sar', 'sbd', 'scr', 'sdg', 'sek', 'sen', 'sol', 'sos', 'std', 'try', 'yer', 'yen']; + EnglishNumericWithUnit.InformationSuffixList = new Map([["Bit", "-bit|bit|bits"], ["Kilobit", "kilobit|kilobits|kb|Kb|kbit"], ["Megabit", "megabit|megabits|mb|Mb|mbit"], ["Gigabit", "gigabit|gigabits|gb|Gb|gbit"], ["Terabit", "terabit|terabits|tb|Tb|tbit"], ["Petabit", "petabit|petabits|pb|Pb|pbit"], ["Byte", "-byte|byte|bytes"], ["Kilobyte", "-kilobyte|-kilobytes|kilobyte|kB|KB|kilobytes|kilo byte|kilo bytes|kbyte"], ["Megabyte", "-megabyte|-megabytes|megabyte|mB|MB|megabytes|mega byte|mega bytes|mbyte"], ["Gigabyte", "-gigabyte|-gigabytes|gigabyte|gB|GB|gigabytes|giga byte|giga bytes|gbyte"], ["Terabyte", "-terabyte|-terabytes|terabyte|tB|TB|terabytes|tera byte|tera bytes|tbyte"], ["Petabyte", "-petabyte|-petabytes|petabyte|pB|PB|petabytes|peta byte|peta bytes|pbyte"]]); + EnglishNumericWithUnit.AmbiguousDimensionUnitList = ['barrel', 'barrels', 'grain', 'pound', 'stone', 'yards', 'yard', 'cord', 'dram', 'feet', 'foot', 'gill', 'knot', 'peck', 'cup', 'fps', 'pts', 'in', 'dm', '\"']; + EnglishNumericWithUnit.BuildPrefix = `(?<=(\\s|^))`; + EnglishNumericWithUnit.BuildSuffix = `(?=(\\s|\\W|$))`; + EnglishNumericWithUnit.LengthSuffixList = new Map([["Kilometer", "km|kilometer|kilometre|kilometers|kilometres|kilo meter|kilo meters|kilo metres|kilo metre"], ["Hectometer", "hm|hectometer|hectometre|hectometers|hectometres|hecto meter|hecto meters|hecto metres|hecto metre"], ["Decameter", "dam|decameter|decametre|decameters|decametres|deca meter|deca meters|deca metres|deca metre"], ["Meter", "m|meter|metre|meters|metres"], ["Decimeter", "dm|decimeter|decimeters|decimetre|decimetres|deci meter|deci meters|deci metres|deci metre"], ["Centimeter", "cm|centimeter|centimeters|centimetre|centimetres|centi meter|centi meters|centi metres|centi metre"], ["Millimeter", "mm|millimeter|millimeters|millimetre|millimetres|milli meter|milli meters|milli metres|milli metre"], ["Micrometer", "μm|micrometer|micrometre|micrometers|micrometres|micro meter|micro meters|micro metres|micro metre"], ["Nanometer", "nm|nanometer|nanometre|nanometers|nanometres|nano meter|nano meters|nano metres|nano metre"], ["Picometer", "pm|picometer|picometre|picometers|picometres|pico meter|pico meters|pico metres|pico metre"], ["Mile", "-mile|mile|miles"], ["Yard", "yard|yards"], ["Inch", "-inch|inch|inches|in|\""], ["Foot", "-foot|foot|feet|ft"], ["Light year", "light year|light-year|light years|light-years"], ["Pt", "pt|pts"]]); + EnglishNumericWithUnit.AmbiguousLengthUnitList = ['m', 'yard', 'yards', 'pm', 'pt', 'pts']; + EnglishNumericWithUnit.SpeedSuffixList = new Map([["Meter per second", "meters / second|m/s|meters per second|metres per second|meter per second|metre per second"], ["Kilometer per hour", "km/h|kilometres per hour|kilometers per hour|kilometer per hour|kilometre per hour"], ["Kilometer per minute", "km/min|kilometers per minute|kilometres per minute|kilometer per minute|kilometre per minute"], ["Kilometer per second", "km/s|kilometers per second|kilometres per second|kilometer per second|kilometre per second"], ["Mile per hour", "mph|mile per hour|miles per hour|mi/h|mile / hour|miles / hour|miles an hour"], ["Knot", "kt|knot|kn"], ["Foot per second", "ft/s|foot/s|foot per second|feet per second|fps"], ["Foot per minute", "ft/min|foot/min|foot per minute|feet per minute"], ["Yard per minute", "yards per minute|yard per minute|yards / minute|yards/min|yard/min"], ["Yard per second", "yards per second|yard per second|yards / second|yards/s|yard/s"]]); + EnglishNumericWithUnit.TemperatureSuffixList = new Map([["F", "degrees fahrenheit|degree fahrenheit|deg fahrenheit|degs fahrenheit|fahrenheit|°f|degrees farenheit|degree farenheit|deg farenheit|degs farenheit|degrees f|degree f|deg f|degs f|farenheit|f"], ["K", "k|kelvin"], ["R", "rankine|°r"], ["D", "delisle|°de"], ["C", "degrees celsius|degree celsius|deg celsius|degs celsius|celsius|degrees celcius|degree celcius|celcius|deg celcius|degs celcius|degrees centigrade|degree centigrade|centigrade|degrees centigrate|degree centigrate|degs centigrate|deg centigrate|centigrate|degrees c|degree c|deg c|degs c|°c|c"], ["Degree", "degree|degrees|deg.|deg|°"]]); + EnglishNumericWithUnit.AmbiguousTemperatureUnitList = ['c', 'f', 'k']; + EnglishNumericWithUnit.VolumeSuffixList = new Map([["Cubic meter", "m3|cubic meter|cubic meters|cubic metre|cubic metres"], ["Cubic centimeter", "cubic centimeter|cubic centimetre|cubic centimeters|cubic centimetres"], ["Cubic millimiter", "cubic millimiter|cubic millimitre|cubic millimiters|cubic millimitres"], ["Hectoliter", "hectoliter|hectolitre|hectoliters|hectolitres"], ["Decaliter", "decaliter|decalitre|dekaliter|dekalitre|decaliters|decalitres|dekaliters|dekalitres"], ["Liter", "l|litre|liter|liters|litres"], ["Deciliter", "dl|deciliter|decilitre|deciliters|decilitres"], ["Centiliter", "cl|centiliter|centilitre|centiliters|centilitres"], ["Milliliter", "ml|mls|millilitre|milliliter|millilitres|milliliters"], ["Cubic yard", "cubic yard|cubic yards"], ["Cubic inch", "cubic inch|cubic inches"], ["Cubic foot", "cubic foot|cubic feet"], ["Cubic mile", "cubic mile|cubic miles"], ["Fluid ounce", "fl oz|fluid ounce|fluid ounces"], ["Teaspoon", "teaspoon|teaspoons"], ["Tablespoon", "tablespoon|tablespoons"], ["Pint", "pint|pints"], ["Volume unit", "fluid dram|gill|quart|minim|barrel|cord|peck|bushel|hogshead"]]); + EnglishNumericWithUnit.AmbiguousVolumeUnitList = ['l', 'ounce', 'oz', 'cup', 'peck', 'cord', 'gill']; + EnglishNumericWithUnit.WeightSuffixList = new Map([["Kilogram", "kg|kilogram|kilograms|kilo|kilos"], ["Gram", "g|gram|grams"], ["Milligram", "mg|milligram|milligrams"], ["Barrel", "barrels|barrel"], ["Gallon", "-gallon|gallons|gallon"], ["Metric ton", "metric tons|metric ton"], ["Ton", "-ton|ton|tons|tonne|tonnes"], ["Pound", "pound|pounds|lb"], ["Ounce", "-ounce|ounce|oz|ounces"], ["Weight unit", "pennyweight|grain|british long ton|US short hundredweight|stone|dram"]]); + EnglishNumericWithUnit.AmbiguousWeightUnitList = ['g', 'oz', 'stone', 'dram']; +})(EnglishNumericWithUnit = exports.EnglishNumericWithUnit || (exports.EnglishNumericWithUnit = {})); + +}); + +unwrapExports(englishNumericWithUnit); + +var base = createCommonjsModule(function (module, exports) { +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); + + + + + +class EnglishNumberWithUnitExtractorConfiguration { + constructor(ci) { + this.cultureInfo = ci; + this.unitNumExtractor = new recognizersTextNumber.EnglishNumberExtractor(); + this.buildPrefix = englishNumericWithUnit.EnglishNumericWithUnit.BuildPrefix; + this.buildSuffix = englishNumericWithUnit.EnglishNumericWithUnit.BuildSuffix; + this.connectorToken = ''; + this.compoundUnitConnectorRegex = recognizersText.RegExpUtility.getSafeRegExp(englishNumericWithUnit.EnglishNumericWithUnit.CompoundUnitConnectorRegex); + this.pmNonUnitRegex = recognizersText.RegExpUtility.getSafeRegExp(baseUnits.BaseUnits.PmNonUnitRegex); + } +} +exports.EnglishNumberWithUnitExtractorConfiguration = EnglishNumberWithUnitExtractorConfiguration; +class EnglishNumberWithUnitParserConfiguration extends parsers$4.BaseNumberWithUnitParserConfiguration { + constructor(ci) { + super(ci); + this.internalNumberExtractor = new recognizersTextNumber.EnglishNumberExtractor(recognizersTextNumber.NumberMode.Default); + this.internalNumberParser = recognizersTextNumber.AgnosticNumberParserFactory.getParser(recognizersTextNumber.AgnosticNumberParserType.Number, new recognizersTextNumber.EnglishNumberParserConfiguration()); + this.connectorToken = ''; + this.currencyNameToIsoCodeMap = englishNumericWithUnit.EnglishNumericWithUnit.CurrencyNameToIsoCodeMap; + this.currencyFractionCodeList = englishNumericWithUnit.EnglishNumericWithUnit.FractionalUnitNameToCodeMap; + } +} +exports.EnglishNumberWithUnitParserConfiguration = EnglishNumberWithUnitParserConfiguration; + +}); + +unwrapExports(base); + +var currency = createCommonjsModule(function (module, exports) { +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); + + + + +class EnglishCurrencyExtractorConfiguration extends base.EnglishNumberWithUnitExtractorConfiguration { + constructor(ci) { + if (!ci) { + ci = new recognizersTextNumber.CultureInfo(recognizersTextNumber.Culture.English); + } + super(ci); + this.extractType = constants$2.Constants.SYS_UNIT_CURRENCY; + // Reference Source: https:// en.wikipedia.org/wiki/List_of_circulating_currencies + this.suffixList = englishNumericWithUnit.EnglishNumericWithUnit.CurrencySuffixList; + this.prefixList = englishNumericWithUnit.EnglishNumericWithUnit.CurrencyPrefixList; + this.ambiguousUnitList = englishNumericWithUnit.EnglishNumericWithUnit.AmbiguousCurrencyUnitList; + } +} +exports.EnglishCurrencyExtractorConfiguration = EnglishCurrencyExtractorConfiguration; +class EnglishCurrencyParserConfiguration extends base.EnglishNumberWithUnitParserConfiguration { + constructor(ci) { + if (!ci) { + ci = new recognizersTextNumber.CultureInfo(recognizersTextNumber.Culture.English); + } + super(ci); + this.BindDictionary(englishNumericWithUnit.EnglishNumericWithUnit.CurrencySuffixList); + this.BindDictionary(englishNumericWithUnit.EnglishNumericWithUnit.CurrencyPrefixList); + } +} +exports.EnglishCurrencyParserConfiguration = EnglishCurrencyParserConfiguration; + +}); + +unwrapExports(currency); + +var temperature = createCommonjsModule(function (module, exports) { +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); + + + + +class EnglishTemperatureExtractorConfiguration extends base.EnglishNumberWithUnitExtractorConfiguration { + constructor(ci) { + if (!ci) { + ci = new recognizersTextNumber.CultureInfo(recognizersTextNumber.Culture.English); + } + super(ci); + this.extractType = constants$2.Constants.SYS_UNIT_TEMPERATURE; + this.suffixList = englishNumericWithUnit.EnglishNumericWithUnit.TemperatureSuffixList; + this.prefixList = new Map(); + this.ambiguousUnitList = englishNumericWithUnit.EnglishNumericWithUnit.AmbiguousTemperatureUnitList; + } +} +exports.EnglishTemperatureExtractorConfiguration = EnglishTemperatureExtractorConfiguration; +class EnglishTemperatureParserConfiguration extends base.EnglishNumberWithUnitParserConfiguration { + constructor(ci) { + if (!ci) { + ci = new recognizersTextNumber.CultureInfo(recognizersTextNumber.Culture.English); + } + super(ci); + this.BindDictionary(englishNumericWithUnit.EnglishNumericWithUnit.TemperatureSuffixList); + } +} +exports.EnglishTemperatureParserConfiguration = EnglishTemperatureParserConfiguration; + +}); + +unwrapExports(temperature); + +var dimension = createCommonjsModule(function (module, exports) { +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); + + + + +const dimensionSuffixList = new Map([ + ...englishNumericWithUnit.EnglishNumericWithUnit.InformationSuffixList, + ...englishNumericWithUnit.EnglishNumericWithUnit.AreaSuffixList, + ...englishNumericWithUnit.EnglishNumericWithUnit.LengthSuffixList, + ...englishNumericWithUnit.EnglishNumericWithUnit.SpeedSuffixList, + ...englishNumericWithUnit.EnglishNumericWithUnit.VolumeSuffixList, + ...englishNumericWithUnit.EnglishNumericWithUnit.WeightSuffixList +]); +class EnglishDimensionExtractorConfiguration extends base.EnglishNumberWithUnitExtractorConfiguration { + constructor(ci) { + if (!ci) { + ci = new recognizersTextNumber.CultureInfo(recognizersTextNumber.Culture.English); + } + super(ci); + this.extractType = constants$2.Constants.SYS_UNIT_DIMENSION; + this.suffixList = dimensionSuffixList; + this.prefixList = new Map(); + this.ambiguousUnitList = englishNumericWithUnit.EnglishNumericWithUnit.AmbiguousDimensionUnitList; + } +} +exports.EnglishDimensionExtractorConfiguration = EnglishDimensionExtractorConfiguration; +class EnglishDimensionParserConfiguration extends base.EnglishNumberWithUnitParserConfiguration { + constructor(ci) { + if (!ci) { + ci = new recognizersTextNumber.CultureInfo(recognizersTextNumber.Culture.English); + } + super(ci); + this.BindDictionary(dimensionSuffixList); + } +} +exports.EnglishDimensionParserConfiguration = EnglishDimensionParserConfiguration; + +}); + +unwrapExports(dimension); + +var age = createCommonjsModule(function (module, exports) { +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); + + + + +class EnglishAgeExtractorConfiguration extends base.EnglishNumberWithUnitExtractorConfiguration { + constructor(ci) { + if (!ci) { + ci = new recognizersTextNumber.CultureInfo(recognizersTextNumber.Culture.English); + } + super(ci); + this.extractType = constants$2.Constants.SYS_UNIT_AGE; + this.suffixList = englishNumericWithUnit.EnglishNumericWithUnit.AgeSuffixList; + this.prefixList = new Map(); + this.ambiguousUnitList = new Array(); + } +} +exports.EnglishAgeExtractorConfiguration = EnglishAgeExtractorConfiguration; +class EnglishAgeParserConfiguration extends base.EnglishNumberWithUnitParserConfiguration { + constructor(ci) { + if (!ci) { + ci = new recognizersTextNumber.CultureInfo(recognizersTextNumber.Culture.English); + } + super(ci); + this.BindDictionary(englishNumericWithUnit.EnglishNumericWithUnit.AgeSuffixList); + } +} +exports.EnglishAgeParserConfiguration = EnglishAgeParserConfiguration; + +}); + +unwrapExports(age); + +var spanishNumericWithUnit = createCommonjsModule(function (module, exports) { +"use strict"; +// ------------------------------------------------------------------------------ +// +// This code was generated by a tool. +// Changes to this file may cause incorrect behavior and will be lost if +// the code is regenerated. +// +// ------------------------------------------------------------------------------ +Object.defineProperty(exports, "__esModule", { value: true }); +var SpanishNumericWithUnit; +(function (SpanishNumericWithUnit) { + SpanishNumericWithUnit.AgeSuffixList = new Map([["Año", "años|año"], ["Mes", "meses|mes"], ["Semana", "semanas|semana"], ["Día", "dias|días|día|dia"]]); + SpanishNumericWithUnit.AreaSuffixList = new Map([["Kilómetro cuadrado", "kilómetro cuadrado|kilómetros cuadrados|km2|km^2|km²"], ["Hectómetro cuadrado", "hectómetro cuadrado|hectómetros cuadrados|hm2|hm^2|hm²|hectárea|hectáreas"], ["Decámetro cuadrado", "decámetro cuadrado|decámetros cuadrados|dam2|dam^2|dam²|área|áreas"], ["Metro cuadrado", "metro cuadrado|metros cuadrados|m2|m^2|m²"], ["Decímetro cuadrado", "decímetro cuadrado|decímetros cuadrados|dm2|dm^2|dm²"], ["Centímetro cuadrado", "centímetro cuadrado|centímetros cuadrados|cm2|cm^2|cm²"], ["Milímetro cuadrado", "milímetro cuadrado|milímetros cuadrados|mm2|mm^2|mm²"], ["Pulgada cuadrado", "pulgada cuadrada|pulgadas cuadradas"], ["Pie cuadrado", "pie cuadrado|pies cuadrados|pie2|pie^2|pie²|ft2|ft^2|ft²"], ["Yarda cuadrado", "yarda cuadrada|yardas cuadradas|yd2|yd^2|yd²"], ["Acre", "acre|acres"]]); + SpanishNumericWithUnit.AreaAmbiguousValues = ['área', 'áreas']; + SpanishNumericWithUnit.CurrencySuffixList = new Map([["Dólar", "dólar|dólares"], ["Peso", "peso|pesos"], ["Rublo", "rublo|rublos"], ["Libra", "libra|libras"], ["Florín", "florín|florines"], ["Dinar", "dinar|dinares"], ["Franco", "franco|francos"], ["Rupia", "rupia|rupias"], ["Escudo", "escudo|escudos"], ["Chelín", "chelín|chelines"], ["Lira", "lira|liras"], ["Centavo", "centavo|centavos"], ["Céntimo", "céntimo|céntimos"], ["Centésimo", "centésimo|centésimos"], ["Penique", "penique|peniques"], ["Euro", "euro|euros|€|eur"], ["Céntimo de Euro", "céntimo de euro|céntimos de euros"], ["Dólar del Caribe Oriental", "dólar del Caribe Oriental|dólares del Caribe Oriental|ec$|xcd"], ["Centavo del Caribe Oriental", "centavo del Caribe Oriental|centavos del Caribe Oriental"], ["Franco CFA de África Occidental", "franco CFA de África Occidental|francos CFA de África Occidental|fcfa|xof"], ["Céntimo de CFA de África Occidental", "céntimo de CFA de África Occidental|céntimos de CFA de África Occidental"], ["Franco CFA de África Central", "franco CFA de África Central|francos CFA de África Central|xaf"], ["Céntimo de CFA de África Central", "céntimo de CFA de África Central|céntimos de CFA de África Central"], ["Apsar", "apsar|apsares"], ["Afgani afgano", "afgani afgano|؋|afn|afganis|afgani"], ["Pul", "pul|puls"], ["Lek albanés", "lek|lekë|lekes|lek albanés"], ["Qindarka", "qindarka|qindarkë|qindarkas"], ["Kwanza angoleño", "kwanza angoleño|kwanzas angoleños|kwanza angoleños|kwanzas angoleño|kwanzas|aoa|kz"], ["Cêntimo angoleño", "cêntimo angoleño|cêntimo|cêntimos"], ["Florín antillano neerlandés", "florín antillano neerlandés|florínes antillano neerlandés|ƒ antillano neerlandés|ang|naƒ"], ["Cent antillano neerlandés", "cent|centen"], ["Riyal saudí", "riyal saudí|riyales saudí|sar"], ["Halalá saudí", "halalá saudí|hallalah"], ["Dinar argelino", "dinar argelino|dinares argelinos|dzd"], ["Céntimo argelino", "centimo argelino|centimos argelinos|"], ["Peso argentino", "peso argentino|pesos argentinos|peso|pesos|ar$|ars"], ["Centavo argentino", "centavo argentino|centavos argentinos|centavo|ctvo.|ctvos."], ["Dram armenio", "dram armenio|dram armenios|dram|դր."], ["Luma armenio", "luma armenio|luma armenios"], ["Florín arubeño", "florín arubeño|florines arubeños|ƒ arubeños|aƒ|awg"], ["Yotin arubeño", "yotin arubeño|yotines arubeños"], ["Dólar australiano", "dólar australiano|dólares australianos|a$|aud"], ["Centavo australiano", "centavo australiano|centavos australianos"], ["Manat azerí", "manat azerí|man|azn"], ["Qəpik azerí", "qəpik azerí|qəpik"], ["Dólar bahameño", "dólar bahameño|dólares bahameños|b$|bsd"], ["Centavo bahameño", "centavo bahameño|centavos bahameños"], ["Dinar bahreiní", "dinar bahreiní|dinares bahreinies|bhd"], ["Fil bahreiní", "fil bahreiní|fils bahreinies"], ["Taka bangladeshí", "taka bangladeshí|takas bangladeshí|bdt"], ["Poisha bangladeshí", "poisha bangladeshí|poishas bangladeshí"], ["Dólar de Barbados", "dólar de barbados|dólares de barbados|bbd"], ["Centavo de Barbados", "centavo de barbados|centavos de barbados"], ["Dólar beliceño", "dólar beliceño|dólares beliceños|bz$|bzd"], ["Centavo beliceño", "centavo beliceño|centavos beliceños"], ["Dólar bermudeño", "dólar bermudeño|dólares bermudeños|bd$|bmd"], ["Centavo bermudeño", "centavo bermudeño|centavos bermudeños"], ["Rublo bielorruso", "rublo bielorruso|rublos bielorrusos|br|byr"], ["Kópek bielorruso", "kópek bielorruso|kópeks bielorrusos|kap"], ["Kyat birmano", "kyat birmano|kyats birmanos|mmk"], ["Pya birmano", "pya birmano|pyas birmanos"], ["Boliviano", "boliviano|bolivianos|bob|bs"], ["Centésimo Boliviano", "centésimo boliviano|centésimos bolivianos"], ["Marco bosnioherzegovino", "marco convertible|marco bosnioherzegovino|marcos convertibles|marcos bosnioherzegovinos|bam"], ["Feningas bosnioherzegovino", "feninga convertible|feninga bosnioherzegovina|feningas convertibles"], ["Pula", "pula|bwp"], ["Thebe", "thebe"], ["Real brasileño", "real brasileño|reales brasileños|r$|brl"], ["Centavo brasileño", "centavo brasileño|centavos brasileños"], ["Dólar de Brunéi", "dólar de brunei|dólares de brunéi|bnd"], ["Sen de Brunéi", "sen|sen de brunéi"], ["Lev búlgaro", "lev búlgaro|leva búlgaros|lv|bgn"], ["Stotinki búlgaro", "stotinka búlgaro|stotinki búlgaros"], ["Franco de Burundi", "franco de burundi|francos de burundi|fbu|fib"], ["Céntimo Burundi", "céntimo burundi|céntimos burundies"], ["Ngultrum butanés", "ngultrum butanés|ngultrum butaneses|btn"], ["Chetrum butanés", "chetrum butanés|chetrum butaneses"], ["Escudo caboverdiano", "escudo caboverdiano|escudos caboverdianos|cve"], ["Riel camboyano", "riel camboyano|rieles camboyanos|khr"], ["Dólar canadiense", "dólar canadiense|dólares canadienses|c$|cad"], ["Centavo canadiense", "centavo canadiense|centavos canadienses"], ["Peso chileno", "peso chileno|pesos chilenos|cpl"], ["Yuan chino", "yuan chino|yuanes chinos|yuan|yuanes|renminbi|rmb|cny|¥"], ["Peso colombiano", "peso colombiano|pesos colombianos|cop|col$"], ["Centavo colombiano", "centavo colombiano|centavos colombianos"], ["Franco comorano", "franco comorano|francos comoranos|kmf|₣"], ["Franco congoleño", "franco congoleño|francos congoleños|cdf"], ["Céntimo congoleño", "céntimo congoleño|céntimos congoleños"], ["Won norcoreano", "won norcoreano|wŏn norcoreano|wŏn norcoreanos|kpw"], ["Chon norcoreano", "chon norcoreano|chŏn norcoreano|chŏn norcoreanos|chon norcoreanos"], ["Won surcoreano", "wŏn surcoreano|won surcoreano|wŏnes surcoreanos|wones surcoreanos|krw"], ["Chon surcoreano", "chon surcoreano|chŏn surcoreano|chŏn surcoreanos|chon surcoreanos"], ["Colón costarricense", "colón costarricense|colones costarricenses|crc"], ["Kuna croata", "kuna croata|kuna croatas|hrk"], ["Lipa croata", "lipa croata|lipa croatas"], ["Peso cubano", "peso cubano|pesos cubanos|cup"], ["Peso cubano convertible", "peso cubano convertible|pesos cubanos convertible|cuc"], ["Corona danesa", "corona danesa|coronas danesas|dkk"], ["Libra egipcia", "libra egipcia|libras egipcias|egp|le"], ["Piastra egipcia", "piastra egipcia|piastras egipcias"], ["Colón salvadoreño", "colón salvadoreño|colones salvadoreños|svc"], ["Dirham de los Emiratos Árabes Unidos", "dirham|dirhams|dirham de los Emiratos Árabes Unidos|aed|dhs"], ["Nakfa", "nakfa|nfk|ern"], ["Céntimo de Nakfa", "céntimo de nakfa|céntimos de nakfa"], ["Peseta", "peseta|pesetas|pts.|ptas.|esp"], ["Dólar estadounidense", "dólar estadounidense|dólares estadounidenses|usd|u$d|us$"], ["Corona estonia", "corona estonia|coronas estonias|eek"], ["Senti estonia", "senti estonia|senti estonias"], ["Birr etíope", "birr etíope|birr etíopes|br|etb"], ["Santim etíope", "santim etíope|santim etíopes"], ["Peso filipino", "peso filipino|pesos filipinos|php"], ["Marco finlandés", "marco finlandés|marcos finlandeses"], ["Dólar fiyiano", "dólar fiyiano|dólares fiyianos|fj$|fjd"], ["Centavo fiyiano", "centavo fiyiano|centavos fiyianos"], ["Dalasi", "dalasi|gmd"], ["Bututs", "butut|bututs"], ["Lari georgiano", "lari georgiano|lari georgianos|gel"], ["Tetri georgiano", "tetri georgiano|tetri georgianos"], ["Cedi", "cedi|ghs|gh₵"], ["Pesewa", "pesewa"], ["Libra gibraltareña", "libra gibraltareña|libras gibraltareñas|gip"], ["Penique gibraltareña", "penique gibraltareña|peniques gibraltareñas"], ["Quetzal guatemalteco", "quetzal guatemalteco|quetzales guatemaltecos|quetzal|quetzales|gtq"], ["Centavo guatemalteco", "centavo guatemalteco|centavos guatemaltecos"], ["Libra de Guernsey", "libra de Guernsey|libras de Guernsey|ggp"], ["Penique de Guernsey", "penique de Guernsey|peniques de Guernsey"], ["Franco guineano", "franco guineano|francos guineanos|gnf|fg"], ["Céntimo guineano", "céntimo guineano|céntimos guineanos"], ["Dólar guyanés", "dólar guyanés|dólares guyaneses|gyd|gy"], ["Gourde haitiano", "gourde haitiano|gourde haitianos|htg"], ["Céntimo haitiano", "céntimo haitiano|céntimos haitianos"], ["Lempira hondureño", "lempira hondureño|lempira hondureños|hnl"], ["Centavo hondureño", "centavo hondureño|centavos hondureño"], ["Dólar de Hong Kong", "dólar de hong kong|dólares de hong kong|hk$|hkd"], ["Forinto húngaro", "forinto húngaro|forinto húngaros|huf"], ["Rupia india", "rupia india|rupias indias|inr"], ["Paisa india", "paisa india|paise indias"], ["Rupia indonesia", "rupia indonesia|rupias indonesias|idr"], ["Sen indonesia", "sen indonesia|sen indonesias"], ["Rial iraní", "rial iraní|rial iranies|irr"], ["Dinar iraquí", "dinar iraquí|dinares iraquies|iqd"], ["Fil iraquí", "fil iraquí|fils iraquies"], ["Libra manesa", "libra manesa|libras manesas|imp"], ["Penique manes", "penique manes|peniques maneses"], ["Corona islandesa", "corona islandesa|coronas islandesas|isk|íkr"], ["Aurar islandes", "aurar islandes|aurar islandeses"], ["Dólar de las Islas Caimán", "dólar de las Islas Caimán|dólares de las Islas Caimán|ci$|kyd"], ["Dólar de las Islas Cook", "dólar de las Islas Cook|dólares de las Islas Cook"], ["Corona feroesa", "corona feroesa|coronas feroesas|fkr"], ["Libra malvinense", "libra malvinense|libras malvinenses|fk£|fkp"], ["Dólar de las Islas Salomón", "dólar de las Islas Salomón|dólares de las Islas Salomón|sbd"], ["Nuevo shéquel", "nuevo shéquel|nuevos shéquel|ils"], ["Agorot", "agorot"], ["Dólar jamaiquino", "dólar jamaiquino|dólares jamaiquinos|j$|ja$|jmd"], ["Yen", "yen|yenes|jpy"], ["Libra de Jersey", "libra de Jersey|libras de Jersey|jep"], ["Dinar jordano", "dinar jordano|dinares jordanos|jd|jod"], ["Piastra jordano", "piastra jordano|piastras jordanos"], ["Tenge kazajo", "tenge|tenge kazajo|kzt"], ["Chelín keniano", "chelín keniano|chelines kenianos|ksh|kes"], ["Som kirguís", "som kirguís|kgs"], ["Tyiyn", "tyiyn"], ["Dólar de Kiribati", "dólar de Kiribati|dólares de Kiribati"], ["Dinar kuwaití", "dinar kuwaití|dinares kuwaití"], ["Kip laosiano", "kip|kip laosiano|kip laosianos|lak"], ["Att laosiano", "att|att laosiano|att laosianos"], ["Loti", "loti|maloti|lsl"], ["Sente", "sente|lisente"], ["Libra libanesa", "libra libanesa|libras libanesas|lbp"], ["Dólar liberiano", "dólar liberiano|dólares liberianos|l$|lrd"], ["Dinar libio", "dinar libio|dinares libios|ld|lyd"], ["Dirham libio", "dirham libio|dirhams libios"], ["Litas lituana", "litas lituana|litai lituanas|ltl"], ["Pataca macaense", "pataca macaense|patacas macaenses|mop$|mop"], ["Avo macaense", "avo macaense|avos macaenses"], ["Ho macaense", "ho macaense|ho macaenses"], ["Denar macedonio", "denar macedonio|denare macedonios|den|mkd"], ["Deni macedonio", "deni macedonio|deni macedonios"], ["Ariary malgache", "ariary malgache|ariary malgaches|mga"], ["Iraimbilanja malgache", "iraimbilanja malgache|iraimbilanja malgaches"], ["Ringgit malayo", "ringgit malayo|ringgit malayos|rm|myr"], ["Sen malayo", "sen malayo|sen malayos"], ["Kwacha malauí", "kwacha malauí|mk|mwk"], ["Támbala malauí", "támbala malauí"], ["Rupia de Maldivas", "rupia de Maldivas|rupias de Maldivas|mvr"], ["Dirham marroquí", "dirham marroquí|dirhams marroquies|mad"], ["Rupia de Mauricio", "rupia de Mauricio|rupias de Mauricio|mur"], ["Uguiya", "uguiya|uguiyas|mro"], ["Jum", "jum|jums"], ["Peso mexicano", "peso mexicano|pesos mexicanos|mxn"], ["Centavo mexicano", "centavo mexicano|centavos mexicanos"], ["Leu moldavo", "leu moldavo|lei moldavos|mdl"], ["Ban moldavo", "ban moldavo|bani moldavos"], ["Tugrik mongol", "tugrik mongol|tugrik|tugrik mongoles|tug|mnt"], ["Metical mozambiqueño", "metical|metical mozambiqueño|meticales|meticales mozambiqueños|mtn|mzn"], ["Dram de Nagorno Karabaj", "dram de Nagorno Karabaj|drams de Nagorno Karabaj|"], ["Luma de Nagorno Karabaj", "luma de Nagorno Karabaj"], ["Dólar namibio", "dólar namibio|dólares namibios|n$|nad"], ["Centavo namibio", "centavo namibio|centavos namibios"], ["Rupia nepalí", "rupia nepalí|rupias nepalies|npr"], ["Paisa nepalí", "paisa nepalí|paisas nepalies"], ["Córdoba nicaragüense", "córdoba nicaragüense|córdobas nicaragüenses|c$|nio"], ["Centavo nicaragüense", "centavo nicaragüense|centavos nicaragüenses"], ["Naira", "naira|ngn"], ["Kobo", "kobo"], ["Corona noruega", "corona noruega|coronas noruegas|nok"], ["Franco CFP", "franco cfp|francos cfp|xpf"], ["Dólar neozelandés", "dólar neozelandés|dólares neozelandeses|dólar de Nueva Zelanda|dólares de Nueva Zelanda|nz$|nzd"], ["Centavo neozelandés", "centavo neozelandés|centavo de Nueva Zelanda|centavos de Nueva Zelanda|centavos neozelandeses"], ["Rial omaní", "rial omaní|riales omanies|omr"], ["Baisa omaní", "baisa omaní|baisa omanies"], ["Florín neerlandés", "florín neerlandés|florines neerlandeses|nlg"], ["Rupia pakistaní", "rupia pakistaní|rupias pakistanies|pkr"], ["Paisa pakistaní", "paisa pakistaní|paisas pakistanies"], ["Balboa panameño", "balboa panameño|balboa panameños|pab"], ["Centésimo panameño", "centésimo panameño|centésimos panameños"], ["Kina", "kina|pkg|pgk"], ["Toea", "toea"], ["Guaraní", "guaraní|guaranies|gs|pyg"], ["Sol", "sol|soles|nuevo sol|pen|s#."], ["Céntimo de sol", "céntimo de sol|céntimos de sol"], ["Złoty", "złoty|esloti|eslotis|zł|pln"], ["Groszy", "groszy"], ["Riyal qatarí", "riyal qatarí|riyal qataries|qr|qar"], ["Dirham qatarí", "dirham qatarí|dirhams qataries"], ["Libra esterlina", "libra esterlina|libras esterlinas|gbp"], ["Corona checa", "corona checa|coronas checas|kc|czk"], ["Peso dominicano", "peso dominicano|pesos dominicanos|rd$|dop"], ["Centavo dominicano", "centavo dominicano|centavos dominicanos"], ["Franco ruandés", "franco ruandés|francos ruandeses|rf|rwf"], ["Céntimo ruandés", "céntimo ruandés|céntimos ruandeses"], ["Leu rumano", "leu rumano|lei rumanos|ron"], ["Ban rumano", "ban rumano|bani rumanos"], ["Rublo ruso", "rublo ruso|rublos rusos|rub"], ["Kopek ruso", "kopek ruso|kopeks rusos"], ["Tala", "tala|tālā|ws$|sat|wst"], ["Sene", "sene"], ["Libra de Santa Helena", "libra de Santa Helena|libras de Santa Helena|shp"], ["Penique de Santa Helena", "penique de Santa Helena|peniques de Santa Helena"], ["Dobra", "dobra|db|std"], ["Dinar serbio", "dinar serbio|dinares serbios|rsd"], ["Para serbio", "para serbio|para serbios"], ["Rupia de Seychelles", "rupia de Seychelles|rupias de Seychelles|scr"], ["Centavo de Seychelles", "centavo de Seychelles|centavos de Seychelles"], ["Leone", "leone|le|sll"], ["Dólar de Singapur", "dólar de singapur|dólares de singapur|sgb"], ["Centavo de Singapur", "centavo de Singapur|centavos de Singapur"], ["Libra siria", "libra siria|libras sirias|s£|syp"], ["Piastra siria", "piastra siria|piastras sirias"], ["Chelín somalí", "chelín somalí|chelines somalies|sos"], ["Centavo somalí", "centavo somalí|centavos somalies"], ["Chelín somalilandés", "chelín somalilandés|chelines somalilandeses"], ["Centavo somalilandés", "centavo somalilandés|centavos somalilandeses"], ["Rupia de Sri Lanka", "rupia de Sri Lanka|rupias de Sri Lanka|lkr"], ["Céntimo de Sri Lanka", "céntimo de Sri Lanka|céntimos de Sri Lanka"], ["Lilangeni", "lilangeni|emalangeni|szl"], ["Rand sudafricano", "rand|rand sudafricano|zar"], ["Libra sudanesa", "libra sudanesa|libras sudanesas|sdg"], ["Piastra sudanesa", "piastra sudanesa|piastras sudanesas"], ["Libra sursudanesa", "libra sursudanesa|libras sursudanesa|ssp"], ["Piastra sursudanesa", "piastra sursudanesa|piastras sursudanesas"], ["Corona sueca", "corona sueca|coronas suecas|sek"], ["Franco suizo", "franco suizo|francos suizos|sfr|chf"], ["Rappen suizo", "rappen suizo|rappens suizos"], ["Dólar surinamés", "óolar surinamés|dólares surinameses|srd"], ["Centavo surinamés", "centavo surinamés|centavos surinamés"], ["Baht tailandés", "baht tailandés|baht tailandeses|thb"], ["Satang tailandés", "satang tailandés|satang tailandeses"], ["Nuevo dólar taiwanés", "nuevo dólar taiwanés|dólar taiwanés|dólares taiwaneses|twd"], ["Centavo taiwanés", "centavo taiwanés|centavos taiwaneses"], ["Chelín tanzano", "chelín tanzano|chelines tanzanos|tzs"], ["Centavo tanzano", "centavo tanzano|centavos tanzanos"], ["Somoni tayiko", "somoni tayiko|somoni|tjs"], ["Diram", "diram|dirams"], ["Paʻanga", "dólar tongano|dólares tonganos|paʻanga|pa'anga|top"], ["Seniti", "seniti"], ["Rublo de Transnistria", "rublo de Transnistria|rublos de Transnistria"], ["Kopek de Transnistria", "kopek de Transnistria|kopeks de Transnistria"], ["Dólar trinitense", "dólar trinitense|dólares trinitenses|ttd"], ["Centavo trinitense", "centavo trinitense|centavos trinitenses"], ["Dinar tunecino", "dinar tunecino|dinares tunecinos|tnd"], ["Millime tunecino", "millime tunecino|millimes tunecinos"], ["Lira turca", "lira turca|liras turcas|try"], ["Kuruş turca", "kuruş turca|kuruş turcas"], ["Manat turkmeno", "manat turkmeno|manat turkmenos|tmt"], ["Tennesi turkmeno", "tennesi turkmeno|tenge turkmeno"], ["Dólar tuvaluano", "dólar tuvaluano|dólares tuvaluanos"], ["Centavo tuvaluano", "centavo tuvaluano|centavos tuvaluanos"], ["Grivna", "grivna|grivnas|uah"], ["Kopiyka", "kopiyka|kópeks"], ["Chelín ugandés", "chelín ugandés|chelines ugandeses|ugx"], ["Centavo ugandés", "centavo ugandés|centavos ugandeses"], ["Peso uruguayo", "peso uruguayo|pesos uruguayos|uyu"], ["Centésimo uruguayo", "centésimo uruguayo|centésimos uruguayos"], ["Som uzbeko", "som uzbeko|som uzbekos|uzs"], ["Tiyin uzbeko", "tiyin uzbeko|tiyin uzbekos"], ["Vatu", "vatu|vuv"], ["Bolívar fuerte", "bolívar fuerte|bolívar|bolívares|vef"], ["Céntimo de bolívar", "céntimo de bolívar|céntimos de bolívar"], ["Đồng vietnamita", "Đồng vietnamita|dong vietnamita|dong vietnamitas|vnd"], ["Hào vietnamita", "Hào vietnamita|hao vietnamita|hao vietnamitas"], ["Rial yemení", "rial yemení|riales yemenies|yer"], ["Fils yemení", "fils yemení|fils yemenies"], ["Franco yibutiano", "franco yibutiano|francos yibutianos|djf"], ["Dinar yugoslavo", "dinar yugoslavo|dinares yugoslavos|yud"], ["Kwacha zambiano", "kwacha zambiano|kwacha zambianos|zmw"], ["Ngwee zambiano", "ngwee zambiano|ngwee zambianos"]]); + SpanishNumericWithUnit.CompoundUnitConnectorRegex = `(?[^.])`; + SpanishNumericWithUnit.CurrencyPrefixList = new Map([["Dólar", "$"], ["Dólar estadounidense", "us$|u$d|usd"], ["Dólar del Caribe Oriental", "ec$|xcd"], ["Dólar australiano", "a$|aud"], ["Dólar bahameño", "b$|bsd"], ["Dólar de Barbados", "bds$|bbd"], ["Dólar beliceño", "bz$|bzd"], ["Dólar bermudeño", "bd$|bmd"], ["Dólar de Brunéi", "brunéi $|bnd"], ["Dólar de Singapur", "s$|sgd"], ["Dólar canadiense", "c$|can$|cad"], ["Dólar de las Islas Caimán", "ci$|kyd"], ["Dólar neozelandés", "nz$|nzd"], ["Dólar fiyiano", "fj$|fjd"], ["Dólar guyanés", "gy$|gyd"], ["Dólar de Hong Kong", "hk$|hkd"], ["Dólar jamaiquino", "j$|ja$|jmd"], ["Dólar liberiano", "l$|lrd"], ["Dólar namibio", "n$|nad"], ["Dólar de las Islas Salomón", "si$|sbd"], ["Nuevo dólar taiwanés", "nt$|twd"], ["Real brasileño", "r$|brl"], ["Guaraní", "₲|gs.|pyg"], ["Dólar trinitense", "tt$|ttd"], ["Yuan chino", "¥|cny|rmb"], ["Yen", "¥|jpy"], ["Euro", "€|eur"], ["Florín", "ƒ"], ["Libra", "£|gbp"], ["Colón costarricense", "₡"], ["Lira turca", "₺"]]); + SpanishNumericWithUnit.AmbiguousCurrencyUnitList = ['le']; + SpanishNumericWithUnit.DimensionSuffixList = new Map([["Kilómetro", "km|kilometro|kilómetro|kilometros|kilómetros"], ["Hectómetro", "hm|hectometro|hectómetro|hectometros|hectómetros"], ["Decámetro", "decametro|decámetro|decametros|decámetros|dam"], ["Metro", "m|m.|metro|metros"], ["Decímetro", "dm|decimetro|decímetro|decimetros|decímetros"], ["Centímetro", "cm|centimetro|centímetro|centimetros|centimetros"], ["Milímetro", "mm|milimetro|milímetro|milimetros|milímetros"], ["Micrómetro", "µm|um|micrometro|micrómetro|micrometros|micrómetros|micrón|micrónes"], ["Nanómetro", "nm|nanometro|nanómetro|nanometros|nanómetros"], ["Picómetro", "pm|picometro|picómetro|picometros|picometros"], ["Milla", "mi|milla|millas"], ["Yarda", "yd|yarda|yardas"], ["Pulgada", "pulgada|pulgadas|\""], ["Pie", "pie|pies|ft"], ["Año luz", "año luz|años luz|al"], ["Metro por segundo", "metro/segundo|m/s|metro por segundo|metros por segundo|metros por segundos"], ["Kilómetro por hora", "km/h|kilómetro por hora|kilometro por hora|kilómetros por hora|kilometros por hora|kilómetro/hora|kilometro/hora|kilómetros/hora|kilometros/hora"], ["Kilómetro por minuto", "km/min|kilómetro por minuto|kilometro por minuto|kilómetros por minuto|kilometros por minuto|kilómetro/minuto|kilometro/minuto|kilómetros/minuto|kilometros/minuto"], ["Kilómetro por segundo", "km/seg|kilómetro por segundo|kilometro por segundo|kilómetros por segundo|kilometros por segundo|kilómetro/segundo|kilometro/segundo|kilómetros/segundo|kilometros/segundo"], ["Milla por hora", "mph|milla por hora|mi/h|milla/hora|millas/hora|millas por hora"], ["Nudo", "kt|nudo|nudos|kn"], ["Pie por segundo", "ft/s|pie/s|ft/seg|pie/seg|pie por segundo|pies por segundo"], ["Pie por minuto", "ft/min|pie/min|pie por minuto|pies por minuto"], ["Yarda por minuto", "yardas por minuto|yardas/minuto|yardas/min"], ["Yarda por segundo", "yardas por segundo|yardas/segundo|yardas/seg"], ["Kilómetro cuadrado", "kilómetro cuadrado|kilómetros cuadrados|km2|km^2|km²"], ["Hectómetro cuadrado", "hectómetro cuadrado|hectómetros cuadrados|hm2|hm^2|hm²|hectárea|hectáreas"], ["Decámetro cuadrado", "decámetro cuadrado|decámetros cuadrados|dam2|dam^2|dam²|área|áreas"], ["Metro cuadrado", "metro cuadrado|metros cuadrados|m2|m^2|m²"], ["Decímetro cuadrado", "decímetro cuadrado|decímetros cuadrados|dm2|dm^2|dm²"], ["Centímetro cuadrado", "centímetro cuadrado|centímetros cuadrados|cm2|cm^2|cm²"], ["Milímetro cuadrado", "milímetro cuadrado|milímetros cuadrados|mm2|mm^2|mm²"], ["Pulgada cuadrado", "pulgada cuadrada|pulgadas cuadradas"], ["Pie cuadrado", "pie cuadrado|pies cuadrados|pie2|pie^2|pie²|ft2|ft^2|ft²"], ["Yarda cuadrado", "yarda cuadrada|yardas cuadradas|yd2|yd^2|yd²"], ["Acre", "acre|acres"], ["Kilómetro cúbico", "kilómetro cúbico|kilómetros cúbico|km3|km^3|km³"], ["Hectómetro cúbico", "hectómetro cúbico|hectómetros cúbico|hm3|hm^3|hm³"], ["Decámetro cúbico", "decámetro cúbico|decámetros cúbico|dam3|dam^3|dam³"], ["Metro cúbico", "metro cúbico|metros cúbico|m3|m^3|m³"], ["Decímetro cúbico", "decímetro cúbico|decímetros cúbico|dm3|dm^3|dm³"], ["Centímetro cúbico", "centímetro cúbico|centímetros cúbico|cc|cm3|cm^3|cm³"], ["Milímetro cúbico", "milímetro cúbico|milímetros cúbico|mm3|mm^3|mm³"], ["Pulgada cúbica", "pulgada cúbics|pulgadas cúbicas"], ["Pie cúbico", "pie cúbico|pies cúbicos|pie3|pie^3|pie³|ft3|ft^3|ft³"], ["Yarda cúbica", "yarda cúbica|yardas cúbicas|yd3|yd^3|yd³"], ["Hectolitro", "hectolitro|hectolitros|hl"], ["Litro", "litro|litros|lts|l"], ["Mililitro", "mililitro|mililitros|ml"], ["Galón", "galón|galones"], ["Pinta", "pinta|pintas"], ["Barril", "barril|barriles"], ["Onza líquida", "onza líquida|onzas líquidas"], ["Tonelada métrica", "tonelada métrica|toneladas métricas"], ["Tonelada", "ton|tonelada|toneladas"], ["Kilogramo", "kg|kilogramo|kilogramos"], ["Hectogramo", "hg|hectogramo|hectogramos"], ["Decagramo", "dag|decagramo|decagramos"], ["Gramo", "g|gr|gramo|gramos"], ["Decigramo", "dg|decigramo|decigramos"], ["Centigramo", "cg|centigramo|centigramos"], ["Miligramo", "mg|miligramo|miligramos"], ["Microgramo", "µg|ug|microgramo|microgramos"], ["Nanogramo", "ng|nanogramo|nanogramos"], ["Picogramo", "pg|picogramo|picogramos"], ["Libra", "lb|libra|libras"], ["Onza", "oz|onza|onzas"], ["Grano", "grano|granos"], ["Quilate", "ct|kt|quilate|quilates"], ["bit", "bit|bits"], ["kilobit", "kilobit|kilobits|kb|kbit"], ["megabit", "megabit|megabits|Mb|Mbit"], ["gigabit", "gigabit|gigabits|Gb|Gbit"], ["terabit", "terabit|terabits|Tb|Tbit"], ["petabit", "petabit|petabits|Pb|Pbit"], ["kibibit", "kibibit|kibibits|kib|kibit"], ["mebibit", "mebibit|mebibits|Mib|Mibit"], ["gibibit", "gibibit|gibibits|Gib|Gibit"], ["tebibit", "tebibit|tebibits|Tib|Tibit"], ["pebibit", "pebibit|pebibits|Pib|Pibit"], ["byte", "byte|bytes"], ["kilobyte", "kilobyte|kilobytes|kB|kByte"], ["megabyte", "megabyte|megabytes|MB|MByte"], ["gigabyte", "gigabyte|gigabytes|GB|GByte"], ["terabyte", "terabyte|terabytes|TB|TByte"], ["petabyte", "petabyte|petabytes|PB|PByte"], ["kibibyte", "kibibyte|kibibytes|kiB|kiByte"], ["mebibyte", "mebibyte|mebibytes|MiB|MiByte"], ["gibibyte", "gibibyte|gibibytes|GiB|GiByte"], ["tebibyte", "tebibyte|tebibytes|TiB|TiByte"], ["pebibyte", "pebibyte|pebibytes|PiB|PiByte"]]); + SpanishNumericWithUnit.AmbiguousDimensionUnitList = ['al', 'mi', 'área', 'áreas', 'pie', 'pies']; + SpanishNumericWithUnit.LengthSuffixList = new Map([["Kilómetro", "km|kilometro|kilómetro|kilometros|kilómetros"], ["Hectómetro", "hm|hectometro|hectómetro|hectometros|hectómetros"], ["Decámetro", "decametro|decámetro|decametros|decámetros|dam"], ["Metro", "m|m.|metro|metros"], ["Decímetro", "dm|decimetro|decímetro|decimetros|decímetros"], ["Centímetro", "cm|centimetro|centímetro|centimetros|centimetros"], ["Milímetro", "mm|milimetro|milímetro|milimetros|milímetros"], ["Micrómetro", "µm|um|micrometro|micrómetro|micrometros|micrómetros|micrón|micrónes"], ["Nanómetro", "nm|nanometro|nanómetro|nanometros|nanómetros"], ["Picómetro", "pm|picometro|picómetro|picometros|picómetros"], ["Milla", "mi|milla|millas"], ["Yarda", "yd|yarda|yardas"], ["Pulgada", "pulgada|pulgadas|\""], ["Pie", "pie|pies|ft"], ["Año luz", "año luz|años luz|al"]]); + SpanishNumericWithUnit.AmbiguousLengthUnitList = ['mi', 'área', 'áreas']; + SpanishNumericWithUnit.BuildPrefix = `(?<=(\\s|^|\\P{L}))`; + SpanishNumericWithUnit.BuildSuffix = `(?=(\\s|\\P{L}|$))`; + SpanishNumericWithUnit.ConnectorToken = 'de'; + SpanishNumericWithUnit.SpeedSuffixList = new Map([["Metro por segundo", "metro/segundo|m/s|metro por segundo|metros por segundo|metros por segundos"], ["Kilómetro por hora", "km/h|kilómetro por hora|kilometro por hora|kilómetros por hora|kilometros por hora|kilómetro/hora|kilometro/hora|kilómetros/hora|kilometros/hora"], ["Kilómetro por minuto", "km/min|kilómetro por minuto|kilometro por minuto|kilómetros por minuto|kilometros por minuto|kilómetro/minuto|kilometro/minuto|kilómetros/minuto|kilometros/minuto"], ["Kilómetro por segundo", "km/seg|kilómetro por segundo|kilometro por segundo|kilómetros por segundo|kilometros por segundo|kilómetro/segundo|kilometro/segundo|kilómetros/segundo|kilometros/segundo"], ["Milla por hora", "mph|milla por hora|mi/h|milla/hora|millas/hora|millas por hora"], ["Nudo", "kt|nudo|nudos|kn"], ["Pie por segundo", "ft/s|pie/s|ft/seg|pie/seg|pie por segundo|pies por segundo"], ["Pie por minuto", "ft/min|pie/min|pie por minuto|pies por minuto"], ["Yarda por minuto", "yardas por minuto|yardas/minuto|yardas/min"], ["Yarda por segundo", "yardas por segundo|yardas/segundo|yardas/seg"]]); + SpanishNumericWithUnit.AmbiguousSpeedUnitList = ['nudo', 'nudos']; + SpanishNumericWithUnit.TemperatureSuffixList = new Map([["Kelvin", "k|kelvin"], ["Rankine", "r|rankine"], ["Grado Celsius", "°c|grados c|grado celsius|grados celsius|celsius|grado centígrado|grados centígrados|centígrado|centígrados"], ["Grado Fahrenheit", "°f|grados f|grado fahrenheit|grados fahrenheit|fahrenheit"], ["Grado Réaumur", "°r|°re|grados r|grado réaumur|grados réaumur|réaumur"], ["Grado Delisle", "°d|grados d|grado delisle|grados delisle|delisle"], ["Grado", "°|grados|grado"]]); + SpanishNumericWithUnit.VolumeSuffixList = new Map([["Kilómetro cúbico", "kilómetro cúbico|kilómetros cúbico|km3|km^3|km³"], ["Hectómetro cúbico", "hectómetro cúbico|hectómetros cúbico|hm3|hm^3|hm³"], ["Decámetro cúbico", "decámetro cúbico|decámetros cúbico|dam3|dam^3|dam³"], ["Metro cúbico", "metro cúbico|metros cúbico|m3|m^3|m³"], ["Decímetro cúbico", "decímetro cúbico|decímetros cúbico|dm3|dm^3|dm³"], ["Centímetro cúbico", "centímetro cúbico|centímetros cúbico|cc|cm3|cm^3|cm³"], ["Milímetro cúbico", "milímetro cúbico|milímetros cúbico|mm3|mm^3|mm³"], ["Pulgada cúbica", "pulgada cúbica|pulgadas cúbicas"], ["Pie cúbico", "pie cúbico|pies cúbicos|pie3|pie^3|pie³|ft3|ft^3|ft³"], ["Yarda cúbica", "yarda cúbica|yardas cúbicas|yd3|yd^3|yd³"], ["Hectolitro", "hectolitro|hectolitros|hl"], ["Litro", "litro|litros|lts|l"], ["Mililitro", "mililitro|mililitros|ml"], ["Galón", "galón|galones"], ["Pinta", "pinta|pintas"], ["Barril", "barril|barriles|bbl"], ["Onza líquida", "onza líquida|onzas líquidas"]]); + SpanishNumericWithUnit.WeightSuffixList = new Map([["Tonelada métrica", "tonelada métrica|toneladas métricas"], ["Tonelada", "ton|tonelada|toneladas"], ["Kilogramo", "kg|kilogramo|kilogramos"], ["Hectogramo", "hg|hectogramo|hectogramos"], ["Decagramo", "dag|decagramo|decagramos"], ["Gramo", "g|gr|gramo|gramos"], ["Decigramo", "dg|decigramo|decigramos"], ["Centigramo", "cg|centigramo|centigramos"], ["Miligramo", "mg|miligramo|miligramos"], ["Microgramo", "µg|ug|microgramo|microgramos"], ["Nanogramo", "ng|nanogramo|nanogramos"], ["Picogramo", "pg|picogramo|picogramos"], ["Libra", "lb|libra|libras"], ["Onza", "oz|onza|onzas"], ["Grano", "grano|granos|gr"], ["Quilate", "ct|kt|quilate|quilates"]]); +})(SpanishNumericWithUnit = exports.SpanishNumericWithUnit || (exports.SpanishNumericWithUnit = {})); + +}); + +unwrapExports(spanishNumericWithUnit); + +var base$2 = createCommonjsModule(function (module, exports) { +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); + + + + + +class SpanishNumberWithUnitExtractorConfiguration { + constructor(ci) { + this.cultureInfo = ci; + this.unitNumExtractor = new recognizersTextNumber.SpanishNumberExtractor(); + this.buildPrefix = spanishNumericWithUnit.SpanishNumericWithUnit.BuildPrefix; + this.buildSuffix = spanishNumericWithUnit.SpanishNumericWithUnit.BuildSuffix; + this.connectorToken = spanishNumericWithUnit.SpanishNumericWithUnit.ConnectorToken; + this.compoundUnitConnectorRegex = recognizersText.RegExpUtility.getSafeRegExp(spanishNumericWithUnit.SpanishNumericWithUnit.CompoundUnitConnectorRegex); + this.pmNonUnitRegex = recognizersText.RegExpUtility.getSafeRegExp(baseUnits.BaseUnits.PmNonUnitRegex); + } +} +exports.SpanishNumberWithUnitExtractorConfiguration = SpanishNumberWithUnitExtractorConfiguration; +class SpanishNumberWithUnitParserConfiguration extends parsers$4.BaseNumberWithUnitParserConfiguration { + constructor(ci) { + super(ci); + this.internalNumberExtractor = new recognizersTextNumber.SpanishNumberExtractor(recognizersTextNumber.NumberMode.Default); + this.internalNumberParser = recognizersTextNumber.AgnosticNumberParserFactory.getParser(recognizersTextNumber.AgnosticNumberParserType.Number, new recognizersTextNumber.SpanishNumberParserConfiguration()); + this.connectorToken = spanishNumericWithUnit.SpanishNumericWithUnit.ConnectorToken; + } +} +exports.SpanishNumberWithUnitParserConfiguration = SpanishNumberWithUnitParserConfiguration; + +}); + +unwrapExports(base$2); + +var currency$2 = createCommonjsModule(function (module, exports) { +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); + + + + +class SpanishCurrencyExtractorConfiguration extends base$2.SpanishNumberWithUnitExtractorConfiguration { + constructor(ci) { + if (!ci) { + ci = new recognizersTextNumber.CultureInfo(recognizersTextNumber.Culture.Spanish); + } + super(ci); + this.extractType = constants$2.Constants.SYS_UNIT_CURRENCY; + // Reference Source: https:// en.wikipedia.org/wiki/List_of_circulating_currencies + this.suffixList = spanishNumericWithUnit.SpanishNumericWithUnit.CurrencySuffixList; + this.prefixList = spanishNumericWithUnit.SpanishNumericWithUnit.CurrencyPrefixList; + this.ambiguousUnitList = spanishNumericWithUnit.SpanishNumericWithUnit.AmbiguousCurrencyUnitList; + } +} +exports.SpanishCurrencyExtractorConfiguration = SpanishCurrencyExtractorConfiguration; +class SpanishCurrencyParserConfiguration extends base$2.SpanishNumberWithUnitParserConfiguration { + constructor(ci) { + if (!ci) { + ci = new recognizersTextNumber.CultureInfo(recognizersTextNumber.Culture.Spanish); + } + super(ci); + this.BindDictionary(spanishNumericWithUnit.SpanishNumericWithUnit.CurrencySuffixList); + this.BindDictionary(spanishNumericWithUnit.SpanishNumericWithUnit.CurrencyPrefixList); + } +} +exports.SpanishCurrencyParserConfiguration = SpanishCurrencyParserConfiguration; + +}); + +unwrapExports(currency$2); + +var temperature$2 = createCommonjsModule(function (module, exports) { +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); + + + + +class SpanishTemperatureExtractorConfiguration extends base$2.SpanishNumberWithUnitExtractorConfiguration { + constructor(ci) { + if (!ci) { + ci = new recognizersTextNumber.CultureInfo(recognizersTextNumber.Culture.Spanish); + } + super(ci); + this.extractType = constants$2.Constants.SYS_UNIT_TEMPERATURE; + this.suffixList = spanishNumericWithUnit.SpanishNumericWithUnit.TemperatureSuffixList; + this.prefixList = new Map(); + this.ambiguousUnitList = new Array(); + } +} +exports.SpanishTemperatureExtractorConfiguration = SpanishTemperatureExtractorConfiguration; +class SpanishTemperatureParserConfiguration extends base$2.SpanishNumberWithUnitParserConfiguration { + constructor(ci) { + if (!ci) { + ci = new recognizersTextNumber.CultureInfo(recognizersTextNumber.Culture.Spanish); + } + super(ci); + this.BindDictionary(spanishNumericWithUnit.SpanishNumericWithUnit.TemperatureSuffixList); + } +} +exports.SpanishTemperatureParserConfiguration = SpanishTemperatureParserConfiguration; + +}); + +unwrapExports(temperature$2); + +var dimension$2 = createCommonjsModule(function (module, exports) { +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); + + + + +class SpanishDimensionExtractorConfiguration extends base$2.SpanishNumberWithUnitExtractorConfiguration { + constructor(ci) { + if (!ci) { + ci = new recognizersTextNumber.CultureInfo(recognizersTextNumber.Culture.Spanish); + } + super(ci); + this.extractType = constants$2.Constants.SYS_UNIT_DIMENSION; + this.suffixList = spanishNumericWithUnit.SpanishNumericWithUnit.DimensionSuffixList; + this.prefixList = new Map(); + this.ambiguousUnitList = spanishNumericWithUnit.SpanishNumericWithUnit.AmbiguousDimensionUnitList; + } +} +exports.SpanishDimensionExtractorConfiguration = SpanishDimensionExtractorConfiguration; +class SpanishDimensionParserConfiguration extends base$2.SpanishNumberWithUnitParserConfiguration { + constructor(ci) { + if (!ci) { + ci = new recognizersTextNumber.CultureInfo(recognizersTextNumber.Culture.Spanish); + } + super(ci); + this.BindDictionary(spanishNumericWithUnit.SpanishNumericWithUnit.DimensionSuffixList); + } +} +exports.SpanishDimensionParserConfiguration = SpanishDimensionParserConfiguration; + +}); + +unwrapExports(dimension$2); + +var age$2 = createCommonjsModule(function (module, exports) { +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); + + + + +class SpanishAgeExtractorConfiguration extends base$2.SpanishNumberWithUnitExtractorConfiguration { + constructor(ci) { + if (!ci) { + ci = new recognizersTextNumber.CultureInfo(recognizersTextNumber.Culture.Spanish); + } + super(ci); + this.extractType = constants$2.Constants.SYS_UNIT_AGE; + this.suffixList = spanishNumericWithUnit.SpanishNumericWithUnit.AgeSuffixList; + this.prefixList = new Map(); + this.ambiguousUnitList = new Array(); + } +} +exports.SpanishAgeExtractorConfiguration = SpanishAgeExtractorConfiguration; +class SpanishAgeParserConfiguration extends base$2.SpanishNumberWithUnitParserConfiguration { + constructor(ci) { + if (!ci) { + ci = new recognizersTextNumber.CultureInfo(recognizersTextNumber.Culture.Spanish); + } + super(ci); + this.BindDictionary(spanishNumericWithUnit.SpanishNumericWithUnit.AgeSuffixList); + } +} +exports.SpanishAgeParserConfiguration = SpanishAgeParserConfiguration; + +}); + +unwrapExports(age$2); + +var portugueseNumericWithUnit = createCommonjsModule(function (module, exports) { +"use strict"; +// ------------------------------------------------------------------------------ +// +// This code was generated by a tool. +// Changes to this file may cause incorrect behavior and will be lost if +// the code is regenerated. +// +// ------------------------------------------------------------------------------ +Object.defineProperty(exports, "__esModule", { value: true }); +var PortugueseNumericWithUnit; +(function (PortugueseNumericWithUnit) { + PortugueseNumericWithUnit.AgeSuffixList = new Map([["Ano", "anos|ano"], ["Mês", "meses|mes|mês"], ["Semana", "semanas|semana"], ["Dia", "dias|dia"]]); + PortugueseNumericWithUnit.AreaSuffixList = new Map([["Quilômetro quadrado", "quilômetro quadrado|quilómetro quadrado|quilometro quadrado|quilômetros quadrados|quilómetros quadrados|quilomeros quadrados|km2|km^2|km²"], ["Hectare", "hectômetro quadrado|hectómetro quadrado|hectômetros quadrados|hectómetros cuadrados|hm2|hm^2|hm²|hectare|hectares"], ["Decâmetro quadrado", "decâmetro quadrado|decametro quadrado|decâmetros quadrados|decametro quadrado|dam2|dam^2|dam²|are|ares"], ["Metro quadrado", "metro quadrado|metros quadrados|m2|m^2|m²"], ["Decímetro quadrado", "decímetro quadrado|decimentro quadrado|decímetros quadrados|decimentros quadrados|dm2|dm^2|dm²"], ["Centímetro quadrado", "centímetro quadrado|centimetro quadrado|centímetros quadrados|centrimetros quadrados|cm2|cm^2|cm²"], ["Milímetro quadrado", "milímetro quadrado|milimetro quadrado|milímetros quadrados|militmetros quadrados|mm2|mm^2|mm²"], ["Polegada quadrada", "polegada quadrada|polegadas quadradas|in2|in^2|in²"], ["Pé quadrado", "pé quadrado|pe quadrado|pés quadrados|pes quadrados|pé2|pé^2|pé²|sqft|sq ft|ft2|ft^2|ft²"], ["Jarda quadrada", "jarda quadrada|jardas quadradas|yd2|yd^2|yd²"], ["Milha quadrada", "milha quadrada|milhas quadradas|mi2|mi^2|mi²"], ["Acre", "acre|acres"]]); + PortugueseNumericWithUnit.CurrencySuffixList = new Map([["Dólar", "dólar|dolar|dólares|dolares"], ["Peso", "peso|pesos"], ["Coroa", "coroa|coroas"], ["Rublo", "rublo|rublos"], ["Libra", "libra|libras"], ["Florim", "florim|florins|ƒ"], ["Dinar", "dinar|dinares"], ["Franco", "franco|francos"], ["Rupia", "rúpia|rupia|rúpias|rupias"], ["Escudo", "escudo|escudos"], ["Xelim", "xelim|xelins|xelims"], ["Lira", "lira|liras"], ["Centavo", "centavo|cêntimo|centimo|centavos|cêntimos|centimo"], ["Centésimo", "centésimo|centésimos"], ["Pêni", "pêni|péni|peni|penies|pennies"], ["Manat", "manat|manate|mánate|man|manats|manates|mánates"], ["Euro", "euro|euros|€|eur"], ["Centavo de Euro", "centavo de euro|cêntimo de euro|centimo de euro|centavos de euro|cêntimos de euro|centimos de euro"], ["Dólar do Caribe Oriental", "dólar do Caribe Oriental|dolar do Caribe Oriental|dólares do Caribe Oriental|dolares do Caribe Oriental|dólar das Caraíbas Orientais|dolar das Caraibas Orientais|dólares das Caraíbas Orientais|dolares das Caraibas Orientais|ec$|xcd"], ["Centavo do Caribe Oriental", "centavo do Caribe Oriental|centavo das Caraíbas Orientais|cêntimo do Caribe Oriental|cêntimo das Caraíbas Orientais|centavos do Caribe Oriental|centavos das Caraíbas Orientais|cêntimos do Caribe Oriental|cêntimos das Caraíbas Orientais"], ["Franco CFA da África Ocidental", "franco CFA da África Ocidental|franco CFA da Africa Ocidental|francos CFA da África Occidental|francos CFA da Africa Occidental|franco CFA Ocidental|xof"], ["Centavo de CFA da África Ocidental", "centavo de CFA da Africa Occidental|centavos de CFA da África Ocidental|cêntimo de CFA da Africa Occidental|cêntimos de CFA da África Ocidental"], ["Franco CFA da África Central", "franco CFA da África Central|franco CFA da Africa Central|francos CFA da África Central|francos CFA da Africa Central|franco CFA central|xaf"], ["Centavo de CFA da África Central", "centavo de CFA de África Central|centavos de CFA da África Central|cêntimo de CFA de África Central|cêntimos de CFA da África Central"], ["Apsar abcásio", "apsar abcásio|apsar abecásio|apsar abcasio|apsar|apsares"], ["Afegani afegão", "afegani afegão|afegane afegão|؋|afn|afegane|afgane|afegâni|afeganis|afeganes|afganes|afegânis"], ["Pul", "pul|pules|puls"], ["Lek albanês", "lek|lekë|lekes|lek albanês|leque|leques|all"], ["Qindarke", "qindarka|qindarkë|qindarke|qindarkas"], ["Kwanza angolano", "kwanza angolano|kwanzas angolanos|kwanza|kwanzas|aoa|kz"], ["Cêntimo angolano", "cêntimo angolano|cêntimo|cêntimos"], ["Florim das Antilhas Holandesas", "florim das antilhas holandesas|florim das antilhas neerlandesas|ang"], ["Rial saudita", "rial saudita|riais sauditas|riyal saudita|riyals sauditas|riyal|riyals|sar"], ["Halala saudita", "halala saudita|halala|hallalah"], ["Dinar argelino", "dinar argelino|dinares argelinos|dzd"], ["Cêntimo argelino", "centimo argelino|centimos argelinos|cêntimo argelino|cêntimos argelinos|centavo argelino|centavos argelinos"], ["Peso argentino", "peso argentino|pesos argentinos|peso|pesos|ar$|ars"], ["Centavo argentino", "centavo argentino|centavos argentinos|centavo|ctvo.|ctvos."], ["Dram armênio", "dram armênio|dram armênios|dram arménio|dram arménios|dram armenio|dram armenios|dram|drame|drames|դր."], ["Luma armênio", "luma armênio|lumas armênios|luma arménio|lumas arménios|luma armenio|lumas armenios|luma|lumas"], ["Florim arubano", "florín arubeño|florines arubeños|ƒ arubeños|aƒ|awg"], ["Dólar australiano", "dólar australiano|dólares australianos|dolar australiano|dolares australianos|a$|aud"], ["Centavo australiano", "centavo australiano|centavos australianos"], ["Manat azeri", "manat azeri|manats azeris|azn|manat azerbaijanês|manat azerbaijano|manats azerbaijaneses|manats azerbaijanos"], ["Qəpik azeri", "qəpik azeri|qəpik|qəpiks"], ["Dólar bahamense", "dólar bahamense|dólares bahamense|dolar bahamense|dolares bahamense|dólar baamiano|dólares baamiano|dolar baamiano|dolares baamiano|b$|bsd"], ["Centavo bahamense", "centavo bahamense|centavos bahamense"], ["Dinar bareinita", "dinar bareinita|dinar baremita|dinares bareinitas|dinares baremitas|bhd"], ["Fil bareinita", "fil bareinita|fil baremita|fils bareinitas|fils baremitas"], ["Taka bengali", "taka bengali|takas bengalis|taca|tacas|taka|takas|bdt"], ["Poisha bengali", "poisha bengali|poishas bengalis"], ["Dólar de Barbados", "dólar de barbados|dólares de barbados|dolar de barbados|dolares de barbados|dólar dos barbados|dólares dos barbados|bbd"], ["Centavo de Barbados", "centavo de barbados|centavos de barbados|centavo dos barbados|centavos dos barbados"], ["Dólar de Belize", "dólar de belize|dólares de belize|dolar de belize|dolares de belize|dólar do belize|dólares do belize|dolar do belize|dolares do belize|bz$|bzd"], ["Centavo de Belize", "centavo de belize|centavos de belize|cêntimo do belize|cêntimos do belize"], ["Dólar bermudense", "dólar bermudense|dólares bermudenses|bd$|bmd"], ["Centavo bermudense", "centavo bermudense|centavos bermudenses|cêntimo bermudense| cêntimos bermudenses"], ["Rublo bielorrusso", "rublo bielorrusso|rublos bielorrussos|br|byr"], ["Copeque bielorusso", "copeque bielorrusso|copeques bielorrussos|kopek bielorrusso|kopeks bielorrussos|kap"], ["Quiate mianmarense", "quiate mianmarense|quiates mianmarenses|kyat mianmarense|kyates mianmarenses|quiate myanmarense|quiates myanmarenses|kyat myanmarense|kyates myanmarenses|quiate birmanês|quite birmanes|quiates birmaneses|kyat birmanês|kyat birmanes|kyates birmaneses|mmk"], ["Pya mianmarense", "pya mianmarense|pyas mianmarenses|pya myanmarense|pyas myanmarenses|pya birmanês|pya birmanes|pyas birmaneses"], ["Boliviano", "boliviano|bolivianos|bob|bs"], ["Centavo Boliviano", "centavo boliviano|centavos bolivianos"], ["Marco da Bósnia e Herzegovina", "marco conversível|marco conversivel|marco convertível|marco convertivel|marcos conversíveis|marcos conversiveis|marcos convertíveis|marcos convertivies|bam"], ["Fening da Bósnia e Herzegovina", "fening conversível|fening conversivel|fening convertível|fening convertivel|fenings conversíveis|fenings conversiveis|fenings convertíveis|fenings convertiveis"], ["Pula", "pula|pulas|bwp"], ["Thebe", "thebe|thebes"], ["Real brasileiro", "real brasileiro|real do brasil|real|reais brasileiros|reais do brasil|reais|r$|brl"], ["Centavo brasileiro", "centavo de real|centavo brasileiro|centavos de real|centavos brasileiros"], ["Dólar de Brunei", "dólar de brunei|dolar de brunei|dólar do brunei|dolar do brunei|dólares de brunéi|dolares de brunei|dólares do brunei|dolares do brunei|bnd"], ["Sen de Brunei", "sen de brunei|sen do brunei|sens de brunei|sens do brunei"], ["Lev búlgaro", "lev búlgaro|leve búlgaro|leves búlgaros|lev bulgaro|leve bulgaro|leves bulgaros|lv|bgn"], ["Stotinka búlgaro", "stotinka búlgaro|stotinki búlgaros|stotinka bulgaro|stotinki bulgaros"], ["Franco do Burundi", "franco do burundi|francos do burundi|fbu|fib"], ["Centavo Burundi", "centavo burundi|cêntimo burundi|centimo burundi|centavos burundi|cêntimo burundi|centimo burundi"], ["Ngultrum butanês", "ngultrum butanês|ngultrum butanes|ngúltrume butanês|ngultrume butanes|ngultrum butaneses|ngúltrumes butaneses|ngultrumes butaneses|btn"], ["Chetrum butanês", "chetrum butanês|chetrum butanes|chetrum butaneses"], ["Escudo cabo-verdiano", "escudo cabo-verdiano|escudos cabo-verdianos|cve"], ["Riel cambojano", "riel cambojano|riéis cambojanos|rieis cambojanos|khr"], ["Dólar canadense", "dólar canadense|dolar canadense|dólares canadenses|dolares canadenses|c$|cad"], ["Centavo canadense", "centavo canadense|centavos canadenses"], ["Peso chileno", "peso chileno|pesos chilenos|cpl"], ["Yuan chinês", "yuan chinês|yuan chines|yuans chineses|yuan|yuans|renminbi|rmb|cny|¥"], ["Peso colombiano", "peso colombiano|pesos colombianos|cop|col$"], ["Centavo colombiano", "centavo colombiano|centavos colombianos"], ["Franco comorense", "franco comorense|francos comorenses|kmf|₣"], ["Franco congolês", "franco congolês|franco congoles|francos congoleses|cdf"], ["Centavo congolês", "centavo congolês|centavo congoles|centavos congoleses|cêntimo congolês|centimo congoles|cêntimos congoleses|cêntimos congoleses"], ["Won norte-coreano", "won norte-coreano|wŏn norte-coreano|won norte-coreanos|wŏn norte-coreanos|kpw"], ["Chon norte-coreano", "chon norte-coreano|chŏn norte-coreano|chŏn norte-coreanos|chon norte-coreanos"], ["Won sul-coreano", "wŏn sul-coreano|won sul-coreano|wŏnes sul-coreanos|wones sul-coreanos|krw"], ["Jeon sul-coreano", "jeons sul-coreano|jeons sul-coreanos"], ["Colón costarriquenho", "colón costarriquenho|colon costarriquenho|colons costarriquenho|colones costarriquenhos|crc"], ["Kuna croata", "kuna croata|kunas croatas|hrk"], ["Lipa croata", "lipa croata|lipas croatas"], ["Peso cubano", "peso cubano|pesos cubanos|cup"], ["Peso cubano convertível", "peso cubano conversível|pesos cubanos conversíveis|peso cubano conversivel|pesos cubanos conversiveis|peso cubano convertível|pesos cubanos convertíveis|peso cubano convertivel|pesos cubanos convertiveis|cuc"], ["Coroa dinamarquesa", "coroa dinamarquesa|coroas dinamarquesas|dkk"], ["Libra egípcia", "libra egípcia|libra egipcia|libras egípcias|libras egipcias|egp|le"], ["Piastra egípcia", "piastra egípcia|piastra egipcia|pisastras egípcias|piastras egipcias"], ["Dirham dos Emirados Árabes Unidos", "dirham|dirhams|dirham dos emirados arabes unidos|aed|dhs"], ["Nakfa", "nakfa|nfk|ern"], ["Centavo de Nakfa", "cêntimo de nakfa|cêntimos de nakfa|centavo de nafka|centavos de nafka"], ["Peseta", "peseta|pesetas|pts.|ptas.|esp"], ["Dólar estadunidense", "dólar dos estados unidos|dolar dos estados unidos|dólar estadunidense|dólar americano|dólares dos estados unidos|dolares dos estados unidos|dólares estadunidenses|dólares americanos|dolar estadunidense|dolar americano|dolares estadunidenses|dolares americanos|usd|u$d|us$"], ["Coroa estoniana", "coroa estoniana|coroas estonianas|eek"], ["Senti estoniano", "senti estoniano|senti estonianos"], ["Birr etíope", "birr etíope|birr etiope|birr etíopes|birr etiopes|br|etb"], ["Santim etíope", "santim etíope|santim etiope|santim etíopes|santim etiopes"], ["Peso filipino", "peso filipino|pesos filipinos|php"], ["Marco finlandês", "marco finlandês|marco finlandes|marcos finlandeses"], ["Dólar fijiano", "dólar fijiano|dolar fijiano|dólares fijianos|dolares fijianos|fj$|fjd"], ["Centavo fijiano", "centavo fijiano|centavos fijianos"], ["Dalasi gambiano", "dalasi|gmd"], ["Bututs", "butut|bututs"], ["Lari georgiano", "lari georgiano|lari georgianos|gel"], ["Tetri georgiano", "tetri georgiano|tetri georgianos"], ["Cedi", "cedi|ghs|gh₵"], ["Pesewa", "pesewa"], ["Libra de Gibraltar", "libra de gibraltar|libras de gibraltar|gip"], ["Peni de Gibraltar", "peni de gibraltar|penies de gibraltar"], ["Quetzal guatemalteco", "quetzal guatemalteco|quetzales guatemaltecos|quetzal|quetzales|gtq"], ["Centavo guatemalteco", "centavo guatemalteco|centavos guatemaltecos"], ["Libra de Guernsey", "libra de Guernsey|libras de Guernsey|ggp"], ["Peni de Guernsey", "peni de Guernsey|penies de Guernsey"], ["Franco da Guiné", "franco da guiné|franco da guine| franco guineense|francos da guiné|francos da guine|francos guineense|gnf|fg"], ["Centavo da Guiné", "cêntimo guineense|centimo guineense|centavo guineense|cêntimos guineenses|centimos guineenses|centavos guineenses"], ["Dólar guianense", "dólar guianense|dólares guianense|dolar guianense|dolares guianense|gyd|gy"], ["Gurde haitiano", "gurde haitiano|gourde|gurdes haitianos|htg"], ["Centavo haitiano", "cêntimo haitiano|cêntimos haitianos|centavo haitiano|centavos haitianos"], ["Lempira hondurenha", "lempira hondurenha|lempiras hondurenhas|lempira|lempiras|hnl"], ["Centavo hondurenho", "centavo hondurenho|centavos hondurehos|cêntimo hondurenho|cêntimos hondurenhos"], ["Dólar de Hong Kong", "dólar de hong kong|dolar de hong kong|dólares de hong kong|dolares de hong kong|hk$|hkd"], ["Florim húngaro", "florim húngaro|florim hungaro|florins húngaros|florins hungaros|forinte|forintes|huf"], ["Filér húngaro", "fillér|filér|filler|filer"], ["Rupia indiana", "rúpia indiana|rupia indiana|rupias indianas|inr"], ["Paisa indiana", "paisa indiana|paisas indianas"], ["Rupia indonésia", "rupia indonesia|rupia indonésia|rupias indonesias|rupias indonésias|idr"], ["Sen indonésio", "send indonésio|sen indonesio|sen indonésios|sen indonesios"], ["Rial iraniano", "rial iraniano|riais iranianos|irr"], ["Dinar iraquiano", "dinar iraquiano|dinares iraquianos|iqd"], ["Fil iraquiano", "fil iraquiano|fils iraquianos|files iraquianos"], ["Libra manesa", "libra manesa|libras manesas|imp"], ["Peni manês", "peni manes|peni manês|penies maneses"], ["Coroa islandesa", "coroa islandesa|coroas islandesas|isk|íkr"], ["Aurar islandês", "aurar islandês|aurar islandes|aurar islandeses|eyrir"], ["Dólar das Ilhas Cayman", "dólar das ilhas cayman|dolar das ilhas cayman|dólar das ilhas caimão|dólares das ilhas cayman|dolares das ilhas cayman|dólares das ilhas caimão|ci$|kyd"], ["Dólar das Ilhas Cook", "dólar das ilhas cook|dolar das ilhas cook|dólares das ilhas cook|dolares das ilhas cook"], ["Coroa feroesa", "coroa feroesa|coroas feroesas|fkr"], ["Libra das Malvinas", "libra das malvinas|libras das malvinas|fk£|fkp"], ["Dólar das Ilhas Salomão", "dólar das ilhas salomão|dolar das ilhas salomao|dólares das ilhas salomão|dolares das ilhas salomao|sbd"], ["Novo shekel israelense", "novo shekel|novos shekeles|novo shequel|novo siclo|novo xéquel|shekeles novos|novos sheqalim|sheqalim novos|ils"], ["Agora", "agora|agorot"], ["Dólar jamaicano", "dólar jamaicano|dolar jamaicano|dólares jamaicanos|dolares jamaicanos|j$|ja$|jmd"], ["Yen", "yen|iene|yenes|ienes|jpy"], ["Libra de Jersey", "libra de Jersey|libras de Jersey|jep"], ["Dinar jordaniano", "dinar jordaniano|dinar jordano|dinares jordanianos|dinares jordanos|jd|jod"], ["Piastra jordaniana", "piastra jordaniana|piastra jordano|piastras jordanianas|piastra jordaniano|piastras jordanianos|piastras jordanos"], ["Tengue cazaque", "tenge|tengue|tengué|tengue cazaque|kzt"], ["Tiyin", "tiyin|tiyins"], ["Xelim queniano", "xelim queniano|xelins quenianos|ksh|kes"], ["Som quirguiz", "som quirguiz|som quirguizes|soms quirguizes|kgs"], ["Tyiyn", "tyiyn|tyiyns"], ["Dólar de Kiribati", "dólar de kiribati|dolar de kiribati|dólares de kiribati|dolares de kiribati"], ["Dinar kuwaitiano", "dinar kuwaitiano|dinar cuaitiano|dinares kuwaitiano|dinares cuaitianos|kwd"], ["Quipe laosiano", "quipe|quipes|kipe|kipes|kip|kip laosiano|kip laociano|kips laosianos|kips laocianos|lak"], ["Att laosiano", "at|att|att laosiano|att laosianos"], ["Loti do Lesoto", "loti|lóti|maloti|lotis|lótis|lsl"], ["Sente", "sente|lisente"], ["Libra libanesa", "libra libanesa|libras libanesas|lbp"], ["Dólar liberiano", "dólar liberiano|dolar liberiano|dólares liberianos|dolares liberianos|l$|lrd"], ["Dinar libio", "dinar libio|dinar líbio|dinares libios|dinares líbios|ld|lyd"], ["Dirham libio", "dirham libio|dirhams libios|dirham líbio|dirhams líbios"], ["Litas lituana", "litas lituana|litai lituanas|ltl"], ["Pataca macaense", "pataca macaense|patacas macaenses|mop$|mop"], ["Avo macaense", "avo macaense|avos macaenses"], ["Ho macaense", "ho macaense|ho macaenses"], ["Dinar macedônio", "denar macedonio|denare macedonios|denar macedônio|denar macedónio|denare macedônio|denare macedónio|dinar macedonio|dinar macedônio|dinar macedónio|dinares macedonios|dinares macedônios|dinares macedónios|den|mkd"], ["Deni macedônio", "deni macedonio|deni macedônio|deni macedónio|denis macedonios|denis macedônios|denis macedónios"], ["Ariary malgaxe", "ariai malgaxe|ariary malgaxe|ariary malgaxes|ariaris|mga"], ["Iraimbilanja", "iraimbilanja|iraimbilanjas"], ["Ringuite malaio", "ringgit malaio|ringgit malaios|ringgits malaios|ringuite malaio|ringuites malaios|rm|myr"], ["Sen malaio", "sen malaio|sen malaios|centavo malaio|centavos malaios|cêntimo malaio|cêntimos malaios"], ["Kwacha do Malawi", "kwacha|cuacha|quacha|mk|mwk"], ["Tambala", "tambala|tambalas|tambala malawi"], ["Rupia maldiva", "rupia maldiva|rupias maldivas|rupia das maldivas| rupias das maldivas|mvr"], ["Dirame marroquino", "dirame marroquino|dirham marroquinho|dirhams marroquinos|dirames marroquinos|mad"], ["Rupia maurícia", "rupia maurícia|rupia de Maurício|rupia mauricia|rupia de mauricio|rupias de mauricio|rupias de maurício|rupias mauricias|rupias maurícias|mur"], ["Uguia", "uguia|uguias|oguia|ouguiya|oguias|mro"], ["Kume", "kumes|kume|khoums"], ["Peso mexicano", "peso mexicano|pesos mexicanos|mxn"], ["Centavo mexicano", "centavo mexicano|centavos mexicanos"], ["Leu moldávio", "leu moldavo|lei moldavos|leu moldávio|leu moldavio|lei moldávios|lei moldavios|leus moldavos|leus moldavios|leus moldávios|mdl"], ["Ban moldávio", "ban moldavo|bani moldavos"], ["Tugrik mongol", "tugrik mongol|tugrik|tugriks mongóis|tugriks mongois|tug|mnt"], ["Metical moçambicao", "metical|metical moçambicano|metical mocambicano|meticais|meticais moçambicanos|meticais mocambicanos|mtn|mzn"], ["Dólar namibiano", "dólar namibiano|dólares namibianos|dolar namibio|dolares namibios|n$|nad"], ["Centavo namibiano", "centavo namibiano|centavos namibianos|centavo namibio|centavos namibianos"], ["Rupia nepalesa", "rupia nepalesa|rupias nepalesas|npr"], ["Paisa nepalesa", "paisa nepalesa|paisas nepalesas"], ["Córdova nicaraguense", "córdova nicaraguense|cordova nicaraguense|cordova nicaraguana|córdoba nicaragüense|córdobas nicaragüenses|cordobas nicaraguenses|córdovas nicaraguenses|cordovas nicaraguenses|córdovas nicaraguanasc$|nio"], ["Centavo nicaraguense", "centavo nicaragüense|centavos nicaraguenses|centavo nicaraguano|centavos nicaraguenses|centavo nicaraguano|centavos nicaraguanos"], ["Naira", "naira|ngn"], ["Kobo", "kobo"], ["Coroa norueguesa", "coroa norueguesa|coroas norueguesas|nok"], ["Franco CFP", "franco cfp|francos cfp|xpf"], ["Dólar neozelandês", "dólar neozelandês|dolar neozelandes|dólares neozelandeses|dolares neozelandeses|dólar da nova zelândia|dolar da nova zelandia|dólares da nova zelândia|dolares da nova zelandia|nz$|nzd"], ["Centavo neozelandês", "centavo neozelandês|centavo neozelandes|centavo da nova zelandia|centavo da nova zelândia|centavos da nova zelandia|centavos neozelandeses|centavos da nova zelândia"], ["Rial omanense", "rial omani|riais omanis|rial omanense|riais omanenses|omr"], ["Baisa omanense", "baisa omani|baisas omanis|baisa omanense|baisas omanenses"], ["Florim holandês", "florim holandês|florim holandes|florins holandeses|nlg"], ["Rupia paquistanesa", "rupia paquistanesa|rupias paquistanesas|pkr"], ["Paisa paquistanesa", "paisa paquistanesa|paisas paquistanesasas"], ["Balboa panamenho", "balboa panamenho|balboas panamenhos|balboa|pab|balboa panamense|balboas panamenses"], ["Centavo panamenho", "centavo panamenho|cêntimo panamenho|centavos panamenhos|cêntimos panamenhos|cêntimo panamense|cêntimos panamenses"], ["Kina", "kina|kina papuásia|kinas|kinas papuásias|pkg|pgk"], ["Toea", "toea"], ["Guarani", "guarani|guaranis|gs|pyg"], ["Novo Sol", "novo sol peruano|novos sóis peruanos|sol|soles|sóis|nuevo sol|pen|s#."], ["Centavo de sol", "cêntimo de sol|cêntimos de sol|centavo de sol|centavos de sol"], ["Złoty", "złoty|złotys|zloty|zlotys|zloti|zlotis|zlóti|zlótis|zlote|zł|pln"], ["Groszy", "groszy|grosz"], ["Rial catariano", "rial qatari|riais qataris|rial catarense|riais catarenses|rial catariano|riais catarianos|qr|qar"], ["Dirame catariano", "dirame catariano|dirames catarianos|dirame qatari|dirames qataris|dirame catarense|dirames catarenses|dirham qatari|dirhams qataris|dirham catarense|dirhams catarenses|dirham catariano|dirhams catariano"], ["Libra esterlina", "libra esterlina|libras esterlinas|gbp"], ["Coroa checa", "coroa checa|coroas checas|kc|czk"], ["Peso dominicano", "peso dominicano|pesos dominicanos|rd$|dop"], ["Centavo dominicano", "centavo dominicano|centavos dominicanos"], ["Franco ruandês", "franco ruandês|franco ruandes|francos ruandeses|rf|rwf"], ["Céntimo ruandês", "cêntimo ruandês|centimo ruandes|centavo ruandês|centavo ruandes|cêntimos ruandeses|centimos ruandeses|centavos ruandeses"], ["Leu romeno", "leu romeno|lei romenos|leus romenos|ron"], ["Ban romeno", "ban romeno|bani romeno|bans romenos"], ["Rublo russo", "rublo russo|rublos russos|rub|р."], ["Copeque ruso", "copeque russo|copeques russos|kopek ruso|kopeks rusos|copeque|copeques|kopek|kopeks"], ["Tala samoano", "tala|tālā|talas|tala samonano|talas samoanos|ws$|sat|wst"], ["Sene samoano", "sene"], ["Libra de Santa Helena", "libra de santa helena|libras de santa helena|shp"], ["Pêni de Santa Helena", "peni de santa helena|penies de santa helena"], ["Dobra", "dobra|dobras|db|std"], ["Dinar sérvio", "dinar sérvio|dinar servio|dinar serbio|dinares sérvios|dinares servios|dinares serbios|rsd"], ["Para sérvio", "para sérvio|para servio|para serbio|paras sérvios|paras servios|paras serbios"], ["Rupia seichelense", "rupia de seicheles|rupias de seicheles|rupia seichelense|rupias seichelenses|scr"], ["Centavo seichelense", "centavo de seicheles|centavos de seicheles|centavo seichelense|centavos seichelenses"], ["Leone serra-leonino", "leone|leones|leone serra-leonino|leones serra-leoninos|le|sll"], ["Dólar de Cingapura", "dólar de singapura|dolar de singapura|dórar de cingapura|dolar de cingapura|dólares de singapura|dolares de singapura|dólares de cingapura|dolares de cingapura|sgb"], ["Centavo de Cingapura", "centavo de singapura|centavos de singapura|centavo de cingapura|centavos de cingapura"], ["Libra síria", "libra síria|libra siria|libras sírias|libras sirias|s£|syp"], ["Piastra síria", "piastra siria|piastras sirias|piastra síria|piastras sírias"], ["Xelim somali", "xelim somali|xelins somalis|xelim somaliano|xelins somalianos|sos"], ["Centavo somali", "centavo somapli|centavos somalis|centavo somaliano|centavos somalianos"], ["Xelim da Somalilândia", "xelim da somalilândia|xelins da somalilândia|xelim da somalilandia|xelins da somalilandia"], ["Centavo da Somalilândia", "centavo da somalilândia|centavos da somalilândia|centavo da somalilandia|centavos da somalilandia"], ["Rupia do Sri Lanka", "rupia do sri lanka|rupia do sri lanca|rupias do sri lanka|rupias do sri lanca|rupia cingalesa|rupias cingalesas|lkr"], ["Lilangeni", "lilangeni|lilangenis|emalangeni|szl"], ["Rand sul-africano", "rand|rand sul-africano|rands|rands sul-africanos|zar"], ["Libra sudanesa", "libra sudanesa|libras sudanesas|sdg"], ["Piastra sudanesa", "piastra sudanesa|piastras sudanesas"], ["Libra sul-sudanesa", "libra sul-sudanesa|libras sul-sudanesas|ssp"], ["Piastra sul-sudanesa", "piastra sul-sudanesa|piastras sul-sudanesas"], ["Coroa sueca", "coroa sueca|coroas suecas|sek"], ["Franco suíço", "franco suíço|franco suico|francos suíços|francos suicos|sfr|chf"], ["Rappen suíço", "rappen suíço|rappen suico|rappens suíços|rappens suicos"], ["Dólar surinamês", "dólar surinamês|dolar surinames|dólar do Suriname|dolar do Suriname|dólares surinameses|dolares surinameses|dólares do Suriname|dolares do Suriname|srd"], ["Centavo surinamês", "centavo surinamês|centavo surinames|centavos surinameses"], ["Baht tailandês", "baht tailandês|bath tailandes|baht tailandeses|thb"], ["Satang tailandês", "satang tailandês|satang tailandes|satang tailandeses"], ["Novo dólar taiwanês", "novo dólar taiwanês|novo dolar taiwanes|dólar taiwanês|dolar taiwanes|dólares taiwaneses|dolares taiwaneses|twd"], ["Centavo taiwanês", "centavo taiwanês|centavo taiwanes|centavos taiwaneses"], ["Xelim tanzaniano", "xelim tanzaniano|xelins tanzanianos|tzs"], ["Centavo tanzaniano", "centavo tanzaniano|centavos tanzanianos"], ["Somoni tajique", "somoni tajique|somoni|somonis tajiques|somonis|tjs"], ["Diram tajique", "diram tajique|dirams tajiques|dirames tajiques"], ["Paʻanga", "paanga|paangas|paʻanga|pa'anga|top"], ["Seniti", "seniti"], ["Rublo transdniestriano", "rublo transdniestriano|rublos transdniestriano"], ["Copeque transdniestriano", "copeque transdniestriano|copeques transdniestriano"], ["Dólar de Trinidade e Tobago", "dólar de trinidade e tobago|dólares trinidade e tobago|dolar de trinidade e tobago|dolares trinidade e tobago|dólar de trinidad e tobago|dólares trinidad e tobago|ttd"], ["Centavo de Trinidade e Tobago", "centavo de trinidade e tobago|centavos de trinidade e tobago|centavo de trinidad e tobago|centavos de trinidad e tobago"], ["Dinar tunisiano", "dinar tunisiano|dinares tunisianos|dinar tunisino|dinares tunisinos|tnd"], ["Milim tunisiano", "milim tunisiano|milim tunesianos|millime tunisianos|millimes tunisianos|milim tunisino|milim tunisinos|millime tunisinos|millimes tunisinos"], ["Lira turca", "lira turca|liras turcas|try"], ["Kuruş turco", "kuruş turco|kuruş turcos"], ["Manat turcomeno", "manat turcomeno|manats turcomenos|tmt"], ["Tennesi turcomeno", "tennesi turcomeno|tennesis turcomenos|tenge turcomenos|tenges turcomenos"], ["Dólar tuvaluano", "dólar tuvaluano|dolar tuvaluano|dólares tuvaluanos|dolares tuvaluanos"], ["Centavo tuvaluano", "centavo tuvaluano|centavos tuvaluanos"], ["Grívnia", "grívnia|grivnia|grívnias|grivnias|grivna|grivnas|uah"], ["Copeque ucraniano", "kopiyka|copeque ucraniano|copeques ucranianos"], ["Xelim ugandês", "xelim ugandês|xelim ugandes|xelins ugandeses|ugx"], ["Centavo ugandês", "centavo ugandês|centavo ugandes|centavos ugandeses"], ["Peso uruguaio", "peso uruguaio|pesos uruguayis|uyu"], ["Centésimo uruguayo", "centésimo uruguaio|centesimo uruguaio|centésimos uruguaios|centesimos uruguaios"], ["Som uzbeque", "som uzbeque|som uzbeques|soms uzbeques|somes uzbeques|som usbeque|som usbeques|soms usbeques|somes usbeques|uzs"], ["Tiyin uzbeque", "tiyin uzbeque|tiyin uzbeques|tiyins uzbeques|tiyin usbeque|tiyin usbeques|tiyins usbeques"], ["Vatu", "vatu|vatus|vuv"], ["Bolívar forte venezuelano", "bolívar forte|bolivar forte|bolívar|bolivar|bolívares|bolivares|vef"], ["Centavo de bolívar", "cêntimo de bolívar|cêntimos de bolívar|centavo de bolívar|centavo de bolivar|centavos de bolívar|centavos de bolivar"], ["Dongue vietnamita", "dongue vietnamita|Đồng vietnamita|dong vietnamita|dongues vietnamitas|dongs vietnamitas|vnd"], ["Hào vietnamita", "hào vietnamita|hao vietnamita|hào vietnamitas|hàos vietnamitas|haos vietnamitas"], ["Rial iemenita", "rial iemenita|riais iemenitas|yer"], ["Fils iemenita", "fils iemenita|fils iemenitas"], ["Franco djibutiano", "franco djibutiano|francos djibutianos|franco jibutiano|francos jibutianos|djf"], ["Dinar iugoslavo", "dinar iugoslavo|dinares iugoslavos|dinar jugoslavo|dinares jugoslavos|yud"], ["Kwacha zambiano", "kwacha zambiano|kwacha zambianos|kwachas zambianos|zmw"], ["Ngwee zambiano", "ngwee zambiano|ngwee zambianos|ngwees zambianos"]]); + PortugueseNumericWithUnit.CompoundUnitConnectorRegex = `(?[^.])`; + PortugueseNumericWithUnit.CurrencyPrefixList = new Map([["Dólar", "$"], ["Dólar estadunidense", "us$|u$d|usd"], ["Dólar do Caribe Oriental", "ec$|xcd"], ["Dólar australiano", "a$|aud"], ["Dólar bahamense", "b$|bsd"], ["Dólar de Barbados", "bds$|bbd"], ["Dólar de Belizebe", "bz$|bzd"], ["Dólar bermudense", "bd$|bmd"], ["Dólar de Brunebi", "brunéi $|bnd"], ["Dólar de Cingapura", "s$|sgd"], ["Dólar canadense", "c$|can$|cad"], ["Dólar das Ilhas Cayman", "ci$|kyd"], ["Dólar neozelandês", "nz$|nzd"], ["Dólar fijgiano", "fj$|fjd"], ["Dólar guianense", "gy$|gyd"], ["Dólar de Hong Kong", "hk$|hkd"], ["Dólar jamaicano", "j$|ja$|jmd"], ["Dólar liberiano", "l$|lrd"], ["Dólar namibiano", "n$|nad"], ["Dólar das Ilhas Salomão", "si$|sbd"], ["Novo dólar taiwanês", "nt$|twd"], ["Real brasileiro", "r$|brl"], ["Guarani", "₲|gs.|pyg"], ["Dólar de Trinidade e Tobago", "tt$|ttd"], ["Yuan chinês", "¥|cny|rmb"], ["Yen", "¥|jpy"], ["Euro", "€|eur"], ["Florim", "ƒ"], ["Libra", "£|gbp"], ["Colón costarriquenho", "₡"], ["Lira turca", "₺"]]); + PortugueseNumericWithUnit.AmbiguousCurrencyUnitList = ['le']; + PortugueseNumericWithUnit.InformationSuffixList = new Map([["bit", "bit|bits"], ["kilobit", "kilobit|kilobits|kb|kbit"], ["megabit", "megabit|megabits|Mb|Mbit"], ["gigabit", "gigabit|gigabits|Gb|Gbit"], ["terabit", "terabit|terabits|Tb|Tbit"], ["petabit", "petabit|petabits|Pb|Pbit"], ["kibibit", "kibibit|kibibits|kib|kibit"], ["mebibit", "mebibit|mebibits|Mib|Mibit"], ["gibibit", "gibibit|gibibits|Gib|Gibit"], ["tebibit", "tebibit|tebibits|Tib|Tibit"], ["pebibit", "pebibit|pebibits|Pib|Pibit"], ["byte", "byte|bytes"], ["kilobyte", "kilobyte|kilobytes|kB|kByte"], ["megabyte", "megabyte|megabytes|MB|MByte"], ["gigabyte", "gigabyte|gigabytes|GB|GByte"], ["terabyte", "terabyte|terabytes|TB|TByte"], ["petabyte", "petabyte|petabytes|PB|PByte"], ["kibibyte", "kibibyte|kibibytes|kiB|kiByte"], ["mebibyte", "mebibyte|mebibytes|MiB|MiByte"], ["gibibyte", "gibibyte|gibibytes|GiB|GiByte"], ["tebibyte", "tebibyte|tebibytes|TiB|TiByte"], ["pebibyte", "pebibyte|pebibytes|PiB|PiByte"]]); + PortugueseNumericWithUnit.AmbiguousDimensionUnitList = ['ton', 'tonelada', 'área', 'area', 'áreas', 'areas', 'milha', 'milhas']; + PortugueseNumericWithUnit.BuildPrefix = `(?<=(\\s|^|\\P{L}))`; + PortugueseNumericWithUnit.BuildSuffix = `(?=(\\s|\\P{L}|$))`; + PortugueseNumericWithUnit.ConnectorToken = 'de'; + PortugueseNumericWithUnit.LengthSuffixList = new Map([["Quilômetro", "km|quilometro|quilômetro|quilómetro|quilometros|quilômetros|quilómetros"], ["Hectômetro", "hm|hectometro|hectômetro|hectómetro|hectometros|hectômetros|hectómetros"], ["Decâmetro", "decametro|decâmetro|decámetro|decametros|decâmetro|decámetros|dam"], ["Metro", "m|m.|metro|metros"], ["Decímetro", "dm|decimetro|decímetro|decimetros|decímetros"], ["Centímetro", "cm|centimetro|centímetro|centimetros|centimetros"], ["Milímetro", "mm|milimetro|milímetro|milimetros|milímetros"], ["Micrômetro", "µm|um|micrometro|micrômetro|micrómetro|micrometros|micrômetros|micrómetros|micron|mícron|microns|mícrons|micra"], ["Nanômetro", "nm|nanometro|nanômetro|nanómetro|nanometros|nanômetros|nanómetros|milimicron|milimícron|milimicrons|milimícrons"], ["Picômetro", "pm|picometro|picômetro|picómetro|picometros|picômetros|picómetros"], ["Milha", "mi|milha|milhas"], ["Jarda", "yd|jarda|jardas"], ["Polegada", "polegada|polegadas|\""], ["Pé", "pé|pe|pés|pes|ft"], ["Ano luz", "ano luz|anos luz|al"]]); + PortugueseNumericWithUnit.AmbiguousLengthUnitList = ['mi', 'milha', 'milhas']; + PortugueseNumericWithUnit.SpeedSuffixList = new Map([["Metro por segundo", "metro/segundo|m/s|metro por segundo|metros por segundo|metros por segundos"], ["Quilômetro por hora", "km/h|quilômetro por hora|quilómetro por hora|quilometro por hora|quilômetros por hora|quilómetros por hora|quilometros por hora|quilômetro/hora|quilómetro/hora|quilometro/hora|quilômetros/hora|quilómetros/hora|quilometros/hora"], ["Quilômetro por minuto", "km/min|quilômetro por minuto|quilómetro por minuto|quilometro por minuto|quilômetros por minuto|quilómetros por minuto|quilometros por minuto|quilômetro/minuto|quilómetro/minuto|quilometro/minuto|quilômetros/minuto|quilómetros/minuto|quilometros/minuto"], ["Quilômetro por segundo", "km/seg|quilômetro por segundo|quilómetro por segundo|quilometro por segundo|quilômetros por segundo|quilómetros por segundo|quilometros por segundo|quilômetro/segundo|quilómetro/segundo|quilometro/segundo|quilômetros/segundo|quilómetros/segundo|quilometros/segundo"], ["Milha por hora", "mph|milha por hora|mi/h|milha/hora|milhas/hora|milhas por hora"], ["Nó", "kt|nó|nós|kn"], ["Pé por segundo", "ft/s|pé/s|pe/s|ft/seg|pé/seg|pe/seg|pé por segundo|pe por segundo|pés por segundo|pes por segundo"], ["Pé por minuto", "ft/min|pé/mind|pe/min|pé por minuto|pe por minuto|pés por minuto|pes por minuto"], ["Jarda por minuto", "jardas por minuto|jardas/minuto|jardas/min"], ["Jarda por segundo", "jardas por segundo|jardas/segundo|jardas/seg"]]); + PortugueseNumericWithUnit.AmbiguousSpeedUnitList = ['nó', 'no', 'nós', 'nos']; + PortugueseNumericWithUnit.TemperatureSuffixList = new Map([["Kelvin", "k|kelvin"], ["Grau Rankine", "r|°r|°ra|grau rankine|graus rankine| rankine"], ["Grau Celsius", "°c|grau c|grau celsius|graus c|graus celsius|celsius|grau centígrado|grau centrigrado|graus centígrados|graus centigrados|centígrado|centígrados|centigrado|centigrados"], ["Grau Fahrenheit", "°f|grau f|graus f|grau fahrenheit|graus fahrenheit|fahrenheit"], ["Grau", "°|graus|grau"]]); + PortugueseNumericWithUnit.VolumeSuffixList = new Map([["Quilômetro cúbico", "quilômetro cúbico|quilómetro cúbico|quilometro cubico|quilômetros cúbicos|quilómetros cúbicos|quilometros cubicos|km3|km^3|km³"], ["Hectômetro cúbico", "hectômetro cúbico|hectómetro cúbico|hectometro cubico|hectômetros cúbicos|hectómetros cúbicos|hectometros cubicos|hm3|hm^3|hm³"], ["Decâmetro cúbico", "decâmetro cúbico|decámetro cúbico|decametro cubico|decâmetros cúbicos|decámetros cúbicos|decametros cubicosdam3|dam^3|dam³"], ["Metro cúbico", "metro cúbico|metro cubico|metros cúbicos|metros cubicos|m3|m^3|m³"], ["Decímetro cúbico", "decímetro cúbico|decimetro cubico|decímetros cúbicos|decimetros cubicos|dm3|dm^3|dm³"], ["Centímetro cúbico", "centímetro cúbico|centimetro cubico|centímetros cúbicos|centrimetros cubicos|cc|cm3|cm^3|cm³"], ["Milímetro cúbico", "milímetro cúbico|milimetro cubico|milímetros cúbicos|milimetros cubicos|mm3|mm^3|mm³"], ["Polegada cúbica", "polegada cúbica|polegada cubica|polegadas cúbicas|polegadas cubicas"], ["Pé cúbico", "pé cúbico|pe cubico|pés cúbicos|pes cubicos|pé3|pe3|pé^3|pe^3|pé³|pe³|ft3|ft^3|ft³"], ["Jarda cúbica", "jarda cúbica|jarda cubica|jardas cúbicas|jardas cubicas|yd3|yd^3|yd³"], ["Hectolitro", "hectolitro|hectolitros|hl"], ["Litro", "litro|litros|lts|l"], ["Mililitro", "mililitro|mililitros|ml"], ["Galão", "galão|galões|galao|galoes"], ["Pint", "pinta|pintas|pinto|pintos|quartilho|quartilhos|pint|pints"], ["Barril", "barril|barris|bbl"], ["Onça líquida", "onça líquida|onca liquida|onças líquidas|oncas liquidas"]]); + PortugueseNumericWithUnit.WeightSuffixList = new Map([["Tonelada métrica", "tonelada métrica|tonelada metrica|toneladas métricas|toneladas metricas"], ["Tonelada", "ton|tonelada|toneladas"], ["Quilograma", "kg|quilograma|quilogramas|quilo|quilos|kilo|kilos"], ["Hectograma", "hg|hectograma|hectogramas"], ["Decagrama", "dag|decagrama|decagramas"], ["Grama", "g|gr|grama|gramas"], ["Decigrama", "dg|decigrama|decigramas"], ["Centigrama", "cg|centigrama|centigramas"], ["Miligrama", "mg|miligrama|miligramas"], ["Micrograma", "µg|ug|micrograma|microgramas"], ["Nanograma", "ng|nanograma|nanogramas"], ["Picograma", "pg|picograma|picogramas"], ["Libra", "lb|libra|libras"], ["Onça", "oz|onça|onca|onças|oncas"], ["Grão", "grão|grao|grãos|graos|gr"], ["Quilate", "ct|kt|quilate|quilates"]]); +})(PortugueseNumericWithUnit = exports.PortugueseNumericWithUnit || (exports.PortugueseNumericWithUnit = {})); + +}); + +unwrapExports(portugueseNumericWithUnit); + +var base$4 = createCommonjsModule(function (module, exports) { +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); + + + + + +class PortugueseNumberWithUnitExtractorConfiguration { + constructor(ci) { + this.cultureInfo = ci; + this.unitNumExtractor = new recognizersTextNumber.PortugueseNumberExtractor(); + this.buildPrefix = portugueseNumericWithUnit.PortugueseNumericWithUnit.BuildPrefix; + this.buildSuffix = portugueseNumericWithUnit.PortugueseNumericWithUnit.BuildSuffix; + this.connectorToken = portugueseNumericWithUnit.PortugueseNumericWithUnit.ConnectorToken; + this.compoundUnitConnectorRegex = recognizersText.RegExpUtility.getSafeRegExp(portugueseNumericWithUnit.PortugueseNumericWithUnit.CompoundUnitConnectorRegex); + this.pmNonUnitRegex = recognizersText.RegExpUtility.getSafeRegExp(baseUnits.BaseUnits.PmNonUnitRegex); + } +} +exports.PortugueseNumberWithUnitExtractorConfiguration = PortugueseNumberWithUnitExtractorConfiguration; +class PortugueseNumberWithUnitParserConfiguration extends parsers$4.BaseNumberWithUnitParserConfiguration { + constructor(ci) { + super(ci); + this.internalNumberExtractor = new recognizersTextNumber.PortugueseNumberExtractor(recognizersTextNumber.NumberMode.Default); + this.internalNumberParser = recognizersTextNumber.AgnosticNumberParserFactory.getParser(recognizersTextNumber.AgnosticNumberParserType.Number, new recognizersTextNumber.PortugueseNumberParserConfiguration()); + this.connectorToken = portugueseNumericWithUnit.PortugueseNumericWithUnit.ConnectorToken; + } +} +exports.PortugueseNumberWithUnitParserConfiguration = PortugueseNumberWithUnitParserConfiguration; + +}); + +unwrapExports(base$4); + +var currency$4 = createCommonjsModule(function (module, exports) { +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); + + + + +class PortugueseCurrencyExtractorConfiguration extends base$4.PortugueseNumberWithUnitExtractorConfiguration { + constructor(ci) { + if (!ci) { + ci = new recognizersTextNumber.CultureInfo(recognizersTextNumber.Culture.Portuguese); + } + super(ci); + this.extractType = constants$2.Constants.SYS_UNIT_CURRENCY; + // Reference Source: https:// en.wikipedia.org/wiki/List_of_circulating_currencies + this.suffixList = portugueseNumericWithUnit.PortugueseNumericWithUnit.CurrencySuffixList; + this.prefixList = portugueseNumericWithUnit.PortugueseNumericWithUnit.CurrencyPrefixList; + this.ambiguousUnitList = portugueseNumericWithUnit.PortugueseNumericWithUnit.AmbiguousCurrencyUnitList; + } +} +exports.PortugueseCurrencyExtractorConfiguration = PortugueseCurrencyExtractorConfiguration; +class PortugueseCurrencyParserConfiguration extends base$4.PortugueseNumberWithUnitParserConfiguration { + constructor(ci) { + if (!ci) { + ci = new recognizersTextNumber.CultureInfo(recognizersTextNumber.Culture.Portuguese); + } + super(ci); + this.BindDictionary(portugueseNumericWithUnit.PortugueseNumericWithUnit.CurrencySuffixList); + this.BindDictionary(portugueseNumericWithUnit.PortugueseNumericWithUnit.CurrencyPrefixList); + } +} +exports.PortugueseCurrencyParserConfiguration = PortugueseCurrencyParserConfiguration; + +}); + +unwrapExports(currency$4); + +var temperature$4 = createCommonjsModule(function (module, exports) { +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); + + + + +class PortugueseTemperatureExtractorConfiguration extends base$4.PortugueseNumberWithUnitExtractorConfiguration { + constructor(ci) { + if (!ci) { + ci = new recognizersTextNumber.CultureInfo(recognizersTextNumber.Culture.Portuguese); + } + super(ci); + this.extractType = constants$2.Constants.SYS_UNIT_TEMPERATURE; + this.suffixList = portugueseNumericWithUnit.PortugueseNumericWithUnit.TemperatureSuffixList; + this.prefixList = new Map(); + this.ambiguousUnitList = new Array(); + } +} +exports.PortugueseTemperatureExtractorConfiguration = PortugueseTemperatureExtractorConfiguration; +class PortugueseTemperatureParserConfiguration extends base$4.PortugueseNumberWithUnitParserConfiguration { + constructor(ci) { + if (!ci) { + ci = new recognizersTextNumber.CultureInfo(recognizersTextNumber.Culture.Portuguese); + } + super(ci); + this.BindDictionary(portugueseNumericWithUnit.PortugueseNumericWithUnit.TemperatureSuffixList); + } +} +exports.PortugueseTemperatureParserConfiguration = PortugueseTemperatureParserConfiguration; + +}); + +unwrapExports(temperature$4); + +var dimension$4 = createCommonjsModule(function (module, exports) { +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); + + + + +const dimensionSuffixList = new Map([ + ...portugueseNumericWithUnit.PortugueseNumericWithUnit.InformationSuffixList, + ...portugueseNumericWithUnit.PortugueseNumericWithUnit.AreaSuffixList, + ...portugueseNumericWithUnit.PortugueseNumericWithUnit.LengthSuffixList, + ...portugueseNumericWithUnit.PortugueseNumericWithUnit.SpeedSuffixList, + ...portugueseNumericWithUnit.PortugueseNumericWithUnit.VolumeSuffixList, + ...portugueseNumericWithUnit.PortugueseNumericWithUnit.WeightSuffixList +]); +class PortugueseDimensionExtractorConfiguration extends base$4.PortugueseNumberWithUnitExtractorConfiguration { + constructor(ci) { + if (!ci) { + ci = new recognizersTextNumber.CultureInfo(recognizersTextNumber.Culture.Portuguese); + } + super(ci); + this.extractType = constants$2.Constants.SYS_UNIT_DIMENSION; + this.suffixList = dimensionSuffixList; + this.prefixList = new Map(); + this.ambiguousUnitList = portugueseNumericWithUnit.PortugueseNumericWithUnit.AmbiguousDimensionUnitList; + } +} +exports.PortugueseDimensionExtractorConfiguration = PortugueseDimensionExtractorConfiguration; +class PortugueseDimensionParserConfiguration extends base$4.PortugueseNumberWithUnitParserConfiguration { + constructor(ci) { + if (!ci) { + ci = new recognizersTextNumber.CultureInfo(recognizersTextNumber.Culture.Portuguese); + } + super(ci); + this.BindDictionary(dimensionSuffixList); + } +} +exports.PortugueseDimensionParserConfiguration = PortugueseDimensionParserConfiguration; + +}); + +unwrapExports(dimension$4); + +var age$4 = createCommonjsModule(function (module, exports) { +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); + + + + +class PortugueseAgeExtractorConfiguration extends base$4.PortugueseNumberWithUnitExtractorConfiguration { + constructor(ci) { + if (!ci) { + ci = new recognizersTextNumber.CultureInfo(recognizersTextNumber.Culture.Portuguese); + } + super(ci); + this.extractType = constants$2.Constants.SYS_UNIT_AGE; + this.suffixList = portugueseNumericWithUnit.PortugueseNumericWithUnit.AgeSuffixList; + this.prefixList = new Map(); + this.ambiguousUnitList = new Array(); + } +} +exports.PortugueseAgeExtractorConfiguration = PortugueseAgeExtractorConfiguration; +class PortugueseAgeParserConfiguration extends base$4.PortugueseNumberWithUnitParserConfiguration { + constructor(ci) { + if (!ci) { + ci = new recognizersTextNumber.CultureInfo(recognizersTextNumber.Culture.Portuguese); + } + super(ci); + this.BindDictionary(portugueseNumericWithUnit.PortugueseNumericWithUnit.AgeSuffixList); + } +} +exports.PortugueseAgeParserConfiguration = PortugueseAgeParserConfiguration; + +}); + +unwrapExports(age$4); + +var chineseNumericWithUnit = createCommonjsModule(function (module, exports) { +"use strict"; +// ------------------------------------------------------------------------------ +// +// This code was generated by a tool. +// Changes to this file may cause incorrect behavior and will be lost if +// the code is regenerated. +// +// ------------------------------------------------------------------------------ +Object.defineProperty(exports, "__esModule", { value: true }); +var ChineseNumericWithUnit; +(function (ChineseNumericWithUnit) { + ChineseNumericWithUnit.AgeAmbiguousValues = ['岁']; + ChineseNumericWithUnit.AgeSuffixList = new Map([["Year", "岁|周岁"], ["Month", "个月大|月大"], ["Week", "周大"], ["Day", "天大"]]); + ChineseNumericWithUnit.BuildPrefix = ''; + ChineseNumericWithUnit.BuildSuffix = ''; + ChineseNumericWithUnit.ConnectorToken = ''; + ChineseNumericWithUnit.CurrencySuffixList = new Map([["Afghan afghani", "阿富汗尼"], ["Pul", "普尔"], ["Euro", "欧元"], ["Cent", "美分"], ["Albanian lek", "阿尔巴尼亚列克|列克"], ["Angolan kwanza", "安哥拉宽扎|宽扎"], ["Armenian dram", "亚美尼亚德拉姆"], ["Aruban florin", "阿鲁巴弗罗林|阿鲁巴币"], ["Bangladeshi taka", "塔卡|孟加拉塔卡"], ["Paisa", "派萨|帕萨"], ["Bhutanese ngultrum", "不丹努尔特鲁姆|不丹努扎姆|努扎姆"], ["Chetrum", "切特鲁姆"], ["Bolivian boliviano", "玻利维亚诺|玻利维亚币"], ["Bosnia and Herzegovina convertible mark", "波斯尼亚和黑塞哥维那可兑换马克|波赫可兑换马克"], ["Botswana pula", "博茨瓦纳普拉|普拉"], ["Thebe", "thebe"], ["Brazilian real", "巴西雷亚尔"], ["Bulgarian lev", "保加利亚列弗|保加利亚列瓦"], ["Stotinka", "斯托丁卡"], ["Cambodian riel", "瑞尔"], ["Cape Verdean escudo", "佛得角埃斯库多|维德角埃斯库多"], ["Croatian kuna", "克罗地亚库纳|克罗地亚库那|克罗埃西亚库纳"], ["Lipa", "利巴"], ["Eritrean nakfa", "厄立特里亚纳克法"], ["Ethiopian birr", "埃塞俄比亚比尔|埃塞俄比亚元"], ["Gambian dalasi", "冈比亚达拉西|甘比亚达拉西"], ["Butut", "布达|布图"], ["Georgian lari", "格鲁吉亚拉里"], ["Tetri", "特特里|泰特里"], ["Ghanaian cedi", "塞地|加纳塞地"], ["Pesewa", "比塞瓦"], ["Guatemalan quetzal", "瓜地马拉格查尔"], ["Haitian gourde", "海地古德"], ["Honduran lempira", "洪都拉斯伦皮拉"], ["Hungarian forint", "匈牙利福林|匈牙利货币|匈牙利福林币"], ["Iranian rial", "伊朗里亚尔|伊朗莱尔"], ["Yemeni rial", "叶门莱尔|叶门里亚尔"], ["Israeli new shekel", "₪|ils|以色列币|以色列新克尔|谢克尔"], ["Japanese yen", "日元|日本元|日币|日圆"], ["Sen", "日本銭"], ["Kazakhstani tenge", "哈萨克斯坦坚戈"], ["Kenyan shilling", "肯尼亚先令"], ["North Korean won", "朝鲜圆|朝鲜元"], ["South Korean won", "韩元|韩圆"], ["Korean won", "₩"], ["Kyrgyzstani som", "吉尔吉斯斯坦索姆"], ["Lao kip", "基普|老挝基普|老挝币"], ["Att", "att"], ["Lesotho loti", "莱索托洛提|莱索托马洛蒂"], ["South African rand", "南非兰特"], ["Macedonian denar", "马其顿代纳尔|马其顿币|第纳尔|代纳尔"], ["Deni", "第尼"], ["Malagasy ariary", "马达加斯加阿里亚里"], ["Iraimbilanja", "伊莱姆比拉贾"], ["Malawian kwacha", "马拉威克瓦查"], ["Tambala", "坦巴拉"], ["Malaysian ringgit", "马来西亚币|马币|马来西亚林吉特"], ["Mauritanian ouguiya", "毛里塔尼亚乌吉亚"], ["Khoums", "库姆斯"], ["Mozambican metical", "莫桑比克梅蒂卡尔|梅蒂卡尔"], ["Burmese kyat", "缅甸元|缅元"], ["Pya", "缅分"], ["Nigerian naira", "尼日利亚奈拉|尼日利亚币|奈拉"], ["Kobo", "考包"], ["Turkish lira", "土耳其里拉"], ["Kuruş", "库鲁"], ["Omani rial", "阿曼里亚尔|阿曼莱尔"], ["Panamanian balboa", "巴拿马巴波亚"], ["Centesimo", "意大利分|乌拉圭分|巴拿马分"], ["Papua New Guinean kina", "基那"], ["Toea", "托亚|托伊"], ["Peruvian sol", "秘鲁索尔"], ["Polish złoty", "波兰币|波兰兹罗提|兹罗提"], ["Grosz", "格罗希"], ["Qatari riyal", "卡达里亚尔"], ["Saudi riyal", "沙特里亚尔"], ["Riyal", "里亚尔|"], ["Dirham", "迪拉姆"], ["Halala", "哈拉"], ["Samoan tālā", "萨摩亚塔拉"], ["Sierra Leonean leone", "塞拉利昂利昂|利昂"], ["Peseta", "比塞塔|西班牙比塞塔|西班牙币"], ["Swazi lilangeni", "斯威士兰里兰吉尼|兰吉尼"], ["Tajikistani somoni", "塔吉克斯坦索莫尼"], ["Thai baht", "泰铢|泰元"], ["Satang", "萨当"], ["Tongan paʻanga", "汤加潘加|潘加"], ["Ukrainian hryvnia", "乌克兰格里夫纳|格里夫纳"], ["Vanuatu vatu", "瓦努阿图瓦图"], ["Vietnamese dong", "越南盾"], ["Indonesian rupiah", "印度尼西亚盾"], ["Netherlands guilder", "荷兰盾|荷属安的列斯盾|列斯盾"], ["Surinam florin", "苏里南盾"], ["Guilder", "盾"], ["Zambian kwacha", "赞比亚克瓦查"], ["Moroccan dirham", "摩洛哥迪拉姆"], ["United Arab Emirates dirham", "阿联酋迪拉姆"], ["Azerbaijani manat", "阿塞拜疆马纳特"], ["Turkmenistan manat", "土库曼马纳特"], ["Manat", "马纳特"], ["Somali shilling", "索马里先令|索马利先令"], ["Somaliland shilling", "索马里兰先令"], ["Tanzanian shilling", "坦桑尼亚先令"], ["Ugandan shilling", "乌干达先令"], ["Romanian leu", "罗马尼亚列伊"], ["Moldovan leu", "摩尔多瓦列伊"], ["Leu", "列伊"], ["Ban", "巴尼"], ["Nepalese rupee", "尼泊尔卢比"], ["Pakistani rupee", "巴基斯坦卢比"], ["Indian rupee", "印度卢比"], ["Seychellois rupee", "塞舌尔卢比"], ["Mauritian rupee", "毛里求斯卢比"], ["Maldivian rufiyaa", "马尔代夫卢比"], ["Sri Lankan rupee", "斯里兰卡卢比"], ["Rupee", "卢比"], ["Czech koruna", "捷克克朗"], ["Danish krone", "丹麦克朗|丹麦克郎"], ["Norwegian krone", "挪威克朗"], ["Faroese króna", "法罗克朗"], ["Icelandic króna", "冰岛克朗"], ["Swedish krona", "瑞典克朗"], ["Krone", "克朗"], ["Øre", "奥依拉|奥拉|埃利"], ["West African CFA franc", "非共体法郎"], ["Central African CFA franc", "中非法郎|中非金融合作法郎"], ["Comorian franc", "科摩罗法郎"], ["Congolese franc", "刚果法郎"], ["Burundian franc", "布隆迪法郎"], ["Djiboutian franc", "吉布提法郎"], ["CFP franc", "太平洋法郎"], ["Guinean franc", "几内亚法郎"], ["Swiss franc", "瑞士法郎"], ["Rwandan franc", "卢旺达法郎"], ["Belgian franc", "比利时法郎"], ["Rappen", "瑞士分|瑞士生丁"], ["Franc", "法郎"], ["Centime", "生丁|仙士"], ["Russian ruble", "俄国卢布|俄罗斯卢布"], ["Transnistrian ruble", "德涅斯特卢布"], ["Belarusian ruble", "白俄罗斯卢布"], ["Kopek", "戈比"], ["Ruble", "卢布"], ["Algerian dinar", "阿尔及利亚第纳尔"], ["Bahraini dinar", "巴林第纳尔"], ["Iraqi dinar", "伊拉克第纳尔|"], ["Jordanian dinar", "约旦第纳尔"], ["Kuwaiti dinar", "科威特第纳尔|科威特币"], ["Libyan dinar", "利比亚第纳尔"], ["Serbian dinar", "塞尔维亚第纳尔|塞尔维亚币"], ["Tunisian dinar", "突尼斯第纳尔"], ["Dinar", "第纳尔"], ["Fils", "费尔"], ["Para", "帕拉"], ["Millime", "米利姆"], ["Argentine peso", "阿根廷比索"], ["Chilean peso", "智利比索"], ["Colombian peso", "哥伦比亚比索"], ["Cuban peso", "古巴比索"], ["Dominican peso", "多米尼加比索"], ["Mexican peso", "墨西哥比索"], ["Philippine peso", "菲律宾比索"], ["Uruguayan peso", "乌拉圭比索"], ["Peso", "比索"], ["Centavo", "仙|菲辅币"], ["Alderney pound", "奥尔德尼镑"], ["British pound", "英镑"], ["Guernsey pound", "根西镑"], ["Saint Helena pound", "圣赫勒拿镑"], ["Egyptian pound", "埃及镑"], ["Falkland Islands pound", "福克兰镑"], ["Gibraltar pound", "直布罗陀镑"], ["Manx pound", "马恩岛镑"], ["Jersey pound", "泽西岛镑"], ["Lebanese pound", "黎巴嫩镑"], ["South Sudanese pound", "南苏丹镑"], ["Sudanese pound", "苏丹镑"], ["Syrian pound", "叙利亚镑"], ["Pound", "英镑"], ["Pence", "便士"], ["Shilling", "先令"], ["United States dollar", "美元|美金|美圆"], ["East Caribbean dollar", "东加勒比元"], ["Australian dollar", "澳大利亚元|澳元"], ["Bahamian dollar", "巴哈马元"], ["Barbadian dollar", "巴巴多斯元"], ["Belize dollar", "伯利兹元"], ["Bermudian dollar", "百慕大元"], ["Brunei dollar", "文莱元"], ["Singapore dollar", "新加坡元|新元"], ["Canadian dollar", "加元|加拿大元"], ["Cayman Islands dollar", "开曼岛元|"], ["New Zealand dollar", "新西兰元|纽元"], ["Cook Islands dollar", "库克群岛元"], ["Fijian dollar", "斐济元|斐币"], ["Guyanese dollar", "圭亚那元"], ["Hong Kong dollar", "蚊|港元|港圆|港币"], ["Macau Pataca", "澳元|澳门币|澳门元"], ["New Taiwan dollar", "箍|新台币|台币"], ["Jamaican dollar", "牙买加元"], ["Kiribati dollar", "吉里巴斯元"], ["Liberian dollar", "利比里亚元"], ["Namibian dollar", "纳米比亚元"], ["Surinamese dollar", "苏里南元"], ["Trinidad and Tobago dollar", "特立尼达多巴哥元"], ["Tuvaluan dollar", "吐瓦鲁元"], ["Chinese yuan", "人民币|人民币元|块钱|块|元|圆"], ["Fen", "分钱|分"], ["Jiao", "毛钱|毛|角钱|角"], ["Finnish markka", "芬兰马克"], ["Penni", "盆尼"]]); + ChineseNumericWithUnit.CurrencyNameToIsoCodeMap = new Map([["Afghan afghani", "AFN"], ["Euro", "EUR"], ["Albanian lek", "ALL"], ["Angolan kwanza", "AOA"], ["Armenian dram", "AMD"], ["Aruban florin", "AWG"], ["Bangladeshi taka", "BDT"], ["Bhutanese ngultrum", "BTN"], ["Bolivian boliviano", "BOB"], ["Bosnia and Herzegovina convertible mark", "BAM"], ["Botswana pula", "BWP"], ["Brazilian real", "BRL"], ["Bulgarian lev", "BGN"], ["Cambodian riel", "KHR"], ["Cape Verdean escudo", "CVE"], ["Costa Rican colón", "CRC"], ["Croatian kuna", "HRK"], ["Czech koruna", "CZK"], ["Eritrean nakfa", "ERN"], ["Ethiopian birr", "ETB"], ["Gambian dalasi", "GMD"], ["Georgian lari", "GEL"], ["Ghanaian cedi", "GHS"], ["Guatemalan quetzal", "GTQ"], ["Haitian gourde", "HTG"], ["Honduran lempira", "HNL"], ["Hungarian forint", "HUF"], ["Iranian rial", "IRR"], ["Yemeni rial", "YER"], ["Israeli new shekel", "ILS"], ["Japanese yen", "JPY"], ["Kazakhstani tenge", "KZT"], ["Kenyan shilling", "KES"], ["North Korean won", "KPW"], ["South Korean won", "KRW"], ["Kyrgyzstani som", "KGS"], ["Lao kip", "LAK"], ["Lesotho loti", "LSL"], ["South African rand", "ZAR"], ["Macanese pataca", "MOP"], ["Macedonian denar", "MKD"], ["Malagasy ariary", "MGA"], ["Malawian kwacha", "MWK"], ["Malaysian ringgit", "MYR"], ["Mauritanian ouguiya", "MRO"], ["Mongolian tögrög", "MNT"], ["Mozambican metical", "MZN"], ["Burmese kyat", "MMK"], ["Nicaraguan córdoba", "NIO"], ["Nigerian naira", "NGN"], ["Turkish lira", "TRY"], ["Omani rial", "OMR"], ["Panamanian balboa", "PAB"], ["Papua New Guinean kina", "PGK"], ["Paraguayan guaraní", "PYG"], ["Peruvian sol", "PEN"], ["Polish złoty", "PLN"], ["Qatari riyal", "QAR"], ["Saudi riyal", "SAR"], ["Samoan tālā", "WST"], ["São Tomé and Príncipe dobra", "STD"], ["Sierra Leonean leone", "SLL"], ["Swazi lilangeni", "SZL"], ["Tajikistani somoni", "TJS"], ["Thai baht", "THB"], ["Ukrainian hryvnia", "UAH"], ["Vanuatu vatu", "VUV"], ["Venezuelan bolívar", "VEF"], ["Zambian kwacha", "ZMW"], ["Moroccan dirham", "MAD"], ["United Arab Emirates dirham", "AED"], ["Azerbaijani manat", "AZN"], ["Turkmenistan manat", "TMT"], ["Somali shilling", "SOS"], ["Tanzanian shilling", "TZS"], ["Ugandan shilling", "UGX"], ["Romanian leu", "RON"], ["Moldovan leu", "MDL"], ["Nepalese rupee", "NPR"], ["Pakistani rupee", "PKR"], ["Indian rupee", "INR"], ["Seychellois rupee", "SCR"], ["Mauritian rupee", "MUR"], ["Maldivian rufiyaa", "MVR"], ["Sri Lankan rupee", "LKR"], ["Indonesian rupiah", "IDR"], ["Danish krone", "DKK"], ["Norwegian krone", "NOK"], ["Icelandic króna", "ISK"], ["Swedish krona", "SEK"], ["West African CFA franc", "XOF"], ["Central African CFA franc", "XAF"], ["Comorian franc", "KMF"], ["Congolese franc", "CDF"], ["Burundian franc", "BIF"], ["Djiboutian franc", "DJF"], ["CFP franc", "XPF"], ["Guinean franc", "GNF"], ["Swiss franc", "CHF"], ["Rwandan franc", "RWF"], ["Russian ruble", "RUB"], ["Transnistrian ruble", "PRB"], ["Belarusian ruble", "BYN"], ["Algerian dinar", "DZD"], ["Bahraini dinar", "BHD"], ["Iraqi dinar", "IQD"], ["Jordanian dinar", "JOD"], ["Kuwaiti dinar", "KWD"], ["Libyan dinar", "LYD"], ["Serbian dinar", "RSD"], ["Tunisian dinar", "TND"], ["Argentine peso", "ARS"], ["Chilean peso", "CLP"], ["Colombian peso", "COP"], ["Cuban convertible peso", "CUC"], ["Cuban peso", "CUP"], ["Dominican peso", "DOP"], ["Mexican peso", "MXN"], ["Uruguayan peso", "UYU"], ["British pound", "GBP"], ["Saint Helena pound", "SHP"], ["Egyptian pound", "EGP"], ["Falkland Islands pound", "FKP"], ["Gibraltar pound", "GIP"], ["Manx pound", "IMP"], ["Jersey pound", "JEP"], ["Lebanese pound", "LBP"], ["South Sudanese pound", "SSP"], ["Sudanese pound", "SDG"], ["Syrian pound", "SYP"], ["United States dollar", "USD"], ["Australian dollar", "AUD"], ["Bahamian dollar", "BSD"], ["Barbadian dollar", "BBD"], ["Belize dollar", "BZD"], ["Bermudian dollar", "BMD"], ["Brunei dollar", "BND"], ["Singapore dollar", "SGD"], ["Canadian dollar", "CAD"], ["Cayman Islands dollar", "KYD"], ["New Zealand dollar", "NZD"], ["Fijian dollar", "FJD"], ["Guyanese dollar", "GYD"], ["Hong Kong dollar", "HKD"], ["Jamaican dollar", "JMD"], ["Liberian dollar", "LRD"], ["Namibian dollar", "NAD"], ["Solomon Islands dollar", "SBD"], ["Surinamese dollar", "SRD"], ["New Taiwan dollar", "TWD"], ["Trinidad and Tobago dollar", "TTD"], ["Tuvaluan dollar", "TVD"], ["Chinese yuan", "CNY"], ["Rial", "__RI"], ["Shiling", "__S"], ["Som", "__SO"], ["Dirham", "__DR"], ["Dinar", "_DN"], ["Dollar", "__D"], ["Manat", "__MA"], ["Rupee", "__R"], ["Krone", "__K"], ["Krona", "__K"], ["Crown", "__K"], ["Frank", "__F"], ["Mark", "__M"], ["Ruble", "__RB"], ["Peso", "__PE"], ["Pound", "__P"], ["Tristan da Cunha pound", "_TP"], ["South Georgia and the South Sandwich Islands pound", "_SP"], ["Somaliland shilling", "_SS"], ["Pitcairn Islands dollar", "_PND"], ["Palauan dollar", "_PD"], ["Niue dollar", "_NID"], ["Nauruan dollar", "_ND"], ["Micronesian dollar", "_MD"], ["Kiribati dollar", "_KID"], ["Guernsey pound", "_GGP"], ["Faroese króna", "_FOK"], ["Cook Islands dollar", "_CKD"], ["British Virgin Islands dollar", "_BD"], ["Ascension pound", "_AP"], ["Alderney pound", "_ALP"], ["Abkhazian apsar", "_AA"]]); + ChineseNumericWithUnit.FractionalUnitNameToCodeMap = new Map([["Jiao", "JIAO"], ["Kopek", "KOPEK"], ["Pul", "PUL"], ["Cent", "CENT"], ["Qindarkë", "QINDARKE"], ["Penny", "PENNY"], ["Santeem", "SANTEEM"], ["Cêntimo", "CENTIMO"], ["Centavo", "CENTAVO"], ["Luma", "LUMA"], ["Qəpik", "QƏPIK"], ["Fils", "FILS"], ["Poisha", "POISHA"], ["Kapyeyka", "KAPYEYKA"], ["Centime", "CENTIME"], ["Chetrum", "CHETRUM"], ["Paisa", "PAISA"], ["Fening", "FENING"], ["Thebe", "THEBE"], ["Sen", "SEN"], ["Stotinka", "STOTINKA"], ["Fen", "FEN"], ["Céntimo", "CENTIMO"], ["Lipa", "LIPA"], ["Haléř", "HALER"], ["Øre", "ØRE"], ["Piastre", "PIASTRE"], ["Santim", "SANTIM"], ["Oyra", "OYRA"], ["Butut", "BUTUT"], ["Tetri", "TETRI"], ["Pesewa", "PESEWA"], ["Fillér", "FILLER"], ["Eyrir", "EYRIR"], ["Dinar", "DINAR"], ["Agora", "AGORA"], ["Tïın", "TIIN"], ["Chon", "CHON"], ["Jeon", "JEON"], ["Tyiyn", "TYIYN"], ["Att", "ATT"], ["Sente", "SENTE"], ["Dirham", "DIRHAM"], ["Rappen", "RAPPEN"], ["Avo", "AVO"], ["Deni", "DENI"], ["Iraimbilanja", "IRAIMBILANJA"], ["Tambala", "TAMBALA"], ["Laari", "LAARI"], ["Khoums", "KHOUMS"], ["Ban", "BAN"], ["Möngö", "MONGO"], ["Pya", "PYA"], ["Kobo", "KOBO"], ["Kuruş", "KURUS"], ["Baisa", "BAISA"], ["Centésimo", "CENTESIMO"], ["Toea", "TOEA"], ["Sentimo", "SENTIMO"], ["Grosz", "GROSZ"], ["Sene", "SENE"], ["Halala", "HALALA"], ["Para", "PARA"], ["Öre", "ORE"], ["Diram", "DIRAM"], ["Satang", "SATANG"], ["Seniti", "SENITI"], ["Millime", "MILLIME"], ["Tennesi", "TENNESI"], ["Kopiyka", "KOPIYKA"], ["Tiyin", "TIYIN"], ["Hào", "HAO"], ["Ngwee", "NGWEE"]]); + ChineseNumericWithUnit.CompoundUnitConnectorRegex = `(?又|再)`; + ChineseNumericWithUnit.CurrencyPrefixList = new Map([["Dollar", "$"], ["United States dollar", "us$"], ["British Virgin Islands dollar", "bvi$"], ["Brunei dollar", "b$"], ["Sen", "sen"], ["Singapore dollar", "s$"], ["Canadian dollar", "can$|c$|c $"], ["Cayman Islands dollar", "ci$"], ["New Zealand dollar", "nz$|nz $"], ["Guyanese dollar", "gy$|gy $|g$|g $"], ["Hong Kong dollar", "hk$|hkd|hk $"], ["Jamaican dollar", "j$"], ["Namibian dollar", "nad|n$|n $"], ["Solomon Islands dollar", "si$|si $"], ["New Taiwan dollar", "nt$|nt $"], ["Samoan tālā", "ws$"], ["Chinese yuan", "¥"], ["Japanese yen", "¥"], ["Turkish lira", "₺"], ["Euro", "€"], ["Pound", "£"], ["Costa Rican colón", "₡"]]); + ChineseNumericWithUnit.CurrencyAmbiguousValues = ['元', '仙', '分', '圆', '块', '毛', '盾', '箍', '蚊', '角']; + ChineseNumericWithUnit.DimensionSuffixList = new Map([["Meter", "米|公尺|m"], ["Kilometer", "千米|公里|km"], ["Decimeter", "分米|公寸|dm"], ["Centimeter", "釐米|厘米|公分|cm"], ["Micrometer", "毫米|公釐|mm"], ["Microns", "微米"], ["Picometer", "皮米"], ["Nanometer", "纳米"], ["Li", "里|市里"], ["Zhang", "丈"], ["Chi", "市尺|尺"], ["Cun", "市寸|寸"], ["Fen", "市分|分"], ["Hao", "毫"], ["Mile", "英里"], ["Inch", "英寸"], ["Foot", "呎|英尺"], ["Yard", "码"], ["Knot", "海里"], ["Light year", "光年"], ["Meter per second", "米每秒|米/秒|m/s"], ["Kilometer per hour", "公里每小时|千米每小时|公里/小时|千米/小时|km/h"], ["Kilometer per minute", "公里每分钟|千米每分钟|公里/分钟|千米/分钟|km/min"], ["Kilometer per second", "公里每秒|千米每秒|公里/秒|千米/秒|km/s"], ["Mile per hour", "英里每小时|英里/小时"], ["Foot per second", "英尺每小时|英尺/小时"], ["Foot per minute", "英尺每分钟|英尺/分钟"], ["Yard per minute", "码每分|码/分"], ["Yard per second", "码每秒|码/秒"], ["Square centimetre", "平方厘米"], ["Square decimeter", "平方分米"], ["Square meter", "平方米"], ["Square kilometer", "平方公里"], ["Acre", "英亩|公亩"], ["Hectare", "公顷"], ["Mu", "亩|市亩"], ["Liter", "公升|升|l"], ["Milliliter", "毫升|ml"], ["Cubic meter", "立方米"], ["Cubic decimeter", "立方分米"], ["Cubic millimeter", "立方毫米"], ["Cubic feet", "立方英尺"], ["Gallon", "加仑"], ["Pint", "品脱"], ["Dou", "市斗|斗"], ["Dan", "市石|石"], ["Kilogram", "千克|公斤|kg"], ["Jin", "市斤|斤"], ["Milligram", "毫克|mg"], ["Barrel", "桶"], ["Pot", "罐"], ["Gram", "克|g"], ["Ton", "公吨|吨|t"], ["Pound", "磅"], ["Ounce", "盎司"], ["Bit", "比特|位|b"], ["Byte", "字节|byte"], ["Kilobyte", "千字节|kb"], ["Megabyte", "兆字节|mb"], ["Gigabyte", "十亿字节|千兆字节|gb"], ["Terabyte", "万亿字节|兆兆字节|tb"], ["Petabyte", "千兆兆|千万亿字节|pb"]]); + ChineseNumericWithUnit.DimensionAmbiguousValues = ['丈', '位', '克', '分', '升', '寸', '尺', '斗', '斤', '桶', '毫', '石', '码', '磅', '米', '罐', '里', 'm', 'km', 'dm', 'cm', 'mm', 'l', 'ml', 'kg', 'mg', 'g', 't', 'b', 'byte', 'kb', 'mb', 'gb', 'tb', 'pb']; + ChineseNumericWithUnit.TemperatureSuffixList = new Map([["F", "华氏温度|华氏度|°f"], ["K", "k|开尔文温度|开氏度|凯氏度"], ["R", "兰氏温度|°r"], ["C", "摄氏温度|摄氏度|°c"], ["Degree", "度"]]); + ChineseNumericWithUnit.TemperaturePrefixList = new Map([["F", "华氏温度|华氏"], ["K", "开氏温度|开氏"], ["R", "兰氏温度|兰氏"], ["C", "摄氏温度|摄氏"]]); + ChineseNumericWithUnit.TemperatureAmbiguousValues = ['度', 'k']; +})(ChineseNumericWithUnit = exports.ChineseNumericWithUnit || (exports.ChineseNumericWithUnit = {})); + +}); + +unwrapExports(chineseNumericWithUnit); + +var base$6 = createCommonjsModule(function (module, exports) { +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); + + + + + +class ChineseNumberWithUnitExtractorConfiguration { + constructor(ci) { + this.cultureInfo = ci; + this.unitNumExtractor = new recognizersTextNumber.ChineseNumberExtractor(recognizersTextNumber.ChineseNumberExtractorMode.ExtractAll); + this.buildPrefix = chineseNumericWithUnit.ChineseNumericWithUnit.BuildPrefix; + this.buildSuffix = chineseNumericWithUnit.ChineseNumericWithUnit.BuildSuffix; + this.connectorToken = chineseNumericWithUnit.ChineseNumericWithUnit.ConnectorToken; + this.compoundUnitConnectorRegex = recognizersText.RegExpUtility.getSafeRegExp(chineseNumericWithUnit.ChineseNumericWithUnit.CompoundUnitConnectorRegex); + this.pmNonUnitRegex = recognizersText.RegExpUtility.getSafeRegExp(baseUnits.BaseUnits.PmNonUnitRegex); + } +} +exports.ChineseNumberWithUnitExtractorConfiguration = ChineseNumberWithUnitExtractorConfiguration; +class ChineseNumberWithUnitParserConfiguration extends parsers$4.BaseNumberWithUnitParserConfiguration { + constructor(ci) { + super(ci); + this.internalNumberExtractor = new recognizersTextNumber.ChineseNumberExtractor(recognizersTextNumber.ChineseNumberExtractorMode.Default); + this.internalNumberParser = recognizersTextNumber.AgnosticNumberParserFactory.getParser(recognizersTextNumber.AgnosticNumberParserType.Number, new recognizersTextNumber.ChineseNumberParserConfiguration()); + this.connectorToken = ''; + this.currencyNameToIsoCodeMap = chineseNumericWithUnit.ChineseNumericWithUnit.CurrencyNameToIsoCodeMap; + this.currencyFractionCodeList = chineseNumericWithUnit.ChineseNumericWithUnit.FractionalUnitNameToCodeMap; + } +} +exports.ChineseNumberWithUnitParserConfiguration = ChineseNumberWithUnitParserConfiguration; + +}); + +unwrapExports(base$6); + +var currency$6 = createCommonjsModule(function (module, exports) { +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); + + + + +class ChineseCurrencyExtractorConfiguration extends base$6.ChineseNumberWithUnitExtractorConfiguration { + constructor(ci) { + if (!ci) { + ci = new recognizersTextNumber.CultureInfo(recognizersTextNumber.Culture.Chinese); + } + super(ci); + this.extractType = constants$2.Constants.SYS_UNIT_CURRENCY; + // Reference Source: https:// en.wikipedia.org/wiki/List_of_circulating_currencies + this.suffixList = chineseNumericWithUnit.ChineseNumericWithUnit.CurrencySuffixList; + this.prefixList = chineseNumericWithUnit.ChineseNumericWithUnit.CurrencyPrefixList; + this.ambiguousUnitList = chineseNumericWithUnit.ChineseNumericWithUnit.CurrencyAmbiguousValues; + + } +} +exports.ChineseCurrencyExtractorConfiguration = ChineseCurrencyExtractorConfiguration; +class ChineseCurrencyParserConfiguration extends base$6.ChineseNumberWithUnitParserConfiguration { + constructor(ci) { + if (!ci) { + ci = new recognizersTextNumber.CultureInfo(recognizersTextNumber.Culture.Chinese); + } + super(ci); + this.BindDictionary(chineseNumericWithUnit.ChineseNumericWithUnit.CurrencySuffixList); + this.BindDictionary(chineseNumericWithUnit.ChineseNumericWithUnit.CurrencyPrefixList); + } +} +exports.ChineseCurrencyParserConfiguration = ChineseCurrencyParserConfiguration; + +}); + +unwrapExports(currency$6); + +var temperature$6 = createCommonjsModule(function (module, exports) { +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); + + + + +class ChineseTemperatureExtractorConfiguration extends base$6.ChineseNumberWithUnitExtractorConfiguration { + constructor(ci) { + if (!ci) { + ci = new recognizersTextNumber.CultureInfo(recognizersTextNumber.Culture.Chinese); + } + super(ci); + this.extractType = constants$2.Constants.SYS_UNIT_TEMPERATURE; + this.suffixList = chineseNumericWithUnit.ChineseNumericWithUnit.TemperatureSuffixList; + this.prefixList = chineseNumericWithUnit.ChineseNumericWithUnit.TemperaturePrefixList; + this.ambiguousUnitList = chineseNumericWithUnit.ChineseNumericWithUnit.TemperatureAmbiguousValues; + } +} +exports.ChineseTemperatureExtractorConfiguration = ChineseTemperatureExtractorConfiguration; +class ChineseTemperatureParserConfiguration extends base$6.ChineseNumberWithUnitParserConfiguration { + constructor(ci) { + if (!ci) { + ci = new recognizersTextNumber.CultureInfo(recognizersTextNumber.Culture.Chinese); + } + super(ci); + this.BindDictionary(chineseNumericWithUnit.ChineseNumericWithUnit.TemperaturePrefixList); + this.BindDictionary(chineseNumericWithUnit.ChineseNumericWithUnit.TemperatureSuffixList); + } +} +exports.ChineseTemperatureParserConfiguration = ChineseTemperatureParserConfiguration; + +}); + +unwrapExports(temperature$6); + +var dimension$6 = createCommonjsModule(function (module, exports) { +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); + + + + +class ChineseDimensionExtractorConfiguration extends base$6.ChineseNumberWithUnitExtractorConfiguration { + constructor(ci) { + if (!ci) { + ci = new recognizersTextNumber.CultureInfo(recognizersTextNumber.Culture.Chinese); + } + super(ci); + this.extractType = constants$2.Constants.SYS_UNIT_DIMENSION; + this.suffixList = chineseNumericWithUnit.ChineseNumericWithUnit.DimensionSuffixList; + this.prefixList = new Map(); + this.ambiguousUnitList = chineseNumericWithUnit.ChineseNumericWithUnit.DimensionAmbiguousValues; + } +} +exports.ChineseDimensionExtractorConfiguration = ChineseDimensionExtractorConfiguration; +class ChineseDimensionParserConfiguration extends base$6.ChineseNumberWithUnitParserConfiguration { + constructor(ci) { + if (!ci) { + ci = new recognizersTextNumber.CultureInfo(recognizersTextNumber.Culture.Chinese); + } + super(ci); + this.BindDictionary(chineseNumericWithUnit.ChineseNumericWithUnit.DimensionSuffixList); + } +} +exports.ChineseDimensionParserConfiguration = ChineseDimensionParserConfiguration; + +}); + +unwrapExports(dimension$6); + +var age$6 = createCommonjsModule(function (module, exports) { +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); + + + + +class ChineseAgeExtractorConfiguration extends base$6.ChineseNumberWithUnitExtractorConfiguration { + constructor(ci) { + if (!ci) { + ci = new recognizersTextNumber.CultureInfo(recognizersTextNumber.Culture.Chinese); + } + super(ci); + this.extractType = constants$2.Constants.SYS_UNIT_AGE; + this.suffixList = chineseNumericWithUnit.ChineseNumericWithUnit.AgeSuffixList; + this.prefixList = new Map(); + this.ambiguousUnitList = chineseNumericWithUnit.ChineseNumericWithUnit.AgeAmbiguousValues; + } +} +exports.ChineseAgeExtractorConfiguration = ChineseAgeExtractorConfiguration; +class ChineseAgeParserConfiguration extends base$6.ChineseNumberWithUnitParserConfiguration { + constructor(ci) { + if (!ci) { + ci = new recognizersTextNumber.CultureInfo(recognizersTextNumber.Culture.Chinese); + } + super(ci); + this.BindDictionary(chineseNumericWithUnit.ChineseNumericWithUnit.AgeSuffixList); + } +} +exports.ChineseAgeParserConfiguration = ChineseAgeParserConfiguration; + +}); + +unwrapExports(age$6); + +var japaneseNumericWithUnit = createCommonjsModule(function (module, exports) { +"use strict"; +// ------------------------------------------------------------------------------ +// +// This code was generated by a tool. +// Changes to this file may cause incorrect behavior and will be lost if +// the code is regenerated. +// +// ------------------------------------------------------------------------------ +Object.defineProperty(exports, "__esModule", { value: true }); +var JapaneseNumericWithUnit; +(function (JapaneseNumericWithUnit) { + JapaneseNumericWithUnit.AgeAmbiguousValues = ['歳']; + JapaneseNumericWithUnit.AgeSuffixList = new Map([["Year", "歳"], ["Month", "ヶ月"], ["Week", "週間|週"], ["Day", "日間|日齢|日大"]]); + JapaneseNumericWithUnit.BuildPrefix = ''; + JapaneseNumericWithUnit.BuildSuffix = ''; + JapaneseNumericWithUnit.ConnectorToken = ''; + JapaneseNumericWithUnit.CurrencySuffixList = new Map([["Afghan afghani", "アフガニ"], ["Pul", "プル"], ["Euro", "ユーロ"], ["Cent", "セント"], ["Albanian lek", "アルバニアレク|アルバニア・レク|レク"], ["Angolan kwanza", "アンゴラクワンザ|アンゴラ・クワンザ|クワンザ"], ["Armenian dram", "アルメニアドラム|アルメニア・ドラム|ドラム"], ["Aruban florin", "アルバ・フロリン|フロリン"], ["Bangladeshi taka", "タカ|バングラデシュ・タカ"], ["Paisa", "パイサ"], ["Bhutanese ngultrum", "ニュルタム|ブータン・ニュルタム|ブータンニュルタム"], ["Chetrum", "チェルタム"], ["Bolivian boliviano", "ボリビアーノ"], ["Bosnia and Herzegovina convertible mark", "兌換マルク"], ["Botswana pula", "ボツワナ・プラ|ボツワナプラ|プラ"], ["Thebe", "テベ"], ["Brazilian real", "ブラジル・レアル|ブラジルレアル|レアル"], ["Bulgarian lev", "ブルガリア・レフ|ブルガリアレフ|レフ"], ["Stotinka", "ストティンカ"], ["Cambodian riel", "カンボジア・リエル|カンボジアリエル|リエル"], ["Cape Verdean escudo", "カーボベルデ・エスクード"], ["Croatian kuna", "クロアチアクーナ|クロアチア・クーナ|クーナ"], ["Lipa", "リパ"], ["Eritrean nakfa", "エリトリア・ナクファ|エリトリアナクファ|ナクファ"], ["Ethiopian birr", "エチオピア・ブル|エチオピアブル|ブル"], ["Gambian dalasi", "ガンビア・ダラシ|ガンビアダラシ|ダラシ"], ["Butut", "ブトゥツ"], ["Georgian lari", "ジョージア・ラリ|ジョージアラリ|ラリ"], ["Tetri", "テトリ"], ["Ghanaian cedi", "ガーナ・セディ|ガーナセディ|セディ"], ["Pesewa", "ペセワ"], ["Guatemalan quetzal", "グアテマラ・ケツァル|グアテマラケツァル|ケツァル"], ["Haitian gourde", "ハイチ・グールド|ハイチグールド|グールド"], ["Honduran lempira", "ホンジュラス・レンピラ|ホンジュラスレンピラ|レンピラ"], ["Hungarian forint", "ハンガリー・フォリント|ハンガリーフォリント|フォリント"], ["Iranian rial", "イラン・リアル"], ["Yemeni rial", "イエメン・リアル"], ["Israeli new shekel", "₪|ils|イスラエル・新シェケル|イスラエル新シェケル"], ["Japanese yen", "円"], ["Sen", "銭"], ["Kazakhstani tenge", "テンゲ|カザフスタン・テンゲ|カザフスタンテンゲ"], ["Kenyan shilling", "ケニア・シリング"], ["North Korean won", "北朝鮮ウォン"], ["South Korean won", "韓国ウォン"], ["Korean won", "₩"], ["Kyrgyzstani som", "キルギス・ソム|ソム"], ["Lao kip", "キップ|ラオス・キップ|ラオスキップ"], ["Att", "att"], ["Lesotho loti", "ロチ|レソト・ロチ|レソトロチ"], ["South African rand", "ランド|南アフリカ・ランド|南アフリカランド"], ["Macedonian denar", "マケドニア・デナール"], ["Deni", "デニ"], ["Malagasy ariary", "アリアリ|マダガスカル・アリアリ|マダガスカルアリアリ"], ["Iraimbilanja", "イライムビランジャ"], ["Malawian kwacha", "マラウイ・クワチャ"], ["Tambala", "タンバラ"], ["Malaysian ringgit", "リンギット|マレーシア・リンギット"], ["Mauritanian ouguiya", "ウギア|モーリタニア・ウギア|モーリタニアウギア"], ["Khoums", "コウム"], ["Mozambican metical", "メティカル|モザンビーク・メティカル|モザンビークメティカル"], ["Burmese kyat", "チャット|ミャンマー・チャット|ミャンマーチャット"], ["Pya", "ピャー"], ["Nigerian naira", "ナイラ|ナイジェリア・ナイラ|ナイジェリアナイラ"], ["Kobo", "コボ"], ["Turkish lira", "トルコリラ"], ["Kuruş", "クルシュ"], ["Omani rial", "オマーン・リアル"], ["Panamanian balboa", "バルボア|パナマ・バルボア|パナマバルボア"], ["Centesimo", "センテシモ"], ["Papua New Guinean kina", "キナ|パプア・ニューギニア・キナ"], ["Toea", "トエア"], ["Peruvian sol", "ヌエボ・ソル"], ["Polish złoty", "ズウォティ|ポーランド・ズウォティ|ポーランドズウォティ"], ["Grosz", "グロシュ"], ["Qatari riyal", "カタール・リヤル"], ["Saudi riyal", "サウジアラビア・リヤル"], ["Riyal", "リヤル"], ["Dirham", "ディルハム"], ["Halala", "ハララ"], ["Samoan tālā", "タラ|サモア・タラ|サモアタラ"], ["Sierra Leonean leone", "レオン|シエラレオネ・レオン|シエラレオネレオン"], ["Peseta", "ユーロ"], ["Swazi lilangeni", "リランゲニ|スワジランド・リランゲニ|スワジランドリランゲニ"], ["Tajikistani somoni", "ソモニ|タジキスタン・ソモニ|タジキスタンソモニ"], ["Thai baht", "バーツ|タイ・バーツ|タイバーツ"], ["Satang", "サタン"], ["Tongan paʻanga", "パアンガ|トンガ・パアンガ|トンガパアンガ"], ["Ukrainian hryvnia", "フリヴニャ|ウクライナ・フリヴニャ|ウクライナフリヴニャ"], ["Vanuatu vatu", "バツ|バヌアツ・バツ|バヌアツバツ"], ["Vietnamese dong", "ドン|ベトナム・ドン|ベトナムドン"], ["Indonesian rupiah", "ルピア|インドネシア・ルピア|インドネシアルピア"], ["Netherlands guilder", "ユーロ|オランダ・ユーロ"], ["Surinam florin", "スリナム・ドル"], ["Zambian kwacha", "ザンビア・クワチャ"], ["Moroccan dirham", "モロッコ・ディルハム"], ["United Arab Emirates dirham", "UAEディルハム"], ["Azerbaijani manat", "アゼルバイジャン・マナト"], ["Turkmenistan manat", "トルクメニスタン・マナト"], ["Manat", "マナト"], ["Somali shilling", "ソマリア・シリング"], ["Somaliland shilling", "ソマリランド・シリング"], ["Tanzanian shilling", "タンザニア・シリング"], ["Ugandan shilling", "ウガンダ・シリング"], ["Romanian leu", "ルーマニア・レウ"], ["Moldovan leu", "モルドバ・レウ"], ["Leu", "レウ"], ["Ban", "バン"], ["Nepalese rupee", "ネパール・ルピー"], ["Pakistani rupee", "パキスタン・ルピー"], ["Indian rupee", "インド・ルピー"], ["Seychellois rupee", "セーシェル・ルピー"], ["Mauritian rupee", "モーリシャス・ルピー"], ["Maldivian rufiyaa", "ルフィヤ|モルディブ・ルフィヤ|モルディブルフィヤ"], ["Sri Lankan rupee", "スリランカ・ルピー"], ["Rupee", "ルピー"], ["Czech koruna", "チェコ・コルナ"], ["Danish krone", "デンマーク・クローネ"], ["Norwegian krone", "ノルウェー・クローネ"], ["Faroese króna", "フェロー・クローネ"], ["Icelandic króna", "アイスランド・クローナ"], ["Swedish krona", "スウェーデン・クローナ"], ["Krone", "クローナ"], ["Øre", "オーレ"], ["West African CFA franc", "CFAフラン"], ["Central African CFA franc", "CFAフラン"], ["Comorian franc", "コモロ・フラン"], ["Congolese franc", "コンゴ・フラン"], ["Burundian franc", "ブルンジ・フラン"], ["Djiboutian franc", "ジブチ・フラン"], ["CFP franc", "CFPフラン"], ["Guinean franc", "ギニア・フラン"], ["Swiss franc", "スイス・フラン"], ["Rwandan franc", "ルワンダ・フラン"], ["Belgian franc", "ベルギー・フラン"], ["Rappen", "Rappen"], ["Franc", "フラン"], ["Centime", "サンチーム"], ["Russian ruble", "ロシア・ルーブル"], ["Transnistrian ruble", "沿ドニエストル・ルーブル"], ["Belarusian ruble", "ベラルーシ・ルーブル"], ["Kopek", "カペイカ"], ["Ruble", "ルーブル"], ["Algerian dinar", "アルジェリア・ディナール"], ["Bahraini dinar", "バーレーン・ディナール"], ["Iraqi dinar", "イラク・ディナール"], ["Jordanian dinar", "ヨルダン・ディナール"], ["Kuwaiti dinar", "クウェート・ディナール"], ["Libyan dinar", "リビア・ディナール"], ["Serbian dinar", "セルビア・ディナール"], ["Tunisian dinar", "チュニジア・ディナール"], ["Dinar", "ディナール"], ["Fils", "フィルス"], ["Para", "パラ"], ["Millime", "ミリム"], ["Argentine peso", "ペソ|アルゼンチン・ペソ"], ["Chilean peso", "チリ・ペソ"], ["Colombian peso", "コロンビア・ペソ"], ["Cuban peso", "兌換ペソ"], ["Dominican peso", "ドミニカ・ペソ"], ["Mexican peso", "メキシコ・ペソ"], ["Philippine peso", "フィリピン・ペソ"], ["Uruguayan peso", "ウルグアイ・ペソ"], ["Peso", "ペソ"], ["Centavo", "センターボ"], ["Alderney pound", "ガーンジー・ポンド"], ["British pound", "UKポンド"], ["Guernsey pound", "ガーンジー・ポンド"], ["Saint Helena pound", "セントヘレナ・ポンド"], ["Egyptian pound", "エジプト・ポンド"], ["Falkland Islands pound", "フォークランド諸島ポンド"], ["Gibraltar pound", "ジブラルタル・ポンド"], ["Manx pound", "マン島ポンド"], ["Jersey pound", "ジャージー・ポンド"], ["Lebanese pound", "レバノン・ポンド"], ["South Sudanese pound", "南スーダン・ポンド"], ["Sudanese pound", "スーダン・ポンド"], ["Syrian pound", "シリア・ポンド"], ["Pound", "ポンド"], ["Pence", "ペニー"], ["Shilling", "シリング"], ["United States dollar", "ドル|USドル"], ["East Caribbean dollar", "東カリブ・ドル"], ["Australian dollar", "オーストラリア・ドル"], ["Bahamian dollar", "バハマ・ドル"], ["Barbadian dollar", "バルバドス・ドル"], ["Belize dollar", "ベリーズ・ドル"], ["Bermudian dollar", "バミューダ・ドル"], ["Brunei dollar", "ブルネイ・ドル"], ["Singapore dollar", "シンガポール・ドル"], ["Canadian dollar", "カナダ・ドル"], ["Cayman Islands dollar", "ケイマン諸島・ドル"], ["New Zealand dollar", "ニュージーランド・ドル"], ["Cook Islands dollar", "ニュージーランド・ドル|ニュージーランド・ドル"], ["Fijian dollar", "フィジー・ドル|フィジー・ドル"], ["Guyanese dollar", "ガイアナ・ドル|ガイアナ・ドル"], ["Hong Kong dollar", "香港ドル"], ["Macau Pataca", "マカオ・パタカ|マカオ・パタカ"], ["New Taiwan dollar", "ニュー台湾ドル|ニュー台湾ドル"], ["Jamaican dollar", "ジャマイカ・ドル|ジャマイカドル"], ["Kiribati dollar", "オーストラリア・ドル|オーストラリアドル"], ["Liberian dollar", "リベリア・ドル|リベリアドル"], ["Namibian dollar", "ナミビア・ドル|ナミビアドル"], ["Surinamese dollar", "スリナム・ドル|スリナムドル"], ["Trinidad and Tobago dollar", "トリニダード・トバゴ・ドル|トリニダードトバゴ・ドル"], ["Tuvaluan dollar", "ツバル・ドル|ツバルドル"], ["Chinese yuan", "人民元"], ["Fen", "分"], ["Jiao", "角"], ["Finnish markka", "フィンランド・マルカ"], ["Penni", "ペニー"]]); + JapaneseNumericWithUnit.CurrencyNameToIsoCodeMap = new Map([["Afghan afghani", "AFN"], ["Euro", "EUR"], ["Albanian lek", "ALL"], ["Angolan kwanza", "AOA"], ["Armenian dram", "AMD"], ["Aruban florin", "AWG"], ["Bangladeshi taka", "BDT"], ["Bhutanese ngultrum", "BTN"], ["Bolivian boliviano", "BOB"], ["Bosnia and Herzegovina convertible mark", "BAM"], ["Botswana pula", "BWP"], ["Brazilian real", "BRL"], ["Bulgarian lev", "BGN"], ["Cambodian riel", "KHR"], ["Cape Verdean escudo", "CVE"], ["Costa Rican colón", "CRC"], ["Croatian kuna", "HRK"], ["Czech koruna", "CZK"], ["Eritrean nakfa", "ERN"], ["Ethiopian birr", "ETB"], ["Gambian dalasi", "GMD"], ["Georgian lari", "GEL"], ["Ghanaian cedi", "GHS"], ["Guatemalan quetzal", "GTQ"], ["Haitian gourde", "HTG"], ["Honduran lempira", "HNL"], ["Hungarian forint", "HUF"], ["Iranian rial", "IRR"], ["Yemeni rial", "YER"], ["Israeli new shekel", "ILS"], ["Japanese yen", "JPY"], ["Kazakhstani tenge", "KZT"], ["Kenyan shilling", "KES"], ["North Korean won", "KPW"], ["South Korean won", "KRW"], ["Kyrgyzstani som", "KGS"], ["Lao kip", "LAK"], ["Lesotho loti", "LSL"], ["South African rand", "ZAR"], ["Macanese pataca", "MOP"], ["Macedonian denar", "MKD"], ["Malagasy ariary", "MGA"], ["Malawian kwacha", "MWK"], ["Malaysian ringgit", "MYR"], ["Mauritanian ouguiya", "MRO"], ["Mongolian tögrög", "MNT"], ["Mozambican metical", "MZN"], ["Burmese kyat", "MMK"], ["Nicaraguan córdoba", "NIO"], ["Nigerian naira", "NGN"], ["Turkish lira", "TRY"], ["Omani rial", "OMR"], ["Panamanian balboa", "PAB"], ["Papua New Guinean kina", "PGK"], ["Paraguayan guaraní", "PYG"], ["Peruvian sol", "PEN"], ["Polish złoty", "PLN"], ["Qatari riyal", "QAR"], ["Saudi riyal", "SAR"], ["Samoan tālā", "WST"], ["São Tomé and Príncipe dobra", "STD"], ["Sierra Leonean leone", "SLL"], ["Swazi lilangeni", "SZL"], ["Tajikistani somoni", "TJS"], ["Thai baht", "THB"], ["Ukrainian hryvnia", "UAH"], ["Vanuatu vatu", "VUV"], ["Venezuelan bolívar", "VEF"], ["Zambian kwacha", "ZMW"], ["Moroccan dirham", "MAD"], ["United Arab Emirates dirham", "AED"], ["Azerbaijani manat", "AZN"], ["Turkmenistan manat", "TMT"], ["Somali shilling", "SOS"], ["Tanzanian shilling", "TZS"], ["Ugandan shilling", "UGX"], ["Romanian leu", "RON"], ["Moldovan leu", "MDL"], ["Nepalese rupee", "NPR"], ["Pakistani rupee", "PKR"], ["Indian rupee", "INR"], ["Seychellois rupee", "SCR"], ["Mauritian rupee", "MUR"], ["Maldivian rufiyaa", "MVR"], ["Sri Lankan rupee", "LKR"], ["Indonesian rupiah", "IDR"], ["Danish krone", "DKK"], ["Norwegian krone", "NOK"], ["Icelandic króna", "ISK"], ["Swedish krona", "SEK"], ["West African CFA franc", "XOF"], ["Central African CFA franc", "XAF"], ["Comorian franc", "KMF"], ["Congolese franc", "CDF"], ["Burundian franc", "BIF"], ["Djiboutian franc", "DJF"], ["CFP franc", "XPF"], ["Guinean franc", "GNF"], ["Swiss franc", "CHF"], ["Rwandan franc", "RWF"], ["Russian ruble", "RUB"], ["Transnistrian ruble", "PRB"], ["Belarusian ruble", "BYN"], ["Algerian dinar", "DZD"], ["Bahraini dinar", "BHD"], ["Iraqi dinar", "IQD"], ["Jordanian dinar", "JOD"], ["Kuwaiti dinar", "KWD"], ["Libyan dinar", "LYD"], ["Serbian dinar", "RSD"], ["Tunisian dinar", "TND"], ["Argentine peso", "ARS"], ["Chilean peso", "CLP"], ["Colombian peso", "COP"], ["Cuban convertible peso", "CUC"], ["Cuban peso", "CUP"], ["Dominican peso", "DOP"], ["Mexican peso", "MXN"], ["Uruguayan peso", "UYU"], ["British pound", "GBP"], ["Saint Helena pound", "SHP"], ["Egyptian pound", "EGP"], ["Falkland Islands pound", "FKP"], ["Gibraltar pound", "GIP"], ["Manx pound", "IMP"], ["Jersey pound", "JEP"], ["Lebanese pound", "LBP"], ["South Sudanese pound", "SSP"], ["Sudanese pound", "SDG"], ["Syrian pound", "SYP"], ["United States dollar", "USD"], ["Australian dollar", "AUD"], ["Bahamian dollar", "BSD"], ["Barbadian dollar", "BBD"], ["Belize dollar", "BZD"], ["Bermudian dollar", "BMD"], ["Brunei dollar", "BND"], ["Singapore dollar", "SGD"], ["Canadian dollar", "CAD"], ["Cayman Islands dollar", "KYD"], ["New Zealand dollar", "NZD"], ["Fijian dollar", "FJD"], ["Guyanese dollar", "GYD"], ["Hong Kong dollar", "HKD"], ["Jamaican dollar", "JMD"], ["Liberian dollar", "LRD"], ["Namibian dollar", "NAD"], ["Solomon Islands dollar", "SBD"], ["Surinamese dollar", "SRD"], ["New Taiwan dollar", "TWD"], ["Trinidad and Tobago dollar", "TTD"], ["Tuvaluan dollar", "TVD"], ["Chinese yuan", "CNY"], ["Rial", "__RI"], ["Shiling", "__S"], ["Som", "__SO"], ["Dirham", "__DR"], ["Dinar", "_DN"], ["Dollar", "__D"], ["Manat", "__MA"], ["Rupee", "__R"], ["Krone", "__K"], ["Krona", "__K"], ["Crown", "__K"], ["Frank", "__F"], ["Mark", "__M"], ["Ruble", "__RB"], ["Peso", "__PE"], ["Pound", "__P"], ["Tristan da Cunha pound", "_TP"], ["South Georgia and the South Sandwich Islands pound", "_SP"], ["Somaliland shilling", "_SS"], ["Pitcairn Islands dollar", "_PND"], ["Palauan dollar", "_PD"], ["Niue dollar", "_NID"], ["Nauruan dollar", "_ND"], ["Micronesian dollar", "_MD"], ["Kiribati dollar", "_KID"], ["Guernsey pound", "_GGP"], ["Faroese króna", "_FOK"], ["Cook Islands dollar", "_CKD"], ["British Virgin Islands dollar", "_BD"], ["Ascension pound", "_AP"], ["Alderney pound", "_ALP"], ["Abkhazian apsar", "_AA"]]); + JapaneseNumericWithUnit.FractionalUnitNameToCodeMap = new Map([["Jiao", "JIAO"], ["Kopek", "KOPEK"], ["Pul", "PUL"], ["Cent", "CENT"], ["Qindarkë", "QINDARKE"], ["Penny", "PENNY"], ["Santeem", "SANTEEM"], ["Cêntimo", "CENTIMO"], ["Centavo", "CENTAVO"], ["Luma", "LUMA"], ["Qəpik", "QƏPIK"], ["Fils", "FILS"], ["Poisha", "POISHA"], ["Kapyeyka", "KAPYEYKA"], ["Centime", "CENTIME"], ["Chetrum", "CHETRUM"], ["Paisa", "PAISA"], ["Fening", "FENING"], ["Thebe", "THEBE"], ["Sen", "SEN"], ["Stotinka", "STOTINKA"], ["Fen", "FEN"], ["Céntimo", "CENTIMO"], ["Lipa", "LIPA"], ["Haléř", "HALER"], ["Øre", "ØRE"], ["Piastre", "PIASTRE"], ["Santim", "SANTIM"], ["Oyra", "OYRA"], ["Butut", "BUTUT"], ["Tetri", "TETRI"], ["Pesewa", "PESEWA"], ["Fillér", "FILLER"], ["Eyrir", "EYRIR"], ["Dinar", "DINAR"], ["Agora", "AGORA"], ["Tïın", "TIIN"], ["Chon", "CHON"], ["Jeon", "JEON"], ["Tyiyn", "TYIYN"], ["Att", "ATT"], ["Sente", "SENTE"], ["Dirham", "DIRHAM"], ["Rappen", "RAPPEN"], ["Avo", "AVO"], ["Deni", "DENI"], ["Iraimbilanja", "IRAIMBILANJA"], ["Tambala", "TAMBALA"], ["Laari", "LAARI"], ["Khoums", "KHOUMS"], ["Ban", "BAN"], ["Möngö", "MONGO"], ["Pya", "PYA"], ["Kobo", "KOBO"], ["Kuruş", "KURUS"], ["Baisa", "BAISA"], ["Centésimo", "CENTESIMO"], ["Toea", "TOEA"], ["Sentimo", "SENTIMO"], ["Grosz", "GROSZ"], ["Sene", "SENE"], ["Halala", "HALALA"], ["Para", "PARA"], ["Öre", "ORE"], ["Diram", "DIRAM"], ["Satang", "SATANG"], ["Seniti", "SENITI"], ["Millime", "MILLIME"], ["Tennesi", "TENNESI"], ["Kopiyka", "KOPIYKA"], ["Tiyin", "TIYIN"], ["Hào", "HAO"], ["Ngwee", "NGWEE"]]); + JapaneseNumericWithUnit.CompoundUnitConnectorRegex = `(?と)`; + JapaneseNumericWithUnit.CurrencyPrefixList = new Map([["Dollar", "$"], ["United States dollar", "us$"], ["British Virgin Islands dollar", "bvi$"], ["Brunei dollar", "b$"], ["Sen", "sen"], ["Singapore dollar", "s$"], ["Canadian dollar", "can$|c$|c $"], ["Cayman Islands dollar", "ci$"], ["New Zealand dollar", "nz$|nz $"], ["Guyanese dollar", "gy$|gy $|g$|g $"], ["Hong Kong dollar", "hk$|hkd|hk $"], ["Jamaican dollar", "j$"], ["Namibian dollar", "nad|n$|n $"], ["Solomon Islands dollar", "si$|si $"], ["New Taiwan dollar", "nt$|nt $"], ["Samoan tālā", "ws$"], ["Chinese yuan", "¥"], ["Japanese yen", "¥|\\"], ["Turkish lira", "₺"], ["Euro", "€"], ["Pound", "£"], ["Costa Rican colón", "₡"]]); + JapaneseNumericWithUnit.CurrencyAmbiguousValues = ['円', '銭', '\\']; +})(JapaneseNumericWithUnit = exports.JapaneseNumericWithUnit || (exports.JapaneseNumericWithUnit = {})); + +}); + +unwrapExports(japaneseNumericWithUnit); + +var base$8 = createCommonjsModule(function (module, exports) { +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); + + + + + +class JapaneseNumberWithUnitExtractorConfiguration { + constructor(ci) { + this.cultureInfo = ci; + this.unitNumExtractor = new recognizersTextNumber.JapaneseNumberExtractor(recognizersTextNumber.JapaneseNumberExtractorMode.ExtractAll); + this.buildPrefix = japaneseNumericWithUnit.JapaneseNumericWithUnit.BuildPrefix; + this.buildSuffix = japaneseNumericWithUnit.JapaneseNumericWithUnit.BuildSuffix; + this.connectorToken = japaneseNumericWithUnit.JapaneseNumericWithUnit.ConnectorToken; + this.compoundUnitConnectorRegex = recognizersText.RegExpUtility.getSafeRegExp(japaneseNumericWithUnit.JapaneseNumericWithUnit.CompoundUnitConnectorRegex); + this.pmNonUnitRegex = recognizersText.RegExpUtility.getSafeRegExp(baseUnits.BaseUnits.PmNonUnitRegex); + } +} +exports.JapaneseNumberWithUnitExtractorConfiguration = JapaneseNumberWithUnitExtractorConfiguration; +class JapaneseNumberWithUnitParserConfiguration extends parsers$4.BaseNumberWithUnitParserConfiguration { + constructor(ci) { + super(ci); + this.internalNumberExtractor = new recognizersTextNumber.JapaneseNumberExtractor(recognizersTextNumber.JapaneseNumberExtractorMode.Default); + this.internalNumberParser = recognizersTextNumber.AgnosticNumberParserFactory.getParser(recognizersTextNumber.AgnosticNumberParserType.Number, new recognizersTextNumber.JapaneseNumberParserConfiguration()); + this.connectorToken = ''; + this.currencyNameToIsoCodeMap = japaneseNumericWithUnit.JapaneseNumericWithUnit.CurrencyNameToIsoCodeMap; + this.currencyFractionCodeList = japaneseNumericWithUnit.JapaneseNumericWithUnit.FractionalUnitNameToCodeMap; + } +} +exports.JapaneseNumberWithUnitParserConfiguration = JapaneseNumberWithUnitParserConfiguration; + +}); + +unwrapExports(base$8); + +var currency$8 = createCommonjsModule(function (module, exports) { +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); + + + + +class JapaneseCurrencyExtractorConfiguration extends base$8.JapaneseNumberWithUnitExtractorConfiguration { + constructor(ci) { + if (!ci) { + ci = new recognizersTextNumber.CultureInfo(recognizersTextNumber.Culture.Japanese); + } + super(ci); + this.extractType = constants$2.Constants.SYS_UNIT_CURRENCY; + // Reference Source: https:// en.wikipedia.org/wiki/List_of_circulating_currencies + this.suffixList = japaneseNumericWithUnit.JapaneseNumericWithUnit.CurrencySuffixList; + this.prefixList = japaneseNumericWithUnit.JapaneseNumericWithUnit.CurrencyPrefixList; + this.ambiguousUnitList = japaneseNumericWithUnit.JapaneseNumericWithUnit.CurrencyAmbiguousValues; + + } +} +exports.JapaneseCurrencyExtractorConfiguration = JapaneseCurrencyExtractorConfiguration; +class JapaneseCurrencyParserConfiguration extends base$8.JapaneseNumberWithUnitParserConfiguration { + constructor(ci) { + if (!ci) { + ci = new recognizersTextNumber.CultureInfo(recognizersTextNumber.Culture.Japanese); + } + super(ci); + this.BindDictionary(japaneseNumericWithUnit.JapaneseNumericWithUnit.CurrencySuffixList); + this.BindDictionary(japaneseNumericWithUnit.JapaneseNumericWithUnit.CurrencyPrefixList); + } +} +exports.JapaneseCurrencyParserConfiguration = JapaneseCurrencyParserConfiguration; + +}); + +unwrapExports(currency$8); + +var age$8 = createCommonjsModule(function (module, exports) { +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); + + + + +class JapaneseAgeExtractorConfiguration extends base$8.JapaneseNumberWithUnitExtractorConfiguration { + constructor(ci) { + if (!ci) { + ci = new recognizersTextNumber.CultureInfo(recognizersTextNumber.Culture.Japanese); + } + super(ci); + this.extractType = constants$2.Constants.SYS_UNIT_AGE; + this.suffixList = japaneseNumericWithUnit.JapaneseNumericWithUnit.AgeSuffixList; + this.prefixList = new Map(); + this.ambiguousUnitList = japaneseNumericWithUnit.JapaneseNumericWithUnit.AgeAmbiguousValues; + } +} +exports.JapaneseAgeExtractorConfiguration = JapaneseAgeExtractorConfiguration; +class JapaneseAgeParserConfiguration extends base$8.JapaneseNumberWithUnitParserConfiguration { + constructor(ci) { + if (!ci) { + ci = new recognizersTextNumber.CultureInfo(recognizersTextNumber.Culture.Japanese); + } + super(ci); + this.BindDictionary(japaneseNumericWithUnit.JapaneseNumericWithUnit.AgeSuffixList); + } +} +exports.JapaneseAgeParserConfiguration = JapaneseAgeParserConfiguration; + +}); + +unwrapExports(age$8); + +var frenchNumericWithUnit = createCommonjsModule(function (module, exports) { +"use strict"; +// ------------------------------------------------------------------------------ +// +// This code was generated by a tool. +// Changes to this file may cause incorrect behavior and will be lost if +// the code is regenerated. +// +// ------------------------------------------------------------------------------ +Object.defineProperty(exports, "__esModule", { value: true }); +var FrenchNumericWithUnit; +(function (FrenchNumericWithUnit) { + FrenchNumericWithUnit.AgeSuffixList = new Map([["Ans", "ans"], ["Mois", "mois d'âge|mois d'age|mois"], ["Semaines", "semaine|semaines|semaines d'âge|semaines d'age"], ["Jour", "jours|jour"]]); + FrenchNumericWithUnit.AreaSuffixList = new Map([["Kilomètre carré", "km2|km^2|km²|kilomètres carrés|kilomètre carré"], ["Hectomètre carré", "hm2|hm^2|hm²|hectomètre carré|hectomètres carrés"], ["Décamètre carré", "dam2|dam^2|dam²|décamètre carré|décamètres carrés"], ["Mètre carré", "m2|m^2|m²|mètre carré|mètres carrés"], ["Décimètre carré", "dm2|dm^2|dm²|décimètre carré|décimètres carrés"], ["Centimètre carré", "cm2|cm^2|cm²|centimètre carré|centimètres carrés"], ["Millimètre carré", "mm2|mm^2|mm²|millimètre carré|millimètres carrés"], ["Pouce carré", "pouces2|po2|pouce carré|pouces carrés|in^2|in²|in2"], ["Pied carré", "pied carré|pieds carrés|pi2|pi^2|pi²"], ["Mile carré", "mile carré|miles carrés|mi2|mi^2|mi²"], ["Acre", "acre|acres"]]); + FrenchNumericWithUnit.CurrencySuffixList = new Map([["Abkhazie apsar", "abkhazie apsar|apsars"], ["Afghan afghani", "afghan afghani|؋|afn|afghanis|afghani"], ["Pul", "pul"], ["Euro", "euros|euro|€|eur|d'euros"], ["Cent", "cents|cent|-cents|-cent|sen"], ["lek Albanais", "lek albanais|leks|lek"], ["Qindarkë", "qindarkë|qindarkës|qindarke|qindarkes"], ["Kwanza angolais", "kwanza angolais|kz|aoa|kwanza|kwanzas"], ["Dram arménien", "dram arménien|drams arméniens"], ["Florins d'Aruba", "florins aruba|ƒ|awg"], ["Bangladeshi taka", "bangladeshi taka|৳|bdt|taka|takas|bangladeshi takas"], ["Paisa", "poisha|paisa"], ["Ngultrum bhoutanais", "ngultrum bhoutanais|nu.|btn"], ["Chetrum", "chetrums|chetrum"], ["Boliviano bolivien", "boliviano bolivien|bolivianos bolivien|bolivianos bolivie|boliviano bolivie|bob|bs."], ["Bosnie-Herzégovine mark convertible", "bosnie-herzégovine mark convertible|bosnie-et-herzégovine mark convertible|bam"], ["Fening", "fening|fenings"], ["Pula", "pula|bwp"], ["Thebe", "thebe"], ["Réal brésilien", "réal brésilien|réals brésilien|r$|brl|real bresil|reals bresilien"], ["Lev bulgare", "lev bulgare|levs bulgare|lv|bgn"], ["Stotinki búlgaro", "stotinki bulgare"], ["Riel cambodgien", "riel cambodgien|khr|៛"], ["Escudo du cap-vert", "escudo cap-verdien|cve"], ["Colon du costa rica", "colon du costa rica|colons du costa rica|crc|₡"], ["Colon du salvador", "colon du salvador|colons du salvador|svc"], ["Kuna croate", "kuna croate|kunas croate|kn|hrk"], ["Lipa", "lipa"], ["Couronne tchèque", "couronne tchèque|couronnes tchèque|czk|Kč"], ["Haléř", "haléř"], ["Nakfas érythréens", "nakfas érythréens|nfk|ern|nakfa érythréens"], ["Birr éthiopien", "birr éthiopien|birrs éthiopien|etb"], ["Dalasi gambienne", "gmd"], ["Butut", "bututs|butut"], ["Lari géorgien", "lari géorgie|lari géorgiens|gel|₾"], ["Tetri géorgien", "tetri géorgie|tetris géorgiens"], ["Cedi", "cedi|ghs|cedi ghanéen|gh₵"], ["Pesewa", "pesewa|pesewas"], ["Quetzal guatémaltèque", "quetzal guatémaltèque|gtq|quetzal|quetzales"], ["Gourdes haïtiennes", "gourdes haïtiennes|gourdes|htg|gourde haïtienne"], ["Lempira hondurien", "lempira hondurien|hnl"], ["Forint hongrois", "forint hongrois|huf|fg|forints hongrois"], ["Fillér", "fillér"], ["Rial iranien", "rial iranien|irr|rials iranien|rials iraniens"], ["Litas lituanien", "litas lituanien|ltl|lit lithuanien|litas lithuanie"], ["Yen Japonais", "yen japonais|yen japon|yens|jpy|yen|¥|-yen"], ["Tenge kazakh", "tenge kazakh|kzt"], ["Shilling kényan", "shilling kényan|sh|kes|shillings kényans"], ["Won coréen", "won coréen|won coréens|₩"], ["Won sud-coréen", "won sud-coréen|won sud coréen|won sud-coréens|krw"], ["Corée du nord won", "corée du nord won|corée nord won|kpw"], ["Som Kirghizie", "som kirghizie|kgs"], ["Sum Ouzbékistan", "sum ouzbékistan|sum ouzbeks|sum ouzbéks|uzs"], ["Kip laotien", "kip laotien|lak|₭n|₭"], ["Att", "att"], ["Loti", "loti|maloti|lsl"], ["Sente", "sente|lisente"], ["Rand sud-africain", "rand sud-africain|zar"], ["Pataca macanais", "pataca macanais|mop$|mop"], ["Avo", "avos|avo"], ["Dinar macédonien", "dinar macédonien|mkd|ден"], ["Deni", "deni"], ["Ariary malagache", "ariary malagache|mga"], ["Iraimbilanja", "Iraimbilanja"], ["Kwacha malawien", "kwacha malawien|mk|mwk"], ["Tambala", "Tambala"], ["Ringitt malaisien", "ringitt malaisien|rm|myr|ringitts malaisien"], ["Ouguiya mauritanienne", "ouguiya|um|mro|ouguiya mauritanien|ouguiya mauritanienne"], ["Khoums", "khoums"], ["Togrogs mongoles", "togrogs mongoles|togrogs|tugriks|tögrög|mnt|₮|tögrög mongoles|tögrög mongolie|togrogs mongolie"], ["Metical mozambique", "metical du mozambique|metical mozambique|mt|mzn|meticals mozambique"], ["Kyat birmanie", "kyat birmanie|ks|mmk"], ["Pya", "pya"], ["Cordoba nicaraguayen", "cordoba nicaraguayen|córdoba nicaraguayen|nio|córdoba oro|cordoba oro nicaraguayen"], ["Naira nigérians", "naira nigérians|naira|ngm|₦|nairas nigérians"], ["Livre turque", "livre turque|try|tl|livre turques"], ["Kuruş", "kuruş"], ["Rials omanais", "rials omanais|omr|ر.ع.|rial omanais"], ["Balboa panaméennes", "balboa panaméennes|balboa|pab"], ["Kina", "kina|pkg|pgk"], ["Toea", "toea"], ["Guaraní paraguayen", "guaraní paraguayen|₲|pyg"], ["Sol péruvien", "nuevo sol péruvien|soles|sol|sol péruvien"], ["Złoty polonais", "złoty polonais|złoty|zł|pln|zloty|zloty polonais"], ["Groxz", "groszy|grosz|grosze"], ["Riyal qatari", "riyal qatari|qar|riyals qatari"], ["Riyal saudi", "riyal saudi|sar|riyals saudi"], ["Riyal", "riyal|riyals|rial|﷼"], ["Dirham", "dirham|dirhem|dirhm"], ["Halala", "halalas|halala"], ["Tala", "tala|tālā|ws$|sat|wst"], ["Sene", "sene"], ["Dobra", "dobra|db|std"], ["Leone", "leone|sll"], ["Florins Néerlandais", "florins hollandais|florins néerlandais|florins|ang|ƒ|florin|fl |"], ["Lilangeni", "lilangeni|szl"], ["Somoni tadjikistan", "somoni tadjikistan|tjs|somoni"], ["Diram", "dirams|diram"], ["Baht thaïlandais", "baht thaïlandais|baht thailandais|baht thaï|baht thai|baht|฿|thb"], ["Satang", "satang|satangs"], ["Paʻanga", "paʻanga|pa'anga|top"], ["Hryvnia ukrainien", "hryvnia ukrainien|hyrvnia|uah|₴|hryvnias ukrainien|hryvnia ukrainienne"], ["Vanuatu vatu", "vanuatu vatu|vatu|vuv"], ["Bolívar vénézuélien", "bolívar vénézuélien|bolivar venezuelien|bs.f.|vef|bolívars vénézuélien|bolivars venezuelien"], ["Dong vietnamien", "dong vietnamien|dongs vietnamiens|dong|đồng|vnd|dông|dông vietnamiens"], ["Kwacha de Zambie", "kwacha de zambie|zk|zmw|kwachas"], ["Dirham marocain", "dirham marocain|mad|د.م."], ["Dirham des Émirats arabes unis", "dirham des Émirats arabes unis|د.إ|aed"], ["Manat azerbaïdjanais", "manat azerbaïdjanais|manat azerbaidjanais|azn"], ["Manat turkmène", "manat turkmène|tmt|manat turkmene"], ["Manat", "manats|manat"], ["Qəpik", "qəpik"], ["Shilling somalien", "shilling somalien|shillings somalien|sos"], ["Shilling tanzanien", "shilling tanzanien|shillings tanzanien|tzs|tsh|shilling tanzanienne|shillings tanzanienne"], ["Shilling ougandais", "shilling ougandais|shillings ougandais|sh|ugx"], ["Leu roumain", "leu roumain|lei|leu roumaine|ron"], ["Leu moldave", "leu meoldave|mdl"], ["Leu", "leu"], ["Ban", "bani|-ban|ban"], ["Roupie népalaise", "roupie népalaise|roupie nepalaise|npr"], ["Roupie pakistanaise", "roupie pakistanaise|pkr"], ["Roupie indienne", "roupie indienne|inr|roupie indien|inr|₹"], ["Roupie seychelloise", "roupie seychelloise|scr|sr|sre"], ["Roupie mauricienne", "roupie mauricienne|mur"], ["Rufiyaa maldives", "rufiyaa maldives|mvr|.ރ|rf"], ["Roupie srilankaise", "roupie srilankaise|lrk|රු|ரூ"], ["Rupiah Indonésie", "rupia indonésie|rupia indonesie|rupiah|rp|idr"], ["Roupie", "roupie"], ["Couronne danoise", "couronne danoise|dkk|couronnes danoise|couronne danemark|couronnes danemark"], ["Couronne norvégienne", "couronne norvégienne|couronne norvegienne|couronnes norvégienne|couronnes norvegienne|nok"], ["Couronne féroïenne", "couronne féroïenne|couronne feroienne"], ["Couronne suédoise", "couronne suédoise|couronne suéde|sek|couronnes suédoise|couronne suedoise"], ["Couronne", "couronne|couronnes"], ["Øre", "Øre|oyra|eyrir"], ["Franc CFA de l'Afrique de l'Ouest", "franc cfa de l''afrique de l''ouest|franc cfa ouest africain|franc cfa|francs cfa|fcfa|frs cfa|cfa francs|xof"], ["Franc CFA d'Afrique centrale", "franc cfa d''afrique centrale|franc cfa centrale|frs cfa centrale|xaf"], ["Franc comorien", "franc comorien|kmf"], ["Franc congolais", "franc congolais|cdf"], ["Franc burundais", "franc burundais|bif"], ["Franc djiboutienne", "franc djiboutienne|djf"], ["Franc CFP", "franc cfp|xpf"], ["Franc guinéen", "franc guinéen|gnf"], ["Franc Suisse", "franc suisse|chf|sfr.|francs suisses"], ["Franc rwandais", "franc rwandais|rwf|rw|r₣|frw"], ["Franc belge", "franc belge|bi.|b.fr.|bef"], ["Rappen", "rappen|-rappen"], ["Franc", "francs|franc|fr.|fs"], ["Centimes", "centimes|centime|santim"], ["Rouble russe", "rouble russe|rub|₽|₽ russe|roubles russe|roubles russes|₽ russes"], ["Nouveau rouble biélorusse", "nouveau rouble biélorusse|byn|nouveau roubles biélorusse|nouveau rouble bielorusse|nouveau roubles biélorusse"], ["Rouble transnistriens", "rouble transnistriens|prb"], ["Rouble biélorusses", "rouble biélorusses|roubles biélorusses|rouble bielorusses|roubles bielorusses"], ["Kopek", "kopek|kopeks"], ["Kapyeyka", "kapyeyka"], ["Rouble", "roubles|rouble|br"], ["Dinar algérien", "dinar algérien|د.ج|dzd|dinars algérien|dinar algerien|dinars algerien"], ["Dinar de bahreïn", "dinar de bahreïn|bhd|.د.ب|dinar de bahrein"], ["Santeem", "santeem|santeems"], ["Dinar iraquien", "dinar iraquien|dinars iraquien|iqd|ع.د|dinar iraquienne|dinars iraquienne"], ["Dinar jordanien", "dinar jordanien|dinars jordanien|د.ا|jod"], ["Dinar koweïtien", "dinar koweïtien|dinar koweitien|dinars koweïtien|kwd|د.ك"], ["Dinar libyen", "dinar libyen|dinars libyen|lyd"], ["Dinar serbe", "dinar serbe|dinars serbe|rsd|дин."], ["Dinar tunisien", "dinar tunisien|dinars tunisien|tnd"], ["Dinar yougoslave", "dinar yougoslave|dinars yougoslave|yun"], ["Dinar", "dinars|dinar|denar|-dinars|-dinar"], ["Fils", "fils|fulūs|-fils|-fil"], ["Para", "para|napa"], ["Millime", "millimes|millime"], ["Peso argentin", "peso argentin|ars|pesos argentin|peso argentine|pesos argentine"], ["Peso chilien", "peso chilien|pesos chilien|clp"], ["Peso colombien", "peso colombien|pesos colombien|cop|peso colombie|pesos colombien"], ["Peso cubains convertibles", "peso cubains convertibles|pesos cubains convertibles|cuc"], ["Peso cubains", "peso cubaines|pesos cubaines|peso cubaine|pesos cubaines|cup"], ["Peso dominicain", "peso dominicain|pesos dominicain|dop|peso dominicaine|pesos dominicaine"], ["Peso philippin", "peso philippin|pesos philippin|piso|₱|php"], ["Peso uruguayen", "peso uruguayen|pesos uruguayen|uyu"], ["Peso", "pesos|Peso"], ["Centavo", "centavos|Centavo"], ["Livre britannique", "livre britannique|livres britannique|gbp|£ britannique"], ["Livre guernesey", "livre guernesey|£ guernesey|ggp"], ["Livre ascension", "livre ascension|livres ascension|£ ascension"], ["Livre sainte-hélène", "livre de sainte-hélène|livre sainte-hélène|livre sainte-helene|livre de sainte hélène|shp"], ["Livre égyptienne", "livre égyptienne|livre egyptienne|egp|ج.م"], ["Livre des îles falkland", "livre des îles falkland|livre des iles falkland|fkp|£ iles falkland"], ["Livre gibraltar", "livre gibraltar|livre de gibraltar|£ gibraltar|gip"], ["Livre manx", "imp|livre manx|£ manx"], ["Livre jersey", "livre de jersey|livre jersey|jep|£ jersey"], ["Livre libanaise", "livre libanaise|£ libanaise|livres libanaise|lbp|ل.ل"], ["Livre des îles malouines", "livre des îles malouines|livre des iles malouines|£ iles malouines"], ["Livre sud-soudanaise", "livre sud-soudanaise|livre sud soudanaise|livre du soudan du sud|livres sud-soudanaises|livre sud soudan|livre soudan sud"], ["Livre soudanaise", "livre soudanaise|livres soudanaise|sdg|£ soudan|ج.س.|livre soudan|livres soudan"], ["Livre syrienne", "livre syrienne|ل.س|syp|livre syrie|livres syrie|£ syrie"], ["Livre", "livre|livres|-livre|-livres|£"], ["Pence", "pence"], ["Shilling", "shilling|shillings"], ["Penny", "penny|sou|centime"], ["Dollar Américain", "dollar américain|$ américain|$ americain|usd|$usd|$ usd|dollar americain|dollar États-Unis|dollar des États-Unis|dollar États Unis|dollar etats unis|dollar etats-unis|$ etats-unis|$ États-Unis"], ["Dollar des Caraïbes orientales", "dollar des caraïbes orientales|dollar des caraibes orientales|xcd|$ caraibes orientales|$ caraïbes orientales"], ["Dollar Australien", "dollar australien|dollars australiens|$ australien|aud|$australien|australien $|$ australie|dollar australie"], ["Dollar des bahamas", "dollar des bahamas|dollar bahamas|$ bahamas|bsd|bahama $|dollar bahama|$ bahamas"], ["Dollar bermudes", "dollar des bermudes|dollar bermude|dollar bermudes|$ bermudes|bmd"], ["Dollar belize", "dollar de Belize|dollar belizien|bzd|$ belize"], ["Dollar îles Vierges britanniques", "dollar îles vierges britanniques|dollar iles vierges britanniques|$ iles vierges britanniques"], ["Dollar brunei", "dollar de brunei|$ brunei|bnd|dollar brunei"], ["Sen", "sen"], ["Dollar singapour", "dollar de singapour|dollar singapour|$ sinapour|sgd|$s"], ["Dollar Canadien", "dollar canadien|dollars canadien|$ canadien|cad|$can|$c|$ c|dollar canada|dollar canadienne|$ canada|$cad|cad$"], ["Dollar iles caimanes", "dollars des îles caïmanes|dollar des îles caïmanes|dollars des iles caimanes|dollar iles caimanes|kyd|$ci"], ["Dollar néo-zélandais", "dollar néo-zélandais|dollar néo zélandais|dollar neo-zelandais|dollar neo zelandais|$nz|$ néo-zélandais|$ neo zelandais"], ["Dollar îles cook", "dollar îles cook|dollar iles cook|$ iles cook"], ["Dollar des fidji", "dollar des fidji|$ fidji|dollar fidji|dollar de fidji|dollars des fidji|dollars de fidji"], ["Dollar guyanien", "dollar guyanien|dollar du guyana|dollar dre guyana|$ guayana|gyd|$gy"], ["Dollar de Hong Kong", "dollar hong kong|dollar hongkong|dollar de hong kong|dollar de hongkong|$hk|$ hk|hkd|hk $|hk$|dollar hk|$hongkong|dollars hongkong|dollars hong kong"], ["Dollar jamaïcain", "dollar jamaïcain|dollars jamaïcain|dollar jamaicain|dollars jamaicain|$j|$ jamaïque|dollar jamaïque|jmd"], ["Dollar libérien", "dollar libérien|dollars libérien|dollar liberien|dollars liberien|lrd|$ libérien|$ liberia|$ liberien"], ["Dollar namibien", "dollar namibien|dollars namibien|$ namibien|nad|$n|dollar namibie|dollars namibie|$ namibie"], ["Dollar des îles salomon", "dollar des îles Salomon|dollar des iles salomon|$si|sbd|$ iles salomon|$ îles salomon"], ["Dollar du suriname", "dollar du suriname|srd|$ du suriname|$ suriname|dollar suriname|dollars suriname|dollars du suriname"], ["Nouveau dollar de Taïwan", "nouveau dollar de taïwan|nouveau dollar de taiwan|twd|ntd|$nt"], ["Dollar trinidadien", "dollar trinidadien|dollars trinidadien|ttd|$ trinidadien"], ["Dollar", "dollar|$|dollars"], ["Yuan Chinois", "yuan|yuans|yuan chinois|renminbi|cny|rmb|¥"], ["Fen", "fen"], ["Jiao", "jiao"], ["Mark Finlandais", "marks finlandais|mark finlandais|fim|mark"]]); + FrenchNumericWithUnit.CompoundUnitConnectorRegex = `(?[^.])`; + FrenchNumericWithUnit.CurrencyPrefixList = new Map([["Dollar", "$"], ["Dollar États-Unis", "$us|usd|us$"], ["Dollar Caraïbes orientales", "xcd|$ec"], ["Dollar australien", "a$|$a|aud"], ["Dollar bahamas", "bsd|b$"], ["Dollar barbadien", "bbd|bds$"], ["Dollar de belize", "bz$|bzd"], ["Dollar des bermudes", "bd$|bmd"], ["Dollar de brunei", "brunei $|bnd"], ["Dollar de Singapour", "s$|sgd"], ["Dollar Canadien", "cad|$ ca|$ca|$ c"], ["Dollar des îles Caïmans", "ci$|kyd"], ["Dollar néo-zélandais", "nz$|nzd"], ["Dollar de Fidji", "$fj|fjd"], ["Dolar guyanien", "g$|gyd"], ["Dollar de Hong Kong", "hkd|hk$"], ["Dollar jamaïcain", "j$|jmd"], ["Dollar libérien", "lrd|l$"], ["Dollar namibien", "nad|n$"], ["Dollar des îles Salomon", "$ si|$si|sbd"], ["Nouveau dollar de Taïwan", "nt$|twd"], ["Réal brésilien", "r$|brl|reais"], ["Guaraní paraguayen", "₲|gs.|pyg"], ["Dollar trinidadien", "ttd|titis"], ["Yuan renminbi", "cny|rmb|¥|元"], ["Yen", "¥|jpy"], ["Euro", "€|eur"], ["Pound", "£"], ["Florín", "ƒ"], ["Livre", "£|gbp"]]); + FrenchNumericWithUnit.AmbiguousCurrencyUnitList = ['din.', 'kina', 'lari', 'taka', 'tala', 'vatu', 'yuan', 'bob', 'btn', 'cop', 'cup', 'dop', 'gip', 'jod', 'kgs', 'lak', 'mga', 'mop', 'nad', 'omr', 'sar', 'sbd', 'scr', 'sdg', 'sek', 'sos', 'std', 'try', 'yer']; + FrenchNumericWithUnit.InformationSuffixList = new Map([["Bit", "-bit|bit|bits"], ["Kilobit", "kilobit|kilobits|kb|kbit|kbits"], ["Megabit", "megabit|megabits|Mb|Mbit|mégabit|mégabits"], ["Gigabit", "gigabit|gigabits|Gb|Gbit"], ["Terabit", "terabit|terabits|Tb|Tbit|térabit|térabits"], ["Petabit", "petabit|petabits|Pb|Pbit|pétabit|pétabits"], ["octet", "octet|octets|-octet"], ["Kilooctet", "kilo-octet|kilo-octets|kilooctet|kilooctets|ko|kio|kB|KiB|kilobyte|kilobytes"], ["Mégaoctet", "mégaoctet|mégaoctets|méga-octet|méga-octets|Mo|Mio|MB|mégabyte|mégabytes"], ["Gigaoctet", "gigaoctet|gigaoctets|Go|Gio|GB|GiB|gigabyte|gigabytes"], ["Téraoctet", "téraoctet|téraoctets|To|Tio|TB|TiB|térabyte|térabytes"], ["Pétaoctet", "pétaoctet|pétaoctets|Po|Pio|PB|PiB|pétabyte|pétabytes"]]); + FrenchNumericWithUnit.AmbiguousDimensionUnitList = ['mi', 'barils', 'grain', 'l', 'pierre', 'fps', 'pts']; + FrenchNumericWithUnit.BuildPrefix = `(?<=(\\s|^|\\P{L}))`; + FrenchNumericWithUnit.BuildSuffix = `(?=(\\s|\\P{L}|$))`; + FrenchNumericWithUnit.ConnectorToken = 'de'; + FrenchNumericWithUnit.LengthSuffixList = new Map([["Kilomètres", "km|kilomètres|kilomètre|kilometres|kilometre|-km"], ["Hectomètre", "hm|hectomètre|hectomètres|hectometre|hectometres|-hm"], ["Décamètre", "dam|décamètre|décamètres|decametre|decametres|-dm"], ["Mètres", "m|mètres|mètre|metres|metre|m.|-m"], ["Décimètres", "dm|décimètres|décimètre|decimetres|decimetre"], ["Centimètres", "cm|centimètres|centimètre|centimetres|centimetre"], ["Millimètres", "mm|millimètres|millimètre|millimetre|millimetres"], ["Micromètres", "µm|um|micromètres|micromètre|micrometres|micrometre"], ["Nanomètres", "nm|nanometre|nanometres|nanomètres|nanomètre"], ["Picomètres", "pm|picomètre|picomètres|picometres|picometre"], ["Mile", "mi|mile|miles"], ["Pied", "pied|pieds"], ["Yard", "yards|yard|yd"], ["Pouce", "pouce|pouces"]]); + FrenchNumericWithUnit.AmbiguousLengthUnitList = ['m', 'yard', 'yards', 'pm', 'pt', 'pts']; + FrenchNumericWithUnit.AmbuguousLengthUnitList = ['m', 'pouce', 'pm']; + FrenchNumericWithUnit.SpeedSuffixList = new Map([["Mètre par seconde", "m/s|metres/seconde|metres par seconde|metre par seconde|metres par secondes|mètre par seconde|mètres par seconde|mètres par secondes"], ["Kilomètre par heure", "km/h|kilomètre par heure|kilomètres par heure|kilomètres par heures|kilometres par heure|kilometre par heure"], ["Kilomètre par minute", "km/m|kilomètre par minute|kilomètres par minute|kilomètres par minutes|kilometre par minute|kilometre par minutes"], ["Kilomètre par seconde", "km/s|km à la seconde|km a la seconde|kilomètre par seconde|kilomètres par seconde|kilometre par seconde|kilometres par seconde"], ["Miles par heure", "mph|miles par heure|miles à l'heure|miles a l'heure|miles un heure"], ["Noeuds", "noeud|noeuds|nuds"], ["Pied par seconde", "ft/s|pied par seconde|pieds par seconde|pied/s|pieds/s"], ["Pied par minute", "pieds/minute|pied/minute|ft/minute|ft/min|pied/min"]]); + FrenchNumericWithUnit.TemperatureSuffixList = new Map([["Kelvin", "k|K|kelvin"], ["F", "°f|degres f|degrés f|deg f|° f|degrés fahrenheit|degres fahrenheit|fahrenheit"], ["R", "rankine|°r|° r"], ["C", "°c|deg c|degrés celsius|degrés c|degres celsius|celsius|deg celsius|degs celsius|centigrade|deg centigrade|degs centigrade|degrés centigrade|degres centigrade|degré centigrade|degre centigrade"], ["Degré", "degrés|degres|deg.|°| °|degré|degre|deg"]]); + FrenchNumericWithUnit.VolumeSuffixList = new Map([["Mètre cube", "m3|m^3|m³|mètre cube|mètres cube|metre cube|metres cube"], ["Centimètre cube", "cm3|cm^3|cm³|centimètre cube|centimètres cube|centimetre cube|centimetres cube"], ["Millimètre cube", "mm3|mm^3|mm³|millimètre cube|millimètres cube|millimetre cube|millimetres cube"], ["Kilomètre cube", "km3|km^3|km³|kilomètre cube|kilomètres cube|kilometre cube|kilometres cube"], ["Pieds cube", "pieds cubes|pieds cube|pied cube|pied cubes"], ["Litre", "litre|litres|lts|l"], ["Millilitre", "ml|millilitre|millilitres"], ["Gallon", "gallon|gallons"], ["Pintes", "pintes"], ["Onces", "onces|once|oz"], ["Décilitre", "dl|décilitre|decilitre|décilitres|decilitres"], ["Centilitre", "cl|centilitres|centilitre"], ["Onces liquides", "onces liquides|once liquide|once liquides"], ["Baril", "baril|barils|bbl"]]); + FrenchNumericWithUnit.AmbiguousVolumeUnitList = ['ounce', 'oz', 'l', 'cup', 'peck', 'cord', 'gill']; + FrenchNumericWithUnit.WeightSuffixList = new Map([["Kilogramme", "kg|kilogramme|kilogrammes|kilo|kilos"], ["Gram", "g|gramme|grammes"], ["Milligramme", "mg|milligramme|milligrammes"], ["Tonne métrique", "tonne métrique|tonnes métrique|tonnes métriques|tonne metrique|tonnes metrique"], ["Tonne", "tonne|tonnes|-tonnes|-tonne"], ["Livre", "livre|livres"]]); + FrenchNumericWithUnit.AmbiguousWeightUnitList = ['g', 'oz', 'stone', 'dram']; +})(FrenchNumericWithUnit = exports.FrenchNumericWithUnit || (exports.FrenchNumericWithUnit = {})); + +}); + +unwrapExports(frenchNumericWithUnit); + +var base$10 = createCommonjsModule(function (module, exports) { +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); + + + + + +class FrenchNumberWithUnitExtractorConfiguration { + constructor(ci) { + this.cultureInfo = ci; + this.unitNumExtractor = new recognizersTextNumber.FrenchNumberExtractor(); + this.buildPrefix = frenchNumericWithUnit.FrenchNumericWithUnit.BuildPrefix; + this.buildSuffix = frenchNumericWithUnit.FrenchNumericWithUnit.BuildSuffix; + this.connectorToken = frenchNumericWithUnit.FrenchNumericWithUnit.ConnectorToken; + this.compoundUnitConnectorRegex = recognizersText.RegExpUtility.getSafeRegExp(frenchNumericWithUnit.FrenchNumericWithUnit.CompoundUnitConnectorRegex); + this.pmNonUnitRegex = recognizersText.RegExpUtility.getSafeRegExp(baseUnits.BaseUnits.PmNonUnitRegex); + } +} +exports.FrenchNumberWithUnitExtractorConfiguration = FrenchNumberWithUnitExtractorConfiguration; +class FrenchNumberWithUnitParserConfiguration extends parsers$4.BaseNumberWithUnitParserConfiguration { + constructor(ci) { + super(ci); + this.internalNumberExtractor = new recognizersTextNumber.FrenchNumberExtractor(recognizersTextNumber.NumberMode.Default); + this.internalNumberParser = recognizersTextNumber.AgnosticNumberParserFactory.getParser(recognizersTextNumber.AgnosticNumberParserType.Number, new recognizersTextNumber.FrenchNumberParserConfiguration()); + this.connectorToken = frenchNumericWithUnit.FrenchNumericWithUnit.ConnectorToken; + } +} +exports.FrenchNumberWithUnitParserConfiguration = FrenchNumberWithUnitParserConfiguration; + +}); + +unwrapExports(base$10); + +var currency$10 = createCommonjsModule(function (module, exports) { +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); + + + + +class FrenchCurrencyExtractorConfiguration extends base$10.FrenchNumberWithUnitExtractorConfiguration { + constructor(ci) { + if (!ci) { + ci = new recognizersTextNumber.CultureInfo(recognizersTextNumber.Culture.French); + } + super(ci); + this.extractType = constants$2.Constants.SYS_UNIT_CURRENCY; + // Reference Source: https:// en.wikipedia.org/wiki/List_of_circulating_currencies + this.suffixList = frenchNumericWithUnit.FrenchNumericWithUnit.CurrencySuffixList; + this.prefixList = frenchNumericWithUnit.FrenchNumericWithUnit.CurrencyPrefixList; + this.ambiguousUnitList = frenchNumericWithUnit.FrenchNumericWithUnit.AmbiguousCurrencyUnitList; + } +} +exports.FrenchCurrencyExtractorConfiguration = FrenchCurrencyExtractorConfiguration; +class FrenchCurrencyParserConfiguration extends base$10.FrenchNumberWithUnitParserConfiguration { + constructor(ci) { + if (!ci) { + ci = new recognizersTextNumber.CultureInfo(recognizersTextNumber.Culture.French); + } + super(ci); + this.BindDictionary(frenchNumericWithUnit.FrenchNumericWithUnit.CurrencySuffixList); + this.BindDictionary(frenchNumericWithUnit.FrenchNumericWithUnit.CurrencyPrefixList); + } +} +exports.FrenchCurrencyParserConfiguration = FrenchCurrencyParserConfiguration; + +}); + +unwrapExports(currency$10); + +var temperature$8 = createCommonjsModule(function (module, exports) { +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); + + + + +class FrenchTemperatureExtractorConfiguration extends base$10.FrenchNumberWithUnitExtractorConfiguration { + constructor(ci) { + if (!ci) { + ci = new recognizersTextNumber.CultureInfo(recognizersTextNumber.Culture.French); + } + super(ci); + this.extractType = constants$2.Constants.SYS_UNIT_TEMPERATURE; + this.suffixList = frenchNumericWithUnit.FrenchNumericWithUnit.TemperatureSuffixList; + this.prefixList = new Map(); + this.ambiguousUnitList = new Array(); + } +} +exports.FrenchTemperatureExtractorConfiguration = FrenchTemperatureExtractorConfiguration; +class FrenchTemperatureParserConfiguration extends base$10.FrenchNumberWithUnitParserConfiguration { + constructor(ci) { + if (!ci) { + ci = new recognizersTextNumber.CultureInfo(recognizersTextNumber.Culture.French); + } + super(ci); + this.connectorToken = null; + this.BindDictionary(frenchNumericWithUnit.FrenchNumericWithUnit.TemperatureSuffixList); + } +} +exports.FrenchTemperatureParserConfiguration = FrenchTemperatureParserConfiguration; + +}); + +unwrapExports(temperature$8); + +var dimension$8 = createCommonjsModule(function (module, exports) { +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); + + + + +const dimensionSuffixList = new Map([ + ...frenchNumericWithUnit.FrenchNumericWithUnit.InformationSuffixList, + ...frenchNumericWithUnit.FrenchNumericWithUnit.AreaSuffixList, + ...frenchNumericWithUnit.FrenchNumericWithUnit.LengthSuffixList, + ...frenchNumericWithUnit.FrenchNumericWithUnit.SpeedSuffixList, + ...frenchNumericWithUnit.FrenchNumericWithUnit.VolumeSuffixList, + ...frenchNumericWithUnit.FrenchNumericWithUnit.WeightSuffixList +]); +class FrenchDimensionExtractorConfiguration extends base$10.FrenchNumberWithUnitExtractorConfiguration { + constructor(ci) { + if (!ci) { + ci = new recognizersTextNumber.CultureInfo(recognizersTextNumber.Culture.French); + } + super(ci); + this.extractType = constants$2.Constants.SYS_UNIT_DIMENSION; + this.suffixList = dimensionSuffixList; + this.prefixList = new Map(); + this.ambiguousUnitList = frenchNumericWithUnit.FrenchNumericWithUnit.AmbiguousDimensionUnitList; + } +} +exports.FrenchDimensionExtractorConfiguration = FrenchDimensionExtractorConfiguration; +class FrenchDimensionParserConfiguration extends base$10.FrenchNumberWithUnitParserConfiguration { + constructor(ci) { + if (!ci) { + ci = new recognizersTextNumber.CultureInfo(recognizersTextNumber.Culture.French); + } + super(ci); + this.BindDictionary(dimensionSuffixList); + } +} +exports.FrenchDimensionParserConfiguration = FrenchDimensionParserConfiguration; + +}); + +unwrapExports(dimension$8); + +var age$10 = createCommonjsModule(function (module, exports) { +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); + + + + +class FrenchAgeExtractorConfiguration extends base$10.FrenchNumberWithUnitExtractorConfiguration { + constructor(ci) { + if (!ci) { + ci = new recognizersTextNumber.CultureInfo(recognizersTextNumber.Culture.French); + } + super(ci); + this.extractType = constants$2.Constants.SYS_UNIT_AGE; + this.suffixList = frenchNumericWithUnit.FrenchNumericWithUnit.AgeSuffixList; + this.prefixList = new Map(); + this.ambiguousUnitList = new Array(); + } +} +exports.FrenchAgeExtractorConfiguration = FrenchAgeExtractorConfiguration; +class FrenchAgeParserConfiguration extends base$10.FrenchNumberWithUnitParserConfiguration { + constructor(ci) { + if (!ci) { + ci = new recognizersTextNumber.CultureInfo(recognizersTextNumber.Culture.French); + } + super(ci); + this.BindDictionary(frenchNumericWithUnit.FrenchNumericWithUnit.AgeSuffixList); + } +} +exports.FrenchAgeParserConfiguration = FrenchAgeParserConfiguration; + +}); + +unwrapExports(age$10); + +var numberWithUnitRecognizer = createCommonjsModule(function (module, exports) { +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); + + + + + + + + + + + + + + + + + + + + + + + + + + + +var NumberWithUnitOptions; +(function (NumberWithUnitOptions) { + NumberWithUnitOptions[NumberWithUnitOptions["None"] = 0] = "None"; +})(NumberWithUnitOptions = exports.NumberWithUnitOptions || (exports.NumberWithUnitOptions = {})); +function recognizeCurrency(query, culture, options = NumberWithUnitOptions.None, fallbackToDefaultCulture = true) { + return recognizeByModel(recognizer => recognizer.getCurrencyModel(culture, fallbackToDefaultCulture), query, culture, options); +} +exports.recognizeCurrency = recognizeCurrency; +function recognizeTemperature(query, culture, options = NumberWithUnitOptions.None, fallbackToDefaultCulture = true) { + return recognizeByModel(recognizer => recognizer.getTemperatureModel(culture, fallbackToDefaultCulture), query, culture, options); +} +exports.recognizeTemperature = recognizeTemperature; +function recognizeDimension(query, culture, options = NumberWithUnitOptions.None, fallbackToDefaultCulture = true) { + return recognizeByModel(recognizer => recognizer.getDimensionModel(culture, fallbackToDefaultCulture), query, culture, options); +} +exports.recognizeDimension = recognizeDimension; +function recognizeAge(query, culture, options = NumberWithUnitOptions.None, fallbackToDefaultCulture = true) { + return recognizeByModel(recognizer => recognizer.getAgeModel(culture, fallbackToDefaultCulture), query, culture, options); +} +exports.recognizeAge = recognizeAge; +function recognizeByModel(getModelFunc, query, culture, options) { + let recognizer = new NumberWithUnitRecognizer(culture, options); + let model = getModelFunc(recognizer); + return model.parse(query); +} +class NumberWithUnitRecognizer extends recognizersText.Recognizer { + constructor(culture, options = NumberWithUnitOptions.None, lazyInitialization = false) { + super(culture, options, lazyInitialization); + } + InitializeConfiguration() { + //#region English + this.registerModel("CurrencyModel", recognizersTextNumber.Culture.English, (options) => new models$4.CurrencyModel(new Map([ + [new extractors$16.BaseMergedUnitExtractor(new currency.EnglishCurrencyExtractorConfiguration()), new parsers$4.BaseMergedUnitParser(new currency.EnglishCurrencyParserConfiguration())] + ]))); + this.registerModel("TemperatureModel", recognizersTextNumber.Culture.English, (options) => new models$4.TemperatureModel(new Map([ + [new extractors$16.NumberWithUnitExtractor(new temperature.EnglishTemperatureExtractorConfiguration()), new parsers$4.NumberWithUnitParser(new temperature.EnglishTemperatureParserConfiguration())] + ]))); + this.registerModel("DimensionModel", recognizersTextNumber.Culture.English, (options) => new models$4.DimensionModel(new Map([ + [new extractors$16.NumberWithUnitExtractor(new dimension.EnglishDimensionExtractorConfiguration()), new parsers$4.NumberWithUnitParser(new dimension.EnglishDimensionParserConfiguration())] + ]))); + this.registerModel("AgeModel", recognizersTextNumber.Culture.English, (options) => new models$4.AgeModel(new Map([ + [new extractors$16.NumberWithUnitExtractor(new age.EnglishAgeExtractorConfiguration()), new parsers$4.NumberWithUnitParser(new age.EnglishAgeParserConfiguration())] + ]))); + //#endregion + //#region Spanish + this.registerModel("CurrencyModel", recognizersTextNumber.Culture.Spanish, (options) => new models$4.CurrencyModel(new Map([ + [new extractors$16.NumberWithUnitExtractor(new currency$2.SpanishCurrencyExtractorConfiguration()), new parsers$4.NumberWithUnitParser(new currency$2.SpanishCurrencyParserConfiguration())] + ]))); + this.registerModel("TemperatureModel", recognizersTextNumber.Culture.Spanish, (options) => new models$4.TemperatureModel(new Map([ + [new extractors$16.NumberWithUnitExtractor(new temperature$2.SpanishTemperatureExtractorConfiguration()), new parsers$4.NumberWithUnitParser(new temperature$2.SpanishTemperatureParserConfiguration())] + ]))); + this.registerModel("DimensionModel", recognizersTextNumber.Culture.Spanish, (options) => new models$4.DimensionModel(new Map([ + [new extractors$16.NumberWithUnitExtractor(new dimension$2.SpanishDimensionExtractorConfiguration()), new parsers$4.NumberWithUnitParser(new dimension$2.SpanishDimensionParserConfiguration())] + ]))); + this.registerModel("AgeModel", recognizersTextNumber.Culture.Spanish, (options) => new models$4.AgeModel(new Map([ + [new extractors$16.NumberWithUnitExtractor(new age$2.SpanishAgeExtractorConfiguration()), new parsers$4.NumberWithUnitParser(new age$2.SpanishAgeParserConfiguration())] + ]))); + //#endregion + //#region Portuguese + this.registerModel("CurrencyModel", recognizersTextNumber.Culture.Portuguese, (options) => new models$4.CurrencyModel(new Map([ + [new extractors$16.NumberWithUnitExtractor(new currency$4.PortugueseCurrencyExtractorConfiguration()), new parsers$4.NumberWithUnitParser(new currency$4.PortugueseCurrencyParserConfiguration())] + ]))); + this.registerModel("TemperatureModel", recognizersTextNumber.Culture.Portuguese, (options) => new models$4.TemperatureModel(new Map([ + [new extractors$16.NumberWithUnitExtractor(new temperature$4.PortugueseTemperatureExtractorConfiguration()), new parsers$4.NumberWithUnitParser(new temperature$4.PortugueseTemperatureParserConfiguration())] + ]))); + this.registerModel("DimensionModel", recognizersTextNumber.Culture.Portuguese, (options) => new models$4.DimensionModel(new Map([ + [new extractors$16.NumberWithUnitExtractor(new dimension$4.PortugueseDimensionExtractorConfiguration()), new parsers$4.NumberWithUnitParser(new dimension$4.PortugueseDimensionParserConfiguration())] + ]))); + this.registerModel("AgeModel", recognizersTextNumber.Culture.Portuguese, (options) => new models$4.AgeModel(new Map([ + [new extractors$16.NumberWithUnitExtractor(new age$4.PortugueseAgeExtractorConfiguration()), new parsers$4.NumberWithUnitParser(new age$4.PortugueseAgeParserConfiguration())] + ]))); + //#endregion + //#region Chinese + this.registerModel("CurrencyModel", recognizersTextNumber.Culture.Chinese, (options) => new models$4.CurrencyModel(new Map([ + [new extractors$16.BaseMergedUnitExtractor(new currency$6.ChineseCurrencyExtractorConfiguration()), new parsers$4.BaseMergedUnitParser(new currency$6.ChineseCurrencyParserConfiguration())], + [new extractors$16.NumberWithUnitExtractor(new currency.EnglishCurrencyExtractorConfiguration()), new parsers$4.NumberWithUnitParser(new currency.EnglishCurrencyParserConfiguration())] + ]))); + this.registerModel("TemperatureModel", recognizersTextNumber.Culture.Chinese, (options) => new models$4.TemperatureModel(new Map([ + [new extractors$16.NumberWithUnitExtractor(new temperature$6.ChineseTemperatureExtractorConfiguration()), new parsers$4.NumberWithUnitParser(new temperature$6.ChineseTemperatureParserConfiguration())], + [new extractors$16.NumberWithUnitExtractor(new temperature.EnglishTemperatureExtractorConfiguration()), new parsers$4.NumberWithUnitParser(new temperature.EnglishTemperatureParserConfiguration())] + ]))); + this.registerModel("DimensionModel", recognizersTextNumber.Culture.Chinese, (options) => new models$4.DimensionModel(new Map([ + [new extractors$16.NumberWithUnitExtractor(new dimension$6.ChineseDimensionExtractorConfiguration()), new parsers$4.NumberWithUnitParser(new dimension$6.ChineseDimensionParserConfiguration())], + [new extractors$16.NumberWithUnitExtractor(new dimension.EnglishDimensionExtractorConfiguration()), new parsers$4.NumberWithUnitParser(new dimension.EnglishDimensionParserConfiguration())] + ]))); + this.registerModel("AgeModel", recognizersTextNumber.Culture.Chinese, (options) => new models$4.AgeModel(new Map([ + [new extractors$16.NumberWithUnitExtractor(new age$6.ChineseAgeExtractorConfiguration()), new parsers$4.NumberWithUnitParser(new age$6.ChineseAgeParserConfiguration())], + [new extractors$16.NumberWithUnitExtractor(new age.EnglishAgeExtractorConfiguration()), new parsers$4.NumberWithUnitParser(new age.EnglishAgeParserConfiguration())] + ]))); + //#endregion + //#region Japanese + this.registerModel("CurrencyModel", recognizersTextNumber.Culture.Japanese, (options) => new models$4.CurrencyModel(new Map([ + [new extractors$16.BaseMergedUnitExtractor(new currency$8.JapaneseCurrencyExtractorConfiguration()), new parsers$4.BaseMergedUnitParser(new currency$8.JapaneseCurrencyParserConfiguration())], + [new extractors$16.NumberWithUnitExtractor(new currency.EnglishCurrencyExtractorConfiguration()), new parsers$4.NumberWithUnitParser(new currency.EnglishCurrencyParserConfiguration())] + ]))); + this.registerModel("AgeModel", recognizersTextNumber.Culture.Japanese, (options) => new models$4.AgeModel(new Map([ + [new extractors$16.NumberWithUnitExtractor(new age$8.JapaneseAgeExtractorConfiguration()), new parsers$4.NumberWithUnitParser(new age$8.JapaneseAgeParserConfiguration())], + [new extractors$16.NumberWithUnitExtractor(new age.EnglishAgeExtractorConfiguration()), new parsers$4.NumberWithUnitParser(new age.EnglishAgeParserConfiguration())] + ]))); + //#endregion + //#region French + this.registerModel("CurrencyModel", recognizersTextNumber.Culture.French, (options) => new models$4.CurrencyModel(new Map([ + [new extractors$16.NumberWithUnitExtractor(new currency$10.FrenchCurrencyExtractorConfiguration()), new parsers$4.NumberWithUnitParser(new currency$10.FrenchCurrencyParserConfiguration())] + ]))); + this.registerModel("TemperatureModel", recognizersTextNumber.Culture.French, (options) => new models$4.TemperatureModel(new Map([ + [new extractors$16.NumberWithUnitExtractor(new temperature$8.FrenchTemperatureExtractorConfiguration()), new parsers$4.NumberWithUnitParser(new temperature$8.FrenchTemperatureParserConfiguration())] + ]))); + this.registerModel("DimensionModel", recognizersTextNumber.Culture.French, (options) => new models$4.DimensionModel(new Map([ + [new extractors$16.NumberWithUnitExtractor(new dimension$8.FrenchDimensionExtractorConfiguration()), new parsers$4.NumberWithUnitParser(new dimension$8.FrenchDimensionParserConfiguration())] + ]))); + this.registerModel("AgeModel", recognizersTextNumber.Culture.French, (options) => new models$4.AgeModel(new Map([ + [new extractors$16.NumberWithUnitExtractor(new age$10.FrenchAgeExtractorConfiguration()), new parsers$4.NumberWithUnitParser(new age$10.FrenchAgeParserConfiguration())] + ]))); + //#endregion + } + IsValidOptions(options) { + return options >= 0 && options <= NumberWithUnitOptions.None; + } + getCurrencyModel(culture = null, fallbackToDefaultCulture = true) { + return this.getModel("CurrencyModel", culture, fallbackToDefaultCulture); + } + getTemperatureModel(culture = null, fallbackToDefaultCulture = true) { + return this.getModel("TemperatureModel", culture, fallbackToDefaultCulture); + } + getDimensionModel(culture = null, fallbackToDefaultCulture = true) { + return this.getModel("DimensionModel", culture, fallbackToDefaultCulture); + } + getAgeModel(culture = null, fallbackToDefaultCulture = true) { + return this.getModel("AgeModel", culture, fallbackToDefaultCulture); + } +} +exports.default = NumberWithUnitRecognizer; + +}); + +unwrapExports(numberWithUnitRecognizer); + +var recognizersTextNumberWithUnit = createCommonjsModule(function (module, exports) { +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); + +exports.NumberWithUnitRecognizer = numberWithUnitRecognizer.default; +exports.NumberWithUnitOptions = numberWithUnitRecognizer.NumberWithUnitOptions; +exports.recognizeTemperature = numberWithUnitRecognizer.recognizeTemperature; +exports.recognizeDimension = numberWithUnitRecognizer.recognizeDimension; +exports.recognizeCurrency = numberWithUnitRecognizer.recognizeCurrency; +exports.recognizeAge = numberWithUnitRecognizer.recognizeAge; + +exports.Culture = recognizersTextNumber.Culture; +exports.CultureInfo = recognizersTextNumber.CultureInfo; + +exports.Constants = constants$2.Constants; + +exports.NumberWithUnitExtractor = extractors$16.NumberWithUnitExtractor; +exports.PrefixUnitResult = extractors$16.PrefixUnitResult; +exports.BaseMergedUnitExtractor = extractors$16.BaseMergedUnitExtractor; + +exports.CompositeEntityType = models$4.CompositeEntityType; +exports.AbstractNumberWithUnitModel = models$4.AbstractNumberWithUnitModel; +exports.AgeModel = models$4.AgeModel; +exports.CurrencyModel = models$4.CurrencyModel; +exports.DimensionModel = models$4.DimensionModel; +exports.TemperatureModel = models$4.TemperatureModel; + +exports.UnitValue = parsers$4.UnitValue; +exports.UnitValueIso = parsers$4.UnitValueIso; +exports.NumberWithUnitParser = parsers$4.NumberWithUnitParser; +exports.BaseNumberWithUnitParserConfiguration = parsers$4.BaseNumberWithUnitParserConfiguration; +exports.BaseCurrencyParser = parsers$4.BaseCurrencyParser; +exports.BaseMergedUnitParser = parsers$4.BaseMergedUnitParser; + +exports.EnglishAgeExtractorConfiguration = age.EnglishAgeExtractorConfiguration; +exports.EnglishAgeParserConfiguration = age.EnglishAgeParserConfiguration; + +exports.EnglishNumberWithUnitExtractorConfiguration = base.EnglishNumberWithUnitExtractorConfiguration; +exports.EnglishNumberWithUnitParserConfiguration = base.EnglishNumberWithUnitParserConfiguration; + +exports.EnglishCurrencyExtractorConfiguration = currency.EnglishCurrencyExtractorConfiguration; +exports.EnglishCurrencyParserConfiguration = currency.EnglishCurrencyParserConfiguration; + +exports.EnglishDimensionExtractorConfiguration = dimension.EnglishDimensionExtractorConfiguration; +exports.EnglishDimensionParserConfiguration = dimension.EnglishDimensionParserConfiguration; + +exports.EnglishTemperatureExtractorConfiguration = temperature.EnglishTemperatureExtractorConfiguration; +exports.EnglishTemperatureParserConfiguration = temperature.EnglishTemperatureParserConfiguration; + +exports.SpanishAgeExtractorConfiguration = age$2.SpanishAgeExtractorConfiguration; +exports.SpanishAgeParserConfiguration = age$2.SpanishAgeParserConfiguration; + +exports.SpanishNumberWithUnitExtractorConfiguration = base$2.SpanishNumberWithUnitExtractorConfiguration; +exports.SpanishNumberWithUnitParserConfiguration = base$2.SpanishNumberWithUnitParserConfiguration; + +exports.SpanishCurrencyExtractorConfiguration = currency$2.SpanishCurrencyExtractorConfiguration; +exports.SpanishCurrencyParserConfiguration = currency$2.SpanishCurrencyParserConfiguration; + +exports.SpanishDimensionExtractorConfiguration = dimension$2.SpanishDimensionExtractorConfiguration; +exports.SpanishDimensionParserConfiguration = dimension$2.SpanishDimensionParserConfiguration; + +exports.SpanishTemperatureExtractorConfiguration = temperature$2.SpanishTemperatureExtractorConfiguration; +exports.SpanishTemperatureParserConfiguration = temperature$2.SpanishTemperatureParserConfiguration; + +exports.PortugueseAgeExtractorConfiguration = age$4.PortugueseAgeExtractorConfiguration; +exports.PortugueseAgeParserConfiguration = age$4.PortugueseAgeParserConfiguration; + +exports.PortugueseNumberWithUnitExtractorConfiguration = base$4.PortugueseNumberWithUnitExtractorConfiguration; +exports.PortugueseNumberWithUnitParserConfiguration = base$4.PortugueseNumberWithUnitParserConfiguration; + +exports.PortugueseCurrencyExtractorConfiguration = currency$4.PortugueseCurrencyExtractorConfiguration; +exports.PortugueseCurrencyParserConfiguration = currency$4.PortugueseCurrencyParserConfiguration; + +exports.PortugueseDimensionExtractorConfiguration = dimension$4.PortugueseDimensionExtractorConfiguration; +exports.PortugueseDimensionParserConfiguration = dimension$4.PortugueseDimensionParserConfiguration; + +exports.PortugueseTemperatureExtractorConfiguration = temperature$4.PortugueseTemperatureExtractorConfiguration; +exports.PortugueseTemperatureParserConfiguration = temperature$4.PortugueseTemperatureParserConfiguration; + +exports.ChineseAgeExtractorConfiguration = age$6.ChineseAgeExtractorConfiguration; +exports.ChineseAgeParserConfiguration = age$6.ChineseAgeParserConfiguration; + +exports.ChineseNumberWithUnitExtractorConfiguration = base$6.ChineseNumberWithUnitExtractorConfiguration; +exports.ChineseNumberWithUnitParserConfiguration = base$6.ChineseNumberWithUnitParserConfiguration; + +exports.ChineseCurrencyExtractorConfiguration = currency$6.ChineseCurrencyExtractorConfiguration; +exports.ChineseCurrencyParserConfiguration = currency$6.ChineseCurrencyParserConfiguration; + +exports.ChineseDimensionExtractorConfiguration = dimension$6.ChineseDimensionExtractorConfiguration; +exports.ChineseDimensionParserConfiguration = dimension$6.ChineseDimensionParserConfiguration; + +exports.ChineseTemperatureExtractorConfiguration = temperature$6.ChineseTemperatureExtractorConfiguration; +exports.ChineseTemperatureParserConfiguration = temperature$6.ChineseTemperatureParserConfiguration; + +exports.JapaneseAgeExtractorConfiguration = age$8.JapaneseAgeExtractorConfiguration; +exports.JapaneseAgeParserConfiguration = age$8.JapaneseAgeParserConfiguration; + +exports.JapaneseNumberWithUnitExtractorConfiguration = base$8.JapaneseNumberWithUnitExtractorConfiguration; +exports.JapaneseNumberWithUnitParserConfiguration = base$8.JapaneseNumberWithUnitParserConfiguration; + +exports.JapaneseCurrencyExtractorConfiguration = currency$8.JapaneseCurrencyExtractorConfiguration; +exports.JapaneseCurrencyParserConfiguration = currency$8.JapaneseCurrencyParserConfiguration; + +exports.EnglishNumericWithUnit = englishNumericWithUnit.EnglishNumericWithUnit; + +exports.SpanishNumericWithUnit = spanishNumericWithUnit.SpanishNumericWithUnit; + +exports.PortugueseNumericWithUnit = portugueseNumericWithUnit.PortugueseNumericWithUnit; + +exports.ChineseNumericWithUnit = chineseNumericWithUnit.ChineseNumericWithUnit; + +exports.JapaneseNumericWithUnit = japaneseNumericWithUnit.JapaneseNumericWithUnit; + +}); + +var recognizersTextNumberWithUnit$1 = unwrapExports(recognizersTextNumberWithUnit); +var recognizersTextNumberWithUnit_1 = recognizersTextNumberWithUnit.NumberWithUnitRecognizer; +var recognizersTextNumberWithUnit_2 = recognizersTextNumberWithUnit.NumberWithUnitOptions; +var recognizersTextNumberWithUnit_3 = recognizersTextNumberWithUnit.recognizeTemperature; +var recognizersTextNumberWithUnit_4 = recognizersTextNumberWithUnit.recognizeDimension; +var recognizersTextNumberWithUnit_5 = recognizersTextNumberWithUnit.recognizeCurrency; +var recognizersTextNumberWithUnit_6 = recognizersTextNumberWithUnit.recognizeAge; +var recognizersTextNumberWithUnit_7 = recognizersTextNumberWithUnit.Culture; +var recognizersTextNumberWithUnit_8 = recognizersTextNumberWithUnit.CultureInfo; +var recognizersTextNumberWithUnit_9 = recognizersTextNumberWithUnit.Constants; +var recognizersTextNumberWithUnit_10 = recognizersTextNumberWithUnit.NumberWithUnitExtractor; +var recognizersTextNumberWithUnit_11 = recognizersTextNumberWithUnit.PrefixUnitResult; +var recognizersTextNumberWithUnit_12 = recognizersTextNumberWithUnit.BaseMergedUnitExtractor; +var recognizersTextNumberWithUnit_13 = recognizersTextNumberWithUnit.CompositeEntityType; +var recognizersTextNumberWithUnit_14 = recognizersTextNumberWithUnit.AbstractNumberWithUnitModel; +var recognizersTextNumberWithUnit_15 = recognizersTextNumberWithUnit.AgeModel; +var recognizersTextNumberWithUnit_16 = recognizersTextNumberWithUnit.CurrencyModel; +var recognizersTextNumberWithUnit_17 = recognizersTextNumberWithUnit.DimensionModel; +var recognizersTextNumberWithUnit_18 = recognizersTextNumberWithUnit.TemperatureModel; +var recognizersTextNumberWithUnit_19 = recognizersTextNumberWithUnit.UnitValue; +var recognizersTextNumberWithUnit_20 = recognizersTextNumberWithUnit.UnitValueIso; +var recognizersTextNumberWithUnit_21 = recognizersTextNumberWithUnit.NumberWithUnitParser; +var recognizersTextNumberWithUnit_22 = recognizersTextNumberWithUnit.BaseNumberWithUnitParserConfiguration; +var recognizersTextNumberWithUnit_23 = recognizersTextNumberWithUnit.BaseCurrencyParser; +var recognizersTextNumberWithUnit_24 = recognizersTextNumberWithUnit.BaseMergedUnitParser; +var recognizersTextNumberWithUnit_25 = recognizersTextNumberWithUnit.EnglishAgeExtractorConfiguration; +var recognizersTextNumberWithUnit_26 = recognizersTextNumberWithUnit.EnglishAgeParserConfiguration; +var recognizersTextNumberWithUnit_27 = recognizersTextNumberWithUnit.EnglishNumberWithUnitExtractorConfiguration; +var recognizersTextNumberWithUnit_28 = recognizersTextNumberWithUnit.EnglishNumberWithUnitParserConfiguration; +var recognizersTextNumberWithUnit_29 = recognizersTextNumberWithUnit.EnglishCurrencyExtractorConfiguration; +var recognizersTextNumberWithUnit_30 = recognizersTextNumberWithUnit.EnglishCurrencyParserConfiguration; +var recognizersTextNumberWithUnit_31 = recognizersTextNumberWithUnit.EnglishDimensionExtractorConfiguration; +var recognizersTextNumberWithUnit_32 = recognizersTextNumberWithUnit.EnglishDimensionParserConfiguration; +var recognizersTextNumberWithUnit_33 = recognizersTextNumberWithUnit.EnglishTemperatureExtractorConfiguration; +var recognizersTextNumberWithUnit_34 = recognizersTextNumberWithUnit.EnglishTemperatureParserConfiguration; +var recognizersTextNumberWithUnit_35 = recognizersTextNumberWithUnit.SpanishAgeExtractorConfiguration; +var recognizersTextNumberWithUnit_36 = recognizersTextNumberWithUnit.SpanishAgeParserConfiguration; +var recognizersTextNumberWithUnit_37 = recognizersTextNumberWithUnit.SpanishNumberWithUnitExtractorConfiguration; +var recognizersTextNumberWithUnit_38 = recognizersTextNumberWithUnit.SpanishNumberWithUnitParserConfiguration; +var recognizersTextNumberWithUnit_39 = recognizersTextNumberWithUnit.SpanishCurrencyExtractorConfiguration; +var recognizersTextNumberWithUnit_40 = recognizersTextNumberWithUnit.SpanishCurrencyParserConfiguration; +var recognizersTextNumberWithUnit_41 = recognizersTextNumberWithUnit.SpanishDimensionExtractorConfiguration; +var recognizersTextNumberWithUnit_42 = recognizersTextNumberWithUnit.SpanishDimensionParserConfiguration; +var recognizersTextNumberWithUnit_43 = recognizersTextNumberWithUnit.SpanishTemperatureExtractorConfiguration; +var recognizersTextNumberWithUnit_44 = recognizersTextNumberWithUnit.SpanishTemperatureParserConfiguration; +var recognizersTextNumberWithUnit_45 = recognizersTextNumberWithUnit.PortugueseAgeExtractorConfiguration; +var recognizersTextNumberWithUnit_46 = recognizersTextNumberWithUnit.PortugueseAgeParserConfiguration; +var recognizersTextNumberWithUnit_47 = recognizersTextNumberWithUnit.PortugueseNumberWithUnitExtractorConfiguration; +var recognizersTextNumberWithUnit_48 = recognizersTextNumberWithUnit.PortugueseNumberWithUnitParserConfiguration; +var recognizersTextNumberWithUnit_49 = recognizersTextNumberWithUnit.PortugueseCurrencyExtractorConfiguration; +var recognizersTextNumberWithUnit_50 = recognizersTextNumberWithUnit.PortugueseCurrencyParserConfiguration; +var recognizersTextNumberWithUnit_51 = recognizersTextNumberWithUnit.PortugueseDimensionExtractorConfiguration; +var recognizersTextNumberWithUnit_52 = recognizersTextNumberWithUnit.PortugueseDimensionParserConfiguration; +var recognizersTextNumberWithUnit_53 = recognizersTextNumberWithUnit.PortugueseTemperatureExtractorConfiguration; +var recognizersTextNumberWithUnit_54 = recognizersTextNumberWithUnit.PortugueseTemperatureParserConfiguration; +var recognizersTextNumberWithUnit_55 = recognizersTextNumberWithUnit.ChineseAgeExtractorConfiguration; +var recognizersTextNumberWithUnit_56 = recognizersTextNumberWithUnit.ChineseAgeParserConfiguration; +var recognizersTextNumberWithUnit_57 = recognizersTextNumberWithUnit.ChineseNumberWithUnitExtractorConfiguration; +var recognizersTextNumberWithUnit_58 = recognizersTextNumberWithUnit.ChineseNumberWithUnitParserConfiguration; +var recognizersTextNumberWithUnit_59 = recognizersTextNumberWithUnit.ChineseCurrencyExtractorConfiguration; +var recognizersTextNumberWithUnit_60 = recognizersTextNumberWithUnit.ChineseCurrencyParserConfiguration; +var recognizersTextNumberWithUnit_61 = recognizersTextNumberWithUnit.ChineseDimensionExtractorConfiguration; +var recognizersTextNumberWithUnit_62 = recognizersTextNumberWithUnit.ChineseDimensionParserConfiguration; +var recognizersTextNumberWithUnit_63 = recognizersTextNumberWithUnit.ChineseTemperatureExtractorConfiguration; +var recognizersTextNumberWithUnit_64 = recognizersTextNumberWithUnit.ChineseTemperatureParserConfiguration; +var recognizersTextNumberWithUnit_65 = recognizersTextNumberWithUnit.JapaneseAgeExtractorConfiguration; +var recognizersTextNumberWithUnit_66 = recognizersTextNumberWithUnit.JapaneseAgeParserConfiguration; +var recognizersTextNumberWithUnit_67 = recognizersTextNumberWithUnit.JapaneseNumberWithUnitExtractorConfiguration; +var recognizersTextNumberWithUnit_68 = recognizersTextNumberWithUnit.JapaneseNumberWithUnitParserConfiguration; +var recognizersTextNumberWithUnit_69 = recognizersTextNumberWithUnit.JapaneseCurrencyExtractorConfiguration; +var recognizersTextNumberWithUnit_70 = recognizersTextNumberWithUnit.JapaneseCurrencyParserConfiguration; +var recognizersTextNumberWithUnit_71 = recognizersTextNumberWithUnit.EnglishNumericWithUnit; +var recognizersTextNumberWithUnit_72 = recognizersTextNumberWithUnit.SpanishNumericWithUnit; +var recognizersTextNumberWithUnit_73 = recognizersTextNumberWithUnit.PortugueseNumericWithUnit; +var recognizersTextNumberWithUnit_74 = recognizersTextNumberWithUnit.ChineseNumericWithUnit; +var recognizersTextNumberWithUnit_75 = recognizersTextNumberWithUnit.JapaneseNumericWithUnit; + +exports['default'] = recognizersTextNumberWithUnit$1; +exports.NumberWithUnitRecognizer = recognizersTextNumberWithUnit_1; +exports.NumberWithUnitOptions = recognizersTextNumberWithUnit_2; +exports.recognizeTemperature = recognizersTextNumberWithUnit_3; +exports.recognizeDimension = recognizersTextNumberWithUnit_4; +exports.recognizeCurrency = recognizersTextNumberWithUnit_5; +exports.recognizeAge = recognizersTextNumberWithUnit_6; +exports.Culture = recognizersTextNumberWithUnit_7; +exports.CultureInfo = recognizersTextNumberWithUnit_8; +exports.Constants = recognizersTextNumberWithUnit_9; +exports.NumberWithUnitExtractor = recognizersTextNumberWithUnit_10; +exports.PrefixUnitResult = recognizersTextNumberWithUnit_11; +exports.BaseMergedUnitExtractor = recognizersTextNumberWithUnit_12; +exports.CompositeEntityType = recognizersTextNumberWithUnit_13; +exports.AbstractNumberWithUnitModel = recognizersTextNumberWithUnit_14; +exports.AgeModel = recognizersTextNumberWithUnit_15; +exports.CurrencyModel = recognizersTextNumberWithUnit_16; +exports.DimensionModel = recognizersTextNumberWithUnit_17; +exports.TemperatureModel = recognizersTextNumberWithUnit_18; +exports.UnitValue = recognizersTextNumberWithUnit_19; +exports.UnitValueIso = recognizersTextNumberWithUnit_20; +exports.NumberWithUnitParser = recognizersTextNumberWithUnit_21; +exports.BaseNumberWithUnitParserConfiguration = recognizersTextNumberWithUnit_22; +exports.BaseCurrencyParser = recognizersTextNumberWithUnit_23; +exports.BaseMergedUnitParser = recognizersTextNumberWithUnit_24; +exports.EnglishAgeExtractorConfiguration = recognizersTextNumberWithUnit_25; +exports.EnglishAgeParserConfiguration = recognizersTextNumberWithUnit_26; +exports.EnglishNumberWithUnitExtractorConfiguration = recognizersTextNumberWithUnit_27; +exports.EnglishNumberWithUnitParserConfiguration = recognizersTextNumberWithUnit_28; +exports.EnglishCurrencyExtractorConfiguration = recognizersTextNumberWithUnit_29; +exports.EnglishCurrencyParserConfiguration = recognizersTextNumberWithUnit_30; +exports.EnglishDimensionExtractorConfiguration = recognizersTextNumberWithUnit_31; +exports.EnglishDimensionParserConfiguration = recognizersTextNumberWithUnit_32; +exports.EnglishTemperatureExtractorConfiguration = recognizersTextNumberWithUnit_33; +exports.EnglishTemperatureParserConfiguration = recognizersTextNumberWithUnit_34; +exports.SpanishAgeExtractorConfiguration = recognizersTextNumberWithUnit_35; +exports.SpanishAgeParserConfiguration = recognizersTextNumberWithUnit_36; +exports.SpanishNumberWithUnitExtractorConfiguration = recognizersTextNumberWithUnit_37; +exports.SpanishNumberWithUnitParserConfiguration = recognizersTextNumberWithUnit_38; +exports.SpanishCurrencyExtractorConfiguration = recognizersTextNumberWithUnit_39; +exports.SpanishCurrencyParserConfiguration = recognizersTextNumberWithUnit_40; +exports.SpanishDimensionExtractorConfiguration = recognizersTextNumberWithUnit_41; +exports.SpanishDimensionParserConfiguration = recognizersTextNumberWithUnit_42; +exports.SpanishTemperatureExtractorConfiguration = recognizersTextNumberWithUnit_43; +exports.SpanishTemperatureParserConfiguration = recognizersTextNumberWithUnit_44; +exports.PortugueseAgeExtractorConfiguration = recognizersTextNumberWithUnit_45; +exports.PortugueseAgeParserConfiguration = recognizersTextNumberWithUnit_46; +exports.PortugueseNumberWithUnitExtractorConfiguration = recognizersTextNumberWithUnit_47; +exports.PortugueseNumberWithUnitParserConfiguration = recognizersTextNumberWithUnit_48; +exports.PortugueseCurrencyExtractorConfiguration = recognizersTextNumberWithUnit_49; +exports.PortugueseCurrencyParserConfiguration = recognizersTextNumberWithUnit_50; +exports.PortugueseDimensionExtractorConfiguration = recognizersTextNumberWithUnit_51; +exports.PortugueseDimensionParserConfiguration = recognizersTextNumberWithUnit_52; +exports.PortugueseTemperatureExtractorConfiguration = recognizersTextNumberWithUnit_53; +exports.PortugueseTemperatureParserConfiguration = recognizersTextNumberWithUnit_54; +exports.ChineseAgeExtractorConfiguration = recognizersTextNumberWithUnit_55; +exports.ChineseAgeParserConfiguration = recognizersTextNumberWithUnit_56; +exports.ChineseNumberWithUnitExtractorConfiguration = recognizersTextNumberWithUnit_57; +exports.ChineseNumberWithUnitParserConfiguration = recognizersTextNumberWithUnit_58; +exports.ChineseCurrencyExtractorConfiguration = recognizersTextNumberWithUnit_59; +exports.ChineseCurrencyParserConfiguration = recognizersTextNumberWithUnit_60; +exports.ChineseDimensionExtractorConfiguration = recognizersTextNumberWithUnit_61; +exports.ChineseDimensionParserConfiguration = recognizersTextNumberWithUnit_62; +exports.ChineseTemperatureExtractorConfiguration = recognizersTextNumberWithUnit_63; +exports.ChineseTemperatureParserConfiguration = recognizersTextNumberWithUnit_64; +exports.JapaneseAgeExtractorConfiguration = recognizersTextNumberWithUnit_65; +exports.JapaneseAgeParserConfiguration = recognizersTextNumberWithUnit_66; +exports.JapaneseNumberWithUnitExtractorConfiguration = recognizersTextNumberWithUnit_67; +exports.JapaneseNumberWithUnitParserConfiguration = recognizersTextNumberWithUnit_68; +exports.JapaneseCurrencyExtractorConfiguration = recognizersTextNumberWithUnit_69; +exports.JapaneseCurrencyParserConfiguration = recognizersTextNumberWithUnit_70; +exports.EnglishNumericWithUnit = recognizersTextNumberWithUnit_71; +exports.SpanishNumericWithUnit = recognizersTextNumberWithUnit_72; +exports.PortugueseNumericWithUnit = recognizersTextNumberWithUnit_73; +exports.ChineseNumericWithUnit = recognizersTextNumberWithUnit_74; +exports.JapaneseNumericWithUnit = recognizersTextNumberWithUnit_75; + +return exports; + +}({})); +//# sourceMappingURL=recognizers-text-number-with-unit.browser.js.map diff --git a/libraries/botbuilder-stdlib/vendors/@microsoft/recognizers-text-number-with-unit/dist/recognizers-text-number-with-unit.es5.js b/libraries/botbuilder-stdlib/vendors/@microsoft/recognizers-text-number-with-unit/dist/recognizers-text-number-with-unit.es5.js new file mode 100644 index 0000000000..acf5ceb618 --- /dev/null +++ b/libraries/botbuilder-stdlib/vendors/@microsoft/recognizers-text-number-with-unit/dist/recognizers-text-number-with-unit.es5.js @@ -0,0 +1,18968 @@ +var commonjsGlobal = typeof window !== 'undefined' ? window : typeof global !== 'undefined' ? global : typeof self !== 'undefined' ? self : {}; + + + +function unwrapExports (x) { + return x && x.__esModule && Object.prototype.hasOwnProperty.call(x, 'default') ? x['default'] : x; +} + +function createCommonjsModule(fn, module) { + return module = { exports: {} }, fn(module, module.exports), module.exports; +} + +var culture = createCommonjsModule(function (module, exports) { +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +class Culture { + constructor(cultureName, cultureCode) { + this.cultureName = cultureName; + this.cultureCode = cultureCode; + } + static getSupportedCultureCodes() { + return Culture.supportedCultures.map(c => c.cultureCode); + } + static mapToNearestLanguage(cultureCode) { + if (cultureCode !== undefined) { + cultureCode = cultureCode.toLowerCase(); + var supportedCultureCodes = Culture.getSupportedCultureCodes(); + if (supportedCultureCodes.indexOf(cultureCode) < 0) { + var culturePrefix = cultureCode.split('-')[0].trim(); + supportedCultureCodes.forEach(function (supportedCultureCode) { + if (supportedCultureCode.startsWith(culturePrefix)) { + cultureCode = supportedCultureCode; + } + }); + } + } + return cultureCode; + } +} +Culture.English = "en-us"; +Culture.Chinese = "zh-cn"; +Culture.Spanish = "es-es"; +Culture.Portuguese = "pt-br"; +Culture.French = "fr-fr"; +Culture.German = "de-de"; +Culture.Japanese = "ja-jp"; +Culture.Dutch = "nl-nl"; +Culture.Italian = "it-it"; +Culture.supportedCultures = [ + new Culture("English", Culture.English), + new Culture("Chinese", Culture.Chinese), + new Culture("Spanish", Culture.Spanish), + new Culture("Portuguese", Culture.Portuguese), + new Culture("French", Culture.French), + new Culture("German", Culture.German), + new Culture("Japanese", Culture.Japanese), + new Culture("Dutch", Culture.Dutch), + new Culture("Italian", Culture.Italian) +]; +exports.Culture = Culture; +class CultureInfo { + static getCultureInfo(cultureCode) { + return new CultureInfo(cultureCode); + } + constructor(cultureName) { + this.code = cultureName; + } +} +exports.CultureInfo = CultureInfo; + +}); + +unwrapExports(culture); + +var xregexp = createCommonjsModule(function (module, exports) { +"use strict"; + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.default = void 0; + +function _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _nonIterableRest(); } + +function _nonIterableRest() { throw new TypeError("Invalid attempt to destructure non-iterable instance"); } + +function _iterableToArrayLimit(arr, i) { var _arr = []; var _n = true; var _d = false; var _e = undefined; try { for (var _i = arr[Symbol.iterator](), _s; !(_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; } + +function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; } + +/*! + * XRegExp 4.2.0 + * + * Steven Levithan (c) 2007-present MIT License + */ + +/** + * XRegExp provides augmented, extensible regular expressions. You get additional regex syntax and + * flags, beyond what browsers support natively. XRegExp is also a regex utility belt with tools to + * make your client-side grepping simpler and more powerful, while freeing you from related + * cross-browser inconsistencies. + */ +// ==--------------------------== +// Private stuff +// ==--------------------------== +// Property name used for extended regex instance data +var REGEX_DATA = 'xregexp'; // Optional features that can be installed and uninstalled + +var features = { + astral: false, + namespacing: false +}; // Native methods to use and restore ('native' is an ES3 reserved keyword) + +var nativ = { + exec: RegExp.prototype.exec, + test: RegExp.prototype.test, + match: String.prototype.match, + replace: String.prototype.replace, + split: String.prototype.split +}; // Storage for fixed/extended native methods + +var fixed = {}; // Storage for regexes cached by `XRegExp.cache` + +var regexCache = {}; // Storage for pattern details cached by the `XRegExp` constructor + +var patternCache = {}; // Storage for regex syntax tokens added internally or by `XRegExp.addToken` + +var tokens = []; // Token scopes + +var defaultScope = 'default'; +var classScope = 'class'; // Regexes that match native regex syntax, including octals + +var nativeTokens = { + // Any native multicharacter token in default scope, or any single character + 'default': /\\(?:0(?:[0-3][0-7]{0,2}|[4-7][0-7]?)?|[1-9]\d*|x[\dA-Fa-f]{2}|u(?:[\dA-Fa-f]{4}|{[\dA-Fa-f]+})|c[A-Za-z]|[\s\S])|\(\?(?:[:=!]|<[=!])|[?*+]\?|{\d+(?:,\d*)?}\??|[\s\S]/, + // Any native multicharacter token in character class scope, or any single character + 'class': /\\(?:[0-3][0-7]{0,2}|[4-7][0-7]?|x[\dA-Fa-f]{2}|u(?:[\dA-Fa-f]{4}|{[\dA-Fa-f]+})|c[A-Za-z]|[\s\S])|[\s\S]/ +}; // Any backreference or dollar-prefixed character in replacement strings + +var replacementToken = /\$(?:{([\w$]+)}|<([\w$]+)>|(\d\d?|[\s\S]))/g; // Check for correct `exec` handling of nonparticipating capturing groups + +var correctExecNpcg = nativ.exec.call(/()??/, '')[1] === undefined; // Check for ES6 `flags` prop support + +var hasFlagsProp = /x/.flags !== undefined; // Shortcut to `Object.prototype.toString` + +var _ref = {}, + toString = _ref.toString; + +function hasNativeFlag(flag) { + // Can't check based on the presence of properties/getters since browsers might support such + // properties even when they don't support the corresponding flag in regex construction (tested + // in Chrome 48, where `'unicode' in /x/` is true but trying to construct a regex with flag `u` + // throws an error) + var isSupported = true; + + try { + // Can't use regex literals for testing even in a `try` because regex literals with + // unsupported flags cause a compilation error in IE + new RegExp('', flag); + } catch (exception) { + isSupported = false; + } + + return isSupported; +} // Check for ES6 `u` flag support + + +var hasNativeU = hasNativeFlag('u'); // Check for ES6 `y` flag support + +var hasNativeY = hasNativeFlag('y'); // Tracker for known flags, including addon flags + +var registeredFlags = { + g: true, + i: true, + m: true, + u: hasNativeU, + y: hasNativeY +}; +/** + * Attaches extended data and `XRegExp.prototype` properties to a regex object. + * + * @private + * @param {RegExp} regex Regex to augment. + * @param {Array} captureNames Array with capture names, or `null`. + * @param {String} xSource XRegExp pattern used to generate `regex`, or `null` if N/A. + * @param {String} xFlags XRegExp flags used to generate `regex`, or `null` if N/A. + * @param {Boolean} [isInternalOnly=false] Whether the regex will be used only for internal + * operations, and never exposed to users. For internal-only regexes, we can improve perf by + * skipping some operations like attaching `XRegExp.prototype` properties. + * @returns {RegExp} Augmented regex. + */ + +function augment(regex, captureNames, xSource, xFlags, isInternalOnly) { + regex[REGEX_DATA] = { + captureNames: captureNames + }; + + if (isInternalOnly) { + return regex; + } // Can't auto-inherit these since the XRegExp constructor returns a nonprimitive value + + + if (regex.__proto__) { + regex.__proto__ = XRegExp.prototype; + } else { + for (var p in XRegExp.prototype) { + // An `XRegExp.prototype.hasOwnProperty(p)` check wouldn't be worth it here, since this + // is performance sensitive, and enumerable `Object.prototype` or `RegExp.prototype` + // extensions exist on `regex.prototype` anyway + regex[p] = XRegExp.prototype[p]; + } + } + + regex[REGEX_DATA].source = xSource; // Emulate the ES6 `flags` prop by ensuring flags are in alphabetical order + + regex[REGEX_DATA].flags = xFlags ? xFlags.split('').sort().join('') : xFlags; + return regex; +} +/** + * Removes any duplicate characters from the provided string. + * + * @private + * @param {String} str String to remove duplicate characters from. + * @returns {String} String with any duplicate characters removed. + */ + + +function clipDuplicates(str) { + return nativ.replace.call(str, /([\s\S])(?=[\s\S]*\1)/g, ''); +} +/** + * Copies a regex object while preserving extended data and augmenting with `XRegExp.prototype` + * properties. The copy has a fresh `lastIndex` property (set to zero). Allows adding and removing + * flags g and y while copying the regex. + * + * @private + * @param {RegExp} regex Regex to copy. + * @param {Object} [options] Options object with optional properties: + * - `addG` {Boolean} Add flag g while copying the regex. + * - `addY` {Boolean} Add flag y while copying the regex. + * - `removeG` {Boolean} Remove flag g while copying the regex. + * - `removeY` {Boolean} Remove flag y while copying the regex. + * - `isInternalOnly` {Boolean} Whether the copied regex will be used only for internal + * operations, and never exposed to users. For internal-only regexes, we can improve perf by + * skipping some operations like attaching `XRegExp.prototype` properties. + * - `source` {String} Overrides `.source`, for special cases. + * @returns {RegExp} Copy of the provided regex, possibly with modified flags. + */ + + +function copyRegex(regex, options) { + if (!XRegExp.isRegExp(regex)) { + throw new TypeError('Type RegExp expected'); + } + + var xData = regex[REGEX_DATA] || {}; + var flags = getNativeFlags(regex); + var flagsToAdd = ''; + var flagsToRemove = ''; + var xregexpSource = null; + var xregexpFlags = null; + options = options || {}; + + if (options.removeG) { + flagsToRemove += 'g'; + } + + if (options.removeY) { + flagsToRemove += 'y'; + } + + if (flagsToRemove) { + flags = nativ.replace.call(flags, new RegExp("[".concat(flagsToRemove, "]+"), 'g'), ''); + } + + if (options.addG) { + flagsToAdd += 'g'; + } + + if (options.addY) { + flagsToAdd += 'y'; + } + + if (flagsToAdd) { + flags = clipDuplicates(flags + flagsToAdd); + } + + if (!options.isInternalOnly) { + if (xData.source !== undefined) { + xregexpSource = xData.source; + } // null or undefined; don't want to add to `flags` if the previous value was null, since + // that indicates we're not tracking original precompilation flags + + + if (xData.flags != null) { + // Flags are only added for non-internal regexes by `XRegExp.globalize`. Flags are never + // removed for non-internal regexes, so don't need to handle it + xregexpFlags = flagsToAdd ? clipDuplicates(xData.flags + flagsToAdd) : xData.flags; + } + } // Augment with `XRegExp.prototype` properties, but use the native `RegExp` constructor to avoid + // searching for special tokens. That would be wrong for regexes constructed by `RegExp`, and + // unnecessary for regexes constructed by `XRegExp` because the regex has already undergone the + // translation to native regex syntax + + + regex = augment(new RegExp(options.source || regex.source, flags), hasNamedCapture(regex) ? xData.captureNames.slice(0) : null, xregexpSource, xregexpFlags, options.isInternalOnly); + return regex; +} +/** + * Converts hexadecimal to decimal. + * + * @private + * @param {String} hex + * @returns {Number} + */ + + +function dec(hex) { + return parseInt(hex, 16); +} +/** + * Returns a pattern that can be used in a native RegExp in place of an ignorable token such as an + * inline comment or whitespace with flag x. This is used directly as a token handler function + * passed to `XRegExp.addToken`. + * + * @private + * @param {String} match Match arg of `XRegExp.addToken` handler + * @param {String} scope Scope arg of `XRegExp.addToken` handler + * @param {String} flags Flags arg of `XRegExp.addToken` handler + * @returns {String} Either '' or '(?:)', depending on which is needed in the context of the match. + */ + + +function getContextualTokenSeparator(match, scope, flags) { + if ( // No need to separate tokens if at the beginning or end of a group + match.input[match.index - 1] === '(' || match.input[match.index + match[0].length] === ')' || // No need to separate tokens if before or after a `|` + match.input[match.index - 1] === '|' || match.input[match.index + match[0].length] === '|' || // No need to separate tokens if at the beginning or end of the pattern + match.index < 1 || match.index + match[0].length >= match.input.length || // No need to separate tokens if at the beginning of a noncapturing group or lookahead. + // The way this is written relies on: + // - The search regex matching only 3-char strings. + // - Although `substr` gives chars from the end of the string if given a negative index, + // the resulting substring will be too short to match. Ex: `'abcd'.substr(-1, 3) === 'd'` + nativ.test.call(/^\(\?[:=!]/, match.input.substr(match.index - 3, 3)) || // Avoid separating tokens when the following token is a quantifier + isQuantifierNext(match.input, match.index + match[0].length, flags)) { + return ''; + } // Keep tokens separated. This avoids e.g. inadvertedly changing `\1 1` or `\1(?#)1` to `\11`. + // This also ensures all tokens remain as discrete atoms, e.g. it avoids converting the syntax + // error `(? :` into `(?:`. + + + return '(?:)'; +} +/** + * Returns native `RegExp` flags used by a regex object. + * + * @private + * @param {RegExp} regex Regex to check. + * @returns {String} Native flags in use. + */ + + +function getNativeFlags(regex) { + return hasFlagsProp ? regex.flags : // Explicitly using `RegExp.prototype.toString` (rather than e.g. `String` or concatenation + // with an empty string) allows this to continue working predictably when + // `XRegExp.proptotype.toString` is overridden + nativ.exec.call(/\/([a-z]*)$/i, RegExp.prototype.toString.call(regex))[1]; +} +/** + * Determines whether a regex has extended instance data used to track capture names. + * + * @private + * @param {RegExp} regex Regex to check. + * @returns {Boolean} Whether the regex uses named capture. + */ + + +function hasNamedCapture(regex) { + return !!(regex[REGEX_DATA] && regex[REGEX_DATA].captureNames); +} +/** + * Converts decimal to hexadecimal. + * + * @private + * @param {Number|String} dec + * @returns {String} + */ + + +function hex(dec) { + return parseInt(dec, 10).toString(16); +} +/** + * Checks whether the next nonignorable token after the specified position is a quantifier. + * + * @private + * @param {String} pattern Pattern to search within. + * @param {Number} pos Index in `pattern` to search at. + * @param {String} flags Flags used by the pattern. + * @returns {Boolean} Whether the next nonignorable token is a quantifier. + */ + + +function isQuantifierNext(pattern, pos, flags) { + return nativ.test.call(flags.indexOf('x') !== -1 ? // Ignore any leading whitespace, line comments, and inline comments + /^(?:\s|#[^#\n]*|\(\?#[^)]*\))*(?:[?*+]|{\d+(?:,\d*)?})/ : // Ignore any leading inline comments + /^(?:\(\?#[^)]*\))*(?:[?*+]|{\d+(?:,\d*)?})/, pattern.slice(pos)); +} +/** + * Determines whether a value is of the specified type, by resolving its internal [[Class]]. + * + * @private + * @param {*} value Object to check. + * @param {String} type Type to check for, in TitleCase. + * @returns {Boolean} Whether the object matches the type. + */ + + +function isType(value, type) { + return toString.call(value) === "[object ".concat(type, "]"); +} +/** + * Adds leading zeros if shorter than four characters. Used for fixed-length hexadecimal values. + * + * @private + * @param {String} str + * @returns {String} + */ + + +function pad4(str) { + while (str.length < 4) { + str = "0".concat(str); + } + + return str; +} +/** + * Checks for flag-related errors, and strips/applies flags in a leading mode modifier. Offloads + * the flag preparation logic from the `XRegExp` constructor. + * + * @private + * @param {String} pattern Regex pattern, possibly with a leading mode modifier. + * @param {String} flags Any combination of flags. + * @returns {Object} Object with properties `pattern` and `flags`. + */ + + +function prepareFlags(pattern, flags) { + // Recent browsers throw on duplicate flags, so copy this behavior for nonnative flags + if (clipDuplicates(flags) !== flags) { + throw new SyntaxError("Invalid duplicate regex flag ".concat(flags)); + } // Strip and apply a leading mode modifier with any combination of flags except g or y + + + pattern = nativ.replace.call(pattern, /^\(\?([\w$]+)\)/, function ($0, $1) { + if (nativ.test.call(/[gy]/, $1)) { + throw new SyntaxError("Cannot use flag g or y in mode modifier ".concat($0)); + } // Allow duplicate flags within the mode modifier + + + flags = clipDuplicates(flags + $1); + return ''; + }); // Throw on unknown native or nonnative flags + + var _iteratorNormalCompletion = true; + var _didIteratorError = false; + var _iteratorError = undefined; + + try { + for (var _iterator = flags[Symbol.iterator](), _step; !(_iteratorNormalCompletion = (_step = _iterator.next()).done); _iteratorNormalCompletion = true) { + var flag = _step.value; + + if (!registeredFlags[flag]) { + throw new SyntaxError("Unknown regex flag ".concat(flag)); + } + } + } catch (err) { + _didIteratorError = true; + _iteratorError = err; + } finally { + try { + if (!_iteratorNormalCompletion && _iterator.return != null) { + _iterator.return(); + } + } finally { + if (_didIteratorError) { + throw _iteratorError; + } + } + } + + return { + pattern: pattern, + flags: flags + }; +} +/** + * Prepares an options object from the given value. + * + * @private + * @param {String|Object} value Value to convert to an options object. + * @returns {Object} Options object. + */ + + +function prepareOptions(value) { + var options = {}; + + if (isType(value, 'String')) { + XRegExp.forEach(value, /[^\s,]+/, function (match) { + options[match] = true; + }); + return options; + } + + return value; +} +/** + * Registers a flag so it doesn't throw an 'unknown flag' error. + * + * @private + * @param {String} flag Single-character flag to register. + */ + + +function registerFlag(flag) { + if (!/^[\w$]$/.test(flag)) { + throw new Error('Flag must be a single character A-Za-z0-9_$'); + } + + registeredFlags[flag] = true; +} +/** + * Runs built-in and custom regex syntax tokens in reverse insertion order at the specified + * position, until a match is found. + * + * @private + * @param {String} pattern Original pattern from which an XRegExp object is being built. + * @param {String} flags Flags being used to construct the regex. + * @param {Number} pos Position to search for tokens within `pattern`. + * @param {Number} scope Regex scope to apply: 'default' or 'class'. + * @param {Object} context Context object to use for token handler functions. + * @returns {Object} Object with properties `matchLength`, `output`, and `reparse`; or `null`. + */ + + +function runTokens(pattern, flags, pos, scope, context) { + var i = tokens.length; + var leadChar = pattern[pos]; + var result = null; + var match; + var t; // Run in reverse insertion order + + while (i--) { + t = tokens[i]; + + if (t.leadChar && t.leadChar !== leadChar || t.scope !== scope && t.scope !== 'all' || t.flag && !(flags.indexOf(t.flag) !== -1)) { + continue; + } + + match = XRegExp.exec(pattern, t.regex, pos, 'sticky'); + + if (match) { + result = { + matchLength: match[0].length, + output: t.handler.call(context, match, scope, flags), + reparse: t.reparse + }; // Finished with token tests + + break; + } + } + + return result; +} +/** + * Enables or disables implicit astral mode opt-in. When enabled, flag A is automatically added to + * all new regexes created by XRegExp. This causes an error to be thrown when creating regexes if + * the Unicode Base addon is not available, since flag A is registered by that addon. + * + * @private + * @param {Boolean} on `true` to enable; `false` to disable. + */ + + +function setAstral(on) { + features.astral = on; +} +/** + * Adds named capture groups to the `groups` property of match arrays. See here for details: + * https://github.com/tc39/proposal-regexp-named-groups + * + * @private + * @param {Boolean} on `true` to enable; `false` to disable. + */ + + +function setNamespacing(on) { + features.namespacing = on; +} +/** + * Returns the object, or throws an error if it is `null` or `undefined`. This is used to follow + * the ES5 abstract operation `ToObject`. + * + * @private + * @param {*} value Object to check and return. + * @returns {*} The provided object. + */ + + +function toObject(value) { + // null or undefined + if (value == null) { + throw new TypeError('Cannot convert null or undefined to object'); + } + + return value; +} // ==--------------------------== +// Constructor +// ==--------------------------== + +/** + * Creates an extended regular expression object for matching text with a pattern. Differs from a + * native regular expression in that additional syntax and flags are supported. The returned object + * is in fact a native `RegExp` and works with all native methods. + * + * @class XRegExp + * @constructor + * @param {String|RegExp} pattern Regex pattern string, or an existing regex object to copy. + * @param {String} [flags] Any combination of flags. + * Native flags: + * - `g` - global + * - `i` - ignore case + * - `m` - multiline anchors + * - `u` - unicode (ES6) + * - `y` - sticky (Firefox 3+, ES6) + * Additional XRegExp flags: + * - `n` - explicit capture + * - `s` - dot matches all (aka singleline) + * - `x` - free-spacing and line comments (aka extended) + * - `A` - astral (requires the Unicode Base addon) + * Flags cannot be provided when constructing one `RegExp` from another. + * @returns {RegExp} Extended regular expression object. + * @example + * + * // With named capture and flag x + * XRegExp(`(? [0-9]{4} ) -? # year + * (? [0-9]{2} ) -? # month + * (? [0-9]{2} ) # day`, 'x'); + * + * // Providing a regex object copies it. Native regexes are recompiled using native (not XRegExp) + * // syntax. Copies maintain extended data, are augmented with `XRegExp.prototype` properties, and + * // have fresh `lastIndex` properties (set to zero). + * XRegExp(/regex/); + */ + + +function XRegExp(pattern, flags) { + if (XRegExp.isRegExp(pattern)) { + if (flags !== undefined) { + throw new TypeError('Cannot supply flags when copying a RegExp'); + } + + return copyRegex(pattern); + } // Copy the argument behavior of `RegExp` + + + pattern = pattern === undefined ? '' : String(pattern); + flags = flags === undefined ? '' : String(flags); + + if (XRegExp.isInstalled('astral') && !(flags.indexOf('A') !== -1)) { + // This causes an error to be thrown if the Unicode Base addon is not available + flags += 'A'; + } + + if (!patternCache[pattern]) { + patternCache[pattern] = {}; + } + + if (!patternCache[pattern][flags]) { + var context = { + hasNamedCapture: false, + captureNames: [] + }; + var scope = defaultScope; + var output = ''; + var pos = 0; + var result; // Check for flag-related errors, and strip/apply flags in a leading mode modifier + + var applied = prepareFlags(pattern, flags); + var appliedPattern = applied.pattern; + var appliedFlags = applied.flags; // Use XRegExp's tokens to translate the pattern to a native regex pattern. + // `appliedPattern.length` may change on each iteration if tokens use `reparse` + + while (pos < appliedPattern.length) { + do { + // Check for custom tokens at the current position + result = runTokens(appliedPattern, appliedFlags, pos, scope, context); // If the matched token used the `reparse` option, splice its output into the + // pattern before running tokens again at the same position + + if (result && result.reparse) { + appliedPattern = appliedPattern.slice(0, pos) + result.output + appliedPattern.slice(pos + result.matchLength); + } + } while (result && result.reparse); + + if (result) { + output += result.output; + pos += result.matchLength || 1; + } else { + // Get the native token at the current position + var _XRegExp$exec = XRegExp.exec(appliedPattern, nativeTokens[scope], pos, 'sticky'), + _XRegExp$exec2 = _slicedToArray(_XRegExp$exec, 1), + token = _XRegExp$exec2[0]; + + output += token; + pos += token.length; + + if (token === '[' && scope === defaultScope) { + scope = classScope; + } else if (token === ']' && scope === classScope) { + scope = defaultScope; + } + } + } + + patternCache[pattern][flags] = { + // Use basic cleanup to collapse repeated empty groups like `(?:)(?:)` to `(?:)`. Empty + // groups are sometimes inserted during regex transpilation in order to keep tokens + // separated. However, more than one empty group in a row is never needed. + pattern: nativ.replace.call(output, /(?:\(\?:\))+/g, '(?:)'), + // Strip all but native flags + flags: nativ.replace.call(appliedFlags, /[^gimuy]+/g, ''), + // `context.captureNames` has an item for each capturing group, even if unnamed + captures: context.hasNamedCapture ? context.captureNames : null + }; + } + + var generated = patternCache[pattern][flags]; + return augment(new RegExp(generated.pattern, generated.flags), generated.captures, pattern, flags); +} // Add `RegExp.prototype` to the prototype chain + + +XRegExp.prototype = /(?:)/; // ==--------------------------== +// Public properties +// ==--------------------------== + +/** + * The XRegExp version number as a string containing three dot-separated parts. For example, + * '2.0.0-beta-3'. + * + * @static + * @memberOf XRegExp + * @type String + */ + +XRegExp.version = '4.2.0'; // ==--------------------------== +// Public methods +// ==--------------------------== +// Intentionally undocumented; used in tests and addons + +XRegExp._clipDuplicates = clipDuplicates; +XRegExp._hasNativeFlag = hasNativeFlag; +XRegExp._dec = dec; +XRegExp._hex = hex; +XRegExp._pad4 = pad4; +/** + * Extends XRegExp syntax and allows custom flags. This is used internally and can be used to + * create XRegExp addons. If more than one token can match the same string, the last added wins. + * + * @memberOf XRegExp + * @param {RegExp} regex Regex object that matches the new token. + * @param {Function} handler Function that returns a new pattern string (using native regex syntax) + * to replace the matched token within all future XRegExp regexes. Has access to persistent + * properties of the regex being built, through `this`. Invoked with three arguments: + * - The match array, with named backreference properties. + * - The regex scope where the match was found: 'default' or 'class'. + * - The flags used by the regex, including any flags in a leading mode modifier. + * The handler function becomes part of the XRegExp construction process, so be careful not to + * construct XRegExps within the function or you will trigger infinite recursion. + * @param {Object} [options] Options object with optional properties: + * - `scope` {String} Scope where the token applies: 'default', 'class', or 'all'. + * - `flag` {String} Single-character flag that triggers the token. This also registers the + * flag, which prevents XRegExp from throwing an 'unknown flag' error when the flag is used. + * - `optionalFlags` {String} Any custom flags checked for within the token `handler` that are + * not required to trigger the token. This registers the flags, to prevent XRegExp from + * throwing an 'unknown flag' error when any of the flags are used. + * - `reparse` {Boolean} Whether the `handler` function's output should not be treated as + * final, and instead be reparseable by other tokens (including the current token). Allows + * token chaining or deferring. + * - `leadChar` {String} Single character that occurs at the beginning of any successful match + * of the token (not always applicable). This doesn't change the behavior of the token unless + * you provide an erroneous value. However, providing it can increase the token's performance + * since the token can be skipped at any positions where this character doesn't appear. + * @example + * + * // Basic usage: Add \a for the ALERT control code + * XRegExp.addToken( + * /\\a/, + * () => '\\x07', + * {scope: 'all'} + * ); + * XRegExp('\\a[\\a-\\n]+').test('\x07\n\x07'); // -> true + * + * // Add the U (ungreedy) flag from PCRE and RE2, which reverses greedy and lazy quantifiers. + * // Since `scope` is not specified, it uses 'default' (i.e., transformations apply outside of + * // character classes only) + * XRegExp.addToken( + * /([?*+]|{\d+(?:,\d*)?})(\??)/, + * (match) => `${match[1]}${match[2] ? '' : '?'}`, + * {flag: 'U'} + * ); + * XRegExp('a+', 'U').exec('aaa')[0]; // -> 'a' + * XRegExp('a+?', 'U').exec('aaa')[0]; // -> 'aaa' + */ + +XRegExp.addToken = function (regex, handler, options) { + options = options || {}; + var _options = options, + optionalFlags = _options.optionalFlags; + + if (options.flag) { + registerFlag(options.flag); + } + + if (optionalFlags) { + optionalFlags = nativ.split.call(optionalFlags, ''); + var _iteratorNormalCompletion2 = true; + var _didIteratorError2 = false; + var _iteratorError2 = undefined; + + try { + for (var _iterator2 = optionalFlags[Symbol.iterator](), _step2; !(_iteratorNormalCompletion2 = (_step2 = _iterator2.next()).done); _iteratorNormalCompletion2 = true) { + var flag = _step2.value; + registerFlag(flag); + } + } catch (err) { + _didIteratorError2 = true; + _iteratorError2 = err; + } finally { + try { + if (!_iteratorNormalCompletion2 && _iterator2.return != null) { + _iterator2.return(); + } + } finally { + if (_didIteratorError2) { + throw _iteratorError2; + } + } + } + } // Add to the private list of syntax tokens + + + tokens.push({ + regex: copyRegex(regex, { + addG: true, + addY: hasNativeY, + isInternalOnly: true + }), + handler: handler, + scope: options.scope || defaultScope, + flag: options.flag, + reparse: options.reparse, + leadChar: options.leadChar + }); // Reset the pattern cache used by the `XRegExp` constructor, since the same pattern and flags + // might now produce different results + + XRegExp.cache.flush('patterns'); +}; +/** + * Caches and returns the result of calling `XRegExp(pattern, flags)`. On any subsequent call with + * the same pattern and flag combination, the cached copy of the regex is returned. + * + * @memberOf XRegExp + * @param {String} pattern Regex pattern string. + * @param {String} [flags] Any combination of XRegExp flags. + * @returns {RegExp} Cached XRegExp object. + * @example + * + * while (match = XRegExp.cache('.', 'gs').exec(str)) { + * // The regex is compiled once only + * } + */ + + +XRegExp.cache = function (pattern, flags) { + if (!regexCache[pattern]) { + regexCache[pattern] = {}; + } + + return regexCache[pattern][flags] || (regexCache[pattern][flags] = XRegExp(pattern, flags)); +}; // Intentionally undocumented; used in tests + + +XRegExp.cache.flush = function (cacheName) { + if (cacheName === 'patterns') { + // Flush the pattern cache used by the `XRegExp` constructor + patternCache = {}; + } else { + // Flush the regex cache populated by `XRegExp.cache` + regexCache = {}; + } +}; +/** + * Escapes any regular expression metacharacters, for use when matching literal strings. The result + * can safely be used at any point within a regex that uses any flags. + * + * @memberOf XRegExp + * @param {String} str String to escape. + * @returns {String} String with regex metacharacters escaped. + * @example + * + * XRegExp.escape('Escaped? <.>'); + * // -> 'Escaped\?\ <\.>' + */ + + +XRegExp.escape = function (str) { + return nativ.replace.call(toObject(str), /[-\[\]{}()*+?.,\\^$|#\s]/g, '\\$&'); +}; +/** + * Executes a regex search in a specified string. Returns a match array or `null`. If the provided + * regex uses named capture, named backreference properties are included on the match array. + * Optional `pos` and `sticky` arguments specify the search start position, and whether the match + * must start at the specified position only. The `lastIndex` property of the provided regex is not + * used, but is updated for compatibility. Also fixes browser bugs compared to the native + * `RegExp.prototype.exec` and can be used reliably cross-browser. + * + * @memberOf XRegExp + * @param {String} str String to search. + * @param {RegExp} regex Regex to search with. + * @param {Number} [pos=0] Zero-based index at which to start the search. + * @param {Boolean|String} [sticky=false] Whether the match must start at the specified position + * only. The string `'sticky'` is accepted as an alternative to `true`. + * @returns {Array} Match array with named backreference properties, or `null`. + * @example + * + * // Basic use, with named backreference + * let match = XRegExp.exec('U+2620', XRegExp('U\\+(?[0-9A-F]{4})')); + * match.hex; // -> '2620' + * + * // With pos and sticky, in a loop + * let pos = 2, result = [], match; + * while (match = XRegExp.exec('<1><2><3><4>5<6>', /<(\d)>/, pos, 'sticky')) { + * result.push(match[1]); + * pos = match.index + match[0].length; + * } + * // result -> ['2', '3', '4'] + */ + + +XRegExp.exec = function (str, regex, pos, sticky) { + var cacheKey = 'g'; + var addY = false; + var fakeY = false; + var match; + addY = hasNativeY && !!(sticky || regex.sticky && sticky !== false); + + if (addY) { + cacheKey += 'y'; + } else if (sticky) { + // Simulate sticky matching by appending an empty capture to the original regex. The + // resulting regex will succeed no matter what at the current index (set with `lastIndex`), + // and will not search the rest of the subject string. We'll know that the original regex + // has failed if that last capture is `''` rather than `undefined` (i.e., if that last + // capture participated in the match). + fakeY = true; + cacheKey += 'FakeY'; + } + + regex[REGEX_DATA] = regex[REGEX_DATA] || {}; // Shares cached copies with `XRegExp.match`/`replace` + + var r2 = regex[REGEX_DATA][cacheKey] || (regex[REGEX_DATA][cacheKey] = copyRegex(regex, { + addG: true, + addY: addY, + source: fakeY ? "".concat(regex.source, "|()") : undefined, + removeY: sticky === false, + isInternalOnly: true + })); + pos = pos || 0; + r2.lastIndex = pos; // Fixed `exec` required for `lastIndex` fix, named backreferences, etc. + + match = fixed.exec.call(r2, str); // Get rid of the capture added by the pseudo-sticky matcher if needed. An empty string means + // the original regexp failed (see above). + + if (fakeY && match && match.pop() === '') { + match = null; + } + + if (regex.global) { + regex.lastIndex = match ? r2.lastIndex : 0; + } + + return match; +}; +/** + * Executes a provided function once per regex match. Searches always start at the beginning of the + * string and continue until the end, regardless of the state of the regex's `global` property and + * initial `lastIndex`. + * + * @memberOf XRegExp + * @param {String} str String to search. + * @param {RegExp} regex Regex to search with. + * @param {Function} callback Function to execute for each match. Invoked with four arguments: + * - The match array, with named backreference properties. + * - The zero-based match index. + * - The string being traversed. + * - The regex object being used to traverse the string. + * @example + * + * // Extracts every other digit from a string + * const evens = []; + * XRegExp.forEach('1a2345', /\d/, (match, i) => { + * if (i % 2) evens.push(+match[0]); + * }); + * // evens -> [2, 4] + */ + + +XRegExp.forEach = function (str, regex, callback) { + var pos = 0; + var i = -1; + var match; + + while (match = XRegExp.exec(str, regex, pos)) { + // Because `regex` is provided to `callback`, the function could use the deprecated/ + // nonstandard `RegExp.prototype.compile` to mutate the regex. However, since `XRegExp.exec` + // doesn't use `lastIndex` to set the search position, this can't lead to an infinite loop, + // at least. Actually, because of the way `XRegExp.exec` caches globalized versions of + // regexes, mutating the regex will not have any effect on the iteration or matched strings, + // which is a nice side effect that brings extra safety. + callback(match, ++i, str, regex); + pos = match.index + (match[0].length || 1); + } +}; +/** + * Copies a regex object and adds flag `g`. The copy maintains extended data, is augmented with + * `XRegExp.prototype` properties, and has a fresh `lastIndex` property (set to zero). Native + * regexes are not recompiled using XRegExp syntax. + * + * @memberOf XRegExp + * @param {RegExp} regex Regex to globalize. + * @returns {RegExp} Copy of the provided regex with flag `g` added. + * @example + * + * const globalCopy = XRegExp.globalize(/regex/); + * globalCopy.global; // -> true + */ + + +XRegExp.globalize = function (regex) { + return copyRegex(regex, { + addG: true + }); +}; +/** + * Installs optional features according to the specified options. Can be undone using + * `XRegExp.uninstall`. + * + * @memberOf XRegExp + * @param {Object|String} options Options object or string. + * @example + * + * // With an options object + * XRegExp.install({ + * // Enables support for astral code points in Unicode addons (implicitly sets flag A) + * astral: true, + * + * // Adds named capture groups to the `groups` property of matches + * namespacing: true + * }); + * + * // With an options string + * XRegExp.install('astral namespacing'); + */ + + +XRegExp.install = function (options) { + options = prepareOptions(options); + + if (!features.astral && options.astral) { + setAstral(true); + } + + if (!features.namespacing && options.namespacing) { + setNamespacing(true); + } +}; +/** + * Checks whether an individual optional feature is installed. + * + * @memberOf XRegExp + * @param {String} feature Name of the feature to check. One of: + * - `astral` + * - `namespacing` + * @returns {Boolean} Whether the feature is installed. + * @example + * + * XRegExp.isInstalled('astral'); + */ + + +XRegExp.isInstalled = function (feature) { + return !!features[feature]; +}; +/** + * Returns `true` if an object is a regex; `false` if it isn't. This works correctly for regexes + * created in another frame, when `instanceof` and `constructor` checks would fail. + * + * @memberOf XRegExp + * @param {*} value Object to check. + * @returns {Boolean} Whether the object is a `RegExp` object. + * @example + * + * XRegExp.isRegExp('string'); // -> false + * XRegExp.isRegExp(/regex/i); // -> true + * XRegExp.isRegExp(RegExp('^', 'm')); // -> true + * XRegExp.isRegExp(XRegExp('(?s).')); // -> true + */ + + +XRegExp.isRegExp = function (value) { + return toString.call(value) === '[object RegExp]'; +}; // isType(value, 'RegExp'); + +/** + * Returns the first matched string, or in global mode, an array containing all matched strings. + * This is essentially a more convenient re-implementation of `String.prototype.match` that gives + * the result types you actually want (string instead of `exec`-style array in match-first mode, + * and an empty array instead of `null` when no matches are found in match-all mode). It also lets + * you override flag g and ignore `lastIndex`, and fixes browser bugs. + * + * @memberOf XRegExp + * @param {String} str String to search. + * @param {RegExp} regex Regex to search with. + * @param {String} [scope='one'] Use 'one' to return the first match as a string. Use 'all' to + * return an array of all matched strings. If not explicitly specified and `regex` uses flag g, + * `scope` is 'all'. + * @returns {String|Array} In match-first mode: First match as a string, or `null`. In match-all + * mode: Array of all matched strings, or an empty array. + * @example + * + * // Match first + * XRegExp.match('abc', /\w/); // -> 'a' + * XRegExp.match('abc', /\w/g, 'one'); // -> 'a' + * XRegExp.match('abc', /x/g, 'one'); // -> null + * + * // Match all + * XRegExp.match('abc', /\w/g); // -> ['a', 'b', 'c'] + * XRegExp.match('abc', /\w/, 'all'); // -> ['a', 'b', 'c'] + * XRegExp.match('abc', /x/, 'all'); // -> [] + */ + + +XRegExp.match = function (str, regex, scope) { + var global = regex.global && scope !== 'one' || scope === 'all'; + var cacheKey = (global ? 'g' : '') + (regex.sticky ? 'y' : '') || 'noGY'; + regex[REGEX_DATA] = regex[REGEX_DATA] || {}; // Shares cached copies with `XRegExp.exec`/`replace` + + var r2 = regex[REGEX_DATA][cacheKey] || (regex[REGEX_DATA][cacheKey] = copyRegex(regex, { + addG: !!global, + removeG: scope === 'one', + isInternalOnly: true + })); + var result = nativ.match.call(toObject(str), r2); + + if (regex.global) { + regex.lastIndex = scope === 'one' && result ? // Can't use `r2.lastIndex` since `r2` is nonglobal in this case + result.index + result[0].length : 0; + } + + return global ? result || [] : result && result[0]; +}; +/** + * Retrieves the matches from searching a string using a chain of regexes that successively search + * within previous matches. The provided `chain` array can contain regexes and or objects with + * `regex` and `backref` properties. When a backreference is specified, the named or numbered + * backreference is passed forward to the next regex or returned. + * + * @memberOf XRegExp + * @param {String} str String to search. + * @param {Array} chain Regexes that each search for matches within preceding results. + * @returns {Array} Matches by the last regex in the chain, or an empty array. + * @example + * + * // Basic usage; matches numbers within tags + * XRegExp.matchChain('1 2 3 4 a 56', [ + * XRegExp('(?is).*?'), + * /\d+/ + * ]); + * // -> ['2', '4', '56'] + * + * // Passing forward and returning specific backreferences + * html = '
XRegExp\ + * Google'; + * XRegExp.matchChain(html, [ + * {regex: //i, backref: 1}, + * {regex: XRegExp('(?i)^https?://(?[^/?#]+)'), backref: 'domain'} + * ]); + * // -> ['xregexp.com', 'www.google.com'] + */ + + +XRegExp.matchChain = function (str, chain) { + return function recurseChain(values, level) { + var item = chain[level].regex ? chain[level] : { + regex: chain[level] + }; + var matches = []; + + function addMatch(match) { + if (item.backref) { + var ERR_UNDEFINED_GROUP = "Backreference to undefined group: ".concat(item.backref); + var isNamedBackref = isNaN(item.backref); + + if (isNamedBackref && XRegExp.isInstalled('namespacing')) { + // `groups` has `null` as prototype, so using `in` instead of `hasOwnProperty` + if (!(item.backref in match.groups)) { + throw new ReferenceError(ERR_UNDEFINED_GROUP); + } + } else if (!match.hasOwnProperty(item.backref)) { + throw new ReferenceError(ERR_UNDEFINED_GROUP); + } + + var backrefValue = isNamedBackref && XRegExp.isInstalled('namespacing') ? match.groups[item.backref] : match[item.backref]; + matches.push(backrefValue || ''); + } else { + matches.push(match[0]); + } + } + + var _iteratorNormalCompletion3 = true; + var _didIteratorError3 = false; + var _iteratorError3 = undefined; + + try { + for (var _iterator3 = values[Symbol.iterator](), _step3; !(_iteratorNormalCompletion3 = (_step3 = _iterator3.next()).done); _iteratorNormalCompletion3 = true) { + var value = _step3.value; + XRegExp.forEach(value, item.regex, addMatch); + } + } catch (err) { + _didIteratorError3 = true; + _iteratorError3 = err; + } finally { + try { + if (!_iteratorNormalCompletion3 && _iterator3.return != null) { + _iterator3.return(); + } + } finally { + if (_didIteratorError3) { + throw _iteratorError3; + } + } + } + + return level === chain.length - 1 || !matches.length ? matches : recurseChain(matches, level + 1); + }([str], 0); +}; +/** + * Returns a new string with one or all matches of a pattern replaced. The pattern can be a string + * or regex, and the replacement can be a string or a function to be called for each match. To + * perform a global search and replace, use the optional `scope` argument or include flag g if using + * a regex. Replacement strings can use `${n}` or `$` for named and numbered backreferences. + * Replacement functions can use named backreferences via `arguments[0].name`. Also fixes browser + * bugs compared to the native `String.prototype.replace` and can be used reliably cross-browser. + * + * @memberOf XRegExp + * @param {String} str String to search. + * @param {RegExp|String} search Search pattern to be replaced. + * @param {String|Function} replacement Replacement string or a function invoked to create it. + * Replacement strings can include special replacement syntax: + * - $$ - Inserts a literal $ character. + * - $&, $0 - Inserts the matched substring. + * - $` - Inserts the string that precedes the matched substring (left context). + * - $' - Inserts the string that follows the matched substring (right context). + * - $n, $nn - Where n/nn are digits referencing an existent capturing group, inserts + * backreference n/nn. + * - ${n}, $ - Where n is a name or any number of digits that reference an existent capturing + * group, inserts backreference n. + * Replacement functions are invoked with three or more arguments: + * - The matched substring (corresponds to $& above). Named backreferences are accessible as + * properties of this first argument. + * - 0..n arguments, one for each backreference (corresponding to $1, $2, etc. above). + * - The zero-based index of the match within the total search string. + * - The total string being searched. + * @param {String} [scope='one'] Use 'one' to replace the first match only, or 'all'. If not + * explicitly specified and using a regex with flag g, `scope` is 'all'. + * @returns {String} New string with one or all matches replaced. + * @example + * + * // Regex search, using named backreferences in replacement string + * const name = XRegExp('(?\\w+) (?\\w+)'); + * XRegExp.replace('John Smith', name, '$, $'); + * // -> 'Smith, John' + * + * // Regex search, using named backreferences in replacement function + * XRegExp.replace('John Smith', name, (match) => `${match.last}, ${match.first}`); + * // -> 'Smith, John' + * + * // String search, with replace-all + * XRegExp.replace('RegExp builds RegExps', 'RegExp', 'XRegExp', 'all'); + * // -> 'XRegExp builds XRegExps' + */ + + +XRegExp.replace = function (str, search, replacement, scope) { + var isRegex = XRegExp.isRegExp(search); + var global = search.global && scope !== 'one' || scope === 'all'; + var cacheKey = (global ? 'g' : '') + (search.sticky ? 'y' : '') || 'noGY'; + var s2 = search; + + if (isRegex) { + search[REGEX_DATA] = search[REGEX_DATA] || {}; // Shares cached copies with `XRegExp.exec`/`match`. Since a copy is used, `search`'s + // `lastIndex` isn't updated *during* replacement iterations + + s2 = search[REGEX_DATA][cacheKey] || (search[REGEX_DATA][cacheKey] = copyRegex(search, { + addG: !!global, + removeG: scope === 'one', + isInternalOnly: true + })); + } else if (global) { + s2 = new RegExp(XRegExp.escape(String(search)), 'g'); + } // Fixed `replace` required for named backreferences, etc. + + + var result = fixed.replace.call(toObject(str), s2, replacement); + + if (isRegex && search.global) { + // Fixes IE, Safari bug (last tested IE 9, Safari 5.1) + search.lastIndex = 0; + } + + return result; +}; +/** + * Performs batch processing of string replacements. Used like `XRegExp.replace`, but accepts an + * array of replacement details. Later replacements operate on the output of earlier replacements. + * Replacement details are accepted as an array with a regex or string to search for, the + * replacement string or function, and an optional scope of 'one' or 'all'. Uses the XRegExp + * replacement text syntax, which supports named backreference properties via `${name}` or + * `$`. + * + * @memberOf XRegExp + * @param {String} str String to search. + * @param {Array} replacements Array of replacement detail arrays. + * @returns {String} New string with all replacements. + * @example + * + * str = XRegExp.replaceEach(str, [ + * [XRegExp('(?a)'), 'z${name}'], + * [/b/gi, 'y'], + * [/c/g, 'x', 'one'], // scope 'one' overrides /g + * [/d/, 'w', 'all'], // scope 'all' overrides lack of /g + * ['e', 'v', 'all'], // scope 'all' allows replace-all for strings + * [/f/g, ($0) => $0.toUpperCase()] + * ]); + */ + + +XRegExp.replaceEach = function (str, replacements) { + var _iteratorNormalCompletion4 = true; + var _didIteratorError4 = false; + var _iteratorError4 = undefined; + + try { + for (var _iterator4 = replacements[Symbol.iterator](), _step4; !(_iteratorNormalCompletion4 = (_step4 = _iterator4.next()).done); _iteratorNormalCompletion4 = true) { + var r = _step4.value; + str = XRegExp.replace(str, r[0], r[1], r[2]); + } + } catch (err) { + _didIteratorError4 = true; + _iteratorError4 = err; + } finally { + try { + if (!_iteratorNormalCompletion4 && _iterator4.return != null) { + _iterator4.return(); + } + } finally { + if (_didIteratorError4) { + throw _iteratorError4; + } + } + } + + return str; +}; +/** + * Splits a string into an array of strings using a regex or string separator. Matches of the + * separator are not included in the result array. However, if `separator` is a regex that contains + * capturing groups, backreferences are spliced into the result each time `separator` is matched. + * Fixes browser bugs compared to the native `String.prototype.split` and can be used reliably + * cross-browser. + * + * @memberOf XRegExp + * @param {String} str String to split. + * @param {RegExp|String} separator Regex or string to use for separating the string. + * @param {Number} [limit] Maximum number of items to include in the result array. + * @returns {Array} Array of substrings. + * @example + * + * // Basic use + * XRegExp.split('a b c', ' '); + * // -> ['a', 'b', 'c'] + * + * // With limit + * XRegExp.split('a b c', ' ', 2); + * // -> ['a', 'b'] + * + * // Backreferences in result array + * XRegExp.split('..word1..', /([a-z]+)(\d+)/i); + * // -> ['..', 'word', '1', '..'] + */ + + +XRegExp.split = function (str, separator, limit) { + return fixed.split.call(toObject(str), separator, limit); +}; +/** + * Executes a regex search in a specified string. Returns `true` or `false`. Optional `pos` and + * `sticky` arguments specify the search start position, and whether the match must start at the + * specified position only. The `lastIndex` property of the provided regex is not used, but is + * updated for compatibility. Also fixes browser bugs compared to the native + * `RegExp.prototype.test` and can be used reliably cross-browser. + * + * @memberOf XRegExp + * @param {String} str String to search. + * @param {RegExp} regex Regex to search with. + * @param {Number} [pos=0] Zero-based index at which to start the search. + * @param {Boolean|String} [sticky=false] Whether the match must start at the specified position + * only. The string `'sticky'` is accepted as an alternative to `true`. + * @returns {Boolean} Whether the regex matched the provided value. + * @example + * + * // Basic use + * XRegExp.test('abc', /c/); // -> true + * + * // With pos and sticky + * XRegExp.test('abc', /c/, 0, 'sticky'); // -> false + * XRegExp.test('abc', /c/, 2, 'sticky'); // -> true + */ +// Do this the easy way :-) + + +XRegExp.test = function (str, regex, pos, sticky) { + return !!XRegExp.exec(str, regex, pos, sticky); +}; +/** + * Uninstalls optional features according to the specified options. All optional features start out + * uninstalled, so this is used to undo the actions of `XRegExp.install`. + * + * @memberOf XRegExp + * @param {Object|String} options Options object or string. + * @example + * + * // With an options object + * XRegExp.uninstall({ + * // Disables support for astral code points in Unicode addons + * astral: true, + * + * // Don't add named capture groups to the `groups` property of matches + * namespacing: true + * }); + * + * // With an options string + * XRegExp.uninstall('astral namespacing'); + */ + + +XRegExp.uninstall = function (options) { + options = prepareOptions(options); + + if (features.astral && options.astral) { + setAstral(false); + } + + if (features.namespacing && options.namespacing) { + setNamespacing(false); + } +}; +/** + * Returns an XRegExp object that is the union of the given patterns. Patterns can be provided as + * regex objects or strings. Metacharacters are escaped in patterns provided as strings. + * Backreferences in provided regex objects are automatically renumbered to work correctly within + * the larger combined pattern. Native flags used by provided regexes are ignored in favor of the + * `flags` argument. + * + * @memberOf XRegExp + * @param {Array} patterns Regexes and strings to combine. + * @param {String} [flags] Any combination of XRegExp flags. + * @param {Object} [options] Options object with optional properties: + * - `conjunction` {String} Type of conjunction to use: 'or' (default) or 'none'. + * @returns {RegExp} Union of the provided regexes and strings. + * @example + * + * XRegExp.union(['a+b*c', /(dogs)\1/, /(cats)\1/], 'i'); + * // -> /a\+b\*c|(dogs)\1|(cats)\2/i + * + * XRegExp.union([/man/, /bear/, /pig/], 'i', {conjunction: 'none'}); + * // -> /manbearpig/i + */ + + +XRegExp.union = function (patterns, flags, options) { + options = options || {}; + var conjunction = options.conjunction || 'or'; + var numCaptures = 0; + var numPriorCaptures; + var captureNames; + + function rewrite(match, paren, backref) { + var name = captureNames[numCaptures - numPriorCaptures]; // Capturing group + + if (paren) { + ++numCaptures; // If the current capture has a name, preserve the name + + if (name) { + return "(?<".concat(name, ">"); + } // Backreference + + } else if (backref) { + // Rewrite the backreference + return "\\".concat(+backref + numPriorCaptures); + } + + return match; + } + + if (!(isType(patterns, 'Array') && patterns.length)) { + throw new TypeError('Must provide a nonempty array of patterns to merge'); + } + + var parts = /(\()(?!\?)|\\([1-9]\d*)|\\[\s\S]|\[(?:[^\\\]]|\\[\s\S])*\]/g; + var output = []; + var _iteratorNormalCompletion5 = true; + var _didIteratorError5 = false; + var _iteratorError5 = undefined; + + try { + for (var _iterator5 = patterns[Symbol.iterator](), _step5; !(_iteratorNormalCompletion5 = (_step5 = _iterator5.next()).done); _iteratorNormalCompletion5 = true) { + var pattern = _step5.value; + + if (XRegExp.isRegExp(pattern)) { + numPriorCaptures = numCaptures; + captureNames = pattern[REGEX_DATA] && pattern[REGEX_DATA].captureNames || []; // Rewrite backreferences. Passing to XRegExp dies on octals and ensures patterns are + // independently valid; helps keep this simple. Named captures are put back + + output.push(nativ.replace.call(XRegExp(pattern.source).source, parts, rewrite)); + } else { + output.push(XRegExp.escape(pattern)); + } + } + } catch (err) { + _didIteratorError5 = true; + _iteratorError5 = err; + } finally { + try { + if (!_iteratorNormalCompletion5 && _iterator5.return != null) { + _iterator5.return(); + } + } finally { + if (_didIteratorError5) { + throw _iteratorError5; + } + } + } + + var separator = conjunction === 'none' ? '' : '|'; + return XRegExp(output.join(separator), flags); +}; // ==--------------------------== +// Fixed/extended native methods +// ==--------------------------== + +/** + * Adds named capture support (with backreferences returned as `result.name`), and fixes browser + * bugs in the native `RegExp.prototype.exec`. Use via `XRegExp.exec`. + * + * @memberOf RegExp + * @param {String} str String to search. + * @returns {Array} Match array with named backreference properties, or `null`. + */ + + +fixed.exec = function (str) { + var origLastIndex = this.lastIndex; + var match = nativ.exec.apply(this, arguments); + + if (match) { + // Fix browsers whose `exec` methods don't return `undefined` for nonparticipating capturing + // groups. This fixes IE 5.5-8, but not IE 9's quirks mode or emulation of older IEs. IE 9 + // in standards mode follows the spec. + if (!correctExecNpcg && match.length > 1 && match.indexOf('') !== -1) { + var r2 = copyRegex(this, { + removeG: true, + isInternalOnly: true + }); // Using `str.slice(match.index)` rather than `match[0]` in case lookahead allowed + // matching due to characters outside the match + + nativ.replace.call(String(str).slice(match.index), r2, function () { + var len = arguments.length; // Skip index 0 and the last 2 + + for (var i = 1; i < len - 2; ++i) { + if ((i < 0 || arguments.length <= i ? undefined : arguments[i]) === undefined) { + match[i] = undefined; + } + } + }); + } // Attach named capture properties + + + var groupsObject = match; + + if (XRegExp.isInstalled('namespacing')) { + // https://tc39.github.io/proposal-regexp-named-groups/#sec-regexpbuiltinexec + match.groups = Object.create(null); + groupsObject = match.groups; + } + + if (this[REGEX_DATA] && this[REGEX_DATA].captureNames) { + // Skip index 0 + for (var i = 1; i < match.length; ++i) { + var name = this[REGEX_DATA].captureNames[i - 1]; + + if (name) { + groupsObject[name] = match[i]; + } + } + } // Fix browsers that increment `lastIndex` after zero-length matches + + + if (this.global && !match[0].length && this.lastIndex > match.index) { + this.lastIndex = match.index; + } + } + + if (!this.global) { + // Fixes IE, Opera bug (last tested IE 9, Opera 11.6) + this.lastIndex = origLastIndex; + } + + return match; +}; +/** + * Fixes browser bugs in the native `RegExp.prototype.test`. + * + * @memberOf RegExp + * @param {String} str String to search. + * @returns {Boolean} Whether the regex matched the provided value. + */ + + +fixed.test = function (str) { + // Do this the easy way :-) + return !!fixed.exec.call(this, str); +}; +/** + * Adds named capture support (with backreferences returned as `result.name`), and fixes browser + * bugs in the native `String.prototype.match`. + * + * @memberOf String + * @param {RegExp|*} regex Regex to search with. If not a regex object, it is passed to `RegExp`. + * @returns {Array} If `regex` uses flag g, an array of match strings or `null`. Without flag g, + * the result of calling `regex.exec(this)`. + */ + + +fixed.match = function (regex) { + if (!XRegExp.isRegExp(regex)) { + // Use the native `RegExp` rather than `XRegExp` + regex = new RegExp(regex); + } else if (regex.global) { + var result = nativ.match.apply(this, arguments); // Fixes IE bug + + regex.lastIndex = 0; + return result; + } + + return fixed.exec.call(regex, toObject(this)); +}; +/** + * Adds support for `${n}` (or `$`) tokens for named and numbered backreferences in replacement + * text, and provides named backreferences to replacement functions as `arguments[0].name`. Also + * fixes browser bugs in replacement text syntax when performing a replacement using a nonregex + * search value, and the value of a replacement regex's `lastIndex` property during replacement + * iterations and upon completion. Note that this doesn't support SpiderMonkey's proprietary third + * (`flags`) argument. Use via `XRegExp.replace`. + * + * @memberOf String + * @param {RegExp|String} search Search pattern to be replaced. + * @param {String|Function} replacement Replacement string or a function invoked to create it. + * @returns {String} New string with one or all matches replaced. + */ + + +fixed.replace = function (search, replacement) { + var isRegex = XRegExp.isRegExp(search); + var origLastIndex; + var captureNames; + var result; + + if (isRegex) { + if (search[REGEX_DATA]) { + captureNames = search[REGEX_DATA].captureNames; + } // Only needed if `search` is nonglobal + + + origLastIndex = search.lastIndex; + } else { + search += ''; // Type-convert + } // Don't use `typeof`; some older browsers return 'function' for regex objects + + + if (isType(replacement, 'Function')) { + // Stringifying `this` fixes a bug in IE < 9 where the last argument in replacement + // functions isn't type-converted to a string + result = nativ.replace.call(String(this), search, function () { + for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) { + args[_key] = arguments[_key]; + } + + if (captureNames) { + var groupsObject; + + if (XRegExp.isInstalled('namespacing')) { + // https://tc39.github.io/proposal-regexp-named-groups/#sec-regexpbuiltinexec + groupsObject = Object.create(null); + args.push(groupsObject); + } else { + // Change the `args[0]` string primitive to a `String` object that can store + // properties. This really does need to use `String` as a constructor + args[0] = new String(args[0]); + groupsObject = args[0]; + } // Store named backreferences + + + for (var i = 0; i < captureNames.length; ++i) { + if (captureNames[i]) { + groupsObject[captureNames[i]] = args[i + 1]; + } + } + } // Update `lastIndex` before calling `replacement`. Fixes IE, Chrome, Firefox, Safari + // bug (last tested IE 9, Chrome 17, Firefox 11, Safari 5.1) + + + if (isRegex && search.global) { + search.lastIndex = args[args.length - 2] + args[0].length; + } // ES6 specs the context for replacement functions as `undefined` + + + return replacement.apply(void 0, args); + }); + } else { + // Ensure that the last value of `args` will be a string when given nonstring `this`, + // while still throwing on null or undefined context + result = nativ.replace.call(this == null ? this : String(this), search, function () { + for (var _len2 = arguments.length, args = new Array(_len2), _key2 = 0; _key2 < _len2; _key2++) { + args[_key2] = arguments[_key2]; + } + + return nativ.replace.call(String(replacement), replacementToken, replacer); + + function replacer($0, bracketed, angled, dollarToken) { + bracketed = bracketed || angled; // Named or numbered backreference with curly or angled braces + + if (bracketed) { + // XRegExp behavior for `${n}` or `$`: + // 1. Backreference to numbered capture, if `n` is an integer. Use `0` for the + // entire match. Any number of leading zeros may be used. + // 2. Backreference to named capture `n`, if it exists and is not an integer + // overridden by numbered capture. In practice, this does not overlap with + // numbered capture since XRegExp does not allow named capture to use a bare + // integer as the name. + // 3. If the name or number does not refer to an existing capturing group, it's + // an error. + var n = +bracketed; // Type-convert; drop leading zeros + + if (n <= args.length - 3) { + return args[n] || ''; + } // Groups with the same name is an error, else would need `lastIndexOf` + + + n = captureNames ? captureNames.indexOf(bracketed) : -1; + + if (n < 0) { + throw new SyntaxError("Backreference to undefined group ".concat($0)); + } + + return args[n + 1] || ''; + } // Else, special variable or numbered backreference without curly braces + + + if (dollarToken === '$') { + // $$ + return '$'; + } + + if (dollarToken === '&' || +dollarToken === 0) { + // $&, $0 (not followed by 1-9), $00 + return args[0]; + } + + if (dollarToken === '`') { + // $` (left context) + return args[args.length - 1].slice(0, args[args.length - 2]); + } + + if (dollarToken === "'") { + // $' (right context) + return args[args.length - 1].slice(args[args.length - 2] + args[0].length); + } // Else, numbered backreference without braces + + + dollarToken = +dollarToken; // Type-convert; drop leading zero + // XRegExp behavior for `$n` and `$nn`: + // - Backrefs end after 1 or 2 digits. Use `${..}` or `$<..>` for more digits. + // - `$1` is an error if no capturing groups. + // - `$10` is an error if less than 10 capturing groups. Use `${1}0` or `$<1>0` + // instead. + // - `$01` is `$1` if at least one capturing group, else it's an error. + // - `$0` (not followed by 1-9) and `$00` are the entire match. + // Native behavior, for comparison: + // - Backrefs end after 1 or 2 digits. Cannot reference capturing group 100+. + // - `$1` is a literal `$1` if no capturing groups. + // - `$10` is `$1` followed by a literal `0` if less than 10 capturing groups. + // - `$01` is `$1` if at least one capturing group, else it's a literal `$01`. + // - `$0` is a literal `$0`. + + if (!isNaN(dollarToken)) { + if (dollarToken > args.length - 3) { + throw new SyntaxError("Backreference to undefined group ".concat($0)); + } + + return args[dollarToken] || ''; + } // `$` followed by an unsupported char is an error, unlike native JS + + + throw new SyntaxError("Invalid token ".concat($0)); + } + }); + } + + if (isRegex) { + if (search.global) { + // Fixes IE, Safari bug (last tested IE 9, Safari 5.1) + search.lastIndex = 0; + } else { + // Fixes IE, Opera bug (last tested IE 9, Opera 11.6) + search.lastIndex = origLastIndex; + } + } + + return result; +}; +/** + * Fixes browser bugs in the native `String.prototype.split`. Use via `XRegExp.split`. + * + * @memberOf String + * @param {RegExp|String} separator Regex or string to use for separating the string. + * @param {Number} [limit] Maximum number of items to include in the result array. + * @returns {Array} Array of substrings. + */ + + +fixed.split = function (separator, limit) { + if (!XRegExp.isRegExp(separator)) { + // Browsers handle nonregex split correctly, so use the faster native method + return nativ.split.apply(this, arguments); + } + + var str = String(this); + var output = []; + var origLastIndex = separator.lastIndex; + var lastLastIndex = 0; + var lastLength; // Values for `limit`, per the spec: + // If undefined: pow(2,32) - 1 + // If 0, Infinity, or NaN: 0 + // If positive number: limit = floor(limit); if (limit >= pow(2,32)) limit -= pow(2,32); + // If negative number: pow(2,32) - floor(abs(limit)) + // If other: Type-convert, then use the above rules + // This line fails in very strange ways for some values of `limit` in Opera 10.5-10.63, unless + // Opera Dragonfly is open (go figure). It works in at least Opera 9.5-10.1 and 11+ + + limit = (limit === undefined ? -1 : limit) >>> 0; + XRegExp.forEach(str, separator, function (match) { + // This condition is not the same as `if (match[0].length)` + if (match.index + match[0].length > lastLastIndex) { + output.push(str.slice(lastLastIndex, match.index)); + + if (match.length > 1 && match.index < str.length) { + Array.prototype.push.apply(output, match.slice(1)); + } + + lastLength = match[0].length; + lastLastIndex = match.index + lastLength; + } + }); + + if (lastLastIndex === str.length) { + if (!nativ.test.call(separator, '') || lastLength) { + output.push(''); + } + } else { + output.push(str.slice(lastLastIndex)); + } + + separator.lastIndex = origLastIndex; + return output.length > limit ? output.slice(0, limit) : output; +}; // ==--------------------------== +// Built-in syntax/flag tokens +// ==--------------------------== + +/* + * Letter escapes that natively match literal characters: `\a`, `\A`, etc. These should be + * SyntaxErrors but are allowed in web reality. XRegExp makes them errors for cross-browser + * consistency and to reserve their syntax, but lets them be superseded by addons. + */ + + +XRegExp.addToken(/\\([ABCE-RTUVXYZaeg-mopqyz]|c(?![A-Za-z])|u(?![\dA-Fa-f]{4}|{[\dA-Fa-f]+})|x(?![\dA-Fa-f]{2}))/, function (match, scope) { + // \B is allowed in default scope only + if (match[1] === 'B' && scope === defaultScope) { + return match[0]; + } + + throw new SyntaxError("Invalid escape ".concat(match[0])); +}, { + scope: 'all', + leadChar: '\\' +}); +/* + * Unicode code point escape with curly braces: `\u{N..}`. `N..` is any one or more digit + * hexadecimal number from 0-10FFFF, and can include leading zeros. Requires the native ES6 `u` flag + * to support code points greater than U+FFFF. Avoids converting code points above U+FFFF to + * surrogate pairs (which could be done without flag `u`), since that could lead to broken behavior + * if you follow a `\u{N..}` token that references a code point above U+FFFF with a quantifier, or + * if you use the same in a character class. + */ + +XRegExp.addToken(/\\u{([\dA-Fa-f]+)}/, function (match, scope, flags) { + var code = dec(match[1]); + + if (code > 0x10FFFF) { + throw new SyntaxError("Invalid Unicode code point ".concat(match[0])); + } + + if (code <= 0xFFFF) { + // Converting to \uNNNN avoids needing to escape the literal character and keep it + // separate from preceding tokens + return "\\u".concat(pad4(hex(code))); + } // If `code` is between 0xFFFF and 0x10FFFF, require and defer to native handling + + + if (hasNativeU && flags.indexOf('u') !== -1) { + return match[0]; + } + + throw new SyntaxError('Cannot use Unicode code point above \\u{FFFF} without flag u'); +}, { + scope: 'all', + leadChar: '\\' +}); +/* + * Empty character class: `[]` or `[^]`. This fixes a critical cross-browser syntax inconsistency. + * Unless this is standardized (per the ES spec), regex syntax can't be accurately parsed because + * character class endings can't be determined. + */ + +XRegExp.addToken(/\[(\^?)\]/, // For cross-browser compatibility with ES3, convert [] to \b\B and [^] to [\s\S]. +// (?!) should work like \b\B, but is unreliable in some versions of Firefox + +/* eslint-disable no-confusing-arrow */ +function (match) { + return match[1] ? '[\\s\\S]' : '\\b\\B'; +}, +/* eslint-enable no-confusing-arrow */ +{ + leadChar: '[' +}); +/* + * Comment pattern: `(?# )`. Inline comments are an alternative to the line comments allowed in + * free-spacing mode (flag x). + */ + +XRegExp.addToken(/\(\?#[^)]*\)/, getContextualTokenSeparator, { + leadChar: '(' +}); +/* + * Whitespace and line comments, in free-spacing mode (aka extended mode, flag x) only. + */ + +XRegExp.addToken(/\s+|#[^\n]*\n?/, getContextualTokenSeparator, { + flag: 'x' +}); +/* + * Dot, in dotall mode (aka singleline mode, flag s) only. + */ + +XRegExp.addToken(/\./, function () { + return '[\\s\\S]'; +}, { + flag: 's', + leadChar: '.' +}); +/* + * Named backreference: `\k`. Backreference names can use the characters A-Z, a-z, 0-9, _, + * and $ only. Also allows numbered backreferences as `\k`. + */ + +XRegExp.addToken(/\\k<([\w$]+)>/, function (match) { + // Groups with the same name is an error, else would need `lastIndexOf` + var index = isNaN(match[1]) ? this.captureNames.indexOf(match[1]) + 1 : +match[1]; + var endIndex = match.index + match[0].length; + + if (!index || index > this.captureNames.length) { + throw new SyntaxError("Backreference to undefined group ".concat(match[0])); + } // Keep backreferences separate from subsequent literal numbers. This avoids e.g. + // inadvertedly changing `(?)\k1` to `()\11`. + + + return "\\".concat(index).concat(endIndex === match.input.length || isNaN(match.input[endIndex]) ? '' : '(?:)'); +}, { + leadChar: '\\' +}); +/* + * Numbered backreference or octal, plus any following digits: `\0`, `\11`, etc. Octals except `\0` + * not followed by 0-9 and backreferences to unopened capture groups throw an error. Other matches + * are returned unaltered. IE < 9 doesn't support backreferences above `\99` in regex syntax. + */ + +XRegExp.addToken(/\\(\d+)/, function (match, scope) { + if (!(scope === defaultScope && /^[1-9]/.test(match[1]) && +match[1] <= this.captureNames.length) && match[1] !== '0') { + throw new SyntaxError("Cannot use octal escape or backreference to undefined group ".concat(match[0])); + } + + return match[0]; +}, { + scope: 'all', + leadChar: '\\' +}); +/* + * Named capturing group; match the opening delimiter only: `(?`. Capture names can use the + * characters A-Z, a-z, 0-9, _, and $ only. Names can't be integers. Supports Python-style + * `(?P` as an alternate syntax to avoid issues in some older versions of Opera which natively + * supported the Python-style syntax. Otherwise, XRegExp might treat numbered backreferences to + * Python-style named capture as octals. + */ + +XRegExp.addToken(/\(\?P?<([\w$]+)>/, function (match) { + // Disallow bare integers as names because named backreferences are added to match arrays + // and therefore numeric properties may lead to incorrect lookups + if (!isNaN(match[1])) { + throw new SyntaxError("Cannot use integer as capture name ".concat(match[0])); + } + + if (!XRegExp.isInstalled('namespacing') && (match[1] === 'length' || match[1] === '__proto__')) { + throw new SyntaxError("Cannot use reserved word as capture name ".concat(match[0])); + } + + if (this.captureNames.indexOf(match[1]) !== -1) { + throw new SyntaxError("Cannot use same name for multiple groups ".concat(match[0])); + } + + this.captureNames.push(match[1]); + this.hasNamedCapture = true; + return '('; +}, { + leadChar: '(' +}); +/* + * Capturing group; match the opening parenthesis only. Required for support of named capturing + * groups. Also adds explicit capture mode (flag n). + */ + +XRegExp.addToken(/\((?!\?)/, function (match, scope, flags) { + if (flags.indexOf('n') !== -1) { + return '(?:'; + } + + this.captureNames.push(null); + return '('; +}, { + optionalFlags: 'n', + leadChar: '(' +}); +var _default = XRegExp; +exports.default = _default; +module.exports = exports["default"]; +}); + +unwrapExports(xregexp); + +var build = createCommonjsModule(function (module, exports) { +"use strict"; + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.default = void 0; + +/*! + * XRegExp.build 4.2.0 + * + * Steven Levithan (c) 2012-present MIT License + */ +var _default = function _default(XRegExp) { + var REGEX_DATA = 'xregexp'; + var subParts = /(\()(?!\?)|\\([1-9]\d*)|\\[\s\S]|\[(?:[^\\\]]|\\[\s\S])*\]/g; + var parts = XRegExp.union([/\({{([\w$]+)}}\)|{{([\w$]+)}}/, subParts], 'g', { + conjunction: 'or' + }); + /** + * Strips a leading `^` and trailing unescaped `$`, if both are present. + * + * @private + * @param {String} pattern Pattern to process. + * @returns {String} Pattern with edge anchors removed. + */ + + function deanchor(pattern) { + // Allow any number of empty noncapturing groups before/after anchors, because regexes + // built/generated by XRegExp sometimes include them + var leadingAnchor = /^(?:\(\?:\))*\^/; + var trailingAnchor = /\$(?:\(\?:\))*$/; + + if (leadingAnchor.test(pattern) && trailingAnchor.test(pattern) && // Ensure that the trailing `$` isn't escaped + trailingAnchor.test(pattern.replace(/\\[\s\S]/g, ''))) { + return pattern.replace(leadingAnchor, '').replace(trailingAnchor, ''); + } + + return pattern; + } + /** + * Converts the provided value to an XRegExp. Native RegExp flags are not preserved. + * + * @private + * @param {String|RegExp} value Value to convert. + * @param {Boolean} [addFlagX] Whether to apply the `x` flag in cases when `value` is not + * already a regex generated by XRegExp + * @returns {RegExp} XRegExp object with XRegExp syntax applied. + */ + + + function asXRegExp(value, addFlagX) { + var flags = addFlagX ? 'x' : ''; + return XRegExp.isRegExp(value) ? value[REGEX_DATA] && value[REGEX_DATA].captureNames ? // Don't recompile, to preserve capture names + value : // Recompile as XRegExp + XRegExp(value.source, flags) : // Compile string as XRegExp + XRegExp(value, flags); + } + + function interpolate(substitution) { + return substitution instanceof RegExp ? substitution : XRegExp.escape(substitution); + } + + function reduceToSubpatternsObject(subpatterns, interpolated, subpatternIndex) { + subpatterns["subpattern".concat(subpatternIndex)] = interpolated; + return subpatterns; + } + + function embedSubpatternAfter(raw, subpatternIndex, rawLiterals) { + var hasSubpattern = subpatternIndex < rawLiterals.length - 1; + return raw + (hasSubpattern ? "{{subpattern".concat(subpatternIndex, "}}") : ''); + } + /** + * Provides tagged template literals that create regexes with XRegExp syntax and flags. The + * provided pattern is handled as a raw string, so backslashes don't need to be escaped. + * + * Interpolation of strings and regexes shares the features of `XRegExp.build`. Interpolated + * patterns are treated as atomic units when quantified, interpolated strings have their special + * characters escaped, a leading `^` and trailing unescaped `$` are stripped from interpolated + * regexes if both are present, and any backreferences within an interpolated regex are + * rewritten to work within the overall pattern. + * + * @memberOf XRegExp + * @param {String} [flags] Any combination of XRegExp flags. + * @returns {Function} Handler for template literals that construct regexes with XRegExp syntax. + * @example + * + * const h12 = /1[0-2]|0?[1-9]/; + * const h24 = /2[0-3]|[01][0-9]/; + * const hours = XRegExp.tag('x')`${h12} : | ${h24}`; + * const minutes = /^[0-5][0-9]$/; + * // Note that explicitly naming the 'minutes' group is required for named backreferences + * const time = XRegExp.tag('x')`^ ${hours} (?${minutes}) $`; + * time.test('10:59'); // -> true + * XRegExp.exec('10:59', time).minutes; // -> '59' + */ + + + XRegExp.tag = function (flags) { + return function (literals) { + for (var _len = arguments.length, substitutions = new Array(_len > 1 ? _len - 1 : 0), _key = 1; _key < _len; _key++) { + substitutions[_key - 1] = arguments[_key]; + } + + var subpatterns = substitutions.map(interpolate).reduce(reduceToSubpatternsObject, {}); + var pattern = literals.raw.map(embedSubpatternAfter).join(''); + return XRegExp.build(pattern, subpatterns, flags); + }; + }; + /** + * Builds regexes using named subpatterns, for readability and pattern reuse. Backreferences in + * the outer pattern and provided subpatterns are automatically renumbered to work correctly. + * Native flags used by provided subpatterns are ignored in favor of the `flags` argument. + * + * @memberOf XRegExp + * @param {String} pattern XRegExp pattern using `{{name}}` for embedded subpatterns. Allows + * `({{name}})` as shorthand for `(?{{name}})`. Patterns cannot be embedded within + * character classes. + * @param {Object} subs Lookup object for named subpatterns. Values can be strings or regexes. A + * leading `^` and trailing unescaped `$` are stripped from subpatterns, if both are present. + * @param {String} [flags] Any combination of XRegExp flags. + * @returns {RegExp} Regex with interpolated subpatterns. + * @example + * + * const time = XRegExp.build('(?x)^ {{hours}} ({{minutes}}) $', { + * hours: XRegExp.build('{{h12}} : | {{h24}}', { + * h12: /1[0-2]|0?[1-9]/, + * h24: /2[0-3]|[01][0-9]/ + * }, 'x'), + * minutes: /^[0-5][0-9]$/ + * }); + * time.test('10:59'); // -> true + * XRegExp.exec('10:59', time).minutes; // -> '59' + */ + + + XRegExp.build = function (pattern, subs, flags) { + flags = flags || ''; // Used with `asXRegExp` calls for `pattern` and subpatterns in `subs`, to work around how + // some browsers convert `RegExp('\n')` to a regex that contains the literal characters `\` + // and `n`. See more details at . + + var addFlagX = flags.indexOf('x') !== -1; + var inlineFlags = /^\(\?([\w$]+)\)/.exec(pattern); // Add flags within a leading mode modifier to the overall pattern's flags + + if (inlineFlags) { + flags = XRegExp._clipDuplicates(flags + inlineFlags[1]); + } + + var data = {}; + + for (var p in subs) { + if (subs.hasOwnProperty(p)) { + // Passing to XRegExp enables extended syntax and ensures independent validity, + // lest an unescaped `(`, `)`, `[`, or trailing `\` breaks the `(?:)` wrapper. For + // subpatterns provided as native regexes, it dies on octals and adds the property + // used to hold extended regex instance data, for simplicity. + var sub = asXRegExp(subs[p], addFlagX); + data[p] = { + // Deanchoring allows embedding independently useful anchored regexes. If you + // really need to keep your anchors, double them (i.e., `^^...$$`). + pattern: deanchor(sub.source), + names: sub[REGEX_DATA].captureNames || [] + }; + } + } // Passing to XRegExp dies on octals and ensures the outer pattern is independently valid; + // helps keep this simple. Named captures will be put back. + + + var patternAsRegex = asXRegExp(pattern, addFlagX); // 'Caps' is short for 'captures' + + var numCaps = 0; + var numPriorCaps; + var numOuterCaps = 0; + var outerCapsMap = [0]; + var outerCapNames = patternAsRegex[REGEX_DATA].captureNames || []; + var output = patternAsRegex.source.replace(parts, function ($0, $1, $2, $3, $4) { + var subName = $1 || $2; + var capName; + var intro; + var localCapIndex; // Named subpattern + + if (subName) { + if (!data.hasOwnProperty(subName)) { + throw new ReferenceError("Undefined property ".concat($0)); + } // Named subpattern was wrapped in a capturing group + + + if ($1) { + capName = outerCapNames[numOuterCaps]; + outerCapsMap[++numOuterCaps] = ++numCaps; // If it's a named group, preserve the name. Otherwise, use the subpattern name + // as the capture name + + intro = "(?<".concat(capName || subName, ">"); + } else { + intro = '(?:'; + } + + numPriorCaps = numCaps; + var rewrittenSubpattern = data[subName].pattern.replace(subParts, function (match, paren, backref) { + // Capturing group + if (paren) { + capName = data[subName].names[numCaps - numPriorCaps]; + ++numCaps; // If the current capture has a name, preserve the name + + if (capName) { + return "(?<".concat(capName, ">"); + } // Backreference + + } else if (backref) { + localCapIndex = +backref - 1; // Rewrite the backreference + + return data[subName].names[localCapIndex] ? // Need to preserve the backreference name in case using flag `n` + "\\k<".concat(data[subName].names[localCapIndex], ">") : "\\".concat(+backref + numPriorCaps); + } + + return match; + }); + return "".concat(intro).concat(rewrittenSubpattern, ")"); + } // Capturing group + + + if ($3) { + capName = outerCapNames[numOuterCaps]; + outerCapsMap[++numOuterCaps] = ++numCaps; // If the current capture has a name, preserve the name + + if (capName) { + return "(?<".concat(capName, ">"); + } // Backreference + + } else if ($4) { + localCapIndex = +$4 - 1; // Rewrite the backreference + + return outerCapNames[localCapIndex] ? // Need to preserve the backreference name in case using flag `n` + "\\k<".concat(outerCapNames[localCapIndex], ">") : "\\".concat(outerCapsMap[+$4]); + } + + return $0; + }); + return XRegExp(output, flags); + }; +}; + +exports.default = _default; +module.exports = exports["default"]; +}); + +unwrapExports(build); + +var matchrecursive = createCommonjsModule(function (module, exports) { +"use strict"; + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.default = void 0; + +/*! + * XRegExp.matchRecursive 4.2.0 + * + * Steven Levithan (c) 2009-present MIT License + */ +var _default = function _default(XRegExp) { + /** + * Returns a match detail object composed of the provided values. + * + * @private + */ + function row(name, value, start, end) { + return { + name: name, + value: value, + start: start, + end: end + }; + } + /** + * Returns an array of match strings between outermost left and right delimiters, or an array of + * objects with detailed match parts and position data. An error is thrown if delimiters are + * unbalanced within the data. + * + * @memberOf XRegExp + * @param {String} str String to search. + * @param {String} left Left delimiter as an XRegExp pattern. + * @param {String} right Right delimiter as an XRegExp pattern. + * @param {String} [flags] Any native or XRegExp flags, used for the left and right delimiters. + * @param {Object} [options] Lets you specify `valueNames` and `escapeChar` options. + * @returns {Array} Array of matches, or an empty array. + * @example + * + * // Basic usage + * let str = '(t((e))s)t()(ing)'; + * XRegExp.matchRecursive(str, '\\(', '\\)', 'g'); + * // -> ['t((e))s', '', 'ing'] + * + * // Extended information mode with valueNames + * str = 'Here is
an
example'; + * XRegExp.matchRecursive(str, '', '', 'gi', { + * valueNames: ['between', 'left', 'match', 'right'] + * }); + * // -> [ + * // {name: 'between', value: 'Here is ', start: 0, end: 8}, + * // {name: 'left', value: '
', start: 8, end: 13}, + * // {name: 'match', value: '
an
', start: 13, end: 27}, + * // {name: 'right', value: '
', start: 27, end: 33}, + * // {name: 'between', value: ' example', start: 33, end: 41} + * // ] + * + * // Omitting unneeded parts with null valueNames, and using escapeChar + * str = '...{1}.\\{{function(x,y){return {y:x}}}'; + * XRegExp.matchRecursive(str, '{', '}', 'g', { + * valueNames: ['literal', null, 'value', null], + * escapeChar: '\\' + * }); + * // -> [ + * // {name: 'literal', value: '...', start: 0, end: 3}, + * // {name: 'value', value: '1', start: 4, end: 5}, + * // {name: 'literal', value: '.\\{', start: 6, end: 9}, + * // {name: 'value', value: 'function(x,y){return {y:x}}', start: 10, end: 37} + * // ] + * + * // Sticky mode via flag y + * str = '<1><<<2>>><3>4<5>'; + * XRegExp.matchRecursive(str, '<', '>', 'gy'); + * // -> ['1', '<<2>>', '3'] + */ + + + XRegExp.matchRecursive = function (str, left, right, flags, options) { + flags = flags || ''; + options = options || {}; + var global = flags.indexOf('g') !== -1; + var sticky = flags.indexOf('y') !== -1; // Flag `y` is controlled internally + + var basicFlags = flags.replace(/y/g, ''); + var _options = options, + escapeChar = _options.escapeChar; + var vN = options.valueNames; + var output = []; + var openTokens = 0; + var delimStart = 0; + var delimEnd = 0; + var lastOuterEnd = 0; + var outerStart; + var innerStart; + var leftMatch; + var rightMatch; + var esc; + left = XRegExp(left, basicFlags); + right = XRegExp(right, basicFlags); + + if (escapeChar) { + if (escapeChar.length > 1) { + throw new Error('Cannot use more than one escape character'); + } + + escapeChar = XRegExp.escape(escapeChar); // Example of concatenated `esc` regex: + // `escapeChar`: '%' + // `left`: '<' + // `right`: '>' + // Regex is: /(?:%[\S\s]|(?:(?!<|>)[^%])+)+/ + + esc = new RegExp("(?:".concat(escapeChar, "[\\S\\s]|(?:(?!").concat( // Using `XRegExp.union` safely rewrites backreferences in `left` and `right`. + // Intentionally not passing `basicFlags` to `XRegExp.union` since any syntax + // transformation resulting from those flags was already applied to `left` and + // `right` when they were passed through the XRegExp constructor above. + XRegExp.union([left, right], '', { + conjunction: 'or' + }).source, ")[^").concat(escapeChar, "])+)+"), // Flags `gy` not needed here + flags.replace(/[^imu]+/g, '')); + } + + while (true) { + // If using an escape character, advance to the delimiter's next starting position, + // skipping any escaped characters in between + if (escapeChar) { + delimEnd += (XRegExp.exec(str, esc, delimEnd, 'sticky') || [''])[0].length; + } + + leftMatch = XRegExp.exec(str, left, delimEnd); + rightMatch = XRegExp.exec(str, right, delimEnd); // Keep the leftmost match only + + if (leftMatch && rightMatch) { + if (leftMatch.index <= rightMatch.index) { + rightMatch = null; + } else { + leftMatch = null; + } + } // Paths (LM: leftMatch, RM: rightMatch, OT: openTokens): + // LM | RM | OT | Result + // 1 | 0 | 1 | loop + // 1 | 0 | 0 | loop + // 0 | 1 | 1 | loop + // 0 | 1 | 0 | throw + // 0 | 0 | 1 | throw + // 0 | 0 | 0 | break + // The paths above don't include the sticky mode special case. The loop ends after the + // first completed match if not `global`. + + + if (leftMatch || rightMatch) { + delimStart = (leftMatch || rightMatch).index; + delimEnd = delimStart + (leftMatch || rightMatch)[0].length; + } else if (!openTokens) { + break; + } + + if (sticky && !openTokens && delimStart > lastOuterEnd) { + break; + } + + if (leftMatch) { + if (!openTokens) { + outerStart = delimStart; + innerStart = delimEnd; + } + + ++openTokens; + } else if (rightMatch && openTokens) { + if (! --openTokens) { + if (vN) { + if (vN[0] && outerStart > lastOuterEnd) { + output.push(row(vN[0], str.slice(lastOuterEnd, outerStart), lastOuterEnd, outerStart)); + } + + if (vN[1]) { + output.push(row(vN[1], str.slice(outerStart, innerStart), outerStart, innerStart)); + } + + if (vN[2]) { + output.push(row(vN[2], str.slice(innerStart, delimStart), innerStart, delimStart)); + } + + if (vN[3]) { + output.push(row(vN[3], str.slice(delimStart, delimEnd), delimStart, delimEnd)); + } + } else { + output.push(str.slice(innerStart, delimStart)); + } + + lastOuterEnd = delimEnd; + + if (!global) { + break; + } + } + } else { + throw new Error('Unbalanced delimiter found in string'); + } // If the delimiter matched an empty string, avoid an infinite loop + + + if (delimStart === delimEnd) { + ++delimEnd; + } + } + + if (global && !sticky && vN && vN[0] && str.length > lastOuterEnd) { + output.push(row(vN[0], str.slice(lastOuterEnd), lastOuterEnd, str.length)); + } + + return output; + }; +}; + +exports.default = _default; +module.exports = exports["default"]; +}); + +unwrapExports(matchrecursive); + +var unicodeBase = createCommonjsModule(function (module, exports) { +"use strict"; + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.default = void 0; + +/*! + * XRegExp Unicode Base 4.2.0 + * + * Steven Levithan (c) 2008-present MIT License + */ +var _default = function _default(XRegExp) { + /** + * Adds base support for Unicode matching: + * - Adds syntax `\p{..}` for matching Unicode tokens. Tokens can be inverted using `\P{..}` or + * `\p{^..}`. Token names ignore case, spaces, hyphens, and underscores. You can omit the + * braces for token names that are a single letter (e.g. `\pL` or `PL`). + * - Adds flag A (astral), which enables 21-bit Unicode support. + * - Adds the `XRegExp.addUnicodeData` method used by other addons to provide character data. + * + * Unicode Base relies on externally provided Unicode character data. Official addons are + * available to provide data for Unicode categories, scripts, blocks, and properties. + * + * @requires XRegExp + */ + // ==--------------------------== + // Private stuff + // ==--------------------------== + // Storage for Unicode data + var unicode = {}; // Reuse utils + + var dec = XRegExp._dec; + var hex = XRegExp._hex; + var pad4 = XRegExp._pad4; // Generates a token lookup name: lowercase, with hyphens, spaces, and underscores removed + + function normalize(name) { + return name.replace(/[- _]+/g, '').toLowerCase(); + } // Gets the decimal code of a literal code unit, \xHH, \uHHHH, or a backslash-escaped literal + + + function charCode(chr) { + var esc = /^\\[xu](.+)/.exec(chr); + return esc ? dec(esc[1]) : chr.charCodeAt(chr[0] === '\\' ? 1 : 0); + } // Inverts a list of ordered BMP characters and ranges + + + function invertBmp(range) { + var output = ''; + var lastEnd = -1; + XRegExp.forEach(range, /(\\x..|\\u....|\\?[\s\S])(?:-(\\x..|\\u....|\\?[\s\S]))?/, function (m) { + var start = charCode(m[1]); + + if (start > lastEnd + 1) { + output += "\\u".concat(pad4(hex(lastEnd + 1))); + + if (start > lastEnd + 2) { + output += "-\\u".concat(pad4(hex(start - 1))); + } + } + + lastEnd = charCode(m[2] || m[1]); + }); + + if (lastEnd < 0xFFFF) { + output += "\\u".concat(pad4(hex(lastEnd + 1))); + + if (lastEnd < 0xFFFE) { + output += '-\\uFFFF'; + } + } + + return output; + } // Generates an inverted BMP range on first use + + + function cacheInvertedBmp(slug) { + var prop = 'b!'; + return unicode[slug][prop] || (unicode[slug][prop] = invertBmp(unicode[slug].bmp)); + } // Combines and optionally negates BMP and astral data + + + function buildAstral(slug, isNegated) { + var item = unicode[slug]; + var combined = ''; + + if (item.bmp && !item.isBmpLast) { + combined = "[".concat(item.bmp, "]").concat(item.astral ? '|' : ''); + } + + if (item.astral) { + combined += item.astral; + } + + if (item.isBmpLast && item.bmp) { + combined += "".concat(item.astral ? '|' : '', "[").concat(item.bmp, "]"); + } // Astral Unicode tokens always match a code point, never a code unit + + + return isNegated ? "(?:(?!".concat(combined, ")(?:[\uD800-\uDBFF][\uDC00-\uDFFF]|[\0-\uFFFF]))") : "(?:".concat(combined, ")"); + } // Builds a complete astral pattern on first use + + + function cacheAstral(slug, isNegated) { + var prop = isNegated ? 'a!' : 'a='; + return unicode[slug][prop] || (unicode[slug][prop] = buildAstral(slug, isNegated)); + } // ==--------------------------== + // Core functionality + // ==--------------------------== + + /* + * Add astral mode (flag A) and Unicode token syntax: `\p{..}`, `\P{..}`, `\p{^..}`, `\pC`. + */ + + + XRegExp.addToken( // Use `*` instead of `+` to avoid capturing `^` as the token name in `\p{^}` + /\\([pP])(?:{(\^?)([^}]*)}|([A-Za-z]))/, function (match, scope, flags) { + var ERR_DOUBLE_NEG = 'Invalid double negation '; + var ERR_UNKNOWN_NAME = 'Unknown Unicode token '; + var ERR_UNKNOWN_REF = 'Unicode token missing data '; + var ERR_ASTRAL_ONLY = 'Astral mode required for Unicode token '; + var ERR_ASTRAL_IN_CLASS = 'Astral mode does not support Unicode tokens within character classes'; // Negated via \P{..} or \p{^..} + + var isNegated = match[1] === 'P' || !!match[2]; // Switch from BMP (0-FFFF) to astral (0-10FFFF) mode via flag A + + var isAstralMode = flags.indexOf('A') !== -1; // Token lookup name. Check `[4]` first to avoid passing `undefined` via `\p{}` + + var slug = normalize(match[4] || match[3]); // Token data object + + var item = unicode[slug]; + + if (match[1] === 'P' && match[2]) { + throw new SyntaxError(ERR_DOUBLE_NEG + match[0]); + } + + if (!unicode.hasOwnProperty(slug)) { + throw new SyntaxError(ERR_UNKNOWN_NAME + match[0]); + } // Switch to the negated form of the referenced Unicode token + + + if (item.inverseOf) { + slug = normalize(item.inverseOf); + + if (!unicode.hasOwnProperty(slug)) { + throw new ReferenceError("".concat(ERR_UNKNOWN_REF + match[0], " -> ").concat(item.inverseOf)); + } + + item = unicode[slug]; + isNegated = !isNegated; + } + + if (!(item.bmp || isAstralMode)) { + throw new SyntaxError(ERR_ASTRAL_ONLY + match[0]); + } + + if (isAstralMode) { + if (scope === 'class') { + throw new SyntaxError(ERR_ASTRAL_IN_CLASS); + } + + return cacheAstral(slug, isNegated); + } + + return scope === 'class' ? isNegated ? cacheInvertedBmp(slug) : item.bmp : "".concat((isNegated ? '[^' : '[') + item.bmp, "]"); + }, { + scope: 'all', + optionalFlags: 'A', + leadChar: '\\' + }); + /** + * Adds to the list of Unicode tokens that XRegExp regexes can match via `\p` or `\P`. + * + * @memberOf XRegExp + * @param {Array} data Objects with named character ranges. Each object may have properties + * `name`, `alias`, `isBmpLast`, `inverseOf`, `bmp`, and `astral`. All but `name` are + * optional, although one of `bmp` or `astral` is required (unless `inverseOf` is set). If + * `astral` is absent, the `bmp` data is used for BMP and astral modes. If `bmp` is absent, + * the name errors in BMP mode but works in astral mode. If both `bmp` and `astral` are + * provided, the `bmp` data only is used in BMP mode, and the combination of `bmp` and + * `astral` data is used in astral mode. `isBmpLast` is needed when a token matches orphan + * high surrogates *and* uses surrogate pairs to match astral code points. The `bmp` and + * `astral` data should be a combination of literal characters and `\xHH` or `\uHHHH` escape + * sequences, with hyphens to create ranges. Any regex metacharacters in the data should be + * escaped, apart from range-creating hyphens. The `astral` data can additionally use + * character classes and alternation, and should use surrogate pairs to represent astral code + * points. `inverseOf` can be used to avoid duplicating character data if a Unicode token is + * defined as the exact inverse of another token. + * @example + * + * // Basic use + * XRegExp.addUnicodeData([{ + * name: 'XDigit', + * alias: 'Hexadecimal', + * bmp: '0-9A-Fa-f' + * }]); + * XRegExp('\\p{XDigit}:\\p{Hexadecimal}+').test('0:3D'); // -> true + */ + + XRegExp.addUnicodeData = function (data) { + var ERR_NO_NAME = 'Unicode token requires name'; + var ERR_NO_DATA = 'Unicode token has no character data '; + var _iteratorNormalCompletion = true; + var _didIteratorError = false; + var _iteratorError = undefined; + + try { + for (var _iterator = data[Symbol.iterator](), _step; !(_iteratorNormalCompletion = (_step = _iterator.next()).done); _iteratorNormalCompletion = true) { + var item = _step.value; + + if (!item.name) { + throw new Error(ERR_NO_NAME); + } + + if (!(item.inverseOf || item.bmp || item.astral)) { + throw new Error(ERR_NO_DATA + item.name); + } + + unicode[normalize(item.name)] = item; + + if (item.alias) { + unicode[normalize(item.alias)] = item; + } + } // Reset the pattern cache used by the `XRegExp` constructor, since the same pattern and + // flags might now produce different results + + } catch (err) { + _didIteratorError = true; + _iteratorError = err; + } finally { + try { + if (!_iteratorNormalCompletion && _iterator.return != null) { + _iterator.return(); + } + } finally { + if (_didIteratorError) { + throw _iteratorError; + } + } + } + + XRegExp.cache.flush('patterns'); + }; + /** + * @ignore + * + * Return a reference to the internal Unicode definition structure for the given Unicode + * Property if the given name is a legal Unicode Property for use in XRegExp `\p` or `\P` regex + * constructs. + * + * @memberOf XRegExp + * @param {String} name Name by which the Unicode Property may be recognized (case-insensitive), + * e.g. `'N'` or `'Number'`. The given name is matched against all registered Unicode + * Properties and Property Aliases. + * @returns {Object} Reference to definition structure when the name matches a Unicode Property. + * + * @note + * For more info on Unicode Properties, see also http://unicode.org/reports/tr18/#Categories. + * + * @note + * This method is *not* part of the officially documented API and may change or be removed in + * the future. It is meant for userland code that wishes to reuse the (large) internal Unicode + * structures set up by XRegExp. + */ + + + XRegExp._getUnicodeProperty = function (name) { + var slug = normalize(name); + return unicode[slug]; + }; +}; + +exports.default = _default; +module.exports = exports["default"]; +}); + +unwrapExports(unicodeBase); + +var blocks = [ + { + 'name': 'InAdlam', + 'astral': '\uD83A[\uDD00-\uDD5F]' + }, + { + 'name': 'InAegean_Numbers', + 'astral': '\uD800[\uDD00-\uDD3F]' + }, + { + 'name': 'InAhom', + 'astral': '\uD805[\uDF00-\uDF3F]' + }, + { + 'name': 'InAlchemical_Symbols', + 'astral': '\uD83D[\uDF00-\uDF7F]' + }, + { + 'name': 'InAlphabetic_Presentation_Forms', + 'bmp': '\uFB00-\uFB4F' + }, + { + 'name': 'InAnatolian_Hieroglyphs', + 'astral': '\uD811[\uDC00-\uDE7F]' + }, + { + 'name': 'InAncient_Greek_Musical_Notation', + 'astral': '\uD834[\uDE00-\uDE4F]' + }, + { + 'name': 'InAncient_Greek_Numbers', + 'astral': '\uD800[\uDD40-\uDD8F]' + }, + { + 'name': 'InAncient_Symbols', + 'astral': '\uD800[\uDD90-\uDDCF]' + }, + { + 'name': 'InArabic', + 'bmp': '\u0600-\u06FF' + }, + { + 'name': 'InArabic_Extended_A', + 'bmp': '\u08A0-\u08FF' + }, + { + 'name': 'InArabic_Mathematical_Alphabetic_Symbols', + 'astral': '\uD83B[\uDE00-\uDEFF]' + }, + { + 'name': 'InArabic_Presentation_Forms_A', + 'bmp': '\uFB50-\uFDFF' + }, + { + 'name': 'InArabic_Presentation_Forms_B', + 'bmp': '\uFE70-\uFEFF' + }, + { + 'name': 'InArabic_Supplement', + 'bmp': '\u0750-\u077F' + }, + { + 'name': 'InArmenian', + 'bmp': '\u0530-\u058F' + }, + { + 'name': 'InArrows', + 'bmp': '\u2190-\u21FF' + }, + { + 'name': 'InAvestan', + 'astral': '\uD802[\uDF00-\uDF3F]' + }, + { + 'name': 'InBalinese', + 'bmp': '\u1B00-\u1B7F' + }, + { + 'name': 'InBamum', + 'bmp': '\uA6A0-\uA6FF' + }, + { + 'name': 'InBamum_Supplement', + 'astral': '\uD81A[\uDC00-\uDE3F]' + }, + { + 'name': 'InBasic_Latin', + 'bmp': '\0-\x7F' + }, + { + 'name': 'InBassa_Vah', + 'astral': '\uD81A[\uDED0-\uDEFF]' + }, + { + 'name': 'InBatak', + 'bmp': '\u1BC0-\u1BFF' + }, + { + 'name': 'InBengali', + 'bmp': '\u0980-\u09FF' + }, + { + 'name': 'InBhaiksuki', + 'astral': '\uD807[\uDC00-\uDC6F]' + }, + { + 'name': 'InBlock_Elements', + 'bmp': '\u2580-\u259F' + }, + { + 'name': 'InBopomofo', + 'bmp': '\u3100-\u312F' + }, + { + 'name': 'InBopomofo_Extended', + 'bmp': '\u31A0-\u31BF' + }, + { + 'name': 'InBox_Drawing', + 'bmp': '\u2500-\u257F' + }, + { + 'name': 'InBrahmi', + 'astral': '\uD804[\uDC00-\uDC7F]' + }, + { + 'name': 'InBraille_Patterns', + 'bmp': '\u2800-\u28FF' + }, + { + 'name': 'InBuginese', + 'bmp': '\u1A00-\u1A1F' + }, + { + 'name': 'InBuhid', + 'bmp': '\u1740-\u175F' + }, + { + 'name': 'InByzantine_Musical_Symbols', + 'astral': '\uD834[\uDC00-\uDCFF]' + }, + { + 'name': 'InCJK_Compatibility', + 'bmp': '\u3300-\u33FF' + }, + { + 'name': 'InCJK_Compatibility_Forms', + 'bmp': '\uFE30-\uFE4F' + }, + { + 'name': 'InCJK_Compatibility_Ideographs', + 'bmp': '\uF900-\uFAFF' + }, + { + 'name': 'InCJK_Compatibility_Ideographs_Supplement', + 'astral': '\uD87E[\uDC00-\uDE1F]' + }, + { + 'name': 'InCJK_Radicals_Supplement', + 'bmp': '\u2E80-\u2EFF' + }, + { + 'name': 'InCJK_Strokes', + 'bmp': '\u31C0-\u31EF' + }, + { + 'name': 'InCJK_Symbols_And_Punctuation', + 'bmp': '\u3000-\u303F' + }, + { + 'name': 'InCJK_Unified_Ideographs', + 'bmp': '\u4E00-\u9FFF' + }, + { + 'name': 'InCJK_Unified_Ideographs_Extension_A', + 'bmp': '\u3400-\u4DBF' + }, + { + 'name': 'InCJK_Unified_Ideographs_Extension_B', + 'astral': '[\uD840-\uD868][\uDC00-\uDFFF]|\uD869[\uDC00-\uDEDF]' + }, + { + 'name': 'InCJK_Unified_Ideographs_Extension_C', + 'astral': '\uD869[\uDF00-\uDFFF]|[\uD86A-\uD86C][\uDC00-\uDFFF]|\uD86D[\uDC00-\uDF3F]' + }, + { + 'name': 'InCJK_Unified_Ideographs_Extension_D', + 'astral': '\uD86D[\uDF40-\uDFFF]|\uD86E[\uDC00-\uDC1F]' + }, + { + 'name': 'InCJK_Unified_Ideographs_Extension_E', + 'astral': '\uD86E[\uDC20-\uDFFF]|[\uD86F-\uD872][\uDC00-\uDFFF]|\uD873[\uDC00-\uDEAF]' + }, + { + 'name': 'InCJK_Unified_Ideographs_Extension_F', + 'astral': '\uD873[\uDEB0-\uDFFF]|[\uD874-\uD879][\uDC00-\uDFFF]|\uD87A[\uDC00-\uDFEF]' + }, + { + 'name': 'InCarian', + 'astral': '\uD800[\uDEA0-\uDEDF]' + }, + { + 'name': 'InCaucasian_Albanian', + 'astral': '\uD801[\uDD30-\uDD6F]' + }, + { + 'name': 'InChakma', + 'astral': '\uD804[\uDD00-\uDD4F]' + }, + { + 'name': 'InCham', + 'bmp': '\uAA00-\uAA5F' + }, + { + 'name': 'InCherokee', + 'bmp': '\u13A0-\u13FF' + }, + { + 'name': 'InCherokee_Supplement', + 'bmp': '\uAB70-\uABBF' + }, + { + 'name': 'InChess_Symbols', + 'astral': '\uD83E[\uDE00-\uDE6F]' + }, + { + 'name': 'InCombining_Diacritical_Marks', + 'bmp': '\u0300-\u036F' + }, + { + 'name': 'InCombining_Diacritical_Marks_Extended', + 'bmp': '\u1AB0-\u1AFF' + }, + { + 'name': 'InCombining_Diacritical_Marks_For_Symbols', + 'bmp': '\u20D0-\u20FF' + }, + { + 'name': 'InCombining_Diacritical_Marks_Supplement', + 'bmp': '\u1DC0-\u1DFF' + }, + { + 'name': 'InCombining_Half_Marks', + 'bmp': '\uFE20-\uFE2F' + }, + { + 'name': 'InCommon_Indic_Number_Forms', + 'bmp': '\uA830-\uA83F' + }, + { + 'name': 'InControl_Pictures', + 'bmp': '\u2400-\u243F' + }, + { + 'name': 'InCoptic', + 'bmp': '\u2C80-\u2CFF' + }, + { + 'name': 'InCoptic_Epact_Numbers', + 'astral': '\uD800[\uDEE0-\uDEFF]' + }, + { + 'name': 'InCounting_Rod_Numerals', + 'astral': '\uD834[\uDF60-\uDF7F]' + }, + { + 'name': 'InCuneiform', + 'astral': '\uD808[\uDC00-\uDFFF]' + }, + { + 'name': 'InCuneiform_Numbers_And_Punctuation', + 'astral': '\uD809[\uDC00-\uDC7F]' + }, + { + 'name': 'InCurrency_Symbols', + 'bmp': '\u20A0-\u20CF' + }, + { + 'name': 'InCypriot_Syllabary', + 'astral': '\uD802[\uDC00-\uDC3F]' + }, + { + 'name': 'InCyrillic', + 'bmp': '\u0400-\u04FF' + }, + { + 'name': 'InCyrillic_Extended_A', + 'bmp': '\u2DE0-\u2DFF' + }, + { + 'name': 'InCyrillic_Extended_B', + 'bmp': '\uA640-\uA69F' + }, + { + 'name': 'InCyrillic_Extended_C', + 'bmp': '\u1C80-\u1C8F' + }, + { + 'name': 'InCyrillic_Supplement', + 'bmp': '\u0500-\u052F' + }, + { + 'name': 'InDeseret', + 'astral': '\uD801[\uDC00-\uDC4F]' + }, + { + 'name': 'InDevanagari', + 'bmp': '\u0900-\u097F' + }, + { + 'name': 'InDevanagari_Extended', + 'bmp': '\uA8E0-\uA8FF' + }, + { + 'name': 'InDingbats', + 'bmp': '\u2700-\u27BF' + }, + { + 'name': 'InDogra', + 'astral': '\uD806[\uDC00-\uDC4F]' + }, + { + 'name': 'InDomino_Tiles', + 'astral': '\uD83C[\uDC30-\uDC9F]' + }, + { + 'name': 'InDuployan', + 'astral': '\uD82F[\uDC00-\uDC9F]' + }, + { + 'name': 'InEarly_Dynastic_Cuneiform', + 'astral': '\uD809[\uDC80-\uDD4F]' + }, + { + 'name': 'InEgyptian_Hieroglyphs', + 'astral': '\uD80C[\uDC00-\uDFFF]|\uD80D[\uDC00-\uDC2F]' + }, + { + 'name': 'InElbasan', + 'astral': '\uD801[\uDD00-\uDD2F]' + }, + { + 'name': 'InEmoticons', + 'astral': '\uD83D[\uDE00-\uDE4F]' + }, + { + 'name': 'InEnclosed_Alphanumeric_Supplement', + 'astral': '\uD83C[\uDD00-\uDDFF]' + }, + { + 'name': 'InEnclosed_Alphanumerics', + 'bmp': '\u2460-\u24FF' + }, + { + 'name': 'InEnclosed_CJK_Letters_And_Months', + 'bmp': '\u3200-\u32FF' + }, + { + 'name': 'InEnclosed_Ideographic_Supplement', + 'astral': '\uD83C[\uDE00-\uDEFF]' + }, + { + 'name': 'InEthiopic', + 'bmp': '\u1200-\u137F' + }, + { + 'name': 'InEthiopic_Extended', + 'bmp': '\u2D80-\u2DDF' + }, + { + 'name': 'InEthiopic_Extended_A', + 'bmp': '\uAB00-\uAB2F' + }, + { + 'name': 'InEthiopic_Supplement', + 'bmp': '\u1380-\u139F' + }, + { + 'name': 'InGeneral_Punctuation', + 'bmp': '\u2000-\u206F' + }, + { + 'name': 'InGeometric_Shapes', + 'bmp': '\u25A0-\u25FF' + }, + { + 'name': 'InGeometric_Shapes_Extended', + 'astral': '\uD83D[\uDF80-\uDFFF]' + }, + { + 'name': 'InGeorgian', + 'bmp': '\u10A0-\u10FF' + }, + { + 'name': 'InGeorgian_Extended', + 'bmp': '\u1C90-\u1CBF' + }, + { + 'name': 'InGeorgian_Supplement', + 'bmp': '\u2D00-\u2D2F' + }, + { + 'name': 'InGlagolitic', + 'bmp': '\u2C00-\u2C5F' + }, + { + 'name': 'InGlagolitic_Supplement', + 'astral': '\uD838[\uDC00-\uDC2F]' + }, + { + 'name': 'InGothic', + 'astral': '\uD800[\uDF30-\uDF4F]' + }, + { + 'name': 'InGrantha', + 'astral': '\uD804[\uDF00-\uDF7F]' + }, + { + 'name': 'InGreek_And_Coptic', + 'bmp': '\u0370-\u03FF' + }, + { + 'name': 'InGreek_Extended', + 'bmp': '\u1F00-\u1FFF' + }, + { + 'name': 'InGujarati', + 'bmp': '\u0A80-\u0AFF' + }, + { + 'name': 'InGunjala_Gondi', + 'astral': '\uD807[\uDD60-\uDDAF]' + }, + { + 'name': 'InGurmukhi', + 'bmp': '\u0A00-\u0A7F' + }, + { + 'name': 'InHalfwidth_And_Fullwidth_Forms', + 'bmp': '\uFF00-\uFFEF' + }, + { + 'name': 'InHangul_Compatibility_Jamo', + 'bmp': '\u3130-\u318F' + }, + { + 'name': 'InHangul_Jamo', + 'bmp': '\u1100-\u11FF' + }, + { + 'name': 'InHangul_Jamo_Extended_A', + 'bmp': '\uA960-\uA97F' + }, + { + 'name': 'InHangul_Jamo_Extended_B', + 'bmp': '\uD7B0-\uD7FF' + }, + { + 'name': 'InHangul_Syllables', + 'bmp': '\uAC00-\uD7AF' + }, + { + 'name': 'InHanifi_Rohingya', + 'astral': '\uD803[\uDD00-\uDD3F]' + }, + { + 'name': 'InHanunoo', + 'bmp': '\u1720-\u173F' + }, + { + 'name': 'InHatran', + 'astral': '\uD802[\uDCE0-\uDCFF]' + }, + { + 'name': 'InHebrew', + 'bmp': '\u0590-\u05FF' + }, + { + 'name': 'InHigh_Private_Use_Surrogates', + 'bmp': '\uDB80-\uDBFF' + }, + { + 'name': 'InHigh_Surrogates', + 'bmp': '\uD800-\uDB7F' + }, + { + 'name': 'InHiragana', + 'bmp': '\u3040-\u309F' + }, + { + 'name': 'InIPA_Extensions', + 'bmp': '\u0250-\u02AF' + }, + { + 'name': 'InIdeographic_Description_Characters', + 'bmp': '\u2FF0-\u2FFF' + }, + { + 'name': 'InIdeographic_Symbols_And_Punctuation', + 'astral': '\uD81B[\uDFE0-\uDFFF]' + }, + { + 'name': 'InImperial_Aramaic', + 'astral': '\uD802[\uDC40-\uDC5F]' + }, + { + 'name': 'InIndic_Siyaq_Numbers', + 'astral': '\uD83B[\uDC70-\uDCBF]' + }, + { + 'name': 'InInscriptional_Pahlavi', + 'astral': '\uD802[\uDF60-\uDF7F]' + }, + { + 'name': 'InInscriptional_Parthian', + 'astral': '\uD802[\uDF40-\uDF5F]' + }, + { + 'name': 'InJavanese', + 'bmp': '\uA980-\uA9DF' + }, + { + 'name': 'InKaithi', + 'astral': '\uD804[\uDC80-\uDCCF]' + }, + { + 'name': 'InKana_Extended_A', + 'astral': '\uD82C[\uDD00-\uDD2F]' + }, + { + 'name': 'InKana_Supplement', + 'astral': '\uD82C[\uDC00-\uDCFF]' + }, + { + 'name': 'InKanbun', + 'bmp': '\u3190-\u319F' + }, + { + 'name': 'InKangxi_Radicals', + 'bmp': '\u2F00-\u2FDF' + }, + { + 'name': 'InKannada', + 'bmp': '\u0C80-\u0CFF' + }, + { + 'name': 'InKatakana', + 'bmp': '\u30A0-\u30FF' + }, + { + 'name': 'InKatakana_Phonetic_Extensions', + 'bmp': '\u31F0-\u31FF' + }, + { + 'name': 'InKayah_Li', + 'bmp': '\uA900-\uA92F' + }, + { + 'name': 'InKharoshthi', + 'astral': '\uD802[\uDE00-\uDE5F]' + }, + { + 'name': 'InKhmer', + 'bmp': '\u1780-\u17FF' + }, + { + 'name': 'InKhmer_Symbols', + 'bmp': '\u19E0-\u19FF' + }, + { + 'name': 'InKhojki', + 'astral': '\uD804[\uDE00-\uDE4F]' + }, + { + 'name': 'InKhudawadi', + 'astral': '\uD804[\uDEB0-\uDEFF]' + }, + { + 'name': 'InLao', + 'bmp': '\u0E80-\u0EFF' + }, + { + 'name': 'InLatin_1_Supplement', + 'bmp': '\x80-\xFF' + }, + { + 'name': 'InLatin_Extended_A', + 'bmp': '\u0100-\u017F' + }, + { + 'name': 'InLatin_Extended_Additional', + 'bmp': '\u1E00-\u1EFF' + }, + { + 'name': 'InLatin_Extended_B', + 'bmp': '\u0180-\u024F' + }, + { + 'name': 'InLatin_Extended_C', + 'bmp': '\u2C60-\u2C7F' + }, + { + 'name': 'InLatin_Extended_D', + 'bmp': '\uA720-\uA7FF' + }, + { + 'name': 'InLatin_Extended_E', + 'bmp': '\uAB30-\uAB6F' + }, + { + 'name': 'InLepcha', + 'bmp': '\u1C00-\u1C4F' + }, + { + 'name': 'InLetterlike_Symbols', + 'bmp': '\u2100-\u214F' + }, + { + 'name': 'InLimbu', + 'bmp': '\u1900-\u194F' + }, + { + 'name': 'InLinear_A', + 'astral': '\uD801[\uDE00-\uDF7F]' + }, + { + 'name': 'InLinear_B_Ideograms', + 'astral': '\uD800[\uDC80-\uDCFF]' + }, + { + 'name': 'InLinear_B_Syllabary', + 'astral': '\uD800[\uDC00-\uDC7F]' + }, + { + 'name': 'InLisu', + 'bmp': '\uA4D0-\uA4FF' + }, + { + 'name': 'InLow_Surrogates', + 'bmp': '\uDC00-\uDFFF' + }, + { + 'name': 'InLycian', + 'astral': '\uD800[\uDE80-\uDE9F]' + }, + { + 'name': 'InLydian', + 'astral': '\uD802[\uDD20-\uDD3F]' + }, + { + 'name': 'InMahajani', + 'astral': '\uD804[\uDD50-\uDD7F]' + }, + { + 'name': 'InMahjong_Tiles', + 'astral': '\uD83C[\uDC00-\uDC2F]' + }, + { + 'name': 'InMakasar', + 'astral': '\uD807[\uDEE0-\uDEFF]' + }, + { + 'name': 'InMalayalam', + 'bmp': '\u0D00-\u0D7F' + }, + { + 'name': 'InMandaic', + 'bmp': '\u0840-\u085F' + }, + { + 'name': 'InManichaean', + 'astral': '\uD802[\uDEC0-\uDEFF]' + }, + { + 'name': 'InMarchen', + 'astral': '\uD807[\uDC70-\uDCBF]' + }, + { + 'name': 'InMasaram_Gondi', + 'astral': '\uD807[\uDD00-\uDD5F]' + }, + { + 'name': 'InMathematical_Alphanumeric_Symbols', + 'astral': '\uD835[\uDC00-\uDFFF]' + }, + { + 'name': 'InMathematical_Operators', + 'bmp': '\u2200-\u22FF' + }, + { + 'name': 'InMayan_Numerals', + 'astral': '\uD834[\uDEE0-\uDEFF]' + }, + { + 'name': 'InMedefaidrin', + 'astral': '\uD81B[\uDE40-\uDE9F]' + }, + { + 'name': 'InMeetei_Mayek', + 'bmp': '\uABC0-\uABFF' + }, + { + 'name': 'InMeetei_Mayek_Extensions', + 'bmp': '\uAAE0-\uAAFF' + }, + { + 'name': 'InMende_Kikakui', + 'astral': '\uD83A[\uDC00-\uDCDF]' + }, + { + 'name': 'InMeroitic_Cursive', + 'astral': '\uD802[\uDDA0-\uDDFF]' + }, + { + 'name': 'InMeroitic_Hieroglyphs', + 'astral': '\uD802[\uDD80-\uDD9F]' + }, + { + 'name': 'InMiao', + 'astral': '\uD81B[\uDF00-\uDF9F]' + }, + { + 'name': 'InMiscellaneous_Mathematical_Symbols_A', + 'bmp': '\u27C0-\u27EF' + }, + { + 'name': 'InMiscellaneous_Mathematical_Symbols_B', + 'bmp': '\u2980-\u29FF' + }, + { + 'name': 'InMiscellaneous_Symbols', + 'bmp': '\u2600-\u26FF' + }, + { + 'name': 'InMiscellaneous_Symbols_And_Arrows', + 'bmp': '\u2B00-\u2BFF' + }, + { + 'name': 'InMiscellaneous_Symbols_And_Pictographs', + 'astral': '\uD83C[\uDF00-\uDFFF]|\uD83D[\uDC00-\uDDFF]' + }, + { + 'name': 'InMiscellaneous_Technical', + 'bmp': '\u2300-\u23FF' + }, + { + 'name': 'InModi', + 'astral': '\uD805[\uDE00-\uDE5F]' + }, + { + 'name': 'InModifier_Tone_Letters', + 'bmp': '\uA700-\uA71F' + }, + { + 'name': 'InMongolian', + 'bmp': '\u1800-\u18AF' + }, + { + 'name': 'InMongolian_Supplement', + 'astral': '\uD805[\uDE60-\uDE7F]' + }, + { + 'name': 'InMro', + 'astral': '\uD81A[\uDE40-\uDE6F]' + }, + { + 'name': 'InMultani', + 'astral': '\uD804[\uDE80-\uDEAF]' + }, + { + 'name': 'InMusical_Symbols', + 'astral': '\uD834[\uDD00-\uDDFF]' + }, + { + 'name': 'InMyanmar', + 'bmp': '\u1000-\u109F' + }, + { + 'name': 'InMyanmar_Extended_A', + 'bmp': '\uAA60-\uAA7F' + }, + { + 'name': 'InMyanmar_Extended_B', + 'bmp': '\uA9E0-\uA9FF' + }, + { + 'name': 'InNKo', + 'bmp': '\u07C0-\u07FF' + }, + { + 'name': 'InNabataean', + 'astral': '\uD802[\uDC80-\uDCAF]' + }, + { + 'name': 'InNew_Tai_Lue', + 'bmp': '\u1980-\u19DF' + }, + { + 'name': 'InNewa', + 'astral': '\uD805[\uDC00-\uDC7F]' + }, + { + 'name': 'InNumber_Forms', + 'bmp': '\u2150-\u218F' + }, + { + 'name': 'InNushu', + 'astral': '\uD82C[\uDD70-\uDEFF]' + }, + { + 'name': 'InOgham', + 'bmp': '\u1680-\u169F' + }, + { + 'name': 'InOl_Chiki', + 'bmp': '\u1C50-\u1C7F' + }, + { + 'name': 'InOld_Hungarian', + 'astral': '\uD803[\uDC80-\uDCFF]' + }, + { + 'name': 'InOld_Italic', + 'astral': '\uD800[\uDF00-\uDF2F]' + }, + { + 'name': 'InOld_North_Arabian', + 'astral': '\uD802[\uDE80-\uDE9F]' + }, + { + 'name': 'InOld_Permic', + 'astral': '\uD800[\uDF50-\uDF7F]' + }, + { + 'name': 'InOld_Persian', + 'astral': '\uD800[\uDFA0-\uDFDF]' + }, + { + 'name': 'InOld_Sogdian', + 'astral': '\uD803[\uDF00-\uDF2F]' + }, + { + 'name': 'InOld_South_Arabian', + 'astral': '\uD802[\uDE60-\uDE7F]' + }, + { + 'name': 'InOld_Turkic', + 'astral': '\uD803[\uDC00-\uDC4F]' + }, + { + 'name': 'InOptical_Character_Recognition', + 'bmp': '\u2440-\u245F' + }, + { + 'name': 'InOriya', + 'bmp': '\u0B00-\u0B7F' + }, + { + 'name': 'InOrnamental_Dingbats', + 'astral': '\uD83D[\uDE50-\uDE7F]' + }, + { + 'name': 'InOsage', + 'astral': '\uD801[\uDCB0-\uDCFF]' + }, + { + 'name': 'InOsmanya', + 'astral': '\uD801[\uDC80-\uDCAF]' + }, + { + 'name': 'InPahawh_Hmong', + 'astral': '\uD81A[\uDF00-\uDF8F]' + }, + { + 'name': 'InPalmyrene', + 'astral': '\uD802[\uDC60-\uDC7F]' + }, + { + 'name': 'InPau_Cin_Hau', + 'astral': '\uD806[\uDEC0-\uDEFF]' + }, + { + 'name': 'InPhags_Pa', + 'bmp': '\uA840-\uA87F' + }, + { + 'name': 'InPhaistos_Disc', + 'astral': '\uD800[\uDDD0-\uDDFF]' + }, + { + 'name': 'InPhoenician', + 'astral': '\uD802[\uDD00-\uDD1F]' + }, + { + 'name': 'InPhonetic_Extensions', + 'bmp': '\u1D00-\u1D7F' + }, + { + 'name': 'InPhonetic_Extensions_Supplement', + 'bmp': '\u1D80-\u1DBF' + }, + { + 'name': 'InPlaying_Cards', + 'astral': '\uD83C[\uDCA0-\uDCFF]' + }, + { + 'name': 'InPrivate_Use_Area', + 'bmp': '\uE000-\uF8FF' + }, + { + 'name': 'InPsalter_Pahlavi', + 'astral': '\uD802[\uDF80-\uDFAF]' + }, + { + 'name': 'InRejang', + 'bmp': '\uA930-\uA95F' + }, + { + 'name': 'InRumi_Numeral_Symbols', + 'astral': '\uD803[\uDE60-\uDE7F]' + }, + { + 'name': 'InRunic', + 'bmp': '\u16A0-\u16FF' + }, + { + 'name': 'InSamaritan', + 'bmp': '\u0800-\u083F' + }, + { + 'name': 'InSaurashtra', + 'bmp': '\uA880-\uA8DF' + }, + { + 'name': 'InSharada', + 'astral': '\uD804[\uDD80-\uDDDF]' + }, + { + 'name': 'InShavian', + 'astral': '\uD801[\uDC50-\uDC7F]' + }, + { + 'name': 'InShorthand_Format_Controls', + 'astral': '\uD82F[\uDCA0-\uDCAF]' + }, + { + 'name': 'InSiddham', + 'astral': '\uD805[\uDD80-\uDDFF]' + }, + { + 'name': 'InSinhala', + 'bmp': '\u0D80-\u0DFF' + }, + { + 'name': 'InSinhala_Archaic_Numbers', + 'astral': '\uD804[\uDDE0-\uDDFF]' + }, + { + 'name': 'InSmall_Form_Variants', + 'bmp': '\uFE50-\uFE6F' + }, + { + 'name': 'InSogdian', + 'astral': '\uD803[\uDF30-\uDF6F]' + }, + { + 'name': 'InSora_Sompeng', + 'astral': '\uD804[\uDCD0-\uDCFF]' + }, + { + 'name': 'InSoyombo', + 'astral': '\uD806[\uDE50-\uDEAF]' + }, + { + 'name': 'InSpacing_Modifier_Letters', + 'bmp': '\u02B0-\u02FF' + }, + { + 'name': 'InSpecials', + 'bmp': '\uFFF0-\uFFFF' + }, + { + 'name': 'InSundanese', + 'bmp': '\u1B80-\u1BBF' + }, + { + 'name': 'InSundanese_Supplement', + 'bmp': '\u1CC0-\u1CCF' + }, + { + 'name': 'InSuperscripts_And_Subscripts', + 'bmp': '\u2070-\u209F' + }, + { + 'name': 'InSupplemental_Arrows_A', + 'bmp': '\u27F0-\u27FF' + }, + { + 'name': 'InSupplemental_Arrows_B', + 'bmp': '\u2900-\u297F' + }, + { + 'name': 'InSupplemental_Arrows_C', + 'astral': '\uD83E[\uDC00-\uDCFF]' + }, + { + 'name': 'InSupplemental_Mathematical_Operators', + 'bmp': '\u2A00-\u2AFF' + }, + { + 'name': 'InSupplemental_Punctuation', + 'bmp': '\u2E00-\u2E7F' + }, + { + 'name': 'InSupplemental_Symbols_And_Pictographs', + 'astral': '\uD83E[\uDD00-\uDDFF]' + }, + { + 'name': 'InSupplementary_Private_Use_Area_A', + 'astral': '[\uDB80-\uDBBF][\uDC00-\uDFFF]' + }, + { + 'name': 'InSupplementary_Private_Use_Area_B', + 'astral': '[\uDBC0-\uDBFF][\uDC00-\uDFFF]' + }, + { + 'name': 'InSutton_SignWriting', + 'astral': '\uD836[\uDC00-\uDEAF]' + }, + { + 'name': 'InSyloti_Nagri', + 'bmp': '\uA800-\uA82F' + }, + { + 'name': 'InSyriac', + 'bmp': '\u0700-\u074F' + }, + { + 'name': 'InSyriac_Supplement', + 'bmp': '\u0860-\u086F' + }, + { + 'name': 'InTagalog', + 'bmp': '\u1700-\u171F' + }, + { + 'name': 'InTagbanwa', + 'bmp': '\u1760-\u177F' + }, + { + 'name': 'InTags', + 'astral': '\uDB40[\uDC00-\uDC7F]' + }, + { + 'name': 'InTai_Le', + 'bmp': '\u1950-\u197F' + }, + { + 'name': 'InTai_Tham', + 'bmp': '\u1A20-\u1AAF' + }, + { + 'name': 'InTai_Viet', + 'bmp': '\uAA80-\uAADF' + }, + { + 'name': 'InTai_Xuan_Jing_Symbols', + 'astral': '\uD834[\uDF00-\uDF5F]' + }, + { + 'name': 'InTakri', + 'astral': '\uD805[\uDE80-\uDECF]' + }, + { + 'name': 'InTamil', + 'bmp': '\u0B80-\u0BFF' + }, + { + 'name': 'InTangut', + 'astral': '[\uD81C-\uD821][\uDC00-\uDFFF]' + }, + { + 'name': 'InTangut_Components', + 'astral': '\uD822[\uDC00-\uDEFF]' + }, + { + 'name': 'InTelugu', + 'bmp': '\u0C00-\u0C7F' + }, + { + 'name': 'InThaana', + 'bmp': '\u0780-\u07BF' + }, + { + 'name': 'InThai', + 'bmp': '\u0E00-\u0E7F' + }, + { + 'name': 'InTibetan', + 'bmp': '\u0F00-\u0FFF' + }, + { + 'name': 'InTifinagh', + 'bmp': '\u2D30-\u2D7F' + }, + { + 'name': 'InTirhuta', + 'astral': '\uD805[\uDC80-\uDCDF]' + }, + { + 'name': 'InTransport_And_Map_Symbols', + 'astral': '\uD83D[\uDE80-\uDEFF]' + }, + { + 'name': 'InUgaritic', + 'astral': '\uD800[\uDF80-\uDF9F]' + }, + { + 'name': 'InUnified_Canadian_Aboriginal_Syllabics', + 'bmp': '\u1400-\u167F' + }, + { + 'name': 'InUnified_Canadian_Aboriginal_Syllabics_Extended', + 'bmp': '\u18B0-\u18FF' + }, + { + 'name': 'InVai', + 'bmp': '\uA500-\uA63F' + }, + { + 'name': 'InVariation_Selectors', + 'bmp': '\uFE00-\uFE0F' + }, + { + 'name': 'InVariation_Selectors_Supplement', + 'astral': '\uDB40[\uDD00-\uDDEF]' + }, + { + 'name': 'InVedic_Extensions', + 'bmp': '\u1CD0-\u1CFF' + }, + { + 'name': 'InVertical_Forms', + 'bmp': '\uFE10-\uFE1F' + }, + { + 'name': 'InWarang_Citi', + 'astral': '\uD806[\uDCA0-\uDCFF]' + }, + { + 'name': 'InYi_Radicals', + 'bmp': '\uA490-\uA4CF' + }, + { + 'name': 'InYi_Syllables', + 'bmp': '\uA000-\uA48F' + }, + { + 'name': 'InYijing_Hexagram_Symbols', + 'bmp': '\u4DC0-\u4DFF' + }, + { + 'name': 'InZanabazar_Square', + 'astral': '\uD806[\uDE00-\uDE4F]' + } +]; + +var unicodeBlocks = createCommonjsModule(function (module, exports) { +"use strict"; + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.default = void 0; + +var _blocks = _interopRequireDefault(blocks); + +function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } + +/*! + * XRegExp Unicode Blocks 4.2.0 + * + * Steven Levithan (c) 2010-present MIT License + * Unicode data by Mathias Bynens + */ +var _default = function _default(XRegExp) { + /** + * Adds support for all Unicode blocks. Block names use the prefix 'In'. E.g., + * `\p{InBasicLatin}`. Token names are case insensitive, and any spaces, hyphens, and + * underscores are ignored. + * + * Uses Unicode 11.0.0. + * + * @requires XRegExp, Unicode Base + */ + if (!XRegExp.addUnicodeData) { + throw new ReferenceError('Unicode Base must be loaded before Unicode Blocks'); + } + + XRegExp.addUnicodeData(_blocks.default); +}; + +exports.default = _default; +module.exports = exports["default"]; +}); + +unwrapExports(unicodeBlocks); + +var categories = [ + { + 'name': 'C', + 'alias': 'Other', + 'isBmpLast': true, + 'bmp': '\0-\x1F\x7F-\x9F\xAD\u0378\u0379\u0380-\u0383\u038B\u038D\u03A2\u0530\u0557\u0558\u058B\u058C\u0590\u05C8-\u05CF\u05EB-\u05EE\u05F5-\u0605\u061C\u061D\u06DD\u070E\u070F\u074B\u074C\u07B2-\u07BF\u07FB\u07FC\u082E\u082F\u083F\u085C\u085D\u085F\u086B-\u089F\u08B5\u08BE-\u08D2\u08E2\u0984\u098D\u098E\u0991\u0992\u09A9\u09B1\u09B3-\u09B5\u09BA\u09BB\u09C5\u09C6\u09C9\u09CA\u09CF-\u09D6\u09D8-\u09DB\u09DE\u09E4\u09E5\u09FF\u0A00\u0A04\u0A0B-\u0A0E\u0A11\u0A12\u0A29\u0A31\u0A34\u0A37\u0A3A\u0A3B\u0A3D\u0A43-\u0A46\u0A49\u0A4A\u0A4E-\u0A50\u0A52-\u0A58\u0A5D\u0A5F-\u0A65\u0A77-\u0A80\u0A84\u0A8E\u0A92\u0AA9\u0AB1\u0AB4\u0ABA\u0ABB\u0AC6\u0ACA\u0ACE\u0ACF\u0AD1-\u0ADF\u0AE4\u0AE5\u0AF2-\u0AF8\u0B00\u0B04\u0B0D\u0B0E\u0B11\u0B12\u0B29\u0B31\u0B34\u0B3A\u0B3B\u0B45\u0B46\u0B49\u0B4A\u0B4E-\u0B55\u0B58-\u0B5B\u0B5E\u0B64\u0B65\u0B78-\u0B81\u0B84\u0B8B-\u0B8D\u0B91\u0B96-\u0B98\u0B9B\u0B9D\u0BA0-\u0BA2\u0BA5-\u0BA7\u0BAB-\u0BAD\u0BBA-\u0BBD\u0BC3-\u0BC5\u0BC9\u0BCE\u0BCF\u0BD1-\u0BD6\u0BD8-\u0BE5\u0BFB-\u0BFF\u0C0D\u0C11\u0C29\u0C3A-\u0C3C\u0C45\u0C49\u0C4E-\u0C54\u0C57\u0C5B-\u0C5F\u0C64\u0C65\u0C70-\u0C77\u0C8D\u0C91\u0CA9\u0CB4\u0CBA\u0CBB\u0CC5\u0CC9\u0CCE-\u0CD4\u0CD7-\u0CDD\u0CDF\u0CE4\u0CE5\u0CF0\u0CF3-\u0CFF\u0D04\u0D0D\u0D11\u0D45\u0D49\u0D50-\u0D53\u0D64\u0D65\u0D80\u0D81\u0D84\u0D97-\u0D99\u0DB2\u0DBC\u0DBE\u0DBF\u0DC7-\u0DC9\u0DCB-\u0DCE\u0DD5\u0DD7\u0DE0-\u0DE5\u0DF0\u0DF1\u0DF5-\u0E00\u0E3B-\u0E3E\u0E5C-\u0E80\u0E83\u0E85\u0E86\u0E89\u0E8B\u0E8C\u0E8E-\u0E93\u0E98\u0EA0\u0EA4\u0EA6\u0EA8\u0EA9\u0EAC\u0EBA\u0EBE\u0EBF\u0EC5\u0EC7\u0ECE\u0ECF\u0EDA\u0EDB\u0EE0-\u0EFF\u0F48\u0F6D-\u0F70\u0F98\u0FBD\u0FCD\u0FDB-\u0FFF\u10C6\u10C8-\u10CC\u10CE\u10CF\u1249\u124E\u124F\u1257\u1259\u125E\u125F\u1289\u128E\u128F\u12B1\u12B6\u12B7\u12BF\u12C1\u12C6\u12C7\u12D7\u1311\u1316\u1317\u135B\u135C\u137D-\u137F\u139A-\u139F\u13F6\u13F7\u13FE\u13FF\u169D-\u169F\u16F9-\u16FF\u170D\u1715-\u171F\u1737-\u173F\u1754-\u175F\u176D\u1771\u1774-\u177F\u17DE\u17DF\u17EA-\u17EF\u17FA-\u17FF\u180E\u180F\u181A-\u181F\u1879-\u187F\u18AB-\u18AF\u18F6-\u18FF\u191F\u192C-\u192F\u193C-\u193F\u1941-\u1943\u196E\u196F\u1975-\u197F\u19AC-\u19AF\u19CA-\u19CF\u19DB-\u19DD\u1A1C\u1A1D\u1A5F\u1A7D\u1A7E\u1A8A-\u1A8F\u1A9A-\u1A9F\u1AAE\u1AAF\u1ABF-\u1AFF\u1B4C-\u1B4F\u1B7D-\u1B7F\u1BF4-\u1BFB\u1C38-\u1C3A\u1C4A-\u1C4C\u1C89-\u1C8F\u1CBB\u1CBC\u1CC8-\u1CCF\u1CFA-\u1CFF\u1DFA\u1F16\u1F17\u1F1E\u1F1F\u1F46\u1F47\u1F4E\u1F4F\u1F58\u1F5A\u1F5C\u1F5E\u1F7E\u1F7F\u1FB5\u1FC5\u1FD4\u1FD5\u1FDC\u1FF0\u1FF1\u1FF5\u1FFF\u200B-\u200F\u202A-\u202E\u2060-\u206F\u2072\u2073\u208F\u209D-\u209F\u20C0-\u20CF\u20F1-\u20FF\u218C-\u218F\u2427-\u243F\u244B-\u245F\u2B74\u2B75\u2B96\u2B97\u2BC9\u2BFF\u2C2F\u2C5F\u2CF4-\u2CF8\u2D26\u2D28-\u2D2C\u2D2E\u2D2F\u2D68-\u2D6E\u2D71-\u2D7E\u2D97-\u2D9F\u2DA7\u2DAF\u2DB7\u2DBF\u2DC7\u2DCF\u2DD7\u2DDF\u2E4F-\u2E7F\u2E9A\u2EF4-\u2EFF\u2FD6-\u2FEF\u2FFC-\u2FFF\u3040\u3097\u3098\u3100-\u3104\u3130\u318F\u31BB-\u31BF\u31E4-\u31EF\u321F\u32FF\u4DB6-\u4DBF\u9FF0-\u9FFF\uA48D-\uA48F\uA4C7-\uA4CF\uA62C-\uA63F\uA6F8-\uA6FF\uA7BA-\uA7F6\uA82C-\uA82F\uA83A-\uA83F\uA878-\uA87F\uA8C6-\uA8CD\uA8DA-\uA8DF\uA954-\uA95E\uA97D-\uA97F\uA9CE\uA9DA-\uA9DD\uA9FF\uAA37-\uAA3F\uAA4E\uAA4F\uAA5A\uAA5B\uAAC3-\uAADA\uAAF7-\uAB00\uAB07\uAB08\uAB0F\uAB10\uAB17-\uAB1F\uAB27\uAB2F\uAB66-\uAB6F\uABEE\uABEF\uABFA-\uABFF\uD7A4-\uD7AF\uD7C7-\uD7CA\uD7FC-\uF8FF\uFA6E\uFA6F\uFADA-\uFAFF\uFB07-\uFB12\uFB18-\uFB1C\uFB37\uFB3D\uFB3F\uFB42\uFB45\uFBC2-\uFBD2\uFD40-\uFD4F\uFD90\uFD91\uFDC8-\uFDEF\uFDFE\uFDFF\uFE1A-\uFE1F\uFE53\uFE67\uFE6C-\uFE6F\uFE75\uFEFD-\uFF00\uFFBF-\uFFC1\uFFC8\uFFC9\uFFD0\uFFD1\uFFD8\uFFD9\uFFDD-\uFFDF\uFFE7\uFFEF-\uFFFB\uFFFE\uFFFF', + 'astral': '\uD800[\uDC0C\uDC27\uDC3B\uDC3E\uDC4E\uDC4F\uDC5E-\uDC7F\uDCFB-\uDCFF\uDD03-\uDD06\uDD34-\uDD36\uDD8F\uDD9C-\uDD9F\uDDA1-\uDDCF\uDDFE-\uDE7F\uDE9D-\uDE9F\uDED1-\uDEDF\uDEFC-\uDEFF\uDF24-\uDF2C\uDF4B-\uDF4F\uDF7B-\uDF7F\uDF9E\uDFC4-\uDFC7\uDFD6-\uDFFF]|\uD801[\uDC9E\uDC9F\uDCAA-\uDCAF\uDCD4-\uDCD7\uDCFC-\uDCFF\uDD28-\uDD2F\uDD64-\uDD6E\uDD70-\uDDFF\uDF37-\uDF3F\uDF56-\uDF5F\uDF68-\uDFFF]|\uD802[\uDC06\uDC07\uDC09\uDC36\uDC39-\uDC3B\uDC3D\uDC3E\uDC56\uDC9F-\uDCA6\uDCB0-\uDCDF\uDCF3\uDCF6-\uDCFA\uDD1C-\uDD1E\uDD3A-\uDD3E\uDD40-\uDD7F\uDDB8-\uDDBB\uDDD0\uDDD1\uDE04\uDE07-\uDE0B\uDE14\uDE18\uDE36\uDE37\uDE3B-\uDE3E\uDE49-\uDE4F\uDE59-\uDE5F\uDEA0-\uDEBF\uDEE7-\uDEEA\uDEF7-\uDEFF\uDF36-\uDF38\uDF56\uDF57\uDF73-\uDF77\uDF92-\uDF98\uDF9D-\uDFA8\uDFB0-\uDFFF]|\uD803[\uDC49-\uDC7F\uDCB3-\uDCBF\uDCF3-\uDCF9\uDD28-\uDD2F\uDD3A-\uDE5F\uDE7F-\uDEFF\uDF28-\uDF2F\uDF5A-\uDFFF]|\uD804[\uDC4E-\uDC51\uDC70-\uDC7E\uDCBD\uDCC2-\uDCCF\uDCE9-\uDCEF\uDCFA-\uDCFF\uDD35\uDD47-\uDD4F\uDD77-\uDD7F\uDDCE\uDDCF\uDDE0\uDDF5-\uDDFF\uDE12\uDE3F-\uDE7F\uDE87\uDE89\uDE8E\uDE9E\uDEAA-\uDEAF\uDEEB-\uDEEF\uDEFA-\uDEFF\uDF04\uDF0D\uDF0E\uDF11\uDF12\uDF29\uDF31\uDF34\uDF3A\uDF45\uDF46\uDF49\uDF4A\uDF4E\uDF4F\uDF51-\uDF56\uDF58-\uDF5C\uDF64\uDF65\uDF6D-\uDF6F\uDF75-\uDFFF]|\uD805[\uDC5A\uDC5C\uDC5F-\uDC7F\uDCC8-\uDCCF\uDCDA-\uDD7F\uDDB6\uDDB7\uDDDE-\uDDFF\uDE45-\uDE4F\uDE5A-\uDE5F\uDE6D-\uDE7F\uDEB8-\uDEBF\uDECA-\uDEFF\uDF1B\uDF1C\uDF2C-\uDF2F\uDF40-\uDFFF]|\uD806[\uDC3C-\uDC9F\uDCF3-\uDCFE\uDD00-\uDDFF\uDE48-\uDE4F\uDE84\uDE85\uDEA3-\uDEBF\uDEF9-\uDFFF]|\uD807[\uDC09\uDC37\uDC46-\uDC4F\uDC6D-\uDC6F\uDC90\uDC91\uDCA8\uDCB7-\uDCFF\uDD07\uDD0A\uDD37-\uDD39\uDD3B\uDD3E\uDD48-\uDD4F\uDD5A-\uDD5F\uDD66\uDD69\uDD8F\uDD92\uDD99-\uDD9F\uDDAA-\uDEDF\uDEF9-\uDFFF]|\uD808[\uDF9A-\uDFFF]|\uD809[\uDC6F\uDC75-\uDC7F\uDD44-\uDFFF]|[\uD80A\uD80B\uD80E-\uD810\uD812-\uD819\uD823-\uD82B\uD82D\uD82E\uD830-\uD833\uD837\uD839\uD83F\uD87B-\uD87D\uD87F-\uDB3F\uDB41-\uDBFF][\uDC00-\uDFFF]|\uD80D[\uDC2F-\uDFFF]|\uD811[\uDE47-\uDFFF]|\uD81A[\uDE39-\uDE3F\uDE5F\uDE6A-\uDE6D\uDE70-\uDECF\uDEEE\uDEEF\uDEF6-\uDEFF\uDF46-\uDF4F\uDF5A\uDF62\uDF78-\uDF7C\uDF90-\uDFFF]|\uD81B[\uDC00-\uDE3F\uDE9B-\uDEFF\uDF45-\uDF4F\uDF7F-\uDF8E\uDFA0-\uDFDF\uDFE2-\uDFFF]|\uD821[\uDFF2-\uDFFF]|\uD822[\uDEF3-\uDFFF]|\uD82C[\uDD1F-\uDD6F\uDEFC-\uDFFF]|\uD82F[\uDC6B-\uDC6F\uDC7D-\uDC7F\uDC89-\uDC8F\uDC9A\uDC9B\uDCA0-\uDFFF]|\uD834[\uDCF6-\uDCFF\uDD27\uDD28\uDD73-\uDD7A\uDDE9-\uDDFF\uDE46-\uDEDF\uDEF4-\uDEFF\uDF57-\uDF5F\uDF79-\uDFFF]|\uD835[\uDC55\uDC9D\uDCA0\uDCA1\uDCA3\uDCA4\uDCA7\uDCA8\uDCAD\uDCBA\uDCBC\uDCC4\uDD06\uDD0B\uDD0C\uDD15\uDD1D\uDD3A\uDD3F\uDD45\uDD47-\uDD49\uDD51\uDEA6\uDEA7\uDFCC\uDFCD]|\uD836[\uDE8C-\uDE9A\uDEA0\uDEB0-\uDFFF]|\uD838[\uDC07\uDC19\uDC1A\uDC22\uDC25\uDC2B-\uDFFF]|\uD83A[\uDCC5\uDCC6\uDCD7-\uDCFF\uDD4B-\uDD4F\uDD5A-\uDD5D\uDD60-\uDFFF]|\uD83B[\uDC00-\uDC70\uDCB5-\uDDFF\uDE04\uDE20\uDE23\uDE25\uDE26\uDE28\uDE33\uDE38\uDE3A\uDE3C-\uDE41\uDE43-\uDE46\uDE48\uDE4A\uDE4C\uDE50\uDE53\uDE55\uDE56\uDE58\uDE5A\uDE5C\uDE5E\uDE60\uDE63\uDE65\uDE66\uDE6B\uDE73\uDE78\uDE7D\uDE7F\uDE8A\uDE9C-\uDEA0\uDEA4\uDEAA\uDEBC-\uDEEF\uDEF2-\uDFFF]|\uD83C[\uDC2C-\uDC2F\uDC94-\uDC9F\uDCAF\uDCB0\uDCC0\uDCD0\uDCF6-\uDCFF\uDD0D-\uDD0F\uDD6C-\uDD6F\uDDAD-\uDDE5\uDE03-\uDE0F\uDE3C-\uDE3F\uDE49-\uDE4F\uDE52-\uDE5F\uDE66-\uDEFF]|\uD83D[\uDED5-\uDEDF\uDEED-\uDEEF\uDEFA-\uDEFF\uDF74-\uDF7F\uDFD9-\uDFFF]|\uD83E[\uDC0C-\uDC0F\uDC48-\uDC4F\uDC5A-\uDC5F\uDC88-\uDC8F\uDCAE-\uDCFF\uDD0C-\uDD0F\uDD3F\uDD71\uDD72\uDD77-\uDD79\uDD7B\uDDA3-\uDDAF\uDDBA-\uDDBF\uDDC3-\uDDCF\uDE00-\uDE5F\uDE6E-\uDFFF]|\uD869[\uDED7-\uDEFF]|\uD86D[\uDF35-\uDF3F]|\uD86E[\uDC1E\uDC1F]|\uD873[\uDEA2-\uDEAF]|\uD87A[\uDFE1-\uDFFF]|\uD87E[\uDE1E-\uDFFF]|\uDB40[\uDC00-\uDCFF\uDDF0-\uDFFF]' + }, + { + 'name': 'Cc', + 'alias': 'Control', + 'bmp': '\0-\x1F\x7F-\x9F' + }, + { + 'name': 'Cf', + 'alias': 'Format', + 'bmp': '\xAD\u0600-\u0605\u061C\u06DD\u070F\u08E2\u180E\u200B-\u200F\u202A-\u202E\u2060-\u2064\u2066-\u206F\uFEFF\uFFF9-\uFFFB', + 'astral': '\uD804[\uDCBD\uDCCD]|\uD82F[\uDCA0-\uDCA3]|\uD834[\uDD73-\uDD7A]|\uDB40[\uDC01\uDC20-\uDC7F]' + }, + { + 'name': 'Cn', + 'alias': 'Unassigned', + 'bmp': '\u0378\u0379\u0380-\u0383\u038B\u038D\u03A2\u0530\u0557\u0558\u058B\u058C\u0590\u05C8-\u05CF\u05EB-\u05EE\u05F5-\u05FF\u061D\u070E\u074B\u074C\u07B2-\u07BF\u07FB\u07FC\u082E\u082F\u083F\u085C\u085D\u085F\u086B-\u089F\u08B5\u08BE-\u08D2\u0984\u098D\u098E\u0991\u0992\u09A9\u09B1\u09B3-\u09B5\u09BA\u09BB\u09C5\u09C6\u09C9\u09CA\u09CF-\u09D6\u09D8-\u09DB\u09DE\u09E4\u09E5\u09FF\u0A00\u0A04\u0A0B-\u0A0E\u0A11\u0A12\u0A29\u0A31\u0A34\u0A37\u0A3A\u0A3B\u0A3D\u0A43-\u0A46\u0A49\u0A4A\u0A4E-\u0A50\u0A52-\u0A58\u0A5D\u0A5F-\u0A65\u0A77-\u0A80\u0A84\u0A8E\u0A92\u0AA9\u0AB1\u0AB4\u0ABA\u0ABB\u0AC6\u0ACA\u0ACE\u0ACF\u0AD1-\u0ADF\u0AE4\u0AE5\u0AF2-\u0AF8\u0B00\u0B04\u0B0D\u0B0E\u0B11\u0B12\u0B29\u0B31\u0B34\u0B3A\u0B3B\u0B45\u0B46\u0B49\u0B4A\u0B4E-\u0B55\u0B58-\u0B5B\u0B5E\u0B64\u0B65\u0B78-\u0B81\u0B84\u0B8B-\u0B8D\u0B91\u0B96-\u0B98\u0B9B\u0B9D\u0BA0-\u0BA2\u0BA5-\u0BA7\u0BAB-\u0BAD\u0BBA-\u0BBD\u0BC3-\u0BC5\u0BC9\u0BCE\u0BCF\u0BD1-\u0BD6\u0BD8-\u0BE5\u0BFB-\u0BFF\u0C0D\u0C11\u0C29\u0C3A-\u0C3C\u0C45\u0C49\u0C4E-\u0C54\u0C57\u0C5B-\u0C5F\u0C64\u0C65\u0C70-\u0C77\u0C8D\u0C91\u0CA9\u0CB4\u0CBA\u0CBB\u0CC5\u0CC9\u0CCE-\u0CD4\u0CD7-\u0CDD\u0CDF\u0CE4\u0CE5\u0CF0\u0CF3-\u0CFF\u0D04\u0D0D\u0D11\u0D45\u0D49\u0D50-\u0D53\u0D64\u0D65\u0D80\u0D81\u0D84\u0D97-\u0D99\u0DB2\u0DBC\u0DBE\u0DBF\u0DC7-\u0DC9\u0DCB-\u0DCE\u0DD5\u0DD7\u0DE0-\u0DE5\u0DF0\u0DF1\u0DF5-\u0E00\u0E3B-\u0E3E\u0E5C-\u0E80\u0E83\u0E85\u0E86\u0E89\u0E8B\u0E8C\u0E8E-\u0E93\u0E98\u0EA0\u0EA4\u0EA6\u0EA8\u0EA9\u0EAC\u0EBA\u0EBE\u0EBF\u0EC5\u0EC7\u0ECE\u0ECF\u0EDA\u0EDB\u0EE0-\u0EFF\u0F48\u0F6D-\u0F70\u0F98\u0FBD\u0FCD\u0FDB-\u0FFF\u10C6\u10C8-\u10CC\u10CE\u10CF\u1249\u124E\u124F\u1257\u1259\u125E\u125F\u1289\u128E\u128F\u12B1\u12B6\u12B7\u12BF\u12C1\u12C6\u12C7\u12D7\u1311\u1316\u1317\u135B\u135C\u137D-\u137F\u139A-\u139F\u13F6\u13F7\u13FE\u13FF\u169D-\u169F\u16F9-\u16FF\u170D\u1715-\u171F\u1737-\u173F\u1754-\u175F\u176D\u1771\u1774-\u177F\u17DE\u17DF\u17EA-\u17EF\u17FA-\u17FF\u180F\u181A-\u181F\u1879-\u187F\u18AB-\u18AF\u18F6-\u18FF\u191F\u192C-\u192F\u193C-\u193F\u1941-\u1943\u196E\u196F\u1975-\u197F\u19AC-\u19AF\u19CA-\u19CF\u19DB-\u19DD\u1A1C\u1A1D\u1A5F\u1A7D\u1A7E\u1A8A-\u1A8F\u1A9A-\u1A9F\u1AAE\u1AAF\u1ABF-\u1AFF\u1B4C-\u1B4F\u1B7D-\u1B7F\u1BF4-\u1BFB\u1C38-\u1C3A\u1C4A-\u1C4C\u1C89-\u1C8F\u1CBB\u1CBC\u1CC8-\u1CCF\u1CFA-\u1CFF\u1DFA\u1F16\u1F17\u1F1E\u1F1F\u1F46\u1F47\u1F4E\u1F4F\u1F58\u1F5A\u1F5C\u1F5E\u1F7E\u1F7F\u1FB5\u1FC5\u1FD4\u1FD5\u1FDC\u1FF0\u1FF1\u1FF5\u1FFF\u2065\u2072\u2073\u208F\u209D-\u209F\u20C0-\u20CF\u20F1-\u20FF\u218C-\u218F\u2427-\u243F\u244B-\u245F\u2B74\u2B75\u2B96\u2B97\u2BC9\u2BFF\u2C2F\u2C5F\u2CF4-\u2CF8\u2D26\u2D28-\u2D2C\u2D2E\u2D2F\u2D68-\u2D6E\u2D71-\u2D7E\u2D97-\u2D9F\u2DA7\u2DAF\u2DB7\u2DBF\u2DC7\u2DCF\u2DD7\u2DDF\u2E4F-\u2E7F\u2E9A\u2EF4-\u2EFF\u2FD6-\u2FEF\u2FFC-\u2FFF\u3040\u3097\u3098\u3100-\u3104\u3130\u318F\u31BB-\u31BF\u31E4-\u31EF\u321F\u32FF\u4DB6-\u4DBF\u9FF0-\u9FFF\uA48D-\uA48F\uA4C7-\uA4CF\uA62C-\uA63F\uA6F8-\uA6FF\uA7BA-\uA7F6\uA82C-\uA82F\uA83A-\uA83F\uA878-\uA87F\uA8C6-\uA8CD\uA8DA-\uA8DF\uA954-\uA95E\uA97D-\uA97F\uA9CE\uA9DA-\uA9DD\uA9FF\uAA37-\uAA3F\uAA4E\uAA4F\uAA5A\uAA5B\uAAC3-\uAADA\uAAF7-\uAB00\uAB07\uAB08\uAB0F\uAB10\uAB17-\uAB1F\uAB27\uAB2F\uAB66-\uAB6F\uABEE\uABEF\uABFA-\uABFF\uD7A4-\uD7AF\uD7C7-\uD7CA\uD7FC-\uD7FF\uFA6E\uFA6F\uFADA-\uFAFF\uFB07-\uFB12\uFB18-\uFB1C\uFB37\uFB3D\uFB3F\uFB42\uFB45\uFBC2-\uFBD2\uFD40-\uFD4F\uFD90\uFD91\uFDC8-\uFDEF\uFDFE\uFDFF\uFE1A-\uFE1F\uFE53\uFE67\uFE6C-\uFE6F\uFE75\uFEFD\uFEFE\uFF00\uFFBF-\uFFC1\uFFC8\uFFC9\uFFD0\uFFD1\uFFD8\uFFD9\uFFDD-\uFFDF\uFFE7\uFFEF-\uFFF8\uFFFE\uFFFF', + 'astral': '\uD800[\uDC0C\uDC27\uDC3B\uDC3E\uDC4E\uDC4F\uDC5E-\uDC7F\uDCFB-\uDCFF\uDD03-\uDD06\uDD34-\uDD36\uDD8F\uDD9C-\uDD9F\uDDA1-\uDDCF\uDDFE-\uDE7F\uDE9D-\uDE9F\uDED1-\uDEDF\uDEFC-\uDEFF\uDF24-\uDF2C\uDF4B-\uDF4F\uDF7B-\uDF7F\uDF9E\uDFC4-\uDFC7\uDFD6-\uDFFF]|\uD801[\uDC9E\uDC9F\uDCAA-\uDCAF\uDCD4-\uDCD7\uDCFC-\uDCFF\uDD28-\uDD2F\uDD64-\uDD6E\uDD70-\uDDFF\uDF37-\uDF3F\uDF56-\uDF5F\uDF68-\uDFFF]|\uD802[\uDC06\uDC07\uDC09\uDC36\uDC39-\uDC3B\uDC3D\uDC3E\uDC56\uDC9F-\uDCA6\uDCB0-\uDCDF\uDCF3\uDCF6-\uDCFA\uDD1C-\uDD1E\uDD3A-\uDD3E\uDD40-\uDD7F\uDDB8-\uDDBB\uDDD0\uDDD1\uDE04\uDE07-\uDE0B\uDE14\uDE18\uDE36\uDE37\uDE3B-\uDE3E\uDE49-\uDE4F\uDE59-\uDE5F\uDEA0-\uDEBF\uDEE7-\uDEEA\uDEF7-\uDEFF\uDF36-\uDF38\uDF56\uDF57\uDF73-\uDF77\uDF92-\uDF98\uDF9D-\uDFA8\uDFB0-\uDFFF]|\uD803[\uDC49-\uDC7F\uDCB3-\uDCBF\uDCF3-\uDCF9\uDD28-\uDD2F\uDD3A-\uDE5F\uDE7F-\uDEFF\uDF28-\uDF2F\uDF5A-\uDFFF]|\uD804[\uDC4E-\uDC51\uDC70-\uDC7E\uDCC2-\uDCCC\uDCCE\uDCCF\uDCE9-\uDCEF\uDCFA-\uDCFF\uDD35\uDD47-\uDD4F\uDD77-\uDD7F\uDDCE\uDDCF\uDDE0\uDDF5-\uDDFF\uDE12\uDE3F-\uDE7F\uDE87\uDE89\uDE8E\uDE9E\uDEAA-\uDEAF\uDEEB-\uDEEF\uDEFA-\uDEFF\uDF04\uDF0D\uDF0E\uDF11\uDF12\uDF29\uDF31\uDF34\uDF3A\uDF45\uDF46\uDF49\uDF4A\uDF4E\uDF4F\uDF51-\uDF56\uDF58-\uDF5C\uDF64\uDF65\uDF6D-\uDF6F\uDF75-\uDFFF]|\uD805[\uDC5A\uDC5C\uDC5F-\uDC7F\uDCC8-\uDCCF\uDCDA-\uDD7F\uDDB6\uDDB7\uDDDE-\uDDFF\uDE45-\uDE4F\uDE5A-\uDE5F\uDE6D-\uDE7F\uDEB8-\uDEBF\uDECA-\uDEFF\uDF1B\uDF1C\uDF2C-\uDF2F\uDF40-\uDFFF]|\uD806[\uDC3C-\uDC9F\uDCF3-\uDCFE\uDD00-\uDDFF\uDE48-\uDE4F\uDE84\uDE85\uDEA3-\uDEBF\uDEF9-\uDFFF]|\uD807[\uDC09\uDC37\uDC46-\uDC4F\uDC6D-\uDC6F\uDC90\uDC91\uDCA8\uDCB7-\uDCFF\uDD07\uDD0A\uDD37-\uDD39\uDD3B\uDD3E\uDD48-\uDD4F\uDD5A-\uDD5F\uDD66\uDD69\uDD8F\uDD92\uDD99-\uDD9F\uDDAA-\uDEDF\uDEF9-\uDFFF]|\uD808[\uDF9A-\uDFFF]|\uD809[\uDC6F\uDC75-\uDC7F\uDD44-\uDFFF]|[\uD80A\uD80B\uD80E-\uD810\uD812-\uD819\uD823-\uD82B\uD82D\uD82E\uD830-\uD833\uD837\uD839\uD83F\uD87B-\uD87D\uD87F-\uDB3F\uDB41-\uDB7F][\uDC00-\uDFFF]|\uD80D[\uDC2F-\uDFFF]|\uD811[\uDE47-\uDFFF]|\uD81A[\uDE39-\uDE3F\uDE5F\uDE6A-\uDE6D\uDE70-\uDECF\uDEEE\uDEEF\uDEF6-\uDEFF\uDF46-\uDF4F\uDF5A\uDF62\uDF78-\uDF7C\uDF90-\uDFFF]|\uD81B[\uDC00-\uDE3F\uDE9B-\uDEFF\uDF45-\uDF4F\uDF7F-\uDF8E\uDFA0-\uDFDF\uDFE2-\uDFFF]|\uD821[\uDFF2-\uDFFF]|\uD822[\uDEF3-\uDFFF]|\uD82C[\uDD1F-\uDD6F\uDEFC-\uDFFF]|\uD82F[\uDC6B-\uDC6F\uDC7D-\uDC7F\uDC89-\uDC8F\uDC9A\uDC9B\uDCA4-\uDFFF]|\uD834[\uDCF6-\uDCFF\uDD27\uDD28\uDDE9-\uDDFF\uDE46-\uDEDF\uDEF4-\uDEFF\uDF57-\uDF5F\uDF79-\uDFFF]|\uD835[\uDC55\uDC9D\uDCA0\uDCA1\uDCA3\uDCA4\uDCA7\uDCA8\uDCAD\uDCBA\uDCBC\uDCC4\uDD06\uDD0B\uDD0C\uDD15\uDD1D\uDD3A\uDD3F\uDD45\uDD47-\uDD49\uDD51\uDEA6\uDEA7\uDFCC\uDFCD]|\uD836[\uDE8C-\uDE9A\uDEA0\uDEB0-\uDFFF]|\uD838[\uDC07\uDC19\uDC1A\uDC22\uDC25\uDC2B-\uDFFF]|\uD83A[\uDCC5\uDCC6\uDCD7-\uDCFF\uDD4B-\uDD4F\uDD5A-\uDD5D\uDD60-\uDFFF]|\uD83B[\uDC00-\uDC70\uDCB5-\uDDFF\uDE04\uDE20\uDE23\uDE25\uDE26\uDE28\uDE33\uDE38\uDE3A\uDE3C-\uDE41\uDE43-\uDE46\uDE48\uDE4A\uDE4C\uDE50\uDE53\uDE55\uDE56\uDE58\uDE5A\uDE5C\uDE5E\uDE60\uDE63\uDE65\uDE66\uDE6B\uDE73\uDE78\uDE7D\uDE7F\uDE8A\uDE9C-\uDEA0\uDEA4\uDEAA\uDEBC-\uDEEF\uDEF2-\uDFFF]|\uD83C[\uDC2C-\uDC2F\uDC94-\uDC9F\uDCAF\uDCB0\uDCC0\uDCD0\uDCF6-\uDCFF\uDD0D-\uDD0F\uDD6C-\uDD6F\uDDAD-\uDDE5\uDE03-\uDE0F\uDE3C-\uDE3F\uDE49-\uDE4F\uDE52-\uDE5F\uDE66-\uDEFF]|\uD83D[\uDED5-\uDEDF\uDEED-\uDEEF\uDEFA-\uDEFF\uDF74-\uDF7F\uDFD9-\uDFFF]|\uD83E[\uDC0C-\uDC0F\uDC48-\uDC4F\uDC5A-\uDC5F\uDC88-\uDC8F\uDCAE-\uDCFF\uDD0C-\uDD0F\uDD3F\uDD71\uDD72\uDD77-\uDD79\uDD7B\uDDA3-\uDDAF\uDDBA-\uDDBF\uDDC3-\uDDCF\uDE00-\uDE5F\uDE6E-\uDFFF]|\uD869[\uDED7-\uDEFF]|\uD86D[\uDF35-\uDF3F]|\uD86E[\uDC1E\uDC1F]|\uD873[\uDEA2-\uDEAF]|\uD87A[\uDFE1-\uDFFF]|\uD87E[\uDE1E-\uDFFF]|\uDB40[\uDC00\uDC02-\uDC1F\uDC80-\uDCFF\uDDF0-\uDFFF]|[\uDBBF\uDBFF][\uDFFE\uDFFF]' + }, + { + 'name': 'Co', + 'alias': 'Private_Use', + 'bmp': '\uE000-\uF8FF', + 'astral': '[\uDB80-\uDBBE\uDBC0-\uDBFE][\uDC00-\uDFFF]|[\uDBBF\uDBFF][\uDC00-\uDFFD]' + }, + { + 'name': 'Cs', + 'alias': 'Surrogate', + 'bmp': '\uD800-\uDFFF' + }, + { + 'name': 'L', + 'alias': 'Letter', + 'bmp': 'A-Za-z\xAA\xB5\xBA\xC0-\xD6\xD8-\xF6\xF8-\u02C1\u02C6-\u02D1\u02E0-\u02E4\u02EC\u02EE\u0370-\u0374\u0376\u0377\u037A-\u037D\u037F\u0386\u0388-\u038A\u038C\u038E-\u03A1\u03A3-\u03F5\u03F7-\u0481\u048A-\u052F\u0531-\u0556\u0559\u0560-\u0588\u05D0-\u05EA\u05EF-\u05F2\u0620-\u064A\u066E\u066F\u0671-\u06D3\u06D5\u06E5\u06E6\u06EE\u06EF\u06FA-\u06FC\u06FF\u0710\u0712-\u072F\u074D-\u07A5\u07B1\u07CA-\u07EA\u07F4\u07F5\u07FA\u0800-\u0815\u081A\u0824\u0828\u0840-\u0858\u0860-\u086A\u08A0-\u08B4\u08B6-\u08BD\u0904-\u0939\u093D\u0950\u0958-\u0961\u0971-\u0980\u0985-\u098C\u098F\u0990\u0993-\u09A8\u09AA-\u09B0\u09B2\u09B6-\u09B9\u09BD\u09CE\u09DC\u09DD\u09DF-\u09E1\u09F0\u09F1\u09FC\u0A05-\u0A0A\u0A0F\u0A10\u0A13-\u0A28\u0A2A-\u0A30\u0A32\u0A33\u0A35\u0A36\u0A38\u0A39\u0A59-\u0A5C\u0A5E\u0A72-\u0A74\u0A85-\u0A8D\u0A8F-\u0A91\u0A93-\u0AA8\u0AAA-\u0AB0\u0AB2\u0AB3\u0AB5-\u0AB9\u0ABD\u0AD0\u0AE0\u0AE1\u0AF9\u0B05-\u0B0C\u0B0F\u0B10\u0B13-\u0B28\u0B2A-\u0B30\u0B32\u0B33\u0B35-\u0B39\u0B3D\u0B5C\u0B5D\u0B5F-\u0B61\u0B71\u0B83\u0B85-\u0B8A\u0B8E-\u0B90\u0B92-\u0B95\u0B99\u0B9A\u0B9C\u0B9E\u0B9F\u0BA3\u0BA4\u0BA8-\u0BAA\u0BAE-\u0BB9\u0BD0\u0C05-\u0C0C\u0C0E-\u0C10\u0C12-\u0C28\u0C2A-\u0C39\u0C3D\u0C58-\u0C5A\u0C60\u0C61\u0C80\u0C85-\u0C8C\u0C8E-\u0C90\u0C92-\u0CA8\u0CAA-\u0CB3\u0CB5-\u0CB9\u0CBD\u0CDE\u0CE0\u0CE1\u0CF1\u0CF2\u0D05-\u0D0C\u0D0E-\u0D10\u0D12-\u0D3A\u0D3D\u0D4E\u0D54-\u0D56\u0D5F-\u0D61\u0D7A-\u0D7F\u0D85-\u0D96\u0D9A-\u0DB1\u0DB3-\u0DBB\u0DBD\u0DC0-\u0DC6\u0E01-\u0E30\u0E32\u0E33\u0E40-\u0E46\u0E81\u0E82\u0E84\u0E87\u0E88\u0E8A\u0E8D\u0E94-\u0E97\u0E99-\u0E9F\u0EA1-\u0EA3\u0EA5\u0EA7\u0EAA\u0EAB\u0EAD-\u0EB0\u0EB2\u0EB3\u0EBD\u0EC0-\u0EC4\u0EC6\u0EDC-\u0EDF\u0F00\u0F40-\u0F47\u0F49-\u0F6C\u0F88-\u0F8C\u1000-\u102A\u103F\u1050-\u1055\u105A-\u105D\u1061\u1065\u1066\u106E-\u1070\u1075-\u1081\u108E\u10A0-\u10C5\u10C7\u10CD\u10D0-\u10FA\u10FC-\u1248\u124A-\u124D\u1250-\u1256\u1258\u125A-\u125D\u1260-\u1288\u128A-\u128D\u1290-\u12B0\u12B2-\u12B5\u12B8-\u12BE\u12C0\u12C2-\u12C5\u12C8-\u12D6\u12D8-\u1310\u1312-\u1315\u1318-\u135A\u1380-\u138F\u13A0-\u13F5\u13F8-\u13FD\u1401-\u166C\u166F-\u167F\u1681-\u169A\u16A0-\u16EA\u16F1-\u16F8\u1700-\u170C\u170E-\u1711\u1720-\u1731\u1740-\u1751\u1760-\u176C\u176E-\u1770\u1780-\u17B3\u17D7\u17DC\u1820-\u1878\u1880-\u1884\u1887-\u18A8\u18AA\u18B0-\u18F5\u1900-\u191E\u1950-\u196D\u1970-\u1974\u1980-\u19AB\u19B0-\u19C9\u1A00-\u1A16\u1A20-\u1A54\u1AA7\u1B05-\u1B33\u1B45-\u1B4B\u1B83-\u1BA0\u1BAE\u1BAF\u1BBA-\u1BE5\u1C00-\u1C23\u1C4D-\u1C4F\u1C5A-\u1C7D\u1C80-\u1C88\u1C90-\u1CBA\u1CBD-\u1CBF\u1CE9-\u1CEC\u1CEE-\u1CF1\u1CF5\u1CF6\u1D00-\u1DBF\u1E00-\u1F15\u1F18-\u1F1D\u1F20-\u1F45\u1F48-\u1F4D\u1F50-\u1F57\u1F59\u1F5B\u1F5D\u1F5F-\u1F7D\u1F80-\u1FB4\u1FB6-\u1FBC\u1FBE\u1FC2-\u1FC4\u1FC6-\u1FCC\u1FD0-\u1FD3\u1FD6-\u1FDB\u1FE0-\u1FEC\u1FF2-\u1FF4\u1FF6-\u1FFC\u2071\u207F\u2090-\u209C\u2102\u2107\u210A-\u2113\u2115\u2119-\u211D\u2124\u2126\u2128\u212A-\u212D\u212F-\u2139\u213C-\u213F\u2145-\u2149\u214E\u2183\u2184\u2C00-\u2C2E\u2C30-\u2C5E\u2C60-\u2CE4\u2CEB-\u2CEE\u2CF2\u2CF3\u2D00-\u2D25\u2D27\u2D2D\u2D30-\u2D67\u2D6F\u2D80-\u2D96\u2DA0-\u2DA6\u2DA8-\u2DAE\u2DB0-\u2DB6\u2DB8-\u2DBE\u2DC0-\u2DC6\u2DC8-\u2DCE\u2DD0-\u2DD6\u2DD8-\u2DDE\u2E2F\u3005\u3006\u3031-\u3035\u303B\u303C\u3041-\u3096\u309D-\u309F\u30A1-\u30FA\u30FC-\u30FF\u3105-\u312F\u3131-\u318E\u31A0-\u31BA\u31F0-\u31FF\u3400-\u4DB5\u4E00-\u9FEF\uA000-\uA48C\uA4D0-\uA4FD\uA500-\uA60C\uA610-\uA61F\uA62A\uA62B\uA640-\uA66E\uA67F-\uA69D\uA6A0-\uA6E5\uA717-\uA71F\uA722-\uA788\uA78B-\uA7B9\uA7F7-\uA801\uA803-\uA805\uA807-\uA80A\uA80C-\uA822\uA840-\uA873\uA882-\uA8B3\uA8F2-\uA8F7\uA8FB\uA8FD\uA8FE\uA90A-\uA925\uA930-\uA946\uA960-\uA97C\uA984-\uA9B2\uA9CF\uA9E0-\uA9E4\uA9E6-\uA9EF\uA9FA-\uA9FE\uAA00-\uAA28\uAA40-\uAA42\uAA44-\uAA4B\uAA60-\uAA76\uAA7A\uAA7E-\uAAAF\uAAB1\uAAB5\uAAB6\uAAB9-\uAABD\uAAC0\uAAC2\uAADB-\uAADD\uAAE0-\uAAEA\uAAF2-\uAAF4\uAB01-\uAB06\uAB09-\uAB0E\uAB11-\uAB16\uAB20-\uAB26\uAB28-\uAB2E\uAB30-\uAB5A\uAB5C-\uAB65\uAB70-\uABE2\uAC00-\uD7A3\uD7B0-\uD7C6\uD7CB-\uD7FB\uF900-\uFA6D\uFA70-\uFAD9\uFB00-\uFB06\uFB13-\uFB17\uFB1D\uFB1F-\uFB28\uFB2A-\uFB36\uFB38-\uFB3C\uFB3E\uFB40\uFB41\uFB43\uFB44\uFB46-\uFBB1\uFBD3-\uFD3D\uFD50-\uFD8F\uFD92-\uFDC7\uFDF0-\uFDFB\uFE70-\uFE74\uFE76-\uFEFC\uFF21-\uFF3A\uFF41-\uFF5A\uFF66-\uFFBE\uFFC2-\uFFC7\uFFCA-\uFFCF\uFFD2-\uFFD7\uFFDA-\uFFDC', + 'astral': '\uD800[\uDC00-\uDC0B\uDC0D-\uDC26\uDC28-\uDC3A\uDC3C\uDC3D\uDC3F-\uDC4D\uDC50-\uDC5D\uDC80-\uDCFA\uDE80-\uDE9C\uDEA0-\uDED0\uDF00-\uDF1F\uDF2D-\uDF40\uDF42-\uDF49\uDF50-\uDF75\uDF80-\uDF9D\uDFA0-\uDFC3\uDFC8-\uDFCF]|\uD801[\uDC00-\uDC9D\uDCB0-\uDCD3\uDCD8-\uDCFB\uDD00-\uDD27\uDD30-\uDD63\uDE00-\uDF36\uDF40-\uDF55\uDF60-\uDF67]|\uD802[\uDC00-\uDC05\uDC08\uDC0A-\uDC35\uDC37\uDC38\uDC3C\uDC3F-\uDC55\uDC60-\uDC76\uDC80-\uDC9E\uDCE0-\uDCF2\uDCF4\uDCF5\uDD00-\uDD15\uDD20-\uDD39\uDD80-\uDDB7\uDDBE\uDDBF\uDE00\uDE10-\uDE13\uDE15-\uDE17\uDE19-\uDE35\uDE60-\uDE7C\uDE80-\uDE9C\uDEC0-\uDEC7\uDEC9-\uDEE4\uDF00-\uDF35\uDF40-\uDF55\uDF60-\uDF72\uDF80-\uDF91]|\uD803[\uDC00-\uDC48\uDC80-\uDCB2\uDCC0-\uDCF2\uDD00-\uDD23\uDF00-\uDF1C\uDF27\uDF30-\uDF45]|\uD804[\uDC03-\uDC37\uDC83-\uDCAF\uDCD0-\uDCE8\uDD03-\uDD26\uDD44\uDD50-\uDD72\uDD76\uDD83-\uDDB2\uDDC1-\uDDC4\uDDDA\uDDDC\uDE00-\uDE11\uDE13-\uDE2B\uDE80-\uDE86\uDE88\uDE8A-\uDE8D\uDE8F-\uDE9D\uDE9F-\uDEA8\uDEB0-\uDEDE\uDF05-\uDF0C\uDF0F\uDF10\uDF13-\uDF28\uDF2A-\uDF30\uDF32\uDF33\uDF35-\uDF39\uDF3D\uDF50\uDF5D-\uDF61]|\uD805[\uDC00-\uDC34\uDC47-\uDC4A\uDC80-\uDCAF\uDCC4\uDCC5\uDCC7\uDD80-\uDDAE\uDDD8-\uDDDB\uDE00-\uDE2F\uDE44\uDE80-\uDEAA\uDF00-\uDF1A]|\uD806[\uDC00-\uDC2B\uDCA0-\uDCDF\uDCFF\uDE00\uDE0B-\uDE32\uDE3A\uDE50\uDE5C-\uDE83\uDE86-\uDE89\uDE9D\uDEC0-\uDEF8]|\uD807[\uDC00-\uDC08\uDC0A-\uDC2E\uDC40\uDC72-\uDC8F\uDD00-\uDD06\uDD08\uDD09\uDD0B-\uDD30\uDD46\uDD60-\uDD65\uDD67\uDD68\uDD6A-\uDD89\uDD98\uDEE0-\uDEF2]|\uD808[\uDC00-\uDF99]|\uD809[\uDC80-\uDD43]|[\uD80C\uD81C-\uD820\uD840-\uD868\uD86A-\uD86C\uD86F-\uD872\uD874-\uD879][\uDC00-\uDFFF]|\uD80D[\uDC00-\uDC2E]|\uD811[\uDC00-\uDE46]|\uD81A[\uDC00-\uDE38\uDE40-\uDE5E\uDED0-\uDEED\uDF00-\uDF2F\uDF40-\uDF43\uDF63-\uDF77\uDF7D-\uDF8F]|\uD81B[\uDE40-\uDE7F\uDF00-\uDF44\uDF50\uDF93-\uDF9F\uDFE0\uDFE1]|\uD821[\uDC00-\uDFF1]|\uD822[\uDC00-\uDEF2]|\uD82C[\uDC00-\uDD1E\uDD70-\uDEFB]|\uD82F[\uDC00-\uDC6A\uDC70-\uDC7C\uDC80-\uDC88\uDC90-\uDC99]|\uD835[\uDC00-\uDC54\uDC56-\uDC9C\uDC9E\uDC9F\uDCA2\uDCA5\uDCA6\uDCA9-\uDCAC\uDCAE-\uDCB9\uDCBB\uDCBD-\uDCC3\uDCC5-\uDD05\uDD07-\uDD0A\uDD0D-\uDD14\uDD16-\uDD1C\uDD1E-\uDD39\uDD3B-\uDD3E\uDD40-\uDD44\uDD46\uDD4A-\uDD50\uDD52-\uDEA5\uDEA8-\uDEC0\uDEC2-\uDEDA\uDEDC-\uDEFA\uDEFC-\uDF14\uDF16-\uDF34\uDF36-\uDF4E\uDF50-\uDF6E\uDF70-\uDF88\uDF8A-\uDFA8\uDFAA-\uDFC2\uDFC4-\uDFCB]|\uD83A[\uDC00-\uDCC4\uDD00-\uDD43]|\uD83B[\uDE00-\uDE03\uDE05-\uDE1F\uDE21\uDE22\uDE24\uDE27\uDE29-\uDE32\uDE34-\uDE37\uDE39\uDE3B\uDE42\uDE47\uDE49\uDE4B\uDE4D-\uDE4F\uDE51\uDE52\uDE54\uDE57\uDE59\uDE5B\uDE5D\uDE5F\uDE61\uDE62\uDE64\uDE67-\uDE6A\uDE6C-\uDE72\uDE74-\uDE77\uDE79-\uDE7C\uDE7E\uDE80-\uDE89\uDE8B-\uDE9B\uDEA1-\uDEA3\uDEA5-\uDEA9\uDEAB-\uDEBB]|\uD869[\uDC00-\uDED6\uDF00-\uDFFF]|\uD86D[\uDC00-\uDF34\uDF40-\uDFFF]|\uD86E[\uDC00-\uDC1D\uDC20-\uDFFF]|\uD873[\uDC00-\uDEA1\uDEB0-\uDFFF]|\uD87A[\uDC00-\uDFE0]|\uD87E[\uDC00-\uDE1D]' + }, + { + 'name': 'LC', + 'alias': 'Cased_Letter', + 'bmp': 'A-Za-z\xB5\xC0-\xD6\xD8-\xF6\xF8-\u01BA\u01BC-\u01BF\u01C4-\u0293\u0295-\u02AF\u0370-\u0373\u0376\u0377\u037B-\u037D\u037F\u0386\u0388-\u038A\u038C\u038E-\u03A1\u03A3-\u03F5\u03F7-\u0481\u048A-\u052F\u0531-\u0556\u0560-\u0588\u10A0-\u10C5\u10C7\u10CD\u10D0-\u10FA\u10FD-\u10FF\u13A0-\u13F5\u13F8-\u13FD\u1C80-\u1C88\u1C90-\u1CBA\u1CBD-\u1CBF\u1D00-\u1D2B\u1D6B-\u1D77\u1D79-\u1D9A\u1E00-\u1F15\u1F18-\u1F1D\u1F20-\u1F45\u1F48-\u1F4D\u1F50-\u1F57\u1F59\u1F5B\u1F5D\u1F5F-\u1F7D\u1F80-\u1FB4\u1FB6-\u1FBC\u1FBE\u1FC2-\u1FC4\u1FC6-\u1FCC\u1FD0-\u1FD3\u1FD6-\u1FDB\u1FE0-\u1FEC\u1FF2-\u1FF4\u1FF6-\u1FFC\u2102\u2107\u210A-\u2113\u2115\u2119-\u211D\u2124\u2126\u2128\u212A-\u212D\u212F-\u2134\u2139\u213C-\u213F\u2145-\u2149\u214E\u2183\u2184\u2C00-\u2C2E\u2C30-\u2C5E\u2C60-\u2C7B\u2C7E-\u2CE4\u2CEB-\u2CEE\u2CF2\u2CF3\u2D00-\u2D25\u2D27\u2D2D\uA640-\uA66D\uA680-\uA69B\uA722-\uA76F\uA771-\uA787\uA78B-\uA78E\uA790-\uA7B9\uA7FA\uAB30-\uAB5A\uAB60-\uAB65\uAB70-\uABBF\uFB00-\uFB06\uFB13-\uFB17\uFF21-\uFF3A\uFF41-\uFF5A', + 'astral': '\uD801[\uDC00-\uDC4F\uDCB0-\uDCD3\uDCD8-\uDCFB]|\uD803[\uDC80-\uDCB2\uDCC0-\uDCF2]|\uD806[\uDCA0-\uDCDF]|\uD81B[\uDE40-\uDE7F]|\uD835[\uDC00-\uDC54\uDC56-\uDC9C\uDC9E\uDC9F\uDCA2\uDCA5\uDCA6\uDCA9-\uDCAC\uDCAE-\uDCB9\uDCBB\uDCBD-\uDCC3\uDCC5-\uDD05\uDD07-\uDD0A\uDD0D-\uDD14\uDD16-\uDD1C\uDD1E-\uDD39\uDD3B-\uDD3E\uDD40-\uDD44\uDD46\uDD4A-\uDD50\uDD52-\uDEA5\uDEA8-\uDEC0\uDEC2-\uDEDA\uDEDC-\uDEFA\uDEFC-\uDF14\uDF16-\uDF34\uDF36-\uDF4E\uDF50-\uDF6E\uDF70-\uDF88\uDF8A-\uDFA8\uDFAA-\uDFC2\uDFC4-\uDFCB]|\uD83A[\uDD00-\uDD43]' + }, + { + 'name': 'Ll', + 'alias': 'Lowercase_Letter', + 'bmp': 'a-z\xB5\xDF-\xF6\xF8-\xFF\u0101\u0103\u0105\u0107\u0109\u010B\u010D\u010F\u0111\u0113\u0115\u0117\u0119\u011B\u011D\u011F\u0121\u0123\u0125\u0127\u0129\u012B\u012D\u012F\u0131\u0133\u0135\u0137\u0138\u013A\u013C\u013E\u0140\u0142\u0144\u0146\u0148\u0149\u014B\u014D\u014F\u0151\u0153\u0155\u0157\u0159\u015B\u015D\u015F\u0161\u0163\u0165\u0167\u0169\u016B\u016D\u016F\u0171\u0173\u0175\u0177\u017A\u017C\u017E-\u0180\u0183\u0185\u0188\u018C\u018D\u0192\u0195\u0199-\u019B\u019E\u01A1\u01A3\u01A5\u01A8\u01AA\u01AB\u01AD\u01B0\u01B4\u01B6\u01B9\u01BA\u01BD-\u01BF\u01C6\u01C9\u01CC\u01CE\u01D0\u01D2\u01D4\u01D6\u01D8\u01DA\u01DC\u01DD\u01DF\u01E1\u01E3\u01E5\u01E7\u01E9\u01EB\u01ED\u01EF\u01F0\u01F3\u01F5\u01F9\u01FB\u01FD\u01FF\u0201\u0203\u0205\u0207\u0209\u020B\u020D\u020F\u0211\u0213\u0215\u0217\u0219\u021B\u021D\u021F\u0221\u0223\u0225\u0227\u0229\u022B\u022D\u022F\u0231\u0233-\u0239\u023C\u023F\u0240\u0242\u0247\u0249\u024B\u024D\u024F-\u0293\u0295-\u02AF\u0371\u0373\u0377\u037B-\u037D\u0390\u03AC-\u03CE\u03D0\u03D1\u03D5-\u03D7\u03D9\u03DB\u03DD\u03DF\u03E1\u03E3\u03E5\u03E7\u03E9\u03EB\u03ED\u03EF-\u03F3\u03F5\u03F8\u03FB\u03FC\u0430-\u045F\u0461\u0463\u0465\u0467\u0469\u046B\u046D\u046F\u0471\u0473\u0475\u0477\u0479\u047B\u047D\u047F\u0481\u048B\u048D\u048F\u0491\u0493\u0495\u0497\u0499\u049B\u049D\u049F\u04A1\u04A3\u04A5\u04A7\u04A9\u04AB\u04AD\u04AF\u04B1\u04B3\u04B5\u04B7\u04B9\u04BB\u04BD\u04BF\u04C2\u04C4\u04C6\u04C8\u04CA\u04CC\u04CE\u04CF\u04D1\u04D3\u04D5\u04D7\u04D9\u04DB\u04DD\u04DF\u04E1\u04E3\u04E5\u04E7\u04E9\u04EB\u04ED\u04EF\u04F1\u04F3\u04F5\u04F7\u04F9\u04FB\u04FD\u04FF\u0501\u0503\u0505\u0507\u0509\u050B\u050D\u050F\u0511\u0513\u0515\u0517\u0519\u051B\u051D\u051F\u0521\u0523\u0525\u0527\u0529\u052B\u052D\u052F\u0560-\u0588\u10D0-\u10FA\u10FD-\u10FF\u13F8-\u13FD\u1C80-\u1C88\u1D00-\u1D2B\u1D6B-\u1D77\u1D79-\u1D9A\u1E01\u1E03\u1E05\u1E07\u1E09\u1E0B\u1E0D\u1E0F\u1E11\u1E13\u1E15\u1E17\u1E19\u1E1B\u1E1D\u1E1F\u1E21\u1E23\u1E25\u1E27\u1E29\u1E2B\u1E2D\u1E2F\u1E31\u1E33\u1E35\u1E37\u1E39\u1E3B\u1E3D\u1E3F\u1E41\u1E43\u1E45\u1E47\u1E49\u1E4B\u1E4D\u1E4F\u1E51\u1E53\u1E55\u1E57\u1E59\u1E5B\u1E5D\u1E5F\u1E61\u1E63\u1E65\u1E67\u1E69\u1E6B\u1E6D\u1E6F\u1E71\u1E73\u1E75\u1E77\u1E79\u1E7B\u1E7D\u1E7F\u1E81\u1E83\u1E85\u1E87\u1E89\u1E8B\u1E8D\u1E8F\u1E91\u1E93\u1E95-\u1E9D\u1E9F\u1EA1\u1EA3\u1EA5\u1EA7\u1EA9\u1EAB\u1EAD\u1EAF\u1EB1\u1EB3\u1EB5\u1EB7\u1EB9\u1EBB\u1EBD\u1EBF\u1EC1\u1EC3\u1EC5\u1EC7\u1EC9\u1ECB\u1ECD\u1ECF\u1ED1\u1ED3\u1ED5\u1ED7\u1ED9\u1EDB\u1EDD\u1EDF\u1EE1\u1EE3\u1EE5\u1EE7\u1EE9\u1EEB\u1EED\u1EEF\u1EF1\u1EF3\u1EF5\u1EF7\u1EF9\u1EFB\u1EFD\u1EFF-\u1F07\u1F10-\u1F15\u1F20-\u1F27\u1F30-\u1F37\u1F40-\u1F45\u1F50-\u1F57\u1F60-\u1F67\u1F70-\u1F7D\u1F80-\u1F87\u1F90-\u1F97\u1FA0-\u1FA7\u1FB0-\u1FB4\u1FB6\u1FB7\u1FBE\u1FC2-\u1FC4\u1FC6\u1FC7\u1FD0-\u1FD3\u1FD6\u1FD7\u1FE0-\u1FE7\u1FF2-\u1FF4\u1FF6\u1FF7\u210A\u210E\u210F\u2113\u212F\u2134\u2139\u213C\u213D\u2146-\u2149\u214E\u2184\u2C30-\u2C5E\u2C61\u2C65\u2C66\u2C68\u2C6A\u2C6C\u2C71\u2C73\u2C74\u2C76-\u2C7B\u2C81\u2C83\u2C85\u2C87\u2C89\u2C8B\u2C8D\u2C8F\u2C91\u2C93\u2C95\u2C97\u2C99\u2C9B\u2C9D\u2C9F\u2CA1\u2CA3\u2CA5\u2CA7\u2CA9\u2CAB\u2CAD\u2CAF\u2CB1\u2CB3\u2CB5\u2CB7\u2CB9\u2CBB\u2CBD\u2CBF\u2CC1\u2CC3\u2CC5\u2CC7\u2CC9\u2CCB\u2CCD\u2CCF\u2CD1\u2CD3\u2CD5\u2CD7\u2CD9\u2CDB\u2CDD\u2CDF\u2CE1\u2CE3\u2CE4\u2CEC\u2CEE\u2CF3\u2D00-\u2D25\u2D27\u2D2D\uA641\uA643\uA645\uA647\uA649\uA64B\uA64D\uA64F\uA651\uA653\uA655\uA657\uA659\uA65B\uA65D\uA65F\uA661\uA663\uA665\uA667\uA669\uA66B\uA66D\uA681\uA683\uA685\uA687\uA689\uA68B\uA68D\uA68F\uA691\uA693\uA695\uA697\uA699\uA69B\uA723\uA725\uA727\uA729\uA72B\uA72D\uA72F-\uA731\uA733\uA735\uA737\uA739\uA73B\uA73D\uA73F\uA741\uA743\uA745\uA747\uA749\uA74B\uA74D\uA74F\uA751\uA753\uA755\uA757\uA759\uA75B\uA75D\uA75F\uA761\uA763\uA765\uA767\uA769\uA76B\uA76D\uA76F\uA771-\uA778\uA77A\uA77C\uA77F\uA781\uA783\uA785\uA787\uA78C\uA78E\uA791\uA793-\uA795\uA797\uA799\uA79B\uA79D\uA79F\uA7A1\uA7A3\uA7A5\uA7A7\uA7A9\uA7AF\uA7B5\uA7B7\uA7B9\uA7FA\uAB30-\uAB5A\uAB60-\uAB65\uAB70-\uABBF\uFB00-\uFB06\uFB13-\uFB17\uFF41-\uFF5A', + 'astral': '\uD801[\uDC28-\uDC4F\uDCD8-\uDCFB]|\uD803[\uDCC0-\uDCF2]|\uD806[\uDCC0-\uDCDF]|\uD81B[\uDE60-\uDE7F]|\uD835[\uDC1A-\uDC33\uDC4E-\uDC54\uDC56-\uDC67\uDC82-\uDC9B\uDCB6-\uDCB9\uDCBB\uDCBD-\uDCC3\uDCC5-\uDCCF\uDCEA-\uDD03\uDD1E-\uDD37\uDD52-\uDD6B\uDD86-\uDD9F\uDDBA-\uDDD3\uDDEE-\uDE07\uDE22-\uDE3B\uDE56-\uDE6F\uDE8A-\uDEA5\uDEC2-\uDEDA\uDEDC-\uDEE1\uDEFC-\uDF14\uDF16-\uDF1B\uDF36-\uDF4E\uDF50-\uDF55\uDF70-\uDF88\uDF8A-\uDF8F\uDFAA-\uDFC2\uDFC4-\uDFC9\uDFCB]|\uD83A[\uDD22-\uDD43]' + }, + { + 'name': 'Lm', + 'alias': 'Modifier_Letter', + 'bmp': '\u02B0-\u02C1\u02C6-\u02D1\u02E0-\u02E4\u02EC\u02EE\u0374\u037A\u0559\u0640\u06E5\u06E6\u07F4\u07F5\u07FA\u081A\u0824\u0828\u0971\u0E46\u0EC6\u10FC\u17D7\u1843\u1AA7\u1C78-\u1C7D\u1D2C-\u1D6A\u1D78\u1D9B-\u1DBF\u2071\u207F\u2090-\u209C\u2C7C\u2C7D\u2D6F\u2E2F\u3005\u3031-\u3035\u303B\u309D\u309E\u30FC-\u30FE\uA015\uA4F8-\uA4FD\uA60C\uA67F\uA69C\uA69D\uA717-\uA71F\uA770\uA788\uA7F8\uA7F9\uA9CF\uA9E6\uAA70\uAADD\uAAF3\uAAF4\uAB5C-\uAB5F\uFF70\uFF9E\uFF9F', + 'astral': '\uD81A[\uDF40-\uDF43]|\uD81B[\uDF93-\uDF9F\uDFE0\uDFE1]' + }, + { + 'name': 'Lo', + 'alias': 'Other_Letter', + 'bmp': '\xAA\xBA\u01BB\u01C0-\u01C3\u0294\u05D0-\u05EA\u05EF-\u05F2\u0620-\u063F\u0641-\u064A\u066E\u066F\u0671-\u06D3\u06D5\u06EE\u06EF\u06FA-\u06FC\u06FF\u0710\u0712-\u072F\u074D-\u07A5\u07B1\u07CA-\u07EA\u0800-\u0815\u0840-\u0858\u0860-\u086A\u08A0-\u08B4\u08B6-\u08BD\u0904-\u0939\u093D\u0950\u0958-\u0961\u0972-\u0980\u0985-\u098C\u098F\u0990\u0993-\u09A8\u09AA-\u09B0\u09B2\u09B6-\u09B9\u09BD\u09CE\u09DC\u09DD\u09DF-\u09E1\u09F0\u09F1\u09FC\u0A05-\u0A0A\u0A0F\u0A10\u0A13-\u0A28\u0A2A-\u0A30\u0A32\u0A33\u0A35\u0A36\u0A38\u0A39\u0A59-\u0A5C\u0A5E\u0A72-\u0A74\u0A85-\u0A8D\u0A8F-\u0A91\u0A93-\u0AA8\u0AAA-\u0AB0\u0AB2\u0AB3\u0AB5-\u0AB9\u0ABD\u0AD0\u0AE0\u0AE1\u0AF9\u0B05-\u0B0C\u0B0F\u0B10\u0B13-\u0B28\u0B2A-\u0B30\u0B32\u0B33\u0B35-\u0B39\u0B3D\u0B5C\u0B5D\u0B5F-\u0B61\u0B71\u0B83\u0B85-\u0B8A\u0B8E-\u0B90\u0B92-\u0B95\u0B99\u0B9A\u0B9C\u0B9E\u0B9F\u0BA3\u0BA4\u0BA8-\u0BAA\u0BAE-\u0BB9\u0BD0\u0C05-\u0C0C\u0C0E-\u0C10\u0C12-\u0C28\u0C2A-\u0C39\u0C3D\u0C58-\u0C5A\u0C60\u0C61\u0C80\u0C85-\u0C8C\u0C8E-\u0C90\u0C92-\u0CA8\u0CAA-\u0CB3\u0CB5-\u0CB9\u0CBD\u0CDE\u0CE0\u0CE1\u0CF1\u0CF2\u0D05-\u0D0C\u0D0E-\u0D10\u0D12-\u0D3A\u0D3D\u0D4E\u0D54-\u0D56\u0D5F-\u0D61\u0D7A-\u0D7F\u0D85-\u0D96\u0D9A-\u0DB1\u0DB3-\u0DBB\u0DBD\u0DC0-\u0DC6\u0E01-\u0E30\u0E32\u0E33\u0E40-\u0E45\u0E81\u0E82\u0E84\u0E87\u0E88\u0E8A\u0E8D\u0E94-\u0E97\u0E99-\u0E9F\u0EA1-\u0EA3\u0EA5\u0EA7\u0EAA\u0EAB\u0EAD-\u0EB0\u0EB2\u0EB3\u0EBD\u0EC0-\u0EC4\u0EDC-\u0EDF\u0F00\u0F40-\u0F47\u0F49-\u0F6C\u0F88-\u0F8C\u1000-\u102A\u103F\u1050-\u1055\u105A-\u105D\u1061\u1065\u1066\u106E-\u1070\u1075-\u1081\u108E\u1100-\u1248\u124A-\u124D\u1250-\u1256\u1258\u125A-\u125D\u1260-\u1288\u128A-\u128D\u1290-\u12B0\u12B2-\u12B5\u12B8-\u12BE\u12C0\u12C2-\u12C5\u12C8-\u12D6\u12D8-\u1310\u1312-\u1315\u1318-\u135A\u1380-\u138F\u1401-\u166C\u166F-\u167F\u1681-\u169A\u16A0-\u16EA\u16F1-\u16F8\u1700-\u170C\u170E-\u1711\u1720-\u1731\u1740-\u1751\u1760-\u176C\u176E-\u1770\u1780-\u17B3\u17DC\u1820-\u1842\u1844-\u1878\u1880-\u1884\u1887-\u18A8\u18AA\u18B0-\u18F5\u1900-\u191E\u1950-\u196D\u1970-\u1974\u1980-\u19AB\u19B0-\u19C9\u1A00-\u1A16\u1A20-\u1A54\u1B05-\u1B33\u1B45-\u1B4B\u1B83-\u1BA0\u1BAE\u1BAF\u1BBA-\u1BE5\u1C00-\u1C23\u1C4D-\u1C4F\u1C5A-\u1C77\u1CE9-\u1CEC\u1CEE-\u1CF1\u1CF5\u1CF6\u2135-\u2138\u2D30-\u2D67\u2D80-\u2D96\u2DA0-\u2DA6\u2DA8-\u2DAE\u2DB0-\u2DB6\u2DB8-\u2DBE\u2DC0-\u2DC6\u2DC8-\u2DCE\u2DD0-\u2DD6\u2DD8-\u2DDE\u3006\u303C\u3041-\u3096\u309F\u30A1-\u30FA\u30FF\u3105-\u312F\u3131-\u318E\u31A0-\u31BA\u31F0-\u31FF\u3400-\u4DB5\u4E00-\u9FEF\uA000-\uA014\uA016-\uA48C\uA4D0-\uA4F7\uA500-\uA60B\uA610-\uA61F\uA62A\uA62B\uA66E\uA6A0-\uA6E5\uA78F\uA7F7\uA7FB-\uA801\uA803-\uA805\uA807-\uA80A\uA80C-\uA822\uA840-\uA873\uA882-\uA8B3\uA8F2-\uA8F7\uA8FB\uA8FD\uA8FE\uA90A-\uA925\uA930-\uA946\uA960-\uA97C\uA984-\uA9B2\uA9E0-\uA9E4\uA9E7-\uA9EF\uA9FA-\uA9FE\uAA00-\uAA28\uAA40-\uAA42\uAA44-\uAA4B\uAA60-\uAA6F\uAA71-\uAA76\uAA7A\uAA7E-\uAAAF\uAAB1\uAAB5\uAAB6\uAAB9-\uAABD\uAAC0\uAAC2\uAADB\uAADC\uAAE0-\uAAEA\uAAF2\uAB01-\uAB06\uAB09-\uAB0E\uAB11-\uAB16\uAB20-\uAB26\uAB28-\uAB2E\uABC0-\uABE2\uAC00-\uD7A3\uD7B0-\uD7C6\uD7CB-\uD7FB\uF900-\uFA6D\uFA70-\uFAD9\uFB1D\uFB1F-\uFB28\uFB2A-\uFB36\uFB38-\uFB3C\uFB3E\uFB40\uFB41\uFB43\uFB44\uFB46-\uFBB1\uFBD3-\uFD3D\uFD50-\uFD8F\uFD92-\uFDC7\uFDF0-\uFDFB\uFE70-\uFE74\uFE76-\uFEFC\uFF66-\uFF6F\uFF71-\uFF9D\uFFA0-\uFFBE\uFFC2-\uFFC7\uFFCA-\uFFCF\uFFD2-\uFFD7\uFFDA-\uFFDC', + 'astral': '\uD800[\uDC00-\uDC0B\uDC0D-\uDC26\uDC28-\uDC3A\uDC3C\uDC3D\uDC3F-\uDC4D\uDC50-\uDC5D\uDC80-\uDCFA\uDE80-\uDE9C\uDEA0-\uDED0\uDF00-\uDF1F\uDF2D-\uDF40\uDF42-\uDF49\uDF50-\uDF75\uDF80-\uDF9D\uDFA0-\uDFC3\uDFC8-\uDFCF]|\uD801[\uDC50-\uDC9D\uDD00-\uDD27\uDD30-\uDD63\uDE00-\uDF36\uDF40-\uDF55\uDF60-\uDF67]|\uD802[\uDC00-\uDC05\uDC08\uDC0A-\uDC35\uDC37\uDC38\uDC3C\uDC3F-\uDC55\uDC60-\uDC76\uDC80-\uDC9E\uDCE0-\uDCF2\uDCF4\uDCF5\uDD00-\uDD15\uDD20-\uDD39\uDD80-\uDDB7\uDDBE\uDDBF\uDE00\uDE10-\uDE13\uDE15-\uDE17\uDE19-\uDE35\uDE60-\uDE7C\uDE80-\uDE9C\uDEC0-\uDEC7\uDEC9-\uDEE4\uDF00-\uDF35\uDF40-\uDF55\uDF60-\uDF72\uDF80-\uDF91]|\uD803[\uDC00-\uDC48\uDD00-\uDD23\uDF00-\uDF1C\uDF27\uDF30-\uDF45]|\uD804[\uDC03-\uDC37\uDC83-\uDCAF\uDCD0-\uDCE8\uDD03-\uDD26\uDD44\uDD50-\uDD72\uDD76\uDD83-\uDDB2\uDDC1-\uDDC4\uDDDA\uDDDC\uDE00-\uDE11\uDE13-\uDE2B\uDE80-\uDE86\uDE88\uDE8A-\uDE8D\uDE8F-\uDE9D\uDE9F-\uDEA8\uDEB0-\uDEDE\uDF05-\uDF0C\uDF0F\uDF10\uDF13-\uDF28\uDF2A-\uDF30\uDF32\uDF33\uDF35-\uDF39\uDF3D\uDF50\uDF5D-\uDF61]|\uD805[\uDC00-\uDC34\uDC47-\uDC4A\uDC80-\uDCAF\uDCC4\uDCC5\uDCC7\uDD80-\uDDAE\uDDD8-\uDDDB\uDE00-\uDE2F\uDE44\uDE80-\uDEAA\uDF00-\uDF1A]|\uD806[\uDC00-\uDC2B\uDCFF\uDE00\uDE0B-\uDE32\uDE3A\uDE50\uDE5C-\uDE83\uDE86-\uDE89\uDE9D\uDEC0-\uDEF8]|\uD807[\uDC00-\uDC08\uDC0A-\uDC2E\uDC40\uDC72-\uDC8F\uDD00-\uDD06\uDD08\uDD09\uDD0B-\uDD30\uDD46\uDD60-\uDD65\uDD67\uDD68\uDD6A-\uDD89\uDD98\uDEE0-\uDEF2]|\uD808[\uDC00-\uDF99]|\uD809[\uDC80-\uDD43]|[\uD80C\uD81C-\uD820\uD840-\uD868\uD86A-\uD86C\uD86F-\uD872\uD874-\uD879][\uDC00-\uDFFF]|\uD80D[\uDC00-\uDC2E]|\uD811[\uDC00-\uDE46]|\uD81A[\uDC00-\uDE38\uDE40-\uDE5E\uDED0-\uDEED\uDF00-\uDF2F\uDF63-\uDF77\uDF7D-\uDF8F]|\uD81B[\uDF00-\uDF44\uDF50]|\uD821[\uDC00-\uDFF1]|\uD822[\uDC00-\uDEF2]|\uD82C[\uDC00-\uDD1E\uDD70-\uDEFB]|\uD82F[\uDC00-\uDC6A\uDC70-\uDC7C\uDC80-\uDC88\uDC90-\uDC99]|\uD83A[\uDC00-\uDCC4]|\uD83B[\uDE00-\uDE03\uDE05-\uDE1F\uDE21\uDE22\uDE24\uDE27\uDE29-\uDE32\uDE34-\uDE37\uDE39\uDE3B\uDE42\uDE47\uDE49\uDE4B\uDE4D-\uDE4F\uDE51\uDE52\uDE54\uDE57\uDE59\uDE5B\uDE5D\uDE5F\uDE61\uDE62\uDE64\uDE67-\uDE6A\uDE6C-\uDE72\uDE74-\uDE77\uDE79-\uDE7C\uDE7E\uDE80-\uDE89\uDE8B-\uDE9B\uDEA1-\uDEA3\uDEA5-\uDEA9\uDEAB-\uDEBB]|\uD869[\uDC00-\uDED6\uDF00-\uDFFF]|\uD86D[\uDC00-\uDF34\uDF40-\uDFFF]|\uD86E[\uDC00-\uDC1D\uDC20-\uDFFF]|\uD873[\uDC00-\uDEA1\uDEB0-\uDFFF]|\uD87A[\uDC00-\uDFE0]|\uD87E[\uDC00-\uDE1D]' + }, + { + 'name': 'Lt', + 'alias': 'Titlecase_Letter', + 'bmp': '\u01C5\u01C8\u01CB\u01F2\u1F88-\u1F8F\u1F98-\u1F9F\u1FA8-\u1FAF\u1FBC\u1FCC\u1FFC' + }, + { + 'name': 'Lu', + 'alias': 'Uppercase_Letter', + 'bmp': 'A-Z\xC0-\xD6\xD8-\xDE\u0100\u0102\u0104\u0106\u0108\u010A\u010C\u010E\u0110\u0112\u0114\u0116\u0118\u011A\u011C\u011E\u0120\u0122\u0124\u0126\u0128\u012A\u012C\u012E\u0130\u0132\u0134\u0136\u0139\u013B\u013D\u013F\u0141\u0143\u0145\u0147\u014A\u014C\u014E\u0150\u0152\u0154\u0156\u0158\u015A\u015C\u015E\u0160\u0162\u0164\u0166\u0168\u016A\u016C\u016E\u0170\u0172\u0174\u0176\u0178\u0179\u017B\u017D\u0181\u0182\u0184\u0186\u0187\u0189-\u018B\u018E-\u0191\u0193\u0194\u0196-\u0198\u019C\u019D\u019F\u01A0\u01A2\u01A4\u01A6\u01A7\u01A9\u01AC\u01AE\u01AF\u01B1-\u01B3\u01B5\u01B7\u01B8\u01BC\u01C4\u01C7\u01CA\u01CD\u01CF\u01D1\u01D3\u01D5\u01D7\u01D9\u01DB\u01DE\u01E0\u01E2\u01E4\u01E6\u01E8\u01EA\u01EC\u01EE\u01F1\u01F4\u01F6-\u01F8\u01FA\u01FC\u01FE\u0200\u0202\u0204\u0206\u0208\u020A\u020C\u020E\u0210\u0212\u0214\u0216\u0218\u021A\u021C\u021E\u0220\u0222\u0224\u0226\u0228\u022A\u022C\u022E\u0230\u0232\u023A\u023B\u023D\u023E\u0241\u0243-\u0246\u0248\u024A\u024C\u024E\u0370\u0372\u0376\u037F\u0386\u0388-\u038A\u038C\u038E\u038F\u0391-\u03A1\u03A3-\u03AB\u03CF\u03D2-\u03D4\u03D8\u03DA\u03DC\u03DE\u03E0\u03E2\u03E4\u03E6\u03E8\u03EA\u03EC\u03EE\u03F4\u03F7\u03F9\u03FA\u03FD-\u042F\u0460\u0462\u0464\u0466\u0468\u046A\u046C\u046E\u0470\u0472\u0474\u0476\u0478\u047A\u047C\u047E\u0480\u048A\u048C\u048E\u0490\u0492\u0494\u0496\u0498\u049A\u049C\u049E\u04A0\u04A2\u04A4\u04A6\u04A8\u04AA\u04AC\u04AE\u04B0\u04B2\u04B4\u04B6\u04B8\u04BA\u04BC\u04BE\u04C0\u04C1\u04C3\u04C5\u04C7\u04C9\u04CB\u04CD\u04D0\u04D2\u04D4\u04D6\u04D8\u04DA\u04DC\u04DE\u04E0\u04E2\u04E4\u04E6\u04E8\u04EA\u04EC\u04EE\u04F0\u04F2\u04F4\u04F6\u04F8\u04FA\u04FC\u04FE\u0500\u0502\u0504\u0506\u0508\u050A\u050C\u050E\u0510\u0512\u0514\u0516\u0518\u051A\u051C\u051E\u0520\u0522\u0524\u0526\u0528\u052A\u052C\u052E\u0531-\u0556\u10A0-\u10C5\u10C7\u10CD\u13A0-\u13F5\u1C90-\u1CBA\u1CBD-\u1CBF\u1E00\u1E02\u1E04\u1E06\u1E08\u1E0A\u1E0C\u1E0E\u1E10\u1E12\u1E14\u1E16\u1E18\u1E1A\u1E1C\u1E1E\u1E20\u1E22\u1E24\u1E26\u1E28\u1E2A\u1E2C\u1E2E\u1E30\u1E32\u1E34\u1E36\u1E38\u1E3A\u1E3C\u1E3E\u1E40\u1E42\u1E44\u1E46\u1E48\u1E4A\u1E4C\u1E4E\u1E50\u1E52\u1E54\u1E56\u1E58\u1E5A\u1E5C\u1E5E\u1E60\u1E62\u1E64\u1E66\u1E68\u1E6A\u1E6C\u1E6E\u1E70\u1E72\u1E74\u1E76\u1E78\u1E7A\u1E7C\u1E7E\u1E80\u1E82\u1E84\u1E86\u1E88\u1E8A\u1E8C\u1E8E\u1E90\u1E92\u1E94\u1E9E\u1EA0\u1EA2\u1EA4\u1EA6\u1EA8\u1EAA\u1EAC\u1EAE\u1EB0\u1EB2\u1EB4\u1EB6\u1EB8\u1EBA\u1EBC\u1EBE\u1EC0\u1EC2\u1EC4\u1EC6\u1EC8\u1ECA\u1ECC\u1ECE\u1ED0\u1ED2\u1ED4\u1ED6\u1ED8\u1EDA\u1EDC\u1EDE\u1EE0\u1EE2\u1EE4\u1EE6\u1EE8\u1EEA\u1EEC\u1EEE\u1EF0\u1EF2\u1EF4\u1EF6\u1EF8\u1EFA\u1EFC\u1EFE\u1F08-\u1F0F\u1F18-\u1F1D\u1F28-\u1F2F\u1F38-\u1F3F\u1F48-\u1F4D\u1F59\u1F5B\u1F5D\u1F5F\u1F68-\u1F6F\u1FB8-\u1FBB\u1FC8-\u1FCB\u1FD8-\u1FDB\u1FE8-\u1FEC\u1FF8-\u1FFB\u2102\u2107\u210B-\u210D\u2110-\u2112\u2115\u2119-\u211D\u2124\u2126\u2128\u212A-\u212D\u2130-\u2133\u213E\u213F\u2145\u2183\u2C00-\u2C2E\u2C60\u2C62-\u2C64\u2C67\u2C69\u2C6B\u2C6D-\u2C70\u2C72\u2C75\u2C7E-\u2C80\u2C82\u2C84\u2C86\u2C88\u2C8A\u2C8C\u2C8E\u2C90\u2C92\u2C94\u2C96\u2C98\u2C9A\u2C9C\u2C9E\u2CA0\u2CA2\u2CA4\u2CA6\u2CA8\u2CAA\u2CAC\u2CAE\u2CB0\u2CB2\u2CB4\u2CB6\u2CB8\u2CBA\u2CBC\u2CBE\u2CC0\u2CC2\u2CC4\u2CC6\u2CC8\u2CCA\u2CCC\u2CCE\u2CD0\u2CD2\u2CD4\u2CD6\u2CD8\u2CDA\u2CDC\u2CDE\u2CE0\u2CE2\u2CEB\u2CED\u2CF2\uA640\uA642\uA644\uA646\uA648\uA64A\uA64C\uA64E\uA650\uA652\uA654\uA656\uA658\uA65A\uA65C\uA65E\uA660\uA662\uA664\uA666\uA668\uA66A\uA66C\uA680\uA682\uA684\uA686\uA688\uA68A\uA68C\uA68E\uA690\uA692\uA694\uA696\uA698\uA69A\uA722\uA724\uA726\uA728\uA72A\uA72C\uA72E\uA732\uA734\uA736\uA738\uA73A\uA73C\uA73E\uA740\uA742\uA744\uA746\uA748\uA74A\uA74C\uA74E\uA750\uA752\uA754\uA756\uA758\uA75A\uA75C\uA75E\uA760\uA762\uA764\uA766\uA768\uA76A\uA76C\uA76E\uA779\uA77B\uA77D\uA77E\uA780\uA782\uA784\uA786\uA78B\uA78D\uA790\uA792\uA796\uA798\uA79A\uA79C\uA79E\uA7A0\uA7A2\uA7A4\uA7A6\uA7A8\uA7AA-\uA7AE\uA7B0-\uA7B4\uA7B6\uA7B8\uFF21-\uFF3A', + 'astral': '\uD801[\uDC00-\uDC27\uDCB0-\uDCD3]|\uD803[\uDC80-\uDCB2]|\uD806[\uDCA0-\uDCBF]|\uD81B[\uDE40-\uDE5F]|\uD835[\uDC00-\uDC19\uDC34-\uDC4D\uDC68-\uDC81\uDC9C\uDC9E\uDC9F\uDCA2\uDCA5\uDCA6\uDCA9-\uDCAC\uDCAE-\uDCB5\uDCD0-\uDCE9\uDD04\uDD05\uDD07-\uDD0A\uDD0D-\uDD14\uDD16-\uDD1C\uDD38\uDD39\uDD3B-\uDD3E\uDD40-\uDD44\uDD46\uDD4A-\uDD50\uDD6C-\uDD85\uDDA0-\uDDB9\uDDD4-\uDDED\uDE08-\uDE21\uDE3C-\uDE55\uDE70-\uDE89\uDEA8-\uDEC0\uDEE2-\uDEFA\uDF1C-\uDF34\uDF56-\uDF6E\uDF90-\uDFA8\uDFCA]|\uD83A[\uDD00-\uDD21]' + }, + { + 'name': 'M', + 'alias': 'Mark', + 'bmp': '\u0300-\u036F\u0483-\u0489\u0591-\u05BD\u05BF\u05C1\u05C2\u05C4\u05C5\u05C7\u0610-\u061A\u064B-\u065F\u0670\u06D6-\u06DC\u06DF-\u06E4\u06E7\u06E8\u06EA-\u06ED\u0711\u0730-\u074A\u07A6-\u07B0\u07EB-\u07F3\u07FD\u0816-\u0819\u081B-\u0823\u0825-\u0827\u0829-\u082D\u0859-\u085B\u08D3-\u08E1\u08E3-\u0903\u093A-\u093C\u093E-\u094F\u0951-\u0957\u0962\u0963\u0981-\u0983\u09BC\u09BE-\u09C4\u09C7\u09C8\u09CB-\u09CD\u09D7\u09E2\u09E3\u09FE\u0A01-\u0A03\u0A3C\u0A3E-\u0A42\u0A47\u0A48\u0A4B-\u0A4D\u0A51\u0A70\u0A71\u0A75\u0A81-\u0A83\u0ABC\u0ABE-\u0AC5\u0AC7-\u0AC9\u0ACB-\u0ACD\u0AE2\u0AE3\u0AFA-\u0AFF\u0B01-\u0B03\u0B3C\u0B3E-\u0B44\u0B47\u0B48\u0B4B-\u0B4D\u0B56\u0B57\u0B62\u0B63\u0B82\u0BBE-\u0BC2\u0BC6-\u0BC8\u0BCA-\u0BCD\u0BD7\u0C00-\u0C04\u0C3E-\u0C44\u0C46-\u0C48\u0C4A-\u0C4D\u0C55\u0C56\u0C62\u0C63\u0C81-\u0C83\u0CBC\u0CBE-\u0CC4\u0CC6-\u0CC8\u0CCA-\u0CCD\u0CD5\u0CD6\u0CE2\u0CE3\u0D00-\u0D03\u0D3B\u0D3C\u0D3E-\u0D44\u0D46-\u0D48\u0D4A-\u0D4D\u0D57\u0D62\u0D63\u0D82\u0D83\u0DCA\u0DCF-\u0DD4\u0DD6\u0DD8-\u0DDF\u0DF2\u0DF3\u0E31\u0E34-\u0E3A\u0E47-\u0E4E\u0EB1\u0EB4-\u0EB9\u0EBB\u0EBC\u0EC8-\u0ECD\u0F18\u0F19\u0F35\u0F37\u0F39\u0F3E\u0F3F\u0F71-\u0F84\u0F86\u0F87\u0F8D-\u0F97\u0F99-\u0FBC\u0FC6\u102B-\u103E\u1056-\u1059\u105E-\u1060\u1062-\u1064\u1067-\u106D\u1071-\u1074\u1082-\u108D\u108F\u109A-\u109D\u135D-\u135F\u1712-\u1714\u1732-\u1734\u1752\u1753\u1772\u1773\u17B4-\u17D3\u17DD\u180B-\u180D\u1885\u1886\u18A9\u1920-\u192B\u1930-\u193B\u1A17-\u1A1B\u1A55-\u1A5E\u1A60-\u1A7C\u1A7F\u1AB0-\u1ABE\u1B00-\u1B04\u1B34-\u1B44\u1B6B-\u1B73\u1B80-\u1B82\u1BA1-\u1BAD\u1BE6-\u1BF3\u1C24-\u1C37\u1CD0-\u1CD2\u1CD4-\u1CE8\u1CED\u1CF2-\u1CF4\u1CF7-\u1CF9\u1DC0-\u1DF9\u1DFB-\u1DFF\u20D0-\u20F0\u2CEF-\u2CF1\u2D7F\u2DE0-\u2DFF\u302A-\u302F\u3099\u309A\uA66F-\uA672\uA674-\uA67D\uA69E\uA69F\uA6F0\uA6F1\uA802\uA806\uA80B\uA823-\uA827\uA880\uA881\uA8B4-\uA8C5\uA8E0-\uA8F1\uA8FF\uA926-\uA92D\uA947-\uA953\uA980-\uA983\uA9B3-\uA9C0\uA9E5\uAA29-\uAA36\uAA43\uAA4C\uAA4D\uAA7B-\uAA7D\uAAB0\uAAB2-\uAAB4\uAAB7\uAAB8\uAABE\uAABF\uAAC1\uAAEB-\uAAEF\uAAF5\uAAF6\uABE3-\uABEA\uABEC\uABED\uFB1E\uFE00-\uFE0F\uFE20-\uFE2F', + 'astral': '\uD800[\uDDFD\uDEE0\uDF76-\uDF7A]|\uD802[\uDE01-\uDE03\uDE05\uDE06\uDE0C-\uDE0F\uDE38-\uDE3A\uDE3F\uDEE5\uDEE6]|\uD803[\uDD24-\uDD27\uDF46-\uDF50]|\uD804[\uDC00-\uDC02\uDC38-\uDC46\uDC7F-\uDC82\uDCB0-\uDCBA\uDD00-\uDD02\uDD27-\uDD34\uDD45\uDD46\uDD73\uDD80-\uDD82\uDDB3-\uDDC0\uDDC9-\uDDCC\uDE2C-\uDE37\uDE3E\uDEDF-\uDEEA\uDF00-\uDF03\uDF3B\uDF3C\uDF3E-\uDF44\uDF47\uDF48\uDF4B-\uDF4D\uDF57\uDF62\uDF63\uDF66-\uDF6C\uDF70-\uDF74]|\uD805[\uDC35-\uDC46\uDC5E\uDCB0-\uDCC3\uDDAF-\uDDB5\uDDB8-\uDDC0\uDDDC\uDDDD\uDE30-\uDE40\uDEAB-\uDEB7\uDF1D-\uDF2B]|\uD806[\uDC2C-\uDC3A\uDE01-\uDE0A\uDE33-\uDE39\uDE3B-\uDE3E\uDE47\uDE51-\uDE5B\uDE8A-\uDE99]|\uD807[\uDC2F-\uDC36\uDC38-\uDC3F\uDC92-\uDCA7\uDCA9-\uDCB6\uDD31-\uDD36\uDD3A\uDD3C\uDD3D\uDD3F-\uDD45\uDD47\uDD8A-\uDD8E\uDD90\uDD91\uDD93-\uDD97\uDEF3-\uDEF6]|\uD81A[\uDEF0-\uDEF4\uDF30-\uDF36]|\uD81B[\uDF51-\uDF7E\uDF8F-\uDF92]|\uD82F[\uDC9D\uDC9E]|\uD834[\uDD65-\uDD69\uDD6D-\uDD72\uDD7B-\uDD82\uDD85-\uDD8B\uDDAA-\uDDAD\uDE42-\uDE44]|\uD836[\uDE00-\uDE36\uDE3B-\uDE6C\uDE75\uDE84\uDE9B-\uDE9F\uDEA1-\uDEAF]|\uD838[\uDC00-\uDC06\uDC08-\uDC18\uDC1B-\uDC21\uDC23\uDC24\uDC26-\uDC2A]|\uD83A[\uDCD0-\uDCD6\uDD44-\uDD4A]|\uDB40[\uDD00-\uDDEF]' + }, + { + 'name': 'Mc', + 'alias': 'Spacing_Mark', + 'bmp': '\u0903\u093B\u093E-\u0940\u0949-\u094C\u094E\u094F\u0982\u0983\u09BE-\u09C0\u09C7\u09C8\u09CB\u09CC\u09D7\u0A03\u0A3E-\u0A40\u0A83\u0ABE-\u0AC0\u0AC9\u0ACB\u0ACC\u0B02\u0B03\u0B3E\u0B40\u0B47\u0B48\u0B4B\u0B4C\u0B57\u0BBE\u0BBF\u0BC1\u0BC2\u0BC6-\u0BC8\u0BCA-\u0BCC\u0BD7\u0C01-\u0C03\u0C41-\u0C44\u0C82\u0C83\u0CBE\u0CC0-\u0CC4\u0CC7\u0CC8\u0CCA\u0CCB\u0CD5\u0CD6\u0D02\u0D03\u0D3E-\u0D40\u0D46-\u0D48\u0D4A-\u0D4C\u0D57\u0D82\u0D83\u0DCF-\u0DD1\u0DD8-\u0DDF\u0DF2\u0DF3\u0F3E\u0F3F\u0F7F\u102B\u102C\u1031\u1038\u103B\u103C\u1056\u1057\u1062-\u1064\u1067-\u106D\u1083\u1084\u1087-\u108C\u108F\u109A-\u109C\u17B6\u17BE-\u17C5\u17C7\u17C8\u1923-\u1926\u1929-\u192B\u1930\u1931\u1933-\u1938\u1A19\u1A1A\u1A55\u1A57\u1A61\u1A63\u1A64\u1A6D-\u1A72\u1B04\u1B35\u1B3B\u1B3D-\u1B41\u1B43\u1B44\u1B82\u1BA1\u1BA6\u1BA7\u1BAA\u1BE7\u1BEA-\u1BEC\u1BEE\u1BF2\u1BF3\u1C24-\u1C2B\u1C34\u1C35\u1CE1\u1CF2\u1CF3\u1CF7\u302E\u302F\uA823\uA824\uA827\uA880\uA881\uA8B4-\uA8C3\uA952\uA953\uA983\uA9B4\uA9B5\uA9BA\uA9BB\uA9BD-\uA9C0\uAA2F\uAA30\uAA33\uAA34\uAA4D\uAA7B\uAA7D\uAAEB\uAAEE\uAAEF\uAAF5\uABE3\uABE4\uABE6\uABE7\uABE9\uABEA\uABEC', + 'astral': '\uD804[\uDC00\uDC02\uDC82\uDCB0-\uDCB2\uDCB7\uDCB8\uDD2C\uDD45\uDD46\uDD82\uDDB3-\uDDB5\uDDBF\uDDC0\uDE2C-\uDE2E\uDE32\uDE33\uDE35\uDEE0-\uDEE2\uDF02\uDF03\uDF3E\uDF3F\uDF41-\uDF44\uDF47\uDF48\uDF4B-\uDF4D\uDF57\uDF62\uDF63]|\uD805[\uDC35-\uDC37\uDC40\uDC41\uDC45\uDCB0-\uDCB2\uDCB9\uDCBB-\uDCBE\uDCC1\uDDAF-\uDDB1\uDDB8-\uDDBB\uDDBE\uDE30-\uDE32\uDE3B\uDE3C\uDE3E\uDEAC\uDEAE\uDEAF\uDEB6\uDF20\uDF21\uDF26]|\uD806[\uDC2C-\uDC2E\uDC38\uDE39\uDE57\uDE58\uDE97]|\uD807[\uDC2F\uDC3E\uDCA9\uDCB1\uDCB4\uDD8A-\uDD8E\uDD93\uDD94\uDD96\uDEF5\uDEF6]|\uD81B[\uDF51-\uDF7E]|\uD834[\uDD65\uDD66\uDD6D-\uDD72]' + }, + { + 'name': 'Me', + 'alias': 'Enclosing_Mark', + 'bmp': '\u0488\u0489\u1ABE\u20DD-\u20E0\u20E2-\u20E4\uA670-\uA672' + }, + { + 'name': 'Mn', + 'alias': 'Nonspacing_Mark', + 'bmp': '\u0300-\u036F\u0483-\u0487\u0591-\u05BD\u05BF\u05C1\u05C2\u05C4\u05C5\u05C7\u0610-\u061A\u064B-\u065F\u0670\u06D6-\u06DC\u06DF-\u06E4\u06E7\u06E8\u06EA-\u06ED\u0711\u0730-\u074A\u07A6-\u07B0\u07EB-\u07F3\u07FD\u0816-\u0819\u081B-\u0823\u0825-\u0827\u0829-\u082D\u0859-\u085B\u08D3-\u08E1\u08E3-\u0902\u093A\u093C\u0941-\u0948\u094D\u0951-\u0957\u0962\u0963\u0981\u09BC\u09C1-\u09C4\u09CD\u09E2\u09E3\u09FE\u0A01\u0A02\u0A3C\u0A41\u0A42\u0A47\u0A48\u0A4B-\u0A4D\u0A51\u0A70\u0A71\u0A75\u0A81\u0A82\u0ABC\u0AC1-\u0AC5\u0AC7\u0AC8\u0ACD\u0AE2\u0AE3\u0AFA-\u0AFF\u0B01\u0B3C\u0B3F\u0B41-\u0B44\u0B4D\u0B56\u0B62\u0B63\u0B82\u0BC0\u0BCD\u0C00\u0C04\u0C3E-\u0C40\u0C46-\u0C48\u0C4A-\u0C4D\u0C55\u0C56\u0C62\u0C63\u0C81\u0CBC\u0CBF\u0CC6\u0CCC\u0CCD\u0CE2\u0CE3\u0D00\u0D01\u0D3B\u0D3C\u0D41-\u0D44\u0D4D\u0D62\u0D63\u0DCA\u0DD2-\u0DD4\u0DD6\u0E31\u0E34-\u0E3A\u0E47-\u0E4E\u0EB1\u0EB4-\u0EB9\u0EBB\u0EBC\u0EC8-\u0ECD\u0F18\u0F19\u0F35\u0F37\u0F39\u0F71-\u0F7E\u0F80-\u0F84\u0F86\u0F87\u0F8D-\u0F97\u0F99-\u0FBC\u0FC6\u102D-\u1030\u1032-\u1037\u1039\u103A\u103D\u103E\u1058\u1059\u105E-\u1060\u1071-\u1074\u1082\u1085\u1086\u108D\u109D\u135D-\u135F\u1712-\u1714\u1732-\u1734\u1752\u1753\u1772\u1773\u17B4\u17B5\u17B7-\u17BD\u17C6\u17C9-\u17D3\u17DD\u180B-\u180D\u1885\u1886\u18A9\u1920-\u1922\u1927\u1928\u1932\u1939-\u193B\u1A17\u1A18\u1A1B\u1A56\u1A58-\u1A5E\u1A60\u1A62\u1A65-\u1A6C\u1A73-\u1A7C\u1A7F\u1AB0-\u1ABD\u1B00-\u1B03\u1B34\u1B36-\u1B3A\u1B3C\u1B42\u1B6B-\u1B73\u1B80\u1B81\u1BA2-\u1BA5\u1BA8\u1BA9\u1BAB-\u1BAD\u1BE6\u1BE8\u1BE9\u1BED\u1BEF-\u1BF1\u1C2C-\u1C33\u1C36\u1C37\u1CD0-\u1CD2\u1CD4-\u1CE0\u1CE2-\u1CE8\u1CED\u1CF4\u1CF8\u1CF9\u1DC0-\u1DF9\u1DFB-\u1DFF\u20D0-\u20DC\u20E1\u20E5-\u20F0\u2CEF-\u2CF1\u2D7F\u2DE0-\u2DFF\u302A-\u302D\u3099\u309A\uA66F\uA674-\uA67D\uA69E\uA69F\uA6F0\uA6F1\uA802\uA806\uA80B\uA825\uA826\uA8C4\uA8C5\uA8E0-\uA8F1\uA8FF\uA926-\uA92D\uA947-\uA951\uA980-\uA982\uA9B3\uA9B6-\uA9B9\uA9BC\uA9E5\uAA29-\uAA2E\uAA31\uAA32\uAA35\uAA36\uAA43\uAA4C\uAA7C\uAAB0\uAAB2-\uAAB4\uAAB7\uAAB8\uAABE\uAABF\uAAC1\uAAEC\uAAED\uAAF6\uABE5\uABE8\uABED\uFB1E\uFE00-\uFE0F\uFE20-\uFE2F', + 'astral': '\uD800[\uDDFD\uDEE0\uDF76-\uDF7A]|\uD802[\uDE01-\uDE03\uDE05\uDE06\uDE0C-\uDE0F\uDE38-\uDE3A\uDE3F\uDEE5\uDEE6]|\uD803[\uDD24-\uDD27\uDF46-\uDF50]|\uD804[\uDC01\uDC38-\uDC46\uDC7F-\uDC81\uDCB3-\uDCB6\uDCB9\uDCBA\uDD00-\uDD02\uDD27-\uDD2B\uDD2D-\uDD34\uDD73\uDD80\uDD81\uDDB6-\uDDBE\uDDC9-\uDDCC\uDE2F-\uDE31\uDE34\uDE36\uDE37\uDE3E\uDEDF\uDEE3-\uDEEA\uDF00\uDF01\uDF3B\uDF3C\uDF40\uDF66-\uDF6C\uDF70-\uDF74]|\uD805[\uDC38-\uDC3F\uDC42-\uDC44\uDC46\uDC5E\uDCB3-\uDCB8\uDCBA\uDCBF\uDCC0\uDCC2\uDCC3\uDDB2-\uDDB5\uDDBC\uDDBD\uDDBF\uDDC0\uDDDC\uDDDD\uDE33-\uDE3A\uDE3D\uDE3F\uDE40\uDEAB\uDEAD\uDEB0-\uDEB5\uDEB7\uDF1D-\uDF1F\uDF22-\uDF25\uDF27-\uDF2B]|\uD806[\uDC2F-\uDC37\uDC39\uDC3A\uDE01-\uDE0A\uDE33-\uDE38\uDE3B-\uDE3E\uDE47\uDE51-\uDE56\uDE59-\uDE5B\uDE8A-\uDE96\uDE98\uDE99]|\uD807[\uDC30-\uDC36\uDC38-\uDC3D\uDC3F\uDC92-\uDCA7\uDCAA-\uDCB0\uDCB2\uDCB3\uDCB5\uDCB6\uDD31-\uDD36\uDD3A\uDD3C\uDD3D\uDD3F-\uDD45\uDD47\uDD90\uDD91\uDD95\uDD97\uDEF3\uDEF4]|\uD81A[\uDEF0-\uDEF4\uDF30-\uDF36]|\uD81B[\uDF8F-\uDF92]|\uD82F[\uDC9D\uDC9E]|\uD834[\uDD67-\uDD69\uDD7B-\uDD82\uDD85-\uDD8B\uDDAA-\uDDAD\uDE42-\uDE44]|\uD836[\uDE00-\uDE36\uDE3B-\uDE6C\uDE75\uDE84\uDE9B-\uDE9F\uDEA1-\uDEAF]|\uD838[\uDC00-\uDC06\uDC08-\uDC18\uDC1B-\uDC21\uDC23\uDC24\uDC26-\uDC2A]|\uD83A[\uDCD0-\uDCD6\uDD44-\uDD4A]|\uDB40[\uDD00-\uDDEF]' + }, + { + 'name': 'N', + 'alias': 'Number', + 'bmp': '0-9\xB2\xB3\xB9\xBC-\xBE\u0660-\u0669\u06F0-\u06F9\u07C0-\u07C9\u0966-\u096F\u09E6-\u09EF\u09F4-\u09F9\u0A66-\u0A6F\u0AE6-\u0AEF\u0B66-\u0B6F\u0B72-\u0B77\u0BE6-\u0BF2\u0C66-\u0C6F\u0C78-\u0C7E\u0CE6-\u0CEF\u0D58-\u0D5E\u0D66-\u0D78\u0DE6-\u0DEF\u0E50-\u0E59\u0ED0-\u0ED9\u0F20-\u0F33\u1040-\u1049\u1090-\u1099\u1369-\u137C\u16EE-\u16F0\u17E0-\u17E9\u17F0-\u17F9\u1810-\u1819\u1946-\u194F\u19D0-\u19DA\u1A80-\u1A89\u1A90-\u1A99\u1B50-\u1B59\u1BB0-\u1BB9\u1C40-\u1C49\u1C50-\u1C59\u2070\u2074-\u2079\u2080-\u2089\u2150-\u2182\u2185-\u2189\u2460-\u249B\u24EA-\u24FF\u2776-\u2793\u2CFD\u3007\u3021-\u3029\u3038-\u303A\u3192-\u3195\u3220-\u3229\u3248-\u324F\u3251-\u325F\u3280-\u3289\u32B1-\u32BF\uA620-\uA629\uA6E6-\uA6EF\uA830-\uA835\uA8D0-\uA8D9\uA900-\uA909\uA9D0-\uA9D9\uA9F0-\uA9F9\uAA50-\uAA59\uABF0-\uABF9\uFF10-\uFF19', + 'astral': '\uD800[\uDD07-\uDD33\uDD40-\uDD78\uDD8A\uDD8B\uDEE1-\uDEFB\uDF20-\uDF23\uDF41\uDF4A\uDFD1-\uDFD5]|\uD801[\uDCA0-\uDCA9]|\uD802[\uDC58-\uDC5F\uDC79-\uDC7F\uDCA7-\uDCAF\uDCFB-\uDCFF\uDD16-\uDD1B\uDDBC\uDDBD\uDDC0-\uDDCF\uDDD2-\uDDFF\uDE40-\uDE48\uDE7D\uDE7E\uDE9D-\uDE9F\uDEEB-\uDEEF\uDF58-\uDF5F\uDF78-\uDF7F\uDFA9-\uDFAF]|\uD803[\uDCFA-\uDCFF\uDD30-\uDD39\uDE60-\uDE7E\uDF1D-\uDF26\uDF51-\uDF54]|\uD804[\uDC52-\uDC6F\uDCF0-\uDCF9\uDD36-\uDD3F\uDDD0-\uDDD9\uDDE1-\uDDF4\uDEF0-\uDEF9]|\uD805[\uDC50-\uDC59\uDCD0-\uDCD9\uDE50-\uDE59\uDEC0-\uDEC9\uDF30-\uDF3B]|\uD806[\uDCE0-\uDCF2]|\uD807[\uDC50-\uDC6C\uDD50-\uDD59\uDDA0-\uDDA9]|\uD809[\uDC00-\uDC6E]|\uD81A[\uDE60-\uDE69\uDF50-\uDF59\uDF5B-\uDF61]|\uD81B[\uDE80-\uDE96]|\uD834[\uDEE0-\uDEF3\uDF60-\uDF78]|\uD835[\uDFCE-\uDFFF]|\uD83A[\uDCC7-\uDCCF\uDD50-\uDD59]|\uD83B[\uDC71-\uDCAB\uDCAD-\uDCAF\uDCB1-\uDCB4]|\uD83C[\uDD00-\uDD0C]' + }, + { + 'name': 'Nd', + 'alias': 'Decimal_Number', + 'bmp': '0-9\u0660-\u0669\u06F0-\u06F9\u07C0-\u07C9\u0966-\u096F\u09E6-\u09EF\u0A66-\u0A6F\u0AE6-\u0AEF\u0B66-\u0B6F\u0BE6-\u0BEF\u0C66-\u0C6F\u0CE6-\u0CEF\u0D66-\u0D6F\u0DE6-\u0DEF\u0E50-\u0E59\u0ED0-\u0ED9\u0F20-\u0F29\u1040-\u1049\u1090-\u1099\u17E0-\u17E9\u1810-\u1819\u1946-\u194F\u19D0-\u19D9\u1A80-\u1A89\u1A90-\u1A99\u1B50-\u1B59\u1BB0-\u1BB9\u1C40-\u1C49\u1C50-\u1C59\uA620-\uA629\uA8D0-\uA8D9\uA900-\uA909\uA9D0-\uA9D9\uA9F0-\uA9F9\uAA50-\uAA59\uABF0-\uABF9\uFF10-\uFF19', + 'astral': '\uD801[\uDCA0-\uDCA9]|\uD803[\uDD30-\uDD39]|\uD804[\uDC66-\uDC6F\uDCF0-\uDCF9\uDD36-\uDD3F\uDDD0-\uDDD9\uDEF0-\uDEF9]|\uD805[\uDC50-\uDC59\uDCD0-\uDCD9\uDE50-\uDE59\uDEC0-\uDEC9\uDF30-\uDF39]|\uD806[\uDCE0-\uDCE9]|\uD807[\uDC50-\uDC59\uDD50-\uDD59\uDDA0-\uDDA9]|\uD81A[\uDE60-\uDE69\uDF50-\uDF59]|\uD835[\uDFCE-\uDFFF]|\uD83A[\uDD50-\uDD59]' + }, + { + 'name': 'Nl', + 'alias': 'Letter_Number', + 'bmp': '\u16EE-\u16F0\u2160-\u2182\u2185-\u2188\u3007\u3021-\u3029\u3038-\u303A\uA6E6-\uA6EF', + 'astral': '\uD800[\uDD40-\uDD74\uDF41\uDF4A\uDFD1-\uDFD5]|\uD809[\uDC00-\uDC6E]' + }, + { + 'name': 'No', + 'alias': 'Other_Number', + 'bmp': '\xB2\xB3\xB9\xBC-\xBE\u09F4-\u09F9\u0B72-\u0B77\u0BF0-\u0BF2\u0C78-\u0C7E\u0D58-\u0D5E\u0D70-\u0D78\u0F2A-\u0F33\u1369-\u137C\u17F0-\u17F9\u19DA\u2070\u2074-\u2079\u2080-\u2089\u2150-\u215F\u2189\u2460-\u249B\u24EA-\u24FF\u2776-\u2793\u2CFD\u3192-\u3195\u3220-\u3229\u3248-\u324F\u3251-\u325F\u3280-\u3289\u32B1-\u32BF\uA830-\uA835', + 'astral': '\uD800[\uDD07-\uDD33\uDD75-\uDD78\uDD8A\uDD8B\uDEE1-\uDEFB\uDF20-\uDF23]|\uD802[\uDC58-\uDC5F\uDC79-\uDC7F\uDCA7-\uDCAF\uDCFB-\uDCFF\uDD16-\uDD1B\uDDBC\uDDBD\uDDC0-\uDDCF\uDDD2-\uDDFF\uDE40-\uDE48\uDE7D\uDE7E\uDE9D-\uDE9F\uDEEB-\uDEEF\uDF58-\uDF5F\uDF78-\uDF7F\uDFA9-\uDFAF]|\uD803[\uDCFA-\uDCFF\uDE60-\uDE7E\uDF1D-\uDF26\uDF51-\uDF54]|\uD804[\uDC52-\uDC65\uDDE1-\uDDF4]|\uD805[\uDF3A\uDF3B]|\uD806[\uDCEA-\uDCF2]|\uD807[\uDC5A-\uDC6C]|\uD81A[\uDF5B-\uDF61]|\uD81B[\uDE80-\uDE96]|\uD834[\uDEE0-\uDEF3\uDF60-\uDF78]|\uD83A[\uDCC7-\uDCCF]|\uD83B[\uDC71-\uDCAB\uDCAD-\uDCAF\uDCB1-\uDCB4]|\uD83C[\uDD00-\uDD0C]' + }, + { + 'name': 'P', + 'alias': 'Punctuation', + 'bmp': '!-#%-\\*,-\\/:;\\?@\\[-\\]_\\{\\}\xA1\xA7\xAB\xB6\xB7\xBB\xBF\u037E\u0387\u055A-\u055F\u0589\u058A\u05BE\u05C0\u05C3\u05C6\u05F3\u05F4\u0609\u060A\u060C\u060D\u061B\u061E\u061F\u066A-\u066D\u06D4\u0700-\u070D\u07F7-\u07F9\u0830-\u083E\u085E\u0964\u0965\u0970\u09FD\u0A76\u0AF0\u0C84\u0DF4\u0E4F\u0E5A\u0E5B\u0F04-\u0F12\u0F14\u0F3A-\u0F3D\u0F85\u0FD0-\u0FD4\u0FD9\u0FDA\u104A-\u104F\u10FB\u1360-\u1368\u1400\u166D\u166E\u169B\u169C\u16EB-\u16ED\u1735\u1736\u17D4-\u17D6\u17D8-\u17DA\u1800-\u180A\u1944\u1945\u1A1E\u1A1F\u1AA0-\u1AA6\u1AA8-\u1AAD\u1B5A-\u1B60\u1BFC-\u1BFF\u1C3B-\u1C3F\u1C7E\u1C7F\u1CC0-\u1CC7\u1CD3\u2010-\u2027\u2030-\u2043\u2045-\u2051\u2053-\u205E\u207D\u207E\u208D\u208E\u2308-\u230B\u2329\u232A\u2768-\u2775\u27C5\u27C6\u27E6-\u27EF\u2983-\u2998\u29D8-\u29DB\u29FC\u29FD\u2CF9-\u2CFC\u2CFE\u2CFF\u2D70\u2E00-\u2E2E\u2E30-\u2E4E\u3001-\u3003\u3008-\u3011\u3014-\u301F\u3030\u303D\u30A0\u30FB\uA4FE\uA4FF\uA60D-\uA60F\uA673\uA67E\uA6F2-\uA6F7\uA874-\uA877\uA8CE\uA8CF\uA8F8-\uA8FA\uA8FC\uA92E\uA92F\uA95F\uA9C1-\uA9CD\uA9DE\uA9DF\uAA5C-\uAA5F\uAADE\uAADF\uAAF0\uAAF1\uABEB\uFD3E\uFD3F\uFE10-\uFE19\uFE30-\uFE52\uFE54-\uFE61\uFE63\uFE68\uFE6A\uFE6B\uFF01-\uFF03\uFF05-\uFF0A\uFF0C-\uFF0F\uFF1A\uFF1B\uFF1F\uFF20\uFF3B-\uFF3D\uFF3F\uFF5B\uFF5D\uFF5F-\uFF65', + 'astral': '\uD800[\uDD00-\uDD02\uDF9F\uDFD0]|\uD801\uDD6F|\uD802[\uDC57\uDD1F\uDD3F\uDE50-\uDE58\uDE7F\uDEF0-\uDEF6\uDF39-\uDF3F\uDF99-\uDF9C]|\uD803[\uDF55-\uDF59]|\uD804[\uDC47-\uDC4D\uDCBB\uDCBC\uDCBE-\uDCC1\uDD40-\uDD43\uDD74\uDD75\uDDC5-\uDDC8\uDDCD\uDDDB\uDDDD-\uDDDF\uDE38-\uDE3D\uDEA9]|\uD805[\uDC4B-\uDC4F\uDC5B\uDC5D\uDCC6\uDDC1-\uDDD7\uDE41-\uDE43\uDE60-\uDE6C\uDF3C-\uDF3E]|\uD806[\uDC3B\uDE3F-\uDE46\uDE9A-\uDE9C\uDE9E-\uDEA2]|\uD807[\uDC41-\uDC45\uDC70\uDC71\uDEF7\uDEF8]|\uD809[\uDC70-\uDC74]|\uD81A[\uDE6E\uDE6F\uDEF5\uDF37-\uDF3B\uDF44]|\uD81B[\uDE97-\uDE9A]|\uD82F\uDC9F|\uD836[\uDE87-\uDE8B]|\uD83A[\uDD5E\uDD5F]' + }, + { + 'name': 'Pc', + 'alias': 'Connector_Punctuation', + 'bmp': '_\u203F\u2040\u2054\uFE33\uFE34\uFE4D-\uFE4F\uFF3F' + }, + { + 'name': 'Pd', + 'alias': 'Dash_Punctuation', + 'bmp': '\\-\u058A\u05BE\u1400\u1806\u2010-\u2015\u2E17\u2E1A\u2E3A\u2E3B\u2E40\u301C\u3030\u30A0\uFE31\uFE32\uFE58\uFE63\uFF0D' + }, + { + 'name': 'Pe', + 'alias': 'Close_Punctuation', + 'bmp': '\\)\\]\\}\u0F3B\u0F3D\u169C\u2046\u207E\u208E\u2309\u230B\u232A\u2769\u276B\u276D\u276F\u2771\u2773\u2775\u27C6\u27E7\u27E9\u27EB\u27ED\u27EF\u2984\u2986\u2988\u298A\u298C\u298E\u2990\u2992\u2994\u2996\u2998\u29D9\u29DB\u29FD\u2E23\u2E25\u2E27\u2E29\u3009\u300B\u300D\u300F\u3011\u3015\u3017\u3019\u301B\u301E\u301F\uFD3E\uFE18\uFE36\uFE38\uFE3A\uFE3C\uFE3E\uFE40\uFE42\uFE44\uFE48\uFE5A\uFE5C\uFE5E\uFF09\uFF3D\uFF5D\uFF60\uFF63' + }, + { + 'name': 'Pf', + 'alias': 'Final_Punctuation', + 'bmp': '\xBB\u2019\u201D\u203A\u2E03\u2E05\u2E0A\u2E0D\u2E1D\u2E21' + }, + { + 'name': 'Pi', + 'alias': 'Initial_Punctuation', + 'bmp': '\xAB\u2018\u201B\u201C\u201F\u2039\u2E02\u2E04\u2E09\u2E0C\u2E1C\u2E20' + }, + { + 'name': 'Po', + 'alias': 'Other_Punctuation', + 'bmp': '!-#%-\'\\*,\\.\\/:;\\?@\\\xA1\xA7\xB6\xB7\xBF\u037E\u0387\u055A-\u055F\u0589\u05C0\u05C3\u05C6\u05F3\u05F4\u0609\u060A\u060C\u060D\u061B\u061E\u061F\u066A-\u066D\u06D4\u0700-\u070D\u07F7-\u07F9\u0830-\u083E\u085E\u0964\u0965\u0970\u09FD\u0A76\u0AF0\u0C84\u0DF4\u0E4F\u0E5A\u0E5B\u0F04-\u0F12\u0F14\u0F85\u0FD0-\u0FD4\u0FD9\u0FDA\u104A-\u104F\u10FB\u1360-\u1368\u166D\u166E\u16EB-\u16ED\u1735\u1736\u17D4-\u17D6\u17D8-\u17DA\u1800-\u1805\u1807-\u180A\u1944\u1945\u1A1E\u1A1F\u1AA0-\u1AA6\u1AA8-\u1AAD\u1B5A-\u1B60\u1BFC-\u1BFF\u1C3B-\u1C3F\u1C7E\u1C7F\u1CC0-\u1CC7\u1CD3\u2016\u2017\u2020-\u2027\u2030-\u2038\u203B-\u203E\u2041-\u2043\u2047-\u2051\u2053\u2055-\u205E\u2CF9-\u2CFC\u2CFE\u2CFF\u2D70\u2E00\u2E01\u2E06-\u2E08\u2E0B\u2E0E-\u2E16\u2E18\u2E19\u2E1B\u2E1E\u2E1F\u2E2A-\u2E2E\u2E30-\u2E39\u2E3C-\u2E3F\u2E41\u2E43-\u2E4E\u3001-\u3003\u303D\u30FB\uA4FE\uA4FF\uA60D-\uA60F\uA673\uA67E\uA6F2-\uA6F7\uA874-\uA877\uA8CE\uA8CF\uA8F8-\uA8FA\uA8FC\uA92E\uA92F\uA95F\uA9C1-\uA9CD\uA9DE\uA9DF\uAA5C-\uAA5F\uAADE\uAADF\uAAF0\uAAF1\uABEB\uFE10-\uFE16\uFE19\uFE30\uFE45\uFE46\uFE49-\uFE4C\uFE50-\uFE52\uFE54-\uFE57\uFE5F-\uFE61\uFE68\uFE6A\uFE6B\uFF01-\uFF03\uFF05-\uFF07\uFF0A\uFF0C\uFF0E\uFF0F\uFF1A\uFF1B\uFF1F\uFF20\uFF3C\uFF61\uFF64\uFF65', + 'astral': '\uD800[\uDD00-\uDD02\uDF9F\uDFD0]|\uD801\uDD6F|\uD802[\uDC57\uDD1F\uDD3F\uDE50-\uDE58\uDE7F\uDEF0-\uDEF6\uDF39-\uDF3F\uDF99-\uDF9C]|\uD803[\uDF55-\uDF59]|\uD804[\uDC47-\uDC4D\uDCBB\uDCBC\uDCBE-\uDCC1\uDD40-\uDD43\uDD74\uDD75\uDDC5-\uDDC8\uDDCD\uDDDB\uDDDD-\uDDDF\uDE38-\uDE3D\uDEA9]|\uD805[\uDC4B-\uDC4F\uDC5B\uDC5D\uDCC6\uDDC1-\uDDD7\uDE41-\uDE43\uDE60-\uDE6C\uDF3C-\uDF3E]|\uD806[\uDC3B\uDE3F-\uDE46\uDE9A-\uDE9C\uDE9E-\uDEA2]|\uD807[\uDC41-\uDC45\uDC70\uDC71\uDEF7\uDEF8]|\uD809[\uDC70-\uDC74]|\uD81A[\uDE6E\uDE6F\uDEF5\uDF37-\uDF3B\uDF44]|\uD81B[\uDE97-\uDE9A]|\uD82F\uDC9F|\uD836[\uDE87-\uDE8B]|\uD83A[\uDD5E\uDD5F]' + }, + { + 'name': 'Ps', + 'alias': 'Open_Punctuation', + 'bmp': '\\(\\[\\{\u0F3A\u0F3C\u169B\u201A\u201E\u2045\u207D\u208D\u2308\u230A\u2329\u2768\u276A\u276C\u276E\u2770\u2772\u2774\u27C5\u27E6\u27E8\u27EA\u27EC\u27EE\u2983\u2985\u2987\u2989\u298B\u298D\u298F\u2991\u2993\u2995\u2997\u29D8\u29DA\u29FC\u2E22\u2E24\u2E26\u2E28\u2E42\u3008\u300A\u300C\u300E\u3010\u3014\u3016\u3018\u301A\u301D\uFD3F\uFE17\uFE35\uFE37\uFE39\uFE3B\uFE3D\uFE3F\uFE41\uFE43\uFE47\uFE59\uFE5B\uFE5D\uFF08\uFF3B\uFF5B\uFF5F\uFF62' + }, + { + 'name': 'S', + 'alias': 'Symbol', + 'bmp': '\\$\\+<->\\^`\\|~\xA2-\xA6\xA8\xA9\xAC\xAE-\xB1\xB4\xB8\xD7\xF7\u02C2-\u02C5\u02D2-\u02DF\u02E5-\u02EB\u02ED\u02EF-\u02FF\u0375\u0384\u0385\u03F6\u0482\u058D-\u058F\u0606-\u0608\u060B\u060E\u060F\u06DE\u06E9\u06FD\u06FE\u07F6\u07FE\u07FF\u09F2\u09F3\u09FA\u09FB\u0AF1\u0B70\u0BF3-\u0BFA\u0C7F\u0D4F\u0D79\u0E3F\u0F01-\u0F03\u0F13\u0F15-\u0F17\u0F1A-\u0F1F\u0F34\u0F36\u0F38\u0FBE-\u0FC5\u0FC7-\u0FCC\u0FCE\u0FCF\u0FD5-\u0FD8\u109E\u109F\u1390-\u1399\u17DB\u1940\u19DE-\u19FF\u1B61-\u1B6A\u1B74-\u1B7C\u1FBD\u1FBF-\u1FC1\u1FCD-\u1FCF\u1FDD-\u1FDF\u1FED-\u1FEF\u1FFD\u1FFE\u2044\u2052\u207A-\u207C\u208A-\u208C\u20A0-\u20BF\u2100\u2101\u2103-\u2106\u2108\u2109\u2114\u2116-\u2118\u211E-\u2123\u2125\u2127\u2129\u212E\u213A\u213B\u2140-\u2144\u214A-\u214D\u214F\u218A\u218B\u2190-\u2307\u230C-\u2328\u232B-\u2426\u2440-\u244A\u249C-\u24E9\u2500-\u2767\u2794-\u27C4\u27C7-\u27E5\u27F0-\u2982\u2999-\u29D7\u29DC-\u29FB\u29FE-\u2B73\u2B76-\u2B95\u2B98-\u2BC8\u2BCA-\u2BFE\u2CE5-\u2CEA\u2E80-\u2E99\u2E9B-\u2EF3\u2F00-\u2FD5\u2FF0-\u2FFB\u3004\u3012\u3013\u3020\u3036\u3037\u303E\u303F\u309B\u309C\u3190\u3191\u3196-\u319F\u31C0-\u31E3\u3200-\u321E\u322A-\u3247\u3250\u3260-\u327F\u328A-\u32B0\u32C0-\u32FE\u3300-\u33FF\u4DC0-\u4DFF\uA490-\uA4C6\uA700-\uA716\uA720\uA721\uA789\uA78A\uA828-\uA82B\uA836-\uA839\uAA77-\uAA79\uAB5B\uFB29\uFBB2-\uFBC1\uFDFC\uFDFD\uFE62\uFE64-\uFE66\uFE69\uFF04\uFF0B\uFF1C-\uFF1E\uFF3E\uFF40\uFF5C\uFF5E\uFFE0-\uFFE6\uFFE8-\uFFEE\uFFFC\uFFFD', + 'astral': '\uD800[\uDD37-\uDD3F\uDD79-\uDD89\uDD8C-\uDD8E\uDD90-\uDD9B\uDDA0\uDDD0-\uDDFC]|\uD802[\uDC77\uDC78\uDEC8]|\uD805\uDF3F|\uD81A[\uDF3C-\uDF3F\uDF45]|\uD82F\uDC9C|\uD834[\uDC00-\uDCF5\uDD00-\uDD26\uDD29-\uDD64\uDD6A-\uDD6C\uDD83\uDD84\uDD8C-\uDDA9\uDDAE-\uDDE8\uDE00-\uDE41\uDE45\uDF00-\uDF56]|\uD835[\uDEC1\uDEDB\uDEFB\uDF15\uDF35\uDF4F\uDF6F\uDF89\uDFA9\uDFC3]|\uD836[\uDC00-\uDDFF\uDE37-\uDE3A\uDE6D-\uDE74\uDE76-\uDE83\uDE85\uDE86]|\uD83B[\uDCAC\uDCB0\uDEF0\uDEF1]|\uD83C[\uDC00-\uDC2B\uDC30-\uDC93\uDCA0-\uDCAE\uDCB1-\uDCBF\uDCC1-\uDCCF\uDCD1-\uDCF5\uDD10-\uDD6B\uDD70-\uDDAC\uDDE6-\uDE02\uDE10-\uDE3B\uDE40-\uDE48\uDE50\uDE51\uDE60-\uDE65\uDF00-\uDFFF]|\uD83D[\uDC00-\uDED4\uDEE0-\uDEEC\uDEF0-\uDEF9\uDF00-\uDF73\uDF80-\uDFD8]|\uD83E[\uDC00-\uDC0B\uDC10-\uDC47\uDC50-\uDC59\uDC60-\uDC87\uDC90-\uDCAD\uDD00-\uDD0B\uDD10-\uDD3E\uDD40-\uDD70\uDD73-\uDD76\uDD7A\uDD7C-\uDDA2\uDDB0-\uDDB9\uDDC0-\uDDC2\uDDD0-\uDDFF\uDE60-\uDE6D]' + }, + { + 'name': 'Sc', + 'alias': 'Currency_Symbol', + 'bmp': '\\$\xA2-\xA5\u058F\u060B\u07FE\u07FF\u09F2\u09F3\u09FB\u0AF1\u0BF9\u0E3F\u17DB\u20A0-\u20BF\uA838\uFDFC\uFE69\uFF04\uFFE0\uFFE1\uFFE5\uFFE6', + 'astral': '\uD83B\uDCB0' + }, + { + 'name': 'Sk', + 'alias': 'Modifier_Symbol', + 'bmp': '\\^`\xA8\xAF\xB4\xB8\u02C2-\u02C5\u02D2-\u02DF\u02E5-\u02EB\u02ED\u02EF-\u02FF\u0375\u0384\u0385\u1FBD\u1FBF-\u1FC1\u1FCD-\u1FCF\u1FDD-\u1FDF\u1FED-\u1FEF\u1FFD\u1FFE\u309B\u309C\uA700-\uA716\uA720\uA721\uA789\uA78A\uAB5B\uFBB2-\uFBC1\uFF3E\uFF40\uFFE3', + 'astral': '\uD83C[\uDFFB-\uDFFF]' + }, + { + 'name': 'Sm', + 'alias': 'Math_Symbol', + 'bmp': '\\+<->\\|~\xAC\xB1\xD7\xF7\u03F6\u0606-\u0608\u2044\u2052\u207A-\u207C\u208A-\u208C\u2118\u2140-\u2144\u214B\u2190-\u2194\u219A\u219B\u21A0\u21A3\u21A6\u21AE\u21CE\u21CF\u21D2\u21D4\u21F4-\u22FF\u2320\u2321\u237C\u239B-\u23B3\u23DC-\u23E1\u25B7\u25C1\u25F8-\u25FF\u266F\u27C0-\u27C4\u27C7-\u27E5\u27F0-\u27FF\u2900-\u2982\u2999-\u29D7\u29DC-\u29FB\u29FE-\u2AFF\u2B30-\u2B44\u2B47-\u2B4C\uFB29\uFE62\uFE64-\uFE66\uFF0B\uFF1C-\uFF1E\uFF5C\uFF5E\uFFE2\uFFE9-\uFFEC', + 'astral': '\uD835[\uDEC1\uDEDB\uDEFB\uDF15\uDF35\uDF4F\uDF6F\uDF89\uDFA9\uDFC3]|\uD83B[\uDEF0\uDEF1]' + }, + { + 'name': 'So', + 'alias': 'Other_Symbol', + 'bmp': '\xA6\xA9\xAE\xB0\u0482\u058D\u058E\u060E\u060F\u06DE\u06E9\u06FD\u06FE\u07F6\u09FA\u0B70\u0BF3-\u0BF8\u0BFA\u0C7F\u0D4F\u0D79\u0F01-\u0F03\u0F13\u0F15-\u0F17\u0F1A-\u0F1F\u0F34\u0F36\u0F38\u0FBE-\u0FC5\u0FC7-\u0FCC\u0FCE\u0FCF\u0FD5-\u0FD8\u109E\u109F\u1390-\u1399\u1940\u19DE-\u19FF\u1B61-\u1B6A\u1B74-\u1B7C\u2100\u2101\u2103-\u2106\u2108\u2109\u2114\u2116\u2117\u211E-\u2123\u2125\u2127\u2129\u212E\u213A\u213B\u214A\u214C\u214D\u214F\u218A\u218B\u2195-\u2199\u219C-\u219F\u21A1\u21A2\u21A4\u21A5\u21A7-\u21AD\u21AF-\u21CD\u21D0\u21D1\u21D3\u21D5-\u21F3\u2300-\u2307\u230C-\u231F\u2322-\u2328\u232B-\u237B\u237D-\u239A\u23B4-\u23DB\u23E2-\u2426\u2440-\u244A\u249C-\u24E9\u2500-\u25B6\u25B8-\u25C0\u25C2-\u25F7\u2600-\u266E\u2670-\u2767\u2794-\u27BF\u2800-\u28FF\u2B00-\u2B2F\u2B45\u2B46\u2B4D-\u2B73\u2B76-\u2B95\u2B98-\u2BC8\u2BCA-\u2BFE\u2CE5-\u2CEA\u2E80-\u2E99\u2E9B-\u2EF3\u2F00-\u2FD5\u2FF0-\u2FFB\u3004\u3012\u3013\u3020\u3036\u3037\u303E\u303F\u3190\u3191\u3196-\u319F\u31C0-\u31E3\u3200-\u321E\u322A-\u3247\u3250\u3260-\u327F\u328A-\u32B0\u32C0-\u32FE\u3300-\u33FF\u4DC0-\u4DFF\uA490-\uA4C6\uA828-\uA82B\uA836\uA837\uA839\uAA77-\uAA79\uFDFD\uFFE4\uFFE8\uFFED\uFFEE\uFFFC\uFFFD', + 'astral': '\uD800[\uDD37-\uDD3F\uDD79-\uDD89\uDD8C-\uDD8E\uDD90-\uDD9B\uDDA0\uDDD0-\uDDFC]|\uD802[\uDC77\uDC78\uDEC8]|\uD805\uDF3F|\uD81A[\uDF3C-\uDF3F\uDF45]|\uD82F\uDC9C|\uD834[\uDC00-\uDCF5\uDD00-\uDD26\uDD29-\uDD64\uDD6A-\uDD6C\uDD83\uDD84\uDD8C-\uDDA9\uDDAE-\uDDE8\uDE00-\uDE41\uDE45\uDF00-\uDF56]|\uD836[\uDC00-\uDDFF\uDE37-\uDE3A\uDE6D-\uDE74\uDE76-\uDE83\uDE85\uDE86]|\uD83B\uDCAC|\uD83C[\uDC00-\uDC2B\uDC30-\uDC93\uDCA0-\uDCAE\uDCB1-\uDCBF\uDCC1-\uDCCF\uDCD1-\uDCF5\uDD10-\uDD6B\uDD70-\uDDAC\uDDE6-\uDE02\uDE10-\uDE3B\uDE40-\uDE48\uDE50\uDE51\uDE60-\uDE65\uDF00-\uDFFA]|\uD83D[\uDC00-\uDED4\uDEE0-\uDEEC\uDEF0-\uDEF9\uDF00-\uDF73\uDF80-\uDFD8]|\uD83E[\uDC00-\uDC0B\uDC10-\uDC47\uDC50-\uDC59\uDC60-\uDC87\uDC90-\uDCAD\uDD00-\uDD0B\uDD10-\uDD3E\uDD40-\uDD70\uDD73-\uDD76\uDD7A\uDD7C-\uDDA2\uDDB0-\uDDB9\uDDC0-\uDDC2\uDDD0-\uDDFF\uDE60-\uDE6D]' + }, + { + 'name': 'Z', + 'alias': 'Separator', + 'bmp': ' \xA0\u1680\u2000-\u200A\u2028\u2029\u202F\u205F\u3000' + }, + { + 'name': 'Zl', + 'alias': 'Line_Separator', + 'bmp': '\u2028' + }, + { + 'name': 'Zp', + 'alias': 'Paragraph_Separator', + 'bmp': '\u2029' + }, + { + 'name': 'Zs', + 'alias': 'Space_Separator', + 'bmp': ' \xA0\u1680\u2000-\u200A\u202F\u205F\u3000' + } +]; + +var unicodeCategories = createCommonjsModule(function (module, exports) { +"use strict"; + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.default = void 0; + +var _categories = _interopRequireDefault(categories); + +function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } + +/*! + * XRegExp Unicode Categories 4.2.0 + * + * Steven Levithan (c) 2010-present MIT License + * Unicode data by Mathias Bynens + */ +var _default = function _default(XRegExp) { + /** + * Adds support for Unicode's general categories. E.g., `\p{Lu}` or `\p{Uppercase Letter}`. See + * category descriptions in UAX #44 . Token + * names are case insensitive, and any spaces, hyphens, and underscores are ignored. + * + * Uses Unicode 11.0.0. + * + * @requires XRegExp, Unicode Base + */ + if (!XRegExp.addUnicodeData) { + throw new ReferenceError('Unicode Base must be loaded before Unicode Categories'); + } + + XRegExp.addUnicodeData(_categories.default); +}; + +exports.default = _default; +module.exports = exports["default"]; +}); + +unwrapExports(unicodeCategories); + +var properties = [ + { + 'name': 'ASCII', + 'bmp': '\0-\x7F' + }, + { + 'name': 'Alphabetic', + 'bmp': 'A-Za-z\xAA\xB5\xBA\xC0-\xD6\xD8-\xF6\xF8-\u02C1\u02C6-\u02D1\u02E0-\u02E4\u02EC\u02EE\u0345\u0370-\u0374\u0376\u0377\u037A-\u037D\u037F\u0386\u0388-\u038A\u038C\u038E-\u03A1\u03A3-\u03F5\u03F7-\u0481\u048A-\u052F\u0531-\u0556\u0559\u0560-\u0588\u05B0-\u05BD\u05BF\u05C1\u05C2\u05C4\u05C5\u05C7\u05D0-\u05EA\u05EF-\u05F2\u0610-\u061A\u0620-\u0657\u0659-\u065F\u066E-\u06D3\u06D5-\u06DC\u06E1-\u06E8\u06ED-\u06EF\u06FA-\u06FC\u06FF\u0710-\u073F\u074D-\u07B1\u07CA-\u07EA\u07F4\u07F5\u07FA\u0800-\u0817\u081A-\u082C\u0840-\u0858\u0860-\u086A\u08A0-\u08B4\u08B6-\u08BD\u08D4-\u08DF\u08E3-\u08E9\u08F0-\u093B\u093D-\u094C\u094E-\u0950\u0955-\u0963\u0971-\u0983\u0985-\u098C\u098F\u0990\u0993-\u09A8\u09AA-\u09B0\u09B2\u09B6-\u09B9\u09BD-\u09C4\u09C7\u09C8\u09CB\u09CC\u09CE\u09D7\u09DC\u09DD\u09DF-\u09E3\u09F0\u09F1\u09FC\u0A01-\u0A03\u0A05-\u0A0A\u0A0F\u0A10\u0A13-\u0A28\u0A2A-\u0A30\u0A32\u0A33\u0A35\u0A36\u0A38\u0A39\u0A3E-\u0A42\u0A47\u0A48\u0A4B\u0A4C\u0A51\u0A59-\u0A5C\u0A5E\u0A70-\u0A75\u0A81-\u0A83\u0A85-\u0A8D\u0A8F-\u0A91\u0A93-\u0AA8\u0AAA-\u0AB0\u0AB2\u0AB3\u0AB5-\u0AB9\u0ABD-\u0AC5\u0AC7-\u0AC9\u0ACB\u0ACC\u0AD0\u0AE0-\u0AE3\u0AF9-\u0AFC\u0B01-\u0B03\u0B05-\u0B0C\u0B0F\u0B10\u0B13-\u0B28\u0B2A-\u0B30\u0B32\u0B33\u0B35-\u0B39\u0B3D-\u0B44\u0B47\u0B48\u0B4B\u0B4C\u0B56\u0B57\u0B5C\u0B5D\u0B5F-\u0B63\u0B71\u0B82\u0B83\u0B85-\u0B8A\u0B8E-\u0B90\u0B92-\u0B95\u0B99\u0B9A\u0B9C\u0B9E\u0B9F\u0BA3\u0BA4\u0BA8-\u0BAA\u0BAE-\u0BB9\u0BBE-\u0BC2\u0BC6-\u0BC8\u0BCA-\u0BCC\u0BD0\u0BD7\u0C00-\u0C03\u0C05-\u0C0C\u0C0E-\u0C10\u0C12-\u0C28\u0C2A-\u0C39\u0C3D-\u0C44\u0C46-\u0C48\u0C4A-\u0C4C\u0C55\u0C56\u0C58-\u0C5A\u0C60-\u0C63\u0C80-\u0C83\u0C85-\u0C8C\u0C8E-\u0C90\u0C92-\u0CA8\u0CAA-\u0CB3\u0CB5-\u0CB9\u0CBD-\u0CC4\u0CC6-\u0CC8\u0CCA-\u0CCC\u0CD5\u0CD6\u0CDE\u0CE0-\u0CE3\u0CF1\u0CF2\u0D00-\u0D03\u0D05-\u0D0C\u0D0E-\u0D10\u0D12-\u0D3A\u0D3D-\u0D44\u0D46-\u0D48\u0D4A-\u0D4C\u0D4E\u0D54-\u0D57\u0D5F-\u0D63\u0D7A-\u0D7F\u0D82\u0D83\u0D85-\u0D96\u0D9A-\u0DB1\u0DB3-\u0DBB\u0DBD\u0DC0-\u0DC6\u0DCF-\u0DD4\u0DD6\u0DD8-\u0DDF\u0DF2\u0DF3\u0E01-\u0E3A\u0E40-\u0E46\u0E4D\u0E81\u0E82\u0E84\u0E87\u0E88\u0E8A\u0E8D\u0E94-\u0E97\u0E99-\u0E9F\u0EA1-\u0EA3\u0EA5\u0EA7\u0EAA\u0EAB\u0EAD-\u0EB9\u0EBB-\u0EBD\u0EC0-\u0EC4\u0EC6\u0ECD\u0EDC-\u0EDF\u0F00\u0F40-\u0F47\u0F49-\u0F6C\u0F71-\u0F81\u0F88-\u0F97\u0F99-\u0FBC\u1000-\u1036\u1038\u103B-\u103F\u1050-\u1062\u1065-\u1068\u106E-\u1086\u108E\u109C\u109D\u10A0-\u10C5\u10C7\u10CD\u10D0-\u10FA\u10FC-\u1248\u124A-\u124D\u1250-\u1256\u1258\u125A-\u125D\u1260-\u1288\u128A-\u128D\u1290-\u12B0\u12B2-\u12B5\u12B8-\u12BE\u12C0\u12C2-\u12C5\u12C8-\u12D6\u12D8-\u1310\u1312-\u1315\u1318-\u135A\u135F\u1380-\u138F\u13A0-\u13F5\u13F8-\u13FD\u1401-\u166C\u166F-\u167F\u1681-\u169A\u16A0-\u16EA\u16EE-\u16F8\u1700-\u170C\u170E-\u1713\u1720-\u1733\u1740-\u1753\u1760-\u176C\u176E-\u1770\u1772\u1773\u1780-\u17B3\u17B6-\u17C8\u17D7\u17DC\u1820-\u1878\u1880-\u18AA\u18B0-\u18F5\u1900-\u191E\u1920-\u192B\u1930-\u1938\u1950-\u196D\u1970-\u1974\u1980-\u19AB\u19B0-\u19C9\u1A00-\u1A1B\u1A20-\u1A5E\u1A61-\u1A74\u1AA7\u1B00-\u1B33\u1B35-\u1B43\u1B45-\u1B4B\u1B80-\u1BA9\u1BAC-\u1BAF\u1BBA-\u1BE5\u1BE7-\u1BF1\u1C00-\u1C35\u1C4D-\u1C4F\u1C5A-\u1C7D\u1C80-\u1C88\u1C90-\u1CBA\u1CBD-\u1CBF\u1CE9-\u1CEC\u1CEE-\u1CF3\u1CF5\u1CF6\u1D00-\u1DBF\u1DE7-\u1DF4\u1E00-\u1F15\u1F18-\u1F1D\u1F20-\u1F45\u1F48-\u1F4D\u1F50-\u1F57\u1F59\u1F5B\u1F5D\u1F5F-\u1F7D\u1F80-\u1FB4\u1FB6-\u1FBC\u1FBE\u1FC2-\u1FC4\u1FC6-\u1FCC\u1FD0-\u1FD3\u1FD6-\u1FDB\u1FE0-\u1FEC\u1FF2-\u1FF4\u1FF6-\u1FFC\u2071\u207F\u2090-\u209C\u2102\u2107\u210A-\u2113\u2115\u2119-\u211D\u2124\u2126\u2128\u212A-\u212D\u212F-\u2139\u213C-\u213F\u2145-\u2149\u214E\u2160-\u2188\u24B6-\u24E9\u2C00-\u2C2E\u2C30-\u2C5E\u2C60-\u2CE4\u2CEB-\u2CEE\u2CF2\u2CF3\u2D00-\u2D25\u2D27\u2D2D\u2D30-\u2D67\u2D6F\u2D80-\u2D96\u2DA0-\u2DA6\u2DA8-\u2DAE\u2DB0-\u2DB6\u2DB8-\u2DBE\u2DC0-\u2DC6\u2DC8-\u2DCE\u2DD0-\u2DD6\u2DD8-\u2DDE\u2DE0-\u2DFF\u2E2F\u3005-\u3007\u3021-\u3029\u3031-\u3035\u3038-\u303C\u3041-\u3096\u309D-\u309F\u30A1-\u30FA\u30FC-\u30FF\u3105-\u312F\u3131-\u318E\u31A0-\u31BA\u31F0-\u31FF\u3400-\u4DB5\u4E00-\u9FEF\uA000-\uA48C\uA4D0-\uA4FD\uA500-\uA60C\uA610-\uA61F\uA62A\uA62B\uA640-\uA66E\uA674-\uA67B\uA67F-\uA6EF\uA717-\uA71F\uA722-\uA788\uA78B-\uA7B9\uA7F7-\uA801\uA803-\uA805\uA807-\uA80A\uA80C-\uA827\uA840-\uA873\uA880-\uA8C3\uA8C5\uA8F2-\uA8F7\uA8FB\uA8FD\uA8FE\uA90A-\uA92A\uA930-\uA952\uA960-\uA97C\uA980-\uA9B2\uA9B4-\uA9BF\uA9CF\uA9E0-\uA9E4\uA9E6-\uA9EF\uA9FA-\uA9FE\uAA00-\uAA36\uAA40-\uAA4D\uAA60-\uAA76\uAA7A\uAA7E-\uAABE\uAAC0\uAAC2\uAADB-\uAADD\uAAE0-\uAAEF\uAAF2-\uAAF5\uAB01-\uAB06\uAB09-\uAB0E\uAB11-\uAB16\uAB20-\uAB26\uAB28-\uAB2E\uAB30-\uAB5A\uAB5C-\uAB65\uAB70-\uABEA\uAC00-\uD7A3\uD7B0-\uD7C6\uD7CB-\uD7FB\uF900-\uFA6D\uFA70-\uFAD9\uFB00-\uFB06\uFB13-\uFB17\uFB1D-\uFB28\uFB2A-\uFB36\uFB38-\uFB3C\uFB3E\uFB40\uFB41\uFB43\uFB44\uFB46-\uFBB1\uFBD3-\uFD3D\uFD50-\uFD8F\uFD92-\uFDC7\uFDF0-\uFDFB\uFE70-\uFE74\uFE76-\uFEFC\uFF21-\uFF3A\uFF41-\uFF5A\uFF66-\uFFBE\uFFC2-\uFFC7\uFFCA-\uFFCF\uFFD2-\uFFD7\uFFDA-\uFFDC', + 'astral': '\uD800[\uDC00-\uDC0B\uDC0D-\uDC26\uDC28-\uDC3A\uDC3C\uDC3D\uDC3F-\uDC4D\uDC50-\uDC5D\uDC80-\uDCFA\uDD40-\uDD74\uDE80-\uDE9C\uDEA0-\uDED0\uDF00-\uDF1F\uDF2D-\uDF4A\uDF50-\uDF7A\uDF80-\uDF9D\uDFA0-\uDFC3\uDFC8-\uDFCF\uDFD1-\uDFD5]|\uD801[\uDC00-\uDC9D\uDCB0-\uDCD3\uDCD8-\uDCFB\uDD00-\uDD27\uDD30-\uDD63\uDE00-\uDF36\uDF40-\uDF55\uDF60-\uDF67]|\uD802[\uDC00-\uDC05\uDC08\uDC0A-\uDC35\uDC37\uDC38\uDC3C\uDC3F-\uDC55\uDC60-\uDC76\uDC80-\uDC9E\uDCE0-\uDCF2\uDCF4\uDCF5\uDD00-\uDD15\uDD20-\uDD39\uDD80-\uDDB7\uDDBE\uDDBF\uDE00-\uDE03\uDE05\uDE06\uDE0C-\uDE13\uDE15-\uDE17\uDE19-\uDE35\uDE60-\uDE7C\uDE80-\uDE9C\uDEC0-\uDEC7\uDEC9-\uDEE4\uDF00-\uDF35\uDF40-\uDF55\uDF60-\uDF72\uDF80-\uDF91]|\uD803[\uDC00-\uDC48\uDC80-\uDCB2\uDCC0-\uDCF2\uDD00-\uDD27\uDF00-\uDF1C\uDF27\uDF30-\uDF45]|\uD804[\uDC00-\uDC45\uDC82-\uDCB8\uDCD0-\uDCE8\uDD00-\uDD32\uDD44-\uDD46\uDD50-\uDD72\uDD76\uDD80-\uDDBF\uDDC1-\uDDC4\uDDDA\uDDDC\uDE00-\uDE11\uDE13-\uDE34\uDE37\uDE3E\uDE80-\uDE86\uDE88\uDE8A-\uDE8D\uDE8F-\uDE9D\uDE9F-\uDEA8\uDEB0-\uDEE8\uDF00-\uDF03\uDF05-\uDF0C\uDF0F\uDF10\uDF13-\uDF28\uDF2A-\uDF30\uDF32\uDF33\uDF35-\uDF39\uDF3D-\uDF44\uDF47\uDF48\uDF4B\uDF4C\uDF50\uDF57\uDF5D-\uDF63]|\uD805[\uDC00-\uDC41\uDC43-\uDC45\uDC47-\uDC4A\uDC80-\uDCC1\uDCC4\uDCC5\uDCC7\uDD80-\uDDB5\uDDB8-\uDDBE\uDDD8-\uDDDD\uDE00-\uDE3E\uDE40\uDE44\uDE80-\uDEB5\uDF00-\uDF1A\uDF1D-\uDF2A]|\uD806[\uDC00-\uDC38\uDCA0-\uDCDF\uDCFF\uDE00-\uDE32\uDE35-\uDE3E\uDE50-\uDE83\uDE86-\uDE97\uDE9D\uDEC0-\uDEF8]|\uD807[\uDC00-\uDC08\uDC0A-\uDC36\uDC38-\uDC3E\uDC40\uDC72-\uDC8F\uDC92-\uDCA7\uDCA9-\uDCB6\uDD00-\uDD06\uDD08\uDD09\uDD0B-\uDD36\uDD3A\uDD3C\uDD3D\uDD3F-\uDD41\uDD43\uDD46\uDD47\uDD60-\uDD65\uDD67\uDD68\uDD6A-\uDD8E\uDD90\uDD91\uDD93-\uDD96\uDD98\uDEE0-\uDEF6]|\uD808[\uDC00-\uDF99]|\uD809[\uDC00-\uDC6E\uDC80-\uDD43]|[\uD80C\uD81C-\uD820\uD840-\uD868\uD86A-\uD86C\uD86F-\uD872\uD874-\uD879][\uDC00-\uDFFF]|\uD80D[\uDC00-\uDC2E]|\uD811[\uDC00-\uDE46]|\uD81A[\uDC00-\uDE38\uDE40-\uDE5E\uDED0-\uDEED\uDF00-\uDF36\uDF40-\uDF43\uDF63-\uDF77\uDF7D-\uDF8F]|\uD81B[\uDE40-\uDE7F\uDF00-\uDF44\uDF50-\uDF7E\uDF93-\uDF9F\uDFE0\uDFE1]|\uD821[\uDC00-\uDFF1]|\uD822[\uDC00-\uDEF2]|\uD82C[\uDC00-\uDD1E\uDD70-\uDEFB]|\uD82F[\uDC00-\uDC6A\uDC70-\uDC7C\uDC80-\uDC88\uDC90-\uDC99\uDC9E]|\uD835[\uDC00-\uDC54\uDC56-\uDC9C\uDC9E\uDC9F\uDCA2\uDCA5\uDCA6\uDCA9-\uDCAC\uDCAE-\uDCB9\uDCBB\uDCBD-\uDCC3\uDCC5-\uDD05\uDD07-\uDD0A\uDD0D-\uDD14\uDD16-\uDD1C\uDD1E-\uDD39\uDD3B-\uDD3E\uDD40-\uDD44\uDD46\uDD4A-\uDD50\uDD52-\uDEA5\uDEA8-\uDEC0\uDEC2-\uDEDA\uDEDC-\uDEFA\uDEFC-\uDF14\uDF16-\uDF34\uDF36-\uDF4E\uDF50-\uDF6E\uDF70-\uDF88\uDF8A-\uDFA8\uDFAA-\uDFC2\uDFC4-\uDFCB]|\uD838[\uDC00-\uDC06\uDC08-\uDC18\uDC1B-\uDC21\uDC23\uDC24\uDC26-\uDC2A]|\uD83A[\uDC00-\uDCC4\uDD00-\uDD43\uDD47]|\uD83B[\uDE00-\uDE03\uDE05-\uDE1F\uDE21\uDE22\uDE24\uDE27\uDE29-\uDE32\uDE34-\uDE37\uDE39\uDE3B\uDE42\uDE47\uDE49\uDE4B\uDE4D-\uDE4F\uDE51\uDE52\uDE54\uDE57\uDE59\uDE5B\uDE5D\uDE5F\uDE61\uDE62\uDE64\uDE67-\uDE6A\uDE6C-\uDE72\uDE74-\uDE77\uDE79-\uDE7C\uDE7E\uDE80-\uDE89\uDE8B-\uDE9B\uDEA1-\uDEA3\uDEA5-\uDEA9\uDEAB-\uDEBB]|\uD83C[\uDD30-\uDD49\uDD50-\uDD69\uDD70-\uDD89]|\uD869[\uDC00-\uDED6\uDF00-\uDFFF]|\uD86D[\uDC00-\uDF34\uDF40-\uDFFF]|\uD86E[\uDC00-\uDC1D\uDC20-\uDFFF]|\uD873[\uDC00-\uDEA1\uDEB0-\uDFFF]|\uD87A[\uDC00-\uDFE0]|\uD87E[\uDC00-\uDE1D]' + }, + { + 'name': 'Any', + 'isBmpLast': true, + 'bmp': '\0-\uFFFF', + 'astral': '[\uD800-\uDBFF][\uDC00-\uDFFF]' + }, + { + 'name': 'Default_Ignorable_Code_Point', + 'bmp': '\xAD\u034F\u061C\u115F\u1160\u17B4\u17B5\u180B-\u180E\u200B-\u200F\u202A-\u202E\u2060-\u206F\u3164\uFE00-\uFE0F\uFEFF\uFFA0\uFFF0-\uFFF8', + 'astral': '\uD82F[\uDCA0-\uDCA3]|\uD834[\uDD73-\uDD7A]|[\uDB40-\uDB43][\uDC00-\uDFFF]' + }, + { + 'name': 'Lowercase', + 'bmp': 'a-z\xAA\xB5\xBA\xDF-\xF6\xF8-\xFF\u0101\u0103\u0105\u0107\u0109\u010B\u010D\u010F\u0111\u0113\u0115\u0117\u0119\u011B\u011D\u011F\u0121\u0123\u0125\u0127\u0129\u012B\u012D\u012F\u0131\u0133\u0135\u0137\u0138\u013A\u013C\u013E\u0140\u0142\u0144\u0146\u0148\u0149\u014B\u014D\u014F\u0151\u0153\u0155\u0157\u0159\u015B\u015D\u015F\u0161\u0163\u0165\u0167\u0169\u016B\u016D\u016F\u0171\u0173\u0175\u0177\u017A\u017C\u017E-\u0180\u0183\u0185\u0188\u018C\u018D\u0192\u0195\u0199-\u019B\u019E\u01A1\u01A3\u01A5\u01A8\u01AA\u01AB\u01AD\u01B0\u01B4\u01B6\u01B9\u01BA\u01BD-\u01BF\u01C6\u01C9\u01CC\u01CE\u01D0\u01D2\u01D4\u01D6\u01D8\u01DA\u01DC\u01DD\u01DF\u01E1\u01E3\u01E5\u01E7\u01E9\u01EB\u01ED\u01EF\u01F0\u01F3\u01F5\u01F9\u01FB\u01FD\u01FF\u0201\u0203\u0205\u0207\u0209\u020B\u020D\u020F\u0211\u0213\u0215\u0217\u0219\u021B\u021D\u021F\u0221\u0223\u0225\u0227\u0229\u022B\u022D\u022F\u0231\u0233-\u0239\u023C\u023F\u0240\u0242\u0247\u0249\u024B\u024D\u024F-\u0293\u0295-\u02B8\u02C0\u02C1\u02E0-\u02E4\u0345\u0371\u0373\u0377\u037A-\u037D\u0390\u03AC-\u03CE\u03D0\u03D1\u03D5-\u03D7\u03D9\u03DB\u03DD\u03DF\u03E1\u03E3\u03E5\u03E7\u03E9\u03EB\u03ED\u03EF-\u03F3\u03F5\u03F8\u03FB\u03FC\u0430-\u045F\u0461\u0463\u0465\u0467\u0469\u046B\u046D\u046F\u0471\u0473\u0475\u0477\u0479\u047B\u047D\u047F\u0481\u048B\u048D\u048F\u0491\u0493\u0495\u0497\u0499\u049B\u049D\u049F\u04A1\u04A3\u04A5\u04A7\u04A9\u04AB\u04AD\u04AF\u04B1\u04B3\u04B5\u04B7\u04B9\u04BB\u04BD\u04BF\u04C2\u04C4\u04C6\u04C8\u04CA\u04CC\u04CE\u04CF\u04D1\u04D3\u04D5\u04D7\u04D9\u04DB\u04DD\u04DF\u04E1\u04E3\u04E5\u04E7\u04E9\u04EB\u04ED\u04EF\u04F1\u04F3\u04F5\u04F7\u04F9\u04FB\u04FD\u04FF\u0501\u0503\u0505\u0507\u0509\u050B\u050D\u050F\u0511\u0513\u0515\u0517\u0519\u051B\u051D\u051F\u0521\u0523\u0525\u0527\u0529\u052B\u052D\u052F\u0560-\u0588\u10D0-\u10FA\u10FD-\u10FF\u13F8-\u13FD\u1C80-\u1C88\u1D00-\u1DBF\u1E01\u1E03\u1E05\u1E07\u1E09\u1E0B\u1E0D\u1E0F\u1E11\u1E13\u1E15\u1E17\u1E19\u1E1B\u1E1D\u1E1F\u1E21\u1E23\u1E25\u1E27\u1E29\u1E2B\u1E2D\u1E2F\u1E31\u1E33\u1E35\u1E37\u1E39\u1E3B\u1E3D\u1E3F\u1E41\u1E43\u1E45\u1E47\u1E49\u1E4B\u1E4D\u1E4F\u1E51\u1E53\u1E55\u1E57\u1E59\u1E5B\u1E5D\u1E5F\u1E61\u1E63\u1E65\u1E67\u1E69\u1E6B\u1E6D\u1E6F\u1E71\u1E73\u1E75\u1E77\u1E79\u1E7B\u1E7D\u1E7F\u1E81\u1E83\u1E85\u1E87\u1E89\u1E8B\u1E8D\u1E8F\u1E91\u1E93\u1E95-\u1E9D\u1E9F\u1EA1\u1EA3\u1EA5\u1EA7\u1EA9\u1EAB\u1EAD\u1EAF\u1EB1\u1EB3\u1EB5\u1EB7\u1EB9\u1EBB\u1EBD\u1EBF\u1EC1\u1EC3\u1EC5\u1EC7\u1EC9\u1ECB\u1ECD\u1ECF\u1ED1\u1ED3\u1ED5\u1ED7\u1ED9\u1EDB\u1EDD\u1EDF\u1EE1\u1EE3\u1EE5\u1EE7\u1EE9\u1EEB\u1EED\u1EEF\u1EF1\u1EF3\u1EF5\u1EF7\u1EF9\u1EFB\u1EFD\u1EFF-\u1F07\u1F10-\u1F15\u1F20-\u1F27\u1F30-\u1F37\u1F40-\u1F45\u1F50-\u1F57\u1F60-\u1F67\u1F70-\u1F7D\u1F80-\u1F87\u1F90-\u1F97\u1FA0-\u1FA7\u1FB0-\u1FB4\u1FB6\u1FB7\u1FBE\u1FC2-\u1FC4\u1FC6\u1FC7\u1FD0-\u1FD3\u1FD6\u1FD7\u1FE0-\u1FE7\u1FF2-\u1FF4\u1FF6\u1FF7\u2071\u207F\u2090-\u209C\u210A\u210E\u210F\u2113\u212F\u2134\u2139\u213C\u213D\u2146-\u2149\u214E\u2170-\u217F\u2184\u24D0-\u24E9\u2C30-\u2C5E\u2C61\u2C65\u2C66\u2C68\u2C6A\u2C6C\u2C71\u2C73\u2C74\u2C76-\u2C7D\u2C81\u2C83\u2C85\u2C87\u2C89\u2C8B\u2C8D\u2C8F\u2C91\u2C93\u2C95\u2C97\u2C99\u2C9B\u2C9D\u2C9F\u2CA1\u2CA3\u2CA5\u2CA7\u2CA9\u2CAB\u2CAD\u2CAF\u2CB1\u2CB3\u2CB5\u2CB7\u2CB9\u2CBB\u2CBD\u2CBF\u2CC1\u2CC3\u2CC5\u2CC7\u2CC9\u2CCB\u2CCD\u2CCF\u2CD1\u2CD3\u2CD5\u2CD7\u2CD9\u2CDB\u2CDD\u2CDF\u2CE1\u2CE3\u2CE4\u2CEC\u2CEE\u2CF3\u2D00-\u2D25\u2D27\u2D2D\uA641\uA643\uA645\uA647\uA649\uA64B\uA64D\uA64F\uA651\uA653\uA655\uA657\uA659\uA65B\uA65D\uA65F\uA661\uA663\uA665\uA667\uA669\uA66B\uA66D\uA681\uA683\uA685\uA687\uA689\uA68B\uA68D\uA68F\uA691\uA693\uA695\uA697\uA699\uA69B-\uA69D\uA723\uA725\uA727\uA729\uA72B\uA72D\uA72F-\uA731\uA733\uA735\uA737\uA739\uA73B\uA73D\uA73F\uA741\uA743\uA745\uA747\uA749\uA74B\uA74D\uA74F\uA751\uA753\uA755\uA757\uA759\uA75B\uA75D\uA75F\uA761\uA763\uA765\uA767\uA769\uA76B\uA76D\uA76F-\uA778\uA77A\uA77C\uA77F\uA781\uA783\uA785\uA787\uA78C\uA78E\uA791\uA793-\uA795\uA797\uA799\uA79B\uA79D\uA79F\uA7A1\uA7A3\uA7A5\uA7A7\uA7A9\uA7AF\uA7B5\uA7B7\uA7B9\uA7F8-\uA7FA\uAB30-\uAB5A\uAB5C-\uAB65\uAB70-\uABBF\uFB00-\uFB06\uFB13-\uFB17\uFF41-\uFF5A', + 'astral': '\uD801[\uDC28-\uDC4F\uDCD8-\uDCFB]|\uD803[\uDCC0-\uDCF2]|\uD806[\uDCC0-\uDCDF]|\uD81B[\uDE60-\uDE7F]|\uD835[\uDC1A-\uDC33\uDC4E-\uDC54\uDC56-\uDC67\uDC82-\uDC9B\uDCB6-\uDCB9\uDCBB\uDCBD-\uDCC3\uDCC5-\uDCCF\uDCEA-\uDD03\uDD1E-\uDD37\uDD52-\uDD6B\uDD86-\uDD9F\uDDBA-\uDDD3\uDDEE-\uDE07\uDE22-\uDE3B\uDE56-\uDE6F\uDE8A-\uDEA5\uDEC2-\uDEDA\uDEDC-\uDEE1\uDEFC-\uDF14\uDF16-\uDF1B\uDF36-\uDF4E\uDF50-\uDF55\uDF70-\uDF88\uDF8A-\uDF8F\uDFAA-\uDFC2\uDFC4-\uDFC9\uDFCB]|\uD83A[\uDD22-\uDD43]' + }, + { + 'name': 'Noncharacter_Code_Point', + 'bmp': '\uFDD0-\uFDEF\uFFFE\uFFFF', + 'astral': '[\uD83F\uD87F\uD8BF\uD8FF\uD93F\uD97F\uD9BF\uD9FF\uDA3F\uDA7F\uDABF\uDAFF\uDB3F\uDB7F\uDBBF\uDBFF][\uDFFE\uDFFF]' + }, + { + 'name': 'Uppercase', + 'bmp': 'A-Z\xC0-\xD6\xD8-\xDE\u0100\u0102\u0104\u0106\u0108\u010A\u010C\u010E\u0110\u0112\u0114\u0116\u0118\u011A\u011C\u011E\u0120\u0122\u0124\u0126\u0128\u012A\u012C\u012E\u0130\u0132\u0134\u0136\u0139\u013B\u013D\u013F\u0141\u0143\u0145\u0147\u014A\u014C\u014E\u0150\u0152\u0154\u0156\u0158\u015A\u015C\u015E\u0160\u0162\u0164\u0166\u0168\u016A\u016C\u016E\u0170\u0172\u0174\u0176\u0178\u0179\u017B\u017D\u0181\u0182\u0184\u0186\u0187\u0189-\u018B\u018E-\u0191\u0193\u0194\u0196-\u0198\u019C\u019D\u019F\u01A0\u01A2\u01A4\u01A6\u01A7\u01A9\u01AC\u01AE\u01AF\u01B1-\u01B3\u01B5\u01B7\u01B8\u01BC\u01C4\u01C7\u01CA\u01CD\u01CF\u01D1\u01D3\u01D5\u01D7\u01D9\u01DB\u01DE\u01E0\u01E2\u01E4\u01E6\u01E8\u01EA\u01EC\u01EE\u01F1\u01F4\u01F6-\u01F8\u01FA\u01FC\u01FE\u0200\u0202\u0204\u0206\u0208\u020A\u020C\u020E\u0210\u0212\u0214\u0216\u0218\u021A\u021C\u021E\u0220\u0222\u0224\u0226\u0228\u022A\u022C\u022E\u0230\u0232\u023A\u023B\u023D\u023E\u0241\u0243-\u0246\u0248\u024A\u024C\u024E\u0370\u0372\u0376\u037F\u0386\u0388-\u038A\u038C\u038E\u038F\u0391-\u03A1\u03A3-\u03AB\u03CF\u03D2-\u03D4\u03D8\u03DA\u03DC\u03DE\u03E0\u03E2\u03E4\u03E6\u03E8\u03EA\u03EC\u03EE\u03F4\u03F7\u03F9\u03FA\u03FD-\u042F\u0460\u0462\u0464\u0466\u0468\u046A\u046C\u046E\u0470\u0472\u0474\u0476\u0478\u047A\u047C\u047E\u0480\u048A\u048C\u048E\u0490\u0492\u0494\u0496\u0498\u049A\u049C\u049E\u04A0\u04A2\u04A4\u04A6\u04A8\u04AA\u04AC\u04AE\u04B0\u04B2\u04B4\u04B6\u04B8\u04BA\u04BC\u04BE\u04C0\u04C1\u04C3\u04C5\u04C7\u04C9\u04CB\u04CD\u04D0\u04D2\u04D4\u04D6\u04D8\u04DA\u04DC\u04DE\u04E0\u04E2\u04E4\u04E6\u04E8\u04EA\u04EC\u04EE\u04F0\u04F2\u04F4\u04F6\u04F8\u04FA\u04FC\u04FE\u0500\u0502\u0504\u0506\u0508\u050A\u050C\u050E\u0510\u0512\u0514\u0516\u0518\u051A\u051C\u051E\u0520\u0522\u0524\u0526\u0528\u052A\u052C\u052E\u0531-\u0556\u10A0-\u10C5\u10C7\u10CD\u13A0-\u13F5\u1C90-\u1CBA\u1CBD-\u1CBF\u1E00\u1E02\u1E04\u1E06\u1E08\u1E0A\u1E0C\u1E0E\u1E10\u1E12\u1E14\u1E16\u1E18\u1E1A\u1E1C\u1E1E\u1E20\u1E22\u1E24\u1E26\u1E28\u1E2A\u1E2C\u1E2E\u1E30\u1E32\u1E34\u1E36\u1E38\u1E3A\u1E3C\u1E3E\u1E40\u1E42\u1E44\u1E46\u1E48\u1E4A\u1E4C\u1E4E\u1E50\u1E52\u1E54\u1E56\u1E58\u1E5A\u1E5C\u1E5E\u1E60\u1E62\u1E64\u1E66\u1E68\u1E6A\u1E6C\u1E6E\u1E70\u1E72\u1E74\u1E76\u1E78\u1E7A\u1E7C\u1E7E\u1E80\u1E82\u1E84\u1E86\u1E88\u1E8A\u1E8C\u1E8E\u1E90\u1E92\u1E94\u1E9E\u1EA0\u1EA2\u1EA4\u1EA6\u1EA8\u1EAA\u1EAC\u1EAE\u1EB0\u1EB2\u1EB4\u1EB6\u1EB8\u1EBA\u1EBC\u1EBE\u1EC0\u1EC2\u1EC4\u1EC6\u1EC8\u1ECA\u1ECC\u1ECE\u1ED0\u1ED2\u1ED4\u1ED6\u1ED8\u1EDA\u1EDC\u1EDE\u1EE0\u1EE2\u1EE4\u1EE6\u1EE8\u1EEA\u1EEC\u1EEE\u1EF0\u1EF2\u1EF4\u1EF6\u1EF8\u1EFA\u1EFC\u1EFE\u1F08-\u1F0F\u1F18-\u1F1D\u1F28-\u1F2F\u1F38-\u1F3F\u1F48-\u1F4D\u1F59\u1F5B\u1F5D\u1F5F\u1F68-\u1F6F\u1FB8-\u1FBB\u1FC8-\u1FCB\u1FD8-\u1FDB\u1FE8-\u1FEC\u1FF8-\u1FFB\u2102\u2107\u210B-\u210D\u2110-\u2112\u2115\u2119-\u211D\u2124\u2126\u2128\u212A-\u212D\u2130-\u2133\u213E\u213F\u2145\u2160-\u216F\u2183\u24B6-\u24CF\u2C00-\u2C2E\u2C60\u2C62-\u2C64\u2C67\u2C69\u2C6B\u2C6D-\u2C70\u2C72\u2C75\u2C7E-\u2C80\u2C82\u2C84\u2C86\u2C88\u2C8A\u2C8C\u2C8E\u2C90\u2C92\u2C94\u2C96\u2C98\u2C9A\u2C9C\u2C9E\u2CA0\u2CA2\u2CA4\u2CA6\u2CA8\u2CAA\u2CAC\u2CAE\u2CB0\u2CB2\u2CB4\u2CB6\u2CB8\u2CBA\u2CBC\u2CBE\u2CC0\u2CC2\u2CC4\u2CC6\u2CC8\u2CCA\u2CCC\u2CCE\u2CD0\u2CD2\u2CD4\u2CD6\u2CD8\u2CDA\u2CDC\u2CDE\u2CE0\u2CE2\u2CEB\u2CED\u2CF2\uA640\uA642\uA644\uA646\uA648\uA64A\uA64C\uA64E\uA650\uA652\uA654\uA656\uA658\uA65A\uA65C\uA65E\uA660\uA662\uA664\uA666\uA668\uA66A\uA66C\uA680\uA682\uA684\uA686\uA688\uA68A\uA68C\uA68E\uA690\uA692\uA694\uA696\uA698\uA69A\uA722\uA724\uA726\uA728\uA72A\uA72C\uA72E\uA732\uA734\uA736\uA738\uA73A\uA73C\uA73E\uA740\uA742\uA744\uA746\uA748\uA74A\uA74C\uA74E\uA750\uA752\uA754\uA756\uA758\uA75A\uA75C\uA75E\uA760\uA762\uA764\uA766\uA768\uA76A\uA76C\uA76E\uA779\uA77B\uA77D\uA77E\uA780\uA782\uA784\uA786\uA78B\uA78D\uA790\uA792\uA796\uA798\uA79A\uA79C\uA79E\uA7A0\uA7A2\uA7A4\uA7A6\uA7A8\uA7AA-\uA7AE\uA7B0-\uA7B4\uA7B6\uA7B8\uFF21-\uFF3A', + 'astral': '\uD801[\uDC00-\uDC27\uDCB0-\uDCD3]|\uD803[\uDC80-\uDCB2]|\uD806[\uDCA0-\uDCBF]|\uD81B[\uDE40-\uDE5F]|\uD835[\uDC00-\uDC19\uDC34-\uDC4D\uDC68-\uDC81\uDC9C\uDC9E\uDC9F\uDCA2\uDCA5\uDCA6\uDCA9-\uDCAC\uDCAE-\uDCB5\uDCD0-\uDCE9\uDD04\uDD05\uDD07-\uDD0A\uDD0D-\uDD14\uDD16-\uDD1C\uDD38\uDD39\uDD3B-\uDD3E\uDD40-\uDD44\uDD46\uDD4A-\uDD50\uDD6C-\uDD85\uDDA0-\uDDB9\uDDD4-\uDDED\uDE08-\uDE21\uDE3C-\uDE55\uDE70-\uDE89\uDEA8-\uDEC0\uDEE2-\uDEFA\uDF1C-\uDF34\uDF56-\uDF6E\uDF90-\uDFA8\uDFCA]|\uD83A[\uDD00-\uDD21]|\uD83C[\uDD30-\uDD49\uDD50-\uDD69\uDD70-\uDD89]' + }, + { + 'name': 'White_Space', + 'bmp': '\t-\r \x85\xA0\u1680\u2000-\u200A\u2028\u2029\u202F\u205F\u3000' + } +]; + +var unicodeProperties = createCommonjsModule(function (module, exports) { +"use strict"; + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.default = void 0; + +var _properties = _interopRequireDefault(properties); + +function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } + +/*! + * XRegExp Unicode Properties 4.2.0 + * + * Steven Levithan (c) 2012-present MIT License + * Unicode data by Mathias Bynens + */ +var _default = function _default(XRegExp) { + /** + * Adds properties to meet the UTS #18 Level 1 RL1.2 requirements for Unicode regex support. See + * . Following are definitions of these properties from + * UAX #44 : + * + * - Alphabetic + * Characters with the Alphabetic property. Generated from: Lowercase + Uppercase + Lt + Lm + + * Lo + Nl + Other_Alphabetic. + * + * - Default_Ignorable_Code_Point + * For programmatic determination of default ignorable code points. New characters that should + * be ignored in rendering (unless explicitly supported) will be assigned in these ranges, + * permitting programs to correctly handle the default rendering of such characters when not + * otherwise supported. + * + * - Lowercase + * Characters with the Lowercase property. Generated from: Ll + Other_Lowercase. + * + * - Noncharacter_Code_Point + * Code points permanently reserved for internal use. + * + * - Uppercase + * Characters with the Uppercase property. Generated from: Lu + Other_Uppercase. + * + * - White_Space + * Spaces, separator characters and other control characters which should be treated by + * programming languages as "white space" for the purpose of parsing elements. + * + * The properties ASCII, Any, and Assigned are also included but are not defined in UAX #44. UTS + * #18 RL1.2 additionally requires support for Unicode scripts and general categories. These are + * included in XRegExp's Unicode Categories and Unicode Scripts addons. + * + * Token names are case insensitive, and any spaces, hyphens, and underscores are ignored. + * + * Uses Unicode 11.0.0. + * + * @requires XRegExp, Unicode Base + */ + if (!XRegExp.addUnicodeData) { + throw new ReferenceError('Unicode Base must be loaded before Unicode Properties'); + } + + var unicodeData = _properties.default; // Add non-generated data + + unicodeData.push({ + name: 'Assigned', + // Since this is defined as the inverse of Unicode category Cn (Unassigned), the Unicode + // Categories addon is required to use this property + inverseOf: 'Cn' + }); + XRegExp.addUnicodeData(unicodeData); +}; + +exports.default = _default; +module.exports = exports["default"]; +}); + +unwrapExports(unicodeProperties); + +var scripts = [ + { + 'name': 'Adlam', + 'astral': '\uD83A[\uDD00-\uDD4A\uDD50-\uDD59\uDD5E\uDD5F]' + }, + { + 'name': 'Ahom', + 'astral': '\uD805[\uDF00-\uDF1A\uDF1D-\uDF2B\uDF30-\uDF3F]' + }, + { + 'name': 'Anatolian_Hieroglyphs', + 'astral': '\uD811[\uDC00-\uDE46]' + }, + { + 'name': 'Arabic', + 'bmp': '\u0600-\u0604\u0606-\u060B\u060D-\u061A\u061C\u061E\u0620-\u063F\u0641-\u064A\u0656-\u066F\u0671-\u06DC\u06DE-\u06FF\u0750-\u077F\u08A0-\u08B4\u08B6-\u08BD\u08D3-\u08E1\u08E3-\u08FF\uFB50-\uFBC1\uFBD3-\uFD3D\uFD50-\uFD8F\uFD92-\uFDC7\uFDF0-\uFDFD\uFE70-\uFE74\uFE76-\uFEFC', + 'astral': '\uD803[\uDE60-\uDE7E]|\uD83B[\uDE00-\uDE03\uDE05-\uDE1F\uDE21\uDE22\uDE24\uDE27\uDE29-\uDE32\uDE34-\uDE37\uDE39\uDE3B\uDE42\uDE47\uDE49\uDE4B\uDE4D-\uDE4F\uDE51\uDE52\uDE54\uDE57\uDE59\uDE5B\uDE5D\uDE5F\uDE61\uDE62\uDE64\uDE67-\uDE6A\uDE6C-\uDE72\uDE74-\uDE77\uDE79-\uDE7C\uDE7E\uDE80-\uDE89\uDE8B-\uDE9B\uDEA1-\uDEA3\uDEA5-\uDEA9\uDEAB-\uDEBB\uDEF0\uDEF1]' + }, + { + 'name': 'Armenian', + 'bmp': '\u0531-\u0556\u0559-\u0588\u058A\u058D-\u058F\uFB13-\uFB17' + }, + { + 'name': 'Avestan', + 'astral': '\uD802[\uDF00-\uDF35\uDF39-\uDF3F]' + }, + { + 'name': 'Balinese', + 'bmp': '\u1B00-\u1B4B\u1B50-\u1B7C' + }, + { + 'name': 'Bamum', + 'bmp': '\uA6A0-\uA6F7', + 'astral': '\uD81A[\uDC00-\uDE38]' + }, + { + 'name': 'Bassa_Vah', + 'astral': '\uD81A[\uDED0-\uDEED\uDEF0-\uDEF5]' + }, + { + 'name': 'Batak', + 'bmp': '\u1BC0-\u1BF3\u1BFC-\u1BFF' + }, + { + 'name': 'Bengali', + 'bmp': '\u0980-\u0983\u0985-\u098C\u098F\u0990\u0993-\u09A8\u09AA-\u09B0\u09B2\u09B6-\u09B9\u09BC-\u09C4\u09C7\u09C8\u09CB-\u09CE\u09D7\u09DC\u09DD\u09DF-\u09E3\u09E6-\u09FE' + }, + { + 'name': 'Bhaiksuki', + 'astral': '\uD807[\uDC00-\uDC08\uDC0A-\uDC36\uDC38-\uDC45\uDC50-\uDC6C]' + }, + { + 'name': 'Bopomofo', + 'bmp': '\u02EA\u02EB\u3105-\u312F\u31A0-\u31BA' + }, + { + 'name': 'Brahmi', + 'astral': '\uD804[\uDC00-\uDC4D\uDC52-\uDC6F\uDC7F]' + }, + { + 'name': 'Braille', + 'bmp': '\u2800-\u28FF' + }, + { + 'name': 'Buginese', + 'bmp': '\u1A00-\u1A1B\u1A1E\u1A1F' + }, + { + 'name': 'Buhid', + 'bmp': '\u1740-\u1753' + }, + { + 'name': 'Canadian_Aboriginal', + 'bmp': '\u1400-\u167F\u18B0-\u18F5' + }, + { + 'name': 'Carian', + 'astral': '\uD800[\uDEA0-\uDED0]' + }, + { + 'name': 'Caucasian_Albanian', + 'astral': '\uD801[\uDD30-\uDD63\uDD6F]' + }, + { + 'name': 'Chakma', + 'astral': '\uD804[\uDD00-\uDD34\uDD36-\uDD46]' + }, + { + 'name': 'Cham', + 'bmp': '\uAA00-\uAA36\uAA40-\uAA4D\uAA50-\uAA59\uAA5C-\uAA5F' + }, + { + 'name': 'Cherokee', + 'bmp': '\u13A0-\u13F5\u13F8-\u13FD\uAB70-\uABBF' + }, + { + 'name': 'Common', + 'bmp': '\0-@\\[-`\\{-\xA9\xAB-\xB9\xBB-\xBF\xD7\xF7\u02B9-\u02DF\u02E5-\u02E9\u02EC-\u02FF\u0374\u037E\u0385\u0387\u0589\u0605\u060C\u061B\u061F\u0640\u06DD\u08E2\u0964\u0965\u0E3F\u0FD5-\u0FD8\u10FB\u16EB-\u16ED\u1735\u1736\u1802\u1803\u1805\u1CD3\u1CE1\u1CE9-\u1CEC\u1CEE-\u1CF3\u1CF5-\u1CF7\u2000-\u200B\u200E-\u2064\u2066-\u2070\u2074-\u207E\u2080-\u208E\u20A0-\u20BF\u2100-\u2125\u2127-\u2129\u212C-\u2131\u2133-\u214D\u214F-\u215F\u2189-\u218B\u2190-\u2426\u2440-\u244A\u2460-\u27FF\u2900-\u2B73\u2B76-\u2B95\u2B98-\u2BC8\u2BCA-\u2BFE\u2E00-\u2E4E\u2FF0-\u2FFB\u3000-\u3004\u3006\u3008-\u3020\u3030-\u3037\u303C-\u303F\u309B\u309C\u30A0\u30FB\u30FC\u3190-\u319F\u31C0-\u31E3\u3220-\u325F\u327F-\u32CF\u3358-\u33FF\u4DC0-\u4DFF\uA700-\uA721\uA788-\uA78A\uA830-\uA839\uA92E\uA9CF\uAB5B\uFD3E\uFD3F\uFE10-\uFE19\uFE30-\uFE52\uFE54-\uFE66\uFE68-\uFE6B\uFEFF\uFF01-\uFF20\uFF3B-\uFF40\uFF5B-\uFF65\uFF70\uFF9E\uFF9F\uFFE0-\uFFE6\uFFE8-\uFFEE\uFFF9-\uFFFD', + 'astral': '\uD800[\uDD00-\uDD02\uDD07-\uDD33\uDD37-\uDD3F\uDD90-\uDD9B\uDDD0-\uDDFC\uDEE1-\uDEFB]|\uD82F[\uDCA0-\uDCA3]|\uD834[\uDC00-\uDCF5\uDD00-\uDD26\uDD29-\uDD66\uDD6A-\uDD7A\uDD83\uDD84\uDD8C-\uDDA9\uDDAE-\uDDE8\uDEE0-\uDEF3\uDF00-\uDF56\uDF60-\uDF78]|\uD835[\uDC00-\uDC54\uDC56-\uDC9C\uDC9E\uDC9F\uDCA2\uDCA5\uDCA6\uDCA9-\uDCAC\uDCAE-\uDCB9\uDCBB\uDCBD-\uDCC3\uDCC5-\uDD05\uDD07-\uDD0A\uDD0D-\uDD14\uDD16-\uDD1C\uDD1E-\uDD39\uDD3B-\uDD3E\uDD40-\uDD44\uDD46\uDD4A-\uDD50\uDD52-\uDEA5\uDEA8-\uDFCB\uDFCE-\uDFFF]|\uD83B[\uDC71-\uDCB4]|\uD83C[\uDC00-\uDC2B\uDC30-\uDC93\uDCA0-\uDCAE\uDCB1-\uDCBF\uDCC1-\uDCCF\uDCD1-\uDCF5\uDD00-\uDD0C\uDD10-\uDD6B\uDD70-\uDDAC\uDDE6-\uDDFF\uDE01\uDE02\uDE10-\uDE3B\uDE40-\uDE48\uDE50\uDE51\uDE60-\uDE65\uDF00-\uDFFF]|\uD83D[\uDC00-\uDED4\uDEE0-\uDEEC\uDEF0-\uDEF9\uDF00-\uDF73\uDF80-\uDFD8]|\uD83E[\uDC00-\uDC0B\uDC10-\uDC47\uDC50-\uDC59\uDC60-\uDC87\uDC90-\uDCAD\uDD00-\uDD0B\uDD10-\uDD3E\uDD40-\uDD70\uDD73-\uDD76\uDD7A\uDD7C-\uDDA2\uDDB0-\uDDB9\uDDC0-\uDDC2\uDDD0-\uDDFF\uDE60-\uDE6D]|\uDB40[\uDC01\uDC20-\uDC7F]' + }, + { + 'name': 'Coptic', + 'bmp': '\u03E2-\u03EF\u2C80-\u2CF3\u2CF9-\u2CFF' + }, + { + 'name': 'Cuneiform', + 'astral': '\uD808[\uDC00-\uDF99]|\uD809[\uDC00-\uDC6E\uDC70-\uDC74\uDC80-\uDD43]' + }, + { + 'name': 'Cypriot', + 'astral': '\uD802[\uDC00-\uDC05\uDC08\uDC0A-\uDC35\uDC37\uDC38\uDC3C\uDC3F]' + }, + { + 'name': 'Cyrillic', + 'bmp': '\u0400-\u0484\u0487-\u052F\u1C80-\u1C88\u1D2B\u1D78\u2DE0-\u2DFF\uA640-\uA69F\uFE2E\uFE2F' + }, + { + 'name': 'Deseret', + 'astral': '\uD801[\uDC00-\uDC4F]' + }, + { + 'name': 'Devanagari', + 'bmp': '\u0900-\u0950\u0953-\u0963\u0966-\u097F\uA8E0-\uA8FF' + }, + { + 'name': 'Dogra', + 'astral': '\uD806[\uDC00-\uDC3B]' + }, + { + 'name': 'Duployan', + 'astral': '\uD82F[\uDC00-\uDC6A\uDC70-\uDC7C\uDC80-\uDC88\uDC90-\uDC99\uDC9C-\uDC9F]' + }, + { + 'name': 'Egyptian_Hieroglyphs', + 'astral': '\uD80C[\uDC00-\uDFFF]|\uD80D[\uDC00-\uDC2E]' + }, + { + 'name': 'Elbasan', + 'astral': '\uD801[\uDD00-\uDD27]' + }, + { + 'name': 'Ethiopic', + 'bmp': '\u1200-\u1248\u124A-\u124D\u1250-\u1256\u1258\u125A-\u125D\u1260-\u1288\u128A-\u128D\u1290-\u12B0\u12B2-\u12B5\u12B8-\u12BE\u12C0\u12C2-\u12C5\u12C8-\u12D6\u12D8-\u1310\u1312-\u1315\u1318-\u135A\u135D-\u137C\u1380-\u1399\u2D80-\u2D96\u2DA0-\u2DA6\u2DA8-\u2DAE\u2DB0-\u2DB6\u2DB8-\u2DBE\u2DC0-\u2DC6\u2DC8-\u2DCE\u2DD0-\u2DD6\u2DD8-\u2DDE\uAB01-\uAB06\uAB09-\uAB0E\uAB11-\uAB16\uAB20-\uAB26\uAB28-\uAB2E' + }, + { + 'name': 'Georgian', + 'bmp': '\u10A0-\u10C5\u10C7\u10CD\u10D0-\u10FA\u10FC-\u10FF\u1C90-\u1CBA\u1CBD-\u1CBF\u2D00-\u2D25\u2D27\u2D2D' + }, + { + 'name': 'Glagolitic', + 'bmp': '\u2C00-\u2C2E\u2C30-\u2C5E', + 'astral': '\uD838[\uDC00-\uDC06\uDC08-\uDC18\uDC1B-\uDC21\uDC23\uDC24\uDC26-\uDC2A]' + }, + { + 'name': 'Gothic', + 'astral': '\uD800[\uDF30-\uDF4A]' + }, + { + 'name': 'Grantha', + 'astral': '\uD804[\uDF00-\uDF03\uDF05-\uDF0C\uDF0F\uDF10\uDF13-\uDF28\uDF2A-\uDF30\uDF32\uDF33\uDF35-\uDF39\uDF3C-\uDF44\uDF47\uDF48\uDF4B-\uDF4D\uDF50\uDF57\uDF5D-\uDF63\uDF66-\uDF6C\uDF70-\uDF74]' + }, + { + 'name': 'Greek', + 'bmp': '\u0370-\u0373\u0375-\u0377\u037A-\u037D\u037F\u0384\u0386\u0388-\u038A\u038C\u038E-\u03A1\u03A3-\u03E1\u03F0-\u03FF\u1D26-\u1D2A\u1D5D-\u1D61\u1D66-\u1D6A\u1DBF\u1F00-\u1F15\u1F18-\u1F1D\u1F20-\u1F45\u1F48-\u1F4D\u1F50-\u1F57\u1F59\u1F5B\u1F5D\u1F5F-\u1F7D\u1F80-\u1FB4\u1FB6-\u1FC4\u1FC6-\u1FD3\u1FD6-\u1FDB\u1FDD-\u1FEF\u1FF2-\u1FF4\u1FF6-\u1FFE\u2126\uAB65', + 'astral': '\uD800[\uDD40-\uDD8E\uDDA0]|\uD834[\uDE00-\uDE45]' + }, + { + 'name': 'Gujarati', + 'bmp': '\u0A81-\u0A83\u0A85-\u0A8D\u0A8F-\u0A91\u0A93-\u0AA8\u0AAA-\u0AB0\u0AB2\u0AB3\u0AB5-\u0AB9\u0ABC-\u0AC5\u0AC7-\u0AC9\u0ACB-\u0ACD\u0AD0\u0AE0-\u0AE3\u0AE6-\u0AF1\u0AF9-\u0AFF' + }, + { + 'name': 'Gunjala_Gondi', + 'astral': '\uD807[\uDD60-\uDD65\uDD67\uDD68\uDD6A-\uDD8E\uDD90\uDD91\uDD93-\uDD98\uDDA0-\uDDA9]' + }, + { + 'name': 'Gurmukhi', + 'bmp': '\u0A01-\u0A03\u0A05-\u0A0A\u0A0F\u0A10\u0A13-\u0A28\u0A2A-\u0A30\u0A32\u0A33\u0A35\u0A36\u0A38\u0A39\u0A3C\u0A3E-\u0A42\u0A47\u0A48\u0A4B-\u0A4D\u0A51\u0A59-\u0A5C\u0A5E\u0A66-\u0A76' + }, + { + 'name': 'Han', + 'bmp': '\u2E80-\u2E99\u2E9B-\u2EF3\u2F00-\u2FD5\u3005\u3007\u3021-\u3029\u3038-\u303B\u3400-\u4DB5\u4E00-\u9FEF\uF900-\uFA6D\uFA70-\uFAD9', + 'astral': '[\uD840-\uD868\uD86A-\uD86C\uD86F-\uD872\uD874-\uD879][\uDC00-\uDFFF]|\uD869[\uDC00-\uDED6\uDF00-\uDFFF]|\uD86D[\uDC00-\uDF34\uDF40-\uDFFF]|\uD86E[\uDC00-\uDC1D\uDC20-\uDFFF]|\uD873[\uDC00-\uDEA1\uDEB0-\uDFFF]|\uD87A[\uDC00-\uDFE0]|\uD87E[\uDC00-\uDE1D]' + }, + { + 'name': 'Hangul', + 'bmp': '\u1100-\u11FF\u302E\u302F\u3131-\u318E\u3200-\u321E\u3260-\u327E\uA960-\uA97C\uAC00-\uD7A3\uD7B0-\uD7C6\uD7CB-\uD7FB\uFFA0-\uFFBE\uFFC2-\uFFC7\uFFCA-\uFFCF\uFFD2-\uFFD7\uFFDA-\uFFDC' + }, + { + 'name': 'Hanifi_Rohingya', + 'astral': '\uD803[\uDD00-\uDD27\uDD30-\uDD39]' + }, + { + 'name': 'Hanunoo', + 'bmp': '\u1720-\u1734' + }, + { + 'name': 'Hatran', + 'astral': '\uD802[\uDCE0-\uDCF2\uDCF4\uDCF5\uDCFB-\uDCFF]' + }, + { + 'name': 'Hebrew', + 'bmp': '\u0591-\u05C7\u05D0-\u05EA\u05EF-\u05F4\uFB1D-\uFB36\uFB38-\uFB3C\uFB3E\uFB40\uFB41\uFB43\uFB44\uFB46-\uFB4F' + }, + { + 'name': 'Hiragana', + 'bmp': '\u3041-\u3096\u309D-\u309F', + 'astral': '\uD82C[\uDC01-\uDD1E]|\uD83C\uDE00' + }, + { + 'name': 'Imperial_Aramaic', + 'astral': '\uD802[\uDC40-\uDC55\uDC57-\uDC5F]' + }, + { + 'name': 'Inherited', + 'bmp': '\u0300-\u036F\u0485\u0486\u064B-\u0655\u0670\u0951\u0952\u1AB0-\u1ABE\u1CD0-\u1CD2\u1CD4-\u1CE0\u1CE2-\u1CE8\u1CED\u1CF4\u1CF8\u1CF9\u1DC0-\u1DF9\u1DFB-\u1DFF\u200C\u200D\u20D0-\u20F0\u302A-\u302D\u3099\u309A\uFE00-\uFE0F\uFE20-\uFE2D', + 'astral': '\uD800[\uDDFD\uDEE0]|\uD804\uDF3B|\uD834[\uDD67-\uDD69\uDD7B-\uDD82\uDD85-\uDD8B\uDDAA-\uDDAD]|\uDB40[\uDD00-\uDDEF]' + }, + { + 'name': 'Inscriptional_Pahlavi', + 'astral': '\uD802[\uDF60-\uDF72\uDF78-\uDF7F]' + }, + { + 'name': 'Inscriptional_Parthian', + 'astral': '\uD802[\uDF40-\uDF55\uDF58-\uDF5F]' + }, + { + 'name': 'Javanese', + 'bmp': '\uA980-\uA9CD\uA9D0-\uA9D9\uA9DE\uA9DF' + }, + { + 'name': 'Kaithi', + 'astral': '\uD804[\uDC80-\uDCC1\uDCCD]' + }, + { + 'name': 'Kannada', + 'bmp': '\u0C80-\u0C8C\u0C8E-\u0C90\u0C92-\u0CA8\u0CAA-\u0CB3\u0CB5-\u0CB9\u0CBC-\u0CC4\u0CC6-\u0CC8\u0CCA-\u0CCD\u0CD5\u0CD6\u0CDE\u0CE0-\u0CE3\u0CE6-\u0CEF\u0CF1\u0CF2' + }, + { + 'name': 'Katakana', + 'bmp': '\u30A1-\u30FA\u30FD-\u30FF\u31F0-\u31FF\u32D0-\u32FE\u3300-\u3357\uFF66-\uFF6F\uFF71-\uFF9D', + 'astral': '\uD82C\uDC00' + }, + { + 'name': 'Kayah_Li', + 'bmp': '\uA900-\uA92D\uA92F' + }, + { + 'name': 'Kharoshthi', + 'astral': '\uD802[\uDE00-\uDE03\uDE05\uDE06\uDE0C-\uDE13\uDE15-\uDE17\uDE19-\uDE35\uDE38-\uDE3A\uDE3F-\uDE48\uDE50-\uDE58]' + }, + { + 'name': 'Khmer', + 'bmp': '\u1780-\u17DD\u17E0-\u17E9\u17F0-\u17F9\u19E0-\u19FF' + }, + { + 'name': 'Khojki', + 'astral': '\uD804[\uDE00-\uDE11\uDE13-\uDE3E]' + }, + { + 'name': 'Khudawadi', + 'astral': '\uD804[\uDEB0-\uDEEA\uDEF0-\uDEF9]' + }, + { + 'name': 'Lao', + 'bmp': '\u0E81\u0E82\u0E84\u0E87\u0E88\u0E8A\u0E8D\u0E94-\u0E97\u0E99-\u0E9F\u0EA1-\u0EA3\u0EA5\u0EA7\u0EAA\u0EAB\u0EAD-\u0EB9\u0EBB-\u0EBD\u0EC0-\u0EC4\u0EC6\u0EC8-\u0ECD\u0ED0-\u0ED9\u0EDC-\u0EDF' + }, + { + 'name': 'Latin', + 'bmp': 'A-Za-z\xAA\xBA\xC0-\xD6\xD8-\xF6\xF8-\u02B8\u02E0-\u02E4\u1D00-\u1D25\u1D2C-\u1D5C\u1D62-\u1D65\u1D6B-\u1D77\u1D79-\u1DBE\u1E00-\u1EFF\u2071\u207F\u2090-\u209C\u212A\u212B\u2132\u214E\u2160-\u2188\u2C60-\u2C7F\uA722-\uA787\uA78B-\uA7B9\uA7F7-\uA7FF\uAB30-\uAB5A\uAB5C-\uAB64\uFB00-\uFB06\uFF21-\uFF3A\uFF41-\uFF5A' + }, + { + 'name': 'Lepcha', + 'bmp': '\u1C00-\u1C37\u1C3B-\u1C49\u1C4D-\u1C4F' + }, + { + 'name': 'Limbu', + 'bmp': '\u1900-\u191E\u1920-\u192B\u1930-\u193B\u1940\u1944-\u194F' + }, + { + 'name': 'Linear_A', + 'astral': '\uD801[\uDE00-\uDF36\uDF40-\uDF55\uDF60-\uDF67]' + }, + { + 'name': 'Linear_B', + 'astral': '\uD800[\uDC00-\uDC0B\uDC0D-\uDC26\uDC28-\uDC3A\uDC3C\uDC3D\uDC3F-\uDC4D\uDC50-\uDC5D\uDC80-\uDCFA]' + }, + { + 'name': 'Lisu', + 'bmp': '\uA4D0-\uA4FF' + }, + { + 'name': 'Lycian', + 'astral': '\uD800[\uDE80-\uDE9C]' + }, + { + 'name': 'Lydian', + 'astral': '\uD802[\uDD20-\uDD39\uDD3F]' + }, + { + 'name': 'Mahajani', + 'astral': '\uD804[\uDD50-\uDD76]' + }, + { + 'name': 'Makasar', + 'astral': '\uD807[\uDEE0-\uDEF8]' + }, + { + 'name': 'Malayalam', + 'bmp': '\u0D00-\u0D03\u0D05-\u0D0C\u0D0E-\u0D10\u0D12-\u0D44\u0D46-\u0D48\u0D4A-\u0D4F\u0D54-\u0D63\u0D66-\u0D7F' + }, + { + 'name': 'Mandaic', + 'bmp': '\u0840-\u085B\u085E' + }, + { + 'name': 'Manichaean', + 'astral': '\uD802[\uDEC0-\uDEE6\uDEEB-\uDEF6]' + }, + { + 'name': 'Marchen', + 'astral': '\uD807[\uDC70-\uDC8F\uDC92-\uDCA7\uDCA9-\uDCB6]' + }, + { + 'name': 'Masaram_Gondi', + 'astral': '\uD807[\uDD00-\uDD06\uDD08\uDD09\uDD0B-\uDD36\uDD3A\uDD3C\uDD3D\uDD3F-\uDD47\uDD50-\uDD59]' + }, + { + 'name': 'Medefaidrin', + 'astral': '\uD81B[\uDE40-\uDE9A]' + }, + { + 'name': 'Meetei_Mayek', + 'bmp': '\uAAE0-\uAAF6\uABC0-\uABED\uABF0-\uABF9' + }, + { + 'name': 'Mende_Kikakui', + 'astral': '\uD83A[\uDC00-\uDCC4\uDCC7-\uDCD6]' + }, + { + 'name': 'Meroitic_Cursive', + 'astral': '\uD802[\uDDA0-\uDDB7\uDDBC-\uDDCF\uDDD2-\uDDFF]' + }, + { + 'name': 'Meroitic_Hieroglyphs', + 'astral': '\uD802[\uDD80-\uDD9F]' + }, + { + 'name': 'Miao', + 'astral': '\uD81B[\uDF00-\uDF44\uDF50-\uDF7E\uDF8F-\uDF9F]' + }, + { + 'name': 'Modi', + 'astral': '\uD805[\uDE00-\uDE44\uDE50-\uDE59]' + }, + { + 'name': 'Mongolian', + 'bmp': '\u1800\u1801\u1804\u1806-\u180E\u1810-\u1819\u1820-\u1878\u1880-\u18AA', + 'astral': '\uD805[\uDE60-\uDE6C]' + }, + { + 'name': 'Mro', + 'astral': '\uD81A[\uDE40-\uDE5E\uDE60-\uDE69\uDE6E\uDE6F]' + }, + { + 'name': 'Multani', + 'astral': '\uD804[\uDE80-\uDE86\uDE88\uDE8A-\uDE8D\uDE8F-\uDE9D\uDE9F-\uDEA9]' + }, + { + 'name': 'Myanmar', + 'bmp': '\u1000-\u109F\uA9E0-\uA9FE\uAA60-\uAA7F' + }, + { + 'name': 'Nabataean', + 'astral': '\uD802[\uDC80-\uDC9E\uDCA7-\uDCAF]' + }, + { + 'name': 'New_Tai_Lue', + 'bmp': '\u1980-\u19AB\u19B0-\u19C9\u19D0-\u19DA\u19DE\u19DF' + }, + { + 'name': 'Newa', + 'astral': '\uD805[\uDC00-\uDC59\uDC5B\uDC5D\uDC5E]' + }, + { + 'name': 'Nko', + 'bmp': '\u07C0-\u07FA\u07FD-\u07FF' + }, + { + 'name': 'Nushu', + 'astral': '\uD81B\uDFE1|\uD82C[\uDD70-\uDEFB]' + }, + { + 'name': 'Ogham', + 'bmp': '\u1680-\u169C' + }, + { + 'name': 'Ol_Chiki', + 'bmp': '\u1C50-\u1C7F' + }, + { + 'name': 'Old_Hungarian', + 'astral': '\uD803[\uDC80-\uDCB2\uDCC0-\uDCF2\uDCFA-\uDCFF]' + }, + { + 'name': 'Old_Italic', + 'astral': '\uD800[\uDF00-\uDF23\uDF2D-\uDF2F]' + }, + { + 'name': 'Old_North_Arabian', + 'astral': '\uD802[\uDE80-\uDE9F]' + }, + { + 'name': 'Old_Permic', + 'astral': '\uD800[\uDF50-\uDF7A]' + }, + { + 'name': 'Old_Persian', + 'astral': '\uD800[\uDFA0-\uDFC3\uDFC8-\uDFD5]' + }, + { + 'name': 'Old_Sogdian', + 'astral': '\uD803[\uDF00-\uDF27]' + }, + { + 'name': 'Old_South_Arabian', + 'astral': '\uD802[\uDE60-\uDE7F]' + }, + { + 'name': 'Old_Turkic', + 'astral': '\uD803[\uDC00-\uDC48]' + }, + { + 'name': 'Oriya', + 'bmp': '\u0B01-\u0B03\u0B05-\u0B0C\u0B0F\u0B10\u0B13-\u0B28\u0B2A-\u0B30\u0B32\u0B33\u0B35-\u0B39\u0B3C-\u0B44\u0B47\u0B48\u0B4B-\u0B4D\u0B56\u0B57\u0B5C\u0B5D\u0B5F-\u0B63\u0B66-\u0B77' + }, + { + 'name': 'Osage', + 'astral': '\uD801[\uDCB0-\uDCD3\uDCD8-\uDCFB]' + }, + { + 'name': 'Osmanya', + 'astral': '\uD801[\uDC80-\uDC9D\uDCA0-\uDCA9]' + }, + { + 'name': 'Pahawh_Hmong', + 'astral': '\uD81A[\uDF00-\uDF45\uDF50-\uDF59\uDF5B-\uDF61\uDF63-\uDF77\uDF7D-\uDF8F]' + }, + { + 'name': 'Palmyrene', + 'astral': '\uD802[\uDC60-\uDC7F]' + }, + { + 'name': 'Pau_Cin_Hau', + 'astral': '\uD806[\uDEC0-\uDEF8]' + }, + { + 'name': 'Phags_Pa', + 'bmp': '\uA840-\uA877' + }, + { + 'name': 'Phoenician', + 'astral': '\uD802[\uDD00-\uDD1B\uDD1F]' + }, + { + 'name': 'Psalter_Pahlavi', + 'astral': '\uD802[\uDF80-\uDF91\uDF99-\uDF9C\uDFA9-\uDFAF]' + }, + { + 'name': 'Rejang', + 'bmp': '\uA930-\uA953\uA95F' + }, + { + 'name': 'Runic', + 'bmp': '\u16A0-\u16EA\u16EE-\u16F8' + }, + { + 'name': 'Samaritan', + 'bmp': '\u0800-\u082D\u0830-\u083E' + }, + { + 'name': 'Saurashtra', + 'bmp': '\uA880-\uA8C5\uA8CE-\uA8D9' + }, + { + 'name': 'Sharada', + 'astral': '\uD804[\uDD80-\uDDCD\uDDD0-\uDDDF]' + }, + { + 'name': 'Shavian', + 'astral': '\uD801[\uDC50-\uDC7F]' + }, + { + 'name': 'Siddham', + 'astral': '\uD805[\uDD80-\uDDB5\uDDB8-\uDDDD]' + }, + { + 'name': 'SignWriting', + 'astral': '\uD836[\uDC00-\uDE8B\uDE9B-\uDE9F\uDEA1-\uDEAF]' + }, + { + 'name': 'Sinhala', + 'bmp': '\u0D82\u0D83\u0D85-\u0D96\u0D9A-\u0DB1\u0DB3-\u0DBB\u0DBD\u0DC0-\u0DC6\u0DCA\u0DCF-\u0DD4\u0DD6\u0DD8-\u0DDF\u0DE6-\u0DEF\u0DF2-\u0DF4', + 'astral': '\uD804[\uDDE1-\uDDF4]' + }, + { + 'name': 'Sogdian', + 'astral': '\uD803[\uDF30-\uDF59]' + }, + { + 'name': 'Sora_Sompeng', + 'astral': '\uD804[\uDCD0-\uDCE8\uDCF0-\uDCF9]' + }, + { + 'name': 'Soyombo', + 'astral': '\uD806[\uDE50-\uDE83\uDE86-\uDEA2]' + }, + { + 'name': 'Sundanese', + 'bmp': '\u1B80-\u1BBF\u1CC0-\u1CC7' + }, + { + 'name': 'Syloti_Nagri', + 'bmp': '\uA800-\uA82B' + }, + { + 'name': 'Syriac', + 'bmp': '\u0700-\u070D\u070F-\u074A\u074D-\u074F\u0860-\u086A' + }, + { + 'name': 'Tagalog', + 'bmp': '\u1700-\u170C\u170E-\u1714' + }, + { + 'name': 'Tagbanwa', + 'bmp': '\u1760-\u176C\u176E-\u1770\u1772\u1773' + }, + { + 'name': 'Tai_Le', + 'bmp': '\u1950-\u196D\u1970-\u1974' + }, + { + 'name': 'Tai_Tham', + 'bmp': '\u1A20-\u1A5E\u1A60-\u1A7C\u1A7F-\u1A89\u1A90-\u1A99\u1AA0-\u1AAD' + }, + { + 'name': 'Tai_Viet', + 'bmp': '\uAA80-\uAAC2\uAADB-\uAADF' + }, + { + 'name': 'Takri', + 'astral': '\uD805[\uDE80-\uDEB7\uDEC0-\uDEC9]' + }, + { + 'name': 'Tamil', + 'bmp': '\u0B82\u0B83\u0B85-\u0B8A\u0B8E-\u0B90\u0B92-\u0B95\u0B99\u0B9A\u0B9C\u0B9E\u0B9F\u0BA3\u0BA4\u0BA8-\u0BAA\u0BAE-\u0BB9\u0BBE-\u0BC2\u0BC6-\u0BC8\u0BCA-\u0BCD\u0BD0\u0BD7\u0BE6-\u0BFA' + }, + { + 'name': 'Tangut', + 'astral': '\uD81B\uDFE0|[\uD81C-\uD820][\uDC00-\uDFFF]|\uD821[\uDC00-\uDFF1]|\uD822[\uDC00-\uDEF2]' + }, + { + 'name': 'Telugu', + 'bmp': '\u0C00-\u0C0C\u0C0E-\u0C10\u0C12-\u0C28\u0C2A-\u0C39\u0C3D-\u0C44\u0C46-\u0C48\u0C4A-\u0C4D\u0C55\u0C56\u0C58-\u0C5A\u0C60-\u0C63\u0C66-\u0C6F\u0C78-\u0C7F' + }, + { + 'name': 'Thaana', + 'bmp': '\u0780-\u07B1' + }, + { + 'name': 'Thai', + 'bmp': '\u0E01-\u0E3A\u0E40-\u0E5B' + }, + { + 'name': 'Tibetan', + 'bmp': '\u0F00-\u0F47\u0F49-\u0F6C\u0F71-\u0F97\u0F99-\u0FBC\u0FBE-\u0FCC\u0FCE-\u0FD4\u0FD9\u0FDA' + }, + { + 'name': 'Tifinagh', + 'bmp': '\u2D30-\u2D67\u2D6F\u2D70\u2D7F' + }, + { + 'name': 'Tirhuta', + 'astral': '\uD805[\uDC80-\uDCC7\uDCD0-\uDCD9]' + }, + { + 'name': 'Ugaritic', + 'astral': '\uD800[\uDF80-\uDF9D\uDF9F]' + }, + { + 'name': 'Vai', + 'bmp': '\uA500-\uA62B' + }, + { + 'name': 'Warang_Citi', + 'astral': '\uD806[\uDCA0-\uDCF2\uDCFF]' + }, + { + 'name': 'Yi', + 'bmp': '\uA000-\uA48C\uA490-\uA4C6' + }, + { + 'name': 'Zanabazar_Square', + 'astral': '\uD806[\uDE00-\uDE47]' + } +]; + +var unicodeScripts = createCommonjsModule(function (module, exports) { +"use strict"; + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.default = void 0; + +var _scripts = _interopRequireDefault(scripts); + +function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } + +/*! + * XRegExp Unicode Scripts 4.2.0 + * + * Steven Levithan (c) 2010-present MIT License + * Unicode data by Mathias Bynens + */ +var _default = function _default(XRegExp) { + /** + * Adds support for all Unicode scripts. E.g., `\p{Latin}`. Token names are case insensitive, + * and any spaces, hyphens, and underscores are ignored. + * + * Uses Unicode 11.0.0. + * + * @requires XRegExp, Unicode Base + */ + if (!XRegExp.addUnicodeData) { + throw new ReferenceError('Unicode Base must be loaded before Unicode Scripts'); + } + + XRegExp.addUnicodeData(_scripts.default); +}; + +exports.default = _default; +module.exports = exports["default"]; +}); + +unwrapExports(unicodeScripts); + +var lib = createCommonjsModule(function (module, exports) { +"use strict"; + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.default = void 0; + +var _xregexp = _interopRequireDefault(xregexp); + +var _build = _interopRequireDefault(build); + +var _matchrecursive = _interopRequireDefault(matchrecursive); + +var _unicodeBase = _interopRequireDefault(unicodeBase); + +var _unicodeBlocks = _interopRequireDefault(unicodeBlocks); + +var _unicodeCategories = _interopRequireDefault(unicodeCategories); + +var _unicodeProperties = _interopRequireDefault(unicodeProperties); + +var _unicodeScripts = _interopRequireDefault(unicodeScripts); + +function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } + +(_build.default)(_xregexp.default); +(_matchrecursive.default)(_xregexp.default); +(_unicodeBase.default)(_xregexp.default); +(_unicodeBlocks.default)(_xregexp.default); +(_unicodeCategories.default)(_xregexp.default); +(_unicodeProperties.default)(_xregexp.default); +(_unicodeScripts.default)(_xregexp.default); +var _default = _xregexp.default; +exports.default = _default; +module.exports = exports["default"]; +}); + +unwrapExports(lib); + +var utilities = createCommonjsModule(function (module, exports) { +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); + +class FormatUtility { + static preProcess(query, toLower = true) { + if (toLower) { + query = query.toLowerCase(); + } + return query + .replace(/0/g, "0") + .replace(/1/g, "1") + .replace(/2/g, "2") + .replace(/3/g, "3") + .replace(/4/g, "4") + .replace(/5/g, "5") + .replace(/6/g, "6") + .replace(/7/g, "7") + .replace(/8/g, "8") + .replace(/9/g, "9") + .replace(/:/g, ":") + .replace(/-/g, "-") + .replace(/,/g, ",") + .replace(///g, "/") + .replace(/G/g, "G") + .replace(/M/g, "M") + .replace(/T/g, "T") + .replace(/K/g, "K") + .replace(/k/g, "k") + .replace(/./g, ".") + .replace(/(/g, "(") + .replace(/)/g, ")"); + } +} +exports.FormatUtility = FormatUtility; +class Match { + constructor(index, length, value, groups) { + this.index = index; + this.length = length; + this.value = value; + this.innerGroups = groups; + } + groups(key) { + return this.innerGroups[key] ? this.innerGroups[key] : { value: '', index: 0, length: 0, captures: [] }; + } +} +exports.Match = Match; +class RegExpUtility { + static getMatches(regex, source) { + if (!regex) + return []; + let rawRegex = regex.xregexp.source; + if (!rawRegex.includes('(?= 0) { + closePos = this.getClosePos(rawRegex, startPos); + let nlbRegex = lib(rawRegex.substring(startPos, closePos + 1), flags); + let nextRegex = RegExpUtility.getNextRegex(rawRegex, startPos); + nlbRegex.nextRegex = nextRegex ? lib(nextRegex, flags) : null; + negativeLookbehindRegexes.push(nlbRegex); + rawRegex = rawRegex.substr(0, startPos) + rawRegex.substr(closePos + 1); + startPos = rawRegex.indexOf('(? { + let clean = true; + negativeLookbehindRegexes.forEach(regex => { + let negativeLookbehindMatches = RegExpUtility.getMatchesSimple(regex, source); + negativeLookbehindMatches.forEach(negativeLookbehindMatch => { + let negativeLookbehindEnd = negativeLookbehindMatch.index + negativeLookbehindMatch.length; + let nextRegex = regex.nextRegex; + if (match.index === negativeLookbehindEnd) { + if (!nextRegex) { + clean = false; + return; + } + else { + let nextMatch = RegExpUtility.getFirstMatchIndex(nextRegex, source.substring(negativeLookbehindMatch.index)); + if (nextMatch.matched && ((nextMatch.index === negativeLookbehindMatch.length) || (source.includes(nextMatch.value + match.value)))) { + clean = false; + return; + } + } + } + if (negativeLookbehindMatch.value.includes(match.value)) { + let preMatches = RegExpUtility.getMatchesSimple(regex, source.substring(0, match.index)); + preMatches.forEach(preMatch => { + if (source.includes(preMatch.value + match.value)) { + clean = false; + return; + } + }); + } + }); + if (!clean) { + return; + } + }); + if (clean) { + realMatches.push(match); + } + }); + return realMatches; + } + static getMatchesSimple(regex, source) { + // Word boundary (\b) in JS is not unicode-aware, so words starting/ending with accentuated characters will not match + // use a normalized string to match, the return matches' values using the original one + // http://blog.stevenlevithan.com/archives/javascript-regex-and-unicode + // https://stackoverflow.com/questions/2881445/utf-8-word-boundary-regex-in-javascript + let normalized = StringUtility.removeDiacriticsFromWordBoundaries(source); + let matches = new Array(); + lib.forEach(normalized, regex, match => { + let positiveLookbehinds = []; + let groups = {}; + let lastGroup = ''; + Object.keys(match).forEach(key => { + if (!key.includes('__')) + return; + if (key.startsWith('plb') && match[key]) { + if (match[0].indexOf(match[key]) !== 0 && !StringUtility.isNullOrEmpty(lastGroup)) { + let index = match.index + match[0].indexOf(match[key]); + let length = match[key].length; + let value = source.substr(index, length); + groups[lastGroup].value = groups[lastGroup].value + value; + } + positiveLookbehinds.push({ key: key, value: match[key] }); + return; + } + if (key.startsWith('nlb')) { + return; + } + let groupKey = key.substr(0, key.lastIndexOf('__')); + lastGroup = groupKey; + if (!groups[groupKey]) + groups[groupKey] = { value: '', index: 0, length: 0, captures: [] }; + if (match[key]) { + let index = match.index + match[0].indexOf(match[key]); + let length = match[key].length; + let value = source.substr(index, length); + groups[groupKey].index = index; + groups[groupKey].length = length; + groups[groupKey].value = value; + groups[groupKey].captures.push(value); + } + }); + let value = match[0]; + let index = match.index; + let length = value.length; + if (positiveLookbehinds && positiveLookbehinds.length > 0 && value.indexOf(positiveLookbehinds[0].value) === 0) { + value = source.substr(index, length).substr(positiveLookbehinds[0].value.length); + index += positiveLookbehinds[0].value.length; + length -= positiveLookbehinds[0].value.length; + } + else { + value = source.substr(index, length); + } + matches.push(new Match(index, length, value, groups)); + }); + return matches; + } + static getSafeRegExp(source, flags) { + let sanitizedSource = this.sanitizeGroups(source); + return lib(sanitizedSource, flags || 'gis'); + } + static getFirstMatchIndex(regex, source) { + let matches = RegExpUtility.getMatches(regex, source); + if (matches.length) { + return { + matched: true, + index: matches[0].index, + value: matches[0].value + }; + } + return { matched: false, index: -1, value: null }; + } + static split(regex, source) { + return lib.split(source, regex); + } + static isMatch(regex, source) { + return !StringUtility.isNullOrEmpty(source) + && this.getMatches(regex, source).length > 0; + } + static sanitizeGroups(source) { + let index = 0; + let result = lib.replace(source, this.matchGroup, (match, name) => match.replace(name, `${name}__${index++}`)); + index = 0; + result = lib.replace(result, this.matchPositiveLookbehind, () => `(?`); + index = 0; + result = lib.replace(result, this.matchNegativeLookbehind, () => `(?`); + return result; + } + static getNextRegex(source, startPos) { + startPos = RegExpUtility.getClosePos(source, startPos) + 1; + let closePos = RegExpUtility.getClosePos(source, startPos); + if (source[startPos] !== '(') { + closePos--; + } + let next = (startPos === closePos) + ? null + : source.substring(startPos, closePos + 1); + return next; + } + static getClosePos(source, startPos) { + let counter = 1; + let closePos = startPos; + while (counter > 0 && closePos < source.length) { + let c = source[++closePos]; + if (c === '(') + counter++; + else if (c === ')') + counter--; + } + return closePos; + } +} +RegExpUtility.matchGroup = lib(String.raw `\?<(?\w+)>`, 'gis'); +RegExpUtility.matchPositiveLookbehind = lib(String.raw `\(\?<=`, 'gis'); +RegExpUtility.matchNegativeLookbehind = lib(String.raw `\(\? { + let length = s.length; + if (length === 0) + return s; + let first = StringUtility.removeDiacritics(s.substring(0, 1)); + if (length === 1) + return first; + let last = length > 1 ? StringUtility.removeDiacritics(s.substring(length - 1)) : ''; + let mid = s.substring(1, length - 1); + // console.log(first + mid + last) + return first + mid + last; + }) + .join(' '); + } + static removeDiacritics(c) { + let clean = StringUtility.diacriticsRemovalMap[c]; + return !clean ? c : clean; + } +} +StringUtility.diacriticsRemovalMap = { + "Ⓐ": "A", + "A": "A", + "À": "A", + "Á": "A", + "Â": "A", + "Ầ": "A", + "Ấ": "A", + "Ẫ": "A", + "Ẩ": "A", + "Ã": "A", + "Ā": "A", + "Ă": "A", + "Ằ": "A", + "Ắ": "A", + "Ẵ": "A", + "Ẳ": "A", + "Ȧ": "A", + "Ǡ": "A", + "Ä": "A", + "Ǟ": "A", + "Ả": "A", + "Å": "A", + "Ǻ": "A", + "Ǎ": "A", + "Ȁ": "A", + "Ȃ": "A", + "Ạ": "A", + "Ậ": "A", + "Ặ": "A", + "Ḁ": "A", + "Ą": "A", + "Ⱥ": "A", + "Ɐ": "A", + "Ⓑ": "B", + "B": "B", + "Ḃ": "B", + "Ḅ": "B", + "Ḇ": "B", + "Ƀ": "B", + "Ƃ": "B", + "Ɓ": "B", + "Ⓒ": "C", + "C": "C", + "Ć": "C", + "Ĉ": "C", + "Ċ": "C", + "Č": "C", + "Ç": "C", + "Ḉ": "C", + "Ƈ": "C", + "Ȼ": "C", + "Ꜿ": "C", + "Ⓓ": "D", + "D": "D", + "Ḋ": "D", + "Ď": "D", + "Ḍ": "D", + "Ḑ": "D", + "Ḓ": "D", + "Ḏ": "D", + "Đ": "D", + "Ƌ": "D", + "Ɗ": "D", + "Ɖ": "D", + "Ꝺ": "D", + "Ⓔ": "E", + "E": "E", + "È": "E", + "É": "E", + "Ê": "E", + "Ề": "E", + "Ế": "E", + "Ễ": "E", + "Ể": "E", + "Ẽ": "E", + "Ē": "E", + "Ḕ": "E", + "Ḗ": "E", + "Ĕ": "E", + "Ė": "E", + "Ë": "E", + "Ẻ": "E", + "Ě": "E", + "Ȅ": "E", + "Ȇ": "E", + "Ẹ": "E", + "Ệ": "E", + "Ȩ": "E", + "Ḝ": "E", + "Ę": "E", + "Ḙ": "E", + "Ḛ": "E", + "Ɛ": "E", + "Ǝ": "E", + "Ⓕ": "F", + "F": "F", + "Ḟ": "F", + "Ƒ": "F", + "Ꝼ": "F", + "Ⓖ": "G", + "G": "G", + "Ǵ": "G", + "Ĝ": "G", + "Ḡ": "G", + "Ğ": "G", + "Ġ": "G", + "Ǧ": "G", + "Ģ": "G", + "Ǥ": "G", + "Ɠ": "G", + "Ꞡ": "G", + "Ᵹ": "G", + "Ꝿ": "G", + "Ⓗ": "H", + "H": "H", + "Ĥ": "H", + "Ḣ": "H", + "Ḧ": "H", + "Ȟ": "H", + "Ḥ": "H", + "Ḩ": "H", + "Ḫ": "H", + "Ħ": "H", + "Ⱨ": "H", + "Ⱶ": "H", + "Ɥ": "H", + "Ⓘ": "I", + "I": "I", + "Ì": "I", + "Í": "I", + "Î": "I", + "Ĩ": "I", + "Ī": "I", + "Ĭ": "I", + "İ": "I", + "Ï": "I", + "Ḯ": "I", + "Ỉ": "I", + "Ǐ": "I", + "Ȉ": "I", + "Ȋ": "I", + "Ị": "I", + "Į": "I", + "Ḭ": "I", + "Ɨ": "I", + "Ⓙ": "J", + "J": "J", + "Ĵ": "J", + "Ɉ": "J", + "Ⓚ": "K", + "K": "K", + "Ḱ": "K", + "Ǩ": "K", + "Ḳ": "K", + "Ķ": "K", + "Ḵ": "K", + "Ƙ": "K", + "Ⱪ": "K", + "Ꝁ": "K", + "Ꝃ": "K", + "Ꝅ": "K", + "Ꞣ": "K", + "Ⓛ": "L", + "L": "L", + "Ŀ": "L", + "Ĺ": "L", + "Ľ": "L", + "Ḷ": "L", + "Ḹ": "L", + "Ļ": "L", + "Ḽ": "L", + "Ḻ": "L", + "Ł": "L", + "Ƚ": "L", + "Ɫ": "L", + "Ⱡ": "L", + "Ꝉ": "L", + "Ꝇ": "L", + "Ꞁ": "L", + "Ⓜ": "M", + "M": "M", + "Ḿ": "M", + "Ṁ": "M", + "Ṃ": "M", + "Ɱ": "M", + "Ɯ": "M", + "Ⓝ": "N", + "N": "N", + "Ǹ": "N", + "Ń": "N", + "Ñ": "N", + "Ṅ": "N", + "Ň": "N", + "Ṇ": "N", + "Ņ": "N", + "Ṋ": "N", + "Ṉ": "N", + "Ƞ": "N", + "Ɲ": "N", + "Ꞑ": "N", + "Ꞥ": "N", + "Ⓞ": "O", + "O": "O", + "Ò": "O", + "Ó": "O", + "Ô": "O", + "Ồ": "O", + "Ố": "O", + "Ỗ": "O", + "Ổ": "O", + "Õ": "O", + "Ṍ": "O", + "Ȭ": "O", + "Ṏ": "O", + "Ō": "O", + "Ṑ": "O", + "Ṓ": "O", + "Ŏ": "O", + "Ȯ": "O", + "Ȱ": "O", + "Ö": "O", + "Ȫ": "O", + "Ỏ": "O", + "Ő": "O", + "Ǒ": "O", + "Ȍ": "O", + "Ȏ": "O", + "Ơ": "O", + "Ờ": "O", + "Ớ": "O", + "Ỡ": "O", + "Ở": "O", + "Ợ": "O", + "Ọ": "O", + "Ộ": "O", + "Ǫ": "O", + "Ǭ": "O", + "Ø": "O", + "Ǿ": "O", + "Ɔ": "O", + "Ɵ": "O", + "Ꝋ": "O", + "Ꝍ": "O", + "Ⓟ": "P", + "P": "P", + "Ṕ": "P", + "Ṗ": "P", + "Ƥ": "P", + "Ᵽ": "P", + "Ꝑ": "P", + "Ꝓ": "P", + "Ꝕ": "P", + "Ⓠ": "Q", + "Q": "Q", + "Ꝗ": "Q", + "Ꝙ": "Q", + "Ɋ": "Q", + "Ⓡ": "R", + "R": "R", + "Ŕ": "R", + "Ṙ": "R", + "Ř": "R", + "Ȑ": "R", + "Ȓ": "R", + "Ṛ": "R", + "Ṝ": "R", + "Ŗ": "R", + "Ṟ": "R", + "Ɍ": "R", + "Ɽ": "R", + "Ꝛ": "R", + "Ꞧ": "R", + "Ꞃ": "R", + "Ⓢ": "S", + "S": "S", + "ẞ": "S", + "Ś": "S", + "Ṥ": "S", + "Ŝ": "S", + "Ṡ": "S", + "Š": "S", + "Ṧ": "S", + "Ṣ": "S", + "Ṩ": "S", + "Ș": "S", + "Ş": "S", + "Ȿ": "S", + "Ꞩ": "S", + "Ꞅ": "S", + "Ⓣ": "T", + "T": "T", + "Ṫ": "T", + "Ť": "T", + "Ṭ": "T", + "Ț": "T", + "Ţ": "T", + "Ṱ": "T", + "Ṯ": "T", + "Ŧ": "T", + "Ƭ": "T", + "Ʈ": "T", + "Ⱦ": "T", + "Ꞇ": "T", + "Ⓤ": "U", + "U": "U", + "Ù": "U", + "Ú": "U", + "Û": "U", + "Ũ": "U", + "Ṹ": "U", + "Ū": "U", + "Ṻ": "U", + "Ŭ": "U", + "Ü": "U", + "Ǜ": "U", + "Ǘ": "U", + "Ǖ": "U", + "Ǚ": "U", + "Ủ": "U", + "Ů": "U", + "Ű": "U", + "Ǔ": "U", + "Ȕ": "U", + "Ȗ": "U", + "Ư": "U", + "Ừ": "U", + "Ứ": "U", + "Ữ": "U", + "Ử": "U", + "Ự": "U", + "Ụ": "U", + "Ṳ": "U", + "Ų": "U", + "Ṷ": "U", + "Ṵ": "U", + "Ʉ": "U", + "Ⓥ": "V", + "V": "V", + "Ṽ": "V", + "Ṿ": "V", + "Ʋ": "V", + "Ꝟ": "V", + "Ʌ": "V", + "Ⓦ": "W", + "W": "W", + "Ẁ": "W", + "Ẃ": "W", + "Ŵ": "W", + "Ẇ": "W", + "Ẅ": "W", + "Ẉ": "W", + "Ⱳ": "W", + "Ⓧ": "X", + "X": "X", + "Ẋ": "X", + "Ẍ": "X", + "Ⓨ": "Y", + "Y": "Y", + "Ỳ": "Y", + "Ý": "Y", + "Ŷ": "Y", + "Ỹ": "Y", + "Ȳ": "Y", + "Ẏ": "Y", + "Ÿ": "Y", + "Ỷ": "Y", + "Ỵ": "Y", + "Ƴ": "Y", + "Ɏ": "Y", + "Ỿ": "Y", + "Ⓩ": "Z", + "Z": "Z", + "Ź": "Z", + "Ẑ": "Z", + "Ż": "Z", + "Ž": "Z", + "Ẓ": "Z", + "Ẕ": "Z", + "Ƶ": "Z", + "Ȥ": "Z", + "Ɀ": "Z", + "Ⱬ": "Z", + "Ꝣ": "Z", + "ⓐ": "a", + "a": "a", + "ẚ": "a", + "à": "a", + "á": "a", + "â": "a", + "ầ": "a", + "ấ": "a", + "ẫ": "a", + "ẩ": "a", + "ã": "a", + "ā": "a", + "ă": "a", + "ằ": "a", + "ắ": "a", + "ẵ": "a", + "ẳ": "a", + "ȧ": "a", + "ǡ": "a", + "ä": "a", + "ǟ": "a", + "ả": "a", + "å": "a", + "ǻ": "a", + "ǎ": "a", + "ȁ": "a", + "ȃ": "a", + "ạ": "a", + "ậ": "a", + "ặ": "a", + "ḁ": "a", + "ą": "a", + "ⱥ": "a", + "ɐ": "a", + "ⓑ": "b", + "b": "b", + "ḃ": "b", + "ḅ": "b", + "ḇ": "b", + "ƀ": "b", + "ƃ": "b", + "ɓ": "b", + "ⓒ": "c", + "c": "c", + "ć": "c", + "ĉ": "c", + "ċ": "c", + "č": "c", + "ç": "c", + "ḉ": "c", + "ƈ": "c", + "ȼ": "c", + "ꜿ": "c", + "ↄ": "c", + "ⓓ": "d", + "d": "d", + "ḋ": "d", + "ď": "d", + "ḍ": "d", + "ḑ": "d", + "ḓ": "d", + "ḏ": "d", + "đ": "d", + "ƌ": "d", + "ɖ": "d", + "ɗ": "d", + "ꝺ": "d", + "ⓔ": "e", + "e": "e", + "è": "e", + "é": "e", + "ê": "e", + "ề": "e", + "ế": "e", + "ễ": "e", + "ể": "e", + "ẽ": "e", + "ē": "e", + "ḕ": "e", + "ḗ": "e", + "ĕ": "e", + "ė": "e", + "ë": "e", + "ẻ": "e", + "ě": "e", + "ȅ": "e", + "ȇ": "e", + "ẹ": "e", + "ệ": "e", + "ȩ": "e", + "ḝ": "e", + "ę": "e", + "ḙ": "e", + "ḛ": "e", + "ɇ": "e", + "ɛ": "e", + "ǝ": "e", + "ⓕ": "f", + "f": "f", + "ḟ": "f", + "ƒ": "f", + "ꝼ": "f", + "ⓖ": "g", + "g": "g", + "ǵ": "g", + "ĝ": "g", + "ḡ": "g", + "ğ": "g", + "ġ": "g", + "ǧ": "g", + "ģ": "g", + "ǥ": "g", + "ɠ": "g", + "ꞡ": "g", + "ᵹ": "g", + "ꝿ": "g", + "ⓗ": "h", + "h": "h", + "ĥ": "h", + "ḣ": "h", + "ḧ": "h", + "ȟ": "h", + "ḥ": "h", + "ḩ": "h", + "ḫ": "h", + "ẖ": "h", + "ħ": "h", + "ⱨ": "h", + "ⱶ": "h", + "ɥ": "h", + "ⓘ": "i", + "i": "i", + "ì": "i", + "í": "i", + "î": "i", + "ĩ": "i", + "ī": "i", + "ĭ": "i", + "ï": "i", + "ḯ": "i", + "ỉ": "i", + "ǐ": "i", + "ȉ": "i", + "ȋ": "i", + "ị": "i", + "į": "i", + "ḭ": "i", + "ɨ": "i", + "ı": "i", + "ⓙ": "j", + "j": "j", + "ĵ": "j", + "ǰ": "j", + "ɉ": "j", + "ⓚ": "k", + "k": "k", + "ḱ": "k", + "ǩ": "k", + "ḳ": "k", + "ķ": "k", + "ḵ": "k", + "ƙ": "k", + "ⱪ": "k", + "ꝁ": "k", + "ꝃ": "k", + "ꝅ": "k", + "ꞣ": "k", + "ⓛ": "l", + "l": "l", + "ŀ": "l", + "ĺ": "l", + "ľ": "l", + "ḷ": "l", + "ḹ": "l", + "ļ": "l", + "ḽ": "l", + "ḻ": "l", + "ſ": "l", + "ł": "l", + "ƚ": "l", + "ɫ": "l", + "ⱡ": "l", + "ꝉ": "l", + "ꞁ": "l", + "ꝇ": "l", + "ⓜ": "m", + "m": "m", + "ḿ": "m", + "ṁ": "m", + "ṃ": "m", + "ɱ": "m", + "ɯ": "m", + "ⓝ": "n", + "n": "n", + "ǹ": "n", + "ń": "n", + "ñ": "n", + "ṅ": "n", + "ň": "n", + "ṇ": "n", + "ņ": "n", + "ṋ": "n", + "ṉ": "n", + "ƞ": "n", + "ɲ": "n", + "ʼn": "n", + "ꞑ": "n", + "ꞥ": "n", + "ⓞ": "o", + "o": "o", + "ò": "o", + "ó": "o", + "ô": "o", + "ồ": "o", + "ố": "o", + "ỗ": "o", + "ổ": "o", + "õ": "o", + "ṍ": "o", + "ȭ": "o", + "ṏ": "o", + "ō": "o", + "ṑ": "o", + "ṓ": "o", + "ŏ": "o", + "ȯ": "o", + "ȱ": "o", + "ö": "o", + "ȫ": "o", + "ỏ": "o", + "ő": "o", + "ǒ": "o", + "ȍ": "o", + "ȏ": "o", + "ơ": "o", + "ờ": "o", + "ớ": "o", + "ỡ": "o", + "ở": "o", + "ợ": "o", + "ọ": "o", + "ộ": "o", + "ǫ": "o", + "ǭ": "o", + "ø": "o", + "ǿ": "o", + "ɔ": "o", + "ꝋ": "o", + "ꝍ": "o", + "ɵ": "o", + "ⓟ": "p", + "p": "p", + "ṕ": "p", + "ṗ": "p", + "ƥ": "p", + "ᵽ": "p", + "ꝑ": "p", + "ꝓ": "p", + "ꝕ": "p", + "ⓠ": "q", + "q": "q", + "ɋ": "q", + "ꝗ": "q", + "ꝙ": "q", + "ⓡ": "r", + "r": "r", + "ŕ": "r", + "ṙ": "r", + "ř": "r", + "ȑ": "r", + "ȓ": "r", + "ṛ": "r", + "ṝ": "r", + "ŗ": "r", + "ṟ": "r", + "ɍ": "r", + "ɽ": "r", + "ꝛ": "r", + "ꞧ": "r", + "ꞃ": "r", + "ⓢ": "s", + "s": "s", + "ß": "s", + "ś": "s", + "ṥ": "s", + "ŝ": "s", + "ṡ": "s", + "š": "s", + "ṧ": "s", + "ṣ": "s", + "ṩ": "s", + "ș": "s", + "ş": "s", + "ȿ": "s", + "ꞩ": "s", + "ꞅ": "s", + "ẛ": "s", + "ⓣ": "t", + "t": "t", + "ṫ": "t", + "ẗ": "t", + "ť": "t", + "ṭ": "t", + "ț": "t", + "ţ": "t", + "ṱ": "t", + "ṯ": "t", + "ŧ": "t", + "ƭ": "t", + "ʈ": "t", + "ⱦ": "t", + "ꞇ": "t", + "ⓤ": "u", + "u": "u", + "ù": "u", + "ú": "u", + "û": "u", + "ũ": "u", + "ṹ": "u", + "ū": "u", + "ṻ": "u", + "ŭ": "u", + "ü": "u", + "ǜ": "u", + "ǘ": "u", + "ǖ": "u", + "ǚ": "u", + "ủ": "u", + "ů": "u", + "ű": "u", + "ǔ": "u", + "ȕ": "u", + "ȗ": "u", + "ư": "u", + "ừ": "u", + "ứ": "u", + "ữ": "u", + "ử": "u", + "ự": "u", + "ụ": "u", + "ṳ": "u", + "ų": "u", + "ṷ": "u", + "ṵ": "u", + "ʉ": "u", + "ⓥ": "v", + "v": "v", + "ṽ": "v", + "ṿ": "v", + "ʋ": "v", + "ꝟ": "v", + "ʌ": "v", + "ⓦ": "w", + "w": "w", + "ẁ": "w", + "ẃ": "w", + "ŵ": "w", + "ẇ": "w", + "ẅ": "w", + "ẘ": "w", + "ẉ": "w", + "ⱳ": "w", + "ⓧ": "x", + "x": "x", + "ẋ": "x", + "ẍ": "x", + "ⓨ": "y", + "y": "y", + "ỳ": "y", + "ý": "y", + "ŷ": "y", + "ỹ": "y", + "ȳ": "y", + "ẏ": "y", + "ÿ": "y", + "ỷ": "y", + "ẙ": "y", + "ỵ": "y", + "ƴ": "y", + "ɏ": "y", + "ỿ": "y", + "ⓩ": "z", + "z": "z", + "ź": "z", + "ẑ": "z", + "ż": "z", + "ž": "z", + "ẓ": "z", + "ẕ": "z", + "ƶ": "z", + "ȥ": "z", + "ɀ": "z", + "ⱬ": "z", + "ꝣ": "z" +}; +exports.StringUtility = StringUtility; + +}); + +unwrapExports(utilities); + +var models = createCommonjsModule(function (module, exports) { +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); + + +class ModelResult { +} +exports.ModelResult = ModelResult; +class ExtendedModelResult extends ModelResult { + constructor(source = null) { + super(); + if (source) { + this.text = source.text; + this.start = source.start; + this.end = source.end; + this.typeName = source.typeName; + this.resolution = source.resolution; + } + } +} +exports.ExtendedModelResult = ExtendedModelResult; +class ModelFactoryKey { + constructor(culture$$1, modelType, options = null) { + this.culture = culture$$1 ? culture$$1.toLowerCase() : null; + this.modelType = modelType; + this.options = options; + } + toString() { + return JSON.stringify(this); + } + static fromString(key) { + return JSON.parse(key); + } +} +class ModelFactory { + constructor() { + this.modelFactories = new Map(); + } + getModel(modelTypeName, culture$$1, fallbackToDefaultCulture, options) { + let result = this.tryGetModel(modelTypeName, culture$$1, options); + if (!result.containsModel && fallbackToDefaultCulture) { + result = this.tryGetModel(modelTypeName, ModelFactory.fallbackCulture, options); + } + if (result.containsModel) { + return result.model; + } + throw new Error(`Could not find Model with the specified configuration: ${culture$$1},${modelTypeName}`); + } + tryGetModel(modelTypeName, culture$$1, options) { + culture$$1 = culture.Culture.mapToNearestLanguage(culture$$1); + let cacheResult = this.getModelFromCache(modelTypeName, culture$$1, options); + if (cacheResult) + return { containsModel: true, model: cacheResult }; + let key = this.generateKey(modelTypeName, culture$$1); + if (this.modelFactories.has(key)) { + let model = this.modelFactories.get(key)(options); + this.registerModelInCache(modelTypeName, culture$$1, options, model); + return { containsModel: true, model: model }; + } + return { containsModel: false }; + } + registerModel(modelTypeName, culture$$1, modelCreator) { + let key = this.generateKey(modelTypeName, culture$$1); + if (this.modelFactories.has(key)) { + throw new Error(`${culture$$1}-${modelTypeName} has already been registered.`); + } + this.modelFactories.set(key, modelCreator); + } + initializeModels(targetCulture, options) { + this.modelFactories.forEach((value, key) => { + let modelFactoryKey = ModelFactoryKey.fromString(key); + if (utilities.StringUtility.isNullOrEmpty(targetCulture) || modelFactoryKey.culture === targetCulture) { + this.tryGetModel(modelFactoryKey.modelType, modelFactoryKey.culture, modelFactoryKey.options); + } + }); + } + generateKey(modelTypeName, culture$$1) { + return new ModelFactoryKey(culture$$1, modelTypeName).toString(); + } + getModelFromCache(modelTypeName, culture$$1, options) { + let key = this.generateCacheKey(modelTypeName, culture$$1, options); + return ModelFactory.cache.get(key); + } + registerModelInCache(modelTypeName, culture$$1, options, model) { + let key = this.generateCacheKey(modelTypeName, culture$$1, options); + ModelFactory.cache.set(key, model); + } + generateCacheKey(modelTypeName, culture$$1, options) { + return new ModelFactoryKey(culture$$1, modelTypeName, options).toString(); + } +} +ModelFactory.fallbackCulture = culture.Culture.English; +ModelFactory.cache = new Map(); +exports.ModelFactory = ModelFactory; + +}); + +unwrapExports(models); + +var recognizer = createCommonjsModule(function (module, exports) { +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); + +class Recognizer { + constructor(targetCulture, options, lazyInitialization) { + this.modelFactory = new models.ModelFactory(); + if (!this.IsValidOptions(options)) + throw new Error(`${options} is not a valid options value.`); + this.TargetCulture = targetCulture; + this.Options = options; + this.InitializeConfiguration(); + if (!lazyInitialization) { + this.initializeModels(targetCulture, options); + } + } + getModel(modelTypeName, culture, fallbackToDefaultCulture) { + return this.modelFactory.getModel(modelTypeName, culture || this.TargetCulture, fallbackToDefaultCulture, this.Options); + } + registerModel(modelTypeName, culture, modelCreator) { + this.modelFactory.registerModel(modelTypeName, culture, modelCreator); + } + initializeModels(targetCulture, options) { + this.modelFactory.initializeModels(targetCulture, options); + } +} +exports.Recognizer = Recognizer; + +}); + +unwrapExports(recognizer); + +var extractors = createCommonjsModule(function (module, exports) { +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +class ExtractResult { + static isOverlap(erA, erB) { + return !(erA.start >= erB.start + erB.length) && !(erB.start >= erA.start + erA.length); + } + static isCover(er1, er2) { + return ((er2.start < er1.start) && ((er2.start + er2.length) >= (er1.start + er1.length))) + || ((er2.start <= er1.start) && ((er2.start + er2.length) > (er1.start + er1.length))); + } + static getFromText(source) { + return { + start: 0, + length: source.length, + text: source, + type: 'custom' + }; + } +} +exports.ExtractResult = ExtractResult; + +}); + +unwrapExports(extractors); + +var parsers = createCommonjsModule(function (module, exports) { +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); + +class ParseResult extends extractors.ExtractResult { + constructor(er) { + super(); + if (er) { + this.length = er.length; + this.start = er.start; + this.data = er.data; + this.text = er.text; + this.type = er.type; + } + this.resolutionStr = ""; + } +} +exports.ParseResult = ParseResult; + +}); + +unwrapExports(parsers); + +var recognizersText = createCommonjsModule(function (module, exports) { +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); + +exports.Culture = culture.Culture; +exports.CultureInfo = culture.CultureInfo; + +exports.ModelResult = models.ModelResult; +exports.ModelFactory = models.ModelFactory; + +exports.Recognizer = recognizer.Recognizer; + +exports.ExtractResult = extractors.ExtractResult; + +exports.ParseResult = parsers.ParseResult; + +exports.FormatUtility = utilities.FormatUtility; +exports.StringUtility = utilities.StringUtility; +exports.Match = utilities.Match; +exports.RegExpUtility = utilities.RegExpUtility; + +}); + +unwrapExports(recognizersText); + +/** + * lodash (Custom Build) + * Build: `lodash modularize exports="npm" -o ./` + * Copyright jQuery Foundation and other contributors + * Released under MIT license + * Based on Underscore.js 1.8.3 + * Copyright Jeremy Ashkenas, DocumentCloud and Investigative Reporters & Editors + */ + +/** Used as references for various `Number` constants. */ +var INFINITY = 1 / 0; + +/** `Object#toString` result references. */ +var symbolTag = '[object Symbol]'; + +/** Used to match leading and trailing whitespace. */ +var reTrimEnd = /\s+$/; + +/** Used to compose unicode character classes. */ +var rsAstralRange = '\\ud800-\\udfff'; +var rsComboMarksRange = '\\u0300-\\u036f\\ufe20-\\ufe23'; +var rsComboSymbolsRange = '\\u20d0-\\u20f0'; +var rsVarRange = '\\ufe0e\\ufe0f'; + +/** Used to compose unicode capture groups. */ +var rsAstral = '[' + rsAstralRange + ']'; +var rsCombo = '[' + rsComboMarksRange + rsComboSymbolsRange + ']'; +var rsFitz = '\\ud83c[\\udffb-\\udfff]'; +var rsModifier = '(?:' + rsCombo + '|' + rsFitz + ')'; +var rsNonAstral = '[^' + rsAstralRange + ']'; +var rsRegional = '(?:\\ud83c[\\udde6-\\uddff]){2}'; +var rsSurrPair = '[\\ud800-\\udbff][\\udc00-\\udfff]'; +var rsZWJ = '\\u200d'; + +/** Used to compose unicode regexes. */ +var reOptMod = rsModifier + '?'; +var rsOptVar = '[' + rsVarRange + ']?'; +var rsOptJoin = '(?:' + rsZWJ + '(?:' + [rsNonAstral, rsRegional, rsSurrPair].join('|') + ')' + rsOptVar + reOptMod + ')*'; +var rsSeq = rsOptVar + reOptMod + rsOptJoin; +var rsSymbol = '(?:' + [rsNonAstral + rsCombo + '?', rsCombo, rsRegional, rsSurrPair, rsAstral].join('|') + ')'; + +/** Used to match [string symbols](https://mathiasbynens.be/notes/javascript-unicode). */ +var reUnicode = RegExp(rsFitz + '(?=' + rsFitz + ')|' + rsSymbol + rsSeq, 'g'); + +/** Used to detect strings with [zero-width joiners or code points from the astral planes](http://eev.ee/blog/2015/09/12/dark-corners-of-unicode/). */ +var reHasUnicode = RegExp('[' + rsZWJ + rsAstralRange + rsComboMarksRange + rsComboSymbolsRange + rsVarRange + ']'); + +/** Detect free variable `global` from Node.js. */ +var freeGlobal = typeof commonjsGlobal == 'object' && commonjsGlobal && commonjsGlobal.Object === Object && commonjsGlobal; + +/** Detect free variable `self`. */ +var freeSelf = typeof self == 'object' && self && self.Object === Object && self; + +/** Used as a reference to the global object. */ +var root = freeGlobal || freeSelf || Function('return this')(); + +/** + * Converts an ASCII `string` to an array. + * + * @private + * @param {string} string The string to convert. + * @returns {Array} Returns the converted array. + */ +function asciiToArray(string) { + return string.split(''); +} + +/** + * The base implementation of `_.findIndex` and `_.findLastIndex` without + * support for iteratee shorthands. + * + * @private + * @param {Array} array The array to inspect. + * @param {Function} predicate The function invoked per iteration. + * @param {number} fromIndex The index to search from. + * @param {boolean} [fromRight] Specify iterating from right to left. + * @returns {number} Returns the index of the matched value, else `-1`. + */ +function baseFindIndex(array, predicate, fromIndex, fromRight) { + var length = array.length, + index = fromIndex + (fromRight ? 1 : -1); + + while ((fromRight ? index-- : ++index < length)) { + if (predicate(array[index], index, array)) { + return index; + } + } + return -1; +} + +/** + * The base implementation of `_.indexOf` without `fromIndex` bounds checks. + * + * @private + * @param {Array} array The array to inspect. + * @param {*} value The value to search for. + * @param {number} fromIndex The index to search from. + * @returns {number} Returns the index of the matched value, else `-1`. + */ +function baseIndexOf(array, value, fromIndex) { + if (value !== value) { + return baseFindIndex(array, baseIsNaN, fromIndex); + } + var index = fromIndex - 1, + length = array.length; + + while (++index < length) { + if (array[index] === value) { + return index; + } + } + return -1; +} + +/** + * The base implementation of `_.isNaN` without support for number objects. + * + * @private + * @param {*} value The value to check. + * @returns {boolean} Returns `true` if `value` is `NaN`, else `false`. + */ +function baseIsNaN(value) { + return value !== value; +} + +/** + * Used by `_.trim` and `_.trimEnd` to get the index of the last string symbol + * that is not found in the character symbols. + * + * @private + * @param {Array} strSymbols The string symbols to inspect. + * @param {Array} chrSymbols The character symbols to find. + * @returns {number} Returns the index of the last unmatched string symbol. + */ +function charsEndIndex(strSymbols, chrSymbols) { + var index = strSymbols.length; + + while (index-- && baseIndexOf(chrSymbols, strSymbols[index], 0) > -1) {} + return index; +} + +/** + * Checks if `string` contains Unicode symbols. + * + * @private + * @param {string} string The string to inspect. + * @returns {boolean} Returns `true` if a symbol is found, else `false`. + */ +function hasUnicode(string) { + return reHasUnicode.test(string); +} + +/** + * Converts `string` to an array. + * + * @private + * @param {string} string The string to convert. + * @returns {Array} Returns the converted array. + */ +function stringToArray(string) { + return hasUnicode(string) + ? unicodeToArray(string) + : asciiToArray(string); +} + +/** + * Converts a Unicode `string` to an array. + * + * @private + * @param {string} string The string to convert. + * @returns {Array} Returns the converted array. + */ +function unicodeToArray(string) { + return string.match(reUnicode) || []; +} + +/** Used for built-in method references. */ +var objectProto = Object.prototype; + +/** + * Used to resolve the + * [`toStringTag`](http://ecma-international.org/ecma-262/7.0/#sec-object.prototype.tostring) + * of values. + */ +var objectToString = objectProto.toString; + +/** Built-in value references. */ +var Symbol$1 = root.Symbol; + +/** Used to convert symbols to primitives and strings. */ +var symbolProto = Symbol$1 ? Symbol$1.prototype : undefined; +var symbolToString = symbolProto ? symbolProto.toString : undefined; + +/** + * The base implementation of `_.slice` without an iteratee call guard. + * + * @private + * @param {Array} array The array to slice. + * @param {number} [start=0] The start position. + * @param {number} [end=array.length] The end position. + * @returns {Array} Returns the slice of `array`. + */ +function baseSlice(array, start, end) { + var index = -1, + length = array.length; + + if (start < 0) { + start = -start > length ? 0 : (length + start); + } + end = end > length ? length : end; + if (end < 0) { + end += length; + } + length = start > end ? 0 : ((end - start) >>> 0); + start >>>= 0; + + var result = Array(length); + while (++index < length) { + result[index] = array[index + start]; + } + return result; +} + +/** + * The base implementation of `_.toString` which doesn't convert nullish + * values to empty strings. + * + * @private + * @param {*} value The value to process. + * @returns {string} Returns the string. + */ +function baseToString(value) { + // Exit early for strings to avoid a performance hit in some environments. + if (typeof value == 'string') { + return value; + } + if (isSymbol(value)) { + return symbolToString ? symbolToString.call(value) : ''; + } + var result = (value + ''); + return (result == '0' && (1 / value) == -INFINITY) ? '-0' : result; +} + +/** + * Casts `array` to a slice if it's needed. + * + * @private + * @param {Array} array The array to inspect. + * @param {number} start The start position. + * @param {number} [end=array.length] The end position. + * @returns {Array} Returns the cast slice. + */ +function castSlice(array, start, end) { + var length = array.length; + end = end === undefined ? length : end; + return (!start && end >= length) ? array : baseSlice(array, start, end); +} + +/** + * Checks if `value` is object-like. A value is object-like if it's not `null` + * and has a `typeof` result of "object". + * + * @static + * @memberOf _ + * @since 4.0.0 + * @category Lang + * @param {*} value The value to check. + * @returns {boolean} Returns `true` if `value` is object-like, else `false`. + * @example + * + * _.isObjectLike({}); + * // => true + * + * _.isObjectLike([1, 2, 3]); + * // => true + * + * _.isObjectLike(_.noop); + * // => false + * + * _.isObjectLike(null); + * // => false + */ +function isObjectLike(value) { + return !!value && typeof value == 'object'; +} + +/** + * Checks if `value` is classified as a `Symbol` primitive or object. + * + * @static + * @memberOf _ + * @since 4.0.0 + * @category Lang + * @param {*} value The value to check. + * @returns {boolean} Returns `true` if `value` is a symbol, else `false`. + * @example + * + * _.isSymbol(Symbol.iterator); + * // => true + * + * _.isSymbol('abc'); + * // => false + */ +function isSymbol(value) { + return typeof value == 'symbol' || + (isObjectLike(value) && objectToString.call(value) == symbolTag); +} + +/** + * Converts `value` to a string. An empty string is returned for `null` + * and `undefined` values. The sign of `-0` is preserved. + * + * @static + * @memberOf _ + * @since 4.0.0 + * @category Lang + * @param {*} value The value to process. + * @returns {string} Returns the string. + * @example + * + * _.toString(null); + * // => '' + * + * _.toString(-0); + * // => '-0' + * + * _.toString([1, 2, 3]); + * // => '1,2,3' + */ +function toString(value) { + return value == null ? '' : baseToString(value); +} + +/** + * Removes trailing whitespace or specified characters from `string`. + * + * @static + * @memberOf _ + * @since 4.0.0 + * @category String + * @param {string} [string=''] The string to trim. + * @param {string} [chars=whitespace] The characters to trim. + * @param- {Object} [guard] Enables use as an iteratee for methods like `_.map`. + * @returns {string} Returns the trimmed string. + * @example + * + * _.trimEnd(' abc '); + * // => ' abc' + * + * _.trimEnd('-_-abc-_-', '_-'); + * // => '-_-abc' + */ +function trimEnd(string, chars, guard) { + string = toString(string); + if (string && (guard || chars === undefined)) { + return string.replace(reTrimEnd, ''); + } + if (!string || !(chars = baseToString(chars))) { + return string; + } + var strSymbols = stringToArray(string), + end = charsEndIndex(strSymbols, stringToArray(chars)) + 1; + + return castSlice(strSymbols, 0, end).join(''); +} + +var lodash_trimend = trimEnd; + +var bignumber = createCommonjsModule(function (module) { +(function (globalObject) { + 'use strict'; + +/* + * bignumber.js v7.2.1 + * A JavaScript library for arbitrary-precision arithmetic. + * https://github.com/MikeMcl/bignumber.js + * Copyright (c) 2018 Michael Mclaughlin + * MIT Licensed. + * + * BigNumber.prototype methods | BigNumber methods + * | + * absoluteValue abs | clone + * comparedTo | config set + * decimalPlaces dp | DECIMAL_PLACES + * dividedBy div | ROUNDING_MODE + * dividedToIntegerBy idiv | EXPONENTIAL_AT + * exponentiatedBy pow | RANGE + * integerValue | CRYPTO + * isEqualTo eq | MODULO_MODE + * isFinite | POW_PRECISION + * isGreaterThan gt | FORMAT + * isGreaterThanOrEqualTo gte | ALPHABET + * isInteger | isBigNumber + * isLessThan lt | maximum max + * isLessThanOrEqualTo lte | minimum min + * isNaN | random + * isNegative | + * isPositive | + * isZero | + * minus | + * modulo mod | + * multipliedBy times | + * negated | + * plus | + * precision sd | + * shiftedBy | + * squareRoot sqrt | + * toExponential | + * toFixed | + * toFormat | + * toFraction | + * toJSON | + * toNumber | + * toPrecision | + * toString | + * valueOf | + * + */ + + + var BigNumber, + isNumeric = /^-?(?:\d+(?:\.\d*)?|\.\d+)(?:e[+-]?\d+)?$/i, + + mathceil = Math.ceil, + mathfloor = Math.floor, + + bignumberError = '[BigNumber Error] ', + tooManyDigits = bignumberError + 'Number primitive has more than 15 significant digits: ', + + BASE = 1e14, + LOG_BASE = 14, + MAX_SAFE_INTEGER = 0x1fffffffffffff, // 2^53 - 1 + // MAX_INT32 = 0x7fffffff, // 2^31 - 1 + POWS_TEN = [1, 10, 100, 1e3, 1e4, 1e5, 1e6, 1e7, 1e8, 1e9, 1e10, 1e11, 1e12, 1e13], + SQRT_BASE = 1e7, + + // EDITABLE + // The limit on the value of DECIMAL_PLACES, TO_EXP_NEG, TO_EXP_POS, MIN_EXP, MAX_EXP, and + // the arguments to toExponential, toFixed, toFormat, and toPrecision. + MAX = 1E9; // 0 to MAX_INT32 + + + /* + * Create and return a BigNumber constructor. + */ + function clone(configObject) { + var div, convertBase, parseNumeric, + P = BigNumber.prototype = { constructor: BigNumber, toString: null, valueOf: null }, + ONE = new BigNumber(1), + + + //----------------------------- EDITABLE CONFIG DEFAULTS ------------------------------- + + + // The default values below must be integers within the inclusive ranges stated. + // The values can also be changed at run-time using BigNumber.set. + + // The maximum number of decimal places for operations involving division. + DECIMAL_PLACES = 20, // 0 to MAX + + // The rounding mode used when rounding to the above decimal places, and when using + // toExponential, toFixed, toFormat and toPrecision, and round (default value). + // UP 0 Away from zero. + // DOWN 1 Towards zero. + // CEIL 2 Towards +Infinity. + // FLOOR 3 Towards -Infinity. + // HALF_UP 4 Towards nearest neighbour. If equidistant, up. + // HALF_DOWN 5 Towards nearest neighbour. If equidistant, down. + // HALF_EVEN 6 Towards nearest neighbour. If equidistant, towards even neighbour. + // HALF_CEIL 7 Towards nearest neighbour. If equidistant, towards +Infinity. + // HALF_FLOOR 8 Towards nearest neighbour. If equidistant, towards -Infinity. + ROUNDING_MODE = 4, // 0 to 8 + + // EXPONENTIAL_AT : [TO_EXP_NEG , TO_EXP_POS] + + // The exponent value at and beneath which toString returns exponential notation. + // Number type: -7 + TO_EXP_NEG = -7, // 0 to -MAX + + // The exponent value at and above which toString returns exponential notation. + // Number type: 21 + TO_EXP_POS = 21, // 0 to MAX + + // RANGE : [MIN_EXP, MAX_EXP] + + // The minimum exponent value, beneath which underflow to zero occurs. + // Number type: -324 (5e-324) + MIN_EXP = -1e7, // -1 to -MAX + + // The maximum exponent value, above which overflow to Infinity occurs. + // Number type: 308 (1.7976931348623157e+308) + // For MAX_EXP > 1e7, e.g. new BigNumber('1e100000000').plus(1) may be slow. + MAX_EXP = 1e7, // 1 to MAX + + // Whether to use cryptographically-secure random number generation, if available. + CRYPTO = false, // true or false + + // The modulo mode used when calculating the modulus: a mod n. + // The quotient (q = a / n) is calculated according to the corresponding rounding mode. + // The remainder (r) is calculated as: r = a - n * q. + // + // UP 0 The remainder is positive if the dividend is negative, else is negative. + // DOWN 1 The remainder has the same sign as the dividend. + // This modulo mode is commonly known as 'truncated division' and is + // equivalent to (a % n) in JavaScript. + // FLOOR 3 The remainder has the same sign as the divisor (Python %). + // HALF_EVEN 6 This modulo mode implements the IEEE 754 remainder function. + // EUCLID 9 Euclidian division. q = sign(n) * floor(a / abs(n)). + // The remainder is always positive. + // + // The truncated division, floored division, Euclidian division and IEEE 754 remainder + // modes are commonly used for the modulus operation. + // Although the other rounding modes can also be used, they may not give useful results. + MODULO_MODE = 1, // 0 to 9 + + // The maximum number of significant digits of the result of the exponentiatedBy operation. + // If POW_PRECISION is 0, there will be unlimited significant digits. + POW_PRECISION = 0, // 0 to MAX + + // The format specification used by the BigNumber.prototype.toFormat method. + FORMAT = { + decimalSeparator: '.', + groupSeparator: ',', + groupSize: 3, + secondaryGroupSize: 0, + fractionGroupSeparator: '\xA0', // non-breaking space + fractionGroupSize: 0 + }, + + // The alphabet used for base conversion. + // It must be at least 2 characters long, with no '.' or repeated character. + // '0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ$_' + ALPHABET = '0123456789abcdefghijklmnopqrstuvwxyz'; + + + //------------------------------------------------------------------------------------------ + + + // CONSTRUCTOR + + + /* + * The BigNumber constructor and exported function. + * Create and return a new instance of a BigNumber object. + * + * n {number|string|BigNumber} A numeric value. + * [b] {number} The base of n. Integer, 2 to ALPHABET.length inclusive. + */ + function BigNumber(n, b) { + var alphabet, c, caseChanged, e, i, isNum, len, str, + x = this; + + // Enable constructor usage without new. + if (!(x instanceof BigNumber)) { + + // Don't throw on constructor call without new (#81). + // '[BigNumber Error] Constructor call without new: {n}' + //throw Error(bignumberError + ' Constructor call without new: ' + n); + return new BigNumber(n, b); + } + + if (b == null) { + + // Duplicate. + if (n instanceof BigNumber) { + x.s = n.s; + x.e = n.e; + x.c = (n = n.c) ? n.slice() : n; + return; + } + + isNum = typeof n == 'number'; + + if (isNum && n * 0 == 0) { + + // Use `1 / n` to handle minus zero also. + x.s = 1 / n < 0 ? (n = -n, -1) : 1; + + // Faster path for integers. + if (n === ~~n) { + for (e = 0, i = n; i >= 10; i /= 10, e++); + x.e = e; + x.c = [n]; + return; + } + + str = n + ''; + } else { + if (!isNumeric.test(str = n + '')) return parseNumeric(x, str, isNum); + x.s = str.charCodeAt(0) == 45 ? (str = str.slice(1), -1) : 1; + } + + // Decimal point? + if ((e = str.indexOf('.')) > -1) str = str.replace('.', ''); + + // Exponential form? + if ((i = str.search(/e/i)) > 0) { + + // Determine exponent. + if (e < 0) e = i; + e += +str.slice(i + 1); + str = str.substring(0, i); + } else if (e < 0) { + + // Integer. + e = str.length; + } + + } else { + + // '[BigNumber Error] Base {not a primitive number|not an integer|out of range}: {b}' + intCheck(b, 2, ALPHABET.length, 'Base'); + str = n + ''; + + // Allow exponential notation to be used with base 10 argument, while + // also rounding to DECIMAL_PLACES as with other bases. + if (b == 10) { + x = new BigNumber(n instanceof BigNumber ? n : str); + return round(x, DECIMAL_PLACES + x.e + 1, ROUNDING_MODE); + } + + isNum = typeof n == 'number'; + + if (isNum) { + + // Avoid potential interpretation of Infinity and NaN as base 44+ values. + if (n * 0 != 0) return parseNumeric(x, str, isNum, b); + + x.s = 1 / n < 0 ? (str = str.slice(1), -1) : 1; + + // '[BigNumber Error] Number primitive has more than 15 significant digits: {n}' + if (BigNumber.DEBUG && str.replace(/^0\.0*|\./, '').length > 15) { + throw Error + (tooManyDigits + n); + } + + // Prevent later check for length on converted number. + isNum = false; + } else { + x.s = str.charCodeAt(0) === 45 ? (str = str.slice(1), -1) : 1; + } + + alphabet = ALPHABET.slice(0, b); + e = i = 0; + + // Check that str is a valid base b number. + // Don't use RegExp so alphabet can contain special characters. + for (len = str.length; i < len; i++) { + if (alphabet.indexOf(c = str.charAt(i)) < 0) { + if (c == '.') { + + // If '.' is not the first character and it has not be found before. + if (i > e) { + e = len; + continue; + } + } else if (!caseChanged) { + + // Allow e.g. hexadecimal 'FF' as well as 'ff'. + if (str == str.toUpperCase() && (str = str.toLowerCase()) || + str == str.toLowerCase() && (str = str.toUpperCase())) { + caseChanged = true; + i = -1; + e = 0; + continue; + } + } + + return parseNumeric(x, n + '', isNum, b); + } + } + + str = convertBase(str, b, 10, x.s); + + // Decimal point? + if ((e = str.indexOf('.')) > -1) str = str.replace('.', ''); + else e = str.length; + } + + // Determine leading zeros. + for (i = 0; str.charCodeAt(i) === 48; i++); + + // Determine trailing zeros. + for (len = str.length; str.charCodeAt(--len) === 48;); + + str = str.slice(i, ++len); + + if (str) { + len -= i; + + // '[BigNumber Error] Number primitive has more than 15 significant digits: {n}' + if (isNum && BigNumber.DEBUG && + len > 15 && (n > MAX_SAFE_INTEGER || n !== mathfloor(n))) { + throw Error + (tooManyDigits + (x.s * n)); + } + + e = e - i - 1; + + // Overflow? + if (e > MAX_EXP) { + + // Infinity. + x.c = x.e = null; + + // Underflow? + } else if (e < MIN_EXP) { + + // Zero. + x.c = [x.e = 0]; + } else { + x.e = e; + x.c = []; + + // Transform base + + // e is the base 10 exponent. + // i is where to slice str to get the first element of the coefficient array. + i = (e + 1) % LOG_BASE; + if (e < 0) i += LOG_BASE; + + if (i < len) { + if (i) x.c.push(+str.slice(0, i)); + + for (len -= LOG_BASE; i < len;) { + x.c.push(+str.slice(i, i += LOG_BASE)); + } + + str = str.slice(i); + i = LOG_BASE - str.length; + } else { + i -= len; + } + + for (; i--; str += '0'); + x.c.push(+str); + } + } else { + + // Zero. + x.c = [x.e = 0]; + } + } + + + // CONSTRUCTOR PROPERTIES + + + BigNumber.clone = clone; + + BigNumber.ROUND_UP = 0; + BigNumber.ROUND_DOWN = 1; + BigNumber.ROUND_CEIL = 2; + BigNumber.ROUND_FLOOR = 3; + BigNumber.ROUND_HALF_UP = 4; + BigNumber.ROUND_HALF_DOWN = 5; + BigNumber.ROUND_HALF_EVEN = 6; + BigNumber.ROUND_HALF_CEIL = 7; + BigNumber.ROUND_HALF_FLOOR = 8; + BigNumber.EUCLID = 9; + + + /* + * Configure infrequently-changing library-wide settings. + * + * Accept an object with the following optional properties (if the value of a property is + * a number, it must be an integer within the inclusive range stated): + * + * DECIMAL_PLACES {number} 0 to MAX + * ROUNDING_MODE {number} 0 to 8 + * EXPONENTIAL_AT {number|number[]} -MAX to MAX or [-MAX to 0, 0 to MAX] + * RANGE {number|number[]} -MAX to MAX (not zero) or [-MAX to -1, 1 to MAX] + * CRYPTO {boolean} true or false + * MODULO_MODE {number} 0 to 9 + * POW_PRECISION {number} 0 to MAX + * ALPHABET {string} A string of two or more unique characters which does + * not contain '.'. + * FORMAT {object} An object with some of the following properties: + * decimalSeparator {string} + * groupSeparator {string} + * groupSize {number} + * secondaryGroupSize {number} + * fractionGroupSeparator {string} + * fractionGroupSize {number} + * + * (The values assigned to the above FORMAT object properties are not checked for validity.) + * + * E.g. + * BigNumber.config({ DECIMAL_PLACES : 20, ROUNDING_MODE : 4 }) + * + * Ignore properties/parameters set to null or undefined, except for ALPHABET. + * + * Return an object with the properties current values. + */ + BigNumber.config = BigNumber.set = function (obj) { + var p, v; + + if (obj != null) { + + if (typeof obj == 'object') { + + // DECIMAL_PLACES {number} Integer, 0 to MAX inclusive. + // '[BigNumber Error] DECIMAL_PLACES {not a primitive number|not an integer|out of range}: {v}' + if (obj.hasOwnProperty(p = 'DECIMAL_PLACES')) { + v = obj[p]; + intCheck(v, 0, MAX, p); + DECIMAL_PLACES = v; + } + + // ROUNDING_MODE {number} Integer, 0 to 8 inclusive. + // '[BigNumber Error] ROUNDING_MODE {not a primitive number|not an integer|out of range}: {v}' + if (obj.hasOwnProperty(p = 'ROUNDING_MODE')) { + v = obj[p]; + intCheck(v, 0, 8, p); + ROUNDING_MODE = v; + } + + // EXPONENTIAL_AT {number|number[]} + // Integer, -MAX to MAX inclusive or + // [integer -MAX to 0 inclusive, 0 to MAX inclusive]. + // '[BigNumber Error] EXPONENTIAL_AT {not a primitive number|not an integer|out of range}: {v}' + if (obj.hasOwnProperty(p = 'EXPONENTIAL_AT')) { + v = obj[p]; + if (isArray(v)) { + intCheck(v[0], -MAX, 0, p); + intCheck(v[1], 0, MAX, p); + TO_EXP_NEG = v[0]; + TO_EXP_POS = v[1]; + } else { + intCheck(v, -MAX, MAX, p); + TO_EXP_NEG = -(TO_EXP_POS = v < 0 ? -v : v); + } + } + + // RANGE {number|number[]} Non-zero integer, -MAX to MAX inclusive or + // [integer -MAX to -1 inclusive, integer 1 to MAX inclusive]. + // '[BigNumber Error] RANGE {not a primitive number|not an integer|out of range|cannot be zero}: {v}' + if (obj.hasOwnProperty(p = 'RANGE')) { + v = obj[p]; + if (isArray(v)) { + intCheck(v[0], -MAX, -1, p); + intCheck(v[1], 1, MAX, p); + MIN_EXP = v[0]; + MAX_EXP = v[1]; + } else { + intCheck(v, -MAX, MAX, p); + if (v) { + MIN_EXP = -(MAX_EXP = v < 0 ? -v : v); + } else { + throw Error + (bignumberError + p + ' cannot be zero: ' + v); + } + } + } + + // CRYPTO {boolean} true or false. + // '[BigNumber Error] CRYPTO not true or false: {v}' + // '[BigNumber Error] crypto unavailable' + if (obj.hasOwnProperty(p = 'CRYPTO')) { + v = obj[p]; + if (v === !!v) { + if (v) { + if (typeof crypto != 'undefined' && crypto && + (crypto.getRandomValues || crypto.randomBytes)) { + CRYPTO = v; + } else { + CRYPTO = !v; + throw Error + (bignumberError + 'crypto unavailable'); + } + } else { + CRYPTO = v; + } + } else { + throw Error + (bignumberError + p + ' not true or false: ' + v); + } + } + + // MODULO_MODE {number} Integer, 0 to 9 inclusive. + // '[BigNumber Error] MODULO_MODE {not a primitive number|not an integer|out of range}: {v}' + if (obj.hasOwnProperty(p = 'MODULO_MODE')) { + v = obj[p]; + intCheck(v, 0, 9, p); + MODULO_MODE = v; + } + + // POW_PRECISION {number} Integer, 0 to MAX inclusive. + // '[BigNumber Error] POW_PRECISION {not a primitive number|not an integer|out of range}: {v}' + if (obj.hasOwnProperty(p = 'POW_PRECISION')) { + v = obj[p]; + intCheck(v, 0, MAX, p); + POW_PRECISION = v; + } + + // FORMAT {object} + // '[BigNumber Error] FORMAT not an object: {v}' + if (obj.hasOwnProperty(p = 'FORMAT')) { + v = obj[p]; + if (typeof v == 'object') FORMAT = v; + else throw Error + (bignumberError + p + ' not an object: ' + v); + } + + // ALPHABET {string} + // '[BigNumber Error] ALPHABET invalid: {v}' + if (obj.hasOwnProperty(p = 'ALPHABET')) { + v = obj[p]; + + // Disallow if only one character, or contains '.' or a repeated character. + if (typeof v == 'string' && !/^.$|\.|(.).*\1/.test(v)) { + ALPHABET = v; + } else { + throw Error + (bignumberError + p + ' invalid: ' + v); + } + } + + } else { + + // '[BigNumber Error] Object expected: {v}' + throw Error + (bignumberError + 'Object expected: ' + obj); + } + } + + return { + DECIMAL_PLACES: DECIMAL_PLACES, + ROUNDING_MODE: ROUNDING_MODE, + EXPONENTIAL_AT: [TO_EXP_NEG, TO_EXP_POS], + RANGE: [MIN_EXP, MAX_EXP], + CRYPTO: CRYPTO, + MODULO_MODE: MODULO_MODE, + POW_PRECISION: POW_PRECISION, + FORMAT: FORMAT, + ALPHABET: ALPHABET + }; + }; + + + /* + * Return true if v is a BigNumber instance, otherwise return false. + * + * v {any} + */ + BigNumber.isBigNumber = function (v) { + return v instanceof BigNumber || v && v._isBigNumber === true || false; + }; + + + /* + * Return a new BigNumber whose value is the maximum of the arguments. + * + * arguments {number|string|BigNumber} + */ + BigNumber.maximum = BigNumber.max = function () { + return maxOrMin(arguments, P.lt); + }; + + + /* + * Return a new BigNumber whose value is the minimum of the arguments. + * + * arguments {number|string|BigNumber} + */ + BigNumber.minimum = BigNumber.min = function () { + return maxOrMin(arguments, P.gt); + }; + + + /* + * Return a new BigNumber with a random value equal to or greater than 0 and less than 1, + * and with dp, or DECIMAL_PLACES if dp is omitted, decimal places (or less if trailing + * zeros are produced). + * + * [dp] {number} Decimal places. Integer, 0 to MAX inclusive. + * + * '[BigNumber Error] Argument {not a primitive number|not an integer|out of range}: {dp}' + * '[BigNumber Error] crypto unavailable' + */ + BigNumber.random = (function () { + var pow2_53 = 0x20000000000000; + + // Return a 53 bit integer n, where 0 <= n < 9007199254740992. + // Check if Math.random() produces more than 32 bits of randomness. + // If it does, assume at least 53 bits are produced, otherwise assume at least 30 bits. + // 0x40000000 is 2^30, 0x800000 is 2^23, 0x1fffff is 2^21 - 1. + var random53bitInt = (Math.random() * pow2_53) & 0x1fffff + ? function () { return mathfloor(Math.random() * pow2_53); } + : function () { return ((Math.random() * 0x40000000 | 0) * 0x800000) + + (Math.random() * 0x800000 | 0); }; + + return function (dp) { + var a, b, e, k, v, + i = 0, + c = [], + rand = new BigNumber(ONE); + + if (dp == null) dp = DECIMAL_PLACES; + else intCheck(dp, 0, MAX); + + k = mathceil(dp / LOG_BASE); + + if (CRYPTO) { + + // Browsers supporting crypto.getRandomValues. + if (crypto.getRandomValues) { + + a = crypto.getRandomValues(new Uint32Array(k *= 2)); + + for (; i < k;) { + + // 53 bits: + // ((Math.pow(2, 32) - 1) * Math.pow(2, 21)).toString(2) + // 11111 11111111 11111111 11111111 11100000 00000000 00000000 + // ((Math.pow(2, 32) - 1) >>> 11).toString(2) + // 11111 11111111 11111111 + // 0x20000 is 2^21. + v = a[i] * 0x20000 + (a[i + 1] >>> 11); + + // Rejection sampling: + // 0 <= v < 9007199254740992 + // Probability that v >= 9e15, is + // 7199254740992 / 9007199254740992 ~= 0.0008, i.e. 1 in 1251 + if (v >= 9e15) { + b = crypto.getRandomValues(new Uint32Array(2)); + a[i] = b[0]; + a[i + 1] = b[1]; + } else { + + // 0 <= v <= 8999999999999999 + // 0 <= (v % 1e14) <= 99999999999999 + c.push(v % 1e14); + i += 2; + } + } + i = k / 2; + + // Node.js supporting crypto.randomBytes. + } else if (crypto.randomBytes) { + + // buffer + a = crypto.randomBytes(k *= 7); + + for (; i < k;) { + + // 0x1000000000000 is 2^48, 0x10000000000 is 2^40 + // 0x100000000 is 2^32, 0x1000000 is 2^24 + // 11111 11111111 11111111 11111111 11111111 11111111 11111111 + // 0 <= v < 9007199254740992 + v = ((a[i] & 31) * 0x1000000000000) + (a[i + 1] * 0x10000000000) + + (a[i + 2] * 0x100000000) + (a[i + 3] * 0x1000000) + + (a[i + 4] << 16) + (a[i + 5] << 8) + a[i + 6]; + + if (v >= 9e15) { + crypto.randomBytes(7).copy(a, i); + } else { + + // 0 <= (v % 1e14) <= 99999999999999 + c.push(v % 1e14); + i += 7; + } + } + i = k / 7; + } else { + CRYPTO = false; + throw Error + (bignumberError + 'crypto unavailable'); + } + } + + // Use Math.random. + if (!CRYPTO) { + + for (; i < k;) { + v = random53bitInt(); + if (v < 9e15) c[i++] = v % 1e14; + } + } + + k = c[--i]; + dp %= LOG_BASE; + + // Convert trailing digits to zeros according to dp. + if (k && dp) { + v = POWS_TEN[LOG_BASE - dp]; + c[i] = mathfloor(k / v) * v; + } + + // Remove trailing elements which are zero. + for (; c[i] === 0; c.pop(), i--); + + // Zero? + if (i < 0) { + c = [e = 0]; + } else { + + // Remove leading elements which are zero and adjust exponent accordingly. + for (e = -1 ; c[0] === 0; c.splice(0, 1), e -= LOG_BASE); + + // Count the digits of the first element of c to determine leading zeros, and... + for (i = 1, v = c[0]; v >= 10; v /= 10, i++); + + // adjust the exponent accordingly. + if (i < LOG_BASE) e -= LOG_BASE - i; + } + + rand.e = e; + rand.c = c; + return rand; + }; + })(); + + + // PRIVATE FUNCTIONS + + + // Called by BigNumber and BigNumber.prototype.toString. + convertBase = (function () { + var decimal = '0123456789'; + + /* + * Convert string of baseIn to an array of numbers of baseOut. + * Eg. toBaseOut('255', 10, 16) returns [15, 15]. + * Eg. toBaseOut('ff', 16, 10) returns [2, 5, 5]. + */ + function toBaseOut(str, baseIn, baseOut, alphabet) { + var j, + arr = [0], + arrL, + i = 0, + len = str.length; + + for (; i < len;) { + for (arrL = arr.length; arrL--; arr[arrL] *= baseIn); + + arr[0] += alphabet.indexOf(str.charAt(i++)); + + for (j = 0; j < arr.length; j++) { + + if (arr[j] > baseOut - 1) { + if (arr[j + 1] == null) arr[j + 1] = 0; + arr[j + 1] += arr[j] / baseOut | 0; + arr[j] %= baseOut; + } + } + } + + return arr.reverse(); + } + + // Convert a numeric string of baseIn to a numeric string of baseOut. + // If the caller is toString, we are converting from base 10 to baseOut. + // If the caller is BigNumber, we are converting from baseIn to base 10. + return function (str, baseIn, baseOut, sign, callerIsToString) { + var alphabet, d, e, k, r, x, xc, y, + i = str.indexOf('.'), + dp = DECIMAL_PLACES, + rm = ROUNDING_MODE; + + // Non-integer. + if (i >= 0) { + k = POW_PRECISION; + + // Unlimited precision. + POW_PRECISION = 0; + str = str.replace('.', ''); + y = new BigNumber(baseIn); + x = y.pow(str.length - i); + POW_PRECISION = k; + + // Convert str as if an integer, then restore the fraction part by dividing the + // result by its base raised to a power. + + y.c = toBaseOut(toFixedPoint(coeffToString(x.c), x.e, '0'), + 10, baseOut, decimal); + y.e = y.c.length; + } + + // Convert the number as integer. + + xc = toBaseOut(str, baseIn, baseOut, callerIsToString + ? (alphabet = ALPHABET, decimal) + : (alphabet = decimal, ALPHABET)); + + // xc now represents str as an integer and converted to baseOut. e is the exponent. + e = k = xc.length; + + // Remove trailing zeros. + for (; xc[--k] == 0; xc.pop()); + + // Zero? + if (!xc[0]) return alphabet.charAt(0); + + // Does str represent an integer? If so, no need for the division. + if (i < 0) { + --e; + } else { + x.c = xc; + x.e = e; + + // The sign is needed for correct rounding. + x.s = sign; + x = div(x, y, dp, rm, baseOut); + xc = x.c; + r = x.r; + e = x.e; + } + + // xc now represents str converted to baseOut. + + // THe index of the rounding digit. + d = e + dp + 1; + + // The rounding digit: the digit to the right of the digit that may be rounded up. + i = xc[d]; + + // Look at the rounding digits and mode to determine whether to round up. + + k = baseOut / 2; + r = r || d < 0 || xc[d + 1] != null; + + r = rm < 4 ? (i != null || r) && (rm == 0 || rm == (x.s < 0 ? 3 : 2)) + : i > k || i == k &&(rm == 4 || r || rm == 6 && xc[d - 1] & 1 || + rm == (x.s < 0 ? 8 : 7)); + + // If the index of the rounding digit is not greater than zero, or xc represents + // zero, then the result of the base conversion is zero or, if rounding up, a value + // such as 0.00001. + if (d < 1 || !xc[0]) { + + // 1^-dp or 0 + str = r ? toFixedPoint(alphabet.charAt(1), -dp, alphabet.charAt(0)) + : alphabet.charAt(0); + } else { + + // Truncate xc to the required number of decimal places. + xc.length = d; + + // Round up? + if (r) { + + // Rounding up may mean the previous digit has to be rounded up and so on. + for (--baseOut; ++xc[--d] > baseOut;) { + xc[d] = 0; + + if (!d) { + ++e; + xc = [1].concat(xc); + } + } + } + + // Determine trailing zeros. + for (k = xc.length; !xc[--k];); + + // E.g. [4, 11, 15] becomes 4bf. + for (i = 0, str = ''; i <= k; str += alphabet.charAt(xc[i++])); + + // Add leading zeros, decimal point and trailing zeros as required. + str = toFixedPoint(str, e, alphabet.charAt(0)); + } + + // The caller will add the sign. + return str; + }; + })(); + + + // Perform division in the specified base. Called by div and convertBase. + div = (function () { + + // Assume non-zero x and k. + function multiply(x, k, base) { + var m, temp, xlo, xhi, + carry = 0, + i = x.length, + klo = k % SQRT_BASE, + khi = k / SQRT_BASE | 0; + + for (x = x.slice(); i--;) { + xlo = x[i] % SQRT_BASE; + xhi = x[i] / SQRT_BASE | 0; + m = khi * xlo + xhi * klo; + temp = klo * xlo + ((m % SQRT_BASE) * SQRT_BASE) + carry; + carry = (temp / base | 0) + (m / SQRT_BASE | 0) + khi * xhi; + x[i] = temp % base; + } + + if (carry) x = [carry].concat(x); + + return x; + } + + function compare(a, b, aL, bL) { + var i, cmp; + + if (aL != bL) { + cmp = aL > bL ? 1 : -1; + } else { + + for (i = cmp = 0; i < aL; i++) { + + if (a[i] != b[i]) { + cmp = a[i] > b[i] ? 1 : -1; + break; + } + } + } + + return cmp; + } + + function subtract(a, b, aL, base) { + var i = 0; + + // Subtract b from a. + for (; aL--;) { + a[aL] -= i; + i = a[aL] < b[aL] ? 1 : 0; + a[aL] = i * base + a[aL] - b[aL]; + } + + // Remove leading zeros. + for (; !a[0] && a.length > 1; a.splice(0, 1)); + } + + // x: dividend, y: divisor. + return function (x, y, dp, rm, base) { + var cmp, e, i, more, n, prod, prodL, q, qc, rem, remL, rem0, xi, xL, yc0, + yL, yz, + s = x.s == y.s ? 1 : -1, + xc = x.c, + yc = y.c; + + // Either NaN, Infinity or 0? + if (!xc || !xc[0] || !yc || !yc[0]) { + + return new BigNumber( + + // Return NaN if either NaN, or both Infinity or 0. + !x.s || !y.s || (xc ? yc && xc[0] == yc[0] : !yc) ? NaN : + + // Return ±0 if x is ±0 or y is ±Infinity, or return ±Infinity as y is ±0. + xc && xc[0] == 0 || !yc ? s * 0 : s / 0 + ); + } + + q = new BigNumber(s); + qc = q.c = []; + e = x.e - y.e; + s = dp + e + 1; + + if (!base) { + base = BASE; + e = bitFloor(x.e / LOG_BASE) - bitFloor(y.e / LOG_BASE); + s = s / LOG_BASE | 0; + } + + // Result exponent may be one less then the current value of e. + // The coefficients of the BigNumbers from convertBase may have trailing zeros. + for (i = 0; yc[i] == (xc[i] || 0); i++); + + if (yc[i] > (xc[i] || 0)) e--; + + if (s < 0) { + qc.push(1); + more = true; + } else { + xL = xc.length; + yL = yc.length; + i = 0; + s += 2; + + // Normalise xc and yc so highest order digit of yc is >= base / 2. + + n = mathfloor(base / (yc[0] + 1)); + + // Not necessary, but to handle odd bases where yc[0] == (base / 2) - 1. + // if (n > 1 || n++ == 1 && yc[0] < base / 2) { + if (n > 1) { + yc = multiply(yc, n, base); + xc = multiply(xc, n, base); + yL = yc.length; + xL = xc.length; + } + + xi = yL; + rem = xc.slice(0, yL); + remL = rem.length; + + // Add zeros to make remainder as long as divisor. + for (; remL < yL; rem[remL++] = 0); + yz = yc.slice(); + yz = [0].concat(yz); + yc0 = yc[0]; + if (yc[1] >= base / 2) yc0++; + // Not necessary, but to prevent trial digit n > base, when using base 3. + // else if (base == 3 && yc0 == 1) yc0 = 1 + 1e-15; + + do { + n = 0; + + // Compare divisor and remainder. + cmp = compare(yc, rem, yL, remL); + + // If divisor < remainder. + if (cmp < 0) { + + // Calculate trial digit, n. + + rem0 = rem[0]; + if (yL != remL) rem0 = rem0 * base + (rem[1] || 0); + + // n is how many times the divisor goes into the current remainder. + n = mathfloor(rem0 / yc0); + + // Algorithm: + // product = divisor multiplied by trial digit (n). + // Compare product and remainder. + // If product is greater than remainder: + // Subtract divisor from product, decrement trial digit. + // Subtract product from remainder. + // If product was less than remainder at the last compare: + // Compare new remainder and divisor. + // If remainder is greater than divisor: + // Subtract divisor from remainder, increment trial digit. + + if (n > 1) { + + // n may be > base only when base is 3. + if (n >= base) n = base - 1; + + // product = divisor * trial digit. + prod = multiply(yc, n, base); + prodL = prod.length; + remL = rem.length; + + // Compare product and remainder. + // If product > remainder then trial digit n too high. + // n is 1 too high about 5% of the time, and is not known to have + // ever been more than 1 too high. + while (compare(prod, rem, prodL, remL) == 1) { + n--; + + // Subtract divisor from product. + subtract(prod, yL < prodL ? yz : yc, prodL, base); + prodL = prod.length; + cmp = 1; + } + } else { + + // n is 0 or 1, cmp is -1. + // If n is 0, there is no need to compare yc and rem again below, + // so change cmp to 1 to avoid it. + // If n is 1, leave cmp as -1, so yc and rem are compared again. + if (n == 0) { + + // divisor < remainder, so n must be at least 1. + cmp = n = 1; + } + + // product = divisor + prod = yc.slice(); + prodL = prod.length; + } + + if (prodL < remL) prod = [0].concat(prod); + + // Subtract product from remainder. + subtract(rem, prod, remL, base); + remL = rem.length; + + // If product was < remainder. + if (cmp == -1) { + + // Compare divisor and new remainder. + // If divisor < new remainder, subtract divisor from remainder. + // Trial digit n too low. + // n is 1 too low about 5% of the time, and very rarely 2 too low. + while (compare(yc, rem, yL, remL) < 1) { + n++; + + // Subtract divisor from remainder. + subtract(rem, yL < remL ? yz : yc, remL, base); + remL = rem.length; + } + } + } else if (cmp === 0) { + n++; + rem = [0]; + } // else cmp === 1 and n will be 0 + + // Add the next digit, n, to the result array. + qc[i++] = n; + + // Update the remainder. + if (rem[0]) { + rem[remL++] = xc[xi] || 0; + } else { + rem = [xc[xi]]; + remL = 1; + } + } while ((xi++ < xL || rem[0] != null) && s--); + + more = rem[0] != null; + + // Leading zero? + if (!qc[0]) qc.splice(0, 1); + } + + if (base == BASE) { + + // To calculate q.e, first get the number of digits of qc[0]. + for (i = 1, s = qc[0]; s >= 10; s /= 10, i++); + + round(q, dp + (q.e = i + e * LOG_BASE - 1) + 1, rm, more); + + // Caller is convertBase. + } else { + q.e = e; + q.r = +more; + } + + return q; + }; + })(); + + + /* + * Return a string representing the value of BigNumber n in fixed-point or exponential + * notation rounded to the specified decimal places or significant digits. + * + * n: a BigNumber. + * i: the index of the last digit required (i.e. the digit that may be rounded up). + * rm: the rounding mode. + * id: 1 (toExponential) or 2 (toPrecision). + */ + function format(n, i, rm, id) { + var c0, e, ne, len, str; + + if (rm == null) rm = ROUNDING_MODE; + else intCheck(rm, 0, 8); + + if (!n.c) return n.toString(); + + c0 = n.c[0]; + ne = n.e; + + if (i == null) { + str = coeffToString(n.c); + str = id == 1 || id == 2 && ne <= TO_EXP_NEG + ? toExponential(str, ne) + : toFixedPoint(str, ne, '0'); + } else { + n = round(new BigNumber(n), i, rm); + + // n.e may have changed if the value was rounded up. + e = n.e; + + str = coeffToString(n.c); + len = str.length; + + // toPrecision returns exponential notation if the number of significant digits + // specified is less than the number of digits necessary to represent the integer + // part of the value in fixed-point notation. + + // Exponential notation. + if (id == 1 || id == 2 && (i <= e || e <= TO_EXP_NEG)) { + + // Append zeros? + for (; len < i; str += '0', len++); + str = toExponential(str, e); + + // Fixed-point notation. + } else { + i -= ne; + str = toFixedPoint(str, e, '0'); + + // Append zeros? + if (e + 1 > len) { + if (--i > 0) for (str += '.'; i--; str += '0'); + } else { + i += e - len; + if (i > 0) { + if (e + 1 == len) str += '.'; + for (; i--; str += '0'); + } + } + } + } + + return n.s < 0 && c0 ? '-' + str : str; + } + + + // Handle BigNumber.max and BigNumber.min. + function maxOrMin(args, method) { + var m, n, + i = 0; + + if (isArray(args[0])) args = args[0]; + m = new BigNumber(args[0]); + + for (; ++i < args.length;) { + n = new BigNumber(args[i]); + + // If any number is NaN, return NaN. + if (!n.s) { + m = n; + break; + } else if (method.call(m, n)) { + m = n; + } + } + + return m; + } + + + /* + * Strip trailing zeros, calculate base 10 exponent and check against MIN_EXP and MAX_EXP. + * Called by minus, plus and times. + */ + function normalise(n, c, e) { + var i = 1, + j = c.length; + + // Remove trailing zeros. + for (; !c[--j]; c.pop()); + + // Calculate the base 10 exponent. First get the number of digits of c[0]. + for (j = c[0]; j >= 10; j /= 10, i++); + + // Overflow? + if ((e = i + e * LOG_BASE - 1) > MAX_EXP) { + + // Infinity. + n.c = n.e = null; + + // Underflow? + } else if (e < MIN_EXP) { + + // Zero. + n.c = [n.e = 0]; + } else { + n.e = e; + n.c = c; + } + + return n; + } + + + // Handle values that fail the validity test in BigNumber. + parseNumeric = (function () { + var basePrefix = /^(-?)0([xbo])(?=\w[\w.]*$)/i, + dotAfter = /^([^.]+)\.$/, + dotBefore = /^\.([^.]+)$/, + isInfinityOrNaN = /^-?(Infinity|NaN)$/, + whitespaceOrPlus = /^\s*\+(?=[\w.])|^\s+|\s+$/g; + + return function (x, str, isNum, b) { + var base, + s = isNum ? str : str.replace(whitespaceOrPlus, ''); + + // No exception on ±Infinity or NaN. + if (isInfinityOrNaN.test(s)) { + x.s = isNaN(s) ? null : s < 0 ? -1 : 1; + x.c = x.e = null; + } else { + if (!isNum) { + + // basePrefix = /^(-?)0([xbo])(?=\w[\w.]*$)/i + s = s.replace(basePrefix, function (m, p1, p2) { + base = (p2 = p2.toLowerCase()) == 'x' ? 16 : p2 == 'b' ? 2 : 8; + return !b || b == base ? p1 : m; + }); + + if (b) { + base = b; + + // E.g. '1.' to '1', '.1' to '0.1' + s = s.replace(dotAfter, '$1').replace(dotBefore, '0.$1'); + } + + if (str != s) return new BigNumber(s, base); + } + + // '[BigNumber Error] Not a number: {n}' + // '[BigNumber Error] Not a base {b} number: {n}' + if (BigNumber.DEBUG) { + throw Error + (bignumberError + 'Not a' + (b ? ' base ' + b : '') + ' number: ' + str); + } + + // NaN + x.c = x.e = x.s = null; + } + } + })(); + + + /* + * Round x to sd significant digits using rounding mode rm. Check for over/under-flow. + * If r is truthy, it is known that there are more digits after the rounding digit. + */ + function round(x, sd, rm, r) { + var d, i, j, k, n, ni, rd, + xc = x.c, + pows10 = POWS_TEN; + + // if x is not Infinity or NaN... + if (xc) { + + // rd is the rounding digit, i.e. the digit after the digit that may be rounded up. + // n is a base 1e14 number, the value of the element of array x.c containing rd. + // ni is the index of n within x.c. + // d is the number of digits of n. + // i is the index of rd within n including leading zeros. + // j is the actual index of rd within n (if < 0, rd is a leading zero). + out: { + + // Get the number of digits of the first element of xc. + for (d = 1, k = xc[0]; k >= 10; k /= 10, d++); + i = sd - d; + + // If the rounding digit is in the first element of xc... + if (i < 0) { + i += LOG_BASE; + j = sd; + n = xc[ni = 0]; + + // Get the rounding digit at index j of n. + rd = n / pows10[d - j - 1] % 10 | 0; + } else { + ni = mathceil((i + 1) / LOG_BASE); + + if (ni >= xc.length) { + + if (r) { + + // Needed by sqrt. + for (; xc.length <= ni; xc.push(0)); + n = rd = 0; + d = 1; + i %= LOG_BASE; + j = i - LOG_BASE + 1; + } else { + break out; + } + } else { + n = k = xc[ni]; + + // Get the number of digits of n. + for (d = 1; k >= 10; k /= 10, d++); + + // Get the index of rd within n. + i %= LOG_BASE; + + // Get the index of rd within n, adjusted for leading zeros. + // The number of leading zeros of n is given by LOG_BASE - d. + j = i - LOG_BASE + d; + + // Get the rounding digit at index j of n. + rd = j < 0 ? 0 : n / pows10[d - j - 1] % 10 | 0; + } + } + + r = r || sd < 0 || + + // Are there any non-zero digits after the rounding digit? + // The expression n % pows10[d - j - 1] returns all digits of n to the right + // of the digit at j, e.g. if n is 908714 and j is 2, the expression gives 714. + xc[ni + 1] != null || (j < 0 ? n : n % pows10[d - j - 1]); + + r = rm < 4 + ? (rd || r) && (rm == 0 || rm == (x.s < 0 ? 3 : 2)) + : rd > 5 || rd == 5 && (rm == 4 || r || rm == 6 && + + // Check whether the digit to the left of the rounding digit is odd. + ((i > 0 ? j > 0 ? n / pows10[d - j] : 0 : xc[ni - 1]) % 10) & 1 || + rm == (x.s < 0 ? 8 : 7)); + + if (sd < 1 || !xc[0]) { + xc.length = 0; + + if (r) { + + // Convert sd to decimal places. + sd -= x.e + 1; + + // 1, 0.1, 0.01, 0.001, 0.0001 etc. + xc[0] = pows10[(LOG_BASE - sd % LOG_BASE) % LOG_BASE]; + x.e = -sd || 0; + } else { + + // Zero. + xc[0] = x.e = 0; + } + + return x; + } + + // Remove excess digits. + if (i == 0) { + xc.length = ni; + k = 1; + ni--; + } else { + xc.length = ni + 1; + k = pows10[LOG_BASE - i]; + + // E.g. 56700 becomes 56000 if 7 is the rounding digit. + // j > 0 means i > number of leading zeros of n. + xc[ni] = j > 0 ? mathfloor(n / pows10[d - j] % pows10[j]) * k : 0; + } + + // Round up? + if (r) { + + for (; ;) { + + // If the digit to be rounded up is in the first element of xc... + if (ni == 0) { + + // i will be the length of xc[0] before k is added. + for (i = 1, j = xc[0]; j >= 10; j /= 10, i++); + j = xc[0] += k; + for (k = 1; j >= 10; j /= 10, k++); + + // if i != k the length has increased. + if (i != k) { + x.e++; + if (xc[0] == BASE) xc[0] = 1; + } + + break; + } else { + xc[ni] += k; + if (xc[ni] != BASE) break; + xc[ni--] = 0; + k = 1; + } + } + } + + // Remove trailing zeros. + for (i = xc.length; xc[--i] === 0; xc.pop()); + } + + // Overflow? Infinity. + if (x.e > MAX_EXP) { + x.c = x.e = null; + + // Underflow? Zero. + } else if (x.e < MIN_EXP) { + x.c = [x.e = 0]; + } + } + + return x; + } + + + // PROTOTYPE/INSTANCE METHODS + + + /* + * Return a new BigNumber whose value is the absolute value of this BigNumber. + */ + P.absoluteValue = P.abs = function () { + var x = new BigNumber(this); + if (x.s < 0) x.s = 1; + return x; + }; + + + /* + * Return + * 1 if the value of this BigNumber is greater than the value of BigNumber(y, b), + * -1 if the value of this BigNumber is less than the value of BigNumber(y, b), + * 0 if they have the same value, + * or null if the value of either is NaN. + */ + P.comparedTo = function (y, b) { + return compare(this, new BigNumber(y, b)); + }; + + + /* + * If dp is undefined or null or true or false, return the number of decimal places of the + * value of this BigNumber, or null if the value of this BigNumber is ±Infinity or NaN. + * + * Otherwise, if dp is a number, return a new BigNumber whose value is the value of this + * BigNumber rounded to a maximum of dp decimal places using rounding mode rm, or + * ROUNDING_MODE if rm is omitted. + * + * [dp] {number} Decimal places: integer, 0 to MAX inclusive. + * [rm] {number} Rounding mode. Integer, 0 to 8 inclusive. + * + * '[BigNumber Error] Argument {not a primitive number|not an integer|out of range}: {dp|rm}' + */ + P.decimalPlaces = P.dp = function (dp, rm) { + var c, n, v, + x = this; + + if (dp != null) { + intCheck(dp, 0, MAX); + if (rm == null) rm = ROUNDING_MODE; + else intCheck(rm, 0, 8); + + return round(new BigNumber(x), dp + x.e + 1, rm); + } + + if (!(c = x.c)) return null; + n = ((v = c.length - 1) - bitFloor(this.e / LOG_BASE)) * LOG_BASE; + + // Subtract the number of trailing zeros of the last number. + if (v = c[v]) for (; v % 10 == 0; v /= 10, n--); + if (n < 0) n = 0; + + return n; + }; + + + /* + * n / 0 = I + * n / N = N + * n / I = 0 + * 0 / n = 0 + * 0 / 0 = N + * 0 / N = N + * 0 / I = 0 + * N / n = N + * N / 0 = N + * N / N = N + * N / I = N + * I / n = I + * I / 0 = I + * I / N = N + * I / I = N + * + * Return a new BigNumber whose value is the value of this BigNumber divided by the value of + * BigNumber(y, b), rounded according to DECIMAL_PLACES and ROUNDING_MODE. + */ + P.dividedBy = P.div = function (y, b) { + return div(this, new BigNumber(y, b), DECIMAL_PLACES, ROUNDING_MODE); + }; + + + /* + * Return a new BigNumber whose value is the integer part of dividing the value of this + * BigNumber by the value of BigNumber(y, b). + */ + P.dividedToIntegerBy = P.idiv = function (y, b) { + return div(this, new BigNumber(y, b), 0, 1); + }; + + + /* + * Return a BigNumber whose value is the value of this BigNumber exponentiated by n. + * + * If m is present, return the result modulo m. + * If n is negative round according to DECIMAL_PLACES and ROUNDING_MODE. + * If POW_PRECISION is non-zero and m is not present, round to POW_PRECISION using ROUNDING_MODE. + * + * The modular power operation works efficiently when x, n, and m are integers, otherwise it + * is equivalent to calculating x.exponentiatedBy(n).modulo(m) with a POW_PRECISION of 0. + * + * n {number|string|BigNumber} The exponent. An integer. + * [m] {number|string|BigNumber} The modulus. + * + * '[BigNumber Error] Exponent not an integer: {n}' + */ + P.exponentiatedBy = P.pow = function (n, m) { + var half, isModExp, k, more, nIsBig, nIsNeg, nIsOdd, y, + x = this; + + n = new BigNumber(n); + + // Allow NaN and ±Infinity, but not other non-integers. + if (n.c && !n.isInteger()) { + throw Error + (bignumberError + 'Exponent not an integer: ' + n); + } + + if (m != null) m = new BigNumber(m); + + // Exponent of MAX_SAFE_INTEGER is 15. + nIsBig = n.e > 14; + + // If x is NaN, ±Infinity, ±0 or ±1, or n is ±Infinity, NaN or ±0. + if (!x.c || !x.c[0] || x.c[0] == 1 && !x.e && x.c.length == 1 || !n.c || !n.c[0]) { + + // The sign of the result of pow when x is negative depends on the evenness of n. + // If +n overflows to ±Infinity, the evenness of n would be not be known. + y = new BigNumber(Math.pow(+x.valueOf(), nIsBig ? 2 - isOdd(n) : +n)); + return m ? y.mod(m) : y; + } + + nIsNeg = n.s < 0; + + if (m) { + + // x % m returns NaN if abs(m) is zero, or m is NaN. + if (m.c ? !m.c[0] : !m.s) return new BigNumber(NaN); + + isModExp = !nIsNeg && x.isInteger() && m.isInteger(); + + if (isModExp) x = x.mod(m); + + // Overflow to ±Infinity: >=2**1e10 or >=1.0000024**1e15. + // Underflow to ±0: <=0.79**1e10 or <=0.9999975**1e15. + } else if (n.e > 9 && (x.e > 0 || x.e < -1 || (x.e == 0 + // [1, 240000000] + ? x.c[0] > 1 || nIsBig && x.c[1] >= 24e7 + // [80000000000000] [99999750000000] + : x.c[0] < 8e13 || nIsBig && x.c[0] <= 9999975e7))) { + + // If x is negative and n is odd, k = -0, else k = 0. + k = x.s < 0 && isOdd(n) ? -0 : 0; + + // If x >= 1, k = ±Infinity. + if (x.e > -1) k = 1 / k; + + // If n is negative return ±0, else return ±Infinity. + return new BigNumber(nIsNeg ? 1 / k : k); + + } else if (POW_PRECISION) { + + // Truncating each coefficient array to a length of k after each multiplication + // equates to truncating significant digits to POW_PRECISION + [28, 41], + // i.e. there will be a minimum of 28 guard digits retained. + k = mathceil(POW_PRECISION / LOG_BASE + 2); + } + + if (nIsBig) { + half = new BigNumber(0.5); + nIsOdd = isOdd(n); + } else { + nIsOdd = n % 2; + } + + if (nIsNeg) n.s = 1; + + y = new BigNumber(ONE); + + // Performs 54 loop iterations for n of 9007199254740991. + for (; ;) { + + if (nIsOdd) { + y = y.times(x); + if (!y.c) break; + + if (k) { + if (y.c.length > k) y.c.length = k; + } else if (isModExp) { + y = y.mod(m); //y = y.minus(div(y, m, 0, MODULO_MODE).times(m)); + } + } + + if (nIsBig) { + n = n.times(half); + round(n, n.e + 1, 1); + if (!n.c[0]) break; + nIsBig = n.e > 14; + nIsOdd = isOdd(n); + } else { + n = mathfloor(n / 2); + if (!n) break; + nIsOdd = n % 2; + } + + x = x.times(x); + + if (k) { + if (x.c && x.c.length > k) x.c.length = k; + } else if (isModExp) { + x = x.mod(m); //x = x.minus(div(x, m, 0, MODULO_MODE).times(m)); + } + } + + if (isModExp) return y; + if (nIsNeg) y = ONE.div(y); + + return m ? y.mod(m) : k ? round(y, POW_PRECISION, ROUNDING_MODE, more) : y; + }; + + + /* + * Return a new BigNumber whose value is the value of this BigNumber rounded to an integer + * using rounding mode rm, or ROUNDING_MODE if rm is omitted. + * + * [rm] {number} Rounding mode. Integer, 0 to 8 inclusive. + * + * '[BigNumber Error] Argument {not a primitive number|not an integer|out of range}: {rm}' + */ + P.integerValue = function (rm) { + var n = new BigNumber(this); + if (rm == null) rm = ROUNDING_MODE; + else intCheck(rm, 0, 8); + return round(n, n.e + 1, rm); + }; + + + /* + * Return true if the value of this BigNumber is equal to the value of BigNumber(y, b), + * otherwise return false. + */ + P.isEqualTo = P.eq = function (y, b) { + return compare(this, new BigNumber(y, b)) === 0; + }; + + + /* + * Return true if the value of this BigNumber is a finite number, otherwise return false. + */ + P.isFinite = function () { + return !!this.c; + }; + + + /* + * Return true if the value of this BigNumber is greater than the value of BigNumber(y, b), + * otherwise return false. + */ + P.isGreaterThan = P.gt = function (y, b) { + return compare(this, new BigNumber(y, b)) > 0; + }; + + + /* + * Return true if the value of this BigNumber is greater than or equal to the value of + * BigNumber(y, b), otherwise return false. + */ + P.isGreaterThanOrEqualTo = P.gte = function (y, b) { + return (b = compare(this, new BigNumber(y, b))) === 1 || b === 0; + + }; + + + /* + * Return true if the value of this BigNumber is an integer, otherwise return false. + */ + P.isInteger = function () { + return !!this.c && bitFloor(this.e / LOG_BASE) > this.c.length - 2; + }; + + + /* + * Return true if the value of this BigNumber is less than the value of BigNumber(y, b), + * otherwise return false. + */ + P.isLessThan = P.lt = function (y, b) { + return compare(this, new BigNumber(y, b)) < 0; + }; + + + /* + * Return true if the value of this BigNumber is less than or equal to the value of + * BigNumber(y, b), otherwise return false. + */ + P.isLessThanOrEqualTo = P.lte = function (y, b) { + return (b = compare(this, new BigNumber(y, b))) === -1 || b === 0; + }; + + + /* + * Return true if the value of this BigNumber is NaN, otherwise return false. + */ + P.isNaN = function () { + return !this.s; + }; + + + /* + * Return true if the value of this BigNumber is negative, otherwise return false. + */ + P.isNegative = function () { + return this.s < 0; + }; + + + /* + * Return true if the value of this BigNumber is positive, otherwise return false. + */ + P.isPositive = function () { + return this.s > 0; + }; + + + /* + * Return true if the value of this BigNumber is 0 or -0, otherwise return false. + */ + P.isZero = function () { + return !!this.c && this.c[0] == 0; + }; + + + /* + * n - 0 = n + * n - N = N + * n - I = -I + * 0 - n = -n + * 0 - 0 = 0 + * 0 - N = N + * 0 - I = -I + * N - n = N + * N - 0 = N + * N - N = N + * N - I = N + * I - n = I + * I - 0 = I + * I - N = N + * I - I = N + * + * Return a new BigNumber whose value is the value of this BigNumber minus the value of + * BigNumber(y, b). + */ + P.minus = function (y, b) { + var i, j, t, xLTy, + x = this, + a = x.s; + + y = new BigNumber(y, b); + b = y.s; + + // Either NaN? + if (!a || !b) return new BigNumber(NaN); + + // Signs differ? + if (a != b) { + y.s = -b; + return x.plus(y); + } + + var xe = x.e / LOG_BASE, + ye = y.e / LOG_BASE, + xc = x.c, + yc = y.c; + + if (!xe || !ye) { + + // Either Infinity? + if (!xc || !yc) return xc ? (y.s = -b, y) : new BigNumber(yc ? x : NaN); + + // Either zero? + if (!xc[0] || !yc[0]) { + + // Return y if y is non-zero, x if x is non-zero, or zero if both are zero. + return yc[0] ? (y.s = -b, y) : new BigNumber(xc[0] ? x : + + // IEEE 754 (2008) 6.3: n - n = -0 when rounding to -Infinity + ROUNDING_MODE == 3 ? -0 : 0); + } + } + + xe = bitFloor(xe); + ye = bitFloor(ye); + xc = xc.slice(); + + // Determine which is the bigger number. + if (a = xe - ye) { + + if (xLTy = a < 0) { + a = -a; + t = xc; + } else { + ye = xe; + t = yc; + } + + t.reverse(); + + // Prepend zeros to equalise exponents. + for (b = a; b--; t.push(0)); + t.reverse(); + } else { + + // Exponents equal. Check digit by digit. + j = (xLTy = (a = xc.length) < (b = yc.length)) ? a : b; + + for (a = b = 0; b < j; b++) { + + if (xc[b] != yc[b]) { + xLTy = xc[b] < yc[b]; + break; + } + } + } + + // x < y? Point xc to the array of the bigger number. + if (xLTy) t = xc, xc = yc, yc = t, y.s = -y.s; + + b = (j = yc.length) - (i = xc.length); + + // Append zeros to xc if shorter. + // No need to add zeros to yc if shorter as subtract only needs to start at yc.length. + if (b > 0) for (; b--; xc[i++] = 0); + b = BASE - 1; + + // Subtract yc from xc. + for (; j > a;) { + + if (xc[--j] < yc[j]) { + for (i = j; i && !xc[--i]; xc[i] = b); + --xc[i]; + xc[j] += BASE; + } + + xc[j] -= yc[j]; + } + + // Remove leading zeros and adjust exponent accordingly. + for (; xc[0] == 0; xc.splice(0, 1), --ye); + + // Zero? + if (!xc[0]) { + + // Following IEEE 754 (2008) 6.3, + // n - n = +0 but n - n = -0 when rounding towards -Infinity. + y.s = ROUNDING_MODE == 3 ? -1 : 1; + y.c = [y.e = 0]; + return y; + } + + // No need to check for Infinity as +x - +y != Infinity && -x - -y != Infinity + // for finite x and y. + return normalise(y, xc, ye); + }; + + + /* + * n % 0 = N + * n % N = N + * n % I = n + * 0 % n = 0 + * -0 % n = -0 + * 0 % 0 = N + * 0 % N = N + * 0 % I = 0 + * N % n = N + * N % 0 = N + * N % N = N + * N % I = N + * I % n = N + * I % 0 = N + * I % N = N + * I % I = N + * + * Return a new BigNumber whose value is the value of this BigNumber modulo the value of + * BigNumber(y, b). The result depends on the value of MODULO_MODE. + */ + P.modulo = P.mod = function (y, b) { + var q, s, + x = this; + + y = new BigNumber(y, b); + + // Return NaN if x is Infinity or NaN, or y is NaN or zero. + if (!x.c || !y.s || y.c && !y.c[0]) { + return new BigNumber(NaN); + + // Return x if y is Infinity or x is zero. + } else if (!y.c || x.c && !x.c[0]) { + return new BigNumber(x); + } + + if (MODULO_MODE == 9) { + + // Euclidian division: q = sign(y) * floor(x / abs(y)) + // r = x - qy where 0 <= r < abs(y) + s = y.s; + y.s = 1; + q = div(x, y, 0, 3); + y.s = s; + q.s *= s; + } else { + q = div(x, y, 0, MODULO_MODE); + } + + y = x.minus(q.times(y)); + + // To match JavaScript %, ensure sign of zero is sign of dividend. + if (!y.c[0] && MODULO_MODE == 1) y.s = x.s; + + return y; + }; + + + /* + * n * 0 = 0 + * n * N = N + * n * I = I + * 0 * n = 0 + * 0 * 0 = 0 + * 0 * N = N + * 0 * I = N + * N * n = N + * N * 0 = N + * N * N = N + * N * I = N + * I * n = I + * I * 0 = N + * I * N = N + * I * I = I + * + * Return a new BigNumber whose value is the value of this BigNumber multiplied by the value + * of BigNumber(y, b). + */ + P.multipliedBy = P.times = function (y, b) { + var c, e, i, j, k, m, xcL, xlo, xhi, ycL, ylo, yhi, zc, + base, sqrtBase, + x = this, + xc = x.c, + yc = (y = new BigNumber(y, b)).c; + + // Either NaN, ±Infinity or ±0? + if (!xc || !yc || !xc[0] || !yc[0]) { + + // Return NaN if either is NaN, or one is 0 and the other is Infinity. + if (!x.s || !y.s || xc && !xc[0] && !yc || yc && !yc[0] && !xc) { + y.c = y.e = y.s = null; + } else { + y.s *= x.s; + + // Return ±Infinity if either is ±Infinity. + if (!xc || !yc) { + y.c = y.e = null; + + // Return ±0 if either is ±0. + } else { + y.c = [0]; + y.e = 0; + } + } + + return y; + } + + e = bitFloor(x.e / LOG_BASE) + bitFloor(y.e / LOG_BASE); + y.s *= x.s; + xcL = xc.length; + ycL = yc.length; + + // Ensure xc points to longer array and xcL to its length. + if (xcL < ycL) zc = xc, xc = yc, yc = zc, i = xcL, xcL = ycL, ycL = i; + + // Initialise the result array with zeros. + for (i = xcL + ycL, zc = []; i--; zc.push(0)); + + base = BASE; + sqrtBase = SQRT_BASE; + + for (i = ycL; --i >= 0;) { + c = 0; + ylo = yc[i] % sqrtBase; + yhi = yc[i] / sqrtBase | 0; + + for (k = xcL, j = i + k; j > i;) { + xlo = xc[--k] % sqrtBase; + xhi = xc[k] / sqrtBase | 0; + m = yhi * xlo + xhi * ylo; + xlo = ylo * xlo + ((m % sqrtBase) * sqrtBase) + zc[j] + c; + c = (xlo / base | 0) + (m / sqrtBase | 0) + yhi * xhi; + zc[j--] = xlo % base; + } + + zc[j] = c; + } + + if (c) { + ++e; + } else { + zc.splice(0, 1); + } + + return normalise(y, zc, e); + }; + + + /* + * Return a new BigNumber whose value is the value of this BigNumber negated, + * i.e. multiplied by -1. + */ + P.negated = function () { + var x = new BigNumber(this); + x.s = -x.s || null; + return x; + }; + + + /* + * n + 0 = n + * n + N = N + * n + I = I + * 0 + n = n + * 0 + 0 = 0 + * 0 + N = N + * 0 + I = I + * N + n = N + * N + 0 = N + * N + N = N + * N + I = N + * I + n = I + * I + 0 = I + * I + N = N + * I + I = I + * + * Return a new BigNumber whose value is the value of this BigNumber plus the value of + * BigNumber(y, b). + */ + P.plus = function (y, b) { + var t, + x = this, + a = x.s; + + y = new BigNumber(y, b); + b = y.s; + + // Either NaN? + if (!a || !b) return new BigNumber(NaN); + + // Signs differ? + if (a != b) { + y.s = -b; + return x.minus(y); + } + + var xe = x.e / LOG_BASE, + ye = y.e / LOG_BASE, + xc = x.c, + yc = y.c; + + if (!xe || !ye) { + + // Return ±Infinity if either ±Infinity. + if (!xc || !yc) return new BigNumber(a / 0); + + // Either zero? + // Return y if y is non-zero, x if x is non-zero, or zero if both are zero. + if (!xc[0] || !yc[0]) return yc[0] ? y : new BigNumber(xc[0] ? x : a * 0); + } + + xe = bitFloor(xe); + ye = bitFloor(ye); + xc = xc.slice(); + + // Prepend zeros to equalise exponents. Faster to use reverse then do unshifts. + if (a = xe - ye) { + if (a > 0) { + ye = xe; + t = yc; + } else { + a = -a; + t = xc; + } + + t.reverse(); + for (; a--; t.push(0)); + t.reverse(); + } + + a = xc.length; + b = yc.length; + + // Point xc to the longer array, and b to the shorter length. + if (a - b < 0) t = yc, yc = xc, xc = t, b = a; + + // Only start adding at yc.length - 1 as the further digits of xc can be ignored. + for (a = 0; b;) { + a = (xc[--b] = xc[b] + yc[b] + a) / BASE | 0; + xc[b] = BASE === xc[b] ? 0 : xc[b] % BASE; + } + + if (a) { + xc = [a].concat(xc); + ++ye; + } + + // No need to check for zero, as +x + +y != 0 && -x + -y != 0 + // ye = MAX_EXP + 1 possible + return normalise(y, xc, ye); + }; + + + /* + * If sd is undefined or null or true or false, return the number of significant digits of + * the value of this BigNumber, or null if the value of this BigNumber is ±Infinity or NaN. + * If sd is true include integer-part trailing zeros in the count. + * + * Otherwise, if sd is a number, return a new BigNumber whose value is the value of this + * BigNumber rounded to a maximum of sd significant digits using rounding mode rm, or + * ROUNDING_MODE if rm is omitted. + * + * sd {number|boolean} number: significant digits: integer, 1 to MAX inclusive. + * boolean: whether to count integer-part trailing zeros: true or false. + * [rm] {number} Rounding mode. Integer, 0 to 8 inclusive. + * + * '[BigNumber Error] Argument {not a primitive number|not an integer|out of range}: {sd|rm}' + */ + P.precision = P.sd = function (sd, rm) { + var c, n, v, + x = this; + + if (sd != null && sd !== !!sd) { + intCheck(sd, 1, MAX); + if (rm == null) rm = ROUNDING_MODE; + else intCheck(rm, 0, 8); + + return round(new BigNumber(x), sd, rm); + } + + if (!(c = x.c)) return null; + v = c.length - 1; + n = v * LOG_BASE + 1; + + if (v = c[v]) { + + // Subtract the number of trailing zeros of the last element. + for (; v % 10 == 0; v /= 10, n--); + + // Add the number of digits of the first element. + for (v = c[0]; v >= 10; v /= 10, n++); + } + + if (sd && x.e + 1 > n) n = x.e + 1; + + return n; + }; + + + /* + * Return a new BigNumber whose value is the value of this BigNumber shifted by k places + * (powers of 10). Shift to the right if n > 0, and to the left if n < 0. + * + * k {number} Integer, -MAX_SAFE_INTEGER to MAX_SAFE_INTEGER inclusive. + * + * '[BigNumber Error] Argument {not a primitive number|not an integer|out of range}: {k}' + */ + P.shiftedBy = function (k) { + intCheck(k, -MAX_SAFE_INTEGER, MAX_SAFE_INTEGER); + return this.times('1e' + k); + }; + + + /* + * sqrt(-n) = N + * sqrt(N) = N + * sqrt(-I) = N + * sqrt(I) = I + * sqrt(0) = 0 + * sqrt(-0) = -0 + * + * Return a new BigNumber whose value is the square root of the value of this BigNumber, + * rounded according to DECIMAL_PLACES and ROUNDING_MODE. + */ + P.squareRoot = P.sqrt = function () { + var m, n, r, rep, t, + x = this, + c = x.c, + s = x.s, + e = x.e, + dp = DECIMAL_PLACES + 4, + half = new BigNumber('0.5'); + + // Negative/NaN/Infinity/zero? + if (s !== 1 || !c || !c[0]) { + return new BigNumber(!s || s < 0 && (!c || c[0]) ? NaN : c ? x : 1 / 0); + } + + // Initial estimate. + s = Math.sqrt(+x); + + // Math.sqrt underflow/overflow? + // Pass x to Math.sqrt as integer, then adjust the exponent of the result. + if (s == 0 || s == 1 / 0) { + n = coeffToString(c); + if ((n.length + e) % 2 == 0) n += '0'; + s = Math.sqrt(n); + e = bitFloor((e + 1) / 2) - (e < 0 || e % 2); + + if (s == 1 / 0) { + n = '1e' + e; + } else { + n = s.toExponential(); + n = n.slice(0, n.indexOf('e') + 1) + e; + } + + r = new BigNumber(n); + } else { + r = new BigNumber(s + ''); + } + + // Check for zero. + // r could be zero if MIN_EXP is changed after the this value was created. + // This would cause a division by zero (x/t) and hence Infinity below, which would cause + // coeffToString to throw. + if (r.c[0]) { + e = r.e; + s = e + dp; + if (s < 3) s = 0; + + // Newton-Raphson iteration. + for (; ;) { + t = r; + r = half.times(t.plus(div(x, t, dp, 1))); + + if (coeffToString(t.c ).slice(0, s) === (n = + coeffToString(r.c)).slice(0, s)) { + + // The exponent of r may here be one less than the final result exponent, + // e.g 0.0009999 (e-4) --> 0.001 (e-3), so adjust s so the rounding digits + // are indexed correctly. + if (r.e < e) --s; + n = n.slice(s - 3, s + 1); + + // The 4th rounding digit may be in error by -1 so if the 4 rounding digits + // are 9999 or 4999 (i.e. approaching a rounding boundary) continue the + // iteration. + if (n == '9999' || !rep && n == '4999') { + + // On the first iteration only, check to see if rounding up gives the + // exact result as the nines may infinitely repeat. + if (!rep) { + round(t, t.e + DECIMAL_PLACES + 2, 0); + + if (t.times(t).eq(x)) { + r = t; + break; + } + } + + dp += 4; + s += 4; + rep = 1; + } else { + + // If rounding digits are null, 0{0,4} or 50{0,3}, check for exact + // result. If not, then there are further digits and m will be truthy. + if (!+n || !+n.slice(1) && n.charAt(0) == '5') { + + // Truncate to the first rounding digit. + round(r, r.e + DECIMAL_PLACES + 2, 1); + m = !r.times(r).eq(x); + } + + break; + } + } + } + } + + return round(r, r.e + DECIMAL_PLACES + 1, ROUNDING_MODE, m); + }; + + + /* + * Return a string representing the value of this BigNumber in exponential notation and + * rounded using ROUNDING_MODE to dp fixed decimal places. + * + * [dp] {number} Decimal places. Integer, 0 to MAX inclusive. + * [rm] {number} Rounding mode. Integer, 0 to 8 inclusive. + * + * '[BigNumber Error] Argument {not a primitive number|not an integer|out of range}: {dp|rm}' + */ + P.toExponential = function (dp, rm) { + if (dp != null) { + intCheck(dp, 0, MAX); + dp++; + } + return format(this, dp, rm, 1); + }; + + + /* + * Return a string representing the value of this BigNumber in fixed-point notation rounding + * to dp fixed decimal places using rounding mode rm, or ROUNDING_MODE if rm is omitted. + * + * Note: as with JavaScript's number type, (-0).toFixed(0) is '0', + * but e.g. (-0.00001).toFixed(0) is '-0'. + * + * [dp] {number} Decimal places. Integer, 0 to MAX inclusive. + * [rm] {number} Rounding mode. Integer, 0 to 8 inclusive. + * + * '[BigNumber Error] Argument {not a primitive number|not an integer|out of range}: {dp|rm}' + */ + P.toFixed = function (dp, rm) { + if (dp != null) { + intCheck(dp, 0, MAX); + dp = dp + this.e + 1; + } + return format(this, dp, rm); + }; + + + /* + * Return a string representing the value of this BigNumber in fixed-point notation rounded + * using rm or ROUNDING_MODE to dp decimal places, and formatted according to the properties + * of the FORMAT object (see BigNumber.set). + * + * FORMAT = { + * decimalSeparator : '.', + * groupSeparator : ',', + * groupSize : 3, + * secondaryGroupSize : 0, + * fractionGroupSeparator : '\xA0', // non-breaking space + * fractionGroupSize : 0 + * }; + * + * [dp] {number} Decimal places. Integer, 0 to MAX inclusive. + * [rm] {number} Rounding mode. Integer, 0 to 8 inclusive. + * + * '[BigNumber Error] Argument {not a primitive number|not an integer|out of range}: {dp|rm}' + */ + P.toFormat = function (dp, rm) { + var str = this.toFixed(dp, rm); + + if (this.c) { + var i, + arr = str.split('.'), + g1 = +FORMAT.groupSize, + g2 = +FORMAT.secondaryGroupSize, + groupSeparator = FORMAT.groupSeparator, + intPart = arr[0], + fractionPart = arr[1], + isNeg = this.s < 0, + intDigits = isNeg ? intPart.slice(1) : intPart, + len = intDigits.length; + + if (g2) i = g1, g1 = g2, g2 = i, len -= i; + + if (g1 > 0 && len > 0) { + i = len % g1 || g1; + intPart = intDigits.substr(0, i); + + for (; i < len; i += g1) { + intPart += groupSeparator + intDigits.substr(i, g1); + } + + if (g2 > 0) intPart += groupSeparator + intDigits.slice(i); + if (isNeg) intPart = '-' + intPart; + } + + str = fractionPart + ? intPart + FORMAT.decimalSeparator + ((g2 = +FORMAT.fractionGroupSize) + ? fractionPart.replace(new RegExp('\\d{' + g2 + '}\\B', 'g'), + '$&' + FORMAT.fractionGroupSeparator) + : fractionPart) + : intPart; + } + + return str; + }; + + + /* + * Return a string array representing the value of this BigNumber as a simple fraction with + * an integer numerator and an integer denominator. The denominator will be a positive + * non-zero value less than or equal to the specified maximum denominator. If a maximum + * denominator is not specified, the denominator will be the lowest value necessary to + * represent the number exactly. + * + * [md] {number|string|BigNumber} Integer >= 1, or Infinity. The maximum denominator. + * + * '[BigNumber Error] Argument {not an integer|out of range} : {md}' + */ + P.toFraction = function (md) { + var arr, d, d0, d1, d2, e, exp, n, n0, n1, q, s, + x = this, + xc = x.c; + + if (md != null) { + n = new BigNumber(md); + + // Throw if md is less than one or is not an integer, unless it is Infinity. + if (!n.isInteger() && (n.c || n.s !== 1) || n.lt(ONE)) { + throw Error + (bignumberError + 'Argument ' + + (n.isInteger() ? 'out of range: ' : 'not an integer: ') + md); + } + } + + if (!xc) return x.toString(); + + d = new BigNumber(ONE); + n1 = d0 = new BigNumber(ONE); + d1 = n0 = new BigNumber(ONE); + s = coeffToString(xc); + + // Determine initial denominator. + // d is a power of 10 and the minimum max denominator that specifies the value exactly. + e = d.e = s.length - x.e - 1; + d.c[0] = POWS_TEN[(exp = e % LOG_BASE) < 0 ? LOG_BASE + exp : exp]; + md = !md || n.comparedTo(d) > 0 ? (e > 0 ? d : n1) : n; + + exp = MAX_EXP; + MAX_EXP = 1 / 0; + n = new BigNumber(s); + + // n0 = d1 = 0 + n0.c[0] = 0; + + for (; ;) { + q = div(n, d, 0, 1); + d2 = d0.plus(q.times(d1)); + if (d2.comparedTo(md) == 1) break; + d0 = d1; + d1 = d2; + n1 = n0.plus(q.times(d2 = n1)); + n0 = d2; + d = n.minus(q.times(d2 = d)); + n = d2; + } + + d2 = div(md.minus(d0), d1, 0, 1); + n0 = n0.plus(d2.times(n1)); + d0 = d0.plus(d2.times(d1)); + n0.s = n1.s = x.s; + e *= 2; + + // Determine which fraction is closer to x, n0/d0 or n1/d1 + arr = div(n1, d1, e, ROUNDING_MODE).minus(x).abs().comparedTo( + div(n0, d0, e, ROUNDING_MODE).minus(x).abs()) < 1 + ? [n1.toString(), d1.toString()] + : [n0.toString(), d0.toString()]; + + MAX_EXP = exp; + return arr; + }; + + + /* + * Return the value of this BigNumber converted to a number primitive. + */ + P.toNumber = function () { + return +this; + }; + + + /* + * Return a string representing the value of this BigNumber rounded to sd significant digits + * using rounding mode rm or ROUNDING_MODE. If sd is less than the number of digits + * necessary to represent the integer part of the value in fixed-point notation, then use + * exponential notation. + * + * [sd] {number} Significant digits. Integer, 1 to MAX inclusive. + * [rm] {number} Rounding mode. Integer, 0 to 8 inclusive. + * + * '[BigNumber Error] Argument {not a primitive number|not an integer|out of range}: {sd|rm}' + */ + P.toPrecision = function (sd, rm) { + if (sd != null) intCheck(sd, 1, MAX); + return format(this, sd, rm, 2); + }; + + + /* + * Return a string representing the value of this BigNumber in base b, or base 10 if b is + * omitted. If a base is specified, including base 10, round according to DECIMAL_PLACES and + * ROUNDING_MODE. If a base is not specified, and this BigNumber has a positive exponent + * that is equal to or greater than TO_EXP_POS, or a negative exponent equal to or less than + * TO_EXP_NEG, return exponential notation. + * + * [b] {number} Integer, 2 to ALPHABET.length inclusive. + * + * '[BigNumber Error] Base {not a primitive number|not an integer|out of range}: {b}' + */ + P.toString = function (b) { + var str, + n = this, + s = n.s, + e = n.e; + + // Infinity or NaN? + if (e === null) { + + if (s) { + str = 'Infinity'; + if (s < 0) str = '-' + str; + } else { + str = 'NaN'; + } + } else { + str = coeffToString(n.c); + + if (b == null) { + str = e <= TO_EXP_NEG || e >= TO_EXP_POS + ? toExponential(str, e) + : toFixedPoint(str, e, '0'); + } else { + intCheck(b, 2, ALPHABET.length, 'Base'); + str = convertBase(toFixedPoint(str, e, '0'), 10, b, s, true); + } + + if (s < 0 && n.c[0]) str = '-' + str; + } + + return str; + }; + + + /* + * Return as toString, but do not accept a base argument, and include the minus sign for + * negative zero. + */ + P.valueOf = P.toJSON = function () { + var str, + n = this, + e = n.e; + + if (e === null) return n.toString(); + + str = coeffToString(n.c); + + str = e <= TO_EXP_NEG || e >= TO_EXP_POS + ? toExponential(str, e) + : toFixedPoint(str, e, '0'); + + return n.s < 0 ? '-' + str : str; + }; + + + P._isBigNumber = true; + + if (configObject != null) BigNumber.set(configObject); + + return BigNumber; + } + + + // PRIVATE HELPER FUNCTIONS + + + function bitFloor(n) { + var i = n | 0; + return n > 0 || n === i ? i : i - 1; + } + + + // Return a coefficient array as a string of base 10 digits. + function coeffToString(a) { + var s, z, + i = 1, + j = a.length, + r = a[0] + ''; + + for (; i < j;) { + s = a[i++] + ''; + z = LOG_BASE - s.length; + for (; z--; s = '0' + s); + r += s; + } + + // Determine trailing zeros. + for (j = r.length; r.charCodeAt(--j) === 48;); + return r.slice(0, j + 1 || 1); + } + + + // Compare the value of BigNumbers x and y. + function compare(x, y) { + var a, b, + xc = x.c, + yc = y.c, + i = x.s, + j = y.s, + k = x.e, + l = y.e; + + // Either NaN? + if (!i || !j) return null; + + a = xc && !xc[0]; + b = yc && !yc[0]; + + // Either zero? + if (a || b) return a ? b ? 0 : -j : i; + + // Signs differ? + if (i != j) return i; + + a = i < 0; + b = k == l; + + // Either Infinity? + if (!xc || !yc) return b ? 0 : !xc ^ a ? 1 : -1; + + // Compare exponents. + if (!b) return k > l ^ a ? 1 : -1; + + j = (k = xc.length) < (l = yc.length) ? k : l; + + // Compare digit by digit. + for (i = 0; i < j; i++) if (xc[i] != yc[i]) return xc[i] > yc[i] ^ a ? 1 : -1; + + // Compare lengths. + return k == l ? 0 : k > l ^ a ? 1 : -1; + } + + + /* + * Check that n is a primitive number, an integer, and in range, otherwise throw. + */ + function intCheck(n, min, max, name) { + if (n < min || n > max || n !== (n < 0 ? mathceil(n) : mathfloor(n))) { + throw Error + (bignumberError + (name || 'Argument') + (typeof n == 'number' + ? n < min || n > max ? ' out of range: ' : ' not an integer: ' + : ' not a primitive number: ') + n); + } + } + + + function isArray(obj) { + return Object.prototype.toString.call(obj) == '[object Array]'; + } + + + // Assumes finite n. + function isOdd(n) { + var k = n.c.length - 1; + return bitFloor(n.e / LOG_BASE) == k && n.c[k] % 2 != 0; + } + + + function toExponential(str, e) { + return (str.length > 1 ? str.charAt(0) + '.' + str.slice(1) : str) + + (e < 0 ? 'e' : 'e+') + e; + } + + + function toFixedPoint(str, e, z) { + var len, zs; + + // Negative exponent? + if (e < 0) { + + // Prepend zeros. + for (zs = z + '.'; ++e; zs += z); + str = zs + str; + + // Positive exponent + } else { + len = str.length; + + // Append zeros. + if (++e > len) { + for (zs = z, e -= len; --e; zs += z); + str += zs; + } else if (e < len) { + str = str.slice(0, e) + '.' + str.slice(e); + } + } + + return str; + } + + + // EXPORT + + + BigNumber = clone(); + BigNumber['default'] = BigNumber.BigNumber = BigNumber; + + // AMD. + if (typeof undefined == 'function' && undefined.amd) { + undefined(function () { return BigNumber; }); + + // Node.js and other environments that support module.exports. + } else if ('object' != 'undefined' && module.exports) { + module.exports = BigNumber; + + // Browser. + } else { + if (!globalObject) { + globalObject = typeof self != 'undefined' && self ? self : window; + } + + globalObject.BigNumber = BigNumber; + } +})(commonjsGlobal); +}); + +var constants = createCommonjsModule(function (module, exports) { +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +class Constants { +} +Constants.SYS_NUM_CARDINAL = "builtin.num.cardinal"; +Constants.SYS_NUM_DOUBLE = "builtin.num.double"; +Constants.SYS_NUM_FRACTION = "builtin.num.fraction"; +Constants.SYS_NUM_INTEGER = "builtin.num.integer"; +Constants.SYS_NUM = "builtin.num"; +Constants.SYS_NUM_ORDINAL = "builtin.num.ordinal"; +Constants.SYS_NUM_PERCENTAGE = "builtin.num.percentage"; +// NARROW NO-BREAK SPACE +Constants.NO_BREAK_SPACE = '\u202f'; +exports.Constants = Constants; + +}); + +unwrapExports(constants); + +var models$2 = createCommonjsModule(function (module, exports) { +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); + +var NumberMode; +(function (NumberMode) { + // Default is for unit and datetime + NumberMode[NumberMode["Default"] = 0] = "Default"; + // Add 67.5 billion & million support. + NumberMode[NumberMode["Currency"] = 1] = "Currency"; + // Don't extract number from cases like 16ml + NumberMode[NumberMode["PureNumber"] = 2] = "PureNumber"; +})(NumberMode = exports.NumberMode || (exports.NumberMode = {})); +class LongFormatType { + constructor(thousandsMark, decimalsMark) { + this.thousandsMark = thousandsMark; + this.decimalsMark = decimalsMark; + } +} +// Reference : https://www.wikiwand.com/en/Decimal_mark +// Value : 1234567.89 +// 1,234,567 +LongFormatType.integerNumComma = new LongFormatType(',', '\0'); +// 1.234.567 +LongFormatType.integerNumDot = new LongFormatType('.', '\0'); +// 1 234 567 +LongFormatType.integerNumBlank = new LongFormatType(' ', '\0'); +// 1 234 567 +LongFormatType.integerNumNoBreakSpace = new LongFormatType(constants.Constants.NO_BREAK_SPACE, '\0'); +// 1'234'567 +LongFormatType.integerNumQuote = new LongFormatType('\'', '\0'); +// 1,234,567.89 +LongFormatType.doubleNumCommaDot = new LongFormatType(',', '.'); +// 1,234,567·89 +LongFormatType.doubleNumCommaCdot = new LongFormatType(',', '·'); +// 1 234 567,89 +LongFormatType.doubleNumBlankComma = new LongFormatType(' ', ','); +// 1 234 567,89 +LongFormatType.doubleNumNoBreakSpaceComma = new LongFormatType(constants.Constants.NO_BREAK_SPACE, ','); +// 1 234 567.89 +LongFormatType.doubleNumBlankDot = new LongFormatType(' ', '.'); +// 1 234 567.89 +LongFormatType.doubleNumNoBreakSpaceDot = new LongFormatType(constants.Constants.NO_BREAK_SPACE, '.'); +// 1.234.567,89 +LongFormatType.doubleNumDotComma = new LongFormatType('.', ','); +// 1'234'567,89 +LongFormatType.doubleNumQuoteComma = new LongFormatType('\'', ','); +exports.LongFormatType = LongFormatType; +class AbstractNumberModel { + constructor(parser, extractor) { + this.extractor = extractor; + this.parser = parser; + } + parse(query) { + let extractResults = this.extractor.extract(query); + let parseNums = extractResults.map(r => this.parser.parse(r)); + return parseNums + .map(o => o) + .map(o => ({ + start: o.start, + end: o.start + o.length - 1, + resolution: { value: o.resolutionStr }, + text: o.text, + typeName: this.modelTypeName + })); + } +} +exports.AbstractNumberModel = AbstractNumberModel; +class NumberModel extends AbstractNumberModel { + constructor() { + super(...arguments); + this.modelTypeName = "number"; + } +} +exports.NumberModel = NumberModel; +class OrdinalModel extends AbstractNumberModel { + constructor() { + super(...arguments); + this.modelTypeName = "ordinal"; + } +} +exports.OrdinalModel = OrdinalModel; +class PercentModel extends AbstractNumberModel { + constructor() { + super(...arguments); + this.modelTypeName = "percentage"; + } +} +exports.PercentModel = PercentModel; + +}); + +unwrapExports(models$2); + +var culture$2 = createCommonjsModule(function (module, exports) { +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); + + + + +class Culture extends recognizersText.Culture { + constructor(cultureName, cultureCode, longFormat) { + super(cultureName, cultureCode); + this.longFormat = longFormat; + } +} +Culture.supportedCultures = [ + new Culture("English", Culture.English, new models$2.LongFormatType(',', '.')), + new Culture("Chinese", Culture.Chinese, null), + new Culture("Spanish", Culture.Spanish, new models$2.LongFormatType('.', ',')), + new Culture("Portuguese", Culture.Portuguese, new models$2.LongFormatType('.', ',')), + new Culture("French", Culture.French, new models$2.LongFormatType('.', ',')), + new Culture("Japanese", Culture.Japanese, new models$2.LongFormatType(',', '.')) +]; +exports.Culture = Culture; +class CultureInfo extends recognizersText.CultureInfo { + format(value) { + let bigNumber = new bignumber.BigNumber(value); + let s; + if (bigNumber.decimalPlaces()) { + s = bigNumber.precision(15, bignumber.BigNumber.ROUND_HALF_UP).toString(); + } + else { + s = bigNumber.toString().toUpperCase(); + } + if (s.indexOf('.') > -1) { + // trim leading 0 from decimal places + s = lodash_trimend(s, '0'); + } + if (s.indexOf('e-') > -1) { + // mimic .NET behavior by adding leading 0 to exponential. E.g.: 1E-07 + let p = s.split('e-'); + p[1] = p[1].length === 1 ? ('0' + p[1]) : p[1]; + s = p.join('E-'); + } + // TODO: Use BigNumber.toFormat instead + let culture = Culture.supportedCultures.find(c => c.cultureCode === this.code); + if (culture && culture.longFormat) { + return s + .split(',') + .map(t => t.split('.').join(culture.longFormat.decimalsMark)) + .join(culture.longFormat.thousandsMark); + } + return s; + } +} +exports.CultureInfo = CultureInfo; + +}); + +unwrapExports(culture$2); + +var lodash_sortby = createCommonjsModule(function (module, exports) { +/** + * lodash (Custom Build) + * Build: `lodash modularize exports="npm" -o ./` + * Copyright jQuery Foundation and other contributors + * Released under MIT license + * Based on Underscore.js 1.8.3 + * Copyright Jeremy Ashkenas, DocumentCloud and Investigative Reporters & Editors + */ + +/** Used as the size to enable large array optimizations. */ +var LARGE_ARRAY_SIZE = 200; + +/** Used as the `TypeError` message for "Functions" methods. */ +var FUNC_ERROR_TEXT = 'Expected a function'; + +/** Used to stand-in for `undefined` hash values. */ +var HASH_UNDEFINED = '__lodash_hash_undefined__'; + +/** Used to compose bitmasks for comparison styles. */ +var UNORDERED_COMPARE_FLAG = 1, + PARTIAL_COMPARE_FLAG = 2; + +/** Used as references for various `Number` constants. */ +var INFINITY = 1 / 0, + MAX_SAFE_INTEGER = 9007199254740991; + +/** `Object#toString` result references. */ +var argsTag = '[object Arguments]', + arrayTag = '[object Array]', + boolTag = '[object Boolean]', + dateTag = '[object Date]', + errorTag = '[object Error]', + funcTag = '[object Function]', + genTag = '[object GeneratorFunction]', + mapTag = '[object Map]', + numberTag = '[object Number]', + objectTag = '[object Object]', + promiseTag = '[object Promise]', + regexpTag = '[object RegExp]', + setTag = '[object Set]', + stringTag = '[object String]', + symbolTag = '[object Symbol]', + weakMapTag = '[object WeakMap]'; + +var arrayBufferTag = '[object ArrayBuffer]', + dataViewTag = '[object DataView]', + float32Tag = '[object Float32Array]', + float64Tag = '[object Float64Array]', + int8Tag = '[object Int8Array]', + int16Tag = '[object Int16Array]', + int32Tag = '[object Int32Array]', + uint8Tag = '[object Uint8Array]', + uint8ClampedTag = '[object Uint8ClampedArray]', + uint16Tag = '[object Uint16Array]', + uint32Tag = '[object Uint32Array]'; + +/** Used to match property names within property paths. */ +var reIsDeepProp = /\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/, + reIsPlainProp = /^\w*$/, + reLeadingDot = /^\./, + rePropName = /[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g; + +/** + * Used to match `RegExp` + * [syntax characters](http://ecma-international.org/ecma-262/7.0/#sec-patterns). + */ +var reRegExpChar = /[\\^$.*+?()[\]{}|]/g; + +/** Used to match backslashes in property paths. */ +var reEscapeChar = /\\(\\)?/g; + +/** Used to detect host constructors (Safari). */ +var reIsHostCtor = /^\[object .+?Constructor\]$/; + +/** Used to detect unsigned integer values. */ +var reIsUint = /^(?:0|[1-9]\d*)$/; + +/** Used to identify `toStringTag` values of typed arrays. */ +var typedArrayTags = {}; +typedArrayTags[float32Tag] = typedArrayTags[float64Tag] = +typedArrayTags[int8Tag] = typedArrayTags[int16Tag] = +typedArrayTags[int32Tag] = typedArrayTags[uint8Tag] = +typedArrayTags[uint8ClampedTag] = typedArrayTags[uint16Tag] = +typedArrayTags[uint32Tag] = true; +typedArrayTags[argsTag] = typedArrayTags[arrayTag] = +typedArrayTags[arrayBufferTag] = typedArrayTags[boolTag] = +typedArrayTags[dataViewTag] = typedArrayTags[dateTag] = +typedArrayTags[errorTag] = typedArrayTags[funcTag] = +typedArrayTags[mapTag] = typedArrayTags[numberTag] = +typedArrayTags[objectTag] = typedArrayTags[regexpTag] = +typedArrayTags[setTag] = typedArrayTags[stringTag] = +typedArrayTags[weakMapTag] = false; + +/** Detect free variable `global` from Node.js. */ +var freeGlobal = typeof commonjsGlobal == 'object' && commonjsGlobal && commonjsGlobal.Object === Object && commonjsGlobal; + +/** Detect free variable `self`. */ +var freeSelf = typeof self == 'object' && self && self.Object === Object && self; + +/** Used as a reference to the global object. */ +var root = freeGlobal || freeSelf || Function('return this')(); + +/** Detect free variable `exports`. */ +var freeExports = 'object' == 'object' && exports && !exports.nodeType && exports; + +/** Detect free variable `module`. */ +var freeModule = freeExports && 'object' == 'object' && module && !module.nodeType && module; + +/** Detect the popular CommonJS extension `module.exports`. */ +var moduleExports = freeModule && freeModule.exports === freeExports; + +/** Detect free variable `process` from Node.js. */ +var freeProcess = moduleExports && freeGlobal.process; + +/** Used to access faster Node.js helpers. */ +var nodeUtil = (function() { + try { + return freeProcess && freeProcess.binding('util'); + } catch (e) {} +}()); + +/* Node.js helper references. */ +var nodeIsTypedArray = nodeUtil && nodeUtil.isTypedArray; + +/** + * A faster alternative to `Function#apply`, this function invokes `func` + * with the `this` binding of `thisArg` and the arguments of `args`. + * + * @private + * @param {Function} func The function to invoke. + * @param {*} thisArg The `this` binding of `func`. + * @param {Array} args The arguments to invoke `func` with. + * @returns {*} Returns the result of `func`. + */ +function apply(func, thisArg, args) { + switch (args.length) { + case 0: return func.call(thisArg); + case 1: return func.call(thisArg, args[0]); + case 2: return func.call(thisArg, args[0], args[1]); + case 3: return func.call(thisArg, args[0], args[1], args[2]); + } + return func.apply(thisArg, args); +} + +/** + * A specialized version of `_.map` for arrays without support for iteratee + * shorthands. + * + * @private + * @param {Array} [array] The array to iterate over. + * @param {Function} iteratee The function invoked per iteration. + * @returns {Array} Returns the new mapped array. + */ +function arrayMap(array, iteratee) { + var index = -1, + length = array ? array.length : 0, + result = Array(length); + + while (++index < length) { + result[index] = iteratee(array[index], index, array); + } + return result; +} + +/** + * Appends the elements of `values` to `array`. + * + * @private + * @param {Array} array The array to modify. + * @param {Array} values The values to append. + * @returns {Array} Returns `array`. + */ +function arrayPush(array, values) { + var index = -1, + length = values.length, + offset = array.length; + + while (++index < length) { + array[offset + index] = values[index]; + } + return array; +} + +/** + * A specialized version of `_.some` for arrays without support for iteratee + * shorthands. + * + * @private + * @param {Array} [array] The array to iterate over. + * @param {Function} predicate The function invoked per iteration. + * @returns {boolean} Returns `true` if any element passes the predicate check, + * else `false`. + */ +function arraySome(array, predicate) { + var index = -1, + length = array ? array.length : 0; + + while (++index < length) { + if (predicate(array[index], index, array)) { + return true; + } + } + return false; +} + +/** + * The base implementation of `_.property` without support for deep paths. + * + * @private + * @param {string} key The key of the property to get. + * @returns {Function} Returns the new accessor function. + */ +function baseProperty(key) { + return function(object) { + return object == null ? undefined : object[key]; + }; +} + +/** + * The base implementation of `_.sortBy` which uses `comparer` to define the + * sort order of `array` and replaces criteria objects with their corresponding + * values. + * + * @private + * @param {Array} array The array to sort. + * @param {Function} comparer The function to define sort order. + * @returns {Array} Returns `array`. + */ +function baseSortBy(array, comparer) { + var length = array.length; + + array.sort(comparer); + while (length--) { + array[length] = array[length].value; + } + return array; +} + +/** + * The base implementation of `_.times` without support for iteratee shorthands + * or max array length checks. + * + * @private + * @param {number} n The number of times to invoke `iteratee`. + * @param {Function} iteratee The function invoked per iteration. + * @returns {Array} Returns the array of results. + */ +function baseTimes(n, iteratee) { + var index = -1, + result = Array(n); + + while (++index < n) { + result[index] = iteratee(index); + } + return result; +} + +/** + * The base implementation of `_.unary` without support for storing metadata. + * + * @private + * @param {Function} func The function to cap arguments for. + * @returns {Function} Returns the new capped function. + */ +function baseUnary(func) { + return function(value) { + return func(value); + }; +} + +/** + * Gets the value at `key` of `object`. + * + * @private + * @param {Object} [object] The object to query. + * @param {string} key The key of the property to get. + * @returns {*} Returns the property value. + */ +function getValue(object, key) { + return object == null ? undefined : object[key]; +} + +/** + * Checks if `value` is a host object in IE < 9. + * + * @private + * @param {*} value The value to check. + * @returns {boolean} Returns `true` if `value` is a host object, else `false`. + */ +function isHostObject(value) { + // Many host objects are `Object` objects that can coerce to strings + // despite having improperly defined `toString` methods. + var result = false; + if (value != null && typeof value.toString != 'function') { + try { + result = !!(value + ''); + } catch (e) {} + } + return result; +} + +/** + * Converts `map` to its key-value pairs. + * + * @private + * @param {Object} map The map to convert. + * @returns {Array} Returns the key-value pairs. + */ +function mapToArray(map) { + var index = -1, + result = Array(map.size); + + map.forEach(function(value, key) { + result[++index] = [key, value]; + }); + return result; +} + +/** + * Creates a unary function that invokes `func` with its argument transformed. + * + * @private + * @param {Function} func The function to wrap. + * @param {Function} transform The argument transform. + * @returns {Function} Returns the new function. + */ +function overArg(func, transform) { + return function(arg) { + return func(transform(arg)); + }; +} + +/** + * Converts `set` to an array of its values. + * + * @private + * @param {Object} set The set to convert. + * @returns {Array} Returns the values. + */ +function setToArray(set) { + var index = -1, + result = Array(set.size); + + set.forEach(function(value) { + result[++index] = value; + }); + return result; +} + +/** Used for built-in method references. */ +var arrayProto = Array.prototype, + funcProto = Function.prototype, + objectProto = Object.prototype; + +/** Used to detect overreaching core-js shims. */ +var coreJsData = root['__core-js_shared__']; + +/** Used to detect methods masquerading as native. */ +var maskSrcKey = (function() { + var uid = /[^.]+$/.exec(coreJsData && coreJsData.keys && coreJsData.keys.IE_PROTO || ''); + return uid ? ('Symbol(src)_1.' + uid) : ''; +}()); + +/** Used to resolve the decompiled source of functions. */ +var funcToString = funcProto.toString; + +/** Used to check objects for own properties. */ +var hasOwnProperty = objectProto.hasOwnProperty; + +/** + * Used to resolve the + * [`toStringTag`](http://ecma-international.org/ecma-262/7.0/#sec-object.prototype.tostring) + * of values. + */ +var objectToString = objectProto.toString; + +/** Used to detect if a method is native. */ +var reIsNative = RegExp('^' + + funcToString.call(hasOwnProperty).replace(reRegExpChar, '\\$&') + .replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g, '$1.*?') + '$' +); + +/** Built-in value references. */ +var Symbol = root.Symbol, + Uint8Array = root.Uint8Array, + propertyIsEnumerable = objectProto.propertyIsEnumerable, + splice = arrayProto.splice, + spreadableSymbol = Symbol ? Symbol.isConcatSpreadable : undefined; + +/* Built-in method references for those with the same name as other `lodash` methods. */ +var nativeKeys = overArg(Object.keys, Object), + nativeMax = Math.max; + +/* Built-in method references that are verified to be native. */ +var DataView = getNative(root, 'DataView'), + Map = getNative(root, 'Map'), + Promise = getNative(root, 'Promise'), + Set = getNative(root, 'Set'), + WeakMap = getNative(root, 'WeakMap'), + nativeCreate = getNative(Object, 'create'); + +/** Used to detect maps, sets, and weakmaps. */ +var dataViewCtorString = toSource(DataView), + mapCtorString = toSource(Map), + promiseCtorString = toSource(Promise), + setCtorString = toSource(Set), + weakMapCtorString = toSource(WeakMap); + +/** Used to convert symbols to primitives and strings. */ +var symbolProto = Symbol ? Symbol.prototype : undefined, + symbolValueOf = symbolProto ? symbolProto.valueOf : undefined, + symbolToString = symbolProto ? symbolProto.toString : undefined; + +/** + * Creates a hash object. + * + * @private + * @constructor + * @param {Array} [entries] The key-value pairs to cache. + */ +function Hash(entries) { + var index = -1, + length = entries ? entries.length : 0; + + this.clear(); + while (++index < length) { + var entry = entries[index]; + this.set(entry[0], entry[1]); + } +} + +/** + * Removes all key-value entries from the hash. + * + * @private + * @name clear + * @memberOf Hash + */ +function hashClear() { + this.__data__ = nativeCreate ? nativeCreate(null) : {}; +} + +/** + * Removes `key` and its value from the hash. + * + * @private + * @name delete + * @memberOf Hash + * @param {Object} hash The hash to modify. + * @param {string} key The key of the value to remove. + * @returns {boolean} Returns `true` if the entry was removed, else `false`. + */ +function hashDelete(key) { + return this.has(key) && delete this.__data__[key]; +} + +/** + * Gets the hash value for `key`. + * + * @private + * @name get + * @memberOf Hash + * @param {string} key The key of the value to get. + * @returns {*} Returns the entry value. + */ +function hashGet(key) { + var data = this.__data__; + if (nativeCreate) { + var result = data[key]; + return result === HASH_UNDEFINED ? undefined : result; + } + return hasOwnProperty.call(data, key) ? data[key] : undefined; +} + +/** + * Checks if a hash value for `key` exists. + * + * @private + * @name has + * @memberOf Hash + * @param {string} key The key of the entry to check. + * @returns {boolean} Returns `true` if an entry for `key` exists, else `false`. + */ +function hashHas(key) { + var data = this.__data__; + return nativeCreate ? data[key] !== undefined : hasOwnProperty.call(data, key); +} + +/** + * Sets the hash `key` to `value`. + * + * @private + * @name set + * @memberOf Hash + * @param {string} key The key of the value to set. + * @param {*} value The value to set. + * @returns {Object} Returns the hash instance. + */ +function hashSet(key, value) { + var data = this.__data__; + data[key] = (nativeCreate && value === undefined) ? HASH_UNDEFINED : value; + return this; +} + +// Add methods to `Hash`. +Hash.prototype.clear = hashClear; +Hash.prototype['delete'] = hashDelete; +Hash.prototype.get = hashGet; +Hash.prototype.has = hashHas; +Hash.prototype.set = hashSet; + +/** + * Creates an list cache object. + * + * @private + * @constructor + * @param {Array} [entries] The key-value pairs to cache. + */ +function ListCache(entries) { + var index = -1, + length = entries ? entries.length : 0; + + this.clear(); + while (++index < length) { + var entry = entries[index]; + this.set(entry[0], entry[1]); + } +} + +/** + * Removes all key-value entries from the list cache. + * + * @private + * @name clear + * @memberOf ListCache + */ +function listCacheClear() { + this.__data__ = []; +} + +/** + * Removes `key` and its value from the list cache. + * + * @private + * @name delete + * @memberOf ListCache + * @param {string} key The key of the value to remove. + * @returns {boolean} Returns `true` if the entry was removed, else `false`. + */ +function listCacheDelete(key) { + var data = this.__data__, + index = assocIndexOf(data, key); + + if (index < 0) { + return false; + } + var lastIndex = data.length - 1; + if (index == lastIndex) { + data.pop(); + } else { + splice.call(data, index, 1); + } + return true; +} + +/** + * Gets the list cache value for `key`. + * + * @private + * @name get + * @memberOf ListCache + * @param {string} key The key of the value to get. + * @returns {*} Returns the entry value. + */ +function listCacheGet(key) { + var data = this.__data__, + index = assocIndexOf(data, key); + + return index < 0 ? undefined : data[index][1]; +} + +/** + * Checks if a list cache value for `key` exists. + * + * @private + * @name has + * @memberOf ListCache + * @param {string} key The key of the entry to check. + * @returns {boolean} Returns `true` if an entry for `key` exists, else `false`. + */ +function listCacheHas(key) { + return assocIndexOf(this.__data__, key) > -1; +} + +/** + * Sets the list cache `key` to `value`. + * + * @private + * @name set + * @memberOf ListCache + * @param {string} key The key of the value to set. + * @param {*} value The value to set. + * @returns {Object} Returns the list cache instance. + */ +function listCacheSet(key, value) { + var data = this.__data__, + index = assocIndexOf(data, key); + + if (index < 0) { + data.push([key, value]); + } else { + data[index][1] = value; + } + return this; +} + +// Add methods to `ListCache`. +ListCache.prototype.clear = listCacheClear; +ListCache.prototype['delete'] = listCacheDelete; +ListCache.prototype.get = listCacheGet; +ListCache.prototype.has = listCacheHas; +ListCache.prototype.set = listCacheSet; + +/** + * Creates a map cache object to store key-value pairs. + * + * @private + * @constructor + * @param {Array} [entries] The key-value pairs to cache. + */ +function MapCache(entries) { + var index = -1, + length = entries ? entries.length : 0; + + this.clear(); + while (++index < length) { + var entry = entries[index]; + this.set(entry[0], entry[1]); + } +} + +/** + * Removes all key-value entries from the map. + * + * @private + * @name clear + * @memberOf MapCache + */ +function mapCacheClear() { + this.__data__ = { + 'hash': new Hash, + 'map': new (Map || ListCache), + 'string': new Hash + }; +} + +/** + * Removes `key` and its value from the map. + * + * @private + * @name delete + * @memberOf MapCache + * @param {string} key The key of the value to remove. + * @returns {boolean} Returns `true` if the entry was removed, else `false`. + */ +function mapCacheDelete(key) { + return getMapData(this, key)['delete'](key); +} + +/** + * Gets the map value for `key`. + * + * @private + * @name get + * @memberOf MapCache + * @param {string} key The key of the value to get. + * @returns {*} Returns the entry value. + */ +function mapCacheGet(key) { + return getMapData(this, key).get(key); +} + +/** + * Checks if a map value for `key` exists. + * + * @private + * @name has + * @memberOf MapCache + * @param {string} key The key of the entry to check. + * @returns {boolean} Returns `true` if an entry for `key` exists, else `false`. + */ +function mapCacheHas(key) { + return getMapData(this, key).has(key); +} + +/** + * Sets the map `key` to `value`. + * + * @private + * @name set + * @memberOf MapCache + * @param {string} key The key of the value to set. + * @param {*} value The value to set. + * @returns {Object} Returns the map cache instance. + */ +function mapCacheSet(key, value) { + getMapData(this, key).set(key, value); + return this; +} + +// Add methods to `MapCache`. +MapCache.prototype.clear = mapCacheClear; +MapCache.prototype['delete'] = mapCacheDelete; +MapCache.prototype.get = mapCacheGet; +MapCache.prototype.has = mapCacheHas; +MapCache.prototype.set = mapCacheSet; + +/** + * + * Creates an array cache object to store unique values. + * + * @private + * @constructor + * @param {Array} [values] The values to cache. + */ +function SetCache(values) { + var index = -1, + length = values ? values.length : 0; + + this.__data__ = new MapCache; + while (++index < length) { + this.add(values[index]); + } +} + +/** + * Adds `value` to the array cache. + * + * @private + * @name add + * @memberOf SetCache + * @alias push + * @param {*} value The value to cache. + * @returns {Object} Returns the cache instance. + */ +function setCacheAdd(value) { + this.__data__.set(value, HASH_UNDEFINED); + return this; +} + +/** + * Checks if `value` is in the array cache. + * + * @private + * @name has + * @memberOf SetCache + * @param {*} value The value to search for. + * @returns {number} Returns `true` if `value` is found, else `false`. + */ +function setCacheHas(value) { + return this.__data__.has(value); +} + +// Add methods to `SetCache`. +SetCache.prototype.add = SetCache.prototype.push = setCacheAdd; +SetCache.prototype.has = setCacheHas; + +/** + * Creates a stack cache object to store key-value pairs. + * + * @private + * @constructor + * @param {Array} [entries] The key-value pairs to cache. + */ +function Stack(entries) { + this.__data__ = new ListCache(entries); +} + +/** + * Removes all key-value entries from the stack. + * + * @private + * @name clear + * @memberOf Stack + */ +function stackClear() { + this.__data__ = new ListCache; +} + +/** + * Removes `key` and its value from the stack. + * + * @private + * @name delete + * @memberOf Stack + * @param {string} key The key of the value to remove. + * @returns {boolean} Returns `true` if the entry was removed, else `false`. + */ +function stackDelete(key) { + return this.__data__['delete'](key); +} + +/** + * Gets the stack value for `key`. + * + * @private + * @name get + * @memberOf Stack + * @param {string} key The key of the value to get. + * @returns {*} Returns the entry value. + */ +function stackGet(key) { + return this.__data__.get(key); +} + +/** + * Checks if a stack value for `key` exists. + * + * @private + * @name has + * @memberOf Stack + * @param {string} key The key of the entry to check. + * @returns {boolean} Returns `true` if an entry for `key` exists, else `false`. + */ +function stackHas(key) { + return this.__data__.has(key); +} + +/** + * Sets the stack `key` to `value`. + * + * @private + * @name set + * @memberOf Stack + * @param {string} key The key of the value to set. + * @param {*} value The value to set. + * @returns {Object} Returns the stack cache instance. + */ +function stackSet(key, value) { + var cache = this.__data__; + if (cache instanceof ListCache) { + var pairs = cache.__data__; + if (!Map || (pairs.length < LARGE_ARRAY_SIZE - 1)) { + pairs.push([key, value]); + return this; + } + cache = this.__data__ = new MapCache(pairs); + } + cache.set(key, value); + return this; +} + +// Add methods to `Stack`. +Stack.prototype.clear = stackClear; +Stack.prototype['delete'] = stackDelete; +Stack.prototype.get = stackGet; +Stack.prototype.has = stackHas; +Stack.prototype.set = stackSet; + +/** + * Creates an array of the enumerable property names of the array-like `value`. + * + * @private + * @param {*} value The value to query. + * @param {boolean} inherited Specify returning inherited property names. + * @returns {Array} Returns the array of property names. + */ +function arrayLikeKeys(value, inherited) { + // Safari 8.1 makes `arguments.callee` enumerable in strict mode. + // Safari 9 makes `arguments.length` enumerable in strict mode. + var result = (isArray(value) || isArguments(value)) + ? baseTimes(value.length, String) + : []; + + var length = result.length, + skipIndexes = !!length; + + for (var key in value) { + if ((inherited || hasOwnProperty.call(value, key)) && + !(skipIndexes && (key == 'length' || isIndex(key, length)))) { + result.push(key); + } + } + return result; +} + +/** + * Gets the index at which the `key` is found in `array` of key-value pairs. + * + * @private + * @param {Array} array The array to inspect. + * @param {*} key The key to search for. + * @returns {number} Returns the index of the matched value, else `-1`. + */ +function assocIndexOf(array, key) { + var length = array.length; + while (length--) { + if (eq(array[length][0], key)) { + return length; + } + } + return -1; +} + +/** + * The base implementation of `_.forEach` without support for iteratee shorthands. + * + * @private + * @param {Array|Object} collection The collection to iterate over. + * @param {Function} iteratee The function invoked per iteration. + * @returns {Array|Object} Returns `collection`. + */ +var baseEach = createBaseEach(baseForOwn); + +/** + * The base implementation of `_.flatten` with support for restricting flattening. + * + * @private + * @param {Array} array The array to flatten. + * @param {number} depth The maximum recursion depth. + * @param {boolean} [predicate=isFlattenable] The function invoked per iteration. + * @param {boolean} [isStrict] Restrict to values that pass `predicate` checks. + * @param {Array} [result=[]] The initial result value. + * @returns {Array} Returns the new flattened array. + */ +function baseFlatten(array, depth, predicate, isStrict, result) { + var index = -1, + length = array.length; + + predicate || (predicate = isFlattenable); + result || (result = []); + + while (++index < length) { + var value = array[index]; + if (depth > 0 && predicate(value)) { + if (depth > 1) { + // Recursively flatten arrays (susceptible to call stack limits). + baseFlatten(value, depth - 1, predicate, isStrict, result); + } else { + arrayPush(result, value); + } + } else if (!isStrict) { + result[result.length] = value; + } + } + return result; +} + +/** + * The base implementation of `baseForOwn` which iterates over `object` + * properties returned by `keysFunc` and invokes `iteratee` for each property. + * Iteratee functions may exit iteration early by explicitly returning `false`. + * + * @private + * @param {Object} object The object to iterate over. + * @param {Function} iteratee The function invoked per iteration. + * @param {Function} keysFunc The function to get the keys of `object`. + * @returns {Object} Returns `object`. + */ +var baseFor = createBaseFor(); + +/** + * The base implementation of `_.forOwn` without support for iteratee shorthands. + * + * @private + * @param {Object} object The object to iterate over. + * @param {Function} iteratee The function invoked per iteration. + * @returns {Object} Returns `object`. + */ +function baseForOwn(object, iteratee) { + return object && baseFor(object, iteratee, keys); +} + +/** + * The base implementation of `_.get` without support for default values. + * + * @private + * @param {Object} object The object to query. + * @param {Array|string} path The path of the property to get. + * @returns {*} Returns the resolved value. + */ +function baseGet(object, path) { + path = isKey(path, object) ? [path] : castPath(path); + + var index = 0, + length = path.length; + + while (object != null && index < length) { + object = object[toKey(path[index++])]; + } + return (index && index == length) ? object : undefined; +} + +/** + * The base implementation of `getTag`. + * + * @private + * @param {*} value The value to query. + * @returns {string} Returns the `toStringTag`. + */ +function baseGetTag(value) { + return objectToString.call(value); +} + +/** + * The base implementation of `_.hasIn` without support for deep paths. + * + * @private + * @param {Object} [object] The object to query. + * @param {Array|string} key The key to check. + * @returns {boolean} Returns `true` if `key` exists, else `false`. + */ +function baseHasIn(object, key) { + return object != null && key in Object(object); +} + +/** + * The base implementation of `_.isEqual` which supports partial comparisons + * and tracks traversed objects. + * + * @private + * @param {*} value The value to compare. + * @param {*} other The other value to compare. + * @param {Function} [customizer] The function to customize comparisons. + * @param {boolean} [bitmask] The bitmask of comparison flags. + * The bitmask may be composed of the following flags: + * 1 - Unordered comparison + * 2 - Partial comparison + * @param {Object} [stack] Tracks traversed `value` and `other` objects. + * @returns {boolean} Returns `true` if the values are equivalent, else `false`. + */ +function baseIsEqual(value, other, customizer, bitmask, stack) { + if (value === other) { + return true; + } + if (value == null || other == null || (!isObject(value) && !isObjectLike(other))) { + return value !== value && other !== other; + } + return baseIsEqualDeep(value, other, baseIsEqual, customizer, bitmask, stack); +} + +/** + * A specialized version of `baseIsEqual` for arrays and objects which performs + * deep comparisons and tracks traversed objects enabling objects with circular + * references to be compared. + * + * @private + * @param {Object} object The object to compare. + * @param {Object} other The other object to compare. + * @param {Function} equalFunc The function to determine equivalents of values. + * @param {Function} [customizer] The function to customize comparisons. + * @param {number} [bitmask] The bitmask of comparison flags. See `baseIsEqual` + * for more details. + * @param {Object} [stack] Tracks traversed `object` and `other` objects. + * @returns {boolean} Returns `true` if the objects are equivalent, else `false`. + */ +function baseIsEqualDeep(object, other, equalFunc, customizer, bitmask, stack) { + var objIsArr = isArray(object), + othIsArr = isArray(other), + objTag = arrayTag, + othTag = arrayTag; + + if (!objIsArr) { + objTag = getTag(object); + objTag = objTag == argsTag ? objectTag : objTag; + } + if (!othIsArr) { + othTag = getTag(other); + othTag = othTag == argsTag ? objectTag : othTag; + } + var objIsObj = objTag == objectTag && !isHostObject(object), + othIsObj = othTag == objectTag && !isHostObject(other), + isSameTag = objTag == othTag; + + if (isSameTag && !objIsObj) { + stack || (stack = new Stack); + return (objIsArr || isTypedArray(object)) + ? equalArrays(object, other, equalFunc, customizer, bitmask, stack) + : equalByTag(object, other, objTag, equalFunc, customizer, bitmask, stack); + } + if (!(bitmask & PARTIAL_COMPARE_FLAG)) { + var objIsWrapped = objIsObj && hasOwnProperty.call(object, '__wrapped__'), + othIsWrapped = othIsObj && hasOwnProperty.call(other, '__wrapped__'); + + if (objIsWrapped || othIsWrapped) { + var objUnwrapped = objIsWrapped ? object.value() : object, + othUnwrapped = othIsWrapped ? other.value() : other; + + stack || (stack = new Stack); + return equalFunc(objUnwrapped, othUnwrapped, customizer, bitmask, stack); + } + } + if (!isSameTag) { + return false; + } + stack || (stack = new Stack); + return equalObjects(object, other, equalFunc, customizer, bitmask, stack); +} + +/** + * The base implementation of `_.isMatch` without support for iteratee shorthands. + * + * @private + * @param {Object} object The object to inspect. + * @param {Object} source The object of property values to match. + * @param {Array} matchData The property names, values, and compare flags to match. + * @param {Function} [customizer] The function to customize comparisons. + * @returns {boolean} Returns `true` if `object` is a match, else `false`. + */ +function baseIsMatch(object, source, matchData, customizer) { + var index = matchData.length, + length = index, + noCustomizer = !customizer; + + if (object == null) { + return !length; + } + object = Object(object); + while (index--) { + var data = matchData[index]; + if ((noCustomizer && data[2]) + ? data[1] !== object[data[0]] + : !(data[0] in object) + ) { + return false; + } + } + while (++index < length) { + data = matchData[index]; + var key = data[0], + objValue = object[key], + srcValue = data[1]; + + if (noCustomizer && data[2]) { + if (objValue === undefined && !(key in object)) { + return false; + } + } else { + var stack = new Stack; + if (customizer) { + var result = customizer(objValue, srcValue, key, object, source, stack); + } + if (!(result === undefined + ? baseIsEqual(srcValue, objValue, customizer, UNORDERED_COMPARE_FLAG | PARTIAL_COMPARE_FLAG, stack) + : result + )) { + return false; + } + } + } + return true; +} + +/** + * The base implementation of `_.isNative` without bad shim checks. + * + * @private + * @param {*} value The value to check. + * @returns {boolean} Returns `true` if `value` is a native function, + * else `false`. + */ +function baseIsNative(value) { + if (!isObject(value) || isMasked(value)) { + return false; + } + var pattern = (isFunction(value) || isHostObject(value)) ? reIsNative : reIsHostCtor; + return pattern.test(toSource(value)); +} + +/** + * The base implementation of `_.isTypedArray` without Node.js optimizations. + * + * @private + * @param {*} value The value to check. + * @returns {boolean} Returns `true` if `value` is a typed array, else `false`. + */ +function baseIsTypedArray(value) { + return isObjectLike(value) && + isLength(value.length) && !!typedArrayTags[objectToString.call(value)]; +} + +/** + * The base implementation of `_.iteratee`. + * + * @private + * @param {*} [value=_.identity] The value to convert to an iteratee. + * @returns {Function} Returns the iteratee. + */ +function baseIteratee(value) { + // Don't store the `typeof` result in a variable to avoid a JIT bug in Safari 9. + // See https://bugs.webkit.org/show_bug.cgi?id=156034 for more details. + if (typeof value == 'function') { + return value; + } + if (value == null) { + return identity; + } + if (typeof value == 'object') { + return isArray(value) + ? baseMatchesProperty(value[0], value[1]) + : baseMatches(value); + } + return property(value); +} + +/** + * The base implementation of `_.keys` which doesn't treat sparse arrays as dense. + * + * @private + * @param {Object} object The object to query. + * @returns {Array} Returns the array of property names. + */ +function baseKeys(object) { + if (!isPrototype(object)) { + return nativeKeys(object); + } + var result = []; + for (var key in Object(object)) { + if (hasOwnProperty.call(object, key) && key != 'constructor') { + result.push(key); + } + } + return result; +} + +/** + * The base implementation of `_.map` without support for iteratee shorthands. + * + * @private + * @param {Array|Object} collection The collection to iterate over. + * @param {Function} iteratee The function invoked per iteration. + * @returns {Array} Returns the new mapped array. + */ +function baseMap(collection, iteratee) { + var index = -1, + result = isArrayLike(collection) ? Array(collection.length) : []; + + baseEach(collection, function(value, key, collection) { + result[++index] = iteratee(value, key, collection); + }); + return result; +} + +/** + * The base implementation of `_.matches` which doesn't clone `source`. + * + * @private + * @param {Object} source The object of property values to match. + * @returns {Function} Returns the new spec function. + */ +function baseMatches(source) { + var matchData = getMatchData(source); + if (matchData.length == 1 && matchData[0][2]) { + return matchesStrictComparable(matchData[0][0], matchData[0][1]); + } + return function(object) { + return object === source || baseIsMatch(object, source, matchData); + }; +} + +/** + * The base implementation of `_.matchesProperty` which doesn't clone `srcValue`. + * + * @private + * @param {string} path The path of the property to get. + * @param {*} srcValue The value to match. + * @returns {Function} Returns the new spec function. + */ +function baseMatchesProperty(path, srcValue) { + if (isKey(path) && isStrictComparable(srcValue)) { + return matchesStrictComparable(toKey(path), srcValue); + } + return function(object) { + var objValue = get(object, path); + return (objValue === undefined && objValue === srcValue) + ? hasIn(object, path) + : baseIsEqual(srcValue, objValue, undefined, UNORDERED_COMPARE_FLAG | PARTIAL_COMPARE_FLAG); + }; +} + +/** + * The base implementation of `_.orderBy` without param guards. + * + * @private + * @param {Array|Object} collection The collection to iterate over. + * @param {Function[]|Object[]|string[]} iteratees The iteratees to sort by. + * @param {string[]} orders The sort orders of `iteratees`. + * @returns {Array} Returns the new sorted array. + */ +function baseOrderBy(collection, iteratees, orders) { + var index = -1; + iteratees = arrayMap(iteratees.length ? iteratees : [identity], baseUnary(baseIteratee)); + + var result = baseMap(collection, function(value, key, collection) { + var criteria = arrayMap(iteratees, function(iteratee) { + return iteratee(value); + }); + return { 'criteria': criteria, 'index': ++index, 'value': value }; + }); + + return baseSortBy(result, function(object, other) { + return compareMultiple(object, other, orders); + }); +} + +/** + * A specialized version of `baseProperty` which supports deep paths. + * + * @private + * @param {Array|string} path The path of the property to get. + * @returns {Function} Returns the new accessor function. + */ +function basePropertyDeep(path) { + return function(object) { + return baseGet(object, path); + }; +} + +/** + * The base implementation of `_.rest` which doesn't validate or coerce arguments. + * + * @private + * @param {Function} func The function to apply a rest parameter to. + * @param {number} [start=func.length-1] The start position of the rest parameter. + * @returns {Function} Returns the new function. + */ +function baseRest(func, start) { + start = nativeMax(start === undefined ? (func.length - 1) : start, 0); + return function() { + var args = arguments, + index = -1, + length = nativeMax(args.length - start, 0), + array = Array(length); + + while (++index < length) { + array[index] = args[start + index]; + } + index = -1; + var otherArgs = Array(start + 1); + while (++index < start) { + otherArgs[index] = args[index]; + } + otherArgs[start] = array; + return apply(func, this, otherArgs); + }; +} + +/** + * The base implementation of `_.toString` which doesn't convert nullish + * values to empty strings. + * + * @private + * @param {*} value The value to process. + * @returns {string} Returns the string. + */ +function baseToString(value) { + // Exit early for strings to avoid a performance hit in some environments. + if (typeof value == 'string') { + return value; + } + if (isSymbol(value)) { + return symbolToString ? symbolToString.call(value) : ''; + } + var result = (value + ''); + return (result == '0' && (1 / value) == -INFINITY) ? '-0' : result; +} + +/** + * Casts `value` to a path array if it's not one. + * + * @private + * @param {*} value The value to inspect. + * @returns {Array} Returns the cast property path array. + */ +function castPath(value) { + return isArray(value) ? value : stringToPath(value); +} + +/** + * Compares values to sort them in ascending order. + * + * @private + * @param {*} value The value to compare. + * @param {*} other The other value to compare. + * @returns {number} Returns the sort order indicator for `value`. + */ +function compareAscending(value, other) { + if (value !== other) { + var valIsDefined = value !== undefined, + valIsNull = value === null, + valIsReflexive = value === value, + valIsSymbol = isSymbol(value); + + var othIsDefined = other !== undefined, + othIsNull = other === null, + othIsReflexive = other === other, + othIsSymbol = isSymbol(other); + + if ((!othIsNull && !othIsSymbol && !valIsSymbol && value > other) || + (valIsSymbol && othIsDefined && othIsReflexive && !othIsNull && !othIsSymbol) || + (valIsNull && othIsDefined && othIsReflexive) || + (!valIsDefined && othIsReflexive) || + !valIsReflexive) { + return 1; + } + if ((!valIsNull && !valIsSymbol && !othIsSymbol && value < other) || + (othIsSymbol && valIsDefined && valIsReflexive && !valIsNull && !valIsSymbol) || + (othIsNull && valIsDefined && valIsReflexive) || + (!othIsDefined && valIsReflexive) || + !othIsReflexive) { + return -1; + } + } + return 0; +} + +/** + * Used by `_.orderBy` to compare multiple properties of a value to another + * and stable sort them. + * + * If `orders` is unspecified, all values are sorted in ascending order. Otherwise, + * specify an order of "desc" for descending or "asc" for ascending sort order + * of corresponding values. + * + * @private + * @param {Object} object The object to compare. + * @param {Object} other The other object to compare. + * @param {boolean[]|string[]} orders The order to sort by for each property. + * @returns {number} Returns the sort order indicator for `object`. + */ +function compareMultiple(object, other, orders) { + var index = -1, + objCriteria = object.criteria, + othCriteria = other.criteria, + length = objCriteria.length, + ordersLength = orders.length; + + while (++index < length) { + var result = compareAscending(objCriteria[index], othCriteria[index]); + if (result) { + if (index >= ordersLength) { + return result; + } + var order = orders[index]; + return result * (order == 'desc' ? -1 : 1); + } + } + // Fixes an `Array#sort` bug in the JS engine embedded in Adobe applications + // that causes it, under certain circumstances, to provide the same value for + // `object` and `other`. See https://github.com/jashkenas/underscore/pull/1247 + // for more details. + // + // This also ensures a stable sort in V8 and other engines. + // See https://bugs.chromium.org/p/v8/issues/detail?id=90 for more details. + return object.index - other.index; +} + +/** + * Creates a `baseEach` or `baseEachRight` function. + * + * @private + * @param {Function} eachFunc The function to iterate over a collection. + * @param {boolean} [fromRight] Specify iterating from right to left. + * @returns {Function} Returns the new base function. + */ +function createBaseEach(eachFunc, fromRight) { + return function(collection, iteratee) { + if (collection == null) { + return collection; + } + if (!isArrayLike(collection)) { + return eachFunc(collection, iteratee); + } + var length = collection.length, + index = fromRight ? length : -1, + iterable = Object(collection); + + while ((fromRight ? index-- : ++index < length)) { + if (iteratee(iterable[index], index, iterable) === false) { + break; + } + } + return collection; + }; +} + +/** + * Creates a base function for methods like `_.forIn` and `_.forOwn`. + * + * @private + * @param {boolean} [fromRight] Specify iterating from right to left. + * @returns {Function} Returns the new base function. + */ +function createBaseFor(fromRight) { + return function(object, iteratee, keysFunc) { + var index = -1, + iterable = Object(object), + props = keysFunc(object), + length = props.length; + + while (length--) { + var key = props[fromRight ? length : ++index]; + if (iteratee(iterable[key], key, iterable) === false) { + break; + } + } + return object; + }; +} + +/** + * A specialized version of `baseIsEqualDeep` for arrays with support for + * partial deep comparisons. + * + * @private + * @param {Array} array The array to compare. + * @param {Array} other The other array to compare. + * @param {Function} equalFunc The function to determine equivalents of values. + * @param {Function} customizer The function to customize comparisons. + * @param {number} bitmask The bitmask of comparison flags. See `baseIsEqual` + * for more details. + * @param {Object} stack Tracks traversed `array` and `other` objects. + * @returns {boolean} Returns `true` if the arrays are equivalent, else `false`. + */ +function equalArrays(array, other, equalFunc, customizer, bitmask, stack) { + var isPartial = bitmask & PARTIAL_COMPARE_FLAG, + arrLength = array.length, + othLength = other.length; + + if (arrLength != othLength && !(isPartial && othLength > arrLength)) { + return false; + } + // Assume cyclic values are equal. + var stacked = stack.get(array); + if (stacked && stack.get(other)) { + return stacked == other; + } + var index = -1, + result = true, + seen = (bitmask & UNORDERED_COMPARE_FLAG) ? new SetCache : undefined; + + stack.set(array, other); + stack.set(other, array); + + // Ignore non-index properties. + while (++index < arrLength) { + var arrValue = array[index], + othValue = other[index]; + + if (customizer) { + var compared = isPartial + ? customizer(othValue, arrValue, index, other, array, stack) + : customizer(arrValue, othValue, index, array, other, stack); + } + if (compared !== undefined) { + if (compared) { + continue; + } + result = false; + break; + } + // Recursively compare arrays (susceptible to call stack limits). + if (seen) { + if (!arraySome(other, function(othValue, othIndex) { + if (!seen.has(othIndex) && + (arrValue === othValue || equalFunc(arrValue, othValue, customizer, bitmask, stack))) { + return seen.add(othIndex); + } + })) { + result = false; + break; + } + } else if (!( + arrValue === othValue || + equalFunc(arrValue, othValue, customizer, bitmask, stack) + )) { + result = false; + break; + } + } + stack['delete'](array); + stack['delete'](other); + return result; +} + +/** + * A specialized version of `baseIsEqualDeep` for comparing objects of + * the same `toStringTag`. + * + * **Note:** This function only supports comparing values with tags of + * `Boolean`, `Date`, `Error`, `Number`, `RegExp`, or `String`. + * + * @private + * @param {Object} object The object to compare. + * @param {Object} other The other object to compare. + * @param {string} tag The `toStringTag` of the objects to compare. + * @param {Function} equalFunc The function to determine equivalents of values. + * @param {Function} customizer The function to customize comparisons. + * @param {number} bitmask The bitmask of comparison flags. See `baseIsEqual` + * for more details. + * @param {Object} stack Tracks traversed `object` and `other` objects. + * @returns {boolean} Returns `true` if the objects are equivalent, else `false`. + */ +function equalByTag(object, other, tag, equalFunc, customizer, bitmask, stack) { + switch (tag) { + case dataViewTag: + if ((object.byteLength != other.byteLength) || + (object.byteOffset != other.byteOffset)) { + return false; + } + object = object.buffer; + other = other.buffer; + + case arrayBufferTag: + if ((object.byteLength != other.byteLength) || + !equalFunc(new Uint8Array(object), new Uint8Array(other))) { + return false; + } + return true; + + case boolTag: + case dateTag: + case numberTag: + // Coerce booleans to `1` or `0` and dates to milliseconds. + // Invalid dates are coerced to `NaN`. + return eq(+object, +other); + + case errorTag: + return object.name == other.name && object.message == other.message; + + case regexpTag: + case stringTag: + // Coerce regexes to strings and treat strings, primitives and objects, + // as equal. See http://www.ecma-international.org/ecma-262/7.0/#sec-regexp.prototype.tostring + // for more details. + return object == (other + ''); + + case mapTag: + var convert = mapToArray; + + case setTag: + var isPartial = bitmask & PARTIAL_COMPARE_FLAG; + convert || (convert = setToArray); + + if (object.size != other.size && !isPartial) { + return false; + } + // Assume cyclic values are equal. + var stacked = stack.get(object); + if (stacked) { + return stacked == other; + } + bitmask |= UNORDERED_COMPARE_FLAG; + + // Recursively compare objects (susceptible to call stack limits). + stack.set(object, other); + var result = equalArrays(convert(object), convert(other), equalFunc, customizer, bitmask, stack); + stack['delete'](object); + return result; + + case symbolTag: + if (symbolValueOf) { + return symbolValueOf.call(object) == symbolValueOf.call(other); + } + } + return false; +} + +/** + * A specialized version of `baseIsEqualDeep` for objects with support for + * partial deep comparisons. + * + * @private + * @param {Object} object The object to compare. + * @param {Object} other The other object to compare. + * @param {Function} equalFunc The function to determine equivalents of values. + * @param {Function} customizer The function to customize comparisons. + * @param {number} bitmask The bitmask of comparison flags. See `baseIsEqual` + * for more details. + * @param {Object} stack Tracks traversed `object` and `other` objects. + * @returns {boolean} Returns `true` if the objects are equivalent, else `false`. + */ +function equalObjects(object, other, equalFunc, customizer, bitmask, stack) { + var isPartial = bitmask & PARTIAL_COMPARE_FLAG, + objProps = keys(object), + objLength = objProps.length, + othProps = keys(other), + othLength = othProps.length; + + if (objLength != othLength && !isPartial) { + return false; + } + var index = objLength; + while (index--) { + var key = objProps[index]; + if (!(isPartial ? key in other : hasOwnProperty.call(other, key))) { + return false; + } + } + // Assume cyclic values are equal. + var stacked = stack.get(object); + if (stacked && stack.get(other)) { + return stacked == other; + } + var result = true; + stack.set(object, other); + stack.set(other, object); + + var skipCtor = isPartial; + while (++index < objLength) { + key = objProps[index]; + var objValue = object[key], + othValue = other[key]; + + if (customizer) { + var compared = isPartial + ? customizer(othValue, objValue, key, other, object, stack) + : customizer(objValue, othValue, key, object, other, stack); + } + // Recursively compare objects (susceptible to call stack limits). + if (!(compared === undefined + ? (objValue === othValue || equalFunc(objValue, othValue, customizer, bitmask, stack)) + : compared + )) { + result = false; + break; + } + skipCtor || (skipCtor = key == 'constructor'); + } + if (result && !skipCtor) { + var objCtor = object.constructor, + othCtor = other.constructor; + + // Non `Object` object instances with different constructors are not equal. + if (objCtor != othCtor && + ('constructor' in object && 'constructor' in other) && + !(typeof objCtor == 'function' && objCtor instanceof objCtor && + typeof othCtor == 'function' && othCtor instanceof othCtor)) { + result = false; + } + } + stack['delete'](object); + stack['delete'](other); + return result; +} + +/** + * Gets the data for `map`. + * + * @private + * @param {Object} map The map to query. + * @param {string} key The reference key. + * @returns {*} Returns the map data. + */ +function getMapData(map, key) { + var data = map.__data__; + return isKeyable(key) + ? data[typeof key == 'string' ? 'string' : 'hash'] + : data.map; +} + +/** + * Gets the property names, values, and compare flags of `object`. + * + * @private + * @param {Object} object The object to query. + * @returns {Array} Returns the match data of `object`. + */ +function getMatchData(object) { + var result = keys(object), + length = result.length; + + while (length--) { + var key = result[length], + value = object[key]; + + result[length] = [key, value, isStrictComparable(value)]; + } + return result; +} + +/** + * Gets the native function at `key` of `object`. + * + * @private + * @param {Object} object The object to query. + * @param {string} key The key of the method to get. + * @returns {*} Returns the function if it's native, else `undefined`. + */ +function getNative(object, key) { + var value = getValue(object, key); + return baseIsNative(value) ? value : undefined; +} + +/** + * Gets the `toStringTag` of `value`. + * + * @private + * @param {*} value The value to query. + * @returns {string} Returns the `toStringTag`. + */ +var getTag = baseGetTag; + +// Fallback for data views, maps, sets, and weak maps in IE 11, +// for data views in Edge < 14, and promises in Node.js. +if ((DataView && getTag(new DataView(new ArrayBuffer(1))) != dataViewTag) || + (Map && getTag(new Map) != mapTag) || + (Promise && getTag(Promise.resolve()) != promiseTag) || + (Set && getTag(new Set) != setTag) || + (WeakMap && getTag(new WeakMap) != weakMapTag)) { + getTag = function(value) { + var result = objectToString.call(value), + Ctor = result == objectTag ? value.constructor : undefined, + ctorString = Ctor ? toSource(Ctor) : undefined; + + if (ctorString) { + switch (ctorString) { + case dataViewCtorString: return dataViewTag; + case mapCtorString: return mapTag; + case promiseCtorString: return promiseTag; + case setCtorString: return setTag; + case weakMapCtorString: return weakMapTag; + } + } + return result; + }; +} + +/** + * Checks if `path` exists on `object`. + * + * @private + * @param {Object} object The object to query. + * @param {Array|string} path The path to check. + * @param {Function} hasFunc The function to check properties. + * @returns {boolean} Returns `true` if `path` exists, else `false`. + */ +function hasPath(object, path, hasFunc) { + path = isKey(path, object) ? [path] : castPath(path); + + var result, + index = -1, + length = path.length; + + while (++index < length) { + var key = toKey(path[index]); + if (!(result = object != null && hasFunc(object, key))) { + break; + } + object = object[key]; + } + if (result) { + return result; + } + var length = object ? object.length : 0; + return !!length && isLength(length) && isIndex(key, length) && + (isArray(object) || isArguments(object)); +} + +/** + * Checks if `value` is a flattenable `arguments` object or array. + * + * @private + * @param {*} value The value to check. + * @returns {boolean} Returns `true` if `value` is flattenable, else `false`. + */ +function isFlattenable(value) { + return isArray(value) || isArguments(value) || + !!(spreadableSymbol && value && value[spreadableSymbol]); +} + +/** + * Checks if `value` is a valid array-like index. + * + * @private + * @param {*} value The value to check. + * @param {number} [length=MAX_SAFE_INTEGER] The upper bounds of a valid index. + * @returns {boolean} Returns `true` if `value` is a valid index, else `false`. + */ +function isIndex(value, length) { + length = length == null ? MAX_SAFE_INTEGER : length; + return !!length && + (typeof value == 'number' || reIsUint.test(value)) && + (value > -1 && value % 1 == 0 && value < length); +} + +/** + * Checks if the given arguments are from an iteratee call. + * + * @private + * @param {*} value The potential iteratee value argument. + * @param {*} index The potential iteratee index or key argument. + * @param {*} object The potential iteratee object argument. + * @returns {boolean} Returns `true` if the arguments are from an iteratee call, + * else `false`. + */ +function isIterateeCall(value, index, object) { + if (!isObject(object)) { + return false; + } + var type = typeof index; + if (type == 'number' + ? (isArrayLike(object) && isIndex(index, object.length)) + : (type == 'string' && index in object) + ) { + return eq(object[index], value); + } + return false; +} + +/** + * Checks if `value` is a property name and not a property path. + * + * @private + * @param {*} value The value to check. + * @param {Object} [object] The object to query keys on. + * @returns {boolean} Returns `true` if `value` is a property name, else `false`. + */ +function isKey(value, object) { + if (isArray(value)) { + return false; + } + var type = typeof value; + if (type == 'number' || type == 'symbol' || type == 'boolean' || + value == null || isSymbol(value)) { + return true; + } + return reIsPlainProp.test(value) || !reIsDeepProp.test(value) || + (object != null && value in Object(object)); +} + +/** + * Checks if `value` is suitable for use as unique object key. + * + * @private + * @param {*} value The value to check. + * @returns {boolean} Returns `true` if `value` is suitable, else `false`. + */ +function isKeyable(value) { + var type = typeof value; + return (type == 'string' || type == 'number' || type == 'symbol' || type == 'boolean') + ? (value !== '__proto__') + : (value === null); +} + +/** + * Checks if `func` has its source masked. + * + * @private + * @param {Function} func The function to check. + * @returns {boolean} Returns `true` if `func` is masked, else `false`. + */ +function isMasked(func) { + return !!maskSrcKey && (maskSrcKey in func); +} + +/** + * Checks if `value` is likely a prototype object. + * + * @private + * @param {*} value The value to check. + * @returns {boolean} Returns `true` if `value` is a prototype, else `false`. + */ +function isPrototype(value) { + var Ctor = value && value.constructor, + proto = (typeof Ctor == 'function' && Ctor.prototype) || objectProto; + + return value === proto; +} + +/** + * Checks if `value` is suitable for strict equality comparisons, i.e. `===`. + * + * @private + * @param {*} value The value to check. + * @returns {boolean} Returns `true` if `value` if suitable for strict + * equality comparisons, else `false`. + */ +function isStrictComparable(value) { + return value === value && !isObject(value); +} + +/** + * A specialized version of `matchesProperty` for source values suitable + * for strict equality comparisons, i.e. `===`. + * + * @private + * @param {string} key The key of the property to get. + * @param {*} srcValue The value to match. + * @returns {Function} Returns the new spec function. + */ +function matchesStrictComparable(key, srcValue) { + return function(object) { + if (object == null) { + return false; + } + return object[key] === srcValue && + (srcValue !== undefined || (key in Object(object))); + }; +} + +/** + * Converts `string` to a property path array. + * + * @private + * @param {string} string The string to convert. + * @returns {Array} Returns the property path array. + */ +var stringToPath = memoize(function(string) { + string = toString(string); + + var result = []; + if (reLeadingDot.test(string)) { + result.push(''); + } + string.replace(rePropName, function(match, number, quote, string) { + result.push(quote ? string.replace(reEscapeChar, '$1') : (number || match)); + }); + return result; +}); + +/** + * Converts `value` to a string key if it's not a string or symbol. + * + * @private + * @param {*} value The value to inspect. + * @returns {string|symbol} Returns the key. + */ +function toKey(value) { + if (typeof value == 'string' || isSymbol(value)) { + return value; + } + var result = (value + ''); + return (result == '0' && (1 / value) == -INFINITY) ? '-0' : result; +} + +/** + * Converts `func` to its source code. + * + * @private + * @param {Function} func The function to process. + * @returns {string} Returns the source code. + */ +function toSource(func) { + if (func != null) { + try { + return funcToString.call(func); + } catch (e) {} + try { + return (func + ''); + } catch (e) {} + } + return ''; +} + +/** + * Creates an array of elements, sorted in ascending order by the results of + * running each element in a collection thru each iteratee. This method + * performs a stable sort, that is, it preserves the original sort order of + * equal elements. The iteratees are invoked with one argument: (value). + * + * @static + * @memberOf _ + * @since 0.1.0 + * @category Collection + * @param {Array|Object} collection The collection to iterate over. + * @param {...(Function|Function[])} [iteratees=[_.identity]] + * The iteratees to sort by. + * @returns {Array} Returns the new sorted array. + * @example + * + * var users = [ + * { 'user': 'fred', 'age': 48 }, + * { 'user': 'barney', 'age': 36 }, + * { 'user': 'fred', 'age': 40 }, + * { 'user': 'barney', 'age': 34 } + * ]; + * + * _.sortBy(users, function(o) { return o.user; }); + * // => objects for [['barney', 36], ['barney', 34], ['fred', 48], ['fred', 40]] + * + * _.sortBy(users, ['user', 'age']); + * // => objects for [['barney', 34], ['barney', 36], ['fred', 40], ['fred', 48]] + * + * _.sortBy(users, 'user', function(o) { + * return Math.floor(o.age / 10); + * }); + * // => objects for [['barney', 36], ['barney', 34], ['fred', 48], ['fred', 40]] + */ +var sortBy = baseRest(function(collection, iteratees) { + if (collection == null) { + return []; + } + var length = iteratees.length; + if (length > 1 && isIterateeCall(collection, iteratees[0], iteratees[1])) { + iteratees = []; + } else if (length > 2 && isIterateeCall(iteratees[0], iteratees[1], iteratees[2])) { + iteratees = [iteratees[0]]; + } + return baseOrderBy(collection, baseFlatten(iteratees, 1), []); +}); + +/** + * Creates a function that memoizes the result of `func`. If `resolver` is + * provided, it determines the cache key for storing the result based on the + * arguments provided to the memoized function. By default, the first argument + * provided to the memoized function is used as the map cache key. The `func` + * is invoked with the `this` binding of the memoized function. + * + * **Note:** The cache is exposed as the `cache` property on the memoized + * function. Its creation may be customized by replacing the `_.memoize.Cache` + * constructor with one whose instances implement the + * [`Map`](http://ecma-international.org/ecma-262/7.0/#sec-properties-of-the-map-prototype-object) + * method interface of `delete`, `get`, `has`, and `set`. + * + * @static + * @memberOf _ + * @since 0.1.0 + * @category Function + * @param {Function} func The function to have its output memoized. + * @param {Function} [resolver] The function to resolve the cache key. + * @returns {Function} Returns the new memoized function. + * @example + * + * var object = { 'a': 1, 'b': 2 }; + * var other = { 'c': 3, 'd': 4 }; + * + * var values = _.memoize(_.values); + * values(object); + * // => [1, 2] + * + * values(other); + * // => [3, 4] + * + * object.a = 2; + * values(object); + * // => [1, 2] + * + * // Modify the result cache. + * values.cache.set(object, ['a', 'b']); + * values(object); + * // => ['a', 'b'] + * + * // Replace `_.memoize.Cache`. + * _.memoize.Cache = WeakMap; + */ +function memoize(func, resolver) { + if (typeof func != 'function' || (resolver && typeof resolver != 'function')) { + throw new TypeError(FUNC_ERROR_TEXT); + } + var memoized = function() { + var args = arguments, + key = resolver ? resolver.apply(this, args) : args[0], + cache = memoized.cache; + + if (cache.has(key)) { + return cache.get(key); + } + var result = func.apply(this, args); + memoized.cache = cache.set(key, result); + return result; + }; + memoized.cache = new (memoize.Cache || MapCache); + return memoized; +} + +// Assign cache to `_.memoize`. +memoize.Cache = MapCache; + +/** + * Performs a + * [`SameValueZero`](http://ecma-international.org/ecma-262/7.0/#sec-samevaluezero) + * comparison between two values to determine if they are equivalent. + * + * @static + * @memberOf _ + * @since 4.0.0 + * @category Lang + * @param {*} value The value to compare. + * @param {*} other The other value to compare. + * @returns {boolean} Returns `true` if the values are equivalent, else `false`. + * @example + * + * var object = { 'a': 1 }; + * var other = { 'a': 1 }; + * + * _.eq(object, object); + * // => true + * + * _.eq(object, other); + * // => false + * + * _.eq('a', 'a'); + * // => true + * + * _.eq('a', Object('a')); + * // => false + * + * _.eq(NaN, NaN); + * // => true + */ +function eq(value, other) { + return value === other || (value !== value && other !== other); +} + +/** + * Checks if `value` is likely an `arguments` object. + * + * @static + * @memberOf _ + * @since 0.1.0 + * @category Lang + * @param {*} value The value to check. + * @returns {boolean} Returns `true` if `value` is an `arguments` object, + * else `false`. + * @example + * + * _.isArguments(function() { return arguments; }()); + * // => true + * + * _.isArguments([1, 2, 3]); + * // => false + */ +function isArguments(value) { + // Safari 8.1 makes `arguments.callee` enumerable in strict mode. + return isArrayLikeObject(value) && hasOwnProperty.call(value, 'callee') && + (!propertyIsEnumerable.call(value, 'callee') || objectToString.call(value) == argsTag); +} + +/** + * Checks if `value` is classified as an `Array` object. + * + * @static + * @memberOf _ + * @since 0.1.0 + * @category Lang + * @param {*} value The value to check. + * @returns {boolean} Returns `true` if `value` is an array, else `false`. + * @example + * + * _.isArray([1, 2, 3]); + * // => true + * + * _.isArray(document.body.children); + * // => false + * + * _.isArray('abc'); + * // => false + * + * _.isArray(_.noop); + * // => false + */ +var isArray = Array.isArray; + +/** + * Checks if `value` is array-like. A value is considered array-like if it's + * not a function and has a `value.length` that's an integer greater than or + * equal to `0` and less than or equal to `Number.MAX_SAFE_INTEGER`. + * + * @static + * @memberOf _ + * @since 4.0.0 + * @category Lang + * @param {*} value The value to check. + * @returns {boolean} Returns `true` if `value` is array-like, else `false`. + * @example + * + * _.isArrayLike([1, 2, 3]); + * // => true + * + * _.isArrayLike(document.body.children); + * // => true + * + * _.isArrayLike('abc'); + * // => true + * + * _.isArrayLike(_.noop); + * // => false + */ +function isArrayLike(value) { + return value != null && isLength(value.length) && !isFunction(value); +} + +/** + * This method is like `_.isArrayLike` except that it also checks if `value` + * is an object. + * + * @static + * @memberOf _ + * @since 4.0.0 + * @category Lang + * @param {*} value The value to check. + * @returns {boolean} Returns `true` if `value` is an array-like object, + * else `false`. + * @example + * + * _.isArrayLikeObject([1, 2, 3]); + * // => true + * + * _.isArrayLikeObject(document.body.children); + * // => true + * + * _.isArrayLikeObject('abc'); + * // => false + * + * _.isArrayLikeObject(_.noop); + * // => false + */ +function isArrayLikeObject(value) { + return isObjectLike(value) && isArrayLike(value); +} + +/** + * Checks if `value` is classified as a `Function` object. + * + * @static + * @memberOf _ + * @since 0.1.0 + * @category Lang + * @param {*} value The value to check. + * @returns {boolean} Returns `true` if `value` is a function, else `false`. + * @example + * + * _.isFunction(_); + * // => true + * + * _.isFunction(/abc/); + * // => false + */ +function isFunction(value) { + // The use of `Object#toString` avoids issues with the `typeof` operator + // in Safari 8-9 which returns 'object' for typed array and other constructors. + var tag = isObject(value) ? objectToString.call(value) : ''; + return tag == funcTag || tag == genTag; +} + +/** + * Checks if `value` is a valid array-like length. + * + * **Note:** This method is loosely based on + * [`ToLength`](http://ecma-international.org/ecma-262/7.0/#sec-tolength). + * + * @static + * @memberOf _ + * @since 4.0.0 + * @category Lang + * @param {*} value The value to check. + * @returns {boolean} Returns `true` if `value` is a valid length, else `false`. + * @example + * + * _.isLength(3); + * // => true + * + * _.isLength(Number.MIN_VALUE); + * // => false + * + * _.isLength(Infinity); + * // => false + * + * _.isLength('3'); + * // => false + */ +function isLength(value) { + return typeof value == 'number' && + value > -1 && value % 1 == 0 && value <= MAX_SAFE_INTEGER; +} + +/** + * Checks if `value` is the + * [language type](http://www.ecma-international.org/ecma-262/7.0/#sec-ecmascript-language-types) + * of `Object`. (e.g. arrays, functions, objects, regexes, `new Number(0)`, and `new String('')`) + * + * @static + * @memberOf _ + * @since 0.1.0 + * @category Lang + * @param {*} value The value to check. + * @returns {boolean} Returns `true` if `value` is an object, else `false`. + * @example + * + * _.isObject({}); + * // => true + * + * _.isObject([1, 2, 3]); + * // => true + * + * _.isObject(_.noop); + * // => true + * + * _.isObject(null); + * // => false + */ +function isObject(value) { + var type = typeof value; + return !!value && (type == 'object' || type == 'function'); +} + +/** + * Checks if `value` is object-like. A value is object-like if it's not `null` + * and has a `typeof` result of "object". + * + * @static + * @memberOf _ + * @since 4.0.0 + * @category Lang + * @param {*} value The value to check. + * @returns {boolean} Returns `true` if `value` is object-like, else `false`. + * @example + * + * _.isObjectLike({}); + * // => true + * + * _.isObjectLike([1, 2, 3]); + * // => true + * + * _.isObjectLike(_.noop); + * // => false + * + * _.isObjectLike(null); + * // => false + */ +function isObjectLike(value) { + return !!value && typeof value == 'object'; +} + +/** + * Checks if `value` is classified as a `Symbol` primitive or object. + * + * @static + * @memberOf _ + * @since 4.0.0 + * @category Lang + * @param {*} value The value to check. + * @returns {boolean} Returns `true` if `value` is a symbol, else `false`. + * @example + * + * _.isSymbol(Symbol.iterator); + * // => true + * + * _.isSymbol('abc'); + * // => false + */ +function isSymbol(value) { + return typeof value == 'symbol' || + (isObjectLike(value) && objectToString.call(value) == symbolTag); +} + +/** + * Checks if `value` is classified as a typed array. + * + * @static + * @memberOf _ + * @since 3.0.0 + * @category Lang + * @param {*} value The value to check. + * @returns {boolean} Returns `true` if `value` is a typed array, else `false`. + * @example + * + * _.isTypedArray(new Uint8Array); + * // => true + * + * _.isTypedArray([]); + * // => false + */ +var isTypedArray = nodeIsTypedArray ? baseUnary(nodeIsTypedArray) : baseIsTypedArray; + +/** + * Converts `value` to a string. An empty string is returned for `null` + * and `undefined` values. The sign of `-0` is preserved. + * + * @static + * @memberOf _ + * @since 4.0.0 + * @category Lang + * @param {*} value The value to process. + * @returns {string} Returns the string. + * @example + * + * _.toString(null); + * // => '' + * + * _.toString(-0); + * // => '-0' + * + * _.toString([1, 2, 3]); + * // => '1,2,3' + */ +function toString(value) { + return value == null ? '' : baseToString(value); +} + +/** + * Gets the value at `path` of `object`. If the resolved value is + * `undefined`, the `defaultValue` is returned in its place. + * + * @static + * @memberOf _ + * @since 3.7.0 + * @category Object + * @param {Object} object The object to query. + * @param {Array|string} path The path of the property to get. + * @param {*} [defaultValue] The value returned for `undefined` resolved values. + * @returns {*} Returns the resolved value. + * @example + * + * var object = { 'a': [{ 'b': { 'c': 3 } }] }; + * + * _.get(object, 'a[0].b.c'); + * // => 3 + * + * _.get(object, ['a', '0', 'b', 'c']); + * // => 3 + * + * _.get(object, 'a.b.c', 'default'); + * // => 'default' + */ +function get(object, path, defaultValue) { + var result = object == null ? undefined : baseGet(object, path); + return result === undefined ? defaultValue : result; +} + +/** + * Checks if `path` is a direct or inherited property of `object`. + * + * @static + * @memberOf _ + * @since 4.0.0 + * @category Object + * @param {Object} object The object to query. + * @param {Array|string} path The path to check. + * @returns {boolean} Returns `true` if `path` exists, else `false`. + * @example + * + * var object = _.create({ 'a': _.create({ 'b': 2 }) }); + * + * _.hasIn(object, 'a'); + * // => true + * + * _.hasIn(object, 'a.b'); + * // => true + * + * _.hasIn(object, ['a', 'b']); + * // => true + * + * _.hasIn(object, 'b'); + * // => false + */ +function hasIn(object, path) { + return object != null && hasPath(object, path, baseHasIn); +} + +/** + * Creates an array of the own enumerable property names of `object`. + * + * **Note:** Non-object values are coerced to objects. See the + * [ES spec](http://ecma-international.org/ecma-262/7.0/#sec-object.keys) + * for more details. + * + * @static + * @since 0.1.0 + * @memberOf _ + * @category Object + * @param {Object} object The object to query. + * @returns {Array} Returns the array of property names. + * @example + * + * function Foo() { + * this.a = 1; + * this.b = 2; + * } + * + * Foo.prototype.c = 3; + * + * _.keys(new Foo); + * // => ['a', 'b'] (iteration order is not guaranteed) + * + * _.keys('hi'); + * // => ['0', '1'] + */ +function keys(object) { + return isArrayLike(object) ? arrayLikeKeys(object) : baseKeys(object); +} + +/** + * This method returns the first argument it receives. + * + * @static + * @since 0.1.0 + * @memberOf _ + * @category Util + * @param {*} value Any value. + * @returns {*} Returns `value`. + * @example + * + * var object = { 'a': 1 }; + * + * console.log(_.identity(object) === object); + * // => true + */ +function identity(value) { + return value; +} + +/** + * Creates a function that returns the value at `path` of a given object. + * + * @static + * @memberOf _ + * @since 2.4.0 + * @category Util + * @param {Array|string} path The path of the property to get. + * @returns {Function} Returns the new accessor function. + * @example + * + * var objects = [ + * { 'a': { 'b': 2 } }, + * { 'a': { 'b': 1 } } + * ]; + * + * _.map(objects, _.property('a.b')); + * // => [2, 1] + * + * _.map(_.sortBy(objects, _.property(['a', 'b'])), 'a.b'); + * // => [1, 2] + */ +function property(path) { + return isKey(path) ? baseProperty(toKey(path)) : basePropertyDeep(path); +} + +module.exports = sortBy; +}); + +var parsers$2 = createCommonjsModule(function (module, exports) { +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); + + + + +// The exponent value(s) at which toString returns exponential notation. +bignumber.BigNumber.config({ EXPONENTIAL_AT: [-5, 15] }); +class BaseNumberParser { + constructor(config) { + this.config = config; + let singleIntFrac = `${this.config.wordSeparatorToken}| -|${this.getKeyRegex(this.config.cardinalNumberMap)}|${this.getKeyRegex(this.config.ordinalNumberMap)}`; + this.textNumberRegex = recognizersText.RegExpUtility.getSafeRegExp(String.raw `(?=\b)(${singleIntFrac})(?=\b)`, "gis"); + this.arabicNumberRegex = recognizersText.RegExpUtility.getSafeRegExp(String.raw `\d+`, "is"); + this.roundNumberSet = new Set(); + this.config.roundNumberMap.forEach((value, key) => this.roundNumberSet.add(key)); + } + parse(extResult) { + // check if the parser is configured to support specific types + if (this.supportedTypes && !this.supportedTypes.find(t => t === extResult.type)) { + return null; + } + let ret = null; + let extra = extResult.data; + if (!extra) { + if (this.arabicNumberRegex.test(extResult.text)) { + extra = "Num"; + } + else { + extra = this.config.langMarker; + } + } + // Resolve symbol prefix + let isNegative = false; + let matchNegative = extResult.text.match(this.config.negativeNumberSignRegex); + if (matchNegative) { + isNegative = true; + extResult.text = extResult.text.substr(matchNegative[1].length); + } + if (extra.includes("Num")) { + ret = this.digitNumberParse(extResult); + } + else if (extra.includes(`Frac${this.config.langMarker}`)) // Frac is a special number, parse via another method + { + ret = this.fracLikeNumberParse(extResult); + } + else if (extra.includes(this.config.langMarker)) { + ret = this.textNumberParse(extResult); + } + else if (extra.includes("Pow")) { + ret = this.powerNumberParse(extResult); + } + if (ret && ret.value !== null) { + if (isNegative) { + // Recover to the original extracted Text + ret.text = matchNegative[1] + extResult.text; + // Check if ret.value is a BigNumber + if (typeof ret.value === "number") { + ret.value = -ret.value; + } + else { + ret.value.s = -1; + } + } + ret.resolutionStr = this.config.cultureInfo + ? this.config.cultureInfo.format(ret.value) + : ret.value.toString(); + } + return ret; + } + getKeyRegex(regexMap) { + let keys = new Array(); + regexMap.forEach((value, key) => keys.push(key)); + let sortKeys = lodash_sortby(keys, key => key.length).reverse(); + return sortKeys.join('|'); + } + digitNumberParse(extResult) { + let result = { + start: extResult.start, + length: extResult.length, + text: extResult.text, + type: extResult.type + }; + // [1] 24 + // [2] 12 32/33 + // [3] 1,000,000 + // [4] 234.567 + // [5] 44/55 + // [6] 2 hundred + // dot occured. + let power = 1; + let tmpIndex = -1; + let startIndex = 0; + let handle = extResult.text.toLowerCase(); + let matches = recognizersText.RegExpUtility.getMatches(this.config.digitalNumberRegex, handle); + if (matches) { + matches.forEach(match => { + // HACK: Matching regex may be buggy, may include a digit before the unit + match.value = match.value.replace(/\d/g, ''); + match.length = match.value.length; + let rep = this.config.roundNumberMap.get(match.value); + // \\s+ for filter the spaces. + power *= rep; + // tslint:disable-next-line:no-conditional-assignment + while ((tmpIndex = handle.indexOf(match.value, startIndex)) >= 0) { + let front = lodash_trimend(handle.substring(0, tmpIndex)); + startIndex = front.length; + handle = front + handle.substring(tmpIndex + match.length); + } + }); + } + // scale used in the calculate of double + result.value = this.getDigitalValue(handle, power); + return result; + } + isDigit(c) { + return c >= '0' && c <= '9'; + } + fracLikeNumberParse(extResult) { + let result = { + start: extResult.start, + length: extResult.length, + text: extResult.text, + type: extResult.type + }; + let resultText = extResult.text.toLowerCase(); + if (resultText.includes(this.config.fractionMarkerToken)) { + let overIndex = resultText.indexOf(this.config.fractionMarkerToken); + let smallPart = resultText.substring(0, overIndex).trim(); + let bigPart = resultText.substring(overIndex + this.config.fractionMarkerToken.length, resultText.length).trim(); + let smallValue = this.isDigit(smallPart[0]) + ? this.getDigitalValue(smallPart, 1) + : this.getIntValue(this.getMatches(smallPart)); + let bigValue = this.isDigit(bigPart[0]) + ? this.getDigitalValue(bigPart, 1) + : this.getIntValue(this.getMatches(bigPart)); + result.value = smallValue / bigValue; + } + else { + let words = resultText.split(" ").filter(s => s && s.length); + let fracWords = Array.from(this.config.normalizeTokenSet(words, result)); + // Split fraction with integer + let splitIndex = fracWords.length - 1; + let currentValue = this.config.resolveCompositeNumber(fracWords[splitIndex]); + let roundValue = 1; + for (splitIndex = fracWords.length - 2; splitIndex >= 0; splitIndex--) { + if (this.config.writtenFractionSeparatorTexts.indexOf(fracWords[splitIndex]) > -1 || + this.config.writtenIntegerSeparatorTexts.indexOf(fracWords[splitIndex]) > -1) { + continue; + } + let previousValue = currentValue; + currentValue = this.config.resolveCompositeNumber(fracWords[splitIndex]); + let smHundreds = 100; + // previous : hundred + // current : one + if ((previousValue >= smHundreds && previousValue > currentValue) + || (previousValue < smHundreds && this.isComposable(currentValue, previousValue))) { + if (previousValue < smHundreds && currentValue >= roundValue) { + roundValue = currentValue; + } + else if (previousValue < smHundreds && currentValue < roundValue) { + splitIndex++; + break; + } + // current is the first word + if (splitIndex === 0) { + // scan, skip the first word + splitIndex = 1; + while (splitIndex <= fracWords.length - 2) { + // e.g. one hundred thousand + // frac[i+1] % 100 && frac[i] % 100 = 0 + if (this.config.resolveCompositeNumber(fracWords[splitIndex]) >= smHundreds + && !(this.config.writtenFractionSeparatorTexts.indexOf(fracWords[splitIndex + 1]) > -1) + && this.config.resolveCompositeNumber(fracWords[splitIndex + 1]) < smHundreds) { + splitIndex++; + break; + } + splitIndex++; + } + break; + } + continue; + } + splitIndex++; + break; + } + let fracPart = new Array(); + for (let i = splitIndex; i < fracWords.length; i++) { + if (fracWords[i].indexOf("-") > -1) { + let split = fracWords[i].split('-'); + fracPart.push(split[0]); + fracPart.push("-"); + fracPart.push(split[1]); + } + else { + fracPart.push(fracWords[i]); + } + } + fracWords.splice(splitIndex, fracWords.length - splitIndex); + // denomi = denominator + let denomiValue = this.getIntValue(fracPart); + // Split mixed number with fraction + let numerValue = 0; + let intValue = 0; + let mixedIndex = fracWords.length; + for (let i = fracWords.length - 1; i >= 0; i--) { + if (i < fracWords.length - 1 && this.config.writtenFractionSeparatorTexts.indexOf(fracWords[i]) > -1) { + let numerStr = fracWords.slice(i + 1, fracWords.length).join(" "); + numerValue = this.getIntValue(this.getMatches(numerStr)); + mixedIndex = i + 1; + break; + } + } + let intStr = fracWords.slice(0, mixedIndex).join(" "); + intValue = this.getIntValue(this.getMatches(intStr)); + // Find mixed number + if (mixedIndex !== fracWords.length && numerValue < denomiValue) { + // intValue + numerValue / denomiValue + result.value = new bignumber.BigNumber(intValue).plus(new bignumber.BigNumber(numerValue).dividedBy(denomiValue)); + } + else { + // (intValue + numerValue) / denomiValue + result.value = new bignumber.BigNumber(intValue + numerValue).dividedBy(denomiValue); + } + } + return result; + } + textNumberParse(extResult) { + let result = { + start: extResult.start, + length: extResult.length, + text: extResult.text, + type: extResult.type + }; + let handle = extResult.text.toLowerCase(); + handle = handle.replace(this.config.halfADozenRegex, this.config.halfADozenText); + let numGroup = this.splitMulti(handle, Array.from(this.config.writtenDecimalSeparatorTexts)).filter(s => s && s.length > 0); + let intPart = numGroup[0]; + let matchStrs = intPart + ? intPart.match(this.textNumberRegex).map(s => s.toLowerCase()) + : new Array(); + // Get the value recursively + let intPartRet = this.getIntValue(matchStrs); + let pointPartRet = 0; + if (numGroup.length === 2) { + let pointPart = numGroup[1]; + let matchStrs = pointPart.match(this.textNumberRegex).map(s => s.toLowerCase()); + pointPartRet += this.getPointValue(matchStrs); + } + result.value = intPartRet + pointPartRet; + return result; + } + powerNumberParse(extResult) { + let result = { + start: extResult.start, + length: extResult.length, + text: extResult.text, + type: extResult.type + }; + let handle = extResult.text.toUpperCase(); + let isE = !extResult.text.includes("^"); + // [1] 1e10 + // [2] 1.1^-23 + let calStack = new Array(); + let scale = new bignumber.BigNumber(10); + let dot = false; + let isNegative = false; + let tmp = new bignumber.BigNumber(0); + for (let i = 0; i < handle.length; i++) { + let ch = handle[i]; + if (ch === '^' || ch === 'E') { + if (isNegative) { + calStack.push(tmp.negated()); + } + else { + calStack.push(tmp); + } + tmp = new bignumber.BigNumber(0); + scale = new bignumber.BigNumber(10); + dot = false; + isNegative = false; + } + else if (ch.charCodeAt(0) - 48 >= 0 && ch.charCodeAt(0) - 48 <= 9) { + if (dot) { + // tmp = tmp + scale * (ch.charCodeAt(0) - 48); + // scale *= 0.1; + tmp = tmp.plus(scale.times(ch.charCodeAt(0) - 48)); + scale = scale.times(0.1); + } + else { + // tmp = tmp * scale + (ch.charCodeAt(0) - 48); + tmp = tmp.times(scale).plus(ch.charCodeAt(0) - 48); + } + } + else if (ch === this.config.decimalSeparatorChar) { + dot = true; + scale = new bignumber.BigNumber(0.1); + } + else if (ch === '-') { + isNegative = !isNegative; + } + else if (ch === '+') { + continue; + } + if (i === handle.length - 1) { + if (isNegative) { + calStack.push(tmp.negated()); + } + else { + calStack.push(tmp); + } + } + } + let ret = 0; + if (isE) { + // ret = calStack.shift() * Math.pow(10, calStack.shift()); + ret = calStack.shift().times(Math.pow(10, calStack.shift().toNumber())).toNumber(); + } + else { + ret = Math.pow(calStack.shift().toNumber(), calStack.shift().toNumber()); + } + result.value = ret; + result.resolutionStr = ret.toString(); // @TODO Possible Culture bug. + return result; + } + splitMulti(str, tokens) { + let tempChar = tokens[0]; // We can use the first token as a temporary join character + for (let i = 0; i < tokens.length; i++) { + str = str.split(tokens[i]).join(tempChar); + } + return str.split(tempChar); + } + getMatches(input) { + let matches = input.match(this.textNumberRegex); + return (matches || []).map(match => { + return match.toLowerCase(); + }); + } + // Test if big and combine with small. + // e.g. "hundred" can combine with "thirty" but "twenty" can't combine with "thirty". + isComposable(big, small) { + let baseNumber = small > 10 ? 100 : 10; + if (big % baseNumber === 0 && big / baseNumber >= 1) { + return true; + } + return false; + } + getIntValue(matchStrs) { + let isEnd = new Array(matchStrs.length); + for (let i = 0; i < isEnd.length; i++) { + isEnd[i] = false; + } + let tempValue = 0; + let endFlag = 1; + // Scan from end to start, find the end word + for (let i = matchStrs.length - 1; i >= 0; i--) { + if (this.roundNumberSet.has(matchStrs[i])) { + // if false,then continue + // You will meet hundred first, then thousand. + if (endFlag > this.config.roundNumberMap.get(matchStrs[i])) { + continue; + } + isEnd[i] = true; + endFlag = this.config.roundNumberMap.get(matchStrs[i]); + } + } + if (endFlag === 1) { + let tempStack = new Array(); + let oldSym = ""; + matchStrs.forEach(matchStr => { + let isCardinal = this.config.cardinalNumberMap.has(matchStr); + let isOrdinal = this.config.ordinalNumberMap.has(matchStr); + if (isCardinal || isOrdinal) { + let matchValue = isCardinal + ? this.config.cardinalNumberMap.get(matchStr) + : this.config.ordinalNumberMap.get(matchStr); + // This is just for ordinal now. Not for fraction ever. + if (isOrdinal) { + let fracPart = this.config.ordinalNumberMap.get(matchStr); + if (tempStack.length > 0) { + let intPart = tempStack.pop(); + // if intPart >= fracPart, it means it is an ordinal number + // it begins with an integer, ends with an ordinal + // e.g. ninety-ninth + if (intPart >= fracPart) { + tempStack.push(intPart + fracPart); + } + // another case of the type is ordinal + // e.g. three hundredth + else { + while (tempStack.length > 0) { + intPart = intPart + tempStack.pop(); + } + tempStack.push(intPart * fracPart); + } + } + else { + tempStack.push(fracPart); + } + } + else if (this.config.cardinalNumberMap.has(matchStr)) { + if (oldSym === "-") { + let sum = tempStack.pop() + matchValue; + tempStack.push(sum); + } + else if (oldSym === this.config.writtenIntegerSeparatorTexts[0] || tempStack.length < 2) { + tempStack.push(matchValue); + } + else if (tempStack.length >= 2) { + let sum = tempStack.pop() + matchValue; + sum = tempStack.pop() + sum; + tempStack.push(sum); + } + } + } + else { + let complexValue = this.config.resolveCompositeNumber(matchStr); + if (complexValue !== 0) { + tempStack.push(complexValue); + } + } + oldSym = matchStr; + }); + tempStack.forEach(stackValue => { + tempValue += stackValue; + }); + } + else { + let lastIndex = 0; + let mulValue = 1; + let partValue = 1; + for (let i = 0; i < isEnd.length; i++) { + if (isEnd[i]) { + mulValue = this.config.roundNumberMap.get(matchStrs[i]); + partValue = 1; + if (i !== 0) { + partValue = this.getIntValue(matchStrs.slice(lastIndex, i)); + } + tempValue += mulValue * partValue; + lastIndex = i + 1; + } + } + // Calculate the part like "thirty-one" + mulValue = 1; + if (lastIndex !== isEnd.length) { + partValue = this.getIntValue(matchStrs.slice(lastIndex, isEnd.length)); + tempValue += mulValue * partValue; + } + } + return tempValue; + } + getPointValue(matchStrs) { + let ret = 0; + let firstMatch = matchStrs[0]; + if (this.config.cardinalNumberMap.has(firstMatch) && this.config.cardinalNumberMap.get(firstMatch) >= 10) { + let prefix = "0."; + let tempInt = this.getIntValue(matchStrs); + let all = prefix + tempInt; + ret = parseFloat(all); + } + else { + let scale = new bignumber.BigNumber(0.1); + for (let i = 0; i < matchStrs.length; i++) { + ret += scale.times(this.config.cardinalNumberMap.get(matchStrs[i])).toNumber(); + // scale *= 0.1; + scale = scale.times(0.1); + } + } + return ret; + } + skipNonDecimalSeparator(ch, distance, culture) { + var decimalLength = 3; + // Special cases for multi-language countries where decimal separators can be used interchangeably. Mostly informally. + // Ex: South Africa, Namibia; Puerto Rico in ES; or in Canada for EN and FR. + // "me pidio $5.00 prestados" and "me pidio $5,00 prestados" -> currency $5 + var cultureRegex = recognizersText.RegExpUtility.getSafeRegExp(String.raw `^(en|es|fr)(-)?\b`, "is"); + return (ch == this.config.nonDecimalSeparatorChar && !(distance <= decimalLength && (cultureRegex.exec(culture.code) !== null))); + } + getDigitalValue(digitsStr, power) { + let tmp = new bignumber.BigNumber(0); + let scale = new bignumber.BigNumber(10); + let decimalSeparator = false; + var strLength = digitsStr.length; + let isNegative = false; + let isFrac = digitsStr.includes('/'); + let calStack = new Array(); + for (let i = 0; i < digitsStr.length; i++) { + let ch = digitsStr[i]; + var skippableNonDecimal = this.skipNonDecimalSeparator(ch, strLength - i, this.config.cultureInfo); + if (!isFrac && (ch === ' ' || skippableNonDecimal)) { + continue; + } + if (ch === ' ' || ch === '/') { + calStack.push(tmp); + tmp = new bignumber.BigNumber(0); + } + else if (ch >= '0' && ch <= '9') { + if (decimalSeparator) { + // tmp = tmp + scale * (ch.charCodeAt(0) - 48); + // scale *= 0.1; + tmp = tmp.plus(scale.times(ch.charCodeAt(0) - 48)); + scale = scale.times(0.1); + } + else { + // tmp = tmp * scale + (ch.charCodeAt(0) - 48); + tmp = tmp.times(scale).plus(ch.charCodeAt(0) - 48); + } + } + else if (ch === this.config.decimalSeparatorChar || (!skippableNonDecimal && ch == this.config.nonDecimalSeparatorChar)) { + decimalSeparator = true; + scale = new bignumber.BigNumber(0.1); + } + else if (ch === '-') { + isNegative = true; + } + } + calStack.push(tmp); + // if the number is a fraction. + let calResult = new bignumber.BigNumber(0); + if (isFrac) { + let deno = calStack.pop(); + let mole = calStack.pop(); + // calResult += mole / deno; + calResult = calResult.plus(mole.dividedBy(deno)); + } + while (calStack.length > 0) { + calResult = calResult.plus(calStack.pop()); + } + // calResult *= power; + calResult = calResult.times(power); + if (isNegative) { + return calResult.negated().toNumber(); + } + return calResult.toNumber(); + } +} +exports.BaseNumberParser = BaseNumberParser; +class BasePercentageParser extends BaseNumberParser { + parse(extResult) { + let originText = extResult.text; + // do replace text & data from extended info + if (extResult.data && extResult.data instanceof Array) { + extResult.text = extResult.data[0]; + extResult.data = extResult.data[1].data; + } + let ret = super.parse(extResult); + if (ret.resolutionStr && ret.resolutionStr.length > 0) { + if (!ret.resolutionStr.trim().endsWith("%")) { + ret.resolutionStr = ret.resolutionStr.trim() + "%"; + } + } + ret.data = extResult.text; + ret.text = originText; + return ret; + } +} +exports.BasePercentageParser = BasePercentageParser; + +}); + +unwrapExports(parsers$2); + +var cjkParsers = createCommonjsModule(function (module, exports) { +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); + + + +const recognizers_text_2 = recognizersText; +class BaseCJKNumberParser extends parsers$2.BaseNumberParser { + constructor(config) { + super(config); + this.config = config; + } + toString(value) { + return this.config.cultureInfo + ? this.config.cultureInfo.format(value) + : value.toString(); + } + parse(extResult) { + let extra = ''; + let result; + extra = extResult.data; + let getExtResult = { + start: extResult.start, + length: extResult.length, + data: extResult.data, + text: this.replaceTraditionalWithSimplified(extResult.text), + type: extResult.type + }; + if (!extra) { + return result; + } + if (extra.includes("Per")) { + result = this.perParseCJK(getExtResult); + } + else if (extra.includes("Num")) { + getExtResult.text = this.replaceFullWithHalf(getExtResult.text); + result = this.digitNumberParse(getExtResult); + if (this.config.negativeNumberSignRegex.test(getExtResult.text) && result.value > 0) { + result.value = -result.value; + } + result.resolutionStr = this.toString(result.value); + } + else if (extra.includes("Pow")) { + getExtResult.text = this.replaceFullWithHalf(getExtResult.text); + result = this.powerNumberParse(getExtResult); + result.resolutionStr = this.toString(result.value); + } + else if (extra.includes("Frac")) { + result = this.fracParseCJK(getExtResult); + } + else if (extra.includes("Dou")) { + result = this.douParseCJK(getExtResult); + } + else if (extra.includes("Integer")) { + result = this.intParseCJK(getExtResult); + } + else if (extra.includes("Ordinal")) { + result = this.ordParseCJK(getExtResult); + } + if (result) { + result.text = extResult.text; + } + return result; + } + replaceTraditionalWithSimplified(value) { + if (recognizers_text_2.StringUtility.isNullOrWhitespace(value)) { + return value; + } + if (this.config.tratoSimMap == null) { + return value; + } + let result = ''; + for (let index = 0; index < value.length; index++) { + result = result.concat(this.config.tratoSimMap.get(value.charAt(index)) || value.charAt(index)); + } + return result; + } + replaceFullWithHalf(value) { + if (recognizers_text_2.StringUtility.isNullOrWhitespace(value)) { + return value; + } + let result = ''; + for (let index = 0; index < value.length; index++) { + result = result.concat(this.config.fullToHalfMap.get(value.charAt(index)) || value.charAt(index)); + } + return result; + } + replaceUnit(value) { + if (recognizers_text_2.StringUtility.isNullOrEmpty(value)) + return value; + let result = value; + this.config.unitMap.forEach((value, key) => { + result = result.replace(new RegExp(key, 'g'), value); + }); + return result; + } + perParseCJK(extResult) { + let result = new recognizersText.ParseResult(extResult); + let resultText = extResult.text; + let power = 1; + if (extResult.data.includes("Spe")) { + resultText = this.replaceFullWithHalf(resultText); + resultText = this.replaceUnit(resultText); + if (resultText === "半額" || resultText === "半折" || resultText === "半折") { + result.value = 50; + } + else if (resultText === "10成" || resultText === "10割" || resultText === "十割") { + result.value = 100; + } + else { + let matches = recognizers_text_2.RegExpUtility.getMatches(this.config.speGetNumberRegex, resultText); + let intNumber; + if (matches.length === 2) { + let intNumberChar = matches[0].value.charAt(0); + if (intNumberChar === '対' || intNumberChar === "对") { + intNumber = 5; + } + else if (intNumberChar === "十" || intNumberChar === "拾") { + intNumber = 10; + } + else { + intNumber = this.config.zeroToNineMap.get(intNumberChar); + } + let pointNumberChar = matches[1].value.charAt(0); + let pointNumber; + if (pointNumberChar === "半") { + pointNumber = 0.5; + } + else { + pointNumber = this.config.zeroToNineMap.get(pointNumberChar) * 0.1; + } + result.value = (intNumber + pointNumber) * 10; + } + else if (matches.length === 5) { + // Deal the Japanese percentage case like "xxx割xxx分xxx厘", get the integer value and convert into result. + let intNumberChar = matches[0].value.charAt(0); + let pointNumberChar = matches[1].value.charAt(0); + let dotNumberChar = matches[3].value.charAt(0); + let pointNumber = this.config.zeroToNineMap.get(pointNumberChar) * 0.1; + let dotNumber = this.config.zeroToNineMap.get(dotNumberChar) * 0.01; + intNumber = this.config.zeroToNineMap.get(intNumberChar); + result.value = (intNumber + pointNumber + dotNumber) * 10; + } + else { + let intNumberChar = matches[0].value.charAt(0); + if (intNumberChar === '対' || intNumberChar === "对") { + intNumber = 5; + } + else if (intNumberChar === "十" || intNumberChar === "拾") { + intNumber = 10; + } + else { + intNumber = this.config.zeroToNineMap.get(intNumberChar); + } + result.value = intNumber * 10; + } + } + } + else if (extResult.data.includes("Num")) { + let doubleMatch = recognizers_text_2.RegExpUtility.getMatches(this.config.percentageRegex, resultText).pop(); + let doubleText = doubleMatch.value; + if (doubleText.includes("k") || doubleText.includes("K") || doubleText.includes("k") || doubleText.includes("K")) { + power = 1000; + } + if (doubleText.includes("M") || doubleText.includes("M")) { + power = 1000000; + } + if (doubleText.includes("G") || doubleText.includes("G")) { + power = 1000000000; + } + if (doubleText.includes("T") || doubleText.includes("T")) { + power = 1000000000000; + } + result.value = this.getDigitValueCJK(resultText, power); + } + else { + let doubleMatch = recognizers_text_2.RegExpUtility.getMatches(this.config.percentageRegex, resultText).pop(); + let doubleText = this.replaceUnit(doubleMatch.value); + let splitResult = recognizers_text_2.RegExpUtility.split(this.config.pointRegex, doubleText); + if (splitResult[0] === "") { + splitResult[0] = "零"; + } + let doubleValue = this.getIntValueCJK(splitResult[0]); + if (splitResult.length === 2) { + if (recognizers_text_2.RegExpUtility.isMatch(this.config.negativeNumberSignRegex, splitResult[0])) { + doubleValue -= this.getPointValueCJK(splitResult[1]); + } + else { + doubleValue += this.getPointValueCJK(splitResult[1]); + } + } + result.value = doubleValue; + } + result.resolutionStr = this.toString(result.value) + "%"; + return result; + } + fracParseCJK(extResult) { + let result = new recognizersText.ParseResult(extResult); + let resultText = extResult.text; + let splitResult = recognizers_text_2.RegExpUtility.split(this.config.fracSplitRegex, resultText); + let intPart = ""; + let demoPart = ""; + let numPart = ""; + if (splitResult.length === 3) { + intPart = splitResult[0] || ""; + demoPart = splitResult[1] || ""; + numPart = splitResult[2] || ""; + } + else { + intPart = "零"; + demoPart = splitResult[0] || ""; + numPart = splitResult[1] || ""; + } + let intValue = this.isDigitCJK(intPart) + ? this.getDigitValueCJK(intPart, 1.0) + : this.getIntValueCJK(intPart); + let numValue = this.isDigitCJK(numPart) + ? this.getDigitValueCJK(numPart, 1.0) + : this.getIntValueCJK(numPart); + let demoValue = this.isDigitCJK(demoPart) + ? this.getDigitValueCJK(demoPart, 1.0) + : this.getIntValueCJK(demoPart); + if (recognizers_text_2.RegExpUtility.isMatch(this.config.negativeNumberSignRegex, intPart)) { + result.value = intValue - numValue / demoValue; + } + else { + result.value = intValue + numValue / demoValue; + } + result.resolutionStr = this.toString(result.value); + return result; + } + douParseCJK(extResult) { + let result = new recognizersText.ParseResult(extResult); + let resultText = extResult.text; + if (recognizers_text_2.RegExpUtility.isMatch(this.config.doubleAndRoundRegex, resultText)) { + resultText = this.replaceUnit(resultText); + let power = this.config.roundNumberMapChar.get(resultText.charAt(resultText.length - 1)); + result.value = this.getDigitValueCJK(resultText.substr(0, resultText.length - 1), power); + } + else { + resultText = this.replaceUnit(resultText); + let splitResult = recognizers_text_2.RegExpUtility.split(this.config.pointRegex, resultText); + if (splitResult[0] === "") { + splitResult[0] = "零"; + } + if (recognizers_text_2.RegExpUtility.isMatch(this.config.negativeNumberSignRegex, splitResult[0])) { + result.value = this.getIntValueCJK(splitResult[0]) - this.getPointValueCJK(splitResult[1]); + } + else { + result.value = this.getIntValueCJK(splitResult[0]) + this.getPointValueCJK(splitResult[1]); + } + } + result.resolutionStr = this.toString(result.value); + return result; + } + intParseCJK(extResult) { + let result = new recognizersText.ParseResult(extResult); + result.value = this.getIntValueCJK(extResult.text); + result.resolutionStr = this.toString(result.value); + return result; + } + ordParseCJK(extResult) { + let result = new recognizersText.ParseResult(extResult); + let resultText = extResult.text.substr(1); + if (recognizers_text_2.RegExpUtility.isMatch(this.config.digitNumRegex, resultText) && !recognizers_text_2.RegExpUtility.isMatch(this.config.roundNumberIntegerRegex, resultText)) { + result.value = this.getDigitValueCJK(resultText, 1); + } + else { + result.value = this.getIntValueCJK(resultText); + } + result.resolutionStr = this.toString(result.value); + return result; + } + getDigitValueCJK(value, power) { + let isNegative = false; + let resultStr = value; + if (recognizers_text_2.RegExpUtility.isMatch(this.config.negativeNumberSignRegex, resultStr)) { + isNegative = true; + resultStr = resultStr.substr(1); + } + resultStr = this.replaceFullWithHalf(resultStr); + let result = this.getDigitalValue(resultStr, power); + if (isNegative) { + result = -result; + } + return result; + } + getIntValueCJK(value) { + let resultStr = value; + let isDozen = false; + let isPair = false; + if (recognizers_text_2.RegExpUtility.isMatch(this.config.dozenRegex, resultStr)) { + isDozen = true; + if (this.config.cultureInfo.code.toLowerCase() === culture$2.Culture.Chinese) { + resultStr = resultStr.substr(0, resultStr.length - 1); + } + else if (this.config.cultureInfo.code.toLowerCase() === culture$2.Culture.Japanese) { + resultStr = resultStr.substr(0, resultStr.length - 3); + } + } + else if (recognizers_text_2.RegExpUtility.isMatch(this.config.pairRegex, resultStr)) { + isPair = true; + resultStr = resultStr.substr(0, resultStr.length - 1); + } + resultStr = this.replaceUnit(resultStr); + let intValue = 0; + let partValue = 0; + let beforeValue = 0; + let isRoundBefore = false; + let roundBefore = -1; + let roundDefault = 1; + let isNegative = false; + let hasNumber = false; + if (recognizers_text_2.RegExpUtility.isMatch(this.config.negativeNumberSignRegex, resultStr)) { + isNegative = true; + resultStr = resultStr.substr(1); + } + for (let index = 0; index < resultStr.length; index++) { + let currentChar = resultStr.charAt(index); + if (this.config.roundNumberMapChar.has(currentChar)) { + let roundRecent = this.config.roundNumberMapChar.get(currentChar); + if (!hasNumber) { + beforeValue = 1; + } + if (roundBefore !== -1 && roundRecent > roundBefore) { + if (isRoundBefore) { + intValue += partValue * roundRecent; + isRoundBefore = false; + } + else { + partValue += beforeValue * roundDefault; + intValue += partValue * roundRecent; + } + roundBefore = -1; + partValue = 0; + } + else { + isRoundBefore = true; + partValue += beforeValue * roundRecent; + roundBefore = roundRecent; + if ((index === resultStr.length - 1) || this.config.roundDirectList.some(o => o === currentChar)) { + intValue += partValue; + partValue = 0; + } + } + hasNumber = false; + beforeValue = 0; + roundDefault = roundRecent / 10; + } + else if (this.config.zeroToNineMap.has(currentChar)) { + hasNumber = true; + if (index !== resultStr.length - 1) { + if ((currentChar === "零") && !this.config.roundNumberMapChar.has(resultStr.charAt(index + 1))) { + roundDefault = 1; + } + else { + beforeValue = beforeValue * 10 + this.config.zeroToNineMap.get(currentChar); + isRoundBefore = false; + } + } + else { + if (index === resultStr.length - 1 && this.config.cultureInfo.code.toLowerCase() === culture$2.Culture.Japanese) { + roundDefault = 1; + } + partValue += beforeValue * 10; + partValue += this.config.zeroToNineMap.get(currentChar) * roundDefault; + intValue += partValue; + partValue = 0; + } + } + } + if (isNegative) { + intValue = -intValue; + } + if (isDozen) { + intValue = intValue * 12; + } + if (isPair) { + intValue = intValue * 2; + } + return intValue; + } + getPointValueCJK(value) { + let result = 0; + let scale = 0.1; + for (let index = 0; index < value.length; index++) { + result += scale * this.config.zeroToNineMap.get(value.charAt(index)); + scale *= 0.1; + } + return result; + } + isDigitCJK(value) { + return !recognizers_text_2.StringUtility.isNullOrEmpty(value) + && recognizers_text_2.RegExpUtility.isMatch(this.config.digitNumRegex, value); + } +} +exports.BaseCJKNumberParser = BaseCJKNumberParser; + +}); + +unwrapExports(cjkParsers); + +var agnosticNumberParser = createCommonjsModule(function (module, exports) { +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); + + + + +var AgnosticNumberParserType; +(function (AgnosticNumberParserType) { + AgnosticNumberParserType[AgnosticNumberParserType["Cardinal"] = 0] = "Cardinal"; + AgnosticNumberParserType[AgnosticNumberParserType["Double"] = 1] = "Double"; + AgnosticNumberParserType[AgnosticNumberParserType["Fraction"] = 2] = "Fraction"; + AgnosticNumberParserType[AgnosticNumberParserType["Integer"] = 3] = "Integer"; + AgnosticNumberParserType[AgnosticNumberParserType["Number"] = 4] = "Number"; + AgnosticNumberParserType[AgnosticNumberParserType["Ordinal"] = 5] = "Ordinal"; + AgnosticNumberParserType[AgnosticNumberParserType["Percentage"] = 6] = "Percentage"; +})(AgnosticNumberParserType = exports.AgnosticNumberParserType || (exports.AgnosticNumberParserType = {})); +class AgnosticNumberParserFactory { + static getParser(type, languageConfiguration) { + let isChinese = languageConfiguration.cultureInfo.code.toLowerCase() === culture$2.Culture.Chinese; + let isJapanese = languageConfiguration.cultureInfo.code.toLowerCase() === culture$2.Culture.Japanese; + let parser; + if (isChinese) { + parser = new cjkParsers.BaseCJKNumberParser(languageConfiguration); + } + else if (isJapanese) { + parser = new cjkParsers.BaseCJKNumberParser(languageConfiguration); + } + else { + parser = new parsers$2.BaseNumberParser(languageConfiguration); + } + switch (type) { + case AgnosticNumberParserType.Cardinal: + parser.supportedTypes = [constants.Constants.SYS_NUM_CARDINAL, constants.Constants.SYS_NUM_INTEGER, constants.Constants.SYS_NUM_DOUBLE]; + break; + case AgnosticNumberParserType.Double: + parser.supportedTypes = [constants.Constants.SYS_NUM_DOUBLE]; + break; + case AgnosticNumberParserType.Fraction: + parser.supportedTypes = [constants.Constants.SYS_NUM_FRACTION]; + break; + case AgnosticNumberParserType.Integer: + parser.supportedTypes = [constants.Constants.SYS_NUM_INTEGER]; + break; + case AgnosticNumberParserType.Ordinal: + parser.supportedTypes = [constants.Constants.SYS_NUM_ORDINAL]; + break; + case AgnosticNumberParserType.Percentage: + if (!isChinese && !isJapanese) { + parser = new parsers$2.BasePercentageParser(languageConfiguration); + } + break; + } + return parser; + } +} +exports.AgnosticNumberParserFactory = AgnosticNumberParserFactory; + +}); + +unwrapExports(agnosticNumberParser); + +var baseNumbers = createCommonjsModule(function (module, exports) { +"use strict"; +// ------------------------------------------------------------------------------ +// +// This code was generated by a tool. +// Changes to this file may cause incorrect behavior and will be lost if +// the code is regenerated. +// +// ------------------------------------------------------------------------------ +Object.defineProperty(exports, "__esModule", { value: true }); +var BaseNumbers; +(function (BaseNumbers) { + BaseNumbers.NumberReplaceToken = '@builtin.num'; + BaseNumbers.FractionNumberReplaceToken = '@builtin.num.fraction'; + BaseNumbers.IntegerRegexDefinition = (placeholder, thousandsmark) => { return `(((? { return `(((? +// This code was generated by a tool. +// Changes to this file may cause incorrect behavior and will be lost if +// the code is regenerated. +// +// ------------------------------------------------------------------------------ +Object.defineProperty(exports, "__esModule", { value: true }); + +var EnglishNumeric; +(function (EnglishNumeric) { + EnglishNumeric.LangMarker = 'Eng'; + EnglishNumeric.RoundNumberIntegerRegex = `(hundred|thousand|million|billion|trillion)`; + EnglishNumeric.ZeroToNineIntegerRegex = `(three|seven|eight|four|five|zero|nine|one|two|six)`; + EnglishNumeric.NegativeNumberTermsRegex = `((minus|negative)\\s+)`; + EnglishNumeric.NegativeNumberSignRegex = `^${EnglishNumeric.NegativeNumberTermsRegex}.*`; + EnglishNumeric.AnIntRegex = `(an|a)(?=\\s)`; + EnglishNumeric.TenToNineteenIntegerRegex = `(seventeen|thirteen|fourteen|eighteen|nineteen|fifteen|sixteen|eleven|twelve|ten)`; + EnglishNumeric.TensNumberIntegerRegex = `(seventy|twenty|thirty|eighty|ninety|forty|fifty|sixty)`; + EnglishNumeric.SeparaIntRegex = `(((${EnglishNumeric.TenToNineteenIntegerRegex}|(${EnglishNumeric.TensNumberIntegerRegex}(\\s+(and\\s+)?|\\s*-\\s*)${EnglishNumeric.ZeroToNineIntegerRegex})|${EnglishNumeric.TensNumberIntegerRegex}|${EnglishNumeric.ZeroToNineIntegerRegex})(\\s+${EnglishNumeric.RoundNumberIntegerRegex})*))|((${EnglishNumeric.AnIntRegex}(\\s+${EnglishNumeric.RoundNumberIntegerRegex})+))`; + EnglishNumeric.AllIntRegex = `((((${EnglishNumeric.TenToNineteenIntegerRegex}|(${EnglishNumeric.TensNumberIntegerRegex}(\\s+(and\\s+)?|\\s*-\\s*)${EnglishNumeric.ZeroToNineIntegerRegex})|${EnglishNumeric.TensNumberIntegerRegex}|${EnglishNumeric.ZeroToNineIntegerRegex}|${EnglishNumeric.AnIntRegex})(\\s+${EnglishNumeric.RoundNumberIntegerRegex})+)\\s+(and\\s+)?)*${EnglishNumeric.SeparaIntRegex})`; + EnglishNumeric.PlaceHolderPureNumber = `\\b`; + EnglishNumeric.PlaceHolderDefault = `\\D|\\b`; + EnglishNumeric.NumbersWithPlaceHolder = (placeholder) => { return `(((?(${EnglishNumeric.AllIntRegex})|((?(${EnglishNumeric.AllIntRegex})|(\\d+)(?![\\.,]))(?=\\b)`; + EnglishNumeric.FractionPrepositionWithinPercentModeRegex = `(?<=\\b)(?(${EnglishNumeric.AllIntRegex})|((?(${EnglishNumeric.AllIntRegex})|(\\d+)(?![\\.,]))(?=\\b)`; + EnglishNumeric.AllPointRegex = `((\\s+${EnglishNumeric.ZeroToNineIntegerRegex})+|(\\s+${EnglishNumeric.SeparaIntRegex}))`; + EnglishNumeric.AllFloatRegex = `${EnglishNumeric.AllIntRegex}(\\s+point)${EnglishNumeric.AllPointRegex}`; + EnglishNumeric.DoubleWithMultiplierRegex = `(((? { return `(((? { return `(?<=\\s|^)(?and)`; + EnglishNumeric.NumberWithSuffixPercentage = `(?)`; + EnglishNumeric.LessRegex = `((less|lower|smaller|fewer)(\\s+than)?|below|under|(?|=)<)`; + EnglishNumeric.EqualRegex = `(equal(s|ing)?(\\s+(to|than))?|(?)=)`; + EnglishNumeric.MoreOrEqualPrefix = `((no\\s+${EnglishNumeric.LessRegex})|(at\\s+least))`; + EnglishNumeric.MoreOrEqual = `((${EnglishNumeric.MoreRegex}\\s+(or)?\\s+${EnglishNumeric.EqualRegex})|(${EnglishNumeric.EqualRegex}\\s+(or)?\\s+${EnglishNumeric.MoreRegex})|${EnglishNumeric.MoreOrEqualPrefix}(\\s+(or)?\\s+${EnglishNumeric.EqualRegex})?|(${EnglishNumeric.EqualRegex}\\s+(or)?\\s+)?${EnglishNumeric.MoreOrEqualPrefix}|>\\s*=)`; + EnglishNumeric.MoreOrEqualSuffix = `((and|or)\\s+(more|greater|higher|larger|bigger)((?!\\s+than)|(\\s+than(?!(\\s*\\d+)))))`; + EnglishNumeric.LessOrEqualPrefix = `((no\\s+${EnglishNumeric.MoreRegex})|(at\\s+most))`; + EnglishNumeric.LessOrEqual = `((${EnglishNumeric.LessRegex}\\s+(or)?\\s+${EnglishNumeric.EqualRegex})|(${EnglishNumeric.EqualRegex}\\s+(or)?\\s+${EnglishNumeric.LessRegex})|${EnglishNumeric.LessOrEqualPrefix}(\\s+(or)?\\s+${EnglishNumeric.EqualRegex})?|(${EnglishNumeric.EqualRegex}\\s+(or)?\\s+)?${EnglishNumeric.LessOrEqualPrefix}|<\\s*=)`; + EnglishNumeric.LessOrEqualSuffix = `((and|or)\\s+(less|lower|smaller|fewer)((?!\\s+than)|(\\s+than(?!(\\s*\\d+)))))`; + EnglishNumeric.NumberSplitMark = `(?![,.](?!\\d+))`; + EnglishNumeric.MoreRegexNoNumberSucceed = `((bigger|greater|more|higher|larger)((?!\\s+than)|\\s+(than(?!(\\s*\\d+))))|(above|over)(?!(\\s*\\d+)))`; + EnglishNumeric.LessRegexNoNumberSucceed = `((less|lower|smaller|fewer)((?!\\s+than)|\\s+(than(?!(\\s*\\d+))))|(below|under)(?!(\\s*\\d+)))`; + EnglishNumeric.EqualRegexNoNumberSucceed = `(equal(s|ing)?((?!\\s+(to|than))|(\\s+(to|than)(?!(\\s*\\d+)))))`; + EnglishNumeric.OneNumberRangeMoreRegex1 = `(${EnglishNumeric.MoreOrEqual}|${EnglishNumeric.MoreRegex})\\s*(the\\s+)?(?(${EnglishNumeric.NumberSplitMark}.)+)`; + EnglishNumeric.OneNumberRangeMoreRegex2 = `(?(${EnglishNumeric.NumberSplitMark}.)+)\\s*${EnglishNumeric.MoreOrEqualSuffix}`; + EnglishNumeric.OneNumberRangeMoreSeparateRegex = `(${EnglishNumeric.EqualRegex}\\s+(?(${EnglishNumeric.NumberSplitMark}.)+)(\\s+or\\s+)${EnglishNumeric.MoreRegexNoNumberSucceed})|(${EnglishNumeric.MoreRegex}\\s+(?(${EnglishNumeric.NumberSplitMark}.)+)(\\s+or\\s+)${EnglishNumeric.EqualRegexNoNumberSucceed})`; + EnglishNumeric.OneNumberRangeLessRegex1 = `(${EnglishNumeric.LessOrEqual}|${EnglishNumeric.LessRegex})\\s*(the\\s+)?(?(${EnglishNumeric.NumberSplitMark}.)+)`; + EnglishNumeric.OneNumberRangeLessRegex2 = `(?(${EnglishNumeric.NumberSplitMark}.)+)\\s*${EnglishNumeric.LessOrEqualSuffix}`; + EnglishNumeric.OneNumberRangeLessSeparateRegex = `(${EnglishNumeric.EqualRegex}\\s+(?(${EnglishNumeric.NumberSplitMark}.)+)(\\s+or\\s+)${EnglishNumeric.LessRegexNoNumberSucceed})|(${EnglishNumeric.LessRegex}\\s+(?(${EnglishNumeric.NumberSplitMark}.)+)(\\s+or\\s+)${EnglishNumeric.EqualRegexNoNumberSucceed})`; + EnglishNumeric.OneNumberRangeEqualRegex = `${EnglishNumeric.EqualRegex}\\s*(the\\s+)?(?(${EnglishNumeric.NumberSplitMark}.)+)`; + EnglishNumeric.TwoNumberRangeRegex1 = `between\\s*(the\\s+)?(?(${EnglishNumeric.NumberSplitMark}.)+)\\s*and\\s*(the\\s+)?(?(${EnglishNumeric.NumberSplitMark}.)+)`; + EnglishNumeric.TwoNumberRangeRegex2 = `(${EnglishNumeric.OneNumberRangeMoreRegex1}|${EnglishNumeric.OneNumberRangeMoreRegex2})\\s*(and|but|,)\\s*(${EnglishNumeric.OneNumberRangeLessRegex1}|${EnglishNumeric.OneNumberRangeLessRegex2})`; + EnglishNumeric.TwoNumberRangeRegex3 = `(${EnglishNumeric.OneNumberRangeLessRegex1}|${EnglishNumeric.OneNumberRangeLessRegex2})\\s*(and|but|,)\\s*(${EnglishNumeric.OneNumberRangeMoreRegex1}|${EnglishNumeric.OneNumberRangeMoreRegex2})`; + EnglishNumeric.TwoNumberRangeRegex4 = `(from\\s+)?(?(${EnglishNumeric.NumberSplitMark}(?!\\bfrom\\b).)+)\\s*${EnglishNumeric.TillRegex}\\s*(the\\s+)?(?(${EnglishNumeric.NumberSplitMark}.)+)`; + EnglishNumeric.AmbiguousFractionConnectorsRegex = `(\\bin\\b)`; + EnglishNumeric.DecimalSeparatorChar = '.'; + EnglishNumeric.FractionMarkerToken = 'over'; + EnglishNumeric.NonDecimalSeparatorChar = ','; + EnglishNumeric.HalfADozenText = 'six'; + EnglishNumeric.WordSeparatorToken = 'and'; + EnglishNumeric.WrittenDecimalSeparatorTexts = ['point']; + EnglishNumeric.WrittenGroupSeparatorTexts = ['punto']; + EnglishNumeric.WrittenIntegerSeparatorTexts = ['and']; + EnglishNumeric.WrittenFractionSeparatorTexts = ['and']; + EnglishNumeric.HalfADozenRegex = `half\\s+a\\s+dozen`; + EnglishNumeric.DigitalNumberRegex = `((?<=\\b)(hundred|thousand|million|billion|trillion|dozen(s)?)(?=\\b))|((?<=(\\d|\\b))(k|t|m|g|b)(?=\\b))`; + EnglishNumeric.CardinalNumberMap = new Map([["a", 1], ["zero", 0], ["an", 1], ["one", 1], ["two", 2], ["three", 3], ["four", 4], ["five", 5], ["six", 6], ["seven", 7], ["eight", 8], ["nine", 9], ["ten", 10], ["eleven", 11], ["twelve", 12], ["dozen", 12], ["dozens", 12], ["thirteen", 13], ["fourteen", 14], ["fifteen", 15], ["sixteen", 16], ["seventeen", 17], ["eighteen", 18], ["nineteen", 19], ["twenty", 20], ["thirty", 30], ["forty", 40], ["fifty", 50], ["sixty", 60], ["seventy", 70], ["eighty", 80], ["ninety", 90], ["hundred", 100], ["thousand", 1000], ["million", 1000000], ["billion", 1000000000], ["trillion", 1000000000000]]); + EnglishNumeric.OrdinalNumberMap = new Map([["first", 1], ["second", 2], ["secondary", 2], ["half", 2], ["third", 3], ["fourth", 4], ["quarter", 4], ["fifth", 5], ["sixth", 6], ["seventh", 7], ["eighth", 8], ["ninth", 9], ["tenth", 10], ["eleventh", 11], ["twelfth", 12], ["thirteenth", 13], ["fourteenth", 14], ["fifteenth", 15], ["sixteenth", 16], ["seventeenth", 17], ["eighteenth", 18], ["nineteenth", 19], ["twentieth", 20], ["thirtieth", 30], ["fortieth", 40], ["fiftieth", 50], ["sixtieth", 60], ["seventieth", 70], ["eightieth", 80], ["ninetieth", 90], ["hundredth", 100], ["thousandth", 1000], ["millionth", 1000000], ["billionth", 1000000000], ["trillionth", 1000000000000], ["firsts", 1], ["halves", 2], ["thirds", 3], ["fourths", 4], ["quarters", 4], ["fifths", 5], ["sixths", 6], ["sevenths", 7], ["eighths", 8], ["ninths", 9], ["tenths", 10], ["elevenths", 11], ["twelfths", 12], ["thirteenths", 13], ["fourteenths", 14], ["fifteenths", 15], ["sixteenths", 16], ["seventeenths", 17], ["eighteenths", 18], ["nineteenths", 19], ["twentieths", 20], ["thirtieths", 30], ["fortieths", 40], ["fiftieths", 50], ["sixtieths", 60], ["seventieths", 70], ["eightieths", 80], ["ninetieths", 90], ["hundredths", 100], ["thousandths", 1000], ["millionths", 1000000], ["billionths", 1000000000], ["trillionths", 1000000000000]]); + EnglishNumeric.RoundNumberMap = new Map([["hundred", 100], ["thousand", 1000], ["million", 1000000], ["billion", 1000000000], ["trillion", 1000000000000], ["hundredth", 100], ["thousandth", 1000], ["millionth", 1000000], ["billionth", 1000000000], ["trillionth", 1000000000000], ["hundredths", 100], ["thousandths", 1000], ["millionths", 1000000], ["billionths", 1000000000], ["trillionths", 1000000000000], ["dozen", 12], ["dozens", 12], ["k", 1000], ["m", 1000000], ["g", 1000000000], ["b", 1000000000], ["t", 1000000000000]]); + EnglishNumeric.AmbiguityFiltersDict = new Map([["\\bone\\b", "\\b(the|this|that|which)\\s+(one)\\b"]]); +})(EnglishNumeric = exports.EnglishNumeric || (exports.EnglishNumeric = {})); + +}); + +unwrapExports(englishNumeric); + +var parserConfiguration = createCommonjsModule(function (module, exports) { +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); + + + +class EnglishNumberParserConfiguration { + constructor(ci) { + if (!ci) { + ci = new culture$2.CultureInfo(culture$2.Culture.English); + } + this.cultureInfo = ci; + this.langMarker = englishNumeric.EnglishNumeric.LangMarker; + this.decimalSeparatorChar = englishNumeric.EnglishNumeric.DecimalSeparatorChar; + this.fractionMarkerToken = englishNumeric.EnglishNumeric.FractionMarkerToken; + this.nonDecimalSeparatorChar = englishNumeric.EnglishNumeric.NonDecimalSeparatorChar; + this.halfADozenText = englishNumeric.EnglishNumeric.HalfADozenText; + this.wordSeparatorToken = englishNumeric.EnglishNumeric.WordSeparatorToken; + this.writtenDecimalSeparatorTexts = englishNumeric.EnglishNumeric.WrittenDecimalSeparatorTexts; + this.writtenGroupSeparatorTexts = englishNumeric.EnglishNumeric.WrittenGroupSeparatorTexts; + this.writtenIntegerSeparatorTexts = englishNumeric.EnglishNumeric.WrittenIntegerSeparatorTexts; + this.writtenFractionSeparatorTexts = englishNumeric.EnglishNumeric.WrittenFractionSeparatorTexts; + this.cardinalNumberMap = englishNumeric.EnglishNumeric.CardinalNumberMap; + this.ordinalNumberMap = englishNumeric.EnglishNumeric.OrdinalNumberMap; + this.roundNumberMap = englishNumeric.EnglishNumeric.RoundNumberMap; + this.negativeNumberSignRegex = recognizersText.RegExpUtility.getSafeRegExp(englishNumeric.EnglishNumeric.NegativeNumberSignRegex, "is"); + this.halfADozenRegex = recognizersText.RegExpUtility.getSafeRegExp(englishNumeric.EnglishNumeric.HalfADozenRegex, "gis"); + this.digitalNumberRegex = recognizersText.RegExpUtility.getSafeRegExp(englishNumeric.EnglishNumeric.DigitalNumberRegex, "gis"); + } + normalizeTokenSet(tokens, context) { + let fracWords = new Array(); + let tokenList = Array.from(tokens); + let tokenLen = tokenList.length; + for (let i = 0; i < tokenLen; i++) { + if (tokenList[i].includes("-")) { + let spiltedTokens = tokenList[i].split("-"); + if (spiltedTokens.length === 2 && this.ordinalNumberMap.has(spiltedTokens[1])) { + fracWords.push(spiltedTokens[0]); + fracWords.push(spiltedTokens[1]); + } + else { + fracWords.push(tokenList[i]); + } + } + else if ((i < tokenLen - 2) && tokenList[i + 1] === "-") { + if (this.ordinalNumberMap.has(tokenList[i + 2])) { + fracWords.push(tokenList[i]); + fracWords.push(tokenList[i + 2]); + } + else { + fracWords.push(tokenList[i] + tokenList[i + 1] + tokenList[i + 2]); + } + i += 2; + } + else { + fracWords.push(tokenList[i]); + } + } + return fracWords; + } + resolveCompositeNumber(numberStr) { + if (numberStr.includes("-")) { + let numbers = numberStr.split('-'); + let ret = 0; + numbers.forEach(num => { + if (this.ordinalNumberMap.has(num)) { + ret += this.ordinalNumberMap.get(num); + } + else if (this.cardinalNumberMap.has(num)) { + ret += this.cardinalNumberMap.get(num); + } + }); + return ret; + } + if (this.ordinalNumberMap.has(numberStr)) { + return this.ordinalNumberMap.get(numberStr); + } + if (this.cardinalNumberMap.has(numberStr)) { + return this.cardinalNumberMap.get(numberStr); + } + return 0; + } +} +exports.EnglishNumberParserConfiguration = EnglishNumberParserConfiguration; + +}); + +unwrapExports(parserConfiguration); + +var spanishNumeric = createCommonjsModule(function (module, exports) { +"use strict"; +// ------------------------------------------------------------------------------ +// +// This code was generated by a tool. +// Changes to this file may cause incorrect behavior and will be lost if +// the code is regenerated. +// +// ------------------------------------------------------------------------------ +Object.defineProperty(exports, "__esModule", { value: true }); + +var SpanishNumeric; +(function (SpanishNumeric) { + SpanishNumeric.LangMarker = 'Spa'; + SpanishNumeric.HundredsNumberIntegerRegex = `(cuatrocient[ao]s|trescient[ao]s|seiscient[ao]s|setecient[ao]s|ochocient[ao]s|novecient[ao]s|doscient[ao]s|quinient[ao]s|(? { return `(((?(${SpanishNumeric.AllIntRegex})|((?(${SpanishNumeric.AllIntRegex})|((\\d+)(?!\\.)))(?=\\b)`; + SpanishNumeric.AllPointRegex = `((\\s+${SpanishNumeric.ZeroToNineIntegerRegex})+|(\\s+${SpanishNumeric.AllIntRegex}))`; + SpanishNumeric.AllFloatRegex = `${SpanishNumeric.AllIntRegex}(\\s+(coma|con))${SpanishNumeric.AllPointRegex}`; + SpanishNumeric.DoubleDecimalPointRegex = (placeholder) => { return `(((? { return `(?<=\\s|^)(? { + spanishNumeric.SpanishNumeric.SuffixOrdinalMap.forEach((suffixValue, suffixKey) => { + if (!ordinalNumberMap.has(prefixKey + suffixKey)) { + ordinalNumberMap.set(prefixKey + suffixKey, prefixValue * suffixValue); + } + }); + }); + this.cardinalNumberMap = spanishNumeric.SpanishNumeric.CardinalNumberMap; + this.ordinalNumberMap = ordinalNumberMap; + this.roundNumberMap = spanishNumeric.SpanishNumeric.RoundNumberMap; + this.negativeNumberSignRegex = recognizersText.RegExpUtility.getSafeRegExp(spanishNumeric.SpanishNumeric.NegativeNumberSignRegex, "is"); + this.halfADozenRegex = recognizersText.RegExpUtility.getSafeRegExp(spanishNumeric.SpanishNumeric.HalfADozenRegex); + this.digitalNumberRegex = recognizersText.RegExpUtility.getSafeRegExp(spanishNumeric.SpanishNumeric.DigitalNumberRegex); + } + normalizeTokenSet(tokens, context) { + let result = new Array(); + tokens.forEach((token) => { + let tempWord = token.replace(/^s+/, '').replace(/s+$/, ''); + if (this.ordinalNumberMap.has(tempWord)) { + result.push(tempWord); + return; + } + if (tempWord.endsWith("avo") || tempWord.endsWith("ava")) { + let origTempWord = tempWord; + let newLength = origTempWord.length; + tempWord = origTempWord.substring(0, newLength - 3); + if (this.cardinalNumberMap.has(tempWord)) { + result.push(tempWord); + return; + } + else { + tempWord = origTempWord.substring(0, newLength - 2); + if (this.cardinalNumberMap.has(tempWord)) { + result.push(tempWord); + return; + } + } + } + result.push(token); + }); + return result; + } + resolveCompositeNumber(numberStr) { + if (this.ordinalNumberMap.has(numberStr)) { + return this.ordinalNumberMap.get(numberStr); + } + if (this.cardinalNumberMap.has(numberStr)) { + return this.cardinalNumberMap.get(numberStr); + } + let value = 0; + let finalValue = 0; + let strBuilder = ""; + let lastGoodChar = 0; + for (let i = 0; i < numberStr.length; i++) { + strBuilder = strBuilder.concat(numberStr[i]); + if (this.cardinalNumberMap.has(strBuilder) && this.cardinalNumberMap.get(strBuilder) > value) { + lastGoodChar = i; + value = this.cardinalNumberMap.get(strBuilder); + } + if ((i + 1) === numberStr.length) { + finalValue += value; + strBuilder = ""; + i = lastGoodChar++; + value = 0; + } + } + return finalValue; + } +} +exports.SpanishNumberParserConfiguration = SpanishNumberParserConfiguration; + +}); + +unwrapExports(parserConfiguration$2); + +var portugueseNumeric = createCommonjsModule(function (module, exports) { +"use strict"; +// ------------------------------------------------------------------------------ +// +// This code was generated by a tool. +// Changes to this file may cause incorrect behavior and will be lost if +// the code is regenerated. +// +// ------------------------------------------------------------------------------ +Object.defineProperty(exports, "__esModule", { value: true }); + +var PortugueseNumeric; +(function (PortugueseNumeric) { + PortugueseNumeric.LangMarker = 'Por'; + PortugueseNumeric.HundredsNumberIntegerRegex = `(quatrocent[ao]s|trezent[ao]s|seiscent[ao]s|setecent[ao]s|oitocent[ao]s|novecent[ao]s|duzent[ao]s|quinhent[ao]s|cem|(? { return `(((?(${PortugueseNumeric.AllIntRegex})|((?(${PortugueseNumeric.AllIntRegex})|((\\d+)(?!\\.)))(?=\\b)`; + PortugueseNumeric.AllFloatRegex = `${PortugueseNumeric.AllIntRegex}(\\s+(vírgula|virgula|e|ponto))${PortugueseNumeric.AllPointRegex}`; + PortugueseNumeric.DoubleWithMultiplierRegex = `(((? { return `(((? { return `(?<=\\s|^)(? { + portugueseNumeric.PortugueseNumeric.SuffixOrdinalMap.forEach((suffixValue, suffixKey) => { + if (!ordinalNumberMap.has(prefixKey + suffixKey)) { + ordinalNumberMap.set(prefixKey + suffixKey, prefixValue * suffixValue); + } + }); + }); + this.cardinalNumberMap = portugueseNumeric.PortugueseNumeric.CardinalNumberMap; + this.ordinalNumberMap = ordinalNumberMap; + this.roundNumberMap = portugueseNumeric.PortugueseNumeric.RoundNumberMap; + this.negativeNumberSignRegex = recognizersText.RegExpUtility.getSafeRegExp(portugueseNumeric.PortugueseNumeric.NegativeNumberSignRegex, "is"); + this.halfADozenRegex = recognizersText.RegExpUtility.getSafeRegExp(portugueseNumeric.PortugueseNumeric.HalfADozenRegex); + this.digitalNumberRegex = recognizersText.RegExpUtility.getSafeRegExp(portugueseNumeric.PortugueseNumeric.DigitalNumberRegex); + } + normalizeTokenSet(tokens, context) { + let result = new Array(); + tokens.forEach((token) => { + let tempWord = token.replace(/^s+/, '').replace(/s+$/, ''); + if (this.ordinalNumberMap.has(tempWord)) { + result.push(tempWord); + return; + } + // ends with 'avo' or 'ava' + if (portugueseNumeric.PortugueseNumeric.WrittenFractionSuffix.some(suffix => tempWord.endsWith(suffix))) { + let origTempWord = tempWord; + let newLength = origTempWord.length; + tempWord = origTempWord.substring(0, newLength - 3); + if (!tempWord) { + return; + } + else if (this.cardinalNumberMap.has(tempWord)) { + result.push(tempWord); + return; + } + else { + tempWord = origTempWord.substring(0, newLength - 2); + if (this.cardinalNumberMap.has(tempWord)) { + result.push(tempWord); + return; + } + } + } + result.push(token); + }); + return result; + } + resolveCompositeNumber(numberStr) { + if (this.ordinalNumberMap.has(numberStr)) { + return this.ordinalNumberMap.get(numberStr); + } + if (this.cardinalNumberMap.has(numberStr)) { + return this.cardinalNumberMap.get(numberStr); + } + let value = 0; + let finalValue = 0; + let strBuilder = ""; + let lastGoodChar = 0; + for (let i = 0; i < numberStr.length; i++) { + strBuilder = strBuilder.concat(numberStr[i]); + if (this.cardinalNumberMap.has(strBuilder) && this.cardinalNumberMap.get(strBuilder) > value) { + lastGoodChar = i; + value = this.cardinalNumberMap.get(strBuilder); + } + if ((i + 1) === numberStr.length) { + finalValue += value; + strBuilder = ""; + i = lastGoodChar++; + value = 0; + } + } + return finalValue; + } +} +exports.PortugueseNumberParserConfiguration = PortugueseNumberParserConfiguration; + +}); + +unwrapExports(parserConfiguration$4); + +var frenchNumeric = createCommonjsModule(function (module, exports) { +"use strict"; +// ------------------------------------------------------------------------------ +// +// This code was generated by a tool. +// Changes to this file may cause incorrect behavior and will be lost if +// the code is regenerated. +// +// ------------------------------------------------------------------------------ +Object.defineProperty(exports, "__esModule", { value: true }); + +var FrenchNumeric; +(function (FrenchNumeric) { + FrenchNumeric.LangMarker = 'Fr'; + FrenchNumeric.RoundNumberIntegerRegex = `(cent|mille|millions|million|milliard|milliards|billion|billions)`; + FrenchNumeric.ZeroToNineIntegerRegex = `(et un|un|une|deux|trois|quatre|cinq|six|sept|huit|neuf)`; + FrenchNumeric.TenToNineteenIntegerRegex = `((seize|quinze|quatorze|treize|douze|onze)|dix(\\Wneuf|\\Whuit|\\Wsept)?)`; + FrenchNumeric.TensNumberIntegerRegex = `(quatre\\Wvingt(s|\\Wdix)?|soixante\\Wdix|vingt|trente|quarante|cinquante|soixante|septante|octante|huitante|nonante)`; + FrenchNumeric.DigitsNumberRegex = `\\d|\\d{1,3}(\\.\\d{3})`; + FrenchNumeric.NegativeNumberTermsRegex = `^[.]`; + FrenchNumeric.NegativeNumberSignRegex = `^(${FrenchNumeric.NegativeNumberTermsRegex}\\s+).*`; + FrenchNumeric.HundredsNumberIntegerRegex = `((${FrenchNumeric.ZeroToNineIntegerRegex}(\\s+cent))|cent|((\\s+cent\\s)+${FrenchNumeric.TensNumberIntegerRegex}))`; + FrenchNumeric.BelowHundredsRegex = `((${FrenchNumeric.TenToNineteenIntegerRegex}|(${FrenchNumeric.TensNumberIntegerRegex}([-\\s]+(${FrenchNumeric.TenToNineteenIntegerRegex}|${FrenchNumeric.ZeroToNineIntegerRegex}))?))|${FrenchNumeric.ZeroToNineIntegerRegex})`; + FrenchNumeric.BelowThousandsRegex = `((${FrenchNumeric.HundredsNumberIntegerRegex}(\\s+${FrenchNumeric.BelowHundredsRegex})?|${FrenchNumeric.BelowHundredsRegex}|${FrenchNumeric.TenToNineteenIntegerRegex})|cent\\s+${FrenchNumeric.TenToNineteenIntegerRegex})`; + FrenchNumeric.SupportThousandsRegex = `((${FrenchNumeric.BelowThousandsRegex}|${FrenchNumeric.BelowHundredsRegex})\\s+${FrenchNumeric.RoundNumberIntegerRegex}(\\s+${FrenchNumeric.RoundNumberIntegerRegex})?)`; + FrenchNumeric.SeparaIntRegex = `(${FrenchNumeric.SupportThousandsRegex}(\\s+${FrenchNumeric.SupportThousandsRegex})*(\\s+${FrenchNumeric.BelowThousandsRegex})?|${FrenchNumeric.BelowThousandsRegex})`; + FrenchNumeric.AllIntRegex = `(${FrenchNumeric.SeparaIntRegex}|mille(\\s+${FrenchNumeric.BelowThousandsRegex})?)`; + FrenchNumeric.NumbersWithPlaceHolder = (placeholder) => { return `(((?(${FrenchNumeric.AllIntRegex})|((?(${FrenchNumeric.AllIntRegex})|((\\d+)(?!\\.)))(?=\\b)`; + FrenchNumeric.AllPointRegex = `((\\s+${FrenchNumeric.ZeroToNineIntegerRegex})+|(\\s+${FrenchNumeric.SeparaIntRegex}))`; + FrenchNumeric.AllFloatRegex = `(${FrenchNumeric.AllIntRegex}(\\s+(virgule|point))${FrenchNumeric.AllPointRegex})`; + FrenchNumeric.DoubleDecimalPointRegex = (placeholder) => { return `(((? { return `(?<=\\s|^)(? value) { + lastGoodChar = i; + value = this.cardinalNumberMap.get(strBuilder); + } + if ((i + 1) === numberStr.length) { + finalValue += value; + strBuilder = ""; + i = lastGoodChar++; + value = 0; + } + } + return finalValue; + } +} +exports.FrenchNumberParserConfiguration = FrenchNumberParserConfiguration; + +}); + +unwrapExports(parserConfiguration$6); + +var chineseNumeric = createCommonjsModule(function (module, exports) { +"use strict"; +// ------------------------------------------------------------------------------ +// +// This code was generated by a tool. +// Changes to this file may cause incorrect behavior and will be lost if +// the code is regenerated. +// +// ------------------------------------------------------------------------------ +Object.defineProperty(exports, "__esModule", { value: true }); +var ChineseNumeric; +(function (ChineseNumeric) { + ChineseNumeric.LangMarker = ''; + ChineseNumeric.DecimalSeparatorChar = '.'; + ChineseNumeric.FractionMarkerToken = ''; + ChineseNumeric.NonDecimalSeparatorChar = ' '; + ChineseNumeric.HalfADozenText = ''; + ChineseNumeric.WordSeparatorToken = ''; + ChineseNumeric.RoundNumberMap = new Map([["k", 1000], ["m", 1000000], ["g", 1000000000], ["t", 1000000000000]]); + ChineseNumeric.RoundNumberMapChar = new Map([["十", 10], ["百", 100], ["千", 1000], ["万", 10000], ["亿", 100000000], ["兆", 1000000000000], ["拾", 10], ["佰", 100], ["仟", 1000], ["萬", 10000], ["億", 100000000]]); + ChineseNumeric.ZeroToNineMap = new Map([["0", 0], ["1", 1], ["2", 2], ["3", 3], ["4", 4], ["5", 5], ["6", 6], ["7", 7], ["8", 8], ["9", 9], ["零", 0], ["一", 1], ["二", 2], ["三", 3], ["四", 4], ["五", 5], ["六", 6], ["七", 7], ["八", 8], ["九", 9], ["〇", 0], ["壹", 1], ["贰", 2], ["貳", 2], ["叁", 3], ["肆", 4], ["伍", 5], ["陆", 6], ["陸", 6], ["柒", 7], ["捌", 8], ["玖", 9], ["0", 0], ["1", 1], ["2", 2], ["3", 3], ["4", 4], ["5", 5], ["6", 6], ["7", 7], ["8", 8], ["9", 9], ["半", 0.5], ["两", 2], ["兩", 2], ["俩", 2], ["倆", 2], ["仨", 3]]); + ChineseNumeric.FullToHalfMap = new Map([["0", "0"], ["1", "1"], ["2", "2"], ["3", "3"], ["4", "4"], ["5", "5"], ["6", "6"], ["7", "7"], ["8", "8"], ["9", "9"], ["/", "/"], ["-", "-"], [",", "\'"], ["G", "G"], ["M", "M"], ["T", "T"], ["K", "K"], ["k", "k"], [".", "."]]); + ChineseNumeric.TratoSimMap = new Map([["佰", "百"], ["點", "点"], ["個", "个"], ["幾", "几"], ["對", "对"], ["雙", "双"]]); + ChineseNumeric.UnitMap = new Map([["萬萬", "億"], ["億萬", "兆"], ["萬億", "兆"], ["万万", "亿"], ["万亿", "兆"], ["亿万", "兆"], [" ", ""], ["多", ""], ["余", ""], ["几", ""]]); + ChineseNumeric.RoundDirectList = ['万', '萬', '亿', '兆', '億']; + ChineseNumeric.DigitalNumberRegex = `((?<=(\\d|\\b))(k|t|m|g)(?=\\b))`; + ChineseNumeric.ZeroToNineFullHalfRegex = `[\\d1234567890]`; + ChineseNumeric.DigitNumRegex = `${ChineseNumeric.ZeroToNineFullHalfRegex}+`; + ChineseNumeric.DozenRegex = `.*打$`; + ChineseNumeric.PercentageRegex = `(?<=百\\s*分\\s*之).+|.+(?=个\\s*百\\s*分\\s*点)|.*(?=[%%])`; + ChineseNumeric.DoubleAndRoundRegex = `${ChineseNumeric.ZeroToNineFullHalfRegex}+(\\.${ChineseNumeric.ZeroToNineFullHalfRegex}+)?\\s*[多几余]?[万亿萬億]{1,2}`; + ChineseNumeric.FracSplitRegex = `又|分\\s*之`; + ChineseNumeric.ZeroToNineIntegerRegex = `[一二三四五六七八九零壹贰貳叁肆伍陆陸柒捌玖〇两兩俩倆仨]`; + ChineseNumeric.NegativeNumberTermsRegex = `[负負]`; + ChineseNumeric.NegativeNumberTermsRegexNum = `((?)`; + ChineseNumeric.LessRegex = `(小于|少于|低于|小於|少於|低於|不到|不足|<)`; + ChineseNumeric.EqualRegex = `(等于|等於|=)`; + ChineseNumeric.MoreOrEqual = `((${ChineseNumeric.MoreRegex}\\s*(或|或者)?\\s*${ChineseNumeric.EqualRegex})|至少|最少|不${ChineseNumeric.LessRegex})`; + ChineseNumeric.MoreOrEqualSuffix = `(或|或者)\\s*(以上|之上|更[大多高])`; + ChineseNumeric.LessOrEqual = `((${ChineseNumeric.LessRegex}\\s*(或|或者)?\\s*${ChineseNumeric.EqualRegex})|至多|最多|不${ChineseNumeric.MoreRegex})`; + ChineseNumeric.LessOrEqualSuffix = `(或|或者)\\s*(以下|之下|更[小少低])`; + ChineseNumeric.OneNumberRangeMoreRegex1 = `(${ChineseNumeric.MoreOrEqual}|${ChineseNumeric.MoreRegex})\\s*(?((?!([并且而並的同時时]|(,(?!\\d+))|(,(?!\\d+))|。)).)+)`; + ChineseNumeric.OneNumberRangeMoreRegex2 = `比\\s*(?((?!((,(?!\\d+))|(,(?!\\d+))|。)).)+)\\s*更?[大多高]`; + ChineseNumeric.OneNumberRangeMoreRegex3 = `(?((?!((,(?!\\d+))|(,(?!\\d+))|。|[或者])).)+)\\s*(或|或者)?\\s*([多几余幾餘]|以上|之上|更[大多高])(?![万亿萬億]{1,2})`; + ChineseNumeric.OneNumberRangeLessRegex1 = `(${ChineseNumeric.LessOrEqual}|${ChineseNumeric.LessRegex})\\s*(?((?!([并且而並的同時时]|(,(?!\\d+))|(,(?!\\d+))|。)).)+)`; + ChineseNumeric.OneNumberRangeLessRegex2 = `比\\s*(?((?!((,(?!\\d+))|(,(?!\\d+))|。)).)+)\\s*更?[小少低]`; + ChineseNumeric.OneNumberRangeLessRegex3 = `(?((?!((,(?!\\d+))|(,(?!\\d+))|。|[或者])).)+)\\s*(或|或者)?\\s*(以下|之下|更[小少低])`; + ChineseNumeric.OneNumberRangeMoreSeparateRegex = `^[.]`; + ChineseNumeric.OneNumberRangeLessSeparateRegex = `^[.]`; + ChineseNumeric.OneNumberRangeEqualRegex = `${ChineseNumeric.EqualRegex}\\s*(?((?!((,(?!\\d+))|(,(?!\\d+))|。)).)+)`; + ChineseNumeric.TwoNumberRangeRegex1 = `((位于|在|位於)|(?=(\\d|\\+|\\-)))\\s*(?((?!((,(?!\\d+))|(,(?!\\d+))|。)).)+)\\s*(和|与|與|${ChineseNumeric.TillRegex})\\s*(?((?!((,(?!\\d+))|(,(?!\\d+))|。))[^之])+)\\s*(之)?(间|間)`; + ChineseNumeric.TwoNumberRangeRegex2 = `(${ChineseNumeric.OneNumberRangeMoreRegex1}|${ChineseNumeric.OneNumberRangeMoreRegex2}|${ChineseNumeric.OneNumberRangeMoreRegex3})\\s*(且|并且|而且|並且|((的)?同時)|((的)?同时)|,)?\\s*(${ChineseNumeric.OneNumberRangeLessRegex1}|${ChineseNumeric.OneNumberRangeLessRegex2}|${ChineseNumeric.OneNumberRangeLessRegex3})`; + ChineseNumeric.TwoNumberRangeRegex3 = `(${ChineseNumeric.OneNumberRangeLessRegex1}|${ChineseNumeric.OneNumberRangeLessRegex2}|${ChineseNumeric.OneNumberRangeLessRegex3})\\s*(且|并且|而且|並且|((的)?同時)|((的)?同时)|,)?\\s*(${ChineseNumeric.OneNumberRangeMoreRegex1}|${ChineseNumeric.OneNumberRangeMoreRegex2}|${ChineseNumeric.OneNumberRangeMoreRegex3})`; + ChineseNumeric.TwoNumberRangeRegex4 = `(?((?!((,(?!\\d+))|(,(?!\\d+))|。)).)+)\\s*${ChineseNumeric.TillRegex}\\s*(?((?!((,(?!\\d+))|(,(?!\\d+))|。)).)+)`; + ChineseNumeric.AmbiguousFractionConnectorsRegex = `^[.]`; +})(ChineseNumeric = exports.ChineseNumeric || (exports.ChineseNumeric = {})); + +}); + +unwrapExports(chineseNumeric); + +var parserConfiguration$8 = createCommonjsModule(function (module, exports) { +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); + + + +class ChineseNumberParserConfiguration { + constructor(ci) { + if (!ci) { + ci = new culture$2.CultureInfo(culture$2.Culture.Chinese); + } + this.cultureInfo = ci; + this.langMarker = chineseNumeric.ChineseNumeric.LangMarker; + this.decimalSeparatorChar = chineseNumeric.ChineseNumeric.DecimalSeparatorChar; + this.fractionMarkerToken = chineseNumeric.ChineseNumeric.FractionMarkerToken; + this.nonDecimalSeparatorChar = chineseNumeric.ChineseNumeric.NonDecimalSeparatorChar; + this.halfADozenText = chineseNumeric.ChineseNumeric.HalfADozenText; + this.wordSeparatorToken = chineseNumeric.ChineseNumeric.WordSeparatorToken; + this.writtenDecimalSeparatorTexts = []; + this.writtenGroupSeparatorTexts = []; + this.writtenIntegerSeparatorTexts = []; + this.writtenFractionSeparatorTexts = []; + this.cardinalNumberMap = new Map(); + this.ordinalNumberMap = new Map(); + this.roundNumberMap = chineseNumeric.ChineseNumeric.RoundNumberMap; + this.halfADozenRegex = null; + this.digitalNumberRegex = recognizersText.RegExpUtility.getSafeRegExp(chineseNumeric.ChineseNumeric.DigitalNumberRegex, "gis"); + this.zeroToNineMap = chineseNumeric.ChineseNumeric.ZeroToNineMap; + this.roundNumberMapChar = chineseNumeric.ChineseNumeric.RoundNumberMapChar; + this.fullToHalfMap = chineseNumeric.ChineseNumeric.FullToHalfMap; + this.tratoSimMap = chineseNumeric.ChineseNumeric.TratoSimMap; + this.unitMap = chineseNumeric.ChineseNumeric.UnitMap; + this.roundDirectList = chineseNumeric.ChineseNumeric.RoundDirectList; + this.digitNumRegex = recognizersText.RegExpUtility.getSafeRegExp(chineseNumeric.ChineseNumeric.DigitNumRegex, "gis"); + this.dozenRegex = recognizersText.RegExpUtility.getSafeRegExp(chineseNumeric.ChineseNumeric.DozenRegex, "gis"); + this.percentageRegex = recognizersText.RegExpUtility.getSafeRegExp(chineseNumeric.ChineseNumeric.PercentageRegex, "gis"); + this.doubleAndRoundRegex = recognizersText.RegExpUtility.getSafeRegExp(chineseNumeric.ChineseNumeric.DoubleAndRoundRegex, "gis"); + this.fracSplitRegex = recognizersText.RegExpUtility.getSafeRegExp(chineseNumeric.ChineseNumeric.FracSplitRegex, "gis"); + this.negativeNumberSignRegex = recognizersText.RegExpUtility.getSafeRegExp(chineseNumeric.ChineseNumeric.NegativeNumberSignRegex, "gis"); + this.pointRegex = recognizersText.RegExpUtility.getSafeRegExp(chineseNumeric.ChineseNumeric.PointRegex, "gis"); + this.speGetNumberRegex = recognizersText.RegExpUtility.getSafeRegExp(chineseNumeric.ChineseNumeric.SpeGetNumberRegex, "gis"); + this.pairRegex = recognizersText.RegExpUtility.getSafeRegExp(chineseNumeric.ChineseNumeric.PairRegex, "gis"); + this.roundNumberIntegerRegex = recognizersText.RegExpUtility.getSafeRegExp(chineseNumeric.ChineseNumeric.RoundNumberIntegerRegex, "gis"); + } + normalizeTokenSet(tokens, context) { + return tokens; + } + resolveCompositeNumber(numberStr) { + return 0; + } +} +exports.ChineseNumberParserConfiguration = ChineseNumberParserConfiguration; + +}); + +unwrapExports(parserConfiguration$8); + +var japaneseNumeric = createCommonjsModule(function (module, exports) { +"use strict"; +// ------------------------------------------------------------------------------ +// +// This code was generated by a tool. +// Changes to this file may cause incorrect behavior and will be lost if +// the code is regenerated. +// +// ------------------------------------------------------------------------------ +Object.defineProperty(exports, "__esModule", { value: true }); +var JapaneseNumeric; +(function (JapaneseNumeric) { + JapaneseNumeric.LangMarker = ''; + JapaneseNumeric.DecimalSeparatorChar = '.'; + JapaneseNumeric.FractionMarkerToken = ''; + JapaneseNumeric.NonDecimalSeparatorChar = ' '; + JapaneseNumeric.HalfADozenText = ''; + JapaneseNumeric.WordSeparatorToken = ''; + JapaneseNumeric.RoundNumberMap = new Map([["k", 1000], ["m", 1000000], ["g", 1000000000], ["t", 1000000000000]]); + JapaneseNumeric.RoundNumberMapChar = new Map([["十", 10], ["百", 100], ["千", 1000], ["万", 10000], ["億", 100000000], ["兆", 1000000000000]]); + JapaneseNumeric.ZeroToNineMap = new Map([["0", 0], ["1", 1], ["2", 2], ["3", 3], ["4", 4], ["5", 5], ["6", 6], ["7", 7], ["8", 8], ["9", 9], ["零", 0], ["一", 1], ["二", 2], ["三", 3], ["四", 4], ["五", 5], ["六", 6], ["七", 7], ["八", 8], ["九", 9], ["半", 0.5]]); + JapaneseNumeric.FullToHalfMap = new Map([["0", "0"], ["1", "1"], ["2", "2"], ["3", "3"], ["4", "4"], ["5", "5"], ["6", "6"], ["7", "7"], ["8", "8"], ["9", "9"], ["/", "/"], ["-", "-"], [",", "\'"], ["、", "\'"], ["G", "G"], ["M", "M"], ["T", "T"], ["K", "K"], ["k", "k"], [".", "."]]); + JapaneseNumeric.UnitMap = new Map([["万万", "億"], ["億万", "兆"], ["万億", "兆"], [" ", ""]]); + JapaneseNumeric.RoundDirectList = ['万', '億', '兆']; + JapaneseNumeric.DigitalNumberRegex = `((?<=(\\d|\\b))(k|t|m|g)(?=\\b))`; + JapaneseNumeric.ZeroToNineFullHalfRegex = `[\\d1234567890]`; + JapaneseNumeric.DigitNumRegex = `${JapaneseNumeric.ZeroToNineFullHalfRegex}+`; + JapaneseNumeric.DozenRegex = `.*ダース$`; + JapaneseNumeric.PercentageRegex = `.+(?=パ\\s*ー\\s*セ\\s*ン\\s*ト)|.*(?=[%%])`; + JapaneseNumeric.DoubleAndRoundRegex = `${JapaneseNumeric.ZeroToNineFullHalfRegex}+(\\.${JapaneseNumeric.ZeroToNineFullHalfRegex}+)?\\s*[万億]{1,2}(\\s*(以上))?`; + JapaneseNumeric.FracSplitRegex = `[はと]|分\\s*の`; + JapaneseNumeric.ZeroToNineIntegerRegex = `[一二三四五六七八九]`; + JapaneseNumeric.NegativeNumberTermsRegex = `(マ\\s*イ\\s*ナ\\s*ス)`; + JapaneseNumeric.NegativeNumberTermsRegexNum = `(?)`; + JapaneseNumeric.LessRegex = `(小なり|小さい|低い|<)`; + JapaneseNumeric.EqualRegex = `(等しい|イコール|=)`; + JapaneseNumeric.MoreOrEqual = `((大なりかイコール)|(大きいかイコール)|(大なりか等しい)|(大きいか等しい)|小さくない|以上|最低)`; + JapaneseNumeric.MoreOrEqualSuffix = `(より(大なりイコール|小さくない))`; + JapaneseNumeric.LessOrEqual = `((${JapaneseNumeric.LessRegex}\\s*(或|或者)?\\s*${JapaneseNumeric.EqualRegex})|(小なりかイコール)|(小なりか等しい)|(小さいかイコール)|(小さいか等しい)|(小さいか等しい)|大さくない|以下|最大)`; + JapaneseNumeric.LessOrEqualSuffix = `(小なりイコール|大さくない)`; + JapaneseNumeric.OneNumberRangeMoreRegex1 = `(?((?!(((,|、)(?!\\d+))|((,|、)(?!\\d+))|。)).)+)\\s*((より)\\s*((${JapaneseNumeric.MoreOrEqual}|${JapaneseNumeric.MoreRegex}))|超える|を超える)`; + JapaneseNumeric.OneNumberRangeMoreRegex2 = `(?((?!((,|、(?!\\d+))|(,|、(?!\\d+))|。)).)+)\\s*(より)?(大なり)`; + JapaneseNumeric.OneNumberRangeMoreRegex3 = `(?((?!((,(?!\\d+))|(,(?!\\d+))|。)).)+)\\s*(以上|最低)(?![万億]{1,2})`; + JapaneseNumeric.OneNumberRangeMoreRegex4 = `(${JapaneseNumeric.MoreOrEqual}|${JapaneseNumeric.MoreRegex})\\s*(?((?!(と|は|((と)?同時に)|((と)?そして)|が|,|、|,|(,(?!\\d+))|(,(?!\\d+))|。)).)+)`; + JapaneseNumeric.OneNumberRangeMoreSeparateRegex = `^[.]`; + JapaneseNumeric.OneNumberRangeLessSeparateRegex = `^[.]`; + JapaneseNumeric.OneNumberRangeLessRegex1 = `(?((?!(((,|、)(?!\\d+))|((,|、)(?!\\d+))|。)).)+)\\s*(より)\\s*(${JapaneseNumeric.LessOrEqual}|${JapaneseNumeric.LessRegex})`; + JapaneseNumeric.OneNumberRangeLessRegex2 = `(?((?!((,(?!\\d+))|(,(?!\\d+))|。)).)+)\\s*(より)?(小な)`; + JapaneseNumeric.OneNumberRangeLessRegex3 = `(?((?!((,(?!\\d+))|(,(?!\\d+))|。)).)+)\\s*(以下|未満)(?![万億]{1,2})`; + JapaneseNumeric.OneNumberRangeLessRegex4 = `(${JapaneseNumeric.LessOrEqual}|${JapaneseNumeric.LessRegex})\\s*(?((?!(と|は|((と)?同時に)|((と)?そして)|が|,|、|,|(,(?!\\d+))|(,(?!\\d+))|。)).)+)`; + JapaneseNumeric.OneNumberRangeEqualRegex = `(((?((?!((,(?!\\d+))|(,(?!\\d+))|。)).)+)\\s*(に)\\s*${JapaneseNumeric.EqualRegex})|(${JapaneseNumeric.EqualRegex}\\s*(?((?!((,(?!\\d+))|(,(?!\\d+))|。)).)+)))`; + JapaneseNumeric.TwoNumberRangeRegex1 = `(?((?!((,(?!\\d+))|(,(?!\\d+))|。)).)+)\\s*(と|${JapaneseNumeric.TillRegex})\\s*(?((?!((,(?!\\d+))|(,(?!\\d+))|。)).)+)\\s*(の間)`; + JapaneseNumeric.TwoNumberRangeRegex2 = `(${JapaneseNumeric.OneNumberRangeMoreRegex1}|${JapaneseNumeric.OneNumberRangeMoreRegex2}|${JapaneseNumeric.OneNumberRangeMoreRegex3}|${JapaneseNumeric.OneNumberRangeMoreRegex4})\\s*(と|は|((と)?同時に)|((と)?そして)|が|,|、|,)?\\s*(${JapaneseNumeric.OneNumberRangeLessRegex1}|${JapaneseNumeric.OneNumberRangeLessRegex2}|${JapaneseNumeric.OneNumberRangeLessRegex3}|${JapaneseNumeric.OneNumberRangeLessRegex4})`; + JapaneseNumeric.TwoNumberRangeRegex3 = `(${JapaneseNumeric.OneNumberRangeLessRegex1}|${JapaneseNumeric.OneNumberRangeLessRegex2}|${JapaneseNumeric.OneNumberRangeLessRegex3}|${JapaneseNumeric.OneNumberRangeLessRegex4})\\s*(と|は|((と)?同時に)|((と)?そして)|が|,|、|,)?\\s*(${JapaneseNumeric.OneNumberRangeMoreRegex1}|${JapaneseNumeric.OneNumberRangeMoreRegex2}|${JapaneseNumeric.OneNumberRangeMoreRegex3}|${JapaneseNumeric.OneNumberRangeMoreRegex4})`; + JapaneseNumeric.TwoNumberRangeRegex4 = `(?((?!((,(?!\\d+))|(,(?!\\d+))|。)).)+)\\s*${JapaneseNumeric.TillRegex}\\s*(?((?!((,(?!\\d+))|(,(?!\\d+))|。)).)+)`; + JapaneseNumeric.AmbiguousFractionConnectorsRegex = `^[.]`; +})(JapaneseNumeric = exports.JapaneseNumeric || (exports.JapaneseNumeric = {})); + +}); + +unwrapExports(japaneseNumeric); + +var parserConfiguration$10 = createCommonjsModule(function (module, exports) { +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); + + + +class JapaneseNumberParserConfiguration { + // readonly NumberOptions Options { get; } + // readonly Regex FractionPrepositionRegex { get; } + // readonly string NonDecimalSeparatorText + constructor(ci) { + if (!ci) { + ci = new culture$2.CultureInfo(culture$2.Culture.Japanese); + } + this.cultureInfo = ci; + this.langMarker = japaneseNumeric.JapaneseNumeric.LangMarker; + this.decimalSeparatorChar = japaneseNumeric.JapaneseNumeric.DecimalSeparatorChar; + this.fractionMarkerToken = japaneseNumeric.JapaneseNumeric.FractionMarkerToken; + this.nonDecimalSeparatorChar = japaneseNumeric.JapaneseNumeric.NonDecimalSeparatorChar; + this.halfADozenText = japaneseNumeric.JapaneseNumeric.HalfADozenText; + this.wordSeparatorToken = japaneseNumeric.JapaneseNumeric.WordSeparatorToken; + this.writtenDecimalSeparatorTexts = []; + this.writtenGroupSeparatorTexts = []; + this.writtenIntegerSeparatorTexts = []; + this.writtenFractionSeparatorTexts = []; + this.cardinalNumberMap = new Map(); + this.ordinalNumberMap = new Map(); + this.roundNumberMap = japaneseNumeric.JapaneseNumeric.RoundNumberMap; + this.halfADozenRegex = null; + this.digitalNumberRegex = recognizersText.RegExpUtility.getSafeRegExp(japaneseNumeric.JapaneseNumeric.DigitalNumberRegex, "gis"); + this.zeroToNineMap = japaneseNumeric.JapaneseNumeric.ZeroToNineMap; + this.roundNumberMapChar = japaneseNumeric.JapaneseNumeric.RoundNumberMapChar; + this.fullToHalfMap = japaneseNumeric.JapaneseNumeric.FullToHalfMap; + this.tratoSimMap = null; + this.unitMap = japaneseNumeric.JapaneseNumeric.UnitMap; + this.roundDirectList = japaneseNumeric.JapaneseNumeric.RoundDirectList; + this.digitNumRegex = recognizersText.RegExpUtility.getSafeRegExp(japaneseNumeric.JapaneseNumeric.DigitNumRegex, "gis"); + this.dozenRegex = recognizersText.RegExpUtility.getSafeRegExp(japaneseNumeric.JapaneseNumeric.DozenRegex, "gis"); + this.percentageRegex = recognizersText.RegExpUtility.getSafeRegExp(japaneseNumeric.JapaneseNumeric.PercentageRegex, "gis"); + this.doubleAndRoundRegex = recognizersText.RegExpUtility.getSafeRegExp(japaneseNumeric.JapaneseNumeric.DoubleAndRoundRegex, "gis"); + this.fracSplitRegex = recognizersText.RegExpUtility.getSafeRegExp(japaneseNumeric.JapaneseNumeric.FracSplitRegex, "gis"); + this.negativeNumberSignRegex = recognizersText.RegExpUtility.getSafeRegExp(japaneseNumeric.JapaneseNumeric.NegativeNumberSignRegex, "is"); + this.pointRegex = recognizersText.RegExpUtility.getSafeRegExp(japaneseNumeric.JapaneseNumeric.PointRegex, "gis"); + this.speGetNumberRegex = recognizersText.RegExpUtility.getSafeRegExp(japaneseNumeric.JapaneseNumeric.SpeGetNumberRegex, "gis"); + this.pairRegex = recognizersText.RegExpUtility.getSafeRegExp(japaneseNumeric.JapaneseNumeric.PairRegex, "gis"); + this.roundNumberIntegerRegex = recognizersText.RegExpUtility.getSafeRegExp(japaneseNumeric.JapaneseNumeric.RoundNumberIntegerRegex, "gis"); + } + normalizeTokenSet(tokens, context) { + return tokens; + } + resolveCompositeNumber(numberStr) { + return 0; + } +} +exports.JapaneseNumberParserConfiguration = JapaneseNumberParserConfiguration; + +}); + +unwrapExports(parserConfiguration$10); + +/** + * lodash (Custom Build) + * Build: `lodash modularize exports="npm" -o ./` + * Copyright jQuery Foundation and other contributors + * Released under MIT license + * Based on Underscore.js 1.8.3 + * Copyright Jeremy Ashkenas, DocumentCloud and Investigative Reporters & Editors + */ + +/** Used as references for various `Number` constants. */ +var INFINITY$1 = 1 / 0; + +/** `Object#toString` result references. */ +var symbolTag$1 = '[object Symbol]'; + +/** + * Used to match `RegExp` + * [syntax characters](http://ecma-international.org/ecma-262/6.0/#sec-patterns). + */ +var reRegExpChar = /[\\^$.*+?()[\]{}|]/g; +var reHasRegExpChar = RegExp(reRegExpChar.source); + +/** Detect free variable `global` from Node.js. */ +var freeGlobal$1 = typeof commonjsGlobal == 'object' && commonjsGlobal && commonjsGlobal.Object === Object && commonjsGlobal; + +/** Detect free variable `self`. */ +var freeSelf$1 = typeof self == 'object' && self && self.Object === Object && self; + +/** Used as a reference to the global object. */ +var root$1 = freeGlobal$1 || freeSelf$1 || Function('return this')(); + +/** Used for built-in method references. */ +var objectProto$1 = Object.prototype; + +/** + * Used to resolve the + * [`toStringTag`](http://ecma-international.org/ecma-262/6.0/#sec-object.prototype.tostring) + * of values. + */ +var objectToString$1 = objectProto$1.toString; + +/** Built-in value references. */ +var Symbol$2 = root$1.Symbol; + +/** Used to convert symbols to primitives and strings. */ +var symbolProto$1 = Symbol$2 ? Symbol$2.prototype : undefined; +var symbolToString$1 = symbolProto$1 ? symbolProto$1.toString : undefined; + +/** + * The base implementation of `_.toString` which doesn't convert nullish + * values to empty strings. + * + * @private + * @param {*} value The value to process. + * @returns {string} Returns the string. + */ +function baseToString$1(value) { + // Exit early for strings to avoid a performance hit in some environments. + if (typeof value == 'string') { + return value; + } + if (isSymbol$1(value)) { + return symbolToString$1 ? symbolToString$1.call(value) : ''; + } + var result = (value + ''); + return (result == '0' && (1 / value) == -INFINITY$1) ? '-0' : result; +} + +/** + * Checks if `value` is object-like. A value is object-like if it's not `null` + * and has a `typeof` result of "object". + * + * @static + * @memberOf _ + * @since 4.0.0 + * @category Lang + * @param {*} value The value to check. + * @returns {boolean} Returns `true` if `value` is object-like, else `false`. + * @example + * + * _.isObjectLike({}); + * // => true + * + * _.isObjectLike([1, 2, 3]); + * // => true + * + * _.isObjectLike(_.noop); + * // => false + * + * _.isObjectLike(null); + * // => false + */ +function isObjectLike$1(value) { + return !!value && typeof value == 'object'; +} + +/** + * Checks if `value` is classified as a `Symbol` primitive or object. + * + * @static + * @memberOf _ + * @since 4.0.0 + * @category Lang + * @param {*} value The value to check. + * @returns {boolean} Returns `true` if `value` is a symbol, else `false`. + * @example + * + * _.isSymbol(Symbol.iterator); + * // => true + * + * _.isSymbol('abc'); + * // => false + */ +function isSymbol$1(value) { + return typeof value == 'symbol' || + (isObjectLike$1(value) && objectToString$1.call(value) == symbolTag$1); +} + +/** + * Converts `value` to a string. An empty string is returned for `null` + * and `undefined` values. The sign of `-0` is preserved. + * + * @static + * @memberOf _ + * @since 4.0.0 + * @category Lang + * @param {*} value The value to process. + * @returns {string} Returns the string. + * @example + * + * _.toString(null); + * // => '' + * + * _.toString(-0); + * // => '-0' + * + * _.toString([1, 2, 3]); + * // => '1,2,3' + */ +function toString$1(value) { + return value == null ? '' : baseToString$1(value); +} + +/** + * Escapes the `RegExp` special characters "^", "$", "\", ".", "*", "+", + * "?", "(", ")", "[", "]", "{", "}", and "|" in `string`. + * + * @static + * @memberOf _ + * @since 3.0.0 + * @category String + * @param {string} [string=''] The string to escape. + * @returns {string} Returns the escaped string. + * @example + * + * _.escapeRegExp('[lodash](https://lodash.com/)'); + * // => '\[lodash\]\(https://lodash\.com/\)' + */ +function escapeRegExp(string) { + string = toString$1(string); + return (string && reHasRegExpChar.test(string)) + ? string.replace(reRegExpChar, '\\$&') + : string; +} + +var lodash_escaperegexp = escapeRegExp; + +var extractors$4 = createCommonjsModule(function (module, exports) { +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); + + + + +class BaseNumberExtractor { + constructor() { + this.extractType = ""; + this.negativeNumberTermsRegex = null; + } + extract(source) { + if (!source || source.trim().length === 0) { + return []; + } + let result = new Array(); + let matchSource = new Map(); + let matched = new Array(source.length); + for (let i = 0; i < source.length; i++) { + matched[i] = false; + } + let collections = this.regexes + .map(o => ({ matches: recognizersText.RegExpUtility.getMatches(o.regExp, source), value: o.value })) + .filter(o => o.matches && o.matches.length); + collections.forEach(collection => { + collection.matches.forEach(m => { + for (let j = 0; j < m.length; j++) { + matched[m.index + j] = true; + } + // Keep Source Data for extra information + matchSource.set(m, collection.value); + }); + }); + let last = -1; + for (let i = 0; i < source.length; i++) { + if (matched[i]) { + if (i + 1 === source.length || !matched[i + 1]) { + let start = last + 1; + let length = i - last; + let substr = source.substring(start, start + length); + let srcMatch = Array.from(matchSource.keys()).find(m => m.index === start && m.length === length); + // Extract negative numbers + if (this.negativeNumberTermsRegex !== null) { + let match = source.substr(0, start).match(this.negativeNumberTermsRegex); + if (match) { + start = match.index; + length = length + match[0].length; + substr = match[0] + substr; + } + } + if (srcMatch) { + result.push({ + start: start, + length: length, + text: substr, + type: this.extractType, + data: matchSource.has(srcMatch) ? matchSource.get(srcMatch) : null + }); + } + } + } + else { + last = i; + } + } + return result; + } + generateLongFormatNumberRegexes(type, placeholder = baseNumbers.BaseNumbers.PlaceHolderDefault) { + let thousandsMark = lodash_escaperegexp(type.thousandsMark); + let decimalsMark = lodash_escaperegexp(type.decimalsMark); + let regexDefinition = type.decimalsMark === '\0' + ? baseNumbers.BaseNumbers.IntegerRegexDefinition(placeholder, thousandsMark) + : baseNumbers.BaseNumbers.DoubleRegexDefinition(placeholder, thousandsMark, decimalsMark); + return recognizersText.RegExpUtility.getSafeRegExp(regexDefinition, "gis"); + } +} +exports.BaseNumberExtractor = BaseNumberExtractor; +class BasePercentageExtractor { + constructor(numberExtractor) { + this.extractType = constants.Constants.SYS_NUM_PERCENTAGE; + this.numberExtractor = numberExtractor; + this.regexes = this.initRegexes(); + } + extract(source) { + let originSource = source; + let positionMap; + let numExtResults; + // preprocess the source sentence via extracting and replacing the numbers in it + let preprocess = this.preprocessStrWithNumberExtracted(originSource); + source = preprocess.source; + positionMap = preprocess.positionMap; + numExtResults = preprocess.numExtResults; + let allMatches = this.regexes.map(rx => recognizersText.RegExpUtility.getMatches(rx, source)); + let matched = new Array(source.length); + for (let i = 0; i < source.length; i++) { + matched[i] = false; + } + for (let i = 0; i < allMatches.length; i++) { + allMatches[i].forEach(match => { + for (let j = 0; j < match.length; j++) { + matched[j + match.index] = true; + } + }); + } + let result = new Array(); + let last = -1; + // get index of each matched results + for (let i = 0; i < source.length; i++) { + if (matched[i]) { + if (i + 1 === source.length || matched[i + 1] === false) { + let start = last + 1; + let length = i - last; + let substr = source.substring(start, start + length); + let er = { + start: start, + length: length, + text: substr, + type: this.extractType + }; + result.push(er); + } + } + else { + last = i; + } + } + // post-processing, restoring the extracted numbers + this.postProcessing(result, originSource, positionMap, numExtResults); + return result; + } + // get the number extractor results and convert the extracted numbers to @sys.num, so that the regexes can work + preprocessStrWithNumberExtracted(str) { + let positionMap = new Map(); + let numExtResults = this.numberExtractor.extract(str); + let replaceText = baseNumbers.BaseNumbers.NumberReplaceToken; + let match = new Array(str.length); + let strParts = new Array(); + let start; + let end; + for (let i = 0; i < str.length; i++) { + match[i] = -1; + } + for (let i = 0; i < numExtResults.length; i++) { + let extraction = numExtResults[i]; + start = extraction.start; + end = extraction.length + start; + for (let j = start; j < end; j++) { + if (match[j] === -1) { + match[j] = i; + } + } + } + start = 0; + for (let i = 1; i < str.length; i++) { + if (match[i] !== match[i - 1]) { + strParts.push([start, i - 1]); + start = i; + } + } + strParts.push([start, str.length - 1]); + let ret = ""; + let index = 0; + strParts.forEach(strPart => { + start = strPart[0]; + end = strPart[1]; + let type = match[start]; + if (type === -1) { + ret += str.substring(start, end + 1); + for (let i = start; i <= end; i++) { + positionMap.set(index++, i); + } + } + else { + let originalText = str.substring(start, end + 1); + ret += replaceText; + for (let i = 0; i < replaceText.length; i++) { + positionMap.set(index++, start); + } + } + }); + positionMap.set(index++, str.length); + return { + numExtResults: numExtResults, + source: ret, + positionMap: positionMap + }; + } + // replace the @sys.num to the real patterns, directly modifies the ExtractResult + postProcessing(results, originSource, positionMap, numExtResults) { + let replaceText = baseNumbers.BaseNumbers.NumberReplaceToken; + for (let i = 0; i < results.length; i++) { + let start = results[i].start; + let end = start + results[i].length; + let str = results[i].text; + if (positionMap.has(start) && positionMap.has(end)) { + let originStart = positionMap.get(start); + let originLenth = positionMap.get(end) - originStart; + results[i].start = originStart; + results[i].length = originLenth; + results[i].text = originSource.substring(originStart, originStart + originLenth).trim(); + let numStart = str.indexOf(replaceText); + if (numStart !== -1) { + let numOriginStart = start + numStart; + if (positionMap.has(numStart)) { + let dataKey = originSource.substring(positionMap.get(numOriginStart), positionMap.get(numOriginStart + replaceText.length)); + for (let j = i; j < numExtResults.length; j++) { + if (results[i].start === numExtResults[j].start && results[i].text.includes(numExtResults[j].text)) { + results[i].data = [dataKey, numExtResults[j]]; + break; + } + } + } + } + } + } + } + // read the rules + buildRegexes(regexStrs, ignoreCase = true) { + return regexStrs.map(regexStr => { + let options = "gs"; + if (ignoreCase) { + options += "i"; + } + return recognizersText.RegExpUtility.getSafeRegExp(regexStr, options); + }); + } +} +BasePercentageExtractor.numExtType = constants.Constants.SYS_NUM; +exports.BasePercentageExtractor = BasePercentageExtractor; + +}); + +unwrapExports(extractors$4); + +var extractors$2 = createCommonjsModule(function (module, exports) { +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); + + + + + +class EnglishNumberExtractor extends extractors$4.BaseNumberExtractor { + constructor(mode = models$2.NumberMode.Default) { + super(); + this.extractType = constants.Constants.SYS_NUM; + this.negativeNumberTermsRegex = recognizersText.RegExpUtility.getSafeRegExp(englishNumeric.EnglishNumeric.NegativeNumberTermsRegex + "$", "is"); + let regexes = new Array(); + // Add Cardinal + let cardExtract = null; + switch (mode) { + case models$2.NumberMode.PureNumber: + cardExtract = new EnglishCardinalExtractor(englishNumeric.EnglishNumeric.PlaceHolderPureNumber); + break; + case models$2.NumberMode.Currency: + regexes.push({ regExp: recognizersText.RegExpUtility.getSafeRegExp(englishNumeric.EnglishNumeric.CurrencyRegex, "gs"), value: "IntegerNum" }); + break; + case models$2.NumberMode.Default: + break; + } + if (cardExtract === null) { + cardExtract = new EnglishCardinalExtractor(); + } + cardExtract.regexes.forEach(r => regexes.push(r)); + // Add Fraction + let fracExtract = new EnglishFractionExtractor(); + fracExtract.regexes.forEach(r => regexes.push(r)); + this.regexes = regexes; + } +} +exports.EnglishNumberExtractor = EnglishNumberExtractor; +class EnglishCardinalExtractor extends extractors$4.BaseNumberExtractor { + constructor(placeholder = englishNumeric.EnglishNumeric.PlaceHolderDefault) { + super(); + this.extractType = constants.Constants.SYS_NUM_CARDINAL; + let regexes = new Array(); + // Add Integer Regexes + let intExtract = new EnglishIntegerExtractor(placeholder); + intExtract.regexes.forEach(r => regexes.push(r)); + // Add Double Regexes + let doubleExtract = new EnglishDoubleExtractor(placeholder); + doubleExtract.regexes.forEach(r => regexes.push(r)); + this.regexes = regexes; + } +} +exports.EnglishCardinalExtractor = EnglishCardinalExtractor; +class EnglishIntegerExtractor extends extractors$4.BaseNumberExtractor { + constructor(placeholder = englishNumeric.EnglishNumeric.PlaceHolderDefault) { + super(); + this.extractType = constants.Constants.SYS_NUM_INTEGER; + let regexes = new Array({ + regExp: recognizersText.RegExpUtility.getSafeRegExp(englishNumeric.EnglishNumeric.NumbersWithPlaceHolder(placeholder), "gi"), + value: "IntegerNum" + }, { + regExp: recognizersText.RegExpUtility.getSafeRegExp(englishNumeric.EnglishNumeric.NumbersWithSuffix, "gs"), + value: "IntegerNum" + }, { + regExp: this.generateLongFormatNumberRegexes(models$2.LongFormatType.integerNumComma, placeholder), + value: "IntegerNum" + }, { + regExp: this.generateLongFormatNumberRegexes(models$2.LongFormatType.integerNumBlank, placeholder), + value: "IntegerNum" + }, { + regExp: this.generateLongFormatNumberRegexes(models$2.LongFormatType.integerNumNoBreakSpace, placeholder), + value: "IntegerNum" + }, { + regExp: recognizersText.RegExpUtility.getSafeRegExp(englishNumeric.EnglishNumeric.RoundNumberIntegerRegexWithLocks, "gis"), + value: "IntegerNum" + }, { + regExp: recognizersText.RegExpUtility.getSafeRegExp(englishNumeric.EnglishNumeric.NumbersWithDozenSuffix, "gis"), + value: "IntegerNum" + }, { + regExp: recognizersText.RegExpUtility.getSafeRegExp(englishNumeric.EnglishNumeric.AllIntRegexWithLocks, "gis"), + value: "IntegerEng" + }, { + regExp: recognizersText.RegExpUtility.getSafeRegExp(englishNumeric.EnglishNumeric.AllIntRegexWithDozenSuffixLocks, "gis"), + value: "IntegerEng" + }); + this.regexes = regexes; + } +} +exports.EnglishIntegerExtractor = EnglishIntegerExtractor; +class EnglishDoubleExtractor extends extractors$4.BaseNumberExtractor { + constructor(placeholder = englishNumeric.EnglishNumeric.PlaceHolderDefault) { + super(); + this.extractType = constants.Constants.SYS_NUM_DOUBLE; + let regexes = new Array({ + regExp: recognizersText.RegExpUtility.getSafeRegExp(englishNumeric.EnglishNumeric.DoubleDecimalPointRegex(placeholder), "gis"), + value: "DoubleNum" + }, { + regExp: recognizersText.RegExpUtility.getSafeRegExp(englishNumeric.EnglishNumeric.DoubleWithoutIntegralRegex(placeholder), "gis"), + value: "DoubleNum" + }, { + regExp: this.generateLongFormatNumberRegexes(models$2.LongFormatType.doubleNumCommaDot, placeholder), + value: "DoubleNum" + }, { + regExp: this.generateLongFormatNumberRegexes(models$2.LongFormatType.doubleNumNoBreakSpaceDot, placeholder), + value: "DoubleNum" + }, { + regExp: recognizersText.RegExpUtility.getSafeRegExp(englishNumeric.EnglishNumeric.DoubleWithMultiplierRegex, "gs"), + value: "DoubleNum" + }, { + regExp: recognizersText.RegExpUtility.getSafeRegExp(englishNumeric.EnglishNumeric.DoubleWithRoundNumber, "gis"), + value: "DoubleNum" + }, { + regExp: recognizersText.RegExpUtility.getSafeRegExp(englishNumeric.EnglishNumeric.DoubleAllFloatRegex, "gis"), + value: "DoubleEng" + }, { + regExp: recognizersText.RegExpUtility.getSafeRegExp(englishNumeric.EnglishNumeric.DoubleExponentialNotationRegex, "gis"), + value: "DoublePow" + }, { + regExp: recognizersText.RegExpUtility.getSafeRegExp(englishNumeric.EnglishNumeric.DoubleCaretExponentialNotationRegex, "gis"), + value: "DoublePow" + }); + this.regexes = regexes; + } +} +exports.EnglishDoubleExtractor = EnglishDoubleExtractor; +class EnglishFractionExtractor extends extractors$4.BaseNumberExtractor { + constructor() { + super(); + this.extractType = constants.Constants.SYS_NUM_FRACTION; + let regexes = new Array({ + regExp: recognizersText.RegExpUtility.getSafeRegExp(englishNumeric.EnglishNumeric.FractionNotationWithSpacesRegex, "gis"), + value: "FracNum" + }, { + regExp: recognizersText.RegExpUtility.getSafeRegExp(englishNumeric.EnglishNumeric.FractionNotationRegex, "gis"), + value: "FracNum" + }, { + regExp: recognizersText.RegExpUtility.getSafeRegExp(englishNumeric.EnglishNumeric.FractionNounRegex, "gis"), + value: "FracEng" + }, { + regExp: recognizersText.RegExpUtility.getSafeRegExp(englishNumeric.EnglishNumeric.FractionNounWithArticleRegex, "gis"), + value: "FracEng" + }, { + regExp: recognizersText.RegExpUtility.getSafeRegExp(englishNumeric.EnglishNumeric.FractionPrepositionRegex, "gis"), + value: "FracEng" + }); + this.regexes = regexes; + } +} +exports.EnglishFractionExtractor = EnglishFractionExtractor; +class EnglishOrdinalExtractor extends extractors$4.BaseNumberExtractor { + constructor() { + super(); + this.extractType = constants.Constants.SYS_NUM_ORDINAL; + let regexes = new Array({ + regExp: recognizersText.RegExpUtility.getSafeRegExp(englishNumeric.EnglishNumeric.OrdinalSuffixRegex, "gis"), + value: "OrdinalNum" + }, { + regExp: recognizersText.RegExpUtility.getSafeRegExp(englishNumeric.EnglishNumeric.OrdinalNumericRegex, "gis"), + value: "OrdinalNum" + }, { + regExp: recognizersText.RegExpUtility.getSafeRegExp(englishNumeric.EnglishNumeric.OrdinalEnglishRegex, "gis"), + value: "OrdEng" + }, { + regExp: recognizersText.RegExpUtility.getSafeRegExp(englishNumeric.EnglishNumeric.OrdinalRoundNumberRegex, "gis"), + value: "OrdEng" + }); + this.regexes = regexes; + } +} +exports.EnglishOrdinalExtractor = EnglishOrdinalExtractor; +class EnglishPercentageExtractor extends extractors$4.BasePercentageExtractor { + constructor() { + super(new EnglishNumberExtractor()); + } + initRegexes() { + let regexStrs = [ + englishNumeric.EnglishNumeric.NumberWithSuffixPercentage, + englishNumeric.EnglishNumeric.NumberWithPrefixPercentage + ]; + return this.buildRegexes(regexStrs); + } +} +exports.EnglishPercentageExtractor = EnglishPercentageExtractor; + +}); + +unwrapExports(extractors$2); + +var extractors$6 = createCommonjsModule(function (module, exports) { +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); + + + + + +class SpanishNumberExtractor extends extractors$4.BaseNumberExtractor { + constructor(mode = models$2.NumberMode.Default) { + super(); + this.extractType = constants.Constants.SYS_NUM; + let regexes = new Array(); + // Add Cardinal + let cardExtract = null; + switch (mode) { + case models$2.NumberMode.PureNumber: + cardExtract = new SpanishCardinalExtractor(spanishNumeric.SpanishNumeric.PlaceHolderPureNumber); + break; + case models$2.NumberMode.Currency: + regexes.push({ regExp: recognizersText.RegExpUtility.getSafeRegExp(spanishNumeric.SpanishNumeric.CurrencyRegex, "gs"), value: "IntegerNum" }); + break; + case models$2.NumberMode.Default: + break; + } + if (cardExtract === null) { + cardExtract = new SpanishCardinalExtractor(); + } + cardExtract.regexes.forEach(r => regexes.push(r)); + // Add Fraction + let fracExtract = new SpanishFractionExtractor(); + fracExtract.regexes.forEach(r => regexes.push(r)); + this.regexes = regexes; + } +} +exports.SpanishNumberExtractor = SpanishNumberExtractor; +class SpanishCardinalExtractor extends extractors$4.BaseNumberExtractor { + constructor(placeholder = spanishNumeric.SpanishNumeric.PlaceHolderDefault) { + super(); + this.extractType = constants.Constants.SYS_NUM_CARDINAL; + let regexes = new Array(); + // Add Integer Regexes + let intExtract = new SpanishIntegerExtractor(placeholder); + intExtract.regexes.forEach(r => regexes.push(r)); + // Add Double Regexes + let doubleExtract = new SpanishDoubleExtractor(placeholder); + doubleExtract.regexes.forEach(r => regexes.push(r)); + this.regexes = regexes; + } +} +exports.SpanishCardinalExtractor = SpanishCardinalExtractor; +class SpanishIntegerExtractor extends extractors$4.BaseNumberExtractor { + constructor(placeholder = spanishNumeric.SpanishNumeric.PlaceHolderDefault) { + super(); + this.extractType = constants.Constants.SYS_NUM_INTEGER; + let regexes = new Array({ + regExp: recognizersText.RegExpUtility.getSafeRegExp(spanishNumeric.SpanishNumeric.NumbersWithPlaceHolder(placeholder), "gi"), + value: "IntegerNum" + }, { + regExp: recognizersText.RegExpUtility.getSafeRegExp(spanishNumeric.SpanishNumeric.NumbersWithSuffix, "gs"), + value: "IntegerNum" + }, { + regExp: this.generateLongFormatNumberRegexes(models$2.LongFormatType.integerNumDot, placeholder), + value: "IntegerNum" + }, { + regExp: this.generateLongFormatNumberRegexes(models$2.LongFormatType.integerNumBlank, placeholder), + value: "IntegerNum" + }, { + regExp: this.generateLongFormatNumberRegexes(models$2.LongFormatType.integerNumNoBreakSpace, placeholder), + value: "IntegerNum" + }, { + regExp: recognizersText.RegExpUtility.getSafeRegExp(spanishNumeric.SpanishNumeric.RoundNumberIntegerRegexWithLocks), + value: "IntegerNum" + }, { + regExp: recognizersText.RegExpUtility.getSafeRegExp(spanishNumeric.SpanishNumeric.NumbersWithDozenSuffix), + value: "IntegerNum" + }, { + regExp: recognizersText.RegExpUtility.getSafeRegExp(spanishNumeric.SpanishNumeric.AllIntRegexWithLocks), + value: "IntegerSpa" + }, { + regExp: recognizersText.RegExpUtility.getSafeRegExp(spanishNumeric.SpanishNumeric.AllIntRegexWithDozenSuffixLocks), + value: "IntegerSpa" + }); + this.regexes = regexes; + } +} +exports.SpanishIntegerExtractor = SpanishIntegerExtractor; +class SpanishDoubleExtractor extends extractors$4.BaseNumberExtractor { + constructor(placeholder = spanishNumeric.SpanishNumeric.PlaceHolderDefault) { + super(); + this.extractType = constants.Constants.SYS_NUM_DOUBLE; + let regexes = new Array({ + regExp: recognizersText.RegExpUtility.getSafeRegExp(spanishNumeric.SpanishNumeric.DoubleDecimalPointRegex(placeholder)), + value: "DoubleNum" + }, { + regExp: recognizersText.RegExpUtility.getSafeRegExp(spanishNumeric.SpanishNumeric.DoubleWithoutIntegralRegex(placeholder)), + value: "DoubleNum" + }, { + regExp: recognizersText.RegExpUtility.getSafeRegExp(spanishNumeric.SpanishNumeric.DoubleWithMultiplierRegex, "gs"), + value: "DoubleNum" + }, { + regExp: recognizersText.RegExpUtility.getSafeRegExp(spanishNumeric.SpanishNumeric.DoubleWithRoundNumber), + value: "DoubleNum" + }, { + regExp: recognizersText.RegExpUtility.getSafeRegExp(spanishNumeric.SpanishNumeric.DoubleAllFloatRegex), + value: "DoubleSpa" + }, { + regExp: recognizersText.RegExpUtility.getSafeRegExp(spanishNumeric.SpanishNumeric.DoubleExponentialNotationRegex), + value: "DoublePow" + }, { + regExp: recognizersText.RegExpUtility.getSafeRegExp(spanishNumeric.SpanishNumeric.DoubleCaretExponentialNotationRegex), + value: "DoublePow" + }, { + regExp: this.generateLongFormatNumberRegexes(models$2.LongFormatType.doubleNumDotComma, placeholder), + value: "DoubleNum" + }, { + regExp: this.generateLongFormatNumberRegexes(models$2.LongFormatType.doubleNumNoBreakSpaceComma, placeholder), + value: "DoubleNum" + }); + this.regexes = regexes; + } +} +exports.SpanishDoubleExtractor = SpanishDoubleExtractor; +class SpanishFractionExtractor extends extractors$4.BaseNumberExtractor { + constructor() { + super(); + this.extractType = constants.Constants.SYS_NUM_FRACTION; + let regexes = new Array({ + regExp: recognizersText.RegExpUtility.getSafeRegExp(spanishNumeric.SpanishNumeric.FractionNotationRegex), + value: "FracNum" + }, { + regExp: recognizersText.RegExpUtility.getSafeRegExp(spanishNumeric.SpanishNumeric.FractionNotationWithSpacesRegex), + value: "FracNum" + }, { + regExp: recognizersText.RegExpUtility.getSafeRegExp(spanishNumeric.SpanishNumeric.FractionNounRegex), + value: "FracSpa" + }, { + regExp: recognizersText.RegExpUtility.getSafeRegExp(spanishNumeric.SpanishNumeric.FractionNounWithArticleRegex), + value: "FracSpa" + }, { + regExp: recognizersText.RegExpUtility.getSafeRegExp(spanishNumeric.SpanishNumeric.FractionPrepositionRegex), + value: "FracSpa" + }); + this.regexes = regexes; + } +} +exports.SpanishFractionExtractor = SpanishFractionExtractor; +class SpanishOrdinalExtractor extends extractors$4.BaseNumberExtractor { + constructor() { + super(); + this.extractType = constants.Constants.SYS_NUM_ORDINAL; + let regexes = new Array({ + regExp: recognizersText.RegExpUtility.getSafeRegExp(spanishNumeric.SpanishNumeric.OrdinalSuffixRegex), + value: "OrdinalNum" + }, { + regExp: recognizersText.RegExpUtility.getSafeRegExp(spanishNumeric.SpanishNumeric.OrdinalNounRegex), + value: "OrdSpa" + }); + this.regexes = regexes; + } +} +exports.SpanishOrdinalExtractor = SpanishOrdinalExtractor; +class SpanishPercentageExtractor extends extractors$4.BasePercentageExtractor { + constructor() { + super(new SpanishNumberExtractor()); + } + initRegexes() { + let regexStrs = [ + spanishNumeric.SpanishNumeric.NumberWithPrefixPercentage + ]; + return this.buildRegexes(regexStrs); + } +} +exports.SpanishPercentageExtractor = SpanishPercentageExtractor; + +}); + +unwrapExports(extractors$6); + +var extractors$8 = createCommonjsModule(function (module, exports) { +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); + + + + + +class PortugueseNumberExtractor extends extractors$4.BaseNumberExtractor { + constructor(mode = models$2.NumberMode.Default) { + super(); + this.extractType = constants.Constants.SYS_NUM; + let regexes = new Array(); + // Add Cardinal + let cardExtract = null; + switch (mode) { + case models$2.NumberMode.PureNumber: + cardExtract = new PortugueseCardinalExtractor(portugueseNumeric.PortugueseNumeric.PlaceHolderPureNumber); + break; + case models$2.NumberMode.Currency: + regexes.push({ regExp: recognizersText.RegExpUtility.getSafeRegExp(portugueseNumeric.PortugueseNumeric.CurrencyRegex, "gs"), value: "IntegerNum" }); + break; + case models$2.NumberMode.Default: + break; + } + if (cardExtract === null) { + cardExtract = new PortugueseCardinalExtractor(); + } + cardExtract.regexes.forEach(r => regexes.push(r)); + // Add Fraction + let fracExtract = new PortugueseFractionExtractor(); + fracExtract.regexes.forEach(r => regexes.push(r)); + this.regexes = regexes; + } +} +exports.PortugueseNumberExtractor = PortugueseNumberExtractor; +class PortugueseCardinalExtractor extends extractors$4.BaseNumberExtractor { + constructor(placeholder = portugueseNumeric.PortugueseNumeric.PlaceHolderDefault) { + super(); + this.extractType = constants.Constants.SYS_NUM_CARDINAL; + let regexes = new Array(); + // Add Integer Regexes + let intExtract = new PortugueseIntegerExtractor(placeholder); + intExtract.regexes.forEach(r => regexes.push(r)); + // Add Double Regexes + let doubleExtract = new PortugueseDoubleExtractor(placeholder); + doubleExtract.regexes.forEach(r => regexes.push(r)); + this.regexes = regexes; + } +} +exports.PortugueseCardinalExtractor = PortugueseCardinalExtractor; +class PortugueseIntegerExtractor extends extractors$4.BaseNumberExtractor { + constructor(placeholder = portugueseNumeric.PortugueseNumeric.PlaceHolderDefault) { + super(); + this.extractType = constants.Constants.SYS_NUM_INTEGER; + let regexes = new Array({ + regExp: recognizersText.RegExpUtility.getSafeRegExp(portugueseNumeric.PortugueseNumeric.NumbersWithPlaceHolder(placeholder), "gi"), + value: "IntegerNum" + }, { + regExp: recognizersText.RegExpUtility.getSafeRegExp(portugueseNumeric.PortugueseNumeric.NumbersWithSuffix, "gs"), + value: "IntegerNum" + }, { + regExp: this.generateLongFormatNumberRegexes(models$2.LongFormatType.integerNumDot, placeholder), + value: "IntegerNum" + }, { + regExp: this.generateLongFormatNumberRegexes(models$2.LongFormatType.integerNumBlank, placeholder), + value: "IntegerNum" + }, { + regExp: this.generateLongFormatNumberRegexes(models$2.LongFormatType.integerNumNoBreakSpace, placeholder), + value: "IntegerNum" + }, { + regExp: recognizersText.RegExpUtility.getSafeRegExp(portugueseNumeric.PortugueseNumeric.RoundNumberIntegerRegexWithLocks), + value: "IntegerNum" + }, { + regExp: recognizersText.RegExpUtility.getSafeRegExp(portugueseNumeric.PortugueseNumeric.NumbersWithDozen2Suffix), + value: "IntegerNum" + }, { + regExp: recognizersText.RegExpUtility.getSafeRegExp(portugueseNumeric.PortugueseNumeric.NumbersWithDozenSuffix), + value: "IntegerNum" + }, { + regExp: recognizersText.RegExpUtility.getSafeRegExp(portugueseNumeric.PortugueseNumeric.AllIntRegexWithLocks), + value: "IntegerPor" + }, { + regExp: recognizersText.RegExpUtility.getSafeRegExp(portugueseNumeric.PortugueseNumeric.AllIntRegexWithDozenSuffixLocks), + value: "IntegerPor" + }); + this.regexes = regexes; + } +} +exports.PortugueseIntegerExtractor = PortugueseIntegerExtractor; +class PortugueseDoubleExtractor extends extractors$4.BaseNumberExtractor { + constructor(placeholder = portugueseNumeric.PortugueseNumeric.PlaceHolderDefault) { + super(); + this.extractType = constants.Constants.SYS_NUM_DOUBLE; + let regexes = new Array({ + regExp: recognizersText.RegExpUtility.getSafeRegExp(portugueseNumeric.PortugueseNumeric.DoubleDecimalPointRegex(placeholder)), + value: "DoubleNum" + }, { + regExp: recognizersText.RegExpUtility.getSafeRegExp(portugueseNumeric.PortugueseNumeric.DoubleWithoutIntegralRegex(placeholder)), + value: "DoubleNum" + }, { + regExp: recognizersText.RegExpUtility.getSafeRegExp(portugueseNumeric.PortugueseNumeric.DoubleWithMultiplierRegex, "gs"), + value: "DoubleNum" + }, { + regExp: recognizersText.RegExpUtility.getSafeRegExp(portugueseNumeric.PortugueseNumeric.DoubleWithRoundNumber), + value: "DoubleNum" + }, { + regExp: recognizersText.RegExpUtility.getSafeRegExp(portugueseNumeric.PortugueseNumeric.DoubleAllFloatRegex), + value: "DoublePor" + }, { + regExp: recognizersText.RegExpUtility.getSafeRegExp(portugueseNumeric.PortugueseNumeric.DoubleExponentialNotationRegex), + value: "DoublePow" + }, { + regExp: recognizersText.RegExpUtility.getSafeRegExp(portugueseNumeric.PortugueseNumeric.DoubleCaretExponentialNotationRegex), + value: "DoublePow" + }, { + regExp: this.generateLongFormatNumberRegexes(models$2.LongFormatType.doubleNumDotComma, placeholder), + value: "DoubleNum" + }, { + regExp: this.generateLongFormatNumberRegexes(models$2.LongFormatType.doubleNumNoBreakSpaceComma, placeholder), + value: "DoubleNum" + }); + this.regexes = regexes; + } +} +exports.PortugueseDoubleExtractor = PortugueseDoubleExtractor; +class PortugueseFractionExtractor extends extractors$4.BaseNumberExtractor { + constructor() { + super(); + this.extractType = constants.Constants.SYS_NUM_FRACTION; + let regexes = new Array({ + regExp: recognizersText.RegExpUtility.getSafeRegExp(portugueseNumeric.PortugueseNumeric.FractionNotationRegex), + value: "FracNum" + }, { + regExp: recognizersText.RegExpUtility.getSafeRegExp(portugueseNumeric.PortugueseNumeric.FractionNotationWithSpacesRegex), + value: "FracNum" + }, { + regExp: recognizersText.RegExpUtility.getSafeRegExp(portugueseNumeric.PortugueseNumeric.FractionNounRegex), + value: "FracPor" + }, { + regExp: recognizersText.RegExpUtility.getSafeRegExp(portugueseNumeric.PortugueseNumeric.FractionNounWithArticleRegex), + value: "FracPor" + }, { + regExp: recognizersText.RegExpUtility.getSafeRegExp(portugueseNumeric.PortugueseNumeric.FractionPrepositionRegex), + value: "FracPor" + }); + this.regexes = regexes; + } +} +exports.PortugueseFractionExtractor = PortugueseFractionExtractor; +class PortugueseOrdinalExtractor extends extractors$4.BaseNumberExtractor { + constructor() { + super(); + this.extractType = constants.Constants.SYS_NUM_ORDINAL; + let regexes = new Array({ + regExp: recognizersText.RegExpUtility.getSafeRegExp(portugueseNumeric.PortugueseNumeric.OrdinalSuffixRegex), + value: "OrdinalNum" + }, { + regExp: recognizersText.RegExpUtility.getSafeRegExp(portugueseNumeric.PortugueseNumeric.OrdinalEnglishRegex), + value: "OrdinalPor" + }); + this.regexes = regexes; + } +} +exports.PortugueseOrdinalExtractor = PortugueseOrdinalExtractor; +class PortuguesePercentageExtractor extends extractors$4.BasePercentageExtractor { + constructor() { + super(new PortugueseNumberExtractor()); + } + initRegexes() { + let regexStrs = [ + portugueseNumeric.PortugueseNumeric.NumberWithSuffixPercentage + ]; + return this.buildRegexes(regexStrs); + } +} +exports.PortuguesePercentageExtractor = PortuguesePercentageExtractor; + +}); + +unwrapExports(extractors$8); + +var extractors$10 = createCommonjsModule(function (module, exports) { +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); + + + + + +class FrenchNumberExtractor extends extractors$4.BaseNumberExtractor { + constructor(mode = models$2.NumberMode.Default) { + super(); + this.extractType = constants.Constants.SYS_NUM; + let regexes = new Array(); + // Add Cardinal + let cardExtract = null; + switch (mode) { + case models$2.NumberMode.PureNumber: + cardExtract = new FrenchCardinalExtractor(frenchNumeric.FrenchNumeric.PlaceHolderPureNumber); + break; + case models$2.NumberMode.Currency: + regexes.push({ regExp: recognizersText.RegExpUtility.getSafeRegExp(frenchNumeric.FrenchNumeric.CurrencyRegex, "gs"), value: "IntegerNum" }); + break; + case models$2.NumberMode.Default: + break; + } + if (cardExtract === null) { + cardExtract = new FrenchCardinalExtractor(); + } + cardExtract.regexes.forEach(r => regexes.push(r)); + // Add Fraction + let fracExtract = new FrenchFractionExtractor(); + fracExtract.regexes.forEach(r => regexes.push(r)); + this.regexes = regexes; + } +} +exports.FrenchNumberExtractor = FrenchNumberExtractor; +class FrenchCardinalExtractor extends extractors$4.BaseNumberExtractor { + constructor(placeholder = frenchNumeric.FrenchNumeric.PlaceHolderDefault) { + super(); + this.extractType = constants.Constants.SYS_NUM_CARDINAL; + let regexes = new Array(); + // Add Integer Regexes + let intExtract = new FrenchIntegerExtractor(placeholder); + intExtract.regexes.forEach(r => regexes.push(r)); + // Add Double Regexes + let doubleExtract = new FrenchDoubleExtractor(placeholder); + doubleExtract.regexes.forEach(r => regexes.push(r)); + this.regexes = regexes; + } +} +exports.FrenchCardinalExtractor = FrenchCardinalExtractor; +class FrenchIntegerExtractor extends extractors$4.BaseNumberExtractor { + constructor(placeholder = frenchNumeric.FrenchNumeric.PlaceHolderDefault) { + super(); + this.extractType = constants.Constants.SYS_NUM_INTEGER; + let regexes = new Array({ + regExp: recognizersText.RegExpUtility.getSafeRegExp(frenchNumeric.FrenchNumeric.NumbersWithPlaceHolder(placeholder), "gi"), + value: "IntegerNum" + }, { + regExp: recognizersText.RegExpUtility.getSafeRegExp(frenchNumeric.FrenchNumeric.NumbersWithSuffix, "gs"), + value: "IntegerNum" + }, { + regExp: this.generateLongFormatNumberRegexes(models$2.LongFormatType.integerNumDot, placeholder), + value: "IntegerNum" + }, { + regExp: this.generateLongFormatNumberRegexes(models$2.LongFormatType.integerNumBlank, placeholder), + value: "IntegerNum" + }, { + regExp: this.generateLongFormatNumberRegexes(models$2.LongFormatType.integerNumNoBreakSpace, placeholder), + value: "IntegerNum" + }, { + regExp: recognizersText.RegExpUtility.getSafeRegExp(frenchNumeric.FrenchNumeric.RoundNumberIntegerRegexWithLocks), + value: "IntegerNum" + }, { + regExp: recognizersText.RegExpUtility.getSafeRegExp(frenchNumeric.FrenchNumeric.NumbersWithDozenSuffix), + value: "IntegerNum" + }, { + regExp: recognizersText.RegExpUtility.getSafeRegExp(frenchNumeric.FrenchNumeric.AllIntRegexWithLocks), + value: "IntegerFr" + }, { + regExp: recognizersText.RegExpUtility.getSafeRegExp(frenchNumeric.FrenchNumeric.AllIntRegexWithDozenSuffixLocks), + value: "IntegerFr" + }); + this.regexes = regexes; + } +} +exports.FrenchIntegerExtractor = FrenchIntegerExtractor; +class FrenchDoubleExtractor extends extractors$4.BaseNumberExtractor { + constructor(placeholder = frenchNumeric.FrenchNumeric.PlaceHolderDefault) { + super(); + this.extractType = constants.Constants.SYS_NUM_DOUBLE; + let regexes = new Array({ + regExp: recognizersText.RegExpUtility.getSafeRegExp(frenchNumeric.FrenchNumeric.DoubleDecimalPointRegex(placeholder)), + value: "DoubleNum" + }, { + regExp: recognizersText.RegExpUtility.getSafeRegExp(frenchNumeric.FrenchNumeric.DoubleWithoutIntegralRegex(placeholder)), + value: "DoubleNum" + }, { + regExp: recognizersText.RegExpUtility.getSafeRegExp(frenchNumeric.FrenchNumeric.DoubleWithMultiplierRegex, "gs"), + value: "DoubleNum" + }, { + regExp: recognizersText.RegExpUtility.getSafeRegExp(frenchNumeric.FrenchNumeric.DoubleWithRoundNumber), + value: "DoubleNum" + }, { + regExp: recognizersText.RegExpUtility.getSafeRegExp(frenchNumeric.FrenchNumeric.DoubleAllFloatRegex), + value: "DoubleFr" + }, { + regExp: recognizersText.RegExpUtility.getSafeRegExp(frenchNumeric.FrenchNumeric.DoubleExponentialNotationRegex), + value: "DoublePow" + }, { + regExp: recognizersText.RegExpUtility.getSafeRegExp(frenchNumeric.FrenchNumeric.DoubleCaretExponentialNotationRegex), + value: "DoublePow" + }, { + regExp: this.generateLongFormatNumberRegexes(models$2.LongFormatType.doubleNumDotComma, placeholder), + value: "DoubleNum" + }, { + regExp: this.generateLongFormatNumberRegexes(models$2.LongFormatType.doubleNumNoBreakSpaceComma, placeholder), + value: "DoubleNum" + }); + this.regexes = regexes; + } +} +exports.FrenchDoubleExtractor = FrenchDoubleExtractor; +class FrenchFractionExtractor extends extractors$4.BaseNumberExtractor { + constructor() { + super(); + this.extractType = constants.Constants.SYS_NUM_FRACTION; + let regexes = new Array({ + regExp: recognizersText.RegExpUtility.getSafeRegExp(frenchNumeric.FrenchNumeric.FractionNotationRegex), + value: "FracNum" + }, { + regExp: recognizersText.RegExpUtility.getSafeRegExp(frenchNumeric.FrenchNumeric.FractionNotationWithSpacesRegex), + value: "FracNum" + }, { + regExp: recognizersText.RegExpUtility.getSafeRegExp(frenchNumeric.FrenchNumeric.FractionNounRegex), + value: "FracFr" + }, { + regExp: recognizersText.RegExpUtility.getSafeRegExp(frenchNumeric.FrenchNumeric.FractionNounWithArticleRegex), + value: "FracFr" + }, { + regExp: recognizersText.RegExpUtility.getSafeRegExp(frenchNumeric.FrenchNumeric.FractionPrepositionRegex), + value: "FracFr" + }); + this.regexes = regexes; + } +} +exports.FrenchFractionExtractor = FrenchFractionExtractor; +class FrenchOrdinalExtractor extends extractors$4.BaseNumberExtractor { + constructor() { + super(); + this.extractType = constants.Constants.SYS_NUM_ORDINAL; + let regexes = new Array({ + regExp: recognizersText.RegExpUtility.getSafeRegExp(frenchNumeric.FrenchNumeric.OrdinalSuffixRegex), + value: "OrdinalNum" + }, { + regExp: recognizersText.RegExpUtility.getSafeRegExp(frenchNumeric.FrenchNumeric.OrdinalFrenchRegex), + value: "OrdFr" + }); + this.regexes = regexes; + } +} +exports.FrenchOrdinalExtractor = FrenchOrdinalExtractor; +class FrenchPercentageExtractor extends extractors$4.BasePercentageExtractor { + constructor() { + super(new FrenchNumberExtractor()); + } + initRegexes() { + let regexStrs = [ + frenchNumeric.FrenchNumeric.NumberWithSuffixPercentage, + frenchNumeric.FrenchNumeric.NumberWithPrefixPercentage + ]; + return this.buildRegexes(regexStrs); + } +} +exports.FrenchPercentageExtractor = FrenchPercentageExtractor; + +}); + +unwrapExports(extractors$10); + +var extractors$12 = createCommonjsModule(function (module, exports) { +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); + + + + +var ChineseNumberExtractorMode; +(function (ChineseNumberExtractorMode) { + // Number extraction with an allow list that filters what numbers to extract. + ChineseNumberExtractorMode[ChineseNumberExtractorMode["Default"] = 0] = "Default"; + // Extract all number-related terms aggressively. + ChineseNumberExtractorMode[ChineseNumberExtractorMode["ExtractAll"] = 1] = "ExtractAll"; +})(ChineseNumberExtractorMode = exports.ChineseNumberExtractorMode || (exports.ChineseNumberExtractorMode = {})); +class ChineseNumberExtractor extends extractors$4.BaseNumberExtractor { + constructor(mode = ChineseNumberExtractorMode.Default) { + super(); + this.extractType = constants.Constants.SYS_NUM; + let regexes = new Array(); + // Add Cardinal + let cardExtract = new ChineseCardinalExtractor(mode); + cardExtract.regexes.forEach(r => regexes.push(r)); + // Add Fraction + let fracExtract = new ChineseFractionExtractor(); + fracExtract.regexes.forEach(r => regexes.push(r)); + this.regexes = regexes; + } +} +exports.ChineseNumberExtractor = ChineseNumberExtractor; +class ChineseCardinalExtractor extends extractors$4.BaseNumberExtractor { + constructor(mode = ChineseNumberExtractorMode.Default) { + super(); + this.extractType = constants.Constants.SYS_NUM_CARDINAL; + let regexes = new Array(); + // Add Integer Regexes + let intExtract = new ChineseIntegerExtractor(mode); + intExtract.regexes.forEach(r => regexes.push(r)); + // Add Double Regexes + let doubleExtract = new ChineseDoubleExtractor(); + doubleExtract.regexes.forEach(r => regexes.push(r)); + this.regexes = regexes; + } +} +exports.ChineseCardinalExtractor = ChineseCardinalExtractor; +class ChineseIntegerExtractor extends extractors$4.BaseNumberExtractor { + constructor(mode = ChineseNumberExtractorMode.Default) { + super(); + this.extractType = constants.Constants.SYS_NUM_INTEGER; + let regexes = new Array({ + regExp: recognizersText.RegExpUtility.getSafeRegExp(chineseNumeric.ChineseNumeric.NumbersSpecialsChars, "gi"), + value: "IntegerNum" + }, { + regExp: recognizersText.RegExpUtility.getSafeRegExp(chineseNumeric.ChineseNumeric.NumbersSpecialsCharsWithSuffix, "gs"), + value: "IntegerNum" + }, { + regExp: recognizersText.RegExpUtility.getSafeRegExp(chineseNumeric.ChineseNumeric.DottedNumbersSpecialsChar, "gis"), + value: "IntegerNum" + }, { + regExp: recognizersText.RegExpUtility.getSafeRegExp(chineseNumeric.ChineseNumeric.NumbersWithHalfDozen, "gis"), + value: "IntegerChs" + }, { + regExp: recognizersText.RegExpUtility.getSafeRegExp(chineseNumeric.ChineseNumeric.NumbersWithDozen, "gis"), + value: "IntegerChs" + }); + switch (mode) { + case ChineseNumberExtractorMode.Default: + regexes.push({ + regExp: recognizersText.RegExpUtility.getSafeRegExp(chineseNumeric.ChineseNumeric.NumbersWithAllowListRegex, "gi"), + value: "IntegerChs" + }); + break; + case ChineseNumberExtractorMode.ExtractAll: + regexes.push({ + regExp: recognizersText.RegExpUtility.getSafeRegExp(chineseNumeric.ChineseNumeric.NumbersAggressiveRegex, "gi"), + value: "IntegerChs" + }); + break; + } + this.regexes = regexes; + } +} +exports.ChineseIntegerExtractor = ChineseIntegerExtractor; +class ChineseDoubleExtractor extends extractors$4.BaseNumberExtractor { + constructor() { + super(); + this.extractType = constants.Constants.SYS_NUM_DOUBLE; + let regexes = new Array({ + regExp: recognizersText.RegExpUtility.getSafeRegExp(chineseNumeric.ChineseNumeric.DoubleSpecialsChars, "gis"), + value: "DoubleNum" + }, { + regExp: recognizersText.RegExpUtility.getSafeRegExp(chineseNumeric.ChineseNumeric.DoubleSpecialsCharsWithNegatives, "gis"), + value: "DoubleNum" + }, { + regExp: recognizersText.RegExpUtility.getSafeRegExp(chineseNumeric.ChineseNumeric.SimpleDoubleSpecialsChars, "gis"), + value: "DoubleNum" + }, { + regExp: recognizersText.RegExpUtility.getSafeRegExp(chineseNumeric.ChineseNumeric.DoubleWithMultiplierRegex, "gi"), + value: "DoubleNum" + }, { + regExp: recognizersText.RegExpUtility.getSafeRegExp(chineseNumeric.ChineseNumeric.DoubleWithThousandsRegex, "gi"), + value: "DoubleChs" + }, { + regExp: recognizersText.RegExpUtility.getSafeRegExp(chineseNumeric.ChineseNumeric.DoubleAllFloatRegex, "gi"), + value: "DoubleChs" + }, { + regExp: recognizersText.RegExpUtility.getSafeRegExp(chineseNumeric.ChineseNumeric.DoubleExponentialNotationRegex, "gis"), + value: "DoublePow" + }, { + regExp: recognizersText.RegExpUtility.getSafeRegExp(chineseNumeric.ChineseNumeric.DoubleScientificNotationRegex, "gis"), + value: "DoublePow" + }); + this.regexes = regexes; + } +} +exports.ChineseDoubleExtractor = ChineseDoubleExtractor; +class ChineseFractionExtractor extends extractors$4.BaseNumberExtractor { + constructor() { + super(); + this.extractType = constants.Constants.SYS_NUM_FRACTION; + let regexes = new Array({ + regExp: recognizersText.RegExpUtility.getSafeRegExp(chineseNumeric.ChineseNumeric.FractionNotationSpecialsCharsRegex, "gis"), + value: "FracNum" + }, { + regExp: recognizersText.RegExpUtility.getSafeRegExp(chineseNumeric.ChineseNumeric.FractionNotationRegex, "gis"), + value: "FracNum" + }, { + regExp: recognizersText.RegExpUtility.getSafeRegExp(chineseNumeric.ChineseNumeric.AllFractionNumber, "gi"), + value: "FracChs" + }); + this.regexes = regexes; + } +} +exports.ChineseFractionExtractor = ChineseFractionExtractor; +class ChineseOrdinalExtractor extends extractors$4.BaseNumberExtractor { + constructor() { + super(); + this.extractType = constants.Constants.SYS_NUM_ORDINAL; + let regexes = new Array({ + regExp: recognizersText.RegExpUtility.getSafeRegExp(chineseNumeric.ChineseNumeric.OrdinalRegex, "gi"), + value: "OrdinalChs" + }, { + regExp: recognizersText.RegExpUtility.getSafeRegExp(chineseNumeric.ChineseNumeric.OrdinalNumbersRegex, "gi"), + value: "OrdinalChs" + }); + this.regexes = regexes; + } +} +exports.ChineseOrdinalExtractor = ChineseOrdinalExtractor; +class ChinesePercentageExtractor extends extractors$4.BaseNumberExtractor { + constructor() { + super(); + this.extractType = constants.Constants.SYS_NUM_PERCENTAGE; + let regexes = new Array({ + regExp: recognizersText.RegExpUtility.getSafeRegExp(chineseNumeric.ChineseNumeric.PercentagePointRegex, "gi"), + value: "PerChs" + }, { + regExp: recognizersText.RegExpUtility.getSafeRegExp(chineseNumeric.ChineseNumeric.SimplePercentageRegex, "gi"), + value: "PerChs" + }, { + regExp: recognizersText.RegExpUtility.getSafeRegExp(chineseNumeric.ChineseNumeric.NumbersPercentagePointRegex, "gis"), + value: "PerNum" + }, { + regExp: recognizersText.RegExpUtility.getSafeRegExp(chineseNumeric.ChineseNumeric.NumbersPercentageWithSeparatorRegex, "gis"), + value: "PerNum" + }, { + regExp: recognizersText.RegExpUtility.getSafeRegExp(chineseNumeric.ChineseNumeric.NumbersPercentageWithMultiplierRegex, "gi"), + value: "PerNum" + }, { + regExp: recognizersText.RegExpUtility.getSafeRegExp(chineseNumeric.ChineseNumeric.FractionPercentagePointRegex, "gis"), + value: "PerNum" + }, { + regExp: recognizersText.RegExpUtility.getSafeRegExp(chineseNumeric.ChineseNumeric.FractionPercentageWithSeparatorRegex, "gis"), + value: "PerNum" + }, { + regExp: recognizersText.RegExpUtility.getSafeRegExp(chineseNumeric.ChineseNumeric.FractionPercentageWithMultiplierRegex, "gi"), + value: "PerNum" + }, { + regExp: recognizersText.RegExpUtility.getSafeRegExp(chineseNumeric.ChineseNumeric.SimpleNumbersPercentageRegex, "gis"), + value: "PerNum" + }, { + regExp: recognizersText.RegExpUtility.getSafeRegExp(chineseNumeric.ChineseNumeric.SimpleNumbersPercentageWithMultiplierRegex, "gi"), + value: "PerNum" + }, { + regExp: recognizersText.RegExpUtility.getSafeRegExp(chineseNumeric.ChineseNumeric.SimpleNumbersPercentagePointRegex, "gis"), + value: "PerNum" + }, { + regExp: recognizersText.RegExpUtility.getSafeRegExp(chineseNumeric.ChineseNumeric.IntegerPercentageRegex, "gis"), + value: "PerNum" + }, { + regExp: recognizersText.RegExpUtility.getSafeRegExp(chineseNumeric.ChineseNumeric.IntegerPercentageWithMultiplierRegex, "gi"), + value: "PerNum" + }, { + regExp: recognizersText.RegExpUtility.getSafeRegExp(chineseNumeric.ChineseNumeric.NumbersFractionPercentageRegex, "gis"), + value: "PerNum" + }, { + regExp: recognizersText.RegExpUtility.getSafeRegExp(chineseNumeric.ChineseNumeric.SimpleIntegerPercentageRegex, "gis"), + value: "PerNum" + }, { + regExp: recognizersText.RegExpUtility.getSafeRegExp(chineseNumeric.ChineseNumeric.NumbersFoldsPercentageRegex, "gis"), + value: "PerSpe" + }, { + regExp: recognizersText.RegExpUtility.getSafeRegExp(chineseNumeric.ChineseNumeric.FoldsPercentageRegex, "gis"), + value: "PerSpe" + }, { + regExp: recognizersText.RegExpUtility.getSafeRegExp(chineseNumeric.ChineseNumeric.SimpleFoldsPercentageRegex, "gis"), + value: "PerSpe" + }, { + regExp: recognizersText.RegExpUtility.getSafeRegExp(chineseNumeric.ChineseNumeric.SpecialsPercentageRegex, "gis"), + value: "PerSpe" + }, { + regExp: recognizersText.RegExpUtility.getSafeRegExp(chineseNumeric.ChineseNumeric.NumbersSpecialsPercentageRegex, "gis"), + value: "PerSpe" + }, { + regExp: recognizersText.RegExpUtility.getSafeRegExp(chineseNumeric.ChineseNumeric.SimpleSpecialsPercentageRegex, "gis"), + value: "PerSpe" + }, { + regExp: recognizersText.RegExpUtility.getSafeRegExp(chineseNumeric.ChineseNumeric.SpecialsFoldsPercentageRegex, "gis"), + value: "PerSpe" + }); + this.regexes = regexes; + } +} +exports.ChinesePercentageExtractor = ChinesePercentageExtractor; + +}); + +unwrapExports(extractors$12); + +var extractors$14 = createCommonjsModule(function (module, exports) { +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); + + + + +var JapaneseNumberExtractorMode; +(function (JapaneseNumberExtractorMode) { + // Number extraction with an allow list that filters what numbers to extract. + JapaneseNumberExtractorMode[JapaneseNumberExtractorMode["Default"] = 0] = "Default"; + // Extract all number-related terms aggressively. + JapaneseNumberExtractorMode[JapaneseNumberExtractorMode["ExtractAll"] = 1] = "ExtractAll"; +})(JapaneseNumberExtractorMode = exports.JapaneseNumberExtractorMode || (exports.JapaneseNumberExtractorMode = {})); +class JapaneseNumberExtractor extends extractors$4.BaseNumberExtractor { + constructor(mode = JapaneseNumberExtractorMode.Default) { + super(); + this.extractType = constants.Constants.SYS_NUM; + let regexes = new Array(); + // Add Cardinal + let cardExtract = new JapaneseCardinalExtractor(mode); + cardExtract.regexes.forEach(r => regexes.push(r)); + // Add Fraction + let fracExtract = new JapaneseFractionExtractor(); + fracExtract.regexes.forEach(r => regexes.push(r)); + this.regexes = regexes; + } +} +exports.JapaneseNumberExtractor = JapaneseNumberExtractor; +class JapaneseCardinalExtractor extends extractors$4.BaseNumberExtractor { + constructor(mode = JapaneseNumberExtractorMode.Default) { + super(); + this.extractType = constants.Constants.SYS_NUM_CARDINAL; + let regexes = new Array(); + // Add Integer Regexes + let intExtract = new JapaneseIntegerExtractor(mode); + intExtract.regexes.forEach(r => regexes.push(r)); + // Add Double Regexes + let doubleExtract = new JapaneseDoubleExtractor(); + doubleExtract.regexes.forEach(r => regexes.push(r)); + this.regexes = regexes; + } +} +exports.JapaneseCardinalExtractor = JapaneseCardinalExtractor; +class JapaneseIntegerExtractor extends extractors$4.BaseNumberExtractor { + constructor(mode = JapaneseNumberExtractorMode.Default) { + super(); + this.extractType = constants.Constants.SYS_NUM_INTEGER; + let regexes = new Array({ + regExp: recognizersText.RegExpUtility.getSafeRegExp(japaneseNumeric.JapaneseNumeric.NumbersSpecialsChars, "gi"), + value: "IntegerNum" + }, { + regExp: recognizersText.RegExpUtility.getSafeRegExp(japaneseNumeric.JapaneseNumeric.NumbersSpecialsCharsWithSuffix, "gi"), + value: "IntegerNum" + }, { + regExp: recognizersText.RegExpUtility.getSafeRegExp(japaneseNumeric.JapaneseNumeric.DottedNumbersSpecialsChar, "gi"), + value: "IntegerNum" + }, { + regExp: recognizersText.RegExpUtility.getSafeRegExp(japaneseNumeric.JapaneseNumeric.NumbersWithHalfDozen, "gi"), + value: "IntegerJpn" + }, { + regExp: recognizersText.RegExpUtility.getSafeRegExp(japaneseNumeric.JapaneseNumeric.NumbersWithDozen, "gi"), + value: "IntegerJpn" + }); + switch (mode) { + case JapaneseNumberExtractorMode.Default: + regexes.push({ + regExp: recognizersText.RegExpUtility.getSafeRegExp(japaneseNumeric.JapaneseNumeric.NumbersWithAllowListRegex, "gi"), + value: "IntegerJpn" + }); + break; + case JapaneseNumberExtractorMode.ExtractAll: + regexes.push({ + regExp: recognizersText.RegExpUtility.getSafeRegExp(japaneseNumeric.JapaneseNumeric.NumbersAggressiveRegex, "gi"), + value: "IntegerJpn" + }); + break; + } + this.regexes = regexes; + } +} +exports.JapaneseIntegerExtractor = JapaneseIntegerExtractor; +class JapaneseDoubleExtractor extends extractors$4.BaseNumberExtractor { + constructor() { + super(); + this.extractType = constants.Constants.SYS_NUM_DOUBLE; + let regexes = new Array({ + regExp: recognizersText.RegExpUtility.getSafeRegExp(japaneseNumeric.JapaneseNumeric.DoubleSpecialsChars, "gis"), + value: "DoubleNum" + }, { + regExp: recognizersText.RegExpUtility.getSafeRegExp(japaneseNumeric.JapaneseNumeric.DoubleSpecialsCharsWithNegatives, "gis"), + value: "DoubleNum" + }, { + regExp: recognizersText.RegExpUtility.getSafeRegExp(japaneseNumeric.JapaneseNumeric.SimpleDoubleSpecialsChars, "gis"), + value: "DoubleNum" + }, { + regExp: recognizersText.RegExpUtility.getSafeRegExp(japaneseNumeric.JapaneseNumeric.DoubleWithMultiplierRegex, "gis"), + value: "DoubleNum" + }, { + regExp: recognizersText.RegExpUtility.getSafeRegExp(japaneseNumeric.JapaneseNumeric.DoubleWithThousandsRegex, "gis"), + value: "DoubleJpn" + }, { + regExp: recognizersText.RegExpUtility.getSafeRegExp(japaneseNumeric.JapaneseNumeric.DoubleExponentialNotationRegex, "gis"), + value: "DoublePow" + }, { + regExp: recognizersText.RegExpUtility.getSafeRegExp(japaneseNumeric.JapaneseNumeric.DoubleScientificNotationRegex, "gis"), + value: "DoublePow" + }); + this.regexes = regexes; + } +} +exports.JapaneseDoubleExtractor = JapaneseDoubleExtractor; +class JapaneseFractionExtractor extends extractors$4.BaseNumberExtractor { + constructor() { + super(); + this.extractType = constants.Constants.SYS_NUM_FRACTION; + let regexes = new Array({ + regExp: recognizersText.RegExpUtility.getSafeRegExp(japaneseNumeric.JapaneseNumeric.FractionNotationSpecialsCharsRegex, "gis"), + value: "FracNum" + }, { + regExp: recognizersText.RegExpUtility.getSafeRegExp(japaneseNumeric.JapaneseNumeric.FractionNotationRegex, "gis"), + value: "FracNum" + }, { + regExp: recognizersText.RegExpUtility.getSafeRegExp(japaneseNumeric.JapaneseNumeric.AllFractionNumber, "gis"), + value: "FracJpn" + }); + this.regexes = regexes; + } +} +exports.JapaneseFractionExtractor = JapaneseFractionExtractor; +class JapaneseOrdinalExtractor extends extractors$4.BaseNumberExtractor { + constructor() { + super(); + this.extractType = constants.Constants.SYS_NUM_ORDINAL; + let regexes = new Array({ + regExp: recognizersText.RegExpUtility.getSafeRegExp(japaneseNumeric.JapaneseNumeric.OrdinalRegex, "gi"), + value: "OrdinalJpn" + }, { + regExp: recognizersText.RegExpUtility.getSafeRegExp(japaneseNumeric.JapaneseNumeric.OrdinalNumbersRegex, "gi"), + value: "OrdinalJpn" + }, { + regExp: recognizersText.RegExpUtility.getSafeRegExp(japaneseNumeric.JapaneseNumeric.NumbersFoldsPercentageRegex, "gi"), + value: "OrdinalJpn" + }); + this.regexes = regexes; + } +} +exports.JapaneseOrdinalExtractor = JapaneseOrdinalExtractor; +class JapanesePercentageExtractor extends extractors$4.BaseNumberExtractor { + constructor() { + super(); + this.extractType = constants.Constants.SYS_NUM_PERCENTAGE; + let regexes = new Array({ + regExp: recognizersText.RegExpUtility.getSafeRegExp(japaneseNumeric.JapaneseNumeric.SimplePercentageRegex, "gi"), + value: "PerJpn" + }, { + regExp: recognizersText.RegExpUtility.getSafeRegExp(japaneseNumeric.JapaneseNumeric.NumbersPercentagePointRegex, "gis"), + value: "PerNum" + }, { + regExp: recognizersText.RegExpUtility.getSafeRegExp(japaneseNumeric.JapaneseNumeric.NumbersPercentageWithSeparatorRegex, "gis"), + value: "PerNum" + }, { + regExp: recognizersText.RegExpUtility.getSafeRegExp(japaneseNumeric.JapaneseNumeric.NumbersPercentageWithMultiplierRegex, "gi"), + value: "PerNum" + }, { + regExp: recognizersText.RegExpUtility.getSafeRegExp(japaneseNumeric.JapaneseNumeric.SimpleNumbersPercentageWithMultiplierRegex, "gi"), + value: "PerNum" + }, { + regExp: recognizersText.RegExpUtility.getSafeRegExp(japaneseNumeric.JapaneseNumeric.SimpleIntegerPercentageRegex, "gis"), + value: "PerNum" + }, { + regExp: recognizersText.RegExpUtility.getSafeRegExp(japaneseNumeric.JapaneseNumeric.NumbersFoldsPercentageRegex, "gis"), + value: "PerSpe" + }, { + regExp: recognizersText.RegExpUtility.getSafeRegExp(japaneseNumeric.JapaneseNumeric.FoldsPercentageRegex, "gis"), + value: "PerSpe" + }, { + regExp: recognizersText.RegExpUtility.getSafeRegExp(japaneseNumeric.JapaneseNumeric.SimpleFoldsPercentageRegex, "gis"), + value: "PerSpe" + }, { + regExp: recognizersText.RegExpUtility.getSafeRegExp(japaneseNumeric.JapaneseNumeric.SpecialsPercentageRegex, "gis"), + value: "PerSpe" + }, { + regExp: recognizersText.RegExpUtility.getSafeRegExp(japaneseNumeric.JapaneseNumeric.NumbersSpecialsPercentageRegex, "gis"), + value: "PerSpe" + }, { + regExp: recognizersText.RegExpUtility.getSafeRegExp(japaneseNumeric.JapaneseNumeric.SimpleSpecialsPercentageRegex, "gis"), + value: "PerSpe" + }, { + regExp: recognizersText.RegExpUtility.getSafeRegExp(japaneseNumeric.JapaneseNumeric.SpecialsFoldsPercentageRegex, "gis"), + value: "PerSpe" + }); + this.regexes = regexes; + } +} +exports.JapanesePercentageExtractor = JapanesePercentageExtractor; + +}); + +unwrapExports(extractors$14); + +var numberRecognizer = createCommonjsModule(function (module, exports) { +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); + + + + + + + + + + + + + + + + +var NumberOptions; +(function (NumberOptions) { + NumberOptions[NumberOptions["None"] = 0] = "None"; +})(NumberOptions = exports.NumberOptions || (exports.NumberOptions = {})); +function recognizeNumber(query, culture, options = NumberOptions.None, fallbackToDefaultCulture = true) { + return recognizeByModel(recognizer => recognizer.getNumberModel(culture, fallbackToDefaultCulture), query, culture, options); +} +exports.recognizeNumber = recognizeNumber; +function recognizeOrdinal(query, culture, options = NumberOptions.None, fallbackToDefaultCulture = true) { + return recognizeByModel(recognizer => recognizer.getOrdinalModel(culture, fallbackToDefaultCulture), query, culture, options); +} +exports.recognizeOrdinal = recognizeOrdinal; +function recognizePercentage(query, culture, options = NumberOptions.None, fallbackToDefaultCulture = true) { + return recognizeByModel(recognizer => recognizer.getPercentageModel(culture, fallbackToDefaultCulture), query, culture, options); +} +exports.recognizePercentage = recognizePercentage; +function recognizeByModel(getModelFunc, query, culture, options) { + let recognizer = new NumberRecognizer(culture, options); + let model = getModelFunc(recognizer); + return model.parse(query); +} +class NumberRecognizer extends recognizersText.Recognizer { + constructor(culture, options = NumberOptions.None, lazyInitialization = false) { + super(culture, options, lazyInitialization); + } + InitializeConfiguration() { + //#region English + this.registerModel("NumberModel", culture$2.Culture.English, (options) => new models$2.NumberModel(agnosticNumberParser.AgnosticNumberParserFactory.getParser(agnosticNumberParser.AgnosticNumberParserType.Number, new parserConfiguration.EnglishNumberParserConfiguration()), new extractors$2.EnglishNumberExtractor(models$2.NumberMode.PureNumber))); + this.registerModel("OrdinalModel", culture$2.Culture.English, (options) => new models$2.OrdinalModel(agnosticNumberParser.AgnosticNumberParserFactory.getParser(agnosticNumberParser.AgnosticNumberParserType.Ordinal, new parserConfiguration.EnglishNumberParserConfiguration()), new extractors$2.EnglishOrdinalExtractor())); + this.registerModel("PercentModel", culture$2.Culture.English, (options) => new models$2.PercentModel(agnosticNumberParser.AgnosticNumberParserFactory.getParser(agnosticNumberParser.AgnosticNumberParserType.Percentage, new parserConfiguration.EnglishNumberParserConfiguration()), new extractors$2.EnglishPercentageExtractor())); + //#endregion + //#region Spanish + this.registerModel("NumberModel", culture$2.Culture.Spanish, (options) => new models$2.NumberModel(agnosticNumberParser.AgnosticNumberParserFactory.getParser(agnosticNumberParser.AgnosticNumberParserType.Number, new parserConfiguration$2.SpanishNumberParserConfiguration()), new extractors$6.SpanishNumberExtractor(models$2.NumberMode.PureNumber))); + this.registerModel("OrdinalModel", culture$2.Culture.Spanish, (options) => new models$2.OrdinalModel(agnosticNumberParser.AgnosticNumberParserFactory.getParser(agnosticNumberParser.AgnosticNumberParserType.Ordinal, new parserConfiguration$2.SpanishNumberParserConfiguration()), new extractors$6.SpanishOrdinalExtractor())); + this.registerModel("PercentModel", culture$2.Culture.Spanish, (options) => new models$2.PercentModel(agnosticNumberParser.AgnosticNumberParserFactory.getParser(agnosticNumberParser.AgnosticNumberParserType.Percentage, new parserConfiguration$2.SpanishNumberParserConfiguration()), new extractors$6.SpanishPercentageExtractor())); + //#endregion + //#region Portuguese + this.registerModel("NumberModel", culture$2.Culture.Portuguese, (options) => new models$2.NumberModel(agnosticNumberParser.AgnosticNumberParserFactory.getParser(agnosticNumberParser.AgnosticNumberParserType.Number, new parserConfiguration$4.PortugueseNumberParserConfiguration()), new extractors$8.PortugueseNumberExtractor(models$2.NumberMode.PureNumber))); + this.registerModel("OrdinalModel", culture$2.Culture.Portuguese, (options) => new models$2.OrdinalModel(agnosticNumberParser.AgnosticNumberParserFactory.getParser(agnosticNumberParser.AgnosticNumberParserType.Ordinal, new parserConfiguration$4.PortugueseNumberParserConfiguration()), new extractors$8.PortugueseOrdinalExtractor())); + this.registerModel("PercentModel", culture$2.Culture.Portuguese, (options) => new models$2.PercentModel(agnosticNumberParser.AgnosticNumberParserFactory.getParser(agnosticNumberParser.AgnosticNumberParserType.Percentage, new parserConfiguration$4.PortugueseNumberParserConfiguration()), new extractors$8.PortuguesePercentageExtractor())); + //#endregion + //#region Chinese + this.registerModel("NumberModel", culture$2.Culture.Chinese, (options) => new models$2.NumberModel(agnosticNumberParser.AgnosticNumberParserFactory.getParser(agnosticNumberParser.AgnosticNumberParserType.Number, new parserConfiguration$8.ChineseNumberParserConfiguration()), new extractors$12.ChineseNumberExtractor())); + this.registerModel("OrdinalModel", culture$2.Culture.Chinese, (options) => new models$2.OrdinalModel(agnosticNumberParser.AgnosticNumberParserFactory.getParser(agnosticNumberParser.AgnosticNumberParserType.Ordinal, new parserConfiguration$8.ChineseNumberParserConfiguration()), new extractors$12.ChineseOrdinalExtractor())); + this.registerModel("PercentModel", culture$2.Culture.Chinese, (options) => new models$2.PercentModel(agnosticNumberParser.AgnosticNumberParserFactory.getParser(agnosticNumberParser.AgnosticNumberParserType.Percentage, new parserConfiguration$8.ChineseNumberParserConfiguration()), new extractors$12.ChinesePercentageExtractor())); + //#endregion + //#region Japanese + this.registerModel("NumberModel", culture$2.Culture.Japanese, (options) => new models$2.NumberModel(agnosticNumberParser.AgnosticNumberParserFactory.getParser(agnosticNumberParser.AgnosticNumberParserType.Number, new parserConfiguration$10.JapaneseNumberParserConfiguration()), new extractors$14.JapaneseNumberExtractor())); + this.registerModel("OrdinalModel", culture$2.Culture.Japanese, (options) => new models$2.OrdinalModel(agnosticNumberParser.AgnosticNumberParserFactory.getParser(agnosticNumberParser.AgnosticNumberParserType.Ordinal, new parserConfiguration$10.JapaneseNumberParserConfiguration()), new extractors$14.JapaneseOrdinalExtractor())); + this.registerModel("PercentModel", culture$2.Culture.Japanese, (options) => new models$2.PercentModel(agnosticNumberParser.AgnosticNumberParserFactory.getParser(agnosticNumberParser.AgnosticNumberParserType.Percentage, new parserConfiguration$10.JapaneseNumberParserConfiguration()), new extractors$14.JapanesePercentageExtractor())); + //#endregion + //#region French + this.registerModel("NumberModel", culture$2.Culture.French, (options) => new models$2.NumberModel(agnosticNumberParser.AgnosticNumberParserFactory.getParser(agnosticNumberParser.AgnosticNumberParserType.Number, new parserConfiguration$6.FrenchNumberParserConfiguration()), new extractors$10.FrenchNumberExtractor(models$2.NumberMode.PureNumber))); + this.registerModel("OrdinalModel", culture$2.Culture.French, (options) => new models$2.OrdinalModel(agnosticNumberParser.AgnosticNumberParserFactory.getParser(agnosticNumberParser.AgnosticNumberParserType.Ordinal, new parserConfiguration$6.FrenchNumberParserConfiguration()), new extractors$10.FrenchOrdinalExtractor())); + this.registerModel("PercentModel", culture$2.Culture.French, (options) => new models$2.PercentModel(agnosticNumberParser.AgnosticNumberParserFactory.getParser(agnosticNumberParser.AgnosticNumberParserType.Percentage, new parserConfiguration$6.FrenchNumberParserConfiguration()), new extractors$10.FrenchPercentageExtractor())); + //#endregion + } + IsValidOptions(options) { + return options >= 0 && options <= NumberOptions.None; + } + getNumberModel(culture = null, fallbackToDefaultCulture = true) { + return this.getModel("NumberModel", culture, fallbackToDefaultCulture); + } + getOrdinalModel(culture = null, fallbackToDefaultCulture = true) { + return this.getModel("OrdinalModel", culture, fallbackToDefaultCulture); + } + getPercentageModel(culture = null, fallbackToDefaultCulture = true) { + return this.getModel("PercentModel", culture, fallbackToDefaultCulture); + } +} +exports.default = NumberRecognizer; + +}); + +unwrapExports(numberRecognizer); + +var recognizersTextNumber = createCommonjsModule(function (module, exports) { +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); + +exports.NumberRecognizer = numberRecognizer.default; +exports.NumberOptions = numberRecognizer.NumberOptions; +exports.recognizeNumber = numberRecognizer.recognizeNumber; +exports.recognizeOrdinal = numberRecognizer.recognizeOrdinal; +exports.recognizePercentage = numberRecognizer.recognizePercentage; + +exports.Culture = culture$2.Culture; +exports.CultureInfo = culture$2.CultureInfo; + +exports.FormatUtility = recognizersText.FormatUtility; +exports.StringUtility = recognizersText.StringUtility; +exports.Match = recognizersText.Match; +exports.RegExpUtility = recognizersText.RegExpUtility; + +exports.BaseNumbers = baseNumbers.BaseNumbers; + +exports.EnglishNumeric = englishNumeric.EnglishNumeric; + +exports.SpanishNumeric = spanishNumeric.SpanishNumeric; + +exports.FrenchNumeric = frenchNumeric.FrenchNumeric; + +exports.ChineseNumeric = chineseNumeric.ChineseNumeric; + +exports.JapaneseNumeric = japaneseNumeric.JapaneseNumeric; + +exports.Constants = constants.Constants; + +exports.BaseNumberExtractor = extractors$4.BaseNumberExtractor; +exports.BasePercentageExtractor = extractors$4.BasePercentageExtractor; + +exports.NumberMode = models$2.NumberMode; +exports.LongFormatType = models$2.LongFormatType; +exports.AbstractNumberModel = models$2.AbstractNumberModel; +exports.NumberModel = models$2.NumberModel; +exports.OrdinalModel = models$2.OrdinalModel; +exports.PercentModel = models$2.PercentModel; + +exports.AgnosticNumberParserType = agnosticNumberParser.AgnosticNumberParserType; +exports.AgnosticNumberParserFactory = agnosticNumberParser.AgnosticNumberParserFactory; + +exports.BaseNumberParser = parsers$2.BaseNumberParser; +exports.BasePercentageParser = parsers$2.BasePercentageParser; + +exports.EnglishCardinalExtractor = extractors$2.EnglishCardinalExtractor; +exports.EnglishDoubleExtractor = extractors$2.EnglishDoubleExtractor; +exports.EnglishFractionExtractor = extractors$2.EnglishFractionExtractor; +exports.EnglishIntegerExtractor = extractors$2.EnglishIntegerExtractor; +exports.EnglishNumberExtractor = extractors$2.EnglishNumberExtractor; +exports.EnglishOrdinalExtractor = extractors$2.EnglishOrdinalExtractor; +exports.EnglishPercentageExtractor = extractors$2.EnglishPercentageExtractor; + +exports.EnglishNumberParserConfiguration = parserConfiguration.EnglishNumberParserConfiguration; + +exports.SpanishCardinalExtractor = extractors$6.SpanishCardinalExtractor; +exports.SpanishDoubleExtractor = extractors$6.SpanishDoubleExtractor; +exports.SpanishFractionExtractor = extractors$6.SpanishFractionExtractor; +exports.SpanishIntegerExtractor = extractors$6.SpanishIntegerExtractor; +exports.SpanishNumberExtractor = extractors$6.SpanishNumberExtractor; +exports.SpanishOrdinalExtractor = extractors$6.SpanishOrdinalExtractor; +exports.SpanishPercentageExtractor = extractors$6.SpanishPercentageExtractor; + +exports.SpanishNumberParserConfiguration = parserConfiguration$2.SpanishNumberParserConfiguration; + +exports.PortugueseCardinalExtractor = extractors$8.PortugueseCardinalExtractor; +exports.PortugueseDoubleExtractor = extractors$8.PortugueseDoubleExtractor; +exports.PortugueseFractionExtractor = extractors$8.PortugueseFractionExtractor; +exports.PortugueseIntegerExtractor = extractors$8.PortugueseIntegerExtractor; +exports.PortugueseNumberExtractor = extractors$8.PortugueseNumberExtractor; +exports.PortugueseOrdinalExtractor = extractors$8.PortugueseOrdinalExtractor; +exports.PortuguesePercentageExtractor = extractors$8.PortuguesePercentageExtractor; + +exports.PortugueseNumberParserConfiguration = parserConfiguration$4.PortugueseNumberParserConfiguration; + +exports.FrenchCardinalExtractor = extractors$10.FrenchCardinalExtractor; +exports.FrenchDoubleExtractor = extractors$10.FrenchDoubleExtractor; +exports.FrenchFractionExtractor = extractors$10.FrenchFractionExtractor; +exports.FrenchIntegerExtractor = extractors$10.FrenchIntegerExtractor; +exports.FrenchNumberExtractor = extractors$10.FrenchNumberExtractor; +exports.FrenchOrdinalExtractor = extractors$10.FrenchOrdinalExtractor; +exports.FrenchPercentageExtractor = extractors$10.FrenchPercentageExtractor; + +exports.FrenchNumberParserConfiguration = parserConfiguration$6.FrenchNumberParserConfiguration; + +exports.ChineseCardinalExtractor = extractors$12.ChineseCardinalExtractor; +exports.ChineseDoubleExtractor = extractors$12.ChineseDoubleExtractor; +exports.ChineseFractionExtractor = extractors$12.ChineseFractionExtractor; +exports.ChineseIntegerExtractor = extractors$12.ChineseIntegerExtractor; +exports.ChineseNumberExtractor = extractors$12.ChineseNumberExtractor; +exports.ChineseOrdinalExtractor = extractors$12.ChineseOrdinalExtractor; +exports.ChinesePercentageExtractor = extractors$12.ChinesePercentageExtractor; +exports.ChineseNumberExtractorMode = extractors$12.ChineseNumberExtractorMode; + +exports.ChineseNumberParserConfiguration = parserConfiguration$8.ChineseNumberParserConfiguration; + +exports.JapaneseCardinalExtractor = extractors$14.JapaneseCardinalExtractor; +exports.JapaneseDoubleExtractor = extractors$14.JapaneseDoubleExtractor; +exports.JapaneseFractionExtractor = extractors$14.JapaneseFractionExtractor; +exports.JapaneseIntegerExtractor = extractors$14.JapaneseIntegerExtractor; +exports.JapaneseNumberExtractor = extractors$14.JapaneseNumberExtractor; +exports.JapaneseOrdinalExtractor = extractors$14.JapaneseOrdinalExtractor; +exports.JapanesePercentageExtractor = extractors$14.JapanesePercentageExtractor; +exports.JapaneseNumberExtractorMode = extractors$14.JapaneseNumberExtractorMode; + +exports.JapaneseNumberParserConfiguration = parserConfiguration$10.JapaneseNumberParserConfiguration; + +}); + +unwrapExports(recognizersTextNumber); + +var models$4 = createCommonjsModule(function (module, exports) { +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); + +var CompositeEntityType; +(function (CompositeEntityType) { + CompositeEntityType[CompositeEntityType["Age"] = 0] = "Age"; + CompositeEntityType[CompositeEntityType["Currency"] = 1] = "Currency"; + CompositeEntityType[CompositeEntityType["Dimension"] = 2] = "Dimension"; + CompositeEntityType[CompositeEntityType["Temperature"] = 3] = "Temperature"; +})(CompositeEntityType = exports.CompositeEntityType || (exports.CompositeEntityType = {})); +class AbstractNumberWithUnitModel { + constructor(extractorParsersMap) { + this.extractorParsersMap = extractorParsersMap; + } + parse(query) { + query = recognizersText.FormatUtility.preProcess(query, false); + let extractionResults = new Array(); + for (let kv of this.extractorParsersMap.entries()) { + let extractor = kv[0]; + let parser = kv[1]; + let extractResults = extractor.extract(query); + let parseResults = []; + for (let i = 0; i < extractResults.length; i++) { + let r = parser.parse(extractResults[i]); + if (r.value !== null) { + if (r.value instanceof Array) { + for (let j = 0; j < r.value.length; j++) { + parseResults.push(r.value[j]); + } + } + else { + parseResults.push(r); + } + } + } + let modelResults = parseResults.map(o => ({ + start: o.start, + end: o.start + o.length - 1, + resolution: this.getResolution(o.value), + text: o.text, + typeName: this.modelTypeName + })); + modelResults.forEach(result => { + let bAdd = true; + extractionResults.forEach(extractionResult => { + if (extractionResult.start === result.start && extractionResult.end === result.end) { + bAdd = false; + } + }); + if (bAdd) { + extractionResults.push(result); + } + }); + } + return extractionResults; + } + getResolution(data) { + if (typeof data === 'undefined') + return null; + let result = typeof data === "string" + ? { value: data.toString() } + : { value: data.number, unit: data.unit }; + if (data.isoCurrency) { + result['isoCurrency'] = data.isoCurrency; + } + return result; + } +} +exports.AbstractNumberWithUnitModel = AbstractNumberWithUnitModel; +class AgeModel extends AbstractNumberWithUnitModel { + constructor() { + super(...arguments); + this.modelTypeName = "age"; + } +} +exports.AgeModel = AgeModel; +class CurrencyModel extends AbstractNumberWithUnitModel { + constructor() { + super(...arguments); + this.modelTypeName = "currency"; + } +} +exports.CurrencyModel = CurrencyModel; +class DimensionModel extends AbstractNumberWithUnitModel { + constructor() { + super(...arguments); + this.modelTypeName = "dimension"; + } +} +exports.DimensionModel = DimensionModel; +class TemperatureModel extends AbstractNumberWithUnitModel { + constructor() { + super(...arguments); + this.modelTypeName = "temperature"; + } +} +exports.TemperatureModel = TemperatureModel; + +}); + +unwrapExports(models$4); + +var baseUnits = createCommonjsModule(function (module, exports) { +"use strict"; +// ------------------------------------------------------------------------------ +// +// This code was generated by a tool. +// Changes to this file may cause incorrect behavior and will be lost if +// the code is regenerated. +// +// ------------------------------------------------------------------------------ +Object.defineProperty(exports, "__esModule", { value: true }); +var BaseUnits; +(function (BaseUnits) { + BaseUnits.HourRegex = `(?00|01|02|03|04|05|06|07|08|09|0|10|11|12|13|14|15|16|17|18|19|20|21|22|23|24|1|2|3|4|5|6|7|8|9)(h)?`; + BaseUnits.MinuteRegex = `(?00|01|02|03|04|05|06|07|08|09|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|0|1|2|3|4|5|6|7|8|9)(?!\\d)`; + BaseUnits.SecondRegex = `(?00|01|02|03|04|05|06|07|08|09|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|0|1|2|3|4|5|6|7|8|9)`; + BaseUnits.PmNonUnitRegex = `(${BaseUnits.HourRegex}\\s*:\\s*${BaseUnits.MinuteRegex}(\\s*:\\s*${BaseUnits.SecondRegex})?\\s*pm)`; + BaseUnits.AmbiguousTimeTerm = 'pm'; +})(BaseUnits = exports.BaseUnits || (exports.BaseUnits = {})); + +}); + +unwrapExports(baseUnits); + +var constants$2 = createCommonjsModule(function (module, exports) { +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); + +class Constants { +} +Constants.SYS_UNIT = "builtin.unit"; +Constants.SYS_UNIT_DIMENSION = "builtin.unit.dimension"; +Constants.SYS_UNIT_AGE = "builtin.unit.age"; +Constants.SYS_UNIT_AREA = "builtin.unit.area"; +Constants.SYS_UNIT_CURRENCY = "builtin.unit.currency"; +Constants.SYS_UNIT_LENGTH = "builtin.unit.length"; +Constants.SYS_UNIT_SPEED = "builtin.unit.speed"; +Constants.SYS_UNIT_TEMPERATURE = "builtin.unit.temperature"; +Constants.SYS_UNIT_VOLUME = "builtin.unit.volume"; +Constants.SYS_UNIT_WEIGHT = "builtin.unit.weight"; +Constants.SYS_NUM = "builtin.num"; +// For cases like '2:00 pm', both 'pm' and '00 pm' are not dimension +Constants.AMBIGUOUS_TIME_TERM = baseUnits.BaseUnits.AmbiguousTimeTerm; +// For currencies without ISO codes, we use internal values prefixed by '_'. +// These values should never be present in parse output. +Constants.FAKE_ISO_CODE_PREFIX = "_"; +exports.Constants = Constants; + +}); + +unwrapExports(constants$2); + +/** + * lodash (Custom Build) + * Build: `lodash modularize exports="npm" -o ./` + * Copyright jQuery Foundation and other contributors + * Released under MIT license + * Based on Underscore.js 1.8.3 + * Copyright Jeremy Ashkenas, DocumentCloud and Investigative Reporters & Editors + */ + +/** `Object#toString` result references. */ +var symbolTag$2 = '[object Symbol]'; + +/** Used for built-in method references. */ +var objectProto$2 = Object.prototype; + +/** + * Used to resolve the + * [`toStringTag`](http://ecma-international.org/ecma-262/6.0/#sec-object.prototype.tostring) + * of values. + */ +var objectToString$2 = objectProto$2.toString; + +/** + * The base implementation of methods like `_.max` and `_.min` which accepts a + * `comparator` to determine the extremum value. + * + * @private + * @param {Array} array The array to iterate over. + * @param {Function} iteratee The iteratee invoked per iteration. + * @param {Function} comparator The comparator used to compare values. + * @returns {*} Returns the extremum value. + */ +function baseExtremum(array, iteratee, comparator) { + var index = -1, + length = array.length; + + while (++index < length) { + var value = array[index], + current = iteratee(value); + + if (current != null && (computed === undefined + ? (current === current && !isSymbol$2(current)) + : comparator(current, computed) + )) { + var computed = current, + result = value; + } + } + return result; +} + +/** + * The base implementation of `_.gt` which doesn't coerce arguments to numbers. + * + * @private + * @param {*} value The value to compare. + * @param {*} other The other value to compare. + * @returns {boolean} Returns `true` if `value` is greater than `other`, + * else `false`. + */ +function baseGt(value, other) { + return value > other; +} + +/** + * Checks if `value` is object-like. A value is object-like if it's not `null` + * and has a `typeof` result of "object". + * + * @static + * @memberOf _ + * @since 4.0.0 + * @category Lang + * @param {*} value The value to check. + * @returns {boolean} Returns `true` if `value` is object-like, else `false`. + * @example + * + * _.isObjectLike({}); + * // => true + * + * _.isObjectLike([1, 2, 3]); + * // => true + * + * _.isObjectLike(_.noop); + * // => false + * + * _.isObjectLike(null); + * // => false + */ +function isObjectLike$2(value) { + return !!value && typeof value == 'object'; +} + +/** + * Checks if `value` is classified as a `Symbol` primitive or object. + * + * @static + * @memberOf _ + * @since 4.0.0 + * @category Lang + * @param {*} value The value to check. + * @returns {boolean} Returns `true` if `value` is correctly classified, + * else `false`. + * @example + * + * _.isSymbol(Symbol.iterator); + * // => true + * + * _.isSymbol('abc'); + * // => false + */ +function isSymbol$2(value) { + return typeof value == 'symbol' || + (isObjectLike$2(value) && objectToString$2.call(value) == symbolTag$2); +} + +/** + * This method returns the first argument given to it. + * + * @static + * @since 0.1.0 + * @memberOf _ + * @category Util + * @param {*} value Any value. + * @returns {*} Returns `value`. + * @example + * + * var object = { 'user': 'fred' }; + * + * _.identity(object) === object; + * // => true + */ +function identity(value) { + return value; +} + +/** + * Computes the maximum value of `array`. If `array` is empty or falsey, + * `undefined` is returned. + * + * @static + * @since 0.1.0 + * @memberOf _ + * @category Math + * @param {Array} array The array to iterate over. + * @returns {*} Returns the maximum value. + * @example + * + * _.max([4, 2, 8, 6]); + * // => 8 + * + * _.max([]); + * // => undefined + */ +function max(array) { + return (array && array.length) + ? baseExtremum(array, identity, baseGt) + : undefined; +} + +var lodash_max = max; + +var extractors$16 = createCommonjsModule(function (module, exports) { +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); + + + + + +class NumberWithUnitExtractor { + constructor(config) { + this.config = config; + if (this.config.suffixList && this.config.suffixList.size > 0) { + this.suffixRegexes = this.buildRegexFromSet(Array.from(this.config.suffixList.values())); + } + else { + this.suffixRegexes = new Set(); // empty + } + if (this.config.prefixList && this.config.prefixList.size > 0) { + let maxLength = 0; + this.config.prefixList.forEach(preMatch => { + let len = lodash_max(preMatch.split('|').filter(s => s && s.length).map(s => s.length)); + maxLength = maxLength >= len ? maxLength : len; + }); + // 2 is the maxium length of spaces. + this.maxPrefixMatchLen = maxLength + 2; + this.prefixRegexes = this.buildRegexFromSet(Array.from(this.config.prefixList.values())); + } + else { + this.prefixRegexes = new Set(); // empty + } + this.separateRegex = this.buildSeparateRegexFromSet(); + } + extract(source) { + if (!this.preCheckStr(source)) { + return new Array(); + } + let mappingPrefix = new Map(); + let matched = new Array(source.length); + let numbers = this.config.unitNumExtractor.extract(source); + let result = new Array(); + let sourceLen = source.length; + /* Mix prefix and numbers, make up a prefix-number combination */ + if (this.maxPrefixMatchLen !== 0) { + numbers.forEach(num => { + if (num.start === undefined || num.length === undefined) { + return; + } + let maxFindPref = Math.min(this.maxPrefixMatchLen, num.start); + if (maxFindPref === 0) { + return; + } + /* Scan from left to right , find the longest match */ + let leftStr = source.substring(num.start - maxFindPref, num.start - maxFindPref + maxFindPref); + + let lastIndex = leftStr.length; + let bestMatch = null; + this.prefixRegexes.forEach(regex => { + let collection = recognizersText.RegExpUtility.getMatches(regex, leftStr).filter(m => m.length); + if (collection.length === 0) { + return; + } + collection.forEach(match => { + if (leftStr.substring(match.index, lastIndex).trim() === match.value) { + if (bestMatch === null || bestMatch.index >= match.index) { + bestMatch = match; + } + } + }); + }); + if (bestMatch !== null) { + let unitStr = leftStr.substring(bestMatch.index, lastIndex); + mappingPrefix.set(num.start, { + offset: lastIndex - bestMatch.index, + unitString: unitStr + }); + } + }); + } + for (let num of numbers) { + if (num.start === undefined || num.length === undefined) { + continue; + } + let start = num.start; + let length = num.length; + let maxFindLen = sourceLen - start - length; + let prefixUnit = mappingPrefix.has(start) ? mappingPrefix.get(start) : null; + if (maxFindLen > 0) { + let rightSub = source.substring(start + length, start + length + maxFindLen); + let unitMatch = Array.from(this.suffixRegexes.values()).map(r => recognizersText.RegExpUtility.getMatches(r, rightSub)) + .filter(m => m.length > 0); + let maxlen = 0; + for (let i = 0; i < unitMatch.length; i++) { + for (let m of unitMatch[i]) { + if (m.length > 0) { + let endpos = m.index + m.length; + if (m.index >= 0) { + let midStr = rightSub.substring(0, Math.min(m.index, rightSub.length)); + if (maxlen < endpos && (recognizersText.StringUtility.isNullOrWhitespace(midStr) || midStr.trim() === this.config.connectorToken)) { + maxlen = endpos; + } + } + } + } + } + if (maxlen !== 0) { + for (let i = 0; i < length + maxlen; i++) { + matched[i + start] = true; + } + let substr = source.substring(start, start + length + maxlen); + let er = { + start: start, + length: length + maxlen, + text: substr, + type: this.config.extractType + }; + if (prefixUnit !== null) { + er.start -= prefixUnit.offset; + er.length += prefixUnit.offset; + er.text = prefixUnit.unitString + er.text; + } + /* Relative position will be used in Parser */ + num.start = start - er.start; + er.data = num; + let isDimensionFallsInPmTime = false; + if (er.type === constants$2.Constants.SYS_UNIT_DIMENSION) { + let nonUnitMatch = recognizersText.RegExpUtility.getMatches(this.config.pmNonUnitRegex, source); + nonUnitMatch.forEach(match => { + if (er.start >= match.index && er.start + er.length <= match.index + match.length) { + isDimensionFallsInPmTime = true; + } + }); + } + if (isDimensionFallsInPmTime) { + continue; + } + result.push(er); + continue; + } + } + if (prefixUnit !== null) { + let er = { + start: num.start - prefixUnit.offset, + length: num.length + prefixUnit.offset, + text: prefixUnit.unitString + num.text, + type: this.config.extractType + }; + /* Relative position will be used in Parser */ + num.start = start - er.start; + er.data = num; + result.push(er); + } + } + // extract Separate unit + if (this.separateRegex !== null) { + this.extractSeparateUnits(source, result); + } + return result; + } + validateUnit(source) { + return source.substring(0, 1) !== '-'; + } + preCheckStr(str) { + return str && str.length; + } + extractSeparateUnits(source, numDependResults) { + // Default is false + let matchResult = new Array(source.length); + numDependResults.forEach(numDependResult => { + let start = numDependResult.start; + let i = 0; + do { + matchResult[start + i++] = true; + } while (i < numDependResult.length); + }); + // Extract all SeparateUnits, then merge it with numDependResults + let matchCollection = recognizersText.RegExpUtility.getMatches(this.separateRegex, source); + if (matchCollection.length > 0) { + matchCollection.forEach(match => { + let i = 0; + while (i < match.length && !matchResult[match.index + i]) { + i++; + } + if (i === match.length) { + // Mark as extracted + for (let j = 0; j < i; j++) { + matchResult[j] = true; + } + let isDimensionFallsInPmTime = false; + if (match.value === constants$2.Constants.AMBIGUOUS_TIME_TERM) { + let nonUnitMatch = recognizersText.RegExpUtility.getMatches(this.config.pmNonUnitRegex, source); + nonUnitMatch.forEach(time => { + if (this.isDimensionFallsInTime(match, time)) { + isDimensionFallsInPmTime = true; + } + }); + } + if (isDimensionFallsInPmTime === false) { + numDependResults.push({ + start: match.index, + length: match.length, + text: match.value, + type: this.config.extractType, + data: null + }); + } + } + }); + } + } + buildRegexFromSet(collection, ignoreCase = true) { + return new Set(collection.map(regexString => { + let regexTokens = regexString.split('|').map(lodash_escaperegexp); + let pattern = `${this.config.buildPrefix}(${regexTokens.join('|')})${this.config.buildSuffix}`; + let options = "gs"; + if (ignoreCase) + options += "i"; + return recognizersText.RegExpUtility.getSafeRegExp(pattern, options); + })); + } + buildSeparateRegexFromSet(ignoreCase = true) { + let separateWords = new Set(); + if (this.config.prefixList && this.config.prefixList.size) { + for (let addWord of this.config.prefixList.values()) { + addWord.split('|').filter(s => s && s.length) + .filter(this.validateUnit) + .forEach(word => separateWords.add(word)); + } + } + if (this.config.suffixList && this.config.suffixList.size) { + for (let addWord of this.config.suffixList.values()) { + addWord.split('|').filter(s => s && s.length) + .filter(this.validateUnit) + .forEach(word => separateWords.add(word)); + } + } + if (this.config.ambiguousUnitList && this.config.ambiguousUnitList.length) { + for (let abandonWord of this.config.ambiguousUnitList) { + if (separateWords.has(abandonWord)) { + separateWords.delete(abandonWord); + } + } + } + let regexTokens = Array.from(separateWords.values()).map(lodash_escaperegexp); + if (regexTokens.length === 0) { + return null; + } + // Sort SeparateWords using descending length. + regexTokens = regexTokens.sort(this.dinoComparer); + let pattern = `${this.config.buildPrefix}(${regexTokens.join('|')})${this.config.buildSuffix}`; + let options = "gs"; + if (ignoreCase) + options += "i"; + return recognizersText.RegExpUtility.getSafeRegExp(pattern, options); + } + dinoComparer(x, y) { + if (x === null) { + if (y === null) { + // If x is null and y is null, they're + // equal. + return 0; + } + else { + // If x is null and y is not null, y + // is greater. + return 1; + } + } + else { + // If x is not null... + // + if (y === null) + // ...and y is null, x is greater. + { + return -1; + } + else { + // ...and y is not null, compare the + // lengths of the two strings. + // + let retval = y.length - x.length; + if (retval !== 0) { + // If the strings are not of equal length, + // the longer string is greater. + // + return retval; + } + else { + // If the strings are of equal length, + // sort them with ordinary string comparison. + // + let xl = x.toLowerCase(); + let yl = y.toLowerCase(); + if (xl < yl) { + return -1; + } + if (xl > yl) { + return 1; + } + return 0; + } + } + } + } + isDimensionFallsInTime(dimension, time) { + let isSubMatch = false; + if (dimension.index >= time.index && dimension.index + dimension.length <= time.index + time.length) { + isSubMatch = true; + } + return isSubMatch; + } +} +exports.NumberWithUnitExtractor = NumberWithUnitExtractor; +class BaseMergedUnitExtractor { + constructor(config) { + this.config = config; + this.innerExtractor = new NumberWithUnitExtractor(config); + } + extract(source) { + let result = new Array(); + if (this.config.extractType === constants$2.Constants.SYS_UNIT_CURRENCY) { + result = this.mergeCompoundUnits(source); + } + else { + result = this.innerExtractor.extract(source); + } + return result; + } + mergeCompoundUnits(source) { + let result = new Array(); + let ers = this.innerExtractor.extract(source); + this.MergePureNumber(source, ers); + let groups = []; + groups[0] = 0; + for (let i = 0; i < ers.length - 1; i++) { + if (ers[i].type !== ers[i + 1].type && ers[i].type !== recognizersTextNumber.Constants.SYS_NUM && ers[i + 1].type !== recognizersTextNumber.Constants.SYS_NUM) { + continue; + } + if (ers[i].data != null && ers[i].data.data != null && !ers[i].data.data.startsWith('Integer')) { + groups[i + 1] = groups[i] + 1; + continue; + } + let middleBegin = ers[i].start + ers[i].length; + let middleEnd = ers[i + 1].start; + let middleStr = source.substring(middleBegin, middleEnd).trim().toLowerCase(); + // Separated by whitespace + if (recognizersText.StringUtility.isNullOrEmpty(middleStr)) { + groups[i + 1] = groups[i]; + continue; + } + // Separated by connectors + let match = recognizersText.RegExpUtility.getMatches(this.config.compoundUnitConnectorRegex, middleStr).pop(); + if (match && match.index === 0 && match.length === middleStr.length) { + groups[i + 1] = groups[i]; + } + else { + groups[i + 1] = groups[i] + 1; + } + } + for (let i = 0; i < ers.length; i++) { + if (i === 0 || groups[i] !== groups[i - 1]) { + let tmpInner = new recognizersText.ExtractResult(); + tmpInner.data = ers[i].data; + tmpInner.length = ers[i].length; + tmpInner.start = ers[i].start; + tmpInner.text = ers[i].text; + tmpInner.type = ers[i].type; + let tmpExtractResult = ers[i]; + tmpExtractResult.data = new Array(); + tmpExtractResult.data.push(tmpInner); + result.push(tmpExtractResult); + } + // Reduce extract results in same group + if (i + 1 < ers.length && groups[i + 1] === groups[i]) { + let group = groups[i]; + let periodBegin = result[group].start; + let periodEnd = ers[i + 1].start + ers[i + 1].length; + result[group].length = periodEnd - periodBegin; + result[group].text = source.substring(periodBegin, periodEnd); + result[group].type = constants$2.Constants.SYS_UNIT_CURRENCY; + result[group].data.push(ers[i + 1]); + } + } + for (let i = 0; i < result.length; i++) { + let innerData = result[i].data; + if (innerData && innerData.length === 1) { + result[i] = innerData[0]; + } + } + result = result.filter(er => er.type !== recognizersTextNumber.Constants.SYS_NUM); + return result; + } + MergePureNumber(source, result) { + let numErs = this.config.unitNumExtractor.extract(source); + let unitNumbers = new Array(); + let i; + let j; + for (i = 0, j = 0; i < numErs.length; i++) { + let hasBehindExtraction = false; + while (j < result.length && result[j].start + result[j].length < numErs[i].start) { + hasBehindExtraction = true; + j++; + } + if (!hasBehindExtraction) { + continue; + } + let middleBegin = result[j - 1].start + result[j - 1].length; + let middleEnd = numErs[i].start; + let middleStr = source.substring(middleBegin, middleEnd).trim().toLowerCase(); + // Separated by whitespace + if (recognizersText.StringUtility.isNullOrEmpty(middleStr)) { + unitNumbers.push(numErs[i]); + continue; + } + // Separated by connectors + let match = recognizersText.RegExpUtility.getMatches(this.config.compoundUnitConnectorRegex, middleStr).pop(); + if (match && match.index === 0 && match.length === middleStr.length) { + unitNumbers.push(numErs[i]); + } + } + unitNumbers.forEach(extractResult => { + let overlap = false; + result.forEach(er => { + if (er.start <= extractResult.start && er.start + er.length >= extractResult.start) { + overlap = true; + } + }); + if (!overlap) { + result.push(extractResult); + } + }); + result.sort((x, y) => x.start - y.start); + } +} +exports.BaseMergedUnitExtractor = BaseMergedUnitExtractor; +class PrefixUnitResult { +} +exports.PrefixUnitResult = PrefixUnitResult; + +}); + +unwrapExports(extractors$16); + +/** + * lodash 3.0.0 (Custom Build) + * Build: `lodash modern modularize exports="npm" -o ./` + * Copyright 2012-2015 The Dojo Foundation + * Based on Underscore.js 1.7.0 + * Copyright 2009-2015 Jeremy Ashkenas, DocumentCloud and Investigative Reporters & Editors + * Available under MIT license + */ + +/** + * Gets the last element of `array`. + * + * @static + * @memberOf _ + * @category Array + * @param {Array} array The array to query. + * @returns {*} Returns the last element of `array`. + * @example + * + * _.last([1, 2, 3]); + * // => 3 + */ +function last(array) { + var length = array ? array.length : 0; + return length ? array[length - 1] : undefined; +} + +var lodash_last = last; + +var utilities$2 = createCommonjsModule(function (module, exports) { +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); + +class DictionaryUtils { + static bindDictionary(dictionary, source) { + if (dictionary === null) { + return; + } + dictionary.forEach((value, key) => { + if (recognizersText.StringUtility.isNullOrEmpty(key)) { + return; + } + this.bindUnitsString(source, key, value); + }); + } + static bindUnitsString(dictionary, key, source) { + let values = source.trim().split('|'); + values.forEach(token => { + if (recognizersText.StringUtility.isNullOrWhitespace(token) || dictionary.has(token)) { + return; + } + dictionary.set(token, key); + }); + } +} +exports.DictionaryUtils = DictionaryUtils; + +}); + +unwrapExports(utilities$2); + +var baseCurrency = createCommonjsModule(function (module, exports) { +"use strict"; +// ------------------------------------------------------------------------------ +// +// This code was generated by a tool. +// Changes to this file may cause incorrect behavior and will be lost if +// the code is regenerated. +// +// ------------------------------------------------------------------------------ +Object.defineProperty(exports, "__esModule", { value: true }); +var BaseCurrency; +(function (BaseCurrency) { + BaseCurrency.CurrencyFractionMapping = new Map([["CNY", "FEN|JIAO"], ["__D", "CENT"], ["RUB", "KOPEK"], ["AFN", "PUL"], ["EUR", "CENT"], ["ALL", "QINDARKE"], ["_ALP", "PENNY"], ["GBP", "PENNY"], ["_GGP", "PENNY"], ["DZD", "SANTEEM"], ["AOA", "CENTIMO"], ["ARS", "CENTAVO"], ["AMD", "LUMA"], ["AWG", "CENT"], ["_AP", "PENNY"], ["SHP", "PENNY"], ["AUD", "CENT"], ["AZN", "QƏPIK"], ["BSD", "CENT"], ["BHD", "FILS"], ["BDT", "POISHA"], ["BBD", "CENT"], ["BYN", "KAPYEYKA"], ["BZD", "CENT"], ["XOF", "CENTIME"], ["BMD", "CENT"], ["BTN", "CHETRUM"], ["INR", "PAISA"], ["BOB", "CENTAVO"], ["USD", "CENT"], ["BAM", "FENING"], ["BWP", "THEBE"], ["BRL", "CENTAVO"], ["_BD", "CENT"], ["BND", "SEN"], ["SGD", "CENT"], ["BGN", "STOTINKA"], ["BIF", "CENTIME"], ["KHR", "SEN"], ["XAF", "CENTIME"], ["CAD", "CENT"], ["CVE", "CENTAVO"], ["KYD", "CENT"], ["CLP", "CENTAVO"], ["COP", "CENTAVO"], ["KMF", "CENTIME"], ["CDF", "CENTIME"], ["NZD", "CENT"], ["_CKD", "CENT"], ["CRC", "CENTIMO"], ["HRK", "LIPA"], ["CUC", "CENTAVO"], ["CUP", "CENTAVO"], ["CZK", "HALER"], ["DKK", "ØRE"], ["DJF", "CENTIME"], ["DOP", "CENTAVO"], ["EGP", "PIASTRE"], ["ERN", "CENT"], ["ETB", "SANTIM"], ["FKP", "PENNY"], ["_FOK", "OYRA"], ["FJD", "CENT"], ["XPF", "CENTIME"], ["GMD", "BUTUT"], ["GEL", "TETRI"], ["GHS", "PESEWA"], ["GIP", "PENNY"], ["GTQ", "CENTAVO"], ["GNF", "CENTIME"], ["GYD", "CENT"], ["HTG", "CENTIME"], ["HNL", "CENTAVO"], ["HKD", "CENT"], ["HUF", "FILLER"], ["ISK", "EYRIR"], ["IDR", "SEN"], ["IRR", "DINAR"], ["IQD", "FILS"], ["IMP", "PENNY"], ["ILS", "AGORA"], ["JMD", "CENT"], ["JPY", "SEN"], ["JEP", "PENNY"], ["JOD", "PIASTRE"], ["KZT", "TIIN"], ["KES", "CENT"], ["_KID", "CENT"], ["KPW", "CHON"], ["KRW", "JEON"], ["KWD", "FILS"], ["KGS", "TYIYN"], ["LAK", "ATT"], ["LBP", "PIASTRE"], ["LSL", "SENTE"], ["ZAR", "CENT"], ["LRD", "CENT"], ["LYD", "DIRHAM"], ["CHF", "RAPPEN"], ["MOP", "AVO"], ["MKD", "DENI"], ["MGA", "IRAIMBILANJA"], ["MWK", "TAMBALA"], ["MYR", "SEN"], ["MVR", "LAARI"], ["MRO", "KHOUMS"], ["MUR", "CENT"], ["MXN", "CENTAVO"], ["_MD", "CENT"], ["MDL", "BAN"], ["MNT", "MONGO"], ["MAD", "CENTIME"], ["MZN", "CENTAVO"], ["MMK", "PYA"], ["NAD", "CENT"], ["_ND", "CENT"], ["NPR", "PAISA"], ["NIO", "CENTAVO"], ["NGN", "KOBO"], ["_NID", "CENT"], ["TRY", "KURUS"], ["NOK", "ØRE"], ["OMR", "BAISA"], ["PKR", "PAISA"], ["_PD", "CENT"], ["PAB", "CENTESIMO"], ["PGK", "TOEA"], ["PYG", "CENTIMO"], ["PEN", "CENTIMO"], ["_PND", "CENT"], ["PLN", "GROSZ"], ["QAR", "DIRHAM"], ["RON", "BAN"], ["RWF", "CENTIME"], ["WST", "SENE"], ["STD", "CENTIMO"], ["SAR", "HALALA"], ["RSD", "PARA"], ["SCR", "CENT"], ["SLL", "CENT"], ["SBD", "CENT"], ["SOS", "CENT"], ["_SS", "CENT"], ["_SP", "PENNY"], ["SSP", "PIASTRE"], ["LKR", "CENT"], ["SDG", "PIASTRE"], ["SRD", "CENT"], ["SZL", "CENT"], ["SEK", "ORE"], ["SYP", "PIASTRE"], ["TWD", "CENT"], ["TJS", "DIRAM"], ["TZS", "CENT"], ["THB", "SATANG"], ["PRB", "KOPEK"], ["TTD", "CENT"], ["_TP", "PENNY"], ["TND", "MILLIME"], ["TMT", "TENNESI"], ["TVD", "CENT"], ["UGX", "CENT"], ["UAH", "KOPIYKA"], ["AED", "FILS"], ["UYU", "CENTESIMO"], ["VEF", "CENTIMO"], ["YER", "FILS"], ["ZMW", "NGWEE"]]); + BaseCurrency.CurrencyFractionalRatios = new Map([["Kopek", 100], ["Pul", 100], ["Cent", 100], ["Qindarkë", 100], ["Penny", 100], ["Santeem", 100], ["Cêntimo", 100], ["Centavo", 100], ["Luma", 100], ["Qəpik", 100], ["Fils", 1000], ["Poisha", 100], ["Kapyeyka", 100], ["Centime", 100], ["Chetrum", 100], ["Paisa", 100], ["Fening", 100], ["Thebe", 100], ["Sen", 100], ["Stotinka", 100], ["Jiao", 10], ["Fen", 100], ["Céntimo", 100], ["Lipa", 100], ["Haléř", 100], ["Øre", 100], ["Piastre", 100], ["Santim", 100], ["Oyra", 100], ["Butut", 100], ["Tetri", 100], ["Pesewa", 100], ["Fillér", 100], ["Eyrir", 100], ["Dinar", 100], ["Agora", 100], ["Tïın", 100], ["Chon", 100], ["Jeon", 100], ["Tyiyn", 100], ["Att", 100], ["Sente", 100], ["Dirham", 1000], ["Rappen", 100], ["Avo", 100], ["Deni", 100], ["Iraimbilanja", 5], ["Tambala", 100], ["Laari", 100], ["Khoums", 5], ["Ban", 100], ["Möngö", 100], ["Pya", 100], ["Kobo", 100], ["Kuruş", 100], ["Baisa", 1000], ["Centésimo", 100], ["Toea", 100], ["Sentimo", 100], ["Grosz", 100], ["Sene", 100], ["Halala", 100], ["Para", 100], ["Öre", 100], ["Diram", 100], ["Satang", 100], ["Seniti", 100], ["Millime", 1000], ["Tennesi", 100], ["Kopiyka", 100], ["Tiyin", 100], ["Hào", 10], ["Ngwee", 100]]); +})(BaseCurrency = exports.BaseCurrency || (exports.BaseCurrency = {})); + +}); + +unwrapExports(baseCurrency); + +var parsers$4 = createCommonjsModule(function (module, exports) { +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); + + + + + + +class UnitValue { + constructor() { + this.number = ""; + this.unit = ""; + } +} +exports.UnitValue = UnitValue; +class UnitValueIso extends UnitValue { + constructor() { + super(...arguments); + this.isoCurrency = ""; + } +} +exports.UnitValueIso = UnitValueIso; +class BaseNumberWithUnitParserConfiguration { + constructor(cultureInfo) { + this.cultureInfo = cultureInfo; + this.unitMap = new Map(); + this.currencyFractionNumMap = baseCurrency.BaseCurrency.CurrencyFractionalRatios; + this.currencyFractionMapping = baseCurrency.BaseCurrency.CurrencyFractionMapping; + } + BindDictionary(dictionary) { + utilities$2.DictionaryUtils.bindDictionary(dictionary, this.unitMap); + } +} +exports.BaseNumberWithUnitParserConfiguration = BaseNumberWithUnitParserConfiguration; +class NumberWithUnitParser { + constructor(config) { + this.config = config; + } + parse(extResult) { + let ret = new recognizersText.ParseResult(extResult); + let numberResult; + if (extResult.data && typeof extResult.data === "object") { + numberResult = extResult.data; + } + else if (extResult.type === constants$2.Constants.SYS_NUM) { + ret.value = this.config.internalNumberParser.parse(extResult).value; + return ret; + } + else { + // if there is no unitResult, means there is just unit + numberResult = { start: -1, length: 0, text: null, type: null }; + } + // key contains units + let key = extResult.text; + let unitKeyBuild = ''; + let unitKeys = new Array(); + for (let i = 0; i <= key.length; i++) { + if (i === key.length) { + if (unitKeyBuild.length !== 0) { + this.addIfNotContained(unitKeys, unitKeyBuild.trim()); + } + } + // numberResult.start is a relative position + else if (i === numberResult.start) { + if (unitKeyBuild.length !== 0) { + this.addIfNotContained(unitKeys, unitKeyBuild.trim()); + unitKeyBuild = ''; + } + let o = numberResult.start + numberResult.length - 1; + if (o !== null && !isNaN(o)) { + i = o; + } + } + else { + unitKeyBuild += key[i]; + } + } + /* Unit type depends on last unit in suffix.*/ + let lastUnit = lodash_last(unitKeys); + let normalizedLastUnit = lastUnit.toLowerCase(); + if (this.config.connectorToken && this.config.connectorToken.length && normalizedLastUnit.indexOf(this.config.connectorToken) === 0) { + normalizedLastUnit = normalizedLastUnit.substring(this.config.connectorToken.length).trim(); + lastUnit = lastUnit.substring(this.config.connectorToken.length).trim(); + } + if (key && key.length && (this.config.unitMap !== null)) { + let unitValue = null; + if (this.config.unitMap.has(lastUnit)) { + unitValue = this.config.unitMap.get(lastUnit); + } + else if (this.config.unitMap.has(normalizedLastUnit)) { + unitValue = this.config.unitMap.get(normalizedLastUnit); + } + if (unitValue) { + let numValue = numberResult.text && numberResult.text.length ? this.config.internalNumberParser.parse(numberResult) : null; + let resolutionStr = numValue ? numValue.resolutionStr : null; + ret.value = { number: resolutionStr, unit: unitValue }; + ret.resolutionStr = (`${resolutionStr} ${unitValue}`).trim(); + } + } + return ret; + } + addIfNotContained(keys, newKey) { + if (!keys.some(key => key.includes(newKey))) { + keys.push(newKey); + } + } +} +exports.NumberWithUnitParser = NumberWithUnitParser; +class BaseCurrencyParser { + constructor(config) { + this.config = config; + this.numberWithUnitParser = new NumberWithUnitParser(config); + } + parse(extResult) { + let result = null; + if (extResult.data instanceof Array) { + result = this.mergeCompoundUnit(extResult); + } + else { + result = this.numberWithUnitParser.parse(extResult); + let value = result.value; + if (!this.config.currencyNameToIsoCodeMap.has(value.unit) || this.config.currencyNameToIsoCodeMap.get(value.unit).startsWith(constants$2.Constants.FAKE_ISO_CODE_PREFIX)) { + result.value = { + unit: value.unit, + number: value.number + }; + } + else { + result.value = { + unit: value.unit, + number: value.number, + isoCurrency: this.config.currencyNameToIsoCodeMap.get(value.unit) + }; + } + } + return result; + } + mergeCompoundUnit(compoundResult) { + let results = []; + let compoundUnit = compoundResult.data; + let count = 0; + let result = null; + let numberValue = 0.0; + let mainUnitValue = ''; + let mainUnitIsoCode = ''; + let fractionUnitsString = ''; + for (let i = 0; i < compoundUnit.length; i++) { + let extractResult = compoundUnit[i]; + let parseResult = this.numberWithUnitParser.parse(extractResult); + let parseResultValue = parseResult.value; + let unitValue = parseResultValue != null ? parseResultValue.unit : null; + // Process a new group + if (count === 0) { + if (extractResult.type !== constants$2.Constants.SYS_UNIT_CURRENCY) { + continue; + } + // Initialize a new result + result = new recognizersText.ParseResult(extractResult); + mainUnitValue = unitValue; + numberValue = parseFloat(parseResultValue.number); + result.resolutionStr = parseResult.resolutionStr; + if (this.config.currencyNameToIsoCodeMap.has(unitValue)) { + mainUnitIsoCode = this.config.currencyNameToIsoCodeMap.get(unitValue); + } + // If the main unit can't be recognized, finish process this group. + if (recognizersText.StringUtility.isNullOrEmpty(mainUnitIsoCode)) { + result.value = { + number: numberValue.toString(), + unit: mainUnitValue + }; + results.push(result); + result = null; + continue; + } + if (this.config.currencyFractionMapping.has(mainUnitIsoCode)) { + fractionUnitsString = this.config.currencyFractionMapping.get(mainUnitIsoCode); + } + } + else { + // Match pure number as fraction unit. + if (extractResult.type === recognizersTextNumber.Constants.SYS_NUM) { + numberValue += parseResult.value * (1.0 / 100); + result.resolutionStr += ' ' + parseResult.resolutionStr; + result.length = parseResult.start + parseResult.length - result.start; + count++; + continue; + } + let fractionUnitCode; + let fractionNumValue; + if (this.config.currencyFractionCodeList.has(unitValue)) { + fractionUnitCode = this.config.currencyFractionCodeList.get(unitValue); + } + if (this.config.currencyFractionNumMap.has(unitValue)) { + fractionNumValue = this.config.currencyFractionNumMap.get(unitValue); + } + if (fractionUnitCode && fractionNumValue !== 0 && this.checkUnitsStringContains(fractionUnitCode, fractionUnitsString)) { + numberValue += parseFloat(parseResultValue.number) * (1.0 / fractionNumValue); + result.resolutionStr += ' ' + parseResult.resolutionStr; + result.length = parseResult.start + parseResult.length - result.start; + } + else { + // If the fraction unit doesn't match the main unit, finish process this group. + if (result !== null) { + if (recognizersText.StringUtility.isNullOrEmpty(mainUnitIsoCode) || mainUnitIsoCode.startsWith(constants$2.Constants.FAKE_ISO_CODE_PREFIX)) { + result.value = { + number: numberValue.toString(), + unit: mainUnitValue + }; + } + else { + result.value = { + number: numberValue.toString(), + unit: mainUnitValue, + isoCurrency: mainUnitIsoCode + }; + } + results.push(result); + result = null; + } + count = 0; + i -= 1; + continue; + } + } + count++; + } + if (result !== null) { + if (recognizersText.StringUtility.isNullOrEmpty(mainUnitIsoCode) || mainUnitIsoCode.startsWith(constants$2.Constants.FAKE_ISO_CODE_PREFIX)) { + result.value = { + number: numberValue.toString(), + unit: mainUnitValue + }; + } + else { + result.value = { + number: numberValue.toString(), + unit: mainUnitValue, + isoCurrency: mainUnitIsoCode + }; + } + results.push(result); + } + this.resolveText(results, compoundResult.text, compoundResult.start); + return { value: results }; + } + checkUnitsStringContains(fractionUnitCode, fractionUnitsString) { + let unitsMap = new Map(); + utilities$2.DictionaryUtils.bindUnitsString(unitsMap, '', fractionUnitsString); + return unitsMap.has(fractionUnitCode); + } + resolveText(prs, source, bias) { + prs.forEach(parseResult => { + if (parseResult.start !== null && parseResult.length !== null) { + parseResult.text = source.substr(parseResult.start - bias, parseResult.length); + } + }); + } +} +exports.BaseCurrencyParser = BaseCurrencyParser; +class BaseMergedUnitParser { + constructor(config) { + this.config = config; + this.numberWithUnitParser = new NumberWithUnitParser(config); + this.currencyParser = new BaseCurrencyParser(config); + } + parse(extResult) { + let result; + if (extResult.type === constants$2.Constants.SYS_UNIT_CURRENCY) { + result = this.currencyParser.parse(extResult); + } + else { + result = this.numberWithUnitParser.parse(extResult); + } + return result; + } +} +exports.BaseMergedUnitParser = BaseMergedUnitParser; + +}); + +unwrapExports(parsers$4); + +var englishNumericWithUnit = createCommonjsModule(function (module, exports) { +"use strict"; +// ------------------------------------------------------------------------------ +// +// This code was generated by a tool. +// Changes to this file may cause incorrect behavior and will be lost if +// the code is regenerated. +// +// ------------------------------------------------------------------------------ +Object.defineProperty(exports, "__esModule", { value: true }); +var EnglishNumericWithUnit; +(function (EnglishNumericWithUnit) { + EnglishNumericWithUnit.AgeSuffixList = new Map([["Year", "years old|year old|year-old|years-old|-year-old|-years-old|years of age|year of age"], ["Month", "months old|month old|month-old|months-old|-month-old|-months-old|month of age|months of age"], ["Week", "weeks old|week old|week-old|weeks-old|-week-old|-weeks-old|week of age|weeks of age"], ["Day", "days old|day old|day-old|days-old|-day-old|-days-old|day of age|days of age"]]); + EnglishNumericWithUnit.AreaSuffixList = new Map([["Square kilometer", "sq km|sq kilometer|sq kilometre|sq kilometers|sq kilometres|square kilometer|square kilometre|square kilometers|square kilometres|km2|km^2|km²"], ["Square hectometer", "sq hm|sq hectometer|sq hectometre|sq hectometers|sq hectometres|square hectometer|square hectometre|square hectometers|square hectometres|hm2|hm^2|hm²|hectare|hectares"], ["Square decameter", "sq dam|sq decameter|sq decametre|sq decameters|sq decametres|square decameter|square decametre|square decameters|square decametres|sq dekameter|sq dekametre|sq dekameters|sq dekametres|square dekameter|square dekametre|square dekameters|square dekametres|dam2|dam^2|dam²"], ["Square meter", "sq m|sq meter|sq metre|sq meters|sq metres|sq metre|square meter|square meters|square metre|square metres|m2|m^2|m²"], ["Square decimeter", "sq dm|sq decimeter|sq decimetre|sq decimeters|sq decimetres|square decimeter|square decimetre|square decimeters|square decimetres|dm2|dm^2|dm²"], ["Square centimeter", "sq cm|sq centimeter|sq centimetre|sq centimeters|sq centimetres|square centimeter|square centimetre|square centimeters|square centimetres|cm2|cm^2|cm²"], ["Square millimeter", "sq mm|sq millimeter|sq millimetre|sq millimeters|sq millimetres|square millimeter|square millimetre|square millimeters|square millimetres|mm2|mm^2|mm²"], ["Square inch", "sq in|sq inch|square inch|square inches|in2|in^2|in²"], ["Square foot", "sqft|sq ft|sq foot|sq feet|square foot|square feet|feet2|feet^2|feet²|ft2|ft^2|ft²"], ["Square mile", "sq mi|sq mile|sqmiles|square mile|square miles|mi2|mi^2|mi²"], ["Square yard", "sq yd|sq yard|sq yards|square yard|square yards|yd2|yd^2|yd²"], ["Acre", "-acre|acre|acres"]]); + EnglishNumericWithUnit.CurrencySuffixList = new Map([["Abkhazian apsar", "abkhazian apsar|apsars"], ["Afghan afghani", "afghan afghani|؋|afn|afghanis|afghani"], ["Pul", "pul"], ["Euro", "euros|euro|€|eur"], ["Cent", "cents|cent|-cents|-cent|sen"], ["Albanian lek", "albanian lek|leks|lek"], ["Qindarkë", "qindarkë|qindarkës|qindarke|qindarkes"], ["Angolan kwanza", "angolan kwanza|kz|aoa|kwanza|kwanzas|angolan kwanzas"], ["Armenian dram", "armenian drams|armenian dram"], ["Aruban florin", "aruban florin|ƒ|awg|aruban florins"], ["Bangladeshi taka", "bangladeshi taka|৳|bdt|taka|takas|bangladeshi takas"], ["Paisa", "poisha|paisa"], ["Bhutanese ngultrum", "Bhutanese ngultrum|nu.|btn"], ["Chetrum", "chetrums|chetrum"], ["Bolivian boliviano", "bolivian boliviano|bob|bs.|bolivia boliviano|bolivia bolivianos|bolivian bolivianos"], ["Bosnia and Herzegovina convertible mark", "bosnia and herzegovina convertible mark|bam"], ["Fening", "fenings|fenings"], ["Botswana pula", "botswana pula|bwp|pula|pulas|botswana pulas"], ["Thebe", "thebe"], ["Brazilian real", "brazilian real|r$|brl|brazil real|brazil reals|brazilian reals"], ["Bulgarian lev", "bulgarian lev|bgn|лв|bulgaria lev|bulgaria levs|bulgarian levs"], ["Stotinka", "stotinki|stotinka"], ["Cambodian riel", "cambodian riel|khr|៛|cambodia riel|cambodia riels|cambodian riels"], ["Cape Verdean escudo", "cape verdean escudo|cve"], ["Costa Rican colón", "costa rican colón|costa rican colóns|crc|₡|costa rica colón|costa rica colóns|costa rican colon|costa rican colons|costa rica colon|costa rica colons"], ["Salvadoran colón", "svc|salvadoran colón|salvadoran colóns|salvador colón|salvador colóns|salvadoran colon|salvadoran colons|salvador colon|salvador colons"], ["Céntimo", "céntimo"], ["Croatian kuna", "croatian kuna|kn|hrk|croatia kuna|croatian kunas|croatian kuna kunas"], ["Lipa", "lipa"], ["Czech koruna", "czech koruna|czk|Kč|czech korunas"], ["Haléř", "haléř"], ["Eritrean nakfa", "eritrean nakfa|nfk|ern|eritrean nakfas"], ["Ethiopian birr", "ethiopian birr|etb"], ["Gambian dalasi", "gmd"], ["Butut", "bututs|butut"], ["Georgian lari", "Georgian lari|lari|gel|₾"], ["Tetri", "tetri"], ["Ghanaian cedi", "Ghanaian cedi|ghs|₵|gh₵"], ["Pesewa", "pesewas|pesewa"], ["Guatemalan quetzal", "guatemalan quetzal|gtq|guatemala quetzal"], ["Haitian gourde", "haitian gourde|htg"], ["Honduran lempira", "honduran lempira|hnl"], ["Hungarian forint", "hungarian forint|huf|ft|hungary forint|hungary forints|hungarian forints"], ["Fillér", "fillér"], ["Iranian rial", "iranian rial|irr|iran rial|iran rials|iranian rials"], ["Yemeni rial", "yemeni rial|yer|yemeni rials"], ["Israeli new shekel", "₪|ils|agora"], ["Lithuanian litas", "ltl|lithuanian litas|lithuan litas|lithuanian lit|lithuan lit"], ["Japanese yen", "japanese yen|jpy|yen|-yen|¥|yens|japanese yens|japan yen|japan yens"], ["Kazakhstani tenge", "Kazakhstani tenge|kzt"], ["Kenyan shilling", "kenyan shilling|sh|kes"], ["North Korean won", "north korean won|kpw|north korean wons"], ["South Korean won", "south korean won|krw|south korean wons"], ["Korean won", "korean won|₩|korean wons"], ["Kyrgyzstani som", "kyrgyzstani som|kgs"], ["Uzbekitan som", "uzbekitan som|uzs"], ["Lao kip", "lao kip|lak|₭n|₭"], ["Att", "att"], ["Lesotho loti", "lesotho loti|lsl|loti"], ["Sente", "sente|lisente"], ["South African rand", "south african rand|zar|south africa rand|south africa rands|south african rands"], ["Macanese pataca", "macanese pataca|mop$|mop"], ["Avo", "avos|avo"], ["Macedonian denar", "macedonian denar|mkd|ден"], ["Deni", "deni"], ["Malagasy ariary", "malagasy ariary|mga"], ["Iraimbilanja", "iraimbilanja"], ["Malawian kwacha", "malawian kwacha|mk|mwk"], ["Tambala", "tambala"], ["Malaysian ringgit", "malaysian ringgit|rm|myr|malaysia ringgit|malaysia ringgits|malaysian ringgits"], ["Mauritanian ouguiya", "mauritanian ouguiya|um|mro|mauritania ouguiya|mauritania ouguiyas|mauritanian ouguiyas"], ["Khoums", "khoums"], ["Mongolian tögrög", "mongolian tögrög|mnt|₮|mongolia tögrög|mongolia tögrögs|mongolian tögrögs|mongolian togrog|mongolian togrogs|mongolia togrog|mongolia togrogs"], ["Mozambican metical", "mozambican metical|mt|mzn|mozambica metical|mozambica meticals|mozambican meticals"], ["Burmese kyat", "Burmese kyat|ks|mmk"], ["Pya", "pya"], ["Nicaraguan córdoba", "nicaraguan córdoba|nio"], ["Nigerian naira", "nigerian naira|naira|ngn|₦|nigeria naira|nigeria nairas|nigerian nairas"], ["Kobo", "kobo"], ["Turkish lira", "turkish lira|try|tl|turkey lira|turkey liras|turkish liras"], ["Kuruş", "kuruş"], ["Omani rial", "omani rial|omr|ر.ع."], ["Panamanian balboa", "panamanian balboa|b/.|pab"], ["Centesimo", "centesimo|céntimo"], ["Papua New Guinean kina", "papua new guinean kina|kina|pgk"], ["Toea", "toea"], ["Paraguayan guaraní", "paraguayan guaraní|₲|pyg"], ["Peruvian sol", "peruvian sol|soles|sol|peruvian nuevo sol"], ["Polish złoty", "złoty|polish złoty|zł|pln|zloty|polish zloty|poland zloty|poland złoty"], ["Grosz", "groszy|grosz|grosze"], ["Qatari riyal", "qatari riyal|qar|qatari riyals|qatar riyal|qatar riyals"], ["Saudi riyal", "saudi riyal|sar|saudi riyals"], ["Riyal", "riyal|riyals|rial|﷼"], ["Dirham", "dirham|dirhem|dirhm"], ["Halala", "halalas|halala"], ["Samoan tālā", "samoan tālā|tālā|tala|ws$|samoa|wst|samoan tala"], ["Sene", "sene"], ["São Tomé and Príncipe dobra", "são tomé and príncipe dobra|dobras|dobra|std"], ["Sierra Leonean leone", "sierra Leonean leone|sll|leone|le"], ["Peseta", "pesetas|peseta"], ["Netherlands guilder", "florin|netherlands antillean guilder|ang|ƒ|nederlandse gulden|guilders|guilder|gulden|-guilders|-guilder|dutch guilders|dutch guilder|fl"], ["Swazi lilangeni", "swazi lilangeni|lilangeni|szl|emalangeni"], ["Tajikistani somoni", "tajikistani somoni|tjs|somoni"], ["Diram", "dirams|diram"], ["Thai baht", "thai baht|฿|thb|baht"], ["Satang", "satang|satangs"], ["Tongan paʻanga", "tongan paʻanga|paʻanga|tongan pa'anga|pa'anga"], ["Seniti", "seniti"], ["Ukrainian hryvnia", "ukrainian hryvnia|hyrvnia|uah|₴|ukrain hryvnia|ukrain hryvnias|ukrainian hryvnias"], ["Vanuatu vatu", "vanuatu vatu|vatu|vuv"], ["Venezuelan bolívar", "venezuelan bolívar|venezuelan bolívars|bs.f.|vef|bolívar fuerte|venezuelan bolivar|venezuelan bolivars|venezuela bolivar|venezuela bolivarsvenezuelan bolivar|venezuelan bolivars"], ["Vietnamese dong", "vietnamese dong|vnd|đồng|vietnam dong|vietnamese dongs|vietnam dongs"], ["Zambian kwacha", "zambian kwacha|zk|zmw|zambia kwacha|kwachas|zambian kwachas"], ["Moroccan dirham", "moroccan dirham|mad|د.م."], ["United Arab Emirates dirham", "united arab emirates dirham|د.إ|aed"], ["Azerbaijani manat", "azerbaijani manat|azn"], ["Turkmenistan manat", "turkmenistan manat|turkmenistan new manat|tmt"], ["Manat", "manats|manat"], ["Qəpik", "qəpik"], ["Somali shilling", "somali shillings|somali shilling|shilin soomaali|-shilin soomaali|scellino|shilin|sh.so.|sos"], ["Somaliland shilling", "somaliland shillings|somaliland shilling|soomaaliland shilin"], ["Tanzanian shilling", "tanzanian shilling|tanzanian shillings|tsh|tzs|tanzania shilling|tanzania shillings"], ["Ugandan shilling", "ugandan shilling|ugandan shillings|sh|ugx|uganda shilling|uganda shillings"], ["Romanian leu", "romanian leu|lei|ron|romania leu"], ["Moldovan leu", "moldovan leu|mdl|moldova leu"], ["Leu", "leu"], ["Ban", "bani|-ban|ban"], ["Nepalese rupee", "nepalese rupee|npr"], ["Pakistani rupee", "pakistani rupee|pkr"], ["Indian rupee", "indian rupee|inr|₹|india rupee"], ["Seychellois rupee", "seychellois rupee|scr|sr|sre"], ["Mauritian rupee", "mauritian rupee|mur"], ["Maldivian rufiyaa", "maldivian rufiyaa|rf|mvr|.ރ|maldive rufiyaa"], ["Sri Lankan rupee", "sri Lankan rupee|lkr|රු|ரூ"], ["Indonesian rupiah", "Indonesian rupiah|rupiah|perak|rp|idr"], ["Rupee", "rupee|rs"], ["Danish krone", "danish krone|dkk|denmark krone|denmark krones|danish krones"], ["Norwegian krone", "norwegian krone|nok|norway krone|norway krones|norwegian krones"], ["Faroese króna", "faroese króna|faroese krona"], ["Icelandic króna", "icelandic króna|isk|icelandic krona|iceland króna|iceland krona"], ["Swedish krona", "swedish krona|sek|swedan krona"], ["Krone", "kronor|krona|króna|krone|krones|kr|-kr"], ["Øre", "Øre|oyra|eyrir"], ["West African CFA franc", "west african cfa franc|xof|west africa cfa franc|west africa franc|west african franc"], ["Central African CFA franc", "central african cfa franc|xaf|central africa cfa franc|central african franc|central africa franc"], ["Comorian franc", "comorian franc|kmf"], ["Congolese franc", "congolese franc|cdf"], ["Burundian franc", "burundian franc|bif"], ["Djiboutian franc", "djiboutian franc|djf"], ["CFP franc", "cfp franc|xpf"], ["Guinean franc", "guinean franc|gnf"], ["Swiss franc", "swiss francs|swiss franc|chf|sfr."], ["Rwandan franc", "Rwandan franc|rwf|rf|r₣|frw"], ["Belgian franc", "belgian franc|bi.|b.fr.|bef|belgium franc"], ["Rappen", "rappen|-rappen"], ["Franc", "francs|franc|fr.|fs"], ["Centime", "centimes|centime|santim"], ["Russian ruble", "russian ruble|₽|rub|russia ruble|russia ₽|russian ₽|russian rubles|russia rubles"], ["New Belarusian ruble", "new belarusian ruble|byn|new belarus ruble|new belarus rubles|new belarusian rubles"], ["Old Belarusian ruble", "old belarusian ruble|byr|old belarus ruble|old belarus rubles|old belarusian rubles"], ["Transnistrian ruble", "transnistrian ruble|prb|р."], ["Belarusian ruble", "belarusian ruble|belarus ruble|belarus rubles|belarusian rubles"], ["Kopek", "kopek|kopeks"], ["Kapyeyka", "kapyeyka"], ["Ruble", "rubles|ruble|br"], ["Algerian dinar", "algerian dinar|د.ج|dzd|algerian dinars|algeria dinar|algeria dinars"], ["Bahraini dinar", "bahraini dinars|bahraini dinar|bhd|.د.ب"], ["Santeem", "santeem|santeems"], ["Iraqi dinar", "iraqi dinars|iraqi dinar|iraq dinars|iraq dinar|iqd|ع.د"], ["Jordanian dinar", "jordanian dinars|jordanian dinar|د.ا|jod|jordan dinar|jordan dinars"], ["Kuwaiti dinar", "kuwaiti dinars|kuwaiti dinar|kwd|د.ك"], ["Libyan dinar", "libyan dinars|libyan dinar|libya dinars|libya dinar|lyd"], ["Serbian dinar", "serbian dinars|serbian dinar|din.|rsd|дин.|serbia dinars|serbia dinar"], ["Tunisian dinar", "tunisian dinars|tunisian dinar|tnd|tunisia dinars|tunisia dinar"], ["Yugoslav dinar", "yugoslav dinars|yugoslav dinar|yun"], ["Dinar", "dinars|dinar|denar|-dinars|-dinar"], ["Fils", "fils|fulūs|-fils|-fil"], ["Para", "para|napa"], ["Millime", "millimes|millime"], ["Argentine peso", "argentine peso|ars|argetina peso|argetina pesos|argentine pesos"], ["Chilean peso", "chilean pesos|chilean peso|clp|chile peso|chile peso"], ["Colombian peso", "colombian pesos|colombian peso|cop|colombia peso|colombia pesos"], ["Cuban convertible peso", "cuban convertible pesos|cuban convertible peso|cuc|cuba convertible pesos|cuba convertible peso"], ["Cuban peso", "cuban pesos|cuban peso|cup|cuba pesos|cuba peso"], ["Dominican peso", "dominican pesos|dominican peso|dop|dominica pesos|dominica peso"], ["Mexican peso", "mexican pesos|mexican peso|mxn|mexico pesos|mexico peso"], ["Philippine peso", "piso|philippine pesos|philippine peso|₱|php"], ["Uruguayan peso", "uruguayan pesos|uruguayan peso|uyu"], ["Peso", "pesos|peso"], ["Centavo", "centavos|centavo"], ["Alderney pound", "alderney pounds|alderney pound|alderney £"], ["British pound", "british pounds|british pound|british £|gbp|pound sterling|pound sterlings|sterling|pound scot|pound scots"], ["Guernsey pound", "guernsey pounds|guernsey £|ggp"], ["Ascension pound", "ascension pounds|ascension pound|ascension £"], ["Saint Helena pound", "saint helena pounds|saint helena pound|saint helena £|shp"], ["Egyptian pound", "egyptian pounds|egyptian pound|egyptian £|egp|ج.م|egypt pounds|egypt pound"], ["Falkland Islands pound", "falkland islands pounds|falkland islands pound|falkland islands £|fkp|falkland island pounds|falkland island pound|falkland island £"], ["Gibraltar pound", "gibraltar pounds|gibraltar pound|gibraltar £|gip"], ["Manx pound", "manx pounds|manx pound|manx £|imp"], ["Jersey pound", "jersey pounds|jersey pound|jersey £|jep"], ["Lebanese pound", "lebanese pounds|lebanese pound|lebanese £|lebanan pounds|lebanan pound|lebanan £|lbp|ل.ل"], ["South Georgia and the South Sandwich Islands pound", "south georgia and the south sandwich islands pounds|south georgia and the south sandwich islands pound|south georgia and the south sandwich islands £"], ["South Sudanese pound", "south sudanese pounds|south sudanese pound|south sudanese £|ssp|south sudan pounds|south sudan pound|south sudan £"], ["Sudanese pound", "sudanese pounds|sudanese pound|sudanese £|ج.س.|sdg|sudan pounds|sudan pound|sudan £"], ["Syrian pound", "syrian pounds|syrian pound|syrian £|ل.س|syp|syria pounds|syria pound|syria £"], ["Tristan da Cunha pound", "tristan da cunha pounds|tristan da cunha pound|tristan da cunha £"], ["Pound", "pounds|pound|-pounds|-pound|£"], ["Pence", "pence"], ["Shilling", "shillings|shilling|shilingi"], ["Penny", "pennies|penny"], ["United States dollar", "united states dollars|united states dollar|united states $|u.s. dollars|u.s. dollar|u s dollar|u s dollars|usd|american dollars|american dollar|us$|us dollar|us dollars|u.s dollar|u.s dollars"], ["East Caribbean dollar", "east caribbean dollars|east caribbean dollar|east Caribbean $|xcd"], ["Australian dollar", "australian dollars|australian dollar|australian $|australian$|aud|australia dollars|australia dollar|australia $|australia$"], ["Bahamian dollar", "bahamian dollars|bahamian dollar|bahamian $|bahamian$|bsd|bahamia dollars|bahamia dollar|bahamia $|bahamia$"], ["Barbadian dollar", "barbadian dollars|barbadian dollar|barbadian $|bbd"], ["Belize dollar", "belize dollars|belize dollar|belize $|bzd"], ["Bermudian dollar", "bermudian dollars|bermudian dollar|bermudian $|bmd|bermudia dollars|bermudia dollar|bermudia $"], ["British Virgin Islands dollar", "british virgin islands dollars|british virgin islands dollar|british virgin islands $|bvi$|virgin islands dollars|virgin islands dolalr|virgin islands $|virgin island dollars|virgin island dollar|virgin island $"], ["Brunei dollar", "brunei dollar|brunei $|bnd"], ["Sen", "sen"], ["Singapore dollar", "singapore dollars|singapore dollar|singapore $|s$|sgd"], ["Canadian dollar", "canadian dollars|canadian dollar|canadian $|cad|can$|c$|canada dollars|canada dolllar|canada $"], ["Cayman Islands dollar", "cayman islands dollars|cayman islands dollar|cayman islands $|kyd|ci$|cayman island dollar|cayman island doolars|cayman island $"], ["New Zealand dollar", "new zealand dollars|new zealand dollar|new zealand $|nz$|nzd|kiwi"], ["Cook Islands dollar", "cook islands dollars|cook islands dollar|cook islands $|cook island dollars|cook island dollar|cook island $"], ["Fijian dollar", "fijian dollars|fijian dollar|fijian $|fjd|fiji dollars|fiji dollar|fiji $"], ["Guyanese dollar", "guyanese dollars|guyanese dollar|gyd|gy$"], ["Hong Kong dollar", "hong kong dollars|hong kong dollar|hong kong $|hk$|hkd|hk dollars|hk dollar|hk $|hongkong$"], ["Jamaican dollar", "jamaican dollars|jamaican dollar|jamaican $|j$|jamaica dollars|jamaica dollar|jamaica $|jmd"], ["Kiribati dollar", "kiribati dollars|kiribati dollar|kiribati $"], ["Liberian dollar", "liberian dollars|liberian dollar|liberian $|liberia dollars|liberia dollar|liberia $|lrd"], ["Micronesian dollar", "micronesian dollars|micronesian dollar|micronesian $"], ["Namibian dollar", "namibian dollars|namibian dollar|namibian $|nad|n$|namibia dollars|namibia dollar|namibia $"], ["Nauruan dollar", "nauruan dollars|nauruan dollar|nauruan $"], ["Niue dollar", "niue dollars|niue dollar|niue $"], ["Palauan dollar", "palauan dollars|palauan dollar|palauan $"], ["Pitcairn Islands dollar", "pitcairn islands dollars|pitcairn islands dollar|pitcairn islands $|pitcairn island dollars|pitcairn island dollar|pitcairn island $"], ["Solomon Islands dollar", "solomon islands dollars|solomon islands dollar|solomon islands $|si$|sbd|solomon island dollars|solomon island dollar|solomon island $"], ["Surinamese dollar", "surinamese dollars|surinamese dollar|surinamese $|srd"], ["New Taiwan dollar", "new taiwan dollars|new taiwan dollar|nt$|twd|ntd"], ["Trinidad and Tobago dollar", "trinidad and tobago dollars|trinidad and tobago dollar|trinidad and tobago $|trinidad $|trinidad dollar|trinidad dollars|trinidadian dollar|trinidadian dollars|trinidadian $|ttd"], ["Tuvaluan dollar", "tuvaluan dollars|tuvaluan dollar|tuvaluan $"], ["Dollar", "dollars|dollar|$"], ["Chinese yuan", "yuan|kuai|chinese yuan|renminbi|cny|rmb|¥|元"], ["Fen", "fen"], ["Jiao", "jiao|mao"], ["Finnish markka", "suomen markka|finnish markka|finsk mark|fim|markkaa|markka"], ["Penni", "penniä|penni"]]); + EnglishNumericWithUnit.CurrencyNameToIsoCodeMap = new Map([["Afghan afghani", "AFN"], ["Euro", "EUR"], ["Albanian lek", "ALL"], ["Angolan kwanza", "AOA"], ["Armenian dram", "AMD"], ["Aruban florin", "AWG"], ["Bangladeshi taka", "BDT"], ["Bhutanese ngultrum", "BTN"], ["Bolivian boliviano", "BOB"], ["Bosnia and Herzegovina convertible mark", "BAM"], ["Botswana pula", "BWP"], ["Brazilian real", "BRL"], ["Bulgarian lev", "BGN"], ["Cambodian riel", "KHR"], ["Cape Verdean escudo", "CVE"], ["Costa Rican colón", "CRC"], ["Croatian kuna", "HRK"], ["Czech koruna", "CZK"], ["Eritrean nakfa", "ERN"], ["Ethiopian birr", "ETB"], ["Gambian dalasi", "GMD"], ["Georgian lari", "GEL"], ["Ghanaian cedi", "GHS"], ["Guatemalan quetzal", "GTQ"], ["Haitian gourde", "HTG"], ["Honduran lempira", "HNL"], ["Hungarian forint", "HUF"], ["Iranian rial", "IRR"], ["Yemeni rial", "YER"], ["Israeli new shekel", "ILS"], ["Japanese yen", "JPY"], ["Kazakhstani tenge", "KZT"], ["Kenyan shilling", "KES"], ["North Korean won", "KPW"], ["South Korean won", "KRW"], ["Kyrgyzstani som", "KGS"], ["Lao kip", "LAK"], ["Lesotho loti", "LSL"], ["South African rand", "ZAR"], ["Macanese pataca", "MOP"], ["Macedonian denar", "MKD"], ["Malagasy ariary", "MGA"], ["Malawian kwacha", "MWK"], ["Malaysian ringgit", "MYR"], ["Mauritanian ouguiya", "MRO"], ["Mongolian tögrög", "MNT"], ["Mozambican metical", "MZN"], ["Burmese kyat", "MMK"], ["Nicaraguan córdoba", "NIO"], ["Nigerian naira", "NGN"], ["Turkish lira", "TRY"], ["Omani rial", "OMR"], ["Panamanian balboa", "PAB"], ["Papua New Guinean kina", "PGK"], ["Paraguayan guaraní", "PYG"], ["Peruvian sol", "PEN"], ["Polish złoty", "PLN"], ["Qatari riyal", "QAR"], ["Saudi riyal", "SAR"], ["Samoan tālā", "WST"], ["São Tomé and Príncipe dobra", "STD"], ["Sierra Leonean leone", "SLL"], ["Swazi lilangeni", "SZL"], ["Tajikistani somoni", "TJS"], ["Thai baht", "THB"], ["Ukrainian hryvnia", "UAH"], ["Vanuatu vatu", "VUV"], ["Venezuelan bolívar", "VEF"], ["Zambian kwacha", "ZMW"], ["Moroccan dirham", "MAD"], ["United Arab Emirates dirham", "AED"], ["Azerbaijani manat", "AZN"], ["Turkmenistan manat", "TMT"], ["Somali shilling", "SOS"], ["Tanzanian shilling", "TZS"], ["Ugandan shilling", "UGX"], ["Romanian leu", "RON"], ["Moldovan leu", "MDL"], ["Nepalese rupee", "NPR"], ["Pakistani rupee", "PKR"], ["Indian rupee", "INR"], ["Seychellois rupee", "SCR"], ["Mauritian rupee", "MUR"], ["Maldivian rufiyaa", "MVR"], ["Sri Lankan rupee", "LKR"], ["Indonesian rupiah", "IDR"], ["Danish krone", "DKK"], ["Norwegian krone", "NOK"], ["Icelandic króna", "ISK"], ["Swedish krona", "SEK"], ["West African CFA franc", "XOF"], ["Central African CFA franc", "XAF"], ["Comorian franc", "KMF"], ["Congolese franc", "CDF"], ["Burundian franc", "BIF"], ["Djiboutian franc", "DJF"], ["CFP franc", "XPF"], ["Guinean franc", "GNF"], ["Swiss franc", "CHF"], ["Rwandan franc", "RWF"], ["Russian ruble", "RUB"], ["Transnistrian ruble", "PRB"], ["Belarusian ruble", "BYN"], ["Algerian dinar", "DZD"], ["Bahraini dinar", "BHD"], ["Iraqi dinar", "IQD"], ["Jordanian dinar", "JOD"], ["Kuwaiti dinar", "KWD"], ["Libyan dinar", "LYD"], ["Serbian dinar", "RSD"], ["Tunisian dinar", "TND"], ["Argentine peso", "ARS"], ["Chilean peso", "CLP"], ["Colombian peso", "COP"], ["Cuban convertible peso", "CUC"], ["Cuban peso", "CUP"], ["Dominican peso", "DOP"], ["Mexican peso", "MXN"], ["Uruguayan peso", "UYU"], ["British pound", "GBP"], ["Saint Helena pound", "SHP"], ["Egyptian pound", "EGP"], ["Falkland Islands pound", "FKP"], ["Gibraltar pound", "GIP"], ["Manx pound", "IMP"], ["Jersey pound", "JEP"], ["Lebanese pound", "LBP"], ["South Sudanese pound", "SSP"], ["Sudanese pound", "SDG"], ["Syrian pound", "SYP"], ["United States dollar", "USD"], ["Australian dollar", "AUD"], ["Bahamian dollar", "BSD"], ["Barbadian dollar", "BBD"], ["Belize dollar", "BZD"], ["Bermudian dollar", "BMD"], ["Brunei dollar", "BND"], ["Singapore dollar", "SGD"], ["Canadian dollar", "CAD"], ["Cayman Islands dollar", "KYD"], ["New Zealand dollar", "NZD"], ["Fijian dollar", "FJD"], ["Guyanese dollar", "GYD"], ["Hong Kong dollar", "HKD"], ["Jamaican dollar", "JMD"], ["Liberian dollar", "LRD"], ["Namibian dollar", "NAD"], ["Solomon Islands dollar", "SBD"], ["Surinamese dollar", "SRD"], ["New Taiwan dollar", "TWD"], ["Trinidad and Tobago dollar", "TTD"], ["Tuvaluan dollar", "TVD"], ["Chinese yuan", "CNY"], ["Rial", "__RI"], ["Shiling", "__S"], ["Som", "__SO"], ["Dirham", "__DR"], ["Dinar", "_DN"], ["Dollar", "__D"], ["Manat", "__MA"], ["Rupee", "__R"], ["Krone", "__K"], ["Krona", "__K"], ["Crown", "__K"], ["Frank", "__F"], ["Mark", "__M"], ["Ruble", "__RB"], ["Peso", "__PE"], ["Pound", "__P"], ["Tristan da Cunha pound", "_TP"], ["South Georgia and the South Sandwich Islands pound", "_SP"], ["Somaliland shilling", "_SS"], ["Pitcairn Islands dollar", "_PND"], ["Palauan dollar", "_PD"], ["Niue dollar", "_NID"], ["Nauruan dollar", "_ND"], ["Micronesian dollar", "_MD"], ["Kiribati dollar", "_KID"], ["Guernsey pound", "_GGP"], ["Faroese króna", "_FOK"], ["Cook Islands dollar", "_CKD"], ["British Virgin Islands dollar", "_BD"], ["Ascension pound", "_AP"], ["Alderney pound", "_ALP"], ["Abkhazian apsar", "_AA"]]); + EnglishNumericWithUnit.FractionalUnitNameToCodeMap = new Map([["Jiao", "JIAO"], ["Kopek", "KOPEK"], ["Pul", "PUL"], ["Cent", "CENT"], ["Qindarkë", "QINDARKE"], ["Penny", "PENNY"], ["Santeem", "SANTEEM"], ["Cêntimo", "CENTIMO"], ["Centavo", "CENTAVO"], ["Luma", "LUMA"], ["Qəpik", "QƏPIK"], ["Fils", "FILS"], ["Poisha", "POISHA"], ["Kapyeyka", "KAPYEYKA"], ["Centime", "CENTIME"], ["Chetrum", "CHETRUM"], ["Paisa", "PAISA"], ["Fening", "FENING"], ["Thebe", "THEBE"], ["Sen", "SEN"], ["Stotinka", "STOTINKA"], ["Fen", "FEN"], ["Céntimo", "CENTIMO"], ["Lipa", "LIPA"], ["Haléř", "HALER"], ["Øre", "ØRE"], ["Piastre", "PIASTRE"], ["Santim", "SANTIM"], ["Oyra", "OYRA"], ["Butut", "BUTUT"], ["Tetri", "TETRI"], ["Pesewa", "PESEWA"], ["Fillér", "FILLER"], ["Eyrir", "EYRIR"], ["Dinar", "DINAR"], ["Agora", "AGORA"], ["Tïın", "TIIN"], ["Chon", "CHON"], ["Jeon", "JEON"], ["Tyiyn", "TYIYN"], ["Att", "ATT"], ["Sente", "SENTE"], ["Dirham", "DIRHAM"], ["Rappen", "RAPPEN"], ["Avo", "AVO"], ["Deni", "DENI"], ["Iraimbilanja", "IRAIMBILANJA"], ["Tambala", "TAMBALA"], ["Laari", "LAARI"], ["Khoums", "KHOUMS"], ["Ban", "BAN"], ["Möngö", "MONGO"], ["Pya", "PYA"], ["Kobo", "KOBO"], ["Kuruş", "KURUS"], ["Baisa", "BAISA"], ["Centésimo", "CENTESIMO"], ["Toea", "TOEA"], ["Sentimo", "SENTIMO"], ["Grosz", "GROSZ"], ["Sene", "SENE"], ["Halala", "HALALA"], ["Para", "PARA"], ["Öre", "ORE"], ["Diram", "DIRAM"], ["Satang", "SATANG"], ["Seniti", "SENITI"], ["Millime", "MILLIME"], ["Tennesi", "TENNESI"], ["Kopiyka", "KOPIYKA"], ["Tiyin", "TIYIN"], ["Hào", "HAO"], ["Ngwee", "NGWEE"]]); + EnglishNumericWithUnit.CompoundUnitConnectorRegex = `(?and)`; + EnglishNumericWithUnit.CurrencyPrefixList = new Map([["Dollar", "$"], ["United States dollar", "united states $|us$|us $|u.s. $|u.s $"], ["East Caribbean dollar", "east caribbean $"], ["Australian dollar", "australian $|australia $"], ["Bahamian dollar", "bahamian $|bahamia $"], ["Barbadian dollar", "barbadian $|barbadin $"], ["Belize dollar", "belize $"], ["Bermudian dollar", "bermudian $"], ["British Virgin Islands dollar", "british virgin islands $|bvi$|virgin islands $|virgin island $|british virgin island $"], ["Brunei dollar", "brunei $|b$"], ["Sen", "sen"], ["Singapore dollar", "singapore $|s$"], ["Canadian dollar", "canadian $|can$|c$|c $|canada $"], ["Cayman Islands dollar", "cayman islands $|ci$|cayman island $"], ["New Zealand dollar", "new zealand $|nz$|nz $"], ["Cook Islands dollar", "cook islands $|cook island $"], ["Fijian dollar", "fijian $|fiji $"], ["Guyanese dollar", "gy$|gy $|g$|g $"], ["Hong Kong dollar", "hong kong $|hk$|hkd|hk $"], ["Jamaican dollar", "jamaican $|j$|jamaica $"], ["Kiribati dollar", "kiribati $"], ["Liberian dollar", "liberian $|liberia $"], ["Micronesian dollar", "micronesian $"], ["Namibian dollar", "namibian $|nad|n$|namibia $"], ["Nauruan dollar", "nauruan $"], ["Niue dollar", "niue $"], ["Palauan dollar", "palauan $"], ["Pitcairn Islands dollar", "pitcairn islands $|pitcairn island $"], ["Solomon Islands dollar", "solomon islands $|si$|si $|solomon island $"], ["Surinamese dollar", "surinamese $|surinam $"], ["New Taiwan dollar", "nt$|nt $"], ["Trinidad and Tobago dollar", "trinidad and tobago $|trinidad $|trinidadian $"], ["Tuvaluan dollar", "tuvaluan $"], ["Samoan tālā", "ws$"], ["Chinese yuan", "¥"], ["Japanese yen", "¥"], ["Euro", "€"], ["Pound", "£"], ["Costa Rican colón", "₡"], ["Turkish lira", "₺"]]); + EnglishNumericWithUnit.AmbiguousCurrencyUnitList = ['din.', 'kiwi', 'kina', 'kobo', 'lari', 'lipa', 'napa', 'para', 'sfr.', 'taka', 'tala', 'toea', 'vatu', 'yuan', 'ang', 'ban', 'bob', 'btn', 'byr', 'cad', 'cop', 'cup', 'dop', 'gip', 'jod', 'kgs', 'lak', 'lei', 'mga', 'mop', 'nad', 'omr', 'pul', 'sar', 'sbd', 'scr', 'sdg', 'sek', 'sen', 'sol', 'sos', 'std', 'try', 'yer', 'yen']; + EnglishNumericWithUnit.InformationSuffixList = new Map([["Bit", "-bit|bit|bits"], ["Kilobit", "kilobit|kilobits|kb|Kb|kbit"], ["Megabit", "megabit|megabits|mb|Mb|mbit"], ["Gigabit", "gigabit|gigabits|gb|Gb|gbit"], ["Terabit", "terabit|terabits|tb|Tb|tbit"], ["Petabit", "petabit|petabits|pb|Pb|pbit"], ["Byte", "-byte|byte|bytes"], ["Kilobyte", "-kilobyte|-kilobytes|kilobyte|kB|KB|kilobytes|kilo byte|kilo bytes|kbyte"], ["Megabyte", "-megabyte|-megabytes|megabyte|mB|MB|megabytes|mega byte|mega bytes|mbyte"], ["Gigabyte", "-gigabyte|-gigabytes|gigabyte|gB|GB|gigabytes|giga byte|giga bytes|gbyte"], ["Terabyte", "-terabyte|-terabytes|terabyte|tB|TB|terabytes|tera byte|tera bytes|tbyte"], ["Petabyte", "-petabyte|-petabytes|petabyte|pB|PB|petabytes|peta byte|peta bytes|pbyte"]]); + EnglishNumericWithUnit.AmbiguousDimensionUnitList = ['barrel', 'barrels', 'grain', 'pound', 'stone', 'yards', 'yard', 'cord', 'dram', 'feet', 'foot', 'gill', 'knot', 'peck', 'cup', 'fps', 'pts', 'in', 'dm', '\"']; + EnglishNumericWithUnit.BuildPrefix = `(?<=(\\s|^))`; + EnglishNumericWithUnit.BuildSuffix = `(?=(\\s|\\W|$))`; + EnglishNumericWithUnit.LengthSuffixList = new Map([["Kilometer", "km|kilometer|kilometre|kilometers|kilometres|kilo meter|kilo meters|kilo metres|kilo metre"], ["Hectometer", "hm|hectometer|hectometre|hectometers|hectometres|hecto meter|hecto meters|hecto metres|hecto metre"], ["Decameter", "dam|decameter|decametre|decameters|decametres|deca meter|deca meters|deca metres|deca metre"], ["Meter", "m|meter|metre|meters|metres"], ["Decimeter", "dm|decimeter|decimeters|decimetre|decimetres|deci meter|deci meters|deci metres|deci metre"], ["Centimeter", "cm|centimeter|centimeters|centimetre|centimetres|centi meter|centi meters|centi metres|centi metre"], ["Millimeter", "mm|millimeter|millimeters|millimetre|millimetres|milli meter|milli meters|milli metres|milli metre"], ["Micrometer", "μm|micrometer|micrometre|micrometers|micrometres|micro meter|micro meters|micro metres|micro metre"], ["Nanometer", "nm|nanometer|nanometre|nanometers|nanometres|nano meter|nano meters|nano metres|nano metre"], ["Picometer", "pm|picometer|picometre|picometers|picometres|pico meter|pico meters|pico metres|pico metre"], ["Mile", "-mile|mile|miles"], ["Yard", "yard|yards"], ["Inch", "-inch|inch|inches|in|\""], ["Foot", "-foot|foot|feet|ft"], ["Light year", "light year|light-year|light years|light-years"], ["Pt", "pt|pts"]]); + EnglishNumericWithUnit.AmbiguousLengthUnitList = ['m', 'yard', 'yards', 'pm', 'pt', 'pts']; + EnglishNumericWithUnit.SpeedSuffixList = new Map([["Meter per second", "meters / second|m/s|meters per second|metres per second|meter per second|metre per second"], ["Kilometer per hour", "km/h|kilometres per hour|kilometers per hour|kilometer per hour|kilometre per hour"], ["Kilometer per minute", "km/min|kilometers per minute|kilometres per minute|kilometer per minute|kilometre per minute"], ["Kilometer per second", "km/s|kilometers per second|kilometres per second|kilometer per second|kilometre per second"], ["Mile per hour", "mph|mile per hour|miles per hour|mi/h|mile / hour|miles / hour|miles an hour"], ["Knot", "kt|knot|kn"], ["Foot per second", "ft/s|foot/s|foot per second|feet per second|fps"], ["Foot per minute", "ft/min|foot/min|foot per minute|feet per minute"], ["Yard per minute", "yards per minute|yard per minute|yards / minute|yards/min|yard/min"], ["Yard per second", "yards per second|yard per second|yards / second|yards/s|yard/s"]]); + EnglishNumericWithUnit.TemperatureSuffixList = new Map([["F", "degrees fahrenheit|degree fahrenheit|deg fahrenheit|degs fahrenheit|fahrenheit|°f|degrees farenheit|degree farenheit|deg farenheit|degs farenheit|degrees f|degree f|deg f|degs f|farenheit|f"], ["K", "k|kelvin"], ["R", "rankine|°r"], ["D", "delisle|°de"], ["C", "degrees celsius|degree celsius|deg celsius|degs celsius|celsius|degrees celcius|degree celcius|celcius|deg celcius|degs celcius|degrees centigrade|degree centigrade|centigrade|degrees centigrate|degree centigrate|degs centigrate|deg centigrate|centigrate|degrees c|degree c|deg c|degs c|°c|c"], ["Degree", "degree|degrees|deg.|deg|°"]]); + EnglishNumericWithUnit.AmbiguousTemperatureUnitList = ['c', 'f', 'k']; + EnglishNumericWithUnit.VolumeSuffixList = new Map([["Cubic meter", "m3|cubic meter|cubic meters|cubic metre|cubic metres"], ["Cubic centimeter", "cubic centimeter|cubic centimetre|cubic centimeters|cubic centimetres"], ["Cubic millimiter", "cubic millimiter|cubic millimitre|cubic millimiters|cubic millimitres"], ["Hectoliter", "hectoliter|hectolitre|hectoliters|hectolitres"], ["Decaliter", "decaliter|decalitre|dekaliter|dekalitre|decaliters|decalitres|dekaliters|dekalitres"], ["Liter", "l|litre|liter|liters|litres"], ["Deciliter", "dl|deciliter|decilitre|deciliters|decilitres"], ["Centiliter", "cl|centiliter|centilitre|centiliters|centilitres"], ["Milliliter", "ml|mls|millilitre|milliliter|millilitres|milliliters"], ["Cubic yard", "cubic yard|cubic yards"], ["Cubic inch", "cubic inch|cubic inches"], ["Cubic foot", "cubic foot|cubic feet"], ["Cubic mile", "cubic mile|cubic miles"], ["Fluid ounce", "fl oz|fluid ounce|fluid ounces"], ["Teaspoon", "teaspoon|teaspoons"], ["Tablespoon", "tablespoon|tablespoons"], ["Pint", "pint|pints"], ["Volume unit", "fluid dram|gill|quart|minim|barrel|cord|peck|bushel|hogshead"]]); + EnglishNumericWithUnit.AmbiguousVolumeUnitList = ['l', 'ounce', 'oz', 'cup', 'peck', 'cord', 'gill']; + EnglishNumericWithUnit.WeightSuffixList = new Map([["Kilogram", "kg|kilogram|kilograms|kilo|kilos"], ["Gram", "g|gram|grams"], ["Milligram", "mg|milligram|milligrams"], ["Barrel", "barrels|barrel"], ["Gallon", "-gallon|gallons|gallon"], ["Metric ton", "metric tons|metric ton"], ["Ton", "-ton|ton|tons|tonne|tonnes"], ["Pound", "pound|pounds|lb"], ["Ounce", "-ounce|ounce|oz|ounces"], ["Weight unit", "pennyweight|grain|british long ton|US short hundredweight|stone|dram"]]); + EnglishNumericWithUnit.AmbiguousWeightUnitList = ['g', 'oz', 'stone', 'dram']; +})(EnglishNumericWithUnit = exports.EnglishNumericWithUnit || (exports.EnglishNumericWithUnit = {})); + +}); + +unwrapExports(englishNumericWithUnit); + +var base = createCommonjsModule(function (module, exports) { +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); + + + + + +class EnglishNumberWithUnitExtractorConfiguration { + constructor(ci) { + this.cultureInfo = ci; + this.unitNumExtractor = new recognizersTextNumber.EnglishNumberExtractor(); + this.buildPrefix = englishNumericWithUnit.EnglishNumericWithUnit.BuildPrefix; + this.buildSuffix = englishNumericWithUnit.EnglishNumericWithUnit.BuildSuffix; + this.connectorToken = ''; + this.compoundUnitConnectorRegex = recognizersText.RegExpUtility.getSafeRegExp(englishNumericWithUnit.EnglishNumericWithUnit.CompoundUnitConnectorRegex); + this.pmNonUnitRegex = recognizersText.RegExpUtility.getSafeRegExp(baseUnits.BaseUnits.PmNonUnitRegex); + } +} +exports.EnglishNumberWithUnitExtractorConfiguration = EnglishNumberWithUnitExtractorConfiguration; +class EnglishNumberWithUnitParserConfiguration extends parsers$4.BaseNumberWithUnitParserConfiguration { + constructor(ci) { + super(ci); + this.internalNumberExtractor = new recognizersTextNumber.EnglishNumberExtractor(recognizersTextNumber.NumberMode.Default); + this.internalNumberParser = recognizersTextNumber.AgnosticNumberParserFactory.getParser(recognizersTextNumber.AgnosticNumberParserType.Number, new recognizersTextNumber.EnglishNumberParserConfiguration()); + this.connectorToken = ''; + this.currencyNameToIsoCodeMap = englishNumericWithUnit.EnglishNumericWithUnit.CurrencyNameToIsoCodeMap; + this.currencyFractionCodeList = englishNumericWithUnit.EnglishNumericWithUnit.FractionalUnitNameToCodeMap; + } +} +exports.EnglishNumberWithUnitParserConfiguration = EnglishNumberWithUnitParserConfiguration; + +}); + +unwrapExports(base); + +var currency = createCommonjsModule(function (module, exports) { +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); + + + + +class EnglishCurrencyExtractorConfiguration extends base.EnglishNumberWithUnitExtractorConfiguration { + constructor(ci) { + if (!ci) { + ci = new recognizersTextNumber.CultureInfo(recognizersTextNumber.Culture.English); + } + super(ci); + this.extractType = constants$2.Constants.SYS_UNIT_CURRENCY; + // Reference Source: https:// en.wikipedia.org/wiki/List_of_circulating_currencies + this.suffixList = englishNumericWithUnit.EnglishNumericWithUnit.CurrencySuffixList; + this.prefixList = englishNumericWithUnit.EnglishNumericWithUnit.CurrencyPrefixList; + this.ambiguousUnitList = englishNumericWithUnit.EnglishNumericWithUnit.AmbiguousCurrencyUnitList; + } +} +exports.EnglishCurrencyExtractorConfiguration = EnglishCurrencyExtractorConfiguration; +class EnglishCurrencyParserConfiguration extends base.EnglishNumberWithUnitParserConfiguration { + constructor(ci) { + if (!ci) { + ci = new recognizersTextNumber.CultureInfo(recognizersTextNumber.Culture.English); + } + super(ci); + this.BindDictionary(englishNumericWithUnit.EnglishNumericWithUnit.CurrencySuffixList); + this.BindDictionary(englishNumericWithUnit.EnglishNumericWithUnit.CurrencyPrefixList); + } +} +exports.EnglishCurrencyParserConfiguration = EnglishCurrencyParserConfiguration; + +}); + +unwrapExports(currency); + +var temperature = createCommonjsModule(function (module, exports) { +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); + + + + +class EnglishTemperatureExtractorConfiguration extends base.EnglishNumberWithUnitExtractorConfiguration { + constructor(ci) { + if (!ci) { + ci = new recognizersTextNumber.CultureInfo(recognizersTextNumber.Culture.English); + } + super(ci); + this.extractType = constants$2.Constants.SYS_UNIT_TEMPERATURE; + this.suffixList = englishNumericWithUnit.EnglishNumericWithUnit.TemperatureSuffixList; + this.prefixList = new Map(); + this.ambiguousUnitList = englishNumericWithUnit.EnglishNumericWithUnit.AmbiguousTemperatureUnitList; + } +} +exports.EnglishTemperatureExtractorConfiguration = EnglishTemperatureExtractorConfiguration; +class EnglishTemperatureParserConfiguration extends base.EnglishNumberWithUnitParserConfiguration { + constructor(ci) { + if (!ci) { + ci = new recognizersTextNumber.CultureInfo(recognizersTextNumber.Culture.English); + } + super(ci); + this.BindDictionary(englishNumericWithUnit.EnglishNumericWithUnit.TemperatureSuffixList); + } +} +exports.EnglishTemperatureParserConfiguration = EnglishTemperatureParserConfiguration; + +}); + +unwrapExports(temperature); + +var dimension = createCommonjsModule(function (module, exports) { +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); + + + + +const dimensionSuffixList = new Map([ + ...englishNumericWithUnit.EnglishNumericWithUnit.InformationSuffixList, + ...englishNumericWithUnit.EnglishNumericWithUnit.AreaSuffixList, + ...englishNumericWithUnit.EnglishNumericWithUnit.LengthSuffixList, + ...englishNumericWithUnit.EnglishNumericWithUnit.SpeedSuffixList, + ...englishNumericWithUnit.EnglishNumericWithUnit.VolumeSuffixList, + ...englishNumericWithUnit.EnglishNumericWithUnit.WeightSuffixList +]); +class EnglishDimensionExtractorConfiguration extends base.EnglishNumberWithUnitExtractorConfiguration { + constructor(ci) { + if (!ci) { + ci = new recognizersTextNumber.CultureInfo(recognizersTextNumber.Culture.English); + } + super(ci); + this.extractType = constants$2.Constants.SYS_UNIT_DIMENSION; + this.suffixList = dimensionSuffixList; + this.prefixList = new Map(); + this.ambiguousUnitList = englishNumericWithUnit.EnglishNumericWithUnit.AmbiguousDimensionUnitList; + } +} +exports.EnglishDimensionExtractorConfiguration = EnglishDimensionExtractorConfiguration; +class EnglishDimensionParserConfiguration extends base.EnglishNumberWithUnitParserConfiguration { + constructor(ci) { + if (!ci) { + ci = new recognizersTextNumber.CultureInfo(recognizersTextNumber.Culture.English); + } + super(ci); + this.BindDictionary(dimensionSuffixList); + } +} +exports.EnglishDimensionParserConfiguration = EnglishDimensionParserConfiguration; + +}); + +unwrapExports(dimension); + +var age = createCommonjsModule(function (module, exports) { +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); + + + + +class EnglishAgeExtractorConfiguration extends base.EnglishNumberWithUnitExtractorConfiguration { + constructor(ci) { + if (!ci) { + ci = new recognizersTextNumber.CultureInfo(recognizersTextNumber.Culture.English); + } + super(ci); + this.extractType = constants$2.Constants.SYS_UNIT_AGE; + this.suffixList = englishNumericWithUnit.EnglishNumericWithUnit.AgeSuffixList; + this.prefixList = new Map(); + this.ambiguousUnitList = new Array(); + } +} +exports.EnglishAgeExtractorConfiguration = EnglishAgeExtractorConfiguration; +class EnglishAgeParserConfiguration extends base.EnglishNumberWithUnitParserConfiguration { + constructor(ci) { + if (!ci) { + ci = new recognizersTextNumber.CultureInfo(recognizersTextNumber.Culture.English); + } + super(ci); + this.BindDictionary(englishNumericWithUnit.EnglishNumericWithUnit.AgeSuffixList); + } +} +exports.EnglishAgeParserConfiguration = EnglishAgeParserConfiguration; + +}); + +unwrapExports(age); + +var spanishNumericWithUnit = createCommonjsModule(function (module, exports) { +"use strict"; +// ------------------------------------------------------------------------------ +// +// This code was generated by a tool. +// Changes to this file may cause incorrect behavior and will be lost if +// the code is regenerated. +// +// ------------------------------------------------------------------------------ +Object.defineProperty(exports, "__esModule", { value: true }); +var SpanishNumericWithUnit; +(function (SpanishNumericWithUnit) { + SpanishNumericWithUnit.AgeSuffixList = new Map([["Año", "años|año"], ["Mes", "meses|mes"], ["Semana", "semanas|semana"], ["Día", "dias|días|día|dia"]]); + SpanishNumericWithUnit.AreaSuffixList = new Map([["Kilómetro cuadrado", "kilómetro cuadrado|kilómetros cuadrados|km2|km^2|km²"], ["Hectómetro cuadrado", "hectómetro cuadrado|hectómetros cuadrados|hm2|hm^2|hm²|hectárea|hectáreas"], ["Decámetro cuadrado", "decámetro cuadrado|decámetros cuadrados|dam2|dam^2|dam²|área|áreas"], ["Metro cuadrado", "metro cuadrado|metros cuadrados|m2|m^2|m²"], ["Decímetro cuadrado", "decímetro cuadrado|decímetros cuadrados|dm2|dm^2|dm²"], ["Centímetro cuadrado", "centímetro cuadrado|centímetros cuadrados|cm2|cm^2|cm²"], ["Milímetro cuadrado", "milímetro cuadrado|milímetros cuadrados|mm2|mm^2|mm²"], ["Pulgada cuadrado", "pulgada cuadrada|pulgadas cuadradas"], ["Pie cuadrado", "pie cuadrado|pies cuadrados|pie2|pie^2|pie²|ft2|ft^2|ft²"], ["Yarda cuadrado", "yarda cuadrada|yardas cuadradas|yd2|yd^2|yd²"], ["Acre", "acre|acres"]]); + SpanishNumericWithUnit.AreaAmbiguousValues = ['área', 'áreas']; + SpanishNumericWithUnit.CurrencySuffixList = new Map([["Dólar", "dólar|dólares"], ["Peso", "peso|pesos"], ["Rublo", "rublo|rublos"], ["Libra", "libra|libras"], ["Florín", "florín|florines"], ["Dinar", "dinar|dinares"], ["Franco", "franco|francos"], ["Rupia", "rupia|rupias"], ["Escudo", "escudo|escudos"], ["Chelín", "chelín|chelines"], ["Lira", "lira|liras"], ["Centavo", "centavo|centavos"], ["Céntimo", "céntimo|céntimos"], ["Centésimo", "centésimo|centésimos"], ["Penique", "penique|peniques"], ["Euro", "euro|euros|€|eur"], ["Céntimo de Euro", "céntimo de euro|céntimos de euros"], ["Dólar del Caribe Oriental", "dólar del Caribe Oriental|dólares del Caribe Oriental|ec$|xcd"], ["Centavo del Caribe Oriental", "centavo del Caribe Oriental|centavos del Caribe Oriental"], ["Franco CFA de África Occidental", "franco CFA de África Occidental|francos CFA de África Occidental|fcfa|xof"], ["Céntimo de CFA de África Occidental", "céntimo de CFA de África Occidental|céntimos de CFA de África Occidental"], ["Franco CFA de África Central", "franco CFA de África Central|francos CFA de África Central|xaf"], ["Céntimo de CFA de África Central", "céntimo de CFA de África Central|céntimos de CFA de África Central"], ["Apsar", "apsar|apsares"], ["Afgani afgano", "afgani afgano|؋|afn|afganis|afgani"], ["Pul", "pul|puls"], ["Lek albanés", "lek|lekë|lekes|lek albanés"], ["Qindarka", "qindarka|qindarkë|qindarkas"], ["Kwanza angoleño", "kwanza angoleño|kwanzas angoleños|kwanza angoleños|kwanzas angoleño|kwanzas|aoa|kz"], ["Cêntimo angoleño", "cêntimo angoleño|cêntimo|cêntimos"], ["Florín antillano neerlandés", "florín antillano neerlandés|florínes antillano neerlandés|ƒ antillano neerlandés|ang|naƒ"], ["Cent antillano neerlandés", "cent|centen"], ["Riyal saudí", "riyal saudí|riyales saudí|sar"], ["Halalá saudí", "halalá saudí|hallalah"], ["Dinar argelino", "dinar argelino|dinares argelinos|dzd"], ["Céntimo argelino", "centimo argelino|centimos argelinos|"], ["Peso argentino", "peso argentino|pesos argentinos|peso|pesos|ar$|ars"], ["Centavo argentino", "centavo argentino|centavos argentinos|centavo|ctvo.|ctvos."], ["Dram armenio", "dram armenio|dram armenios|dram|դր."], ["Luma armenio", "luma armenio|luma armenios"], ["Florín arubeño", "florín arubeño|florines arubeños|ƒ arubeños|aƒ|awg"], ["Yotin arubeño", "yotin arubeño|yotines arubeños"], ["Dólar australiano", "dólar australiano|dólares australianos|a$|aud"], ["Centavo australiano", "centavo australiano|centavos australianos"], ["Manat azerí", "manat azerí|man|azn"], ["Qəpik azerí", "qəpik azerí|qəpik"], ["Dólar bahameño", "dólar bahameño|dólares bahameños|b$|bsd"], ["Centavo bahameño", "centavo bahameño|centavos bahameños"], ["Dinar bahreiní", "dinar bahreiní|dinares bahreinies|bhd"], ["Fil bahreiní", "fil bahreiní|fils bahreinies"], ["Taka bangladeshí", "taka bangladeshí|takas bangladeshí|bdt"], ["Poisha bangladeshí", "poisha bangladeshí|poishas bangladeshí"], ["Dólar de Barbados", "dólar de barbados|dólares de barbados|bbd"], ["Centavo de Barbados", "centavo de barbados|centavos de barbados"], ["Dólar beliceño", "dólar beliceño|dólares beliceños|bz$|bzd"], ["Centavo beliceño", "centavo beliceño|centavos beliceños"], ["Dólar bermudeño", "dólar bermudeño|dólares bermudeños|bd$|bmd"], ["Centavo bermudeño", "centavo bermudeño|centavos bermudeños"], ["Rublo bielorruso", "rublo bielorruso|rublos bielorrusos|br|byr"], ["Kópek bielorruso", "kópek bielorruso|kópeks bielorrusos|kap"], ["Kyat birmano", "kyat birmano|kyats birmanos|mmk"], ["Pya birmano", "pya birmano|pyas birmanos"], ["Boliviano", "boliviano|bolivianos|bob|bs"], ["Centésimo Boliviano", "centésimo boliviano|centésimos bolivianos"], ["Marco bosnioherzegovino", "marco convertible|marco bosnioherzegovino|marcos convertibles|marcos bosnioherzegovinos|bam"], ["Feningas bosnioherzegovino", "feninga convertible|feninga bosnioherzegovina|feningas convertibles"], ["Pula", "pula|bwp"], ["Thebe", "thebe"], ["Real brasileño", "real brasileño|reales brasileños|r$|brl"], ["Centavo brasileño", "centavo brasileño|centavos brasileños"], ["Dólar de Brunéi", "dólar de brunei|dólares de brunéi|bnd"], ["Sen de Brunéi", "sen|sen de brunéi"], ["Lev búlgaro", "lev búlgaro|leva búlgaros|lv|bgn"], ["Stotinki búlgaro", "stotinka búlgaro|stotinki búlgaros"], ["Franco de Burundi", "franco de burundi|francos de burundi|fbu|fib"], ["Céntimo Burundi", "céntimo burundi|céntimos burundies"], ["Ngultrum butanés", "ngultrum butanés|ngultrum butaneses|btn"], ["Chetrum butanés", "chetrum butanés|chetrum butaneses"], ["Escudo caboverdiano", "escudo caboverdiano|escudos caboverdianos|cve"], ["Riel camboyano", "riel camboyano|rieles camboyanos|khr"], ["Dólar canadiense", "dólar canadiense|dólares canadienses|c$|cad"], ["Centavo canadiense", "centavo canadiense|centavos canadienses"], ["Peso chileno", "peso chileno|pesos chilenos|cpl"], ["Yuan chino", "yuan chino|yuanes chinos|yuan|yuanes|renminbi|rmb|cny|¥"], ["Peso colombiano", "peso colombiano|pesos colombianos|cop|col$"], ["Centavo colombiano", "centavo colombiano|centavos colombianos"], ["Franco comorano", "franco comorano|francos comoranos|kmf|₣"], ["Franco congoleño", "franco congoleño|francos congoleños|cdf"], ["Céntimo congoleño", "céntimo congoleño|céntimos congoleños"], ["Won norcoreano", "won norcoreano|wŏn norcoreano|wŏn norcoreanos|kpw"], ["Chon norcoreano", "chon norcoreano|chŏn norcoreano|chŏn norcoreanos|chon norcoreanos"], ["Won surcoreano", "wŏn surcoreano|won surcoreano|wŏnes surcoreanos|wones surcoreanos|krw"], ["Chon surcoreano", "chon surcoreano|chŏn surcoreano|chŏn surcoreanos|chon surcoreanos"], ["Colón costarricense", "colón costarricense|colones costarricenses|crc"], ["Kuna croata", "kuna croata|kuna croatas|hrk"], ["Lipa croata", "lipa croata|lipa croatas"], ["Peso cubano", "peso cubano|pesos cubanos|cup"], ["Peso cubano convertible", "peso cubano convertible|pesos cubanos convertible|cuc"], ["Corona danesa", "corona danesa|coronas danesas|dkk"], ["Libra egipcia", "libra egipcia|libras egipcias|egp|le"], ["Piastra egipcia", "piastra egipcia|piastras egipcias"], ["Colón salvadoreño", "colón salvadoreño|colones salvadoreños|svc"], ["Dirham de los Emiratos Árabes Unidos", "dirham|dirhams|dirham de los Emiratos Árabes Unidos|aed|dhs"], ["Nakfa", "nakfa|nfk|ern"], ["Céntimo de Nakfa", "céntimo de nakfa|céntimos de nakfa"], ["Peseta", "peseta|pesetas|pts.|ptas.|esp"], ["Dólar estadounidense", "dólar estadounidense|dólares estadounidenses|usd|u$d|us$"], ["Corona estonia", "corona estonia|coronas estonias|eek"], ["Senti estonia", "senti estonia|senti estonias"], ["Birr etíope", "birr etíope|birr etíopes|br|etb"], ["Santim etíope", "santim etíope|santim etíopes"], ["Peso filipino", "peso filipino|pesos filipinos|php"], ["Marco finlandés", "marco finlandés|marcos finlandeses"], ["Dólar fiyiano", "dólar fiyiano|dólares fiyianos|fj$|fjd"], ["Centavo fiyiano", "centavo fiyiano|centavos fiyianos"], ["Dalasi", "dalasi|gmd"], ["Bututs", "butut|bututs"], ["Lari georgiano", "lari georgiano|lari georgianos|gel"], ["Tetri georgiano", "tetri georgiano|tetri georgianos"], ["Cedi", "cedi|ghs|gh₵"], ["Pesewa", "pesewa"], ["Libra gibraltareña", "libra gibraltareña|libras gibraltareñas|gip"], ["Penique gibraltareña", "penique gibraltareña|peniques gibraltareñas"], ["Quetzal guatemalteco", "quetzal guatemalteco|quetzales guatemaltecos|quetzal|quetzales|gtq"], ["Centavo guatemalteco", "centavo guatemalteco|centavos guatemaltecos"], ["Libra de Guernsey", "libra de Guernsey|libras de Guernsey|ggp"], ["Penique de Guernsey", "penique de Guernsey|peniques de Guernsey"], ["Franco guineano", "franco guineano|francos guineanos|gnf|fg"], ["Céntimo guineano", "céntimo guineano|céntimos guineanos"], ["Dólar guyanés", "dólar guyanés|dólares guyaneses|gyd|gy"], ["Gourde haitiano", "gourde haitiano|gourde haitianos|htg"], ["Céntimo haitiano", "céntimo haitiano|céntimos haitianos"], ["Lempira hondureño", "lempira hondureño|lempira hondureños|hnl"], ["Centavo hondureño", "centavo hondureño|centavos hondureño"], ["Dólar de Hong Kong", "dólar de hong kong|dólares de hong kong|hk$|hkd"], ["Forinto húngaro", "forinto húngaro|forinto húngaros|huf"], ["Rupia india", "rupia india|rupias indias|inr"], ["Paisa india", "paisa india|paise indias"], ["Rupia indonesia", "rupia indonesia|rupias indonesias|idr"], ["Sen indonesia", "sen indonesia|sen indonesias"], ["Rial iraní", "rial iraní|rial iranies|irr"], ["Dinar iraquí", "dinar iraquí|dinares iraquies|iqd"], ["Fil iraquí", "fil iraquí|fils iraquies"], ["Libra manesa", "libra manesa|libras manesas|imp"], ["Penique manes", "penique manes|peniques maneses"], ["Corona islandesa", "corona islandesa|coronas islandesas|isk|íkr"], ["Aurar islandes", "aurar islandes|aurar islandeses"], ["Dólar de las Islas Caimán", "dólar de las Islas Caimán|dólares de las Islas Caimán|ci$|kyd"], ["Dólar de las Islas Cook", "dólar de las Islas Cook|dólares de las Islas Cook"], ["Corona feroesa", "corona feroesa|coronas feroesas|fkr"], ["Libra malvinense", "libra malvinense|libras malvinenses|fk£|fkp"], ["Dólar de las Islas Salomón", "dólar de las Islas Salomón|dólares de las Islas Salomón|sbd"], ["Nuevo shéquel", "nuevo shéquel|nuevos shéquel|ils"], ["Agorot", "agorot"], ["Dólar jamaiquino", "dólar jamaiquino|dólares jamaiquinos|j$|ja$|jmd"], ["Yen", "yen|yenes|jpy"], ["Libra de Jersey", "libra de Jersey|libras de Jersey|jep"], ["Dinar jordano", "dinar jordano|dinares jordanos|jd|jod"], ["Piastra jordano", "piastra jordano|piastras jordanos"], ["Tenge kazajo", "tenge|tenge kazajo|kzt"], ["Chelín keniano", "chelín keniano|chelines kenianos|ksh|kes"], ["Som kirguís", "som kirguís|kgs"], ["Tyiyn", "tyiyn"], ["Dólar de Kiribati", "dólar de Kiribati|dólares de Kiribati"], ["Dinar kuwaití", "dinar kuwaití|dinares kuwaití"], ["Kip laosiano", "kip|kip laosiano|kip laosianos|lak"], ["Att laosiano", "att|att laosiano|att laosianos"], ["Loti", "loti|maloti|lsl"], ["Sente", "sente|lisente"], ["Libra libanesa", "libra libanesa|libras libanesas|lbp"], ["Dólar liberiano", "dólar liberiano|dólares liberianos|l$|lrd"], ["Dinar libio", "dinar libio|dinares libios|ld|lyd"], ["Dirham libio", "dirham libio|dirhams libios"], ["Litas lituana", "litas lituana|litai lituanas|ltl"], ["Pataca macaense", "pataca macaense|patacas macaenses|mop$|mop"], ["Avo macaense", "avo macaense|avos macaenses"], ["Ho macaense", "ho macaense|ho macaenses"], ["Denar macedonio", "denar macedonio|denare macedonios|den|mkd"], ["Deni macedonio", "deni macedonio|deni macedonios"], ["Ariary malgache", "ariary malgache|ariary malgaches|mga"], ["Iraimbilanja malgache", "iraimbilanja malgache|iraimbilanja malgaches"], ["Ringgit malayo", "ringgit malayo|ringgit malayos|rm|myr"], ["Sen malayo", "sen malayo|sen malayos"], ["Kwacha malauí", "kwacha malauí|mk|mwk"], ["Támbala malauí", "támbala malauí"], ["Rupia de Maldivas", "rupia de Maldivas|rupias de Maldivas|mvr"], ["Dirham marroquí", "dirham marroquí|dirhams marroquies|mad"], ["Rupia de Mauricio", "rupia de Mauricio|rupias de Mauricio|mur"], ["Uguiya", "uguiya|uguiyas|mro"], ["Jum", "jum|jums"], ["Peso mexicano", "peso mexicano|pesos mexicanos|mxn"], ["Centavo mexicano", "centavo mexicano|centavos mexicanos"], ["Leu moldavo", "leu moldavo|lei moldavos|mdl"], ["Ban moldavo", "ban moldavo|bani moldavos"], ["Tugrik mongol", "tugrik mongol|tugrik|tugrik mongoles|tug|mnt"], ["Metical mozambiqueño", "metical|metical mozambiqueño|meticales|meticales mozambiqueños|mtn|mzn"], ["Dram de Nagorno Karabaj", "dram de Nagorno Karabaj|drams de Nagorno Karabaj|"], ["Luma de Nagorno Karabaj", "luma de Nagorno Karabaj"], ["Dólar namibio", "dólar namibio|dólares namibios|n$|nad"], ["Centavo namibio", "centavo namibio|centavos namibios"], ["Rupia nepalí", "rupia nepalí|rupias nepalies|npr"], ["Paisa nepalí", "paisa nepalí|paisas nepalies"], ["Córdoba nicaragüense", "córdoba nicaragüense|córdobas nicaragüenses|c$|nio"], ["Centavo nicaragüense", "centavo nicaragüense|centavos nicaragüenses"], ["Naira", "naira|ngn"], ["Kobo", "kobo"], ["Corona noruega", "corona noruega|coronas noruegas|nok"], ["Franco CFP", "franco cfp|francos cfp|xpf"], ["Dólar neozelandés", "dólar neozelandés|dólares neozelandeses|dólar de Nueva Zelanda|dólares de Nueva Zelanda|nz$|nzd"], ["Centavo neozelandés", "centavo neozelandés|centavo de Nueva Zelanda|centavos de Nueva Zelanda|centavos neozelandeses"], ["Rial omaní", "rial omaní|riales omanies|omr"], ["Baisa omaní", "baisa omaní|baisa omanies"], ["Florín neerlandés", "florín neerlandés|florines neerlandeses|nlg"], ["Rupia pakistaní", "rupia pakistaní|rupias pakistanies|pkr"], ["Paisa pakistaní", "paisa pakistaní|paisas pakistanies"], ["Balboa panameño", "balboa panameño|balboa panameños|pab"], ["Centésimo panameño", "centésimo panameño|centésimos panameños"], ["Kina", "kina|pkg|pgk"], ["Toea", "toea"], ["Guaraní", "guaraní|guaranies|gs|pyg"], ["Sol", "sol|soles|nuevo sol|pen|s#."], ["Céntimo de sol", "céntimo de sol|céntimos de sol"], ["Złoty", "złoty|esloti|eslotis|zł|pln"], ["Groszy", "groszy"], ["Riyal qatarí", "riyal qatarí|riyal qataries|qr|qar"], ["Dirham qatarí", "dirham qatarí|dirhams qataries"], ["Libra esterlina", "libra esterlina|libras esterlinas|gbp"], ["Corona checa", "corona checa|coronas checas|kc|czk"], ["Peso dominicano", "peso dominicano|pesos dominicanos|rd$|dop"], ["Centavo dominicano", "centavo dominicano|centavos dominicanos"], ["Franco ruandés", "franco ruandés|francos ruandeses|rf|rwf"], ["Céntimo ruandés", "céntimo ruandés|céntimos ruandeses"], ["Leu rumano", "leu rumano|lei rumanos|ron"], ["Ban rumano", "ban rumano|bani rumanos"], ["Rublo ruso", "rublo ruso|rublos rusos|rub"], ["Kopek ruso", "kopek ruso|kopeks rusos"], ["Tala", "tala|tālā|ws$|sat|wst"], ["Sene", "sene"], ["Libra de Santa Helena", "libra de Santa Helena|libras de Santa Helena|shp"], ["Penique de Santa Helena", "penique de Santa Helena|peniques de Santa Helena"], ["Dobra", "dobra|db|std"], ["Dinar serbio", "dinar serbio|dinares serbios|rsd"], ["Para serbio", "para serbio|para serbios"], ["Rupia de Seychelles", "rupia de Seychelles|rupias de Seychelles|scr"], ["Centavo de Seychelles", "centavo de Seychelles|centavos de Seychelles"], ["Leone", "leone|le|sll"], ["Dólar de Singapur", "dólar de singapur|dólares de singapur|sgb"], ["Centavo de Singapur", "centavo de Singapur|centavos de Singapur"], ["Libra siria", "libra siria|libras sirias|s£|syp"], ["Piastra siria", "piastra siria|piastras sirias"], ["Chelín somalí", "chelín somalí|chelines somalies|sos"], ["Centavo somalí", "centavo somalí|centavos somalies"], ["Chelín somalilandés", "chelín somalilandés|chelines somalilandeses"], ["Centavo somalilandés", "centavo somalilandés|centavos somalilandeses"], ["Rupia de Sri Lanka", "rupia de Sri Lanka|rupias de Sri Lanka|lkr"], ["Céntimo de Sri Lanka", "céntimo de Sri Lanka|céntimos de Sri Lanka"], ["Lilangeni", "lilangeni|emalangeni|szl"], ["Rand sudafricano", "rand|rand sudafricano|zar"], ["Libra sudanesa", "libra sudanesa|libras sudanesas|sdg"], ["Piastra sudanesa", "piastra sudanesa|piastras sudanesas"], ["Libra sursudanesa", "libra sursudanesa|libras sursudanesa|ssp"], ["Piastra sursudanesa", "piastra sursudanesa|piastras sursudanesas"], ["Corona sueca", "corona sueca|coronas suecas|sek"], ["Franco suizo", "franco suizo|francos suizos|sfr|chf"], ["Rappen suizo", "rappen suizo|rappens suizos"], ["Dólar surinamés", "óolar surinamés|dólares surinameses|srd"], ["Centavo surinamés", "centavo surinamés|centavos surinamés"], ["Baht tailandés", "baht tailandés|baht tailandeses|thb"], ["Satang tailandés", "satang tailandés|satang tailandeses"], ["Nuevo dólar taiwanés", "nuevo dólar taiwanés|dólar taiwanés|dólares taiwaneses|twd"], ["Centavo taiwanés", "centavo taiwanés|centavos taiwaneses"], ["Chelín tanzano", "chelín tanzano|chelines tanzanos|tzs"], ["Centavo tanzano", "centavo tanzano|centavos tanzanos"], ["Somoni tayiko", "somoni tayiko|somoni|tjs"], ["Diram", "diram|dirams"], ["Paʻanga", "dólar tongano|dólares tonganos|paʻanga|pa'anga|top"], ["Seniti", "seniti"], ["Rublo de Transnistria", "rublo de Transnistria|rublos de Transnistria"], ["Kopek de Transnistria", "kopek de Transnistria|kopeks de Transnistria"], ["Dólar trinitense", "dólar trinitense|dólares trinitenses|ttd"], ["Centavo trinitense", "centavo trinitense|centavos trinitenses"], ["Dinar tunecino", "dinar tunecino|dinares tunecinos|tnd"], ["Millime tunecino", "millime tunecino|millimes tunecinos"], ["Lira turca", "lira turca|liras turcas|try"], ["Kuruş turca", "kuruş turca|kuruş turcas"], ["Manat turkmeno", "manat turkmeno|manat turkmenos|tmt"], ["Tennesi turkmeno", "tennesi turkmeno|tenge turkmeno"], ["Dólar tuvaluano", "dólar tuvaluano|dólares tuvaluanos"], ["Centavo tuvaluano", "centavo tuvaluano|centavos tuvaluanos"], ["Grivna", "grivna|grivnas|uah"], ["Kopiyka", "kopiyka|kópeks"], ["Chelín ugandés", "chelín ugandés|chelines ugandeses|ugx"], ["Centavo ugandés", "centavo ugandés|centavos ugandeses"], ["Peso uruguayo", "peso uruguayo|pesos uruguayos|uyu"], ["Centésimo uruguayo", "centésimo uruguayo|centésimos uruguayos"], ["Som uzbeko", "som uzbeko|som uzbekos|uzs"], ["Tiyin uzbeko", "tiyin uzbeko|tiyin uzbekos"], ["Vatu", "vatu|vuv"], ["Bolívar fuerte", "bolívar fuerte|bolívar|bolívares|vef"], ["Céntimo de bolívar", "céntimo de bolívar|céntimos de bolívar"], ["Đồng vietnamita", "Đồng vietnamita|dong vietnamita|dong vietnamitas|vnd"], ["Hào vietnamita", "Hào vietnamita|hao vietnamita|hao vietnamitas"], ["Rial yemení", "rial yemení|riales yemenies|yer"], ["Fils yemení", "fils yemení|fils yemenies"], ["Franco yibutiano", "franco yibutiano|francos yibutianos|djf"], ["Dinar yugoslavo", "dinar yugoslavo|dinares yugoslavos|yud"], ["Kwacha zambiano", "kwacha zambiano|kwacha zambianos|zmw"], ["Ngwee zambiano", "ngwee zambiano|ngwee zambianos"]]); + SpanishNumericWithUnit.CompoundUnitConnectorRegex = `(?[^.])`; + SpanishNumericWithUnit.CurrencyPrefixList = new Map([["Dólar", "$"], ["Dólar estadounidense", "us$|u$d|usd"], ["Dólar del Caribe Oriental", "ec$|xcd"], ["Dólar australiano", "a$|aud"], ["Dólar bahameño", "b$|bsd"], ["Dólar de Barbados", "bds$|bbd"], ["Dólar beliceño", "bz$|bzd"], ["Dólar bermudeño", "bd$|bmd"], ["Dólar de Brunéi", "brunéi $|bnd"], ["Dólar de Singapur", "s$|sgd"], ["Dólar canadiense", "c$|can$|cad"], ["Dólar de las Islas Caimán", "ci$|kyd"], ["Dólar neozelandés", "nz$|nzd"], ["Dólar fiyiano", "fj$|fjd"], ["Dólar guyanés", "gy$|gyd"], ["Dólar de Hong Kong", "hk$|hkd"], ["Dólar jamaiquino", "j$|ja$|jmd"], ["Dólar liberiano", "l$|lrd"], ["Dólar namibio", "n$|nad"], ["Dólar de las Islas Salomón", "si$|sbd"], ["Nuevo dólar taiwanés", "nt$|twd"], ["Real brasileño", "r$|brl"], ["Guaraní", "₲|gs.|pyg"], ["Dólar trinitense", "tt$|ttd"], ["Yuan chino", "¥|cny|rmb"], ["Yen", "¥|jpy"], ["Euro", "€|eur"], ["Florín", "ƒ"], ["Libra", "£|gbp"], ["Colón costarricense", "₡"], ["Lira turca", "₺"]]); + SpanishNumericWithUnit.AmbiguousCurrencyUnitList = ['le']; + SpanishNumericWithUnit.DimensionSuffixList = new Map([["Kilómetro", "km|kilometro|kilómetro|kilometros|kilómetros"], ["Hectómetro", "hm|hectometro|hectómetro|hectometros|hectómetros"], ["Decámetro", "decametro|decámetro|decametros|decámetros|dam"], ["Metro", "m|m.|metro|metros"], ["Decímetro", "dm|decimetro|decímetro|decimetros|decímetros"], ["Centímetro", "cm|centimetro|centímetro|centimetros|centimetros"], ["Milímetro", "mm|milimetro|milímetro|milimetros|milímetros"], ["Micrómetro", "µm|um|micrometro|micrómetro|micrometros|micrómetros|micrón|micrónes"], ["Nanómetro", "nm|nanometro|nanómetro|nanometros|nanómetros"], ["Picómetro", "pm|picometro|picómetro|picometros|picometros"], ["Milla", "mi|milla|millas"], ["Yarda", "yd|yarda|yardas"], ["Pulgada", "pulgada|pulgadas|\""], ["Pie", "pie|pies|ft"], ["Año luz", "año luz|años luz|al"], ["Metro por segundo", "metro/segundo|m/s|metro por segundo|metros por segundo|metros por segundos"], ["Kilómetro por hora", "km/h|kilómetro por hora|kilometro por hora|kilómetros por hora|kilometros por hora|kilómetro/hora|kilometro/hora|kilómetros/hora|kilometros/hora"], ["Kilómetro por minuto", "km/min|kilómetro por minuto|kilometro por minuto|kilómetros por minuto|kilometros por minuto|kilómetro/minuto|kilometro/minuto|kilómetros/minuto|kilometros/minuto"], ["Kilómetro por segundo", "km/seg|kilómetro por segundo|kilometro por segundo|kilómetros por segundo|kilometros por segundo|kilómetro/segundo|kilometro/segundo|kilómetros/segundo|kilometros/segundo"], ["Milla por hora", "mph|milla por hora|mi/h|milla/hora|millas/hora|millas por hora"], ["Nudo", "kt|nudo|nudos|kn"], ["Pie por segundo", "ft/s|pie/s|ft/seg|pie/seg|pie por segundo|pies por segundo"], ["Pie por minuto", "ft/min|pie/min|pie por minuto|pies por minuto"], ["Yarda por minuto", "yardas por minuto|yardas/minuto|yardas/min"], ["Yarda por segundo", "yardas por segundo|yardas/segundo|yardas/seg"], ["Kilómetro cuadrado", "kilómetro cuadrado|kilómetros cuadrados|km2|km^2|km²"], ["Hectómetro cuadrado", "hectómetro cuadrado|hectómetros cuadrados|hm2|hm^2|hm²|hectárea|hectáreas"], ["Decámetro cuadrado", "decámetro cuadrado|decámetros cuadrados|dam2|dam^2|dam²|área|áreas"], ["Metro cuadrado", "metro cuadrado|metros cuadrados|m2|m^2|m²"], ["Decímetro cuadrado", "decímetro cuadrado|decímetros cuadrados|dm2|dm^2|dm²"], ["Centímetro cuadrado", "centímetro cuadrado|centímetros cuadrados|cm2|cm^2|cm²"], ["Milímetro cuadrado", "milímetro cuadrado|milímetros cuadrados|mm2|mm^2|mm²"], ["Pulgada cuadrado", "pulgada cuadrada|pulgadas cuadradas"], ["Pie cuadrado", "pie cuadrado|pies cuadrados|pie2|pie^2|pie²|ft2|ft^2|ft²"], ["Yarda cuadrado", "yarda cuadrada|yardas cuadradas|yd2|yd^2|yd²"], ["Acre", "acre|acres"], ["Kilómetro cúbico", "kilómetro cúbico|kilómetros cúbico|km3|km^3|km³"], ["Hectómetro cúbico", "hectómetro cúbico|hectómetros cúbico|hm3|hm^3|hm³"], ["Decámetro cúbico", "decámetro cúbico|decámetros cúbico|dam3|dam^3|dam³"], ["Metro cúbico", "metro cúbico|metros cúbico|m3|m^3|m³"], ["Decímetro cúbico", "decímetro cúbico|decímetros cúbico|dm3|dm^3|dm³"], ["Centímetro cúbico", "centímetro cúbico|centímetros cúbico|cc|cm3|cm^3|cm³"], ["Milímetro cúbico", "milímetro cúbico|milímetros cúbico|mm3|mm^3|mm³"], ["Pulgada cúbica", "pulgada cúbics|pulgadas cúbicas"], ["Pie cúbico", "pie cúbico|pies cúbicos|pie3|pie^3|pie³|ft3|ft^3|ft³"], ["Yarda cúbica", "yarda cúbica|yardas cúbicas|yd3|yd^3|yd³"], ["Hectolitro", "hectolitro|hectolitros|hl"], ["Litro", "litro|litros|lts|l"], ["Mililitro", "mililitro|mililitros|ml"], ["Galón", "galón|galones"], ["Pinta", "pinta|pintas"], ["Barril", "barril|barriles"], ["Onza líquida", "onza líquida|onzas líquidas"], ["Tonelada métrica", "tonelada métrica|toneladas métricas"], ["Tonelada", "ton|tonelada|toneladas"], ["Kilogramo", "kg|kilogramo|kilogramos"], ["Hectogramo", "hg|hectogramo|hectogramos"], ["Decagramo", "dag|decagramo|decagramos"], ["Gramo", "g|gr|gramo|gramos"], ["Decigramo", "dg|decigramo|decigramos"], ["Centigramo", "cg|centigramo|centigramos"], ["Miligramo", "mg|miligramo|miligramos"], ["Microgramo", "µg|ug|microgramo|microgramos"], ["Nanogramo", "ng|nanogramo|nanogramos"], ["Picogramo", "pg|picogramo|picogramos"], ["Libra", "lb|libra|libras"], ["Onza", "oz|onza|onzas"], ["Grano", "grano|granos"], ["Quilate", "ct|kt|quilate|quilates"], ["bit", "bit|bits"], ["kilobit", "kilobit|kilobits|kb|kbit"], ["megabit", "megabit|megabits|Mb|Mbit"], ["gigabit", "gigabit|gigabits|Gb|Gbit"], ["terabit", "terabit|terabits|Tb|Tbit"], ["petabit", "petabit|petabits|Pb|Pbit"], ["kibibit", "kibibit|kibibits|kib|kibit"], ["mebibit", "mebibit|mebibits|Mib|Mibit"], ["gibibit", "gibibit|gibibits|Gib|Gibit"], ["tebibit", "tebibit|tebibits|Tib|Tibit"], ["pebibit", "pebibit|pebibits|Pib|Pibit"], ["byte", "byte|bytes"], ["kilobyte", "kilobyte|kilobytes|kB|kByte"], ["megabyte", "megabyte|megabytes|MB|MByte"], ["gigabyte", "gigabyte|gigabytes|GB|GByte"], ["terabyte", "terabyte|terabytes|TB|TByte"], ["petabyte", "petabyte|petabytes|PB|PByte"], ["kibibyte", "kibibyte|kibibytes|kiB|kiByte"], ["mebibyte", "mebibyte|mebibytes|MiB|MiByte"], ["gibibyte", "gibibyte|gibibytes|GiB|GiByte"], ["tebibyte", "tebibyte|tebibytes|TiB|TiByte"], ["pebibyte", "pebibyte|pebibytes|PiB|PiByte"]]); + SpanishNumericWithUnit.AmbiguousDimensionUnitList = ['al', 'mi', 'área', 'áreas', 'pie', 'pies']; + SpanishNumericWithUnit.LengthSuffixList = new Map([["Kilómetro", "km|kilometro|kilómetro|kilometros|kilómetros"], ["Hectómetro", "hm|hectometro|hectómetro|hectometros|hectómetros"], ["Decámetro", "decametro|decámetro|decametros|decámetros|dam"], ["Metro", "m|m.|metro|metros"], ["Decímetro", "dm|decimetro|decímetro|decimetros|decímetros"], ["Centímetro", "cm|centimetro|centímetro|centimetros|centimetros"], ["Milímetro", "mm|milimetro|milímetro|milimetros|milímetros"], ["Micrómetro", "µm|um|micrometro|micrómetro|micrometros|micrómetros|micrón|micrónes"], ["Nanómetro", "nm|nanometro|nanómetro|nanometros|nanómetros"], ["Picómetro", "pm|picometro|picómetro|picometros|picómetros"], ["Milla", "mi|milla|millas"], ["Yarda", "yd|yarda|yardas"], ["Pulgada", "pulgada|pulgadas|\""], ["Pie", "pie|pies|ft"], ["Año luz", "año luz|años luz|al"]]); + SpanishNumericWithUnit.AmbiguousLengthUnitList = ['mi', 'área', 'áreas']; + SpanishNumericWithUnit.BuildPrefix = `(?<=(\\s|^|\\P{L}))`; + SpanishNumericWithUnit.BuildSuffix = `(?=(\\s|\\P{L}|$))`; + SpanishNumericWithUnit.ConnectorToken = 'de'; + SpanishNumericWithUnit.SpeedSuffixList = new Map([["Metro por segundo", "metro/segundo|m/s|metro por segundo|metros por segundo|metros por segundos"], ["Kilómetro por hora", "km/h|kilómetro por hora|kilometro por hora|kilómetros por hora|kilometros por hora|kilómetro/hora|kilometro/hora|kilómetros/hora|kilometros/hora"], ["Kilómetro por minuto", "km/min|kilómetro por minuto|kilometro por minuto|kilómetros por minuto|kilometros por minuto|kilómetro/minuto|kilometro/minuto|kilómetros/minuto|kilometros/minuto"], ["Kilómetro por segundo", "km/seg|kilómetro por segundo|kilometro por segundo|kilómetros por segundo|kilometros por segundo|kilómetro/segundo|kilometro/segundo|kilómetros/segundo|kilometros/segundo"], ["Milla por hora", "mph|milla por hora|mi/h|milla/hora|millas/hora|millas por hora"], ["Nudo", "kt|nudo|nudos|kn"], ["Pie por segundo", "ft/s|pie/s|ft/seg|pie/seg|pie por segundo|pies por segundo"], ["Pie por minuto", "ft/min|pie/min|pie por minuto|pies por minuto"], ["Yarda por minuto", "yardas por minuto|yardas/minuto|yardas/min"], ["Yarda por segundo", "yardas por segundo|yardas/segundo|yardas/seg"]]); + SpanishNumericWithUnit.AmbiguousSpeedUnitList = ['nudo', 'nudos']; + SpanishNumericWithUnit.TemperatureSuffixList = new Map([["Kelvin", "k|kelvin"], ["Rankine", "r|rankine"], ["Grado Celsius", "°c|grados c|grado celsius|grados celsius|celsius|grado centígrado|grados centígrados|centígrado|centígrados"], ["Grado Fahrenheit", "°f|grados f|grado fahrenheit|grados fahrenheit|fahrenheit"], ["Grado Réaumur", "°r|°re|grados r|grado réaumur|grados réaumur|réaumur"], ["Grado Delisle", "°d|grados d|grado delisle|grados delisle|delisle"], ["Grado", "°|grados|grado"]]); + SpanishNumericWithUnit.VolumeSuffixList = new Map([["Kilómetro cúbico", "kilómetro cúbico|kilómetros cúbico|km3|km^3|km³"], ["Hectómetro cúbico", "hectómetro cúbico|hectómetros cúbico|hm3|hm^3|hm³"], ["Decámetro cúbico", "decámetro cúbico|decámetros cúbico|dam3|dam^3|dam³"], ["Metro cúbico", "metro cúbico|metros cúbico|m3|m^3|m³"], ["Decímetro cúbico", "decímetro cúbico|decímetros cúbico|dm3|dm^3|dm³"], ["Centímetro cúbico", "centímetro cúbico|centímetros cúbico|cc|cm3|cm^3|cm³"], ["Milímetro cúbico", "milímetro cúbico|milímetros cúbico|mm3|mm^3|mm³"], ["Pulgada cúbica", "pulgada cúbica|pulgadas cúbicas"], ["Pie cúbico", "pie cúbico|pies cúbicos|pie3|pie^3|pie³|ft3|ft^3|ft³"], ["Yarda cúbica", "yarda cúbica|yardas cúbicas|yd3|yd^3|yd³"], ["Hectolitro", "hectolitro|hectolitros|hl"], ["Litro", "litro|litros|lts|l"], ["Mililitro", "mililitro|mililitros|ml"], ["Galón", "galón|galones"], ["Pinta", "pinta|pintas"], ["Barril", "barril|barriles|bbl"], ["Onza líquida", "onza líquida|onzas líquidas"]]); + SpanishNumericWithUnit.WeightSuffixList = new Map([["Tonelada métrica", "tonelada métrica|toneladas métricas"], ["Tonelada", "ton|tonelada|toneladas"], ["Kilogramo", "kg|kilogramo|kilogramos"], ["Hectogramo", "hg|hectogramo|hectogramos"], ["Decagramo", "dag|decagramo|decagramos"], ["Gramo", "g|gr|gramo|gramos"], ["Decigramo", "dg|decigramo|decigramos"], ["Centigramo", "cg|centigramo|centigramos"], ["Miligramo", "mg|miligramo|miligramos"], ["Microgramo", "µg|ug|microgramo|microgramos"], ["Nanogramo", "ng|nanogramo|nanogramos"], ["Picogramo", "pg|picogramo|picogramos"], ["Libra", "lb|libra|libras"], ["Onza", "oz|onza|onzas"], ["Grano", "grano|granos|gr"], ["Quilate", "ct|kt|quilate|quilates"]]); +})(SpanishNumericWithUnit = exports.SpanishNumericWithUnit || (exports.SpanishNumericWithUnit = {})); + +}); + +unwrapExports(spanishNumericWithUnit); + +var base$2 = createCommonjsModule(function (module, exports) { +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); + + + + + +class SpanishNumberWithUnitExtractorConfiguration { + constructor(ci) { + this.cultureInfo = ci; + this.unitNumExtractor = new recognizersTextNumber.SpanishNumberExtractor(); + this.buildPrefix = spanishNumericWithUnit.SpanishNumericWithUnit.BuildPrefix; + this.buildSuffix = spanishNumericWithUnit.SpanishNumericWithUnit.BuildSuffix; + this.connectorToken = spanishNumericWithUnit.SpanishNumericWithUnit.ConnectorToken; + this.compoundUnitConnectorRegex = recognizersText.RegExpUtility.getSafeRegExp(spanishNumericWithUnit.SpanishNumericWithUnit.CompoundUnitConnectorRegex); + this.pmNonUnitRegex = recognizersText.RegExpUtility.getSafeRegExp(baseUnits.BaseUnits.PmNonUnitRegex); + } +} +exports.SpanishNumberWithUnitExtractorConfiguration = SpanishNumberWithUnitExtractorConfiguration; +class SpanishNumberWithUnitParserConfiguration extends parsers$4.BaseNumberWithUnitParserConfiguration { + constructor(ci) { + super(ci); + this.internalNumberExtractor = new recognizersTextNumber.SpanishNumberExtractor(recognizersTextNumber.NumberMode.Default); + this.internalNumberParser = recognizersTextNumber.AgnosticNumberParserFactory.getParser(recognizersTextNumber.AgnosticNumberParserType.Number, new recognizersTextNumber.SpanishNumberParserConfiguration()); + this.connectorToken = spanishNumericWithUnit.SpanishNumericWithUnit.ConnectorToken; + } +} +exports.SpanishNumberWithUnitParserConfiguration = SpanishNumberWithUnitParserConfiguration; + +}); + +unwrapExports(base$2); + +var currency$2 = createCommonjsModule(function (module, exports) { +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); + + + + +class SpanishCurrencyExtractorConfiguration extends base$2.SpanishNumberWithUnitExtractorConfiguration { + constructor(ci) { + if (!ci) { + ci = new recognizersTextNumber.CultureInfo(recognizersTextNumber.Culture.Spanish); + } + super(ci); + this.extractType = constants$2.Constants.SYS_UNIT_CURRENCY; + // Reference Source: https:// en.wikipedia.org/wiki/List_of_circulating_currencies + this.suffixList = spanishNumericWithUnit.SpanishNumericWithUnit.CurrencySuffixList; + this.prefixList = spanishNumericWithUnit.SpanishNumericWithUnit.CurrencyPrefixList; + this.ambiguousUnitList = spanishNumericWithUnit.SpanishNumericWithUnit.AmbiguousCurrencyUnitList; + } +} +exports.SpanishCurrencyExtractorConfiguration = SpanishCurrencyExtractorConfiguration; +class SpanishCurrencyParserConfiguration extends base$2.SpanishNumberWithUnitParserConfiguration { + constructor(ci) { + if (!ci) { + ci = new recognizersTextNumber.CultureInfo(recognizersTextNumber.Culture.Spanish); + } + super(ci); + this.BindDictionary(spanishNumericWithUnit.SpanishNumericWithUnit.CurrencySuffixList); + this.BindDictionary(spanishNumericWithUnit.SpanishNumericWithUnit.CurrencyPrefixList); + } +} +exports.SpanishCurrencyParserConfiguration = SpanishCurrencyParserConfiguration; + +}); + +unwrapExports(currency$2); + +var temperature$2 = createCommonjsModule(function (module, exports) { +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); + + + + +class SpanishTemperatureExtractorConfiguration extends base$2.SpanishNumberWithUnitExtractorConfiguration { + constructor(ci) { + if (!ci) { + ci = new recognizersTextNumber.CultureInfo(recognizersTextNumber.Culture.Spanish); + } + super(ci); + this.extractType = constants$2.Constants.SYS_UNIT_TEMPERATURE; + this.suffixList = spanishNumericWithUnit.SpanishNumericWithUnit.TemperatureSuffixList; + this.prefixList = new Map(); + this.ambiguousUnitList = new Array(); + } +} +exports.SpanishTemperatureExtractorConfiguration = SpanishTemperatureExtractorConfiguration; +class SpanishTemperatureParserConfiguration extends base$2.SpanishNumberWithUnitParserConfiguration { + constructor(ci) { + if (!ci) { + ci = new recognizersTextNumber.CultureInfo(recognizersTextNumber.Culture.Spanish); + } + super(ci); + this.BindDictionary(spanishNumericWithUnit.SpanishNumericWithUnit.TemperatureSuffixList); + } +} +exports.SpanishTemperatureParserConfiguration = SpanishTemperatureParserConfiguration; + +}); + +unwrapExports(temperature$2); + +var dimension$2 = createCommonjsModule(function (module, exports) { +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); + + + + +class SpanishDimensionExtractorConfiguration extends base$2.SpanishNumberWithUnitExtractorConfiguration { + constructor(ci) { + if (!ci) { + ci = new recognizersTextNumber.CultureInfo(recognizersTextNumber.Culture.Spanish); + } + super(ci); + this.extractType = constants$2.Constants.SYS_UNIT_DIMENSION; + this.suffixList = spanishNumericWithUnit.SpanishNumericWithUnit.DimensionSuffixList; + this.prefixList = new Map(); + this.ambiguousUnitList = spanishNumericWithUnit.SpanishNumericWithUnit.AmbiguousDimensionUnitList; + } +} +exports.SpanishDimensionExtractorConfiguration = SpanishDimensionExtractorConfiguration; +class SpanishDimensionParserConfiguration extends base$2.SpanishNumberWithUnitParserConfiguration { + constructor(ci) { + if (!ci) { + ci = new recognizersTextNumber.CultureInfo(recognizersTextNumber.Culture.Spanish); + } + super(ci); + this.BindDictionary(spanishNumericWithUnit.SpanishNumericWithUnit.DimensionSuffixList); + } +} +exports.SpanishDimensionParserConfiguration = SpanishDimensionParserConfiguration; + +}); + +unwrapExports(dimension$2); + +var age$2 = createCommonjsModule(function (module, exports) { +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); + + + + +class SpanishAgeExtractorConfiguration extends base$2.SpanishNumberWithUnitExtractorConfiguration { + constructor(ci) { + if (!ci) { + ci = new recognizersTextNumber.CultureInfo(recognizersTextNumber.Culture.Spanish); + } + super(ci); + this.extractType = constants$2.Constants.SYS_UNIT_AGE; + this.suffixList = spanishNumericWithUnit.SpanishNumericWithUnit.AgeSuffixList; + this.prefixList = new Map(); + this.ambiguousUnitList = new Array(); + } +} +exports.SpanishAgeExtractorConfiguration = SpanishAgeExtractorConfiguration; +class SpanishAgeParserConfiguration extends base$2.SpanishNumberWithUnitParserConfiguration { + constructor(ci) { + if (!ci) { + ci = new recognizersTextNumber.CultureInfo(recognizersTextNumber.Culture.Spanish); + } + super(ci); + this.BindDictionary(spanishNumericWithUnit.SpanishNumericWithUnit.AgeSuffixList); + } +} +exports.SpanishAgeParserConfiguration = SpanishAgeParserConfiguration; + +}); + +unwrapExports(age$2); + +var portugueseNumericWithUnit = createCommonjsModule(function (module, exports) { +"use strict"; +// ------------------------------------------------------------------------------ +// +// This code was generated by a tool. +// Changes to this file may cause incorrect behavior and will be lost if +// the code is regenerated. +// +// ------------------------------------------------------------------------------ +Object.defineProperty(exports, "__esModule", { value: true }); +var PortugueseNumericWithUnit; +(function (PortugueseNumericWithUnit) { + PortugueseNumericWithUnit.AgeSuffixList = new Map([["Ano", "anos|ano"], ["Mês", "meses|mes|mês"], ["Semana", "semanas|semana"], ["Dia", "dias|dia"]]); + PortugueseNumericWithUnit.AreaSuffixList = new Map([["Quilômetro quadrado", "quilômetro quadrado|quilómetro quadrado|quilometro quadrado|quilômetros quadrados|quilómetros quadrados|quilomeros quadrados|km2|km^2|km²"], ["Hectare", "hectômetro quadrado|hectómetro quadrado|hectômetros quadrados|hectómetros cuadrados|hm2|hm^2|hm²|hectare|hectares"], ["Decâmetro quadrado", "decâmetro quadrado|decametro quadrado|decâmetros quadrados|decametro quadrado|dam2|dam^2|dam²|are|ares"], ["Metro quadrado", "metro quadrado|metros quadrados|m2|m^2|m²"], ["Decímetro quadrado", "decímetro quadrado|decimentro quadrado|decímetros quadrados|decimentros quadrados|dm2|dm^2|dm²"], ["Centímetro quadrado", "centímetro quadrado|centimetro quadrado|centímetros quadrados|centrimetros quadrados|cm2|cm^2|cm²"], ["Milímetro quadrado", "milímetro quadrado|milimetro quadrado|milímetros quadrados|militmetros quadrados|mm2|mm^2|mm²"], ["Polegada quadrada", "polegada quadrada|polegadas quadradas|in2|in^2|in²"], ["Pé quadrado", "pé quadrado|pe quadrado|pés quadrados|pes quadrados|pé2|pé^2|pé²|sqft|sq ft|ft2|ft^2|ft²"], ["Jarda quadrada", "jarda quadrada|jardas quadradas|yd2|yd^2|yd²"], ["Milha quadrada", "milha quadrada|milhas quadradas|mi2|mi^2|mi²"], ["Acre", "acre|acres"]]); + PortugueseNumericWithUnit.CurrencySuffixList = new Map([["Dólar", "dólar|dolar|dólares|dolares"], ["Peso", "peso|pesos"], ["Coroa", "coroa|coroas"], ["Rublo", "rublo|rublos"], ["Libra", "libra|libras"], ["Florim", "florim|florins|ƒ"], ["Dinar", "dinar|dinares"], ["Franco", "franco|francos"], ["Rupia", "rúpia|rupia|rúpias|rupias"], ["Escudo", "escudo|escudos"], ["Xelim", "xelim|xelins|xelims"], ["Lira", "lira|liras"], ["Centavo", "centavo|cêntimo|centimo|centavos|cêntimos|centimo"], ["Centésimo", "centésimo|centésimos"], ["Pêni", "pêni|péni|peni|penies|pennies"], ["Manat", "manat|manate|mánate|man|manats|manates|mánates"], ["Euro", "euro|euros|€|eur"], ["Centavo de Euro", "centavo de euro|cêntimo de euro|centimo de euro|centavos de euro|cêntimos de euro|centimos de euro"], ["Dólar do Caribe Oriental", "dólar do Caribe Oriental|dolar do Caribe Oriental|dólares do Caribe Oriental|dolares do Caribe Oriental|dólar das Caraíbas Orientais|dolar das Caraibas Orientais|dólares das Caraíbas Orientais|dolares das Caraibas Orientais|ec$|xcd"], ["Centavo do Caribe Oriental", "centavo do Caribe Oriental|centavo das Caraíbas Orientais|cêntimo do Caribe Oriental|cêntimo das Caraíbas Orientais|centavos do Caribe Oriental|centavos das Caraíbas Orientais|cêntimos do Caribe Oriental|cêntimos das Caraíbas Orientais"], ["Franco CFA da África Ocidental", "franco CFA da África Ocidental|franco CFA da Africa Ocidental|francos CFA da África Occidental|francos CFA da Africa Occidental|franco CFA Ocidental|xof"], ["Centavo de CFA da África Ocidental", "centavo de CFA da Africa Occidental|centavos de CFA da África Ocidental|cêntimo de CFA da Africa Occidental|cêntimos de CFA da África Ocidental"], ["Franco CFA da África Central", "franco CFA da África Central|franco CFA da Africa Central|francos CFA da África Central|francos CFA da Africa Central|franco CFA central|xaf"], ["Centavo de CFA da África Central", "centavo de CFA de África Central|centavos de CFA da África Central|cêntimo de CFA de África Central|cêntimos de CFA da África Central"], ["Apsar abcásio", "apsar abcásio|apsar abecásio|apsar abcasio|apsar|apsares"], ["Afegani afegão", "afegani afegão|afegane afegão|؋|afn|afegane|afgane|afegâni|afeganis|afeganes|afganes|afegânis"], ["Pul", "pul|pules|puls"], ["Lek albanês", "lek|lekë|lekes|lek albanês|leque|leques|all"], ["Qindarke", "qindarka|qindarkë|qindarke|qindarkas"], ["Kwanza angolano", "kwanza angolano|kwanzas angolanos|kwanza|kwanzas|aoa|kz"], ["Cêntimo angolano", "cêntimo angolano|cêntimo|cêntimos"], ["Florim das Antilhas Holandesas", "florim das antilhas holandesas|florim das antilhas neerlandesas|ang"], ["Rial saudita", "rial saudita|riais sauditas|riyal saudita|riyals sauditas|riyal|riyals|sar"], ["Halala saudita", "halala saudita|halala|hallalah"], ["Dinar argelino", "dinar argelino|dinares argelinos|dzd"], ["Cêntimo argelino", "centimo argelino|centimos argelinos|cêntimo argelino|cêntimos argelinos|centavo argelino|centavos argelinos"], ["Peso argentino", "peso argentino|pesos argentinos|peso|pesos|ar$|ars"], ["Centavo argentino", "centavo argentino|centavos argentinos|centavo|ctvo.|ctvos."], ["Dram armênio", "dram armênio|dram armênios|dram arménio|dram arménios|dram armenio|dram armenios|dram|drame|drames|դր."], ["Luma armênio", "luma armênio|lumas armênios|luma arménio|lumas arménios|luma armenio|lumas armenios|luma|lumas"], ["Florim arubano", "florín arubeño|florines arubeños|ƒ arubeños|aƒ|awg"], ["Dólar australiano", "dólar australiano|dólares australianos|dolar australiano|dolares australianos|a$|aud"], ["Centavo australiano", "centavo australiano|centavos australianos"], ["Manat azeri", "manat azeri|manats azeris|azn|manat azerbaijanês|manat azerbaijano|manats azerbaijaneses|manats azerbaijanos"], ["Qəpik azeri", "qəpik azeri|qəpik|qəpiks"], ["Dólar bahamense", "dólar bahamense|dólares bahamense|dolar bahamense|dolares bahamense|dólar baamiano|dólares baamiano|dolar baamiano|dolares baamiano|b$|bsd"], ["Centavo bahamense", "centavo bahamense|centavos bahamense"], ["Dinar bareinita", "dinar bareinita|dinar baremita|dinares bareinitas|dinares baremitas|bhd"], ["Fil bareinita", "fil bareinita|fil baremita|fils bareinitas|fils baremitas"], ["Taka bengali", "taka bengali|takas bengalis|taca|tacas|taka|takas|bdt"], ["Poisha bengali", "poisha bengali|poishas bengalis"], ["Dólar de Barbados", "dólar de barbados|dólares de barbados|dolar de barbados|dolares de barbados|dólar dos barbados|dólares dos barbados|bbd"], ["Centavo de Barbados", "centavo de barbados|centavos de barbados|centavo dos barbados|centavos dos barbados"], ["Dólar de Belize", "dólar de belize|dólares de belize|dolar de belize|dolares de belize|dólar do belize|dólares do belize|dolar do belize|dolares do belize|bz$|bzd"], ["Centavo de Belize", "centavo de belize|centavos de belize|cêntimo do belize|cêntimos do belize"], ["Dólar bermudense", "dólar bermudense|dólares bermudenses|bd$|bmd"], ["Centavo bermudense", "centavo bermudense|centavos bermudenses|cêntimo bermudense| cêntimos bermudenses"], ["Rublo bielorrusso", "rublo bielorrusso|rublos bielorrussos|br|byr"], ["Copeque bielorusso", "copeque bielorrusso|copeques bielorrussos|kopek bielorrusso|kopeks bielorrussos|kap"], ["Quiate mianmarense", "quiate mianmarense|quiates mianmarenses|kyat mianmarense|kyates mianmarenses|quiate myanmarense|quiates myanmarenses|kyat myanmarense|kyates myanmarenses|quiate birmanês|quite birmanes|quiates birmaneses|kyat birmanês|kyat birmanes|kyates birmaneses|mmk"], ["Pya mianmarense", "pya mianmarense|pyas mianmarenses|pya myanmarense|pyas myanmarenses|pya birmanês|pya birmanes|pyas birmaneses"], ["Boliviano", "boliviano|bolivianos|bob|bs"], ["Centavo Boliviano", "centavo boliviano|centavos bolivianos"], ["Marco da Bósnia e Herzegovina", "marco conversível|marco conversivel|marco convertível|marco convertivel|marcos conversíveis|marcos conversiveis|marcos convertíveis|marcos convertivies|bam"], ["Fening da Bósnia e Herzegovina", "fening conversível|fening conversivel|fening convertível|fening convertivel|fenings conversíveis|fenings conversiveis|fenings convertíveis|fenings convertiveis"], ["Pula", "pula|pulas|bwp"], ["Thebe", "thebe|thebes"], ["Real brasileiro", "real brasileiro|real do brasil|real|reais brasileiros|reais do brasil|reais|r$|brl"], ["Centavo brasileiro", "centavo de real|centavo brasileiro|centavos de real|centavos brasileiros"], ["Dólar de Brunei", "dólar de brunei|dolar de brunei|dólar do brunei|dolar do brunei|dólares de brunéi|dolares de brunei|dólares do brunei|dolares do brunei|bnd"], ["Sen de Brunei", "sen de brunei|sen do brunei|sens de brunei|sens do brunei"], ["Lev búlgaro", "lev búlgaro|leve búlgaro|leves búlgaros|lev bulgaro|leve bulgaro|leves bulgaros|lv|bgn"], ["Stotinka búlgaro", "stotinka búlgaro|stotinki búlgaros|stotinka bulgaro|stotinki bulgaros"], ["Franco do Burundi", "franco do burundi|francos do burundi|fbu|fib"], ["Centavo Burundi", "centavo burundi|cêntimo burundi|centimo burundi|centavos burundi|cêntimo burundi|centimo burundi"], ["Ngultrum butanês", "ngultrum butanês|ngultrum butanes|ngúltrume butanês|ngultrume butanes|ngultrum butaneses|ngúltrumes butaneses|ngultrumes butaneses|btn"], ["Chetrum butanês", "chetrum butanês|chetrum butanes|chetrum butaneses"], ["Escudo cabo-verdiano", "escudo cabo-verdiano|escudos cabo-verdianos|cve"], ["Riel cambojano", "riel cambojano|riéis cambojanos|rieis cambojanos|khr"], ["Dólar canadense", "dólar canadense|dolar canadense|dólares canadenses|dolares canadenses|c$|cad"], ["Centavo canadense", "centavo canadense|centavos canadenses"], ["Peso chileno", "peso chileno|pesos chilenos|cpl"], ["Yuan chinês", "yuan chinês|yuan chines|yuans chineses|yuan|yuans|renminbi|rmb|cny|¥"], ["Peso colombiano", "peso colombiano|pesos colombianos|cop|col$"], ["Centavo colombiano", "centavo colombiano|centavos colombianos"], ["Franco comorense", "franco comorense|francos comorenses|kmf|₣"], ["Franco congolês", "franco congolês|franco congoles|francos congoleses|cdf"], ["Centavo congolês", "centavo congolês|centavo congoles|centavos congoleses|cêntimo congolês|centimo congoles|cêntimos congoleses|cêntimos congoleses"], ["Won norte-coreano", "won norte-coreano|wŏn norte-coreano|won norte-coreanos|wŏn norte-coreanos|kpw"], ["Chon norte-coreano", "chon norte-coreano|chŏn norte-coreano|chŏn norte-coreanos|chon norte-coreanos"], ["Won sul-coreano", "wŏn sul-coreano|won sul-coreano|wŏnes sul-coreanos|wones sul-coreanos|krw"], ["Jeon sul-coreano", "jeons sul-coreano|jeons sul-coreanos"], ["Colón costarriquenho", "colón costarriquenho|colon costarriquenho|colons costarriquenho|colones costarriquenhos|crc"], ["Kuna croata", "kuna croata|kunas croatas|hrk"], ["Lipa croata", "lipa croata|lipas croatas"], ["Peso cubano", "peso cubano|pesos cubanos|cup"], ["Peso cubano convertível", "peso cubano conversível|pesos cubanos conversíveis|peso cubano conversivel|pesos cubanos conversiveis|peso cubano convertível|pesos cubanos convertíveis|peso cubano convertivel|pesos cubanos convertiveis|cuc"], ["Coroa dinamarquesa", "coroa dinamarquesa|coroas dinamarquesas|dkk"], ["Libra egípcia", "libra egípcia|libra egipcia|libras egípcias|libras egipcias|egp|le"], ["Piastra egípcia", "piastra egípcia|piastra egipcia|pisastras egípcias|piastras egipcias"], ["Dirham dos Emirados Árabes Unidos", "dirham|dirhams|dirham dos emirados arabes unidos|aed|dhs"], ["Nakfa", "nakfa|nfk|ern"], ["Centavo de Nakfa", "cêntimo de nakfa|cêntimos de nakfa|centavo de nafka|centavos de nafka"], ["Peseta", "peseta|pesetas|pts.|ptas.|esp"], ["Dólar estadunidense", "dólar dos estados unidos|dolar dos estados unidos|dólar estadunidense|dólar americano|dólares dos estados unidos|dolares dos estados unidos|dólares estadunidenses|dólares americanos|dolar estadunidense|dolar americano|dolares estadunidenses|dolares americanos|usd|u$d|us$"], ["Coroa estoniana", "coroa estoniana|coroas estonianas|eek"], ["Senti estoniano", "senti estoniano|senti estonianos"], ["Birr etíope", "birr etíope|birr etiope|birr etíopes|birr etiopes|br|etb"], ["Santim etíope", "santim etíope|santim etiope|santim etíopes|santim etiopes"], ["Peso filipino", "peso filipino|pesos filipinos|php"], ["Marco finlandês", "marco finlandês|marco finlandes|marcos finlandeses"], ["Dólar fijiano", "dólar fijiano|dolar fijiano|dólares fijianos|dolares fijianos|fj$|fjd"], ["Centavo fijiano", "centavo fijiano|centavos fijianos"], ["Dalasi gambiano", "dalasi|gmd"], ["Bututs", "butut|bututs"], ["Lari georgiano", "lari georgiano|lari georgianos|gel"], ["Tetri georgiano", "tetri georgiano|tetri georgianos"], ["Cedi", "cedi|ghs|gh₵"], ["Pesewa", "pesewa"], ["Libra de Gibraltar", "libra de gibraltar|libras de gibraltar|gip"], ["Peni de Gibraltar", "peni de gibraltar|penies de gibraltar"], ["Quetzal guatemalteco", "quetzal guatemalteco|quetzales guatemaltecos|quetzal|quetzales|gtq"], ["Centavo guatemalteco", "centavo guatemalteco|centavos guatemaltecos"], ["Libra de Guernsey", "libra de Guernsey|libras de Guernsey|ggp"], ["Peni de Guernsey", "peni de Guernsey|penies de Guernsey"], ["Franco da Guiné", "franco da guiné|franco da guine| franco guineense|francos da guiné|francos da guine|francos guineense|gnf|fg"], ["Centavo da Guiné", "cêntimo guineense|centimo guineense|centavo guineense|cêntimos guineenses|centimos guineenses|centavos guineenses"], ["Dólar guianense", "dólar guianense|dólares guianense|dolar guianense|dolares guianense|gyd|gy"], ["Gurde haitiano", "gurde haitiano|gourde|gurdes haitianos|htg"], ["Centavo haitiano", "cêntimo haitiano|cêntimos haitianos|centavo haitiano|centavos haitianos"], ["Lempira hondurenha", "lempira hondurenha|lempiras hondurenhas|lempira|lempiras|hnl"], ["Centavo hondurenho", "centavo hondurenho|centavos hondurehos|cêntimo hondurenho|cêntimos hondurenhos"], ["Dólar de Hong Kong", "dólar de hong kong|dolar de hong kong|dólares de hong kong|dolares de hong kong|hk$|hkd"], ["Florim húngaro", "florim húngaro|florim hungaro|florins húngaros|florins hungaros|forinte|forintes|huf"], ["Filér húngaro", "fillér|filér|filler|filer"], ["Rupia indiana", "rúpia indiana|rupia indiana|rupias indianas|inr"], ["Paisa indiana", "paisa indiana|paisas indianas"], ["Rupia indonésia", "rupia indonesia|rupia indonésia|rupias indonesias|rupias indonésias|idr"], ["Sen indonésio", "send indonésio|sen indonesio|sen indonésios|sen indonesios"], ["Rial iraniano", "rial iraniano|riais iranianos|irr"], ["Dinar iraquiano", "dinar iraquiano|dinares iraquianos|iqd"], ["Fil iraquiano", "fil iraquiano|fils iraquianos|files iraquianos"], ["Libra manesa", "libra manesa|libras manesas|imp"], ["Peni manês", "peni manes|peni manês|penies maneses"], ["Coroa islandesa", "coroa islandesa|coroas islandesas|isk|íkr"], ["Aurar islandês", "aurar islandês|aurar islandes|aurar islandeses|eyrir"], ["Dólar das Ilhas Cayman", "dólar das ilhas cayman|dolar das ilhas cayman|dólar das ilhas caimão|dólares das ilhas cayman|dolares das ilhas cayman|dólares das ilhas caimão|ci$|kyd"], ["Dólar das Ilhas Cook", "dólar das ilhas cook|dolar das ilhas cook|dólares das ilhas cook|dolares das ilhas cook"], ["Coroa feroesa", "coroa feroesa|coroas feroesas|fkr"], ["Libra das Malvinas", "libra das malvinas|libras das malvinas|fk£|fkp"], ["Dólar das Ilhas Salomão", "dólar das ilhas salomão|dolar das ilhas salomao|dólares das ilhas salomão|dolares das ilhas salomao|sbd"], ["Novo shekel israelense", "novo shekel|novos shekeles|novo shequel|novo siclo|novo xéquel|shekeles novos|novos sheqalim|sheqalim novos|ils"], ["Agora", "agora|agorot"], ["Dólar jamaicano", "dólar jamaicano|dolar jamaicano|dólares jamaicanos|dolares jamaicanos|j$|ja$|jmd"], ["Yen", "yen|iene|yenes|ienes|jpy"], ["Libra de Jersey", "libra de Jersey|libras de Jersey|jep"], ["Dinar jordaniano", "dinar jordaniano|dinar jordano|dinares jordanianos|dinares jordanos|jd|jod"], ["Piastra jordaniana", "piastra jordaniana|piastra jordano|piastras jordanianas|piastra jordaniano|piastras jordanianos|piastras jordanos"], ["Tengue cazaque", "tenge|tengue|tengué|tengue cazaque|kzt"], ["Tiyin", "tiyin|tiyins"], ["Xelim queniano", "xelim queniano|xelins quenianos|ksh|kes"], ["Som quirguiz", "som quirguiz|som quirguizes|soms quirguizes|kgs"], ["Tyiyn", "tyiyn|tyiyns"], ["Dólar de Kiribati", "dólar de kiribati|dolar de kiribati|dólares de kiribati|dolares de kiribati"], ["Dinar kuwaitiano", "dinar kuwaitiano|dinar cuaitiano|dinares kuwaitiano|dinares cuaitianos|kwd"], ["Quipe laosiano", "quipe|quipes|kipe|kipes|kip|kip laosiano|kip laociano|kips laosianos|kips laocianos|lak"], ["Att laosiano", "at|att|att laosiano|att laosianos"], ["Loti do Lesoto", "loti|lóti|maloti|lotis|lótis|lsl"], ["Sente", "sente|lisente"], ["Libra libanesa", "libra libanesa|libras libanesas|lbp"], ["Dólar liberiano", "dólar liberiano|dolar liberiano|dólares liberianos|dolares liberianos|l$|lrd"], ["Dinar libio", "dinar libio|dinar líbio|dinares libios|dinares líbios|ld|lyd"], ["Dirham libio", "dirham libio|dirhams libios|dirham líbio|dirhams líbios"], ["Litas lituana", "litas lituana|litai lituanas|ltl"], ["Pataca macaense", "pataca macaense|patacas macaenses|mop$|mop"], ["Avo macaense", "avo macaense|avos macaenses"], ["Ho macaense", "ho macaense|ho macaenses"], ["Dinar macedônio", "denar macedonio|denare macedonios|denar macedônio|denar macedónio|denare macedônio|denare macedónio|dinar macedonio|dinar macedônio|dinar macedónio|dinares macedonios|dinares macedônios|dinares macedónios|den|mkd"], ["Deni macedônio", "deni macedonio|deni macedônio|deni macedónio|denis macedonios|denis macedônios|denis macedónios"], ["Ariary malgaxe", "ariai malgaxe|ariary malgaxe|ariary malgaxes|ariaris|mga"], ["Iraimbilanja", "iraimbilanja|iraimbilanjas"], ["Ringuite malaio", "ringgit malaio|ringgit malaios|ringgits malaios|ringuite malaio|ringuites malaios|rm|myr"], ["Sen malaio", "sen malaio|sen malaios|centavo malaio|centavos malaios|cêntimo malaio|cêntimos malaios"], ["Kwacha do Malawi", "kwacha|cuacha|quacha|mk|mwk"], ["Tambala", "tambala|tambalas|tambala malawi"], ["Rupia maldiva", "rupia maldiva|rupias maldivas|rupia das maldivas| rupias das maldivas|mvr"], ["Dirame marroquino", "dirame marroquino|dirham marroquinho|dirhams marroquinos|dirames marroquinos|mad"], ["Rupia maurícia", "rupia maurícia|rupia de Maurício|rupia mauricia|rupia de mauricio|rupias de mauricio|rupias de maurício|rupias mauricias|rupias maurícias|mur"], ["Uguia", "uguia|uguias|oguia|ouguiya|oguias|mro"], ["Kume", "kumes|kume|khoums"], ["Peso mexicano", "peso mexicano|pesos mexicanos|mxn"], ["Centavo mexicano", "centavo mexicano|centavos mexicanos"], ["Leu moldávio", "leu moldavo|lei moldavos|leu moldávio|leu moldavio|lei moldávios|lei moldavios|leus moldavos|leus moldavios|leus moldávios|mdl"], ["Ban moldávio", "ban moldavo|bani moldavos"], ["Tugrik mongol", "tugrik mongol|tugrik|tugriks mongóis|tugriks mongois|tug|mnt"], ["Metical moçambicao", "metical|metical moçambicano|metical mocambicano|meticais|meticais moçambicanos|meticais mocambicanos|mtn|mzn"], ["Dólar namibiano", "dólar namibiano|dólares namibianos|dolar namibio|dolares namibios|n$|nad"], ["Centavo namibiano", "centavo namibiano|centavos namibianos|centavo namibio|centavos namibianos"], ["Rupia nepalesa", "rupia nepalesa|rupias nepalesas|npr"], ["Paisa nepalesa", "paisa nepalesa|paisas nepalesas"], ["Córdova nicaraguense", "córdova nicaraguense|cordova nicaraguense|cordova nicaraguana|córdoba nicaragüense|córdobas nicaragüenses|cordobas nicaraguenses|córdovas nicaraguenses|cordovas nicaraguenses|córdovas nicaraguanasc$|nio"], ["Centavo nicaraguense", "centavo nicaragüense|centavos nicaraguenses|centavo nicaraguano|centavos nicaraguenses|centavo nicaraguano|centavos nicaraguanos"], ["Naira", "naira|ngn"], ["Kobo", "kobo"], ["Coroa norueguesa", "coroa norueguesa|coroas norueguesas|nok"], ["Franco CFP", "franco cfp|francos cfp|xpf"], ["Dólar neozelandês", "dólar neozelandês|dolar neozelandes|dólares neozelandeses|dolares neozelandeses|dólar da nova zelândia|dolar da nova zelandia|dólares da nova zelândia|dolares da nova zelandia|nz$|nzd"], ["Centavo neozelandês", "centavo neozelandês|centavo neozelandes|centavo da nova zelandia|centavo da nova zelândia|centavos da nova zelandia|centavos neozelandeses|centavos da nova zelândia"], ["Rial omanense", "rial omani|riais omanis|rial omanense|riais omanenses|omr"], ["Baisa omanense", "baisa omani|baisas omanis|baisa omanense|baisas omanenses"], ["Florim holandês", "florim holandês|florim holandes|florins holandeses|nlg"], ["Rupia paquistanesa", "rupia paquistanesa|rupias paquistanesas|pkr"], ["Paisa paquistanesa", "paisa paquistanesa|paisas paquistanesasas"], ["Balboa panamenho", "balboa panamenho|balboas panamenhos|balboa|pab|balboa panamense|balboas panamenses"], ["Centavo panamenho", "centavo panamenho|cêntimo panamenho|centavos panamenhos|cêntimos panamenhos|cêntimo panamense|cêntimos panamenses"], ["Kina", "kina|kina papuásia|kinas|kinas papuásias|pkg|pgk"], ["Toea", "toea"], ["Guarani", "guarani|guaranis|gs|pyg"], ["Novo Sol", "novo sol peruano|novos sóis peruanos|sol|soles|sóis|nuevo sol|pen|s#."], ["Centavo de sol", "cêntimo de sol|cêntimos de sol|centavo de sol|centavos de sol"], ["Złoty", "złoty|złotys|zloty|zlotys|zloti|zlotis|zlóti|zlótis|zlote|zł|pln"], ["Groszy", "groszy|grosz"], ["Rial catariano", "rial qatari|riais qataris|rial catarense|riais catarenses|rial catariano|riais catarianos|qr|qar"], ["Dirame catariano", "dirame catariano|dirames catarianos|dirame qatari|dirames qataris|dirame catarense|dirames catarenses|dirham qatari|dirhams qataris|dirham catarense|dirhams catarenses|dirham catariano|dirhams catariano"], ["Libra esterlina", "libra esterlina|libras esterlinas|gbp"], ["Coroa checa", "coroa checa|coroas checas|kc|czk"], ["Peso dominicano", "peso dominicano|pesos dominicanos|rd$|dop"], ["Centavo dominicano", "centavo dominicano|centavos dominicanos"], ["Franco ruandês", "franco ruandês|franco ruandes|francos ruandeses|rf|rwf"], ["Céntimo ruandês", "cêntimo ruandês|centimo ruandes|centavo ruandês|centavo ruandes|cêntimos ruandeses|centimos ruandeses|centavos ruandeses"], ["Leu romeno", "leu romeno|lei romenos|leus romenos|ron"], ["Ban romeno", "ban romeno|bani romeno|bans romenos"], ["Rublo russo", "rublo russo|rublos russos|rub|р."], ["Copeque ruso", "copeque russo|copeques russos|kopek ruso|kopeks rusos|copeque|copeques|kopek|kopeks"], ["Tala samoano", "tala|tālā|talas|tala samonano|talas samoanos|ws$|sat|wst"], ["Sene samoano", "sene"], ["Libra de Santa Helena", "libra de santa helena|libras de santa helena|shp"], ["Pêni de Santa Helena", "peni de santa helena|penies de santa helena"], ["Dobra", "dobra|dobras|db|std"], ["Dinar sérvio", "dinar sérvio|dinar servio|dinar serbio|dinares sérvios|dinares servios|dinares serbios|rsd"], ["Para sérvio", "para sérvio|para servio|para serbio|paras sérvios|paras servios|paras serbios"], ["Rupia seichelense", "rupia de seicheles|rupias de seicheles|rupia seichelense|rupias seichelenses|scr"], ["Centavo seichelense", "centavo de seicheles|centavos de seicheles|centavo seichelense|centavos seichelenses"], ["Leone serra-leonino", "leone|leones|leone serra-leonino|leones serra-leoninos|le|sll"], ["Dólar de Cingapura", "dólar de singapura|dolar de singapura|dórar de cingapura|dolar de cingapura|dólares de singapura|dolares de singapura|dólares de cingapura|dolares de cingapura|sgb"], ["Centavo de Cingapura", "centavo de singapura|centavos de singapura|centavo de cingapura|centavos de cingapura"], ["Libra síria", "libra síria|libra siria|libras sírias|libras sirias|s£|syp"], ["Piastra síria", "piastra siria|piastras sirias|piastra síria|piastras sírias"], ["Xelim somali", "xelim somali|xelins somalis|xelim somaliano|xelins somalianos|sos"], ["Centavo somali", "centavo somapli|centavos somalis|centavo somaliano|centavos somalianos"], ["Xelim da Somalilândia", "xelim da somalilândia|xelins da somalilândia|xelim da somalilandia|xelins da somalilandia"], ["Centavo da Somalilândia", "centavo da somalilândia|centavos da somalilândia|centavo da somalilandia|centavos da somalilandia"], ["Rupia do Sri Lanka", "rupia do sri lanka|rupia do sri lanca|rupias do sri lanka|rupias do sri lanca|rupia cingalesa|rupias cingalesas|lkr"], ["Lilangeni", "lilangeni|lilangenis|emalangeni|szl"], ["Rand sul-africano", "rand|rand sul-africano|rands|rands sul-africanos|zar"], ["Libra sudanesa", "libra sudanesa|libras sudanesas|sdg"], ["Piastra sudanesa", "piastra sudanesa|piastras sudanesas"], ["Libra sul-sudanesa", "libra sul-sudanesa|libras sul-sudanesas|ssp"], ["Piastra sul-sudanesa", "piastra sul-sudanesa|piastras sul-sudanesas"], ["Coroa sueca", "coroa sueca|coroas suecas|sek"], ["Franco suíço", "franco suíço|franco suico|francos suíços|francos suicos|sfr|chf"], ["Rappen suíço", "rappen suíço|rappen suico|rappens suíços|rappens suicos"], ["Dólar surinamês", "dólar surinamês|dolar surinames|dólar do Suriname|dolar do Suriname|dólares surinameses|dolares surinameses|dólares do Suriname|dolares do Suriname|srd"], ["Centavo surinamês", "centavo surinamês|centavo surinames|centavos surinameses"], ["Baht tailandês", "baht tailandês|bath tailandes|baht tailandeses|thb"], ["Satang tailandês", "satang tailandês|satang tailandes|satang tailandeses"], ["Novo dólar taiwanês", "novo dólar taiwanês|novo dolar taiwanes|dólar taiwanês|dolar taiwanes|dólares taiwaneses|dolares taiwaneses|twd"], ["Centavo taiwanês", "centavo taiwanês|centavo taiwanes|centavos taiwaneses"], ["Xelim tanzaniano", "xelim tanzaniano|xelins tanzanianos|tzs"], ["Centavo tanzaniano", "centavo tanzaniano|centavos tanzanianos"], ["Somoni tajique", "somoni tajique|somoni|somonis tajiques|somonis|tjs"], ["Diram tajique", "diram tajique|dirams tajiques|dirames tajiques"], ["Paʻanga", "paanga|paangas|paʻanga|pa'anga|top"], ["Seniti", "seniti"], ["Rublo transdniestriano", "rublo transdniestriano|rublos transdniestriano"], ["Copeque transdniestriano", "copeque transdniestriano|copeques transdniestriano"], ["Dólar de Trinidade e Tobago", "dólar de trinidade e tobago|dólares trinidade e tobago|dolar de trinidade e tobago|dolares trinidade e tobago|dólar de trinidad e tobago|dólares trinidad e tobago|ttd"], ["Centavo de Trinidade e Tobago", "centavo de trinidade e tobago|centavos de trinidade e tobago|centavo de trinidad e tobago|centavos de trinidad e tobago"], ["Dinar tunisiano", "dinar tunisiano|dinares tunisianos|dinar tunisino|dinares tunisinos|tnd"], ["Milim tunisiano", "milim tunisiano|milim tunesianos|millime tunisianos|millimes tunisianos|milim tunisino|milim tunisinos|millime tunisinos|millimes tunisinos"], ["Lira turca", "lira turca|liras turcas|try"], ["Kuruş turco", "kuruş turco|kuruş turcos"], ["Manat turcomeno", "manat turcomeno|manats turcomenos|tmt"], ["Tennesi turcomeno", "tennesi turcomeno|tennesis turcomenos|tenge turcomenos|tenges turcomenos"], ["Dólar tuvaluano", "dólar tuvaluano|dolar tuvaluano|dólares tuvaluanos|dolares tuvaluanos"], ["Centavo tuvaluano", "centavo tuvaluano|centavos tuvaluanos"], ["Grívnia", "grívnia|grivnia|grívnias|grivnias|grivna|grivnas|uah"], ["Copeque ucraniano", "kopiyka|copeque ucraniano|copeques ucranianos"], ["Xelim ugandês", "xelim ugandês|xelim ugandes|xelins ugandeses|ugx"], ["Centavo ugandês", "centavo ugandês|centavo ugandes|centavos ugandeses"], ["Peso uruguaio", "peso uruguaio|pesos uruguayis|uyu"], ["Centésimo uruguayo", "centésimo uruguaio|centesimo uruguaio|centésimos uruguaios|centesimos uruguaios"], ["Som uzbeque", "som uzbeque|som uzbeques|soms uzbeques|somes uzbeques|som usbeque|som usbeques|soms usbeques|somes usbeques|uzs"], ["Tiyin uzbeque", "tiyin uzbeque|tiyin uzbeques|tiyins uzbeques|tiyin usbeque|tiyin usbeques|tiyins usbeques"], ["Vatu", "vatu|vatus|vuv"], ["Bolívar forte venezuelano", "bolívar forte|bolivar forte|bolívar|bolivar|bolívares|bolivares|vef"], ["Centavo de bolívar", "cêntimo de bolívar|cêntimos de bolívar|centavo de bolívar|centavo de bolivar|centavos de bolívar|centavos de bolivar"], ["Dongue vietnamita", "dongue vietnamita|Đồng vietnamita|dong vietnamita|dongues vietnamitas|dongs vietnamitas|vnd"], ["Hào vietnamita", "hào vietnamita|hao vietnamita|hào vietnamitas|hàos vietnamitas|haos vietnamitas"], ["Rial iemenita", "rial iemenita|riais iemenitas|yer"], ["Fils iemenita", "fils iemenita|fils iemenitas"], ["Franco djibutiano", "franco djibutiano|francos djibutianos|franco jibutiano|francos jibutianos|djf"], ["Dinar iugoslavo", "dinar iugoslavo|dinares iugoslavos|dinar jugoslavo|dinares jugoslavos|yud"], ["Kwacha zambiano", "kwacha zambiano|kwacha zambianos|kwachas zambianos|zmw"], ["Ngwee zambiano", "ngwee zambiano|ngwee zambianos|ngwees zambianos"]]); + PortugueseNumericWithUnit.CompoundUnitConnectorRegex = `(?[^.])`; + PortugueseNumericWithUnit.CurrencyPrefixList = new Map([["Dólar", "$"], ["Dólar estadunidense", "us$|u$d|usd"], ["Dólar do Caribe Oriental", "ec$|xcd"], ["Dólar australiano", "a$|aud"], ["Dólar bahamense", "b$|bsd"], ["Dólar de Barbados", "bds$|bbd"], ["Dólar de Belizebe", "bz$|bzd"], ["Dólar bermudense", "bd$|bmd"], ["Dólar de Brunebi", "brunéi $|bnd"], ["Dólar de Cingapura", "s$|sgd"], ["Dólar canadense", "c$|can$|cad"], ["Dólar das Ilhas Cayman", "ci$|kyd"], ["Dólar neozelandês", "nz$|nzd"], ["Dólar fijgiano", "fj$|fjd"], ["Dólar guianense", "gy$|gyd"], ["Dólar de Hong Kong", "hk$|hkd"], ["Dólar jamaicano", "j$|ja$|jmd"], ["Dólar liberiano", "l$|lrd"], ["Dólar namibiano", "n$|nad"], ["Dólar das Ilhas Salomão", "si$|sbd"], ["Novo dólar taiwanês", "nt$|twd"], ["Real brasileiro", "r$|brl"], ["Guarani", "₲|gs.|pyg"], ["Dólar de Trinidade e Tobago", "tt$|ttd"], ["Yuan chinês", "¥|cny|rmb"], ["Yen", "¥|jpy"], ["Euro", "€|eur"], ["Florim", "ƒ"], ["Libra", "£|gbp"], ["Colón costarriquenho", "₡"], ["Lira turca", "₺"]]); + PortugueseNumericWithUnit.AmbiguousCurrencyUnitList = ['le']; + PortugueseNumericWithUnit.InformationSuffixList = new Map([["bit", "bit|bits"], ["kilobit", "kilobit|kilobits|kb|kbit"], ["megabit", "megabit|megabits|Mb|Mbit"], ["gigabit", "gigabit|gigabits|Gb|Gbit"], ["terabit", "terabit|terabits|Tb|Tbit"], ["petabit", "petabit|petabits|Pb|Pbit"], ["kibibit", "kibibit|kibibits|kib|kibit"], ["mebibit", "mebibit|mebibits|Mib|Mibit"], ["gibibit", "gibibit|gibibits|Gib|Gibit"], ["tebibit", "tebibit|tebibits|Tib|Tibit"], ["pebibit", "pebibit|pebibits|Pib|Pibit"], ["byte", "byte|bytes"], ["kilobyte", "kilobyte|kilobytes|kB|kByte"], ["megabyte", "megabyte|megabytes|MB|MByte"], ["gigabyte", "gigabyte|gigabytes|GB|GByte"], ["terabyte", "terabyte|terabytes|TB|TByte"], ["petabyte", "petabyte|petabytes|PB|PByte"], ["kibibyte", "kibibyte|kibibytes|kiB|kiByte"], ["mebibyte", "mebibyte|mebibytes|MiB|MiByte"], ["gibibyte", "gibibyte|gibibytes|GiB|GiByte"], ["tebibyte", "tebibyte|tebibytes|TiB|TiByte"], ["pebibyte", "pebibyte|pebibytes|PiB|PiByte"]]); + PortugueseNumericWithUnit.AmbiguousDimensionUnitList = ['ton', 'tonelada', 'área', 'area', 'áreas', 'areas', 'milha', 'milhas']; + PortugueseNumericWithUnit.BuildPrefix = `(?<=(\\s|^|\\P{L}))`; + PortugueseNumericWithUnit.BuildSuffix = `(?=(\\s|\\P{L}|$))`; + PortugueseNumericWithUnit.ConnectorToken = 'de'; + PortugueseNumericWithUnit.LengthSuffixList = new Map([["Quilômetro", "km|quilometro|quilômetro|quilómetro|quilometros|quilômetros|quilómetros"], ["Hectômetro", "hm|hectometro|hectômetro|hectómetro|hectometros|hectômetros|hectómetros"], ["Decâmetro", "decametro|decâmetro|decámetro|decametros|decâmetro|decámetros|dam"], ["Metro", "m|m.|metro|metros"], ["Decímetro", "dm|decimetro|decímetro|decimetros|decímetros"], ["Centímetro", "cm|centimetro|centímetro|centimetros|centimetros"], ["Milímetro", "mm|milimetro|milímetro|milimetros|milímetros"], ["Micrômetro", "µm|um|micrometro|micrômetro|micrómetro|micrometros|micrômetros|micrómetros|micron|mícron|microns|mícrons|micra"], ["Nanômetro", "nm|nanometro|nanômetro|nanómetro|nanometros|nanômetros|nanómetros|milimicron|milimícron|milimicrons|milimícrons"], ["Picômetro", "pm|picometro|picômetro|picómetro|picometros|picômetros|picómetros"], ["Milha", "mi|milha|milhas"], ["Jarda", "yd|jarda|jardas"], ["Polegada", "polegada|polegadas|\""], ["Pé", "pé|pe|pés|pes|ft"], ["Ano luz", "ano luz|anos luz|al"]]); + PortugueseNumericWithUnit.AmbiguousLengthUnitList = ['mi', 'milha', 'milhas']; + PortugueseNumericWithUnit.SpeedSuffixList = new Map([["Metro por segundo", "metro/segundo|m/s|metro por segundo|metros por segundo|metros por segundos"], ["Quilômetro por hora", "km/h|quilômetro por hora|quilómetro por hora|quilometro por hora|quilômetros por hora|quilómetros por hora|quilometros por hora|quilômetro/hora|quilómetro/hora|quilometro/hora|quilômetros/hora|quilómetros/hora|quilometros/hora"], ["Quilômetro por minuto", "km/min|quilômetro por minuto|quilómetro por minuto|quilometro por minuto|quilômetros por minuto|quilómetros por minuto|quilometros por minuto|quilômetro/minuto|quilómetro/minuto|quilometro/minuto|quilômetros/minuto|quilómetros/minuto|quilometros/minuto"], ["Quilômetro por segundo", "km/seg|quilômetro por segundo|quilómetro por segundo|quilometro por segundo|quilômetros por segundo|quilómetros por segundo|quilometros por segundo|quilômetro/segundo|quilómetro/segundo|quilometro/segundo|quilômetros/segundo|quilómetros/segundo|quilometros/segundo"], ["Milha por hora", "mph|milha por hora|mi/h|milha/hora|milhas/hora|milhas por hora"], ["Nó", "kt|nó|nós|kn"], ["Pé por segundo", "ft/s|pé/s|pe/s|ft/seg|pé/seg|pe/seg|pé por segundo|pe por segundo|pés por segundo|pes por segundo"], ["Pé por minuto", "ft/min|pé/mind|pe/min|pé por minuto|pe por minuto|pés por minuto|pes por minuto"], ["Jarda por minuto", "jardas por minuto|jardas/minuto|jardas/min"], ["Jarda por segundo", "jardas por segundo|jardas/segundo|jardas/seg"]]); + PortugueseNumericWithUnit.AmbiguousSpeedUnitList = ['nó', 'no', 'nós', 'nos']; + PortugueseNumericWithUnit.TemperatureSuffixList = new Map([["Kelvin", "k|kelvin"], ["Grau Rankine", "r|°r|°ra|grau rankine|graus rankine| rankine"], ["Grau Celsius", "°c|grau c|grau celsius|graus c|graus celsius|celsius|grau centígrado|grau centrigrado|graus centígrados|graus centigrados|centígrado|centígrados|centigrado|centigrados"], ["Grau Fahrenheit", "°f|grau f|graus f|grau fahrenheit|graus fahrenheit|fahrenheit"], ["Grau", "°|graus|grau"]]); + PortugueseNumericWithUnit.VolumeSuffixList = new Map([["Quilômetro cúbico", "quilômetro cúbico|quilómetro cúbico|quilometro cubico|quilômetros cúbicos|quilómetros cúbicos|quilometros cubicos|km3|km^3|km³"], ["Hectômetro cúbico", "hectômetro cúbico|hectómetro cúbico|hectometro cubico|hectômetros cúbicos|hectómetros cúbicos|hectometros cubicos|hm3|hm^3|hm³"], ["Decâmetro cúbico", "decâmetro cúbico|decámetro cúbico|decametro cubico|decâmetros cúbicos|decámetros cúbicos|decametros cubicosdam3|dam^3|dam³"], ["Metro cúbico", "metro cúbico|metro cubico|metros cúbicos|metros cubicos|m3|m^3|m³"], ["Decímetro cúbico", "decímetro cúbico|decimetro cubico|decímetros cúbicos|decimetros cubicos|dm3|dm^3|dm³"], ["Centímetro cúbico", "centímetro cúbico|centimetro cubico|centímetros cúbicos|centrimetros cubicos|cc|cm3|cm^3|cm³"], ["Milímetro cúbico", "milímetro cúbico|milimetro cubico|milímetros cúbicos|milimetros cubicos|mm3|mm^3|mm³"], ["Polegada cúbica", "polegada cúbica|polegada cubica|polegadas cúbicas|polegadas cubicas"], ["Pé cúbico", "pé cúbico|pe cubico|pés cúbicos|pes cubicos|pé3|pe3|pé^3|pe^3|pé³|pe³|ft3|ft^3|ft³"], ["Jarda cúbica", "jarda cúbica|jarda cubica|jardas cúbicas|jardas cubicas|yd3|yd^3|yd³"], ["Hectolitro", "hectolitro|hectolitros|hl"], ["Litro", "litro|litros|lts|l"], ["Mililitro", "mililitro|mililitros|ml"], ["Galão", "galão|galões|galao|galoes"], ["Pint", "pinta|pintas|pinto|pintos|quartilho|quartilhos|pint|pints"], ["Barril", "barril|barris|bbl"], ["Onça líquida", "onça líquida|onca liquida|onças líquidas|oncas liquidas"]]); + PortugueseNumericWithUnit.WeightSuffixList = new Map([["Tonelada métrica", "tonelada métrica|tonelada metrica|toneladas métricas|toneladas metricas"], ["Tonelada", "ton|tonelada|toneladas"], ["Quilograma", "kg|quilograma|quilogramas|quilo|quilos|kilo|kilos"], ["Hectograma", "hg|hectograma|hectogramas"], ["Decagrama", "dag|decagrama|decagramas"], ["Grama", "g|gr|grama|gramas"], ["Decigrama", "dg|decigrama|decigramas"], ["Centigrama", "cg|centigrama|centigramas"], ["Miligrama", "mg|miligrama|miligramas"], ["Micrograma", "µg|ug|micrograma|microgramas"], ["Nanograma", "ng|nanograma|nanogramas"], ["Picograma", "pg|picograma|picogramas"], ["Libra", "lb|libra|libras"], ["Onça", "oz|onça|onca|onças|oncas"], ["Grão", "grão|grao|grãos|graos|gr"], ["Quilate", "ct|kt|quilate|quilates"]]); +})(PortugueseNumericWithUnit = exports.PortugueseNumericWithUnit || (exports.PortugueseNumericWithUnit = {})); + +}); + +unwrapExports(portugueseNumericWithUnit); + +var base$4 = createCommonjsModule(function (module, exports) { +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); + + + + + +class PortugueseNumberWithUnitExtractorConfiguration { + constructor(ci) { + this.cultureInfo = ci; + this.unitNumExtractor = new recognizersTextNumber.PortugueseNumberExtractor(); + this.buildPrefix = portugueseNumericWithUnit.PortugueseNumericWithUnit.BuildPrefix; + this.buildSuffix = portugueseNumericWithUnit.PortugueseNumericWithUnit.BuildSuffix; + this.connectorToken = portugueseNumericWithUnit.PortugueseNumericWithUnit.ConnectorToken; + this.compoundUnitConnectorRegex = recognizersText.RegExpUtility.getSafeRegExp(portugueseNumericWithUnit.PortugueseNumericWithUnit.CompoundUnitConnectorRegex); + this.pmNonUnitRegex = recognizersText.RegExpUtility.getSafeRegExp(baseUnits.BaseUnits.PmNonUnitRegex); + } +} +exports.PortugueseNumberWithUnitExtractorConfiguration = PortugueseNumberWithUnitExtractorConfiguration; +class PortugueseNumberWithUnitParserConfiguration extends parsers$4.BaseNumberWithUnitParserConfiguration { + constructor(ci) { + super(ci); + this.internalNumberExtractor = new recognizersTextNumber.PortugueseNumberExtractor(recognizersTextNumber.NumberMode.Default); + this.internalNumberParser = recognizersTextNumber.AgnosticNumberParserFactory.getParser(recognizersTextNumber.AgnosticNumberParserType.Number, new recognizersTextNumber.PortugueseNumberParserConfiguration()); + this.connectorToken = portugueseNumericWithUnit.PortugueseNumericWithUnit.ConnectorToken; + } +} +exports.PortugueseNumberWithUnitParserConfiguration = PortugueseNumberWithUnitParserConfiguration; + +}); + +unwrapExports(base$4); + +var currency$4 = createCommonjsModule(function (module, exports) { +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); + + + + +class PortugueseCurrencyExtractorConfiguration extends base$4.PortugueseNumberWithUnitExtractorConfiguration { + constructor(ci) { + if (!ci) { + ci = new recognizersTextNumber.CultureInfo(recognizersTextNumber.Culture.Portuguese); + } + super(ci); + this.extractType = constants$2.Constants.SYS_UNIT_CURRENCY; + // Reference Source: https:// en.wikipedia.org/wiki/List_of_circulating_currencies + this.suffixList = portugueseNumericWithUnit.PortugueseNumericWithUnit.CurrencySuffixList; + this.prefixList = portugueseNumericWithUnit.PortugueseNumericWithUnit.CurrencyPrefixList; + this.ambiguousUnitList = portugueseNumericWithUnit.PortugueseNumericWithUnit.AmbiguousCurrencyUnitList; + } +} +exports.PortugueseCurrencyExtractorConfiguration = PortugueseCurrencyExtractorConfiguration; +class PortugueseCurrencyParserConfiguration extends base$4.PortugueseNumberWithUnitParserConfiguration { + constructor(ci) { + if (!ci) { + ci = new recognizersTextNumber.CultureInfo(recognizersTextNumber.Culture.Portuguese); + } + super(ci); + this.BindDictionary(portugueseNumericWithUnit.PortugueseNumericWithUnit.CurrencySuffixList); + this.BindDictionary(portugueseNumericWithUnit.PortugueseNumericWithUnit.CurrencyPrefixList); + } +} +exports.PortugueseCurrencyParserConfiguration = PortugueseCurrencyParserConfiguration; + +}); + +unwrapExports(currency$4); + +var temperature$4 = createCommonjsModule(function (module, exports) { +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); + + + + +class PortugueseTemperatureExtractorConfiguration extends base$4.PortugueseNumberWithUnitExtractorConfiguration { + constructor(ci) { + if (!ci) { + ci = new recognizersTextNumber.CultureInfo(recognizersTextNumber.Culture.Portuguese); + } + super(ci); + this.extractType = constants$2.Constants.SYS_UNIT_TEMPERATURE; + this.suffixList = portugueseNumericWithUnit.PortugueseNumericWithUnit.TemperatureSuffixList; + this.prefixList = new Map(); + this.ambiguousUnitList = new Array(); + } +} +exports.PortugueseTemperatureExtractorConfiguration = PortugueseTemperatureExtractorConfiguration; +class PortugueseTemperatureParserConfiguration extends base$4.PortugueseNumberWithUnitParserConfiguration { + constructor(ci) { + if (!ci) { + ci = new recognizersTextNumber.CultureInfo(recognizersTextNumber.Culture.Portuguese); + } + super(ci); + this.BindDictionary(portugueseNumericWithUnit.PortugueseNumericWithUnit.TemperatureSuffixList); + } +} +exports.PortugueseTemperatureParserConfiguration = PortugueseTemperatureParserConfiguration; + +}); + +unwrapExports(temperature$4); + +var dimension$4 = createCommonjsModule(function (module, exports) { +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); + + + + +const dimensionSuffixList = new Map([ + ...portugueseNumericWithUnit.PortugueseNumericWithUnit.InformationSuffixList, + ...portugueseNumericWithUnit.PortugueseNumericWithUnit.AreaSuffixList, + ...portugueseNumericWithUnit.PortugueseNumericWithUnit.LengthSuffixList, + ...portugueseNumericWithUnit.PortugueseNumericWithUnit.SpeedSuffixList, + ...portugueseNumericWithUnit.PortugueseNumericWithUnit.VolumeSuffixList, + ...portugueseNumericWithUnit.PortugueseNumericWithUnit.WeightSuffixList +]); +class PortugueseDimensionExtractorConfiguration extends base$4.PortugueseNumberWithUnitExtractorConfiguration { + constructor(ci) { + if (!ci) { + ci = new recognizersTextNumber.CultureInfo(recognizersTextNumber.Culture.Portuguese); + } + super(ci); + this.extractType = constants$2.Constants.SYS_UNIT_DIMENSION; + this.suffixList = dimensionSuffixList; + this.prefixList = new Map(); + this.ambiguousUnitList = portugueseNumericWithUnit.PortugueseNumericWithUnit.AmbiguousDimensionUnitList; + } +} +exports.PortugueseDimensionExtractorConfiguration = PortugueseDimensionExtractorConfiguration; +class PortugueseDimensionParserConfiguration extends base$4.PortugueseNumberWithUnitParserConfiguration { + constructor(ci) { + if (!ci) { + ci = new recognizersTextNumber.CultureInfo(recognizersTextNumber.Culture.Portuguese); + } + super(ci); + this.BindDictionary(dimensionSuffixList); + } +} +exports.PortugueseDimensionParserConfiguration = PortugueseDimensionParserConfiguration; + +}); + +unwrapExports(dimension$4); + +var age$4 = createCommonjsModule(function (module, exports) { +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); + + + + +class PortugueseAgeExtractorConfiguration extends base$4.PortugueseNumberWithUnitExtractorConfiguration { + constructor(ci) { + if (!ci) { + ci = new recognizersTextNumber.CultureInfo(recognizersTextNumber.Culture.Portuguese); + } + super(ci); + this.extractType = constants$2.Constants.SYS_UNIT_AGE; + this.suffixList = portugueseNumericWithUnit.PortugueseNumericWithUnit.AgeSuffixList; + this.prefixList = new Map(); + this.ambiguousUnitList = new Array(); + } +} +exports.PortugueseAgeExtractorConfiguration = PortugueseAgeExtractorConfiguration; +class PortugueseAgeParserConfiguration extends base$4.PortugueseNumberWithUnitParserConfiguration { + constructor(ci) { + if (!ci) { + ci = new recognizersTextNumber.CultureInfo(recognizersTextNumber.Culture.Portuguese); + } + super(ci); + this.BindDictionary(portugueseNumericWithUnit.PortugueseNumericWithUnit.AgeSuffixList); + } +} +exports.PortugueseAgeParserConfiguration = PortugueseAgeParserConfiguration; + +}); + +unwrapExports(age$4); + +var chineseNumericWithUnit = createCommonjsModule(function (module, exports) { +"use strict"; +// ------------------------------------------------------------------------------ +// +// This code was generated by a tool. +// Changes to this file may cause incorrect behavior and will be lost if +// the code is regenerated. +// +// ------------------------------------------------------------------------------ +Object.defineProperty(exports, "__esModule", { value: true }); +var ChineseNumericWithUnit; +(function (ChineseNumericWithUnit) { + ChineseNumericWithUnit.AgeAmbiguousValues = ['岁']; + ChineseNumericWithUnit.AgeSuffixList = new Map([["Year", "岁|周岁"], ["Month", "个月大|月大"], ["Week", "周大"], ["Day", "天大"]]); + ChineseNumericWithUnit.BuildPrefix = ''; + ChineseNumericWithUnit.BuildSuffix = ''; + ChineseNumericWithUnit.ConnectorToken = ''; + ChineseNumericWithUnit.CurrencySuffixList = new Map([["Afghan afghani", "阿富汗尼"], ["Pul", "普尔"], ["Euro", "欧元"], ["Cent", "美分"], ["Albanian lek", "阿尔巴尼亚列克|列克"], ["Angolan kwanza", "安哥拉宽扎|宽扎"], ["Armenian dram", "亚美尼亚德拉姆"], ["Aruban florin", "阿鲁巴弗罗林|阿鲁巴币"], ["Bangladeshi taka", "塔卡|孟加拉塔卡"], ["Paisa", "派萨|帕萨"], ["Bhutanese ngultrum", "不丹努尔特鲁姆|不丹努扎姆|努扎姆"], ["Chetrum", "切特鲁姆"], ["Bolivian boliviano", "玻利维亚诺|玻利维亚币"], ["Bosnia and Herzegovina convertible mark", "波斯尼亚和黑塞哥维那可兑换马克|波赫可兑换马克"], ["Botswana pula", "博茨瓦纳普拉|普拉"], ["Thebe", "thebe"], ["Brazilian real", "巴西雷亚尔"], ["Bulgarian lev", "保加利亚列弗|保加利亚列瓦"], ["Stotinka", "斯托丁卡"], ["Cambodian riel", "瑞尔"], ["Cape Verdean escudo", "佛得角埃斯库多|维德角埃斯库多"], ["Croatian kuna", "克罗地亚库纳|克罗地亚库那|克罗埃西亚库纳"], ["Lipa", "利巴"], ["Eritrean nakfa", "厄立特里亚纳克法"], ["Ethiopian birr", "埃塞俄比亚比尔|埃塞俄比亚元"], ["Gambian dalasi", "冈比亚达拉西|甘比亚达拉西"], ["Butut", "布达|布图"], ["Georgian lari", "格鲁吉亚拉里"], ["Tetri", "特特里|泰特里"], ["Ghanaian cedi", "塞地|加纳塞地"], ["Pesewa", "比塞瓦"], ["Guatemalan quetzal", "瓜地马拉格查尔"], ["Haitian gourde", "海地古德"], ["Honduran lempira", "洪都拉斯伦皮拉"], ["Hungarian forint", "匈牙利福林|匈牙利货币|匈牙利福林币"], ["Iranian rial", "伊朗里亚尔|伊朗莱尔"], ["Yemeni rial", "叶门莱尔|叶门里亚尔"], ["Israeli new shekel", "₪|ils|以色列币|以色列新克尔|谢克尔"], ["Japanese yen", "日元|日本元|日币|日圆"], ["Sen", "日本銭"], ["Kazakhstani tenge", "哈萨克斯坦坚戈"], ["Kenyan shilling", "肯尼亚先令"], ["North Korean won", "朝鲜圆|朝鲜元"], ["South Korean won", "韩元|韩圆"], ["Korean won", "₩"], ["Kyrgyzstani som", "吉尔吉斯斯坦索姆"], ["Lao kip", "基普|老挝基普|老挝币"], ["Att", "att"], ["Lesotho loti", "莱索托洛提|莱索托马洛蒂"], ["South African rand", "南非兰特"], ["Macedonian denar", "马其顿代纳尔|马其顿币|第纳尔|代纳尔"], ["Deni", "第尼"], ["Malagasy ariary", "马达加斯加阿里亚里"], ["Iraimbilanja", "伊莱姆比拉贾"], ["Malawian kwacha", "马拉威克瓦查"], ["Tambala", "坦巴拉"], ["Malaysian ringgit", "马来西亚币|马币|马来西亚林吉特"], ["Mauritanian ouguiya", "毛里塔尼亚乌吉亚"], ["Khoums", "库姆斯"], ["Mozambican metical", "莫桑比克梅蒂卡尔|梅蒂卡尔"], ["Burmese kyat", "缅甸元|缅元"], ["Pya", "缅分"], ["Nigerian naira", "尼日利亚奈拉|尼日利亚币|奈拉"], ["Kobo", "考包"], ["Turkish lira", "土耳其里拉"], ["Kuruş", "库鲁"], ["Omani rial", "阿曼里亚尔|阿曼莱尔"], ["Panamanian balboa", "巴拿马巴波亚"], ["Centesimo", "意大利分|乌拉圭分|巴拿马分"], ["Papua New Guinean kina", "基那"], ["Toea", "托亚|托伊"], ["Peruvian sol", "秘鲁索尔"], ["Polish złoty", "波兰币|波兰兹罗提|兹罗提"], ["Grosz", "格罗希"], ["Qatari riyal", "卡达里亚尔"], ["Saudi riyal", "沙特里亚尔"], ["Riyal", "里亚尔|"], ["Dirham", "迪拉姆"], ["Halala", "哈拉"], ["Samoan tālā", "萨摩亚塔拉"], ["Sierra Leonean leone", "塞拉利昂利昂|利昂"], ["Peseta", "比塞塔|西班牙比塞塔|西班牙币"], ["Swazi lilangeni", "斯威士兰里兰吉尼|兰吉尼"], ["Tajikistani somoni", "塔吉克斯坦索莫尼"], ["Thai baht", "泰铢|泰元"], ["Satang", "萨当"], ["Tongan paʻanga", "汤加潘加|潘加"], ["Ukrainian hryvnia", "乌克兰格里夫纳|格里夫纳"], ["Vanuatu vatu", "瓦努阿图瓦图"], ["Vietnamese dong", "越南盾"], ["Indonesian rupiah", "印度尼西亚盾"], ["Netherlands guilder", "荷兰盾|荷属安的列斯盾|列斯盾"], ["Surinam florin", "苏里南盾"], ["Guilder", "盾"], ["Zambian kwacha", "赞比亚克瓦查"], ["Moroccan dirham", "摩洛哥迪拉姆"], ["United Arab Emirates dirham", "阿联酋迪拉姆"], ["Azerbaijani manat", "阿塞拜疆马纳特"], ["Turkmenistan manat", "土库曼马纳特"], ["Manat", "马纳特"], ["Somali shilling", "索马里先令|索马利先令"], ["Somaliland shilling", "索马里兰先令"], ["Tanzanian shilling", "坦桑尼亚先令"], ["Ugandan shilling", "乌干达先令"], ["Romanian leu", "罗马尼亚列伊"], ["Moldovan leu", "摩尔多瓦列伊"], ["Leu", "列伊"], ["Ban", "巴尼"], ["Nepalese rupee", "尼泊尔卢比"], ["Pakistani rupee", "巴基斯坦卢比"], ["Indian rupee", "印度卢比"], ["Seychellois rupee", "塞舌尔卢比"], ["Mauritian rupee", "毛里求斯卢比"], ["Maldivian rufiyaa", "马尔代夫卢比"], ["Sri Lankan rupee", "斯里兰卡卢比"], ["Rupee", "卢比"], ["Czech koruna", "捷克克朗"], ["Danish krone", "丹麦克朗|丹麦克郎"], ["Norwegian krone", "挪威克朗"], ["Faroese króna", "法罗克朗"], ["Icelandic króna", "冰岛克朗"], ["Swedish krona", "瑞典克朗"], ["Krone", "克朗"], ["Øre", "奥依拉|奥拉|埃利"], ["West African CFA franc", "非共体法郎"], ["Central African CFA franc", "中非法郎|中非金融合作法郎"], ["Comorian franc", "科摩罗法郎"], ["Congolese franc", "刚果法郎"], ["Burundian franc", "布隆迪法郎"], ["Djiboutian franc", "吉布提法郎"], ["CFP franc", "太平洋法郎"], ["Guinean franc", "几内亚法郎"], ["Swiss franc", "瑞士法郎"], ["Rwandan franc", "卢旺达法郎"], ["Belgian franc", "比利时法郎"], ["Rappen", "瑞士分|瑞士生丁"], ["Franc", "法郎"], ["Centime", "生丁|仙士"], ["Russian ruble", "俄国卢布|俄罗斯卢布"], ["Transnistrian ruble", "德涅斯特卢布"], ["Belarusian ruble", "白俄罗斯卢布"], ["Kopek", "戈比"], ["Ruble", "卢布"], ["Algerian dinar", "阿尔及利亚第纳尔"], ["Bahraini dinar", "巴林第纳尔"], ["Iraqi dinar", "伊拉克第纳尔|"], ["Jordanian dinar", "约旦第纳尔"], ["Kuwaiti dinar", "科威特第纳尔|科威特币"], ["Libyan dinar", "利比亚第纳尔"], ["Serbian dinar", "塞尔维亚第纳尔|塞尔维亚币"], ["Tunisian dinar", "突尼斯第纳尔"], ["Dinar", "第纳尔"], ["Fils", "费尔"], ["Para", "帕拉"], ["Millime", "米利姆"], ["Argentine peso", "阿根廷比索"], ["Chilean peso", "智利比索"], ["Colombian peso", "哥伦比亚比索"], ["Cuban peso", "古巴比索"], ["Dominican peso", "多米尼加比索"], ["Mexican peso", "墨西哥比索"], ["Philippine peso", "菲律宾比索"], ["Uruguayan peso", "乌拉圭比索"], ["Peso", "比索"], ["Centavo", "仙|菲辅币"], ["Alderney pound", "奥尔德尼镑"], ["British pound", "英镑"], ["Guernsey pound", "根西镑"], ["Saint Helena pound", "圣赫勒拿镑"], ["Egyptian pound", "埃及镑"], ["Falkland Islands pound", "福克兰镑"], ["Gibraltar pound", "直布罗陀镑"], ["Manx pound", "马恩岛镑"], ["Jersey pound", "泽西岛镑"], ["Lebanese pound", "黎巴嫩镑"], ["South Sudanese pound", "南苏丹镑"], ["Sudanese pound", "苏丹镑"], ["Syrian pound", "叙利亚镑"], ["Pound", "英镑"], ["Pence", "便士"], ["Shilling", "先令"], ["United States dollar", "美元|美金|美圆"], ["East Caribbean dollar", "东加勒比元"], ["Australian dollar", "澳大利亚元|澳元"], ["Bahamian dollar", "巴哈马元"], ["Barbadian dollar", "巴巴多斯元"], ["Belize dollar", "伯利兹元"], ["Bermudian dollar", "百慕大元"], ["Brunei dollar", "文莱元"], ["Singapore dollar", "新加坡元|新元"], ["Canadian dollar", "加元|加拿大元"], ["Cayman Islands dollar", "开曼岛元|"], ["New Zealand dollar", "新西兰元|纽元"], ["Cook Islands dollar", "库克群岛元"], ["Fijian dollar", "斐济元|斐币"], ["Guyanese dollar", "圭亚那元"], ["Hong Kong dollar", "蚊|港元|港圆|港币"], ["Macau Pataca", "澳元|澳门币|澳门元"], ["New Taiwan dollar", "箍|新台币|台币"], ["Jamaican dollar", "牙买加元"], ["Kiribati dollar", "吉里巴斯元"], ["Liberian dollar", "利比里亚元"], ["Namibian dollar", "纳米比亚元"], ["Surinamese dollar", "苏里南元"], ["Trinidad and Tobago dollar", "特立尼达多巴哥元"], ["Tuvaluan dollar", "吐瓦鲁元"], ["Chinese yuan", "人民币|人民币元|块钱|块|元|圆"], ["Fen", "分钱|分"], ["Jiao", "毛钱|毛|角钱|角"], ["Finnish markka", "芬兰马克"], ["Penni", "盆尼"]]); + ChineseNumericWithUnit.CurrencyNameToIsoCodeMap = new Map([["Afghan afghani", "AFN"], ["Euro", "EUR"], ["Albanian lek", "ALL"], ["Angolan kwanza", "AOA"], ["Armenian dram", "AMD"], ["Aruban florin", "AWG"], ["Bangladeshi taka", "BDT"], ["Bhutanese ngultrum", "BTN"], ["Bolivian boliviano", "BOB"], ["Bosnia and Herzegovina convertible mark", "BAM"], ["Botswana pula", "BWP"], ["Brazilian real", "BRL"], ["Bulgarian lev", "BGN"], ["Cambodian riel", "KHR"], ["Cape Verdean escudo", "CVE"], ["Costa Rican colón", "CRC"], ["Croatian kuna", "HRK"], ["Czech koruna", "CZK"], ["Eritrean nakfa", "ERN"], ["Ethiopian birr", "ETB"], ["Gambian dalasi", "GMD"], ["Georgian lari", "GEL"], ["Ghanaian cedi", "GHS"], ["Guatemalan quetzal", "GTQ"], ["Haitian gourde", "HTG"], ["Honduran lempira", "HNL"], ["Hungarian forint", "HUF"], ["Iranian rial", "IRR"], ["Yemeni rial", "YER"], ["Israeli new shekel", "ILS"], ["Japanese yen", "JPY"], ["Kazakhstani tenge", "KZT"], ["Kenyan shilling", "KES"], ["North Korean won", "KPW"], ["South Korean won", "KRW"], ["Kyrgyzstani som", "KGS"], ["Lao kip", "LAK"], ["Lesotho loti", "LSL"], ["South African rand", "ZAR"], ["Macanese pataca", "MOP"], ["Macedonian denar", "MKD"], ["Malagasy ariary", "MGA"], ["Malawian kwacha", "MWK"], ["Malaysian ringgit", "MYR"], ["Mauritanian ouguiya", "MRO"], ["Mongolian tögrög", "MNT"], ["Mozambican metical", "MZN"], ["Burmese kyat", "MMK"], ["Nicaraguan córdoba", "NIO"], ["Nigerian naira", "NGN"], ["Turkish lira", "TRY"], ["Omani rial", "OMR"], ["Panamanian balboa", "PAB"], ["Papua New Guinean kina", "PGK"], ["Paraguayan guaraní", "PYG"], ["Peruvian sol", "PEN"], ["Polish złoty", "PLN"], ["Qatari riyal", "QAR"], ["Saudi riyal", "SAR"], ["Samoan tālā", "WST"], ["São Tomé and Príncipe dobra", "STD"], ["Sierra Leonean leone", "SLL"], ["Swazi lilangeni", "SZL"], ["Tajikistani somoni", "TJS"], ["Thai baht", "THB"], ["Ukrainian hryvnia", "UAH"], ["Vanuatu vatu", "VUV"], ["Venezuelan bolívar", "VEF"], ["Zambian kwacha", "ZMW"], ["Moroccan dirham", "MAD"], ["United Arab Emirates dirham", "AED"], ["Azerbaijani manat", "AZN"], ["Turkmenistan manat", "TMT"], ["Somali shilling", "SOS"], ["Tanzanian shilling", "TZS"], ["Ugandan shilling", "UGX"], ["Romanian leu", "RON"], ["Moldovan leu", "MDL"], ["Nepalese rupee", "NPR"], ["Pakistani rupee", "PKR"], ["Indian rupee", "INR"], ["Seychellois rupee", "SCR"], ["Mauritian rupee", "MUR"], ["Maldivian rufiyaa", "MVR"], ["Sri Lankan rupee", "LKR"], ["Indonesian rupiah", "IDR"], ["Danish krone", "DKK"], ["Norwegian krone", "NOK"], ["Icelandic króna", "ISK"], ["Swedish krona", "SEK"], ["West African CFA franc", "XOF"], ["Central African CFA franc", "XAF"], ["Comorian franc", "KMF"], ["Congolese franc", "CDF"], ["Burundian franc", "BIF"], ["Djiboutian franc", "DJF"], ["CFP franc", "XPF"], ["Guinean franc", "GNF"], ["Swiss franc", "CHF"], ["Rwandan franc", "RWF"], ["Russian ruble", "RUB"], ["Transnistrian ruble", "PRB"], ["Belarusian ruble", "BYN"], ["Algerian dinar", "DZD"], ["Bahraini dinar", "BHD"], ["Iraqi dinar", "IQD"], ["Jordanian dinar", "JOD"], ["Kuwaiti dinar", "KWD"], ["Libyan dinar", "LYD"], ["Serbian dinar", "RSD"], ["Tunisian dinar", "TND"], ["Argentine peso", "ARS"], ["Chilean peso", "CLP"], ["Colombian peso", "COP"], ["Cuban convertible peso", "CUC"], ["Cuban peso", "CUP"], ["Dominican peso", "DOP"], ["Mexican peso", "MXN"], ["Uruguayan peso", "UYU"], ["British pound", "GBP"], ["Saint Helena pound", "SHP"], ["Egyptian pound", "EGP"], ["Falkland Islands pound", "FKP"], ["Gibraltar pound", "GIP"], ["Manx pound", "IMP"], ["Jersey pound", "JEP"], ["Lebanese pound", "LBP"], ["South Sudanese pound", "SSP"], ["Sudanese pound", "SDG"], ["Syrian pound", "SYP"], ["United States dollar", "USD"], ["Australian dollar", "AUD"], ["Bahamian dollar", "BSD"], ["Barbadian dollar", "BBD"], ["Belize dollar", "BZD"], ["Bermudian dollar", "BMD"], ["Brunei dollar", "BND"], ["Singapore dollar", "SGD"], ["Canadian dollar", "CAD"], ["Cayman Islands dollar", "KYD"], ["New Zealand dollar", "NZD"], ["Fijian dollar", "FJD"], ["Guyanese dollar", "GYD"], ["Hong Kong dollar", "HKD"], ["Jamaican dollar", "JMD"], ["Liberian dollar", "LRD"], ["Namibian dollar", "NAD"], ["Solomon Islands dollar", "SBD"], ["Surinamese dollar", "SRD"], ["New Taiwan dollar", "TWD"], ["Trinidad and Tobago dollar", "TTD"], ["Tuvaluan dollar", "TVD"], ["Chinese yuan", "CNY"], ["Rial", "__RI"], ["Shiling", "__S"], ["Som", "__SO"], ["Dirham", "__DR"], ["Dinar", "_DN"], ["Dollar", "__D"], ["Manat", "__MA"], ["Rupee", "__R"], ["Krone", "__K"], ["Krona", "__K"], ["Crown", "__K"], ["Frank", "__F"], ["Mark", "__M"], ["Ruble", "__RB"], ["Peso", "__PE"], ["Pound", "__P"], ["Tristan da Cunha pound", "_TP"], ["South Georgia and the South Sandwich Islands pound", "_SP"], ["Somaliland shilling", "_SS"], ["Pitcairn Islands dollar", "_PND"], ["Palauan dollar", "_PD"], ["Niue dollar", "_NID"], ["Nauruan dollar", "_ND"], ["Micronesian dollar", "_MD"], ["Kiribati dollar", "_KID"], ["Guernsey pound", "_GGP"], ["Faroese króna", "_FOK"], ["Cook Islands dollar", "_CKD"], ["British Virgin Islands dollar", "_BD"], ["Ascension pound", "_AP"], ["Alderney pound", "_ALP"], ["Abkhazian apsar", "_AA"]]); + ChineseNumericWithUnit.FractionalUnitNameToCodeMap = new Map([["Jiao", "JIAO"], ["Kopek", "KOPEK"], ["Pul", "PUL"], ["Cent", "CENT"], ["Qindarkë", "QINDARKE"], ["Penny", "PENNY"], ["Santeem", "SANTEEM"], ["Cêntimo", "CENTIMO"], ["Centavo", "CENTAVO"], ["Luma", "LUMA"], ["Qəpik", "QƏPIK"], ["Fils", "FILS"], ["Poisha", "POISHA"], ["Kapyeyka", "KAPYEYKA"], ["Centime", "CENTIME"], ["Chetrum", "CHETRUM"], ["Paisa", "PAISA"], ["Fening", "FENING"], ["Thebe", "THEBE"], ["Sen", "SEN"], ["Stotinka", "STOTINKA"], ["Fen", "FEN"], ["Céntimo", "CENTIMO"], ["Lipa", "LIPA"], ["Haléř", "HALER"], ["Øre", "ØRE"], ["Piastre", "PIASTRE"], ["Santim", "SANTIM"], ["Oyra", "OYRA"], ["Butut", "BUTUT"], ["Tetri", "TETRI"], ["Pesewa", "PESEWA"], ["Fillér", "FILLER"], ["Eyrir", "EYRIR"], ["Dinar", "DINAR"], ["Agora", "AGORA"], ["Tïın", "TIIN"], ["Chon", "CHON"], ["Jeon", "JEON"], ["Tyiyn", "TYIYN"], ["Att", "ATT"], ["Sente", "SENTE"], ["Dirham", "DIRHAM"], ["Rappen", "RAPPEN"], ["Avo", "AVO"], ["Deni", "DENI"], ["Iraimbilanja", "IRAIMBILANJA"], ["Tambala", "TAMBALA"], ["Laari", "LAARI"], ["Khoums", "KHOUMS"], ["Ban", "BAN"], ["Möngö", "MONGO"], ["Pya", "PYA"], ["Kobo", "KOBO"], ["Kuruş", "KURUS"], ["Baisa", "BAISA"], ["Centésimo", "CENTESIMO"], ["Toea", "TOEA"], ["Sentimo", "SENTIMO"], ["Grosz", "GROSZ"], ["Sene", "SENE"], ["Halala", "HALALA"], ["Para", "PARA"], ["Öre", "ORE"], ["Diram", "DIRAM"], ["Satang", "SATANG"], ["Seniti", "SENITI"], ["Millime", "MILLIME"], ["Tennesi", "TENNESI"], ["Kopiyka", "KOPIYKA"], ["Tiyin", "TIYIN"], ["Hào", "HAO"], ["Ngwee", "NGWEE"]]); + ChineseNumericWithUnit.CompoundUnitConnectorRegex = `(?又|再)`; + ChineseNumericWithUnit.CurrencyPrefixList = new Map([["Dollar", "$"], ["United States dollar", "us$"], ["British Virgin Islands dollar", "bvi$"], ["Brunei dollar", "b$"], ["Sen", "sen"], ["Singapore dollar", "s$"], ["Canadian dollar", "can$|c$|c $"], ["Cayman Islands dollar", "ci$"], ["New Zealand dollar", "nz$|nz $"], ["Guyanese dollar", "gy$|gy $|g$|g $"], ["Hong Kong dollar", "hk$|hkd|hk $"], ["Jamaican dollar", "j$"], ["Namibian dollar", "nad|n$|n $"], ["Solomon Islands dollar", "si$|si $"], ["New Taiwan dollar", "nt$|nt $"], ["Samoan tālā", "ws$"], ["Chinese yuan", "¥"], ["Japanese yen", "¥"], ["Turkish lira", "₺"], ["Euro", "€"], ["Pound", "£"], ["Costa Rican colón", "₡"]]); + ChineseNumericWithUnit.CurrencyAmbiguousValues = ['元', '仙', '分', '圆', '块', '毛', '盾', '箍', '蚊', '角']; + ChineseNumericWithUnit.DimensionSuffixList = new Map([["Meter", "米|公尺|m"], ["Kilometer", "千米|公里|km"], ["Decimeter", "分米|公寸|dm"], ["Centimeter", "釐米|厘米|公分|cm"], ["Micrometer", "毫米|公釐|mm"], ["Microns", "微米"], ["Picometer", "皮米"], ["Nanometer", "纳米"], ["Li", "里|市里"], ["Zhang", "丈"], ["Chi", "市尺|尺"], ["Cun", "市寸|寸"], ["Fen", "市分|分"], ["Hao", "毫"], ["Mile", "英里"], ["Inch", "英寸"], ["Foot", "呎|英尺"], ["Yard", "码"], ["Knot", "海里"], ["Light year", "光年"], ["Meter per second", "米每秒|米/秒|m/s"], ["Kilometer per hour", "公里每小时|千米每小时|公里/小时|千米/小时|km/h"], ["Kilometer per minute", "公里每分钟|千米每分钟|公里/分钟|千米/分钟|km/min"], ["Kilometer per second", "公里每秒|千米每秒|公里/秒|千米/秒|km/s"], ["Mile per hour", "英里每小时|英里/小时"], ["Foot per second", "英尺每小时|英尺/小时"], ["Foot per minute", "英尺每分钟|英尺/分钟"], ["Yard per minute", "码每分|码/分"], ["Yard per second", "码每秒|码/秒"], ["Square centimetre", "平方厘米"], ["Square decimeter", "平方分米"], ["Square meter", "平方米"], ["Square kilometer", "平方公里"], ["Acre", "英亩|公亩"], ["Hectare", "公顷"], ["Mu", "亩|市亩"], ["Liter", "公升|升|l"], ["Milliliter", "毫升|ml"], ["Cubic meter", "立方米"], ["Cubic decimeter", "立方分米"], ["Cubic millimeter", "立方毫米"], ["Cubic feet", "立方英尺"], ["Gallon", "加仑"], ["Pint", "品脱"], ["Dou", "市斗|斗"], ["Dan", "市石|石"], ["Kilogram", "千克|公斤|kg"], ["Jin", "市斤|斤"], ["Milligram", "毫克|mg"], ["Barrel", "桶"], ["Pot", "罐"], ["Gram", "克|g"], ["Ton", "公吨|吨|t"], ["Pound", "磅"], ["Ounce", "盎司"], ["Bit", "比特|位|b"], ["Byte", "字节|byte"], ["Kilobyte", "千字节|kb"], ["Megabyte", "兆字节|mb"], ["Gigabyte", "十亿字节|千兆字节|gb"], ["Terabyte", "万亿字节|兆兆字节|tb"], ["Petabyte", "千兆兆|千万亿字节|pb"]]); + ChineseNumericWithUnit.DimensionAmbiguousValues = ['丈', '位', '克', '分', '升', '寸', '尺', '斗', '斤', '桶', '毫', '石', '码', '磅', '米', '罐', '里', 'm', 'km', 'dm', 'cm', 'mm', 'l', 'ml', 'kg', 'mg', 'g', 't', 'b', 'byte', 'kb', 'mb', 'gb', 'tb', 'pb']; + ChineseNumericWithUnit.TemperatureSuffixList = new Map([["F", "华氏温度|华氏度|°f"], ["K", "k|开尔文温度|开氏度|凯氏度"], ["R", "兰氏温度|°r"], ["C", "摄氏温度|摄氏度|°c"], ["Degree", "度"]]); + ChineseNumericWithUnit.TemperaturePrefixList = new Map([["F", "华氏温度|华氏"], ["K", "开氏温度|开氏"], ["R", "兰氏温度|兰氏"], ["C", "摄氏温度|摄氏"]]); + ChineseNumericWithUnit.TemperatureAmbiguousValues = ['度', 'k']; +})(ChineseNumericWithUnit = exports.ChineseNumericWithUnit || (exports.ChineseNumericWithUnit = {})); + +}); + +unwrapExports(chineseNumericWithUnit); + +var base$6 = createCommonjsModule(function (module, exports) { +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); + + + + + +class ChineseNumberWithUnitExtractorConfiguration { + constructor(ci) { + this.cultureInfo = ci; + this.unitNumExtractor = new recognizersTextNumber.ChineseNumberExtractor(recognizersTextNumber.ChineseNumberExtractorMode.ExtractAll); + this.buildPrefix = chineseNumericWithUnit.ChineseNumericWithUnit.BuildPrefix; + this.buildSuffix = chineseNumericWithUnit.ChineseNumericWithUnit.BuildSuffix; + this.connectorToken = chineseNumericWithUnit.ChineseNumericWithUnit.ConnectorToken; + this.compoundUnitConnectorRegex = recognizersText.RegExpUtility.getSafeRegExp(chineseNumericWithUnit.ChineseNumericWithUnit.CompoundUnitConnectorRegex); + this.pmNonUnitRegex = recognizersText.RegExpUtility.getSafeRegExp(baseUnits.BaseUnits.PmNonUnitRegex); + } +} +exports.ChineseNumberWithUnitExtractorConfiguration = ChineseNumberWithUnitExtractorConfiguration; +class ChineseNumberWithUnitParserConfiguration extends parsers$4.BaseNumberWithUnitParserConfiguration { + constructor(ci) { + super(ci); + this.internalNumberExtractor = new recognizersTextNumber.ChineseNumberExtractor(recognizersTextNumber.ChineseNumberExtractorMode.Default); + this.internalNumberParser = recognizersTextNumber.AgnosticNumberParserFactory.getParser(recognizersTextNumber.AgnosticNumberParserType.Number, new recognizersTextNumber.ChineseNumberParserConfiguration()); + this.connectorToken = ''; + this.currencyNameToIsoCodeMap = chineseNumericWithUnit.ChineseNumericWithUnit.CurrencyNameToIsoCodeMap; + this.currencyFractionCodeList = chineseNumericWithUnit.ChineseNumericWithUnit.FractionalUnitNameToCodeMap; + } +} +exports.ChineseNumberWithUnitParserConfiguration = ChineseNumberWithUnitParserConfiguration; + +}); + +unwrapExports(base$6); + +var currency$6 = createCommonjsModule(function (module, exports) { +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); + + + + +class ChineseCurrencyExtractorConfiguration extends base$6.ChineseNumberWithUnitExtractorConfiguration { + constructor(ci) { + if (!ci) { + ci = new recognizersTextNumber.CultureInfo(recognizersTextNumber.Culture.Chinese); + } + super(ci); + this.extractType = constants$2.Constants.SYS_UNIT_CURRENCY; + // Reference Source: https:// en.wikipedia.org/wiki/List_of_circulating_currencies + this.suffixList = chineseNumericWithUnit.ChineseNumericWithUnit.CurrencySuffixList; + this.prefixList = chineseNumericWithUnit.ChineseNumericWithUnit.CurrencyPrefixList; + this.ambiguousUnitList = chineseNumericWithUnit.ChineseNumericWithUnit.CurrencyAmbiguousValues; + + } +} +exports.ChineseCurrencyExtractorConfiguration = ChineseCurrencyExtractorConfiguration; +class ChineseCurrencyParserConfiguration extends base$6.ChineseNumberWithUnitParserConfiguration { + constructor(ci) { + if (!ci) { + ci = new recognizersTextNumber.CultureInfo(recognizersTextNumber.Culture.Chinese); + } + super(ci); + this.BindDictionary(chineseNumericWithUnit.ChineseNumericWithUnit.CurrencySuffixList); + this.BindDictionary(chineseNumericWithUnit.ChineseNumericWithUnit.CurrencyPrefixList); + } +} +exports.ChineseCurrencyParserConfiguration = ChineseCurrencyParserConfiguration; + +}); + +unwrapExports(currency$6); + +var temperature$6 = createCommonjsModule(function (module, exports) { +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); + + + + +class ChineseTemperatureExtractorConfiguration extends base$6.ChineseNumberWithUnitExtractorConfiguration { + constructor(ci) { + if (!ci) { + ci = new recognizersTextNumber.CultureInfo(recognizersTextNumber.Culture.Chinese); + } + super(ci); + this.extractType = constants$2.Constants.SYS_UNIT_TEMPERATURE; + this.suffixList = chineseNumericWithUnit.ChineseNumericWithUnit.TemperatureSuffixList; + this.prefixList = chineseNumericWithUnit.ChineseNumericWithUnit.TemperaturePrefixList; + this.ambiguousUnitList = chineseNumericWithUnit.ChineseNumericWithUnit.TemperatureAmbiguousValues; + } +} +exports.ChineseTemperatureExtractorConfiguration = ChineseTemperatureExtractorConfiguration; +class ChineseTemperatureParserConfiguration extends base$6.ChineseNumberWithUnitParserConfiguration { + constructor(ci) { + if (!ci) { + ci = new recognizersTextNumber.CultureInfo(recognizersTextNumber.Culture.Chinese); + } + super(ci); + this.BindDictionary(chineseNumericWithUnit.ChineseNumericWithUnit.TemperaturePrefixList); + this.BindDictionary(chineseNumericWithUnit.ChineseNumericWithUnit.TemperatureSuffixList); + } +} +exports.ChineseTemperatureParserConfiguration = ChineseTemperatureParserConfiguration; + +}); + +unwrapExports(temperature$6); + +var dimension$6 = createCommonjsModule(function (module, exports) { +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); + + + + +class ChineseDimensionExtractorConfiguration extends base$6.ChineseNumberWithUnitExtractorConfiguration { + constructor(ci) { + if (!ci) { + ci = new recognizersTextNumber.CultureInfo(recognizersTextNumber.Culture.Chinese); + } + super(ci); + this.extractType = constants$2.Constants.SYS_UNIT_DIMENSION; + this.suffixList = chineseNumericWithUnit.ChineseNumericWithUnit.DimensionSuffixList; + this.prefixList = new Map(); + this.ambiguousUnitList = chineseNumericWithUnit.ChineseNumericWithUnit.DimensionAmbiguousValues; + } +} +exports.ChineseDimensionExtractorConfiguration = ChineseDimensionExtractorConfiguration; +class ChineseDimensionParserConfiguration extends base$6.ChineseNumberWithUnitParserConfiguration { + constructor(ci) { + if (!ci) { + ci = new recognizersTextNumber.CultureInfo(recognizersTextNumber.Culture.Chinese); + } + super(ci); + this.BindDictionary(chineseNumericWithUnit.ChineseNumericWithUnit.DimensionSuffixList); + } +} +exports.ChineseDimensionParserConfiguration = ChineseDimensionParserConfiguration; + +}); + +unwrapExports(dimension$6); + +var age$6 = createCommonjsModule(function (module, exports) { +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); + + + + +class ChineseAgeExtractorConfiguration extends base$6.ChineseNumberWithUnitExtractorConfiguration { + constructor(ci) { + if (!ci) { + ci = new recognizersTextNumber.CultureInfo(recognizersTextNumber.Culture.Chinese); + } + super(ci); + this.extractType = constants$2.Constants.SYS_UNIT_AGE; + this.suffixList = chineseNumericWithUnit.ChineseNumericWithUnit.AgeSuffixList; + this.prefixList = new Map(); + this.ambiguousUnitList = chineseNumericWithUnit.ChineseNumericWithUnit.AgeAmbiguousValues; + } +} +exports.ChineseAgeExtractorConfiguration = ChineseAgeExtractorConfiguration; +class ChineseAgeParserConfiguration extends base$6.ChineseNumberWithUnitParserConfiguration { + constructor(ci) { + if (!ci) { + ci = new recognizersTextNumber.CultureInfo(recognizersTextNumber.Culture.Chinese); + } + super(ci); + this.BindDictionary(chineseNumericWithUnit.ChineseNumericWithUnit.AgeSuffixList); + } +} +exports.ChineseAgeParserConfiguration = ChineseAgeParserConfiguration; + +}); + +unwrapExports(age$6); + +var japaneseNumericWithUnit = createCommonjsModule(function (module, exports) { +"use strict"; +// ------------------------------------------------------------------------------ +// +// This code was generated by a tool. +// Changes to this file may cause incorrect behavior and will be lost if +// the code is regenerated. +// +// ------------------------------------------------------------------------------ +Object.defineProperty(exports, "__esModule", { value: true }); +var JapaneseNumericWithUnit; +(function (JapaneseNumericWithUnit) { + JapaneseNumericWithUnit.AgeAmbiguousValues = ['歳']; + JapaneseNumericWithUnit.AgeSuffixList = new Map([["Year", "歳"], ["Month", "ヶ月"], ["Week", "週間|週"], ["Day", "日間|日齢|日大"]]); + JapaneseNumericWithUnit.BuildPrefix = ''; + JapaneseNumericWithUnit.BuildSuffix = ''; + JapaneseNumericWithUnit.ConnectorToken = ''; + JapaneseNumericWithUnit.CurrencySuffixList = new Map([["Afghan afghani", "アフガニ"], ["Pul", "プル"], ["Euro", "ユーロ"], ["Cent", "セント"], ["Albanian lek", "アルバニアレク|アルバニア・レク|レク"], ["Angolan kwanza", "アンゴラクワンザ|アンゴラ・クワンザ|クワンザ"], ["Armenian dram", "アルメニアドラム|アルメニア・ドラム|ドラム"], ["Aruban florin", "アルバ・フロリン|フロリン"], ["Bangladeshi taka", "タカ|バングラデシュ・タカ"], ["Paisa", "パイサ"], ["Bhutanese ngultrum", "ニュルタム|ブータン・ニュルタム|ブータンニュルタム"], ["Chetrum", "チェルタム"], ["Bolivian boliviano", "ボリビアーノ"], ["Bosnia and Herzegovina convertible mark", "兌換マルク"], ["Botswana pula", "ボツワナ・プラ|ボツワナプラ|プラ"], ["Thebe", "テベ"], ["Brazilian real", "ブラジル・レアル|ブラジルレアル|レアル"], ["Bulgarian lev", "ブルガリア・レフ|ブルガリアレフ|レフ"], ["Stotinka", "ストティンカ"], ["Cambodian riel", "カンボジア・リエル|カンボジアリエル|リエル"], ["Cape Verdean escudo", "カーボベルデ・エスクード"], ["Croatian kuna", "クロアチアクーナ|クロアチア・クーナ|クーナ"], ["Lipa", "リパ"], ["Eritrean nakfa", "エリトリア・ナクファ|エリトリアナクファ|ナクファ"], ["Ethiopian birr", "エチオピア・ブル|エチオピアブル|ブル"], ["Gambian dalasi", "ガンビア・ダラシ|ガンビアダラシ|ダラシ"], ["Butut", "ブトゥツ"], ["Georgian lari", "ジョージア・ラリ|ジョージアラリ|ラリ"], ["Tetri", "テトリ"], ["Ghanaian cedi", "ガーナ・セディ|ガーナセディ|セディ"], ["Pesewa", "ペセワ"], ["Guatemalan quetzal", "グアテマラ・ケツァル|グアテマラケツァル|ケツァル"], ["Haitian gourde", "ハイチ・グールド|ハイチグールド|グールド"], ["Honduran lempira", "ホンジュラス・レンピラ|ホンジュラスレンピラ|レンピラ"], ["Hungarian forint", "ハンガリー・フォリント|ハンガリーフォリント|フォリント"], ["Iranian rial", "イラン・リアル"], ["Yemeni rial", "イエメン・リアル"], ["Israeli new shekel", "₪|ils|イスラエル・新シェケル|イスラエル新シェケル"], ["Japanese yen", "円"], ["Sen", "銭"], ["Kazakhstani tenge", "テンゲ|カザフスタン・テンゲ|カザフスタンテンゲ"], ["Kenyan shilling", "ケニア・シリング"], ["North Korean won", "北朝鮮ウォン"], ["South Korean won", "韓国ウォン"], ["Korean won", "₩"], ["Kyrgyzstani som", "キルギス・ソム|ソム"], ["Lao kip", "キップ|ラオス・キップ|ラオスキップ"], ["Att", "att"], ["Lesotho loti", "ロチ|レソト・ロチ|レソトロチ"], ["South African rand", "ランド|南アフリカ・ランド|南アフリカランド"], ["Macedonian denar", "マケドニア・デナール"], ["Deni", "デニ"], ["Malagasy ariary", "アリアリ|マダガスカル・アリアリ|マダガスカルアリアリ"], ["Iraimbilanja", "イライムビランジャ"], ["Malawian kwacha", "マラウイ・クワチャ"], ["Tambala", "タンバラ"], ["Malaysian ringgit", "リンギット|マレーシア・リンギット"], ["Mauritanian ouguiya", "ウギア|モーリタニア・ウギア|モーリタニアウギア"], ["Khoums", "コウム"], ["Mozambican metical", "メティカル|モザンビーク・メティカル|モザンビークメティカル"], ["Burmese kyat", "チャット|ミャンマー・チャット|ミャンマーチャット"], ["Pya", "ピャー"], ["Nigerian naira", "ナイラ|ナイジェリア・ナイラ|ナイジェリアナイラ"], ["Kobo", "コボ"], ["Turkish lira", "トルコリラ"], ["Kuruş", "クルシュ"], ["Omani rial", "オマーン・リアル"], ["Panamanian balboa", "バルボア|パナマ・バルボア|パナマバルボア"], ["Centesimo", "センテシモ"], ["Papua New Guinean kina", "キナ|パプア・ニューギニア・キナ"], ["Toea", "トエア"], ["Peruvian sol", "ヌエボ・ソル"], ["Polish złoty", "ズウォティ|ポーランド・ズウォティ|ポーランドズウォティ"], ["Grosz", "グロシュ"], ["Qatari riyal", "カタール・リヤル"], ["Saudi riyal", "サウジアラビア・リヤル"], ["Riyal", "リヤル"], ["Dirham", "ディルハム"], ["Halala", "ハララ"], ["Samoan tālā", "タラ|サモア・タラ|サモアタラ"], ["Sierra Leonean leone", "レオン|シエラレオネ・レオン|シエラレオネレオン"], ["Peseta", "ユーロ"], ["Swazi lilangeni", "リランゲニ|スワジランド・リランゲニ|スワジランドリランゲニ"], ["Tajikistani somoni", "ソモニ|タジキスタン・ソモニ|タジキスタンソモニ"], ["Thai baht", "バーツ|タイ・バーツ|タイバーツ"], ["Satang", "サタン"], ["Tongan paʻanga", "パアンガ|トンガ・パアンガ|トンガパアンガ"], ["Ukrainian hryvnia", "フリヴニャ|ウクライナ・フリヴニャ|ウクライナフリヴニャ"], ["Vanuatu vatu", "バツ|バヌアツ・バツ|バヌアツバツ"], ["Vietnamese dong", "ドン|ベトナム・ドン|ベトナムドン"], ["Indonesian rupiah", "ルピア|インドネシア・ルピア|インドネシアルピア"], ["Netherlands guilder", "ユーロ|オランダ・ユーロ"], ["Surinam florin", "スリナム・ドル"], ["Zambian kwacha", "ザンビア・クワチャ"], ["Moroccan dirham", "モロッコ・ディルハム"], ["United Arab Emirates dirham", "UAEディルハム"], ["Azerbaijani manat", "アゼルバイジャン・マナト"], ["Turkmenistan manat", "トルクメニスタン・マナト"], ["Manat", "マナト"], ["Somali shilling", "ソマリア・シリング"], ["Somaliland shilling", "ソマリランド・シリング"], ["Tanzanian shilling", "タンザニア・シリング"], ["Ugandan shilling", "ウガンダ・シリング"], ["Romanian leu", "ルーマニア・レウ"], ["Moldovan leu", "モルドバ・レウ"], ["Leu", "レウ"], ["Ban", "バン"], ["Nepalese rupee", "ネパール・ルピー"], ["Pakistani rupee", "パキスタン・ルピー"], ["Indian rupee", "インド・ルピー"], ["Seychellois rupee", "セーシェル・ルピー"], ["Mauritian rupee", "モーリシャス・ルピー"], ["Maldivian rufiyaa", "ルフィヤ|モルディブ・ルフィヤ|モルディブルフィヤ"], ["Sri Lankan rupee", "スリランカ・ルピー"], ["Rupee", "ルピー"], ["Czech koruna", "チェコ・コルナ"], ["Danish krone", "デンマーク・クローネ"], ["Norwegian krone", "ノルウェー・クローネ"], ["Faroese króna", "フェロー・クローネ"], ["Icelandic króna", "アイスランド・クローナ"], ["Swedish krona", "スウェーデン・クローナ"], ["Krone", "クローナ"], ["Øre", "オーレ"], ["West African CFA franc", "CFAフラン"], ["Central African CFA franc", "CFAフラン"], ["Comorian franc", "コモロ・フラン"], ["Congolese franc", "コンゴ・フラン"], ["Burundian franc", "ブルンジ・フラン"], ["Djiboutian franc", "ジブチ・フラン"], ["CFP franc", "CFPフラン"], ["Guinean franc", "ギニア・フラン"], ["Swiss franc", "スイス・フラン"], ["Rwandan franc", "ルワンダ・フラン"], ["Belgian franc", "ベルギー・フラン"], ["Rappen", "Rappen"], ["Franc", "フラン"], ["Centime", "サンチーム"], ["Russian ruble", "ロシア・ルーブル"], ["Transnistrian ruble", "沿ドニエストル・ルーブル"], ["Belarusian ruble", "ベラルーシ・ルーブル"], ["Kopek", "カペイカ"], ["Ruble", "ルーブル"], ["Algerian dinar", "アルジェリア・ディナール"], ["Bahraini dinar", "バーレーン・ディナール"], ["Iraqi dinar", "イラク・ディナール"], ["Jordanian dinar", "ヨルダン・ディナール"], ["Kuwaiti dinar", "クウェート・ディナール"], ["Libyan dinar", "リビア・ディナール"], ["Serbian dinar", "セルビア・ディナール"], ["Tunisian dinar", "チュニジア・ディナール"], ["Dinar", "ディナール"], ["Fils", "フィルス"], ["Para", "パラ"], ["Millime", "ミリム"], ["Argentine peso", "ペソ|アルゼンチン・ペソ"], ["Chilean peso", "チリ・ペソ"], ["Colombian peso", "コロンビア・ペソ"], ["Cuban peso", "兌換ペソ"], ["Dominican peso", "ドミニカ・ペソ"], ["Mexican peso", "メキシコ・ペソ"], ["Philippine peso", "フィリピン・ペソ"], ["Uruguayan peso", "ウルグアイ・ペソ"], ["Peso", "ペソ"], ["Centavo", "センターボ"], ["Alderney pound", "ガーンジー・ポンド"], ["British pound", "UKポンド"], ["Guernsey pound", "ガーンジー・ポンド"], ["Saint Helena pound", "セントヘレナ・ポンド"], ["Egyptian pound", "エジプト・ポンド"], ["Falkland Islands pound", "フォークランド諸島ポンド"], ["Gibraltar pound", "ジブラルタル・ポンド"], ["Manx pound", "マン島ポンド"], ["Jersey pound", "ジャージー・ポンド"], ["Lebanese pound", "レバノン・ポンド"], ["South Sudanese pound", "南スーダン・ポンド"], ["Sudanese pound", "スーダン・ポンド"], ["Syrian pound", "シリア・ポンド"], ["Pound", "ポンド"], ["Pence", "ペニー"], ["Shilling", "シリング"], ["United States dollar", "ドル|USドル"], ["East Caribbean dollar", "東カリブ・ドル"], ["Australian dollar", "オーストラリア・ドル"], ["Bahamian dollar", "バハマ・ドル"], ["Barbadian dollar", "バルバドス・ドル"], ["Belize dollar", "ベリーズ・ドル"], ["Bermudian dollar", "バミューダ・ドル"], ["Brunei dollar", "ブルネイ・ドル"], ["Singapore dollar", "シンガポール・ドル"], ["Canadian dollar", "カナダ・ドル"], ["Cayman Islands dollar", "ケイマン諸島・ドル"], ["New Zealand dollar", "ニュージーランド・ドル"], ["Cook Islands dollar", "ニュージーランド・ドル|ニュージーランド・ドル"], ["Fijian dollar", "フィジー・ドル|フィジー・ドル"], ["Guyanese dollar", "ガイアナ・ドル|ガイアナ・ドル"], ["Hong Kong dollar", "香港ドル"], ["Macau Pataca", "マカオ・パタカ|マカオ・パタカ"], ["New Taiwan dollar", "ニュー台湾ドル|ニュー台湾ドル"], ["Jamaican dollar", "ジャマイカ・ドル|ジャマイカドル"], ["Kiribati dollar", "オーストラリア・ドル|オーストラリアドル"], ["Liberian dollar", "リベリア・ドル|リベリアドル"], ["Namibian dollar", "ナミビア・ドル|ナミビアドル"], ["Surinamese dollar", "スリナム・ドル|スリナムドル"], ["Trinidad and Tobago dollar", "トリニダード・トバゴ・ドル|トリニダードトバゴ・ドル"], ["Tuvaluan dollar", "ツバル・ドル|ツバルドル"], ["Chinese yuan", "人民元"], ["Fen", "分"], ["Jiao", "角"], ["Finnish markka", "フィンランド・マルカ"], ["Penni", "ペニー"]]); + JapaneseNumericWithUnit.CurrencyNameToIsoCodeMap = new Map([["Afghan afghani", "AFN"], ["Euro", "EUR"], ["Albanian lek", "ALL"], ["Angolan kwanza", "AOA"], ["Armenian dram", "AMD"], ["Aruban florin", "AWG"], ["Bangladeshi taka", "BDT"], ["Bhutanese ngultrum", "BTN"], ["Bolivian boliviano", "BOB"], ["Bosnia and Herzegovina convertible mark", "BAM"], ["Botswana pula", "BWP"], ["Brazilian real", "BRL"], ["Bulgarian lev", "BGN"], ["Cambodian riel", "KHR"], ["Cape Verdean escudo", "CVE"], ["Costa Rican colón", "CRC"], ["Croatian kuna", "HRK"], ["Czech koruna", "CZK"], ["Eritrean nakfa", "ERN"], ["Ethiopian birr", "ETB"], ["Gambian dalasi", "GMD"], ["Georgian lari", "GEL"], ["Ghanaian cedi", "GHS"], ["Guatemalan quetzal", "GTQ"], ["Haitian gourde", "HTG"], ["Honduran lempira", "HNL"], ["Hungarian forint", "HUF"], ["Iranian rial", "IRR"], ["Yemeni rial", "YER"], ["Israeli new shekel", "ILS"], ["Japanese yen", "JPY"], ["Kazakhstani tenge", "KZT"], ["Kenyan shilling", "KES"], ["North Korean won", "KPW"], ["South Korean won", "KRW"], ["Kyrgyzstani som", "KGS"], ["Lao kip", "LAK"], ["Lesotho loti", "LSL"], ["South African rand", "ZAR"], ["Macanese pataca", "MOP"], ["Macedonian denar", "MKD"], ["Malagasy ariary", "MGA"], ["Malawian kwacha", "MWK"], ["Malaysian ringgit", "MYR"], ["Mauritanian ouguiya", "MRO"], ["Mongolian tögrög", "MNT"], ["Mozambican metical", "MZN"], ["Burmese kyat", "MMK"], ["Nicaraguan córdoba", "NIO"], ["Nigerian naira", "NGN"], ["Turkish lira", "TRY"], ["Omani rial", "OMR"], ["Panamanian balboa", "PAB"], ["Papua New Guinean kina", "PGK"], ["Paraguayan guaraní", "PYG"], ["Peruvian sol", "PEN"], ["Polish złoty", "PLN"], ["Qatari riyal", "QAR"], ["Saudi riyal", "SAR"], ["Samoan tālā", "WST"], ["São Tomé and Príncipe dobra", "STD"], ["Sierra Leonean leone", "SLL"], ["Swazi lilangeni", "SZL"], ["Tajikistani somoni", "TJS"], ["Thai baht", "THB"], ["Ukrainian hryvnia", "UAH"], ["Vanuatu vatu", "VUV"], ["Venezuelan bolívar", "VEF"], ["Zambian kwacha", "ZMW"], ["Moroccan dirham", "MAD"], ["United Arab Emirates dirham", "AED"], ["Azerbaijani manat", "AZN"], ["Turkmenistan manat", "TMT"], ["Somali shilling", "SOS"], ["Tanzanian shilling", "TZS"], ["Ugandan shilling", "UGX"], ["Romanian leu", "RON"], ["Moldovan leu", "MDL"], ["Nepalese rupee", "NPR"], ["Pakistani rupee", "PKR"], ["Indian rupee", "INR"], ["Seychellois rupee", "SCR"], ["Mauritian rupee", "MUR"], ["Maldivian rufiyaa", "MVR"], ["Sri Lankan rupee", "LKR"], ["Indonesian rupiah", "IDR"], ["Danish krone", "DKK"], ["Norwegian krone", "NOK"], ["Icelandic króna", "ISK"], ["Swedish krona", "SEK"], ["West African CFA franc", "XOF"], ["Central African CFA franc", "XAF"], ["Comorian franc", "KMF"], ["Congolese franc", "CDF"], ["Burundian franc", "BIF"], ["Djiboutian franc", "DJF"], ["CFP franc", "XPF"], ["Guinean franc", "GNF"], ["Swiss franc", "CHF"], ["Rwandan franc", "RWF"], ["Russian ruble", "RUB"], ["Transnistrian ruble", "PRB"], ["Belarusian ruble", "BYN"], ["Algerian dinar", "DZD"], ["Bahraini dinar", "BHD"], ["Iraqi dinar", "IQD"], ["Jordanian dinar", "JOD"], ["Kuwaiti dinar", "KWD"], ["Libyan dinar", "LYD"], ["Serbian dinar", "RSD"], ["Tunisian dinar", "TND"], ["Argentine peso", "ARS"], ["Chilean peso", "CLP"], ["Colombian peso", "COP"], ["Cuban convertible peso", "CUC"], ["Cuban peso", "CUP"], ["Dominican peso", "DOP"], ["Mexican peso", "MXN"], ["Uruguayan peso", "UYU"], ["British pound", "GBP"], ["Saint Helena pound", "SHP"], ["Egyptian pound", "EGP"], ["Falkland Islands pound", "FKP"], ["Gibraltar pound", "GIP"], ["Manx pound", "IMP"], ["Jersey pound", "JEP"], ["Lebanese pound", "LBP"], ["South Sudanese pound", "SSP"], ["Sudanese pound", "SDG"], ["Syrian pound", "SYP"], ["United States dollar", "USD"], ["Australian dollar", "AUD"], ["Bahamian dollar", "BSD"], ["Barbadian dollar", "BBD"], ["Belize dollar", "BZD"], ["Bermudian dollar", "BMD"], ["Brunei dollar", "BND"], ["Singapore dollar", "SGD"], ["Canadian dollar", "CAD"], ["Cayman Islands dollar", "KYD"], ["New Zealand dollar", "NZD"], ["Fijian dollar", "FJD"], ["Guyanese dollar", "GYD"], ["Hong Kong dollar", "HKD"], ["Jamaican dollar", "JMD"], ["Liberian dollar", "LRD"], ["Namibian dollar", "NAD"], ["Solomon Islands dollar", "SBD"], ["Surinamese dollar", "SRD"], ["New Taiwan dollar", "TWD"], ["Trinidad and Tobago dollar", "TTD"], ["Tuvaluan dollar", "TVD"], ["Chinese yuan", "CNY"], ["Rial", "__RI"], ["Shiling", "__S"], ["Som", "__SO"], ["Dirham", "__DR"], ["Dinar", "_DN"], ["Dollar", "__D"], ["Manat", "__MA"], ["Rupee", "__R"], ["Krone", "__K"], ["Krona", "__K"], ["Crown", "__K"], ["Frank", "__F"], ["Mark", "__M"], ["Ruble", "__RB"], ["Peso", "__PE"], ["Pound", "__P"], ["Tristan da Cunha pound", "_TP"], ["South Georgia and the South Sandwich Islands pound", "_SP"], ["Somaliland shilling", "_SS"], ["Pitcairn Islands dollar", "_PND"], ["Palauan dollar", "_PD"], ["Niue dollar", "_NID"], ["Nauruan dollar", "_ND"], ["Micronesian dollar", "_MD"], ["Kiribati dollar", "_KID"], ["Guernsey pound", "_GGP"], ["Faroese króna", "_FOK"], ["Cook Islands dollar", "_CKD"], ["British Virgin Islands dollar", "_BD"], ["Ascension pound", "_AP"], ["Alderney pound", "_ALP"], ["Abkhazian apsar", "_AA"]]); + JapaneseNumericWithUnit.FractionalUnitNameToCodeMap = new Map([["Jiao", "JIAO"], ["Kopek", "KOPEK"], ["Pul", "PUL"], ["Cent", "CENT"], ["Qindarkë", "QINDARKE"], ["Penny", "PENNY"], ["Santeem", "SANTEEM"], ["Cêntimo", "CENTIMO"], ["Centavo", "CENTAVO"], ["Luma", "LUMA"], ["Qəpik", "QƏPIK"], ["Fils", "FILS"], ["Poisha", "POISHA"], ["Kapyeyka", "KAPYEYKA"], ["Centime", "CENTIME"], ["Chetrum", "CHETRUM"], ["Paisa", "PAISA"], ["Fening", "FENING"], ["Thebe", "THEBE"], ["Sen", "SEN"], ["Stotinka", "STOTINKA"], ["Fen", "FEN"], ["Céntimo", "CENTIMO"], ["Lipa", "LIPA"], ["Haléř", "HALER"], ["Øre", "ØRE"], ["Piastre", "PIASTRE"], ["Santim", "SANTIM"], ["Oyra", "OYRA"], ["Butut", "BUTUT"], ["Tetri", "TETRI"], ["Pesewa", "PESEWA"], ["Fillér", "FILLER"], ["Eyrir", "EYRIR"], ["Dinar", "DINAR"], ["Agora", "AGORA"], ["Tïın", "TIIN"], ["Chon", "CHON"], ["Jeon", "JEON"], ["Tyiyn", "TYIYN"], ["Att", "ATT"], ["Sente", "SENTE"], ["Dirham", "DIRHAM"], ["Rappen", "RAPPEN"], ["Avo", "AVO"], ["Deni", "DENI"], ["Iraimbilanja", "IRAIMBILANJA"], ["Tambala", "TAMBALA"], ["Laari", "LAARI"], ["Khoums", "KHOUMS"], ["Ban", "BAN"], ["Möngö", "MONGO"], ["Pya", "PYA"], ["Kobo", "KOBO"], ["Kuruş", "KURUS"], ["Baisa", "BAISA"], ["Centésimo", "CENTESIMO"], ["Toea", "TOEA"], ["Sentimo", "SENTIMO"], ["Grosz", "GROSZ"], ["Sene", "SENE"], ["Halala", "HALALA"], ["Para", "PARA"], ["Öre", "ORE"], ["Diram", "DIRAM"], ["Satang", "SATANG"], ["Seniti", "SENITI"], ["Millime", "MILLIME"], ["Tennesi", "TENNESI"], ["Kopiyka", "KOPIYKA"], ["Tiyin", "TIYIN"], ["Hào", "HAO"], ["Ngwee", "NGWEE"]]); + JapaneseNumericWithUnit.CompoundUnitConnectorRegex = `(?と)`; + JapaneseNumericWithUnit.CurrencyPrefixList = new Map([["Dollar", "$"], ["United States dollar", "us$"], ["British Virgin Islands dollar", "bvi$"], ["Brunei dollar", "b$"], ["Sen", "sen"], ["Singapore dollar", "s$"], ["Canadian dollar", "can$|c$|c $"], ["Cayman Islands dollar", "ci$"], ["New Zealand dollar", "nz$|nz $"], ["Guyanese dollar", "gy$|gy $|g$|g $"], ["Hong Kong dollar", "hk$|hkd|hk $"], ["Jamaican dollar", "j$"], ["Namibian dollar", "nad|n$|n $"], ["Solomon Islands dollar", "si$|si $"], ["New Taiwan dollar", "nt$|nt $"], ["Samoan tālā", "ws$"], ["Chinese yuan", "¥"], ["Japanese yen", "¥|\\"], ["Turkish lira", "₺"], ["Euro", "€"], ["Pound", "£"], ["Costa Rican colón", "₡"]]); + JapaneseNumericWithUnit.CurrencyAmbiguousValues = ['円', '銭', '\\']; +})(JapaneseNumericWithUnit = exports.JapaneseNumericWithUnit || (exports.JapaneseNumericWithUnit = {})); + +}); + +unwrapExports(japaneseNumericWithUnit); + +var base$8 = createCommonjsModule(function (module, exports) { +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); + + + + + +class JapaneseNumberWithUnitExtractorConfiguration { + constructor(ci) { + this.cultureInfo = ci; + this.unitNumExtractor = new recognizersTextNumber.JapaneseNumberExtractor(recognizersTextNumber.JapaneseNumberExtractorMode.ExtractAll); + this.buildPrefix = japaneseNumericWithUnit.JapaneseNumericWithUnit.BuildPrefix; + this.buildSuffix = japaneseNumericWithUnit.JapaneseNumericWithUnit.BuildSuffix; + this.connectorToken = japaneseNumericWithUnit.JapaneseNumericWithUnit.ConnectorToken; + this.compoundUnitConnectorRegex = recognizersText.RegExpUtility.getSafeRegExp(japaneseNumericWithUnit.JapaneseNumericWithUnit.CompoundUnitConnectorRegex); + this.pmNonUnitRegex = recognizersText.RegExpUtility.getSafeRegExp(baseUnits.BaseUnits.PmNonUnitRegex); + } +} +exports.JapaneseNumberWithUnitExtractorConfiguration = JapaneseNumberWithUnitExtractorConfiguration; +class JapaneseNumberWithUnitParserConfiguration extends parsers$4.BaseNumberWithUnitParserConfiguration { + constructor(ci) { + super(ci); + this.internalNumberExtractor = new recognizersTextNumber.JapaneseNumberExtractor(recognizersTextNumber.JapaneseNumberExtractorMode.Default); + this.internalNumberParser = recognizersTextNumber.AgnosticNumberParserFactory.getParser(recognizersTextNumber.AgnosticNumberParserType.Number, new recognizersTextNumber.JapaneseNumberParserConfiguration()); + this.connectorToken = ''; + this.currencyNameToIsoCodeMap = japaneseNumericWithUnit.JapaneseNumericWithUnit.CurrencyNameToIsoCodeMap; + this.currencyFractionCodeList = japaneseNumericWithUnit.JapaneseNumericWithUnit.FractionalUnitNameToCodeMap; + } +} +exports.JapaneseNumberWithUnitParserConfiguration = JapaneseNumberWithUnitParserConfiguration; + +}); + +unwrapExports(base$8); + +var currency$8 = createCommonjsModule(function (module, exports) { +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); + + + + +class JapaneseCurrencyExtractorConfiguration extends base$8.JapaneseNumberWithUnitExtractorConfiguration { + constructor(ci) { + if (!ci) { + ci = new recognizersTextNumber.CultureInfo(recognizersTextNumber.Culture.Japanese); + } + super(ci); + this.extractType = constants$2.Constants.SYS_UNIT_CURRENCY; + // Reference Source: https:// en.wikipedia.org/wiki/List_of_circulating_currencies + this.suffixList = japaneseNumericWithUnit.JapaneseNumericWithUnit.CurrencySuffixList; + this.prefixList = japaneseNumericWithUnit.JapaneseNumericWithUnit.CurrencyPrefixList; + this.ambiguousUnitList = japaneseNumericWithUnit.JapaneseNumericWithUnit.CurrencyAmbiguousValues; + + } +} +exports.JapaneseCurrencyExtractorConfiguration = JapaneseCurrencyExtractorConfiguration; +class JapaneseCurrencyParserConfiguration extends base$8.JapaneseNumberWithUnitParserConfiguration { + constructor(ci) { + if (!ci) { + ci = new recognizersTextNumber.CultureInfo(recognizersTextNumber.Culture.Japanese); + } + super(ci); + this.BindDictionary(japaneseNumericWithUnit.JapaneseNumericWithUnit.CurrencySuffixList); + this.BindDictionary(japaneseNumericWithUnit.JapaneseNumericWithUnit.CurrencyPrefixList); + } +} +exports.JapaneseCurrencyParserConfiguration = JapaneseCurrencyParserConfiguration; + +}); + +unwrapExports(currency$8); + +var age$8 = createCommonjsModule(function (module, exports) { +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); + + + + +class JapaneseAgeExtractorConfiguration extends base$8.JapaneseNumberWithUnitExtractorConfiguration { + constructor(ci) { + if (!ci) { + ci = new recognizersTextNumber.CultureInfo(recognizersTextNumber.Culture.Japanese); + } + super(ci); + this.extractType = constants$2.Constants.SYS_UNIT_AGE; + this.suffixList = japaneseNumericWithUnit.JapaneseNumericWithUnit.AgeSuffixList; + this.prefixList = new Map(); + this.ambiguousUnitList = japaneseNumericWithUnit.JapaneseNumericWithUnit.AgeAmbiguousValues; + } +} +exports.JapaneseAgeExtractorConfiguration = JapaneseAgeExtractorConfiguration; +class JapaneseAgeParserConfiguration extends base$8.JapaneseNumberWithUnitParserConfiguration { + constructor(ci) { + if (!ci) { + ci = new recognizersTextNumber.CultureInfo(recognizersTextNumber.Culture.Japanese); + } + super(ci); + this.BindDictionary(japaneseNumericWithUnit.JapaneseNumericWithUnit.AgeSuffixList); + } +} +exports.JapaneseAgeParserConfiguration = JapaneseAgeParserConfiguration; + +}); + +unwrapExports(age$8); + +var frenchNumericWithUnit = createCommonjsModule(function (module, exports) { +"use strict"; +// ------------------------------------------------------------------------------ +// +// This code was generated by a tool. +// Changes to this file may cause incorrect behavior and will be lost if +// the code is regenerated. +// +// ------------------------------------------------------------------------------ +Object.defineProperty(exports, "__esModule", { value: true }); +var FrenchNumericWithUnit; +(function (FrenchNumericWithUnit) { + FrenchNumericWithUnit.AgeSuffixList = new Map([["Ans", "ans"], ["Mois", "mois d'âge|mois d'age|mois"], ["Semaines", "semaine|semaines|semaines d'âge|semaines d'age"], ["Jour", "jours|jour"]]); + FrenchNumericWithUnit.AreaSuffixList = new Map([["Kilomètre carré", "km2|km^2|km²|kilomètres carrés|kilomètre carré"], ["Hectomètre carré", "hm2|hm^2|hm²|hectomètre carré|hectomètres carrés"], ["Décamètre carré", "dam2|dam^2|dam²|décamètre carré|décamètres carrés"], ["Mètre carré", "m2|m^2|m²|mètre carré|mètres carrés"], ["Décimètre carré", "dm2|dm^2|dm²|décimètre carré|décimètres carrés"], ["Centimètre carré", "cm2|cm^2|cm²|centimètre carré|centimètres carrés"], ["Millimètre carré", "mm2|mm^2|mm²|millimètre carré|millimètres carrés"], ["Pouce carré", "pouces2|po2|pouce carré|pouces carrés|in^2|in²|in2"], ["Pied carré", "pied carré|pieds carrés|pi2|pi^2|pi²"], ["Mile carré", "mile carré|miles carrés|mi2|mi^2|mi²"], ["Acre", "acre|acres"]]); + FrenchNumericWithUnit.CurrencySuffixList = new Map([["Abkhazie apsar", "abkhazie apsar|apsars"], ["Afghan afghani", "afghan afghani|؋|afn|afghanis|afghani"], ["Pul", "pul"], ["Euro", "euros|euro|€|eur|d'euros"], ["Cent", "cents|cent|-cents|-cent|sen"], ["lek Albanais", "lek albanais|leks|lek"], ["Qindarkë", "qindarkë|qindarkës|qindarke|qindarkes"], ["Kwanza angolais", "kwanza angolais|kz|aoa|kwanza|kwanzas"], ["Dram arménien", "dram arménien|drams arméniens"], ["Florins d'Aruba", "florins aruba|ƒ|awg"], ["Bangladeshi taka", "bangladeshi taka|৳|bdt|taka|takas|bangladeshi takas"], ["Paisa", "poisha|paisa"], ["Ngultrum bhoutanais", "ngultrum bhoutanais|nu.|btn"], ["Chetrum", "chetrums|chetrum"], ["Boliviano bolivien", "boliviano bolivien|bolivianos bolivien|bolivianos bolivie|boliviano bolivie|bob|bs."], ["Bosnie-Herzégovine mark convertible", "bosnie-herzégovine mark convertible|bosnie-et-herzégovine mark convertible|bam"], ["Fening", "fening|fenings"], ["Pula", "pula|bwp"], ["Thebe", "thebe"], ["Réal brésilien", "réal brésilien|réals brésilien|r$|brl|real bresil|reals bresilien"], ["Lev bulgare", "lev bulgare|levs bulgare|lv|bgn"], ["Stotinki búlgaro", "stotinki bulgare"], ["Riel cambodgien", "riel cambodgien|khr|៛"], ["Escudo du cap-vert", "escudo cap-verdien|cve"], ["Colon du costa rica", "colon du costa rica|colons du costa rica|crc|₡"], ["Colon du salvador", "colon du salvador|colons du salvador|svc"], ["Kuna croate", "kuna croate|kunas croate|kn|hrk"], ["Lipa", "lipa"], ["Couronne tchèque", "couronne tchèque|couronnes tchèque|czk|Kč"], ["Haléř", "haléř"], ["Nakfas érythréens", "nakfas érythréens|nfk|ern|nakfa érythréens"], ["Birr éthiopien", "birr éthiopien|birrs éthiopien|etb"], ["Dalasi gambienne", "gmd"], ["Butut", "bututs|butut"], ["Lari géorgien", "lari géorgie|lari géorgiens|gel|₾"], ["Tetri géorgien", "tetri géorgie|tetris géorgiens"], ["Cedi", "cedi|ghs|cedi ghanéen|gh₵"], ["Pesewa", "pesewa|pesewas"], ["Quetzal guatémaltèque", "quetzal guatémaltèque|gtq|quetzal|quetzales"], ["Gourdes haïtiennes", "gourdes haïtiennes|gourdes|htg|gourde haïtienne"], ["Lempira hondurien", "lempira hondurien|hnl"], ["Forint hongrois", "forint hongrois|huf|fg|forints hongrois"], ["Fillér", "fillér"], ["Rial iranien", "rial iranien|irr|rials iranien|rials iraniens"], ["Litas lituanien", "litas lituanien|ltl|lit lithuanien|litas lithuanie"], ["Yen Japonais", "yen japonais|yen japon|yens|jpy|yen|¥|-yen"], ["Tenge kazakh", "tenge kazakh|kzt"], ["Shilling kényan", "shilling kényan|sh|kes|shillings kényans"], ["Won coréen", "won coréen|won coréens|₩"], ["Won sud-coréen", "won sud-coréen|won sud coréen|won sud-coréens|krw"], ["Corée du nord won", "corée du nord won|corée nord won|kpw"], ["Som Kirghizie", "som kirghizie|kgs"], ["Sum Ouzbékistan", "sum ouzbékistan|sum ouzbeks|sum ouzbéks|uzs"], ["Kip laotien", "kip laotien|lak|₭n|₭"], ["Att", "att"], ["Loti", "loti|maloti|lsl"], ["Sente", "sente|lisente"], ["Rand sud-africain", "rand sud-africain|zar"], ["Pataca macanais", "pataca macanais|mop$|mop"], ["Avo", "avos|avo"], ["Dinar macédonien", "dinar macédonien|mkd|ден"], ["Deni", "deni"], ["Ariary malagache", "ariary malagache|mga"], ["Iraimbilanja", "Iraimbilanja"], ["Kwacha malawien", "kwacha malawien|mk|mwk"], ["Tambala", "Tambala"], ["Ringitt malaisien", "ringitt malaisien|rm|myr|ringitts malaisien"], ["Ouguiya mauritanienne", "ouguiya|um|mro|ouguiya mauritanien|ouguiya mauritanienne"], ["Khoums", "khoums"], ["Togrogs mongoles", "togrogs mongoles|togrogs|tugriks|tögrög|mnt|₮|tögrög mongoles|tögrög mongolie|togrogs mongolie"], ["Metical mozambique", "metical du mozambique|metical mozambique|mt|mzn|meticals mozambique"], ["Kyat birmanie", "kyat birmanie|ks|mmk"], ["Pya", "pya"], ["Cordoba nicaraguayen", "cordoba nicaraguayen|córdoba nicaraguayen|nio|córdoba oro|cordoba oro nicaraguayen"], ["Naira nigérians", "naira nigérians|naira|ngm|₦|nairas nigérians"], ["Livre turque", "livre turque|try|tl|livre turques"], ["Kuruş", "kuruş"], ["Rials omanais", "rials omanais|omr|ر.ع.|rial omanais"], ["Balboa panaméennes", "balboa panaméennes|balboa|pab"], ["Kina", "kina|pkg|pgk"], ["Toea", "toea"], ["Guaraní paraguayen", "guaraní paraguayen|₲|pyg"], ["Sol péruvien", "nuevo sol péruvien|soles|sol|sol péruvien"], ["Złoty polonais", "złoty polonais|złoty|zł|pln|zloty|zloty polonais"], ["Groxz", "groszy|grosz|grosze"], ["Riyal qatari", "riyal qatari|qar|riyals qatari"], ["Riyal saudi", "riyal saudi|sar|riyals saudi"], ["Riyal", "riyal|riyals|rial|﷼"], ["Dirham", "dirham|dirhem|dirhm"], ["Halala", "halalas|halala"], ["Tala", "tala|tālā|ws$|sat|wst"], ["Sene", "sene"], ["Dobra", "dobra|db|std"], ["Leone", "leone|sll"], ["Florins Néerlandais", "florins hollandais|florins néerlandais|florins|ang|ƒ|florin|fl |"], ["Lilangeni", "lilangeni|szl"], ["Somoni tadjikistan", "somoni tadjikistan|tjs|somoni"], ["Diram", "dirams|diram"], ["Baht thaïlandais", "baht thaïlandais|baht thailandais|baht thaï|baht thai|baht|฿|thb"], ["Satang", "satang|satangs"], ["Paʻanga", "paʻanga|pa'anga|top"], ["Hryvnia ukrainien", "hryvnia ukrainien|hyrvnia|uah|₴|hryvnias ukrainien|hryvnia ukrainienne"], ["Vanuatu vatu", "vanuatu vatu|vatu|vuv"], ["Bolívar vénézuélien", "bolívar vénézuélien|bolivar venezuelien|bs.f.|vef|bolívars vénézuélien|bolivars venezuelien"], ["Dong vietnamien", "dong vietnamien|dongs vietnamiens|dong|đồng|vnd|dông|dông vietnamiens"], ["Kwacha de Zambie", "kwacha de zambie|zk|zmw|kwachas"], ["Dirham marocain", "dirham marocain|mad|د.م."], ["Dirham des Émirats arabes unis", "dirham des Émirats arabes unis|د.إ|aed"], ["Manat azerbaïdjanais", "manat azerbaïdjanais|manat azerbaidjanais|azn"], ["Manat turkmène", "manat turkmène|tmt|manat turkmene"], ["Manat", "manats|manat"], ["Qəpik", "qəpik"], ["Shilling somalien", "shilling somalien|shillings somalien|sos"], ["Shilling tanzanien", "shilling tanzanien|shillings tanzanien|tzs|tsh|shilling tanzanienne|shillings tanzanienne"], ["Shilling ougandais", "shilling ougandais|shillings ougandais|sh|ugx"], ["Leu roumain", "leu roumain|lei|leu roumaine|ron"], ["Leu moldave", "leu meoldave|mdl"], ["Leu", "leu"], ["Ban", "bani|-ban|ban"], ["Roupie népalaise", "roupie népalaise|roupie nepalaise|npr"], ["Roupie pakistanaise", "roupie pakistanaise|pkr"], ["Roupie indienne", "roupie indienne|inr|roupie indien|inr|₹"], ["Roupie seychelloise", "roupie seychelloise|scr|sr|sre"], ["Roupie mauricienne", "roupie mauricienne|mur"], ["Rufiyaa maldives", "rufiyaa maldives|mvr|.ރ|rf"], ["Roupie srilankaise", "roupie srilankaise|lrk|රු|ரூ"], ["Rupiah Indonésie", "rupia indonésie|rupia indonesie|rupiah|rp|idr"], ["Roupie", "roupie"], ["Couronne danoise", "couronne danoise|dkk|couronnes danoise|couronne danemark|couronnes danemark"], ["Couronne norvégienne", "couronne norvégienne|couronne norvegienne|couronnes norvégienne|couronnes norvegienne|nok"], ["Couronne féroïenne", "couronne féroïenne|couronne feroienne"], ["Couronne suédoise", "couronne suédoise|couronne suéde|sek|couronnes suédoise|couronne suedoise"], ["Couronne", "couronne|couronnes"], ["Øre", "Øre|oyra|eyrir"], ["Franc CFA de l'Afrique de l'Ouest", "franc cfa de l''afrique de l''ouest|franc cfa ouest africain|franc cfa|francs cfa|fcfa|frs cfa|cfa francs|xof"], ["Franc CFA d'Afrique centrale", "franc cfa d''afrique centrale|franc cfa centrale|frs cfa centrale|xaf"], ["Franc comorien", "franc comorien|kmf"], ["Franc congolais", "franc congolais|cdf"], ["Franc burundais", "franc burundais|bif"], ["Franc djiboutienne", "franc djiboutienne|djf"], ["Franc CFP", "franc cfp|xpf"], ["Franc guinéen", "franc guinéen|gnf"], ["Franc Suisse", "franc suisse|chf|sfr.|francs suisses"], ["Franc rwandais", "franc rwandais|rwf|rw|r₣|frw"], ["Franc belge", "franc belge|bi.|b.fr.|bef"], ["Rappen", "rappen|-rappen"], ["Franc", "francs|franc|fr.|fs"], ["Centimes", "centimes|centime|santim"], ["Rouble russe", "rouble russe|rub|₽|₽ russe|roubles russe|roubles russes|₽ russes"], ["Nouveau rouble biélorusse", "nouveau rouble biélorusse|byn|nouveau roubles biélorusse|nouveau rouble bielorusse|nouveau roubles biélorusse"], ["Rouble transnistriens", "rouble transnistriens|prb"], ["Rouble biélorusses", "rouble biélorusses|roubles biélorusses|rouble bielorusses|roubles bielorusses"], ["Kopek", "kopek|kopeks"], ["Kapyeyka", "kapyeyka"], ["Rouble", "roubles|rouble|br"], ["Dinar algérien", "dinar algérien|د.ج|dzd|dinars algérien|dinar algerien|dinars algerien"], ["Dinar de bahreïn", "dinar de bahreïn|bhd|.د.ب|dinar de bahrein"], ["Santeem", "santeem|santeems"], ["Dinar iraquien", "dinar iraquien|dinars iraquien|iqd|ع.د|dinar iraquienne|dinars iraquienne"], ["Dinar jordanien", "dinar jordanien|dinars jordanien|د.ا|jod"], ["Dinar koweïtien", "dinar koweïtien|dinar koweitien|dinars koweïtien|kwd|د.ك"], ["Dinar libyen", "dinar libyen|dinars libyen|lyd"], ["Dinar serbe", "dinar serbe|dinars serbe|rsd|дин."], ["Dinar tunisien", "dinar tunisien|dinars tunisien|tnd"], ["Dinar yougoslave", "dinar yougoslave|dinars yougoslave|yun"], ["Dinar", "dinars|dinar|denar|-dinars|-dinar"], ["Fils", "fils|fulūs|-fils|-fil"], ["Para", "para|napa"], ["Millime", "millimes|millime"], ["Peso argentin", "peso argentin|ars|pesos argentin|peso argentine|pesos argentine"], ["Peso chilien", "peso chilien|pesos chilien|clp"], ["Peso colombien", "peso colombien|pesos colombien|cop|peso colombie|pesos colombien"], ["Peso cubains convertibles", "peso cubains convertibles|pesos cubains convertibles|cuc"], ["Peso cubains", "peso cubaines|pesos cubaines|peso cubaine|pesos cubaines|cup"], ["Peso dominicain", "peso dominicain|pesos dominicain|dop|peso dominicaine|pesos dominicaine"], ["Peso philippin", "peso philippin|pesos philippin|piso|₱|php"], ["Peso uruguayen", "peso uruguayen|pesos uruguayen|uyu"], ["Peso", "pesos|Peso"], ["Centavo", "centavos|Centavo"], ["Livre britannique", "livre britannique|livres britannique|gbp|£ britannique"], ["Livre guernesey", "livre guernesey|£ guernesey|ggp"], ["Livre ascension", "livre ascension|livres ascension|£ ascension"], ["Livre sainte-hélène", "livre de sainte-hélène|livre sainte-hélène|livre sainte-helene|livre de sainte hélène|shp"], ["Livre égyptienne", "livre égyptienne|livre egyptienne|egp|ج.م"], ["Livre des îles falkland", "livre des îles falkland|livre des iles falkland|fkp|£ iles falkland"], ["Livre gibraltar", "livre gibraltar|livre de gibraltar|£ gibraltar|gip"], ["Livre manx", "imp|livre manx|£ manx"], ["Livre jersey", "livre de jersey|livre jersey|jep|£ jersey"], ["Livre libanaise", "livre libanaise|£ libanaise|livres libanaise|lbp|ل.ل"], ["Livre des îles malouines", "livre des îles malouines|livre des iles malouines|£ iles malouines"], ["Livre sud-soudanaise", "livre sud-soudanaise|livre sud soudanaise|livre du soudan du sud|livres sud-soudanaises|livre sud soudan|livre soudan sud"], ["Livre soudanaise", "livre soudanaise|livres soudanaise|sdg|£ soudan|ج.س.|livre soudan|livres soudan"], ["Livre syrienne", "livre syrienne|ل.س|syp|livre syrie|livres syrie|£ syrie"], ["Livre", "livre|livres|-livre|-livres|£"], ["Pence", "pence"], ["Shilling", "shilling|shillings"], ["Penny", "penny|sou|centime"], ["Dollar Américain", "dollar américain|$ américain|$ americain|usd|$usd|$ usd|dollar americain|dollar États-Unis|dollar des États-Unis|dollar États Unis|dollar etats unis|dollar etats-unis|$ etats-unis|$ États-Unis"], ["Dollar des Caraïbes orientales", "dollar des caraïbes orientales|dollar des caraibes orientales|xcd|$ caraibes orientales|$ caraïbes orientales"], ["Dollar Australien", "dollar australien|dollars australiens|$ australien|aud|$australien|australien $|$ australie|dollar australie"], ["Dollar des bahamas", "dollar des bahamas|dollar bahamas|$ bahamas|bsd|bahama $|dollar bahama|$ bahamas"], ["Dollar bermudes", "dollar des bermudes|dollar bermude|dollar bermudes|$ bermudes|bmd"], ["Dollar belize", "dollar de Belize|dollar belizien|bzd|$ belize"], ["Dollar îles Vierges britanniques", "dollar îles vierges britanniques|dollar iles vierges britanniques|$ iles vierges britanniques"], ["Dollar brunei", "dollar de brunei|$ brunei|bnd|dollar brunei"], ["Sen", "sen"], ["Dollar singapour", "dollar de singapour|dollar singapour|$ sinapour|sgd|$s"], ["Dollar Canadien", "dollar canadien|dollars canadien|$ canadien|cad|$can|$c|$ c|dollar canada|dollar canadienne|$ canada|$cad|cad$"], ["Dollar iles caimanes", "dollars des îles caïmanes|dollar des îles caïmanes|dollars des iles caimanes|dollar iles caimanes|kyd|$ci"], ["Dollar néo-zélandais", "dollar néo-zélandais|dollar néo zélandais|dollar neo-zelandais|dollar neo zelandais|$nz|$ néo-zélandais|$ neo zelandais"], ["Dollar îles cook", "dollar îles cook|dollar iles cook|$ iles cook"], ["Dollar des fidji", "dollar des fidji|$ fidji|dollar fidji|dollar de fidji|dollars des fidji|dollars de fidji"], ["Dollar guyanien", "dollar guyanien|dollar du guyana|dollar dre guyana|$ guayana|gyd|$gy"], ["Dollar de Hong Kong", "dollar hong kong|dollar hongkong|dollar de hong kong|dollar de hongkong|$hk|$ hk|hkd|hk $|hk$|dollar hk|$hongkong|dollars hongkong|dollars hong kong"], ["Dollar jamaïcain", "dollar jamaïcain|dollars jamaïcain|dollar jamaicain|dollars jamaicain|$j|$ jamaïque|dollar jamaïque|jmd"], ["Dollar libérien", "dollar libérien|dollars libérien|dollar liberien|dollars liberien|lrd|$ libérien|$ liberia|$ liberien"], ["Dollar namibien", "dollar namibien|dollars namibien|$ namibien|nad|$n|dollar namibie|dollars namibie|$ namibie"], ["Dollar des îles salomon", "dollar des îles Salomon|dollar des iles salomon|$si|sbd|$ iles salomon|$ îles salomon"], ["Dollar du suriname", "dollar du suriname|srd|$ du suriname|$ suriname|dollar suriname|dollars suriname|dollars du suriname"], ["Nouveau dollar de Taïwan", "nouveau dollar de taïwan|nouveau dollar de taiwan|twd|ntd|$nt"], ["Dollar trinidadien", "dollar trinidadien|dollars trinidadien|ttd|$ trinidadien"], ["Dollar", "dollar|$|dollars"], ["Yuan Chinois", "yuan|yuans|yuan chinois|renminbi|cny|rmb|¥"], ["Fen", "fen"], ["Jiao", "jiao"], ["Mark Finlandais", "marks finlandais|mark finlandais|fim|mark"]]); + FrenchNumericWithUnit.CompoundUnitConnectorRegex = `(?[^.])`; + FrenchNumericWithUnit.CurrencyPrefixList = new Map([["Dollar", "$"], ["Dollar États-Unis", "$us|usd|us$"], ["Dollar Caraïbes orientales", "xcd|$ec"], ["Dollar australien", "a$|$a|aud"], ["Dollar bahamas", "bsd|b$"], ["Dollar barbadien", "bbd|bds$"], ["Dollar de belize", "bz$|bzd"], ["Dollar des bermudes", "bd$|bmd"], ["Dollar de brunei", "brunei $|bnd"], ["Dollar de Singapour", "s$|sgd"], ["Dollar Canadien", "cad|$ ca|$ca|$ c"], ["Dollar des îles Caïmans", "ci$|kyd"], ["Dollar néo-zélandais", "nz$|nzd"], ["Dollar de Fidji", "$fj|fjd"], ["Dolar guyanien", "g$|gyd"], ["Dollar de Hong Kong", "hkd|hk$"], ["Dollar jamaïcain", "j$|jmd"], ["Dollar libérien", "lrd|l$"], ["Dollar namibien", "nad|n$"], ["Dollar des îles Salomon", "$ si|$si|sbd"], ["Nouveau dollar de Taïwan", "nt$|twd"], ["Réal brésilien", "r$|brl|reais"], ["Guaraní paraguayen", "₲|gs.|pyg"], ["Dollar trinidadien", "ttd|titis"], ["Yuan renminbi", "cny|rmb|¥|元"], ["Yen", "¥|jpy"], ["Euro", "€|eur"], ["Pound", "£"], ["Florín", "ƒ"], ["Livre", "£|gbp"]]); + FrenchNumericWithUnit.AmbiguousCurrencyUnitList = ['din.', 'kina', 'lari', 'taka', 'tala', 'vatu', 'yuan', 'bob', 'btn', 'cop', 'cup', 'dop', 'gip', 'jod', 'kgs', 'lak', 'mga', 'mop', 'nad', 'omr', 'sar', 'sbd', 'scr', 'sdg', 'sek', 'sos', 'std', 'try', 'yer']; + FrenchNumericWithUnit.InformationSuffixList = new Map([["Bit", "-bit|bit|bits"], ["Kilobit", "kilobit|kilobits|kb|kbit|kbits"], ["Megabit", "megabit|megabits|Mb|Mbit|mégabit|mégabits"], ["Gigabit", "gigabit|gigabits|Gb|Gbit"], ["Terabit", "terabit|terabits|Tb|Tbit|térabit|térabits"], ["Petabit", "petabit|petabits|Pb|Pbit|pétabit|pétabits"], ["octet", "octet|octets|-octet"], ["Kilooctet", "kilo-octet|kilo-octets|kilooctet|kilooctets|ko|kio|kB|KiB|kilobyte|kilobytes"], ["Mégaoctet", "mégaoctet|mégaoctets|méga-octet|méga-octets|Mo|Mio|MB|mégabyte|mégabytes"], ["Gigaoctet", "gigaoctet|gigaoctets|Go|Gio|GB|GiB|gigabyte|gigabytes"], ["Téraoctet", "téraoctet|téraoctets|To|Tio|TB|TiB|térabyte|térabytes"], ["Pétaoctet", "pétaoctet|pétaoctets|Po|Pio|PB|PiB|pétabyte|pétabytes"]]); + FrenchNumericWithUnit.AmbiguousDimensionUnitList = ['mi', 'barils', 'grain', 'l', 'pierre', 'fps', 'pts']; + FrenchNumericWithUnit.BuildPrefix = `(?<=(\\s|^|\\P{L}))`; + FrenchNumericWithUnit.BuildSuffix = `(?=(\\s|\\P{L}|$))`; + FrenchNumericWithUnit.ConnectorToken = 'de'; + FrenchNumericWithUnit.LengthSuffixList = new Map([["Kilomètres", "km|kilomètres|kilomètre|kilometres|kilometre|-km"], ["Hectomètre", "hm|hectomètre|hectomètres|hectometre|hectometres|-hm"], ["Décamètre", "dam|décamètre|décamètres|decametre|decametres|-dm"], ["Mètres", "m|mètres|mètre|metres|metre|m.|-m"], ["Décimètres", "dm|décimètres|décimètre|decimetres|decimetre"], ["Centimètres", "cm|centimètres|centimètre|centimetres|centimetre"], ["Millimètres", "mm|millimètres|millimètre|millimetre|millimetres"], ["Micromètres", "µm|um|micromètres|micromètre|micrometres|micrometre"], ["Nanomètres", "nm|nanometre|nanometres|nanomètres|nanomètre"], ["Picomètres", "pm|picomètre|picomètres|picometres|picometre"], ["Mile", "mi|mile|miles"], ["Pied", "pied|pieds"], ["Yard", "yards|yard|yd"], ["Pouce", "pouce|pouces"]]); + FrenchNumericWithUnit.AmbiguousLengthUnitList = ['m', 'yard', 'yards', 'pm', 'pt', 'pts']; + FrenchNumericWithUnit.AmbuguousLengthUnitList = ['m', 'pouce', 'pm']; + FrenchNumericWithUnit.SpeedSuffixList = new Map([["Mètre par seconde", "m/s|metres/seconde|metres par seconde|metre par seconde|metres par secondes|mètre par seconde|mètres par seconde|mètres par secondes"], ["Kilomètre par heure", "km/h|kilomètre par heure|kilomètres par heure|kilomètres par heures|kilometres par heure|kilometre par heure"], ["Kilomètre par minute", "km/m|kilomètre par minute|kilomètres par minute|kilomètres par minutes|kilometre par minute|kilometre par minutes"], ["Kilomètre par seconde", "km/s|km à la seconde|km a la seconde|kilomètre par seconde|kilomètres par seconde|kilometre par seconde|kilometres par seconde"], ["Miles par heure", "mph|miles par heure|miles à l'heure|miles a l'heure|miles un heure"], ["Noeuds", "noeud|noeuds|nuds"], ["Pied par seconde", "ft/s|pied par seconde|pieds par seconde|pied/s|pieds/s"], ["Pied par minute", "pieds/minute|pied/minute|ft/minute|ft/min|pied/min"]]); + FrenchNumericWithUnit.TemperatureSuffixList = new Map([["Kelvin", "k|K|kelvin"], ["F", "°f|degres f|degrés f|deg f|° f|degrés fahrenheit|degres fahrenheit|fahrenheit"], ["R", "rankine|°r|° r"], ["C", "°c|deg c|degrés celsius|degrés c|degres celsius|celsius|deg celsius|degs celsius|centigrade|deg centigrade|degs centigrade|degrés centigrade|degres centigrade|degré centigrade|degre centigrade"], ["Degré", "degrés|degres|deg.|°| °|degré|degre|deg"]]); + FrenchNumericWithUnit.VolumeSuffixList = new Map([["Mètre cube", "m3|m^3|m³|mètre cube|mètres cube|metre cube|metres cube"], ["Centimètre cube", "cm3|cm^3|cm³|centimètre cube|centimètres cube|centimetre cube|centimetres cube"], ["Millimètre cube", "mm3|mm^3|mm³|millimètre cube|millimètres cube|millimetre cube|millimetres cube"], ["Kilomètre cube", "km3|km^3|km³|kilomètre cube|kilomètres cube|kilometre cube|kilometres cube"], ["Pieds cube", "pieds cubes|pieds cube|pied cube|pied cubes"], ["Litre", "litre|litres|lts|l"], ["Millilitre", "ml|millilitre|millilitres"], ["Gallon", "gallon|gallons"], ["Pintes", "pintes"], ["Onces", "onces|once|oz"], ["Décilitre", "dl|décilitre|decilitre|décilitres|decilitres"], ["Centilitre", "cl|centilitres|centilitre"], ["Onces liquides", "onces liquides|once liquide|once liquides"], ["Baril", "baril|barils|bbl"]]); + FrenchNumericWithUnit.AmbiguousVolumeUnitList = ['ounce', 'oz', 'l', 'cup', 'peck', 'cord', 'gill']; + FrenchNumericWithUnit.WeightSuffixList = new Map([["Kilogramme", "kg|kilogramme|kilogrammes|kilo|kilos"], ["Gram", "g|gramme|grammes"], ["Milligramme", "mg|milligramme|milligrammes"], ["Tonne métrique", "tonne métrique|tonnes métrique|tonnes métriques|tonne metrique|tonnes metrique"], ["Tonne", "tonne|tonnes|-tonnes|-tonne"], ["Livre", "livre|livres"]]); + FrenchNumericWithUnit.AmbiguousWeightUnitList = ['g', 'oz', 'stone', 'dram']; +})(FrenchNumericWithUnit = exports.FrenchNumericWithUnit || (exports.FrenchNumericWithUnit = {})); + +}); + +unwrapExports(frenchNumericWithUnit); + +var base$10 = createCommonjsModule(function (module, exports) { +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); + + + + + +class FrenchNumberWithUnitExtractorConfiguration { + constructor(ci) { + this.cultureInfo = ci; + this.unitNumExtractor = new recognizersTextNumber.FrenchNumberExtractor(); + this.buildPrefix = frenchNumericWithUnit.FrenchNumericWithUnit.BuildPrefix; + this.buildSuffix = frenchNumericWithUnit.FrenchNumericWithUnit.BuildSuffix; + this.connectorToken = frenchNumericWithUnit.FrenchNumericWithUnit.ConnectorToken; + this.compoundUnitConnectorRegex = recognizersText.RegExpUtility.getSafeRegExp(frenchNumericWithUnit.FrenchNumericWithUnit.CompoundUnitConnectorRegex); + this.pmNonUnitRegex = recognizersText.RegExpUtility.getSafeRegExp(baseUnits.BaseUnits.PmNonUnitRegex); + } +} +exports.FrenchNumberWithUnitExtractorConfiguration = FrenchNumberWithUnitExtractorConfiguration; +class FrenchNumberWithUnitParserConfiguration extends parsers$4.BaseNumberWithUnitParserConfiguration { + constructor(ci) { + super(ci); + this.internalNumberExtractor = new recognizersTextNumber.FrenchNumberExtractor(recognizersTextNumber.NumberMode.Default); + this.internalNumberParser = recognizersTextNumber.AgnosticNumberParserFactory.getParser(recognizersTextNumber.AgnosticNumberParserType.Number, new recognizersTextNumber.FrenchNumberParserConfiguration()); + this.connectorToken = frenchNumericWithUnit.FrenchNumericWithUnit.ConnectorToken; + } +} +exports.FrenchNumberWithUnitParserConfiguration = FrenchNumberWithUnitParserConfiguration; + +}); + +unwrapExports(base$10); + +var currency$10 = createCommonjsModule(function (module, exports) { +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); + + + + +class FrenchCurrencyExtractorConfiguration extends base$10.FrenchNumberWithUnitExtractorConfiguration { + constructor(ci) { + if (!ci) { + ci = new recognizersTextNumber.CultureInfo(recognizersTextNumber.Culture.French); + } + super(ci); + this.extractType = constants$2.Constants.SYS_UNIT_CURRENCY; + // Reference Source: https:// en.wikipedia.org/wiki/List_of_circulating_currencies + this.suffixList = frenchNumericWithUnit.FrenchNumericWithUnit.CurrencySuffixList; + this.prefixList = frenchNumericWithUnit.FrenchNumericWithUnit.CurrencyPrefixList; + this.ambiguousUnitList = frenchNumericWithUnit.FrenchNumericWithUnit.AmbiguousCurrencyUnitList; + } +} +exports.FrenchCurrencyExtractorConfiguration = FrenchCurrencyExtractorConfiguration; +class FrenchCurrencyParserConfiguration extends base$10.FrenchNumberWithUnitParserConfiguration { + constructor(ci) { + if (!ci) { + ci = new recognizersTextNumber.CultureInfo(recognizersTextNumber.Culture.French); + } + super(ci); + this.BindDictionary(frenchNumericWithUnit.FrenchNumericWithUnit.CurrencySuffixList); + this.BindDictionary(frenchNumericWithUnit.FrenchNumericWithUnit.CurrencyPrefixList); + } +} +exports.FrenchCurrencyParserConfiguration = FrenchCurrencyParserConfiguration; + +}); + +unwrapExports(currency$10); + +var temperature$8 = createCommonjsModule(function (module, exports) { +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); + + + + +class FrenchTemperatureExtractorConfiguration extends base$10.FrenchNumberWithUnitExtractorConfiguration { + constructor(ci) { + if (!ci) { + ci = new recognizersTextNumber.CultureInfo(recognizersTextNumber.Culture.French); + } + super(ci); + this.extractType = constants$2.Constants.SYS_UNIT_TEMPERATURE; + this.suffixList = frenchNumericWithUnit.FrenchNumericWithUnit.TemperatureSuffixList; + this.prefixList = new Map(); + this.ambiguousUnitList = new Array(); + } +} +exports.FrenchTemperatureExtractorConfiguration = FrenchTemperatureExtractorConfiguration; +class FrenchTemperatureParserConfiguration extends base$10.FrenchNumberWithUnitParserConfiguration { + constructor(ci) { + if (!ci) { + ci = new recognizersTextNumber.CultureInfo(recognizersTextNumber.Culture.French); + } + super(ci); + this.connectorToken = null; + this.BindDictionary(frenchNumericWithUnit.FrenchNumericWithUnit.TemperatureSuffixList); + } +} +exports.FrenchTemperatureParserConfiguration = FrenchTemperatureParserConfiguration; + +}); + +unwrapExports(temperature$8); + +var dimension$8 = createCommonjsModule(function (module, exports) { +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); + + + + +const dimensionSuffixList = new Map([ + ...frenchNumericWithUnit.FrenchNumericWithUnit.InformationSuffixList, + ...frenchNumericWithUnit.FrenchNumericWithUnit.AreaSuffixList, + ...frenchNumericWithUnit.FrenchNumericWithUnit.LengthSuffixList, + ...frenchNumericWithUnit.FrenchNumericWithUnit.SpeedSuffixList, + ...frenchNumericWithUnit.FrenchNumericWithUnit.VolumeSuffixList, + ...frenchNumericWithUnit.FrenchNumericWithUnit.WeightSuffixList +]); +class FrenchDimensionExtractorConfiguration extends base$10.FrenchNumberWithUnitExtractorConfiguration { + constructor(ci) { + if (!ci) { + ci = new recognizersTextNumber.CultureInfo(recognizersTextNumber.Culture.French); + } + super(ci); + this.extractType = constants$2.Constants.SYS_UNIT_DIMENSION; + this.suffixList = dimensionSuffixList; + this.prefixList = new Map(); + this.ambiguousUnitList = frenchNumericWithUnit.FrenchNumericWithUnit.AmbiguousDimensionUnitList; + } +} +exports.FrenchDimensionExtractorConfiguration = FrenchDimensionExtractorConfiguration; +class FrenchDimensionParserConfiguration extends base$10.FrenchNumberWithUnitParserConfiguration { + constructor(ci) { + if (!ci) { + ci = new recognizersTextNumber.CultureInfo(recognizersTextNumber.Culture.French); + } + super(ci); + this.BindDictionary(dimensionSuffixList); + } +} +exports.FrenchDimensionParserConfiguration = FrenchDimensionParserConfiguration; + +}); + +unwrapExports(dimension$8); + +var age$10 = createCommonjsModule(function (module, exports) { +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); + + + + +class FrenchAgeExtractorConfiguration extends base$10.FrenchNumberWithUnitExtractorConfiguration { + constructor(ci) { + if (!ci) { + ci = new recognizersTextNumber.CultureInfo(recognizersTextNumber.Culture.French); + } + super(ci); + this.extractType = constants$2.Constants.SYS_UNIT_AGE; + this.suffixList = frenchNumericWithUnit.FrenchNumericWithUnit.AgeSuffixList; + this.prefixList = new Map(); + this.ambiguousUnitList = new Array(); + } +} +exports.FrenchAgeExtractorConfiguration = FrenchAgeExtractorConfiguration; +class FrenchAgeParserConfiguration extends base$10.FrenchNumberWithUnitParserConfiguration { + constructor(ci) { + if (!ci) { + ci = new recognizersTextNumber.CultureInfo(recognizersTextNumber.Culture.French); + } + super(ci); + this.BindDictionary(frenchNumericWithUnit.FrenchNumericWithUnit.AgeSuffixList); + } +} +exports.FrenchAgeParserConfiguration = FrenchAgeParserConfiguration; + +}); + +unwrapExports(age$10); + +var numberWithUnitRecognizer = createCommonjsModule(function (module, exports) { +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); + + + + + + + + + + + + + + + + + + + + + + + + + + + +var NumberWithUnitOptions; +(function (NumberWithUnitOptions) { + NumberWithUnitOptions[NumberWithUnitOptions["None"] = 0] = "None"; +})(NumberWithUnitOptions = exports.NumberWithUnitOptions || (exports.NumberWithUnitOptions = {})); +function recognizeCurrency(query, culture, options = NumberWithUnitOptions.None, fallbackToDefaultCulture = true) { + return recognizeByModel(recognizer => recognizer.getCurrencyModel(culture, fallbackToDefaultCulture), query, culture, options); +} +exports.recognizeCurrency = recognizeCurrency; +function recognizeTemperature(query, culture, options = NumberWithUnitOptions.None, fallbackToDefaultCulture = true) { + return recognizeByModel(recognizer => recognizer.getTemperatureModel(culture, fallbackToDefaultCulture), query, culture, options); +} +exports.recognizeTemperature = recognizeTemperature; +function recognizeDimension(query, culture, options = NumberWithUnitOptions.None, fallbackToDefaultCulture = true) { + return recognizeByModel(recognizer => recognizer.getDimensionModel(culture, fallbackToDefaultCulture), query, culture, options); +} +exports.recognizeDimension = recognizeDimension; +function recognizeAge(query, culture, options = NumberWithUnitOptions.None, fallbackToDefaultCulture = true) { + return recognizeByModel(recognizer => recognizer.getAgeModel(culture, fallbackToDefaultCulture), query, culture, options); +} +exports.recognizeAge = recognizeAge; +function recognizeByModel(getModelFunc, query, culture, options) { + let recognizer = new NumberWithUnitRecognizer(culture, options); + let model = getModelFunc(recognizer); + return model.parse(query); +} +class NumberWithUnitRecognizer extends recognizersText.Recognizer { + constructor(culture, options = NumberWithUnitOptions.None, lazyInitialization = false) { + super(culture, options, lazyInitialization); + } + InitializeConfiguration() { + //#region English + this.registerModel("CurrencyModel", recognizersTextNumber.Culture.English, (options) => new models$4.CurrencyModel(new Map([ + [new extractors$16.BaseMergedUnitExtractor(new currency.EnglishCurrencyExtractorConfiguration()), new parsers$4.BaseMergedUnitParser(new currency.EnglishCurrencyParserConfiguration())] + ]))); + this.registerModel("TemperatureModel", recognizersTextNumber.Culture.English, (options) => new models$4.TemperatureModel(new Map([ + [new extractors$16.NumberWithUnitExtractor(new temperature.EnglishTemperatureExtractorConfiguration()), new parsers$4.NumberWithUnitParser(new temperature.EnglishTemperatureParserConfiguration())] + ]))); + this.registerModel("DimensionModel", recognizersTextNumber.Culture.English, (options) => new models$4.DimensionModel(new Map([ + [new extractors$16.NumberWithUnitExtractor(new dimension.EnglishDimensionExtractorConfiguration()), new parsers$4.NumberWithUnitParser(new dimension.EnglishDimensionParserConfiguration())] + ]))); + this.registerModel("AgeModel", recognizersTextNumber.Culture.English, (options) => new models$4.AgeModel(new Map([ + [new extractors$16.NumberWithUnitExtractor(new age.EnglishAgeExtractorConfiguration()), new parsers$4.NumberWithUnitParser(new age.EnglishAgeParserConfiguration())] + ]))); + //#endregion + //#region Spanish + this.registerModel("CurrencyModel", recognizersTextNumber.Culture.Spanish, (options) => new models$4.CurrencyModel(new Map([ + [new extractors$16.NumberWithUnitExtractor(new currency$2.SpanishCurrencyExtractorConfiguration()), new parsers$4.NumberWithUnitParser(new currency$2.SpanishCurrencyParserConfiguration())] + ]))); + this.registerModel("TemperatureModel", recognizersTextNumber.Culture.Spanish, (options) => new models$4.TemperatureModel(new Map([ + [new extractors$16.NumberWithUnitExtractor(new temperature$2.SpanishTemperatureExtractorConfiguration()), new parsers$4.NumberWithUnitParser(new temperature$2.SpanishTemperatureParserConfiguration())] + ]))); + this.registerModel("DimensionModel", recognizersTextNumber.Culture.Spanish, (options) => new models$4.DimensionModel(new Map([ + [new extractors$16.NumberWithUnitExtractor(new dimension$2.SpanishDimensionExtractorConfiguration()), new parsers$4.NumberWithUnitParser(new dimension$2.SpanishDimensionParserConfiguration())] + ]))); + this.registerModel("AgeModel", recognizersTextNumber.Culture.Spanish, (options) => new models$4.AgeModel(new Map([ + [new extractors$16.NumberWithUnitExtractor(new age$2.SpanishAgeExtractorConfiguration()), new parsers$4.NumberWithUnitParser(new age$2.SpanishAgeParserConfiguration())] + ]))); + //#endregion + //#region Portuguese + this.registerModel("CurrencyModel", recognizersTextNumber.Culture.Portuguese, (options) => new models$4.CurrencyModel(new Map([ + [new extractors$16.NumberWithUnitExtractor(new currency$4.PortugueseCurrencyExtractorConfiguration()), new parsers$4.NumberWithUnitParser(new currency$4.PortugueseCurrencyParserConfiguration())] + ]))); + this.registerModel("TemperatureModel", recognizersTextNumber.Culture.Portuguese, (options) => new models$4.TemperatureModel(new Map([ + [new extractors$16.NumberWithUnitExtractor(new temperature$4.PortugueseTemperatureExtractorConfiguration()), new parsers$4.NumberWithUnitParser(new temperature$4.PortugueseTemperatureParserConfiguration())] + ]))); + this.registerModel("DimensionModel", recognizersTextNumber.Culture.Portuguese, (options) => new models$4.DimensionModel(new Map([ + [new extractors$16.NumberWithUnitExtractor(new dimension$4.PortugueseDimensionExtractorConfiguration()), new parsers$4.NumberWithUnitParser(new dimension$4.PortugueseDimensionParserConfiguration())] + ]))); + this.registerModel("AgeModel", recognizersTextNumber.Culture.Portuguese, (options) => new models$4.AgeModel(new Map([ + [new extractors$16.NumberWithUnitExtractor(new age$4.PortugueseAgeExtractorConfiguration()), new parsers$4.NumberWithUnitParser(new age$4.PortugueseAgeParserConfiguration())] + ]))); + //#endregion + //#region Chinese + this.registerModel("CurrencyModel", recognizersTextNumber.Culture.Chinese, (options) => new models$4.CurrencyModel(new Map([ + [new extractors$16.BaseMergedUnitExtractor(new currency$6.ChineseCurrencyExtractorConfiguration()), new parsers$4.BaseMergedUnitParser(new currency$6.ChineseCurrencyParserConfiguration())], + [new extractors$16.NumberWithUnitExtractor(new currency.EnglishCurrencyExtractorConfiguration()), new parsers$4.NumberWithUnitParser(new currency.EnglishCurrencyParserConfiguration())] + ]))); + this.registerModel("TemperatureModel", recognizersTextNumber.Culture.Chinese, (options) => new models$4.TemperatureModel(new Map([ + [new extractors$16.NumberWithUnitExtractor(new temperature$6.ChineseTemperatureExtractorConfiguration()), new parsers$4.NumberWithUnitParser(new temperature$6.ChineseTemperatureParserConfiguration())], + [new extractors$16.NumberWithUnitExtractor(new temperature.EnglishTemperatureExtractorConfiguration()), new parsers$4.NumberWithUnitParser(new temperature.EnglishTemperatureParserConfiguration())] + ]))); + this.registerModel("DimensionModel", recognizersTextNumber.Culture.Chinese, (options) => new models$4.DimensionModel(new Map([ + [new extractors$16.NumberWithUnitExtractor(new dimension$6.ChineseDimensionExtractorConfiguration()), new parsers$4.NumberWithUnitParser(new dimension$6.ChineseDimensionParserConfiguration())], + [new extractors$16.NumberWithUnitExtractor(new dimension.EnglishDimensionExtractorConfiguration()), new parsers$4.NumberWithUnitParser(new dimension.EnglishDimensionParserConfiguration())] + ]))); + this.registerModel("AgeModel", recognizersTextNumber.Culture.Chinese, (options) => new models$4.AgeModel(new Map([ + [new extractors$16.NumberWithUnitExtractor(new age$6.ChineseAgeExtractorConfiguration()), new parsers$4.NumberWithUnitParser(new age$6.ChineseAgeParserConfiguration())], + [new extractors$16.NumberWithUnitExtractor(new age.EnglishAgeExtractorConfiguration()), new parsers$4.NumberWithUnitParser(new age.EnglishAgeParserConfiguration())] + ]))); + //#endregion + //#region Japanese + this.registerModel("CurrencyModel", recognizersTextNumber.Culture.Japanese, (options) => new models$4.CurrencyModel(new Map([ + [new extractors$16.BaseMergedUnitExtractor(new currency$8.JapaneseCurrencyExtractorConfiguration()), new parsers$4.BaseMergedUnitParser(new currency$8.JapaneseCurrencyParserConfiguration())], + [new extractors$16.NumberWithUnitExtractor(new currency.EnglishCurrencyExtractorConfiguration()), new parsers$4.NumberWithUnitParser(new currency.EnglishCurrencyParserConfiguration())] + ]))); + this.registerModel("AgeModel", recognizersTextNumber.Culture.Japanese, (options) => new models$4.AgeModel(new Map([ + [new extractors$16.NumberWithUnitExtractor(new age$8.JapaneseAgeExtractorConfiguration()), new parsers$4.NumberWithUnitParser(new age$8.JapaneseAgeParserConfiguration())], + [new extractors$16.NumberWithUnitExtractor(new age.EnglishAgeExtractorConfiguration()), new parsers$4.NumberWithUnitParser(new age.EnglishAgeParserConfiguration())] + ]))); + //#endregion + //#region French + this.registerModel("CurrencyModel", recognizersTextNumber.Culture.French, (options) => new models$4.CurrencyModel(new Map([ + [new extractors$16.NumberWithUnitExtractor(new currency$10.FrenchCurrencyExtractorConfiguration()), new parsers$4.NumberWithUnitParser(new currency$10.FrenchCurrencyParserConfiguration())] + ]))); + this.registerModel("TemperatureModel", recognizersTextNumber.Culture.French, (options) => new models$4.TemperatureModel(new Map([ + [new extractors$16.NumberWithUnitExtractor(new temperature$8.FrenchTemperatureExtractorConfiguration()), new parsers$4.NumberWithUnitParser(new temperature$8.FrenchTemperatureParserConfiguration())] + ]))); + this.registerModel("DimensionModel", recognizersTextNumber.Culture.French, (options) => new models$4.DimensionModel(new Map([ + [new extractors$16.NumberWithUnitExtractor(new dimension$8.FrenchDimensionExtractorConfiguration()), new parsers$4.NumberWithUnitParser(new dimension$8.FrenchDimensionParserConfiguration())] + ]))); + this.registerModel("AgeModel", recognizersTextNumber.Culture.French, (options) => new models$4.AgeModel(new Map([ + [new extractors$16.NumberWithUnitExtractor(new age$10.FrenchAgeExtractorConfiguration()), new parsers$4.NumberWithUnitParser(new age$10.FrenchAgeParserConfiguration())] + ]))); + //#endregion + } + IsValidOptions(options) { + return options >= 0 && options <= NumberWithUnitOptions.None; + } + getCurrencyModel(culture = null, fallbackToDefaultCulture = true) { + return this.getModel("CurrencyModel", culture, fallbackToDefaultCulture); + } + getTemperatureModel(culture = null, fallbackToDefaultCulture = true) { + return this.getModel("TemperatureModel", culture, fallbackToDefaultCulture); + } + getDimensionModel(culture = null, fallbackToDefaultCulture = true) { + return this.getModel("DimensionModel", culture, fallbackToDefaultCulture); + } + getAgeModel(culture = null, fallbackToDefaultCulture = true) { + return this.getModel("AgeModel", culture, fallbackToDefaultCulture); + } +} +exports.default = NumberWithUnitRecognizer; + +}); + +unwrapExports(numberWithUnitRecognizer); + +var recognizersTextNumberWithUnit = createCommonjsModule(function (module, exports) { +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); + +exports.NumberWithUnitRecognizer = numberWithUnitRecognizer.default; +exports.NumberWithUnitOptions = numberWithUnitRecognizer.NumberWithUnitOptions; +exports.recognizeTemperature = numberWithUnitRecognizer.recognizeTemperature; +exports.recognizeDimension = numberWithUnitRecognizer.recognizeDimension; +exports.recognizeCurrency = numberWithUnitRecognizer.recognizeCurrency; +exports.recognizeAge = numberWithUnitRecognizer.recognizeAge; + +exports.Culture = recognizersTextNumber.Culture; +exports.CultureInfo = recognizersTextNumber.CultureInfo; + +exports.Constants = constants$2.Constants; + +exports.NumberWithUnitExtractor = extractors$16.NumberWithUnitExtractor; +exports.PrefixUnitResult = extractors$16.PrefixUnitResult; +exports.BaseMergedUnitExtractor = extractors$16.BaseMergedUnitExtractor; + +exports.CompositeEntityType = models$4.CompositeEntityType; +exports.AbstractNumberWithUnitModel = models$4.AbstractNumberWithUnitModel; +exports.AgeModel = models$4.AgeModel; +exports.CurrencyModel = models$4.CurrencyModel; +exports.DimensionModel = models$4.DimensionModel; +exports.TemperatureModel = models$4.TemperatureModel; + +exports.UnitValue = parsers$4.UnitValue; +exports.UnitValueIso = parsers$4.UnitValueIso; +exports.NumberWithUnitParser = parsers$4.NumberWithUnitParser; +exports.BaseNumberWithUnitParserConfiguration = parsers$4.BaseNumberWithUnitParserConfiguration; +exports.BaseCurrencyParser = parsers$4.BaseCurrencyParser; +exports.BaseMergedUnitParser = parsers$4.BaseMergedUnitParser; + +exports.EnglishAgeExtractorConfiguration = age.EnglishAgeExtractorConfiguration; +exports.EnglishAgeParserConfiguration = age.EnglishAgeParserConfiguration; + +exports.EnglishNumberWithUnitExtractorConfiguration = base.EnglishNumberWithUnitExtractorConfiguration; +exports.EnglishNumberWithUnitParserConfiguration = base.EnglishNumberWithUnitParserConfiguration; + +exports.EnglishCurrencyExtractorConfiguration = currency.EnglishCurrencyExtractorConfiguration; +exports.EnglishCurrencyParserConfiguration = currency.EnglishCurrencyParserConfiguration; + +exports.EnglishDimensionExtractorConfiguration = dimension.EnglishDimensionExtractorConfiguration; +exports.EnglishDimensionParserConfiguration = dimension.EnglishDimensionParserConfiguration; + +exports.EnglishTemperatureExtractorConfiguration = temperature.EnglishTemperatureExtractorConfiguration; +exports.EnglishTemperatureParserConfiguration = temperature.EnglishTemperatureParserConfiguration; + +exports.SpanishAgeExtractorConfiguration = age$2.SpanishAgeExtractorConfiguration; +exports.SpanishAgeParserConfiguration = age$2.SpanishAgeParserConfiguration; + +exports.SpanishNumberWithUnitExtractorConfiguration = base$2.SpanishNumberWithUnitExtractorConfiguration; +exports.SpanishNumberWithUnitParserConfiguration = base$2.SpanishNumberWithUnitParserConfiguration; + +exports.SpanishCurrencyExtractorConfiguration = currency$2.SpanishCurrencyExtractorConfiguration; +exports.SpanishCurrencyParserConfiguration = currency$2.SpanishCurrencyParserConfiguration; + +exports.SpanishDimensionExtractorConfiguration = dimension$2.SpanishDimensionExtractorConfiguration; +exports.SpanishDimensionParserConfiguration = dimension$2.SpanishDimensionParserConfiguration; + +exports.SpanishTemperatureExtractorConfiguration = temperature$2.SpanishTemperatureExtractorConfiguration; +exports.SpanishTemperatureParserConfiguration = temperature$2.SpanishTemperatureParserConfiguration; + +exports.PortugueseAgeExtractorConfiguration = age$4.PortugueseAgeExtractorConfiguration; +exports.PortugueseAgeParserConfiguration = age$4.PortugueseAgeParserConfiguration; + +exports.PortugueseNumberWithUnitExtractorConfiguration = base$4.PortugueseNumberWithUnitExtractorConfiguration; +exports.PortugueseNumberWithUnitParserConfiguration = base$4.PortugueseNumberWithUnitParserConfiguration; + +exports.PortugueseCurrencyExtractorConfiguration = currency$4.PortugueseCurrencyExtractorConfiguration; +exports.PortugueseCurrencyParserConfiguration = currency$4.PortugueseCurrencyParserConfiguration; + +exports.PortugueseDimensionExtractorConfiguration = dimension$4.PortugueseDimensionExtractorConfiguration; +exports.PortugueseDimensionParserConfiguration = dimension$4.PortugueseDimensionParserConfiguration; + +exports.PortugueseTemperatureExtractorConfiguration = temperature$4.PortugueseTemperatureExtractorConfiguration; +exports.PortugueseTemperatureParserConfiguration = temperature$4.PortugueseTemperatureParserConfiguration; + +exports.ChineseAgeExtractorConfiguration = age$6.ChineseAgeExtractorConfiguration; +exports.ChineseAgeParserConfiguration = age$6.ChineseAgeParserConfiguration; + +exports.ChineseNumberWithUnitExtractorConfiguration = base$6.ChineseNumberWithUnitExtractorConfiguration; +exports.ChineseNumberWithUnitParserConfiguration = base$6.ChineseNumberWithUnitParserConfiguration; + +exports.ChineseCurrencyExtractorConfiguration = currency$6.ChineseCurrencyExtractorConfiguration; +exports.ChineseCurrencyParserConfiguration = currency$6.ChineseCurrencyParserConfiguration; + +exports.ChineseDimensionExtractorConfiguration = dimension$6.ChineseDimensionExtractorConfiguration; +exports.ChineseDimensionParserConfiguration = dimension$6.ChineseDimensionParserConfiguration; + +exports.ChineseTemperatureExtractorConfiguration = temperature$6.ChineseTemperatureExtractorConfiguration; +exports.ChineseTemperatureParserConfiguration = temperature$6.ChineseTemperatureParserConfiguration; + +exports.JapaneseAgeExtractorConfiguration = age$8.JapaneseAgeExtractorConfiguration; +exports.JapaneseAgeParserConfiguration = age$8.JapaneseAgeParserConfiguration; + +exports.JapaneseNumberWithUnitExtractorConfiguration = base$8.JapaneseNumberWithUnitExtractorConfiguration; +exports.JapaneseNumberWithUnitParserConfiguration = base$8.JapaneseNumberWithUnitParserConfiguration; + +exports.JapaneseCurrencyExtractorConfiguration = currency$8.JapaneseCurrencyExtractorConfiguration; +exports.JapaneseCurrencyParserConfiguration = currency$8.JapaneseCurrencyParserConfiguration; + +exports.EnglishNumericWithUnit = englishNumericWithUnit.EnglishNumericWithUnit; + +exports.SpanishNumericWithUnit = spanishNumericWithUnit.SpanishNumericWithUnit; + +exports.PortugueseNumericWithUnit = portugueseNumericWithUnit.PortugueseNumericWithUnit; + +exports.ChineseNumericWithUnit = chineseNumericWithUnit.ChineseNumericWithUnit; + +exports.JapaneseNumericWithUnit = japaneseNumericWithUnit.JapaneseNumericWithUnit; + +}); + +var recognizersTextNumberWithUnit$1 = unwrapExports(recognizersTextNumberWithUnit); +var recognizersTextNumberWithUnit_1 = recognizersTextNumberWithUnit.NumberWithUnitRecognizer; +var recognizersTextNumberWithUnit_2 = recognizersTextNumberWithUnit.NumberWithUnitOptions; +var recognizersTextNumberWithUnit_3 = recognizersTextNumberWithUnit.recognizeTemperature; +var recognizersTextNumberWithUnit_4 = recognizersTextNumberWithUnit.recognizeDimension; +var recognizersTextNumberWithUnit_5 = recognizersTextNumberWithUnit.recognizeCurrency; +var recognizersTextNumberWithUnit_6 = recognizersTextNumberWithUnit.recognizeAge; +var recognizersTextNumberWithUnit_7 = recognizersTextNumberWithUnit.Culture; +var recognizersTextNumberWithUnit_8 = recognizersTextNumberWithUnit.CultureInfo; +var recognizersTextNumberWithUnit_9 = recognizersTextNumberWithUnit.Constants; +var recognizersTextNumberWithUnit_10 = recognizersTextNumberWithUnit.NumberWithUnitExtractor; +var recognizersTextNumberWithUnit_11 = recognizersTextNumberWithUnit.PrefixUnitResult; +var recognizersTextNumberWithUnit_12 = recognizersTextNumberWithUnit.BaseMergedUnitExtractor; +var recognizersTextNumberWithUnit_13 = recognizersTextNumberWithUnit.CompositeEntityType; +var recognizersTextNumberWithUnit_14 = recognizersTextNumberWithUnit.AbstractNumberWithUnitModel; +var recognizersTextNumberWithUnit_15 = recognizersTextNumberWithUnit.AgeModel; +var recognizersTextNumberWithUnit_16 = recognizersTextNumberWithUnit.CurrencyModel; +var recognizersTextNumberWithUnit_17 = recognizersTextNumberWithUnit.DimensionModel; +var recognizersTextNumberWithUnit_18 = recognizersTextNumberWithUnit.TemperatureModel; +var recognizersTextNumberWithUnit_19 = recognizersTextNumberWithUnit.UnitValue; +var recognizersTextNumberWithUnit_20 = recognizersTextNumberWithUnit.UnitValueIso; +var recognizersTextNumberWithUnit_21 = recognizersTextNumberWithUnit.NumberWithUnitParser; +var recognizersTextNumberWithUnit_22 = recognizersTextNumberWithUnit.BaseNumberWithUnitParserConfiguration; +var recognizersTextNumberWithUnit_23 = recognizersTextNumberWithUnit.BaseCurrencyParser; +var recognizersTextNumberWithUnit_24 = recognizersTextNumberWithUnit.BaseMergedUnitParser; +var recognizersTextNumberWithUnit_25 = recognizersTextNumberWithUnit.EnglishAgeExtractorConfiguration; +var recognizersTextNumberWithUnit_26 = recognizersTextNumberWithUnit.EnglishAgeParserConfiguration; +var recognizersTextNumberWithUnit_27 = recognizersTextNumberWithUnit.EnglishNumberWithUnitExtractorConfiguration; +var recognizersTextNumberWithUnit_28 = recognizersTextNumberWithUnit.EnglishNumberWithUnitParserConfiguration; +var recognizersTextNumberWithUnit_29 = recognizersTextNumberWithUnit.EnglishCurrencyExtractorConfiguration; +var recognizersTextNumberWithUnit_30 = recognizersTextNumberWithUnit.EnglishCurrencyParserConfiguration; +var recognizersTextNumberWithUnit_31 = recognizersTextNumberWithUnit.EnglishDimensionExtractorConfiguration; +var recognizersTextNumberWithUnit_32 = recognizersTextNumberWithUnit.EnglishDimensionParserConfiguration; +var recognizersTextNumberWithUnit_33 = recognizersTextNumberWithUnit.EnglishTemperatureExtractorConfiguration; +var recognizersTextNumberWithUnit_34 = recognizersTextNumberWithUnit.EnglishTemperatureParserConfiguration; +var recognizersTextNumberWithUnit_35 = recognizersTextNumberWithUnit.SpanishAgeExtractorConfiguration; +var recognizersTextNumberWithUnit_36 = recognizersTextNumberWithUnit.SpanishAgeParserConfiguration; +var recognizersTextNumberWithUnit_37 = recognizersTextNumberWithUnit.SpanishNumberWithUnitExtractorConfiguration; +var recognizersTextNumberWithUnit_38 = recognizersTextNumberWithUnit.SpanishNumberWithUnitParserConfiguration; +var recognizersTextNumberWithUnit_39 = recognizersTextNumberWithUnit.SpanishCurrencyExtractorConfiguration; +var recognizersTextNumberWithUnit_40 = recognizersTextNumberWithUnit.SpanishCurrencyParserConfiguration; +var recognizersTextNumberWithUnit_41 = recognizersTextNumberWithUnit.SpanishDimensionExtractorConfiguration; +var recognizersTextNumberWithUnit_42 = recognizersTextNumberWithUnit.SpanishDimensionParserConfiguration; +var recognizersTextNumberWithUnit_43 = recognizersTextNumberWithUnit.SpanishTemperatureExtractorConfiguration; +var recognizersTextNumberWithUnit_44 = recognizersTextNumberWithUnit.SpanishTemperatureParserConfiguration; +var recognizersTextNumberWithUnit_45 = recognizersTextNumberWithUnit.PortugueseAgeExtractorConfiguration; +var recognizersTextNumberWithUnit_46 = recognizersTextNumberWithUnit.PortugueseAgeParserConfiguration; +var recognizersTextNumberWithUnit_47 = recognizersTextNumberWithUnit.PortugueseNumberWithUnitExtractorConfiguration; +var recognizersTextNumberWithUnit_48 = recognizersTextNumberWithUnit.PortugueseNumberWithUnitParserConfiguration; +var recognizersTextNumberWithUnit_49 = recognizersTextNumberWithUnit.PortugueseCurrencyExtractorConfiguration; +var recognizersTextNumberWithUnit_50 = recognizersTextNumberWithUnit.PortugueseCurrencyParserConfiguration; +var recognizersTextNumberWithUnit_51 = recognizersTextNumberWithUnit.PortugueseDimensionExtractorConfiguration; +var recognizersTextNumberWithUnit_52 = recognizersTextNumberWithUnit.PortugueseDimensionParserConfiguration; +var recognizersTextNumberWithUnit_53 = recognizersTextNumberWithUnit.PortugueseTemperatureExtractorConfiguration; +var recognizersTextNumberWithUnit_54 = recognizersTextNumberWithUnit.PortugueseTemperatureParserConfiguration; +var recognizersTextNumberWithUnit_55 = recognizersTextNumberWithUnit.ChineseAgeExtractorConfiguration; +var recognizersTextNumberWithUnit_56 = recognizersTextNumberWithUnit.ChineseAgeParserConfiguration; +var recognizersTextNumberWithUnit_57 = recognizersTextNumberWithUnit.ChineseNumberWithUnitExtractorConfiguration; +var recognizersTextNumberWithUnit_58 = recognizersTextNumberWithUnit.ChineseNumberWithUnitParserConfiguration; +var recognizersTextNumberWithUnit_59 = recognizersTextNumberWithUnit.ChineseCurrencyExtractorConfiguration; +var recognizersTextNumberWithUnit_60 = recognizersTextNumberWithUnit.ChineseCurrencyParserConfiguration; +var recognizersTextNumberWithUnit_61 = recognizersTextNumberWithUnit.ChineseDimensionExtractorConfiguration; +var recognizersTextNumberWithUnit_62 = recognizersTextNumberWithUnit.ChineseDimensionParserConfiguration; +var recognizersTextNumberWithUnit_63 = recognizersTextNumberWithUnit.ChineseTemperatureExtractorConfiguration; +var recognizersTextNumberWithUnit_64 = recognizersTextNumberWithUnit.ChineseTemperatureParserConfiguration; +var recognizersTextNumberWithUnit_65 = recognizersTextNumberWithUnit.JapaneseAgeExtractorConfiguration; +var recognizersTextNumberWithUnit_66 = recognizersTextNumberWithUnit.JapaneseAgeParserConfiguration; +var recognizersTextNumberWithUnit_67 = recognizersTextNumberWithUnit.JapaneseNumberWithUnitExtractorConfiguration; +var recognizersTextNumberWithUnit_68 = recognizersTextNumberWithUnit.JapaneseNumberWithUnitParserConfiguration; +var recognizersTextNumberWithUnit_69 = recognizersTextNumberWithUnit.JapaneseCurrencyExtractorConfiguration; +var recognizersTextNumberWithUnit_70 = recognizersTextNumberWithUnit.JapaneseCurrencyParserConfiguration; +var recognizersTextNumberWithUnit_71 = recognizersTextNumberWithUnit.EnglishNumericWithUnit; +var recognizersTextNumberWithUnit_72 = recognizersTextNumberWithUnit.SpanishNumericWithUnit; +var recognizersTextNumberWithUnit_73 = recognizersTextNumberWithUnit.PortugueseNumericWithUnit; +var recognizersTextNumberWithUnit_74 = recognizersTextNumberWithUnit.ChineseNumericWithUnit; +var recognizersTextNumberWithUnit_75 = recognizersTextNumberWithUnit.JapaneseNumericWithUnit; + +export { recognizersTextNumberWithUnit_1 as NumberWithUnitRecognizer, recognizersTextNumberWithUnit_2 as NumberWithUnitOptions, recognizersTextNumberWithUnit_3 as recognizeTemperature, recognizersTextNumberWithUnit_4 as recognizeDimension, recognizersTextNumberWithUnit_5 as recognizeCurrency, recognizersTextNumberWithUnit_6 as recognizeAge, recognizersTextNumberWithUnit_7 as Culture, recognizersTextNumberWithUnit_8 as CultureInfo, recognizersTextNumberWithUnit_9 as Constants, recognizersTextNumberWithUnit_10 as NumberWithUnitExtractor, recognizersTextNumberWithUnit_11 as PrefixUnitResult, recognizersTextNumberWithUnit_12 as BaseMergedUnitExtractor, recognizersTextNumberWithUnit_13 as CompositeEntityType, recognizersTextNumberWithUnit_14 as AbstractNumberWithUnitModel, recognizersTextNumberWithUnit_15 as AgeModel, recognizersTextNumberWithUnit_16 as CurrencyModel, recognizersTextNumberWithUnit_17 as DimensionModel, recognizersTextNumberWithUnit_18 as TemperatureModel, recognizersTextNumberWithUnit_19 as UnitValue, recognizersTextNumberWithUnit_20 as UnitValueIso, recognizersTextNumberWithUnit_21 as NumberWithUnitParser, recognizersTextNumberWithUnit_22 as BaseNumberWithUnitParserConfiguration, recognizersTextNumberWithUnit_23 as BaseCurrencyParser, recognizersTextNumberWithUnit_24 as BaseMergedUnitParser, recognizersTextNumberWithUnit_25 as EnglishAgeExtractorConfiguration, recognizersTextNumberWithUnit_26 as EnglishAgeParserConfiguration, recognizersTextNumberWithUnit_27 as EnglishNumberWithUnitExtractorConfiguration, recognizersTextNumberWithUnit_28 as EnglishNumberWithUnitParserConfiguration, recognizersTextNumberWithUnit_29 as EnglishCurrencyExtractorConfiguration, recognizersTextNumberWithUnit_30 as EnglishCurrencyParserConfiguration, recognizersTextNumberWithUnit_31 as EnglishDimensionExtractorConfiguration, recognizersTextNumberWithUnit_32 as EnglishDimensionParserConfiguration, recognizersTextNumberWithUnit_33 as EnglishTemperatureExtractorConfiguration, recognizersTextNumberWithUnit_34 as EnglishTemperatureParserConfiguration, recognizersTextNumberWithUnit_35 as SpanishAgeExtractorConfiguration, recognizersTextNumberWithUnit_36 as SpanishAgeParserConfiguration, recognizersTextNumberWithUnit_37 as SpanishNumberWithUnitExtractorConfiguration, recognizersTextNumberWithUnit_38 as SpanishNumberWithUnitParserConfiguration, recognizersTextNumberWithUnit_39 as SpanishCurrencyExtractorConfiguration, recognizersTextNumberWithUnit_40 as SpanishCurrencyParserConfiguration, recognizersTextNumberWithUnit_41 as SpanishDimensionExtractorConfiguration, recognizersTextNumberWithUnit_42 as SpanishDimensionParserConfiguration, recognizersTextNumberWithUnit_43 as SpanishTemperatureExtractorConfiguration, recognizersTextNumberWithUnit_44 as SpanishTemperatureParserConfiguration, recognizersTextNumberWithUnit_45 as PortugueseAgeExtractorConfiguration, recognizersTextNumberWithUnit_46 as PortugueseAgeParserConfiguration, recognizersTextNumberWithUnit_47 as PortugueseNumberWithUnitExtractorConfiguration, recognizersTextNumberWithUnit_48 as PortugueseNumberWithUnitParserConfiguration, recognizersTextNumberWithUnit_49 as PortugueseCurrencyExtractorConfiguration, recognizersTextNumberWithUnit_50 as PortugueseCurrencyParserConfiguration, recognizersTextNumberWithUnit_51 as PortugueseDimensionExtractorConfiguration, recognizersTextNumberWithUnit_52 as PortugueseDimensionParserConfiguration, recognizersTextNumberWithUnit_53 as PortugueseTemperatureExtractorConfiguration, recognizersTextNumberWithUnit_54 as PortugueseTemperatureParserConfiguration, recognizersTextNumberWithUnit_55 as ChineseAgeExtractorConfiguration, recognizersTextNumberWithUnit_56 as ChineseAgeParserConfiguration, recognizersTextNumberWithUnit_57 as ChineseNumberWithUnitExtractorConfiguration, recognizersTextNumberWithUnit_58 as ChineseNumberWithUnitParserConfiguration, recognizersTextNumberWithUnit_59 as ChineseCurrencyExtractorConfiguration, recognizersTextNumberWithUnit_60 as ChineseCurrencyParserConfiguration, recognizersTextNumberWithUnit_61 as ChineseDimensionExtractorConfiguration, recognizersTextNumberWithUnit_62 as ChineseDimensionParserConfiguration, recognizersTextNumberWithUnit_63 as ChineseTemperatureExtractorConfiguration, recognizersTextNumberWithUnit_64 as ChineseTemperatureParserConfiguration, recognizersTextNumberWithUnit_65 as JapaneseAgeExtractorConfiguration, recognizersTextNumberWithUnit_66 as JapaneseAgeParserConfiguration, recognizersTextNumberWithUnit_67 as JapaneseNumberWithUnitExtractorConfiguration, recognizersTextNumberWithUnit_68 as JapaneseNumberWithUnitParserConfiguration, recognizersTextNumberWithUnit_69 as JapaneseCurrencyExtractorConfiguration, recognizersTextNumberWithUnit_70 as JapaneseCurrencyParserConfiguration, recognizersTextNumberWithUnit_71 as EnglishNumericWithUnit, recognizersTextNumberWithUnit_72 as SpanishNumericWithUnit, recognizersTextNumberWithUnit_73 as PortugueseNumericWithUnit, recognizersTextNumberWithUnit_74 as ChineseNumericWithUnit, recognizersTextNumberWithUnit_75 as JapaneseNumericWithUnit }; +export default recognizersTextNumberWithUnit$1; +//# sourceMappingURL=recognizers-text-number-with-unit.es5.js.map diff --git a/libraries/botbuilder-stdlib/vendors/@microsoft/recognizers-text-number-with-unit/dist/recognizers-text-number-with-unit.umd.js b/libraries/botbuilder-stdlib/vendors/@microsoft/recognizers-text-number-with-unit/dist/recognizers-text-number-with-unit.umd.js new file mode 100644 index 0000000000..53c62e546c --- /dev/null +++ b/libraries/botbuilder-stdlib/vendors/@microsoft/recognizers-text-number-with-unit/dist/recognizers-text-number-with-unit.umd.js @@ -0,0 +1,19052 @@ +(function (global, factory) { + typeof exports === 'object' && typeof module !== 'undefined' ? factory(exports) : + typeof define === 'function' && define.amd ? define(['exports'], factory) : + (factory((global.microsoftRecognizersTextNumberWithUnit = {}))); +}(this, (function (exports) { 'use strict'; + +var commonjsGlobal = typeof window !== 'undefined' ? window : typeof global !== 'undefined' ? global : typeof self !== 'undefined' ? self : {}; + + + +function unwrapExports (x) { + return x && x.__esModule && Object.prototype.hasOwnProperty.call(x, 'default') ? x['default'] : x; +} + +function createCommonjsModule(fn, module) { + return module = { exports: {} }, fn(module, module.exports), module.exports; +} + +var culture = createCommonjsModule(function (module, exports) { +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +class Culture { + constructor(cultureName, cultureCode) { + this.cultureName = cultureName; + this.cultureCode = cultureCode; + } + static getSupportedCultureCodes() { + return Culture.supportedCultures.map(c => c.cultureCode); + } + static mapToNearestLanguage(cultureCode) { + if (cultureCode !== undefined) { + cultureCode = cultureCode.toLowerCase(); + var supportedCultureCodes = Culture.getSupportedCultureCodes(); + if (supportedCultureCodes.indexOf(cultureCode) < 0) { + var culturePrefix = cultureCode.split('-')[0].trim(); + supportedCultureCodes.forEach(function (supportedCultureCode) { + if (supportedCultureCode.startsWith(culturePrefix)) { + cultureCode = supportedCultureCode; + } + }); + } + } + return cultureCode; + } +} +Culture.English = "en-us"; +Culture.Chinese = "zh-cn"; +Culture.Spanish = "es-es"; +Culture.Portuguese = "pt-br"; +Culture.French = "fr-fr"; +Culture.German = "de-de"; +Culture.Japanese = "ja-jp"; +Culture.Dutch = "nl-nl"; +Culture.Italian = "it-it"; +Culture.supportedCultures = [ + new Culture("English", Culture.English), + new Culture("Chinese", Culture.Chinese), + new Culture("Spanish", Culture.Spanish), + new Culture("Portuguese", Culture.Portuguese), + new Culture("French", Culture.French), + new Culture("German", Culture.German), + new Culture("Japanese", Culture.Japanese), + new Culture("Dutch", Culture.Dutch), + new Culture("Italian", Culture.Italian) +]; +exports.Culture = Culture; +class CultureInfo { + static getCultureInfo(cultureCode) { + return new CultureInfo(cultureCode); + } + constructor(cultureName) { + this.code = cultureName; + } +} +exports.CultureInfo = CultureInfo; + +}); + +unwrapExports(culture); + +var xregexp = createCommonjsModule(function (module, exports) { +"use strict"; + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.default = void 0; + +function _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _nonIterableRest(); } + +function _nonIterableRest() { throw new TypeError("Invalid attempt to destructure non-iterable instance"); } + +function _iterableToArrayLimit(arr, i) { var _arr = []; var _n = true; var _d = false; var _e = undefined; try { for (var _i = arr[Symbol.iterator](), _s; !(_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; } + +function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; } + +/*! + * XRegExp 4.2.0 + * + * Steven Levithan (c) 2007-present MIT License + */ + +/** + * XRegExp provides augmented, extensible regular expressions. You get additional regex syntax and + * flags, beyond what browsers support natively. XRegExp is also a regex utility belt with tools to + * make your client-side grepping simpler and more powerful, while freeing you from related + * cross-browser inconsistencies. + */ +// ==--------------------------== +// Private stuff +// ==--------------------------== +// Property name used for extended regex instance data +var REGEX_DATA = 'xregexp'; // Optional features that can be installed and uninstalled + +var features = { + astral: false, + namespacing: false +}; // Native methods to use and restore ('native' is an ES3 reserved keyword) + +var nativ = { + exec: RegExp.prototype.exec, + test: RegExp.prototype.test, + match: String.prototype.match, + replace: String.prototype.replace, + split: String.prototype.split +}; // Storage for fixed/extended native methods + +var fixed = {}; // Storage for regexes cached by `XRegExp.cache` + +var regexCache = {}; // Storage for pattern details cached by the `XRegExp` constructor + +var patternCache = {}; // Storage for regex syntax tokens added internally or by `XRegExp.addToken` + +var tokens = []; // Token scopes + +var defaultScope = 'default'; +var classScope = 'class'; // Regexes that match native regex syntax, including octals + +var nativeTokens = { + // Any native multicharacter token in default scope, or any single character + 'default': /\\(?:0(?:[0-3][0-7]{0,2}|[4-7][0-7]?)?|[1-9]\d*|x[\dA-Fa-f]{2}|u(?:[\dA-Fa-f]{4}|{[\dA-Fa-f]+})|c[A-Za-z]|[\s\S])|\(\?(?:[:=!]|<[=!])|[?*+]\?|{\d+(?:,\d*)?}\??|[\s\S]/, + // Any native multicharacter token in character class scope, or any single character + 'class': /\\(?:[0-3][0-7]{0,2}|[4-7][0-7]?|x[\dA-Fa-f]{2}|u(?:[\dA-Fa-f]{4}|{[\dA-Fa-f]+})|c[A-Za-z]|[\s\S])|[\s\S]/ +}; // Any backreference or dollar-prefixed character in replacement strings + +var replacementToken = /\$(?:{([\w$]+)}|<([\w$]+)>|(\d\d?|[\s\S]))/g; // Check for correct `exec` handling of nonparticipating capturing groups + +var correctExecNpcg = nativ.exec.call(/()??/, '')[1] === undefined; // Check for ES6 `flags` prop support + +var hasFlagsProp = /x/.flags !== undefined; // Shortcut to `Object.prototype.toString` + +var _ref = {}, + toString = _ref.toString; + +function hasNativeFlag(flag) { + // Can't check based on the presence of properties/getters since browsers might support such + // properties even when they don't support the corresponding flag in regex construction (tested + // in Chrome 48, where `'unicode' in /x/` is true but trying to construct a regex with flag `u` + // throws an error) + var isSupported = true; + + try { + // Can't use regex literals for testing even in a `try` because regex literals with + // unsupported flags cause a compilation error in IE + new RegExp('', flag); + } catch (exception) { + isSupported = false; + } + + return isSupported; +} // Check for ES6 `u` flag support + + +var hasNativeU = hasNativeFlag('u'); // Check for ES6 `y` flag support + +var hasNativeY = hasNativeFlag('y'); // Tracker for known flags, including addon flags + +var registeredFlags = { + g: true, + i: true, + m: true, + u: hasNativeU, + y: hasNativeY +}; +/** + * Attaches extended data and `XRegExp.prototype` properties to a regex object. + * + * @private + * @param {RegExp} regex Regex to augment. + * @param {Array} captureNames Array with capture names, or `null`. + * @param {String} xSource XRegExp pattern used to generate `regex`, or `null` if N/A. + * @param {String} xFlags XRegExp flags used to generate `regex`, or `null` if N/A. + * @param {Boolean} [isInternalOnly=false] Whether the regex will be used only for internal + * operations, and never exposed to users. For internal-only regexes, we can improve perf by + * skipping some operations like attaching `XRegExp.prototype` properties. + * @returns {RegExp} Augmented regex. + */ + +function augment(regex, captureNames, xSource, xFlags, isInternalOnly) { + regex[REGEX_DATA] = { + captureNames: captureNames + }; + + if (isInternalOnly) { + return regex; + } // Can't auto-inherit these since the XRegExp constructor returns a nonprimitive value + + + if (regex.__proto__) { + regex.__proto__ = XRegExp.prototype; + } else { + for (var p in XRegExp.prototype) { + // An `XRegExp.prototype.hasOwnProperty(p)` check wouldn't be worth it here, since this + // is performance sensitive, and enumerable `Object.prototype` or `RegExp.prototype` + // extensions exist on `regex.prototype` anyway + regex[p] = XRegExp.prototype[p]; + } + } + + regex[REGEX_DATA].source = xSource; // Emulate the ES6 `flags` prop by ensuring flags are in alphabetical order + + regex[REGEX_DATA].flags = xFlags ? xFlags.split('').sort().join('') : xFlags; + return regex; +} +/** + * Removes any duplicate characters from the provided string. + * + * @private + * @param {String} str String to remove duplicate characters from. + * @returns {String} String with any duplicate characters removed. + */ + + +function clipDuplicates(str) { + return nativ.replace.call(str, /([\s\S])(?=[\s\S]*\1)/g, ''); +} +/** + * Copies a regex object while preserving extended data and augmenting with `XRegExp.prototype` + * properties. The copy has a fresh `lastIndex` property (set to zero). Allows adding and removing + * flags g and y while copying the regex. + * + * @private + * @param {RegExp} regex Regex to copy. + * @param {Object} [options] Options object with optional properties: + * - `addG` {Boolean} Add flag g while copying the regex. + * - `addY` {Boolean} Add flag y while copying the regex. + * - `removeG` {Boolean} Remove flag g while copying the regex. + * - `removeY` {Boolean} Remove flag y while copying the regex. + * - `isInternalOnly` {Boolean} Whether the copied regex will be used only for internal + * operations, and never exposed to users. For internal-only regexes, we can improve perf by + * skipping some operations like attaching `XRegExp.prototype` properties. + * - `source` {String} Overrides `.source`, for special cases. + * @returns {RegExp} Copy of the provided regex, possibly with modified flags. + */ + + +function copyRegex(regex, options) { + if (!XRegExp.isRegExp(regex)) { + throw new TypeError('Type RegExp expected'); + } + + var xData = regex[REGEX_DATA] || {}; + var flags = getNativeFlags(regex); + var flagsToAdd = ''; + var flagsToRemove = ''; + var xregexpSource = null; + var xregexpFlags = null; + options = options || {}; + + if (options.removeG) { + flagsToRemove += 'g'; + } + + if (options.removeY) { + flagsToRemove += 'y'; + } + + if (flagsToRemove) { + flags = nativ.replace.call(flags, new RegExp("[".concat(flagsToRemove, "]+"), 'g'), ''); + } + + if (options.addG) { + flagsToAdd += 'g'; + } + + if (options.addY) { + flagsToAdd += 'y'; + } + + if (flagsToAdd) { + flags = clipDuplicates(flags + flagsToAdd); + } + + if (!options.isInternalOnly) { + if (xData.source !== undefined) { + xregexpSource = xData.source; + } // null or undefined; don't want to add to `flags` if the previous value was null, since + // that indicates we're not tracking original precompilation flags + + + if (xData.flags != null) { + // Flags are only added for non-internal regexes by `XRegExp.globalize`. Flags are never + // removed for non-internal regexes, so don't need to handle it + xregexpFlags = flagsToAdd ? clipDuplicates(xData.flags + flagsToAdd) : xData.flags; + } + } // Augment with `XRegExp.prototype` properties, but use the native `RegExp` constructor to avoid + // searching for special tokens. That would be wrong for regexes constructed by `RegExp`, and + // unnecessary for regexes constructed by `XRegExp` because the regex has already undergone the + // translation to native regex syntax + + + regex = augment(new RegExp(options.source || regex.source, flags), hasNamedCapture(regex) ? xData.captureNames.slice(0) : null, xregexpSource, xregexpFlags, options.isInternalOnly); + return regex; +} +/** + * Converts hexadecimal to decimal. + * + * @private + * @param {String} hex + * @returns {Number} + */ + + +function dec(hex) { + return parseInt(hex, 16); +} +/** + * Returns a pattern that can be used in a native RegExp in place of an ignorable token such as an + * inline comment or whitespace with flag x. This is used directly as a token handler function + * passed to `XRegExp.addToken`. + * + * @private + * @param {String} match Match arg of `XRegExp.addToken` handler + * @param {String} scope Scope arg of `XRegExp.addToken` handler + * @param {String} flags Flags arg of `XRegExp.addToken` handler + * @returns {String} Either '' or '(?:)', depending on which is needed in the context of the match. + */ + + +function getContextualTokenSeparator(match, scope, flags) { + if ( // No need to separate tokens if at the beginning or end of a group + match.input[match.index - 1] === '(' || match.input[match.index + match[0].length] === ')' || // No need to separate tokens if before or after a `|` + match.input[match.index - 1] === '|' || match.input[match.index + match[0].length] === '|' || // No need to separate tokens if at the beginning or end of the pattern + match.index < 1 || match.index + match[0].length >= match.input.length || // No need to separate tokens if at the beginning of a noncapturing group or lookahead. + // The way this is written relies on: + // - The search regex matching only 3-char strings. + // - Although `substr` gives chars from the end of the string if given a negative index, + // the resulting substring will be too short to match. Ex: `'abcd'.substr(-1, 3) === 'd'` + nativ.test.call(/^\(\?[:=!]/, match.input.substr(match.index - 3, 3)) || // Avoid separating tokens when the following token is a quantifier + isQuantifierNext(match.input, match.index + match[0].length, flags)) { + return ''; + } // Keep tokens separated. This avoids e.g. inadvertedly changing `\1 1` or `\1(?#)1` to `\11`. + // This also ensures all tokens remain as discrete atoms, e.g. it avoids converting the syntax + // error `(? :` into `(?:`. + + + return '(?:)'; +} +/** + * Returns native `RegExp` flags used by a regex object. + * + * @private + * @param {RegExp} regex Regex to check. + * @returns {String} Native flags in use. + */ + + +function getNativeFlags(regex) { + return hasFlagsProp ? regex.flags : // Explicitly using `RegExp.prototype.toString` (rather than e.g. `String` or concatenation + // with an empty string) allows this to continue working predictably when + // `XRegExp.proptotype.toString` is overridden + nativ.exec.call(/\/([a-z]*)$/i, RegExp.prototype.toString.call(regex))[1]; +} +/** + * Determines whether a regex has extended instance data used to track capture names. + * + * @private + * @param {RegExp} regex Regex to check. + * @returns {Boolean} Whether the regex uses named capture. + */ + + +function hasNamedCapture(regex) { + return !!(regex[REGEX_DATA] && regex[REGEX_DATA].captureNames); +} +/** + * Converts decimal to hexadecimal. + * + * @private + * @param {Number|String} dec + * @returns {String} + */ + + +function hex(dec) { + return parseInt(dec, 10).toString(16); +} +/** + * Checks whether the next nonignorable token after the specified position is a quantifier. + * + * @private + * @param {String} pattern Pattern to search within. + * @param {Number} pos Index in `pattern` to search at. + * @param {String} flags Flags used by the pattern. + * @returns {Boolean} Whether the next nonignorable token is a quantifier. + */ + + +function isQuantifierNext(pattern, pos, flags) { + return nativ.test.call(flags.indexOf('x') !== -1 ? // Ignore any leading whitespace, line comments, and inline comments + /^(?:\s|#[^#\n]*|\(\?#[^)]*\))*(?:[?*+]|{\d+(?:,\d*)?})/ : // Ignore any leading inline comments + /^(?:\(\?#[^)]*\))*(?:[?*+]|{\d+(?:,\d*)?})/, pattern.slice(pos)); +} +/** + * Determines whether a value is of the specified type, by resolving its internal [[Class]]. + * + * @private + * @param {*} value Object to check. + * @param {String} type Type to check for, in TitleCase. + * @returns {Boolean} Whether the object matches the type. + */ + + +function isType(value, type) { + return toString.call(value) === "[object ".concat(type, "]"); +} +/** + * Adds leading zeros if shorter than four characters. Used for fixed-length hexadecimal values. + * + * @private + * @param {String} str + * @returns {String} + */ + + +function pad4(str) { + while (str.length < 4) { + str = "0".concat(str); + } + + return str; +} +/** + * Checks for flag-related errors, and strips/applies flags in a leading mode modifier. Offloads + * the flag preparation logic from the `XRegExp` constructor. + * + * @private + * @param {String} pattern Regex pattern, possibly with a leading mode modifier. + * @param {String} flags Any combination of flags. + * @returns {Object} Object with properties `pattern` and `flags`. + */ + + +function prepareFlags(pattern, flags) { + // Recent browsers throw on duplicate flags, so copy this behavior for nonnative flags + if (clipDuplicates(flags) !== flags) { + throw new SyntaxError("Invalid duplicate regex flag ".concat(flags)); + } // Strip and apply a leading mode modifier with any combination of flags except g or y + + + pattern = nativ.replace.call(pattern, /^\(\?([\w$]+)\)/, function ($0, $1) { + if (nativ.test.call(/[gy]/, $1)) { + throw new SyntaxError("Cannot use flag g or y in mode modifier ".concat($0)); + } // Allow duplicate flags within the mode modifier + + + flags = clipDuplicates(flags + $1); + return ''; + }); // Throw on unknown native or nonnative flags + + var _iteratorNormalCompletion = true; + var _didIteratorError = false; + var _iteratorError = undefined; + + try { + for (var _iterator = flags[Symbol.iterator](), _step; !(_iteratorNormalCompletion = (_step = _iterator.next()).done); _iteratorNormalCompletion = true) { + var flag = _step.value; + + if (!registeredFlags[flag]) { + throw new SyntaxError("Unknown regex flag ".concat(flag)); + } + } + } catch (err) { + _didIteratorError = true; + _iteratorError = err; + } finally { + try { + if (!_iteratorNormalCompletion && _iterator.return != null) { + _iterator.return(); + } + } finally { + if (_didIteratorError) { + throw _iteratorError; + } + } + } + + return { + pattern: pattern, + flags: flags + }; +} +/** + * Prepares an options object from the given value. + * + * @private + * @param {String|Object} value Value to convert to an options object. + * @returns {Object} Options object. + */ + + +function prepareOptions(value) { + var options = {}; + + if (isType(value, 'String')) { + XRegExp.forEach(value, /[^\s,]+/, function (match) { + options[match] = true; + }); + return options; + } + + return value; +} +/** + * Registers a flag so it doesn't throw an 'unknown flag' error. + * + * @private + * @param {String} flag Single-character flag to register. + */ + + +function registerFlag(flag) { + if (!/^[\w$]$/.test(flag)) { + throw new Error('Flag must be a single character A-Za-z0-9_$'); + } + + registeredFlags[flag] = true; +} +/** + * Runs built-in and custom regex syntax tokens in reverse insertion order at the specified + * position, until a match is found. + * + * @private + * @param {String} pattern Original pattern from which an XRegExp object is being built. + * @param {String} flags Flags being used to construct the regex. + * @param {Number} pos Position to search for tokens within `pattern`. + * @param {Number} scope Regex scope to apply: 'default' or 'class'. + * @param {Object} context Context object to use for token handler functions. + * @returns {Object} Object with properties `matchLength`, `output`, and `reparse`; or `null`. + */ + + +function runTokens(pattern, flags, pos, scope, context) { + var i = tokens.length; + var leadChar = pattern[pos]; + var result = null; + var match; + var t; // Run in reverse insertion order + + while (i--) { + t = tokens[i]; + + if (t.leadChar && t.leadChar !== leadChar || t.scope !== scope && t.scope !== 'all' || t.flag && !(flags.indexOf(t.flag) !== -1)) { + continue; + } + + match = XRegExp.exec(pattern, t.regex, pos, 'sticky'); + + if (match) { + result = { + matchLength: match[0].length, + output: t.handler.call(context, match, scope, flags), + reparse: t.reparse + }; // Finished with token tests + + break; + } + } + + return result; +} +/** + * Enables or disables implicit astral mode opt-in. When enabled, flag A is automatically added to + * all new regexes created by XRegExp. This causes an error to be thrown when creating regexes if + * the Unicode Base addon is not available, since flag A is registered by that addon. + * + * @private + * @param {Boolean} on `true` to enable; `false` to disable. + */ + + +function setAstral(on) { + features.astral = on; +} +/** + * Adds named capture groups to the `groups` property of match arrays. See here for details: + * https://github.com/tc39/proposal-regexp-named-groups + * + * @private + * @param {Boolean} on `true` to enable; `false` to disable. + */ + + +function setNamespacing(on) { + features.namespacing = on; +} +/** + * Returns the object, or throws an error if it is `null` or `undefined`. This is used to follow + * the ES5 abstract operation `ToObject`. + * + * @private + * @param {*} value Object to check and return. + * @returns {*} The provided object. + */ + + +function toObject(value) { + // null or undefined + if (value == null) { + throw new TypeError('Cannot convert null or undefined to object'); + } + + return value; +} // ==--------------------------== +// Constructor +// ==--------------------------== + +/** + * Creates an extended regular expression object for matching text with a pattern. Differs from a + * native regular expression in that additional syntax and flags are supported. The returned object + * is in fact a native `RegExp` and works with all native methods. + * + * @class XRegExp + * @constructor + * @param {String|RegExp} pattern Regex pattern string, or an existing regex object to copy. + * @param {String} [flags] Any combination of flags. + * Native flags: + * - `g` - global + * - `i` - ignore case + * - `m` - multiline anchors + * - `u` - unicode (ES6) + * - `y` - sticky (Firefox 3+, ES6) + * Additional XRegExp flags: + * - `n` - explicit capture + * - `s` - dot matches all (aka singleline) + * - `x` - free-spacing and line comments (aka extended) + * - `A` - astral (requires the Unicode Base addon) + * Flags cannot be provided when constructing one `RegExp` from another. + * @returns {RegExp} Extended regular expression object. + * @example + * + * // With named capture and flag x + * XRegExp(`(? [0-9]{4} ) -? # year + * (? [0-9]{2} ) -? # month + * (? [0-9]{2} ) # day`, 'x'); + * + * // Providing a regex object copies it. Native regexes are recompiled using native (not XRegExp) + * // syntax. Copies maintain extended data, are augmented with `XRegExp.prototype` properties, and + * // have fresh `lastIndex` properties (set to zero). + * XRegExp(/regex/); + */ + + +function XRegExp(pattern, flags) { + if (XRegExp.isRegExp(pattern)) { + if (flags !== undefined) { + throw new TypeError('Cannot supply flags when copying a RegExp'); + } + + return copyRegex(pattern); + } // Copy the argument behavior of `RegExp` + + + pattern = pattern === undefined ? '' : String(pattern); + flags = flags === undefined ? '' : String(flags); + + if (XRegExp.isInstalled('astral') && !(flags.indexOf('A') !== -1)) { + // This causes an error to be thrown if the Unicode Base addon is not available + flags += 'A'; + } + + if (!patternCache[pattern]) { + patternCache[pattern] = {}; + } + + if (!patternCache[pattern][flags]) { + var context = { + hasNamedCapture: false, + captureNames: [] + }; + var scope = defaultScope; + var output = ''; + var pos = 0; + var result; // Check for flag-related errors, and strip/apply flags in a leading mode modifier + + var applied = prepareFlags(pattern, flags); + var appliedPattern = applied.pattern; + var appliedFlags = applied.flags; // Use XRegExp's tokens to translate the pattern to a native regex pattern. + // `appliedPattern.length` may change on each iteration if tokens use `reparse` + + while (pos < appliedPattern.length) { + do { + // Check for custom tokens at the current position + result = runTokens(appliedPattern, appliedFlags, pos, scope, context); // If the matched token used the `reparse` option, splice its output into the + // pattern before running tokens again at the same position + + if (result && result.reparse) { + appliedPattern = appliedPattern.slice(0, pos) + result.output + appliedPattern.slice(pos + result.matchLength); + } + } while (result && result.reparse); + + if (result) { + output += result.output; + pos += result.matchLength || 1; + } else { + // Get the native token at the current position + var _XRegExp$exec = XRegExp.exec(appliedPattern, nativeTokens[scope], pos, 'sticky'), + _XRegExp$exec2 = _slicedToArray(_XRegExp$exec, 1), + token = _XRegExp$exec2[0]; + + output += token; + pos += token.length; + + if (token === '[' && scope === defaultScope) { + scope = classScope; + } else if (token === ']' && scope === classScope) { + scope = defaultScope; + } + } + } + + patternCache[pattern][flags] = { + // Use basic cleanup to collapse repeated empty groups like `(?:)(?:)` to `(?:)`. Empty + // groups are sometimes inserted during regex transpilation in order to keep tokens + // separated. However, more than one empty group in a row is never needed. + pattern: nativ.replace.call(output, /(?:\(\?:\))+/g, '(?:)'), + // Strip all but native flags + flags: nativ.replace.call(appliedFlags, /[^gimuy]+/g, ''), + // `context.captureNames` has an item for each capturing group, even if unnamed + captures: context.hasNamedCapture ? context.captureNames : null + }; + } + + var generated = patternCache[pattern][flags]; + return augment(new RegExp(generated.pattern, generated.flags), generated.captures, pattern, flags); +} // Add `RegExp.prototype` to the prototype chain + + +XRegExp.prototype = /(?:)/; // ==--------------------------== +// Public properties +// ==--------------------------== + +/** + * The XRegExp version number as a string containing three dot-separated parts. For example, + * '2.0.0-beta-3'. + * + * @static + * @memberOf XRegExp + * @type String + */ + +XRegExp.version = '4.2.0'; // ==--------------------------== +// Public methods +// ==--------------------------== +// Intentionally undocumented; used in tests and addons + +XRegExp._clipDuplicates = clipDuplicates; +XRegExp._hasNativeFlag = hasNativeFlag; +XRegExp._dec = dec; +XRegExp._hex = hex; +XRegExp._pad4 = pad4; +/** + * Extends XRegExp syntax and allows custom flags. This is used internally and can be used to + * create XRegExp addons. If more than one token can match the same string, the last added wins. + * + * @memberOf XRegExp + * @param {RegExp} regex Regex object that matches the new token. + * @param {Function} handler Function that returns a new pattern string (using native regex syntax) + * to replace the matched token within all future XRegExp regexes. Has access to persistent + * properties of the regex being built, through `this`. Invoked with three arguments: + * - The match array, with named backreference properties. + * - The regex scope where the match was found: 'default' or 'class'. + * - The flags used by the regex, including any flags in a leading mode modifier. + * The handler function becomes part of the XRegExp construction process, so be careful not to + * construct XRegExps within the function or you will trigger infinite recursion. + * @param {Object} [options] Options object with optional properties: + * - `scope` {String} Scope where the token applies: 'default', 'class', or 'all'. + * - `flag` {String} Single-character flag that triggers the token. This also registers the + * flag, which prevents XRegExp from throwing an 'unknown flag' error when the flag is used. + * - `optionalFlags` {String} Any custom flags checked for within the token `handler` that are + * not required to trigger the token. This registers the flags, to prevent XRegExp from + * throwing an 'unknown flag' error when any of the flags are used. + * - `reparse` {Boolean} Whether the `handler` function's output should not be treated as + * final, and instead be reparseable by other tokens (including the current token). Allows + * token chaining or deferring. + * - `leadChar` {String} Single character that occurs at the beginning of any successful match + * of the token (not always applicable). This doesn't change the behavior of the token unless + * you provide an erroneous value. However, providing it can increase the token's performance + * since the token can be skipped at any positions where this character doesn't appear. + * @example + * + * // Basic usage: Add \a for the ALERT control code + * XRegExp.addToken( + * /\\a/, + * () => '\\x07', + * {scope: 'all'} + * ); + * XRegExp('\\a[\\a-\\n]+').test('\x07\n\x07'); // -> true + * + * // Add the U (ungreedy) flag from PCRE and RE2, which reverses greedy and lazy quantifiers. + * // Since `scope` is not specified, it uses 'default' (i.e., transformations apply outside of + * // character classes only) + * XRegExp.addToken( + * /([?*+]|{\d+(?:,\d*)?})(\??)/, + * (match) => `${match[1]}${match[2] ? '' : '?'}`, + * {flag: 'U'} + * ); + * XRegExp('a+', 'U').exec('aaa')[0]; // -> 'a' + * XRegExp('a+?', 'U').exec('aaa')[0]; // -> 'aaa' + */ + +XRegExp.addToken = function (regex, handler, options) { + options = options || {}; + var _options = options, + optionalFlags = _options.optionalFlags; + + if (options.flag) { + registerFlag(options.flag); + } + + if (optionalFlags) { + optionalFlags = nativ.split.call(optionalFlags, ''); + var _iteratorNormalCompletion2 = true; + var _didIteratorError2 = false; + var _iteratorError2 = undefined; + + try { + for (var _iterator2 = optionalFlags[Symbol.iterator](), _step2; !(_iteratorNormalCompletion2 = (_step2 = _iterator2.next()).done); _iteratorNormalCompletion2 = true) { + var flag = _step2.value; + registerFlag(flag); + } + } catch (err) { + _didIteratorError2 = true; + _iteratorError2 = err; + } finally { + try { + if (!_iteratorNormalCompletion2 && _iterator2.return != null) { + _iterator2.return(); + } + } finally { + if (_didIteratorError2) { + throw _iteratorError2; + } + } + } + } // Add to the private list of syntax tokens + + + tokens.push({ + regex: copyRegex(regex, { + addG: true, + addY: hasNativeY, + isInternalOnly: true + }), + handler: handler, + scope: options.scope || defaultScope, + flag: options.flag, + reparse: options.reparse, + leadChar: options.leadChar + }); // Reset the pattern cache used by the `XRegExp` constructor, since the same pattern and flags + // might now produce different results + + XRegExp.cache.flush('patterns'); +}; +/** + * Caches and returns the result of calling `XRegExp(pattern, flags)`. On any subsequent call with + * the same pattern and flag combination, the cached copy of the regex is returned. + * + * @memberOf XRegExp + * @param {String} pattern Regex pattern string. + * @param {String} [flags] Any combination of XRegExp flags. + * @returns {RegExp} Cached XRegExp object. + * @example + * + * while (match = XRegExp.cache('.', 'gs').exec(str)) { + * // The regex is compiled once only + * } + */ + + +XRegExp.cache = function (pattern, flags) { + if (!regexCache[pattern]) { + regexCache[pattern] = {}; + } + + return regexCache[pattern][flags] || (regexCache[pattern][flags] = XRegExp(pattern, flags)); +}; // Intentionally undocumented; used in tests + + +XRegExp.cache.flush = function (cacheName) { + if (cacheName === 'patterns') { + // Flush the pattern cache used by the `XRegExp` constructor + patternCache = {}; + } else { + // Flush the regex cache populated by `XRegExp.cache` + regexCache = {}; + } +}; +/** + * Escapes any regular expression metacharacters, for use when matching literal strings. The result + * can safely be used at any point within a regex that uses any flags. + * + * @memberOf XRegExp + * @param {String} str String to escape. + * @returns {String} String with regex metacharacters escaped. + * @example + * + * XRegExp.escape('Escaped? <.>'); + * // -> 'Escaped\?\ <\.>' + */ + + +XRegExp.escape = function (str) { + return nativ.replace.call(toObject(str), /[-\[\]{}()*+?.,\\^$|#\s]/g, '\\$&'); +}; +/** + * Executes a regex search in a specified string. Returns a match array or `null`. If the provided + * regex uses named capture, named backreference properties are included on the match array. + * Optional `pos` and `sticky` arguments specify the search start position, and whether the match + * must start at the specified position only. The `lastIndex` property of the provided regex is not + * used, but is updated for compatibility. Also fixes browser bugs compared to the native + * `RegExp.prototype.exec` and can be used reliably cross-browser. + * + * @memberOf XRegExp + * @param {String} str String to search. + * @param {RegExp} regex Regex to search with. + * @param {Number} [pos=0] Zero-based index at which to start the search. + * @param {Boolean|String} [sticky=false] Whether the match must start at the specified position + * only. The string `'sticky'` is accepted as an alternative to `true`. + * @returns {Array} Match array with named backreference properties, or `null`. + * @example + * + * // Basic use, with named backreference + * let match = XRegExp.exec('U+2620', XRegExp('U\\+(?[0-9A-F]{4})')); + * match.hex; // -> '2620' + * + * // With pos and sticky, in a loop + * let pos = 2, result = [], match; + * while (match = XRegExp.exec('<1><2><3><4>5<6>', /<(\d)>/, pos, 'sticky')) { + * result.push(match[1]); + * pos = match.index + match[0].length; + * } + * // result -> ['2', '3', '4'] + */ + + +XRegExp.exec = function (str, regex, pos, sticky) { + var cacheKey = 'g'; + var addY = false; + var fakeY = false; + var match; + addY = hasNativeY && !!(sticky || regex.sticky && sticky !== false); + + if (addY) { + cacheKey += 'y'; + } else if (sticky) { + // Simulate sticky matching by appending an empty capture to the original regex. The + // resulting regex will succeed no matter what at the current index (set with `lastIndex`), + // and will not search the rest of the subject string. We'll know that the original regex + // has failed if that last capture is `''` rather than `undefined` (i.e., if that last + // capture participated in the match). + fakeY = true; + cacheKey += 'FakeY'; + } + + regex[REGEX_DATA] = regex[REGEX_DATA] || {}; // Shares cached copies with `XRegExp.match`/`replace` + + var r2 = regex[REGEX_DATA][cacheKey] || (regex[REGEX_DATA][cacheKey] = copyRegex(regex, { + addG: true, + addY: addY, + source: fakeY ? "".concat(regex.source, "|()") : undefined, + removeY: sticky === false, + isInternalOnly: true + })); + pos = pos || 0; + r2.lastIndex = pos; // Fixed `exec` required for `lastIndex` fix, named backreferences, etc. + + match = fixed.exec.call(r2, str); // Get rid of the capture added by the pseudo-sticky matcher if needed. An empty string means + // the original regexp failed (see above). + + if (fakeY && match && match.pop() === '') { + match = null; + } + + if (regex.global) { + regex.lastIndex = match ? r2.lastIndex : 0; + } + + return match; +}; +/** + * Executes a provided function once per regex match. Searches always start at the beginning of the + * string and continue until the end, regardless of the state of the regex's `global` property and + * initial `lastIndex`. + * + * @memberOf XRegExp + * @param {String} str String to search. + * @param {RegExp} regex Regex to search with. + * @param {Function} callback Function to execute for each match. Invoked with four arguments: + * - The match array, with named backreference properties. + * - The zero-based match index. + * - The string being traversed. + * - The regex object being used to traverse the string. + * @example + * + * // Extracts every other digit from a string + * const evens = []; + * XRegExp.forEach('1a2345', /\d/, (match, i) => { + * if (i % 2) evens.push(+match[0]); + * }); + * // evens -> [2, 4] + */ + + +XRegExp.forEach = function (str, regex, callback) { + var pos = 0; + var i = -1; + var match; + + while (match = XRegExp.exec(str, regex, pos)) { + // Because `regex` is provided to `callback`, the function could use the deprecated/ + // nonstandard `RegExp.prototype.compile` to mutate the regex. However, since `XRegExp.exec` + // doesn't use `lastIndex` to set the search position, this can't lead to an infinite loop, + // at least. Actually, because of the way `XRegExp.exec` caches globalized versions of + // regexes, mutating the regex will not have any effect on the iteration or matched strings, + // which is a nice side effect that brings extra safety. + callback(match, ++i, str, regex); + pos = match.index + (match[0].length || 1); + } +}; +/** + * Copies a regex object and adds flag `g`. The copy maintains extended data, is augmented with + * `XRegExp.prototype` properties, and has a fresh `lastIndex` property (set to zero). Native + * regexes are not recompiled using XRegExp syntax. + * + * @memberOf XRegExp + * @param {RegExp} regex Regex to globalize. + * @returns {RegExp} Copy of the provided regex with flag `g` added. + * @example + * + * const globalCopy = XRegExp.globalize(/regex/); + * globalCopy.global; // -> true + */ + + +XRegExp.globalize = function (regex) { + return copyRegex(regex, { + addG: true + }); +}; +/** + * Installs optional features according to the specified options. Can be undone using + * `XRegExp.uninstall`. + * + * @memberOf XRegExp + * @param {Object|String} options Options object or string. + * @example + * + * // With an options object + * XRegExp.install({ + * // Enables support for astral code points in Unicode addons (implicitly sets flag A) + * astral: true, + * + * // Adds named capture groups to the `groups` property of matches + * namespacing: true + * }); + * + * // With an options string + * XRegExp.install('astral namespacing'); + */ + + +XRegExp.install = function (options) { + options = prepareOptions(options); + + if (!features.astral && options.astral) { + setAstral(true); + } + + if (!features.namespacing && options.namespacing) { + setNamespacing(true); + } +}; +/** + * Checks whether an individual optional feature is installed. + * + * @memberOf XRegExp + * @param {String} feature Name of the feature to check. One of: + * - `astral` + * - `namespacing` + * @returns {Boolean} Whether the feature is installed. + * @example + * + * XRegExp.isInstalled('astral'); + */ + + +XRegExp.isInstalled = function (feature) { + return !!features[feature]; +}; +/** + * Returns `true` if an object is a regex; `false` if it isn't. This works correctly for regexes + * created in another frame, when `instanceof` and `constructor` checks would fail. + * + * @memberOf XRegExp + * @param {*} value Object to check. + * @returns {Boolean} Whether the object is a `RegExp` object. + * @example + * + * XRegExp.isRegExp('string'); // -> false + * XRegExp.isRegExp(/regex/i); // -> true + * XRegExp.isRegExp(RegExp('^', 'm')); // -> true + * XRegExp.isRegExp(XRegExp('(?s).')); // -> true + */ + + +XRegExp.isRegExp = function (value) { + return toString.call(value) === '[object RegExp]'; +}; // isType(value, 'RegExp'); + +/** + * Returns the first matched string, or in global mode, an array containing all matched strings. + * This is essentially a more convenient re-implementation of `String.prototype.match` that gives + * the result types you actually want (string instead of `exec`-style array in match-first mode, + * and an empty array instead of `null` when no matches are found in match-all mode). It also lets + * you override flag g and ignore `lastIndex`, and fixes browser bugs. + * + * @memberOf XRegExp + * @param {String} str String to search. + * @param {RegExp} regex Regex to search with. + * @param {String} [scope='one'] Use 'one' to return the first match as a string. Use 'all' to + * return an array of all matched strings. If not explicitly specified and `regex` uses flag g, + * `scope` is 'all'. + * @returns {String|Array} In match-first mode: First match as a string, or `null`. In match-all + * mode: Array of all matched strings, or an empty array. + * @example + * + * // Match first + * XRegExp.match('abc', /\w/); // -> 'a' + * XRegExp.match('abc', /\w/g, 'one'); // -> 'a' + * XRegExp.match('abc', /x/g, 'one'); // -> null + * + * // Match all + * XRegExp.match('abc', /\w/g); // -> ['a', 'b', 'c'] + * XRegExp.match('abc', /\w/, 'all'); // -> ['a', 'b', 'c'] + * XRegExp.match('abc', /x/, 'all'); // -> [] + */ + + +XRegExp.match = function (str, regex, scope) { + var global = regex.global && scope !== 'one' || scope === 'all'; + var cacheKey = (global ? 'g' : '') + (regex.sticky ? 'y' : '') || 'noGY'; + regex[REGEX_DATA] = regex[REGEX_DATA] || {}; // Shares cached copies with `XRegExp.exec`/`replace` + + var r2 = regex[REGEX_DATA][cacheKey] || (regex[REGEX_DATA][cacheKey] = copyRegex(regex, { + addG: !!global, + removeG: scope === 'one', + isInternalOnly: true + })); + var result = nativ.match.call(toObject(str), r2); + + if (regex.global) { + regex.lastIndex = scope === 'one' && result ? // Can't use `r2.lastIndex` since `r2` is nonglobal in this case + result.index + result[0].length : 0; + } + + return global ? result || [] : result && result[0]; +}; +/** + * Retrieves the matches from searching a string using a chain of regexes that successively search + * within previous matches. The provided `chain` array can contain regexes and or objects with + * `regex` and `backref` properties. When a backreference is specified, the named or numbered + * backreference is passed forward to the next regex or returned. + * + * @memberOf XRegExp + * @param {String} str String to search. + * @param {Array} chain Regexes that each search for matches within preceding results. + * @returns {Array} Matches by the last regex in the chain, or an empty array. + * @example + * + * // Basic usage; matches numbers within tags + * XRegExp.matchChain('1 2 3 4 a 56', [ + * XRegExp('(?is).*?'), + * /\d+/ + * ]); + * // -> ['2', '4', '56'] + * + * // Passing forward and returning specific backreferences + * html = '
XRegExp\ + * Google'; + * XRegExp.matchChain(html, [ + * {regex: //i, backref: 1}, + * {regex: XRegExp('(?i)^https?://(?[^/?#]+)'), backref: 'domain'} + * ]); + * // -> ['xregexp.com', 'www.google.com'] + */ + + +XRegExp.matchChain = function (str, chain) { + return function recurseChain(values, level) { + var item = chain[level].regex ? chain[level] : { + regex: chain[level] + }; + var matches = []; + + function addMatch(match) { + if (item.backref) { + var ERR_UNDEFINED_GROUP = "Backreference to undefined group: ".concat(item.backref); + var isNamedBackref = isNaN(item.backref); + + if (isNamedBackref && XRegExp.isInstalled('namespacing')) { + // `groups` has `null` as prototype, so using `in` instead of `hasOwnProperty` + if (!(item.backref in match.groups)) { + throw new ReferenceError(ERR_UNDEFINED_GROUP); + } + } else if (!match.hasOwnProperty(item.backref)) { + throw new ReferenceError(ERR_UNDEFINED_GROUP); + } + + var backrefValue = isNamedBackref && XRegExp.isInstalled('namespacing') ? match.groups[item.backref] : match[item.backref]; + matches.push(backrefValue || ''); + } else { + matches.push(match[0]); + } + } + + var _iteratorNormalCompletion3 = true; + var _didIteratorError3 = false; + var _iteratorError3 = undefined; + + try { + for (var _iterator3 = values[Symbol.iterator](), _step3; !(_iteratorNormalCompletion3 = (_step3 = _iterator3.next()).done); _iteratorNormalCompletion3 = true) { + var value = _step3.value; + XRegExp.forEach(value, item.regex, addMatch); + } + } catch (err) { + _didIteratorError3 = true; + _iteratorError3 = err; + } finally { + try { + if (!_iteratorNormalCompletion3 && _iterator3.return != null) { + _iterator3.return(); + } + } finally { + if (_didIteratorError3) { + throw _iteratorError3; + } + } + } + + return level === chain.length - 1 || !matches.length ? matches : recurseChain(matches, level + 1); + }([str], 0); +}; +/** + * Returns a new string with one or all matches of a pattern replaced. The pattern can be a string + * or regex, and the replacement can be a string or a function to be called for each match. To + * perform a global search and replace, use the optional `scope` argument or include flag g if using + * a regex. Replacement strings can use `${n}` or `$` for named and numbered backreferences. + * Replacement functions can use named backreferences via `arguments[0].name`. Also fixes browser + * bugs compared to the native `String.prototype.replace` and can be used reliably cross-browser. + * + * @memberOf XRegExp + * @param {String} str String to search. + * @param {RegExp|String} search Search pattern to be replaced. + * @param {String|Function} replacement Replacement string or a function invoked to create it. + * Replacement strings can include special replacement syntax: + * - $$ - Inserts a literal $ character. + * - $&, $0 - Inserts the matched substring. + * - $` - Inserts the string that precedes the matched substring (left context). + * - $' - Inserts the string that follows the matched substring (right context). + * - $n, $nn - Where n/nn are digits referencing an existent capturing group, inserts + * backreference n/nn. + * - ${n}, $ - Where n is a name or any number of digits that reference an existent capturing + * group, inserts backreference n. + * Replacement functions are invoked with three or more arguments: + * - The matched substring (corresponds to $& above). Named backreferences are accessible as + * properties of this first argument. + * - 0..n arguments, one for each backreference (corresponding to $1, $2, etc. above). + * - The zero-based index of the match within the total search string. + * - The total string being searched. + * @param {String} [scope='one'] Use 'one' to replace the first match only, or 'all'. If not + * explicitly specified and using a regex with flag g, `scope` is 'all'. + * @returns {String} New string with one or all matches replaced. + * @example + * + * // Regex search, using named backreferences in replacement string + * const name = XRegExp('(?\\w+) (?\\w+)'); + * XRegExp.replace('John Smith', name, '$, $'); + * // -> 'Smith, John' + * + * // Regex search, using named backreferences in replacement function + * XRegExp.replace('John Smith', name, (match) => `${match.last}, ${match.first}`); + * // -> 'Smith, John' + * + * // String search, with replace-all + * XRegExp.replace('RegExp builds RegExps', 'RegExp', 'XRegExp', 'all'); + * // -> 'XRegExp builds XRegExps' + */ + + +XRegExp.replace = function (str, search, replacement, scope) { + var isRegex = XRegExp.isRegExp(search); + var global = search.global && scope !== 'one' || scope === 'all'; + var cacheKey = (global ? 'g' : '') + (search.sticky ? 'y' : '') || 'noGY'; + var s2 = search; + + if (isRegex) { + search[REGEX_DATA] = search[REGEX_DATA] || {}; // Shares cached copies with `XRegExp.exec`/`match`. Since a copy is used, `search`'s + // `lastIndex` isn't updated *during* replacement iterations + + s2 = search[REGEX_DATA][cacheKey] || (search[REGEX_DATA][cacheKey] = copyRegex(search, { + addG: !!global, + removeG: scope === 'one', + isInternalOnly: true + })); + } else if (global) { + s2 = new RegExp(XRegExp.escape(String(search)), 'g'); + } // Fixed `replace` required for named backreferences, etc. + + + var result = fixed.replace.call(toObject(str), s2, replacement); + + if (isRegex && search.global) { + // Fixes IE, Safari bug (last tested IE 9, Safari 5.1) + search.lastIndex = 0; + } + + return result; +}; +/** + * Performs batch processing of string replacements. Used like `XRegExp.replace`, but accepts an + * array of replacement details. Later replacements operate on the output of earlier replacements. + * Replacement details are accepted as an array with a regex or string to search for, the + * replacement string or function, and an optional scope of 'one' or 'all'. Uses the XRegExp + * replacement text syntax, which supports named backreference properties via `${name}` or + * `$`. + * + * @memberOf XRegExp + * @param {String} str String to search. + * @param {Array} replacements Array of replacement detail arrays. + * @returns {String} New string with all replacements. + * @example + * + * str = XRegExp.replaceEach(str, [ + * [XRegExp('(?a)'), 'z${name}'], + * [/b/gi, 'y'], + * [/c/g, 'x', 'one'], // scope 'one' overrides /g + * [/d/, 'w', 'all'], // scope 'all' overrides lack of /g + * ['e', 'v', 'all'], // scope 'all' allows replace-all for strings + * [/f/g, ($0) => $0.toUpperCase()] + * ]); + */ + + +XRegExp.replaceEach = function (str, replacements) { + var _iteratorNormalCompletion4 = true; + var _didIteratorError4 = false; + var _iteratorError4 = undefined; + + try { + for (var _iterator4 = replacements[Symbol.iterator](), _step4; !(_iteratorNormalCompletion4 = (_step4 = _iterator4.next()).done); _iteratorNormalCompletion4 = true) { + var r = _step4.value; + str = XRegExp.replace(str, r[0], r[1], r[2]); + } + } catch (err) { + _didIteratorError4 = true; + _iteratorError4 = err; + } finally { + try { + if (!_iteratorNormalCompletion4 && _iterator4.return != null) { + _iterator4.return(); + } + } finally { + if (_didIteratorError4) { + throw _iteratorError4; + } + } + } + + return str; +}; +/** + * Splits a string into an array of strings using a regex or string separator. Matches of the + * separator are not included in the result array. However, if `separator` is a regex that contains + * capturing groups, backreferences are spliced into the result each time `separator` is matched. + * Fixes browser bugs compared to the native `String.prototype.split` and can be used reliably + * cross-browser. + * + * @memberOf XRegExp + * @param {String} str String to split. + * @param {RegExp|String} separator Regex or string to use for separating the string. + * @param {Number} [limit] Maximum number of items to include in the result array. + * @returns {Array} Array of substrings. + * @example + * + * // Basic use + * XRegExp.split('a b c', ' '); + * // -> ['a', 'b', 'c'] + * + * // With limit + * XRegExp.split('a b c', ' ', 2); + * // -> ['a', 'b'] + * + * // Backreferences in result array + * XRegExp.split('..word1..', /([a-z]+)(\d+)/i); + * // -> ['..', 'word', '1', '..'] + */ + + +XRegExp.split = function (str, separator, limit) { + return fixed.split.call(toObject(str), separator, limit); +}; +/** + * Executes a regex search in a specified string. Returns `true` or `false`. Optional `pos` and + * `sticky` arguments specify the search start position, and whether the match must start at the + * specified position only. The `lastIndex` property of the provided regex is not used, but is + * updated for compatibility. Also fixes browser bugs compared to the native + * `RegExp.prototype.test` and can be used reliably cross-browser. + * + * @memberOf XRegExp + * @param {String} str String to search. + * @param {RegExp} regex Regex to search with. + * @param {Number} [pos=0] Zero-based index at which to start the search. + * @param {Boolean|String} [sticky=false] Whether the match must start at the specified position + * only. The string `'sticky'` is accepted as an alternative to `true`. + * @returns {Boolean} Whether the regex matched the provided value. + * @example + * + * // Basic use + * XRegExp.test('abc', /c/); // -> true + * + * // With pos and sticky + * XRegExp.test('abc', /c/, 0, 'sticky'); // -> false + * XRegExp.test('abc', /c/, 2, 'sticky'); // -> true + */ +// Do this the easy way :-) + + +XRegExp.test = function (str, regex, pos, sticky) { + return !!XRegExp.exec(str, regex, pos, sticky); +}; +/** + * Uninstalls optional features according to the specified options. All optional features start out + * uninstalled, so this is used to undo the actions of `XRegExp.install`. + * + * @memberOf XRegExp + * @param {Object|String} options Options object or string. + * @example + * + * // With an options object + * XRegExp.uninstall({ + * // Disables support for astral code points in Unicode addons + * astral: true, + * + * // Don't add named capture groups to the `groups` property of matches + * namespacing: true + * }); + * + * // With an options string + * XRegExp.uninstall('astral namespacing'); + */ + + +XRegExp.uninstall = function (options) { + options = prepareOptions(options); + + if (features.astral && options.astral) { + setAstral(false); + } + + if (features.namespacing && options.namespacing) { + setNamespacing(false); + } +}; +/** + * Returns an XRegExp object that is the union of the given patterns. Patterns can be provided as + * regex objects or strings. Metacharacters are escaped in patterns provided as strings. + * Backreferences in provided regex objects are automatically renumbered to work correctly within + * the larger combined pattern. Native flags used by provided regexes are ignored in favor of the + * `flags` argument. + * + * @memberOf XRegExp + * @param {Array} patterns Regexes and strings to combine. + * @param {String} [flags] Any combination of XRegExp flags. + * @param {Object} [options] Options object with optional properties: + * - `conjunction` {String} Type of conjunction to use: 'or' (default) or 'none'. + * @returns {RegExp} Union of the provided regexes and strings. + * @example + * + * XRegExp.union(['a+b*c', /(dogs)\1/, /(cats)\1/], 'i'); + * // -> /a\+b\*c|(dogs)\1|(cats)\2/i + * + * XRegExp.union([/man/, /bear/, /pig/], 'i', {conjunction: 'none'}); + * // -> /manbearpig/i + */ + + +XRegExp.union = function (patterns, flags, options) { + options = options || {}; + var conjunction = options.conjunction || 'or'; + var numCaptures = 0; + var numPriorCaptures; + var captureNames; + + function rewrite(match, paren, backref) { + var name = captureNames[numCaptures - numPriorCaptures]; // Capturing group + + if (paren) { + ++numCaptures; // If the current capture has a name, preserve the name + + if (name) { + return "(?<".concat(name, ">"); + } // Backreference + + } else if (backref) { + // Rewrite the backreference + return "\\".concat(+backref + numPriorCaptures); + } + + return match; + } + + if (!(isType(patterns, 'Array') && patterns.length)) { + throw new TypeError('Must provide a nonempty array of patterns to merge'); + } + + var parts = /(\()(?!\?)|\\([1-9]\d*)|\\[\s\S]|\[(?:[^\\\]]|\\[\s\S])*\]/g; + var output = []; + var _iteratorNormalCompletion5 = true; + var _didIteratorError5 = false; + var _iteratorError5 = undefined; + + try { + for (var _iterator5 = patterns[Symbol.iterator](), _step5; !(_iteratorNormalCompletion5 = (_step5 = _iterator5.next()).done); _iteratorNormalCompletion5 = true) { + var pattern = _step5.value; + + if (XRegExp.isRegExp(pattern)) { + numPriorCaptures = numCaptures; + captureNames = pattern[REGEX_DATA] && pattern[REGEX_DATA].captureNames || []; // Rewrite backreferences. Passing to XRegExp dies on octals and ensures patterns are + // independently valid; helps keep this simple. Named captures are put back + + output.push(nativ.replace.call(XRegExp(pattern.source).source, parts, rewrite)); + } else { + output.push(XRegExp.escape(pattern)); + } + } + } catch (err) { + _didIteratorError5 = true; + _iteratorError5 = err; + } finally { + try { + if (!_iteratorNormalCompletion5 && _iterator5.return != null) { + _iterator5.return(); + } + } finally { + if (_didIteratorError5) { + throw _iteratorError5; + } + } + } + + var separator = conjunction === 'none' ? '' : '|'; + return XRegExp(output.join(separator), flags); +}; // ==--------------------------== +// Fixed/extended native methods +// ==--------------------------== + +/** + * Adds named capture support (with backreferences returned as `result.name`), and fixes browser + * bugs in the native `RegExp.prototype.exec`. Use via `XRegExp.exec`. + * + * @memberOf RegExp + * @param {String} str String to search. + * @returns {Array} Match array with named backreference properties, or `null`. + */ + + +fixed.exec = function (str) { + var origLastIndex = this.lastIndex; + var match = nativ.exec.apply(this, arguments); + + if (match) { + // Fix browsers whose `exec` methods don't return `undefined` for nonparticipating capturing + // groups. This fixes IE 5.5-8, but not IE 9's quirks mode or emulation of older IEs. IE 9 + // in standards mode follows the spec. + if (!correctExecNpcg && match.length > 1 && match.indexOf('') !== -1) { + var r2 = copyRegex(this, { + removeG: true, + isInternalOnly: true + }); // Using `str.slice(match.index)` rather than `match[0]` in case lookahead allowed + // matching due to characters outside the match + + nativ.replace.call(String(str).slice(match.index), r2, function () { + var len = arguments.length; // Skip index 0 and the last 2 + + for (var i = 1; i < len - 2; ++i) { + if ((i < 0 || arguments.length <= i ? undefined : arguments[i]) === undefined) { + match[i] = undefined; + } + } + }); + } // Attach named capture properties + + + var groupsObject = match; + + if (XRegExp.isInstalled('namespacing')) { + // https://tc39.github.io/proposal-regexp-named-groups/#sec-regexpbuiltinexec + match.groups = Object.create(null); + groupsObject = match.groups; + } + + if (this[REGEX_DATA] && this[REGEX_DATA].captureNames) { + // Skip index 0 + for (var i = 1; i < match.length; ++i) { + var name = this[REGEX_DATA].captureNames[i - 1]; + + if (name) { + groupsObject[name] = match[i]; + } + } + } // Fix browsers that increment `lastIndex` after zero-length matches + + + if (this.global && !match[0].length && this.lastIndex > match.index) { + this.lastIndex = match.index; + } + } + + if (!this.global) { + // Fixes IE, Opera bug (last tested IE 9, Opera 11.6) + this.lastIndex = origLastIndex; + } + + return match; +}; +/** + * Fixes browser bugs in the native `RegExp.prototype.test`. + * + * @memberOf RegExp + * @param {String} str String to search. + * @returns {Boolean} Whether the regex matched the provided value. + */ + + +fixed.test = function (str) { + // Do this the easy way :-) + return !!fixed.exec.call(this, str); +}; +/** + * Adds named capture support (with backreferences returned as `result.name`), and fixes browser + * bugs in the native `String.prototype.match`. + * + * @memberOf String + * @param {RegExp|*} regex Regex to search with. If not a regex object, it is passed to `RegExp`. + * @returns {Array} If `regex` uses flag g, an array of match strings or `null`. Without flag g, + * the result of calling `regex.exec(this)`. + */ + + +fixed.match = function (regex) { + if (!XRegExp.isRegExp(regex)) { + // Use the native `RegExp` rather than `XRegExp` + regex = new RegExp(regex); + } else if (regex.global) { + var result = nativ.match.apply(this, arguments); // Fixes IE bug + + regex.lastIndex = 0; + return result; + } + + return fixed.exec.call(regex, toObject(this)); +}; +/** + * Adds support for `${n}` (or `$`) tokens for named and numbered backreferences in replacement + * text, and provides named backreferences to replacement functions as `arguments[0].name`. Also + * fixes browser bugs in replacement text syntax when performing a replacement using a nonregex + * search value, and the value of a replacement regex's `lastIndex` property during replacement + * iterations and upon completion. Note that this doesn't support SpiderMonkey's proprietary third + * (`flags`) argument. Use via `XRegExp.replace`. + * + * @memberOf String + * @param {RegExp|String} search Search pattern to be replaced. + * @param {String|Function} replacement Replacement string or a function invoked to create it. + * @returns {String} New string with one or all matches replaced. + */ + + +fixed.replace = function (search, replacement) { + var isRegex = XRegExp.isRegExp(search); + var origLastIndex; + var captureNames; + var result; + + if (isRegex) { + if (search[REGEX_DATA]) { + captureNames = search[REGEX_DATA].captureNames; + } // Only needed if `search` is nonglobal + + + origLastIndex = search.lastIndex; + } else { + search += ''; // Type-convert + } // Don't use `typeof`; some older browsers return 'function' for regex objects + + + if (isType(replacement, 'Function')) { + // Stringifying `this` fixes a bug in IE < 9 where the last argument in replacement + // functions isn't type-converted to a string + result = nativ.replace.call(String(this), search, function () { + for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) { + args[_key] = arguments[_key]; + } + + if (captureNames) { + var groupsObject; + + if (XRegExp.isInstalled('namespacing')) { + // https://tc39.github.io/proposal-regexp-named-groups/#sec-regexpbuiltinexec + groupsObject = Object.create(null); + args.push(groupsObject); + } else { + // Change the `args[0]` string primitive to a `String` object that can store + // properties. This really does need to use `String` as a constructor + args[0] = new String(args[0]); + groupsObject = args[0]; + } // Store named backreferences + + + for (var i = 0; i < captureNames.length; ++i) { + if (captureNames[i]) { + groupsObject[captureNames[i]] = args[i + 1]; + } + } + } // Update `lastIndex` before calling `replacement`. Fixes IE, Chrome, Firefox, Safari + // bug (last tested IE 9, Chrome 17, Firefox 11, Safari 5.1) + + + if (isRegex && search.global) { + search.lastIndex = args[args.length - 2] + args[0].length; + } // ES6 specs the context for replacement functions as `undefined` + + + return replacement.apply(void 0, args); + }); + } else { + // Ensure that the last value of `args` will be a string when given nonstring `this`, + // while still throwing on null or undefined context + result = nativ.replace.call(this == null ? this : String(this), search, function () { + for (var _len2 = arguments.length, args = new Array(_len2), _key2 = 0; _key2 < _len2; _key2++) { + args[_key2] = arguments[_key2]; + } + + return nativ.replace.call(String(replacement), replacementToken, replacer); + + function replacer($0, bracketed, angled, dollarToken) { + bracketed = bracketed || angled; // Named or numbered backreference with curly or angled braces + + if (bracketed) { + // XRegExp behavior for `${n}` or `$`: + // 1. Backreference to numbered capture, if `n` is an integer. Use `0` for the + // entire match. Any number of leading zeros may be used. + // 2. Backreference to named capture `n`, if it exists and is not an integer + // overridden by numbered capture. In practice, this does not overlap with + // numbered capture since XRegExp does not allow named capture to use a bare + // integer as the name. + // 3. If the name or number does not refer to an existing capturing group, it's + // an error. + var n = +bracketed; // Type-convert; drop leading zeros + + if (n <= args.length - 3) { + return args[n] || ''; + } // Groups with the same name is an error, else would need `lastIndexOf` + + + n = captureNames ? captureNames.indexOf(bracketed) : -1; + + if (n < 0) { + throw new SyntaxError("Backreference to undefined group ".concat($0)); + } + + return args[n + 1] || ''; + } // Else, special variable or numbered backreference without curly braces + + + if (dollarToken === '$') { + // $$ + return '$'; + } + + if (dollarToken === '&' || +dollarToken === 0) { + // $&, $0 (not followed by 1-9), $00 + return args[0]; + } + + if (dollarToken === '`') { + // $` (left context) + return args[args.length - 1].slice(0, args[args.length - 2]); + } + + if (dollarToken === "'") { + // $' (right context) + return args[args.length - 1].slice(args[args.length - 2] + args[0].length); + } // Else, numbered backreference without braces + + + dollarToken = +dollarToken; // Type-convert; drop leading zero + // XRegExp behavior for `$n` and `$nn`: + // - Backrefs end after 1 or 2 digits. Use `${..}` or `$<..>` for more digits. + // - `$1` is an error if no capturing groups. + // - `$10` is an error if less than 10 capturing groups. Use `${1}0` or `$<1>0` + // instead. + // - `$01` is `$1` if at least one capturing group, else it's an error. + // - `$0` (not followed by 1-9) and `$00` are the entire match. + // Native behavior, for comparison: + // - Backrefs end after 1 or 2 digits. Cannot reference capturing group 100+. + // - `$1` is a literal `$1` if no capturing groups. + // - `$10` is `$1` followed by a literal `0` if less than 10 capturing groups. + // - `$01` is `$1` if at least one capturing group, else it's a literal `$01`. + // - `$0` is a literal `$0`. + + if (!isNaN(dollarToken)) { + if (dollarToken > args.length - 3) { + throw new SyntaxError("Backreference to undefined group ".concat($0)); + } + + return args[dollarToken] || ''; + } // `$` followed by an unsupported char is an error, unlike native JS + + + throw new SyntaxError("Invalid token ".concat($0)); + } + }); + } + + if (isRegex) { + if (search.global) { + // Fixes IE, Safari bug (last tested IE 9, Safari 5.1) + search.lastIndex = 0; + } else { + // Fixes IE, Opera bug (last tested IE 9, Opera 11.6) + search.lastIndex = origLastIndex; + } + } + + return result; +}; +/** + * Fixes browser bugs in the native `String.prototype.split`. Use via `XRegExp.split`. + * + * @memberOf String + * @param {RegExp|String} separator Regex or string to use for separating the string. + * @param {Number} [limit] Maximum number of items to include in the result array. + * @returns {Array} Array of substrings. + */ + + +fixed.split = function (separator, limit) { + if (!XRegExp.isRegExp(separator)) { + // Browsers handle nonregex split correctly, so use the faster native method + return nativ.split.apply(this, arguments); + } + + var str = String(this); + var output = []; + var origLastIndex = separator.lastIndex; + var lastLastIndex = 0; + var lastLength; // Values for `limit`, per the spec: + // If undefined: pow(2,32) - 1 + // If 0, Infinity, or NaN: 0 + // If positive number: limit = floor(limit); if (limit >= pow(2,32)) limit -= pow(2,32); + // If negative number: pow(2,32) - floor(abs(limit)) + // If other: Type-convert, then use the above rules + // This line fails in very strange ways for some values of `limit` in Opera 10.5-10.63, unless + // Opera Dragonfly is open (go figure). It works in at least Opera 9.5-10.1 and 11+ + + limit = (limit === undefined ? -1 : limit) >>> 0; + XRegExp.forEach(str, separator, function (match) { + // This condition is not the same as `if (match[0].length)` + if (match.index + match[0].length > lastLastIndex) { + output.push(str.slice(lastLastIndex, match.index)); + + if (match.length > 1 && match.index < str.length) { + Array.prototype.push.apply(output, match.slice(1)); + } + + lastLength = match[0].length; + lastLastIndex = match.index + lastLength; + } + }); + + if (lastLastIndex === str.length) { + if (!nativ.test.call(separator, '') || lastLength) { + output.push(''); + } + } else { + output.push(str.slice(lastLastIndex)); + } + + separator.lastIndex = origLastIndex; + return output.length > limit ? output.slice(0, limit) : output; +}; // ==--------------------------== +// Built-in syntax/flag tokens +// ==--------------------------== + +/* + * Letter escapes that natively match literal characters: `\a`, `\A`, etc. These should be + * SyntaxErrors but are allowed in web reality. XRegExp makes them errors for cross-browser + * consistency and to reserve their syntax, but lets them be superseded by addons. + */ + + +XRegExp.addToken(/\\([ABCE-RTUVXYZaeg-mopqyz]|c(?![A-Za-z])|u(?![\dA-Fa-f]{4}|{[\dA-Fa-f]+})|x(?![\dA-Fa-f]{2}))/, function (match, scope) { + // \B is allowed in default scope only + if (match[1] === 'B' && scope === defaultScope) { + return match[0]; + } + + throw new SyntaxError("Invalid escape ".concat(match[0])); +}, { + scope: 'all', + leadChar: '\\' +}); +/* + * Unicode code point escape with curly braces: `\u{N..}`. `N..` is any one or more digit + * hexadecimal number from 0-10FFFF, and can include leading zeros. Requires the native ES6 `u` flag + * to support code points greater than U+FFFF. Avoids converting code points above U+FFFF to + * surrogate pairs (which could be done without flag `u`), since that could lead to broken behavior + * if you follow a `\u{N..}` token that references a code point above U+FFFF with a quantifier, or + * if you use the same in a character class. + */ + +XRegExp.addToken(/\\u{([\dA-Fa-f]+)}/, function (match, scope, flags) { + var code = dec(match[1]); + + if (code > 0x10FFFF) { + throw new SyntaxError("Invalid Unicode code point ".concat(match[0])); + } + + if (code <= 0xFFFF) { + // Converting to \uNNNN avoids needing to escape the literal character and keep it + // separate from preceding tokens + return "\\u".concat(pad4(hex(code))); + } // If `code` is between 0xFFFF and 0x10FFFF, require and defer to native handling + + + if (hasNativeU && flags.indexOf('u') !== -1) { + return match[0]; + } + + throw new SyntaxError('Cannot use Unicode code point above \\u{FFFF} without flag u'); +}, { + scope: 'all', + leadChar: '\\' +}); +/* + * Empty character class: `[]` or `[^]`. This fixes a critical cross-browser syntax inconsistency. + * Unless this is standardized (per the ES spec), regex syntax can't be accurately parsed because + * character class endings can't be determined. + */ + +XRegExp.addToken(/\[(\^?)\]/, // For cross-browser compatibility with ES3, convert [] to \b\B and [^] to [\s\S]. +// (?!) should work like \b\B, but is unreliable in some versions of Firefox + +/* eslint-disable no-confusing-arrow */ +function (match) { + return match[1] ? '[\\s\\S]' : '\\b\\B'; +}, +/* eslint-enable no-confusing-arrow */ +{ + leadChar: '[' +}); +/* + * Comment pattern: `(?# )`. Inline comments are an alternative to the line comments allowed in + * free-spacing mode (flag x). + */ + +XRegExp.addToken(/\(\?#[^)]*\)/, getContextualTokenSeparator, { + leadChar: '(' +}); +/* + * Whitespace and line comments, in free-spacing mode (aka extended mode, flag x) only. + */ + +XRegExp.addToken(/\s+|#[^\n]*\n?/, getContextualTokenSeparator, { + flag: 'x' +}); +/* + * Dot, in dotall mode (aka singleline mode, flag s) only. + */ + +XRegExp.addToken(/\./, function () { + return '[\\s\\S]'; +}, { + flag: 's', + leadChar: '.' +}); +/* + * Named backreference: `\k`. Backreference names can use the characters A-Z, a-z, 0-9, _, + * and $ only. Also allows numbered backreferences as `\k`. + */ + +XRegExp.addToken(/\\k<([\w$]+)>/, function (match) { + // Groups with the same name is an error, else would need `lastIndexOf` + var index = isNaN(match[1]) ? this.captureNames.indexOf(match[1]) + 1 : +match[1]; + var endIndex = match.index + match[0].length; + + if (!index || index > this.captureNames.length) { + throw new SyntaxError("Backreference to undefined group ".concat(match[0])); + } // Keep backreferences separate from subsequent literal numbers. This avoids e.g. + // inadvertedly changing `(?)\k1` to `()\11`. + + + return "\\".concat(index).concat(endIndex === match.input.length || isNaN(match.input[endIndex]) ? '' : '(?:)'); +}, { + leadChar: '\\' +}); +/* + * Numbered backreference or octal, plus any following digits: `\0`, `\11`, etc. Octals except `\0` + * not followed by 0-9 and backreferences to unopened capture groups throw an error. Other matches + * are returned unaltered. IE < 9 doesn't support backreferences above `\99` in regex syntax. + */ + +XRegExp.addToken(/\\(\d+)/, function (match, scope) { + if (!(scope === defaultScope && /^[1-9]/.test(match[1]) && +match[1] <= this.captureNames.length) && match[1] !== '0') { + throw new SyntaxError("Cannot use octal escape or backreference to undefined group ".concat(match[0])); + } + + return match[0]; +}, { + scope: 'all', + leadChar: '\\' +}); +/* + * Named capturing group; match the opening delimiter only: `(?`. Capture names can use the + * characters A-Z, a-z, 0-9, _, and $ only. Names can't be integers. Supports Python-style + * `(?P` as an alternate syntax to avoid issues in some older versions of Opera which natively + * supported the Python-style syntax. Otherwise, XRegExp might treat numbered backreferences to + * Python-style named capture as octals. + */ + +XRegExp.addToken(/\(\?P?<([\w$]+)>/, function (match) { + // Disallow bare integers as names because named backreferences are added to match arrays + // and therefore numeric properties may lead to incorrect lookups + if (!isNaN(match[1])) { + throw new SyntaxError("Cannot use integer as capture name ".concat(match[0])); + } + + if (!XRegExp.isInstalled('namespacing') && (match[1] === 'length' || match[1] === '__proto__')) { + throw new SyntaxError("Cannot use reserved word as capture name ".concat(match[0])); + } + + if (this.captureNames.indexOf(match[1]) !== -1) { + throw new SyntaxError("Cannot use same name for multiple groups ".concat(match[0])); + } + + this.captureNames.push(match[1]); + this.hasNamedCapture = true; + return '('; +}, { + leadChar: '(' +}); +/* + * Capturing group; match the opening parenthesis only. Required for support of named capturing + * groups. Also adds explicit capture mode (flag n). + */ + +XRegExp.addToken(/\((?!\?)/, function (match, scope, flags) { + if (flags.indexOf('n') !== -1) { + return '(?:'; + } + + this.captureNames.push(null); + return '('; +}, { + optionalFlags: 'n', + leadChar: '(' +}); +var _default = XRegExp; +exports.default = _default; +module.exports = exports["default"]; +}); + +unwrapExports(xregexp); + +var build = createCommonjsModule(function (module, exports) { +"use strict"; + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.default = void 0; + +/*! + * XRegExp.build 4.2.0 + * + * Steven Levithan (c) 2012-present MIT License + */ +var _default = function _default(XRegExp) { + var REGEX_DATA = 'xregexp'; + var subParts = /(\()(?!\?)|\\([1-9]\d*)|\\[\s\S]|\[(?:[^\\\]]|\\[\s\S])*\]/g; + var parts = XRegExp.union([/\({{([\w$]+)}}\)|{{([\w$]+)}}/, subParts], 'g', { + conjunction: 'or' + }); + /** + * Strips a leading `^` and trailing unescaped `$`, if both are present. + * + * @private + * @param {String} pattern Pattern to process. + * @returns {String} Pattern with edge anchors removed. + */ + + function deanchor(pattern) { + // Allow any number of empty noncapturing groups before/after anchors, because regexes + // built/generated by XRegExp sometimes include them + var leadingAnchor = /^(?:\(\?:\))*\^/; + var trailingAnchor = /\$(?:\(\?:\))*$/; + + if (leadingAnchor.test(pattern) && trailingAnchor.test(pattern) && // Ensure that the trailing `$` isn't escaped + trailingAnchor.test(pattern.replace(/\\[\s\S]/g, ''))) { + return pattern.replace(leadingAnchor, '').replace(trailingAnchor, ''); + } + + return pattern; + } + /** + * Converts the provided value to an XRegExp. Native RegExp flags are not preserved. + * + * @private + * @param {String|RegExp} value Value to convert. + * @param {Boolean} [addFlagX] Whether to apply the `x` flag in cases when `value` is not + * already a regex generated by XRegExp + * @returns {RegExp} XRegExp object with XRegExp syntax applied. + */ + + + function asXRegExp(value, addFlagX) { + var flags = addFlagX ? 'x' : ''; + return XRegExp.isRegExp(value) ? value[REGEX_DATA] && value[REGEX_DATA].captureNames ? // Don't recompile, to preserve capture names + value : // Recompile as XRegExp + XRegExp(value.source, flags) : // Compile string as XRegExp + XRegExp(value, flags); + } + + function interpolate(substitution) { + return substitution instanceof RegExp ? substitution : XRegExp.escape(substitution); + } + + function reduceToSubpatternsObject(subpatterns, interpolated, subpatternIndex) { + subpatterns["subpattern".concat(subpatternIndex)] = interpolated; + return subpatterns; + } + + function embedSubpatternAfter(raw, subpatternIndex, rawLiterals) { + var hasSubpattern = subpatternIndex < rawLiterals.length - 1; + return raw + (hasSubpattern ? "{{subpattern".concat(subpatternIndex, "}}") : ''); + } + /** + * Provides tagged template literals that create regexes with XRegExp syntax and flags. The + * provided pattern is handled as a raw string, so backslashes don't need to be escaped. + * + * Interpolation of strings and regexes shares the features of `XRegExp.build`. Interpolated + * patterns are treated as atomic units when quantified, interpolated strings have their special + * characters escaped, a leading `^` and trailing unescaped `$` are stripped from interpolated + * regexes if both are present, and any backreferences within an interpolated regex are + * rewritten to work within the overall pattern. + * + * @memberOf XRegExp + * @param {String} [flags] Any combination of XRegExp flags. + * @returns {Function} Handler for template literals that construct regexes with XRegExp syntax. + * @example + * + * const h12 = /1[0-2]|0?[1-9]/; + * const h24 = /2[0-3]|[01][0-9]/; + * const hours = XRegExp.tag('x')`${h12} : | ${h24}`; + * const minutes = /^[0-5][0-9]$/; + * // Note that explicitly naming the 'minutes' group is required for named backreferences + * const time = XRegExp.tag('x')`^ ${hours} (?${minutes}) $`; + * time.test('10:59'); // -> true + * XRegExp.exec('10:59', time).minutes; // -> '59' + */ + + + XRegExp.tag = function (flags) { + return function (literals) { + for (var _len = arguments.length, substitutions = new Array(_len > 1 ? _len - 1 : 0), _key = 1; _key < _len; _key++) { + substitutions[_key - 1] = arguments[_key]; + } + + var subpatterns = substitutions.map(interpolate).reduce(reduceToSubpatternsObject, {}); + var pattern = literals.raw.map(embedSubpatternAfter).join(''); + return XRegExp.build(pattern, subpatterns, flags); + }; + }; + /** + * Builds regexes using named subpatterns, for readability and pattern reuse. Backreferences in + * the outer pattern and provided subpatterns are automatically renumbered to work correctly. + * Native flags used by provided subpatterns are ignored in favor of the `flags` argument. + * + * @memberOf XRegExp + * @param {String} pattern XRegExp pattern using `{{name}}` for embedded subpatterns. Allows + * `({{name}})` as shorthand for `(?{{name}})`. Patterns cannot be embedded within + * character classes. + * @param {Object} subs Lookup object for named subpatterns. Values can be strings or regexes. A + * leading `^` and trailing unescaped `$` are stripped from subpatterns, if both are present. + * @param {String} [flags] Any combination of XRegExp flags. + * @returns {RegExp} Regex with interpolated subpatterns. + * @example + * + * const time = XRegExp.build('(?x)^ {{hours}} ({{minutes}}) $', { + * hours: XRegExp.build('{{h12}} : | {{h24}}', { + * h12: /1[0-2]|0?[1-9]/, + * h24: /2[0-3]|[01][0-9]/ + * }, 'x'), + * minutes: /^[0-5][0-9]$/ + * }); + * time.test('10:59'); // -> true + * XRegExp.exec('10:59', time).minutes; // -> '59' + */ + + + XRegExp.build = function (pattern, subs, flags) { + flags = flags || ''; // Used with `asXRegExp` calls for `pattern` and subpatterns in `subs`, to work around how + // some browsers convert `RegExp('\n')` to a regex that contains the literal characters `\` + // and `n`. See more details at . + + var addFlagX = flags.indexOf('x') !== -1; + var inlineFlags = /^\(\?([\w$]+)\)/.exec(pattern); // Add flags within a leading mode modifier to the overall pattern's flags + + if (inlineFlags) { + flags = XRegExp._clipDuplicates(flags + inlineFlags[1]); + } + + var data = {}; + + for (var p in subs) { + if (subs.hasOwnProperty(p)) { + // Passing to XRegExp enables extended syntax and ensures independent validity, + // lest an unescaped `(`, `)`, `[`, or trailing `\` breaks the `(?:)` wrapper. For + // subpatterns provided as native regexes, it dies on octals and adds the property + // used to hold extended regex instance data, for simplicity. + var sub = asXRegExp(subs[p], addFlagX); + data[p] = { + // Deanchoring allows embedding independently useful anchored regexes. If you + // really need to keep your anchors, double them (i.e., `^^...$$`). + pattern: deanchor(sub.source), + names: sub[REGEX_DATA].captureNames || [] + }; + } + } // Passing to XRegExp dies on octals and ensures the outer pattern is independently valid; + // helps keep this simple. Named captures will be put back. + + + var patternAsRegex = asXRegExp(pattern, addFlagX); // 'Caps' is short for 'captures' + + var numCaps = 0; + var numPriorCaps; + var numOuterCaps = 0; + var outerCapsMap = [0]; + var outerCapNames = patternAsRegex[REGEX_DATA].captureNames || []; + var output = patternAsRegex.source.replace(parts, function ($0, $1, $2, $3, $4) { + var subName = $1 || $2; + var capName; + var intro; + var localCapIndex; // Named subpattern + + if (subName) { + if (!data.hasOwnProperty(subName)) { + throw new ReferenceError("Undefined property ".concat($0)); + } // Named subpattern was wrapped in a capturing group + + + if ($1) { + capName = outerCapNames[numOuterCaps]; + outerCapsMap[++numOuterCaps] = ++numCaps; // If it's a named group, preserve the name. Otherwise, use the subpattern name + // as the capture name + + intro = "(?<".concat(capName || subName, ">"); + } else { + intro = '(?:'; + } + + numPriorCaps = numCaps; + var rewrittenSubpattern = data[subName].pattern.replace(subParts, function (match, paren, backref) { + // Capturing group + if (paren) { + capName = data[subName].names[numCaps - numPriorCaps]; + ++numCaps; // If the current capture has a name, preserve the name + + if (capName) { + return "(?<".concat(capName, ">"); + } // Backreference + + } else if (backref) { + localCapIndex = +backref - 1; // Rewrite the backreference + + return data[subName].names[localCapIndex] ? // Need to preserve the backreference name in case using flag `n` + "\\k<".concat(data[subName].names[localCapIndex], ">") : "\\".concat(+backref + numPriorCaps); + } + + return match; + }); + return "".concat(intro).concat(rewrittenSubpattern, ")"); + } // Capturing group + + + if ($3) { + capName = outerCapNames[numOuterCaps]; + outerCapsMap[++numOuterCaps] = ++numCaps; // If the current capture has a name, preserve the name + + if (capName) { + return "(?<".concat(capName, ">"); + } // Backreference + + } else if ($4) { + localCapIndex = +$4 - 1; // Rewrite the backreference + + return outerCapNames[localCapIndex] ? // Need to preserve the backreference name in case using flag `n` + "\\k<".concat(outerCapNames[localCapIndex], ">") : "\\".concat(outerCapsMap[+$4]); + } + + return $0; + }); + return XRegExp(output, flags); + }; +}; + +exports.default = _default; +module.exports = exports["default"]; +}); + +unwrapExports(build); + +var matchrecursive = createCommonjsModule(function (module, exports) { +"use strict"; + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.default = void 0; + +/*! + * XRegExp.matchRecursive 4.2.0 + * + * Steven Levithan (c) 2009-present MIT License + */ +var _default = function _default(XRegExp) { + /** + * Returns a match detail object composed of the provided values. + * + * @private + */ + function row(name, value, start, end) { + return { + name: name, + value: value, + start: start, + end: end + }; + } + /** + * Returns an array of match strings between outermost left and right delimiters, or an array of + * objects with detailed match parts and position data. An error is thrown if delimiters are + * unbalanced within the data. + * + * @memberOf XRegExp + * @param {String} str String to search. + * @param {String} left Left delimiter as an XRegExp pattern. + * @param {String} right Right delimiter as an XRegExp pattern. + * @param {String} [flags] Any native or XRegExp flags, used for the left and right delimiters. + * @param {Object} [options] Lets you specify `valueNames` and `escapeChar` options. + * @returns {Array} Array of matches, or an empty array. + * @example + * + * // Basic usage + * let str = '(t((e))s)t()(ing)'; + * XRegExp.matchRecursive(str, '\\(', '\\)', 'g'); + * // -> ['t((e))s', '', 'ing'] + * + * // Extended information mode with valueNames + * str = 'Here is
an
example'; + * XRegExp.matchRecursive(str, '', '', 'gi', { + * valueNames: ['between', 'left', 'match', 'right'] + * }); + * // -> [ + * // {name: 'between', value: 'Here is ', start: 0, end: 8}, + * // {name: 'left', value: '
', start: 8, end: 13}, + * // {name: 'match', value: '
an
', start: 13, end: 27}, + * // {name: 'right', value: '
', start: 27, end: 33}, + * // {name: 'between', value: ' example', start: 33, end: 41} + * // ] + * + * // Omitting unneeded parts with null valueNames, and using escapeChar + * str = '...{1}.\\{{function(x,y){return {y:x}}}'; + * XRegExp.matchRecursive(str, '{', '}', 'g', { + * valueNames: ['literal', null, 'value', null], + * escapeChar: '\\' + * }); + * // -> [ + * // {name: 'literal', value: '...', start: 0, end: 3}, + * // {name: 'value', value: '1', start: 4, end: 5}, + * // {name: 'literal', value: '.\\{', start: 6, end: 9}, + * // {name: 'value', value: 'function(x,y){return {y:x}}', start: 10, end: 37} + * // ] + * + * // Sticky mode via flag y + * str = '<1><<<2>>><3>4<5>'; + * XRegExp.matchRecursive(str, '<', '>', 'gy'); + * // -> ['1', '<<2>>', '3'] + */ + + + XRegExp.matchRecursive = function (str, left, right, flags, options) { + flags = flags || ''; + options = options || {}; + var global = flags.indexOf('g') !== -1; + var sticky = flags.indexOf('y') !== -1; // Flag `y` is controlled internally + + var basicFlags = flags.replace(/y/g, ''); + var _options = options, + escapeChar = _options.escapeChar; + var vN = options.valueNames; + var output = []; + var openTokens = 0; + var delimStart = 0; + var delimEnd = 0; + var lastOuterEnd = 0; + var outerStart; + var innerStart; + var leftMatch; + var rightMatch; + var esc; + left = XRegExp(left, basicFlags); + right = XRegExp(right, basicFlags); + + if (escapeChar) { + if (escapeChar.length > 1) { + throw new Error('Cannot use more than one escape character'); + } + + escapeChar = XRegExp.escape(escapeChar); // Example of concatenated `esc` regex: + // `escapeChar`: '%' + // `left`: '<' + // `right`: '>' + // Regex is: /(?:%[\S\s]|(?:(?!<|>)[^%])+)+/ + + esc = new RegExp("(?:".concat(escapeChar, "[\\S\\s]|(?:(?!").concat( // Using `XRegExp.union` safely rewrites backreferences in `left` and `right`. + // Intentionally not passing `basicFlags` to `XRegExp.union` since any syntax + // transformation resulting from those flags was already applied to `left` and + // `right` when they were passed through the XRegExp constructor above. + XRegExp.union([left, right], '', { + conjunction: 'or' + }).source, ")[^").concat(escapeChar, "])+)+"), // Flags `gy` not needed here + flags.replace(/[^imu]+/g, '')); + } + + while (true) { + // If using an escape character, advance to the delimiter's next starting position, + // skipping any escaped characters in between + if (escapeChar) { + delimEnd += (XRegExp.exec(str, esc, delimEnd, 'sticky') || [''])[0].length; + } + + leftMatch = XRegExp.exec(str, left, delimEnd); + rightMatch = XRegExp.exec(str, right, delimEnd); // Keep the leftmost match only + + if (leftMatch && rightMatch) { + if (leftMatch.index <= rightMatch.index) { + rightMatch = null; + } else { + leftMatch = null; + } + } // Paths (LM: leftMatch, RM: rightMatch, OT: openTokens): + // LM | RM | OT | Result + // 1 | 0 | 1 | loop + // 1 | 0 | 0 | loop + // 0 | 1 | 1 | loop + // 0 | 1 | 0 | throw + // 0 | 0 | 1 | throw + // 0 | 0 | 0 | break + // The paths above don't include the sticky mode special case. The loop ends after the + // first completed match if not `global`. + + + if (leftMatch || rightMatch) { + delimStart = (leftMatch || rightMatch).index; + delimEnd = delimStart + (leftMatch || rightMatch)[0].length; + } else if (!openTokens) { + break; + } + + if (sticky && !openTokens && delimStart > lastOuterEnd) { + break; + } + + if (leftMatch) { + if (!openTokens) { + outerStart = delimStart; + innerStart = delimEnd; + } + + ++openTokens; + } else if (rightMatch && openTokens) { + if (! --openTokens) { + if (vN) { + if (vN[0] && outerStart > lastOuterEnd) { + output.push(row(vN[0], str.slice(lastOuterEnd, outerStart), lastOuterEnd, outerStart)); + } + + if (vN[1]) { + output.push(row(vN[1], str.slice(outerStart, innerStart), outerStart, innerStart)); + } + + if (vN[2]) { + output.push(row(vN[2], str.slice(innerStart, delimStart), innerStart, delimStart)); + } + + if (vN[3]) { + output.push(row(vN[3], str.slice(delimStart, delimEnd), delimStart, delimEnd)); + } + } else { + output.push(str.slice(innerStart, delimStart)); + } + + lastOuterEnd = delimEnd; + + if (!global) { + break; + } + } + } else { + throw new Error('Unbalanced delimiter found in string'); + } // If the delimiter matched an empty string, avoid an infinite loop + + + if (delimStart === delimEnd) { + ++delimEnd; + } + } + + if (global && !sticky && vN && vN[0] && str.length > lastOuterEnd) { + output.push(row(vN[0], str.slice(lastOuterEnd), lastOuterEnd, str.length)); + } + + return output; + }; +}; + +exports.default = _default; +module.exports = exports["default"]; +}); + +unwrapExports(matchrecursive); + +var unicodeBase = createCommonjsModule(function (module, exports) { +"use strict"; + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.default = void 0; + +/*! + * XRegExp Unicode Base 4.2.0 + * + * Steven Levithan (c) 2008-present MIT License + */ +var _default = function _default(XRegExp) { + /** + * Adds base support for Unicode matching: + * - Adds syntax `\p{..}` for matching Unicode tokens. Tokens can be inverted using `\P{..}` or + * `\p{^..}`. Token names ignore case, spaces, hyphens, and underscores. You can omit the + * braces for token names that are a single letter (e.g. `\pL` or `PL`). + * - Adds flag A (astral), which enables 21-bit Unicode support. + * - Adds the `XRegExp.addUnicodeData` method used by other addons to provide character data. + * + * Unicode Base relies on externally provided Unicode character data. Official addons are + * available to provide data for Unicode categories, scripts, blocks, and properties. + * + * @requires XRegExp + */ + // ==--------------------------== + // Private stuff + // ==--------------------------== + // Storage for Unicode data + var unicode = {}; // Reuse utils + + var dec = XRegExp._dec; + var hex = XRegExp._hex; + var pad4 = XRegExp._pad4; // Generates a token lookup name: lowercase, with hyphens, spaces, and underscores removed + + function normalize(name) { + return name.replace(/[- _]+/g, '').toLowerCase(); + } // Gets the decimal code of a literal code unit, \xHH, \uHHHH, or a backslash-escaped literal + + + function charCode(chr) { + var esc = /^\\[xu](.+)/.exec(chr); + return esc ? dec(esc[1]) : chr.charCodeAt(chr[0] === '\\' ? 1 : 0); + } // Inverts a list of ordered BMP characters and ranges + + + function invertBmp(range) { + var output = ''; + var lastEnd = -1; + XRegExp.forEach(range, /(\\x..|\\u....|\\?[\s\S])(?:-(\\x..|\\u....|\\?[\s\S]))?/, function (m) { + var start = charCode(m[1]); + + if (start > lastEnd + 1) { + output += "\\u".concat(pad4(hex(lastEnd + 1))); + + if (start > lastEnd + 2) { + output += "-\\u".concat(pad4(hex(start - 1))); + } + } + + lastEnd = charCode(m[2] || m[1]); + }); + + if (lastEnd < 0xFFFF) { + output += "\\u".concat(pad4(hex(lastEnd + 1))); + + if (lastEnd < 0xFFFE) { + output += '-\\uFFFF'; + } + } + + return output; + } // Generates an inverted BMP range on first use + + + function cacheInvertedBmp(slug) { + var prop = 'b!'; + return unicode[slug][prop] || (unicode[slug][prop] = invertBmp(unicode[slug].bmp)); + } // Combines and optionally negates BMP and astral data + + + function buildAstral(slug, isNegated) { + var item = unicode[slug]; + var combined = ''; + + if (item.bmp && !item.isBmpLast) { + combined = "[".concat(item.bmp, "]").concat(item.astral ? '|' : ''); + } + + if (item.astral) { + combined += item.astral; + } + + if (item.isBmpLast && item.bmp) { + combined += "".concat(item.astral ? '|' : '', "[").concat(item.bmp, "]"); + } // Astral Unicode tokens always match a code point, never a code unit + + + return isNegated ? "(?:(?!".concat(combined, ")(?:[\uD800-\uDBFF][\uDC00-\uDFFF]|[\0-\uFFFF]))") : "(?:".concat(combined, ")"); + } // Builds a complete astral pattern on first use + + + function cacheAstral(slug, isNegated) { + var prop = isNegated ? 'a!' : 'a='; + return unicode[slug][prop] || (unicode[slug][prop] = buildAstral(slug, isNegated)); + } // ==--------------------------== + // Core functionality + // ==--------------------------== + + /* + * Add astral mode (flag A) and Unicode token syntax: `\p{..}`, `\P{..}`, `\p{^..}`, `\pC`. + */ + + + XRegExp.addToken( // Use `*` instead of `+` to avoid capturing `^` as the token name in `\p{^}` + /\\([pP])(?:{(\^?)([^}]*)}|([A-Za-z]))/, function (match, scope, flags) { + var ERR_DOUBLE_NEG = 'Invalid double negation '; + var ERR_UNKNOWN_NAME = 'Unknown Unicode token '; + var ERR_UNKNOWN_REF = 'Unicode token missing data '; + var ERR_ASTRAL_ONLY = 'Astral mode required for Unicode token '; + var ERR_ASTRAL_IN_CLASS = 'Astral mode does not support Unicode tokens within character classes'; // Negated via \P{..} or \p{^..} + + var isNegated = match[1] === 'P' || !!match[2]; // Switch from BMP (0-FFFF) to astral (0-10FFFF) mode via flag A + + var isAstralMode = flags.indexOf('A') !== -1; // Token lookup name. Check `[4]` first to avoid passing `undefined` via `\p{}` + + var slug = normalize(match[4] || match[3]); // Token data object + + var item = unicode[slug]; + + if (match[1] === 'P' && match[2]) { + throw new SyntaxError(ERR_DOUBLE_NEG + match[0]); + } + + if (!unicode.hasOwnProperty(slug)) { + throw new SyntaxError(ERR_UNKNOWN_NAME + match[0]); + } // Switch to the negated form of the referenced Unicode token + + + if (item.inverseOf) { + slug = normalize(item.inverseOf); + + if (!unicode.hasOwnProperty(slug)) { + throw new ReferenceError("".concat(ERR_UNKNOWN_REF + match[0], " -> ").concat(item.inverseOf)); + } + + item = unicode[slug]; + isNegated = !isNegated; + } + + if (!(item.bmp || isAstralMode)) { + throw new SyntaxError(ERR_ASTRAL_ONLY + match[0]); + } + + if (isAstralMode) { + if (scope === 'class') { + throw new SyntaxError(ERR_ASTRAL_IN_CLASS); + } + + return cacheAstral(slug, isNegated); + } + + return scope === 'class' ? isNegated ? cacheInvertedBmp(slug) : item.bmp : "".concat((isNegated ? '[^' : '[') + item.bmp, "]"); + }, { + scope: 'all', + optionalFlags: 'A', + leadChar: '\\' + }); + /** + * Adds to the list of Unicode tokens that XRegExp regexes can match via `\p` or `\P`. + * + * @memberOf XRegExp + * @param {Array} data Objects with named character ranges. Each object may have properties + * `name`, `alias`, `isBmpLast`, `inverseOf`, `bmp`, and `astral`. All but `name` are + * optional, although one of `bmp` or `astral` is required (unless `inverseOf` is set). If + * `astral` is absent, the `bmp` data is used for BMP and astral modes. If `bmp` is absent, + * the name errors in BMP mode but works in astral mode. If both `bmp` and `astral` are + * provided, the `bmp` data only is used in BMP mode, and the combination of `bmp` and + * `astral` data is used in astral mode. `isBmpLast` is needed when a token matches orphan + * high surrogates *and* uses surrogate pairs to match astral code points. The `bmp` and + * `astral` data should be a combination of literal characters and `\xHH` or `\uHHHH` escape + * sequences, with hyphens to create ranges. Any regex metacharacters in the data should be + * escaped, apart from range-creating hyphens. The `astral` data can additionally use + * character classes and alternation, and should use surrogate pairs to represent astral code + * points. `inverseOf` can be used to avoid duplicating character data if a Unicode token is + * defined as the exact inverse of another token. + * @example + * + * // Basic use + * XRegExp.addUnicodeData([{ + * name: 'XDigit', + * alias: 'Hexadecimal', + * bmp: '0-9A-Fa-f' + * }]); + * XRegExp('\\p{XDigit}:\\p{Hexadecimal}+').test('0:3D'); // -> true + */ + + XRegExp.addUnicodeData = function (data) { + var ERR_NO_NAME = 'Unicode token requires name'; + var ERR_NO_DATA = 'Unicode token has no character data '; + var _iteratorNormalCompletion = true; + var _didIteratorError = false; + var _iteratorError = undefined; + + try { + for (var _iterator = data[Symbol.iterator](), _step; !(_iteratorNormalCompletion = (_step = _iterator.next()).done); _iteratorNormalCompletion = true) { + var item = _step.value; + + if (!item.name) { + throw new Error(ERR_NO_NAME); + } + + if (!(item.inverseOf || item.bmp || item.astral)) { + throw new Error(ERR_NO_DATA + item.name); + } + + unicode[normalize(item.name)] = item; + + if (item.alias) { + unicode[normalize(item.alias)] = item; + } + } // Reset the pattern cache used by the `XRegExp` constructor, since the same pattern and + // flags might now produce different results + + } catch (err) { + _didIteratorError = true; + _iteratorError = err; + } finally { + try { + if (!_iteratorNormalCompletion && _iterator.return != null) { + _iterator.return(); + } + } finally { + if (_didIteratorError) { + throw _iteratorError; + } + } + } + + XRegExp.cache.flush('patterns'); + }; + /** + * @ignore + * + * Return a reference to the internal Unicode definition structure for the given Unicode + * Property if the given name is a legal Unicode Property for use in XRegExp `\p` or `\P` regex + * constructs. + * + * @memberOf XRegExp + * @param {String} name Name by which the Unicode Property may be recognized (case-insensitive), + * e.g. `'N'` or `'Number'`. The given name is matched against all registered Unicode + * Properties and Property Aliases. + * @returns {Object} Reference to definition structure when the name matches a Unicode Property. + * + * @note + * For more info on Unicode Properties, see also http://unicode.org/reports/tr18/#Categories. + * + * @note + * This method is *not* part of the officially documented API and may change or be removed in + * the future. It is meant for userland code that wishes to reuse the (large) internal Unicode + * structures set up by XRegExp. + */ + + + XRegExp._getUnicodeProperty = function (name) { + var slug = normalize(name); + return unicode[slug]; + }; +}; + +exports.default = _default; +module.exports = exports["default"]; +}); + +unwrapExports(unicodeBase); + +var blocks = [ + { + 'name': 'InAdlam', + 'astral': '\uD83A[\uDD00-\uDD5F]' + }, + { + 'name': 'InAegean_Numbers', + 'astral': '\uD800[\uDD00-\uDD3F]' + }, + { + 'name': 'InAhom', + 'astral': '\uD805[\uDF00-\uDF3F]' + }, + { + 'name': 'InAlchemical_Symbols', + 'astral': '\uD83D[\uDF00-\uDF7F]' + }, + { + 'name': 'InAlphabetic_Presentation_Forms', + 'bmp': '\uFB00-\uFB4F' + }, + { + 'name': 'InAnatolian_Hieroglyphs', + 'astral': '\uD811[\uDC00-\uDE7F]' + }, + { + 'name': 'InAncient_Greek_Musical_Notation', + 'astral': '\uD834[\uDE00-\uDE4F]' + }, + { + 'name': 'InAncient_Greek_Numbers', + 'astral': '\uD800[\uDD40-\uDD8F]' + }, + { + 'name': 'InAncient_Symbols', + 'astral': '\uD800[\uDD90-\uDDCF]' + }, + { + 'name': 'InArabic', + 'bmp': '\u0600-\u06FF' + }, + { + 'name': 'InArabic_Extended_A', + 'bmp': '\u08A0-\u08FF' + }, + { + 'name': 'InArabic_Mathematical_Alphabetic_Symbols', + 'astral': '\uD83B[\uDE00-\uDEFF]' + }, + { + 'name': 'InArabic_Presentation_Forms_A', + 'bmp': '\uFB50-\uFDFF' + }, + { + 'name': 'InArabic_Presentation_Forms_B', + 'bmp': '\uFE70-\uFEFF' + }, + { + 'name': 'InArabic_Supplement', + 'bmp': '\u0750-\u077F' + }, + { + 'name': 'InArmenian', + 'bmp': '\u0530-\u058F' + }, + { + 'name': 'InArrows', + 'bmp': '\u2190-\u21FF' + }, + { + 'name': 'InAvestan', + 'astral': '\uD802[\uDF00-\uDF3F]' + }, + { + 'name': 'InBalinese', + 'bmp': '\u1B00-\u1B7F' + }, + { + 'name': 'InBamum', + 'bmp': '\uA6A0-\uA6FF' + }, + { + 'name': 'InBamum_Supplement', + 'astral': '\uD81A[\uDC00-\uDE3F]' + }, + { + 'name': 'InBasic_Latin', + 'bmp': '\0-\x7F' + }, + { + 'name': 'InBassa_Vah', + 'astral': '\uD81A[\uDED0-\uDEFF]' + }, + { + 'name': 'InBatak', + 'bmp': '\u1BC0-\u1BFF' + }, + { + 'name': 'InBengali', + 'bmp': '\u0980-\u09FF' + }, + { + 'name': 'InBhaiksuki', + 'astral': '\uD807[\uDC00-\uDC6F]' + }, + { + 'name': 'InBlock_Elements', + 'bmp': '\u2580-\u259F' + }, + { + 'name': 'InBopomofo', + 'bmp': '\u3100-\u312F' + }, + { + 'name': 'InBopomofo_Extended', + 'bmp': '\u31A0-\u31BF' + }, + { + 'name': 'InBox_Drawing', + 'bmp': '\u2500-\u257F' + }, + { + 'name': 'InBrahmi', + 'astral': '\uD804[\uDC00-\uDC7F]' + }, + { + 'name': 'InBraille_Patterns', + 'bmp': '\u2800-\u28FF' + }, + { + 'name': 'InBuginese', + 'bmp': '\u1A00-\u1A1F' + }, + { + 'name': 'InBuhid', + 'bmp': '\u1740-\u175F' + }, + { + 'name': 'InByzantine_Musical_Symbols', + 'astral': '\uD834[\uDC00-\uDCFF]' + }, + { + 'name': 'InCJK_Compatibility', + 'bmp': '\u3300-\u33FF' + }, + { + 'name': 'InCJK_Compatibility_Forms', + 'bmp': '\uFE30-\uFE4F' + }, + { + 'name': 'InCJK_Compatibility_Ideographs', + 'bmp': '\uF900-\uFAFF' + }, + { + 'name': 'InCJK_Compatibility_Ideographs_Supplement', + 'astral': '\uD87E[\uDC00-\uDE1F]' + }, + { + 'name': 'InCJK_Radicals_Supplement', + 'bmp': '\u2E80-\u2EFF' + }, + { + 'name': 'InCJK_Strokes', + 'bmp': '\u31C0-\u31EF' + }, + { + 'name': 'InCJK_Symbols_And_Punctuation', + 'bmp': '\u3000-\u303F' + }, + { + 'name': 'InCJK_Unified_Ideographs', + 'bmp': '\u4E00-\u9FFF' + }, + { + 'name': 'InCJK_Unified_Ideographs_Extension_A', + 'bmp': '\u3400-\u4DBF' + }, + { + 'name': 'InCJK_Unified_Ideographs_Extension_B', + 'astral': '[\uD840-\uD868][\uDC00-\uDFFF]|\uD869[\uDC00-\uDEDF]' + }, + { + 'name': 'InCJK_Unified_Ideographs_Extension_C', + 'astral': '\uD869[\uDF00-\uDFFF]|[\uD86A-\uD86C][\uDC00-\uDFFF]|\uD86D[\uDC00-\uDF3F]' + }, + { + 'name': 'InCJK_Unified_Ideographs_Extension_D', + 'astral': '\uD86D[\uDF40-\uDFFF]|\uD86E[\uDC00-\uDC1F]' + }, + { + 'name': 'InCJK_Unified_Ideographs_Extension_E', + 'astral': '\uD86E[\uDC20-\uDFFF]|[\uD86F-\uD872][\uDC00-\uDFFF]|\uD873[\uDC00-\uDEAF]' + }, + { + 'name': 'InCJK_Unified_Ideographs_Extension_F', + 'astral': '\uD873[\uDEB0-\uDFFF]|[\uD874-\uD879][\uDC00-\uDFFF]|\uD87A[\uDC00-\uDFEF]' + }, + { + 'name': 'InCarian', + 'astral': '\uD800[\uDEA0-\uDEDF]' + }, + { + 'name': 'InCaucasian_Albanian', + 'astral': '\uD801[\uDD30-\uDD6F]' + }, + { + 'name': 'InChakma', + 'astral': '\uD804[\uDD00-\uDD4F]' + }, + { + 'name': 'InCham', + 'bmp': '\uAA00-\uAA5F' + }, + { + 'name': 'InCherokee', + 'bmp': '\u13A0-\u13FF' + }, + { + 'name': 'InCherokee_Supplement', + 'bmp': '\uAB70-\uABBF' + }, + { + 'name': 'InChess_Symbols', + 'astral': '\uD83E[\uDE00-\uDE6F]' + }, + { + 'name': 'InCombining_Diacritical_Marks', + 'bmp': '\u0300-\u036F' + }, + { + 'name': 'InCombining_Diacritical_Marks_Extended', + 'bmp': '\u1AB0-\u1AFF' + }, + { + 'name': 'InCombining_Diacritical_Marks_For_Symbols', + 'bmp': '\u20D0-\u20FF' + }, + { + 'name': 'InCombining_Diacritical_Marks_Supplement', + 'bmp': '\u1DC0-\u1DFF' + }, + { + 'name': 'InCombining_Half_Marks', + 'bmp': '\uFE20-\uFE2F' + }, + { + 'name': 'InCommon_Indic_Number_Forms', + 'bmp': '\uA830-\uA83F' + }, + { + 'name': 'InControl_Pictures', + 'bmp': '\u2400-\u243F' + }, + { + 'name': 'InCoptic', + 'bmp': '\u2C80-\u2CFF' + }, + { + 'name': 'InCoptic_Epact_Numbers', + 'astral': '\uD800[\uDEE0-\uDEFF]' + }, + { + 'name': 'InCounting_Rod_Numerals', + 'astral': '\uD834[\uDF60-\uDF7F]' + }, + { + 'name': 'InCuneiform', + 'astral': '\uD808[\uDC00-\uDFFF]' + }, + { + 'name': 'InCuneiform_Numbers_And_Punctuation', + 'astral': '\uD809[\uDC00-\uDC7F]' + }, + { + 'name': 'InCurrency_Symbols', + 'bmp': '\u20A0-\u20CF' + }, + { + 'name': 'InCypriot_Syllabary', + 'astral': '\uD802[\uDC00-\uDC3F]' + }, + { + 'name': 'InCyrillic', + 'bmp': '\u0400-\u04FF' + }, + { + 'name': 'InCyrillic_Extended_A', + 'bmp': '\u2DE0-\u2DFF' + }, + { + 'name': 'InCyrillic_Extended_B', + 'bmp': '\uA640-\uA69F' + }, + { + 'name': 'InCyrillic_Extended_C', + 'bmp': '\u1C80-\u1C8F' + }, + { + 'name': 'InCyrillic_Supplement', + 'bmp': '\u0500-\u052F' + }, + { + 'name': 'InDeseret', + 'astral': '\uD801[\uDC00-\uDC4F]' + }, + { + 'name': 'InDevanagari', + 'bmp': '\u0900-\u097F' + }, + { + 'name': 'InDevanagari_Extended', + 'bmp': '\uA8E0-\uA8FF' + }, + { + 'name': 'InDingbats', + 'bmp': '\u2700-\u27BF' + }, + { + 'name': 'InDogra', + 'astral': '\uD806[\uDC00-\uDC4F]' + }, + { + 'name': 'InDomino_Tiles', + 'astral': '\uD83C[\uDC30-\uDC9F]' + }, + { + 'name': 'InDuployan', + 'astral': '\uD82F[\uDC00-\uDC9F]' + }, + { + 'name': 'InEarly_Dynastic_Cuneiform', + 'astral': '\uD809[\uDC80-\uDD4F]' + }, + { + 'name': 'InEgyptian_Hieroglyphs', + 'astral': '\uD80C[\uDC00-\uDFFF]|\uD80D[\uDC00-\uDC2F]' + }, + { + 'name': 'InElbasan', + 'astral': '\uD801[\uDD00-\uDD2F]' + }, + { + 'name': 'InEmoticons', + 'astral': '\uD83D[\uDE00-\uDE4F]' + }, + { + 'name': 'InEnclosed_Alphanumeric_Supplement', + 'astral': '\uD83C[\uDD00-\uDDFF]' + }, + { + 'name': 'InEnclosed_Alphanumerics', + 'bmp': '\u2460-\u24FF' + }, + { + 'name': 'InEnclosed_CJK_Letters_And_Months', + 'bmp': '\u3200-\u32FF' + }, + { + 'name': 'InEnclosed_Ideographic_Supplement', + 'astral': '\uD83C[\uDE00-\uDEFF]' + }, + { + 'name': 'InEthiopic', + 'bmp': '\u1200-\u137F' + }, + { + 'name': 'InEthiopic_Extended', + 'bmp': '\u2D80-\u2DDF' + }, + { + 'name': 'InEthiopic_Extended_A', + 'bmp': '\uAB00-\uAB2F' + }, + { + 'name': 'InEthiopic_Supplement', + 'bmp': '\u1380-\u139F' + }, + { + 'name': 'InGeneral_Punctuation', + 'bmp': '\u2000-\u206F' + }, + { + 'name': 'InGeometric_Shapes', + 'bmp': '\u25A0-\u25FF' + }, + { + 'name': 'InGeometric_Shapes_Extended', + 'astral': '\uD83D[\uDF80-\uDFFF]' + }, + { + 'name': 'InGeorgian', + 'bmp': '\u10A0-\u10FF' + }, + { + 'name': 'InGeorgian_Extended', + 'bmp': '\u1C90-\u1CBF' + }, + { + 'name': 'InGeorgian_Supplement', + 'bmp': '\u2D00-\u2D2F' + }, + { + 'name': 'InGlagolitic', + 'bmp': '\u2C00-\u2C5F' + }, + { + 'name': 'InGlagolitic_Supplement', + 'astral': '\uD838[\uDC00-\uDC2F]' + }, + { + 'name': 'InGothic', + 'astral': '\uD800[\uDF30-\uDF4F]' + }, + { + 'name': 'InGrantha', + 'astral': '\uD804[\uDF00-\uDF7F]' + }, + { + 'name': 'InGreek_And_Coptic', + 'bmp': '\u0370-\u03FF' + }, + { + 'name': 'InGreek_Extended', + 'bmp': '\u1F00-\u1FFF' + }, + { + 'name': 'InGujarati', + 'bmp': '\u0A80-\u0AFF' + }, + { + 'name': 'InGunjala_Gondi', + 'astral': '\uD807[\uDD60-\uDDAF]' + }, + { + 'name': 'InGurmukhi', + 'bmp': '\u0A00-\u0A7F' + }, + { + 'name': 'InHalfwidth_And_Fullwidth_Forms', + 'bmp': '\uFF00-\uFFEF' + }, + { + 'name': 'InHangul_Compatibility_Jamo', + 'bmp': '\u3130-\u318F' + }, + { + 'name': 'InHangul_Jamo', + 'bmp': '\u1100-\u11FF' + }, + { + 'name': 'InHangul_Jamo_Extended_A', + 'bmp': '\uA960-\uA97F' + }, + { + 'name': 'InHangul_Jamo_Extended_B', + 'bmp': '\uD7B0-\uD7FF' + }, + { + 'name': 'InHangul_Syllables', + 'bmp': '\uAC00-\uD7AF' + }, + { + 'name': 'InHanifi_Rohingya', + 'astral': '\uD803[\uDD00-\uDD3F]' + }, + { + 'name': 'InHanunoo', + 'bmp': '\u1720-\u173F' + }, + { + 'name': 'InHatran', + 'astral': '\uD802[\uDCE0-\uDCFF]' + }, + { + 'name': 'InHebrew', + 'bmp': '\u0590-\u05FF' + }, + { + 'name': 'InHigh_Private_Use_Surrogates', + 'bmp': '\uDB80-\uDBFF' + }, + { + 'name': 'InHigh_Surrogates', + 'bmp': '\uD800-\uDB7F' + }, + { + 'name': 'InHiragana', + 'bmp': '\u3040-\u309F' + }, + { + 'name': 'InIPA_Extensions', + 'bmp': '\u0250-\u02AF' + }, + { + 'name': 'InIdeographic_Description_Characters', + 'bmp': '\u2FF0-\u2FFF' + }, + { + 'name': 'InIdeographic_Symbols_And_Punctuation', + 'astral': '\uD81B[\uDFE0-\uDFFF]' + }, + { + 'name': 'InImperial_Aramaic', + 'astral': '\uD802[\uDC40-\uDC5F]' + }, + { + 'name': 'InIndic_Siyaq_Numbers', + 'astral': '\uD83B[\uDC70-\uDCBF]' + }, + { + 'name': 'InInscriptional_Pahlavi', + 'astral': '\uD802[\uDF60-\uDF7F]' + }, + { + 'name': 'InInscriptional_Parthian', + 'astral': '\uD802[\uDF40-\uDF5F]' + }, + { + 'name': 'InJavanese', + 'bmp': '\uA980-\uA9DF' + }, + { + 'name': 'InKaithi', + 'astral': '\uD804[\uDC80-\uDCCF]' + }, + { + 'name': 'InKana_Extended_A', + 'astral': '\uD82C[\uDD00-\uDD2F]' + }, + { + 'name': 'InKana_Supplement', + 'astral': '\uD82C[\uDC00-\uDCFF]' + }, + { + 'name': 'InKanbun', + 'bmp': '\u3190-\u319F' + }, + { + 'name': 'InKangxi_Radicals', + 'bmp': '\u2F00-\u2FDF' + }, + { + 'name': 'InKannada', + 'bmp': '\u0C80-\u0CFF' + }, + { + 'name': 'InKatakana', + 'bmp': '\u30A0-\u30FF' + }, + { + 'name': 'InKatakana_Phonetic_Extensions', + 'bmp': '\u31F0-\u31FF' + }, + { + 'name': 'InKayah_Li', + 'bmp': '\uA900-\uA92F' + }, + { + 'name': 'InKharoshthi', + 'astral': '\uD802[\uDE00-\uDE5F]' + }, + { + 'name': 'InKhmer', + 'bmp': '\u1780-\u17FF' + }, + { + 'name': 'InKhmer_Symbols', + 'bmp': '\u19E0-\u19FF' + }, + { + 'name': 'InKhojki', + 'astral': '\uD804[\uDE00-\uDE4F]' + }, + { + 'name': 'InKhudawadi', + 'astral': '\uD804[\uDEB0-\uDEFF]' + }, + { + 'name': 'InLao', + 'bmp': '\u0E80-\u0EFF' + }, + { + 'name': 'InLatin_1_Supplement', + 'bmp': '\x80-\xFF' + }, + { + 'name': 'InLatin_Extended_A', + 'bmp': '\u0100-\u017F' + }, + { + 'name': 'InLatin_Extended_Additional', + 'bmp': '\u1E00-\u1EFF' + }, + { + 'name': 'InLatin_Extended_B', + 'bmp': '\u0180-\u024F' + }, + { + 'name': 'InLatin_Extended_C', + 'bmp': '\u2C60-\u2C7F' + }, + { + 'name': 'InLatin_Extended_D', + 'bmp': '\uA720-\uA7FF' + }, + { + 'name': 'InLatin_Extended_E', + 'bmp': '\uAB30-\uAB6F' + }, + { + 'name': 'InLepcha', + 'bmp': '\u1C00-\u1C4F' + }, + { + 'name': 'InLetterlike_Symbols', + 'bmp': '\u2100-\u214F' + }, + { + 'name': 'InLimbu', + 'bmp': '\u1900-\u194F' + }, + { + 'name': 'InLinear_A', + 'astral': '\uD801[\uDE00-\uDF7F]' + }, + { + 'name': 'InLinear_B_Ideograms', + 'astral': '\uD800[\uDC80-\uDCFF]' + }, + { + 'name': 'InLinear_B_Syllabary', + 'astral': '\uD800[\uDC00-\uDC7F]' + }, + { + 'name': 'InLisu', + 'bmp': '\uA4D0-\uA4FF' + }, + { + 'name': 'InLow_Surrogates', + 'bmp': '\uDC00-\uDFFF' + }, + { + 'name': 'InLycian', + 'astral': '\uD800[\uDE80-\uDE9F]' + }, + { + 'name': 'InLydian', + 'astral': '\uD802[\uDD20-\uDD3F]' + }, + { + 'name': 'InMahajani', + 'astral': '\uD804[\uDD50-\uDD7F]' + }, + { + 'name': 'InMahjong_Tiles', + 'astral': '\uD83C[\uDC00-\uDC2F]' + }, + { + 'name': 'InMakasar', + 'astral': '\uD807[\uDEE0-\uDEFF]' + }, + { + 'name': 'InMalayalam', + 'bmp': '\u0D00-\u0D7F' + }, + { + 'name': 'InMandaic', + 'bmp': '\u0840-\u085F' + }, + { + 'name': 'InManichaean', + 'astral': '\uD802[\uDEC0-\uDEFF]' + }, + { + 'name': 'InMarchen', + 'astral': '\uD807[\uDC70-\uDCBF]' + }, + { + 'name': 'InMasaram_Gondi', + 'astral': '\uD807[\uDD00-\uDD5F]' + }, + { + 'name': 'InMathematical_Alphanumeric_Symbols', + 'astral': '\uD835[\uDC00-\uDFFF]' + }, + { + 'name': 'InMathematical_Operators', + 'bmp': '\u2200-\u22FF' + }, + { + 'name': 'InMayan_Numerals', + 'astral': '\uD834[\uDEE0-\uDEFF]' + }, + { + 'name': 'InMedefaidrin', + 'astral': '\uD81B[\uDE40-\uDE9F]' + }, + { + 'name': 'InMeetei_Mayek', + 'bmp': '\uABC0-\uABFF' + }, + { + 'name': 'InMeetei_Mayek_Extensions', + 'bmp': '\uAAE0-\uAAFF' + }, + { + 'name': 'InMende_Kikakui', + 'astral': '\uD83A[\uDC00-\uDCDF]' + }, + { + 'name': 'InMeroitic_Cursive', + 'astral': '\uD802[\uDDA0-\uDDFF]' + }, + { + 'name': 'InMeroitic_Hieroglyphs', + 'astral': '\uD802[\uDD80-\uDD9F]' + }, + { + 'name': 'InMiao', + 'astral': '\uD81B[\uDF00-\uDF9F]' + }, + { + 'name': 'InMiscellaneous_Mathematical_Symbols_A', + 'bmp': '\u27C0-\u27EF' + }, + { + 'name': 'InMiscellaneous_Mathematical_Symbols_B', + 'bmp': '\u2980-\u29FF' + }, + { + 'name': 'InMiscellaneous_Symbols', + 'bmp': '\u2600-\u26FF' + }, + { + 'name': 'InMiscellaneous_Symbols_And_Arrows', + 'bmp': '\u2B00-\u2BFF' + }, + { + 'name': 'InMiscellaneous_Symbols_And_Pictographs', + 'astral': '\uD83C[\uDF00-\uDFFF]|\uD83D[\uDC00-\uDDFF]' + }, + { + 'name': 'InMiscellaneous_Technical', + 'bmp': '\u2300-\u23FF' + }, + { + 'name': 'InModi', + 'astral': '\uD805[\uDE00-\uDE5F]' + }, + { + 'name': 'InModifier_Tone_Letters', + 'bmp': '\uA700-\uA71F' + }, + { + 'name': 'InMongolian', + 'bmp': '\u1800-\u18AF' + }, + { + 'name': 'InMongolian_Supplement', + 'astral': '\uD805[\uDE60-\uDE7F]' + }, + { + 'name': 'InMro', + 'astral': '\uD81A[\uDE40-\uDE6F]' + }, + { + 'name': 'InMultani', + 'astral': '\uD804[\uDE80-\uDEAF]' + }, + { + 'name': 'InMusical_Symbols', + 'astral': '\uD834[\uDD00-\uDDFF]' + }, + { + 'name': 'InMyanmar', + 'bmp': '\u1000-\u109F' + }, + { + 'name': 'InMyanmar_Extended_A', + 'bmp': '\uAA60-\uAA7F' + }, + { + 'name': 'InMyanmar_Extended_B', + 'bmp': '\uA9E0-\uA9FF' + }, + { + 'name': 'InNKo', + 'bmp': '\u07C0-\u07FF' + }, + { + 'name': 'InNabataean', + 'astral': '\uD802[\uDC80-\uDCAF]' + }, + { + 'name': 'InNew_Tai_Lue', + 'bmp': '\u1980-\u19DF' + }, + { + 'name': 'InNewa', + 'astral': '\uD805[\uDC00-\uDC7F]' + }, + { + 'name': 'InNumber_Forms', + 'bmp': '\u2150-\u218F' + }, + { + 'name': 'InNushu', + 'astral': '\uD82C[\uDD70-\uDEFF]' + }, + { + 'name': 'InOgham', + 'bmp': '\u1680-\u169F' + }, + { + 'name': 'InOl_Chiki', + 'bmp': '\u1C50-\u1C7F' + }, + { + 'name': 'InOld_Hungarian', + 'astral': '\uD803[\uDC80-\uDCFF]' + }, + { + 'name': 'InOld_Italic', + 'astral': '\uD800[\uDF00-\uDF2F]' + }, + { + 'name': 'InOld_North_Arabian', + 'astral': '\uD802[\uDE80-\uDE9F]' + }, + { + 'name': 'InOld_Permic', + 'astral': '\uD800[\uDF50-\uDF7F]' + }, + { + 'name': 'InOld_Persian', + 'astral': '\uD800[\uDFA0-\uDFDF]' + }, + { + 'name': 'InOld_Sogdian', + 'astral': '\uD803[\uDF00-\uDF2F]' + }, + { + 'name': 'InOld_South_Arabian', + 'astral': '\uD802[\uDE60-\uDE7F]' + }, + { + 'name': 'InOld_Turkic', + 'astral': '\uD803[\uDC00-\uDC4F]' + }, + { + 'name': 'InOptical_Character_Recognition', + 'bmp': '\u2440-\u245F' + }, + { + 'name': 'InOriya', + 'bmp': '\u0B00-\u0B7F' + }, + { + 'name': 'InOrnamental_Dingbats', + 'astral': '\uD83D[\uDE50-\uDE7F]' + }, + { + 'name': 'InOsage', + 'astral': '\uD801[\uDCB0-\uDCFF]' + }, + { + 'name': 'InOsmanya', + 'astral': '\uD801[\uDC80-\uDCAF]' + }, + { + 'name': 'InPahawh_Hmong', + 'astral': '\uD81A[\uDF00-\uDF8F]' + }, + { + 'name': 'InPalmyrene', + 'astral': '\uD802[\uDC60-\uDC7F]' + }, + { + 'name': 'InPau_Cin_Hau', + 'astral': '\uD806[\uDEC0-\uDEFF]' + }, + { + 'name': 'InPhags_Pa', + 'bmp': '\uA840-\uA87F' + }, + { + 'name': 'InPhaistos_Disc', + 'astral': '\uD800[\uDDD0-\uDDFF]' + }, + { + 'name': 'InPhoenician', + 'astral': '\uD802[\uDD00-\uDD1F]' + }, + { + 'name': 'InPhonetic_Extensions', + 'bmp': '\u1D00-\u1D7F' + }, + { + 'name': 'InPhonetic_Extensions_Supplement', + 'bmp': '\u1D80-\u1DBF' + }, + { + 'name': 'InPlaying_Cards', + 'astral': '\uD83C[\uDCA0-\uDCFF]' + }, + { + 'name': 'InPrivate_Use_Area', + 'bmp': '\uE000-\uF8FF' + }, + { + 'name': 'InPsalter_Pahlavi', + 'astral': '\uD802[\uDF80-\uDFAF]' + }, + { + 'name': 'InRejang', + 'bmp': '\uA930-\uA95F' + }, + { + 'name': 'InRumi_Numeral_Symbols', + 'astral': '\uD803[\uDE60-\uDE7F]' + }, + { + 'name': 'InRunic', + 'bmp': '\u16A0-\u16FF' + }, + { + 'name': 'InSamaritan', + 'bmp': '\u0800-\u083F' + }, + { + 'name': 'InSaurashtra', + 'bmp': '\uA880-\uA8DF' + }, + { + 'name': 'InSharada', + 'astral': '\uD804[\uDD80-\uDDDF]' + }, + { + 'name': 'InShavian', + 'astral': '\uD801[\uDC50-\uDC7F]' + }, + { + 'name': 'InShorthand_Format_Controls', + 'astral': '\uD82F[\uDCA0-\uDCAF]' + }, + { + 'name': 'InSiddham', + 'astral': '\uD805[\uDD80-\uDDFF]' + }, + { + 'name': 'InSinhala', + 'bmp': '\u0D80-\u0DFF' + }, + { + 'name': 'InSinhala_Archaic_Numbers', + 'astral': '\uD804[\uDDE0-\uDDFF]' + }, + { + 'name': 'InSmall_Form_Variants', + 'bmp': '\uFE50-\uFE6F' + }, + { + 'name': 'InSogdian', + 'astral': '\uD803[\uDF30-\uDF6F]' + }, + { + 'name': 'InSora_Sompeng', + 'astral': '\uD804[\uDCD0-\uDCFF]' + }, + { + 'name': 'InSoyombo', + 'astral': '\uD806[\uDE50-\uDEAF]' + }, + { + 'name': 'InSpacing_Modifier_Letters', + 'bmp': '\u02B0-\u02FF' + }, + { + 'name': 'InSpecials', + 'bmp': '\uFFF0-\uFFFF' + }, + { + 'name': 'InSundanese', + 'bmp': '\u1B80-\u1BBF' + }, + { + 'name': 'InSundanese_Supplement', + 'bmp': '\u1CC0-\u1CCF' + }, + { + 'name': 'InSuperscripts_And_Subscripts', + 'bmp': '\u2070-\u209F' + }, + { + 'name': 'InSupplemental_Arrows_A', + 'bmp': '\u27F0-\u27FF' + }, + { + 'name': 'InSupplemental_Arrows_B', + 'bmp': '\u2900-\u297F' + }, + { + 'name': 'InSupplemental_Arrows_C', + 'astral': '\uD83E[\uDC00-\uDCFF]' + }, + { + 'name': 'InSupplemental_Mathematical_Operators', + 'bmp': '\u2A00-\u2AFF' + }, + { + 'name': 'InSupplemental_Punctuation', + 'bmp': '\u2E00-\u2E7F' + }, + { + 'name': 'InSupplemental_Symbols_And_Pictographs', + 'astral': '\uD83E[\uDD00-\uDDFF]' + }, + { + 'name': 'InSupplementary_Private_Use_Area_A', + 'astral': '[\uDB80-\uDBBF][\uDC00-\uDFFF]' + }, + { + 'name': 'InSupplementary_Private_Use_Area_B', + 'astral': '[\uDBC0-\uDBFF][\uDC00-\uDFFF]' + }, + { + 'name': 'InSutton_SignWriting', + 'astral': '\uD836[\uDC00-\uDEAF]' + }, + { + 'name': 'InSyloti_Nagri', + 'bmp': '\uA800-\uA82F' + }, + { + 'name': 'InSyriac', + 'bmp': '\u0700-\u074F' + }, + { + 'name': 'InSyriac_Supplement', + 'bmp': '\u0860-\u086F' + }, + { + 'name': 'InTagalog', + 'bmp': '\u1700-\u171F' + }, + { + 'name': 'InTagbanwa', + 'bmp': '\u1760-\u177F' + }, + { + 'name': 'InTags', + 'astral': '\uDB40[\uDC00-\uDC7F]' + }, + { + 'name': 'InTai_Le', + 'bmp': '\u1950-\u197F' + }, + { + 'name': 'InTai_Tham', + 'bmp': '\u1A20-\u1AAF' + }, + { + 'name': 'InTai_Viet', + 'bmp': '\uAA80-\uAADF' + }, + { + 'name': 'InTai_Xuan_Jing_Symbols', + 'astral': '\uD834[\uDF00-\uDF5F]' + }, + { + 'name': 'InTakri', + 'astral': '\uD805[\uDE80-\uDECF]' + }, + { + 'name': 'InTamil', + 'bmp': '\u0B80-\u0BFF' + }, + { + 'name': 'InTangut', + 'astral': '[\uD81C-\uD821][\uDC00-\uDFFF]' + }, + { + 'name': 'InTangut_Components', + 'astral': '\uD822[\uDC00-\uDEFF]' + }, + { + 'name': 'InTelugu', + 'bmp': '\u0C00-\u0C7F' + }, + { + 'name': 'InThaana', + 'bmp': '\u0780-\u07BF' + }, + { + 'name': 'InThai', + 'bmp': '\u0E00-\u0E7F' + }, + { + 'name': 'InTibetan', + 'bmp': '\u0F00-\u0FFF' + }, + { + 'name': 'InTifinagh', + 'bmp': '\u2D30-\u2D7F' + }, + { + 'name': 'InTirhuta', + 'astral': '\uD805[\uDC80-\uDCDF]' + }, + { + 'name': 'InTransport_And_Map_Symbols', + 'astral': '\uD83D[\uDE80-\uDEFF]' + }, + { + 'name': 'InUgaritic', + 'astral': '\uD800[\uDF80-\uDF9F]' + }, + { + 'name': 'InUnified_Canadian_Aboriginal_Syllabics', + 'bmp': '\u1400-\u167F' + }, + { + 'name': 'InUnified_Canadian_Aboriginal_Syllabics_Extended', + 'bmp': '\u18B0-\u18FF' + }, + { + 'name': 'InVai', + 'bmp': '\uA500-\uA63F' + }, + { + 'name': 'InVariation_Selectors', + 'bmp': '\uFE00-\uFE0F' + }, + { + 'name': 'InVariation_Selectors_Supplement', + 'astral': '\uDB40[\uDD00-\uDDEF]' + }, + { + 'name': 'InVedic_Extensions', + 'bmp': '\u1CD0-\u1CFF' + }, + { + 'name': 'InVertical_Forms', + 'bmp': '\uFE10-\uFE1F' + }, + { + 'name': 'InWarang_Citi', + 'astral': '\uD806[\uDCA0-\uDCFF]' + }, + { + 'name': 'InYi_Radicals', + 'bmp': '\uA490-\uA4CF' + }, + { + 'name': 'InYi_Syllables', + 'bmp': '\uA000-\uA48F' + }, + { + 'name': 'InYijing_Hexagram_Symbols', + 'bmp': '\u4DC0-\u4DFF' + }, + { + 'name': 'InZanabazar_Square', + 'astral': '\uD806[\uDE00-\uDE4F]' + } +]; + +var unicodeBlocks = createCommonjsModule(function (module, exports) { +"use strict"; + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.default = void 0; + +var _blocks = _interopRequireDefault(blocks); + +function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } + +/*! + * XRegExp Unicode Blocks 4.2.0 + * + * Steven Levithan (c) 2010-present MIT License + * Unicode data by Mathias Bynens + */ +var _default = function _default(XRegExp) { + /** + * Adds support for all Unicode blocks. Block names use the prefix 'In'. E.g., + * `\p{InBasicLatin}`. Token names are case insensitive, and any spaces, hyphens, and + * underscores are ignored. + * + * Uses Unicode 11.0.0. + * + * @requires XRegExp, Unicode Base + */ + if (!XRegExp.addUnicodeData) { + throw new ReferenceError('Unicode Base must be loaded before Unicode Blocks'); + } + + XRegExp.addUnicodeData(_blocks.default); +}; + +exports.default = _default; +module.exports = exports["default"]; +}); + +unwrapExports(unicodeBlocks); + +var categories = [ + { + 'name': 'C', + 'alias': 'Other', + 'isBmpLast': true, + 'bmp': '\0-\x1F\x7F-\x9F\xAD\u0378\u0379\u0380-\u0383\u038B\u038D\u03A2\u0530\u0557\u0558\u058B\u058C\u0590\u05C8-\u05CF\u05EB-\u05EE\u05F5-\u0605\u061C\u061D\u06DD\u070E\u070F\u074B\u074C\u07B2-\u07BF\u07FB\u07FC\u082E\u082F\u083F\u085C\u085D\u085F\u086B-\u089F\u08B5\u08BE-\u08D2\u08E2\u0984\u098D\u098E\u0991\u0992\u09A9\u09B1\u09B3-\u09B5\u09BA\u09BB\u09C5\u09C6\u09C9\u09CA\u09CF-\u09D6\u09D8-\u09DB\u09DE\u09E4\u09E5\u09FF\u0A00\u0A04\u0A0B-\u0A0E\u0A11\u0A12\u0A29\u0A31\u0A34\u0A37\u0A3A\u0A3B\u0A3D\u0A43-\u0A46\u0A49\u0A4A\u0A4E-\u0A50\u0A52-\u0A58\u0A5D\u0A5F-\u0A65\u0A77-\u0A80\u0A84\u0A8E\u0A92\u0AA9\u0AB1\u0AB4\u0ABA\u0ABB\u0AC6\u0ACA\u0ACE\u0ACF\u0AD1-\u0ADF\u0AE4\u0AE5\u0AF2-\u0AF8\u0B00\u0B04\u0B0D\u0B0E\u0B11\u0B12\u0B29\u0B31\u0B34\u0B3A\u0B3B\u0B45\u0B46\u0B49\u0B4A\u0B4E-\u0B55\u0B58-\u0B5B\u0B5E\u0B64\u0B65\u0B78-\u0B81\u0B84\u0B8B-\u0B8D\u0B91\u0B96-\u0B98\u0B9B\u0B9D\u0BA0-\u0BA2\u0BA5-\u0BA7\u0BAB-\u0BAD\u0BBA-\u0BBD\u0BC3-\u0BC5\u0BC9\u0BCE\u0BCF\u0BD1-\u0BD6\u0BD8-\u0BE5\u0BFB-\u0BFF\u0C0D\u0C11\u0C29\u0C3A-\u0C3C\u0C45\u0C49\u0C4E-\u0C54\u0C57\u0C5B-\u0C5F\u0C64\u0C65\u0C70-\u0C77\u0C8D\u0C91\u0CA9\u0CB4\u0CBA\u0CBB\u0CC5\u0CC9\u0CCE-\u0CD4\u0CD7-\u0CDD\u0CDF\u0CE4\u0CE5\u0CF0\u0CF3-\u0CFF\u0D04\u0D0D\u0D11\u0D45\u0D49\u0D50-\u0D53\u0D64\u0D65\u0D80\u0D81\u0D84\u0D97-\u0D99\u0DB2\u0DBC\u0DBE\u0DBF\u0DC7-\u0DC9\u0DCB-\u0DCE\u0DD5\u0DD7\u0DE0-\u0DE5\u0DF0\u0DF1\u0DF5-\u0E00\u0E3B-\u0E3E\u0E5C-\u0E80\u0E83\u0E85\u0E86\u0E89\u0E8B\u0E8C\u0E8E-\u0E93\u0E98\u0EA0\u0EA4\u0EA6\u0EA8\u0EA9\u0EAC\u0EBA\u0EBE\u0EBF\u0EC5\u0EC7\u0ECE\u0ECF\u0EDA\u0EDB\u0EE0-\u0EFF\u0F48\u0F6D-\u0F70\u0F98\u0FBD\u0FCD\u0FDB-\u0FFF\u10C6\u10C8-\u10CC\u10CE\u10CF\u1249\u124E\u124F\u1257\u1259\u125E\u125F\u1289\u128E\u128F\u12B1\u12B6\u12B7\u12BF\u12C1\u12C6\u12C7\u12D7\u1311\u1316\u1317\u135B\u135C\u137D-\u137F\u139A-\u139F\u13F6\u13F7\u13FE\u13FF\u169D-\u169F\u16F9-\u16FF\u170D\u1715-\u171F\u1737-\u173F\u1754-\u175F\u176D\u1771\u1774-\u177F\u17DE\u17DF\u17EA-\u17EF\u17FA-\u17FF\u180E\u180F\u181A-\u181F\u1879-\u187F\u18AB-\u18AF\u18F6-\u18FF\u191F\u192C-\u192F\u193C-\u193F\u1941-\u1943\u196E\u196F\u1975-\u197F\u19AC-\u19AF\u19CA-\u19CF\u19DB-\u19DD\u1A1C\u1A1D\u1A5F\u1A7D\u1A7E\u1A8A-\u1A8F\u1A9A-\u1A9F\u1AAE\u1AAF\u1ABF-\u1AFF\u1B4C-\u1B4F\u1B7D-\u1B7F\u1BF4-\u1BFB\u1C38-\u1C3A\u1C4A-\u1C4C\u1C89-\u1C8F\u1CBB\u1CBC\u1CC8-\u1CCF\u1CFA-\u1CFF\u1DFA\u1F16\u1F17\u1F1E\u1F1F\u1F46\u1F47\u1F4E\u1F4F\u1F58\u1F5A\u1F5C\u1F5E\u1F7E\u1F7F\u1FB5\u1FC5\u1FD4\u1FD5\u1FDC\u1FF0\u1FF1\u1FF5\u1FFF\u200B-\u200F\u202A-\u202E\u2060-\u206F\u2072\u2073\u208F\u209D-\u209F\u20C0-\u20CF\u20F1-\u20FF\u218C-\u218F\u2427-\u243F\u244B-\u245F\u2B74\u2B75\u2B96\u2B97\u2BC9\u2BFF\u2C2F\u2C5F\u2CF4-\u2CF8\u2D26\u2D28-\u2D2C\u2D2E\u2D2F\u2D68-\u2D6E\u2D71-\u2D7E\u2D97-\u2D9F\u2DA7\u2DAF\u2DB7\u2DBF\u2DC7\u2DCF\u2DD7\u2DDF\u2E4F-\u2E7F\u2E9A\u2EF4-\u2EFF\u2FD6-\u2FEF\u2FFC-\u2FFF\u3040\u3097\u3098\u3100-\u3104\u3130\u318F\u31BB-\u31BF\u31E4-\u31EF\u321F\u32FF\u4DB6-\u4DBF\u9FF0-\u9FFF\uA48D-\uA48F\uA4C7-\uA4CF\uA62C-\uA63F\uA6F8-\uA6FF\uA7BA-\uA7F6\uA82C-\uA82F\uA83A-\uA83F\uA878-\uA87F\uA8C6-\uA8CD\uA8DA-\uA8DF\uA954-\uA95E\uA97D-\uA97F\uA9CE\uA9DA-\uA9DD\uA9FF\uAA37-\uAA3F\uAA4E\uAA4F\uAA5A\uAA5B\uAAC3-\uAADA\uAAF7-\uAB00\uAB07\uAB08\uAB0F\uAB10\uAB17-\uAB1F\uAB27\uAB2F\uAB66-\uAB6F\uABEE\uABEF\uABFA-\uABFF\uD7A4-\uD7AF\uD7C7-\uD7CA\uD7FC-\uF8FF\uFA6E\uFA6F\uFADA-\uFAFF\uFB07-\uFB12\uFB18-\uFB1C\uFB37\uFB3D\uFB3F\uFB42\uFB45\uFBC2-\uFBD2\uFD40-\uFD4F\uFD90\uFD91\uFDC8-\uFDEF\uFDFE\uFDFF\uFE1A-\uFE1F\uFE53\uFE67\uFE6C-\uFE6F\uFE75\uFEFD-\uFF00\uFFBF-\uFFC1\uFFC8\uFFC9\uFFD0\uFFD1\uFFD8\uFFD9\uFFDD-\uFFDF\uFFE7\uFFEF-\uFFFB\uFFFE\uFFFF', + 'astral': '\uD800[\uDC0C\uDC27\uDC3B\uDC3E\uDC4E\uDC4F\uDC5E-\uDC7F\uDCFB-\uDCFF\uDD03-\uDD06\uDD34-\uDD36\uDD8F\uDD9C-\uDD9F\uDDA1-\uDDCF\uDDFE-\uDE7F\uDE9D-\uDE9F\uDED1-\uDEDF\uDEFC-\uDEFF\uDF24-\uDF2C\uDF4B-\uDF4F\uDF7B-\uDF7F\uDF9E\uDFC4-\uDFC7\uDFD6-\uDFFF]|\uD801[\uDC9E\uDC9F\uDCAA-\uDCAF\uDCD4-\uDCD7\uDCFC-\uDCFF\uDD28-\uDD2F\uDD64-\uDD6E\uDD70-\uDDFF\uDF37-\uDF3F\uDF56-\uDF5F\uDF68-\uDFFF]|\uD802[\uDC06\uDC07\uDC09\uDC36\uDC39-\uDC3B\uDC3D\uDC3E\uDC56\uDC9F-\uDCA6\uDCB0-\uDCDF\uDCF3\uDCF6-\uDCFA\uDD1C-\uDD1E\uDD3A-\uDD3E\uDD40-\uDD7F\uDDB8-\uDDBB\uDDD0\uDDD1\uDE04\uDE07-\uDE0B\uDE14\uDE18\uDE36\uDE37\uDE3B-\uDE3E\uDE49-\uDE4F\uDE59-\uDE5F\uDEA0-\uDEBF\uDEE7-\uDEEA\uDEF7-\uDEFF\uDF36-\uDF38\uDF56\uDF57\uDF73-\uDF77\uDF92-\uDF98\uDF9D-\uDFA8\uDFB0-\uDFFF]|\uD803[\uDC49-\uDC7F\uDCB3-\uDCBF\uDCF3-\uDCF9\uDD28-\uDD2F\uDD3A-\uDE5F\uDE7F-\uDEFF\uDF28-\uDF2F\uDF5A-\uDFFF]|\uD804[\uDC4E-\uDC51\uDC70-\uDC7E\uDCBD\uDCC2-\uDCCF\uDCE9-\uDCEF\uDCFA-\uDCFF\uDD35\uDD47-\uDD4F\uDD77-\uDD7F\uDDCE\uDDCF\uDDE0\uDDF5-\uDDFF\uDE12\uDE3F-\uDE7F\uDE87\uDE89\uDE8E\uDE9E\uDEAA-\uDEAF\uDEEB-\uDEEF\uDEFA-\uDEFF\uDF04\uDF0D\uDF0E\uDF11\uDF12\uDF29\uDF31\uDF34\uDF3A\uDF45\uDF46\uDF49\uDF4A\uDF4E\uDF4F\uDF51-\uDF56\uDF58-\uDF5C\uDF64\uDF65\uDF6D-\uDF6F\uDF75-\uDFFF]|\uD805[\uDC5A\uDC5C\uDC5F-\uDC7F\uDCC8-\uDCCF\uDCDA-\uDD7F\uDDB6\uDDB7\uDDDE-\uDDFF\uDE45-\uDE4F\uDE5A-\uDE5F\uDE6D-\uDE7F\uDEB8-\uDEBF\uDECA-\uDEFF\uDF1B\uDF1C\uDF2C-\uDF2F\uDF40-\uDFFF]|\uD806[\uDC3C-\uDC9F\uDCF3-\uDCFE\uDD00-\uDDFF\uDE48-\uDE4F\uDE84\uDE85\uDEA3-\uDEBF\uDEF9-\uDFFF]|\uD807[\uDC09\uDC37\uDC46-\uDC4F\uDC6D-\uDC6F\uDC90\uDC91\uDCA8\uDCB7-\uDCFF\uDD07\uDD0A\uDD37-\uDD39\uDD3B\uDD3E\uDD48-\uDD4F\uDD5A-\uDD5F\uDD66\uDD69\uDD8F\uDD92\uDD99-\uDD9F\uDDAA-\uDEDF\uDEF9-\uDFFF]|\uD808[\uDF9A-\uDFFF]|\uD809[\uDC6F\uDC75-\uDC7F\uDD44-\uDFFF]|[\uD80A\uD80B\uD80E-\uD810\uD812-\uD819\uD823-\uD82B\uD82D\uD82E\uD830-\uD833\uD837\uD839\uD83F\uD87B-\uD87D\uD87F-\uDB3F\uDB41-\uDBFF][\uDC00-\uDFFF]|\uD80D[\uDC2F-\uDFFF]|\uD811[\uDE47-\uDFFF]|\uD81A[\uDE39-\uDE3F\uDE5F\uDE6A-\uDE6D\uDE70-\uDECF\uDEEE\uDEEF\uDEF6-\uDEFF\uDF46-\uDF4F\uDF5A\uDF62\uDF78-\uDF7C\uDF90-\uDFFF]|\uD81B[\uDC00-\uDE3F\uDE9B-\uDEFF\uDF45-\uDF4F\uDF7F-\uDF8E\uDFA0-\uDFDF\uDFE2-\uDFFF]|\uD821[\uDFF2-\uDFFF]|\uD822[\uDEF3-\uDFFF]|\uD82C[\uDD1F-\uDD6F\uDEFC-\uDFFF]|\uD82F[\uDC6B-\uDC6F\uDC7D-\uDC7F\uDC89-\uDC8F\uDC9A\uDC9B\uDCA0-\uDFFF]|\uD834[\uDCF6-\uDCFF\uDD27\uDD28\uDD73-\uDD7A\uDDE9-\uDDFF\uDE46-\uDEDF\uDEF4-\uDEFF\uDF57-\uDF5F\uDF79-\uDFFF]|\uD835[\uDC55\uDC9D\uDCA0\uDCA1\uDCA3\uDCA4\uDCA7\uDCA8\uDCAD\uDCBA\uDCBC\uDCC4\uDD06\uDD0B\uDD0C\uDD15\uDD1D\uDD3A\uDD3F\uDD45\uDD47-\uDD49\uDD51\uDEA6\uDEA7\uDFCC\uDFCD]|\uD836[\uDE8C-\uDE9A\uDEA0\uDEB0-\uDFFF]|\uD838[\uDC07\uDC19\uDC1A\uDC22\uDC25\uDC2B-\uDFFF]|\uD83A[\uDCC5\uDCC6\uDCD7-\uDCFF\uDD4B-\uDD4F\uDD5A-\uDD5D\uDD60-\uDFFF]|\uD83B[\uDC00-\uDC70\uDCB5-\uDDFF\uDE04\uDE20\uDE23\uDE25\uDE26\uDE28\uDE33\uDE38\uDE3A\uDE3C-\uDE41\uDE43-\uDE46\uDE48\uDE4A\uDE4C\uDE50\uDE53\uDE55\uDE56\uDE58\uDE5A\uDE5C\uDE5E\uDE60\uDE63\uDE65\uDE66\uDE6B\uDE73\uDE78\uDE7D\uDE7F\uDE8A\uDE9C-\uDEA0\uDEA4\uDEAA\uDEBC-\uDEEF\uDEF2-\uDFFF]|\uD83C[\uDC2C-\uDC2F\uDC94-\uDC9F\uDCAF\uDCB0\uDCC0\uDCD0\uDCF6-\uDCFF\uDD0D-\uDD0F\uDD6C-\uDD6F\uDDAD-\uDDE5\uDE03-\uDE0F\uDE3C-\uDE3F\uDE49-\uDE4F\uDE52-\uDE5F\uDE66-\uDEFF]|\uD83D[\uDED5-\uDEDF\uDEED-\uDEEF\uDEFA-\uDEFF\uDF74-\uDF7F\uDFD9-\uDFFF]|\uD83E[\uDC0C-\uDC0F\uDC48-\uDC4F\uDC5A-\uDC5F\uDC88-\uDC8F\uDCAE-\uDCFF\uDD0C-\uDD0F\uDD3F\uDD71\uDD72\uDD77-\uDD79\uDD7B\uDDA3-\uDDAF\uDDBA-\uDDBF\uDDC3-\uDDCF\uDE00-\uDE5F\uDE6E-\uDFFF]|\uD869[\uDED7-\uDEFF]|\uD86D[\uDF35-\uDF3F]|\uD86E[\uDC1E\uDC1F]|\uD873[\uDEA2-\uDEAF]|\uD87A[\uDFE1-\uDFFF]|\uD87E[\uDE1E-\uDFFF]|\uDB40[\uDC00-\uDCFF\uDDF0-\uDFFF]' + }, + { + 'name': 'Cc', + 'alias': 'Control', + 'bmp': '\0-\x1F\x7F-\x9F' + }, + { + 'name': 'Cf', + 'alias': 'Format', + 'bmp': '\xAD\u0600-\u0605\u061C\u06DD\u070F\u08E2\u180E\u200B-\u200F\u202A-\u202E\u2060-\u2064\u2066-\u206F\uFEFF\uFFF9-\uFFFB', + 'astral': '\uD804[\uDCBD\uDCCD]|\uD82F[\uDCA0-\uDCA3]|\uD834[\uDD73-\uDD7A]|\uDB40[\uDC01\uDC20-\uDC7F]' + }, + { + 'name': 'Cn', + 'alias': 'Unassigned', + 'bmp': '\u0378\u0379\u0380-\u0383\u038B\u038D\u03A2\u0530\u0557\u0558\u058B\u058C\u0590\u05C8-\u05CF\u05EB-\u05EE\u05F5-\u05FF\u061D\u070E\u074B\u074C\u07B2-\u07BF\u07FB\u07FC\u082E\u082F\u083F\u085C\u085D\u085F\u086B-\u089F\u08B5\u08BE-\u08D2\u0984\u098D\u098E\u0991\u0992\u09A9\u09B1\u09B3-\u09B5\u09BA\u09BB\u09C5\u09C6\u09C9\u09CA\u09CF-\u09D6\u09D8-\u09DB\u09DE\u09E4\u09E5\u09FF\u0A00\u0A04\u0A0B-\u0A0E\u0A11\u0A12\u0A29\u0A31\u0A34\u0A37\u0A3A\u0A3B\u0A3D\u0A43-\u0A46\u0A49\u0A4A\u0A4E-\u0A50\u0A52-\u0A58\u0A5D\u0A5F-\u0A65\u0A77-\u0A80\u0A84\u0A8E\u0A92\u0AA9\u0AB1\u0AB4\u0ABA\u0ABB\u0AC6\u0ACA\u0ACE\u0ACF\u0AD1-\u0ADF\u0AE4\u0AE5\u0AF2-\u0AF8\u0B00\u0B04\u0B0D\u0B0E\u0B11\u0B12\u0B29\u0B31\u0B34\u0B3A\u0B3B\u0B45\u0B46\u0B49\u0B4A\u0B4E-\u0B55\u0B58-\u0B5B\u0B5E\u0B64\u0B65\u0B78-\u0B81\u0B84\u0B8B-\u0B8D\u0B91\u0B96-\u0B98\u0B9B\u0B9D\u0BA0-\u0BA2\u0BA5-\u0BA7\u0BAB-\u0BAD\u0BBA-\u0BBD\u0BC3-\u0BC5\u0BC9\u0BCE\u0BCF\u0BD1-\u0BD6\u0BD8-\u0BE5\u0BFB-\u0BFF\u0C0D\u0C11\u0C29\u0C3A-\u0C3C\u0C45\u0C49\u0C4E-\u0C54\u0C57\u0C5B-\u0C5F\u0C64\u0C65\u0C70-\u0C77\u0C8D\u0C91\u0CA9\u0CB4\u0CBA\u0CBB\u0CC5\u0CC9\u0CCE-\u0CD4\u0CD7-\u0CDD\u0CDF\u0CE4\u0CE5\u0CF0\u0CF3-\u0CFF\u0D04\u0D0D\u0D11\u0D45\u0D49\u0D50-\u0D53\u0D64\u0D65\u0D80\u0D81\u0D84\u0D97-\u0D99\u0DB2\u0DBC\u0DBE\u0DBF\u0DC7-\u0DC9\u0DCB-\u0DCE\u0DD5\u0DD7\u0DE0-\u0DE5\u0DF0\u0DF1\u0DF5-\u0E00\u0E3B-\u0E3E\u0E5C-\u0E80\u0E83\u0E85\u0E86\u0E89\u0E8B\u0E8C\u0E8E-\u0E93\u0E98\u0EA0\u0EA4\u0EA6\u0EA8\u0EA9\u0EAC\u0EBA\u0EBE\u0EBF\u0EC5\u0EC7\u0ECE\u0ECF\u0EDA\u0EDB\u0EE0-\u0EFF\u0F48\u0F6D-\u0F70\u0F98\u0FBD\u0FCD\u0FDB-\u0FFF\u10C6\u10C8-\u10CC\u10CE\u10CF\u1249\u124E\u124F\u1257\u1259\u125E\u125F\u1289\u128E\u128F\u12B1\u12B6\u12B7\u12BF\u12C1\u12C6\u12C7\u12D7\u1311\u1316\u1317\u135B\u135C\u137D-\u137F\u139A-\u139F\u13F6\u13F7\u13FE\u13FF\u169D-\u169F\u16F9-\u16FF\u170D\u1715-\u171F\u1737-\u173F\u1754-\u175F\u176D\u1771\u1774-\u177F\u17DE\u17DF\u17EA-\u17EF\u17FA-\u17FF\u180F\u181A-\u181F\u1879-\u187F\u18AB-\u18AF\u18F6-\u18FF\u191F\u192C-\u192F\u193C-\u193F\u1941-\u1943\u196E\u196F\u1975-\u197F\u19AC-\u19AF\u19CA-\u19CF\u19DB-\u19DD\u1A1C\u1A1D\u1A5F\u1A7D\u1A7E\u1A8A-\u1A8F\u1A9A-\u1A9F\u1AAE\u1AAF\u1ABF-\u1AFF\u1B4C-\u1B4F\u1B7D-\u1B7F\u1BF4-\u1BFB\u1C38-\u1C3A\u1C4A-\u1C4C\u1C89-\u1C8F\u1CBB\u1CBC\u1CC8-\u1CCF\u1CFA-\u1CFF\u1DFA\u1F16\u1F17\u1F1E\u1F1F\u1F46\u1F47\u1F4E\u1F4F\u1F58\u1F5A\u1F5C\u1F5E\u1F7E\u1F7F\u1FB5\u1FC5\u1FD4\u1FD5\u1FDC\u1FF0\u1FF1\u1FF5\u1FFF\u2065\u2072\u2073\u208F\u209D-\u209F\u20C0-\u20CF\u20F1-\u20FF\u218C-\u218F\u2427-\u243F\u244B-\u245F\u2B74\u2B75\u2B96\u2B97\u2BC9\u2BFF\u2C2F\u2C5F\u2CF4-\u2CF8\u2D26\u2D28-\u2D2C\u2D2E\u2D2F\u2D68-\u2D6E\u2D71-\u2D7E\u2D97-\u2D9F\u2DA7\u2DAF\u2DB7\u2DBF\u2DC7\u2DCF\u2DD7\u2DDF\u2E4F-\u2E7F\u2E9A\u2EF4-\u2EFF\u2FD6-\u2FEF\u2FFC-\u2FFF\u3040\u3097\u3098\u3100-\u3104\u3130\u318F\u31BB-\u31BF\u31E4-\u31EF\u321F\u32FF\u4DB6-\u4DBF\u9FF0-\u9FFF\uA48D-\uA48F\uA4C7-\uA4CF\uA62C-\uA63F\uA6F8-\uA6FF\uA7BA-\uA7F6\uA82C-\uA82F\uA83A-\uA83F\uA878-\uA87F\uA8C6-\uA8CD\uA8DA-\uA8DF\uA954-\uA95E\uA97D-\uA97F\uA9CE\uA9DA-\uA9DD\uA9FF\uAA37-\uAA3F\uAA4E\uAA4F\uAA5A\uAA5B\uAAC3-\uAADA\uAAF7-\uAB00\uAB07\uAB08\uAB0F\uAB10\uAB17-\uAB1F\uAB27\uAB2F\uAB66-\uAB6F\uABEE\uABEF\uABFA-\uABFF\uD7A4-\uD7AF\uD7C7-\uD7CA\uD7FC-\uD7FF\uFA6E\uFA6F\uFADA-\uFAFF\uFB07-\uFB12\uFB18-\uFB1C\uFB37\uFB3D\uFB3F\uFB42\uFB45\uFBC2-\uFBD2\uFD40-\uFD4F\uFD90\uFD91\uFDC8-\uFDEF\uFDFE\uFDFF\uFE1A-\uFE1F\uFE53\uFE67\uFE6C-\uFE6F\uFE75\uFEFD\uFEFE\uFF00\uFFBF-\uFFC1\uFFC8\uFFC9\uFFD0\uFFD1\uFFD8\uFFD9\uFFDD-\uFFDF\uFFE7\uFFEF-\uFFF8\uFFFE\uFFFF', + 'astral': '\uD800[\uDC0C\uDC27\uDC3B\uDC3E\uDC4E\uDC4F\uDC5E-\uDC7F\uDCFB-\uDCFF\uDD03-\uDD06\uDD34-\uDD36\uDD8F\uDD9C-\uDD9F\uDDA1-\uDDCF\uDDFE-\uDE7F\uDE9D-\uDE9F\uDED1-\uDEDF\uDEFC-\uDEFF\uDF24-\uDF2C\uDF4B-\uDF4F\uDF7B-\uDF7F\uDF9E\uDFC4-\uDFC7\uDFD6-\uDFFF]|\uD801[\uDC9E\uDC9F\uDCAA-\uDCAF\uDCD4-\uDCD7\uDCFC-\uDCFF\uDD28-\uDD2F\uDD64-\uDD6E\uDD70-\uDDFF\uDF37-\uDF3F\uDF56-\uDF5F\uDF68-\uDFFF]|\uD802[\uDC06\uDC07\uDC09\uDC36\uDC39-\uDC3B\uDC3D\uDC3E\uDC56\uDC9F-\uDCA6\uDCB0-\uDCDF\uDCF3\uDCF6-\uDCFA\uDD1C-\uDD1E\uDD3A-\uDD3E\uDD40-\uDD7F\uDDB8-\uDDBB\uDDD0\uDDD1\uDE04\uDE07-\uDE0B\uDE14\uDE18\uDE36\uDE37\uDE3B-\uDE3E\uDE49-\uDE4F\uDE59-\uDE5F\uDEA0-\uDEBF\uDEE7-\uDEEA\uDEF7-\uDEFF\uDF36-\uDF38\uDF56\uDF57\uDF73-\uDF77\uDF92-\uDF98\uDF9D-\uDFA8\uDFB0-\uDFFF]|\uD803[\uDC49-\uDC7F\uDCB3-\uDCBF\uDCF3-\uDCF9\uDD28-\uDD2F\uDD3A-\uDE5F\uDE7F-\uDEFF\uDF28-\uDF2F\uDF5A-\uDFFF]|\uD804[\uDC4E-\uDC51\uDC70-\uDC7E\uDCC2-\uDCCC\uDCCE\uDCCF\uDCE9-\uDCEF\uDCFA-\uDCFF\uDD35\uDD47-\uDD4F\uDD77-\uDD7F\uDDCE\uDDCF\uDDE0\uDDF5-\uDDFF\uDE12\uDE3F-\uDE7F\uDE87\uDE89\uDE8E\uDE9E\uDEAA-\uDEAF\uDEEB-\uDEEF\uDEFA-\uDEFF\uDF04\uDF0D\uDF0E\uDF11\uDF12\uDF29\uDF31\uDF34\uDF3A\uDF45\uDF46\uDF49\uDF4A\uDF4E\uDF4F\uDF51-\uDF56\uDF58-\uDF5C\uDF64\uDF65\uDF6D-\uDF6F\uDF75-\uDFFF]|\uD805[\uDC5A\uDC5C\uDC5F-\uDC7F\uDCC8-\uDCCF\uDCDA-\uDD7F\uDDB6\uDDB7\uDDDE-\uDDFF\uDE45-\uDE4F\uDE5A-\uDE5F\uDE6D-\uDE7F\uDEB8-\uDEBF\uDECA-\uDEFF\uDF1B\uDF1C\uDF2C-\uDF2F\uDF40-\uDFFF]|\uD806[\uDC3C-\uDC9F\uDCF3-\uDCFE\uDD00-\uDDFF\uDE48-\uDE4F\uDE84\uDE85\uDEA3-\uDEBF\uDEF9-\uDFFF]|\uD807[\uDC09\uDC37\uDC46-\uDC4F\uDC6D-\uDC6F\uDC90\uDC91\uDCA8\uDCB7-\uDCFF\uDD07\uDD0A\uDD37-\uDD39\uDD3B\uDD3E\uDD48-\uDD4F\uDD5A-\uDD5F\uDD66\uDD69\uDD8F\uDD92\uDD99-\uDD9F\uDDAA-\uDEDF\uDEF9-\uDFFF]|\uD808[\uDF9A-\uDFFF]|\uD809[\uDC6F\uDC75-\uDC7F\uDD44-\uDFFF]|[\uD80A\uD80B\uD80E-\uD810\uD812-\uD819\uD823-\uD82B\uD82D\uD82E\uD830-\uD833\uD837\uD839\uD83F\uD87B-\uD87D\uD87F-\uDB3F\uDB41-\uDB7F][\uDC00-\uDFFF]|\uD80D[\uDC2F-\uDFFF]|\uD811[\uDE47-\uDFFF]|\uD81A[\uDE39-\uDE3F\uDE5F\uDE6A-\uDE6D\uDE70-\uDECF\uDEEE\uDEEF\uDEF6-\uDEFF\uDF46-\uDF4F\uDF5A\uDF62\uDF78-\uDF7C\uDF90-\uDFFF]|\uD81B[\uDC00-\uDE3F\uDE9B-\uDEFF\uDF45-\uDF4F\uDF7F-\uDF8E\uDFA0-\uDFDF\uDFE2-\uDFFF]|\uD821[\uDFF2-\uDFFF]|\uD822[\uDEF3-\uDFFF]|\uD82C[\uDD1F-\uDD6F\uDEFC-\uDFFF]|\uD82F[\uDC6B-\uDC6F\uDC7D-\uDC7F\uDC89-\uDC8F\uDC9A\uDC9B\uDCA4-\uDFFF]|\uD834[\uDCF6-\uDCFF\uDD27\uDD28\uDDE9-\uDDFF\uDE46-\uDEDF\uDEF4-\uDEFF\uDF57-\uDF5F\uDF79-\uDFFF]|\uD835[\uDC55\uDC9D\uDCA0\uDCA1\uDCA3\uDCA4\uDCA7\uDCA8\uDCAD\uDCBA\uDCBC\uDCC4\uDD06\uDD0B\uDD0C\uDD15\uDD1D\uDD3A\uDD3F\uDD45\uDD47-\uDD49\uDD51\uDEA6\uDEA7\uDFCC\uDFCD]|\uD836[\uDE8C-\uDE9A\uDEA0\uDEB0-\uDFFF]|\uD838[\uDC07\uDC19\uDC1A\uDC22\uDC25\uDC2B-\uDFFF]|\uD83A[\uDCC5\uDCC6\uDCD7-\uDCFF\uDD4B-\uDD4F\uDD5A-\uDD5D\uDD60-\uDFFF]|\uD83B[\uDC00-\uDC70\uDCB5-\uDDFF\uDE04\uDE20\uDE23\uDE25\uDE26\uDE28\uDE33\uDE38\uDE3A\uDE3C-\uDE41\uDE43-\uDE46\uDE48\uDE4A\uDE4C\uDE50\uDE53\uDE55\uDE56\uDE58\uDE5A\uDE5C\uDE5E\uDE60\uDE63\uDE65\uDE66\uDE6B\uDE73\uDE78\uDE7D\uDE7F\uDE8A\uDE9C-\uDEA0\uDEA4\uDEAA\uDEBC-\uDEEF\uDEF2-\uDFFF]|\uD83C[\uDC2C-\uDC2F\uDC94-\uDC9F\uDCAF\uDCB0\uDCC0\uDCD0\uDCF6-\uDCFF\uDD0D-\uDD0F\uDD6C-\uDD6F\uDDAD-\uDDE5\uDE03-\uDE0F\uDE3C-\uDE3F\uDE49-\uDE4F\uDE52-\uDE5F\uDE66-\uDEFF]|\uD83D[\uDED5-\uDEDF\uDEED-\uDEEF\uDEFA-\uDEFF\uDF74-\uDF7F\uDFD9-\uDFFF]|\uD83E[\uDC0C-\uDC0F\uDC48-\uDC4F\uDC5A-\uDC5F\uDC88-\uDC8F\uDCAE-\uDCFF\uDD0C-\uDD0F\uDD3F\uDD71\uDD72\uDD77-\uDD79\uDD7B\uDDA3-\uDDAF\uDDBA-\uDDBF\uDDC3-\uDDCF\uDE00-\uDE5F\uDE6E-\uDFFF]|\uD869[\uDED7-\uDEFF]|\uD86D[\uDF35-\uDF3F]|\uD86E[\uDC1E\uDC1F]|\uD873[\uDEA2-\uDEAF]|\uD87A[\uDFE1-\uDFFF]|\uD87E[\uDE1E-\uDFFF]|\uDB40[\uDC00\uDC02-\uDC1F\uDC80-\uDCFF\uDDF0-\uDFFF]|[\uDBBF\uDBFF][\uDFFE\uDFFF]' + }, + { + 'name': 'Co', + 'alias': 'Private_Use', + 'bmp': '\uE000-\uF8FF', + 'astral': '[\uDB80-\uDBBE\uDBC0-\uDBFE][\uDC00-\uDFFF]|[\uDBBF\uDBFF][\uDC00-\uDFFD]' + }, + { + 'name': 'Cs', + 'alias': 'Surrogate', + 'bmp': '\uD800-\uDFFF' + }, + { + 'name': 'L', + 'alias': 'Letter', + 'bmp': 'A-Za-z\xAA\xB5\xBA\xC0-\xD6\xD8-\xF6\xF8-\u02C1\u02C6-\u02D1\u02E0-\u02E4\u02EC\u02EE\u0370-\u0374\u0376\u0377\u037A-\u037D\u037F\u0386\u0388-\u038A\u038C\u038E-\u03A1\u03A3-\u03F5\u03F7-\u0481\u048A-\u052F\u0531-\u0556\u0559\u0560-\u0588\u05D0-\u05EA\u05EF-\u05F2\u0620-\u064A\u066E\u066F\u0671-\u06D3\u06D5\u06E5\u06E6\u06EE\u06EF\u06FA-\u06FC\u06FF\u0710\u0712-\u072F\u074D-\u07A5\u07B1\u07CA-\u07EA\u07F4\u07F5\u07FA\u0800-\u0815\u081A\u0824\u0828\u0840-\u0858\u0860-\u086A\u08A0-\u08B4\u08B6-\u08BD\u0904-\u0939\u093D\u0950\u0958-\u0961\u0971-\u0980\u0985-\u098C\u098F\u0990\u0993-\u09A8\u09AA-\u09B0\u09B2\u09B6-\u09B9\u09BD\u09CE\u09DC\u09DD\u09DF-\u09E1\u09F0\u09F1\u09FC\u0A05-\u0A0A\u0A0F\u0A10\u0A13-\u0A28\u0A2A-\u0A30\u0A32\u0A33\u0A35\u0A36\u0A38\u0A39\u0A59-\u0A5C\u0A5E\u0A72-\u0A74\u0A85-\u0A8D\u0A8F-\u0A91\u0A93-\u0AA8\u0AAA-\u0AB0\u0AB2\u0AB3\u0AB5-\u0AB9\u0ABD\u0AD0\u0AE0\u0AE1\u0AF9\u0B05-\u0B0C\u0B0F\u0B10\u0B13-\u0B28\u0B2A-\u0B30\u0B32\u0B33\u0B35-\u0B39\u0B3D\u0B5C\u0B5D\u0B5F-\u0B61\u0B71\u0B83\u0B85-\u0B8A\u0B8E-\u0B90\u0B92-\u0B95\u0B99\u0B9A\u0B9C\u0B9E\u0B9F\u0BA3\u0BA4\u0BA8-\u0BAA\u0BAE-\u0BB9\u0BD0\u0C05-\u0C0C\u0C0E-\u0C10\u0C12-\u0C28\u0C2A-\u0C39\u0C3D\u0C58-\u0C5A\u0C60\u0C61\u0C80\u0C85-\u0C8C\u0C8E-\u0C90\u0C92-\u0CA8\u0CAA-\u0CB3\u0CB5-\u0CB9\u0CBD\u0CDE\u0CE0\u0CE1\u0CF1\u0CF2\u0D05-\u0D0C\u0D0E-\u0D10\u0D12-\u0D3A\u0D3D\u0D4E\u0D54-\u0D56\u0D5F-\u0D61\u0D7A-\u0D7F\u0D85-\u0D96\u0D9A-\u0DB1\u0DB3-\u0DBB\u0DBD\u0DC0-\u0DC6\u0E01-\u0E30\u0E32\u0E33\u0E40-\u0E46\u0E81\u0E82\u0E84\u0E87\u0E88\u0E8A\u0E8D\u0E94-\u0E97\u0E99-\u0E9F\u0EA1-\u0EA3\u0EA5\u0EA7\u0EAA\u0EAB\u0EAD-\u0EB0\u0EB2\u0EB3\u0EBD\u0EC0-\u0EC4\u0EC6\u0EDC-\u0EDF\u0F00\u0F40-\u0F47\u0F49-\u0F6C\u0F88-\u0F8C\u1000-\u102A\u103F\u1050-\u1055\u105A-\u105D\u1061\u1065\u1066\u106E-\u1070\u1075-\u1081\u108E\u10A0-\u10C5\u10C7\u10CD\u10D0-\u10FA\u10FC-\u1248\u124A-\u124D\u1250-\u1256\u1258\u125A-\u125D\u1260-\u1288\u128A-\u128D\u1290-\u12B0\u12B2-\u12B5\u12B8-\u12BE\u12C0\u12C2-\u12C5\u12C8-\u12D6\u12D8-\u1310\u1312-\u1315\u1318-\u135A\u1380-\u138F\u13A0-\u13F5\u13F8-\u13FD\u1401-\u166C\u166F-\u167F\u1681-\u169A\u16A0-\u16EA\u16F1-\u16F8\u1700-\u170C\u170E-\u1711\u1720-\u1731\u1740-\u1751\u1760-\u176C\u176E-\u1770\u1780-\u17B3\u17D7\u17DC\u1820-\u1878\u1880-\u1884\u1887-\u18A8\u18AA\u18B0-\u18F5\u1900-\u191E\u1950-\u196D\u1970-\u1974\u1980-\u19AB\u19B0-\u19C9\u1A00-\u1A16\u1A20-\u1A54\u1AA7\u1B05-\u1B33\u1B45-\u1B4B\u1B83-\u1BA0\u1BAE\u1BAF\u1BBA-\u1BE5\u1C00-\u1C23\u1C4D-\u1C4F\u1C5A-\u1C7D\u1C80-\u1C88\u1C90-\u1CBA\u1CBD-\u1CBF\u1CE9-\u1CEC\u1CEE-\u1CF1\u1CF5\u1CF6\u1D00-\u1DBF\u1E00-\u1F15\u1F18-\u1F1D\u1F20-\u1F45\u1F48-\u1F4D\u1F50-\u1F57\u1F59\u1F5B\u1F5D\u1F5F-\u1F7D\u1F80-\u1FB4\u1FB6-\u1FBC\u1FBE\u1FC2-\u1FC4\u1FC6-\u1FCC\u1FD0-\u1FD3\u1FD6-\u1FDB\u1FE0-\u1FEC\u1FF2-\u1FF4\u1FF6-\u1FFC\u2071\u207F\u2090-\u209C\u2102\u2107\u210A-\u2113\u2115\u2119-\u211D\u2124\u2126\u2128\u212A-\u212D\u212F-\u2139\u213C-\u213F\u2145-\u2149\u214E\u2183\u2184\u2C00-\u2C2E\u2C30-\u2C5E\u2C60-\u2CE4\u2CEB-\u2CEE\u2CF2\u2CF3\u2D00-\u2D25\u2D27\u2D2D\u2D30-\u2D67\u2D6F\u2D80-\u2D96\u2DA0-\u2DA6\u2DA8-\u2DAE\u2DB0-\u2DB6\u2DB8-\u2DBE\u2DC0-\u2DC6\u2DC8-\u2DCE\u2DD0-\u2DD6\u2DD8-\u2DDE\u2E2F\u3005\u3006\u3031-\u3035\u303B\u303C\u3041-\u3096\u309D-\u309F\u30A1-\u30FA\u30FC-\u30FF\u3105-\u312F\u3131-\u318E\u31A0-\u31BA\u31F0-\u31FF\u3400-\u4DB5\u4E00-\u9FEF\uA000-\uA48C\uA4D0-\uA4FD\uA500-\uA60C\uA610-\uA61F\uA62A\uA62B\uA640-\uA66E\uA67F-\uA69D\uA6A0-\uA6E5\uA717-\uA71F\uA722-\uA788\uA78B-\uA7B9\uA7F7-\uA801\uA803-\uA805\uA807-\uA80A\uA80C-\uA822\uA840-\uA873\uA882-\uA8B3\uA8F2-\uA8F7\uA8FB\uA8FD\uA8FE\uA90A-\uA925\uA930-\uA946\uA960-\uA97C\uA984-\uA9B2\uA9CF\uA9E0-\uA9E4\uA9E6-\uA9EF\uA9FA-\uA9FE\uAA00-\uAA28\uAA40-\uAA42\uAA44-\uAA4B\uAA60-\uAA76\uAA7A\uAA7E-\uAAAF\uAAB1\uAAB5\uAAB6\uAAB9-\uAABD\uAAC0\uAAC2\uAADB-\uAADD\uAAE0-\uAAEA\uAAF2-\uAAF4\uAB01-\uAB06\uAB09-\uAB0E\uAB11-\uAB16\uAB20-\uAB26\uAB28-\uAB2E\uAB30-\uAB5A\uAB5C-\uAB65\uAB70-\uABE2\uAC00-\uD7A3\uD7B0-\uD7C6\uD7CB-\uD7FB\uF900-\uFA6D\uFA70-\uFAD9\uFB00-\uFB06\uFB13-\uFB17\uFB1D\uFB1F-\uFB28\uFB2A-\uFB36\uFB38-\uFB3C\uFB3E\uFB40\uFB41\uFB43\uFB44\uFB46-\uFBB1\uFBD3-\uFD3D\uFD50-\uFD8F\uFD92-\uFDC7\uFDF0-\uFDFB\uFE70-\uFE74\uFE76-\uFEFC\uFF21-\uFF3A\uFF41-\uFF5A\uFF66-\uFFBE\uFFC2-\uFFC7\uFFCA-\uFFCF\uFFD2-\uFFD7\uFFDA-\uFFDC', + 'astral': '\uD800[\uDC00-\uDC0B\uDC0D-\uDC26\uDC28-\uDC3A\uDC3C\uDC3D\uDC3F-\uDC4D\uDC50-\uDC5D\uDC80-\uDCFA\uDE80-\uDE9C\uDEA0-\uDED0\uDF00-\uDF1F\uDF2D-\uDF40\uDF42-\uDF49\uDF50-\uDF75\uDF80-\uDF9D\uDFA0-\uDFC3\uDFC8-\uDFCF]|\uD801[\uDC00-\uDC9D\uDCB0-\uDCD3\uDCD8-\uDCFB\uDD00-\uDD27\uDD30-\uDD63\uDE00-\uDF36\uDF40-\uDF55\uDF60-\uDF67]|\uD802[\uDC00-\uDC05\uDC08\uDC0A-\uDC35\uDC37\uDC38\uDC3C\uDC3F-\uDC55\uDC60-\uDC76\uDC80-\uDC9E\uDCE0-\uDCF2\uDCF4\uDCF5\uDD00-\uDD15\uDD20-\uDD39\uDD80-\uDDB7\uDDBE\uDDBF\uDE00\uDE10-\uDE13\uDE15-\uDE17\uDE19-\uDE35\uDE60-\uDE7C\uDE80-\uDE9C\uDEC0-\uDEC7\uDEC9-\uDEE4\uDF00-\uDF35\uDF40-\uDF55\uDF60-\uDF72\uDF80-\uDF91]|\uD803[\uDC00-\uDC48\uDC80-\uDCB2\uDCC0-\uDCF2\uDD00-\uDD23\uDF00-\uDF1C\uDF27\uDF30-\uDF45]|\uD804[\uDC03-\uDC37\uDC83-\uDCAF\uDCD0-\uDCE8\uDD03-\uDD26\uDD44\uDD50-\uDD72\uDD76\uDD83-\uDDB2\uDDC1-\uDDC4\uDDDA\uDDDC\uDE00-\uDE11\uDE13-\uDE2B\uDE80-\uDE86\uDE88\uDE8A-\uDE8D\uDE8F-\uDE9D\uDE9F-\uDEA8\uDEB0-\uDEDE\uDF05-\uDF0C\uDF0F\uDF10\uDF13-\uDF28\uDF2A-\uDF30\uDF32\uDF33\uDF35-\uDF39\uDF3D\uDF50\uDF5D-\uDF61]|\uD805[\uDC00-\uDC34\uDC47-\uDC4A\uDC80-\uDCAF\uDCC4\uDCC5\uDCC7\uDD80-\uDDAE\uDDD8-\uDDDB\uDE00-\uDE2F\uDE44\uDE80-\uDEAA\uDF00-\uDF1A]|\uD806[\uDC00-\uDC2B\uDCA0-\uDCDF\uDCFF\uDE00\uDE0B-\uDE32\uDE3A\uDE50\uDE5C-\uDE83\uDE86-\uDE89\uDE9D\uDEC0-\uDEF8]|\uD807[\uDC00-\uDC08\uDC0A-\uDC2E\uDC40\uDC72-\uDC8F\uDD00-\uDD06\uDD08\uDD09\uDD0B-\uDD30\uDD46\uDD60-\uDD65\uDD67\uDD68\uDD6A-\uDD89\uDD98\uDEE0-\uDEF2]|\uD808[\uDC00-\uDF99]|\uD809[\uDC80-\uDD43]|[\uD80C\uD81C-\uD820\uD840-\uD868\uD86A-\uD86C\uD86F-\uD872\uD874-\uD879][\uDC00-\uDFFF]|\uD80D[\uDC00-\uDC2E]|\uD811[\uDC00-\uDE46]|\uD81A[\uDC00-\uDE38\uDE40-\uDE5E\uDED0-\uDEED\uDF00-\uDF2F\uDF40-\uDF43\uDF63-\uDF77\uDF7D-\uDF8F]|\uD81B[\uDE40-\uDE7F\uDF00-\uDF44\uDF50\uDF93-\uDF9F\uDFE0\uDFE1]|\uD821[\uDC00-\uDFF1]|\uD822[\uDC00-\uDEF2]|\uD82C[\uDC00-\uDD1E\uDD70-\uDEFB]|\uD82F[\uDC00-\uDC6A\uDC70-\uDC7C\uDC80-\uDC88\uDC90-\uDC99]|\uD835[\uDC00-\uDC54\uDC56-\uDC9C\uDC9E\uDC9F\uDCA2\uDCA5\uDCA6\uDCA9-\uDCAC\uDCAE-\uDCB9\uDCBB\uDCBD-\uDCC3\uDCC5-\uDD05\uDD07-\uDD0A\uDD0D-\uDD14\uDD16-\uDD1C\uDD1E-\uDD39\uDD3B-\uDD3E\uDD40-\uDD44\uDD46\uDD4A-\uDD50\uDD52-\uDEA5\uDEA8-\uDEC0\uDEC2-\uDEDA\uDEDC-\uDEFA\uDEFC-\uDF14\uDF16-\uDF34\uDF36-\uDF4E\uDF50-\uDF6E\uDF70-\uDF88\uDF8A-\uDFA8\uDFAA-\uDFC2\uDFC4-\uDFCB]|\uD83A[\uDC00-\uDCC4\uDD00-\uDD43]|\uD83B[\uDE00-\uDE03\uDE05-\uDE1F\uDE21\uDE22\uDE24\uDE27\uDE29-\uDE32\uDE34-\uDE37\uDE39\uDE3B\uDE42\uDE47\uDE49\uDE4B\uDE4D-\uDE4F\uDE51\uDE52\uDE54\uDE57\uDE59\uDE5B\uDE5D\uDE5F\uDE61\uDE62\uDE64\uDE67-\uDE6A\uDE6C-\uDE72\uDE74-\uDE77\uDE79-\uDE7C\uDE7E\uDE80-\uDE89\uDE8B-\uDE9B\uDEA1-\uDEA3\uDEA5-\uDEA9\uDEAB-\uDEBB]|\uD869[\uDC00-\uDED6\uDF00-\uDFFF]|\uD86D[\uDC00-\uDF34\uDF40-\uDFFF]|\uD86E[\uDC00-\uDC1D\uDC20-\uDFFF]|\uD873[\uDC00-\uDEA1\uDEB0-\uDFFF]|\uD87A[\uDC00-\uDFE0]|\uD87E[\uDC00-\uDE1D]' + }, + { + 'name': 'LC', + 'alias': 'Cased_Letter', + 'bmp': 'A-Za-z\xB5\xC0-\xD6\xD8-\xF6\xF8-\u01BA\u01BC-\u01BF\u01C4-\u0293\u0295-\u02AF\u0370-\u0373\u0376\u0377\u037B-\u037D\u037F\u0386\u0388-\u038A\u038C\u038E-\u03A1\u03A3-\u03F5\u03F7-\u0481\u048A-\u052F\u0531-\u0556\u0560-\u0588\u10A0-\u10C5\u10C7\u10CD\u10D0-\u10FA\u10FD-\u10FF\u13A0-\u13F5\u13F8-\u13FD\u1C80-\u1C88\u1C90-\u1CBA\u1CBD-\u1CBF\u1D00-\u1D2B\u1D6B-\u1D77\u1D79-\u1D9A\u1E00-\u1F15\u1F18-\u1F1D\u1F20-\u1F45\u1F48-\u1F4D\u1F50-\u1F57\u1F59\u1F5B\u1F5D\u1F5F-\u1F7D\u1F80-\u1FB4\u1FB6-\u1FBC\u1FBE\u1FC2-\u1FC4\u1FC6-\u1FCC\u1FD0-\u1FD3\u1FD6-\u1FDB\u1FE0-\u1FEC\u1FF2-\u1FF4\u1FF6-\u1FFC\u2102\u2107\u210A-\u2113\u2115\u2119-\u211D\u2124\u2126\u2128\u212A-\u212D\u212F-\u2134\u2139\u213C-\u213F\u2145-\u2149\u214E\u2183\u2184\u2C00-\u2C2E\u2C30-\u2C5E\u2C60-\u2C7B\u2C7E-\u2CE4\u2CEB-\u2CEE\u2CF2\u2CF3\u2D00-\u2D25\u2D27\u2D2D\uA640-\uA66D\uA680-\uA69B\uA722-\uA76F\uA771-\uA787\uA78B-\uA78E\uA790-\uA7B9\uA7FA\uAB30-\uAB5A\uAB60-\uAB65\uAB70-\uABBF\uFB00-\uFB06\uFB13-\uFB17\uFF21-\uFF3A\uFF41-\uFF5A', + 'astral': '\uD801[\uDC00-\uDC4F\uDCB0-\uDCD3\uDCD8-\uDCFB]|\uD803[\uDC80-\uDCB2\uDCC0-\uDCF2]|\uD806[\uDCA0-\uDCDF]|\uD81B[\uDE40-\uDE7F]|\uD835[\uDC00-\uDC54\uDC56-\uDC9C\uDC9E\uDC9F\uDCA2\uDCA5\uDCA6\uDCA9-\uDCAC\uDCAE-\uDCB9\uDCBB\uDCBD-\uDCC3\uDCC5-\uDD05\uDD07-\uDD0A\uDD0D-\uDD14\uDD16-\uDD1C\uDD1E-\uDD39\uDD3B-\uDD3E\uDD40-\uDD44\uDD46\uDD4A-\uDD50\uDD52-\uDEA5\uDEA8-\uDEC0\uDEC2-\uDEDA\uDEDC-\uDEFA\uDEFC-\uDF14\uDF16-\uDF34\uDF36-\uDF4E\uDF50-\uDF6E\uDF70-\uDF88\uDF8A-\uDFA8\uDFAA-\uDFC2\uDFC4-\uDFCB]|\uD83A[\uDD00-\uDD43]' + }, + { + 'name': 'Ll', + 'alias': 'Lowercase_Letter', + 'bmp': 'a-z\xB5\xDF-\xF6\xF8-\xFF\u0101\u0103\u0105\u0107\u0109\u010B\u010D\u010F\u0111\u0113\u0115\u0117\u0119\u011B\u011D\u011F\u0121\u0123\u0125\u0127\u0129\u012B\u012D\u012F\u0131\u0133\u0135\u0137\u0138\u013A\u013C\u013E\u0140\u0142\u0144\u0146\u0148\u0149\u014B\u014D\u014F\u0151\u0153\u0155\u0157\u0159\u015B\u015D\u015F\u0161\u0163\u0165\u0167\u0169\u016B\u016D\u016F\u0171\u0173\u0175\u0177\u017A\u017C\u017E-\u0180\u0183\u0185\u0188\u018C\u018D\u0192\u0195\u0199-\u019B\u019E\u01A1\u01A3\u01A5\u01A8\u01AA\u01AB\u01AD\u01B0\u01B4\u01B6\u01B9\u01BA\u01BD-\u01BF\u01C6\u01C9\u01CC\u01CE\u01D0\u01D2\u01D4\u01D6\u01D8\u01DA\u01DC\u01DD\u01DF\u01E1\u01E3\u01E5\u01E7\u01E9\u01EB\u01ED\u01EF\u01F0\u01F3\u01F5\u01F9\u01FB\u01FD\u01FF\u0201\u0203\u0205\u0207\u0209\u020B\u020D\u020F\u0211\u0213\u0215\u0217\u0219\u021B\u021D\u021F\u0221\u0223\u0225\u0227\u0229\u022B\u022D\u022F\u0231\u0233-\u0239\u023C\u023F\u0240\u0242\u0247\u0249\u024B\u024D\u024F-\u0293\u0295-\u02AF\u0371\u0373\u0377\u037B-\u037D\u0390\u03AC-\u03CE\u03D0\u03D1\u03D5-\u03D7\u03D9\u03DB\u03DD\u03DF\u03E1\u03E3\u03E5\u03E7\u03E9\u03EB\u03ED\u03EF-\u03F3\u03F5\u03F8\u03FB\u03FC\u0430-\u045F\u0461\u0463\u0465\u0467\u0469\u046B\u046D\u046F\u0471\u0473\u0475\u0477\u0479\u047B\u047D\u047F\u0481\u048B\u048D\u048F\u0491\u0493\u0495\u0497\u0499\u049B\u049D\u049F\u04A1\u04A3\u04A5\u04A7\u04A9\u04AB\u04AD\u04AF\u04B1\u04B3\u04B5\u04B7\u04B9\u04BB\u04BD\u04BF\u04C2\u04C4\u04C6\u04C8\u04CA\u04CC\u04CE\u04CF\u04D1\u04D3\u04D5\u04D7\u04D9\u04DB\u04DD\u04DF\u04E1\u04E3\u04E5\u04E7\u04E9\u04EB\u04ED\u04EF\u04F1\u04F3\u04F5\u04F7\u04F9\u04FB\u04FD\u04FF\u0501\u0503\u0505\u0507\u0509\u050B\u050D\u050F\u0511\u0513\u0515\u0517\u0519\u051B\u051D\u051F\u0521\u0523\u0525\u0527\u0529\u052B\u052D\u052F\u0560-\u0588\u10D0-\u10FA\u10FD-\u10FF\u13F8-\u13FD\u1C80-\u1C88\u1D00-\u1D2B\u1D6B-\u1D77\u1D79-\u1D9A\u1E01\u1E03\u1E05\u1E07\u1E09\u1E0B\u1E0D\u1E0F\u1E11\u1E13\u1E15\u1E17\u1E19\u1E1B\u1E1D\u1E1F\u1E21\u1E23\u1E25\u1E27\u1E29\u1E2B\u1E2D\u1E2F\u1E31\u1E33\u1E35\u1E37\u1E39\u1E3B\u1E3D\u1E3F\u1E41\u1E43\u1E45\u1E47\u1E49\u1E4B\u1E4D\u1E4F\u1E51\u1E53\u1E55\u1E57\u1E59\u1E5B\u1E5D\u1E5F\u1E61\u1E63\u1E65\u1E67\u1E69\u1E6B\u1E6D\u1E6F\u1E71\u1E73\u1E75\u1E77\u1E79\u1E7B\u1E7D\u1E7F\u1E81\u1E83\u1E85\u1E87\u1E89\u1E8B\u1E8D\u1E8F\u1E91\u1E93\u1E95-\u1E9D\u1E9F\u1EA1\u1EA3\u1EA5\u1EA7\u1EA9\u1EAB\u1EAD\u1EAF\u1EB1\u1EB3\u1EB5\u1EB7\u1EB9\u1EBB\u1EBD\u1EBF\u1EC1\u1EC3\u1EC5\u1EC7\u1EC9\u1ECB\u1ECD\u1ECF\u1ED1\u1ED3\u1ED5\u1ED7\u1ED9\u1EDB\u1EDD\u1EDF\u1EE1\u1EE3\u1EE5\u1EE7\u1EE9\u1EEB\u1EED\u1EEF\u1EF1\u1EF3\u1EF5\u1EF7\u1EF9\u1EFB\u1EFD\u1EFF-\u1F07\u1F10-\u1F15\u1F20-\u1F27\u1F30-\u1F37\u1F40-\u1F45\u1F50-\u1F57\u1F60-\u1F67\u1F70-\u1F7D\u1F80-\u1F87\u1F90-\u1F97\u1FA0-\u1FA7\u1FB0-\u1FB4\u1FB6\u1FB7\u1FBE\u1FC2-\u1FC4\u1FC6\u1FC7\u1FD0-\u1FD3\u1FD6\u1FD7\u1FE0-\u1FE7\u1FF2-\u1FF4\u1FF6\u1FF7\u210A\u210E\u210F\u2113\u212F\u2134\u2139\u213C\u213D\u2146-\u2149\u214E\u2184\u2C30-\u2C5E\u2C61\u2C65\u2C66\u2C68\u2C6A\u2C6C\u2C71\u2C73\u2C74\u2C76-\u2C7B\u2C81\u2C83\u2C85\u2C87\u2C89\u2C8B\u2C8D\u2C8F\u2C91\u2C93\u2C95\u2C97\u2C99\u2C9B\u2C9D\u2C9F\u2CA1\u2CA3\u2CA5\u2CA7\u2CA9\u2CAB\u2CAD\u2CAF\u2CB1\u2CB3\u2CB5\u2CB7\u2CB9\u2CBB\u2CBD\u2CBF\u2CC1\u2CC3\u2CC5\u2CC7\u2CC9\u2CCB\u2CCD\u2CCF\u2CD1\u2CD3\u2CD5\u2CD7\u2CD9\u2CDB\u2CDD\u2CDF\u2CE1\u2CE3\u2CE4\u2CEC\u2CEE\u2CF3\u2D00-\u2D25\u2D27\u2D2D\uA641\uA643\uA645\uA647\uA649\uA64B\uA64D\uA64F\uA651\uA653\uA655\uA657\uA659\uA65B\uA65D\uA65F\uA661\uA663\uA665\uA667\uA669\uA66B\uA66D\uA681\uA683\uA685\uA687\uA689\uA68B\uA68D\uA68F\uA691\uA693\uA695\uA697\uA699\uA69B\uA723\uA725\uA727\uA729\uA72B\uA72D\uA72F-\uA731\uA733\uA735\uA737\uA739\uA73B\uA73D\uA73F\uA741\uA743\uA745\uA747\uA749\uA74B\uA74D\uA74F\uA751\uA753\uA755\uA757\uA759\uA75B\uA75D\uA75F\uA761\uA763\uA765\uA767\uA769\uA76B\uA76D\uA76F\uA771-\uA778\uA77A\uA77C\uA77F\uA781\uA783\uA785\uA787\uA78C\uA78E\uA791\uA793-\uA795\uA797\uA799\uA79B\uA79D\uA79F\uA7A1\uA7A3\uA7A5\uA7A7\uA7A9\uA7AF\uA7B5\uA7B7\uA7B9\uA7FA\uAB30-\uAB5A\uAB60-\uAB65\uAB70-\uABBF\uFB00-\uFB06\uFB13-\uFB17\uFF41-\uFF5A', + 'astral': '\uD801[\uDC28-\uDC4F\uDCD8-\uDCFB]|\uD803[\uDCC0-\uDCF2]|\uD806[\uDCC0-\uDCDF]|\uD81B[\uDE60-\uDE7F]|\uD835[\uDC1A-\uDC33\uDC4E-\uDC54\uDC56-\uDC67\uDC82-\uDC9B\uDCB6-\uDCB9\uDCBB\uDCBD-\uDCC3\uDCC5-\uDCCF\uDCEA-\uDD03\uDD1E-\uDD37\uDD52-\uDD6B\uDD86-\uDD9F\uDDBA-\uDDD3\uDDEE-\uDE07\uDE22-\uDE3B\uDE56-\uDE6F\uDE8A-\uDEA5\uDEC2-\uDEDA\uDEDC-\uDEE1\uDEFC-\uDF14\uDF16-\uDF1B\uDF36-\uDF4E\uDF50-\uDF55\uDF70-\uDF88\uDF8A-\uDF8F\uDFAA-\uDFC2\uDFC4-\uDFC9\uDFCB]|\uD83A[\uDD22-\uDD43]' + }, + { + 'name': 'Lm', + 'alias': 'Modifier_Letter', + 'bmp': '\u02B0-\u02C1\u02C6-\u02D1\u02E0-\u02E4\u02EC\u02EE\u0374\u037A\u0559\u0640\u06E5\u06E6\u07F4\u07F5\u07FA\u081A\u0824\u0828\u0971\u0E46\u0EC6\u10FC\u17D7\u1843\u1AA7\u1C78-\u1C7D\u1D2C-\u1D6A\u1D78\u1D9B-\u1DBF\u2071\u207F\u2090-\u209C\u2C7C\u2C7D\u2D6F\u2E2F\u3005\u3031-\u3035\u303B\u309D\u309E\u30FC-\u30FE\uA015\uA4F8-\uA4FD\uA60C\uA67F\uA69C\uA69D\uA717-\uA71F\uA770\uA788\uA7F8\uA7F9\uA9CF\uA9E6\uAA70\uAADD\uAAF3\uAAF4\uAB5C-\uAB5F\uFF70\uFF9E\uFF9F', + 'astral': '\uD81A[\uDF40-\uDF43]|\uD81B[\uDF93-\uDF9F\uDFE0\uDFE1]' + }, + { + 'name': 'Lo', + 'alias': 'Other_Letter', + 'bmp': '\xAA\xBA\u01BB\u01C0-\u01C3\u0294\u05D0-\u05EA\u05EF-\u05F2\u0620-\u063F\u0641-\u064A\u066E\u066F\u0671-\u06D3\u06D5\u06EE\u06EF\u06FA-\u06FC\u06FF\u0710\u0712-\u072F\u074D-\u07A5\u07B1\u07CA-\u07EA\u0800-\u0815\u0840-\u0858\u0860-\u086A\u08A0-\u08B4\u08B6-\u08BD\u0904-\u0939\u093D\u0950\u0958-\u0961\u0972-\u0980\u0985-\u098C\u098F\u0990\u0993-\u09A8\u09AA-\u09B0\u09B2\u09B6-\u09B9\u09BD\u09CE\u09DC\u09DD\u09DF-\u09E1\u09F0\u09F1\u09FC\u0A05-\u0A0A\u0A0F\u0A10\u0A13-\u0A28\u0A2A-\u0A30\u0A32\u0A33\u0A35\u0A36\u0A38\u0A39\u0A59-\u0A5C\u0A5E\u0A72-\u0A74\u0A85-\u0A8D\u0A8F-\u0A91\u0A93-\u0AA8\u0AAA-\u0AB0\u0AB2\u0AB3\u0AB5-\u0AB9\u0ABD\u0AD0\u0AE0\u0AE1\u0AF9\u0B05-\u0B0C\u0B0F\u0B10\u0B13-\u0B28\u0B2A-\u0B30\u0B32\u0B33\u0B35-\u0B39\u0B3D\u0B5C\u0B5D\u0B5F-\u0B61\u0B71\u0B83\u0B85-\u0B8A\u0B8E-\u0B90\u0B92-\u0B95\u0B99\u0B9A\u0B9C\u0B9E\u0B9F\u0BA3\u0BA4\u0BA8-\u0BAA\u0BAE-\u0BB9\u0BD0\u0C05-\u0C0C\u0C0E-\u0C10\u0C12-\u0C28\u0C2A-\u0C39\u0C3D\u0C58-\u0C5A\u0C60\u0C61\u0C80\u0C85-\u0C8C\u0C8E-\u0C90\u0C92-\u0CA8\u0CAA-\u0CB3\u0CB5-\u0CB9\u0CBD\u0CDE\u0CE0\u0CE1\u0CF1\u0CF2\u0D05-\u0D0C\u0D0E-\u0D10\u0D12-\u0D3A\u0D3D\u0D4E\u0D54-\u0D56\u0D5F-\u0D61\u0D7A-\u0D7F\u0D85-\u0D96\u0D9A-\u0DB1\u0DB3-\u0DBB\u0DBD\u0DC0-\u0DC6\u0E01-\u0E30\u0E32\u0E33\u0E40-\u0E45\u0E81\u0E82\u0E84\u0E87\u0E88\u0E8A\u0E8D\u0E94-\u0E97\u0E99-\u0E9F\u0EA1-\u0EA3\u0EA5\u0EA7\u0EAA\u0EAB\u0EAD-\u0EB0\u0EB2\u0EB3\u0EBD\u0EC0-\u0EC4\u0EDC-\u0EDF\u0F00\u0F40-\u0F47\u0F49-\u0F6C\u0F88-\u0F8C\u1000-\u102A\u103F\u1050-\u1055\u105A-\u105D\u1061\u1065\u1066\u106E-\u1070\u1075-\u1081\u108E\u1100-\u1248\u124A-\u124D\u1250-\u1256\u1258\u125A-\u125D\u1260-\u1288\u128A-\u128D\u1290-\u12B0\u12B2-\u12B5\u12B8-\u12BE\u12C0\u12C2-\u12C5\u12C8-\u12D6\u12D8-\u1310\u1312-\u1315\u1318-\u135A\u1380-\u138F\u1401-\u166C\u166F-\u167F\u1681-\u169A\u16A0-\u16EA\u16F1-\u16F8\u1700-\u170C\u170E-\u1711\u1720-\u1731\u1740-\u1751\u1760-\u176C\u176E-\u1770\u1780-\u17B3\u17DC\u1820-\u1842\u1844-\u1878\u1880-\u1884\u1887-\u18A8\u18AA\u18B0-\u18F5\u1900-\u191E\u1950-\u196D\u1970-\u1974\u1980-\u19AB\u19B0-\u19C9\u1A00-\u1A16\u1A20-\u1A54\u1B05-\u1B33\u1B45-\u1B4B\u1B83-\u1BA0\u1BAE\u1BAF\u1BBA-\u1BE5\u1C00-\u1C23\u1C4D-\u1C4F\u1C5A-\u1C77\u1CE9-\u1CEC\u1CEE-\u1CF1\u1CF5\u1CF6\u2135-\u2138\u2D30-\u2D67\u2D80-\u2D96\u2DA0-\u2DA6\u2DA8-\u2DAE\u2DB0-\u2DB6\u2DB8-\u2DBE\u2DC0-\u2DC6\u2DC8-\u2DCE\u2DD0-\u2DD6\u2DD8-\u2DDE\u3006\u303C\u3041-\u3096\u309F\u30A1-\u30FA\u30FF\u3105-\u312F\u3131-\u318E\u31A0-\u31BA\u31F0-\u31FF\u3400-\u4DB5\u4E00-\u9FEF\uA000-\uA014\uA016-\uA48C\uA4D0-\uA4F7\uA500-\uA60B\uA610-\uA61F\uA62A\uA62B\uA66E\uA6A0-\uA6E5\uA78F\uA7F7\uA7FB-\uA801\uA803-\uA805\uA807-\uA80A\uA80C-\uA822\uA840-\uA873\uA882-\uA8B3\uA8F2-\uA8F7\uA8FB\uA8FD\uA8FE\uA90A-\uA925\uA930-\uA946\uA960-\uA97C\uA984-\uA9B2\uA9E0-\uA9E4\uA9E7-\uA9EF\uA9FA-\uA9FE\uAA00-\uAA28\uAA40-\uAA42\uAA44-\uAA4B\uAA60-\uAA6F\uAA71-\uAA76\uAA7A\uAA7E-\uAAAF\uAAB1\uAAB5\uAAB6\uAAB9-\uAABD\uAAC0\uAAC2\uAADB\uAADC\uAAE0-\uAAEA\uAAF2\uAB01-\uAB06\uAB09-\uAB0E\uAB11-\uAB16\uAB20-\uAB26\uAB28-\uAB2E\uABC0-\uABE2\uAC00-\uD7A3\uD7B0-\uD7C6\uD7CB-\uD7FB\uF900-\uFA6D\uFA70-\uFAD9\uFB1D\uFB1F-\uFB28\uFB2A-\uFB36\uFB38-\uFB3C\uFB3E\uFB40\uFB41\uFB43\uFB44\uFB46-\uFBB1\uFBD3-\uFD3D\uFD50-\uFD8F\uFD92-\uFDC7\uFDF0-\uFDFB\uFE70-\uFE74\uFE76-\uFEFC\uFF66-\uFF6F\uFF71-\uFF9D\uFFA0-\uFFBE\uFFC2-\uFFC7\uFFCA-\uFFCF\uFFD2-\uFFD7\uFFDA-\uFFDC', + 'astral': '\uD800[\uDC00-\uDC0B\uDC0D-\uDC26\uDC28-\uDC3A\uDC3C\uDC3D\uDC3F-\uDC4D\uDC50-\uDC5D\uDC80-\uDCFA\uDE80-\uDE9C\uDEA0-\uDED0\uDF00-\uDF1F\uDF2D-\uDF40\uDF42-\uDF49\uDF50-\uDF75\uDF80-\uDF9D\uDFA0-\uDFC3\uDFC8-\uDFCF]|\uD801[\uDC50-\uDC9D\uDD00-\uDD27\uDD30-\uDD63\uDE00-\uDF36\uDF40-\uDF55\uDF60-\uDF67]|\uD802[\uDC00-\uDC05\uDC08\uDC0A-\uDC35\uDC37\uDC38\uDC3C\uDC3F-\uDC55\uDC60-\uDC76\uDC80-\uDC9E\uDCE0-\uDCF2\uDCF4\uDCF5\uDD00-\uDD15\uDD20-\uDD39\uDD80-\uDDB7\uDDBE\uDDBF\uDE00\uDE10-\uDE13\uDE15-\uDE17\uDE19-\uDE35\uDE60-\uDE7C\uDE80-\uDE9C\uDEC0-\uDEC7\uDEC9-\uDEE4\uDF00-\uDF35\uDF40-\uDF55\uDF60-\uDF72\uDF80-\uDF91]|\uD803[\uDC00-\uDC48\uDD00-\uDD23\uDF00-\uDF1C\uDF27\uDF30-\uDF45]|\uD804[\uDC03-\uDC37\uDC83-\uDCAF\uDCD0-\uDCE8\uDD03-\uDD26\uDD44\uDD50-\uDD72\uDD76\uDD83-\uDDB2\uDDC1-\uDDC4\uDDDA\uDDDC\uDE00-\uDE11\uDE13-\uDE2B\uDE80-\uDE86\uDE88\uDE8A-\uDE8D\uDE8F-\uDE9D\uDE9F-\uDEA8\uDEB0-\uDEDE\uDF05-\uDF0C\uDF0F\uDF10\uDF13-\uDF28\uDF2A-\uDF30\uDF32\uDF33\uDF35-\uDF39\uDF3D\uDF50\uDF5D-\uDF61]|\uD805[\uDC00-\uDC34\uDC47-\uDC4A\uDC80-\uDCAF\uDCC4\uDCC5\uDCC7\uDD80-\uDDAE\uDDD8-\uDDDB\uDE00-\uDE2F\uDE44\uDE80-\uDEAA\uDF00-\uDF1A]|\uD806[\uDC00-\uDC2B\uDCFF\uDE00\uDE0B-\uDE32\uDE3A\uDE50\uDE5C-\uDE83\uDE86-\uDE89\uDE9D\uDEC0-\uDEF8]|\uD807[\uDC00-\uDC08\uDC0A-\uDC2E\uDC40\uDC72-\uDC8F\uDD00-\uDD06\uDD08\uDD09\uDD0B-\uDD30\uDD46\uDD60-\uDD65\uDD67\uDD68\uDD6A-\uDD89\uDD98\uDEE0-\uDEF2]|\uD808[\uDC00-\uDF99]|\uD809[\uDC80-\uDD43]|[\uD80C\uD81C-\uD820\uD840-\uD868\uD86A-\uD86C\uD86F-\uD872\uD874-\uD879][\uDC00-\uDFFF]|\uD80D[\uDC00-\uDC2E]|\uD811[\uDC00-\uDE46]|\uD81A[\uDC00-\uDE38\uDE40-\uDE5E\uDED0-\uDEED\uDF00-\uDF2F\uDF63-\uDF77\uDF7D-\uDF8F]|\uD81B[\uDF00-\uDF44\uDF50]|\uD821[\uDC00-\uDFF1]|\uD822[\uDC00-\uDEF2]|\uD82C[\uDC00-\uDD1E\uDD70-\uDEFB]|\uD82F[\uDC00-\uDC6A\uDC70-\uDC7C\uDC80-\uDC88\uDC90-\uDC99]|\uD83A[\uDC00-\uDCC4]|\uD83B[\uDE00-\uDE03\uDE05-\uDE1F\uDE21\uDE22\uDE24\uDE27\uDE29-\uDE32\uDE34-\uDE37\uDE39\uDE3B\uDE42\uDE47\uDE49\uDE4B\uDE4D-\uDE4F\uDE51\uDE52\uDE54\uDE57\uDE59\uDE5B\uDE5D\uDE5F\uDE61\uDE62\uDE64\uDE67-\uDE6A\uDE6C-\uDE72\uDE74-\uDE77\uDE79-\uDE7C\uDE7E\uDE80-\uDE89\uDE8B-\uDE9B\uDEA1-\uDEA3\uDEA5-\uDEA9\uDEAB-\uDEBB]|\uD869[\uDC00-\uDED6\uDF00-\uDFFF]|\uD86D[\uDC00-\uDF34\uDF40-\uDFFF]|\uD86E[\uDC00-\uDC1D\uDC20-\uDFFF]|\uD873[\uDC00-\uDEA1\uDEB0-\uDFFF]|\uD87A[\uDC00-\uDFE0]|\uD87E[\uDC00-\uDE1D]' + }, + { + 'name': 'Lt', + 'alias': 'Titlecase_Letter', + 'bmp': '\u01C5\u01C8\u01CB\u01F2\u1F88-\u1F8F\u1F98-\u1F9F\u1FA8-\u1FAF\u1FBC\u1FCC\u1FFC' + }, + { + 'name': 'Lu', + 'alias': 'Uppercase_Letter', + 'bmp': 'A-Z\xC0-\xD6\xD8-\xDE\u0100\u0102\u0104\u0106\u0108\u010A\u010C\u010E\u0110\u0112\u0114\u0116\u0118\u011A\u011C\u011E\u0120\u0122\u0124\u0126\u0128\u012A\u012C\u012E\u0130\u0132\u0134\u0136\u0139\u013B\u013D\u013F\u0141\u0143\u0145\u0147\u014A\u014C\u014E\u0150\u0152\u0154\u0156\u0158\u015A\u015C\u015E\u0160\u0162\u0164\u0166\u0168\u016A\u016C\u016E\u0170\u0172\u0174\u0176\u0178\u0179\u017B\u017D\u0181\u0182\u0184\u0186\u0187\u0189-\u018B\u018E-\u0191\u0193\u0194\u0196-\u0198\u019C\u019D\u019F\u01A0\u01A2\u01A4\u01A6\u01A7\u01A9\u01AC\u01AE\u01AF\u01B1-\u01B3\u01B5\u01B7\u01B8\u01BC\u01C4\u01C7\u01CA\u01CD\u01CF\u01D1\u01D3\u01D5\u01D7\u01D9\u01DB\u01DE\u01E0\u01E2\u01E4\u01E6\u01E8\u01EA\u01EC\u01EE\u01F1\u01F4\u01F6-\u01F8\u01FA\u01FC\u01FE\u0200\u0202\u0204\u0206\u0208\u020A\u020C\u020E\u0210\u0212\u0214\u0216\u0218\u021A\u021C\u021E\u0220\u0222\u0224\u0226\u0228\u022A\u022C\u022E\u0230\u0232\u023A\u023B\u023D\u023E\u0241\u0243-\u0246\u0248\u024A\u024C\u024E\u0370\u0372\u0376\u037F\u0386\u0388-\u038A\u038C\u038E\u038F\u0391-\u03A1\u03A3-\u03AB\u03CF\u03D2-\u03D4\u03D8\u03DA\u03DC\u03DE\u03E0\u03E2\u03E4\u03E6\u03E8\u03EA\u03EC\u03EE\u03F4\u03F7\u03F9\u03FA\u03FD-\u042F\u0460\u0462\u0464\u0466\u0468\u046A\u046C\u046E\u0470\u0472\u0474\u0476\u0478\u047A\u047C\u047E\u0480\u048A\u048C\u048E\u0490\u0492\u0494\u0496\u0498\u049A\u049C\u049E\u04A0\u04A2\u04A4\u04A6\u04A8\u04AA\u04AC\u04AE\u04B0\u04B2\u04B4\u04B6\u04B8\u04BA\u04BC\u04BE\u04C0\u04C1\u04C3\u04C5\u04C7\u04C9\u04CB\u04CD\u04D0\u04D2\u04D4\u04D6\u04D8\u04DA\u04DC\u04DE\u04E0\u04E2\u04E4\u04E6\u04E8\u04EA\u04EC\u04EE\u04F0\u04F2\u04F4\u04F6\u04F8\u04FA\u04FC\u04FE\u0500\u0502\u0504\u0506\u0508\u050A\u050C\u050E\u0510\u0512\u0514\u0516\u0518\u051A\u051C\u051E\u0520\u0522\u0524\u0526\u0528\u052A\u052C\u052E\u0531-\u0556\u10A0-\u10C5\u10C7\u10CD\u13A0-\u13F5\u1C90-\u1CBA\u1CBD-\u1CBF\u1E00\u1E02\u1E04\u1E06\u1E08\u1E0A\u1E0C\u1E0E\u1E10\u1E12\u1E14\u1E16\u1E18\u1E1A\u1E1C\u1E1E\u1E20\u1E22\u1E24\u1E26\u1E28\u1E2A\u1E2C\u1E2E\u1E30\u1E32\u1E34\u1E36\u1E38\u1E3A\u1E3C\u1E3E\u1E40\u1E42\u1E44\u1E46\u1E48\u1E4A\u1E4C\u1E4E\u1E50\u1E52\u1E54\u1E56\u1E58\u1E5A\u1E5C\u1E5E\u1E60\u1E62\u1E64\u1E66\u1E68\u1E6A\u1E6C\u1E6E\u1E70\u1E72\u1E74\u1E76\u1E78\u1E7A\u1E7C\u1E7E\u1E80\u1E82\u1E84\u1E86\u1E88\u1E8A\u1E8C\u1E8E\u1E90\u1E92\u1E94\u1E9E\u1EA0\u1EA2\u1EA4\u1EA6\u1EA8\u1EAA\u1EAC\u1EAE\u1EB0\u1EB2\u1EB4\u1EB6\u1EB8\u1EBA\u1EBC\u1EBE\u1EC0\u1EC2\u1EC4\u1EC6\u1EC8\u1ECA\u1ECC\u1ECE\u1ED0\u1ED2\u1ED4\u1ED6\u1ED8\u1EDA\u1EDC\u1EDE\u1EE0\u1EE2\u1EE4\u1EE6\u1EE8\u1EEA\u1EEC\u1EEE\u1EF0\u1EF2\u1EF4\u1EF6\u1EF8\u1EFA\u1EFC\u1EFE\u1F08-\u1F0F\u1F18-\u1F1D\u1F28-\u1F2F\u1F38-\u1F3F\u1F48-\u1F4D\u1F59\u1F5B\u1F5D\u1F5F\u1F68-\u1F6F\u1FB8-\u1FBB\u1FC8-\u1FCB\u1FD8-\u1FDB\u1FE8-\u1FEC\u1FF8-\u1FFB\u2102\u2107\u210B-\u210D\u2110-\u2112\u2115\u2119-\u211D\u2124\u2126\u2128\u212A-\u212D\u2130-\u2133\u213E\u213F\u2145\u2183\u2C00-\u2C2E\u2C60\u2C62-\u2C64\u2C67\u2C69\u2C6B\u2C6D-\u2C70\u2C72\u2C75\u2C7E-\u2C80\u2C82\u2C84\u2C86\u2C88\u2C8A\u2C8C\u2C8E\u2C90\u2C92\u2C94\u2C96\u2C98\u2C9A\u2C9C\u2C9E\u2CA0\u2CA2\u2CA4\u2CA6\u2CA8\u2CAA\u2CAC\u2CAE\u2CB0\u2CB2\u2CB4\u2CB6\u2CB8\u2CBA\u2CBC\u2CBE\u2CC0\u2CC2\u2CC4\u2CC6\u2CC8\u2CCA\u2CCC\u2CCE\u2CD0\u2CD2\u2CD4\u2CD6\u2CD8\u2CDA\u2CDC\u2CDE\u2CE0\u2CE2\u2CEB\u2CED\u2CF2\uA640\uA642\uA644\uA646\uA648\uA64A\uA64C\uA64E\uA650\uA652\uA654\uA656\uA658\uA65A\uA65C\uA65E\uA660\uA662\uA664\uA666\uA668\uA66A\uA66C\uA680\uA682\uA684\uA686\uA688\uA68A\uA68C\uA68E\uA690\uA692\uA694\uA696\uA698\uA69A\uA722\uA724\uA726\uA728\uA72A\uA72C\uA72E\uA732\uA734\uA736\uA738\uA73A\uA73C\uA73E\uA740\uA742\uA744\uA746\uA748\uA74A\uA74C\uA74E\uA750\uA752\uA754\uA756\uA758\uA75A\uA75C\uA75E\uA760\uA762\uA764\uA766\uA768\uA76A\uA76C\uA76E\uA779\uA77B\uA77D\uA77E\uA780\uA782\uA784\uA786\uA78B\uA78D\uA790\uA792\uA796\uA798\uA79A\uA79C\uA79E\uA7A0\uA7A2\uA7A4\uA7A6\uA7A8\uA7AA-\uA7AE\uA7B0-\uA7B4\uA7B6\uA7B8\uFF21-\uFF3A', + 'astral': '\uD801[\uDC00-\uDC27\uDCB0-\uDCD3]|\uD803[\uDC80-\uDCB2]|\uD806[\uDCA0-\uDCBF]|\uD81B[\uDE40-\uDE5F]|\uD835[\uDC00-\uDC19\uDC34-\uDC4D\uDC68-\uDC81\uDC9C\uDC9E\uDC9F\uDCA2\uDCA5\uDCA6\uDCA9-\uDCAC\uDCAE-\uDCB5\uDCD0-\uDCE9\uDD04\uDD05\uDD07-\uDD0A\uDD0D-\uDD14\uDD16-\uDD1C\uDD38\uDD39\uDD3B-\uDD3E\uDD40-\uDD44\uDD46\uDD4A-\uDD50\uDD6C-\uDD85\uDDA0-\uDDB9\uDDD4-\uDDED\uDE08-\uDE21\uDE3C-\uDE55\uDE70-\uDE89\uDEA8-\uDEC0\uDEE2-\uDEFA\uDF1C-\uDF34\uDF56-\uDF6E\uDF90-\uDFA8\uDFCA]|\uD83A[\uDD00-\uDD21]' + }, + { + 'name': 'M', + 'alias': 'Mark', + 'bmp': '\u0300-\u036F\u0483-\u0489\u0591-\u05BD\u05BF\u05C1\u05C2\u05C4\u05C5\u05C7\u0610-\u061A\u064B-\u065F\u0670\u06D6-\u06DC\u06DF-\u06E4\u06E7\u06E8\u06EA-\u06ED\u0711\u0730-\u074A\u07A6-\u07B0\u07EB-\u07F3\u07FD\u0816-\u0819\u081B-\u0823\u0825-\u0827\u0829-\u082D\u0859-\u085B\u08D3-\u08E1\u08E3-\u0903\u093A-\u093C\u093E-\u094F\u0951-\u0957\u0962\u0963\u0981-\u0983\u09BC\u09BE-\u09C4\u09C7\u09C8\u09CB-\u09CD\u09D7\u09E2\u09E3\u09FE\u0A01-\u0A03\u0A3C\u0A3E-\u0A42\u0A47\u0A48\u0A4B-\u0A4D\u0A51\u0A70\u0A71\u0A75\u0A81-\u0A83\u0ABC\u0ABE-\u0AC5\u0AC7-\u0AC9\u0ACB-\u0ACD\u0AE2\u0AE3\u0AFA-\u0AFF\u0B01-\u0B03\u0B3C\u0B3E-\u0B44\u0B47\u0B48\u0B4B-\u0B4D\u0B56\u0B57\u0B62\u0B63\u0B82\u0BBE-\u0BC2\u0BC6-\u0BC8\u0BCA-\u0BCD\u0BD7\u0C00-\u0C04\u0C3E-\u0C44\u0C46-\u0C48\u0C4A-\u0C4D\u0C55\u0C56\u0C62\u0C63\u0C81-\u0C83\u0CBC\u0CBE-\u0CC4\u0CC6-\u0CC8\u0CCA-\u0CCD\u0CD5\u0CD6\u0CE2\u0CE3\u0D00-\u0D03\u0D3B\u0D3C\u0D3E-\u0D44\u0D46-\u0D48\u0D4A-\u0D4D\u0D57\u0D62\u0D63\u0D82\u0D83\u0DCA\u0DCF-\u0DD4\u0DD6\u0DD8-\u0DDF\u0DF2\u0DF3\u0E31\u0E34-\u0E3A\u0E47-\u0E4E\u0EB1\u0EB4-\u0EB9\u0EBB\u0EBC\u0EC8-\u0ECD\u0F18\u0F19\u0F35\u0F37\u0F39\u0F3E\u0F3F\u0F71-\u0F84\u0F86\u0F87\u0F8D-\u0F97\u0F99-\u0FBC\u0FC6\u102B-\u103E\u1056-\u1059\u105E-\u1060\u1062-\u1064\u1067-\u106D\u1071-\u1074\u1082-\u108D\u108F\u109A-\u109D\u135D-\u135F\u1712-\u1714\u1732-\u1734\u1752\u1753\u1772\u1773\u17B4-\u17D3\u17DD\u180B-\u180D\u1885\u1886\u18A9\u1920-\u192B\u1930-\u193B\u1A17-\u1A1B\u1A55-\u1A5E\u1A60-\u1A7C\u1A7F\u1AB0-\u1ABE\u1B00-\u1B04\u1B34-\u1B44\u1B6B-\u1B73\u1B80-\u1B82\u1BA1-\u1BAD\u1BE6-\u1BF3\u1C24-\u1C37\u1CD0-\u1CD2\u1CD4-\u1CE8\u1CED\u1CF2-\u1CF4\u1CF7-\u1CF9\u1DC0-\u1DF9\u1DFB-\u1DFF\u20D0-\u20F0\u2CEF-\u2CF1\u2D7F\u2DE0-\u2DFF\u302A-\u302F\u3099\u309A\uA66F-\uA672\uA674-\uA67D\uA69E\uA69F\uA6F0\uA6F1\uA802\uA806\uA80B\uA823-\uA827\uA880\uA881\uA8B4-\uA8C5\uA8E0-\uA8F1\uA8FF\uA926-\uA92D\uA947-\uA953\uA980-\uA983\uA9B3-\uA9C0\uA9E5\uAA29-\uAA36\uAA43\uAA4C\uAA4D\uAA7B-\uAA7D\uAAB0\uAAB2-\uAAB4\uAAB7\uAAB8\uAABE\uAABF\uAAC1\uAAEB-\uAAEF\uAAF5\uAAF6\uABE3-\uABEA\uABEC\uABED\uFB1E\uFE00-\uFE0F\uFE20-\uFE2F', + 'astral': '\uD800[\uDDFD\uDEE0\uDF76-\uDF7A]|\uD802[\uDE01-\uDE03\uDE05\uDE06\uDE0C-\uDE0F\uDE38-\uDE3A\uDE3F\uDEE5\uDEE6]|\uD803[\uDD24-\uDD27\uDF46-\uDF50]|\uD804[\uDC00-\uDC02\uDC38-\uDC46\uDC7F-\uDC82\uDCB0-\uDCBA\uDD00-\uDD02\uDD27-\uDD34\uDD45\uDD46\uDD73\uDD80-\uDD82\uDDB3-\uDDC0\uDDC9-\uDDCC\uDE2C-\uDE37\uDE3E\uDEDF-\uDEEA\uDF00-\uDF03\uDF3B\uDF3C\uDF3E-\uDF44\uDF47\uDF48\uDF4B-\uDF4D\uDF57\uDF62\uDF63\uDF66-\uDF6C\uDF70-\uDF74]|\uD805[\uDC35-\uDC46\uDC5E\uDCB0-\uDCC3\uDDAF-\uDDB5\uDDB8-\uDDC0\uDDDC\uDDDD\uDE30-\uDE40\uDEAB-\uDEB7\uDF1D-\uDF2B]|\uD806[\uDC2C-\uDC3A\uDE01-\uDE0A\uDE33-\uDE39\uDE3B-\uDE3E\uDE47\uDE51-\uDE5B\uDE8A-\uDE99]|\uD807[\uDC2F-\uDC36\uDC38-\uDC3F\uDC92-\uDCA7\uDCA9-\uDCB6\uDD31-\uDD36\uDD3A\uDD3C\uDD3D\uDD3F-\uDD45\uDD47\uDD8A-\uDD8E\uDD90\uDD91\uDD93-\uDD97\uDEF3-\uDEF6]|\uD81A[\uDEF0-\uDEF4\uDF30-\uDF36]|\uD81B[\uDF51-\uDF7E\uDF8F-\uDF92]|\uD82F[\uDC9D\uDC9E]|\uD834[\uDD65-\uDD69\uDD6D-\uDD72\uDD7B-\uDD82\uDD85-\uDD8B\uDDAA-\uDDAD\uDE42-\uDE44]|\uD836[\uDE00-\uDE36\uDE3B-\uDE6C\uDE75\uDE84\uDE9B-\uDE9F\uDEA1-\uDEAF]|\uD838[\uDC00-\uDC06\uDC08-\uDC18\uDC1B-\uDC21\uDC23\uDC24\uDC26-\uDC2A]|\uD83A[\uDCD0-\uDCD6\uDD44-\uDD4A]|\uDB40[\uDD00-\uDDEF]' + }, + { + 'name': 'Mc', + 'alias': 'Spacing_Mark', + 'bmp': '\u0903\u093B\u093E-\u0940\u0949-\u094C\u094E\u094F\u0982\u0983\u09BE-\u09C0\u09C7\u09C8\u09CB\u09CC\u09D7\u0A03\u0A3E-\u0A40\u0A83\u0ABE-\u0AC0\u0AC9\u0ACB\u0ACC\u0B02\u0B03\u0B3E\u0B40\u0B47\u0B48\u0B4B\u0B4C\u0B57\u0BBE\u0BBF\u0BC1\u0BC2\u0BC6-\u0BC8\u0BCA-\u0BCC\u0BD7\u0C01-\u0C03\u0C41-\u0C44\u0C82\u0C83\u0CBE\u0CC0-\u0CC4\u0CC7\u0CC8\u0CCA\u0CCB\u0CD5\u0CD6\u0D02\u0D03\u0D3E-\u0D40\u0D46-\u0D48\u0D4A-\u0D4C\u0D57\u0D82\u0D83\u0DCF-\u0DD1\u0DD8-\u0DDF\u0DF2\u0DF3\u0F3E\u0F3F\u0F7F\u102B\u102C\u1031\u1038\u103B\u103C\u1056\u1057\u1062-\u1064\u1067-\u106D\u1083\u1084\u1087-\u108C\u108F\u109A-\u109C\u17B6\u17BE-\u17C5\u17C7\u17C8\u1923-\u1926\u1929-\u192B\u1930\u1931\u1933-\u1938\u1A19\u1A1A\u1A55\u1A57\u1A61\u1A63\u1A64\u1A6D-\u1A72\u1B04\u1B35\u1B3B\u1B3D-\u1B41\u1B43\u1B44\u1B82\u1BA1\u1BA6\u1BA7\u1BAA\u1BE7\u1BEA-\u1BEC\u1BEE\u1BF2\u1BF3\u1C24-\u1C2B\u1C34\u1C35\u1CE1\u1CF2\u1CF3\u1CF7\u302E\u302F\uA823\uA824\uA827\uA880\uA881\uA8B4-\uA8C3\uA952\uA953\uA983\uA9B4\uA9B5\uA9BA\uA9BB\uA9BD-\uA9C0\uAA2F\uAA30\uAA33\uAA34\uAA4D\uAA7B\uAA7D\uAAEB\uAAEE\uAAEF\uAAF5\uABE3\uABE4\uABE6\uABE7\uABE9\uABEA\uABEC', + 'astral': '\uD804[\uDC00\uDC02\uDC82\uDCB0-\uDCB2\uDCB7\uDCB8\uDD2C\uDD45\uDD46\uDD82\uDDB3-\uDDB5\uDDBF\uDDC0\uDE2C-\uDE2E\uDE32\uDE33\uDE35\uDEE0-\uDEE2\uDF02\uDF03\uDF3E\uDF3F\uDF41-\uDF44\uDF47\uDF48\uDF4B-\uDF4D\uDF57\uDF62\uDF63]|\uD805[\uDC35-\uDC37\uDC40\uDC41\uDC45\uDCB0-\uDCB2\uDCB9\uDCBB-\uDCBE\uDCC1\uDDAF-\uDDB1\uDDB8-\uDDBB\uDDBE\uDE30-\uDE32\uDE3B\uDE3C\uDE3E\uDEAC\uDEAE\uDEAF\uDEB6\uDF20\uDF21\uDF26]|\uD806[\uDC2C-\uDC2E\uDC38\uDE39\uDE57\uDE58\uDE97]|\uD807[\uDC2F\uDC3E\uDCA9\uDCB1\uDCB4\uDD8A-\uDD8E\uDD93\uDD94\uDD96\uDEF5\uDEF6]|\uD81B[\uDF51-\uDF7E]|\uD834[\uDD65\uDD66\uDD6D-\uDD72]' + }, + { + 'name': 'Me', + 'alias': 'Enclosing_Mark', + 'bmp': '\u0488\u0489\u1ABE\u20DD-\u20E0\u20E2-\u20E4\uA670-\uA672' + }, + { + 'name': 'Mn', + 'alias': 'Nonspacing_Mark', + 'bmp': '\u0300-\u036F\u0483-\u0487\u0591-\u05BD\u05BF\u05C1\u05C2\u05C4\u05C5\u05C7\u0610-\u061A\u064B-\u065F\u0670\u06D6-\u06DC\u06DF-\u06E4\u06E7\u06E8\u06EA-\u06ED\u0711\u0730-\u074A\u07A6-\u07B0\u07EB-\u07F3\u07FD\u0816-\u0819\u081B-\u0823\u0825-\u0827\u0829-\u082D\u0859-\u085B\u08D3-\u08E1\u08E3-\u0902\u093A\u093C\u0941-\u0948\u094D\u0951-\u0957\u0962\u0963\u0981\u09BC\u09C1-\u09C4\u09CD\u09E2\u09E3\u09FE\u0A01\u0A02\u0A3C\u0A41\u0A42\u0A47\u0A48\u0A4B-\u0A4D\u0A51\u0A70\u0A71\u0A75\u0A81\u0A82\u0ABC\u0AC1-\u0AC5\u0AC7\u0AC8\u0ACD\u0AE2\u0AE3\u0AFA-\u0AFF\u0B01\u0B3C\u0B3F\u0B41-\u0B44\u0B4D\u0B56\u0B62\u0B63\u0B82\u0BC0\u0BCD\u0C00\u0C04\u0C3E-\u0C40\u0C46-\u0C48\u0C4A-\u0C4D\u0C55\u0C56\u0C62\u0C63\u0C81\u0CBC\u0CBF\u0CC6\u0CCC\u0CCD\u0CE2\u0CE3\u0D00\u0D01\u0D3B\u0D3C\u0D41-\u0D44\u0D4D\u0D62\u0D63\u0DCA\u0DD2-\u0DD4\u0DD6\u0E31\u0E34-\u0E3A\u0E47-\u0E4E\u0EB1\u0EB4-\u0EB9\u0EBB\u0EBC\u0EC8-\u0ECD\u0F18\u0F19\u0F35\u0F37\u0F39\u0F71-\u0F7E\u0F80-\u0F84\u0F86\u0F87\u0F8D-\u0F97\u0F99-\u0FBC\u0FC6\u102D-\u1030\u1032-\u1037\u1039\u103A\u103D\u103E\u1058\u1059\u105E-\u1060\u1071-\u1074\u1082\u1085\u1086\u108D\u109D\u135D-\u135F\u1712-\u1714\u1732-\u1734\u1752\u1753\u1772\u1773\u17B4\u17B5\u17B7-\u17BD\u17C6\u17C9-\u17D3\u17DD\u180B-\u180D\u1885\u1886\u18A9\u1920-\u1922\u1927\u1928\u1932\u1939-\u193B\u1A17\u1A18\u1A1B\u1A56\u1A58-\u1A5E\u1A60\u1A62\u1A65-\u1A6C\u1A73-\u1A7C\u1A7F\u1AB0-\u1ABD\u1B00-\u1B03\u1B34\u1B36-\u1B3A\u1B3C\u1B42\u1B6B-\u1B73\u1B80\u1B81\u1BA2-\u1BA5\u1BA8\u1BA9\u1BAB-\u1BAD\u1BE6\u1BE8\u1BE9\u1BED\u1BEF-\u1BF1\u1C2C-\u1C33\u1C36\u1C37\u1CD0-\u1CD2\u1CD4-\u1CE0\u1CE2-\u1CE8\u1CED\u1CF4\u1CF8\u1CF9\u1DC0-\u1DF9\u1DFB-\u1DFF\u20D0-\u20DC\u20E1\u20E5-\u20F0\u2CEF-\u2CF1\u2D7F\u2DE0-\u2DFF\u302A-\u302D\u3099\u309A\uA66F\uA674-\uA67D\uA69E\uA69F\uA6F0\uA6F1\uA802\uA806\uA80B\uA825\uA826\uA8C4\uA8C5\uA8E0-\uA8F1\uA8FF\uA926-\uA92D\uA947-\uA951\uA980-\uA982\uA9B3\uA9B6-\uA9B9\uA9BC\uA9E5\uAA29-\uAA2E\uAA31\uAA32\uAA35\uAA36\uAA43\uAA4C\uAA7C\uAAB0\uAAB2-\uAAB4\uAAB7\uAAB8\uAABE\uAABF\uAAC1\uAAEC\uAAED\uAAF6\uABE5\uABE8\uABED\uFB1E\uFE00-\uFE0F\uFE20-\uFE2F', + 'astral': '\uD800[\uDDFD\uDEE0\uDF76-\uDF7A]|\uD802[\uDE01-\uDE03\uDE05\uDE06\uDE0C-\uDE0F\uDE38-\uDE3A\uDE3F\uDEE5\uDEE6]|\uD803[\uDD24-\uDD27\uDF46-\uDF50]|\uD804[\uDC01\uDC38-\uDC46\uDC7F-\uDC81\uDCB3-\uDCB6\uDCB9\uDCBA\uDD00-\uDD02\uDD27-\uDD2B\uDD2D-\uDD34\uDD73\uDD80\uDD81\uDDB6-\uDDBE\uDDC9-\uDDCC\uDE2F-\uDE31\uDE34\uDE36\uDE37\uDE3E\uDEDF\uDEE3-\uDEEA\uDF00\uDF01\uDF3B\uDF3C\uDF40\uDF66-\uDF6C\uDF70-\uDF74]|\uD805[\uDC38-\uDC3F\uDC42-\uDC44\uDC46\uDC5E\uDCB3-\uDCB8\uDCBA\uDCBF\uDCC0\uDCC2\uDCC3\uDDB2-\uDDB5\uDDBC\uDDBD\uDDBF\uDDC0\uDDDC\uDDDD\uDE33-\uDE3A\uDE3D\uDE3F\uDE40\uDEAB\uDEAD\uDEB0-\uDEB5\uDEB7\uDF1D-\uDF1F\uDF22-\uDF25\uDF27-\uDF2B]|\uD806[\uDC2F-\uDC37\uDC39\uDC3A\uDE01-\uDE0A\uDE33-\uDE38\uDE3B-\uDE3E\uDE47\uDE51-\uDE56\uDE59-\uDE5B\uDE8A-\uDE96\uDE98\uDE99]|\uD807[\uDC30-\uDC36\uDC38-\uDC3D\uDC3F\uDC92-\uDCA7\uDCAA-\uDCB0\uDCB2\uDCB3\uDCB5\uDCB6\uDD31-\uDD36\uDD3A\uDD3C\uDD3D\uDD3F-\uDD45\uDD47\uDD90\uDD91\uDD95\uDD97\uDEF3\uDEF4]|\uD81A[\uDEF0-\uDEF4\uDF30-\uDF36]|\uD81B[\uDF8F-\uDF92]|\uD82F[\uDC9D\uDC9E]|\uD834[\uDD67-\uDD69\uDD7B-\uDD82\uDD85-\uDD8B\uDDAA-\uDDAD\uDE42-\uDE44]|\uD836[\uDE00-\uDE36\uDE3B-\uDE6C\uDE75\uDE84\uDE9B-\uDE9F\uDEA1-\uDEAF]|\uD838[\uDC00-\uDC06\uDC08-\uDC18\uDC1B-\uDC21\uDC23\uDC24\uDC26-\uDC2A]|\uD83A[\uDCD0-\uDCD6\uDD44-\uDD4A]|\uDB40[\uDD00-\uDDEF]' + }, + { + 'name': 'N', + 'alias': 'Number', + 'bmp': '0-9\xB2\xB3\xB9\xBC-\xBE\u0660-\u0669\u06F0-\u06F9\u07C0-\u07C9\u0966-\u096F\u09E6-\u09EF\u09F4-\u09F9\u0A66-\u0A6F\u0AE6-\u0AEF\u0B66-\u0B6F\u0B72-\u0B77\u0BE6-\u0BF2\u0C66-\u0C6F\u0C78-\u0C7E\u0CE6-\u0CEF\u0D58-\u0D5E\u0D66-\u0D78\u0DE6-\u0DEF\u0E50-\u0E59\u0ED0-\u0ED9\u0F20-\u0F33\u1040-\u1049\u1090-\u1099\u1369-\u137C\u16EE-\u16F0\u17E0-\u17E9\u17F0-\u17F9\u1810-\u1819\u1946-\u194F\u19D0-\u19DA\u1A80-\u1A89\u1A90-\u1A99\u1B50-\u1B59\u1BB0-\u1BB9\u1C40-\u1C49\u1C50-\u1C59\u2070\u2074-\u2079\u2080-\u2089\u2150-\u2182\u2185-\u2189\u2460-\u249B\u24EA-\u24FF\u2776-\u2793\u2CFD\u3007\u3021-\u3029\u3038-\u303A\u3192-\u3195\u3220-\u3229\u3248-\u324F\u3251-\u325F\u3280-\u3289\u32B1-\u32BF\uA620-\uA629\uA6E6-\uA6EF\uA830-\uA835\uA8D0-\uA8D9\uA900-\uA909\uA9D0-\uA9D9\uA9F0-\uA9F9\uAA50-\uAA59\uABF0-\uABF9\uFF10-\uFF19', + 'astral': '\uD800[\uDD07-\uDD33\uDD40-\uDD78\uDD8A\uDD8B\uDEE1-\uDEFB\uDF20-\uDF23\uDF41\uDF4A\uDFD1-\uDFD5]|\uD801[\uDCA0-\uDCA9]|\uD802[\uDC58-\uDC5F\uDC79-\uDC7F\uDCA7-\uDCAF\uDCFB-\uDCFF\uDD16-\uDD1B\uDDBC\uDDBD\uDDC0-\uDDCF\uDDD2-\uDDFF\uDE40-\uDE48\uDE7D\uDE7E\uDE9D-\uDE9F\uDEEB-\uDEEF\uDF58-\uDF5F\uDF78-\uDF7F\uDFA9-\uDFAF]|\uD803[\uDCFA-\uDCFF\uDD30-\uDD39\uDE60-\uDE7E\uDF1D-\uDF26\uDF51-\uDF54]|\uD804[\uDC52-\uDC6F\uDCF0-\uDCF9\uDD36-\uDD3F\uDDD0-\uDDD9\uDDE1-\uDDF4\uDEF0-\uDEF9]|\uD805[\uDC50-\uDC59\uDCD0-\uDCD9\uDE50-\uDE59\uDEC0-\uDEC9\uDF30-\uDF3B]|\uD806[\uDCE0-\uDCF2]|\uD807[\uDC50-\uDC6C\uDD50-\uDD59\uDDA0-\uDDA9]|\uD809[\uDC00-\uDC6E]|\uD81A[\uDE60-\uDE69\uDF50-\uDF59\uDF5B-\uDF61]|\uD81B[\uDE80-\uDE96]|\uD834[\uDEE0-\uDEF3\uDF60-\uDF78]|\uD835[\uDFCE-\uDFFF]|\uD83A[\uDCC7-\uDCCF\uDD50-\uDD59]|\uD83B[\uDC71-\uDCAB\uDCAD-\uDCAF\uDCB1-\uDCB4]|\uD83C[\uDD00-\uDD0C]' + }, + { + 'name': 'Nd', + 'alias': 'Decimal_Number', + 'bmp': '0-9\u0660-\u0669\u06F0-\u06F9\u07C0-\u07C9\u0966-\u096F\u09E6-\u09EF\u0A66-\u0A6F\u0AE6-\u0AEF\u0B66-\u0B6F\u0BE6-\u0BEF\u0C66-\u0C6F\u0CE6-\u0CEF\u0D66-\u0D6F\u0DE6-\u0DEF\u0E50-\u0E59\u0ED0-\u0ED9\u0F20-\u0F29\u1040-\u1049\u1090-\u1099\u17E0-\u17E9\u1810-\u1819\u1946-\u194F\u19D0-\u19D9\u1A80-\u1A89\u1A90-\u1A99\u1B50-\u1B59\u1BB0-\u1BB9\u1C40-\u1C49\u1C50-\u1C59\uA620-\uA629\uA8D0-\uA8D9\uA900-\uA909\uA9D0-\uA9D9\uA9F0-\uA9F9\uAA50-\uAA59\uABF0-\uABF9\uFF10-\uFF19', + 'astral': '\uD801[\uDCA0-\uDCA9]|\uD803[\uDD30-\uDD39]|\uD804[\uDC66-\uDC6F\uDCF0-\uDCF9\uDD36-\uDD3F\uDDD0-\uDDD9\uDEF0-\uDEF9]|\uD805[\uDC50-\uDC59\uDCD0-\uDCD9\uDE50-\uDE59\uDEC0-\uDEC9\uDF30-\uDF39]|\uD806[\uDCE0-\uDCE9]|\uD807[\uDC50-\uDC59\uDD50-\uDD59\uDDA0-\uDDA9]|\uD81A[\uDE60-\uDE69\uDF50-\uDF59]|\uD835[\uDFCE-\uDFFF]|\uD83A[\uDD50-\uDD59]' + }, + { + 'name': 'Nl', + 'alias': 'Letter_Number', + 'bmp': '\u16EE-\u16F0\u2160-\u2182\u2185-\u2188\u3007\u3021-\u3029\u3038-\u303A\uA6E6-\uA6EF', + 'astral': '\uD800[\uDD40-\uDD74\uDF41\uDF4A\uDFD1-\uDFD5]|\uD809[\uDC00-\uDC6E]' + }, + { + 'name': 'No', + 'alias': 'Other_Number', + 'bmp': '\xB2\xB3\xB9\xBC-\xBE\u09F4-\u09F9\u0B72-\u0B77\u0BF0-\u0BF2\u0C78-\u0C7E\u0D58-\u0D5E\u0D70-\u0D78\u0F2A-\u0F33\u1369-\u137C\u17F0-\u17F9\u19DA\u2070\u2074-\u2079\u2080-\u2089\u2150-\u215F\u2189\u2460-\u249B\u24EA-\u24FF\u2776-\u2793\u2CFD\u3192-\u3195\u3220-\u3229\u3248-\u324F\u3251-\u325F\u3280-\u3289\u32B1-\u32BF\uA830-\uA835', + 'astral': '\uD800[\uDD07-\uDD33\uDD75-\uDD78\uDD8A\uDD8B\uDEE1-\uDEFB\uDF20-\uDF23]|\uD802[\uDC58-\uDC5F\uDC79-\uDC7F\uDCA7-\uDCAF\uDCFB-\uDCFF\uDD16-\uDD1B\uDDBC\uDDBD\uDDC0-\uDDCF\uDDD2-\uDDFF\uDE40-\uDE48\uDE7D\uDE7E\uDE9D-\uDE9F\uDEEB-\uDEEF\uDF58-\uDF5F\uDF78-\uDF7F\uDFA9-\uDFAF]|\uD803[\uDCFA-\uDCFF\uDE60-\uDE7E\uDF1D-\uDF26\uDF51-\uDF54]|\uD804[\uDC52-\uDC65\uDDE1-\uDDF4]|\uD805[\uDF3A\uDF3B]|\uD806[\uDCEA-\uDCF2]|\uD807[\uDC5A-\uDC6C]|\uD81A[\uDF5B-\uDF61]|\uD81B[\uDE80-\uDE96]|\uD834[\uDEE0-\uDEF3\uDF60-\uDF78]|\uD83A[\uDCC7-\uDCCF]|\uD83B[\uDC71-\uDCAB\uDCAD-\uDCAF\uDCB1-\uDCB4]|\uD83C[\uDD00-\uDD0C]' + }, + { + 'name': 'P', + 'alias': 'Punctuation', + 'bmp': '!-#%-\\*,-\\/:;\\?@\\[-\\]_\\{\\}\xA1\xA7\xAB\xB6\xB7\xBB\xBF\u037E\u0387\u055A-\u055F\u0589\u058A\u05BE\u05C0\u05C3\u05C6\u05F3\u05F4\u0609\u060A\u060C\u060D\u061B\u061E\u061F\u066A-\u066D\u06D4\u0700-\u070D\u07F7-\u07F9\u0830-\u083E\u085E\u0964\u0965\u0970\u09FD\u0A76\u0AF0\u0C84\u0DF4\u0E4F\u0E5A\u0E5B\u0F04-\u0F12\u0F14\u0F3A-\u0F3D\u0F85\u0FD0-\u0FD4\u0FD9\u0FDA\u104A-\u104F\u10FB\u1360-\u1368\u1400\u166D\u166E\u169B\u169C\u16EB-\u16ED\u1735\u1736\u17D4-\u17D6\u17D8-\u17DA\u1800-\u180A\u1944\u1945\u1A1E\u1A1F\u1AA0-\u1AA6\u1AA8-\u1AAD\u1B5A-\u1B60\u1BFC-\u1BFF\u1C3B-\u1C3F\u1C7E\u1C7F\u1CC0-\u1CC7\u1CD3\u2010-\u2027\u2030-\u2043\u2045-\u2051\u2053-\u205E\u207D\u207E\u208D\u208E\u2308-\u230B\u2329\u232A\u2768-\u2775\u27C5\u27C6\u27E6-\u27EF\u2983-\u2998\u29D8-\u29DB\u29FC\u29FD\u2CF9-\u2CFC\u2CFE\u2CFF\u2D70\u2E00-\u2E2E\u2E30-\u2E4E\u3001-\u3003\u3008-\u3011\u3014-\u301F\u3030\u303D\u30A0\u30FB\uA4FE\uA4FF\uA60D-\uA60F\uA673\uA67E\uA6F2-\uA6F7\uA874-\uA877\uA8CE\uA8CF\uA8F8-\uA8FA\uA8FC\uA92E\uA92F\uA95F\uA9C1-\uA9CD\uA9DE\uA9DF\uAA5C-\uAA5F\uAADE\uAADF\uAAF0\uAAF1\uABEB\uFD3E\uFD3F\uFE10-\uFE19\uFE30-\uFE52\uFE54-\uFE61\uFE63\uFE68\uFE6A\uFE6B\uFF01-\uFF03\uFF05-\uFF0A\uFF0C-\uFF0F\uFF1A\uFF1B\uFF1F\uFF20\uFF3B-\uFF3D\uFF3F\uFF5B\uFF5D\uFF5F-\uFF65', + 'astral': '\uD800[\uDD00-\uDD02\uDF9F\uDFD0]|\uD801\uDD6F|\uD802[\uDC57\uDD1F\uDD3F\uDE50-\uDE58\uDE7F\uDEF0-\uDEF6\uDF39-\uDF3F\uDF99-\uDF9C]|\uD803[\uDF55-\uDF59]|\uD804[\uDC47-\uDC4D\uDCBB\uDCBC\uDCBE-\uDCC1\uDD40-\uDD43\uDD74\uDD75\uDDC5-\uDDC8\uDDCD\uDDDB\uDDDD-\uDDDF\uDE38-\uDE3D\uDEA9]|\uD805[\uDC4B-\uDC4F\uDC5B\uDC5D\uDCC6\uDDC1-\uDDD7\uDE41-\uDE43\uDE60-\uDE6C\uDF3C-\uDF3E]|\uD806[\uDC3B\uDE3F-\uDE46\uDE9A-\uDE9C\uDE9E-\uDEA2]|\uD807[\uDC41-\uDC45\uDC70\uDC71\uDEF7\uDEF8]|\uD809[\uDC70-\uDC74]|\uD81A[\uDE6E\uDE6F\uDEF5\uDF37-\uDF3B\uDF44]|\uD81B[\uDE97-\uDE9A]|\uD82F\uDC9F|\uD836[\uDE87-\uDE8B]|\uD83A[\uDD5E\uDD5F]' + }, + { + 'name': 'Pc', + 'alias': 'Connector_Punctuation', + 'bmp': '_\u203F\u2040\u2054\uFE33\uFE34\uFE4D-\uFE4F\uFF3F' + }, + { + 'name': 'Pd', + 'alias': 'Dash_Punctuation', + 'bmp': '\\-\u058A\u05BE\u1400\u1806\u2010-\u2015\u2E17\u2E1A\u2E3A\u2E3B\u2E40\u301C\u3030\u30A0\uFE31\uFE32\uFE58\uFE63\uFF0D' + }, + { + 'name': 'Pe', + 'alias': 'Close_Punctuation', + 'bmp': '\\)\\]\\}\u0F3B\u0F3D\u169C\u2046\u207E\u208E\u2309\u230B\u232A\u2769\u276B\u276D\u276F\u2771\u2773\u2775\u27C6\u27E7\u27E9\u27EB\u27ED\u27EF\u2984\u2986\u2988\u298A\u298C\u298E\u2990\u2992\u2994\u2996\u2998\u29D9\u29DB\u29FD\u2E23\u2E25\u2E27\u2E29\u3009\u300B\u300D\u300F\u3011\u3015\u3017\u3019\u301B\u301E\u301F\uFD3E\uFE18\uFE36\uFE38\uFE3A\uFE3C\uFE3E\uFE40\uFE42\uFE44\uFE48\uFE5A\uFE5C\uFE5E\uFF09\uFF3D\uFF5D\uFF60\uFF63' + }, + { + 'name': 'Pf', + 'alias': 'Final_Punctuation', + 'bmp': '\xBB\u2019\u201D\u203A\u2E03\u2E05\u2E0A\u2E0D\u2E1D\u2E21' + }, + { + 'name': 'Pi', + 'alias': 'Initial_Punctuation', + 'bmp': '\xAB\u2018\u201B\u201C\u201F\u2039\u2E02\u2E04\u2E09\u2E0C\u2E1C\u2E20' + }, + { + 'name': 'Po', + 'alias': 'Other_Punctuation', + 'bmp': '!-#%-\'\\*,\\.\\/:;\\?@\\\xA1\xA7\xB6\xB7\xBF\u037E\u0387\u055A-\u055F\u0589\u05C0\u05C3\u05C6\u05F3\u05F4\u0609\u060A\u060C\u060D\u061B\u061E\u061F\u066A-\u066D\u06D4\u0700-\u070D\u07F7-\u07F9\u0830-\u083E\u085E\u0964\u0965\u0970\u09FD\u0A76\u0AF0\u0C84\u0DF4\u0E4F\u0E5A\u0E5B\u0F04-\u0F12\u0F14\u0F85\u0FD0-\u0FD4\u0FD9\u0FDA\u104A-\u104F\u10FB\u1360-\u1368\u166D\u166E\u16EB-\u16ED\u1735\u1736\u17D4-\u17D6\u17D8-\u17DA\u1800-\u1805\u1807-\u180A\u1944\u1945\u1A1E\u1A1F\u1AA0-\u1AA6\u1AA8-\u1AAD\u1B5A-\u1B60\u1BFC-\u1BFF\u1C3B-\u1C3F\u1C7E\u1C7F\u1CC0-\u1CC7\u1CD3\u2016\u2017\u2020-\u2027\u2030-\u2038\u203B-\u203E\u2041-\u2043\u2047-\u2051\u2053\u2055-\u205E\u2CF9-\u2CFC\u2CFE\u2CFF\u2D70\u2E00\u2E01\u2E06-\u2E08\u2E0B\u2E0E-\u2E16\u2E18\u2E19\u2E1B\u2E1E\u2E1F\u2E2A-\u2E2E\u2E30-\u2E39\u2E3C-\u2E3F\u2E41\u2E43-\u2E4E\u3001-\u3003\u303D\u30FB\uA4FE\uA4FF\uA60D-\uA60F\uA673\uA67E\uA6F2-\uA6F7\uA874-\uA877\uA8CE\uA8CF\uA8F8-\uA8FA\uA8FC\uA92E\uA92F\uA95F\uA9C1-\uA9CD\uA9DE\uA9DF\uAA5C-\uAA5F\uAADE\uAADF\uAAF0\uAAF1\uABEB\uFE10-\uFE16\uFE19\uFE30\uFE45\uFE46\uFE49-\uFE4C\uFE50-\uFE52\uFE54-\uFE57\uFE5F-\uFE61\uFE68\uFE6A\uFE6B\uFF01-\uFF03\uFF05-\uFF07\uFF0A\uFF0C\uFF0E\uFF0F\uFF1A\uFF1B\uFF1F\uFF20\uFF3C\uFF61\uFF64\uFF65', + 'astral': '\uD800[\uDD00-\uDD02\uDF9F\uDFD0]|\uD801\uDD6F|\uD802[\uDC57\uDD1F\uDD3F\uDE50-\uDE58\uDE7F\uDEF0-\uDEF6\uDF39-\uDF3F\uDF99-\uDF9C]|\uD803[\uDF55-\uDF59]|\uD804[\uDC47-\uDC4D\uDCBB\uDCBC\uDCBE-\uDCC1\uDD40-\uDD43\uDD74\uDD75\uDDC5-\uDDC8\uDDCD\uDDDB\uDDDD-\uDDDF\uDE38-\uDE3D\uDEA9]|\uD805[\uDC4B-\uDC4F\uDC5B\uDC5D\uDCC6\uDDC1-\uDDD7\uDE41-\uDE43\uDE60-\uDE6C\uDF3C-\uDF3E]|\uD806[\uDC3B\uDE3F-\uDE46\uDE9A-\uDE9C\uDE9E-\uDEA2]|\uD807[\uDC41-\uDC45\uDC70\uDC71\uDEF7\uDEF8]|\uD809[\uDC70-\uDC74]|\uD81A[\uDE6E\uDE6F\uDEF5\uDF37-\uDF3B\uDF44]|\uD81B[\uDE97-\uDE9A]|\uD82F\uDC9F|\uD836[\uDE87-\uDE8B]|\uD83A[\uDD5E\uDD5F]' + }, + { + 'name': 'Ps', + 'alias': 'Open_Punctuation', + 'bmp': '\\(\\[\\{\u0F3A\u0F3C\u169B\u201A\u201E\u2045\u207D\u208D\u2308\u230A\u2329\u2768\u276A\u276C\u276E\u2770\u2772\u2774\u27C5\u27E6\u27E8\u27EA\u27EC\u27EE\u2983\u2985\u2987\u2989\u298B\u298D\u298F\u2991\u2993\u2995\u2997\u29D8\u29DA\u29FC\u2E22\u2E24\u2E26\u2E28\u2E42\u3008\u300A\u300C\u300E\u3010\u3014\u3016\u3018\u301A\u301D\uFD3F\uFE17\uFE35\uFE37\uFE39\uFE3B\uFE3D\uFE3F\uFE41\uFE43\uFE47\uFE59\uFE5B\uFE5D\uFF08\uFF3B\uFF5B\uFF5F\uFF62' + }, + { + 'name': 'S', + 'alias': 'Symbol', + 'bmp': '\\$\\+<->\\^`\\|~\xA2-\xA6\xA8\xA9\xAC\xAE-\xB1\xB4\xB8\xD7\xF7\u02C2-\u02C5\u02D2-\u02DF\u02E5-\u02EB\u02ED\u02EF-\u02FF\u0375\u0384\u0385\u03F6\u0482\u058D-\u058F\u0606-\u0608\u060B\u060E\u060F\u06DE\u06E9\u06FD\u06FE\u07F6\u07FE\u07FF\u09F2\u09F3\u09FA\u09FB\u0AF1\u0B70\u0BF3-\u0BFA\u0C7F\u0D4F\u0D79\u0E3F\u0F01-\u0F03\u0F13\u0F15-\u0F17\u0F1A-\u0F1F\u0F34\u0F36\u0F38\u0FBE-\u0FC5\u0FC7-\u0FCC\u0FCE\u0FCF\u0FD5-\u0FD8\u109E\u109F\u1390-\u1399\u17DB\u1940\u19DE-\u19FF\u1B61-\u1B6A\u1B74-\u1B7C\u1FBD\u1FBF-\u1FC1\u1FCD-\u1FCF\u1FDD-\u1FDF\u1FED-\u1FEF\u1FFD\u1FFE\u2044\u2052\u207A-\u207C\u208A-\u208C\u20A0-\u20BF\u2100\u2101\u2103-\u2106\u2108\u2109\u2114\u2116-\u2118\u211E-\u2123\u2125\u2127\u2129\u212E\u213A\u213B\u2140-\u2144\u214A-\u214D\u214F\u218A\u218B\u2190-\u2307\u230C-\u2328\u232B-\u2426\u2440-\u244A\u249C-\u24E9\u2500-\u2767\u2794-\u27C4\u27C7-\u27E5\u27F0-\u2982\u2999-\u29D7\u29DC-\u29FB\u29FE-\u2B73\u2B76-\u2B95\u2B98-\u2BC8\u2BCA-\u2BFE\u2CE5-\u2CEA\u2E80-\u2E99\u2E9B-\u2EF3\u2F00-\u2FD5\u2FF0-\u2FFB\u3004\u3012\u3013\u3020\u3036\u3037\u303E\u303F\u309B\u309C\u3190\u3191\u3196-\u319F\u31C0-\u31E3\u3200-\u321E\u322A-\u3247\u3250\u3260-\u327F\u328A-\u32B0\u32C0-\u32FE\u3300-\u33FF\u4DC0-\u4DFF\uA490-\uA4C6\uA700-\uA716\uA720\uA721\uA789\uA78A\uA828-\uA82B\uA836-\uA839\uAA77-\uAA79\uAB5B\uFB29\uFBB2-\uFBC1\uFDFC\uFDFD\uFE62\uFE64-\uFE66\uFE69\uFF04\uFF0B\uFF1C-\uFF1E\uFF3E\uFF40\uFF5C\uFF5E\uFFE0-\uFFE6\uFFE8-\uFFEE\uFFFC\uFFFD', + 'astral': '\uD800[\uDD37-\uDD3F\uDD79-\uDD89\uDD8C-\uDD8E\uDD90-\uDD9B\uDDA0\uDDD0-\uDDFC]|\uD802[\uDC77\uDC78\uDEC8]|\uD805\uDF3F|\uD81A[\uDF3C-\uDF3F\uDF45]|\uD82F\uDC9C|\uD834[\uDC00-\uDCF5\uDD00-\uDD26\uDD29-\uDD64\uDD6A-\uDD6C\uDD83\uDD84\uDD8C-\uDDA9\uDDAE-\uDDE8\uDE00-\uDE41\uDE45\uDF00-\uDF56]|\uD835[\uDEC1\uDEDB\uDEFB\uDF15\uDF35\uDF4F\uDF6F\uDF89\uDFA9\uDFC3]|\uD836[\uDC00-\uDDFF\uDE37-\uDE3A\uDE6D-\uDE74\uDE76-\uDE83\uDE85\uDE86]|\uD83B[\uDCAC\uDCB0\uDEF0\uDEF1]|\uD83C[\uDC00-\uDC2B\uDC30-\uDC93\uDCA0-\uDCAE\uDCB1-\uDCBF\uDCC1-\uDCCF\uDCD1-\uDCF5\uDD10-\uDD6B\uDD70-\uDDAC\uDDE6-\uDE02\uDE10-\uDE3B\uDE40-\uDE48\uDE50\uDE51\uDE60-\uDE65\uDF00-\uDFFF]|\uD83D[\uDC00-\uDED4\uDEE0-\uDEEC\uDEF0-\uDEF9\uDF00-\uDF73\uDF80-\uDFD8]|\uD83E[\uDC00-\uDC0B\uDC10-\uDC47\uDC50-\uDC59\uDC60-\uDC87\uDC90-\uDCAD\uDD00-\uDD0B\uDD10-\uDD3E\uDD40-\uDD70\uDD73-\uDD76\uDD7A\uDD7C-\uDDA2\uDDB0-\uDDB9\uDDC0-\uDDC2\uDDD0-\uDDFF\uDE60-\uDE6D]' + }, + { + 'name': 'Sc', + 'alias': 'Currency_Symbol', + 'bmp': '\\$\xA2-\xA5\u058F\u060B\u07FE\u07FF\u09F2\u09F3\u09FB\u0AF1\u0BF9\u0E3F\u17DB\u20A0-\u20BF\uA838\uFDFC\uFE69\uFF04\uFFE0\uFFE1\uFFE5\uFFE6', + 'astral': '\uD83B\uDCB0' + }, + { + 'name': 'Sk', + 'alias': 'Modifier_Symbol', + 'bmp': '\\^`\xA8\xAF\xB4\xB8\u02C2-\u02C5\u02D2-\u02DF\u02E5-\u02EB\u02ED\u02EF-\u02FF\u0375\u0384\u0385\u1FBD\u1FBF-\u1FC1\u1FCD-\u1FCF\u1FDD-\u1FDF\u1FED-\u1FEF\u1FFD\u1FFE\u309B\u309C\uA700-\uA716\uA720\uA721\uA789\uA78A\uAB5B\uFBB2-\uFBC1\uFF3E\uFF40\uFFE3', + 'astral': '\uD83C[\uDFFB-\uDFFF]' + }, + { + 'name': 'Sm', + 'alias': 'Math_Symbol', + 'bmp': '\\+<->\\|~\xAC\xB1\xD7\xF7\u03F6\u0606-\u0608\u2044\u2052\u207A-\u207C\u208A-\u208C\u2118\u2140-\u2144\u214B\u2190-\u2194\u219A\u219B\u21A0\u21A3\u21A6\u21AE\u21CE\u21CF\u21D2\u21D4\u21F4-\u22FF\u2320\u2321\u237C\u239B-\u23B3\u23DC-\u23E1\u25B7\u25C1\u25F8-\u25FF\u266F\u27C0-\u27C4\u27C7-\u27E5\u27F0-\u27FF\u2900-\u2982\u2999-\u29D7\u29DC-\u29FB\u29FE-\u2AFF\u2B30-\u2B44\u2B47-\u2B4C\uFB29\uFE62\uFE64-\uFE66\uFF0B\uFF1C-\uFF1E\uFF5C\uFF5E\uFFE2\uFFE9-\uFFEC', + 'astral': '\uD835[\uDEC1\uDEDB\uDEFB\uDF15\uDF35\uDF4F\uDF6F\uDF89\uDFA9\uDFC3]|\uD83B[\uDEF0\uDEF1]' + }, + { + 'name': 'So', + 'alias': 'Other_Symbol', + 'bmp': '\xA6\xA9\xAE\xB0\u0482\u058D\u058E\u060E\u060F\u06DE\u06E9\u06FD\u06FE\u07F6\u09FA\u0B70\u0BF3-\u0BF8\u0BFA\u0C7F\u0D4F\u0D79\u0F01-\u0F03\u0F13\u0F15-\u0F17\u0F1A-\u0F1F\u0F34\u0F36\u0F38\u0FBE-\u0FC5\u0FC7-\u0FCC\u0FCE\u0FCF\u0FD5-\u0FD8\u109E\u109F\u1390-\u1399\u1940\u19DE-\u19FF\u1B61-\u1B6A\u1B74-\u1B7C\u2100\u2101\u2103-\u2106\u2108\u2109\u2114\u2116\u2117\u211E-\u2123\u2125\u2127\u2129\u212E\u213A\u213B\u214A\u214C\u214D\u214F\u218A\u218B\u2195-\u2199\u219C-\u219F\u21A1\u21A2\u21A4\u21A5\u21A7-\u21AD\u21AF-\u21CD\u21D0\u21D1\u21D3\u21D5-\u21F3\u2300-\u2307\u230C-\u231F\u2322-\u2328\u232B-\u237B\u237D-\u239A\u23B4-\u23DB\u23E2-\u2426\u2440-\u244A\u249C-\u24E9\u2500-\u25B6\u25B8-\u25C0\u25C2-\u25F7\u2600-\u266E\u2670-\u2767\u2794-\u27BF\u2800-\u28FF\u2B00-\u2B2F\u2B45\u2B46\u2B4D-\u2B73\u2B76-\u2B95\u2B98-\u2BC8\u2BCA-\u2BFE\u2CE5-\u2CEA\u2E80-\u2E99\u2E9B-\u2EF3\u2F00-\u2FD5\u2FF0-\u2FFB\u3004\u3012\u3013\u3020\u3036\u3037\u303E\u303F\u3190\u3191\u3196-\u319F\u31C0-\u31E3\u3200-\u321E\u322A-\u3247\u3250\u3260-\u327F\u328A-\u32B0\u32C0-\u32FE\u3300-\u33FF\u4DC0-\u4DFF\uA490-\uA4C6\uA828-\uA82B\uA836\uA837\uA839\uAA77-\uAA79\uFDFD\uFFE4\uFFE8\uFFED\uFFEE\uFFFC\uFFFD', + 'astral': '\uD800[\uDD37-\uDD3F\uDD79-\uDD89\uDD8C-\uDD8E\uDD90-\uDD9B\uDDA0\uDDD0-\uDDFC]|\uD802[\uDC77\uDC78\uDEC8]|\uD805\uDF3F|\uD81A[\uDF3C-\uDF3F\uDF45]|\uD82F\uDC9C|\uD834[\uDC00-\uDCF5\uDD00-\uDD26\uDD29-\uDD64\uDD6A-\uDD6C\uDD83\uDD84\uDD8C-\uDDA9\uDDAE-\uDDE8\uDE00-\uDE41\uDE45\uDF00-\uDF56]|\uD836[\uDC00-\uDDFF\uDE37-\uDE3A\uDE6D-\uDE74\uDE76-\uDE83\uDE85\uDE86]|\uD83B\uDCAC|\uD83C[\uDC00-\uDC2B\uDC30-\uDC93\uDCA0-\uDCAE\uDCB1-\uDCBF\uDCC1-\uDCCF\uDCD1-\uDCF5\uDD10-\uDD6B\uDD70-\uDDAC\uDDE6-\uDE02\uDE10-\uDE3B\uDE40-\uDE48\uDE50\uDE51\uDE60-\uDE65\uDF00-\uDFFA]|\uD83D[\uDC00-\uDED4\uDEE0-\uDEEC\uDEF0-\uDEF9\uDF00-\uDF73\uDF80-\uDFD8]|\uD83E[\uDC00-\uDC0B\uDC10-\uDC47\uDC50-\uDC59\uDC60-\uDC87\uDC90-\uDCAD\uDD00-\uDD0B\uDD10-\uDD3E\uDD40-\uDD70\uDD73-\uDD76\uDD7A\uDD7C-\uDDA2\uDDB0-\uDDB9\uDDC0-\uDDC2\uDDD0-\uDDFF\uDE60-\uDE6D]' + }, + { + 'name': 'Z', + 'alias': 'Separator', + 'bmp': ' \xA0\u1680\u2000-\u200A\u2028\u2029\u202F\u205F\u3000' + }, + { + 'name': 'Zl', + 'alias': 'Line_Separator', + 'bmp': '\u2028' + }, + { + 'name': 'Zp', + 'alias': 'Paragraph_Separator', + 'bmp': '\u2029' + }, + { + 'name': 'Zs', + 'alias': 'Space_Separator', + 'bmp': ' \xA0\u1680\u2000-\u200A\u202F\u205F\u3000' + } +]; + +var unicodeCategories = createCommonjsModule(function (module, exports) { +"use strict"; + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.default = void 0; + +var _categories = _interopRequireDefault(categories); + +function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } + +/*! + * XRegExp Unicode Categories 4.2.0 + * + * Steven Levithan (c) 2010-present MIT License + * Unicode data by Mathias Bynens + */ +var _default = function _default(XRegExp) { + /** + * Adds support for Unicode's general categories. E.g., `\p{Lu}` or `\p{Uppercase Letter}`. See + * category descriptions in UAX #44 . Token + * names are case insensitive, and any spaces, hyphens, and underscores are ignored. + * + * Uses Unicode 11.0.0. + * + * @requires XRegExp, Unicode Base + */ + if (!XRegExp.addUnicodeData) { + throw new ReferenceError('Unicode Base must be loaded before Unicode Categories'); + } + + XRegExp.addUnicodeData(_categories.default); +}; + +exports.default = _default; +module.exports = exports["default"]; +}); + +unwrapExports(unicodeCategories); + +var properties = [ + { + 'name': 'ASCII', + 'bmp': '\0-\x7F' + }, + { + 'name': 'Alphabetic', + 'bmp': 'A-Za-z\xAA\xB5\xBA\xC0-\xD6\xD8-\xF6\xF8-\u02C1\u02C6-\u02D1\u02E0-\u02E4\u02EC\u02EE\u0345\u0370-\u0374\u0376\u0377\u037A-\u037D\u037F\u0386\u0388-\u038A\u038C\u038E-\u03A1\u03A3-\u03F5\u03F7-\u0481\u048A-\u052F\u0531-\u0556\u0559\u0560-\u0588\u05B0-\u05BD\u05BF\u05C1\u05C2\u05C4\u05C5\u05C7\u05D0-\u05EA\u05EF-\u05F2\u0610-\u061A\u0620-\u0657\u0659-\u065F\u066E-\u06D3\u06D5-\u06DC\u06E1-\u06E8\u06ED-\u06EF\u06FA-\u06FC\u06FF\u0710-\u073F\u074D-\u07B1\u07CA-\u07EA\u07F4\u07F5\u07FA\u0800-\u0817\u081A-\u082C\u0840-\u0858\u0860-\u086A\u08A0-\u08B4\u08B6-\u08BD\u08D4-\u08DF\u08E3-\u08E9\u08F0-\u093B\u093D-\u094C\u094E-\u0950\u0955-\u0963\u0971-\u0983\u0985-\u098C\u098F\u0990\u0993-\u09A8\u09AA-\u09B0\u09B2\u09B6-\u09B9\u09BD-\u09C4\u09C7\u09C8\u09CB\u09CC\u09CE\u09D7\u09DC\u09DD\u09DF-\u09E3\u09F0\u09F1\u09FC\u0A01-\u0A03\u0A05-\u0A0A\u0A0F\u0A10\u0A13-\u0A28\u0A2A-\u0A30\u0A32\u0A33\u0A35\u0A36\u0A38\u0A39\u0A3E-\u0A42\u0A47\u0A48\u0A4B\u0A4C\u0A51\u0A59-\u0A5C\u0A5E\u0A70-\u0A75\u0A81-\u0A83\u0A85-\u0A8D\u0A8F-\u0A91\u0A93-\u0AA8\u0AAA-\u0AB0\u0AB2\u0AB3\u0AB5-\u0AB9\u0ABD-\u0AC5\u0AC7-\u0AC9\u0ACB\u0ACC\u0AD0\u0AE0-\u0AE3\u0AF9-\u0AFC\u0B01-\u0B03\u0B05-\u0B0C\u0B0F\u0B10\u0B13-\u0B28\u0B2A-\u0B30\u0B32\u0B33\u0B35-\u0B39\u0B3D-\u0B44\u0B47\u0B48\u0B4B\u0B4C\u0B56\u0B57\u0B5C\u0B5D\u0B5F-\u0B63\u0B71\u0B82\u0B83\u0B85-\u0B8A\u0B8E-\u0B90\u0B92-\u0B95\u0B99\u0B9A\u0B9C\u0B9E\u0B9F\u0BA3\u0BA4\u0BA8-\u0BAA\u0BAE-\u0BB9\u0BBE-\u0BC2\u0BC6-\u0BC8\u0BCA-\u0BCC\u0BD0\u0BD7\u0C00-\u0C03\u0C05-\u0C0C\u0C0E-\u0C10\u0C12-\u0C28\u0C2A-\u0C39\u0C3D-\u0C44\u0C46-\u0C48\u0C4A-\u0C4C\u0C55\u0C56\u0C58-\u0C5A\u0C60-\u0C63\u0C80-\u0C83\u0C85-\u0C8C\u0C8E-\u0C90\u0C92-\u0CA8\u0CAA-\u0CB3\u0CB5-\u0CB9\u0CBD-\u0CC4\u0CC6-\u0CC8\u0CCA-\u0CCC\u0CD5\u0CD6\u0CDE\u0CE0-\u0CE3\u0CF1\u0CF2\u0D00-\u0D03\u0D05-\u0D0C\u0D0E-\u0D10\u0D12-\u0D3A\u0D3D-\u0D44\u0D46-\u0D48\u0D4A-\u0D4C\u0D4E\u0D54-\u0D57\u0D5F-\u0D63\u0D7A-\u0D7F\u0D82\u0D83\u0D85-\u0D96\u0D9A-\u0DB1\u0DB3-\u0DBB\u0DBD\u0DC0-\u0DC6\u0DCF-\u0DD4\u0DD6\u0DD8-\u0DDF\u0DF2\u0DF3\u0E01-\u0E3A\u0E40-\u0E46\u0E4D\u0E81\u0E82\u0E84\u0E87\u0E88\u0E8A\u0E8D\u0E94-\u0E97\u0E99-\u0E9F\u0EA1-\u0EA3\u0EA5\u0EA7\u0EAA\u0EAB\u0EAD-\u0EB9\u0EBB-\u0EBD\u0EC0-\u0EC4\u0EC6\u0ECD\u0EDC-\u0EDF\u0F00\u0F40-\u0F47\u0F49-\u0F6C\u0F71-\u0F81\u0F88-\u0F97\u0F99-\u0FBC\u1000-\u1036\u1038\u103B-\u103F\u1050-\u1062\u1065-\u1068\u106E-\u1086\u108E\u109C\u109D\u10A0-\u10C5\u10C7\u10CD\u10D0-\u10FA\u10FC-\u1248\u124A-\u124D\u1250-\u1256\u1258\u125A-\u125D\u1260-\u1288\u128A-\u128D\u1290-\u12B0\u12B2-\u12B5\u12B8-\u12BE\u12C0\u12C2-\u12C5\u12C8-\u12D6\u12D8-\u1310\u1312-\u1315\u1318-\u135A\u135F\u1380-\u138F\u13A0-\u13F5\u13F8-\u13FD\u1401-\u166C\u166F-\u167F\u1681-\u169A\u16A0-\u16EA\u16EE-\u16F8\u1700-\u170C\u170E-\u1713\u1720-\u1733\u1740-\u1753\u1760-\u176C\u176E-\u1770\u1772\u1773\u1780-\u17B3\u17B6-\u17C8\u17D7\u17DC\u1820-\u1878\u1880-\u18AA\u18B0-\u18F5\u1900-\u191E\u1920-\u192B\u1930-\u1938\u1950-\u196D\u1970-\u1974\u1980-\u19AB\u19B0-\u19C9\u1A00-\u1A1B\u1A20-\u1A5E\u1A61-\u1A74\u1AA7\u1B00-\u1B33\u1B35-\u1B43\u1B45-\u1B4B\u1B80-\u1BA9\u1BAC-\u1BAF\u1BBA-\u1BE5\u1BE7-\u1BF1\u1C00-\u1C35\u1C4D-\u1C4F\u1C5A-\u1C7D\u1C80-\u1C88\u1C90-\u1CBA\u1CBD-\u1CBF\u1CE9-\u1CEC\u1CEE-\u1CF3\u1CF5\u1CF6\u1D00-\u1DBF\u1DE7-\u1DF4\u1E00-\u1F15\u1F18-\u1F1D\u1F20-\u1F45\u1F48-\u1F4D\u1F50-\u1F57\u1F59\u1F5B\u1F5D\u1F5F-\u1F7D\u1F80-\u1FB4\u1FB6-\u1FBC\u1FBE\u1FC2-\u1FC4\u1FC6-\u1FCC\u1FD0-\u1FD3\u1FD6-\u1FDB\u1FE0-\u1FEC\u1FF2-\u1FF4\u1FF6-\u1FFC\u2071\u207F\u2090-\u209C\u2102\u2107\u210A-\u2113\u2115\u2119-\u211D\u2124\u2126\u2128\u212A-\u212D\u212F-\u2139\u213C-\u213F\u2145-\u2149\u214E\u2160-\u2188\u24B6-\u24E9\u2C00-\u2C2E\u2C30-\u2C5E\u2C60-\u2CE4\u2CEB-\u2CEE\u2CF2\u2CF3\u2D00-\u2D25\u2D27\u2D2D\u2D30-\u2D67\u2D6F\u2D80-\u2D96\u2DA0-\u2DA6\u2DA8-\u2DAE\u2DB0-\u2DB6\u2DB8-\u2DBE\u2DC0-\u2DC6\u2DC8-\u2DCE\u2DD0-\u2DD6\u2DD8-\u2DDE\u2DE0-\u2DFF\u2E2F\u3005-\u3007\u3021-\u3029\u3031-\u3035\u3038-\u303C\u3041-\u3096\u309D-\u309F\u30A1-\u30FA\u30FC-\u30FF\u3105-\u312F\u3131-\u318E\u31A0-\u31BA\u31F0-\u31FF\u3400-\u4DB5\u4E00-\u9FEF\uA000-\uA48C\uA4D0-\uA4FD\uA500-\uA60C\uA610-\uA61F\uA62A\uA62B\uA640-\uA66E\uA674-\uA67B\uA67F-\uA6EF\uA717-\uA71F\uA722-\uA788\uA78B-\uA7B9\uA7F7-\uA801\uA803-\uA805\uA807-\uA80A\uA80C-\uA827\uA840-\uA873\uA880-\uA8C3\uA8C5\uA8F2-\uA8F7\uA8FB\uA8FD\uA8FE\uA90A-\uA92A\uA930-\uA952\uA960-\uA97C\uA980-\uA9B2\uA9B4-\uA9BF\uA9CF\uA9E0-\uA9E4\uA9E6-\uA9EF\uA9FA-\uA9FE\uAA00-\uAA36\uAA40-\uAA4D\uAA60-\uAA76\uAA7A\uAA7E-\uAABE\uAAC0\uAAC2\uAADB-\uAADD\uAAE0-\uAAEF\uAAF2-\uAAF5\uAB01-\uAB06\uAB09-\uAB0E\uAB11-\uAB16\uAB20-\uAB26\uAB28-\uAB2E\uAB30-\uAB5A\uAB5C-\uAB65\uAB70-\uABEA\uAC00-\uD7A3\uD7B0-\uD7C6\uD7CB-\uD7FB\uF900-\uFA6D\uFA70-\uFAD9\uFB00-\uFB06\uFB13-\uFB17\uFB1D-\uFB28\uFB2A-\uFB36\uFB38-\uFB3C\uFB3E\uFB40\uFB41\uFB43\uFB44\uFB46-\uFBB1\uFBD3-\uFD3D\uFD50-\uFD8F\uFD92-\uFDC7\uFDF0-\uFDFB\uFE70-\uFE74\uFE76-\uFEFC\uFF21-\uFF3A\uFF41-\uFF5A\uFF66-\uFFBE\uFFC2-\uFFC7\uFFCA-\uFFCF\uFFD2-\uFFD7\uFFDA-\uFFDC', + 'astral': '\uD800[\uDC00-\uDC0B\uDC0D-\uDC26\uDC28-\uDC3A\uDC3C\uDC3D\uDC3F-\uDC4D\uDC50-\uDC5D\uDC80-\uDCFA\uDD40-\uDD74\uDE80-\uDE9C\uDEA0-\uDED0\uDF00-\uDF1F\uDF2D-\uDF4A\uDF50-\uDF7A\uDF80-\uDF9D\uDFA0-\uDFC3\uDFC8-\uDFCF\uDFD1-\uDFD5]|\uD801[\uDC00-\uDC9D\uDCB0-\uDCD3\uDCD8-\uDCFB\uDD00-\uDD27\uDD30-\uDD63\uDE00-\uDF36\uDF40-\uDF55\uDF60-\uDF67]|\uD802[\uDC00-\uDC05\uDC08\uDC0A-\uDC35\uDC37\uDC38\uDC3C\uDC3F-\uDC55\uDC60-\uDC76\uDC80-\uDC9E\uDCE0-\uDCF2\uDCF4\uDCF5\uDD00-\uDD15\uDD20-\uDD39\uDD80-\uDDB7\uDDBE\uDDBF\uDE00-\uDE03\uDE05\uDE06\uDE0C-\uDE13\uDE15-\uDE17\uDE19-\uDE35\uDE60-\uDE7C\uDE80-\uDE9C\uDEC0-\uDEC7\uDEC9-\uDEE4\uDF00-\uDF35\uDF40-\uDF55\uDF60-\uDF72\uDF80-\uDF91]|\uD803[\uDC00-\uDC48\uDC80-\uDCB2\uDCC0-\uDCF2\uDD00-\uDD27\uDF00-\uDF1C\uDF27\uDF30-\uDF45]|\uD804[\uDC00-\uDC45\uDC82-\uDCB8\uDCD0-\uDCE8\uDD00-\uDD32\uDD44-\uDD46\uDD50-\uDD72\uDD76\uDD80-\uDDBF\uDDC1-\uDDC4\uDDDA\uDDDC\uDE00-\uDE11\uDE13-\uDE34\uDE37\uDE3E\uDE80-\uDE86\uDE88\uDE8A-\uDE8D\uDE8F-\uDE9D\uDE9F-\uDEA8\uDEB0-\uDEE8\uDF00-\uDF03\uDF05-\uDF0C\uDF0F\uDF10\uDF13-\uDF28\uDF2A-\uDF30\uDF32\uDF33\uDF35-\uDF39\uDF3D-\uDF44\uDF47\uDF48\uDF4B\uDF4C\uDF50\uDF57\uDF5D-\uDF63]|\uD805[\uDC00-\uDC41\uDC43-\uDC45\uDC47-\uDC4A\uDC80-\uDCC1\uDCC4\uDCC5\uDCC7\uDD80-\uDDB5\uDDB8-\uDDBE\uDDD8-\uDDDD\uDE00-\uDE3E\uDE40\uDE44\uDE80-\uDEB5\uDF00-\uDF1A\uDF1D-\uDF2A]|\uD806[\uDC00-\uDC38\uDCA0-\uDCDF\uDCFF\uDE00-\uDE32\uDE35-\uDE3E\uDE50-\uDE83\uDE86-\uDE97\uDE9D\uDEC0-\uDEF8]|\uD807[\uDC00-\uDC08\uDC0A-\uDC36\uDC38-\uDC3E\uDC40\uDC72-\uDC8F\uDC92-\uDCA7\uDCA9-\uDCB6\uDD00-\uDD06\uDD08\uDD09\uDD0B-\uDD36\uDD3A\uDD3C\uDD3D\uDD3F-\uDD41\uDD43\uDD46\uDD47\uDD60-\uDD65\uDD67\uDD68\uDD6A-\uDD8E\uDD90\uDD91\uDD93-\uDD96\uDD98\uDEE0-\uDEF6]|\uD808[\uDC00-\uDF99]|\uD809[\uDC00-\uDC6E\uDC80-\uDD43]|[\uD80C\uD81C-\uD820\uD840-\uD868\uD86A-\uD86C\uD86F-\uD872\uD874-\uD879][\uDC00-\uDFFF]|\uD80D[\uDC00-\uDC2E]|\uD811[\uDC00-\uDE46]|\uD81A[\uDC00-\uDE38\uDE40-\uDE5E\uDED0-\uDEED\uDF00-\uDF36\uDF40-\uDF43\uDF63-\uDF77\uDF7D-\uDF8F]|\uD81B[\uDE40-\uDE7F\uDF00-\uDF44\uDF50-\uDF7E\uDF93-\uDF9F\uDFE0\uDFE1]|\uD821[\uDC00-\uDFF1]|\uD822[\uDC00-\uDEF2]|\uD82C[\uDC00-\uDD1E\uDD70-\uDEFB]|\uD82F[\uDC00-\uDC6A\uDC70-\uDC7C\uDC80-\uDC88\uDC90-\uDC99\uDC9E]|\uD835[\uDC00-\uDC54\uDC56-\uDC9C\uDC9E\uDC9F\uDCA2\uDCA5\uDCA6\uDCA9-\uDCAC\uDCAE-\uDCB9\uDCBB\uDCBD-\uDCC3\uDCC5-\uDD05\uDD07-\uDD0A\uDD0D-\uDD14\uDD16-\uDD1C\uDD1E-\uDD39\uDD3B-\uDD3E\uDD40-\uDD44\uDD46\uDD4A-\uDD50\uDD52-\uDEA5\uDEA8-\uDEC0\uDEC2-\uDEDA\uDEDC-\uDEFA\uDEFC-\uDF14\uDF16-\uDF34\uDF36-\uDF4E\uDF50-\uDF6E\uDF70-\uDF88\uDF8A-\uDFA8\uDFAA-\uDFC2\uDFC4-\uDFCB]|\uD838[\uDC00-\uDC06\uDC08-\uDC18\uDC1B-\uDC21\uDC23\uDC24\uDC26-\uDC2A]|\uD83A[\uDC00-\uDCC4\uDD00-\uDD43\uDD47]|\uD83B[\uDE00-\uDE03\uDE05-\uDE1F\uDE21\uDE22\uDE24\uDE27\uDE29-\uDE32\uDE34-\uDE37\uDE39\uDE3B\uDE42\uDE47\uDE49\uDE4B\uDE4D-\uDE4F\uDE51\uDE52\uDE54\uDE57\uDE59\uDE5B\uDE5D\uDE5F\uDE61\uDE62\uDE64\uDE67-\uDE6A\uDE6C-\uDE72\uDE74-\uDE77\uDE79-\uDE7C\uDE7E\uDE80-\uDE89\uDE8B-\uDE9B\uDEA1-\uDEA3\uDEA5-\uDEA9\uDEAB-\uDEBB]|\uD83C[\uDD30-\uDD49\uDD50-\uDD69\uDD70-\uDD89]|\uD869[\uDC00-\uDED6\uDF00-\uDFFF]|\uD86D[\uDC00-\uDF34\uDF40-\uDFFF]|\uD86E[\uDC00-\uDC1D\uDC20-\uDFFF]|\uD873[\uDC00-\uDEA1\uDEB0-\uDFFF]|\uD87A[\uDC00-\uDFE0]|\uD87E[\uDC00-\uDE1D]' + }, + { + 'name': 'Any', + 'isBmpLast': true, + 'bmp': '\0-\uFFFF', + 'astral': '[\uD800-\uDBFF][\uDC00-\uDFFF]' + }, + { + 'name': 'Default_Ignorable_Code_Point', + 'bmp': '\xAD\u034F\u061C\u115F\u1160\u17B4\u17B5\u180B-\u180E\u200B-\u200F\u202A-\u202E\u2060-\u206F\u3164\uFE00-\uFE0F\uFEFF\uFFA0\uFFF0-\uFFF8', + 'astral': '\uD82F[\uDCA0-\uDCA3]|\uD834[\uDD73-\uDD7A]|[\uDB40-\uDB43][\uDC00-\uDFFF]' + }, + { + 'name': 'Lowercase', + 'bmp': 'a-z\xAA\xB5\xBA\xDF-\xF6\xF8-\xFF\u0101\u0103\u0105\u0107\u0109\u010B\u010D\u010F\u0111\u0113\u0115\u0117\u0119\u011B\u011D\u011F\u0121\u0123\u0125\u0127\u0129\u012B\u012D\u012F\u0131\u0133\u0135\u0137\u0138\u013A\u013C\u013E\u0140\u0142\u0144\u0146\u0148\u0149\u014B\u014D\u014F\u0151\u0153\u0155\u0157\u0159\u015B\u015D\u015F\u0161\u0163\u0165\u0167\u0169\u016B\u016D\u016F\u0171\u0173\u0175\u0177\u017A\u017C\u017E-\u0180\u0183\u0185\u0188\u018C\u018D\u0192\u0195\u0199-\u019B\u019E\u01A1\u01A3\u01A5\u01A8\u01AA\u01AB\u01AD\u01B0\u01B4\u01B6\u01B9\u01BA\u01BD-\u01BF\u01C6\u01C9\u01CC\u01CE\u01D0\u01D2\u01D4\u01D6\u01D8\u01DA\u01DC\u01DD\u01DF\u01E1\u01E3\u01E5\u01E7\u01E9\u01EB\u01ED\u01EF\u01F0\u01F3\u01F5\u01F9\u01FB\u01FD\u01FF\u0201\u0203\u0205\u0207\u0209\u020B\u020D\u020F\u0211\u0213\u0215\u0217\u0219\u021B\u021D\u021F\u0221\u0223\u0225\u0227\u0229\u022B\u022D\u022F\u0231\u0233-\u0239\u023C\u023F\u0240\u0242\u0247\u0249\u024B\u024D\u024F-\u0293\u0295-\u02B8\u02C0\u02C1\u02E0-\u02E4\u0345\u0371\u0373\u0377\u037A-\u037D\u0390\u03AC-\u03CE\u03D0\u03D1\u03D5-\u03D7\u03D9\u03DB\u03DD\u03DF\u03E1\u03E3\u03E5\u03E7\u03E9\u03EB\u03ED\u03EF-\u03F3\u03F5\u03F8\u03FB\u03FC\u0430-\u045F\u0461\u0463\u0465\u0467\u0469\u046B\u046D\u046F\u0471\u0473\u0475\u0477\u0479\u047B\u047D\u047F\u0481\u048B\u048D\u048F\u0491\u0493\u0495\u0497\u0499\u049B\u049D\u049F\u04A1\u04A3\u04A5\u04A7\u04A9\u04AB\u04AD\u04AF\u04B1\u04B3\u04B5\u04B7\u04B9\u04BB\u04BD\u04BF\u04C2\u04C4\u04C6\u04C8\u04CA\u04CC\u04CE\u04CF\u04D1\u04D3\u04D5\u04D7\u04D9\u04DB\u04DD\u04DF\u04E1\u04E3\u04E5\u04E7\u04E9\u04EB\u04ED\u04EF\u04F1\u04F3\u04F5\u04F7\u04F9\u04FB\u04FD\u04FF\u0501\u0503\u0505\u0507\u0509\u050B\u050D\u050F\u0511\u0513\u0515\u0517\u0519\u051B\u051D\u051F\u0521\u0523\u0525\u0527\u0529\u052B\u052D\u052F\u0560-\u0588\u10D0-\u10FA\u10FD-\u10FF\u13F8-\u13FD\u1C80-\u1C88\u1D00-\u1DBF\u1E01\u1E03\u1E05\u1E07\u1E09\u1E0B\u1E0D\u1E0F\u1E11\u1E13\u1E15\u1E17\u1E19\u1E1B\u1E1D\u1E1F\u1E21\u1E23\u1E25\u1E27\u1E29\u1E2B\u1E2D\u1E2F\u1E31\u1E33\u1E35\u1E37\u1E39\u1E3B\u1E3D\u1E3F\u1E41\u1E43\u1E45\u1E47\u1E49\u1E4B\u1E4D\u1E4F\u1E51\u1E53\u1E55\u1E57\u1E59\u1E5B\u1E5D\u1E5F\u1E61\u1E63\u1E65\u1E67\u1E69\u1E6B\u1E6D\u1E6F\u1E71\u1E73\u1E75\u1E77\u1E79\u1E7B\u1E7D\u1E7F\u1E81\u1E83\u1E85\u1E87\u1E89\u1E8B\u1E8D\u1E8F\u1E91\u1E93\u1E95-\u1E9D\u1E9F\u1EA1\u1EA3\u1EA5\u1EA7\u1EA9\u1EAB\u1EAD\u1EAF\u1EB1\u1EB3\u1EB5\u1EB7\u1EB9\u1EBB\u1EBD\u1EBF\u1EC1\u1EC3\u1EC5\u1EC7\u1EC9\u1ECB\u1ECD\u1ECF\u1ED1\u1ED3\u1ED5\u1ED7\u1ED9\u1EDB\u1EDD\u1EDF\u1EE1\u1EE3\u1EE5\u1EE7\u1EE9\u1EEB\u1EED\u1EEF\u1EF1\u1EF3\u1EF5\u1EF7\u1EF9\u1EFB\u1EFD\u1EFF-\u1F07\u1F10-\u1F15\u1F20-\u1F27\u1F30-\u1F37\u1F40-\u1F45\u1F50-\u1F57\u1F60-\u1F67\u1F70-\u1F7D\u1F80-\u1F87\u1F90-\u1F97\u1FA0-\u1FA7\u1FB0-\u1FB4\u1FB6\u1FB7\u1FBE\u1FC2-\u1FC4\u1FC6\u1FC7\u1FD0-\u1FD3\u1FD6\u1FD7\u1FE0-\u1FE7\u1FF2-\u1FF4\u1FF6\u1FF7\u2071\u207F\u2090-\u209C\u210A\u210E\u210F\u2113\u212F\u2134\u2139\u213C\u213D\u2146-\u2149\u214E\u2170-\u217F\u2184\u24D0-\u24E9\u2C30-\u2C5E\u2C61\u2C65\u2C66\u2C68\u2C6A\u2C6C\u2C71\u2C73\u2C74\u2C76-\u2C7D\u2C81\u2C83\u2C85\u2C87\u2C89\u2C8B\u2C8D\u2C8F\u2C91\u2C93\u2C95\u2C97\u2C99\u2C9B\u2C9D\u2C9F\u2CA1\u2CA3\u2CA5\u2CA7\u2CA9\u2CAB\u2CAD\u2CAF\u2CB1\u2CB3\u2CB5\u2CB7\u2CB9\u2CBB\u2CBD\u2CBF\u2CC1\u2CC3\u2CC5\u2CC7\u2CC9\u2CCB\u2CCD\u2CCF\u2CD1\u2CD3\u2CD5\u2CD7\u2CD9\u2CDB\u2CDD\u2CDF\u2CE1\u2CE3\u2CE4\u2CEC\u2CEE\u2CF3\u2D00-\u2D25\u2D27\u2D2D\uA641\uA643\uA645\uA647\uA649\uA64B\uA64D\uA64F\uA651\uA653\uA655\uA657\uA659\uA65B\uA65D\uA65F\uA661\uA663\uA665\uA667\uA669\uA66B\uA66D\uA681\uA683\uA685\uA687\uA689\uA68B\uA68D\uA68F\uA691\uA693\uA695\uA697\uA699\uA69B-\uA69D\uA723\uA725\uA727\uA729\uA72B\uA72D\uA72F-\uA731\uA733\uA735\uA737\uA739\uA73B\uA73D\uA73F\uA741\uA743\uA745\uA747\uA749\uA74B\uA74D\uA74F\uA751\uA753\uA755\uA757\uA759\uA75B\uA75D\uA75F\uA761\uA763\uA765\uA767\uA769\uA76B\uA76D\uA76F-\uA778\uA77A\uA77C\uA77F\uA781\uA783\uA785\uA787\uA78C\uA78E\uA791\uA793-\uA795\uA797\uA799\uA79B\uA79D\uA79F\uA7A1\uA7A3\uA7A5\uA7A7\uA7A9\uA7AF\uA7B5\uA7B7\uA7B9\uA7F8-\uA7FA\uAB30-\uAB5A\uAB5C-\uAB65\uAB70-\uABBF\uFB00-\uFB06\uFB13-\uFB17\uFF41-\uFF5A', + 'astral': '\uD801[\uDC28-\uDC4F\uDCD8-\uDCFB]|\uD803[\uDCC0-\uDCF2]|\uD806[\uDCC0-\uDCDF]|\uD81B[\uDE60-\uDE7F]|\uD835[\uDC1A-\uDC33\uDC4E-\uDC54\uDC56-\uDC67\uDC82-\uDC9B\uDCB6-\uDCB9\uDCBB\uDCBD-\uDCC3\uDCC5-\uDCCF\uDCEA-\uDD03\uDD1E-\uDD37\uDD52-\uDD6B\uDD86-\uDD9F\uDDBA-\uDDD3\uDDEE-\uDE07\uDE22-\uDE3B\uDE56-\uDE6F\uDE8A-\uDEA5\uDEC2-\uDEDA\uDEDC-\uDEE1\uDEFC-\uDF14\uDF16-\uDF1B\uDF36-\uDF4E\uDF50-\uDF55\uDF70-\uDF88\uDF8A-\uDF8F\uDFAA-\uDFC2\uDFC4-\uDFC9\uDFCB]|\uD83A[\uDD22-\uDD43]' + }, + { + 'name': 'Noncharacter_Code_Point', + 'bmp': '\uFDD0-\uFDEF\uFFFE\uFFFF', + 'astral': '[\uD83F\uD87F\uD8BF\uD8FF\uD93F\uD97F\uD9BF\uD9FF\uDA3F\uDA7F\uDABF\uDAFF\uDB3F\uDB7F\uDBBF\uDBFF][\uDFFE\uDFFF]' + }, + { + 'name': 'Uppercase', + 'bmp': 'A-Z\xC0-\xD6\xD8-\xDE\u0100\u0102\u0104\u0106\u0108\u010A\u010C\u010E\u0110\u0112\u0114\u0116\u0118\u011A\u011C\u011E\u0120\u0122\u0124\u0126\u0128\u012A\u012C\u012E\u0130\u0132\u0134\u0136\u0139\u013B\u013D\u013F\u0141\u0143\u0145\u0147\u014A\u014C\u014E\u0150\u0152\u0154\u0156\u0158\u015A\u015C\u015E\u0160\u0162\u0164\u0166\u0168\u016A\u016C\u016E\u0170\u0172\u0174\u0176\u0178\u0179\u017B\u017D\u0181\u0182\u0184\u0186\u0187\u0189-\u018B\u018E-\u0191\u0193\u0194\u0196-\u0198\u019C\u019D\u019F\u01A0\u01A2\u01A4\u01A6\u01A7\u01A9\u01AC\u01AE\u01AF\u01B1-\u01B3\u01B5\u01B7\u01B8\u01BC\u01C4\u01C7\u01CA\u01CD\u01CF\u01D1\u01D3\u01D5\u01D7\u01D9\u01DB\u01DE\u01E0\u01E2\u01E4\u01E6\u01E8\u01EA\u01EC\u01EE\u01F1\u01F4\u01F6-\u01F8\u01FA\u01FC\u01FE\u0200\u0202\u0204\u0206\u0208\u020A\u020C\u020E\u0210\u0212\u0214\u0216\u0218\u021A\u021C\u021E\u0220\u0222\u0224\u0226\u0228\u022A\u022C\u022E\u0230\u0232\u023A\u023B\u023D\u023E\u0241\u0243-\u0246\u0248\u024A\u024C\u024E\u0370\u0372\u0376\u037F\u0386\u0388-\u038A\u038C\u038E\u038F\u0391-\u03A1\u03A3-\u03AB\u03CF\u03D2-\u03D4\u03D8\u03DA\u03DC\u03DE\u03E0\u03E2\u03E4\u03E6\u03E8\u03EA\u03EC\u03EE\u03F4\u03F7\u03F9\u03FA\u03FD-\u042F\u0460\u0462\u0464\u0466\u0468\u046A\u046C\u046E\u0470\u0472\u0474\u0476\u0478\u047A\u047C\u047E\u0480\u048A\u048C\u048E\u0490\u0492\u0494\u0496\u0498\u049A\u049C\u049E\u04A0\u04A2\u04A4\u04A6\u04A8\u04AA\u04AC\u04AE\u04B0\u04B2\u04B4\u04B6\u04B8\u04BA\u04BC\u04BE\u04C0\u04C1\u04C3\u04C5\u04C7\u04C9\u04CB\u04CD\u04D0\u04D2\u04D4\u04D6\u04D8\u04DA\u04DC\u04DE\u04E0\u04E2\u04E4\u04E6\u04E8\u04EA\u04EC\u04EE\u04F0\u04F2\u04F4\u04F6\u04F8\u04FA\u04FC\u04FE\u0500\u0502\u0504\u0506\u0508\u050A\u050C\u050E\u0510\u0512\u0514\u0516\u0518\u051A\u051C\u051E\u0520\u0522\u0524\u0526\u0528\u052A\u052C\u052E\u0531-\u0556\u10A0-\u10C5\u10C7\u10CD\u13A0-\u13F5\u1C90-\u1CBA\u1CBD-\u1CBF\u1E00\u1E02\u1E04\u1E06\u1E08\u1E0A\u1E0C\u1E0E\u1E10\u1E12\u1E14\u1E16\u1E18\u1E1A\u1E1C\u1E1E\u1E20\u1E22\u1E24\u1E26\u1E28\u1E2A\u1E2C\u1E2E\u1E30\u1E32\u1E34\u1E36\u1E38\u1E3A\u1E3C\u1E3E\u1E40\u1E42\u1E44\u1E46\u1E48\u1E4A\u1E4C\u1E4E\u1E50\u1E52\u1E54\u1E56\u1E58\u1E5A\u1E5C\u1E5E\u1E60\u1E62\u1E64\u1E66\u1E68\u1E6A\u1E6C\u1E6E\u1E70\u1E72\u1E74\u1E76\u1E78\u1E7A\u1E7C\u1E7E\u1E80\u1E82\u1E84\u1E86\u1E88\u1E8A\u1E8C\u1E8E\u1E90\u1E92\u1E94\u1E9E\u1EA0\u1EA2\u1EA4\u1EA6\u1EA8\u1EAA\u1EAC\u1EAE\u1EB0\u1EB2\u1EB4\u1EB6\u1EB8\u1EBA\u1EBC\u1EBE\u1EC0\u1EC2\u1EC4\u1EC6\u1EC8\u1ECA\u1ECC\u1ECE\u1ED0\u1ED2\u1ED4\u1ED6\u1ED8\u1EDA\u1EDC\u1EDE\u1EE0\u1EE2\u1EE4\u1EE6\u1EE8\u1EEA\u1EEC\u1EEE\u1EF0\u1EF2\u1EF4\u1EF6\u1EF8\u1EFA\u1EFC\u1EFE\u1F08-\u1F0F\u1F18-\u1F1D\u1F28-\u1F2F\u1F38-\u1F3F\u1F48-\u1F4D\u1F59\u1F5B\u1F5D\u1F5F\u1F68-\u1F6F\u1FB8-\u1FBB\u1FC8-\u1FCB\u1FD8-\u1FDB\u1FE8-\u1FEC\u1FF8-\u1FFB\u2102\u2107\u210B-\u210D\u2110-\u2112\u2115\u2119-\u211D\u2124\u2126\u2128\u212A-\u212D\u2130-\u2133\u213E\u213F\u2145\u2160-\u216F\u2183\u24B6-\u24CF\u2C00-\u2C2E\u2C60\u2C62-\u2C64\u2C67\u2C69\u2C6B\u2C6D-\u2C70\u2C72\u2C75\u2C7E-\u2C80\u2C82\u2C84\u2C86\u2C88\u2C8A\u2C8C\u2C8E\u2C90\u2C92\u2C94\u2C96\u2C98\u2C9A\u2C9C\u2C9E\u2CA0\u2CA2\u2CA4\u2CA6\u2CA8\u2CAA\u2CAC\u2CAE\u2CB0\u2CB2\u2CB4\u2CB6\u2CB8\u2CBA\u2CBC\u2CBE\u2CC0\u2CC2\u2CC4\u2CC6\u2CC8\u2CCA\u2CCC\u2CCE\u2CD0\u2CD2\u2CD4\u2CD6\u2CD8\u2CDA\u2CDC\u2CDE\u2CE0\u2CE2\u2CEB\u2CED\u2CF2\uA640\uA642\uA644\uA646\uA648\uA64A\uA64C\uA64E\uA650\uA652\uA654\uA656\uA658\uA65A\uA65C\uA65E\uA660\uA662\uA664\uA666\uA668\uA66A\uA66C\uA680\uA682\uA684\uA686\uA688\uA68A\uA68C\uA68E\uA690\uA692\uA694\uA696\uA698\uA69A\uA722\uA724\uA726\uA728\uA72A\uA72C\uA72E\uA732\uA734\uA736\uA738\uA73A\uA73C\uA73E\uA740\uA742\uA744\uA746\uA748\uA74A\uA74C\uA74E\uA750\uA752\uA754\uA756\uA758\uA75A\uA75C\uA75E\uA760\uA762\uA764\uA766\uA768\uA76A\uA76C\uA76E\uA779\uA77B\uA77D\uA77E\uA780\uA782\uA784\uA786\uA78B\uA78D\uA790\uA792\uA796\uA798\uA79A\uA79C\uA79E\uA7A0\uA7A2\uA7A4\uA7A6\uA7A8\uA7AA-\uA7AE\uA7B0-\uA7B4\uA7B6\uA7B8\uFF21-\uFF3A', + 'astral': '\uD801[\uDC00-\uDC27\uDCB0-\uDCD3]|\uD803[\uDC80-\uDCB2]|\uD806[\uDCA0-\uDCBF]|\uD81B[\uDE40-\uDE5F]|\uD835[\uDC00-\uDC19\uDC34-\uDC4D\uDC68-\uDC81\uDC9C\uDC9E\uDC9F\uDCA2\uDCA5\uDCA6\uDCA9-\uDCAC\uDCAE-\uDCB5\uDCD0-\uDCE9\uDD04\uDD05\uDD07-\uDD0A\uDD0D-\uDD14\uDD16-\uDD1C\uDD38\uDD39\uDD3B-\uDD3E\uDD40-\uDD44\uDD46\uDD4A-\uDD50\uDD6C-\uDD85\uDDA0-\uDDB9\uDDD4-\uDDED\uDE08-\uDE21\uDE3C-\uDE55\uDE70-\uDE89\uDEA8-\uDEC0\uDEE2-\uDEFA\uDF1C-\uDF34\uDF56-\uDF6E\uDF90-\uDFA8\uDFCA]|\uD83A[\uDD00-\uDD21]|\uD83C[\uDD30-\uDD49\uDD50-\uDD69\uDD70-\uDD89]' + }, + { + 'name': 'White_Space', + 'bmp': '\t-\r \x85\xA0\u1680\u2000-\u200A\u2028\u2029\u202F\u205F\u3000' + } +]; + +var unicodeProperties = createCommonjsModule(function (module, exports) { +"use strict"; + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.default = void 0; + +var _properties = _interopRequireDefault(properties); + +function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } + +/*! + * XRegExp Unicode Properties 4.2.0 + * + * Steven Levithan (c) 2012-present MIT License + * Unicode data by Mathias Bynens + */ +var _default = function _default(XRegExp) { + /** + * Adds properties to meet the UTS #18 Level 1 RL1.2 requirements for Unicode regex support. See + * . Following are definitions of these properties from + * UAX #44 : + * + * - Alphabetic + * Characters with the Alphabetic property. Generated from: Lowercase + Uppercase + Lt + Lm + + * Lo + Nl + Other_Alphabetic. + * + * - Default_Ignorable_Code_Point + * For programmatic determination of default ignorable code points. New characters that should + * be ignored in rendering (unless explicitly supported) will be assigned in these ranges, + * permitting programs to correctly handle the default rendering of such characters when not + * otherwise supported. + * + * - Lowercase + * Characters with the Lowercase property. Generated from: Ll + Other_Lowercase. + * + * - Noncharacter_Code_Point + * Code points permanently reserved for internal use. + * + * - Uppercase + * Characters with the Uppercase property. Generated from: Lu + Other_Uppercase. + * + * - White_Space + * Spaces, separator characters and other control characters which should be treated by + * programming languages as "white space" for the purpose of parsing elements. + * + * The properties ASCII, Any, and Assigned are also included but are not defined in UAX #44. UTS + * #18 RL1.2 additionally requires support for Unicode scripts and general categories. These are + * included in XRegExp's Unicode Categories and Unicode Scripts addons. + * + * Token names are case insensitive, and any spaces, hyphens, and underscores are ignored. + * + * Uses Unicode 11.0.0. + * + * @requires XRegExp, Unicode Base + */ + if (!XRegExp.addUnicodeData) { + throw new ReferenceError('Unicode Base must be loaded before Unicode Properties'); + } + + var unicodeData = _properties.default; // Add non-generated data + + unicodeData.push({ + name: 'Assigned', + // Since this is defined as the inverse of Unicode category Cn (Unassigned), the Unicode + // Categories addon is required to use this property + inverseOf: 'Cn' + }); + XRegExp.addUnicodeData(unicodeData); +}; + +exports.default = _default; +module.exports = exports["default"]; +}); + +unwrapExports(unicodeProperties); + +var scripts = [ + { + 'name': 'Adlam', + 'astral': '\uD83A[\uDD00-\uDD4A\uDD50-\uDD59\uDD5E\uDD5F]' + }, + { + 'name': 'Ahom', + 'astral': '\uD805[\uDF00-\uDF1A\uDF1D-\uDF2B\uDF30-\uDF3F]' + }, + { + 'name': 'Anatolian_Hieroglyphs', + 'astral': '\uD811[\uDC00-\uDE46]' + }, + { + 'name': 'Arabic', + 'bmp': '\u0600-\u0604\u0606-\u060B\u060D-\u061A\u061C\u061E\u0620-\u063F\u0641-\u064A\u0656-\u066F\u0671-\u06DC\u06DE-\u06FF\u0750-\u077F\u08A0-\u08B4\u08B6-\u08BD\u08D3-\u08E1\u08E3-\u08FF\uFB50-\uFBC1\uFBD3-\uFD3D\uFD50-\uFD8F\uFD92-\uFDC7\uFDF0-\uFDFD\uFE70-\uFE74\uFE76-\uFEFC', + 'astral': '\uD803[\uDE60-\uDE7E]|\uD83B[\uDE00-\uDE03\uDE05-\uDE1F\uDE21\uDE22\uDE24\uDE27\uDE29-\uDE32\uDE34-\uDE37\uDE39\uDE3B\uDE42\uDE47\uDE49\uDE4B\uDE4D-\uDE4F\uDE51\uDE52\uDE54\uDE57\uDE59\uDE5B\uDE5D\uDE5F\uDE61\uDE62\uDE64\uDE67-\uDE6A\uDE6C-\uDE72\uDE74-\uDE77\uDE79-\uDE7C\uDE7E\uDE80-\uDE89\uDE8B-\uDE9B\uDEA1-\uDEA3\uDEA5-\uDEA9\uDEAB-\uDEBB\uDEF0\uDEF1]' + }, + { + 'name': 'Armenian', + 'bmp': '\u0531-\u0556\u0559-\u0588\u058A\u058D-\u058F\uFB13-\uFB17' + }, + { + 'name': 'Avestan', + 'astral': '\uD802[\uDF00-\uDF35\uDF39-\uDF3F]' + }, + { + 'name': 'Balinese', + 'bmp': '\u1B00-\u1B4B\u1B50-\u1B7C' + }, + { + 'name': 'Bamum', + 'bmp': '\uA6A0-\uA6F7', + 'astral': '\uD81A[\uDC00-\uDE38]' + }, + { + 'name': 'Bassa_Vah', + 'astral': '\uD81A[\uDED0-\uDEED\uDEF0-\uDEF5]' + }, + { + 'name': 'Batak', + 'bmp': '\u1BC0-\u1BF3\u1BFC-\u1BFF' + }, + { + 'name': 'Bengali', + 'bmp': '\u0980-\u0983\u0985-\u098C\u098F\u0990\u0993-\u09A8\u09AA-\u09B0\u09B2\u09B6-\u09B9\u09BC-\u09C4\u09C7\u09C8\u09CB-\u09CE\u09D7\u09DC\u09DD\u09DF-\u09E3\u09E6-\u09FE' + }, + { + 'name': 'Bhaiksuki', + 'astral': '\uD807[\uDC00-\uDC08\uDC0A-\uDC36\uDC38-\uDC45\uDC50-\uDC6C]' + }, + { + 'name': 'Bopomofo', + 'bmp': '\u02EA\u02EB\u3105-\u312F\u31A0-\u31BA' + }, + { + 'name': 'Brahmi', + 'astral': '\uD804[\uDC00-\uDC4D\uDC52-\uDC6F\uDC7F]' + }, + { + 'name': 'Braille', + 'bmp': '\u2800-\u28FF' + }, + { + 'name': 'Buginese', + 'bmp': '\u1A00-\u1A1B\u1A1E\u1A1F' + }, + { + 'name': 'Buhid', + 'bmp': '\u1740-\u1753' + }, + { + 'name': 'Canadian_Aboriginal', + 'bmp': '\u1400-\u167F\u18B0-\u18F5' + }, + { + 'name': 'Carian', + 'astral': '\uD800[\uDEA0-\uDED0]' + }, + { + 'name': 'Caucasian_Albanian', + 'astral': '\uD801[\uDD30-\uDD63\uDD6F]' + }, + { + 'name': 'Chakma', + 'astral': '\uD804[\uDD00-\uDD34\uDD36-\uDD46]' + }, + { + 'name': 'Cham', + 'bmp': '\uAA00-\uAA36\uAA40-\uAA4D\uAA50-\uAA59\uAA5C-\uAA5F' + }, + { + 'name': 'Cherokee', + 'bmp': '\u13A0-\u13F5\u13F8-\u13FD\uAB70-\uABBF' + }, + { + 'name': 'Common', + 'bmp': '\0-@\\[-`\\{-\xA9\xAB-\xB9\xBB-\xBF\xD7\xF7\u02B9-\u02DF\u02E5-\u02E9\u02EC-\u02FF\u0374\u037E\u0385\u0387\u0589\u0605\u060C\u061B\u061F\u0640\u06DD\u08E2\u0964\u0965\u0E3F\u0FD5-\u0FD8\u10FB\u16EB-\u16ED\u1735\u1736\u1802\u1803\u1805\u1CD3\u1CE1\u1CE9-\u1CEC\u1CEE-\u1CF3\u1CF5-\u1CF7\u2000-\u200B\u200E-\u2064\u2066-\u2070\u2074-\u207E\u2080-\u208E\u20A0-\u20BF\u2100-\u2125\u2127-\u2129\u212C-\u2131\u2133-\u214D\u214F-\u215F\u2189-\u218B\u2190-\u2426\u2440-\u244A\u2460-\u27FF\u2900-\u2B73\u2B76-\u2B95\u2B98-\u2BC8\u2BCA-\u2BFE\u2E00-\u2E4E\u2FF0-\u2FFB\u3000-\u3004\u3006\u3008-\u3020\u3030-\u3037\u303C-\u303F\u309B\u309C\u30A0\u30FB\u30FC\u3190-\u319F\u31C0-\u31E3\u3220-\u325F\u327F-\u32CF\u3358-\u33FF\u4DC0-\u4DFF\uA700-\uA721\uA788-\uA78A\uA830-\uA839\uA92E\uA9CF\uAB5B\uFD3E\uFD3F\uFE10-\uFE19\uFE30-\uFE52\uFE54-\uFE66\uFE68-\uFE6B\uFEFF\uFF01-\uFF20\uFF3B-\uFF40\uFF5B-\uFF65\uFF70\uFF9E\uFF9F\uFFE0-\uFFE6\uFFE8-\uFFEE\uFFF9-\uFFFD', + 'astral': '\uD800[\uDD00-\uDD02\uDD07-\uDD33\uDD37-\uDD3F\uDD90-\uDD9B\uDDD0-\uDDFC\uDEE1-\uDEFB]|\uD82F[\uDCA0-\uDCA3]|\uD834[\uDC00-\uDCF5\uDD00-\uDD26\uDD29-\uDD66\uDD6A-\uDD7A\uDD83\uDD84\uDD8C-\uDDA9\uDDAE-\uDDE8\uDEE0-\uDEF3\uDF00-\uDF56\uDF60-\uDF78]|\uD835[\uDC00-\uDC54\uDC56-\uDC9C\uDC9E\uDC9F\uDCA2\uDCA5\uDCA6\uDCA9-\uDCAC\uDCAE-\uDCB9\uDCBB\uDCBD-\uDCC3\uDCC5-\uDD05\uDD07-\uDD0A\uDD0D-\uDD14\uDD16-\uDD1C\uDD1E-\uDD39\uDD3B-\uDD3E\uDD40-\uDD44\uDD46\uDD4A-\uDD50\uDD52-\uDEA5\uDEA8-\uDFCB\uDFCE-\uDFFF]|\uD83B[\uDC71-\uDCB4]|\uD83C[\uDC00-\uDC2B\uDC30-\uDC93\uDCA0-\uDCAE\uDCB1-\uDCBF\uDCC1-\uDCCF\uDCD1-\uDCF5\uDD00-\uDD0C\uDD10-\uDD6B\uDD70-\uDDAC\uDDE6-\uDDFF\uDE01\uDE02\uDE10-\uDE3B\uDE40-\uDE48\uDE50\uDE51\uDE60-\uDE65\uDF00-\uDFFF]|\uD83D[\uDC00-\uDED4\uDEE0-\uDEEC\uDEF0-\uDEF9\uDF00-\uDF73\uDF80-\uDFD8]|\uD83E[\uDC00-\uDC0B\uDC10-\uDC47\uDC50-\uDC59\uDC60-\uDC87\uDC90-\uDCAD\uDD00-\uDD0B\uDD10-\uDD3E\uDD40-\uDD70\uDD73-\uDD76\uDD7A\uDD7C-\uDDA2\uDDB0-\uDDB9\uDDC0-\uDDC2\uDDD0-\uDDFF\uDE60-\uDE6D]|\uDB40[\uDC01\uDC20-\uDC7F]' + }, + { + 'name': 'Coptic', + 'bmp': '\u03E2-\u03EF\u2C80-\u2CF3\u2CF9-\u2CFF' + }, + { + 'name': 'Cuneiform', + 'astral': '\uD808[\uDC00-\uDF99]|\uD809[\uDC00-\uDC6E\uDC70-\uDC74\uDC80-\uDD43]' + }, + { + 'name': 'Cypriot', + 'astral': '\uD802[\uDC00-\uDC05\uDC08\uDC0A-\uDC35\uDC37\uDC38\uDC3C\uDC3F]' + }, + { + 'name': 'Cyrillic', + 'bmp': '\u0400-\u0484\u0487-\u052F\u1C80-\u1C88\u1D2B\u1D78\u2DE0-\u2DFF\uA640-\uA69F\uFE2E\uFE2F' + }, + { + 'name': 'Deseret', + 'astral': '\uD801[\uDC00-\uDC4F]' + }, + { + 'name': 'Devanagari', + 'bmp': '\u0900-\u0950\u0953-\u0963\u0966-\u097F\uA8E0-\uA8FF' + }, + { + 'name': 'Dogra', + 'astral': '\uD806[\uDC00-\uDC3B]' + }, + { + 'name': 'Duployan', + 'astral': '\uD82F[\uDC00-\uDC6A\uDC70-\uDC7C\uDC80-\uDC88\uDC90-\uDC99\uDC9C-\uDC9F]' + }, + { + 'name': 'Egyptian_Hieroglyphs', + 'astral': '\uD80C[\uDC00-\uDFFF]|\uD80D[\uDC00-\uDC2E]' + }, + { + 'name': 'Elbasan', + 'astral': '\uD801[\uDD00-\uDD27]' + }, + { + 'name': 'Ethiopic', + 'bmp': '\u1200-\u1248\u124A-\u124D\u1250-\u1256\u1258\u125A-\u125D\u1260-\u1288\u128A-\u128D\u1290-\u12B0\u12B2-\u12B5\u12B8-\u12BE\u12C0\u12C2-\u12C5\u12C8-\u12D6\u12D8-\u1310\u1312-\u1315\u1318-\u135A\u135D-\u137C\u1380-\u1399\u2D80-\u2D96\u2DA0-\u2DA6\u2DA8-\u2DAE\u2DB0-\u2DB6\u2DB8-\u2DBE\u2DC0-\u2DC6\u2DC8-\u2DCE\u2DD0-\u2DD6\u2DD8-\u2DDE\uAB01-\uAB06\uAB09-\uAB0E\uAB11-\uAB16\uAB20-\uAB26\uAB28-\uAB2E' + }, + { + 'name': 'Georgian', + 'bmp': '\u10A0-\u10C5\u10C7\u10CD\u10D0-\u10FA\u10FC-\u10FF\u1C90-\u1CBA\u1CBD-\u1CBF\u2D00-\u2D25\u2D27\u2D2D' + }, + { + 'name': 'Glagolitic', + 'bmp': '\u2C00-\u2C2E\u2C30-\u2C5E', + 'astral': '\uD838[\uDC00-\uDC06\uDC08-\uDC18\uDC1B-\uDC21\uDC23\uDC24\uDC26-\uDC2A]' + }, + { + 'name': 'Gothic', + 'astral': '\uD800[\uDF30-\uDF4A]' + }, + { + 'name': 'Grantha', + 'astral': '\uD804[\uDF00-\uDF03\uDF05-\uDF0C\uDF0F\uDF10\uDF13-\uDF28\uDF2A-\uDF30\uDF32\uDF33\uDF35-\uDF39\uDF3C-\uDF44\uDF47\uDF48\uDF4B-\uDF4D\uDF50\uDF57\uDF5D-\uDF63\uDF66-\uDF6C\uDF70-\uDF74]' + }, + { + 'name': 'Greek', + 'bmp': '\u0370-\u0373\u0375-\u0377\u037A-\u037D\u037F\u0384\u0386\u0388-\u038A\u038C\u038E-\u03A1\u03A3-\u03E1\u03F0-\u03FF\u1D26-\u1D2A\u1D5D-\u1D61\u1D66-\u1D6A\u1DBF\u1F00-\u1F15\u1F18-\u1F1D\u1F20-\u1F45\u1F48-\u1F4D\u1F50-\u1F57\u1F59\u1F5B\u1F5D\u1F5F-\u1F7D\u1F80-\u1FB4\u1FB6-\u1FC4\u1FC6-\u1FD3\u1FD6-\u1FDB\u1FDD-\u1FEF\u1FF2-\u1FF4\u1FF6-\u1FFE\u2126\uAB65', + 'astral': '\uD800[\uDD40-\uDD8E\uDDA0]|\uD834[\uDE00-\uDE45]' + }, + { + 'name': 'Gujarati', + 'bmp': '\u0A81-\u0A83\u0A85-\u0A8D\u0A8F-\u0A91\u0A93-\u0AA8\u0AAA-\u0AB0\u0AB2\u0AB3\u0AB5-\u0AB9\u0ABC-\u0AC5\u0AC7-\u0AC9\u0ACB-\u0ACD\u0AD0\u0AE0-\u0AE3\u0AE6-\u0AF1\u0AF9-\u0AFF' + }, + { + 'name': 'Gunjala_Gondi', + 'astral': '\uD807[\uDD60-\uDD65\uDD67\uDD68\uDD6A-\uDD8E\uDD90\uDD91\uDD93-\uDD98\uDDA0-\uDDA9]' + }, + { + 'name': 'Gurmukhi', + 'bmp': '\u0A01-\u0A03\u0A05-\u0A0A\u0A0F\u0A10\u0A13-\u0A28\u0A2A-\u0A30\u0A32\u0A33\u0A35\u0A36\u0A38\u0A39\u0A3C\u0A3E-\u0A42\u0A47\u0A48\u0A4B-\u0A4D\u0A51\u0A59-\u0A5C\u0A5E\u0A66-\u0A76' + }, + { + 'name': 'Han', + 'bmp': '\u2E80-\u2E99\u2E9B-\u2EF3\u2F00-\u2FD5\u3005\u3007\u3021-\u3029\u3038-\u303B\u3400-\u4DB5\u4E00-\u9FEF\uF900-\uFA6D\uFA70-\uFAD9', + 'astral': '[\uD840-\uD868\uD86A-\uD86C\uD86F-\uD872\uD874-\uD879][\uDC00-\uDFFF]|\uD869[\uDC00-\uDED6\uDF00-\uDFFF]|\uD86D[\uDC00-\uDF34\uDF40-\uDFFF]|\uD86E[\uDC00-\uDC1D\uDC20-\uDFFF]|\uD873[\uDC00-\uDEA1\uDEB0-\uDFFF]|\uD87A[\uDC00-\uDFE0]|\uD87E[\uDC00-\uDE1D]' + }, + { + 'name': 'Hangul', + 'bmp': '\u1100-\u11FF\u302E\u302F\u3131-\u318E\u3200-\u321E\u3260-\u327E\uA960-\uA97C\uAC00-\uD7A3\uD7B0-\uD7C6\uD7CB-\uD7FB\uFFA0-\uFFBE\uFFC2-\uFFC7\uFFCA-\uFFCF\uFFD2-\uFFD7\uFFDA-\uFFDC' + }, + { + 'name': 'Hanifi_Rohingya', + 'astral': '\uD803[\uDD00-\uDD27\uDD30-\uDD39]' + }, + { + 'name': 'Hanunoo', + 'bmp': '\u1720-\u1734' + }, + { + 'name': 'Hatran', + 'astral': '\uD802[\uDCE0-\uDCF2\uDCF4\uDCF5\uDCFB-\uDCFF]' + }, + { + 'name': 'Hebrew', + 'bmp': '\u0591-\u05C7\u05D0-\u05EA\u05EF-\u05F4\uFB1D-\uFB36\uFB38-\uFB3C\uFB3E\uFB40\uFB41\uFB43\uFB44\uFB46-\uFB4F' + }, + { + 'name': 'Hiragana', + 'bmp': '\u3041-\u3096\u309D-\u309F', + 'astral': '\uD82C[\uDC01-\uDD1E]|\uD83C\uDE00' + }, + { + 'name': 'Imperial_Aramaic', + 'astral': '\uD802[\uDC40-\uDC55\uDC57-\uDC5F]' + }, + { + 'name': 'Inherited', + 'bmp': '\u0300-\u036F\u0485\u0486\u064B-\u0655\u0670\u0951\u0952\u1AB0-\u1ABE\u1CD0-\u1CD2\u1CD4-\u1CE0\u1CE2-\u1CE8\u1CED\u1CF4\u1CF8\u1CF9\u1DC0-\u1DF9\u1DFB-\u1DFF\u200C\u200D\u20D0-\u20F0\u302A-\u302D\u3099\u309A\uFE00-\uFE0F\uFE20-\uFE2D', + 'astral': '\uD800[\uDDFD\uDEE0]|\uD804\uDF3B|\uD834[\uDD67-\uDD69\uDD7B-\uDD82\uDD85-\uDD8B\uDDAA-\uDDAD]|\uDB40[\uDD00-\uDDEF]' + }, + { + 'name': 'Inscriptional_Pahlavi', + 'astral': '\uD802[\uDF60-\uDF72\uDF78-\uDF7F]' + }, + { + 'name': 'Inscriptional_Parthian', + 'astral': '\uD802[\uDF40-\uDF55\uDF58-\uDF5F]' + }, + { + 'name': 'Javanese', + 'bmp': '\uA980-\uA9CD\uA9D0-\uA9D9\uA9DE\uA9DF' + }, + { + 'name': 'Kaithi', + 'astral': '\uD804[\uDC80-\uDCC1\uDCCD]' + }, + { + 'name': 'Kannada', + 'bmp': '\u0C80-\u0C8C\u0C8E-\u0C90\u0C92-\u0CA8\u0CAA-\u0CB3\u0CB5-\u0CB9\u0CBC-\u0CC4\u0CC6-\u0CC8\u0CCA-\u0CCD\u0CD5\u0CD6\u0CDE\u0CE0-\u0CE3\u0CE6-\u0CEF\u0CF1\u0CF2' + }, + { + 'name': 'Katakana', + 'bmp': '\u30A1-\u30FA\u30FD-\u30FF\u31F0-\u31FF\u32D0-\u32FE\u3300-\u3357\uFF66-\uFF6F\uFF71-\uFF9D', + 'astral': '\uD82C\uDC00' + }, + { + 'name': 'Kayah_Li', + 'bmp': '\uA900-\uA92D\uA92F' + }, + { + 'name': 'Kharoshthi', + 'astral': '\uD802[\uDE00-\uDE03\uDE05\uDE06\uDE0C-\uDE13\uDE15-\uDE17\uDE19-\uDE35\uDE38-\uDE3A\uDE3F-\uDE48\uDE50-\uDE58]' + }, + { + 'name': 'Khmer', + 'bmp': '\u1780-\u17DD\u17E0-\u17E9\u17F0-\u17F9\u19E0-\u19FF' + }, + { + 'name': 'Khojki', + 'astral': '\uD804[\uDE00-\uDE11\uDE13-\uDE3E]' + }, + { + 'name': 'Khudawadi', + 'astral': '\uD804[\uDEB0-\uDEEA\uDEF0-\uDEF9]' + }, + { + 'name': 'Lao', + 'bmp': '\u0E81\u0E82\u0E84\u0E87\u0E88\u0E8A\u0E8D\u0E94-\u0E97\u0E99-\u0E9F\u0EA1-\u0EA3\u0EA5\u0EA7\u0EAA\u0EAB\u0EAD-\u0EB9\u0EBB-\u0EBD\u0EC0-\u0EC4\u0EC6\u0EC8-\u0ECD\u0ED0-\u0ED9\u0EDC-\u0EDF' + }, + { + 'name': 'Latin', + 'bmp': 'A-Za-z\xAA\xBA\xC0-\xD6\xD8-\xF6\xF8-\u02B8\u02E0-\u02E4\u1D00-\u1D25\u1D2C-\u1D5C\u1D62-\u1D65\u1D6B-\u1D77\u1D79-\u1DBE\u1E00-\u1EFF\u2071\u207F\u2090-\u209C\u212A\u212B\u2132\u214E\u2160-\u2188\u2C60-\u2C7F\uA722-\uA787\uA78B-\uA7B9\uA7F7-\uA7FF\uAB30-\uAB5A\uAB5C-\uAB64\uFB00-\uFB06\uFF21-\uFF3A\uFF41-\uFF5A' + }, + { + 'name': 'Lepcha', + 'bmp': '\u1C00-\u1C37\u1C3B-\u1C49\u1C4D-\u1C4F' + }, + { + 'name': 'Limbu', + 'bmp': '\u1900-\u191E\u1920-\u192B\u1930-\u193B\u1940\u1944-\u194F' + }, + { + 'name': 'Linear_A', + 'astral': '\uD801[\uDE00-\uDF36\uDF40-\uDF55\uDF60-\uDF67]' + }, + { + 'name': 'Linear_B', + 'astral': '\uD800[\uDC00-\uDC0B\uDC0D-\uDC26\uDC28-\uDC3A\uDC3C\uDC3D\uDC3F-\uDC4D\uDC50-\uDC5D\uDC80-\uDCFA]' + }, + { + 'name': 'Lisu', + 'bmp': '\uA4D0-\uA4FF' + }, + { + 'name': 'Lycian', + 'astral': '\uD800[\uDE80-\uDE9C]' + }, + { + 'name': 'Lydian', + 'astral': '\uD802[\uDD20-\uDD39\uDD3F]' + }, + { + 'name': 'Mahajani', + 'astral': '\uD804[\uDD50-\uDD76]' + }, + { + 'name': 'Makasar', + 'astral': '\uD807[\uDEE0-\uDEF8]' + }, + { + 'name': 'Malayalam', + 'bmp': '\u0D00-\u0D03\u0D05-\u0D0C\u0D0E-\u0D10\u0D12-\u0D44\u0D46-\u0D48\u0D4A-\u0D4F\u0D54-\u0D63\u0D66-\u0D7F' + }, + { + 'name': 'Mandaic', + 'bmp': '\u0840-\u085B\u085E' + }, + { + 'name': 'Manichaean', + 'astral': '\uD802[\uDEC0-\uDEE6\uDEEB-\uDEF6]' + }, + { + 'name': 'Marchen', + 'astral': '\uD807[\uDC70-\uDC8F\uDC92-\uDCA7\uDCA9-\uDCB6]' + }, + { + 'name': 'Masaram_Gondi', + 'astral': '\uD807[\uDD00-\uDD06\uDD08\uDD09\uDD0B-\uDD36\uDD3A\uDD3C\uDD3D\uDD3F-\uDD47\uDD50-\uDD59]' + }, + { + 'name': 'Medefaidrin', + 'astral': '\uD81B[\uDE40-\uDE9A]' + }, + { + 'name': 'Meetei_Mayek', + 'bmp': '\uAAE0-\uAAF6\uABC0-\uABED\uABF0-\uABF9' + }, + { + 'name': 'Mende_Kikakui', + 'astral': '\uD83A[\uDC00-\uDCC4\uDCC7-\uDCD6]' + }, + { + 'name': 'Meroitic_Cursive', + 'astral': '\uD802[\uDDA0-\uDDB7\uDDBC-\uDDCF\uDDD2-\uDDFF]' + }, + { + 'name': 'Meroitic_Hieroglyphs', + 'astral': '\uD802[\uDD80-\uDD9F]' + }, + { + 'name': 'Miao', + 'astral': '\uD81B[\uDF00-\uDF44\uDF50-\uDF7E\uDF8F-\uDF9F]' + }, + { + 'name': 'Modi', + 'astral': '\uD805[\uDE00-\uDE44\uDE50-\uDE59]' + }, + { + 'name': 'Mongolian', + 'bmp': '\u1800\u1801\u1804\u1806-\u180E\u1810-\u1819\u1820-\u1878\u1880-\u18AA', + 'astral': '\uD805[\uDE60-\uDE6C]' + }, + { + 'name': 'Mro', + 'astral': '\uD81A[\uDE40-\uDE5E\uDE60-\uDE69\uDE6E\uDE6F]' + }, + { + 'name': 'Multani', + 'astral': '\uD804[\uDE80-\uDE86\uDE88\uDE8A-\uDE8D\uDE8F-\uDE9D\uDE9F-\uDEA9]' + }, + { + 'name': 'Myanmar', + 'bmp': '\u1000-\u109F\uA9E0-\uA9FE\uAA60-\uAA7F' + }, + { + 'name': 'Nabataean', + 'astral': '\uD802[\uDC80-\uDC9E\uDCA7-\uDCAF]' + }, + { + 'name': 'New_Tai_Lue', + 'bmp': '\u1980-\u19AB\u19B0-\u19C9\u19D0-\u19DA\u19DE\u19DF' + }, + { + 'name': 'Newa', + 'astral': '\uD805[\uDC00-\uDC59\uDC5B\uDC5D\uDC5E]' + }, + { + 'name': 'Nko', + 'bmp': '\u07C0-\u07FA\u07FD-\u07FF' + }, + { + 'name': 'Nushu', + 'astral': '\uD81B\uDFE1|\uD82C[\uDD70-\uDEFB]' + }, + { + 'name': 'Ogham', + 'bmp': '\u1680-\u169C' + }, + { + 'name': 'Ol_Chiki', + 'bmp': '\u1C50-\u1C7F' + }, + { + 'name': 'Old_Hungarian', + 'astral': '\uD803[\uDC80-\uDCB2\uDCC0-\uDCF2\uDCFA-\uDCFF]' + }, + { + 'name': 'Old_Italic', + 'astral': '\uD800[\uDF00-\uDF23\uDF2D-\uDF2F]' + }, + { + 'name': 'Old_North_Arabian', + 'astral': '\uD802[\uDE80-\uDE9F]' + }, + { + 'name': 'Old_Permic', + 'astral': '\uD800[\uDF50-\uDF7A]' + }, + { + 'name': 'Old_Persian', + 'astral': '\uD800[\uDFA0-\uDFC3\uDFC8-\uDFD5]' + }, + { + 'name': 'Old_Sogdian', + 'astral': '\uD803[\uDF00-\uDF27]' + }, + { + 'name': 'Old_South_Arabian', + 'astral': '\uD802[\uDE60-\uDE7F]' + }, + { + 'name': 'Old_Turkic', + 'astral': '\uD803[\uDC00-\uDC48]' + }, + { + 'name': 'Oriya', + 'bmp': '\u0B01-\u0B03\u0B05-\u0B0C\u0B0F\u0B10\u0B13-\u0B28\u0B2A-\u0B30\u0B32\u0B33\u0B35-\u0B39\u0B3C-\u0B44\u0B47\u0B48\u0B4B-\u0B4D\u0B56\u0B57\u0B5C\u0B5D\u0B5F-\u0B63\u0B66-\u0B77' + }, + { + 'name': 'Osage', + 'astral': '\uD801[\uDCB0-\uDCD3\uDCD8-\uDCFB]' + }, + { + 'name': 'Osmanya', + 'astral': '\uD801[\uDC80-\uDC9D\uDCA0-\uDCA9]' + }, + { + 'name': 'Pahawh_Hmong', + 'astral': '\uD81A[\uDF00-\uDF45\uDF50-\uDF59\uDF5B-\uDF61\uDF63-\uDF77\uDF7D-\uDF8F]' + }, + { + 'name': 'Palmyrene', + 'astral': '\uD802[\uDC60-\uDC7F]' + }, + { + 'name': 'Pau_Cin_Hau', + 'astral': '\uD806[\uDEC0-\uDEF8]' + }, + { + 'name': 'Phags_Pa', + 'bmp': '\uA840-\uA877' + }, + { + 'name': 'Phoenician', + 'astral': '\uD802[\uDD00-\uDD1B\uDD1F]' + }, + { + 'name': 'Psalter_Pahlavi', + 'astral': '\uD802[\uDF80-\uDF91\uDF99-\uDF9C\uDFA9-\uDFAF]' + }, + { + 'name': 'Rejang', + 'bmp': '\uA930-\uA953\uA95F' + }, + { + 'name': 'Runic', + 'bmp': '\u16A0-\u16EA\u16EE-\u16F8' + }, + { + 'name': 'Samaritan', + 'bmp': '\u0800-\u082D\u0830-\u083E' + }, + { + 'name': 'Saurashtra', + 'bmp': '\uA880-\uA8C5\uA8CE-\uA8D9' + }, + { + 'name': 'Sharada', + 'astral': '\uD804[\uDD80-\uDDCD\uDDD0-\uDDDF]' + }, + { + 'name': 'Shavian', + 'astral': '\uD801[\uDC50-\uDC7F]' + }, + { + 'name': 'Siddham', + 'astral': '\uD805[\uDD80-\uDDB5\uDDB8-\uDDDD]' + }, + { + 'name': 'SignWriting', + 'astral': '\uD836[\uDC00-\uDE8B\uDE9B-\uDE9F\uDEA1-\uDEAF]' + }, + { + 'name': 'Sinhala', + 'bmp': '\u0D82\u0D83\u0D85-\u0D96\u0D9A-\u0DB1\u0DB3-\u0DBB\u0DBD\u0DC0-\u0DC6\u0DCA\u0DCF-\u0DD4\u0DD6\u0DD8-\u0DDF\u0DE6-\u0DEF\u0DF2-\u0DF4', + 'astral': '\uD804[\uDDE1-\uDDF4]' + }, + { + 'name': 'Sogdian', + 'astral': '\uD803[\uDF30-\uDF59]' + }, + { + 'name': 'Sora_Sompeng', + 'astral': '\uD804[\uDCD0-\uDCE8\uDCF0-\uDCF9]' + }, + { + 'name': 'Soyombo', + 'astral': '\uD806[\uDE50-\uDE83\uDE86-\uDEA2]' + }, + { + 'name': 'Sundanese', + 'bmp': '\u1B80-\u1BBF\u1CC0-\u1CC7' + }, + { + 'name': 'Syloti_Nagri', + 'bmp': '\uA800-\uA82B' + }, + { + 'name': 'Syriac', + 'bmp': '\u0700-\u070D\u070F-\u074A\u074D-\u074F\u0860-\u086A' + }, + { + 'name': 'Tagalog', + 'bmp': '\u1700-\u170C\u170E-\u1714' + }, + { + 'name': 'Tagbanwa', + 'bmp': '\u1760-\u176C\u176E-\u1770\u1772\u1773' + }, + { + 'name': 'Tai_Le', + 'bmp': '\u1950-\u196D\u1970-\u1974' + }, + { + 'name': 'Tai_Tham', + 'bmp': '\u1A20-\u1A5E\u1A60-\u1A7C\u1A7F-\u1A89\u1A90-\u1A99\u1AA0-\u1AAD' + }, + { + 'name': 'Tai_Viet', + 'bmp': '\uAA80-\uAAC2\uAADB-\uAADF' + }, + { + 'name': 'Takri', + 'astral': '\uD805[\uDE80-\uDEB7\uDEC0-\uDEC9]' + }, + { + 'name': 'Tamil', + 'bmp': '\u0B82\u0B83\u0B85-\u0B8A\u0B8E-\u0B90\u0B92-\u0B95\u0B99\u0B9A\u0B9C\u0B9E\u0B9F\u0BA3\u0BA4\u0BA8-\u0BAA\u0BAE-\u0BB9\u0BBE-\u0BC2\u0BC6-\u0BC8\u0BCA-\u0BCD\u0BD0\u0BD7\u0BE6-\u0BFA' + }, + { + 'name': 'Tangut', + 'astral': '\uD81B\uDFE0|[\uD81C-\uD820][\uDC00-\uDFFF]|\uD821[\uDC00-\uDFF1]|\uD822[\uDC00-\uDEF2]' + }, + { + 'name': 'Telugu', + 'bmp': '\u0C00-\u0C0C\u0C0E-\u0C10\u0C12-\u0C28\u0C2A-\u0C39\u0C3D-\u0C44\u0C46-\u0C48\u0C4A-\u0C4D\u0C55\u0C56\u0C58-\u0C5A\u0C60-\u0C63\u0C66-\u0C6F\u0C78-\u0C7F' + }, + { + 'name': 'Thaana', + 'bmp': '\u0780-\u07B1' + }, + { + 'name': 'Thai', + 'bmp': '\u0E01-\u0E3A\u0E40-\u0E5B' + }, + { + 'name': 'Tibetan', + 'bmp': '\u0F00-\u0F47\u0F49-\u0F6C\u0F71-\u0F97\u0F99-\u0FBC\u0FBE-\u0FCC\u0FCE-\u0FD4\u0FD9\u0FDA' + }, + { + 'name': 'Tifinagh', + 'bmp': '\u2D30-\u2D67\u2D6F\u2D70\u2D7F' + }, + { + 'name': 'Tirhuta', + 'astral': '\uD805[\uDC80-\uDCC7\uDCD0-\uDCD9]' + }, + { + 'name': 'Ugaritic', + 'astral': '\uD800[\uDF80-\uDF9D\uDF9F]' + }, + { + 'name': 'Vai', + 'bmp': '\uA500-\uA62B' + }, + { + 'name': 'Warang_Citi', + 'astral': '\uD806[\uDCA0-\uDCF2\uDCFF]' + }, + { + 'name': 'Yi', + 'bmp': '\uA000-\uA48C\uA490-\uA4C6' + }, + { + 'name': 'Zanabazar_Square', + 'astral': '\uD806[\uDE00-\uDE47]' + } +]; + +var unicodeScripts = createCommonjsModule(function (module, exports) { +"use strict"; + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.default = void 0; + +var _scripts = _interopRequireDefault(scripts); + +function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } + +/*! + * XRegExp Unicode Scripts 4.2.0 + * + * Steven Levithan (c) 2010-present MIT License + * Unicode data by Mathias Bynens + */ +var _default = function _default(XRegExp) { + /** + * Adds support for all Unicode scripts. E.g., `\p{Latin}`. Token names are case insensitive, + * and any spaces, hyphens, and underscores are ignored. + * + * Uses Unicode 11.0.0. + * + * @requires XRegExp, Unicode Base + */ + if (!XRegExp.addUnicodeData) { + throw new ReferenceError('Unicode Base must be loaded before Unicode Scripts'); + } + + XRegExp.addUnicodeData(_scripts.default); +}; + +exports.default = _default; +module.exports = exports["default"]; +}); + +unwrapExports(unicodeScripts); + +var lib = createCommonjsModule(function (module, exports) { +"use strict"; + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.default = void 0; + +var _xregexp = _interopRequireDefault(xregexp); + +var _build = _interopRequireDefault(build); + +var _matchrecursive = _interopRequireDefault(matchrecursive); + +var _unicodeBase = _interopRequireDefault(unicodeBase); + +var _unicodeBlocks = _interopRequireDefault(unicodeBlocks); + +var _unicodeCategories = _interopRequireDefault(unicodeCategories); + +var _unicodeProperties = _interopRequireDefault(unicodeProperties); + +var _unicodeScripts = _interopRequireDefault(unicodeScripts); + +function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } + +(_build.default)(_xregexp.default); +(_matchrecursive.default)(_xregexp.default); +(_unicodeBase.default)(_xregexp.default); +(_unicodeBlocks.default)(_xregexp.default); +(_unicodeCategories.default)(_xregexp.default); +(_unicodeProperties.default)(_xregexp.default); +(_unicodeScripts.default)(_xregexp.default); +var _default = _xregexp.default; +exports.default = _default; +module.exports = exports["default"]; +}); + +unwrapExports(lib); + +var utilities = createCommonjsModule(function (module, exports) { +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); + +class FormatUtility { + static preProcess(query, toLower = true) { + if (toLower) { + query = query.toLowerCase(); + } + return query + .replace(/0/g, "0") + .replace(/1/g, "1") + .replace(/2/g, "2") + .replace(/3/g, "3") + .replace(/4/g, "4") + .replace(/5/g, "5") + .replace(/6/g, "6") + .replace(/7/g, "7") + .replace(/8/g, "8") + .replace(/9/g, "9") + .replace(/:/g, ":") + .replace(/-/g, "-") + .replace(/,/g, ",") + .replace(///g, "/") + .replace(/G/g, "G") + .replace(/M/g, "M") + .replace(/T/g, "T") + .replace(/K/g, "K") + .replace(/k/g, "k") + .replace(/./g, ".") + .replace(/(/g, "(") + .replace(/)/g, ")"); + } +} +exports.FormatUtility = FormatUtility; +class Match { + constructor(index, length, value, groups) { + this.index = index; + this.length = length; + this.value = value; + this.innerGroups = groups; + } + groups(key) { + return this.innerGroups[key] ? this.innerGroups[key] : { value: '', index: 0, length: 0, captures: [] }; + } +} +exports.Match = Match; +class RegExpUtility { + static getMatches(regex, source) { + if (!regex) + return []; + let rawRegex = regex.xregexp.source; + if (!rawRegex.includes('(?= 0) { + closePos = this.getClosePos(rawRegex, startPos); + let nlbRegex = lib(rawRegex.substring(startPos, closePos + 1), flags); + let nextRegex = RegExpUtility.getNextRegex(rawRegex, startPos); + nlbRegex.nextRegex = nextRegex ? lib(nextRegex, flags) : null; + negativeLookbehindRegexes.push(nlbRegex); + rawRegex = rawRegex.substr(0, startPos) + rawRegex.substr(closePos + 1); + startPos = rawRegex.indexOf('(? { + let clean = true; + negativeLookbehindRegexes.forEach(regex => { + let negativeLookbehindMatches = RegExpUtility.getMatchesSimple(regex, source); + negativeLookbehindMatches.forEach(negativeLookbehindMatch => { + let negativeLookbehindEnd = negativeLookbehindMatch.index + negativeLookbehindMatch.length; + let nextRegex = regex.nextRegex; + if (match.index === negativeLookbehindEnd) { + if (!nextRegex) { + clean = false; + return; + } + else { + let nextMatch = RegExpUtility.getFirstMatchIndex(nextRegex, source.substring(negativeLookbehindMatch.index)); + if (nextMatch.matched && ((nextMatch.index === negativeLookbehindMatch.length) || (source.includes(nextMatch.value + match.value)))) { + clean = false; + return; + } + } + } + if (negativeLookbehindMatch.value.includes(match.value)) { + let preMatches = RegExpUtility.getMatchesSimple(regex, source.substring(0, match.index)); + preMatches.forEach(preMatch => { + if (source.includes(preMatch.value + match.value)) { + clean = false; + return; + } + }); + } + }); + if (!clean) { + return; + } + }); + if (clean) { + realMatches.push(match); + } + }); + return realMatches; + } + static getMatchesSimple(regex, source) { + // Word boundary (\b) in JS is not unicode-aware, so words starting/ending with accentuated characters will not match + // use a normalized string to match, the return matches' values using the original one + // http://blog.stevenlevithan.com/archives/javascript-regex-and-unicode + // https://stackoverflow.com/questions/2881445/utf-8-word-boundary-regex-in-javascript + let normalized = StringUtility.removeDiacriticsFromWordBoundaries(source); + let matches = new Array(); + lib.forEach(normalized, regex, match => { + let positiveLookbehinds = []; + let groups = {}; + let lastGroup = ''; + Object.keys(match).forEach(key => { + if (!key.includes('__')) + return; + if (key.startsWith('plb') && match[key]) { + if (match[0].indexOf(match[key]) !== 0 && !StringUtility.isNullOrEmpty(lastGroup)) { + let index = match.index + match[0].indexOf(match[key]); + let length = match[key].length; + let value = source.substr(index, length); + groups[lastGroup].value = groups[lastGroup].value + value; + } + positiveLookbehinds.push({ key: key, value: match[key] }); + return; + } + if (key.startsWith('nlb')) { + return; + } + let groupKey = key.substr(0, key.lastIndexOf('__')); + lastGroup = groupKey; + if (!groups[groupKey]) + groups[groupKey] = { value: '', index: 0, length: 0, captures: [] }; + if (match[key]) { + let index = match.index + match[0].indexOf(match[key]); + let length = match[key].length; + let value = source.substr(index, length); + groups[groupKey].index = index; + groups[groupKey].length = length; + groups[groupKey].value = value; + groups[groupKey].captures.push(value); + } + }); + let value = match[0]; + let index = match.index; + let length = value.length; + if (positiveLookbehinds && positiveLookbehinds.length > 0 && value.indexOf(positiveLookbehinds[0].value) === 0) { + value = source.substr(index, length).substr(positiveLookbehinds[0].value.length); + index += positiveLookbehinds[0].value.length; + length -= positiveLookbehinds[0].value.length; + } + else { + value = source.substr(index, length); + } + matches.push(new Match(index, length, value, groups)); + }); + return matches; + } + static getSafeRegExp(source, flags) { + let sanitizedSource = this.sanitizeGroups(source); + return lib(sanitizedSource, flags || 'gis'); + } + static getFirstMatchIndex(regex, source) { + let matches = RegExpUtility.getMatches(regex, source); + if (matches.length) { + return { + matched: true, + index: matches[0].index, + value: matches[0].value + }; + } + return { matched: false, index: -1, value: null }; + } + static split(regex, source) { + return lib.split(source, regex); + } + static isMatch(regex, source) { + return !StringUtility.isNullOrEmpty(source) + && this.getMatches(regex, source).length > 0; + } + static sanitizeGroups(source) { + let index = 0; + let result = lib.replace(source, this.matchGroup, (match, name) => match.replace(name, `${name}__${index++}`)); + index = 0; + result = lib.replace(result, this.matchPositiveLookbehind, () => `(?`); + index = 0; + result = lib.replace(result, this.matchNegativeLookbehind, () => `(?`); + return result; + } + static getNextRegex(source, startPos) { + startPos = RegExpUtility.getClosePos(source, startPos) + 1; + let closePos = RegExpUtility.getClosePos(source, startPos); + if (source[startPos] !== '(') { + closePos--; + } + let next = (startPos === closePos) + ? null + : source.substring(startPos, closePos + 1); + return next; + } + static getClosePos(source, startPos) { + let counter = 1; + let closePos = startPos; + while (counter > 0 && closePos < source.length) { + let c = source[++closePos]; + if (c === '(') + counter++; + else if (c === ')') + counter--; + } + return closePos; + } +} +RegExpUtility.matchGroup = lib(String.raw `\?<(?\w+)>`, 'gis'); +RegExpUtility.matchPositiveLookbehind = lib(String.raw `\(\?<=`, 'gis'); +RegExpUtility.matchNegativeLookbehind = lib(String.raw `\(\? { + let length = s.length; + if (length === 0) + return s; + let first = StringUtility.removeDiacritics(s.substring(0, 1)); + if (length === 1) + return first; + let last = length > 1 ? StringUtility.removeDiacritics(s.substring(length - 1)) : ''; + let mid = s.substring(1, length - 1); + // console.log(first + mid + last) + return first + mid + last; + }) + .join(' '); + } + static removeDiacritics(c) { + let clean = StringUtility.diacriticsRemovalMap[c]; + return !clean ? c : clean; + } +} +StringUtility.diacriticsRemovalMap = { + "Ⓐ": "A", + "A": "A", + "À": "A", + "Á": "A", + "Â": "A", + "Ầ": "A", + "Ấ": "A", + "Ẫ": "A", + "Ẩ": "A", + "Ã": "A", + "Ā": "A", + "Ă": "A", + "Ằ": "A", + "Ắ": "A", + "Ẵ": "A", + "Ẳ": "A", + "Ȧ": "A", + "Ǡ": "A", + "Ä": "A", + "Ǟ": "A", + "Ả": "A", + "Å": "A", + "Ǻ": "A", + "Ǎ": "A", + "Ȁ": "A", + "Ȃ": "A", + "Ạ": "A", + "Ậ": "A", + "Ặ": "A", + "Ḁ": "A", + "Ą": "A", + "Ⱥ": "A", + "Ɐ": "A", + "Ⓑ": "B", + "B": "B", + "Ḃ": "B", + "Ḅ": "B", + "Ḇ": "B", + "Ƀ": "B", + "Ƃ": "B", + "Ɓ": "B", + "Ⓒ": "C", + "C": "C", + "Ć": "C", + "Ĉ": "C", + "Ċ": "C", + "Č": "C", + "Ç": "C", + "Ḉ": "C", + "Ƈ": "C", + "Ȼ": "C", + "Ꜿ": "C", + "Ⓓ": "D", + "D": "D", + "Ḋ": "D", + "Ď": "D", + "Ḍ": "D", + "Ḑ": "D", + "Ḓ": "D", + "Ḏ": "D", + "Đ": "D", + "Ƌ": "D", + "Ɗ": "D", + "Ɖ": "D", + "Ꝺ": "D", + "Ⓔ": "E", + "E": "E", + "È": "E", + "É": "E", + "Ê": "E", + "Ề": "E", + "Ế": "E", + "Ễ": "E", + "Ể": "E", + "Ẽ": "E", + "Ē": "E", + "Ḕ": "E", + "Ḗ": "E", + "Ĕ": "E", + "Ė": "E", + "Ë": "E", + "Ẻ": "E", + "Ě": "E", + "Ȅ": "E", + "Ȇ": "E", + "Ẹ": "E", + "Ệ": "E", + "Ȩ": "E", + "Ḝ": "E", + "Ę": "E", + "Ḙ": "E", + "Ḛ": "E", + "Ɛ": "E", + "Ǝ": "E", + "Ⓕ": "F", + "F": "F", + "Ḟ": "F", + "Ƒ": "F", + "Ꝼ": "F", + "Ⓖ": "G", + "G": "G", + "Ǵ": "G", + "Ĝ": "G", + "Ḡ": "G", + "Ğ": "G", + "Ġ": "G", + "Ǧ": "G", + "Ģ": "G", + "Ǥ": "G", + "Ɠ": "G", + "Ꞡ": "G", + "Ᵹ": "G", + "Ꝿ": "G", + "Ⓗ": "H", + "H": "H", + "Ĥ": "H", + "Ḣ": "H", + "Ḧ": "H", + "Ȟ": "H", + "Ḥ": "H", + "Ḩ": "H", + "Ḫ": "H", + "Ħ": "H", + "Ⱨ": "H", + "Ⱶ": "H", + "Ɥ": "H", + "Ⓘ": "I", + "I": "I", + "Ì": "I", + "Í": "I", + "Î": "I", + "Ĩ": "I", + "Ī": "I", + "Ĭ": "I", + "İ": "I", + "Ï": "I", + "Ḯ": "I", + "Ỉ": "I", + "Ǐ": "I", + "Ȉ": "I", + "Ȋ": "I", + "Ị": "I", + "Į": "I", + "Ḭ": "I", + "Ɨ": "I", + "Ⓙ": "J", + "J": "J", + "Ĵ": "J", + "Ɉ": "J", + "Ⓚ": "K", + "K": "K", + "Ḱ": "K", + "Ǩ": "K", + "Ḳ": "K", + "Ķ": "K", + "Ḵ": "K", + "Ƙ": "K", + "Ⱪ": "K", + "Ꝁ": "K", + "Ꝃ": "K", + "Ꝅ": "K", + "Ꞣ": "K", + "Ⓛ": "L", + "L": "L", + "Ŀ": "L", + "Ĺ": "L", + "Ľ": "L", + "Ḷ": "L", + "Ḹ": "L", + "Ļ": "L", + "Ḽ": "L", + "Ḻ": "L", + "Ł": "L", + "Ƚ": "L", + "Ɫ": "L", + "Ⱡ": "L", + "Ꝉ": "L", + "Ꝇ": "L", + "Ꞁ": "L", + "Ⓜ": "M", + "M": "M", + "Ḿ": "M", + "Ṁ": "M", + "Ṃ": "M", + "Ɱ": "M", + "Ɯ": "M", + "Ⓝ": "N", + "N": "N", + "Ǹ": "N", + "Ń": "N", + "Ñ": "N", + "Ṅ": "N", + "Ň": "N", + "Ṇ": "N", + "Ņ": "N", + "Ṋ": "N", + "Ṉ": "N", + "Ƞ": "N", + "Ɲ": "N", + "Ꞑ": "N", + "Ꞥ": "N", + "Ⓞ": "O", + "O": "O", + "Ò": "O", + "Ó": "O", + "Ô": "O", + "Ồ": "O", + "Ố": "O", + "Ỗ": "O", + "Ổ": "O", + "Õ": "O", + "Ṍ": "O", + "Ȭ": "O", + "Ṏ": "O", + "Ō": "O", + "Ṑ": "O", + "Ṓ": "O", + "Ŏ": "O", + "Ȯ": "O", + "Ȱ": "O", + "Ö": "O", + "Ȫ": "O", + "Ỏ": "O", + "Ő": "O", + "Ǒ": "O", + "Ȍ": "O", + "Ȏ": "O", + "Ơ": "O", + "Ờ": "O", + "Ớ": "O", + "Ỡ": "O", + "Ở": "O", + "Ợ": "O", + "Ọ": "O", + "Ộ": "O", + "Ǫ": "O", + "Ǭ": "O", + "Ø": "O", + "Ǿ": "O", + "Ɔ": "O", + "Ɵ": "O", + "Ꝋ": "O", + "Ꝍ": "O", + "Ⓟ": "P", + "P": "P", + "Ṕ": "P", + "Ṗ": "P", + "Ƥ": "P", + "Ᵽ": "P", + "Ꝑ": "P", + "Ꝓ": "P", + "Ꝕ": "P", + "Ⓠ": "Q", + "Q": "Q", + "Ꝗ": "Q", + "Ꝙ": "Q", + "Ɋ": "Q", + "Ⓡ": "R", + "R": "R", + "Ŕ": "R", + "Ṙ": "R", + "Ř": "R", + "Ȑ": "R", + "Ȓ": "R", + "Ṛ": "R", + "Ṝ": "R", + "Ŗ": "R", + "Ṟ": "R", + "Ɍ": "R", + "Ɽ": "R", + "Ꝛ": "R", + "Ꞧ": "R", + "Ꞃ": "R", + "Ⓢ": "S", + "S": "S", + "ẞ": "S", + "Ś": "S", + "Ṥ": "S", + "Ŝ": "S", + "Ṡ": "S", + "Š": "S", + "Ṧ": "S", + "Ṣ": "S", + "Ṩ": "S", + "Ș": "S", + "Ş": "S", + "Ȿ": "S", + "Ꞩ": "S", + "Ꞅ": "S", + "Ⓣ": "T", + "T": "T", + "Ṫ": "T", + "Ť": "T", + "Ṭ": "T", + "Ț": "T", + "Ţ": "T", + "Ṱ": "T", + "Ṯ": "T", + "Ŧ": "T", + "Ƭ": "T", + "Ʈ": "T", + "Ⱦ": "T", + "Ꞇ": "T", + "Ⓤ": "U", + "U": "U", + "Ù": "U", + "Ú": "U", + "Û": "U", + "Ũ": "U", + "Ṹ": "U", + "Ū": "U", + "Ṻ": "U", + "Ŭ": "U", + "Ü": "U", + "Ǜ": "U", + "Ǘ": "U", + "Ǖ": "U", + "Ǚ": "U", + "Ủ": "U", + "Ů": "U", + "Ű": "U", + "Ǔ": "U", + "Ȕ": "U", + "Ȗ": "U", + "Ư": "U", + "Ừ": "U", + "Ứ": "U", + "Ữ": "U", + "Ử": "U", + "Ự": "U", + "Ụ": "U", + "Ṳ": "U", + "Ų": "U", + "Ṷ": "U", + "Ṵ": "U", + "Ʉ": "U", + "Ⓥ": "V", + "V": "V", + "Ṽ": "V", + "Ṿ": "V", + "Ʋ": "V", + "Ꝟ": "V", + "Ʌ": "V", + "Ⓦ": "W", + "W": "W", + "Ẁ": "W", + "Ẃ": "W", + "Ŵ": "W", + "Ẇ": "W", + "Ẅ": "W", + "Ẉ": "W", + "Ⱳ": "W", + "Ⓧ": "X", + "X": "X", + "Ẋ": "X", + "Ẍ": "X", + "Ⓨ": "Y", + "Y": "Y", + "Ỳ": "Y", + "Ý": "Y", + "Ŷ": "Y", + "Ỹ": "Y", + "Ȳ": "Y", + "Ẏ": "Y", + "Ÿ": "Y", + "Ỷ": "Y", + "Ỵ": "Y", + "Ƴ": "Y", + "Ɏ": "Y", + "Ỿ": "Y", + "Ⓩ": "Z", + "Z": "Z", + "Ź": "Z", + "Ẑ": "Z", + "Ż": "Z", + "Ž": "Z", + "Ẓ": "Z", + "Ẕ": "Z", + "Ƶ": "Z", + "Ȥ": "Z", + "Ɀ": "Z", + "Ⱬ": "Z", + "Ꝣ": "Z", + "ⓐ": "a", + "a": "a", + "ẚ": "a", + "à": "a", + "á": "a", + "â": "a", + "ầ": "a", + "ấ": "a", + "ẫ": "a", + "ẩ": "a", + "ã": "a", + "ā": "a", + "ă": "a", + "ằ": "a", + "ắ": "a", + "ẵ": "a", + "ẳ": "a", + "ȧ": "a", + "ǡ": "a", + "ä": "a", + "ǟ": "a", + "ả": "a", + "å": "a", + "ǻ": "a", + "ǎ": "a", + "ȁ": "a", + "ȃ": "a", + "ạ": "a", + "ậ": "a", + "ặ": "a", + "ḁ": "a", + "ą": "a", + "ⱥ": "a", + "ɐ": "a", + "ⓑ": "b", + "b": "b", + "ḃ": "b", + "ḅ": "b", + "ḇ": "b", + "ƀ": "b", + "ƃ": "b", + "ɓ": "b", + "ⓒ": "c", + "c": "c", + "ć": "c", + "ĉ": "c", + "ċ": "c", + "č": "c", + "ç": "c", + "ḉ": "c", + "ƈ": "c", + "ȼ": "c", + "ꜿ": "c", + "ↄ": "c", + "ⓓ": "d", + "d": "d", + "ḋ": "d", + "ď": "d", + "ḍ": "d", + "ḑ": "d", + "ḓ": "d", + "ḏ": "d", + "đ": "d", + "ƌ": "d", + "ɖ": "d", + "ɗ": "d", + "ꝺ": "d", + "ⓔ": "e", + "e": "e", + "è": "e", + "é": "e", + "ê": "e", + "ề": "e", + "ế": "e", + "ễ": "e", + "ể": "e", + "ẽ": "e", + "ē": "e", + "ḕ": "e", + "ḗ": "e", + "ĕ": "e", + "ė": "e", + "ë": "e", + "ẻ": "e", + "ě": "e", + "ȅ": "e", + "ȇ": "e", + "ẹ": "e", + "ệ": "e", + "ȩ": "e", + "ḝ": "e", + "ę": "e", + "ḙ": "e", + "ḛ": "e", + "ɇ": "e", + "ɛ": "e", + "ǝ": "e", + "ⓕ": "f", + "f": "f", + "ḟ": "f", + "ƒ": "f", + "ꝼ": "f", + "ⓖ": "g", + "g": "g", + "ǵ": "g", + "ĝ": "g", + "ḡ": "g", + "ğ": "g", + "ġ": "g", + "ǧ": "g", + "ģ": "g", + "ǥ": "g", + "ɠ": "g", + "ꞡ": "g", + "ᵹ": "g", + "ꝿ": "g", + "ⓗ": "h", + "h": "h", + "ĥ": "h", + "ḣ": "h", + "ḧ": "h", + "ȟ": "h", + "ḥ": "h", + "ḩ": "h", + "ḫ": "h", + "ẖ": "h", + "ħ": "h", + "ⱨ": "h", + "ⱶ": "h", + "ɥ": "h", + "ⓘ": "i", + "i": "i", + "ì": "i", + "í": "i", + "î": "i", + "ĩ": "i", + "ī": "i", + "ĭ": "i", + "ï": "i", + "ḯ": "i", + "ỉ": "i", + "ǐ": "i", + "ȉ": "i", + "ȋ": "i", + "ị": "i", + "į": "i", + "ḭ": "i", + "ɨ": "i", + "ı": "i", + "ⓙ": "j", + "j": "j", + "ĵ": "j", + "ǰ": "j", + "ɉ": "j", + "ⓚ": "k", + "k": "k", + "ḱ": "k", + "ǩ": "k", + "ḳ": "k", + "ķ": "k", + "ḵ": "k", + "ƙ": "k", + "ⱪ": "k", + "ꝁ": "k", + "ꝃ": "k", + "ꝅ": "k", + "ꞣ": "k", + "ⓛ": "l", + "l": "l", + "ŀ": "l", + "ĺ": "l", + "ľ": "l", + "ḷ": "l", + "ḹ": "l", + "ļ": "l", + "ḽ": "l", + "ḻ": "l", + "ſ": "l", + "ł": "l", + "ƚ": "l", + "ɫ": "l", + "ⱡ": "l", + "ꝉ": "l", + "ꞁ": "l", + "ꝇ": "l", + "ⓜ": "m", + "m": "m", + "ḿ": "m", + "ṁ": "m", + "ṃ": "m", + "ɱ": "m", + "ɯ": "m", + "ⓝ": "n", + "n": "n", + "ǹ": "n", + "ń": "n", + "ñ": "n", + "ṅ": "n", + "ň": "n", + "ṇ": "n", + "ņ": "n", + "ṋ": "n", + "ṉ": "n", + "ƞ": "n", + "ɲ": "n", + "ʼn": "n", + "ꞑ": "n", + "ꞥ": "n", + "ⓞ": "o", + "o": "o", + "ò": "o", + "ó": "o", + "ô": "o", + "ồ": "o", + "ố": "o", + "ỗ": "o", + "ổ": "o", + "õ": "o", + "ṍ": "o", + "ȭ": "o", + "ṏ": "o", + "ō": "o", + "ṑ": "o", + "ṓ": "o", + "ŏ": "o", + "ȯ": "o", + "ȱ": "o", + "ö": "o", + "ȫ": "o", + "ỏ": "o", + "ő": "o", + "ǒ": "o", + "ȍ": "o", + "ȏ": "o", + "ơ": "o", + "ờ": "o", + "ớ": "o", + "ỡ": "o", + "ở": "o", + "ợ": "o", + "ọ": "o", + "ộ": "o", + "ǫ": "o", + "ǭ": "o", + "ø": "o", + "ǿ": "o", + "ɔ": "o", + "ꝋ": "o", + "ꝍ": "o", + "ɵ": "o", + "ⓟ": "p", + "p": "p", + "ṕ": "p", + "ṗ": "p", + "ƥ": "p", + "ᵽ": "p", + "ꝑ": "p", + "ꝓ": "p", + "ꝕ": "p", + "ⓠ": "q", + "q": "q", + "ɋ": "q", + "ꝗ": "q", + "ꝙ": "q", + "ⓡ": "r", + "r": "r", + "ŕ": "r", + "ṙ": "r", + "ř": "r", + "ȑ": "r", + "ȓ": "r", + "ṛ": "r", + "ṝ": "r", + "ŗ": "r", + "ṟ": "r", + "ɍ": "r", + "ɽ": "r", + "ꝛ": "r", + "ꞧ": "r", + "ꞃ": "r", + "ⓢ": "s", + "s": "s", + "ß": "s", + "ś": "s", + "ṥ": "s", + "ŝ": "s", + "ṡ": "s", + "š": "s", + "ṧ": "s", + "ṣ": "s", + "ṩ": "s", + "ș": "s", + "ş": "s", + "ȿ": "s", + "ꞩ": "s", + "ꞅ": "s", + "ẛ": "s", + "ⓣ": "t", + "t": "t", + "ṫ": "t", + "ẗ": "t", + "ť": "t", + "ṭ": "t", + "ț": "t", + "ţ": "t", + "ṱ": "t", + "ṯ": "t", + "ŧ": "t", + "ƭ": "t", + "ʈ": "t", + "ⱦ": "t", + "ꞇ": "t", + "ⓤ": "u", + "u": "u", + "ù": "u", + "ú": "u", + "û": "u", + "ũ": "u", + "ṹ": "u", + "ū": "u", + "ṻ": "u", + "ŭ": "u", + "ü": "u", + "ǜ": "u", + "ǘ": "u", + "ǖ": "u", + "ǚ": "u", + "ủ": "u", + "ů": "u", + "ű": "u", + "ǔ": "u", + "ȕ": "u", + "ȗ": "u", + "ư": "u", + "ừ": "u", + "ứ": "u", + "ữ": "u", + "ử": "u", + "ự": "u", + "ụ": "u", + "ṳ": "u", + "ų": "u", + "ṷ": "u", + "ṵ": "u", + "ʉ": "u", + "ⓥ": "v", + "v": "v", + "ṽ": "v", + "ṿ": "v", + "ʋ": "v", + "ꝟ": "v", + "ʌ": "v", + "ⓦ": "w", + "w": "w", + "ẁ": "w", + "ẃ": "w", + "ŵ": "w", + "ẇ": "w", + "ẅ": "w", + "ẘ": "w", + "ẉ": "w", + "ⱳ": "w", + "ⓧ": "x", + "x": "x", + "ẋ": "x", + "ẍ": "x", + "ⓨ": "y", + "y": "y", + "ỳ": "y", + "ý": "y", + "ŷ": "y", + "ỹ": "y", + "ȳ": "y", + "ẏ": "y", + "ÿ": "y", + "ỷ": "y", + "ẙ": "y", + "ỵ": "y", + "ƴ": "y", + "ɏ": "y", + "ỿ": "y", + "ⓩ": "z", + "z": "z", + "ź": "z", + "ẑ": "z", + "ż": "z", + "ž": "z", + "ẓ": "z", + "ẕ": "z", + "ƶ": "z", + "ȥ": "z", + "ɀ": "z", + "ⱬ": "z", + "ꝣ": "z" +}; +exports.StringUtility = StringUtility; + +}); + +unwrapExports(utilities); + +var models = createCommonjsModule(function (module, exports) { +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); + + +class ModelResult { +} +exports.ModelResult = ModelResult; +class ExtendedModelResult extends ModelResult { + constructor(source = null) { + super(); + if (source) { + this.text = source.text; + this.start = source.start; + this.end = source.end; + this.typeName = source.typeName; + this.resolution = source.resolution; + } + } +} +exports.ExtendedModelResult = ExtendedModelResult; +class ModelFactoryKey { + constructor(culture$$1, modelType, options = null) { + this.culture = culture$$1 ? culture$$1.toLowerCase() : null; + this.modelType = modelType; + this.options = options; + } + toString() { + return JSON.stringify(this); + } + static fromString(key) { + return JSON.parse(key); + } +} +class ModelFactory { + constructor() { + this.modelFactories = new Map(); + } + getModel(modelTypeName, culture$$1, fallbackToDefaultCulture, options) { + let result = this.tryGetModel(modelTypeName, culture$$1, options); + if (!result.containsModel && fallbackToDefaultCulture) { + result = this.tryGetModel(modelTypeName, ModelFactory.fallbackCulture, options); + } + if (result.containsModel) { + return result.model; + } + throw new Error(`Could not find Model with the specified configuration: ${culture$$1},${modelTypeName}`); + } + tryGetModel(modelTypeName, culture$$1, options) { + culture$$1 = culture.Culture.mapToNearestLanguage(culture$$1); + let cacheResult = this.getModelFromCache(modelTypeName, culture$$1, options); + if (cacheResult) + return { containsModel: true, model: cacheResult }; + let key = this.generateKey(modelTypeName, culture$$1); + if (this.modelFactories.has(key)) { + let model = this.modelFactories.get(key)(options); + this.registerModelInCache(modelTypeName, culture$$1, options, model); + return { containsModel: true, model: model }; + } + return { containsModel: false }; + } + registerModel(modelTypeName, culture$$1, modelCreator) { + let key = this.generateKey(modelTypeName, culture$$1); + if (this.modelFactories.has(key)) { + throw new Error(`${culture$$1}-${modelTypeName} has already been registered.`); + } + this.modelFactories.set(key, modelCreator); + } + initializeModels(targetCulture, options) { + this.modelFactories.forEach((value, key) => { + let modelFactoryKey = ModelFactoryKey.fromString(key); + if (utilities.StringUtility.isNullOrEmpty(targetCulture) || modelFactoryKey.culture === targetCulture) { + this.tryGetModel(modelFactoryKey.modelType, modelFactoryKey.culture, modelFactoryKey.options); + } + }); + } + generateKey(modelTypeName, culture$$1) { + return new ModelFactoryKey(culture$$1, modelTypeName).toString(); + } + getModelFromCache(modelTypeName, culture$$1, options) { + let key = this.generateCacheKey(modelTypeName, culture$$1, options); + return ModelFactory.cache.get(key); + } + registerModelInCache(modelTypeName, culture$$1, options, model) { + let key = this.generateCacheKey(modelTypeName, culture$$1, options); + ModelFactory.cache.set(key, model); + } + generateCacheKey(modelTypeName, culture$$1, options) { + return new ModelFactoryKey(culture$$1, modelTypeName, options).toString(); + } +} +ModelFactory.fallbackCulture = culture.Culture.English; +ModelFactory.cache = new Map(); +exports.ModelFactory = ModelFactory; + +}); + +unwrapExports(models); + +var recognizer = createCommonjsModule(function (module, exports) { +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); + +class Recognizer { + constructor(targetCulture, options, lazyInitialization) { + this.modelFactory = new models.ModelFactory(); + if (!this.IsValidOptions(options)) + throw new Error(`${options} is not a valid options value.`); + this.TargetCulture = targetCulture; + this.Options = options; + this.InitializeConfiguration(); + if (!lazyInitialization) { + this.initializeModels(targetCulture, options); + } + } + getModel(modelTypeName, culture, fallbackToDefaultCulture) { + return this.modelFactory.getModel(modelTypeName, culture || this.TargetCulture, fallbackToDefaultCulture, this.Options); + } + registerModel(modelTypeName, culture, modelCreator) { + this.modelFactory.registerModel(modelTypeName, culture, modelCreator); + } + initializeModels(targetCulture, options) { + this.modelFactory.initializeModels(targetCulture, options); + } +} +exports.Recognizer = Recognizer; + +}); + +unwrapExports(recognizer); + +var extractors = createCommonjsModule(function (module, exports) { +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +class ExtractResult { + static isOverlap(erA, erB) { + return !(erA.start >= erB.start + erB.length) && !(erB.start >= erA.start + erA.length); + } + static isCover(er1, er2) { + return ((er2.start < er1.start) && ((er2.start + er2.length) >= (er1.start + er1.length))) + || ((er2.start <= er1.start) && ((er2.start + er2.length) > (er1.start + er1.length))); + } + static getFromText(source) { + return { + start: 0, + length: source.length, + text: source, + type: 'custom' + }; + } +} +exports.ExtractResult = ExtractResult; + +}); + +unwrapExports(extractors); + +var parsers = createCommonjsModule(function (module, exports) { +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); + +class ParseResult extends extractors.ExtractResult { + constructor(er) { + super(); + if (er) { + this.length = er.length; + this.start = er.start; + this.data = er.data; + this.text = er.text; + this.type = er.type; + } + this.resolutionStr = ""; + } +} +exports.ParseResult = ParseResult; + +}); + +unwrapExports(parsers); + +var recognizersText = createCommonjsModule(function (module, exports) { +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); + +exports.Culture = culture.Culture; +exports.CultureInfo = culture.CultureInfo; + +exports.ModelResult = models.ModelResult; +exports.ModelFactory = models.ModelFactory; + +exports.Recognizer = recognizer.Recognizer; + +exports.ExtractResult = extractors.ExtractResult; + +exports.ParseResult = parsers.ParseResult; + +exports.FormatUtility = utilities.FormatUtility; +exports.StringUtility = utilities.StringUtility; +exports.Match = utilities.Match; +exports.RegExpUtility = utilities.RegExpUtility; + +}); + +unwrapExports(recognizersText); + +/** + * lodash (Custom Build) + * Build: `lodash modularize exports="npm" -o ./` + * Copyright jQuery Foundation and other contributors + * Released under MIT license + * Based on Underscore.js 1.8.3 + * Copyright Jeremy Ashkenas, DocumentCloud and Investigative Reporters & Editors + */ + +/** Used as references for various `Number` constants. */ +var INFINITY = 1 / 0; + +/** `Object#toString` result references. */ +var symbolTag = '[object Symbol]'; + +/** Used to match leading and trailing whitespace. */ +var reTrimEnd = /\s+$/; + +/** Used to compose unicode character classes. */ +var rsAstralRange = '\\ud800-\\udfff'; +var rsComboMarksRange = '\\u0300-\\u036f\\ufe20-\\ufe23'; +var rsComboSymbolsRange = '\\u20d0-\\u20f0'; +var rsVarRange = '\\ufe0e\\ufe0f'; + +/** Used to compose unicode capture groups. */ +var rsAstral = '[' + rsAstralRange + ']'; +var rsCombo = '[' + rsComboMarksRange + rsComboSymbolsRange + ']'; +var rsFitz = '\\ud83c[\\udffb-\\udfff]'; +var rsModifier = '(?:' + rsCombo + '|' + rsFitz + ')'; +var rsNonAstral = '[^' + rsAstralRange + ']'; +var rsRegional = '(?:\\ud83c[\\udde6-\\uddff]){2}'; +var rsSurrPair = '[\\ud800-\\udbff][\\udc00-\\udfff]'; +var rsZWJ = '\\u200d'; + +/** Used to compose unicode regexes. */ +var reOptMod = rsModifier + '?'; +var rsOptVar = '[' + rsVarRange + ']?'; +var rsOptJoin = '(?:' + rsZWJ + '(?:' + [rsNonAstral, rsRegional, rsSurrPair].join('|') + ')' + rsOptVar + reOptMod + ')*'; +var rsSeq = rsOptVar + reOptMod + rsOptJoin; +var rsSymbol = '(?:' + [rsNonAstral + rsCombo + '?', rsCombo, rsRegional, rsSurrPair, rsAstral].join('|') + ')'; + +/** Used to match [string symbols](https://mathiasbynens.be/notes/javascript-unicode). */ +var reUnicode = RegExp(rsFitz + '(?=' + rsFitz + ')|' + rsSymbol + rsSeq, 'g'); + +/** Used to detect strings with [zero-width joiners or code points from the astral planes](http://eev.ee/blog/2015/09/12/dark-corners-of-unicode/). */ +var reHasUnicode = RegExp('[' + rsZWJ + rsAstralRange + rsComboMarksRange + rsComboSymbolsRange + rsVarRange + ']'); + +/** Detect free variable `global` from Node.js. */ +var freeGlobal = typeof commonjsGlobal == 'object' && commonjsGlobal && commonjsGlobal.Object === Object && commonjsGlobal; + +/** Detect free variable `self`. */ +var freeSelf = typeof self == 'object' && self && self.Object === Object && self; + +/** Used as a reference to the global object. */ +var root = freeGlobal || freeSelf || Function('return this')(); + +/** + * Converts an ASCII `string` to an array. + * + * @private + * @param {string} string The string to convert. + * @returns {Array} Returns the converted array. + */ +function asciiToArray(string) { + return string.split(''); +} + +/** + * The base implementation of `_.findIndex` and `_.findLastIndex` without + * support for iteratee shorthands. + * + * @private + * @param {Array} array The array to inspect. + * @param {Function} predicate The function invoked per iteration. + * @param {number} fromIndex The index to search from. + * @param {boolean} [fromRight] Specify iterating from right to left. + * @returns {number} Returns the index of the matched value, else `-1`. + */ +function baseFindIndex(array, predicate, fromIndex, fromRight) { + var length = array.length, + index = fromIndex + (fromRight ? 1 : -1); + + while ((fromRight ? index-- : ++index < length)) { + if (predicate(array[index], index, array)) { + return index; + } + } + return -1; +} + +/** + * The base implementation of `_.indexOf` without `fromIndex` bounds checks. + * + * @private + * @param {Array} array The array to inspect. + * @param {*} value The value to search for. + * @param {number} fromIndex The index to search from. + * @returns {number} Returns the index of the matched value, else `-1`. + */ +function baseIndexOf(array, value, fromIndex) { + if (value !== value) { + return baseFindIndex(array, baseIsNaN, fromIndex); + } + var index = fromIndex - 1, + length = array.length; + + while (++index < length) { + if (array[index] === value) { + return index; + } + } + return -1; +} + +/** + * The base implementation of `_.isNaN` without support for number objects. + * + * @private + * @param {*} value The value to check. + * @returns {boolean} Returns `true` if `value` is `NaN`, else `false`. + */ +function baseIsNaN(value) { + return value !== value; +} + +/** + * Used by `_.trim` and `_.trimEnd` to get the index of the last string symbol + * that is not found in the character symbols. + * + * @private + * @param {Array} strSymbols The string symbols to inspect. + * @param {Array} chrSymbols The character symbols to find. + * @returns {number} Returns the index of the last unmatched string symbol. + */ +function charsEndIndex(strSymbols, chrSymbols) { + var index = strSymbols.length; + + while (index-- && baseIndexOf(chrSymbols, strSymbols[index], 0) > -1) {} + return index; +} + +/** + * Checks if `string` contains Unicode symbols. + * + * @private + * @param {string} string The string to inspect. + * @returns {boolean} Returns `true` if a symbol is found, else `false`. + */ +function hasUnicode(string) { + return reHasUnicode.test(string); +} + +/** + * Converts `string` to an array. + * + * @private + * @param {string} string The string to convert. + * @returns {Array} Returns the converted array. + */ +function stringToArray(string) { + return hasUnicode(string) + ? unicodeToArray(string) + : asciiToArray(string); +} + +/** + * Converts a Unicode `string` to an array. + * + * @private + * @param {string} string The string to convert. + * @returns {Array} Returns the converted array. + */ +function unicodeToArray(string) { + return string.match(reUnicode) || []; +} + +/** Used for built-in method references. */ +var objectProto = Object.prototype; + +/** + * Used to resolve the + * [`toStringTag`](http://ecma-international.org/ecma-262/7.0/#sec-object.prototype.tostring) + * of values. + */ +var objectToString = objectProto.toString; + +/** Built-in value references. */ +var Symbol$1 = root.Symbol; + +/** Used to convert symbols to primitives and strings. */ +var symbolProto = Symbol$1 ? Symbol$1.prototype : undefined; +var symbolToString = symbolProto ? symbolProto.toString : undefined; + +/** + * The base implementation of `_.slice` without an iteratee call guard. + * + * @private + * @param {Array} array The array to slice. + * @param {number} [start=0] The start position. + * @param {number} [end=array.length] The end position. + * @returns {Array} Returns the slice of `array`. + */ +function baseSlice(array, start, end) { + var index = -1, + length = array.length; + + if (start < 0) { + start = -start > length ? 0 : (length + start); + } + end = end > length ? length : end; + if (end < 0) { + end += length; + } + length = start > end ? 0 : ((end - start) >>> 0); + start >>>= 0; + + var result = Array(length); + while (++index < length) { + result[index] = array[index + start]; + } + return result; +} + +/** + * The base implementation of `_.toString` which doesn't convert nullish + * values to empty strings. + * + * @private + * @param {*} value The value to process. + * @returns {string} Returns the string. + */ +function baseToString(value) { + // Exit early for strings to avoid a performance hit in some environments. + if (typeof value == 'string') { + return value; + } + if (isSymbol(value)) { + return symbolToString ? symbolToString.call(value) : ''; + } + var result = (value + ''); + return (result == '0' && (1 / value) == -INFINITY) ? '-0' : result; +} + +/** + * Casts `array` to a slice if it's needed. + * + * @private + * @param {Array} array The array to inspect. + * @param {number} start The start position. + * @param {number} [end=array.length] The end position. + * @returns {Array} Returns the cast slice. + */ +function castSlice(array, start, end) { + var length = array.length; + end = end === undefined ? length : end; + return (!start && end >= length) ? array : baseSlice(array, start, end); +} + +/** + * Checks if `value` is object-like. A value is object-like if it's not `null` + * and has a `typeof` result of "object". + * + * @static + * @memberOf _ + * @since 4.0.0 + * @category Lang + * @param {*} value The value to check. + * @returns {boolean} Returns `true` if `value` is object-like, else `false`. + * @example + * + * _.isObjectLike({}); + * // => true + * + * _.isObjectLike([1, 2, 3]); + * // => true + * + * _.isObjectLike(_.noop); + * // => false + * + * _.isObjectLike(null); + * // => false + */ +function isObjectLike(value) { + return !!value && typeof value == 'object'; +} + +/** + * Checks if `value` is classified as a `Symbol` primitive or object. + * + * @static + * @memberOf _ + * @since 4.0.0 + * @category Lang + * @param {*} value The value to check. + * @returns {boolean} Returns `true` if `value` is a symbol, else `false`. + * @example + * + * _.isSymbol(Symbol.iterator); + * // => true + * + * _.isSymbol('abc'); + * // => false + */ +function isSymbol(value) { + return typeof value == 'symbol' || + (isObjectLike(value) && objectToString.call(value) == symbolTag); +} + +/** + * Converts `value` to a string. An empty string is returned for `null` + * and `undefined` values. The sign of `-0` is preserved. + * + * @static + * @memberOf _ + * @since 4.0.0 + * @category Lang + * @param {*} value The value to process. + * @returns {string} Returns the string. + * @example + * + * _.toString(null); + * // => '' + * + * _.toString(-0); + * // => '-0' + * + * _.toString([1, 2, 3]); + * // => '1,2,3' + */ +function toString(value) { + return value == null ? '' : baseToString(value); +} + +/** + * Removes trailing whitespace or specified characters from `string`. + * + * @static + * @memberOf _ + * @since 4.0.0 + * @category String + * @param {string} [string=''] The string to trim. + * @param {string} [chars=whitespace] The characters to trim. + * @param- {Object} [guard] Enables use as an iteratee for methods like `_.map`. + * @returns {string} Returns the trimmed string. + * @example + * + * _.trimEnd(' abc '); + * // => ' abc' + * + * _.trimEnd('-_-abc-_-', '_-'); + * // => '-_-abc' + */ +function trimEnd(string, chars, guard) { + string = toString(string); + if (string && (guard || chars === undefined)) { + return string.replace(reTrimEnd, ''); + } + if (!string || !(chars = baseToString(chars))) { + return string; + } + var strSymbols = stringToArray(string), + end = charsEndIndex(strSymbols, stringToArray(chars)) + 1; + + return castSlice(strSymbols, 0, end).join(''); +} + +var lodash_trimend = trimEnd; + +var bignumber = createCommonjsModule(function (module) { +(function (globalObject) { + 'use strict'; + +/* + * bignumber.js v7.2.1 + * A JavaScript library for arbitrary-precision arithmetic. + * https://github.com/MikeMcl/bignumber.js + * Copyright (c) 2018 Michael Mclaughlin + * MIT Licensed. + * + * BigNumber.prototype methods | BigNumber methods + * | + * absoluteValue abs | clone + * comparedTo | config set + * decimalPlaces dp | DECIMAL_PLACES + * dividedBy div | ROUNDING_MODE + * dividedToIntegerBy idiv | EXPONENTIAL_AT + * exponentiatedBy pow | RANGE + * integerValue | CRYPTO + * isEqualTo eq | MODULO_MODE + * isFinite | POW_PRECISION + * isGreaterThan gt | FORMAT + * isGreaterThanOrEqualTo gte | ALPHABET + * isInteger | isBigNumber + * isLessThan lt | maximum max + * isLessThanOrEqualTo lte | minimum min + * isNaN | random + * isNegative | + * isPositive | + * isZero | + * minus | + * modulo mod | + * multipliedBy times | + * negated | + * plus | + * precision sd | + * shiftedBy | + * squareRoot sqrt | + * toExponential | + * toFixed | + * toFormat | + * toFraction | + * toJSON | + * toNumber | + * toPrecision | + * toString | + * valueOf | + * + */ + + + var BigNumber, + isNumeric = /^-?(?:\d+(?:\.\d*)?|\.\d+)(?:e[+-]?\d+)?$/i, + + mathceil = Math.ceil, + mathfloor = Math.floor, + + bignumberError = '[BigNumber Error] ', + tooManyDigits = bignumberError + 'Number primitive has more than 15 significant digits: ', + + BASE = 1e14, + LOG_BASE = 14, + MAX_SAFE_INTEGER = 0x1fffffffffffff, // 2^53 - 1 + // MAX_INT32 = 0x7fffffff, // 2^31 - 1 + POWS_TEN = [1, 10, 100, 1e3, 1e4, 1e5, 1e6, 1e7, 1e8, 1e9, 1e10, 1e11, 1e12, 1e13], + SQRT_BASE = 1e7, + + // EDITABLE + // The limit on the value of DECIMAL_PLACES, TO_EXP_NEG, TO_EXP_POS, MIN_EXP, MAX_EXP, and + // the arguments to toExponential, toFixed, toFormat, and toPrecision. + MAX = 1E9; // 0 to MAX_INT32 + + + /* + * Create and return a BigNumber constructor. + */ + function clone(configObject) { + var div, convertBase, parseNumeric, + P = BigNumber.prototype = { constructor: BigNumber, toString: null, valueOf: null }, + ONE = new BigNumber(1), + + + //----------------------------- EDITABLE CONFIG DEFAULTS ------------------------------- + + + // The default values below must be integers within the inclusive ranges stated. + // The values can also be changed at run-time using BigNumber.set. + + // The maximum number of decimal places for operations involving division. + DECIMAL_PLACES = 20, // 0 to MAX + + // The rounding mode used when rounding to the above decimal places, and when using + // toExponential, toFixed, toFormat and toPrecision, and round (default value). + // UP 0 Away from zero. + // DOWN 1 Towards zero. + // CEIL 2 Towards +Infinity. + // FLOOR 3 Towards -Infinity. + // HALF_UP 4 Towards nearest neighbour. If equidistant, up. + // HALF_DOWN 5 Towards nearest neighbour. If equidistant, down. + // HALF_EVEN 6 Towards nearest neighbour. If equidistant, towards even neighbour. + // HALF_CEIL 7 Towards nearest neighbour. If equidistant, towards +Infinity. + // HALF_FLOOR 8 Towards nearest neighbour. If equidistant, towards -Infinity. + ROUNDING_MODE = 4, // 0 to 8 + + // EXPONENTIAL_AT : [TO_EXP_NEG , TO_EXP_POS] + + // The exponent value at and beneath which toString returns exponential notation. + // Number type: -7 + TO_EXP_NEG = -7, // 0 to -MAX + + // The exponent value at and above which toString returns exponential notation. + // Number type: 21 + TO_EXP_POS = 21, // 0 to MAX + + // RANGE : [MIN_EXP, MAX_EXP] + + // The minimum exponent value, beneath which underflow to zero occurs. + // Number type: -324 (5e-324) + MIN_EXP = -1e7, // -1 to -MAX + + // The maximum exponent value, above which overflow to Infinity occurs. + // Number type: 308 (1.7976931348623157e+308) + // For MAX_EXP > 1e7, e.g. new BigNumber('1e100000000').plus(1) may be slow. + MAX_EXP = 1e7, // 1 to MAX + + // Whether to use cryptographically-secure random number generation, if available. + CRYPTO = false, // true or false + + // The modulo mode used when calculating the modulus: a mod n. + // The quotient (q = a / n) is calculated according to the corresponding rounding mode. + // The remainder (r) is calculated as: r = a - n * q. + // + // UP 0 The remainder is positive if the dividend is negative, else is negative. + // DOWN 1 The remainder has the same sign as the dividend. + // This modulo mode is commonly known as 'truncated division' and is + // equivalent to (a % n) in JavaScript. + // FLOOR 3 The remainder has the same sign as the divisor (Python %). + // HALF_EVEN 6 This modulo mode implements the IEEE 754 remainder function. + // EUCLID 9 Euclidian division. q = sign(n) * floor(a / abs(n)). + // The remainder is always positive. + // + // The truncated division, floored division, Euclidian division and IEEE 754 remainder + // modes are commonly used for the modulus operation. + // Although the other rounding modes can also be used, they may not give useful results. + MODULO_MODE = 1, // 0 to 9 + + // The maximum number of significant digits of the result of the exponentiatedBy operation. + // If POW_PRECISION is 0, there will be unlimited significant digits. + POW_PRECISION = 0, // 0 to MAX + + // The format specification used by the BigNumber.prototype.toFormat method. + FORMAT = { + decimalSeparator: '.', + groupSeparator: ',', + groupSize: 3, + secondaryGroupSize: 0, + fractionGroupSeparator: '\xA0', // non-breaking space + fractionGroupSize: 0 + }, + + // The alphabet used for base conversion. + // It must be at least 2 characters long, with no '.' or repeated character. + // '0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ$_' + ALPHABET = '0123456789abcdefghijklmnopqrstuvwxyz'; + + + //------------------------------------------------------------------------------------------ + + + // CONSTRUCTOR + + + /* + * The BigNumber constructor and exported function. + * Create and return a new instance of a BigNumber object. + * + * n {number|string|BigNumber} A numeric value. + * [b] {number} The base of n. Integer, 2 to ALPHABET.length inclusive. + */ + function BigNumber(n, b) { + var alphabet, c, caseChanged, e, i, isNum, len, str, + x = this; + + // Enable constructor usage without new. + if (!(x instanceof BigNumber)) { + + // Don't throw on constructor call without new (#81). + // '[BigNumber Error] Constructor call without new: {n}' + //throw Error(bignumberError + ' Constructor call without new: ' + n); + return new BigNumber(n, b); + } + + if (b == null) { + + // Duplicate. + if (n instanceof BigNumber) { + x.s = n.s; + x.e = n.e; + x.c = (n = n.c) ? n.slice() : n; + return; + } + + isNum = typeof n == 'number'; + + if (isNum && n * 0 == 0) { + + // Use `1 / n` to handle minus zero also. + x.s = 1 / n < 0 ? (n = -n, -1) : 1; + + // Faster path for integers. + if (n === ~~n) { + for (e = 0, i = n; i >= 10; i /= 10, e++); + x.e = e; + x.c = [n]; + return; + } + + str = n + ''; + } else { + if (!isNumeric.test(str = n + '')) return parseNumeric(x, str, isNum); + x.s = str.charCodeAt(0) == 45 ? (str = str.slice(1), -1) : 1; + } + + // Decimal point? + if ((e = str.indexOf('.')) > -1) str = str.replace('.', ''); + + // Exponential form? + if ((i = str.search(/e/i)) > 0) { + + // Determine exponent. + if (e < 0) e = i; + e += +str.slice(i + 1); + str = str.substring(0, i); + } else if (e < 0) { + + // Integer. + e = str.length; + } + + } else { + + // '[BigNumber Error] Base {not a primitive number|not an integer|out of range}: {b}' + intCheck(b, 2, ALPHABET.length, 'Base'); + str = n + ''; + + // Allow exponential notation to be used with base 10 argument, while + // also rounding to DECIMAL_PLACES as with other bases. + if (b == 10) { + x = new BigNumber(n instanceof BigNumber ? n : str); + return round(x, DECIMAL_PLACES + x.e + 1, ROUNDING_MODE); + } + + isNum = typeof n == 'number'; + + if (isNum) { + + // Avoid potential interpretation of Infinity and NaN as base 44+ values. + if (n * 0 != 0) return parseNumeric(x, str, isNum, b); + + x.s = 1 / n < 0 ? (str = str.slice(1), -1) : 1; + + // '[BigNumber Error] Number primitive has more than 15 significant digits: {n}' + if (BigNumber.DEBUG && str.replace(/^0\.0*|\./, '').length > 15) { + throw Error + (tooManyDigits + n); + } + + // Prevent later check for length on converted number. + isNum = false; + } else { + x.s = str.charCodeAt(0) === 45 ? (str = str.slice(1), -1) : 1; + } + + alphabet = ALPHABET.slice(0, b); + e = i = 0; + + // Check that str is a valid base b number. + // Don't use RegExp so alphabet can contain special characters. + for (len = str.length; i < len; i++) { + if (alphabet.indexOf(c = str.charAt(i)) < 0) { + if (c == '.') { + + // If '.' is not the first character and it has not be found before. + if (i > e) { + e = len; + continue; + } + } else if (!caseChanged) { + + // Allow e.g. hexadecimal 'FF' as well as 'ff'. + if (str == str.toUpperCase() && (str = str.toLowerCase()) || + str == str.toLowerCase() && (str = str.toUpperCase())) { + caseChanged = true; + i = -1; + e = 0; + continue; + } + } + + return parseNumeric(x, n + '', isNum, b); + } + } + + str = convertBase(str, b, 10, x.s); + + // Decimal point? + if ((e = str.indexOf('.')) > -1) str = str.replace('.', ''); + else e = str.length; + } + + // Determine leading zeros. + for (i = 0; str.charCodeAt(i) === 48; i++); + + // Determine trailing zeros. + for (len = str.length; str.charCodeAt(--len) === 48;); + + str = str.slice(i, ++len); + + if (str) { + len -= i; + + // '[BigNumber Error] Number primitive has more than 15 significant digits: {n}' + if (isNum && BigNumber.DEBUG && + len > 15 && (n > MAX_SAFE_INTEGER || n !== mathfloor(n))) { + throw Error + (tooManyDigits + (x.s * n)); + } + + e = e - i - 1; + + // Overflow? + if (e > MAX_EXP) { + + // Infinity. + x.c = x.e = null; + + // Underflow? + } else if (e < MIN_EXP) { + + // Zero. + x.c = [x.e = 0]; + } else { + x.e = e; + x.c = []; + + // Transform base + + // e is the base 10 exponent. + // i is where to slice str to get the first element of the coefficient array. + i = (e + 1) % LOG_BASE; + if (e < 0) i += LOG_BASE; + + if (i < len) { + if (i) x.c.push(+str.slice(0, i)); + + for (len -= LOG_BASE; i < len;) { + x.c.push(+str.slice(i, i += LOG_BASE)); + } + + str = str.slice(i); + i = LOG_BASE - str.length; + } else { + i -= len; + } + + for (; i--; str += '0'); + x.c.push(+str); + } + } else { + + // Zero. + x.c = [x.e = 0]; + } + } + + + // CONSTRUCTOR PROPERTIES + + + BigNumber.clone = clone; + + BigNumber.ROUND_UP = 0; + BigNumber.ROUND_DOWN = 1; + BigNumber.ROUND_CEIL = 2; + BigNumber.ROUND_FLOOR = 3; + BigNumber.ROUND_HALF_UP = 4; + BigNumber.ROUND_HALF_DOWN = 5; + BigNumber.ROUND_HALF_EVEN = 6; + BigNumber.ROUND_HALF_CEIL = 7; + BigNumber.ROUND_HALF_FLOOR = 8; + BigNumber.EUCLID = 9; + + + /* + * Configure infrequently-changing library-wide settings. + * + * Accept an object with the following optional properties (if the value of a property is + * a number, it must be an integer within the inclusive range stated): + * + * DECIMAL_PLACES {number} 0 to MAX + * ROUNDING_MODE {number} 0 to 8 + * EXPONENTIAL_AT {number|number[]} -MAX to MAX or [-MAX to 0, 0 to MAX] + * RANGE {number|number[]} -MAX to MAX (not zero) or [-MAX to -1, 1 to MAX] + * CRYPTO {boolean} true or false + * MODULO_MODE {number} 0 to 9 + * POW_PRECISION {number} 0 to MAX + * ALPHABET {string} A string of two or more unique characters which does + * not contain '.'. + * FORMAT {object} An object with some of the following properties: + * decimalSeparator {string} + * groupSeparator {string} + * groupSize {number} + * secondaryGroupSize {number} + * fractionGroupSeparator {string} + * fractionGroupSize {number} + * + * (The values assigned to the above FORMAT object properties are not checked for validity.) + * + * E.g. + * BigNumber.config({ DECIMAL_PLACES : 20, ROUNDING_MODE : 4 }) + * + * Ignore properties/parameters set to null or undefined, except for ALPHABET. + * + * Return an object with the properties current values. + */ + BigNumber.config = BigNumber.set = function (obj) { + var p, v; + + if (obj != null) { + + if (typeof obj == 'object') { + + // DECIMAL_PLACES {number} Integer, 0 to MAX inclusive. + // '[BigNumber Error] DECIMAL_PLACES {not a primitive number|not an integer|out of range}: {v}' + if (obj.hasOwnProperty(p = 'DECIMAL_PLACES')) { + v = obj[p]; + intCheck(v, 0, MAX, p); + DECIMAL_PLACES = v; + } + + // ROUNDING_MODE {number} Integer, 0 to 8 inclusive. + // '[BigNumber Error] ROUNDING_MODE {not a primitive number|not an integer|out of range}: {v}' + if (obj.hasOwnProperty(p = 'ROUNDING_MODE')) { + v = obj[p]; + intCheck(v, 0, 8, p); + ROUNDING_MODE = v; + } + + // EXPONENTIAL_AT {number|number[]} + // Integer, -MAX to MAX inclusive or + // [integer -MAX to 0 inclusive, 0 to MAX inclusive]. + // '[BigNumber Error] EXPONENTIAL_AT {not a primitive number|not an integer|out of range}: {v}' + if (obj.hasOwnProperty(p = 'EXPONENTIAL_AT')) { + v = obj[p]; + if (isArray(v)) { + intCheck(v[0], -MAX, 0, p); + intCheck(v[1], 0, MAX, p); + TO_EXP_NEG = v[0]; + TO_EXP_POS = v[1]; + } else { + intCheck(v, -MAX, MAX, p); + TO_EXP_NEG = -(TO_EXP_POS = v < 0 ? -v : v); + } + } + + // RANGE {number|number[]} Non-zero integer, -MAX to MAX inclusive or + // [integer -MAX to -1 inclusive, integer 1 to MAX inclusive]. + // '[BigNumber Error] RANGE {not a primitive number|not an integer|out of range|cannot be zero}: {v}' + if (obj.hasOwnProperty(p = 'RANGE')) { + v = obj[p]; + if (isArray(v)) { + intCheck(v[0], -MAX, -1, p); + intCheck(v[1], 1, MAX, p); + MIN_EXP = v[0]; + MAX_EXP = v[1]; + } else { + intCheck(v, -MAX, MAX, p); + if (v) { + MIN_EXP = -(MAX_EXP = v < 0 ? -v : v); + } else { + throw Error + (bignumberError + p + ' cannot be zero: ' + v); + } + } + } + + // CRYPTO {boolean} true or false. + // '[BigNumber Error] CRYPTO not true or false: {v}' + // '[BigNumber Error] crypto unavailable' + if (obj.hasOwnProperty(p = 'CRYPTO')) { + v = obj[p]; + if (v === !!v) { + if (v) { + if (typeof crypto != 'undefined' && crypto && + (crypto.getRandomValues || crypto.randomBytes)) { + CRYPTO = v; + } else { + CRYPTO = !v; + throw Error + (bignumberError + 'crypto unavailable'); + } + } else { + CRYPTO = v; + } + } else { + throw Error + (bignumberError + p + ' not true or false: ' + v); + } + } + + // MODULO_MODE {number} Integer, 0 to 9 inclusive. + // '[BigNumber Error] MODULO_MODE {not a primitive number|not an integer|out of range}: {v}' + if (obj.hasOwnProperty(p = 'MODULO_MODE')) { + v = obj[p]; + intCheck(v, 0, 9, p); + MODULO_MODE = v; + } + + // POW_PRECISION {number} Integer, 0 to MAX inclusive. + // '[BigNumber Error] POW_PRECISION {not a primitive number|not an integer|out of range}: {v}' + if (obj.hasOwnProperty(p = 'POW_PRECISION')) { + v = obj[p]; + intCheck(v, 0, MAX, p); + POW_PRECISION = v; + } + + // FORMAT {object} + // '[BigNumber Error] FORMAT not an object: {v}' + if (obj.hasOwnProperty(p = 'FORMAT')) { + v = obj[p]; + if (typeof v == 'object') FORMAT = v; + else throw Error + (bignumberError + p + ' not an object: ' + v); + } + + // ALPHABET {string} + // '[BigNumber Error] ALPHABET invalid: {v}' + if (obj.hasOwnProperty(p = 'ALPHABET')) { + v = obj[p]; + + // Disallow if only one character, or contains '.' or a repeated character. + if (typeof v == 'string' && !/^.$|\.|(.).*\1/.test(v)) { + ALPHABET = v; + } else { + throw Error + (bignumberError + p + ' invalid: ' + v); + } + } + + } else { + + // '[BigNumber Error] Object expected: {v}' + throw Error + (bignumberError + 'Object expected: ' + obj); + } + } + + return { + DECIMAL_PLACES: DECIMAL_PLACES, + ROUNDING_MODE: ROUNDING_MODE, + EXPONENTIAL_AT: [TO_EXP_NEG, TO_EXP_POS], + RANGE: [MIN_EXP, MAX_EXP], + CRYPTO: CRYPTO, + MODULO_MODE: MODULO_MODE, + POW_PRECISION: POW_PRECISION, + FORMAT: FORMAT, + ALPHABET: ALPHABET + }; + }; + + + /* + * Return true if v is a BigNumber instance, otherwise return false. + * + * v {any} + */ + BigNumber.isBigNumber = function (v) { + return v instanceof BigNumber || v && v._isBigNumber === true || false; + }; + + + /* + * Return a new BigNumber whose value is the maximum of the arguments. + * + * arguments {number|string|BigNumber} + */ + BigNumber.maximum = BigNumber.max = function () { + return maxOrMin(arguments, P.lt); + }; + + + /* + * Return a new BigNumber whose value is the minimum of the arguments. + * + * arguments {number|string|BigNumber} + */ + BigNumber.minimum = BigNumber.min = function () { + return maxOrMin(arguments, P.gt); + }; + + + /* + * Return a new BigNumber with a random value equal to or greater than 0 and less than 1, + * and with dp, or DECIMAL_PLACES if dp is omitted, decimal places (or less if trailing + * zeros are produced). + * + * [dp] {number} Decimal places. Integer, 0 to MAX inclusive. + * + * '[BigNumber Error] Argument {not a primitive number|not an integer|out of range}: {dp}' + * '[BigNumber Error] crypto unavailable' + */ + BigNumber.random = (function () { + var pow2_53 = 0x20000000000000; + + // Return a 53 bit integer n, where 0 <= n < 9007199254740992. + // Check if Math.random() produces more than 32 bits of randomness. + // If it does, assume at least 53 bits are produced, otherwise assume at least 30 bits. + // 0x40000000 is 2^30, 0x800000 is 2^23, 0x1fffff is 2^21 - 1. + var random53bitInt = (Math.random() * pow2_53) & 0x1fffff + ? function () { return mathfloor(Math.random() * pow2_53); } + : function () { return ((Math.random() * 0x40000000 | 0) * 0x800000) + + (Math.random() * 0x800000 | 0); }; + + return function (dp) { + var a, b, e, k, v, + i = 0, + c = [], + rand = new BigNumber(ONE); + + if (dp == null) dp = DECIMAL_PLACES; + else intCheck(dp, 0, MAX); + + k = mathceil(dp / LOG_BASE); + + if (CRYPTO) { + + // Browsers supporting crypto.getRandomValues. + if (crypto.getRandomValues) { + + a = crypto.getRandomValues(new Uint32Array(k *= 2)); + + for (; i < k;) { + + // 53 bits: + // ((Math.pow(2, 32) - 1) * Math.pow(2, 21)).toString(2) + // 11111 11111111 11111111 11111111 11100000 00000000 00000000 + // ((Math.pow(2, 32) - 1) >>> 11).toString(2) + // 11111 11111111 11111111 + // 0x20000 is 2^21. + v = a[i] * 0x20000 + (a[i + 1] >>> 11); + + // Rejection sampling: + // 0 <= v < 9007199254740992 + // Probability that v >= 9e15, is + // 7199254740992 / 9007199254740992 ~= 0.0008, i.e. 1 in 1251 + if (v >= 9e15) { + b = crypto.getRandomValues(new Uint32Array(2)); + a[i] = b[0]; + a[i + 1] = b[1]; + } else { + + // 0 <= v <= 8999999999999999 + // 0 <= (v % 1e14) <= 99999999999999 + c.push(v % 1e14); + i += 2; + } + } + i = k / 2; + + // Node.js supporting crypto.randomBytes. + } else if (crypto.randomBytes) { + + // buffer + a = crypto.randomBytes(k *= 7); + + for (; i < k;) { + + // 0x1000000000000 is 2^48, 0x10000000000 is 2^40 + // 0x100000000 is 2^32, 0x1000000 is 2^24 + // 11111 11111111 11111111 11111111 11111111 11111111 11111111 + // 0 <= v < 9007199254740992 + v = ((a[i] & 31) * 0x1000000000000) + (a[i + 1] * 0x10000000000) + + (a[i + 2] * 0x100000000) + (a[i + 3] * 0x1000000) + + (a[i + 4] << 16) + (a[i + 5] << 8) + a[i + 6]; + + if (v >= 9e15) { + crypto.randomBytes(7).copy(a, i); + } else { + + // 0 <= (v % 1e14) <= 99999999999999 + c.push(v % 1e14); + i += 7; + } + } + i = k / 7; + } else { + CRYPTO = false; + throw Error + (bignumberError + 'crypto unavailable'); + } + } + + // Use Math.random. + if (!CRYPTO) { + + for (; i < k;) { + v = random53bitInt(); + if (v < 9e15) c[i++] = v % 1e14; + } + } + + k = c[--i]; + dp %= LOG_BASE; + + // Convert trailing digits to zeros according to dp. + if (k && dp) { + v = POWS_TEN[LOG_BASE - dp]; + c[i] = mathfloor(k / v) * v; + } + + // Remove trailing elements which are zero. + for (; c[i] === 0; c.pop(), i--); + + // Zero? + if (i < 0) { + c = [e = 0]; + } else { + + // Remove leading elements which are zero and adjust exponent accordingly. + for (e = -1 ; c[0] === 0; c.splice(0, 1), e -= LOG_BASE); + + // Count the digits of the first element of c to determine leading zeros, and... + for (i = 1, v = c[0]; v >= 10; v /= 10, i++); + + // adjust the exponent accordingly. + if (i < LOG_BASE) e -= LOG_BASE - i; + } + + rand.e = e; + rand.c = c; + return rand; + }; + })(); + + + // PRIVATE FUNCTIONS + + + // Called by BigNumber and BigNumber.prototype.toString. + convertBase = (function () { + var decimal = '0123456789'; + + /* + * Convert string of baseIn to an array of numbers of baseOut. + * Eg. toBaseOut('255', 10, 16) returns [15, 15]. + * Eg. toBaseOut('ff', 16, 10) returns [2, 5, 5]. + */ + function toBaseOut(str, baseIn, baseOut, alphabet) { + var j, + arr = [0], + arrL, + i = 0, + len = str.length; + + for (; i < len;) { + for (arrL = arr.length; arrL--; arr[arrL] *= baseIn); + + arr[0] += alphabet.indexOf(str.charAt(i++)); + + for (j = 0; j < arr.length; j++) { + + if (arr[j] > baseOut - 1) { + if (arr[j + 1] == null) arr[j + 1] = 0; + arr[j + 1] += arr[j] / baseOut | 0; + arr[j] %= baseOut; + } + } + } + + return arr.reverse(); + } + + // Convert a numeric string of baseIn to a numeric string of baseOut. + // If the caller is toString, we are converting from base 10 to baseOut. + // If the caller is BigNumber, we are converting from baseIn to base 10. + return function (str, baseIn, baseOut, sign, callerIsToString) { + var alphabet, d, e, k, r, x, xc, y, + i = str.indexOf('.'), + dp = DECIMAL_PLACES, + rm = ROUNDING_MODE; + + // Non-integer. + if (i >= 0) { + k = POW_PRECISION; + + // Unlimited precision. + POW_PRECISION = 0; + str = str.replace('.', ''); + y = new BigNumber(baseIn); + x = y.pow(str.length - i); + POW_PRECISION = k; + + // Convert str as if an integer, then restore the fraction part by dividing the + // result by its base raised to a power. + + y.c = toBaseOut(toFixedPoint(coeffToString(x.c), x.e, '0'), + 10, baseOut, decimal); + y.e = y.c.length; + } + + // Convert the number as integer. + + xc = toBaseOut(str, baseIn, baseOut, callerIsToString + ? (alphabet = ALPHABET, decimal) + : (alphabet = decimal, ALPHABET)); + + // xc now represents str as an integer and converted to baseOut. e is the exponent. + e = k = xc.length; + + // Remove trailing zeros. + for (; xc[--k] == 0; xc.pop()); + + // Zero? + if (!xc[0]) return alphabet.charAt(0); + + // Does str represent an integer? If so, no need for the division. + if (i < 0) { + --e; + } else { + x.c = xc; + x.e = e; + + // The sign is needed for correct rounding. + x.s = sign; + x = div(x, y, dp, rm, baseOut); + xc = x.c; + r = x.r; + e = x.e; + } + + // xc now represents str converted to baseOut. + + // THe index of the rounding digit. + d = e + dp + 1; + + // The rounding digit: the digit to the right of the digit that may be rounded up. + i = xc[d]; + + // Look at the rounding digits and mode to determine whether to round up. + + k = baseOut / 2; + r = r || d < 0 || xc[d + 1] != null; + + r = rm < 4 ? (i != null || r) && (rm == 0 || rm == (x.s < 0 ? 3 : 2)) + : i > k || i == k &&(rm == 4 || r || rm == 6 && xc[d - 1] & 1 || + rm == (x.s < 0 ? 8 : 7)); + + // If the index of the rounding digit is not greater than zero, or xc represents + // zero, then the result of the base conversion is zero or, if rounding up, a value + // such as 0.00001. + if (d < 1 || !xc[0]) { + + // 1^-dp or 0 + str = r ? toFixedPoint(alphabet.charAt(1), -dp, alphabet.charAt(0)) + : alphabet.charAt(0); + } else { + + // Truncate xc to the required number of decimal places. + xc.length = d; + + // Round up? + if (r) { + + // Rounding up may mean the previous digit has to be rounded up and so on. + for (--baseOut; ++xc[--d] > baseOut;) { + xc[d] = 0; + + if (!d) { + ++e; + xc = [1].concat(xc); + } + } + } + + // Determine trailing zeros. + for (k = xc.length; !xc[--k];); + + // E.g. [4, 11, 15] becomes 4bf. + for (i = 0, str = ''; i <= k; str += alphabet.charAt(xc[i++])); + + // Add leading zeros, decimal point and trailing zeros as required. + str = toFixedPoint(str, e, alphabet.charAt(0)); + } + + // The caller will add the sign. + return str; + }; + })(); + + + // Perform division in the specified base. Called by div and convertBase. + div = (function () { + + // Assume non-zero x and k. + function multiply(x, k, base) { + var m, temp, xlo, xhi, + carry = 0, + i = x.length, + klo = k % SQRT_BASE, + khi = k / SQRT_BASE | 0; + + for (x = x.slice(); i--;) { + xlo = x[i] % SQRT_BASE; + xhi = x[i] / SQRT_BASE | 0; + m = khi * xlo + xhi * klo; + temp = klo * xlo + ((m % SQRT_BASE) * SQRT_BASE) + carry; + carry = (temp / base | 0) + (m / SQRT_BASE | 0) + khi * xhi; + x[i] = temp % base; + } + + if (carry) x = [carry].concat(x); + + return x; + } + + function compare(a, b, aL, bL) { + var i, cmp; + + if (aL != bL) { + cmp = aL > bL ? 1 : -1; + } else { + + for (i = cmp = 0; i < aL; i++) { + + if (a[i] != b[i]) { + cmp = a[i] > b[i] ? 1 : -1; + break; + } + } + } + + return cmp; + } + + function subtract(a, b, aL, base) { + var i = 0; + + // Subtract b from a. + for (; aL--;) { + a[aL] -= i; + i = a[aL] < b[aL] ? 1 : 0; + a[aL] = i * base + a[aL] - b[aL]; + } + + // Remove leading zeros. + for (; !a[0] && a.length > 1; a.splice(0, 1)); + } + + // x: dividend, y: divisor. + return function (x, y, dp, rm, base) { + var cmp, e, i, more, n, prod, prodL, q, qc, rem, remL, rem0, xi, xL, yc0, + yL, yz, + s = x.s == y.s ? 1 : -1, + xc = x.c, + yc = y.c; + + // Either NaN, Infinity or 0? + if (!xc || !xc[0] || !yc || !yc[0]) { + + return new BigNumber( + + // Return NaN if either NaN, or both Infinity or 0. + !x.s || !y.s || (xc ? yc && xc[0] == yc[0] : !yc) ? NaN : + + // Return ±0 if x is ±0 or y is ±Infinity, or return ±Infinity as y is ±0. + xc && xc[0] == 0 || !yc ? s * 0 : s / 0 + ); + } + + q = new BigNumber(s); + qc = q.c = []; + e = x.e - y.e; + s = dp + e + 1; + + if (!base) { + base = BASE; + e = bitFloor(x.e / LOG_BASE) - bitFloor(y.e / LOG_BASE); + s = s / LOG_BASE | 0; + } + + // Result exponent may be one less then the current value of e. + // The coefficients of the BigNumbers from convertBase may have trailing zeros. + for (i = 0; yc[i] == (xc[i] || 0); i++); + + if (yc[i] > (xc[i] || 0)) e--; + + if (s < 0) { + qc.push(1); + more = true; + } else { + xL = xc.length; + yL = yc.length; + i = 0; + s += 2; + + // Normalise xc and yc so highest order digit of yc is >= base / 2. + + n = mathfloor(base / (yc[0] + 1)); + + // Not necessary, but to handle odd bases where yc[0] == (base / 2) - 1. + // if (n > 1 || n++ == 1 && yc[0] < base / 2) { + if (n > 1) { + yc = multiply(yc, n, base); + xc = multiply(xc, n, base); + yL = yc.length; + xL = xc.length; + } + + xi = yL; + rem = xc.slice(0, yL); + remL = rem.length; + + // Add zeros to make remainder as long as divisor. + for (; remL < yL; rem[remL++] = 0); + yz = yc.slice(); + yz = [0].concat(yz); + yc0 = yc[0]; + if (yc[1] >= base / 2) yc0++; + // Not necessary, but to prevent trial digit n > base, when using base 3. + // else if (base == 3 && yc0 == 1) yc0 = 1 + 1e-15; + + do { + n = 0; + + // Compare divisor and remainder. + cmp = compare(yc, rem, yL, remL); + + // If divisor < remainder. + if (cmp < 0) { + + // Calculate trial digit, n. + + rem0 = rem[0]; + if (yL != remL) rem0 = rem0 * base + (rem[1] || 0); + + // n is how many times the divisor goes into the current remainder. + n = mathfloor(rem0 / yc0); + + // Algorithm: + // product = divisor multiplied by trial digit (n). + // Compare product and remainder. + // If product is greater than remainder: + // Subtract divisor from product, decrement trial digit. + // Subtract product from remainder. + // If product was less than remainder at the last compare: + // Compare new remainder and divisor. + // If remainder is greater than divisor: + // Subtract divisor from remainder, increment trial digit. + + if (n > 1) { + + // n may be > base only when base is 3. + if (n >= base) n = base - 1; + + // product = divisor * trial digit. + prod = multiply(yc, n, base); + prodL = prod.length; + remL = rem.length; + + // Compare product and remainder. + // If product > remainder then trial digit n too high. + // n is 1 too high about 5% of the time, and is not known to have + // ever been more than 1 too high. + while (compare(prod, rem, prodL, remL) == 1) { + n--; + + // Subtract divisor from product. + subtract(prod, yL < prodL ? yz : yc, prodL, base); + prodL = prod.length; + cmp = 1; + } + } else { + + // n is 0 or 1, cmp is -1. + // If n is 0, there is no need to compare yc and rem again below, + // so change cmp to 1 to avoid it. + // If n is 1, leave cmp as -1, so yc and rem are compared again. + if (n == 0) { + + // divisor < remainder, so n must be at least 1. + cmp = n = 1; + } + + // product = divisor + prod = yc.slice(); + prodL = prod.length; + } + + if (prodL < remL) prod = [0].concat(prod); + + // Subtract product from remainder. + subtract(rem, prod, remL, base); + remL = rem.length; + + // If product was < remainder. + if (cmp == -1) { + + // Compare divisor and new remainder. + // If divisor < new remainder, subtract divisor from remainder. + // Trial digit n too low. + // n is 1 too low about 5% of the time, and very rarely 2 too low. + while (compare(yc, rem, yL, remL) < 1) { + n++; + + // Subtract divisor from remainder. + subtract(rem, yL < remL ? yz : yc, remL, base); + remL = rem.length; + } + } + } else if (cmp === 0) { + n++; + rem = [0]; + } // else cmp === 1 and n will be 0 + + // Add the next digit, n, to the result array. + qc[i++] = n; + + // Update the remainder. + if (rem[0]) { + rem[remL++] = xc[xi] || 0; + } else { + rem = [xc[xi]]; + remL = 1; + } + } while ((xi++ < xL || rem[0] != null) && s--); + + more = rem[0] != null; + + // Leading zero? + if (!qc[0]) qc.splice(0, 1); + } + + if (base == BASE) { + + // To calculate q.e, first get the number of digits of qc[0]. + for (i = 1, s = qc[0]; s >= 10; s /= 10, i++); + + round(q, dp + (q.e = i + e * LOG_BASE - 1) + 1, rm, more); + + // Caller is convertBase. + } else { + q.e = e; + q.r = +more; + } + + return q; + }; + })(); + + + /* + * Return a string representing the value of BigNumber n in fixed-point or exponential + * notation rounded to the specified decimal places or significant digits. + * + * n: a BigNumber. + * i: the index of the last digit required (i.e. the digit that may be rounded up). + * rm: the rounding mode. + * id: 1 (toExponential) or 2 (toPrecision). + */ + function format(n, i, rm, id) { + var c0, e, ne, len, str; + + if (rm == null) rm = ROUNDING_MODE; + else intCheck(rm, 0, 8); + + if (!n.c) return n.toString(); + + c0 = n.c[0]; + ne = n.e; + + if (i == null) { + str = coeffToString(n.c); + str = id == 1 || id == 2 && ne <= TO_EXP_NEG + ? toExponential(str, ne) + : toFixedPoint(str, ne, '0'); + } else { + n = round(new BigNumber(n), i, rm); + + // n.e may have changed if the value was rounded up. + e = n.e; + + str = coeffToString(n.c); + len = str.length; + + // toPrecision returns exponential notation if the number of significant digits + // specified is less than the number of digits necessary to represent the integer + // part of the value in fixed-point notation. + + // Exponential notation. + if (id == 1 || id == 2 && (i <= e || e <= TO_EXP_NEG)) { + + // Append zeros? + for (; len < i; str += '0', len++); + str = toExponential(str, e); + + // Fixed-point notation. + } else { + i -= ne; + str = toFixedPoint(str, e, '0'); + + // Append zeros? + if (e + 1 > len) { + if (--i > 0) for (str += '.'; i--; str += '0'); + } else { + i += e - len; + if (i > 0) { + if (e + 1 == len) str += '.'; + for (; i--; str += '0'); + } + } + } + } + + return n.s < 0 && c0 ? '-' + str : str; + } + + + // Handle BigNumber.max and BigNumber.min. + function maxOrMin(args, method) { + var m, n, + i = 0; + + if (isArray(args[0])) args = args[0]; + m = new BigNumber(args[0]); + + for (; ++i < args.length;) { + n = new BigNumber(args[i]); + + // If any number is NaN, return NaN. + if (!n.s) { + m = n; + break; + } else if (method.call(m, n)) { + m = n; + } + } + + return m; + } + + + /* + * Strip trailing zeros, calculate base 10 exponent and check against MIN_EXP and MAX_EXP. + * Called by minus, plus and times. + */ + function normalise(n, c, e) { + var i = 1, + j = c.length; + + // Remove trailing zeros. + for (; !c[--j]; c.pop()); + + // Calculate the base 10 exponent. First get the number of digits of c[0]. + for (j = c[0]; j >= 10; j /= 10, i++); + + // Overflow? + if ((e = i + e * LOG_BASE - 1) > MAX_EXP) { + + // Infinity. + n.c = n.e = null; + + // Underflow? + } else if (e < MIN_EXP) { + + // Zero. + n.c = [n.e = 0]; + } else { + n.e = e; + n.c = c; + } + + return n; + } + + + // Handle values that fail the validity test in BigNumber. + parseNumeric = (function () { + var basePrefix = /^(-?)0([xbo])(?=\w[\w.]*$)/i, + dotAfter = /^([^.]+)\.$/, + dotBefore = /^\.([^.]+)$/, + isInfinityOrNaN = /^-?(Infinity|NaN)$/, + whitespaceOrPlus = /^\s*\+(?=[\w.])|^\s+|\s+$/g; + + return function (x, str, isNum, b) { + var base, + s = isNum ? str : str.replace(whitespaceOrPlus, ''); + + // No exception on ±Infinity or NaN. + if (isInfinityOrNaN.test(s)) { + x.s = isNaN(s) ? null : s < 0 ? -1 : 1; + x.c = x.e = null; + } else { + if (!isNum) { + + // basePrefix = /^(-?)0([xbo])(?=\w[\w.]*$)/i + s = s.replace(basePrefix, function (m, p1, p2) { + base = (p2 = p2.toLowerCase()) == 'x' ? 16 : p2 == 'b' ? 2 : 8; + return !b || b == base ? p1 : m; + }); + + if (b) { + base = b; + + // E.g. '1.' to '1', '.1' to '0.1' + s = s.replace(dotAfter, '$1').replace(dotBefore, '0.$1'); + } + + if (str != s) return new BigNumber(s, base); + } + + // '[BigNumber Error] Not a number: {n}' + // '[BigNumber Error] Not a base {b} number: {n}' + if (BigNumber.DEBUG) { + throw Error + (bignumberError + 'Not a' + (b ? ' base ' + b : '') + ' number: ' + str); + } + + // NaN + x.c = x.e = x.s = null; + } + } + })(); + + + /* + * Round x to sd significant digits using rounding mode rm. Check for over/under-flow. + * If r is truthy, it is known that there are more digits after the rounding digit. + */ + function round(x, sd, rm, r) { + var d, i, j, k, n, ni, rd, + xc = x.c, + pows10 = POWS_TEN; + + // if x is not Infinity or NaN... + if (xc) { + + // rd is the rounding digit, i.e. the digit after the digit that may be rounded up. + // n is a base 1e14 number, the value of the element of array x.c containing rd. + // ni is the index of n within x.c. + // d is the number of digits of n. + // i is the index of rd within n including leading zeros. + // j is the actual index of rd within n (if < 0, rd is a leading zero). + out: { + + // Get the number of digits of the first element of xc. + for (d = 1, k = xc[0]; k >= 10; k /= 10, d++); + i = sd - d; + + // If the rounding digit is in the first element of xc... + if (i < 0) { + i += LOG_BASE; + j = sd; + n = xc[ni = 0]; + + // Get the rounding digit at index j of n. + rd = n / pows10[d - j - 1] % 10 | 0; + } else { + ni = mathceil((i + 1) / LOG_BASE); + + if (ni >= xc.length) { + + if (r) { + + // Needed by sqrt. + for (; xc.length <= ni; xc.push(0)); + n = rd = 0; + d = 1; + i %= LOG_BASE; + j = i - LOG_BASE + 1; + } else { + break out; + } + } else { + n = k = xc[ni]; + + // Get the number of digits of n. + for (d = 1; k >= 10; k /= 10, d++); + + // Get the index of rd within n. + i %= LOG_BASE; + + // Get the index of rd within n, adjusted for leading zeros. + // The number of leading zeros of n is given by LOG_BASE - d. + j = i - LOG_BASE + d; + + // Get the rounding digit at index j of n. + rd = j < 0 ? 0 : n / pows10[d - j - 1] % 10 | 0; + } + } + + r = r || sd < 0 || + + // Are there any non-zero digits after the rounding digit? + // The expression n % pows10[d - j - 1] returns all digits of n to the right + // of the digit at j, e.g. if n is 908714 and j is 2, the expression gives 714. + xc[ni + 1] != null || (j < 0 ? n : n % pows10[d - j - 1]); + + r = rm < 4 + ? (rd || r) && (rm == 0 || rm == (x.s < 0 ? 3 : 2)) + : rd > 5 || rd == 5 && (rm == 4 || r || rm == 6 && + + // Check whether the digit to the left of the rounding digit is odd. + ((i > 0 ? j > 0 ? n / pows10[d - j] : 0 : xc[ni - 1]) % 10) & 1 || + rm == (x.s < 0 ? 8 : 7)); + + if (sd < 1 || !xc[0]) { + xc.length = 0; + + if (r) { + + // Convert sd to decimal places. + sd -= x.e + 1; + + // 1, 0.1, 0.01, 0.001, 0.0001 etc. + xc[0] = pows10[(LOG_BASE - sd % LOG_BASE) % LOG_BASE]; + x.e = -sd || 0; + } else { + + // Zero. + xc[0] = x.e = 0; + } + + return x; + } + + // Remove excess digits. + if (i == 0) { + xc.length = ni; + k = 1; + ni--; + } else { + xc.length = ni + 1; + k = pows10[LOG_BASE - i]; + + // E.g. 56700 becomes 56000 if 7 is the rounding digit. + // j > 0 means i > number of leading zeros of n. + xc[ni] = j > 0 ? mathfloor(n / pows10[d - j] % pows10[j]) * k : 0; + } + + // Round up? + if (r) { + + for (; ;) { + + // If the digit to be rounded up is in the first element of xc... + if (ni == 0) { + + // i will be the length of xc[0] before k is added. + for (i = 1, j = xc[0]; j >= 10; j /= 10, i++); + j = xc[0] += k; + for (k = 1; j >= 10; j /= 10, k++); + + // if i != k the length has increased. + if (i != k) { + x.e++; + if (xc[0] == BASE) xc[0] = 1; + } + + break; + } else { + xc[ni] += k; + if (xc[ni] != BASE) break; + xc[ni--] = 0; + k = 1; + } + } + } + + // Remove trailing zeros. + for (i = xc.length; xc[--i] === 0; xc.pop()); + } + + // Overflow? Infinity. + if (x.e > MAX_EXP) { + x.c = x.e = null; + + // Underflow? Zero. + } else if (x.e < MIN_EXP) { + x.c = [x.e = 0]; + } + } + + return x; + } + + + // PROTOTYPE/INSTANCE METHODS + + + /* + * Return a new BigNumber whose value is the absolute value of this BigNumber. + */ + P.absoluteValue = P.abs = function () { + var x = new BigNumber(this); + if (x.s < 0) x.s = 1; + return x; + }; + + + /* + * Return + * 1 if the value of this BigNumber is greater than the value of BigNumber(y, b), + * -1 if the value of this BigNumber is less than the value of BigNumber(y, b), + * 0 if they have the same value, + * or null if the value of either is NaN. + */ + P.comparedTo = function (y, b) { + return compare(this, new BigNumber(y, b)); + }; + + + /* + * If dp is undefined or null or true or false, return the number of decimal places of the + * value of this BigNumber, or null if the value of this BigNumber is ±Infinity or NaN. + * + * Otherwise, if dp is a number, return a new BigNumber whose value is the value of this + * BigNumber rounded to a maximum of dp decimal places using rounding mode rm, or + * ROUNDING_MODE if rm is omitted. + * + * [dp] {number} Decimal places: integer, 0 to MAX inclusive. + * [rm] {number} Rounding mode. Integer, 0 to 8 inclusive. + * + * '[BigNumber Error] Argument {not a primitive number|not an integer|out of range}: {dp|rm}' + */ + P.decimalPlaces = P.dp = function (dp, rm) { + var c, n, v, + x = this; + + if (dp != null) { + intCheck(dp, 0, MAX); + if (rm == null) rm = ROUNDING_MODE; + else intCheck(rm, 0, 8); + + return round(new BigNumber(x), dp + x.e + 1, rm); + } + + if (!(c = x.c)) return null; + n = ((v = c.length - 1) - bitFloor(this.e / LOG_BASE)) * LOG_BASE; + + // Subtract the number of trailing zeros of the last number. + if (v = c[v]) for (; v % 10 == 0; v /= 10, n--); + if (n < 0) n = 0; + + return n; + }; + + + /* + * n / 0 = I + * n / N = N + * n / I = 0 + * 0 / n = 0 + * 0 / 0 = N + * 0 / N = N + * 0 / I = 0 + * N / n = N + * N / 0 = N + * N / N = N + * N / I = N + * I / n = I + * I / 0 = I + * I / N = N + * I / I = N + * + * Return a new BigNumber whose value is the value of this BigNumber divided by the value of + * BigNumber(y, b), rounded according to DECIMAL_PLACES and ROUNDING_MODE. + */ + P.dividedBy = P.div = function (y, b) { + return div(this, new BigNumber(y, b), DECIMAL_PLACES, ROUNDING_MODE); + }; + + + /* + * Return a new BigNumber whose value is the integer part of dividing the value of this + * BigNumber by the value of BigNumber(y, b). + */ + P.dividedToIntegerBy = P.idiv = function (y, b) { + return div(this, new BigNumber(y, b), 0, 1); + }; + + + /* + * Return a BigNumber whose value is the value of this BigNumber exponentiated by n. + * + * If m is present, return the result modulo m. + * If n is negative round according to DECIMAL_PLACES and ROUNDING_MODE. + * If POW_PRECISION is non-zero and m is not present, round to POW_PRECISION using ROUNDING_MODE. + * + * The modular power operation works efficiently when x, n, and m are integers, otherwise it + * is equivalent to calculating x.exponentiatedBy(n).modulo(m) with a POW_PRECISION of 0. + * + * n {number|string|BigNumber} The exponent. An integer. + * [m] {number|string|BigNumber} The modulus. + * + * '[BigNumber Error] Exponent not an integer: {n}' + */ + P.exponentiatedBy = P.pow = function (n, m) { + var half, isModExp, k, more, nIsBig, nIsNeg, nIsOdd, y, + x = this; + + n = new BigNumber(n); + + // Allow NaN and ±Infinity, but not other non-integers. + if (n.c && !n.isInteger()) { + throw Error + (bignumberError + 'Exponent not an integer: ' + n); + } + + if (m != null) m = new BigNumber(m); + + // Exponent of MAX_SAFE_INTEGER is 15. + nIsBig = n.e > 14; + + // If x is NaN, ±Infinity, ±0 or ±1, or n is ±Infinity, NaN or ±0. + if (!x.c || !x.c[0] || x.c[0] == 1 && !x.e && x.c.length == 1 || !n.c || !n.c[0]) { + + // The sign of the result of pow when x is negative depends on the evenness of n. + // If +n overflows to ±Infinity, the evenness of n would be not be known. + y = new BigNumber(Math.pow(+x.valueOf(), nIsBig ? 2 - isOdd(n) : +n)); + return m ? y.mod(m) : y; + } + + nIsNeg = n.s < 0; + + if (m) { + + // x % m returns NaN if abs(m) is zero, or m is NaN. + if (m.c ? !m.c[0] : !m.s) return new BigNumber(NaN); + + isModExp = !nIsNeg && x.isInteger() && m.isInteger(); + + if (isModExp) x = x.mod(m); + + // Overflow to ±Infinity: >=2**1e10 or >=1.0000024**1e15. + // Underflow to ±0: <=0.79**1e10 or <=0.9999975**1e15. + } else if (n.e > 9 && (x.e > 0 || x.e < -1 || (x.e == 0 + // [1, 240000000] + ? x.c[0] > 1 || nIsBig && x.c[1] >= 24e7 + // [80000000000000] [99999750000000] + : x.c[0] < 8e13 || nIsBig && x.c[0] <= 9999975e7))) { + + // If x is negative and n is odd, k = -0, else k = 0. + k = x.s < 0 && isOdd(n) ? -0 : 0; + + // If x >= 1, k = ±Infinity. + if (x.e > -1) k = 1 / k; + + // If n is negative return ±0, else return ±Infinity. + return new BigNumber(nIsNeg ? 1 / k : k); + + } else if (POW_PRECISION) { + + // Truncating each coefficient array to a length of k after each multiplication + // equates to truncating significant digits to POW_PRECISION + [28, 41], + // i.e. there will be a minimum of 28 guard digits retained. + k = mathceil(POW_PRECISION / LOG_BASE + 2); + } + + if (nIsBig) { + half = new BigNumber(0.5); + nIsOdd = isOdd(n); + } else { + nIsOdd = n % 2; + } + + if (nIsNeg) n.s = 1; + + y = new BigNumber(ONE); + + // Performs 54 loop iterations for n of 9007199254740991. + for (; ;) { + + if (nIsOdd) { + y = y.times(x); + if (!y.c) break; + + if (k) { + if (y.c.length > k) y.c.length = k; + } else if (isModExp) { + y = y.mod(m); //y = y.minus(div(y, m, 0, MODULO_MODE).times(m)); + } + } + + if (nIsBig) { + n = n.times(half); + round(n, n.e + 1, 1); + if (!n.c[0]) break; + nIsBig = n.e > 14; + nIsOdd = isOdd(n); + } else { + n = mathfloor(n / 2); + if (!n) break; + nIsOdd = n % 2; + } + + x = x.times(x); + + if (k) { + if (x.c && x.c.length > k) x.c.length = k; + } else if (isModExp) { + x = x.mod(m); //x = x.minus(div(x, m, 0, MODULO_MODE).times(m)); + } + } + + if (isModExp) return y; + if (nIsNeg) y = ONE.div(y); + + return m ? y.mod(m) : k ? round(y, POW_PRECISION, ROUNDING_MODE, more) : y; + }; + + + /* + * Return a new BigNumber whose value is the value of this BigNumber rounded to an integer + * using rounding mode rm, or ROUNDING_MODE if rm is omitted. + * + * [rm] {number} Rounding mode. Integer, 0 to 8 inclusive. + * + * '[BigNumber Error] Argument {not a primitive number|not an integer|out of range}: {rm}' + */ + P.integerValue = function (rm) { + var n = new BigNumber(this); + if (rm == null) rm = ROUNDING_MODE; + else intCheck(rm, 0, 8); + return round(n, n.e + 1, rm); + }; + + + /* + * Return true if the value of this BigNumber is equal to the value of BigNumber(y, b), + * otherwise return false. + */ + P.isEqualTo = P.eq = function (y, b) { + return compare(this, new BigNumber(y, b)) === 0; + }; + + + /* + * Return true if the value of this BigNumber is a finite number, otherwise return false. + */ + P.isFinite = function () { + return !!this.c; + }; + + + /* + * Return true if the value of this BigNumber is greater than the value of BigNumber(y, b), + * otherwise return false. + */ + P.isGreaterThan = P.gt = function (y, b) { + return compare(this, new BigNumber(y, b)) > 0; + }; + + + /* + * Return true if the value of this BigNumber is greater than or equal to the value of + * BigNumber(y, b), otherwise return false. + */ + P.isGreaterThanOrEqualTo = P.gte = function (y, b) { + return (b = compare(this, new BigNumber(y, b))) === 1 || b === 0; + + }; + + + /* + * Return true if the value of this BigNumber is an integer, otherwise return false. + */ + P.isInteger = function () { + return !!this.c && bitFloor(this.e / LOG_BASE) > this.c.length - 2; + }; + + + /* + * Return true if the value of this BigNumber is less than the value of BigNumber(y, b), + * otherwise return false. + */ + P.isLessThan = P.lt = function (y, b) { + return compare(this, new BigNumber(y, b)) < 0; + }; + + + /* + * Return true if the value of this BigNumber is less than or equal to the value of + * BigNumber(y, b), otherwise return false. + */ + P.isLessThanOrEqualTo = P.lte = function (y, b) { + return (b = compare(this, new BigNumber(y, b))) === -1 || b === 0; + }; + + + /* + * Return true if the value of this BigNumber is NaN, otherwise return false. + */ + P.isNaN = function () { + return !this.s; + }; + + + /* + * Return true if the value of this BigNumber is negative, otherwise return false. + */ + P.isNegative = function () { + return this.s < 0; + }; + + + /* + * Return true if the value of this BigNumber is positive, otherwise return false. + */ + P.isPositive = function () { + return this.s > 0; + }; + + + /* + * Return true if the value of this BigNumber is 0 or -0, otherwise return false. + */ + P.isZero = function () { + return !!this.c && this.c[0] == 0; + }; + + + /* + * n - 0 = n + * n - N = N + * n - I = -I + * 0 - n = -n + * 0 - 0 = 0 + * 0 - N = N + * 0 - I = -I + * N - n = N + * N - 0 = N + * N - N = N + * N - I = N + * I - n = I + * I - 0 = I + * I - N = N + * I - I = N + * + * Return a new BigNumber whose value is the value of this BigNumber minus the value of + * BigNumber(y, b). + */ + P.minus = function (y, b) { + var i, j, t, xLTy, + x = this, + a = x.s; + + y = new BigNumber(y, b); + b = y.s; + + // Either NaN? + if (!a || !b) return new BigNumber(NaN); + + // Signs differ? + if (a != b) { + y.s = -b; + return x.plus(y); + } + + var xe = x.e / LOG_BASE, + ye = y.e / LOG_BASE, + xc = x.c, + yc = y.c; + + if (!xe || !ye) { + + // Either Infinity? + if (!xc || !yc) return xc ? (y.s = -b, y) : new BigNumber(yc ? x : NaN); + + // Either zero? + if (!xc[0] || !yc[0]) { + + // Return y if y is non-zero, x if x is non-zero, or zero if both are zero. + return yc[0] ? (y.s = -b, y) : new BigNumber(xc[0] ? x : + + // IEEE 754 (2008) 6.3: n - n = -0 when rounding to -Infinity + ROUNDING_MODE == 3 ? -0 : 0); + } + } + + xe = bitFloor(xe); + ye = bitFloor(ye); + xc = xc.slice(); + + // Determine which is the bigger number. + if (a = xe - ye) { + + if (xLTy = a < 0) { + a = -a; + t = xc; + } else { + ye = xe; + t = yc; + } + + t.reverse(); + + // Prepend zeros to equalise exponents. + for (b = a; b--; t.push(0)); + t.reverse(); + } else { + + // Exponents equal. Check digit by digit. + j = (xLTy = (a = xc.length) < (b = yc.length)) ? a : b; + + for (a = b = 0; b < j; b++) { + + if (xc[b] != yc[b]) { + xLTy = xc[b] < yc[b]; + break; + } + } + } + + // x < y? Point xc to the array of the bigger number. + if (xLTy) t = xc, xc = yc, yc = t, y.s = -y.s; + + b = (j = yc.length) - (i = xc.length); + + // Append zeros to xc if shorter. + // No need to add zeros to yc if shorter as subtract only needs to start at yc.length. + if (b > 0) for (; b--; xc[i++] = 0); + b = BASE - 1; + + // Subtract yc from xc. + for (; j > a;) { + + if (xc[--j] < yc[j]) { + for (i = j; i && !xc[--i]; xc[i] = b); + --xc[i]; + xc[j] += BASE; + } + + xc[j] -= yc[j]; + } + + // Remove leading zeros and adjust exponent accordingly. + for (; xc[0] == 0; xc.splice(0, 1), --ye); + + // Zero? + if (!xc[0]) { + + // Following IEEE 754 (2008) 6.3, + // n - n = +0 but n - n = -0 when rounding towards -Infinity. + y.s = ROUNDING_MODE == 3 ? -1 : 1; + y.c = [y.e = 0]; + return y; + } + + // No need to check for Infinity as +x - +y != Infinity && -x - -y != Infinity + // for finite x and y. + return normalise(y, xc, ye); + }; + + + /* + * n % 0 = N + * n % N = N + * n % I = n + * 0 % n = 0 + * -0 % n = -0 + * 0 % 0 = N + * 0 % N = N + * 0 % I = 0 + * N % n = N + * N % 0 = N + * N % N = N + * N % I = N + * I % n = N + * I % 0 = N + * I % N = N + * I % I = N + * + * Return a new BigNumber whose value is the value of this BigNumber modulo the value of + * BigNumber(y, b). The result depends on the value of MODULO_MODE. + */ + P.modulo = P.mod = function (y, b) { + var q, s, + x = this; + + y = new BigNumber(y, b); + + // Return NaN if x is Infinity or NaN, or y is NaN or zero. + if (!x.c || !y.s || y.c && !y.c[0]) { + return new BigNumber(NaN); + + // Return x if y is Infinity or x is zero. + } else if (!y.c || x.c && !x.c[0]) { + return new BigNumber(x); + } + + if (MODULO_MODE == 9) { + + // Euclidian division: q = sign(y) * floor(x / abs(y)) + // r = x - qy where 0 <= r < abs(y) + s = y.s; + y.s = 1; + q = div(x, y, 0, 3); + y.s = s; + q.s *= s; + } else { + q = div(x, y, 0, MODULO_MODE); + } + + y = x.minus(q.times(y)); + + // To match JavaScript %, ensure sign of zero is sign of dividend. + if (!y.c[0] && MODULO_MODE == 1) y.s = x.s; + + return y; + }; + + + /* + * n * 0 = 0 + * n * N = N + * n * I = I + * 0 * n = 0 + * 0 * 0 = 0 + * 0 * N = N + * 0 * I = N + * N * n = N + * N * 0 = N + * N * N = N + * N * I = N + * I * n = I + * I * 0 = N + * I * N = N + * I * I = I + * + * Return a new BigNumber whose value is the value of this BigNumber multiplied by the value + * of BigNumber(y, b). + */ + P.multipliedBy = P.times = function (y, b) { + var c, e, i, j, k, m, xcL, xlo, xhi, ycL, ylo, yhi, zc, + base, sqrtBase, + x = this, + xc = x.c, + yc = (y = new BigNumber(y, b)).c; + + // Either NaN, ±Infinity or ±0? + if (!xc || !yc || !xc[0] || !yc[0]) { + + // Return NaN if either is NaN, or one is 0 and the other is Infinity. + if (!x.s || !y.s || xc && !xc[0] && !yc || yc && !yc[0] && !xc) { + y.c = y.e = y.s = null; + } else { + y.s *= x.s; + + // Return ±Infinity if either is ±Infinity. + if (!xc || !yc) { + y.c = y.e = null; + + // Return ±0 if either is ±0. + } else { + y.c = [0]; + y.e = 0; + } + } + + return y; + } + + e = bitFloor(x.e / LOG_BASE) + bitFloor(y.e / LOG_BASE); + y.s *= x.s; + xcL = xc.length; + ycL = yc.length; + + // Ensure xc points to longer array and xcL to its length. + if (xcL < ycL) zc = xc, xc = yc, yc = zc, i = xcL, xcL = ycL, ycL = i; + + // Initialise the result array with zeros. + for (i = xcL + ycL, zc = []; i--; zc.push(0)); + + base = BASE; + sqrtBase = SQRT_BASE; + + for (i = ycL; --i >= 0;) { + c = 0; + ylo = yc[i] % sqrtBase; + yhi = yc[i] / sqrtBase | 0; + + for (k = xcL, j = i + k; j > i;) { + xlo = xc[--k] % sqrtBase; + xhi = xc[k] / sqrtBase | 0; + m = yhi * xlo + xhi * ylo; + xlo = ylo * xlo + ((m % sqrtBase) * sqrtBase) + zc[j] + c; + c = (xlo / base | 0) + (m / sqrtBase | 0) + yhi * xhi; + zc[j--] = xlo % base; + } + + zc[j] = c; + } + + if (c) { + ++e; + } else { + zc.splice(0, 1); + } + + return normalise(y, zc, e); + }; + + + /* + * Return a new BigNumber whose value is the value of this BigNumber negated, + * i.e. multiplied by -1. + */ + P.negated = function () { + var x = new BigNumber(this); + x.s = -x.s || null; + return x; + }; + + + /* + * n + 0 = n + * n + N = N + * n + I = I + * 0 + n = n + * 0 + 0 = 0 + * 0 + N = N + * 0 + I = I + * N + n = N + * N + 0 = N + * N + N = N + * N + I = N + * I + n = I + * I + 0 = I + * I + N = N + * I + I = I + * + * Return a new BigNumber whose value is the value of this BigNumber plus the value of + * BigNumber(y, b). + */ + P.plus = function (y, b) { + var t, + x = this, + a = x.s; + + y = new BigNumber(y, b); + b = y.s; + + // Either NaN? + if (!a || !b) return new BigNumber(NaN); + + // Signs differ? + if (a != b) { + y.s = -b; + return x.minus(y); + } + + var xe = x.e / LOG_BASE, + ye = y.e / LOG_BASE, + xc = x.c, + yc = y.c; + + if (!xe || !ye) { + + // Return ±Infinity if either ±Infinity. + if (!xc || !yc) return new BigNumber(a / 0); + + // Either zero? + // Return y if y is non-zero, x if x is non-zero, or zero if both are zero. + if (!xc[0] || !yc[0]) return yc[0] ? y : new BigNumber(xc[0] ? x : a * 0); + } + + xe = bitFloor(xe); + ye = bitFloor(ye); + xc = xc.slice(); + + // Prepend zeros to equalise exponents. Faster to use reverse then do unshifts. + if (a = xe - ye) { + if (a > 0) { + ye = xe; + t = yc; + } else { + a = -a; + t = xc; + } + + t.reverse(); + for (; a--; t.push(0)); + t.reverse(); + } + + a = xc.length; + b = yc.length; + + // Point xc to the longer array, and b to the shorter length. + if (a - b < 0) t = yc, yc = xc, xc = t, b = a; + + // Only start adding at yc.length - 1 as the further digits of xc can be ignored. + for (a = 0; b;) { + a = (xc[--b] = xc[b] + yc[b] + a) / BASE | 0; + xc[b] = BASE === xc[b] ? 0 : xc[b] % BASE; + } + + if (a) { + xc = [a].concat(xc); + ++ye; + } + + // No need to check for zero, as +x + +y != 0 && -x + -y != 0 + // ye = MAX_EXP + 1 possible + return normalise(y, xc, ye); + }; + + + /* + * If sd is undefined or null or true or false, return the number of significant digits of + * the value of this BigNumber, or null if the value of this BigNumber is ±Infinity or NaN. + * If sd is true include integer-part trailing zeros in the count. + * + * Otherwise, if sd is a number, return a new BigNumber whose value is the value of this + * BigNumber rounded to a maximum of sd significant digits using rounding mode rm, or + * ROUNDING_MODE if rm is omitted. + * + * sd {number|boolean} number: significant digits: integer, 1 to MAX inclusive. + * boolean: whether to count integer-part trailing zeros: true or false. + * [rm] {number} Rounding mode. Integer, 0 to 8 inclusive. + * + * '[BigNumber Error] Argument {not a primitive number|not an integer|out of range}: {sd|rm}' + */ + P.precision = P.sd = function (sd, rm) { + var c, n, v, + x = this; + + if (sd != null && sd !== !!sd) { + intCheck(sd, 1, MAX); + if (rm == null) rm = ROUNDING_MODE; + else intCheck(rm, 0, 8); + + return round(new BigNumber(x), sd, rm); + } + + if (!(c = x.c)) return null; + v = c.length - 1; + n = v * LOG_BASE + 1; + + if (v = c[v]) { + + // Subtract the number of trailing zeros of the last element. + for (; v % 10 == 0; v /= 10, n--); + + // Add the number of digits of the first element. + for (v = c[0]; v >= 10; v /= 10, n++); + } + + if (sd && x.e + 1 > n) n = x.e + 1; + + return n; + }; + + + /* + * Return a new BigNumber whose value is the value of this BigNumber shifted by k places + * (powers of 10). Shift to the right if n > 0, and to the left if n < 0. + * + * k {number} Integer, -MAX_SAFE_INTEGER to MAX_SAFE_INTEGER inclusive. + * + * '[BigNumber Error] Argument {not a primitive number|not an integer|out of range}: {k}' + */ + P.shiftedBy = function (k) { + intCheck(k, -MAX_SAFE_INTEGER, MAX_SAFE_INTEGER); + return this.times('1e' + k); + }; + + + /* + * sqrt(-n) = N + * sqrt(N) = N + * sqrt(-I) = N + * sqrt(I) = I + * sqrt(0) = 0 + * sqrt(-0) = -0 + * + * Return a new BigNumber whose value is the square root of the value of this BigNumber, + * rounded according to DECIMAL_PLACES and ROUNDING_MODE. + */ + P.squareRoot = P.sqrt = function () { + var m, n, r, rep, t, + x = this, + c = x.c, + s = x.s, + e = x.e, + dp = DECIMAL_PLACES + 4, + half = new BigNumber('0.5'); + + // Negative/NaN/Infinity/zero? + if (s !== 1 || !c || !c[0]) { + return new BigNumber(!s || s < 0 && (!c || c[0]) ? NaN : c ? x : 1 / 0); + } + + // Initial estimate. + s = Math.sqrt(+x); + + // Math.sqrt underflow/overflow? + // Pass x to Math.sqrt as integer, then adjust the exponent of the result. + if (s == 0 || s == 1 / 0) { + n = coeffToString(c); + if ((n.length + e) % 2 == 0) n += '0'; + s = Math.sqrt(n); + e = bitFloor((e + 1) / 2) - (e < 0 || e % 2); + + if (s == 1 / 0) { + n = '1e' + e; + } else { + n = s.toExponential(); + n = n.slice(0, n.indexOf('e') + 1) + e; + } + + r = new BigNumber(n); + } else { + r = new BigNumber(s + ''); + } + + // Check for zero. + // r could be zero if MIN_EXP is changed after the this value was created. + // This would cause a division by zero (x/t) and hence Infinity below, which would cause + // coeffToString to throw. + if (r.c[0]) { + e = r.e; + s = e + dp; + if (s < 3) s = 0; + + // Newton-Raphson iteration. + for (; ;) { + t = r; + r = half.times(t.plus(div(x, t, dp, 1))); + + if (coeffToString(t.c ).slice(0, s) === (n = + coeffToString(r.c)).slice(0, s)) { + + // The exponent of r may here be one less than the final result exponent, + // e.g 0.0009999 (e-4) --> 0.001 (e-3), so adjust s so the rounding digits + // are indexed correctly. + if (r.e < e) --s; + n = n.slice(s - 3, s + 1); + + // The 4th rounding digit may be in error by -1 so if the 4 rounding digits + // are 9999 or 4999 (i.e. approaching a rounding boundary) continue the + // iteration. + if (n == '9999' || !rep && n == '4999') { + + // On the first iteration only, check to see if rounding up gives the + // exact result as the nines may infinitely repeat. + if (!rep) { + round(t, t.e + DECIMAL_PLACES + 2, 0); + + if (t.times(t).eq(x)) { + r = t; + break; + } + } + + dp += 4; + s += 4; + rep = 1; + } else { + + // If rounding digits are null, 0{0,4} or 50{0,3}, check for exact + // result. If not, then there are further digits and m will be truthy. + if (!+n || !+n.slice(1) && n.charAt(0) == '5') { + + // Truncate to the first rounding digit. + round(r, r.e + DECIMAL_PLACES + 2, 1); + m = !r.times(r).eq(x); + } + + break; + } + } + } + } + + return round(r, r.e + DECIMAL_PLACES + 1, ROUNDING_MODE, m); + }; + + + /* + * Return a string representing the value of this BigNumber in exponential notation and + * rounded using ROUNDING_MODE to dp fixed decimal places. + * + * [dp] {number} Decimal places. Integer, 0 to MAX inclusive. + * [rm] {number} Rounding mode. Integer, 0 to 8 inclusive. + * + * '[BigNumber Error] Argument {not a primitive number|not an integer|out of range}: {dp|rm}' + */ + P.toExponential = function (dp, rm) { + if (dp != null) { + intCheck(dp, 0, MAX); + dp++; + } + return format(this, dp, rm, 1); + }; + + + /* + * Return a string representing the value of this BigNumber in fixed-point notation rounding + * to dp fixed decimal places using rounding mode rm, or ROUNDING_MODE if rm is omitted. + * + * Note: as with JavaScript's number type, (-0).toFixed(0) is '0', + * but e.g. (-0.00001).toFixed(0) is '-0'. + * + * [dp] {number} Decimal places. Integer, 0 to MAX inclusive. + * [rm] {number} Rounding mode. Integer, 0 to 8 inclusive. + * + * '[BigNumber Error] Argument {not a primitive number|not an integer|out of range}: {dp|rm}' + */ + P.toFixed = function (dp, rm) { + if (dp != null) { + intCheck(dp, 0, MAX); + dp = dp + this.e + 1; + } + return format(this, dp, rm); + }; + + + /* + * Return a string representing the value of this BigNumber in fixed-point notation rounded + * using rm or ROUNDING_MODE to dp decimal places, and formatted according to the properties + * of the FORMAT object (see BigNumber.set). + * + * FORMAT = { + * decimalSeparator : '.', + * groupSeparator : ',', + * groupSize : 3, + * secondaryGroupSize : 0, + * fractionGroupSeparator : '\xA0', // non-breaking space + * fractionGroupSize : 0 + * }; + * + * [dp] {number} Decimal places. Integer, 0 to MAX inclusive. + * [rm] {number} Rounding mode. Integer, 0 to 8 inclusive. + * + * '[BigNumber Error] Argument {not a primitive number|not an integer|out of range}: {dp|rm}' + */ + P.toFormat = function (dp, rm) { + var str = this.toFixed(dp, rm); + + if (this.c) { + var i, + arr = str.split('.'), + g1 = +FORMAT.groupSize, + g2 = +FORMAT.secondaryGroupSize, + groupSeparator = FORMAT.groupSeparator, + intPart = arr[0], + fractionPart = arr[1], + isNeg = this.s < 0, + intDigits = isNeg ? intPart.slice(1) : intPart, + len = intDigits.length; + + if (g2) i = g1, g1 = g2, g2 = i, len -= i; + + if (g1 > 0 && len > 0) { + i = len % g1 || g1; + intPart = intDigits.substr(0, i); + + for (; i < len; i += g1) { + intPart += groupSeparator + intDigits.substr(i, g1); + } + + if (g2 > 0) intPart += groupSeparator + intDigits.slice(i); + if (isNeg) intPart = '-' + intPart; + } + + str = fractionPart + ? intPart + FORMAT.decimalSeparator + ((g2 = +FORMAT.fractionGroupSize) + ? fractionPart.replace(new RegExp('\\d{' + g2 + '}\\B', 'g'), + '$&' + FORMAT.fractionGroupSeparator) + : fractionPart) + : intPart; + } + + return str; + }; + + + /* + * Return a string array representing the value of this BigNumber as a simple fraction with + * an integer numerator and an integer denominator. The denominator will be a positive + * non-zero value less than or equal to the specified maximum denominator. If a maximum + * denominator is not specified, the denominator will be the lowest value necessary to + * represent the number exactly. + * + * [md] {number|string|BigNumber} Integer >= 1, or Infinity. The maximum denominator. + * + * '[BigNumber Error] Argument {not an integer|out of range} : {md}' + */ + P.toFraction = function (md) { + var arr, d, d0, d1, d2, e, exp, n, n0, n1, q, s, + x = this, + xc = x.c; + + if (md != null) { + n = new BigNumber(md); + + // Throw if md is less than one or is not an integer, unless it is Infinity. + if (!n.isInteger() && (n.c || n.s !== 1) || n.lt(ONE)) { + throw Error + (bignumberError + 'Argument ' + + (n.isInteger() ? 'out of range: ' : 'not an integer: ') + md); + } + } + + if (!xc) return x.toString(); + + d = new BigNumber(ONE); + n1 = d0 = new BigNumber(ONE); + d1 = n0 = new BigNumber(ONE); + s = coeffToString(xc); + + // Determine initial denominator. + // d is a power of 10 and the minimum max denominator that specifies the value exactly. + e = d.e = s.length - x.e - 1; + d.c[0] = POWS_TEN[(exp = e % LOG_BASE) < 0 ? LOG_BASE + exp : exp]; + md = !md || n.comparedTo(d) > 0 ? (e > 0 ? d : n1) : n; + + exp = MAX_EXP; + MAX_EXP = 1 / 0; + n = new BigNumber(s); + + // n0 = d1 = 0 + n0.c[0] = 0; + + for (; ;) { + q = div(n, d, 0, 1); + d2 = d0.plus(q.times(d1)); + if (d2.comparedTo(md) == 1) break; + d0 = d1; + d1 = d2; + n1 = n0.plus(q.times(d2 = n1)); + n0 = d2; + d = n.minus(q.times(d2 = d)); + n = d2; + } + + d2 = div(md.minus(d0), d1, 0, 1); + n0 = n0.plus(d2.times(n1)); + d0 = d0.plus(d2.times(d1)); + n0.s = n1.s = x.s; + e *= 2; + + // Determine which fraction is closer to x, n0/d0 or n1/d1 + arr = div(n1, d1, e, ROUNDING_MODE).minus(x).abs().comparedTo( + div(n0, d0, e, ROUNDING_MODE).minus(x).abs()) < 1 + ? [n1.toString(), d1.toString()] + : [n0.toString(), d0.toString()]; + + MAX_EXP = exp; + return arr; + }; + + + /* + * Return the value of this BigNumber converted to a number primitive. + */ + P.toNumber = function () { + return +this; + }; + + + /* + * Return a string representing the value of this BigNumber rounded to sd significant digits + * using rounding mode rm or ROUNDING_MODE. If sd is less than the number of digits + * necessary to represent the integer part of the value in fixed-point notation, then use + * exponential notation. + * + * [sd] {number} Significant digits. Integer, 1 to MAX inclusive. + * [rm] {number} Rounding mode. Integer, 0 to 8 inclusive. + * + * '[BigNumber Error] Argument {not a primitive number|not an integer|out of range}: {sd|rm}' + */ + P.toPrecision = function (sd, rm) { + if (sd != null) intCheck(sd, 1, MAX); + return format(this, sd, rm, 2); + }; + + + /* + * Return a string representing the value of this BigNumber in base b, or base 10 if b is + * omitted. If a base is specified, including base 10, round according to DECIMAL_PLACES and + * ROUNDING_MODE. If a base is not specified, and this BigNumber has a positive exponent + * that is equal to or greater than TO_EXP_POS, or a negative exponent equal to or less than + * TO_EXP_NEG, return exponential notation. + * + * [b] {number} Integer, 2 to ALPHABET.length inclusive. + * + * '[BigNumber Error] Base {not a primitive number|not an integer|out of range}: {b}' + */ + P.toString = function (b) { + var str, + n = this, + s = n.s, + e = n.e; + + // Infinity or NaN? + if (e === null) { + + if (s) { + str = 'Infinity'; + if (s < 0) str = '-' + str; + } else { + str = 'NaN'; + } + } else { + str = coeffToString(n.c); + + if (b == null) { + str = e <= TO_EXP_NEG || e >= TO_EXP_POS + ? toExponential(str, e) + : toFixedPoint(str, e, '0'); + } else { + intCheck(b, 2, ALPHABET.length, 'Base'); + str = convertBase(toFixedPoint(str, e, '0'), 10, b, s, true); + } + + if (s < 0 && n.c[0]) str = '-' + str; + } + + return str; + }; + + + /* + * Return as toString, but do not accept a base argument, and include the minus sign for + * negative zero. + */ + P.valueOf = P.toJSON = function () { + var str, + n = this, + e = n.e; + + if (e === null) return n.toString(); + + str = coeffToString(n.c); + + str = e <= TO_EXP_NEG || e >= TO_EXP_POS + ? toExponential(str, e) + : toFixedPoint(str, e, '0'); + + return n.s < 0 ? '-' + str : str; + }; + + + P._isBigNumber = true; + + if (configObject != null) BigNumber.set(configObject); + + return BigNumber; + } + + + // PRIVATE HELPER FUNCTIONS + + + function bitFloor(n) { + var i = n | 0; + return n > 0 || n === i ? i : i - 1; + } + + + // Return a coefficient array as a string of base 10 digits. + function coeffToString(a) { + var s, z, + i = 1, + j = a.length, + r = a[0] + ''; + + for (; i < j;) { + s = a[i++] + ''; + z = LOG_BASE - s.length; + for (; z--; s = '0' + s); + r += s; + } + + // Determine trailing zeros. + for (j = r.length; r.charCodeAt(--j) === 48;); + return r.slice(0, j + 1 || 1); + } + + + // Compare the value of BigNumbers x and y. + function compare(x, y) { + var a, b, + xc = x.c, + yc = y.c, + i = x.s, + j = y.s, + k = x.e, + l = y.e; + + // Either NaN? + if (!i || !j) return null; + + a = xc && !xc[0]; + b = yc && !yc[0]; + + // Either zero? + if (a || b) return a ? b ? 0 : -j : i; + + // Signs differ? + if (i != j) return i; + + a = i < 0; + b = k == l; + + // Either Infinity? + if (!xc || !yc) return b ? 0 : !xc ^ a ? 1 : -1; + + // Compare exponents. + if (!b) return k > l ^ a ? 1 : -1; + + j = (k = xc.length) < (l = yc.length) ? k : l; + + // Compare digit by digit. + for (i = 0; i < j; i++) if (xc[i] != yc[i]) return xc[i] > yc[i] ^ a ? 1 : -1; + + // Compare lengths. + return k == l ? 0 : k > l ^ a ? 1 : -1; + } + + + /* + * Check that n is a primitive number, an integer, and in range, otherwise throw. + */ + function intCheck(n, min, max, name) { + if (n < min || n > max || n !== (n < 0 ? mathceil(n) : mathfloor(n))) { + throw Error + (bignumberError + (name || 'Argument') + (typeof n == 'number' + ? n < min || n > max ? ' out of range: ' : ' not an integer: ' + : ' not a primitive number: ') + n); + } + } + + + function isArray(obj) { + return Object.prototype.toString.call(obj) == '[object Array]'; + } + + + // Assumes finite n. + function isOdd(n) { + var k = n.c.length - 1; + return bitFloor(n.e / LOG_BASE) == k && n.c[k] % 2 != 0; + } + + + function toExponential(str, e) { + return (str.length > 1 ? str.charAt(0) + '.' + str.slice(1) : str) + + (e < 0 ? 'e' : 'e+') + e; + } + + + function toFixedPoint(str, e, z) { + var len, zs; + + // Negative exponent? + if (e < 0) { + + // Prepend zeros. + for (zs = z + '.'; ++e; zs += z); + str = zs + str; + + // Positive exponent + } else { + len = str.length; + + // Append zeros. + if (++e > len) { + for (zs = z, e -= len; --e; zs += z); + str += zs; + } else if (e < len) { + str = str.slice(0, e) + '.' + str.slice(e); + } + } + + return str; + } + + + // EXPORT + + + BigNumber = clone(); + BigNumber['default'] = BigNumber.BigNumber = BigNumber; + + // AMD. + if (typeof undefined == 'function' && undefined.amd) { + undefined(function () { return BigNumber; }); + + // Node.js and other environments that support module.exports. + } else if ('object' != 'undefined' && module.exports) { + module.exports = BigNumber; + + // Browser. + } else { + if (!globalObject) { + globalObject = typeof self != 'undefined' && self ? self : window; + } + + globalObject.BigNumber = BigNumber; + } +})(commonjsGlobal); +}); + +var constants = createCommonjsModule(function (module, exports) { +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +class Constants { +} +Constants.SYS_NUM_CARDINAL = "builtin.num.cardinal"; +Constants.SYS_NUM_DOUBLE = "builtin.num.double"; +Constants.SYS_NUM_FRACTION = "builtin.num.fraction"; +Constants.SYS_NUM_INTEGER = "builtin.num.integer"; +Constants.SYS_NUM = "builtin.num"; +Constants.SYS_NUM_ORDINAL = "builtin.num.ordinal"; +Constants.SYS_NUM_PERCENTAGE = "builtin.num.percentage"; +// NARROW NO-BREAK SPACE +Constants.NO_BREAK_SPACE = '\u202f'; +exports.Constants = Constants; + +}); + +unwrapExports(constants); + +var models$2 = createCommonjsModule(function (module, exports) { +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); + +var NumberMode; +(function (NumberMode) { + // Default is for unit and datetime + NumberMode[NumberMode["Default"] = 0] = "Default"; + // Add 67.5 billion & million support. + NumberMode[NumberMode["Currency"] = 1] = "Currency"; + // Don't extract number from cases like 16ml + NumberMode[NumberMode["PureNumber"] = 2] = "PureNumber"; +})(NumberMode = exports.NumberMode || (exports.NumberMode = {})); +class LongFormatType { + constructor(thousandsMark, decimalsMark) { + this.thousandsMark = thousandsMark; + this.decimalsMark = decimalsMark; + } +} +// Reference : https://www.wikiwand.com/en/Decimal_mark +// Value : 1234567.89 +// 1,234,567 +LongFormatType.integerNumComma = new LongFormatType(',', '\0'); +// 1.234.567 +LongFormatType.integerNumDot = new LongFormatType('.', '\0'); +// 1 234 567 +LongFormatType.integerNumBlank = new LongFormatType(' ', '\0'); +// 1 234 567 +LongFormatType.integerNumNoBreakSpace = new LongFormatType(constants.Constants.NO_BREAK_SPACE, '\0'); +// 1'234'567 +LongFormatType.integerNumQuote = new LongFormatType('\'', '\0'); +// 1,234,567.89 +LongFormatType.doubleNumCommaDot = new LongFormatType(',', '.'); +// 1,234,567·89 +LongFormatType.doubleNumCommaCdot = new LongFormatType(',', '·'); +// 1 234 567,89 +LongFormatType.doubleNumBlankComma = new LongFormatType(' ', ','); +// 1 234 567,89 +LongFormatType.doubleNumNoBreakSpaceComma = new LongFormatType(constants.Constants.NO_BREAK_SPACE, ','); +// 1 234 567.89 +LongFormatType.doubleNumBlankDot = new LongFormatType(' ', '.'); +// 1 234 567.89 +LongFormatType.doubleNumNoBreakSpaceDot = new LongFormatType(constants.Constants.NO_BREAK_SPACE, '.'); +// 1.234.567,89 +LongFormatType.doubleNumDotComma = new LongFormatType('.', ','); +// 1'234'567,89 +LongFormatType.doubleNumQuoteComma = new LongFormatType('\'', ','); +exports.LongFormatType = LongFormatType; +class AbstractNumberModel { + constructor(parser, extractor) { + this.extractor = extractor; + this.parser = parser; + } + parse(query) { + let extractResults = this.extractor.extract(query); + let parseNums = extractResults.map(r => this.parser.parse(r)); + return parseNums + .map(o => o) + .map(o => ({ + start: o.start, + end: o.start + o.length - 1, + resolution: { value: o.resolutionStr }, + text: o.text, + typeName: this.modelTypeName + })); + } +} +exports.AbstractNumberModel = AbstractNumberModel; +class NumberModel extends AbstractNumberModel { + constructor() { + super(...arguments); + this.modelTypeName = "number"; + } +} +exports.NumberModel = NumberModel; +class OrdinalModel extends AbstractNumberModel { + constructor() { + super(...arguments); + this.modelTypeName = "ordinal"; + } +} +exports.OrdinalModel = OrdinalModel; +class PercentModel extends AbstractNumberModel { + constructor() { + super(...arguments); + this.modelTypeName = "percentage"; + } +} +exports.PercentModel = PercentModel; + +}); + +unwrapExports(models$2); + +var culture$2 = createCommonjsModule(function (module, exports) { +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); + + + + +class Culture extends recognizersText.Culture { + constructor(cultureName, cultureCode, longFormat) { + super(cultureName, cultureCode); + this.longFormat = longFormat; + } +} +Culture.supportedCultures = [ + new Culture("English", Culture.English, new models$2.LongFormatType(',', '.')), + new Culture("Chinese", Culture.Chinese, null), + new Culture("Spanish", Culture.Spanish, new models$2.LongFormatType('.', ',')), + new Culture("Portuguese", Culture.Portuguese, new models$2.LongFormatType('.', ',')), + new Culture("French", Culture.French, new models$2.LongFormatType('.', ',')), + new Culture("Japanese", Culture.Japanese, new models$2.LongFormatType(',', '.')) +]; +exports.Culture = Culture; +class CultureInfo extends recognizersText.CultureInfo { + format(value) { + let bigNumber = new bignumber.BigNumber(value); + let s; + if (bigNumber.decimalPlaces()) { + s = bigNumber.precision(15, bignumber.BigNumber.ROUND_HALF_UP).toString(); + } + else { + s = bigNumber.toString().toUpperCase(); + } + if (s.indexOf('.') > -1) { + // trim leading 0 from decimal places + s = lodash_trimend(s, '0'); + } + if (s.indexOf('e-') > -1) { + // mimic .NET behavior by adding leading 0 to exponential. E.g.: 1E-07 + let p = s.split('e-'); + p[1] = p[1].length === 1 ? ('0' + p[1]) : p[1]; + s = p.join('E-'); + } + // TODO: Use BigNumber.toFormat instead + let culture = Culture.supportedCultures.find(c => c.cultureCode === this.code); + if (culture && culture.longFormat) { + return s + .split(',') + .map(t => t.split('.').join(culture.longFormat.decimalsMark)) + .join(culture.longFormat.thousandsMark); + } + return s; + } +} +exports.CultureInfo = CultureInfo; + +}); + +unwrapExports(culture$2); + +var lodash_sortby = createCommonjsModule(function (module, exports) { +/** + * lodash (Custom Build) + * Build: `lodash modularize exports="npm" -o ./` + * Copyright jQuery Foundation and other contributors + * Released under MIT license + * Based on Underscore.js 1.8.3 + * Copyright Jeremy Ashkenas, DocumentCloud and Investigative Reporters & Editors + */ + +/** Used as the size to enable large array optimizations. */ +var LARGE_ARRAY_SIZE = 200; + +/** Used as the `TypeError` message for "Functions" methods. */ +var FUNC_ERROR_TEXT = 'Expected a function'; + +/** Used to stand-in for `undefined` hash values. */ +var HASH_UNDEFINED = '__lodash_hash_undefined__'; + +/** Used to compose bitmasks for comparison styles. */ +var UNORDERED_COMPARE_FLAG = 1, + PARTIAL_COMPARE_FLAG = 2; + +/** Used as references for various `Number` constants. */ +var INFINITY = 1 / 0, + MAX_SAFE_INTEGER = 9007199254740991; + +/** `Object#toString` result references. */ +var argsTag = '[object Arguments]', + arrayTag = '[object Array]', + boolTag = '[object Boolean]', + dateTag = '[object Date]', + errorTag = '[object Error]', + funcTag = '[object Function]', + genTag = '[object GeneratorFunction]', + mapTag = '[object Map]', + numberTag = '[object Number]', + objectTag = '[object Object]', + promiseTag = '[object Promise]', + regexpTag = '[object RegExp]', + setTag = '[object Set]', + stringTag = '[object String]', + symbolTag = '[object Symbol]', + weakMapTag = '[object WeakMap]'; + +var arrayBufferTag = '[object ArrayBuffer]', + dataViewTag = '[object DataView]', + float32Tag = '[object Float32Array]', + float64Tag = '[object Float64Array]', + int8Tag = '[object Int8Array]', + int16Tag = '[object Int16Array]', + int32Tag = '[object Int32Array]', + uint8Tag = '[object Uint8Array]', + uint8ClampedTag = '[object Uint8ClampedArray]', + uint16Tag = '[object Uint16Array]', + uint32Tag = '[object Uint32Array]'; + +/** Used to match property names within property paths. */ +var reIsDeepProp = /\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/, + reIsPlainProp = /^\w*$/, + reLeadingDot = /^\./, + rePropName = /[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g; + +/** + * Used to match `RegExp` + * [syntax characters](http://ecma-international.org/ecma-262/7.0/#sec-patterns). + */ +var reRegExpChar = /[\\^$.*+?()[\]{}|]/g; + +/** Used to match backslashes in property paths. */ +var reEscapeChar = /\\(\\)?/g; + +/** Used to detect host constructors (Safari). */ +var reIsHostCtor = /^\[object .+?Constructor\]$/; + +/** Used to detect unsigned integer values. */ +var reIsUint = /^(?:0|[1-9]\d*)$/; + +/** Used to identify `toStringTag` values of typed arrays. */ +var typedArrayTags = {}; +typedArrayTags[float32Tag] = typedArrayTags[float64Tag] = +typedArrayTags[int8Tag] = typedArrayTags[int16Tag] = +typedArrayTags[int32Tag] = typedArrayTags[uint8Tag] = +typedArrayTags[uint8ClampedTag] = typedArrayTags[uint16Tag] = +typedArrayTags[uint32Tag] = true; +typedArrayTags[argsTag] = typedArrayTags[arrayTag] = +typedArrayTags[arrayBufferTag] = typedArrayTags[boolTag] = +typedArrayTags[dataViewTag] = typedArrayTags[dateTag] = +typedArrayTags[errorTag] = typedArrayTags[funcTag] = +typedArrayTags[mapTag] = typedArrayTags[numberTag] = +typedArrayTags[objectTag] = typedArrayTags[regexpTag] = +typedArrayTags[setTag] = typedArrayTags[stringTag] = +typedArrayTags[weakMapTag] = false; + +/** Detect free variable `global` from Node.js. */ +var freeGlobal = typeof commonjsGlobal == 'object' && commonjsGlobal && commonjsGlobal.Object === Object && commonjsGlobal; + +/** Detect free variable `self`. */ +var freeSelf = typeof self == 'object' && self && self.Object === Object && self; + +/** Used as a reference to the global object. */ +var root = freeGlobal || freeSelf || Function('return this')(); + +/** Detect free variable `exports`. */ +var freeExports = 'object' == 'object' && exports && !exports.nodeType && exports; + +/** Detect free variable `module`. */ +var freeModule = freeExports && 'object' == 'object' && module && !module.nodeType && module; + +/** Detect the popular CommonJS extension `module.exports`. */ +var moduleExports = freeModule && freeModule.exports === freeExports; + +/** Detect free variable `process` from Node.js. */ +var freeProcess = moduleExports && freeGlobal.process; + +/** Used to access faster Node.js helpers. */ +var nodeUtil = (function() { + try { + return freeProcess && freeProcess.binding('util'); + } catch (e) {} +}()); + +/* Node.js helper references. */ +var nodeIsTypedArray = nodeUtil && nodeUtil.isTypedArray; + +/** + * A faster alternative to `Function#apply`, this function invokes `func` + * with the `this` binding of `thisArg` and the arguments of `args`. + * + * @private + * @param {Function} func The function to invoke. + * @param {*} thisArg The `this` binding of `func`. + * @param {Array} args The arguments to invoke `func` with. + * @returns {*} Returns the result of `func`. + */ +function apply(func, thisArg, args) { + switch (args.length) { + case 0: return func.call(thisArg); + case 1: return func.call(thisArg, args[0]); + case 2: return func.call(thisArg, args[0], args[1]); + case 3: return func.call(thisArg, args[0], args[1], args[2]); + } + return func.apply(thisArg, args); +} + +/** + * A specialized version of `_.map` for arrays without support for iteratee + * shorthands. + * + * @private + * @param {Array} [array] The array to iterate over. + * @param {Function} iteratee The function invoked per iteration. + * @returns {Array} Returns the new mapped array. + */ +function arrayMap(array, iteratee) { + var index = -1, + length = array ? array.length : 0, + result = Array(length); + + while (++index < length) { + result[index] = iteratee(array[index], index, array); + } + return result; +} + +/** + * Appends the elements of `values` to `array`. + * + * @private + * @param {Array} array The array to modify. + * @param {Array} values The values to append. + * @returns {Array} Returns `array`. + */ +function arrayPush(array, values) { + var index = -1, + length = values.length, + offset = array.length; + + while (++index < length) { + array[offset + index] = values[index]; + } + return array; +} + +/** + * A specialized version of `_.some` for arrays without support for iteratee + * shorthands. + * + * @private + * @param {Array} [array] The array to iterate over. + * @param {Function} predicate The function invoked per iteration. + * @returns {boolean} Returns `true` if any element passes the predicate check, + * else `false`. + */ +function arraySome(array, predicate) { + var index = -1, + length = array ? array.length : 0; + + while (++index < length) { + if (predicate(array[index], index, array)) { + return true; + } + } + return false; +} + +/** + * The base implementation of `_.property` without support for deep paths. + * + * @private + * @param {string} key The key of the property to get. + * @returns {Function} Returns the new accessor function. + */ +function baseProperty(key) { + return function(object) { + return object == null ? undefined : object[key]; + }; +} + +/** + * The base implementation of `_.sortBy` which uses `comparer` to define the + * sort order of `array` and replaces criteria objects with their corresponding + * values. + * + * @private + * @param {Array} array The array to sort. + * @param {Function} comparer The function to define sort order. + * @returns {Array} Returns `array`. + */ +function baseSortBy(array, comparer) { + var length = array.length; + + array.sort(comparer); + while (length--) { + array[length] = array[length].value; + } + return array; +} + +/** + * The base implementation of `_.times` without support for iteratee shorthands + * or max array length checks. + * + * @private + * @param {number} n The number of times to invoke `iteratee`. + * @param {Function} iteratee The function invoked per iteration. + * @returns {Array} Returns the array of results. + */ +function baseTimes(n, iteratee) { + var index = -1, + result = Array(n); + + while (++index < n) { + result[index] = iteratee(index); + } + return result; +} + +/** + * The base implementation of `_.unary` without support for storing metadata. + * + * @private + * @param {Function} func The function to cap arguments for. + * @returns {Function} Returns the new capped function. + */ +function baseUnary(func) { + return function(value) { + return func(value); + }; +} + +/** + * Gets the value at `key` of `object`. + * + * @private + * @param {Object} [object] The object to query. + * @param {string} key The key of the property to get. + * @returns {*} Returns the property value. + */ +function getValue(object, key) { + return object == null ? undefined : object[key]; +} + +/** + * Checks if `value` is a host object in IE < 9. + * + * @private + * @param {*} value The value to check. + * @returns {boolean} Returns `true` if `value` is a host object, else `false`. + */ +function isHostObject(value) { + // Many host objects are `Object` objects that can coerce to strings + // despite having improperly defined `toString` methods. + var result = false; + if (value != null && typeof value.toString != 'function') { + try { + result = !!(value + ''); + } catch (e) {} + } + return result; +} + +/** + * Converts `map` to its key-value pairs. + * + * @private + * @param {Object} map The map to convert. + * @returns {Array} Returns the key-value pairs. + */ +function mapToArray(map) { + var index = -1, + result = Array(map.size); + + map.forEach(function(value, key) { + result[++index] = [key, value]; + }); + return result; +} + +/** + * Creates a unary function that invokes `func` with its argument transformed. + * + * @private + * @param {Function} func The function to wrap. + * @param {Function} transform The argument transform. + * @returns {Function} Returns the new function. + */ +function overArg(func, transform) { + return function(arg) { + return func(transform(arg)); + }; +} + +/** + * Converts `set` to an array of its values. + * + * @private + * @param {Object} set The set to convert. + * @returns {Array} Returns the values. + */ +function setToArray(set) { + var index = -1, + result = Array(set.size); + + set.forEach(function(value) { + result[++index] = value; + }); + return result; +} + +/** Used for built-in method references. */ +var arrayProto = Array.prototype, + funcProto = Function.prototype, + objectProto = Object.prototype; + +/** Used to detect overreaching core-js shims. */ +var coreJsData = root['__core-js_shared__']; + +/** Used to detect methods masquerading as native. */ +var maskSrcKey = (function() { + var uid = /[^.]+$/.exec(coreJsData && coreJsData.keys && coreJsData.keys.IE_PROTO || ''); + return uid ? ('Symbol(src)_1.' + uid) : ''; +}()); + +/** Used to resolve the decompiled source of functions. */ +var funcToString = funcProto.toString; + +/** Used to check objects for own properties. */ +var hasOwnProperty = objectProto.hasOwnProperty; + +/** + * Used to resolve the + * [`toStringTag`](http://ecma-international.org/ecma-262/7.0/#sec-object.prototype.tostring) + * of values. + */ +var objectToString = objectProto.toString; + +/** Used to detect if a method is native. */ +var reIsNative = RegExp('^' + + funcToString.call(hasOwnProperty).replace(reRegExpChar, '\\$&') + .replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g, '$1.*?') + '$' +); + +/** Built-in value references. */ +var Symbol = root.Symbol, + Uint8Array = root.Uint8Array, + propertyIsEnumerable = objectProto.propertyIsEnumerable, + splice = arrayProto.splice, + spreadableSymbol = Symbol ? Symbol.isConcatSpreadable : undefined; + +/* Built-in method references for those with the same name as other `lodash` methods. */ +var nativeKeys = overArg(Object.keys, Object), + nativeMax = Math.max; + +/* Built-in method references that are verified to be native. */ +var DataView = getNative(root, 'DataView'), + Map = getNative(root, 'Map'), + Promise = getNative(root, 'Promise'), + Set = getNative(root, 'Set'), + WeakMap = getNative(root, 'WeakMap'), + nativeCreate = getNative(Object, 'create'); + +/** Used to detect maps, sets, and weakmaps. */ +var dataViewCtorString = toSource(DataView), + mapCtorString = toSource(Map), + promiseCtorString = toSource(Promise), + setCtorString = toSource(Set), + weakMapCtorString = toSource(WeakMap); + +/** Used to convert symbols to primitives and strings. */ +var symbolProto = Symbol ? Symbol.prototype : undefined, + symbolValueOf = symbolProto ? symbolProto.valueOf : undefined, + symbolToString = symbolProto ? symbolProto.toString : undefined; + +/** + * Creates a hash object. + * + * @private + * @constructor + * @param {Array} [entries] The key-value pairs to cache. + */ +function Hash(entries) { + var index = -1, + length = entries ? entries.length : 0; + + this.clear(); + while (++index < length) { + var entry = entries[index]; + this.set(entry[0], entry[1]); + } +} + +/** + * Removes all key-value entries from the hash. + * + * @private + * @name clear + * @memberOf Hash + */ +function hashClear() { + this.__data__ = nativeCreate ? nativeCreate(null) : {}; +} + +/** + * Removes `key` and its value from the hash. + * + * @private + * @name delete + * @memberOf Hash + * @param {Object} hash The hash to modify. + * @param {string} key The key of the value to remove. + * @returns {boolean} Returns `true` if the entry was removed, else `false`. + */ +function hashDelete(key) { + return this.has(key) && delete this.__data__[key]; +} + +/** + * Gets the hash value for `key`. + * + * @private + * @name get + * @memberOf Hash + * @param {string} key The key of the value to get. + * @returns {*} Returns the entry value. + */ +function hashGet(key) { + var data = this.__data__; + if (nativeCreate) { + var result = data[key]; + return result === HASH_UNDEFINED ? undefined : result; + } + return hasOwnProperty.call(data, key) ? data[key] : undefined; +} + +/** + * Checks if a hash value for `key` exists. + * + * @private + * @name has + * @memberOf Hash + * @param {string} key The key of the entry to check. + * @returns {boolean} Returns `true` if an entry for `key` exists, else `false`. + */ +function hashHas(key) { + var data = this.__data__; + return nativeCreate ? data[key] !== undefined : hasOwnProperty.call(data, key); +} + +/** + * Sets the hash `key` to `value`. + * + * @private + * @name set + * @memberOf Hash + * @param {string} key The key of the value to set. + * @param {*} value The value to set. + * @returns {Object} Returns the hash instance. + */ +function hashSet(key, value) { + var data = this.__data__; + data[key] = (nativeCreate && value === undefined) ? HASH_UNDEFINED : value; + return this; +} + +// Add methods to `Hash`. +Hash.prototype.clear = hashClear; +Hash.prototype['delete'] = hashDelete; +Hash.prototype.get = hashGet; +Hash.prototype.has = hashHas; +Hash.prototype.set = hashSet; + +/** + * Creates an list cache object. + * + * @private + * @constructor + * @param {Array} [entries] The key-value pairs to cache. + */ +function ListCache(entries) { + var index = -1, + length = entries ? entries.length : 0; + + this.clear(); + while (++index < length) { + var entry = entries[index]; + this.set(entry[0], entry[1]); + } +} + +/** + * Removes all key-value entries from the list cache. + * + * @private + * @name clear + * @memberOf ListCache + */ +function listCacheClear() { + this.__data__ = []; +} + +/** + * Removes `key` and its value from the list cache. + * + * @private + * @name delete + * @memberOf ListCache + * @param {string} key The key of the value to remove. + * @returns {boolean} Returns `true` if the entry was removed, else `false`. + */ +function listCacheDelete(key) { + var data = this.__data__, + index = assocIndexOf(data, key); + + if (index < 0) { + return false; + } + var lastIndex = data.length - 1; + if (index == lastIndex) { + data.pop(); + } else { + splice.call(data, index, 1); + } + return true; +} + +/** + * Gets the list cache value for `key`. + * + * @private + * @name get + * @memberOf ListCache + * @param {string} key The key of the value to get. + * @returns {*} Returns the entry value. + */ +function listCacheGet(key) { + var data = this.__data__, + index = assocIndexOf(data, key); + + return index < 0 ? undefined : data[index][1]; +} + +/** + * Checks if a list cache value for `key` exists. + * + * @private + * @name has + * @memberOf ListCache + * @param {string} key The key of the entry to check. + * @returns {boolean} Returns `true` if an entry for `key` exists, else `false`. + */ +function listCacheHas(key) { + return assocIndexOf(this.__data__, key) > -1; +} + +/** + * Sets the list cache `key` to `value`. + * + * @private + * @name set + * @memberOf ListCache + * @param {string} key The key of the value to set. + * @param {*} value The value to set. + * @returns {Object} Returns the list cache instance. + */ +function listCacheSet(key, value) { + var data = this.__data__, + index = assocIndexOf(data, key); + + if (index < 0) { + data.push([key, value]); + } else { + data[index][1] = value; + } + return this; +} + +// Add methods to `ListCache`. +ListCache.prototype.clear = listCacheClear; +ListCache.prototype['delete'] = listCacheDelete; +ListCache.prototype.get = listCacheGet; +ListCache.prototype.has = listCacheHas; +ListCache.prototype.set = listCacheSet; + +/** + * Creates a map cache object to store key-value pairs. + * + * @private + * @constructor + * @param {Array} [entries] The key-value pairs to cache. + */ +function MapCache(entries) { + var index = -1, + length = entries ? entries.length : 0; + + this.clear(); + while (++index < length) { + var entry = entries[index]; + this.set(entry[0], entry[1]); + } +} + +/** + * Removes all key-value entries from the map. + * + * @private + * @name clear + * @memberOf MapCache + */ +function mapCacheClear() { + this.__data__ = { + 'hash': new Hash, + 'map': new (Map || ListCache), + 'string': new Hash + }; +} + +/** + * Removes `key` and its value from the map. + * + * @private + * @name delete + * @memberOf MapCache + * @param {string} key The key of the value to remove. + * @returns {boolean} Returns `true` if the entry was removed, else `false`. + */ +function mapCacheDelete(key) { + return getMapData(this, key)['delete'](key); +} + +/** + * Gets the map value for `key`. + * + * @private + * @name get + * @memberOf MapCache + * @param {string} key The key of the value to get. + * @returns {*} Returns the entry value. + */ +function mapCacheGet(key) { + return getMapData(this, key).get(key); +} + +/** + * Checks if a map value for `key` exists. + * + * @private + * @name has + * @memberOf MapCache + * @param {string} key The key of the entry to check. + * @returns {boolean} Returns `true` if an entry for `key` exists, else `false`. + */ +function mapCacheHas(key) { + return getMapData(this, key).has(key); +} + +/** + * Sets the map `key` to `value`. + * + * @private + * @name set + * @memberOf MapCache + * @param {string} key The key of the value to set. + * @param {*} value The value to set. + * @returns {Object} Returns the map cache instance. + */ +function mapCacheSet(key, value) { + getMapData(this, key).set(key, value); + return this; +} + +// Add methods to `MapCache`. +MapCache.prototype.clear = mapCacheClear; +MapCache.prototype['delete'] = mapCacheDelete; +MapCache.prototype.get = mapCacheGet; +MapCache.prototype.has = mapCacheHas; +MapCache.prototype.set = mapCacheSet; + +/** + * + * Creates an array cache object to store unique values. + * + * @private + * @constructor + * @param {Array} [values] The values to cache. + */ +function SetCache(values) { + var index = -1, + length = values ? values.length : 0; + + this.__data__ = new MapCache; + while (++index < length) { + this.add(values[index]); + } +} + +/** + * Adds `value` to the array cache. + * + * @private + * @name add + * @memberOf SetCache + * @alias push + * @param {*} value The value to cache. + * @returns {Object} Returns the cache instance. + */ +function setCacheAdd(value) { + this.__data__.set(value, HASH_UNDEFINED); + return this; +} + +/** + * Checks if `value` is in the array cache. + * + * @private + * @name has + * @memberOf SetCache + * @param {*} value The value to search for. + * @returns {number} Returns `true` if `value` is found, else `false`. + */ +function setCacheHas(value) { + return this.__data__.has(value); +} + +// Add methods to `SetCache`. +SetCache.prototype.add = SetCache.prototype.push = setCacheAdd; +SetCache.prototype.has = setCacheHas; + +/** + * Creates a stack cache object to store key-value pairs. + * + * @private + * @constructor + * @param {Array} [entries] The key-value pairs to cache. + */ +function Stack(entries) { + this.__data__ = new ListCache(entries); +} + +/** + * Removes all key-value entries from the stack. + * + * @private + * @name clear + * @memberOf Stack + */ +function stackClear() { + this.__data__ = new ListCache; +} + +/** + * Removes `key` and its value from the stack. + * + * @private + * @name delete + * @memberOf Stack + * @param {string} key The key of the value to remove. + * @returns {boolean} Returns `true` if the entry was removed, else `false`. + */ +function stackDelete(key) { + return this.__data__['delete'](key); +} + +/** + * Gets the stack value for `key`. + * + * @private + * @name get + * @memberOf Stack + * @param {string} key The key of the value to get. + * @returns {*} Returns the entry value. + */ +function stackGet(key) { + return this.__data__.get(key); +} + +/** + * Checks if a stack value for `key` exists. + * + * @private + * @name has + * @memberOf Stack + * @param {string} key The key of the entry to check. + * @returns {boolean} Returns `true` if an entry for `key` exists, else `false`. + */ +function stackHas(key) { + return this.__data__.has(key); +} + +/** + * Sets the stack `key` to `value`. + * + * @private + * @name set + * @memberOf Stack + * @param {string} key The key of the value to set. + * @param {*} value The value to set. + * @returns {Object} Returns the stack cache instance. + */ +function stackSet(key, value) { + var cache = this.__data__; + if (cache instanceof ListCache) { + var pairs = cache.__data__; + if (!Map || (pairs.length < LARGE_ARRAY_SIZE - 1)) { + pairs.push([key, value]); + return this; + } + cache = this.__data__ = new MapCache(pairs); + } + cache.set(key, value); + return this; +} + +// Add methods to `Stack`. +Stack.prototype.clear = stackClear; +Stack.prototype['delete'] = stackDelete; +Stack.prototype.get = stackGet; +Stack.prototype.has = stackHas; +Stack.prototype.set = stackSet; + +/** + * Creates an array of the enumerable property names of the array-like `value`. + * + * @private + * @param {*} value The value to query. + * @param {boolean} inherited Specify returning inherited property names. + * @returns {Array} Returns the array of property names. + */ +function arrayLikeKeys(value, inherited) { + // Safari 8.1 makes `arguments.callee` enumerable in strict mode. + // Safari 9 makes `arguments.length` enumerable in strict mode. + var result = (isArray(value) || isArguments(value)) + ? baseTimes(value.length, String) + : []; + + var length = result.length, + skipIndexes = !!length; + + for (var key in value) { + if ((inherited || hasOwnProperty.call(value, key)) && + !(skipIndexes && (key == 'length' || isIndex(key, length)))) { + result.push(key); + } + } + return result; +} + +/** + * Gets the index at which the `key` is found in `array` of key-value pairs. + * + * @private + * @param {Array} array The array to inspect. + * @param {*} key The key to search for. + * @returns {number} Returns the index of the matched value, else `-1`. + */ +function assocIndexOf(array, key) { + var length = array.length; + while (length--) { + if (eq(array[length][0], key)) { + return length; + } + } + return -1; +} + +/** + * The base implementation of `_.forEach` without support for iteratee shorthands. + * + * @private + * @param {Array|Object} collection The collection to iterate over. + * @param {Function} iteratee The function invoked per iteration. + * @returns {Array|Object} Returns `collection`. + */ +var baseEach = createBaseEach(baseForOwn); + +/** + * The base implementation of `_.flatten` with support for restricting flattening. + * + * @private + * @param {Array} array The array to flatten. + * @param {number} depth The maximum recursion depth. + * @param {boolean} [predicate=isFlattenable] The function invoked per iteration. + * @param {boolean} [isStrict] Restrict to values that pass `predicate` checks. + * @param {Array} [result=[]] The initial result value. + * @returns {Array} Returns the new flattened array. + */ +function baseFlatten(array, depth, predicate, isStrict, result) { + var index = -1, + length = array.length; + + predicate || (predicate = isFlattenable); + result || (result = []); + + while (++index < length) { + var value = array[index]; + if (depth > 0 && predicate(value)) { + if (depth > 1) { + // Recursively flatten arrays (susceptible to call stack limits). + baseFlatten(value, depth - 1, predicate, isStrict, result); + } else { + arrayPush(result, value); + } + } else if (!isStrict) { + result[result.length] = value; + } + } + return result; +} + +/** + * The base implementation of `baseForOwn` which iterates over `object` + * properties returned by `keysFunc` and invokes `iteratee` for each property. + * Iteratee functions may exit iteration early by explicitly returning `false`. + * + * @private + * @param {Object} object The object to iterate over. + * @param {Function} iteratee The function invoked per iteration. + * @param {Function} keysFunc The function to get the keys of `object`. + * @returns {Object} Returns `object`. + */ +var baseFor = createBaseFor(); + +/** + * The base implementation of `_.forOwn` without support for iteratee shorthands. + * + * @private + * @param {Object} object The object to iterate over. + * @param {Function} iteratee The function invoked per iteration. + * @returns {Object} Returns `object`. + */ +function baseForOwn(object, iteratee) { + return object && baseFor(object, iteratee, keys); +} + +/** + * The base implementation of `_.get` without support for default values. + * + * @private + * @param {Object} object The object to query. + * @param {Array|string} path The path of the property to get. + * @returns {*} Returns the resolved value. + */ +function baseGet(object, path) { + path = isKey(path, object) ? [path] : castPath(path); + + var index = 0, + length = path.length; + + while (object != null && index < length) { + object = object[toKey(path[index++])]; + } + return (index && index == length) ? object : undefined; +} + +/** + * The base implementation of `getTag`. + * + * @private + * @param {*} value The value to query. + * @returns {string} Returns the `toStringTag`. + */ +function baseGetTag(value) { + return objectToString.call(value); +} + +/** + * The base implementation of `_.hasIn` without support for deep paths. + * + * @private + * @param {Object} [object] The object to query. + * @param {Array|string} key The key to check. + * @returns {boolean} Returns `true` if `key` exists, else `false`. + */ +function baseHasIn(object, key) { + return object != null && key in Object(object); +} + +/** + * The base implementation of `_.isEqual` which supports partial comparisons + * and tracks traversed objects. + * + * @private + * @param {*} value The value to compare. + * @param {*} other The other value to compare. + * @param {Function} [customizer] The function to customize comparisons. + * @param {boolean} [bitmask] The bitmask of comparison flags. + * The bitmask may be composed of the following flags: + * 1 - Unordered comparison + * 2 - Partial comparison + * @param {Object} [stack] Tracks traversed `value` and `other` objects. + * @returns {boolean} Returns `true` if the values are equivalent, else `false`. + */ +function baseIsEqual(value, other, customizer, bitmask, stack) { + if (value === other) { + return true; + } + if (value == null || other == null || (!isObject(value) && !isObjectLike(other))) { + return value !== value && other !== other; + } + return baseIsEqualDeep(value, other, baseIsEqual, customizer, bitmask, stack); +} + +/** + * A specialized version of `baseIsEqual` for arrays and objects which performs + * deep comparisons and tracks traversed objects enabling objects with circular + * references to be compared. + * + * @private + * @param {Object} object The object to compare. + * @param {Object} other The other object to compare. + * @param {Function} equalFunc The function to determine equivalents of values. + * @param {Function} [customizer] The function to customize comparisons. + * @param {number} [bitmask] The bitmask of comparison flags. See `baseIsEqual` + * for more details. + * @param {Object} [stack] Tracks traversed `object` and `other` objects. + * @returns {boolean} Returns `true` if the objects are equivalent, else `false`. + */ +function baseIsEqualDeep(object, other, equalFunc, customizer, bitmask, stack) { + var objIsArr = isArray(object), + othIsArr = isArray(other), + objTag = arrayTag, + othTag = arrayTag; + + if (!objIsArr) { + objTag = getTag(object); + objTag = objTag == argsTag ? objectTag : objTag; + } + if (!othIsArr) { + othTag = getTag(other); + othTag = othTag == argsTag ? objectTag : othTag; + } + var objIsObj = objTag == objectTag && !isHostObject(object), + othIsObj = othTag == objectTag && !isHostObject(other), + isSameTag = objTag == othTag; + + if (isSameTag && !objIsObj) { + stack || (stack = new Stack); + return (objIsArr || isTypedArray(object)) + ? equalArrays(object, other, equalFunc, customizer, bitmask, stack) + : equalByTag(object, other, objTag, equalFunc, customizer, bitmask, stack); + } + if (!(bitmask & PARTIAL_COMPARE_FLAG)) { + var objIsWrapped = objIsObj && hasOwnProperty.call(object, '__wrapped__'), + othIsWrapped = othIsObj && hasOwnProperty.call(other, '__wrapped__'); + + if (objIsWrapped || othIsWrapped) { + var objUnwrapped = objIsWrapped ? object.value() : object, + othUnwrapped = othIsWrapped ? other.value() : other; + + stack || (stack = new Stack); + return equalFunc(objUnwrapped, othUnwrapped, customizer, bitmask, stack); + } + } + if (!isSameTag) { + return false; + } + stack || (stack = new Stack); + return equalObjects(object, other, equalFunc, customizer, bitmask, stack); +} + +/** + * The base implementation of `_.isMatch` without support for iteratee shorthands. + * + * @private + * @param {Object} object The object to inspect. + * @param {Object} source The object of property values to match. + * @param {Array} matchData The property names, values, and compare flags to match. + * @param {Function} [customizer] The function to customize comparisons. + * @returns {boolean} Returns `true` if `object` is a match, else `false`. + */ +function baseIsMatch(object, source, matchData, customizer) { + var index = matchData.length, + length = index, + noCustomizer = !customizer; + + if (object == null) { + return !length; + } + object = Object(object); + while (index--) { + var data = matchData[index]; + if ((noCustomizer && data[2]) + ? data[1] !== object[data[0]] + : !(data[0] in object) + ) { + return false; + } + } + while (++index < length) { + data = matchData[index]; + var key = data[0], + objValue = object[key], + srcValue = data[1]; + + if (noCustomizer && data[2]) { + if (objValue === undefined && !(key in object)) { + return false; + } + } else { + var stack = new Stack; + if (customizer) { + var result = customizer(objValue, srcValue, key, object, source, stack); + } + if (!(result === undefined + ? baseIsEqual(srcValue, objValue, customizer, UNORDERED_COMPARE_FLAG | PARTIAL_COMPARE_FLAG, stack) + : result + )) { + return false; + } + } + } + return true; +} + +/** + * The base implementation of `_.isNative` without bad shim checks. + * + * @private + * @param {*} value The value to check. + * @returns {boolean} Returns `true` if `value` is a native function, + * else `false`. + */ +function baseIsNative(value) { + if (!isObject(value) || isMasked(value)) { + return false; + } + var pattern = (isFunction(value) || isHostObject(value)) ? reIsNative : reIsHostCtor; + return pattern.test(toSource(value)); +} + +/** + * The base implementation of `_.isTypedArray` without Node.js optimizations. + * + * @private + * @param {*} value The value to check. + * @returns {boolean} Returns `true` if `value` is a typed array, else `false`. + */ +function baseIsTypedArray(value) { + return isObjectLike(value) && + isLength(value.length) && !!typedArrayTags[objectToString.call(value)]; +} + +/** + * The base implementation of `_.iteratee`. + * + * @private + * @param {*} [value=_.identity] The value to convert to an iteratee. + * @returns {Function} Returns the iteratee. + */ +function baseIteratee(value) { + // Don't store the `typeof` result in a variable to avoid a JIT bug in Safari 9. + // See https://bugs.webkit.org/show_bug.cgi?id=156034 for more details. + if (typeof value == 'function') { + return value; + } + if (value == null) { + return identity; + } + if (typeof value == 'object') { + return isArray(value) + ? baseMatchesProperty(value[0], value[1]) + : baseMatches(value); + } + return property(value); +} + +/** + * The base implementation of `_.keys` which doesn't treat sparse arrays as dense. + * + * @private + * @param {Object} object The object to query. + * @returns {Array} Returns the array of property names. + */ +function baseKeys(object) { + if (!isPrototype(object)) { + return nativeKeys(object); + } + var result = []; + for (var key in Object(object)) { + if (hasOwnProperty.call(object, key) && key != 'constructor') { + result.push(key); + } + } + return result; +} + +/** + * The base implementation of `_.map` without support for iteratee shorthands. + * + * @private + * @param {Array|Object} collection The collection to iterate over. + * @param {Function} iteratee The function invoked per iteration. + * @returns {Array} Returns the new mapped array. + */ +function baseMap(collection, iteratee) { + var index = -1, + result = isArrayLike(collection) ? Array(collection.length) : []; + + baseEach(collection, function(value, key, collection) { + result[++index] = iteratee(value, key, collection); + }); + return result; +} + +/** + * The base implementation of `_.matches` which doesn't clone `source`. + * + * @private + * @param {Object} source The object of property values to match. + * @returns {Function} Returns the new spec function. + */ +function baseMatches(source) { + var matchData = getMatchData(source); + if (matchData.length == 1 && matchData[0][2]) { + return matchesStrictComparable(matchData[0][0], matchData[0][1]); + } + return function(object) { + return object === source || baseIsMatch(object, source, matchData); + }; +} + +/** + * The base implementation of `_.matchesProperty` which doesn't clone `srcValue`. + * + * @private + * @param {string} path The path of the property to get. + * @param {*} srcValue The value to match. + * @returns {Function} Returns the new spec function. + */ +function baseMatchesProperty(path, srcValue) { + if (isKey(path) && isStrictComparable(srcValue)) { + return matchesStrictComparable(toKey(path), srcValue); + } + return function(object) { + var objValue = get(object, path); + return (objValue === undefined && objValue === srcValue) + ? hasIn(object, path) + : baseIsEqual(srcValue, objValue, undefined, UNORDERED_COMPARE_FLAG | PARTIAL_COMPARE_FLAG); + }; +} + +/** + * The base implementation of `_.orderBy` without param guards. + * + * @private + * @param {Array|Object} collection The collection to iterate over. + * @param {Function[]|Object[]|string[]} iteratees The iteratees to sort by. + * @param {string[]} orders The sort orders of `iteratees`. + * @returns {Array} Returns the new sorted array. + */ +function baseOrderBy(collection, iteratees, orders) { + var index = -1; + iteratees = arrayMap(iteratees.length ? iteratees : [identity], baseUnary(baseIteratee)); + + var result = baseMap(collection, function(value, key, collection) { + var criteria = arrayMap(iteratees, function(iteratee) { + return iteratee(value); + }); + return { 'criteria': criteria, 'index': ++index, 'value': value }; + }); + + return baseSortBy(result, function(object, other) { + return compareMultiple(object, other, orders); + }); +} + +/** + * A specialized version of `baseProperty` which supports deep paths. + * + * @private + * @param {Array|string} path The path of the property to get. + * @returns {Function} Returns the new accessor function. + */ +function basePropertyDeep(path) { + return function(object) { + return baseGet(object, path); + }; +} + +/** + * The base implementation of `_.rest` which doesn't validate or coerce arguments. + * + * @private + * @param {Function} func The function to apply a rest parameter to. + * @param {number} [start=func.length-1] The start position of the rest parameter. + * @returns {Function} Returns the new function. + */ +function baseRest(func, start) { + start = nativeMax(start === undefined ? (func.length - 1) : start, 0); + return function() { + var args = arguments, + index = -1, + length = nativeMax(args.length - start, 0), + array = Array(length); + + while (++index < length) { + array[index] = args[start + index]; + } + index = -1; + var otherArgs = Array(start + 1); + while (++index < start) { + otherArgs[index] = args[index]; + } + otherArgs[start] = array; + return apply(func, this, otherArgs); + }; +} + +/** + * The base implementation of `_.toString` which doesn't convert nullish + * values to empty strings. + * + * @private + * @param {*} value The value to process. + * @returns {string} Returns the string. + */ +function baseToString(value) { + // Exit early for strings to avoid a performance hit in some environments. + if (typeof value == 'string') { + return value; + } + if (isSymbol(value)) { + return symbolToString ? symbolToString.call(value) : ''; + } + var result = (value + ''); + return (result == '0' && (1 / value) == -INFINITY) ? '-0' : result; +} + +/** + * Casts `value` to a path array if it's not one. + * + * @private + * @param {*} value The value to inspect. + * @returns {Array} Returns the cast property path array. + */ +function castPath(value) { + return isArray(value) ? value : stringToPath(value); +} + +/** + * Compares values to sort them in ascending order. + * + * @private + * @param {*} value The value to compare. + * @param {*} other The other value to compare. + * @returns {number} Returns the sort order indicator for `value`. + */ +function compareAscending(value, other) { + if (value !== other) { + var valIsDefined = value !== undefined, + valIsNull = value === null, + valIsReflexive = value === value, + valIsSymbol = isSymbol(value); + + var othIsDefined = other !== undefined, + othIsNull = other === null, + othIsReflexive = other === other, + othIsSymbol = isSymbol(other); + + if ((!othIsNull && !othIsSymbol && !valIsSymbol && value > other) || + (valIsSymbol && othIsDefined && othIsReflexive && !othIsNull && !othIsSymbol) || + (valIsNull && othIsDefined && othIsReflexive) || + (!valIsDefined && othIsReflexive) || + !valIsReflexive) { + return 1; + } + if ((!valIsNull && !valIsSymbol && !othIsSymbol && value < other) || + (othIsSymbol && valIsDefined && valIsReflexive && !valIsNull && !valIsSymbol) || + (othIsNull && valIsDefined && valIsReflexive) || + (!othIsDefined && valIsReflexive) || + !othIsReflexive) { + return -1; + } + } + return 0; +} + +/** + * Used by `_.orderBy` to compare multiple properties of a value to another + * and stable sort them. + * + * If `orders` is unspecified, all values are sorted in ascending order. Otherwise, + * specify an order of "desc" for descending or "asc" for ascending sort order + * of corresponding values. + * + * @private + * @param {Object} object The object to compare. + * @param {Object} other The other object to compare. + * @param {boolean[]|string[]} orders The order to sort by for each property. + * @returns {number} Returns the sort order indicator for `object`. + */ +function compareMultiple(object, other, orders) { + var index = -1, + objCriteria = object.criteria, + othCriteria = other.criteria, + length = objCriteria.length, + ordersLength = orders.length; + + while (++index < length) { + var result = compareAscending(objCriteria[index], othCriteria[index]); + if (result) { + if (index >= ordersLength) { + return result; + } + var order = orders[index]; + return result * (order == 'desc' ? -1 : 1); + } + } + // Fixes an `Array#sort` bug in the JS engine embedded in Adobe applications + // that causes it, under certain circumstances, to provide the same value for + // `object` and `other`. See https://github.com/jashkenas/underscore/pull/1247 + // for more details. + // + // This also ensures a stable sort in V8 and other engines. + // See https://bugs.chromium.org/p/v8/issues/detail?id=90 for more details. + return object.index - other.index; +} + +/** + * Creates a `baseEach` or `baseEachRight` function. + * + * @private + * @param {Function} eachFunc The function to iterate over a collection. + * @param {boolean} [fromRight] Specify iterating from right to left. + * @returns {Function} Returns the new base function. + */ +function createBaseEach(eachFunc, fromRight) { + return function(collection, iteratee) { + if (collection == null) { + return collection; + } + if (!isArrayLike(collection)) { + return eachFunc(collection, iteratee); + } + var length = collection.length, + index = fromRight ? length : -1, + iterable = Object(collection); + + while ((fromRight ? index-- : ++index < length)) { + if (iteratee(iterable[index], index, iterable) === false) { + break; + } + } + return collection; + }; +} + +/** + * Creates a base function for methods like `_.forIn` and `_.forOwn`. + * + * @private + * @param {boolean} [fromRight] Specify iterating from right to left. + * @returns {Function} Returns the new base function. + */ +function createBaseFor(fromRight) { + return function(object, iteratee, keysFunc) { + var index = -1, + iterable = Object(object), + props = keysFunc(object), + length = props.length; + + while (length--) { + var key = props[fromRight ? length : ++index]; + if (iteratee(iterable[key], key, iterable) === false) { + break; + } + } + return object; + }; +} + +/** + * A specialized version of `baseIsEqualDeep` for arrays with support for + * partial deep comparisons. + * + * @private + * @param {Array} array The array to compare. + * @param {Array} other The other array to compare. + * @param {Function} equalFunc The function to determine equivalents of values. + * @param {Function} customizer The function to customize comparisons. + * @param {number} bitmask The bitmask of comparison flags. See `baseIsEqual` + * for more details. + * @param {Object} stack Tracks traversed `array` and `other` objects. + * @returns {boolean} Returns `true` if the arrays are equivalent, else `false`. + */ +function equalArrays(array, other, equalFunc, customizer, bitmask, stack) { + var isPartial = bitmask & PARTIAL_COMPARE_FLAG, + arrLength = array.length, + othLength = other.length; + + if (arrLength != othLength && !(isPartial && othLength > arrLength)) { + return false; + } + // Assume cyclic values are equal. + var stacked = stack.get(array); + if (stacked && stack.get(other)) { + return stacked == other; + } + var index = -1, + result = true, + seen = (bitmask & UNORDERED_COMPARE_FLAG) ? new SetCache : undefined; + + stack.set(array, other); + stack.set(other, array); + + // Ignore non-index properties. + while (++index < arrLength) { + var arrValue = array[index], + othValue = other[index]; + + if (customizer) { + var compared = isPartial + ? customizer(othValue, arrValue, index, other, array, stack) + : customizer(arrValue, othValue, index, array, other, stack); + } + if (compared !== undefined) { + if (compared) { + continue; + } + result = false; + break; + } + // Recursively compare arrays (susceptible to call stack limits). + if (seen) { + if (!arraySome(other, function(othValue, othIndex) { + if (!seen.has(othIndex) && + (arrValue === othValue || equalFunc(arrValue, othValue, customizer, bitmask, stack))) { + return seen.add(othIndex); + } + })) { + result = false; + break; + } + } else if (!( + arrValue === othValue || + equalFunc(arrValue, othValue, customizer, bitmask, stack) + )) { + result = false; + break; + } + } + stack['delete'](array); + stack['delete'](other); + return result; +} + +/** + * A specialized version of `baseIsEqualDeep` for comparing objects of + * the same `toStringTag`. + * + * **Note:** This function only supports comparing values with tags of + * `Boolean`, `Date`, `Error`, `Number`, `RegExp`, or `String`. + * + * @private + * @param {Object} object The object to compare. + * @param {Object} other The other object to compare. + * @param {string} tag The `toStringTag` of the objects to compare. + * @param {Function} equalFunc The function to determine equivalents of values. + * @param {Function} customizer The function to customize comparisons. + * @param {number} bitmask The bitmask of comparison flags. See `baseIsEqual` + * for more details. + * @param {Object} stack Tracks traversed `object` and `other` objects. + * @returns {boolean} Returns `true` if the objects are equivalent, else `false`. + */ +function equalByTag(object, other, tag, equalFunc, customizer, bitmask, stack) { + switch (tag) { + case dataViewTag: + if ((object.byteLength != other.byteLength) || + (object.byteOffset != other.byteOffset)) { + return false; + } + object = object.buffer; + other = other.buffer; + + case arrayBufferTag: + if ((object.byteLength != other.byteLength) || + !equalFunc(new Uint8Array(object), new Uint8Array(other))) { + return false; + } + return true; + + case boolTag: + case dateTag: + case numberTag: + // Coerce booleans to `1` or `0` and dates to milliseconds. + // Invalid dates are coerced to `NaN`. + return eq(+object, +other); + + case errorTag: + return object.name == other.name && object.message == other.message; + + case regexpTag: + case stringTag: + // Coerce regexes to strings and treat strings, primitives and objects, + // as equal. See http://www.ecma-international.org/ecma-262/7.0/#sec-regexp.prototype.tostring + // for more details. + return object == (other + ''); + + case mapTag: + var convert = mapToArray; + + case setTag: + var isPartial = bitmask & PARTIAL_COMPARE_FLAG; + convert || (convert = setToArray); + + if (object.size != other.size && !isPartial) { + return false; + } + // Assume cyclic values are equal. + var stacked = stack.get(object); + if (stacked) { + return stacked == other; + } + bitmask |= UNORDERED_COMPARE_FLAG; + + // Recursively compare objects (susceptible to call stack limits). + stack.set(object, other); + var result = equalArrays(convert(object), convert(other), equalFunc, customizer, bitmask, stack); + stack['delete'](object); + return result; + + case symbolTag: + if (symbolValueOf) { + return symbolValueOf.call(object) == symbolValueOf.call(other); + } + } + return false; +} + +/** + * A specialized version of `baseIsEqualDeep` for objects with support for + * partial deep comparisons. + * + * @private + * @param {Object} object The object to compare. + * @param {Object} other The other object to compare. + * @param {Function} equalFunc The function to determine equivalents of values. + * @param {Function} customizer The function to customize comparisons. + * @param {number} bitmask The bitmask of comparison flags. See `baseIsEqual` + * for more details. + * @param {Object} stack Tracks traversed `object` and `other` objects. + * @returns {boolean} Returns `true` if the objects are equivalent, else `false`. + */ +function equalObjects(object, other, equalFunc, customizer, bitmask, stack) { + var isPartial = bitmask & PARTIAL_COMPARE_FLAG, + objProps = keys(object), + objLength = objProps.length, + othProps = keys(other), + othLength = othProps.length; + + if (objLength != othLength && !isPartial) { + return false; + } + var index = objLength; + while (index--) { + var key = objProps[index]; + if (!(isPartial ? key in other : hasOwnProperty.call(other, key))) { + return false; + } + } + // Assume cyclic values are equal. + var stacked = stack.get(object); + if (stacked && stack.get(other)) { + return stacked == other; + } + var result = true; + stack.set(object, other); + stack.set(other, object); + + var skipCtor = isPartial; + while (++index < objLength) { + key = objProps[index]; + var objValue = object[key], + othValue = other[key]; + + if (customizer) { + var compared = isPartial + ? customizer(othValue, objValue, key, other, object, stack) + : customizer(objValue, othValue, key, object, other, stack); + } + // Recursively compare objects (susceptible to call stack limits). + if (!(compared === undefined + ? (objValue === othValue || equalFunc(objValue, othValue, customizer, bitmask, stack)) + : compared + )) { + result = false; + break; + } + skipCtor || (skipCtor = key == 'constructor'); + } + if (result && !skipCtor) { + var objCtor = object.constructor, + othCtor = other.constructor; + + // Non `Object` object instances with different constructors are not equal. + if (objCtor != othCtor && + ('constructor' in object && 'constructor' in other) && + !(typeof objCtor == 'function' && objCtor instanceof objCtor && + typeof othCtor == 'function' && othCtor instanceof othCtor)) { + result = false; + } + } + stack['delete'](object); + stack['delete'](other); + return result; +} + +/** + * Gets the data for `map`. + * + * @private + * @param {Object} map The map to query. + * @param {string} key The reference key. + * @returns {*} Returns the map data. + */ +function getMapData(map, key) { + var data = map.__data__; + return isKeyable(key) + ? data[typeof key == 'string' ? 'string' : 'hash'] + : data.map; +} + +/** + * Gets the property names, values, and compare flags of `object`. + * + * @private + * @param {Object} object The object to query. + * @returns {Array} Returns the match data of `object`. + */ +function getMatchData(object) { + var result = keys(object), + length = result.length; + + while (length--) { + var key = result[length], + value = object[key]; + + result[length] = [key, value, isStrictComparable(value)]; + } + return result; +} + +/** + * Gets the native function at `key` of `object`. + * + * @private + * @param {Object} object The object to query. + * @param {string} key The key of the method to get. + * @returns {*} Returns the function if it's native, else `undefined`. + */ +function getNative(object, key) { + var value = getValue(object, key); + return baseIsNative(value) ? value : undefined; +} + +/** + * Gets the `toStringTag` of `value`. + * + * @private + * @param {*} value The value to query. + * @returns {string} Returns the `toStringTag`. + */ +var getTag = baseGetTag; + +// Fallback for data views, maps, sets, and weak maps in IE 11, +// for data views in Edge < 14, and promises in Node.js. +if ((DataView && getTag(new DataView(new ArrayBuffer(1))) != dataViewTag) || + (Map && getTag(new Map) != mapTag) || + (Promise && getTag(Promise.resolve()) != promiseTag) || + (Set && getTag(new Set) != setTag) || + (WeakMap && getTag(new WeakMap) != weakMapTag)) { + getTag = function(value) { + var result = objectToString.call(value), + Ctor = result == objectTag ? value.constructor : undefined, + ctorString = Ctor ? toSource(Ctor) : undefined; + + if (ctorString) { + switch (ctorString) { + case dataViewCtorString: return dataViewTag; + case mapCtorString: return mapTag; + case promiseCtorString: return promiseTag; + case setCtorString: return setTag; + case weakMapCtorString: return weakMapTag; + } + } + return result; + }; +} + +/** + * Checks if `path` exists on `object`. + * + * @private + * @param {Object} object The object to query. + * @param {Array|string} path The path to check. + * @param {Function} hasFunc The function to check properties. + * @returns {boolean} Returns `true` if `path` exists, else `false`. + */ +function hasPath(object, path, hasFunc) { + path = isKey(path, object) ? [path] : castPath(path); + + var result, + index = -1, + length = path.length; + + while (++index < length) { + var key = toKey(path[index]); + if (!(result = object != null && hasFunc(object, key))) { + break; + } + object = object[key]; + } + if (result) { + return result; + } + var length = object ? object.length : 0; + return !!length && isLength(length) && isIndex(key, length) && + (isArray(object) || isArguments(object)); +} + +/** + * Checks if `value` is a flattenable `arguments` object or array. + * + * @private + * @param {*} value The value to check. + * @returns {boolean} Returns `true` if `value` is flattenable, else `false`. + */ +function isFlattenable(value) { + return isArray(value) || isArguments(value) || + !!(spreadableSymbol && value && value[spreadableSymbol]); +} + +/** + * Checks if `value` is a valid array-like index. + * + * @private + * @param {*} value The value to check. + * @param {number} [length=MAX_SAFE_INTEGER] The upper bounds of a valid index. + * @returns {boolean} Returns `true` if `value` is a valid index, else `false`. + */ +function isIndex(value, length) { + length = length == null ? MAX_SAFE_INTEGER : length; + return !!length && + (typeof value == 'number' || reIsUint.test(value)) && + (value > -1 && value % 1 == 0 && value < length); +} + +/** + * Checks if the given arguments are from an iteratee call. + * + * @private + * @param {*} value The potential iteratee value argument. + * @param {*} index The potential iteratee index or key argument. + * @param {*} object The potential iteratee object argument. + * @returns {boolean} Returns `true` if the arguments are from an iteratee call, + * else `false`. + */ +function isIterateeCall(value, index, object) { + if (!isObject(object)) { + return false; + } + var type = typeof index; + if (type == 'number' + ? (isArrayLike(object) && isIndex(index, object.length)) + : (type == 'string' && index in object) + ) { + return eq(object[index], value); + } + return false; +} + +/** + * Checks if `value` is a property name and not a property path. + * + * @private + * @param {*} value The value to check. + * @param {Object} [object] The object to query keys on. + * @returns {boolean} Returns `true` if `value` is a property name, else `false`. + */ +function isKey(value, object) { + if (isArray(value)) { + return false; + } + var type = typeof value; + if (type == 'number' || type == 'symbol' || type == 'boolean' || + value == null || isSymbol(value)) { + return true; + } + return reIsPlainProp.test(value) || !reIsDeepProp.test(value) || + (object != null && value in Object(object)); +} + +/** + * Checks if `value` is suitable for use as unique object key. + * + * @private + * @param {*} value The value to check. + * @returns {boolean} Returns `true` if `value` is suitable, else `false`. + */ +function isKeyable(value) { + var type = typeof value; + return (type == 'string' || type == 'number' || type == 'symbol' || type == 'boolean') + ? (value !== '__proto__') + : (value === null); +} + +/** + * Checks if `func` has its source masked. + * + * @private + * @param {Function} func The function to check. + * @returns {boolean} Returns `true` if `func` is masked, else `false`. + */ +function isMasked(func) { + return !!maskSrcKey && (maskSrcKey in func); +} + +/** + * Checks if `value` is likely a prototype object. + * + * @private + * @param {*} value The value to check. + * @returns {boolean} Returns `true` if `value` is a prototype, else `false`. + */ +function isPrototype(value) { + var Ctor = value && value.constructor, + proto = (typeof Ctor == 'function' && Ctor.prototype) || objectProto; + + return value === proto; +} + +/** + * Checks if `value` is suitable for strict equality comparisons, i.e. `===`. + * + * @private + * @param {*} value The value to check. + * @returns {boolean} Returns `true` if `value` if suitable for strict + * equality comparisons, else `false`. + */ +function isStrictComparable(value) { + return value === value && !isObject(value); +} + +/** + * A specialized version of `matchesProperty` for source values suitable + * for strict equality comparisons, i.e. `===`. + * + * @private + * @param {string} key The key of the property to get. + * @param {*} srcValue The value to match. + * @returns {Function} Returns the new spec function. + */ +function matchesStrictComparable(key, srcValue) { + return function(object) { + if (object == null) { + return false; + } + return object[key] === srcValue && + (srcValue !== undefined || (key in Object(object))); + }; +} + +/** + * Converts `string` to a property path array. + * + * @private + * @param {string} string The string to convert. + * @returns {Array} Returns the property path array. + */ +var stringToPath = memoize(function(string) { + string = toString(string); + + var result = []; + if (reLeadingDot.test(string)) { + result.push(''); + } + string.replace(rePropName, function(match, number, quote, string) { + result.push(quote ? string.replace(reEscapeChar, '$1') : (number || match)); + }); + return result; +}); + +/** + * Converts `value` to a string key if it's not a string or symbol. + * + * @private + * @param {*} value The value to inspect. + * @returns {string|symbol} Returns the key. + */ +function toKey(value) { + if (typeof value == 'string' || isSymbol(value)) { + return value; + } + var result = (value + ''); + return (result == '0' && (1 / value) == -INFINITY) ? '-0' : result; +} + +/** + * Converts `func` to its source code. + * + * @private + * @param {Function} func The function to process. + * @returns {string} Returns the source code. + */ +function toSource(func) { + if (func != null) { + try { + return funcToString.call(func); + } catch (e) {} + try { + return (func + ''); + } catch (e) {} + } + return ''; +} + +/** + * Creates an array of elements, sorted in ascending order by the results of + * running each element in a collection thru each iteratee. This method + * performs a stable sort, that is, it preserves the original sort order of + * equal elements. The iteratees are invoked with one argument: (value). + * + * @static + * @memberOf _ + * @since 0.1.0 + * @category Collection + * @param {Array|Object} collection The collection to iterate over. + * @param {...(Function|Function[])} [iteratees=[_.identity]] + * The iteratees to sort by. + * @returns {Array} Returns the new sorted array. + * @example + * + * var users = [ + * { 'user': 'fred', 'age': 48 }, + * { 'user': 'barney', 'age': 36 }, + * { 'user': 'fred', 'age': 40 }, + * { 'user': 'barney', 'age': 34 } + * ]; + * + * _.sortBy(users, function(o) { return o.user; }); + * // => objects for [['barney', 36], ['barney', 34], ['fred', 48], ['fred', 40]] + * + * _.sortBy(users, ['user', 'age']); + * // => objects for [['barney', 34], ['barney', 36], ['fred', 40], ['fred', 48]] + * + * _.sortBy(users, 'user', function(o) { + * return Math.floor(o.age / 10); + * }); + * // => objects for [['barney', 36], ['barney', 34], ['fred', 48], ['fred', 40]] + */ +var sortBy = baseRest(function(collection, iteratees) { + if (collection == null) { + return []; + } + var length = iteratees.length; + if (length > 1 && isIterateeCall(collection, iteratees[0], iteratees[1])) { + iteratees = []; + } else if (length > 2 && isIterateeCall(iteratees[0], iteratees[1], iteratees[2])) { + iteratees = [iteratees[0]]; + } + return baseOrderBy(collection, baseFlatten(iteratees, 1), []); +}); + +/** + * Creates a function that memoizes the result of `func`. If `resolver` is + * provided, it determines the cache key for storing the result based on the + * arguments provided to the memoized function. By default, the first argument + * provided to the memoized function is used as the map cache key. The `func` + * is invoked with the `this` binding of the memoized function. + * + * **Note:** The cache is exposed as the `cache` property on the memoized + * function. Its creation may be customized by replacing the `_.memoize.Cache` + * constructor with one whose instances implement the + * [`Map`](http://ecma-international.org/ecma-262/7.0/#sec-properties-of-the-map-prototype-object) + * method interface of `delete`, `get`, `has`, and `set`. + * + * @static + * @memberOf _ + * @since 0.1.0 + * @category Function + * @param {Function} func The function to have its output memoized. + * @param {Function} [resolver] The function to resolve the cache key. + * @returns {Function} Returns the new memoized function. + * @example + * + * var object = { 'a': 1, 'b': 2 }; + * var other = { 'c': 3, 'd': 4 }; + * + * var values = _.memoize(_.values); + * values(object); + * // => [1, 2] + * + * values(other); + * // => [3, 4] + * + * object.a = 2; + * values(object); + * // => [1, 2] + * + * // Modify the result cache. + * values.cache.set(object, ['a', 'b']); + * values(object); + * // => ['a', 'b'] + * + * // Replace `_.memoize.Cache`. + * _.memoize.Cache = WeakMap; + */ +function memoize(func, resolver) { + if (typeof func != 'function' || (resolver && typeof resolver != 'function')) { + throw new TypeError(FUNC_ERROR_TEXT); + } + var memoized = function() { + var args = arguments, + key = resolver ? resolver.apply(this, args) : args[0], + cache = memoized.cache; + + if (cache.has(key)) { + return cache.get(key); + } + var result = func.apply(this, args); + memoized.cache = cache.set(key, result); + return result; + }; + memoized.cache = new (memoize.Cache || MapCache); + return memoized; +} + +// Assign cache to `_.memoize`. +memoize.Cache = MapCache; + +/** + * Performs a + * [`SameValueZero`](http://ecma-international.org/ecma-262/7.0/#sec-samevaluezero) + * comparison between two values to determine if they are equivalent. + * + * @static + * @memberOf _ + * @since 4.0.0 + * @category Lang + * @param {*} value The value to compare. + * @param {*} other The other value to compare. + * @returns {boolean} Returns `true` if the values are equivalent, else `false`. + * @example + * + * var object = { 'a': 1 }; + * var other = { 'a': 1 }; + * + * _.eq(object, object); + * // => true + * + * _.eq(object, other); + * // => false + * + * _.eq('a', 'a'); + * // => true + * + * _.eq('a', Object('a')); + * // => false + * + * _.eq(NaN, NaN); + * // => true + */ +function eq(value, other) { + return value === other || (value !== value && other !== other); +} + +/** + * Checks if `value` is likely an `arguments` object. + * + * @static + * @memberOf _ + * @since 0.1.0 + * @category Lang + * @param {*} value The value to check. + * @returns {boolean} Returns `true` if `value` is an `arguments` object, + * else `false`. + * @example + * + * _.isArguments(function() { return arguments; }()); + * // => true + * + * _.isArguments([1, 2, 3]); + * // => false + */ +function isArguments(value) { + // Safari 8.1 makes `arguments.callee` enumerable in strict mode. + return isArrayLikeObject(value) && hasOwnProperty.call(value, 'callee') && + (!propertyIsEnumerable.call(value, 'callee') || objectToString.call(value) == argsTag); +} + +/** + * Checks if `value` is classified as an `Array` object. + * + * @static + * @memberOf _ + * @since 0.1.0 + * @category Lang + * @param {*} value The value to check. + * @returns {boolean} Returns `true` if `value` is an array, else `false`. + * @example + * + * _.isArray([1, 2, 3]); + * // => true + * + * _.isArray(document.body.children); + * // => false + * + * _.isArray('abc'); + * // => false + * + * _.isArray(_.noop); + * // => false + */ +var isArray = Array.isArray; + +/** + * Checks if `value` is array-like. A value is considered array-like if it's + * not a function and has a `value.length` that's an integer greater than or + * equal to `0` and less than or equal to `Number.MAX_SAFE_INTEGER`. + * + * @static + * @memberOf _ + * @since 4.0.0 + * @category Lang + * @param {*} value The value to check. + * @returns {boolean} Returns `true` if `value` is array-like, else `false`. + * @example + * + * _.isArrayLike([1, 2, 3]); + * // => true + * + * _.isArrayLike(document.body.children); + * // => true + * + * _.isArrayLike('abc'); + * // => true + * + * _.isArrayLike(_.noop); + * // => false + */ +function isArrayLike(value) { + return value != null && isLength(value.length) && !isFunction(value); +} + +/** + * This method is like `_.isArrayLike` except that it also checks if `value` + * is an object. + * + * @static + * @memberOf _ + * @since 4.0.0 + * @category Lang + * @param {*} value The value to check. + * @returns {boolean} Returns `true` if `value` is an array-like object, + * else `false`. + * @example + * + * _.isArrayLikeObject([1, 2, 3]); + * // => true + * + * _.isArrayLikeObject(document.body.children); + * // => true + * + * _.isArrayLikeObject('abc'); + * // => false + * + * _.isArrayLikeObject(_.noop); + * // => false + */ +function isArrayLikeObject(value) { + return isObjectLike(value) && isArrayLike(value); +} + +/** + * Checks if `value` is classified as a `Function` object. + * + * @static + * @memberOf _ + * @since 0.1.0 + * @category Lang + * @param {*} value The value to check. + * @returns {boolean} Returns `true` if `value` is a function, else `false`. + * @example + * + * _.isFunction(_); + * // => true + * + * _.isFunction(/abc/); + * // => false + */ +function isFunction(value) { + // The use of `Object#toString` avoids issues with the `typeof` operator + // in Safari 8-9 which returns 'object' for typed array and other constructors. + var tag = isObject(value) ? objectToString.call(value) : ''; + return tag == funcTag || tag == genTag; +} + +/** + * Checks if `value` is a valid array-like length. + * + * **Note:** This method is loosely based on + * [`ToLength`](http://ecma-international.org/ecma-262/7.0/#sec-tolength). + * + * @static + * @memberOf _ + * @since 4.0.0 + * @category Lang + * @param {*} value The value to check. + * @returns {boolean} Returns `true` if `value` is a valid length, else `false`. + * @example + * + * _.isLength(3); + * // => true + * + * _.isLength(Number.MIN_VALUE); + * // => false + * + * _.isLength(Infinity); + * // => false + * + * _.isLength('3'); + * // => false + */ +function isLength(value) { + return typeof value == 'number' && + value > -1 && value % 1 == 0 && value <= MAX_SAFE_INTEGER; +} + +/** + * Checks if `value` is the + * [language type](http://www.ecma-international.org/ecma-262/7.0/#sec-ecmascript-language-types) + * of `Object`. (e.g. arrays, functions, objects, regexes, `new Number(0)`, and `new String('')`) + * + * @static + * @memberOf _ + * @since 0.1.0 + * @category Lang + * @param {*} value The value to check. + * @returns {boolean} Returns `true` if `value` is an object, else `false`. + * @example + * + * _.isObject({}); + * // => true + * + * _.isObject([1, 2, 3]); + * // => true + * + * _.isObject(_.noop); + * // => true + * + * _.isObject(null); + * // => false + */ +function isObject(value) { + var type = typeof value; + return !!value && (type == 'object' || type == 'function'); +} + +/** + * Checks if `value` is object-like. A value is object-like if it's not `null` + * and has a `typeof` result of "object". + * + * @static + * @memberOf _ + * @since 4.0.0 + * @category Lang + * @param {*} value The value to check. + * @returns {boolean} Returns `true` if `value` is object-like, else `false`. + * @example + * + * _.isObjectLike({}); + * // => true + * + * _.isObjectLike([1, 2, 3]); + * // => true + * + * _.isObjectLike(_.noop); + * // => false + * + * _.isObjectLike(null); + * // => false + */ +function isObjectLike(value) { + return !!value && typeof value == 'object'; +} + +/** + * Checks if `value` is classified as a `Symbol` primitive or object. + * + * @static + * @memberOf _ + * @since 4.0.0 + * @category Lang + * @param {*} value The value to check. + * @returns {boolean} Returns `true` if `value` is a symbol, else `false`. + * @example + * + * _.isSymbol(Symbol.iterator); + * // => true + * + * _.isSymbol('abc'); + * // => false + */ +function isSymbol(value) { + return typeof value == 'symbol' || + (isObjectLike(value) && objectToString.call(value) == symbolTag); +} + +/** + * Checks if `value` is classified as a typed array. + * + * @static + * @memberOf _ + * @since 3.0.0 + * @category Lang + * @param {*} value The value to check. + * @returns {boolean} Returns `true` if `value` is a typed array, else `false`. + * @example + * + * _.isTypedArray(new Uint8Array); + * // => true + * + * _.isTypedArray([]); + * // => false + */ +var isTypedArray = nodeIsTypedArray ? baseUnary(nodeIsTypedArray) : baseIsTypedArray; + +/** + * Converts `value` to a string. An empty string is returned for `null` + * and `undefined` values. The sign of `-0` is preserved. + * + * @static + * @memberOf _ + * @since 4.0.0 + * @category Lang + * @param {*} value The value to process. + * @returns {string} Returns the string. + * @example + * + * _.toString(null); + * // => '' + * + * _.toString(-0); + * // => '-0' + * + * _.toString([1, 2, 3]); + * // => '1,2,3' + */ +function toString(value) { + return value == null ? '' : baseToString(value); +} + +/** + * Gets the value at `path` of `object`. If the resolved value is + * `undefined`, the `defaultValue` is returned in its place. + * + * @static + * @memberOf _ + * @since 3.7.0 + * @category Object + * @param {Object} object The object to query. + * @param {Array|string} path The path of the property to get. + * @param {*} [defaultValue] The value returned for `undefined` resolved values. + * @returns {*} Returns the resolved value. + * @example + * + * var object = { 'a': [{ 'b': { 'c': 3 } }] }; + * + * _.get(object, 'a[0].b.c'); + * // => 3 + * + * _.get(object, ['a', '0', 'b', 'c']); + * // => 3 + * + * _.get(object, 'a.b.c', 'default'); + * // => 'default' + */ +function get(object, path, defaultValue) { + var result = object == null ? undefined : baseGet(object, path); + return result === undefined ? defaultValue : result; +} + +/** + * Checks if `path` is a direct or inherited property of `object`. + * + * @static + * @memberOf _ + * @since 4.0.0 + * @category Object + * @param {Object} object The object to query. + * @param {Array|string} path The path to check. + * @returns {boolean} Returns `true` if `path` exists, else `false`. + * @example + * + * var object = _.create({ 'a': _.create({ 'b': 2 }) }); + * + * _.hasIn(object, 'a'); + * // => true + * + * _.hasIn(object, 'a.b'); + * // => true + * + * _.hasIn(object, ['a', 'b']); + * // => true + * + * _.hasIn(object, 'b'); + * // => false + */ +function hasIn(object, path) { + return object != null && hasPath(object, path, baseHasIn); +} + +/** + * Creates an array of the own enumerable property names of `object`. + * + * **Note:** Non-object values are coerced to objects. See the + * [ES spec](http://ecma-international.org/ecma-262/7.0/#sec-object.keys) + * for more details. + * + * @static + * @since 0.1.0 + * @memberOf _ + * @category Object + * @param {Object} object The object to query. + * @returns {Array} Returns the array of property names. + * @example + * + * function Foo() { + * this.a = 1; + * this.b = 2; + * } + * + * Foo.prototype.c = 3; + * + * _.keys(new Foo); + * // => ['a', 'b'] (iteration order is not guaranteed) + * + * _.keys('hi'); + * // => ['0', '1'] + */ +function keys(object) { + return isArrayLike(object) ? arrayLikeKeys(object) : baseKeys(object); +} + +/** + * This method returns the first argument it receives. + * + * @static + * @since 0.1.0 + * @memberOf _ + * @category Util + * @param {*} value Any value. + * @returns {*} Returns `value`. + * @example + * + * var object = { 'a': 1 }; + * + * console.log(_.identity(object) === object); + * // => true + */ +function identity(value) { + return value; +} + +/** + * Creates a function that returns the value at `path` of a given object. + * + * @static + * @memberOf _ + * @since 2.4.0 + * @category Util + * @param {Array|string} path The path of the property to get. + * @returns {Function} Returns the new accessor function. + * @example + * + * var objects = [ + * { 'a': { 'b': 2 } }, + * { 'a': { 'b': 1 } } + * ]; + * + * _.map(objects, _.property('a.b')); + * // => [2, 1] + * + * _.map(_.sortBy(objects, _.property(['a', 'b'])), 'a.b'); + * // => [1, 2] + */ +function property(path) { + return isKey(path) ? baseProperty(toKey(path)) : basePropertyDeep(path); +} + +module.exports = sortBy; +}); + +var parsers$2 = createCommonjsModule(function (module, exports) { +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); + + + + +// The exponent value(s) at which toString returns exponential notation. +bignumber.BigNumber.config({ EXPONENTIAL_AT: [-5, 15] }); +class BaseNumberParser { + constructor(config) { + this.config = config; + let singleIntFrac = `${this.config.wordSeparatorToken}| -|${this.getKeyRegex(this.config.cardinalNumberMap)}|${this.getKeyRegex(this.config.ordinalNumberMap)}`; + this.textNumberRegex = recognizersText.RegExpUtility.getSafeRegExp(String.raw `(?=\b)(${singleIntFrac})(?=\b)`, "gis"); + this.arabicNumberRegex = recognizersText.RegExpUtility.getSafeRegExp(String.raw `\d+`, "is"); + this.roundNumberSet = new Set(); + this.config.roundNumberMap.forEach((value, key) => this.roundNumberSet.add(key)); + } + parse(extResult) { + // check if the parser is configured to support specific types + if (this.supportedTypes && !this.supportedTypes.find(t => t === extResult.type)) { + return null; + } + let ret = null; + let extra = extResult.data; + if (!extra) { + if (this.arabicNumberRegex.test(extResult.text)) { + extra = "Num"; + } + else { + extra = this.config.langMarker; + } + } + // Resolve symbol prefix + let isNegative = false; + let matchNegative = extResult.text.match(this.config.negativeNumberSignRegex); + if (matchNegative) { + isNegative = true; + extResult.text = extResult.text.substr(matchNegative[1].length); + } + if (extra.includes("Num")) { + ret = this.digitNumberParse(extResult); + } + else if (extra.includes(`Frac${this.config.langMarker}`)) // Frac is a special number, parse via another method + { + ret = this.fracLikeNumberParse(extResult); + } + else if (extra.includes(this.config.langMarker)) { + ret = this.textNumberParse(extResult); + } + else if (extra.includes("Pow")) { + ret = this.powerNumberParse(extResult); + } + if (ret && ret.value !== null) { + if (isNegative) { + // Recover to the original extracted Text + ret.text = matchNegative[1] + extResult.text; + // Check if ret.value is a BigNumber + if (typeof ret.value === "number") { + ret.value = -ret.value; + } + else { + ret.value.s = -1; + } + } + ret.resolutionStr = this.config.cultureInfo + ? this.config.cultureInfo.format(ret.value) + : ret.value.toString(); + } + return ret; + } + getKeyRegex(regexMap) { + let keys = new Array(); + regexMap.forEach((value, key) => keys.push(key)); + let sortKeys = lodash_sortby(keys, key => key.length).reverse(); + return sortKeys.join('|'); + } + digitNumberParse(extResult) { + let result = { + start: extResult.start, + length: extResult.length, + text: extResult.text, + type: extResult.type + }; + // [1] 24 + // [2] 12 32/33 + // [3] 1,000,000 + // [4] 234.567 + // [5] 44/55 + // [6] 2 hundred + // dot occured. + let power = 1; + let tmpIndex = -1; + let startIndex = 0; + let handle = extResult.text.toLowerCase(); + let matches = recognizersText.RegExpUtility.getMatches(this.config.digitalNumberRegex, handle); + if (matches) { + matches.forEach(match => { + // HACK: Matching regex may be buggy, may include a digit before the unit + match.value = match.value.replace(/\d/g, ''); + match.length = match.value.length; + let rep = this.config.roundNumberMap.get(match.value); + // \\s+ for filter the spaces. + power *= rep; + // tslint:disable-next-line:no-conditional-assignment + while ((tmpIndex = handle.indexOf(match.value, startIndex)) >= 0) { + let front = lodash_trimend(handle.substring(0, tmpIndex)); + startIndex = front.length; + handle = front + handle.substring(tmpIndex + match.length); + } + }); + } + // scale used in the calculate of double + result.value = this.getDigitalValue(handle, power); + return result; + } + isDigit(c) { + return c >= '0' && c <= '9'; + } + fracLikeNumberParse(extResult) { + let result = { + start: extResult.start, + length: extResult.length, + text: extResult.text, + type: extResult.type + }; + let resultText = extResult.text.toLowerCase(); + if (resultText.includes(this.config.fractionMarkerToken)) { + let overIndex = resultText.indexOf(this.config.fractionMarkerToken); + let smallPart = resultText.substring(0, overIndex).trim(); + let bigPart = resultText.substring(overIndex + this.config.fractionMarkerToken.length, resultText.length).trim(); + let smallValue = this.isDigit(smallPart[0]) + ? this.getDigitalValue(smallPart, 1) + : this.getIntValue(this.getMatches(smallPart)); + let bigValue = this.isDigit(bigPart[0]) + ? this.getDigitalValue(bigPart, 1) + : this.getIntValue(this.getMatches(bigPart)); + result.value = smallValue / bigValue; + } + else { + let words = resultText.split(" ").filter(s => s && s.length); + let fracWords = Array.from(this.config.normalizeTokenSet(words, result)); + // Split fraction with integer + let splitIndex = fracWords.length - 1; + let currentValue = this.config.resolveCompositeNumber(fracWords[splitIndex]); + let roundValue = 1; + for (splitIndex = fracWords.length - 2; splitIndex >= 0; splitIndex--) { + if (this.config.writtenFractionSeparatorTexts.indexOf(fracWords[splitIndex]) > -1 || + this.config.writtenIntegerSeparatorTexts.indexOf(fracWords[splitIndex]) > -1) { + continue; + } + let previousValue = currentValue; + currentValue = this.config.resolveCompositeNumber(fracWords[splitIndex]); + let smHundreds = 100; + // previous : hundred + // current : one + if ((previousValue >= smHundreds && previousValue > currentValue) + || (previousValue < smHundreds && this.isComposable(currentValue, previousValue))) { + if (previousValue < smHundreds && currentValue >= roundValue) { + roundValue = currentValue; + } + else if (previousValue < smHundreds && currentValue < roundValue) { + splitIndex++; + break; + } + // current is the first word + if (splitIndex === 0) { + // scan, skip the first word + splitIndex = 1; + while (splitIndex <= fracWords.length - 2) { + // e.g. one hundred thousand + // frac[i+1] % 100 && frac[i] % 100 = 0 + if (this.config.resolveCompositeNumber(fracWords[splitIndex]) >= smHundreds + && !(this.config.writtenFractionSeparatorTexts.indexOf(fracWords[splitIndex + 1]) > -1) + && this.config.resolveCompositeNumber(fracWords[splitIndex + 1]) < smHundreds) { + splitIndex++; + break; + } + splitIndex++; + } + break; + } + continue; + } + splitIndex++; + break; + } + let fracPart = new Array(); + for (let i = splitIndex; i < fracWords.length; i++) { + if (fracWords[i].indexOf("-") > -1) { + let split = fracWords[i].split('-'); + fracPart.push(split[0]); + fracPart.push("-"); + fracPart.push(split[1]); + } + else { + fracPart.push(fracWords[i]); + } + } + fracWords.splice(splitIndex, fracWords.length - splitIndex); + // denomi = denominator + let denomiValue = this.getIntValue(fracPart); + // Split mixed number with fraction + let numerValue = 0; + let intValue = 0; + let mixedIndex = fracWords.length; + for (let i = fracWords.length - 1; i >= 0; i--) { + if (i < fracWords.length - 1 && this.config.writtenFractionSeparatorTexts.indexOf(fracWords[i]) > -1) { + let numerStr = fracWords.slice(i + 1, fracWords.length).join(" "); + numerValue = this.getIntValue(this.getMatches(numerStr)); + mixedIndex = i + 1; + break; + } + } + let intStr = fracWords.slice(0, mixedIndex).join(" "); + intValue = this.getIntValue(this.getMatches(intStr)); + // Find mixed number + if (mixedIndex !== fracWords.length && numerValue < denomiValue) { + // intValue + numerValue / denomiValue + result.value = new bignumber.BigNumber(intValue).plus(new bignumber.BigNumber(numerValue).dividedBy(denomiValue)); + } + else { + // (intValue + numerValue) / denomiValue + result.value = new bignumber.BigNumber(intValue + numerValue).dividedBy(denomiValue); + } + } + return result; + } + textNumberParse(extResult) { + let result = { + start: extResult.start, + length: extResult.length, + text: extResult.text, + type: extResult.type + }; + let handle = extResult.text.toLowerCase(); + handle = handle.replace(this.config.halfADozenRegex, this.config.halfADozenText); + let numGroup = this.splitMulti(handle, Array.from(this.config.writtenDecimalSeparatorTexts)).filter(s => s && s.length > 0); + let intPart = numGroup[0]; + let matchStrs = intPart + ? intPart.match(this.textNumberRegex).map(s => s.toLowerCase()) + : new Array(); + // Get the value recursively + let intPartRet = this.getIntValue(matchStrs); + let pointPartRet = 0; + if (numGroup.length === 2) { + let pointPart = numGroup[1]; + let matchStrs = pointPart.match(this.textNumberRegex).map(s => s.toLowerCase()); + pointPartRet += this.getPointValue(matchStrs); + } + result.value = intPartRet + pointPartRet; + return result; + } + powerNumberParse(extResult) { + let result = { + start: extResult.start, + length: extResult.length, + text: extResult.text, + type: extResult.type + }; + let handle = extResult.text.toUpperCase(); + let isE = !extResult.text.includes("^"); + // [1] 1e10 + // [2] 1.1^-23 + let calStack = new Array(); + let scale = new bignumber.BigNumber(10); + let dot = false; + let isNegative = false; + let tmp = new bignumber.BigNumber(0); + for (let i = 0; i < handle.length; i++) { + let ch = handle[i]; + if (ch === '^' || ch === 'E') { + if (isNegative) { + calStack.push(tmp.negated()); + } + else { + calStack.push(tmp); + } + tmp = new bignumber.BigNumber(0); + scale = new bignumber.BigNumber(10); + dot = false; + isNegative = false; + } + else if (ch.charCodeAt(0) - 48 >= 0 && ch.charCodeAt(0) - 48 <= 9) { + if (dot) { + // tmp = tmp + scale * (ch.charCodeAt(0) - 48); + // scale *= 0.1; + tmp = tmp.plus(scale.times(ch.charCodeAt(0) - 48)); + scale = scale.times(0.1); + } + else { + // tmp = tmp * scale + (ch.charCodeAt(0) - 48); + tmp = tmp.times(scale).plus(ch.charCodeAt(0) - 48); + } + } + else if (ch === this.config.decimalSeparatorChar) { + dot = true; + scale = new bignumber.BigNumber(0.1); + } + else if (ch === '-') { + isNegative = !isNegative; + } + else if (ch === '+') { + continue; + } + if (i === handle.length - 1) { + if (isNegative) { + calStack.push(tmp.negated()); + } + else { + calStack.push(tmp); + } + } + } + let ret = 0; + if (isE) { + // ret = calStack.shift() * Math.pow(10, calStack.shift()); + ret = calStack.shift().times(Math.pow(10, calStack.shift().toNumber())).toNumber(); + } + else { + ret = Math.pow(calStack.shift().toNumber(), calStack.shift().toNumber()); + } + result.value = ret; + result.resolutionStr = ret.toString(); // @TODO Possible Culture bug. + return result; + } + splitMulti(str, tokens) { + let tempChar = tokens[0]; // We can use the first token as a temporary join character + for (let i = 0; i < tokens.length; i++) { + str = str.split(tokens[i]).join(tempChar); + } + return str.split(tempChar); + } + getMatches(input) { + let matches = input.match(this.textNumberRegex); + return (matches || []).map(match => { + return match.toLowerCase(); + }); + } + // Test if big and combine with small. + // e.g. "hundred" can combine with "thirty" but "twenty" can't combine with "thirty". + isComposable(big, small) { + let baseNumber = small > 10 ? 100 : 10; + if (big % baseNumber === 0 && big / baseNumber >= 1) { + return true; + } + return false; + } + getIntValue(matchStrs) { + let isEnd = new Array(matchStrs.length); + for (let i = 0; i < isEnd.length; i++) { + isEnd[i] = false; + } + let tempValue = 0; + let endFlag = 1; + // Scan from end to start, find the end word + for (let i = matchStrs.length - 1; i >= 0; i--) { + if (this.roundNumberSet.has(matchStrs[i])) { + // if false,then continue + // You will meet hundred first, then thousand. + if (endFlag > this.config.roundNumberMap.get(matchStrs[i])) { + continue; + } + isEnd[i] = true; + endFlag = this.config.roundNumberMap.get(matchStrs[i]); + } + } + if (endFlag === 1) { + let tempStack = new Array(); + let oldSym = ""; + matchStrs.forEach(matchStr => { + let isCardinal = this.config.cardinalNumberMap.has(matchStr); + let isOrdinal = this.config.ordinalNumberMap.has(matchStr); + if (isCardinal || isOrdinal) { + let matchValue = isCardinal + ? this.config.cardinalNumberMap.get(matchStr) + : this.config.ordinalNumberMap.get(matchStr); + // This is just for ordinal now. Not for fraction ever. + if (isOrdinal) { + let fracPart = this.config.ordinalNumberMap.get(matchStr); + if (tempStack.length > 0) { + let intPart = tempStack.pop(); + // if intPart >= fracPart, it means it is an ordinal number + // it begins with an integer, ends with an ordinal + // e.g. ninety-ninth + if (intPart >= fracPart) { + tempStack.push(intPart + fracPart); + } + // another case of the type is ordinal + // e.g. three hundredth + else { + while (tempStack.length > 0) { + intPart = intPart + tempStack.pop(); + } + tempStack.push(intPart * fracPart); + } + } + else { + tempStack.push(fracPart); + } + } + else if (this.config.cardinalNumberMap.has(matchStr)) { + if (oldSym === "-") { + let sum = tempStack.pop() + matchValue; + tempStack.push(sum); + } + else if (oldSym === this.config.writtenIntegerSeparatorTexts[0] || tempStack.length < 2) { + tempStack.push(matchValue); + } + else if (tempStack.length >= 2) { + let sum = tempStack.pop() + matchValue; + sum = tempStack.pop() + sum; + tempStack.push(sum); + } + } + } + else { + let complexValue = this.config.resolveCompositeNumber(matchStr); + if (complexValue !== 0) { + tempStack.push(complexValue); + } + } + oldSym = matchStr; + }); + tempStack.forEach(stackValue => { + tempValue += stackValue; + }); + } + else { + let lastIndex = 0; + let mulValue = 1; + let partValue = 1; + for (let i = 0; i < isEnd.length; i++) { + if (isEnd[i]) { + mulValue = this.config.roundNumberMap.get(matchStrs[i]); + partValue = 1; + if (i !== 0) { + partValue = this.getIntValue(matchStrs.slice(lastIndex, i)); + } + tempValue += mulValue * partValue; + lastIndex = i + 1; + } + } + // Calculate the part like "thirty-one" + mulValue = 1; + if (lastIndex !== isEnd.length) { + partValue = this.getIntValue(matchStrs.slice(lastIndex, isEnd.length)); + tempValue += mulValue * partValue; + } + } + return tempValue; + } + getPointValue(matchStrs) { + let ret = 0; + let firstMatch = matchStrs[0]; + if (this.config.cardinalNumberMap.has(firstMatch) && this.config.cardinalNumberMap.get(firstMatch) >= 10) { + let prefix = "0."; + let tempInt = this.getIntValue(matchStrs); + let all = prefix + tempInt; + ret = parseFloat(all); + } + else { + let scale = new bignumber.BigNumber(0.1); + for (let i = 0; i < matchStrs.length; i++) { + ret += scale.times(this.config.cardinalNumberMap.get(matchStrs[i])).toNumber(); + // scale *= 0.1; + scale = scale.times(0.1); + } + } + return ret; + } + skipNonDecimalSeparator(ch, distance, culture) { + var decimalLength = 3; + // Special cases for multi-language countries where decimal separators can be used interchangeably. Mostly informally. + // Ex: South Africa, Namibia; Puerto Rico in ES; or in Canada for EN and FR. + // "me pidio $5.00 prestados" and "me pidio $5,00 prestados" -> currency $5 + var cultureRegex = recognizersText.RegExpUtility.getSafeRegExp(String.raw `^(en|es|fr)(-)?\b`, "is"); + return (ch == this.config.nonDecimalSeparatorChar && !(distance <= decimalLength && (cultureRegex.exec(culture.code) !== null))); + } + getDigitalValue(digitsStr, power) { + let tmp = new bignumber.BigNumber(0); + let scale = new bignumber.BigNumber(10); + let decimalSeparator = false; + var strLength = digitsStr.length; + let isNegative = false; + let isFrac = digitsStr.includes('/'); + let calStack = new Array(); + for (let i = 0; i < digitsStr.length; i++) { + let ch = digitsStr[i]; + var skippableNonDecimal = this.skipNonDecimalSeparator(ch, strLength - i, this.config.cultureInfo); + if (!isFrac && (ch === ' ' || skippableNonDecimal)) { + continue; + } + if (ch === ' ' || ch === '/') { + calStack.push(tmp); + tmp = new bignumber.BigNumber(0); + } + else if (ch >= '0' && ch <= '9') { + if (decimalSeparator) { + // tmp = tmp + scale * (ch.charCodeAt(0) - 48); + // scale *= 0.1; + tmp = tmp.plus(scale.times(ch.charCodeAt(0) - 48)); + scale = scale.times(0.1); + } + else { + // tmp = tmp * scale + (ch.charCodeAt(0) - 48); + tmp = tmp.times(scale).plus(ch.charCodeAt(0) - 48); + } + } + else if (ch === this.config.decimalSeparatorChar || (!skippableNonDecimal && ch == this.config.nonDecimalSeparatorChar)) { + decimalSeparator = true; + scale = new bignumber.BigNumber(0.1); + } + else if (ch === '-') { + isNegative = true; + } + } + calStack.push(tmp); + // if the number is a fraction. + let calResult = new bignumber.BigNumber(0); + if (isFrac) { + let deno = calStack.pop(); + let mole = calStack.pop(); + // calResult += mole / deno; + calResult = calResult.plus(mole.dividedBy(deno)); + } + while (calStack.length > 0) { + calResult = calResult.plus(calStack.pop()); + } + // calResult *= power; + calResult = calResult.times(power); + if (isNegative) { + return calResult.negated().toNumber(); + } + return calResult.toNumber(); + } +} +exports.BaseNumberParser = BaseNumberParser; +class BasePercentageParser extends BaseNumberParser { + parse(extResult) { + let originText = extResult.text; + // do replace text & data from extended info + if (extResult.data && extResult.data instanceof Array) { + extResult.text = extResult.data[0]; + extResult.data = extResult.data[1].data; + } + let ret = super.parse(extResult); + if (ret.resolutionStr && ret.resolutionStr.length > 0) { + if (!ret.resolutionStr.trim().endsWith("%")) { + ret.resolutionStr = ret.resolutionStr.trim() + "%"; + } + } + ret.data = extResult.text; + ret.text = originText; + return ret; + } +} +exports.BasePercentageParser = BasePercentageParser; + +}); + +unwrapExports(parsers$2); + +var cjkParsers = createCommonjsModule(function (module, exports) { +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); + + + +const recognizers_text_2 = recognizersText; +class BaseCJKNumberParser extends parsers$2.BaseNumberParser { + constructor(config) { + super(config); + this.config = config; + } + toString(value) { + return this.config.cultureInfo + ? this.config.cultureInfo.format(value) + : value.toString(); + } + parse(extResult) { + let extra = ''; + let result; + extra = extResult.data; + let getExtResult = { + start: extResult.start, + length: extResult.length, + data: extResult.data, + text: this.replaceTraditionalWithSimplified(extResult.text), + type: extResult.type + }; + if (!extra) { + return result; + } + if (extra.includes("Per")) { + result = this.perParseCJK(getExtResult); + } + else if (extra.includes("Num")) { + getExtResult.text = this.replaceFullWithHalf(getExtResult.text); + result = this.digitNumberParse(getExtResult); + if (this.config.negativeNumberSignRegex.test(getExtResult.text) && result.value > 0) { + result.value = -result.value; + } + result.resolutionStr = this.toString(result.value); + } + else if (extra.includes("Pow")) { + getExtResult.text = this.replaceFullWithHalf(getExtResult.text); + result = this.powerNumberParse(getExtResult); + result.resolutionStr = this.toString(result.value); + } + else if (extra.includes("Frac")) { + result = this.fracParseCJK(getExtResult); + } + else if (extra.includes("Dou")) { + result = this.douParseCJK(getExtResult); + } + else if (extra.includes("Integer")) { + result = this.intParseCJK(getExtResult); + } + else if (extra.includes("Ordinal")) { + result = this.ordParseCJK(getExtResult); + } + if (result) { + result.text = extResult.text; + } + return result; + } + replaceTraditionalWithSimplified(value) { + if (recognizers_text_2.StringUtility.isNullOrWhitespace(value)) { + return value; + } + if (this.config.tratoSimMap == null) { + return value; + } + let result = ''; + for (let index = 0; index < value.length; index++) { + result = result.concat(this.config.tratoSimMap.get(value.charAt(index)) || value.charAt(index)); + } + return result; + } + replaceFullWithHalf(value) { + if (recognizers_text_2.StringUtility.isNullOrWhitespace(value)) { + return value; + } + let result = ''; + for (let index = 0; index < value.length; index++) { + result = result.concat(this.config.fullToHalfMap.get(value.charAt(index)) || value.charAt(index)); + } + return result; + } + replaceUnit(value) { + if (recognizers_text_2.StringUtility.isNullOrEmpty(value)) + return value; + let result = value; + this.config.unitMap.forEach((value, key) => { + result = result.replace(new RegExp(key, 'g'), value); + }); + return result; + } + perParseCJK(extResult) { + let result = new recognizersText.ParseResult(extResult); + let resultText = extResult.text; + let power = 1; + if (extResult.data.includes("Spe")) { + resultText = this.replaceFullWithHalf(resultText); + resultText = this.replaceUnit(resultText); + if (resultText === "半額" || resultText === "半折" || resultText === "半折") { + result.value = 50; + } + else if (resultText === "10成" || resultText === "10割" || resultText === "十割") { + result.value = 100; + } + else { + let matches = recognizers_text_2.RegExpUtility.getMatches(this.config.speGetNumberRegex, resultText); + let intNumber; + if (matches.length === 2) { + let intNumberChar = matches[0].value.charAt(0); + if (intNumberChar === '対' || intNumberChar === "对") { + intNumber = 5; + } + else if (intNumberChar === "十" || intNumberChar === "拾") { + intNumber = 10; + } + else { + intNumber = this.config.zeroToNineMap.get(intNumberChar); + } + let pointNumberChar = matches[1].value.charAt(0); + let pointNumber; + if (pointNumberChar === "半") { + pointNumber = 0.5; + } + else { + pointNumber = this.config.zeroToNineMap.get(pointNumberChar) * 0.1; + } + result.value = (intNumber + pointNumber) * 10; + } + else if (matches.length === 5) { + // Deal the Japanese percentage case like "xxx割xxx分xxx厘", get the integer value and convert into result. + let intNumberChar = matches[0].value.charAt(0); + let pointNumberChar = matches[1].value.charAt(0); + let dotNumberChar = matches[3].value.charAt(0); + let pointNumber = this.config.zeroToNineMap.get(pointNumberChar) * 0.1; + let dotNumber = this.config.zeroToNineMap.get(dotNumberChar) * 0.01; + intNumber = this.config.zeroToNineMap.get(intNumberChar); + result.value = (intNumber + pointNumber + dotNumber) * 10; + } + else { + let intNumberChar = matches[0].value.charAt(0); + if (intNumberChar === '対' || intNumberChar === "对") { + intNumber = 5; + } + else if (intNumberChar === "十" || intNumberChar === "拾") { + intNumber = 10; + } + else { + intNumber = this.config.zeroToNineMap.get(intNumberChar); + } + result.value = intNumber * 10; + } + } + } + else if (extResult.data.includes("Num")) { + let doubleMatch = recognizers_text_2.RegExpUtility.getMatches(this.config.percentageRegex, resultText).pop(); + let doubleText = doubleMatch.value; + if (doubleText.includes("k") || doubleText.includes("K") || doubleText.includes("k") || doubleText.includes("K")) { + power = 1000; + } + if (doubleText.includes("M") || doubleText.includes("M")) { + power = 1000000; + } + if (doubleText.includes("G") || doubleText.includes("G")) { + power = 1000000000; + } + if (doubleText.includes("T") || doubleText.includes("T")) { + power = 1000000000000; + } + result.value = this.getDigitValueCJK(resultText, power); + } + else { + let doubleMatch = recognizers_text_2.RegExpUtility.getMatches(this.config.percentageRegex, resultText).pop(); + let doubleText = this.replaceUnit(doubleMatch.value); + let splitResult = recognizers_text_2.RegExpUtility.split(this.config.pointRegex, doubleText); + if (splitResult[0] === "") { + splitResult[0] = "零"; + } + let doubleValue = this.getIntValueCJK(splitResult[0]); + if (splitResult.length === 2) { + if (recognizers_text_2.RegExpUtility.isMatch(this.config.negativeNumberSignRegex, splitResult[0])) { + doubleValue -= this.getPointValueCJK(splitResult[1]); + } + else { + doubleValue += this.getPointValueCJK(splitResult[1]); + } + } + result.value = doubleValue; + } + result.resolutionStr = this.toString(result.value) + "%"; + return result; + } + fracParseCJK(extResult) { + let result = new recognizersText.ParseResult(extResult); + let resultText = extResult.text; + let splitResult = recognizers_text_2.RegExpUtility.split(this.config.fracSplitRegex, resultText); + let intPart = ""; + let demoPart = ""; + let numPart = ""; + if (splitResult.length === 3) { + intPart = splitResult[0] || ""; + demoPart = splitResult[1] || ""; + numPart = splitResult[2] || ""; + } + else { + intPart = "零"; + demoPart = splitResult[0] || ""; + numPart = splitResult[1] || ""; + } + let intValue = this.isDigitCJK(intPart) + ? this.getDigitValueCJK(intPart, 1.0) + : this.getIntValueCJK(intPart); + let numValue = this.isDigitCJK(numPart) + ? this.getDigitValueCJK(numPart, 1.0) + : this.getIntValueCJK(numPart); + let demoValue = this.isDigitCJK(demoPart) + ? this.getDigitValueCJK(demoPart, 1.0) + : this.getIntValueCJK(demoPart); + if (recognizers_text_2.RegExpUtility.isMatch(this.config.negativeNumberSignRegex, intPart)) { + result.value = intValue - numValue / demoValue; + } + else { + result.value = intValue + numValue / demoValue; + } + result.resolutionStr = this.toString(result.value); + return result; + } + douParseCJK(extResult) { + let result = new recognizersText.ParseResult(extResult); + let resultText = extResult.text; + if (recognizers_text_2.RegExpUtility.isMatch(this.config.doubleAndRoundRegex, resultText)) { + resultText = this.replaceUnit(resultText); + let power = this.config.roundNumberMapChar.get(resultText.charAt(resultText.length - 1)); + result.value = this.getDigitValueCJK(resultText.substr(0, resultText.length - 1), power); + } + else { + resultText = this.replaceUnit(resultText); + let splitResult = recognizers_text_2.RegExpUtility.split(this.config.pointRegex, resultText); + if (splitResult[0] === "") { + splitResult[0] = "零"; + } + if (recognizers_text_2.RegExpUtility.isMatch(this.config.negativeNumberSignRegex, splitResult[0])) { + result.value = this.getIntValueCJK(splitResult[0]) - this.getPointValueCJK(splitResult[1]); + } + else { + result.value = this.getIntValueCJK(splitResult[0]) + this.getPointValueCJK(splitResult[1]); + } + } + result.resolutionStr = this.toString(result.value); + return result; + } + intParseCJK(extResult) { + let result = new recognizersText.ParseResult(extResult); + result.value = this.getIntValueCJK(extResult.text); + result.resolutionStr = this.toString(result.value); + return result; + } + ordParseCJK(extResult) { + let result = new recognizersText.ParseResult(extResult); + let resultText = extResult.text.substr(1); + if (recognizers_text_2.RegExpUtility.isMatch(this.config.digitNumRegex, resultText) && !recognizers_text_2.RegExpUtility.isMatch(this.config.roundNumberIntegerRegex, resultText)) { + result.value = this.getDigitValueCJK(resultText, 1); + } + else { + result.value = this.getIntValueCJK(resultText); + } + result.resolutionStr = this.toString(result.value); + return result; + } + getDigitValueCJK(value, power) { + let isNegative = false; + let resultStr = value; + if (recognizers_text_2.RegExpUtility.isMatch(this.config.negativeNumberSignRegex, resultStr)) { + isNegative = true; + resultStr = resultStr.substr(1); + } + resultStr = this.replaceFullWithHalf(resultStr); + let result = this.getDigitalValue(resultStr, power); + if (isNegative) { + result = -result; + } + return result; + } + getIntValueCJK(value) { + let resultStr = value; + let isDozen = false; + let isPair = false; + if (recognizers_text_2.RegExpUtility.isMatch(this.config.dozenRegex, resultStr)) { + isDozen = true; + if (this.config.cultureInfo.code.toLowerCase() === culture$2.Culture.Chinese) { + resultStr = resultStr.substr(0, resultStr.length - 1); + } + else if (this.config.cultureInfo.code.toLowerCase() === culture$2.Culture.Japanese) { + resultStr = resultStr.substr(0, resultStr.length - 3); + } + } + else if (recognizers_text_2.RegExpUtility.isMatch(this.config.pairRegex, resultStr)) { + isPair = true; + resultStr = resultStr.substr(0, resultStr.length - 1); + } + resultStr = this.replaceUnit(resultStr); + let intValue = 0; + let partValue = 0; + let beforeValue = 0; + let isRoundBefore = false; + let roundBefore = -1; + let roundDefault = 1; + let isNegative = false; + let hasNumber = false; + if (recognizers_text_2.RegExpUtility.isMatch(this.config.negativeNumberSignRegex, resultStr)) { + isNegative = true; + resultStr = resultStr.substr(1); + } + for (let index = 0; index < resultStr.length; index++) { + let currentChar = resultStr.charAt(index); + if (this.config.roundNumberMapChar.has(currentChar)) { + let roundRecent = this.config.roundNumberMapChar.get(currentChar); + if (!hasNumber) { + beforeValue = 1; + } + if (roundBefore !== -1 && roundRecent > roundBefore) { + if (isRoundBefore) { + intValue += partValue * roundRecent; + isRoundBefore = false; + } + else { + partValue += beforeValue * roundDefault; + intValue += partValue * roundRecent; + } + roundBefore = -1; + partValue = 0; + } + else { + isRoundBefore = true; + partValue += beforeValue * roundRecent; + roundBefore = roundRecent; + if ((index === resultStr.length - 1) || this.config.roundDirectList.some(o => o === currentChar)) { + intValue += partValue; + partValue = 0; + } + } + hasNumber = false; + beforeValue = 0; + roundDefault = roundRecent / 10; + } + else if (this.config.zeroToNineMap.has(currentChar)) { + hasNumber = true; + if (index !== resultStr.length - 1) { + if ((currentChar === "零") && !this.config.roundNumberMapChar.has(resultStr.charAt(index + 1))) { + roundDefault = 1; + } + else { + beforeValue = beforeValue * 10 + this.config.zeroToNineMap.get(currentChar); + isRoundBefore = false; + } + } + else { + if (index === resultStr.length - 1 && this.config.cultureInfo.code.toLowerCase() === culture$2.Culture.Japanese) { + roundDefault = 1; + } + partValue += beforeValue * 10; + partValue += this.config.zeroToNineMap.get(currentChar) * roundDefault; + intValue += partValue; + partValue = 0; + } + } + } + if (isNegative) { + intValue = -intValue; + } + if (isDozen) { + intValue = intValue * 12; + } + if (isPair) { + intValue = intValue * 2; + } + return intValue; + } + getPointValueCJK(value) { + let result = 0; + let scale = 0.1; + for (let index = 0; index < value.length; index++) { + result += scale * this.config.zeroToNineMap.get(value.charAt(index)); + scale *= 0.1; + } + return result; + } + isDigitCJK(value) { + return !recognizers_text_2.StringUtility.isNullOrEmpty(value) + && recognizers_text_2.RegExpUtility.isMatch(this.config.digitNumRegex, value); + } +} +exports.BaseCJKNumberParser = BaseCJKNumberParser; + +}); + +unwrapExports(cjkParsers); + +var agnosticNumberParser = createCommonjsModule(function (module, exports) { +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); + + + + +var AgnosticNumberParserType; +(function (AgnosticNumberParserType) { + AgnosticNumberParserType[AgnosticNumberParserType["Cardinal"] = 0] = "Cardinal"; + AgnosticNumberParserType[AgnosticNumberParserType["Double"] = 1] = "Double"; + AgnosticNumberParserType[AgnosticNumberParserType["Fraction"] = 2] = "Fraction"; + AgnosticNumberParserType[AgnosticNumberParserType["Integer"] = 3] = "Integer"; + AgnosticNumberParserType[AgnosticNumberParserType["Number"] = 4] = "Number"; + AgnosticNumberParserType[AgnosticNumberParserType["Ordinal"] = 5] = "Ordinal"; + AgnosticNumberParserType[AgnosticNumberParserType["Percentage"] = 6] = "Percentage"; +})(AgnosticNumberParserType = exports.AgnosticNumberParserType || (exports.AgnosticNumberParserType = {})); +class AgnosticNumberParserFactory { + static getParser(type, languageConfiguration) { + let isChinese = languageConfiguration.cultureInfo.code.toLowerCase() === culture$2.Culture.Chinese; + let isJapanese = languageConfiguration.cultureInfo.code.toLowerCase() === culture$2.Culture.Japanese; + let parser; + if (isChinese) { + parser = new cjkParsers.BaseCJKNumberParser(languageConfiguration); + } + else if (isJapanese) { + parser = new cjkParsers.BaseCJKNumberParser(languageConfiguration); + } + else { + parser = new parsers$2.BaseNumberParser(languageConfiguration); + } + switch (type) { + case AgnosticNumberParserType.Cardinal: + parser.supportedTypes = [constants.Constants.SYS_NUM_CARDINAL, constants.Constants.SYS_NUM_INTEGER, constants.Constants.SYS_NUM_DOUBLE]; + break; + case AgnosticNumberParserType.Double: + parser.supportedTypes = [constants.Constants.SYS_NUM_DOUBLE]; + break; + case AgnosticNumberParserType.Fraction: + parser.supportedTypes = [constants.Constants.SYS_NUM_FRACTION]; + break; + case AgnosticNumberParserType.Integer: + parser.supportedTypes = [constants.Constants.SYS_NUM_INTEGER]; + break; + case AgnosticNumberParserType.Ordinal: + parser.supportedTypes = [constants.Constants.SYS_NUM_ORDINAL]; + break; + case AgnosticNumberParserType.Percentage: + if (!isChinese && !isJapanese) { + parser = new parsers$2.BasePercentageParser(languageConfiguration); + } + break; + } + return parser; + } +} +exports.AgnosticNumberParserFactory = AgnosticNumberParserFactory; + +}); + +unwrapExports(agnosticNumberParser); + +var baseNumbers = createCommonjsModule(function (module, exports) { +"use strict"; +// ------------------------------------------------------------------------------ +// +// This code was generated by a tool. +// Changes to this file may cause incorrect behavior and will be lost if +// the code is regenerated. +// +// ------------------------------------------------------------------------------ +Object.defineProperty(exports, "__esModule", { value: true }); +var BaseNumbers; +(function (BaseNumbers) { + BaseNumbers.NumberReplaceToken = '@builtin.num'; + BaseNumbers.FractionNumberReplaceToken = '@builtin.num.fraction'; + BaseNumbers.IntegerRegexDefinition = (placeholder, thousandsmark) => { return `(((? { return `(((? +// This code was generated by a tool. +// Changes to this file may cause incorrect behavior and will be lost if +// the code is regenerated. +// +// ------------------------------------------------------------------------------ +Object.defineProperty(exports, "__esModule", { value: true }); + +var EnglishNumeric; +(function (EnglishNumeric) { + EnglishNumeric.LangMarker = 'Eng'; + EnglishNumeric.RoundNumberIntegerRegex = `(hundred|thousand|million|billion|trillion)`; + EnglishNumeric.ZeroToNineIntegerRegex = `(three|seven|eight|four|five|zero|nine|one|two|six)`; + EnglishNumeric.NegativeNumberTermsRegex = `((minus|negative)\\s+)`; + EnglishNumeric.NegativeNumberSignRegex = `^${EnglishNumeric.NegativeNumberTermsRegex}.*`; + EnglishNumeric.AnIntRegex = `(an|a)(?=\\s)`; + EnglishNumeric.TenToNineteenIntegerRegex = `(seventeen|thirteen|fourteen|eighteen|nineteen|fifteen|sixteen|eleven|twelve|ten)`; + EnglishNumeric.TensNumberIntegerRegex = `(seventy|twenty|thirty|eighty|ninety|forty|fifty|sixty)`; + EnglishNumeric.SeparaIntRegex = `(((${EnglishNumeric.TenToNineteenIntegerRegex}|(${EnglishNumeric.TensNumberIntegerRegex}(\\s+(and\\s+)?|\\s*-\\s*)${EnglishNumeric.ZeroToNineIntegerRegex})|${EnglishNumeric.TensNumberIntegerRegex}|${EnglishNumeric.ZeroToNineIntegerRegex})(\\s+${EnglishNumeric.RoundNumberIntegerRegex})*))|((${EnglishNumeric.AnIntRegex}(\\s+${EnglishNumeric.RoundNumberIntegerRegex})+))`; + EnglishNumeric.AllIntRegex = `((((${EnglishNumeric.TenToNineteenIntegerRegex}|(${EnglishNumeric.TensNumberIntegerRegex}(\\s+(and\\s+)?|\\s*-\\s*)${EnglishNumeric.ZeroToNineIntegerRegex})|${EnglishNumeric.TensNumberIntegerRegex}|${EnglishNumeric.ZeroToNineIntegerRegex}|${EnglishNumeric.AnIntRegex})(\\s+${EnglishNumeric.RoundNumberIntegerRegex})+)\\s+(and\\s+)?)*${EnglishNumeric.SeparaIntRegex})`; + EnglishNumeric.PlaceHolderPureNumber = `\\b`; + EnglishNumeric.PlaceHolderDefault = `\\D|\\b`; + EnglishNumeric.NumbersWithPlaceHolder = (placeholder) => { return `(((?(${EnglishNumeric.AllIntRegex})|((?(${EnglishNumeric.AllIntRegex})|(\\d+)(?![\\.,]))(?=\\b)`; + EnglishNumeric.FractionPrepositionWithinPercentModeRegex = `(?<=\\b)(?(${EnglishNumeric.AllIntRegex})|((?(${EnglishNumeric.AllIntRegex})|(\\d+)(?![\\.,]))(?=\\b)`; + EnglishNumeric.AllPointRegex = `((\\s+${EnglishNumeric.ZeroToNineIntegerRegex})+|(\\s+${EnglishNumeric.SeparaIntRegex}))`; + EnglishNumeric.AllFloatRegex = `${EnglishNumeric.AllIntRegex}(\\s+point)${EnglishNumeric.AllPointRegex}`; + EnglishNumeric.DoubleWithMultiplierRegex = `(((? { return `(((? { return `(?<=\\s|^)(?and)`; + EnglishNumeric.NumberWithSuffixPercentage = `(?)`; + EnglishNumeric.LessRegex = `((less|lower|smaller|fewer)(\\s+than)?|below|under|(?|=)<)`; + EnglishNumeric.EqualRegex = `(equal(s|ing)?(\\s+(to|than))?|(?)=)`; + EnglishNumeric.MoreOrEqualPrefix = `((no\\s+${EnglishNumeric.LessRegex})|(at\\s+least))`; + EnglishNumeric.MoreOrEqual = `((${EnglishNumeric.MoreRegex}\\s+(or)?\\s+${EnglishNumeric.EqualRegex})|(${EnglishNumeric.EqualRegex}\\s+(or)?\\s+${EnglishNumeric.MoreRegex})|${EnglishNumeric.MoreOrEqualPrefix}(\\s+(or)?\\s+${EnglishNumeric.EqualRegex})?|(${EnglishNumeric.EqualRegex}\\s+(or)?\\s+)?${EnglishNumeric.MoreOrEqualPrefix}|>\\s*=)`; + EnglishNumeric.MoreOrEqualSuffix = `((and|or)\\s+(more|greater|higher|larger|bigger)((?!\\s+than)|(\\s+than(?!(\\s*\\d+)))))`; + EnglishNumeric.LessOrEqualPrefix = `((no\\s+${EnglishNumeric.MoreRegex})|(at\\s+most))`; + EnglishNumeric.LessOrEqual = `((${EnglishNumeric.LessRegex}\\s+(or)?\\s+${EnglishNumeric.EqualRegex})|(${EnglishNumeric.EqualRegex}\\s+(or)?\\s+${EnglishNumeric.LessRegex})|${EnglishNumeric.LessOrEqualPrefix}(\\s+(or)?\\s+${EnglishNumeric.EqualRegex})?|(${EnglishNumeric.EqualRegex}\\s+(or)?\\s+)?${EnglishNumeric.LessOrEqualPrefix}|<\\s*=)`; + EnglishNumeric.LessOrEqualSuffix = `((and|or)\\s+(less|lower|smaller|fewer)((?!\\s+than)|(\\s+than(?!(\\s*\\d+)))))`; + EnglishNumeric.NumberSplitMark = `(?![,.](?!\\d+))`; + EnglishNumeric.MoreRegexNoNumberSucceed = `((bigger|greater|more|higher|larger)((?!\\s+than)|\\s+(than(?!(\\s*\\d+))))|(above|over)(?!(\\s*\\d+)))`; + EnglishNumeric.LessRegexNoNumberSucceed = `((less|lower|smaller|fewer)((?!\\s+than)|\\s+(than(?!(\\s*\\d+))))|(below|under)(?!(\\s*\\d+)))`; + EnglishNumeric.EqualRegexNoNumberSucceed = `(equal(s|ing)?((?!\\s+(to|than))|(\\s+(to|than)(?!(\\s*\\d+)))))`; + EnglishNumeric.OneNumberRangeMoreRegex1 = `(${EnglishNumeric.MoreOrEqual}|${EnglishNumeric.MoreRegex})\\s*(the\\s+)?(?(${EnglishNumeric.NumberSplitMark}.)+)`; + EnglishNumeric.OneNumberRangeMoreRegex2 = `(?(${EnglishNumeric.NumberSplitMark}.)+)\\s*${EnglishNumeric.MoreOrEqualSuffix}`; + EnglishNumeric.OneNumberRangeMoreSeparateRegex = `(${EnglishNumeric.EqualRegex}\\s+(?(${EnglishNumeric.NumberSplitMark}.)+)(\\s+or\\s+)${EnglishNumeric.MoreRegexNoNumberSucceed})|(${EnglishNumeric.MoreRegex}\\s+(?(${EnglishNumeric.NumberSplitMark}.)+)(\\s+or\\s+)${EnglishNumeric.EqualRegexNoNumberSucceed})`; + EnglishNumeric.OneNumberRangeLessRegex1 = `(${EnglishNumeric.LessOrEqual}|${EnglishNumeric.LessRegex})\\s*(the\\s+)?(?(${EnglishNumeric.NumberSplitMark}.)+)`; + EnglishNumeric.OneNumberRangeLessRegex2 = `(?(${EnglishNumeric.NumberSplitMark}.)+)\\s*${EnglishNumeric.LessOrEqualSuffix}`; + EnglishNumeric.OneNumberRangeLessSeparateRegex = `(${EnglishNumeric.EqualRegex}\\s+(?(${EnglishNumeric.NumberSplitMark}.)+)(\\s+or\\s+)${EnglishNumeric.LessRegexNoNumberSucceed})|(${EnglishNumeric.LessRegex}\\s+(?(${EnglishNumeric.NumberSplitMark}.)+)(\\s+or\\s+)${EnglishNumeric.EqualRegexNoNumberSucceed})`; + EnglishNumeric.OneNumberRangeEqualRegex = `${EnglishNumeric.EqualRegex}\\s*(the\\s+)?(?(${EnglishNumeric.NumberSplitMark}.)+)`; + EnglishNumeric.TwoNumberRangeRegex1 = `between\\s*(the\\s+)?(?(${EnglishNumeric.NumberSplitMark}.)+)\\s*and\\s*(the\\s+)?(?(${EnglishNumeric.NumberSplitMark}.)+)`; + EnglishNumeric.TwoNumberRangeRegex2 = `(${EnglishNumeric.OneNumberRangeMoreRegex1}|${EnglishNumeric.OneNumberRangeMoreRegex2})\\s*(and|but|,)\\s*(${EnglishNumeric.OneNumberRangeLessRegex1}|${EnglishNumeric.OneNumberRangeLessRegex2})`; + EnglishNumeric.TwoNumberRangeRegex3 = `(${EnglishNumeric.OneNumberRangeLessRegex1}|${EnglishNumeric.OneNumberRangeLessRegex2})\\s*(and|but|,)\\s*(${EnglishNumeric.OneNumberRangeMoreRegex1}|${EnglishNumeric.OneNumberRangeMoreRegex2})`; + EnglishNumeric.TwoNumberRangeRegex4 = `(from\\s+)?(?(${EnglishNumeric.NumberSplitMark}(?!\\bfrom\\b).)+)\\s*${EnglishNumeric.TillRegex}\\s*(the\\s+)?(?(${EnglishNumeric.NumberSplitMark}.)+)`; + EnglishNumeric.AmbiguousFractionConnectorsRegex = `(\\bin\\b)`; + EnglishNumeric.DecimalSeparatorChar = '.'; + EnglishNumeric.FractionMarkerToken = 'over'; + EnglishNumeric.NonDecimalSeparatorChar = ','; + EnglishNumeric.HalfADozenText = 'six'; + EnglishNumeric.WordSeparatorToken = 'and'; + EnglishNumeric.WrittenDecimalSeparatorTexts = ['point']; + EnglishNumeric.WrittenGroupSeparatorTexts = ['punto']; + EnglishNumeric.WrittenIntegerSeparatorTexts = ['and']; + EnglishNumeric.WrittenFractionSeparatorTexts = ['and']; + EnglishNumeric.HalfADozenRegex = `half\\s+a\\s+dozen`; + EnglishNumeric.DigitalNumberRegex = `((?<=\\b)(hundred|thousand|million|billion|trillion|dozen(s)?)(?=\\b))|((?<=(\\d|\\b))(k|t|m|g|b)(?=\\b))`; + EnglishNumeric.CardinalNumberMap = new Map([["a", 1], ["zero", 0], ["an", 1], ["one", 1], ["two", 2], ["three", 3], ["four", 4], ["five", 5], ["six", 6], ["seven", 7], ["eight", 8], ["nine", 9], ["ten", 10], ["eleven", 11], ["twelve", 12], ["dozen", 12], ["dozens", 12], ["thirteen", 13], ["fourteen", 14], ["fifteen", 15], ["sixteen", 16], ["seventeen", 17], ["eighteen", 18], ["nineteen", 19], ["twenty", 20], ["thirty", 30], ["forty", 40], ["fifty", 50], ["sixty", 60], ["seventy", 70], ["eighty", 80], ["ninety", 90], ["hundred", 100], ["thousand", 1000], ["million", 1000000], ["billion", 1000000000], ["trillion", 1000000000000]]); + EnglishNumeric.OrdinalNumberMap = new Map([["first", 1], ["second", 2], ["secondary", 2], ["half", 2], ["third", 3], ["fourth", 4], ["quarter", 4], ["fifth", 5], ["sixth", 6], ["seventh", 7], ["eighth", 8], ["ninth", 9], ["tenth", 10], ["eleventh", 11], ["twelfth", 12], ["thirteenth", 13], ["fourteenth", 14], ["fifteenth", 15], ["sixteenth", 16], ["seventeenth", 17], ["eighteenth", 18], ["nineteenth", 19], ["twentieth", 20], ["thirtieth", 30], ["fortieth", 40], ["fiftieth", 50], ["sixtieth", 60], ["seventieth", 70], ["eightieth", 80], ["ninetieth", 90], ["hundredth", 100], ["thousandth", 1000], ["millionth", 1000000], ["billionth", 1000000000], ["trillionth", 1000000000000], ["firsts", 1], ["halves", 2], ["thirds", 3], ["fourths", 4], ["quarters", 4], ["fifths", 5], ["sixths", 6], ["sevenths", 7], ["eighths", 8], ["ninths", 9], ["tenths", 10], ["elevenths", 11], ["twelfths", 12], ["thirteenths", 13], ["fourteenths", 14], ["fifteenths", 15], ["sixteenths", 16], ["seventeenths", 17], ["eighteenths", 18], ["nineteenths", 19], ["twentieths", 20], ["thirtieths", 30], ["fortieths", 40], ["fiftieths", 50], ["sixtieths", 60], ["seventieths", 70], ["eightieths", 80], ["ninetieths", 90], ["hundredths", 100], ["thousandths", 1000], ["millionths", 1000000], ["billionths", 1000000000], ["trillionths", 1000000000000]]); + EnglishNumeric.RoundNumberMap = new Map([["hundred", 100], ["thousand", 1000], ["million", 1000000], ["billion", 1000000000], ["trillion", 1000000000000], ["hundredth", 100], ["thousandth", 1000], ["millionth", 1000000], ["billionth", 1000000000], ["trillionth", 1000000000000], ["hundredths", 100], ["thousandths", 1000], ["millionths", 1000000], ["billionths", 1000000000], ["trillionths", 1000000000000], ["dozen", 12], ["dozens", 12], ["k", 1000], ["m", 1000000], ["g", 1000000000], ["b", 1000000000], ["t", 1000000000000]]); + EnglishNumeric.AmbiguityFiltersDict = new Map([["\\bone\\b", "\\b(the|this|that|which)\\s+(one)\\b"]]); +})(EnglishNumeric = exports.EnglishNumeric || (exports.EnglishNumeric = {})); + +}); + +unwrapExports(englishNumeric); + +var parserConfiguration = createCommonjsModule(function (module, exports) { +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); + + + +class EnglishNumberParserConfiguration { + constructor(ci) { + if (!ci) { + ci = new culture$2.CultureInfo(culture$2.Culture.English); + } + this.cultureInfo = ci; + this.langMarker = englishNumeric.EnglishNumeric.LangMarker; + this.decimalSeparatorChar = englishNumeric.EnglishNumeric.DecimalSeparatorChar; + this.fractionMarkerToken = englishNumeric.EnglishNumeric.FractionMarkerToken; + this.nonDecimalSeparatorChar = englishNumeric.EnglishNumeric.NonDecimalSeparatorChar; + this.halfADozenText = englishNumeric.EnglishNumeric.HalfADozenText; + this.wordSeparatorToken = englishNumeric.EnglishNumeric.WordSeparatorToken; + this.writtenDecimalSeparatorTexts = englishNumeric.EnglishNumeric.WrittenDecimalSeparatorTexts; + this.writtenGroupSeparatorTexts = englishNumeric.EnglishNumeric.WrittenGroupSeparatorTexts; + this.writtenIntegerSeparatorTexts = englishNumeric.EnglishNumeric.WrittenIntegerSeparatorTexts; + this.writtenFractionSeparatorTexts = englishNumeric.EnglishNumeric.WrittenFractionSeparatorTexts; + this.cardinalNumberMap = englishNumeric.EnglishNumeric.CardinalNumberMap; + this.ordinalNumberMap = englishNumeric.EnglishNumeric.OrdinalNumberMap; + this.roundNumberMap = englishNumeric.EnglishNumeric.RoundNumberMap; + this.negativeNumberSignRegex = recognizersText.RegExpUtility.getSafeRegExp(englishNumeric.EnglishNumeric.NegativeNumberSignRegex, "is"); + this.halfADozenRegex = recognizersText.RegExpUtility.getSafeRegExp(englishNumeric.EnglishNumeric.HalfADozenRegex, "gis"); + this.digitalNumberRegex = recognizersText.RegExpUtility.getSafeRegExp(englishNumeric.EnglishNumeric.DigitalNumberRegex, "gis"); + } + normalizeTokenSet(tokens, context) { + let fracWords = new Array(); + let tokenList = Array.from(tokens); + let tokenLen = tokenList.length; + for (let i = 0; i < tokenLen; i++) { + if (tokenList[i].includes("-")) { + let spiltedTokens = tokenList[i].split("-"); + if (spiltedTokens.length === 2 && this.ordinalNumberMap.has(spiltedTokens[1])) { + fracWords.push(spiltedTokens[0]); + fracWords.push(spiltedTokens[1]); + } + else { + fracWords.push(tokenList[i]); + } + } + else if ((i < tokenLen - 2) && tokenList[i + 1] === "-") { + if (this.ordinalNumberMap.has(tokenList[i + 2])) { + fracWords.push(tokenList[i]); + fracWords.push(tokenList[i + 2]); + } + else { + fracWords.push(tokenList[i] + tokenList[i + 1] + tokenList[i + 2]); + } + i += 2; + } + else { + fracWords.push(tokenList[i]); + } + } + return fracWords; + } + resolveCompositeNumber(numberStr) { + if (numberStr.includes("-")) { + let numbers = numberStr.split('-'); + let ret = 0; + numbers.forEach(num => { + if (this.ordinalNumberMap.has(num)) { + ret += this.ordinalNumberMap.get(num); + } + else if (this.cardinalNumberMap.has(num)) { + ret += this.cardinalNumberMap.get(num); + } + }); + return ret; + } + if (this.ordinalNumberMap.has(numberStr)) { + return this.ordinalNumberMap.get(numberStr); + } + if (this.cardinalNumberMap.has(numberStr)) { + return this.cardinalNumberMap.get(numberStr); + } + return 0; + } +} +exports.EnglishNumberParserConfiguration = EnglishNumberParserConfiguration; + +}); + +unwrapExports(parserConfiguration); + +var spanishNumeric = createCommonjsModule(function (module, exports) { +"use strict"; +// ------------------------------------------------------------------------------ +// +// This code was generated by a tool. +// Changes to this file may cause incorrect behavior and will be lost if +// the code is regenerated. +// +// ------------------------------------------------------------------------------ +Object.defineProperty(exports, "__esModule", { value: true }); + +var SpanishNumeric; +(function (SpanishNumeric) { + SpanishNumeric.LangMarker = 'Spa'; + SpanishNumeric.HundredsNumberIntegerRegex = `(cuatrocient[ao]s|trescient[ao]s|seiscient[ao]s|setecient[ao]s|ochocient[ao]s|novecient[ao]s|doscient[ao]s|quinient[ao]s|(? { return `(((?(${SpanishNumeric.AllIntRegex})|((?(${SpanishNumeric.AllIntRegex})|((\\d+)(?!\\.)))(?=\\b)`; + SpanishNumeric.AllPointRegex = `((\\s+${SpanishNumeric.ZeroToNineIntegerRegex})+|(\\s+${SpanishNumeric.AllIntRegex}))`; + SpanishNumeric.AllFloatRegex = `${SpanishNumeric.AllIntRegex}(\\s+(coma|con))${SpanishNumeric.AllPointRegex}`; + SpanishNumeric.DoubleDecimalPointRegex = (placeholder) => { return `(((? { return `(?<=\\s|^)(? { + spanishNumeric.SpanishNumeric.SuffixOrdinalMap.forEach((suffixValue, suffixKey) => { + if (!ordinalNumberMap.has(prefixKey + suffixKey)) { + ordinalNumberMap.set(prefixKey + suffixKey, prefixValue * suffixValue); + } + }); + }); + this.cardinalNumberMap = spanishNumeric.SpanishNumeric.CardinalNumberMap; + this.ordinalNumberMap = ordinalNumberMap; + this.roundNumberMap = spanishNumeric.SpanishNumeric.RoundNumberMap; + this.negativeNumberSignRegex = recognizersText.RegExpUtility.getSafeRegExp(spanishNumeric.SpanishNumeric.NegativeNumberSignRegex, "is"); + this.halfADozenRegex = recognizersText.RegExpUtility.getSafeRegExp(spanishNumeric.SpanishNumeric.HalfADozenRegex); + this.digitalNumberRegex = recognizersText.RegExpUtility.getSafeRegExp(spanishNumeric.SpanishNumeric.DigitalNumberRegex); + } + normalizeTokenSet(tokens, context) { + let result = new Array(); + tokens.forEach((token) => { + let tempWord = token.replace(/^s+/, '').replace(/s+$/, ''); + if (this.ordinalNumberMap.has(tempWord)) { + result.push(tempWord); + return; + } + if (tempWord.endsWith("avo") || tempWord.endsWith("ava")) { + let origTempWord = tempWord; + let newLength = origTempWord.length; + tempWord = origTempWord.substring(0, newLength - 3); + if (this.cardinalNumberMap.has(tempWord)) { + result.push(tempWord); + return; + } + else { + tempWord = origTempWord.substring(0, newLength - 2); + if (this.cardinalNumberMap.has(tempWord)) { + result.push(tempWord); + return; + } + } + } + result.push(token); + }); + return result; + } + resolveCompositeNumber(numberStr) { + if (this.ordinalNumberMap.has(numberStr)) { + return this.ordinalNumberMap.get(numberStr); + } + if (this.cardinalNumberMap.has(numberStr)) { + return this.cardinalNumberMap.get(numberStr); + } + let value = 0; + let finalValue = 0; + let strBuilder = ""; + let lastGoodChar = 0; + for (let i = 0; i < numberStr.length; i++) { + strBuilder = strBuilder.concat(numberStr[i]); + if (this.cardinalNumberMap.has(strBuilder) && this.cardinalNumberMap.get(strBuilder) > value) { + lastGoodChar = i; + value = this.cardinalNumberMap.get(strBuilder); + } + if ((i + 1) === numberStr.length) { + finalValue += value; + strBuilder = ""; + i = lastGoodChar++; + value = 0; + } + } + return finalValue; + } +} +exports.SpanishNumberParserConfiguration = SpanishNumberParserConfiguration; + +}); + +unwrapExports(parserConfiguration$2); + +var portugueseNumeric = createCommonjsModule(function (module, exports) { +"use strict"; +// ------------------------------------------------------------------------------ +// +// This code was generated by a tool. +// Changes to this file may cause incorrect behavior and will be lost if +// the code is regenerated. +// +// ------------------------------------------------------------------------------ +Object.defineProperty(exports, "__esModule", { value: true }); + +var PortugueseNumeric; +(function (PortugueseNumeric) { + PortugueseNumeric.LangMarker = 'Por'; + PortugueseNumeric.HundredsNumberIntegerRegex = `(quatrocent[ao]s|trezent[ao]s|seiscent[ao]s|setecent[ao]s|oitocent[ao]s|novecent[ao]s|duzent[ao]s|quinhent[ao]s|cem|(? { return `(((?(${PortugueseNumeric.AllIntRegex})|((?(${PortugueseNumeric.AllIntRegex})|((\\d+)(?!\\.)))(?=\\b)`; + PortugueseNumeric.AllFloatRegex = `${PortugueseNumeric.AllIntRegex}(\\s+(vírgula|virgula|e|ponto))${PortugueseNumeric.AllPointRegex}`; + PortugueseNumeric.DoubleWithMultiplierRegex = `(((? { return `(((? { return `(?<=\\s|^)(? { + portugueseNumeric.PortugueseNumeric.SuffixOrdinalMap.forEach((suffixValue, suffixKey) => { + if (!ordinalNumberMap.has(prefixKey + suffixKey)) { + ordinalNumberMap.set(prefixKey + suffixKey, prefixValue * suffixValue); + } + }); + }); + this.cardinalNumberMap = portugueseNumeric.PortugueseNumeric.CardinalNumberMap; + this.ordinalNumberMap = ordinalNumberMap; + this.roundNumberMap = portugueseNumeric.PortugueseNumeric.RoundNumberMap; + this.negativeNumberSignRegex = recognizersText.RegExpUtility.getSafeRegExp(portugueseNumeric.PortugueseNumeric.NegativeNumberSignRegex, "is"); + this.halfADozenRegex = recognizersText.RegExpUtility.getSafeRegExp(portugueseNumeric.PortugueseNumeric.HalfADozenRegex); + this.digitalNumberRegex = recognizersText.RegExpUtility.getSafeRegExp(portugueseNumeric.PortugueseNumeric.DigitalNumberRegex); + } + normalizeTokenSet(tokens, context) { + let result = new Array(); + tokens.forEach((token) => { + let tempWord = token.replace(/^s+/, '').replace(/s+$/, ''); + if (this.ordinalNumberMap.has(tempWord)) { + result.push(tempWord); + return; + } + // ends with 'avo' or 'ava' + if (portugueseNumeric.PortugueseNumeric.WrittenFractionSuffix.some(suffix => tempWord.endsWith(suffix))) { + let origTempWord = tempWord; + let newLength = origTempWord.length; + tempWord = origTempWord.substring(0, newLength - 3); + if (!tempWord) { + return; + } + else if (this.cardinalNumberMap.has(tempWord)) { + result.push(tempWord); + return; + } + else { + tempWord = origTempWord.substring(0, newLength - 2); + if (this.cardinalNumberMap.has(tempWord)) { + result.push(tempWord); + return; + } + } + } + result.push(token); + }); + return result; + } + resolveCompositeNumber(numberStr) { + if (this.ordinalNumberMap.has(numberStr)) { + return this.ordinalNumberMap.get(numberStr); + } + if (this.cardinalNumberMap.has(numberStr)) { + return this.cardinalNumberMap.get(numberStr); + } + let value = 0; + let finalValue = 0; + let strBuilder = ""; + let lastGoodChar = 0; + for (let i = 0; i < numberStr.length; i++) { + strBuilder = strBuilder.concat(numberStr[i]); + if (this.cardinalNumberMap.has(strBuilder) && this.cardinalNumberMap.get(strBuilder) > value) { + lastGoodChar = i; + value = this.cardinalNumberMap.get(strBuilder); + } + if ((i + 1) === numberStr.length) { + finalValue += value; + strBuilder = ""; + i = lastGoodChar++; + value = 0; + } + } + return finalValue; + } +} +exports.PortugueseNumberParserConfiguration = PortugueseNumberParserConfiguration; + +}); + +unwrapExports(parserConfiguration$4); + +var frenchNumeric = createCommonjsModule(function (module, exports) { +"use strict"; +// ------------------------------------------------------------------------------ +// +// This code was generated by a tool. +// Changes to this file may cause incorrect behavior and will be lost if +// the code is regenerated. +// +// ------------------------------------------------------------------------------ +Object.defineProperty(exports, "__esModule", { value: true }); + +var FrenchNumeric; +(function (FrenchNumeric) { + FrenchNumeric.LangMarker = 'Fr'; + FrenchNumeric.RoundNumberIntegerRegex = `(cent|mille|millions|million|milliard|milliards|billion|billions)`; + FrenchNumeric.ZeroToNineIntegerRegex = `(et un|un|une|deux|trois|quatre|cinq|six|sept|huit|neuf)`; + FrenchNumeric.TenToNineteenIntegerRegex = `((seize|quinze|quatorze|treize|douze|onze)|dix(\\Wneuf|\\Whuit|\\Wsept)?)`; + FrenchNumeric.TensNumberIntegerRegex = `(quatre\\Wvingt(s|\\Wdix)?|soixante\\Wdix|vingt|trente|quarante|cinquante|soixante|septante|octante|huitante|nonante)`; + FrenchNumeric.DigitsNumberRegex = `\\d|\\d{1,3}(\\.\\d{3})`; + FrenchNumeric.NegativeNumberTermsRegex = `^[.]`; + FrenchNumeric.NegativeNumberSignRegex = `^(${FrenchNumeric.NegativeNumberTermsRegex}\\s+).*`; + FrenchNumeric.HundredsNumberIntegerRegex = `((${FrenchNumeric.ZeroToNineIntegerRegex}(\\s+cent))|cent|((\\s+cent\\s)+${FrenchNumeric.TensNumberIntegerRegex}))`; + FrenchNumeric.BelowHundredsRegex = `((${FrenchNumeric.TenToNineteenIntegerRegex}|(${FrenchNumeric.TensNumberIntegerRegex}([-\\s]+(${FrenchNumeric.TenToNineteenIntegerRegex}|${FrenchNumeric.ZeroToNineIntegerRegex}))?))|${FrenchNumeric.ZeroToNineIntegerRegex})`; + FrenchNumeric.BelowThousandsRegex = `((${FrenchNumeric.HundredsNumberIntegerRegex}(\\s+${FrenchNumeric.BelowHundredsRegex})?|${FrenchNumeric.BelowHundredsRegex}|${FrenchNumeric.TenToNineteenIntegerRegex})|cent\\s+${FrenchNumeric.TenToNineteenIntegerRegex})`; + FrenchNumeric.SupportThousandsRegex = `((${FrenchNumeric.BelowThousandsRegex}|${FrenchNumeric.BelowHundredsRegex})\\s+${FrenchNumeric.RoundNumberIntegerRegex}(\\s+${FrenchNumeric.RoundNumberIntegerRegex})?)`; + FrenchNumeric.SeparaIntRegex = `(${FrenchNumeric.SupportThousandsRegex}(\\s+${FrenchNumeric.SupportThousandsRegex})*(\\s+${FrenchNumeric.BelowThousandsRegex})?|${FrenchNumeric.BelowThousandsRegex})`; + FrenchNumeric.AllIntRegex = `(${FrenchNumeric.SeparaIntRegex}|mille(\\s+${FrenchNumeric.BelowThousandsRegex})?)`; + FrenchNumeric.NumbersWithPlaceHolder = (placeholder) => { return `(((?(${FrenchNumeric.AllIntRegex})|((?(${FrenchNumeric.AllIntRegex})|((\\d+)(?!\\.)))(?=\\b)`; + FrenchNumeric.AllPointRegex = `((\\s+${FrenchNumeric.ZeroToNineIntegerRegex})+|(\\s+${FrenchNumeric.SeparaIntRegex}))`; + FrenchNumeric.AllFloatRegex = `(${FrenchNumeric.AllIntRegex}(\\s+(virgule|point))${FrenchNumeric.AllPointRegex})`; + FrenchNumeric.DoubleDecimalPointRegex = (placeholder) => { return `(((? { return `(?<=\\s|^)(? value) { + lastGoodChar = i; + value = this.cardinalNumberMap.get(strBuilder); + } + if ((i + 1) === numberStr.length) { + finalValue += value; + strBuilder = ""; + i = lastGoodChar++; + value = 0; + } + } + return finalValue; + } +} +exports.FrenchNumberParserConfiguration = FrenchNumberParserConfiguration; + +}); + +unwrapExports(parserConfiguration$6); + +var chineseNumeric = createCommonjsModule(function (module, exports) { +"use strict"; +// ------------------------------------------------------------------------------ +// +// This code was generated by a tool. +// Changes to this file may cause incorrect behavior and will be lost if +// the code is regenerated. +// +// ------------------------------------------------------------------------------ +Object.defineProperty(exports, "__esModule", { value: true }); +var ChineseNumeric; +(function (ChineseNumeric) { + ChineseNumeric.LangMarker = ''; + ChineseNumeric.DecimalSeparatorChar = '.'; + ChineseNumeric.FractionMarkerToken = ''; + ChineseNumeric.NonDecimalSeparatorChar = ' '; + ChineseNumeric.HalfADozenText = ''; + ChineseNumeric.WordSeparatorToken = ''; + ChineseNumeric.RoundNumberMap = new Map([["k", 1000], ["m", 1000000], ["g", 1000000000], ["t", 1000000000000]]); + ChineseNumeric.RoundNumberMapChar = new Map([["十", 10], ["百", 100], ["千", 1000], ["万", 10000], ["亿", 100000000], ["兆", 1000000000000], ["拾", 10], ["佰", 100], ["仟", 1000], ["萬", 10000], ["億", 100000000]]); + ChineseNumeric.ZeroToNineMap = new Map([["0", 0], ["1", 1], ["2", 2], ["3", 3], ["4", 4], ["5", 5], ["6", 6], ["7", 7], ["8", 8], ["9", 9], ["零", 0], ["一", 1], ["二", 2], ["三", 3], ["四", 4], ["五", 5], ["六", 6], ["七", 7], ["八", 8], ["九", 9], ["〇", 0], ["壹", 1], ["贰", 2], ["貳", 2], ["叁", 3], ["肆", 4], ["伍", 5], ["陆", 6], ["陸", 6], ["柒", 7], ["捌", 8], ["玖", 9], ["0", 0], ["1", 1], ["2", 2], ["3", 3], ["4", 4], ["5", 5], ["6", 6], ["7", 7], ["8", 8], ["9", 9], ["半", 0.5], ["两", 2], ["兩", 2], ["俩", 2], ["倆", 2], ["仨", 3]]); + ChineseNumeric.FullToHalfMap = new Map([["0", "0"], ["1", "1"], ["2", "2"], ["3", "3"], ["4", "4"], ["5", "5"], ["6", "6"], ["7", "7"], ["8", "8"], ["9", "9"], ["/", "/"], ["-", "-"], [",", "\'"], ["G", "G"], ["M", "M"], ["T", "T"], ["K", "K"], ["k", "k"], [".", "."]]); + ChineseNumeric.TratoSimMap = new Map([["佰", "百"], ["點", "点"], ["個", "个"], ["幾", "几"], ["對", "对"], ["雙", "双"]]); + ChineseNumeric.UnitMap = new Map([["萬萬", "億"], ["億萬", "兆"], ["萬億", "兆"], ["万万", "亿"], ["万亿", "兆"], ["亿万", "兆"], [" ", ""], ["多", ""], ["余", ""], ["几", ""]]); + ChineseNumeric.RoundDirectList = ['万', '萬', '亿', '兆', '億']; + ChineseNumeric.DigitalNumberRegex = `((?<=(\\d|\\b))(k|t|m|g)(?=\\b))`; + ChineseNumeric.ZeroToNineFullHalfRegex = `[\\d1234567890]`; + ChineseNumeric.DigitNumRegex = `${ChineseNumeric.ZeroToNineFullHalfRegex}+`; + ChineseNumeric.DozenRegex = `.*打$`; + ChineseNumeric.PercentageRegex = `(?<=百\\s*分\\s*之).+|.+(?=个\\s*百\\s*分\\s*点)|.*(?=[%%])`; + ChineseNumeric.DoubleAndRoundRegex = `${ChineseNumeric.ZeroToNineFullHalfRegex}+(\\.${ChineseNumeric.ZeroToNineFullHalfRegex}+)?\\s*[多几余]?[万亿萬億]{1,2}`; + ChineseNumeric.FracSplitRegex = `又|分\\s*之`; + ChineseNumeric.ZeroToNineIntegerRegex = `[一二三四五六七八九零壹贰貳叁肆伍陆陸柒捌玖〇两兩俩倆仨]`; + ChineseNumeric.NegativeNumberTermsRegex = `[负負]`; + ChineseNumeric.NegativeNumberTermsRegexNum = `((?)`; + ChineseNumeric.LessRegex = `(小于|少于|低于|小於|少於|低於|不到|不足|<)`; + ChineseNumeric.EqualRegex = `(等于|等於|=)`; + ChineseNumeric.MoreOrEqual = `((${ChineseNumeric.MoreRegex}\\s*(或|或者)?\\s*${ChineseNumeric.EqualRegex})|至少|最少|不${ChineseNumeric.LessRegex})`; + ChineseNumeric.MoreOrEqualSuffix = `(或|或者)\\s*(以上|之上|更[大多高])`; + ChineseNumeric.LessOrEqual = `((${ChineseNumeric.LessRegex}\\s*(或|或者)?\\s*${ChineseNumeric.EqualRegex})|至多|最多|不${ChineseNumeric.MoreRegex})`; + ChineseNumeric.LessOrEqualSuffix = `(或|或者)\\s*(以下|之下|更[小少低])`; + ChineseNumeric.OneNumberRangeMoreRegex1 = `(${ChineseNumeric.MoreOrEqual}|${ChineseNumeric.MoreRegex})\\s*(?((?!([并且而並的同時时]|(,(?!\\d+))|(,(?!\\d+))|。)).)+)`; + ChineseNumeric.OneNumberRangeMoreRegex2 = `比\\s*(?((?!((,(?!\\d+))|(,(?!\\d+))|。)).)+)\\s*更?[大多高]`; + ChineseNumeric.OneNumberRangeMoreRegex3 = `(?((?!((,(?!\\d+))|(,(?!\\d+))|。|[或者])).)+)\\s*(或|或者)?\\s*([多几余幾餘]|以上|之上|更[大多高])(?![万亿萬億]{1,2})`; + ChineseNumeric.OneNumberRangeLessRegex1 = `(${ChineseNumeric.LessOrEqual}|${ChineseNumeric.LessRegex})\\s*(?((?!([并且而並的同時时]|(,(?!\\d+))|(,(?!\\d+))|。)).)+)`; + ChineseNumeric.OneNumberRangeLessRegex2 = `比\\s*(?((?!((,(?!\\d+))|(,(?!\\d+))|。)).)+)\\s*更?[小少低]`; + ChineseNumeric.OneNumberRangeLessRegex3 = `(?((?!((,(?!\\d+))|(,(?!\\d+))|。|[或者])).)+)\\s*(或|或者)?\\s*(以下|之下|更[小少低])`; + ChineseNumeric.OneNumberRangeMoreSeparateRegex = `^[.]`; + ChineseNumeric.OneNumberRangeLessSeparateRegex = `^[.]`; + ChineseNumeric.OneNumberRangeEqualRegex = `${ChineseNumeric.EqualRegex}\\s*(?((?!((,(?!\\d+))|(,(?!\\d+))|。)).)+)`; + ChineseNumeric.TwoNumberRangeRegex1 = `((位于|在|位於)|(?=(\\d|\\+|\\-)))\\s*(?((?!((,(?!\\d+))|(,(?!\\d+))|。)).)+)\\s*(和|与|與|${ChineseNumeric.TillRegex})\\s*(?((?!((,(?!\\d+))|(,(?!\\d+))|。))[^之])+)\\s*(之)?(间|間)`; + ChineseNumeric.TwoNumberRangeRegex2 = `(${ChineseNumeric.OneNumberRangeMoreRegex1}|${ChineseNumeric.OneNumberRangeMoreRegex2}|${ChineseNumeric.OneNumberRangeMoreRegex3})\\s*(且|并且|而且|並且|((的)?同時)|((的)?同时)|,)?\\s*(${ChineseNumeric.OneNumberRangeLessRegex1}|${ChineseNumeric.OneNumberRangeLessRegex2}|${ChineseNumeric.OneNumberRangeLessRegex3})`; + ChineseNumeric.TwoNumberRangeRegex3 = `(${ChineseNumeric.OneNumberRangeLessRegex1}|${ChineseNumeric.OneNumberRangeLessRegex2}|${ChineseNumeric.OneNumberRangeLessRegex3})\\s*(且|并且|而且|並且|((的)?同時)|((的)?同时)|,)?\\s*(${ChineseNumeric.OneNumberRangeMoreRegex1}|${ChineseNumeric.OneNumberRangeMoreRegex2}|${ChineseNumeric.OneNumberRangeMoreRegex3})`; + ChineseNumeric.TwoNumberRangeRegex4 = `(?((?!((,(?!\\d+))|(,(?!\\d+))|。)).)+)\\s*${ChineseNumeric.TillRegex}\\s*(?((?!((,(?!\\d+))|(,(?!\\d+))|。)).)+)`; + ChineseNumeric.AmbiguousFractionConnectorsRegex = `^[.]`; +})(ChineseNumeric = exports.ChineseNumeric || (exports.ChineseNumeric = {})); + +}); + +unwrapExports(chineseNumeric); + +var parserConfiguration$8 = createCommonjsModule(function (module, exports) { +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); + + + +class ChineseNumberParserConfiguration { + constructor(ci) { + if (!ci) { + ci = new culture$2.CultureInfo(culture$2.Culture.Chinese); + } + this.cultureInfo = ci; + this.langMarker = chineseNumeric.ChineseNumeric.LangMarker; + this.decimalSeparatorChar = chineseNumeric.ChineseNumeric.DecimalSeparatorChar; + this.fractionMarkerToken = chineseNumeric.ChineseNumeric.FractionMarkerToken; + this.nonDecimalSeparatorChar = chineseNumeric.ChineseNumeric.NonDecimalSeparatorChar; + this.halfADozenText = chineseNumeric.ChineseNumeric.HalfADozenText; + this.wordSeparatorToken = chineseNumeric.ChineseNumeric.WordSeparatorToken; + this.writtenDecimalSeparatorTexts = []; + this.writtenGroupSeparatorTexts = []; + this.writtenIntegerSeparatorTexts = []; + this.writtenFractionSeparatorTexts = []; + this.cardinalNumberMap = new Map(); + this.ordinalNumberMap = new Map(); + this.roundNumberMap = chineseNumeric.ChineseNumeric.RoundNumberMap; + this.halfADozenRegex = null; + this.digitalNumberRegex = recognizersText.RegExpUtility.getSafeRegExp(chineseNumeric.ChineseNumeric.DigitalNumberRegex, "gis"); + this.zeroToNineMap = chineseNumeric.ChineseNumeric.ZeroToNineMap; + this.roundNumberMapChar = chineseNumeric.ChineseNumeric.RoundNumberMapChar; + this.fullToHalfMap = chineseNumeric.ChineseNumeric.FullToHalfMap; + this.tratoSimMap = chineseNumeric.ChineseNumeric.TratoSimMap; + this.unitMap = chineseNumeric.ChineseNumeric.UnitMap; + this.roundDirectList = chineseNumeric.ChineseNumeric.RoundDirectList; + this.digitNumRegex = recognizersText.RegExpUtility.getSafeRegExp(chineseNumeric.ChineseNumeric.DigitNumRegex, "gis"); + this.dozenRegex = recognizersText.RegExpUtility.getSafeRegExp(chineseNumeric.ChineseNumeric.DozenRegex, "gis"); + this.percentageRegex = recognizersText.RegExpUtility.getSafeRegExp(chineseNumeric.ChineseNumeric.PercentageRegex, "gis"); + this.doubleAndRoundRegex = recognizersText.RegExpUtility.getSafeRegExp(chineseNumeric.ChineseNumeric.DoubleAndRoundRegex, "gis"); + this.fracSplitRegex = recognizersText.RegExpUtility.getSafeRegExp(chineseNumeric.ChineseNumeric.FracSplitRegex, "gis"); + this.negativeNumberSignRegex = recognizersText.RegExpUtility.getSafeRegExp(chineseNumeric.ChineseNumeric.NegativeNumberSignRegex, "gis"); + this.pointRegex = recognizersText.RegExpUtility.getSafeRegExp(chineseNumeric.ChineseNumeric.PointRegex, "gis"); + this.speGetNumberRegex = recognizersText.RegExpUtility.getSafeRegExp(chineseNumeric.ChineseNumeric.SpeGetNumberRegex, "gis"); + this.pairRegex = recognizersText.RegExpUtility.getSafeRegExp(chineseNumeric.ChineseNumeric.PairRegex, "gis"); + this.roundNumberIntegerRegex = recognizersText.RegExpUtility.getSafeRegExp(chineseNumeric.ChineseNumeric.RoundNumberIntegerRegex, "gis"); + } + normalizeTokenSet(tokens, context) { + return tokens; + } + resolveCompositeNumber(numberStr) { + return 0; + } +} +exports.ChineseNumberParserConfiguration = ChineseNumberParserConfiguration; + +}); + +unwrapExports(parserConfiguration$8); + +var japaneseNumeric = createCommonjsModule(function (module, exports) { +"use strict"; +// ------------------------------------------------------------------------------ +// +// This code was generated by a tool. +// Changes to this file may cause incorrect behavior and will be lost if +// the code is regenerated. +// +// ------------------------------------------------------------------------------ +Object.defineProperty(exports, "__esModule", { value: true }); +var JapaneseNumeric; +(function (JapaneseNumeric) { + JapaneseNumeric.LangMarker = ''; + JapaneseNumeric.DecimalSeparatorChar = '.'; + JapaneseNumeric.FractionMarkerToken = ''; + JapaneseNumeric.NonDecimalSeparatorChar = ' '; + JapaneseNumeric.HalfADozenText = ''; + JapaneseNumeric.WordSeparatorToken = ''; + JapaneseNumeric.RoundNumberMap = new Map([["k", 1000], ["m", 1000000], ["g", 1000000000], ["t", 1000000000000]]); + JapaneseNumeric.RoundNumberMapChar = new Map([["十", 10], ["百", 100], ["千", 1000], ["万", 10000], ["億", 100000000], ["兆", 1000000000000]]); + JapaneseNumeric.ZeroToNineMap = new Map([["0", 0], ["1", 1], ["2", 2], ["3", 3], ["4", 4], ["5", 5], ["6", 6], ["7", 7], ["8", 8], ["9", 9], ["零", 0], ["一", 1], ["二", 2], ["三", 3], ["四", 4], ["五", 5], ["六", 6], ["七", 7], ["八", 8], ["九", 9], ["半", 0.5]]); + JapaneseNumeric.FullToHalfMap = new Map([["0", "0"], ["1", "1"], ["2", "2"], ["3", "3"], ["4", "4"], ["5", "5"], ["6", "6"], ["7", "7"], ["8", "8"], ["9", "9"], ["/", "/"], ["-", "-"], [",", "\'"], ["、", "\'"], ["G", "G"], ["M", "M"], ["T", "T"], ["K", "K"], ["k", "k"], [".", "."]]); + JapaneseNumeric.UnitMap = new Map([["万万", "億"], ["億万", "兆"], ["万億", "兆"], [" ", ""]]); + JapaneseNumeric.RoundDirectList = ['万', '億', '兆']; + JapaneseNumeric.DigitalNumberRegex = `((?<=(\\d|\\b))(k|t|m|g)(?=\\b))`; + JapaneseNumeric.ZeroToNineFullHalfRegex = `[\\d1234567890]`; + JapaneseNumeric.DigitNumRegex = `${JapaneseNumeric.ZeroToNineFullHalfRegex}+`; + JapaneseNumeric.DozenRegex = `.*ダース$`; + JapaneseNumeric.PercentageRegex = `.+(?=パ\\s*ー\\s*セ\\s*ン\\s*ト)|.*(?=[%%])`; + JapaneseNumeric.DoubleAndRoundRegex = `${JapaneseNumeric.ZeroToNineFullHalfRegex}+(\\.${JapaneseNumeric.ZeroToNineFullHalfRegex}+)?\\s*[万億]{1,2}(\\s*(以上))?`; + JapaneseNumeric.FracSplitRegex = `[はと]|分\\s*の`; + JapaneseNumeric.ZeroToNineIntegerRegex = `[一二三四五六七八九]`; + JapaneseNumeric.NegativeNumberTermsRegex = `(マ\\s*イ\\s*ナ\\s*ス)`; + JapaneseNumeric.NegativeNumberTermsRegexNum = `(?)`; + JapaneseNumeric.LessRegex = `(小なり|小さい|低い|<)`; + JapaneseNumeric.EqualRegex = `(等しい|イコール|=)`; + JapaneseNumeric.MoreOrEqual = `((大なりかイコール)|(大きいかイコール)|(大なりか等しい)|(大きいか等しい)|小さくない|以上|最低)`; + JapaneseNumeric.MoreOrEqualSuffix = `(より(大なりイコール|小さくない))`; + JapaneseNumeric.LessOrEqual = `((${JapaneseNumeric.LessRegex}\\s*(或|或者)?\\s*${JapaneseNumeric.EqualRegex})|(小なりかイコール)|(小なりか等しい)|(小さいかイコール)|(小さいか等しい)|(小さいか等しい)|大さくない|以下|最大)`; + JapaneseNumeric.LessOrEqualSuffix = `(小なりイコール|大さくない)`; + JapaneseNumeric.OneNumberRangeMoreRegex1 = `(?((?!(((,|、)(?!\\d+))|((,|、)(?!\\d+))|。)).)+)\\s*((より)\\s*((${JapaneseNumeric.MoreOrEqual}|${JapaneseNumeric.MoreRegex}))|超える|を超える)`; + JapaneseNumeric.OneNumberRangeMoreRegex2 = `(?((?!((,|、(?!\\d+))|(,|、(?!\\d+))|。)).)+)\\s*(より)?(大なり)`; + JapaneseNumeric.OneNumberRangeMoreRegex3 = `(?((?!((,(?!\\d+))|(,(?!\\d+))|。)).)+)\\s*(以上|最低)(?![万億]{1,2})`; + JapaneseNumeric.OneNumberRangeMoreRegex4 = `(${JapaneseNumeric.MoreOrEqual}|${JapaneseNumeric.MoreRegex})\\s*(?((?!(と|は|((と)?同時に)|((と)?そして)|が|,|、|,|(,(?!\\d+))|(,(?!\\d+))|。)).)+)`; + JapaneseNumeric.OneNumberRangeMoreSeparateRegex = `^[.]`; + JapaneseNumeric.OneNumberRangeLessSeparateRegex = `^[.]`; + JapaneseNumeric.OneNumberRangeLessRegex1 = `(?((?!(((,|、)(?!\\d+))|((,|、)(?!\\d+))|。)).)+)\\s*(より)\\s*(${JapaneseNumeric.LessOrEqual}|${JapaneseNumeric.LessRegex})`; + JapaneseNumeric.OneNumberRangeLessRegex2 = `(?((?!((,(?!\\d+))|(,(?!\\d+))|。)).)+)\\s*(より)?(小な)`; + JapaneseNumeric.OneNumberRangeLessRegex3 = `(?((?!((,(?!\\d+))|(,(?!\\d+))|。)).)+)\\s*(以下|未満)(?![万億]{1,2})`; + JapaneseNumeric.OneNumberRangeLessRegex4 = `(${JapaneseNumeric.LessOrEqual}|${JapaneseNumeric.LessRegex})\\s*(?((?!(と|は|((と)?同時に)|((と)?そして)|が|,|、|,|(,(?!\\d+))|(,(?!\\d+))|。)).)+)`; + JapaneseNumeric.OneNumberRangeEqualRegex = `(((?((?!((,(?!\\d+))|(,(?!\\d+))|。)).)+)\\s*(に)\\s*${JapaneseNumeric.EqualRegex})|(${JapaneseNumeric.EqualRegex}\\s*(?((?!((,(?!\\d+))|(,(?!\\d+))|。)).)+)))`; + JapaneseNumeric.TwoNumberRangeRegex1 = `(?((?!((,(?!\\d+))|(,(?!\\d+))|。)).)+)\\s*(と|${JapaneseNumeric.TillRegex})\\s*(?((?!((,(?!\\d+))|(,(?!\\d+))|。)).)+)\\s*(の間)`; + JapaneseNumeric.TwoNumberRangeRegex2 = `(${JapaneseNumeric.OneNumberRangeMoreRegex1}|${JapaneseNumeric.OneNumberRangeMoreRegex2}|${JapaneseNumeric.OneNumberRangeMoreRegex3}|${JapaneseNumeric.OneNumberRangeMoreRegex4})\\s*(と|は|((と)?同時に)|((と)?そして)|が|,|、|,)?\\s*(${JapaneseNumeric.OneNumberRangeLessRegex1}|${JapaneseNumeric.OneNumberRangeLessRegex2}|${JapaneseNumeric.OneNumberRangeLessRegex3}|${JapaneseNumeric.OneNumberRangeLessRegex4})`; + JapaneseNumeric.TwoNumberRangeRegex3 = `(${JapaneseNumeric.OneNumberRangeLessRegex1}|${JapaneseNumeric.OneNumberRangeLessRegex2}|${JapaneseNumeric.OneNumberRangeLessRegex3}|${JapaneseNumeric.OneNumberRangeLessRegex4})\\s*(と|は|((と)?同時に)|((と)?そして)|が|,|、|,)?\\s*(${JapaneseNumeric.OneNumberRangeMoreRegex1}|${JapaneseNumeric.OneNumberRangeMoreRegex2}|${JapaneseNumeric.OneNumberRangeMoreRegex3}|${JapaneseNumeric.OneNumberRangeMoreRegex4})`; + JapaneseNumeric.TwoNumberRangeRegex4 = `(?((?!((,(?!\\d+))|(,(?!\\d+))|。)).)+)\\s*${JapaneseNumeric.TillRegex}\\s*(?((?!((,(?!\\d+))|(,(?!\\d+))|。)).)+)`; + JapaneseNumeric.AmbiguousFractionConnectorsRegex = `^[.]`; +})(JapaneseNumeric = exports.JapaneseNumeric || (exports.JapaneseNumeric = {})); + +}); + +unwrapExports(japaneseNumeric); + +var parserConfiguration$10 = createCommonjsModule(function (module, exports) { +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); + + + +class JapaneseNumberParserConfiguration { + // readonly NumberOptions Options { get; } + // readonly Regex FractionPrepositionRegex { get; } + // readonly string NonDecimalSeparatorText + constructor(ci) { + if (!ci) { + ci = new culture$2.CultureInfo(culture$2.Culture.Japanese); + } + this.cultureInfo = ci; + this.langMarker = japaneseNumeric.JapaneseNumeric.LangMarker; + this.decimalSeparatorChar = japaneseNumeric.JapaneseNumeric.DecimalSeparatorChar; + this.fractionMarkerToken = japaneseNumeric.JapaneseNumeric.FractionMarkerToken; + this.nonDecimalSeparatorChar = japaneseNumeric.JapaneseNumeric.NonDecimalSeparatorChar; + this.halfADozenText = japaneseNumeric.JapaneseNumeric.HalfADozenText; + this.wordSeparatorToken = japaneseNumeric.JapaneseNumeric.WordSeparatorToken; + this.writtenDecimalSeparatorTexts = []; + this.writtenGroupSeparatorTexts = []; + this.writtenIntegerSeparatorTexts = []; + this.writtenFractionSeparatorTexts = []; + this.cardinalNumberMap = new Map(); + this.ordinalNumberMap = new Map(); + this.roundNumberMap = japaneseNumeric.JapaneseNumeric.RoundNumberMap; + this.halfADozenRegex = null; + this.digitalNumberRegex = recognizersText.RegExpUtility.getSafeRegExp(japaneseNumeric.JapaneseNumeric.DigitalNumberRegex, "gis"); + this.zeroToNineMap = japaneseNumeric.JapaneseNumeric.ZeroToNineMap; + this.roundNumberMapChar = japaneseNumeric.JapaneseNumeric.RoundNumberMapChar; + this.fullToHalfMap = japaneseNumeric.JapaneseNumeric.FullToHalfMap; + this.tratoSimMap = null; + this.unitMap = japaneseNumeric.JapaneseNumeric.UnitMap; + this.roundDirectList = japaneseNumeric.JapaneseNumeric.RoundDirectList; + this.digitNumRegex = recognizersText.RegExpUtility.getSafeRegExp(japaneseNumeric.JapaneseNumeric.DigitNumRegex, "gis"); + this.dozenRegex = recognizersText.RegExpUtility.getSafeRegExp(japaneseNumeric.JapaneseNumeric.DozenRegex, "gis"); + this.percentageRegex = recognizersText.RegExpUtility.getSafeRegExp(japaneseNumeric.JapaneseNumeric.PercentageRegex, "gis"); + this.doubleAndRoundRegex = recognizersText.RegExpUtility.getSafeRegExp(japaneseNumeric.JapaneseNumeric.DoubleAndRoundRegex, "gis"); + this.fracSplitRegex = recognizersText.RegExpUtility.getSafeRegExp(japaneseNumeric.JapaneseNumeric.FracSplitRegex, "gis"); + this.negativeNumberSignRegex = recognizersText.RegExpUtility.getSafeRegExp(japaneseNumeric.JapaneseNumeric.NegativeNumberSignRegex, "is"); + this.pointRegex = recognizersText.RegExpUtility.getSafeRegExp(japaneseNumeric.JapaneseNumeric.PointRegex, "gis"); + this.speGetNumberRegex = recognizersText.RegExpUtility.getSafeRegExp(japaneseNumeric.JapaneseNumeric.SpeGetNumberRegex, "gis"); + this.pairRegex = recognizersText.RegExpUtility.getSafeRegExp(japaneseNumeric.JapaneseNumeric.PairRegex, "gis"); + this.roundNumberIntegerRegex = recognizersText.RegExpUtility.getSafeRegExp(japaneseNumeric.JapaneseNumeric.RoundNumberIntegerRegex, "gis"); + } + normalizeTokenSet(tokens, context) { + return tokens; + } + resolveCompositeNumber(numberStr) { + return 0; + } +} +exports.JapaneseNumberParserConfiguration = JapaneseNumberParserConfiguration; + +}); + +unwrapExports(parserConfiguration$10); + +/** + * lodash (Custom Build) + * Build: `lodash modularize exports="npm" -o ./` + * Copyright jQuery Foundation and other contributors + * Released under MIT license + * Based on Underscore.js 1.8.3 + * Copyright Jeremy Ashkenas, DocumentCloud and Investigative Reporters & Editors + */ + +/** Used as references for various `Number` constants. */ +var INFINITY$1 = 1 / 0; + +/** `Object#toString` result references. */ +var symbolTag$1 = '[object Symbol]'; + +/** + * Used to match `RegExp` + * [syntax characters](http://ecma-international.org/ecma-262/6.0/#sec-patterns). + */ +var reRegExpChar = /[\\^$.*+?()[\]{}|]/g; +var reHasRegExpChar = RegExp(reRegExpChar.source); + +/** Detect free variable `global` from Node.js. */ +var freeGlobal$1 = typeof commonjsGlobal == 'object' && commonjsGlobal && commonjsGlobal.Object === Object && commonjsGlobal; + +/** Detect free variable `self`. */ +var freeSelf$1 = typeof self == 'object' && self && self.Object === Object && self; + +/** Used as a reference to the global object. */ +var root$1 = freeGlobal$1 || freeSelf$1 || Function('return this')(); + +/** Used for built-in method references. */ +var objectProto$1 = Object.prototype; + +/** + * Used to resolve the + * [`toStringTag`](http://ecma-international.org/ecma-262/6.0/#sec-object.prototype.tostring) + * of values. + */ +var objectToString$1 = objectProto$1.toString; + +/** Built-in value references. */ +var Symbol$2 = root$1.Symbol; + +/** Used to convert symbols to primitives and strings. */ +var symbolProto$1 = Symbol$2 ? Symbol$2.prototype : undefined; +var symbolToString$1 = symbolProto$1 ? symbolProto$1.toString : undefined; + +/** + * The base implementation of `_.toString` which doesn't convert nullish + * values to empty strings. + * + * @private + * @param {*} value The value to process. + * @returns {string} Returns the string. + */ +function baseToString$1(value) { + // Exit early for strings to avoid a performance hit in some environments. + if (typeof value == 'string') { + return value; + } + if (isSymbol$1(value)) { + return symbolToString$1 ? symbolToString$1.call(value) : ''; + } + var result = (value + ''); + return (result == '0' && (1 / value) == -INFINITY$1) ? '-0' : result; +} + +/** + * Checks if `value` is object-like. A value is object-like if it's not `null` + * and has a `typeof` result of "object". + * + * @static + * @memberOf _ + * @since 4.0.0 + * @category Lang + * @param {*} value The value to check. + * @returns {boolean} Returns `true` if `value` is object-like, else `false`. + * @example + * + * _.isObjectLike({}); + * // => true + * + * _.isObjectLike([1, 2, 3]); + * // => true + * + * _.isObjectLike(_.noop); + * // => false + * + * _.isObjectLike(null); + * // => false + */ +function isObjectLike$1(value) { + return !!value && typeof value == 'object'; +} + +/** + * Checks if `value` is classified as a `Symbol` primitive or object. + * + * @static + * @memberOf _ + * @since 4.0.0 + * @category Lang + * @param {*} value The value to check. + * @returns {boolean} Returns `true` if `value` is a symbol, else `false`. + * @example + * + * _.isSymbol(Symbol.iterator); + * // => true + * + * _.isSymbol('abc'); + * // => false + */ +function isSymbol$1(value) { + return typeof value == 'symbol' || + (isObjectLike$1(value) && objectToString$1.call(value) == symbolTag$1); +} + +/** + * Converts `value` to a string. An empty string is returned for `null` + * and `undefined` values. The sign of `-0` is preserved. + * + * @static + * @memberOf _ + * @since 4.0.0 + * @category Lang + * @param {*} value The value to process. + * @returns {string} Returns the string. + * @example + * + * _.toString(null); + * // => '' + * + * _.toString(-0); + * // => '-0' + * + * _.toString([1, 2, 3]); + * // => '1,2,3' + */ +function toString$1(value) { + return value == null ? '' : baseToString$1(value); +} + +/** + * Escapes the `RegExp` special characters "^", "$", "\", ".", "*", "+", + * "?", "(", ")", "[", "]", "{", "}", and "|" in `string`. + * + * @static + * @memberOf _ + * @since 3.0.0 + * @category String + * @param {string} [string=''] The string to escape. + * @returns {string} Returns the escaped string. + * @example + * + * _.escapeRegExp('[lodash](https://lodash.com/)'); + * // => '\[lodash\]\(https://lodash\.com/\)' + */ +function escapeRegExp(string) { + string = toString$1(string); + return (string && reHasRegExpChar.test(string)) + ? string.replace(reRegExpChar, '\\$&') + : string; +} + +var lodash_escaperegexp = escapeRegExp; + +var extractors$4 = createCommonjsModule(function (module, exports) { +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); + + + + +class BaseNumberExtractor { + constructor() { + this.extractType = ""; + this.negativeNumberTermsRegex = null; + } + extract(source) { + if (!source || source.trim().length === 0) { + return []; + } + let result = new Array(); + let matchSource = new Map(); + let matched = new Array(source.length); + for (let i = 0; i < source.length; i++) { + matched[i] = false; + } + let collections = this.regexes + .map(o => ({ matches: recognizersText.RegExpUtility.getMatches(o.regExp, source), value: o.value })) + .filter(o => o.matches && o.matches.length); + collections.forEach(collection => { + collection.matches.forEach(m => { + for (let j = 0; j < m.length; j++) { + matched[m.index + j] = true; + } + // Keep Source Data for extra information + matchSource.set(m, collection.value); + }); + }); + let last = -1; + for (let i = 0; i < source.length; i++) { + if (matched[i]) { + if (i + 1 === source.length || !matched[i + 1]) { + let start = last + 1; + let length = i - last; + let substr = source.substring(start, start + length); + let srcMatch = Array.from(matchSource.keys()).find(m => m.index === start && m.length === length); + // Extract negative numbers + if (this.negativeNumberTermsRegex !== null) { + let match = source.substr(0, start).match(this.negativeNumberTermsRegex); + if (match) { + start = match.index; + length = length + match[0].length; + substr = match[0] + substr; + } + } + if (srcMatch) { + result.push({ + start: start, + length: length, + text: substr, + type: this.extractType, + data: matchSource.has(srcMatch) ? matchSource.get(srcMatch) : null + }); + } + } + } + else { + last = i; + } + } + return result; + } + generateLongFormatNumberRegexes(type, placeholder = baseNumbers.BaseNumbers.PlaceHolderDefault) { + let thousandsMark = lodash_escaperegexp(type.thousandsMark); + let decimalsMark = lodash_escaperegexp(type.decimalsMark); + let regexDefinition = type.decimalsMark === '\0' + ? baseNumbers.BaseNumbers.IntegerRegexDefinition(placeholder, thousandsMark) + : baseNumbers.BaseNumbers.DoubleRegexDefinition(placeholder, thousandsMark, decimalsMark); + return recognizersText.RegExpUtility.getSafeRegExp(regexDefinition, "gis"); + } +} +exports.BaseNumberExtractor = BaseNumberExtractor; +class BasePercentageExtractor { + constructor(numberExtractor) { + this.extractType = constants.Constants.SYS_NUM_PERCENTAGE; + this.numberExtractor = numberExtractor; + this.regexes = this.initRegexes(); + } + extract(source) { + let originSource = source; + let positionMap; + let numExtResults; + // preprocess the source sentence via extracting and replacing the numbers in it + let preprocess = this.preprocessStrWithNumberExtracted(originSource); + source = preprocess.source; + positionMap = preprocess.positionMap; + numExtResults = preprocess.numExtResults; + let allMatches = this.regexes.map(rx => recognizersText.RegExpUtility.getMatches(rx, source)); + let matched = new Array(source.length); + for (let i = 0; i < source.length; i++) { + matched[i] = false; + } + for (let i = 0; i < allMatches.length; i++) { + allMatches[i].forEach(match => { + for (let j = 0; j < match.length; j++) { + matched[j + match.index] = true; + } + }); + } + let result = new Array(); + let last = -1; + // get index of each matched results + for (let i = 0; i < source.length; i++) { + if (matched[i]) { + if (i + 1 === source.length || matched[i + 1] === false) { + let start = last + 1; + let length = i - last; + let substr = source.substring(start, start + length); + let er = { + start: start, + length: length, + text: substr, + type: this.extractType + }; + result.push(er); + } + } + else { + last = i; + } + } + // post-processing, restoring the extracted numbers + this.postProcessing(result, originSource, positionMap, numExtResults); + return result; + } + // get the number extractor results and convert the extracted numbers to @sys.num, so that the regexes can work + preprocessStrWithNumberExtracted(str) { + let positionMap = new Map(); + let numExtResults = this.numberExtractor.extract(str); + let replaceText = baseNumbers.BaseNumbers.NumberReplaceToken; + let match = new Array(str.length); + let strParts = new Array(); + let start; + let end; + for (let i = 0; i < str.length; i++) { + match[i] = -1; + } + for (let i = 0; i < numExtResults.length; i++) { + let extraction = numExtResults[i]; + start = extraction.start; + end = extraction.length + start; + for (let j = start; j < end; j++) { + if (match[j] === -1) { + match[j] = i; + } + } + } + start = 0; + for (let i = 1; i < str.length; i++) { + if (match[i] !== match[i - 1]) { + strParts.push([start, i - 1]); + start = i; + } + } + strParts.push([start, str.length - 1]); + let ret = ""; + let index = 0; + strParts.forEach(strPart => { + start = strPart[0]; + end = strPart[1]; + let type = match[start]; + if (type === -1) { + ret += str.substring(start, end + 1); + for (let i = start; i <= end; i++) { + positionMap.set(index++, i); + } + } + else { + let originalText = str.substring(start, end + 1); + ret += replaceText; + for (let i = 0; i < replaceText.length; i++) { + positionMap.set(index++, start); + } + } + }); + positionMap.set(index++, str.length); + return { + numExtResults: numExtResults, + source: ret, + positionMap: positionMap + }; + } + // replace the @sys.num to the real patterns, directly modifies the ExtractResult + postProcessing(results, originSource, positionMap, numExtResults) { + let replaceText = baseNumbers.BaseNumbers.NumberReplaceToken; + for (let i = 0; i < results.length; i++) { + let start = results[i].start; + let end = start + results[i].length; + let str = results[i].text; + if (positionMap.has(start) && positionMap.has(end)) { + let originStart = positionMap.get(start); + let originLenth = positionMap.get(end) - originStart; + results[i].start = originStart; + results[i].length = originLenth; + results[i].text = originSource.substring(originStart, originStart + originLenth).trim(); + let numStart = str.indexOf(replaceText); + if (numStart !== -1) { + let numOriginStart = start + numStart; + if (positionMap.has(numStart)) { + let dataKey = originSource.substring(positionMap.get(numOriginStart), positionMap.get(numOriginStart + replaceText.length)); + for (let j = i; j < numExtResults.length; j++) { + if (results[i].start === numExtResults[j].start && results[i].text.includes(numExtResults[j].text)) { + results[i].data = [dataKey, numExtResults[j]]; + break; + } + } + } + } + } + } + } + // read the rules + buildRegexes(regexStrs, ignoreCase = true) { + return regexStrs.map(regexStr => { + let options = "gs"; + if (ignoreCase) { + options += "i"; + } + return recognizersText.RegExpUtility.getSafeRegExp(regexStr, options); + }); + } +} +BasePercentageExtractor.numExtType = constants.Constants.SYS_NUM; +exports.BasePercentageExtractor = BasePercentageExtractor; + +}); + +unwrapExports(extractors$4); + +var extractors$2 = createCommonjsModule(function (module, exports) { +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); + + + + + +class EnglishNumberExtractor extends extractors$4.BaseNumberExtractor { + constructor(mode = models$2.NumberMode.Default) { + super(); + this.extractType = constants.Constants.SYS_NUM; + this.negativeNumberTermsRegex = recognizersText.RegExpUtility.getSafeRegExp(englishNumeric.EnglishNumeric.NegativeNumberTermsRegex + "$", "is"); + let regexes = new Array(); + // Add Cardinal + let cardExtract = null; + switch (mode) { + case models$2.NumberMode.PureNumber: + cardExtract = new EnglishCardinalExtractor(englishNumeric.EnglishNumeric.PlaceHolderPureNumber); + break; + case models$2.NumberMode.Currency: + regexes.push({ regExp: recognizersText.RegExpUtility.getSafeRegExp(englishNumeric.EnglishNumeric.CurrencyRegex, "gs"), value: "IntegerNum" }); + break; + case models$2.NumberMode.Default: + break; + } + if (cardExtract === null) { + cardExtract = new EnglishCardinalExtractor(); + } + cardExtract.regexes.forEach(r => regexes.push(r)); + // Add Fraction + let fracExtract = new EnglishFractionExtractor(); + fracExtract.regexes.forEach(r => regexes.push(r)); + this.regexes = regexes; + } +} +exports.EnglishNumberExtractor = EnglishNumberExtractor; +class EnglishCardinalExtractor extends extractors$4.BaseNumberExtractor { + constructor(placeholder = englishNumeric.EnglishNumeric.PlaceHolderDefault) { + super(); + this.extractType = constants.Constants.SYS_NUM_CARDINAL; + let regexes = new Array(); + // Add Integer Regexes + let intExtract = new EnglishIntegerExtractor(placeholder); + intExtract.regexes.forEach(r => regexes.push(r)); + // Add Double Regexes + let doubleExtract = new EnglishDoubleExtractor(placeholder); + doubleExtract.regexes.forEach(r => regexes.push(r)); + this.regexes = regexes; + } +} +exports.EnglishCardinalExtractor = EnglishCardinalExtractor; +class EnglishIntegerExtractor extends extractors$4.BaseNumberExtractor { + constructor(placeholder = englishNumeric.EnglishNumeric.PlaceHolderDefault) { + super(); + this.extractType = constants.Constants.SYS_NUM_INTEGER; + let regexes = new Array({ + regExp: recognizersText.RegExpUtility.getSafeRegExp(englishNumeric.EnglishNumeric.NumbersWithPlaceHolder(placeholder), "gi"), + value: "IntegerNum" + }, { + regExp: recognizersText.RegExpUtility.getSafeRegExp(englishNumeric.EnglishNumeric.NumbersWithSuffix, "gs"), + value: "IntegerNum" + }, { + regExp: this.generateLongFormatNumberRegexes(models$2.LongFormatType.integerNumComma, placeholder), + value: "IntegerNum" + }, { + regExp: this.generateLongFormatNumberRegexes(models$2.LongFormatType.integerNumBlank, placeholder), + value: "IntegerNum" + }, { + regExp: this.generateLongFormatNumberRegexes(models$2.LongFormatType.integerNumNoBreakSpace, placeholder), + value: "IntegerNum" + }, { + regExp: recognizersText.RegExpUtility.getSafeRegExp(englishNumeric.EnglishNumeric.RoundNumberIntegerRegexWithLocks, "gis"), + value: "IntegerNum" + }, { + regExp: recognizersText.RegExpUtility.getSafeRegExp(englishNumeric.EnglishNumeric.NumbersWithDozenSuffix, "gis"), + value: "IntegerNum" + }, { + regExp: recognizersText.RegExpUtility.getSafeRegExp(englishNumeric.EnglishNumeric.AllIntRegexWithLocks, "gis"), + value: "IntegerEng" + }, { + regExp: recognizersText.RegExpUtility.getSafeRegExp(englishNumeric.EnglishNumeric.AllIntRegexWithDozenSuffixLocks, "gis"), + value: "IntegerEng" + }); + this.regexes = regexes; + } +} +exports.EnglishIntegerExtractor = EnglishIntegerExtractor; +class EnglishDoubleExtractor extends extractors$4.BaseNumberExtractor { + constructor(placeholder = englishNumeric.EnglishNumeric.PlaceHolderDefault) { + super(); + this.extractType = constants.Constants.SYS_NUM_DOUBLE; + let regexes = new Array({ + regExp: recognizersText.RegExpUtility.getSafeRegExp(englishNumeric.EnglishNumeric.DoubleDecimalPointRegex(placeholder), "gis"), + value: "DoubleNum" + }, { + regExp: recognizersText.RegExpUtility.getSafeRegExp(englishNumeric.EnglishNumeric.DoubleWithoutIntegralRegex(placeholder), "gis"), + value: "DoubleNum" + }, { + regExp: this.generateLongFormatNumberRegexes(models$2.LongFormatType.doubleNumCommaDot, placeholder), + value: "DoubleNum" + }, { + regExp: this.generateLongFormatNumberRegexes(models$2.LongFormatType.doubleNumNoBreakSpaceDot, placeholder), + value: "DoubleNum" + }, { + regExp: recognizersText.RegExpUtility.getSafeRegExp(englishNumeric.EnglishNumeric.DoubleWithMultiplierRegex, "gs"), + value: "DoubleNum" + }, { + regExp: recognizersText.RegExpUtility.getSafeRegExp(englishNumeric.EnglishNumeric.DoubleWithRoundNumber, "gis"), + value: "DoubleNum" + }, { + regExp: recognizersText.RegExpUtility.getSafeRegExp(englishNumeric.EnglishNumeric.DoubleAllFloatRegex, "gis"), + value: "DoubleEng" + }, { + regExp: recognizersText.RegExpUtility.getSafeRegExp(englishNumeric.EnglishNumeric.DoubleExponentialNotationRegex, "gis"), + value: "DoublePow" + }, { + regExp: recognizersText.RegExpUtility.getSafeRegExp(englishNumeric.EnglishNumeric.DoubleCaretExponentialNotationRegex, "gis"), + value: "DoublePow" + }); + this.regexes = regexes; + } +} +exports.EnglishDoubleExtractor = EnglishDoubleExtractor; +class EnglishFractionExtractor extends extractors$4.BaseNumberExtractor { + constructor() { + super(); + this.extractType = constants.Constants.SYS_NUM_FRACTION; + let regexes = new Array({ + regExp: recognizersText.RegExpUtility.getSafeRegExp(englishNumeric.EnglishNumeric.FractionNotationWithSpacesRegex, "gis"), + value: "FracNum" + }, { + regExp: recognizersText.RegExpUtility.getSafeRegExp(englishNumeric.EnglishNumeric.FractionNotationRegex, "gis"), + value: "FracNum" + }, { + regExp: recognizersText.RegExpUtility.getSafeRegExp(englishNumeric.EnglishNumeric.FractionNounRegex, "gis"), + value: "FracEng" + }, { + regExp: recognizersText.RegExpUtility.getSafeRegExp(englishNumeric.EnglishNumeric.FractionNounWithArticleRegex, "gis"), + value: "FracEng" + }, { + regExp: recognizersText.RegExpUtility.getSafeRegExp(englishNumeric.EnglishNumeric.FractionPrepositionRegex, "gis"), + value: "FracEng" + }); + this.regexes = regexes; + } +} +exports.EnglishFractionExtractor = EnglishFractionExtractor; +class EnglishOrdinalExtractor extends extractors$4.BaseNumberExtractor { + constructor() { + super(); + this.extractType = constants.Constants.SYS_NUM_ORDINAL; + let regexes = new Array({ + regExp: recognizersText.RegExpUtility.getSafeRegExp(englishNumeric.EnglishNumeric.OrdinalSuffixRegex, "gis"), + value: "OrdinalNum" + }, { + regExp: recognizersText.RegExpUtility.getSafeRegExp(englishNumeric.EnglishNumeric.OrdinalNumericRegex, "gis"), + value: "OrdinalNum" + }, { + regExp: recognizersText.RegExpUtility.getSafeRegExp(englishNumeric.EnglishNumeric.OrdinalEnglishRegex, "gis"), + value: "OrdEng" + }, { + regExp: recognizersText.RegExpUtility.getSafeRegExp(englishNumeric.EnglishNumeric.OrdinalRoundNumberRegex, "gis"), + value: "OrdEng" + }); + this.regexes = regexes; + } +} +exports.EnglishOrdinalExtractor = EnglishOrdinalExtractor; +class EnglishPercentageExtractor extends extractors$4.BasePercentageExtractor { + constructor() { + super(new EnglishNumberExtractor()); + } + initRegexes() { + let regexStrs = [ + englishNumeric.EnglishNumeric.NumberWithSuffixPercentage, + englishNumeric.EnglishNumeric.NumberWithPrefixPercentage + ]; + return this.buildRegexes(regexStrs); + } +} +exports.EnglishPercentageExtractor = EnglishPercentageExtractor; + +}); + +unwrapExports(extractors$2); + +var extractors$6 = createCommonjsModule(function (module, exports) { +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); + + + + + +class SpanishNumberExtractor extends extractors$4.BaseNumberExtractor { + constructor(mode = models$2.NumberMode.Default) { + super(); + this.extractType = constants.Constants.SYS_NUM; + let regexes = new Array(); + // Add Cardinal + let cardExtract = null; + switch (mode) { + case models$2.NumberMode.PureNumber: + cardExtract = new SpanishCardinalExtractor(spanishNumeric.SpanishNumeric.PlaceHolderPureNumber); + break; + case models$2.NumberMode.Currency: + regexes.push({ regExp: recognizersText.RegExpUtility.getSafeRegExp(spanishNumeric.SpanishNumeric.CurrencyRegex, "gs"), value: "IntegerNum" }); + break; + case models$2.NumberMode.Default: + break; + } + if (cardExtract === null) { + cardExtract = new SpanishCardinalExtractor(); + } + cardExtract.regexes.forEach(r => regexes.push(r)); + // Add Fraction + let fracExtract = new SpanishFractionExtractor(); + fracExtract.regexes.forEach(r => regexes.push(r)); + this.regexes = regexes; + } +} +exports.SpanishNumberExtractor = SpanishNumberExtractor; +class SpanishCardinalExtractor extends extractors$4.BaseNumberExtractor { + constructor(placeholder = spanishNumeric.SpanishNumeric.PlaceHolderDefault) { + super(); + this.extractType = constants.Constants.SYS_NUM_CARDINAL; + let regexes = new Array(); + // Add Integer Regexes + let intExtract = new SpanishIntegerExtractor(placeholder); + intExtract.regexes.forEach(r => regexes.push(r)); + // Add Double Regexes + let doubleExtract = new SpanishDoubleExtractor(placeholder); + doubleExtract.regexes.forEach(r => regexes.push(r)); + this.regexes = regexes; + } +} +exports.SpanishCardinalExtractor = SpanishCardinalExtractor; +class SpanishIntegerExtractor extends extractors$4.BaseNumberExtractor { + constructor(placeholder = spanishNumeric.SpanishNumeric.PlaceHolderDefault) { + super(); + this.extractType = constants.Constants.SYS_NUM_INTEGER; + let regexes = new Array({ + regExp: recognizersText.RegExpUtility.getSafeRegExp(spanishNumeric.SpanishNumeric.NumbersWithPlaceHolder(placeholder), "gi"), + value: "IntegerNum" + }, { + regExp: recognizersText.RegExpUtility.getSafeRegExp(spanishNumeric.SpanishNumeric.NumbersWithSuffix, "gs"), + value: "IntegerNum" + }, { + regExp: this.generateLongFormatNumberRegexes(models$2.LongFormatType.integerNumDot, placeholder), + value: "IntegerNum" + }, { + regExp: this.generateLongFormatNumberRegexes(models$2.LongFormatType.integerNumBlank, placeholder), + value: "IntegerNum" + }, { + regExp: this.generateLongFormatNumberRegexes(models$2.LongFormatType.integerNumNoBreakSpace, placeholder), + value: "IntegerNum" + }, { + regExp: recognizersText.RegExpUtility.getSafeRegExp(spanishNumeric.SpanishNumeric.RoundNumberIntegerRegexWithLocks), + value: "IntegerNum" + }, { + regExp: recognizersText.RegExpUtility.getSafeRegExp(spanishNumeric.SpanishNumeric.NumbersWithDozenSuffix), + value: "IntegerNum" + }, { + regExp: recognizersText.RegExpUtility.getSafeRegExp(spanishNumeric.SpanishNumeric.AllIntRegexWithLocks), + value: "IntegerSpa" + }, { + regExp: recognizersText.RegExpUtility.getSafeRegExp(spanishNumeric.SpanishNumeric.AllIntRegexWithDozenSuffixLocks), + value: "IntegerSpa" + }); + this.regexes = regexes; + } +} +exports.SpanishIntegerExtractor = SpanishIntegerExtractor; +class SpanishDoubleExtractor extends extractors$4.BaseNumberExtractor { + constructor(placeholder = spanishNumeric.SpanishNumeric.PlaceHolderDefault) { + super(); + this.extractType = constants.Constants.SYS_NUM_DOUBLE; + let regexes = new Array({ + regExp: recognizersText.RegExpUtility.getSafeRegExp(spanishNumeric.SpanishNumeric.DoubleDecimalPointRegex(placeholder)), + value: "DoubleNum" + }, { + regExp: recognizersText.RegExpUtility.getSafeRegExp(spanishNumeric.SpanishNumeric.DoubleWithoutIntegralRegex(placeholder)), + value: "DoubleNum" + }, { + regExp: recognizersText.RegExpUtility.getSafeRegExp(spanishNumeric.SpanishNumeric.DoubleWithMultiplierRegex, "gs"), + value: "DoubleNum" + }, { + regExp: recognizersText.RegExpUtility.getSafeRegExp(spanishNumeric.SpanishNumeric.DoubleWithRoundNumber), + value: "DoubleNum" + }, { + regExp: recognizersText.RegExpUtility.getSafeRegExp(spanishNumeric.SpanishNumeric.DoubleAllFloatRegex), + value: "DoubleSpa" + }, { + regExp: recognizersText.RegExpUtility.getSafeRegExp(spanishNumeric.SpanishNumeric.DoubleExponentialNotationRegex), + value: "DoublePow" + }, { + regExp: recognizersText.RegExpUtility.getSafeRegExp(spanishNumeric.SpanishNumeric.DoubleCaretExponentialNotationRegex), + value: "DoublePow" + }, { + regExp: this.generateLongFormatNumberRegexes(models$2.LongFormatType.doubleNumDotComma, placeholder), + value: "DoubleNum" + }, { + regExp: this.generateLongFormatNumberRegexes(models$2.LongFormatType.doubleNumNoBreakSpaceComma, placeholder), + value: "DoubleNum" + }); + this.regexes = regexes; + } +} +exports.SpanishDoubleExtractor = SpanishDoubleExtractor; +class SpanishFractionExtractor extends extractors$4.BaseNumberExtractor { + constructor() { + super(); + this.extractType = constants.Constants.SYS_NUM_FRACTION; + let regexes = new Array({ + regExp: recognizersText.RegExpUtility.getSafeRegExp(spanishNumeric.SpanishNumeric.FractionNotationRegex), + value: "FracNum" + }, { + regExp: recognizersText.RegExpUtility.getSafeRegExp(spanishNumeric.SpanishNumeric.FractionNotationWithSpacesRegex), + value: "FracNum" + }, { + regExp: recognizersText.RegExpUtility.getSafeRegExp(spanishNumeric.SpanishNumeric.FractionNounRegex), + value: "FracSpa" + }, { + regExp: recognizersText.RegExpUtility.getSafeRegExp(spanishNumeric.SpanishNumeric.FractionNounWithArticleRegex), + value: "FracSpa" + }, { + regExp: recognizersText.RegExpUtility.getSafeRegExp(spanishNumeric.SpanishNumeric.FractionPrepositionRegex), + value: "FracSpa" + }); + this.regexes = regexes; + } +} +exports.SpanishFractionExtractor = SpanishFractionExtractor; +class SpanishOrdinalExtractor extends extractors$4.BaseNumberExtractor { + constructor() { + super(); + this.extractType = constants.Constants.SYS_NUM_ORDINAL; + let regexes = new Array({ + regExp: recognizersText.RegExpUtility.getSafeRegExp(spanishNumeric.SpanishNumeric.OrdinalSuffixRegex), + value: "OrdinalNum" + }, { + regExp: recognizersText.RegExpUtility.getSafeRegExp(spanishNumeric.SpanishNumeric.OrdinalNounRegex), + value: "OrdSpa" + }); + this.regexes = regexes; + } +} +exports.SpanishOrdinalExtractor = SpanishOrdinalExtractor; +class SpanishPercentageExtractor extends extractors$4.BasePercentageExtractor { + constructor() { + super(new SpanishNumberExtractor()); + } + initRegexes() { + let regexStrs = [ + spanishNumeric.SpanishNumeric.NumberWithPrefixPercentage + ]; + return this.buildRegexes(regexStrs); + } +} +exports.SpanishPercentageExtractor = SpanishPercentageExtractor; + +}); + +unwrapExports(extractors$6); + +var extractors$8 = createCommonjsModule(function (module, exports) { +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); + + + + + +class PortugueseNumberExtractor extends extractors$4.BaseNumberExtractor { + constructor(mode = models$2.NumberMode.Default) { + super(); + this.extractType = constants.Constants.SYS_NUM; + let regexes = new Array(); + // Add Cardinal + let cardExtract = null; + switch (mode) { + case models$2.NumberMode.PureNumber: + cardExtract = new PortugueseCardinalExtractor(portugueseNumeric.PortugueseNumeric.PlaceHolderPureNumber); + break; + case models$2.NumberMode.Currency: + regexes.push({ regExp: recognizersText.RegExpUtility.getSafeRegExp(portugueseNumeric.PortugueseNumeric.CurrencyRegex, "gs"), value: "IntegerNum" }); + break; + case models$2.NumberMode.Default: + break; + } + if (cardExtract === null) { + cardExtract = new PortugueseCardinalExtractor(); + } + cardExtract.regexes.forEach(r => regexes.push(r)); + // Add Fraction + let fracExtract = new PortugueseFractionExtractor(); + fracExtract.regexes.forEach(r => regexes.push(r)); + this.regexes = regexes; + } +} +exports.PortugueseNumberExtractor = PortugueseNumberExtractor; +class PortugueseCardinalExtractor extends extractors$4.BaseNumberExtractor { + constructor(placeholder = portugueseNumeric.PortugueseNumeric.PlaceHolderDefault) { + super(); + this.extractType = constants.Constants.SYS_NUM_CARDINAL; + let regexes = new Array(); + // Add Integer Regexes + let intExtract = new PortugueseIntegerExtractor(placeholder); + intExtract.regexes.forEach(r => regexes.push(r)); + // Add Double Regexes + let doubleExtract = new PortugueseDoubleExtractor(placeholder); + doubleExtract.regexes.forEach(r => regexes.push(r)); + this.regexes = regexes; + } +} +exports.PortugueseCardinalExtractor = PortugueseCardinalExtractor; +class PortugueseIntegerExtractor extends extractors$4.BaseNumberExtractor { + constructor(placeholder = portugueseNumeric.PortugueseNumeric.PlaceHolderDefault) { + super(); + this.extractType = constants.Constants.SYS_NUM_INTEGER; + let regexes = new Array({ + regExp: recognizersText.RegExpUtility.getSafeRegExp(portugueseNumeric.PortugueseNumeric.NumbersWithPlaceHolder(placeholder), "gi"), + value: "IntegerNum" + }, { + regExp: recognizersText.RegExpUtility.getSafeRegExp(portugueseNumeric.PortugueseNumeric.NumbersWithSuffix, "gs"), + value: "IntegerNum" + }, { + regExp: this.generateLongFormatNumberRegexes(models$2.LongFormatType.integerNumDot, placeholder), + value: "IntegerNum" + }, { + regExp: this.generateLongFormatNumberRegexes(models$2.LongFormatType.integerNumBlank, placeholder), + value: "IntegerNum" + }, { + regExp: this.generateLongFormatNumberRegexes(models$2.LongFormatType.integerNumNoBreakSpace, placeholder), + value: "IntegerNum" + }, { + regExp: recognizersText.RegExpUtility.getSafeRegExp(portugueseNumeric.PortugueseNumeric.RoundNumberIntegerRegexWithLocks), + value: "IntegerNum" + }, { + regExp: recognizersText.RegExpUtility.getSafeRegExp(portugueseNumeric.PortugueseNumeric.NumbersWithDozen2Suffix), + value: "IntegerNum" + }, { + regExp: recognizersText.RegExpUtility.getSafeRegExp(portugueseNumeric.PortugueseNumeric.NumbersWithDozenSuffix), + value: "IntegerNum" + }, { + regExp: recognizersText.RegExpUtility.getSafeRegExp(portugueseNumeric.PortugueseNumeric.AllIntRegexWithLocks), + value: "IntegerPor" + }, { + regExp: recognizersText.RegExpUtility.getSafeRegExp(portugueseNumeric.PortugueseNumeric.AllIntRegexWithDozenSuffixLocks), + value: "IntegerPor" + }); + this.regexes = regexes; + } +} +exports.PortugueseIntegerExtractor = PortugueseIntegerExtractor; +class PortugueseDoubleExtractor extends extractors$4.BaseNumberExtractor { + constructor(placeholder = portugueseNumeric.PortugueseNumeric.PlaceHolderDefault) { + super(); + this.extractType = constants.Constants.SYS_NUM_DOUBLE; + let regexes = new Array({ + regExp: recognizersText.RegExpUtility.getSafeRegExp(portugueseNumeric.PortugueseNumeric.DoubleDecimalPointRegex(placeholder)), + value: "DoubleNum" + }, { + regExp: recognizersText.RegExpUtility.getSafeRegExp(portugueseNumeric.PortugueseNumeric.DoubleWithoutIntegralRegex(placeholder)), + value: "DoubleNum" + }, { + regExp: recognizersText.RegExpUtility.getSafeRegExp(portugueseNumeric.PortugueseNumeric.DoubleWithMultiplierRegex, "gs"), + value: "DoubleNum" + }, { + regExp: recognizersText.RegExpUtility.getSafeRegExp(portugueseNumeric.PortugueseNumeric.DoubleWithRoundNumber), + value: "DoubleNum" + }, { + regExp: recognizersText.RegExpUtility.getSafeRegExp(portugueseNumeric.PortugueseNumeric.DoubleAllFloatRegex), + value: "DoublePor" + }, { + regExp: recognizersText.RegExpUtility.getSafeRegExp(portugueseNumeric.PortugueseNumeric.DoubleExponentialNotationRegex), + value: "DoublePow" + }, { + regExp: recognizersText.RegExpUtility.getSafeRegExp(portugueseNumeric.PortugueseNumeric.DoubleCaretExponentialNotationRegex), + value: "DoublePow" + }, { + regExp: this.generateLongFormatNumberRegexes(models$2.LongFormatType.doubleNumDotComma, placeholder), + value: "DoubleNum" + }, { + regExp: this.generateLongFormatNumberRegexes(models$2.LongFormatType.doubleNumNoBreakSpaceComma, placeholder), + value: "DoubleNum" + }); + this.regexes = regexes; + } +} +exports.PortugueseDoubleExtractor = PortugueseDoubleExtractor; +class PortugueseFractionExtractor extends extractors$4.BaseNumberExtractor { + constructor() { + super(); + this.extractType = constants.Constants.SYS_NUM_FRACTION; + let regexes = new Array({ + regExp: recognizersText.RegExpUtility.getSafeRegExp(portugueseNumeric.PortugueseNumeric.FractionNotationRegex), + value: "FracNum" + }, { + regExp: recognizersText.RegExpUtility.getSafeRegExp(portugueseNumeric.PortugueseNumeric.FractionNotationWithSpacesRegex), + value: "FracNum" + }, { + regExp: recognizersText.RegExpUtility.getSafeRegExp(portugueseNumeric.PortugueseNumeric.FractionNounRegex), + value: "FracPor" + }, { + regExp: recognizersText.RegExpUtility.getSafeRegExp(portugueseNumeric.PortugueseNumeric.FractionNounWithArticleRegex), + value: "FracPor" + }, { + regExp: recognizersText.RegExpUtility.getSafeRegExp(portugueseNumeric.PortugueseNumeric.FractionPrepositionRegex), + value: "FracPor" + }); + this.regexes = regexes; + } +} +exports.PortugueseFractionExtractor = PortugueseFractionExtractor; +class PortugueseOrdinalExtractor extends extractors$4.BaseNumberExtractor { + constructor() { + super(); + this.extractType = constants.Constants.SYS_NUM_ORDINAL; + let regexes = new Array({ + regExp: recognizersText.RegExpUtility.getSafeRegExp(portugueseNumeric.PortugueseNumeric.OrdinalSuffixRegex), + value: "OrdinalNum" + }, { + regExp: recognizersText.RegExpUtility.getSafeRegExp(portugueseNumeric.PortugueseNumeric.OrdinalEnglishRegex), + value: "OrdinalPor" + }); + this.regexes = regexes; + } +} +exports.PortugueseOrdinalExtractor = PortugueseOrdinalExtractor; +class PortuguesePercentageExtractor extends extractors$4.BasePercentageExtractor { + constructor() { + super(new PortugueseNumberExtractor()); + } + initRegexes() { + let regexStrs = [ + portugueseNumeric.PortugueseNumeric.NumberWithSuffixPercentage + ]; + return this.buildRegexes(regexStrs); + } +} +exports.PortuguesePercentageExtractor = PortuguesePercentageExtractor; + +}); + +unwrapExports(extractors$8); + +var extractors$10 = createCommonjsModule(function (module, exports) { +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); + + + + + +class FrenchNumberExtractor extends extractors$4.BaseNumberExtractor { + constructor(mode = models$2.NumberMode.Default) { + super(); + this.extractType = constants.Constants.SYS_NUM; + let regexes = new Array(); + // Add Cardinal + let cardExtract = null; + switch (mode) { + case models$2.NumberMode.PureNumber: + cardExtract = new FrenchCardinalExtractor(frenchNumeric.FrenchNumeric.PlaceHolderPureNumber); + break; + case models$2.NumberMode.Currency: + regexes.push({ regExp: recognizersText.RegExpUtility.getSafeRegExp(frenchNumeric.FrenchNumeric.CurrencyRegex, "gs"), value: "IntegerNum" }); + break; + case models$2.NumberMode.Default: + break; + } + if (cardExtract === null) { + cardExtract = new FrenchCardinalExtractor(); + } + cardExtract.regexes.forEach(r => regexes.push(r)); + // Add Fraction + let fracExtract = new FrenchFractionExtractor(); + fracExtract.regexes.forEach(r => regexes.push(r)); + this.regexes = regexes; + } +} +exports.FrenchNumberExtractor = FrenchNumberExtractor; +class FrenchCardinalExtractor extends extractors$4.BaseNumberExtractor { + constructor(placeholder = frenchNumeric.FrenchNumeric.PlaceHolderDefault) { + super(); + this.extractType = constants.Constants.SYS_NUM_CARDINAL; + let regexes = new Array(); + // Add Integer Regexes + let intExtract = new FrenchIntegerExtractor(placeholder); + intExtract.regexes.forEach(r => regexes.push(r)); + // Add Double Regexes + let doubleExtract = new FrenchDoubleExtractor(placeholder); + doubleExtract.regexes.forEach(r => regexes.push(r)); + this.regexes = regexes; + } +} +exports.FrenchCardinalExtractor = FrenchCardinalExtractor; +class FrenchIntegerExtractor extends extractors$4.BaseNumberExtractor { + constructor(placeholder = frenchNumeric.FrenchNumeric.PlaceHolderDefault) { + super(); + this.extractType = constants.Constants.SYS_NUM_INTEGER; + let regexes = new Array({ + regExp: recognizersText.RegExpUtility.getSafeRegExp(frenchNumeric.FrenchNumeric.NumbersWithPlaceHolder(placeholder), "gi"), + value: "IntegerNum" + }, { + regExp: recognizersText.RegExpUtility.getSafeRegExp(frenchNumeric.FrenchNumeric.NumbersWithSuffix, "gs"), + value: "IntegerNum" + }, { + regExp: this.generateLongFormatNumberRegexes(models$2.LongFormatType.integerNumDot, placeholder), + value: "IntegerNum" + }, { + regExp: this.generateLongFormatNumberRegexes(models$2.LongFormatType.integerNumBlank, placeholder), + value: "IntegerNum" + }, { + regExp: this.generateLongFormatNumberRegexes(models$2.LongFormatType.integerNumNoBreakSpace, placeholder), + value: "IntegerNum" + }, { + regExp: recognizersText.RegExpUtility.getSafeRegExp(frenchNumeric.FrenchNumeric.RoundNumberIntegerRegexWithLocks), + value: "IntegerNum" + }, { + regExp: recognizersText.RegExpUtility.getSafeRegExp(frenchNumeric.FrenchNumeric.NumbersWithDozenSuffix), + value: "IntegerNum" + }, { + regExp: recognizersText.RegExpUtility.getSafeRegExp(frenchNumeric.FrenchNumeric.AllIntRegexWithLocks), + value: "IntegerFr" + }, { + regExp: recognizersText.RegExpUtility.getSafeRegExp(frenchNumeric.FrenchNumeric.AllIntRegexWithDozenSuffixLocks), + value: "IntegerFr" + }); + this.regexes = regexes; + } +} +exports.FrenchIntegerExtractor = FrenchIntegerExtractor; +class FrenchDoubleExtractor extends extractors$4.BaseNumberExtractor { + constructor(placeholder = frenchNumeric.FrenchNumeric.PlaceHolderDefault) { + super(); + this.extractType = constants.Constants.SYS_NUM_DOUBLE; + let regexes = new Array({ + regExp: recognizersText.RegExpUtility.getSafeRegExp(frenchNumeric.FrenchNumeric.DoubleDecimalPointRegex(placeholder)), + value: "DoubleNum" + }, { + regExp: recognizersText.RegExpUtility.getSafeRegExp(frenchNumeric.FrenchNumeric.DoubleWithoutIntegralRegex(placeholder)), + value: "DoubleNum" + }, { + regExp: recognizersText.RegExpUtility.getSafeRegExp(frenchNumeric.FrenchNumeric.DoubleWithMultiplierRegex, "gs"), + value: "DoubleNum" + }, { + regExp: recognizersText.RegExpUtility.getSafeRegExp(frenchNumeric.FrenchNumeric.DoubleWithRoundNumber), + value: "DoubleNum" + }, { + regExp: recognizersText.RegExpUtility.getSafeRegExp(frenchNumeric.FrenchNumeric.DoubleAllFloatRegex), + value: "DoubleFr" + }, { + regExp: recognizersText.RegExpUtility.getSafeRegExp(frenchNumeric.FrenchNumeric.DoubleExponentialNotationRegex), + value: "DoublePow" + }, { + regExp: recognizersText.RegExpUtility.getSafeRegExp(frenchNumeric.FrenchNumeric.DoubleCaretExponentialNotationRegex), + value: "DoublePow" + }, { + regExp: this.generateLongFormatNumberRegexes(models$2.LongFormatType.doubleNumDotComma, placeholder), + value: "DoubleNum" + }, { + regExp: this.generateLongFormatNumberRegexes(models$2.LongFormatType.doubleNumNoBreakSpaceComma, placeholder), + value: "DoubleNum" + }); + this.regexes = regexes; + } +} +exports.FrenchDoubleExtractor = FrenchDoubleExtractor; +class FrenchFractionExtractor extends extractors$4.BaseNumberExtractor { + constructor() { + super(); + this.extractType = constants.Constants.SYS_NUM_FRACTION; + let regexes = new Array({ + regExp: recognizersText.RegExpUtility.getSafeRegExp(frenchNumeric.FrenchNumeric.FractionNotationRegex), + value: "FracNum" + }, { + regExp: recognizersText.RegExpUtility.getSafeRegExp(frenchNumeric.FrenchNumeric.FractionNotationWithSpacesRegex), + value: "FracNum" + }, { + regExp: recognizersText.RegExpUtility.getSafeRegExp(frenchNumeric.FrenchNumeric.FractionNounRegex), + value: "FracFr" + }, { + regExp: recognizersText.RegExpUtility.getSafeRegExp(frenchNumeric.FrenchNumeric.FractionNounWithArticleRegex), + value: "FracFr" + }, { + regExp: recognizersText.RegExpUtility.getSafeRegExp(frenchNumeric.FrenchNumeric.FractionPrepositionRegex), + value: "FracFr" + }); + this.regexes = regexes; + } +} +exports.FrenchFractionExtractor = FrenchFractionExtractor; +class FrenchOrdinalExtractor extends extractors$4.BaseNumberExtractor { + constructor() { + super(); + this.extractType = constants.Constants.SYS_NUM_ORDINAL; + let regexes = new Array({ + regExp: recognizersText.RegExpUtility.getSafeRegExp(frenchNumeric.FrenchNumeric.OrdinalSuffixRegex), + value: "OrdinalNum" + }, { + regExp: recognizersText.RegExpUtility.getSafeRegExp(frenchNumeric.FrenchNumeric.OrdinalFrenchRegex), + value: "OrdFr" + }); + this.regexes = regexes; + } +} +exports.FrenchOrdinalExtractor = FrenchOrdinalExtractor; +class FrenchPercentageExtractor extends extractors$4.BasePercentageExtractor { + constructor() { + super(new FrenchNumberExtractor()); + } + initRegexes() { + let regexStrs = [ + frenchNumeric.FrenchNumeric.NumberWithSuffixPercentage, + frenchNumeric.FrenchNumeric.NumberWithPrefixPercentage + ]; + return this.buildRegexes(regexStrs); + } +} +exports.FrenchPercentageExtractor = FrenchPercentageExtractor; + +}); + +unwrapExports(extractors$10); + +var extractors$12 = createCommonjsModule(function (module, exports) { +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); + + + + +var ChineseNumberExtractorMode; +(function (ChineseNumberExtractorMode) { + // Number extraction with an allow list that filters what numbers to extract. + ChineseNumberExtractorMode[ChineseNumberExtractorMode["Default"] = 0] = "Default"; + // Extract all number-related terms aggressively. + ChineseNumberExtractorMode[ChineseNumberExtractorMode["ExtractAll"] = 1] = "ExtractAll"; +})(ChineseNumberExtractorMode = exports.ChineseNumberExtractorMode || (exports.ChineseNumberExtractorMode = {})); +class ChineseNumberExtractor extends extractors$4.BaseNumberExtractor { + constructor(mode = ChineseNumberExtractorMode.Default) { + super(); + this.extractType = constants.Constants.SYS_NUM; + let regexes = new Array(); + // Add Cardinal + let cardExtract = new ChineseCardinalExtractor(mode); + cardExtract.regexes.forEach(r => regexes.push(r)); + // Add Fraction + let fracExtract = new ChineseFractionExtractor(); + fracExtract.regexes.forEach(r => regexes.push(r)); + this.regexes = regexes; + } +} +exports.ChineseNumberExtractor = ChineseNumberExtractor; +class ChineseCardinalExtractor extends extractors$4.BaseNumberExtractor { + constructor(mode = ChineseNumberExtractorMode.Default) { + super(); + this.extractType = constants.Constants.SYS_NUM_CARDINAL; + let regexes = new Array(); + // Add Integer Regexes + let intExtract = new ChineseIntegerExtractor(mode); + intExtract.regexes.forEach(r => regexes.push(r)); + // Add Double Regexes + let doubleExtract = new ChineseDoubleExtractor(); + doubleExtract.regexes.forEach(r => regexes.push(r)); + this.regexes = regexes; + } +} +exports.ChineseCardinalExtractor = ChineseCardinalExtractor; +class ChineseIntegerExtractor extends extractors$4.BaseNumberExtractor { + constructor(mode = ChineseNumberExtractorMode.Default) { + super(); + this.extractType = constants.Constants.SYS_NUM_INTEGER; + let regexes = new Array({ + regExp: recognizersText.RegExpUtility.getSafeRegExp(chineseNumeric.ChineseNumeric.NumbersSpecialsChars, "gi"), + value: "IntegerNum" + }, { + regExp: recognizersText.RegExpUtility.getSafeRegExp(chineseNumeric.ChineseNumeric.NumbersSpecialsCharsWithSuffix, "gs"), + value: "IntegerNum" + }, { + regExp: recognizersText.RegExpUtility.getSafeRegExp(chineseNumeric.ChineseNumeric.DottedNumbersSpecialsChar, "gis"), + value: "IntegerNum" + }, { + regExp: recognizersText.RegExpUtility.getSafeRegExp(chineseNumeric.ChineseNumeric.NumbersWithHalfDozen, "gis"), + value: "IntegerChs" + }, { + regExp: recognizersText.RegExpUtility.getSafeRegExp(chineseNumeric.ChineseNumeric.NumbersWithDozen, "gis"), + value: "IntegerChs" + }); + switch (mode) { + case ChineseNumberExtractorMode.Default: + regexes.push({ + regExp: recognizersText.RegExpUtility.getSafeRegExp(chineseNumeric.ChineseNumeric.NumbersWithAllowListRegex, "gi"), + value: "IntegerChs" + }); + break; + case ChineseNumberExtractorMode.ExtractAll: + regexes.push({ + regExp: recognizersText.RegExpUtility.getSafeRegExp(chineseNumeric.ChineseNumeric.NumbersAggressiveRegex, "gi"), + value: "IntegerChs" + }); + break; + } + this.regexes = regexes; + } +} +exports.ChineseIntegerExtractor = ChineseIntegerExtractor; +class ChineseDoubleExtractor extends extractors$4.BaseNumberExtractor { + constructor() { + super(); + this.extractType = constants.Constants.SYS_NUM_DOUBLE; + let regexes = new Array({ + regExp: recognizersText.RegExpUtility.getSafeRegExp(chineseNumeric.ChineseNumeric.DoubleSpecialsChars, "gis"), + value: "DoubleNum" + }, { + regExp: recognizersText.RegExpUtility.getSafeRegExp(chineseNumeric.ChineseNumeric.DoubleSpecialsCharsWithNegatives, "gis"), + value: "DoubleNum" + }, { + regExp: recognizersText.RegExpUtility.getSafeRegExp(chineseNumeric.ChineseNumeric.SimpleDoubleSpecialsChars, "gis"), + value: "DoubleNum" + }, { + regExp: recognizersText.RegExpUtility.getSafeRegExp(chineseNumeric.ChineseNumeric.DoubleWithMultiplierRegex, "gi"), + value: "DoubleNum" + }, { + regExp: recognizersText.RegExpUtility.getSafeRegExp(chineseNumeric.ChineseNumeric.DoubleWithThousandsRegex, "gi"), + value: "DoubleChs" + }, { + regExp: recognizersText.RegExpUtility.getSafeRegExp(chineseNumeric.ChineseNumeric.DoubleAllFloatRegex, "gi"), + value: "DoubleChs" + }, { + regExp: recognizersText.RegExpUtility.getSafeRegExp(chineseNumeric.ChineseNumeric.DoubleExponentialNotationRegex, "gis"), + value: "DoublePow" + }, { + regExp: recognizersText.RegExpUtility.getSafeRegExp(chineseNumeric.ChineseNumeric.DoubleScientificNotationRegex, "gis"), + value: "DoublePow" + }); + this.regexes = regexes; + } +} +exports.ChineseDoubleExtractor = ChineseDoubleExtractor; +class ChineseFractionExtractor extends extractors$4.BaseNumberExtractor { + constructor() { + super(); + this.extractType = constants.Constants.SYS_NUM_FRACTION; + let regexes = new Array({ + regExp: recognizersText.RegExpUtility.getSafeRegExp(chineseNumeric.ChineseNumeric.FractionNotationSpecialsCharsRegex, "gis"), + value: "FracNum" + }, { + regExp: recognizersText.RegExpUtility.getSafeRegExp(chineseNumeric.ChineseNumeric.FractionNotationRegex, "gis"), + value: "FracNum" + }, { + regExp: recognizersText.RegExpUtility.getSafeRegExp(chineseNumeric.ChineseNumeric.AllFractionNumber, "gi"), + value: "FracChs" + }); + this.regexes = regexes; + } +} +exports.ChineseFractionExtractor = ChineseFractionExtractor; +class ChineseOrdinalExtractor extends extractors$4.BaseNumberExtractor { + constructor() { + super(); + this.extractType = constants.Constants.SYS_NUM_ORDINAL; + let regexes = new Array({ + regExp: recognizersText.RegExpUtility.getSafeRegExp(chineseNumeric.ChineseNumeric.OrdinalRegex, "gi"), + value: "OrdinalChs" + }, { + regExp: recognizersText.RegExpUtility.getSafeRegExp(chineseNumeric.ChineseNumeric.OrdinalNumbersRegex, "gi"), + value: "OrdinalChs" + }); + this.regexes = regexes; + } +} +exports.ChineseOrdinalExtractor = ChineseOrdinalExtractor; +class ChinesePercentageExtractor extends extractors$4.BaseNumberExtractor { + constructor() { + super(); + this.extractType = constants.Constants.SYS_NUM_PERCENTAGE; + let regexes = new Array({ + regExp: recognizersText.RegExpUtility.getSafeRegExp(chineseNumeric.ChineseNumeric.PercentagePointRegex, "gi"), + value: "PerChs" + }, { + regExp: recognizersText.RegExpUtility.getSafeRegExp(chineseNumeric.ChineseNumeric.SimplePercentageRegex, "gi"), + value: "PerChs" + }, { + regExp: recognizersText.RegExpUtility.getSafeRegExp(chineseNumeric.ChineseNumeric.NumbersPercentagePointRegex, "gis"), + value: "PerNum" + }, { + regExp: recognizersText.RegExpUtility.getSafeRegExp(chineseNumeric.ChineseNumeric.NumbersPercentageWithSeparatorRegex, "gis"), + value: "PerNum" + }, { + regExp: recognizersText.RegExpUtility.getSafeRegExp(chineseNumeric.ChineseNumeric.NumbersPercentageWithMultiplierRegex, "gi"), + value: "PerNum" + }, { + regExp: recognizersText.RegExpUtility.getSafeRegExp(chineseNumeric.ChineseNumeric.FractionPercentagePointRegex, "gis"), + value: "PerNum" + }, { + regExp: recognizersText.RegExpUtility.getSafeRegExp(chineseNumeric.ChineseNumeric.FractionPercentageWithSeparatorRegex, "gis"), + value: "PerNum" + }, { + regExp: recognizersText.RegExpUtility.getSafeRegExp(chineseNumeric.ChineseNumeric.FractionPercentageWithMultiplierRegex, "gi"), + value: "PerNum" + }, { + regExp: recognizersText.RegExpUtility.getSafeRegExp(chineseNumeric.ChineseNumeric.SimpleNumbersPercentageRegex, "gis"), + value: "PerNum" + }, { + regExp: recognizersText.RegExpUtility.getSafeRegExp(chineseNumeric.ChineseNumeric.SimpleNumbersPercentageWithMultiplierRegex, "gi"), + value: "PerNum" + }, { + regExp: recognizersText.RegExpUtility.getSafeRegExp(chineseNumeric.ChineseNumeric.SimpleNumbersPercentagePointRegex, "gis"), + value: "PerNum" + }, { + regExp: recognizersText.RegExpUtility.getSafeRegExp(chineseNumeric.ChineseNumeric.IntegerPercentageRegex, "gis"), + value: "PerNum" + }, { + regExp: recognizersText.RegExpUtility.getSafeRegExp(chineseNumeric.ChineseNumeric.IntegerPercentageWithMultiplierRegex, "gi"), + value: "PerNum" + }, { + regExp: recognizersText.RegExpUtility.getSafeRegExp(chineseNumeric.ChineseNumeric.NumbersFractionPercentageRegex, "gis"), + value: "PerNum" + }, { + regExp: recognizersText.RegExpUtility.getSafeRegExp(chineseNumeric.ChineseNumeric.SimpleIntegerPercentageRegex, "gis"), + value: "PerNum" + }, { + regExp: recognizersText.RegExpUtility.getSafeRegExp(chineseNumeric.ChineseNumeric.NumbersFoldsPercentageRegex, "gis"), + value: "PerSpe" + }, { + regExp: recognizersText.RegExpUtility.getSafeRegExp(chineseNumeric.ChineseNumeric.FoldsPercentageRegex, "gis"), + value: "PerSpe" + }, { + regExp: recognizersText.RegExpUtility.getSafeRegExp(chineseNumeric.ChineseNumeric.SimpleFoldsPercentageRegex, "gis"), + value: "PerSpe" + }, { + regExp: recognizersText.RegExpUtility.getSafeRegExp(chineseNumeric.ChineseNumeric.SpecialsPercentageRegex, "gis"), + value: "PerSpe" + }, { + regExp: recognizersText.RegExpUtility.getSafeRegExp(chineseNumeric.ChineseNumeric.NumbersSpecialsPercentageRegex, "gis"), + value: "PerSpe" + }, { + regExp: recognizersText.RegExpUtility.getSafeRegExp(chineseNumeric.ChineseNumeric.SimpleSpecialsPercentageRegex, "gis"), + value: "PerSpe" + }, { + regExp: recognizersText.RegExpUtility.getSafeRegExp(chineseNumeric.ChineseNumeric.SpecialsFoldsPercentageRegex, "gis"), + value: "PerSpe" + }); + this.regexes = regexes; + } +} +exports.ChinesePercentageExtractor = ChinesePercentageExtractor; + +}); + +unwrapExports(extractors$12); + +var extractors$14 = createCommonjsModule(function (module, exports) { +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); + + + + +var JapaneseNumberExtractorMode; +(function (JapaneseNumberExtractorMode) { + // Number extraction with an allow list that filters what numbers to extract. + JapaneseNumberExtractorMode[JapaneseNumberExtractorMode["Default"] = 0] = "Default"; + // Extract all number-related terms aggressively. + JapaneseNumberExtractorMode[JapaneseNumberExtractorMode["ExtractAll"] = 1] = "ExtractAll"; +})(JapaneseNumberExtractorMode = exports.JapaneseNumberExtractorMode || (exports.JapaneseNumberExtractorMode = {})); +class JapaneseNumberExtractor extends extractors$4.BaseNumberExtractor { + constructor(mode = JapaneseNumberExtractorMode.Default) { + super(); + this.extractType = constants.Constants.SYS_NUM; + let regexes = new Array(); + // Add Cardinal + let cardExtract = new JapaneseCardinalExtractor(mode); + cardExtract.regexes.forEach(r => regexes.push(r)); + // Add Fraction + let fracExtract = new JapaneseFractionExtractor(); + fracExtract.regexes.forEach(r => regexes.push(r)); + this.regexes = regexes; + } +} +exports.JapaneseNumberExtractor = JapaneseNumberExtractor; +class JapaneseCardinalExtractor extends extractors$4.BaseNumberExtractor { + constructor(mode = JapaneseNumberExtractorMode.Default) { + super(); + this.extractType = constants.Constants.SYS_NUM_CARDINAL; + let regexes = new Array(); + // Add Integer Regexes + let intExtract = new JapaneseIntegerExtractor(mode); + intExtract.regexes.forEach(r => regexes.push(r)); + // Add Double Regexes + let doubleExtract = new JapaneseDoubleExtractor(); + doubleExtract.regexes.forEach(r => regexes.push(r)); + this.regexes = regexes; + } +} +exports.JapaneseCardinalExtractor = JapaneseCardinalExtractor; +class JapaneseIntegerExtractor extends extractors$4.BaseNumberExtractor { + constructor(mode = JapaneseNumberExtractorMode.Default) { + super(); + this.extractType = constants.Constants.SYS_NUM_INTEGER; + let regexes = new Array({ + regExp: recognizersText.RegExpUtility.getSafeRegExp(japaneseNumeric.JapaneseNumeric.NumbersSpecialsChars, "gi"), + value: "IntegerNum" + }, { + regExp: recognizersText.RegExpUtility.getSafeRegExp(japaneseNumeric.JapaneseNumeric.NumbersSpecialsCharsWithSuffix, "gi"), + value: "IntegerNum" + }, { + regExp: recognizersText.RegExpUtility.getSafeRegExp(japaneseNumeric.JapaneseNumeric.DottedNumbersSpecialsChar, "gi"), + value: "IntegerNum" + }, { + regExp: recognizersText.RegExpUtility.getSafeRegExp(japaneseNumeric.JapaneseNumeric.NumbersWithHalfDozen, "gi"), + value: "IntegerJpn" + }, { + regExp: recognizersText.RegExpUtility.getSafeRegExp(japaneseNumeric.JapaneseNumeric.NumbersWithDozen, "gi"), + value: "IntegerJpn" + }); + switch (mode) { + case JapaneseNumberExtractorMode.Default: + regexes.push({ + regExp: recognizersText.RegExpUtility.getSafeRegExp(japaneseNumeric.JapaneseNumeric.NumbersWithAllowListRegex, "gi"), + value: "IntegerJpn" + }); + break; + case JapaneseNumberExtractorMode.ExtractAll: + regexes.push({ + regExp: recognizersText.RegExpUtility.getSafeRegExp(japaneseNumeric.JapaneseNumeric.NumbersAggressiveRegex, "gi"), + value: "IntegerJpn" + }); + break; + } + this.regexes = regexes; + } +} +exports.JapaneseIntegerExtractor = JapaneseIntegerExtractor; +class JapaneseDoubleExtractor extends extractors$4.BaseNumberExtractor { + constructor() { + super(); + this.extractType = constants.Constants.SYS_NUM_DOUBLE; + let regexes = new Array({ + regExp: recognizersText.RegExpUtility.getSafeRegExp(japaneseNumeric.JapaneseNumeric.DoubleSpecialsChars, "gis"), + value: "DoubleNum" + }, { + regExp: recognizersText.RegExpUtility.getSafeRegExp(japaneseNumeric.JapaneseNumeric.DoubleSpecialsCharsWithNegatives, "gis"), + value: "DoubleNum" + }, { + regExp: recognizersText.RegExpUtility.getSafeRegExp(japaneseNumeric.JapaneseNumeric.SimpleDoubleSpecialsChars, "gis"), + value: "DoubleNum" + }, { + regExp: recognizersText.RegExpUtility.getSafeRegExp(japaneseNumeric.JapaneseNumeric.DoubleWithMultiplierRegex, "gis"), + value: "DoubleNum" + }, { + regExp: recognizersText.RegExpUtility.getSafeRegExp(japaneseNumeric.JapaneseNumeric.DoubleWithThousandsRegex, "gis"), + value: "DoubleJpn" + }, { + regExp: recognizersText.RegExpUtility.getSafeRegExp(japaneseNumeric.JapaneseNumeric.DoubleExponentialNotationRegex, "gis"), + value: "DoublePow" + }, { + regExp: recognizersText.RegExpUtility.getSafeRegExp(japaneseNumeric.JapaneseNumeric.DoubleScientificNotationRegex, "gis"), + value: "DoublePow" + }); + this.regexes = regexes; + } +} +exports.JapaneseDoubleExtractor = JapaneseDoubleExtractor; +class JapaneseFractionExtractor extends extractors$4.BaseNumberExtractor { + constructor() { + super(); + this.extractType = constants.Constants.SYS_NUM_FRACTION; + let regexes = new Array({ + regExp: recognizersText.RegExpUtility.getSafeRegExp(japaneseNumeric.JapaneseNumeric.FractionNotationSpecialsCharsRegex, "gis"), + value: "FracNum" + }, { + regExp: recognizersText.RegExpUtility.getSafeRegExp(japaneseNumeric.JapaneseNumeric.FractionNotationRegex, "gis"), + value: "FracNum" + }, { + regExp: recognizersText.RegExpUtility.getSafeRegExp(japaneseNumeric.JapaneseNumeric.AllFractionNumber, "gis"), + value: "FracJpn" + }); + this.regexes = regexes; + } +} +exports.JapaneseFractionExtractor = JapaneseFractionExtractor; +class JapaneseOrdinalExtractor extends extractors$4.BaseNumberExtractor { + constructor() { + super(); + this.extractType = constants.Constants.SYS_NUM_ORDINAL; + let regexes = new Array({ + regExp: recognizersText.RegExpUtility.getSafeRegExp(japaneseNumeric.JapaneseNumeric.OrdinalRegex, "gi"), + value: "OrdinalJpn" + }, { + regExp: recognizersText.RegExpUtility.getSafeRegExp(japaneseNumeric.JapaneseNumeric.OrdinalNumbersRegex, "gi"), + value: "OrdinalJpn" + }, { + regExp: recognizersText.RegExpUtility.getSafeRegExp(japaneseNumeric.JapaneseNumeric.NumbersFoldsPercentageRegex, "gi"), + value: "OrdinalJpn" + }); + this.regexes = regexes; + } +} +exports.JapaneseOrdinalExtractor = JapaneseOrdinalExtractor; +class JapanesePercentageExtractor extends extractors$4.BaseNumberExtractor { + constructor() { + super(); + this.extractType = constants.Constants.SYS_NUM_PERCENTAGE; + let regexes = new Array({ + regExp: recognizersText.RegExpUtility.getSafeRegExp(japaneseNumeric.JapaneseNumeric.SimplePercentageRegex, "gi"), + value: "PerJpn" + }, { + regExp: recognizersText.RegExpUtility.getSafeRegExp(japaneseNumeric.JapaneseNumeric.NumbersPercentagePointRegex, "gis"), + value: "PerNum" + }, { + regExp: recognizersText.RegExpUtility.getSafeRegExp(japaneseNumeric.JapaneseNumeric.NumbersPercentageWithSeparatorRegex, "gis"), + value: "PerNum" + }, { + regExp: recognizersText.RegExpUtility.getSafeRegExp(japaneseNumeric.JapaneseNumeric.NumbersPercentageWithMultiplierRegex, "gi"), + value: "PerNum" + }, { + regExp: recognizersText.RegExpUtility.getSafeRegExp(japaneseNumeric.JapaneseNumeric.SimpleNumbersPercentageWithMultiplierRegex, "gi"), + value: "PerNum" + }, { + regExp: recognizersText.RegExpUtility.getSafeRegExp(japaneseNumeric.JapaneseNumeric.SimpleIntegerPercentageRegex, "gis"), + value: "PerNum" + }, { + regExp: recognizersText.RegExpUtility.getSafeRegExp(japaneseNumeric.JapaneseNumeric.NumbersFoldsPercentageRegex, "gis"), + value: "PerSpe" + }, { + regExp: recognizersText.RegExpUtility.getSafeRegExp(japaneseNumeric.JapaneseNumeric.FoldsPercentageRegex, "gis"), + value: "PerSpe" + }, { + regExp: recognizersText.RegExpUtility.getSafeRegExp(japaneseNumeric.JapaneseNumeric.SimpleFoldsPercentageRegex, "gis"), + value: "PerSpe" + }, { + regExp: recognizersText.RegExpUtility.getSafeRegExp(japaneseNumeric.JapaneseNumeric.SpecialsPercentageRegex, "gis"), + value: "PerSpe" + }, { + regExp: recognizersText.RegExpUtility.getSafeRegExp(japaneseNumeric.JapaneseNumeric.NumbersSpecialsPercentageRegex, "gis"), + value: "PerSpe" + }, { + regExp: recognizersText.RegExpUtility.getSafeRegExp(japaneseNumeric.JapaneseNumeric.SimpleSpecialsPercentageRegex, "gis"), + value: "PerSpe" + }, { + regExp: recognizersText.RegExpUtility.getSafeRegExp(japaneseNumeric.JapaneseNumeric.SpecialsFoldsPercentageRegex, "gis"), + value: "PerSpe" + }); + this.regexes = regexes; + } +} +exports.JapanesePercentageExtractor = JapanesePercentageExtractor; + +}); + +unwrapExports(extractors$14); + +var numberRecognizer = createCommonjsModule(function (module, exports) { +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); + + + + + + + + + + + + + + + + +var NumberOptions; +(function (NumberOptions) { + NumberOptions[NumberOptions["None"] = 0] = "None"; +})(NumberOptions = exports.NumberOptions || (exports.NumberOptions = {})); +function recognizeNumber(query, culture, options = NumberOptions.None, fallbackToDefaultCulture = true) { + return recognizeByModel(recognizer => recognizer.getNumberModel(culture, fallbackToDefaultCulture), query, culture, options); +} +exports.recognizeNumber = recognizeNumber; +function recognizeOrdinal(query, culture, options = NumberOptions.None, fallbackToDefaultCulture = true) { + return recognizeByModel(recognizer => recognizer.getOrdinalModel(culture, fallbackToDefaultCulture), query, culture, options); +} +exports.recognizeOrdinal = recognizeOrdinal; +function recognizePercentage(query, culture, options = NumberOptions.None, fallbackToDefaultCulture = true) { + return recognizeByModel(recognizer => recognizer.getPercentageModel(culture, fallbackToDefaultCulture), query, culture, options); +} +exports.recognizePercentage = recognizePercentage; +function recognizeByModel(getModelFunc, query, culture, options) { + let recognizer = new NumberRecognizer(culture, options); + let model = getModelFunc(recognizer); + return model.parse(query); +} +class NumberRecognizer extends recognizersText.Recognizer { + constructor(culture, options = NumberOptions.None, lazyInitialization = false) { + super(culture, options, lazyInitialization); + } + InitializeConfiguration() { + //#region English + this.registerModel("NumberModel", culture$2.Culture.English, (options) => new models$2.NumberModel(agnosticNumberParser.AgnosticNumberParserFactory.getParser(agnosticNumberParser.AgnosticNumberParserType.Number, new parserConfiguration.EnglishNumberParserConfiguration()), new extractors$2.EnglishNumberExtractor(models$2.NumberMode.PureNumber))); + this.registerModel("OrdinalModel", culture$2.Culture.English, (options) => new models$2.OrdinalModel(agnosticNumberParser.AgnosticNumberParserFactory.getParser(agnosticNumberParser.AgnosticNumberParserType.Ordinal, new parserConfiguration.EnglishNumberParserConfiguration()), new extractors$2.EnglishOrdinalExtractor())); + this.registerModel("PercentModel", culture$2.Culture.English, (options) => new models$2.PercentModel(agnosticNumberParser.AgnosticNumberParserFactory.getParser(agnosticNumberParser.AgnosticNumberParserType.Percentage, new parserConfiguration.EnglishNumberParserConfiguration()), new extractors$2.EnglishPercentageExtractor())); + //#endregion + //#region Spanish + this.registerModel("NumberModel", culture$2.Culture.Spanish, (options) => new models$2.NumberModel(agnosticNumberParser.AgnosticNumberParserFactory.getParser(agnosticNumberParser.AgnosticNumberParserType.Number, new parserConfiguration$2.SpanishNumberParserConfiguration()), new extractors$6.SpanishNumberExtractor(models$2.NumberMode.PureNumber))); + this.registerModel("OrdinalModel", culture$2.Culture.Spanish, (options) => new models$2.OrdinalModel(agnosticNumberParser.AgnosticNumberParserFactory.getParser(agnosticNumberParser.AgnosticNumberParserType.Ordinal, new parserConfiguration$2.SpanishNumberParserConfiguration()), new extractors$6.SpanishOrdinalExtractor())); + this.registerModel("PercentModel", culture$2.Culture.Spanish, (options) => new models$2.PercentModel(agnosticNumberParser.AgnosticNumberParserFactory.getParser(agnosticNumberParser.AgnosticNumberParserType.Percentage, new parserConfiguration$2.SpanishNumberParserConfiguration()), new extractors$6.SpanishPercentageExtractor())); + //#endregion + //#region Portuguese + this.registerModel("NumberModel", culture$2.Culture.Portuguese, (options) => new models$2.NumberModel(agnosticNumberParser.AgnosticNumberParserFactory.getParser(agnosticNumberParser.AgnosticNumberParserType.Number, new parserConfiguration$4.PortugueseNumberParserConfiguration()), new extractors$8.PortugueseNumberExtractor(models$2.NumberMode.PureNumber))); + this.registerModel("OrdinalModel", culture$2.Culture.Portuguese, (options) => new models$2.OrdinalModel(agnosticNumberParser.AgnosticNumberParserFactory.getParser(agnosticNumberParser.AgnosticNumberParserType.Ordinal, new parserConfiguration$4.PortugueseNumberParserConfiguration()), new extractors$8.PortugueseOrdinalExtractor())); + this.registerModel("PercentModel", culture$2.Culture.Portuguese, (options) => new models$2.PercentModel(agnosticNumberParser.AgnosticNumberParserFactory.getParser(agnosticNumberParser.AgnosticNumberParserType.Percentage, new parserConfiguration$4.PortugueseNumberParserConfiguration()), new extractors$8.PortuguesePercentageExtractor())); + //#endregion + //#region Chinese + this.registerModel("NumberModel", culture$2.Culture.Chinese, (options) => new models$2.NumberModel(agnosticNumberParser.AgnosticNumberParserFactory.getParser(agnosticNumberParser.AgnosticNumberParserType.Number, new parserConfiguration$8.ChineseNumberParserConfiguration()), new extractors$12.ChineseNumberExtractor())); + this.registerModel("OrdinalModel", culture$2.Culture.Chinese, (options) => new models$2.OrdinalModel(agnosticNumberParser.AgnosticNumberParserFactory.getParser(agnosticNumberParser.AgnosticNumberParserType.Ordinal, new parserConfiguration$8.ChineseNumberParserConfiguration()), new extractors$12.ChineseOrdinalExtractor())); + this.registerModel("PercentModel", culture$2.Culture.Chinese, (options) => new models$2.PercentModel(agnosticNumberParser.AgnosticNumberParserFactory.getParser(agnosticNumberParser.AgnosticNumberParserType.Percentage, new parserConfiguration$8.ChineseNumberParserConfiguration()), new extractors$12.ChinesePercentageExtractor())); + //#endregion + //#region Japanese + this.registerModel("NumberModel", culture$2.Culture.Japanese, (options) => new models$2.NumberModel(agnosticNumberParser.AgnosticNumberParserFactory.getParser(agnosticNumberParser.AgnosticNumberParserType.Number, new parserConfiguration$10.JapaneseNumberParserConfiguration()), new extractors$14.JapaneseNumberExtractor())); + this.registerModel("OrdinalModel", culture$2.Culture.Japanese, (options) => new models$2.OrdinalModel(agnosticNumberParser.AgnosticNumberParserFactory.getParser(agnosticNumberParser.AgnosticNumberParserType.Ordinal, new parserConfiguration$10.JapaneseNumberParserConfiguration()), new extractors$14.JapaneseOrdinalExtractor())); + this.registerModel("PercentModel", culture$2.Culture.Japanese, (options) => new models$2.PercentModel(agnosticNumberParser.AgnosticNumberParserFactory.getParser(agnosticNumberParser.AgnosticNumberParserType.Percentage, new parserConfiguration$10.JapaneseNumberParserConfiguration()), new extractors$14.JapanesePercentageExtractor())); + //#endregion + //#region French + this.registerModel("NumberModel", culture$2.Culture.French, (options) => new models$2.NumberModel(agnosticNumberParser.AgnosticNumberParserFactory.getParser(agnosticNumberParser.AgnosticNumberParserType.Number, new parserConfiguration$6.FrenchNumberParserConfiguration()), new extractors$10.FrenchNumberExtractor(models$2.NumberMode.PureNumber))); + this.registerModel("OrdinalModel", culture$2.Culture.French, (options) => new models$2.OrdinalModel(agnosticNumberParser.AgnosticNumberParserFactory.getParser(agnosticNumberParser.AgnosticNumberParserType.Ordinal, new parserConfiguration$6.FrenchNumberParserConfiguration()), new extractors$10.FrenchOrdinalExtractor())); + this.registerModel("PercentModel", culture$2.Culture.French, (options) => new models$2.PercentModel(agnosticNumberParser.AgnosticNumberParserFactory.getParser(agnosticNumberParser.AgnosticNumberParserType.Percentage, new parserConfiguration$6.FrenchNumberParserConfiguration()), new extractors$10.FrenchPercentageExtractor())); + //#endregion + } + IsValidOptions(options) { + return options >= 0 && options <= NumberOptions.None; + } + getNumberModel(culture = null, fallbackToDefaultCulture = true) { + return this.getModel("NumberModel", culture, fallbackToDefaultCulture); + } + getOrdinalModel(culture = null, fallbackToDefaultCulture = true) { + return this.getModel("OrdinalModel", culture, fallbackToDefaultCulture); + } + getPercentageModel(culture = null, fallbackToDefaultCulture = true) { + return this.getModel("PercentModel", culture, fallbackToDefaultCulture); + } +} +exports.default = NumberRecognizer; + +}); + +unwrapExports(numberRecognizer); + +var recognizersTextNumber = createCommonjsModule(function (module, exports) { +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); + +exports.NumberRecognizer = numberRecognizer.default; +exports.NumberOptions = numberRecognizer.NumberOptions; +exports.recognizeNumber = numberRecognizer.recognizeNumber; +exports.recognizeOrdinal = numberRecognizer.recognizeOrdinal; +exports.recognizePercentage = numberRecognizer.recognizePercentage; + +exports.Culture = culture$2.Culture; +exports.CultureInfo = culture$2.CultureInfo; + +exports.FormatUtility = recognizersText.FormatUtility; +exports.StringUtility = recognizersText.StringUtility; +exports.Match = recognizersText.Match; +exports.RegExpUtility = recognizersText.RegExpUtility; + +exports.BaseNumbers = baseNumbers.BaseNumbers; + +exports.EnglishNumeric = englishNumeric.EnglishNumeric; + +exports.SpanishNumeric = spanishNumeric.SpanishNumeric; + +exports.FrenchNumeric = frenchNumeric.FrenchNumeric; + +exports.ChineseNumeric = chineseNumeric.ChineseNumeric; + +exports.JapaneseNumeric = japaneseNumeric.JapaneseNumeric; + +exports.Constants = constants.Constants; + +exports.BaseNumberExtractor = extractors$4.BaseNumberExtractor; +exports.BasePercentageExtractor = extractors$4.BasePercentageExtractor; + +exports.NumberMode = models$2.NumberMode; +exports.LongFormatType = models$2.LongFormatType; +exports.AbstractNumberModel = models$2.AbstractNumberModel; +exports.NumberModel = models$2.NumberModel; +exports.OrdinalModel = models$2.OrdinalModel; +exports.PercentModel = models$2.PercentModel; + +exports.AgnosticNumberParserType = agnosticNumberParser.AgnosticNumberParserType; +exports.AgnosticNumberParserFactory = agnosticNumberParser.AgnosticNumberParserFactory; + +exports.BaseNumberParser = parsers$2.BaseNumberParser; +exports.BasePercentageParser = parsers$2.BasePercentageParser; + +exports.EnglishCardinalExtractor = extractors$2.EnglishCardinalExtractor; +exports.EnglishDoubleExtractor = extractors$2.EnglishDoubleExtractor; +exports.EnglishFractionExtractor = extractors$2.EnglishFractionExtractor; +exports.EnglishIntegerExtractor = extractors$2.EnglishIntegerExtractor; +exports.EnglishNumberExtractor = extractors$2.EnglishNumberExtractor; +exports.EnglishOrdinalExtractor = extractors$2.EnglishOrdinalExtractor; +exports.EnglishPercentageExtractor = extractors$2.EnglishPercentageExtractor; + +exports.EnglishNumberParserConfiguration = parserConfiguration.EnglishNumberParserConfiguration; + +exports.SpanishCardinalExtractor = extractors$6.SpanishCardinalExtractor; +exports.SpanishDoubleExtractor = extractors$6.SpanishDoubleExtractor; +exports.SpanishFractionExtractor = extractors$6.SpanishFractionExtractor; +exports.SpanishIntegerExtractor = extractors$6.SpanishIntegerExtractor; +exports.SpanishNumberExtractor = extractors$6.SpanishNumberExtractor; +exports.SpanishOrdinalExtractor = extractors$6.SpanishOrdinalExtractor; +exports.SpanishPercentageExtractor = extractors$6.SpanishPercentageExtractor; + +exports.SpanishNumberParserConfiguration = parserConfiguration$2.SpanishNumberParserConfiguration; + +exports.PortugueseCardinalExtractor = extractors$8.PortugueseCardinalExtractor; +exports.PortugueseDoubleExtractor = extractors$8.PortugueseDoubleExtractor; +exports.PortugueseFractionExtractor = extractors$8.PortugueseFractionExtractor; +exports.PortugueseIntegerExtractor = extractors$8.PortugueseIntegerExtractor; +exports.PortugueseNumberExtractor = extractors$8.PortugueseNumberExtractor; +exports.PortugueseOrdinalExtractor = extractors$8.PortugueseOrdinalExtractor; +exports.PortuguesePercentageExtractor = extractors$8.PortuguesePercentageExtractor; + +exports.PortugueseNumberParserConfiguration = parserConfiguration$4.PortugueseNumberParserConfiguration; + +exports.FrenchCardinalExtractor = extractors$10.FrenchCardinalExtractor; +exports.FrenchDoubleExtractor = extractors$10.FrenchDoubleExtractor; +exports.FrenchFractionExtractor = extractors$10.FrenchFractionExtractor; +exports.FrenchIntegerExtractor = extractors$10.FrenchIntegerExtractor; +exports.FrenchNumberExtractor = extractors$10.FrenchNumberExtractor; +exports.FrenchOrdinalExtractor = extractors$10.FrenchOrdinalExtractor; +exports.FrenchPercentageExtractor = extractors$10.FrenchPercentageExtractor; + +exports.FrenchNumberParserConfiguration = parserConfiguration$6.FrenchNumberParserConfiguration; + +exports.ChineseCardinalExtractor = extractors$12.ChineseCardinalExtractor; +exports.ChineseDoubleExtractor = extractors$12.ChineseDoubleExtractor; +exports.ChineseFractionExtractor = extractors$12.ChineseFractionExtractor; +exports.ChineseIntegerExtractor = extractors$12.ChineseIntegerExtractor; +exports.ChineseNumberExtractor = extractors$12.ChineseNumberExtractor; +exports.ChineseOrdinalExtractor = extractors$12.ChineseOrdinalExtractor; +exports.ChinesePercentageExtractor = extractors$12.ChinesePercentageExtractor; +exports.ChineseNumberExtractorMode = extractors$12.ChineseNumberExtractorMode; + +exports.ChineseNumberParserConfiguration = parserConfiguration$8.ChineseNumberParserConfiguration; + +exports.JapaneseCardinalExtractor = extractors$14.JapaneseCardinalExtractor; +exports.JapaneseDoubleExtractor = extractors$14.JapaneseDoubleExtractor; +exports.JapaneseFractionExtractor = extractors$14.JapaneseFractionExtractor; +exports.JapaneseIntegerExtractor = extractors$14.JapaneseIntegerExtractor; +exports.JapaneseNumberExtractor = extractors$14.JapaneseNumberExtractor; +exports.JapaneseOrdinalExtractor = extractors$14.JapaneseOrdinalExtractor; +exports.JapanesePercentageExtractor = extractors$14.JapanesePercentageExtractor; +exports.JapaneseNumberExtractorMode = extractors$14.JapaneseNumberExtractorMode; + +exports.JapaneseNumberParserConfiguration = parserConfiguration$10.JapaneseNumberParserConfiguration; + +}); + +unwrapExports(recognizersTextNumber); + +var models$4 = createCommonjsModule(function (module, exports) { +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); + +var CompositeEntityType; +(function (CompositeEntityType) { + CompositeEntityType[CompositeEntityType["Age"] = 0] = "Age"; + CompositeEntityType[CompositeEntityType["Currency"] = 1] = "Currency"; + CompositeEntityType[CompositeEntityType["Dimension"] = 2] = "Dimension"; + CompositeEntityType[CompositeEntityType["Temperature"] = 3] = "Temperature"; +})(CompositeEntityType = exports.CompositeEntityType || (exports.CompositeEntityType = {})); +class AbstractNumberWithUnitModel { + constructor(extractorParsersMap) { + this.extractorParsersMap = extractorParsersMap; + } + parse(query) { + query = recognizersText.FormatUtility.preProcess(query, false); + let extractionResults = new Array(); + for (let kv of this.extractorParsersMap.entries()) { + let extractor = kv[0]; + let parser = kv[1]; + let extractResults = extractor.extract(query); + let parseResults = []; + for (let i = 0; i < extractResults.length; i++) { + let r = parser.parse(extractResults[i]); + if (r.value !== null) { + if (r.value instanceof Array) { + for (let j = 0; j < r.value.length; j++) { + parseResults.push(r.value[j]); + } + } + else { + parseResults.push(r); + } + } + } + let modelResults = parseResults.map(o => ({ + start: o.start, + end: o.start + o.length - 1, + resolution: this.getResolution(o.value), + text: o.text, + typeName: this.modelTypeName + })); + modelResults.forEach(result => { + let bAdd = true; + extractionResults.forEach(extractionResult => { + if (extractionResult.start === result.start && extractionResult.end === result.end) { + bAdd = false; + } + }); + if (bAdd) { + extractionResults.push(result); + } + }); + } + return extractionResults; + } + getResolution(data) { + if (typeof data === 'undefined') + return null; + let result = typeof data === "string" + ? { value: data.toString() } + : { value: data.number, unit: data.unit }; + if (data.isoCurrency) { + result['isoCurrency'] = data.isoCurrency; + } + return result; + } +} +exports.AbstractNumberWithUnitModel = AbstractNumberWithUnitModel; +class AgeModel extends AbstractNumberWithUnitModel { + constructor() { + super(...arguments); + this.modelTypeName = "age"; + } +} +exports.AgeModel = AgeModel; +class CurrencyModel extends AbstractNumberWithUnitModel { + constructor() { + super(...arguments); + this.modelTypeName = "currency"; + } +} +exports.CurrencyModel = CurrencyModel; +class DimensionModel extends AbstractNumberWithUnitModel { + constructor() { + super(...arguments); + this.modelTypeName = "dimension"; + } +} +exports.DimensionModel = DimensionModel; +class TemperatureModel extends AbstractNumberWithUnitModel { + constructor() { + super(...arguments); + this.modelTypeName = "temperature"; + } +} +exports.TemperatureModel = TemperatureModel; + +}); + +unwrapExports(models$4); + +var baseUnits = createCommonjsModule(function (module, exports) { +"use strict"; +// ------------------------------------------------------------------------------ +// +// This code was generated by a tool. +// Changes to this file may cause incorrect behavior and will be lost if +// the code is regenerated. +// +// ------------------------------------------------------------------------------ +Object.defineProperty(exports, "__esModule", { value: true }); +var BaseUnits; +(function (BaseUnits) { + BaseUnits.HourRegex = `(?00|01|02|03|04|05|06|07|08|09|0|10|11|12|13|14|15|16|17|18|19|20|21|22|23|24|1|2|3|4|5|6|7|8|9)(h)?`; + BaseUnits.MinuteRegex = `(?00|01|02|03|04|05|06|07|08|09|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|0|1|2|3|4|5|6|7|8|9)(?!\\d)`; + BaseUnits.SecondRegex = `(?00|01|02|03|04|05|06|07|08|09|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|0|1|2|3|4|5|6|7|8|9)`; + BaseUnits.PmNonUnitRegex = `(${BaseUnits.HourRegex}\\s*:\\s*${BaseUnits.MinuteRegex}(\\s*:\\s*${BaseUnits.SecondRegex})?\\s*pm)`; + BaseUnits.AmbiguousTimeTerm = 'pm'; +})(BaseUnits = exports.BaseUnits || (exports.BaseUnits = {})); + +}); + +unwrapExports(baseUnits); + +var constants$2 = createCommonjsModule(function (module, exports) { +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); + +class Constants { +} +Constants.SYS_UNIT = "builtin.unit"; +Constants.SYS_UNIT_DIMENSION = "builtin.unit.dimension"; +Constants.SYS_UNIT_AGE = "builtin.unit.age"; +Constants.SYS_UNIT_AREA = "builtin.unit.area"; +Constants.SYS_UNIT_CURRENCY = "builtin.unit.currency"; +Constants.SYS_UNIT_LENGTH = "builtin.unit.length"; +Constants.SYS_UNIT_SPEED = "builtin.unit.speed"; +Constants.SYS_UNIT_TEMPERATURE = "builtin.unit.temperature"; +Constants.SYS_UNIT_VOLUME = "builtin.unit.volume"; +Constants.SYS_UNIT_WEIGHT = "builtin.unit.weight"; +Constants.SYS_NUM = "builtin.num"; +// For cases like '2:00 pm', both 'pm' and '00 pm' are not dimension +Constants.AMBIGUOUS_TIME_TERM = baseUnits.BaseUnits.AmbiguousTimeTerm; +// For currencies without ISO codes, we use internal values prefixed by '_'. +// These values should never be present in parse output. +Constants.FAKE_ISO_CODE_PREFIX = "_"; +exports.Constants = Constants; + +}); + +unwrapExports(constants$2); + +/** + * lodash (Custom Build) + * Build: `lodash modularize exports="npm" -o ./` + * Copyright jQuery Foundation and other contributors + * Released under MIT license + * Based on Underscore.js 1.8.3 + * Copyright Jeremy Ashkenas, DocumentCloud and Investigative Reporters & Editors + */ + +/** `Object#toString` result references. */ +var symbolTag$2 = '[object Symbol]'; + +/** Used for built-in method references. */ +var objectProto$2 = Object.prototype; + +/** + * Used to resolve the + * [`toStringTag`](http://ecma-international.org/ecma-262/6.0/#sec-object.prototype.tostring) + * of values. + */ +var objectToString$2 = objectProto$2.toString; + +/** + * The base implementation of methods like `_.max` and `_.min` which accepts a + * `comparator` to determine the extremum value. + * + * @private + * @param {Array} array The array to iterate over. + * @param {Function} iteratee The iteratee invoked per iteration. + * @param {Function} comparator The comparator used to compare values. + * @returns {*} Returns the extremum value. + */ +function baseExtremum(array, iteratee, comparator) { + var index = -1, + length = array.length; + + while (++index < length) { + var value = array[index], + current = iteratee(value); + + if (current != null && (computed === undefined + ? (current === current && !isSymbol$2(current)) + : comparator(current, computed) + )) { + var computed = current, + result = value; + } + } + return result; +} + +/** + * The base implementation of `_.gt` which doesn't coerce arguments to numbers. + * + * @private + * @param {*} value The value to compare. + * @param {*} other The other value to compare. + * @returns {boolean} Returns `true` if `value` is greater than `other`, + * else `false`. + */ +function baseGt(value, other) { + return value > other; +} + +/** + * Checks if `value` is object-like. A value is object-like if it's not `null` + * and has a `typeof` result of "object". + * + * @static + * @memberOf _ + * @since 4.0.0 + * @category Lang + * @param {*} value The value to check. + * @returns {boolean} Returns `true` if `value` is object-like, else `false`. + * @example + * + * _.isObjectLike({}); + * // => true + * + * _.isObjectLike([1, 2, 3]); + * // => true + * + * _.isObjectLike(_.noop); + * // => false + * + * _.isObjectLike(null); + * // => false + */ +function isObjectLike$2(value) { + return !!value && typeof value == 'object'; +} + +/** + * Checks if `value` is classified as a `Symbol` primitive or object. + * + * @static + * @memberOf _ + * @since 4.0.0 + * @category Lang + * @param {*} value The value to check. + * @returns {boolean} Returns `true` if `value` is correctly classified, + * else `false`. + * @example + * + * _.isSymbol(Symbol.iterator); + * // => true + * + * _.isSymbol('abc'); + * // => false + */ +function isSymbol$2(value) { + return typeof value == 'symbol' || + (isObjectLike$2(value) && objectToString$2.call(value) == symbolTag$2); +} + +/** + * This method returns the first argument given to it. + * + * @static + * @since 0.1.0 + * @memberOf _ + * @category Util + * @param {*} value Any value. + * @returns {*} Returns `value`. + * @example + * + * var object = { 'user': 'fred' }; + * + * _.identity(object) === object; + * // => true + */ +function identity(value) { + return value; +} + +/** + * Computes the maximum value of `array`. If `array` is empty or falsey, + * `undefined` is returned. + * + * @static + * @since 0.1.0 + * @memberOf _ + * @category Math + * @param {Array} array The array to iterate over. + * @returns {*} Returns the maximum value. + * @example + * + * _.max([4, 2, 8, 6]); + * // => 8 + * + * _.max([]); + * // => undefined + */ +function max(array) { + return (array && array.length) + ? baseExtremum(array, identity, baseGt) + : undefined; +} + +var lodash_max = max; + +var extractors$16 = createCommonjsModule(function (module, exports) { +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); + + + + + +class NumberWithUnitExtractor { + constructor(config) { + this.config = config; + if (this.config.suffixList && this.config.suffixList.size > 0) { + this.suffixRegexes = this.buildRegexFromSet(Array.from(this.config.suffixList.values())); + } + else { + this.suffixRegexes = new Set(); // empty + } + if (this.config.prefixList && this.config.prefixList.size > 0) { + let maxLength = 0; + this.config.prefixList.forEach(preMatch => { + let len = lodash_max(preMatch.split('|').filter(s => s && s.length).map(s => s.length)); + maxLength = maxLength >= len ? maxLength : len; + }); + // 2 is the maxium length of spaces. + this.maxPrefixMatchLen = maxLength + 2; + this.prefixRegexes = this.buildRegexFromSet(Array.from(this.config.prefixList.values())); + } + else { + this.prefixRegexes = new Set(); // empty + } + this.separateRegex = this.buildSeparateRegexFromSet(); + } + extract(source) { + if (!this.preCheckStr(source)) { + return new Array(); + } + let mappingPrefix = new Map(); + let matched = new Array(source.length); + let numbers = this.config.unitNumExtractor.extract(source); + let result = new Array(); + let sourceLen = source.length; + /* Mix prefix and numbers, make up a prefix-number combination */ + if (this.maxPrefixMatchLen !== 0) { + numbers.forEach(num => { + if (num.start === undefined || num.length === undefined) { + return; + } + let maxFindPref = Math.min(this.maxPrefixMatchLen, num.start); + if (maxFindPref === 0) { + return; + } + /* Scan from left to right , find the longest match */ + let leftStr = source.substring(num.start - maxFindPref, num.start - maxFindPref + maxFindPref); + + let lastIndex = leftStr.length; + let bestMatch = null; + this.prefixRegexes.forEach(regex => { + let collection = recognizersText.RegExpUtility.getMatches(regex, leftStr).filter(m => m.length); + if (collection.length === 0) { + return; + } + collection.forEach(match => { + if (leftStr.substring(match.index, lastIndex).trim() === match.value) { + if (bestMatch === null || bestMatch.index >= match.index) { + bestMatch = match; + } + } + }); + }); + if (bestMatch !== null) { + let unitStr = leftStr.substring(bestMatch.index, lastIndex); + mappingPrefix.set(num.start, { + offset: lastIndex - bestMatch.index, + unitString: unitStr + }); + } + }); + } + for (let num of numbers) { + if (num.start === undefined || num.length === undefined) { + continue; + } + let start = num.start; + let length = num.length; + let maxFindLen = sourceLen - start - length; + let prefixUnit = mappingPrefix.has(start) ? mappingPrefix.get(start) : null; + if (maxFindLen > 0) { + let rightSub = source.substring(start + length, start + length + maxFindLen); + let unitMatch = Array.from(this.suffixRegexes.values()).map(r => recognizersText.RegExpUtility.getMatches(r, rightSub)) + .filter(m => m.length > 0); + let maxlen = 0; + for (let i = 0; i < unitMatch.length; i++) { + for (let m of unitMatch[i]) { + if (m.length > 0) { + let endpos = m.index + m.length; + if (m.index >= 0) { + let midStr = rightSub.substring(0, Math.min(m.index, rightSub.length)); + if (maxlen < endpos && (recognizersText.StringUtility.isNullOrWhitespace(midStr) || midStr.trim() === this.config.connectorToken)) { + maxlen = endpos; + } + } + } + } + } + if (maxlen !== 0) { + for (let i = 0; i < length + maxlen; i++) { + matched[i + start] = true; + } + let substr = source.substring(start, start + length + maxlen); + let er = { + start: start, + length: length + maxlen, + text: substr, + type: this.config.extractType + }; + if (prefixUnit !== null) { + er.start -= prefixUnit.offset; + er.length += prefixUnit.offset; + er.text = prefixUnit.unitString + er.text; + } + /* Relative position will be used in Parser */ + num.start = start - er.start; + er.data = num; + let isDimensionFallsInPmTime = false; + if (er.type === constants$2.Constants.SYS_UNIT_DIMENSION) { + let nonUnitMatch = recognizersText.RegExpUtility.getMatches(this.config.pmNonUnitRegex, source); + nonUnitMatch.forEach(match => { + if (er.start >= match.index && er.start + er.length <= match.index + match.length) { + isDimensionFallsInPmTime = true; + } + }); + } + if (isDimensionFallsInPmTime) { + continue; + } + result.push(er); + continue; + } + } + if (prefixUnit !== null) { + let er = { + start: num.start - prefixUnit.offset, + length: num.length + prefixUnit.offset, + text: prefixUnit.unitString + num.text, + type: this.config.extractType + }; + /* Relative position will be used in Parser */ + num.start = start - er.start; + er.data = num; + result.push(er); + } + } + // extract Separate unit + if (this.separateRegex !== null) { + this.extractSeparateUnits(source, result); + } + return result; + } + validateUnit(source) { + return source.substring(0, 1) !== '-'; + } + preCheckStr(str) { + return str && str.length; + } + extractSeparateUnits(source, numDependResults) { + // Default is false + let matchResult = new Array(source.length); + numDependResults.forEach(numDependResult => { + let start = numDependResult.start; + let i = 0; + do { + matchResult[start + i++] = true; + } while (i < numDependResult.length); + }); + // Extract all SeparateUnits, then merge it with numDependResults + let matchCollection = recognizersText.RegExpUtility.getMatches(this.separateRegex, source); + if (matchCollection.length > 0) { + matchCollection.forEach(match => { + let i = 0; + while (i < match.length && !matchResult[match.index + i]) { + i++; + } + if (i === match.length) { + // Mark as extracted + for (let j = 0; j < i; j++) { + matchResult[j] = true; + } + let isDimensionFallsInPmTime = false; + if (match.value === constants$2.Constants.AMBIGUOUS_TIME_TERM) { + let nonUnitMatch = recognizersText.RegExpUtility.getMatches(this.config.pmNonUnitRegex, source); + nonUnitMatch.forEach(time => { + if (this.isDimensionFallsInTime(match, time)) { + isDimensionFallsInPmTime = true; + } + }); + } + if (isDimensionFallsInPmTime === false) { + numDependResults.push({ + start: match.index, + length: match.length, + text: match.value, + type: this.config.extractType, + data: null + }); + } + } + }); + } + } + buildRegexFromSet(collection, ignoreCase = true) { + return new Set(collection.map(regexString => { + let regexTokens = regexString.split('|').map(lodash_escaperegexp); + let pattern = `${this.config.buildPrefix}(${regexTokens.join('|')})${this.config.buildSuffix}`; + let options = "gs"; + if (ignoreCase) + options += "i"; + return recognizersText.RegExpUtility.getSafeRegExp(pattern, options); + })); + } + buildSeparateRegexFromSet(ignoreCase = true) { + let separateWords = new Set(); + if (this.config.prefixList && this.config.prefixList.size) { + for (let addWord of this.config.prefixList.values()) { + addWord.split('|').filter(s => s && s.length) + .filter(this.validateUnit) + .forEach(word => separateWords.add(word)); + } + } + if (this.config.suffixList && this.config.suffixList.size) { + for (let addWord of this.config.suffixList.values()) { + addWord.split('|').filter(s => s && s.length) + .filter(this.validateUnit) + .forEach(word => separateWords.add(word)); + } + } + if (this.config.ambiguousUnitList && this.config.ambiguousUnitList.length) { + for (let abandonWord of this.config.ambiguousUnitList) { + if (separateWords.has(abandonWord)) { + separateWords.delete(abandonWord); + } + } + } + let regexTokens = Array.from(separateWords.values()).map(lodash_escaperegexp); + if (regexTokens.length === 0) { + return null; + } + // Sort SeparateWords using descending length. + regexTokens = regexTokens.sort(this.dinoComparer); + let pattern = `${this.config.buildPrefix}(${regexTokens.join('|')})${this.config.buildSuffix}`; + let options = "gs"; + if (ignoreCase) + options += "i"; + return recognizersText.RegExpUtility.getSafeRegExp(pattern, options); + } + dinoComparer(x, y) { + if (x === null) { + if (y === null) { + // If x is null and y is null, they're + // equal. + return 0; + } + else { + // If x is null and y is not null, y + // is greater. + return 1; + } + } + else { + // If x is not null... + // + if (y === null) + // ...and y is null, x is greater. + { + return -1; + } + else { + // ...and y is not null, compare the + // lengths of the two strings. + // + let retval = y.length - x.length; + if (retval !== 0) { + // If the strings are not of equal length, + // the longer string is greater. + // + return retval; + } + else { + // If the strings are of equal length, + // sort them with ordinary string comparison. + // + let xl = x.toLowerCase(); + let yl = y.toLowerCase(); + if (xl < yl) { + return -1; + } + if (xl > yl) { + return 1; + } + return 0; + } + } + } + } + isDimensionFallsInTime(dimension, time) { + let isSubMatch = false; + if (dimension.index >= time.index && dimension.index + dimension.length <= time.index + time.length) { + isSubMatch = true; + } + return isSubMatch; + } +} +exports.NumberWithUnitExtractor = NumberWithUnitExtractor; +class BaseMergedUnitExtractor { + constructor(config) { + this.config = config; + this.innerExtractor = new NumberWithUnitExtractor(config); + } + extract(source) { + let result = new Array(); + if (this.config.extractType === constants$2.Constants.SYS_UNIT_CURRENCY) { + result = this.mergeCompoundUnits(source); + } + else { + result = this.innerExtractor.extract(source); + } + return result; + } + mergeCompoundUnits(source) { + let result = new Array(); + let ers = this.innerExtractor.extract(source); + this.MergePureNumber(source, ers); + let groups = []; + groups[0] = 0; + for (let i = 0; i < ers.length - 1; i++) { + if (ers[i].type !== ers[i + 1].type && ers[i].type !== recognizersTextNumber.Constants.SYS_NUM && ers[i + 1].type !== recognizersTextNumber.Constants.SYS_NUM) { + continue; + } + if (ers[i].data != null && ers[i].data.data != null && !ers[i].data.data.startsWith('Integer')) { + groups[i + 1] = groups[i] + 1; + continue; + } + let middleBegin = ers[i].start + ers[i].length; + let middleEnd = ers[i + 1].start; + let middleStr = source.substring(middleBegin, middleEnd).trim().toLowerCase(); + // Separated by whitespace + if (recognizersText.StringUtility.isNullOrEmpty(middleStr)) { + groups[i + 1] = groups[i]; + continue; + } + // Separated by connectors + let match = recognizersText.RegExpUtility.getMatches(this.config.compoundUnitConnectorRegex, middleStr).pop(); + if (match && match.index === 0 && match.length === middleStr.length) { + groups[i + 1] = groups[i]; + } + else { + groups[i + 1] = groups[i] + 1; + } + } + for (let i = 0; i < ers.length; i++) { + if (i === 0 || groups[i] !== groups[i - 1]) { + let tmpInner = new recognizersText.ExtractResult(); + tmpInner.data = ers[i].data; + tmpInner.length = ers[i].length; + tmpInner.start = ers[i].start; + tmpInner.text = ers[i].text; + tmpInner.type = ers[i].type; + let tmpExtractResult = ers[i]; + tmpExtractResult.data = new Array(); + tmpExtractResult.data.push(tmpInner); + result.push(tmpExtractResult); + } + // Reduce extract results in same group + if (i + 1 < ers.length && groups[i + 1] === groups[i]) { + let group = groups[i]; + let periodBegin = result[group].start; + let periodEnd = ers[i + 1].start + ers[i + 1].length; + result[group].length = periodEnd - periodBegin; + result[group].text = source.substring(periodBegin, periodEnd); + result[group].type = constants$2.Constants.SYS_UNIT_CURRENCY; + result[group].data.push(ers[i + 1]); + } + } + for (let i = 0; i < result.length; i++) { + let innerData = result[i].data; + if (innerData && innerData.length === 1) { + result[i] = innerData[0]; + } + } + result = result.filter(er => er.type !== recognizersTextNumber.Constants.SYS_NUM); + return result; + } + MergePureNumber(source, result) { + let numErs = this.config.unitNumExtractor.extract(source); + let unitNumbers = new Array(); + let i; + let j; + for (i = 0, j = 0; i < numErs.length; i++) { + let hasBehindExtraction = false; + while (j < result.length && result[j].start + result[j].length < numErs[i].start) { + hasBehindExtraction = true; + j++; + } + if (!hasBehindExtraction) { + continue; + } + let middleBegin = result[j - 1].start + result[j - 1].length; + let middleEnd = numErs[i].start; + let middleStr = source.substring(middleBegin, middleEnd).trim().toLowerCase(); + // Separated by whitespace + if (recognizersText.StringUtility.isNullOrEmpty(middleStr)) { + unitNumbers.push(numErs[i]); + continue; + } + // Separated by connectors + let match = recognizersText.RegExpUtility.getMatches(this.config.compoundUnitConnectorRegex, middleStr).pop(); + if (match && match.index === 0 && match.length === middleStr.length) { + unitNumbers.push(numErs[i]); + } + } + unitNumbers.forEach(extractResult => { + let overlap = false; + result.forEach(er => { + if (er.start <= extractResult.start && er.start + er.length >= extractResult.start) { + overlap = true; + } + }); + if (!overlap) { + result.push(extractResult); + } + }); + result.sort((x, y) => x.start - y.start); + } +} +exports.BaseMergedUnitExtractor = BaseMergedUnitExtractor; +class PrefixUnitResult { +} +exports.PrefixUnitResult = PrefixUnitResult; + +}); + +unwrapExports(extractors$16); + +/** + * lodash 3.0.0 (Custom Build) + * Build: `lodash modern modularize exports="npm" -o ./` + * Copyright 2012-2015 The Dojo Foundation + * Based on Underscore.js 1.7.0 + * Copyright 2009-2015 Jeremy Ashkenas, DocumentCloud and Investigative Reporters & Editors + * Available under MIT license + */ + +/** + * Gets the last element of `array`. + * + * @static + * @memberOf _ + * @category Array + * @param {Array} array The array to query. + * @returns {*} Returns the last element of `array`. + * @example + * + * _.last([1, 2, 3]); + * // => 3 + */ +function last(array) { + var length = array ? array.length : 0; + return length ? array[length - 1] : undefined; +} + +var lodash_last = last; + +var utilities$2 = createCommonjsModule(function (module, exports) { +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); + +class DictionaryUtils { + static bindDictionary(dictionary, source) { + if (dictionary === null) { + return; + } + dictionary.forEach((value, key) => { + if (recognizersText.StringUtility.isNullOrEmpty(key)) { + return; + } + this.bindUnitsString(source, key, value); + }); + } + static bindUnitsString(dictionary, key, source) { + let values = source.trim().split('|'); + values.forEach(token => { + if (recognizersText.StringUtility.isNullOrWhitespace(token) || dictionary.has(token)) { + return; + } + dictionary.set(token, key); + }); + } +} +exports.DictionaryUtils = DictionaryUtils; + +}); + +unwrapExports(utilities$2); + +var baseCurrency = createCommonjsModule(function (module, exports) { +"use strict"; +// ------------------------------------------------------------------------------ +// +// This code was generated by a tool. +// Changes to this file may cause incorrect behavior and will be lost if +// the code is regenerated. +// +// ------------------------------------------------------------------------------ +Object.defineProperty(exports, "__esModule", { value: true }); +var BaseCurrency; +(function (BaseCurrency) { + BaseCurrency.CurrencyFractionMapping = new Map([["CNY", "FEN|JIAO"], ["__D", "CENT"], ["RUB", "KOPEK"], ["AFN", "PUL"], ["EUR", "CENT"], ["ALL", "QINDARKE"], ["_ALP", "PENNY"], ["GBP", "PENNY"], ["_GGP", "PENNY"], ["DZD", "SANTEEM"], ["AOA", "CENTIMO"], ["ARS", "CENTAVO"], ["AMD", "LUMA"], ["AWG", "CENT"], ["_AP", "PENNY"], ["SHP", "PENNY"], ["AUD", "CENT"], ["AZN", "QƏPIK"], ["BSD", "CENT"], ["BHD", "FILS"], ["BDT", "POISHA"], ["BBD", "CENT"], ["BYN", "KAPYEYKA"], ["BZD", "CENT"], ["XOF", "CENTIME"], ["BMD", "CENT"], ["BTN", "CHETRUM"], ["INR", "PAISA"], ["BOB", "CENTAVO"], ["USD", "CENT"], ["BAM", "FENING"], ["BWP", "THEBE"], ["BRL", "CENTAVO"], ["_BD", "CENT"], ["BND", "SEN"], ["SGD", "CENT"], ["BGN", "STOTINKA"], ["BIF", "CENTIME"], ["KHR", "SEN"], ["XAF", "CENTIME"], ["CAD", "CENT"], ["CVE", "CENTAVO"], ["KYD", "CENT"], ["CLP", "CENTAVO"], ["COP", "CENTAVO"], ["KMF", "CENTIME"], ["CDF", "CENTIME"], ["NZD", "CENT"], ["_CKD", "CENT"], ["CRC", "CENTIMO"], ["HRK", "LIPA"], ["CUC", "CENTAVO"], ["CUP", "CENTAVO"], ["CZK", "HALER"], ["DKK", "ØRE"], ["DJF", "CENTIME"], ["DOP", "CENTAVO"], ["EGP", "PIASTRE"], ["ERN", "CENT"], ["ETB", "SANTIM"], ["FKP", "PENNY"], ["_FOK", "OYRA"], ["FJD", "CENT"], ["XPF", "CENTIME"], ["GMD", "BUTUT"], ["GEL", "TETRI"], ["GHS", "PESEWA"], ["GIP", "PENNY"], ["GTQ", "CENTAVO"], ["GNF", "CENTIME"], ["GYD", "CENT"], ["HTG", "CENTIME"], ["HNL", "CENTAVO"], ["HKD", "CENT"], ["HUF", "FILLER"], ["ISK", "EYRIR"], ["IDR", "SEN"], ["IRR", "DINAR"], ["IQD", "FILS"], ["IMP", "PENNY"], ["ILS", "AGORA"], ["JMD", "CENT"], ["JPY", "SEN"], ["JEP", "PENNY"], ["JOD", "PIASTRE"], ["KZT", "TIIN"], ["KES", "CENT"], ["_KID", "CENT"], ["KPW", "CHON"], ["KRW", "JEON"], ["KWD", "FILS"], ["KGS", "TYIYN"], ["LAK", "ATT"], ["LBP", "PIASTRE"], ["LSL", "SENTE"], ["ZAR", "CENT"], ["LRD", "CENT"], ["LYD", "DIRHAM"], ["CHF", "RAPPEN"], ["MOP", "AVO"], ["MKD", "DENI"], ["MGA", "IRAIMBILANJA"], ["MWK", "TAMBALA"], ["MYR", "SEN"], ["MVR", "LAARI"], ["MRO", "KHOUMS"], ["MUR", "CENT"], ["MXN", "CENTAVO"], ["_MD", "CENT"], ["MDL", "BAN"], ["MNT", "MONGO"], ["MAD", "CENTIME"], ["MZN", "CENTAVO"], ["MMK", "PYA"], ["NAD", "CENT"], ["_ND", "CENT"], ["NPR", "PAISA"], ["NIO", "CENTAVO"], ["NGN", "KOBO"], ["_NID", "CENT"], ["TRY", "KURUS"], ["NOK", "ØRE"], ["OMR", "BAISA"], ["PKR", "PAISA"], ["_PD", "CENT"], ["PAB", "CENTESIMO"], ["PGK", "TOEA"], ["PYG", "CENTIMO"], ["PEN", "CENTIMO"], ["_PND", "CENT"], ["PLN", "GROSZ"], ["QAR", "DIRHAM"], ["RON", "BAN"], ["RWF", "CENTIME"], ["WST", "SENE"], ["STD", "CENTIMO"], ["SAR", "HALALA"], ["RSD", "PARA"], ["SCR", "CENT"], ["SLL", "CENT"], ["SBD", "CENT"], ["SOS", "CENT"], ["_SS", "CENT"], ["_SP", "PENNY"], ["SSP", "PIASTRE"], ["LKR", "CENT"], ["SDG", "PIASTRE"], ["SRD", "CENT"], ["SZL", "CENT"], ["SEK", "ORE"], ["SYP", "PIASTRE"], ["TWD", "CENT"], ["TJS", "DIRAM"], ["TZS", "CENT"], ["THB", "SATANG"], ["PRB", "KOPEK"], ["TTD", "CENT"], ["_TP", "PENNY"], ["TND", "MILLIME"], ["TMT", "TENNESI"], ["TVD", "CENT"], ["UGX", "CENT"], ["UAH", "KOPIYKA"], ["AED", "FILS"], ["UYU", "CENTESIMO"], ["VEF", "CENTIMO"], ["YER", "FILS"], ["ZMW", "NGWEE"]]); + BaseCurrency.CurrencyFractionalRatios = new Map([["Kopek", 100], ["Pul", 100], ["Cent", 100], ["Qindarkë", 100], ["Penny", 100], ["Santeem", 100], ["Cêntimo", 100], ["Centavo", 100], ["Luma", 100], ["Qəpik", 100], ["Fils", 1000], ["Poisha", 100], ["Kapyeyka", 100], ["Centime", 100], ["Chetrum", 100], ["Paisa", 100], ["Fening", 100], ["Thebe", 100], ["Sen", 100], ["Stotinka", 100], ["Jiao", 10], ["Fen", 100], ["Céntimo", 100], ["Lipa", 100], ["Haléř", 100], ["Øre", 100], ["Piastre", 100], ["Santim", 100], ["Oyra", 100], ["Butut", 100], ["Tetri", 100], ["Pesewa", 100], ["Fillér", 100], ["Eyrir", 100], ["Dinar", 100], ["Agora", 100], ["Tïın", 100], ["Chon", 100], ["Jeon", 100], ["Tyiyn", 100], ["Att", 100], ["Sente", 100], ["Dirham", 1000], ["Rappen", 100], ["Avo", 100], ["Deni", 100], ["Iraimbilanja", 5], ["Tambala", 100], ["Laari", 100], ["Khoums", 5], ["Ban", 100], ["Möngö", 100], ["Pya", 100], ["Kobo", 100], ["Kuruş", 100], ["Baisa", 1000], ["Centésimo", 100], ["Toea", 100], ["Sentimo", 100], ["Grosz", 100], ["Sene", 100], ["Halala", 100], ["Para", 100], ["Öre", 100], ["Diram", 100], ["Satang", 100], ["Seniti", 100], ["Millime", 1000], ["Tennesi", 100], ["Kopiyka", 100], ["Tiyin", 100], ["Hào", 10], ["Ngwee", 100]]); +})(BaseCurrency = exports.BaseCurrency || (exports.BaseCurrency = {})); + +}); + +unwrapExports(baseCurrency); + +var parsers$4 = createCommonjsModule(function (module, exports) { +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); + + + + + + +class UnitValue { + constructor() { + this.number = ""; + this.unit = ""; + } +} +exports.UnitValue = UnitValue; +class UnitValueIso extends UnitValue { + constructor() { + super(...arguments); + this.isoCurrency = ""; + } +} +exports.UnitValueIso = UnitValueIso; +class BaseNumberWithUnitParserConfiguration { + constructor(cultureInfo) { + this.cultureInfo = cultureInfo; + this.unitMap = new Map(); + this.currencyFractionNumMap = baseCurrency.BaseCurrency.CurrencyFractionalRatios; + this.currencyFractionMapping = baseCurrency.BaseCurrency.CurrencyFractionMapping; + } + BindDictionary(dictionary) { + utilities$2.DictionaryUtils.bindDictionary(dictionary, this.unitMap); + } +} +exports.BaseNumberWithUnitParserConfiguration = BaseNumberWithUnitParserConfiguration; +class NumberWithUnitParser { + constructor(config) { + this.config = config; + } + parse(extResult) { + let ret = new recognizersText.ParseResult(extResult); + let numberResult; + if (extResult.data && typeof extResult.data === "object") { + numberResult = extResult.data; + } + else if (extResult.type === constants$2.Constants.SYS_NUM) { + ret.value = this.config.internalNumberParser.parse(extResult).value; + return ret; + } + else { + // if there is no unitResult, means there is just unit + numberResult = { start: -1, length: 0, text: null, type: null }; + } + // key contains units + let key = extResult.text; + let unitKeyBuild = ''; + let unitKeys = new Array(); + for (let i = 0; i <= key.length; i++) { + if (i === key.length) { + if (unitKeyBuild.length !== 0) { + this.addIfNotContained(unitKeys, unitKeyBuild.trim()); + } + } + // numberResult.start is a relative position + else if (i === numberResult.start) { + if (unitKeyBuild.length !== 0) { + this.addIfNotContained(unitKeys, unitKeyBuild.trim()); + unitKeyBuild = ''; + } + let o = numberResult.start + numberResult.length - 1; + if (o !== null && !isNaN(o)) { + i = o; + } + } + else { + unitKeyBuild += key[i]; + } + } + /* Unit type depends on last unit in suffix.*/ + let lastUnit = lodash_last(unitKeys); + let normalizedLastUnit = lastUnit.toLowerCase(); + if (this.config.connectorToken && this.config.connectorToken.length && normalizedLastUnit.indexOf(this.config.connectorToken) === 0) { + normalizedLastUnit = normalizedLastUnit.substring(this.config.connectorToken.length).trim(); + lastUnit = lastUnit.substring(this.config.connectorToken.length).trim(); + } + if (key && key.length && (this.config.unitMap !== null)) { + let unitValue = null; + if (this.config.unitMap.has(lastUnit)) { + unitValue = this.config.unitMap.get(lastUnit); + } + else if (this.config.unitMap.has(normalizedLastUnit)) { + unitValue = this.config.unitMap.get(normalizedLastUnit); + } + if (unitValue) { + let numValue = numberResult.text && numberResult.text.length ? this.config.internalNumberParser.parse(numberResult) : null; + let resolutionStr = numValue ? numValue.resolutionStr : null; + ret.value = { number: resolutionStr, unit: unitValue }; + ret.resolutionStr = (`${resolutionStr} ${unitValue}`).trim(); + } + } + return ret; + } + addIfNotContained(keys, newKey) { + if (!keys.some(key => key.includes(newKey))) { + keys.push(newKey); + } + } +} +exports.NumberWithUnitParser = NumberWithUnitParser; +class BaseCurrencyParser { + constructor(config) { + this.config = config; + this.numberWithUnitParser = new NumberWithUnitParser(config); + } + parse(extResult) { + let result = null; + if (extResult.data instanceof Array) { + result = this.mergeCompoundUnit(extResult); + } + else { + result = this.numberWithUnitParser.parse(extResult); + let value = result.value; + if (!this.config.currencyNameToIsoCodeMap.has(value.unit) || this.config.currencyNameToIsoCodeMap.get(value.unit).startsWith(constants$2.Constants.FAKE_ISO_CODE_PREFIX)) { + result.value = { + unit: value.unit, + number: value.number + }; + } + else { + result.value = { + unit: value.unit, + number: value.number, + isoCurrency: this.config.currencyNameToIsoCodeMap.get(value.unit) + }; + } + } + return result; + } + mergeCompoundUnit(compoundResult) { + let results = []; + let compoundUnit = compoundResult.data; + let count = 0; + let result = null; + let numberValue = 0.0; + let mainUnitValue = ''; + let mainUnitIsoCode = ''; + let fractionUnitsString = ''; + for (let i = 0; i < compoundUnit.length; i++) { + let extractResult = compoundUnit[i]; + let parseResult = this.numberWithUnitParser.parse(extractResult); + let parseResultValue = parseResult.value; + let unitValue = parseResultValue != null ? parseResultValue.unit : null; + // Process a new group + if (count === 0) { + if (extractResult.type !== constants$2.Constants.SYS_UNIT_CURRENCY) { + continue; + } + // Initialize a new result + result = new recognizersText.ParseResult(extractResult); + mainUnitValue = unitValue; + numberValue = parseFloat(parseResultValue.number); + result.resolutionStr = parseResult.resolutionStr; + if (this.config.currencyNameToIsoCodeMap.has(unitValue)) { + mainUnitIsoCode = this.config.currencyNameToIsoCodeMap.get(unitValue); + } + // If the main unit can't be recognized, finish process this group. + if (recognizersText.StringUtility.isNullOrEmpty(mainUnitIsoCode)) { + result.value = { + number: numberValue.toString(), + unit: mainUnitValue + }; + results.push(result); + result = null; + continue; + } + if (this.config.currencyFractionMapping.has(mainUnitIsoCode)) { + fractionUnitsString = this.config.currencyFractionMapping.get(mainUnitIsoCode); + } + } + else { + // Match pure number as fraction unit. + if (extractResult.type === recognizersTextNumber.Constants.SYS_NUM) { + numberValue += parseResult.value * (1.0 / 100); + result.resolutionStr += ' ' + parseResult.resolutionStr; + result.length = parseResult.start + parseResult.length - result.start; + count++; + continue; + } + let fractionUnitCode; + let fractionNumValue; + if (this.config.currencyFractionCodeList.has(unitValue)) { + fractionUnitCode = this.config.currencyFractionCodeList.get(unitValue); + } + if (this.config.currencyFractionNumMap.has(unitValue)) { + fractionNumValue = this.config.currencyFractionNumMap.get(unitValue); + } + if (fractionUnitCode && fractionNumValue !== 0 && this.checkUnitsStringContains(fractionUnitCode, fractionUnitsString)) { + numberValue += parseFloat(parseResultValue.number) * (1.0 / fractionNumValue); + result.resolutionStr += ' ' + parseResult.resolutionStr; + result.length = parseResult.start + parseResult.length - result.start; + } + else { + // If the fraction unit doesn't match the main unit, finish process this group. + if (result !== null) { + if (recognizersText.StringUtility.isNullOrEmpty(mainUnitIsoCode) || mainUnitIsoCode.startsWith(constants$2.Constants.FAKE_ISO_CODE_PREFIX)) { + result.value = { + number: numberValue.toString(), + unit: mainUnitValue + }; + } + else { + result.value = { + number: numberValue.toString(), + unit: mainUnitValue, + isoCurrency: mainUnitIsoCode + }; + } + results.push(result); + result = null; + } + count = 0; + i -= 1; + continue; + } + } + count++; + } + if (result !== null) { + if (recognizersText.StringUtility.isNullOrEmpty(mainUnitIsoCode) || mainUnitIsoCode.startsWith(constants$2.Constants.FAKE_ISO_CODE_PREFIX)) { + result.value = { + number: numberValue.toString(), + unit: mainUnitValue + }; + } + else { + result.value = { + number: numberValue.toString(), + unit: mainUnitValue, + isoCurrency: mainUnitIsoCode + }; + } + results.push(result); + } + this.resolveText(results, compoundResult.text, compoundResult.start); + return { value: results }; + } + checkUnitsStringContains(fractionUnitCode, fractionUnitsString) { + let unitsMap = new Map(); + utilities$2.DictionaryUtils.bindUnitsString(unitsMap, '', fractionUnitsString); + return unitsMap.has(fractionUnitCode); + } + resolveText(prs, source, bias) { + prs.forEach(parseResult => { + if (parseResult.start !== null && parseResult.length !== null) { + parseResult.text = source.substr(parseResult.start - bias, parseResult.length); + } + }); + } +} +exports.BaseCurrencyParser = BaseCurrencyParser; +class BaseMergedUnitParser { + constructor(config) { + this.config = config; + this.numberWithUnitParser = new NumberWithUnitParser(config); + this.currencyParser = new BaseCurrencyParser(config); + } + parse(extResult) { + let result; + if (extResult.type === constants$2.Constants.SYS_UNIT_CURRENCY) { + result = this.currencyParser.parse(extResult); + } + else { + result = this.numberWithUnitParser.parse(extResult); + } + return result; + } +} +exports.BaseMergedUnitParser = BaseMergedUnitParser; + +}); + +unwrapExports(parsers$4); + +var englishNumericWithUnit = createCommonjsModule(function (module, exports) { +"use strict"; +// ------------------------------------------------------------------------------ +// +// This code was generated by a tool. +// Changes to this file may cause incorrect behavior and will be lost if +// the code is regenerated. +// +// ------------------------------------------------------------------------------ +Object.defineProperty(exports, "__esModule", { value: true }); +var EnglishNumericWithUnit; +(function (EnglishNumericWithUnit) { + EnglishNumericWithUnit.AgeSuffixList = new Map([["Year", "years old|year old|year-old|years-old|-year-old|-years-old|years of age|year of age"], ["Month", "months old|month old|month-old|months-old|-month-old|-months-old|month of age|months of age"], ["Week", "weeks old|week old|week-old|weeks-old|-week-old|-weeks-old|week of age|weeks of age"], ["Day", "days old|day old|day-old|days-old|-day-old|-days-old|day of age|days of age"]]); + EnglishNumericWithUnit.AreaSuffixList = new Map([["Square kilometer", "sq km|sq kilometer|sq kilometre|sq kilometers|sq kilometres|square kilometer|square kilometre|square kilometers|square kilometres|km2|km^2|km²"], ["Square hectometer", "sq hm|sq hectometer|sq hectometre|sq hectometers|sq hectometres|square hectometer|square hectometre|square hectometers|square hectometres|hm2|hm^2|hm²|hectare|hectares"], ["Square decameter", "sq dam|sq decameter|sq decametre|sq decameters|sq decametres|square decameter|square decametre|square decameters|square decametres|sq dekameter|sq dekametre|sq dekameters|sq dekametres|square dekameter|square dekametre|square dekameters|square dekametres|dam2|dam^2|dam²"], ["Square meter", "sq m|sq meter|sq metre|sq meters|sq metres|sq metre|square meter|square meters|square metre|square metres|m2|m^2|m²"], ["Square decimeter", "sq dm|sq decimeter|sq decimetre|sq decimeters|sq decimetres|square decimeter|square decimetre|square decimeters|square decimetres|dm2|dm^2|dm²"], ["Square centimeter", "sq cm|sq centimeter|sq centimetre|sq centimeters|sq centimetres|square centimeter|square centimetre|square centimeters|square centimetres|cm2|cm^2|cm²"], ["Square millimeter", "sq mm|sq millimeter|sq millimetre|sq millimeters|sq millimetres|square millimeter|square millimetre|square millimeters|square millimetres|mm2|mm^2|mm²"], ["Square inch", "sq in|sq inch|square inch|square inches|in2|in^2|in²"], ["Square foot", "sqft|sq ft|sq foot|sq feet|square foot|square feet|feet2|feet^2|feet²|ft2|ft^2|ft²"], ["Square mile", "sq mi|sq mile|sqmiles|square mile|square miles|mi2|mi^2|mi²"], ["Square yard", "sq yd|sq yard|sq yards|square yard|square yards|yd2|yd^2|yd²"], ["Acre", "-acre|acre|acres"]]); + EnglishNumericWithUnit.CurrencySuffixList = new Map([["Abkhazian apsar", "abkhazian apsar|apsars"], ["Afghan afghani", "afghan afghani|؋|afn|afghanis|afghani"], ["Pul", "pul"], ["Euro", "euros|euro|€|eur"], ["Cent", "cents|cent|-cents|-cent|sen"], ["Albanian lek", "albanian lek|leks|lek"], ["Qindarkë", "qindarkë|qindarkës|qindarke|qindarkes"], ["Angolan kwanza", "angolan kwanza|kz|aoa|kwanza|kwanzas|angolan kwanzas"], ["Armenian dram", "armenian drams|armenian dram"], ["Aruban florin", "aruban florin|ƒ|awg|aruban florins"], ["Bangladeshi taka", "bangladeshi taka|৳|bdt|taka|takas|bangladeshi takas"], ["Paisa", "poisha|paisa"], ["Bhutanese ngultrum", "Bhutanese ngultrum|nu.|btn"], ["Chetrum", "chetrums|chetrum"], ["Bolivian boliviano", "bolivian boliviano|bob|bs.|bolivia boliviano|bolivia bolivianos|bolivian bolivianos"], ["Bosnia and Herzegovina convertible mark", "bosnia and herzegovina convertible mark|bam"], ["Fening", "fenings|fenings"], ["Botswana pula", "botswana pula|bwp|pula|pulas|botswana pulas"], ["Thebe", "thebe"], ["Brazilian real", "brazilian real|r$|brl|brazil real|brazil reals|brazilian reals"], ["Bulgarian lev", "bulgarian lev|bgn|лв|bulgaria lev|bulgaria levs|bulgarian levs"], ["Stotinka", "stotinki|stotinka"], ["Cambodian riel", "cambodian riel|khr|៛|cambodia riel|cambodia riels|cambodian riels"], ["Cape Verdean escudo", "cape verdean escudo|cve"], ["Costa Rican colón", "costa rican colón|costa rican colóns|crc|₡|costa rica colón|costa rica colóns|costa rican colon|costa rican colons|costa rica colon|costa rica colons"], ["Salvadoran colón", "svc|salvadoran colón|salvadoran colóns|salvador colón|salvador colóns|salvadoran colon|salvadoran colons|salvador colon|salvador colons"], ["Céntimo", "céntimo"], ["Croatian kuna", "croatian kuna|kn|hrk|croatia kuna|croatian kunas|croatian kuna kunas"], ["Lipa", "lipa"], ["Czech koruna", "czech koruna|czk|Kč|czech korunas"], ["Haléř", "haléř"], ["Eritrean nakfa", "eritrean nakfa|nfk|ern|eritrean nakfas"], ["Ethiopian birr", "ethiopian birr|etb"], ["Gambian dalasi", "gmd"], ["Butut", "bututs|butut"], ["Georgian lari", "Georgian lari|lari|gel|₾"], ["Tetri", "tetri"], ["Ghanaian cedi", "Ghanaian cedi|ghs|₵|gh₵"], ["Pesewa", "pesewas|pesewa"], ["Guatemalan quetzal", "guatemalan quetzal|gtq|guatemala quetzal"], ["Haitian gourde", "haitian gourde|htg"], ["Honduran lempira", "honduran lempira|hnl"], ["Hungarian forint", "hungarian forint|huf|ft|hungary forint|hungary forints|hungarian forints"], ["Fillér", "fillér"], ["Iranian rial", "iranian rial|irr|iran rial|iran rials|iranian rials"], ["Yemeni rial", "yemeni rial|yer|yemeni rials"], ["Israeli new shekel", "₪|ils|agora"], ["Lithuanian litas", "ltl|lithuanian litas|lithuan litas|lithuanian lit|lithuan lit"], ["Japanese yen", "japanese yen|jpy|yen|-yen|¥|yens|japanese yens|japan yen|japan yens"], ["Kazakhstani tenge", "Kazakhstani tenge|kzt"], ["Kenyan shilling", "kenyan shilling|sh|kes"], ["North Korean won", "north korean won|kpw|north korean wons"], ["South Korean won", "south korean won|krw|south korean wons"], ["Korean won", "korean won|₩|korean wons"], ["Kyrgyzstani som", "kyrgyzstani som|kgs"], ["Uzbekitan som", "uzbekitan som|uzs"], ["Lao kip", "lao kip|lak|₭n|₭"], ["Att", "att"], ["Lesotho loti", "lesotho loti|lsl|loti"], ["Sente", "sente|lisente"], ["South African rand", "south african rand|zar|south africa rand|south africa rands|south african rands"], ["Macanese pataca", "macanese pataca|mop$|mop"], ["Avo", "avos|avo"], ["Macedonian denar", "macedonian denar|mkd|ден"], ["Deni", "deni"], ["Malagasy ariary", "malagasy ariary|mga"], ["Iraimbilanja", "iraimbilanja"], ["Malawian kwacha", "malawian kwacha|mk|mwk"], ["Tambala", "tambala"], ["Malaysian ringgit", "malaysian ringgit|rm|myr|malaysia ringgit|malaysia ringgits|malaysian ringgits"], ["Mauritanian ouguiya", "mauritanian ouguiya|um|mro|mauritania ouguiya|mauritania ouguiyas|mauritanian ouguiyas"], ["Khoums", "khoums"], ["Mongolian tögrög", "mongolian tögrög|mnt|₮|mongolia tögrög|mongolia tögrögs|mongolian tögrögs|mongolian togrog|mongolian togrogs|mongolia togrog|mongolia togrogs"], ["Mozambican metical", "mozambican metical|mt|mzn|mozambica metical|mozambica meticals|mozambican meticals"], ["Burmese kyat", "Burmese kyat|ks|mmk"], ["Pya", "pya"], ["Nicaraguan córdoba", "nicaraguan córdoba|nio"], ["Nigerian naira", "nigerian naira|naira|ngn|₦|nigeria naira|nigeria nairas|nigerian nairas"], ["Kobo", "kobo"], ["Turkish lira", "turkish lira|try|tl|turkey lira|turkey liras|turkish liras"], ["Kuruş", "kuruş"], ["Omani rial", "omani rial|omr|ر.ع."], ["Panamanian balboa", "panamanian balboa|b/.|pab"], ["Centesimo", "centesimo|céntimo"], ["Papua New Guinean kina", "papua new guinean kina|kina|pgk"], ["Toea", "toea"], ["Paraguayan guaraní", "paraguayan guaraní|₲|pyg"], ["Peruvian sol", "peruvian sol|soles|sol|peruvian nuevo sol"], ["Polish złoty", "złoty|polish złoty|zł|pln|zloty|polish zloty|poland zloty|poland złoty"], ["Grosz", "groszy|grosz|grosze"], ["Qatari riyal", "qatari riyal|qar|qatari riyals|qatar riyal|qatar riyals"], ["Saudi riyal", "saudi riyal|sar|saudi riyals"], ["Riyal", "riyal|riyals|rial|﷼"], ["Dirham", "dirham|dirhem|dirhm"], ["Halala", "halalas|halala"], ["Samoan tālā", "samoan tālā|tālā|tala|ws$|samoa|wst|samoan tala"], ["Sene", "sene"], ["São Tomé and Príncipe dobra", "são tomé and príncipe dobra|dobras|dobra|std"], ["Sierra Leonean leone", "sierra Leonean leone|sll|leone|le"], ["Peseta", "pesetas|peseta"], ["Netherlands guilder", "florin|netherlands antillean guilder|ang|ƒ|nederlandse gulden|guilders|guilder|gulden|-guilders|-guilder|dutch guilders|dutch guilder|fl"], ["Swazi lilangeni", "swazi lilangeni|lilangeni|szl|emalangeni"], ["Tajikistani somoni", "tajikistani somoni|tjs|somoni"], ["Diram", "dirams|diram"], ["Thai baht", "thai baht|฿|thb|baht"], ["Satang", "satang|satangs"], ["Tongan paʻanga", "tongan paʻanga|paʻanga|tongan pa'anga|pa'anga"], ["Seniti", "seniti"], ["Ukrainian hryvnia", "ukrainian hryvnia|hyrvnia|uah|₴|ukrain hryvnia|ukrain hryvnias|ukrainian hryvnias"], ["Vanuatu vatu", "vanuatu vatu|vatu|vuv"], ["Venezuelan bolívar", "venezuelan bolívar|venezuelan bolívars|bs.f.|vef|bolívar fuerte|venezuelan bolivar|venezuelan bolivars|venezuela bolivar|venezuela bolivarsvenezuelan bolivar|venezuelan bolivars"], ["Vietnamese dong", "vietnamese dong|vnd|đồng|vietnam dong|vietnamese dongs|vietnam dongs"], ["Zambian kwacha", "zambian kwacha|zk|zmw|zambia kwacha|kwachas|zambian kwachas"], ["Moroccan dirham", "moroccan dirham|mad|د.م."], ["United Arab Emirates dirham", "united arab emirates dirham|د.إ|aed"], ["Azerbaijani manat", "azerbaijani manat|azn"], ["Turkmenistan manat", "turkmenistan manat|turkmenistan new manat|tmt"], ["Manat", "manats|manat"], ["Qəpik", "qəpik"], ["Somali shilling", "somali shillings|somali shilling|shilin soomaali|-shilin soomaali|scellino|shilin|sh.so.|sos"], ["Somaliland shilling", "somaliland shillings|somaliland shilling|soomaaliland shilin"], ["Tanzanian shilling", "tanzanian shilling|tanzanian shillings|tsh|tzs|tanzania shilling|tanzania shillings"], ["Ugandan shilling", "ugandan shilling|ugandan shillings|sh|ugx|uganda shilling|uganda shillings"], ["Romanian leu", "romanian leu|lei|ron|romania leu"], ["Moldovan leu", "moldovan leu|mdl|moldova leu"], ["Leu", "leu"], ["Ban", "bani|-ban|ban"], ["Nepalese rupee", "nepalese rupee|npr"], ["Pakistani rupee", "pakistani rupee|pkr"], ["Indian rupee", "indian rupee|inr|₹|india rupee"], ["Seychellois rupee", "seychellois rupee|scr|sr|sre"], ["Mauritian rupee", "mauritian rupee|mur"], ["Maldivian rufiyaa", "maldivian rufiyaa|rf|mvr|.ރ|maldive rufiyaa"], ["Sri Lankan rupee", "sri Lankan rupee|lkr|රු|ரூ"], ["Indonesian rupiah", "Indonesian rupiah|rupiah|perak|rp|idr"], ["Rupee", "rupee|rs"], ["Danish krone", "danish krone|dkk|denmark krone|denmark krones|danish krones"], ["Norwegian krone", "norwegian krone|nok|norway krone|norway krones|norwegian krones"], ["Faroese króna", "faroese króna|faroese krona"], ["Icelandic króna", "icelandic króna|isk|icelandic krona|iceland króna|iceland krona"], ["Swedish krona", "swedish krona|sek|swedan krona"], ["Krone", "kronor|krona|króna|krone|krones|kr|-kr"], ["Øre", "Øre|oyra|eyrir"], ["West African CFA franc", "west african cfa franc|xof|west africa cfa franc|west africa franc|west african franc"], ["Central African CFA franc", "central african cfa franc|xaf|central africa cfa franc|central african franc|central africa franc"], ["Comorian franc", "comorian franc|kmf"], ["Congolese franc", "congolese franc|cdf"], ["Burundian franc", "burundian franc|bif"], ["Djiboutian franc", "djiboutian franc|djf"], ["CFP franc", "cfp franc|xpf"], ["Guinean franc", "guinean franc|gnf"], ["Swiss franc", "swiss francs|swiss franc|chf|sfr."], ["Rwandan franc", "Rwandan franc|rwf|rf|r₣|frw"], ["Belgian franc", "belgian franc|bi.|b.fr.|bef|belgium franc"], ["Rappen", "rappen|-rappen"], ["Franc", "francs|franc|fr.|fs"], ["Centime", "centimes|centime|santim"], ["Russian ruble", "russian ruble|₽|rub|russia ruble|russia ₽|russian ₽|russian rubles|russia rubles"], ["New Belarusian ruble", "new belarusian ruble|byn|new belarus ruble|new belarus rubles|new belarusian rubles"], ["Old Belarusian ruble", "old belarusian ruble|byr|old belarus ruble|old belarus rubles|old belarusian rubles"], ["Transnistrian ruble", "transnistrian ruble|prb|р."], ["Belarusian ruble", "belarusian ruble|belarus ruble|belarus rubles|belarusian rubles"], ["Kopek", "kopek|kopeks"], ["Kapyeyka", "kapyeyka"], ["Ruble", "rubles|ruble|br"], ["Algerian dinar", "algerian dinar|د.ج|dzd|algerian dinars|algeria dinar|algeria dinars"], ["Bahraini dinar", "bahraini dinars|bahraini dinar|bhd|.د.ب"], ["Santeem", "santeem|santeems"], ["Iraqi dinar", "iraqi dinars|iraqi dinar|iraq dinars|iraq dinar|iqd|ع.د"], ["Jordanian dinar", "jordanian dinars|jordanian dinar|د.ا|jod|jordan dinar|jordan dinars"], ["Kuwaiti dinar", "kuwaiti dinars|kuwaiti dinar|kwd|د.ك"], ["Libyan dinar", "libyan dinars|libyan dinar|libya dinars|libya dinar|lyd"], ["Serbian dinar", "serbian dinars|serbian dinar|din.|rsd|дин.|serbia dinars|serbia dinar"], ["Tunisian dinar", "tunisian dinars|tunisian dinar|tnd|tunisia dinars|tunisia dinar"], ["Yugoslav dinar", "yugoslav dinars|yugoslav dinar|yun"], ["Dinar", "dinars|dinar|denar|-dinars|-dinar"], ["Fils", "fils|fulūs|-fils|-fil"], ["Para", "para|napa"], ["Millime", "millimes|millime"], ["Argentine peso", "argentine peso|ars|argetina peso|argetina pesos|argentine pesos"], ["Chilean peso", "chilean pesos|chilean peso|clp|chile peso|chile peso"], ["Colombian peso", "colombian pesos|colombian peso|cop|colombia peso|colombia pesos"], ["Cuban convertible peso", "cuban convertible pesos|cuban convertible peso|cuc|cuba convertible pesos|cuba convertible peso"], ["Cuban peso", "cuban pesos|cuban peso|cup|cuba pesos|cuba peso"], ["Dominican peso", "dominican pesos|dominican peso|dop|dominica pesos|dominica peso"], ["Mexican peso", "mexican pesos|mexican peso|mxn|mexico pesos|mexico peso"], ["Philippine peso", "piso|philippine pesos|philippine peso|₱|php"], ["Uruguayan peso", "uruguayan pesos|uruguayan peso|uyu"], ["Peso", "pesos|peso"], ["Centavo", "centavos|centavo"], ["Alderney pound", "alderney pounds|alderney pound|alderney £"], ["British pound", "british pounds|british pound|british £|gbp|pound sterling|pound sterlings|sterling|pound scot|pound scots"], ["Guernsey pound", "guernsey pounds|guernsey £|ggp"], ["Ascension pound", "ascension pounds|ascension pound|ascension £"], ["Saint Helena pound", "saint helena pounds|saint helena pound|saint helena £|shp"], ["Egyptian pound", "egyptian pounds|egyptian pound|egyptian £|egp|ج.م|egypt pounds|egypt pound"], ["Falkland Islands pound", "falkland islands pounds|falkland islands pound|falkland islands £|fkp|falkland island pounds|falkland island pound|falkland island £"], ["Gibraltar pound", "gibraltar pounds|gibraltar pound|gibraltar £|gip"], ["Manx pound", "manx pounds|manx pound|manx £|imp"], ["Jersey pound", "jersey pounds|jersey pound|jersey £|jep"], ["Lebanese pound", "lebanese pounds|lebanese pound|lebanese £|lebanan pounds|lebanan pound|lebanan £|lbp|ل.ل"], ["South Georgia and the South Sandwich Islands pound", "south georgia and the south sandwich islands pounds|south georgia and the south sandwich islands pound|south georgia and the south sandwich islands £"], ["South Sudanese pound", "south sudanese pounds|south sudanese pound|south sudanese £|ssp|south sudan pounds|south sudan pound|south sudan £"], ["Sudanese pound", "sudanese pounds|sudanese pound|sudanese £|ج.س.|sdg|sudan pounds|sudan pound|sudan £"], ["Syrian pound", "syrian pounds|syrian pound|syrian £|ل.س|syp|syria pounds|syria pound|syria £"], ["Tristan da Cunha pound", "tristan da cunha pounds|tristan da cunha pound|tristan da cunha £"], ["Pound", "pounds|pound|-pounds|-pound|£"], ["Pence", "pence"], ["Shilling", "shillings|shilling|shilingi"], ["Penny", "pennies|penny"], ["United States dollar", "united states dollars|united states dollar|united states $|u.s. dollars|u.s. dollar|u s dollar|u s dollars|usd|american dollars|american dollar|us$|us dollar|us dollars|u.s dollar|u.s dollars"], ["East Caribbean dollar", "east caribbean dollars|east caribbean dollar|east Caribbean $|xcd"], ["Australian dollar", "australian dollars|australian dollar|australian $|australian$|aud|australia dollars|australia dollar|australia $|australia$"], ["Bahamian dollar", "bahamian dollars|bahamian dollar|bahamian $|bahamian$|bsd|bahamia dollars|bahamia dollar|bahamia $|bahamia$"], ["Barbadian dollar", "barbadian dollars|barbadian dollar|barbadian $|bbd"], ["Belize dollar", "belize dollars|belize dollar|belize $|bzd"], ["Bermudian dollar", "bermudian dollars|bermudian dollar|bermudian $|bmd|bermudia dollars|bermudia dollar|bermudia $"], ["British Virgin Islands dollar", "british virgin islands dollars|british virgin islands dollar|british virgin islands $|bvi$|virgin islands dollars|virgin islands dolalr|virgin islands $|virgin island dollars|virgin island dollar|virgin island $"], ["Brunei dollar", "brunei dollar|brunei $|bnd"], ["Sen", "sen"], ["Singapore dollar", "singapore dollars|singapore dollar|singapore $|s$|sgd"], ["Canadian dollar", "canadian dollars|canadian dollar|canadian $|cad|can$|c$|canada dollars|canada dolllar|canada $"], ["Cayman Islands dollar", "cayman islands dollars|cayman islands dollar|cayman islands $|kyd|ci$|cayman island dollar|cayman island doolars|cayman island $"], ["New Zealand dollar", "new zealand dollars|new zealand dollar|new zealand $|nz$|nzd|kiwi"], ["Cook Islands dollar", "cook islands dollars|cook islands dollar|cook islands $|cook island dollars|cook island dollar|cook island $"], ["Fijian dollar", "fijian dollars|fijian dollar|fijian $|fjd|fiji dollars|fiji dollar|fiji $"], ["Guyanese dollar", "guyanese dollars|guyanese dollar|gyd|gy$"], ["Hong Kong dollar", "hong kong dollars|hong kong dollar|hong kong $|hk$|hkd|hk dollars|hk dollar|hk $|hongkong$"], ["Jamaican dollar", "jamaican dollars|jamaican dollar|jamaican $|j$|jamaica dollars|jamaica dollar|jamaica $|jmd"], ["Kiribati dollar", "kiribati dollars|kiribati dollar|kiribati $"], ["Liberian dollar", "liberian dollars|liberian dollar|liberian $|liberia dollars|liberia dollar|liberia $|lrd"], ["Micronesian dollar", "micronesian dollars|micronesian dollar|micronesian $"], ["Namibian dollar", "namibian dollars|namibian dollar|namibian $|nad|n$|namibia dollars|namibia dollar|namibia $"], ["Nauruan dollar", "nauruan dollars|nauruan dollar|nauruan $"], ["Niue dollar", "niue dollars|niue dollar|niue $"], ["Palauan dollar", "palauan dollars|palauan dollar|palauan $"], ["Pitcairn Islands dollar", "pitcairn islands dollars|pitcairn islands dollar|pitcairn islands $|pitcairn island dollars|pitcairn island dollar|pitcairn island $"], ["Solomon Islands dollar", "solomon islands dollars|solomon islands dollar|solomon islands $|si$|sbd|solomon island dollars|solomon island dollar|solomon island $"], ["Surinamese dollar", "surinamese dollars|surinamese dollar|surinamese $|srd"], ["New Taiwan dollar", "new taiwan dollars|new taiwan dollar|nt$|twd|ntd"], ["Trinidad and Tobago dollar", "trinidad and tobago dollars|trinidad and tobago dollar|trinidad and tobago $|trinidad $|trinidad dollar|trinidad dollars|trinidadian dollar|trinidadian dollars|trinidadian $|ttd"], ["Tuvaluan dollar", "tuvaluan dollars|tuvaluan dollar|tuvaluan $"], ["Dollar", "dollars|dollar|$"], ["Chinese yuan", "yuan|kuai|chinese yuan|renminbi|cny|rmb|¥|元"], ["Fen", "fen"], ["Jiao", "jiao|mao"], ["Finnish markka", "suomen markka|finnish markka|finsk mark|fim|markkaa|markka"], ["Penni", "penniä|penni"]]); + EnglishNumericWithUnit.CurrencyNameToIsoCodeMap = new Map([["Afghan afghani", "AFN"], ["Euro", "EUR"], ["Albanian lek", "ALL"], ["Angolan kwanza", "AOA"], ["Armenian dram", "AMD"], ["Aruban florin", "AWG"], ["Bangladeshi taka", "BDT"], ["Bhutanese ngultrum", "BTN"], ["Bolivian boliviano", "BOB"], ["Bosnia and Herzegovina convertible mark", "BAM"], ["Botswana pula", "BWP"], ["Brazilian real", "BRL"], ["Bulgarian lev", "BGN"], ["Cambodian riel", "KHR"], ["Cape Verdean escudo", "CVE"], ["Costa Rican colón", "CRC"], ["Croatian kuna", "HRK"], ["Czech koruna", "CZK"], ["Eritrean nakfa", "ERN"], ["Ethiopian birr", "ETB"], ["Gambian dalasi", "GMD"], ["Georgian lari", "GEL"], ["Ghanaian cedi", "GHS"], ["Guatemalan quetzal", "GTQ"], ["Haitian gourde", "HTG"], ["Honduran lempira", "HNL"], ["Hungarian forint", "HUF"], ["Iranian rial", "IRR"], ["Yemeni rial", "YER"], ["Israeli new shekel", "ILS"], ["Japanese yen", "JPY"], ["Kazakhstani tenge", "KZT"], ["Kenyan shilling", "KES"], ["North Korean won", "KPW"], ["South Korean won", "KRW"], ["Kyrgyzstani som", "KGS"], ["Lao kip", "LAK"], ["Lesotho loti", "LSL"], ["South African rand", "ZAR"], ["Macanese pataca", "MOP"], ["Macedonian denar", "MKD"], ["Malagasy ariary", "MGA"], ["Malawian kwacha", "MWK"], ["Malaysian ringgit", "MYR"], ["Mauritanian ouguiya", "MRO"], ["Mongolian tögrög", "MNT"], ["Mozambican metical", "MZN"], ["Burmese kyat", "MMK"], ["Nicaraguan córdoba", "NIO"], ["Nigerian naira", "NGN"], ["Turkish lira", "TRY"], ["Omani rial", "OMR"], ["Panamanian balboa", "PAB"], ["Papua New Guinean kina", "PGK"], ["Paraguayan guaraní", "PYG"], ["Peruvian sol", "PEN"], ["Polish złoty", "PLN"], ["Qatari riyal", "QAR"], ["Saudi riyal", "SAR"], ["Samoan tālā", "WST"], ["São Tomé and Príncipe dobra", "STD"], ["Sierra Leonean leone", "SLL"], ["Swazi lilangeni", "SZL"], ["Tajikistani somoni", "TJS"], ["Thai baht", "THB"], ["Ukrainian hryvnia", "UAH"], ["Vanuatu vatu", "VUV"], ["Venezuelan bolívar", "VEF"], ["Zambian kwacha", "ZMW"], ["Moroccan dirham", "MAD"], ["United Arab Emirates dirham", "AED"], ["Azerbaijani manat", "AZN"], ["Turkmenistan manat", "TMT"], ["Somali shilling", "SOS"], ["Tanzanian shilling", "TZS"], ["Ugandan shilling", "UGX"], ["Romanian leu", "RON"], ["Moldovan leu", "MDL"], ["Nepalese rupee", "NPR"], ["Pakistani rupee", "PKR"], ["Indian rupee", "INR"], ["Seychellois rupee", "SCR"], ["Mauritian rupee", "MUR"], ["Maldivian rufiyaa", "MVR"], ["Sri Lankan rupee", "LKR"], ["Indonesian rupiah", "IDR"], ["Danish krone", "DKK"], ["Norwegian krone", "NOK"], ["Icelandic króna", "ISK"], ["Swedish krona", "SEK"], ["West African CFA franc", "XOF"], ["Central African CFA franc", "XAF"], ["Comorian franc", "KMF"], ["Congolese franc", "CDF"], ["Burundian franc", "BIF"], ["Djiboutian franc", "DJF"], ["CFP franc", "XPF"], ["Guinean franc", "GNF"], ["Swiss franc", "CHF"], ["Rwandan franc", "RWF"], ["Russian ruble", "RUB"], ["Transnistrian ruble", "PRB"], ["Belarusian ruble", "BYN"], ["Algerian dinar", "DZD"], ["Bahraini dinar", "BHD"], ["Iraqi dinar", "IQD"], ["Jordanian dinar", "JOD"], ["Kuwaiti dinar", "KWD"], ["Libyan dinar", "LYD"], ["Serbian dinar", "RSD"], ["Tunisian dinar", "TND"], ["Argentine peso", "ARS"], ["Chilean peso", "CLP"], ["Colombian peso", "COP"], ["Cuban convertible peso", "CUC"], ["Cuban peso", "CUP"], ["Dominican peso", "DOP"], ["Mexican peso", "MXN"], ["Uruguayan peso", "UYU"], ["British pound", "GBP"], ["Saint Helena pound", "SHP"], ["Egyptian pound", "EGP"], ["Falkland Islands pound", "FKP"], ["Gibraltar pound", "GIP"], ["Manx pound", "IMP"], ["Jersey pound", "JEP"], ["Lebanese pound", "LBP"], ["South Sudanese pound", "SSP"], ["Sudanese pound", "SDG"], ["Syrian pound", "SYP"], ["United States dollar", "USD"], ["Australian dollar", "AUD"], ["Bahamian dollar", "BSD"], ["Barbadian dollar", "BBD"], ["Belize dollar", "BZD"], ["Bermudian dollar", "BMD"], ["Brunei dollar", "BND"], ["Singapore dollar", "SGD"], ["Canadian dollar", "CAD"], ["Cayman Islands dollar", "KYD"], ["New Zealand dollar", "NZD"], ["Fijian dollar", "FJD"], ["Guyanese dollar", "GYD"], ["Hong Kong dollar", "HKD"], ["Jamaican dollar", "JMD"], ["Liberian dollar", "LRD"], ["Namibian dollar", "NAD"], ["Solomon Islands dollar", "SBD"], ["Surinamese dollar", "SRD"], ["New Taiwan dollar", "TWD"], ["Trinidad and Tobago dollar", "TTD"], ["Tuvaluan dollar", "TVD"], ["Chinese yuan", "CNY"], ["Rial", "__RI"], ["Shiling", "__S"], ["Som", "__SO"], ["Dirham", "__DR"], ["Dinar", "_DN"], ["Dollar", "__D"], ["Manat", "__MA"], ["Rupee", "__R"], ["Krone", "__K"], ["Krona", "__K"], ["Crown", "__K"], ["Frank", "__F"], ["Mark", "__M"], ["Ruble", "__RB"], ["Peso", "__PE"], ["Pound", "__P"], ["Tristan da Cunha pound", "_TP"], ["South Georgia and the South Sandwich Islands pound", "_SP"], ["Somaliland shilling", "_SS"], ["Pitcairn Islands dollar", "_PND"], ["Palauan dollar", "_PD"], ["Niue dollar", "_NID"], ["Nauruan dollar", "_ND"], ["Micronesian dollar", "_MD"], ["Kiribati dollar", "_KID"], ["Guernsey pound", "_GGP"], ["Faroese króna", "_FOK"], ["Cook Islands dollar", "_CKD"], ["British Virgin Islands dollar", "_BD"], ["Ascension pound", "_AP"], ["Alderney pound", "_ALP"], ["Abkhazian apsar", "_AA"]]); + EnglishNumericWithUnit.FractionalUnitNameToCodeMap = new Map([["Jiao", "JIAO"], ["Kopek", "KOPEK"], ["Pul", "PUL"], ["Cent", "CENT"], ["Qindarkë", "QINDARKE"], ["Penny", "PENNY"], ["Santeem", "SANTEEM"], ["Cêntimo", "CENTIMO"], ["Centavo", "CENTAVO"], ["Luma", "LUMA"], ["Qəpik", "QƏPIK"], ["Fils", "FILS"], ["Poisha", "POISHA"], ["Kapyeyka", "KAPYEYKA"], ["Centime", "CENTIME"], ["Chetrum", "CHETRUM"], ["Paisa", "PAISA"], ["Fening", "FENING"], ["Thebe", "THEBE"], ["Sen", "SEN"], ["Stotinka", "STOTINKA"], ["Fen", "FEN"], ["Céntimo", "CENTIMO"], ["Lipa", "LIPA"], ["Haléř", "HALER"], ["Øre", "ØRE"], ["Piastre", "PIASTRE"], ["Santim", "SANTIM"], ["Oyra", "OYRA"], ["Butut", "BUTUT"], ["Tetri", "TETRI"], ["Pesewa", "PESEWA"], ["Fillér", "FILLER"], ["Eyrir", "EYRIR"], ["Dinar", "DINAR"], ["Agora", "AGORA"], ["Tïın", "TIIN"], ["Chon", "CHON"], ["Jeon", "JEON"], ["Tyiyn", "TYIYN"], ["Att", "ATT"], ["Sente", "SENTE"], ["Dirham", "DIRHAM"], ["Rappen", "RAPPEN"], ["Avo", "AVO"], ["Deni", "DENI"], ["Iraimbilanja", "IRAIMBILANJA"], ["Tambala", "TAMBALA"], ["Laari", "LAARI"], ["Khoums", "KHOUMS"], ["Ban", "BAN"], ["Möngö", "MONGO"], ["Pya", "PYA"], ["Kobo", "KOBO"], ["Kuruş", "KURUS"], ["Baisa", "BAISA"], ["Centésimo", "CENTESIMO"], ["Toea", "TOEA"], ["Sentimo", "SENTIMO"], ["Grosz", "GROSZ"], ["Sene", "SENE"], ["Halala", "HALALA"], ["Para", "PARA"], ["Öre", "ORE"], ["Diram", "DIRAM"], ["Satang", "SATANG"], ["Seniti", "SENITI"], ["Millime", "MILLIME"], ["Tennesi", "TENNESI"], ["Kopiyka", "KOPIYKA"], ["Tiyin", "TIYIN"], ["Hào", "HAO"], ["Ngwee", "NGWEE"]]); + EnglishNumericWithUnit.CompoundUnitConnectorRegex = `(?and)`; + EnglishNumericWithUnit.CurrencyPrefixList = new Map([["Dollar", "$"], ["United States dollar", "united states $|us$|us $|u.s. $|u.s $"], ["East Caribbean dollar", "east caribbean $"], ["Australian dollar", "australian $|australia $"], ["Bahamian dollar", "bahamian $|bahamia $"], ["Barbadian dollar", "barbadian $|barbadin $"], ["Belize dollar", "belize $"], ["Bermudian dollar", "bermudian $"], ["British Virgin Islands dollar", "british virgin islands $|bvi$|virgin islands $|virgin island $|british virgin island $"], ["Brunei dollar", "brunei $|b$"], ["Sen", "sen"], ["Singapore dollar", "singapore $|s$"], ["Canadian dollar", "canadian $|can$|c$|c $|canada $"], ["Cayman Islands dollar", "cayman islands $|ci$|cayman island $"], ["New Zealand dollar", "new zealand $|nz$|nz $"], ["Cook Islands dollar", "cook islands $|cook island $"], ["Fijian dollar", "fijian $|fiji $"], ["Guyanese dollar", "gy$|gy $|g$|g $"], ["Hong Kong dollar", "hong kong $|hk$|hkd|hk $"], ["Jamaican dollar", "jamaican $|j$|jamaica $"], ["Kiribati dollar", "kiribati $"], ["Liberian dollar", "liberian $|liberia $"], ["Micronesian dollar", "micronesian $"], ["Namibian dollar", "namibian $|nad|n$|namibia $"], ["Nauruan dollar", "nauruan $"], ["Niue dollar", "niue $"], ["Palauan dollar", "palauan $"], ["Pitcairn Islands dollar", "pitcairn islands $|pitcairn island $"], ["Solomon Islands dollar", "solomon islands $|si$|si $|solomon island $"], ["Surinamese dollar", "surinamese $|surinam $"], ["New Taiwan dollar", "nt$|nt $"], ["Trinidad and Tobago dollar", "trinidad and tobago $|trinidad $|trinidadian $"], ["Tuvaluan dollar", "tuvaluan $"], ["Samoan tālā", "ws$"], ["Chinese yuan", "¥"], ["Japanese yen", "¥"], ["Euro", "€"], ["Pound", "£"], ["Costa Rican colón", "₡"], ["Turkish lira", "₺"]]); + EnglishNumericWithUnit.AmbiguousCurrencyUnitList = ['din.', 'kiwi', 'kina', 'kobo', 'lari', 'lipa', 'napa', 'para', 'sfr.', 'taka', 'tala', 'toea', 'vatu', 'yuan', 'ang', 'ban', 'bob', 'btn', 'byr', 'cad', 'cop', 'cup', 'dop', 'gip', 'jod', 'kgs', 'lak', 'lei', 'mga', 'mop', 'nad', 'omr', 'pul', 'sar', 'sbd', 'scr', 'sdg', 'sek', 'sen', 'sol', 'sos', 'std', 'try', 'yer', 'yen']; + EnglishNumericWithUnit.InformationSuffixList = new Map([["Bit", "-bit|bit|bits"], ["Kilobit", "kilobit|kilobits|kb|Kb|kbit"], ["Megabit", "megabit|megabits|mb|Mb|mbit"], ["Gigabit", "gigabit|gigabits|gb|Gb|gbit"], ["Terabit", "terabit|terabits|tb|Tb|tbit"], ["Petabit", "petabit|petabits|pb|Pb|pbit"], ["Byte", "-byte|byte|bytes"], ["Kilobyte", "-kilobyte|-kilobytes|kilobyte|kB|KB|kilobytes|kilo byte|kilo bytes|kbyte"], ["Megabyte", "-megabyte|-megabytes|megabyte|mB|MB|megabytes|mega byte|mega bytes|mbyte"], ["Gigabyte", "-gigabyte|-gigabytes|gigabyte|gB|GB|gigabytes|giga byte|giga bytes|gbyte"], ["Terabyte", "-terabyte|-terabytes|terabyte|tB|TB|terabytes|tera byte|tera bytes|tbyte"], ["Petabyte", "-petabyte|-petabytes|petabyte|pB|PB|petabytes|peta byte|peta bytes|pbyte"]]); + EnglishNumericWithUnit.AmbiguousDimensionUnitList = ['barrel', 'barrels', 'grain', 'pound', 'stone', 'yards', 'yard', 'cord', 'dram', 'feet', 'foot', 'gill', 'knot', 'peck', 'cup', 'fps', 'pts', 'in', 'dm', '\"']; + EnglishNumericWithUnit.BuildPrefix = `(?<=(\\s|^))`; + EnglishNumericWithUnit.BuildSuffix = `(?=(\\s|\\W|$))`; + EnglishNumericWithUnit.LengthSuffixList = new Map([["Kilometer", "km|kilometer|kilometre|kilometers|kilometres|kilo meter|kilo meters|kilo metres|kilo metre"], ["Hectometer", "hm|hectometer|hectometre|hectometers|hectometres|hecto meter|hecto meters|hecto metres|hecto metre"], ["Decameter", "dam|decameter|decametre|decameters|decametres|deca meter|deca meters|deca metres|deca metre"], ["Meter", "m|meter|metre|meters|metres"], ["Decimeter", "dm|decimeter|decimeters|decimetre|decimetres|deci meter|deci meters|deci metres|deci metre"], ["Centimeter", "cm|centimeter|centimeters|centimetre|centimetres|centi meter|centi meters|centi metres|centi metre"], ["Millimeter", "mm|millimeter|millimeters|millimetre|millimetres|milli meter|milli meters|milli metres|milli metre"], ["Micrometer", "μm|micrometer|micrometre|micrometers|micrometres|micro meter|micro meters|micro metres|micro metre"], ["Nanometer", "nm|nanometer|nanometre|nanometers|nanometres|nano meter|nano meters|nano metres|nano metre"], ["Picometer", "pm|picometer|picometre|picometers|picometres|pico meter|pico meters|pico metres|pico metre"], ["Mile", "-mile|mile|miles"], ["Yard", "yard|yards"], ["Inch", "-inch|inch|inches|in|\""], ["Foot", "-foot|foot|feet|ft"], ["Light year", "light year|light-year|light years|light-years"], ["Pt", "pt|pts"]]); + EnglishNumericWithUnit.AmbiguousLengthUnitList = ['m', 'yard', 'yards', 'pm', 'pt', 'pts']; + EnglishNumericWithUnit.SpeedSuffixList = new Map([["Meter per second", "meters / second|m/s|meters per second|metres per second|meter per second|metre per second"], ["Kilometer per hour", "km/h|kilometres per hour|kilometers per hour|kilometer per hour|kilometre per hour"], ["Kilometer per minute", "km/min|kilometers per minute|kilometres per minute|kilometer per minute|kilometre per minute"], ["Kilometer per second", "km/s|kilometers per second|kilometres per second|kilometer per second|kilometre per second"], ["Mile per hour", "mph|mile per hour|miles per hour|mi/h|mile / hour|miles / hour|miles an hour"], ["Knot", "kt|knot|kn"], ["Foot per second", "ft/s|foot/s|foot per second|feet per second|fps"], ["Foot per minute", "ft/min|foot/min|foot per minute|feet per minute"], ["Yard per minute", "yards per minute|yard per minute|yards / minute|yards/min|yard/min"], ["Yard per second", "yards per second|yard per second|yards / second|yards/s|yard/s"]]); + EnglishNumericWithUnit.TemperatureSuffixList = new Map([["F", "degrees fahrenheit|degree fahrenheit|deg fahrenheit|degs fahrenheit|fahrenheit|°f|degrees farenheit|degree farenheit|deg farenheit|degs farenheit|degrees f|degree f|deg f|degs f|farenheit|f"], ["K", "k|kelvin"], ["R", "rankine|°r"], ["D", "delisle|°de"], ["C", "degrees celsius|degree celsius|deg celsius|degs celsius|celsius|degrees celcius|degree celcius|celcius|deg celcius|degs celcius|degrees centigrade|degree centigrade|centigrade|degrees centigrate|degree centigrate|degs centigrate|deg centigrate|centigrate|degrees c|degree c|deg c|degs c|°c|c"], ["Degree", "degree|degrees|deg.|deg|°"]]); + EnglishNumericWithUnit.AmbiguousTemperatureUnitList = ['c', 'f', 'k']; + EnglishNumericWithUnit.VolumeSuffixList = new Map([["Cubic meter", "m3|cubic meter|cubic meters|cubic metre|cubic metres"], ["Cubic centimeter", "cubic centimeter|cubic centimetre|cubic centimeters|cubic centimetres"], ["Cubic millimiter", "cubic millimiter|cubic millimitre|cubic millimiters|cubic millimitres"], ["Hectoliter", "hectoliter|hectolitre|hectoliters|hectolitres"], ["Decaliter", "decaliter|decalitre|dekaliter|dekalitre|decaliters|decalitres|dekaliters|dekalitres"], ["Liter", "l|litre|liter|liters|litres"], ["Deciliter", "dl|deciliter|decilitre|deciliters|decilitres"], ["Centiliter", "cl|centiliter|centilitre|centiliters|centilitres"], ["Milliliter", "ml|mls|millilitre|milliliter|millilitres|milliliters"], ["Cubic yard", "cubic yard|cubic yards"], ["Cubic inch", "cubic inch|cubic inches"], ["Cubic foot", "cubic foot|cubic feet"], ["Cubic mile", "cubic mile|cubic miles"], ["Fluid ounce", "fl oz|fluid ounce|fluid ounces"], ["Teaspoon", "teaspoon|teaspoons"], ["Tablespoon", "tablespoon|tablespoons"], ["Pint", "pint|pints"], ["Volume unit", "fluid dram|gill|quart|minim|barrel|cord|peck|bushel|hogshead"]]); + EnglishNumericWithUnit.AmbiguousVolumeUnitList = ['l', 'ounce', 'oz', 'cup', 'peck', 'cord', 'gill']; + EnglishNumericWithUnit.WeightSuffixList = new Map([["Kilogram", "kg|kilogram|kilograms|kilo|kilos"], ["Gram", "g|gram|grams"], ["Milligram", "mg|milligram|milligrams"], ["Barrel", "barrels|barrel"], ["Gallon", "-gallon|gallons|gallon"], ["Metric ton", "metric tons|metric ton"], ["Ton", "-ton|ton|tons|tonne|tonnes"], ["Pound", "pound|pounds|lb"], ["Ounce", "-ounce|ounce|oz|ounces"], ["Weight unit", "pennyweight|grain|british long ton|US short hundredweight|stone|dram"]]); + EnglishNumericWithUnit.AmbiguousWeightUnitList = ['g', 'oz', 'stone', 'dram']; +})(EnglishNumericWithUnit = exports.EnglishNumericWithUnit || (exports.EnglishNumericWithUnit = {})); + +}); + +unwrapExports(englishNumericWithUnit); + +var base = createCommonjsModule(function (module, exports) { +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); + + + + + +class EnglishNumberWithUnitExtractorConfiguration { + constructor(ci) { + this.cultureInfo = ci; + this.unitNumExtractor = new recognizersTextNumber.EnglishNumberExtractor(); + this.buildPrefix = englishNumericWithUnit.EnglishNumericWithUnit.BuildPrefix; + this.buildSuffix = englishNumericWithUnit.EnglishNumericWithUnit.BuildSuffix; + this.connectorToken = ''; + this.compoundUnitConnectorRegex = recognizersText.RegExpUtility.getSafeRegExp(englishNumericWithUnit.EnglishNumericWithUnit.CompoundUnitConnectorRegex); + this.pmNonUnitRegex = recognizersText.RegExpUtility.getSafeRegExp(baseUnits.BaseUnits.PmNonUnitRegex); + } +} +exports.EnglishNumberWithUnitExtractorConfiguration = EnglishNumberWithUnitExtractorConfiguration; +class EnglishNumberWithUnitParserConfiguration extends parsers$4.BaseNumberWithUnitParserConfiguration { + constructor(ci) { + super(ci); + this.internalNumberExtractor = new recognizersTextNumber.EnglishNumberExtractor(recognizersTextNumber.NumberMode.Default); + this.internalNumberParser = recognizersTextNumber.AgnosticNumberParserFactory.getParser(recognizersTextNumber.AgnosticNumberParserType.Number, new recognizersTextNumber.EnglishNumberParserConfiguration()); + this.connectorToken = ''; + this.currencyNameToIsoCodeMap = englishNumericWithUnit.EnglishNumericWithUnit.CurrencyNameToIsoCodeMap; + this.currencyFractionCodeList = englishNumericWithUnit.EnglishNumericWithUnit.FractionalUnitNameToCodeMap; + } +} +exports.EnglishNumberWithUnitParserConfiguration = EnglishNumberWithUnitParserConfiguration; + +}); + +unwrapExports(base); + +var currency = createCommonjsModule(function (module, exports) { +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); + + + + +class EnglishCurrencyExtractorConfiguration extends base.EnglishNumberWithUnitExtractorConfiguration { + constructor(ci) { + if (!ci) { + ci = new recognizersTextNumber.CultureInfo(recognizersTextNumber.Culture.English); + } + super(ci); + this.extractType = constants$2.Constants.SYS_UNIT_CURRENCY; + // Reference Source: https:// en.wikipedia.org/wiki/List_of_circulating_currencies + this.suffixList = englishNumericWithUnit.EnglishNumericWithUnit.CurrencySuffixList; + this.prefixList = englishNumericWithUnit.EnglishNumericWithUnit.CurrencyPrefixList; + this.ambiguousUnitList = englishNumericWithUnit.EnglishNumericWithUnit.AmbiguousCurrencyUnitList; + } +} +exports.EnglishCurrencyExtractorConfiguration = EnglishCurrencyExtractorConfiguration; +class EnglishCurrencyParserConfiguration extends base.EnglishNumberWithUnitParserConfiguration { + constructor(ci) { + if (!ci) { + ci = new recognizersTextNumber.CultureInfo(recognizersTextNumber.Culture.English); + } + super(ci); + this.BindDictionary(englishNumericWithUnit.EnglishNumericWithUnit.CurrencySuffixList); + this.BindDictionary(englishNumericWithUnit.EnglishNumericWithUnit.CurrencyPrefixList); + } +} +exports.EnglishCurrencyParserConfiguration = EnglishCurrencyParserConfiguration; + +}); + +unwrapExports(currency); + +var temperature = createCommonjsModule(function (module, exports) { +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); + + + + +class EnglishTemperatureExtractorConfiguration extends base.EnglishNumberWithUnitExtractorConfiguration { + constructor(ci) { + if (!ci) { + ci = new recognizersTextNumber.CultureInfo(recognizersTextNumber.Culture.English); + } + super(ci); + this.extractType = constants$2.Constants.SYS_UNIT_TEMPERATURE; + this.suffixList = englishNumericWithUnit.EnglishNumericWithUnit.TemperatureSuffixList; + this.prefixList = new Map(); + this.ambiguousUnitList = englishNumericWithUnit.EnglishNumericWithUnit.AmbiguousTemperatureUnitList; + } +} +exports.EnglishTemperatureExtractorConfiguration = EnglishTemperatureExtractorConfiguration; +class EnglishTemperatureParserConfiguration extends base.EnglishNumberWithUnitParserConfiguration { + constructor(ci) { + if (!ci) { + ci = new recognizersTextNumber.CultureInfo(recognizersTextNumber.Culture.English); + } + super(ci); + this.BindDictionary(englishNumericWithUnit.EnglishNumericWithUnit.TemperatureSuffixList); + } +} +exports.EnglishTemperatureParserConfiguration = EnglishTemperatureParserConfiguration; + +}); + +unwrapExports(temperature); + +var dimension = createCommonjsModule(function (module, exports) { +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); + + + + +const dimensionSuffixList = new Map([ + ...englishNumericWithUnit.EnglishNumericWithUnit.InformationSuffixList, + ...englishNumericWithUnit.EnglishNumericWithUnit.AreaSuffixList, + ...englishNumericWithUnit.EnglishNumericWithUnit.LengthSuffixList, + ...englishNumericWithUnit.EnglishNumericWithUnit.SpeedSuffixList, + ...englishNumericWithUnit.EnglishNumericWithUnit.VolumeSuffixList, + ...englishNumericWithUnit.EnglishNumericWithUnit.WeightSuffixList +]); +class EnglishDimensionExtractorConfiguration extends base.EnglishNumberWithUnitExtractorConfiguration { + constructor(ci) { + if (!ci) { + ci = new recognizersTextNumber.CultureInfo(recognizersTextNumber.Culture.English); + } + super(ci); + this.extractType = constants$2.Constants.SYS_UNIT_DIMENSION; + this.suffixList = dimensionSuffixList; + this.prefixList = new Map(); + this.ambiguousUnitList = englishNumericWithUnit.EnglishNumericWithUnit.AmbiguousDimensionUnitList; + } +} +exports.EnglishDimensionExtractorConfiguration = EnglishDimensionExtractorConfiguration; +class EnglishDimensionParserConfiguration extends base.EnglishNumberWithUnitParserConfiguration { + constructor(ci) { + if (!ci) { + ci = new recognizersTextNumber.CultureInfo(recognizersTextNumber.Culture.English); + } + super(ci); + this.BindDictionary(dimensionSuffixList); + } +} +exports.EnglishDimensionParserConfiguration = EnglishDimensionParserConfiguration; + +}); + +unwrapExports(dimension); + +var age = createCommonjsModule(function (module, exports) { +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); + + + + +class EnglishAgeExtractorConfiguration extends base.EnglishNumberWithUnitExtractorConfiguration { + constructor(ci) { + if (!ci) { + ci = new recognizersTextNumber.CultureInfo(recognizersTextNumber.Culture.English); + } + super(ci); + this.extractType = constants$2.Constants.SYS_UNIT_AGE; + this.suffixList = englishNumericWithUnit.EnglishNumericWithUnit.AgeSuffixList; + this.prefixList = new Map(); + this.ambiguousUnitList = new Array(); + } +} +exports.EnglishAgeExtractorConfiguration = EnglishAgeExtractorConfiguration; +class EnglishAgeParserConfiguration extends base.EnglishNumberWithUnitParserConfiguration { + constructor(ci) { + if (!ci) { + ci = new recognizersTextNumber.CultureInfo(recognizersTextNumber.Culture.English); + } + super(ci); + this.BindDictionary(englishNumericWithUnit.EnglishNumericWithUnit.AgeSuffixList); + } +} +exports.EnglishAgeParserConfiguration = EnglishAgeParserConfiguration; + +}); + +unwrapExports(age); + +var spanishNumericWithUnit = createCommonjsModule(function (module, exports) { +"use strict"; +// ------------------------------------------------------------------------------ +// +// This code was generated by a tool. +// Changes to this file may cause incorrect behavior and will be lost if +// the code is regenerated. +// +// ------------------------------------------------------------------------------ +Object.defineProperty(exports, "__esModule", { value: true }); +var SpanishNumericWithUnit; +(function (SpanishNumericWithUnit) { + SpanishNumericWithUnit.AgeSuffixList = new Map([["Año", "años|año"], ["Mes", "meses|mes"], ["Semana", "semanas|semana"], ["Día", "dias|días|día|dia"]]); + SpanishNumericWithUnit.AreaSuffixList = new Map([["Kilómetro cuadrado", "kilómetro cuadrado|kilómetros cuadrados|km2|km^2|km²"], ["Hectómetro cuadrado", "hectómetro cuadrado|hectómetros cuadrados|hm2|hm^2|hm²|hectárea|hectáreas"], ["Decámetro cuadrado", "decámetro cuadrado|decámetros cuadrados|dam2|dam^2|dam²|área|áreas"], ["Metro cuadrado", "metro cuadrado|metros cuadrados|m2|m^2|m²"], ["Decímetro cuadrado", "decímetro cuadrado|decímetros cuadrados|dm2|dm^2|dm²"], ["Centímetro cuadrado", "centímetro cuadrado|centímetros cuadrados|cm2|cm^2|cm²"], ["Milímetro cuadrado", "milímetro cuadrado|milímetros cuadrados|mm2|mm^2|mm²"], ["Pulgada cuadrado", "pulgada cuadrada|pulgadas cuadradas"], ["Pie cuadrado", "pie cuadrado|pies cuadrados|pie2|pie^2|pie²|ft2|ft^2|ft²"], ["Yarda cuadrado", "yarda cuadrada|yardas cuadradas|yd2|yd^2|yd²"], ["Acre", "acre|acres"]]); + SpanishNumericWithUnit.AreaAmbiguousValues = ['área', 'áreas']; + SpanishNumericWithUnit.CurrencySuffixList = new Map([["Dólar", "dólar|dólares"], ["Peso", "peso|pesos"], ["Rublo", "rublo|rublos"], ["Libra", "libra|libras"], ["Florín", "florín|florines"], ["Dinar", "dinar|dinares"], ["Franco", "franco|francos"], ["Rupia", "rupia|rupias"], ["Escudo", "escudo|escudos"], ["Chelín", "chelín|chelines"], ["Lira", "lira|liras"], ["Centavo", "centavo|centavos"], ["Céntimo", "céntimo|céntimos"], ["Centésimo", "centésimo|centésimos"], ["Penique", "penique|peniques"], ["Euro", "euro|euros|€|eur"], ["Céntimo de Euro", "céntimo de euro|céntimos de euros"], ["Dólar del Caribe Oriental", "dólar del Caribe Oriental|dólares del Caribe Oriental|ec$|xcd"], ["Centavo del Caribe Oriental", "centavo del Caribe Oriental|centavos del Caribe Oriental"], ["Franco CFA de África Occidental", "franco CFA de África Occidental|francos CFA de África Occidental|fcfa|xof"], ["Céntimo de CFA de África Occidental", "céntimo de CFA de África Occidental|céntimos de CFA de África Occidental"], ["Franco CFA de África Central", "franco CFA de África Central|francos CFA de África Central|xaf"], ["Céntimo de CFA de África Central", "céntimo de CFA de África Central|céntimos de CFA de África Central"], ["Apsar", "apsar|apsares"], ["Afgani afgano", "afgani afgano|؋|afn|afganis|afgani"], ["Pul", "pul|puls"], ["Lek albanés", "lek|lekë|lekes|lek albanés"], ["Qindarka", "qindarka|qindarkë|qindarkas"], ["Kwanza angoleño", "kwanza angoleño|kwanzas angoleños|kwanza angoleños|kwanzas angoleño|kwanzas|aoa|kz"], ["Cêntimo angoleño", "cêntimo angoleño|cêntimo|cêntimos"], ["Florín antillano neerlandés", "florín antillano neerlandés|florínes antillano neerlandés|ƒ antillano neerlandés|ang|naƒ"], ["Cent antillano neerlandés", "cent|centen"], ["Riyal saudí", "riyal saudí|riyales saudí|sar"], ["Halalá saudí", "halalá saudí|hallalah"], ["Dinar argelino", "dinar argelino|dinares argelinos|dzd"], ["Céntimo argelino", "centimo argelino|centimos argelinos|"], ["Peso argentino", "peso argentino|pesos argentinos|peso|pesos|ar$|ars"], ["Centavo argentino", "centavo argentino|centavos argentinos|centavo|ctvo.|ctvos."], ["Dram armenio", "dram armenio|dram armenios|dram|դր."], ["Luma armenio", "luma armenio|luma armenios"], ["Florín arubeño", "florín arubeño|florines arubeños|ƒ arubeños|aƒ|awg"], ["Yotin arubeño", "yotin arubeño|yotines arubeños"], ["Dólar australiano", "dólar australiano|dólares australianos|a$|aud"], ["Centavo australiano", "centavo australiano|centavos australianos"], ["Manat azerí", "manat azerí|man|azn"], ["Qəpik azerí", "qəpik azerí|qəpik"], ["Dólar bahameño", "dólar bahameño|dólares bahameños|b$|bsd"], ["Centavo bahameño", "centavo bahameño|centavos bahameños"], ["Dinar bahreiní", "dinar bahreiní|dinares bahreinies|bhd"], ["Fil bahreiní", "fil bahreiní|fils bahreinies"], ["Taka bangladeshí", "taka bangladeshí|takas bangladeshí|bdt"], ["Poisha bangladeshí", "poisha bangladeshí|poishas bangladeshí"], ["Dólar de Barbados", "dólar de barbados|dólares de barbados|bbd"], ["Centavo de Barbados", "centavo de barbados|centavos de barbados"], ["Dólar beliceño", "dólar beliceño|dólares beliceños|bz$|bzd"], ["Centavo beliceño", "centavo beliceño|centavos beliceños"], ["Dólar bermudeño", "dólar bermudeño|dólares bermudeños|bd$|bmd"], ["Centavo bermudeño", "centavo bermudeño|centavos bermudeños"], ["Rublo bielorruso", "rublo bielorruso|rublos bielorrusos|br|byr"], ["Kópek bielorruso", "kópek bielorruso|kópeks bielorrusos|kap"], ["Kyat birmano", "kyat birmano|kyats birmanos|mmk"], ["Pya birmano", "pya birmano|pyas birmanos"], ["Boliviano", "boliviano|bolivianos|bob|bs"], ["Centésimo Boliviano", "centésimo boliviano|centésimos bolivianos"], ["Marco bosnioherzegovino", "marco convertible|marco bosnioherzegovino|marcos convertibles|marcos bosnioherzegovinos|bam"], ["Feningas bosnioherzegovino", "feninga convertible|feninga bosnioherzegovina|feningas convertibles"], ["Pula", "pula|bwp"], ["Thebe", "thebe"], ["Real brasileño", "real brasileño|reales brasileños|r$|brl"], ["Centavo brasileño", "centavo brasileño|centavos brasileños"], ["Dólar de Brunéi", "dólar de brunei|dólares de brunéi|bnd"], ["Sen de Brunéi", "sen|sen de brunéi"], ["Lev búlgaro", "lev búlgaro|leva búlgaros|lv|bgn"], ["Stotinki búlgaro", "stotinka búlgaro|stotinki búlgaros"], ["Franco de Burundi", "franco de burundi|francos de burundi|fbu|fib"], ["Céntimo Burundi", "céntimo burundi|céntimos burundies"], ["Ngultrum butanés", "ngultrum butanés|ngultrum butaneses|btn"], ["Chetrum butanés", "chetrum butanés|chetrum butaneses"], ["Escudo caboverdiano", "escudo caboverdiano|escudos caboverdianos|cve"], ["Riel camboyano", "riel camboyano|rieles camboyanos|khr"], ["Dólar canadiense", "dólar canadiense|dólares canadienses|c$|cad"], ["Centavo canadiense", "centavo canadiense|centavos canadienses"], ["Peso chileno", "peso chileno|pesos chilenos|cpl"], ["Yuan chino", "yuan chino|yuanes chinos|yuan|yuanes|renminbi|rmb|cny|¥"], ["Peso colombiano", "peso colombiano|pesos colombianos|cop|col$"], ["Centavo colombiano", "centavo colombiano|centavos colombianos"], ["Franco comorano", "franco comorano|francos comoranos|kmf|₣"], ["Franco congoleño", "franco congoleño|francos congoleños|cdf"], ["Céntimo congoleño", "céntimo congoleño|céntimos congoleños"], ["Won norcoreano", "won norcoreano|wŏn norcoreano|wŏn norcoreanos|kpw"], ["Chon norcoreano", "chon norcoreano|chŏn norcoreano|chŏn norcoreanos|chon norcoreanos"], ["Won surcoreano", "wŏn surcoreano|won surcoreano|wŏnes surcoreanos|wones surcoreanos|krw"], ["Chon surcoreano", "chon surcoreano|chŏn surcoreano|chŏn surcoreanos|chon surcoreanos"], ["Colón costarricense", "colón costarricense|colones costarricenses|crc"], ["Kuna croata", "kuna croata|kuna croatas|hrk"], ["Lipa croata", "lipa croata|lipa croatas"], ["Peso cubano", "peso cubano|pesos cubanos|cup"], ["Peso cubano convertible", "peso cubano convertible|pesos cubanos convertible|cuc"], ["Corona danesa", "corona danesa|coronas danesas|dkk"], ["Libra egipcia", "libra egipcia|libras egipcias|egp|le"], ["Piastra egipcia", "piastra egipcia|piastras egipcias"], ["Colón salvadoreño", "colón salvadoreño|colones salvadoreños|svc"], ["Dirham de los Emiratos Árabes Unidos", "dirham|dirhams|dirham de los Emiratos Árabes Unidos|aed|dhs"], ["Nakfa", "nakfa|nfk|ern"], ["Céntimo de Nakfa", "céntimo de nakfa|céntimos de nakfa"], ["Peseta", "peseta|pesetas|pts.|ptas.|esp"], ["Dólar estadounidense", "dólar estadounidense|dólares estadounidenses|usd|u$d|us$"], ["Corona estonia", "corona estonia|coronas estonias|eek"], ["Senti estonia", "senti estonia|senti estonias"], ["Birr etíope", "birr etíope|birr etíopes|br|etb"], ["Santim etíope", "santim etíope|santim etíopes"], ["Peso filipino", "peso filipino|pesos filipinos|php"], ["Marco finlandés", "marco finlandés|marcos finlandeses"], ["Dólar fiyiano", "dólar fiyiano|dólares fiyianos|fj$|fjd"], ["Centavo fiyiano", "centavo fiyiano|centavos fiyianos"], ["Dalasi", "dalasi|gmd"], ["Bututs", "butut|bututs"], ["Lari georgiano", "lari georgiano|lari georgianos|gel"], ["Tetri georgiano", "tetri georgiano|tetri georgianos"], ["Cedi", "cedi|ghs|gh₵"], ["Pesewa", "pesewa"], ["Libra gibraltareña", "libra gibraltareña|libras gibraltareñas|gip"], ["Penique gibraltareña", "penique gibraltareña|peniques gibraltareñas"], ["Quetzal guatemalteco", "quetzal guatemalteco|quetzales guatemaltecos|quetzal|quetzales|gtq"], ["Centavo guatemalteco", "centavo guatemalteco|centavos guatemaltecos"], ["Libra de Guernsey", "libra de Guernsey|libras de Guernsey|ggp"], ["Penique de Guernsey", "penique de Guernsey|peniques de Guernsey"], ["Franco guineano", "franco guineano|francos guineanos|gnf|fg"], ["Céntimo guineano", "céntimo guineano|céntimos guineanos"], ["Dólar guyanés", "dólar guyanés|dólares guyaneses|gyd|gy"], ["Gourde haitiano", "gourde haitiano|gourde haitianos|htg"], ["Céntimo haitiano", "céntimo haitiano|céntimos haitianos"], ["Lempira hondureño", "lempira hondureño|lempira hondureños|hnl"], ["Centavo hondureño", "centavo hondureño|centavos hondureño"], ["Dólar de Hong Kong", "dólar de hong kong|dólares de hong kong|hk$|hkd"], ["Forinto húngaro", "forinto húngaro|forinto húngaros|huf"], ["Rupia india", "rupia india|rupias indias|inr"], ["Paisa india", "paisa india|paise indias"], ["Rupia indonesia", "rupia indonesia|rupias indonesias|idr"], ["Sen indonesia", "sen indonesia|sen indonesias"], ["Rial iraní", "rial iraní|rial iranies|irr"], ["Dinar iraquí", "dinar iraquí|dinares iraquies|iqd"], ["Fil iraquí", "fil iraquí|fils iraquies"], ["Libra manesa", "libra manesa|libras manesas|imp"], ["Penique manes", "penique manes|peniques maneses"], ["Corona islandesa", "corona islandesa|coronas islandesas|isk|íkr"], ["Aurar islandes", "aurar islandes|aurar islandeses"], ["Dólar de las Islas Caimán", "dólar de las Islas Caimán|dólares de las Islas Caimán|ci$|kyd"], ["Dólar de las Islas Cook", "dólar de las Islas Cook|dólares de las Islas Cook"], ["Corona feroesa", "corona feroesa|coronas feroesas|fkr"], ["Libra malvinense", "libra malvinense|libras malvinenses|fk£|fkp"], ["Dólar de las Islas Salomón", "dólar de las Islas Salomón|dólares de las Islas Salomón|sbd"], ["Nuevo shéquel", "nuevo shéquel|nuevos shéquel|ils"], ["Agorot", "agorot"], ["Dólar jamaiquino", "dólar jamaiquino|dólares jamaiquinos|j$|ja$|jmd"], ["Yen", "yen|yenes|jpy"], ["Libra de Jersey", "libra de Jersey|libras de Jersey|jep"], ["Dinar jordano", "dinar jordano|dinares jordanos|jd|jod"], ["Piastra jordano", "piastra jordano|piastras jordanos"], ["Tenge kazajo", "tenge|tenge kazajo|kzt"], ["Chelín keniano", "chelín keniano|chelines kenianos|ksh|kes"], ["Som kirguís", "som kirguís|kgs"], ["Tyiyn", "tyiyn"], ["Dólar de Kiribati", "dólar de Kiribati|dólares de Kiribati"], ["Dinar kuwaití", "dinar kuwaití|dinares kuwaití"], ["Kip laosiano", "kip|kip laosiano|kip laosianos|lak"], ["Att laosiano", "att|att laosiano|att laosianos"], ["Loti", "loti|maloti|lsl"], ["Sente", "sente|lisente"], ["Libra libanesa", "libra libanesa|libras libanesas|lbp"], ["Dólar liberiano", "dólar liberiano|dólares liberianos|l$|lrd"], ["Dinar libio", "dinar libio|dinares libios|ld|lyd"], ["Dirham libio", "dirham libio|dirhams libios"], ["Litas lituana", "litas lituana|litai lituanas|ltl"], ["Pataca macaense", "pataca macaense|patacas macaenses|mop$|mop"], ["Avo macaense", "avo macaense|avos macaenses"], ["Ho macaense", "ho macaense|ho macaenses"], ["Denar macedonio", "denar macedonio|denare macedonios|den|mkd"], ["Deni macedonio", "deni macedonio|deni macedonios"], ["Ariary malgache", "ariary malgache|ariary malgaches|mga"], ["Iraimbilanja malgache", "iraimbilanja malgache|iraimbilanja malgaches"], ["Ringgit malayo", "ringgit malayo|ringgit malayos|rm|myr"], ["Sen malayo", "sen malayo|sen malayos"], ["Kwacha malauí", "kwacha malauí|mk|mwk"], ["Támbala malauí", "támbala malauí"], ["Rupia de Maldivas", "rupia de Maldivas|rupias de Maldivas|mvr"], ["Dirham marroquí", "dirham marroquí|dirhams marroquies|mad"], ["Rupia de Mauricio", "rupia de Mauricio|rupias de Mauricio|mur"], ["Uguiya", "uguiya|uguiyas|mro"], ["Jum", "jum|jums"], ["Peso mexicano", "peso mexicano|pesos mexicanos|mxn"], ["Centavo mexicano", "centavo mexicano|centavos mexicanos"], ["Leu moldavo", "leu moldavo|lei moldavos|mdl"], ["Ban moldavo", "ban moldavo|bani moldavos"], ["Tugrik mongol", "tugrik mongol|tugrik|tugrik mongoles|tug|mnt"], ["Metical mozambiqueño", "metical|metical mozambiqueño|meticales|meticales mozambiqueños|mtn|mzn"], ["Dram de Nagorno Karabaj", "dram de Nagorno Karabaj|drams de Nagorno Karabaj|"], ["Luma de Nagorno Karabaj", "luma de Nagorno Karabaj"], ["Dólar namibio", "dólar namibio|dólares namibios|n$|nad"], ["Centavo namibio", "centavo namibio|centavos namibios"], ["Rupia nepalí", "rupia nepalí|rupias nepalies|npr"], ["Paisa nepalí", "paisa nepalí|paisas nepalies"], ["Córdoba nicaragüense", "córdoba nicaragüense|córdobas nicaragüenses|c$|nio"], ["Centavo nicaragüense", "centavo nicaragüense|centavos nicaragüenses"], ["Naira", "naira|ngn"], ["Kobo", "kobo"], ["Corona noruega", "corona noruega|coronas noruegas|nok"], ["Franco CFP", "franco cfp|francos cfp|xpf"], ["Dólar neozelandés", "dólar neozelandés|dólares neozelandeses|dólar de Nueva Zelanda|dólares de Nueva Zelanda|nz$|nzd"], ["Centavo neozelandés", "centavo neozelandés|centavo de Nueva Zelanda|centavos de Nueva Zelanda|centavos neozelandeses"], ["Rial omaní", "rial omaní|riales omanies|omr"], ["Baisa omaní", "baisa omaní|baisa omanies"], ["Florín neerlandés", "florín neerlandés|florines neerlandeses|nlg"], ["Rupia pakistaní", "rupia pakistaní|rupias pakistanies|pkr"], ["Paisa pakistaní", "paisa pakistaní|paisas pakistanies"], ["Balboa panameño", "balboa panameño|balboa panameños|pab"], ["Centésimo panameño", "centésimo panameño|centésimos panameños"], ["Kina", "kina|pkg|pgk"], ["Toea", "toea"], ["Guaraní", "guaraní|guaranies|gs|pyg"], ["Sol", "sol|soles|nuevo sol|pen|s#."], ["Céntimo de sol", "céntimo de sol|céntimos de sol"], ["Złoty", "złoty|esloti|eslotis|zł|pln"], ["Groszy", "groszy"], ["Riyal qatarí", "riyal qatarí|riyal qataries|qr|qar"], ["Dirham qatarí", "dirham qatarí|dirhams qataries"], ["Libra esterlina", "libra esterlina|libras esterlinas|gbp"], ["Corona checa", "corona checa|coronas checas|kc|czk"], ["Peso dominicano", "peso dominicano|pesos dominicanos|rd$|dop"], ["Centavo dominicano", "centavo dominicano|centavos dominicanos"], ["Franco ruandés", "franco ruandés|francos ruandeses|rf|rwf"], ["Céntimo ruandés", "céntimo ruandés|céntimos ruandeses"], ["Leu rumano", "leu rumano|lei rumanos|ron"], ["Ban rumano", "ban rumano|bani rumanos"], ["Rublo ruso", "rublo ruso|rublos rusos|rub"], ["Kopek ruso", "kopek ruso|kopeks rusos"], ["Tala", "tala|tālā|ws$|sat|wst"], ["Sene", "sene"], ["Libra de Santa Helena", "libra de Santa Helena|libras de Santa Helena|shp"], ["Penique de Santa Helena", "penique de Santa Helena|peniques de Santa Helena"], ["Dobra", "dobra|db|std"], ["Dinar serbio", "dinar serbio|dinares serbios|rsd"], ["Para serbio", "para serbio|para serbios"], ["Rupia de Seychelles", "rupia de Seychelles|rupias de Seychelles|scr"], ["Centavo de Seychelles", "centavo de Seychelles|centavos de Seychelles"], ["Leone", "leone|le|sll"], ["Dólar de Singapur", "dólar de singapur|dólares de singapur|sgb"], ["Centavo de Singapur", "centavo de Singapur|centavos de Singapur"], ["Libra siria", "libra siria|libras sirias|s£|syp"], ["Piastra siria", "piastra siria|piastras sirias"], ["Chelín somalí", "chelín somalí|chelines somalies|sos"], ["Centavo somalí", "centavo somalí|centavos somalies"], ["Chelín somalilandés", "chelín somalilandés|chelines somalilandeses"], ["Centavo somalilandés", "centavo somalilandés|centavos somalilandeses"], ["Rupia de Sri Lanka", "rupia de Sri Lanka|rupias de Sri Lanka|lkr"], ["Céntimo de Sri Lanka", "céntimo de Sri Lanka|céntimos de Sri Lanka"], ["Lilangeni", "lilangeni|emalangeni|szl"], ["Rand sudafricano", "rand|rand sudafricano|zar"], ["Libra sudanesa", "libra sudanesa|libras sudanesas|sdg"], ["Piastra sudanesa", "piastra sudanesa|piastras sudanesas"], ["Libra sursudanesa", "libra sursudanesa|libras sursudanesa|ssp"], ["Piastra sursudanesa", "piastra sursudanesa|piastras sursudanesas"], ["Corona sueca", "corona sueca|coronas suecas|sek"], ["Franco suizo", "franco suizo|francos suizos|sfr|chf"], ["Rappen suizo", "rappen suizo|rappens suizos"], ["Dólar surinamés", "óolar surinamés|dólares surinameses|srd"], ["Centavo surinamés", "centavo surinamés|centavos surinamés"], ["Baht tailandés", "baht tailandés|baht tailandeses|thb"], ["Satang tailandés", "satang tailandés|satang tailandeses"], ["Nuevo dólar taiwanés", "nuevo dólar taiwanés|dólar taiwanés|dólares taiwaneses|twd"], ["Centavo taiwanés", "centavo taiwanés|centavos taiwaneses"], ["Chelín tanzano", "chelín tanzano|chelines tanzanos|tzs"], ["Centavo tanzano", "centavo tanzano|centavos tanzanos"], ["Somoni tayiko", "somoni tayiko|somoni|tjs"], ["Diram", "diram|dirams"], ["Paʻanga", "dólar tongano|dólares tonganos|paʻanga|pa'anga|top"], ["Seniti", "seniti"], ["Rublo de Transnistria", "rublo de Transnistria|rublos de Transnistria"], ["Kopek de Transnistria", "kopek de Transnistria|kopeks de Transnistria"], ["Dólar trinitense", "dólar trinitense|dólares trinitenses|ttd"], ["Centavo trinitense", "centavo trinitense|centavos trinitenses"], ["Dinar tunecino", "dinar tunecino|dinares tunecinos|tnd"], ["Millime tunecino", "millime tunecino|millimes tunecinos"], ["Lira turca", "lira turca|liras turcas|try"], ["Kuruş turca", "kuruş turca|kuruş turcas"], ["Manat turkmeno", "manat turkmeno|manat turkmenos|tmt"], ["Tennesi turkmeno", "tennesi turkmeno|tenge turkmeno"], ["Dólar tuvaluano", "dólar tuvaluano|dólares tuvaluanos"], ["Centavo tuvaluano", "centavo tuvaluano|centavos tuvaluanos"], ["Grivna", "grivna|grivnas|uah"], ["Kopiyka", "kopiyka|kópeks"], ["Chelín ugandés", "chelín ugandés|chelines ugandeses|ugx"], ["Centavo ugandés", "centavo ugandés|centavos ugandeses"], ["Peso uruguayo", "peso uruguayo|pesos uruguayos|uyu"], ["Centésimo uruguayo", "centésimo uruguayo|centésimos uruguayos"], ["Som uzbeko", "som uzbeko|som uzbekos|uzs"], ["Tiyin uzbeko", "tiyin uzbeko|tiyin uzbekos"], ["Vatu", "vatu|vuv"], ["Bolívar fuerte", "bolívar fuerte|bolívar|bolívares|vef"], ["Céntimo de bolívar", "céntimo de bolívar|céntimos de bolívar"], ["Đồng vietnamita", "Đồng vietnamita|dong vietnamita|dong vietnamitas|vnd"], ["Hào vietnamita", "Hào vietnamita|hao vietnamita|hao vietnamitas"], ["Rial yemení", "rial yemení|riales yemenies|yer"], ["Fils yemení", "fils yemení|fils yemenies"], ["Franco yibutiano", "franco yibutiano|francos yibutianos|djf"], ["Dinar yugoslavo", "dinar yugoslavo|dinares yugoslavos|yud"], ["Kwacha zambiano", "kwacha zambiano|kwacha zambianos|zmw"], ["Ngwee zambiano", "ngwee zambiano|ngwee zambianos"]]); + SpanishNumericWithUnit.CompoundUnitConnectorRegex = `(?[^.])`; + SpanishNumericWithUnit.CurrencyPrefixList = new Map([["Dólar", "$"], ["Dólar estadounidense", "us$|u$d|usd"], ["Dólar del Caribe Oriental", "ec$|xcd"], ["Dólar australiano", "a$|aud"], ["Dólar bahameño", "b$|bsd"], ["Dólar de Barbados", "bds$|bbd"], ["Dólar beliceño", "bz$|bzd"], ["Dólar bermudeño", "bd$|bmd"], ["Dólar de Brunéi", "brunéi $|bnd"], ["Dólar de Singapur", "s$|sgd"], ["Dólar canadiense", "c$|can$|cad"], ["Dólar de las Islas Caimán", "ci$|kyd"], ["Dólar neozelandés", "nz$|nzd"], ["Dólar fiyiano", "fj$|fjd"], ["Dólar guyanés", "gy$|gyd"], ["Dólar de Hong Kong", "hk$|hkd"], ["Dólar jamaiquino", "j$|ja$|jmd"], ["Dólar liberiano", "l$|lrd"], ["Dólar namibio", "n$|nad"], ["Dólar de las Islas Salomón", "si$|sbd"], ["Nuevo dólar taiwanés", "nt$|twd"], ["Real brasileño", "r$|brl"], ["Guaraní", "₲|gs.|pyg"], ["Dólar trinitense", "tt$|ttd"], ["Yuan chino", "¥|cny|rmb"], ["Yen", "¥|jpy"], ["Euro", "€|eur"], ["Florín", "ƒ"], ["Libra", "£|gbp"], ["Colón costarricense", "₡"], ["Lira turca", "₺"]]); + SpanishNumericWithUnit.AmbiguousCurrencyUnitList = ['le']; + SpanishNumericWithUnit.DimensionSuffixList = new Map([["Kilómetro", "km|kilometro|kilómetro|kilometros|kilómetros"], ["Hectómetro", "hm|hectometro|hectómetro|hectometros|hectómetros"], ["Decámetro", "decametro|decámetro|decametros|decámetros|dam"], ["Metro", "m|m.|metro|metros"], ["Decímetro", "dm|decimetro|decímetro|decimetros|decímetros"], ["Centímetro", "cm|centimetro|centímetro|centimetros|centimetros"], ["Milímetro", "mm|milimetro|milímetro|milimetros|milímetros"], ["Micrómetro", "µm|um|micrometro|micrómetro|micrometros|micrómetros|micrón|micrónes"], ["Nanómetro", "nm|nanometro|nanómetro|nanometros|nanómetros"], ["Picómetro", "pm|picometro|picómetro|picometros|picometros"], ["Milla", "mi|milla|millas"], ["Yarda", "yd|yarda|yardas"], ["Pulgada", "pulgada|pulgadas|\""], ["Pie", "pie|pies|ft"], ["Año luz", "año luz|años luz|al"], ["Metro por segundo", "metro/segundo|m/s|metro por segundo|metros por segundo|metros por segundos"], ["Kilómetro por hora", "km/h|kilómetro por hora|kilometro por hora|kilómetros por hora|kilometros por hora|kilómetro/hora|kilometro/hora|kilómetros/hora|kilometros/hora"], ["Kilómetro por minuto", "km/min|kilómetro por minuto|kilometro por minuto|kilómetros por minuto|kilometros por minuto|kilómetro/minuto|kilometro/minuto|kilómetros/minuto|kilometros/minuto"], ["Kilómetro por segundo", "km/seg|kilómetro por segundo|kilometro por segundo|kilómetros por segundo|kilometros por segundo|kilómetro/segundo|kilometro/segundo|kilómetros/segundo|kilometros/segundo"], ["Milla por hora", "mph|milla por hora|mi/h|milla/hora|millas/hora|millas por hora"], ["Nudo", "kt|nudo|nudos|kn"], ["Pie por segundo", "ft/s|pie/s|ft/seg|pie/seg|pie por segundo|pies por segundo"], ["Pie por minuto", "ft/min|pie/min|pie por minuto|pies por minuto"], ["Yarda por minuto", "yardas por minuto|yardas/minuto|yardas/min"], ["Yarda por segundo", "yardas por segundo|yardas/segundo|yardas/seg"], ["Kilómetro cuadrado", "kilómetro cuadrado|kilómetros cuadrados|km2|km^2|km²"], ["Hectómetro cuadrado", "hectómetro cuadrado|hectómetros cuadrados|hm2|hm^2|hm²|hectárea|hectáreas"], ["Decámetro cuadrado", "decámetro cuadrado|decámetros cuadrados|dam2|dam^2|dam²|área|áreas"], ["Metro cuadrado", "metro cuadrado|metros cuadrados|m2|m^2|m²"], ["Decímetro cuadrado", "decímetro cuadrado|decímetros cuadrados|dm2|dm^2|dm²"], ["Centímetro cuadrado", "centímetro cuadrado|centímetros cuadrados|cm2|cm^2|cm²"], ["Milímetro cuadrado", "milímetro cuadrado|milímetros cuadrados|mm2|mm^2|mm²"], ["Pulgada cuadrado", "pulgada cuadrada|pulgadas cuadradas"], ["Pie cuadrado", "pie cuadrado|pies cuadrados|pie2|pie^2|pie²|ft2|ft^2|ft²"], ["Yarda cuadrado", "yarda cuadrada|yardas cuadradas|yd2|yd^2|yd²"], ["Acre", "acre|acres"], ["Kilómetro cúbico", "kilómetro cúbico|kilómetros cúbico|km3|km^3|km³"], ["Hectómetro cúbico", "hectómetro cúbico|hectómetros cúbico|hm3|hm^3|hm³"], ["Decámetro cúbico", "decámetro cúbico|decámetros cúbico|dam3|dam^3|dam³"], ["Metro cúbico", "metro cúbico|metros cúbico|m3|m^3|m³"], ["Decímetro cúbico", "decímetro cúbico|decímetros cúbico|dm3|dm^3|dm³"], ["Centímetro cúbico", "centímetro cúbico|centímetros cúbico|cc|cm3|cm^3|cm³"], ["Milímetro cúbico", "milímetro cúbico|milímetros cúbico|mm3|mm^3|mm³"], ["Pulgada cúbica", "pulgada cúbics|pulgadas cúbicas"], ["Pie cúbico", "pie cúbico|pies cúbicos|pie3|pie^3|pie³|ft3|ft^3|ft³"], ["Yarda cúbica", "yarda cúbica|yardas cúbicas|yd3|yd^3|yd³"], ["Hectolitro", "hectolitro|hectolitros|hl"], ["Litro", "litro|litros|lts|l"], ["Mililitro", "mililitro|mililitros|ml"], ["Galón", "galón|galones"], ["Pinta", "pinta|pintas"], ["Barril", "barril|barriles"], ["Onza líquida", "onza líquida|onzas líquidas"], ["Tonelada métrica", "tonelada métrica|toneladas métricas"], ["Tonelada", "ton|tonelada|toneladas"], ["Kilogramo", "kg|kilogramo|kilogramos"], ["Hectogramo", "hg|hectogramo|hectogramos"], ["Decagramo", "dag|decagramo|decagramos"], ["Gramo", "g|gr|gramo|gramos"], ["Decigramo", "dg|decigramo|decigramos"], ["Centigramo", "cg|centigramo|centigramos"], ["Miligramo", "mg|miligramo|miligramos"], ["Microgramo", "µg|ug|microgramo|microgramos"], ["Nanogramo", "ng|nanogramo|nanogramos"], ["Picogramo", "pg|picogramo|picogramos"], ["Libra", "lb|libra|libras"], ["Onza", "oz|onza|onzas"], ["Grano", "grano|granos"], ["Quilate", "ct|kt|quilate|quilates"], ["bit", "bit|bits"], ["kilobit", "kilobit|kilobits|kb|kbit"], ["megabit", "megabit|megabits|Mb|Mbit"], ["gigabit", "gigabit|gigabits|Gb|Gbit"], ["terabit", "terabit|terabits|Tb|Tbit"], ["petabit", "petabit|petabits|Pb|Pbit"], ["kibibit", "kibibit|kibibits|kib|kibit"], ["mebibit", "mebibit|mebibits|Mib|Mibit"], ["gibibit", "gibibit|gibibits|Gib|Gibit"], ["tebibit", "tebibit|tebibits|Tib|Tibit"], ["pebibit", "pebibit|pebibits|Pib|Pibit"], ["byte", "byte|bytes"], ["kilobyte", "kilobyte|kilobytes|kB|kByte"], ["megabyte", "megabyte|megabytes|MB|MByte"], ["gigabyte", "gigabyte|gigabytes|GB|GByte"], ["terabyte", "terabyte|terabytes|TB|TByte"], ["petabyte", "petabyte|petabytes|PB|PByte"], ["kibibyte", "kibibyte|kibibytes|kiB|kiByte"], ["mebibyte", "mebibyte|mebibytes|MiB|MiByte"], ["gibibyte", "gibibyte|gibibytes|GiB|GiByte"], ["tebibyte", "tebibyte|tebibytes|TiB|TiByte"], ["pebibyte", "pebibyte|pebibytes|PiB|PiByte"]]); + SpanishNumericWithUnit.AmbiguousDimensionUnitList = ['al', 'mi', 'área', 'áreas', 'pie', 'pies']; + SpanishNumericWithUnit.LengthSuffixList = new Map([["Kilómetro", "km|kilometro|kilómetro|kilometros|kilómetros"], ["Hectómetro", "hm|hectometro|hectómetro|hectometros|hectómetros"], ["Decámetro", "decametro|decámetro|decametros|decámetros|dam"], ["Metro", "m|m.|metro|metros"], ["Decímetro", "dm|decimetro|decímetro|decimetros|decímetros"], ["Centímetro", "cm|centimetro|centímetro|centimetros|centimetros"], ["Milímetro", "mm|milimetro|milímetro|milimetros|milímetros"], ["Micrómetro", "µm|um|micrometro|micrómetro|micrometros|micrómetros|micrón|micrónes"], ["Nanómetro", "nm|nanometro|nanómetro|nanometros|nanómetros"], ["Picómetro", "pm|picometro|picómetro|picometros|picómetros"], ["Milla", "mi|milla|millas"], ["Yarda", "yd|yarda|yardas"], ["Pulgada", "pulgada|pulgadas|\""], ["Pie", "pie|pies|ft"], ["Año luz", "año luz|años luz|al"]]); + SpanishNumericWithUnit.AmbiguousLengthUnitList = ['mi', 'área', 'áreas']; + SpanishNumericWithUnit.BuildPrefix = `(?<=(\\s|^|\\P{L}))`; + SpanishNumericWithUnit.BuildSuffix = `(?=(\\s|\\P{L}|$))`; + SpanishNumericWithUnit.ConnectorToken = 'de'; + SpanishNumericWithUnit.SpeedSuffixList = new Map([["Metro por segundo", "metro/segundo|m/s|metro por segundo|metros por segundo|metros por segundos"], ["Kilómetro por hora", "km/h|kilómetro por hora|kilometro por hora|kilómetros por hora|kilometros por hora|kilómetro/hora|kilometro/hora|kilómetros/hora|kilometros/hora"], ["Kilómetro por minuto", "km/min|kilómetro por minuto|kilometro por minuto|kilómetros por minuto|kilometros por minuto|kilómetro/minuto|kilometro/minuto|kilómetros/minuto|kilometros/minuto"], ["Kilómetro por segundo", "km/seg|kilómetro por segundo|kilometro por segundo|kilómetros por segundo|kilometros por segundo|kilómetro/segundo|kilometro/segundo|kilómetros/segundo|kilometros/segundo"], ["Milla por hora", "mph|milla por hora|mi/h|milla/hora|millas/hora|millas por hora"], ["Nudo", "kt|nudo|nudos|kn"], ["Pie por segundo", "ft/s|pie/s|ft/seg|pie/seg|pie por segundo|pies por segundo"], ["Pie por minuto", "ft/min|pie/min|pie por minuto|pies por minuto"], ["Yarda por minuto", "yardas por minuto|yardas/minuto|yardas/min"], ["Yarda por segundo", "yardas por segundo|yardas/segundo|yardas/seg"]]); + SpanishNumericWithUnit.AmbiguousSpeedUnitList = ['nudo', 'nudos']; + SpanishNumericWithUnit.TemperatureSuffixList = new Map([["Kelvin", "k|kelvin"], ["Rankine", "r|rankine"], ["Grado Celsius", "°c|grados c|grado celsius|grados celsius|celsius|grado centígrado|grados centígrados|centígrado|centígrados"], ["Grado Fahrenheit", "°f|grados f|grado fahrenheit|grados fahrenheit|fahrenheit"], ["Grado Réaumur", "°r|°re|grados r|grado réaumur|grados réaumur|réaumur"], ["Grado Delisle", "°d|grados d|grado delisle|grados delisle|delisle"], ["Grado", "°|grados|grado"]]); + SpanishNumericWithUnit.VolumeSuffixList = new Map([["Kilómetro cúbico", "kilómetro cúbico|kilómetros cúbico|km3|km^3|km³"], ["Hectómetro cúbico", "hectómetro cúbico|hectómetros cúbico|hm3|hm^3|hm³"], ["Decámetro cúbico", "decámetro cúbico|decámetros cúbico|dam3|dam^3|dam³"], ["Metro cúbico", "metro cúbico|metros cúbico|m3|m^3|m³"], ["Decímetro cúbico", "decímetro cúbico|decímetros cúbico|dm3|dm^3|dm³"], ["Centímetro cúbico", "centímetro cúbico|centímetros cúbico|cc|cm3|cm^3|cm³"], ["Milímetro cúbico", "milímetro cúbico|milímetros cúbico|mm3|mm^3|mm³"], ["Pulgada cúbica", "pulgada cúbica|pulgadas cúbicas"], ["Pie cúbico", "pie cúbico|pies cúbicos|pie3|pie^3|pie³|ft3|ft^3|ft³"], ["Yarda cúbica", "yarda cúbica|yardas cúbicas|yd3|yd^3|yd³"], ["Hectolitro", "hectolitro|hectolitros|hl"], ["Litro", "litro|litros|lts|l"], ["Mililitro", "mililitro|mililitros|ml"], ["Galón", "galón|galones"], ["Pinta", "pinta|pintas"], ["Barril", "barril|barriles|bbl"], ["Onza líquida", "onza líquida|onzas líquidas"]]); + SpanishNumericWithUnit.WeightSuffixList = new Map([["Tonelada métrica", "tonelada métrica|toneladas métricas"], ["Tonelada", "ton|tonelada|toneladas"], ["Kilogramo", "kg|kilogramo|kilogramos"], ["Hectogramo", "hg|hectogramo|hectogramos"], ["Decagramo", "dag|decagramo|decagramos"], ["Gramo", "g|gr|gramo|gramos"], ["Decigramo", "dg|decigramo|decigramos"], ["Centigramo", "cg|centigramo|centigramos"], ["Miligramo", "mg|miligramo|miligramos"], ["Microgramo", "µg|ug|microgramo|microgramos"], ["Nanogramo", "ng|nanogramo|nanogramos"], ["Picogramo", "pg|picogramo|picogramos"], ["Libra", "lb|libra|libras"], ["Onza", "oz|onza|onzas"], ["Grano", "grano|granos|gr"], ["Quilate", "ct|kt|quilate|quilates"]]); +})(SpanishNumericWithUnit = exports.SpanishNumericWithUnit || (exports.SpanishNumericWithUnit = {})); + +}); + +unwrapExports(spanishNumericWithUnit); + +var base$2 = createCommonjsModule(function (module, exports) { +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); + + + + + +class SpanishNumberWithUnitExtractorConfiguration { + constructor(ci) { + this.cultureInfo = ci; + this.unitNumExtractor = new recognizersTextNumber.SpanishNumberExtractor(); + this.buildPrefix = spanishNumericWithUnit.SpanishNumericWithUnit.BuildPrefix; + this.buildSuffix = spanishNumericWithUnit.SpanishNumericWithUnit.BuildSuffix; + this.connectorToken = spanishNumericWithUnit.SpanishNumericWithUnit.ConnectorToken; + this.compoundUnitConnectorRegex = recognizersText.RegExpUtility.getSafeRegExp(spanishNumericWithUnit.SpanishNumericWithUnit.CompoundUnitConnectorRegex); + this.pmNonUnitRegex = recognizersText.RegExpUtility.getSafeRegExp(baseUnits.BaseUnits.PmNonUnitRegex); + } +} +exports.SpanishNumberWithUnitExtractorConfiguration = SpanishNumberWithUnitExtractorConfiguration; +class SpanishNumberWithUnitParserConfiguration extends parsers$4.BaseNumberWithUnitParserConfiguration { + constructor(ci) { + super(ci); + this.internalNumberExtractor = new recognizersTextNumber.SpanishNumberExtractor(recognizersTextNumber.NumberMode.Default); + this.internalNumberParser = recognizersTextNumber.AgnosticNumberParserFactory.getParser(recognizersTextNumber.AgnosticNumberParserType.Number, new recognizersTextNumber.SpanishNumberParserConfiguration()); + this.connectorToken = spanishNumericWithUnit.SpanishNumericWithUnit.ConnectorToken; + } +} +exports.SpanishNumberWithUnitParserConfiguration = SpanishNumberWithUnitParserConfiguration; + +}); + +unwrapExports(base$2); + +var currency$2 = createCommonjsModule(function (module, exports) { +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); + + + + +class SpanishCurrencyExtractorConfiguration extends base$2.SpanishNumberWithUnitExtractorConfiguration { + constructor(ci) { + if (!ci) { + ci = new recognizersTextNumber.CultureInfo(recognizersTextNumber.Culture.Spanish); + } + super(ci); + this.extractType = constants$2.Constants.SYS_UNIT_CURRENCY; + // Reference Source: https:// en.wikipedia.org/wiki/List_of_circulating_currencies + this.suffixList = spanishNumericWithUnit.SpanishNumericWithUnit.CurrencySuffixList; + this.prefixList = spanishNumericWithUnit.SpanishNumericWithUnit.CurrencyPrefixList; + this.ambiguousUnitList = spanishNumericWithUnit.SpanishNumericWithUnit.AmbiguousCurrencyUnitList; + } +} +exports.SpanishCurrencyExtractorConfiguration = SpanishCurrencyExtractorConfiguration; +class SpanishCurrencyParserConfiguration extends base$2.SpanishNumberWithUnitParserConfiguration { + constructor(ci) { + if (!ci) { + ci = new recognizersTextNumber.CultureInfo(recognizersTextNumber.Culture.Spanish); + } + super(ci); + this.BindDictionary(spanishNumericWithUnit.SpanishNumericWithUnit.CurrencySuffixList); + this.BindDictionary(spanishNumericWithUnit.SpanishNumericWithUnit.CurrencyPrefixList); + } +} +exports.SpanishCurrencyParserConfiguration = SpanishCurrencyParserConfiguration; + +}); + +unwrapExports(currency$2); + +var temperature$2 = createCommonjsModule(function (module, exports) { +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); + + + + +class SpanishTemperatureExtractorConfiguration extends base$2.SpanishNumberWithUnitExtractorConfiguration { + constructor(ci) { + if (!ci) { + ci = new recognizersTextNumber.CultureInfo(recognizersTextNumber.Culture.Spanish); + } + super(ci); + this.extractType = constants$2.Constants.SYS_UNIT_TEMPERATURE; + this.suffixList = spanishNumericWithUnit.SpanishNumericWithUnit.TemperatureSuffixList; + this.prefixList = new Map(); + this.ambiguousUnitList = new Array(); + } +} +exports.SpanishTemperatureExtractorConfiguration = SpanishTemperatureExtractorConfiguration; +class SpanishTemperatureParserConfiguration extends base$2.SpanishNumberWithUnitParserConfiguration { + constructor(ci) { + if (!ci) { + ci = new recognizersTextNumber.CultureInfo(recognizersTextNumber.Culture.Spanish); + } + super(ci); + this.BindDictionary(spanishNumericWithUnit.SpanishNumericWithUnit.TemperatureSuffixList); + } +} +exports.SpanishTemperatureParserConfiguration = SpanishTemperatureParserConfiguration; + +}); + +unwrapExports(temperature$2); + +var dimension$2 = createCommonjsModule(function (module, exports) { +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); + + + + +class SpanishDimensionExtractorConfiguration extends base$2.SpanishNumberWithUnitExtractorConfiguration { + constructor(ci) { + if (!ci) { + ci = new recognizersTextNumber.CultureInfo(recognizersTextNumber.Culture.Spanish); + } + super(ci); + this.extractType = constants$2.Constants.SYS_UNIT_DIMENSION; + this.suffixList = spanishNumericWithUnit.SpanishNumericWithUnit.DimensionSuffixList; + this.prefixList = new Map(); + this.ambiguousUnitList = spanishNumericWithUnit.SpanishNumericWithUnit.AmbiguousDimensionUnitList; + } +} +exports.SpanishDimensionExtractorConfiguration = SpanishDimensionExtractorConfiguration; +class SpanishDimensionParserConfiguration extends base$2.SpanishNumberWithUnitParserConfiguration { + constructor(ci) { + if (!ci) { + ci = new recognizersTextNumber.CultureInfo(recognizersTextNumber.Culture.Spanish); + } + super(ci); + this.BindDictionary(spanishNumericWithUnit.SpanishNumericWithUnit.DimensionSuffixList); + } +} +exports.SpanishDimensionParserConfiguration = SpanishDimensionParserConfiguration; + +}); + +unwrapExports(dimension$2); + +var age$2 = createCommonjsModule(function (module, exports) { +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); + + + + +class SpanishAgeExtractorConfiguration extends base$2.SpanishNumberWithUnitExtractorConfiguration { + constructor(ci) { + if (!ci) { + ci = new recognizersTextNumber.CultureInfo(recognizersTextNumber.Culture.Spanish); + } + super(ci); + this.extractType = constants$2.Constants.SYS_UNIT_AGE; + this.suffixList = spanishNumericWithUnit.SpanishNumericWithUnit.AgeSuffixList; + this.prefixList = new Map(); + this.ambiguousUnitList = new Array(); + } +} +exports.SpanishAgeExtractorConfiguration = SpanishAgeExtractorConfiguration; +class SpanishAgeParserConfiguration extends base$2.SpanishNumberWithUnitParserConfiguration { + constructor(ci) { + if (!ci) { + ci = new recognizersTextNumber.CultureInfo(recognizersTextNumber.Culture.Spanish); + } + super(ci); + this.BindDictionary(spanishNumericWithUnit.SpanishNumericWithUnit.AgeSuffixList); + } +} +exports.SpanishAgeParserConfiguration = SpanishAgeParserConfiguration; + +}); + +unwrapExports(age$2); + +var portugueseNumericWithUnit = createCommonjsModule(function (module, exports) { +"use strict"; +// ------------------------------------------------------------------------------ +// +// This code was generated by a tool. +// Changes to this file may cause incorrect behavior and will be lost if +// the code is regenerated. +// +// ------------------------------------------------------------------------------ +Object.defineProperty(exports, "__esModule", { value: true }); +var PortugueseNumericWithUnit; +(function (PortugueseNumericWithUnit) { + PortugueseNumericWithUnit.AgeSuffixList = new Map([["Ano", "anos|ano"], ["Mês", "meses|mes|mês"], ["Semana", "semanas|semana"], ["Dia", "dias|dia"]]); + PortugueseNumericWithUnit.AreaSuffixList = new Map([["Quilômetro quadrado", "quilômetro quadrado|quilómetro quadrado|quilometro quadrado|quilômetros quadrados|quilómetros quadrados|quilomeros quadrados|km2|km^2|km²"], ["Hectare", "hectômetro quadrado|hectómetro quadrado|hectômetros quadrados|hectómetros cuadrados|hm2|hm^2|hm²|hectare|hectares"], ["Decâmetro quadrado", "decâmetro quadrado|decametro quadrado|decâmetros quadrados|decametro quadrado|dam2|dam^2|dam²|are|ares"], ["Metro quadrado", "metro quadrado|metros quadrados|m2|m^2|m²"], ["Decímetro quadrado", "decímetro quadrado|decimentro quadrado|decímetros quadrados|decimentros quadrados|dm2|dm^2|dm²"], ["Centímetro quadrado", "centímetro quadrado|centimetro quadrado|centímetros quadrados|centrimetros quadrados|cm2|cm^2|cm²"], ["Milímetro quadrado", "milímetro quadrado|milimetro quadrado|milímetros quadrados|militmetros quadrados|mm2|mm^2|mm²"], ["Polegada quadrada", "polegada quadrada|polegadas quadradas|in2|in^2|in²"], ["Pé quadrado", "pé quadrado|pe quadrado|pés quadrados|pes quadrados|pé2|pé^2|pé²|sqft|sq ft|ft2|ft^2|ft²"], ["Jarda quadrada", "jarda quadrada|jardas quadradas|yd2|yd^2|yd²"], ["Milha quadrada", "milha quadrada|milhas quadradas|mi2|mi^2|mi²"], ["Acre", "acre|acres"]]); + PortugueseNumericWithUnit.CurrencySuffixList = new Map([["Dólar", "dólar|dolar|dólares|dolares"], ["Peso", "peso|pesos"], ["Coroa", "coroa|coroas"], ["Rublo", "rublo|rublos"], ["Libra", "libra|libras"], ["Florim", "florim|florins|ƒ"], ["Dinar", "dinar|dinares"], ["Franco", "franco|francos"], ["Rupia", "rúpia|rupia|rúpias|rupias"], ["Escudo", "escudo|escudos"], ["Xelim", "xelim|xelins|xelims"], ["Lira", "lira|liras"], ["Centavo", "centavo|cêntimo|centimo|centavos|cêntimos|centimo"], ["Centésimo", "centésimo|centésimos"], ["Pêni", "pêni|péni|peni|penies|pennies"], ["Manat", "manat|manate|mánate|man|manats|manates|mánates"], ["Euro", "euro|euros|€|eur"], ["Centavo de Euro", "centavo de euro|cêntimo de euro|centimo de euro|centavos de euro|cêntimos de euro|centimos de euro"], ["Dólar do Caribe Oriental", "dólar do Caribe Oriental|dolar do Caribe Oriental|dólares do Caribe Oriental|dolares do Caribe Oriental|dólar das Caraíbas Orientais|dolar das Caraibas Orientais|dólares das Caraíbas Orientais|dolares das Caraibas Orientais|ec$|xcd"], ["Centavo do Caribe Oriental", "centavo do Caribe Oriental|centavo das Caraíbas Orientais|cêntimo do Caribe Oriental|cêntimo das Caraíbas Orientais|centavos do Caribe Oriental|centavos das Caraíbas Orientais|cêntimos do Caribe Oriental|cêntimos das Caraíbas Orientais"], ["Franco CFA da África Ocidental", "franco CFA da África Ocidental|franco CFA da Africa Ocidental|francos CFA da África Occidental|francos CFA da Africa Occidental|franco CFA Ocidental|xof"], ["Centavo de CFA da África Ocidental", "centavo de CFA da Africa Occidental|centavos de CFA da África Ocidental|cêntimo de CFA da Africa Occidental|cêntimos de CFA da África Ocidental"], ["Franco CFA da África Central", "franco CFA da África Central|franco CFA da Africa Central|francos CFA da África Central|francos CFA da Africa Central|franco CFA central|xaf"], ["Centavo de CFA da África Central", "centavo de CFA de África Central|centavos de CFA da África Central|cêntimo de CFA de África Central|cêntimos de CFA da África Central"], ["Apsar abcásio", "apsar abcásio|apsar abecásio|apsar abcasio|apsar|apsares"], ["Afegani afegão", "afegani afegão|afegane afegão|؋|afn|afegane|afgane|afegâni|afeganis|afeganes|afganes|afegânis"], ["Pul", "pul|pules|puls"], ["Lek albanês", "lek|lekë|lekes|lek albanês|leque|leques|all"], ["Qindarke", "qindarka|qindarkë|qindarke|qindarkas"], ["Kwanza angolano", "kwanza angolano|kwanzas angolanos|kwanza|kwanzas|aoa|kz"], ["Cêntimo angolano", "cêntimo angolano|cêntimo|cêntimos"], ["Florim das Antilhas Holandesas", "florim das antilhas holandesas|florim das antilhas neerlandesas|ang"], ["Rial saudita", "rial saudita|riais sauditas|riyal saudita|riyals sauditas|riyal|riyals|sar"], ["Halala saudita", "halala saudita|halala|hallalah"], ["Dinar argelino", "dinar argelino|dinares argelinos|dzd"], ["Cêntimo argelino", "centimo argelino|centimos argelinos|cêntimo argelino|cêntimos argelinos|centavo argelino|centavos argelinos"], ["Peso argentino", "peso argentino|pesos argentinos|peso|pesos|ar$|ars"], ["Centavo argentino", "centavo argentino|centavos argentinos|centavo|ctvo.|ctvos."], ["Dram armênio", "dram armênio|dram armênios|dram arménio|dram arménios|dram armenio|dram armenios|dram|drame|drames|դր."], ["Luma armênio", "luma armênio|lumas armênios|luma arménio|lumas arménios|luma armenio|lumas armenios|luma|lumas"], ["Florim arubano", "florín arubeño|florines arubeños|ƒ arubeños|aƒ|awg"], ["Dólar australiano", "dólar australiano|dólares australianos|dolar australiano|dolares australianos|a$|aud"], ["Centavo australiano", "centavo australiano|centavos australianos"], ["Manat azeri", "manat azeri|manats azeris|azn|manat azerbaijanês|manat azerbaijano|manats azerbaijaneses|manats azerbaijanos"], ["Qəpik azeri", "qəpik azeri|qəpik|qəpiks"], ["Dólar bahamense", "dólar bahamense|dólares bahamense|dolar bahamense|dolares bahamense|dólar baamiano|dólares baamiano|dolar baamiano|dolares baamiano|b$|bsd"], ["Centavo bahamense", "centavo bahamense|centavos bahamense"], ["Dinar bareinita", "dinar bareinita|dinar baremita|dinares bareinitas|dinares baremitas|bhd"], ["Fil bareinita", "fil bareinita|fil baremita|fils bareinitas|fils baremitas"], ["Taka bengali", "taka bengali|takas bengalis|taca|tacas|taka|takas|bdt"], ["Poisha bengali", "poisha bengali|poishas bengalis"], ["Dólar de Barbados", "dólar de barbados|dólares de barbados|dolar de barbados|dolares de barbados|dólar dos barbados|dólares dos barbados|bbd"], ["Centavo de Barbados", "centavo de barbados|centavos de barbados|centavo dos barbados|centavos dos barbados"], ["Dólar de Belize", "dólar de belize|dólares de belize|dolar de belize|dolares de belize|dólar do belize|dólares do belize|dolar do belize|dolares do belize|bz$|bzd"], ["Centavo de Belize", "centavo de belize|centavos de belize|cêntimo do belize|cêntimos do belize"], ["Dólar bermudense", "dólar bermudense|dólares bermudenses|bd$|bmd"], ["Centavo bermudense", "centavo bermudense|centavos bermudenses|cêntimo bermudense| cêntimos bermudenses"], ["Rublo bielorrusso", "rublo bielorrusso|rublos bielorrussos|br|byr"], ["Copeque bielorusso", "copeque bielorrusso|copeques bielorrussos|kopek bielorrusso|kopeks bielorrussos|kap"], ["Quiate mianmarense", "quiate mianmarense|quiates mianmarenses|kyat mianmarense|kyates mianmarenses|quiate myanmarense|quiates myanmarenses|kyat myanmarense|kyates myanmarenses|quiate birmanês|quite birmanes|quiates birmaneses|kyat birmanês|kyat birmanes|kyates birmaneses|mmk"], ["Pya mianmarense", "pya mianmarense|pyas mianmarenses|pya myanmarense|pyas myanmarenses|pya birmanês|pya birmanes|pyas birmaneses"], ["Boliviano", "boliviano|bolivianos|bob|bs"], ["Centavo Boliviano", "centavo boliviano|centavos bolivianos"], ["Marco da Bósnia e Herzegovina", "marco conversível|marco conversivel|marco convertível|marco convertivel|marcos conversíveis|marcos conversiveis|marcos convertíveis|marcos convertivies|bam"], ["Fening da Bósnia e Herzegovina", "fening conversível|fening conversivel|fening convertível|fening convertivel|fenings conversíveis|fenings conversiveis|fenings convertíveis|fenings convertiveis"], ["Pula", "pula|pulas|bwp"], ["Thebe", "thebe|thebes"], ["Real brasileiro", "real brasileiro|real do brasil|real|reais brasileiros|reais do brasil|reais|r$|brl"], ["Centavo brasileiro", "centavo de real|centavo brasileiro|centavos de real|centavos brasileiros"], ["Dólar de Brunei", "dólar de brunei|dolar de brunei|dólar do brunei|dolar do brunei|dólares de brunéi|dolares de brunei|dólares do brunei|dolares do brunei|bnd"], ["Sen de Brunei", "sen de brunei|sen do brunei|sens de brunei|sens do brunei"], ["Lev búlgaro", "lev búlgaro|leve búlgaro|leves búlgaros|lev bulgaro|leve bulgaro|leves bulgaros|lv|bgn"], ["Stotinka búlgaro", "stotinka búlgaro|stotinki búlgaros|stotinka bulgaro|stotinki bulgaros"], ["Franco do Burundi", "franco do burundi|francos do burundi|fbu|fib"], ["Centavo Burundi", "centavo burundi|cêntimo burundi|centimo burundi|centavos burundi|cêntimo burundi|centimo burundi"], ["Ngultrum butanês", "ngultrum butanês|ngultrum butanes|ngúltrume butanês|ngultrume butanes|ngultrum butaneses|ngúltrumes butaneses|ngultrumes butaneses|btn"], ["Chetrum butanês", "chetrum butanês|chetrum butanes|chetrum butaneses"], ["Escudo cabo-verdiano", "escudo cabo-verdiano|escudos cabo-verdianos|cve"], ["Riel cambojano", "riel cambojano|riéis cambojanos|rieis cambojanos|khr"], ["Dólar canadense", "dólar canadense|dolar canadense|dólares canadenses|dolares canadenses|c$|cad"], ["Centavo canadense", "centavo canadense|centavos canadenses"], ["Peso chileno", "peso chileno|pesos chilenos|cpl"], ["Yuan chinês", "yuan chinês|yuan chines|yuans chineses|yuan|yuans|renminbi|rmb|cny|¥"], ["Peso colombiano", "peso colombiano|pesos colombianos|cop|col$"], ["Centavo colombiano", "centavo colombiano|centavos colombianos"], ["Franco comorense", "franco comorense|francos comorenses|kmf|₣"], ["Franco congolês", "franco congolês|franco congoles|francos congoleses|cdf"], ["Centavo congolês", "centavo congolês|centavo congoles|centavos congoleses|cêntimo congolês|centimo congoles|cêntimos congoleses|cêntimos congoleses"], ["Won norte-coreano", "won norte-coreano|wŏn norte-coreano|won norte-coreanos|wŏn norte-coreanos|kpw"], ["Chon norte-coreano", "chon norte-coreano|chŏn norte-coreano|chŏn norte-coreanos|chon norte-coreanos"], ["Won sul-coreano", "wŏn sul-coreano|won sul-coreano|wŏnes sul-coreanos|wones sul-coreanos|krw"], ["Jeon sul-coreano", "jeons sul-coreano|jeons sul-coreanos"], ["Colón costarriquenho", "colón costarriquenho|colon costarriquenho|colons costarriquenho|colones costarriquenhos|crc"], ["Kuna croata", "kuna croata|kunas croatas|hrk"], ["Lipa croata", "lipa croata|lipas croatas"], ["Peso cubano", "peso cubano|pesos cubanos|cup"], ["Peso cubano convertível", "peso cubano conversível|pesos cubanos conversíveis|peso cubano conversivel|pesos cubanos conversiveis|peso cubano convertível|pesos cubanos convertíveis|peso cubano convertivel|pesos cubanos convertiveis|cuc"], ["Coroa dinamarquesa", "coroa dinamarquesa|coroas dinamarquesas|dkk"], ["Libra egípcia", "libra egípcia|libra egipcia|libras egípcias|libras egipcias|egp|le"], ["Piastra egípcia", "piastra egípcia|piastra egipcia|pisastras egípcias|piastras egipcias"], ["Dirham dos Emirados Árabes Unidos", "dirham|dirhams|dirham dos emirados arabes unidos|aed|dhs"], ["Nakfa", "nakfa|nfk|ern"], ["Centavo de Nakfa", "cêntimo de nakfa|cêntimos de nakfa|centavo de nafka|centavos de nafka"], ["Peseta", "peseta|pesetas|pts.|ptas.|esp"], ["Dólar estadunidense", "dólar dos estados unidos|dolar dos estados unidos|dólar estadunidense|dólar americano|dólares dos estados unidos|dolares dos estados unidos|dólares estadunidenses|dólares americanos|dolar estadunidense|dolar americano|dolares estadunidenses|dolares americanos|usd|u$d|us$"], ["Coroa estoniana", "coroa estoniana|coroas estonianas|eek"], ["Senti estoniano", "senti estoniano|senti estonianos"], ["Birr etíope", "birr etíope|birr etiope|birr etíopes|birr etiopes|br|etb"], ["Santim etíope", "santim etíope|santim etiope|santim etíopes|santim etiopes"], ["Peso filipino", "peso filipino|pesos filipinos|php"], ["Marco finlandês", "marco finlandês|marco finlandes|marcos finlandeses"], ["Dólar fijiano", "dólar fijiano|dolar fijiano|dólares fijianos|dolares fijianos|fj$|fjd"], ["Centavo fijiano", "centavo fijiano|centavos fijianos"], ["Dalasi gambiano", "dalasi|gmd"], ["Bututs", "butut|bututs"], ["Lari georgiano", "lari georgiano|lari georgianos|gel"], ["Tetri georgiano", "tetri georgiano|tetri georgianos"], ["Cedi", "cedi|ghs|gh₵"], ["Pesewa", "pesewa"], ["Libra de Gibraltar", "libra de gibraltar|libras de gibraltar|gip"], ["Peni de Gibraltar", "peni de gibraltar|penies de gibraltar"], ["Quetzal guatemalteco", "quetzal guatemalteco|quetzales guatemaltecos|quetzal|quetzales|gtq"], ["Centavo guatemalteco", "centavo guatemalteco|centavos guatemaltecos"], ["Libra de Guernsey", "libra de Guernsey|libras de Guernsey|ggp"], ["Peni de Guernsey", "peni de Guernsey|penies de Guernsey"], ["Franco da Guiné", "franco da guiné|franco da guine| franco guineense|francos da guiné|francos da guine|francos guineense|gnf|fg"], ["Centavo da Guiné", "cêntimo guineense|centimo guineense|centavo guineense|cêntimos guineenses|centimos guineenses|centavos guineenses"], ["Dólar guianense", "dólar guianense|dólares guianense|dolar guianense|dolares guianense|gyd|gy"], ["Gurde haitiano", "gurde haitiano|gourde|gurdes haitianos|htg"], ["Centavo haitiano", "cêntimo haitiano|cêntimos haitianos|centavo haitiano|centavos haitianos"], ["Lempira hondurenha", "lempira hondurenha|lempiras hondurenhas|lempira|lempiras|hnl"], ["Centavo hondurenho", "centavo hondurenho|centavos hondurehos|cêntimo hondurenho|cêntimos hondurenhos"], ["Dólar de Hong Kong", "dólar de hong kong|dolar de hong kong|dólares de hong kong|dolares de hong kong|hk$|hkd"], ["Florim húngaro", "florim húngaro|florim hungaro|florins húngaros|florins hungaros|forinte|forintes|huf"], ["Filér húngaro", "fillér|filér|filler|filer"], ["Rupia indiana", "rúpia indiana|rupia indiana|rupias indianas|inr"], ["Paisa indiana", "paisa indiana|paisas indianas"], ["Rupia indonésia", "rupia indonesia|rupia indonésia|rupias indonesias|rupias indonésias|idr"], ["Sen indonésio", "send indonésio|sen indonesio|sen indonésios|sen indonesios"], ["Rial iraniano", "rial iraniano|riais iranianos|irr"], ["Dinar iraquiano", "dinar iraquiano|dinares iraquianos|iqd"], ["Fil iraquiano", "fil iraquiano|fils iraquianos|files iraquianos"], ["Libra manesa", "libra manesa|libras manesas|imp"], ["Peni manês", "peni manes|peni manês|penies maneses"], ["Coroa islandesa", "coroa islandesa|coroas islandesas|isk|íkr"], ["Aurar islandês", "aurar islandês|aurar islandes|aurar islandeses|eyrir"], ["Dólar das Ilhas Cayman", "dólar das ilhas cayman|dolar das ilhas cayman|dólar das ilhas caimão|dólares das ilhas cayman|dolares das ilhas cayman|dólares das ilhas caimão|ci$|kyd"], ["Dólar das Ilhas Cook", "dólar das ilhas cook|dolar das ilhas cook|dólares das ilhas cook|dolares das ilhas cook"], ["Coroa feroesa", "coroa feroesa|coroas feroesas|fkr"], ["Libra das Malvinas", "libra das malvinas|libras das malvinas|fk£|fkp"], ["Dólar das Ilhas Salomão", "dólar das ilhas salomão|dolar das ilhas salomao|dólares das ilhas salomão|dolares das ilhas salomao|sbd"], ["Novo shekel israelense", "novo shekel|novos shekeles|novo shequel|novo siclo|novo xéquel|shekeles novos|novos sheqalim|sheqalim novos|ils"], ["Agora", "agora|agorot"], ["Dólar jamaicano", "dólar jamaicano|dolar jamaicano|dólares jamaicanos|dolares jamaicanos|j$|ja$|jmd"], ["Yen", "yen|iene|yenes|ienes|jpy"], ["Libra de Jersey", "libra de Jersey|libras de Jersey|jep"], ["Dinar jordaniano", "dinar jordaniano|dinar jordano|dinares jordanianos|dinares jordanos|jd|jod"], ["Piastra jordaniana", "piastra jordaniana|piastra jordano|piastras jordanianas|piastra jordaniano|piastras jordanianos|piastras jordanos"], ["Tengue cazaque", "tenge|tengue|tengué|tengue cazaque|kzt"], ["Tiyin", "tiyin|tiyins"], ["Xelim queniano", "xelim queniano|xelins quenianos|ksh|kes"], ["Som quirguiz", "som quirguiz|som quirguizes|soms quirguizes|kgs"], ["Tyiyn", "tyiyn|tyiyns"], ["Dólar de Kiribati", "dólar de kiribati|dolar de kiribati|dólares de kiribati|dolares de kiribati"], ["Dinar kuwaitiano", "dinar kuwaitiano|dinar cuaitiano|dinares kuwaitiano|dinares cuaitianos|kwd"], ["Quipe laosiano", "quipe|quipes|kipe|kipes|kip|kip laosiano|kip laociano|kips laosianos|kips laocianos|lak"], ["Att laosiano", "at|att|att laosiano|att laosianos"], ["Loti do Lesoto", "loti|lóti|maloti|lotis|lótis|lsl"], ["Sente", "sente|lisente"], ["Libra libanesa", "libra libanesa|libras libanesas|lbp"], ["Dólar liberiano", "dólar liberiano|dolar liberiano|dólares liberianos|dolares liberianos|l$|lrd"], ["Dinar libio", "dinar libio|dinar líbio|dinares libios|dinares líbios|ld|lyd"], ["Dirham libio", "dirham libio|dirhams libios|dirham líbio|dirhams líbios"], ["Litas lituana", "litas lituana|litai lituanas|ltl"], ["Pataca macaense", "pataca macaense|patacas macaenses|mop$|mop"], ["Avo macaense", "avo macaense|avos macaenses"], ["Ho macaense", "ho macaense|ho macaenses"], ["Dinar macedônio", "denar macedonio|denare macedonios|denar macedônio|denar macedónio|denare macedônio|denare macedónio|dinar macedonio|dinar macedônio|dinar macedónio|dinares macedonios|dinares macedônios|dinares macedónios|den|mkd"], ["Deni macedônio", "deni macedonio|deni macedônio|deni macedónio|denis macedonios|denis macedônios|denis macedónios"], ["Ariary malgaxe", "ariai malgaxe|ariary malgaxe|ariary malgaxes|ariaris|mga"], ["Iraimbilanja", "iraimbilanja|iraimbilanjas"], ["Ringuite malaio", "ringgit malaio|ringgit malaios|ringgits malaios|ringuite malaio|ringuites malaios|rm|myr"], ["Sen malaio", "sen malaio|sen malaios|centavo malaio|centavos malaios|cêntimo malaio|cêntimos malaios"], ["Kwacha do Malawi", "kwacha|cuacha|quacha|mk|mwk"], ["Tambala", "tambala|tambalas|tambala malawi"], ["Rupia maldiva", "rupia maldiva|rupias maldivas|rupia das maldivas| rupias das maldivas|mvr"], ["Dirame marroquino", "dirame marroquino|dirham marroquinho|dirhams marroquinos|dirames marroquinos|mad"], ["Rupia maurícia", "rupia maurícia|rupia de Maurício|rupia mauricia|rupia de mauricio|rupias de mauricio|rupias de maurício|rupias mauricias|rupias maurícias|mur"], ["Uguia", "uguia|uguias|oguia|ouguiya|oguias|mro"], ["Kume", "kumes|kume|khoums"], ["Peso mexicano", "peso mexicano|pesos mexicanos|mxn"], ["Centavo mexicano", "centavo mexicano|centavos mexicanos"], ["Leu moldávio", "leu moldavo|lei moldavos|leu moldávio|leu moldavio|lei moldávios|lei moldavios|leus moldavos|leus moldavios|leus moldávios|mdl"], ["Ban moldávio", "ban moldavo|bani moldavos"], ["Tugrik mongol", "tugrik mongol|tugrik|tugriks mongóis|tugriks mongois|tug|mnt"], ["Metical moçambicao", "metical|metical moçambicano|metical mocambicano|meticais|meticais moçambicanos|meticais mocambicanos|mtn|mzn"], ["Dólar namibiano", "dólar namibiano|dólares namibianos|dolar namibio|dolares namibios|n$|nad"], ["Centavo namibiano", "centavo namibiano|centavos namibianos|centavo namibio|centavos namibianos"], ["Rupia nepalesa", "rupia nepalesa|rupias nepalesas|npr"], ["Paisa nepalesa", "paisa nepalesa|paisas nepalesas"], ["Córdova nicaraguense", "córdova nicaraguense|cordova nicaraguense|cordova nicaraguana|córdoba nicaragüense|córdobas nicaragüenses|cordobas nicaraguenses|córdovas nicaraguenses|cordovas nicaraguenses|córdovas nicaraguanasc$|nio"], ["Centavo nicaraguense", "centavo nicaragüense|centavos nicaraguenses|centavo nicaraguano|centavos nicaraguenses|centavo nicaraguano|centavos nicaraguanos"], ["Naira", "naira|ngn"], ["Kobo", "kobo"], ["Coroa norueguesa", "coroa norueguesa|coroas norueguesas|nok"], ["Franco CFP", "franco cfp|francos cfp|xpf"], ["Dólar neozelandês", "dólar neozelandês|dolar neozelandes|dólares neozelandeses|dolares neozelandeses|dólar da nova zelândia|dolar da nova zelandia|dólares da nova zelândia|dolares da nova zelandia|nz$|nzd"], ["Centavo neozelandês", "centavo neozelandês|centavo neozelandes|centavo da nova zelandia|centavo da nova zelândia|centavos da nova zelandia|centavos neozelandeses|centavos da nova zelândia"], ["Rial omanense", "rial omani|riais omanis|rial omanense|riais omanenses|omr"], ["Baisa omanense", "baisa omani|baisas omanis|baisa omanense|baisas omanenses"], ["Florim holandês", "florim holandês|florim holandes|florins holandeses|nlg"], ["Rupia paquistanesa", "rupia paquistanesa|rupias paquistanesas|pkr"], ["Paisa paquistanesa", "paisa paquistanesa|paisas paquistanesasas"], ["Balboa panamenho", "balboa panamenho|balboas panamenhos|balboa|pab|balboa panamense|balboas panamenses"], ["Centavo panamenho", "centavo panamenho|cêntimo panamenho|centavos panamenhos|cêntimos panamenhos|cêntimo panamense|cêntimos panamenses"], ["Kina", "kina|kina papuásia|kinas|kinas papuásias|pkg|pgk"], ["Toea", "toea"], ["Guarani", "guarani|guaranis|gs|pyg"], ["Novo Sol", "novo sol peruano|novos sóis peruanos|sol|soles|sóis|nuevo sol|pen|s#."], ["Centavo de sol", "cêntimo de sol|cêntimos de sol|centavo de sol|centavos de sol"], ["Złoty", "złoty|złotys|zloty|zlotys|zloti|zlotis|zlóti|zlótis|zlote|zł|pln"], ["Groszy", "groszy|grosz"], ["Rial catariano", "rial qatari|riais qataris|rial catarense|riais catarenses|rial catariano|riais catarianos|qr|qar"], ["Dirame catariano", "dirame catariano|dirames catarianos|dirame qatari|dirames qataris|dirame catarense|dirames catarenses|dirham qatari|dirhams qataris|dirham catarense|dirhams catarenses|dirham catariano|dirhams catariano"], ["Libra esterlina", "libra esterlina|libras esterlinas|gbp"], ["Coroa checa", "coroa checa|coroas checas|kc|czk"], ["Peso dominicano", "peso dominicano|pesos dominicanos|rd$|dop"], ["Centavo dominicano", "centavo dominicano|centavos dominicanos"], ["Franco ruandês", "franco ruandês|franco ruandes|francos ruandeses|rf|rwf"], ["Céntimo ruandês", "cêntimo ruandês|centimo ruandes|centavo ruandês|centavo ruandes|cêntimos ruandeses|centimos ruandeses|centavos ruandeses"], ["Leu romeno", "leu romeno|lei romenos|leus romenos|ron"], ["Ban romeno", "ban romeno|bani romeno|bans romenos"], ["Rublo russo", "rublo russo|rublos russos|rub|р."], ["Copeque ruso", "copeque russo|copeques russos|kopek ruso|kopeks rusos|copeque|copeques|kopek|kopeks"], ["Tala samoano", "tala|tālā|talas|tala samonano|talas samoanos|ws$|sat|wst"], ["Sene samoano", "sene"], ["Libra de Santa Helena", "libra de santa helena|libras de santa helena|shp"], ["Pêni de Santa Helena", "peni de santa helena|penies de santa helena"], ["Dobra", "dobra|dobras|db|std"], ["Dinar sérvio", "dinar sérvio|dinar servio|dinar serbio|dinares sérvios|dinares servios|dinares serbios|rsd"], ["Para sérvio", "para sérvio|para servio|para serbio|paras sérvios|paras servios|paras serbios"], ["Rupia seichelense", "rupia de seicheles|rupias de seicheles|rupia seichelense|rupias seichelenses|scr"], ["Centavo seichelense", "centavo de seicheles|centavos de seicheles|centavo seichelense|centavos seichelenses"], ["Leone serra-leonino", "leone|leones|leone serra-leonino|leones serra-leoninos|le|sll"], ["Dólar de Cingapura", "dólar de singapura|dolar de singapura|dórar de cingapura|dolar de cingapura|dólares de singapura|dolares de singapura|dólares de cingapura|dolares de cingapura|sgb"], ["Centavo de Cingapura", "centavo de singapura|centavos de singapura|centavo de cingapura|centavos de cingapura"], ["Libra síria", "libra síria|libra siria|libras sírias|libras sirias|s£|syp"], ["Piastra síria", "piastra siria|piastras sirias|piastra síria|piastras sírias"], ["Xelim somali", "xelim somali|xelins somalis|xelim somaliano|xelins somalianos|sos"], ["Centavo somali", "centavo somapli|centavos somalis|centavo somaliano|centavos somalianos"], ["Xelim da Somalilândia", "xelim da somalilândia|xelins da somalilândia|xelim da somalilandia|xelins da somalilandia"], ["Centavo da Somalilândia", "centavo da somalilândia|centavos da somalilândia|centavo da somalilandia|centavos da somalilandia"], ["Rupia do Sri Lanka", "rupia do sri lanka|rupia do sri lanca|rupias do sri lanka|rupias do sri lanca|rupia cingalesa|rupias cingalesas|lkr"], ["Lilangeni", "lilangeni|lilangenis|emalangeni|szl"], ["Rand sul-africano", "rand|rand sul-africano|rands|rands sul-africanos|zar"], ["Libra sudanesa", "libra sudanesa|libras sudanesas|sdg"], ["Piastra sudanesa", "piastra sudanesa|piastras sudanesas"], ["Libra sul-sudanesa", "libra sul-sudanesa|libras sul-sudanesas|ssp"], ["Piastra sul-sudanesa", "piastra sul-sudanesa|piastras sul-sudanesas"], ["Coroa sueca", "coroa sueca|coroas suecas|sek"], ["Franco suíço", "franco suíço|franco suico|francos suíços|francos suicos|sfr|chf"], ["Rappen suíço", "rappen suíço|rappen suico|rappens suíços|rappens suicos"], ["Dólar surinamês", "dólar surinamês|dolar surinames|dólar do Suriname|dolar do Suriname|dólares surinameses|dolares surinameses|dólares do Suriname|dolares do Suriname|srd"], ["Centavo surinamês", "centavo surinamês|centavo surinames|centavos surinameses"], ["Baht tailandês", "baht tailandês|bath tailandes|baht tailandeses|thb"], ["Satang tailandês", "satang tailandês|satang tailandes|satang tailandeses"], ["Novo dólar taiwanês", "novo dólar taiwanês|novo dolar taiwanes|dólar taiwanês|dolar taiwanes|dólares taiwaneses|dolares taiwaneses|twd"], ["Centavo taiwanês", "centavo taiwanês|centavo taiwanes|centavos taiwaneses"], ["Xelim tanzaniano", "xelim tanzaniano|xelins tanzanianos|tzs"], ["Centavo tanzaniano", "centavo tanzaniano|centavos tanzanianos"], ["Somoni tajique", "somoni tajique|somoni|somonis tajiques|somonis|tjs"], ["Diram tajique", "diram tajique|dirams tajiques|dirames tajiques"], ["Paʻanga", "paanga|paangas|paʻanga|pa'anga|top"], ["Seniti", "seniti"], ["Rublo transdniestriano", "rublo transdniestriano|rublos transdniestriano"], ["Copeque transdniestriano", "copeque transdniestriano|copeques transdniestriano"], ["Dólar de Trinidade e Tobago", "dólar de trinidade e tobago|dólares trinidade e tobago|dolar de trinidade e tobago|dolares trinidade e tobago|dólar de trinidad e tobago|dólares trinidad e tobago|ttd"], ["Centavo de Trinidade e Tobago", "centavo de trinidade e tobago|centavos de trinidade e tobago|centavo de trinidad e tobago|centavos de trinidad e tobago"], ["Dinar tunisiano", "dinar tunisiano|dinares tunisianos|dinar tunisino|dinares tunisinos|tnd"], ["Milim tunisiano", "milim tunisiano|milim tunesianos|millime tunisianos|millimes tunisianos|milim tunisino|milim tunisinos|millime tunisinos|millimes tunisinos"], ["Lira turca", "lira turca|liras turcas|try"], ["Kuruş turco", "kuruş turco|kuruş turcos"], ["Manat turcomeno", "manat turcomeno|manats turcomenos|tmt"], ["Tennesi turcomeno", "tennesi turcomeno|tennesis turcomenos|tenge turcomenos|tenges turcomenos"], ["Dólar tuvaluano", "dólar tuvaluano|dolar tuvaluano|dólares tuvaluanos|dolares tuvaluanos"], ["Centavo tuvaluano", "centavo tuvaluano|centavos tuvaluanos"], ["Grívnia", "grívnia|grivnia|grívnias|grivnias|grivna|grivnas|uah"], ["Copeque ucraniano", "kopiyka|copeque ucraniano|copeques ucranianos"], ["Xelim ugandês", "xelim ugandês|xelim ugandes|xelins ugandeses|ugx"], ["Centavo ugandês", "centavo ugandês|centavo ugandes|centavos ugandeses"], ["Peso uruguaio", "peso uruguaio|pesos uruguayis|uyu"], ["Centésimo uruguayo", "centésimo uruguaio|centesimo uruguaio|centésimos uruguaios|centesimos uruguaios"], ["Som uzbeque", "som uzbeque|som uzbeques|soms uzbeques|somes uzbeques|som usbeque|som usbeques|soms usbeques|somes usbeques|uzs"], ["Tiyin uzbeque", "tiyin uzbeque|tiyin uzbeques|tiyins uzbeques|tiyin usbeque|tiyin usbeques|tiyins usbeques"], ["Vatu", "vatu|vatus|vuv"], ["Bolívar forte venezuelano", "bolívar forte|bolivar forte|bolívar|bolivar|bolívares|bolivares|vef"], ["Centavo de bolívar", "cêntimo de bolívar|cêntimos de bolívar|centavo de bolívar|centavo de bolivar|centavos de bolívar|centavos de bolivar"], ["Dongue vietnamita", "dongue vietnamita|Đồng vietnamita|dong vietnamita|dongues vietnamitas|dongs vietnamitas|vnd"], ["Hào vietnamita", "hào vietnamita|hao vietnamita|hào vietnamitas|hàos vietnamitas|haos vietnamitas"], ["Rial iemenita", "rial iemenita|riais iemenitas|yer"], ["Fils iemenita", "fils iemenita|fils iemenitas"], ["Franco djibutiano", "franco djibutiano|francos djibutianos|franco jibutiano|francos jibutianos|djf"], ["Dinar iugoslavo", "dinar iugoslavo|dinares iugoslavos|dinar jugoslavo|dinares jugoslavos|yud"], ["Kwacha zambiano", "kwacha zambiano|kwacha zambianos|kwachas zambianos|zmw"], ["Ngwee zambiano", "ngwee zambiano|ngwee zambianos|ngwees zambianos"]]); + PortugueseNumericWithUnit.CompoundUnitConnectorRegex = `(?[^.])`; + PortugueseNumericWithUnit.CurrencyPrefixList = new Map([["Dólar", "$"], ["Dólar estadunidense", "us$|u$d|usd"], ["Dólar do Caribe Oriental", "ec$|xcd"], ["Dólar australiano", "a$|aud"], ["Dólar bahamense", "b$|bsd"], ["Dólar de Barbados", "bds$|bbd"], ["Dólar de Belizebe", "bz$|bzd"], ["Dólar bermudense", "bd$|bmd"], ["Dólar de Brunebi", "brunéi $|bnd"], ["Dólar de Cingapura", "s$|sgd"], ["Dólar canadense", "c$|can$|cad"], ["Dólar das Ilhas Cayman", "ci$|kyd"], ["Dólar neozelandês", "nz$|nzd"], ["Dólar fijgiano", "fj$|fjd"], ["Dólar guianense", "gy$|gyd"], ["Dólar de Hong Kong", "hk$|hkd"], ["Dólar jamaicano", "j$|ja$|jmd"], ["Dólar liberiano", "l$|lrd"], ["Dólar namibiano", "n$|nad"], ["Dólar das Ilhas Salomão", "si$|sbd"], ["Novo dólar taiwanês", "nt$|twd"], ["Real brasileiro", "r$|brl"], ["Guarani", "₲|gs.|pyg"], ["Dólar de Trinidade e Tobago", "tt$|ttd"], ["Yuan chinês", "¥|cny|rmb"], ["Yen", "¥|jpy"], ["Euro", "€|eur"], ["Florim", "ƒ"], ["Libra", "£|gbp"], ["Colón costarriquenho", "₡"], ["Lira turca", "₺"]]); + PortugueseNumericWithUnit.AmbiguousCurrencyUnitList = ['le']; + PortugueseNumericWithUnit.InformationSuffixList = new Map([["bit", "bit|bits"], ["kilobit", "kilobit|kilobits|kb|kbit"], ["megabit", "megabit|megabits|Mb|Mbit"], ["gigabit", "gigabit|gigabits|Gb|Gbit"], ["terabit", "terabit|terabits|Tb|Tbit"], ["petabit", "petabit|petabits|Pb|Pbit"], ["kibibit", "kibibit|kibibits|kib|kibit"], ["mebibit", "mebibit|mebibits|Mib|Mibit"], ["gibibit", "gibibit|gibibits|Gib|Gibit"], ["tebibit", "tebibit|tebibits|Tib|Tibit"], ["pebibit", "pebibit|pebibits|Pib|Pibit"], ["byte", "byte|bytes"], ["kilobyte", "kilobyte|kilobytes|kB|kByte"], ["megabyte", "megabyte|megabytes|MB|MByte"], ["gigabyte", "gigabyte|gigabytes|GB|GByte"], ["terabyte", "terabyte|terabytes|TB|TByte"], ["petabyte", "petabyte|petabytes|PB|PByte"], ["kibibyte", "kibibyte|kibibytes|kiB|kiByte"], ["mebibyte", "mebibyte|mebibytes|MiB|MiByte"], ["gibibyte", "gibibyte|gibibytes|GiB|GiByte"], ["tebibyte", "tebibyte|tebibytes|TiB|TiByte"], ["pebibyte", "pebibyte|pebibytes|PiB|PiByte"]]); + PortugueseNumericWithUnit.AmbiguousDimensionUnitList = ['ton', 'tonelada', 'área', 'area', 'áreas', 'areas', 'milha', 'milhas']; + PortugueseNumericWithUnit.BuildPrefix = `(?<=(\\s|^|\\P{L}))`; + PortugueseNumericWithUnit.BuildSuffix = `(?=(\\s|\\P{L}|$))`; + PortugueseNumericWithUnit.ConnectorToken = 'de'; + PortugueseNumericWithUnit.LengthSuffixList = new Map([["Quilômetro", "km|quilometro|quilômetro|quilómetro|quilometros|quilômetros|quilómetros"], ["Hectômetro", "hm|hectometro|hectômetro|hectómetro|hectometros|hectômetros|hectómetros"], ["Decâmetro", "decametro|decâmetro|decámetro|decametros|decâmetro|decámetros|dam"], ["Metro", "m|m.|metro|metros"], ["Decímetro", "dm|decimetro|decímetro|decimetros|decímetros"], ["Centímetro", "cm|centimetro|centímetro|centimetros|centimetros"], ["Milímetro", "mm|milimetro|milímetro|milimetros|milímetros"], ["Micrômetro", "µm|um|micrometro|micrômetro|micrómetro|micrometros|micrômetros|micrómetros|micron|mícron|microns|mícrons|micra"], ["Nanômetro", "nm|nanometro|nanômetro|nanómetro|nanometros|nanômetros|nanómetros|milimicron|milimícron|milimicrons|milimícrons"], ["Picômetro", "pm|picometro|picômetro|picómetro|picometros|picômetros|picómetros"], ["Milha", "mi|milha|milhas"], ["Jarda", "yd|jarda|jardas"], ["Polegada", "polegada|polegadas|\""], ["Pé", "pé|pe|pés|pes|ft"], ["Ano luz", "ano luz|anos luz|al"]]); + PortugueseNumericWithUnit.AmbiguousLengthUnitList = ['mi', 'milha', 'milhas']; + PortugueseNumericWithUnit.SpeedSuffixList = new Map([["Metro por segundo", "metro/segundo|m/s|metro por segundo|metros por segundo|metros por segundos"], ["Quilômetro por hora", "km/h|quilômetro por hora|quilómetro por hora|quilometro por hora|quilômetros por hora|quilómetros por hora|quilometros por hora|quilômetro/hora|quilómetro/hora|quilometro/hora|quilômetros/hora|quilómetros/hora|quilometros/hora"], ["Quilômetro por minuto", "km/min|quilômetro por minuto|quilómetro por minuto|quilometro por minuto|quilômetros por minuto|quilómetros por minuto|quilometros por minuto|quilômetro/minuto|quilómetro/minuto|quilometro/minuto|quilômetros/minuto|quilómetros/minuto|quilometros/minuto"], ["Quilômetro por segundo", "km/seg|quilômetro por segundo|quilómetro por segundo|quilometro por segundo|quilômetros por segundo|quilómetros por segundo|quilometros por segundo|quilômetro/segundo|quilómetro/segundo|quilometro/segundo|quilômetros/segundo|quilómetros/segundo|quilometros/segundo"], ["Milha por hora", "mph|milha por hora|mi/h|milha/hora|milhas/hora|milhas por hora"], ["Nó", "kt|nó|nós|kn"], ["Pé por segundo", "ft/s|pé/s|pe/s|ft/seg|pé/seg|pe/seg|pé por segundo|pe por segundo|pés por segundo|pes por segundo"], ["Pé por minuto", "ft/min|pé/mind|pe/min|pé por minuto|pe por minuto|pés por minuto|pes por minuto"], ["Jarda por minuto", "jardas por minuto|jardas/minuto|jardas/min"], ["Jarda por segundo", "jardas por segundo|jardas/segundo|jardas/seg"]]); + PortugueseNumericWithUnit.AmbiguousSpeedUnitList = ['nó', 'no', 'nós', 'nos']; + PortugueseNumericWithUnit.TemperatureSuffixList = new Map([["Kelvin", "k|kelvin"], ["Grau Rankine", "r|°r|°ra|grau rankine|graus rankine| rankine"], ["Grau Celsius", "°c|grau c|grau celsius|graus c|graus celsius|celsius|grau centígrado|grau centrigrado|graus centígrados|graus centigrados|centígrado|centígrados|centigrado|centigrados"], ["Grau Fahrenheit", "°f|grau f|graus f|grau fahrenheit|graus fahrenheit|fahrenheit"], ["Grau", "°|graus|grau"]]); + PortugueseNumericWithUnit.VolumeSuffixList = new Map([["Quilômetro cúbico", "quilômetro cúbico|quilómetro cúbico|quilometro cubico|quilômetros cúbicos|quilómetros cúbicos|quilometros cubicos|km3|km^3|km³"], ["Hectômetro cúbico", "hectômetro cúbico|hectómetro cúbico|hectometro cubico|hectômetros cúbicos|hectómetros cúbicos|hectometros cubicos|hm3|hm^3|hm³"], ["Decâmetro cúbico", "decâmetro cúbico|decámetro cúbico|decametro cubico|decâmetros cúbicos|decámetros cúbicos|decametros cubicosdam3|dam^3|dam³"], ["Metro cúbico", "metro cúbico|metro cubico|metros cúbicos|metros cubicos|m3|m^3|m³"], ["Decímetro cúbico", "decímetro cúbico|decimetro cubico|decímetros cúbicos|decimetros cubicos|dm3|dm^3|dm³"], ["Centímetro cúbico", "centímetro cúbico|centimetro cubico|centímetros cúbicos|centrimetros cubicos|cc|cm3|cm^3|cm³"], ["Milímetro cúbico", "milímetro cúbico|milimetro cubico|milímetros cúbicos|milimetros cubicos|mm3|mm^3|mm³"], ["Polegada cúbica", "polegada cúbica|polegada cubica|polegadas cúbicas|polegadas cubicas"], ["Pé cúbico", "pé cúbico|pe cubico|pés cúbicos|pes cubicos|pé3|pe3|pé^3|pe^3|pé³|pe³|ft3|ft^3|ft³"], ["Jarda cúbica", "jarda cúbica|jarda cubica|jardas cúbicas|jardas cubicas|yd3|yd^3|yd³"], ["Hectolitro", "hectolitro|hectolitros|hl"], ["Litro", "litro|litros|lts|l"], ["Mililitro", "mililitro|mililitros|ml"], ["Galão", "galão|galões|galao|galoes"], ["Pint", "pinta|pintas|pinto|pintos|quartilho|quartilhos|pint|pints"], ["Barril", "barril|barris|bbl"], ["Onça líquida", "onça líquida|onca liquida|onças líquidas|oncas liquidas"]]); + PortugueseNumericWithUnit.WeightSuffixList = new Map([["Tonelada métrica", "tonelada métrica|tonelada metrica|toneladas métricas|toneladas metricas"], ["Tonelada", "ton|tonelada|toneladas"], ["Quilograma", "kg|quilograma|quilogramas|quilo|quilos|kilo|kilos"], ["Hectograma", "hg|hectograma|hectogramas"], ["Decagrama", "dag|decagrama|decagramas"], ["Grama", "g|gr|grama|gramas"], ["Decigrama", "dg|decigrama|decigramas"], ["Centigrama", "cg|centigrama|centigramas"], ["Miligrama", "mg|miligrama|miligramas"], ["Micrograma", "µg|ug|micrograma|microgramas"], ["Nanograma", "ng|nanograma|nanogramas"], ["Picograma", "pg|picograma|picogramas"], ["Libra", "lb|libra|libras"], ["Onça", "oz|onça|onca|onças|oncas"], ["Grão", "grão|grao|grãos|graos|gr"], ["Quilate", "ct|kt|quilate|quilates"]]); +})(PortugueseNumericWithUnit = exports.PortugueseNumericWithUnit || (exports.PortugueseNumericWithUnit = {})); + +}); + +unwrapExports(portugueseNumericWithUnit); + +var base$4 = createCommonjsModule(function (module, exports) { +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); + + + + + +class PortugueseNumberWithUnitExtractorConfiguration { + constructor(ci) { + this.cultureInfo = ci; + this.unitNumExtractor = new recognizersTextNumber.PortugueseNumberExtractor(); + this.buildPrefix = portugueseNumericWithUnit.PortugueseNumericWithUnit.BuildPrefix; + this.buildSuffix = portugueseNumericWithUnit.PortugueseNumericWithUnit.BuildSuffix; + this.connectorToken = portugueseNumericWithUnit.PortugueseNumericWithUnit.ConnectorToken; + this.compoundUnitConnectorRegex = recognizersText.RegExpUtility.getSafeRegExp(portugueseNumericWithUnit.PortugueseNumericWithUnit.CompoundUnitConnectorRegex); + this.pmNonUnitRegex = recognizersText.RegExpUtility.getSafeRegExp(baseUnits.BaseUnits.PmNonUnitRegex); + } +} +exports.PortugueseNumberWithUnitExtractorConfiguration = PortugueseNumberWithUnitExtractorConfiguration; +class PortugueseNumberWithUnitParserConfiguration extends parsers$4.BaseNumberWithUnitParserConfiguration { + constructor(ci) { + super(ci); + this.internalNumberExtractor = new recognizersTextNumber.PortugueseNumberExtractor(recognizersTextNumber.NumberMode.Default); + this.internalNumberParser = recognizersTextNumber.AgnosticNumberParserFactory.getParser(recognizersTextNumber.AgnosticNumberParserType.Number, new recognizersTextNumber.PortugueseNumberParserConfiguration()); + this.connectorToken = portugueseNumericWithUnit.PortugueseNumericWithUnit.ConnectorToken; + } +} +exports.PortugueseNumberWithUnitParserConfiguration = PortugueseNumberWithUnitParserConfiguration; + +}); + +unwrapExports(base$4); + +var currency$4 = createCommonjsModule(function (module, exports) { +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); + + + + +class PortugueseCurrencyExtractorConfiguration extends base$4.PortugueseNumberWithUnitExtractorConfiguration { + constructor(ci) { + if (!ci) { + ci = new recognizersTextNumber.CultureInfo(recognizersTextNumber.Culture.Portuguese); + } + super(ci); + this.extractType = constants$2.Constants.SYS_UNIT_CURRENCY; + // Reference Source: https:// en.wikipedia.org/wiki/List_of_circulating_currencies + this.suffixList = portugueseNumericWithUnit.PortugueseNumericWithUnit.CurrencySuffixList; + this.prefixList = portugueseNumericWithUnit.PortugueseNumericWithUnit.CurrencyPrefixList; + this.ambiguousUnitList = portugueseNumericWithUnit.PortugueseNumericWithUnit.AmbiguousCurrencyUnitList; + } +} +exports.PortugueseCurrencyExtractorConfiguration = PortugueseCurrencyExtractorConfiguration; +class PortugueseCurrencyParserConfiguration extends base$4.PortugueseNumberWithUnitParserConfiguration { + constructor(ci) { + if (!ci) { + ci = new recognizersTextNumber.CultureInfo(recognizersTextNumber.Culture.Portuguese); + } + super(ci); + this.BindDictionary(portugueseNumericWithUnit.PortugueseNumericWithUnit.CurrencySuffixList); + this.BindDictionary(portugueseNumericWithUnit.PortugueseNumericWithUnit.CurrencyPrefixList); + } +} +exports.PortugueseCurrencyParserConfiguration = PortugueseCurrencyParserConfiguration; + +}); + +unwrapExports(currency$4); + +var temperature$4 = createCommonjsModule(function (module, exports) { +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); + + + + +class PortugueseTemperatureExtractorConfiguration extends base$4.PortugueseNumberWithUnitExtractorConfiguration { + constructor(ci) { + if (!ci) { + ci = new recognizersTextNumber.CultureInfo(recognizersTextNumber.Culture.Portuguese); + } + super(ci); + this.extractType = constants$2.Constants.SYS_UNIT_TEMPERATURE; + this.suffixList = portugueseNumericWithUnit.PortugueseNumericWithUnit.TemperatureSuffixList; + this.prefixList = new Map(); + this.ambiguousUnitList = new Array(); + } +} +exports.PortugueseTemperatureExtractorConfiguration = PortugueseTemperatureExtractorConfiguration; +class PortugueseTemperatureParserConfiguration extends base$4.PortugueseNumberWithUnitParserConfiguration { + constructor(ci) { + if (!ci) { + ci = new recognizersTextNumber.CultureInfo(recognizersTextNumber.Culture.Portuguese); + } + super(ci); + this.BindDictionary(portugueseNumericWithUnit.PortugueseNumericWithUnit.TemperatureSuffixList); + } +} +exports.PortugueseTemperatureParserConfiguration = PortugueseTemperatureParserConfiguration; + +}); + +unwrapExports(temperature$4); + +var dimension$4 = createCommonjsModule(function (module, exports) { +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); + + + + +const dimensionSuffixList = new Map([ + ...portugueseNumericWithUnit.PortugueseNumericWithUnit.InformationSuffixList, + ...portugueseNumericWithUnit.PortugueseNumericWithUnit.AreaSuffixList, + ...portugueseNumericWithUnit.PortugueseNumericWithUnit.LengthSuffixList, + ...portugueseNumericWithUnit.PortugueseNumericWithUnit.SpeedSuffixList, + ...portugueseNumericWithUnit.PortugueseNumericWithUnit.VolumeSuffixList, + ...portugueseNumericWithUnit.PortugueseNumericWithUnit.WeightSuffixList +]); +class PortugueseDimensionExtractorConfiguration extends base$4.PortugueseNumberWithUnitExtractorConfiguration { + constructor(ci) { + if (!ci) { + ci = new recognizersTextNumber.CultureInfo(recognizersTextNumber.Culture.Portuguese); + } + super(ci); + this.extractType = constants$2.Constants.SYS_UNIT_DIMENSION; + this.suffixList = dimensionSuffixList; + this.prefixList = new Map(); + this.ambiguousUnitList = portugueseNumericWithUnit.PortugueseNumericWithUnit.AmbiguousDimensionUnitList; + } +} +exports.PortugueseDimensionExtractorConfiguration = PortugueseDimensionExtractorConfiguration; +class PortugueseDimensionParserConfiguration extends base$4.PortugueseNumberWithUnitParserConfiguration { + constructor(ci) { + if (!ci) { + ci = new recognizersTextNumber.CultureInfo(recognizersTextNumber.Culture.Portuguese); + } + super(ci); + this.BindDictionary(dimensionSuffixList); + } +} +exports.PortugueseDimensionParserConfiguration = PortugueseDimensionParserConfiguration; + +}); + +unwrapExports(dimension$4); + +var age$4 = createCommonjsModule(function (module, exports) { +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); + + + + +class PortugueseAgeExtractorConfiguration extends base$4.PortugueseNumberWithUnitExtractorConfiguration { + constructor(ci) { + if (!ci) { + ci = new recognizersTextNumber.CultureInfo(recognizersTextNumber.Culture.Portuguese); + } + super(ci); + this.extractType = constants$2.Constants.SYS_UNIT_AGE; + this.suffixList = portugueseNumericWithUnit.PortugueseNumericWithUnit.AgeSuffixList; + this.prefixList = new Map(); + this.ambiguousUnitList = new Array(); + } +} +exports.PortugueseAgeExtractorConfiguration = PortugueseAgeExtractorConfiguration; +class PortugueseAgeParserConfiguration extends base$4.PortugueseNumberWithUnitParserConfiguration { + constructor(ci) { + if (!ci) { + ci = new recognizersTextNumber.CultureInfo(recognizersTextNumber.Culture.Portuguese); + } + super(ci); + this.BindDictionary(portugueseNumericWithUnit.PortugueseNumericWithUnit.AgeSuffixList); + } +} +exports.PortugueseAgeParserConfiguration = PortugueseAgeParserConfiguration; + +}); + +unwrapExports(age$4); + +var chineseNumericWithUnit = createCommonjsModule(function (module, exports) { +"use strict"; +// ------------------------------------------------------------------------------ +// +// This code was generated by a tool. +// Changes to this file may cause incorrect behavior and will be lost if +// the code is regenerated. +// +// ------------------------------------------------------------------------------ +Object.defineProperty(exports, "__esModule", { value: true }); +var ChineseNumericWithUnit; +(function (ChineseNumericWithUnit) { + ChineseNumericWithUnit.AgeAmbiguousValues = ['岁']; + ChineseNumericWithUnit.AgeSuffixList = new Map([["Year", "岁|周岁"], ["Month", "个月大|月大"], ["Week", "周大"], ["Day", "天大"]]); + ChineseNumericWithUnit.BuildPrefix = ''; + ChineseNumericWithUnit.BuildSuffix = ''; + ChineseNumericWithUnit.ConnectorToken = ''; + ChineseNumericWithUnit.CurrencySuffixList = new Map([["Afghan afghani", "阿富汗尼"], ["Pul", "普尔"], ["Euro", "欧元"], ["Cent", "美分"], ["Albanian lek", "阿尔巴尼亚列克|列克"], ["Angolan kwanza", "安哥拉宽扎|宽扎"], ["Armenian dram", "亚美尼亚德拉姆"], ["Aruban florin", "阿鲁巴弗罗林|阿鲁巴币"], ["Bangladeshi taka", "塔卡|孟加拉塔卡"], ["Paisa", "派萨|帕萨"], ["Bhutanese ngultrum", "不丹努尔特鲁姆|不丹努扎姆|努扎姆"], ["Chetrum", "切特鲁姆"], ["Bolivian boliviano", "玻利维亚诺|玻利维亚币"], ["Bosnia and Herzegovina convertible mark", "波斯尼亚和黑塞哥维那可兑换马克|波赫可兑换马克"], ["Botswana pula", "博茨瓦纳普拉|普拉"], ["Thebe", "thebe"], ["Brazilian real", "巴西雷亚尔"], ["Bulgarian lev", "保加利亚列弗|保加利亚列瓦"], ["Stotinka", "斯托丁卡"], ["Cambodian riel", "瑞尔"], ["Cape Verdean escudo", "佛得角埃斯库多|维德角埃斯库多"], ["Croatian kuna", "克罗地亚库纳|克罗地亚库那|克罗埃西亚库纳"], ["Lipa", "利巴"], ["Eritrean nakfa", "厄立特里亚纳克法"], ["Ethiopian birr", "埃塞俄比亚比尔|埃塞俄比亚元"], ["Gambian dalasi", "冈比亚达拉西|甘比亚达拉西"], ["Butut", "布达|布图"], ["Georgian lari", "格鲁吉亚拉里"], ["Tetri", "特特里|泰特里"], ["Ghanaian cedi", "塞地|加纳塞地"], ["Pesewa", "比塞瓦"], ["Guatemalan quetzal", "瓜地马拉格查尔"], ["Haitian gourde", "海地古德"], ["Honduran lempira", "洪都拉斯伦皮拉"], ["Hungarian forint", "匈牙利福林|匈牙利货币|匈牙利福林币"], ["Iranian rial", "伊朗里亚尔|伊朗莱尔"], ["Yemeni rial", "叶门莱尔|叶门里亚尔"], ["Israeli new shekel", "₪|ils|以色列币|以色列新克尔|谢克尔"], ["Japanese yen", "日元|日本元|日币|日圆"], ["Sen", "日本銭"], ["Kazakhstani tenge", "哈萨克斯坦坚戈"], ["Kenyan shilling", "肯尼亚先令"], ["North Korean won", "朝鲜圆|朝鲜元"], ["South Korean won", "韩元|韩圆"], ["Korean won", "₩"], ["Kyrgyzstani som", "吉尔吉斯斯坦索姆"], ["Lao kip", "基普|老挝基普|老挝币"], ["Att", "att"], ["Lesotho loti", "莱索托洛提|莱索托马洛蒂"], ["South African rand", "南非兰特"], ["Macedonian denar", "马其顿代纳尔|马其顿币|第纳尔|代纳尔"], ["Deni", "第尼"], ["Malagasy ariary", "马达加斯加阿里亚里"], ["Iraimbilanja", "伊莱姆比拉贾"], ["Malawian kwacha", "马拉威克瓦查"], ["Tambala", "坦巴拉"], ["Malaysian ringgit", "马来西亚币|马币|马来西亚林吉特"], ["Mauritanian ouguiya", "毛里塔尼亚乌吉亚"], ["Khoums", "库姆斯"], ["Mozambican metical", "莫桑比克梅蒂卡尔|梅蒂卡尔"], ["Burmese kyat", "缅甸元|缅元"], ["Pya", "缅分"], ["Nigerian naira", "尼日利亚奈拉|尼日利亚币|奈拉"], ["Kobo", "考包"], ["Turkish lira", "土耳其里拉"], ["Kuruş", "库鲁"], ["Omani rial", "阿曼里亚尔|阿曼莱尔"], ["Panamanian balboa", "巴拿马巴波亚"], ["Centesimo", "意大利分|乌拉圭分|巴拿马分"], ["Papua New Guinean kina", "基那"], ["Toea", "托亚|托伊"], ["Peruvian sol", "秘鲁索尔"], ["Polish złoty", "波兰币|波兰兹罗提|兹罗提"], ["Grosz", "格罗希"], ["Qatari riyal", "卡达里亚尔"], ["Saudi riyal", "沙特里亚尔"], ["Riyal", "里亚尔|"], ["Dirham", "迪拉姆"], ["Halala", "哈拉"], ["Samoan tālā", "萨摩亚塔拉"], ["Sierra Leonean leone", "塞拉利昂利昂|利昂"], ["Peseta", "比塞塔|西班牙比塞塔|西班牙币"], ["Swazi lilangeni", "斯威士兰里兰吉尼|兰吉尼"], ["Tajikistani somoni", "塔吉克斯坦索莫尼"], ["Thai baht", "泰铢|泰元"], ["Satang", "萨当"], ["Tongan paʻanga", "汤加潘加|潘加"], ["Ukrainian hryvnia", "乌克兰格里夫纳|格里夫纳"], ["Vanuatu vatu", "瓦努阿图瓦图"], ["Vietnamese dong", "越南盾"], ["Indonesian rupiah", "印度尼西亚盾"], ["Netherlands guilder", "荷兰盾|荷属安的列斯盾|列斯盾"], ["Surinam florin", "苏里南盾"], ["Guilder", "盾"], ["Zambian kwacha", "赞比亚克瓦查"], ["Moroccan dirham", "摩洛哥迪拉姆"], ["United Arab Emirates dirham", "阿联酋迪拉姆"], ["Azerbaijani manat", "阿塞拜疆马纳特"], ["Turkmenistan manat", "土库曼马纳特"], ["Manat", "马纳特"], ["Somali shilling", "索马里先令|索马利先令"], ["Somaliland shilling", "索马里兰先令"], ["Tanzanian shilling", "坦桑尼亚先令"], ["Ugandan shilling", "乌干达先令"], ["Romanian leu", "罗马尼亚列伊"], ["Moldovan leu", "摩尔多瓦列伊"], ["Leu", "列伊"], ["Ban", "巴尼"], ["Nepalese rupee", "尼泊尔卢比"], ["Pakistani rupee", "巴基斯坦卢比"], ["Indian rupee", "印度卢比"], ["Seychellois rupee", "塞舌尔卢比"], ["Mauritian rupee", "毛里求斯卢比"], ["Maldivian rufiyaa", "马尔代夫卢比"], ["Sri Lankan rupee", "斯里兰卡卢比"], ["Rupee", "卢比"], ["Czech koruna", "捷克克朗"], ["Danish krone", "丹麦克朗|丹麦克郎"], ["Norwegian krone", "挪威克朗"], ["Faroese króna", "法罗克朗"], ["Icelandic króna", "冰岛克朗"], ["Swedish krona", "瑞典克朗"], ["Krone", "克朗"], ["Øre", "奥依拉|奥拉|埃利"], ["West African CFA franc", "非共体法郎"], ["Central African CFA franc", "中非法郎|中非金融合作法郎"], ["Comorian franc", "科摩罗法郎"], ["Congolese franc", "刚果法郎"], ["Burundian franc", "布隆迪法郎"], ["Djiboutian franc", "吉布提法郎"], ["CFP franc", "太平洋法郎"], ["Guinean franc", "几内亚法郎"], ["Swiss franc", "瑞士法郎"], ["Rwandan franc", "卢旺达法郎"], ["Belgian franc", "比利时法郎"], ["Rappen", "瑞士分|瑞士生丁"], ["Franc", "法郎"], ["Centime", "生丁|仙士"], ["Russian ruble", "俄国卢布|俄罗斯卢布"], ["Transnistrian ruble", "德涅斯特卢布"], ["Belarusian ruble", "白俄罗斯卢布"], ["Kopek", "戈比"], ["Ruble", "卢布"], ["Algerian dinar", "阿尔及利亚第纳尔"], ["Bahraini dinar", "巴林第纳尔"], ["Iraqi dinar", "伊拉克第纳尔|"], ["Jordanian dinar", "约旦第纳尔"], ["Kuwaiti dinar", "科威特第纳尔|科威特币"], ["Libyan dinar", "利比亚第纳尔"], ["Serbian dinar", "塞尔维亚第纳尔|塞尔维亚币"], ["Tunisian dinar", "突尼斯第纳尔"], ["Dinar", "第纳尔"], ["Fils", "费尔"], ["Para", "帕拉"], ["Millime", "米利姆"], ["Argentine peso", "阿根廷比索"], ["Chilean peso", "智利比索"], ["Colombian peso", "哥伦比亚比索"], ["Cuban peso", "古巴比索"], ["Dominican peso", "多米尼加比索"], ["Mexican peso", "墨西哥比索"], ["Philippine peso", "菲律宾比索"], ["Uruguayan peso", "乌拉圭比索"], ["Peso", "比索"], ["Centavo", "仙|菲辅币"], ["Alderney pound", "奥尔德尼镑"], ["British pound", "英镑"], ["Guernsey pound", "根西镑"], ["Saint Helena pound", "圣赫勒拿镑"], ["Egyptian pound", "埃及镑"], ["Falkland Islands pound", "福克兰镑"], ["Gibraltar pound", "直布罗陀镑"], ["Manx pound", "马恩岛镑"], ["Jersey pound", "泽西岛镑"], ["Lebanese pound", "黎巴嫩镑"], ["South Sudanese pound", "南苏丹镑"], ["Sudanese pound", "苏丹镑"], ["Syrian pound", "叙利亚镑"], ["Pound", "英镑"], ["Pence", "便士"], ["Shilling", "先令"], ["United States dollar", "美元|美金|美圆"], ["East Caribbean dollar", "东加勒比元"], ["Australian dollar", "澳大利亚元|澳元"], ["Bahamian dollar", "巴哈马元"], ["Barbadian dollar", "巴巴多斯元"], ["Belize dollar", "伯利兹元"], ["Bermudian dollar", "百慕大元"], ["Brunei dollar", "文莱元"], ["Singapore dollar", "新加坡元|新元"], ["Canadian dollar", "加元|加拿大元"], ["Cayman Islands dollar", "开曼岛元|"], ["New Zealand dollar", "新西兰元|纽元"], ["Cook Islands dollar", "库克群岛元"], ["Fijian dollar", "斐济元|斐币"], ["Guyanese dollar", "圭亚那元"], ["Hong Kong dollar", "蚊|港元|港圆|港币"], ["Macau Pataca", "澳元|澳门币|澳门元"], ["New Taiwan dollar", "箍|新台币|台币"], ["Jamaican dollar", "牙买加元"], ["Kiribati dollar", "吉里巴斯元"], ["Liberian dollar", "利比里亚元"], ["Namibian dollar", "纳米比亚元"], ["Surinamese dollar", "苏里南元"], ["Trinidad and Tobago dollar", "特立尼达多巴哥元"], ["Tuvaluan dollar", "吐瓦鲁元"], ["Chinese yuan", "人民币|人民币元|块钱|块|元|圆"], ["Fen", "分钱|分"], ["Jiao", "毛钱|毛|角钱|角"], ["Finnish markka", "芬兰马克"], ["Penni", "盆尼"]]); + ChineseNumericWithUnit.CurrencyNameToIsoCodeMap = new Map([["Afghan afghani", "AFN"], ["Euro", "EUR"], ["Albanian lek", "ALL"], ["Angolan kwanza", "AOA"], ["Armenian dram", "AMD"], ["Aruban florin", "AWG"], ["Bangladeshi taka", "BDT"], ["Bhutanese ngultrum", "BTN"], ["Bolivian boliviano", "BOB"], ["Bosnia and Herzegovina convertible mark", "BAM"], ["Botswana pula", "BWP"], ["Brazilian real", "BRL"], ["Bulgarian lev", "BGN"], ["Cambodian riel", "KHR"], ["Cape Verdean escudo", "CVE"], ["Costa Rican colón", "CRC"], ["Croatian kuna", "HRK"], ["Czech koruna", "CZK"], ["Eritrean nakfa", "ERN"], ["Ethiopian birr", "ETB"], ["Gambian dalasi", "GMD"], ["Georgian lari", "GEL"], ["Ghanaian cedi", "GHS"], ["Guatemalan quetzal", "GTQ"], ["Haitian gourde", "HTG"], ["Honduran lempira", "HNL"], ["Hungarian forint", "HUF"], ["Iranian rial", "IRR"], ["Yemeni rial", "YER"], ["Israeli new shekel", "ILS"], ["Japanese yen", "JPY"], ["Kazakhstani tenge", "KZT"], ["Kenyan shilling", "KES"], ["North Korean won", "KPW"], ["South Korean won", "KRW"], ["Kyrgyzstani som", "KGS"], ["Lao kip", "LAK"], ["Lesotho loti", "LSL"], ["South African rand", "ZAR"], ["Macanese pataca", "MOP"], ["Macedonian denar", "MKD"], ["Malagasy ariary", "MGA"], ["Malawian kwacha", "MWK"], ["Malaysian ringgit", "MYR"], ["Mauritanian ouguiya", "MRO"], ["Mongolian tögrög", "MNT"], ["Mozambican metical", "MZN"], ["Burmese kyat", "MMK"], ["Nicaraguan córdoba", "NIO"], ["Nigerian naira", "NGN"], ["Turkish lira", "TRY"], ["Omani rial", "OMR"], ["Panamanian balboa", "PAB"], ["Papua New Guinean kina", "PGK"], ["Paraguayan guaraní", "PYG"], ["Peruvian sol", "PEN"], ["Polish złoty", "PLN"], ["Qatari riyal", "QAR"], ["Saudi riyal", "SAR"], ["Samoan tālā", "WST"], ["São Tomé and Príncipe dobra", "STD"], ["Sierra Leonean leone", "SLL"], ["Swazi lilangeni", "SZL"], ["Tajikistani somoni", "TJS"], ["Thai baht", "THB"], ["Ukrainian hryvnia", "UAH"], ["Vanuatu vatu", "VUV"], ["Venezuelan bolívar", "VEF"], ["Zambian kwacha", "ZMW"], ["Moroccan dirham", "MAD"], ["United Arab Emirates dirham", "AED"], ["Azerbaijani manat", "AZN"], ["Turkmenistan manat", "TMT"], ["Somali shilling", "SOS"], ["Tanzanian shilling", "TZS"], ["Ugandan shilling", "UGX"], ["Romanian leu", "RON"], ["Moldovan leu", "MDL"], ["Nepalese rupee", "NPR"], ["Pakistani rupee", "PKR"], ["Indian rupee", "INR"], ["Seychellois rupee", "SCR"], ["Mauritian rupee", "MUR"], ["Maldivian rufiyaa", "MVR"], ["Sri Lankan rupee", "LKR"], ["Indonesian rupiah", "IDR"], ["Danish krone", "DKK"], ["Norwegian krone", "NOK"], ["Icelandic króna", "ISK"], ["Swedish krona", "SEK"], ["West African CFA franc", "XOF"], ["Central African CFA franc", "XAF"], ["Comorian franc", "KMF"], ["Congolese franc", "CDF"], ["Burundian franc", "BIF"], ["Djiboutian franc", "DJF"], ["CFP franc", "XPF"], ["Guinean franc", "GNF"], ["Swiss franc", "CHF"], ["Rwandan franc", "RWF"], ["Russian ruble", "RUB"], ["Transnistrian ruble", "PRB"], ["Belarusian ruble", "BYN"], ["Algerian dinar", "DZD"], ["Bahraini dinar", "BHD"], ["Iraqi dinar", "IQD"], ["Jordanian dinar", "JOD"], ["Kuwaiti dinar", "KWD"], ["Libyan dinar", "LYD"], ["Serbian dinar", "RSD"], ["Tunisian dinar", "TND"], ["Argentine peso", "ARS"], ["Chilean peso", "CLP"], ["Colombian peso", "COP"], ["Cuban convertible peso", "CUC"], ["Cuban peso", "CUP"], ["Dominican peso", "DOP"], ["Mexican peso", "MXN"], ["Uruguayan peso", "UYU"], ["British pound", "GBP"], ["Saint Helena pound", "SHP"], ["Egyptian pound", "EGP"], ["Falkland Islands pound", "FKP"], ["Gibraltar pound", "GIP"], ["Manx pound", "IMP"], ["Jersey pound", "JEP"], ["Lebanese pound", "LBP"], ["South Sudanese pound", "SSP"], ["Sudanese pound", "SDG"], ["Syrian pound", "SYP"], ["United States dollar", "USD"], ["Australian dollar", "AUD"], ["Bahamian dollar", "BSD"], ["Barbadian dollar", "BBD"], ["Belize dollar", "BZD"], ["Bermudian dollar", "BMD"], ["Brunei dollar", "BND"], ["Singapore dollar", "SGD"], ["Canadian dollar", "CAD"], ["Cayman Islands dollar", "KYD"], ["New Zealand dollar", "NZD"], ["Fijian dollar", "FJD"], ["Guyanese dollar", "GYD"], ["Hong Kong dollar", "HKD"], ["Jamaican dollar", "JMD"], ["Liberian dollar", "LRD"], ["Namibian dollar", "NAD"], ["Solomon Islands dollar", "SBD"], ["Surinamese dollar", "SRD"], ["New Taiwan dollar", "TWD"], ["Trinidad and Tobago dollar", "TTD"], ["Tuvaluan dollar", "TVD"], ["Chinese yuan", "CNY"], ["Rial", "__RI"], ["Shiling", "__S"], ["Som", "__SO"], ["Dirham", "__DR"], ["Dinar", "_DN"], ["Dollar", "__D"], ["Manat", "__MA"], ["Rupee", "__R"], ["Krone", "__K"], ["Krona", "__K"], ["Crown", "__K"], ["Frank", "__F"], ["Mark", "__M"], ["Ruble", "__RB"], ["Peso", "__PE"], ["Pound", "__P"], ["Tristan da Cunha pound", "_TP"], ["South Georgia and the South Sandwich Islands pound", "_SP"], ["Somaliland shilling", "_SS"], ["Pitcairn Islands dollar", "_PND"], ["Palauan dollar", "_PD"], ["Niue dollar", "_NID"], ["Nauruan dollar", "_ND"], ["Micronesian dollar", "_MD"], ["Kiribati dollar", "_KID"], ["Guernsey pound", "_GGP"], ["Faroese króna", "_FOK"], ["Cook Islands dollar", "_CKD"], ["British Virgin Islands dollar", "_BD"], ["Ascension pound", "_AP"], ["Alderney pound", "_ALP"], ["Abkhazian apsar", "_AA"]]); + ChineseNumericWithUnit.FractionalUnitNameToCodeMap = new Map([["Jiao", "JIAO"], ["Kopek", "KOPEK"], ["Pul", "PUL"], ["Cent", "CENT"], ["Qindarkë", "QINDARKE"], ["Penny", "PENNY"], ["Santeem", "SANTEEM"], ["Cêntimo", "CENTIMO"], ["Centavo", "CENTAVO"], ["Luma", "LUMA"], ["Qəpik", "QƏPIK"], ["Fils", "FILS"], ["Poisha", "POISHA"], ["Kapyeyka", "KAPYEYKA"], ["Centime", "CENTIME"], ["Chetrum", "CHETRUM"], ["Paisa", "PAISA"], ["Fening", "FENING"], ["Thebe", "THEBE"], ["Sen", "SEN"], ["Stotinka", "STOTINKA"], ["Fen", "FEN"], ["Céntimo", "CENTIMO"], ["Lipa", "LIPA"], ["Haléř", "HALER"], ["Øre", "ØRE"], ["Piastre", "PIASTRE"], ["Santim", "SANTIM"], ["Oyra", "OYRA"], ["Butut", "BUTUT"], ["Tetri", "TETRI"], ["Pesewa", "PESEWA"], ["Fillér", "FILLER"], ["Eyrir", "EYRIR"], ["Dinar", "DINAR"], ["Agora", "AGORA"], ["Tïın", "TIIN"], ["Chon", "CHON"], ["Jeon", "JEON"], ["Tyiyn", "TYIYN"], ["Att", "ATT"], ["Sente", "SENTE"], ["Dirham", "DIRHAM"], ["Rappen", "RAPPEN"], ["Avo", "AVO"], ["Deni", "DENI"], ["Iraimbilanja", "IRAIMBILANJA"], ["Tambala", "TAMBALA"], ["Laari", "LAARI"], ["Khoums", "KHOUMS"], ["Ban", "BAN"], ["Möngö", "MONGO"], ["Pya", "PYA"], ["Kobo", "KOBO"], ["Kuruş", "KURUS"], ["Baisa", "BAISA"], ["Centésimo", "CENTESIMO"], ["Toea", "TOEA"], ["Sentimo", "SENTIMO"], ["Grosz", "GROSZ"], ["Sene", "SENE"], ["Halala", "HALALA"], ["Para", "PARA"], ["Öre", "ORE"], ["Diram", "DIRAM"], ["Satang", "SATANG"], ["Seniti", "SENITI"], ["Millime", "MILLIME"], ["Tennesi", "TENNESI"], ["Kopiyka", "KOPIYKA"], ["Tiyin", "TIYIN"], ["Hào", "HAO"], ["Ngwee", "NGWEE"]]); + ChineseNumericWithUnit.CompoundUnitConnectorRegex = `(?又|再)`; + ChineseNumericWithUnit.CurrencyPrefixList = new Map([["Dollar", "$"], ["United States dollar", "us$"], ["British Virgin Islands dollar", "bvi$"], ["Brunei dollar", "b$"], ["Sen", "sen"], ["Singapore dollar", "s$"], ["Canadian dollar", "can$|c$|c $"], ["Cayman Islands dollar", "ci$"], ["New Zealand dollar", "nz$|nz $"], ["Guyanese dollar", "gy$|gy $|g$|g $"], ["Hong Kong dollar", "hk$|hkd|hk $"], ["Jamaican dollar", "j$"], ["Namibian dollar", "nad|n$|n $"], ["Solomon Islands dollar", "si$|si $"], ["New Taiwan dollar", "nt$|nt $"], ["Samoan tālā", "ws$"], ["Chinese yuan", "¥"], ["Japanese yen", "¥"], ["Turkish lira", "₺"], ["Euro", "€"], ["Pound", "£"], ["Costa Rican colón", "₡"]]); + ChineseNumericWithUnit.CurrencyAmbiguousValues = ['元', '仙', '分', '圆', '块', '毛', '盾', '箍', '蚊', '角']; + ChineseNumericWithUnit.DimensionSuffixList = new Map([["Meter", "米|公尺|m"], ["Kilometer", "千米|公里|km"], ["Decimeter", "分米|公寸|dm"], ["Centimeter", "釐米|厘米|公分|cm"], ["Micrometer", "毫米|公釐|mm"], ["Microns", "微米"], ["Picometer", "皮米"], ["Nanometer", "纳米"], ["Li", "里|市里"], ["Zhang", "丈"], ["Chi", "市尺|尺"], ["Cun", "市寸|寸"], ["Fen", "市分|分"], ["Hao", "毫"], ["Mile", "英里"], ["Inch", "英寸"], ["Foot", "呎|英尺"], ["Yard", "码"], ["Knot", "海里"], ["Light year", "光年"], ["Meter per second", "米每秒|米/秒|m/s"], ["Kilometer per hour", "公里每小时|千米每小时|公里/小时|千米/小时|km/h"], ["Kilometer per minute", "公里每分钟|千米每分钟|公里/分钟|千米/分钟|km/min"], ["Kilometer per second", "公里每秒|千米每秒|公里/秒|千米/秒|km/s"], ["Mile per hour", "英里每小时|英里/小时"], ["Foot per second", "英尺每小时|英尺/小时"], ["Foot per minute", "英尺每分钟|英尺/分钟"], ["Yard per minute", "码每分|码/分"], ["Yard per second", "码每秒|码/秒"], ["Square centimetre", "平方厘米"], ["Square decimeter", "平方分米"], ["Square meter", "平方米"], ["Square kilometer", "平方公里"], ["Acre", "英亩|公亩"], ["Hectare", "公顷"], ["Mu", "亩|市亩"], ["Liter", "公升|升|l"], ["Milliliter", "毫升|ml"], ["Cubic meter", "立方米"], ["Cubic decimeter", "立方分米"], ["Cubic millimeter", "立方毫米"], ["Cubic feet", "立方英尺"], ["Gallon", "加仑"], ["Pint", "品脱"], ["Dou", "市斗|斗"], ["Dan", "市石|石"], ["Kilogram", "千克|公斤|kg"], ["Jin", "市斤|斤"], ["Milligram", "毫克|mg"], ["Barrel", "桶"], ["Pot", "罐"], ["Gram", "克|g"], ["Ton", "公吨|吨|t"], ["Pound", "磅"], ["Ounce", "盎司"], ["Bit", "比特|位|b"], ["Byte", "字节|byte"], ["Kilobyte", "千字节|kb"], ["Megabyte", "兆字节|mb"], ["Gigabyte", "十亿字节|千兆字节|gb"], ["Terabyte", "万亿字节|兆兆字节|tb"], ["Petabyte", "千兆兆|千万亿字节|pb"]]); + ChineseNumericWithUnit.DimensionAmbiguousValues = ['丈', '位', '克', '分', '升', '寸', '尺', '斗', '斤', '桶', '毫', '石', '码', '磅', '米', '罐', '里', 'm', 'km', 'dm', 'cm', 'mm', 'l', 'ml', 'kg', 'mg', 'g', 't', 'b', 'byte', 'kb', 'mb', 'gb', 'tb', 'pb']; + ChineseNumericWithUnit.TemperatureSuffixList = new Map([["F", "华氏温度|华氏度|°f"], ["K", "k|开尔文温度|开氏度|凯氏度"], ["R", "兰氏温度|°r"], ["C", "摄氏温度|摄氏度|°c"], ["Degree", "度"]]); + ChineseNumericWithUnit.TemperaturePrefixList = new Map([["F", "华氏温度|华氏"], ["K", "开氏温度|开氏"], ["R", "兰氏温度|兰氏"], ["C", "摄氏温度|摄氏"]]); + ChineseNumericWithUnit.TemperatureAmbiguousValues = ['度', 'k']; +})(ChineseNumericWithUnit = exports.ChineseNumericWithUnit || (exports.ChineseNumericWithUnit = {})); + +}); + +unwrapExports(chineseNumericWithUnit); + +var base$6 = createCommonjsModule(function (module, exports) { +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); + + + + + +class ChineseNumberWithUnitExtractorConfiguration { + constructor(ci) { + this.cultureInfo = ci; + this.unitNumExtractor = new recognizersTextNumber.ChineseNumberExtractor(recognizersTextNumber.ChineseNumberExtractorMode.ExtractAll); + this.buildPrefix = chineseNumericWithUnit.ChineseNumericWithUnit.BuildPrefix; + this.buildSuffix = chineseNumericWithUnit.ChineseNumericWithUnit.BuildSuffix; + this.connectorToken = chineseNumericWithUnit.ChineseNumericWithUnit.ConnectorToken; + this.compoundUnitConnectorRegex = recognizersText.RegExpUtility.getSafeRegExp(chineseNumericWithUnit.ChineseNumericWithUnit.CompoundUnitConnectorRegex); + this.pmNonUnitRegex = recognizersText.RegExpUtility.getSafeRegExp(baseUnits.BaseUnits.PmNonUnitRegex); + } +} +exports.ChineseNumberWithUnitExtractorConfiguration = ChineseNumberWithUnitExtractorConfiguration; +class ChineseNumberWithUnitParserConfiguration extends parsers$4.BaseNumberWithUnitParserConfiguration { + constructor(ci) { + super(ci); + this.internalNumberExtractor = new recognizersTextNumber.ChineseNumberExtractor(recognizersTextNumber.ChineseNumberExtractorMode.Default); + this.internalNumberParser = recognizersTextNumber.AgnosticNumberParserFactory.getParser(recognizersTextNumber.AgnosticNumberParserType.Number, new recognizersTextNumber.ChineseNumberParserConfiguration()); + this.connectorToken = ''; + this.currencyNameToIsoCodeMap = chineseNumericWithUnit.ChineseNumericWithUnit.CurrencyNameToIsoCodeMap; + this.currencyFractionCodeList = chineseNumericWithUnit.ChineseNumericWithUnit.FractionalUnitNameToCodeMap; + } +} +exports.ChineseNumberWithUnitParserConfiguration = ChineseNumberWithUnitParserConfiguration; + +}); + +unwrapExports(base$6); + +var currency$6 = createCommonjsModule(function (module, exports) { +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); + + + + +class ChineseCurrencyExtractorConfiguration extends base$6.ChineseNumberWithUnitExtractorConfiguration { + constructor(ci) { + if (!ci) { + ci = new recognizersTextNumber.CultureInfo(recognizersTextNumber.Culture.Chinese); + } + super(ci); + this.extractType = constants$2.Constants.SYS_UNIT_CURRENCY; + // Reference Source: https:// en.wikipedia.org/wiki/List_of_circulating_currencies + this.suffixList = chineseNumericWithUnit.ChineseNumericWithUnit.CurrencySuffixList; + this.prefixList = chineseNumericWithUnit.ChineseNumericWithUnit.CurrencyPrefixList; + this.ambiguousUnitList = chineseNumericWithUnit.ChineseNumericWithUnit.CurrencyAmbiguousValues; + + } +} +exports.ChineseCurrencyExtractorConfiguration = ChineseCurrencyExtractorConfiguration; +class ChineseCurrencyParserConfiguration extends base$6.ChineseNumberWithUnitParserConfiguration { + constructor(ci) { + if (!ci) { + ci = new recognizersTextNumber.CultureInfo(recognizersTextNumber.Culture.Chinese); + } + super(ci); + this.BindDictionary(chineseNumericWithUnit.ChineseNumericWithUnit.CurrencySuffixList); + this.BindDictionary(chineseNumericWithUnit.ChineseNumericWithUnit.CurrencyPrefixList); + } +} +exports.ChineseCurrencyParserConfiguration = ChineseCurrencyParserConfiguration; + +}); + +unwrapExports(currency$6); + +var temperature$6 = createCommonjsModule(function (module, exports) { +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); + + + + +class ChineseTemperatureExtractorConfiguration extends base$6.ChineseNumberWithUnitExtractorConfiguration { + constructor(ci) { + if (!ci) { + ci = new recognizersTextNumber.CultureInfo(recognizersTextNumber.Culture.Chinese); + } + super(ci); + this.extractType = constants$2.Constants.SYS_UNIT_TEMPERATURE; + this.suffixList = chineseNumericWithUnit.ChineseNumericWithUnit.TemperatureSuffixList; + this.prefixList = chineseNumericWithUnit.ChineseNumericWithUnit.TemperaturePrefixList; + this.ambiguousUnitList = chineseNumericWithUnit.ChineseNumericWithUnit.TemperatureAmbiguousValues; + } +} +exports.ChineseTemperatureExtractorConfiguration = ChineseTemperatureExtractorConfiguration; +class ChineseTemperatureParserConfiguration extends base$6.ChineseNumberWithUnitParserConfiguration { + constructor(ci) { + if (!ci) { + ci = new recognizersTextNumber.CultureInfo(recognizersTextNumber.Culture.Chinese); + } + super(ci); + this.BindDictionary(chineseNumericWithUnit.ChineseNumericWithUnit.TemperaturePrefixList); + this.BindDictionary(chineseNumericWithUnit.ChineseNumericWithUnit.TemperatureSuffixList); + } +} +exports.ChineseTemperatureParserConfiguration = ChineseTemperatureParserConfiguration; + +}); + +unwrapExports(temperature$6); + +var dimension$6 = createCommonjsModule(function (module, exports) { +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); + + + + +class ChineseDimensionExtractorConfiguration extends base$6.ChineseNumberWithUnitExtractorConfiguration { + constructor(ci) { + if (!ci) { + ci = new recognizersTextNumber.CultureInfo(recognizersTextNumber.Culture.Chinese); + } + super(ci); + this.extractType = constants$2.Constants.SYS_UNIT_DIMENSION; + this.suffixList = chineseNumericWithUnit.ChineseNumericWithUnit.DimensionSuffixList; + this.prefixList = new Map(); + this.ambiguousUnitList = chineseNumericWithUnit.ChineseNumericWithUnit.DimensionAmbiguousValues; + } +} +exports.ChineseDimensionExtractorConfiguration = ChineseDimensionExtractorConfiguration; +class ChineseDimensionParserConfiguration extends base$6.ChineseNumberWithUnitParserConfiguration { + constructor(ci) { + if (!ci) { + ci = new recognizersTextNumber.CultureInfo(recognizersTextNumber.Culture.Chinese); + } + super(ci); + this.BindDictionary(chineseNumericWithUnit.ChineseNumericWithUnit.DimensionSuffixList); + } +} +exports.ChineseDimensionParserConfiguration = ChineseDimensionParserConfiguration; + +}); + +unwrapExports(dimension$6); + +var age$6 = createCommonjsModule(function (module, exports) { +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); + + + + +class ChineseAgeExtractorConfiguration extends base$6.ChineseNumberWithUnitExtractorConfiguration { + constructor(ci) { + if (!ci) { + ci = new recognizersTextNumber.CultureInfo(recognizersTextNumber.Culture.Chinese); + } + super(ci); + this.extractType = constants$2.Constants.SYS_UNIT_AGE; + this.suffixList = chineseNumericWithUnit.ChineseNumericWithUnit.AgeSuffixList; + this.prefixList = new Map(); + this.ambiguousUnitList = chineseNumericWithUnit.ChineseNumericWithUnit.AgeAmbiguousValues; + } +} +exports.ChineseAgeExtractorConfiguration = ChineseAgeExtractorConfiguration; +class ChineseAgeParserConfiguration extends base$6.ChineseNumberWithUnitParserConfiguration { + constructor(ci) { + if (!ci) { + ci = new recognizersTextNumber.CultureInfo(recognizersTextNumber.Culture.Chinese); + } + super(ci); + this.BindDictionary(chineseNumericWithUnit.ChineseNumericWithUnit.AgeSuffixList); + } +} +exports.ChineseAgeParserConfiguration = ChineseAgeParserConfiguration; + +}); + +unwrapExports(age$6); + +var japaneseNumericWithUnit = createCommonjsModule(function (module, exports) { +"use strict"; +// ------------------------------------------------------------------------------ +// +// This code was generated by a tool. +// Changes to this file may cause incorrect behavior and will be lost if +// the code is regenerated. +// +// ------------------------------------------------------------------------------ +Object.defineProperty(exports, "__esModule", { value: true }); +var JapaneseNumericWithUnit; +(function (JapaneseNumericWithUnit) { + JapaneseNumericWithUnit.AgeAmbiguousValues = ['歳']; + JapaneseNumericWithUnit.AgeSuffixList = new Map([["Year", "歳"], ["Month", "ヶ月"], ["Week", "週間|週"], ["Day", "日間|日齢|日大"]]); + JapaneseNumericWithUnit.BuildPrefix = ''; + JapaneseNumericWithUnit.BuildSuffix = ''; + JapaneseNumericWithUnit.ConnectorToken = ''; + JapaneseNumericWithUnit.CurrencySuffixList = new Map([["Afghan afghani", "アフガニ"], ["Pul", "プル"], ["Euro", "ユーロ"], ["Cent", "セント"], ["Albanian lek", "アルバニアレク|アルバニア・レク|レク"], ["Angolan kwanza", "アンゴラクワンザ|アンゴラ・クワンザ|クワンザ"], ["Armenian dram", "アルメニアドラム|アルメニア・ドラム|ドラム"], ["Aruban florin", "アルバ・フロリン|フロリン"], ["Bangladeshi taka", "タカ|バングラデシュ・タカ"], ["Paisa", "パイサ"], ["Bhutanese ngultrum", "ニュルタム|ブータン・ニュルタム|ブータンニュルタム"], ["Chetrum", "チェルタム"], ["Bolivian boliviano", "ボリビアーノ"], ["Bosnia and Herzegovina convertible mark", "兌換マルク"], ["Botswana pula", "ボツワナ・プラ|ボツワナプラ|プラ"], ["Thebe", "テベ"], ["Brazilian real", "ブラジル・レアル|ブラジルレアル|レアル"], ["Bulgarian lev", "ブルガリア・レフ|ブルガリアレフ|レフ"], ["Stotinka", "ストティンカ"], ["Cambodian riel", "カンボジア・リエル|カンボジアリエル|リエル"], ["Cape Verdean escudo", "カーボベルデ・エスクード"], ["Croatian kuna", "クロアチアクーナ|クロアチア・クーナ|クーナ"], ["Lipa", "リパ"], ["Eritrean nakfa", "エリトリア・ナクファ|エリトリアナクファ|ナクファ"], ["Ethiopian birr", "エチオピア・ブル|エチオピアブル|ブル"], ["Gambian dalasi", "ガンビア・ダラシ|ガンビアダラシ|ダラシ"], ["Butut", "ブトゥツ"], ["Georgian lari", "ジョージア・ラリ|ジョージアラリ|ラリ"], ["Tetri", "テトリ"], ["Ghanaian cedi", "ガーナ・セディ|ガーナセディ|セディ"], ["Pesewa", "ペセワ"], ["Guatemalan quetzal", "グアテマラ・ケツァル|グアテマラケツァル|ケツァル"], ["Haitian gourde", "ハイチ・グールド|ハイチグールド|グールド"], ["Honduran lempira", "ホンジュラス・レンピラ|ホンジュラスレンピラ|レンピラ"], ["Hungarian forint", "ハンガリー・フォリント|ハンガリーフォリント|フォリント"], ["Iranian rial", "イラン・リアル"], ["Yemeni rial", "イエメン・リアル"], ["Israeli new shekel", "₪|ils|イスラエル・新シェケル|イスラエル新シェケル"], ["Japanese yen", "円"], ["Sen", "銭"], ["Kazakhstani tenge", "テンゲ|カザフスタン・テンゲ|カザフスタンテンゲ"], ["Kenyan shilling", "ケニア・シリング"], ["North Korean won", "北朝鮮ウォン"], ["South Korean won", "韓国ウォン"], ["Korean won", "₩"], ["Kyrgyzstani som", "キルギス・ソム|ソム"], ["Lao kip", "キップ|ラオス・キップ|ラオスキップ"], ["Att", "att"], ["Lesotho loti", "ロチ|レソト・ロチ|レソトロチ"], ["South African rand", "ランド|南アフリカ・ランド|南アフリカランド"], ["Macedonian denar", "マケドニア・デナール"], ["Deni", "デニ"], ["Malagasy ariary", "アリアリ|マダガスカル・アリアリ|マダガスカルアリアリ"], ["Iraimbilanja", "イライムビランジャ"], ["Malawian kwacha", "マラウイ・クワチャ"], ["Tambala", "タンバラ"], ["Malaysian ringgit", "リンギット|マレーシア・リンギット"], ["Mauritanian ouguiya", "ウギア|モーリタニア・ウギア|モーリタニアウギア"], ["Khoums", "コウム"], ["Mozambican metical", "メティカル|モザンビーク・メティカル|モザンビークメティカル"], ["Burmese kyat", "チャット|ミャンマー・チャット|ミャンマーチャット"], ["Pya", "ピャー"], ["Nigerian naira", "ナイラ|ナイジェリア・ナイラ|ナイジェリアナイラ"], ["Kobo", "コボ"], ["Turkish lira", "トルコリラ"], ["Kuruş", "クルシュ"], ["Omani rial", "オマーン・リアル"], ["Panamanian balboa", "バルボア|パナマ・バルボア|パナマバルボア"], ["Centesimo", "センテシモ"], ["Papua New Guinean kina", "キナ|パプア・ニューギニア・キナ"], ["Toea", "トエア"], ["Peruvian sol", "ヌエボ・ソル"], ["Polish złoty", "ズウォティ|ポーランド・ズウォティ|ポーランドズウォティ"], ["Grosz", "グロシュ"], ["Qatari riyal", "カタール・リヤル"], ["Saudi riyal", "サウジアラビア・リヤル"], ["Riyal", "リヤル"], ["Dirham", "ディルハム"], ["Halala", "ハララ"], ["Samoan tālā", "タラ|サモア・タラ|サモアタラ"], ["Sierra Leonean leone", "レオン|シエラレオネ・レオン|シエラレオネレオン"], ["Peseta", "ユーロ"], ["Swazi lilangeni", "リランゲニ|スワジランド・リランゲニ|スワジランドリランゲニ"], ["Tajikistani somoni", "ソモニ|タジキスタン・ソモニ|タジキスタンソモニ"], ["Thai baht", "バーツ|タイ・バーツ|タイバーツ"], ["Satang", "サタン"], ["Tongan paʻanga", "パアンガ|トンガ・パアンガ|トンガパアンガ"], ["Ukrainian hryvnia", "フリヴニャ|ウクライナ・フリヴニャ|ウクライナフリヴニャ"], ["Vanuatu vatu", "バツ|バヌアツ・バツ|バヌアツバツ"], ["Vietnamese dong", "ドン|ベトナム・ドン|ベトナムドン"], ["Indonesian rupiah", "ルピア|インドネシア・ルピア|インドネシアルピア"], ["Netherlands guilder", "ユーロ|オランダ・ユーロ"], ["Surinam florin", "スリナム・ドル"], ["Zambian kwacha", "ザンビア・クワチャ"], ["Moroccan dirham", "モロッコ・ディルハム"], ["United Arab Emirates dirham", "UAEディルハム"], ["Azerbaijani manat", "アゼルバイジャン・マナト"], ["Turkmenistan manat", "トルクメニスタン・マナト"], ["Manat", "マナト"], ["Somali shilling", "ソマリア・シリング"], ["Somaliland shilling", "ソマリランド・シリング"], ["Tanzanian shilling", "タンザニア・シリング"], ["Ugandan shilling", "ウガンダ・シリング"], ["Romanian leu", "ルーマニア・レウ"], ["Moldovan leu", "モルドバ・レウ"], ["Leu", "レウ"], ["Ban", "バン"], ["Nepalese rupee", "ネパール・ルピー"], ["Pakistani rupee", "パキスタン・ルピー"], ["Indian rupee", "インド・ルピー"], ["Seychellois rupee", "セーシェル・ルピー"], ["Mauritian rupee", "モーリシャス・ルピー"], ["Maldivian rufiyaa", "ルフィヤ|モルディブ・ルフィヤ|モルディブルフィヤ"], ["Sri Lankan rupee", "スリランカ・ルピー"], ["Rupee", "ルピー"], ["Czech koruna", "チェコ・コルナ"], ["Danish krone", "デンマーク・クローネ"], ["Norwegian krone", "ノルウェー・クローネ"], ["Faroese króna", "フェロー・クローネ"], ["Icelandic króna", "アイスランド・クローナ"], ["Swedish krona", "スウェーデン・クローナ"], ["Krone", "クローナ"], ["Øre", "オーレ"], ["West African CFA franc", "CFAフラン"], ["Central African CFA franc", "CFAフラン"], ["Comorian franc", "コモロ・フラン"], ["Congolese franc", "コンゴ・フラン"], ["Burundian franc", "ブルンジ・フラン"], ["Djiboutian franc", "ジブチ・フラン"], ["CFP franc", "CFPフラン"], ["Guinean franc", "ギニア・フラン"], ["Swiss franc", "スイス・フラン"], ["Rwandan franc", "ルワンダ・フラン"], ["Belgian franc", "ベルギー・フラン"], ["Rappen", "Rappen"], ["Franc", "フラン"], ["Centime", "サンチーム"], ["Russian ruble", "ロシア・ルーブル"], ["Transnistrian ruble", "沿ドニエストル・ルーブル"], ["Belarusian ruble", "ベラルーシ・ルーブル"], ["Kopek", "カペイカ"], ["Ruble", "ルーブル"], ["Algerian dinar", "アルジェリア・ディナール"], ["Bahraini dinar", "バーレーン・ディナール"], ["Iraqi dinar", "イラク・ディナール"], ["Jordanian dinar", "ヨルダン・ディナール"], ["Kuwaiti dinar", "クウェート・ディナール"], ["Libyan dinar", "リビア・ディナール"], ["Serbian dinar", "セルビア・ディナール"], ["Tunisian dinar", "チュニジア・ディナール"], ["Dinar", "ディナール"], ["Fils", "フィルス"], ["Para", "パラ"], ["Millime", "ミリム"], ["Argentine peso", "ペソ|アルゼンチン・ペソ"], ["Chilean peso", "チリ・ペソ"], ["Colombian peso", "コロンビア・ペソ"], ["Cuban peso", "兌換ペソ"], ["Dominican peso", "ドミニカ・ペソ"], ["Mexican peso", "メキシコ・ペソ"], ["Philippine peso", "フィリピン・ペソ"], ["Uruguayan peso", "ウルグアイ・ペソ"], ["Peso", "ペソ"], ["Centavo", "センターボ"], ["Alderney pound", "ガーンジー・ポンド"], ["British pound", "UKポンド"], ["Guernsey pound", "ガーンジー・ポンド"], ["Saint Helena pound", "セントヘレナ・ポンド"], ["Egyptian pound", "エジプト・ポンド"], ["Falkland Islands pound", "フォークランド諸島ポンド"], ["Gibraltar pound", "ジブラルタル・ポンド"], ["Manx pound", "マン島ポンド"], ["Jersey pound", "ジャージー・ポンド"], ["Lebanese pound", "レバノン・ポンド"], ["South Sudanese pound", "南スーダン・ポンド"], ["Sudanese pound", "スーダン・ポンド"], ["Syrian pound", "シリア・ポンド"], ["Pound", "ポンド"], ["Pence", "ペニー"], ["Shilling", "シリング"], ["United States dollar", "ドル|USドル"], ["East Caribbean dollar", "東カリブ・ドル"], ["Australian dollar", "オーストラリア・ドル"], ["Bahamian dollar", "バハマ・ドル"], ["Barbadian dollar", "バルバドス・ドル"], ["Belize dollar", "ベリーズ・ドル"], ["Bermudian dollar", "バミューダ・ドル"], ["Brunei dollar", "ブルネイ・ドル"], ["Singapore dollar", "シンガポール・ドル"], ["Canadian dollar", "カナダ・ドル"], ["Cayman Islands dollar", "ケイマン諸島・ドル"], ["New Zealand dollar", "ニュージーランド・ドル"], ["Cook Islands dollar", "ニュージーランド・ドル|ニュージーランド・ドル"], ["Fijian dollar", "フィジー・ドル|フィジー・ドル"], ["Guyanese dollar", "ガイアナ・ドル|ガイアナ・ドル"], ["Hong Kong dollar", "香港ドル"], ["Macau Pataca", "マカオ・パタカ|マカオ・パタカ"], ["New Taiwan dollar", "ニュー台湾ドル|ニュー台湾ドル"], ["Jamaican dollar", "ジャマイカ・ドル|ジャマイカドル"], ["Kiribati dollar", "オーストラリア・ドル|オーストラリアドル"], ["Liberian dollar", "リベリア・ドル|リベリアドル"], ["Namibian dollar", "ナミビア・ドル|ナミビアドル"], ["Surinamese dollar", "スリナム・ドル|スリナムドル"], ["Trinidad and Tobago dollar", "トリニダード・トバゴ・ドル|トリニダードトバゴ・ドル"], ["Tuvaluan dollar", "ツバル・ドル|ツバルドル"], ["Chinese yuan", "人民元"], ["Fen", "分"], ["Jiao", "角"], ["Finnish markka", "フィンランド・マルカ"], ["Penni", "ペニー"]]); + JapaneseNumericWithUnit.CurrencyNameToIsoCodeMap = new Map([["Afghan afghani", "AFN"], ["Euro", "EUR"], ["Albanian lek", "ALL"], ["Angolan kwanza", "AOA"], ["Armenian dram", "AMD"], ["Aruban florin", "AWG"], ["Bangladeshi taka", "BDT"], ["Bhutanese ngultrum", "BTN"], ["Bolivian boliviano", "BOB"], ["Bosnia and Herzegovina convertible mark", "BAM"], ["Botswana pula", "BWP"], ["Brazilian real", "BRL"], ["Bulgarian lev", "BGN"], ["Cambodian riel", "KHR"], ["Cape Verdean escudo", "CVE"], ["Costa Rican colón", "CRC"], ["Croatian kuna", "HRK"], ["Czech koruna", "CZK"], ["Eritrean nakfa", "ERN"], ["Ethiopian birr", "ETB"], ["Gambian dalasi", "GMD"], ["Georgian lari", "GEL"], ["Ghanaian cedi", "GHS"], ["Guatemalan quetzal", "GTQ"], ["Haitian gourde", "HTG"], ["Honduran lempira", "HNL"], ["Hungarian forint", "HUF"], ["Iranian rial", "IRR"], ["Yemeni rial", "YER"], ["Israeli new shekel", "ILS"], ["Japanese yen", "JPY"], ["Kazakhstani tenge", "KZT"], ["Kenyan shilling", "KES"], ["North Korean won", "KPW"], ["South Korean won", "KRW"], ["Kyrgyzstani som", "KGS"], ["Lao kip", "LAK"], ["Lesotho loti", "LSL"], ["South African rand", "ZAR"], ["Macanese pataca", "MOP"], ["Macedonian denar", "MKD"], ["Malagasy ariary", "MGA"], ["Malawian kwacha", "MWK"], ["Malaysian ringgit", "MYR"], ["Mauritanian ouguiya", "MRO"], ["Mongolian tögrög", "MNT"], ["Mozambican metical", "MZN"], ["Burmese kyat", "MMK"], ["Nicaraguan córdoba", "NIO"], ["Nigerian naira", "NGN"], ["Turkish lira", "TRY"], ["Omani rial", "OMR"], ["Panamanian balboa", "PAB"], ["Papua New Guinean kina", "PGK"], ["Paraguayan guaraní", "PYG"], ["Peruvian sol", "PEN"], ["Polish złoty", "PLN"], ["Qatari riyal", "QAR"], ["Saudi riyal", "SAR"], ["Samoan tālā", "WST"], ["São Tomé and Príncipe dobra", "STD"], ["Sierra Leonean leone", "SLL"], ["Swazi lilangeni", "SZL"], ["Tajikistani somoni", "TJS"], ["Thai baht", "THB"], ["Ukrainian hryvnia", "UAH"], ["Vanuatu vatu", "VUV"], ["Venezuelan bolívar", "VEF"], ["Zambian kwacha", "ZMW"], ["Moroccan dirham", "MAD"], ["United Arab Emirates dirham", "AED"], ["Azerbaijani manat", "AZN"], ["Turkmenistan manat", "TMT"], ["Somali shilling", "SOS"], ["Tanzanian shilling", "TZS"], ["Ugandan shilling", "UGX"], ["Romanian leu", "RON"], ["Moldovan leu", "MDL"], ["Nepalese rupee", "NPR"], ["Pakistani rupee", "PKR"], ["Indian rupee", "INR"], ["Seychellois rupee", "SCR"], ["Mauritian rupee", "MUR"], ["Maldivian rufiyaa", "MVR"], ["Sri Lankan rupee", "LKR"], ["Indonesian rupiah", "IDR"], ["Danish krone", "DKK"], ["Norwegian krone", "NOK"], ["Icelandic króna", "ISK"], ["Swedish krona", "SEK"], ["West African CFA franc", "XOF"], ["Central African CFA franc", "XAF"], ["Comorian franc", "KMF"], ["Congolese franc", "CDF"], ["Burundian franc", "BIF"], ["Djiboutian franc", "DJF"], ["CFP franc", "XPF"], ["Guinean franc", "GNF"], ["Swiss franc", "CHF"], ["Rwandan franc", "RWF"], ["Russian ruble", "RUB"], ["Transnistrian ruble", "PRB"], ["Belarusian ruble", "BYN"], ["Algerian dinar", "DZD"], ["Bahraini dinar", "BHD"], ["Iraqi dinar", "IQD"], ["Jordanian dinar", "JOD"], ["Kuwaiti dinar", "KWD"], ["Libyan dinar", "LYD"], ["Serbian dinar", "RSD"], ["Tunisian dinar", "TND"], ["Argentine peso", "ARS"], ["Chilean peso", "CLP"], ["Colombian peso", "COP"], ["Cuban convertible peso", "CUC"], ["Cuban peso", "CUP"], ["Dominican peso", "DOP"], ["Mexican peso", "MXN"], ["Uruguayan peso", "UYU"], ["British pound", "GBP"], ["Saint Helena pound", "SHP"], ["Egyptian pound", "EGP"], ["Falkland Islands pound", "FKP"], ["Gibraltar pound", "GIP"], ["Manx pound", "IMP"], ["Jersey pound", "JEP"], ["Lebanese pound", "LBP"], ["South Sudanese pound", "SSP"], ["Sudanese pound", "SDG"], ["Syrian pound", "SYP"], ["United States dollar", "USD"], ["Australian dollar", "AUD"], ["Bahamian dollar", "BSD"], ["Barbadian dollar", "BBD"], ["Belize dollar", "BZD"], ["Bermudian dollar", "BMD"], ["Brunei dollar", "BND"], ["Singapore dollar", "SGD"], ["Canadian dollar", "CAD"], ["Cayman Islands dollar", "KYD"], ["New Zealand dollar", "NZD"], ["Fijian dollar", "FJD"], ["Guyanese dollar", "GYD"], ["Hong Kong dollar", "HKD"], ["Jamaican dollar", "JMD"], ["Liberian dollar", "LRD"], ["Namibian dollar", "NAD"], ["Solomon Islands dollar", "SBD"], ["Surinamese dollar", "SRD"], ["New Taiwan dollar", "TWD"], ["Trinidad and Tobago dollar", "TTD"], ["Tuvaluan dollar", "TVD"], ["Chinese yuan", "CNY"], ["Rial", "__RI"], ["Shiling", "__S"], ["Som", "__SO"], ["Dirham", "__DR"], ["Dinar", "_DN"], ["Dollar", "__D"], ["Manat", "__MA"], ["Rupee", "__R"], ["Krone", "__K"], ["Krona", "__K"], ["Crown", "__K"], ["Frank", "__F"], ["Mark", "__M"], ["Ruble", "__RB"], ["Peso", "__PE"], ["Pound", "__P"], ["Tristan da Cunha pound", "_TP"], ["South Georgia and the South Sandwich Islands pound", "_SP"], ["Somaliland shilling", "_SS"], ["Pitcairn Islands dollar", "_PND"], ["Palauan dollar", "_PD"], ["Niue dollar", "_NID"], ["Nauruan dollar", "_ND"], ["Micronesian dollar", "_MD"], ["Kiribati dollar", "_KID"], ["Guernsey pound", "_GGP"], ["Faroese króna", "_FOK"], ["Cook Islands dollar", "_CKD"], ["British Virgin Islands dollar", "_BD"], ["Ascension pound", "_AP"], ["Alderney pound", "_ALP"], ["Abkhazian apsar", "_AA"]]); + JapaneseNumericWithUnit.FractionalUnitNameToCodeMap = new Map([["Jiao", "JIAO"], ["Kopek", "KOPEK"], ["Pul", "PUL"], ["Cent", "CENT"], ["Qindarkë", "QINDARKE"], ["Penny", "PENNY"], ["Santeem", "SANTEEM"], ["Cêntimo", "CENTIMO"], ["Centavo", "CENTAVO"], ["Luma", "LUMA"], ["Qəpik", "QƏPIK"], ["Fils", "FILS"], ["Poisha", "POISHA"], ["Kapyeyka", "KAPYEYKA"], ["Centime", "CENTIME"], ["Chetrum", "CHETRUM"], ["Paisa", "PAISA"], ["Fening", "FENING"], ["Thebe", "THEBE"], ["Sen", "SEN"], ["Stotinka", "STOTINKA"], ["Fen", "FEN"], ["Céntimo", "CENTIMO"], ["Lipa", "LIPA"], ["Haléř", "HALER"], ["Øre", "ØRE"], ["Piastre", "PIASTRE"], ["Santim", "SANTIM"], ["Oyra", "OYRA"], ["Butut", "BUTUT"], ["Tetri", "TETRI"], ["Pesewa", "PESEWA"], ["Fillér", "FILLER"], ["Eyrir", "EYRIR"], ["Dinar", "DINAR"], ["Agora", "AGORA"], ["Tïın", "TIIN"], ["Chon", "CHON"], ["Jeon", "JEON"], ["Tyiyn", "TYIYN"], ["Att", "ATT"], ["Sente", "SENTE"], ["Dirham", "DIRHAM"], ["Rappen", "RAPPEN"], ["Avo", "AVO"], ["Deni", "DENI"], ["Iraimbilanja", "IRAIMBILANJA"], ["Tambala", "TAMBALA"], ["Laari", "LAARI"], ["Khoums", "KHOUMS"], ["Ban", "BAN"], ["Möngö", "MONGO"], ["Pya", "PYA"], ["Kobo", "KOBO"], ["Kuruş", "KURUS"], ["Baisa", "BAISA"], ["Centésimo", "CENTESIMO"], ["Toea", "TOEA"], ["Sentimo", "SENTIMO"], ["Grosz", "GROSZ"], ["Sene", "SENE"], ["Halala", "HALALA"], ["Para", "PARA"], ["Öre", "ORE"], ["Diram", "DIRAM"], ["Satang", "SATANG"], ["Seniti", "SENITI"], ["Millime", "MILLIME"], ["Tennesi", "TENNESI"], ["Kopiyka", "KOPIYKA"], ["Tiyin", "TIYIN"], ["Hào", "HAO"], ["Ngwee", "NGWEE"]]); + JapaneseNumericWithUnit.CompoundUnitConnectorRegex = `(?と)`; + JapaneseNumericWithUnit.CurrencyPrefixList = new Map([["Dollar", "$"], ["United States dollar", "us$"], ["British Virgin Islands dollar", "bvi$"], ["Brunei dollar", "b$"], ["Sen", "sen"], ["Singapore dollar", "s$"], ["Canadian dollar", "can$|c$|c $"], ["Cayman Islands dollar", "ci$"], ["New Zealand dollar", "nz$|nz $"], ["Guyanese dollar", "gy$|gy $|g$|g $"], ["Hong Kong dollar", "hk$|hkd|hk $"], ["Jamaican dollar", "j$"], ["Namibian dollar", "nad|n$|n $"], ["Solomon Islands dollar", "si$|si $"], ["New Taiwan dollar", "nt$|nt $"], ["Samoan tālā", "ws$"], ["Chinese yuan", "¥"], ["Japanese yen", "¥|\\"], ["Turkish lira", "₺"], ["Euro", "€"], ["Pound", "£"], ["Costa Rican colón", "₡"]]); + JapaneseNumericWithUnit.CurrencyAmbiguousValues = ['円', '銭', '\\']; +})(JapaneseNumericWithUnit = exports.JapaneseNumericWithUnit || (exports.JapaneseNumericWithUnit = {})); + +}); + +unwrapExports(japaneseNumericWithUnit); + +var base$8 = createCommonjsModule(function (module, exports) { +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); + + + + + +class JapaneseNumberWithUnitExtractorConfiguration { + constructor(ci) { + this.cultureInfo = ci; + this.unitNumExtractor = new recognizersTextNumber.JapaneseNumberExtractor(recognizersTextNumber.JapaneseNumberExtractorMode.ExtractAll); + this.buildPrefix = japaneseNumericWithUnit.JapaneseNumericWithUnit.BuildPrefix; + this.buildSuffix = japaneseNumericWithUnit.JapaneseNumericWithUnit.BuildSuffix; + this.connectorToken = japaneseNumericWithUnit.JapaneseNumericWithUnit.ConnectorToken; + this.compoundUnitConnectorRegex = recognizersText.RegExpUtility.getSafeRegExp(japaneseNumericWithUnit.JapaneseNumericWithUnit.CompoundUnitConnectorRegex); + this.pmNonUnitRegex = recognizersText.RegExpUtility.getSafeRegExp(baseUnits.BaseUnits.PmNonUnitRegex); + } +} +exports.JapaneseNumberWithUnitExtractorConfiguration = JapaneseNumberWithUnitExtractorConfiguration; +class JapaneseNumberWithUnitParserConfiguration extends parsers$4.BaseNumberWithUnitParserConfiguration { + constructor(ci) { + super(ci); + this.internalNumberExtractor = new recognizersTextNumber.JapaneseNumberExtractor(recognizersTextNumber.JapaneseNumberExtractorMode.Default); + this.internalNumberParser = recognizersTextNumber.AgnosticNumberParserFactory.getParser(recognizersTextNumber.AgnosticNumberParserType.Number, new recognizersTextNumber.JapaneseNumberParserConfiguration()); + this.connectorToken = ''; + this.currencyNameToIsoCodeMap = japaneseNumericWithUnit.JapaneseNumericWithUnit.CurrencyNameToIsoCodeMap; + this.currencyFractionCodeList = japaneseNumericWithUnit.JapaneseNumericWithUnit.FractionalUnitNameToCodeMap; + } +} +exports.JapaneseNumberWithUnitParserConfiguration = JapaneseNumberWithUnitParserConfiguration; + +}); + +unwrapExports(base$8); + +var currency$8 = createCommonjsModule(function (module, exports) { +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); + + + + +class JapaneseCurrencyExtractorConfiguration extends base$8.JapaneseNumberWithUnitExtractorConfiguration { + constructor(ci) { + if (!ci) { + ci = new recognizersTextNumber.CultureInfo(recognizersTextNumber.Culture.Japanese); + } + super(ci); + this.extractType = constants$2.Constants.SYS_UNIT_CURRENCY; + // Reference Source: https:// en.wikipedia.org/wiki/List_of_circulating_currencies + this.suffixList = japaneseNumericWithUnit.JapaneseNumericWithUnit.CurrencySuffixList; + this.prefixList = japaneseNumericWithUnit.JapaneseNumericWithUnit.CurrencyPrefixList; + this.ambiguousUnitList = japaneseNumericWithUnit.JapaneseNumericWithUnit.CurrencyAmbiguousValues; + + } +} +exports.JapaneseCurrencyExtractorConfiguration = JapaneseCurrencyExtractorConfiguration; +class JapaneseCurrencyParserConfiguration extends base$8.JapaneseNumberWithUnitParserConfiguration { + constructor(ci) { + if (!ci) { + ci = new recognizersTextNumber.CultureInfo(recognizersTextNumber.Culture.Japanese); + } + super(ci); + this.BindDictionary(japaneseNumericWithUnit.JapaneseNumericWithUnit.CurrencySuffixList); + this.BindDictionary(japaneseNumericWithUnit.JapaneseNumericWithUnit.CurrencyPrefixList); + } +} +exports.JapaneseCurrencyParserConfiguration = JapaneseCurrencyParserConfiguration; + +}); + +unwrapExports(currency$8); + +var age$8 = createCommonjsModule(function (module, exports) { +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); + + + + +class JapaneseAgeExtractorConfiguration extends base$8.JapaneseNumberWithUnitExtractorConfiguration { + constructor(ci) { + if (!ci) { + ci = new recognizersTextNumber.CultureInfo(recognizersTextNumber.Culture.Japanese); + } + super(ci); + this.extractType = constants$2.Constants.SYS_UNIT_AGE; + this.suffixList = japaneseNumericWithUnit.JapaneseNumericWithUnit.AgeSuffixList; + this.prefixList = new Map(); + this.ambiguousUnitList = japaneseNumericWithUnit.JapaneseNumericWithUnit.AgeAmbiguousValues; + } +} +exports.JapaneseAgeExtractorConfiguration = JapaneseAgeExtractorConfiguration; +class JapaneseAgeParserConfiguration extends base$8.JapaneseNumberWithUnitParserConfiguration { + constructor(ci) { + if (!ci) { + ci = new recognizersTextNumber.CultureInfo(recognizersTextNumber.Culture.Japanese); + } + super(ci); + this.BindDictionary(japaneseNumericWithUnit.JapaneseNumericWithUnit.AgeSuffixList); + } +} +exports.JapaneseAgeParserConfiguration = JapaneseAgeParserConfiguration; + +}); + +unwrapExports(age$8); + +var frenchNumericWithUnit = createCommonjsModule(function (module, exports) { +"use strict"; +// ------------------------------------------------------------------------------ +// +// This code was generated by a tool. +// Changes to this file may cause incorrect behavior and will be lost if +// the code is regenerated. +// +// ------------------------------------------------------------------------------ +Object.defineProperty(exports, "__esModule", { value: true }); +var FrenchNumericWithUnit; +(function (FrenchNumericWithUnit) { + FrenchNumericWithUnit.AgeSuffixList = new Map([["Ans", "ans"], ["Mois", "mois d'âge|mois d'age|mois"], ["Semaines", "semaine|semaines|semaines d'âge|semaines d'age"], ["Jour", "jours|jour"]]); + FrenchNumericWithUnit.AreaSuffixList = new Map([["Kilomètre carré", "km2|km^2|km²|kilomètres carrés|kilomètre carré"], ["Hectomètre carré", "hm2|hm^2|hm²|hectomètre carré|hectomètres carrés"], ["Décamètre carré", "dam2|dam^2|dam²|décamètre carré|décamètres carrés"], ["Mètre carré", "m2|m^2|m²|mètre carré|mètres carrés"], ["Décimètre carré", "dm2|dm^2|dm²|décimètre carré|décimètres carrés"], ["Centimètre carré", "cm2|cm^2|cm²|centimètre carré|centimètres carrés"], ["Millimètre carré", "mm2|mm^2|mm²|millimètre carré|millimètres carrés"], ["Pouce carré", "pouces2|po2|pouce carré|pouces carrés|in^2|in²|in2"], ["Pied carré", "pied carré|pieds carrés|pi2|pi^2|pi²"], ["Mile carré", "mile carré|miles carrés|mi2|mi^2|mi²"], ["Acre", "acre|acres"]]); + FrenchNumericWithUnit.CurrencySuffixList = new Map([["Abkhazie apsar", "abkhazie apsar|apsars"], ["Afghan afghani", "afghan afghani|؋|afn|afghanis|afghani"], ["Pul", "pul"], ["Euro", "euros|euro|€|eur|d'euros"], ["Cent", "cents|cent|-cents|-cent|sen"], ["lek Albanais", "lek albanais|leks|lek"], ["Qindarkë", "qindarkë|qindarkës|qindarke|qindarkes"], ["Kwanza angolais", "kwanza angolais|kz|aoa|kwanza|kwanzas"], ["Dram arménien", "dram arménien|drams arméniens"], ["Florins d'Aruba", "florins aruba|ƒ|awg"], ["Bangladeshi taka", "bangladeshi taka|৳|bdt|taka|takas|bangladeshi takas"], ["Paisa", "poisha|paisa"], ["Ngultrum bhoutanais", "ngultrum bhoutanais|nu.|btn"], ["Chetrum", "chetrums|chetrum"], ["Boliviano bolivien", "boliviano bolivien|bolivianos bolivien|bolivianos bolivie|boliviano bolivie|bob|bs."], ["Bosnie-Herzégovine mark convertible", "bosnie-herzégovine mark convertible|bosnie-et-herzégovine mark convertible|bam"], ["Fening", "fening|fenings"], ["Pula", "pula|bwp"], ["Thebe", "thebe"], ["Réal brésilien", "réal brésilien|réals brésilien|r$|brl|real bresil|reals bresilien"], ["Lev bulgare", "lev bulgare|levs bulgare|lv|bgn"], ["Stotinki búlgaro", "stotinki bulgare"], ["Riel cambodgien", "riel cambodgien|khr|៛"], ["Escudo du cap-vert", "escudo cap-verdien|cve"], ["Colon du costa rica", "colon du costa rica|colons du costa rica|crc|₡"], ["Colon du salvador", "colon du salvador|colons du salvador|svc"], ["Kuna croate", "kuna croate|kunas croate|kn|hrk"], ["Lipa", "lipa"], ["Couronne tchèque", "couronne tchèque|couronnes tchèque|czk|Kč"], ["Haléř", "haléř"], ["Nakfas érythréens", "nakfas érythréens|nfk|ern|nakfa érythréens"], ["Birr éthiopien", "birr éthiopien|birrs éthiopien|etb"], ["Dalasi gambienne", "gmd"], ["Butut", "bututs|butut"], ["Lari géorgien", "lari géorgie|lari géorgiens|gel|₾"], ["Tetri géorgien", "tetri géorgie|tetris géorgiens"], ["Cedi", "cedi|ghs|cedi ghanéen|gh₵"], ["Pesewa", "pesewa|pesewas"], ["Quetzal guatémaltèque", "quetzal guatémaltèque|gtq|quetzal|quetzales"], ["Gourdes haïtiennes", "gourdes haïtiennes|gourdes|htg|gourde haïtienne"], ["Lempira hondurien", "lempira hondurien|hnl"], ["Forint hongrois", "forint hongrois|huf|fg|forints hongrois"], ["Fillér", "fillér"], ["Rial iranien", "rial iranien|irr|rials iranien|rials iraniens"], ["Litas lituanien", "litas lituanien|ltl|lit lithuanien|litas lithuanie"], ["Yen Japonais", "yen japonais|yen japon|yens|jpy|yen|¥|-yen"], ["Tenge kazakh", "tenge kazakh|kzt"], ["Shilling kényan", "shilling kényan|sh|kes|shillings kényans"], ["Won coréen", "won coréen|won coréens|₩"], ["Won sud-coréen", "won sud-coréen|won sud coréen|won sud-coréens|krw"], ["Corée du nord won", "corée du nord won|corée nord won|kpw"], ["Som Kirghizie", "som kirghizie|kgs"], ["Sum Ouzbékistan", "sum ouzbékistan|sum ouzbeks|sum ouzbéks|uzs"], ["Kip laotien", "kip laotien|lak|₭n|₭"], ["Att", "att"], ["Loti", "loti|maloti|lsl"], ["Sente", "sente|lisente"], ["Rand sud-africain", "rand sud-africain|zar"], ["Pataca macanais", "pataca macanais|mop$|mop"], ["Avo", "avos|avo"], ["Dinar macédonien", "dinar macédonien|mkd|ден"], ["Deni", "deni"], ["Ariary malagache", "ariary malagache|mga"], ["Iraimbilanja", "Iraimbilanja"], ["Kwacha malawien", "kwacha malawien|mk|mwk"], ["Tambala", "Tambala"], ["Ringitt malaisien", "ringitt malaisien|rm|myr|ringitts malaisien"], ["Ouguiya mauritanienne", "ouguiya|um|mro|ouguiya mauritanien|ouguiya mauritanienne"], ["Khoums", "khoums"], ["Togrogs mongoles", "togrogs mongoles|togrogs|tugriks|tögrög|mnt|₮|tögrög mongoles|tögrög mongolie|togrogs mongolie"], ["Metical mozambique", "metical du mozambique|metical mozambique|mt|mzn|meticals mozambique"], ["Kyat birmanie", "kyat birmanie|ks|mmk"], ["Pya", "pya"], ["Cordoba nicaraguayen", "cordoba nicaraguayen|córdoba nicaraguayen|nio|córdoba oro|cordoba oro nicaraguayen"], ["Naira nigérians", "naira nigérians|naira|ngm|₦|nairas nigérians"], ["Livre turque", "livre turque|try|tl|livre turques"], ["Kuruş", "kuruş"], ["Rials omanais", "rials omanais|omr|ر.ع.|rial omanais"], ["Balboa panaméennes", "balboa panaméennes|balboa|pab"], ["Kina", "kina|pkg|pgk"], ["Toea", "toea"], ["Guaraní paraguayen", "guaraní paraguayen|₲|pyg"], ["Sol péruvien", "nuevo sol péruvien|soles|sol|sol péruvien"], ["Złoty polonais", "złoty polonais|złoty|zł|pln|zloty|zloty polonais"], ["Groxz", "groszy|grosz|grosze"], ["Riyal qatari", "riyal qatari|qar|riyals qatari"], ["Riyal saudi", "riyal saudi|sar|riyals saudi"], ["Riyal", "riyal|riyals|rial|﷼"], ["Dirham", "dirham|dirhem|dirhm"], ["Halala", "halalas|halala"], ["Tala", "tala|tālā|ws$|sat|wst"], ["Sene", "sene"], ["Dobra", "dobra|db|std"], ["Leone", "leone|sll"], ["Florins Néerlandais", "florins hollandais|florins néerlandais|florins|ang|ƒ|florin|fl |"], ["Lilangeni", "lilangeni|szl"], ["Somoni tadjikistan", "somoni tadjikistan|tjs|somoni"], ["Diram", "dirams|diram"], ["Baht thaïlandais", "baht thaïlandais|baht thailandais|baht thaï|baht thai|baht|฿|thb"], ["Satang", "satang|satangs"], ["Paʻanga", "paʻanga|pa'anga|top"], ["Hryvnia ukrainien", "hryvnia ukrainien|hyrvnia|uah|₴|hryvnias ukrainien|hryvnia ukrainienne"], ["Vanuatu vatu", "vanuatu vatu|vatu|vuv"], ["Bolívar vénézuélien", "bolívar vénézuélien|bolivar venezuelien|bs.f.|vef|bolívars vénézuélien|bolivars venezuelien"], ["Dong vietnamien", "dong vietnamien|dongs vietnamiens|dong|đồng|vnd|dông|dông vietnamiens"], ["Kwacha de Zambie", "kwacha de zambie|zk|zmw|kwachas"], ["Dirham marocain", "dirham marocain|mad|د.م."], ["Dirham des Émirats arabes unis", "dirham des Émirats arabes unis|د.إ|aed"], ["Manat azerbaïdjanais", "manat azerbaïdjanais|manat azerbaidjanais|azn"], ["Manat turkmène", "manat turkmène|tmt|manat turkmene"], ["Manat", "manats|manat"], ["Qəpik", "qəpik"], ["Shilling somalien", "shilling somalien|shillings somalien|sos"], ["Shilling tanzanien", "shilling tanzanien|shillings tanzanien|tzs|tsh|shilling tanzanienne|shillings tanzanienne"], ["Shilling ougandais", "shilling ougandais|shillings ougandais|sh|ugx"], ["Leu roumain", "leu roumain|lei|leu roumaine|ron"], ["Leu moldave", "leu meoldave|mdl"], ["Leu", "leu"], ["Ban", "bani|-ban|ban"], ["Roupie népalaise", "roupie népalaise|roupie nepalaise|npr"], ["Roupie pakistanaise", "roupie pakistanaise|pkr"], ["Roupie indienne", "roupie indienne|inr|roupie indien|inr|₹"], ["Roupie seychelloise", "roupie seychelloise|scr|sr|sre"], ["Roupie mauricienne", "roupie mauricienne|mur"], ["Rufiyaa maldives", "rufiyaa maldives|mvr|.ރ|rf"], ["Roupie srilankaise", "roupie srilankaise|lrk|රු|ரூ"], ["Rupiah Indonésie", "rupia indonésie|rupia indonesie|rupiah|rp|idr"], ["Roupie", "roupie"], ["Couronne danoise", "couronne danoise|dkk|couronnes danoise|couronne danemark|couronnes danemark"], ["Couronne norvégienne", "couronne norvégienne|couronne norvegienne|couronnes norvégienne|couronnes norvegienne|nok"], ["Couronne féroïenne", "couronne féroïenne|couronne feroienne"], ["Couronne suédoise", "couronne suédoise|couronne suéde|sek|couronnes suédoise|couronne suedoise"], ["Couronne", "couronne|couronnes"], ["Øre", "Øre|oyra|eyrir"], ["Franc CFA de l'Afrique de l'Ouest", "franc cfa de l''afrique de l''ouest|franc cfa ouest africain|franc cfa|francs cfa|fcfa|frs cfa|cfa francs|xof"], ["Franc CFA d'Afrique centrale", "franc cfa d''afrique centrale|franc cfa centrale|frs cfa centrale|xaf"], ["Franc comorien", "franc comorien|kmf"], ["Franc congolais", "franc congolais|cdf"], ["Franc burundais", "franc burundais|bif"], ["Franc djiboutienne", "franc djiboutienne|djf"], ["Franc CFP", "franc cfp|xpf"], ["Franc guinéen", "franc guinéen|gnf"], ["Franc Suisse", "franc suisse|chf|sfr.|francs suisses"], ["Franc rwandais", "franc rwandais|rwf|rw|r₣|frw"], ["Franc belge", "franc belge|bi.|b.fr.|bef"], ["Rappen", "rappen|-rappen"], ["Franc", "francs|franc|fr.|fs"], ["Centimes", "centimes|centime|santim"], ["Rouble russe", "rouble russe|rub|₽|₽ russe|roubles russe|roubles russes|₽ russes"], ["Nouveau rouble biélorusse", "nouveau rouble biélorusse|byn|nouveau roubles biélorusse|nouveau rouble bielorusse|nouveau roubles biélorusse"], ["Rouble transnistriens", "rouble transnistriens|prb"], ["Rouble biélorusses", "rouble biélorusses|roubles biélorusses|rouble bielorusses|roubles bielorusses"], ["Kopek", "kopek|kopeks"], ["Kapyeyka", "kapyeyka"], ["Rouble", "roubles|rouble|br"], ["Dinar algérien", "dinar algérien|د.ج|dzd|dinars algérien|dinar algerien|dinars algerien"], ["Dinar de bahreïn", "dinar de bahreïn|bhd|.د.ب|dinar de bahrein"], ["Santeem", "santeem|santeems"], ["Dinar iraquien", "dinar iraquien|dinars iraquien|iqd|ع.د|dinar iraquienne|dinars iraquienne"], ["Dinar jordanien", "dinar jordanien|dinars jordanien|د.ا|jod"], ["Dinar koweïtien", "dinar koweïtien|dinar koweitien|dinars koweïtien|kwd|د.ك"], ["Dinar libyen", "dinar libyen|dinars libyen|lyd"], ["Dinar serbe", "dinar serbe|dinars serbe|rsd|дин."], ["Dinar tunisien", "dinar tunisien|dinars tunisien|tnd"], ["Dinar yougoslave", "dinar yougoslave|dinars yougoslave|yun"], ["Dinar", "dinars|dinar|denar|-dinars|-dinar"], ["Fils", "fils|fulūs|-fils|-fil"], ["Para", "para|napa"], ["Millime", "millimes|millime"], ["Peso argentin", "peso argentin|ars|pesos argentin|peso argentine|pesos argentine"], ["Peso chilien", "peso chilien|pesos chilien|clp"], ["Peso colombien", "peso colombien|pesos colombien|cop|peso colombie|pesos colombien"], ["Peso cubains convertibles", "peso cubains convertibles|pesos cubains convertibles|cuc"], ["Peso cubains", "peso cubaines|pesos cubaines|peso cubaine|pesos cubaines|cup"], ["Peso dominicain", "peso dominicain|pesos dominicain|dop|peso dominicaine|pesos dominicaine"], ["Peso philippin", "peso philippin|pesos philippin|piso|₱|php"], ["Peso uruguayen", "peso uruguayen|pesos uruguayen|uyu"], ["Peso", "pesos|Peso"], ["Centavo", "centavos|Centavo"], ["Livre britannique", "livre britannique|livres britannique|gbp|£ britannique"], ["Livre guernesey", "livre guernesey|£ guernesey|ggp"], ["Livre ascension", "livre ascension|livres ascension|£ ascension"], ["Livre sainte-hélène", "livre de sainte-hélène|livre sainte-hélène|livre sainte-helene|livre de sainte hélène|shp"], ["Livre égyptienne", "livre égyptienne|livre egyptienne|egp|ج.م"], ["Livre des îles falkland", "livre des îles falkland|livre des iles falkland|fkp|£ iles falkland"], ["Livre gibraltar", "livre gibraltar|livre de gibraltar|£ gibraltar|gip"], ["Livre manx", "imp|livre manx|£ manx"], ["Livre jersey", "livre de jersey|livre jersey|jep|£ jersey"], ["Livre libanaise", "livre libanaise|£ libanaise|livres libanaise|lbp|ل.ل"], ["Livre des îles malouines", "livre des îles malouines|livre des iles malouines|£ iles malouines"], ["Livre sud-soudanaise", "livre sud-soudanaise|livre sud soudanaise|livre du soudan du sud|livres sud-soudanaises|livre sud soudan|livre soudan sud"], ["Livre soudanaise", "livre soudanaise|livres soudanaise|sdg|£ soudan|ج.س.|livre soudan|livres soudan"], ["Livre syrienne", "livre syrienne|ل.س|syp|livre syrie|livres syrie|£ syrie"], ["Livre", "livre|livres|-livre|-livres|£"], ["Pence", "pence"], ["Shilling", "shilling|shillings"], ["Penny", "penny|sou|centime"], ["Dollar Américain", "dollar américain|$ américain|$ americain|usd|$usd|$ usd|dollar americain|dollar États-Unis|dollar des États-Unis|dollar États Unis|dollar etats unis|dollar etats-unis|$ etats-unis|$ États-Unis"], ["Dollar des Caraïbes orientales", "dollar des caraïbes orientales|dollar des caraibes orientales|xcd|$ caraibes orientales|$ caraïbes orientales"], ["Dollar Australien", "dollar australien|dollars australiens|$ australien|aud|$australien|australien $|$ australie|dollar australie"], ["Dollar des bahamas", "dollar des bahamas|dollar bahamas|$ bahamas|bsd|bahama $|dollar bahama|$ bahamas"], ["Dollar bermudes", "dollar des bermudes|dollar bermude|dollar bermudes|$ bermudes|bmd"], ["Dollar belize", "dollar de Belize|dollar belizien|bzd|$ belize"], ["Dollar îles Vierges britanniques", "dollar îles vierges britanniques|dollar iles vierges britanniques|$ iles vierges britanniques"], ["Dollar brunei", "dollar de brunei|$ brunei|bnd|dollar brunei"], ["Sen", "sen"], ["Dollar singapour", "dollar de singapour|dollar singapour|$ sinapour|sgd|$s"], ["Dollar Canadien", "dollar canadien|dollars canadien|$ canadien|cad|$can|$c|$ c|dollar canada|dollar canadienne|$ canada|$cad|cad$"], ["Dollar iles caimanes", "dollars des îles caïmanes|dollar des îles caïmanes|dollars des iles caimanes|dollar iles caimanes|kyd|$ci"], ["Dollar néo-zélandais", "dollar néo-zélandais|dollar néo zélandais|dollar neo-zelandais|dollar neo zelandais|$nz|$ néo-zélandais|$ neo zelandais"], ["Dollar îles cook", "dollar îles cook|dollar iles cook|$ iles cook"], ["Dollar des fidji", "dollar des fidji|$ fidji|dollar fidji|dollar de fidji|dollars des fidji|dollars de fidji"], ["Dollar guyanien", "dollar guyanien|dollar du guyana|dollar dre guyana|$ guayana|gyd|$gy"], ["Dollar de Hong Kong", "dollar hong kong|dollar hongkong|dollar de hong kong|dollar de hongkong|$hk|$ hk|hkd|hk $|hk$|dollar hk|$hongkong|dollars hongkong|dollars hong kong"], ["Dollar jamaïcain", "dollar jamaïcain|dollars jamaïcain|dollar jamaicain|dollars jamaicain|$j|$ jamaïque|dollar jamaïque|jmd"], ["Dollar libérien", "dollar libérien|dollars libérien|dollar liberien|dollars liberien|lrd|$ libérien|$ liberia|$ liberien"], ["Dollar namibien", "dollar namibien|dollars namibien|$ namibien|nad|$n|dollar namibie|dollars namibie|$ namibie"], ["Dollar des îles salomon", "dollar des îles Salomon|dollar des iles salomon|$si|sbd|$ iles salomon|$ îles salomon"], ["Dollar du suriname", "dollar du suriname|srd|$ du suriname|$ suriname|dollar suriname|dollars suriname|dollars du suriname"], ["Nouveau dollar de Taïwan", "nouveau dollar de taïwan|nouveau dollar de taiwan|twd|ntd|$nt"], ["Dollar trinidadien", "dollar trinidadien|dollars trinidadien|ttd|$ trinidadien"], ["Dollar", "dollar|$|dollars"], ["Yuan Chinois", "yuan|yuans|yuan chinois|renminbi|cny|rmb|¥"], ["Fen", "fen"], ["Jiao", "jiao"], ["Mark Finlandais", "marks finlandais|mark finlandais|fim|mark"]]); + FrenchNumericWithUnit.CompoundUnitConnectorRegex = `(?[^.])`; + FrenchNumericWithUnit.CurrencyPrefixList = new Map([["Dollar", "$"], ["Dollar États-Unis", "$us|usd|us$"], ["Dollar Caraïbes orientales", "xcd|$ec"], ["Dollar australien", "a$|$a|aud"], ["Dollar bahamas", "bsd|b$"], ["Dollar barbadien", "bbd|bds$"], ["Dollar de belize", "bz$|bzd"], ["Dollar des bermudes", "bd$|bmd"], ["Dollar de brunei", "brunei $|bnd"], ["Dollar de Singapour", "s$|sgd"], ["Dollar Canadien", "cad|$ ca|$ca|$ c"], ["Dollar des îles Caïmans", "ci$|kyd"], ["Dollar néo-zélandais", "nz$|nzd"], ["Dollar de Fidji", "$fj|fjd"], ["Dolar guyanien", "g$|gyd"], ["Dollar de Hong Kong", "hkd|hk$"], ["Dollar jamaïcain", "j$|jmd"], ["Dollar libérien", "lrd|l$"], ["Dollar namibien", "nad|n$"], ["Dollar des îles Salomon", "$ si|$si|sbd"], ["Nouveau dollar de Taïwan", "nt$|twd"], ["Réal brésilien", "r$|brl|reais"], ["Guaraní paraguayen", "₲|gs.|pyg"], ["Dollar trinidadien", "ttd|titis"], ["Yuan renminbi", "cny|rmb|¥|元"], ["Yen", "¥|jpy"], ["Euro", "€|eur"], ["Pound", "£"], ["Florín", "ƒ"], ["Livre", "£|gbp"]]); + FrenchNumericWithUnit.AmbiguousCurrencyUnitList = ['din.', 'kina', 'lari', 'taka', 'tala', 'vatu', 'yuan', 'bob', 'btn', 'cop', 'cup', 'dop', 'gip', 'jod', 'kgs', 'lak', 'mga', 'mop', 'nad', 'omr', 'sar', 'sbd', 'scr', 'sdg', 'sek', 'sos', 'std', 'try', 'yer']; + FrenchNumericWithUnit.InformationSuffixList = new Map([["Bit", "-bit|bit|bits"], ["Kilobit", "kilobit|kilobits|kb|kbit|kbits"], ["Megabit", "megabit|megabits|Mb|Mbit|mégabit|mégabits"], ["Gigabit", "gigabit|gigabits|Gb|Gbit"], ["Terabit", "terabit|terabits|Tb|Tbit|térabit|térabits"], ["Petabit", "petabit|petabits|Pb|Pbit|pétabit|pétabits"], ["octet", "octet|octets|-octet"], ["Kilooctet", "kilo-octet|kilo-octets|kilooctet|kilooctets|ko|kio|kB|KiB|kilobyte|kilobytes"], ["Mégaoctet", "mégaoctet|mégaoctets|méga-octet|méga-octets|Mo|Mio|MB|mégabyte|mégabytes"], ["Gigaoctet", "gigaoctet|gigaoctets|Go|Gio|GB|GiB|gigabyte|gigabytes"], ["Téraoctet", "téraoctet|téraoctets|To|Tio|TB|TiB|térabyte|térabytes"], ["Pétaoctet", "pétaoctet|pétaoctets|Po|Pio|PB|PiB|pétabyte|pétabytes"]]); + FrenchNumericWithUnit.AmbiguousDimensionUnitList = ['mi', 'barils', 'grain', 'l', 'pierre', 'fps', 'pts']; + FrenchNumericWithUnit.BuildPrefix = `(?<=(\\s|^|\\P{L}))`; + FrenchNumericWithUnit.BuildSuffix = `(?=(\\s|\\P{L}|$))`; + FrenchNumericWithUnit.ConnectorToken = 'de'; + FrenchNumericWithUnit.LengthSuffixList = new Map([["Kilomètres", "km|kilomètres|kilomètre|kilometres|kilometre|-km"], ["Hectomètre", "hm|hectomètre|hectomètres|hectometre|hectometres|-hm"], ["Décamètre", "dam|décamètre|décamètres|decametre|decametres|-dm"], ["Mètres", "m|mètres|mètre|metres|metre|m.|-m"], ["Décimètres", "dm|décimètres|décimètre|decimetres|decimetre"], ["Centimètres", "cm|centimètres|centimètre|centimetres|centimetre"], ["Millimètres", "mm|millimètres|millimètre|millimetre|millimetres"], ["Micromètres", "µm|um|micromètres|micromètre|micrometres|micrometre"], ["Nanomètres", "nm|nanometre|nanometres|nanomètres|nanomètre"], ["Picomètres", "pm|picomètre|picomètres|picometres|picometre"], ["Mile", "mi|mile|miles"], ["Pied", "pied|pieds"], ["Yard", "yards|yard|yd"], ["Pouce", "pouce|pouces"]]); + FrenchNumericWithUnit.AmbiguousLengthUnitList = ['m', 'yard', 'yards', 'pm', 'pt', 'pts']; + FrenchNumericWithUnit.AmbuguousLengthUnitList = ['m', 'pouce', 'pm']; + FrenchNumericWithUnit.SpeedSuffixList = new Map([["Mètre par seconde", "m/s|metres/seconde|metres par seconde|metre par seconde|metres par secondes|mètre par seconde|mètres par seconde|mètres par secondes"], ["Kilomètre par heure", "km/h|kilomètre par heure|kilomètres par heure|kilomètres par heures|kilometres par heure|kilometre par heure"], ["Kilomètre par minute", "km/m|kilomètre par minute|kilomètres par minute|kilomètres par minutes|kilometre par minute|kilometre par minutes"], ["Kilomètre par seconde", "km/s|km à la seconde|km a la seconde|kilomètre par seconde|kilomètres par seconde|kilometre par seconde|kilometres par seconde"], ["Miles par heure", "mph|miles par heure|miles à l'heure|miles a l'heure|miles un heure"], ["Noeuds", "noeud|noeuds|nuds"], ["Pied par seconde", "ft/s|pied par seconde|pieds par seconde|pied/s|pieds/s"], ["Pied par minute", "pieds/minute|pied/minute|ft/minute|ft/min|pied/min"]]); + FrenchNumericWithUnit.TemperatureSuffixList = new Map([["Kelvin", "k|K|kelvin"], ["F", "°f|degres f|degrés f|deg f|° f|degrés fahrenheit|degres fahrenheit|fahrenheit"], ["R", "rankine|°r|° r"], ["C", "°c|deg c|degrés celsius|degrés c|degres celsius|celsius|deg celsius|degs celsius|centigrade|deg centigrade|degs centigrade|degrés centigrade|degres centigrade|degré centigrade|degre centigrade"], ["Degré", "degrés|degres|deg.|°| °|degré|degre|deg"]]); + FrenchNumericWithUnit.VolumeSuffixList = new Map([["Mètre cube", "m3|m^3|m³|mètre cube|mètres cube|metre cube|metres cube"], ["Centimètre cube", "cm3|cm^3|cm³|centimètre cube|centimètres cube|centimetre cube|centimetres cube"], ["Millimètre cube", "mm3|mm^3|mm³|millimètre cube|millimètres cube|millimetre cube|millimetres cube"], ["Kilomètre cube", "km3|km^3|km³|kilomètre cube|kilomètres cube|kilometre cube|kilometres cube"], ["Pieds cube", "pieds cubes|pieds cube|pied cube|pied cubes"], ["Litre", "litre|litres|lts|l"], ["Millilitre", "ml|millilitre|millilitres"], ["Gallon", "gallon|gallons"], ["Pintes", "pintes"], ["Onces", "onces|once|oz"], ["Décilitre", "dl|décilitre|decilitre|décilitres|decilitres"], ["Centilitre", "cl|centilitres|centilitre"], ["Onces liquides", "onces liquides|once liquide|once liquides"], ["Baril", "baril|barils|bbl"]]); + FrenchNumericWithUnit.AmbiguousVolumeUnitList = ['ounce', 'oz', 'l', 'cup', 'peck', 'cord', 'gill']; + FrenchNumericWithUnit.WeightSuffixList = new Map([["Kilogramme", "kg|kilogramme|kilogrammes|kilo|kilos"], ["Gram", "g|gramme|grammes"], ["Milligramme", "mg|milligramme|milligrammes"], ["Tonne métrique", "tonne métrique|tonnes métrique|tonnes métriques|tonne metrique|tonnes metrique"], ["Tonne", "tonne|tonnes|-tonnes|-tonne"], ["Livre", "livre|livres"]]); + FrenchNumericWithUnit.AmbiguousWeightUnitList = ['g', 'oz', 'stone', 'dram']; +})(FrenchNumericWithUnit = exports.FrenchNumericWithUnit || (exports.FrenchNumericWithUnit = {})); + +}); + +unwrapExports(frenchNumericWithUnit); + +var base$10 = createCommonjsModule(function (module, exports) { +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); + + + + + +class FrenchNumberWithUnitExtractorConfiguration { + constructor(ci) { + this.cultureInfo = ci; + this.unitNumExtractor = new recognizersTextNumber.FrenchNumberExtractor(); + this.buildPrefix = frenchNumericWithUnit.FrenchNumericWithUnit.BuildPrefix; + this.buildSuffix = frenchNumericWithUnit.FrenchNumericWithUnit.BuildSuffix; + this.connectorToken = frenchNumericWithUnit.FrenchNumericWithUnit.ConnectorToken; + this.compoundUnitConnectorRegex = recognizersText.RegExpUtility.getSafeRegExp(frenchNumericWithUnit.FrenchNumericWithUnit.CompoundUnitConnectorRegex); + this.pmNonUnitRegex = recognizersText.RegExpUtility.getSafeRegExp(baseUnits.BaseUnits.PmNonUnitRegex); + } +} +exports.FrenchNumberWithUnitExtractorConfiguration = FrenchNumberWithUnitExtractorConfiguration; +class FrenchNumberWithUnitParserConfiguration extends parsers$4.BaseNumberWithUnitParserConfiguration { + constructor(ci) { + super(ci); + this.internalNumberExtractor = new recognizersTextNumber.FrenchNumberExtractor(recognizersTextNumber.NumberMode.Default); + this.internalNumberParser = recognizersTextNumber.AgnosticNumberParserFactory.getParser(recognizersTextNumber.AgnosticNumberParserType.Number, new recognizersTextNumber.FrenchNumberParserConfiguration()); + this.connectorToken = frenchNumericWithUnit.FrenchNumericWithUnit.ConnectorToken; + } +} +exports.FrenchNumberWithUnitParserConfiguration = FrenchNumberWithUnitParserConfiguration; + +}); + +unwrapExports(base$10); + +var currency$10 = createCommonjsModule(function (module, exports) { +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); + + + + +class FrenchCurrencyExtractorConfiguration extends base$10.FrenchNumberWithUnitExtractorConfiguration { + constructor(ci) { + if (!ci) { + ci = new recognizersTextNumber.CultureInfo(recognizersTextNumber.Culture.French); + } + super(ci); + this.extractType = constants$2.Constants.SYS_UNIT_CURRENCY; + // Reference Source: https:// en.wikipedia.org/wiki/List_of_circulating_currencies + this.suffixList = frenchNumericWithUnit.FrenchNumericWithUnit.CurrencySuffixList; + this.prefixList = frenchNumericWithUnit.FrenchNumericWithUnit.CurrencyPrefixList; + this.ambiguousUnitList = frenchNumericWithUnit.FrenchNumericWithUnit.AmbiguousCurrencyUnitList; + } +} +exports.FrenchCurrencyExtractorConfiguration = FrenchCurrencyExtractorConfiguration; +class FrenchCurrencyParserConfiguration extends base$10.FrenchNumberWithUnitParserConfiguration { + constructor(ci) { + if (!ci) { + ci = new recognizersTextNumber.CultureInfo(recognizersTextNumber.Culture.French); + } + super(ci); + this.BindDictionary(frenchNumericWithUnit.FrenchNumericWithUnit.CurrencySuffixList); + this.BindDictionary(frenchNumericWithUnit.FrenchNumericWithUnit.CurrencyPrefixList); + } +} +exports.FrenchCurrencyParserConfiguration = FrenchCurrencyParserConfiguration; + +}); + +unwrapExports(currency$10); + +var temperature$8 = createCommonjsModule(function (module, exports) { +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); + + + + +class FrenchTemperatureExtractorConfiguration extends base$10.FrenchNumberWithUnitExtractorConfiguration { + constructor(ci) { + if (!ci) { + ci = new recognizersTextNumber.CultureInfo(recognizersTextNumber.Culture.French); + } + super(ci); + this.extractType = constants$2.Constants.SYS_UNIT_TEMPERATURE; + this.suffixList = frenchNumericWithUnit.FrenchNumericWithUnit.TemperatureSuffixList; + this.prefixList = new Map(); + this.ambiguousUnitList = new Array(); + } +} +exports.FrenchTemperatureExtractorConfiguration = FrenchTemperatureExtractorConfiguration; +class FrenchTemperatureParserConfiguration extends base$10.FrenchNumberWithUnitParserConfiguration { + constructor(ci) { + if (!ci) { + ci = new recognizersTextNumber.CultureInfo(recognizersTextNumber.Culture.French); + } + super(ci); + this.connectorToken = null; + this.BindDictionary(frenchNumericWithUnit.FrenchNumericWithUnit.TemperatureSuffixList); + } +} +exports.FrenchTemperatureParserConfiguration = FrenchTemperatureParserConfiguration; + +}); + +unwrapExports(temperature$8); + +var dimension$8 = createCommonjsModule(function (module, exports) { +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); + + + + +const dimensionSuffixList = new Map([ + ...frenchNumericWithUnit.FrenchNumericWithUnit.InformationSuffixList, + ...frenchNumericWithUnit.FrenchNumericWithUnit.AreaSuffixList, + ...frenchNumericWithUnit.FrenchNumericWithUnit.LengthSuffixList, + ...frenchNumericWithUnit.FrenchNumericWithUnit.SpeedSuffixList, + ...frenchNumericWithUnit.FrenchNumericWithUnit.VolumeSuffixList, + ...frenchNumericWithUnit.FrenchNumericWithUnit.WeightSuffixList +]); +class FrenchDimensionExtractorConfiguration extends base$10.FrenchNumberWithUnitExtractorConfiguration { + constructor(ci) { + if (!ci) { + ci = new recognizersTextNumber.CultureInfo(recognizersTextNumber.Culture.French); + } + super(ci); + this.extractType = constants$2.Constants.SYS_UNIT_DIMENSION; + this.suffixList = dimensionSuffixList; + this.prefixList = new Map(); + this.ambiguousUnitList = frenchNumericWithUnit.FrenchNumericWithUnit.AmbiguousDimensionUnitList; + } +} +exports.FrenchDimensionExtractorConfiguration = FrenchDimensionExtractorConfiguration; +class FrenchDimensionParserConfiguration extends base$10.FrenchNumberWithUnitParserConfiguration { + constructor(ci) { + if (!ci) { + ci = new recognizersTextNumber.CultureInfo(recognizersTextNumber.Culture.French); + } + super(ci); + this.BindDictionary(dimensionSuffixList); + } +} +exports.FrenchDimensionParserConfiguration = FrenchDimensionParserConfiguration; + +}); + +unwrapExports(dimension$8); + +var age$10 = createCommonjsModule(function (module, exports) { +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); + + + + +class FrenchAgeExtractorConfiguration extends base$10.FrenchNumberWithUnitExtractorConfiguration { + constructor(ci) { + if (!ci) { + ci = new recognizersTextNumber.CultureInfo(recognizersTextNumber.Culture.French); + } + super(ci); + this.extractType = constants$2.Constants.SYS_UNIT_AGE; + this.suffixList = frenchNumericWithUnit.FrenchNumericWithUnit.AgeSuffixList; + this.prefixList = new Map(); + this.ambiguousUnitList = new Array(); + } +} +exports.FrenchAgeExtractorConfiguration = FrenchAgeExtractorConfiguration; +class FrenchAgeParserConfiguration extends base$10.FrenchNumberWithUnitParserConfiguration { + constructor(ci) { + if (!ci) { + ci = new recognizersTextNumber.CultureInfo(recognizersTextNumber.Culture.French); + } + super(ci); + this.BindDictionary(frenchNumericWithUnit.FrenchNumericWithUnit.AgeSuffixList); + } +} +exports.FrenchAgeParserConfiguration = FrenchAgeParserConfiguration; + +}); + +unwrapExports(age$10); + +var numberWithUnitRecognizer = createCommonjsModule(function (module, exports) { +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); + + + + + + + + + + + + + + + + + + + + + + + + + + + +var NumberWithUnitOptions; +(function (NumberWithUnitOptions) { + NumberWithUnitOptions[NumberWithUnitOptions["None"] = 0] = "None"; +})(NumberWithUnitOptions = exports.NumberWithUnitOptions || (exports.NumberWithUnitOptions = {})); +function recognizeCurrency(query, culture, options = NumberWithUnitOptions.None, fallbackToDefaultCulture = true) { + return recognizeByModel(recognizer => recognizer.getCurrencyModel(culture, fallbackToDefaultCulture), query, culture, options); +} +exports.recognizeCurrency = recognizeCurrency; +function recognizeTemperature(query, culture, options = NumberWithUnitOptions.None, fallbackToDefaultCulture = true) { + return recognizeByModel(recognizer => recognizer.getTemperatureModel(culture, fallbackToDefaultCulture), query, culture, options); +} +exports.recognizeTemperature = recognizeTemperature; +function recognizeDimension(query, culture, options = NumberWithUnitOptions.None, fallbackToDefaultCulture = true) { + return recognizeByModel(recognizer => recognizer.getDimensionModel(culture, fallbackToDefaultCulture), query, culture, options); +} +exports.recognizeDimension = recognizeDimension; +function recognizeAge(query, culture, options = NumberWithUnitOptions.None, fallbackToDefaultCulture = true) { + return recognizeByModel(recognizer => recognizer.getAgeModel(culture, fallbackToDefaultCulture), query, culture, options); +} +exports.recognizeAge = recognizeAge; +function recognizeByModel(getModelFunc, query, culture, options) { + let recognizer = new NumberWithUnitRecognizer(culture, options); + let model = getModelFunc(recognizer); + return model.parse(query); +} +class NumberWithUnitRecognizer extends recognizersText.Recognizer { + constructor(culture, options = NumberWithUnitOptions.None, lazyInitialization = false) { + super(culture, options, lazyInitialization); + } + InitializeConfiguration() { + //#region English + this.registerModel("CurrencyModel", recognizersTextNumber.Culture.English, (options) => new models$4.CurrencyModel(new Map([ + [new extractors$16.BaseMergedUnitExtractor(new currency.EnglishCurrencyExtractorConfiguration()), new parsers$4.BaseMergedUnitParser(new currency.EnglishCurrencyParserConfiguration())] + ]))); + this.registerModel("TemperatureModel", recognizersTextNumber.Culture.English, (options) => new models$4.TemperatureModel(new Map([ + [new extractors$16.NumberWithUnitExtractor(new temperature.EnglishTemperatureExtractorConfiguration()), new parsers$4.NumberWithUnitParser(new temperature.EnglishTemperatureParserConfiguration())] + ]))); + this.registerModel("DimensionModel", recognizersTextNumber.Culture.English, (options) => new models$4.DimensionModel(new Map([ + [new extractors$16.NumberWithUnitExtractor(new dimension.EnglishDimensionExtractorConfiguration()), new parsers$4.NumberWithUnitParser(new dimension.EnglishDimensionParserConfiguration())] + ]))); + this.registerModel("AgeModel", recognizersTextNumber.Culture.English, (options) => new models$4.AgeModel(new Map([ + [new extractors$16.NumberWithUnitExtractor(new age.EnglishAgeExtractorConfiguration()), new parsers$4.NumberWithUnitParser(new age.EnglishAgeParserConfiguration())] + ]))); + //#endregion + //#region Spanish + this.registerModel("CurrencyModel", recognizersTextNumber.Culture.Spanish, (options) => new models$4.CurrencyModel(new Map([ + [new extractors$16.NumberWithUnitExtractor(new currency$2.SpanishCurrencyExtractorConfiguration()), new parsers$4.NumberWithUnitParser(new currency$2.SpanishCurrencyParserConfiguration())] + ]))); + this.registerModel("TemperatureModel", recognizersTextNumber.Culture.Spanish, (options) => new models$4.TemperatureModel(new Map([ + [new extractors$16.NumberWithUnitExtractor(new temperature$2.SpanishTemperatureExtractorConfiguration()), new parsers$4.NumberWithUnitParser(new temperature$2.SpanishTemperatureParserConfiguration())] + ]))); + this.registerModel("DimensionModel", recognizersTextNumber.Culture.Spanish, (options) => new models$4.DimensionModel(new Map([ + [new extractors$16.NumberWithUnitExtractor(new dimension$2.SpanishDimensionExtractorConfiguration()), new parsers$4.NumberWithUnitParser(new dimension$2.SpanishDimensionParserConfiguration())] + ]))); + this.registerModel("AgeModel", recognizersTextNumber.Culture.Spanish, (options) => new models$4.AgeModel(new Map([ + [new extractors$16.NumberWithUnitExtractor(new age$2.SpanishAgeExtractorConfiguration()), new parsers$4.NumberWithUnitParser(new age$2.SpanishAgeParserConfiguration())] + ]))); + //#endregion + //#region Portuguese + this.registerModel("CurrencyModel", recognizersTextNumber.Culture.Portuguese, (options) => new models$4.CurrencyModel(new Map([ + [new extractors$16.NumberWithUnitExtractor(new currency$4.PortugueseCurrencyExtractorConfiguration()), new parsers$4.NumberWithUnitParser(new currency$4.PortugueseCurrencyParserConfiguration())] + ]))); + this.registerModel("TemperatureModel", recognizersTextNumber.Culture.Portuguese, (options) => new models$4.TemperatureModel(new Map([ + [new extractors$16.NumberWithUnitExtractor(new temperature$4.PortugueseTemperatureExtractorConfiguration()), new parsers$4.NumberWithUnitParser(new temperature$4.PortugueseTemperatureParserConfiguration())] + ]))); + this.registerModel("DimensionModel", recognizersTextNumber.Culture.Portuguese, (options) => new models$4.DimensionModel(new Map([ + [new extractors$16.NumberWithUnitExtractor(new dimension$4.PortugueseDimensionExtractorConfiguration()), new parsers$4.NumberWithUnitParser(new dimension$4.PortugueseDimensionParserConfiguration())] + ]))); + this.registerModel("AgeModel", recognizersTextNumber.Culture.Portuguese, (options) => new models$4.AgeModel(new Map([ + [new extractors$16.NumberWithUnitExtractor(new age$4.PortugueseAgeExtractorConfiguration()), new parsers$4.NumberWithUnitParser(new age$4.PortugueseAgeParserConfiguration())] + ]))); + //#endregion + //#region Chinese + this.registerModel("CurrencyModel", recognizersTextNumber.Culture.Chinese, (options) => new models$4.CurrencyModel(new Map([ + [new extractors$16.BaseMergedUnitExtractor(new currency$6.ChineseCurrencyExtractorConfiguration()), new parsers$4.BaseMergedUnitParser(new currency$6.ChineseCurrencyParserConfiguration())], + [new extractors$16.NumberWithUnitExtractor(new currency.EnglishCurrencyExtractorConfiguration()), new parsers$4.NumberWithUnitParser(new currency.EnglishCurrencyParserConfiguration())] + ]))); + this.registerModel("TemperatureModel", recognizersTextNumber.Culture.Chinese, (options) => new models$4.TemperatureModel(new Map([ + [new extractors$16.NumberWithUnitExtractor(new temperature$6.ChineseTemperatureExtractorConfiguration()), new parsers$4.NumberWithUnitParser(new temperature$6.ChineseTemperatureParserConfiguration())], + [new extractors$16.NumberWithUnitExtractor(new temperature.EnglishTemperatureExtractorConfiguration()), new parsers$4.NumberWithUnitParser(new temperature.EnglishTemperatureParserConfiguration())] + ]))); + this.registerModel("DimensionModel", recognizersTextNumber.Culture.Chinese, (options) => new models$4.DimensionModel(new Map([ + [new extractors$16.NumberWithUnitExtractor(new dimension$6.ChineseDimensionExtractorConfiguration()), new parsers$4.NumberWithUnitParser(new dimension$6.ChineseDimensionParserConfiguration())], + [new extractors$16.NumberWithUnitExtractor(new dimension.EnglishDimensionExtractorConfiguration()), new parsers$4.NumberWithUnitParser(new dimension.EnglishDimensionParserConfiguration())] + ]))); + this.registerModel("AgeModel", recognizersTextNumber.Culture.Chinese, (options) => new models$4.AgeModel(new Map([ + [new extractors$16.NumberWithUnitExtractor(new age$6.ChineseAgeExtractorConfiguration()), new parsers$4.NumberWithUnitParser(new age$6.ChineseAgeParserConfiguration())], + [new extractors$16.NumberWithUnitExtractor(new age.EnglishAgeExtractorConfiguration()), new parsers$4.NumberWithUnitParser(new age.EnglishAgeParserConfiguration())] + ]))); + //#endregion + //#region Japanese + this.registerModel("CurrencyModel", recognizersTextNumber.Culture.Japanese, (options) => new models$4.CurrencyModel(new Map([ + [new extractors$16.BaseMergedUnitExtractor(new currency$8.JapaneseCurrencyExtractorConfiguration()), new parsers$4.BaseMergedUnitParser(new currency$8.JapaneseCurrencyParserConfiguration())], + [new extractors$16.NumberWithUnitExtractor(new currency.EnglishCurrencyExtractorConfiguration()), new parsers$4.NumberWithUnitParser(new currency.EnglishCurrencyParserConfiguration())] + ]))); + this.registerModel("AgeModel", recognizersTextNumber.Culture.Japanese, (options) => new models$4.AgeModel(new Map([ + [new extractors$16.NumberWithUnitExtractor(new age$8.JapaneseAgeExtractorConfiguration()), new parsers$4.NumberWithUnitParser(new age$8.JapaneseAgeParserConfiguration())], + [new extractors$16.NumberWithUnitExtractor(new age.EnglishAgeExtractorConfiguration()), new parsers$4.NumberWithUnitParser(new age.EnglishAgeParserConfiguration())] + ]))); + //#endregion + //#region French + this.registerModel("CurrencyModel", recognizersTextNumber.Culture.French, (options) => new models$4.CurrencyModel(new Map([ + [new extractors$16.NumberWithUnitExtractor(new currency$10.FrenchCurrencyExtractorConfiguration()), new parsers$4.NumberWithUnitParser(new currency$10.FrenchCurrencyParserConfiguration())] + ]))); + this.registerModel("TemperatureModel", recognizersTextNumber.Culture.French, (options) => new models$4.TemperatureModel(new Map([ + [new extractors$16.NumberWithUnitExtractor(new temperature$8.FrenchTemperatureExtractorConfiguration()), new parsers$4.NumberWithUnitParser(new temperature$8.FrenchTemperatureParserConfiguration())] + ]))); + this.registerModel("DimensionModel", recognizersTextNumber.Culture.French, (options) => new models$4.DimensionModel(new Map([ + [new extractors$16.NumberWithUnitExtractor(new dimension$8.FrenchDimensionExtractorConfiguration()), new parsers$4.NumberWithUnitParser(new dimension$8.FrenchDimensionParserConfiguration())] + ]))); + this.registerModel("AgeModel", recognizersTextNumber.Culture.French, (options) => new models$4.AgeModel(new Map([ + [new extractors$16.NumberWithUnitExtractor(new age$10.FrenchAgeExtractorConfiguration()), new parsers$4.NumberWithUnitParser(new age$10.FrenchAgeParserConfiguration())] + ]))); + //#endregion + } + IsValidOptions(options) { + return options >= 0 && options <= NumberWithUnitOptions.None; + } + getCurrencyModel(culture = null, fallbackToDefaultCulture = true) { + return this.getModel("CurrencyModel", culture, fallbackToDefaultCulture); + } + getTemperatureModel(culture = null, fallbackToDefaultCulture = true) { + return this.getModel("TemperatureModel", culture, fallbackToDefaultCulture); + } + getDimensionModel(culture = null, fallbackToDefaultCulture = true) { + return this.getModel("DimensionModel", culture, fallbackToDefaultCulture); + } + getAgeModel(culture = null, fallbackToDefaultCulture = true) { + return this.getModel("AgeModel", culture, fallbackToDefaultCulture); + } +} +exports.default = NumberWithUnitRecognizer; + +}); + +unwrapExports(numberWithUnitRecognizer); + +var recognizersTextNumberWithUnit = createCommonjsModule(function (module, exports) { +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); + +exports.NumberWithUnitRecognizer = numberWithUnitRecognizer.default; +exports.NumberWithUnitOptions = numberWithUnitRecognizer.NumberWithUnitOptions; +exports.recognizeTemperature = numberWithUnitRecognizer.recognizeTemperature; +exports.recognizeDimension = numberWithUnitRecognizer.recognizeDimension; +exports.recognizeCurrency = numberWithUnitRecognizer.recognizeCurrency; +exports.recognizeAge = numberWithUnitRecognizer.recognizeAge; + +exports.Culture = recognizersTextNumber.Culture; +exports.CultureInfo = recognizersTextNumber.CultureInfo; + +exports.Constants = constants$2.Constants; + +exports.NumberWithUnitExtractor = extractors$16.NumberWithUnitExtractor; +exports.PrefixUnitResult = extractors$16.PrefixUnitResult; +exports.BaseMergedUnitExtractor = extractors$16.BaseMergedUnitExtractor; + +exports.CompositeEntityType = models$4.CompositeEntityType; +exports.AbstractNumberWithUnitModel = models$4.AbstractNumberWithUnitModel; +exports.AgeModel = models$4.AgeModel; +exports.CurrencyModel = models$4.CurrencyModel; +exports.DimensionModel = models$4.DimensionModel; +exports.TemperatureModel = models$4.TemperatureModel; + +exports.UnitValue = parsers$4.UnitValue; +exports.UnitValueIso = parsers$4.UnitValueIso; +exports.NumberWithUnitParser = parsers$4.NumberWithUnitParser; +exports.BaseNumberWithUnitParserConfiguration = parsers$4.BaseNumberWithUnitParserConfiguration; +exports.BaseCurrencyParser = parsers$4.BaseCurrencyParser; +exports.BaseMergedUnitParser = parsers$4.BaseMergedUnitParser; + +exports.EnglishAgeExtractorConfiguration = age.EnglishAgeExtractorConfiguration; +exports.EnglishAgeParserConfiguration = age.EnglishAgeParserConfiguration; + +exports.EnglishNumberWithUnitExtractorConfiguration = base.EnglishNumberWithUnitExtractorConfiguration; +exports.EnglishNumberWithUnitParserConfiguration = base.EnglishNumberWithUnitParserConfiguration; + +exports.EnglishCurrencyExtractorConfiguration = currency.EnglishCurrencyExtractorConfiguration; +exports.EnglishCurrencyParserConfiguration = currency.EnglishCurrencyParserConfiguration; + +exports.EnglishDimensionExtractorConfiguration = dimension.EnglishDimensionExtractorConfiguration; +exports.EnglishDimensionParserConfiguration = dimension.EnglishDimensionParserConfiguration; + +exports.EnglishTemperatureExtractorConfiguration = temperature.EnglishTemperatureExtractorConfiguration; +exports.EnglishTemperatureParserConfiguration = temperature.EnglishTemperatureParserConfiguration; + +exports.SpanishAgeExtractorConfiguration = age$2.SpanishAgeExtractorConfiguration; +exports.SpanishAgeParserConfiguration = age$2.SpanishAgeParserConfiguration; + +exports.SpanishNumberWithUnitExtractorConfiguration = base$2.SpanishNumberWithUnitExtractorConfiguration; +exports.SpanishNumberWithUnitParserConfiguration = base$2.SpanishNumberWithUnitParserConfiguration; + +exports.SpanishCurrencyExtractorConfiguration = currency$2.SpanishCurrencyExtractorConfiguration; +exports.SpanishCurrencyParserConfiguration = currency$2.SpanishCurrencyParserConfiguration; + +exports.SpanishDimensionExtractorConfiguration = dimension$2.SpanishDimensionExtractorConfiguration; +exports.SpanishDimensionParserConfiguration = dimension$2.SpanishDimensionParserConfiguration; + +exports.SpanishTemperatureExtractorConfiguration = temperature$2.SpanishTemperatureExtractorConfiguration; +exports.SpanishTemperatureParserConfiguration = temperature$2.SpanishTemperatureParserConfiguration; + +exports.PortugueseAgeExtractorConfiguration = age$4.PortugueseAgeExtractorConfiguration; +exports.PortugueseAgeParserConfiguration = age$4.PortugueseAgeParserConfiguration; + +exports.PortugueseNumberWithUnitExtractorConfiguration = base$4.PortugueseNumberWithUnitExtractorConfiguration; +exports.PortugueseNumberWithUnitParserConfiguration = base$4.PortugueseNumberWithUnitParserConfiguration; + +exports.PortugueseCurrencyExtractorConfiguration = currency$4.PortugueseCurrencyExtractorConfiguration; +exports.PortugueseCurrencyParserConfiguration = currency$4.PortugueseCurrencyParserConfiguration; + +exports.PortugueseDimensionExtractorConfiguration = dimension$4.PortugueseDimensionExtractorConfiguration; +exports.PortugueseDimensionParserConfiguration = dimension$4.PortugueseDimensionParserConfiguration; + +exports.PortugueseTemperatureExtractorConfiguration = temperature$4.PortugueseTemperatureExtractorConfiguration; +exports.PortugueseTemperatureParserConfiguration = temperature$4.PortugueseTemperatureParserConfiguration; + +exports.ChineseAgeExtractorConfiguration = age$6.ChineseAgeExtractorConfiguration; +exports.ChineseAgeParserConfiguration = age$6.ChineseAgeParserConfiguration; + +exports.ChineseNumberWithUnitExtractorConfiguration = base$6.ChineseNumberWithUnitExtractorConfiguration; +exports.ChineseNumberWithUnitParserConfiguration = base$6.ChineseNumberWithUnitParserConfiguration; + +exports.ChineseCurrencyExtractorConfiguration = currency$6.ChineseCurrencyExtractorConfiguration; +exports.ChineseCurrencyParserConfiguration = currency$6.ChineseCurrencyParserConfiguration; + +exports.ChineseDimensionExtractorConfiguration = dimension$6.ChineseDimensionExtractorConfiguration; +exports.ChineseDimensionParserConfiguration = dimension$6.ChineseDimensionParserConfiguration; + +exports.ChineseTemperatureExtractorConfiguration = temperature$6.ChineseTemperatureExtractorConfiguration; +exports.ChineseTemperatureParserConfiguration = temperature$6.ChineseTemperatureParserConfiguration; + +exports.JapaneseAgeExtractorConfiguration = age$8.JapaneseAgeExtractorConfiguration; +exports.JapaneseAgeParserConfiguration = age$8.JapaneseAgeParserConfiguration; + +exports.JapaneseNumberWithUnitExtractorConfiguration = base$8.JapaneseNumberWithUnitExtractorConfiguration; +exports.JapaneseNumberWithUnitParserConfiguration = base$8.JapaneseNumberWithUnitParserConfiguration; + +exports.JapaneseCurrencyExtractorConfiguration = currency$8.JapaneseCurrencyExtractorConfiguration; +exports.JapaneseCurrencyParserConfiguration = currency$8.JapaneseCurrencyParserConfiguration; + +exports.EnglishNumericWithUnit = englishNumericWithUnit.EnglishNumericWithUnit; + +exports.SpanishNumericWithUnit = spanishNumericWithUnit.SpanishNumericWithUnit; + +exports.PortugueseNumericWithUnit = portugueseNumericWithUnit.PortugueseNumericWithUnit; + +exports.ChineseNumericWithUnit = chineseNumericWithUnit.ChineseNumericWithUnit; + +exports.JapaneseNumericWithUnit = japaneseNumericWithUnit.JapaneseNumericWithUnit; + +}); + +var recognizersTextNumberWithUnit$1 = unwrapExports(recognizersTextNumberWithUnit); +var recognizersTextNumberWithUnit_1 = recognizersTextNumberWithUnit.NumberWithUnitRecognizer; +var recognizersTextNumberWithUnit_2 = recognizersTextNumberWithUnit.NumberWithUnitOptions; +var recognizersTextNumberWithUnit_3 = recognizersTextNumberWithUnit.recognizeTemperature; +var recognizersTextNumberWithUnit_4 = recognizersTextNumberWithUnit.recognizeDimension; +var recognizersTextNumberWithUnit_5 = recognizersTextNumberWithUnit.recognizeCurrency; +var recognizersTextNumberWithUnit_6 = recognizersTextNumberWithUnit.recognizeAge; +var recognizersTextNumberWithUnit_7 = recognizersTextNumberWithUnit.Culture; +var recognizersTextNumberWithUnit_8 = recognizersTextNumberWithUnit.CultureInfo; +var recognizersTextNumberWithUnit_9 = recognizersTextNumberWithUnit.Constants; +var recognizersTextNumberWithUnit_10 = recognizersTextNumberWithUnit.NumberWithUnitExtractor; +var recognizersTextNumberWithUnit_11 = recognizersTextNumberWithUnit.PrefixUnitResult; +var recognizersTextNumberWithUnit_12 = recognizersTextNumberWithUnit.BaseMergedUnitExtractor; +var recognizersTextNumberWithUnit_13 = recognizersTextNumberWithUnit.CompositeEntityType; +var recognizersTextNumberWithUnit_14 = recognizersTextNumberWithUnit.AbstractNumberWithUnitModel; +var recognizersTextNumberWithUnit_15 = recognizersTextNumberWithUnit.AgeModel; +var recognizersTextNumberWithUnit_16 = recognizersTextNumberWithUnit.CurrencyModel; +var recognizersTextNumberWithUnit_17 = recognizersTextNumberWithUnit.DimensionModel; +var recognizersTextNumberWithUnit_18 = recognizersTextNumberWithUnit.TemperatureModel; +var recognizersTextNumberWithUnit_19 = recognizersTextNumberWithUnit.UnitValue; +var recognizersTextNumberWithUnit_20 = recognizersTextNumberWithUnit.UnitValueIso; +var recognizersTextNumberWithUnit_21 = recognizersTextNumberWithUnit.NumberWithUnitParser; +var recognizersTextNumberWithUnit_22 = recognizersTextNumberWithUnit.BaseNumberWithUnitParserConfiguration; +var recognizersTextNumberWithUnit_23 = recognizersTextNumberWithUnit.BaseCurrencyParser; +var recognizersTextNumberWithUnit_24 = recognizersTextNumberWithUnit.BaseMergedUnitParser; +var recognizersTextNumberWithUnit_25 = recognizersTextNumberWithUnit.EnglishAgeExtractorConfiguration; +var recognizersTextNumberWithUnit_26 = recognizersTextNumberWithUnit.EnglishAgeParserConfiguration; +var recognizersTextNumberWithUnit_27 = recognizersTextNumberWithUnit.EnglishNumberWithUnitExtractorConfiguration; +var recognizersTextNumberWithUnit_28 = recognizersTextNumberWithUnit.EnglishNumberWithUnitParserConfiguration; +var recognizersTextNumberWithUnit_29 = recognizersTextNumberWithUnit.EnglishCurrencyExtractorConfiguration; +var recognizersTextNumberWithUnit_30 = recognizersTextNumberWithUnit.EnglishCurrencyParserConfiguration; +var recognizersTextNumberWithUnit_31 = recognizersTextNumberWithUnit.EnglishDimensionExtractorConfiguration; +var recognizersTextNumberWithUnit_32 = recognizersTextNumberWithUnit.EnglishDimensionParserConfiguration; +var recognizersTextNumberWithUnit_33 = recognizersTextNumberWithUnit.EnglishTemperatureExtractorConfiguration; +var recognizersTextNumberWithUnit_34 = recognizersTextNumberWithUnit.EnglishTemperatureParserConfiguration; +var recognizersTextNumberWithUnit_35 = recognizersTextNumberWithUnit.SpanishAgeExtractorConfiguration; +var recognizersTextNumberWithUnit_36 = recognizersTextNumberWithUnit.SpanishAgeParserConfiguration; +var recognizersTextNumberWithUnit_37 = recognizersTextNumberWithUnit.SpanishNumberWithUnitExtractorConfiguration; +var recognizersTextNumberWithUnit_38 = recognizersTextNumberWithUnit.SpanishNumberWithUnitParserConfiguration; +var recognizersTextNumberWithUnit_39 = recognizersTextNumberWithUnit.SpanishCurrencyExtractorConfiguration; +var recognizersTextNumberWithUnit_40 = recognizersTextNumberWithUnit.SpanishCurrencyParserConfiguration; +var recognizersTextNumberWithUnit_41 = recognizersTextNumberWithUnit.SpanishDimensionExtractorConfiguration; +var recognizersTextNumberWithUnit_42 = recognizersTextNumberWithUnit.SpanishDimensionParserConfiguration; +var recognizersTextNumberWithUnit_43 = recognizersTextNumberWithUnit.SpanishTemperatureExtractorConfiguration; +var recognizersTextNumberWithUnit_44 = recognizersTextNumberWithUnit.SpanishTemperatureParserConfiguration; +var recognizersTextNumberWithUnit_45 = recognizersTextNumberWithUnit.PortugueseAgeExtractorConfiguration; +var recognizersTextNumberWithUnit_46 = recognizersTextNumberWithUnit.PortugueseAgeParserConfiguration; +var recognizersTextNumberWithUnit_47 = recognizersTextNumberWithUnit.PortugueseNumberWithUnitExtractorConfiguration; +var recognizersTextNumberWithUnit_48 = recognizersTextNumberWithUnit.PortugueseNumberWithUnitParserConfiguration; +var recognizersTextNumberWithUnit_49 = recognizersTextNumberWithUnit.PortugueseCurrencyExtractorConfiguration; +var recognizersTextNumberWithUnit_50 = recognizersTextNumberWithUnit.PortugueseCurrencyParserConfiguration; +var recognizersTextNumberWithUnit_51 = recognizersTextNumberWithUnit.PortugueseDimensionExtractorConfiguration; +var recognizersTextNumberWithUnit_52 = recognizersTextNumberWithUnit.PortugueseDimensionParserConfiguration; +var recognizersTextNumberWithUnit_53 = recognizersTextNumberWithUnit.PortugueseTemperatureExtractorConfiguration; +var recognizersTextNumberWithUnit_54 = recognizersTextNumberWithUnit.PortugueseTemperatureParserConfiguration; +var recognizersTextNumberWithUnit_55 = recognizersTextNumberWithUnit.ChineseAgeExtractorConfiguration; +var recognizersTextNumberWithUnit_56 = recognizersTextNumberWithUnit.ChineseAgeParserConfiguration; +var recognizersTextNumberWithUnit_57 = recognizersTextNumberWithUnit.ChineseNumberWithUnitExtractorConfiguration; +var recognizersTextNumberWithUnit_58 = recognizersTextNumberWithUnit.ChineseNumberWithUnitParserConfiguration; +var recognizersTextNumberWithUnit_59 = recognizersTextNumberWithUnit.ChineseCurrencyExtractorConfiguration; +var recognizersTextNumberWithUnit_60 = recognizersTextNumberWithUnit.ChineseCurrencyParserConfiguration; +var recognizersTextNumberWithUnit_61 = recognizersTextNumberWithUnit.ChineseDimensionExtractorConfiguration; +var recognizersTextNumberWithUnit_62 = recognizersTextNumberWithUnit.ChineseDimensionParserConfiguration; +var recognizersTextNumberWithUnit_63 = recognizersTextNumberWithUnit.ChineseTemperatureExtractorConfiguration; +var recognizersTextNumberWithUnit_64 = recognizersTextNumberWithUnit.ChineseTemperatureParserConfiguration; +var recognizersTextNumberWithUnit_65 = recognizersTextNumberWithUnit.JapaneseAgeExtractorConfiguration; +var recognizersTextNumberWithUnit_66 = recognizersTextNumberWithUnit.JapaneseAgeParserConfiguration; +var recognizersTextNumberWithUnit_67 = recognizersTextNumberWithUnit.JapaneseNumberWithUnitExtractorConfiguration; +var recognizersTextNumberWithUnit_68 = recognizersTextNumberWithUnit.JapaneseNumberWithUnitParserConfiguration; +var recognizersTextNumberWithUnit_69 = recognizersTextNumberWithUnit.JapaneseCurrencyExtractorConfiguration; +var recognizersTextNumberWithUnit_70 = recognizersTextNumberWithUnit.JapaneseCurrencyParserConfiguration; +var recognizersTextNumberWithUnit_71 = recognizersTextNumberWithUnit.EnglishNumericWithUnit; +var recognizersTextNumberWithUnit_72 = recognizersTextNumberWithUnit.SpanishNumericWithUnit; +var recognizersTextNumberWithUnit_73 = recognizersTextNumberWithUnit.PortugueseNumericWithUnit; +var recognizersTextNumberWithUnit_74 = recognizersTextNumberWithUnit.ChineseNumericWithUnit; +var recognizersTextNumberWithUnit_75 = recognizersTextNumberWithUnit.JapaneseNumericWithUnit; + +exports['default'] = recognizersTextNumberWithUnit$1; +exports.NumberWithUnitRecognizer = recognizersTextNumberWithUnit_1; +exports.NumberWithUnitOptions = recognizersTextNumberWithUnit_2; +exports.recognizeTemperature = recognizersTextNumberWithUnit_3; +exports.recognizeDimension = recognizersTextNumberWithUnit_4; +exports.recognizeCurrency = recognizersTextNumberWithUnit_5; +exports.recognizeAge = recognizersTextNumberWithUnit_6; +exports.Culture = recognizersTextNumberWithUnit_7; +exports.CultureInfo = recognizersTextNumberWithUnit_8; +exports.Constants = recognizersTextNumberWithUnit_9; +exports.NumberWithUnitExtractor = recognizersTextNumberWithUnit_10; +exports.PrefixUnitResult = recognizersTextNumberWithUnit_11; +exports.BaseMergedUnitExtractor = recognizersTextNumberWithUnit_12; +exports.CompositeEntityType = recognizersTextNumberWithUnit_13; +exports.AbstractNumberWithUnitModel = recognizersTextNumberWithUnit_14; +exports.AgeModel = recognizersTextNumberWithUnit_15; +exports.CurrencyModel = recognizersTextNumberWithUnit_16; +exports.DimensionModel = recognizersTextNumberWithUnit_17; +exports.TemperatureModel = recognizersTextNumberWithUnit_18; +exports.UnitValue = recognizersTextNumberWithUnit_19; +exports.UnitValueIso = recognizersTextNumberWithUnit_20; +exports.NumberWithUnitParser = recognizersTextNumberWithUnit_21; +exports.BaseNumberWithUnitParserConfiguration = recognizersTextNumberWithUnit_22; +exports.BaseCurrencyParser = recognizersTextNumberWithUnit_23; +exports.BaseMergedUnitParser = recognizersTextNumberWithUnit_24; +exports.EnglishAgeExtractorConfiguration = recognizersTextNumberWithUnit_25; +exports.EnglishAgeParserConfiguration = recognizersTextNumberWithUnit_26; +exports.EnglishNumberWithUnitExtractorConfiguration = recognizersTextNumberWithUnit_27; +exports.EnglishNumberWithUnitParserConfiguration = recognizersTextNumberWithUnit_28; +exports.EnglishCurrencyExtractorConfiguration = recognizersTextNumberWithUnit_29; +exports.EnglishCurrencyParserConfiguration = recognizersTextNumberWithUnit_30; +exports.EnglishDimensionExtractorConfiguration = recognizersTextNumberWithUnit_31; +exports.EnglishDimensionParserConfiguration = recognizersTextNumberWithUnit_32; +exports.EnglishTemperatureExtractorConfiguration = recognizersTextNumberWithUnit_33; +exports.EnglishTemperatureParserConfiguration = recognizersTextNumberWithUnit_34; +exports.SpanishAgeExtractorConfiguration = recognizersTextNumberWithUnit_35; +exports.SpanishAgeParserConfiguration = recognizersTextNumberWithUnit_36; +exports.SpanishNumberWithUnitExtractorConfiguration = recognizersTextNumberWithUnit_37; +exports.SpanishNumberWithUnitParserConfiguration = recognizersTextNumberWithUnit_38; +exports.SpanishCurrencyExtractorConfiguration = recognizersTextNumberWithUnit_39; +exports.SpanishCurrencyParserConfiguration = recognizersTextNumberWithUnit_40; +exports.SpanishDimensionExtractorConfiguration = recognizersTextNumberWithUnit_41; +exports.SpanishDimensionParserConfiguration = recognizersTextNumberWithUnit_42; +exports.SpanishTemperatureExtractorConfiguration = recognizersTextNumberWithUnit_43; +exports.SpanishTemperatureParserConfiguration = recognizersTextNumberWithUnit_44; +exports.PortugueseAgeExtractorConfiguration = recognizersTextNumberWithUnit_45; +exports.PortugueseAgeParserConfiguration = recognizersTextNumberWithUnit_46; +exports.PortugueseNumberWithUnitExtractorConfiguration = recognizersTextNumberWithUnit_47; +exports.PortugueseNumberWithUnitParserConfiguration = recognizersTextNumberWithUnit_48; +exports.PortugueseCurrencyExtractorConfiguration = recognizersTextNumberWithUnit_49; +exports.PortugueseCurrencyParserConfiguration = recognizersTextNumberWithUnit_50; +exports.PortugueseDimensionExtractorConfiguration = recognizersTextNumberWithUnit_51; +exports.PortugueseDimensionParserConfiguration = recognizersTextNumberWithUnit_52; +exports.PortugueseTemperatureExtractorConfiguration = recognizersTextNumberWithUnit_53; +exports.PortugueseTemperatureParserConfiguration = recognizersTextNumberWithUnit_54; +exports.ChineseAgeExtractorConfiguration = recognizersTextNumberWithUnit_55; +exports.ChineseAgeParserConfiguration = recognizersTextNumberWithUnit_56; +exports.ChineseNumberWithUnitExtractorConfiguration = recognizersTextNumberWithUnit_57; +exports.ChineseNumberWithUnitParserConfiguration = recognizersTextNumberWithUnit_58; +exports.ChineseCurrencyExtractorConfiguration = recognizersTextNumberWithUnit_59; +exports.ChineseCurrencyParserConfiguration = recognizersTextNumberWithUnit_60; +exports.ChineseDimensionExtractorConfiguration = recognizersTextNumberWithUnit_61; +exports.ChineseDimensionParserConfiguration = recognizersTextNumberWithUnit_62; +exports.ChineseTemperatureExtractorConfiguration = recognizersTextNumberWithUnit_63; +exports.ChineseTemperatureParserConfiguration = recognizersTextNumberWithUnit_64; +exports.JapaneseAgeExtractorConfiguration = recognizersTextNumberWithUnit_65; +exports.JapaneseAgeParserConfiguration = recognizersTextNumberWithUnit_66; +exports.JapaneseNumberWithUnitExtractorConfiguration = recognizersTextNumberWithUnit_67; +exports.JapaneseNumberWithUnitParserConfiguration = recognizersTextNumberWithUnit_68; +exports.JapaneseCurrencyExtractorConfiguration = recognizersTextNumberWithUnit_69; +exports.JapaneseCurrencyParserConfiguration = recognizersTextNumberWithUnit_70; +exports.EnglishNumericWithUnit = recognizersTextNumberWithUnit_71; +exports.SpanishNumericWithUnit = recognizersTextNumberWithUnit_72; +exports.PortugueseNumericWithUnit = recognizersTextNumberWithUnit_73; +exports.ChineseNumericWithUnit = recognizersTextNumberWithUnit_74; +exports.JapaneseNumericWithUnit = recognizersTextNumberWithUnit_75; + +Object.defineProperty(exports, '__esModule', { value: true }); + +}))); +//# sourceMappingURL=recognizers-text-number-with-unit.umd.js.map diff --git a/libraries/botbuilder-stdlib/vendors/@microsoft/recognizers-text-number-with-unit/dist/types/numberWithUnit/chinese/age.d.ts b/libraries/botbuilder-stdlib/vendors/@microsoft/recognizers-text-number-with-unit/dist/types/numberWithUnit/chinese/age.d.ts new file mode 100644 index 0000000000..379572c1a8 --- /dev/null +++ b/libraries/botbuilder-stdlib/vendors/@microsoft/recognizers-text-number-with-unit/dist/types/numberWithUnit/chinese/age.d.ts @@ -0,0 +1,12 @@ +import { CultureInfo } from "botbuilder-stdlib/vendors/@microsoft/recognizers-text-number"; +import { ChineseNumberWithUnitExtractorConfiguration, ChineseNumberWithUnitParserConfiguration } from "./base"; +export declare class ChineseAgeExtractorConfiguration extends ChineseNumberWithUnitExtractorConfiguration { + readonly suffixList: ReadonlyMap; + readonly prefixList: ReadonlyMap; + readonly ambiguousUnitList: ReadonlyArray; + readonly extractType: string; + constructor(ci?: CultureInfo); +} +export declare class ChineseAgeParserConfiguration extends ChineseNumberWithUnitParserConfiguration { + constructor(ci?: CultureInfo); +} diff --git a/libraries/botbuilder-stdlib/vendors/@microsoft/recognizers-text-number-with-unit/dist/types/numberWithUnit/chinese/base.d.ts b/libraries/botbuilder-stdlib/vendors/@microsoft/recognizers-text-number-with-unit/dist/types/numberWithUnit/chinese/base.d.ts new file mode 100644 index 0000000000..a51826a27a --- /dev/null +++ b/libraries/botbuilder-stdlib/vendors/@microsoft/recognizers-text-number-with-unit/dist/types/numberWithUnit/chinese/base.d.ts @@ -0,0 +1,26 @@ +import { IExtractor, IParser } from "botbuilder-stdlib/vendors/@microsoft/recognizers-text"; +import { CultureInfo } from "botbuilder-stdlib/vendors/@microsoft/recognizers-text-number"; +import { INumberWithUnitExtractorConfiguration } from "../extractors"; +import { BaseNumberWithUnitParserConfiguration } from "../parsers"; +export declare abstract class ChineseNumberWithUnitExtractorConfiguration implements INumberWithUnitExtractorConfiguration { + readonly abstract suffixList: ReadonlyMap; + readonly abstract prefixList: ReadonlyMap; + readonly abstract ambiguousUnitList: ReadonlyArray; + readonly abstract extractType: string; + readonly cultureInfo: CultureInfo; + readonly unitNumExtractor: IExtractor; + readonly buildPrefix: string; + readonly buildSuffix: string; + readonly connectorToken: string; + readonly compoundUnitConnectorRegex: RegExp; + readonly pmNonUnitRegex: RegExp; + constructor(ci: CultureInfo); +} +export declare class ChineseNumberWithUnitParserConfiguration extends BaseNumberWithUnitParserConfiguration { + readonly internalNumberParser: IParser; + readonly internalNumberExtractor: IExtractor; + readonly connectorToken: string; + readonly currencyNameToIsoCodeMap: ReadonlyMap; + readonly currencyFractionCodeList: ReadonlyMap; + constructor(ci: CultureInfo); +} diff --git a/libraries/botbuilder-stdlib/vendors/@microsoft/recognizers-text-number-with-unit/dist/types/numberWithUnit/chinese/currency.d.ts b/libraries/botbuilder-stdlib/vendors/@microsoft/recognizers-text-number-with-unit/dist/types/numberWithUnit/chinese/currency.d.ts new file mode 100644 index 0000000000..5b04437027 --- /dev/null +++ b/libraries/botbuilder-stdlib/vendors/@microsoft/recognizers-text-number-with-unit/dist/types/numberWithUnit/chinese/currency.d.ts @@ -0,0 +1,12 @@ +import { CultureInfo } from "botbuilder-stdlib/vendors/@microsoft/recognizers-text-number"; +import { ChineseNumberWithUnitExtractorConfiguration, ChineseNumberWithUnitParserConfiguration } from "./base"; +export declare class ChineseCurrencyExtractorConfiguration extends ChineseNumberWithUnitExtractorConfiguration { + readonly suffixList: ReadonlyMap; + readonly prefixList: ReadonlyMap; + readonly ambiguousUnitList: ReadonlyArray; + readonly extractType: string; + constructor(ci?: CultureInfo); +} +export declare class ChineseCurrencyParserConfiguration extends ChineseNumberWithUnitParserConfiguration { + constructor(ci?: CultureInfo); +} diff --git a/libraries/botbuilder-stdlib/vendors/@microsoft/recognizers-text-number-with-unit/dist/types/numberWithUnit/chinese/dimension.d.ts b/libraries/botbuilder-stdlib/vendors/@microsoft/recognizers-text-number-with-unit/dist/types/numberWithUnit/chinese/dimension.d.ts new file mode 100644 index 0000000000..f1c8d55746 --- /dev/null +++ b/libraries/botbuilder-stdlib/vendors/@microsoft/recognizers-text-number-with-unit/dist/types/numberWithUnit/chinese/dimension.d.ts @@ -0,0 +1,12 @@ +import { CultureInfo } from "botbuilder-stdlib/vendors/@microsoft/recognizers-text-number"; +import { ChineseNumberWithUnitExtractorConfiguration, ChineseNumberWithUnitParserConfiguration } from "./base"; +export declare class ChineseDimensionExtractorConfiguration extends ChineseNumberWithUnitExtractorConfiguration { + readonly suffixList: ReadonlyMap; + readonly prefixList: ReadonlyMap; + readonly ambiguousUnitList: ReadonlyArray; + readonly extractType: string; + constructor(ci?: CultureInfo); +} +export declare class ChineseDimensionParserConfiguration extends ChineseNumberWithUnitParserConfiguration { + constructor(ci?: CultureInfo); +} diff --git a/libraries/botbuilder-stdlib/vendors/@microsoft/recognizers-text-number-with-unit/dist/types/numberWithUnit/chinese/temperature.d.ts b/libraries/botbuilder-stdlib/vendors/@microsoft/recognizers-text-number-with-unit/dist/types/numberWithUnit/chinese/temperature.d.ts new file mode 100644 index 0000000000..be3d756c08 --- /dev/null +++ b/libraries/botbuilder-stdlib/vendors/@microsoft/recognizers-text-number-with-unit/dist/types/numberWithUnit/chinese/temperature.d.ts @@ -0,0 +1,12 @@ +import { CultureInfo } from "botbuilder-stdlib/vendors/@microsoft/recognizers-text-number"; +import { ChineseNumberWithUnitExtractorConfiguration, ChineseNumberWithUnitParserConfiguration } from "./base"; +export declare class ChineseTemperatureExtractorConfiguration extends ChineseNumberWithUnitExtractorConfiguration { + readonly suffixList: ReadonlyMap; + readonly prefixList: ReadonlyMap; + readonly ambiguousUnitList: ReadonlyArray; + readonly extractType: string; + constructor(ci?: CultureInfo); +} +export declare class ChineseTemperatureParserConfiguration extends ChineseNumberWithUnitParserConfiguration { + constructor(ci?: CultureInfo); +} diff --git a/libraries/botbuilder-stdlib/vendors/@microsoft/recognizers-text-number-with-unit/dist/types/numberWithUnit/constants.d.ts b/libraries/botbuilder-stdlib/vendors/@microsoft/recognizers-text-number-with-unit/dist/types/numberWithUnit/constants.d.ts new file mode 100644 index 0000000000..0f9ce42583 --- /dev/null +++ b/libraries/botbuilder-stdlib/vendors/@microsoft/recognizers-text-number-with-unit/dist/types/numberWithUnit/constants.d.ts @@ -0,0 +1,15 @@ +export declare class Constants { + static readonly SYS_UNIT: string; + static readonly SYS_UNIT_DIMENSION: string; + static readonly SYS_UNIT_AGE: string; + static readonly SYS_UNIT_AREA: string; + static readonly SYS_UNIT_CURRENCY: string; + static readonly SYS_UNIT_LENGTH: string; + static readonly SYS_UNIT_SPEED: string; + static readonly SYS_UNIT_TEMPERATURE: string; + static readonly SYS_UNIT_VOLUME: string; + static readonly SYS_UNIT_WEIGHT: string; + static readonly SYS_NUM: string; + static readonly AMBIGUOUS_TIME_TERM: string; + static readonly FAKE_ISO_CODE_PREFIX: string; +} diff --git a/libraries/botbuilder-stdlib/vendors/@microsoft/recognizers-text-number-with-unit/dist/types/numberWithUnit/english/age.d.ts b/libraries/botbuilder-stdlib/vendors/@microsoft/recognizers-text-number-with-unit/dist/types/numberWithUnit/english/age.d.ts new file mode 100644 index 0000000000..6c7128fa2d --- /dev/null +++ b/libraries/botbuilder-stdlib/vendors/@microsoft/recognizers-text-number-with-unit/dist/types/numberWithUnit/english/age.d.ts @@ -0,0 +1,12 @@ +import { CultureInfo } from "botbuilder-stdlib/vendors/@microsoft/recognizers-text-number"; +import { EnglishNumberWithUnitExtractorConfiguration, EnglishNumberWithUnitParserConfiguration } from "./base"; +export declare class EnglishAgeExtractorConfiguration extends EnglishNumberWithUnitExtractorConfiguration { + readonly suffixList: ReadonlyMap; + readonly prefixList: ReadonlyMap; + readonly ambiguousUnitList: ReadonlyArray; + readonly extractType: string; + constructor(ci?: CultureInfo); +} +export declare class EnglishAgeParserConfiguration extends EnglishNumberWithUnitParserConfiguration { + constructor(ci?: CultureInfo); +} diff --git a/libraries/botbuilder-stdlib/vendors/@microsoft/recognizers-text-number-with-unit/dist/types/numberWithUnit/english/base.d.ts b/libraries/botbuilder-stdlib/vendors/@microsoft/recognizers-text-number-with-unit/dist/types/numberWithUnit/english/base.d.ts new file mode 100644 index 0000000000..14fd95d353 --- /dev/null +++ b/libraries/botbuilder-stdlib/vendors/@microsoft/recognizers-text-number-with-unit/dist/types/numberWithUnit/english/base.d.ts @@ -0,0 +1,26 @@ +import { IExtractor, IParser } from "botbuilder-stdlib/vendors/@microsoft/recognizers-text"; +import { CultureInfo } from "botbuilder-stdlib/vendors/@microsoft/recognizers-text-number"; +import { INumberWithUnitExtractorConfiguration } from "../extractors"; +import { BaseNumberWithUnitParserConfiguration } from "../parsers"; +export declare abstract class EnglishNumberWithUnitExtractorConfiguration implements INumberWithUnitExtractorConfiguration { + readonly abstract suffixList: ReadonlyMap; + readonly abstract prefixList: ReadonlyMap; + readonly abstract ambiguousUnitList: ReadonlyArray; + readonly abstract extractType: string; + readonly cultureInfo: CultureInfo; + readonly unitNumExtractor: IExtractor; + readonly buildPrefix: string; + readonly buildSuffix: string; + readonly connectorToken: string; + readonly compoundUnitConnectorRegex: RegExp; + readonly pmNonUnitRegex: RegExp; + constructor(ci: CultureInfo); +} +export declare class EnglishNumberWithUnitParserConfiguration extends BaseNumberWithUnitParserConfiguration { + readonly internalNumberParser: IParser; + readonly internalNumberExtractor: IExtractor; + readonly connectorToken: string; + readonly currencyNameToIsoCodeMap: ReadonlyMap; + readonly currencyFractionCodeList: ReadonlyMap; + constructor(ci: CultureInfo); +} diff --git a/libraries/botbuilder-stdlib/vendors/@microsoft/recognizers-text-number-with-unit/dist/types/numberWithUnit/english/currency.d.ts b/libraries/botbuilder-stdlib/vendors/@microsoft/recognizers-text-number-with-unit/dist/types/numberWithUnit/english/currency.d.ts new file mode 100644 index 0000000000..7a7b4ea484 --- /dev/null +++ b/libraries/botbuilder-stdlib/vendors/@microsoft/recognizers-text-number-with-unit/dist/types/numberWithUnit/english/currency.d.ts @@ -0,0 +1,12 @@ +import { CultureInfo } from "botbuilder-stdlib/vendors/@microsoft/recognizers-text-number"; +import { EnglishNumberWithUnitExtractorConfiguration, EnglishNumberWithUnitParserConfiguration } from "./base"; +export declare class EnglishCurrencyExtractorConfiguration extends EnglishNumberWithUnitExtractorConfiguration { + readonly suffixList: ReadonlyMap; + readonly prefixList: ReadonlyMap; + readonly ambiguousUnitList: ReadonlyArray; + readonly extractType: string; + constructor(ci?: CultureInfo); +} +export declare class EnglishCurrencyParserConfiguration extends EnglishNumberWithUnitParserConfiguration { + constructor(ci?: CultureInfo); +} diff --git a/libraries/botbuilder-stdlib/vendors/@microsoft/recognizers-text-number-with-unit/dist/types/numberWithUnit/english/dimension.d.ts b/libraries/botbuilder-stdlib/vendors/@microsoft/recognizers-text-number-with-unit/dist/types/numberWithUnit/english/dimension.d.ts new file mode 100644 index 0000000000..095b77ee98 --- /dev/null +++ b/libraries/botbuilder-stdlib/vendors/@microsoft/recognizers-text-number-with-unit/dist/types/numberWithUnit/english/dimension.d.ts @@ -0,0 +1,12 @@ +import { CultureInfo } from "botbuilder-stdlib/vendors/@microsoft/recognizers-text-number"; +import { EnglishNumberWithUnitExtractorConfiguration, EnglishNumberWithUnitParserConfiguration } from "./base"; +export declare class EnglishDimensionExtractorConfiguration extends EnglishNumberWithUnitExtractorConfiguration { + readonly suffixList: ReadonlyMap; + readonly prefixList: ReadonlyMap; + readonly ambiguousUnitList: ReadonlyArray; + readonly extractType: string; + constructor(ci?: CultureInfo); +} +export declare class EnglishDimensionParserConfiguration extends EnglishNumberWithUnitParserConfiguration { + constructor(ci?: CultureInfo); +} diff --git a/libraries/botbuilder-stdlib/vendors/@microsoft/recognizers-text-number-with-unit/dist/types/numberWithUnit/english/temperature.d.ts b/libraries/botbuilder-stdlib/vendors/@microsoft/recognizers-text-number-with-unit/dist/types/numberWithUnit/english/temperature.d.ts new file mode 100644 index 0000000000..0d16015ec7 --- /dev/null +++ b/libraries/botbuilder-stdlib/vendors/@microsoft/recognizers-text-number-with-unit/dist/types/numberWithUnit/english/temperature.d.ts @@ -0,0 +1,12 @@ +import { CultureInfo } from "botbuilder-stdlib/vendors/@microsoft/recognizers-text-number"; +import { EnglishNumberWithUnitExtractorConfiguration, EnglishNumberWithUnitParserConfiguration } from "./base"; +export declare class EnglishTemperatureExtractorConfiguration extends EnglishNumberWithUnitExtractorConfiguration { + readonly suffixList: ReadonlyMap; + readonly prefixList: ReadonlyMap; + readonly ambiguousUnitList: ReadonlyArray; + readonly extractType: string; + constructor(ci?: CultureInfo); +} +export declare class EnglishTemperatureParserConfiguration extends EnglishNumberWithUnitParserConfiguration { + constructor(ci?: CultureInfo); +} diff --git a/libraries/botbuilder-stdlib/vendors/@microsoft/recognizers-text-number-with-unit/dist/types/numberWithUnit/extractors.d.ts b/libraries/botbuilder-stdlib/vendors/@microsoft/recognizers-text-number-with-unit/dist/types/numberWithUnit/extractors.d.ts new file mode 100644 index 0000000000..135993f2ab --- /dev/null +++ b/libraries/botbuilder-stdlib/vendors/@microsoft/recognizers-text-number-with-unit/dist/types/numberWithUnit/extractors.d.ts @@ -0,0 +1,43 @@ +import { IExtractor, ExtractResult } from "botbuilder-stdlib/vendors/@microsoft/recognizers-text"; +import { CultureInfo } from "botbuilder-stdlib/vendors/@microsoft/recognizers-text-number"; +export interface INumberWithUnitExtractorConfiguration { + readonly suffixList: ReadonlyMap; + readonly prefixList: ReadonlyMap; + readonly ambiguousUnitList: ReadonlyArray; + readonly extractType: string; + readonly cultureInfo: CultureInfo; + readonly unitNumExtractor: IExtractor; + readonly buildPrefix: string; + readonly buildSuffix: string; + readonly connectorToken: string; + readonly compoundUnitConnectorRegex: RegExp; + readonly pmNonUnitRegex: RegExp; +} +export declare class NumberWithUnitExtractor implements IExtractor { + private readonly config; + private readonly suffixRegexes; + private readonly prefixRegexes; + private readonly separateRegex; + private readonly maxPrefixMatchLen; + constructor(config: INumberWithUnitExtractorConfiguration); + extract(source: string): Array; + validateUnit(source: string): boolean; + protected preCheckStr(str: string): number; + protected extractSeparateUnits(source: string, numDependResults: Array): void; + protected buildRegexFromSet(collection: Array, ignoreCase?: boolean): Set; + protected buildSeparateRegexFromSet(ignoreCase?: boolean): RegExp; + protected dinoComparer(x: string, y: string): number; + private isDimensionFallsInTime(dimension, time); +} +export declare class BaseMergedUnitExtractor implements IExtractor { + private readonly config; + private readonly innerExtractor; + constructor(config: INumberWithUnitExtractorConfiguration); + extract(source: string): Array; + private mergeCompoundUnits(source); + private MergePureNumber(source, result); +} +export declare class PrefixUnitResult { + offset: number; + unitString: string; +} diff --git a/libraries/botbuilder-stdlib/vendors/@microsoft/recognizers-text-number-with-unit/dist/types/numberWithUnit/french/age.d.ts b/libraries/botbuilder-stdlib/vendors/@microsoft/recognizers-text-number-with-unit/dist/types/numberWithUnit/french/age.d.ts new file mode 100644 index 0000000000..e98818cd0c --- /dev/null +++ b/libraries/botbuilder-stdlib/vendors/@microsoft/recognizers-text-number-with-unit/dist/types/numberWithUnit/french/age.d.ts @@ -0,0 +1,12 @@ +import { CultureInfo } from "botbuilder-stdlib/vendors/@microsoft/recognizers-text-number"; +import { FrenchNumberWithUnitExtractorConfiguration, FrenchNumberWithUnitParserConfiguration } from "./base"; +export declare class FrenchAgeExtractorConfiguration extends FrenchNumberWithUnitExtractorConfiguration { + readonly suffixList: ReadonlyMap; + readonly prefixList: ReadonlyMap; + readonly ambiguousUnitList: ReadonlyArray; + readonly extractType: string; + constructor(ci?: CultureInfo); +} +export declare class FrenchAgeParserConfiguration extends FrenchNumberWithUnitParserConfiguration { + constructor(ci?: CultureInfo); +} diff --git a/libraries/botbuilder-stdlib/vendors/@microsoft/recognizers-text-number-with-unit/dist/types/numberWithUnit/french/base.d.ts b/libraries/botbuilder-stdlib/vendors/@microsoft/recognizers-text-number-with-unit/dist/types/numberWithUnit/french/base.d.ts new file mode 100644 index 0000000000..1366670440 --- /dev/null +++ b/libraries/botbuilder-stdlib/vendors/@microsoft/recognizers-text-number-with-unit/dist/types/numberWithUnit/french/base.d.ts @@ -0,0 +1,26 @@ +import { IExtractor, IParser } from "botbuilder-stdlib/vendors/@microsoft/recognizers-text"; +import { CultureInfo } from "botbuilder-stdlib/vendors/@microsoft/recognizers-text-number"; +import { INumberWithUnitExtractorConfiguration } from "../extractors"; +import { BaseNumberWithUnitParserConfiguration } from "../parsers"; +export declare abstract class FrenchNumberWithUnitExtractorConfiguration implements INumberWithUnitExtractorConfiguration { + readonly abstract suffixList: ReadonlyMap; + readonly abstract prefixList: ReadonlyMap; + readonly abstract ambiguousUnitList: ReadonlyArray; + readonly abstract extractType: string; + readonly cultureInfo: CultureInfo; + readonly unitNumExtractor: IExtractor; + readonly buildPrefix: string; + readonly buildSuffix: string; + readonly connectorToken: string; + readonly compoundUnitConnectorRegex: RegExp; + readonly pmNonUnitRegex: RegExp; + constructor(ci: CultureInfo); +} +export declare class FrenchNumberWithUnitParserConfiguration extends BaseNumberWithUnitParserConfiguration { + readonly internalNumberParser: IParser; + readonly internalNumberExtractor: IExtractor; + readonly connectorToken: string; + readonly currencyNameToIsoCodeMap: ReadonlyMap; + readonly currencyFractionCodeList: ReadonlyMap; + constructor(ci: CultureInfo); +} diff --git a/libraries/botbuilder-stdlib/vendors/@microsoft/recognizers-text-number-with-unit/dist/types/numberWithUnit/french/currency.d.ts b/libraries/botbuilder-stdlib/vendors/@microsoft/recognizers-text-number-with-unit/dist/types/numberWithUnit/french/currency.d.ts new file mode 100644 index 0000000000..b754b705cd --- /dev/null +++ b/libraries/botbuilder-stdlib/vendors/@microsoft/recognizers-text-number-with-unit/dist/types/numberWithUnit/french/currency.d.ts @@ -0,0 +1,12 @@ +import { CultureInfo } from "botbuilder-stdlib/vendors/@microsoft/recognizers-text-number"; +import { FrenchNumberWithUnitExtractorConfiguration, FrenchNumberWithUnitParserConfiguration } from "./base"; +export declare class FrenchCurrencyExtractorConfiguration extends FrenchNumberWithUnitExtractorConfiguration { + readonly suffixList: ReadonlyMap; + readonly prefixList: ReadonlyMap; + readonly ambiguousUnitList: ReadonlyArray; + readonly extractType: string; + constructor(ci?: CultureInfo); +} +export declare class FrenchCurrencyParserConfiguration extends FrenchNumberWithUnitParserConfiguration { + constructor(ci?: CultureInfo); +} diff --git a/libraries/botbuilder-stdlib/vendors/@microsoft/recognizers-text-number-with-unit/dist/types/numberWithUnit/french/dimension.d.ts b/libraries/botbuilder-stdlib/vendors/@microsoft/recognizers-text-number-with-unit/dist/types/numberWithUnit/french/dimension.d.ts new file mode 100644 index 0000000000..f4a53add23 --- /dev/null +++ b/libraries/botbuilder-stdlib/vendors/@microsoft/recognizers-text-number-with-unit/dist/types/numberWithUnit/french/dimension.d.ts @@ -0,0 +1,12 @@ +import { CultureInfo } from "botbuilder-stdlib/vendors/@microsoft/recognizers-text-number"; +import { FrenchNumberWithUnitExtractorConfiguration, FrenchNumberWithUnitParserConfiguration } from "./base"; +export declare class FrenchDimensionExtractorConfiguration extends FrenchNumberWithUnitExtractorConfiguration { + readonly suffixList: ReadonlyMap; + readonly prefixList: ReadonlyMap; + readonly ambiguousUnitList: ReadonlyArray; + readonly extractType: string; + constructor(ci?: CultureInfo); +} +export declare class FrenchDimensionParserConfiguration extends FrenchNumberWithUnitParserConfiguration { + constructor(ci?: CultureInfo); +} diff --git a/libraries/botbuilder-stdlib/vendors/@microsoft/recognizers-text-number-with-unit/dist/types/numberWithUnit/french/temperature.d.ts b/libraries/botbuilder-stdlib/vendors/@microsoft/recognizers-text-number-with-unit/dist/types/numberWithUnit/french/temperature.d.ts new file mode 100644 index 0000000000..a4dc711c1f --- /dev/null +++ b/libraries/botbuilder-stdlib/vendors/@microsoft/recognizers-text-number-with-unit/dist/types/numberWithUnit/french/temperature.d.ts @@ -0,0 +1,13 @@ +import { CultureInfo } from "botbuilder-stdlib/vendors/@microsoft/recognizers-text-number"; +import { FrenchNumberWithUnitExtractorConfiguration, FrenchNumberWithUnitParserConfiguration } from "./base"; +export declare class FrenchTemperatureExtractorConfiguration extends FrenchNumberWithUnitExtractorConfiguration { + readonly suffixList: ReadonlyMap; + readonly prefixList: ReadonlyMap; + readonly ambiguousUnitList: ReadonlyArray; + readonly extractType: string; + constructor(ci?: CultureInfo); +} +export declare class FrenchTemperatureParserConfiguration extends FrenchNumberWithUnitParserConfiguration { + constructor(ci?: CultureInfo); + readonly connectorToken: string; +} diff --git a/libraries/botbuilder-stdlib/vendors/@microsoft/recognizers-text-number-with-unit/dist/types/numberWithUnit/japanese/age.d.ts b/libraries/botbuilder-stdlib/vendors/@microsoft/recognizers-text-number-with-unit/dist/types/numberWithUnit/japanese/age.d.ts new file mode 100644 index 0000000000..f7c148508e --- /dev/null +++ b/libraries/botbuilder-stdlib/vendors/@microsoft/recognizers-text-number-with-unit/dist/types/numberWithUnit/japanese/age.d.ts @@ -0,0 +1,12 @@ +import { CultureInfo } from "botbuilder-stdlib/vendors/@microsoft/recognizers-text-number"; +import { JapaneseNumberWithUnitExtractorConfiguration, JapaneseNumberWithUnitParserConfiguration } from "./base"; +export declare class JapaneseAgeExtractorConfiguration extends JapaneseNumberWithUnitExtractorConfiguration { + readonly suffixList: ReadonlyMap; + readonly prefixList: ReadonlyMap; + readonly ambiguousUnitList: ReadonlyArray; + readonly extractType: string; + constructor(ci?: CultureInfo); +} +export declare class JapaneseAgeParserConfiguration extends JapaneseNumberWithUnitParserConfiguration { + constructor(ci?: CultureInfo); +} diff --git a/libraries/botbuilder-stdlib/vendors/@microsoft/recognizers-text-number-with-unit/dist/types/numberWithUnit/japanese/base.d.ts b/libraries/botbuilder-stdlib/vendors/@microsoft/recognizers-text-number-with-unit/dist/types/numberWithUnit/japanese/base.d.ts new file mode 100644 index 0000000000..bc7d7b8624 --- /dev/null +++ b/libraries/botbuilder-stdlib/vendors/@microsoft/recognizers-text-number-with-unit/dist/types/numberWithUnit/japanese/base.d.ts @@ -0,0 +1,26 @@ +import { IExtractor, IParser } from "botbuilder-stdlib/vendors/@microsoft/recognizers-text"; +import { CultureInfo } from "botbuilder-stdlib/vendors/@microsoft/recognizers-text-number"; +import { INumberWithUnitExtractorConfiguration } from "../extractors"; +import { BaseNumberWithUnitParserConfiguration } from "../parsers"; +export declare abstract class JapaneseNumberWithUnitExtractorConfiguration implements INumberWithUnitExtractorConfiguration { + readonly abstract suffixList: ReadonlyMap; + readonly abstract prefixList: ReadonlyMap; + readonly abstract ambiguousUnitList: ReadonlyArray; + readonly abstract extractType: string; + readonly cultureInfo: CultureInfo; + readonly unitNumExtractor: IExtractor; + readonly buildPrefix: string; + readonly buildSuffix: string; + readonly connectorToken: string; + readonly compoundUnitConnectorRegex: RegExp; + readonly pmNonUnitRegex: RegExp; + constructor(ci: CultureInfo); +} +export declare class JapaneseNumberWithUnitParserConfiguration extends BaseNumberWithUnitParserConfiguration { + readonly internalNumberParser: IParser; + readonly internalNumberExtractor: IExtractor; + readonly connectorToken: string; + readonly currencyNameToIsoCodeMap: ReadonlyMap; + readonly currencyFractionCodeList: ReadonlyMap; + constructor(ci: CultureInfo); +} diff --git a/libraries/botbuilder-stdlib/vendors/@microsoft/recognizers-text-number-with-unit/dist/types/numberWithUnit/japanese/currency.d.ts b/libraries/botbuilder-stdlib/vendors/@microsoft/recognizers-text-number-with-unit/dist/types/numberWithUnit/japanese/currency.d.ts new file mode 100644 index 0000000000..2da8bdcf01 --- /dev/null +++ b/libraries/botbuilder-stdlib/vendors/@microsoft/recognizers-text-number-with-unit/dist/types/numberWithUnit/japanese/currency.d.ts @@ -0,0 +1,12 @@ +import { CultureInfo } from "botbuilder-stdlib/vendors/@microsoft/recognizers-text-number"; +import { JapaneseNumberWithUnitExtractorConfiguration, JapaneseNumberWithUnitParserConfiguration } from "./base"; +export declare class JapaneseCurrencyExtractorConfiguration extends JapaneseNumberWithUnitExtractorConfiguration { + readonly suffixList: ReadonlyMap; + readonly prefixList: ReadonlyMap; + readonly ambiguousUnitList: ReadonlyArray; + readonly extractType: string; + constructor(ci?: CultureInfo); +} +export declare class JapaneseCurrencyParserConfiguration extends JapaneseNumberWithUnitParserConfiguration { + constructor(ci?: CultureInfo); +} diff --git a/libraries/botbuilder-stdlib/vendors/@microsoft/recognizers-text-number-with-unit/dist/types/numberWithUnit/models.d.ts b/libraries/botbuilder-stdlib/vendors/@microsoft/recognizers-text-number-with-unit/dist/types/numberWithUnit/models.d.ts new file mode 100644 index 0000000000..3973008212 --- /dev/null +++ b/libraries/botbuilder-stdlib/vendors/@microsoft/recognizers-text-number-with-unit/dist/types/numberWithUnit/models.d.ts @@ -0,0 +1,26 @@ +import { IModel, ModelResult, IExtractor, IParser } from "botbuilder-stdlib/vendors/@microsoft/recognizers-text"; +export declare enum CompositeEntityType { + Age = 0, + Currency = 1, + Dimension = 2, + Temperature = 3, +} +export declare abstract class AbstractNumberWithUnitModel implements IModel { + protected extractorParsersMap: Map; + abstract modelTypeName: string; + constructor(extractorParsersMap: Map); + parse(query: string): Array; + private getResolution(data); +} +export declare class AgeModel extends AbstractNumberWithUnitModel { + modelTypeName: string; +} +export declare class CurrencyModel extends AbstractNumberWithUnitModel { + modelTypeName: string; +} +export declare class DimensionModel extends AbstractNumberWithUnitModel { + modelTypeName: string; +} +export declare class TemperatureModel extends AbstractNumberWithUnitModel { + modelTypeName: string; +} diff --git a/libraries/botbuilder-stdlib/vendors/@microsoft/recognizers-text-number-with-unit/dist/types/numberWithUnit/numberWithUnitRecognizer.d.ts b/libraries/botbuilder-stdlib/vendors/@microsoft/recognizers-text-number-with-unit/dist/types/numberWithUnit/numberWithUnitRecognizer.d.ts new file mode 100644 index 0000000000..bbf6674d53 --- /dev/null +++ b/libraries/botbuilder-stdlib/vendors/@microsoft/recognizers-text-number-with-unit/dist/types/numberWithUnit/numberWithUnitRecognizer.d.ts @@ -0,0 +1,17 @@ +import { IModel, ModelResult, Recognizer } from "botbuilder-stdlib/vendors/@microsoft/recognizers-text"; +export declare enum NumberWithUnitOptions { + None = 0, +} +export declare function recognizeCurrency(query: string, culture: string, options?: NumberWithUnitOptions, fallbackToDefaultCulture?: boolean): Array; +export declare function recognizeTemperature(query: string, culture: string, options?: NumberWithUnitOptions, fallbackToDefaultCulture?: boolean): Array; +export declare function recognizeDimension(query: string, culture: string, options?: NumberWithUnitOptions, fallbackToDefaultCulture?: boolean): Array; +export declare function recognizeAge(query: string, culture: string, options?: NumberWithUnitOptions, fallbackToDefaultCulture?: boolean): Array; +export default class NumberWithUnitRecognizer extends Recognizer { + constructor(culture: string, options?: NumberWithUnitOptions, lazyInitialization?: boolean); + protected InitializeConfiguration(): void; + protected IsValidOptions(options: number): boolean; + getCurrencyModel(culture?: string, fallbackToDefaultCulture?: boolean): IModel; + getTemperatureModel(culture?: string, fallbackToDefaultCulture?: boolean): IModel; + getDimensionModel(culture?: string, fallbackToDefaultCulture?: boolean): IModel; + getAgeModel(culture?: string, fallbackToDefaultCulture?: boolean): IModel; +} diff --git a/libraries/botbuilder-stdlib/vendors/@microsoft/recognizers-text-number-with-unit/dist/types/numberWithUnit/parsers.d.ts b/libraries/botbuilder-stdlib/vendors/@microsoft/recognizers-text-number-with-unit/dist/types/numberWithUnit/parsers.d.ts new file mode 100644 index 0000000000..e717b4b1b4 --- /dev/null +++ b/libraries/botbuilder-stdlib/vendors/@microsoft/recognizers-text-number-with-unit/dist/types/numberWithUnit/parsers.d.ts @@ -0,0 +1,56 @@ +import { IExtractor, ExtractResult, IParser, ParseResult } from "botbuilder-stdlib/vendors/@microsoft/recognizers-text"; +import { CultureInfo } from "botbuilder-stdlib/vendors/@microsoft/recognizers-text-number"; +export declare class UnitValue { + number: string; + unit: string; +} +export declare class UnitValueIso extends UnitValue { + isoCurrency: string; +} +export interface INumberWithUnitParserConfiguration { + readonly unitMap: Map; + readonly cultureInfo: CultureInfo; + readonly internalNumberParser: IParser; + readonly internalNumberExtractor: IExtractor; + readonly connectorToken: string; + readonly currencyNameToIsoCodeMap: ReadonlyMap; + readonly currencyFractionCodeList: ReadonlyMap; + readonly currencyFractionNumMap: ReadonlyMap; + readonly currencyFractionMapping: ReadonlyMap; + BindDictionary(dictionary: Map): void; +} +export declare abstract class BaseNumberWithUnitParserConfiguration implements INumberWithUnitParserConfiguration { + unitMap: Map; + cultureInfo: CultureInfo; + abstract internalNumberParser: IParser; + abstract internalNumberExtractor: IExtractor; + abstract connectorToken: string; + abstract currencyNameToIsoCodeMap: ReadonlyMap; + abstract currencyFractionCodeList: ReadonlyMap; + readonly currencyFractionNumMap: ReadonlyMap; + readonly currencyFractionMapping: ReadonlyMap; + constructor(cultureInfo: CultureInfo); + BindDictionary(dictionary: ReadonlyMap): void; +} +export declare class NumberWithUnitParser implements IParser { + protected readonly config: INumberWithUnitParserConfiguration; + constructor(config: INumberWithUnitParserConfiguration); + parse(extResult: ExtractResult): ParseResult; + private addIfNotContained(keys, newKey); +} +export declare class BaseCurrencyParser implements IParser { + protected readonly config: INumberWithUnitParserConfiguration; + private readonly numberWithUnitParser; + constructor(config: INumberWithUnitParserConfiguration); + parse(extResult: ExtractResult): ParseResult; + private mergeCompoundUnit(compoundResult); + private checkUnitsStringContains(fractionUnitCode, fractionUnitsString); + private resolveText(prs, source, bias); +} +export declare class BaseMergedUnitParser implements IParser { + protected readonly config: INumberWithUnitParserConfiguration; + private readonly numberWithUnitParser; + private readonly currencyParser; + constructor(config: INumberWithUnitParserConfiguration); + parse(extResult: ExtractResult): ParseResult; +} diff --git a/libraries/botbuilder-stdlib/vendors/@microsoft/recognizers-text-number-with-unit/dist/types/numberWithUnit/portuguese/age.d.ts b/libraries/botbuilder-stdlib/vendors/@microsoft/recognizers-text-number-with-unit/dist/types/numberWithUnit/portuguese/age.d.ts new file mode 100644 index 0000000000..51ac6bd912 --- /dev/null +++ b/libraries/botbuilder-stdlib/vendors/@microsoft/recognizers-text-number-with-unit/dist/types/numberWithUnit/portuguese/age.d.ts @@ -0,0 +1,12 @@ +import { CultureInfo } from "botbuilder-stdlib/vendors/@microsoft/recognizers-text-number"; +import { PortugueseNumberWithUnitExtractorConfiguration, PortugueseNumberWithUnitParserConfiguration } from "./base"; +export declare class PortugueseAgeExtractorConfiguration extends PortugueseNumberWithUnitExtractorConfiguration { + readonly suffixList: ReadonlyMap; + readonly prefixList: ReadonlyMap; + readonly ambiguousUnitList: ReadonlyArray; + readonly extractType: string; + constructor(ci?: CultureInfo); +} +export declare class PortugueseAgeParserConfiguration extends PortugueseNumberWithUnitParserConfiguration { + constructor(ci?: CultureInfo); +} diff --git a/libraries/botbuilder-stdlib/vendors/@microsoft/recognizers-text-number-with-unit/dist/types/numberWithUnit/portuguese/base.d.ts b/libraries/botbuilder-stdlib/vendors/@microsoft/recognizers-text-number-with-unit/dist/types/numberWithUnit/portuguese/base.d.ts new file mode 100644 index 0000000000..8c9ac59ae6 --- /dev/null +++ b/libraries/botbuilder-stdlib/vendors/@microsoft/recognizers-text-number-with-unit/dist/types/numberWithUnit/portuguese/base.d.ts @@ -0,0 +1,26 @@ +import { IExtractor, IParser } from "botbuilder-stdlib/vendors/@microsoft/recognizers-text"; +import { CultureInfo } from "botbuilder-stdlib/vendors/@microsoft/recognizers-text-number"; +import { INumberWithUnitExtractorConfiguration } from "../extractors"; +import { BaseNumberWithUnitParserConfiguration } from "../parsers"; +export declare abstract class PortugueseNumberWithUnitExtractorConfiguration implements INumberWithUnitExtractorConfiguration { + readonly abstract suffixList: ReadonlyMap; + readonly abstract prefixList: ReadonlyMap; + readonly abstract ambiguousUnitList: ReadonlyArray; + readonly abstract extractType: string; + readonly cultureInfo: CultureInfo; + readonly unitNumExtractor: IExtractor; + readonly buildPrefix: string; + readonly buildSuffix: string; + readonly connectorToken: string; + readonly compoundUnitConnectorRegex: RegExp; + readonly pmNonUnitRegex: RegExp; + constructor(ci: CultureInfo); +} +export declare class PortugueseNumberWithUnitParserConfiguration extends BaseNumberWithUnitParserConfiguration { + readonly internalNumberParser: IParser; + readonly internalNumberExtractor: IExtractor; + readonly connectorToken: string; + readonly currencyNameToIsoCodeMap: ReadonlyMap; + readonly currencyFractionCodeList: ReadonlyMap; + constructor(ci: CultureInfo); +} diff --git a/libraries/botbuilder-stdlib/vendors/@microsoft/recognizers-text-number-with-unit/dist/types/numberWithUnit/portuguese/currency.d.ts b/libraries/botbuilder-stdlib/vendors/@microsoft/recognizers-text-number-with-unit/dist/types/numberWithUnit/portuguese/currency.d.ts new file mode 100644 index 0000000000..40f154181d --- /dev/null +++ b/libraries/botbuilder-stdlib/vendors/@microsoft/recognizers-text-number-with-unit/dist/types/numberWithUnit/portuguese/currency.d.ts @@ -0,0 +1,12 @@ +import { CultureInfo } from "botbuilder-stdlib/vendors/@microsoft/recognizers-text-number"; +import { PortugueseNumberWithUnitExtractorConfiguration, PortugueseNumberWithUnitParserConfiguration } from "./base"; +export declare class PortugueseCurrencyExtractorConfiguration extends PortugueseNumberWithUnitExtractorConfiguration { + readonly suffixList: ReadonlyMap; + readonly prefixList: ReadonlyMap; + readonly ambiguousUnitList: ReadonlyArray; + readonly extractType: string; + constructor(ci?: CultureInfo); +} +export declare class PortugueseCurrencyParserConfiguration extends PortugueseNumberWithUnitParserConfiguration { + constructor(ci?: CultureInfo); +} diff --git a/libraries/botbuilder-stdlib/vendors/@microsoft/recognizers-text-number-with-unit/dist/types/numberWithUnit/portuguese/dimension.d.ts b/libraries/botbuilder-stdlib/vendors/@microsoft/recognizers-text-number-with-unit/dist/types/numberWithUnit/portuguese/dimension.d.ts new file mode 100644 index 0000000000..9e39b0013e --- /dev/null +++ b/libraries/botbuilder-stdlib/vendors/@microsoft/recognizers-text-number-with-unit/dist/types/numberWithUnit/portuguese/dimension.d.ts @@ -0,0 +1,12 @@ +import { CultureInfo } from "botbuilder-stdlib/vendors/@microsoft/recognizers-text-number"; +import { PortugueseNumberWithUnitExtractorConfiguration, PortugueseNumberWithUnitParserConfiguration } from "./base"; +export declare class PortugueseDimensionExtractorConfiguration extends PortugueseNumberWithUnitExtractorConfiguration { + readonly suffixList: ReadonlyMap; + readonly prefixList: ReadonlyMap; + readonly ambiguousUnitList: ReadonlyArray; + readonly extractType: string; + constructor(ci?: CultureInfo); +} +export declare class PortugueseDimensionParserConfiguration extends PortugueseNumberWithUnitParserConfiguration { + constructor(ci?: CultureInfo); +} diff --git a/libraries/botbuilder-stdlib/vendors/@microsoft/recognizers-text-number-with-unit/dist/types/numberWithUnit/portuguese/temperature.d.ts b/libraries/botbuilder-stdlib/vendors/@microsoft/recognizers-text-number-with-unit/dist/types/numberWithUnit/portuguese/temperature.d.ts new file mode 100644 index 0000000000..4544faba0a --- /dev/null +++ b/libraries/botbuilder-stdlib/vendors/@microsoft/recognizers-text-number-with-unit/dist/types/numberWithUnit/portuguese/temperature.d.ts @@ -0,0 +1,12 @@ +import { CultureInfo } from "botbuilder-stdlib/vendors/@microsoft/recognizers-text-number"; +import { PortugueseNumberWithUnitExtractorConfiguration, PortugueseNumberWithUnitParserConfiguration } from "./base"; +export declare class PortugueseTemperatureExtractorConfiguration extends PortugueseNumberWithUnitExtractorConfiguration { + readonly suffixList: ReadonlyMap; + readonly prefixList: ReadonlyMap; + readonly ambiguousUnitList: ReadonlyArray; + readonly extractType: string; + constructor(ci?: CultureInfo); +} +export declare class PortugueseTemperatureParserConfiguration extends PortugueseNumberWithUnitParserConfiguration { + constructor(ci?: CultureInfo); +} diff --git a/libraries/botbuilder-stdlib/vendors/@microsoft/recognizers-text-number-with-unit/dist/types/numberWithUnit/spanish/age.d.ts b/libraries/botbuilder-stdlib/vendors/@microsoft/recognizers-text-number-with-unit/dist/types/numberWithUnit/spanish/age.d.ts new file mode 100644 index 0000000000..a0d2a5dc7c --- /dev/null +++ b/libraries/botbuilder-stdlib/vendors/@microsoft/recognizers-text-number-with-unit/dist/types/numberWithUnit/spanish/age.d.ts @@ -0,0 +1,12 @@ +import { CultureInfo } from "botbuilder-stdlib/vendors/@microsoft/recognizers-text-number"; +import { SpanishNumberWithUnitExtractorConfiguration, SpanishNumberWithUnitParserConfiguration } from "./base"; +export declare class SpanishAgeExtractorConfiguration extends SpanishNumberWithUnitExtractorConfiguration { + readonly suffixList: ReadonlyMap; + readonly prefixList: ReadonlyMap; + readonly ambiguousUnitList: ReadonlyArray; + readonly extractType: string; + constructor(ci?: CultureInfo); +} +export declare class SpanishAgeParserConfiguration extends SpanishNumberWithUnitParserConfiguration { + constructor(ci?: CultureInfo); +} diff --git a/libraries/botbuilder-stdlib/vendors/@microsoft/recognizers-text-number-with-unit/dist/types/numberWithUnit/spanish/base.d.ts b/libraries/botbuilder-stdlib/vendors/@microsoft/recognizers-text-number-with-unit/dist/types/numberWithUnit/spanish/base.d.ts new file mode 100644 index 0000000000..8b6a4ee147 --- /dev/null +++ b/libraries/botbuilder-stdlib/vendors/@microsoft/recognizers-text-number-with-unit/dist/types/numberWithUnit/spanish/base.d.ts @@ -0,0 +1,26 @@ +import { IExtractor, IParser } from "botbuilder-stdlib/vendors/@microsoft/recognizers-text"; +import { CultureInfo } from "botbuilder-stdlib/vendors/@microsoft/recognizers-text-number"; +import { INumberWithUnitExtractorConfiguration } from "../extractors"; +import { BaseNumberWithUnitParserConfiguration } from "../parsers"; +export declare abstract class SpanishNumberWithUnitExtractorConfiguration implements INumberWithUnitExtractorConfiguration { + readonly abstract suffixList: ReadonlyMap; + readonly abstract prefixList: ReadonlyMap; + readonly abstract ambiguousUnitList: ReadonlyArray; + readonly abstract extractType: string; + readonly cultureInfo: CultureInfo; + readonly unitNumExtractor: IExtractor; + readonly buildPrefix: string; + readonly buildSuffix: string; + readonly connectorToken: string; + readonly compoundUnitConnectorRegex: RegExp; + readonly pmNonUnitRegex: RegExp; + constructor(ci: CultureInfo); +} +export declare class SpanishNumberWithUnitParserConfiguration extends BaseNumberWithUnitParserConfiguration { + readonly internalNumberParser: IParser; + readonly internalNumberExtractor: IExtractor; + readonly connectorToken: string; + readonly currencyNameToIsoCodeMap: ReadonlyMap; + readonly currencyFractionCodeList: ReadonlyMap; + constructor(ci: CultureInfo); +} diff --git a/libraries/botbuilder-stdlib/vendors/@microsoft/recognizers-text-number-with-unit/dist/types/numberWithUnit/spanish/currency.d.ts b/libraries/botbuilder-stdlib/vendors/@microsoft/recognizers-text-number-with-unit/dist/types/numberWithUnit/spanish/currency.d.ts new file mode 100644 index 0000000000..b1c09d8ffd --- /dev/null +++ b/libraries/botbuilder-stdlib/vendors/@microsoft/recognizers-text-number-with-unit/dist/types/numberWithUnit/spanish/currency.d.ts @@ -0,0 +1,12 @@ +import { CultureInfo } from "botbuilder-stdlib/vendors/@microsoft/recognizers-text-number"; +import { SpanishNumberWithUnitExtractorConfiguration, SpanishNumberWithUnitParserConfiguration } from "./base"; +export declare class SpanishCurrencyExtractorConfiguration extends SpanishNumberWithUnitExtractorConfiguration { + readonly suffixList: ReadonlyMap; + readonly prefixList: ReadonlyMap; + readonly ambiguousUnitList: ReadonlyArray; + readonly extractType: string; + constructor(ci?: CultureInfo); +} +export declare class SpanishCurrencyParserConfiguration extends SpanishNumberWithUnitParserConfiguration { + constructor(ci?: CultureInfo); +} diff --git a/libraries/botbuilder-stdlib/vendors/@microsoft/recognizers-text-number-with-unit/dist/types/numberWithUnit/spanish/dimension.d.ts b/libraries/botbuilder-stdlib/vendors/@microsoft/recognizers-text-number-with-unit/dist/types/numberWithUnit/spanish/dimension.d.ts new file mode 100644 index 0000000000..ae0121b716 --- /dev/null +++ b/libraries/botbuilder-stdlib/vendors/@microsoft/recognizers-text-number-with-unit/dist/types/numberWithUnit/spanish/dimension.d.ts @@ -0,0 +1,12 @@ +import { CultureInfo } from "botbuilder-stdlib/vendors/@microsoft/recognizers-text-number"; +import { SpanishNumberWithUnitExtractorConfiguration, SpanishNumberWithUnitParserConfiguration } from "./base"; +export declare class SpanishDimensionExtractorConfiguration extends SpanishNumberWithUnitExtractorConfiguration { + readonly suffixList: ReadonlyMap; + readonly prefixList: ReadonlyMap; + readonly ambiguousUnitList: ReadonlyArray; + readonly extractType: string; + constructor(ci?: CultureInfo); +} +export declare class SpanishDimensionParserConfiguration extends SpanishNumberWithUnitParserConfiguration { + constructor(ci?: CultureInfo); +} diff --git a/libraries/botbuilder-stdlib/vendors/@microsoft/recognizers-text-number-with-unit/dist/types/numberWithUnit/spanish/temperature.d.ts b/libraries/botbuilder-stdlib/vendors/@microsoft/recognizers-text-number-with-unit/dist/types/numberWithUnit/spanish/temperature.d.ts new file mode 100644 index 0000000000..50fbae4de1 --- /dev/null +++ b/libraries/botbuilder-stdlib/vendors/@microsoft/recognizers-text-number-with-unit/dist/types/numberWithUnit/spanish/temperature.d.ts @@ -0,0 +1,12 @@ +import { CultureInfo } from "botbuilder-stdlib/vendors/@microsoft/recognizers-text-number"; +import { SpanishNumberWithUnitExtractorConfiguration, SpanishNumberWithUnitParserConfiguration } from "./base"; +export declare class SpanishTemperatureExtractorConfiguration extends SpanishNumberWithUnitExtractorConfiguration { + readonly suffixList: ReadonlyMap; + readonly prefixList: ReadonlyMap; + readonly ambiguousUnitList: ReadonlyArray; + readonly extractType: string; + constructor(ci?: CultureInfo); +} +export declare class SpanishTemperatureParserConfiguration extends SpanishNumberWithUnitParserConfiguration { + constructor(ci?: CultureInfo); +} diff --git a/libraries/botbuilder-stdlib/vendors/@microsoft/recognizers-text-number-with-unit/dist/types/numberWithUnit/utilities.d.ts b/libraries/botbuilder-stdlib/vendors/@microsoft/recognizers-text-number-with-unit/dist/types/numberWithUnit/utilities.d.ts new file mode 100644 index 0000000000..00ed5b6fb8 --- /dev/null +++ b/libraries/botbuilder-stdlib/vendors/@microsoft/recognizers-text-number-with-unit/dist/types/numberWithUnit/utilities.d.ts @@ -0,0 +1,4 @@ +export declare class DictionaryUtils { + static bindDictionary(dictionary: ReadonlyMap, source: Map): void; + static bindUnitsString(dictionary: Map, key: string, source: string): void; +} diff --git a/libraries/botbuilder-stdlib/vendors/@microsoft/recognizers-text-number-with-unit/dist/types/recognizers-text-number-with-unit.d.ts b/libraries/botbuilder-stdlib/vendors/@microsoft/recognizers-text-number-with-unit/dist/types/recognizers-text-number-with-unit.d.ts new file mode 100644 index 0000000000..d82fcfc672 --- /dev/null +++ b/libraries/botbuilder-stdlib/vendors/@microsoft/recognizers-text-number-with-unit/dist/types/recognizers-text-number-with-unit.d.ts @@ -0,0 +1,34 @@ +export { default as NumberWithUnitRecognizer, NumberWithUnitOptions, recognizeTemperature, recognizeDimension, recognizeCurrency, recognizeAge } from "./numberWithUnit/numberWithUnitRecognizer"; +export { Culture, CultureInfo } from "botbuilder-stdlib/vendors/@microsoft/recognizers-text-number"; +export { Constants } from "./numberWithUnit/constants"; +export { INumberWithUnitExtractorConfiguration, NumberWithUnitExtractor, PrefixUnitResult, BaseMergedUnitExtractor } from "./numberWithUnit/extractors"; +export { CompositeEntityType, AbstractNumberWithUnitModel, AgeModel, CurrencyModel, DimensionModel, TemperatureModel } from "./numberWithUnit/models"; +export { UnitValue, UnitValueIso, NumberWithUnitParser, INumberWithUnitParserConfiguration, BaseNumberWithUnitParserConfiguration, BaseCurrencyParser, BaseMergedUnitParser } from "./numberWithUnit/parsers"; +export { EnglishAgeExtractorConfiguration, EnglishAgeParserConfiguration } from "./numberWithUnit/english/age"; +export { EnglishNumberWithUnitExtractorConfiguration, EnglishNumberWithUnitParserConfiguration } from "./numberWithUnit/english/base"; +export { EnglishCurrencyExtractorConfiguration, EnglishCurrencyParserConfiguration } from "./numberWithUnit/english/currency"; +export { EnglishDimensionExtractorConfiguration, EnglishDimensionParserConfiguration } from "./numberWithUnit/english/dimension"; +export { EnglishTemperatureExtractorConfiguration, EnglishTemperatureParserConfiguration } from "./numberWithUnit/english/temperature"; +export { SpanishAgeExtractorConfiguration, SpanishAgeParserConfiguration } from "./numberWithUnit/spanish/age"; +export { SpanishNumberWithUnitExtractorConfiguration, SpanishNumberWithUnitParserConfiguration } from "./numberWithUnit/spanish/base"; +export { SpanishCurrencyExtractorConfiguration, SpanishCurrencyParserConfiguration } from "./numberWithUnit/spanish/currency"; +export { SpanishDimensionExtractorConfiguration, SpanishDimensionParserConfiguration } from "./numberWithUnit/spanish/dimension"; +export { SpanishTemperatureExtractorConfiguration, SpanishTemperatureParserConfiguration } from "./numberWithUnit/spanish/temperature"; +export { PortugueseAgeExtractorConfiguration, PortugueseAgeParserConfiguration } from "./numberWithUnit/portuguese/age"; +export { PortugueseNumberWithUnitExtractorConfiguration, PortugueseNumberWithUnitParserConfiguration } from "./numberWithUnit/portuguese/base"; +export { PortugueseCurrencyExtractorConfiguration, PortugueseCurrencyParserConfiguration } from "./numberWithUnit/portuguese/currency"; +export { PortugueseDimensionExtractorConfiguration, PortugueseDimensionParserConfiguration } from "./numberWithUnit/portuguese/dimension"; +export { PortugueseTemperatureExtractorConfiguration, PortugueseTemperatureParserConfiguration } from "./numberWithUnit/portuguese/temperature"; +export { ChineseAgeExtractorConfiguration, ChineseAgeParserConfiguration } from "./numberWithUnit/chinese/age"; +export { ChineseNumberWithUnitExtractorConfiguration, ChineseNumberWithUnitParserConfiguration } from "./numberWithUnit/chinese/base"; +export { ChineseCurrencyExtractorConfiguration, ChineseCurrencyParserConfiguration } from "./numberWithUnit/chinese/currency"; +export { ChineseDimensionExtractorConfiguration, ChineseDimensionParserConfiguration } from "./numberWithUnit/chinese/dimension"; +export { ChineseTemperatureExtractorConfiguration, ChineseTemperatureParserConfiguration } from "./numberWithUnit/chinese/temperature"; +export { JapaneseAgeExtractorConfiguration, JapaneseAgeParserConfiguration } from "./numberWithUnit/japanese/age"; +export { JapaneseNumberWithUnitExtractorConfiguration, JapaneseNumberWithUnitParserConfiguration } from "./numberWithUnit/japanese/base"; +export { JapaneseCurrencyExtractorConfiguration, JapaneseCurrencyParserConfiguration } from "./numberWithUnit/japanese/currency"; +export { EnglishNumericWithUnit } from "./resources/englishNumericWithUnit"; +export { SpanishNumericWithUnit } from "./resources/spanishNumericWithUnit"; +export { PortugueseNumericWithUnit } from "./resources/portugueseNumericWithUnit"; +export { ChineseNumericWithUnit } from "./resources/chineseNumericWithUnit"; +export { JapaneseNumericWithUnit } from "./resources/japaneseNumericWithUnit"; diff --git a/libraries/botbuilder-stdlib/vendors/@microsoft/recognizers-text-number-with-unit/dist/types/resources/baseCurrency.d.ts b/libraries/botbuilder-stdlib/vendors/@microsoft/recognizers-text-number-with-unit/dist/types/resources/baseCurrency.d.ts new file mode 100644 index 0000000000..73a2781c85 --- /dev/null +++ b/libraries/botbuilder-stdlib/vendors/@microsoft/recognizers-text-number-with-unit/dist/types/resources/baseCurrency.d.ts @@ -0,0 +1,4 @@ +export declare namespace BaseCurrency { + const CurrencyFractionMapping: ReadonlyMap; + const CurrencyFractionalRatios: ReadonlyMap; +} diff --git a/libraries/botbuilder-stdlib/vendors/@microsoft/recognizers-text-number-with-unit/dist/types/resources/baseNumbers.d.ts b/libraries/botbuilder-stdlib/vendors/@microsoft/recognizers-text-number-with-unit/dist/types/resources/baseNumbers.d.ts new file mode 100644 index 0000000000..f30dd0010c --- /dev/null +++ b/libraries/botbuilder-stdlib/vendors/@microsoft/recognizers-text-number-with-unit/dist/types/resources/baseNumbers.d.ts @@ -0,0 +1,7 @@ +export declare namespace BaseNumbers { + const NumberReplaceToken = "@builtin.num"; + const FractionNumberReplaceToken = "@builtin.num.fraction"; + const IntegerRegexDefinition: (placeholder: string, thousandsmark: string) => string; + const DoubleRegexDefinition: (placeholder: string, thousandsmark: string, decimalmark: string) => string; + const PlaceHolderDefault = "\\D|\\b"; +} diff --git a/libraries/botbuilder-stdlib/vendors/@microsoft/recognizers-text-number-with-unit/dist/types/resources/baseUnits.d.ts b/libraries/botbuilder-stdlib/vendors/@microsoft/recognizers-text-number-with-unit/dist/types/resources/baseUnits.d.ts new file mode 100644 index 0000000000..8d7beb422f --- /dev/null +++ b/libraries/botbuilder-stdlib/vendors/@microsoft/recognizers-text-number-with-unit/dist/types/resources/baseUnits.d.ts @@ -0,0 +1,7 @@ +export declare namespace BaseUnits { + const HourRegex = "(?00|01|02|03|04|05|06|07|08|09|0|10|11|12|13|14|15|16|17|18|19|20|21|22|23|24|1|2|3|4|5|6|7|8|9)(h)?"; + const MinuteRegex = "(?00|01|02|03|04|05|06|07|08|09|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|0|1|2|3|4|5|6|7|8|9)(?!\\d)"; + const SecondRegex = "(?00|01|02|03|04|05|06|07|08|09|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|0|1|2|3|4|5|6|7|8|9)"; + const PmNonUnitRegex: string; + const AmbiguousTimeTerm = "pm"; +} diff --git a/libraries/botbuilder-stdlib/vendors/@microsoft/recognizers-text-number-with-unit/dist/types/resources/chineseNumericWithUnit.d.ts b/libraries/botbuilder-stdlib/vendors/@microsoft/recognizers-text-number-with-unit/dist/types/resources/chineseNumericWithUnit.d.ts new file mode 100644 index 0000000000..772150d63b --- /dev/null +++ b/libraries/botbuilder-stdlib/vendors/@microsoft/recognizers-text-number-with-unit/dist/types/resources/chineseNumericWithUnit.d.ts @@ -0,0 +1,18 @@ +export declare namespace ChineseNumericWithUnit { + const AgeAmbiguousValues: string[]; + const AgeSuffixList: ReadonlyMap; + const BuildPrefix = ""; + const BuildSuffix = ""; + const ConnectorToken = ""; + const CurrencySuffixList: ReadonlyMap; + const CurrencyNameToIsoCodeMap: ReadonlyMap; + const FractionalUnitNameToCodeMap: ReadonlyMap; + const CompoundUnitConnectorRegex = "(?又|再)"; + const CurrencyPrefixList: ReadonlyMap; + const CurrencyAmbiguousValues: string[]; + const DimensionSuffixList: ReadonlyMap; + const DimensionAmbiguousValues: string[]; + const TemperatureSuffixList: ReadonlyMap; + const TemperaturePrefixList: ReadonlyMap; + const TemperatureAmbiguousValues: string[]; +} diff --git a/libraries/botbuilder-stdlib/vendors/@microsoft/recognizers-text-number-with-unit/dist/types/resources/englishNumericWithUnit.d.ts b/libraries/botbuilder-stdlib/vendors/@microsoft/recognizers-text-number-with-unit/dist/types/resources/englishNumericWithUnit.d.ts new file mode 100644 index 0000000000..265a266c7a --- /dev/null +++ b/libraries/botbuilder-stdlib/vendors/@microsoft/recognizers-text-number-with-unit/dist/types/resources/englishNumericWithUnit.d.ts @@ -0,0 +1,23 @@ +export declare namespace EnglishNumericWithUnit { + const AgeSuffixList: ReadonlyMap; + const AreaSuffixList: ReadonlyMap; + const CurrencySuffixList: ReadonlyMap; + const CurrencyNameToIsoCodeMap: ReadonlyMap; + const FractionalUnitNameToCodeMap: ReadonlyMap; + const CompoundUnitConnectorRegex = "(?and)"; + const CurrencyPrefixList: ReadonlyMap; + const AmbiguousCurrencyUnitList: string[]; + const InformationSuffixList: ReadonlyMap; + const AmbiguousDimensionUnitList: string[]; + const BuildPrefix = "(?<=(\\s|^))"; + const BuildSuffix = "(?=(\\s|\\W|$))"; + const LengthSuffixList: ReadonlyMap; + const AmbiguousLengthUnitList: string[]; + const SpeedSuffixList: ReadonlyMap; + const TemperatureSuffixList: ReadonlyMap; + const AmbiguousTemperatureUnitList: string[]; + const VolumeSuffixList: ReadonlyMap; + const AmbiguousVolumeUnitList: string[]; + const WeightSuffixList: ReadonlyMap; + const AmbiguousWeightUnitList: string[]; +} diff --git a/libraries/botbuilder-stdlib/vendors/@microsoft/recognizers-text-number-with-unit/dist/types/resources/frenchNumericWithUnit.d.ts b/libraries/botbuilder-stdlib/vendors/@microsoft/recognizers-text-number-with-unit/dist/types/resources/frenchNumericWithUnit.d.ts new file mode 100644 index 0000000000..2a4c5a033f --- /dev/null +++ b/libraries/botbuilder-stdlib/vendors/@microsoft/recognizers-text-number-with-unit/dist/types/resources/frenchNumericWithUnit.d.ts @@ -0,0 +1,22 @@ +export declare namespace FrenchNumericWithUnit { + const AgeSuffixList: ReadonlyMap; + const AreaSuffixList: ReadonlyMap; + const CurrencySuffixList: ReadonlyMap; + const CompoundUnitConnectorRegex = "(?[^.])"; + const CurrencyPrefixList: ReadonlyMap; + const AmbiguousCurrencyUnitList: string[]; + const InformationSuffixList: ReadonlyMap; + const AmbiguousDimensionUnitList: string[]; + const BuildPrefix = "(?<=(\\s|^|\\P{L}))"; + const BuildSuffix = "(?=(\\s|\\P{L}|$))"; + const ConnectorToken = "de"; + const LengthSuffixList: ReadonlyMap; + const AmbiguousLengthUnitList: string[]; + const AmbuguousLengthUnitList: string[]; + const SpeedSuffixList: ReadonlyMap; + const TemperatureSuffixList: ReadonlyMap; + const VolumeSuffixList: ReadonlyMap; + const AmbiguousVolumeUnitList: string[]; + const WeightSuffixList: ReadonlyMap; + const AmbiguousWeightUnitList: string[]; +} diff --git a/libraries/botbuilder-stdlib/vendors/@microsoft/recognizers-text-number-with-unit/dist/types/resources/japaneseNumericWithUnit.d.ts b/libraries/botbuilder-stdlib/vendors/@microsoft/recognizers-text-number-with-unit/dist/types/resources/japaneseNumericWithUnit.d.ts new file mode 100644 index 0000000000..3e141b507a --- /dev/null +++ b/libraries/botbuilder-stdlib/vendors/@microsoft/recognizers-text-number-with-unit/dist/types/resources/japaneseNumericWithUnit.d.ts @@ -0,0 +1,13 @@ +export declare namespace JapaneseNumericWithUnit { + const AgeAmbiguousValues: string[]; + const AgeSuffixList: ReadonlyMap; + const BuildPrefix = ""; + const BuildSuffix = ""; + const ConnectorToken = ""; + const CurrencySuffixList: ReadonlyMap; + const CurrencyNameToIsoCodeMap: ReadonlyMap; + const FractionalUnitNameToCodeMap: ReadonlyMap; + const CompoundUnitConnectorRegex = "(?と)"; + const CurrencyPrefixList: ReadonlyMap; + const CurrencyAmbiguousValues: string[]; +} diff --git a/libraries/botbuilder-stdlib/vendors/@microsoft/recognizers-text-number-with-unit/dist/types/resources/portugueseNumericWithUnit.d.ts b/libraries/botbuilder-stdlib/vendors/@microsoft/recognizers-text-number-with-unit/dist/types/resources/portugueseNumericWithUnit.d.ts new file mode 100644 index 0000000000..b566595e20 --- /dev/null +++ b/libraries/botbuilder-stdlib/vendors/@microsoft/recognizers-text-number-with-unit/dist/types/resources/portugueseNumericWithUnit.d.ts @@ -0,0 +1,20 @@ +export declare namespace PortugueseNumericWithUnit { + const AgeSuffixList: ReadonlyMap; + const AreaSuffixList: ReadonlyMap; + const CurrencySuffixList: ReadonlyMap; + const CompoundUnitConnectorRegex = "(?[^.])"; + const CurrencyPrefixList: ReadonlyMap; + const AmbiguousCurrencyUnitList: string[]; + const InformationSuffixList: ReadonlyMap; + const AmbiguousDimensionUnitList: string[]; + const BuildPrefix = "(?<=(\\s|^|\\P{L}))"; + const BuildSuffix = "(?=(\\s|\\P{L}|$))"; + const ConnectorToken = "de"; + const LengthSuffixList: ReadonlyMap; + const AmbiguousLengthUnitList: string[]; + const SpeedSuffixList: ReadonlyMap; + const AmbiguousSpeedUnitList: string[]; + const TemperatureSuffixList: ReadonlyMap; + const VolumeSuffixList: ReadonlyMap; + const WeightSuffixList: ReadonlyMap; +} diff --git a/libraries/botbuilder-stdlib/vendors/@microsoft/recognizers-text-number-with-unit/dist/types/resources/spanishNumericWithUnit.d.ts b/libraries/botbuilder-stdlib/vendors/@microsoft/recognizers-text-number-with-unit/dist/types/resources/spanishNumericWithUnit.d.ts new file mode 100644 index 0000000000..298e495d24 --- /dev/null +++ b/libraries/botbuilder-stdlib/vendors/@microsoft/recognizers-text-number-with-unit/dist/types/resources/spanishNumericWithUnit.d.ts @@ -0,0 +1,21 @@ +export declare namespace SpanishNumericWithUnit { + const AgeSuffixList: ReadonlyMap; + const AreaSuffixList: ReadonlyMap; + const AreaAmbiguousValues: string[]; + const CurrencySuffixList: ReadonlyMap; + const CompoundUnitConnectorRegex = "(?[^.])"; + const CurrencyPrefixList: ReadonlyMap; + const AmbiguousCurrencyUnitList: string[]; + const DimensionSuffixList: ReadonlyMap; + const AmbiguousDimensionUnitList: string[]; + const LengthSuffixList: ReadonlyMap; + const AmbiguousLengthUnitList: string[]; + const BuildPrefix = "(?<=(\\s|^|\\P{L}))"; + const BuildSuffix = "(?=(\\s|\\P{L}|$))"; + const ConnectorToken = "de"; + const SpeedSuffixList: ReadonlyMap; + const AmbiguousSpeedUnitList: string[]; + const TemperatureSuffixList: ReadonlyMap; + const VolumeSuffixList: ReadonlyMap; + const WeightSuffixList: ReadonlyMap; +} diff --git a/libraries/botbuilder-stdlib/vendors/@microsoft/recognizers-text-number-with-unit/package.json b/libraries/botbuilder-stdlib/vendors/@microsoft/recognizers-text-number-with-unit/package.json new file mode 100644 index 0000000000..6f04955f26 --- /dev/null +++ b/libraries/botbuilder-stdlib/vendors/@microsoft/recognizers-text-number-with-unit/package.json @@ -0,0 +1,29 @@ +{ + "internal": true, + "name": "@microsoft/recognizers-text-number-with-unit", + "version": "1.1.4", + "description": "recognizers-text-number-with-unit provides robust recognition and resolution of numbers with units expressed in multiple languages.", + "author": "Microsoft Corp.", + "license": "MIT", + "keywords": [ + "nlp", + "nlp-entity-extraction", + "entity-extraction", + "numex", + "parser-library" + ], + "main": "dist/recognizers-text-number-with-unit.umd.js", + "module": "dist/recognizers-text-number-with-unit.es5.js", + "typings": "dist/types/recognizers-text-number-with-unit.d.ts", + "browser": "dist/recognizers-text-number-with-unit.browser.js", + "bugs": { + "url": "https://github.com/Microsoft/botbuilder-js/issues" + }, + "repository": { + "type": "git", + "url": "https://github.com/Microsoft/botbuilder-js.git" + }, + "engines": { + "node": ">=6.0.0" + } +} \ No newline at end of file diff --git a/libraries/botbuilder-stdlib/vendors/@microsoft/recognizers-text-number/README.md b/libraries/botbuilder-stdlib/vendors/@microsoft/recognizers-text-number/README.md new file mode 100644 index 0000000000..4407681b40 --- /dev/null +++ b/libraries/botbuilder-stdlib/vendors/@microsoft/recognizers-text-number/README.md @@ -0,0 +1,5 @@ +# Microsoft.Recognizers.Text for JavaScript + +This module (`recognizers-text-number`) is a sub-module of `recognizers-text-suite`. + +Please check the [main README](https://github.com/Microsoft/Recognizers-Text/tree/master/JavaScript/packages/recognizers-text-suite) for more details. \ No newline at end of file diff --git a/libraries/botbuilder-stdlib/vendors/@microsoft/recognizers-text-number/dist/recognizers-text-number.browser.js b/libraries/botbuilder-stdlib/vendors/@microsoft/recognizers-text-number/dist/recognizers-text-number.browser.js new file mode 100644 index 0000000000..9e0bb8c404 --- /dev/null +++ b/libraries/botbuilder-stdlib/vendors/@microsoft/recognizers-text-number/dist/recognizers-text-number.browser.js @@ -0,0 +1,30858 @@ +var microsoftRecognizersTextNumber = (function (exports) { +'use strict'; + +var commonjsGlobal = typeof window !== 'undefined' ? window : typeof global !== 'undefined' ? global : typeof self !== 'undefined' ? self : {}; + + + +function unwrapExports (x) { + return x && x.__esModule && Object.prototype.hasOwnProperty.call(x, 'default') ? x['default'] : x; +} + +function createCommonjsModule(fn, module) { + return module = { exports: {} }, fn(module, module.exports), module.exports; +} + +var culture = createCommonjsModule(function (module, exports) { +"use strict"; +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +Object.defineProperty(exports, "__esModule", { value: true }); +class Culture { + constructor(cultureName, cultureCode) { + this.cultureName = cultureName; + this.cultureCode = cultureCode; + } + static getSupportedCultureCodes() { + return Culture.supportedCultures.map(c => c.cultureCode); + } + static mapToNearestLanguage(cultureCode) { + if (cultureCode !== undefined) { + cultureCode = cultureCode.toLowerCase(); + let supportedCultureCodes = Culture.getSupportedCultureCodes(); + if (supportedCultureCodes.indexOf(cultureCode) < 0) { + let culturePrefix = cultureCode.split('-')[0].trim(); + supportedCultureCodes.forEach(function (supportedCultureCode) { + if (supportedCultureCode.startsWith(culturePrefix)) { + cultureCode = supportedCultureCode; + } + }); + } + } + return cultureCode; + } +} +Culture.English = "en-us"; +Culture.EnglishOthers = "en-*"; +Culture.Chinese = "zh-cn"; +Culture.Spanish = "es-es"; +Culture.Portuguese = "pt-br"; +Culture.French = "fr-fr"; +Culture.German = "de-de"; +Culture.Japanese = "ja-jp"; +Culture.Dutch = "nl-nl"; +Culture.Italian = "it-it"; +Culture.supportedCultures = [ + new Culture("English", Culture.English), + new Culture("EnglishOthers", Culture.EnglishOthers), + new Culture("Chinese", Culture.Chinese), + new Culture("Spanish", Culture.Spanish), + new Culture("Portuguese", Culture.Portuguese), + new Culture("French", Culture.French), + new Culture("German", Culture.German), + new Culture("Japanese", Culture.Japanese), + new Culture("Dutch", Culture.Dutch), + new Culture("Italian", Culture.Italian) +]; +exports.Culture = Culture; +class CultureInfo { + static getCultureInfo(cultureCode) { + return new CultureInfo(cultureCode); + } + constructor(cultureName) { + this.code = cultureName; + } +} +exports.CultureInfo = CultureInfo; + +}); + +unwrapExports(culture); + +var xregexp = createCommonjsModule(function (module, exports) { +"use strict"; + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.default = void 0; + +function _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _nonIterableRest(); } + +function _nonIterableRest() { throw new TypeError("Invalid attempt to destructure non-iterable instance"); } + +function _iterableToArrayLimit(arr, i) { var _arr = []; var _n = true; var _d = false; var _e = undefined; try { for (var _i = arr[Symbol.iterator](), _s; !(_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; } + +function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; } + +/*! + * XRegExp 4.2.0 + * + * Steven Levithan (c) 2007-present MIT License + */ + +/** + * XRegExp provides augmented, extensible regular expressions. You get additional regex syntax and + * flags, beyond what browsers support natively. XRegExp is also a regex utility belt with tools to + * make your client-side grepping simpler and more powerful, while freeing you from related + * cross-browser inconsistencies. + */ +// ==--------------------------== +// Private stuff +// ==--------------------------== +// Property name used for extended regex instance data +var REGEX_DATA = 'xregexp'; // Optional features that can be installed and uninstalled + +var features = { + astral: false, + namespacing: false +}; // Native methods to use and restore ('native' is an ES3 reserved keyword) + +var nativ = { + exec: RegExp.prototype.exec, + test: RegExp.prototype.test, + match: String.prototype.match, + replace: String.prototype.replace, + split: String.prototype.split +}; // Storage for fixed/extended native methods + +var fixed = {}; // Storage for regexes cached by `XRegExp.cache` + +var regexCache = {}; // Storage for pattern details cached by the `XRegExp` constructor + +var patternCache = {}; // Storage for regex syntax tokens added internally or by `XRegExp.addToken` + +var tokens = []; // Token scopes + +var defaultScope = 'default'; +var classScope = 'class'; // Regexes that match native regex syntax, including octals + +var nativeTokens = { + // Any native multicharacter token in default scope, or any single character + 'default': /\\(?:0(?:[0-3][0-7]{0,2}|[4-7][0-7]?)?|[1-9]\d*|x[\dA-Fa-f]{2}|u(?:[\dA-Fa-f]{4}|{[\dA-Fa-f]+})|c[A-Za-z]|[\s\S])|\(\?(?:[:=!]|<[=!])|[?*+]\?|{\d+(?:,\d*)?}\??|[\s\S]/, + // Any native multicharacter token in character class scope, or any single character + 'class': /\\(?:[0-3][0-7]{0,2}|[4-7][0-7]?|x[\dA-Fa-f]{2}|u(?:[\dA-Fa-f]{4}|{[\dA-Fa-f]+})|c[A-Za-z]|[\s\S])|[\s\S]/ +}; // Any backreference or dollar-prefixed character in replacement strings + +var replacementToken = /\$(?:{([\w$]+)}|<([\w$]+)>|(\d\d?|[\s\S]))/g; // Check for correct `exec` handling of nonparticipating capturing groups + +var correctExecNpcg = nativ.exec.call(/()??/, '')[1] === undefined; // Check for ES6 `flags` prop support + +var hasFlagsProp = /x/.flags !== undefined; // Shortcut to `Object.prototype.toString` + +var _ref = {}, + toString = _ref.toString; + +function hasNativeFlag(flag) { + // Can't check based on the presence of properties/getters since browsers might support such + // properties even when they don't support the corresponding flag in regex construction (tested + // in Chrome 48, where `'unicode' in /x/` is true but trying to construct a regex with flag `u` + // throws an error) + var isSupported = true; + + try { + // Can't use regex literals for testing even in a `try` because regex literals with + // unsupported flags cause a compilation error in IE + new RegExp('', flag); + } catch (exception) { + isSupported = false; + } + + return isSupported; +} // Check for ES6 `u` flag support + + +var hasNativeU = hasNativeFlag('u'); // Check for ES6 `y` flag support + +var hasNativeY = hasNativeFlag('y'); // Tracker for known flags, including addon flags + +var registeredFlags = { + g: true, + i: true, + m: true, + u: hasNativeU, + y: hasNativeY +}; +/** + * Attaches extended data and `XRegExp.prototype` properties to a regex object. + * + * @private + * @param {RegExp} regex Regex to augment. + * @param {Array} captureNames Array with capture names, or `null`. + * @param {String} xSource XRegExp pattern used to generate `regex`, or `null` if N/A. + * @param {String} xFlags XRegExp flags used to generate `regex`, or `null` if N/A. + * @param {Boolean} [isInternalOnly=false] Whether the regex will be used only for internal + * operations, and never exposed to users. For internal-only regexes, we can improve perf by + * skipping some operations like attaching `XRegExp.prototype` properties. + * @returns {RegExp} Augmented regex. + */ + +function augment(regex, captureNames, xSource, xFlags, isInternalOnly) { + regex[REGEX_DATA] = { + captureNames: captureNames + }; + + if (isInternalOnly) { + return regex; + } // Can't auto-inherit these since the XRegExp constructor returns a nonprimitive value + + + if (regex.__proto__) { + regex.__proto__ = XRegExp.prototype; + } else { + for (var p in XRegExp.prototype) { + // An `XRegExp.prototype.hasOwnProperty(p)` check wouldn't be worth it here, since this + // is performance sensitive, and enumerable `Object.prototype` or `RegExp.prototype` + // extensions exist on `regex.prototype` anyway + regex[p] = XRegExp.prototype[p]; + } + } + + regex[REGEX_DATA].source = xSource; // Emulate the ES6 `flags` prop by ensuring flags are in alphabetical order + + regex[REGEX_DATA].flags = xFlags ? xFlags.split('').sort().join('') : xFlags; + return regex; +} +/** + * Removes any duplicate characters from the provided string. + * + * @private + * @param {String} str String to remove duplicate characters from. + * @returns {String} String with any duplicate characters removed. + */ + + +function clipDuplicates(str) { + return nativ.replace.call(str, /([\s\S])(?=[\s\S]*\1)/g, ''); +} +/** + * Copies a regex object while preserving extended data and augmenting with `XRegExp.prototype` + * properties. The copy has a fresh `lastIndex` property (set to zero). Allows adding and removing + * flags g and y while copying the regex. + * + * @private + * @param {RegExp} regex Regex to copy. + * @param {Object} [options] Options object with optional properties: + * - `addG` {Boolean} Add flag g while copying the regex. + * - `addY` {Boolean} Add flag y while copying the regex. + * - `removeG` {Boolean} Remove flag g while copying the regex. + * - `removeY` {Boolean} Remove flag y while copying the regex. + * - `isInternalOnly` {Boolean} Whether the copied regex will be used only for internal + * operations, and never exposed to users. For internal-only regexes, we can improve perf by + * skipping some operations like attaching `XRegExp.prototype` properties. + * - `source` {String} Overrides `.source`, for special cases. + * @returns {RegExp} Copy of the provided regex, possibly with modified flags. + */ + + +function copyRegex(regex, options) { + if (!XRegExp.isRegExp(regex)) { + throw new TypeError('Type RegExp expected'); + } + + var xData = regex[REGEX_DATA] || {}; + var flags = getNativeFlags(regex); + var flagsToAdd = ''; + var flagsToRemove = ''; + var xregexpSource = null; + var xregexpFlags = null; + options = options || {}; + + if (options.removeG) { + flagsToRemove += 'g'; + } + + if (options.removeY) { + flagsToRemove += 'y'; + } + + if (flagsToRemove) { + flags = nativ.replace.call(flags, new RegExp("[".concat(flagsToRemove, "]+"), 'g'), ''); + } + + if (options.addG) { + flagsToAdd += 'g'; + } + + if (options.addY) { + flagsToAdd += 'y'; + } + + if (flagsToAdd) { + flags = clipDuplicates(flags + flagsToAdd); + } + + if (!options.isInternalOnly) { + if (xData.source !== undefined) { + xregexpSource = xData.source; + } // null or undefined; don't want to add to `flags` if the previous value was null, since + // that indicates we're not tracking original precompilation flags + + + if (xData.flags != null) { + // Flags are only added for non-internal regexes by `XRegExp.globalize`. Flags are never + // removed for non-internal regexes, so don't need to handle it + xregexpFlags = flagsToAdd ? clipDuplicates(xData.flags + flagsToAdd) : xData.flags; + } + } // Augment with `XRegExp.prototype` properties, but use the native `RegExp` constructor to avoid + // searching for special tokens. That would be wrong for regexes constructed by `RegExp`, and + // unnecessary for regexes constructed by `XRegExp` because the regex has already undergone the + // translation to native regex syntax + + + regex = augment(new RegExp(options.source || regex.source, flags), hasNamedCapture(regex) ? xData.captureNames.slice(0) : null, xregexpSource, xregexpFlags, options.isInternalOnly); + return regex; +} +/** + * Converts hexadecimal to decimal. + * + * @private + * @param {String} hex + * @returns {Number} + */ + + +function dec(hex) { + return parseInt(hex, 16); +} +/** + * Returns a pattern that can be used in a native RegExp in place of an ignorable token such as an + * inline comment or whitespace with flag x. This is used directly as a token handler function + * passed to `XRegExp.addToken`. + * + * @private + * @param {String} match Match arg of `XRegExp.addToken` handler + * @param {String} scope Scope arg of `XRegExp.addToken` handler + * @param {String} flags Flags arg of `XRegExp.addToken` handler + * @returns {String} Either '' or '(?:)', depending on which is needed in the context of the match. + */ + + +function getContextualTokenSeparator(match, scope, flags) { + if ( // No need to separate tokens if at the beginning or end of a group + match.input[match.index - 1] === '(' || match.input[match.index + match[0].length] === ')' || // No need to separate tokens if before or after a `|` + match.input[match.index - 1] === '|' || match.input[match.index + match[0].length] === '|' || // No need to separate tokens if at the beginning or end of the pattern + match.index < 1 || match.index + match[0].length >= match.input.length || // No need to separate tokens if at the beginning of a noncapturing group or lookahead. + // The way this is written relies on: + // - The search regex matching only 3-char strings. + // - Although `substr` gives chars from the end of the string if given a negative index, + // the resulting substring will be too short to match. Ex: `'abcd'.substr(-1, 3) === 'd'` + nativ.test.call(/^\(\?[:=!]/, match.input.substr(match.index - 3, 3)) || // Avoid separating tokens when the following token is a quantifier + isQuantifierNext(match.input, match.index + match[0].length, flags)) { + return ''; + } // Keep tokens separated. This avoids e.g. inadvertedly changing `\1 1` or `\1(?#)1` to `\11`. + // This also ensures all tokens remain as discrete atoms, e.g. it avoids converting the syntax + // error `(? :` into `(?:`. + + + return '(?:)'; +} +/** + * Returns native `RegExp` flags used by a regex object. + * + * @private + * @param {RegExp} regex Regex to check. + * @returns {String} Native flags in use. + */ + + +function getNativeFlags(regex) { + return hasFlagsProp ? regex.flags : // Explicitly using `RegExp.prototype.toString` (rather than e.g. `String` or concatenation + // with an empty string) allows this to continue working predictably when + // `XRegExp.proptotype.toString` is overridden + nativ.exec.call(/\/([a-z]*)$/i, RegExp.prototype.toString.call(regex))[1]; +} +/** + * Determines whether a regex has extended instance data used to track capture names. + * + * @private + * @param {RegExp} regex Regex to check. + * @returns {Boolean} Whether the regex uses named capture. + */ + + +function hasNamedCapture(regex) { + return !!(regex[REGEX_DATA] && regex[REGEX_DATA].captureNames); +} +/** + * Converts decimal to hexadecimal. + * + * @private + * @param {Number|String} dec + * @returns {String} + */ + + +function hex(dec) { + return parseInt(dec, 10).toString(16); +} +/** + * Checks whether the next nonignorable token after the specified position is a quantifier. + * + * @private + * @param {String} pattern Pattern to search within. + * @param {Number} pos Index in `pattern` to search at. + * @param {String} flags Flags used by the pattern. + * @returns {Boolean} Whether the next nonignorable token is a quantifier. + */ + + +function isQuantifierNext(pattern, pos, flags) { + return nativ.test.call(flags.indexOf('x') !== -1 ? // Ignore any leading whitespace, line comments, and inline comments + /^(?:\s|#[^#\n]*|\(\?#[^)]*\))*(?:[?*+]|{\d+(?:,\d*)?})/ : // Ignore any leading inline comments + /^(?:\(\?#[^)]*\))*(?:[?*+]|{\d+(?:,\d*)?})/, pattern.slice(pos)); +} +/** + * Determines whether a value is of the specified type, by resolving its internal [[Class]]. + * + * @private + * @param {*} value Object to check. + * @param {String} type Type to check for, in TitleCase. + * @returns {Boolean} Whether the object matches the type. + */ + + +function isType(value, type) { + return toString.call(value) === "[object ".concat(type, "]"); +} +/** + * Adds leading zeros if shorter than four characters. Used for fixed-length hexadecimal values. + * + * @private + * @param {String} str + * @returns {String} + */ + + +function pad4(str) { + while (str.length < 4) { + str = "0".concat(str); + } + + return str; +} +/** + * Checks for flag-related errors, and strips/applies flags in a leading mode modifier. Offloads + * the flag preparation logic from the `XRegExp` constructor. + * + * @private + * @param {String} pattern Regex pattern, possibly with a leading mode modifier. + * @param {String} flags Any combination of flags. + * @returns {Object} Object with properties `pattern` and `flags`. + */ + + +function prepareFlags(pattern, flags) { + // Recent browsers throw on duplicate flags, so copy this behavior for nonnative flags + if (clipDuplicates(flags) !== flags) { + throw new SyntaxError("Invalid duplicate regex flag ".concat(flags)); + } // Strip and apply a leading mode modifier with any combination of flags except g or y + + + pattern = nativ.replace.call(pattern, /^\(\?([\w$]+)\)/, function ($0, $1) { + if (nativ.test.call(/[gy]/, $1)) { + throw new SyntaxError("Cannot use flag g or y in mode modifier ".concat($0)); + } // Allow duplicate flags within the mode modifier + + + flags = clipDuplicates(flags + $1); + return ''; + }); // Throw on unknown native or nonnative flags + + var _iteratorNormalCompletion = true; + var _didIteratorError = false; + var _iteratorError = undefined; + + try { + for (var _iterator = flags[Symbol.iterator](), _step; !(_iteratorNormalCompletion = (_step = _iterator.next()).done); _iteratorNormalCompletion = true) { + var flag = _step.value; + + if (!registeredFlags[flag]) { + throw new SyntaxError("Unknown regex flag ".concat(flag)); + } + } + } catch (err) { + _didIteratorError = true; + _iteratorError = err; + } finally { + try { + if (!_iteratorNormalCompletion && _iterator.return != null) { + _iterator.return(); + } + } finally { + if (_didIteratorError) { + throw _iteratorError; + } + } + } + + return { + pattern: pattern, + flags: flags + }; +} +/** + * Prepares an options object from the given value. + * + * @private + * @param {String|Object} value Value to convert to an options object. + * @returns {Object} Options object. + */ + + +function prepareOptions(value) { + var options = {}; + + if (isType(value, 'String')) { + XRegExp.forEach(value, /[^\s,]+/, function (match) { + options[match] = true; + }); + return options; + } + + return value; +} +/** + * Registers a flag so it doesn't throw an 'unknown flag' error. + * + * @private + * @param {String} flag Single-character flag to register. + */ + + +function registerFlag(flag) { + if (!/^[\w$]$/.test(flag)) { + throw new Error('Flag must be a single character A-Za-z0-9_$'); + } + + registeredFlags[flag] = true; +} +/** + * Runs built-in and custom regex syntax tokens in reverse insertion order at the specified + * position, until a match is found. + * + * @private + * @param {String} pattern Original pattern from which an XRegExp object is being built. + * @param {String} flags Flags being used to construct the regex. + * @param {Number} pos Position to search for tokens within `pattern`. + * @param {Number} scope Regex scope to apply: 'default' or 'class'. + * @param {Object} context Context object to use for token handler functions. + * @returns {Object} Object with properties `matchLength`, `output`, and `reparse`; or `null`. + */ + + +function runTokens(pattern, flags, pos, scope, context) { + var i = tokens.length; + var leadChar = pattern[pos]; + var result = null; + var match; + var t; // Run in reverse insertion order + + while (i--) { + t = tokens[i]; + + if (t.leadChar && t.leadChar !== leadChar || t.scope !== scope && t.scope !== 'all' || t.flag && !(flags.indexOf(t.flag) !== -1)) { + continue; + } + + match = XRegExp.exec(pattern, t.regex, pos, 'sticky'); + + if (match) { + result = { + matchLength: match[0].length, + output: t.handler.call(context, match, scope, flags), + reparse: t.reparse + }; // Finished with token tests + + break; + } + } + + return result; +} +/** + * Enables or disables implicit astral mode opt-in. When enabled, flag A is automatically added to + * all new regexes created by XRegExp. This causes an error to be thrown when creating regexes if + * the Unicode Base addon is not available, since flag A is registered by that addon. + * + * @private + * @param {Boolean} on `true` to enable; `false` to disable. + */ + + +function setAstral(on) { + features.astral = on; +} +/** + * Adds named capture groups to the `groups` property of match arrays. See here for details: + * https://github.com/tc39/proposal-regexp-named-groups + * + * @private + * @param {Boolean} on `true` to enable; `false` to disable. + */ + + +function setNamespacing(on) { + features.namespacing = on; +} +/** + * Returns the object, or throws an error if it is `null` or `undefined`. This is used to follow + * the ES5 abstract operation `ToObject`. + * + * @private + * @param {*} value Object to check and return. + * @returns {*} The provided object. + */ + + +function toObject(value) { + // null or undefined + if (value == null) { + throw new TypeError('Cannot convert null or undefined to object'); + } + + return value; +} // ==--------------------------== +// Constructor +// ==--------------------------== + +/** + * Creates an extended regular expression object for matching text with a pattern. Differs from a + * native regular expression in that additional syntax and flags are supported. The returned object + * is in fact a native `RegExp` and works with all native methods. + * + * @class XRegExp + * @constructor + * @param {String|RegExp} pattern Regex pattern string, or an existing regex object to copy. + * @param {String} [flags] Any combination of flags. + * Native flags: + * - `g` - global + * - `i` - ignore case + * - `m` - multiline anchors + * - `u` - unicode (ES6) + * - `y` - sticky (Firefox 3+, ES6) + * Additional XRegExp flags: + * - `n` - explicit capture + * - `s` - dot matches all (aka singleline) + * - `x` - free-spacing and line comments (aka extended) + * - `A` - astral (requires the Unicode Base addon) + * Flags cannot be provided when constructing one `RegExp` from another. + * @returns {RegExp} Extended regular expression object. + * @example + * + * // With named capture and flag x + * XRegExp(`(? [0-9]{4} ) -? # year + * (? [0-9]{2} ) -? # month + * (? [0-9]{2} ) # day`, 'x'); + * + * // Providing a regex object copies it. Native regexes are recompiled using native (not XRegExp) + * // syntax. Copies maintain extended data, are augmented with `XRegExp.prototype` properties, and + * // have fresh `lastIndex` properties (set to zero). + * XRegExp(/regex/); + */ + + +function XRegExp(pattern, flags) { + if (XRegExp.isRegExp(pattern)) { + if (flags !== undefined) { + throw new TypeError('Cannot supply flags when copying a RegExp'); + } + + return copyRegex(pattern); + } // Copy the argument behavior of `RegExp` + + + pattern = pattern === undefined ? '' : String(pattern); + flags = flags === undefined ? '' : String(flags); + + if (XRegExp.isInstalled('astral') && !(flags.indexOf('A') !== -1)) { + // This causes an error to be thrown if the Unicode Base addon is not available + flags += 'A'; + } + + if (!patternCache[pattern]) { + patternCache[pattern] = {}; + } + + if (!patternCache[pattern][flags]) { + var context = { + hasNamedCapture: false, + captureNames: [] + }; + var scope = defaultScope; + var output = ''; + var pos = 0; + var result; // Check for flag-related errors, and strip/apply flags in a leading mode modifier + + var applied = prepareFlags(pattern, flags); + var appliedPattern = applied.pattern; + var appliedFlags = applied.flags; // Use XRegExp's tokens to translate the pattern to a native regex pattern. + // `appliedPattern.length` may change on each iteration if tokens use `reparse` + + while (pos < appliedPattern.length) { + do { + // Check for custom tokens at the current position + result = runTokens(appliedPattern, appliedFlags, pos, scope, context); // If the matched token used the `reparse` option, splice its output into the + // pattern before running tokens again at the same position + + if (result && result.reparse) { + appliedPattern = appliedPattern.slice(0, pos) + result.output + appliedPattern.slice(pos + result.matchLength); + } + } while (result && result.reparse); + + if (result) { + output += result.output; + pos += result.matchLength || 1; + } else { + // Get the native token at the current position + var _XRegExp$exec = XRegExp.exec(appliedPattern, nativeTokens[scope], pos, 'sticky'), + _XRegExp$exec2 = _slicedToArray(_XRegExp$exec, 1), + token = _XRegExp$exec2[0]; + + output += token; + pos += token.length; + + if (token === '[' && scope === defaultScope) { + scope = classScope; + } else if (token === ']' && scope === classScope) { + scope = defaultScope; + } + } + } + + patternCache[pattern][flags] = { + // Use basic cleanup to collapse repeated empty groups like `(?:)(?:)` to `(?:)`. Empty + // groups are sometimes inserted during regex transpilation in order to keep tokens + // separated. However, more than one empty group in a row is never needed. + pattern: nativ.replace.call(output, /(?:\(\?:\))+/g, '(?:)'), + // Strip all but native flags + flags: nativ.replace.call(appliedFlags, /[^gimuy]+/g, ''), + // `context.captureNames` has an item for each capturing group, even if unnamed + captures: context.hasNamedCapture ? context.captureNames : null + }; + } + + var generated = patternCache[pattern][flags]; + return augment(new RegExp(generated.pattern, generated.flags), generated.captures, pattern, flags); +} // Add `RegExp.prototype` to the prototype chain + + +XRegExp.prototype = /(?:)/; // ==--------------------------== +// Public properties +// ==--------------------------== + +/** + * The XRegExp version number as a string containing three dot-separated parts. For example, + * '2.0.0-beta-3'. + * + * @static + * @memberOf XRegExp + * @type String + */ + +XRegExp.version = '4.2.0'; // ==--------------------------== +// Public methods +// ==--------------------------== +// Intentionally undocumented; used in tests and addons + +XRegExp._clipDuplicates = clipDuplicates; +XRegExp._hasNativeFlag = hasNativeFlag; +XRegExp._dec = dec; +XRegExp._hex = hex; +XRegExp._pad4 = pad4; +/** + * Extends XRegExp syntax and allows custom flags. This is used internally and can be used to + * create XRegExp addons. If more than one token can match the same string, the last added wins. + * + * @memberOf XRegExp + * @param {RegExp} regex Regex object that matches the new token. + * @param {Function} handler Function that returns a new pattern string (using native regex syntax) + * to replace the matched token within all future XRegExp regexes. Has access to persistent + * properties of the regex being built, through `this`. Invoked with three arguments: + * - The match array, with named backreference properties. + * - The regex scope where the match was found: 'default' or 'class'. + * - The flags used by the regex, including any flags in a leading mode modifier. + * The handler function becomes part of the XRegExp construction process, so be careful not to + * construct XRegExps within the function or you will trigger infinite recursion. + * @param {Object} [options] Options object with optional properties: + * - `scope` {String} Scope where the token applies: 'default', 'class', or 'all'. + * - `flag` {String} Single-character flag that triggers the token. This also registers the + * flag, which prevents XRegExp from throwing an 'unknown flag' error when the flag is used. + * - `optionalFlags` {String} Any custom flags checked for within the token `handler` that are + * not required to trigger the token. This registers the flags, to prevent XRegExp from + * throwing an 'unknown flag' error when any of the flags are used. + * - `reparse` {Boolean} Whether the `handler` function's output should not be treated as + * final, and instead be reparseable by other tokens (including the current token). Allows + * token chaining or deferring. + * - `leadChar` {String} Single character that occurs at the beginning of any successful match + * of the token (not always applicable). This doesn't change the behavior of the token unless + * you provide an erroneous value. However, providing it can increase the token's performance + * since the token can be skipped at any positions where this character doesn't appear. + * @example + * + * // Basic usage: Add \a for the ALERT control code + * XRegExp.addToken( + * /\\a/, + * () => '\\x07', + * {scope: 'all'} + * ); + * XRegExp('\\a[\\a-\\n]+').test('\x07\n\x07'); // -> true + * + * // Add the U (ungreedy) flag from PCRE and RE2, which reverses greedy and lazy quantifiers. + * // Since `scope` is not specified, it uses 'default' (i.e., transformations apply outside of + * // character classes only) + * XRegExp.addToken( + * /([?*+]|{\d+(?:,\d*)?})(\??)/, + * (match) => `${match[1]}${match[2] ? '' : '?'}`, + * {flag: 'U'} + * ); + * XRegExp('a+', 'U').exec('aaa')[0]; // -> 'a' + * XRegExp('a+?', 'U').exec('aaa')[0]; // -> 'aaa' + */ + +XRegExp.addToken = function (regex, handler, options) { + options = options || {}; + var _options = options, + optionalFlags = _options.optionalFlags; + + if (options.flag) { + registerFlag(options.flag); + } + + if (optionalFlags) { + optionalFlags = nativ.split.call(optionalFlags, ''); + var _iteratorNormalCompletion2 = true; + var _didIteratorError2 = false; + var _iteratorError2 = undefined; + + try { + for (var _iterator2 = optionalFlags[Symbol.iterator](), _step2; !(_iteratorNormalCompletion2 = (_step2 = _iterator2.next()).done); _iteratorNormalCompletion2 = true) { + var flag = _step2.value; + registerFlag(flag); + } + } catch (err) { + _didIteratorError2 = true; + _iteratorError2 = err; + } finally { + try { + if (!_iteratorNormalCompletion2 && _iterator2.return != null) { + _iterator2.return(); + } + } finally { + if (_didIteratorError2) { + throw _iteratorError2; + } + } + } + } // Add to the private list of syntax tokens + + + tokens.push({ + regex: copyRegex(regex, { + addG: true, + addY: hasNativeY, + isInternalOnly: true + }), + handler: handler, + scope: options.scope || defaultScope, + flag: options.flag, + reparse: options.reparse, + leadChar: options.leadChar + }); // Reset the pattern cache used by the `XRegExp` constructor, since the same pattern and flags + // might now produce different results + + XRegExp.cache.flush('patterns'); +}; +/** + * Caches and returns the result of calling `XRegExp(pattern, flags)`. On any subsequent call with + * the same pattern and flag combination, the cached copy of the regex is returned. + * + * @memberOf XRegExp + * @param {String} pattern Regex pattern string. + * @param {String} [flags] Any combination of XRegExp flags. + * @returns {RegExp} Cached XRegExp object. + * @example + * + * while (match = XRegExp.cache('.', 'gs').exec(str)) { + * // The regex is compiled once only + * } + */ + + +XRegExp.cache = function (pattern, flags) { + if (!regexCache[pattern]) { + regexCache[pattern] = {}; + } + + return regexCache[pattern][flags] || (regexCache[pattern][flags] = XRegExp(pattern, flags)); +}; // Intentionally undocumented; used in tests + + +XRegExp.cache.flush = function (cacheName) { + if (cacheName === 'patterns') { + // Flush the pattern cache used by the `XRegExp` constructor + patternCache = {}; + } else { + // Flush the regex cache populated by `XRegExp.cache` + regexCache = {}; + } +}; +/** + * Escapes any regular expression metacharacters, for use when matching literal strings. The result + * can safely be used at any point within a regex that uses any flags. + * + * @memberOf XRegExp + * @param {String} str String to escape. + * @returns {String} String with regex metacharacters escaped. + * @example + * + * XRegExp.escape('Escaped? <.>'); + * // -> 'Escaped\?\ <\.>' + */ + + +XRegExp.escape = function (str) { + return nativ.replace.call(toObject(str), /[-\[\]{}()*+?.,\\^$|#\s]/g, '\\$&'); +}; +/** + * Executes a regex search in a specified string. Returns a match array or `null`. If the provided + * regex uses named capture, named backreference properties are included on the match array. + * Optional `pos` and `sticky` arguments specify the search start position, and whether the match + * must start at the specified position only. The `lastIndex` property of the provided regex is not + * used, but is updated for compatibility. Also fixes browser bugs compared to the native + * `RegExp.prototype.exec` and can be used reliably cross-browser. + * + * @memberOf XRegExp + * @param {String} str String to search. + * @param {RegExp} regex Regex to search with. + * @param {Number} [pos=0] Zero-based index at which to start the search. + * @param {Boolean|String} [sticky=false] Whether the match must start at the specified position + * only. The string `'sticky'` is accepted as an alternative to `true`. + * @returns {Array} Match array with named backreference properties, or `null`. + * @example + * + * // Basic use, with named backreference + * let match = XRegExp.exec('U+2620', XRegExp('U\\+(?[0-9A-F]{4})')); + * match.hex; // -> '2620' + * + * // With pos and sticky, in a loop + * let pos = 2, result = [], match; + * while (match = XRegExp.exec('<1><2><3><4>5<6>', /<(\d)>/, pos, 'sticky')) { + * result.push(match[1]); + * pos = match.index + match[0].length; + * } + * // result -> ['2', '3', '4'] + */ + + +XRegExp.exec = function (str, regex, pos, sticky) { + var cacheKey = 'g'; + var addY = false; + var fakeY = false; + var match; + addY = hasNativeY && !!(sticky || regex.sticky && sticky !== false); + + if (addY) { + cacheKey += 'y'; + } else if (sticky) { + // Simulate sticky matching by appending an empty capture to the original regex. The + // resulting regex will succeed no matter what at the current index (set with `lastIndex`), + // and will not search the rest of the subject string. We'll know that the original regex + // has failed if that last capture is `''` rather than `undefined` (i.e., if that last + // capture participated in the match). + fakeY = true; + cacheKey += 'FakeY'; + } + + regex[REGEX_DATA] = regex[REGEX_DATA] || {}; // Shares cached copies with `XRegExp.match`/`replace` + + var r2 = regex[REGEX_DATA][cacheKey] || (regex[REGEX_DATA][cacheKey] = copyRegex(regex, { + addG: true, + addY: addY, + source: fakeY ? "".concat(regex.source, "|()") : undefined, + removeY: sticky === false, + isInternalOnly: true + })); + pos = pos || 0; + r2.lastIndex = pos; // Fixed `exec` required for `lastIndex` fix, named backreferences, etc. + + match = fixed.exec.call(r2, str); // Get rid of the capture added by the pseudo-sticky matcher if needed. An empty string means + // the original regexp failed (see above). + + if (fakeY && match && match.pop() === '') { + match = null; + } + + if (regex.global) { + regex.lastIndex = match ? r2.lastIndex : 0; + } + + return match; +}; +/** + * Executes a provided function once per regex match. Searches always start at the beginning of the + * string and continue until the end, regardless of the state of the regex's `global` property and + * initial `lastIndex`. + * + * @memberOf XRegExp + * @param {String} str String to search. + * @param {RegExp} regex Regex to search with. + * @param {Function} callback Function to execute for each match. Invoked with four arguments: + * - The match array, with named backreference properties. + * - The zero-based match index. + * - The string being traversed. + * - The regex object being used to traverse the string. + * @example + * + * // Extracts every other digit from a string + * const evens = []; + * XRegExp.forEach('1a2345', /\d/, (match, i) => { + * if (i % 2) evens.push(+match[0]); + * }); + * // evens -> [2, 4] + */ + + +XRegExp.forEach = function (str, regex, callback) { + var pos = 0; + var i = -1; + var match; + + while (match = XRegExp.exec(str, regex, pos)) { + // Because `regex` is provided to `callback`, the function could use the deprecated/ + // nonstandard `RegExp.prototype.compile` to mutate the regex. However, since `XRegExp.exec` + // doesn't use `lastIndex` to set the search position, this can't lead to an infinite loop, + // at least. Actually, because of the way `XRegExp.exec` caches globalized versions of + // regexes, mutating the regex will not have any effect on the iteration or matched strings, + // which is a nice side effect that brings extra safety. + callback(match, ++i, str, regex); + pos = match.index + (match[0].length || 1); + } +}; +/** + * Copies a regex object and adds flag `g`. The copy maintains extended data, is augmented with + * `XRegExp.prototype` properties, and has a fresh `lastIndex` property (set to zero). Native + * regexes are not recompiled using XRegExp syntax. + * + * @memberOf XRegExp + * @param {RegExp} regex Regex to globalize. + * @returns {RegExp} Copy of the provided regex with flag `g` added. + * @example + * + * const globalCopy = XRegExp.globalize(/regex/); + * globalCopy.global; // -> true + */ + + +XRegExp.globalize = function (regex) { + return copyRegex(regex, { + addG: true + }); +}; +/** + * Installs optional features according to the specified options. Can be undone using + * `XRegExp.uninstall`. + * + * @memberOf XRegExp + * @param {Object|String} options Options object or string. + * @example + * + * // With an options object + * XRegExp.install({ + * // Enables support for astral code points in Unicode addons (implicitly sets flag A) + * astral: true, + * + * // Adds named capture groups to the `groups` property of matches + * namespacing: true + * }); + * + * // With an options string + * XRegExp.install('astral namespacing'); + */ + + +XRegExp.install = function (options) { + options = prepareOptions(options); + + if (!features.astral && options.astral) { + setAstral(true); + } + + if (!features.namespacing && options.namespacing) { + setNamespacing(true); + } +}; +/** + * Checks whether an individual optional feature is installed. + * + * @memberOf XRegExp + * @param {String} feature Name of the feature to check. One of: + * - `astral` + * - `namespacing` + * @returns {Boolean} Whether the feature is installed. + * @example + * + * XRegExp.isInstalled('astral'); + */ + + +XRegExp.isInstalled = function (feature) { + return !!features[feature]; +}; +/** + * Returns `true` if an object is a regex; `false` if it isn't. This works correctly for regexes + * created in another frame, when `instanceof` and `constructor` checks would fail. + * + * @memberOf XRegExp + * @param {*} value Object to check. + * @returns {Boolean} Whether the object is a `RegExp` object. + * @example + * + * XRegExp.isRegExp('string'); // -> false + * XRegExp.isRegExp(/regex/i); // -> true + * XRegExp.isRegExp(RegExp('^', 'm')); // -> true + * XRegExp.isRegExp(XRegExp('(?s).')); // -> true + */ + + +XRegExp.isRegExp = function (value) { + return toString.call(value) === '[object RegExp]'; +}; // isType(value, 'RegExp'); + +/** + * Returns the first matched string, or in global mode, an array containing all matched strings. + * This is essentially a more convenient re-implementation of `String.prototype.match` that gives + * the result types you actually want (string instead of `exec`-style array in match-first mode, + * and an empty array instead of `null` when no matches are found in match-all mode). It also lets + * you override flag g and ignore `lastIndex`, and fixes browser bugs. + * + * @memberOf XRegExp + * @param {String} str String to search. + * @param {RegExp} regex Regex to search with. + * @param {String} [scope='one'] Use 'one' to return the first match as a string. Use 'all' to + * return an array of all matched strings. If not explicitly specified and `regex` uses flag g, + * `scope` is 'all'. + * @returns {String|Array} In match-first mode: First match as a string, or `null`. In match-all + * mode: Array of all matched strings, or an empty array. + * @example + * + * // Match first + * XRegExp.match('abc', /\w/); // -> 'a' + * XRegExp.match('abc', /\w/g, 'one'); // -> 'a' + * XRegExp.match('abc', /x/g, 'one'); // -> null + * + * // Match all + * XRegExp.match('abc', /\w/g); // -> ['a', 'b', 'c'] + * XRegExp.match('abc', /\w/, 'all'); // -> ['a', 'b', 'c'] + * XRegExp.match('abc', /x/, 'all'); // -> [] + */ + + +XRegExp.match = function (str, regex, scope) { + var global = regex.global && scope !== 'one' || scope === 'all'; + var cacheKey = (global ? 'g' : '') + (regex.sticky ? 'y' : '') || 'noGY'; + regex[REGEX_DATA] = regex[REGEX_DATA] || {}; // Shares cached copies with `XRegExp.exec`/`replace` + + var r2 = regex[REGEX_DATA][cacheKey] || (regex[REGEX_DATA][cacheKey] = copyRegex(regex, { + addG: !!global, + removeG: scope === 'one', + isInternalOnly: true + })); + var result = nativ.match.call(toObject(str), r2); + + if (regex.global) { + regex.lastIndex = scope === 'one' && result ? // Can't use `r2.lastIndex` since `r2` is nonglobal in this case + result.index + result[0].length : 0; + } + + return global ? result || [] : result && result[0]; +}; +/** + * Retrieves the matches from searching a string using a chain of regexes that successively search + * within previous matches. The provided `chain` array can contain regexes and or objects with + * `regex` and `backref` properties. When a backreference is specified, the named or numbered + * backreference is passed forward to the next regex or returned. + * + * @memberOf XRegExp + * @param {String} str String to search. + * @param {Array} chain Regexes that each search for matches within preceding results. + * @returns {Array} Matches by the last regex in the chain, or an empty array. + * @example + * + * // Basic usage; matches numbers within tags + * XRegExp.matchChain('1 2 3 4 a 56', [ + * XRegExp('(?is).*?'), + * /\d+/ + * ]); + * // -> ['2', '4', '56'] + * + * // Passing forward and returning specific backreferences + * html = '
XRegExp\ + * Google'; + * XRegExp.matchChain(html, [ + * {regex: //i, backref: 1}, + * {regex: XRegExp('(?i)^https?://(?[^/?#]+)'), backref: 'domain'} + * ]); + * // -> ['xregexp.com', 'www.google.com'] + */ + + +XRegExp.matchChain = function (str, chain) { + return function recurseChain(values, level) { + var item = chain[level].regex ? chain[level] : { + regex: chain[level] + }; + var matches = []; + + function addMatch(match) { + if (item.backref) { + var ERR_UNDEFINED_GROUP = "Backreference to undefined group: ".concat(item.backref); + var isNamedBackref = isNaN(item.backref); + + if (isNamedBackref && XRegExp.isInstalled('namespacing')) { + // `groups` has `null` as prototype, so using `in` instead of `hasOwnProperty` + if (!(item.backref in match.groups)) { + throw new ReferenceError(ERR_UNDEFINED_GROUP); + } + } else if (!match.hasOwnProperty(item.backref)) { + throw new ReferenceError(ERR_UNDEFINED_GROUP); + } + + var backrefValue = isNamedBackref && XRegExp.isInstalled('namespacing') ? match.groups[item.backref] : match[item.backref]; + matches.push(backrefValue || ''); + } else { + matches.push(match[0]); + } + } + + var _iteratorNormalCompletion3 = true; + var _didIteratorError3 = false; + var _iteratorError3 = undefined; + + try { + for (var _iterator3 = values[Symbol.iterator](), _step3; !(_iteratorNormalCompletion3 = (_step3 = _iterator3.next()).done); _iteratorNormalCompletion3 = true) { + var value = _step3.value; + XRegExp.forEach(value, item.regex, addMatch); + } + } catch (err) { + _didIteratorError3 = true; + _iteratorError3 = err; + } finally { + try { + if (!_iteratorNormalCompletion3 && _iterator3.return != null) { + _iterator3.return(); + } + } finally { + if (_didIteratorError3) { + throw _iteratorError3; + } + } + } + + return level === chain.length - 1 || !matches.length ? matches : recurseChain(matches, level + 1); + }([str], 0); +}; +/** + * Returns a new string with one or all matches of a pattern replaced. The pattern can be a string + * or regex, and the replacement can be a string or a function to be called for each match. To + * perform a global search and replace, use the optional `scope` argument or include flag g if using + * a regex. Replacement strings can use `${n}` or `$` for named and numbered backreferences. + * Replacement functions can use named backreferences via `arguments[0].name`. Also fixes browser + * bugs compared to the native `String.prototype.replace` and can be used reliably cross-browser. + * + * @memberOf XRegExp + * @param {String} str String to search. + * @param {RegExp|String} search Search pattern to be replaced. + * @param {String|Function} replacement Replacement string or a function invoked to create it. + * Replacement strings can include special replacement syntax: + * - $$ - Inserts a literal $ character. + * - $&, $0 - Inserts the matched substring. + * - $` - Inserts the string that precedes the matched substring (left context). + * - $' - Inserts the string that follows the matched substring (right context). + * - $n, $nn - Where n/nn are digits referencing an existent capturing group, inserts + * backreference n/nn. + * - ${n}, $ - Where n is a name or any number of digits that reference an existent capturing + * group, inserts backreference n. + * Replacement functions are invoked with three or more arguments: + * - The matched substring (corresponds to $& above). Named backreferences are accessible as + * properties of this first argument. + * - 0..n arguments, one for each backreference (corresponding to $1, $2, etc. above). + * - The zero-based index of the match within the total search string. + * - The total string being searched. + * @param {String} [scope='one'] Use 'one' to replace the first match only, or 'all'. If not + * explicitly specified and using a regex with flag g, `scope` is 'all'. + * @returns {String} New string with one or all matches replaced. + * @example + * + * // Regex search, using named backreferences in replacement string + * const name = XRegExp('(?\\w+) (?\\w+)'); + * XRegExp.replace('John Smith', name, '$, $'); + * // -> 'Smith, John' + * + * // Regex search, using named backreferences in replacement function + * XRegExp.replace('John Smith', name, (match) => `${match.last}, ${match.first}`); + * // -> 'Smith, John' + * + * // String search, with replace-all + * XRegExp.replace('RegExp builds RegExps', 'RegExp', 'XRegExp', 'all'); + * // -> 'XRegExp builds XRegExps' + */ + + +XRegExp.replace = function (str, search, replacement, scope) { + var isRegex = XRegExp.isRegExp(search); + var global = search.global && scope !== 'one' || scope === 'all'; + var cacheKey = (global ? 'g' : '') + (search.sticky ? 'y' : '') || 'noGY'; + var s2 = search; + + if (isRegex) { + search[REGEX_DATA] = search[REGEX_DATA] || {}; // Shares cached copies with `XRegExp.exec`/`match`. Since a copy is used, `search`'s + // `lastIndex` isn't updated *during* replacement iterations + + s2 = search[REGEX_DATA][cacheKey] || (search[REGEX_DATA][cacheKey] = copyRegex(search, { + addG: !!global, + removeG: scope === 'one', + isInternalOnly: true + })); + } else if (global) { + s2 = new RegExp(XRegExp.escape(String(search)), 'g'); + } // Fixed `replace` required for named backreferences, etc. + + + var result = fixed.replace.call(toObject(str), s2, replacement); + + if (isRegex && search.global) { + // Fixes IE, Safari bug (last tested IE 9, Safari 5.1) + search.lastIndex = 0; + } + + return result; +}; +/** + * Performs batch processing of string replacements. Used like `XRegExp.replace`, but accepts an + * array of replacement details. Later replacements operate on the output of earlier replacements. + * Replacement details are accepted as an array with a regex or string to search for, the + * replacement string or function, and an optional scope of 'one' or 'all'. Uses the XRegExp + * replacement text syntax, which supports named backreference properties via `${name}` or + * `$`. + * + * @memberOf XRegExp + * @param {String} str String to search. + * @param {Array} replacements Array of replacement detail arrays. + * @returns {String} New string with all replacements. + * @example + * + * str = XRegExp.replaceEach(str, [ + * [XRegExp('(?a)'), 'z${name}'], + * [/b/gi, 'y'], + * [/c/g, 'x', 'one'], // scope 'one' overrides /g + * [/d/, 'w', 'all'], // scope 'all' overrides lack of /g + * ['e', 'v', 'all'], // scope 'all' allows replace-all for strings + * [/f/g, ($0) => $0.toUpperCase()] + * ]); + */ + + +XRegExp.replaceEach = function (str, replacements) { + var _iteratorNormalCompletion4 = true; + var _didIteratorError4 = false; + var _iteratorError4 = undefined; + + try { + for (var _iterator4 = replacements[Symbol.iterator](), _step4; !(_iteratorNormalCompletion4 = (_step4 = _iterator4.next()).done); _iteratorNormalCompletion4 = true) { + var r = _step4.value; + str = XRegExp.replace(str, r[0], r[1], r[2]); + } + } catch (err) { + _didIteratorError4 = true; + _iteratorError4 = err; + } finally { + try { + if (!_iteratorNormalCompletion4 && _iterator4.return != null) { + _iterator4.return(); + } + } finally { + if (_didIteratorError4) { + throw _iteratorError4; + } + } + } + + return str; +}; +/** + * Splits a string into an array of strings using a regex or string separator. Matches of the + * separator are not included in the result array. However, if `separator` is a regex that contains + * capturing groups, backreferences are spliced into the result each time `separator` is matched. + * Fixes browser bugs compared to the native `String.prototype.split` and can be used reliably + * cross-browser. + * + * @memberOf XRegExp + * @param {String} str String to split. + * @param {RegExp|String} separator Regex or string to use for separating the string. + * @param {Number} [limit] Maximum number of items to include in the result array. + * @returns {Array} Array of substrings. + * @example + * + * // Basic use + * XRegExp.split('a b c', ' '); + * // -> ['a', 'b', 'c'] + * + * // With limit + * XRegExp.split('a b c', ' ', 2); + * // -> ['a', 'b'] + * + * // Backreferences in result array + * XRegExp.split('..word1..', /([a-z]+)(\d+)/i); + * // -> ['..', 'word', '1', '..'] + */ + + +XRegExp.split = function (str, separator, limit) { + return fixed.split.call(toObject(str), separator, limit); +}; +/** + * Executes a regex search in a specified string. Returns `true` or `false`. Optional `pos` and + * `sticky` arguments specify the search start position, and whether the match must start at the + * specified position only. The `lastIndex` property of the provided regex is not used, but is + * updated for compatibility. Also fixes browser bugs compared to the native + * `RegExp.prototype.test` and can be used reliably cross-browser. + * + * @memberOf XRegExp + * @param {String} str String to search. + * @param {RegExp} regex Regex to search with. + * @param {Number} [pos=0] Zero-based index at which to start the search. + * @param {Boolean|String} [sticky=false] Whether the match must start at the specified position + * only. The string `'sticky'` is accepted as an alternative to `true`. + * @returns {Boolean} Whether the regex matched the provided value. + * @example + * + * // Basic use + * XRegExp.test('abc', /c/); // -> true + * + * // With pos and sticky + * XRegExp.test('abc', /c/, 0, 'sticky'); // -> false + * XRegExp.test('abc', /c/, 2, 'sticky'); // -> true + */ +// Do this the easy way :-) + + +XRegExp.test = function (str, regex, pos, sticky) { + return !!XRegExp.exec(str, regex, pos, sticky); +}; +/** + * Uninstalls optional features according to the specified options. All optional features start out + * uninstalled, so this is used to undo the actions of `XRegExp.install`. + * + * @memberOf XRegExp + * @param {Object|String} options Options object or string. + * @example + * + * // With an options object + * XRegExp.uninstall({ + * // Disables support for astral code points in Unicode addons + * astral: true, + * + * // Don't add named capture groups to the `groups` property of matches + * namespacing: true + * }); + * + * // With an options string + * XRegExp.uninstall('astral namespacing'); + */ + + +XRegExp.uninstall = function (options) { + options = prepareOptions(options); + + if (features.astral && options.astral) { + setAstral(false); + } + + if (features.namespacing && options.namespacing) { + setNamespacing(false); + } +}; +/** + * Returns an XRegExp object that is the union of the given patterns. Patterns can be provided as + * regex objects or strings. Metacharacters are escaped in patterns provided as strings. + * Backreferences in provided regex objects are automatically renumbered to work correctly within + * the larger combined pattern. Native flags used by provided regexes are ignored in favor of the + * `flags` argument. + * + * @memberOf XRegExp + * @param {Array} patterns Regexes and strings to combine. + * @param {String} [flags] Any combination of XRegExp flags. + * @param {Object} [options] Options object with optional properties: + * - `conjunction` {String} Type of conjunction to use: 'or' (default) or 'none'. + * @returns {RegExp} Union of the provided regexes and strings. + * @example + * + * XRegExp.union(['a+b*c', /(dogs)\1/, /(cats)\1/], 'i'); + * // -> /a\+b\*c|(dogs)\1|(cats)\2/i + * + * XRegExp.union([/man/, /bear/, /pig/], 'i', {conjunction: 'none'}); + * // -> /manbearpig/i + */ + + +XRegExp.union = function (patterns, flags, options) { + options = options || {}; + var conjunction = options.conjunction || 'or'; + var numCaptures = 0; + var numPriorCaptures; + var captureNames; + + function rewrite(match, paren, backref) { + var name = captureNames[numCaptures - numPriorCaptures]; // Capturing group + + if (paren) { + ++numCaptures; // If the current capture has a name, preserve the name + + if (name) { + return "(?<".concat(name, ">"); + } // Backreference + + } else if (backref) { + // Rewrite the backreference + return "\\".concat(+backref + numPriorCaptures); + } + + return match; + } + + if (!(isType(patterns, 'Array') && patterns.length)) { + throw new TypeError('Must provide a nonempty array of patterns to merge'); + } + + var parts = /(\()(?!\?)|\\([1-9]\d*)|\\[\s\S]|\[(?:[^\\\]]|\\[\s\S])*\]/g; + var output = []; + var _iteratorNormalCompletion5 = true; + var _didIteratorError5 = false; + var _iteratorError5 = undefined; + + try { + for (var _iterator5 = patterns[Symbol.iterator](), _step5; !(_iteratorNormalCompletion5 = (_step5 = _iterator5.next()).done); _iteratorNormalCompletion5 = true) { + var pattern = _step5.value; + + if (XRegExp.isRegExp(pattern)) { + numPriorCaptures = numCaptures; + captureNames = pattern[REGEX_DATA] && pattern[REGEX_DATA].captureNames || []; // Rewrite backreferences. Passing to XRegExp dies on octals and ensures patterns are + // independently valid; helps keep this simple. Named captures are put back + + output.push(nativ.replace.call(XRegExp(pattern.source).source, parts, rewrite)); + } else { + output.push(XRegExp.escape(pattern)); + } + } + } catch (err) { + _didIteratorError5 = true; + _iteratorError5 = err; + } finally { + try { + if (!_iteratorNormalCompletion5 && _iterator5.return != null) { + _iterator5.return(); + } + } finally { + if (_didIteratorError5) { + throw _iteratorError5; + } + } + } + + var separator = conjunction === 'none' ? '' : '|'; + return XRegExp(output.join(separator), flags); +}; // ==--------------------------== +// Fixed/extended native methods +// ==--------------------------== + +/** + * Adds named capture support (with backreferences returned as `result.name`), and fixes browser + * bugs in the native `RegExp.prototype.exec`. Use via `XRegExp.exec`. + * + * @memberOf RegExp + * @param {String} str String to search. + * @returns {Array} Match array with named backreference properties, or `null`. + */ + + +fixed.exec = function (str) { + var origLastIndex = this.lastIndex; + var match = nativ.exec.apply(this, arguments); + + if (match) { + // Fix browsers whose `exec` methods don't return `undefined` for nonparticipating capturing + // groups. This fixes IE 5.5-8, but not IE 9's quirks mode or emulation of older IEs. IE 9 + // in standards mode follows the spec. + if (!correctExecNpcg && match.length > 1 && match.indexOf('') !== -1) { + var r2 = copyRegex(this, { + removeG: true, + isInternalOnly: true + }); // Using `str.slice(match.index)` rather than `match[0]` in case lookahead allowed + // matching due to characters outside the match + + nativ.replace.call(String(str).slice(match.index), r2, function () { + var len = arguments.length; // Skip index 0 and the last 2 + + for (var i = 1; i < len - 2; ++i) { + if ((i < 0 || arguments.length <= i ? undefined : arguments[i]) === undefined) { + match[i] = undefined; + } + } + }); + } // Attach named capture properties + + + var groupsObject = match; + + if (XRegExp.isInstalled('namespacing')) { + // https://tc39.github.io/proposal-regexp-named-groups/#sec-regexpbuiltinexec + match.groups = Object.create(null); + groupsObject = match.groups; + } + + if (this[REGEX_DATA] && this[REGEX_DATA].captureNames) { + // Skip index 0 + for (var i = 1; i < match.length; ++i) { + var name = this[REGEX_DATA].captureNames[i - 1]; + + if (name) { + groupsObject[name] = match[i]; + } + } + } // Fix browsers that increment `lastIndex` after zero-length matches + + + if (this.global && !match[0].length && this.lastIndex > match.index) { + this.lastIndex = match.index; + } + } + + if (!this.global) { + // Fixes IE, Opera bug (last tested IE 9, Opera 11.6) + this.lastIndex = origLastIndex; + } + + return match; +}; +/** + * Fixes browser bugs in the native `RegExp.prototype.test`. + * + * @memberOf RegExp + * @param {String} str String to search. + * @returns {Boolean} Whether the regex matched the provided value. + */ + + +fixed.test = function (str) { + // Do this the easy way :-) + return !!fixed.exec.call(this, str); +}; +/** + * Adds named capture support (with backreferences returned as `result.name`), and fixes browser + * bugs in the native `String.prototype.match`. + * + * @memberOf String + * @param {RegExp|*} regex Regex to search with. If not a regex object, it is passed to `RegExp`. + * @returns {Array} If `regex` uses flag g, an array of match strings or `null`. Without flag g, + * the result of calling `regex.exec(this)`. + */ + + +fixed.match = function (regex) { + if (!XRegExp.isRegExp(regex)) { + // Use the native `RegExp` rather than `XRegExp` + regex = new RegExp(regex); + } else if (regex.global) { + var result = nativ.match.apply(this, arguments); // Fixes IE bug + + regex.lastIndex = 0; + return result; + } + + return fixed.exec.call(regex, toObject(this)); +}; +/** + * Adds support for `${n}` (or `$`) tokens for named and numbered backreferences in replacement + * text, and provides named backreferences to replacement functions as `arguments[0].name`. Also + * fixes browser bugs in replacement text syntax when performing a replacement using a nonregex + * search value, and the value of a replacement regex's `lastIndex` property during replacement + * iterations and upon completion. Note that this doesn't support SpiderMonkey's proprietary third + * (`flags`) argument. Use via `XRegExp.replace`. + * + * @memberOf String + * @param {RegExp|String} search Search pattern to be replaced. + * @param {String|Function} replacement Replacement string or a function invoked to create it. + * @returns {String} New string with one or all matches replaced. + */ + + +fixed.replace = function (search, replacement) { + var isRegex = XRegExp.isRegExp(search); + var origLastIndex; + var captureNames; + var result; + + if (isRegex) { + if (search[REGEX_DATA]) { + captureNames = search[REGEX_DATA].captureNames; + } // Only needed if `search` is nonglobal + + + origLastIndex = search.lastIndex; + } else { + search += ''; // Type-convert + } // Don't use `typeof`; some older browsers return 'function' for regex objects + + + if (isType(replacement, 'Function')) { + // Stringifying `this` fixes a bug in IE < 9 where the last argument in replacement + // functions isn't type-converted to a string + result = nativ.replace.call(String(this), search, function () { + for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) { + args[_key] = arguments[_key]; + } + + if (captureNames) { + var groupsObject; + + if (XRegExp.isInstalled('namespacing')) { + // https://tc39.github.io/proposal-regexp-named-groups/#sec-regexpbuiltinexec + groupsObject = Object.create(null); + args.push(groupsObject); + } else { + // Change the `args[0]` string primitive to a `String` object that can store + // properties. This really does need to use `String` as a constructor + args[0] = new String(args[0]); + groupsObject = args[0]; + } // Store named backreferences + + + for (var i = 0; i < captureNames.length; ++i) { + if (captureNames[i]) { + groupsObject[captureNames[i]] = args[i + 1]; + } + } + } // Update `lastIndex` before calling `replacement`. Fixes IE, Chrome, Firefox, Safari + // bug (last tested IE 9, Chrome 17, Firefox 11, Safari 5.1) + + + if (isRegex && search.global) { + search.lastIndex = args[args.length - 2] + args[0].length; + } // ES6 specs the context for replacement functions as `undefined` + + + return replacement.apply(void 0, args); + }); + } else { + // Ensure that the last value of `args` will be a string when given nonstring `this`, + // while still throwing on null or undefined context + result = nativ.replace.call(this == null ? this : String(this), search, function () { + for (var _len2 = arguments.length, args = new Array(_len2), _key2 = 0; _key2 < _len2; _key2++) { + args[_key2] = arguments[_key2]; + } + + return nativ.replace.call(String(replacement), replacementToken, replacer); + + function replacer($0, bracketed, angled, dollarToken) { + bracketed = bracketed || angled; // Named or numbered backreference with curly or angled braces + + if (bracketed) { + // XRegExp behavior for `${n}` or `$`: + // 1. Backreference to numbered capture, if `n` is an integer. Use `0` for the + // entire match. Any number of leading zeros may be used. + // 2. Backreference to named capture `n`, if it exists and is not an integer + // overridden by numbered capture. In practice, this does not overlap with + // numbered capture since XRegExp does not allow named capture to use a bare + // integer as the name. + // 3. If the name or number does not refer to an existing capturing group, it's + // an error. + var n = +bracketed; // Type-convert; drop leading zeros + + if (n <= args.length - 3) { + return args[n] || ''; + } // Groups with the same name is an error, else would need `lastIndexOf` + + + n = captureNames ? captureNames.indexOf(bracketed) : -1; + + if (n < 0) { + throw new SyntaxError("Backreference to undefined group ".concat($0)); + } + + return args[n + 1] || ''; + } // Else, special variable or numbered backreference without curly braces + + + if (dollarToken === '$') { + // $$ + return '$'; + } + + if (dollarToken === '&' || +dollarToken === 0) { + // $&, $0 (not followed by 1-9), $00 + return args[0]; + } + + if (dollarToken === '`') { + // $` (left context) + return args[args.length - 1].slice(0, args[args.length - 2]); + } + + if (dollarToken === "'") { + // $' (right context) + return args[args.length - 1].slice(args[args.length - 2] + args[0].length); + } // Else, numbered backreference without braces + + + dollarToken = +dollarToken; // Type-convert; drop leading zero + // XRegExp behavior for `$n` and `$nn`: + // - Backrefs end after 1 or 2 digits. Use `${..}` or `$<..>` for more digits. + // - `$1` is an error if no capturing groups. + // - `$10` is an error if less than 10 capturing groups. Use `${1}0` or `$<1>0` + // instead. + // - `$01` is `$1` if at least one capturing group, else it's an error. + // - `$0` (not followed by 1-9) and `$00` are the entire match. + // Native behavior, for comparison: + // - Backrefs end after 1 or 2 digits. Cannot reference capturing group 100+. + // - `$1` is a literal `$1` if no capturing groups. + // - `$10` is `$1` followed by a literal `0` if less than 10 capturing groups. + // - `$01` is `$1` if at least one capturing group, else it's a literal `$01`. + // - `$0` is a literal `$0`. + + if (!isNaN(dollarToken)) { + if (dollarToken > args.length - 3) { + throw new SyntaxError("Backreference to undefined group ".concat($0)); + } + + return args[dollarToken] || ''; + } // `$` followed by an unsupported char is an error, unlike native JS + + + throw new SyntaxError("Invalid token ".concat($0)); + } + }); + } + + if (isRegex) { + if (search.global) { + // Fixes IE, Safari bug (last tested IE 9, Safari 5.1) + search.lastIndex = 0; + } else { + // Fixes IE, Opera bug (last tested IE 9, Opera 11.6) + search.lastIndex = origLastIndex; + } + } + + return result; +}; +/** + * Fixes browser bugs in the native `String.prototype.split`. Use via `XRegExp.split`. + * + * @memberOf String + * @param {RegExp|String} separator Regex or string to use for separating the string. + * @param {Number} [limit] Maximum number of items to include in the result array. + * @returns {Array} Array of substrings. + */ + + +fixed.split = function (separator, limit) { + if (!XRegExp.isRegExp(separator)) { + // Browsers handle nonregex split correctly, so use the faster native method + return nativ.split.apply(this, arguments); + } + + var str = String(this); + var output = []; + var origLastIndex = separator.lastIndex; + var lastLastIndex = 0; + var lastLength; // Values for `limit`, per the spec: + // If undefined: pow(2,32) - 1 + // If 0, Infinity, or NaN: 0 + // If positive number: limit = floor(limit); if (limit >= pow(2,32)) limit -= pow(2,32); + // If negative number: pow(2,32) - floor(abs(limit)) + // If other: Type-convert, then use the above rules + // This line fails in very strange ways for some values of `limit` in Opera 10.5-10.63, unless + // Opera Dragonfly is open (go figure). It works in at least Opera 9.5-10.1 and 11+ + + limit = (limit === undefined ? -1 : limit) >>> 0; + XRegExp.forEach(str, separator, function (match) { + // This condition is not the same as `if (match[0].length)` + if (match.index + match[0].length > lastLastIndex) { + output.push(str.slice(lastLastIndex, match.index)); + + if (match.length > 1 && match.index < str.length) { + Array.prototype.push.apply(output, match.slice(1)); + } + + lastLength = match[0].length; + lastLastIndex = match.index + lastLength; + } + }); + + if (lastLastIndex === str.length) { + if (!nativ.test.call(separator, '') || lastLength) { + output.push(''); + } + } else { + output.push(str.slice(lastLastIndex)); + } + + separator.lastIndex = origLastIndex; + return output.length > limit ? output.slice(0, limit) : output; +}; // ==--------------------------== +// Built-in syntax/flag tokens +// ==--------------------------== + +/* + * Letter escapes that natively match literal characters: `\a`, `\A`, etc. These should be + * SyntaxErrors but are allowed in web reality. XRegExp makes them errors for cross-browser + * consistency and to reserve their syntax, but lets them be superseded by addons. + */ + + +XRegExp.addToken(/\\([ABCE-RTUVXYZaeg-mopqyz]|c(?![A-Za-z])|u(?![\dA-Fa-f]{4}|{[\dA-Fa-f]+})|x(?![\dA-Fa-f]{2}))/, function (match, scope) { + // \B is allowed in default scope only + if (match[1] === 'B' && scope === defaultScope) { + return match[0]; + } + + throw new SyntaxError("Invalid escape ".concat(match[0])); +}, { + scope: 'all', + leadChar: '\\' +}); +/* + * Unicode code point escape with curly braces: `\u{N..}`. `N..` is any one or more digit + * hexadecimal number from 0-10FFFF, and can include leading zeros. Requires the native ES6 `u` flag + * to support code points greater than U+FFFF. Avoids converting code points above U+FFFF to + * surrogate pairs (which could be done without flag `u`), since that could lead to broken behavior + * if you follow a `\u{N..}` token that references a code point above U+FFFF with a quantifier, or + * if you use the same in a character class. + */ + +XRegExp.addToken(/\\u{([\dA-Fa-f]+)}/, function (match, scope, flags) { + var code = dec(match[1]); + + if (code > 0x10FFFF) { + throw new SyntaxError("Invalid Unicode code point ".concat(match[0])); + } + + if (code <= 0xFFFF) { + // Converting to \uNNNN avoids needing to escape the literal character and keep it + // separate from preceding tokens + return "\\u".concat(pad4(hex(code))); + } // If `code` is between 0xFFFF and 0x10FFFF, require and defer to native handling + + + if (hasNativeU && flags.indexOf('u') !== -1) { + return match[0]; + } + + throw new SyntaxError('Cannot use Unicode code point above \\u{FFFF} without flag u'); +}, { + scope: 'all', + leadChar: '\\' +}); +/* + * Empty character class: `[]` or `[^]`. This fixes a critical cross-browser syntax inconsistency. + * Unless this is standardized (per the ES spec), regex syntax can't be accurately parsed because + * character class endings can't be determined. + */ + +XRegExp.addToken(/\[(\^?)\]/, // For cross-browser compatibility with ES3, convert [] to \b\B and [^] to [\s\S]. +// (?!) should work like \b\B, but is unreliable in some versions of Firefox + +/* eslint-disable no-confusing-arrow */ +function (match) { + return match[1] ? '[\\s\\S]' : '\\b\\B'; +}, +/* eslint-enable no-confusing-arrow */ +{ + leadChar: '[' +}); +/* + * Comment pattern: `(?# )`. Inline comments are an alternative to the line comments allowed in + * free-spacing mode (flag x). + */ + +XRegExp.addToken(/\(\?#[^)]*\)/, getContextualTokenSeparator, { + leadChar: '(' +}); +/* + * Whitespace and line comments, in free-spacing mode (aka extended mode, flag x) only. + */ + +XRegExp.addToken(/\s+|#[^\n]*\n?/, getContextualTokenSeparator, { + flag: 'x' +}); +/* + * Dot, in dotall mode (aka singleline mode, flag s) only. + */ + +XRegExp.addToken(/\./, function () { + return '[\\s\\S]'; +}, { + flag: 's', + leadChar: '.' +}); +/* + * Named backreference: `\k`. Backreference names can use the characters A-Z, a-z, 0-9, _, + * and $ only. Also allows numbered backreferences as `\k`. + */ + +XRegExp.addToken(/\\k<([\w$]+)>/, function (match) { + // Groups with the same name is an error, else would need `lastIndexOf` + var index = isNaN(match[1]) ? this.captureNames.indexOf(match[1]) + 1 : +match[1]; + var endIndex = match.index + match[0].length; + + if (!index || index > this.captureNames.length) { + throw new SyntaxError("Backreference to undefined group ".concat(match[0])); + } // Keep backreferences separate from subsequent literal numbers. This avoids e.g. + // inadvertedly changing `(?)\k1` to `()\11`. + + + return "\\".concat(index).concat(endIndex === match.input.length || isNaN(match.input[endIndex]) ? '' : '(?:)'); +}, { + leadChar: '\\' +}); +/* + * Numbered backreference or octal, plus any following digits: `\0`, `\11`, etc. Octals except `\0` + * not followed by 0-9 and backreferences to unopened capture groups throw an error. Other matches + * are returned unaltered. IE < 9 doesn't support backreferences above `\99` in regex syntax. + */ + +XRegExp.addToken(/\\(\d+)/, function (match, scope) { + if (!(scope === defaultScope && /^[1-9]/.test(match[1]) && +match[1] <= this.captureNames.length) && match[1] !== '0') { + throw new SyntaxError("Cannot use octal escape or backreference to undefined group ".concat(match[0])); + } + + return match[0]; +}, { + scope: 'all', + leadChar: '\\' +}); +/* + * Named capturing group; match the opening delimiter only: `(?`. Capture names can use the + * characters A-Z, a-z, 0-9, _, and $ only. Names can't be integers. Supports Python-style + * `(?P` as an alternate syntax to avoid issues in some older versions of Opera which natively + * supported the Python-style syntax. Otherwise, XRegExp might treat numbered backreferences to + * Python-style named capture as octals. + */ + +XRegExp.addToken(/\(\?P?<([\w$]+)>/, function (match) { + // Disallow bare integers as names because named backreferences are added to match arrays + // and therefore numeric properties may lead to incorrect lookups + if (!isNaN(match[1])) { + throw new SyntaxError("Cannot use integer as capture name ".concat(match[0])); + } + + if (!XRegExp.isInstalled('namespacing') && (match[1] === 'length' || match[1] === '__proto__')) { + throw new SyntaxError("Cannot use reserved word as capture name ".concat(match[0])); + } + + if (this.captureNames.indexOf(match[1]) !== -1) { + throw new SyntaxError("Cannot use same name for multiple groups ".concat(match[0])); + } + + this.captureNames.push(match[1]); + this.hasNamedCapture = true; + return '('; +}, { + leadChar: '(' +}); +/* + * Capturing group; match the opening parenthesis only. Required for support of named capturing + * groups. Also adds explicit capture mode (flag n). + */ + +XRegExp.addToken(/\((?!\?)/, function (match, scope, flags) { + if (flags.indexOf('n') !== -1) { + return '(?:'; + } + + this.captureNames.push(null); + return '('; +}, { + optionalFlags: 'n', + leadChar: '(' +}); +var _default = XRegExp; +exports.default = _default; +module.exports = exports["default"]; +}); + +unwrapExports(xregexp); + +var build = createCommonjsModule(function (module, exports) { +"use strict"; + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.default = void 0; + +/*! + * XRegExp.build 4.2.0 + * + * Steven Levithan (c) 2012-present MIT License + */ +var _default = function _default(XRegExp) { + var REGEX_DATA = 'xregexp'; + var subParts = /(\()(?!\?)|\\([1-9]\d*)|\\[\s\S]|\[(?:[^\\\]]|\\[\s\S])*\]/g; + var parts = XRegExp.union([/\({{([\w$]+)}}\)|{{([\w$]+)}}/, subParts], 'g', { + conjunction: 'or' + }); + /** + * Strips a leading `^` and trailing unescaped `$`, if both are present. + * + * @private + * @param {String} pattern Pattern to process. + * @returns {String} Pattern with edge anchors removed. + */ + + function deanchor(pattern) { + // Allow any number of empty noncapturing groups before/after anchors, because regexes + // built/generated by XRegExp sometimes include them + var leadingAnchor = /^(?:\(\?:\))*\^/; + var trailingAnchor = /\$(?:\(\?:\))*$/; + + if (leadingAnchor.test(pattern) && trailingAnchor.test(pattern) && // Ensure that the trailing `$` isn't escaped + trailingAnchor.test(pattern.replace(/\\[\s\S]/g, ''))) { + return pattern.replace(leadingAnchor, '').replace(trailingAnchor, ''); + } + + return pattern; + } + /** + * Converts the provided value to an XRegExp. Native RegExp flags are not preserved. + * + * @private + * @param {String|RegExp} value Value to convert. + * @param {Boolean} [addFlagX] Whether to apply the `x` flag in cases when `value` is not + * already a regex generated by XRegExp + * @returns {RegExp} XRegExp object with XRegExp syntax applied. + */ + + + function asXRegExp(value, addFlagX) { + var flags = addFlagX ? 'x' : ''; + return XRegExp.isRegExp(value) ? value[REGEX_DATA] && value[REGEX_DATA].captureNames ? // Don't recompile, to preserve capture names + value : // Recompile as XRegExp + XRegExp(value.source, flags) : // Compile string as XRegExp + XRegExp(value, flags); + } + + function interpolate(substitution) { + return substitution instanceof RegExp ? substitution : XRegExp.escape(substitution); + } + + function reduceToSubpatternsObject(subpatterns, interpolated, subpatternIndex) { + subpatterns["subpattern".concat(subpatternIndex)] = interpolated; + return subpatterns; + } + + function embedSubpatternAfter(raw, subpatternIndex, rawLiterals) { + var hasSubpattern = subpatternIndex < rawLiterals.length - 1; + return raw + (hasSubpattern ? "{{subpattern".concat(subpatternIndex, "}}") : ''); + } + /** + * Provides tagged template literals that create regexes with XRegExp syntax and flags. The + * provided pattern is handled as a raw string, so backslashes don't need to be escaped. + * + * Interpolation of strings and regexes shares the features of `XRegExp.build`. Interpolated + * patterns are treated as atomic units when quantified, interpolated strings have their special + * characters escaped, a leading `^` and trailing unescaped `$` are stripped from interpolated + * regexes if both are present, and any backreferences within an interpolated regex are + * rewritten to work within the overall pattern. + * + * @memberOf XRegExp + * @param {String} [flags] Any combination of XRegExp flags. + * @returns {Function} Handler for template literals that construct regexes with XRegExp syntax. + * @example + * + * const h12 = /1[0-2]|0?[1-9]/; + * const h24 = /2[0-3]|[01][0-9]/; + * const hours = XRegExp.tag('x')`${h12} : | ${h24}`; + * const minutes = /^[0-5][0-9]$/; + * // Note that explicitly naming the 'minutes' group is required for named backreferences + * const time = XRegExp.tag('x')`^ ${hours} (?${minutes}) $`; + * time.test('10:59'); // -> true + * XRegExp.exec('10:59', time).minutes; // -> '59' + */ + + + XRegExp.tag = function (flags) { + return function (literals) { + for (var _len = arguments.length, substitutions = new Array(_len > 1 ? _len - 1 : 0), _key = 1; _key < _len; _key++) { + substitutions[_key - 1] = arguments[_key]; + } + + var subpatterns = substitutions.map(interpolate).reduce(reduceToSubpatternsObject, {}); + var pattern = literals.raw.map(embedSubpatternAfter).join(''); + return XRegExp.build(pattern, subpatterns, flags); + }; + }; + /** + * Builds regexes using named subpatterns, for readability and pattern reuse. Backreferences in + * the outer pattern and provided subpatterns are automatically renumbered to work correctly. + * Native flags used by provided subpatterns are ignored in favor of the `flags` argument. + * + * @memberOf XRegExp + * @param {String} pattern XRegExp pattern using `{{name}}` for embedded subpatterns. Allows + * `({{name}})` as shorthand for `(?{{name}})`. Patterns cannot be embedded within + * character classes. + * @param {Object} subs Lookup object for named subpatterns. Values can be strings or regexes. A + * leading `^` and trailing unescaped `$` are stripped from subpatterns, if both are present. + * @param {String} [flags] Any combination of XRegExp flags. + * @returns {RegExp} Regex with interpolated subpatterns. + * @example + * + * const time = XRegExp.build('(?x)^ {{hours}} ({{minutes}}) $', { + * hours: XRegExp.build('{{h12}} : | {{h24}}', { + * h12: /1[0-2]|0?[1-9]/, + * h24: /2[0-3]|[01][0-9]/ + * }, 'x'), + * minutes: /^[0-5][0-9]$/ + * }); + * time.test('10:59'); // -> true + * XRegExp.exec('10:59', time).minutes; // -> '59' + */ + + + XRegExp.build = function (pattern, subs, flags) { + flags = flags || ''; // Used with `asXRegExp` calls for `pattern` and subpatterns in `subs`, to work around how + // some browsers convert `RegExp('\n')` to a regex that contains the literal characters `\` + // and `n`. See more details at . + + var addFlagX = flags.indexOf('x') !== -1; + var inlineFlags = /^\(\?([\w$]+)\)/.exec(pattern); // Add flags within a leading mode modifier to the overall pattern's flags + + if (inlineFlags) { + flags = XRegExp._clipDuplicates(flags + inlineFlags[1]); + } + + var data = {}; + + for (var p in subs) { + if (subs.hasOwnProperty(p)) { + // Passing to XRegExp enables extended syntax and ensures independent validity, + // lest an unescaped `(`, `)`, `[`, or trailing `\` breaks the `(?:)` wrapper. For + // subpatterns provided as native regexes, it dies on octals and adds the property + // used to hold extended regex instance data, for simplicity. + var sub = asXRegExp(subs[p], addFlagX); + data[p] = { + // Deanchoring allows embedding independently useful anchored regexes. If you + // really need to keep your anchors, double them (i.e., `^^...$$`). + pattern: deanchor(sub.source), + names: sub[REGEX_DATA].captureNames || [] + }; + } + } // Passing to XRegExp dies on octals and ensures the outer pattern is independently valid; + // helps keep this simple. Named captures will be put back. + + + var patternAsRegex = asXRegExp(pattern, addFlagX); // 'Caps' is short for 'captures' + + var numCaps = 0; + var numPriorCaps; + var numOuterCaps = 0; + var outerCapsMap = [0]; + var outerCapNames = patternAsRegex[REGEX_DATA].captureNames || []; + var output = patternAsRegex.source.replace(parts, function ($0, $1, $2, $3, $4) { + var subName = $1 || $2; + var capName; + var intro; + var localCapIndex; // Named subpattern + + if (subName) { + if (!data.hasOwnProperty(subName)) { + throw new ReferenceError("Undefined property ".concat($0)); + } // Named subpattern was wrapped in a capturing group + + + if ($1) { + capName = outerCapNames[numOuterCaps]; + outerCapsMap[++numOuterCaps] = ++numCaps; // If it's a named group, preserve the name. Otherwise, use the subpattern name + // as the capture name + + intro = "(?<".concat(capName || subName, ">"); + } else { + intro = '(?:'; + } + + numPriorCaps = numCaps; + var rewrittenSubpattern = data[subName].pattern.replace(subParts, function (match, paren, backref) { + // Capturing group + if (paren) { + capName = data[subName].names[numCaps - numPriorCaps]; + ++numCaps; // If the current capture has a name, preserve the name + + if (capName) { + return "(?<".concat(capName, ">"); + } // Backreference + + } else if (backref) { + localCapIndex = +backref - 1; // Rewrite the backreference + + return data[subName].names[localCapIndex] ? // Need to preserve the backreference name in case using flag `n` + "\\k<".concat(data[subName].names[localCapIndex], ">") : "\\".concat(+backref + numPriorCaps); + } + + return match; + }); + return "".concat(intro).concat(rewrittenSubpattern, ")"); + } // Capturing group + + + if ($3) { + capName = outerCapNames[numOuterCaps]; + outerCapsMap[++numOuterCaps] = ++numCaps; // If the current capture has a name, preserve the name + + if (capName) { + return "(?<".concat(capName, ">"); + } // Backreference + + } else if ($4) { + localCapIndex = +$4 - 1; // Rewrite the backreference + + return outerCapNames[localCapIndex] ? // Need to preserve the backreference name in case using flag `n` + "\\k<".concat(outerCapNames[localCapIndex], ">") : "\\".concat(outerCapsMap[+$4]); + } + + return $0; + }); + return XRegExp(output, flags); + }; +}; + +exports.default = _default; +module.exports = exports["default"]; +}); + +unwrapExports(build); + +var matchrecursive = createCommonjsModule(function (module, exports) { +"use strict"; + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.default = void 0; + +/*! + * XRegExp.matchRecursive 4.2.0 + * + * Steven Levithan (c) 2009-present MIT License + */ +var _default = function _default(XRegExp) { + /** + * Returns a match detail object composed of the provided values. + * + * @private + */ + function row(name, value, start, end) { + return { + name: name, + value: value, + start: start, + end: end + }; + } + /** + * Returns an array of match strings between outermost left and right delimiters, or an array of + * objects with detailed match parts and position data. An error is thrown if delimiters are + * unbalanced within the data. + * + * @memberOf XRegExp + * @param {String} str String to search. + * @param {String} left Left delimiter as an XRegExp pattern. + * @param {String} right Right delimiter as an XRegExp pattern. + * @param {String} [flags] Any native or XRegExp flags, used for the left and right delimiters. + * @param {Object} [options] Lets you specify `valueNames` and `escapeChar` options. + * @returns {Array} Array of matches, or an empty array. + * @example + * + * // Basic usage + * let str = '(t((e))s)t()(ing)'; + * XRegExp.matchRecursive(str, '\\(', '\\)', 'g'); + * // -> ['t((e))s', '', 'ing'] + * + * // Extended information mode with valueNames + * str = 'Here is
an
example'; + * XRegExp.matchRecursive(str, '', '', 'gi', { + * valueNames: ['between', 'left', 'match', 'right'] + * }); + * // -> [ + * // {name: 'between', value: 'Here is ', start: 0, end: 8}, + * // {name: 'left', value: '
', start: 8, end: 13}, + * // {name: 'match', value: '
an
', start: 13, end: 27}, + * // {name: 'right', value: '
', start: 27, end: 33}, + * // {name: 'between', value: ' example', start: 33, end: 41} + * // ] + * + * // Omitting unneeded parts with null valueNames, and using escapeChar + * str = '...{1}.\\{{function(x,y){return {y:x}}}'; + * XRegExp.matchRecursive(str, '{', '}', 'g', { + * valueNames: ['literal', null, 'value', null], + * escapeChar: '\\' + * }); + * // -> [ + * // {name: 'literal', value: '...', start: 0, end: 3}, + * // {name: 'value', value: '1', start: 4, end: 5}, + * // {name: 'literal', value: '.\\{', start: 6, end: 9}, + * // {name: 'value', value: 'function(x,y){return {y:x}}', start: 10, end: 37} + * // ] + * + * // Sticky mode via flag y + * str = '<1><<<2>>><3>4<5>'; + * XRegExp.matchRecursive(str, '<', '>', 'gy'); + * // -> ['1', '<<2>>', '3'] + */ + + + XRegExp.matchRecursive = function (str, left, right, flags, options) { + flags = flags || ''; + options = options || {}; + var global = flags.indexOf('g') !== -1; + var sticky = flags.indexOf('y') !== -1; // Flag `y` is controlled internally + + var basicFlags = flags.replace(/y/g, ''); + var _options = options, + escapeChar = _options.escapeChar; + var vN = options.valueNames; + var output = []; + var openTokens = 0; + var delimStart = 0; + var delimEnd = 0; + var lastOuterEnd = 0; + var outerStart; + var innerStart; + var leftMatch; + var rightMatch; + var esc; + left = XRegExp(left, basicFlags); + right = XRegExp(right, basicFlags); + + if (escapeChar) { + if (escapeChar.length > 1) { + throw new Error('Cannot use more than one escape character'); + } + + escapeChar = XRegExp.escape(escapeChar); // Example of concatenated `esc` regex: + // `escapeChar`: '%' + // `left`: '<' + // `right`: '>' + // Regex is: /(?:%[\S\s]|(?:(?!<|>)[^%])+)+/ + + esc = new RegExp("(?:".concat(escapeChar, "[\\S\\s]|(?:(?!").concat( // Using `XRegExp.union` safely rewrites backreferences in `left` and `right`. + // Intentionally not passing `basicFlags` to `XRegExp.union` since any syntax + // transformation resulting from those flags was already applied to `left` and + // `right` when they were passed through the XRegExp constructor above. + XRegExp.union([left, right], '', { + conjunction: 'or' + }).source, ")[^").concat(escapeChar, "])+)+"), // Flags `gy` not needed here + flags.replace(/[^imu]+/g, '')); + } + + while (true) { + // If using an escape character, advance to the delimiter's next starting position, + // skipping any escaped characters in between + if (escapeChar) { + delimEnd += (XRegExp.exec(str, esc, delimEnd, 'sticky') || [''])[0].length; + } + + leftMatch = XRegExp.exec(str, left, delimEnd); + rightMatch = XRegExp.exec(str, right, delimEnd); // Keep the leftmost match only + + if (leftMatch && rightMatch) { + if (leftMatch.index <= rightMatch.index) { + rightMatch = null; + } else { + leftMatch = null; + } + } // Paths (LM: leftMatch, RM: rightMatch, OT: openTokens): + // LM | RM | OT | Result + // 1 | 0 | 1 | loop + // 1 | 0 | 0 | loop + // 0 | 1 | 1 | loop + // 0 | 1 | 0 | throw + // 0 | 0 | 1 | throw + // 0 | 0 | 0 | break + // The paths above don't include the sticky mode special case. The loop ends after the + // first completed match if not `global`. + + + if (leftMatch || rightMatch) { + delimStart = (leftMatch || rightMatch).index; + delimEnd = delimStart + (leftMatch || rightMatch)[0].length; + } else if (!openTokens) { + break; + } + + if (sticky && !openTokens && delimStart > lastOuterEnd) { + break; + } + + if (leftMatch) { + if (!openTokens) { + outerStart = delimStart; + innerStart = delimEnd; + } + + ++openTokens; + } else if (rightMatch && openTokens) { + if (! --openTokens) { + if (vN) { + if (vN[0] && outerStart > lastOuterEnd) { + output.push(row(vN[0], str.slice(lastOuterEnd, outerStart), lastOuterEnd, outerStart)); + } + + if (vN[1]) { + output.push(row(vN[1], str.slice(outerStart, innerStart), outerStart, innerStart)); + } + + if (vN[2]) { + output.push(row(vN[2], str.slice(innerStart, delimStart), innerStart, delimStart)); + } + + if (vN[3]) { + output.push(row(vN[3], str.slice(delimStart, delimEnd), delimStart, delimEnd)); + } + } else { + output.push(str.slice(innerStart, delimStart)); + } + + lastOuterEnd = delimEnd; + + if (!global) { + break; + } + } + } else { + throw new Error('Unbalanced delimiter found in string'); + } // If the delimiter matched an empty string, avoid an infinite loop + + + if (delimStart === delimEnd) { + ++delimEnd; + } + } + + if (global && !sticky && vN && vN[0] && str.length > lastOuterEnd) { + output.push(row(vN[0], str.slice(lastOuterEnd), lastOuterEnd, str.length)); + } + + return output; + }; +}; + +exports.default = _default; +module.exports = exports["default"]; +}); + +unwrapExports(matchrecursive); + +var unicodeBase = createCommonjsModule(function (module, exports) { +"use strict"; + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.default = void 0; + +/*! + * XRegExp Unicode Base 4.2.0 + * + * Steven Levithan (c) 2008-present MIT License + */ +var _default = function _default(XRegExp) { + /** + * Adds base support for Unicode matching: + * - Adds syntax `\p{..}` for matching Unicode tokens. Tokens can be inverted using `\P{..}` or + * `\p{^..}`. Token names ignore case, spaces, hyphens, and underscores. You can omit the + * braces for token names that are a single letter (e.g. `\pL` or `PL`). + * - Adds flag A (astral), which enables 21-bit Unicode support. + * - Adds the `XRegExp.addUnicodeData` method used by other addons to provide character data. + * + * Unicode Base relies on externally provided Unicode character data. Official addons are + * available to provide data for Unicode categories, scripts, blocks, and properties. + * + * @requires XRegExp + */ + // ==--------------------------== + // Private stuff + // ==--------------------------== + // Storage for Unicode data + var unicode = {}; // Reuse utils + + var dec = XRegExp._dec; + var hex = XRegExp._hex; + var pad4 = XRegExp._pad4; // Generates a token lookup name: lowercase, with hyphens, spaces, and underscores removed + + function normalize(name) { + return name.replace(/[- _]+/g, '').toLowerCase(); + } // Gets the decimal code of a literal code unit, \xHH, \uHHHH, or a backslash-escaped literal + + + function charCode(chr) { + var esc = /^\\[xu](.+)/.exec(chr); + return esc ? dec(esc[1]) : chr.charCodeAt(chr[0] === '\\' ? 1 : 0); + } // Inverts a list of ordered BMP characters and ranges + + + function invertBmp(range) { + var output = ''; + var lastEnd = -1; + XRegExp.forEach(range, /(\\x..|\\u....|\\?[\s\S])(?:-(\\x..|\\u....|\\?[\s\S]))?/, function (m) { + var start = charCode(m[1]); + + if (start > lastEnd + 1) { + output += "\\u".concat(pad4(hex(lastEnd + 1))); + + if (start > lastEnd + 2) { + output += "-\\u".concat(pad4(hex(start - 1))); + } + } + + lastEnd = charCode(m[2] || m[1]); + }); + + if (lastEnd < 0xFFFF) { + output += "\\u".concat(pad4(hex(lastEnd + 1))); + + if (lastEnd < 0xFFFE) { + output += '-\\uFFFF'; + } + } + + return output; + } // Generates an inverted BMP range on first use + + + function cacheInvertedBmp(slug) { + var prop = 'b!'; + return unicode[slug][prop] || (unicode[slug][prop] = invertBmp(unicode[slug].bmp)); + } // Combines and optionally negates BMP and astral data + + + function buildAstral(slug, isNegated) { + var item = unicode[slug]; + var combined = ''; + + if (item.bmp && !item.isBmpLast) { + combined = "[".concat(item.bmp, "]").concat(item.astral ? '|' : ''); + } + + if (item.astral) { + combined += item.astral; + } + + if (item.isBmpLast && item.bmp) { + combined += "".concat(item.astral ? '|' : '', "[").concat(item.bmp, "]"); + } // Astral Unicode tokens always match a code point, never a code unit + + + return isNegated ? "(?:(?!".concat(combined, ")(?:[\uD800-\uDBFF][\uDC00-\uDFFF]|[\0-\uFFFF]))") : "(?:".concat(combined, ")"); + } // Builds a complete astral pattern on first use + + + function cacheAstral(slug, isNegated) { + var prop = isNegated ? 'a!' : 'a='; + return unicode[slug][prop] || (unicode[slug][prop] = buildAstral(slug, isNegated)); + } // ==--------------------------== + // Core functionality + // ==--------------------------== + + /* + * Add astral mode (flag A) and Unicode token syntax: `\p{..}`, `\P{..}`, `\p{^..}`, `\pC`. + */ + + + XRegExp.addToken( // Use `*` instead of `+` to avoid capturing `^` as the token name in `\p{^}` + /\\([pP])(?:{(\^?)([^}]*)}|([A-Za-z]))/, function (match, scope, flags) { + var ERR_DOUBLE_NEG = 'Invalid double negation '; + var ERR_UNKNOWN_NAME = 'Unknown Unicode token '; + var ERR_UNKNOWN_REF = 'Unicode token missing data '; + var ERR_ASTRAL_ONLY = 'Astral mode required for Unicode token '; + var ERR_ASTRAL_IN_CLASS = 'Astral mode does not support Unicode tokens within character classes'; // Negated via \P{..} or \p{^..} + + var isNegated = match[1] === 'P' || !!match[2]; // Switch from BMP (0-FFFF) to astral (0-10FFFF) mode via flag A + + var isAstralMode = flags.indexOf('A') !== -1; // Token lookup name. Check `[4]` first to avoid passing `undefined` via `\p{}` + + var slug = normalize(match[4] || match[3]); // Token data object + + var item = unicode[slug]; + + if (match[1] === 'P' && match[2]) { + throw new SyntaxError(ERR_DOUBLE_NEG + match[0]); + } + + if (!unicode.hasOwnProperty(slug)) { + throw new SyntaxError(ERR_UNKNOWN_NAME + match[0]); + } // Switch to the negated form of the referenced Unicode token + + + if (item.inverseOf) { + slug = normalize(item.inverseOf); + + if (!unicode.hasOwnProperty(slug)) { + throw new ReferenceError("".concat(ERR_UNKNOWN_REF + match[0], " -> ").concat(item.inverseOf)); + } + + item = unicode[slug]; + isNegated = !isNegated; + } + + if (!(item.bmp || isAstralMode)) { + throw new SyntaxError(ERR_ASTRAL_ONLY + match[0]); + } + + if (isAstralMode) { + if (scope === 'class') { + throw new SyntaxError(ERR_ASTRAL_IN_CLASS); + } + + return cacheAstral(slug, isNegated); + } + + return scope === 'class' ? isNegated ? cacheInvertedBmp(slug) : item.bmp : "".concat((isNegated ? '[^' : '[') + item.bmp, "]"); + }, { + scope: 'all', + optionalFlags: 'A', + leadChar: '\\' + }); + /** + * Adds to the list of Unicode tokens that XRegExp regexes can match via `\p` or `\P`. + * + * @memberOf XRegExp + * @param {Array} data Objects with named character ranges. Each object may have properties + * `name`, `alias`, `isBmpLast`, `inverseOf`, `bmp`, and `astral`. All but `name` are + * optional, although one of `bmp` or `astral` is required (unless `inverseOf` is set). If + * `astral` is absent, the `bmp` data is used for BMP and astral modes. If `bmp` is absent, + * the name errors in BMP mode but works in astral mode. If both `bmp` and `astral` are + * provided, the `bmp` data only is used in BMP mode, and the combination of `bmp` and + * `astral` data is used in astral mode. `isBmpLast` is needed when a token matches orphan + * high surrogates *and* uses surrogate pairs to match astral code points. The `bmp` and + * `astral` data should be a combination of literal characters and `\xHH` or `\uHHHH` escape + * sequences, with hyphens to create ranges. Any regex metacharacters in the data should be + * escaped, apart from range-creating hyphens. The `astral` data can additionally use + * character classes and alternation, and should use surrogate pairs to represent astral code + * points. `inverseOf` can be used to avoid duplicating character data if a Unicode token is + * defined as the exact inverse of another token. + * @example + * + * // Basic use + * XRegExp.addUnicodeData([{ + * name: 'XDigit', + * alias: 'Hexadecimal', + * bmp: '0-9A-Fa-f' + * }]); + * XRegExp('\\p{XDigit}:\\p{Hexadecimal}+').test('0:3D'); // -> true + */ + + XRegExp.addUnicodeData = function (data) { + var ERR_NO_NAME = 'Unicode token requires name'; + var ERR_NO_DATA = 'Unicode token has no character data '; + var _iteratorNormalCompletion = true; + var _didIteratorError = false; + var _iteratorError = undefined; + + try { + for (var _iterator = data[Symbol.iterator](), _step; !(_iteratorNormalCompletion = (_step = _iterator.next()).done); _iteratorNormalCompletion = true) { + var item = _step.value; + + if (!item.name) { + throw new Error(ERR_NO_NAME); + } + + if (!(item.inverseOf || item.bmp || item.astral)) { + throw new Error(ERR_NO_DATA + item.name); + } + + unicode[normalize(item.name)] = item; + + if (item.alias) { + unicode[normalize(item.alias)] = item; + } + } // Reset the pattern cache used by the `XRegExp` constructor, since the same pattern and + // flags might now produce different results + + } catch (err) { + _didIteratorError = true; + _iteratorError = err; + } finally { + try { + if (!_iteratorNormalCompletion && _iterator.return != null) { + _iterator.return(); + } + } finally { + if (_didIteratorError) { + throw _iteratorError; + } + } + } + + XRegExp.cache.flush('patterns'); + }; + /** + * @ignore + * + * Return a reference to the internal Unicode definition structure for the given Unicode + * Property if the given name is a legal Unicode Property for use in XRegExp `\p` or `\P` regex + * constructs. + * + * @memberOf XRegExp + * @param {String} name Name by which the Unicode Property may be recognized (case-insensitive), + * e.g. `'N'` or `'Number'`. The given name is matched against all registered Unicode + * Properties and Property Aliases. + * @returns {Object} Reference to definition structure when the name matches a Unicode Property. + * + * @note + * For more info on Unicode Properties, see also http://unicode.org/reports/tr18/#Categories. + * + * @note + * This method is *not* part of the officially documented API and may change or be removed in + * the future. It is meant for userland code that wishes to reuse the (large) internal Unicode + * structures set up by XRegExp. + */ + + + XRegExp._getUnicodeProperty = function (name) { + var slug = normalize(name); + return unicode[slug]; + }; +}; + +exports.default = _default; +module.exports = exports["default"]; +}); + +unwrapExports(unicodeBase); + +var blocks = [ + { + 'name': 'InAdlam', + 'astral': '\uD83A[\uDD00-\uDD5F]' + }, + { + 'name': 'InAegean_Numbers', + 'astral': '\uD800[\uDD00-\uDD3F]' + }, + { + 'name': 'InAhom', + 'astral': '\uD805[\uDF00-\uDF3F]' + }, + { + 'name': 'InAlchemical_Symbols', + 'astral': '\uD83D[\uDF00-\uDF7F]' + }, + { + 'name': 'InAlphabetic_Presentation_Forms', + 'bmp': '\uFB00-\uFB4F' + }, + { + 'name': 'InAnatolian_Hieroglyphs', + 'astral': '\uD811[\uDC00-\uDE7F]' + }, + { + 'name': 'InAncient_Greek_Musical_Notation', + 'astral': '\uD834[\uDE00-\uDE4F]' + }, + { + 'name': 'InAncient_Greek_Numbers', + 'astral': '\uD800[\uDD40-\uDD8F]' + }, + { + 'name': 'InAncient_Symbols', + 'astral': '\uD800[\uDD90-\uDDCF]' + }, + { + 'name': 'InArabic', + 'bmp': '\u0600-\u06FF' + }, + { + 'name': 'InArabic_Extended_A', + 'bmp': '\u08A0-\u08FF' + }, + { + 'name': 'InArabic_Mathematical_Alphabetic_Symbols', + 'astral': '\uD83B[\uDE00-\uDEFF]' + }, + { + 'name': 'InArabic_Presentation_Forms_A', + 'bmp': '\uFB50-\uFDFF' + }, + { + 'name': 'InArabic_Presentation_Forms_B', + 'bmp': '\uFE70-\uFEFF' + }, + { + 'name': 'InArabic_Supplement', + 'bmp': '\u0750-\u077F' + }, + { + 'name': 'InArmenian', + 'bmp': '\u0530-\u058F' + }, + { + 'name': 'InArrows', + 'bmp': '\u2190-\u21FF' + }, + { + 'name': 'InAvestan', + 'astral': '\uD802[\uDF00-\uDF3F]' + }, + { + 'name': 'InBalinese', + 'bmp': '\u1B00-\u1B7F' + }, + { + 'name': 'InBamum', + 'bmp': '\uA6A0-\uA6FF' + }, + { + 'name': 'InBamum_Supplement', + 'astral': '\uD81A[\uDC00-\uDE3F]' + }, + { + 'name': 'InBasic_Latin', + 'bmp': '\0-\x7F' + }, + { + 'name': 'InBassa_Vah', + 'astral': '\uD81A[\uDED0-\uDEFF]' + }, + { + 'name': 'InBatak', + 'bmp': '\u1BC0-\u1BFF' + }, + { + 'name': 'InBengali', + 'bmp': '\u0980-\u09FF' + }, + { + 'name': 'InBhaiksuki', + 'astral': '\uD807[\uDC00-\uDC6F]' + }, + { + 'name': 'InBlock_Elements', + 'bmp': '\u2580-\u259F' + }, + { + 'name': 'InBopomofo', + 'bmp': '\u3100-\u312F' + }, + { + 'name': 'InBopomofo_Extended', + 'bmp': '\u31A0-\u31BF' + }, + { + 'name': 'InBox_Drawing', + 'bmp': '\u2500-\u257F' + }, + { + 'name': 'InBrahmi', + 'astral': '\uD804[\uDC00-\uDC7F]' + }, + { + 'name': 'InBraille_Patterns', + 'bmp': '\u2800-\u28FF' + }, + { + 'name': 'InBuginese', + 'bmp': '\u1A00-\u1A1F' + }, + { + 'name': 'InBuhid', + 'bmp': '\u1740-\u175F' + }, + { + 'name': 'InByzantine_Musical_Symbols', + 'astral': '\uD834[\uDC00-\uDCFF]' + }, + { + 'name': 'InCJK_Compatibility', + 'bmp': '\u3300-\u33FF' + }, + { + 'name': 'InCJK_Compatibility_Forms', + 'bmp': '\uFE30-\uFE4F' + }, + { + 'name': 'InCJK_Compatibility_Ideographs', + 'bmp': '\uF900-\uFAFF' + }, + { + 'name': 'InCJK_Compatibility_Ideographs_Supplement', + 'astral': '\uD87E[\uDC00-\uDE1F]' + }, + { + 'name': 'InCJK_Radicals_Supplement', + 'bmp': '\u2E80-\u2EFF' + }, + { + 'name': 'InCJK_Strokes', + 'bmp': '\u31C0-\u31EF' + }, + { + 'name': 'InCJK_Symbols_And_Punctuation', + 'bmp': '\u3000-\u303F' + }, + { + 'name': 'InCJK_Unified_Ideographs', + 'bmp': '\u4E00-\u9FFF' + }, + { + 'name': 'InCJK_Unified_Ideographs_Extension_A', + 'bmp': '\u3400-\u4DBF' + }, + { + 'name': 'InCJK_Unified_Ideographs_Extension_B', + 'astral': '[\uD840-\uD868][\uDC00-\uDFFF]|\uD869[\uDC00-\uDEDF]' + }, + { + 'name': 'InCJK_Unified_Ideographs_Extension_C', + 'astral': '\uD869[\uDF00-\uDFFF]|[\uD86A-\uD86C][\uDC00-\uDFFF]|\uD86D[\uDC00-\uDF3F]' + }, + { + 'name': 'InCJK_Unified_Ideographs_Extension_D', + 'astral': '\uD86D[\uDF40-\uDFFF]|\uD86E[\uDC00-\uDC1F]' + }, + { + 'name': 'InCJK_Unified_Ideographs_Extension_E', + 'astral': '\uD86E[\uDC20-\uDFFF]|[\uD86F-\uD872][\uDC00-\uDFFF]|\uD873[\uDC00-\uDEAF]' + }, + { + 'name': 'InCJK_Unified_Ideographs_Extension_F', + 'astral': '\uD873[\uDEB0-\uDFFF]|[\uD874-\uD879][\uDC00-\uDFFF]|\uD87A[\uDC00-\uDFEF]' + }, + { + 'name': 'InCarian', + 'astral': '\uD800[\uDEA0-\uDEDF]' + }, + { + 'name': 'InCaucasian_Albanian', + 'astral': '\uD801[\uDD30-\uDD6F]' + }, + { + 'name': 'InChakma', + 'astral': '\uD804[\uDD00-\uDD4F]' + }, + { + 'name': 'InCham', + 'bmp': '\uAA00-\uAA5F' + }, + { + 'name': 'InCherokee', + 'bmp': '\u13A0-\u13FF' + }, + { + 'name': 'InCherokee_Supplement', + 'bmp': '\uAB70-\uABBF' + }, + { + 'name': 'InChess_Symbols', + 'astral': '\uD83E[\uDE00-\uDE6F]' + }, + { + 'name': 'InCombining_Diacritical_Marks', + 'bmp': '\u0300-\u036F' + }, + { + 'name': 'InCombining_Diacritical_Marks_Extended', + 'bmp': '\u1AB0-\u1AFF' + }, + { + 'name': 'InCombining_Diacritical_Marks_For_Symbols', + 'bmp': '\u20D0-\u20FF' + }, + { + 'name': 'InCombining_Diacritical_Marks_Supplement', + 'bmp': '\u1DC0-\u1DFF' + }, + { + 'name': 'InCombining_Half_Marks', + 'bmp': '\uFE20-\uFE2F' + }, + { + 'name': 'InCommon_Indic_Number_Forms', + 'bmp': '\uA830-\uA83F' + }, + { + 'name': 'InControl_Pictures', + 'bmp': '\u2400-\u243F' + }, + { + 'name': 'InCoptic', + 'bmp': '\u2C80-\u2CFF' + }, + { + 'name': 'InCoptic_Epact_Numbers', + 'astral': '\uD800[\uDEE0-\uDEFF]' + }, + { + 'name': 'InCounting_Rod_Numerals', + 'astral': '\uD834[\uDF60-\uDF7F]' + }, + { + 'name': 'InCuneiform', + 'astral': '\uD808[\uDC00-\uDFFF]' + }, + { + 'name': 'InCuneiform_Numbers_And_Punctuation', + 'astral': '\uD809[\uDC00-\uDC7F]' + }, + { + 'name': 'InCurrency_Symbols', + 'bmp': '\u20A0-\u20CF' + }, + { + 'name': 'InCypriot_Syllabary', + 'astral': '\uD802[\uDC00-\uDC3F]' + }, + { + 'name': 'InCyrillic', + 'bmp': '\u0400-\u04FF' + }, + { + 'name': 'InCyrillic_Extended_A', + 'bmp': '\u2DE0-\u2DFF' + }, + { + 'name': 'InCyrillic_Extended_B', + 'bmp': '\uA640-\uA69F' + }, + { + 'name': 'InCyrillic_Extended_C', + 'bmp': '\u1C80-\u1C8F' + }, + { + 'name': 'InCyrillic_Supplement', + 'bmp': '\u0500-\u052F' + }, + { + 'name': 'InDeseret', + 'astral': '\uD801[\uDC00-\uDC4F]' + }, + { + 'name': 'InDevanagari', + 'bmp': '\u0900-\u097F' + }, + { + 'name': 'InDevanagari_Extended', + 'bmp': '\uA8E0-\uA8FF' + }, + { + 'name': 'InDingbats', + 'bmp': '\u2700-\u27BF' + }, + { + 'name': 'InDogra', + 'astral': '\uD806[\uDC00-\uDC4F]' + }, + { + 'name': 'InDomino_Tiles', + 'astral': '\uD83C[\uDC30-\uDC9F]' + }, + { + 'name': 'InDuployan', + 'astral': '\uD82F[\uDC00-\uDC9F]' + }, + { + 'name': 'InEarly_Dynastic_Cuneiform', + 'astral': '\uD809[\uDC80-\uDD4F]' + }, + { + 'name': 'InEgyptian_Hieroglyphs', + 'astral': '\uD80C[\uDC00-\uDFFF]|\uD80D[\uDC00-\uDC2F]' + }, + { + 'name': 'InElbasan', + 'astral': '\uD801[\uDD00-\uDD2F]' + }, + { + 'name': 'InEmoticons', + 'astral': '\uD83D[\uDE00-\uDE4F]' + }, + { + 'name': 'InEnclosed_Alphanumeric_Supplement', + 'astral': '\uD83C[\uDD00-\uDDFF]' + }, + { + 'name': 'InEnclosed_Alphanumerics', + 'bmp': '\u2460-\u24FF' + }, + { + 'name': 'InEnclosed_CJK_Letters_And_Months', + 'bmp': '\u3200-\u32FF' + }, + { + 'name': 'InEnclosed_Ideographic_Supplement', + 'astral': '\uD83C[\uDE00-\uDEFF]' + }, + { + 'name': 'InEthiopic', + 'bmp': '\u1200-\u137F' + }, + { + 'name': 'InEthiopic_Extended', + 'bmp': '\u2D80-\u2DDF' + }, + { + 'name': 'InEthiopic_Extended_A', + 'bmp': '\uAB00-\uAB2F' + }, + { + 'name': 'InEthiopic_Supplement', + 'bmp': '\u1380-\u139F' + }, + { + 'name': 'InGeneral_Punctuation', + 'bmp': '\u2000-\u206F' + }, + { + 'name': 'InGeometric_Shapes', + 'bmp': '\u25A0-\u25FF' + }, + { + 'name': 'InGeometric_Shapes_Extended', + 'astral': '\uD83D[\uDF80-\uDFFF]' + }, + { + 'name': 'InGeorgian', + 'bmp': '\u10A0-\u10FF' + }, + { + 'name': 'InGeorgian_Extended', + 'bmp': '\u1C90-\u1CBF' + }, + { + 'name': 'InGeorgian_Supplement', + 'bmp': '\u2D00-\u2D2F' + }, + { + 'name': 'InGlagolitic', + 'bmp': '\u2C00-\u2C5F' + }, + { + 'name': 'InGlagolitic_Supplement', + 'astral': '\uD838[\uDC00-\uDC2F]' + }, + { + 'name': 'InGothic', + 'astral': '\uD800[\uDF30-\uDF4F]' + }, + { + 'name': 'InGrantha', + 'astral': '\uD804[\uDF00-\uDF7F]' + }, + { + 'name': 'InGreek_And_Coptic', + 'bmp': '\u0370-\u03FF' + }, + { + 'name': 'InGreek_Extended', + 'bmp': '\u1F00-\u1FFF' + }, + { + 'name': 'InGujarati', + 'bmp': '\u0A80-\u0AFF' + }, + { + 'name': 'InGunjala_Gondi', + 'astral': '\uD807[\uDD60-\uDDAF]' + }, + { + 'name': 'InGurmukhi', + 'bmp': '\u0A00-\u0A7F' + }, + { + 'name': 'InHalfwidth_And_Fullwidth_Forms', + 'bmp': '\uFF00-\uFFEF' + }, + { + 'name': 'InHangul_Compatibility_Jamo', + 'bmp': '\u3130-\u318F' + }, + { + 'name': 'InHangul_Jamo', + 'bmp': '\u1100-\u11FF' + }, + { + 'name': 'InHangul_Jamo_Extended_A', + 'bmp': '\uA960-\uA97F' + }, + { + 'name': 'InHangul_Jamo_Extended_B', + 'bmp': '\uD7B0-\uD7FF' + }, + { + 'name': 'InHangul_Syllables', + 'bmp': '\uAC00-\uD7AF' + }, + { + 'name': 'InHanifi_Rohingya', + 'astral': '\uD803[\uDD00-\uDD3F]' + }, + { + 'name': 'InHanunoo', + 'bmp': '\u1720-\u173F' + }, + { + 'name': 'InHatran', + 'astral': '\uD802[\uDCE0-\uDCFF]' + }, + { + 'name': 'InHebrew', + 'bmp': '\u0590-\u05FF' + }, + { + 'name': 'InHigh_Private_Use_Surrogates', + 'bmp': '\uDB80-\uDBFF' + }, + { + 'name': 'InHigh_Surrogates', + 'bmp': '\uD800-\uDB7F' + }, + { + 'name': 'InHiragana', + 'bmp': '\u3040-\u309F' + }, + { + 'name': 'InIPA_Extensions', + 'bmp': '\u0250-\u02AF' + }, + { + 'name': 'InIdeographic_Description_Characters', + 'bmp': '\u2FF0-\u2FFF' + }, + { + 'name': 'InIdeographic_Symbols_And_Punctuation', + 'astral': '\uD81B[\uDFE0-\uDFFF]' + }, + { + 'name': 'InImperial_Aramaic', + 'astral': '\uD802[\uDC40-\uDC5F]' + }, + { + 'name': 'InIndic_Siyaq_Numbers', + 'astral': '\uD83B[\uDC70-\uDCBF]' + }, + { + 'name': 'InInscriptional_Pahlavi', + 'astral': '\uD802[\uDF60-\uDF7F]' + }, + { + 'name': 'InInscriptional_Parthian', + 'astral': '\uD802[\uDF40-\uDF5F]' + }, + { + 'name': 'InJavanese', + 'bmp': '\uA980-\uA9DF' + }, + { + 'name': 'InKaithi', + 'astral': '\uD804[\uDC80-\uDCCF]' + }, + { + 'name': 'InKana_Extended_A', + 'astral': '\uD82C[\uDD00-\uDD2F]' + }, + { + 'name': 'InKana_Supplement', + 'astral': '\uD82C[\uDC00-\uDCFF]' + }, + { + 'name': 'InKanbun', + 'bmp': '\u3190-\u319F' + }, + { + 'name': 'InKangxi_Radicals', + 'bmp': '\u2F00-\u2FDF' + }, + { + 'name': 'InKannada', + 'bmp': '\u0C80-\u0CFF' + }, + { + 'name': 'InKatakana', + 'bmp': '\u30A0-\u30FF' + }, + { + 'name': 'InKatakana_Phonetic_Extensions', + 'bmp': '\u31F0-\u31FF' + }, + { + 'name': 'InKayah_Li', + 'bmp': '\uA900-\uA92F' + }, + { + 'name': 'InKharoshthi', + 'astral': '\uD802[\uDE00-\uDE5F]' + }, + { + 'name': 'InKhmer', + 'bmp': '\u1780-\u17FF' + }, + { + 'name': 'InKhmer_Symbols', + 'bmp': '\u19E0-\u19FF' + }, + { + 'name': 'InKhojki', + 'astral': '\uD804[\uDE00-\uDE4F]' + }, + { + 'name': 'InKhudawadi', + 'astral': '\uD804[\uDEB0-\uDEFF]' + }, + { + 'name': 'InLao', + 'bmp': '\u0E80-\u0EFF' + }, + { + 'name': 'InLatin_1_Supplement', + 'bmp': '\x80-\xFF' + }, + { + 'name': 'InLatin_Extended_A', + 'bmp': '\u0100-\u017F' + }, + { + 'name': 'InLatin_Extended_Additional', + 'bmp': '\u1E00-\u1EFF' + }, + { + 'name': 'InLatin_Extended_B', + 'bmp': '\u0180-\u024F' + }, + { + 'name': 'InLatin_Extended_C', + 'bmp': '\u2C60-\u2C7F' + }, + { + 'name': 'InLatin_Extended_D', + 'bmp': '\uA720-\uA7FF' + }, + { + 'name': 'InLatin_Extended_E', + 'bmp': '\uAB30-\uAB6F' + }, + { + 'name': 'InLepcha', + 'bmp': '\u1C00-\u1C4F' + }, + { + 'name': 'InLetterlike_Symbols', + 'bmp': '\u2100-\u214F' + }, + { + 'name': 'InLimbu', + 'bmp': '\u1900-\u194F' + }, + { + 'name': 'InLinear_A', + 'astral': '\uD801[\uDE00-\uDF7F]' + }, + { + 'name': 'InLinear_B_Ideograms', + 'astral': '\uD800[\uDC80-\uDCFF]' + }, + { + 'name': 'InLinear_B_Syllabary', + 'astral': '\uD800[\uDC00-\uDC7F]' + }, + { + 'name': 'InLisu', + 'bmp': '\uA4D0-\uA4FF' + }, + { + 'name': 'InLow_Surrogates', + 'bmp': '\uDC00-\uDFFF' + }, + { + 'name': 'InLycian', + 'astral': '\uD800[\uDE80-\uDE9F]' + }, + { + 'name': 'InLydian', + 'astral': '\uD802[\uDD20-\uDD3F]' + }, + { + 'name': 'InMahajani', + 'astral': '\uD804[\uDD50-\uDD7F]' + }, + { + 'name': 'InMahjong_Tiles', + 'astral': '\uD83C[\uDC00-\uDC2F]' + }, + { + 'name': 'InMakasar', + 'astral': '\uD807[\uDEE0-\uDEFF]' + }, + { + 'name': 'InMalayalam', + 'bmp': '\u0D00-\u0D7F' + }, + { + 'name': 'InMandaic', + 'bmp': '\u0840-\u085F' + }, + { + 'name': 'InManichaean', + 'astral': '\uD802[\uDEC0-\uDEFF]' + }, + { + 'name': 'InMarchen', + 'astral': '\uD807[\uDC70-\uDCBF]' + }, + { + 'name': 'InMasaram_Gondi', + 'astral': '\uD807[\uDD00-\uDD5F]' + }, + { + 'name': 'InMathematical_Alphanumeric_Symbols', + 'astral': '\uD835[\uDC00-\uDFFF]' + }, + { + 'name': 'InMathematical_Operators', + 'bmp': '\u2200-\u22FF' + }, + { + 'name': 'InMayan_Numerals', + 'astral': '\uD834[\uDEE0-\uDEFF]' + }, + { + 'name': 'InMedefaidrin', + 'astral': '\uD81B[\uDE40-\uDE9F]' + }, + { + 'name': 'InMeetei_Mayek', + 'bmp': '\uABC0-\uABFF' + }, + { + 'name': 'InMeetei_Mayek_Extensions', + 'bmp': '\uAAE0-\uAAFF' + }, + { + 'name': 'InMende_Kikakui', + 'astral': '\uD83A[\uDC00-\uDCDF]' + }, + { + 'name': 'InMeroitic_Cursive', + 'astral': '\uD802[\uDDA0-\uDDFF]' + }, + { + 'name': 'InMeroitic_Hieroglyphs', + 'astral': '\uD802[\uDD80-\uDD9F]' + }, + { + 'name': 'InMiao', + 'astral': '\uD81B[\uDF00-\uDF9F]' + }, + { + 'name': 'InMiscellaneous_Mathematical_Symbols_A', + 'bmp': '\u27C0-\u27EF' + }, + { + 'name': 'InMiscellaneous_Mathematical_Symbols_B', + 'bmp': '\u2980-\u29FF' + }, + { + 'name': 'InMiscellaneous_Symbols', + 'bmp': '\u2600-\u26FF' + }, + { + 'name': 'InMiscellaneous_Symbols_And_Arrows', + 'bmp': '\u2B00-\u2BFF' + }, + { + 'name': 'InMiscellaneous_Symbols_And_Pictographs', + 'astral': '\uD83C[\uDF00-\uDFFF]|\uD83D[\uDC00-\uDDFF]' + }, + { + 'name': 'InMiscellaneous_Technical', + 'bmp': '\u2300-\u23FF' + }, + { + 'name': 'InModi', + 'astral': '\uD805[\uDE00-\uDE5F]' + }, + { + 'name': 'InModifier_Tone_Letters', + 'bmp': '\uA700-\uA71F' + }, + { + 'name': 'InMongolian', + 'bmp': '\u1800-\u18AF' + }, + { + 'name': 'InMongolian_Supplement', + 'astral': '\uD805[\uDE60-\uDE7F]' + }, + { + 'name': 'InMro', + 'astral': '\uD81A[\uDE40-\uDE6F]' + }, + { + 'name': 'InMultani', + 'astral': '\uD804[\uDE80-\uDEAF]' + }, + { + 'name': 'InMusical_Symbols', + 'astral': '\uD834[\uDD00-\uDDFF]' + }, + { + 'name': 'InMyanmar', + 'bmp': '\u1000-\u109F' + }, + { + 'name': 'InMyanmar_Extended_A', + 'bmp': '\uAA60-\uAA7F' + }, + { + 'name': 'InMyanmar_Extended_B', + 'bmp': '\uA9E0-\uA9FF' + }, + { + 'name': 'InNKo', + 'bmp': '\u07C0-\u07FF' + }, + { + 'name': 'InNabataean', + 'astral': '\uD802[\uDC80-\uDCAF]' + }, + { + 'name': 'InNew_Tai_Lue', + 'bmp': '\u1980-\u19DF' + }, + { + 'name': 'InNewa', + 'astral': '\uD805[\uDC00-\uDC7F]' + }, + { + 'name': 'InNumber_Forms', + 'bmp': '\u2150-\u218F' + }, + { + 'name': 'InNushu', + 'astral': '\uD82C[\uDD70-\uDEFF]' + }, + { + 'name': 'InOgham', + 'bmp': '\u1680-\u169F' + }, + { + 'name': 'InOl_Chiki', + 'bmp': '\u1C50-\u1C7F' + }, + { + 'name': 'InOld_Hungarian', + 'astral': '\uD803[\uDC80-\uDCFF]' + }, + { + 'name': 'InOld_Italic', + 'astral': '\uD800[\uDF00-\uDF2F]' + }, + { + 'name': 'InOld_North_Arabian', + 'astral': '\uD802[\uDE80-\uDE9F]' + }, + { + 'name': 'InOld_Permic', + 'astral': '\uD800[\uDF50-\uDF7F]' + }, + { + 'name': 'InOld_Persian', + 'astral': '\uD800[\uDFA0-\uDFDF]' + }, + { + 'name': 'InOld_Sogdian', + 'astral': '\uD803[\uDF00-\uDF2F]' + }, + { + 'name': 'InOld_South_Arabian', + 'astral': '\uD802[\uDE60-\uDE7F]' + }, + { + 'name': 'InOld_Turkic', + 'astral': '\uD803[\uDC00-\uDC4F]' + }, + { + 'name': 'InOptical_Character_Recognition', + 'bmp': '\u2440-\u245F' + }, + { + 'name': 'InOriya', + 'bmp': '\u0B00-\u0B7F' + }, + { + 'name': 'InOrnamental_Dingbats', + 'astral': '\uD83D[\uDE50-\uDE7F]' + }, + { + 'name': 'InOsage', + 'astral': '\uD801[\uDCB0-\uDCFF]' + }, + { + 'name': 'InOsmanya', + 'astral': '\uD801[\uDC80-\uDCAF]' + }, + { + 'name': 'InPahawh_Hmong', + 'astral': '\uD81A[\uDF00-\uDF8F]' + }, + { + 'name': 'InPalmyrene', + 'astral': '\uD802[\uDC60-\uDC7F]' + }, + { + 'name': 'InPau_Cin_Hau', + 'astral': '\uD806[\uDEC0-\uDEFF]' + }, + { + 'name': 'InPhags_Pa', + 'bmp': '\uA840-\uA87F' + }, + { + 'name': 'InPhaistos_Disc', + 'astral': '\uD800[\uDDD0-\uDDFF]' + }, + { + 'name': 'InPhoenician', + 'astral': '\uD802[\uDD00-\uDD1F]' + }, + { + 'name': 'InPhonetic_Extensions', + 'bmp': '\u1D00-\u1D7F' + }, + { + 'name': 'InPhonetic_Extensions_Supplement', + 'bmp': '\u1D80-\u1DBF' + }, + { + 'name': 'InPlaying_Cards', + 'astral': '\uD83C[\uDCA0-\uDCFF]' + }, + { + 'name': 'InPrivate_Use_Area', + 'bmp': '\uE000-\uF8FF' + }, + { + 'name': 'InPsalter_Pahlavi', + 'astral': '\uD802[\uDF80-\uDFAF]' + }, + { + 'name': 'InRejang', + 'bmp': '\uA930-\uA95F' + }, + { + 'name': 'InRumi_Numeral_Symbols', + 'astral': '\uD803[\uDE60-\uDE7F]' + }, + { + 'name': 'InRunic', + 'bmp': '\u16A0-\u16FF' + }, + { + 'name': 'InSamaritan', + 'bmp': '\u0800-\u083F' + }, + { + 'name': 'InSaurashtra', + 'bmp': '\uA880-\uA8DF' + }, + { + 'name': 'InSharada', + 'astral': '\uD804[\uDD80-\uDDDF]' + }, + { + 'name': 'InShavian', + 'astral': '\uD801[\uDC50-\uDC7F]' + }, + { + 'name': 'InShorthand_Format_Controls', + 'astral': '\uD82F[\uDCA0-\uDCAF]' + }, + { + 'name': 'InSiddham', + 'astral': '\uD805[\uDD80-\uDDFF]' + }, + { + 'name': 'InSinhala', + 'bmp': '\u0D80-\u0DFF' + }, + { + 'name': 'InSinhala_Archaic_Numbers', + 'astral': '\uD804[\uDDE0-\uDDFF]' + }, + { + 'name': 'InSmall_Form_Variants', + 'bmp': '\uFE50-\uFE6F' + }, + { + 'name': 'InSogdian', + 'astral': '\uD803[\uDF30-\uDF6F]' + }, + { + 'name': 'InSora_Sompeng', + 'astral': '\uD804[\uDCD0-\uDCFF]' + }, + { + 'name': 'InSoyombo', + 'astral': '\uD806[\uDE50-\uDEAF]' + }, + { + 'name': 'InSpacing_Modifier_Letters', + 'bmp': '\u02B0-\u02FF' + }, + { + 'name': 'InSpecials', + 'bmp': '\uFFF0-\uFFFF' + }, + { + 'name': 'InSundanese', + 'bmp': '\u1B80-\u1BBF' + }, + { + 'name': 'InSundanese_Supplement', + 'bmp': '\u1CC0-\u1CCF' + }, + { + 'name': 'InSuperscripts_And_Subscripts', + 'bmp': '\u2070-\u209F' + }, + { + 'name': 'InSupplemental_Arrows_A', + 'bmp': '\u27F0-\u27FF' + }, + { + 'name': 'InSupplemental_Arrows_B', + 'bmp': '\u2900-\u297F' + }, + { + 'name': 'InSupplemental_Arrows_C', + 'astral': '\uD83E[\uDC00-\uDCFF]' + }, + { + 'name': 'InSupplemental_Mathematical_Operators', + 'bmp': '\u2A00-\u2AFF' + }, + { + 'name': 'InSupplemental_Punctuation', + 'bmp': '\u2E00-\u2E7F' + }, + { + 'name': 'InSupplemental_Symbols_And_Pictographs', + 'astral': '\uD83E[\uDD00-\uDDFF]' + }, + { + 'name': 'InSupplementary_Private_Use_Area_A', + 'astral': '[\uDB80-\uDBBF][\uDC00-\uDFFF]' + }, + { + 'name': 'InSupplementary_Private_Use_Area_B', + 'astral': '[\uDBC0-\uDBFF][\uDC00-\uDFFF]' + }, + { + 'name': 'InSutton_SignWriting', + 'astral': '\uD836[\uDC00-\uDEAF]' + }, + { + 'name': 'InSyloti_Nagri', + 'bmp': '\uA800-\uA82F' + }, + { + 'name': 'InSyriac', + 'bmp': '\u0700-\u074F' + }, + { + 'name': 'InSyriac_Supplement', + 'bmp': '\u0860-\u086F' + }, + { + 'name': 'InTagalog', + 'bmp': '\u1700-\u171F' + }, + { + 'name': 'InTagbanwa', + 'bmp': '\u1760-\u177F' + }, + { + 'name': 'InTags', + 'astral': '\uDB40[\uDC00-\uDC7F]' + }, + { + 'name': 'InTai_Le', + 'bmp': '\u1950-\u197F' + }, + { + 'name': 'InTai_Tham', + 'bmp': '\u1A20-\u1AAF' + }, + { + 'name': 'InTai_Viet', + 'bmp': '\uAA80-\uAADF' + }, + { + 'name': 'InTai_Xuan_Jing_Symbols', + 'astral': '\uD834[\uDF00-\uDF5F]' + }, + { + 'name': 'InTakri', + 'astral': '\uD805[\uDE80-\uDECF]' + }, + { + 'name': 'InTamil', + 'bmp': '\u0B80-\u0BFF' + }, + { + 'name': 'InTangut', + 'astral': '[\uD81C-\uD821][\uDC00-\uDFFF]' + }, + { + 'name': 'InTangut_Components', + 'astral': '\uD822[\uDC00-\uDEFF]' + }, + { + 'name': 'InTelugu', + 'bmp': '\u0C00-\u0C7F' + }, + { + 'name': 'InThaana', + 'bmp': '\u0780-\u07BF' + }, + { + 'name': 'InThai', + 'bmp': '\u0E00-\u0E7F' + }, + { + 'name': 'InTibetan', + 'bmp': '\u0F00-\u0FFF' + }, + { + 'name': 'InTifinagh', + 'bmp': '\u2D30-\u2D7F' + }, + { + 'name': 'InTirhuta', + 'astral': '\uD805[\uDC80-\uDCDF]' + }, + { + 'name': 'InTransport_And_Map_Symbols', + 'astral': '\uD83D[\uDE80-\uDEFF]' + }, + { + 'name': 'InUgaritic', + 'astral': '\uD800[\uDF80-\uDF9F]' + }, + { + 'name': 'InUnified_Canadian_Aboriginal_Syllabics', + 'bmp': '\u1400-\u167F' + }, + { + 'name': 'InUnified_Canadian_Aboriginal_Syllabics_Extended', + 'bmp': '\u18B0-\u18FF' + }, + { + 'name': 'InVai', + 'bmp': '\uA500-\uA63F' + }, + { + 'name': 'InVariation_Selectors', + 'bmp': '\uFE00-\uFE0F' + }, + { + 'name': 'InVariation_Selectors_Supplement', + 'astral': '\uDB40[\uDD00-\uDDEF]' + }, + { + 'name': 'InVedic_Extensions', + 'bmp': '\u1CD0-\u1CFF' + }, + { + 'name': 'InVertical_Forms', + 'bmp': '\uFE10-\uFE1F' + }, + { + 'name': 'InWarang_Citi', + 'astral': '\uD806[\uDCA0-\uDCFF]' + }, + { + 'name': 'InYi_Radicals', + 'bmp': '\uA490-\uA4CF' + }, + { + 'name': 'InYi_Syllables', + 'bmp': '\uA000-\uA48F' + }, + { + 'name': 'InYijing_Hexagram_Symbols', + 'bmp': '\u4DC0-\u4DFF' + }, + { + 'name': 'InZanabazar_Square', + 'astral': '\uD806[\uDE00-\uDE4F]' + } +]; + +var unicodeBlocks = createCommonjsModule(function (module, exports) { +"use strict"; + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.default = void 0; + +var _blocks = _interopRequireDefault(blocks); + +function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } + +/*! + * XRegExp Unicode Blocks 4.2.0 + * + * Steven Levithan (c) 2010-present MIT License + * Unicode data by Mathias Bynens + */ +var _default = function _default(XRegExp) { + /** + * Adds support for all Unicode blocks. Block names use the prefix 'In'. E.g., + * `\p{InBasicLatin}`. Token names are case insensitive, and any spaces, hyphens, and + * underscores are ignored. + * + * Uses Unicode 11.0.0. + * + * @requires XRegExp, Unicode Base + */ + if (!XRegExp.addUnicodeData) { + throw new ReferenceError('Unicode Base must be loaded before Unicode Blocks'); + } + + XRegExp.addUnicodeData(_blocks.default); +}; + +exports.default = _default; +module.exports = exports["default"]; +}); + +unwrapExports(unicodeBlocks); + +var categories = [ + { + 'name': 'C', + 'alias': 'Other', + 'isBmpLast': true, + 'bmp': '\0-\x1F\x7F-\x9F\xAD\u0378\u0379\u0380-\u0383\u038B\u038D\u03A2\u0530\u0557\u0558\u058B\u058C\u0590\u05C8-\u05CF\u05EB-\u05EE\u05F5-\u0605\u061C\u061D\u06DD\u070E\u070F\u074B\u074C\u07B2-\u07BF\u07FB\u07FC\u082E\u082F\u083F\u085C\u085D\u085F\u086B-\u089F\u08B5\u08BE-\u08D2\u08E2\u0984\u098D\u098E\u0991\u0992\u09A9\u09B1\u09B3-\u09B5\u09BA\u09BB\u09C5\u09C6\u09C9\u09CA\u09CF-\u09D6\u09D8-\u09DB\u09DE\u09E4\u09E5\u09FF\u0A00\u0A04\u0A0B-\u0A0E\u0A11\u0A12\u0A29\u0A31\u0A34\u0A37\u0A3A\u0A3B\u0A3D\u0A43-\u0A46\u0A49\u0A4A\u0A4E-\u0A50\u0A52-\u0A58\u0A5D\u0A5F-\u0A65\u0A77-\u0A80\u0A84\u0A8E\u0A92\u0AA9\u0AB1\u0AB4\u0ABA\u0ABB\u0AC6\u0ACA\u0ACE\u0ACF\u0AD1-\u0ADF\u0AE4\u0AE5\u0AF2-\u0AF8\u0B00\u0B04\u0B0D\u0B0E\u0B11\u0B12\u0B29\u0B31\u0B34\u0B3A\u0B3B\u0B45\u0B46\u0B49\u0B4A\u0B4E-\u0B55\u0B58-\u0B5B\u0B5E\u0B64\u0B65\u0B78-\u0B81\u0B84\u0B8B-\u0B8D\u0B91\u0B96-\u0B98\u0B9B\u0B9D\u0BA0-\u0BA2\u0BA5-\u0BA7\u0BAB-\u0BAD\u0BBA-\u0BBD\u0BC3-\u0BC5\u0BC9\u0BCE\u0BCF\u0BD1-\u0BD6\u0BD8-\u0BE5\u0BFB-\u0BFF\u0C0D\u0C11\u0C29\u0C3A-\u0C3C\u0C45\u0C49\u0C4E-\u0C54\u0C57\u0C5B-\u0C5F\u0C64\u0C65\u0C70-\u0C77\u0C8D\u0C91\u0CA9\u0CB4\u0CBA\u0CBB\u0CC5\u0CC9\u0CCE-\u0CD4\u0CD7-\u0CDD\u0CDF\u0CE4\u0CE5\u0CF0\u0CF3-\u0CFF\u0D04\u0D0D\u0D11\u0D45\u0D49\u0D50-\u0D53\u0D64\u0D65\u0D80\u0D81\u0D84\u0D97-\u0D99\u0DB2\u0DBC\u0DBE\u0DBF\u0DC7-\u0DC9\u0DCB-\u0DCE\u0DD5\u0DD7\u0DE0-\u0DE5\u0DF0\u0DF1\u0DF5-\u0E00\u0E3B-\u0E3E\u0E5C-\u0E80\u0E83\u0E85\u0E86\u0E89\u0E8B\u0E8C\u0E8E-\u0E93\u0E98\u0EA0\u0EA4\u0EA6\u0EA8\u0EA9\u0EAC\u0EBA\u0EBE\u0EBF\u0EC5\u0EC7\u0ECE\u0ECF\u0EDA\u0EDB\u0EE0-\u0EFF\u0F48\u0F6D-\u0F70\u0F98\u0FBD\u0FCD\u0FDB-\u0FFF\u10C6\u10C8-\u10CC\u10CE\u10CF\u1249\u124E\u124F\u1257\u1259\u125E\u125F\u1289\u128E\u128F\u12B1\u12B6\u12B7\u12BF\u12C1\u12C6\u12C7\u12D7\u1311\u1316\u1317\u135B\u135C\u137D-\u137F\u139A-\u139F\u13F6\u13F7\u13FE\u13FF\u169D-\u169F\u16F9-\u16FF\u170D\u1715-\u171F\u1737-\u173F\u1754-\u175F\u176D\u1771\u1774-\u177F\u17DE\u17DF\u17EA-\u17EF\u17FA-\u17FF\u180E\u180F\u181A-\u181F\u1879-\u187F\u18AB-\u18AF\u18F6-\u18FF\u191F\u192C-\u192F\u193C-\u193F\u1941-\u1943\u196E\u196F\u1975-\u197F\u19AC-\u19AF\u19CA-\u19CF\u19DB-\u19DD\u1A1C\u1A1D\u1A5F\u1A7D\u1A7E\u1A8A-\u1A8F\u1A9A-\u1A9F\u1AAE\u1AAF\u1ABF-\u1AFF\u1B4C-\u1B4F\u1B7D-\u1B7F\u1BF4-\u1BFB\u1C38-\u1C3A\u1C4A-\u1C4C\u1C89-\u1C8F\u1CBB\u1CBC\u1CC8-\u1CCF\u1CFA-\u1CFF\u1DFA\u1F16\u1F17\u1F1E\u1F1F\u1F46\u1F47\u1F4E\u1F4F\u1F58\u1F5A\u1F5C\u1F5E\u1F7E\u1F7F\u1FB5\u1FC5\u1FD4\u1FD5\u1FDC\u1FF0\u1FF1\u1FF5\u1FFF\u200B-\u200F\u202A-\u202E\u2060-\u206F\u2072\u2073\u208F\u209D-\u209F\u20C0-\u20CF\u20F1-\u20FF\u218C-\u218F\u2427-\u243F\u244B-\u245F\u2B74\u2B75\u2B96\u2B97\u2BC9\u2BFF\u2C2F\u2C5F\u2CF4-\u2CF8\u2D26\u2D28-\u2D2C\u2D2E\u2D2F\u2D68-\u2D6E\u2D71-\u2D7E\u2D97-\u2D9F\u2DA7\u2DAF\u2DB7\u2DBF\u2DC7\u2DCF\u2DD7\u2DDF\u2E4F-\u2E7F\u2E9A\u2EF4-\u2EFF\u2FD6-\u2FEF\u2FFC-\u2FFF\u3040\u3097\u3098\u3100-\u3104\u3130\u318F\u31BB-\u31BF\u31E4-\u31EF\u321F\u32FF\u4DB6-\u4DBF\u9FF0-\u9FFF\uA48D-\uA48F\uA4C7-\uA4CF\uA62C-\uA63F\uA6F8-\uA6FF\uA7BA-\uA7F6\uA82C-\uA82F\uA83A-\uA83F\uA878-\uA87F\uA8C6-\uA8CD\uA8DA-\uA8DF\uA954-\uA95E\uA97D-\uA97F\uA9CE\uA9DA-\uA9DD\uA9FF\uAA37-\uAA3F\uAA4E\uAA4F\uAA5A\uAA5B\uAAC3-\uAADA\uAAF7-\uAB00\uAB07\uAB08\uAB0F\uAB10\uAB17-\uAB1F\uAB27\uAB2F\uAB66-\uAB6F\uABEE\uABEF\uABFA-\uABFF\uD7A4-\uD7AF\uD7C7-\uD7CA\uD7FC-\uF8FF\uFA6E\uFA6F\uFADA-\uFAFF\uFB07-\uFB12\uFB18-\uFB1C\uFB37\uFB3D\uFB3F\uFB42\uFB45\uFBC2-\uFBD2\uFD40-\uFD4F\uFD90\uFD91\uFDC8-\uFDEF\uFDFE\uFDFF\uFE1A-\uFE1F\uFE53\uFE67\uFE6C-\uFE6F\uFE75\uFEFD-\uFF00\uFFBF-\uFFC1\uFFC8\uFFC9\uFFD0\uFFD1\uFFD8\uFFD9\uFFDD-\uFFDF\uFFE7\uFFEF-\uFFFB\uFFFE\uFFFF', + 'astral': '\uD800[\uDC0C\uDC27\uDC3B\uDC3E\uDC4E\uDC4F\uDC5E-\uDC7F\uDCFB-\uDCFF\uDD03-\uDD06\uDD34-\uDD36\uDD8F\uDD9C-\uDD9F\uDDA1-\uDDCF\uDDFE-\uDE7F\uDE9D-\uDE9F\uDED1-\uDEDF\uDEFC-\uDEFF\uDF24-\uDF2C\uDF4B-\uDF4F\uDF7B-\uDF7F\uDF9E\uDFC4-\uDFC7\uDFD6-\uDFFF]|\uD801[\uDC9E\uDC9F\uDCAA-\uDCAF\uDCD4-\uDCD7\uDCFC-\uDCFF\uDD28-\uDD2F\uDD64-\uDD6E\uDD70-\uDDFF\uDF37-\uDF3F\uDF56-\uDF5F\uDF68-\uDFFF]|\uD802[\uDC06\uDC07\uDC09\uDC36\uDC39-\uDC3B\uDC3D\uDC3E\uDC56\uDC9F-\uDCA6\uDCB0-\uDCDF\uDCF3\uDCF6-\uDCFA\uDD1C-\uDD1E\uDD3A-\uDD3E\uDD40-\uDD7F\uDDB8-\uDDBB\uDDD0\uDDD1\uDE04\uDE07-\uDE0B\uDE14\uDE18\uDE36\uDE37\uDE3B-\uDE3E\uDE49-\uDE4F\uDE59-\uDE5F\uDEA0-\uDEBF\uDEE7-\uDEEA\uDEF7-\uDEFF\uDF36-\uDF38\uDF56\uDF57\uDF73-\uDF77\uDF92-\uDF98\uDF9D-\uDFA8\uDFB0-\uDFFF]|\uD803[\uDC49-\uDC7F\uDCB3-\uDCBF\uDCF3-\uDCF9\uDD28-\uDD2F\uDD3A-\uDE5F\uDE7F-\uDEFF\uDF28-\uDF2F\uDF5A-\uDFFF]|\uD804[\uDC4E-\uDC51\uDC70-\uDC7E\uDCBD\uDCC2-\uDCCF\uDCE9-\uDCEF\uDCFA-\uDCFF\uDD35\uDD47-\uDD4F\uDD77-\uDD7F\uDDCE\uDDCF\uDDE0\uDDF5-\uDDFF\uDE12\uDE3F-\uDE7F\uDE87\uDE89\uDE8E\uDE9E\uDEAA-\uDEAF\uDEEB-\uDEEF\uDEFA-\uDEFF\uDF04\uDF0D\uDF0E\uDF11\uDF12\uDF29\uDF31\uDF34\uDF3A\uDF45\uDF46\uDF49\uDF4A\uDF4E\uDF4F\uDF51-\uDF56\uDF58-\uDF5C\uDF64\uDF65\uDF6D-\uDF6F\uDF75-\uDFFF]|\uD805[\uDC5A\uDC5C\uDC5F-\uDC7F\uDCC8-\uDCCF\uDCDA-\uDD7F\uDDB6\uDDB7\uDDDE-\uDDFF\uDE45-\uDE4F\uDE5A-\uDE5F\uDE6D-\uDE7F\uDEB8-\uDEBF\uDECA-\uDEFF\uDF1B\uDF1C\uDF2C-\uDF2F\uDF40-\uDFFF]|\uD806[\uDC3C-\uDC9F\uDCF3-\uDCFE\uDD00-\uDDFF\uDE48-\uDE4F\uDE84\uDE85\uDEA3-\uDEBF\uDEF9-\uDFFF]|\uD807[\uDC09\uDC37\uDC46-\uDC4F\uDC6D-\uDC6F\uDC90\uDC91\uDCA8\uDCB7-\uDCFF\uDD07\uDD0A\uDD37-\uDD39\uDD3B\uDD3E\uDD48-\uDD4F\uDD5A-\uDD5F\uDD66\uDD69\uDD8F\uDD92\uDD99-\uDD9F\uDDAA-\uDEDF\uDEF9-\uDFFF]|\uD808[\uDF9A-\uDFFF]|\uD809[\uDC6F\uDC75-\uDC7F\uDD44-\uDFFF]|[\uD80A\uD80B\uD80E-\uD810\uD812-\uD819\uD823-\uD82B\uD82D\uD82E\uD830-\uD833\uD837\uD839\uD83F\uD87B-\uD87D\uD87F-\uDB3F\uDB41-\uDBFF][\uDC00-\uDFFF]|\uD80D[\uDC2F-\uDFFF]|\uD811[\uDE47-\uDFFF]|\uD81A[\uDE39-\uDE3F\uDE5F\uDE6A-\uDE6D\uDE70-\uDECF\uDEEE\uDEEF\uDEF6-\uDEFF\uDF46-\uDF4F\uDF5A\uDF62\uDF78-\uDF7C\uDF90-\uDFFF]|\uD81B[\uDC00-\uDE3F\uDE9B-\uDEFF\uDF45-\uDF4F\uDF7F-\uDF8E\uDFA0-\uDFDF\uDFE2-\uDFFF]|\uD821[\uDFF2-\uDFFF]|\uD822[\uDEF3-\uDFFF]|\uD82C[\uDD1F-\uDD6F\uDEFC-\uDFFF]|\uD82F[\uDC6B-\uDC6F\uDC7D-\uDC7F\uDC89-\uDC8F\uDC9A\uDC9B\uDCA0-\uDFFF]|\uD834[\uDCF6-\uDCFF\uDD27\uDD28\uDD73-\uDD7A\uDDE9-\uDDFF\uDE46-\uDEDF\uDEF4-\uDEFF\uDF57-\uDF5F\uDF79-\uDFFF]|\uD835[\uDC55\uDC9D\uDCA0\uDCA1\uDCA3\uDCA4\uDCA7\uDCA8\uDCAD\uDCBA\uDCBC\uDCC4\uDD06\uDD0B\uDD0C\uDD15\uDD1D\uDD3A\uDD3F\uDD45\uDD47-\uDD49\uDD51\uDEA6\uDEA7\uDFCC\uDFCD]|\uD836[\uDE8C-\uDE9A\uDEA0\uDEB0-\uDFFF]|\uD838[\uDC07\uDC19\uDC1A\uDC22\uDC25\uDC2B-\uDFFF]|\uD83A[\uDCC5\uDCC6\uDCD7-\uDCFF\uDD4B-\uDD4F\uDD5A-\uDD5D\uDD60-\uDFFF]|\uD83B[\uDC00-\uDC70\uDCB5-\uDDFF\uDE04\uDE20\uDE23\uDE25\uDE26\uDE28\uDE33\uDE38\uDE3A\uDE3C-\uDE41\uDE43-\uDE46\uDE48\uDE4A\uDE4C\uDE50\uDE53\uDE55\uDE56\uDE58\uDE5A\uDE5C\uDE5E\uDE60\uDE63\uDE65\uDE66\uDE6B\uDE73\uDE78\uDE7D\uDE7F\uDE8A\uDE9C-\uDEA0\uDEA4\uDEAA\uDEBC-\uDEEF\uDEF2-\uDFFF]|\uD83C[\uDC2C-\uDC2F\uDC94-\uDC9F\uDCAF\uDCB0\uDCC0\uDCD0\uDCF6-\uDCFF\uDD0D-\uDD0F\uDD6C-\uDD6F\uDDAD-\uDDE5\uDE03-\uDE0F\uDE3C-\uDE3F\uDE49-\uDE4F\uDE52-\uDE5F\uDE66-\uDEFF]|\uD83D[\uDED5-\uDEDF\uDEED-\uDEEF\uDEFA-\uDEFF\uDF74-\uDF7F\uDFD9-\uDFFF]|\uD83E[\uDC0C-\uDC0F\uDC48-\uDC4F\uDC5A-\uDC5F\uDC88-\uDC8F\uDCAE-\uDCFF\uDD0C-\uDD0F\uDD3F\uDD71\uDD72\uDD77-\uDD79\uDD7B\uDDA3-\uDDAF\uDDBA-\uDDBF\uDDC3-\uDDCF\uDE00-\uDE5F\uDE6E-\uDFFF]|\uD869[\uDED7-\uDEFF]|\uD86D[\uDF35-\uDF3F]|\uD86E[\uDC1E\uDC1F]|\uD873[\uDEA2-\uDEAF]|\uD87A[\uDFE1-\uDFFF]|\uD87E[\uDE1E-\uDFFF]|\uDB40[\uDC00-\uDCFF\uDDF0-\uDFFF]' + }, + { + 'name': 'Cc', + 'alias': 'Control', + 'bmp': '\0-\x1F\x7F-\x9F' + }, + { + 'name': 'Cf', + 'alias': 'Format', + 'bmp': '\xAD\u0600-\u0605\u061C\u06DD\u070F\u08E2\u180E\u200B-\u200F\u202A-\u202E\u2060-\u2064\u2066-\u206F\uFEFF\uFFF9-\uFFFB', + 'astral': '\uD804[\uDCBD\uDCCD]|\uD82F[\uDCA0-\uDCA3]|\uD834[\uDD73-\uDD7A]|\uDB40[\uDC01\uDC20-\uDC7F]' + }, + { + 'name': 'Cn', + 'alias': 'Unassigned', + 'bmp': '\u0378\u0379\u0380-\u0383\u038B\u038D\u03A2\u0530\u0557\u0558\u058B\u058C\u0590\u05C8-\u05CF\u05EB-\u05EE\u05F5-\u05FF\u061D\u070E\u074B\u074C\u07B2-\u07BF\u07FB\u07FC\u082E\u082F\u083F\u085C\u085D\u085F\u086B-\u089F\u08B5\u08BE-\u08D2\u0984\u098D\u098E\u0991\u0992\u09A9\u09B1\u09B3-\u09B5\u09BA\u09BB\u09C5\u09C6\u09C9\u09CA\u09CF-\u09D6\u09D8-\u09DB\u09DE\u09E4\u09E5\u09FF\u0A00\u0A04\u0A0B-\u0A0E\u0A11\u0A12\u0A29\u0A31\u0A34\u0A37\u0A3A\u0A3B\u0A3D\u0A43-\u0A46\u0A49\u0A4A\u0A4E-\u0A50\u0A52-\u0A58\u0A5D\u0A5F-\u0A65\u0A77-\u0A80\u0A84\u0A8E\u0A92\u0AA9\u0AB1\u0AB4\u0ABA\u0ABB\u0AC6\u0ACA\u0ACE\u0ACF\u0AD1-\u0ADF\u0AE4\u0AE5\u0AF2-\u0AF8\u0B00\u0B04\u0B0D\u0B0E\u0B11\u0B12\u0B29\u0B31\u0B34\u0B3A\u0B3B\u0B45\u0B46\u0B49\u0B4A\u0B4E-\u0B55\u0B58-\u0B5B\u0B5E\u0B64\u0B65\u0B78-\u0B81\u0B84\u0B8B-\u0B8D\u0B91\u0B96-\u0B98\u0B9B\u0B9D\u0BA0-\u0BA2\u0BA5-\u0BA7\u0BAB-\u0BAD\u0BBA-\u0BBD\u0BC3-\u0BC5\u0BC9\u0BCE\u0BCF\u0BD1-\u0BD6\u0BD8-\u0BE5\u0BFB-\u0BFF\u0C0D\u0C11\u0C29\u0C3A-\u0C3C\u0C45\u0C49\u0C4E-\u0C54\u0C57\u0C5B-\u0C5F\u0C64\u0C65\u0C70-\u0C77\u0C8D\u0C91\u0CA9\u0CB4\u0CBA\u0CBB\u0CC5\u0CC9\u0CCE-\u0CD4\u0CD7-\u0CDD\u0CDF\u0CE4\u0CE5\u0CF0\u0CF3-\u0CFF\u0D04\u0D0D\u0D11\u0D45\u0D49\u0D50-\u0D53\u0D64\u0D65\u0D80\u0D81\u0D84\u0D97-\u0D99\u0DB2\u0DBC\u0DBE\u0DBF\u0DC7-\u0DC9\u0DCB-\u0DCE\u0DD5\u0DD7\u0DE0-\u0DE5\u0DF0\u0DF1\u0DF5-\u0E00\u0E3B-\u0E3E\u0E5C-\u0E80\u0E83\u0E85\u0E86\u0E89\u0E8B\u0E8C\u0E8E-\u0E93\u0E98\u0EA0\u0EA4\u0EA6\u0EA8\u0EA9\u0EAC\u0EBA\u0EBE\u0EBF\u0EC5\u0EC7\u0ECE\u0ECF\u0EDA\u0EDB\u0EE0-\u0EFF\u0F48\u0F6D-\u0F70\u0F98\u0FBD\u0FCD\u0FDB-\u0FFF\u10C6\u10C8-\u10CC\u10CE\u10CF\u1249\u124E\u124F\u1257\u1259\u125E\u125F\u1289\u128E\u128F\u12B1\u12B6\u12B7\u12BF\u12C1\u12C6\u12C7\u12D7\u1311\u1316\u1317\u135B\u135C\u137D-\u137F\u139A-\u139F\u13F6\u13F7\u13FE\u13FF\u169D-\u169F\u16F9-\u16FF\u170D\u1715-\u171F\u1737-\u173F\u1754-\u175F\u176D\u1771\u1774-\u177F\u17DE\u17DF\u17EA-\u17EF\u17FA-\u17FF\u180F\u181A-\u181F\u1879-\u187F\u18AB-\u18AF\u18F6-\u18FF\u191F\u192C-\u192F\u193C-\u193F\u1941-\u1943\u196E\u196F\u1975-\u197F\u19AC-\u19AF\u19CA-\u19CF\u19DB-\u19DD\u1A1C\u1A1D\u1A5F\u1A7D\u1A7E\u1A8A-\u1A8F\u1A9A-\u1A9F\u1AAE\u1AAF\u1ABF-\u1AFF\u1B4C-\u1B4F\u1B7D-\u1B7F\u1BF4-\u1BFB\u1C38-\u1C3A\u1C4A-\u1C4C\u1C89-\u1C8F\u1CBB\u1CBC\u1CC8-\u1CCF\u1CFA-\u1CFF\u1DFA\u1F16\u1F17\u1F1E\u1F1F\u1F46\u1F47\u1F4E\u1F4F\u1F58\u1F5A\u1F5C\u1F5E\u1F7E\u1F7F\u1FB5\u1FC5\u1FD4\u1FD5\u1FDC\u1FF0\u1FF1\u1FF5\u1FFF\u2065\u2072\u2073\u208F\u209D-\u209F\u20C0-\u20CF\u20F1-\u20FF\u218C-\u218F\u2427-\u243F\u244B-\u245F\u2B74\u2B75\u2B96\u2B97\u2BC9\u2BFF\u2C2F\u2C5F\u2CF4-\u2CF8\u2D26\u2D28-\u2D2C\u2D2E\u2D2F\u2D68-\u2D6E\u2D71-\u2D7E\u2D97-\u2D9F\u2DA7\u2DAF\u2DB7\u2DBF\u2DC7\u2DCF\u2DD7\u2DDF\u2E4F-\u2E7F\u2E9A\u2EF4-\u2EFF\u2FD6-\u2FEF\u2FFC-\u2FFF\u3040\u3097\u3098\u3100-\u3104\u3130\u318F\u31BB-\u31BF\u31E4-\u31EF\u321F\u32FF\u4DB6-\u4DBF\u9FF0-\u9FFF\uA48D-\uA48F\uA4C7-\uA4CF\uA62C-\uA63F\uA6F8-\uA6FF\uA7BA-\uA7F6\uA82C-\uA82F\uA83A-\uA83F\uA878-\uA87F\uA8C6-\uA8CD\uA8DA-\uA8DF\uA954-\uA95E\uA97D-\uA97F\uA9CE\uA9DA-\uA9DD\uA9FF\uAA37-\uAA3F\uAA4E\uAA4F\uAA5A\uAA5B\uAAC3-\uAADA\uAAF7-\uAB00\uAB07\uAB08\uAB0F\uAB10\uAB17-\uAB1F\uAB27\uAB2F\uAB66-\uAB6F\uABEE\uABEF\uABFA-\uABFF\uD7A4-\uD7AF\uD7C7-\uD7CA\uD7FC-\uD7FF\uFA6E\uFA6F\uFADA-\uFAFF\uFB07-\uFB12\uFB18-\uFB1C\uFB37\uFB3D\uFB3F\uFB42\uFB45\uFBC2-\uFBD2\uFD40-\uFD4F\uFD90\uFD91\uFDC8-\uFDEF\uFDFE\uFDFF\uFE1A-\uFE1F\uFE53\uFE67\uFE6C-\uFE6F\uFE75\uFEFD\uFEFE\uFF00\uFFBF-\uFFC1\uFFC8\uFFC9\uFFD0\uFFD1\uFFD8\uFFD9\uFFDD-\uFFDF\uFFE7\uFFEF-\uFFF8\uFFFE\uFFFF', + 'astral': '\uD800[\uDC0C\uDC27\uDC3B\uDC3E\uDC4E\uDC4F\uDC5E-\uDC7F\uDCFB-\uDCFF\uDD03-\uDD06\uDD34-\uDD36\uDD8F\uDD9C-\uDD9F\uDDA1-\uDDCF\uDDFE-\uDE7F\uDE9D-\uDE9F\uDED1-\uDEDF\uDEFC-\uDEFF\uDF24-\uDF2C\uDF4B-\uDF4F\uDF7B-\uDF7F\uDF9E\uDFC4-\uDFC7\uDFD6-\uDFFF]|\uD801[\uDC9E\uDC9F\uDCAA-\uDCAF\uDCD4-\uDCD7\uDCFC-\uDCFF\uDD28-\uDD2F\uDD64-\uDD6E\uDD70-\uDDFF\uDF37-\uDF3F\uDF56-\uDF5F\uDF68-\uDFFF]|\uD802[\uDC06\uDC07\uDC09\uDC36\uDC39-\uDC3B\uDC3D\uDC3E\uDC56\uDC9F-\uDCA6\uDCB0-\uDCDF\uDCF3\uDCF6-\uDCFA\uDD1C-\uDD1E\uDD3A-\uDD3E\uDD40-\uDD7F\uDDB8-\uDDBB\uDDD0\uDDD1\uDE04\uDE07-\uDE0B\uDE14\uDE18\uDE36\uDE37\uDE3B-\uDE3E\uDE49-\uDE4F\uDE59-\uDE5F\uDEA0-\uDEBF\uDEE7-\uDEEA\uDEF7-\uDEFF\uDF36-\uDF38\uDF56\uDF57\uDF73-\uDF77\uDF92-\uDF98\uDF9D-\uDFA8\uDFB0-\uDFFF]|\uD803[\uDC49-\uDC7F\uDCB3-\uDCBF\uDCF3-\uDCF9\uDD28-\uDD2F\uDD3A-\uDE5F\uDE7F-\uDEFF\uDF28-\uDF2F\uDF5A-\uDFFF]|\uD804[\uDC4E-\uDC51\uDC70-\uDC7E\uDCC2-\uDCCC\uDCCE\uDCCF\uDCE9-\uDCEF\uDCFA-\uDCFF\uDD35\uDD47-\uDD4F\uDD77-\uDD7F\uDDCE\uDDCF\uDDE0\uDDF5-\uDDFF\uDE12\uDE3F-\uDE7F\uDE87\uDE89\uDE8E\uDE9E\uDEAA-\uDEAF\uDEEB-\uDEEF\uDEFA-\uDEFF\uDF04\uDF0D\uDF0E\uDF11\uDF12\uDF29\uDF31\uDF34\uDF3A\uDF45\uDF46\uDF49\uDF4A\uDF4E\uDF4F\uDF51-\uDF56\uDF58-\uDF5C\uDF64\uDF65\uDF6D-\uDF6F\uDF75-\uDFFF]|\uD805[\uDC5A\uDC5C\uDC5F-\uDC7F\uDCC8-\uDCCF\uDCDA-\uDD7F\uDDB6\uDDB7\uDDDE-\uDDFF\uDE45-\uDE4F\uDE5A-\uDE5F\uDE6D-\uDE7F\uDEB8-\uDEBF\uDECA-\uDEFF\uDF1B\uDF1C\uDF2C-\uDF2F\uDF40-\uDFFF]|\uD806[\uDC3C-\uDC9F\uDCF3-\uDCFE\uDD00-\uDDFF\uDE48-\uDE4F\uDE84\uDE85\uDEA3-\uDEBF\uDEF9-\uDFFF]|\uD807[\uDC09\uDC37\uDC46-\uDC4F\uDC6D-\uDC6F\uDC90\uDC91\uDCA8\uDCB7-\uDCFF\uDD07\uDD0A\uDD37-\uDD39\uDD3B\uDD3E\uDD48-\uDD4F\uDD5A-\uDD5F\uDD66\uDD69\uDD8F\uDD92\uDD99-\uDD9F\uDDAA-\uDEDF\uDEF9-\uDFFF]|\uD808[\uDF9A-\uDFFF]|\uD809[\uDC6F\uDC75-\uDC7F\uDD44-\uDFFF]|[\uD80A\uD80B\uD80E-\uD810\uD812-\uD819\uD823-\uD82B\uD82D\uD82E\uD830-\uD833\uD837\uD839\uD83F\uD87B-\uD87D\uD87F-\uDB3F\uDB41-\uDB7F][\uDC00-\uDFFF]|\uD80D[\uDC2F-\uDFFF]|\uD811[\uDE47-\uDFFF]|\uD81A[\uDE39-\uDE3F\uDE5F\uDE6A-\uDE6D\uDE70-\uDECF\uDEEE\uDEEF\uDEF6-\uDEFF\uDF46-\uDF4F\uDF5A\uDF62\uDF78-\uDF7C\uDF90-\uDFFF]|\uD81B[\uDC00-\uDE3F\uDE9B-\uDEFF\uDF45-\uDF4F\uDF7F-\uDF8E\uDFA0-\uDFDF\uDFE2-\uDFFF]|\uD821[\uDFF2-\uDFFF]|\uD822[\uDEF3-\uDFFF]|\uD82C[\uDD1F-\uDD6F\uDEFC-\uDFFF]|\uD82F[\uDC6B-\uDC6F\uDC7D-\uDC7F\uDC89-\uDC8F\uDC9A\uDC9B\uDCA4-\uDFFF]|\uD834[\uDCF6-\uDCFF\uDD27\uDD28\uDDE9-\uDDFF\uDE46-\uDEDF\uDEF4-\uDEFF\uDF57-\uDF5F\uDF79-\uDFFF]|\uD835[\uDC55\uDC9D\uDCA0\uDCA1\uDCA3\uDCA4\uDCA7\uDCA8\uDCAD\uDCBA\uDCBC\uDCC4\uDD06\uDD0B\uDD0C\uDD15\uDD1D\uDD3A\uDD3F\uDD45\uDD47-\uDD49\uDD51\uDEA6\uDEA7\uDFCC\uDFCD]|\uD836[\uDE8C-\uDE9A\uDEA0\uDEB0-\uDFFF]|\uD838[\uDC07\uDC19\uDC1A\uDC22\uDC25\uDC2B-\uDFFF]|\uD83A[\uDCC5\uDCC6\uDCD7-\uDCFF\uDD4B-\uDD4F\uDD5A-\uDD5D\uDD60-\uDFFF]|\uD83B[\uDC00-\uDC70\uDCB5-\uDDFF\uDE04\uDE20\uDE23\uDE25\uDE26\uDE28\uDE33\uDE38\uDE3A\uDE3C-\uDE41\uDE43-\uDE46\uDE48\uDE4A\uDE4C\uDE50\uDE53\uDE55\uDE56\uDE58\uDE5A\uDE5C\uDE5E\uDE60\uDE63\uDE65\uDE66\uDE6B\uDE73\uDE78\uDE7D\uDE7F\uDE8A\uDE9C-\uDEA0\uDEA4\uDEAA\uDEBC-\uDEEF\uDEF2-\uDFFF]|\uD83C[\uDC2C-\uDC2F\uDC94-\uDC9F\uDCAF\uDCB0\uDCC0\uDCD0\uDCF6-\uDCFF\uDD0D-\uDD0F\uDD6C-\uDD6F\uDDAD-\uDDE5\uDE03-\uDE0F\uDE3C-\uDE3F\uDE49-\uDE4F\uDE52-\uDE5F\uDE66-\uDEFF]|\uD83D[\uDED5-\uDEDF\uDEED-\uDEEF\uDEFA-\uDEFF\uDF74-\uDF7F\uDFD9-\uDFFF]|\uD83E[\uDC0C-\uDC0F\uDC48-\uDC4F\uDC5A-\uDC5F\uDC88-\uDC8F\uDCAE-\uDCFF\uDD0C-\uDD0F\uDD3F\uDD71\uDD72\uDD77-\uDD79\uDD7B\uDDA3-\uDDAF\uDDBA-\uDDBF\uDDC3-\uDDCF\uDE00-\uDE5F\uDE6E-\uDFFF]|\uD869[\uDED7-\uDEFF]|\uD86D[\uDF35-\uDF3F]|\uD86E[\uDC1E\uDC1F]|\uD873[\uDEA2-\uDEAF]|\uD87A[\uDFE1-\uDFFF]|\uD87E[\uDE1E-\uDFFF]|\uDB40[\uDC00\uDC02-\uDC1F\uDC80-\uDCFF\uDDF0-\uDFFF]|[\uDBBF\uDBFF][\uDFFE\uDFFF]' + }, + { + 'name': 'Co', + 'alias': 'Private_Use', + 'bmp': '\uE000-\uF8FF', + 'astral': '[\uDB80-\uDBBE\uDBC0-\uDBFE][\uDC00-\uDFFF]|[\uDBBF\uDBFF][\uDC00-\uDFFD]' + }, + { + 'name': 'Cs', + 'alias': 'Surrogate', + 'bmp': '\uD800-\uDFFF' + }, + { + 'name': 'L', + 'alias': 'Letter', + 'bmp': 'A-Za-z\xAA\xB5\xBA\xC0-\xD6\xD8-\xF6\xF8-\u02C1\u02C6-\u02D1\u02E0-\u02E4\u02EC\u02EE\u0370-\u0374\u0376\u0377\u037A-\u037D\u037F\u0386\u0388-\u038A\u038C\u038E-\u03A1\u03A3-\u03F5\u03F7-\u0481\u048A-\u052F\u0531-\u0556\u0559\u0560-\u0588\u05D0-\u05EA\u05EF-\u05F2\u0620-\u064A\u066E\u066F\u0671-\u06D3\u06D5\u06E5\u06E6\u06EE\u06EF\u06FA-\u06FC\u06FF\u0710\u0712-\u072F\u074D-\u07A5\u07B1\u07CA-\u07EA\u07F4\u07F5\u07FA\u0800-\u0815\u081A\u0824\u0828\u0840-\u0858\u0860-\u086A\u08A0-\u08B4\u08B6-\u08BD\u0904-\u0939\u093D\u0950\u0958-\u0961\u0971-\u0980\u0985-\u098C\u098F\u0990\u0993-\u09A8\u09AA-\u09B0\u09B2\u09B6-\u09B9\u09BD\u09CE\u09DC\u09DD\u09DF-\u09E1\u09F0\u09F1\u09FC\u0A05-\u0A0A\u0A0F\u0A10\u0A13-\u0A28\u0A2A-\u0A30\u0A32\u0A33\u0A35\u0A36\u0A38\u0A39\u0A59-\u0A5C\u0A5E\u0A72-\u0A74\u0A85-\u0A8D\u0A8F-\u0A91\u0A93-\u0AA8\u0AAA-\u0AB0\u0AB2\u0AB3\u0AB5-\u0AB9\u0ABD\u0AD0\u0AE0\u0AE1\u0AF9\u0B05-\u0B0C\u0B0F\u0B10\u0B13-\u0B28\u0B2A-\u0B30\u0B32\u0B33\u0B35-\u0B39\u0B3D\u0B5C\u0B5D\u0B5F-\u0B61\u0B71\u0B83\u0B85-\u0B8A\u0B8E-\u0B90\u0B92-\u0B95\u0B99\u0B9A\u0B9C\u0B9E\u0B9F\u0BA3\u0BA4\u0BA8-\u0BAA\u0BAE-\u0BB9\u0BD0\u0C05-\u0C0C\u0C0E-\u0C10\u0C12-\u0C28\u0C2A-\u0C39\u0C3D\u0C58-\u0C5A\u0C60\u0C61\u0C80\u0C85-\u0C8C\u0C8E-\u0C90\u0C92-\u0CA8\u0CAA-\u0CB3\u0CB5-\u0CB9\u0CBD\u0CDE\u0CE0\u0CE1\u0CF1\u0CF2\u0D05-\u0D0C\u0D0E-\u0D10\u0D12-\u0D3A\u0D3D\u0D4E\u0D54-\u0D56\u0D5F-\u0D61\u0D7A-\u0D7F\u0D85-\u0D96\u0D9A-\u0DB1\u0DB3-\u0DBB\u0DBD\u0DC0-\u0DC6\u0E01-\u0E30\u0E32\u0E33\u0E40-\u0E46\u0E81\u0E82\u0E84\u0E87\u0E88\u0E8A\u0E8D\u0E94-\u0E97\u0E99-\u0E9F\u0EA1-\u0EA3\u0EA5\u0EA7\u0EAA\u0EAB\u0EAD-\u0EB0\u0EB2\u0EB3\u0EBD\u0EC0-\u0EC4\u0EC6\u0EDC-\u0EDF\u0F00\u0F40-\u0F47\u0F49-\u0F6C\u0F88-\u0F8C\u1000-\u102A\u103F\u1050-\u1055\u105A-\u105D\u1061\u1065\u1066\u106E-\u1070\u1075-\u1081\u108E\u10A0-\u10C5\u10C7\u10CD\u10D0-\u10FA\u10FC-\u1248\u124A-\u124D\u1250-\u1256\u1258\u125A-\u125D\u1260-\u1288\u128A-\u128D\u1290-\u12B0\u12B2-\u12B5\u12B8-\u12BE\u12C0\u12C2-\u12C5\u12C8-\u12D6\u12D8-\u1310\u1312-\u1315\u1318-\u135A\u1380-\u138F\u13A0-\u13F5\u13F8-\u13FD\u1401-\u166C\u166F-\u167F\u1681-\u169A\u16A0-\u16EA\u16F1-\u16F8\u1700-\u170C\u170E-\u1711\u1720-\u1731\u1740-\u1751\u1760-\u176C\u176E-\u1770\u1780-\u17B3\u17D7\u17DC\u1820-\u1878\u1880-\u1884\u1887-\u18A8\u18AA\u18B0-\u18F5\u1900-\u191E\u1950-\u196D\u1970-\u1974\u1980-\u19AB\u19B0-\u19C9\u1A00-\u1A16\u1A20-\u1A54\u1AA7\u1B05-\u1B33\u1B45-\u1B4B\u1B83-\u1BA0\u1BAE\u1BAF\u1BBA-\u1BE5\u1C00-\u1C23\u1C4D-\u1C4F\u1C5A-\u1C7D\u1C80-\u1C88\u1C90-\u1CBA\u1CBD-\u1CBF\u1CE9-\u1CEC\u1CEE-\u1CF1\u1CF5\u1CF6\u1D00-\u1DBF\u1E00-\u1F15\u1F18-\u1F1D\u1F20-\u1F45\u1F48-\u1F4D\u1F50-\u1F57\u1F59\u1F5B\u1F5D\u1F5F-\u1F7D\u1F80-\u1FB4\u1FB6-\u1FBC\u1FBE\u1FC2-\u1FC4\u1FC6-\u1FCC\u1FD0-\u1FD3\u1FD6-\u1FDB\u1FE0-\u1FEC\u1FF2-\u1FF4\u1FF6-\u1FFC\u2071\u207F\u2090-\u209C\u2102\u2107\u210A-\u2113\u2115\u2119-\u211D\u2124\u2126\u2128\u212A-\u212D\u212F-\u2139\u213C-\u213F\u2145-\u2149\u214E\u2183\u2184\u2C00-\u2C2E\u2C30-\u2C5E\u2C60-\u2CE4\u2CEB-\u2CEE\u2CF2\u2CF3\u2D00-\u2D25\u2D27\u2D2D\u2D30-\u2D67\u2D6F\u2D80-\u2D96\u2DA0-\u2DA6\u2DA8-\u2DAE\u2DB0-\u2DB6\u2DB8-\u2DBE\u2DC0-\u2DC6\u2DC8-\u2DCE\u2DD0-\u2DD6\u2DD8-\u2DDE\u2E2F\u3005\u3006\u3031-\u3035\u303B\u303C\u3041-\u3096\u309D-\u309F\u30A1-\u30FA\u30FC-\u30FF\u3105-\u312F\u3131-\u318E\u31A0-\u31BA\u31F0-\u31FF\u3400-\u4DB5\u4E00-\u9FEF\uA000-\uA48C\uA4D0-\uA4FD\uA500-\uA60C\uA610-\uA61F\uA62A\uA62B\uA640-\uA66E\uA67F-\uA69D\uA6A0-\uA6E5\uA717-\uA71F\uA722-\uA788\uA78B-\uA7B9\uA7F7-\uA801\uA803-\uA805\uA807-\uA80A\uA80C-\uA822\uA840-\uA873\uA882-\uA8B3\uA8F2-\uA8F7\uA8FB\uA8FD\uA8FE\uA90A-\uA925\uA930-\uA946\uA960-\uA97C\uA984-\uA9B2\uA9CF\uA9E0-\uA9E4\uA9E6-\uA9EF\uA9FA-\uA9FE\uAA00-\uAA28\uAA40-\uAA42\uAA44-\uAA4B\uAA60-\uAA76\uAA7A\uAA7E-\uAAAF\uAAB1\uAAB5\uAAB6\uAAB9-\uAABD\uAAC0\uAAC2\uAADB-\uAADD\uAAE0-\uAAEA\uAAF2-\uAAF4\uAB01-\uAB06\uAB09-\uAB0E\uAB11-\uAB16\uAB20-\uAB26\uAB28-\uAB2E\uAB30-\uAB5A\uAB5C-\uAB65\uAB70-\uABE2\uAC00-\uD7A3\uD7B0-\uD7C6\uD7CB-\uD7FB\uF900-\uFA6D\uFA70-\uFAD9\uFB00-\uFB06\uFB13-\uFB17\uFB1D\uFB1F-\uFB28\uFB2A-\uFB36\uFB38-\uFB3C\uFB3E\uFB40\uFB41\uFB43\uFB44\uFB46-\uFBB1\uFBD3-\uFD3D\uFD50-\uFD8F\uFD92-\uFDC7\uFDF0-\uFDFB\uFE70-\uFE74\uFE76-\uFEFC\uFF21-\uFF3A\uFF41-\uFF5A\uFF66-\uFFBE\uFFC2-\uFFC7\uFFCA-\uFFCF\uFFD2-\uFFD7\uFFDA-\uFFDC', + 'astral': '\uD800[\uDC00-\uDC0B\uDC0D-\uDC26\uDC28-\uDC3A\uDC3C\uDC3D\uDC3F-\uDC4D\uDC50-\uDC5D\uDC80-\uDCFA\uDE80-\uDE9C\uDEA0-\uDED0\uDF00-\uDF1F\uDF2D-\uDF40\uDF42-\uDF49\uDF50-\uDF75\uDF80-\uDF9D\uDFA0-\uDFC3\uDFC8-\uDFCF]|\uD801[\uDC00-\uDC9D\uDCB0-\uDCD3\uDCD8-\uDCFB\uDD00-\uDD27\uDD30-\uDD63\uDE00-\uDF36\uDF40-\uDF55\uDF60-\uDF67]|\uD802[\uDC00-\uDC05\uDC08\uDC0A-\uDC35\uDC37\uDC38\uDC3C\uDC3F-\uDC55\uDC60-\uDC76\uDC80-\uDC9E\uDCE0-\uDCF2\uDCF4\uDCF5\uDD00-\uDD15\uDD20-\uDD39\uDD80-\uDDB7\uDDBE\uDDBF\uDE00\uDE10-\uDE13\uDE15-\uDE17\uDE19-\uDE35\uDE60-\uDE7C\uDE80-\uDE9C\uDEC0-\uDEC7\uDEC9-\uDEE4\uDF00-\uDF35\uDF40-\uDF55\uDF60-\uDF72\uDF80-\uDF91]|\uD803[\uDC00-\uDC48\uDC80-\uDCB2\uDCC0-\uDCF2\uDD00-\uDD23\uDF00-\uDF1C\uDF27\uDF30-\uDF45]|\uD804[\uDC03-\uDC37\uDC83-\uDCAF\uDCD0-\uDCE8\uDD03-\uDD26\uDD44\uDD50-\uDD72\uDD76\uDD83-\uDDB2\uDDC1-\uDDC4\uDDDA\uDDDC\uDE00-\uDE11\uDE13-\uDE2B\uDE80-\uDE86\uDE88\uDE8A-\uDE8D\uDE8F-\uDE9D\uDE9F-\uDEA8\uDEB0-\uDEDE\uDF05-\uDF0C\uDF0F\uDF10\uDF13-\uDF28\uDF2A-\uDF30\uDF32\uDF33\uDF35-\uDF39\uDF3D\uDF50\uDF5D-\uDF61]|\uD805[\uDC00-\uDC34\uDC47-\uDC4A\uDC80-\uDCAF\uDCC4\uDCC5\uDCC7\uDD80-\uDDAE\uDDD8-\uDDDB\uDE00-\uDE2F\uDE44\uDE80-\uDEAA\uDF00-\uDF1A]|\uD806[\uDC00-\uDC2B\uDCA0-\uDCDF\uDCFF\uDE00\uDE0B-\uDE32\uDE3A\uDE50\uDE5C-\uDE83\uDE86-\uDE89\uDE9D\uDEC0-\uDEF8]|\uD807[\uDC00-\uDC08\uDC0A-\uDC2E\uDC40\uDC72-\uDC8F\uDD00-\uDD06\uDD08\uDD09\uDD0B-\uDD30\uDD46\uDD60-\uDD65\uDD67\uDD68\uDD6A-\uDD89\uDD98\uDEE0-\uDEF2]|\uD808[\uDC00-\uDF99]|\uD809[\uDC80-\uDD43]|[\uD80C\uD81C-\uD820\uD840-\uD868\uD86A-\uD86C\uD86F-\uD872\uD874-\uD879][\uDC00-\uDFFF]|\uD80D[\uDC00-\uDC2E]|\uD811[\uDC00-\uDE46]|\uD81A[\uDC00-\uDE38\uDE40-\uDE5E\uDED0-\uDEED\uDF00-\uDF2F\uDF40-\uDF43\uDF63-\uDF77\uDF7D-\uDF8F]|\uD81B[\uDE40-\uDE7F\uDF00-\uDF44\uDF50\uDF93-\uDF9F\uDFE0\uDFE1]|\uD821[\uDC00-\uDFF1]|\uD822[\uDC00-\uDEF2]|\uD82C[\uDC00-\uDD1E\uDD70-\uDEFB]|\uD82F[\uDC00-\uDC6A\uDC70-\uDC7C\uDC80-\uDC88\uDC90-\uDC99]|\uD835[\uDC00-\uDC54\uDC56-\uDC9C\uDC9E\uDC9F\uDCA2\uDCA5\uDCA6\uDCA9-\uDCAC\uDCAE-\uDCB9\uDCBB\uDCBD-\uDCC3\uDCC5-\uDD05\uDD07-\uDD0A\uDD0D-\uDD14\uDD16-\uDD1C\uDD1E-\uDD39\uDD3B-\uDD3E\uDD40-\uDD44\uDD46\uDD4A-\uDD50\uDD52-\uDEA5\uDEA8-\uDEC0\uDEC2-\uDEDA\uDEDC-\uDEFA\uDEFC-\uDF14\uDF16-\uDF34\uDF36-\uDF4E\uDF50-\uDF6E\uDF70-\uDF88\uDF8A-\uDFA8\uDFAA-\uDFC2\uDFC4-\uDFCB]|\uD83A[\uDC00-\uDCC4\uDD00-\uDD43]|\uD83B[\uDE00-\uDE03\uDE05-\uDE1F\uDE21\uDE22\uDE24\uDE27\uDE29-\uDE32\uDE34-\uDE37\uDE39\uDE3B\uDE42\uDE47\uDE49\uDE4B\uDE4D-\uDE4F\uDE51\uDE52\uDE54\uDE57\uDE59\uDE5B\uDE5D\uDE5F\uDE61\uDE62\uDE64\uDE67-\uDE6A\uDE6C-\uDE72\uDE74-\uDE77\uDE79-\uDE7C\uDE7E\uDE80-\uDE89\uDE8B-\uDE9B\uDEA1-\uDEA3\uDEA5-\uDEA9\uDEAB-\uDEBB]|\uD869[\uDC00-\uDED6\uDF00-\uDFFF]|\uD86D[\uDC00-\uDF34\uDF40-\uDFFF]|\uD86E[\uDC00-\uDC1D\uDC20-\uDFFF]|\uD873[\uDC00-\uDEA1\uDEB0-\uDFFF]|\uD87A[\uDC00-\uDFE0]|\uD87E[\uDC00-\uDE1D]' + }, + { + 'name': 'LC', + 'alias': 'Cased_Letter', + 'bmp': 'A-Za-z\xB5\xC0-\xD6\xD8-\xF6\xF8-\u01BA\u01BC-\u01BF\u01C4-\u0293\u0295-\u02AF\u0370-\u0373\u0376\u0377\u037B-\u037D\u037F\u0386\u0388-\u038A\u038C\u038E-\u03A1\u03A3-\u03F5\u03F7-\u0481\u048A-\u052F\u0531-\u0556\u0560-\u0588\u10A0-\u10C5\u10C7\u10CD\u10D0-\u10FA\u10FD-\u10FF\u13A0-\u13F5\u13F8-\u13FD\u1C80-\u1C88\u1C90-\u1CBA\u1CBD-\u1CBF\u1D00-\u1D2B\u1D6B-\u1D77\u1D79-\u1D9A\u1E00-\u1F15\u1F18-\u1F1D\u1F20-\u1F45\u1F48-\u1F4D\u1F50-\u1F57\u1F59\u1F5B\u1F5D\u1F5F-\u1F7D\u1F80-\u1FB4\u1FB6-\u1FBC\u1FBE\u1FC2-\u1FC4\u1FC6-\u1FCC\u1FD0-\u1FD3\u1FD6-\u1FDB\u1FE0-\u1FEC\u1FF2-\u1FF4\u1FF6-\u1FFC\u2102\u2107\u210A-\u2113\u2115\u2119-\u211D\u2124\u2126\u2128\u212A-\u212D\u212F-\u2134\u2139\u213C-\u213F\u2145-\u2149\u214E\u2183\u2184\u2C00-\u2C2E\u2C30-\u2C5E\u2C60-\u2C7B\u2C7E-\u2CE4\u2CEB-\u2CEE\u2CF2\u2CF3\u2D00-\u2D25\u2D27\u2D2D\uA640-\uA66D\uA680-\uA69B\uA722-\uA76F\uA771-\uA787\uA78B-\uA78E\uA790-\uA7B9\uA7FA\uAB30-\uAB5A\uAB60-\uAB65\uAB70-\uABBF\uFB00-\uFB06\uFB13-\uFB17\uFF21-\uFF3A\uFF41-\uFF5A', + 'astral': '\uD801[\uDC00-\uDC4F\uDCB0-\uDCD3\uDCD8-\uDCFB]|\uD803[\uDC80-\uDCB2\uDCC0-\uDCF2]|\uD806[\uDCA0-\uDCDF]|\uD81B[\uDE40-\uDE7F]|\uD835[\uDC00-\uDC54\uDC56-\uDC9C\uDC9E\uDC9F\uDCA2\uDCA5\uDCA6\uDCA9-\uDCAC\uDCAE-\uDCB9\uDCBB\uDCBD-\uDCC3\uDCC5-\uDD05\uDD07-\uDD0A\uDD0D-\uDD14\uDD16-\uDD1C\uDD1E-\uDD39\uDD3B-\uDD3E\uDD40-\uDD44\uDD46\uDD4A-\uDD50\uDD52-\uDEA5\uDEA8-\uDEC0\uDEC2-\uDEDA\uDEDC-\uDEFA\uDEFC-\uDF14\uDF16-\uDF34\uDF36-\uDF4E\uDF50-\uDF6E\uDF70-\uDF88\uDF8A-\uDFA8\uDFAA-\uDFC2\uDFC4-\uDFCB]|\uD83A[\uDD00-\uDD43]' + }, + { + 'name': 'Ll', + 'alias': 'Lowercase_Letter', + 'bmp': 'a-z\xB5\xDF-\xF6\xF8-\xFF\u0101\u0103\u0105\u0107\u0109\u010B\u010D\u010F\u0111\u0113\u0115\u0117\u0119\u011B\u011D\u011F\u0121\u0123\u0125\u0127\u0129\u012B\u012D\u012F\u0131\u0133\u0135\u0137\u0138\u013A\u013C\u013E\u0140\u0142\u0144\u0146\u0148\u0149\u014B\u014D\u014F\u0151\u0153\u0155\u0157\u0159\u015B\u015D\u015F\u0161\u0163\u0165\u0167\u0169\u016B\u016D\u016F\u0171\u0173\u0175\u0177\u017A\u017C\u017E-\u0180\u0183\u0185\u0188\u018C\u018D\u0192\u0195\u0199-\u019B\u019E\u01A1\u01A3\u01A5\u01A8\u01AA\u01AB\u01AD\u01B0\u01B4\u01B6\u01B9\u01BA\u01BD-\u01BF\u01C6\u01C9\u01CC\u01CE\u01D0\u01D2\u01D4\u01D6\u01D8\u01DA\u01DC\u01DD\u01DF\u01E1\u01E3\u01E5\u01E7\u01E9\u01EB\u01ED\u01EF\u01F0\u01F3\u01F5\u01F9\u01FB\u01FD\u01FF\u0201\u0203\u0205\u0207\u0209\u020B\u020D\u020F\u0211\u0213\u0215\u0217\u0219\u021B\u021D\u021F\u0221\u0223\u0225\u0227\u0229\u022B\u022D\u022F\u0231\u0233-\u0239\u023C\u023F\u0240\u0242\u0247\u0249\u024B\u024D\u024F-\u0293\u0295-\u02AF\u0371\u0373\u0377\u037B-\u037D\u0390\u03AC-\u03CE\u03D0\u03D1\u03D5-\u03D7\u03D9\u03DB\u03DD\u03DF\u03E1\u03E3\u03E5\u03E7\u03E9\u03EB\u03ED\u03EF-\u03F3\u03F5\u03F8\u03FB\u03FC\u0430-\u045F\u0461\u0463\u0465\u0467\u0469\u046B\u046D\u046F\u0471\u0473\u0475\u0477\u0479\u047B\u047D\u047F\u0481\u048B\u048D\u048F\u0491\u0493\u0495\u0497\u0499\u049B\u049D\u049F\u04A1\u04A3\u04A5\u04A7\u04A9\u04AB\u04AD\u04AF\u04B1\u04B3\u04B5\u04B7\u04B9\u04BB\u04BD\u04BF\u04C2\u04C4\u04C6\u04C8\u04CA\u04CC\u04CE\u04CF\u04D1\u04D3\u04D5\u04D7\u04D9\u04DB\u04DD\u04DF\u04E1\u04E3\u04E5\u04E7\u04E9\u04EB\u04ED\u04EF\u04F1\u04F3\u04F5\u04F7\u04F9\u04FB\u04FD\u04FF\u0501\u0503\u0505\u0507\u0509\u050B\u050D\u050F\u0511\u0513\u0515\u0517\u0519\u051B\u051D\u051F\u0521\u0523\u0525\u0527\u0529\u052B\u052D\u052F\u0560-\u0588\u10D0-\u10FA\u10FD-\u10FF\u13F8-\u13FD\u1C80-\u1C88\u1D00-\u1D2B\u1D6B-\u1D77\u1D79-\u1D9A\u1E01\u1E03\u1E05\u1E07\u1E09\u1E0B\u1E0D\u1E0F\u1E11\u1E13\u1E15\u1E17\u1E19\u1E1B\u1E1D\u1E1F\u1E21\u1E23\u1E25\u1E27\u1E29\u1E2B\u1E2D\u1E2F\u1E31\u1E33\u1E35\u1E37\u1E39\u1E3B\u1E3D\u1E3F\u1E41\u1E43\u1E45\u1E47\u1E49\u1E4B\u1E4D\u1E4F\u1E51\u1E53\u1E55\u1E57\u1E59\u1E5B\u1E5D\u1E5F\u1E61\u1E63\u1E65\u1E67\u1E69\u1E6B\u1E6D\u1E6F\u1E71\u1E73\u1E75\u1E77\u1E79\u1E7B\u1E7D\u1E7F\u1E81\u1E83\u1E85\u1E87\u1E89\u1E8B\u1E8D\u1E8F\u1E91\u1E93\u1E95-\u1E9D\u1E9F\u1EA1\u1EA3\u1EA5\u1EA7\u1EA9\u1EAB\u1EAD\u1EAF\u1EB1\u1EB3\u1EB5\u1EB7\u1EB9\u1EBB\u1EBD\u1EBF\u1EC1\u1EC3\u1EC5\u1EC7\u1EC9\u1ECB\u1ECD\u1ECF\u1ED1\u1ED3\u1ED5\u1ED7\u1ED9\u1EDB\u1EDD\u1EDF\u1EE1\u1EE3\u1EE5\u1EE7\u1EE9\u1EEB\u1EED\u1EEF\u1EF1\u1EF3\u1EF5\u1EF7\u1EF9\u1EFB\u1EFD\u1EFF-\u1F07\u1F10-\u1F15\u1F20-\u1F27\u1F30-\u1F37\u1F40-\u1F45\u1F50-\u1F57\u1F60-\u1F67\u1F70-\u1F7D\u1F80-\u1F87\u1F90-\u1F97\u1FA0-\u1FA7\u1FB0-\u1FB4\u1FB6\u1FB7\u1FBE\u1FC2-\u1FC4\u1FC6\u1FC7\u1FD0-\u1FD3\u1FD6\u1FD7\u1FE0-\u1FE7\u1FF2-\u1FF4\u1FF6\u1FF7\u210A\u210E\u210F\u2113\u212F\u2134\u2139\u213C\u213D\u2146-\u2149\u214E\u2184\u2C30-\u2C5E\u2C61\u2C65\u2C66\u2C68\u2C6A\u2C6C\u2C71\u2C73\u2C74\u2C76-\u2C7B\u2C81\u2C83\u2C85\u2C87\u2C89\u2C8B\u2C8D\u2C8F\u2C91\u2C93\u2C95\u2C97\u2C99\u2C9B\u2C9D\u2C9F\u2CA1\u2CA3\u2CA5\u2CA7\u2CA9\u2CAB\u2CAD\u2CAF\u2CB1\u2CB3\u2CB5\u2CB7\u2CB9\u2CBB\u2CBD\u2CBF\u2CC1\u2CC3\u2CC5\u2CC7\u2CC9\u2CCB\u2CCD\u2CCF\u2CD1\u2CD3\u2CD5\u2CD7\u2CD9\u2CDB\u2CDD\u2CDF\u2CE1\u2CE3\u2CE4\u2CEC\u2CEE\u2CF3\u2D00-\u2D25\u2D27\u2D2D\uA641\uA643\uA645\uA647\uA649\uA64B\uA64D\uA64F\uA651\uA653\uA655\uA657\uA659\uA65B\uA65D\uA65F\uA661\uA663\uA665\uA667\uA669\uA66B\uA66D\uA681\uA683\uA685\uA687\uA689\uA68B\uA68D\uA68F\uA691\uA693\uA695\uA697\uA699\uA69B\uA723\uA725\uA727\uA729\uA72B\uA72D\uA72F-\uA731\uA733\uA735\uA737\uA739\uA73B\uA73D\uA73F\uA741\uA743\uA745\uA747\uA749\uA74B\uA74D\uA74F\uA751\uA753\uA755\uA757\uA759\uA75B\uA75D\uA75F\uA761\uA763\uA765\uA767\uA769\uA76B\uA76D\uA76F\uA771-\uA778\uA77A\uA77C\uA77F\uA781\uA783\uA785\uA787\uA78C\uA78E\uA791\uA793-\uA795\uA797\uA799\uA79B\uA79D\uA79F\uA7A1\uA7A3\uA7A5\uA7A7\uA7A9\uA7AF\uA7B5\uA7B7\uA7B9\uA7FA\uAB30-\uAB5A\uAB60-\uAB65\uAB70-\uABBF\uFB00-\uFB06\uFB13-\uFB17\uFF41-\uFF5A', + 'astral': '\uD801[\uDC28-\uDC4F\uDCD8-\uDCFB]|\uD803[\uDCC0-\uDCF2]|\uD806[\uDCC0-\uDCDF]|\uD81B[\uDE60-\uDE7F]|\uD835[\uDC1A-\uDC33\uDC4E-\uDC54\uDC56-\uDC67\uDC82-\uDC9B\uDCB6-\uDCB9\uDCBB\uDCBD-\uDCC3\uDCC5-\uDCCF\uDCEA-\uDD03\uDD1E-\uDD37\uDD52-\uDD6B\uDD86-\uDD9F\uDDBA-\uDDD3\uDDEE-\uDE07\uDE22-\uDE3B\uDE56-\uDE6F\uDE8A-\uDEA5\uDEC2-\uDEDA\uDEDC-\uDEE1\uDEFC-\uDF14\uDF16-\uDF1B\uDF36-\uDF4E\uDF50-\uDF55\uDF70-\uDF88\uDF8A-\uDF8F\uDFAA-\uDFC2\uDFC4-\uDFC9\uDFCB]|\uD83A[\uDD22-\uDD43]' + }, + { + 'name': 'Lm', + 'alias': 'Modifier_Letter', + 'bmp': '\u02B0-\u02C1\u02C6-\u02D1\u02E0-\u02E4\u02EC\u02EE\u0374\u037A\u0559\u0640\u06E5\u06E6\u07F4\u07F5\u07FA\u081A\u0824\u0828\u0971\u0E46\u0EC6\u10FC\u17D7\u1843\u1AA7\u1C78-\u1C7D\u1D2C-\u1D6A\u1D78\u1D9B-\u1DBF\u2071\u207F\u2090-\u209C\u2C7C\u2C7D\u2D6F\u2E2F\u3005\u3031-\u3035\u303B\u309D\u309E\u30FC-\u30FE\uA015\uA4F8-\uA4FD\uA60C\uA67F\uA69C\uA69D\uA717-\uA71F\uA770\uA788\uA7F8\uA7F9\uA9CF\uA9E6\uAA70\uAADD\uAAF3\uAAF4\uAB5C-\uAB5F\uFF70\uFF9E\uFF9F', + 'astral': '\uD81A[\uDF40-\uDF43]|\uD81B[\uDF93-\uDF9F\uDFE0\uDFE1]' + }, + { + 'name': 'Lo', + 'alias': 'Other_Letter', + 'bmp': '\xAA\xBA\u01BB\u01C0-\u01C3\u0294\u05D0-\u05EA\u05EF-\u05F2\u0620-\u063F\u0641-\u064A\u066E\u066F\u0671-\u06D3\u06D5\u06EE\u06EF\u06FA-\u06FC\u06FF\u0710\u0712-\u072F\u074D-\u07A5\u07B1\u07CA-\u07EA\u0800-\u0815\u0840-\u0858\u0860-\u086A\u08A0-\u08B4\u08B6-\u08BD\u0904-\u0939\u093D\u0950\u0958-\u0961\u0972-\u0980\u0985-\u098C\u098F\u0990\u0993-\u09A8\u09AA-\u09B0\u09B2\u09B6-\u09B9\u09BD\u09CE\u09DC\u09DD\u09DF-\u09E1\u09F0\u09F1\u09FC\u0A05-\u0A0A\u0A0F\u0A10\u0A13-\u0A28\u0A2A-\u0A30\u0A32\u0A33\u0A35\u0A36\u0A38\u0A39\u0A59-\u0A5C\u0A5E\u0A72-\u0A74\u0A85-\u0A8D\u0A8F-\u0A91\u0A93-\u0AA8\u0AAA-\u0AB0\u0AB2\u0AB3\u0AB5-\u0AB9\u0ABD\u0AD0\u0AE0\u0AE1\u0AF9\u0B05-\u0B0C\u0B0F\u0B10\u0B13-\u0B28\u0B2A-\u0B30\u0B32\u0B33\u0B35-\u0B39\u0B3D\u0B5C\u0B5D\u0B5F-\u0B61\u0B71\u0B83\u0B85-\u0B8A\u0B8E-\u0B90\u0B92-\u0B95\u0B99\u0B9A\u0B9C\u0B9E\u0B9F\u0BA3\u0BA4\u0BA8-\u0BAA\u0BAE-\u0BB9\u0BD0\u0C05-\u0C0C\u0C0E-\u0C10\u0C12-\u0C28\u0C2A-\u0C39\u0C3D\u0C58-\u0C5A\u0C60\u0C61\u0C80\u0C85-\u0C8C\u0C8E-\u0C90\u0C92-\u0CA8\u0CAA-\u0CB3\u0CB5-\u0CB9\u0CBD\u0CDE\u0CE0\u0CE1\u0CF1\u0CF2\u0D05-\u0D0C\u0D0E-\u0D10\u0D12-\u0D3A\u0D3D\u0D4E\u0D54-\u0D56\u0D5F-\u0D61\u0D7A-\u0D7F\u0D85-\u0D96\u0D9A-\u0DB1\u0DB3-\u0DBB\u0DBD\u0DC0-\u0DC6\u0E01-\u0E30\u0E32\u0E33\u0E40-\u0E45\u0E81\u0E82\u0E84\u0E87\u0E88\u0E8A\u0E8D\u0E94-\u0E97\u0E99-\u0E9F\u0EA1-\u0EA3\u0EA5\u0EA7\u0EAA\u0EAB\u0EAD-\u0EB0\u0EB2\u0EB3\u0EBD\u0EC0-\u0EC4\u0EDC-\u0EDF\u0F00\u0F40-\u0F47\u0F49-\u0F6C\u0F88-\u0F8C\u1000-\u102A\u103F\u1050-\u1055\u105A-\u105D\u1061\u1065\u1066\u106E-\u1070\u1075-\u1081\u108E\u1100-\u1248\u124A-\u124D\u1250-\u1256\u1258\u125A-\u125D\u1260-\u1288\u128A-\u128D\u1290-\u12B0\u12B2-\u12B5\u12B8-\u12BE\u12C0\u12C2-\u12C5\u12C8-\u12D6\u12D8-\u1310\u1312-\u1315\u1318-\u135A\u1380-\u138F\u1401-\u166C\u166F-\u167F\u1681-\u169A\u16A0-\u16EA\u16F1-\u16F8\u1700-\u170C\u170E-\u1711\u1720-\u1731\u1740-\u1751\u1760-\u176C\u176E-\u1770\u1780-\u17B3\u17DC\u1820-\u1842\u1844-\u1878\u1880-\u1884\u1887-\u18A8\u18AA\u18B0-\u18F5\u1900-\u191E\u1950-\u196D\u1970-\u1974\u1980-\u19AB\u19B0-\u19C9\u1A00-\u1A16\u1A20-\u1A54\u1B05-\u1B33\u1B45-\u1B4B\u1B83-\u1BA0\u1BAE\u1BAF\u1BBA-\u1BE5\u1C00-\u1C23\u1C4D-\u1C4F\u1C5A-\u1C77\u1CE9-\u1CEC\u1CEE-\u1CF1\u1CF5\u1CF6\u2135-\u2138\u2D30-\u2D67\u2D80-\u2D96\u2DA0-\u2DA6\u2DA8-\u2DAE\u2DB0-\u2DB6\u2DB8-\u2DBE\u2DC0-\u2DC6\u2DC8-\u2DCE\u2DD0-\u2DD6\u2DD8-\u2DDE\u3006\u303C\u3041-\u3096\u309F\u30A1-\u30FA\u30FF\u3105-\u312F\u3131-\u318E\u31A0-\u31BA\u31F0-\u31FF\u3400-\u4DB5\u4E00-\u9FEF\uA000-\uA014\uA016-\uA48C\uA4D0-\uA4F7\uA500-\uA60B\uA610-\uA61F\uA62A\uA62B\uA66E\uA6A0-\uA6E5\uA78F\uA7F7\uA7FB-\uA801\uA803-\uA805\uA807-\uA80A\uA80C-\uA822\uA840-\uA873\uA882-\uA8B3\uA8F2-\uA8F7\uA8FB\uA8FD\uA8FE\uA90A-\uA925\uA930-\uA946\uA960-\uA97C\uA984-\uA9B2\uA9E0-\uA9E4\uA9E7-\uA9EF\uA9FA-\uA9FE\uAA00-\uAA28\uAA40-\uAA42\uAA44-\uAA4B\uAA60-\uAA6F\uAA71-\uAA76\uAA7A\uAA7E-\uAAAF\uAAB1\uAAB5\uAAB6\uAAB9-\uAABD\uAAC0\uAAC2\uAADB\uAADC\uAAE0-\uAAEA\uAAF2\uAB01-\uAB06\uAB09-\uAB0E\uAB11-\uAB16\uAB20-\uAB26\uAB28-\uAB2E\uABC0-\uABE2\uAC00-\uD7A3\uD7B0-\uD7C6\uD7CB-\uD7FB\uF900-\uFA6D\uFA70-\uFAD9\uFB1D\uFB1F-\uFB28\uFB2A-\uFB36\uFB38-\uFB3C\uFB3E\uFB40\uFB41\uFB43\uFB44\uFB46-\uFBB1\uFBD3-\uFD3D\uFD50-\uFD8F\uFD92-\uFDC7\uFDF0-\uFDFB\uFE70-\uFE74\uFE76-\uFEFC\uFF66-\uFF6F\uFF71-\uFF9D\uFFA0-\uFFBE\uFFC2-\uFFC7\uFFCA-\uFFCF\uFFD2-\uFFD7\uFFDA-\uFFDC', + 'astral': '\uD800[\uDC00-\uDC0B\uDC0D-\uDC26\uDC28-\uDC3A\uDC3C\uDC3D\uDC3F-\uDC4D\uDC50-\uDC5D\uDC80-\uDCFA\uDE80-\uDE9C\uDEA0-\uDED0\uDF00-\uDF1F\uDF2D-\uDF40\uDF42-\uDF49\uDF50-\uDF75\uDF80-\uDF9D\uDFA0-\uDFC3\uDFC8-\uDFCF]|\uD801[\uDC50-\uDC9D\uDD00-\uDD27\uDD30-\uDD63\uDE00-\uDF36\uDF40-\uDF55\uDF60-\uDF67]|\uD802[\uDC00-\uDC05\uDC08\uDC0A-\uDC35\uDC37\uDC38\uDC3C\uDC3F-\uDC55\uDC60-\uDC76\uDC80-\uDC9E\uDCE0-\uDCF2\uDCF4\uDCF5\uDD00-\uDD15\uDD20-\uDD39\uDD80-\uDDB7\uDDBE\uDDBF\uDE00\uDE10-\uDE13\uDE15-\uDE17\uDE19-\uDE35\uDE60-\uDE7C\uDE80-\uDE9C\uDEC0-\uDEC7\uDEC9-\uDEE4\uDF00-\uDF35\uDF40-\uDF55\uDF60-\uDF72\uDF80-\uDF91]|\uD803[\uDC00-\uDC48\uDD00-\uDD23\uDF00-\uDF1C\uDF27\uDF30-\uDF45]|\uD804[\uDC03-\uDC37\uDC83-\uDCAF\uDCD0-\uDCE8\uDD03-\uDD26\uDD44\uDD50-\uDD72\uDD76\uDD83-\uDDB2\uDDC1-\uDDC4\uDDDA\uDDDC\uDE00-\uDE11\uDE13-\uDE2B\uDE80-\uDE86\uDE88\uDE8A-\uDE8D\uDE8F-\uDE9D\uDE9F-\uDEA8\uDEB0-\uDEDE\uDF05-\uDF0C\uDF0F\uDF10\uDF13-\uDF28\uDF2A-\uDF30\uDF32\uDF33\uDF35-\uDF39\uDF3D\uDF50\uDF5D-\uDF61]|\uD805[\uDC00-\uDC34\uDC47-\uDC4A\uDC80-\uDCAF\uDCC4\uDCC5\uDCC7\uDD80-\uDDAE\uDDD8-\uDDDB\uDE00-\uDE2F\uDE44\uDE80-\uDEAA\uDF00-\uDF1A]|\uD806[\uDC00-\uDC2B\uDCFF\uDE00\uDE0B-\uDE32\uDE3A\uDE50\uDE5C-\uDE83\uDE86-\uDE89\uDE9D\uDEC0-\uDEF8]|\uD807[\uDC00-\uDC08\uDC0A-\uDC2E\uDC40\uDC72-\uDC8F\uDD00-\uDD06\uDD08\uDD09\uDD0B-\uDD30\uDD46\uDD60-\uDD65\uDD67\uDD68\uDD6A-\uDD89\uDD98\uDEE0-\uDEF2]|\uD808[\uDC00-\uDF99]|\uD809[\uDC80-\uDD43]|[\uD80C\uD81C-\uD820\uD840-\uD868\uD86A-\uD86C\uD86F-\uD872\uD874-\uD879][\uDC00-\uDFFF]|\uD80D[\uDC00-\uDC2E]|\uD811[\uDC00-\uDE46]|\uD81A[\uDC00-\uDE38\uDE40-\uDE5E\uDED0-\uDEED\uDF00-\uDF2F\uDF63-\uDF77\uDF7D-\uDF8F]|\uD81B[\uDF00-\uDF44\uDF50]|\uD821[\uDC00-\uDFF1]|\uD822[\uDC00-\uDEF2]|\uD82C[\uDC00-\uDD1E\uDD70-\uDEFB]|\uD82F[\uDC00-\uDC6A\uDC70-\uDC7C\uDC80-\uDC88\uDC90-\uDC99]|\uD83A[\uDC00-\uDCC4]|\uD83B[\uDE00-\uDE03\uDE05-\uDE1F\uDE21\uDE22\uDE24\uDE27\uDE29-\uDE32\uDE34-\uDE37\uDE39\uDE3B\uDE42\uDE47\uDE49\uDE4B\uDE4D-\uDE4F\uDE51\uDE52\uDE54\uDE57\uDE59\uDE5B\uDE5D\uDE5F\uDE61\uDE62\uDE64\uDE67-\uDE6A\uDE6C-\uDE72\uDE74-\uDE77\uDE79-\uDE7C\uDE7E\uDE80-\uDE89\uDE8B-\uDE9B\uDEA1-\uDEA3\uDEA5-\uDEA9\uDEAB-\uDEBB]|\uD869[\uDC00-\uDED6\uDF00-\uDFFF]|\uD86D[\uDC00-\uDF34\uDF40-\uDFFF]|\uD86E[\uDC00-\uDC1D\uDC20-\uDFFF]|\uD873[\uDC00-\uDEA1\uDEB0-\uDFFF]|\uD87A[\uDC00-\uDFE0]|\uD87E[\uDC00-\uDE1D]' + }, + { + 'name': 'Lt', + 'alias': 'Titlecase_Letter', + 'bmp': '\u01C5\u01C8\u01CB\u01F2\u1F88-\u1F8F\u1F98-\u1F9F\u1FA8-\u1FAF\u1FBC\u1FCC\u1FFC' + }, + { + 'name': 'Lu', + 'alias': 'Uppercase_Letter', + 'bmp': 'A-Z\xC0-\xD6\xD8-\xDE\u0100\u0102\u0104\u0106\u0108\u010A\u010C\u010E\u0110\u0112\u0114\u0116\u0118\u011A\u011C\u011E\u0120\u0122\u0124\u0126\u0128\u012A\u012C\u012E\u0130\u0132\u0134\u0136\u0139\u013B\u013D\u013F\u0141\u0143\u0145\u0147\u014A\u014C\u014E\u0150\u0152\u0154\u0156\u0158\u015A\u015C\u015E\u0160\u0162\u0164\u0166\u0168\u016A\u016C\u016E\u0170\u0172\u0174\u0176\u0178\u0179\u017B\u017D\u0181\u0182\u0184\u0186\u0187\u0189-\u018B\u018E-\u0191\u0193\u0194\u0196-\u0198\u019C\u019D\u019F\u01A0\u01A2\u01A4\u01A6\u01A7\u01A9\u01AC\u01AE\u01AF\u01B1-\u01B3\u01B5\u01B7\u01B8\u01BC\u01C4\u01C7\u01CA\u01CD\u01CF\u01D1\u01D3\u01D5\u01D7\u01D9\u01DB\u01DE\u01E0\u01E2\u01E4\u01E6\u01E8\u01EA\u01EC\u01EE\u01F1\u01F4\u01F6-\u01F8\u01FA\u01FC\u01FE\u0200\u0202\u0204\u0206\u0208\u020A\u020C\u020E\u0210\u0212\u0214\u0216\u0218\u021A\u021C\u021E\u0220\u0222\u0224\u0226\u0228\u022A\u022C\u022E\u0230\u0232\u023A\u023B\u023D\u023E\u0241\u0243-\u0246\u0248\u024A\u024C\u024E\u0370\u0372\u0376\u037F\u0386\u0388-\u038A\u038C\u038E\u038F\u0391-\u03A1\u03A3-\u03AB\u03CF\u03D2-\u03D4\u03D8\u03DA\u03DC\u03DE\u03E0\u03E2\u03E4\u03E6\u03E8\u03EA\u03EC\u03EE\u03F4\u03F7\u03F9\u03FA\u03FD-\u042F\u0460\u0462\u0464\u0466\u0468\u046A\u046C\u046E\u0470\u0472\u0474\u0476\u0478\u047A\u047C\u047E\u0480\u048A\u048C\u048E\u0490\u0492\u0494\u0496\u0498\u049A\u049C\u049E\u04A0\u04A2\u04A4\u04A6\u04A8\u04AA\u04AC\u04AE\u04B0\u04B2\u04B4\u04B6\u04B8\u04BA\u04BC\u04BE\u04C0\u04C1\u04C3\u04C5\u04C7\u04C9\u04CB\u04CD\u04D0\u04D2\u04D4\u04D6\u04D8\u04DA\u04DC\u04DE\u04E0\u04E2\u04E4\u04E6\u04E8\u04EA\u04EC\u04EE\u04F0\u04F2\u04F4\u04F6\u04F8\u04FA\u04FC\u04FE\u0500\u0502\u0504\u0506\u0508\u050A\u050C\u050E\u0510\u0512\u0514\u0516\u0518\u051A\u051C\u051E\u0520\u0522\u0524\u0526\u0528\u052A\u052C\u052E\u0531-\u0556\u10A0-\u10C5\u10C7\u10CD\u13A0-\u13F5\u1C90-\u1CBA\u1CBD-\u1CBF\u1E00\u1E02\u1E04\u1E06\u1E08\u1E0A\u1E0C\u1E0E\u1E10\u1E12\u1E14\u1E16\u1E18\u1E1A\u1E1C\u1E1E\u1E20\u1E22\u1E24\u1E26\u1E28\u1E2A\u1E2C\u1E2E\u1E30\u1E32\u1E34\u1E36\u1E38\u1E3A\u1E3C\u1E3E\u1E40\u1E42\u1E44\u1E46\u1E48\u1E4A\u1E4C\u1E4E\u1E50\u1E52\u1E54\u1E56\u1E58\u1E5A\u1E5C\u1E5E\u1E60\u1E62\u1E64\u1E66\u1E68\u1E6A\u1E6C\u1E6E\u1E70\u1E72\u1E74\u1E76\u1E78\u1E7A\u1E7C\u1E7E\u1E80\u1E82\u1E84\u1E86\u1E88\u1E8A\u1E8C\u1E8E\u1E90\u1E92\u1E94\u1E9E\u1EA0\u1EA2\u1EA4\u1EA6\u1EA8\u1EAA\u1EAC\u1EAE\u1EB0\u1EB2\u1EB4\u1EB6\u1EB8\u1EBA\u1EBC\u1EBE\u1EC0\u1EC2\u1EC4\u1EC6\u1EC8\u1ECA\u1ECC\u1ECE\u1ED0\u1ED2\u1ED4\u1ED6\u1ED8\u1EDA\u1EDC\u1EDE\u1EE0\u1EE2\u1EE4\u1EE6\u1EE8\u1EEA\u1EEC\u1EEE\u1EF0\u1EF2\u1EF4\u1EF6\u1EF8\u1EFA\u1EFC\u1EFE\u1F08-\u1F0F\u1F18-\u1F1D\u1F28-\u1F2F\u1F38-\u1F3F\u1F48-\u1F4D\u1F59\u1F5B\u1F5D\u1F5F\u1F68-\u1F6F\u1FB8-\u1FBB\u1FC8-\u1FCB\u1FD8-\u1FDB\u1FE8-\u1FEC\u1FF8-\u1FFB\u2102\u2107\u210B-\u210D\u2110-\u2112\u2115\u2119-\u211D\u2124\u2126\u2128\u212A-\u212D\u2130-\u2133\u213E\u213F\u2145\u2183\u2C00-\u2C2E\u2C60\u2C62-\u2C64\u2C67\u2C69\u2C6B\u2C6D-\u2C70\u2C72\u2C75\u2C7E-\u2C80\u2C82\u2C84\u2C86\u2C88\u2C8A\u2C8C\u2C8E\u2C90\u2C92\u2C94\u2C96\u2C98\u2C9A\u2C9C\u2C9E\u2CA0\u2CA2\u2CA4\u2CA6\u2CA8\u2CAA\u2CAC\u2CAE\u2CB0\u2CB2\u2CB4\u2CB6\u2CB8\u2CBA\u2CBC\u2CBE\u2CC0\u2CC2\u2CC4\u2CC6\u2CC8\u2CCA\u2CCC\u2CCE\u2CD0\u2CD2\u2CD4\u2CD6\u2CD8\u2CDA\u2CDC\u2CDE\u2CE0\u2CE2\u2CEB\u2CED\u2CF2\uA640\uA642\uA644\uA646\uA648\uA64A\uA64C\uA64E\uA650\uA652\uA654\uA656\uA658\uA65A\uA65C\uA65E\uA660\uA662\uA664\uA666\uA668\uA66A\uA66C\uA680\uA682\uA684\uA686\uA688\uA68A\uA68C\uA68E\uA690\uA692\uA694\uA696\uA698\uA69A\uA722\uA724\uA726\uA728\uA72A\uA72C\uA72E\uA732\uA734\uA736\uA738\uA73A\uA73C\uA73E\uA740\uA742\uA744\uA746\uA748\uA74A\uA74C\uA74E\uA750\uA752\uA754\uA756\uA758\uA75A\uA75C\uA75E\uA760\uA762\uA764\uA766\uA768\uA76A\uA76C\uA76E\uA779\uA77B\uA77D\uA77E\uA780\uA782\uA784\uA786\uA78B\uA78D\uA790\uA792\uA796\uA798\uA79A\uA79C\uA79E\uA7A0\uA7A2\uA7A4\uA7A6\uA7A8\uA7AA-\uA7AE\uA7B0-\uA7B4\uA7B6\uA7B8\uFF21-\uFF3A', + 'astral': '\uD801[\uDC00-\uDC27\uDCB0-\uDCD3]|\uD803[\uDC80-\uDCB2]|\uD806[\uDCA0-\uDCBF]|\uD81B[\uDE40-\uDE5F]|\uD835[\uDC00-\uDC19\uDC34-\uDC4D\uDC68-\uDC81\uDC9C\uDC9E\uDC9F\uDCA2\uDCA5\uDCA6\uDCA9-\uDCAC\uDCAE-\uDCB5\uDCD0-\uDCE9\uDD04\uDD05\uDD07-\uDD0A\uDD0D-\uDD14\uDD16-\uDD1C\uDD38\uDD39\uDD3B-\uDD3E\uDD40-\uDD44\uDD46\uDD4A-\uDD50\uDD6C-\uDD85\uDDA0-\uDDB9\uDDD4-\uDDED\uDE08-\uDE21\uDE3C-\uDE55\uDE70-\uDE89\uDEA8-\uDEC0\uDEE2-\uDEFA\uDF1C-\uDF34\uDF56-\uDF6E\uDF90-\uDFA8\uDFCA]|\uD83A[\uDD00-\uDD21]' + }, + { + 'name': 'M', + 'alias': 'Mark', + 'bmp': '\u0300-\u036F\u0483-\u0489\u0591-\u05BD\u05BF\u05C1\u05C2\u05C4\u05C5\u05C7\u0610-\u061A\u064B-\u065F\u0670\u06D6-\u06DC\u06DF-\u06E4\u06E7\u06E8\u06EA-\u06ED\u0711\u0730-\u074A\u07A6-\u07B0\u07EB-\u07F3\u07FD\u0816-\u0819\u081B-\u0823\u0825-\u0827\u0829-\u082D\u0859-\u085B\u08D3-\u08E1\u08E3-\u0903\u093A-\u093C\u093E-\u094F\u0951-\u0957\u0962\u0963\u0981-\u0983\u09BC\u09BE-\u09C4\u09C7\u09C8\u09CB-\u09CD\u09D7\u09E2\u09E3\u09FE\u0A01-\u0A03\u0A3C\u0A3E-\u0A42\u0A47\u0A48\u0A4B-\u0A4D\u0A51\u0A70\u0A71\u0A75\u0A81-\u0A83\u0ABC\u0ABE-\u0AC5\u0AC7-\u0AC9\u0ACB-\u0ACD\u0AE2\u0AE3\u0AFA-\u0AFF\u0B01-\u0B03\u0B3C\u0B3E-\u0B44\u0B47\u0B48\u0B4B-\u0B4D\u0B56\u0B57\u0B62\u0B63\u0B82\u0BBE-\u0BC2\u0BC6-\u0BC8\u0BCA-\u0BCD\u0BD7\u0C00-\u0C04\u0C3E-\u0C44\u0C46-\u0C48\u0C4A-\u0C4D\u0C55\u0C56\u0C62\u0C63\u0C81-\u0C83\u0CBC\u0CBE-\u0CC4\u0CC6-\u0CC8\u0CCA-\u0CCD\u0CD5\u0CD6\u0CE2\u0CE3\u0D00-\u0D03\u0D3B\u0D3C\u0D3E-\u0D44\u0D46-\u0D48\u0D4A-\u0D4D\u0D57\u0D62\u0D63\u0D82\u0D83\u0DCA\u0DCF-\u0DD4\u0DD6\u0DD8-\u0DDF\u0DF2\u0DF3\u0E31\u0E34-\u0E3A\u0E47-\u0E4E\u0EB1\u0EB4-\u0EB9\u0EBB\u0EBC\u0EC8-\u0ECD\u0F18\u0F19\u0F35\u0F37\u0F39\u0F3E\u0F3F\u0F71-\u0F84\u0F86\u0F87\u0F8D-\u0F97\u0F99-\u0FBC\u0FC6\u102B-\u103E\u1056-\u1059\u105E-\u1060\u1062-\u1064\u1067-\u106D\u1071-\u1074\u1082-\u108D\u108F\u109A-\u109D\u135D-\u135F\u1712-\u1714\u1732-\u1734\u1752\u1753\u1772\u1773\u17B4-\u17D3\u17DD\u180B-\u180D\u1885\u1886\u18A9\u1920-\u192B\u1930-\u193B\u1A17-\u1A1B\u1A55-\u1A5E\u1A60-\u1A7C\u1A7F\u1AB0-\u1ABE\u1B00-\u1B04\u1B34-\u1B44\u1B6B-\u1B73\u1B80-\u1B82\u1BA1-\u1BAD\u1BE6-\u1BF3\u1C24-\u1C37\u1CD0-\u1CD2\u1CD4-\u1CE8\u1CED\u1CF2-\u1CF4\u1CF7-\u1CF9\u1DC0-\u1DF9\u1DFB-\u1DFF\u20D0-\u20F0\u2CEF-\u2CF1\u2D7F\u2DE0-\u2DFF\u302A-\u302F\u3099\u309A\uA66F-\uA672\uA674-\uA67D\uA69E\uA69F\uA6F0\uA6F1\uA802\uA806\uA80B\uA823-\uA827\uA880\uA881\uA8B4-\uA8C5\uA8E0-\uA8F1\uA8FF\uA926-\uA92D\uA947-\uA953\uA980-\uA983\uA9B3-\uA9C0\uA9E5\uAA29-\uAA36\uAA43\uAA4C\uAA4D\uAA7B-\uAA7D\uAAB0\uAAB2-\uAAB4\uAAB7\uAAB8\uAABE\uAABF\uAAC1\uAAEB-\uAAEF\uAAF5\uAAF6\uABE3-\uABEA\uABEC\uABED\uFB1E\uFE00-\uFE0F\uFE20-\uFE2F', + 'astral': '\uD800[\uDDFD\uDEE0\uDF76-\uDF7A]|\uD802[\uDE01-\uDE03\uDE05\uDE06\uDE0C-\uDE0F\uDE38-\uDE3A\uDE3F\uDEE5\uDEE6]|\uD803[\uDD24-\uDD27\uDF46-\uDF50]|\uD804[\uDC00-\uDC02\uDC38-\uDC46\uDC7F-\uDC82\uDCB0-\uDCBA\uDD00-\uDD02\uDD27-\uDD34\uDD45\uDD46\uDD73\uDD80-\uDD82\uDDB3-\uDDC0\uDDC9-\uDDCC\uDE2C-\uDE37\uDE3E\uDEDF-\uDEEA\uDF00-\uDF03\uDF3B\uDF3C\uDF3E-\uDF44\uDF47\uDF48\uDF4B-\uDF4D\uDF57\uDF62\uDF63\uDF66-\uDF6C\uDF70-\uDF74]|\uD805[\uDC35-\uDC46\uDC5E\uDCB0-\uDCC3\uDDAF-\uDDB5\uDDB8-\uDDC0\uDDDC\uDDDD\uDE30-\uDE40\uDEAB-\uDEB7\uDF1D-\uDF2B]|\uD806[\uDC2C-\uDC3A\uDE01-\uDE0A\uDE33-\uDE39\uDE3B-\uDE3E\uDE47\uDE51-\uDE5B\uDE8A-\uDE99]|\uD807[\uDC2F-\uDC36\uDC38-\uDC3F\uDC92-\uDCA7\uDCA9-\uDCB6\uDD31-\uDD36\uDD3A\uDD3C\uDD3D\uDD3F-\uDD45\uDD47\uDD8A-\uDD8E\uDD90\uDD91\uDD93-\uDD97\uDEF3-\uDEF6]|\uD81A[\uDEF0-\uDEF4\uDF30-\uDF36]|\uD81B[\uDF51-\uDF7E\uDF8F-\uDF92]|\uD82F[\uDC9D\uDC9E]|\uD834[\uDD65-\uDD69\uDD6D-\uDD72\uDD7B-\uDD82\uDD85-\uDD8B\uDDAA-\uDDAD\uDE42-\uDE44]|\uD836[\uDE00-\uDE36\uDE3B-\uDE6C\uDE75\uDE84\uDE9B-\uDE9F\uDEA1-\uDEAF]|\uD838[\uDC00-\uDC06\uDC08-\uDC18\uDC1B-\uDC21\uDC23\uDC24\uDC26-\uDC2A]|\uD83A[\uDCD0-\uDCD6\uDD44-\uDD4A]|\uDB40[\uDD00-\uDDEF]' + }, + { + 'name': 'Mc', + 'alias': 'Spacing_Mark', + 'bmp': '\u0903\u093B\u093E-\u0940\u0949-\u094C\u094E\u094F\u0982\u0983\u09BE-\u09C0\u09C7\u09C8\u09CB\u09CC\u09D7\u0A03\u0A3E-\u0A40\u0A83\u0ABE-\u0AC0\u0AC9\u0ACB\u0ACC\u0B02\u0B03\u0B3E\u0B40\u0B47\u0B48\u0B4B\u0B4C\u0B57\u0BBE\u0BBF\u0BC1\u0BC2\u0BC6-\u0BC8\u0BCA-\u0BCC\u0BD7\u0C01-\u0C03\u0C41-\u0C44\u0C82\u0C83\u0CBE\u0CC0-\u0CC4\u0CC7\u0CC8\u0CCA\u0CCB\u0CD5\u0CD6\u0D02\u0D03\u0D3E-\u0D40\u0D46-\u0D48\u0D4A-\u0D4C\u0D57\u0D82\u0D83\u0DCF-\u0DD1\u0DD8-\u0DDF\u0DF2\u0DF3\u0F3E\u0F3F\u0F7F\u102B\u102C\u1031\u1038\u103B\u103C\u1056\u1057\u1062-\u1064\u1067-\u106D\u1083\u1084\u1087-\u108C\u108F\u109A-\u109C\u17B6\u17BE-\u17C5\u17C7\u17C8\u1923-\u1926\u1929-\u192B\u1930\u1931\u1933-\u1938\u1A19\u1A1A\u1A55\u1A57\u1A61\u1A63\u1A64\u1A6D-\u1A72\u1B04\u1B35\u1B3B\u1B3D-\u1B41\u1B43\u1B44\u1B82\u1BA1\u1BA6\u1BA7\u1BAA\u1BE7\u1BEA-\u1BEC\u1BEE\u1BF2\u1BF3\u1C24-\u1C2B\u1C34\u1C35\u1CE1\u1CF2\u1CF3\u1CF7\u302E\u302F\uA823\uA824\uA827\uA880\uA881\uA8B4-\uA8C3\uA952\uA953\uA983\uA9B4\uA9B5\uA9BA\uA9BB\uA9BD-\uA9C0\uAA2F\uAA30\uAA33\uAA34\uAA4D\uAA7B\uAA7D\uAAEB\uAAEE\uAAEF\uAAF5\uABE3\uABE4\uABE6\uABE7\uABE9\uABEA\uABEC', + 'astral': '\uD804[\uDC00\uDC02\uDC82\uDCB0-\uDCB2\uDCB7\uDCB8\uDD2C\uDD45\uDD46\uDD82\uDDB3-\uDDB5\uDDBF\uDDC0\uDE2C-\uDE2E\uDE32\uDE33\uDE35\uDEE0-\uDEE2\uDF02\uDF03\uDF3E\uDF3F\uDF41-\uDF44\uDF47\uDF48\uDF4B-\uDF4D\uDF57\uDF62\uDF63]|\uD805[\uDC35-\uDC37\uDC40\uDC41\uDC45\uDCB0-\uDCB2\uDCB9\uDCBB-\uDCBE\uDCC1\uDDAF-\uDDB1\uDDB8-\uDDBB\uDDBE\uDE30-\uDE32\uDE3B\uDE3C\uDE3E\uDEAC\uDEAE\uDEAF\uDEB6\uDF20\uDF21\uDF26]|\uD806[\uDC2C-\uDC2E\uDC38\uDE39\uDE57\uDE58\uDE97]|\uD807[\uDC2F\uDC3E\uDCA9\uDCB1\uDCB4\uDD8A-\uDD8E\uDD93\uDD94\uDD96\uDEF5\uDEF6]|\uD81B[\uDF51-\uDF7E]|\uD834[\uDD65\uDD66\uDD6D-\uDD72]' + }, + { + 'name': 'Me', + 'alias': 'Enclosing_Mark', + 'bmp': '\u0488\u0489\u1ABE\u20DD-\u20E0\u20E2-\u20E4\uA670-\uA672' + }, + { + 'name': 'Mn', + 'alias': 'Nonspacing_Mark', + 'bmp': '\u0300-\u036F\u0483-\u0487\u0591-\u05BD\u05BF\u05C1\u05C2\u05C4\u05C5\u05C7\u0610-\u061A\u064B-\u065F\u0670\u06D6-\u06DC\u06DF-\u06E4\u06E7\u06E8\u06EA-\u06ED\u0711\u0730-\u074A\u07A6-\u07B0\u07EB-\u07F3\u07FD\u0816-\u0819\u081B-\u0823\u0825-\u0827\u0829-\u082D\u0859-\u085B\u08D3-\u08E1\u08E3-\u0902\u093A\u093C\u0941-\u0948\u094D\u0951-\u0957\u0962\u0963\u0981\u09BC\u09C1-\u09C4\u09CD\u09E2\u09E3\u09FE\u0A01\u0A02\u0A3C\u0A41\u0A42\u0A47\u0A48\u0A4B-\u0A4D\u0A51\u0A70\u0A71\u0A75\u0A81\u0A82\u0ABC\u0AC1-\u0AC5\u0AC7\u0AC8\u0ACD\u0AE2\u0AE3\u0AFA-\u0AFF\u0B01\u0B3C\u0B3F\u0B41-\u0B44\u0B4D\u0B56\u0B62\u0B63\u0B82\u0BC0\u0BCD\u0C00\u0C04\u0C3E-\u0C40\u0C46-\u0C48\u0C4A-\u0C4D\u0C55\u0C56\u0C62\u0C63\u0C81\u0CBC\u0CBF\u0CC6\u0CCC\u0CCD\u0CE2\u0CE3\u0D00\u0D01\u0D3B\u0D3C\u0D41-\u0D44\u0D4D\u0D62\u0D63\u0DCA\u0DD2-\u0DD4\u0DD6\u0E31\u0E34-\u0E3A\u0E47-\u0E4E\u0EB1\u0EB4-\u0EB9\u0EBB\u0EBC\u0EC8-\u0ECD\u0F18\u0F19\u0F35\u0F37\u0F39\u0F71-\u0F7E\u0F80-\u0F84\u0F86\u0F87\u0F8D-\u0F97\u0F99-\u0FBC\u0FC6\u102D-\u1030\u1032-\u1037\u1039\u103A\u103D\u103E\u1058\u1059\u105E-\u1060\u1071-\u1074\u1082\u1085\u1086\u108D\u109D\u135D-\u135F\u1712-\u1714\u1732-\u1734\u1752\u1753\u1772\u1773\u17B4\u17B5\u17B7-\u17BD\u17C6\u17C9-\u17D3\u17DD\u180B-\u180D\u1885\u1886\u18A9\u1920-\u1922\u1927\u1928\u1932\u1939-\u193B\u1A17\u1A18\u1A1B\u1A56\u1A58-\u1A5E\u1A60\u1A62\u1A65-\u1A6C\u1A73-\u1A7C\u1A7F\u1AB0-\u1ABD\u1B00-\u1B03\u1B34\u1B36-\u1B3A\u1B3C\u1B42\u1B6B-\u1B73\u1B80\u1B81\u1BA2-\u1BA5\u1BA8\u1BA9\u1BAB-\u1BAD\u1BE6\u1BE8\u1BE9\u1BED\u1BEF-\u1BF1\u1C2C-\u1C33\u1C36\u1C37\u1CD0-\u1CD2\u1CD4-\u1CE0\u1CE2-\u1CE8\u1CED\u1CF4\u1CF8\u1CF9\u1DC0-\u1DF9\u1DFB-\u1DFF\u20D0-\u20DC\u20E1\u20E5-\u20F0\u2CEF-\u2CF1\u2D7F\u2DE0-\u2DFF\u302A-\u302D\u3099\u309A\uA66F\uA674-\uA67D\uA69E\uA69F\uA6F0\uA6F1\uA802\uA806\uA80B\uA825\uA826\uA8C4\uA8C5\uA8E0-\uA8F1\uA8FF\uA926-\uA92D\uA947-\uA951\uA980-\uA982\uA9B3\uA9B6-\uA9B9\uA9BC\uA9E5\uAA29-\uAA2E\uAA31\uAA32\uAA35\uAA36\uAA43\uAA4C\uAA7C\uAAB0\uAAB2-\uAAB4\uAAB7\uAAB8\uAABE\uAABF\uAAC1\uAAEC\uAAED\uAAF6\uABE5\uABE8\uABED\uFB1E\uFE00-\uFE0F\uFE20-\uFE2F', + 'astral': '\uD800[\uDDFD\uDEE0\uDF76-\uDF7A]|\uD802[\uDE01-\uDE03\uDE05\uDE06\uDE0C-\uDE0F\uDE38-\uDE3A\uDE3F\uDEE5\uDEE6]|\uD803[\uDD24-\uDD27\uDF46-\uDF50]|\uD804[\uDC01\uDC38-\uDC46\uDC7F-\uDC81\uDCB3-\uDCB6\uDCB9\uDCBA\uDD00-\uDD02\uDD27-\uDD2B\uDD2D-\uDD34\uDD73\uDD80\uDD81\uDDB6-\uDDBE\uDDC9-\uDDCC\uDE2F-\uDE31\uDE34\uDE36\uDE37\uDE3E\uDEDF\uDEE3-\uDEEA\uDF00\uDF01\uDF3B\uDF3C\uDF40\uDF66-\uDF6C\uDF70-\uDF74]|\uD805[\uDC38-\uDC3F\uDC42-\uDC44\uDC46\uDC5E\uDCB3-\uDCB8\uDCBA\uDCBF\uDCC0\uDCC2\uDCC3\uDDB2-\uDDB5\uDDBC\uDDBD\uDDBF\uDDC0\uDDDC\uDDDD\uDE33-\uDE3A\uDE3D\uDE3F\uDE40\uDEAB\uDEAD\uDEB0-\uDEB5\uDEB7\uDF1D-\uDF1F\uDF22-\uDF25\uDF27-\uDF2B]|\uD806[\uDC2F-\uDC37\uDC39\uDC3A\uDE01-\uDE0A\uDE33-\uDE38\uDE3B-\uDE3E\uDE47\uDE51-\uDE56\uDE59-\uDE5B\uDE8A-\uDE96\uDE98\uDE99]|\uD807[\uDC30-\uDC36\uDC38-\uDC3D\uDC3F\uDC92-\uDCA7\uDCAA-\uDCB0\uDCB2\uDCB3\uDCB5\uDCB6\uDD31-\uDD36\uDD3A\uDD3C\uDD3D\uDD3F-\uDD45\uDD47\uDD90\uDD91\uDD95\uDD97\uDEF3\uDEF4]|\uD81A[\uDEF0-\uDEF4\uDF30-\uDF36]|\uD81B[\uDF8F-\uDF92]|\uD82F[\uDC9D\uDC9E]|\uD834[\uDD67-\uDD69\uDD7B-\uDD82\uDD85-\uDD8B\uDDAA-\uDDAD\uDE42-\uDE44]|\uD836[\uDE00-\uDE36\uDE3B-\uDE6C\uDE75\uDE84\uDE9B-\uDE9F\uDEA1-\uDEAF]|\uD838[\uDC00-\uDC06\uDC08-\uDC18\uDC1B-\uDC21\uDC23\uDC24\uDC26-\uDC2A]|\uD83A[\uDCD0-\uDCD6\uDD44-\uDD4A]|\uDB40[\uDD00-\uDDEF]' + }, + { + 'name': 'N', + 'alias': 'Number', + 'bmp': '0-9\xB2\xB3\xB9\xBC-\xBE\u0660-\u0669\u06F0-\u06F9\u07C0-\u07C9\u0966-\u096F\u09E6-\u09EF\u09F4-\u09F9\u0A66-\u0A6F\u0AE6-\u0AEF\u0B66-\u0B6F\u0B72-\u0B77\u0BE6-\u0BF2\u0C66-\u0C6F\u0C78-\u0C7E\u0CE6-\u0CEF\u0D58-\u0D5E\u0D66-\u0D78\u0DE6-\u0DEF\u0E50-\u0E59\u0ED0-\u0ED9\u0F20-\u0F33\u1040-\u1049\u1090-\u1099\u1369-\u137C\u16EE-\u16F0\u17E0-\u17E9\u17F0-\u17F9\u1810-\u1819\u1946-\u194F\u19D0-\u19DA\u1A80-\u1A89\u1A90-\u1A99\u1B50-\u1B59\u1BB0-\u1BB9\u1C40-\u1C49\u1C50-\u1C59\u2070\u2074-\u2079\u2080-\u2089\u2150-\u2182\u2185-\u2189\u2460-\u249B\u24EA-\u24FF\u2776-\u2793\u2CFD\u3007\u3021-\u3029\u3038-\u303A\u3192-\u3195\u3220-\u3229\u3248-\u324F\u3251-\u325F\u3280-\u3289\u32B1-\u32BF\uA620-\uA629\uA6E6-\uA6EF\uA830-\uA835\uA8D0-\uA8D9\uA900-\uA909\uA9D0-\uA9D9\uA9F0-\uA9F9\uAA50-\uAA59\uABF0-\uABF9\uFF10-\uFF19', + 'astral': '\uD800[\uDD07-\uDD33\uDD40-\uDD78\uDD8A\uDD8B\uDEE1-\uDEFB\uDF20-\uDF23\uDF41\uDF4A\uDFD1-\uDFD5]|\uD801[\uDCA0-\uDCA9]|\uD802[\uDC58-\uDC5F\uDC79-\uDC7F\uDCA7-\uDCAF\uDCFB-\uDCFF\uDD16-\uDD1B\uDDBC\uDDBD\uDDC0-\uDDCF\uDDD2-\uDDFF\uDE40-\uDE48\uDE7D\uDE7E\uDE9D-\uDE9F\uDEEB-\uDEEF\uDF58-\uDF5F\uDF78-\uDF7F\uDFA9-\uDFAF]|\uD803[\uDCFA-\uDCFF\uDD30-\uDD39\uDE60-\uDE7E\uDF1D-\uDF26\uDF51-\uDF54]|\uD804[\uDC52-\uDC6F\uDCF0-\uDCF9\uDD36-\uDD3F\uDDD0-\uDDD9\uDDE1-\uDDF4\uDEF0-\uDEF9]|\uD805[\uDC50-\uDC59\uDCD0-\uDCD9\uDE50-\uDE59\uDEC0-\uDEC9\uDF30-\uDF3B]|\uD806[\uDCE0-\uDCF2]|\uD807[\uDC50-\uDC6C\uDD50-\uDD59\uDDA0-\uDDA9]|\uD809[\uDC00-\uDC6E]|\uD81A[\uDE60-\uDE69\uDF50-\uDF59\uDF5B-\uDF61]|\uD81B[\uDE80-\uDE96]|\uD834[\uDEE0-\uDEF3\uDF60-\uDF78]|\uD835[\uDFCE-\uDFFF]|\uD83A[\uDCC7-\uDCCF\uDD50-\uDD59]|\uD83B[\uDC71-\uDCAB\uDCAD-\uDCAF\uDCB1-\uDCB4]|\uD83C[\uDD00-\uDD0C]' + }, + { + 'name': 'Nd', + 'alias': 'Decimal_Number', + 'bmp': '0-9\u0660-\u0669\u06F0-\u06F9\u07C0-\u07C9\u0966-\u096F\u09E6-\u09EF\u0A66-\u0A6F\u0AE6-\u0AEF\u0B66-\u0B6F\u0BE6-\u0BEF\u0C66-\u0C6F\u0CE6-\u0CEF\u0D66-\u0D6F\u0DE6-\u0DEF\u0E50-\u0E59\u0ED0-\u0ED9\u0F20-\u0F29\u1040-\u1049\u1090-\u1099\u17E0-\u17E9\u1810-\u1819\u1946-\u194F\u19D0-\u19D9\u1A80-\u1A89\u1A90-\u1A99\u1B50-\u1B59\u1BB0-\u1BB9\u1C40-\u1C49\u1C50-\u1C59\uA620-\uA629\uA8D0-\uA8D9\uA900-\uA909\uA9D0-\uA9D9\uA9F0-\uA9F9\uAA50-\uAA59\uABF0-\uABF9\uFF10-\uFF19', + 'astral': '\uD801[\uDCA0-\uDCA9]|\uD803[\uDD30-\uDD39]|\uD804[\uDC66-\uDC6F\uDCF0-\uDCF9\uDD36-\uDD3F\uDDD0-\uDDD9\uDEF0-\uDEF9]|\uD805[\uDC50-\uDC59\uDCD0-\uDCD9\uDE50-\uDE59\uDEC0-\uDEC9\uDF30-\uDF39]|\uD806[\uDCE0-\uDCE9]|\uD807[\uDC50-\uDC59\uDD50-\uDD59\uDDA0-\uDDA9]|\uD81A[\uDE60-\uDE69\uDF50-\uDF59]|\uD835[\uDFCE-\uDFFF]|\uD83A[\uDD50-\uDD59]' + }, + { + 'name': 'Nl', + 'alias': 'Letter_Number', + 'bmp': '\u16EE-\u16F0\u2160-\u2182\u2185-\u2188\u3007\u3021-\u3029\u3038-\u303A\uA6E6-\uA6EF', + 'astral': '\uD800[\uDD40-\uDD74\uDF41\uDF4A\uDFD1-\uDFD5]|\uD809[\uDC00-\uDC6E]' + }, + { + 'name': 'No', + 'alias': 'Other_Number', + 'bmp': '\xB2\xB3\xB9\xBC-\xBE\u09F4-\u09F9\u0B72-\u0B77\u0BF0-\u0BF2\u0C78-\u0C7E\u0D58-\u0D5E\u0D70-\u0D78\u0F2A-\u0F33\u1369-\u137C\u17F0-\u17F9\u19DA\u2070\u2074-\u2079\u2080-\u2089\u2150-\u215F\u2189\u2460-\u249B\u24EA-\u24FF\u2776-\u2793\u2CFD\u3192-\u3195\u3220-\u3229\u3248-\u324F\u3251-\u325F\u3280-\u3289\u32B1-\u32BF\uA830-\uA835', + 'astral': '\uD800[\uDD07-\uDD33\uDD75-\uDD78\uDD8A\uDD8B\uDEE1-\uDEFB\uDF20-\uDF23]|\uD802[\uDC58-\uDC5F\uDC79-\uDC7F\uDCA7-\uDCAF\uDCFB-\uDCFF\uDD16-\uDD1B\uDDBC\uDDBD\uDDC0-\uDDCF\uDDD2-\uDDFF\uDE40-\uDE48\uDE7D\uDE7E\uDE9D-\uDE9F\uDEEB-\uDEEF\uDF58-\uDF5F\uDF78-\uDF7F\uDFA9-\uDFAF]|\uD803[\uDCFA-\uDCFF\uDE60-\uDE7E\uDF1D-\uDF26\uDF51-\uDF54]|\uD804[\uDC52-\uDC65\uDDE1-\uDDF4]|\uD805[\uDF3A\uDF3B]|\uD806[\uDCEA-\uDCF2]|\uD807[\uDC5A-\uDC6C]|\uD81A[\uDF5B-\uDF61]|\uD81B[\uDE80-\uDE96]|\uD834[\uDEE0-\uDEF3\uDF60-\uDF78]|\uD83A[\uDCC7-\uDCCF]|\uD83B[\uDC71-\uDCAB\uDCAD-\uDCAF\uDCB1-\uDCB4]|\uD83C[\uDD00-\uDD0C]' + }, + { + 'name': 'P', + 'alias': 'Punctuation', + 'bmp': '!-#%-\\*,-\\/:;\\?@\\[-\\]_\\{\\}\xA1\xA7\xAB\xB6\xB7\xBB\xBF\u037E\u0387\u055A-\u055F\u0589\u058A\u05BE\u05C0\u05C3\u05C6\u05F3\u05F4\u0609\u060A\u060C\u060D\u061B\u061E\u061F\u066A-\u066D\u06D4\u0700-\u070D\u07F7-\u07F9\u0830-\u083E\u085E\u0964\u0965\u0970\u09FD\u0A76\u0AF0\u0C84\u0DF4\u0E4F\u0E5A\u0E5B\u0F04-\u0F12\u0F14\u0F3A-\u0F3D\u0F85\u0FD0-\u0FD4\u0FD9\u0FDA\u104A-\u104F\u10FB\u1360-\u1368\u1400\u166D\u166E\u169B\u169C\u16EB-\u16ED\u1735\u1736\u17D4-\u17D6\u17D8-\u17DA\u1800-\u180A\u1944\u1945\u1A1E\u1A1F\u1AA0-\u1AA6\u1AA8-\u1AAD\u1B5A-\u1B60\u1BFC-\u1BFF\u1C3B-\u1C3F\u1C7E\u1C7F\u1CC0-\u1CC7\u1CD3\u2010-\u2027\u2030-\u2043\u2045-\u2051\u2053-\u205E\u207D\u207E\u208D\u208E\u2308-\u230B\u2329\u232A\u2768-\u2775\u27C5\u27C6\u27E6-\u27EF\u2983-\u2998\u29D8-\u29DB\u29FC\u29FD\u2CF9-\u2CFC\u2CFE\u2CFF\u2D70\u2E00-\u2E2E\u2E30-\u2E4E\u3001-\u3003\u3008-\u3011\u3014-\u301F\u3030\u303D\u30A0\u30FB\uA4FE\uA4FF\uA60D-\uA60F\uA673\uA67E\uA6F2-\uA6F7\uA874-\uA877\uA8CE\uA8CF\uA8F8-\uA8FA\uA8FC\uA92E\uA92F\uA95F\uA9C1-\uA9CD\uA9DE\uA9DF\uAA5C-\uAA5F\uAADE\uAADF\uAAF0\uAAF1\uABEB\uFD3E\uFD3F\uFE10-\uFE19\uFE30-\uFE52\uFE54-\uFE61\uFE63\uFE68\uFE6A\uFE6B\uFF01-\uFF03\uFF05-\uFF0A\uFF0C-\uFF0F\uFF1A\uFF1B\uFF1F\uFF20\uFF3B-\uFF3D\uFF3F\uFF5B\uFF5D\uFF5F-\uFF65', + 'astral': '\uD800[\uDD00-\uDD02\uDF9F\uDFD0]|\uD801\uDD6F|\uD802[\uDC57\uDD1F\uDD3F\uDE50-\uDE58\uDE7F\uDEF0-\uDEF6\uDF39-\uDF3F\uDF99-\uDF9C]|\uD803[\uDF55-\uDF59]|\uD804[\uDC47-\uDC4D\uDCBB\uDCBC\uDCBE-\uDCC1\uDD40-\uDD43\uDD74\uDD75\uDDC5-\uDDC8\uDDCD\uDDDB\uDDDD-\uDDDF\uDE38-\uDE3D\uDEA9]|\uD805[\uDC4B-\uDC4F\uDC5B\uDC5D\uDCC6\uDDC1-\uDDD7\uDE41-\uDE43\uDE60-\uDE6C\uDF3C-\uDF3E]|\uD806[\uDC3B\uDE3F-\uDE46\uDE9A-\uDE9C\uDE9E-\uDEA2]|\uD807[\uDC41-\uDC45\uDC70\uDC71\uDEF7\uDEF8]|\uD809[\uDC70-\uDC74]|\uD81A[\uDE6E\uDE6F\uDEF5\uDF37-\uDF3B\uDF44]|\uD81B[\uDE97-\uDE9A]|\uD82F\uDC9F|\uD836[\uDE87-\uDE8B]|\uD83A[\uDD5E\uDD5F]' + }, + { + 'name': 'Pc', + 'alias': 'Connector_Punctuation', + 'bmp': '_\u203F\u2040\u2054\uFE33\uFE34\uFE4D-\uFE4F\uFF3F' + }, + { + 'name': 'Pd', + 'alias': 'Dash_Punctuation', + 'bmp': '\\-\u058A\u05BE\u1400\u1806\u2010-\u2015\u2E17\u2E1A\u2E3A\u2E3B\u2E40\u301C\u3030\u30A0\uFE31\uFE32\uFE58\uFE63\uFF0D' + }, + { + 'name': 'Pe', + 'alias': 'Close_Punctuation', + 'bmp': '\\)\\]\\}\u0F3B\u0F3D\u169C\u2046\u207E\u208E\u2309\u230B\u232A\u2769\u276B\u276D\u276F\u2771\u2773\u2775\u27C6\u27E7\u27E9\u27EB\u27ED\u27EF\u2984\u2986\u2988\u298A\u298C\u298E\u2990\u2992\u2994\u2996\u2998\u29D9\u29DB\u29FD\u2E23\u2E25\u2E27\u2E29\u3009\u300B\u300D\u300F\u3011\u3015\u3017\u3019\u301B\u301E\u301F\uFD3E\uFE18\uFE36\uFE38\uFE3A\uFE3C\uFE3E\uFE40\uFE42\uFE44\uFE48\uFE5A\uFE5C\uFE5E\uFF09\uFF3D\uFF5D\uFF60\uFF63' + }, + { + 'name': 'Pf', + 'alias': 'Final_Punctuation', + 'bmp': '\xBB\u2019\u201D\u203A\u2E03\u2E05\u2E0A\u2E0D\u2E1D\u2E21' + }, + { + 'name': 'Pi', + 'alias': 'Initial_Punctuation', + 'bmp': '\xAB\u2018\u201B\u201C\u201F\u2039\u2E02\u2E04\u2E09\u2E0C\u2E1C\u2E20' + }, + { + 'name': 'Po', + 'alias': 'Other_Punctuation', + 'bmp': '!-#%-\'\\*,\\.\\/:;\\?@\\\xA1\xA7\xB6\xB7\xBF\u037E\u0387\u055A-\u055F\u0589\u05C0\u05C3\u05C6\u05F3\u05F4\u0609\u060A\u060C\u060D\u061B\u061E\u061F\u066A-\u066D\u06D4\u0700-\u070D\u07F7-\u07F9\u0830-\u083E\u085E\u0964\u0965\u0970\u09FD\u0A76\u0AF0\u0C84\u0DF4\u0E4F\u0E5A\u0E5B\u0F04-\u0F12\u0F14\u0F85\u0FD0-\u0FD4\u0FD9\u0FDA\u104A-\u104F\u10FB\u1360-\u1368\u166D\u166E\u16EB-\u16ED\u1735\u1736\u17D4-\u17D6\u17D8-\u17DA\u1800-\u1805\u1807-\u180A\u1944\u1945\u1A1E\u1A1F\u1AA0-\u1AA6\u1AA8-\u1AAD\u1B5A-\u1B60\u1BFC-\u1BFF\u1C3B-\u1C3F\u1C7E\u1C7F\u1CC0-\u1CC7\u1CD3\u2016\u2017\u2020-\u2027\u2030-\u2038\u203B-\u203E\u2041-\u2043\u2047-\u2051\u2053\u2055-\u205E\u2CF9-\u2CFC\u2CFE\u2CFF\u2D70\u2E00\u2E01\u2E06-\u2E08\u2E0B\u2E0E-\u2E16\u2E18\u2E19\u2E1B\u2E1E\u2E1F\u2E2A-\u2E2E\u2E30-\u2E39\u2E3C-\u2E3F\u2E41\u2E43-\u2E4E\u3001-\u3003\u303D\u30FB\uA4FE\uA4FF\uA60D-\uA60F\uA673\uA67E\uA6F2-\uA6F7\uA874-\uA877\uA8CE\uA8CF\uA8F8-\uA8FA\uA8FC\uA92E\uA92F\uA95F\uA9C1-\uA9CD\uA9DE\uA9DF\uAA5C-\uAA5F\uAADE\uAADF\uAAF0\uAAF1\uABEB\uFE10-\uFE16\uFE19\uFE30\uFE45\uFE46\uFE49-\uFE4C\uFE50-\uFE52\uFE54-\uFE57\uFE5F-\uFE61\uFE68\uFE6A\uFE6B\uFF01-\uFF03\uFF05-\uFF07\uFF0A\uFF0C\uFF0E\uFF0F\uFF1A\uFF1B\uFF1F\uFF20\uFF3C\uFF61\uFF64\uFF65', + 'astral': '\uD800[\uDD00-\uDD02\uDF9F\uDFD0]|\uD801\uDD6F|\uD802[\uDC57\uDD1F\uDD3F\uDE50-\uDE58\uDE7F\uDEF0-\uDEF6\uDF39-\uDF3F\uDF99-\uDF9C]|\uD803[\uDF55-\uDF59]|\uD804[\uDC47-\uDC4D\uDCBB\uDCBC\uDCBE-\uDCC1\uDD40-\uDD43\uDD74\uDD75\uDDC5-\uDDC8\uDDCD\uDDDB\uDDDD-\uDDDF\uDE38-\uDE3D\uDEA9]|\uD805[\uDC4B-\uDC4F\uDC5B\uDC5D\uDCC6\uDDC1-\uDDD7\uDE41-\uDE43\uDE60-\uDE6C\uDF3C-\uDF3E]|\uD806[\uDC3B\uDE3F-\uDE46\uDE9A-\uDE9C\uDE9E-\uDEA2]|\uD807[\uDC41-\uDC45\uDC70\uDC71\uDEF7\uDEF8]|\uD809[\uDC70-\uDC74]|\uD81A[\uDE6E\uDE6F\uDEF5\uDF37-\uDF3B\uDF44]|\uD81B[\uDE97-\uDE9A]|\uD82F\uDC9F|\uD836[\uDE87-\uDE8B]|\uD83A[\uDD5E\uDD5F]' + }, + { + 'name': 'Ps', + 'alias': 'Open_Punctuation', + 'bmp': '\\(\\[\\{\u0F3A\u0F3C\u169B\u201A\u201E\u2045\u207D\u208D\u2308\u230A\u2329\u2768\u276A\u276C\u276E\u2770\u2772\u2774\u27C5\u27E6\u27E8\u27EA\u27EC\u27EE\u2983\u2985\u2987\u2989\u298B\u298D\u298F\u2991\u2993\u2995\u2997\u29D8\u29DA\u29FC\u2E22\u2E24\u2E26\u2E28\u2E42\u3008\u300A\u300C\u300E\u3010\u3014\u3016\u3018\u301A\u301D\uFD3F\uFE17\uFE35\uFE37\uFE39\uFE3B\uFE3D\uFE3F\uFE41\uFE43\uFE47\uFE59\uFE5B\uFE5D\uFF08\uFF3B\uFF5B\uFF5F\uFF62' + }, + { + 'name': 'S', + 'alias': 'Symbol', + 'bmp': '\\$\\+<->\\^`\\|~\xA2-\xA6\xA8\xA9\xAC\xAE-\xB1\xB4\xB8\xD7\xF7\u02C2-\u02C5\u02D2-\u02DF\u02E5-\u02EB\u02ED\u02EF-\u02FF\u0375\u0384\u0385\u03F6\u0482\u058D-\u058F\u0606-\u0608\u060B\u060E\u060F\u06DE\u06E9\u06FD\u06FE\u07F6\u07FE\u07FF\u09F2\u09F3\u09FA\u09FB\u0AF1\u0B70\u0BF3-\u0BFA\u0C7F\u0D4F\u0D79\u0E3F\u0F01-\u0F03\u0F13\u0F15-\u0F17\u0F1A-\u0F1F\u0F34\u0F36\u0F38\u0FBE-\u0FC5\u0FC7-\u0FCC\u0FCE\u0FCF\u0FD5-\u0FD8\u109E\u109F\u1390-\u1399\u17DB\u1940\u19DE-\u19FF\u1B61-\u1B6A\u1B74-\u1B7C\u1FBD\u1FBF-\u1FC1\u1FCD-\u1FCF\u1FDD-\u1FDF\u1FED-\u1FEF\u1FFD\u1FFE\u2044\u2052\u207A-\u207C\u208A-\u208C\u20A0-\u20BF\u2100\u2101\u2103-\u2106\u2108\u2109\u2114\u2116-\u2118\u211E-\u2123\u2125\u2127\u2129\u212E\u213A\u213B\u2140-\u2144\u214A-\u214D\u214F\u218A\u218B\u2190-\u2307\u230C-\u2328\u232B-\u2426\u2440-\u244A\u249C-\u24E9\u2500-\u2767\u2794-\u27C4\u27C7-\u27E5\u27F0-\u2982\u2999-\u29D7\u29DC-\u29FB\u29FE-\u2B73\u2B76-\u2B95\u2B98-\u2BC8\u2BCA-\u2BFE\u2CE5-\u2CEA\u2E80-\u2E99\u2E9B-\u2EF3\u2F00-\u2FD5\u2FF0-\u2FFB\u3004\u3012\u3013\u3020\u3036\u3037\u303E\u303F\u309B\u309C\u3190\u3191\u3196-\u319F\u31C0-\u31E3\u3200-\u321E\u322A-\u3247\u3250\u3260-\u327F\u328A-\u32B0\u32C0-\u32FE\u3300-\u33FF\u4DC0-\u4DFF\uA490-\uA4C6\uA700-\uA716\uA720\uA721\uA789\uA78A\uA828-\uA82B\uA836-\uA839\uAA77-\uAA79\uAB5B\uFB29\uFBB2-\uFBC1\uFDFC\uFDFD\uFE62\uFE64-\uFE66\uFE69\uFF04\uFF0B\uFF1C-\uFF1E\uFF3E\uFF40\uFF5C\uFF5E\uFFE0-\uFFE6\uFFE8-\uFFEE\uFFFC\uFFFD', + 'astral': '\uD800[\uDD37-\uDD3F\uDD79-\uDD89\uDD8C-\uDD8E\uDD90-\uDD9B\uDDA0\uDDD0-\uDDFC]|\uD802[\uDC77\uDC78\uDEC8]|\uD805\uDF3F|\uD81A[\uDF3C-\uDF3F\uDF45]|\uD82F\uDC9C|\uD834[\uDC00-\uDCF5\uDD00-\uDD26\uDD29-\uDD64\uDD6A-\uDD6C\uDD83\uDD84\uDD8C-\uDDA9\uDDAE-\uDDE8\uDE00-\uDE41\uDE45\uDF00-\uDF56]|\uD835[\uDEC1\uDEDB\uDEFB\uDF15\uDF35\uDF4F\uDF6F\uDF89\uDFA9\uDFC3]|\uD836[\uDC00-\uDDFF\uDE37-\uDE3A\uDE6D-\uDE74\uDE76-\uDE83\uDE85\uDE86]|\uD83B[\uDCAC\uDCB0\uDEF0\uDEF1]|\uD83C[\uDC00-\uDC2B\uDC30-\uDC93\uDCA0-\uDCAE\uDCB1-\uDCBF\uDCC1-\uDCCF\uDCD1-\uDCF5\uDD10-\uDD6B\uDD70-\uDDAC\uDDE6-\uDE02\uDE10-\uDE3B\uDE40-\uDE48\uDE50\uDE51\uDE60-\uDE65\uDF00-\uDFFF]|\uD83D[\uDC00-\uDED4\uDEE0-\uDEEC\uDEF0-\uDEF9\uDF00-\uDF73\uDF80-\uDFD8]|\uD83E[\uDC00-\uDC0B\uDC10-\uDC47\uDC50-\uDC59\uDC60-\uDC87\uDC90-\uDCAD\uDD00-\uDD0B\uDD10-\uDD3E\uDD40-\uDD70\uDD73-\uDD76\uDD7A\uDD7C-\uDDA2\uDDB0-\uDDB9\uDDC0-\uDDC2\uDDD0-\uDDFF\uDE60-\uDE6D]' + }, + { + 'name': 'Sc', + 'alias': 'Currency_Symbol', + 'bmp': '\\$\xA2-\xA5\u058F\u060B\u07FE\u07FF\u09F2\u09F3\u09FB\u0AF1\u0BF9\u0E3F\u17DB\u20A0-\u20BF\uA838\uFDFC\uFE69\uFF04\uFFE0\uFFE1\uFFE5\uFFE6', + 'astral': '\uD83B\uDCB0' + }, + { + 'name': 'Sk', + 'alias': 'Modifier_Symbol', + 'bmp': '\\^`\xA8\xAF\xB4\xB8\u02C2-\u02C5\u02D2-\u02DF\u02E5-\u02EB\u02ED\u02EF-\u02FF\u0375\u0384\u0385\u1FBD\u1FBF-\u1FC1\u1FCD-\u1FCF\u1FDD-\u1FDF\u1FED-\u1FEF\u1FFD\u1FFE\u309B\u309C\uA700-\uA716\uA720\uA721\uA789\uA78A\uAB5B\uFBB2-\uFBC1\uFF3E\uFF40\uFFE3', + 'astral': '\uD83C[\uDFFB-\uDFFF]' + }, + { + 'name': 'Sm', + 'alias': 'Math_Symbol', + 'bmp': '\\+<->\\|~\xAC\xB1\xD7\xF7\u03F6\u0606-\u0608\u2044\u2052\u207A-\u207C\u208A-\u208C\u2118\u2140-\u2144\u214B\u2190-\u2194\u219A\u219B\u21A0\u21A3\u21A6\u21AE\u21CE\u21CF\u21D2\u21D4\u21F4-\u22FF\u2320\u2321\u237C\u239B-\u23B3\u23DC-\u23E1\u25B7\u25C1\u25F8-\u25FF\u266F\u27C0-\u27C4\u27C7-\u27E5\u27F0-\u27FF\u2900-\u2982\u2999-\u29D7\u29DC-\u29FB\u29FE-\u2AFF\u2B30-\u2B44\u2B47-\u2B4C\uFB29\uFE62\uFE64-\uFE66\uFF0B\uFF1C-\uFF1E\uFF5C\uFF5E\uFFE2\uFFE9-\uFFEC', + 'astral': '\uD835[\uDEC1\uDEDB\uDEFB\uDF15\uDF35\uDF4F\uDF6F\uDF89\uDFA9\uDFC3]|\uD83B[\uDEF0\uDEF1]' + }, + { + 'name': 'So', + 'alias': 'Other_Symbol', + 'bmp': '\xA6\xA9\xAE\xB0\u0482\u058D\u058E\u060E\u060F\u06DE\u06E9\u06FD\u06FE\u07F6\u09FA\u0B70\u0BF3-\u0BF8\u0BFA\u0C7F\u0D4F\u0D79\u0F01-\u0F03\u0F13\u0F15-\u0F17\u0F1A-\u0F1F\u0F34\u0F36\u0F38\u0FBE-\u0FC5\u0FC7-\u0FCC\u0FCE\u0FCF\u0FD5-\u0FD8\u109E\u109F\u1390-\u1399\u1940\u19DE-\u19FF\u1B61-\u1B6A\u1B74-\u1B7C\u2100\u2101\u2103-\u2106\u2108\u2109\u2114\u2116\u2117\u211E-\u2123\u2125\u2127\u2129\u212E\u213A\u213B\u214A\u214C\u214D\u214F\u218A\u218B\u2195-\u2199\u219C-\u219F\u21A1\u21A2\u21A4\u21A5\u21A7-\u21AD\u21AF-\u21CD\u21D0\u21D1\u21D3\u21D5-\u21F3\u2300-\u2307\u230C-\u231F\u2322-\u2328\u232B-\u237B\u237D-\u239A\u23B4-\u23DB\u23E2-\u2426\u2440-\u244A\u249C-\u24E9\u2500-\u25B6\u25B8-\u25C0\u25C2-\u25F7\u2600-\u266E\u2670-\u2767\u2794-\u27BF\u2800-\u28FF\u2B00-\u2B2F\u2B45\u2B46\u2B4D-\u2B73\u2B76-\u2B95\u2B98-\u2BC8\u2BCA-\u2BFE\u2CE5-\u2CEA\u2E80-\u2E99\u2E9B-\u2EF3\u2F00-\u2FD5\u2FF0-\u2FFB\u3004\u3012\u3013\u3020\u3036\u3037\u303E\u303F\u3190\u3191\u3196-\u319F\u31C0-\u31E3\u3200-\u321E\u322A-\u3247\u3250\u3260-\u327F\u328A-\u32B0\u32C0-\u32FE\u3300-\u33FF\u4DC0-\u4DFF\uA490-\uA4C6\uA828-\uA82B\uA836\uA837\uA839\uAA77-\uAA79\uFDFD\uFFE4\uFFE8\uFFED\uFFEE\uFFFC\uFFFD', + 'astral': '\uD800[\uDD37-\uDD3F\uDD79-\uDD89\uDD8C-\uDD8E\uDD90-\uDD9B\uDDA0\uDDD0-\uDDFC]|\uD802[\uDC77\uDC78\uDEC8]|\uD805\uDF3F|\uD81A[\uDF3C-\uDF3F\uDF45]|\uD82F\uDC9C|\uD834[\uDC00-\uDCF5\uDD00-\uDD26\uDD29-\uDD64\uDD6A-\uDD6C\uDD83\uDD84\uDD8C-\uDDA9\uDDAE-\uDDE8\uDE00-\uDE41\uDE45\uDF00-\uDF56]|\uD836[\uDC00-\uDDFF\uDE37-\uDE3A\uDE6D-\uDE74\uDE76-\uDE83\uDE85\uDE86]|\uD83B\uDCAC|\uD83C[\uDC00-\uDC2B\uDC30-\uDC93\uDCA0-\uDCAE\uDCB1-\uDCBF\uDCC1-\uDCCF\uDCD1-\uDCF5\uDD10-\uDD6B\uDD70-\uDDAC\uDDE6-\uDE02\uDE10-\uDE3B\uDE40-\uDE48\uDE50\uDE51\uDE60-\uDE65\uDF00-\uDFFA]|\uD83D[\uDC00-\uDED4\uDEE0-\uDEEC\uDEF0-\uDEF9\uDF00-\uDF73\uDF80-\uDFD8]|\uD83E[\uDC00-\uDC0B\uDC10-\uDC47\uDC50-\uDC59\uDC60-\uDC87\uDC90-\uDCAD\uDD00-\uDD0B\uDD10-\uDD3E\uDD40-\uDD70\uDD73-\uDD76\uDD7A\uDD7C-\uDDA2\uDDB0-\uDDB9\uDDC0-\uDDC2\uDDD0-\uDDFF\uDE60-\uDE6D]' + }, + { + 'name': 'Z', + 'alias': 'Separator', + 'bmp': ' \xA0\u1680\u2000-\u200A\u2028\u2029\u202F\u205F\u3000' + }, + { + 'name': 'Zl', + 'alias': 'Line_Separator', + 'bmp': '\u2028' + }, + { + 'name': 'Zp', + 'alias': 'Paragraph_Separator', + 'bmp': '\u2029' + }, + { + 'name': 'Zs', + 'alias': 'Space_Separator', + 'bmp': ' \xA0\u1680\u2000-\u200A\u202F\u205F\u3000' + } +]; + +var unicodeCategories = createCommonjsModule(function (module, exports) { +"use strict"; + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.default = void 0; + +var _categories = _interopRequireDefault(categories); + +function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } + +/*! + * XRegExp Unicode Categories 4.2.0 + * + * Steven Levithan (c) 2010-present MIT License + * Unicode data by Mathias Bynens + */ +var _default = function _default(XRegExp) { + /** + * Adds support for Unicode's general categories. E.g., `\p{Lu}` or `\p{Uppercase Letter}`. See + * category descriptions in UAX #44 . Token + * names are case insensitive, and any spaces, hyphens, and underscores are ignored. + * + * Uses Unicode 11.0.0. + * + * @requires XRegExp, Unicode Base + */ + if (!XRegExp.addUnicodeData) { + throw new ReferenceError('Unicode Base must be loaded before Unicode Categories'); + } + + XRegExp.addUnicodeData(_categories.default); +}; + +exports.default = _default; +module.exports = exports["default"]; +}); + +unwrapExports(unicodeCategories); + +var properties = [ + { + 'name': 'ASCII', + 'bmp': '\0-\x7F' + }, + { + 'name': 'Alphabetic', + 'bmp': 'A-Za-z\xAA\xB5\xBA\xC0-\xD6\xD8-\xF6\xF8-\u02C1\u02C6-\u02D1\u02E0-\u02E4\u02EC\u02EE\u0345\u0370-\u0374\u0376\u0377\u037A-\u037D\u037F\u0386\u0388-\u038A\u038C\u038E-\u03A1\u03A3-\u03F5\u03F7-\u0481\u048A-\u052F\u0531-\u0556\u0559\u0560-\u0588\u05B0-\u05BD\u05BF\u05C1\u05C2\u05C4\u05C5\u05C7\u05D0-\u05EA\u05EF-\u05F2\u0610-\u061A\u0620-\u0657\u0659-\u065F\u066E-\u06D3\u06D5-\u06DC\u06E1-\u06E8\u06ED-\u06EF\u06FA-\u06FC\u06FF\u0710-\u073F\u074D-\u07B1\u07CA-\u07EA\u07F4\u07F5\u07FA\u0800-\u0817\u081A-\u082C\u0840-\u0858\u0860-\u086A\u08A0-\u08B4\u08B6-\u08BD\u08D4-\u08DF\u08E3-\u08E9\u08F0-\u093B\u093D-\u094C\u094E-\u0950\u0955-\u0963\u0971-\u0983\u0985-\u098C\u098F\u0990\u0993-\u09A8\u09AA-\u09B0\u09B2\u09B6-\u09B9\u09BD-\u09C4\u09C7\u09C8\u09CB\u09CC\u09CE\u09D7\u09DC\u09DD\u09DF-\u09E3\u09F0\u09F1\u09FC\u0A01-\u0A03\u0A05-\u0A0A\u0A0F\u0A10\u0A13-\u0A28\u0A2A-\u0A30\u0A32\u0A33\u0A35\u0A36\u0A38\u0A39\u0A3E-\u0A42\u0A47\u0A48\u0A4B\u0A4C\u0A51\u0A59-\u0A5C\u0A5E\u0A70-\u0A75\u0A81-\u0A83\u0A85-\u0A8D\u0A8F-\u0A91\u0A93-\u0AA8\u0AAA-\u0AB0\u0AB2\u0AB3\u0AB5-\u0AB9\u0ABD-\u0AC5\u0AC7-\u0AC9\u0ACB\u0ACC\u0AD0\u0AE0-\u0AE3\u0AF9-\u0AFC\u0B01-\u0B03\u0B05-\u0B0C\u0B0F\u0B10\u0B13-\u0B28\u0B2A-\u0B30\u0B32\u0B33\u0B35-\u0B39\u0B3D-\u0B44\u0B47\u0B48\u0B4B\u0B4C\u0B56\u0B57\u0B5C\u0B5D\u0B5F-\u0B63\u0B71\u0B82\u0B83\u0B85-\u0B8A\u0B8E-\u0B90\u0B92-\u0B95\u0B99\u0B9A\u0B9C\u0B9E\u0B9F\u0BA3\u0BA4\u0BA8-\u0BAA\u0BAE-\u0BB9\u0BBE-\u0BC2\u0BC6-\u0BC8\u0BCA-\u0BCC\u0BD0\u0BD7\u0C00-\u0C03\u0C05-\u0C0C\u0C0E-\u0C10\u0C12-\u0C28\u0C2A-\u0C39\u0C3D-\u0C44\u0C46-\u0C48\u0C4A-\u0C4C\u0C55\u0C56\u0C58-\u0C5A\u0C60-\u0C63\u0C80-\u0C83\u0C85-\u0C8C\u0C8E-\u0C90\u0C92-\u0CA8\u0CAA-\u0CB3\u0CB5-\u0CB9\u0CBD-\u0CC4\u0CC6-\u0CC8\u0CCA-\u0CCC\u0CD5\u0CD6\u0CDE\u0CE0-\u0CE3\u0CF1\u0CF2\u0D00-\u0D03\u0D05-\u0D0C\u0D0E-\u0D10\u0D12-\u0D3A\u0D3D-\u0D44\u0D46-\u0D48\u0D4A-\u0D4C\u0D4E\u0D54-\u0D57\u0D5F-\u0D63\u0D7A-\u0D7F\u0D82\u0D83\u0D85-\u0D96\u0D9A-\u0DB1\u0DB3-\u0DBB\u0DBD\u0DC0-\u0DC6\u0DCF-\u0DD4\u0DD6\u0DD8-\u0DDF\u0DF2\u0DF3\u0E01-\u0E3A\u0E40-\u0E46\u0E4D\u0E81\u0E82\u0E84\u0E87\u0E88\u0E8A\u0E8D\u0E94-\u0E97\u0E99-\u0E9F\u0EA1-\u0EA3\u0EA5\u0EA7\u0EAA\u0EAB\u0EAD-\u0EB9\u0EBB-\u0EBD\u0EC0-\u0EC4\u0EC6\u0ECD\u0EDC-\u0EDF\u0F00\u0F40-\u0F47\u0F49-\u0F6C\u0F71-\u0F81\u0F88-\u0F97\u0F99-\u0FBC\u1000-\u1036\u1038\u103B-\u103F\u1050-\u1062\u1065-\u1068\u106E-\u1086\u108E\u109C\u109D\u10A0-\u10C5\u10C7\u10CD\u10D0-\u10FA\u10FC-\u1248\u124A-\u124D\u1250-\u1256\u1258\u125A-\u125D\u1260-\u1288\u128A-\u128D\u1290-\u12B0\u12B2-\u12B5\u12B8-\u12BE\u12C0\u12C2-\u12C5\u12C8-\u12D6\u12D8-\u1310\u1312-\u1315\u1318-\u135A\u135F\u1380-\u138F\u13A0-\u13F5\u13F8-\u13FD\u1401-\u166C\u166F-\u167F\u1681-\u169A\u16A0-\u16EA\u16EE-\u16F8\u1700-\u170C\u170E-\u1713\u1720-\u1733\u1740-\u1753\u1760-\u176C\u176E-\u1770\u1772\u1773\u1780-\u17B3\u17B6-\u17C8\u17D7\u17DC\u1820-\u1878\u1880-\u18AA\u18B0-\u18F5\u1900-\u191E\u1920-\u192B\u1930-\u1938\u1950-\u196D\u1970-\u1974\u1980-\u19AB\u19B0-\u19C9\u1A00-\u1A1B\u1A20-\u1A5E\u1A61-\u1A74\u1AA7\u1B00-\u1B33\u1B35-\u1B43\u1B45-\u1B4B\u1B80-\u1BA9\u1BAC-\u1BAF\u1BBA-\u1BE5\u1BE7-\u1BF1\u1C00-\u1C35\u1C4D-\u1C4F\u1C5A-\u1C7D\u1C80-\u1C88\u1C90-\u1CBA\u1CBD-\u1CBF\u1CE9-\u1CEC\u1CEE-\u1CF3\u1CF5\u1CF6\u1D00-\u1DBF\u1DE7-\u1DF4\u1E00-\u1F15\u1F18-\u1F1D\u1F20-\u1F45\u1F48-\u1F4D\u1F50-\u1F57\u1F59\u1F5B\u1F5D\u1F5F-\u1F7D\u1F80-\u1FB4\u1FB6-\u1FBC\u1FBE\u1FC2-\u1FC4\u1FC6-\u1FCC\u1FD0-\u1FD3\u1FD6-\u1FDB\u1FE0-\u1FEC\u1FF2-\u1FF4\u1FF6-\u1FFC\u2071\u207F\u2090-\u209C\u2102\u2107\u210A-\u2113\u2115\u2119-\u211D\u2124\u2126\u2128\u212A-\u212D\u212F-\u2139\u213C-\u213F\u2145-\u2149\u214E\u2160-\u2188\u24B6-\u24E9\u2C00-\u2C2E\u2C30-\u2C5E\u2C60-\u2CE4\u2CEB-\u2CEE\u2CF2\u2CF3\u2D00-\u2D25\u2D27\u2D2D\u2D30-\u2D67\u2D6F\u2D80-\u2D96\u2DA0-\u2DA6\u2DA8-\u2DAE\u2DB0-\u2DB6\u2DB8-\u2DBE\u2DC0-\u2DC6\u2DC8-\u2DCE\u2DD0-\u2DD6\u2DD8-\u2DDE\u2DE0-\u2DFF\u2E2F\u3005-\u3007\u3021-\u3029\u3031-\u3035\u3038-\u303C\u3041-\u3096\u309D-\u309F\u30A1-\u30FA\u30FC-\u30FF\u3105-\u312F\u3131-\u318E\u31A0-\u31BA\u31F0-\u31FF\u3400-\u4DB5\u4E00-\u9FEF\uA000-\uA48C\uA4D0-\uA4FD\uA500-\uA60C\uA610-\uA61F\uA62A\uA62B\uA640-\uA66E\uA674-\uA67B\uA67F-\uA6EF\uA717-\uA71F\uA722-\uA788\uA78B-\uA7B9\uA7F7-\uA801\uA803-\uA805\uA807-\uA80A\uA80C-\uA827\uA840-\uA873\uA880-\uA8C3\uA8C5\uA8F2-\uA8F7\uA8FB\uA8FD\uA8FE\uA90A-\uA92A\uA930-\uA952\uA960-\uA97C\uA980-\uA9B2\uA9B4-\uA9BF\uA9CF\uA9E0-\uA9E4\uA9E6-\uA9EF\uA9FA-\uA9FE\uAA00-\uAA36\uAA40-\uAA4D\uAA60-\uAA76\uAA7A\uAA7E-\uAABE\uAAC0\uAAC2\uAADB-\uAADD\uAAE0-\uAAEF\uAAF2-\uAAF5\uAB01-\uAB06\uAB09-\uAB0E\uAB11-\uAB16\uAB20-\uAB26\uAB28-\uAB2E\uAB30-\uAB5A\uAB5C-\uAB65\uAB70-\uABEA\uAC00-\uD7A3\uD7B0-\uD7C6\uD7CB-\uD7FB\uF900-\uFA6D\uFA70-\uFAD9\uFB00-\uFB06\uFB13-\uFB17\uFB1D-\uFB28\uFB2A-\uFB36\uFB38-\uFB3C\uFB3E\uFB40\uFB41\uFB43\uFB44\uFB46-\uFBB1\uFBD3-\uFD3D\uFD50-\uFD8F\uFD92-\uFDC7\uFDF0-\uFDFB\uFE70-\uFE74\uFE76-\uFEFC\uFF21-\uFF3A\uFF41-\uFF5A\uFF66-\uFFBE\uFFC2-\uFFC7\uFFCA-\uFFCF\uFFD2-\uFFD7\uFFDA-\uFFDC', + 'astral': '\uD800[\uDC00-\uDC0B\uDC0D-\uDC26\uDC28-\uDC3A\uDC3C\uDC3D\uDC3F-\uDC4D\uDC50-\uDC5D\uDC80-\uDCFA\uDD40-\uDD74\uDE80-\uDE9C\uDEA0-\uDED0\uDF00-\uDF1F\uDF2D-\uDF4A\uDF50-\uDF7A\uDF80-\uDF9D\uDFA0-\uDFC3\uDFC8-\uDFCF\uDFD1-\uDFD5]|\uD801[\uDC00-\uDC9D\uDCB0-\uDCD3\uDCD8-\uDCFB\uDD00-\uDD27\uDD30-\uDD63\uDE00-\uDF36\uDF40-\uDF55\uDF60-\uDF67]|\uD802[\uDC00-\uDC05\uDC08\uDC0A-\uDC35\uDC37\uDC38\uDC3C\uDC3F-\uDC55\uDC60-\uDC76\uDC80-\uDC9E\uDCE0-\uDCF2\uDCF4\uDCF5\uDD00-\uDD15\uDD20-\uDD39\uDD80-\uDDB7\uDDBE\uDDBF\uDE00-\uDE03\uDE05\uDE06\uDE0C-\uDE13\uDE15-\uDE17\uDE19-\uDE35\uDE60-\uDE7C\uDE80-\uDE9C\uDEC0-\uDEC7\uDEC9-\uDEE4\uDF00-\uDF35\uDF40-\uDF55\uDF60-\uDF72\uDF80-\uDF91]|\uD803[\uDC00-\uDC48\uDC80-\uDCB2\uDCC0-\uDCF2\uDD00-\uDD27\uDF00-\uDF1C\uDF27\uDF30-\uDF45]|\uD804[\uDC00-\uDC45\uDC82-\uDCB8\uDCD0-\uDCE8\uDD00-\uDD32\uDD44-\uDD46\uDD50-\uDD72\uDD76\uDD80-\uDDBF\uDDC1-\uDDC4\uDDDA\uDDDC\uDE00-\uDE11\uDE13-\uDE34\uDE37\uDE3E\uDE80-\uDE86\uDE88\uDE8A-\uDE8D\uDE8F-\uDE9D\uDE9F-\uDEA8\uDEB0-\uDEE8\uDF00-\uDF03\uDF05-\uDF0C\uDF0F\uDF10\uDF13-\uDF28\uDF2A-\uDF30\uDF32\uDF33\uDF35-\uDF39\uDF3D-\uDF44\uDF47\uDF48\uDF4B\uDF4C\uDF50\uDF57\uDF5D-\uDF63]|\uD805[\uDC00-\uDC41\uDC43-\uDC45\uDC47-\uDC4A\uDC80-\uDCC1\uDCC4\uDCC5\uDCC7\uDD80-\uDDB5\uDDB8-\uDDBE\uDDD8-\uDDDD\uDE00-\uDE3E\uDE40\uDE44\uDE80-\uDEB5\uDF00-\uDF1A\uDF1D-\uDF2A]|\uD806[\uDC00-\uDC38\uDCA0-\uDCDF\uDCFF\uDE00-\uDE32\uDE35-\uDE3E\uDE50-\uDE83\uDE86-\uDE97\uDE9D\uDEC0-\uDEF8]|\uD807[\uDC00-\uDC08\uDC0A-\uDC36\uDC38-\uDC3E\uDC40\uDC72-\uDC8F\uDC92-\uDCA7\uDCA9-\uDCB6\uDD00-\uDD06\uDD08\uDD09\uDD0B-\uDD36\uDD3A\uDD3C\uDD3D\uDD3F-\uDD41\uDD43\uDD46\uDD47\uDD60-\uDD65\uDD67\uDD68\uDD6A-\uDD8E\uDD90\uDD91\uDD93-\uDD96\uDD98\uDEE0-\uDEF6]|\uD808[\uDC00-\uDF99]|\uD809[\uDC00-\uDC6E\uDC80-\uDD43]|[\uD80C\uD81C-\uD820\uD840-\uD868\uD86A-\uD86C\uD86F-\uD872\uD874-\uD879][\uDC00-\uDFFF]|\uD80D[\uDC00-\uDC2E]|\uD811[\uDC00-\uDE46]|\uD81A[\uDC00-\uDE38\uDE40-\uDE5E\uDED0-\uDEED\uDF00-\uDF36\uDF40-\uDF43\uDF63-\uDF77\uDF7D-\uDF8F]|\uD81B[\uDE40-\uDE7F\uDF00-\uDF44\uDF50-\uDF7E\uDF93-\uDF9F\uDFE0\uDFE1]|\uD821[\uDC00-\uDFF1]|\uD822[\uDC00-\uDEF2]|\uD82C[\uDC00-\uDD1E\uDD70-\uDEFB]|\uD82F[\uDC00-\uDC6A\uDC70-\uDC7C\uDC80-\uDC88\uDC90-\uDC99\uDC9E]|\uD835[\uDC00-\uDC54\uDC56-\uDC9C\uDC9E\uDC9F\uDCA2\uDCA5\uDCA6\uDCA9-\uDCAC\uDCAE-\uDCB9\uDCBB\uDCBD-\uDCC3\uDCC5-\uDD05\uDD07-\uDD0A\uDD0D-\uDD14\uDD16-\uDD1C\uDD1E-\uDD39\uDD3B-\uDD3E\uDD40-\uDD44\uDD46\uDD4A-\uDD50\uDD52-\uDEA5\uDEA8-\uDEC0\uDEC2-\uDEDA\uDEDC-\uDEFA\uDEFC-\uDF14\uDF16-\uDF34\uDF36-\uDF4E\uDF50-\uDF6E\uDF70-\uDF88\uDF8A-\uDFA8\uDFAA-\uDFC2\uDFC4-\uDFCB]|\uD838[\uDC00-\uDC06\uDC08-\uDC18\uDC1B-\uDC21\uDC23\uDC24\uDC26-\uDC2A]|\uD83A[\uDC00-\uDCC4\uDD00-\uDD43\uDD47]|\uD83B[\uDE00-\uDE03\uDE05-\uDE1F\uDE21\uDE22\uDE24\uDE27\uDE29-\uDE32\uDE34-\uDE37\uDE39\uDE3B\uDE42\uDE47\uDE49\uDE4B\uDE4D-\uDE4F\uDE51\uDE52\uDE54\uDE57\uDE59\uDE5B\uDE5D\uDE5F\uDE61\uDE62\uDE64\uDE67-\uDE6A\uDE6C-\uDE72\uDE74-\uDE77\uDE79-\uDE7C\uDE7E\uDE80-\uDE89\uDE8B-\uDE9B\uDEA1-\uDEA3\uDEA5-\uDEA9\uDEAB-\uDEBB]|\uD83C[\uDD30-\uDD49\uDD50-\uDD69\uDD70-\uDD89]|\uD869[\uDC00-\uDED6\uDF00-\uDFFF]|\uD86D[\uDC00-\uDF34\uDF40-\uDFFF]|\uD86E[\uDC00-\uDC1D\uDC20-\uDFFF]|\uD873[\uDC00-\uDEA1\uDEB0-\uDFFF]|\uD87A[\uDC00-\uDFE0]|\uD87E[\uDC00-\uDE1D]' + }, + { + 'name': 'Any', + 'isBmpLast': true, + 'bmp': '\0-\uFFFF', + 'astral': '[\uD800-\uDBFF][\uDC00-\uDFFF]' + }, + { + 'name': 'Default_Ignorable_Code_Point', + 'bmp': '\xAD\u034F\u061C\u115F\u1160\u17B4\u17B5\u180B-\u180E\u200B-\u200F\u202A-\u202E\u2060-\u206F\u3164\uFE00-\uFE0F\uFEFF\uFFA0\uFFF0-\uFFF8', + 'astral': '\uD82F[\uDCA0-\uDCA3]|\uD834[\uDD73-\uDD7A]|[\uDB40-\uDB43][\uDC00-\uDFFF]' + }, + { + 'name': 'Lowercase', + 'bmp': 'a-z\xAA\xB5\xBA\xDF-\xF6\xF8-\xFF\u0101\u0103\u0105\u0107\u0109\u010B\u010D\u010F\u0111\u0113\u0115\u0117\u0119\u011B\u011D\u011F\u0121\u0123\u0125\u0127\u0129\u012B\u012D\u012F\u0131\u0133\u0135\u0137\u0138\u013A\u013C\u013E\u0140\u0142\u0144\u0146\u0148\u0149\u014B\u014D\u014F\u0151\u0153\u0155\u0157\u0159\u015B\u015D\u015F\u0161\u0163\u0165\u0167\u0169\u016B\u016D\u016F\u0171\u0173\u0175\u0177\u017A\u017C\u017E-\u0180\u0183\u0185\u0188\u018C\u018D\u0192\u0195\u0199-\u019B\u019E\u01A1\u01A3\u01A5\u01A8\u01AA\u01AB\u01AD\u01B0\u01B4\u01B6\u01B9\u01BA\u01BD-\u01BF\u01C6\u01C9\u01CC\u01CE\u01D0\u01D2\u01D4\u01D6\u01D8\u01DA\u01DC\u01DD\u01DF\u01E1\u01E3\u01E5\u01E7\u01E9\u01EB\u01ED\u01EF\u01F0\u01F3\u01F5\u01F9\u01FB\u01FD\u01FF\u0201\u0203\u0205\u0207\u0209\u020B\u020D\u020F\u0211\u0213\u0215\u0217\u0219\u021B\u021D\u021F\u0221\u0223\u0225\u0227\u0229\u022B\u022D\u022F\u0231\u0233-\u0239\u023C\u023F\u0240\u0242\u0247\u0249\u024B\u024D\u024F-\u0293\u0295-\u02B8\u02C0\u02C1\u02E0-\u02E4\u0345\u0371\u0373\u0377\u037A-\u037D\u0390\u03AC-\u03CE\u03D0\u03D1\u03D5-\u03D7\u03D9\u03DB\u03DD\u03DF\u03E1\u03E3\u03E5\u03E7\u03E9\u03EB\u03ED\u03EF-\u03F3\u03F5\u03F8\u03FB\u03FC\u0430-\u045F\u0461\u0463\u0465\u0467\u0469\u046B\u046D\u046F\u0471\u0473\u0475\u0477\u0479\u047B\u047D\u047F\u0481\u048B\u048D\u048F\u0491\u0493\u0495\u0497\u0499\u049B\u049D\u049F\u04A1\u04A3\u04A5\u04A7\u04A9\u04AB\u04AD\u04AF\u04B1\u04B3\u04B5\u04B7\u04B9\u04BB\u04BD\u04BF\u04C2\u04C4\u04C6\u04C8\u04CA\u04CC\u04CE\u04CF\u04D1\u04D3\u04D5\u04D7\u04D9\u04DB\u04DD\u04DF\u04E1\u04E3\u04E5\u04E7\u04E9\u04EB\u04ED\u04EF\u04F1\u04F3\u04F5\u04F7\u04F9\u04FB\u04FD\u04FF\u0501\u0503\u0505\u0507\u0509\u050B\u050D\u050F\u0511\u0513\u0515\u0517\u0519\u051B\u051D\u051F\u0521\u0523\u0525\u0527\u0529\u052B\u052D\u052F\u0560-\u0588\u10D0-\u10FA\u10FD-\u10FF\u13F8-\u13FD\u1C80-\u1C88\u1D00-\u1DBF\u1E01\u1E03\u1E05\u1E07\u1E09\u1E0B\u1E0D\u1E0F\u1E11\u1E13\u1E15\u1E17\u1E19\u1E1B\u1E1D\u1E1F\u1E21\u1E23\u1E25\u1E27\u1E29\u1E2B\u1E2D\u1E2F\u1E31\u1E33\u1E35\u1E37\u1E39\u1E3B\u1E3D\u1E3F\u1E41\u1E43\u1E45\u1E47\u1E49\u1E4B\u1E4D\u1E4F\u1E51\u1E53\u1E55\u1E57\u1E59\u1E5B\u1E5D\u1E5F\u1E61\u1E63\u1E65\u1E67\u1E69\u1E6B\u1E6D\u1E6F\u1E71\u1E73\u1E75\u1E77\u1E79\u1E7B\u1E7D\u1E7F\u1E81\u1E83\u1E85\u1E87\u1E89\u1E8B\u1E8D\u1E8F\u1E91\u1E93\u1E95-\u1E9D\u1E9F\u1EA1\u1EA3\u1EA5\u1EA7\u1EA9\u1EAB\u1EAD\u1EAF\u1EB1\u1EB3\u1EB5\u1EB7\u1EB9\u1EBB\u1EBD\u1EBF\u1EC1\u1EC3\u1EC5\u1EC7\u1EC9\u1ECB\u1ECD\u1ECF\u1ED1\u1ED3\u1ED5\u1ED7\u1ED9\u1EDB\u1EDD\u1EDF\u1EE1\u1EE3\u1EE5\u1EE7\u1EE9\u1EEB\u1EED\u1EEF\u1EF1\u1EF3\u1EF5\u1EF7\u1EF9\u1EFB\u1EFD\u1EFF-\u1F07\u1F10-\u1F15\u1F20-\u1F27\u1F30-\u1F37\u1F40-\u1F45\u1F50-\u1F57\u1F60-\u1F67\u1F70-\u1F7D\u1F80-\u1F87\u1F90-\u1F97\u1FA0-\u1FA7\u1FB0-\u1FB4\u1FB6\u1FB7\u1FBE\u1FC2-\u1FC4\u1FC6\u1FC7\u1FD0-\u1FD3\u1FD6\u1FD7\u1FE0-\u1FE7\u1FF2-\u1FF4\u1FF6\u1FF7\u2071\u207F\u2090-\u209C\u210A\u210E\u210F\u2113\u212F\u2134\u2139\u213C\u213D\u2146-\u2149\u214E\u2170-\u217F\u2184\u24D0-\u24E9\u2C30-\u2C5E\u2C61\u2C65\u2C66\u2C68\u2C6A\u2C6C\u2C71\u2C73\u2C74\u2C76-\u2C7D\u2C81\u2C83\u2C85\u2C87\u2C89\u2C8B\u2C8D\u2C8F\u2C91\u2C93\u2C95\u2C97\u2C99\u2C9B\u2C9D\u2C9F\u2CA1\u2CA3\u2CA5\u2CA7\u2CA9\u2CAB\u2CAD\u2CAF\u2CB1\u2CB3\u2CB5\u2CB7\u2CB9\u2CBB\u2CBD\u2CBF\u2CC1\u2CC3\u2CC5\u2CC7\u2CC9\u2CCB\u2CCD\u2CCF\u2CD1\u2CD3\u2CD5\u2CD7\u2CD9\u2CDB\u2CDD\u2CDF\u2CE1\u2CE3\u2CE4\u2CEC\u2CEE\u2CF3\u2D00-\u2D25\u2D27\u2D2D\uA641\uA643\uA645\uA647\uA649\uA64B\uA64D\uA64F\uA651\uA653\uA655\uA657\uA659\uA65B\uA65D\uA65F\uA661\uA663\uA665\uA667\uA669\uA66B\uA66D\uA681\uA683\uA685\uA687\uA689\uA68B\uA68D\uA68F\uA691\uA693\uA695\uA697\uA699\uA69B-\uA69D\uA723\uA725\uA727\uA729\uA72B\uA72D\uA72F-\uA731\uA733\uA735\uA737\uA739\uA73B\uA73D\uA73F\uA741\uA743\uA745\uA747\uA749\uA74B\uA74D\uA74F\uA751\uA753\uA755\uA757\uA759\uA75B\uA75D\uA75F\uA761\uA763\uA765\uA767\uA769\uA76B\uA76D\uA76F-\uA778\uA77A\uA77C\uA77F\uA781\uA783\uA785\uA787\uA78C\uA78E\uA791\uA793-\uA795\uA797\uA799\uA79B\uA79D\uA79F\uA7A1\uA7A3\uA7A5\uA7A7\uA7A9\uA7AF\uA7B5\uA7B7\uA7B9\uA7F8-\uA7FA\uAB30-\uAB5A\uAB5C-\uAB65\uAB70-\uABBF\uFB00-\uFB06\uFB13-\uFB17\uFF41-\uFF5A', + 'astral': '\uD801[\uDC28-\uDC4F\uDCD8-\uDCFB]|\uD803[\uDCC0-\uDCF2]|\uD806[\uDCC0-\uDCDF]|\uD81B[\uDE60-\uDE7F]|\uD835[\uDC1A-\uDC33\uDC4E-\uDC54\uDC56-\uDC67\uDC82-\uDC9B\uDCB6-\uDCB9\uDCBB\uDCBD-\uDCC3\uDCC5-\uDCCF\uDCEA-\uDD03\uDD1E-\uDD37\uDD52-\uDD6B\uDD86-\uDD9F\uDDBA-\uDDD3\uDDEE-\uDE07\uDE22-\uDE3B\uDE56-\uDE6F\uDE8A-\uDEA5\uDEC2-\uDEDA\uDEDC-\uDEE1\uDEFC-\uDF14\uDF16-\uDF1B\uDF36-\uDF4E\uDF50-\uDF55\uDF70-\uDF88\uDF8A-\uDF8F\uDFAA-\uDFC2\uDFC4-\uDFC9\uDFCB]|\uD83A[\uDD22-\uDD43]' + }, + { + 'name': 'Noncharacter_Code_Point', + 'bmp': '\uFDD0-\uFDEF\uFFFE\uFFFF', + 'astral': '[\uD83F\uD87F\uD8BF\uD8FF\uD93F\uD97F\uD9BF\uD9FF\uDA3F\uDA7F\uDABF\uDAFF\uDB3F\uDB7F\uDBBF\uDBFF][\uDFFE\uDFFF]' + }, + { + 'name': 'Uppercase', + 'bmp': 'A-Z\xC0-\xD6\xD8-\xDE\u0100\u0102\u0104\u0106\u0108\u010A\u010C\u010E\u0110\u0112\u0114\u0116\u0118\u011A\u011C\u011E\u0120\u0122\u0124\u0126\u0128\u012A\u012C\u012E\u0130\u0132\u0134\u0136\u0139\u013B\u013D\u013F\u0141\u0143\u0145\u0147\u014A\u014C\u014E\u0150\u0152\u0154\u0156\u0158\u015A\u015C\u015E\u0160\u0162\u0164\u0166\u0168\u016A\u016C\u016E\u0170\u0172\u0174\u0176\u0178\u0179\u017B\u017D\u0181\u0182\u0184\u0186\u0187\u0189-\u018B\u018E-\u0191\u0193\u0194\u0196-\u0198\u019C\u019D\u019F\u01A0\u01A2\u01A4\u01A6\u01A7\u01A9\u01AC\u01AE\u01AF\u01B1-\u01B3\u01B5\u01B7\u01B8\u01BC\u01C4\u01C7\u01CA\u01CD\u01CF\u01D1\u01D3\u01D5\u01D7\u01D9\u01DB\u01DE\u01E0\u01E2\u01E4\u01E6\u01E8\u01EA\u01EC\u01EE\u01F1\u01F4\u01F6-\u01F8\u01FA\u01FC\u01FE\u0200\u0202\u0204\u0206\u0208\u020A\u020C\u020E\u0210\u0212\u0214\u0216\u0218\u021A\u021C\u021E\u0220\u0222\u0224\u0226\u0228\u022A\u022C\u022E\u0230\u0232\u023A\u023B\u023D\u023E\u0241\u0243-\u0246\u0248\u024A\u024C\u024E\u0370\u0372\u0376\u037F\u0386\u0388-\u038A\u038C\u038E\u038F\u0391-\u03A1\u03A3-\u03AB\u03CF\u03D2-\u03D4\u03D8\u03DA\u03DC\u03DE\u03E0\u03E2\u03E4\u03E6\u03E8\u03EA\u03EC\u03EE\u03F4\u03F7\u03F9\u03FA\u03FD-\u042F\u0460\u0462\u0464\u0466\u0468\u046A\u046C\u046E\u0470\u0472\u0474\u0476\u0478\u047A\u047C\u047E\u0480\u048A\u048C\u048E\u0490\u0492\u0494\u0496\u0498\u049A\u049C\u049E\u04A0\u04A2\u04A4\u04A6\u04A8\u04AA\u04AC\u04AE\u04B0\u04B2\u04B4\u04B6\u04B8\u04BA\u04BC\u04BE\u04C0\u04C1\u04C3\u04C5\u04C7\u04C9\u04CB\u04CD\u04D0\u04D2\u04D4\u04D6\u04D8\u04DA\u04DC\u04DE\u04E0\u04E2\u04E4\u04E6\u04E8\u04EA\u04EC\u04EE\u04F0\u04F2\u04F4\u04F6\u04F8\u04FA\u04FC\u04FE\u0500\u0502\u0504\u0506\u0508\u050A\u050C\u050E\u0510\u0512\u0514\u0516\u0518\u051A\u051C\u051E\u0520\u0522\u0524\u0526\u0528\u052A\u052C\u052E\u0531-\u0556\u10A0-\u10C5\u10C7\u10CD\u13A0-\u13F5\u1C90-\u1CBA\u1CBD-\u1CBF\u1E00\u1E02\u1E04\u1E06\u1E08\u1E0A\u1E0C\u1E0E\u1E10\u1E12\u1E14\u1E16\u1E18\u1E1A\u1E1C\u1E1E\u1E20\u1E22\u1E24\u1E26\u1E28\u1E2A\u1E2C\u1E2E\u1E30\u1E32\u1E34\u1E36\u1E38\u1E3A\u1E3C\u1E3E\u1E40\u1E42\u1E44\u1E46\u1E48\u1E4A\u1E4C\u1E4E\u1E50\u1E52\u1E54\u1E56\u1E58\u1E5A\u1E5C\u1E5E\u1E60\u1E62\u1E64\u1E66\u1E68\u1E6A\u1E6C\u1E6E\u1E70\u1E72\u1E74\u1E76\u1E78\u1E7A\u1E7C\u1E7E\u1E80\u1E82\u1E84\u1E86\u1E88\u1E8A\u1E8C\u1E8E\u1E90\u1E92\u1E94\u1E9E\u1EA0\u1EA2\u1EA4\u1EA6\u1EA8\u1EAA\u1EAC\u1EAE\u1EB0\u1EB2\u1EB4\u1EB6\u1EB8\u1EBA\u1EBC\u1EBE\u1EC0\u1EC2\u1EC4\u1EC6\u1EC8\u1ECA\u1ECC\u1ECE\u1ED0\u1ED2\u1ED4\u1ED6\u1ED8\u1EDA\u1EDC\u1EDE\u1EE0\u1EE2\u1EE4\u1EE6\u1EE8\u1EEA\u1EEC\u1EEE\u1EF0\u1EF2\u1EF4\u1EF6\u1EF8\u1EFA\u1EFC\u1EFE\u1F08-\u1F0F\u1F18-\u1F1D\u1F28-\u1F2F\u1F38-\u1F3F\u1F48-\u1F4D\u1F59\u1F5B\u1F5D\u1F5F\u1F68-\u1F6F\u1FB8-\u1FBB\u1FC8-\u1FCB\u1FD8-\u1FDB\u1FE8-\u1FEC\u1FF8-\u1FFB\u2102\u2107\u210B-\u210D\u2110-\u2112\u2115\u2119-\u211D\u2124\u2126\u2128\u212A-\u212D\u2130-\u2133\u213E\u213F\u2145\u2160-\u216F\u2183\u24B6-\u24CF\u2C00-\u2C2E\u2C60\u2C62-\u2C64\u2C67\u2C69\u2C6B\u2C6D-\u2C70\u2C72\u2C75\u2C7E-\u2C80\u2C82\u2C84\u2C86\u2C88\u2C8A\u2C8C\u2C8E\u2C90\u2C92\u2C94\u2C96\u2C98\u2C9A\u2C9C\u2C9E\u2CA0\u2CA2\u2CA4\u2CA6\u2CA8\u2CAA\u2CAC\u2CAE\u2CB0\u2CB2\u2CB4\u2CB6\u2CB8\u2CBA\u2CBC\u2CBE\u2CC0\u2CC2\u2CC4\u2CC6\u2CC8\u2CCA\u2CCC\u2CCE\u2CD0\u2CD2\u2CD4\u2CD6\u2CD8\u2CDA\u2CDC\u2CDE\u2CE0\u2CE2\u2CEB\u2CED\u2CF2\uA640\uA642\uA644\uA646\uA648\uA64A\uA64C\uA64E\uA650\uA652\uA654\uA656\uA658\uA65A\uA65C\uA65E\uA660\uA662\uA664\uA666\uA668\uA66A\uA66C\uA680\uA682\uA684\uA686\uA688\uA68A\uA68C\uA68E\uA690\uA692\uA694\uA696\uA698\uA69A\uA722\uA724\uA726\uA728\uA72A\uA72C\uA72E\uA732\uA734\uA736\uA738\uA73A\uA73C\uA73E\uA740\uA742\uA744\uA746\uA748\uA74A\uA74C\uA74E\uA750\uA752\uA754\uA756\uA758\uA75A\uA75C\uA75E\uA760\uA762\uA764\uA766\uA768\uA76A\uA76C\uA76E\uA779\uA77B\uA77D\uA77E\uA780\uA782\uA784\uA786\uA78B\uA78D\uA790\uA792\uA796\uA798\uA79A\uA79C\uA79E\uA7A0\uA7A2\uA7A4\uA7A6\uA7A8\uA7AA-\uA7AE\uA7B0-\uA7B4\uA7B6\uA7B8\uFF21-\uFF3A', + 'astral': '\uD801[\uDC00-\uDC27\uDCB0-\uDCD3]|\uD803[\uDC80-\uDCB2]|\uD806[\uDCA0-\uDCBF]|\uD81B[\uDE40-\uDE5F]|\uD835[\uDC00-\uDC19\uDC34-\uDC4D\uDC68-\uDC81\uDC9C\uDC9E\uDC9F\uDCA2\uDCA5\uDCA6\uDCA9-\uDCAC\uDCAE-\uDCB5\uDCD0-\uDCE9\uDD04\uDD05\uDD07-\uDD0A\uDD0D-\uDD14\uDD16-\uDD1C\uDD38\uDD39\uDD3B-\uDD3E\uDD40-\uDD44\uDD46\uDD4A-\uDD50\uDD6C-\uDD85\uDDA0-\uDDB9\uDDD4-\uDDED\uDE08-\uDE21\uDE3C-\uDE55\uDE70-\uDE89\uDEA8-\uDEC0\uDEE2-\uDEFA\uDF1C-\uDF34\uDF56-\uDF6E\uDF90-\uDFA8\uDFCA]|\uD83A[\uDD00-\uDD21]|\uD83C[\uDD30-\uDD49\uDD50-\uDD69\uDD70-\uDD89]' + }, + { + 'name': 'White_Space', + 'bmp': '\t-\r \x85\xA0\u1680\u2000-\u200A\u2028\u2029\u202F\u205F\u3000' + } +]; + +var unicodeProperties = createCommonjsModule(function (module, exports) { +"use strict"; + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.default = void 0; + +var _properties = _interopRequireDefault(properties); + +function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } + +/*! + * XRegExp Unicode Properties 4.2.0 + * + * Steven Levithan (c) 2012-present MIT License + * Unicode data by Mathias Bynens + */ +var _default = function _default(XRegExp) { + /** + * Adds properties to meet the UTS #18 Level 1 RL1.2 requirements for Unicode regex support. See + * . Following are definitions of these properties from + * UAX #44 : + * + * - Alphabetic + * Characters with the Alphabetic property. Generated from: Lowercase + Uppercase + Lt + Lm + + * Lo + Nl + Other_Alphabetic. + * + * - Default_Ignorable_Code_Point + * For programmatic determination of default ignorable code points. New characters that should + * be ignored in rendering (unless explicitly supported) will be assigned in these ranges, + * permitting programs to correctly handle the default rendering of such characters when not + * otherwise supported. + * + * - Lowercase + * Characters with the Lowercase property. Generated from: Ll + Other_Lowercase. + * + * - Noncharacter_Code_Point + * Code points permanently reserved for internal use. + * + * - Uppercase + * Characters with the Uppercase property. Generated from: Lu + Other_Uppercase. + * + * - White_Space + * Spaces, separator characters and other control characters which should be treated by + * programming languages as "white space" for the purpose of parsing elements. + * + * The properties ASCII, Any, and Assigned are also included but are not defined in UAX #44. UTS + * #18 RL1.2 additionally requires support for Unicode scripts and general categories. These are + * included in XRegExp's Unicode Categories and Unicode Scripts addons. + * + * Token names are case insensitive, and any spaces, hyphens, and underscores are ignored. + * + * Uses Unicode 11.0.0. + * + * @requires XRegExp, Unicode Base + */ + if (!XRegExp.addUnicodeData) { + throw new ReferenceError('Unicode Base must be loaded before Unicode Properties'); + } + + var unicodeData = _properties.default; // Add non-generated data + + unicodeData.push({ + name: 'Assigned', + // Since this is defined as the inverse of Unicode category Cn (Unassigned), the Unicode + // Categories addon is required to use this property + inverseOf: 'Cn' + }); + XRegExp.addUnicodeData(unicodeData); +}; + +exports.default = _default; +module.exports = exports["default"]; +}); + +unwrapExports(unicodeProperties); + +var scripts = [ + { + 'name': 'Adlam', + 'astral': '\uD83A[\uDD00-\uDD4A\uDD50-\uDD59\uDD5E\uDD5F]' + }, + { + 'name': 'Ahom', + 'astral': '\uD805[\uDF00-\uDF1A\uDF1D-\uDF2B\uDF30-\uDF3F]' + }, + { + 'name': 'Anatolian_Hieroglyphs', + 'astral': '\uD811[\uDC00-\uDE46]' + }, + { + 'name': 'Arabic', + 'bmp': '\u0600-\u0604\u0606-\u060B\u060D-\u061A\u061C\u061E\u0620-\u063F\u0641-\u064A\u0656-\u066F\u0671-\u06DC\u06DE-\u06FF\u0750-\u077F\u08A0-\u08B4\u08B6-\u08BD\u08D3-\u08E1\u08E3-\u08FF\uFB50-\uFBC1\uFBD3-\uFD3D\uFD50-\uFD8F\uFD92-\uFDC7\uFDF0-\uFDFD\uFE70-\uFE74\uFE76-\uFEFC', + 'astral': '\uD803[\uDE60-\uDE7E]|\uD83B[\uDE00-\uDE03\uDE05-\uDE1F\uDE21\uDE22\uDE24\uDE27\uDE29-\uDE32\uDE34-\uDE37\uDE39\uDE3B\uDE42\uDE47\uDE49\uDE4B\uDE4D-\uDE4F\uDE51\uDE52\uDE54\uDE57\uDE59\uDE5B\uDE5D\uDE5F\uDE61\uDE62\uDE64\uDE67-\uDE6A\uDE6C-\uDE72\uDE74-\uDE77\uDE79-\uDE7C\uDE7E\uDE80-\uDE89\uDE8B-\uDE9B\uDEA1-\uDEA3\uDEA5-\uDEA9\uDEAB-\uDEBB\uDEF0\uDEF1]' + }, + { + 'name': 'Armenian', + 'bmp': '\u0531-\u0556\u0559-\u0588\u058A\u058D-\u058F\uFB13-\uFB17' + }, + { + 'name': 'Avestan', + 'astral': '\uD802[\uDF00-\uDF35\uDF39-\uDF3F]' + }, + { + 'name': 'Balinese', + 'bmp': '\u1B00-\u1B4B\u1B50-\u1B7C' + }, + { + 'name': 'Bamum', + 'bmp': '\uA6A0-\uA6F7', + 'astral': '\uD81A[\uDC00-\uDE38]' + }, + { + 'name': 'Bassa_Vah', + 'astral': '\uD81A[\uDED0-\uDEED\uDEF0-\uDEF5]' + }, + { + 'name': 'Batak', + 'bmp': '\u1BC0-\u1BF3\u1BFC-\u1BFF' + }, + { + 'name': 'Bengali', + 'bmp': '\u0980-\u0983\u0985-\u098C\u098F\u0990\u0993-\u09A8\u09AA-\u09B0\u09B2\u09B6-\u09B9\u09BC-\u09C4\u09C7\u09C8\u09CB-\u09CE\u09D7\u09DC\u09DD\u09DF-\u09E3\u09E6-\u09FE' + }, + { + 'name': 'Bhaiksuki', + 'astral': '\uD807[\uDC00-\uDC08\uDC0A-\uDC36\uDC38-\uDC45\uDC50-\uDC6C]' + }, + { + 'name': 'Bopomofo', + 'bmp': '\u02EA\u02EB\u3105-\u312F\u31A0-\u31BA' + }, + { + 'name': 'Brahmi', + 'astral': '\uD804[\uDC00-\uDC4D\uDC52-\uDC6F\uDC7F]' + }, + { + 'name': 'Braille', + 'bmp': '\u2800-\u28FF' + }, + { + 'name': 'Buginese', + 'bmp': '\u1A00-\u1A1B\u1A1E\u1A1F' + }, + { + 'name': 'Buhid', + 'bmp': '\u1740-\u1753' + }, + { + 'name': 'Canadian_Aboriginal', + 'bmp': '\u1400-\u167F\u18B0-\u18F5' + }, + { + 'name': 'Carian', + 'astral': '\uD800[\uDEA0-\uDED0]' + }, + { + 'name': 'Caucasian_Albanian', + 'astral': '\uD801[\uDD30-\uDD63\uDD6F]' + }, + { + 'name': 'Chakma', + 'astral': '\uD804[\uDD00-\uDD34\uDD36-\uDD46]' + }, + { + 'name': 'Cham', + 'bmp': '\uAA00-\uAA36\uAA40-\uAA4D\uAA50-\uAA59\uAA5C-\uAA5F' + }, + { + 'name': 'Cherokee', + 'bmp': '\u13A0-\u13F5\u13F8-\u13FD\uAB70-\uABBF' + }, + { + 'name': 'Common', + 'bmp': '\0-@\\[-`\\{-\xA9\xAB-\xB9\xBB-\xBF\xD7\xF7\u02B9-\u02DF\u02E5-\u02E9\u02EC-\u02FF\u0374\u037E\u0385\u0387\u0589\u0605\u060C\u061B\u061F\u0640\u06DD\u08E2\u0964\u0965\u0E3F\u0FD5-\u0FD8\u10FB\u16EB-\u16ED\u1735\u1736\u1802\u1803\u1805\u1CD3\u1CE1\u1CE9-\u1CEC\u1CEE-\u1CF3\u1CF5-\u1CF7\u2000-\u200B\u200E-\u2064\u2066-\u2070\u2074-\u207E\u2080-\u208E\u20A0-\u20BF\u2100-\u2125\u2127-\u2129\u212C-\u2131\u2133-\u214D\u214F-\u215F\u2189-\u218B\u2190-\u2426\u2440-\u244A\u2460-\u27FF\u2900-\u2B73\u2B76-\u2B95\u2B98-\u2BC8\u2BCA-\u2BFE\u2E00-\u2E4E\u2FF0-\u2FFB\u3000-\u3004\u3006\u3008-\u3020\u3030-\u3037\u303C-\u303F\u309B\u309C\u30A0\u30FB\u30FC\u3190-\u319F\u31C0-\u31E3\u3220-\u325F\u327F-\u32CF\u3358-\u33FF\u4DC0-\u4DFF\uA700-\uA721\uA788-\uA78A\uA830-\uA839\uA92E\uA9CF\uAB5B\uFD3E\uFD3F\uFE10-\uFE19\uFE30-\uFE52\uFE54-\uFE66\uFE68-\uFE6B\uFEFF\uFF01-\uFF20\uFF3B-\uFF40\uFF5B-\uFF65\uFF70\uFF9E\uFF9F\uFFE0-\uFFE6\uFFE8-\uFFEE\uFFF9-\uFFFD', + 'astral': '\uD800[\uDD00-\uDD02\uDD07-\uDD33\uDD37-\uDD3F\uDD90-\uDD9B\uDDD0-\uDDFC\uDEE1-\uDEFB]|\uD82F[\uDCA0-\uDCA3]|\uD834[\uDC00-\uDCF5\uDD00-\uDD26\uDD29-\uDD66\uDD6A-\uDD7A\uDD83\uDD84\uDD8C-\uDDA9\uDDAE-\uDDE8\uDEE0-\uDEF3\uDF00-\uDF56\uDF60-\uDF78]|\uD835[\uDC00-\uDC54\uDC56-\uDC9C\uDC9E\uDC9F\uDCA2\uDCA5\uDCA6\uDCA9-\uDCAC\uDCAE-\uDCB9\uDCBB\uDCBD-\uDCC3\uDCC5-\uDD05\uDD07-\uDD0A\uDD0D-\uDD14\uDD16-\uDD1C\uDD1E-\uDD39\uDD3B-\uDD3E\uDD40-\uDD44\uDD46\uDD4A-\uDD50\uDD52-\uDEA5\uDEA8-\uDFCB\uDFCE-\uDFFF]|\uD83B[\uDC71-\uDCB4]|\uD83C[\uDC00-\uDC2B\uDC30-\uDC93\uDCA0-\uDCAE\uDCB1-\uDCBF\uDCC1-\uDCCF\uDCD1-\uDCF5\uDD00-\uDD0C\uDD10-\uDD6B\uDD70-\uDDAC\uDDE6-\uDDFF\uDE01\uDE02\uDE10-\uDE3B\uDE40-\uDE48\uDE50\uDE51\uDE60-\uDE65\uDF00-\uDFFF]|\uD83D[\uDC00-\uDED4\uDEE0-\uDEEC\uDEF0-\uDEF9\uDF00-\uDF73\uDF80-\uDFD8]|\uD83E[\uDC00-\uDC0B\uDC10-\uDC47\uDC50-\uDC59\uDC60-\uDC87\uDC90-\uDCAD\uDD00-\uDD0B\uDD10-\uDD3E\uDD40-\uDD70\uDD73-\uDD76\uDD7A\uDD7C-\uDDA2\uDDB0-\uDDB9\uDDC0-\uDDC2\uDDD0-\uDDFF\uDE60-\uDE6D]|\uDB40[\uDC01\uDC20-\uDC7F]' + }, + { + 'name': 'Coptic', + 'bmp': '\u03E2-\u03EF\u2C80-\u2CF3\u2CF9-\u2CFF' + }, + { + 'name': 'Cuneiform', + 'astral': '\uD808[\uDC00-\uDF99]|\uD809[\uDC00-\uDC6E\uDC70-\uDC74\uDC80-\uDD43]' + }, + { + 'name': 'Cypriot', + 'astral': '\uD802[\uDC00-\uDC05\uDC08\uDC0A-\uDC35\uDC37\uDC38\uDC3C\uDC3F]' + }, + { + 'name': 'Cyrillic', + 'bmp': '\u0400-\u0484\u0487-\u052F\u1C80-\u1C88\u1D2B\u1D78\u2DE0-\u2DFF\uA640-\uA69F\uFE2E\uFE2F' + }, + { + 'name': 'Deseret', + 'astral': '\uD801[\uDC00-\uDC4F]' + }, + { + 'name': 'Devanagari', + 'bmp': '\u0900-\u0950\u0953-\u0963\u0966-\u097F\uA8E0-\uA8FF' + }, + { + 'name': 'Dogra', + 'astral': '\uD806[\uDC00-\uDC3B]' + }, + { + 'name': 'Duployan', + 'astral': '\uD82F[\uDC00-\uDC6A\uDC70-\uDC7C\uDC80-\uDC88\uDC90-\uDC99\uDC9C-\uDC9F]' + }, + { + 'name': 'Egyptian_Hieroglyphs', + 'astral': '\uD80C[\uDC00-\uDFFF]|\uD80D[\uDC00-\uDC2E]' + }, + { + 'name': 'Elbasan', + 'astral': '\uD801[\uDD00-\uDD27]' + }, + { + 'name': 'Ethiopic', + 'bmp': '\u1200-\u1248\u124A-\u124D\u1250-\u1256\u1258\u125A-\u125D\u1260-\u1288\u128A-\u128D\u1290-\u12B0\u12B2-\u12B5\u12B8-\u12BE\u12C0\u12C2-\u12C5\u12C8-\u12D6\u12D8-\u1310\u1312-\u1315\u1318-\u135A\u135D-\u137C\u1380-\u1399\u2D80-\u2D96\u2DA0-\u2DA6\u2DA8-\u2DAE\u2DB0-\u2DB6\u2DB8-\u2DBE\u2DC0-\u2DC6\u2DC8-\u2DCE\u2DD0-\u2DD6\u2DD8-\u2DDE\uAB01-\uAB06\uAB09-\uAB0E\uAB11-\uAB16\uAB20-\uAB26\uAB28-\uAB2E' + }, + { + 'name': 'Georgian', + 'bmp': '\u10A0-\u10C5\u10C7\u10CD\u10D0-\u10FA\u10FC-\u10FF\u1C90-\u1CBA\u1CBD-\u1CBF\u2D00-\u2D25\u2D27\u2D2D' + }, + { + 'name': 'Glagolitic', + 'bmp': '\u2C00-\u2C2E\u2C30-\u2C5E', + 'astral': '\uD838[\uDC00-\uDC06\uDC08-\uDC18\uDC1B-\uDC21\uDC23\uDC24\uDC26-\uDC2A]' + }, + { + 'name': 'Gothic', + 'astral': '\uD800[\uDF30-\uDF4A]' + }, + { + 'name': 'Grantha', + 'astral': '\uD804[\uDF00-\uDF03\uDF05-\uDF0C\uDF0F\uDF10\uDF13-\uDF28\uDF2A-\uDF30\uDF32\uDF33\uDF35-\uDF39\uDF3C-\uDF44\uDF47\uDF48\uDF4B-\uDF4D\uDF50\uDF57\uDF5D-\uDF63\uDF66-\uDF6C\uDF70-\uDF74]' + }, + { + 'name': 'Greek', + 'bmp': '\u0370-\u0373\u0375-\u0377\u037A-\u037D\u037F\u0384\u0386\u0388-\u038A\u038C\u038E-\u03A1\u03A3-\u03E1\u03F0-\u03FF\u1D26-\u1D2A\u1D5D-\u1D61\u1D66-\u1D6A\u1DBF\u1F00-\u1F15\u1F18-\u1F1D\u1F20-\u1F45\u1F48-\u1F4D\u1F50-\u1F57\u1F59\u1F5B\u1F5D\u1F5F-\u1F7D\u1F80-\u1FB4\u1FB6-\u1FC4\u1FC6-\u1FD3\u1FD6-\u1FDB\u1FDD-\u1FEF\u1FF2-\u1FF4\u1FF6-\u1FFE\u2126\uAB65', + 'astral': '\uD800[\uDD40-\uDD8E\uDDA0]|\uD834[\uDE00-\uDE45]' + }, + { + 'name': 'Gujarati', + 'bmp': '\u0A81-\u0A83\u0A85-\u0A8D\u0A8F-\u0A91\u0A93-\u0AA8\u0AAA-\u0AB0\u0AB2\u0AB3\u0AB5-\u0AB9\u0ABC-\u0AC5\u0AC7-\u0AC9\u0ACB-\u0ACD\u0AD0\u0AE0-\u0AE3\u0AE6-\u0AF1\u0AF9-\u0AFF' + }, + { + 'name': 'Gunjala_Gondi', + 'astral': '\uD807[\uDD60-\uDD65\uDD67\uDD68\uDD6A-\uDD8E\uDD90\uDD91\uDD93-\uDD98\uDDA0-\uDDA9]' + }, + { + 'name': 'Gurmukhi', + 'bmp': '\u0A01-\u0A03\u0A05-\u0A0A\u0A0F\u0A10\u0A13-\u0A28\u0A2A-\u0A30\u0A32\u0A33\u0A35\u0A36\u0A38\u0A39\u0A3C\u0A3E-\u0A42\u0A47\u0A48\u0A4B-\u0A4D\u0A51\u0A59-\u0A5C\u0A5E\u0A66-\u0A76' + }, + { + 'name': 'Han', + 'bmp': '\u2E80-\u2E99\u2E9B-\u2EF3\u2F00-\u2FD5\u3005\u3007\u3021-\u3029\u3038-\u303B\u3400-\u4DB5\u4E00-\u9FEF\uF900-\uFA6D\uFA70-\uFAD9', + 'astral': '[\uD840-\uD868\uD86A-\uD86C\uD86F-\uD872\uD874-\uD879][\uDC00-\uDFFF]|\uD869[\uDC00-\uDED6\uDF00-\uDFFF]|\uD86D[\uDC00-\uDF34\uDF40-\uDFFF]|\uD86E[\uDC00-\uDC1D\uDC20-\uDFFF]|\uD873[\uDC00-\uDEA1\uDEB0-\uDFFF]|\uD87A[\uDC00-\uDFE0]|\uD87E[\uDC00-\uDE1D]' + }, + { + 'name': 'Hangul', + 'bmp': '\u1100-\u11FF\u302E\u302F\u3131-\u318E\u3200-\u321E\u3260-\u327E\uA960-\uA97C\uAC00-\uD7A3\uD7B0-\uD7C6\uD7CB-\uD7FB\uFFA0-\uFFBE\uFFC2-\uFFC7\uFFCA-\uFFCF\uFFD2-\uFFD7\uFFDA-\uFFDC' + }, + { + 'name': 'Hanifi_Rohingya', + 'astral': '\uD803[\uDD00-\uDD27\uDD30-\uDD39]' + }, + { + 'name': 'Hanunoo', + 'bmp': '\u1720-\u1734' + }, + { + 'name': 'Hatran', + 'astral': '\uD802[\uDCE0-\uDCF2\uDCF4\uDCF5\uDCFB-\uDCFF]' + }, + { + 'name': 'Hebrew', + 'bmp': '\u0591-\u05C7\u05D0-\u05EA\u05EF-\u05F4\uFB1D-\uFB36\uFB38-\uFB3C\uFB3E\uFB40\uFB41\uFB43\uFB44\uFB46-\uFB4F' + }, + { + 'name': 'Hiragana', + 'bmp': '\u3041-\u3096\u309D-\u309F', + 'astral': '\uD82C[\uDC01-\uDD1E]|\uD83C\uDE00' + }, + { + 'name': 'Imperial_Aramaic', + 'astral': '\uD802[\uDC40-\uDC55\uDC57-\uDC5F]' + }, + { + 'name': 'Inherited', + 'bmp': '\u0300-\u036F\u0485\u0486\u064B-\u0655\u0670\u0951\u0952\u1AB0-\u1ABE\u1CD0-\u1CD2\u1CD4-\u1CE0\u1CE2-\u1CE8\u1CED\u1CF4\u1CF8\u1CF9\u1DC0-\u1DF9\u1DFB-\u1DFF\u200C\u200D\u20D0-\u20F0\u302A-\u302D\u3099\u309A\uFE00-\uFE0F\uFE20-\uFE2D', + 'astral': '\uD800[\uDDFD\uDEE0]|\uD804\uDF3B|\uD834[\uDD67-\uDD69\uDD7B-\uDD82\uDD85-\uDD8B\uDDAA-\uDDAD]|\uDB40[\uDD00-\uDDEF]' + }, + { + 'name': 'Inscriptional_Pahlavi', + 'astral': '\uD802[\uDF60-\uDF72\uDF78-\uDF7F]' + }, + { + 'name': 'Inscriptional_Parthian', + 'astral': '\uD802[\uDF40-\uDF55\uDF58-\uDF5F]' + }, + { + 'name': 'Javanese', + 'bmp': '\uA980-\uA9CD\uA9D0-\uA9D9\uA9DE\uA9DF' + }, + { + 'name': 'Kaithi', + 'astral': '\uD804[\uDC80-\uDCC1\uDCCD]' + }, + { + 'name': 'Kannada', + 'bmp': '\u0C80-\u0C8C\u0C8E-\u0C90\u0C92-\u0CA8\u0CAA-\u0CB3\u0CB5-\u0CB9\u0CBC-\u0CC4\u0CC6-\u0CC8\u0CCA-\u0CCD\u0CD5\u0CD6\u0CDE\u0CE0-\u0CE3\u0CE6-\u0CEF\u0CF1\u0CF2' + }, + { + 'name': 'Katakana', + 'bmp': '\u30A1-\u30FA\u30FD-\u30FF\u31F0-\u31FF\u32D0-\u32FE\u3300-\u3357\uFF66-\uFF6F\uFF71-\uFF9D', + 'astral': '\uD82C\uDC00' + }, + { + 'name': 'Kayah_Li', + 'bmp': '\uA900-\uA92D\uA92F' + }, + { + 'name': 'Kharoshthi', + 'astral': '\uD802[\uDE00-\uDE03\uDE05\uDE06\uDE0C-\uDE13\uDE15-\uDE17\uDE19-\uDE35\uDE38-\uDE3A\uDE3F-\uDE48\uDE50-\uDE58]' + }, + { + 'name': 'Khmer', + 'bmp': '\u1780-\u17DD\u17E0-\u17E9\u17F0-\u17F9\u19E0-\u19FF' + }, + { + 'name': 'Khojki', + 'astral': '\uD804[\uDE00-\uDE11\uDE13-\uDE3E]' + }, + { + 'name': 'Khudawadi', + 'astral': '\uD804[\uDEB0-\uDEEA\uDEF0-\uDEF9]' + }, + { + 'name': 'Lao', + 'bmp': '\u0E81\u0E82\u0E84\u0E87\u0E88\u0E8A\u0E8D\u0E94-\u0E97\u0E99-\u0E9F\u0EA1-\u0EA3\u0EA5\u0EA7\u0EAA\u0EAB\u0EAD-\u0EB9\u0EBB-\u0EBD\u0EC0-\u0EC4\u0EC6\u0EC8-\u0ECD\u0ED0-\u0ED9\u0EDC-\u0EDF' + }, + { + 'name': 'Latin', + 'bmp': 'A-Za-z\xAA\xBA\xC0-\xD6\xD8-\xF6\xF8-\u02B8\u02E0-\u02E4\u1D00-\u1D25\u1D2C-\u1D5C\u1D62-\u1D65\u1D6B-\u1D77\u1D79-\u1DBE\u1E00-\u1EFF\u2071\u207F\u2090-\u209C\u212A\u212B\u2132\u214E\u2160-\u2188\u2C60-\u2C7F\uA722-\uA787\uA78B-\uA7B9\uA7F7-\uA7FF\uAB30-\uAB5A\uAB5C-\uAB64\uFB00-\uFB06\uFF21-\uFF3A\uFF41-\uFF5A' + }, + { + 'name': 'Lepcha', + 'bmp': '\u1C00-\u1C37\u1C3B-\u1C49\u1C4D-\u1C4F' + }, + { + 'name': 'Limbu', + 'bmp': '\u1900-\u191E\u1920-\u192B\u1930-\u193B\u1940\u1944-\u194F' + }, + { + 'name': 'Linear_A', + 'astral': '\uD801[\uDE00-\uDF36\uDF40-\uDF55\uDF60-\uDF67]' + }, + { + 'name': 'Linear_B', + 'astral': '\uD800[\uDC00-\uDC0B\uDC0D-\uDC26\uDC28-\uDC3A\uDC3C\uDC3D\uDC3F-\uDC4D\uDC50-\uDC5D\uDC80-\uDCFA]' + }, + { + 'name': 'Lisu', + 'bmp': '\uA4D0-\uA4FF' + }, + { + 'name': 'Lycian', + 'astral': '\uD800[\uDE80-\uDE9C]' + }, + { + 'name': 'Lydian', + 'astral': '\uD802[\uDD20-\uDD39\uDD3F]' + }, + { + 'name': 'Mahajani', + 'astral': '\uD804[\uDD50-\uDD76]' + }, + { + 'name': 'Makasar', + 'astral': '\uD807[\uDEE0-\uDEF8]' + }, + { + 'name': 'Malayalam', + 'bmp': '\u0D00-\u0D03\u0D05-\u0D0C\u0D0E-\u0D10\u0D12-\u0D44\u0D46-\u0D48\u0D4A-\u0D4F\u0D54-\u0D63\u0D66-\u0D7F' + }, + { + 'name': 'Mandaic', + 'bmp': '\u0840-\u085B\u085E' + }, + { + 'name': 'Manichaean', + 'astral': '\uD802[\uDEC0-\uDEE6\uDEEB-\uDEF6]' + }, + { + 'name': 'Marchen', + 'astral': '\uD807[\uDC70-\uDC8F\uDC92-\uDCA7\uDCA9-\uDCB6]' + }, + { + 'name': 'Masaram_Gondi', + 'astral': '\uD807[\uDD00-\uDD06\uDD08\uDD09\uDD0B-\uDD36\uDD3A\uDD3C\uDD3D\uDD3F-\uDD47\uDD50-\uDD59]' + }, + { + 'name': 'Medefaidrin', + 'astral': '\uD81B[\uDE40-\uDE9A]' + }, + { + 'name': 'Meetei_Mayek', + 'bmp': '\uAAE0-\uAAF6\uABC0-\uABED\uABF0-\uABF9' + }, + { + 'name': 'Mende_Kikakui', + 'astral': '\uD83A[\uDC00-\uDCC4\uDCC7-\uDCD6]' + }, + { + 'name': 'Meroitic_Cursive', + 'astral': '\uD802[\uDDA0-\uDDB7\uDDBC-\uDDCF\uDDD2-\uDDFF]' + }, + { + 'name': 'Meroitic_Hieroglyphs', + 'astral': '\uD802[\uDD80-\uDD9F]' + }, + { + 'name': 'Miao', + 'astral': '\uD81B[\uDF00-\uDF44\uDF50-\uDF7E\uDF8F-\uDF9F]' + }, + { + 'name': 'Modi', + 'astral': '\uD805[\uDE00-\uDE44\uDE50-\uDE59]' + }, + { + 'name': 'Mongolian', + 'bmp': '\u1800\u1801\u1804\u1806-\u180E\u1810-\u1819\u1820-\u1878\u1880-\u18AA', + 'astral': '\uD805[\uDE60-\uDE6C]' + }, + { + 'name': 'Mro', + 'astral': '\uD81A[\uDE40-\uDE5E\uDE60-\uDE69\uDE6E\uDE6F]' + }, + { + 'name': 'Multani', + 'astral': '\uD804[\uDE80-\uDE86\uDE88\uDE8A-\uDE8D\uDE8F-\uDE9D\uDE9F-\uDEA9]' + }, + { + 'name': 'Myanmar', + 'bmp': '\u1000-\u109F\uA9E0-\uA9FE\uAA60-\uAA7F' + }, + { + 'name': 'Nabataean', + 'astral': '\uD802[\uDC80-\uDC9E\uDCA7-\uDCAF]' + }, + { + 'name': 'New_Tai_Lue', + 'bmp': '\u1980-\u19AB\u19B0-\u19C9\u19D0-\u19DA\u19DE\u19DF' + }, + { + 'name': 'Newa', + 'astral': '\uD805[\uDC00-\uDC59\uDC5B\uDC5D\uDC5E]' + }, + { + 'name': 'Nko', + 'bmp': '\u07C0-\u07FA\u07FD-\u07FF' + }, + { + 'name': 'Nushu', + 'astral': '\uD81B\uDFE1|\uD82C[\uDD70-\uDEFB]' + }, + { + 'name': 'Ogham', + 'bmp': '\u1680-\u169C' + }, + { + 'name': 'Ol_Chiki', + 'bmp': '\u1C50-\u1C7F' + }, + { + 'name': 'Old_Hungarian', + 'astral': '\uD803[\uDC80-\uDCB2\uDCC0-\uDCF2\uDCFA-\uDCFF]' + }, + { + 'name': 'Old_Italic', + 'astral': '\uD800[\uDF00-\uDF23\uDF2D-\uDF2F]' + }, + { + 'name': 'Old_North_Arabian', + 'astral': '\uD802[\uDE80-\uDE9F]' + }, + { + 'name': 'Old_Permic', + 'astral': '\uD800[\uDF50-\uDF7A]' + }, + { + 'name': 'Old_Persian', + 'astral': '\uD800[\uDFA0-\uDFC3\uDFC8-\uDFD5]' + }, + { + 'name': 'Old_Sogdian', + 'astral': '\uD803[\uDF00-\uDF27]' + }, + { + 'name': 'Old_South_Arabian', + 'astral': '\uD802[\uDE60-\uDE7F]' + }, + { + 'name': 'Old_Turkic', + 'astral': '\uD803[\uDC00-\uDC48]' + }, + { + 'name': 'Oriya', + 'bmp': '\u0B01-\u0B03\u0B05-\u0B0C\u0B0F\u0B10\u0B13-\u0B28\u0B2A-\u0B30\u0B32\u0B33\u0B35-\u0B39\u0B3C-\u0B44\u0B47\u0B48\u0B4B-\u0B4D\u0B56\u0B57\u0B5C\u0B5D\u0B5F-\u0B63\u0B66-\u0B77' + }, + { + 'name': 'Osage', + 'astral': '\uD801[\uDCB0-\uDCD3\uDCD8-\uDCFB]' + }, + { + 'name': 'Osmanya', + 'astral': '\uD801[\uDC80-\uDC9D\uDCA0-\uDCA9]' + }, + { + 'name': 'Pahawh_Hmong', + 'astral': '\uD81A[\uDF00-\uDF45\uDF50-\uDF59\uDF5B-\uDF61\uDF63-\uDF77\uDF7D-\uDF8F]' + }, + { + 'name': 'Palmyrene', + 'astral': '\uD802[\uDC60-\uDC7F]' + }, + { + 'name': 'Pau_Cin_Hau', + 'astral': '\uD806[\uDEC0-\uDEF8]' + }, + { + 'name': 'Phags_Pa', + 'bmp': '\uA840-\uA877' + }, + { + 'name': 'Phoenician', + 'astral': '\uD802[\uDD00-\uDD1B\uDD1F]' + }, + { + 'name': 'Psalter_Pahlavi', + 'astral': '\uD802[\uDF80-\uDF91\uDF99-\uDF9C\uDFA9-\uDFAF]' + }, + { + 'name': 'Rejang', + 'bmp': '\uA930-\uA953\uA95F' + }, + { + 'name': 'Runic', + 'bmp': '\u16A0-\u16EA\u16EE-\u16F8' + }, + { + 'name': 'Samaritan', + 'bmp': '\u0800-\u082D\u0830-\u083E' + }, + { + 'name': 'Saurashtra', + 'bmp': '\uA880-\uA8C5\uA8CE-\uA8D9' + }, + { + 'name': 'Sharada', + 'astral': '\uD804[\uDD80-\uDDCD\uDDD0-\uDDDF]' + }, + { + 'name': 'Shavian', + 'astral': '\uD801[\uDC50-\uDC7F]' + }, + { + 'name': 'Siddham', + 'astral': '\uD805[\uDD80-\uDDB5\uDDB8-\uDDDD]' + }, + { + 'name': 'SignWriting', + 'astral': '\uD836[\uDC00-\uDE8B\uDE9B-\uDE9F\uDEA1-\uDEAF]' + }, + { + 'name': 'Sinhala', + 'bmp': '\u0D82\u0D83\u0D85-\u0D96\u0D9A-\u0DB1\u0DB3-\u0DBB\u0DBD\u0DC0-\u0DC6\u0DCA\u0DCF-\u0DD4\u0DD6\u0DD8-\u0DDF\u0DE6-\u0DEF\u0DF2-\u0DF4', + 'astral': '\uD804[\uDDE1-\uDDF4]' + }, + { + 'name': 'Sogdian', + 'astral': '\uD803[\uDF30-\uDF59]' + }, + { + 'name': 'Sora_Sompeng', + 'astral': '\uD804[\uDCD0-\uDCE8\uDCF0-\uDCF9]' + }, + { + 'name': 'Soyombo', + 'astral': '\uD806[\uDE50-\uDE83\uDE86-\uDEA2]' + }, + { + 'name': 'Sundanese', + 'bmp': '\u1B80-\u1BBF\u1CC0-\u1CC7' + }, + { + 'name': 'Syloti_Nagri', + 'bmp': '\uA800-\uA82B' + }, + { + 'name': 'Syriac', + 'bmp': '\u0700-\u070D\u070F-\u074A\u074D-\u074F\u0860-\u086A' + }, + { + 'name': 'Tagalog', + 'bmp': '\u1700-\u170C\u170E-\u1714' + }, + { + 'name': 'Tagbanwa', + 'bmp': '\u1760-\u176C\u176E-\u1770\u1772\u1773' + }, + { + 'name': 'Tai_Le', + 'bmp': '\u1950-\u196D\u1970-\u1974' + }, + { + 'name': 'Tai_Tham', + 'bmp': '\u1A20-\u1A5E\u1A60-\u1A7C\u1A7F-\u1A89\u1A90-\u1A99\u1AA0-\u1AAD' + }, + { + 'name': 'Tai_Viet', + 'bmp': '\uAA80-\uAAC2\uAADB-\uAADF' + }, + { + 'name': 'Takri', + 'astral': '\uD805[\uDE80-\uDEB7\uDEC0-\uDEC9]' + }, + { + 'name': 'Tamil', + 'bmp': '\u0B82\u0B83\u0B85-\u0B8A\u0B8E-\u0B90\u0B92-\u0B95\u0B99\u0B9A\u0B9C\u0B9E\u0B9F\u0BA3\u0BA4\u0BA8-\u0BAA\u0BAE-\u0BB9\u0BBE-\u0BC2\u0BC6-\u0BC8\u0BCA-\u0BCD\u0BD0\u0BD7\u0BE6-\u0BFA' + }, + { + 'name': 'Tangut', + 'astral': '\uD81B\uDFE0|[\uD81C-\uD820][\uDC00-\uDFFF]|\uD821[\uDC00-\uDFF1]|\uD822[\uDC00-\uDEF2]' + }, + { + 'name': 'Telugu', + 'bmp': '\u0C00-\u0C0C\u0C0E-\u0C10\u0C12-\u0C28\u0C2A-\u0C39\u0C3D-\u0C44\u0C46-\u0C48\u0C4A-\u0C4D\u0C55\u0C56\u0C58-\u0C5A\u0C60-\u0C63\u0C66-\u0C6F\u0C78-\u0C7F' + }, + { + 'name': 'Thaana', + 'bmp': '\u0780-\u07B1' + }, + { + 'name': 'Thai', + 'bmp': '\u0E01-\u0E3A\u0E40-\u0E5B' + }, + { + 'name': 'Tibetan', + 'bmp': '\u0F00-\u0F47\u0F49-\u0F6C\u0F71-\u0F97\u0F99-\u0FBC\u0FBE-\u0FCC\u0FCE-\u0FD4\u0FD9\u0FDA' + }, + { + 'name': 'Tifinagh', + 'bmp': '\u2D30-\u2D67\u2D6F\u2D70\u2D7F' + }, + { + 'name': 'Tirhuta', + 'astral': '\uD805[\uDC80-\uDCC7\uDCD0-\uDCD9]' + }, + { + 'name': 'Ugaritic', + 'astral': '\uD800[\uDF80-\uDF9D\uDF9F]' + }, + { + 'name': 'Vai', + 'bmp': '\uA500-\uA62B' + }, + { + 'name': 'Warang_Citi', + 'astral': '\uD806[\uDCA0-\uDCF2\uDCFF]' + }, + { + 'name': 'Yi', + 'bmp': '\uA000-\uA48C\uA490-\uA4C6' + }, + { + 'name': 'Zanabazar_Square', + 'astral': '\uD806[\uDE00-\uDE47]' + } +]; + +var unicodeScripts = createCommonjsModule(function (module, exports) { +"use strict"; + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.default = void 0; + +var _scripts = _interopRequireDefault(scripts); + +function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } + +/*! + * XRegExp Unicode Scripts 4.2.0 + * + * Steven Levithan (c) 2010-present MIT License + * Unicode data by Mathias Bynens + */ +var _default = function _default(XRegExp) { + /** + * Adds support for all Unicode scripts. E.g., `\p{Latin}`. Token names are case insensitive, + * and any spaces, hyphens, and underscores are ignored. + * + * Uses Unicode 11.0.0. + * + * @requires XRegExp, Unicode Base + */ + if (!XRegExp.addUnicodeData) { + throw new ReferenceError('Unicode Base must be loaded before Unicode Scripts'); + } + + XRegExp.addUnicodeData(_scripts.default); +}; + +exports.default = _default; +module.exports = exports["default"]; +}); + +unwrapExports(unicodeScripts); + +var lib = createCommonjsModule(function (module, exports) { +"use strict"; + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.default = void 0; + +var _xregexp = _interopRequireDefault(xregexp); + +var _build = _interopRequireDefault(build); + +var _matchrecursive = _interopRequireDefault(matchrecursive); + +var _unicodeBase = _interopRequireDefault(unicodeBase); + +var _unicodeBlocks = _interopRequireDefault(unicodeBlocks); + +var _unicodeCategories = _interopRequireDefault(unicodeCategories); + +var _unicodeProperties = _interopRequireDefault(unicodeProperties); + +var _unicodeScripts = _interopRequireDefault(unicodeScripts); + +function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } + +(_build.default)(_xregexp.default); +(_matchrecursive.default)(_xregexp.default); +(_unicodeBase.default)(_xregexp.default); +(_unicodeBlocks.default)(_xregexp.default); +(_unicodeCategories.default)(_xregexp.default); +(_unicodeProperties.default)(_xregexp.default); +(_unicodeScripts.default)(_xregexp.default); +var _default = _xregexp.default; +exports.default = _default; +module.exports = exports["default"]; +}); + +unwrapExports(lib); + +var utilities = createCommonjsModule(function (module, exports) { +"use strict"; +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +Object.defineProperty(exports, "__esModule", { value: true }); + +class Match { + constructor(index, length, value, groups) { + this.index = index; + this.length = length; + this.value = value; + this.innerGroups = groups; + } + groups(key) { + return this.innerGroups[key] ? this.innerGroups[key] : { value: '', index: 0, length: 0, captures: [] }; + } +} +exports.Match = Match; +class ConditionalMatch { + constructor(match, success) { + this.match = match; + this.success = success; + } +} +exports.ConditionalMatch = ConditionalMatch; +class RegExpUtility { + static getMatches(regex, source) { + if (!regex) { + return []; + } + return this.getMatchesSimple(regex, source); + } + static getMatchEnd(regex, source, trim) { + let match = this.getMatches(regex, source).pop(); + let strAfter = ""; + if (match) { + strAfter = source.substring(match.index + match.length); + if (trim) { + strAfter = strAfter.trim(); + } + } + return new ConditionalMatch(match, match && StringUtility.isNullOrEmpty(strAfter)); + } + static getMatchesSimple(regex, source) { + // Word boundary (\b) in JS is not unicode-aware, so words starting/ending with accentuated characters will not match + // use a normalized string to match, the return matches' values using the original one + // http://blog.stevenlevithan.com/archives/javascript-regex-and-unicode + // https://stackoverflow.com/questions/2881445/utf-8-word-boundary-regex-in-javascript + let normalized = StringUtility.removeDiacriticsFromWordBoundaries(source); + let matches = new Array(); + lib.forEach(normalized, regex, match => { + let groups = {}; + Object.keys(match).forEach(key => { + let groupKey = key.substr(0, key.lastIndexOf('__')); + if (!groups[groupKey]) { + groups[groupKey] = { value: '', index: 0, length: 0, captures: [] }; + } + if (match[key]) { + let index = match.index + match[0].indexOf(match[key]); + let length = match[key].length; + let value = source.substr(index, length); + groups[groupKey].index = index; + groups[groupKey].length = length; + groups[groupKey].value = value; + groups[groupKey].captures.push(value); + } + }); + let value = match[0]; + let index = match.index; + let length = value.length; + value = source.substr(index, length); + matches.push(new Match(index, length, value, groups)); + }); + return matches; + } + static getSafeRegExp(source, flags) { + let sanitizedSource = this.sanitizeGroups(source); + return lib(sanitizedSource, flags || 'gis'); + } + static getFirstMatchIndex(regex, source) { + let matches = RegExpUtility.getMatches(regex, source); + if (matches.length) { + return { + matched: true, + index: matches[0].index, + value: matches[0].value + }; + } + return { matched: false, index: -1, value: null }; + } + static split(regex, source) { + return lib.split(source, regex); + } + static isMatch(regex, source) { + return !StringUtility.isNullOrEmpty(source) + && this.getMatches(regex, source).length > 0; + } + static sanitizeGroups(source) { + let index = 0; + let result = lib.replace(source, this.matchGroup, (match, name) => match.replace(name, `${name}__${index++}`)); + return result; + } + static getNextRegex(source, startPos) { + startPos = RegExpUtility.getClosePos(source, startPos) + 1; + let closePos = RegExpUtility.getClosePos(source, startPos); + if (source[startPos] !== '(') { + closePos--; + } + let next = (startPos === closePos) + ? null + : source.substring(startPos, closePos + 1); + return next; + } + static getClosePos(source, startPos) { + let counter = 1; + let closePos = startPos; + while (counter > 0 && closePos < source.length) { + let c = source[++closePos]; + if (c === '(') { + counter++; + } + else if (c === ')') { + counter--; + } + } + return closePos; + } +} +RegExpUtility.matchGroup = lib(String.raw `\?<(?\w+)>`, 'gis'); +RegExpUtility.matchPositiveLookbehind = lib(String.raw `\(\?<=`, 'gis'); +RegExpUtility.matchNegativeLookbehind = lib(String.raw `\(\? { + result = QueryProcessor.applyReverse(match.index, result, match.value); + }); + return result; + } +} +QueryProcessor.Expression = `(?<=(\\s|\\d))(kB|K[Bb]?|M[BbM]?|G[Bb]?|B)\\b`; +QueryProcessor.SpecialTokensRegex = RegExpUtility.getSafeRegExp(QueryProcessor.Expression, "gs"); +exports.QueryProcessor = QueryProcessor; +class StringUtility { + static isNullOrWhitespace(input) { + return !input || !input.trim(); + } + static isNullOrEmpty(input) { + return !input || input === ''; + } + static isWhitespace(input) { + return input && input !== '' && !input.trim(); + } + static insertInto(input, value, index) { + return input.substr(0, index) + value + input.substr(index); + } + static removeDiacriticsFromWordBoundaries(input) { + return input.split(' ') + .map((s) => { + let length = s.length; + if (length === 0) { + return s; + } + let first = StringUtility.removeDiacritics(s.substring(0, 1)); + if (length === 1) { + return first; + } + let last = length > 1 ? StringUtility.removeDiacritics(s.substring(length - 1)) : ''; + let mid = s.substring(1, length - 1); + // console.log(first + mid + last) + return first + mid + last; + }) + .join(' '); + } + static removeDiacritics(c) { + let clean = StringUtility.diacriticsRemovalMap[c]; + return !clean ? c : clean; + } +} +StringUtility.diacriticsRemovalMap = { + "Ⓐ": "A", + "A": "A", + "À": "A", + "Á": "A", + "Â": "A", + "Ầ": "A", + "Ấ": "A", + "Ẫ": "A", + "Ẩ": "A", + "Ã": "A", + "Ā": "A", + "Ă": "A", + "Ằ": "A", + "Ắ": "A", + "Ẵ": "A", + "Ẳ": "A", + "Ȧ": "A", + "Ǡ": "A", + "Ä": "A", + "Ǟ": "A", + "Ả": "A", + "Å": "A", + "Ǻ": "A", + "Ǎ": "A", + "Ȁ": "A", + "Ȃ": "A", + "Ạ": "A", + "Ậ": "A", + "Ặ": "A", + "Ḁ": "A", + "Ą": "A", + "Ⱥ": "A", + "Ɐ": "A", + "Ⓑ": "B", + "B": "B", + "Ḃ": "B", + "Ḅ": "B", + "Ḇ": "B", + "Ƀ": "B", + "Ƃ": "B", + "Ɓ": "B", + "Ⓒ": "C", + "C": "C", + "Ć": "C", + "Ĉ": "C", + "Ċ": "C", + "Č": "C", + "Ç": "C", + "Ḉ": "C", + "Ƈ": "C", + "Ȼ": "C", + "Ꜿ": "C", + "Ⓓ": "D", + "D": "D", + "Ḋ": "D", + "Ď": "D", + "Ḍ": "D", + "Ḑ": "D", + "Ḓ": "D", + "Ḏ": "D", + "Đ": "D", + "Ƌ": "D", + "Ɗ": "D", + "Ɖ": "D", + "Ꝺ": "D", + "Ⓔ": "E", + "E": "E", + "È": "E", + "É": "E", + "Ê": "E", + "Ề": "E", + "Ế": "E", + "Ễ": "E", + "Ể": "E", + "Ẽ": "E", + "Ē": "E", + "Ḕ": "E", + "Ḗ": "E", + "Ĕ": "E", + "Ė": "E", + "Ë": "E", + "Ẻ": "E", + "Ě": "E", + "Ȅ": "E", + "Ȇ": "E", + "Ẹ": "E", + "Ệ": "E", + "Ȩ": "E", + "Ḝ": "E", + "Ę": "E", + "Ḙ": "E", + "Ḛ": "E", + "Ɛ": "E", + "Ǝ": "E", + "Ⓕ": "F", + "F": "F", + "Ḟ": "F", + "Ƒ": "F", + "Ꝼ": "F", + "Ⓖ": "G", + "G": "G", + "Ǵ": "G", + "Ĝ": "G", + "Ḡ": "G", + "Ğ": "G", + "Ġ": "G", + "Ǧ": "G", + "Ģ": "G", + "Ǥ": "G", + "Ɠ": "G", + "Ꞡ": "G", + "Ᵹ": "G", + "Ꝿ": "G", + "Ⓗ": "H", + "H": "H", + "Ĥ": "H", + "Ḣ": "H", + "Ḧ": "H", + "Ȟ": "H", + "Ḥ": "H", + "Ḩ": "H", + "Ḫ": "H", + "Ħ": "H", + "Ⱨ": "H", + "Ⱶ": "H", + "Ɥ": "H", + "Ⓘ": "I", + "I": "I", + "Ì": "I", + "Í": "I", + "Î": "I", + "Ĩ": "I", + "Ī": "I", + "Ĭ": "I", + "İ": "I", + "Ï": "I", + "Ḯ": "I", + "Ỉ": "I", + "Ǐ": "I", + "Ȉ": "I", + "Ȋ": "I", + "Ị": "I", + "Į": "I", + "Ḭ": "I", + "Ɨ": "I", + "Ⓙ": "J", + "J": "J", + "Ĵ": "J", + "Ɉ": "J", + "Ⓚ": "K", + "K": "K", + "Ḱ": "K", + "Ǩ": "K", + "Ḳ": "K", + "Ķ": "K", + "Ḵ": "K", + "Ƙ": "K", + "Ⱪ": "K", + "Ꝁ": "K", + "Ꝃ": "K", + "Ꝅ": "K", + "Ꞣ": "K", + "Ⓛ": "L", + "L": "L", + "Ŀ": "L", + "Ĺ": "L", + "Ľ": "L", + "Ḷ": "L", + "Ḹ": "L", + "Ļ": "L", + "Ḽ": "L", + "Ḻ": "L", + "Ł": "L", + "Ƚ": "L", + "Ɫ": "L", + "Ⱡ": "L", + "Ꝉ": "L", + "Ꝇ": "L", + "Ꞁ": "L", + "Ⓜ": "M", + "M": "M", + "Ḿ": "M", + "Ṁ": "M", + "Ṃ": "M", + "Ɱ": "M", + "Ɯ": "M", + "Ⓝ": "N", + "N": "N", + "Ǹ": "N", + "Ń": "N", + "Ñ": "N", + "Ṅ": "N", + "Ň": "N", + "Ṇ": "N", + "Ņ": "N", + "Ṋ": "N", + "Ṉ": "N", + "Ƞ": "N", + "Ɲ": "N", + "Ꞑ": "N", + "Ꞥ": "N", + "Ⓞ": "O", + "O": "O", + "Ò": "O", + "Ó": "O", + "Ô": "O", + "Ồ": "O", + "Ố": "O", + "Ỗ": "O", + "Ổ": "O", + "Õ": "O", + "Ṍ": "O", + "Ȭ": "O", + "Ṏ": "O", + "Ō": "O", + "Ṑ": "O", + "Ṓ": "O", + "Ŏ": "O", + "Ȯ": "O", + "Ȱ": "O", + "Ö": "O", + "Ȫ": "O", + "Ỏ": "O", + "Ő": "O", + "Ǒ": "O", + "Ȍ": "O", + "Ȏ": "O", + "Ơ": "O", + "Ờ": "O", + "Ớ": "O", + "Ỡ": "O", + "Ở": "O", + "Ợ": "O", + "Ọ": "O", + "Ộ": "O", + "Ǫ": "O", + "Ǭ": "O", + "Ø": "O", + "Ǿ": "O", + "Ɔ": "O", + "Ɵ": "O", + "Ꝋ": "O", + "Ꝍ": "O", + "Ⓟ": "P", + "P": "P", + "Ṕ": "P", + "Ṗ": "P", + "Ƥ": "P", + "Ᵽ": "P", + "Ꝑ": "P", + "Ꝓ": "P", + "Ꝕ": "P", + "Ⓠ": "Q", + "Q": "Q", + "Ꝗ": "Q", + "Ꝙ": "Q", + "Ɋ": "Q", + "Ⓡ": "R", + "R": "R", + "Ŕ": "R", + "Ṙ": "R", + "Ř": "R", + "Ȑ": "R", + "Ȓ": "R", + "Ṛ": "R", + "Ṝ": "R", + "Ŗ": "R", + "Ṟ": "R", + "Ɍ": "R", + "Ɽ": "R", + "Ꝛ": "R", + "Ꞧ": "R", + "Ꞃ": "R", + "Ⓢ": "S", + "S": "S", + "ẞ": "S", + "Ś": "S", + "Ṥ": "S", + "Ŝ": "S", + "Ṡ": "S", + "Š": "S", + "Ṧ": "S", + "Ṣ": "S", + "Ṩ": "S", + "Ș": "S", + "Ş": "S", + "Ȿ": "S", + "Ꞩ": "S", + "Ꞅ": "S", + "Ⓣ": "T", + "T": "T", + "Ṫ": "T", + "Ť": "T", + "Ṭ": "T", + "Ț": "T", + "Ţ": "T", + "Ṱ": "T", + "Ṯ": "T", + "Ŧ": "T", + "Ƭ": "T", + "Ʈ": "T", + "Ⱦ": "T", + "Ꞇ": "T", + "Ⓤ": "U", + "U": "U", + "Ù": "U", + "Ú": "U", + "Û": "U", + "Ũ": "U", + "Ṹ": "U", + "Ū": "U", + "Ṻ": "U", + "Ŭ": "U", + "Ü": "U", + "Ǜ": "U", + "Ǘ": "U", + "Ǖ": "U", + "Ǚ": "U", + "Ủ": "U", + "Ů": "U", + "Ű": "U", + "Ǔ": "U", + "Ȕ": "U", + "Ȗ": "U", + "Ư": "U", + "Ừ": "U", + "Ứ": "U", + "Ữ": "U", + "Ử": "U", + "Ự": "U", + "Ụ": "U", + "Ṳ": "U", + "Ų": "U", + "Ṷ": "U", + "Ṵ": "U", + "Ʉ": "U", + "Ⓥ": "V", + "V": "V", + "Ṽ": "V", + "Ṿ": "V", + "Ʋ": "V", + "Ꝟ": "V", + "Ʌ": "V", + "Ⓦ": "W", + "W": "W", + "Ẁ": "W", + "Ẃ": "W", + "Ŵ": "W", + "Ẇ": "W", + "Ẅ": "W", + "Ẉ": "W", + "Ⱳ": "W", + "Ⓧ": "X", + "X": "X", + "Ẋ": "X", + "Ẍ": "X", + "Ⓨ": "Y", + "Y": "Y", + "Ỳ": "Y", + "Ý": "Y", + "Ŷ": "Y", + "Ỹ": "Y", + "Ȳ": "Y", + "Ẏ": "Y", + "Ÿ": "Y", + "Ỷ": "Y", + "Ỵ": "Y", + "Ƴ": "Y", + "Ɏ": "Y", + "Ỿ": "Y", + "Ⓩ": "Z", + "Z": "Z", + "Ź": "Z", + "Ẑ": "Z", + "Ż": "Z", + "Ž": "Z", + "Ẓ": "Z", + "Ẕ": "Z", + "Ƶ": "Z", + "Ȥ": "Z", + "Ɀ": "Z", + "Ⱬ": "Z", + "Ꝣ": "Z", + "ⓐ": "a", + "a": "a", + "ẚ": "a", + "à": "a", + "á": "a", + "â": "a", + "ầ": "a", + "ấ": "a", + "ẫ": "a", + "ẩ": "a", + "ã": "a", + "ā": "a", + "ă": "a", + "ằ": "a", + "ắ": "a", + "ẵ": "a", + "ẳ": "a", + "ȧ": "a", + "ǡ": "a", + "ä": "a", + "ǟ": "a", + "ả": "a", + "å": "a", + "ǻ": "a", + "ǎ": "a", + "ȁ": "a", + "ȃ": "a", + "ạ": "a", + "ậ": "a", + "ặ": "a", + "ḁ": "a", + "ą": "a", + "ⱥ": "a", + "ɐ": "a", + "ⓑ": "b", + "b": "b", + "ḃ": "b", + "ḅ": "b", + "ḇ": "b", + "ƀ": "b", + "ƃ": "b", + "ɓ": "b", + "ⓒ": "c", + "c": "c", + "ć": "c", + "ĉ": "c", + "ċ": "c", + "č": "c", + "ç": "c", + "ḉ": "c", + "ƈ": "c", + "ȼ": "c", + "ꜿ": "c", + "ↄ": "c", + "ⓓ": "d", + "d": "d", + "ḋ": "d", + "ď": "d", + "ḍ": "d", + "ḑ": "d", + "ḓ": "d", + "ḏ": "d", + "đ": "d", + "ƌ": "d", + "ɖ": "d", + "ɗ": "d", + "ꝺ": "d", + "ⓔ": "e", + "e": "e", + "è": "e", + "é": "e", + "ê": "e", + "ề": "e", + "ế": "e", + "ễ": "e", + "ể": "e", + "ẽ": "e", + "ē": "e", + "ḕ": "e", + "ḗ": "e", + "ĕ": "e", + "ė": "e", + "ë": "e", + "ẻ": "e", + "ě": "e", + "ȅ": "e", + "ȇ": "e", + "ẹ": "e", + "ệ": "e", + "ȩ": "e", + "ḝ": "e", + "ę": "e", + "ḙ": "e", + "ḛ": "e", + "ɇ": "e", + "ɛ": "e", + "ǝ": "e", + "ⓕ": "f", + "f": "f", + "ḟ": "f", + "ƒ": "f", + "ꝼ": "f", + "ⓖ": "g", + "g": "g", + "ǵ": "g", + "ĝ": "g", + "ḡ": "g", + "ğ": "g", + "ġ": "g", + "ǧ": "g", + "ģ": "g", + "ǥ": "g", + "ɠ": "g", + "ꞡ": "g", + "ᵹ": "g", + "ꝿ": "g", + "ⓗ": "h", + "h": "h", + "ĥ": "h", + "ḣ": "h", + "ḧ": "h", + "ȟ": "h", + "ḥ": "h", + "ḩ": "h", + "ḫ": "h", + "ẖ": "h", + "ħ": "h", + "ⱨ": "h", + "ⱶ": "h", + "ɥ": "h", + "ⓘ": "i", + "i": "i", + "ì": "i", + "í": "i", + "î": "i", + "ĩ": "i", + "ī": "i", + "ĭ": "i", + "ï": "i", + "ḯ": "i", + "ỉ": "i", + "ǐ": "i", + "ȉ": "i", + "ȋ": "i", + "ị": "i", + "į": "i", + "ḭ": "i", + "ɨ": "i", + "ı": "i", + "ⓙ": "j", + "j": "j", + "ĵ": "j", + "ǰ": "j", + "ɉ": "j", + "ⓚ": "k", + "k": "k", + "ḱ": "k", + "ǩ": "k", + "ḳ": "k", + "ķ": "k", + "ḵ": "k", + "ƙ": "k", + "ⱪ": "k", + "ꝁ": "k", + "ꝃ": "k", + "ꝅ": "k", + "ꞣ": "k", + "ⓛ": "l", + "l": "l", + "ŀ": "l", + "ĺ": "l", + "ľ": "l", + "ḷ": "l", + "ḹ": "l", + "ļ": "l", + "ḽ": "l", + "ḻ": "l", + "ſ": "l", + "ł": "l", + "ƚ": "l", + "ɫ": "l", + "ⱡ": "l", + "ꝉ": "l", + "ꞁ": "l", + "ꝇ": "l", + "ⓜ": "m", + "m": "m", + "ḿ": "m", + "ṁ": "m", + "ṃ": "m", + "ɱ": "m", + "ɯ": "m", + "ⓝ": "n", + "n": "n", + "ǹ": "n", + "ń": "n", + "ñ": "n", + "ṅ": "n", + "ň": "n", + "ṇ": "n", + "ņ": "n", + "ṋ": "n", + "ṉ": "n", + "ƞ": "n", + "ɲ": "n", + "ʼn": "n", + "ꞑ": "n", + "ꞥ": "n", + "ⓞ": "o", + "o": "o", + "ò": "o", + "ó": "o", + "ô": "o", + "ồ": "o", + "ố": "o", + "ỗ": "o", + "ổ": "o", + "õ": "o", + "ṍ": "o", + "ȭ": "o", + "ṏ": "o", + "ō": "o", + "ṑ": "o", + "ṓ": "o", + "ŏ": "o", + "ȯ": "o", + "ȱ": "o", + "ö": "o", + "ȫ": "o", + "ỏ": "o", + "ő": "o", + "ǒ": "o", + "ȍ": "o", + "ȏ": "o", + "ơ": "o", + "ờ": "o", + "ớ": "o", + "ỡ": "o", + "ở": "o", + "ợ": "o", + "ọ": "o", + "ộ": "o", + "ǫ": "o", + "ǭ": "o", + "ø": "o", + "ǿ": "o", + "ɔ": "o", + "ꝋ": "o", + "ꝍ": "o", + "ɵ": "o", + "ⓟ": "p", + "p": "p", + "ṕ": "p", + "ṗ": "p", + "ƥ": "p", + "ᵽ": "p", + "ꝑ": "p", + "ꝓ": "p", + "ꝕ": "p", + "ⓠ": "q", + "q": "q", + "ɋ": "q", + "ꝗ": "q", + "ꝙ": "q", + "ⓡ": "r", + "r": "r", + "ŕ": "r", + "ṙ": "r", + "ř": "r", + "ȑ": "r", + "ȓ": "r", + "ṛ": "r", + "ṝ": "r", + "ŗ": "r", + "ṟ": "r", + "ɍ": "r", + "ɽ": "r", + "ꝛ": "r", + "ꞧ": "r", + "ꞃ": "r", + "ⓢ": "s", + "s": "s", + "ß": "s", + "ś": "s", + "ṥ": "s", + "ŝ": "s", + "ṡ": "s", + "š": "s", + "ṧ": "s", + "ṣ": "s", + "ṩ": "s", + "ș": "s", + "ş": "s", + "ȿ": "s", + "ꞩ": "s", + "ꞅ": "s", + "ẛ": "s", + "ⓣ": "t", + "t": "t", + "ṫ": "t", + "ẗ": "t", + "ť": "t", + "ṭ": "t", + "ț": "t", + "ţ": "t", + "ṱ": "t", + "ṯ": "t", + "ŧ": "t", + "ƭ": "t", + "ʈ": "t", + "ⱦ": "t", + "ꞇ": "t", + "ⓤ": "u", + "u": "u", + "ù": "u", + "ú": "u", + "û": "u", + "ũ": "u", + "ṹ": "u", + "ū": "u", + "ṻ": "u", + "ŭ": "u", + "ü": "u", + "ǜ": "u", + "ǘ": "u", + "ǖ": "u", + "ǚ": "u", + "ủ": "u", + "ů": "u", + "ű": "u", + "ǔ": "u", + "ȕ": "u", + "ȗ": "u", + "ư": "u", + "ừ": "u", + "ứ": "u", + "ữ": "u", + "ử": "u", + "ự": "u", + "ụ": "u", + "ṳ": "u", + "ų": "u", + "ṷ": "u", + "ṵ": "u", + "ʉ": "u", + "ⓥ": "v", + "v": "v", + "ṽ": "v", + "ṿ": "v", + "ʋ": "v", + "ꝟ": "v", + "ʌ": "v", + "ⓦ": "w", + "w": "w", + "ẁ": "w", + "ẃ": "w", + "ŵ": "w", + "ẇ": "w", + "ẅ": "w", + "ẘ": "w", + "ẉ": "w", + "ⱳ": "w", + "ⓧ": "x", + "x": "x", + "ẋ": "x", + "ẍ": "x", + "ⓨ": "y", + "y": "y", + "ỳ": "y", + "ý": "y", + "ŷ": "y", + "ỹ": "y", + "ȳ": "y", + "ẏ": "y", + "ÿ": "y", + "ỷ": "y", + "ẙ": "y", + "ỵ": "y", + "ƴ": "y", + "ɏ": "y", + "ỿ": "y", + "ⓩ": "z", + "z": "z", + "ź": "z", + "ẑ": "z", + "ż": "z", + "ž": "z", + "ẓ": "z", + "ẕ": "z", + "ƶ": "z", + "ȥ": "z", + "ɀ": "z", + "ⱬ": "z", + "ꝣ": "z" +}; +exports.StringUtility = StringUtility; + +}); + +unwrapExports(utilities); + +var models = createCommonjsModule(function (module, exports) { +"use strict"; +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +Object.defineProperty(exports, "__esModule", { value: true }); + + +class ModelResult { +} +exports.ModelResult = ModelResult; +class ExtendedModelResult extends ModelResult { + constructor(source = null) { + super(); + if (source) { + this.text = source.text; + this.start = source.start; + this.end = source.end; + this.typeName = source.typeName; + this.resolution = source.resolution; + } + } +} +exports.ExtendedModelResult = ExtendedModelResult; +class ModelFactoryKey { + constructor(culture$$1, modelType, options = null) { + this.culture = culture$$1 ? culture$$1.toLowerCase() : null; + this.modelType = modelType; + this.options = options; + } + toString() { + return JSON.stringify(this); + } + static fromString(key) { + return JSON.parse(key); + } +} +class ModelFactory { + constructor() { + this.modelFactories = new Map(); + } + getModel(modelTypeName, culture$$1, fallbackToDefaultCulture, options) { + let result = this.tryGetModel(modelTypeName, culture$$1, options); + if (!result.containsModel && fallbackToDefaultCulture) { + result = this.tryGetModel(modelTypeName, ModelFactory.fallbackCulture, options); + } + if (result.containsModel) { + return result.model; + } + throw new Error(`Could not find Model with the specified configuration: ${culture$$1},${modelTypeName}`); + } + tryGetModel(modelTypeName, culture$$1, options) { + culture$$1 = culture.Culture.mapToNearestLanguage(culture$$1); + let cacheResult = this.getModelFromCache(modelTypeName, culture$$1, options); + if (cacheResult) { + return { containsModel: true, model: cacheResult }; + } + let key = this.generateKey(modelTypeName, culture$$1); + if (this.modelFactories.has(key)) { + let model = this.modelFactories.get(key)(options); + this.registerModelInCache(modelTypeName, culture$$1, options, model); + return { containsModel: true, model: model }; + } + return { containsModel: false }; + } + registerModel(modelTypeName, culture$$1, modelCreator) { + let key = this.generateKey(modelTypeName, culture$$1); + if (this.modelFactories.has(key)) { + throw new Error(`${culture$$1}-${modelTypeName} has already been registered.`); + } + this.modelFactories.set(key, modelCreator); + } + initializeModels(targetCulture, options) { + this.modelFactories.forEach((value, key) => { + let modelFactoryKey = ModelFactoryKey.fromString(key); + if (utilities.StringUtility.isNullOrEmpty(targetCulture) || modelFactoryKey.culture === targetCulture) { + this.tryGetModel(modelFactoryKey.modelType, modelFactoryKey.culture, modelFactoryKey.options); + } + }); + } + generateKey(modelTypeName, culture$$1) { + return new ModelFactoryKey(culture$$1, modelTypeName).toString(); + } + getModelFromCache(modelTypeName, culture$$1, options) { + let key = this.generateCacheKey(modelTypeName, culture$$1, options); + return ModelFactory.cache.get(key); + } + registerModelInCache(modelTypeName, culture$$1, options, model) { + let key = this.generateCacheKey(modelTypeName, culture$$1, options); + ModelFactory.cache.set(key, model); + } + generateCacheKey(modelTypeName, culture$$1, options) { + return new ModelFactoryKey(culture$$1, modelTypeName, options).toString(); + } +} +ModelFactory.fallbackCulture = culture.Culture.English; +ModelFactory.cache = new Map(); +exports.ModelFactory = ModelFactory; + +}); + +unwrapExports(models); + +var recognizer = createCommonjsModule(function (module, exports) { +"use strict"; +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +Object.defineProperty(exports, "__esModule", { value: true }); + +class Recognizer { + constructor(targetCulture, options, lazyInitialization) { + this.modelFactory = new models.ModelFactory(); + if (!this.IsValidOptions(options)) { + throw new Error(`${options} is not a valid options value.`); + } + this.TargetCulture = targetCulture; + this.Options = options; + this.InitializeConfiguration(); + if (!lazyInitialization) { + this.initializeModels(targetCulture, options); + } + } + getModel(modelTypeName, culture, fallbackToDefaultCulture) { + return this.modelFactory.getModel(modelTypeName, culture || this.TargetCulture, fallbackToDefaultCulture, this.Options); + } + registerModel(modelTypeName, culture, modelCreator) { + this.modelFactory.registerModel(modelTypeName, culture, modelCreator); + } + initializeModels(targetCulture, options) { + this.modelFactory.initializeModels(targetCulture, options); + } +} +exports.Recognizer = Recognizer; + +}); + +unwrapExports(recognizer); + +var extractors = createCommonjsModule(function (module, exports) { +"use strict"; +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +Object.defineProperty(exports, "__esModule", { value: true }); +class ExtractResult { + static isOverlap(erA, erB) { + return !(erA.start >= erB.start + erB.length) && !(erB.start >= erA.start + erA.length); + } + static isCover(er1, er2) { + return ((er2.start < er1.start) && ((er2.start + er2.length) >= (er1.start + er1.length))) + || ((er2.start <= er1.start) && ((er2.start + er2.length) > (er1.start + er1.length))); + } + static getFromText(source) { + return { + start: 0, + length: source.length, + text: source, + type: 'custom' + }; + } +} +exports.ExtractResult = ExtractResult; + +}); + +unwrapExports(extractors); + +var parsers = createCommonjsModule(function (module, exports) { +"use strict"; +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +Object.defineProperty(exports, "__esModule", { value: true }); + +class ParseResult extends extractors.ExtractResult { + constructor(er) { + super(); + if (er) { + this.length = er.length; + this.start = er.start; + this.data = er.data; + this.text = er.text; + this.type = er.type; + } + this.resolutionStr = ""; + } +} +exports.ParseResult = ParseResult; + +}); + +unwrapExports(parsers); + +var metaData = createCommonjsModule(function (module, exports) { +"use strict"; +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +Object.defineProperty(exports, "__esModule", { value: true }); +class MetaData { + constructor() { + this.isHoliday = false; + this.hasMod = false; + this.isDurationWithAgoAndLater = false; + } + get IsHoliday() { + return this.isHoliday; + } + set IsHoliday(isHoliday) { + this.isHoliday = isHoliday; + } + get HasMod() { + return this.hasMod; + } + set HasMod(hasMod) { + this.hasMod = hasMod; + } + get IsDurationWithAgoAndLater() { + return this.isDurationWithAgoAndLater; + } + set IsDurationWithAgoAndLater(isDurationWithAgoAndLater) { + this.isDurationWithAgoAndLater = isDurationWithAgoAndLater; + } +} +exports.MetaData = MetaData; + +}); + +unwrapExports(metaData); + +var recognizersText = createCommonjsModule(function (module, exports) { +"use strict"; +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +Object.defineProperty(exports, "__esModule", { value: true }); + +exports.Culture = culture.Culture; +exports.CultureInfo = culture.CultureInfo; + +exports.ModelResult = models.ModelResult; +exports.ModelFactory = models.ModelFactory; + +exports.Recognizer = recognizer.Recognizer; + +exports.ExtractResult = extractors.ExtractResult; + +exports.ParseResult = parsers.ParseResult; + +exports.MetaData = metaData.MetaData; + +exports.QueryProcessor = utilities.QueryProcessor; +exports.StringUtility = utilities.StringUtility; +exports.Match = utilities.Match; +exports.RegExpUtility = utilities.RegExpUtility; + +}); + +unwrapExports(recognizersText); + +var lodash = createCommonjsModule(function (module, exports) { +/** + * @license + * Lodash + * Copyright OpenJS Foundation and other contributors + * Released under MIT license + * Based on Underscore.js 1.8.3 + * Copyright Jeremy Ashkenas, DocumentCloud and Investigative Reporters & Editors + */ +(function() { + + /** Used as a safe reference for `undefined` in pre-ES5 environments. */ + var undefined; + + /** Used as the semantic version number. */ + var VERSION = '4.17.21'; + + /** Used as the size to enable large array optimizations. */ + var LARGE_ARRAY_SIZE = 200; + + /** Error message constants. */ + var CORE_ERROR_TEXT = 'Unsupported core-js use. Try https://npms.io/search?q=ponyfill.', + FUNC_ERROR_TEXT = 'Expected a function', + INVALID_TEMPL_VAR_ERROR_TEXT = 'Invalid `variable` option passed into `_.template`'; + + /** Used to stand-in for `undefined` hash values. */ + var HASH_UNDEFINED = '__lodash_hash_undefined__'; + + /** Used as the maximum memoize cache size. */ + var MAX_MEMOIZE_SIZE = 500; + + /** Used as the internal argument placeholder. */ + var PLACEHOLDER = '__lodash_placeholder__'; + + /** Used to compose bitmasks for cloning. */ + var CLONE_DEEP_FLAG = 1, + CLONE_FLAT_FLAG = 2, + CLONE_SYMBOLS_FLAG = 4; + + /** Used to compose bitmasks for value comparisons. */ + var COMPARE_PARTIAL_FLAG = 1, + COMPARE_UNORDERED_FLAG = 2; + + /** Used to compose bitmasks for function metadata. */ + var WRAP_BIND_FLAG = 1, + WRAP_BIND_KEY_FLAG = 2, + WRAP_CURRY_BOUND_FLAG = 4, + WRAP_CURRY_FLAG = 8, + WRAP_CURRY_RIGHT_FLAG = 16, + WRAP_PARTIAL_FLAG = 32, + WRAP_PARTIAL_RIGHT_FLAG = 64, + WRAP_ARY_FLAG = 128, + WRAP_REARG_FLAG = 256, + WRAP_FLIP_FLAG = 512; + + /** Used as default options for `_.truncate`. */ + var DEFAULT_TRUNC_LENGTH = 30, + DEFAULT_TRUNC_OMISSION = '...'; + + /** Used to detect hot functions by number of calls within a span of milliseconds. */ + var HOT_COUNT = 800, + HOT_SPAN = 16; + + /** Used to indicate the type of lazy iteratees. */ + var LAZY_FILTER_FLAG = 1, + LAZY_MAP_FLAG = 2, + LAZY_WHILE_FLAG = 3; + + /** Used as references for various `Number` constants. */ + var INFINITY = 1 / 0, + MAX_SAFE_INTEGER = 9007199254740991, + MAX_INTEGER = 1.7976931348623157e+308, + NAN = 0 / 0; + + /** Used as references for the maximum length and index of an array. */ + var MAX_ARRAY_LENGTH = 4294967295, + MAX_ARRAY_INDEX = MAX_ARRAY_LENGTH - 1, + HALF_MAX_ARRAY_LENGTH = MAX_ARRAY_LENGTH >>> 1; + + /** Used to associate wrap methods with their bit flags. */ + var wrapFlags = [ + ['ary', WRAP_ARY_FLAG], + ['bind', WRAP_BIND_FLAG], + ['bindKey', WRAP_BIND_KEY_FLAG], + ['curry', WRAP_CURRY_FLAG], + ['curryRight', WRAP_CURRY_RIGHT_FLAG], + ['flip', WRAP_FLIP_FLAG], + ['partial', WRAP_PARTIAL_FLAG], + ['partialRight', WRAP_PARTIAL_RIGHT_FLAG], + ['rearg', WRAP_REARG_FLAG] + ]; + + /** `Object#toString` result references. */ + var argsTag = '[object Arguments]', + arrayTag = '[object Array]', + asyncTag = '[object AsyncFunction]', + boolTag = '[object Boolean]', + dateTag = '[object Date]', + domExcTag = '[object DOMException]', + errorTag = '[object Error]', + funcTag = '[object Function]', + genTag = '[object GeneratorFunction]', + mapTag = '[object Map]', + numberTag = '[object Number]', + nullTag = '[object Null]', + objectTag = '[object Object]', + promiseTag = '[object Promise]', + proxyTag = '[object Proxy]', + regexpTag = '[object RegExp]', + setTag = '[object Set]', + stringTag = '[object String]', + symbolTag = '[object Symbol]', + undefinedTag = '[object Undefined]', + weakMapTag = '[object WeakMap]', + weakSetTag = '[object WeakSet]'; + + var arrayBufferTag = '[object ArrayBuffer]', + dataViewTag = '[object DataView]', + float32Tag = '[object Float32Array]', + float64Tag = '[object Float64Array]', + int8Tag = '[object Int8Array]', + int16Tag = '[object Int16Array]', + int32Tag = '[object Int32Array]', + uint8Tag = '[object Uint8Array]', + uint8ClampedTag = '[object Uint8ClampedArray]', + uint16Tag = '[object Uint16Array]', + uint32Tag = '[object Uint32Array]'; + + /** Used to match empty string literals in compiled template source. */ + var reEmptyStringLeading = /\b__p \+= '';/g, + reEmptyStringMiddle = /\b(__p \+=) '' \+/g, + reEmptyStringTrailing = /(__e\(.*?\)|\b__t\)) \+\n'';/g; + + /** Used to match HTML entities and HTML characters. */ + var reEscapedHtml = /&(?:amp|lt|gt|quot|#39);/g, + reUnescapedHtml = /[&<>"']/g, + reHasEscapedHtml = RegExp(reEscapedHtml.source), + reHasUnescapedHtml = RegExp(reUnescapedHtml.source); + + /** Used to match template delimiters. */ + var reEscape = /<%-([\s\S]+?)%>/g, + reEvaluate = /<%([\s\S]+?)%>/g, + reInterpolate = /<%=([\s\S]+?)%>/g; + + /** Used to match property names within property paths. */ + var reIsDeepProp = /\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/, + reIsPlainProp = /^\w*$/, + rePropName = /[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g; + + /** + * Used to match `RegExp` + * [syntax characters](http://ecma-international.org/ecma-262/7.0/#sec-patterns). + */ + var reRegExpChar = /[\\^$.*+?()[\]{}|]/g, + reHasRegExpChar = RegExp(reRegExpChar.source); + + /** Used to match leading whitespace. */ + var reTrimStart = /^\s+/; + + /** Used to match a single whitespace character. */ + var reWhitespace = /\s/; + + /** Used to match wrap detail comments. */ + var reWrapComment = /\{(?:\n\/\* \[wrapped with .+\] \*\/)?\n?/, + reWrapDetails = /\{\n\/\* \[wrapped with (.+)\] \*/, + reSplitDetails = /,? & /; + + /** Used to match words composed of alphanumeric characters. */ + var reAsciiWord = /[^\x00-\x2f\x3a-\x40\x5b-\x60\x7b-\x7f]+/g; + + /** + * Used to validate the `validate` option in `_.template` variable. + * + * Forbids characters which could potentially change the meaning of the function argument definition: + * - "()," (modification of function parameters) + * - "=" (default value) + * - "[]{}" (destructuring of function parameters) + * - "/" (beginning of a comment) + * - whitespace + */ + var reForbiddenIdentifierChars = /[()=,{}\[\]\/\s]/; + + /** Used to match backslashes in property paths. */ + var reEscapeChar = /\\(\\)?/g; + + /** + * Used to match + * [ES template delimiters](http://ecma-international.org/ecma-262/7.0/#sec-template-literal-lexical-components). + */ + var reEsTemplate = /\$\{([^\\}]*(?:\\.[^\\}]*)*)\}/g; + + /** Used to match `RegExp` flags from their coerced string values. */ + var reFlags = /\w*$/; + + /** Used to detect bad signed hexadecimal string values. */ + var reIsBadHex = /^[-+]0x[0-9a-f]+$/i; + + /** Used to detect binary string values. */ + var reIsBinary = /^0b[01]+$/i; + + /** Used to detect host constructors (Safari). */ + var reIsHostCtor = /^\[object .+?Constructor\]$/; + + /** Used to detect octal string values. */ + var reIsOctal = /^0o[0-7]+$/i; + + /** Used to detect unsigned integer values. */ + var reIsUint = /^(?:0|[1-9]\d*)$/; + + /** Used to match Latin Unicode letters (excluding mathematical operators). */ + var reLatin = /[\xc0-\xd6\xd8-\xf6\xf8-\xff\u0100-\u017f]/g; + + /** Used to ensure capturing order of template delimiters. */ + var reNoMatch = /($^)/; + + /** Used to match unescaped characters in compiled string literals. */ + var reUnescapedString = /['\n\r\u2028\u2029\\]/g; + + /** Used to compose unicode character classes. */ + var rsAstralRange = '\\ud800-\\udfff', + rsComboMarksRange = '\\u0300-\\u036f', + reComboHalfMarksRange = '\\ufe20-\\ufe2f', + rsComboSymbolsRange = '\\u20d0-\\u20ff', + rsComboRange = rsComboMarksRange + reComboHalfMarksRange + rsComboSymbolsRange, + rsDingbatRange = '\\u2700-\\u27bf', + rsLowerRange = 'a-z\\xdf-\\xf6\\xf8-\\xff', + rsMathOpRange = '\\xac\\xb1\\xd7\\xf7', + rsNonCharRange = '\\x00-\\x2f\\x3a-\\x40\\x5b-\\x60\\x7b-\\xbf', + rsPunctuationRange = '\\u2000-\\u206f', + rsSpaceRange = ' \\t\\x0b\\f\\xa0\\ufeff\\n\\r\\u2028\\u2029\\u1680\\u180e\\u2000\\u2001\\u2002\\u2003\\u2004\\u2005\\u2006\\u2007\\u2008\\u2009\\u200a\\u202f\\u205f\\u3000', + rsUpperRange = 'A-Z\\xc0-\\xd6\\xd8-\\xde', + rsVarRange = '\\ufe0e\\ufe0f', + rsBreakRange = rsMathOpRange + rsNonCharRange + rsPunctuationRange + rsSpaceRange; + + /** Used to compose unicode capture groups. */ + var rsApos = "['\u2019]", + rsAstral = '[' + rsAstralRange + ']', + rsBreak = '[' + rsBreakRange + ']', + rsCombo = '[' + rsComboRange + ']', + rsDigits = '\\d+', + rsDingbat = '[' + rsDingbatRange + ']', + rsLower = '[' + rsLowerRange + ']', + rsMisc = '[^' + rsAstralRange + rsBreakRange + rsDigits + rsDingbatRange + rsLowerRange + rsUpperRange + ']', + rsFitz = '\\ud83c[\\udffb-\\udfff]', + rsModifier = '(?:' + rsCombo + '|' + rsFitz + ')', + rsNonAstral = '[^' + rsAstralRange + ']', + rsRegional = '(?:\\ud83c[\\udde6-\\uddff]){2}', + rsSurrPair = '[\\ud800-\\udbff][\\udc00-\\udfff]', + rsUpper = '[' + rsUpperRange + ']', + rsZWJ = '\\u200d'; + + /** Used to compose unicode regexes. */ + var rsMiscLower = '(?:' + rsLower + '|' + rsMisc + ')', + rsMiscUpper = '(?:' + rsUpper + '|' + rsMisc + ')', + rsOptContrLower = '(?:' + rsApos + '(?:d|ll|m|re|s|t|ve))?', + rsOptContrUpper = '(?:' + rsApos + '(?:D|LL|M|RE|S|T|VE))?', + reOptMod = rsModifier + '?', + rsOptVar = '[' + rsVarRange + ']?', + rsOptJoin = '(?:' + rsZWJ + '(?:' + [rsNonAstral, rsRegional, rsSurrPair].join('|') + ')' + rsOptVar + reOptMod + ')*', + rsOrdLower = '\\d*(?:1st|2nd|3rd|(?![123])\\dth)(?=\\b|[A-Z_])', + rsOrdUpper = '\\d*(?:1ST|2ND|3RD|(?![123])\\dTH)(?=\\b|[a-z_])', + rsSeq = rsOptVar + reOptMod + rsOptJoin, + rsEmoji = '(?:' + [rsDingbat, rsRegional, rsSurrPair].join('|') + ')' + rsSeq, + rsSymbol = '(?:' + [rsNonAstral + rsCombo + '?', rsCombo, rsRegional, rsSurrPair, rsAstral].join('|') + ')'; + + /** Used to match apostrophes. */ + var reApos = RegExp(rsApos, 'g'); + + /** + * Used to match [combining diacritical marks](https://en.wikipedia.org/wiki/Combining_Diacritical_Marks) and + * [combining diacritical marks for symbols](https://en.wikipedia.org/wiki/Combining_Diacritical_Marks_for_Symbols). + */ + var reComboMark = RegExp(rsCombo, 'g'); + + /** Used to match [string symbols](https://mathiasbynens.be/notes/javascript-unicode). */ + var reUnicode = RegExp(rsFitz + '(?=' + rsFitz + ')|' + rsSymbol + rsSeq, 'g'); + + /** Used to match complex or compound words. */ + var reUnicodeWord = RegExp([ + rsUpper + '?' + rsLower + '+' + rsOptContrLower + '(?=' + [rsBreak, rsUpper, '$'].join('|') + ')', + rsMiscUpper + '+' + rsOptContrUpper + '(?=' + [rsBreak, rsUpper + rsMiscLower, '$'].join('|') + ')', + rsUpper + '?' + rsMiscLower + '+' + rsOptContrLower, + rsUpper + '+' + rsOptContrUpper, + rsOrdUpper, + rsOrdLower, + rsDigits, + rsEmoji + ].join('|'), 'g'); + + /** Used to detect strings with [zero-width joiners or code points from the astral planes](http://eev.ee/blog/2015/09/12/dark-corners-of-unicode/). */ + var reHasUnicode = RegExp('[' + rsZWJ + rsAstralRange + rsComboRange + rsVarRange + ']'); + + /** Used to detect strings that need a more robust regexp to match words. */ + var reHasUnicodeWord = /[a-z][A-Z]|[A-Z]{2}[a-z]|[0-9][a-zA-Z]|[a-zA-Z][0-9]|[^a-zA-Z0-9 ]/; + + /** Used to assign default `context` object properties. */ + var contextProps = [ + 'Array', 'Buffer', 'DataView', 'Date', 'Error', 'Float32Array', 'Float64Array', + 'Function', 'Int8Array', 'Int16Array', 'Int32Array', 'Map', 'Math', 'Object', + 'Promise', 'RegExp', 'Set', 'String', 'Symbol', 'TypeError', 'Uint8Array', + 'Uint8ClampedArray', 'Uint16Array', 'Uint32Array', 'WeakMap', + '_', 'clearTimeout', 'isFinite', 'parseInt', 'setTimeout' + ]; + + /** Used to make template sourceURLs easier to identify. */ + var templateCounter = -1; + + /** Used to identify `toStringTag` values of typed arrays. */ + var typedArrayTags = {}; + typedArrayTags[float32Tag] = typedArrayTags[float64Tag] = + typedArrayTags[int8Tag] = typedArrayTags[int16Tag] = + typedArrayTags[int32Tag] = typedArrayTags[uint8Tag] = + typedArrayTags[uint8ClampedTag] = typedArrayTags[uint16Tag] = + typedArrayTags[uint32Tag] = true; + typedArrayTags[argsTag] = typedArrayTags[arrayTag] = + typedArrayTags[arrayBufferTag] = typedArrayTags[boolTag] = + typedArrayTags[dataViewTag] = typedArrayTags[dateTag] = + typedArrayTags[errorTag] = typedArrayTags[funcTag] = + typedArrayTags[mapTag] = typedArrayTags[numberTag] = + typedArrayTags[objectTag] = typedArrayTags[regexpTag] = + typedArrayTags[setTag] = typedArrayTags[stringTag] = + typedArrayTags[weakMapTag] = false; + + /** Used to identify `toStringTag` values supported by `_.clone`. */ + var cloneableTags = {}; + cloneableTags[argsTag] = cloneableTags[arrayTag] = + cloneableTags[arrayBufferTag] = cloneableTags[dataViewTag] = + cloneableTags[boolTag] = cloneableTags[dateTag] = + cloneableTags[float32Tag] = cloneableTags[float64Tag] = + cloneableTags[int8Tag] = cloneableTags[int16Tag] = + cloneableTags[int32Tag] = cloneableTags[mapTag] = + cloneableTags[numberTag] = cloneableTags[objectTag] = + cloneableTags[regexpTag] = cloneableTags[setTag] = + cloneableTags[stringTag] = cloneableTags[symbolTag] = + cloneableTags[uint8Tag] = cloneableTags[uint8ClampedTag] = + cloneableTags[uint16Tag] = cloneableTags[uint32Tag] = true; + cloneableTags[errorTag] = cloneableTags[funcTag] = + cloneableTags[weakMapTag] = false; + + /** Used to map Latin Unicode letters to basic Latin letters. */ + var deburredLetters = { + // Latin-1 Supplement block. + '\xc0': 'A', '\xc1': 'A', '\xc2': 'A', '\xc3': 'A', '\xc4': 'A', '\xc5': 'A', + '\xe0': 'a', '\xe1': 'a', '\xe2': 'a', '\xe3': 'a', '\xe4': 'a', '\xe5': 'a', + '\xc7': 'C', '\xe7': 'c', + '\xd0': 'D', '\xf0': 'd', + '\xc8': 'E', '\xc9': 'E', '\xca': 'E', '\xcb': 'E', + '\xe8': 'e', '\xe9': 'e', '\xea': 'e', '\xeb': 'e', + '\xcc': 'I', '\xcd': 'I', '\xce': 'I', '\xcf': 'I', + '\xec': 'i', '\xed': 'i', '\xee': 'i', '\xef': 'i', + '\xd1': 'N', '\xf1': 'n', + '\xd2': 'O', '\xd3': 'O', '\xd4': 'O', '\xd5': 'O', '\xd6': 'O', '\xd8': 'O', + '\xf2': 'o', '\xf3': 'o', '\xf4': 'o', '\xf5': 'o', '\xf6': 'o', '\xf8': 'o', + '\xd9': 'U', '\xda': 'U', '\xdb': 'U', '\xdc': 'U', + '\xf9': 'u', '\xfa': 'u', '\xfb': 'u', '\xfc': 'u', + '\xdd': 'Y', '\xfd': 'y', '\xff': 'y', + '\xc6': 'Ae', '\xe6': 'ae', + '\xde': 'Th', '\xfe': 'th', + '\xdf': 'ss', + // Latin Extended-A block. + '\u0100': 'A', '\u0102': 'A', '\u0104': 'A', + '\u0101': 'a', '\u0103': 'a', '\u0105': 'a', + '\u0106': 'C', '\u0108': 'C', '\u010a': 'C', '\u010c': 'C', + '\u0107': 'c', '\u0109': 'c', '\u010b': 'c', '\u010d': 'c', + '\u010e': 'D', '\u0110': 'D', '\u010f': 'd', '\u0111': 'd', + '\u0112': 'E', '\u0114': 'E', '\u0116': 'E', '\u0118': 'E', '\u011a': 'E', + '\u0113': 'e', '\u0115': 'e', '\u0117': 'e', '\u0119': 'e', '\u011b': 'e', + '\u011c': 'G', '\u011e': 'G', '\u0120': 'G', '\u0122': 'G', + '\u011d': 'g', '\u011f': 'g', '\u0121': 'g', '\u0123': 'g', + '\u0124': 'H', '\u0126': 'H', '\u0125': 'h', '\u0127': 'h', + '\u0128': 'I', '\u012a': 'I', '\u012c': 'I', '\u012e': 'I', '\u0130': 'I', + '\u0129': 'i', '\u012b': 'i', '\u012d': 'i', '\u012f': 'i', '\u0131': 'i', + '\u0134': 'J', '\u0135': 'j', + '\u0136': 'K', '\u0137': 'k', '\u0138': 'k', + '\u0139': 'L', '\u013b': 'L', '\u013d': 'L', '\u013f': 'L', '\u0141': 'L', + '\u013a': 'l', '\u013c': 'l', '\u013e': 'l', '\u0140': 'l', '\u0142': 'l', + '\u0143': 'N', '\u0145': 'N', '\u0147': 'N', '\u014a': 'N', + '\u0144': 'n', '\u0146': 'n', '\u0148': 'n', '\u014b': 'n', + '\u014c': 'O', '\u014e': 'O', '\u0150': 'O', + '\u014d': 'o', '\u014f': 'o', '\u0151': 'o', + '\u0154': 'R', '\u0156': 'R', '\u0158': 'R', + '\u0155': 'r', '\u0157': 'r', '\u0159': 'r', + '\u015a': 'S', '\u015c': 'S', '\u015e': 'S', '\u0160': 'S', + '\u015b': 's', '\u015d': 's', '\u015f': 's', '\u0161': 's', + '\u0162': 'T', '\u0164': 'T', '\u0166': 'T', + '\u0163': 't', '\u0165': 't', '\u0167': 't', + '\u0168': 'U', '\u016a': 'U', '\u016c': 'U', '\u016e': 'U', '\u0170': 'U', '\u0172': 'U', + '\u0169': 'u', '\u016b': 'u', '\u016d': 'u', '\u016f': 'u', '\u0171': 'u', '\u0173': 'u', + '\u0174': 'W', '\u0175': 'w', + '\u0176': 'Y', '\u0177': 'y', '\u0178': 'Y', + '\u0179': 'Z', '\u017b': 'Z', '\u017d': 'Z', + '\u017a': 'z', '\u017c': 'z', '\u017e': 'z', + '\u0132': 'IJ', '\u0133': 'ij', + '\u0152': 'Oe', '\u0153': 'oe', + '\u0149': "'n", '\u017f': 's' + }; + + /** Used to map characters to HTML entities. */ + var htmlEscapes = { + '&': '&', + '<': '<', + '>': '>', + '"': '"', + "'": ''' + }; + + /** Used to map HTML entities to characters. */ + var htmlUnescapes = { + '&': '&', + '<': '<', + '>': '>', + '"': '"', + ''': "'" + }; + + /** Used to escape characters for inclusion in compiled string literals. */ + var stringEscapes = { + '\\': '\\', + "'": "'", + '\n': 'n', + '\r': 'r', + '\u2028': 'u2028', + '\u2029': 'u2029' + }; + + /** Built-in method references without a dependency on `root`. */ + var freeParseFloat = parseFloat, + freeParseInt = parseInt; + + /** Detect free variable `global` from Node.js. */ + var freeGlobal = typeof commonjsGlobal == 'object' && commonjsGlobal && commonjsGlobal.Object === Object && commonjsGlobal; + + /** Detect free variable `self`. */ + var freeSelf = typeof self == 'object' && self && self.Object === Object && self; + + /** Used as a reference to the global object. */ + var root = freeGlobal || freeSelf || Function('return this')(); + + /** Detect free variable `exports`. */ + var freeExports = 'object' == 'object' && exports && !exports.nodeType && exports; + + /** Detect free variable `module`. */ + var freeModule = freeExports && 'object' == 'object' && module && !module.nodeType && module; + + /** Detect the popular CommonJS extension `module.exports`. */ + var moduleExports = freeModule && freeModule.exports === freeExports; + + /** Detect free variable `process` from Node.js. */ + var freeProcess = moduleExports && freeGlobal.process; + + /** Used to access faster Node.js helpers. */ + var nodeUtil = (function() { + try { + // Use `util.types` for Node.js 10+. + var types = freeModule && freeModule.require && freeModule.require('util').types; + + if (types) { + return types; + } + + // Legacy `process.binding('util')` for Node.js < 10. + return freeProcess && freeProcess.binding && freeProcess.binding('util'); + } catch (e) {} + }()); + + /* Node.js helper references. */ + var nodeIsArrayBuffer = nodeUtil && nodeUtil.isArrayBuffer, + nodeIsDate = nodeUtil && nodeUtil.isDate, + nodeIsMap = nodeUtil && nodeUtil.isMap, + nodeIsRegExp = nodeUtil && nodeUtil.isRegExp, + nodeIsSet = nodeUtil && nodeUtil.isSet, + nodeIsTypedArray = nodeUtil && nodeUtil.isTypedArray; + + /*--------------------------------------------------------------------------*/ + + /** + * A faster alternative to `Function#apply`, this function invokes `func` + * with the `this` binding of `thisArg` and the arguments of `args`. + * + * @private + * @param {Function} func The function to invoke. + * @param {*} thisArg The `this` binding of `func`. + * @param {Array} args The arguments to invoke `func` with. + * @returns {*} Returns the result of `func`. + */ + function apply(func, thisArg, args) { + switch (args.length) { + case 0: return func.call(thisArg); + case 1: return func.call(thisArg, args[0]); + case 2: return func.call(thisArg, args[0], args[1]); + case 3: return func.call(thisArg, args[0], args[1], args[2]); + } + return func.apply(thisArg, args); + } + + /** + * A specialized version of `baseAggregator` for arrays. + * + * @private + * @param {Array} [array] The array to iterate over. + * @param {Function} setter The function to set `accumulator` values. + * @param {Function} iteratee The iteratee to transform keys. + * @param {Object} accumulator The initial aggregated object. + * @returns {Function} Returns `accumulator`. + */ + function arrayAggregator(array, setter, iteratee, accumulator) { + var index = -1, + length = array == null ? 0 : array.length; + + while (++index < length) { + var value = array[index]; + setter(accumulator, value, iteratee(value), array); + } + return accumulator; + } + + /** + * A specialized version of `_.forEach` for arrays without support for + * iteratee shorthands. + * + * @private + * @param {Array} [array] The array to iterate over. + * @param {Function} iteratee The function invoked per iteration. + * @returns {Array} Returns `array`. + */ + function arrayEach(array, iteratee) { + var index = -1, + length = array == null ? 0 : array.length; + + while (++index < length) { + if (iteratee(array[index], index, array) === false) { + break; + } + } + return array; + } + + /** + * A specialized version of `_.forEachRight` for arrays without support for + * iteratee shorthands. + * + * @private + * @param {Array} [array] The array to iterate over. + * @param {Function} iteratee The function invoked per iteration. + * @returns {Array} Returns `array`. + */ + function arrayEachRight(array, iteratee) { + var length = array == null ? 0 : array.length; + + while (length--) { + if (iteratee(array[length], length, array) === false) { + break; + } + } + return array; + } + + /** + * A specialized version of `_.every` for arrays without support for + * iteratee shorthands. + * + * @private + * @param {Array} [array] The array to iterate over. + * @param {Function} predicate The function invoked per iteration. + * @returns {boolean} Returns `true` if all elements pass the predicate check, + * else `false`. + */ + function arrayEvery(array, predicate) { + var index = -1, + length = array == null ? 0 : array.length; + + while (++index < length) { + if (!predicate(array[index], index, array)) { + return false; + } + } + return true; + } + + /** + * A specialized version of `_.filter` for arrays without support for + * iteratee shorthands. + * + * @private + * @param {Array} [array] The array to iterate over. + * @param {Function} predicate The function invoked per iteration. + * @returns {Array} Returns the new filtered array. + */ + function arrayFilter(array, predicate) { + var index = -1, + length = array == null ? 0 : array.length, + resIndex = 0, + result = []; + + while (++index < length) { + var value = array[index]; + if (predicate(value, index, array)) { + result[resIndex++] = value; + } + } + return result; + } + + /** + * A specialized version of `_.includes` for arrays without support for + * specifying an index to search from. + * + * @private + * @param {Array} [array] The array to inspect. + * @param {*} target The value to search for. + * @returns {boolean} Returns `true` if `target` is found, else `false`. + */ + function arrayIncludes(array, value) { + var length = array == null ? 0 : array.length; + return !!length && baseIndexOf(array, value, 0) > -1; + } + + /** + * This function is like `arrayIncludes` except that it accepts a comparator. + * + * @private + * @param {Array} [array] The array to inspect. + * @param {*} target The value to search for. + * @param {Function} comparator The comparator invoked per element. + * @returns {boolean} Returns `true` if `target` is found, else `false`. + */ + function arrayIncludesWith(array, value, comparator) { + var index = -1, + length = array == null ? 0 : array.length; + + while (++index < length) { + if (comparator(value, array[index])) { + return true; + } + } + return false; + } + + /** + * A specialized version of `_.map` for arrays without support for iteratee + * shorthands. + * + * @private + * @param {Array} [array] The array to iterate over. + * @param {Function} iteratee The function invoked per iteration. + * @returns {Array} Returns the new mapped array. + */ + function arrayMap(array, iteratee) { + var index = -1, + length = array == null ? 0 : array.length, + result = Array(length); + + while (++index < length) { + result[index] = iteratee(array[index], index, array); + } + return result; + } + + /** + * Appends the elements of `values` to `array`. + * + * @private + * @param {Array} array The array to modify. + * @param {Array} values The values to append. + * @returns {Array} Returns `array`. + */ + function arrayPush(array, values) { + var index = -1, + length = values.length, + offset = array.length; + + while (++index < length) { + array[offset + index] = values[index]; + } + return array; + } + + /** + * A specialized version of `_.reduce` for arrays without support for + * iteratee shorthands. + * + * @private + * @param {Array} [array] The array to iterate over. + * @param {Function} iteratee The function invoked per iteration. + * @param {*} [accumulator] The initial value. + * @param {boolean} [initAccum] Specify using the first element of `array` as + * the initial value. + * @returns {*} Returns the accumulated value. + */ + function arrayReduce(array, iteratee, accumulator, initAccum) { + var index = -1, + length = array == null ? 0 : array.length; + + if (initAccum && length) { + accumulator = array[++index]; + } + while (++index < length) { + accumulator = iteratee(accumulator, array[index], index, array); + } + return accumulator; + } + + /** + * A specialized version of `_.reduceRight` for arrays without support for + * iteratee shorthands. + * + * @private + * @param {Array} [array] The array to iterate over. + * @param {Function} iteratee The function invoked per iteration. + * @param {*} [accumulator] The initial value. + * @param {boolean} [initAccum] Specify using the last element of `array` as + * the initial value. + * @returns {*} Returns the accumulated value. + */ + function arrayReduceRight(array, iteratee, accumulator, initAccum) { + var length = array == null ? 0 : array.length; + if (initAccum && length) { + accumulator = array[--length]; + } + while (length--) { + accumulator = iteratee(accumulator, array[length], length, array); + } + return accumulator; + } + + /** + * A specialized version of `_.some` for arrays without support for iteratee + * shorthands. + * + * @private + * @param {Array} [array] The array to iterate over. + * @param {Function} predicate The function invoked per iteration. + * @returns {boolean} Returns `true` if any element passes the predicate check, + * else `false`. + */ + function arraySome(array, predicate) { + var index = -1, + length = array == null ? 0 : array.length; + + while (++index < length) { + if (predicate(array[index], index, array)) { + return true; + } + } + return false; + } + + /** + * Gets the size of an ASCII `string`. + * + * @private + * @param {string} string The string inspect. + * @returns {number} Returns the string size. + */ + var asciiSize = baseProperty('length'); + + /** + * Converts an ASCII `string` to an array. + * + * @private + * @param {string} string The string to convert. + * @returns {Array} Returns the converted array. + */ + function asciiToArray(string) { + return string.split(''); + } + + /** + * Splits an ASCII `string` into an array of its words. + * + * @private + * @param {string} The string to inspect. + * @returns {Array} Returns the words of `string`. + */ + function asciiWords(string) { + return string.match(reAsciiWord) || []; + } + + /** + * The base implementation of methods like `_.findKey` and `_.findLastKey`, + * without support for iteratee shorthands, which iterates over `collection` + * using `eachFunc`. + * + * @private + * @param {Array|Object} collection The collection to inspect. + * @param {Function} predicate The function invoked per iteration. + * @param {Function} eachFunc The function to iterate over `collection`. + * @returns {*} Returns the found element or its key, else `undefined`. + */ + function baseFindKey(collection, predicate, eachFunc) { + var result; + eachFunc(collection, function(value, key, collection) { + if (predicate(value, key, collection)) { + result = key; + return false; + } + }); + return result; + } + + /** + * The base implementation of `_.findIndex` and `_.findLastIndex` without + * support for iteratee shorthands. + * + * @private + * @param {Array} array The array to inspect. + * @param {Function} predicate The function invoked per iteration. + * @param {number} fromIndex The index to search from. + * @param {boolean} [fromRight] Specify iterating from right to left. + * @returns {number} Returns the index of the matched value, else `-1`. + */ + function baseFindIndex(array, predicate, fromIndex, fromRight) { + var length = array.length, + index = fromIndex + (fromRight ? 1 : -1); + + while ((fromRight ? index-- : ++index < length)) { + if (predicate(array[index], index, array)) { + return index; + } + } + return -1; + } + + /** + * The base implementation of `_.indexOf` without `fromIndex` bounds checks. + * + * @private + * @param {Array} array The array to inspect. + * @param {*} value The value to search for. + * @param {number} fromIndex The index to search from. + * @returns {number} Returns the index of the matched value, else `-1`. + */ + function baseIndexOf(array, value, fromIndex) { + return value === value + ? strictIndexOf(array, value, fromIndex) + : baseFindIndex(array, baseIsNaN, fromIndex); + } + + /** + * This function is like `baseIndexOf` except that it accepts a comparator. + * + * @private + * @param {Array} array The array to inspect. + * @param {*} value The value to search for. + * @param {number} fromIndex The index to search from. + * @param {Function} comparator The comparator invoked per element. + * @returns {number} Returns the index of the matched value, else `-1`. + */ + function baseIndexOfWith(array, value, fromIndex, comparator) { + var index = fromIndex - 1, + length = array.length; + + while (++index < length) { + if (comparator(array[index], value)) { + return index; + } + } + return -1; + } + + /** + * The base implementation of `_.isNaN` without support for number objects. + * + * @private + * @param {*} value The value to check. + * @returns {boolean} Returns `true` if `value` is `NaN`, else `false`. + */ + function baseIsNaN(value) { + return value !== value; + } + + /** + * The base implementation of `_.mean` and `_.meanBy` without support for + * iteratee shorthands. + * + * @private + * @param {Array} array The array to iterate over. + * @param {Function} iteratee The function invoked per iteration. + * @returns {number} Returns the mean. + */ + function baseMean(array, iteratee) { + var length = array == null ? 0 : array.length; + return length ? (baseSum(array, iteratee) / length) : NAN; + } + + /** + * The base implementation of `_.property` without support for deep paths. + * + * @private + * @param {string} key The key of the property to get. + * @returns {Function} Returns the new accessor function. + */ + function baseProperty(key) { + return function(object) { + return object == null ? undefined : object[key]; + }; + } + + /** + * The base implementation of `_.propertyOf` without support for deep paths. + * + * @private + * @param {Object} object The object to query. + * @returns {Function} Returns the new accessor function. + */ + function basePropertyOf(object) { + return function(key) { + return object == null ? undefined : object[key]; + }; + } + + /** + * The base implementation of `_.reduce` and `_.reduceRight`, without support + * for iteratee shorthands, which iterates over `collection` using `eachFunc`. + * + * @private + * @param {Array|Object} collection The collection to iterate over. + * @param {Function} iteratee The function invoked per iteration. + * @param {*} accumulator The initial value. + * @param {boolean} initAccum Specify using the first or last element of + * `collection` as the initial value. + * @param {Function} eachFunc The function to iterate over `collection`. + * @returns {*} Returns the accumulated value. + */ + function baseReduce(collection, iteratee, accumulator, initAccum, eachFunc) { + eachFunc(collection, function(value, index, collection) { + accumulator = initAccum + ? (initAccum = false, value) + : iteratee(accumulator, value, index, collection); + }); + return accumulator; + } + + /** + * The base implementation of `_.sortBy` which uses `comparer` to define the + * sort order of `array` and replaces criteria objects with their corresponding + * values. + * + * @private + * @param {Array} array The array to sort. + * @param {Function} comparer The function to define sort order. + * @returns {Array} Returns `array`. + */ + function baseSortBy(array, comparer) { + var length = array.length; + + array.sort(comparer); + while (length--) { + array[length] = array[length].value; + } + return array; + } + + /** + * The base implementation of `_.sum` and `_.sumBy` without support for + * iteratee shorthands. + * + * @private + * @param {Array} array The array to iterate over. + * @param {Function} iteratee The function invoked per iteration. + * @returns {number} Returns the sum. + */ + function baseSum(array, iteratee) { + var result, + index = -1, + length = array.length; + + while (++index < length) { + var current = iteratee(array[index]); + if (current !== undefined) { + result = result === undefined ? current : (result + current); + } + } + return result; + } + + /** + * The base implementation of `_.times` without support for iteratee shorthands + * or max array length checks. + * + * @private + * @param {number} n The number of times to invoke `iteratee`. + * @param {Function} iteratee The function invoked per iteration. + * @returns {Array} Returns the array of results. + */ + function baseTimes(n, iteratee) { + var index = -1, + result = Array(n); + + while (++index < n) { + result[index] = iteratee(index); + } + return result; + } + + /** + * The base implementation of `_.toPairs` and `_.toPairsIn` which creates an array + * of key-value pairs for `object` corresponding to the property names of `props`. + * + * @private + * @param {Object} object The object to query. + * @param {Array} props The property names to get values for. + * @returns {Object} Returns the key-value pairs. + */ + function baseToPairs(object, props) { + return arrayMap(props, function(key) { + return [key, object[key]]; + }); + } + + /** + * The base implementation of `_.trim`. + * + * @private + * @param {string} string The string to trim. + * @returns {string} Returns the trimmed string. + */ + function baseTrim(string) { + return string + ? string.slice(0, trimmedEndIndex(string) + 1).replace(reTrimStart, '') + : string; + } + + /** + * The base implementation of `_.unary` without support for storing metadata. + * + * @private + * @param {Function} func The function to cap arguments for. + * @returns {Function} Returns the new capped function. + */ + function baseUnary(func) { + return function(value) { + return func(value); + }; + } + + /** + * The base implementation of `_.values` and `_.valuesIn` which creates an + * array of `object` property values corresponding to the property names + * of `props`. + * + * @private + * @param {Object} object The object to query. + * @param {Array} props The property names to get values for. + * @returns {Object} Returns the array of property values. + */ + function baseValues(object, props) { + return arrayMap(props, function(key) { + return object[key]; + }); + } + + /** + * Checks if a `cache` value for `key` exists. + * + * @private + * @param {Object} cache The cache to query. + * @param {string} key The key of the entry to check. + * @returns {boolean} Returns `true` if an entry for `key` exists, else `false`. + */ + function cacheHas(cache, key) { + return cache.has(key); + } + + /** + * Used by `_.trim` and `_.trimStart` to get the index of the first string symbol + * that is not found in the character symbols. + * + * @private + * @param {Array} strSymbols The string symbols to inspect. + * @param {Array} chrSymbols The character symbols to find. + * @returns {number} Returns the index of the first unmatched string symbol. + */ + function charsStartIndex(strSymbols, chrSymbols) { + var index = -1, + length = strSymbols.length; + + while (++index < length && baseIndexOf(chrSymbols, strSymbols[index], 0) > -1) {} + return index; + } + + /** + * Used by `_.trim` and `_.trimEnd` to get the index of the last string symbol + * that is not found in the character symbols. + * + * @private + * @param {Array} strSymbols The string symbols to inspect. + * @param {Array} chrSymbols The character symbols to find. + * @returns {number} Returns the index of the last unmatched string symbol. + */ + function charsEndIndex(strSymbols, chrSymbols) { + var index = strSymbols.length; + + while (index-- && baseIndexOf(chrSymbols, strSymbols[index], 0) > -1) {} + return index; + } + + /** + * Gets the number of `placeholder` occurrences in `array`. + * + * @private + * @param {Array} array The array to inspect. + * @param {*} placeholder The placeholder to search for. + * @returns {number} Returns the placeholder count. + */ + function countHolders(array, placeholder) { + var length = array.length, + result = 0; + + while (length--) { + if (array[length] === placeholder) { + ++result; + } + } + return result; + } + + /** + * Used by `_.deburr` to convert Latin-1 Supplement and Latin Extended-A + * letters to basic Latin letters. + * + * @private + * @param {string} letter The matched letter to deburr. + * @returns {string} Returns the deburred letter. + */ + var deburrLetter = basePropertyOf(deburredLetters); + + /** + * Used by `_.escape` to convert characters to HTML entities. + * + * @private + * @param {string} chr The matched character to escape. + * @returns {string} Returns the escaped character. + */ + var escapeHtmlChar = basePropertyOf(htmlEscapes); + + /** + * Used by `_.template` to escape characters for inclusion in compiled string literals. + * + * @private + * @param {string} chr The matched character to escape. + * @returns {string} Returns the escaped character. + */ + function escapeStringChar(chr) { + return '\\' + stringEscapes[chr]; + } + + /** + * Gets the value at `key` of `object`. + * + * @private + * @param {Object} [object] The object to query. + * @param {string} key The key of the property to get. + * @returns {*} Returns the property value. + */ + function getValue(object, key) { + return object == null ? undefined : object[key]; + } + + /** + * Checks if `string` contains Unicode symbols. + * + * @private + * @param {string} string The string to inspect. + * @returns {boolean} Returns `true` if a symbol is found, else `false`. + */ + function hasUnicode(string) { + return reHasUnicode.test(string); + } + + /** + * Checks if `string` contains a word composed of Unicode symbols. + * + * @private + * @param {string} string The string to inspect. + * @returns {boolean} Returns `true` if a word is found, else `false`. + */ + function hasUnicodeWord(string) { + return reHasUnicodeWord.test(string); + } + + /** + * Converts `iterator` to an array. + * + * @private + * @param {Object} iterator The iterator to convert. + * @returns {Array} Returns the converted array. + */ + function iteratorToArray(iterator) { + var data, + result = []; + + while (!(data = iterator.next()).done) { + result.push(data.value); + } + return result; + } + + /** + * Converts `map` to its key-value pairs. + * + * @private + * @param {Object} map The map to convert. + * @returns {Array} Returns the key-value pairs. + */ + function mapToArray(map) { + var index = -1, + result = Array(map.size); + + map.forEach(function(value, key) { + result[++index] = [key, value]; + }); + return result; + } + + /** + * Creates a unary function that invokes `func` with its argument transformed. + * + * @private + * @param {Function} func The function to wrap. + * @param {Function} transform The argument transform. + * @returns {Function} Returns the new function. + */ + function overArg(func, transform) { + return function(arg) { + return func(transform(arg)); + }; + } + + /** + * Replaces all `placeholder` elements in `array` with an internal placeholder + * and returns an array of their indexes. + * + * @private + * @param {Array} array The array to modify. + * @param {*} placeholder The placeholder to replace. + * @returns {Array} Returns the new array of placeholder indexes. + */ + function replaceHolders(array, placeholder) { + var index = -1, + length = array.length, + resIndex = 0, + result = []; + + while (++index < length) { + var value = array[index]; + if (value === placeholder || value === PLACEHOLDER) { + array[index] = PLACEHOLDER; + result[resIndex++] = index; + } + } + return result; + } + + /** + * Converts `set` to an array of its values. + * + * @private + * @param {Object} set The set to convert. + * @returns {Array} Returns the values. + */ + function setToArray(set) { + var index = -1, + result = Array(set.size); + + set.forEach(function(value) { + result[++index] = value; + }); + return result; + } + + /** + * Converts `set` to its value-value pairs. + * + * @private + * @param {Object} set The set to convert. + * @returns {Array} Returns the value-value pairs. + */ + function setToPairs(set) { + var index = -1, + result = Array(set.size); + + set.forEach(function(value) { + result[++index] = [value, value]; + }); + return result; + } + + /** + * A specialized version of `_.indexOf` which performs strict equality + * comparisons of values, i.e. `===`. + * + * @private + * @param {Array} array The array to inspect. + * @param {*} value The value to search for. + * @param {number} fromIndex The index to search from. + * @returns {number} Returns the index of the matched value, else `-1`. + */ + function strictIndexOf(array, value, fromIndex) { + var index = fromIndex - 1, + length = array.length; + + while (++index < length) { + if (array[index] === value) { + return index; + } + } + return -1; + } + + /** + * A specialized version of `_.lastIndexOf` which performs strict equality + * comparisons of values, i.e. `===`. + * + * @private + * @param {Array} array The array to inspect. + * @param {*} value The value to search for. + * @param {number} fromIndex The index to search from. + * @returns {number} Returns the index of the matched value, else `-1`. + */ + function strictLastIndexOf(array, value, fromIndex) { + var index = fromIndex + 1; + while (index--) { + if (array[index] === value) { + return index; + } + } + return index; + } + + /** + * Gets the number of symbols in `string`. + * + * @private + * @param {string} string The string to inspect. + * @returns {number} Returns the string size. + */ + function stringSize(string) { + return hasUnicode(string) + ? unicodeSize(string) + : asciiSize(string); + } + + /** + * Converts `string` to an array. + * + * @private + * @param {string} string The string to convert. + * @returns {Array} Returns the converted array. + */ + function stringToArray(string) { + return hasUnicode(string) + ? unicodeToArray(string) + : asciiToArray(string); + } + + /** + * Used by `_.trim` and `_.trimEnd` to get the index of the last non-whitespace + * character of `string`. + * + * @private + * @param {string} string The string to inspect. + * @returns {number} Returns the index of the last non-whitespace character. + */ + function trimmedEndIndex(string) { + var index = string.length; + + while (index-- && reWhitespace.test(string.charAt(index))) {} + return index; + } + + /** + * Used by `_.unescape` to convert HTML entities to characters. + * + * @private + * @param {string} chr The matched character to unescape. + * @returns {string} Returns the unescaped character. + */ + var unescapeHtmlChar = basePropertyOf(htmlUnescapes); + + /** + * Gets the size of a Unicode `string`. + * + * @private + * @param {string} string The string inspect. + * @returns {number} Returns the string size. + */ + function unicodeSize(string) { + var result = reUnicode.lastIndex = 0; + while (reUnicode.test(string)) { + ++result; + } + return result; + } + + /** + * Converts a Unicode `string` to an array. + * + * @private + * @param {string} string The string to convert. + * @returns {Array} Returns the converted array. + */ + function unicodeToArray(string) { + return string.match(reUnicode) || []; + } + + /** + * Splits a Unicode `string` into an array of its words. + * + * @private + * @param {string} The string to inspect. + * @returns {Array} Returns the words of `string`. + */ + function unicodeWords(string) { + return string.match(reUnicodeWord) || []; + } + + /*--------------------------------------------------------------------------*/ + + /** + * Create a new pristine `lodash` function using the `context` object. + * + * @static + * @memberOf _ + * @since 1.1.0 + * @category Util + * @param {Object} [context=root] The context object. + * @returns {Function} Returns a new `lodash` function. + * @example + * + * _.mixin({ 'foo': _.constant('foo') }); + * + * var lodash = _.runInContext(); + * lodash.mixin({ 'bar': lodash.constant('bar') }); + * + * _.isFunction(_.foo); + * // => true + * _.isFunction(_.bar); + * // => false + * + * lodash.isFunction(lodash.foo); + * // => false + * lodash.isFunction(lodash.bar); + * // => true + * + * // Create a suped-up `defer` in Node.js. + * var defer = _.runInContext({ 'setTimeout': setImmediate }).defer; + */ + var runInContext = (function runInContext(context) { + context = context == null ? root : _.defaults(root.Object(), context, _.pick(root, contextProps)); + + /** Built-in constructor references. */ + var Array = context.Array, + Date = context.Date, + Error = context.Error, + Function = context.Function, + Math = context.Math, + Object = context.Object, + RegExp = context.RegExp, + String = context.String, + TypeError = context.TypeError; + + /** Used for built-in method references. */ + var arrayProto = Array.prototype, + funcProto = Function.prototype, + objectProto = Object.prototype; + + /** Used to detect overreaching core-js shims. */ + var coreJsData = context['__core-js_shared__']; + + /** Used to resolve the decompiled source of functions. */ + var funcToString = funcProto.toString; + + /** Used to check objects for own properties. */ + var hasOwnProperty = objectProto.hasOwnProperty; + + /** Used to generate unique IDs. */ + var idCounter = 0; + + /** Used to detect methods masquerading as native. */ + var maskSrcKey = (function() { + var uid = /[^.]+$/.exec(coreJsData && coreJsData.keys && coreJsData.keys.IE_PROTO || ''); + return uid ? ('Symbol(src)_1.' + uid) : ''; + }()); + + /** + * Used to resolve the + * [`toStringTag`](http://ecma-international.org/ecma-262/7.0/#sec-object.prototype.tostring) + * of values. + */ + var nativeObjectToString = objectProto.toString; + + /** Used to infer the `Object` constructor. */ + var objectCtorString = funcToString.call(Object); + + /** Used to restore the original `_` reference in `_.noConflict`. */ + var oldDash = root._; + + /** Used to detect if a method is native. */ + var reIsNative = RegExp('^' + + funcToString.call(hasOwnProperty).replace(reRegExpChar, '\\$&') + .replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g, '$1.*?') + '$' + ); + + /** Built-in value references. */ + var Buffer = moduleExports ? context.Buffer : undefined, + Symbol = context.Symbol, + Uint8Array = context.Uint8Array, + allocUnsafe = Buffer ? Buffer.allocUnsafe : undefined, + getPrototype = overArg(Object.getPrototypeOf, Object), + objectCreate = Object.create, + propertyIsEnumerable = objectProto.propertyIsEnumerable, + splice = arrayProto.splice, + spreadableSymbol = Symbol ? Symbol.isConcatSpreadable : undefined, + symIterator = Symbol ? Symbol.iterator : undefined, + symToStringTag = Symbol ? Symbol.toStringTag : undefined; + + var defineProperty = (function() { + try { + var func = getNative(Object, 'defineProperty'); + func({}, '', {}); + return func; + } catch (e) {} + }()); + + /** Mocked built-ins. */ + var ctxClearTimeout = context.clearTimeout !== root.clearTimeout && context.clearTimeout, + ctxNow = Date && Date.now !== root.Date.now && Date.now, + ctxSetTimeout = context.setTimeout !== root.setTimeout && context.setTimeout; + + /* Built-in method references for those with the same name as other `lodash` methods. */ + var nativeCeil = Math.ceil, + nativeFloor = Math.floor, + nativeGetSymbols = Object.getOwnPropertySymbols, + nativeIsBuffer = Buffer ? Buffer.isBuffer : undefined, + nativeIsFinite = context.isFinite, + nativeJoin = arrayProto.join, + nativeKeys = overArg(Object.keys, Object), + nativeMax = Math.max, + nativeMin = Math.min, + nativeNow = Date.now, + nativeParseInt = context.parseInt, + nativeRandom = Math.random, + nativeReverse = arrayProto.reverse; + + /* Built-in method references that are verified to be native. */ + var DataView = getNative(context, 'DataView'), + Map = getNative(context, 'Map'), + Promise = getNative(context, 'Promise'), + Set = getNative(context, 'Set'), + WeakMap = getNative(context, 'WeakMap'), + nativeCreate = getNative(Object, 'create'); + + /** Used to store function metadata. */ + var metaMap = WeakMap && new WeakMap; + + /** Used to lookup unminified function names. */ + var realNames = {}; + + /** Used to detect maps, sets, and weakmaps. */ + var dataViewCtorString = toSource(DataView), + mapCtorString = toSource(Map), + promiseCtorString = toSource(Promise), + setCtorString = toSource(Set), + weakMapCtorString = toSource(WeakMap); + + /** Used to convert symbols to primitives and strings. */ + var symbolProto = Symbol ? Symbol.prototype : undefined, + symbolValueOf = symbolProto ? symbolProto.valueOf : undefined, + symbolToString = symbolProto ? symbolProto.toString : undefined; + + /*------------------------------------------------------------------------*/ + + /** + * Creates a `lodash` object which wraps `value` to enable implicit method + * chain sequences. Methods that operate on and return arrays, collections, + * and functions can be chained together. Methods that retrieve a single value + * or may return a primitive value will automatically end the chain sequence + * and return the unwrapped value. Otherwise, the value must be unwrapped + * with `_#value`. + * + * Explicit chain sequences, which must be unwrapped with `_#value`, may be + * enabled using `_.chain`. + * + * The execution of chained methods is lazy, that is, it's deferred until + * `_#value` is implicitly or explicitly called. + * + * Lazy evaluation allows several methods to support shortcut fusion. + * Shortcut fusion is an optimization to merge iteratee calls; this avoids + * the creation of intermediate arrays and can greatly reduce the number of + * iteratee executions. Sections of a chain sequence qualify for shortcut + * fusion if the section is applied to an array and iteratees accept only + * one argument. The heuristic for whether a section qualifies for shortcut + * fusion is subject to change. + * + * Chaining is supported in custom builds as long as the `_#value` method is + * directly or indirectly included in the build. + * + * In addition to lodash methods, wrappers have `Array` and `String` methods. + * + * The wrapper `Array` methods are: + * `concat`, `join`, `pop`, `push`, `shift`, `sort`, `splice`, and `unshift` + * + * The wrapper `String` methods are: + * `replace` and `split` + * + * The wrapper methods that support shortcut fusion are: + * `at`, `compact`, `drop`, `dropRight`, `dropWhile`, `filter`, `find`, + * `findLast`, `head`, `initial`, `last`, `map`, `reject`, `reverse`, `slice`, + * `tail`, `take`, `takeRight`, `takeRightWhile`, `takeWhile`, and `toArray` + * + * The chainable wrapper methods are: + * `after`, `ary`, `assign`, `assignIn`, `assignInWith`, `assignWith`, `at`, + * `before`, `bind`, `bindAll`, `bindKey`, `castArray`, `chain`, `chunk`, + * `commit`, `compact`, `concat`, `conforms`, `constant`, `countBy`, `create`, + * `curry`, `debounce`, `defaults`, `defaultsDeep`, `defer`, `delay`, + * `difference`, `differenceBy`, `differenceWith`, `drop`, `dropRight`, + * `dropRightWhile`, `dropWhile`, `extend`, `extendWith`, `fill`, `filter`, + * `flatMap`, `flatMapDeep`, `flatMapDepth`, `flatten`, `flattenDeep`, + * `flattenDepth`, `flip`, `flow`, `flowRight`, `fromPairs`, `functions`, + * `functionsIn`, `groupBy`, `initial`, `intersection`, `intersectionBy`, + * `intersectionWith`, `invert`, `invertBy`, `invokeMap`, `iteratee`, `keyBy`, + * `keys`, `keysIn`, `map`, `mapKeys`, `mapValues`, `matches`, `matchesProperty`, + * `memoize`, `merge`, `mergeWith`, `method`, `methodOf`, `mixin`, `negate`, + * `nthArg`, `omit`, `omitBy`, `once`, `orderBy`, `over`, `overArgs`, + * `overEvery`, `overSome`, `partial`, `partialRight`, `partition`, `pick`, + * `pickBy`, `plant`, `property`, `propertyOf`, `pull`, `pullAll`, `pullAllBy`, + * `pullAllWith`, `pullAt`, `push`, `range`, `rangeRight`, `rearg`, `reject`, + * `remove`, `rest`, `reverse`, `sampleSize`, `set`, `setWith`, `shuffle`, + * `slice`, `sort`, `sortBy`, `splice`, `spread`, `tail`, `take`, `takeRight`, + * `takeRightWhile`, `takeWhile`, `tap`, `throttle`, `thru`, `toArray`, + * `toPairs`, `toPairsIn`, `toPath`, `toPlainObject`, `transform`, `unary`, + * `union`, `unionBy`, `unionWith`, `uniq`, `uniqBy`, `uniqWith`, `unset`, + * `unshift`, `unzip`, `unzipWith`, `update`, `updateWith`, `values`, + * `valuesIn`, `without`, `wrap`, `xor`, `xorBy`, `xorWith`, `zip`, + * `zipObject`, `zipObjectDeep`, and `zipWith` + * + * The wrapper methods that are **not** chainable by default are: + * `add`, `attempt`, `camelCase`, `capitalize`, `ceil`, `clamp`, `clone`, + * `cloneDeep`, `cloneDeepWith`, `cloneWith`, `conformsTo`, `deburr`, + * `defaultTo`, `divide`, `each`, `eachRight`, `endsWith`, `eq`, `escape`, + * `escapeRegExp`, `every`, `find`, `findIndex`, `findKey`, `findLast`, + * `findLastIndex`, `findLastKey`, `first`, `floor`, `forEach`, `forEachRight`, + * `forIn`, `forInRight`, `forOwn`, `forOwnRight`, `get`, `gt`, `gte`, `has`, + * `hasIn`, `head`, `identity`, `includes`, `indexOf`, `inRange`, `invoke`, + * `isArguments`, `isArray`, `isArrayBuffer`, `isArrayLike`, `isArrayLikeObject`, + * `isBoolean`, `isBuffer`, `isDate`, `isElement`, `isEmpty`, `isEqual`, + * `isEqualWith`, `isError`, `isFinite`, `isFunction`, `isInteger`, `isLength`, + * `isMap`, `isMatch`, `isMatchWith`, `isNaN`, `isNative`, `isNil`, `isNull`, + * `isNumber`, `isObject`, `isObjectLike`, `isPlainObject`, `isRegExp`, + * `isSafeInteger`, `isSet`, `isString`, `isUndefined`, `isTypedArray`, + * `isWeakMap`, `isWeakSet`, `join`, `kebabCase`, `last`, `lastIndexOf`, + * `lowerCase`, `lowerFirst`, `lt`, `lte`, `max`, `maxBy`, `mean`, `meanBy`, + * `min`, `minBy`, `multiply`, `noConflict`, `noop`, `now`, `nth`, `pad`, + * `padEnd`, `padStart`, `parseInt`, `pop`, `random`, `reduce`, `reduceRight`, + * `repeat`, `result`, `round`, `runInContext`, `sample`, `shift`, `size`, + * `snakeCase`, `some`, `sortedIndex`, `sortedIndexBy`, `sortedLastIndex`, + * `sortedLastIndexBy`, `startCase`, `startsWith`, `stubArray`, `stubFalse`, + * `stubObject`, `stubString`, `stubTrue`, `subtract`, `sum`, `sumBy`, + * `template`, `times`, `toFinite`, `toInteger`, `toJSON`, `toLength`, + * `toLower`, `toNumber`, `toSafeInteger`, `toString`, `toUpper`, `trim`, + * `trimEnd`, `trimStart`, `truncate`, `unescape`, `uniqueId`, `upperCase`, + * `upperFirst`, `value`, and `words` + * + * @name _ + * @constructor + * @category Seq + * @param {*} value The value to wrap in a `lodash` instance. + * @returns {Object} Returns the new `lodash` wrapper instance. + * @example + * + * function square(n) { + * return n * n; + * } + * + * var wrapped = _([1, 2, 3]); + * + * // Returns an unwrapped value. + * wrapped.reduce(_.add); + * // => 6 + * + * // Returns a wrapped value. + * var squares = wrapped.map(square); + * + * _.isArray(squares); + * // => false + * + * _.isArray(squares.value()); + * // => true + */ + function lodash(value) { + if (isObjectLike(value) && !isArray(value) && !(value instanceof LazyWrapper)) { + if (value instanceof LodashWrapper) { + return value; + } + if (hasOwnProperty.call(value, '__wrapped__')) { + return wrapperClone(value); + } + } + return new LodashWrapper(value); + } + + /** + * The base implementation of `_.create` without support for assigning + * properties to the created object. + * + * @private + * @param {Object} proto The object to inherit from. + * @returns {Object} Returns the new object. + */ + var baseCreate = (function() { + function object() {} + return function(proto) { + if (!isObject(proto)) { + return {}; + } + if (objectCreate) { + return objectCreate(proto); + } + object.prototype = proto; + var result = new object; + object.prototype = undefined; + return result; + }; + }()); + + /** + * The function whose prototype chain sequence wrappers inherit from. + * + * @private + */ + function baseLodash() { + // No operation performed. + } + + /** + * The base constructor for creating `lodash` wrapper objects. + * + * @private + * @param {*} value The value to wrap. + * @param {boolean} [chainAll] Enable explicit method chain sequences. + */ + function LodashWrapper(value, chainAll) { + this.__wrapped__ = value; + this.__actions__ = []; + this.__chain__ = !!chainAll; + this.__index__ = 0; + this.__values__ = undefined; + } + + /** + * By default, the template delimiters used by lodash are like those in + * embedded Ruby (ERB) as well as ES2015 template strings. Change the + * following template settings to use alternative delimiters. + * + * @static + * @memberOf _ + * @type {Object} + */ + lodash.templateSettings = { + + /** + * Used to detect `data` property values to be HTML-escaped. + * + * @memberOf _.templateSettings + * @type {RegExp} + */ + 'escape': reEscape, + + /** + * Used to detect code to be evaluated. + * + * @memberOf _.templateSettings + * @type {RegExp} + */ + 'evaluate': reEvaluate, + + /** + * Used to detect `data` property values to inject. + * + * @memberOf _.templateSettings + * @type {RegExp} + */ + 'interpolate': reInterpolate, + + /** + * Used to reference the data object in the template text. + * + * @memberOf _.templateSettings + * @type {string} + */ + 'variable': '', + + /** + * Used to import variables into the compiled template. + * + * @memberOf _.templateSettings + * @type {Object} + */ + 'imports': { + + /** + * A reference to the `lodash` function. + * + * @memberOf _.templateSettings.imports + * @type {Function} + */ + '_': lodash + } + }; + + // Ensure wrappers are instances of `baseLodash`. + lodash.prototype = baseLodash.prototype; + lodash.prototype.constructor = lodash; + + LodashWrapper.prototype = baseCreate(baseLodash.prototype); + LodashWrapper.prototype.constructor = LodashWrapper; + + /*------------------------------------------------------------------------*/ + + /** + * Creates a lazy wrapper object which wraps `value` to enable lazy evaluation. + * + * @private + * @constructor + * @param {*} value The value to wrap. + */ + function LazyWrapper(value) { + this.__wrapped__ = value; + this.__actions__ = []; + this.__dir__ = 1; + this.__filtered__ = false; + this.__iteratees__ = []; + this.__takeCount__ = MAX_ARRAY_LENGTH; + this.__views__ = []; + } + + /** + * Creates a clone of the lazy wrapper object. + * + * @private + * @name clone + * @memberOf LazyWrapper + * @returns {Object} Returns the cloned `LazyWrapper` object. + */ + function lazyClone() { + var result = new LazyWrapper(this.__wrapped__); + result.__actions__ = copyArray(this.__actions__); + result.__dir__ = this.__dir__; + result.__filtered__ = this.__filtered__; + result.__iteratees__ = copyArray(this.__iteratees__); + result.__takeCount__ = this.__takeCount__; + result.__views__ = copyArray(this.__views__); + return result; + } + + /** + * Reverses the direction of lazy iteration. + * + * @private + * @name reverse + * @memberOf LazyWrapper + * @returns {Object} Returns the new reversed `LazyWrapper` object. + */ + function lazyReverse() { + if (this.__filtered__) { + var result = new LazyWrapper(this); + result.__dir__ = -1; + result.__filtered__ = true; + } else { + result = this.clone(); + result.__dir__ *= -1; + } + return result; + } + + /** + * Extracts the unwrapped value from its lazy wrapper. + * + * @private + * @name value + * @memberOf LazyWrapper + * @returns {*} Returns the unwrapped value. + */ + function lazyValue() { + var array = this.__wrapped__.value(), + dir = this.__dir__, + isArr = isArray(array), + isRight = dir < 0, + arrLength = isArr ? array.length : 0, + view = getView(0, arrLength, this.__views__), + start = view.start, + end = view.end, + length = end - start, + index = isRight ? end : (start - 1), + iteratees = this.__iteratees__, + iterLength = iteratees.length, + resIndex = 0, + takeCount = nativeMin(length, this.__takeCount__); + + if (!isArr || (!isRight && arrLength == length && takeCount == length)) { + return baseWrapperValue(array, this.__actions__); + } + var result = []; + + outer: + while (length-- && resIndex < takeCount) { + index += dir; + + var iterIndex = -1, + value = array[index]; + + while (++iterIndex < iterLength) { + var data = iteratees[iterIndex], + iteratee = data.iteratee, + type = data.type, + computed = iteratee(value); + + if (type == LAZY_MAP_FLAG) { + value = computed; + } else if (!computed) { + if (type == LAZY_FILTER_FLAG) { + continue outer; + } else { + break outer; + } + } + } + result[resIndex++] = value; + } + return result; + } + + // Ensure `LazyWrapper` is an instance of `baseLodash`. + LazyWrapper.prototype = baseCreate(baseLodash.prototype); + LazyWrapper.prototype.constructor = LazyWrapper; + + /*------------------------------------------------------------------------*/ + + /** + * Creates a hash object. + * + * @private + * @constructor + * @param {Array} [entries] The key-value pairs to cache. + */ + function Hash(entries) { + var index = -1, + length = entries == null ? 0 : entries.length; + + this.clear(); + while (++index < length) { + var entry = entries[index]; + this.set(entry[0], entry[1]); + } + } + + /** + * Removes all key-value entries from the hash. + * + * @private + * @name clear + * @memberOf Hash + */ + function hashClear() { + this.__data__ = nativeCreate ? nativeCreate(null) : {}; + this.size = 0; + } + + /** + * Removes `key` and its value from the hash. + * + * @private + * @name delete + * @memberOf Hash + * @param {Object} hash The hash to modify. + * @param {string} key The key of the value to remove. + * @returns {boolean} Returns `true` if the entry was removed, else `false`. + */ + function hashDelete(key) { + var result = this.has(key) && delete this.__data__[key]; + this.size -= result ? 1 : 0; + return result; + } + + /** + * Gets the hash value for `key`. + * + * @private + * @name get + * @memberOf Hash + * @param {string} key The key of the value to get. + * @returns {*} Returns the entry value. + */ + function hashGet(key) { + var data = this.__data__; + if (nativeCreate) { + var result = data[key]; + return result === HASH_UNDEFINED ? undefined : result; + } + return hasOwnProperty.call(data, key) ? data[key] : undefined; + } + + /** + * Checks if a hash value for `key` exists. + * + * @private + * @name has + * @memberOf Hash + * @param {string} key The key of the entry to check. + * @returns {boolean} Returns `true` if an entry for `key` exists, else `false`. + */ + function hashHas(key) { + var data = this.__data__; + return nativeCreate ? (data[key] !== undefined) : hasOwnProperty.call(data, key); + } + + /** + * Sets the hash `key` to `value`. + * + * @private + * @name set + * @memberOf Hash + * @param {string} key The key of the value to set. + * @param {*} value The value to set. + * @returns {Object} Returns the hash instance. + */ + function hashSet(key, value) { + var data = this.__data__; + this.size += this.has(key) ? 0 : 1; + data[key] = (nativeCreate && value === undefined) ? HASH_UNDEFINED : value; + return this; + } + + // Add methods to `Hash`. + Hash.prototype.clear = hashClear; + Hash.prototype['delete'] = hashDelete; + Hash.prototype.get = hashGet; + Hash.prototype.has = hashHas; + Hash.prototype.set = hashSet; + + /*------------------------------------------------------------------------*/ + + /** + * Creates an list cache object. + * + * @private + * @constructor + * @param {Array} [entries] The key-value pairs to cache. + */ + function ListCache(entries) { + var index = -1, + length = entries == null ? 0 : entries.length; + + this.clear(); + while (++index < length) { + var entry = entries[index]; + this.set(entry[0], entry[1]); + } + } + + /** + * Removes all key-value entries from the list cache. + * + * @private + * @name clear + * @memberOf ListCache + */ + function listCacheClear() { + this.__data__ = []; + this.size = 0; + } + + /** + * Removes `key` and its value from the list cache. + * + * @private + * @name delete + * @memberOf ListCache + * @param {string} key The key of the value to remove. + * @returns {boolean} Returns `true` if the entry was removed, else `false`. + */ + function listCacheDelete(key) { + var data = this.__data__, + index = assocIndexOf(data, key); + + if (index < 0) { + return false; + } + var lastIndex = data.length - 1; + if (index == lastIndex) { + data.pop(); + } else { + splice.call(data, index, 1); + } + --this.size; + return true; + } + + /** + * Gets the list cache value for `key`. + * + * @private + * @name get + * @memberOf ListCache + * @param {string} key The key of the value to get. + * @returns {*} Returns the entry value. + */ + function listCacheGet(key) { + var data = this.__data__, + index = assocIndexOf(data, key); + + return index < 0 ? undefined : data[index][1]; + } + + /** + * Checks if a list cache value for `key` exists. + * + * @private + * @name has + * @memberOf ListCache + * @param {string} key The key of the entry to check. + * @returns {boolean} Returns `true` if an entry for `key` exists, else `false`. + */ + function listCacheHas(key) { + return assocIndexOf(this.__data__, key) > -1; + } + + /** + * Sets the list cache `key` to `value`. + * + * @private + * @name set + * @memberOf ListCache + * @param {string} key The key of the value to set. + * @param {*} value The value to set. + * @returns {Object} Returns the list cache instance. + */ + function listCacheSet(key, value) { + var data = this.__data__, + index = assocIndexOf(data, key); + + if (index < 0) { + ++this.size; + data.push([key, value]); + } else { + data[index][1] = value; + } + return this; + } + + // Add methods to `ListCache`. + ListCache.prototype.clear = listCacheClear; + ListCache.prototype['delete'] = listCacheDelete; + ListCache.prototype.get = listCacheGet; + ListCache.prototype.has = listCacheHas; + ListCache.prototype.set = listCacheSet; + + /*------------------------------------------------------------------------*/ + + /** + * Creates a map cache object to store key-value pairs. + * + * @private + * @constructor + * @param {Array} [entries] The key-value pairs to cache. + */ + function MapCache(entries) { + var index = -1, + length = entries == null ? 0 : entries.length; + + this.clear(); + while (++index < length) { + var entry = entries[index]; + this.set(entry[0], entry[1]); + } + } + + /** + * Removes all key-value entries from the map. + * + * @private + * @name clear + * @memberOf MapCache + */ + function mapCacheClear() { + this.size = 0; + this.__data__ = { + 'hash': new Hash, + 'map': new (Map || ListCache), + 'string': new Hash + }; + } + + /** + * Removes `key` and its value from the map. + * + * @private + * @name delete + * @memberOf MapCache + * @param {string} key The key of the value to remove. + * @returns {boolean} Returns `true` if the entry was removed, else `false`. + */ + function mapCacheDelete(key) { + var result = getMapData(this, key)['delete'](key); + this.size -= result ? 1 : 0; + return result; + } + + /** + * Gets the map value for `key`. + * + * @private + * @name get + * @memberOf MapCache + * @param {string} key The key of the value to get. + * @returns {*} Returns the entry value. + */ + function mapCacheGet(key) { + return getMapData(this, key).get(key); + } + + /** + * Checks if a map value for `key` exists. + * + * @private + * @name has + * @memberOf MapCache + * @param {string} key The key of the entry to check. + * @returns {boolean} Returns `true` if an entry for `key` exists, else `false`. + */ + function mapCacheHas(key) { + return getMapData(this, key).has(key); + } + + /** + * Sets the map `key` to `value`. + * + * @private + * @name set + * @memberOf MapCache + * @param {string} key The key of the value to set. + * @param {*} value The value to set. + * @returns {Object} Returns the map cache instance. + */ + function mapCacheSet(key, value) { + var data = getMapData(this, key), + size = data.size; + + data.set(key, value); + this.size += data.size == size ? 0 : 1; + return this; + } + + // Add methods to `MapCache`. + MapCache.prototype.clear = mapCacheClear; + MapCache.prototype['delete'] = mapCacheDelete; + MapCache.prototype.get = mapCacheGet; + MapCache.prototype.has = mapCacheHas; + MapCache.prototype.set = mapCacheSet; + + /*------------------------------------------------------------------------*/ + + /** + * + * Creates an array cache object to store unique values. + * + * @private + * @constructor + * @param {Array} [values] The values to cache. + */ + function SetCache(values) { + var index = -1, + length = values == null ? 0 : values.length; + + this.__data__ = new MapCache; + while (++index < length) { + this.add(values[index]); + } + } + + /** + * Adds `value` to the array cache. + * + * @private + * @name add + * @memberOf SetCache + * @alias push + * @param {*} value The value to cache. + * @returns {Object} Returns the cache instance. + */ + function setCacheAdd(value) { + this.__data__.set(value, HASH_UNDEFINED); + return this; + } + + /** + * Checks if `value` is in the array cache. + * + * @private + * @name has + * @memberOf SetCache + * @param {*} value The value to search for. + * @returns {number} Returns `true` if `value` is found, else `false`. + */ + function setCacheHas(value) { + return this.__data__.has(value); + } + + // Add methods to `SetCache`. + SetCache.prototype.add = SetCache.prototype.push = setCacheAdd; + SetCache.prototype.has = setCacheHas; + + /*------------------------------------------------------------------------*/ + + /** + * Creates a stack cache object to store key-value pairs. + * + * @private + * @constructor + * @param {Array} [entries] The key-value pairs to cache. + */ + function Stack(entries) { + var data = this.__data__ = new ListCache(entries); + this.size = data.size; + } + + /** + * Removes all key-value entries from the stack. + * + * @private + * @name clear + * @memberOf Stack + */ + function stackClear() { + this.__data__ = new ListCache; + this.size = 0; + } + + /** + * Removes `key` and its value from the stack. + * + * @private + * @name delete + * @memberOf Stack + * @param {string} key The key of the value to remove. + * @returns {boolean} Returns `true` if the entry was removed, else `false`. + */ + function stackDelete(key) { + var data = this.__data__, + result = data['delete'](key); + + this.size = data.size; + return result; + } + + /** + * Gets the stack value for `key`. + * + * @private + * @name get + * @memberOf Stack + * @param {string} key The key of the value to get. + * @returns {*} Returns the entry value. + */ + function stackGet(key) { + return this.__data__.get(key); + } + + /** + * Checks if a stack value for `key` exists. + * + * @private + * @name has + * @memberOf Stack + * @param {string} key The key of the entry to check. + * @returns {boolean} Returns `true` if an entry for `key` exists, else `false`. + */ + function stackHas(key) { + return this.__data__.has(key); + } + + /** + * Sets the stack `key` to `value`. + * + * @private + * @name set + * @memberOf Stack + * @param {string} key The key of the value to set. + * @param {*} value The value to set. + * @returns {Object} Returns the stack cache instance. + */ + function stackSet(key, value) { + var data = this.__data__; + if (data instanceof ListCache) { + var pairs = data.__data__; + if (!Map || (pairs.length < LARGE_ARRAY_SIZE - 1)) { + pairs.push([key, value]); + this.size = ++data.size; + return this; + } + data = this.__data__ = new MapCache(pairs); + } + data.set(key, value); + this.size = data.size; + return this; + } + + // Add methods to `Stack`. + Stack.prototype.clear = stackClear; + Stack.prototype['delete'] = stackDelete; + Stack.prototype.get = stackGet; + Stack.prototype.has = stackHas; + Stack.prototype.set = stackSet; + + /*------------------------------------------------------------------------*/ + + /** + * Creates an array of the enumerable property names of the array-like `value`. + * + * @private + * @param {*} value The value to query. + * @param {boolean} inherited Specify returning inherited property names. + * @returns {Array} Returns the array of property names. + */ + function arrayLikeKeys(value, inherited) { + var isArr = isArray(value), + isArg = !isArr && isArguments(value), + isBuff = !isArr && !isArg && isBuffer(value), + isType = !isArr && !isArg && !isBuff && isTypedArray(value), + skipIndexes = isArr || isArg || isBuff || isType, + result = skipIndexes ? baseTimes(value.length, String) : [], + length = result.length; + + for (var key in value) { + if ((inherited || hasOwnProperty.call(value, key)) && + !(skipIndexes && ( + // Safari 9 has enumerable `arguments.length` in strict mode. + key == 'length' || + // Node.js 0.10 has enumerable non-index properties on buffers. + (isBuff && (key == 'offset' || key == 'parent')) || + // PhantomJS 2 has enumerable non-index properties on typed arrays. + (isType && (key == 'buffer' || key == 'byteLength' || key == 'byteOffset')) || + // Skip index properties. + isIndex(key, length) + ))) { + result.push(key); + } + } + return result; + } + + /** + * A specialized version of `_.sample` for arrays. + * + * @private + * @param {Array} array The array to sample. + * @returns {*} Returns the random element. + */ + function arraySample(array) { + var length = array.length; + return length ? array[baseRandom(0, length - 1)] : undefined; + } + + /** + * A specialized version of `_.sampleSize` for arrays. + * + * @private + * @param {Array} array The array to sample. + * @param {number} n The number of elements to sample. + * @returns {Array} Returns the random elements. + */ + function arraySampleSize(array, n) { + return shuffleSelf(copyArray(array), baseClamp(n, 0, array.length)); + } + + /** + * A specialized version of `_.shuffle` for arrays. + * + * @private + * @param {Array} array The array to shuffle. + * @returns {Array} Returns the new shuffled array. + */ + function arrayShuffle(array) { + return shuffleSelf(copyArray(array)); + } + + /** + * This function is like `assignValue` except that it doesn't assign + * `undefined` values. + * + * @private + * @param {Object} object The object to modify. + * @param {string} key The key of the property to assign. + * @param {*} value The value to assign. + */ + function assignMergeValue(object, key, value) { + if ((value !== undefined && !eq(object[key], value)) || + (value === undefined && !(key in object))) { + baseAssignValue(object, key, value); + } + } + + /** + * Assigns `value` to `key` of `object` if the existing value is not equivalent + * using [`SameValueZero`](http://ecma-international.org/ecma-262/7.0/#sec-samevaluezero) + * for equality comparisons. + * + * @private + * @param {Object} object The object to modify. + * @param {string} key The key of the property to assign. + * @param {*} value The value to assign. + */ + function assignValue(object, key, value) { + var objValue = object[key]; + if (!(hasOwnProperty.call(object, key) && eq(objValue, value)) || + (value === undefined && !(key in object))) { + baseAssignValue(object, key, value); + } + } + + /** + * Gets the index at which the `key` is found in `array` of key-value pairs. + * + * @private + * @param {Array} array The array to inspect. + * @param {*} key The key to search for. + * @returns {number} Returns the index of the matched value, else `-1`. + */ + function assocIndexOf(array, key) { + var length = array.length; + while (length--) { + if (eq(array[length][0], key)) { + return length; + } + } + return -1; + } + + /** + * Aggregates elements of `collection` on `accumulator` with keys transformed + * by `iteratee` and values set by `setter`. + * + * @private + * @param {Array|Object} collection The collection to iterate over. + * @param {Function} setter The function to set `accumulator` values. + * @param {Function} iteratee The iteratee to transform keys. + * @param {Object} accumulator The initial aggregated object. + * @returns {Function} Returns `accumulator`. + */ + function baseAggregator(collection, setter, iteratee, accumulator) { + baseEach(collection, function(value, key, collection) { + setter(accumulator, value, iteratee(value), collection); + }); + return accumulator; + } + + /** + * The base implementation of `_.assign` without support for multiple sources + * or `customizer` functions. + * + * @private + * @param {Object} object The destination object. + * @param {Object} source The source object. + * @returns {Object} Returns `object`. + */ + function baseAssign(object, source) { + return object && copyObject(source, keys(source), object); + } + + /** + * The base implementation of `_.assignIn` without support for multiple sources + * or `customizer` functions. + * + * @private + * @param {Object} object The destination object. + * @param {Object} source The source object. + * @returns {Object} Returns `object`. + */ + function baseAssignIn(object, source) { + return object && copyObject(source, keysIn(source), object); + } + + /** + * The base implementation of `assignValue` and `assignMergeValue` without + * value checks. + * + * @private + * @param {Object} object The object to modify. + * @param {string} key The key of the property to assign. + * @param {*} value The value to assign. + */ + function baseAssignValue(object, key, value) { + if (key == '__proto__' && defineProperty) { + defineProperty(object, key, { + 'configurable': true, + 'enumerable': true, + 'value': value, + 'writable': true + }); + } else { + object[key] = value; + } + } + + /** + * The base implementation of `_.at` without support for individual paths. + * + * @private + * @param {Object} object The object to iterate over. + * @param {string[]} paths The property paths to pick. + * @returns {Array} Returns the picked elements. + */ + function baseAt(object, paths) { + var index = -1, + length = paths.length, + result = Array(length), + skip = object == null; + + while (++index < length) { + result[index] = skip ? undefined : get(object, paths[index]); + } + return result; + } + + /** + * The base implementation of `_.clamp` which doesn't coerce arguments. + * + * @private + * @param {number} number The number to clamp. + * @param {number} [lower] The lower bound. + * @param {number} upper The upper bound. + * @returns {number} Returns the clamped number. + */ + function baseClamp(number, lower, upper) { + if (number === number) { + if (upper !== undefined) { + number = number <= upper ? number : upper; + } + if (lower !== undefined) { + number = number >= lower ? number : lower; + } + } + return number; + } + + /** + * The base implementation of `_.clone` and `_.cloneDeep` which tracks + * traversed objects. + * + * @private + * @param {*} value The value to clone. + * @param {boolean} bitmask The bitmask flags. + * 1 - Deep clone + * 2 - Flatten inherited properties + * 4 - Clone symbols + * @param {Function} [customizer] The function to customize cloning. + * @param {string} [key] The key of `value`. + * @param {Object} [object] The parent object of `value`. + * @param {Object} [stack] Tracks traversed objects and their clone counterparts. + * @returns {*} Returns the cloned value. + */ + function baseClone(value, bitmask, customizer, key, object, stack) { + var result, + isDeep = bitmask & CLONE_DEEP_FLAG, + isFlat = bitmask & CLONE_FLAT_FLAG, + isFull = bitmask & CLONE_SYMBOLS_FLAG; + + if (customizer) { + result = object ? customizer(value, key, object, stack) : customizer(value); + } + if (result !== undefined) { + return result; + } + if (!isObject(value)) { + return value; + } + var isArr = isArray(value); + if (isArr) { + result = initCloneArray(value); + if (!isDeep) { + return copyArray(value, result); + } + } else { + var tag = getTag(value), + isFunc = tag == funcTag || tag == genTag; + + if (isBuffer(value)) { + return cloneBuffer(value, isDeep); + } + if (tag == objectTag || tag == argsTag || (isFunc && !object)) { + result = (isFlat || isFunc) ? {} : initCloneObject(value); + if (!isDeep) { + return isFlat + ? copySymbolsIn(value, baseAssignIn(result, value)) + : copySymbols(value, baseAssign(result, value)); + } + } else { + if (!cloneableTags[tag]) { + return object ? value : {}; + } + result = initCloneByTag(value, tag, isDeep); + } + } + // Check for circular references and return its corresponding clone. + stack || (stack = new Stack); + var stacked = stack.get(value); + if (stacked) { + return stacked; + } + stack.set(value, result); + + if (isSet(value)) { + value.forEach(function(subValue) { + result.add(baseClone(subValue, bitmask, customizer, subValue, value, stack)); + }); + } else if (isMap(value)) { + value.forEach(function(subValue, key) { + result.set(key, baseClone(subValue, bitmask, customizer, key, value, stack)); + }); + } + + var keysFunc = isFull + ? (isFlat ? getAllKeysIn : getAllKeys) + : (isFlat ? keysIn : keys); + + var props = isArr ? undefined : keysFunc(value); + arrayEach(props || value, function(subValue, key) { + if (props) { + key = subValue; + subValue = value[key]; + } + // Recursively populate clone (susceptible to call stack limits). + assignValue(result, key, baseClone(subValue, bitmask, customizer, key, value, stack)); + }); + return result; + } + + /** + * The base implementation of `_.conforms` which doesn't clone `source`. + * + * @private + * @param {Object} source The object of property predicates to conform to. + * @returns {Function} Returns the new spec function. + */ + function baseConforms(source) { + var props = keys(source); + return function(object) { + return baseConformsTo(object, source, props); + }; + } + + /** + * The base implementation of `_.conformsTo` which accepts `props` to check. + * + * @private + * @param {Object} object The object to inspect. + * @param {Object} source The object of property predicates to conform to. + * @returns {boolean} Returns `true` if `object` conforms, else `false`. + */ + function baseConformsTo(object, source, props) { + var length = props.length; + if (object == null) { + return !length; + } + object = Object(object); + while (length--) { + var key = props[length], + predicate = source[key], + value = object[key]; + + if ((value === undefined && !(key in object)) || !predicate(value)) { + return false; + } + } + return true; + } + + /** + * The base implementation of `_.delay` and `_.defer` which accepts `args` + * to provide to `func`. + * + * @private + * @param {Function} func The function to delay. + * @param {number} wait The number of milliseconds to delay invocation. + * @param {Array} args The arguments to provide to `func`. + * @returns {number|Object} Returns the timer id or timeout object. + */ + function baseDelay(func, wait, args) { + if (typeof func != 'function') { + throw new TypeError(FUNC_ERROR_TEXT); + } + return setTimeout(function() { func.apply(undefined, args); }, wait); + } + + /** + * The base implementation of methods like `_.difference` without support + * for excluding multiple arrays or iteratee shorthands. + * + * @private + * @param {Array} array The array to inspect. + * @param {Array} values The values to exclude. + * @param {Function} [iteratee] The iteratee invoked per element. + * @param {Function} [comparator] The comparator invoked per element. + * @returns {Array} Returns the new array of filtered values. + */ + function baseDifference(array, values, iteratee, comparator) { + var index = -1, + includes = arrayIncludes, + isCommon = true, + length = array.length, + result = [], + valuesLength = values.length; + + if (!length) { + return result; + } + if (iteratee) { + values = arrayMap(values, baseUnary(iteratee)); + } + if (comparator) { + includes = arrayIncludesWith; + isCommon = false; + } + else if (values.length >= LARGE_ARRAY_SIZE) { + includes = cacheHas; + isCommon = false; + values = new SetCache(values); + } + outer: + while (++index < length) { + var value = array[index], + computed = iteratee == null ? value : iteratee(value); + + value = (comparator || value !== 0) ? value : 0; + if (isCommon && computed === computed) { + var valuesIndex = valuesLength; + while (valuesIndex--) { + if (values[valuesIndex] === computed) { + continue outer; + } + } + result.push(value); + } + else if (!includes(values, computed, comparator)) { + result.push(value); + } + } + return result; + } + + /** + * The base implementation of `_.forEach` without support for iteratee shorthands. + * + * @private + * @param {Array|Object} collection The collection to iterate over. + * @param {Function} iteratee The function invoked per iteration. + * @returns {Array|Object} Returns `collection`. + */ + var baseEach = createBaseEach(baseForOwn); + + /** + * The base implementation of `_.forEachRight` without support for iteratee shorthands. + * + * @private + * @param {Array|Object} collection The collection to iterate over. + * @param {Function} iteratee The function invoked per iteration. + * @returns {Array|Object} Returns `collection`. + */ + var baseEachRight = createBaseEach(baseForOwnRight, true); + + /** + * The base implementation of `_.every` without support for iteratee shorthands. + * + * @private + * @param {Array|Object} collection The collection to iterate over. + * @param {Function} predicate The function invoked per iteration. + * @returns {boolean} Returns `true` if all elements pass the predicate check, + * else `false` + */ + function baseEvery(collection, predicate) { + var result = true; + baseEach(collection, function(value, index, collection) { + result = !!predicate(value, index, collection); + return result; + }); + return result; + } + + /** + * The base implementation of methods like `_.max` and `_.min` which accepts a + * `comparator` to determine the extremum value. + * + * @private + * @param {Array} array The array to iterate over. + * @param {Function} iteratee The iteratee invoked per iteration. + * @param {Function} comparator The comparator used to compare values. + * @returns {*} Returns the extremum value. + */ + function baseExtremum(array, iteratee, comparator) { + var index = -1, + length = array.length; + + while (++index < length) { + var value = array[index], + current = iteratee(value); + + if (current != null && (computed === undefined + ? (current === current && !isSymbol(current)) + : comparator(current, computed) + )) { + var computed = current, + result = value; + } + } + return result; + } + + /** + * The base implementation of `_.fill` without an iteratee call guard. + * + * @private + * @param {Array} array The array to fill. + * @param {*} value The value to fill `array` with. + * @param {number} [start=0] The start position. + * @param {number} [end=array.length] The end position. + * @returns {Array} Returns `array`. + */ + function baseFill(array, value, start, end) { + var length = array.length; + + start = toInteger(start); + if (start < 0) { + start = -start > length ? 0 : (length + start); + } + end = (end === undefined || end > length) ? length : toInteger(end); + if (end < 0) { + end += length; + } + end = start > end ? 0 : toLength(end); + while (start < end) { + array[start++] = value; + } + return array; + } + + /** + * The base implementation of `_.filter` without support for iteratee shorthands. + * + * @private + * @param {Array|Object} collection The collection to iterate over. + * @param {Function} predicate The function invoked per iteration. + * @returns {Array} Returns the new filtered array. + */ + function baseFilter(collection, predicate) { + var result = []; + baseEach(collection, function(value, index, collection) { + if (predicate(value, index, collection)) { + result.push(value); + } + }); + return result; + } + + /** + * The base implementation of `_.flatten` with support for restricting flattening. + * + * @private + * @param {Array} array The array to flatten. + * @param {number} depth The maximum recursion depth. + * @param {boolean} [predicate=isFlattenable] The function invoked per iteration. + * @param {boolean} [isStrict] Restrict to values that pass `predicate` checks. + * @param {Array} [result=[]] The initial result value. + * @returns {Array} Returns the new flattened array. + */ + function baseFlatten(array, depth, predicate, isStrict, result) { + var index = -1, + length = array.length; + + predicate || (predicate = isFlattenable); + result || (result = []); + + while (++index < length) { + var value = array[index]; + if (depth > 0 && predicate(value)) { + if (depth > 1) { + // Recursively flatten arrays (susceptible to call stack limits). + baseFlatten(value, depth - 1, predicate, isStrict, result); + } else { + arrayPush(result, value); + } + } else if (!isStrict) { + result[result.length] = value; + } + } + return result; + } + + /** + * The base implementation of `baseForOwn` which iterates over `object` + * properties returned by `keysFunc` and invokes `iteratee` for each property. + * Iteratee functions may exit iteration early by explicitly returning `false`. + * + * @private + * @param {Object} object The object to iterate over. + * @param {Function} iteratee The function invoked per iteration. + * @param {Function} keysFunc The function to get the keys of `object`. + * @returns {Object} Returns `object`. + */ + var baseFor = createBaseFor(); + + /** + * This function is like `baseFor` except that it iterates over properties + * in the opposite order. + * + * @private + * @param {Object} object The object to iterate over. + * @param {Function} iteratee The function invoked per iteration. + * @param {Function} keysFunc The function to get the keys of `object`. + * @returns {Object} Returns `object`. + */ + var baseForRight = createBaseFor(true); + + /** + * The base implementation of `_.forOwn` without support for iteratee shorthands. + * + * @private + * @param {Object} object The object to iterate over. + * @param {Function} iteratee The function invoked per iteration. + * @returns {Object} Returns `object`. + */ + function baseForOwn(object, iteratee) { + return object && baseFor(object, iteratee, keys); + } + + /** + * The base implementation of `_.forOwnRight` without support for iteratee shorthands. + * + * @private + * @param {Object} object The object to iterate over. + * @param {Function} iteratee The function invoked per iteration. + * @returns {Object} Returns `object`. + */ + function baseForOwnRight(object, iteratee) { + return object && baseForRight(object, iteratee, keys); + } + + /** + * The base implementation of `_.functions` which creates an array of + * `object` function property names filtered from `props`. + * + * @private + * @param {Object} object The object to inspect. + * @param {Array} props The property names to filter. + * @returns {Array} Returns the function names. + */ + function baseFunctions(object, props) { + return arrayFilter(props, function(key) { + return isFunction(object[key]); + }); + } + + /** + * The base implementation of `_.get` without support for default values. + * + * @private + * @param {Object} object The object to query. + * @param {Array|string} path The path of the property to get. + * @returns {*} Returns the resolved value. + */ + function baseGet(object, path) { + path = castPath(path, object); + + var index = 0, + length = path.length; + + while (object != null && index < length) { + object = object[toKey(path[index++])]; + } + return (index && index == length) ? object : undefined; + } + + /** + * The base implementation of `getAllKeys` and `getAllKeysIn` which uses + * `keysFunc` and `symbolsFunc` to get the enumerable property names and + * symbols of `object`. + * + * @private + * @param {Object} object The object to query. + * @param {Function} keysFunc The function to get the keys of `object`. + * @param {Function} symbolsFunc The function to get the symbols of `object`. + * @returns {Array} Returns the array of property names and symbols. + */ + function baseGetAllKeys(object, keysFunc, symbolsFunc) { + var result = keysFunc(object); + return isArray(object) ? result : arrayPush(result, symbolsFunc(object)); + } + + /** + * The base implementation of `getTag` without fallbacks for buggy environments. + * + * @private + * @param {*} value The value to query. + * @returns {string} Returns the `toStringTag`. + */ + function baseGetTag(value) { + if (value == null) { + return value === undefined ? undefinedTag : nullTag; + } + return (symToStringTag && symToStringTag in Object(value)) + ? getRawTag(value) + : objectToString(value); + } + + /** + * The base implementation of `_.gt` which doesn't coerce arguments. + * + * @private + * @param {*} value The value to compare. + * @param {*} other The other value to compare. + * @returns {boolean} Returns `true` if `value` is greater than `other`, + * else `false`. + */ + function baseGt(value, other) { + return value > other; + } + + /** + * The base implementation of `_.has` without support for deep paths. + * + * @private + * @param {Object} [object] The object to query. + * @param {Array|string} key The key to check. + * @returns {boolean} Returns `true` if `key` exists, else `false`. + */ + function baseHas(object, key) { + return object != null && hasOwnProperty.call(object, key); + } + + /** + * The base implementation of `_.hasIn` without support for deep paths. + * + * @private + * @param {Object} [object] The object to query. + * @param {Array|string} key The key to check. + * @returns {boolean} Returns `true` if `key` exists, else `false`. + */ + function baseHasIn(object, key) { + return object != null && key in Object(object); + } + + /** + * The base implementation of `_.inRange` which doesn't coerce arguments. + * + * @private + * @param {number} number The number to check. + * @param {number} start The start of the range. + * @param {number} end The end of the range. + * @returns {boolean} Returns `true` if `number` is in the range, else `false`. + */ + function baseInRange(number, start, end) { + return number >= nativeMin(start, end) && number < nativeMax(start, end); + } + + /** + * The base implementation of methods like `_.intersection`, without support + * for iteratee shorthands, that accepts an array of arrays to inspect. + * + * @private + * @param {Array} arrays The arrays to inspect. + * @param {Function} [iteratee] The iteratee invoked per element. + * @param {Function} [comparator] The comparator invoked per element. + * @returns {Array} Returns the new array of shared values. + */ + function baseIntersection(arrays, iteratee, comparator) { + var includes = comparator ? arrayIncludesWith : arrayIncludes, + length = arrays[0].length, + othLength = arrays.length, + othIndex = othLength, + caches = Array(othLength), + maxLength = Infinity, + result = []; + + while (othIndex--) { + var array = arrays[othIndex]; + if (othIndex && iteratee) { + array = arrayMap(array, baseUnary(iteratee)); + } + maxLength = nativeMin(array.length, maxLength); + caches[othIndex] = !comparator && (iteratee || (length >= 120 && array.length >= 120)) + ? new SetCache(othIndex && array) + : undefined; + } + array = arrays[0]; + + var index = -1, + seen = caches[0]; + + outer: + while (++index < length && result.length < maxLength) { + var value = array[index], + computed = iteratee ? iteratee(value) : value; + + value = (comparator || value !== 0) ? value : 0; + if (!(seen + ? cacheHas(seen, computed) + : includes(result, computed, comparator) + )) { + othIndex = othLength; + while (--othIndex) { + var cache = caches[othIndex]; + if (!(cache + ? cacheHas(cache, computed) + : includes(arrays[othIndex], computed, comparator)) + ) { + continue outer; + } + } + if (seen) { + seen.push(computed); + } + result.push(value); + } + } + return result; + } + + /** + * The base implementation of `_.invert` and `_.invertBy` which inverts + * `object` with values transformed by `iteratee` and set by `setter`. + * + * @private + * @param {Object} object The object to iterate over. + * @param {Function} setter The function to set `accumulator` values. + * @param {Function} iteratee The iteratee to transform values. + * @param {Object} accumulator The initial inverted object. + * @returns {Function} Returns `accumulator`. + */ + function baseInverter(object, setter, iteratee, accumulator) { + baseForOwn(object, function(value, key, object) { + setter(accumulator, iteratee(value), key, object); + }); + return accumulator; + } + + /** + * The base implementation of `_.invoke` without support for individual + * method arguments. + * + * @private + * @param {Object} object The object to query. + * @param {Array|string} path The path of the method to invoke. + * @param {Array} args The arguments to invoke the method with. + * @returns {*} Returns the result of the invoked method. + */ + function baseInvoke(object, path, args) { + path = castPath(path, object); + object = parent(object, path); + var func = object == null ? object : object[toKey(last(path))]; + return func == null ? undefined : apply(func, object, args); + } + + /** + * The base implementation of `_.isArguments`. + * + * @private + * @param {*} value The value to check. + * @returns {boolean} Returns `true` if `value` is an `arguments` object, + */ + function baseIsArguments(value) { + return isObjectLike(value) && baseGetTag(value) == argsTag; + } + + /** + * The base implementation of `_.isArrayBuffer` without Node.js optimizations. + * + * @private + * @param {*} value The value to check. + * @returns {boolean} Returns `true` if `value` is an array buffer, else `false`. + */ + function baseIsArrayBuffer(value) { + return isObjectLike(value) && baseGetTag(value) == arrayBufferTag; + } + + /** + * The base implementation of `_.isDate` without Node.js optimizations. + * + * @private + * @param {*} value The value to check. + * @returns {boolean} Returns `true` if `value` is a date object, else `false`. + */ + function baseIsDate(value) { + return isObjectLike(value) && baseGetTag(value) == dateTag; + } + + /** + * The base implementation of `_.isEqual` which supports partial comparisons + * and tracks traversed objects. + * + * @private + * @param {*} value The value to compare. + * @param {*} other The other value to compare. + * @param {boolean} bitmask The bitmask flags. + * 1 - Unordered comparison + * 2 - Partial comparison + * @param {Function} [customizer] The function to customize comparisons. + * @param {Object} [stack] Tracks traversed `value` and `other` objects. + * @returns {boolean} Returns `true` if the values are equivalent, else `false`. + */ + function baseIsEqual(value, other, bitmask, customizer, stack) { + if (value === other) { + return true; + } + if (value == null || other == null || (!isObjectLike(value) && !isObjectLike(other))) { + return value !== value && other !== other; + } + return baseIsEqualDeep(value, other, bitmask, customizer, baseIsEqual, stack); + } + + /** + * A specialized version of `baseIsEqual` for arrays and objects which performs + * deep comparisons and tracks traversed objects enabling objects with circular + * references to be compared. + * + * @private + * @param {Object} object The object to compare. + * @param {Object} other The other object to compare. + * @param {number} bitmask The bitmask flags. See `baseIsEqual` for more details. + * @param {Function} customizer The function to customize comparisons. + * @param {Function} equalFunc The function to determine equivalents of values. + * @param {Object} [stack] Tracks traversed `object` and `other` objects. + * @returns {boolean} Returns `true` if the objects are equivalent, else `false`. + */ + function baseIsEqualDeep(object, other, bitmask, customizer, equalFunc, stack) { + var objIsArr = isArray(object), + othIsArr = isArray(other), + objTag = objIsArr ? arrayTag : getTag(object), + othTag = othIsArr ? arrayTag : getTag(other); + + objTag = objTag == argsTag ? objectTag : objTag; + othTag = othTag == argsTag ? objectTag : othTag; + + var objIsObj = objTag == objectTag, + othIsObj = othTag == objectTag, + isSameTag = objTag == othTag; + + if (isSameTag && isBuffer(object)) { + if (!isBuffer(other)) { + return false; + } + objIsArr = true; + objIsObj = false; + } + if (isSameTag && !objIsObj) { + stack || (stack = new Stack); + return (objIsArr || isTypedArray(object)) + ? equalArrays(object, other, bitmask, customizer, equalFunc, stack) + : equalByTag(object, other, objTag, bitmask, customizer, equalFunc, stack); + } + if (!(bitmask & COMPARE_PARTIAL_FLAG)) { + var objIsWrapped = objIsObj && hasOwnProperty.call(object, '__wrapped__'), + othIsWrapped = othIsObj && hasOwnProperty.call(other, '__wrapped__'); + + if (objIsWrapped || othIsWrapped) { + var objUnwrapped = objIsWrapped ? object.value() : object, + othUnwrapped = othIsWrapped ? other.value() : other; + + stack || (stack = new Stack); + return equalFunc(objUnwrapped, othUnwrapped, bitmask, customizer, stack); + } + } + if (!isSameTag) { + return false; + } + stack || (stack = new Stack); + return equalObjects(object, other, bitmask, customizer, equalFunc, stack); + } + + /** + * The base implementation of `_.isMap` without Node.js optimizations. + * + * @private + * @param {*} value The value to check. + * @returns {boolean} Returns `true` if `value` is a map, else `false`. + */ + function baseIsMap(value) { + return isObjectLike(value) && getTag(value) == mapTag; + } + + /** + * The base implementation of `_.isMatch` without support for iteratee shorthands. + * + * @private + * @param {Object} object The object to inspect. + * @param {Object} source The object of property values to match. + * @param {Array} matchData The property names, values, and compare flags to match. + * @param {Function} [customizer] The function to customize comparisons. + * @returns {boolean} Returns `true` if `object` is a match, else `false`. + */ + function baseIsMatch(object, source, matchData, customizer) { + var index = matchData.length, + length = index, + noCustomizer = !customizer; + + if (object == null) { + return !length; + } + object = Object(object); + while (index--) { + var data = matchData[index]; + if ((noCustomizer && data[2]) + ? data[1] !== object[data[0]] + : !(data[0] in object) + ) { + return false; + } + } + while (++index < length) { + data = matchData[index]; + var key = data[0], + objValue = object[key], + srcValue = data[1]; + + if (noCustomizer && data[2]) { + if (objValue === undefined && !(key in object)) { + return false; + } + } else { + var stack = new Stack; + if (customizer) { + var result = customizer(objValue, srcValue, key, object, source, stack); + } + if (!(result === undefined + ? baseIsEqual(srcValue, objValue, COMPARE_PARTIAL_FLAG | COMPARE_UNORDERED_FLAG, customizer, stack) + : result + )) { + return false; + } + } + } + return true; + } + + /** + * The base implementation of `_.isNative` without bad shim checks. + * + * @private + * @param {*} value The value to check. + * @returns {boolean} Returns `true` if `value` is a native function, + * else `false`. + */ + function baseIsNative(value) { + if (!isObject(value) || isMasked(value)) { + return false; + } + var pattern = isFunction(value) ? reIsNative : reIsHostCtor; + return pattern.test(toSource(value)); + } + + /** + * The base implementation of `_.isRegExp` without Node.js optimizations. + * + * @private + * @param {*} value The value to check. + * @returns {boolean} Returns `true` if `value` is a regexp, else `false`. + */ + function baseIsRegExp(value) { + return isObjectLike(value) && baseGetTag(value) == regexpTag; + } + + /** + * The base implementation of `_.isSet` without Node.js optimizations. + * + * @private + * @param {*} value The value to check. + * @returns {boolean} Returns `true` if `value` is a set, else `false`. + */ + function baseIsSet(value) { + return isObjectLike(value) && getTag(value) == setTag; + } + + /** + * The base implementation of `_.isTypedArray` without Node.js optimizations. + * + * @private + * @param {*} value The value to check. + * @returns {boolean} Returns `true` if `value` is a typed array, else `false`. + */ + function baseIsTypedArray(value) { + return isObjectLike(value) && + isLength(value.length) && !!typedArrayTags[baseGetTag(value)]; + } + + /** + * The base implementation of `_.iteratee`. + * + * @private + * @param {*} [value=_.identity] The value to convert to an iteratee. + * @returns {Function} Returns the iteratee. + */ + function baseIteratee(value) { + // Don't store the `typeof` result in a variable to avoid a JIT bug in Safari 9. + // See https://bugs.webkit.org/show_bug.cgi?id=156034 for more details. + if (typeof value == 'function') { + return value; + } + if (value == null) { + return identity; + } + if (typeof value == 'object') { + return isArray(value) + ? baseMatchesProperty(value[0], value[1]) + : baseMatches(value); + } + return property(value); + } + + /** + * The base implementation of `_.keys` which doesn't treat sparse arrays as dense. + * + * @private + * @param {Object} object The object to query. + * @returns {Array} Returns the array of property names. + */ + function baseKeys(object) { + if (!isPrototype(object)) { + return nativeKeys(object); + } + var result = []; + for (var key in Object(object)) { + if (hasOwnProperty.call(object, key) && key != 'constructor') { + result.push(key); + } + } + return result; + } + + /** + * The base implementation of `_.keysIn` which doesn't treat sparse arrays as dense. + * + * @private + * @param {Object} object The object to query. + * @returns {Array} Returns the array of property names. + */ + function baseKeysIn(object) { + if (!isObject(object)) { + return nativeKeysIn(object); + } + var isProto = isPrototype(object), + result = []; + + for (var key in object) { + if (!(key == 'constructor' && (isProto || !hasOwnProperty.call(object, key)))) { + result.push(key); + } + } + return result; + } + + /** + * The base implementation of `_.lt` which doesn't coerce arguments. + * + * @private + * @param {*} value The value to compare. + * @param {*} other The other value to compare. + * @returns {boolean} Returns `true` if `value` is less than `other`, + * else `false`. + */ + function baseLt(value, other) { + return value < other; + } + + /** + * The base implementation of `_.map` without support for iteratee shorthands. + * + * @private + * @param {Array|Object} collection The collection to iterate over. + * @param {Function} iteratee The function invoked per iteration. + * @returns {Array} Returns the new mapped array. + */ + function baseMap(collection, iteratee) { + var index = -1, + result = isArrayLike(collection) ? Array(collection.length) : []; + + baseEach(collection, function(value, key, collection) { + result[++index] = iteratee(value, key, collection); + }); + return result; + } + + /** + * The base implementation of `_.matches` which doesn't clone `source`. + * + * @private + * @param {Object} source The object of property values to match. + * @returns {Function} Returns the new spec function. + */ + function baseMatches(source) { + var matchData = getMatchData(source); + if (matchData.length == 1 && matchData[0][2]) { + return matchesStrictComparable(matchData[0][0], matchData[0][1]); + } + return function(object) { + return object === source || baseIsMatch(object, source, matchData); + }; + } + + /** + * The base implementation of `_.matchesProperty` which doesn't clone `srcValue`. + * + * @private + * @param {string} path The path of the property to get. + * @param {*} srcValue The value to match. + * @returns {Function} Returns the new spec function. + */ + function baseMatchesProperty(path, srcValue) { + if (isKey(path) && isStrictComparable(srcValue)) { + return matchesStrictComparable(toKey(path), srcValue); + } + return function(object) { + var objValue = get(object, path); + return (objValue === undefined && objValue === srcValue) + ? hasIn(object, path) + : baseIsEqual(srcValue, objValue, COMPARE_PARTIAL_FLAG | COMPARE_UNORDERED_FLAG); + }; + } + + /** + * The base implementation of `_.merge` without support for multiple sources. + * + * @private + * @param {Object} object The destination object. + * @param {Object} source The source object. + * @param {number} srcIndex The index of `source`. + * @param {Function} [customizer] The function to customize merged values. + * @param {Object} [stack] Tracks traversed source values and their merged + * counterparts. + */ + function baseMerge(object, source, srcIndex, customizer, stack) { + if (object === source) { + return; + } + baseFor(source, function(srcValue, key) { + stack || (stack = new Stack); + if (isObject(srcValue)) { + baseMergeDeep(object, source, key, srcIndex, baseMerge, customizer, stack); + } + else { + var newValue = customizer + ? customizer(safeGet(object, key), srcValue, (key + ''), object, source, stack) + : undefined; + + if (newValue === undefined) { + newValue = srcValue; + } + assignMergeValue(object, key, newValue); + } + }, keysIn); + } + + /** + * A specialized version of `baseMerge` for arrays and objects which performs + * deep merges and tracks traversed objects enabling objects with circular + * references to be merged. + * + * @private + * @param {Object} object The destination object. + * @param {Object} source The source object. + * @param {string} key The key of the value to merge. + * @param {number} srcIndex The index of `source`. + * @param {Function} mergeFunc The function to merge values. + * @param {Function} [customizer] The function to customize assigned values. + * @param {Object} [stack] Tracks traversed source values and their merged + * counterparts. + */ + function baseMergeDeep(object, source, key, srcIndex, mergeFunc, customizer, stack) { + var objValue = safeGet(object, key), + srcValue = safeGet(source, key), + stacked = stack.get(srcValue); + + if (stacked) { + assignMergeValue(object, key, stacked); + return; + } + var newValue = customizer + ? customizer(objValue, srcValue, (key + ''), object, source, stack) + : undefined; + + var isCommon = newValue === undefined; + + if (isCommon) { + var isArr = isArray(srcValue), + isBuff = !isArr && isBuffer(srcValue), + isTyped = !isArr && !isBuff && isTypedArray(srcValue); + + newValue = srcValue; + if (isArr || isBuff || isTyped) { + if (isArray(objValue)) { + newValue = objValue; + } + else if (isArrayLikeObject(objValue)) { + newValue = copyArray(objValue); + } + else if (isBuff) { + isCommon = false; + newValue = cloneBuffer(srcValue, true); + } + else if (isTyped) { + isCommon = false; + newValue = cloneTypedArray(srcValue, true); + } + else { + newValue = []; + } + } + else if (isPlainObject(srcValue) || isArguments(srcValue)) { + newValue = objValue; + if (isArguments(objValue)) { + newValue = toPlainObject(objValue); + } + else if (!isObject(objValue) || isFunction(objValue)) { + newValue = initCloneObject(srcValue); + } + } + else { + isCommon = false; + } + } + if (isCommon) { + // Recursively merge objects and arrays (susceptible to call stack limits). + stack.set(srcValue, newValue); + mergeFunc(newValue, srcValue, srcIndex, customizer, stack); + stack['delete'](srcValue); + } + assignMergeValue(object, key, newValue); + } + + /** + * The base implementation of `_.nth` which doesn't coerce arguments. + * + * @private + * @param {Array} array The array to query. + * @param {number} n The index of the element to return. + * @returns {*} Returns the nth element of `array`. + */ + function baseNth(array, n) { + var length = array.length; + if (!length) { + return; + } + n += n < 0 ? length : 0; + return isIndex(n, length) ? array[n] : undefined; + } + + /** + * The base implementation of `_.orderBy` without param guards. + * + * @private + * @param {Array|Object} collection The collection to iterate over. + * @param {Function[]|Object[]|string[]} iteratees The iteratees to sort by. + * @param {string[]} orders The sort orders of `iteratees`. + * @returns {Array} Returns the new sorted array. + */ + function baseOrderBy(collection, iteratees, orders) { + if (iteratees.length) { + iteratees = arrayMap(iteratees, function(iteratee) { + if (isArray(iteratee)) { + return function(value) { + return baseGet(value, iteratee.length === 1 ? iteratee[0] : iteratee); + } + } + return iteratee; + }); + } else { + iteratees = [identity]; + } + + var index = -1; + iteratees = arrayMap(iteratees, baseUnary(getIteratee())); + + var result = baseMap(collection, function(value, key, collection) { + var criteria = arrayMap(iteratees, function(iteratee) { + return iteratee(value); + }); + return { 'criteria': criteria, 'index': ++index, 'value': value }; + }); + + return baseSortBy(result, function(object, other) { + return compareMultiple(object, other, orders); + }); + } + + /** + * The base implementation of `_.pick` without support for individual + * property identifiers. + * + * @private + * @param {Object} object The source object. + * @param {string[]} paths The property paths to pick. + * @returns {Object} Returns the new object. + */ + function basePick(object, paths) { + return basePickBy(object, paths, function(value, path) { + return hasIn(object, path); + }); + } + + /** + * The base implementation of `_.pickBy` without support for iteratee shorthands. + * + * @private + * @param {Object} object The source object. + * @param {string[]} paths The property paths to pick. + * @param {Function} predicate The function invoked per property. + * @returns {Object} Returns the new object. + */ + function basePickBy(object, paths, predicate) { + var index = -1, + length = paths.length, + result = {}; + + while (++index < length) { + var path = paths[index], + value = baseGet(object, path); + + if (predicate(value, path)) { + baseSet(result, castPath(path, object), value); + } + } + return result; + } + + /** + * A specialized version of `baseProperty` which supports deep paths. + * + * @private + * @param {Array|string} path The path of the property to get. + * @returns {Function} Returns the new accessor function. + */ + function basePropertyDeep(path) { + return function(object) { + return baseGet(object, path); + }; + } + + /** + * The base implementation of `_.pullAllBy` without support for iteratee + * shorthands. + * + * @private + * @param {Array} array The array to modify. + * @param {Array} values The values to remove. + * @param {Function} [iteratee] The iteratee invoked per element. + * @param {Function} [comparator] The comparator invoked per element. + * @returns {Array} Returns `array`. + */ + function basePullAll(array, values, iteratee, comparator) { + var indexOf = comparator ? baseIndexOfWith : baseIndexOf, + index = -1, + length = values.length, + seen = array; + + if (array === values) { + values = copyArray(values); + } + if (iteratee) { + seen = arrayMap(array, baseUnary(iteratee)); + } + while (++index < length) { + var fromIndex = 0, + value = values[index], + computed = iteratee ? iteratee(value) : value; + + while ((fromIndex = indexOf(seen, computed, fromIndex, comparator)) > -1) { + if (seen !== array) { + splice.call(seen, fromIndex, 1); + } + splice.call(array, fromIndex, 1); + } + } + return array; + } + + /** + * The base implementation of `_.pullAt` without support for individual + * indexes or capturing the removed elements. + * + * @private + * @param {Array} array The array to modify. + * @param {number[]} indexes The indexes of elements to remove. + * @returns {Array} Returns `array`. + */ + function basePullAt(array, indexes) { + var length = array ? indexes.length : 0, + lastIndex = length - 1; + + while (length--) { + var index = indexes[length]; + if (length == lastIndex || index !== previous) { + var previous = index; + if (isIndex(index)) { + splice.call(array, index, 1); + } else { + baseUnset(array, index); + } + } + } + return array; + } + + /** + * The base implementation of `_.random` without support for returning + * floating-point numbers. + * + * @private + * @param {number} lower The lower bound. + * @param {number} upper The upper bound. + * @returns {number} Returns the random number. + */ + function baseRandom(lower, upper) { + return lower + nativeFloor(nativeRandom() * (upper - lower + 1)); + } + + /** + * The base implementation of `_.range` and `_.rangeRight` which doesn't + * coerce arguments. + * + * @private + * @param {number} start The start of the range. + * @param {number} end The end of the range. + * @param {number} step The value to increment or decrement by. + * @param {boolean} [fromRight] Specify iterating from right to left. + * @returns {Array} Returns the range of numbers. + */ + function baseRange(start, end, step, fromRight) { + var index = -1, + length = nativeMax(nativeCeil((end - start) / (step || 1)), 0), + result = Array(length); + + while (length--) { + result[fromRight ? length : ++index] = start; + start += step; + } + return result; + } + + /** + * The base implementation of `_.repeat` which doesn't coerce arguments. + * + * @private + * @param {string} string The string to repeat. + * @param {number} n The number of times to repeat the string. + * @returns {string} Returns the repeated string. + */ + function baseRepeat(string, n) { + var result = ''; + if (!string || n < 1 || n > MAX_SAFE_INTEGER) { + return result; + } + // Leverage the exponentiation by squaring algorithm for a faster repeat. + // See https://en.wikipedia.org/wiki/Exponentiation_by_squaring for more details. + do { + if (n % 2) { + result += string; + } + n = nativeFloor(n / 2); + if (n) { + string += string; + } + } while (n); + + return result; + } + + /** + * The base implementation of `_.rest` which doesn't validate or coerce arguments. + * + * @private + * @param {Function} func The function to apply a rest parameter to. + * @param {number} [start=func.length-1] The start position of the rest parameter. + * @returns {Function} Returns the new function. + */ + function baseRest(func, start) { + return setToString(overRest(func, start, identity), func + ''); + } + + /** + * The base implementation of `_.sample`. + * + * @private + * @param {Array|Object} collection The collection to sample. + * @returns {*} Returns the random element. + */ + function baseSample(collection) { + return arraySample(values(collection)); + } + + /** + * The base implementation of `_.sampleSize` without param guards. + * + * @private + * @param {Array|Object} collection The collection to sample. + * @param {number} n The number of elements to sample. + * @returns {Array} Returns the random elements. + */ + function baseSampleSize(collection, n) { + var array = values(collection); + return shuffleSelf(array, baseClamp(n, 0, array.length)); + } + + /** + * The base implementation of `_.set`. + * + * @private + * @param {Object} object The object to modify. + * @param {Array|string} path The path of the property to set. + * @param {*} value The value to set. + * @param {Function} [customizer] The function to customize path creation. + * @returns {Object} Returns `object`. + */ + function baseSet(object, path, value, customizer) { + if (!isObject(object)) { + return object; + } + path = castPath(path, object); + + var index = -1, + length = path.length, + lastIndex = length - 1, + nested = object; + + while (nested != null && ++index < length) { + var key = toKey(path[index]), + newValue = value; + + if (key === '__proto__' || key === 'constructor' || key === 'prototype') { + return object; + } + + if (index != lastIndex) { + var objValue = nested[key]; + newValue = customizer ? customizer(objValue, key, nested) : undefined; + if (newValue === undefined) { + newValue = isObject(objValue) + ? objValue + : (isIndex(path[index + 1]) ? [] : {}); + } + } + assignValue(nested, key, newValue); + nested = nested[key]; + } + return object; + } + + /** + * The base implementation of `setData` without support for hot loop shorting. + * + * @private + * @param {Function} func The function to associate metadata with. + * @param {*} data The metadata. + * @returns {Function} Returns `func`. + */ + var baseSetData = !metaMap ? identity : function(func, data) { + metaMap.set(func, data); + return func; + }; + + /** + * The base implementation of `setToString` without support for hot loop shorting. + * + * @private + * @param {Function} func The function to modify. + * @param {Function} string The `toString` result. + * @returns {Function} Returns `func`. + */ + var baseSetToString = !defineProperty ? identity : function(func, string) { + return defineProperty(func, 'toString', { + 'configurable': true, + 'enumerable': false, + 'value': constant(string), + 'writable': true + }); + }; + + /** + * The base implementation of `_.shuffle`. + * + * @private + * @param {Array|Object} collection The collection to shuffle. + * @returns {Array} Returns the new shuffled array. + */ + function baseShuffle(collection) { + return shuffleSelf(values(collection)); + } + + /** + * The base implementation of `_.slice` without an iteratee call guard. + * + * @private + * @param {Array} array The array to slice. + * @param {number} [start=0] The start position. + * @param {number} [end=array.length] The end position. + * @returns {Array} Returns the slice of `array`. + */ + function baseSlice(array, start, end) { + var index = -1, + length = array.length; + + if (start < 0) { + start = -start > length ? 0 : (length + start); + } + end = end > length ? length : end; + if (end < 0) { + end += length; + } + length = start > end ? 0 : ((end - start) >>> 0); + start >>>= 0; + + var result = Array(length); + while (++index < length) { + result[index] = array[index + start]; + } + return result; + } + + /** + * The base implementation of `_.some` without support for iteratee shorthands. + * + * @private + * @param {Array|Object} collection The collection to iterate over. + * @param {Function} predicate The function invoked per iteration. + * @returns {boolean} Returns `true` if any element passes the predicate check, + * else `false`. + */ + function baseSome(collection, predicate) { + var result; + + baseEach(collection, function(value, index, collection) { + result = predicate(value, index, collection); + return !result; + }); + return !!result; + } + + /** + * The base implementation of `_.sortedIndex` and `_.sortedLastIndex` which + * performs a binary search of `array` to determine the index at which `value` + * should be inserted into `array` in order to maintain its sort order. + * + * @private + * @param {Array} array The sorted array to inspect. + * @param {*} value The value to evaluate. + * @param {boolean} [retHighest] Specify returning the highest qualified index. + * @returns {number} Returns the index at which `value` should be inserted + * into `array`. + */ + function baseSortedIndex(array, value, retHighest) { + var low = 0, + high = array == null ? low : array.length; + + if (typeof value == 'number' && value === value && high <= HALF_MAX_ARRAY_LENGTH) { + while (low < high) { + var mid = (low + high) >>> 1, + computed = array[mid]; + + if (computed !== null && !isSymbol(computed) && + (retHighest ? (computed <= value) : (computed < value))) { + low = mid + 1; + } else { + high = mid; + } + } + return high; + } + return baseSortedIndexBy(array, value, identity, retHighest); + } + + /** + * The base implementation of `_.sortedIndexBy` and `_.sortedLastIndexBy` + * which invokes `iteratee` for `value` and each element of `array` to compute + * their sort ranking. The iteratee is invoked with one argument; (value). + * + * @private + * @param {Array} array The sorted array to inspect. + * @param {*} value The value to evaluate. + * @param {Function} iteratee The iteratee invoked per element. + * @param {boolean} [retHighest] Specify returning the highest qualified index. + * @returns {number} Returns the index at which `value` should be inserted + * into `array`. + */ + function baseSortedIndexBy(array, value, iteratee, retHighest) { + var low = 0, + high = array == null ? 0 : array.length; + if (high === 0) { + return 0; + } + + value = iteratee(value); + var valIsNaN = value !== value, + valIsNull = value === null, + valIsSymbol = isSymbol(value), + valIsUndefined = value === undefined; + + while (low < high) { + var mid = nativeFloor((low + high) / 2), + computed = iteratee(array[mid]), + othIsDefined = computed !== undefined, + othIsNull = computed === null, + othIsReflexive = computed === computed, + othIsSymbol = isSymbol(computed); + + if (valIsNaN) { + var setLow = retHighest || othIsReflexive; + } else if (valIsUndefined) { + setLow = othIsReflexive && (retHighest || othIsDefined); + } else if (valIsNull) { + setLow = othIsReflexive && othIsDefined && (retHighest || !othIsNull); + } else if (valIsSymbol) { + setLow = othIsReflexive && othIsDefined && !othIsNull && (retHighest || !othIsSymbol); + } else if (othIsNull || othIsSymbol) { + setLow = false; + } else { + setLow = retHighest ? (computed <= value) : (computed < value); + } + if (setLow) { + low = mid + 1; + } else { + high = mid; + } + } + return nativeMin(high, MAX_ARRAY_INDEX); + } + + /** + * The base implementation of `_.sortedUniq` and `_.sortedUniqBy` without + * support for iteratee shorthands. + * + * @private + * @param {Array} array The array to inspect. + * @param {Function} [iteratee] The iteratee invoked per element. + * @returns {Array} Returns the new duplicate free array. + */ + function baseSortedUniq(array, iteratee) { + var index = -1, + length = array.length, + resIndex = 0, + result = []; + + while (++index < length) { + var value = array[index], + computed = iteratee ? iteratee(value) : value; + + if (!index || !eq(computed, seen)) { + var seen = computed; + result[resIndex++] = value === 0 ? 0 : value; + } + } + return result; + } + + /** + * The base implementation of `_.toNumber` which doesn't ensure correct + * conversions of binary, hexadecimal, or octal string values. + * + * @private + * @param {*} value The value to process. + * @returns {number} Returns the number. + */ + function baseToNumber(value) { + if (typeof value == 'number') { + return value; + } + if (isSymbol(value)) { + return NAN; + } + return +value; + } + + /** + * The base implementation of `_.toString` which doesn't convert nullish + * values to empty strings. + * + * @private + * @param {*} value The value to process. + * @returns {string} Returns the string. + */ + function baseToString(value) { + // Exit early for strings to avoid a performance hit in some environments. + if (typeof value == 'string') { + return value; + } + if (isArray(value)) { + // Recursively convert values (susceptible to call stack limits). + return arrayMap(value, baseToString) + ''; + } + if (isSymbol(value)) { + return symbolToString ? symbolToString.call(value) : ''; + } + var result = (value + ''); + return (result == '0' && (1 / value) == -INFINITY) ? '-0' : result; + } + + /** + * The base implementation of `_.uniqBy` without support for iteratee shorthands. + * + * @private + * @param {Array} array The array to inspect. + * @param {Function} [iteratee] The iteratee invoked per element. + * @param {Function} [comparator] The comparator invoked per element. + * @returns {Array} Returns the new duplicate free array. + */ + function baseUniq(array, iteratee, comparator) { + var index = -1, + includes = arrayIncludes, + length = array.length, + isCommon = true, + result = [], + seen = result; + + if (comparator) { + isCommon = false; + includes = arrayIncludesWith; + } + else if (length >= LARGE_ARRAY_SIZE) { + var set = iteratee ? null : createSet(array); + if (set) { + return setToArray(set); + } + isCommon = false; + includes = cacheHas; + seen = new SetCache; + } + else { + seen = iteratee ? [] : result; + } + outer: + while (++index < length) { + var value = array[index], + computed = iteratee ? iteratee(value) : value; + + value = (comparator || value !== 0) ? value : 0; + if (isCommon && computed === computed) { + var seenIndex = seen.length; + while (seenIndex--) { + if (seen[seenIndex] === computed) { + continue outer; + } + } + if (iteratee) { + seen.push(computed); + } + result.push(value); + } + else if (!includes(seen, computed, comparator)) { + if (seen !== result) { + seen.push(computed); + } + result.push(value); + } + } + return result; + } + + /** + * The base implementation of `_.unset`. + * + * @private + * @param {Object} object The object to modify. + * @param {Array|string} path The property path to unset. + * @returns {boolean} Returns `true` if the property is deleted, else `false`. + */ + function baseUnset(object, path) { + path = castPath(path, object); + object = parent(object, path); + return object == null || delete object[toKey(last(path))]; + } + + /** + * The base implementation of `_.update`. + * + * @private + * @param {Object} object The object to modify. + * @param {Array|string} path The path of the property to update. + * @param {Function} updater The function to produce the updated value. + * @param {Function} [customizer] The function to customize path creation. + * @returns {Object} Returns `object`. + */ + function baseUpdate(object, path, updater, customizer) { + return baseSet(object, path, updater(baseGet(object, path)), customizer); + } + + /** + * The base implementation of methods like `_.dropWhile` and `_.takeWhile` + * without support for iteratee shorthands. + * + * @private + * @param {Array} array The array to query. + * @param {Function} predicate The function invoked per iteration. + * @param {boolean} [isDrop] Specify dropping elements instead of taking them. + * @param {boolean} [fromRight] Specify iterating from right to left. + * @returns {Array} Returns the slice of `array`. + */ + function baseWhile(array, predicate, isDrop, fromRight) { + var length = array.length, + index = fromRight ? length : -1; + + while ((fromRight ? index-- : ++index < length) && + predicate(array[index], index, array)) {} + + return isDrop + ? baseSlice(array, (fromRight ? 0 : index), (fromRight ? index + 1 : length)) + : baseSlice(array, (fromRight ? index + 1 : 0), (fromRight ? length : index)); + } + + /** + * The base implementation of `wrapperValue` which returns the result of + * performing a sequence of actions on the unwrapped `value`, where each + * successive action is supplied the return value of the previous. + * + * @private + * @param {*} value The unwrapped value. + * @param {Array} actions Actions to perform to resolve the unwrapped value. + * @returns {*} Returns the resolved value. + */ + function baseWrapperValue(value, actions) { + var result = value; + if (result instanceof LazyWrapper) { + result = result.value(); + } + return arrayReduce(actions, function(result, action) { + return action.func.apply(action.thisArg, arrayPush([result], action.args)); + }, result); + } + + /** + * The base implementation of methods like `_.xor`, without support for + * iteratee shorthands, that accepts an array of arrays to inspect. + * + * @private + * @param {Array} arrays The arrays to inspect. + * @param {Function} [iteratee] The iteratee invoked per element. + * @param {Function} [comparator] The comparator invoked per element. + * @returns {Array} Returns the new array of values. + */ + function baseXor(arrays, iteratee, comparator) { + var length = arrays.length; + if (length < 2) { + return length ? baseUniq(arrays[0]) : []; + } + var index = -1, + result = Array(length); + + while (++index < length) { + var array = arrays[index], + othIndex = -1; + + while (++othIndex < length) { + if (othIndex != index) { + result[index] = baseDifference(result[index] || array, arrays[othIndex], iteratee, comparator); + } + } + } + return baseUniq(baseFlatten(result, 1), iteratee, comparator); + } + + /** + * This base implementation of `_.zipObject` which assigns values using `assignFunc`. + * + * @private + * @param {Array} props The property identifiers. + * @param {Array} values The property values. + * @param {Function} assignFunc The function to assign values. + * @returns {Object} Returns the new object. + */ + function baseZipObject(props, values, assignFunc) { + var index = -1, + length = props.length, + valsLength = values.length, + result = {}; + + while (++index < length) { + var value = index < valsLength ? values[index] : undefined; + assignFunc(result, props[index], value); + } + return result; + } + + /** + * Casts `value` to an empty array if it's not an array like object. + * + * @private + * @param {*} value The value to inspect. + * @returns {Array|Object} Returns the cast array-like object. + */ + function castArrayLikeObject(value) { + return isArrayLikeObject(value) ? value : []; + } + + /** + * Casts `value` to `identity` if it's not a function. + * + * @private + * @param {*} value The value to inspect. + * @returns {Function} Returns cast function. + */ + function castFunction(value) { + return typeof value == 'function' ? value : identity; + } + + /** + * Casts `value` to a path array if it's not one. + * + * @private + * @param {*} value The value to inspect. + * @param {Object} [object] The object to query keys on. + * @returns {Array} Returns the cast property path array. + */ + function castPath(value, object) { + if (isArray(value)) { + return value; + } + return isKey(value, object) ? [value] : stringToPath(toString(value)); + } + + /** + * A `baseRest` alias which can be replaced with `identity` by module + * replacement plugins. + * + * @private + * @type {Function} + * @param {Function} func The function to apply a rest parameter to. + * @returns {Function} Returns the new function. + */ + var castRest = baseRest; + + /** + * Casts `array` to a slice if it's needed. + * + * @private + * @param {Array} array The array to inspect. + * @param {number} start The start position. + * @param {number} [end=array.length] The end position. + * @returns {Array} Returns the cast slice. + */ + function castSlice(array, start, end) { + var length = array.length; + end = end === undefined ? length : end; + return (!start && end >= length) ? array : baseSlice(array, start, end); + } + + /** + * A simple wrapper around the global [`clearTimeout`](https://mdn.io/clearTimeout). + * + * @private + * @param {number|Object} id The timer id or timeout object of the timer to clear. + */ + var clearTimeout = ctxClearTimeout || function(id) { + return root.clearTimeout(id); + }; + + /** + * Creates a clone of `buffer`. + * + * @private + * @param {Buffer} buffer The buffer to clone. + * @param {boolean} [isDeep] Specify a deep clone. + * @returns {Buffer} Returns the cloned buffer. + */ + function cloneBuffer(buffer, isDeep) { + if (isDeep) { + return buffer.slice(); + } + var length = buffer.length, + result = allocUnsafe ? allocUnsafe(length) : new buffer.constructor(length); + + buffer.copy(result); + return result; + } + + /** + * Creates a clone of `arrayBuffer`. + * + * @private + * @param {ArrayBuffer} arrayBuffer The array buffer to clone. + * @returns {ArrayBuffer} Returns the cloned array buffer. + */ + function cloneArrayBuffer(arrayBuffer) { + var result = new arrayBuffer.constructor(arrayBuffer.byteLength); + new Uint8Array(result).set(new Uint8Array(arrayBuffer)); + return result; + } + + /** + * Creates a clone of `dataView`. + * + * @private + * @param {Object} dataView The data view to clone. + * @param {boolean} [isDeep] Specify a deep clone. + * @returns {Object} Returns the cloned data view. + */ + function cloneDataView(dataView, isDeep) { + var buffer = isDeep ? cloneArrayBuffer(dataView.buffer) : dataView.buffer; + return new dataView.constructor(buffer, dataView.byteOffset, dataView.byteLength); + } + + /** + * Creates a clone of `regexp`. + * + * @private + * @param {Object} regexp The regexp to clone. + * @returns {Object} Returns the cloned regexp. + */ + function cloneRegExp(regexp) { + var result = new regexp.constructor(regexp.source, reFlags.exec(regexp)); + result.lastIndex = regexp.lastIndex; + return result; + } + + /** + * Creates a clone of the `symbol` object. + * + * @private + * @param {Object} symbol The symbol object to clone. + * @returns {Object} Returns the cloned symbol object. + */ + function cloneSymbol(symbol) { + return symbolValueOf ? Object(symbolValueOf.call(symbol)) : {}; + } + + /** + * Creates a clone of `typedArray`. + * + * @private + * @param {Object} typedArray The typed array to clone. + * @param {boolean} [isDeep] Specify a deep clone. + * @returns {Object} Returns the cloned typed array. + */ + function cloneTypedArray(typedArray, isDeep) { + var buffer = isDeep ? cloneArrayBuffer(typedArray.buffer) : typedArray.buffer; + return new typedArray.constructor(buffer, typedArray.byteOffset, typedArray.length); + } + + /** + * Compares values to sort them in ascending order. + * + * @private + * @param {*} value The value to compare. + * @param {*} other The other value to compare. + * @returns {number} Returns the sort order indicator for `value`. + */ + function compareAscending(value, other) { + if (value !== other) { + var valIsDefined = value !== undefined, + valIsNull = value === null, + valIsReflexive = value === value, + valIsSymbol = isSymbol(value); + + var othIsDefined = other !== undefined, + othIsNull = other === null, + othIsReflexive = other === other, + othIsSymbol = isSymbol(other); + + if ((!othIsNull && !othIsSymbol && !valIsSymbol && value > other) || + (valIsSymbol && othIsDefined && othIsReflexive && !othIsNull && !othIsSymbol) || + (valIsNull && othIsDefined && othIsReflexive) || + (!valIsDefined && othIsReflexive) || + !valIsReflexive) { + return 1; + } + if ((!valIsNull && !valIsSymbol && !othIsSymbol && value < other) || + (othIsSymbol && valIsDefined && valIsReflexive && !valIsNull && !valIsSymbol) || + (othIsNull && valIsDefined && valIsReflexive) || + (!othIsDefined && valIsReflexive) || + !othIsReflexive) { + return -1; + } + } + return 0; + } + + /** + * Used by `_.orderBy` to compare multiple properties of a value to another + * and stable sort them. + * + * If `orders` is unspecified, all values are sorted in ascending order. Otherwise, + * specify an order of "desc" for descending or "asc" for ascending sort order + * of corresponding values. + * + * @private + * @param {Object} object The object to compare. + * @param {Object} other The other object to compare. + * @param {boolean[]|string[]} orders The order to sort by for each property. + * @returns {number} Returns the sort order indicator for `object`. + */ + function compareMultiple(object, other, orders) { + var index = -1, + objCriteria = object.criteria, + othCriteria = other.criteria, + length = objCriteria.length, + ordersLength = orders.length; + + while (++index < length) { + var result = compareAscending(objCriteria[index], othCriteria[index]); + if (result) { + if (index >= ordersLength) { + return result; + } + var order = orders[index]; + return result * (order == 'desc' ? -1 : 1); + } + } + // Fixes an `Array#sort` bug in the JS engine embedded in Adobe applications + // that causes it, under certain circumstances, to provide the same value for + // `object` and `other`. See https://github.com/jashkenas/underscore/pull/1247 + // for more details. + // + // This also ensures a stable sort in V8 and other engines. + // See https://bugs.chromium.org/p/v8/issues/detail?id=90 for more details. + return object.index - other.index; + } + + /** + * Creates an array that is the composition of partially applied arguments, + * placeholders, and provided arguments into a single array of arguments. + * + * @private + * @param {Array} args The provided arguments. + * @param {Array} partials The arguments to prepend to those provided. + * @param {Array} holders The `partials` placeholder indexes. + * @params {boolean} [isCurried] Specify composing for a curried function. + * @returns {Array} Returns the new array of composed arguments. + */ + function composeArgs(args, partials, holders, isCurried) { + var argsIndex = -1, + argsLength = args.length, + holdersLength = holders.length, + leftIndex = -1, + leftLength = partials.length, + rangeLength = nativeMax(argsLength - holdersLength, 0), + result = Array(leftLength + rangeLength), + isUncurried = !isCurried; + + while (++leftIndex < leftLength) { + result[leftIndex] = partials[leftIndex]; + } + while (++argsIndex < holdersLength) { + if (isUncurried || argsIndex < argsLength) { + result[holders[argsIndex]] = args[argsIndex]; + } + } + while (rangeLength--) { + result[leftIndex++] = args[argsIndex++]; + } + return result; + } + + /** + * This function is like `composeArgs` except that the arguments composition + * is tailored for `_.partialRight`. + * + * @private + * @param {Array} args The provided arguments. + * @param {Array} partials The arguments to append to those provided. + * @param {Array} holders The `partials` placeholder indexes. + * @params {boolean} [isCurried] Specify composing for a curried function. + * @returns {Array} Returns the new array of composed arguments. + */ + function composeArgsRight(args, partials, holders, isCurried) { + var argsIndex = -1, + argsLength = args.length, + holdersIndex = -1, + holdersLength = holders.length, + rightIndex = -1, + rightLength = partials.length, + rangeLength = nativeMax(argsLength - holdersLength, 0), + result = Array(rangeLength + rightLength), + isUncurried = !isCurried; + + while (++argsIndex < rangeLength) { + result[argsIndex] = args[argsIndex]; + } + var offset = argsIndex; + while (++rightIndex < rightLength) { + result[offset + rightIndex] = partials[rightIndex]; + } + while (++holdersIndex < holdersLength) { + if (isUncurried || argsIndex < argsLength) { + result[offset + holders[holdersIndex]] = args[argsIndex++]; + } + } + return result; + } + + /** + * Copies the values of `source` to `array`. + * + * @private + * @param {Array} source The array to copy values from. + * @param {Array} [array=[]] The array to copy values to. + * @returns {Array} Returns `array`. + */ + function copyArray(source, array) { + var index = -1, + length = source.length; + + array || (array = Array(length)); + while (++index < length) { + array[index] = source[index]; + } + return array; + } + + /** + * Copies properties of `source` to `object`. + * + * @private + * @param {Object} source The object to copy properties from. + * @param {Array} props The property identifiers to copy. + * @param {Object} [object={}] The object to copy properties to. + * @param {Function} [customizer] The function to customize copied values. + * @returns {Object} Returns `object`. + */ + function copyObject(source, props, object, customizer) { + var isNew = !object; + object || (object = {}); + + var index = -1, + length = props.length; + + while (++index < length) { + var key = props[index]; + + var newValue = customizer + ? customizer(object[key], source[key], key, object, source) + : undefined; + + if (newValue === undefined) { + newValue = source[key]; + } + if (isNew) { + baseAssignValue(object, key, newValue); + } else { + assignValue(object, key, newValue); + } + } + return object; + } + + /** + * Copies own symbols of `source` to `object`. + * + * @private + * @param {Object} source The object to copy symbols from. + * @param {Object} [object={}] The object to copy symbols to. + * @returns {Object} Returns `object`. + */ + function copySymbols(source, object) { + return copyObject(source, getSymbols(source), object); + } + + /** + * Copies own and inherited symbols of `source` to `object`. + * + * @private + * @param {Object} source The object to copy symbols from. + * @param {Object} [object={}] The object to copy symbols to. + * @returns {Object} Returns `object`. + */ + function copySymbolsIn(source, object) { + return copyObject(source, getSymbolsIn(source), object); + } + + /** + * Creates a function like `_.groupBy`. + * + * @private + * @param {Function} setter The function to set accumulator values. + * @param {Function} [initializer] The accumulator object initializer. + * @returns {Function} Returns the new aggregator function. + */ + function createAggregator(setter, initializer) { + return function(collection, iteratee) { + var func = isArray(collection) ? arrayAggregator : baseAggregator, + accumulator = initializer ? initializer() : {}; + + return func(collection, setter, getIteratee(iteratee, 2), accumulator); + }; + } + + /** + * Creates a function like `_.assign`. + * + * @private + * @param {Function} assigner The function to assign values. + * @returns {Function} Returns the new assigner function. + */ + function createAssigner(assigner) { + return baseRest(function(object, sources) { + var index = -1, + length = sources.length, + customizer = length > 1 ? sources[length - 1] : undefined, + guard = length > 2 ? sources[2] : undefined; + + customizer = (assigner.length > 3 && typeof customizer == 'function') + ? (length--, customizer) + : undefined; + + if (guard && isIterateeCall(sources[0], sources[1], guard)) { + customizer = length < 3 ? undefined : customizer; + length = 1; + } + object = Object(object); + while (++index < length) { + var source = sources[index]; + if (source) { + assigner(object, source, index, customizer); + } + } + return object; + }); + } + + /** + * Creates a `baseEach` or `baseEachRight` function. + * + * @private + * @param {Function} eachFunc The function to iterate over a collection. + * @param {boolean} [fromRight] Specify iterating from right to left. + * @returns {Function} Returns the new base function. + */ + function createBaseEach(eachFunc, fromRight) { + return function(collection, iteratee) { + if (collection == null) { + return collection; + } + if (!isArrayLike(collection)) { + return eachFunc(collection, iteratee); + } + var length = collection.length, + index = fromRight ? length : -1, + iterable = Object(collection); + + while ((fromRight ? index-- : ++index < length)) { + if (iteratee(iterable[index], index, iterable) === false) { + break; + } + } + return collection; + }; + } + + /** + * Creates a base function for methods like `_.forIn` and `_.forOwn`. + * + * @private + * @param {boolean} [fromRight] Specify iterating from right to left. + * @returns {Function} Returns the new base function. + */ + function createBaseFor(fromRight) { + return function(object, iteratee, keysFunc) { + var index = -1, + iterable = Object(object), + props = keysFunc(object), + length = props.length; + + while (length--) { + var key = props[fromRight ? length : ++index]; + if (iteratee(iterable[key], key, iterable) === false) { + break; + } + } + return object; + }; + } + + /** + * Creates a function that wraps `func` to invoke it with the optional `this` + * binding of `thisArg`. + * + * @private + * @param {Function} func The function to wrap. + * @param {number} bitmask The bitmask flags. See `createWrap` for more details. + * @param {*} [thisArg] The `this` binding of `func`. + * @returns {Function} Returns the new wrapped function. + */ + function createBind(func, bitmask, thisArg) { + var isBind = bitmask & WRAP_BIND_FLAG, + Ctor = createCtor(func); + + function wrapper() { + var fn = (this && this !== root && this instanceof wrapper) ? Ctor : func; + return fn.apply(isBind ? thisArg : this, arguments); + } + return wrapper; + } + + /** + * Creates a function like `_.lowerFirst`. + * + * @private + * @param {string} methodName The name of the `String` case method to use. + * @returns {Function} Returns the new case function. + */ + function createCaseFirst(methodName) { + return function(string) { + string = toString(string); + + var strSymbols = hasUnicode(string) + ? stringToArray(string) + : undefined; + + var chr = strSymbols + ? strSymbols[0] + : string.charAt(0); + + var trailing = strSymbols + ? castSlice(strSymbols, 1).join('') + : string.slice(1); + + return chr[methodName]() + trailing; + }; + } + + /** + * Creates a function like `_.camelCase`. + * + * @private + * @param {Function} callback The function to combine each word. + * @returns {Function} Returns the new compounder function. + */ + function createCompounder(callback) { + return function(string) { + return arrayReduce(words(deburr(string).replace(reApos, '')), callback, ''); + }; + } + + /** + * Creates a function that produces an instance of `Ctor` regardless of + * whether it was invoked as part of a `new` expression or by `call` or `apply`. + * + * @private + * @param {Function} Ctor The constructor to wrap. + * @returns {Function} Returns the new wrapped function. + */ + function createCtor(Ctor) { + return function() { + // Use a `switch` statement to work with class constructors. See + // http://ecma-international.org/ecma-262/7.0/#sec-ecmascript-function-objects-call-thisargument-argumentslist + // for more details. + var args = arguments; + switch (args.length) { + case 0: return new Ctor; + case 1: return new Ctor(args[0]); + case 2: return new Ctor(args[0], args[1]); + case 3: return new Ctor(args[0], args[1], args[2]); + case 4: return new Ctor(args[0], args[1], args[2], args[3]); + case 5: return new Ctor(args[0], args[1], args[2], args[3], args[4]); + case 6: return new Ctor(args[0], args[1], args[2], args[3], args[4], args[5]); + case 7: return new Ctor(args[0], args[1], args[2], args[3], args[4], args[5], args[6]); + } + var thisBinding = baseCreate(Ctor.prototype), + result = Ctor.apply(thisBinding, args); + + // Mimic the constructor's `return` behavior. + // See https://es5.github.io/#x13.2.2 for more details. + return isObject(result) ? result : thisBinding; + }; + } + + /** + * Creates a function that wraps `func` to enable currying. + * + * @private + * @param {Function} func The function to wrap. + * @param {number} bitmask The bitmask flags. See `createWrap` for more details. + * @param {number} arity The arity of `func`. + * @returns {Function} Returns the new wrapped function. + */ + function createCurry(func, bitmask, arity) { + var Ctor = createCtor(func); + + function wrapper() { + var length = arguments.length, + args = Array(length), + index = length, + placeholder = getHolder(wrapper); + + while (index--) { + args[index] = arguments[index]; + } + var holders = (length < 3 && args[0] !== placeholder && args[length - 1] !== placeholder) + ? [] + : replaceHolders(args, placeholder); + + length -= holders.length; + if (length < arity) { + return createRecurry( + func, bitmask, createHybrid, wrapper.placeholder, undefined, + args, holders, undefined, undefined, arity - length); + } + var fn = (this && this !== root && this instanceof wrapper) ? Ctor : func; + return apply(fn, this, args); + } + return wrapper; + } + + /** + * Creates a `_.find` or `_.findLast` function. + * + * @private + * @param {Function} findIndexFunc The function to find the collection index. + * @returns {Function} Returns the new find function. + */ + function createFind(findIndexFunc) { + return function(collection, predicate, fromIndex) { + var iterable = Object(collection); + if (!isArrayLike(collection)) { + var iteratee = getIteratee(predicate, 3); + collection = keys(collection); + predicate = function(key) { return iteratee(iterable[key], key, iterable); }; + } + var index = findIndexFunc(collection, predicate, fromIndex); + return index > -1 ? iterable[iteratee ? collection[index] : index] : undefined; + }; + } + + /** + * Creates a `_.flow` or `_.flowRight` function. + * + * @private + * @param {boolean} [fromRight] Specify iterating from right to left. + * @returns {Function} Returns the new flow function. + */ + function createFlow(fromRight) { + return flatRest(function(funcs) { + var length = funcs.length, + index = length, + prereq = LodashWrapper.prototype.thru; + + if (fromRight) { + funcs.reverse(); + } + while (index--) { + var func = funcs[index]; + if (typeof func != 'function') { + throw new TypeError(FUNC_ERROR_TEXT); + } + if (prereq && !wrapper && getFuncName(func) == 'wrapper') { + var wrapper = new LodashWrapper([], true); + } + } + index = wrapper ? index : length; + while (++index < length) { + func = funcs[index]; + + var funcName = getFuncName(func), + data = funcName == 'wrapper' ? getData(func) : undefined; + + if (data && isLaziable(data[0]) && + data[1] == (WRAP_ARY_FLAG | WRAP_CURRY_FLAG | WRAP_PARTIAL_FLAG | WRAP_REARG_FLAG) && + !data[4].length && data[9] == 1 + ) { + wrapper = wrapper[getFuncName(data[0])].apply(wrapper, data[3]); + } else { + wrapper = (func.length == 1 && isLaziable(func)) + ? wrapper[funcName]() + : wrapper.thru(func); + } + } + return function() { + var args = arguments, + value = args[0]; + + if (wrapper && args.length == 1 && isArray(value)) { + return wrapper.plant(value).value(); + } + var index = 0, + result = length ? funcs[index].apply(this, args) : value; + + while (++index < length) { + result = funcs[index].call(this, result); + } + return result; + }; + }); + } + + /** + * Creates a function that wraps `func` to invoke it with optional `this` + * binding of `thisArg`, partial application, and currying. + * + * @private + * @param {Function|string} func The function or method name to wrap. + * @param {number} bitmask The bitmask flags. See `createWrap` for more details. + * @param {*} [thisArg] The `this` binding of `func`. + * @param {Array} [partials] The arguments to prepend to those provided to + * the new function. + * @param {Array} [holders] The `partials` placeholder indexes. + * @param {Array} [partialsRight] The arguments to append to those provided + * to the new function. + * @param {Array} [holdersRight] The `partialsRight` placeholder indexes. + * @param {Array} [argPos] The argument positions of the new function. + * @param {number} [ary] The arity cap of `func`. + * @param {number} [arity] The arity of `func`. + * @returns {Function} Returns the new wrapped function. + */ + function createHybrid(func, bitmask, thisArg, partials, holders, partialsRight, holdersRight, argPos, ary, arity) { + var isAry = bitmask & WRAP_ARY_FLAG, + isBind = bitmask & WRAP_BIND_FLAG, + isBindKey = bitmask & WRAP_BIND_KEY_FLAG, + isCurried = bitmask & (WRAP_CURRY_FLAG | WRAP_CURRY_RIGHT_FLAG), + isFlip = bitmask & WRAP_FLIP_FLAG, + Ctor = isBindKey ? undefined : createCtor(func); + + function wrapper() { + var length = arguments.length, + args = Array(length), + index = length; + + while (index--) { + args[index] = arguments[index]; + } + if (isCurried) { + var placeholder = getHolder(wrapper), + holdersCount = countHolders(args, placeholder); + } + if (partials) { + args = composeArgs(args, partials, holders, isCurried); + } + if (partialsRight) { + args = composeArgsRight(args, partialsRight, holdersRight, isCurried); + } + length -= holdersCount; + if (isCurried && length < arity) { + var newHolders = replaceHolders(args, placeholder); + return createRecurry( + func, bitmask, createHybrid, wrapper.placeholder, thisArg, + args, newHolders, argPos, ary, arity - length + ); + } + var thisBinding = isBind ? thisArg : this, + fn = isBindKey ? thisBinding[func] : func; + + length = args.length; + if (argPos) { + args = reorder(args, argPos); + } else if (isFlip && length > 1) { + args.reverse(); + } + if (isAry && ary < length) { + args.length = ary; + } + if (this && this !== root && this instanceof wrapper) { + fn = Ctor || createCtor(fn); + } + return fn.apply(thisBinding, args); + } + return wrapper; + } + + /** + * Creates a function like `_.invertBy`. + * + * @private + * @param {Function} setter The function to set accumulator values. + * @param {Function} toIteratee The function to resolve iteratees. + * @returns {Function} Returns the new inverter function. + */ + function createInverter(setter, toIteratee) { + return function(object, iteratee) { + return baseInverter(object, setter, toIteratee(iteratee), {}); + }; + } + + /** + * Creates a function that performs a mathematical operation on two values. + * + * @private + * @param {Function} operator The function to perform the operation. + * @param {number} [defaultValue] The value used for `undefined` arguments. + * @returns {Function} Returns the new mathematical operation function. + */ + function createMathOperation(operator, defaultValue) { + return function(value, other) { + var result; + if (value === undefined && other === undefined) { + return defaultValue; + } + if (value !== undefined) { + result = value; + } + if (other !== undefined) { + if (result === undefined) { + return other; + } + if (typeof value == 'string' || typeof other == 'string') { + value = baseToString(value); + other = baseToString(other); + } else { + value = baseToNumber(value); + other = baseToNumber(other); + } + result = operator(value, other); + } + return result; + }; + } + + /** + * Creates a function like `_.over`. + * + * @private + * @param {Function} arrayFunc The function to iterate over iteratees. + * @returns {Function} Returns the new over function. + */ + function createOver(arrayFunc) { + return flatRest(function(iteratees) { + iteratees = arrayMap(iteratees, baseUnary(getIteratee())); + return baseRest(function(args) { + var thisArg = this; + return arrayFunc(iteratees, function(iteratee) { + return apply(iteratee, thisArg, args); + }); + }); + }); + } + + /** + * Creates the padding for `string` based on `length`. The `chars` string + * is truncated if the number of characters exceeds `length`. + * + * @private + * @param {number} length The padding length. + * @param {string} [chars=' '] The string used as padding. + * @returns {string} Returns the padding for `string`. + */ + function createPadding(length, chars) { + chars = chars === undefined ? ' ' : baseToString(chars); + + var charsLength = chars.length; + if (charsLength < 2) { + return charsLength ? baseRepeat(chars, length) : chars; + } + var result = baseRepeat(chars, nativeCeil(length / stringSize(chars))); + return hasUnicode(chars) + ? castSlice(stringToArray(result), 0, length).join('') + : result.slice(0, length); + } + + /** + * Creates a function that wraps `func` to invoke it with the `this` binding + * of `thisArg` and `partials` prepended to the arguments it receives. + * + * @private + * @param {Function} func The function to wrap. + * @param {number} bitmask The bitmask flags. See `createWrap` for more details. + * @param {*} thisArg The `this` binding of `func`. + * @param {Array} partials The arguments to prepend to those provided to + * the new function. + * @returns {Function} Returns the new wrapped function. + */ + function createPartial(func, bitmask, thisArg, partials) { + var isBind = bitmask & WRAP_BIND_FLAG, + Ctor = createCtor(func); + + function wrapper() { + var argsIndex = -1, + argsLength = arguments.length, + leftIndex = -1, + leftLength = partials.length, + args = Array(leftLength + argsLength), + fn = (this && this !== root && this instanceof wrapper) ? Ctor : func; + + while (++leftIndex < leftLength) { + args[leftIndex] = partials[leftIndex]; + } + while (argsLength--) { + args[leftIndex++] = arguments[++argsIndex]; + } + return apply(fn, isBind ? thisArg : this, args); + } + return wrapper; + } + + /** + * Creates a `_.range` or `_.rangeRight` function. + * + * @private + * @param {boolean} [fromRight] Specify iterating from right to left. + * @returns {Function} Returns the new range function. + */ + function createRange(fromRight) { + return function(start, end, step) { + if (step && typeof step != 'number' && isIterateeCall(start, end, step)) { + end = step = undefined; + } + // Ensure the sign of `-0` is preserved. + start = toFinite(start); + if (end === undefined) { + end = start; + start = 0; + } else { + end = toFinite(end); + } + step = step === undefined ? (start < end ? 1 : -1) : toFinite(step); + return baseRange(start, end, step, fromRight); + }; + } + + /** + * Creates a function that performs a relational operation on two values. + * + * @private + * @param {Function} operator The function to perform the operation. + * @returns {Function} Returns the new relational operation function. + */ + function createRelationalOperation(operator) { + return function(value, other) { + if (!(typeof value == 'string' && typeof other == 'string')) { + value = toNumber(value); + other = toNumber(other); + } + return operator(value, other); + }; + } + + /** + * Creates a function that wraps `func` to continue currying. + * + * @private + * @param {Function} func The function to wrap. + * @param {number} bitmask The bitmask flags. See `createWrap` for more details. + * @param {Function} wrapFunc The function to create the `func` wrapper. + * @param {*} placeholder The placeholder value. + * @param {*} [thisArg] The `this` binding of `func`. + * @param {Array} [partials] The arguments to prepend to those provided to + * the new function. + * @param {Array} [holders] The `partials` placeholder indexes. + * @param {Array} [argPos] The argument positions of the new function. + * @param {number} [ary] The arity cap of `func`. + * @param {number} [arity] The arity of `func`. + * @returns {Function} Returns the new wrapped function. + */ + function createRecurry(func, bitmask, wrapFunc, placeholder, thisArg, partials, holders, argPos, ary, arity) { + var isCurry = bitmask & WRAP_CURRY_FLAG, + newHolders = isCurry ? holders : undefined, + newHoldersRight = isCurry ? undefined : holders, + newPartials = isCurry ? partials : undefined, + newPartialsRight = isCurry ? undefined : partials; + + bitmask |= (isCurry ? WRAP_PARTIAL_FLAG : WRAP_PARTIAL_RIGHT_FLAG); + bitmask &= ~(isCurry ? WRAP_PARTIAL_RIGHT_FLAG : WRAP_PARTIAL_FLAG); + + if (!(bitmask & WRAP_CURRY_BOUND_FLAG)) { + bitmask &= ~(WRAP_BIND_FLAG | WRAP_BIND_KEY_FLAG); + } + var newData = [ + func, bitmask, thisArg, newPartials, newHolders, newPartialsRight, + newHoldersRight, argPos, ary, arity + ]; + + var result = wrapFunc.apply(undefined, newData); + if (isLaziable(func)) { + setData(result, newData); + } + result.placeholder = placeholder; + return setWrapToString(result, func, bitmask); + } + + /** + * Creates a function like `_.round`. + * + * @private + * @param {string} methodName The name of the `Math` method to use when rounding. + * @returns {Function} Returns the new round function. + */ + function createRound(methodName) { + var func = Math[methodName]; + return function(number, precision) { + number = toNumber(number); + precision = precision == null ? 0 : nativeMin(toInteger(precision), 292); + if (precision && nativeIsFinite(number)) { + // Shift with exponential notation to avoid floating-point issues. + // See [MDN](https://mdn.io/round#Examples) for more details. + var pair = (toString(number) + 'e').split('e'), + value = func(pair[0] + 'e' + (+pair[1] + precision)); + + pair = (toString(value) + 'e').split('e'); + return +(pair[0] + 'e' + (+pair[1] - precision)); + } + return func(number); + }; + } + + /** + * Creates a set object of `values`. + * + * @private + * @param {Array} values The values to add to the set. + * @returns {Object} Returns the new set. + */ + var createSet = !(Set && (1 / setToArray(new Set([,-0]))[1]) == INFINITY) ? noop : function(values) { + return new Set(values); + }; + + /** + * Creates a `_.toPairs` or `_.toPairsIn` function. + * + * @private + * @param {Function} keysFunc The function to get the keys of a given object. + * @returns {Function} Returns the new pairs function. + */ + function createToPairs(keysFunc) { + return function(object) { + var tag = getTag(object); + if (tag == mapTag) { + return mapToArray(object); + } + if (tag == setTag) { + return setToPairs(object); + } + return baseToPairs(object, keysFunc(object)); + }; + } + + /** + * Creates a function that either curries or invokes `func` with optional + * `this` binding and partially applied arguments. + * + * @private + * @param {Function|string} func The function or method name to wrap. + * @param {number} bitmask The bitmask flags. + * 1 - `_.bind` + * 2 - `_.bindKey` + * 4 - `_.curry` or `_.curryRight` of a bound function + * 8 - `_.curry` + * 16 - `_.curryRight` + * 32 - `_.partial` + * 64 - `_.partialRight` + * 128 - `_.rearg` + * 256 - `_.ary` + * 512 - `_.flip` + * @param {*} [thisArg] The `this` binding of `func`. + * @param {Array} [partials] The arguments to be partially applied. + * @param {Array} [holders] The `partials` placeholder indexes. + * @param {Array} [argPos] The argument positions of the new function. + * @param {number} [ary] The arity cap of `func`. + * @param {number} [arity] The arity of `func`. + * @returns {Function} Returns the new wrapped function. + */ + function createWrap(func, bitmask, thisArg, partials, holders, argPos, ary, arity) { + var isBindKey = bitmask & WRAP_BIND_KEY_FLAG; + if (!isBindKey && typeof func != 'function') { + throw new TypeError(FUNC_ERROR_TEXT); + } + var length = partials ? partials.length : 0; + if (!length) { + bitmask &= ~(WRAP_PARTIAL_FLAG | WRAP_PARTIAL_RIGHT_FLAG); + partials = holders = undefined; + } + ary = ary === undefined ? ary : nativeMax(toInteger(ary), 0); + arity = arity === undefined ? arity : toInteger(arity); + length -= holders ? holders.length : 0; + + if (bitmask & WRAP_PARTIAL_RIGHT_FLAG) { + var partialsRight = partials, + holdersRight = holders; + + partials = holders = undefined; + } + var data = isBindKey ? undefined : getData(func); + + var newData = [ + func, bitmask, thisArg, partials, holders, partialsRight, holdersRight, + argPos, ary, arity + ]; + + if (data) { + mergeData(newData, data); + } + func = newData[0]; + bitmask = newData[1]; + thisArg = newData[2]; + partials = newData[3]; + holders = newData[4]; + arity = newData[9] = newData[9] === undefined + ? (isBindKey ? 0 : func.length) + : nativeMax(newData[9] - length, 0); + + if (!arity && bitmask & (WRAP_CURRY_FLAG | WRAP_CURRY_RIGHT_FLAG)) { + bitmask &= ~(WRAP_CURRY_FLAG | WRAP_CURRY_RIGHT_FLAG); + } + if (!bitmask || bitmask == WRAP_BIND_FLAG) { + var result = createBind(func, bitmask, thisArg); + } else if (bitmask == WRAP_CURRY_FLAG || bitmask == WRAP_CURRY_RIGHT_FLAG) { + result = createCurry(func, bitmask, arity); + } else if ((bitmask == WRAP_PARTIAL_FLAG || bitmask == (WRAP_BIND_FLAG | WRAP_PARTIAL_FLAG)) && !holders.length) { + result = createPartial(func, bitmask, thisArg, partials); + } else { + result = createHybrid.apply(undefined, newData); + } + var setter = data ? baseSetData : setData; + return setWrapToString(setter(result, newData), func, bitmask); + } + + /** + * Used by `_.defaults` to customize its `_.assignIn` use to assign properties + * of source objects to the destination object for all destination properties + * that resolve to `undefined`. + * + * @private + * @param {*} objValue The destination value. + * @param {*} srcValue The source value. + * @param {string} key The key of the property to assign. + * @param {Object} object The parent object of `objValue`. + * @returns {*} Returns the value to assign. + */ + function customDefaultsAssignIn(objValue, srcValue, key, object) { + if (objValue === undefined || + (eq(objValue, objectProto[key]) && !hasOwnProperty.call(object, key))) { + return srcValue; + } + return objValue; + } + + /** + * Used by `_.defaultsDeep` to customize its `_.merge` use to merge source + * objects into destination objects that are passed thru. + * + * @private + * @param {*} objValue The destination value. + * @param {*} srcValue The source value. + * @param {string} key The key of the property to merge. + * @param {Object} object The parent object of `objValue`. + * @param {Object} source The parent object of `srcValue`. + * @param {Object} [stack] Tracks traversed source values and their merged + * counterparts. + * @returns {*} Returns the value to assign. + */ + function customDefaultsMerge(objValue, srcValue, key, object, source, stack) { + if (isObject(objValue) && isObject(srcValue)) { + // Recursively merge objects and arrays (susceptible to call stack limits). + stack.set(srcValue, objValue); + baseMerge(objValue, srcValue, undefined, customDefaultsMerge, stack); + stack['delete'](srcValue); + } + return objValue; + } + + /** + * Used by `_.omit` to customize its `_.cloneDeep` use to only clone plain + * objects. + * + * @private + * @param {*} value The value to inspect. + * @param {string} key The key of the property to inspect. + * @returns {*} Returns the uncloned value or `undefined` to defer cloning to `_.cloneDeep`. + */ + function customOmitClone(value) { + return isPlainObject(value) ? undefined : value; + } + + /** + * A specialized version of `baseIsEqualDeep` for arrays with support for + * partial deep comparisons. + * + * @private + * @param {Array} array The array to compare. + * @param {Array} other The other array to compare. + * @param {number} bitmask The bitmask flags. See `baseIsEqual` for more details. + * @param {Function} customizer The function to customize comparisons. + * @param {Function} equalFunc The function to determine equivalents of values. + * @param {Object} stack Tracks traversed `array` and `other` objects. + * @returns {boolean} Returns `true` if the arrays are equivalent, else `false`. + */ + function equalArrays(array, other, bitmask, customizer, equalFunc, stack) { + var isPartial = bitmask & COMPARE_PARTIAL_FLAG, + arrLength = array.length, + othLength = other.length; + + if (arrLength != othLength && !(isPartial && othLength > arrLength)) { + return false; + } + // Check that cyclic values are equal. + var arrStacked = stack.get(array); + var othStacked = stack.get(other); + if (arrStacked && othStacked) { + return arrStacked == other && othStacked == array; + } + var index = -1, + result = true, + seen = (bitmask & COMPARE_UNORDERED_FLAG) ? new SetCache : undefined; + + stack.set(array, other); + stack.set(other, array); + + // Ignore non-index properties. + while (++index < arrLength) { + var arrValue = array[index], + othValue = other[index]; + + if (customizer) { + var compared = isPartial + ? customizer(othValue, arrValue, index, other, array, stack) + : customizer(arrValue, othValue, index, array, other, stack); + } + if (compared !== undefined) { + if (compared) { + continue; + } + result = false; + break; + } + // Recursively compare arrays (susceptible to call stack limits). + if (seen) { + if (!arraySome(other, function(othValue, othIndex) { + if (!cacheHas(seen, othIndex) && + (arrValue === othValue || equalFunc(arrValue, othValue, bitmask, customizer, stack))) { + return seen.push(othIndex); + } + })) { + result = false; + break; + } + } else if (!( + arrValue === othValue || + equalFunc(arrValue, othValue, bitmask, customizer, stack) + )) { + result = false; + break; + } + } + stack['delete'](array); + stack['delete'](other); + return result; + } + + /** + * A specialized version of `baseIsEqualDeep` for comparing objects of + * the same `toStringTag`. + * + * **Note:** This function only supports comparing values with tags of + * `Boolean`, `Date`, `Error`, `Number`, `RegExp`, or `String`. + * + * @private + * @param {Object} object The object to compare. + * @param {Object} other The other object to compare. + * @param {string} tag The `toStringTag` of the objects to compare. + * @param {number} bitmask The bitmask flags. See `baseIsEqual` for more details. + * @param {Function} customizer The function to customize comparisons. + * @param {Function} equalFunc The function to determine equivalents of values. + * @param {Object} stack Tracks traversed `object` and `other` objects. + * @returns {boolean} Returns `true` if the objects are equivalent, else `false`. + */ + function equalByTag(object, other, tag, bitmask, customizer, equalFunc, stack) { + switch (tag) { + case dataViewTag: + if ((object.byteLength != other.byteLength) || + (object.byteOffset != other.byteOffset)) { + return false; + } + object = object.buffer; + other = other.buffer; + + case arrayBufferTag: + if ((object.byteLength != other.byteLength) || + !equalFunc(new Uint8Array(object), new Uint8Array(other))) { + return false; + } + return true; + + case boolTag: + case dateTag: + case numberTag: + // Coerce booleans to `1` or `0` and dates to milliseconds. + // Invalid dates are coerced to `NaN`. + return eq(+object, +other); + + case errorTag: + return object.name == other.name && object.message == other.message; + + case regexpTag: + case stringTag: + // Coerce regexes to strings and treat strings, primitives and objects, + // as equal. See http://www.ecma-international.org/ecma-262/7.0/#sec-regexp.prototype.tostring + // for more details. + return object == (other + ''); + + case mapTag: + var convert = mapToArray; + + case setTag: + var isPartial = bitmask & COMPARE_PARTIAL_FLAG; + convert || (convert = setToArray); + + if (object.size != other.size && !isPartial) { + return false; + } + // Assume cyclic values are equal. + var stacked = stack.get(object); + if (stacked) { + return stacked == other; + } + bitmask |= COMPARE_UNORDERED_FLAG; + + // Recursively compare objects (susceptible to call stack limits). + stack.set(object, other); + var result = equalArrays(convert(object), convert(other), bitmask, customizer, equalFunc, stack); + stack['delete'](object); + return result; + + case symbolTag: + if (symbolValueOf) { + return symbolValueOf.call(object) == symbolValueOf.call(other); + } + } + return false; + } + + /** + * A specialized version of `baseIsEqualDeep` for objects with support for + * partial deep comparisons. + * + * @private + * @param {Object} object The object to compare. + * @param {Object} other The other object to compare. + * @param {number} bitmask The bitmask flags. See `baseIsEqual` for more details. + * @param {Function} customizer The function to customize comparisons. + * @param {Function} equalFunc The function to determine equivalents of values. + * @param {Object} stack Tracks traversed `object` and `other` objects. + * @returns {boolean} Returns `true` if the objects are equivalent, else `false`. + */ + function equalObjects(object, other, bitmask, customizer, equalFunc, stack) { + var isPartial = bitmask & COMPARE_PARTIAL_FLAG, + objProps = getAllKeys(object), + objLength = objProps.length, + othProps = getAllKeys(other), + othLength = othProps.length; + + if (objLength != othLength && !isPartial) { + return false; + } + var index = objLength; + while (index--) { + var key = objProps[index]; + if (!(isPartial ? key in other : hasOwnProperty.call(other, key))) { + return false; + } + } + // Check that cyclic values are equal. + var objStacked = stack.get(object); + var othStacked = stack.get(other); + if (objStacked && othStacked) { + return objStacked == other && othStacked == object; + } + var result = true; + stack.set(object, other); + stack.set(other, object); + + var skipCtor = isPartial; + while (++index < objLength) { + key = objProps[index]; + var objValue = object[key], + othValue = other[key]; + + if (customizer) { + var compared = isPartial + ? customizer(othValue, objValue, key, other, object, stack) + : customizer(objValue, othValue, key, object, other, stack); + } + // Recursively compare objects (susceptible to call stack limits). + if (!(compared === undefined + ? (objValue === othValue || equalFunc(objValue, othValue, bitmask, customizer, stack)) + : compared + )) { + result = false; + break; + } + skipCtor || (skipCtor = key == 'constructor'); + } + if (result && !skipCtor) { + var objCtor = object.constructor, + othCtor = other.constructor; + + // Non `Object` object instances with different constructors are not equal. + if (objCtor != othCtor && + ('constructor' in object && 'constructor' in other) && + !(typeof objCtor == 'function' && objCtor instanceof objCtor && + typeof othCtor == 'function' && othCtor instanceof othCtor)) { + result = false; + } + } + stack['delete'](object); + stack['delete'](other); + return result; + } + + /** + * A specialized version of `baseRest` which flattens the rest array. + * + * @private + * @param {Function} func The function to apply a rest parameter to. + * @returns {Function} Returns the new function. + */ + function flatRest(func) { + return setToString(overRest(func, undefined, flatten), func + ''); + } + + /** + * Creates an array of own enumerable property names and symbols of `object`. + * + * @private + * @param {Object} object The object to query. + * @returns {Array} Returns the array of property names and symbols. + */ + function getAllKeys(object) { + return baseGetAllKeys(object, keys, getSymbols); + } + + /** + * Creates an array of own and inherited enumerable property names and + * symbols of `object`. + * + * @private + * @param {Object} object The object to query. + * @returns {Array} Returns the array of property names and symbols. + */ + function getAllKeysIn(object) { + return baseGetAllKeys(object, keysIn, getSymbolsIn); + } + + /** + * Gets metadata for `func`. + * + * @private + * @param {Function} func The function to query. + * @returns {*} Returns the metadata for `func`. + */ + var getData = !metaMap ? noop : function(func) { + return metaMap.get(func); + }; + + /** + * Gets the name of `func`. + * + * @private + * @param {Function} func The function to query. + * @returns {string} Returns the function name. + */ + function getFuncName(func) { + var result = (func.name + ''), + array = realNames[result], + length = hasOwnProperty.call(realNames, result) ? array.length : 0; + + while (length--) { + var data = array[length], + otherFunc = data.func; + if (otherFunc == null || otherFunc == func) { + return data.name; + } + } + return result; + } + + /** + * Gets the argument placeholder value for `func`. + * + * @private + * @param {Function} func The function to inspect. + * @returns {*} Returns the placeholder value. + */ + function getHolder(func) { + var object = hasOwnProperty.call(lodash, 'placeholder') ? lodash : func; + return object.placeholder; + } + + /** + * Gets the appropriate "iteratee" function. If `_.iteratee` is customized, + * this function returns the custom method, otherwise it returns `baseIteratee`. + * If arguments are provided, the chosen function is invoked with them and + * its result is returned. + * + * @private + * @param {*} [value] The value to convert to an iteratee. + * @param {number} [arity] The arity of the created iteratee. + * @returns {Function} Returns the chosen function or its result. + */ + function getIteratee() { + var result = lodash.iteratee || iteratee; + result = result === iteratee ? baseIteratee : result; + return arguments.length ? result(arguments[0], arguments[1]) : result; + } + + /** + * Gets the data for `map`. + * + * @private + * @param {Object} map The map to query. + * @param {string} key The reference key. + * @returns {*} Returns the map data. + */ + function getMapData(map, key) { + var data = map.__data__; + return isKeyable(key) + ? data[typeof key == 'string' ? 'string' : 'hash'] + : data.map; + } + + /** + * Gets the property names, values, and compare flags of `object`. + * + * @private + * @param {Object} object The object to query. + * @returns {Array} Returns the match data of `object`. + */ + function getMatchData(object) { + var result = keys(object), + length = result.length; + + while (length--) { + var key = result[length], + value = object[key]; + + result[length] = [key, value, isStrictComparable(value)]; + } + return result; + } + + /** + * Gets the native function at `key` of `object`. + * + * @private + * @param {Object} object The object to query. + * @param {string} key The key of the method to get. + * @returns {*} Returns the function if it's native, else `undefined`. + */ + function getNative(object, key) { + var value = getValue(object, key); + return baseIsNative(value) ? value : undefined; + } + + /** + * A specialized version of `baseGetTag` which ignores `Symbol.toStringTag` values. + * + * @private + * @param {*} value The value to query. + * @returns {string} Returns the raw `toStringTag`. + */ + function getRawTag(value) { + var isOwn = hasOwnProperty.call(value, symToStringTag), + tag = value[symToStringTag]; + + try { + value[symToStringTag] = undefined; + var unmasked = true; + } catch (e) {} + + var result = nativeObjectToString.call(value); + if (unmasked) { + if (isOwn) { + value[symToStringTag] = tag; + } else { + delete value[symToStringTag]; + } + } + return result; + } + + /** + * Creates an array of the own enumerable symbols of `object`. + * + * @private + * @param {Object} object The object to query. + * @returns {Array} Returns the array of symbols. + */ + var getSymbols = !nativeGetSymbols ? stubArray : function(object) { + if (object == null) { + return []; + } + object = Object(object); + return arrayFilter(nativeGetSymbols(object), function(symbol) { + return propertyIsEnumerable.call(object, symbol); + }); + }; + + /** + * Creates an array of the own and inherited enumerable symbols of `object`. + * + * @private + * @param {Object} object The object to query. + * @returns {Array} Returns the array of symbols. + */ + var getSymbolsIn = !nativeGetSymbols ? stubArray : function(object) { + var result = []; + while (object) { + arrayPush(result, getSymbols(object)); + object = getPrototype(object); + } + return result; + }; + + /** + * Gets the `toStringTag` of `value`. + * + * @private + * @param {*} value The value to query. + * @returns {string} Returns the `toStringTag`. + */ + var getTag = baseGetTag; + + // Fallback for data views, maps, sets, and weak maps in IE 11 and promises in Node.js < 6. + if ((DataView && getTag(new DataView(new ArrayBuffer(1))) != dataViewTag) || + (Map && getTag(new Map) != mapTag) || + (Promise && getTag(Promise.resolve()) != promiseTag) || + (Set && getTag(new Set) != setTag) || + (WeakMap && getTag(new WeakMap) != weakMapTag)) { + getTag = function(value) { + var result = baseGetTag(value), + Ctor = result == objectTag ? value.constructor : undefined, + ctorString = Ctor ? toSource(Ctor) : ''; + + if (ctorString) { + switch (ctorString) { + case dataViewCtorString: return dataViewTag; + case mapCtorString: return mapTag; + case promiseCtorString: return promiseTag; + case setCtorString: return setTag; + case weakMapCtorString: return weakMapTag; + } + } + return result; + }; + } + + /** + * Gets the view, applying any `transforms` to the `start` and `end` positions. + * + * @private + * @param {number} start The start of the view. + * @param {number} end The end of the view. + * @param {Array} transforms The transformations to apply to the view. + * @returns {Object} Returns an object containing the `start` and `end` + * positions of the view. + */ + function getView(start, end, transforms) { + var index = -1, + length = transforms.length; + + while (++index < length) { + var data = transforms[index], + size = data.size; + + switch (data.type) { + case 'drop': start += size; break; + case 'dropRight': end -= size; break; + case 'take': end = nativeMin(end, start + size); break; + case 'takeRight': start = nativeMax(start, end - size); break; + } + } + return { 'start': start, 'end': end }; + } + + /** + * Extracts wrapper details from the `source` body comment. + * + * @private + * @param {string} source The source to inspect. + * @returns {Array} Returns the wrapper details. + */ + function getWrapDetails(source) { + var match = source.match(reWrapDetails); + return match ? match[1].split(reSplitDetails) : []; + } + + /** + * Checks if `path` exists on `object`. + * + * @private + * @param {Object} object The object to query. + * @param {Array|string} path The path to check. + * @param {Function} hasFunc The function to check properties. + * @returns {boolean} Returns `true` if `path` exists, else `false`. + */ + function hasPath(object, path, hasFunc) { + path = castPath(path, object); + + var index = -1, + length = path.length, + result = false; + + while (++index < length) { + var key = toKey(path[index]); + if (!(result = object != null && hasFunc(object, key))) { + break; + } + object = object[key]; + } + if (result || ++index != length) { + return result; + } + length = object == null ? 0 : object.length; + return !!length && isLength(length) && isIndex(key, length) && + (isArray(object) || isArguments(object)); + } + + /** + * Initializes an array clone. + * + * @private + * @param {Array} array The array to clone. + * @returns {Array} Returns the initialized clone. + */ + function initCloneArray(array) { + var length = array.length, + result = new array.constructor(length); + + // Add properties assigned by `RegExp#exec`. + if (length && typeof array[0] == 'string' && hasOwnProperty.call(array, 'index')) { + result.index = array.index; + result.input = array.input; + } + return result; + } + + /** + * Initializes an object clone. + * + * @private + * @param {Object} object The object to clone. + * @returns {Object} Returns the initialized clone. + */ + function initCloneObject(object) { + return (typeof object.constructor == 'function' && !isPrototype(object)) + ? baseCreate(getPrototype(object)) + : {}; + } + + /** + * Initializes an object clone based on its `toStringTag`. + * + * **Note:** This function only supports cloning values with tags of + * `Boolean`, `Date`, `Error`, `Map`, `Number`, `RegExp`, `Set`, or `String`. + * + * @private + * @param {Object} object The object to clone. + * @param {string} tag The `toStringTag` of the object to clone. + * @param {boolean} [isDeep] Specify a deep clone. + * @returns {Object} Returns the initialized clone. + */ + function initCloneByTag(object, tag, isDeep) { + var Ctor = object.constructor; + switch (tag) { + case arrayBufferTag: + return cloneArrayBuffer(object); + + case boolTag: + case dateTag: + return new Ctor(+object); + + case dataViewTag: + return cloneDataView(object, isDeep); + + case float32Tag: case float64Tag: + case int8Tag: case int16Tag: case int32Tag: + case uint8Tag: case uint8ClampedTag: case uint16Tag: case uint32Tag: + return cloneTypedArray(object, isDeep); + + case mapTag: + return new Ctor; + + case numberTag: + case stringTag: + return new Ctor(object); + + case regexpTag: + return cloneRegExp(object); + + case setTag: + return new Ctor; + + case symbolTag: + return cloneSymbol(object); + } + } + + /** + * Inserts wrapper `details` in a comment at the top of the `source` body. + * + * @private + * @param {string} source The source to modify. + * @returns {Array} details The details to insert. + * @returns {string} Returns the modified source. + */ + function insertWrapDetails(source, details) { + var length = details.length; + if (!length) { + return source; + } + var lastIndex = length - 1; + details[lastIndex] = (length > 1 ? '& ' : '') + details[lastIndex]; + details = details.join(length > 2 ? ', ' : ' '); + return source.replace(reWrapComment, '{\n/* [wrapped with ' + details + '] */\n'); + } + + /** + * Checks if `value` is a flattenable `arguments` object or array. + * + * @private + * @param {*} value The value to check. + * @returns {boolean} Returns `true` if `value` is flattenable, else `false`. + */ + function isFlattenable(value) { + return isArray(value) || isArguments(value) || + !!(spreadableSymbol && value && value[spreadableSymbol]); + } + + /** + * Checks if `value` is a valid array-like index. + * + * @private + * @param {*} value The value to check. + * @param {number} [length=MAX_SAFE_INTEGER] The upper bounds of a valid index. + * @returns {boolean} Returns `true` if `value` is a valid index, else `false`. + */ + function isIndex(value, length) { + var type = typeof value; + length = length == null ? MAX_SAFE_INTEGER : length; + + return !!length && + (type == 'number' || + (type != 'symbol' && reIsUint.test(value))) && + (value > -1 && value % 1 == 0 && value < length); + } + + /** + * Checks if the given arguments are from an iteratee call. + * + * @private + * @param {*} value The potential iteratee value argument. + * @param {*} index The potential iteratee index or key argument. + * @param {*} object The potential iteratee object argument. + * @returns {boolean} Returns `true` if the arguments are from an iteratee call, + * else `false`. + */ + function isIterateeCall(value, index, object) { + if (!isObject(object)) { + return false; + } + var type = typeof index; + if (type == 'number' + ? (isArrayLike(object) && isIndex(index, object.length)) + : (type == 'string' && index in object) + ) { + return eq(object[index], value); + } + return false; + } + + /** + * Checks if `value` is a property name and not a property path. + * + * @private + * @param {*} value The value to check. + * @param {Object} [object] The object to query keys on. + * @returns {boolean} Returns `true` if `value` is a property name, else `false`. + */ + function isKey(value, object) { + if (isArray(value)) { + return false; + } + var type = typeof value; + if (type == 'number' || type == 'symbol' || type == 'boolean' || + value == null || isSymbol(value)) { + return true; + } + return reIsPlainProp.test(value) || !reIsDeepProp.test(value) || + (object != null && value in Object(object)); + } + + /** + * Checks if `value` is suitable for use as unique object key. + * + * @private + * @param {*} value The value to check. + * @returns {boolean} Returns `true` if `value` is suitable, else `false`. + */ + function isKeyable(value) { + var type = typeof value; + return (type == 'string' || type == 'number' || type == 'symbol' || type == 'boolean') + ? (value !== '__proto__') + : (value === null); + } + + /** + * Checks if `func` has a lazy counterpart. + * + * @private + * @param {Function} func The function to check. + * @returns {boolean} Returns `true` if `func` has a lazy counterpart, + * else `false`. + */ + function isLaziable(func) { + var funcName = getFuncName(func), + other = lodash[funcName]; + + if (typeof other != 'function' || !(funcName in LazyWrapper.prototype)) { + return false; + } + if (func === other) { + return true; + } + var data = getData(other); + return !!data && func === data[0]; + } + + /** + * Checks if `func` has its source masked. + * + * @private + * @param {Function} func The function to check. + * @returns {boolean} Returns `true` if `func` is masked, else `false`. + */ + function isMasked(func) { + return !!maskSrcKey && (maskSrcKey in func); + } + + /** + * Checks if `func` is capable of being masked. + * + * @private + * @param {*} value The value to check. + * @returns {boolean} Returns `true` if `func` is maskable, else `false`. + */ + var isMaskable = coreJsData ? isFunction : stubFalse; + + /** + * Checks if `value` is likely a prototype object. + * + * @private + * @param {*} value The value to check. + * @returns {boolean} Returns `true` if `value` is a prototype, else `false`. + */ + function isPrototype(value) { + var Ctor = value && value.constructor, + proto = (typeof Ctor == 'function' && Ctor.prototype) || objectProto; + + return value === proto; + } + + /** + * Checks if `value` is suitable for strict equality comparisons, i.e. `===`. + * + * @private + * @param {*} value The value to check. + * @returns {boolean} Returns `true` if `value` if suitable for strict + * equality comparisons, else `false`. + */ + function isStrictComparable(value) { + return value === value && !isObject(value); + } + + /** + * A specialized version of `matchesProperty` for source values suitable + * for strict equality comparisons, i.e. `===`. + * + * @private + * @param {string} key The key of the property to get. + * @param {*} srcValue The value to match. + * @returns {Function} Returns the new spec function. + */ + function matchesStrictComparable(key, srcValue) { + return function(object) { + if (object == null) { + return false; + } + return object[key] === srcValue && + (srcValue !== undefined || (key in Object(object))); + }; + } + + /** + * A specialized version of `_.memoize` which clears the memoized function's + * cache when it exceeds `MAX_MEMOIZE_SIZE`. + * + * @private + * @param {Function} func The function to have its output memoized. + * @returns {Function} Returns the new memoized function. + */ + function memoizeCapped(func) { + var result = memoize(func, function(key) { + if (cache.size === MAX_MEMOIZE_SIZE) { + cache.clear(); + } + return key; + }); + + var cache = result.cache; + return result; + } + + /** + * Merges the function metadata of `source` into `data`. + * + * Merging metadata reduces the number of wrappers used to invoke a function. + * This is possible because methods like `_.bind`, `_.curry`, and `_.partial` + * may be applied regardless of execution order. Methods like `_.ary` and + * `_.rearg` modify function arguments, making the order in which they are + * executed important, preventing the merging of metadata. However, we make + * an exception for a safe combined case where curried functions have `_.ary` + * and or `_.rearg` applied. + * + * @private + * @param {Array} data The destination metadata. + * @param {Array} source The source metadata. + * @returns {Array} Returns `data`. + */ + function mergeData(data, source) { + var bitmask = data[1], + srcBitmask = source[1], + newBitmask = bitmask | srcBitmask, + isCommon = newBitmask < (WRAP_BIND_FLAG | WRAP_BIND_KEY_FLAG | WRAP_ARY_FLAG); + + var isCombo = + ((srcBitmask == WRAP_ARY_FLAG) && (bitmask == WRAP_CURRY_FLAG)) || + ((srcBitmask == WRAP_ARY_FLAG) && (bitmask == WRAP_REARG_FLAG) && (data[7].length <= source[8])) || + ((srcBitmask == (WRAP_ARY_FLAG | WRAP_REARG_FLAG)) && (source[7].length <= source[8]) && (bitmask == WRAP_CURRY_FLAG)); + + // Exit early if metadata can't be merged. + if (!(isCommon || isCombo)) { + return data; + } + // Use source `thisArg` if available. + if (srcBitmask & WRAP_BIND_FLAG) { + data[2] = source[2]; + // Set when currying a bound function. + newBitmask |= bitmask & WRAP_BIND_FLAG ? 0 : WRAP_CURRY_BOUND_FLAG; + } + // Compose partial arguments. + var value = source[3]; + if (value) { + var partials = data[3]; + data[3] = partials ? composeArgs(partials, value, source[4]) : value; + data[4] = partials ? replaceHolders(data[3], PLACEHOLDER) : source[4]; + } + // Compose partial right arguments. + value = source[5]; + if (value) { + partials = data[5]; + data[5] = partials ? composeArgsRight(partials, value, source[6]) : value; + data[6] = partials ? replaceHolders(data[5], PLACEHOLDER) : source[6]; + } + // Use source `argPos` if available. + value = source[7]; + if (value) { + data[7] = value; + } + // Use source `ary` if it's smaller. + if (srcBitmask & WRAP_ARY_FLAG) { + data[8] = data[8] == null ? source[8] : nativeMin(data[8], source[8]); + } + // Use source `arity` if one is not provided. + if (data[9] == null) { + data[9] = source[9]; + } + // Use source `func` and merge bitmasks. + data[0] = source[0]; + data[1] = newBitmask; + + return data; + } + + /** + * This function is like + * [`Object.keys`](http://ecma-international.org/ecma-262/7.0/#sec-object.keys) + * except that it includes inherited enumerable properties. + * + * @private + * @param {Object} object The object to query. + * @returns {Array} Returns the array of property names. + */ + function nativeKeysIn(object) { + var result = []; + if (object != null) { + for (var key in Object(object)) { + result.push(key); + } + } + return result; + } + + /** + * Converts `value` to a string using `Object.prototype.toString`. + * + * @private + * @param {*} value The value to convert. + * @returns {string} Returns the converted string. + */ + function objectToString(value) { + return nativeObjectToString.call(value); + } + + /** + * A specialized version of `baseRest` which transforms the rest array. + * + * @private + * @param {Function} func The function to apply a rest parameter to. + * @param {number} [start=func.length-1] The start position of the rest parameter. + * @param {Function} transform The rest array transform. + * @returns {Function} Returns the new function. + */ + function overRest(func, start, transform) { + start = nativeMax(start === undefined ? (func.length - 1) : start, 0); + return function() { + var args = arguments, + index = -1, + length = nativeMax(args.length - start, 0), + array = Array(length); + + while (++index < length) { + array[index] = args[start + index]; + } + index = -1; + var otherArgs = Array(start + 1); + while (++index < start) { + otherArgs[index] = args[index]; + } + otherArgs[start] = transform(array); + return apply(func, this, otherArgs); + }; + } + + /** + * Gets the parent value at `path` of `object`. + * + * @private + * @param {Object} object The object to query. + * @param {Array} path The path to get the parent value of. + * @returns {*} Returns the parent value. + */ + function parent(object, path) { + return path.length < 2 ? object : baseGet(object, baseSlice(path, 0, -1)); + } + + /** + * Reorder `array` according to the specified indexes where the element at + * the first index is assigned as the first element, the element at + * the second index is assigned as the second element, and so on. + * + * @private + * @param {Array} array The array to reorder. + * @param {Array} indexes The arranged array indexes. + * @returns {Array} Returns `array`. + */ + function reorder(array, indexes) { + var arrLength = array.length, + length = nativeMin(indexes.length, arrLength), + oldArray = copyArray(array); + + while (length--) { + var index = indexes[length]; + array[length] = isIndex(index, arrLength) ? oldArray[index] : undefined; + } + return array; + } + + /** + * Gets the value at `key`, unless `key` is "__proto__" or "constructor". + * + * @private + * @param {Object} object The object to query. + * @param {string} key The key of the property to get. + * @returns {*} Returns the property value. + */ + function safeGet(object, key) { + if (key === 'constructor' && typeof object[key] === 'function') { + return; + } + + if (key == '__proto__') { + return; + } + + return object[key]; + } + + /** + * Sets metadata for `func`. + * + * **Note:** If this function becomes hot, i.e. is invoked a lot in a short + * period of time, it will trip its breaker and transition to an identity + * function to avoid garbage collection pauses in V8. See + * [V8 issue 2070](https://bugs.chromium.org/p/v8/issues/detail?id=2070) + * for more details. + * + * @private + * @param {Function} func The function to associate metadata with. + * @param {*} data The metadata. + * @returns {Function} Returns `func`. + */ + var setData = shortOut(baseSetData); + + /** + * A simple wrapper around the global [`setTimeout`](https://mdn.io/setTimeout). + * + * @private + * @param {Function} func The function to delay. + * @param {number} wait The number of milliseconds to delay invocation. + * @returns {number|Object} Returns the timer id or timeout object. + */ + var setTimeout = ctxSetTimeout || function(func, wait) { + return root.setTimeout(func, wait); + }; + + /** + * Sets the `toString` method of `func` to return `string`. + * + * @private + * @param {Function} func The function to modify. + * @param {Function} string The `toString` result. + * @returns {Function} Returns `func`. + */ + var setToString = shortOut(baseSetToString); + + /** + * Sets the `toString` method of `wrapper` to mimic the source of `reference` + * with wrapper details in a comment at the top of the source body. + * + * @private + * @param {Function} wrapper The function to modify. + * @param {Function} reference The reference function. + * @param {number} bitmask The bitmask flags. See `createWrap` for more details. + * @returns {Function} Returns `wrapper`. + */ + function setWrapToString(wrapper, reference, bitmask) { + var source = (reference + ''); + return setToString(wrapper, insertWrapDetails(source, updateWrapDetails(getWrapDetails(source), bitmask))); + } + + /** + * Creates a function that'll short out and invoke `identity` instead + * of `func` when it's called `HOT_COUNT` or more times in `HOT_SPAN` + * milliseconds. + * + * @private + * @param {Function} func The function to restrict. + * @returns {Function} Returns the new shortable function. + */ + function shortOut(func) { + var count = 0, + lastCalled = 0; + + return function() { + var stamp = nativeNow(), + remaining = HOT_SPAN - (stamp - lastCalled); + + lastCalled = stamp; + if (remaining > 0) { + if (++count >= HOT_COUNT) { + return arguments[0]; + } + } else { + count = 0; + } + return func.apply(undefined, arguments); + }; + } + + /** + * A specialized version of `_.shuffle` which mutates and sets the size of `array`. + * + * @private + * @param {Array} array The array to shuffle. + * @param {number} [size=array.length] The size of `array`. + * @returns {Array} Returns `array`. + */ + function shuffleSelf(array, size) { + var index = -1, + length = array.length, + lastIndex = length - 1; + + size = size === undefined ? length : size; + while (++index < size) { + var rand = baseRandom(index, lastIndex), + value = array[rand]; + + array[rand] = array[index]; + array[index] = value; + } + array.length = size; + return array; + } + + /** + * Converts `string` to a property path array. + * + * @private + * @param {string} string The string to convert. + * @returns {Array} Returns the property path array. + */ + var stringToPath = memoizeCapped(function(string) { + var result = []; + if (string.charCodeAt(0) === 46 /* . */) { + result.push(''); + } + string.replace(rePropName, function(match, number, quote, subString) { + result.push(quote ? subString.replace(reEscapeChar, '$1') : (number || match)); + }); + return result; + }); + + /** + * Converts `value` to a string key if it's not a string or symbol. + * + * @private + * @param {*} value The value to inspect. + * @returns {string|symbol} Returns the key. + */ + function toKey(value) { + if (typeof value == 'string' || isSymbol(value)) { + return value; + } + var result = (value + ''); + return (result == '0' && (1 / value) == -INFINITY) ? '-0' : result; + } + + /** + * Converts `func` to its source code. + * + * @private + * @param {Function} func The function to convert. + * @returns {string} Returns the source code. + */ + function toSource(func) { + if (func != null) { + try { + return funcToString.call(func); + } catch (e) {} + try { + return (func + ''); + } catch (e) {} + } + return ''; + } + + /** + * Updates wrapper `details` based on `bitmask` flags. + * + * @private + * @returns {Array} details The details to modify. + * @param {number} bitmask The bitmask flags. See `createWrap` for more details. + * @returns {Array} Returns `details`. + */ + function updateWrapDetails(details, bitmask) { + arrayEach(wrapFlags, function(pair) { + var value = '_.' + pair[0]; + if ((bitmask & pair[1]) && !arrayIncludes(details, value)) { + details.push(value); + } + }); + return details.sort(); + } + + /** + * Creates a clone of `wrapper`. + * + * @private + * @param {Object} wrapper The wrapper to clone. + * @returns {Object} Returns the cloned wrapper. + */ + function wrapperClone(wrapper) { + if (wrapper instanceof LazyWrapper) { + return wrapper.clone(); + } + var result = new LodashWrapper(wrapper.__wrapped__, wrapper.__chain__); + result.__actions__ = copyArray(wrapper.__actions__); + result.__index__ = wrapper.__index__; + result.__values__ = wrapper.__values__; + return result; + } + + /*------------------------------------------------------------------------*/ + + /** + * Creates an array of elements split into groups the length of `size`. + * If `array` can't be split evenly, the final chunk will be the remaining + * elements. + * + * @static + * @memberOf _ + * @since 3.0.0 + * @category Array + * @param {Array} array The array to process. + * @param {number} [size=1] The length of each chunk + * @param- {Object} [guard] Enables use as an iteratee for methods like `_.map`. + * @returns {Array} Returns the new array of chunks. + * @example + * + * _.chunk(['a', 'b', 'c', 'd'], 2); + * // => [['a', 'b'], ['c', 'd']] + * + * _.chunk(['a', 'b', 'c', 'd'], 3); + * // => [['a', 'b', 'c'], ['d']] + */ + function chunk(array, size, guard) { + if ((guard ? isIterateeCall(array, size, guard) : size === undefined)) { + size = 1; + } else { + size = nativeMax(toInteger(size), 0); + } + var length = array == null ? 0 : array.length; + if (!length || size < 1) { + return []; + } + var index = 0, + resIndex = 0, + result = Array(nativeCeil(length / size)); + + while (index < length) { + result[resIndex++] = baseSlice(array, index, (index += size)); + } + return result; + } + + /** + * Creates an array with all falsey values removed. The values `false`, `null`, + * `0`, `""`, `undefined`, and `NaN` are falsey. + * + * @static + * @memberOf _ + * @since 0.1.0 + * @category Array + * @param {Array} array The array to compact. + * @returns {Array} Returns the new array of filtered values. + * @example + * + * _.compact([0, 1, false, 2, '', 3]); + * // => [1, 2, 3] + */ + function compact(array) { + var index = -1, + length = array == null ? 0 : array.length, + resIndex = 0, + result = []; + + while (++index < length) { + var value = array[index]; + if (value) { + result[resIndex++] = value; + } + } + return result; + } + + /** + * Creates a new array concatenating `array` with any additional arrays + * and/or values. + * + * @static + * @memberOf _ + * @since 4.0.0 + * @category Array + * @param {Array} array The array to concatenate. + * @param {...*} [values] The values to concatenate. + * @returns {Array} Returns the new concatenated array. + * @example + * + * var array = [1]; + * var other = _.concat(array, 2, [3], [[4]]); + * + * console.log(other); + * // => [1, 2, 3, [4]] + * + * console.log(array); + * // => [1] + */ + function concat() { + var length = arguments.length; + if (!length) { + return []; + } + var args = Array(length - 1), + array = arguments[0], + index = length; + + while (index--) { + args[index - 1] = arguments[index]; + } + return arrayPush(isArray(array) ? copyArray(array) : [array], baseFlatten(args, 1)); + } + + /** + * Creates an array of `array` values not included in the other given arrays + * using [`SameValueZero`](http://ecma-international.org/ecma-262/7.0/#sec-samevaluezero) + * for equality comparisons. The order and references of result values are + * determined by the first array. + * + * **Note:** Unlike `_.pullAll`, this method returns a new array. + * + * @static + * @memberOf _ + * @since 0.1.0 + * @category Array + * @param {Array} array The array to inspect. + * @param {...Array} [values] The values to exclude. + * @returns {Array} Returns the new array of filtered values. + * @see _.without, _.xor + * @example + * + * _.difference([2, 1], [2, 3]); + * // => [1] + */ + var difference = baseRest(function(array, values) { + return isArrayLikeObject(array) + ? baseDifference(array, baseFlatten(values, 1, isArrayLikeObject, true)) + : []; + }); + + /** + * This method is like `_.difference` except that it accepts `iteratee` which + * is invoked for each element of `array` and `values` to generate the criterion + * by which they're compared. The order and references of result values are + * determined by the first array. The iteratee is invoked with one argument: + * (value). + * + * **Note:** Unlike `_.pullAllBy`, this method returns a new array. + * + * @static + * @memberOf _ + * @since 4.0.0 + * @category Array + * @param {Array} array The array to inspect. + * @param {...Array} [values] The values to exclude. + * @param {Function} [iteratee=_.identity] The iteratee invoked per element. + * @returns {Array} Returns the new array of filtered values. + * @example + * + * _.differenceBy([2.1, 1.2], [2.3, 3.4], Math.floor); + * // => [1.2] + * + * // The `_.property` iteratee shorthand. + * _.differenceBy([{ 'x': 2 }, { 'x': 1 }], [{ 'x': 1 }], 'x'); + * // => [{ 'x': 2 }] + */ + var differenceBy = baseRest(function(array, values) { + var iteratee = last(values); + if (isArrayLikeObject(iteratee)) { + iteratee = undefined; + } + return isArrayLikeObject(array) + ? baseDifference(array, baseFlatten(values, 1, isArrayLikeObject, true), getIteratee(iteratee, 2)) + : []; + }); + + /** + * This method is like `_.difference` except that it accepts `comparator` + * which is invoked to compare elements of `array` to `values`. The order and + * references of result values are determined by the first array. The comparator + * is invoked with two arguments: (arrVal, othVal). + * + * **Note:** Unlike `_.pullAllWith`, this method returns a new array. + * + * @static + * @memberOf _ + * @since 4.0.0 + * @category Array + * @param {Array} array The array to inspect. + * @param {...Array} [values] The values to exclude. + * @param {Function} [comparator] The comparator invoked per element. + * @returns {Array} Returns the new array of filtered values. + * @example + * + * var objects = [{ 'x': 1, 'y': 2 }, { 'x': 2, 'y': 1 }]; + * + * _.differenceWith(objects, [{ 'x': 1, 'y': 2 }], _.isEqual); + * // => [{ 'x': 2, 'y': 1 }] + */ + var differenceWith = baseRest(function(array, values) { + var comparator = last(values); + if (isArrayLikeObject(comparator)) { + comparator = undefined; + } + return isArrayLikeObject(array) + ? baseDifference(array, baseFlatten(values, 1, isArrayLikeObject, true), undefined, comparator) + : []; + }); + + /** + * Creates a slice of `array` with `n` elements dropped from the beginning. + * + * @static + * @memberOf _ + * @since 0.5.0 + * @category Array + * @param {Array} array The array to query. + * @param {number} [n=1] The number of elements to drop. + * @param- {Object} [guard] Enables use as an iteratee for methods like `_.map`. + * @returns {Array} Returns the slice of `array`. + * @example + * + * _.drop([1, 2, 3]); + * // => [2, 3] + * + * _.drop([1, 2, 3], 2); + * // => [3] + * + * _.drop([1, 2, 3], 5); + * // => [] + * + * _.drop([1, 2, 3], 0); + * // => [1, 2, 3] + */ + function drop(array, n, guard) { + var length = array == null ? 0 : array.length; + if (!length) { + return []; + } + n = (guard || n === undefined) ? 1 : toInteger(n); + return baseSlice(array, n < 0 ? 0 : n, length); + } + + /** + * Creates a slice of `array` with `n` elements dropped from the end. + * + * @static + * @memberOf _ + * @since 3.0.0 + * @category Array + * @param {Array} array The array to query. + * @param {number} [n=1] The number of elements to drop. + * @param- {Object} [guard] Enables use as an iteratee for methods like `_.map`. + * @returns {Array} Returns the slice of `array`. + * @example + * + * _.dropRight([1, 2, 3]); + * // => [1, 2] + * + * _.dropRight([1, 2, 3], 2); + * // => [1] + * + * _.dropRight([1, 2, 3], 5); + * // => [] + * + * _.dropRight([1, 2, 3], 0); + * // => [1, 2, 3] + */ + function dropRight(array, n, guard) { + var length = array == null ? 0 : array.length; + if (!length) { + return []; + } + n = (guard || n === undefined) ? 1 : toInteger(n); + n = length - n; + return baseSlice(array, 0, n < 0 ? 0 : n); + } + + /** + * Creates a slice of `array` excluding elements dropped from the end. + * Elements are dropped until `predicate` returns falsey. The predicate is + * invoked with three arguments: (value, index, array). + * + * @static + * @memberOf _ + * @since 3.0.0 + * @category Array + * @param {Array} array The array to query. + * @param {Function} [predicate=_.identity] The function invoked per iteration. + * @returns {Array} Returns the slice of `array`. + * @example + * + * var users = [ + * { 'user': 'barney', 'active': true }, + * { 'user': 'fred', 'active': false }, + * { 'user': 'pebbles', 'active': false } + * ]; + * + * _.dropRightWhile(users, function(o) { return !o.active; }); + * // => objects for ['barney'] + * + * // The `_.matches` iteratee shorthand. + * _.dropRightWhile(users, { 'user': 'pebbles', 'active': false }); + * // => objects for ['barney', 'fred'] + * + * // The `_.matchesProperty` iteratee shorthand. + * _.dropRightWhile(users, ['active', false]); + * // => objects for ['barney'] + * + * // The `_.property` iteratee shorthand. + * _.dropRightWhile(users, 'active'); + * // => objects for ['barney', 'fred', 'pebbles'] + */ + function dropRightWhile(array, predicate) { + return (array && array.length) + ? baseWhile(array, getIteratee(predicate, 3), true, true) + : []; + } + + /** + * Creates a slice of `array` excluding elements dropped from the beginning. + * Elements are dropped until `predicate` returns falsey. The predicate is + * invoked with three arguments: (value, index, array). + * + * @static + * @memberOf _ + * @since 3.0.0 + * @category Array + * @param {Array} array The array to query. + * @param {Function} [predicate=_.identity] The function invoked per iteration. + * @returns {Array} Returns the slice of `array`. + * @example + * + * var users = [ + * { 'user': 'barney', 'active': false }, + * { 'user': 'fred', 'active': false }, + * { 'user': 'pebbles', 'active': true } + * ]; + * + * _.dropWhile(users, function(o) { return !o.active; }); + * // => objects for ['pebbles'] + * + * // The `_.matches` iteratee shorthand. + * _.dropWhile(users, { 'user': 'barney', 'active': false }); + * // => objects for ['fred', 'pebbles'] + * + * // The `_.matchesProperty` iteratee shorthand. + * _.dropWhile(users, ['active', false]); + * // => objects for ['pebbles'] + * + * // The `_.property` iteratee shorthand. + * _.dropWhile(users, 'active'); + * // => objects for ['barney', 'fred', 'pebbles'] + */ + function dropWhile(array, predicate) { + return (array && array.length) + ? baseWhile(array, getIteratee(predicate, 3), true) + : []; + } + + /** + * Fills elements of `array` with `value` from `start` up to, but not + * including, `end`. + * + * **Note:** This method mutates `array`. + * + * @static + * @memberOf _ + * @since 3.2.0 + * @category Array + * @param {Array} array The array to fill. + * @param {*} value The value to fill `array` with. + * @param {number} [start=0] The start position. + * @param {number} [end=array.length] The end position. + * @returns {Array} Returns `array`. + * @example + * + * var array = [1, 2, 3]; + * + * _.fill(array, 'a'); + * console.log(array); + * // => ['a', 'a', 'a'] + * + * _.fill(Array(3), 2); + * // => [2, 2, 2] + * + * _.fill([4, 6, 8, 10], '*', 1, 3); + * // => [4, '*', '*', 10] + */ + function fill(array, value, start, end) { + var length = array == null ? 0 : array.length; + if (!length) { + return []; + } + if (start && typeof start != 'number' && isIterateeCall(array, value, start)) { + start = 0; + end = length; + } + return baseFill(array, value, start, end); + } + + /** + * This method is like `_.find` except that it returns the index of the first + * element `predicate` returns truthy for instead of the element itself. + * + * @static + * @memberOf _ + * @since 1.1.0 + * @category Array + * @param {Array} array The array to inspect. + * @param {Function} [predicate=_.identity] The function invoked per iteration. + * @param {number} [fromIndex=0] The index to search from. + * @returns {number} Returns the index of the found element, else `-1`. + * @example + * + * var users = [ + * { 'user': 'barney', 'active': false }, + * { 'user': 'fred', 'active': false }, + * { 'user': 'pebbles', 'active': true } + * ]; + * + * _.findIndex(users, function(o) { return o.user == 'barney'; }); + * // => 0 + * + * // The `_.matches` iteratee shorthand. + * _.findIndex(users, { 'user': 'fred', 'active': false }); + * // => 1 + * + * // The `_.matchesProperty` iteratee shorthand. + * _.findIndex(users, ['active', false]); + * // => 0 + * + * // The `_.property` iteratee shorthand. + * _.findIndex(users, 'active'); + * // => 2 + */ + function findIndex(array, predicate, fromIndex) { + var length = array == null ? 0 : array.length; + if (!length) { + return -1; + } + var index = fromIndex == null ? 0 : toInteger(fromIndex); + if (index < 0) { + index = nativeMax(length + index, 0); + } + return baseFindIndex(array, getIteratee(predicate, 3), index); + } + + /** + * This method is like `_.findIndex` except that it iterates over elements + * of `collection` from right to left. + * + * @static + * @memberOf _ + * @since 2.0.0 + * @category Array + * @param {Array} array The array to inspect. + * @param {Function} [predicate=_.identity] The function invoked per iteration. + * @param {number} [fromIndex=array.length-1] The index to search from. + * @returns {number} Returns the index of the found element, else `-1`. + * @example + * + * var users = [ + * { 'user': 'barney', 'active': true }, + * { 'user': 'fred', 'active': false }, + * { 'user': 'pebbles', 'active': false } + * ]; + * + * _.findLastIndex(users, function(o) { return o.user == 'pebbles'; }); + * // => 2 + * + * // The `_.matches` iteratee shorthand. + * _.findLastIndex(users, { 'user': 'barney', 'active': true }); + * // => 0 + * + * // The `_.matchesProperty` iteratee shorthand. + * _.findLastIndex(users, ['active', false]); + * // => 2 + * + * // The `_.property` iteratee shorthand. + * _.findLastIndex(users, 'active'); + * // => 0 + */ + function findLastIndex(array, predicate, fromIndex) { + var length = array == null ? 0 : array.length; + if (!length) { + return -1; + } + var index = length - 1; + if (fromIndex !== undefined) { + index = toInteger(fromIndex); + index = fromIndex < 0 + ? nativeMax(length + index, 0) + : nativeMin(index, length - 1); + } + return baseFindIndex(array, getIteratee(predicate, 3), index, true); + } + + /** + * Flattens `array` a single level deep. + * + * @static + * @memberOf _ + * @since 0.1.0 + * @category Array + * @param {Array} array The array to flatten. + * @returns {Array} Returns the new flattened array. + * @example + * + * _.flatten([1, [2, [3, [4]], 5]]); + * // => [1, 2, [3, [4]], 5] + */ + function flatten(array) { + var length = array == null ? 0 : array.length; + return length ? baseFlatten(array, 1) : []; + } + + /** + * Recursively flattens `array`. + * + * @static + * @memberOf _ + * @since 3.0.0 + * @category Array + * @param {Array} array The array to flatten. + * @returns {Array} Returns the new flattened array. + * @example + * + * _.flattenDeep([1, [2, [3, [4]], 5]]); + * // => [1, 2, 3, 4, 5] + */ + function flattenDeep(array) { + var length = array == null ? 0 : array.length; + return length ? baseFlatten(array, INFINITY) : []; + } + + /** + * Recursively flatten `array` up to `depth` times. + * + * @static + * @memberOf _ + * @since 4.4.0 + * @category Array + * @param {Array} array The array to flatten. + * @param {number} [depth=1] The maximum recursion depth. + * @returns {Array} Returns the new flattened array. + * @example + * + * var array = [1, [2, [3, [4]], 5]]; + * + * _.flattenDepth(array, 1); + * // => [1, 2, [3, [4]], 5] + * + * _.flattenDepth(array, 2); + * // => [1, 2, 3, [4], 5] + */ + function flattenDepth(array, depth) { + var length = array == null ? 0 : array.length; + if (!length) { + return []; + } + depth = depth === undefined ? 1 : toInteger(depth); + return baseFlatten(array, depth); + } + + /** + * The inverse of `_.toPairs`; this method returns an object composed + * from key-value `pairs`. + * + * @static + * @memberOf _ + * @since 4.0.0 + * @category Array + * @param {Array} pairs The key-value pairs. + * @returns {Object} Returns the new object. + * @example + * + * _.fromPairs([['a', 1], ['b', 2]]); + * // => { 'a': 1, 'b': 2 } + */ + function fromPairs(pairs) { + var index = -1, + length = pairs == null ? 0 : pairs.length, + result = {}; + + while (++index < length) { + var pair = pairs[index]; + result[pair[0]] = pair[1]; + } + return result; + } + + /** + * Gets the first element of `array`. + * + * @static + * @memberOf _ + * @since 0.1.0 + * @alias first + * @category Array + * @param {Array} array The array to query. + * @returns {*} Returns the first element of `array`. + * @example + * + * _.head([1, 2, 3]); + * // => 1 + * + * _.head([]); + * // => undefined + */ + function head(array) { + return (array && array.length) ? array[0] : undefined; + } + + /** + * Gets the index at which the first occurrence of `value` is found in `array` + * using [`SameValueZero`](http://ecma-international.org/ecma-262/7.0/#sec-samevaluezero) + * for equality comparisons. If `fromIndex` is negative, it's used as the + * offset from the end of `array`. + * + * @static + * @memberOf _ + * @since 0.1.0 + * @category Array + * @param {Array} array The array to inspect. + * @param {*} value The value to search for. + * @param {number} [fromIndex=0] The index to search from. + * @returns {number} Returns the index of the matched value, else `-1`. + * @example + * + * _.indexOf([1, 2, 1, 2], 2); + * // => 1 + * + * // Search from the `fromIndex`. + * _.indexOf([1, 2, 1, 2], 2, 2); + * // => 3 + */ + function indexOf(array, value, fromIndex) { + var length = array == null ? 0 : array.length; + if (!length) { + return -1; + } + var index = fromIndex == null ? 0 : toInteger(fromIndex); + if (index < 0) { + index = nativeMax(length + index, 0); + } + return baseIndexOf(array, value, index); + } + + /** + * Gets all but the last element of `array`. + * + * @static + * @memberOf _ + * @since 0.1.0 + * @category Array + * @param {Array} array The array to query. + * @returns {Array} Returns the slice of `array`. + * @example + * + * _.initial([1, 2, 3]); + * // => [1, 2] + */ + function initial(array) { + var length = array == null ? 0 : array.length; + return length ? baseSlice(array, 0, -1) : []; + } + + /** + * Creates an array of unique values that are included in all given arrays + * using [`SameValueZero`](http://ecma-international.org/ecma-262/7.0/#sec-samevaluezero) + * for equality comparisons. The order and references of result values are + * determined by the first array. + * + * @static + * @memberOf _ + * @since 0.1.0 + * @category Array + * @param {...Array} [arrays] The arrays to inspect. + * @returns {Array} Returns the new array of intersecting values. + * @example + * + * _.intersection([2, 1], [2, 3]); + * // => [2] + */ + var intersection = baseRest(function(arrays) { + var mapped = arrayMap(arrays, castArrayLikeObject); + return (mapped.length && mapped[0] === arrays[0]) + ? baseIntersection(mapped) + : []; + }); + + /** + * This method is like `_.intersection` except that it accepts `iteratee` + * which is invoked for each element of each `arrays` to generate the criterion + * by which they're compared. The order and references of result values are + * determined by the first array. The iteratee is invoked with one argument: + * (value). + * + * @static + * @memberOf _ + * @since 4.0.0 + * @category Array + * @param {...Array} [arrays] The arrays to inspect. + * @param {Function} [iteratee=_.identity] The iteratee invoked per element. + * @returns {Array} Returns the new array of intersecting values. + * @example + * + * _.intersectionBy([2.1, 1.2], [2.3, 3.4], Math.floor); + * // => [2.1] + * + * // The `_.property` iteratee shorthand. + * _.intersectionBy([{ 'x': 1 }], [{ 'x': 2 }, { 'x': 1 }], 'x'); + * // => [{ 'x': 1 }] + */ + var intersectionBy = baseRest(function(arrays) { + var iteratee = last(arrays), + mapped = arrayMap(arrays, castArrayLikeObject); + + if (iteratee === last(mapped)) { + iteratee = undefined; + } else { + mapped.pop(); + } + return (mapped.length && mapped[0] === arrays[0]) + ? baseIntersection(mapped, getIteratee(iteratee, 2)) + : []; + }); + + /** + * This method is like `_.intersection` except that it accepts `comparator` + * which is invoked to compare elements of `arrays`. The order and references + * of result values are determined by the first array. The comparator is + * invoked with two arguments: (arrVal, othVal). + * + * @static + * @memberOf _ + * @since 4.0.0 + * @category Array + * @param {...Array} [arrays] The arrays to inspect. + * @param {Function} [comparator] The comparator invoked per element. + * @returns {Array} Returns the new array of intersecting values. + * @example + * + * var objects = [{ 'x': 1, 'y': 2 }, { 'x': 2, 'y': 1 }]; + * var others = [{ 'x': 1, 'y': 1 }, { 'x': 1, 'y': 2 }]; + * + * _.intersectionWith(objects, others, _.isEqual); + * // => [{ 'x': 1, 'y': 2 }] + */ + var intersectionWith = baseRest(function(arrays) { + var comparator = last(arrays), + mapped = arrayMap(arrays, castArrayLikeObject); + + comparator = typeof comparator == 'function' ? comparator : undefined; + if (comparator) { + mapped.pop(); + } + return (mapped.length && mapped[0] === arrays[0]) + ? baseIntersection(mapped, undefined, comparator) + : []; + }); + + /** + * Converts all elements in `array` into a string separated by `separator`. + * + * @static + * @memberOf _ + * @since 4.0.0 + * @category Array + * @param {Array} array The array to convert. + * @param {string} [separator=','] The element separator. + * @returns {string} Returns the joined string. + * @example + * + * _.join(['a', 'b', 'c'], '~'); + * // => 'a~b~c' + */ + function join(array, separator) { + return array == null ? '' : nativeJoin.call(array, separator); + } + + /** + * Gets the last element of `array`. + * + * @static + * @memberOf _ + * @since 0.1.0 + * @category Array + * @param {Array} array The array to query. + * @returns {*} Returns the last element of `array`. + * @example + * + * _.last([1, 2, 3]); + * // => 3 + */ + function last(array) { + var length = array == null ? 0 : array.length; + return length ? array[length - 1] : undefined; + } + + /** + * This method is like `_.indexOf` except that it iterates over elements of + * `array` from right to left. + * + * @static + * @memberOf _ + * @since 0.1.0 + * @category Array + * @param {Array} array The array to inspect. + * @param {*} value The value to search for. + * @param {number} [fromIndex=array.length-1] The index to search from. + * @returns {number} Returns the index of the matched value, else `-1`. + * @example + * + * _.lastIndexOf([1, 2, 1, 2], 2); + * // => 3 + * + * // Search from the `fromIndex`. + * _.lastIndexOf([1, 2, 1, 2], 2, 2); + * // => 1 + */ + function lastIndexOf(array, value, fromIndex) { + var length = array == null ? 0 : array.length; + if (!length) { + return -1; + } + var index = length; + if (fromIndex !== undefined) { + index = toInteger(fromIndex); + index = index < 0 ? nativeMax(length + index, 0) : nativeMin(index, length - 1); + } + return value === value + ? strictLastIndexOf(array, value, index) + : baseFindIndex(array, baseIsNaN, index, true); + } + + /** + * Gets the element at index `n` of `array`. If `n` is negative, the nth + * element from the end is returned. + * + * @static + * @memberOf _ + * @since 4.11.0 + * @category Array + * @param {Array} array The array to query. + * @param {number} [n=0] The index of the element to return. + * @returns {*} Returns the nth element of `array`. + * @example + * + * var array = ['a', 'b', 'c', 'd']; + * + * _.nth(array, 1); + * // => 'b' + * + * _.nth(array, -2); + * // => 'c'; + */ + function nth(array, n) { + return (array && array.length) ? baseNth(array, toInteger(n)) : undefined; + } + + /** + * Removes all given values from `array` using + * [`SameValueZero`](http://ecma-international.org/ecma-262/7.0/#sec-samevaluezero) + * for equality comparisons. + * + * **Note:** Unlike `_.without`, this method mutates `array`. Use `_.remove` + * to remove elements from an array by predicate. + * + * @static + * @memberOf _ + * @since 2.0.0 + * @category Array + * @param {Array} array The array to modify. + * @param {...*} [values] The values to remove. + * @returns {Array} Returns `array`. + * @example + * + * var array = ['a', 'b', 'c', 'a', 'b', 'c']; + * + * _.pull(array, 'a', 'c'); + * console.log(array); + * // => ['b', 'b'] + */ + var pull = baseRest(pullAll); + + /** + * This method is like `_.pull` except that it accepts an array of values to remove. + * + * **Note:** Unlike `_.difference`, this method mutates `array`. + * + * @static + * @memberOf _ + * @since 4.0.0 + * @category Array + * @param {Array} array The array to modify. + * @param {Array} values The values to remove. + * @returns {Array} Returns `array`. + * @example + * + * var array = ['a', 'b', 'c', 'a', 'b', 'c']; + * + * _.pullAll(array, ['a', 'c']); + * console.log(array); + * // => ['b', 'b'] + */ + function pullAll(array, values) { + return (array && array.length && values && values.length) + ? basePullAll(array, values) + : array; + } + + /** + * This method is like `_.pullAll` except that it accepts `iteratee` which is + * invoked for each element of `array` and `values` to generate the criterion + * by which they're compared. The iteratee is invoked with one argument: (value). + * + * **Note:** Unlike `_.differenceBy`, this method mutates `array`. + * + * @static + * @memberOf _ + * @since 4.0.0 + * @category Array + * @param {Array} array The array to modify. + * @param {Array} values The values to remove. + * @param {Function} [iteratee=_.identity] The iteratee invoked per element. + * @returns {Array} Returns `array`. + * @example + * + * var array = [{ 'x': 1 }, { 'x': 2 }, { 'x': 3 }, { 'x': 1 }]; + * + * _.pullAllBy(array, [{ 'x': 1 }, { 'x': 3 }], 'x'); + * console.log(array); + * // => [{ 'x': 2 }] + */ + function pullAllBy(array, values, iteratee) { + return (array && array.length && values && values.length) + ? basePullAll(array, values, getIteratee(iteratee, 2)) + : array; + } + + /** + * This method is like `_.pullAll` except that it accepts `comparator` which + * is invoked to compare elements of `array` to `values`. The comparator is + * invoked with two arguments: (arrVal, othVal). + * + * **Note:** Unlike `_.differenceWith`, this method mutates `array`. + * + * @static + * @memberOf _ + * @since 4.6.0 + * @category Array + * @param {Array} array The array to modify. + * @param {Array} values The values to remove. + * @param {Function} [comparator] The comparator invoked per element. + * @returns {Array} Returns `array`. + * @example + * + * var array = [{ 'x': 1, 'y': 2 }, { 'x': 3, 'y': 4 }, { 'x': 5, 'y': 6 }]; + * + * _.pullAllWith(array, [{ 'x': 3, 'y': 4 }], _.isEqual); + * console.log(array); + * // => [{ 'x': 1, 'y': 2 }, { 'x': 5, 'y': 6 }] + */ + function pullAllWith(array, values, comparator) { + return (array && array.length && values && values.length) + ? basePullAll(array, values, undefined, comparator) + : array; + } + + /** + * Removes elements from `array` corresponding to `indexes` and returns an + * array of removed elements. + * + * **Note:** Unlike `_.at`, this method mutates `array`. + * + * @static + * @memberOf _ + * @since 3.0.0 + * @category Array + * @param {Array} array The array to modify. + * @param {...(number|number[])} [indexes] The indexes of elements to remove. + * @returns {Array} Returns the new array of removed elements. + * @example + * + * var array = ['a', 'b', 'c', 'd']; + * var pulled = _.pullAt(array, [1, 3]); + * + * console.log(array); + * // => ['a', 'c'] + * + * console.log(pulled); + * // => ['b', 'd'] + */ + var pullAt = flatRest(function(array, indexes) { + var length = array == null ? 0 : array.length, + result = baseAt(array, indexes); + + basePullAt(array, arrayMap(indexes, function(index) { + return isIndex(index, length) ? +index : index; + }).sort(compareAscending)); + + return result; + }); + + /** + * Removes all elements from `array` that `predicate` returns truthy for + * and returns an array of the removed elements. The predicate is invoked + * with three arguments: (value, index, array). + * + * **Note:** Unlike `_.filter`, this method mutates `array`. Use `_.pull` + * to pull elements from an array by value. + * + * @static + * @memberOf _ + * @since 2.0.0 + * @category Array + * @param {Array} array The array to modify. + * @param {Function} [predicate=_.identity] The function invoked per iteration. + * @returns {Array} Returns the new array of removed elements. + * @example + * + * var array = [1, 2, 3, 4]; + * var evens = _.remove(array, function(n) { + * return n % 2 == 0; + * }); + * + * console.log(array); + * // => [1, 3] + * + * console.log(evens); + * // => [2, 4] + */ + function remove(array, predicate) { + var result = []; + if (!(array && array.length)) { + return result; + } + var index = -1, + indexes = [], + length = array.length; + + predicate = getIteratee(predicate, 3); + while (++index < length) { + var value = array[index]; + if (predicate(value, index, array)) { + result.push(value); + indexes.push(index); + } + } + basePullAt(array, indexes); + return result; + } + + /** + * Reverses `array` so that the first element becomes the last, the second + * element becomes the second to last, and so on. + * + * **Note:** This method mutates `array` and is based on + * [`Array#reverse`](https://mdn.io/Array/reverse). + * + * @static + * @memberOf _ + * @since 4.0.0 + * @category Array + * @param {Array} array The array to modify. + * @returns {Array} Returns `array`. + * @example + * + * var array = [1, 2, 3]; + * + * _.reverse(array); + * // => [3, 2, 1] + * + * console.log(array); + * // => [3, 2, 1] + */ + function reverse(array) { + return array == null ? array : nativeReverse.call(array); + } + + /** + * Creates a slice of `array` from `start` up to, but not including, `end`. + * + * **Note:** This method is used instead of + * [`Array#slice`](https://mdn.io/Array/slice) to ensure dense arrays are + * returned. + * + * @static + * @memberOf _ + * @since 3.0.0 + * @category Array + * @param {Array} array The array to slice. + * @param {number} [start=0] The start position. + * @param {number} [end=array.length] The end position. + * @returns {Array} Returns the slice of `array`. + */ + function slice(array, start, end) { + var length = array == null ? 0 : array.length; + if (!length) { + return []; + } + if (end && typeof end != 'number' && isIterateeCall(array, start, end)) { + start = 0; + end = length; + } + else { + start = start == null ? 0 : toInteger(start); + end = end === undefined ? length : toInteger(end); + } + return baseSlice(array, start, end); + } + + /** + * Uses a binary search to determine the lowest index at which `value` + * should be inserted into `array` in order to maintain its sort order. + * + * @static + * @memberOf _ + * @since 0.1.0 + * @category Array + * @param {Array} array The sorted array to inspect. + * @param {*} value The value to evaluate. + * @returns {number} Returns the index at which `value` should be inserted + * into `array`. + * @example + * + * _.sortedIndex([30, 50], 40); + * // => 1 + */ + function sortedIndex(array, value) { + return baseSortedIndex(array, value); + } + + /** + * This method is like `_.sortedIndex` except that it accepts `iteratee` + * which is invoked for `value` and each element of `array` to compute their + * sort ranking. The iteratee is invoked with one argument: (value). + * + * @static + * @memberOf _ + * @since 4.0.0 + * @category Array + * @param {Array} array The sorted array to inspect. + * @param {*} value The value to evaluate. + * @param {Function} [iteratee=_.identity] The iteratee invoked per element. + * @returns {number} Returns the index at which `value` should be inserted + * into `array`. + * @example + * + * var objects = [{ 'x': 4 }, { 'x': 5 }]; + * + * _.sortedIndexBy(objects, { 'x': 4 }, function(o) { return o.x; }); + * // => 0 + * + * // The `_.property` iteratee shorthand. + * _.sortedIndexBy(objects, { 'x': 4 }, 'x'); + * // => 0 + */ + function sortedIndexBy(array, value, iteratee) { + return baseSortedIndexBy(array, value, getIteratee(iteratee, 2)); + } + + /** + * This method is like `_.indexOf` except that it performs a binary + * search on a sorted `array`. + * + * @static + * @memberOf _ + * @since 4.0.0 + * @category Array + * @param {Array} array The array to inspect. + * @param {*} value The value to search for. + * @returns {number} Returns the index of the matched value, else `-1`. + * @example + * + * _.sortedIndexOf([4, 5, 5, 5, 6], 5); + * // => 1 + */ + function sortedIndexOf(array, value) { + var length = array == null ? 0 : array.length; + if (length) { + var index = baseSortedIndex(array, value); + if (index < length && eq(array[index], value)) { + return index; + } + } + return -1; + } + + /** + * This method is like `_.sortedIndex` except that it returns the highest + * index at which `value` should be inserted into `array` in order to + * maintain its sort order. + * + * @static + * @memberOf _ + * @since 3.0.0 + * @category Array + * @param {Array} array The sorted array to inspect. + * @param {*} value The value to evaluate. + * @returns {number} Returns the index at which `value` should be inserted + * into `array`. + * @example + * + * _.sortedLastIndex([4, 5, 5, 5, 6], 5); + * // => 4 + */ + function sortedLastIndex(array, value) { + return baseSortedIndex(array, value, true); + } + + /** + * This method is like `_.sortedLastIndex` except that it accepts `iteratee` + * which is invoked for `value` and each element of `array` to compute their + * sort ranking. The iteratee is invoked with one argument: (value). + * + * @static + * @memberOf _ + * @since 4.0.0 + * @category Array + * @param {Array} array The sorted array to inspect. + * @param {*} value The value to evaluate. + * @param {Function} [iteratee=_.identity] The iteratee invoked per element. + * @returns {number} Returns the index at which `value` should be inserted + * into `array`. + * @example + * + * var objects = [{ 'x': 4 }, { 'x': 5 }]; + * + * _.sortedLastIndexBy(objects, { 'x': 4 }, function(o) { return o.x; }); + * // => 1 + * + * // The `_.property` iteratee shorthand. + * _.sortedLastIndexBy(objects, { 'x': 4 }, 'x'); + * // => 1 + */ + function sortedLastIndexBy(array, value, iteratee) { + return baseSortedIndexBy(array, value, getIteratee(iteratee, 2), true); + } + + /** + * This method is like `_.lastIndexOf` except that it performs a binary + * search on a sorted `array`. + * + * @static + * @memberOf _ + * @since 4.0.0 + * @category Array + * @param {Array} array The array to inspect. + * @param {*} value The value to search for. + * @returns {number} Returns the index of the matched value, else `-1`. + * @example + * + * _.sortedLastIndexOf([4, 5, 5, 5, 6], 5); + * // => 3 + */ + function sortedLastIndexOf(array, value) { + var length = array == null ? 0 : array.length; + if (length) { + var index = baseSortedIndex(array, value, true) - 1; + if (eq(array[index], value)) { + return index; + } + } + return -1; + } + + /** + * This method is like `_.uniq` except that it's designed and optimized + * for sorted arrays. + * + * @static + * @memberOf _ + * @since 4.0.0 + * @category Array + * @param {Array} array The array to inspect. + * @returns {Array} Returns the new duplicate free array. + * @example + * + * _.sortedUniq([1, 1, 2]); + * // => [1, 2] + */ + function sortedUniq(array) { + return (array && array.length) + ? baseSortedUniq(array) + : []; + } + + /** + * This method is like `_.uniqBy` except that it's designed and optimized + * for sorted arrays. + * + * @static + * @memberOf _ + * @since 4.0.0 + * @category Array + * @param {Array} array The array to inspect. + * @param {Function} [iteratee] The iteratee invoked per element. + * @returns {Array} Returns the new duplicate free array. + * @example + * + * _.sortedUniqBy([1.1, 1.2, 2.3, 2.4], Math.floor); + * // => [1.1, 2.3] + */ + function sortedUniqBy(array, iteratee) { + return (array && array.length) + ? baseSortedUniq(array, getIteratee(iteratee, 2)) + : []; + } + + /** + * Gets all but the first element of `array`. + * + * @static + * @memberOf _ + * @since 4.0.0 + * @category Array + * @param {Array} array The array to query. + * @returns {Array} Returns the slice of `array`. + * @example + * + * _.tail([1, 2, 3]); + * // => [2, 3] + */ + function tail(array) { + var length = array == null ? 0 : array.length; + return length ? baseSlice(array, 1, length) : []; + } + + /** + * Creates a slice of `array` with `n` elements taken from the beginning. + * + * @static + * @memberOf _ + * @since 0.1.0 + * @category Array + * @param {Array} array The array to query. + * @param {number} [n=1] The number of elements to take. + * @param- {Object} [guard] Enables use as an iteratee for methods like `_.map`. + * @returns {Array} Returns the slice of `array`. + * @example + * + * _.take([1, 2, 3]); + * // => [1] + * + * _.take([1, 2, 3], 2); + * // => [1, 2] + * + * _.take([1, 2, 3], 5); + * // => [1, 2, 3] + * + * _.take([1, 2, 3], 0); + * // => [] + */ + function take(array, n, guard) { + if (!(array && array.length)) { + return []; + } + n = (guard || n === undefined) ? 1 : toInteger(n); + return baseSlice(array, 0, n < 0 ? 0 : n); + } + + /** + * Creates a slice of `array` with `n` elements taken from the end. + * + * @static + * @memberOf _ + * @since 3.0.0 + * @category Array + * @param {Array} array The array to query. + * @param {number} [n=1] The number of elements to take. + * @param- {Object} [guard] Enables use as an iteratee for methods like `_.map`. + * @returns {Array} Returns the slice of `array`. + * @example + * + * _.takeRight([1, 2, 3]); + * // => [3] + * + * _.takeRight([1, 2, 3], 2); + * // => [2, 3] + * + * _.takeRight([1, 2, 3], 5); + * // => [1, 2, 3] + * + * _.takeRight([1, 2, 3], 0); + * // => [] + */ + function takeRight(array, n, guard) { + var length = array == null ? 0 : array.length; + if (!length) { + return []; + } + n = (guard || n === undefined) ? 1 : toInteger(n); + n = length - n; + return baseSlice(array, n < 0 ? 0 : n, length); + } + + /** + * Creates a slice of `array` with elements taken from the end. Elements are + * taken until `predicate` returns falsey. The predicate is invoked with + * three arguments: (value, index, array). + * + * @static + * @memberOf _ + * @since 3.0.0 + * @category Array + * @param {Array} array The array to query. + * @param {Function} [predicate=_.identity] The function invoked per iteration. + * @returns {Array} Returns the slice of `array`. + * @example + * + * var users = [ + * { 'user': 'barney', 'active': true }, + * { 'user': 'fred', 'active': false }, + * { 'user': 'pebbles', 'active': false } + * ]; + * + * _.takeRightWhile(users, function(o) { return !o.active; }); + * // => objects for ['fred', 'pebbles'] + * + * // The `_.matches` iteratee shorthand. + * _.takeRightWhile(users, { 'user': 'pebbles', 'active': false }); + * // => objects for ['pebbles'] + * + * // The `_.matchesProperty` iteratee shorthand. + * _.takeRightWhile(users, ['active', false]); + * // => objects for ['fred', 'pebbles'] + * + * // The `_.property` iteratee shorthand. + * _.takeRightWhile(users, 'active'); + * // => [] + */ + function takeRightWhile(array, predicate) { + return (array && array.length) + ? baseWhile(array, getIteratee(predicate, 3), false, true) + : []; + } + + /** + * Creates a slice of `array` with elements taken from the beginning. Elements + * are taken until `predicate` returns falsey. The predicate is invoked with + * three arguments: (value, index, array). + * + * @static + * @memberOf _ + * @since 3.0.0 + * @category Array + * @param {Array} array The array to query. + * @param {Function} [predicate=_.identity] The function invoked per iteration. + * @returns {Array} Returns the slice of `array`. + * @example + * + * var users = [ + * { 'user': 'barney', 'active': false }, + * { 'user': 'fred', 'active': false }, + * { 'user': 'pebbles', 'active': true } + * ]; + * + * _.takeWhile(users, function(o) { return !o.active; }); + * // => objects for ['barney', 'fred'] + * + * // The `_.matches` iteratee shorthand. + * _.takeWhile(users, { 'user': 'barney', 'active': false }); + * // => objects for ['barney'] + * + * // The `_.matchesProperty` iteratee shorthand. + * _.takeWhile(users, ['active', false]); + * // => objects for ['barney', 'fred'] + * + * // The `_.property` iteratee shorthand. + * _.takeWhile(users, 'active'); + * // => [] + */ + function takeWhile(array, predicate) { + return (array && array.length) + ? baseWhile(array, getIteratee(predicate, 3)) + : []; + } + + /** + * Creates an array of unique values, in order, from all given arrays using + * [`SameValueZero`](http://ecma-international.org/ecma-262/7.0/#sec-samevaluezero) + * for equality comparisons. + * + * @static + * @memberOf _ + * @since 0.1.0 + * @category Array + * @param {...Array} [arrays] The arrays to inspect. + * @returns {Array} Returns the new array of combined values. + * @example + * + * _.union([2], [1, 2]); + * // => [2, 1] + */ + var union = baseRest(function(arrays) { + return baseUniq(baseFlatten(arrays, 1, isArrayLikeObject, true)); + }); + + /** + * This method is like `_.union` except that it accepts `iteratee` which is + * invoked for each element of each `arrays` to generate the criterion by + * which uniqueness is computed. Result values are chosen from the first + * array in which the value occurs. The iteratee is invoked with one argument: + * (value). + * + * @static + * @memberOf _ + * @since 4.0.0 + * @category Array + * @param {...Array} [arrays] The arrays to inspect. + * @param {Function} [iteratee=_.identity] The iteratee invoked per element. + * @returns {Array} Returns the new array of combined values. + * @example + * + * _.unionBy([2.1], [1.2, 2.3], Math.floor); + * // => [2.1, 1.2] + * + * // The `_.property` iteratee shorthand. + * _.unionBy([{ 'x': 1 }], [{ 'x': 2 }, { 'x': 1 }], 'x'); + * // => [{ 'x': 1 }, { 'x': 2 }] + */ + var unionBy = baseRest(function(arrays) { + var iteratee = last(arrays); + if (isArrayLikeObject(iteratee)) { + iteratee = undefined; + } + return baseUniq(baseFlatten(arrays, 1, isArrayLikeObject, true), getIteratee(iteratee, 2)); + }); + + /** + * This method is like `_.union` except that it accepts `comparator` which + * is invoked to compare elements of `arrays`. Result values are chosen from + * the first array in which the value occurs. The comparator is invoked + * with two arguments: (arrVal, othVal). + * + * @static + * @memberOf _ + * @since 4.0.0 + * @category Array + * @param {...Array} [arrays] The arrays to inspect. + * @param {Function} [comparator] The comparator invoked per element. + * @returns {Array} Returns the new array of combined values. + * @example + * + * var objects = [{ 'x': 1, 'y': 2 }, { 'x': 2, 'y': 1 }]; + * var others = [{ 'x': 1, 'y': 1 }, { 'x': 1, 'y': 2 }]; + * + * _.unionWith(objects, others, _.isEqual); + * // => [{ 'x': 1, 'y': 2 }, { 'x': 2, 'y': 1 }, { 'x': 1, 'y': 1 }] + */ + var unionWith = baseRest(function(arrays) { + var comparator = last(arrays); + comparator = typeof comparator == 'function' ? comparator : undefined; + return baseUniq(baseFlatten(arrays, 1, isArrayLikeObject, true), undefined, comparator); + }); + + /** + * Creates a duplicate-free version of an array, using + * [`SameValueZero`](http://ecma-international.org/ecma-262/7.0/#sec-samevaluezero) + * for equality comparisons, in which only the first occurrence of each element + * is kept. The order of result values is determined by the order they occur + * in the array. + * + * @static + * @memberOf _ + * @since 0.1.0 + * @category Array + * @param {Array} array The array to inspect. + * @returns {Array} Returns the new duplicate free array. + * @example + * + * _.uniq([2, 1, 2]); + * // => [2, 1] + */ + function uniq(array) { + return (array && array.length) ? baseUniq(array) : []; + } + + /** + * This method is like `_.uniq` except that it accepts `iteratee` which is + * invoked for each element in `array` to generate the criterion by which + * uniqueness is computed. The order of result values is determined by the + * order they occur in the array. The iteratee is invoked with one argument: + * (value). + * + * @static + * @memberOf _ + * @since 4.0.0 + * @category Array + * @param {Array} array The array to inspect. + * @param {Function} [iteratee=_.identity] The iteratee invoked per element. + * @returns {Array} Returns the new duplicate free array. + * @example + * + * _.uniqBy([2.1, 1.2, 2.3], Math.floor); + * // => [2.1, 1.2] + * + * // The `_.property` iteratee shorthand. + * _.uniqBy([{ 'x': 1 }, { 'x': 2 }, { 'x': 1 }], 'x'); + * // => [{ 'x': 1 }, { 'x': 2 }] + */ + function uniqBy(array, iteratee) { + return (array && array.length) ? baseUniq(array, getIteratee(iteratee, 2)) : []; + } + + /** + * This method is like `_.uniq` except that it accepts `comparator` which + * is invoked to compare elements of `array`. The order of result values is + * determined by the order they occur in the array.The comparator is invoked + * with two arguments: (arrVal, othVal). + * + * @static + * @memberOf _ + * @since 4.0.0 + * @category Array + * @param {Array} array The array to inspect. + * @param {Function} [comparator] The comparator invoked per element. + * @returns {Array} Returns the new duplicate free array. + * @example + * + * var objects = [{ 'x': 1, 'y': 2 }, { 'x': 2, 'y': 1 }, { 'x': 1, 'y': 2 }]; + * + * _.uniqWith(objects, _.isEqual); + * // => [{ 'x': 1, 'y': 2 }, { 'x': 2, 'y': 1 }] + */ + function uniqWith(array, comparator) { + comparator = typeof comparator == 'function' ? comparator : undefined; + return (array && array.length) ? baseUniq(array, undefined, comparator) : []; + } + + /** + * This method is like `_.zip` except that it accepts an array of grouped + * elements and creates an array regrouping the elements to their pre-zip + * configuration. + * + * @static + * @memberOf _ + * @since 1.2.0 + * @category Array + * @param {Array} array The array of grouped elements to process. + * @returns {Array} Returns the new array of regrouped elements. + * @example + * + * var zipped = _.zip(['a', 'b'], [1, 2], [true, false]); + * // => [['a', 1, true], ['b', 2, false]] + * + * _.unzip(zipped); + * // => [['a', 'b'], [1, 2], [true, false]] + */ + function unzip(array) { + if (!(array && array.length)) { + return []; + } + var length = 0; + array = arrayFilter(array, function(group) { + if (isArrayLikeObject(group)) { + length = nativeMax(group.length, length); + return true; + } + }); + return baseTimes(length, function(index) { + return arrayMap(array, baseProperty(index)); + }); + } + + /** + * This method is like `_.unzip` except that it accepts `iteratee` to specify + * how regrouped values should be combined. The iteratee is invoked with the + * elements of each group: (...group). + * + * @static + * @memberOf _ + * @since 3.8.0 + * @category Array + * @param {Array} array The array of grouped elements to process. + * @param {Function} [iteratee=_.identity] The function to combine + * regrouped values. + * @returns {Array} Returns the new array of regrouped elements. + * @example + * + * var zipped = _.zip([1, 2], [10, 20], [100, 200]); + * // => [[1, 10, 100], [2, 20, 200]] + * + * _.unzipWith(zipped, _.add); + * // => [3, 30, 300] + */ + function unzipWith(array, iteratee) { + if (!(array && array.length)) { + return []; + } + var result = unzip(array); + if (iteratee == null) { + return result; + } + return arrayMap(result, function(group) { + return apply(iteratee, undefined, group); + }); + } + + /** + * Creates an array excluding all given values using + * [`SameValueZero`](http://ecma-international.org/ecma-262/7.0/#sec-samevaluezero) + * for equality comparisons. + * + * **Note:** Unlike `_.pull`, this method returns a new array. + * + * @static + * @memberOf _ + * @since 0.1.0 + * @category Array + * @param {Array} array The array to inspect. + * @param {...*} [values] The values to exclude. + * @returns {Array} Returns the new array of filtered values. + * @see _.difference, _.xor + * @example + * + * _.without([2, 1, 2, 3], 1, 2); + * // => [3] + */ + var without = baseRest(function(array, values) { + return isArrayLikeObject(array) + ? baseDifference(array, values) + : []; + }); + + /** + * Creates an array of unique values that is the + * [symmetric difference](https://en.wikipedia.org/wiki/Symmetric_difference) + * of the given arrays. The order of result values is determined by the order + * they occur in the arrays. + * + * @static + * @memberOf _ + * @since 2.4.0 + * @category Array + * @param {...Array} [arrays] The arrays to inspect. + * @returns {Array} Returns the new array of filtered values. + * @see _.difference, _.without + * @example + * + * _.xor([2, 1], [2, 3]); + * // => [1, 3] + */ + var xor = baseRest(function(arrays) { + return baseXor(arrayFilter(arrays, isArrayLikeObject)); + }); + + /** + * This method is like `_.xor` except that it accepts `iteratee` which is + * invoked for each element of each `arrays` to generate the criterion by + * which by which they're compared. The order of result values is determined + * by the order they occur in the arrays. The iteratee is invoked with one + * argument: (value). + * + * @static + * @memberOf _ + * @since 4.0.0 + * @category Array + * @param {...Array} [arrays] The arrays to inspect. + * @param {Function} [iteratee=_.identity] The iteratee invoked per element. + * @returns {Array} Returns the new array of filtered values. + * @example + * + * _.xorBy([2.1, 1.2], [2.3, 3.4], Math.floor); + * // => [1.2, 3.4] + * + * // The `_.property` iteratee shorthand. + * _.xorBy([{ 'x': 1 }], [{ 'x': 2 }, { 'x': 1 }], 'x'); + * // => [{ 'x': 2 }] + */ + var xorBy = baseRest(function(arrays) { + var iteratee = last(arrays); + if (isArrayLikeObject(iteratee)) { + iteratee = undefined; + } + return baseXor(arrayFilter(arrays, isArrayLikeObject), getIteratee(iteratee, 2)); + }); + + /** + * This method is like `_.xor` except that it accepts `comparator` which is + * invoked to compare elements of `arrays`. The order of result values is + * determined by the order they occur in the arrays. The comparator is invoked + * with two arguments: (arrVal, othVal). + * + * @static + * @memberOf _ + * @since 4.0.0 + * @category Array + * @param {...Array} [arrays] The arrays to inspect. + * @param {Function} [comparator] The comparator invoked per element. + * @returns {Array} Returns the new array of filtered values. + * @example + * + * var objects = [{ 'x': 1, 'y': 2 }, { 'x': 2, 'y': 1 }]; + * var others = [{ 'x': 1, 'y': 1 }, { 'x': 1, 'y': 2 }]; + * + * _.xorWith(objects, others, _.isEqual); + * // => [{ 'x': 2, 'y': 1 }, { 'x': 1, 'y': 1 }] + */ + var xorWith = baseRest(function(arrays) { + var comparator = last(arrays); + comparator = typeof comparator == 'function' ? comparator : undefined; + return baseXor(arrayFilter(arrays, isArrayLikeObject), undefined, comparator); + }); + + /** + * Creates an array of grouped elements, the first of which contains the + * first elements of the given arrays, the second of which contains the + * second elements of the given arrays, and so on. + * + * @static + * @memberOf _ + * @since 0.1.0 + * @category Array + * @param {...Array} [arrays] The arrays to process. + * @returns {Array} Returns the new array of grouped elements. + * @example + * + * _.zip(['a', 'b'], [1, 2], [true, false]); + * // => [['a', 1, true], ['b', 2, false]] + */ + var zip = baseRest(unzip); + + /** + * This method is like `_.fromPairs` except that it accepts two arrays, + * one of property identifiers and one of corresponding values. + * + * @static + * @memberOf _ + * @since 0.4.0 + * @category Array + * @param {Array} [props=[]] The property identifiers. + * @param {Array} [values=[]] The property values. + * @returns {Object} Returns the new object. + * @example + * + * _.zipObject(['a', 'b'], [1, 2]); + * // => { 'a': 1, 'b': 2 } + */ + function zipObject(props, values) { + return baseZipObject(props || [], values || [], assignValue); + } + + /** + * This method is like `_.zipObject` except that it supports property paths. + * + * @static + * @memberOf _ + * @since 4.1.0 + * @category Array + * @param {Array} [props=[]] The property identifiers. + * @param {Array} [values=[]] The property values. + * @returns {Object} Returns the new object. + * @example + * + * _.zipObjectDeep(['a.b[0].c', 'a.b[1].d'], [1, 2]); + * // => { 'a': { 'b': [{ 'c': 1 }, { 'd': 2 }] } } + */ + function zipObjectDeep(props, values) { + return baseZipObject(props || [], values || [], baseSet); + } + + /** + * This method is like `_.zip` except that it accepts `iteratee` to specify + * how grouped values should be combined. The iteratee is invoked with the + * elements of each group: (...group). + * + * @static + * @memberOf _ + * @since 3.8.0 + * @category Array + * @param {...Array} [arrays] The arrays to process. + * @param {Function} [iteratee=_.identity] The function to combine + * grouped values. + * @returns {Array} Returns the new array of grouped elements. + * @example + * + * _.zipWith([1, 2], [10, 20], [100, 200], function(a, b, c) { + * return a + b + c; + * }); + * // => [111, 222] + */ + var zipWith = baseRest(function(arrays) { + var length = arrays.length, + iteratee = length > 1 ? arrays[length - 1] : undefined; + + iteratee = typeof iteratee == 'function' ? (arrays.pop(), iteratee) : undefined; + return unzipWith(arrays, iteratee); + }); + + /*------------------------------------------------------------------------*/ + + /** + * Creates a `lodash` wrapper instance that wraps `value` with explicit method + * chain sequences enabled. The result of such sequences must be unwrapped + * with `_#value`. + * + * @static + * @memberOf _ + * @since 1.3.0 + * @category Seq + * @param {*} value The value to wrap. + * @returns {Object} Returns the new `lodash` wrapper instance. + * @example + * + * var users = [ + * { 'user': 'barney', 'age': 36 }, + * { 'user': 'fred', 'age': 40 }, + * { 'user': 'pebbles', 'age': 1 } + * ]; + * + * var youngest = _ + * .chain(users) + * .sortBy('age') + * .map(function(o) { + * return o.user + ' is ' + o.age; + * }) + * .head() + * .value(); + * // => 'pebbles is 1' + */ + function chain(value) { + var result = lodash(value); + result.__chain__ = true; + return result; + } + + /** + * This method invokes `interceptor` and returns `value`. The interceptor + * is invoked with one argument; (value). The purpose of this method is to + * "tap into" a method chain sequence in order to modify intermediate results. + * + * @static + * @memberOf _ + * @since 0.1.0 + * @category Seq + * @param {*} value The value to provide to `interceptor`. + * @param {Function} interceptor The function to invoke. + * @returns {*} Returns `value`. + * @example + * + * _([1, 2, 3]) + * .tap(function(array) { + * // Mutate input array. + * array.pop(); + * }) + * .reverse() + * .value(); + * // => [2, 1] + */ + function tap(value, interceptor) { + interceptor(value); + return value; + } + + /** + * This method is like `_.tap` except that it returns the result of `interceptor`. + * The purpose of this method is to "pass thru" values replacing intermediate + * results in a method chain sequence. + * + * @static + * @memberOf _ + * @since 3.0.0 + * @category Seq + * @param {*} value The value to provide to `interceptor`. + * @param {Function} interceptor The function to invoke. + * @returns {*} Returns the result of `interceptor`. + * @example + * + * _(' abc ') + * .chain() + * .trim() + * .thru(function(value) { + * return [value]; + * }) + * .value(); + * // => ['abc'] + */ + function thru(value, interceptor) { + return interceptor(value); + } + + /** + * This method is the wrapper version of `_.at`. + * + * @name at + * @memberOf _ + * @since 1.0.0 + * @category Seq + * @param {...(string|string[])} [paths] The property paths to pick. + * @returns {Object} Returns the new `lodash` wrapper instance. + * @example + * + * var object = { 'a': [{ 'b': { 'c': 3 } }, 4] }; + * + * _(object).at(['a[0].b.c', 'a[1]']).value(); + * // => [3, 4] + */ + var wrapperAt = flatRest(function(paths) { + var length = paths.length, + start = length ? paths[0] : 0, + value = this.__wrapped__, + interceptor = function(object) { return baseAt(object, paths); }; + + if (length > 1 || this.__actions__.length || + !(value instanceof LazyWrapper) || !isIndex(start)) { + return this.thru(interceptor); + } + value = value.slice(start, +start + (length ? 1 : 0)); + value.__actions__.push({ + 'func': thru, + 'args': [interceptor], + 'thisArg': undefined + }); + return new LodashWrapper(value, this.__chain__).thru(function(array) { + if (length && !array.length) { + array.push(undefined); + } + return array; + }); + }); + + /** + * Creates a `lodash` wrapper instance with explicit method chain sequences enabled. + * + * @name chain + * @memberOf _ + * @since 0.1.0 + * @category Seq + * @returns {Object} Returns the new `lodash` wrapper instance. + * @example + * + * var users = [ + * { 'user': 'barney', 'age': 36 }, + * { 'user': 'fred', 'age': 40 } + * ]; + * + * // A sequence without explicit chaining. + * _(users).head(); + * // => { 'user': 'barney', 'age': 36 } + * + * // A sequence with explicit chaining. + * _(users) + * .chain() + * .head() + * .pick('user') + * .value(); + * // => { 'user': 'barney' } + */ + function wrapperChain() { + return chain(this); + } + + /** + * Executes the chain sequence and returns the wrapped result. + * + * @name commit + * @memberOf _ + * @since 3.2.0 + * @category Seq + * @returns {Object} Returns the new `lodash` wrapper instance. + * @example + * + * var array = [1, 2]; + * var wrapped = _(array).push(3); + * + * console.log(array); + * // => [1, 2] + * + * wrapped = wrapped.commit(); + * console.log(array); + * // => [1, 2, 3] + * + * wrapped.last(); + * // => 3 + * + * console.log(array); + * // => [1, 2, 3] + */ + function wrapperCommit() { + return new LodashWrapper(this.value(), this.__chain__); + } + + /** + * Gets the next value on a wrapped object following the + * [iterator protocol](https://mdn.io/iteration_protocols#iterator). + * + * @name next + * @memberOf _ + * @since 4.0.0 + * @category Seq + * @returns {Object} Returns the next iterator value. + * @example + * + * var wrapped = _([1, 2]); + * + * wrapped.next(); + * // => { 'done': false, 'value': 1 } + * + * wrapped.next(); + * // => { 'done': false, 'value': 2 } + * + * wrapped.next(); + * // => { 'done': true, 'value': undefined } + */ + function wrapperNext() { + if (this.__values__ === undefined) { + this.__values__ = toArray(this.value()); + } + var done = this.__index__ >= this.__values__.length, + value = done ? undefined : this.__values__[this.__index__++]; + + return { 'done': done, 'value': value }; + } + + /** + * Enables the wrapper to be iterable. + * + * @name Symbol.iterator + * @memberOf _ + * @since 4.0.0 + * @category Seq + * @returns {Object} Returns the wrapper object. + * @example + * + * var wrapped = _([1, 2]); + * + * wrapped[Symbol.iterator]() === wrapped; + * // => true + * + * Array.from(wrapped); + * // => [1, 2] + */ + function wrapperToIterator() { + return this; + } + + /** + * Creates a clone of the chain sequence planting `value` as the wrapped value. + * + * @name plant + * @memberOf _ + * @since 3.2.0 + * @category Seq + * @param {*} value The value to plant. + * @returns {Object} Returns the new `lodash` wrapper instance. + * @example + * + * function square(n) { + * return n * n; + * } + * + * var wrapped = _([1, 2]).map(square); + * var other = wrapped.plant([3, 4]); + * + * other.value(); + * // => [9, 16] + * + * wrapped.value(); + * // => [1, 4] + */ + function wrapperPlant(value) { + var result, + parent = this; + + while (parent instanceof baseLodash) { + var clone = wrapperClone(parent); + clone.__index__ = 0; + clone.__values__ = undefined; + if (result) { + previous.__wrapped__ = clone; + } else { + result = clone; + } + var previous = clone; + parent = parent.__wrapped__; + } + previous.__wrapped__ = value; + return result; + } + + /** + * This method is the wrapper version of `_.reverse`. + * + * **Note:** This method mutates the wrapped array. + * + * @name reverse + * @memberOf _ + * @since 0.1.0 + * @category Seq + * @returns {Object} Returns the new `lodash` wrapper instance. + * @example + * + * var array = [1, 2, 3]; + * + * _(array).reverse().value() + * // => [3, 2, 1] + * + * console.log(array); + * // => [3, 2, 1] + */ + function wrapperReverse() { + var value = this.__wrapped__; + if (value instanceof LazyWrapper) { + var wrapped = value; + if (this.__actions__.length) { + wrapped = new LazyWrapper(this); + } + wrapped = wrapped.reverse(); + wrapped.__actions__.push({ + 'func': thru, + 'args': [reverse], + 'thisArg': undefined + }); + return new LodashWrapper(wrapped, this.__chain__); + } + return this.thru(reverse); + } + + /** + * Executes the chain sequence to resolve the unwrapped value. + * + * @name value + * @memberOf _ + * @since 0.1.0 + * @alias toJSON, valueOf + * @category Seq + * @returns {*} Returns the resolved unwrapped value. + * @example + * + * _([1, 2, 3]).value(); + * // => [1, 2, 3] + */ + function wrapperValue() { + return baseWrapperValue(this.__wrapped__, this.__actions__); + } + + /*------------------------------------------------------------------------*/ + + /** + * Creates an object composed of keys generated from the results of running + * each element of `collection` thru `iteratee`. The corresponding value of + * each key is the number of times the key was returned by `iteratee`. The + * iteratee is invoked with one argument: (value). + * + * @static + * @memberOf _ + * @since 0.5.0 + * @category Collection + * @param {Array|Object} collection The collection to iterate over. + * @param {Function} [iteratee=_.identity] The iteratee to transform keys. + * @returns {Object} Returns the composed aggregate object. + * @example + * + * _.countBy([6.1, 4.2, 6.3], Math.floor); + * // => { '4': 1, '6': 2 } + * + * // The `_.property` iteratee shorthand. + * _.countBy(['one', 'two', 'three'], 'length'); + * // => { '3': 2, '5': 1 } + */ + var countBy = createAggregator(function(result, value, key) { + if (hasOwnProperty.call(result, key)) { + ++result[key]; + } else { + baseAssignValue(result, key, 1); + } + }); + + /** + * Checks if `predicate` returns truthy for **all** elements of `collection`. + * Iteration is stopped once `predicate` returns falsey. The predicate is + * invoked with three arguments: (value, index|key, collection). + * + * **Note:** This method returns `true` for + * [empty collections](https://en.wikipedia.org/wiki/Empty_set) because + * [everything is true](https://en.wikipedia.org/wiki/Vacuous_truth) of + * elements of empty collections. + * + * @static + * @memberOf _ + * @since 0.1.0 + * @category Collection + * @param {Array|Object} collection The collection to iterate over. + * @param {Function} [predicate=_.identity] The function invoked per iteration. + * @param- {Object} [guard] Enables use as an iteratee for methods like `_.map`. + * @returns {boolean} Returns `true` if all elements pass the predicate check, + * else `false`. + * @example + * + * _.every([true, 1, null, 'yes'], Boolean); + * // => false + * + * var users = [ + * { 'user': 'barney', 'age': 36, 'active': false }, + * { 'user': 'fred', 'age': 40, 'active': false } + * ]; + * + * // The `_.matches` iteratee shorthand. + * _.every(users, { 'user': 'barney', 'active': false }); + * // => false + * + * // The `_.matchesProperty` iteratee shorthand. + * _.every(users, ['active', false]); + * // => true + * + * // The `_.property` iteratee shorthand. + * _.every(users, 'active'); + * // => false + */ + function every(collection, predicate, guard) { + var func = isArray(collection) ? arrayEvery : baseEvery; + if (guard && isIterateeCall(collection, predicate, guard)) { + predicate = undefined; + } + return func(collection, getIteratee(predicate, 3)); + } + + /** + * Iterates over elements of `collection`, returning an array of all elements + * `predicate` returns truthy for. The predicate is invoked with three + * arguments: (value, index|key, collection). + * + * **Note:** Unlike `_.remove`, this method returns a new array. + * + * @static + * @memberOf _ + * @since 0.1.0 + * @category Collection + * @param {Array|Object} collection The collection to iterate over. + * @param {Function} [predicate=_.identity] The function invoked per iteration. + * @returns {Array} Returns the new filtered array. + * @see _.reject + * @example + * + * var users = [ + * { 'user': 'barney', 'age': 36, 'active': true }, + * { 'user': 'fred', 'age': 40, 'active': false } + * ]; + * + * _.filter(users, function(o) { return !o.active; }); + * // => objects for ['fred'] + * + * // The `_.matches` iteratee shorthand. + * _.filter(users, { 'age': 36, 'active': true }); + * // => objects for ['barney'] + * + * // The `_.matchesProperty` iteratee shorthand. + * _.filter(users, ['active', false]); + * // => objects for ['fred'] + * + * // The `_.property` iteratee shorthand. + * _.filter(users, 'active'); + * // => objects for ['barney'] + * + * // Combining several predicates using `_.overEvery` or `_.overSome`. + * _.filter(users, _.overSome([{ 'age': 36 }, ['age', 40]])); + * // => objects for ['fred', 'barney'] + */ + function filter(collection, predicate) { + var func = isArray(collection) ? arrayFilter : baseFilter; + return func(collection, getIteratee(predicate, 3)); + } + + /** + * Iterates over elements of `collection`, returning the first element + * `predicate` returns truthy for. The predicate is invoked with three + * arguments: (value, index|key, collection). + * + * @static + * @memberOf _ + * @since 0.1.0 + * @category Collection + * @param {Array|Object} collection The collection to inspect. + * @param {Function} [predicate=_.identity] The function invoked per iteration. + * @param {number} [fromIndex=0] The index to search from. + * @returns {*} Returns the matched element, else `undefined`. + * @example + * + * var users = [ + * { 'user': 'barney', 'age': 36, 'active': true }, + * { 'user': 'fred', 'age': 40, 'active': false }, + * { 'user': 'pebbles', 'age': 1, 'active': true } + * ]; + * + * _.find(users, function(o) { return o.age < 40; }); + * // => object for 'barney' + * + * // The `_.matches` iteratee shorthand. + * _.find(users, { 'age': 1, 'active': true }); + * // => object for 'pebbles' + * + * // The `_.matchesProperty` iteratee shorthand. + * _.find(users, ['active', false]); + * // => object for 'fred' + * + * // The `_.property` iteratee shorthand. + * _.find(users, 'active'); + * // => object for 'barney' + */ + var find = createFind(findIndex); + + /** + * This method is like `_.find` except that it iterates over elements of + * `collection` from right to left. + * + * @static + * @memberOf _ + * @since 2.0.0 + * @category Collection + * @param {Array|Object} collection The collection to inspect. + * @param {Function} [predicate=_.identity] The function invoked per iteration. + * @param {number} [fromIndex=collection.length-1] The index to search from. + * @returns {*} Returns the matched element, else `undefined`. + * @example + * + * _.findLast([1, 2, 3, 4], function(n) { + * return n % 2 == 1; + * }); + * // => 3 + */ + var findLast = createFind(findLastIndex); + + /** + * Creates a flattened array of values by running each element in `collection` + * thru `iteratee` and flattening the mapped results. The iteratee is invoked + * with three arguments: (value, index|key, collection). + * + * @static + * @memberOf _ + * @since 4.0.0 + * @category Collection + * @param {Array|Object} collection The collection to iterate over. + * @param {Function} [iteratee=_.identity] The function invoked per iteration. + * @returns {Array} Returns the new flattened array. + * @example + * + * function duplicate(n) { + * return [n, n]; + * } + * + * _.flatMap([1, 2], duplicate); + * // => [1, 1, 2, 2] + */ + function flatMap(collection, iteratee) { + return baseFlatten(map(collection, iteratee), 1); + } + + /** + * This method is like `_.flatMap` except that it recursively flattens the + * mapped results. + * + * @static + * @memberOf _ + * @since 4.7.0 + * @category Collection + * @param {Array|Object} collection The collection to iterate over. + * @param {Function} [iteratee=_.identity] The function invoked per iteration. + * @returns {Array} Returns the new flattened array. + * @example + * + * function duplicate(n) { + * return [[[n, n]]]; + * } + * + * _.flatMapDeep([1, 2], duplicate); + * // => [1, 1, 2, 2] + */ + function flatMapDeep(collection, iteratee) { + return baseFlatten(map(collection, iteratee), INFINITY); + } + + /** + * This method is like `_.flatMap` except that it recursively flattens the + * mapped results up to `depth` times. + * + * @static + * @memberOf _ + * @since 4.7.0 + * @category Collection + * @param {Array|Object} collection The collection to iterate over. + * @param {Function} [iteratee=_.identity] The function invoked per iteration. + * @param {number} [depth=1] The maximum recursion depth. + * @returns {Array} Returns the new flattened array. + * @example + * + * function duplicate(n) { + * return [[[n, n]]]; + * } + * + * _.flatMapDepth([1, 2], duplicate, 2); + * // => [[1, 1], [2, 2]] + */ + function flatMapDepth(collection, iteratee, depth) { + depth = depth === undefined ? 1 : toInteger(depth); + return baseFlatten(map(collection, iteratee), depth); + } + + /** + * Iterates over elements of `collection` and invokes `iteratee` for each element. + * The iteratee is invoked with three arguments: (value, index|key, collection). + * Iteratee functions may exit iteration early by explicitly returning `false`. + * + * **Note:** As with other "Collections" methods, objects with a "length" + * property are iterated like arrays. To avoid this behavior use `_.forIn` + * or `_.forOwn` for object iteration. + * + * @static + * @memberOf _ + * @since 0.1.0 + * @alias each + * @category Collection + * @param {Array|Object} collection The collection to iterate over. + * @param {Function} [iteratee=_.identity] The function invoked per iteration. + * @returns {Array|Object} Returns `collection`. + * @see _.forEachRight + * @example + * + * _.forEach([1, 2], function(value) { + * console.log(value); + * }); + * // => Logs `1` then `2`. + * + * _.forEach({ 'a': 1, 'b': 2 }, function(value, key) { + * console.log(key); + * }); + * // => Logs 'a' then 'b' (iteration order is not guaranteed). + */ + function forEach(collection, iteratee) { + var func = isArray(collection) ? arrayEach : baseEach; + return func(collection, getIteratee(iteratee, 3)); + } + + /** + * This method is like `_.forEach` except that it iterates over elements of + * `collection` from right to left. + * + * @static + * @memberOf _ + * @since 2.0.0 + * @alias eachRight + * @category Collection + * @param {Array|Object} collection The collection to iterate over. + * @param {Function} [iteratee=_.identity] The function invoked per iteration. + * @returns {Array|Object} Returns `collection`. + * @see _.forEach + * @example + * + * _.forEachRight([1, 2], function(value) { + * console.log(value); + * }); + * // => Logs `2` then `1`. + */ + function forEachRight(collection, iteratee) { + var func = isArray(collection) ? arrayEachRight : baseEachRight; + return func(collection, getIteratee(iteratee, 3)); + } + + /** + * Creates an object composed of keys generated from the results of running + * each element of `collection` thru `iteratee`. The order of grouped values + * is determined by the order they occur in `collection`. The corresponding + * value of each key is an array of elements responsible for generating the + * key. The iteratee is invoked with one argument: (value). + * + * @static + * @memberOf _ + * @since 0.1.0 + * @category Collection + * @param {Array|Object} collection The collection to iterate over. + * @param {Function} [iteratee=_.identity] The iteratee to transform keys. + * @returns {Object} Returns the composed aggregate object. + * @example + * + * _.groupBy([6.1, 4.2, 6.3], Math.floor); + * // => { '4': [4.2], '6': [6.1, 6.3] } + * + * // The `_.property` iteratee shorthand. + * _.groupBy(['one', 'two', 'three'], 'length'); + * // => { '3': ['one', 'two'], '5': ['three'] } + */ + var groupBy = createAggregator(function(result, value, key) { + if (hasOwnProperty.call(result, key)) { + result[key].push(value); + } else { + baseAssignValue(result, key, [value]); + } + }); + + /** + * Checks if `value` is in `collection`. If `collection` is a string, it's + * checked for a substring of `value`, otherwise + * [`SameValueZero`](http://ecma-international.org/ecma-262/7.0/#sec-samevaluezero) + * is used for equality comparisons. If `fromIndex` is negative, it's used as + * the offset from the end of `collection`. + * + * @static + * @memberOf _ + * @since 0.1.0 + * @category Collection + * @param {Array|Object|string} collection The collection to inspect. + * @param {*} value The value to search for. + * @param {number} [fromIndex=0] The index to search from. + * @param- {Object} [guard] Enables use as an iteratee for methods like `_.reduce`. + * @returns {boolean} Returns `true` if `value` is found, else `false`. + * @example + * + * _.includes([1, 2, 3], 1); + * // => true + * + * _.includes([1, 2, 3], 1, 2); + * // => false + * + * _.includes({ 'a': 1, 'b': 2 }, 1); + * // => true + * + * _.includes('abcd', 'bc'); + * // => true + */ + function includes(collection, value, fromIndex, guard) { + collection = isArrayLike(collection) ? collection : values(collection); + fromIndex = (fromIndex && !guard) ? toInteger(fromIndex) : 0; + + var length = collection.length; + if (fromIndex < 0) { + fromIndex = nativeMax(length + fromIndex, 0); + } + return isString(collection) + ? (fromIndex <= length && collection.indexOf(value, fromIndex) > -1) + : (!!length && baseIndexOf(collection, value, fromIndex) > -1); + } + + /** + * Invokes the method at `path` of each element in `collection`, returning + * an array of the results of each invoked method. Any additional arguments + * are provided to each invoked method. If `path` is a function, it's invoked + * for, and `this` bound to, each element in `collection`. + * + * @static + * @memberOf _ + * @since 4.0.0 + * @category Collection + * @param {Array|Object} collection The collection to iterate over. + * @param {Array|Function|string} path The path of the method to invoke or + * the function invoked per iteration. + * @param {...*} [args] The arguments to invoke each method with. + * @returns {Array} Returns the array of results. + * @example + * + * _.invokeMap([[5, 1, 7], [3, 2, 1]], 'sort'); + * // => [[1, 5, 7], [1, 2, 3]] + * + * _.invokeMap([123, 456], String.prototype.split, ''); + * // => [['1', '2', '3'], ['4', '5', '6']] + */ + var invokeMap = baseRest(function(collection, path, args) { + var index = -1, + isFunc = typeof path == 'function', + result = isArrayLike(collection) ? Array(collection.length) : []; + + baseEach(collection, function(value) { + result[++index] = isFunc ? apply(path, value, args) : baseInvoke(value, path, args); + }); + return result; + }); + + /** + * Creates an object composed of keys generated from the results of running + * each element of `collection` thru `iteratee`. The corresponding value of + * each key is the last element responsible for generating the key. The + * iteratee is invoked with one argument: (value). + * + * @static + * @memberOf _ + * @since 4.0.0 + * @category Collection + * @param {Array|Object} collection The collection to iterate over. + * @param {Function} [iteratee=_.identity] The iteratee to transform keys. + * @returns {Object} Returns the composed aggregate object. + * @example + * + * var array = [ + * { 'dir': 'left', 'code': 97 }, + * { 'dir': 'right', 'code': 100 } + * ]; + * + * _.keyBy(array, function(o) { + * return String.fromCharCode(o.code); + * }); + * // => { 'a': { 'dir': 'left', 'code': 97 }, 'd': { 'dir': 'right', 'code': 100 } } + * + * _.keyBy(array, 'dir'); + * // => { 'left': { 'dir': 'left', 'code': 97 }, 'right': { 'dir': 'right', 'code': 100 } } + */ + var keyBy = createAggregator(function(result, value, key) { + baseAssignValue(result, key, value); + }); + + /** + * Creates an array of values by running each element in `collection` thru + * `iteratee`. The iteratee is invoked with three arguments: + * (value, index|key, collection). + * + * Many lodash methods are guarded to work as iteratees for methods like + * `_.every`, `_.filter`, `_.map`, `_.mapValues`, `_.reject`, and `_.some`. + * + * The guarded methods are: + * `ary`, `chunk`, `curry`, `curryRight`, `drop`, `dropRight`, `every`, + * `fill`, `invert`, `parseInt`, `random`, `range`, `rangeRight`, `repeat`, + * `sampleSize`, `slice`, `some`, `sortBy`, `split`, `take`, `takeRight`, + * `template`, `trim`, `trimEnd`, `trimStart`, and `words` + * + * @static + * @memberOf _ + * @since 0.1.0 + * @category Collection + * @param {Array|Object} collection The collection to iterate over. + * @param {Function} [iteratee=_.identity] The function invoked per iteration. + * @returns {Array} Returns the new mapped array. + * @example + * + * function square(n) { + * return n * n; + * } + * + * _.map([4, 8], square); + * // => [16, 64] + * + * _.map({ 'a': 4, 'b': 8 }, square); + * // => [16, 64] (iteration order is not guaranteed) + * + * var users = [ + * { 'user': 'barney' }, + * { 'user': 'fred' } + * ]; + * + * // The `_.property` iteratee shorthand. + * _.map(users, 'user'); + * // => ['barney', 'fred'] + */ + function map(collection, iteratee) { + var func = isArray(collection) ? arrayMap : baseMap; + return func(collection, getIteratee(iteratee, 3)); + } + + /** + * This method is like `_.sortBy` except that it allows specifying the sort + * orders of the iteratees to sort by. If `orders` is unspecified, all values + * are sorted in ascending order. Otherwise, specify an order of "desc" for + * descending or "asc" for ascending sort order of corresponding values. + * + * @static + * @memberOf _ + * @since 4.0.0 + * @category Collection + * @param {Array|Object} collection The collection to iterate over. + * @param {Array[]|Function[]|Object[]|string[]} [iteratees=[_.identity]] + * The iteratees to sort by. + * @param {string[]} [orders] The sort orders of `iteratees`. + * @param- {Object} [guard] Enables use as an iteratee for methods like `_.reduce`. + * @returns {Array} Returns the new sorted array. + * @example + * + * var users = [ + * { 'user': 'fred', 'age': 48 }, + * { 'user': 'barney', 'age': 34 }, + * { 'user': 'fred', 'age': 40 }, + * { 'user': 'barney', 'age': 36 } + * ]; + * + * // Sort by `user` in ascending order and by `age` in descending order. + * _.orderBy(users, ['user', 'age'], ['asc', 'desc']); + * // => objects for [['barney', 36], ['barney', 34], ['fred', 48], ['fred', 40]] + */ + function orderBy(collection, iteratees, orders, guard) { + if (collection == null) { + return []; + } + if (!isArray(iteratees)) { + iteratees = iteratees == null ? [] : [iteratees]; + } + orders = guard ? undefined : orders; + if (!isArray(orders)) { + orders = orders == null ? [] : [orders]; + } + return baseOrderBy(collection, iteratees, orders); + } + + /** + * Creates an array of elements split into two groups, the first of which + * contains elements `predicate` returns truthy for, the second of which + * contains elements `predicate` returns falsey for. The predicate is + * invoked with one argument: (value). + * + * @static + * @memberOf _ + * @since 3.0.0 + * @category Collection + * @param {Array|Object} collection The collection to iterate over. + * @param {Function} [predicate=_.identity] The function invoked per iteration. + * @returns {Array} Returns the array of grouped elements. + * @example + * + * var users = [ + * { 'user': 'barney', 'age': 36, 'active': false }, + * { 'user': 'fred', 'age': 40, 'active': true }, + * { 'user': 'pebbles', 'age': 1, 'active': false } + * ]; + * + * _.partition(users, function(o) { return o.active; }); + * // => objects for [['fred'], ['barney', 'pebbles']] + * + * // The `_.matches` iteratee shorthand. + * _.partition(users, { 'age': 1, 'active': false }); + * // => objects for [['pebbles'], ['barney', 'fred']] + * + * // The `_.matchesProperty` iteratee shorthand. + * _.partition(users, ['active', false]); + * // => objects for [['barney', 'pebbles'], ['fred']] + * + * // The `_.property` iteratee shorthand. + * _.partition(users, 'active'); + * // => objects for [['fred'], ['barney', 'pebbles']] + */ + var partition = createAggregator(function(result, value, key) { + result[key ? 0 : 1].push(value); + }, function() { return [[], []]; }); + + /** + * Reduces `collection` to a value which is the accumulated result of running + * each element in `collection` thru `iteratee`, where each successive + * invocation is supplied the return value of the previous. If `accumulator` + * is not given, the first element of `collection` is used as the initial + * value. The iteratee is invoked with four arguments: + * (accumulator, value, index|key, collection). + * + * Many lodash methods are guarded to work as iteratees for methods like + * `_.reduce`, `_.reduceRight`, and `_.transform`. + * + * The guarded methods are: + * `assign`, `defaults`, `defaultsDeep`, `includes`, `merge`, `orderBy`, + * and `sortBy` + * + * @static + * @memberOf _ + * @since 0.1.0 + * @category Collection + * @param {Array|Object} collection The collection to iterate over. + * @param {Function} [iteratee=_.identity] The function invoked per iteration. + * @param {*} [accumulator] The initial value. + * @returns {*} Returns the accumulated value. + * @see _.reduceRight + * @example + * + * _.reduce([1, 2], function(sum, n) { + * return sum + n; + * }, 0); + * // => 3 + * + * _.reduce({ 'a': 1, 'b': 2, 'c': 1 }, function(result, value, key) { + * (result[value] || (result[value] = [])).push(key); + * return result; + * }, {}); + * // => { '1': ['a', 'c'], '2': ['b'] } (iteration order is not guaranteed) + */ + function reduce(collection, iteratee, accumulator) { + var func = isArray(collection) ? arrayReduce : baseReduce, + initAccum = arguments.length < 3; + + return func(collection, getIteratee(iteratee, 4), accumulator, initAccum, baseEach); + } + + /** + * This method is like `_.reduce` except that it iterates over elements of + * `collection` from right to left. + * + * @static + * @memberOf _ + * @since 0.1.0 + * @category Collection + * @param {Array|Object} collection The collection to iterate over. + * @param {Function} [iteratee=_.identity] The function invoked per iteration. + * @param {*} [accumulator] The initial value. + * @returns {*} Returns the accumulated value. + * @see _.reduce + * @example + * + * var array = [[0, 1], [2, 3], [4, 5]]; + * + * _.reduceRight(array, function(flattened, other) { + * return flattened.concat(other); + * }, []); + * // => [4, 5, 2, 3, 0, 1] + */ + function reduceRight(collection, iteratee, accumulator) { + var func = isArray(collection) ? arrayReduceRight : baseReduce, + initAccum = arguments.length < 3; + + return func(collection, getIteratee(iteratee, 4), accumulator, initAccum, baseEachRight); + } + + /** + * The opposite of `_.filter`; this method returns the elements of `collection` + * that `predicate` does **not** return truthy for. + * + * @static + * @memberOf _ + * @since 0.1.0 + * @category Collection + * @param {Array|Object} collection The collection to iterate over. + * @param {Function} [predicate=_.identity] The function invoked per iteration. + * @returns {Array} Returns the new filtered array. + * @see _.filter + * @example + * + * var users = [ + * { 'user': 'barney', 'age': 36, 'active': false }, + * { 'user': 'fred', 'age': 40, 'active': true } + * ]; + * + * _.reject(users, function(o) { return !o.active; }); + * // => objects for ['fred'] + * + * // The `_.matches` iteratee shorthand. + * _.reject(users, { 'age': 40, 'active': true }); + * // => objects for ['barney'] + * + * // The `_.matchesProperty` iteratee shorthand. + * _.reject(users, ['active', false]); + * // => objects for ['fred'] + * + * // The `_.property` iteratee shorthand. + * _.reject(users, 'active'); + * // => objects for ['barney'] + */ + function reject(collection, predicate) { + var func = isArray(collection) ? arrayFilter : baseFilter; + return func(collection, negate(getIteratee(predicate, 3))); + } + + /** + * Gets a random element from `collection`. + * + * @static + * @memberOf _ + * @since 2.0.0 + * @category Collection + * @param {Array|Object} collection The collection to sample. + * @returns {*} Returns the random element. + * @example + * + * _.sample([1, 2, 3, 4]); + * // => 2 + */ + function sample(collection) { + var func = isArray(collection) ? arraySample : baseSample; + return func(collection); + } + + /** + * Gets `n` random elements at unique keys from `collection` up to the + * size of `collection`. + * + * @static + * @memberOf _ + * @since 4.0.0 + * @category Collection + * @param {Array|Object} collection The collection to sample. + * @param {number} [n=1] The number of elements to sample. + * @param- {Object} [guard] Enables use as an iteratee for methods like `_.map`. + * @returns {Array} Returns the random elements. + * @example + * + * _.sampleSize([1, 2, 3], 2); + * // => [3, 1] + * + * _.sampleSize([1, 2, 3], 4); + * // => [2, 3, 1] + */ + function sampleSize(collection, n, guard) { + if ((guard ? isIterateeCall(collection, n, guard) : n === undefined)) { + n = 1; + } else { + n = toInteger(n); + } + var func = isArray(collection) ? arraySampleSize : baseSampleSize; + return func(collection, n); + } + + /** + * Creates an array of shuffled values, using a version of the + * [Fisher-Yates shuffle](https://en.wikipedia.org/wiki/Fisher-Yates_shuffle). + * + * @static + * @memberOf _ + * @since 0.1.0 + * @category Collection + * @param {Array|Object} collection The collection to shuffle. + * @returns {Array} Returns the new shuffled array. + * @example + * + * _.shuffle([1, 2, 3, 4]); + * // => [4, 1, 3, 2] + */ + function shuffle(collection) { + var func = isArray(collection) ? arrayShuffle : baseShuffle; + return func(collection); + } + + /** + * Gets the size of `collection` by returning its length for array-like + * values or the number of own enumerable string keyed properties for objects. + * + * @static + * @memberOf _ + * @since 0.1.0 + * @category Collection + * @param {Array|Object|string} collection The collection to inspect. + * @returns {number} Returns the collection size. + * @example + * + * _.size([1, 2, 3]); + * // => 3 + * + * _.size({ 'a': 1, 'b': 2 }); + * // => 2 + * + * _.size('pebbles'); + * // => 7 + */ + function size(collection) { + if (collection == null) { + return 0; + } + if (isArrayLike(collection)) { + return isString(collection) ? stringSize(collection) : collection.length; + } + var tag = getTag(collection); + if (tag == mapTag || tag == setTag) { + return collection.size; + } + return baseKeys(collection).length; + } + + /** + * Checks if `predicate` returns truthy for **any** element of `collection`. + * Iteration is stopped once `predicate` returns truthy. The predicate is + * invoked with three arguments: (value, index|key, collection). + * + * @static + * @memberOf _ + * @since 0.1.0 + * @category Collection + * @param {Array|Object} collection The collection to iterate over. + * @param {Function} [predicate=_.identity] The function invoked per iteration. + * @param- {Object} [guard] Enables use as an iteratee for methods like `_.map`. + * @returns {boolean} Returns `true` if any element passes the predicate check, + * else `false`. + * @example + * + * _.some([null, 0, 'yes', false], Boolean); + * // => true + * + * var users = [ + * { 'user': 'barney', 'active': true }, + * { 'user': 'fred', 'active': false } + * ]; + * + * // The `_.matches` iteratee shorthand. + * _.some(users, { 'user': 'barney', 'active': false }); + * // => false + * + * // The `_.matchesProperty` iteratee shorthand. + * _.some(users, ['active', false]); + * // => true + * + * // The `_.property` iteratee shorthand. + * _.some(users, 'active'); + * // => true + */ + function some(collection, predicate, guard) { + var func = isArray(collection) ? arraySome : baseSome; + if (guard && isIterateeCall(collection, predicate, guard)) { + predicate = undefined; + } + return func(collection, getIteratee(predicate, 3)); + } + + /** + * Creates an array of elements, sorted in ascending order by the results of + * running each element in a collection thru each iteratee. This method + * performs a stable sort, that is, it preserves the original sort order of + * equal elements. The iteratees are invoked with one argument: (value). + * + * @static + * @memberOf _ + * @since 0.1.0 + * @category Collection + * @param {Array|Object} collection The collection to iterate over. + * @param {...(Function|Function[])} [iteratees=[_.identity]] + * The iteratees to sort by. + * @returns {Array} Returns the new sorted array. + * @example + * + * var users = [ + * { 'user': 'fred', 'age': 48 }, + * { 'user': 'barney', 'age': 36 }, + * { 'user': 'fred', 'age': 30 }, + * { 'user': 'barney', 'age': 34 } + * ]; + * + * _.sortBy(users, [function(o) { return o.user; }]); + * // => objects for [['barney', 36], ['barney', 34], ['fred', 48], ['fred', 30]] + * + * _.sortBy(users, ['user', 'age']); + * // => objects for [['barney', 34], ['barney', 36], ['fred', 30], ['fred', 48]] + */ + var sortBy = baseRest(function(collection, iteratees) { + if (collection == null) { + return []; + } + var length = iteratees.length; + if (length > 1 && isIterateeCall(collection, iteratees[0], iteratees[1])) { + iteratees = []; + } else if (length > 2 && isIterateeCall(iteratees[0], iteratees[1], iteratees[2])) { + iteratees = [iteratees[0]]; + } + return baseOrderBy(collection, baseFlatten(iteratees, 1), []); + }); + + /*------------------------------------------------------------------------*/ + + /** + * Gets the timestamp of the number of milliseconds that have elapsed since + * the Unix epoch (1 January 1970 00:00:00 UTC). + * + * @static + * @memberOf _ + * @since 2.4.0 + * @category Date + * @returns {number} Returns the timestamp. + * @example + * + * _.defer(function(stamp) { + * console.log(_.now() - stamp); + * }, _.now()); + * // => Logs the number of milliseconds it took for the deferred invocation. + */ + var now = ctxNow || function() { + return root.Date.now(); + }; + + /*------------------------------------------------------------------------*/ + + /** + * The opposite of `_.before`; this method creates a function that invokes + * `func` once it's called `n` or more times. + * + * @static + * @memberOf _ + * @since 0.1.0 + * @category Function + * @param {number} n The number of calls before `func` is invoked. + * @param {Function} func The function to restrict. + * @returns {Function} Returns the new restricted function. + * @example + * + * var saves = ['profile', 'settings']; + * + * var done = _.after(saves.length, function() { + * console.log('done saving!'); + * }); + * + * _.forEach(saves, function(type) { + * asyncSave({ 'type': type, 'complete': done }); + * }); + * // => Logs 'done saving!' after the two async saves have completed. + */ + function after(n, func) { + if (typeof func != 'function') { + throw new TypeError(FUNC_ERROR_TEXT); + } + n = toInteger(n); + return function() { + if (--n < 1) { + return func.apply(this, arguments); + } + }; + } + + /** + * Creates a function that invokes `func`, with up to `n` arguments, + * ignoring any additional arguments. + * + * @static + * @memberOf _ + * @since 3.0.0 + * @category Function + * @param {Function} func The function to cap arguments for. + * @param {number} [n=func.length] The arity cap. + * @param- {Object} [guard] Enables use as an iteratee for methods like `_.map`. + * @returns {Function} Returns the new capped function. + * @example + * + * _.map(['6', '8', '10'], _.ary(parseInt, 1)); + * // => [6, 8, 10] + */ + function ary(func, n, guard) { + n = guard ? undefined : n; + n = (func && n == null) ? func.length : n; + return createWrap(func, WRAP_ARY_FLAG, undefined, undefined, undefined, undefined, n); + } + + /** + * Creates a function that invokes `func`, with the `this` binding and arguments + * of the created function, while it's called less than `n` times. Subsequent + * calls to the created function return the result of the last `func` invocation. + * + * @static + * @memberOf _ + * @since 3.0.0 + * @category Function + * @param {number} n The number of calls at which `func` is no longer invoked. + * @param {Function} func The function to restrict. + * @returns {Function} Returns the new restricted function. + * @example + * + * jQuery(element).on('click', _.before(5, addContactToList)); + * // => Allows adding up to 4 contacts to the list. + */ + function before(n, func) { + var result; + if (typeof func != 'function') { + throw new TypeError(FUNC_ERROR_TEXT); + } + n = toInteger(n); + return function() { + if (--n > 0) { + result = func.apply(this, arguments); + } + if (n <= 1) { + func = undefined; + } + return result; + }; + } + + /** + * Creates a function that invokes `func` with the `this` binding of `thisArg` + * and `partials` prepended to the arguments it receives. + * + * The `_.bind.placeholder` value, which defaults to `_` in monolithic builds, + * may be used as a placeholder for partially applied arguments. + * + * **Note:** Unlike native `Function#bind`, this method doesn't set the "length" + * property of bound functions. + * + * @static + * @memberOf _ + * @since 0.1.0 + * @category Function + * @param {Function} func The function to bind. + * @param {*} thisArg The `this` binding of `func`. + * @param {...*} [partials] The arguments to be partially applied. + * @returns {Function} Returns the new bound function. + * @example + * + * function greet(greeting, punctuation) { + * return greeting + ' ' + this.user + punctuation; + * } + * + * var object = { 'user': 'fred' }; + * + * var bound = _.bind(greet, object, 'hi'); + * bound('!'); + * // => 'hi fred!' + * + * // Bound with placeholders. + * var bound = _.bind(greet, object, _, '!'); + * bound('hi'); + * // => 'hi fred!' + */ + var bind = baseRest(function(func, thisArg, partials) { + var bitmask = WRAP_BIND_FLAG; + if (partials.length) { + var holders = replaceHolders(partials, getHolder(bind)); + bitmask |= WRAP_PARTIAL_FLAG; + } + return createWrap(func, bitmask, thisArg, partials, holders); + }); + + /** + * Creates a function that invokes the method at `object[key]` with `partials` + * prepended to the arguments it receives. + * + * This method differs from `_.bind` by allowing bound functions to reference + * methods that may be redefined or don't yet exist. See + * [Peter Michaux's article](http://peter.michaux.ca/articles/lazy-function-definition-pattern) + * for more details. + * + * The `_.bindKey.placeholder` value, which defaults to `_` in monolithic + * builds, may be used as a placeholder for partially applied arguments. + * + * @static + * @memberOf _ + * @since 0.10.0 + * @category Function + * @param {Object} object The object to invoke the method on. + * @param {string} key The key of the method. + * @param {...*} [partials] The arguments to be partially applied. + * @returns {Function} Returns the new bound function. + * @example + * + * var object = { + * 'user': 'fred', + * 'greet': function(greeting, punctuation) { + * return greeting + ' ' + this.user + punctuation; + * } + * }; + * + * var bound = _.bindKey(object, 'greet', 'hi'); + * bound('!'); + * // => 'hi fred!' + * + * object.greet = function(greeting, punctuation) { + * return greeting + 'ya ' + this.user + punctuation; + * }; + * + * bound('!'); + * // => 'hiya fred!' + * + * // Bound with placeholders. + * var bound = _.bindKey(object, 'greet', _, '!'); + * bound('hi'); + * // => 'hiya fred!' + */ + var bindKey = baseRest(function(object, key, partials) { + var bitmask = WRAP_BIND_FLAG | WRAP_BIND_KEY_FLAG; + if (partials.length) { + var holders = replaceHolders(partials, getHolder(bindKey)); + bitmask |= WRAP_PARTIAL_FLAG; + } + return createWrap(key, bitmask, object, partials, holders); + }); + + /** + * Creates a function that accepts arguments of `func` and either invokes + * `func` returning its result, if at least `arity` number of arguments have + * been provided, or returns a function that accepts the remaining `func` + * arguments, and so on. The arity of `func` may be specified if `func.length` + * is not sufficient. + * + * The `_.curry.placeholder` value, which defaults to `_` in monolithic builds, + * may be used as a placeholder for provided arguments. + * + * **Note:** This method doesn't set the "length" property of curried functions. + * + * @static + * @memberOf _ + * @since 2.0.0 + * @category Function + * @param {Function} func The function to curry. + * @param {number} [arity=func.length] The arity of `func`. + * @param- {Object} [guard] Enables use as an iteratee for methods like `_.map`. + * @returns {Function} Returns the new curried function. + * @example + * + * var abc = function(a, b, c) { + * return [a, b, c]; + * }; + * + * var curried = _.curry(abc); + * + * curried(1)(2)(3); + * // => [1, 2, 3] + * + * curried(1, 2)(3); + * // => [1, 2, 3] + * + * curried(1, 2, 3); + * // => [1, 2, 3] + * + * // Curried with placeholders. + * curried(1)(_, 3)(2); + * // => [1, 2, 3] + */ + function curry(func, arity, guard) { + arity = guard ? undefined : arity; + var result = createWrap(func, WRAP_CURRY_FLAG, undefined, undefined, undefined, undefined, undefined, arity); + result.placeholder = curry.placeholder; + return result; + } + + /** + * This method is like `_.curry` except that arguments are applied to `func` + * in the manner of `_.partialRight` instead of `_.partial`. + * + * The `_.curryRight.placeholder` value, which defaults to `_` in monolithic + * builds, may be used as a placeholder for provided arguments. + * + * **Note:** This method doesn't set the "length" property of curried functions. + * + * @static + * @memberOf _ + * @since 3.0.0 + * @category Function + * @param {Function} func The function to curry. + * @param {number} [arity=func.length] The arity of `func`. + * @param- {Object} [guard] Enables use as an iteratee for methods like `_.map`. + * @returns {Function} Returns the new curried function. + * @example + * + * var abc = function(a, b, c) { + * return [a, b, c]; + * }; + * + * var curried = _.curryRight(abc); + * + * curried(3)(2)(1); + * // => [1, 2, 3] + * + * curried(2, 3)(1); + * // => [1, 2, 3] + * + * curried(1, 2, 3); + * // => [1, 2, 3] + * + * // Curried with placeholders. + * curried(3)(1, _)(2); + * // => [1, 2, 3] + */ + function curryRight(func, arity, guard) { + arity = guard ? undefined : arity; + var result = createWrap(func, WRAP_CURRY_RIGHT_FLAG, undefined, undefined, undefined, undefined, undefined, arity); + result.placeholder = curryRight.placeholder; + return result; + } + + /** + * Creates a debounced function that delays invoking `func` until after `wait` + * milliseconds have elapsed since the last time the debounced function was + * invoked. The debounced function comes with a `cancel` method to cancel + * delayed `func` invocations and a `flush` method to immediately invoke them. + * Provide `options` to indicate whether `func` should be invoked on the + * leading and/or trailing edge of the `wait` timeout. The `func` is invoked + * with the last arguments provided to the debounced function. Subsequent + * calls to the debounced function return the result of the last `func` + * invocation. + * + * **Note:** If `leading` and `trailing` options are `true`, `func` is + * invoked on the trailing edge of the timeout only if the debounced function + * is invoked more than once during the `wait` timeout. + * + * If `wait` is `0` and `leading` is `false`, `func` invocation is deferred + * until to the next tick, similar to `setTimeout` with a timeout of `0`. + * + * See [David Corbacho's article](https://css-tricks.com/debouncing-throttling-explained-examples/) + * for details over the differences between `_.debounce` and `_.throttle`. + * + * @static + * @memberOf _ + * @since 0.1.0 + * @category Function + * @param {Function} func The function to debounce. + * @param {number} [wait=0] The number of milliseconds to delay. + * @param {Object} [options={}] The options object. + * @param {boolean} [options.leading=false] + * Specify invoking on the leading edge of the timeout. + * @param {number} [options.maxWait] + * The maximum time `func` is allowed to be delayed before it's invoked. + * @param {boolean} [options.trailing=true] + * Specify invoking on the trailing edge of the timeout. + * @returns {Function} Returns the new debounced function. + * @example + * + * // Avoid costly calculations while the window size is in flux. + * jQuery(window).on('resize', _.debounce(calculateLayout, 150)); + * + * // Invoke `sendMail` when clicked, debouncing subsequent calls. + * jQuery(element).on('click', _.debounce(sendMail, 300, { + * 'leading': true, + * 'trailing': false + * })); + * + * // Ensure `batchLog` is invoked once after 1 second of debounced calls. + * var debounced = _.debounce(batchLog, 250, { 'maxWait': 1000 }); + * var source = new EventSource('/stream'); + * jQuery(source).on('message', debounced); + * + * // Cancel the trailing debounced invocation. + * jQuery(window).on('popstate', debounced.cancel); + */ + function debounce(func, wait, options) { + var lastArgs, + lastThis, + maxWait, + result, + timerId, + lastCallTime, + lastInvokeTime = 0, + leading = false, + maxing = false, + trailing = true; + + if (typeof func != 'function') { + throw new TypeError(FUNC_ERROR_TEXT); + } + wait = toNumber(wait) || 0; + if (isObject(options)) { + leading = !!options.leading; + maxing = 'maxWait' in options; + maxWait = maxing ? nativeMax(toNumber(options.maxWait) || 0, wait) : maxWait; + trailing = 'trailing' in options ? !!options.trailing : trailing; + } + + function invokeFunc(time) { + var args = lastArgs, + thisArg = lastThis; + + lastArgs = lastThis = undefined; + lastInvokeTime = time; + result = func.apply(thisArg, args); + return result; + } + + function leadingEdge(time) { + // Reset any `maxWait` timer. + lastInvokeTime = time; + // Start the timer for the trailing edge. + timerId = setTimeout(timerExpired, wait); + // Invoke the leading edge. + return leading ? invokeFunc(time) : result; + } + + function remainingWait(time) { + var timeSinceLastCall = time - lastCallTime, + timeSinceLastInvoke = time - lastInvokeTime, + timeWaiting = wait - timeSinceLastCall; + + return maxing + ? nativeMin(timeWaiting, maxWait - timeSinceLastInvoke) + : timeWaiting; + } + + function shouldInvoke(time) { + var timeSinceLastCall = time - lastCallTime, + timeSinceLastInvoke = time - lastInvokeTime; + + // Either this is the first call, activity has stopped and we're at the + // trailing edge, the system time has gone backwards and we're treating + // it as the trailing edge, or we've hit the `maxWait` limit. + return (lastCallTime === undefined || (timeSinceLastCall >= wait) || + (timeSinceLastCall < 0) || (maxing && timeSinceLastInvoke >= maxWait)); + } + + function timerExpired() { + var time = now(); + if (shouldInvoke(time)) { + return trailingEdge(time); + } + // Restart the timer. + timerId = setTimeout(timerExpired, remainingWait(time)); + } + + function trailingEdge(time) { + timerId = undefined; + + // Only invoke if we have `lastArgs` which means `func` has been + // debounced at least once. + if (trailing && lastArgs) { + return invokeFunc(time); + } + lastArgs = lastThis = undefined; + return result; + } + + function cancel() { + if (timerId !== undefined) { + clearTimeout(timerId); + } + lastInvokeTime = 0; + lastArgs = lastCallTime = lastThis = timerId = undefined; + } + + function flush() { + return timerId === undefined ? result : trailingEdge(now()); + } + + function debounced() { + var time = now(), + isInvoking = shouldInvoke(time); + + lastArgs = arguments; + lastThis = this; + lastCallTime = time; + + if (isInvoking) { + if (timerId === undefined) { + return leadingEdge(lastCallTime); + } + if (maxing) { + // Handle invocations in a tight loop. + clearTimeout(timerId); + timerId = setTimeout(timerExpired, wait); + return invokeFunc(lastCallTime); + } + } + if (timerId === undefined) { + timerId = setTimeout(timerExpired, wait); + } + return result; + } + debounced.cancel = cancel; + debounced.flush = flush; + return debounced; + } + + /** + * Defers invoking the `func` until the current call stack has cleared. Any + * additional arguments are provided to `func` when it's invoked. + * + * @static + * @memberOf _ + * @since 0.1.0 + * @category Function + * @param {Function} func The function to defer. + * @param {...*} [args] The arguments to invoke `func` with. + * @returns {number} Returns the timer id. + * @example + * + * _.defer(function(text) { + * console.log(text); + * }, 'deferred'); + * // => Logs 'deferred' after one millisecond. + */ + var defer = baseRest(function(func, args) { + return baseDelay(func, 1, args); + }); + + /** + * Invokes `func` after `wait` milliseconds. Any additional arguments are + * provided to `func` when it's invoked. + * + * @static + * @memberOf _ + * @since 0.1.0 + * @category Function + * @param {Function} func The function to delay. + * @param {number} wait The number of milliseconds to delay invocation. + * @param {...*} [args] The arguments to invoke `func` with. + * @returns {number} Returns the timer id. + * @example + * + * _.delay(function(text) { + * console.log(text); + * }, 1000, 'later'); + * // => Logs 'later' after one second. + */ + var delay = baseRest(function(func, wait, args) { + return baseDelay(func, toNumber(wait) || 0, args); + }); + + /** + * Creates a function that invokes `func` with arguments reversed. + * + * @static + * @memberOf _ + * @since 4.0.0 + * @category Function + * @param {Function} func The function to flip arguments for. + * @returns {Function} Returns the new flipped function. + * @example + * + * var flipped = _.flip(function() { + * return _.toArray(arguments); + * }); + * + * flipped('a', 'b', 'c', 'd'); + * // => ['d', 'c', 'b', 'a'] + */ + function flip(func) { + return createWrap(func, WRAP_FLIP_FLAG); + } + + /** + * Creates a function that memoizes the result of `func`. If `resolver` is + * provided, it determines the cache key for storing the result based on the + * arguments provided to the memoized function. By default, the first argument + * provided to the memoized function is used as the map cache key. The `func` + * is invoked with the `this` binding of the memoized function. + * + * **Note:** The cache is exposed as the `cache` property on the memoized + * function. Its creation may be customized by replacing the `_.memoize.Cache` + * constructor with one whose instances implement the + * [`Map`](http://ecma-international.org/ecma-262/7.0/#sec-properties-of-the-map-prototype-object) + * method interface of `clear`, `delete`, `get`, `has`, and `set`. + * + * @static + * @memberOf _ + * @since 0.1.0 + * @category Function + * @param {Function} func The function to have its output memoized. + * @param {Function} [resolver] The function to resolve the cache key. + * @returns {Function} Returns the new memoized function. + * @example + * + * var object = { 'a': 1, 'b': 2 }; + * var other = { 'c': 3, 'd': 4 }; + * + * var values = _.memoize(_.values); + * values(object); + * // => [1, 2] + * + * values(other); + * // => [3, 4] + * + * object.a = 2; + * values(object); + * // => [1, 2] + * + * // Modify the result cache. + * values.cache.set(object, ['a', 'b']); + * values(object); + * // => ['a', 'b'] + * + * // Replace `_.memoize.Cache`. + * _.memoize.Cache = WeakMap; + */ + function memoize(func, resolver) { + if (typeof func != 'function' || (resolver != null && typeof resolver != 'function')) { + throw new TypeError(FUNC_ERROR_TEXT); + } + var memoized = function() { + var args = arguments, + key = resolver ? resolver.apply(this, args) : args[0], + cache = memoized.cache; + + if (cache.has(key)) { + return cache.get(key); + } + var result = func.apply(this, args); + memoized.cache = cache.set(key, result) || cache; + return result; + }; + memoized.cache = new (memoize.Cache || MapCache); + return memoized; + } + + // Expose `MapCache`. + memoize.Cache = MapCache; + + /** + * Creates a function that negates the result of the predicate `func`. The + * `func` predicate is invoked with the `this` binding and arguments of the + * created function. + * + * @static + * @memberOf _ + * @since 3.0.0 + * @category Function + * @param {Function} predicate The predicate to negate. + * @returns {Function} Returns the new negated function. + * @example + * + * function isEven(n) { + * return n % 2 == 0; + * } + * + * _.filter([1, 2, 3, 4, 5, 6], _.negate(isEven)); + * // => [1, 3, 5] + */ + function negate(predicate) { + if (typeof predicate != 'function') { + throw new TypeError(FUNC_ERROR_TEXT); + } + return function() { + var args = arguments; + switch (args.length) { + case 0: return !predicate.call(this); + case 1: return !predicate.call(this, args[0]); + case 2: return !predicate.call(this, args[0], args[1]); + case 3: return !predicate.call(this, args[0], args[1], args[2]); + } + return !predicate.apply(this, args); + }; + } + + /** + * Creates a function that is restricted to invoking `func` once. Repeat calls + * to the function return the value of the first invocation. The `func` is + * invoked with the `this` binding and arguments of the created function. + * + * @static + * @memberOf _ + * @since 0.1.0 + * @category Function + * @param {Function} func The function to restrict. + * @returns {Function} Returns the new restricted function. + * @example + * + * var initialize = _.once(createApplication); + * initialize(); + * initialize(); + * // => `createApplication` is invoked once + */ + function once(func) { + return before(2, func); + } + + /** + * Creates a function that invokes `func` with its arguments transformed. + * + * @static + * @since 4.0.0 + * @memberOf _ + * @category Function + * @param {Function} func The function to wrap. + * @param {...(Function|Function[])} [transforms=[_.identity]] + * The argument transforms. + * @returns {Function} Returns the new function. + * @example + * + * function doubled(n) { + * return n * 2; + * } + * + * function square(n) { + * return n * n; + * } + * + * var func = _.overArgs(function(x, y) { + * return [x, y]; + * }, [square, doubled]); + * + * func(9, 3); + * // => [81, 6] + * + * func(10, 5); + * // => [100, 10] + */ + var overArgs = castRest(function(func, transforms) { + transforms = (transforms.length == 1 && isArray(transforms[0])) + ? arrayMap(transforms[0], baseUnary(getIteratee())) + : arrayMap(baseFlatten(transforms, 1), baseUnary(getIteratee())); + + var funcsLength = transforms.length; + return baseRest(function(args) { + var index = -1, + length = nativeMin(args.length, funcsLength); + + while (++index < length) { + args[index] = transforms[index].call(this, args[index]); + } + return apply(func, this, args); + }); + }); + + /** + * Creates a function that invokes `func` with `partials` prepended to the + * arguments it receives. This method is like `_.bind` except it does **not** + * alter the `this` binding. + * + * The `_.partial.placeholder` value, which defaults to `_` in monolithic + * builds, may be used as a placeholder for partially applied arguments. + * + * **Note:** This method doesn't set the "length" property of partially + * applied functions. + * + * @static + * @memberOf _ + * @since 0.2.0 + * @category Function + * @param {Function} func The function to partially apply arguments to. + * @param {...*} [partials] The arguments to be partially applied. + * @returns {Function} Returns the new partially applied function. + * @example + * + * function greet(greeting, name) { + * return greeting + ' ' + name; + * } + * + * var sayHelloTo = _.partial(greet, 'hello'); + * sayHelloTo('fred'); + * // => 'hello fred' + * + * // Partially applied with placeholders. + * var greetFred = _.partial(greet, _, 'fred'); + * greetFred('hi'); + * // => 'hi fred' + */ + var partial = baseRest(function(func, partials) { + var holders = replaceHolders(partials, getHolder(partial)); + return createWrap(func, WRAP_PARTIAL_FLAG, undefined, partials, holders); + }); + + /** + * This method is like `_.partial` except that partially applied arguments + * are appended to the arguments it receives. + * + * The `_.partialRight.placeholder` value, which defaults to `_` in monolithic + * builds, may be used as a placeholder for partially applied arguments. + * + * **Note:** This method doesn't set the "length" property of partially + * applied functions. + * + * @static + * @memberOf _ + * @since 1.0.0 + * @category Function + * @param {Function} func The function to partially apply arguments to. + * @param {...*} [partials] The arguments to be partially applied. + * @returns {Function} Returns the new partially applied function. + * @example + * + * function greet(greeting, name) { + * return greeting + ' ' + name; + * } + * + * var greetFred = _.partialRight(greet, 'fred'); + * greetFred('hi'); + * // => 'hi fred' + * + * // Partially applied with placeholders. + * var sayHelloTo = _.partialRight(greet, 'hello', _); + * sayHelloTo('fred'); + * // => 'hello fred' + */ + var partialRight = baseRest(function(func, partials) { + var holders = replaceHolders(partials, getHolder(partialRight)); + return createWrap(func, WRAP_PARTIAL_RIGHT_FLAG, undefined, partials, holders); + }); + + /** + * Creates a function that invokes `func` with arguments arranged according + * to the specified `indexes` where the argument value at the first index is + * provided as the first argument, the argument value at the second index is + * provided as the second argument, and so on. + * + * @static + * @memberOf _ + * @since 3.0.0 + * @category Function + * @param {Function} func The function to rearrange arguments for. + * @param {...(number|number[])} indexes The arranged argument indexes. + * @returns {Function} Returns the new function. + * @example + * + * var rearged = _.rearg(function(a, b, c) { + * return [a, b, c]; + * }, [2, 0, 1]); + * + * rearged('b', 'c', 'a') + * // => ['a', 'b', 'c'] + */ + var rearg = flatRest(function(func, indexes) { + return createWrap(func, WRAP_REARG_FLAG, undefined, undefined, undefined, indexes); + }); + + /** + * Creates a function that invokes `func` with the `this` binding of the + * created function and arguments from `start` and beyond provided as + * an array. + * + * **Note:** This method is based on the + * [rest parameter](https://mdn.io/rest_parameters). + * + * @static + * @memberOf _ + * @since 4.0.0 + * @category Function + * @param {Function} func The function to apply a rest parameter to. + * @param {number} [start=func.length-1] The start position of the rest parameter. + * @returns {Function} Returns the new function. + * @example + * + * var say = _.rest(function(what, names) { + * return what + ' ' + _.initial(names).join(', ') + + * (_.size(names) > 1 ? ', & ' : '') + _.last(names); + * }); + * + * say('hello', 'fred', 'barney', 'pebbles'); + * // => 'hello fred, barney, & pebbles' + */ + function rest(func, start) { + if (typeof func != 'function') { + throw new TypeError(FUNC_ERROR_TEXT); + } + start = start === undefined ? start : toInteger(start); + return baseRest(func, start); + } + + /** + * Creates a function that invokes `func` with the `this` binding of the + * create function and an array of arguments much like + * [`Function#apply`](http://www.ecma-international.org/ecma-262/7.0/#sec-function.prototype.apply). + * + * **Note:** This method is based on the + * [spread operator](https://mdn.io/spread_operator). + * + * @static + * @memberOf _ + * @since 3.2.0 + * @category Function + * @param {Function} func The function to spread arguments over. + * @param {number} [start=0] The start position of the spread. + * @returns {Function} Returns the new function. + * @example + * + * var say = _.spread(function(who, what) { + * return who + ' says ' + what; + * }); + * + * say(['fred', 'hello']); + * // => 'fred says hello' + * + * var numbers = Promise.all([ + * Promise.resolve(40), + * Promise.resolve(36) + * ]); + * + * numbers.then(_.spread(function(x, y) { + * return x + y; + * })); + * // => a Promise of 76 + */ + function spread(func, start) { + if (typeof func != 'function') { + throw new TypeError(FUNC_ERROR_TEXT); + } + start = start == null ? 0 : nativeMax(toInteger(start), 0); + return baseRest(function(args) { + var array = args[start], + otherArgs = castSlice(args, 0, start); + + if (array) { + arrayPush(otherArgs, array); + } + return apply(func, this, otherArgs); + }); + } + + /** + * Creates a throttled function that only invokes `func` at most once per + * every `wait` milliseconds. The throttled function comes with a `cancel` + * method to cancel delayed `func` invocations and a `flush` method to + * immediately invoke them. Provide `options` to indicate whether `func` + * should be invoked on the leading and/or trailing edge of the `wait` + * timeout. The `func` is invoked with the last arguments provided to the + * throttled function. Subsequent calls to the throttled function return the + * result of the last `func` invocation. + * + * **Note:** If `leading` and `trailing` options are `true`, `func` is + * invoked on the trailing edge of the timeout only if the throttled function + * is invoked more than once during the `wait` timeout. + * + * If `wait` is `0` and `leading` is `false`, `func` invocation is deferred + * until to the next tick, similar to `setTimeout` with a timeout of `0`. + * + * See [David Corbacho's article](https://css-tricks.com/debouncing-throttling-explained-examples/) + * for details over the differences between `_.throttle` and `_.debounce`. + * + * @static + * @memberOf _ + * @since 0.1.0 + * @category Function + * @param {Function} func The function to throttle. + * @param {number} [wait=0] The number of milliseconds to throttle invocations to. + * @param {Object} [options={}] The options object. + * @param {boolean} [options.leading=true] + * Specify invoking on the leading edge of the timeout. + * @param {boolean} [options.trailing=true] + * Specify invoking on the trailing edge of the timeout. + * @returns {Function} Returns the new throttled function. + * @example + * + * // Avoid excessively updating the position while scrolling. + * jQuery(window).on('scroll', _.throttle(updatePosition, 100)); + * + * // Invoke `renewToken` when the click event is fired, but not more than once every 5 minutes. + * var throttled = _.throttle(renewToken, 300000, { 'trailing': false }); + * jQuery(element).on('click', throttled); + * + * // Cancel the trailing throttled invocation. + * jQuery(window).on('popstate', throttled.cancel); + */ + function throttle(func, wait, options) { + var leading = true, + trailing = true; + + if (typeof func != 'function') { + throw new TypeError(FUNC_ERROR_TEXT); + } + if (isObject(options)) { + leading = 'leading' in options ? !!options.leading : leading; + trailing = 'trailing' in options ? !!options.trailing : trailing; + } + return debounce(func, wait, { + 'leading': leading, + 'maxWait': wait, + 'trailing': trailing + }); + } + + /** + * Creates a function that accepts up to one argument, ignoring any + * additional arguments. + * + * @static + * @memberOf _ + * @since 4.0.0 + * @category Function + * @param {Function} func The function to cap arguments for. + * @returns {Function} Returns the new capped function. + * @example + * + * _.map(['6', '8', '10'], _.unary(parseInt)); + * // => [6, 8, 10] + */ + function unary(func) { + return ary(func, 1); + } + + /** + * Creates a function that provides `value` to `wrapper` as its first + * argument. Any additional arguments provided to the function are appended + * to those provided to the `wrapper`. The wrapper is invoked with the `this` + * binding of the created function. + * + * @static + * @memberOf _ + * @since 0.1.0 + * @category Function + * @param {*} value The value to wrap. + * @param {Function} [wrapper=identity] The wrapper function. + * @returns {Function} Returns the new function. + * @example + * + * var p = _.wrap(_.escape, function(func, text) { + * return '

' + func(text) + '

'; + * }); + * + * p('fred, barney, & pebbles'); + * // => '

fred, barney, & pebbles

' + */ + function wrap(value, wrapper) { + return partial(castFunction(wrapper), value); + } + + /*------------------------------------------------------------------------*/ + + /** + * Casts `value` as an array if it's not one. + * + * @static + * @memberOf _ + * @since 4.4.0 + * @category Lang + * @param {*} value The value to inspect. + * @returns {Array} Returns the cast array. + * @example + * + * _.castArray(1); + * // => [1] + * + * _.castArray({ 'a': 1 }); + * // => [{ 'a': 1 }] + * + * _.castArray('abc'); + * // => ['abc'] + * + * _.castArray(null); + * // => [null] + * + * _.castArray(undefined); + * // => [undefined] + * + * _.castArray(); + * // => [] + * + * var array = [1, 2, 3]; + * console.log(_.castArray(array) === array); + * // => true + */ + function castArray() { + if (!arguments.length) { + return []; + } + var value = arguments[0]; + return isArray(value) ? value : [value]; + } + + /** + * Creates a shallow clone of `value`. + * + * **Note:** This method is loosely based on the + * [structured clone algorithm](https://mdn.io/Structured_clone_algorithm) + * and supports cloning arrays, array buffers, booleans, date objects, maps, + * numbers, `Object` objects, regexes, sets, strings, symbols, and typed + * arrays. The own enumerable properties of `arguments` objects are cloned + * as plain objects. An empty object is returned for uncloneable values such + * as error objects, functions, DOM nodes, and WeakMaps. + * + * @static + * @memberOf _ + * @since 0.1.0 + * @category Lang + * @param {*} value The value to clone. + * @returns {*} Returns the cloned value. + * @see _.cloneDeep + * @example + * + * var objects = [{ 'a': 1 }, { 'b': 2 }]; + * + * var shallow = _.clone(objects); + * console.log(shallow[0] === objects[0]); + * // => true + */ + function clone(value) { + return baseClone(value, CLONE_SYMBOLS_FLAG); + } + + /** + * This method is like `_.clone` except that it accepts `customizer` which + * is invoked to produce the cloned value. If `customizer` returns `undefined`, + * cloning is handled by the method instead. The `customizer` is invoked with + * up to four arguments; (value [, index|key, object, stack]). + * + * @static + * @memberOf _ + * @since 4.0.0 + * @category Lang + * @param {*} value The value to clone. + * @param {Function} [customizer] The function to customize cloning. + * @returns {*} Returns the cloned value. + * @see _.cloneDeepWith + * @example + * + * function customizer(value) { + * if (_.isElement(value)) { + * return value.cloneNode(false); + * } + * } + * + * var el = _.cloneWith(document.body, customizer); + * + * console.log(el === document.body); + * // => false + * console.log(el.nodeName); + * // => 'BODY' + * console.log(el.childNodes.length); + * // => 0 + */ + function cloneWith(value, customizer) { + customizer = typeof customizer == 'function' ? customizer : undefined; + return baseClone(value, CLONE_SYMBOLS_FLAG, customizer); + } + + /** + * This method is like `_.clone` except that it recursively clones `value`. + * + * @static + * @memberOf _ + * @since 1.0.0 + * @category Lang + * @param {*} value The value to recursively clone. + * @returns {*} Returns the deep cloned value. + * @see _.clone + * @example + * + * var objects = [{ 'a': 1 }, { 'b': 2 }]; + * + * var deep = _.cloneDeep(objects); + * console.log(deep[0] === objects[0]); + * // => false + */ + function cloneDeep(value) { + return baseClone(value, CLONE_DEEP_FLAG | CLONE_SYMBOLS_FLAG); + } + + /** + * This method is like `_.cloneWith` except that it recursively clones `value`. + * + * @static + * @memberOf _ + * @since 4.0.0 + * @category Lang + * @param {*} value The value to recursively clone. + * @param {Function} [customizer] The function to customize cloning. + * @returns {*} Returns the deep cloned value. + * @see _.cloneWith + * @example + * + * function customizer(value) { + * if (_.isElement(value)) { + * return value.cloneNode(true); + * } + * } + * + * var el = _.cloneDeepWith(document.body, customizer); + * + * console.log(el === document.body); + * // => false + * console.log(el.nodeName); + * // => 'BODY' + * console.log(el.childNodes.length); + * // => 20 + */ + function cloneDeepWith(value, customizer) { + customizer = typeof customizer == 'function' ? customizer : undefined; + return baseClone(value, CLONE_DEEP_FLAG | CLONE_SYMBOLS_FLAG, customizer); + } + + /** + * Checks if `object` conforms to `source` by invoking the predicate + * properties of `source` with the corresponding property values of `object`. + * + * **Note:** This method is equivalent to `_.conforms` when `source` is + * partially applied. + * + * @static + * @memberOf _ + * @since 4.14.0 + * @category Lang + * @param {Object} object The object to inspect. + * @param {Object} source The object of property predicates to conform to. + * @returns {boolean} Returns `true` if `object` conforms, else `false`. + * @example + * + * var object = { 'a': 1, 'b': 2 }; + * + * _.conformsTo(object, { 'b': function(n) { return n > 1; } }); + * // => true + * + * _.conformsTo(object, { 'b': function(n) { return n > 2; } }); + * // => false + */ + function conformsTo(object, source) { + return source == null || baseConformsTo(object, source, keys(source)); + } + + /** + * Performs a + * [`SameValueZero`](http://ecma-international.org/ecma-262/7.0/#sec-samevaluezero) + * comparison between two values to determine if they are equivalent. + * + * @static + * @memberOf _ + * @since 4.0.0 + * @category Lang + * @param {*} value The value to compare. + * @param {*} other The other value to compare. + * @returns {boolean} Returns `true` if the values are equivalent, else `false`. + * @example + * + * var object = { 'a': 1 }; + * var other = { 'a': 1 }; + * + * _.eq(object, object); + * // => true + * + * _.eq(object, other); + * // => false + * + * _.eq('a', 'a'); + * // => true + * + * _.eq('a', Object('a')); + * // => false + * + * _.eq(NaN, NaN); + * // => true + */ + function eq(value, other) { + return value === other || (value !== value && other !== other); + } + + /** + * Checks if `value` is greater than `other`. + * + * @static + * @memberOf _ + * @since 3.9.0 + * @category Lang + * @param {*} value The value to compare. + * @param {*} other The other value to compare. + * @returns {boolean} Returns `true` if `value` is greater than `other`, + * else `false`. + * @see _.lt + * @example + * + * _.gt(3, 1); + * // => true + * + * _.gt(3, 3); + * // => false + * + * _.gt(1, 3); + * // => false + */ + var gt = createRelationalOperation(baseGt); + + /** + * Checks if `value` is greater than or equal to `other`. + * + * @static + * @memberOf _ + * @since 3.9.0 + * @category Lang + * @param {*} value The value to compare. + * @param {*} other The other value to compare. + * @returns {boolean} Returns `true` if `value` is greater than or equal to + * `other`, else `false`. + * @see _.lte + * @example + * + * _.gte(3, 1); + * // => true + * + * _.gte(3, 3); + * // => true + * + * _.gte(1, 3); + * // => false + */ + var gte = createRelationalOperation(function(value, other) { + return value >= other; + }); + + /** + * Checks if `value` is likely an `arguments` object. + * + * @static + * @memberOf _ + * @since 0.1.0 + * @category Lang + * @param {*} value The value to check. + * @returns {boolean} Returns `true` if `value` is an `arguments` object, + * else `false`. + * @example + * + * _.isArguments(function() { return arguments; }()); + * // => true + * + * _.isArguments([1, 2, 3]); + * // => false + */ + var isArguments = baseIsArguments(function() { return arguments; }()) ? baseIsArguments : function(value) { + return isObjectLike(value) && hasOwnProperty.call(value, 'callee') && + !propertyIsEnumerable.call(value, 'callee'); + }; + + /** + * Checks if `value` is classified as an `Array` object. + * + * @static + * @memberOf _ + * @since 0.1.0 + * @category Lang + * @param {*} value The value to check. + * @returns {boolean} Returns `true` if `value` is an array, else `false`. + * @example + * + * _.isArray([1, 2, 3]); + * // => true + * + * _.isArray(document.body.children); + * // => false + * + * _.isArray('abc'); + * // => false + * + * _.isArray(_.noop); + * // => false + */ + var isArray = Array.isArray; + + /** + * Checks if `value` is classified as an `ArrayBuffer` object. + * + * @static + * @memberOf _ + * @since 4.3.0 + * @category Lang + * @param {*} value The value to check. + * @returns {boolean} Returns `true` if `value` is an array buffer, else `false`. + * @example + * + * _.isArrayBuffer(new ArrayBuffer(2)); + * // => true + * + * _.isArrayBuffer(new Array(2)); + * // => false + */ + var isArrayBuffer = nodeIsArrayBuffer ? baseUnary(nodeIsArrayBuffer) : baseIsArrayBuffer; + + /** + * Checks if `value` is array-like. A value is considered array-like if it's + * not a function and has a `value.length` that's an integer greater than or + * equal to `0` and less than or equal to `Number.MAX_SAFE_INTEGER`. + * + * @static + * @memberOf _ + * @since 4.0.0 + * @category Lang + * @param {*} value The value to check. + * @returns {boolean} Returns `true` if `value` is array-like, else `false`. + * @example + * + * _.isArrayLike([1, 2, 3]); + * // => true + * + * _.isArrayLike(document.body.children); + * // => true + * + * _.isArrayLike('abc'); + * // => true + * + * _.isArrayLike(_.noop); + * // => false + */ + function isArrayLike(value) { + return value != null && isLength(value.length) && !isFunction(value); + } + + /** + * This method is like `_.isArrayLike` except that it also checks if `value` + * is an object. + * + * @static + * @memberOf _ + * @since 4.0.0 + * @category Lang + * @param {*} value The value to check. + * @returns {boolean} Returns `true` if `value` is an array-like object, + * else `false`. + * @example + * + * _.isArrayLikeObject([1, 2, 3]); + * // => true + * + * _.isArrayLikeObject(document.body.children); + * // => true + * + * _.isArrayLikeObject('abc'); + * // => false + * + * _.isArrayLikeObject(_.noop); + * // => false + */ + function isArrayLikeObject(value) { + return isObjectLike(value) && isArrayLike(value); + } + + /** + * Checks if `value` is classified as a boolean primitive or object. + * + * @static + * @memberOf _ + * @since 0.1.0 + * @category Lang + * @param {*} value The value to check. + * @returns {boolean} Returns `true` if `value` is a boolean, else `false`. + * @example + * + * _.isBoolean(false); + * // => true + * + * _.isBoolean(null); + * // => false + */ + function isBoolean(value) { + return value === true || value === false || + (isObjectLike(value) && baseGetTag(value) == boolTag); + } + + /** + * Checks if `value` is a buffer. + * + * @static + * @memberOf _ + * @since 4.3.0 + * @category Lang + * @param {*} value The value to check. + * @returns {boolean} Returns `true` if `value` is a buffer, else `false`. + * @example + * + * _.isBuffer(new Buffer(2)); + * // => true + * + * _.isBuffer(new Uint8Array(2)); + * // => false + */ + var isBuffer = nativeIsBuffer || stubFalse; + + /** + * Checks if `value` is classified as a `Date` object. + * + * @static + * @memberOf _ + * @since 0.1.0 + * @category Lang + * @param {*} value The value to check. + * @returns {boolean} Returns `true` if `value` is a date object, else `false`. + * @example + * + * _.isDate(new Date); + * // => true + * + * _.isDate('Mon April 23 2012'); + * // => false + */ + var isDate = nodeIsDate ? baseUnary(nodeIsDate) : baseIsDate; + + /** + * Checks if `value` is likely a DOM element. + * + * @static + * @memberOf _ + * @since 0.1.0 + * @category Lang + * @param {*} value The value to check. + * @returns {boolean} Returns `true` if `value` is a DOM element, else `false`. + * @example + * + * _.isElement(document.body); + * // => true + * + * _.isElement(''); + * // => false + */ + function isElement(value) { + return isObjectLike(value) && value.nodeType === 1 && !isPlainObject(value); + } + + /** + * Checks if `value` is an empty object, collection, map, or set. + * + * Objects are considered empty if they have no own enumerable string keyed + * properties. + * + * Array-like values such as `arguments` objects, arrays, buffers, strings, or + * jQuery-like collections are considered empty if they have a `length` of `0`. + * Similarly, maps and sets are considered empty if they have a `size` of `0`. + * + * @static + * @memberOf _ + * @since 0.1.0 + * @category Lang + * @param {*} value The value to check. + * @returns {boolean} Returns `true` if `value` is empty, else `false`. + * @example + * + * _.isEmpty(null); + * // => true + * + * _.isEmpty(true); + * // => true + * + * _.isEmpty(1); + * // => true + * + * _.isEmpty([1, 2, 3]); + * // => false + * + * _.isEmpty({ 'a': 1 }); + * // => false + */ + function isEmpty(value) { + if (value == null) { + return true; + } + if (isArrayLike(value) && + (isArray(value) || typeof value == 'string' || typeof value.splice == 'function' || + isBuffer(value) || isTypedArray(value) || isArguments(value))) { + return !value.length; + } + var tag = getTag(value); + if (tag == mapTag || tag == setTag) { + return !value.size; + } + if (isPrototype(value)) { + return !baseKeys(value).length; + } + for (var key in value) { + if (hasOwnProperty.call(value, key)) { + return false; + } + } + return true; + } + + /** + * Performs a deep comparison between two values to determine if they are + * equivalent. + * + * **Note:** This method supports comparing arrays, array buffers, booleans, + * date objects, error objects, maps, numbers, `Object` objects, regexes, + * sets, strings, symbols, and typed arrays. `Object` objects are compared + * by their own, not inherited, enumerable properties. Functions and DOM + * nodes are compared by strict equality, i.e. `===`. + * + * @static + * @memberOf _ + * @since 0.1.0 + * @category Lang + * @param {*} value The value to compare. + * @param {*} other The other value to compare. + * @returns {boolean} Returns `true` if the values are equivalent, else `false`. + * @example + * + * var object = { 'a': 1 }; + * var other = { 'a': 1 }; + * + * _.isEqual(object, other); + * // => true + * + * object === other; + * // => false + */ + function isEqual(value, other) { + return baseIsEqual(value, other); + } + + /** + * This method is like `_.isEqual` except that it accepts `customizer` which + * is invoked to compare values. If `customizer` returns `undefined`, comparisons + * are handled by the method instead. The `customizer` is invoked with up to + * six arguments: (objValue, othValue [, index|key, object, other, stack]). + * + * @static + * @memberOf _ + * @since 4.0.0 + * @category Lang + * @param {*} value The value to compare. + * @param {*} other The other value to compare. + * @param {Function} [customizer] The function to customize comparisons. + * @returns {boolean} Returns `true` if the values are equivalent, else `false`. + * @example + * + * function isGreeting(value) { + * return /^h(?:i|ello)$/.test(value); + * } + * + * function customizer(objValue, othValue) { + * if (isGreeting(objValue) && isGreeting(othValue)) { + * return true; + * } + * } + * + * var array = ['hello', 'goodbye']; + * var other = ['hi', 'goodbye']; + * + * _.isEqualWith(array, other, customizer); + * // => true + */ + function isEqualWith(value, other, customizer) { + customizer = typeof customizer == 'function' ? customizer : undefined; + var result = customizer ? customizer(value, other) : undefined; + return result === undefined ? baseIsEqual(value, other, undefined, customizer) : !!result; + } + + /** + * Checks if `value` is an `Error`, `EvalError`, `RangeError`, `ReferenceError`, + * `SyntaxError`, `TypeError`, or `URIError` object. + * + * @static + * @memberOf _ + * @since 3.0.0 + * @category Lang + * @param {*} value The value to check. + * @returns {boolean} Returns `true` if `value` is an error object, else `false`. + * @example + * + * _.isError(new Error); + * // => true + * + * _.isError(Error); + * // => false + */ + function isError(value) { + if (!isObjectLike(value)) { + return false; + } + var tag = baseGetTag(value); + return tag == errorTag || tag == domExcTag || + (typeof value.message == 'string' && typeof value.name == 'string' && !isPlainObject(value)); + } + + /** + * Checks if `value` is a finite primitive number. + * + * **Note:** This method is based on + * [`Number.isFinite`](https://mdn.io/Number/isFinite). + * + * @static + * @memberOf _ + * @since 0.1.0 + * @category Lang + * @param {*} value The value to check. + * @returns {boolean} Returns `true` if `value` is a finite number, else `false`. + * @example + * + * _.isFinite(3); + * // => true + * + * _.isFinite(Number.MIN_VALUE); + * // => true + * + * _.isFinite(Infinity); + * // => false + * + * _.isFinite('3'); + * // => false + */ + function isFinite(value) { + return typeof value == 'number' && nativeIsFinite(value); + } + + /** + * Checks if `value` is classified as a `Function` object. + * + * @static + * @memberOf _ + * @since 0.1.0 + * @category Lang + * @param {*} value The value to check. + * @returns {boolean} Returns `true` if `value` is a function, else `false`. + * @example + * + * _.isFunction(_); + * // => true + * + * _.isFunction(/abc/); + * // => false + */ + function isFunction(value) { + if (!isObject(value)) { + return false; + } + // The use of `Object#toString` avoids issues with the `typeof` operator + // in Safari 9 which returns 'object' for typed arrays and other constructors. + var tag = baseGetTag(value); + return tag == funcTag || tag == genTag || tag == asyncTag || tag == proxyTag; + } + + /** + * Checks if `value` is an integer. + * + * **Note:** This method is based on + * [`Number.isInteger`](https://mdn.io/Number/isInteger). + * + * @static + * @memberOf _ + * @since 4.0.0 + * @category Lang + * @param {*} value The value to check. + * @returns {boolean} Returns `true` if `value` is an integer, else `false`. + * @example + * + * _.isInteger(3); + * // => true + * + * _.isInteger(Number.MIN_VALUE); + * // => false + * + * _.isInteger(Infinity); + * // => false + * + * _.isInteger('3'); + * // => false + */ + function isInteger(value) { + return typeof value == 'number' && value == toInteger(value); + } + + /** + * Checks if `value` is a valid array-like length. + * + * **Note:** This method is loosely based on + * [`ToLength`](http://ecma-international.org/ecma-262/7.0/#sec-tolength). + * + * @static + * @memberOf _ + * @since 4.0.0 + * @category Lang + * @param {*} value The value to check. + * @returns {boolean} Returns `true` if `value` is a valid length, else `false`. + * @example + * + * _.isLength(3); + * // => true + * + * _.isLength(Number.MIN_VALUE); + * // => false + * + * _.isLength(Infinity); + * // => false + * + * _.isLength('3'); + * // => false + */ + function isLength(value) { + return typeof value == 'number' && + value > -1 && value % 1 == 0 && value <= MAX_SAFE_INTEGER; + } + + /** + * Checks if `value` is the + * [language type](http://www.ecma-international.org/ecma-262/7.0/#sec-ecmascript-language-types) + * of `Object`. (e.g. arrays, functions, objects, regexes, `new Number(0)`, and `new String('')`) + * + * @static + * @memberOf _ + * @since 0.1.0 + * @category Lang + * @param {*} value The value to check. + * @returns {boolean} Returns `true` if `value` is an object, else `false`. + * @example + * + * _.isObject({}); + * // => true + * + * _.isObject([1, 2, 3]); + * // => true + * + * _.isObject(_.noop); + * // => true + * + * _.isObject(null); + * // => false + */ + function isObject(value) { + var type = typeof value; + return value != null && (type == 'object' || type == 'function'); + } + + /** + * Checks if `value` is object-like. A value is object-like if it's not `null` + * and has a `typeof` result of "object". + * + * @static + * @memberOf _ + * @since 4.0.0 + * @category Lang + * @param {*} value The value to check. + * @returns {boolean} Returns `true` if `value` is object-like, else `false`. + * @example + * + * _.isObjectLike({}); + * // => true + * + * _.isObjectLike([1, 2, 3]); + * // => true + * + * _.isObjectLike(_.noop); + * // => false + * + * _.isObjectLike(null); + * // => false + */ + function isObjectLike(value) { + return value != null && typeof value == 'object'; + } + + /** + * Checks if `value` is classified as a `Map` object. + * + * @static + * @memberOf _ + * @since 4.3.0 + * @category Lang + * @param {*} value The value to check. + * @returns {boolean} Returns `true` if `value` is a map, else `false`. + * @example + * + * _.isMap(new Map); + * // => true + * + * _.isMap(new WeakMap); + * // => false + */ + var isMap = nodeIsMap ? baseUnary(nodeIsMap) : baseIsMap; + + /** + * Performs a partial deep comparison between `object` and `source` to + * determine if `object` contains equivalent property values. + * + * **Note:** This method is equivalent to `_.matches` when `source` is + * partially applied. + * + * Partial comparisons will match empty array and empty object `source` + * values against any array or object value, respectively. See `_.isEqual` + * for a list of supported value comparisons. + * + * @static + * @memberOf _ + * @since 3.0.0 + * @category Lang + * @param {Object} object The object to inspect. + * @param {Object} source The object of property values to match. + * @returns {boolean} Returns `true` if `object` is a match, else `false`. + * @example + * + * var object = { 'a': 1, 'b': 2 }; + * + * _.isMatch(object, { 'b': 2 }); + * // => true + * + * _.isMatch(object, { 'b': 1 }); + * // => false + */ + function isMatch(object, source) { + return object === source || baseIsMatch(object, source, getMatchData(source)); + } + + /** + * This method is like `_.isMatch` except that it accepts `customizer` which + * is invoked to compare values. If `customizer` returns `undefined`, comparisons + * are handled by the method instead. The `customizer` is invoked with five + * arguments: (objValue, srcValue, index|key, object, source). + * + * @static + * @memberOf _ + * @since 4.0.0 + * @category Lang + * @param {Object} object The object to inspect. + * @param {Object} source The object of property values to match. + * @param {Function} [customizer] The function to customize comparisons. + * @returns {boolean} Returns `true` if `object` is a match, else `false`. + * @example + * + * function isGreeting(value) { + * return /^h(?:i|ello)$/.test(value); + * } + * + * function customizer(objValue, srcValue) { + * if (isGreeting(objValue) && isGreeting(srcValue)) { + * return true; + * } + * } + * + * var object = { 'greeting': 'hello' }; + * var source = { 'greeting': 'hi' }; + * + * _.isMatchWith(object, source, customizer); + * // => true + */ + function isMatchWith(object, source, customizer) { + customizer = typeof customizer == 'function' ? customizer : undefined; + return baseIsMatch(object, source, getMatchData(source), customizer); + } + + /** + * Checks if `value` is `NaN`. + * + * **Note:** This method is based on + * [`Number.isNaN`](https://mdn.io/Number/isNaN) and is not the same as + * global [`isNaN`](https://mdn.io/isNaN) which returns `true` for + * `undefined` and other non-number values. + * + * @static + * @memberOf _ + * @since 0.1.0 + * @category Lang + * @param {*} value The value to check. + * @returns {boolean} Returns `true` if `value` is `NaN`, else `false`. + * @example + * + * _.isNaN(NaN); + * // => true + * + * _.isNaN(new Number(NaN)); + * // => true + * + * isNaN(undefined); + * // => true + * + * _.isNaN(undefined); + * // => false + */ + function isNaN(value) { + // An `NaN` primitive is the only value that is not equal to itself. + // Perform the `toStringTag` check first to avoid errors with some + // ActiveX objects in IE. + return isNumber(value) && value != +value; + } + + /** + * Checks if `value` is a pristine native function. + * + * **Note:** This method can't reliably detect native functions in the presence + * of the core-js package because core-js circumvents this kind of detection. + * Despite multiple requests, the core-js maintainer has made it clear: any + * attempt to fix the detection will be obstructed. As a result, we're left + * with little choice but to throw an error. Unfortunately, this also affects + * packages, like [babel-polyfill](https://www.npmjs.com/package/babel-polyfill), + * which rely on core-js. + * + * @static + * @memberOf _ + * @since 3.0.0 + * @category Lang + * @param {*} value The value to check. + * @returns {boolean} Returns `true` if `value` is a native function, + * else `false`. + * @example + * + * _.isNative(Array.prototype.push); + * // => true + * + * _.isNative(_); + * // => false + */ + function isNative(value) { + if (isMaskable(value)) { + throw new Error(CORE_ERROR_TEXT); + } + return baseIsNative(value); + } + + /** + * Checks if `value` is `null`. + * + * @static + * @memberOf _ + * @since 0.1.0 + * @category Lang + * @param {*} value The value to check. + * @returns {boolean} Returns `true` if `value` is `null`, else `false`. + * @example + * + * _.isNull(null); + * // => true + * + * _.isNull(void 0); + * // => false + */ + function isNull(value) { + return value === null; + } + + /** + * Checks if `value` is `null` or `undefined`. + * + * @static + * @memberOf _ + * @since 4.0.0 + * @category Lang + * @param {*} value The value to check. + * @returns {boolean} Returns `true` if `value` is nullish, else `false`. + * @example + * + * _.isNil(null); + * // => true + * + * _.isNil(void 0); + * // => true + * + * _.isNil(NaN); + * // => false + */ + function isNil(value) { + return value == null; + } + + /** + * Checks if `value` is classified as a `Number` primitive or object. + * + * **Note:** To exclude `Infinity`, `-Infinity`, and `NaN`, which are + * classified as numbers, use the `_.isFinite` method. + * + * @static + * @memberOf _ + * @since 0.1.0 + * @category Lang + * @param {*} value The value to check. + * @returns {boolean} Returns `true` if `value` is a number, else `false`. + * @example + * + * _.isNumber(3); + * // => true + * + * _.isNumber(Number.MIN_VALUE); + * // => true + * + * _.isNumber(Infinity); + * // => true + * + * _.isNumber('3'); + * // => false + */ + function isNumber(value) { + return typeof value == 'number' || + (isObjectLike(value) && baseGetTag(value) == numberTag); + } + + /** + * Checks if `value` is a plain object, that is, an object created by the + * `Object` constructor or one with a `[[Prototype]]` of `null`. + * + * @static + * @memberOf _ + * @since 0.8.0 + * @category Lang + * @param {*} value The value to check. + * @returns {boolean} Returns `true` if `value` is a plain object, else `false`. + * @example + * + * function Foo() { + * this.a = 1; + * } + * + * _.isPlainObject(new Foo); + * // => false + * + * _.isPlainObject([1, 2, 3]); + * // => false + * + * _.isPlainObject({ 'x': 0, 'y': 0 }); + * // => true + * + * _.isPlainObject(Object.create(null)); + * // => true + */ + function isPlainObject(value) { + if (!isObjectLike(value) || baseGetTag(value) != objectTag) { + return false; + } + var proto = getPrototype(value); + if (proto === null) { + return true; + } + var Ctor = hasOwnProperty.call(proto, 'constructor') && proto.constructor; + return typeof Ctor == 'function' && Ctor instanceof Ctor && + funcToString.call(Ctor) == objectCtorString; + } + + /** + * Checks if `value` is classified as a `RegExp` object. + * + * @static + * @memberOf _ + * @since 0.1.0 + * @category Lang + * @param {*} value The value to check. + * @returns {boolean} Returns `true` if `value` is a regexp, else `false`. + * @example + * + * _.isRegExp(/abc/); + * // => true + * + * _.isRegExp('/abc/'); + * // => false + */ + var isRegExp = nodeIsRegExp ? baseUnary(nodeIsRegExp) : baseIsRegExp; + + /** + * Checks if `value` is a safe integer. An integer is safe if it's an IEEE-754 + * double precision number which isn't the result of a rounded unsafe integer. + * + * **Note:** This method is based on + * [`Number.isSafeInteger`](https://mdn.io/Number/isSafeInteger). + * + * @static + * @memberOf _ + * @since 4.0.0 + * @category Lang + * @param {*} value The value to check. + * @returns {boolean} Returns `true` if `value` is a safe integer, else `false`. + * @example + * + * _.isSafeInteger(3); + * // => true + * + * _.isSafeInteger(Number.MIN_VALUE); + * // => false + * + * _.isSafeInteger(Infinity); + * // => false + * + * _.isSafeInteger('3'); + * // => false + */ + function isSafeInteger(value) { + return isInteger(value) && value >= -MAX_SAFE_INTEGER && value <= MAX_SAFE_INTEGER; + } + + /** + * Checks if `value` is classified as a `Set` object. + * + * @static + * @memberOf _ + * @since 4.3.0 + * @category Lang + * @param {*} value The value to check. + * @returns {boolean} Returns `true` if `value` is a set, else `false`. + * @example + * + * _.isSet(new Set); + * // => true + * + * _.isSet(new WeakSet); + * // => false + */ + var isSet = nodeIsSet ? baseUnary(nodeIsSet) : baseIsSet; + + /** + * Checks if `value` is classified as a `String` primitive or object. + * + * @static + * @since 0.1.0 + * @memberOf _ + * @category Lang + * @param {*} value The value to check. + * @returns {boolean} Returns `true` if `value` is a string, else `false`. + * @example + * + * _.isString('abc'); + * // => true + * + * _.isString(1); + * // => false + */ + function isString(value) { + return typeof value == 'string' || + (!isArray(value) && isObjectLike(value) && baseGetTag(value) == stringTag); + } + + /** + * Checks if `value` is classified as a `Symbol` primitive or object. + * + * @static + * @memberOf _ + * @since 4.0.0 + * @category Lang + * @param {*} value The value to check. + * @returns {boolean} Returns `true` if `value` is a symbol, else `false`. + * @example + * + * _.isSymbol(Symbol.iterator); + * // => true + * + * _.isSymbol('abc'); + * // => false + */ + function isSymbol(value) { + return typeof value == 'symbol' || + (isObjectLike(value) && baseGetTag(value) == symbolTag); + } + + /** + * Checks if `value` is classified as a typed array. + * + * @static + * @memberOf _ + * @since 3.0.0 + * @category Lang + * @param {*} value The value to check. + * @returns {boolean} Returns `true` if `value` is a typed array, else `false`. + * @example + * + * _.isTypedArray(new Uint8Array); + * // => true + * + * _.isTypedArray([]); + * // => false + */ + var isTypedArray = nodeIsTypedArray ? baseUnary(nodeIsTypedArray) : baseIsTypedArray; + + /** + * Checks if `value` is `undefined`. + * + * @static + * @since 0.1.0 + * @memberOf _ + * @category Lang + * @param {*} value The value to check. + * @returns {boolean} Returns `true` if `value` is `undefined`, else `false`. + * @example + * + * _.isUndefined(void 0); + * // => true + * + * _.isUndefined(null); + * // => false + */ + function isUndefined(value) { + return value === undefined; + } + + /** + * Checks if `value` is classified as a `WeakMap` object. + * + * @static + * @memberOf _ + * @since 4.3.0 + * @category Lang + * @param {*} value The value to check. + * @returns {boolean} Returns `true` if `value` is a weak map, else `false`. + * @example + * + * _.isWeakMap(new WeakMap); + * // => true + * + * _.isWeakMap(new Map); + * // => false + */ + function isWeakMap(value) { + return isObjectLike(value) && getTag(value) == weakMapTag; + } + + /** + * Checks if `value` is classified as a `WeakSet` object. + * + * @static + * @memberOf _ + * @since 4.3.0 + * @category Lang + * @param {*} value The value to check. + * @returns {boolean} Returns `true` if `value` is a weak set, else `false`. + * @example + * + * _.isWeakSet(new WeakSet); + * // => true + * + * _.isWeakSet(new Set); + * // => false + */ + function isWeakSet(value) { + return isObjectLike(value) && baseGetTag(value) == weakSetTag; + } + + /** + * Checks if `value` is less than `other`. + * + * @static + * @memberOf _ + * @since 3.9.0 + * @category Lang + * @param {*} value The value to compare. + * @param {*} other The other value to compare. + * @returns {boolean} Returns `true` if `value` is less than `other`, + * else `false`. + * @see _.gt + * @example + * + * _.lt(1, 3); + * // => true + * + * _.lt(3, 3); + * // => false + * + * _.lt(3, 1); + * // => false + */ + var lt = createRelationalOperation(baseLt); + + /** + * Checks if `value` is less than or equal to `other`. + * + * @static + * @memberOf _ + * @since 3.9.0 + * @category Lang + * @param {*} value The value to compare. + * @param {*} other The other value to compare. + * @returns {boolean} Returns `true` if `value` is less than or equal to + * `other`, else `false`. + * @see _.gte + * @example + * + * _.lte(1, 3); + * // => true + * + * _.lte(3, 3); + * // => true + * + * _.lte(3, 1); + * // => false + */ + var lte = createRelationalOperation(function(value, other) { + return value <= other; + }); + + /** + * Converts `value` to an array. + * + * @static + * @since 0.1.0 + * @memberOf _ + * @category Lang + * @param {*} value The value to convert. + * @returns {Array} Returns the converted array. + * @example + * + * _.toArray({ 'a': 1, 'b': 2 }); + * // => [1, 2] + * + * _.toArray('abc'); + * // => ['a', 'b', 'c'] + * + * _.toArray(1); + * // => [] + * + * _.toArray(null); + * // => [] + */ + function toArray(value) { + if (!value) { + return []; + } + if (isArrayLike(value)) { + return isString(value) ? stringToArray(value) : copyArray(value); + } + if (symIterator && value[symIterator]) { + return iteratorToArray(value[symIterator]()); + } + var tag = getTag(value), + func = tag == mapTag ? mapToArray : (tag == setTag ? setToArray : values); + + return func(value); + } + + /** + * Converts `value` to a finite number. + * + * @static + * @memberOf _ + * @since 4.12.0 + * @category Lang + * @param {*} value The value to convert. + * @returns {number} Returns the converted number. + * @example + * + * _.toFinite(3.2); + * // => 3.2 + * + * _.toFinite(Number.MIN_VALUE); + * // => 5e-324 + * + * _.toFinite(Infinity); + * // => 1.7976931348623157e+308 + * + * _.toFinite('3.2'); + * // => 3.2 + */ + function toFinite(value) { + if (!value) { + return value === 0 ? value : 0; + } + value = toNumber(value); + if (value === INFINITY || value === -INFINITY) { + var sign = (value < 0 ? -1 : 1); + return sign * MAX_INTEGER; + } + return value === value ? value : 0; + } + + /** + * Converts `value` to an integer. + * + * **Note:** This method is loosely based on + * [`ToInteger`](http://www.ecma-international.org/ecma-262/7.0/#sec-tointeger). + * + * @static + * @memberOf _ + * @since 4.0.0 + * @category Lang + * @param {*} value The value to convert. + * @returns {number} Returns the converted integer. + * @example + * + * _.toInteger(3.2); + * // => 3 + * + * _.toInteger(Number.MIN_VALUE); + * // => 0 + * + * _.toInteger(Infinity); + * // => 1.7976931348623157e+308 + * + * _.toInteger('3.2'); + * // => 3 + */ + function toInteger(value) { + var result = toFinite(value), + remainder = result % 1; + + return result === result ? (remainder ? result - remainder : result) : 0; + } + + /** + * Converts `value` to an integer suitable for use as the length of an + * array-like object. + * + * **Note:** This method is based on + * [`ToLength`](http://ecma-international.org/ecma-262/7.0/#sec-tolength). + * + * @static + * @memberOf _ + * @since 4.0.0 + * @category Lang + * @param {*} value The value to convert. + * @returns {number} Returns the converted integer. + * @example + * + * _.toLength(3.2); + * // => 3 + * + * _.toLength(Number.MIN_VALUE); + * // => 0 + * + * _.toLength(Infinity); + * // => 4294967295 + * + * _.toLength('3.2'); + * // => 3 + */ + function toLength(value) { + return value ? baseClamp(toInteger(value), 0, MAX_ARRAY_LENGTH) : 0; + } + + /** + * Converts `value` to a number. + * + * @static + * @memberOf _ + * @since 4.0.0 + * @category Lang + * @param {*} value The value to process. + * @returns {number} Returns the number. + * @example + * + * _.toNumber(3.2); + * // => 3.2 + * + * _.toNumber(Number.MIN_VALUE); + * // => 5e-324 + * + * _.toNumber(Infinity); + * // => Infinity + * + * _.toNumber('3.2'); + * // => 3.2 + */ + function toNumber(value) { + if (typeof value == 'number') { + return value; + } + if (isSymbol(value)) { + return NAN; + } + if (isObject(value)) { + var other = typeof value.valueOf == 'function' ? value.valueOf() : value; + value = isObject(other) ? (other + '') : other; + } + if (typeof value != 'string') { + return value === 0 ? value : +value; + } + value = baseTrim(value); + var isBinary = reIsBinary.test(value); + return (isBinary || reIsOctal.test(value)) + ? freeParseInt(value.slice(2), isBinary ? 2 : 8) + : (reIsBadHex.test(value) ? NAN : +value); + } + + /** + * Converts `value` to a plain object flattening inherited enumerable string + * keyed properties of `value` to own properties of the plain object. + * + * @static + * @memberOf _ + * @since 3.0.0 + * @category Lang + * @param {*} value The value to convert. + * @returns {Object} Returns the converted plain object. + * @example + * + * function Foo() { + * this.b = 2; + * } + * + * Foo.prototype.c = 3; + * + * _.assign({ 'a': 1 }, new Foo); + * // => { 'a': 1, 'b': 2 } + * + * _.assign({ 'a': 1 }, _.toPlainObject(new Foo)); + * // => { 'a': 1, 'b': 2, 'c': 3 } + */ + function toPlainObject(value) { + return copyObject(value, keysIn(value)); + } + + /** + * Converts `value` to a safe integer. A safe integer can be compared and + * represented correctly. + * + * @static + * @memberOf _ + * @since 4.0.0 + * @category Lang + * @param {*} value The value to convert. + * @returns {number} Returns the converted integer. + * @example + * + * _.toSafeInteger(3.2); + * // => 3 + * + * _.toSafeInteger(Number.MIN_VALUE); + * // => 0 + * + * _.toSafeInteger(Infinity); + * // => 9007199254740991 + * + * _.toSafeInteger('3.2'); + * // => 3 + */ + function toSafeInteger(value) { + return value + ? baseClamp(toInteger(value), -MAX_SAFE_INTEGER, MAX_SAFE_INTEGER) + : (value === 0 ? value : 0); + } + + /** + * Converts `value` to a string. An empty string is returned for `null` + * and `undefined` values. The sign of `-0` is preserved. + * + * @static + * @memberOf _ + * @since 4.0.0 + * @category Lang + * @param {*} value The value to convert. + * @returns {string} Returns the converted string. + * @example + * + * _.toString(null); + * // => '' + * + * _.toString(-0); + * // => '-0' + * + * _.toString([1, 2, 3]); + * // => '1,2,3' + */ + function toString(value) { + return value == null ? '' : baseToString(value); + } + + /*------------------------------------------------------------------------*/ + + /** + * Assigns own enumerable string keyed properties of source objects to the + * destination object. Source objects are applied from left to right. + * Subsequent sources overwrite property assignments of previous sources. + * + * **Note:** This method mutates `object` and is loosely based on + * [`Object.assign`](https://mdn.io/Object/assign). + * + * @static + * @memberOf _ + * @since 0.10.0 + * @category Object + * @param {Object} object The destination object. + * @param {...Object} [sources] The source objects. + * @returns {Object} Returns `object`. + * @see _.assignIn + * @example + * + * function Foo() { + * this.a = 1; + * } + * + * function Bar() { + * this.c = 3; + * } + * + * Foo.prototype.b = 2; + * Bar.prototype.d = 4; + * + * _.assign({ 'a': 0 }, new Foo, new Bar); + * // => { 'a': 1, 'c': 3 } + */ + var assign = createAssigner(function(object, source) { + if (isPrototype(source) || isArrayLike(source)) { + copyObject(source, keys(source), object); + return; + } + for (var key in source) { + if (hasOwnProperty.call(source, key)) { + assignValue(object, key, source[key]); + } + } + }); + + /** + * This method is like `_.assign` except that it iterates over own and + * inherited source properties. + * + * **Note:** This method mutates `object`. + * + * @static + * @memberOf _ + * @since 4.0.0 + * @alias extend + * @category Object + * @param {Object} object The destination object. + * @param {...Object} [sources] The source objects. + * @returns {Object} Returns `object`. + * @see _.assign + * @example + * + * function Foo() { + * this.a = 1; + * } + * + * function Bar() { + * this.c = 3; + * } + * + * Foo.prototype.b = 2; + * Bar.prototype.d = 4; + * + * _.assignIn({ 'a': 0 }, new Foo, new Bar); + * // => { 'a': 1, 'b': 2, 'c': 3, 'd': 4 } + */ + var assignIn = createAssigner(function(object, source) { + copyObject(source, keysIn(source), object); + }); + + /** + * This method is like `_.assignIn` except that it accepts `customizer` + * which is invoked to produce the assigned values. If `customizer` returns + * `undefined`, assignment is handled by the method instead. The `customizer` + * is invoked with five arguments: (objValue, srcValue, key, object, source). + * + * **Note:** This method mutates `object`. + * + * @static + * @memberOf _ + * @since 4.0.0 + * @alias extendWith + * @category Object + * @param {Object} object The destination object. + * @param {...Object} sources The source objects. + * @param {Function} [customizer] The function to customize assigned values. + * @returns {Object} Returns `object`. + * @see _.assignWith + * @example + * + * function customizer(objValue, srcValue) { + * return _.isUndefined(objValue) ? srcValue : objValue; + * } + * + * var defaults = _.partialRight(_.assignInWith, customizer); + * + * defaults({ 'a': 1 }, { 'b': 2 }, { 'a': 3 }); + * // => { 'a': 1, 'b': 2 } + */ + var assignInWith = createAssigner(function(object, source, srcIndex, customizer) { + copyObject(source, keysIn(source), object, customizer); + }); + + /** + * This method is like `_.assign` except that it accepts `customizer` + * which is invoked to produce the assigned values. If `customizer` returns + * `undefined`, assignment is handled by the method instead. The `customizer` + * is invoked with five arguments: (objValue, srcValue, key, object, source). + * + * **Note:** This method mutates `object`. + * + * @static + * @memberOf _ + * @since 4.0.0 + * @category Object + * @param {Object} object The destination object. + * @param {...Object} sources The source objects. + * @param {Function} [customizer] The function to customize assigned values. + * @returns {Object} Returns `object`. + * @see _.assignInWith + * @example + * + * function customizer(objValue, srcValue) { + * return _.isUndefined(objValue) ? srcValue : objValue; + * } + * + * var defaults = _.partialRight(_.assignWith, customizer); + * + * defaults({ 'a': 1 }, { 'b': 2 }, { 'a': 3 }); + * // => { 'a': 1, 'b': 2 } + */ + var assignWith = createAssigner(function(object, source, srcIndex, customizer) { + copyObject(source, keys(source), object, customizer); + }); + + /** + * Creates an array of values corresponding to `paths` of `object`. + * + * @static + * @memberOf _ + * @since 1.0.0 + * @category Object + * @param {Object} object The object to iterate over. + * @param {...(string|string[])} [paths] The property paths to pick. + * @returns {Array} Returns the picked values. + * @example + * + * var object = { 'a': [{ 'b': { 'c': 3 } }, 4] }; + * + * _.at(object, ['a[0].b.c', 'a[1]']); + * // => [3, 4] + */ + var at = flatRest(baseAt); + + /** + * Creates an object that inherits from the `prototype` object. If a + * `properties` object is given, its own enumerable string keyed properties + * are assigned to the created object. + * + * @static + * @memberOf _ + * @since 2.3.0 + * @category Object + * @param {Object} prototype The object to inherit from. + * @param {Object} [properties] The properties to assign to the object. + * @returns {Object} Returns the new object. + * @example + * + * function Shape() { + * this.x = 0; + * this.y = 0; + * } + * + * function Circle() { + * Shape.call(this); + * } + * + * Circle.prototype = _.create(Shape.prototype, { + * 'constructor': Circle + * }); + * + * var circle = new Circle; + * circle instanceof Circle; + * // => true + * + * circle instanceof Shape; + * // => true + */ + function create(prototype, properties) { + var result = baseCreate(prototype); + return properties == null ? result : baseAssign(result, properties); + } + + /** + * Assigns own and inherited enumerable string keyed properties of source + * objects to the destination object for all destination properties that + * resolve to `undefined`. Source objects are applied from left to right. + * Once a property is set, additional values of the same property are ignored. + * + * **Note:** This method mutates `object`. + * + * @static + * @since 0.1.0 + * @memberOf _ + * @category Object + * @param {Object} object The destination object. + * @param {...Object} [sources] The source objects. + * @returns {Object} Returns `object`. + * @see _.defaultsDeep + * @example + * + * _.defaults({ 'a': 1 }, { 'b': 2 }, { 'a': 3 }); + * // => { 'a': 1, 'b': 2 } + */ + var defaults = baseRest(function(object, sources) { + object = Object(object); + + var index = -1; + var length = sources.length; + var guard = length > 2 ? sources[2] : undefined; + + if (guard && isIterateeCall(sources[0], sources[1], guard)) { + length = 1; + } + + while (++index < length) { + var source = sources[index]; + var props = keysIn(source); + var propsIndex = -1; + var propsLength = props.length; + + while (++propsIndex < propsLength) { + var key = props[propsIndex]; + var value = object[key]; + + if (value === undefined || + (eq(value, objectProto[key]) && !hasOwnProperty.call(object, key))) { + object[key] = source[key]; + } + } + } + + return object; + }); + + /** + * This method is like `_.defaults` except that it recursively assigns + * default properties. + * + * **Note:** This method mutates `object`. + * + * @static + * @memberOf _ + * @since 3.10.0 + * @category Object + * @param {Object} object The destination object. + * @param {...Object} [sources] The source objects. + * @returns {Object} Returns `object`. + * @see _.defaults + * @example + * + * _.defaultsDeep({ 'a': { 'b': 2 } }, { 'a': { 'b': 1, 'c': 3 } }); + * // => { 'a': { 'b': 2, 'c': 3 } } + */ + var defaultsDeep = baseRest(function(args) { + args.push(undefined, customDefaultsMerge); + return apply(mergeWith, undefined, args); + }); + + /** + * This method is like `_.find` except that it returns the key of the first + * element `predicate` returns truthy for instead of the element itself. + * + * @static + * @memberOf _ + * @since 1.1.0 + * @category Object + * @param {Object} object The object to inspect. + * @param {Function} [predicate=_.identity] The function invoked per iteration. + * @returns {string|undefined} Returns the key of the matched element, + * else `undefined`. + * @example + * + * var users = { + * 'barney': { 'age': 36, 'active': true }, + * 'fred': { 'age': 40, 'active': false }, + * 'pebbles': { 'age': 1, 'active': true } + * }; + * + * _.findKey(users, function(o) { return o.age < 40; }); + * // => 'barney' (iteration order is not guaranteed) + * + * // The `_.matches` iteratee shorthand. + * _.findKey(users, { 'age': 1, 'active': true }); + * // => 'pebbles' + * + * // The `_.matchesProperty` iteratee shorthand. + * _.findKey(users, ['active', false]); + * // => 'fred' + * + * // The `_.property` iteratee shorthand. + * _.findKey(users, 'active'); + * // => 'barney' + */ + function findKey(object, predicate) { + return baseFindKey(object, getIteratee(predicate, 3), baseForOwn); + } + + /** + * This method is like `_.findKey` except that it iterates over elements of + * a collection in the opposite order. + * + * @static + * @memberOf _ + * @since 2.0.0 + * @category Object + * @param {Object} object The object to inspect. + * @param {Function} [predicate=_.identity] The function invoked per iteration. + * @returns {string|undefined} Returns the key of the matched element, + * else `undefined`. + * @example + * + * var users = { + * 'barney': { 'age': 36, 'active': true }, + * 'fred': { 'age': 40, 'active': false }, + * 'pebbles': { 'age': 1, 'active': true } + * }; + * + * _.findLastKey(users, function(o) { return o.age < 40; }); + * // => returns 'pebbles' assuming `_.findKey` returns 'barney' + * + * // The `_.matches` iteratee shorthand. + * _.findLastKey(users, { 'age': 36, 'active': true }); + * // => 'barney' + * + * // The `_.matchesProperty` iteratee shorthand. + * _.findLastKey(users, ['active', false]); + * // => 'fred' + * + * // The `_.property` iteratee shorthand. + * _.findLastKey(users, 'active'); + * // => 'pebbles' + */ + function findLastKey(object, predicate) { + return baseFindKey(object, getIteratee(predicate, 3), baseForOwnRight); + } + + /** + * Iterates over own and inherited enumerable string keyed properties of an + * object and invokes `iteratee` for each property. The iteratee is invoked + * with three arguments: (value, key, object). Iteratee functions may exit + * iteration early by explicitly returning `false`. + * + * @static + * @memberOf _ + * @since 0.3.0 + * @category Object + * @param {Object} object The object to iterate over. + * @param {Function} [iteratee=_.identity] The function invoked per iteration. + * @returns {Object} Returns `object`. + * @see _.forInRight + * @example + * + * function Foo() { + * this.a = 1; + * this.b = 2; + * } + * + * Foo.prototype.c = 3; + * + * _.forIn(new Foo, function(value, key) { + * console.log(key); + * }); + * // => Logs 'a', 'b', then 'c' (iteration order is not guaranteed). + */ + function forIn(object, iteratee) { + return object == null + ? object + : baseFor(object, getIteratee(iteratee, 3), keysIn); + } + + /** + * This method is like `_.forIn` except that it iterates over properties of + * `object` in the opposite order. + * + * @static + * @memberOf _ + * @since 2.0.0 + * @category Object + * @param {Object} object The object to iterate over. + * @param {Function} [iteratee=_.identity] The function invoked per iteration. + * @returns {Object} Returns `object`. + * @see _.forIn + * @example + * + * function Foo() { + * this.a = 1; + * this.b = 2; + * } + * + * Foo.prototype.c = 3; + * + * _.forInRight(new Foo, function(value, key) { + * console.log(key); + * }); + * // => Logs 'c', 'b', then 'a' assuming `_.forIn` logs 'a', 'b', then 'c'. + */ + function forInRight(object, iteratee) { + return object == null + ? object + : baseForRight(object, getIteratee(iteratee, 3), keysIn); + } + + /** + * Iterates over own enumerable string keyed properties of an object and + * invokes `iteratee` for each property. The iteratee is invoked with three + * arguments: (value, key, object). Iteratee functions may exit iteration + * early by explicitly returning `false`. + * + * @static + * @memberOf _ + * @since 0.3.0 + * @category Object + * @param {Object} object The object to iterate over. + * @param {Function} [iteratee=_.identity] The function invoked per iteration. + * @returns {Object} Returns `object`. + * @see _.forOwnRight + * @example + * + * function Foo() { + * this.a = 1; + * this.b = 2; + * } + * + * Foo.prototype.c = 3; + * + * _.forOwn(new Foo, function(value, key) { + * console.log(key); + * }); + * // => Logs 'a' then 'b' (iteration order is not guaranteed). + */ + function forOwn(object, iteratee) { + return object && baseForOwn(object, getIteratee(iteratee, 3)); + } + + /** + * This method is like `_.forOwn` except that it iterates over properties of + * `object` in the opposite order. + * + * @static + * @memberOf _ + * @since 2.0.0 + * @category Object + * @param {Object} object The object to iterate over. + * @param {Function} [iteratee=_.identity] The function invoked per iteration. + * @returns {Object} Returns `object`. + * @see _.forOwn + * @example + * + * function Foo() { + * this.a = 1; + * this.b = 2; + * } + * + * Foo.prototype.c = 3; + * + * _.forOwnRight(new Foo, function(value, key) { + * console.log(key); + * }); + * // => Logs 'b' then 'a' assuming `_.forOwn` logs 'a' then 'b'. + */ + function forOwnRight(object, iteratee) { + return object && baseForOwnRight(object, getIteratee(iteratee, 3)); + } + + /** + * Creates an array of function property names from own enumerable properties + * of `object`. + * + * @static + * @since 0.1.0 + * @memberOf _ + * @category Object + * @param {Object} object The object to inspect. + * @returns {Array} Returns the function names. + * @see _.functionsIn + * @example + * + * function Foo() { + * this.a = _.constant('a'); + * this.b = _.constant('b'); + * } + * + * Foo.prototype.c = _.constant('c'); + * + * _.functions(new Foo); + * // => ['a', 'b'] + */ + function functions(object) { + return object == null ? [] : baseFunctions(object, keys(object)); + } + + /** + * Creates an array of function property names from own and inherited + * enumerable properties of `object`. + * + * @static + * @memberOf _ + * @since 4.0.0 + * @category Object + * @param {Object} object The object to inspect. + * @returns {Array} Returns the function names. + * @see _.functions + * @example + * + * function Foo() { + * this.a = _.constant('a'); + * this.b = _.constant('b'); + * } + * + * Foo.prototype.c = _.constant('c'); + * + * _.functionsIn(new Foo); + * // => ['a', 'b', 'c'] + */ + function functionsIn(object) { + return object == null ? [] : baseFunctions(object, keysIn(object)); + } + + /** + * Gets the value at `path` of `object`. If the resolved value is + * `undefined`, the `defaultValue` is returned in its place. + * + * @static + * @memberOf _ + * @since 3.7.0 + * @category Object + * @param {Object} object The object to query. + * @param {Array|string} path The path of the property to get. + * @param {*} [defaultValue] The value returned for `undefined` resolved values. + * @returns {*} Returns the resolved value. + * @example + * + * var object = { 'a': [{ 'b': { 'c': 3 } }] }; + * + * _.get(object, 'a[0].b.c'); + * // => 3 + * + * _.get(object, ['a', '0', 'b', 'c']); + * // => 3 + * + * _.get(object, 'a.b.c', 'default'); + * // => 'default' + */ + function get(object, path, defaultValue) { + var result = object == null ? undefined : baseGet(object, path); + return result === undefined ? defaultValue : result; + } + + /** + * Checks if `path` is a direct property of `object`. + * + * @static + * @since 0.1.0 + * @memberOf _ + * @category Object + * @param {Object} object The object to query. + * @param {Array|string} path The path to check. + * @returns {boolean} Returns `true` if `path` exists, else `false`. + * @example + * + * var object = { 'a': { 'b': 2 } }; + * var other = _.create({ 'a': _.create({ 'b': 2 }) }); + * + * _.has(object, 'a'); + * // => true + * + * _.has(object, 'a.b'); + * // => true + * + * _.has(object, ['a', 'b']); + * // => true + * + * _.has(other, 'a'); + * // => false + */ + function has(object, path) { + return object != null && hasPath(object, path, baseHas); + } + + /** + * Checks if `path` is a direct or inherited property of `object`. + * + * @static + * @memberOf _ + * @since 4.0.0 + * @category Object + * @param {Object} object The object to query. + * @param {Array|string} path The path to check. + * @returns {boolean} Returns `true` if `path` exists, else `false`. + * @example + * + * var object = _.create({ 'a': _.create({ 'b': 2 }) }); + * + * _.hasIn(object, 'a'); + * // => true + * + * _.hasIn(object, 'a.b'); + * // => true + * + * _.hasIn(object, ['a', 'b']); + * // => true + * + * _.hasIn(object, 'b'); + * // => false + */ + function hasIn(object, path) { + return object != null && hasPath(object, path, baseHasIn); + } + + /** + * Creates an object composed of the inverted keys and values of `object`. + * If `object` contains duplicate values, subsequent values overwrite + * property assignments of previous values. + * + * @static + * @memberOf _ + * @since 0.7.0 + * @category Object + * @param {Object} object The object to invert. + * @returns {Object} Returns the new inverted object. + * @example + * + * var object = { 'a': 1, 'b': 2, 'c': 1 }; + * + * _.invert(object); + * // => { '1': 'c', '2': 'b' } + */ + var invert = createInverter(function(result, value, key) { + if (value != null && + typeof value.toString != 'function') { + value = nativeObjectToString.call(value); + } + + result[value] = key; + }, constant(identity)); + + /** + * This method is like `_.invert` except that the inverted object is generated + * from the results of running each element of `object` thru `iteratee`. The + * corresponding inverted value of each inverted key is an array of keys + * responsible for generating the inverted value. The iteratee is invoked + * with one argument: (value). + * + * @static + * @memberOf _ + * @since 4.1.0 + * @category Object + * @param {Object} object The object to invert. + * @param {Function} [iteratee=_.identity] The iteratee invoked per element. + * @returns {Object} Returns the new inverted object. + * @example + * + * var object = { 'a': 1, 'b': 2, 'c': 1 }; + * + * _.invertBy(object); + * // => { '1': ['a', 'c'], '2': ['b'] } + * + * _.invertBy(object, function(value) { + * return 'group' + value; + * }); + * // => { 'group1': ['a', 'c'], 'group2': ['b'] } + */ + var invertBy = createInverter(function(result, value, key) { + if (value != null && + typeof value.toString != 'function') { + value = nativeObjectToString.call(value); + } + + if (hasOwnProperty.call(result, value)) { + result[value].push(key); + } else { + result[value] = [key]; + } + }, getIteratee); + + /** + * Invokes the method at `path` of `object`. + * + * @static + * @memberOf _ + * @since 4.0.0 + * @category Object + * @param {Object} object The object to query. + * @param {Array|string} path The path of the method to invoke. + * @param {...*} [args] The arguments to invoke the method with. + * @returns {*} Returns the result of the invoked method. + * @example + * + * var object = { 'a': [{ 'b': { 'c': [1, 2, 3, 4] } }] }; + * + * _.invoke(object, 'a[0].b.c.slice', 1, 3); + * // => [2, 3] + */ + var invoke = baseRest(baseInvoke); + + /** + * Creates an array of the own enumerable property names of `object`. + * + * **Note:** Non-object values are coerced to objects. See the + * [ES spec](http://ecma-international.org/ecma-262/7.0/#sec-object.keys) + * for more details. + * + * @static + * @since 0.1.0 + * @memberOf _ + * @category Object + * @param {Object} object The object to query. + * @returns {Array} Returns the array of property names. + * @example + * + * function Foo() { + * this.a = 1; + * this.b = 2; + * } + * + * Foo.prototype.c = 3; + * + * _.keys(new Foo); + * // => ['a', 'b'] (iteration order is not guaranteed) + * + * _.keys('hi'); + * // => ['0', '1'] + */ + function keys(object) { + return isArrayLike(object) ? arrayLikeKeys(object) : baseKeys(object); + } + + /** + * Creates an array of the own and inherited enumerable property names of `object`. + * + * **Note:** Non-object values are coerced to objects. + * + * @static + * @memberOf _ + * @since 3.0.0 + * @category Object + * @param {Object} object The object to query. + * @returns {Array} Returns the array of property names. + * @example + * + * function Foo() { + * this.a = 1; + * this.b = 2; + * } + * + * Foo.prototype.c = 3; + * + * _.keysIn(new Foo); + * // => ['a', 'b', 'c'] (iteration order is not guaranteed) + */ + function keysIn(object) { + return isArrayLike(object) ? arrayLikeKeys(object, true) : baseKeysIn(object); + } + + /** + * The opposite of `_.mapValues`; this method creates an object with the + * same values as `object` and keys generated by running each own enumerable + * string keyed property of `object` thru `iteratee`. The iteratee is invoked + * with three arguments: (value, key, object). + * + * @static + * @memberOf _ + * @since 3.8.0 + * @category Object + * @param {Object} object The object to iterate over. + * @param {Function} [iteratee=_.identity] The function invoked per iteration. + * @returns {Object} Returns the new mapped object. + * @see _.mapValues + * @example + * + * _.mapKeys({ 'a': 1, 'b': 2 }, function(value, key) { + * return key + value; + * }); + * // => { 'a1': 1, 'b2': 2 } + */ + function mapKeys(object, iteratee) { + var result = {}; + iteratee = getIteratee(iteratee, 3); + + baseForOwn(object, function(value, key, object) { + baseAssignValue(result, iteratee(value, key, object), value); + }); + return result; + } + + /** + * Creates an object with the same keys as `object` and values generated + * by running each own enumerable string keyed property of `object` thru + * `iteratee`. The iteratee is invoked with three arguments: + * (value, key, object). + * + * @static + * @memberOf _ + * @since 2.4.0 + * @category Object + * @param {Object} object The object to iterate over. + * @param {Function} [iteratee=_.identity] The function invoked per iteration. + * @returns {Object} Returns the new mapped object. + * @see _.mapKeys + * @example + * + * var users = { + * 'fred': { 'user': 'fred', 'age': 40 }, + * 'pebbles': { 'user': 'pebbles', 'age': 1 } + * }; + * + * _.mapValues(users, function(o) { return o.age; }); + * // => { 'fred': 40, 'pebbles': 1 } (iteration order is not guaranteed) + * + * // The `_.property` iteratee shorthand. + * _.mapValues(users, 'age'); + * // => { 'fred': 40, 'pebbles': 1 } (iteration order is not guaranteed) + */ + function mapValues(object, iteratee) { + var result = {}; + iteratee = getIteratee(iteratee, 3); + + baseForOwn(object, function(value, key, object) { + baseAssignValue(result, key, iteratee(value, key, object)); + }); + return result; + } + + /** + * This method is like `_.assign` except that it recursively merges own and + * inherited enumerable string keyed properties of source objects into the + * destination object. Source properties that resolve to `undefined` are + * skipped if a destination value exists. Array and plain object properties + * are merged recursively. Other objects and value types are overridden by + * assignment. Source objects are applied from left to right. Subsequent + * sources overwrite property assignments of previous sources. + * + * **Note:** This method mutates `object`. + * + * @static + * @memberOf _ + * @since 0.5.0 + * @category Object + * @param {Object} object The destination object. + * @param {...Object} [sources] The source objects. + * @returns {Object} Returns `object`. + * @example + * + * var object = { + * 'a': [{ 'b': 2 }, { 'd': 4 }] + * }; + * + * var other = { + * 'a': [{ 'c': 3 }, { 'e': 5 }] + * }; + * + * _.merge(object, other); + * // => { 'a': [{ 'b': 2, 'c': 3 }, { 'd': 4, 'e': 5 }] } + */ + var merge = createAssigner(function(object, source, srcIndex) { + baseMerge(object, source, srcIndex); + }); + + /** + * This method is like `_.merge` except that it accepts `customizer` which + * is invoked to produce the merged values of the destination and source + * properties. If `customizer` returns `undefined`, merging is handled by the + * method instead. The `customizer` is invoked with six arguments: + * (objValue, srcValue, key, object, source, stack). + * + * **Note:** This method mutates `object`. + * + * @static + * @memberOf _ + * @since 4.0.0 + * @category Object + * @param {Object} object The destination object. + * @param {...Object} sources The source objects. + * @param {Function} customizer The function to customize assigned values. + * @returns {Object} Returns `object`. + * @example + * + * function customizer(objValue, srcValue) { + * if (_.isArray(objValue)) { + * return objValue.concat(srcValue); + * } + * } + * + * var object = { 'a': [1], 'b': [2] }; + * var other = { 'a': [3], 'b': [4] }; + * + * _.mergeWith(object, other, customizer); + * // => { 'a': [1, 3], 'b': [2, 4] } + */ + var mergeWith = createAssigner(function(object, source, srcIndex, customizer) { + baseMerge(object, source, srcIndex, customizer); + }); + + /** + * The opposite of `_.pick`; this method creates an object composed of the + * own and inherited enumerable property paths of `object` that are not omitted. + * + * **Note:** This method is considerably slower than `_.pick`. + * + * @static + * @since 0.1.0 + * @memberOf _ + * @category Object + * @param {Object} object The source object. + * @param {...(string|string[])} [paths] The property paths to omit. + * @returns {Object} Returns the new object. + * @example + * + * var object = { 'a': 1, 'b': '2', 'c': 3 }; + * + * _.omit(object, ['a', 'c']); + * // => { 'b': '2' } + */ + var omit = flatRest(function(object, paths) { + var result = {}; + if (object == null) { + return result; + } + var isDeep = false; + paths = arrayMap(paths, function(path) { + path = castPath(path, object); + isDeep || (isDeep = path.length > 1); + return path; + }); + copyObject(object, getAllKeysIn(object), result); + if (isDeep) { + result = baseClone(result, CLONE_DEEP_FLAG | CLONE_FLAT_FLAG | CLONE_SYMBOLS_FLAG, customOmitClone); + } + var length = paths.length; + while (length--) { + baseUnset(result, paths[length]); + } + return result; + }); + + /** + * The opposite of `_.pickBy`; this method creates an object composed of + * the own and inherited enumerable string keyed properties of `object` that + * `predicate` doesn't return truthy for. The predicate is invoked with two + * arguments: (value, key). + * + * @static + * @memberOf _ + * @since 4.0.0 + * @category Object + * @param {Object} object The source object. + * @param {Function} [predicate=_.identity] The function invoked per property. + * @returns {Object} Returns the new object. + * @example + * + * var object = { 'a': 1, 'b': '2', 'c': 3 }; + * + * _.omitBy(object, _.isNumber); + * // => { 'b': '2' } + */ + function omitBy(object, predicate) { + return pickBy(object, negate(getIteratee(predicate))); + } + + /** + * Creates an object composed of the picked `object` properties. + * + * @static + * @since 0.1.0 + * @memberOf _ + * @category Object + * @param {Object} object The source object. + * @param {...(string|string[])} [paths] The property paths to pick. + * @returns {Object} Returns the new object. + * @example + * + * var object = { 'a': 1, 'b': '2', 'c': 3 }; + * + * _.pick(object, ['a', 'c']); + * // => { 'a': 1, 'c': 3 } + */ + var pick = flatRest(function(object, paths) { + return object == null ? {} : basePick(object, paths); + }); + + /** + * Creates an object composed of the `object` properties `predicate` returns + * truthy for. The predicate is invoked with two arguments: (value, key). + * + * @static + * @memberOf _ + * @since 4.0.0 + * @category Object + * @param {Object} object The source object. + * @param {Function} [predicate=_.identity] The function invoked per property. + * @returns {Object} Returns the new object. + * @example + * + * var object = { 'a': 1, 'b': '2', 'c': 3 }; + * + * _.pickBy(object, _.isNumber); + * // => { 'a': 1, 'c': 3 } + */ + function pickBy(object, predicate) { + if (object == null) { + return {}; + } + var props = arrayMap(getAllKeysIn(object), function(prop) { + return [prop]; + }); + predicate = getIteratee(predicate); + return basePickBy(object, props, function(value, path) { + return predicate(value, path[0]); + }); + } + + /** + * This method is like `_.get` except that if the resolved value is a + * function it's invoked with the `this` binding of its parent object and + * its result is returned. + * + * @static + * @since 0.1.0 + * @memberOf _ + * @category Object + * @param {Object} object The object to query. + * @param {Array|string} path The path of the property to resolve. + * @param {*} [defaultValue] The value returned for `undefined` resolved values. + * @returns {*} Returns the resolved value. + * @example + * + * var object = { 'a': [{ 'b': { 'c1': 3, 'c2': _.constant(4) } }] }; + * + * _.result(object, 'a[0].b.c1'); + * // => 3 + * + * _.result(object, 'a[0].b.c2'); + * // => 4 + * + * _.result(object, 'a[0].b.c3', 'default'); + * // => 'default' + * + * _.result(object, 'a[0].b.c3', _.constant('default')); + * // => 'default' + */ + function result(object, path, defaultValue) { + path = castPath(path, object); + + var index = -1, + length = path.length; + + // Ensure the loop is entered when path is empty. + if (!length) { + length = 1; + object = undefined; + } + while (++index < length) { + var value = object == null ? undefined : object[toKey(path[index])]; + if (value === undefined) { + index = length; + value = defaultValue; + } + object = isFunction(value) ? value.call(object) : value; + } + return object; + } + + /** + * Sets the value at `path` of `object`. If a portion of `path` doesn't exist, + * it's created. Arrays are created for missing index properties while objects + * are created for all other missing properties. Use `_.setWith` to customize + * `path` creation. + * + * **Note:** This method mutates `object`. + * + * @static + * @memberOf _ + * @since 3.7.0 + * @category Object + * @param {Object} object The object to modify. + * @param {Array|string} path The path of the property to set. + * @param {*} value The value to set. + * @returns {Object} Returns `object`. + * @example + * + * var object = { 'a': [{ 'b': { 'c': 3 } }] }; + * + * _.set(object, 'a[0].b.c', 4); + * console.log(object.a[0].b.c); + * // => 4 + * + * _.set(object, ['x', '0', 'y', 'z'], 5); + * console.log(object.x[0].y.z); + * // => 5 + */ + function set(object, path, value) { + return object == null ? object : baseSet(object, path, value); + } + + /** + * This method is like `_.set` except that it accepts `customizer` which is + * invoked to produce the objects of `path`. If `customizer` returns `undefined` + * path creation is handled by the method instead. The `customizer` is invoked + * with three arguments: (nsValue, key, nsObject). + * + * **Note:** This method mutates `object`. + * + * @static + * @memberOf _ + * @since 4.0.0 + * @category Object + * @param {Object} object The object to modify. + * @param {Array|string} path The path of the property to set. + * @param {*} value The value to set. + * @param {Function} [customizer] The function to customize assigned values. + * @returns {Object} Returns `object`. + * @example + * + * var object = {}; + * + * _.setWith(object, '[0][1]', 'a', Object); + * // => { '0': { '1': 'a' } } + */ + function setWith(object, path, value, customizer) { + customizer = typeof customizer == 'function' ? customizer : undefined; + return object == null ? object : baseSet(object, path, value, customizer); + } + + /** + * Creates an array of own enumerable string keyed-value pairs for `object` + * which can be consumed by `_.fromPairs`. If `object` is a map or set, its + * entries are returned. + * + * @static + * @memberOf _ + * @since 4.0.0 + * @alias entries + * @category Object + * @param {Object} object The object to query. + * @returns {Array} Returns the key-value pairs. + * @example + * + * function Foo() { + * this.a = 1; + * this.b = 2; + * } + * + * Foo.prototype.c = 3; + * + * _.toPairs(new Foo); + * // => [['a', 1], ['b', 2]] (iteration order is not guaranteed) + */ + var toPairs = createToPairs(keys); + + /** + * Creates an array of own and inherited enumerable string keyed-value pairs + * for `object` which can be consumed by `_.fromPairs`. If `object` is a map + * or set, its entries are returned. + * + * @static + * @memberOf _ + * @since 4.0.0 + * @alias entriesIn + * @category Object + * @param {Object} object The object to query. + * @returns {Array} Returns the key-value pairs. + * @example + * + * function Foo() { + * this.a = 1; + * this.b = 2; + * } + * + * Foo.prototype.c = 3; + * + * _.toPairsIn(new Foo); + * // => [['a', 1], ['b', 2], ['c', 3]] (iteration order is not guaranteed) + */ + var toPairsIn = createToPairs(keysIn); + + /** + * An alternative to `_.reduce`; this method transforms `object` to a new + * `accumulator` object which is the result of running each of its own + * enumerable string keyed properties thru `iteratee`, with each invocation + * potentially mutating the `accumulator` object. If `accumulator` is not + * provided, a new object with the same `[[Prototype]]` will be used. The + * iteratee is invoked with four arguments: (accumulator, value, key, object). + * Iteratee functions may exit iteration early by explicitly returning `false`. + * + * @static + * @memberOf _ + * @since 1.3.0 + * @category Object + * @param {Object} object The object to iterate over. + * @param {Function} [iteratee=_.identity] The function invoked per iteration. + * @param {*} [accumulator] The custom accumulator value. + * @returns {*} Returns the accumulated value. + * @example + * + * _.transform([2, 3, 4], function(result, n) { + * result.push(n *= n); + * return n % 2 == 0; + * }, []); + * // => [4, 9] + * + * _.transform({ 'a': 1, 'b': 2, 'c': 1 }, function(result, value, key) { + * (result[value] || (result[value] = [])).push(key); + * }, {}); + * // => { '1': ['a', 'c'], '2': ['b'] } + */ + function transform(object, iteratee, accumulator) { + var isArr = isArray(object), + isArrLike = isArr || isBuffer(object) || isTypedArray(object); + + iteratee = getIteratee(iteratee, 4); + if (accumulator == null) { + var Ctor = object && object.constructor; + if (isArrLike) { + accumulator = isArr ? new Ctor : []; + } + else if (isObject(object)) { + accumulator = isFunction(Ctor) ? baseCreate(getPrototype(object)) : {}; + } + else { + accumulator = {}; + } + } + (isArrLike ? arrayEach : baseForOwn)(object, function(value, index, object) { + return iteratee(accumulator, value, index, object); + }); + return accumulator; + } + + /** + * Removes the property at `path` of `object`. + * + * **Note:** This method mutates `object`. + * + * @static + * @memberOf _ + * @since 4.0.0 + * @category Object + * @param {Object} object The object to modify. + * @param {Array|string} path The path of the property to unset. + * @returns {boolean} Returns `true` if the property is deleted, else `false`. + * @example + * + * var object = { 'a': [{ 'b': { 'c': 7 } }] }; + * _.unset(object, 'a[0].b.c'); + * // => true + * + * console.log(object); + * // => { 'a': [{ 'b': {} }] }; + * + * _.unset(object, ['a', '0', 'b', 'c']); + * // => true + * + * console.log(object); + * // => { 'a': [{ 'b': {} }] }; + */ + function unset(object, path) { + return object == null ? true : baseUnset(object, path); + } + + /** + * This method is like `_.set` except that accepts `updater` to produce the + * value to set. Use `_.updateWith` to customize `path` creation. The `updater` + * is invoked with one argument: (value). + * + * **Note:** This method mutates `object`. + * + * @static + * @memberOf _ + * @since 4.6.0 + * @category Object + * @param {Object} object The object to modify. + * @param {Array|string} path The path of the property to set. + * @param {Function} updater The function to produce the updated value. + * @returns {Object} Returns `object`. + * @example + * + * var object = { 'a': [{ 'b': { 'c': 3 } }] }; + * + * _.update(object, 'a[0].b.c', function(n) { return n * n; }); + * console.log(object.a[0].b.c); + * // => 9 + * + * _.update(object, 'x[0].y.z', function(n) { return n ? n + 1 : 0; }); + * console.log(object.x[0].y.z); + * // => 0 + */ + function update(object, path, updater) { + return object == null ? object : baseUpdate(object, path, castFunction(updater)); + } + + /** + * This method is like `_.update` except that it accepts `customizer` which is + * invoked to produce the objects of `path`. If `customizer` returns `undefined` + * path creation is handled by the method instead. The `customizer` is invoked + * with three arguments: (nsValue, key, nsObject). + * + * **Note:** This method mutates `object`. + * + * @static + * @memberOf _ + * @since 4.6.0 + * @category Object + * @param {Object} object The object to modify. + * @param {Array|string} path The path of the property to set. + * @param {Function} updater The function to produce the updated value. + * @param {Function} [customizer] The function to customize assigned values. + * @returns {Object} Returns `object`. + * @example + * + * var object = {}; + * + * _.updateWith(object, '[0][1]', _.constant('a'), Object); + * // => { '0': { '1': 'a' } } + */ + function updateWith(object, path, updater, customizer) { + customizer = typeof customizer == 'function' ? customizer : undefined; + return object == null ? object : baseUpdate(object, path, castFunction(updater), customizer); + } + + /** + * Creates an array of the own enumerable string keyed property values of `object`. + * + * **Note:** Non-object values are coerced to objects. + * + * @static + * @since 0.1.0 + * @memberOf _ + * @category Object + * @param {Object} object The object to query. + * @returns {Array} Returns the array of property values. + * @example + * + * function Foo() { + * this.a = 1; + * this.b = 2; + * } + * + * Foo.prototype.c = 3; + * + * _.values(new Foo); + * // => [1, 2] (iteration order is not guaranteed) + * + * _.values('hi'); + * // => ['h', 'i'] + */ + function values(object) { + return object == null ? [] : baseValues(object, keys(object)); + } + + /** + * Creates an array of the own and inherited enumerable string keyed property + * values of `object`. + * + * **Note:** Non-object values are coerced to objects. + * + * @static + * @memberOf _ + * @since 3.0.0 + * @category Object + * @param {Object} object The object to query. + * @returns {Array} Returns the array of property values. + * @example + * + * function Foo() { + * this.a = 1; + * this.b = 2; + * } + * + * Foo.prototype.c = 3; + * + * _.valuesIn(new Foo); + * // => [1, 2, 3] (iteration order is not guaranteed) + */ + function valuesIn(object) { + return object == null ? [] : baseValues(object, keysIn(object)); + } + + /*------------------------------------------------------------------------*/ + + /** + * Clamps `number` within the inclusive `lower` and `upper` bounds. + * + * @static + * @memberOf _ + * @since 4.0.0 + * @category Number + * @param {number} number The number to clamp. + * @param {number} [lower] The lower bound. + * @param {number} upper The upper bound. + * @returns {number} Returns the clamped number. + * @example + * + * _.clamp(-10, -5, 5); + * // => -5 + * + * _.clamp(10, -5, 5); + * // => 5 + */ + function clamp(number, lower, upper) { + if (upper === undefined) { + upper = lower; + lower = undefined; + } + if (upper !== undefined) { + upper = toNumber(upper); + upper = upper === upper ? upper : 0; + } + if (lower !== undefined) { + lower = toNumber(lower); + lower = lower === lower ? lower : 0; + } + return baseClamp(toNumber(number), lower, upper); + } + + /** + * Checks if `n` is between `start` and up to, but not including, `end`. If + * `end` is not specified, it's set to `start` with `start` then set to `0`. + * If `start` is greater than `end` the params are swapped to support + * negative ranges. + * + * @static + * @memberOf _ + * @since 3.3.0 + * @category Number + * @param {number} number The number to check. + * @param {number} [start=0] The start of the range. + * @param {number} end The end of the range. + * @returns {boolean} Returns `true` if `number` is in the range, else `false`. + * @see _.range, _.rangeRight + * @example + * + * _.inRange(3, 2, 4); + * // => true + * + * _.inRange(4, 8); + * // => true + * + * _.inRange(4, 2); + * // => false + * + * _.inRange(2, 2); + * // => false + * + * _.inRange(1.2, 2); + * // => true + * + * _.inRange(5.2, 4); + * // => false + * + * _.inRange(-3, -2, -6); + * // => true + */ + function inRange(number, start, end) { + start = toFinite(start); + if (end === undefined) { + end = start; + start = 0; + } else { + end = toFinite(end); + } + number = toNumber(number); + return baseInRange(number, start, end); + } + + /** + * Produces a random number between the inclusive `lower` and `upper` bounds. + * If only one argument is provided a number between `0` and the given number + * is returned. If `floating` is `true`, or either `lower` or `upper` are + * floats, a floating-point number is returned instead of an integer. + * + * **Note:** JavaScript follows the IEEE-754 standard for resolving + * floating-point values which can produce unexpected results. + * + * @static + * @memberOf _ + * @since 0.7.0 + * @category Number + * @param {number} [lower=0] The lower bound. + * @param {number} [upper=1] The upper bound. + * @param {boolean} [floating] Specify returning a floating-point number. + * @returns {number} Returns the random number. + * @example + * + * _.random(0, 5); + * // => an integer between 0 and 5 + * + * _.random(5); + * // => also an integer between 0 and 5 + * + * _.random(5, true); + * // => a floating-point number between 0 and 5 + * + * _.random(1.2, 5.2); + * // => a floating-point number between 1.2 and 5.2 + */ + function random(lower, upper, floating) { + if (floating && typeof floating != 'boolean' && isIterateeCall(lower, upper, floating)) { + upper = floating = undefined; + } + if (floating === undefined) { + if (typeof upper == 'boolean') { + floating = upper; + upper = undefined; + } + else if (typeof lower == 'boolean') { + floating = lower; + lower = undefined; + } + } + if (lower === undefined && upper === undefined) { + lower = 0; + upper = 1; + } + else { + lower = toFinite(lower); + if (upper === undefined) { + upper = lower; + lower = 0; + } else { + upper = toFinite(upper); + } + } + if (lower > upper) { + var temp = lower; + lower = upper; + upper = temp; + } + if (floating || lower % 1 || upper % 1) { + var rand = nativeRandom(); + return nativeMin(lower + (rand * (upper - lower + freeParseFloat('1e-' + ((rand + '').length - 1)))), upper); + } + return baseRandom(lower, upper); + } + + /*------------------------------------------------------------------------*/ + + /** + * Converts `string` to [camel case](https://en.wikipedia.org/wiki/CamelCase). + * + * @static + * @memberOf _ + * @since 3.0.0 + * @category String + * @param {string} [string=''] The string to convert. + * @returns {string} Returns the camel cased string. + * @example + * + * _.camelCase('Foo Bar'); + * // => 'fooBar' + * + * _.camelCase('--foo-bar--'); + * // => 'fooBar' + * + * _.camelCase('__FOO_BAR__'); + * // => 'fooBar' + */ + var camelCase = createCompounder(function(result, word, index) { + word = word.toLowerCase(); + return result + (index ? capitalize(word) : word); + }); + + /** + * Converts the first character of `string` to upper case and the remaining + * to lower case. + * + * @static + * @memberOf _ + * @since 3.0.0 + * @category String + * @param {string} [string=''] The string to capitalize. + * @returns {string} Returns the capitalized string. + * @example + * + * _.capitalize('FRED'); + * // => 'Fred' + */ + function capitalize(string) { + return upperFirst(toString(string).toLowerCase()); + } + + /** + * Deburrs `string` by converting + * [Latin-1 Supplement](https://en.wikipedia.org/wiki/Latin-1_Supplement_(Unicode_block)#Character_table) + * and [Latin Extended-A](https://en.wikipedia.org/wiki/Latin_Extended-A) + * letters to basic Latin letters and removing + * [combining diacritical marks](https://en.wikipedia.org/wiki/Combining_Diacritical_Marks). + * + * @static + * @memberOf _ + * @since 3.0.0 + * @category String + * @param {string} [string=''] The string to deburr. + * @returns {string} Returns the deburred string. + * @example + * + * _.deburr('déjà vu'); + * // => 'deja vu' + */ + function deburr(string) { + string = toString(string); + return string && string.replace(reLatin, deburrLetter).replace(reComboMark, ''); + } + + /** + * Checks if `string` ends with the given target string. + * + * @static + * @memberOf _ + * @since 3.0.0 + * @category String + * @param {string} [string=''] The string to inspect. + * @param {string} [target] The string to search for. + * @param {number} [position=string.length] The position to search up to. + * @returns {boolean} Returns `true` if `string` ends with `target`, + * else `false`. + * @example + * + * _.endsWith('abc', 'c'); + * // => true + * + * _.endsWith('abc', 'b'); + * // => false + * + * _.endsWith('abc', 'b', 2); + * // => true + */ + function endsWith(string, target, position) { + string = toString(string); + target = baseToString(target); + + var length = string.length; + position = position === undefined + ? length + : baseClamp(toInteger(position), 0, length); + + var end = position; + position -= target.length; + return position >= 0 && string.slice(position, end) == target; + } + + /** + * Converts the characters "&", "<", ">", '"', and "'" in `string` to their + * corresponding HTML entities. + * + * **Note:** No other characters are escaped. To escape additional + * characters use a third-party library like [_he_](https://mths.be/he). + * + * Though the ">" character is escaped for symmetry, characters like + * ">" and "/" don't need escaping in HTML and have no special meaning + * unless they're part of a tag or unquoted attribute value. See + * [Mathias Bynens's article](https://mathiasbynens.be/notes/ambiguous-ampersands) + * (under "semi-related fun fact") for more details. + * + * When working with HTML you should always + * [quote attribute values](http://wonko.com/post/html-escaping) to reduce + * XSS vectors. + * + * @static + * @since 0.1.0 + * @memberOf _ + * @category String + * @param {string} [string=''] The string to escape. + * @returns {string} Returns the escaped string. + * @example + * + * _.escape('fred, barney, & pebbles'); + * // => 'fred, barney, & pebbles' + */ + function escape(string) { + string = toString(string); + return (string && reHasUnescapedHtml.test(string)) + ? string.replace(reUnescapedHtml, escapeHtmlChar) + : string; + } + + /** + * Escapes the `RegExp` special characters "^", "$", "\", ".", "*", "+", + * "?", "(", ")", "[", "]", "{", "}", and "|" in `string`. + * + * @static + * @memberOf _ + * @since 3.0.0 + * @category String + * @param {string} [string=''] The string to escape. + * @returns {string} Returns the escaped string. + * @example + * + * _.escapeRegExp('[lodash](https://lodash.com/)'); + * // => '\[lodash\]\(https://lodash\.com/\)' + */ + function escapeRegExp(string) { + string = toString(string); + return (string && reHasRegExpChar.test(string)) + ? string.replace(reRegExpChar, '\\$&') + : string; + } + + /** + * Converts `string` to + * [kebab case](https://en.wikipedia.org/wiki/Letter_case#Special_case_styles). + * + * @static + * @memberOf _ + * @since 3.0.0 + * @category String + * @param {string} [string=''] The string to convert. + * @returns {string} Returns the kebab cased string. + * @example + * + * _.kebabCase('Foo Bar'); + * // => 'foo-bar' + * + * _.kebabCase('fooBar'); + * // => 'foo-bar' + * + * _.kebabCase('__FOO_BAR__'); + * // => 'foo-bar' + */ + var kebabCase = createCompounder(function(result, word, index) { + return result + (index ? '-' : '') + word.toLowerCase(); + }); + + /** + * Converts `string`, as space separated words, to lower case. + * + * @static + * @memberOf _ + * @since 4.0.0 + * @category String + * @param {string} [string=''] The string to convert. + * @returns {string} Returns the lower cased string. + * @example + * + * _.lowerCase('--Foo-Bar--'); + * // => 'foo bar' + * + * _.lowerCase('fooBar'); + * // => 'foo bar' + * + * _.lowerCase('__FOO_BAR__'); + * // => 'foo bar' + */ + var lowerCase = createCompounder(function(result, word, index) { + return result + (index ? ' ' : '') + word.toLowerCase(); + }); + + /** + * Converts the first character of `string` to lower case. + * + * @static + * @memberOf _ + * @since 4.0.0 + * @category String + * @param {string} [string=''] The string to convert. + * @returns {string} Returns the converted string. + * @example + * + * _.lowerFirst('Fred'); + * // => 'fred' + * + * _.lowerFirst('FRED'); + * // => 'fRED' + */ + var lowerFirst = createCaseFirst('toLowerCase'); + + /** + * Pads `string` on the left and right sides if it's shorter than `length`. + * Padding characters are truncated if they can't be evenly divided by `length`. + * + * @static + * @memberOf _ + * @since 3.0.0 + * @category String + * @param {string} [string=''] The string to pad. + * @param {number} [length=0] The padding length. + * @param {string} [chars=' '] The string used as padding. + * @returns {string} Returns the padded string. + * @example + * + * _.pad('abc', 8); + * // => ' abc ' + * + * _.pad('abc', 8, '_-'); + * // => '_-abc_-_' + * + * _.pad('abc', 3); + * // => 'abc' + */ + function pad(string, length, chars) { + string = toString(string); + length = toInteger(length); + + var strLength = length ? stringSize(string) : 0; + if (!length || strLength >= length) { + return string; + } + var mid = (length - strLength) / 2; + return ( + createPadding(nativeFloor(mid), chars) + + string + + createPadding(nativeCeil(mid), chars) + ); + } + + /** + * Pads `string` on the right side if it's shorter than `length`. Padding + * characters are truncated if they exceed `length`. + * + * @static + * @memberOf _ + * @since 4.0.0 + * @category String + * @param {string} [string=''] The string to pad. + * @param {number} [length=0] The padding length. + * @param {string} [chars=' '] The string used as padding. + * @returns {string} Returns the padded string. + * @example + * + * _.padEnd('abc', 6); + * // => 'abc ' + * + * _.padEnd('abc', 6, '_-'); + * // => 'abc_-_' + * + * _.padEnd('abc', 3); + * // => 'abc' + */ + function padEnd(string, length, chars) { + string = toString(string); + length = toInteger(length); + + var strLength = length ? stringSize(string) : 0; + return (length && strLength < length) + ? (string + createPadding(length - strLength, chars)) + : string; + } + + /** + * Pads `string` on the left side if it's shorter than `length`. Padding + * characters are truncated if they exceed `length`. + * + * @static + * @memberOf _ + * @since 4.0.0 + * @category String + * @param {string} [string=''] The string to pad. + * @param {number} [length=0] The padding length. + * @param {string} [chars=' '] The string used as padding. + * @returns {string} Returns the padded string. + * @example + * + * _.padStart('abc', 6); + * // => ' abc' + * + * _.padStart('abc', 6, '_-'); + * // => '_-_abc' + * + * _.padStart('abc', 3); + * // => 'abc' + */ + function padStart(string, length, chars) { + string = toString(string); + length = toInteger(length); + + var strLength = length ? stringSize(string) : 0; + return (length && strLength < length) + ? (createPadding(length - strLength, chars) + string) + : string; + } + + /** + * Converts `string` to an integer of the specified radix. If `radix` is + * `undefined` or `0`, a `radix` of `10` is used unless `value` is a + * hexadecimal, in which case a `radix` of `16` is used. + * + * **Note:** This method aligns with the + * [ES5 implementation](https://es5.github.io/#x15.1.2.2) of `parseInt`. + * + * @static + * @memberOf _ + * @since 1.1.0 + * @category String + * @param {string} string The string to convert. + * @param {number} [radix=10] The radix to interpret `value` by. + * @param- {Object} [guard] Enables use as an iteratee for methods like `_.map`. + * @returns {number} Returns the converted integer. + * @example + * + * _.parseInt('08'); + * // => 8 + * + * _.map(['6', '08', '10'], _.parseInt); + * // => [6, 8, 10] + */ + function parseInt(string, radix, guard) { + if (guard || radix == null) { + radix = 0; + } else if (radix) { + radix = +radix; + } + return nativeParseInt(toString(string).replace(reTrimStart, ''), radix || 0); + } + + /** + * Repeats the given string `n` times. + * + * @static + * @memberOf _ + * @since 3.0.0 + * @category String + * @param {string} [string=''] The string to repeat. + * @param {number} [n=1] The number of times to repeat the string. + * @param- {Object} [guard] Enables use as an iteratee for methods like `_.map`. + * @returns {string} Returns the repeated string. + * @example + * + * _.repeat('*', 3); + * // => '***' + * + * _.repeat('abc', 2); + * // => 'abcabc' + * + * _.repeat('abc', 0); + * // => '' + */ + function repeat(string, n, guard) { + if ((guard ? isIterateeCall(string, n, guard) : n === undefined)) { + n = 1; + } else { + n = toInteger(n); + } + return baseRepeat(toString(string), n); + } + + /** + * Replaces matches for `pattern` in `string` with `replacement`. + * + * **Note:** This method is based on + * [`String#replace`](https://mdn.io/String/replace). + * + * @static + * @memberOf _ + * @since 4.0.0 + * @category String + * @param {string} [string=''] The string to modify. + * @param {RegExp|string} pattern The pattern to replace. + * @param {Function|string} replacement The match replacement. + * @returns {string} Returns the modified string. + * @example + * + * _.replace('Hi Fred', 'Fred', 'Barney'); + * // => 'Hi Barney' + */ + function replace() { + var args = arguments, + string = toString(args[0]); + + return args.length < 3 ? string : string.replace(args[1], args[2]); + } + + /** + * Converts `string` to + * [snake case](https://en.wikipedia.org/wiki/Snake_case). + * + * @static + * @memberOf _ + * @since 3.0.0 + * @category String + * @param {string} [string=''] The string to convert. + * @returns {string} Returns the snake cased string. + * @example + * + * _.snakeCase('Foo Bar'); + * // => 'foo_bar' + * + * _.snakeCase('fooBar'); + * // => 'foo_bar' + * + * _.snakeCase('--FOO-BAR--'); + * // => 'foo_bar' + */ + var snakeCase = createCompounder(function(result, word, index) { + return result + (index ? '_' : '') + word.toLowerCase(); + }); + + /** + * Splits `string` by `separator`. + * + * **Note:** This method is based on + * [`String#split`](https://mdn.io/String/split). + * + * @static + * @memberOf _ + * @since 4.0.0 + * @category String + * @param {string} [string=''] The string to split. + * @param {RegExp|string} separator The separator pattern to split by. + * @param {number} [limit] The length to truncate results to. + * @returns {Array} Returns the string segments. + * @example + * + * _.split('a-b-c', '-', 2); + * // => ['a', 'b'] + */ + function split(string, separator, limit) { + if (limit && typeof limit != 'number' && isIterateeCall(string, separator, limit)) { + separator = limit = undefined; + } + limit = limit === undefined ? MAX_ARRAY_LENGTH : limit >>> 0; + if (!limit) { + return []; + } + string = toString(string); + if (string && ( + typeof separator == 'string' || + (separator != null && !isRegExp(separator)) + )) { + separator = baseToString(separator); + if (!separator && hasUnicode(string)) { + return castSlice(stringToArray(string), 0, limit); + } + } + return string.split(separator, limit); + } + + /** + * Converts `string` to + * [start case](https://en.wikipedia.org/wiki/Letter_case#Stylistic_or_specialised_usage). + * + * @static + * @memberOf _ + * @since 3.1.0 + * @category String + * @param {string} [string=''] The string to convert. + * @returns {string} Returns the start cased string. + * @example + * + * _.startCase('--foo-bar--'); + * // => 'Foo Bar' + * + * _.startCase('fooBar'); + * // => 'Foo Bar' + * + * _.startCase('__FOO_BAR__'); + * // => 'FOO BAR' + */ + var startCase = createCompounder(function(result, word, index) { + return result + (index ? ' ' : '') + upperFirst(word); + }); + + /** + * Checks if `string` starts with the given target string. + * + * @static + * @memberOf _ + * @since 3.0.0 + * @category String + * @param {string} [string=''] The string to inspect. + * @param {string} [target] The string to search for. + * @param {number} [position=0] The position to search from. + * @returns {boolean} Returns `true` if `string` starts with `target`, + * else `false`. + * @example + * + * _.startsWith('abc', 'a'); + * // => true + * + * _.startsWith('abc', 'b'); + * // => false + * + * _.startsWith('abc', 'b', 1); + * // => true + */ + function startsWith(string, target, position) { + string = toString(string); + position = position == null + ? 0 + : baseClamp(toInteger(position), 0, string.length); + + target = baseToString(target); + return string.slice(position, position + target.length) == target; + } + + /** + * Creates a compiled template function that can interpolate data properties + * in "interpolate" delimiters, HTML-escape interpolated data properties in + * "escape" delimiters, and execute JavaScript in "evaluate" delimiters. Data + * properties may be accessed as free variables in the template. If a setting + * object is given, it takes precedence over `_.templateSettings` values. + * + * **Note:** In the development build `_.template` utilizes + * [sourceURLs](http://www.html5rocks.com/en/tutorials/developertools/sourcemaps/#toc-sourceurl) + * for easier debugging. + * + * For more information on precompiling templates see + * [lodash's custom builds documentation](https://lodash.com/custom-builds). + * + * For more information on Chrome extension sandboxes see + * [Chrome's extensions documentation](https://developer.chrome.com/extensions/sandboxingEval). + * + * @static + * @since 0.1.0 + * @memberOf _ + * @category String + * @param {string} [string=''] The template string. + * @param {Object} [options={}] The options object. + * @param {RegExp} [options.escape=_.templateSettings.escape] + * The HTML "escape" delimiter. + * @param {RegExp} [options.evaluate=_.templateSettings.evaluate] + * The "evaluate" delimiter. + * @param {Object} [options.imports=_.templateSettings.imports] + * An object to import into the template as free variables. + * @param {RegExp} [options.interpolate=_.templateSettings.interpolate] + * The "interpolate" delimiter. + * @param {string} [options.sourceURL='lodash.templateSources[n]'] + * The sourceURL of the compiled template. + * @param {string} [options.variable='obj'] + * The data object variable name. + * @param- {Object} [guard] Enables use as an iteratee for methods like `_.map`. + * @returns {Function} Returns the compiled template function. + * @example + * + * // Use the "interpolate" delimiter to create a compiled template. + * var compiled = _.template('hello <%= user %>!'); + * compiled({ 'user': 'fred' }); + * // => 'hello fred!' + * + * // Use the HTML "escape" delimiter to escape data property values. + * var compiled = _.template('<%- value %>'); + * compiled({ 'value': '